From cc15dcbe243e4ef4b23cb71e7808a0de982f8584 Mon Sep 17 00:00:00 2001 From: support Date: Tue, 11 Oct 2022 05:56:46 +0000 Subject: [PATCH] Built motion from commit b5de439f.|2.6.19 --- 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 360677e..27389f4 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-10-10T15:42:45.274Z", + "time": "2022-10-11T05:38:31.990Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a91504c..6307895 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-10T15:42:45.274Z", + "time": "2022-10-11T05:38:31.990Z", "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 26d00cb..38635f5 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 _0x5b9c=['action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','VIRTUAL','getDataValue'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0x5b9c,0x152));var _0xc5b9=function(_0xf3ea08,_0x586699){_0xf3ea08=_0xf3ea08-0x0;var _0x24b7c1=_0x5b9c[_0xf3ea08];return _0x24b7c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc5b9('0x0')],'get':function(_0x1d9cb1){return this[_0xc5b9('0x1')](_0xc5b9('0x2'));}},'action':{'type':Sequelize[_0xc5b9('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc5b9('0x4'),'integration',_0xc5b9('0x5'),_0xc5b9('0x6'),_0xc5b9('0x7'),_0xc5b9('0x8'),_0xc5b9('0x9'),_0xc5b9('0xa')]],'msg':_0xc5b9('0xb')}},'comment':_0xc5b9('0xb')},'data1':{'type':Sequelize[_0xc5b9('0x3')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xc5b9('0x3')](0x1000),'comment':_0xc5b9('0xc')},'data3':{'type':Sequelize[_0xc5b9('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xc5b9('0xd')},'data5':{'type':Sequelize[_0xc5b9('0x3')](0x1000),'comments':_0xc5b9('0xe')},'data6':{'type':Sequelize[_0xc5b9('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xc5b9('0xf')],'comments':_0xc5b9('0x10')}}; \ No newline at end of file +var _0xfe92=['integration','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','sequelize','exports','getDataValue','action','STRING','contactManager'];(function(_0x3d61dd,_0xc0e9c6){var _0x3d5332=function(_0x1e437){while(--_0x1e437){_0x3d61dd['push'](_0x3d61dd['shift']());}};_0x3d5332(++_0xc0e9c6);}(_0xfe92,0x174));var _0x2fe9=function(_0x26a382,_0x3d54db){_0x26a382=_0x26a382-0x0;var _0x14f9c8=_0xfe92[_0x26a382];return _0x14f9c8;};'use strict';var Sequelize=require(_0x2fe9('0x0'));module[_0x2fe9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3803db){return this[_0x2fe9('0x2')](_0x2fe9('0x3'));}},'action':{'type':Sequelize[_0x2fe9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2fe9('0x5'),_0x2fe9('0x6'),_0x2fe9('0x7'),_0x2fe9('0x8'),'urlForward',_0x2fe9('0x9'),_0x2fe9('0xa'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2fe9('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x2fe9('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x2fe9('0xc')},'data4':{'type':Sequelize[_0x2fe9('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x2fe9('0x4')](0x1000),'comments':_0x2fe9('0xd')},'data6':{'type':Sequelize[_0x2fe9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3a318b6..bd869ff 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 _0x59ff=['stack','name','send','body','catch','Action','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x11edd0,_0x2c9aa0){var _0x47d5ca=function(_0x189646){while(--_0x189646){_0x11edd0['push'](_0x11edd0['shift']());}};_0x47d5ca(++_0x2c9aa0);}(_0x59ff,0xc7));var _0xf59f=function(_0xd4a133,_0x2dabb4){_0xd4a133=_0xd4a133-0x0;var _0x36c65d=_0x59ff[_0xd4a133];return _0x36c65d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf59f('0x0'));var zipdir=require(_0xf59f('0x1'));var jsonpatch=require(_0xf59f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf59f('0x3'));var Mustache=require(_0xf59f('0x4'));var util=require(_0xf59f('0x5'));var path=require('path');var sox=require(_0xf59f('0x6'));var csv=require(_0xf59f('0x7'));var ejs=require(_0xf59f('0x8'));var fs=require('fs');var fs_extra=require(_0xf59f('0x9'));var _=require(_0xf59f('0xa'));var squel=require(_0xf59f('0xb'));var crypto=require(_0xf59f('0xc'));var jsforce=require(_0xf59f('0xd'));var deskjs=require(_0xf59f('0xe'));var toCsv=require(_0xf59f('0x7'));var querystring=require(_0xf59f('0xf'));var Papa=require(_0xf59f('0x10'));var Redis=require(_0xf59f('0x11'));var authService=require(_0xf59f('0x12'));var qs=require(_0xf59f('0x13'));var as=require(_0xf59f('0x14'));var hardwareService=require(_0xf59f('0x15'));var logger=require(_0xf59f('0x16'))('api');var utils=require(_0xf59f('0x17'));var config=require(_0xf59f('0x18'));var licenseUtil=require(_0xf59f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40bd29,_0x3b6915){_0x3b6915=_0x3b6915||0xcc;return function(_0x243873){if(_0x243873){return _0x40bd29[_0xf59f('0x1a')](_0x3b6915);}return _0x40bd29[_0xf59f('0x1b')](_0x3b6915)[_0xf59f('0x1c')]();};}function respondWithResult(_0x2840b7,_0x20956b){_0x20956b=_0x20956b||0xc8;return function(_0x4b9a71){if(_0x4b9a71){return _0x2840b7[_0xf59f('0x1b')](_0x20956b)[_0xf59f('0x1d')](_0x4b9a71);}};}function respondWithFilteredResult(_0x35b67f,_0xc3d6ef){return function(_0x2879a3){if(_0x2879a3){var _0x170830=typeof _0xc3d6ef['offset']===_0xf59f('0x1e')&&typeof _0xc3d6ef[_0xf59f('0x1f')]===_0xf59f('0x1e');var _0x516c15=_0x2879a3[_0xf59f('0x20')];var _0x33bd1e=_0x170830?0x0:_0xc3d6ef[_0xf59f('0x21')];var _0x3b9907=_0x170830?_0x2879a3[_0xf59f('0x20')]:_0xc3d6ef[_0xf59f('0x21')]+_0xc3d6ef[_0xf59f('0x1f')];var _0x44fa0b;if(_0x3b9907>=_0x516c15){_0x3b9907=_0x516c15;_0x44fa0b=0xc8;}else{_0x44fa0b=0xce;}_0x35b67f['status'](_0x44fa0b);return _0x35b67f['set'](_0xf59f('0x22'),_0x33bd1e+'-'+_0x3b9907+'/'+_0x516c15)[_0xf59f('0x1d')](_0x2879a3);}return null;};}function patchUpdates(_0x235b32){return function(_0x1a79f8){try{jsonpatch[_0xf59f('0x23')](_0x1a79f8,_0x235b32,!![]);}catch(_0x4d7c6e){return BPromise[_0xf59f('0x24')](_0x4d7c6e);}return _0x1a79f8['save']();};}function saveUpdates(_0x3032e2,_0x6fb85e){return function(_0x1a6a81){if(_0x1a6a81){return _0x1a6a81[_0xf59f('0x25')](_0x3032e2)[_0xf59f('0x26')](function(_0x301a11){return _0x301a11;});}return null;};}function removeEntity(_0x325cab,_0xef35e6){return function(_0x435235){if(_0x435235){return _0x435235[_0xf59f('0x27')]()[_0xf59f('0x26')](function(){_0x325cab[_0xf59f('0x1b')](0xcc)[_0xf59f('0x1c')]();});}};}function handleEntityNotFound(_0x88b9bb,_0x132fae){return function(_0x228a9e){if(!_0x228a9e){_0x88b9bb['sendStatus'](0x194);}return _0x228a9e;};}function handleError(_0x5af222,_0x69a1bb){_0x69a1bb=_0x69a1bb||0x1f4;return function(_0x1f55e3){logger[_0xf59f('0x28')](_0x1f55e3[_0xf59f('0x29')]);if(_0x1f55e3[_0xf59f('0x2a')]){delete _0x1f55e3[_0xf59f('0x2a')];}_0x5af222[_0xf59f('0x1b')](_0x69a1bb)[_0xf59f('0x2b')](_0x1f55e3);};}exports[_0xf59f('0x25')]=function(_0x54ac5f,_0x1b0498){if(_0x54ac5f['body']['id']){delete _0x54ac5f[_0xf59f('0x2c')]['id'];}return db['Action']['find']({'where':{'id':_0x54ac5f['params']['id']}})[_0xf59f('0x26')](handleEntityNotFound(_0x1b0498,null))[_0xf59f('0x26')](saveUpdates(_0x54ac5f[_0xf59f('0x2c')],null))[_0xf59f('0x26')](respondWithResult(_0x1b0498,null))[_0xf59f('0x2d')](handleError(_0x1b0498,null));};exports[_0xf59f('0x27')]=function(_0x15d1ba,_0x185a6d){return db[_0xf59f('0x2e')]['find']({'where':{'id':_0x15d1ba[_0xf59f('0x2f')]['id']}})[_0xf59f('0x26')](handleEntityNotFound(_0x185a6d,null))[_0xf59f('0x26')](removeEntity(_0x185a6d,null))[_0xf59f('0x2d')](handleError(_0x185a6d,null));}; \ No newline at end of file +var _0x5df8=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit'];(function(_0x1b3bbc,_0x244c09){var _0x5ce037=function(_0x21384c){while(--_0x21384c){_0x1b3bbc['push'](_0x1b3bbc['shift']());}};_0x5ce037(++_0x244c09);}(_0x5df8,0xdb));var _0x85df=function(_0x4c5f3e,_0x3c6f97){_0x4c5f3e=_0x4c5f3e-0x0;var _0x31ca51=_0x5df8[_0x4c5f3e];return _0x31ca51;};'use strict';var emlformat=require(_0x85df('0x0'));var rimraf=require(_0x85df('0x1'));var zipdir=require(_0x85df('0x2'));var jsonpatch=require(_0x85df('0x3'));var rp=require(_0x85df('0x4'));var moment=require(_0x85df('0x5'));var BPromise=require(_0x85df('0x6'));var Mustache=require('mustache');var util=require(_0x85df('0x7'));var path=require(_0x85df('0x8'));var sox=require(_0x85df('0x9'));var csv=require(_0x85df('0xa'));var ejs=require(_0x85df('0xb'));var fs=require('fs');var fs_extra=require(_0x85df('0xc'));var _=require('lodash');var squel=require(_0x85df('0xd'));var crypto=require(_0x85df('0xe'));var jsforce=require(_0x85df('0xf'));var deskjs=require(_0x85df('0x10'));var toCsv=require('to-csv');var querystring=require(_0x85df('0x11'));var Papa=require(_0x85df('0x12'));var Redis=require('ioredis');var authService=require(_0x85df('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85df('0x14'));var utils=require(_0x85df('0x15'));var config=require(_0x85df('0x16'));var licenseUtil=require(_0x85df('0x17'));var db=require(_0x85df('0x18'))['db'];function respondWithStatusCode(_0x229f5a,_0x27c16e){_0x27c16e=_0x27c16e||0xcc;return function(_0x35087f){if(_0x35087f){return _0x229f5a[_0x85df('0x19')](_0x27c16e);}return _0x229f5a['status'](_0x27c16e)[_0x85df('0x1a')]();};}function respondWithResult(_0x581f63,_0x4ed818){_0x4ed818=_0x4ed818||0xc8;return function(_0x561cf8){if(_0x561cf8){return _0x581f63[_0x85df('0x1b')](_0x4ed818)[_0x85df('0x1c')](_0x561cf8);}};}function respondWithFilteredResult(_0x23c059,_0x4c5993){return function(_0xc7a953){if(_0xc7a953){var _0x15e7fc=typeof _0x4c5993[_0x85df('0x1d')]==='undefined'&&typeof _0x4c5993[_0x85df('0x1e')]===_0x85df('0x1f');var _0x4a037d=_0xc7a953[_0x85df('0x20')];var _0x437afb=_0x15e7fc?0x0:_0x4c5993[_0x85df('0x1d')];var _0x22ce96=_0x15e7fc?_0xc7a953['count']:_0x4c5993[_0x85df('0x1d')]+_0x4c5993[_0x85df('0x1e')];var _0x43590e;if(_0x22ce96>=_0x4a037d){_0x22ce96=_0x4a037d;_0x43590e=0xc8;}else{_0x43590e=0xce;}_0x23c059[_0x85df('0x1b')](_0x43590e);return _0x23c059[_0x85df('0x21')](_0x85df('0x22'),_0x437afb+'-'+_0x22ce96+'/'+_0x4a037d)[_0x85df('0x1c')](_0xc7a953);}return null;};}function patchUpdates(_0x2238ec){return function(_0x7bf49d){try{jsonpatch[_0x85df('0x23')](_0x7bf49d,_0x2238ec,!![]);}catch(_0x3dea5a){return BPromise[_0x85df('0x24')](_0x3dea5a);}return _0x7bf49d[_0x85df('0x25')]();};}function saveUpdates(_0xf4b426,_0x50bcc6){return function(_0x245b2a){if(_0x245b2a){return _0x245b2a[_0x85df('0x26')](_0xf4b426)[_0x85df('0x27')](function(_0x17f780){return _0x17f780;});}return null;};}function removeEntity(_0x23bdf4,_0x2e6882){return function(_0x5cb728){if(_0x5cb728){return _0x5cb728[_0x85df('0x28')]()[_0x85df('0x27')](function(){_0x23bdf4[_0x85df('0x1b')](0xcc)[_0x85df('0x1a')]();});}};}function handleEntityNotFound(_0x46e387,_0xeb50f8){return function(_0x221fda){if(!_0x221fda){_0x46e387[_0x85df('0x19')](0x194);}return _0x221fda;};}function handleError(_0x1f7689,_0x2fac48){_0x2fac48=_0x2fac48||0x1f4;return function(_0x29059a){logger[_0x85df('0x29')](_0x29059a[_0x85df('0x2a')]);if(_0x29059a[_0x85df('0x2b')]){delete _0x29059a[_0x85df('0x2b')];}_0x1f7689[_0x85df('0x1b')](_0x2fac48)[_0x85df('0x2c')](_0x29059a);};}exports['update']=function(_0x149f1e,_0x1df841){if(_0x149f1e[_0x85df('0x2d')]['id']){delete _0x149f1e[_0x85df('0x2d')]['id'];}return db[_0x85df('0x2e')][_0x85df('0x2f')]({'where':{'id':_0x149f1e[_0x85df('0x30')]['id']}})['then'](handleEntityNotFound(_0x1df841,null))['then'](saveUpdates(_0x149f1e[_0x85df('0x2d')],null))[_0x85df('0x27')](respondWithResult(_0x1df841,null))[_0x85df('0x31')](handleError(_0x1df841,null));};exports[_0x85df('0x28')]=function(_0x5f4845,_0x66eac5){return db['Action'][_0x85df('0x2f')]({'where':{'id':_0x5f4845[_0x85df('0x30')]['id']}})[_0x85df('0x27')](handleEntityNotFound(_0x66eac5,null))[_0x85df('0x27')](removeEntity(_0x66eac5,null))['catch'](handleError(_0x66eac5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ecc530b..c34523c 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 _0x7f0d=['rimraf','./action.attributes','exports','define','bluebird','request-promise','path'];(function(_0xf5063f,_0x21a4ca){var _0x4fccd9=function(_0x2bda47){while(--_0x2bda47){_0xf5063f['push'](_0xf5063f['shift']());}};_0x4fccd9(++_0x21a4ca);}(_0x7f0d,0x89));var _0xd7f0=function(_0x1e3a9f,_0x1db617){_0x1e3a9f=_0x1e3a9f-0x0;var _0x150bed=_0x7f0d[_0x1e3a9f];return _0x150bed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd7f0('0x0'));var rp=require(_0xd7f0('0x1'));var fs=require('fs');var path=require(_0xd7f0('0x2'));var rimraf=require(_0xd7f0('0x3'));var config=require('../../config/environment');var attributes=require(_0xd7f0('0x4'));module[_0xd7f0('0x5')]=function(_0x53998a,_0x4ee4d4){return _0x53998a[_0xd7f0('0x6')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39ca=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x39ca,0xb7));var _0xa39c=function(_0x1df378,_0x2c4af3){_0x1df378=_0x1df378-0x0;var _0x2cb9fe=_0x39ca[_0x1df378];return _0x2cb9fe;};'use strict';var _=require(_0xa39c('0x0'));var util=require(_0xa39c('0x1'));var logger=require(_0xa39c('0x2'))(_0xa39c('0x3'));var moment=require(_0xa39c('0x4'));var BPromise=require(_0xa39c('0x5'));var rp=require(_0xa39c('0x6'));var fs=require('fs');var path=require(_0xa39c('0x7'));var rimraf=require(_0xa39c('0x8'));var config=require(_0xa39c('0x9'));var attributes=require(_0xa39c('0xa'));module[_0xa39c('0xb')]=function(_0x26d6e5,_0x5e34cf){return _0x26d6e5[_0xa39c('0xc')](_0xa39c('0xd'),attributes,{'tableName':_0xa39c('0xe'),'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 656c0b7..0ac6961 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x7217,0x19e));var _0x7721=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7217[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _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(_0x25a791,_0x1a59b5){var _0x368f42=function(_0x5717c7){while(--_0x5717c7){_0x25a791['push'](_0x25a791['shift']());}};_0x368f42(++_0x1a59b5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('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 40a11b3..c33da0c 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 _0x5fe6=['/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete'];(function(_0x2a9bea,_0x2201d4){var _0x331e3e=function(_0x2e7f80){while(--_0x2e7f80){_0x2a9bea['push'](_0x2a9bea['shift']());}};_0x331e3e(++_0x2201d4);}(_0x5fe6,0xf2));var _0x65fe=function(_0x134f4e,_0x3ab75d){_0x134f4e=_0x134f4e-0x0;var _0x2ef200=_0x5fe6[_0x134f4e];return _0x2ef200;};'use strict';var multer=require(_0x65fe('0x0'));var util=require(_0x65fe('0x1'));var path=require(_0x65fe('0x2'));var timeout=require(_0x65fe('0x3'));var express=require(_0x65fe('0x4'));var router=express[_0x65fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x65fe('0x6'));var interaction=require(_0x65fe('0x7'));var config=require(_0x65fe('0x8'));var controller=require(_0x65fe('0x9'));router[_0x65fe('0xa')]('/:id',auth[_0x65fe('0xb')](),controller['update']);router[_0x65fe('0xc')](_0x65fe('0xd'),auth[_0x65fe('0xb')](),controller[_0x65fe('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe4d6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x130b38,_0x52c443){var _0x1b394e=function(_0xfa9efb){while(--_0xfa9efb){_0x130b38['push'](_0x130b38['shift']());}};_0x1b394e(++_0x52c443);}(_0xe4d6,0x1da));var _0x6e4d=function(_0x1a54ca,_0x497d76){_0x1a54ca=_0x1a54ca-0x0;var _0x4f0d2c=_0xe4d6[_0x1a54ca];return _0x4f0d2c;};'use strict';var multer=require(_0x6e4d('0x0'));var util=require(_0x6e4d('0x1'));var path=require(_0x6e4d('0x2'));var timeout=require(_0x6e4d('0x3'));var express=require(_0x6e4d('0x4'));var router=express['Router']();var fs_extra=require(_0x6e4d('0x5'));var auth=require(_0x6e4d('0x6'));var interaction=require(_0x6e4d('0x7'));var config=require(_0x6e4d('0x8'));var controller=require(_0x6e4d('0x9'));router['put'](_0x6e4d('0xa'),auth[_0x6e4d('0xb')](),controller[_0x6e4d('0xc')]);router[_0x6e4d('0xd')](_0x6e4d('0xa'),auth['isAuthenticated'](),controller[_0x6e4d('0xe')]);module[_0x6e4d('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index b45c75b..8c2100e 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x5e7f8e,_0x4ae19e){var _0x4d79c4=function(_0x17afb1){while(--_0x17afb1){_0x5e7f8e['push'](_0x5e7f8e['shift']());}};_0x4d79c4(++_0x4ae19e);}(_0xa630,0xbe));var _0x0a63=function(_0x1bf3ec,_0x4b3afa){_0x1bf3ec=_0x1bf3ec-0x0;var _0x54fb48=_0xa630[_0x1bf3ec];return _0x54fb48;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x71ab=['TEXT','exports','STRING'];(function(_0x150f00,_0x2f6ff5){var _0x49d75d=function(_0x47b141){while(--_0x47b141){_0x150f00['push'](_0x150f00['shift']());}};_0x49d75d(++_0x2f6ff5);}(_0x71ab,0x64));var _0xb71a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x71ab[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 55bc03d..a8fa0d6 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 _0x6de2=['SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','IS\x20NULL','IS\x20EMPTY','operator','metric','alias','fullPath','randomstring','generate','output','AnalyticExtractedReport','table','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','json','apply','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','model','query','filters','intersection','attributes','fields','order','sort','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','create','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','parse','type','parentKey','foreignKey','foreignTable','conditions','where','clone','debug','toString','sequelize'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6de2,0x152));var _0x26de=function(_0x5d2a8b,_0x308855){_0x5d2a8b=_0x5d2a8b-0x0;var _0x352346=_0x6de2[_0x5d2a8b];return _0x352346;};'use strict';var emlformat=require(_0x26de('0x0'));var rimraf=require(_0x26de('0x1'));var zipdir=require(_0x26de('0x2'));var jsonpatch=require(_0x26de('0x3'));var rp=require(_0x26de('0x4'));var moment=require('moment');var BPromise=require(_0x26de('0x5'));var Mustache=require(_0x26de('0x6'));var util=require(_0x26de('0x7'));var path=require(_0x26de('0x8'));var sox=require(_0x26de('0x9'));var csv=require('to-csv');var ejs=require(_0x26de('0xa'));var fs=require('fs');var fs_extra=require(_0x26de('0xb'));var _=require(_0x26de('0xc'));var squel=require(_0x26de('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26de('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x26de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26de('0x10'));var as=require(_0x26de('0x11'));var hardwareService=require(_0x26de('0x12'));var logger=require(_0x26de('0x13'))('api');var utils=require(_0x26de('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x26de('0x15'));var db=require(_0x26de('0x16'))['db'];var dbH=require(_0x26de('0x16'))[_0x26de('0x17')];function respondWithStatusCode(_0x519622,_0x1e5660){_0x1e5660=_0x1e5660||0xcc;return function(_0x514063){if(_0x514063){return _0x519622[_0x26de('0x18')](_0x1e5660);}return _0x519622['status'](_0x1e5660)['end']();};}function respondWithResult(_0x55f509,_0x39555b){_0x39555b=_0x39555b||0xc8;return function(_0x532ab6){if(_0x532ab6){return _0x55f509[_0x26de('0x19')](_0x39555b)['json'](_0x532ab6);}};}function respondWithFilteredResult(_0x2a7b7e,_0x4d2657){return function(_0x99f382){if(_0x99f382){var _0xc5b528=typeof _0x4d2657[_0x26de('0x1a')]===_0x26de('0x1b')&&typeof _0x4d2657[_0x26de('0x1c')]==='undefined';var _0x3a1cab=_0x99f382['count'];var _0x5f1576=_0xc5b528?0x0:_0x4d2657[_0x26de('0x1a')];var _0x5d3819=_0xc5b528?_0x99f382[_0x26de('0x1d')]:_0x4d2657[_0x26de('0x1a')]+_0x4d2657['limit'];var _0x20e6ea;if(_0x5d3819>=_0x3a1cab){_0x5d3819=_0x3a1cab;_0x20e6ea=0xc8;}else{_0x20e6ea=0xce;}_0x2a7b7e[_0x26de('0x19')](_0x20e6ea);return _0x2a7b7e['set']('Content-Range',_0x5f1576+'-'+_0x5d3819+'/'+_0x3a1cab)[_0x26de('0x1e')](_0x99f382);}return null;};}function patchUpdates(_0x34a979){return function(_0x334745){try{jsonpatch[_0x26de('0x1f')](_0x334745,_0x34a979,!![]);}catch(_0x2ed740){return BPromise['reject'](_0x2ed740);}return _0x334745[_0x26de('0x20')]();};}function saveUpdates(_0x47e5e9,_0x2c5916){return function(_0x2c3d3f){if(_0x2c3d3f){return _0x2c3d3f[_0x26de('0x21')](_0x47e5e9)[_0x26de('0x22')](function(_0x437d03){return _0x437d03;});}return null;};}function removeEntity(_0x3bb86e,_0xa7e4a){return function(_0xd6f52a){if(_0xd6f52a){return _0xd6f52a[_0x26de('0x23')]()[_0x26de('0x22')](function(){var _0x1a07ff=_0xd6f52a['get']({'plain':!![]});var _0x5e046e=_0x26de('0x24');return db[_0x26de('0x25')][_0x26de('0x23')]({'where':{'type':_0x5e046e,'resourceId':_0x1a07ff['id']}})[_0x26de('0x22')](function(){return _0xd6f52a;});})['then'](function(){_0x3bb86e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ee6bd,_0x4fe9f7){return function(_0x5c311d){if(!_0x5c311d){_0x3ee6bd[_0x26de('0x18')](0x194);}return _0x5c311d;};}function handleError(_0x1f0131,_0x1372db){_0x1372db=_0x1372db||0x1f4;return function(_0x2c31f6){logger[_0x26de('0x26')](_0x2c31f6[_0x26de('0x27')]);if(_0x2c31f6[_0x26de('0x28')]){delete _0x2c31f6[_0x26de('0x28')];}_0x1f0131[_0x26de('0x19')](_0x1372db)[_0x26de('0x29')](_0x2c31f6);};}exports[_0x26de('0x2a')]=function(_0x268e68,_0x449c21){var _0x5a7727={},_0x1db5b9={},_0x54d868={'count':0x0,'rows':[]};var _0x33fd4e=_[_0x26de('0x2b')](db[_0x26de('0x2c')][_0x26de('0x2d')],function(_0x1c619e){return{'name':_0x1c619e['fieldName'],'type':_0x1c619e['type']['key']};});_0x1db5b9[_0x26de('0x2e')]=_['map'](_0x33fd4e,_0x26de('0x28'));_0x1db5b9[_0x26de('0x2f')]=_['keys'](_0x268e68['query']);_0x1db5b9[_0x26de('0x30')]=_[_0x26de('0x31')](_0x1db5b9[_0x26de('0x2e')],_0x1db5b9[_0x26de('0x2f')]);_0x5a7727[_0x26de('0x32')]=_[_0x26de('0x31')](_0x1db5b9['model'],qs[_0x26de('0x33')](_0x268e68[_0x26de('0x2f')][_0x26de('0x33')]));_0x5a7727[_0x26de('0x32')]=_0x5a7727[_0x26de('0x32')]['length']?_0x5a7727['attributes']:_0x1db5b9[_0x26de('0x2e')];if(!_0x268e68[_0x26de('0x2f')]['hasOwnProperty']('nolimit')){_0x5a7727['limit']=qs[_0x26de('0x1c')](_0x268e68[_0x26de('0x2f')][_0x26de('0x1c')]);_0x5a7727[_0x26de('0x1a')]=qs[_0x26de('0x1a')](_0x268e68[_0x26de('0x2f')]['offset']);}_0x5a7727[_0x26de('0x34')]=qs[_0x26de('0x35')](_0x268e68[_0x26de('0x2f')]['sort']);_0x5a7727['where']=qs[_0x26de('0x30')](_['pick'](_0x268e68[_0x26de('0x2f')],_0x1db5b9['filters']),_0x33fd4e);if(_0x268e68['query'][_0x26de('0x36')]){_0x5a7727['where']=_[_0x26de('0x37')](_0x5a7727['where'],{'$or':_[_0x26de('0x2b')](_0x33fd4e,function(_0x35b447){if(_0x35b447['type']!==_0x26de('0x38')){var _0x381ff5={};_0x381ff5[_0x35b447[_0x26de('0x28')]]={'$like':'%'+_0x268e68[_0x26de('0x2f')][_0x26de('0x36')]+'%'};return _0x381ff5;}})});}_0x5a7727=_[_0x26de('0x37')]({},_0x5a7727,_0x268e68[_0x26de('0x39')]);var _0x5b6f35={'where':_0x5a7727['where']};return db[_0x26de('0x2c')][_0x26de('0x1d')](_0x5b6f35)[_0x26de('0x22')](function(_0x4cf668){_0x54d868[_0x26de('0x1d')]=_0x4cf668;if(_0x268e68['query']['includeAll']){_0x5a7727[_0x26de('0x3a')]=[{'all':!![]}];}return db[_0x26de('0x2c')][_0x26de('0x3b')](_0x5a7727);})[_0x26de('0x22')](function(_0x488830){_0x54d868['rows']=_0x488830;return _0x54d868;})[_0x26de('0x22')](respondWithFilteredResult(_0x449c21,_0x5a7727))[_0x26de('0x3c')](handleError(_0x449c21,null));};exports[_0x26de('0x3d')]=function(_0x397a62,_0x1139ce){var _0x15a80c={'raw':![],'where':{'id':_0x397a62[_0x26de('0x3e')]['id']}},_0x167b71={};_0x167b71[_0x26de('0x2e')]=_[_0x26de('0x3f')](db['AnalyticCustomReport']['rawAttributes']);_0x167b71[_0x26de('0x2f')]=_[_0x26de('0x3f')](_0x397a62[_0x26de('0x2f')]);_0x167b71['filters']=_[_0x26de('0x31')](_0x167b71[_0x26de('0x2e')],_0x167b71['query']);_0x15a80c[_0x26de('0x32')]=_[_0x26de('0x31')](_0x167b71[_0x26de('0x2e')],qs['fields'](_0x397a62[_0x26de('0x2f')][_0x26de('0x33')]));_0x15a80c[_0x26de('0x32')]=_0x15a80c[_0x26de('0x32')][_0x26de('0x40')]?_0x15a80c[_0x26de('0x32')]:_0x167b71[_0x26de('0x2e')];if(_0x397a62[_0x26de('0x2f')]['includeAll']){_0x15a80c[_0x26de('0x3a')]=[{'all':!![]}];}_0x15a80c=_[_0x26de('0x37')]({},_0x15a80c,_0x397a62[_0x26de('0x39')]);return db[_0x26de('0x2c')][_0x26de('0x41')](_0x15a80c)[_0x26de('0x22')](handleEntityNotFound(_0x1139ce,null))[_0x26de('0x22')](respondWithResult(_0x1139ce,null))[_0x26de('0x3c')](handleError(_0x1139ce,null));};exports['create']=function(_0x4796a3,_0x4a37d6){return db[_0x26de('0x2c')]['create'](_0x4796a3[_0x26de('0x42')],{})[_0x26de('0x22')](function(_0x153729){var _0x3781a6=_0x4796a3[_0x26de('0x43')][_0x26de('0x44')]({'plain':!![]});if(!_0x3781a6)throw new Error(_0x26de('0x45'));if(_0x3781a6[_0x26de('0x46')]===_0x26de('0x43')){var _0x4dff71=_0x153729[_0x26de('0x44')]({'plain':!![]});var _0x302d58=_0x26de('0x47');return db[_0x26de('0x48')][_0x26de('0x41')]({'where':{'name':_0x302d58,'userProfileId':_0x3781a6['userProfileId']},'raw':!![]})[_0x26de('0x22')](function(_0x14fed7){if(_0x14fed7&&_0x14fed7[_0x26de('0x49')]===0x0){return db[_0x26de('0x25')][_0x26de('0x4a')]({'name':_0x4dff71[_0x26de('0x28')],'resourceId':_0x4dff71['id'],'type':'CustomReports','sectionId':_0x14fed7['id']},{})[_0x26de('0x22')](function(){return _0x153729;});}else{return _0x153729;}})[_0x26de('0x3c')](function(_0x5f4566){logger[_0x26de('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f4566);throw _0x5f4566;});}return _0x153729;})['then'](respondWithResult(_0x4a37d6,0xc9))[_0x26de('0x3c')](handleError(_0x4a37d6,null));};exports[_0x26de('0x21')]=function(_0x2fb65f,_0x1e676c){if(_0x2fb65f['body']['id']){delete _0x2fb65f[_0x26de('0x42')]['id'];}return db[_0x26de('0x2c')]['find']({'where':{'id':_0x2fb65f[_0x26de('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1e676c,null))[_0x26de('0x22')](saveUpdates(_0x2fb65f[_0x26de('0x42')],null))[_0x26de('0x22')](respondWithResult(_0x1e676c,null))[_0x26de('0x3c')](handleError(_0x1e676c,null));};exports[_0x26de('0x23')]=function(_0x19ce4a,_0x4fc335){return db[_0x26de('0x2c')]['find']({'where':{'id':_0x19ce4a['params']['id']}})[_0x26de('0x22')](handleEntityNotFound(_0x4fc335,null))[_0x26de('0x22')](removeEntity(_0x4fc335,null))[_0x26de('0x3c')](handleError(_0x4fc335,null));};exports['preview']=function(_0x4be3d1,_0x2530f4){var _0x5a2f32=0xa;var _0x3c9867=[_0x26de('0x4b'),_0x26de('0x4c'),_0x26de('0x4d'),'cross_join'];var _0x3f61e4={'SUM':_0x26de('0x4e'),'COUNT':_0x26de('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x26de('0x50'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x26de('0x51'),'GROUP_CONCAT ASC':_0x26de('0x52'),'GROUP_CONCAT DESC':_0x26de('0x53')};var _0x4ac428={'SEC_TO_TIME':_0x26de('0x54'),'DATE':_0x26de('0x55'),'HOUR':_0x26de('0x56'),'ROUND':_0x26de('0x57'),'UNIX_TIMESTAMP':_0x26de('0x58')};var _0x2f9f15=function(_0x273f1d){return!_[_0x26de('0x59')](['IS\x20NULL',_0x26de('0x5a'),'IS\x20EMPTY',_0x26de('0x5b')],_0x273f1d);};var _0x52f755=function(_0x5122a2){if(!_0x5122a2||!_0x5122a2['rules'][_0x26de('0x40')]){return'';}for(var _0x37c99a='(',_0x198dc5=0x0;_0x198dc5<_0x5122a2[_0x26de('0x5c')][_0x26de('0x40')];_0x198dc5+=0x1){_0x198dc5>0x0&&(_0x37c99a+='\x20'+_0x5122a2['operator']+'\x20');_0x37c99a+=_0x5122a2[_0x26de('0x5c')][_0x198dc5]['group']?_0x52f755(_0x5122a2['rules'][_0x198dc5][_0x26de('0x5d')]):_0x5122a2[_0x26de('0x5c')][_0x198dc5][_0x26de('0x5e')]+'\x20'+_0x5122a2[_0x26de('0x5c')][_0x198dc5][_0x26de('0x5f')]+(_0x2f9f15(_0x5122a2[_0x26de('0x5c')][_0x198dc5][_0x26de('0x5f')])?'\x20'+_0x5122a2[_0x26de('0x5c')][_0x198dc5][_0x26de('0x60')]:'');}return _0x37c99a+')';};var _0x17a594={'where':{'id':_0x4be3d1[_0x26de('0x3e')]['id']}},_0x3cbe2b,_0x12767c,_0x12d1c5,_0x1d4b84,_0xa962ec;_0x17a594=_[_0x26de('0x37')]({},_0x17a594,_0x4be3d1['options']);return db[_0x26de('0x2c')][_0x26de('0x41')](_0x17a594)[_0x26de('0x22')](function(_0x5fce00){if(_0x5fce00){_0x3cbe2b=_0x5fce00;return _0x5fce00[_0x26de('0x61')]();}return null;})[_0x26de('0x22')](function(_0x2f4568){if(_0x2f4568){if(!_0x2f4568['length']){throw new db[(_0x26de('0x62'))][(_0x26de('0x63'))](_0x26de('0x64'),0x193);}_0x12767c=_0x2f4568;return db[_0x26de('0x65')]['findAll']({'raw':!![]});}return null;})[_0x26de('0x22')](function(_0x4c43bc){if(_0x4c43bc){_0x12d1c5=_[_0x26de('0x66')](_0x4c43bc,'id');var _0x33061f;var _0x4f543c=squel[_0x26de('0x67')]();_0x4f543c[_0x26de('0x68')](_0x3cbe2b['table']);for(var _0x23633e=0x0;_0x23633e<_0x12767c[_0x26de('0x40')];_0x23633e+=0x1){_0x33061f=_0x12767c[_0x23633e][_0x26de('0x69')]?_0x12d1c5[_0x12767c[_0x23633e][_0x26de('0x69')]]['metric']:_0x12767c[_0x23633e]['field'];_0x33061f=_0x12767c[_0x23633e][_0x26de('0x6a')]?_['replace'](_0x3f61e4[_0x12767c[_0x23633e][_0x26de('0x6a')]],'%s',_0x33061f):_0x33061f;_0x33061f=_0x12767c[_0x23633e][_0x26de('0x6b')]?_[_0x26de('0x6c')](_0x4ac428[_0x12767c[_0x23633e][_0x26de('0x6b')]],'%s',_0x33061f):_0x33061f;if(_0x12767c[_0x23633e][_0x26de('0x6d')]){_0x4f543c['group'](_0x33061f);}_0x12767c[_0x23633e][_0x26de('0x6e')]&&_0x4f543c[_0x26de('0x34')](_0x33061f,_0x12767c[_0x23633e][_0x26de('0x6e')]===_0x26de('0x6f')?![]:!![]);_0x4f543c[_0x26de('0x5e')](_0x33061f,_0x12767c[_0x23633e]['alias']||_0x33061f);}if(_0x3cbe2b[_0x26de('0x70')]){_0x3cbe2b[_0x26de('0x70')]=JSON[_0x26de('0x71')](_0x3cbe2b['joins']);for(var _0x877737=0x0;_0x877737<_0x3cbe2b[_0x26de('0x70')][_0x26de('0x40')];_0x877737+=0x1){if(_0x3cbe2b[_0x26de('0x70')][_0x877737][_0x26de('0x72')]&&_['includes'](_0x3c9867,_0x3cbe2b[_0x26de('0x70')][_0x877737][_0x26de('0x72')])&&_0x3cbe2b['joins'][_0x877737][_0x26de('0x73')]&&_0x3cbe2b[_0x26de('0x70')][_0x877737]['foreignTable']&&_0x3cbe2b[_0x26de('0x70')][_0x877737][_0x26de('0x74')]){_0x4f543c[_0x3cbe2b[_0x26de('0x70')][_0x877737]['type']](_0x3cbe2b[_0x26de('0x70')][_0x877737][_0x26de('0x75')],null,util[_0x26de('0x6b')]('%s.%s\x20=\x20%s.%s',_0x3cbe2b['table'],_0x3cbe2b[_0x26de('0x70')][_0x877737][_0x26de('0x73')],_0x3cbe2b['joins'][_0x877737][_0x26de('0x75')],_0x3cbe2b['joins'][_0x877737][_0x26de('0x74')]));}}}if(_0x3cbe2b['conditions']){_0x3cbe2b[_0x26de('0x76')]=JSON['parse'](_0x3cbe2b[_0x26de('0x76')]);_0x4f543c[_0x26de('0x77')](_0x52f755(_0x3cbe2b[_0x26de('0x76')][_0x26de('0x5d')]));}_0xa962ec=_0x4f543c[_0x26de('0x78')]();_0x4f543c[_0x26de('0x1c')](_0x5a2f32);_0x4f543c[_0x26de('0x1a')](0x0);logger[_0x26de('0x79')]('Limited\x20Query:',_0x4f543c[_0x26de('0x7a')]());return dbH[_0x26de('0x7b')]['query'](_0x4f543c[_0x26de('0x7a')](),{'type':dbH['sequelize']['QueryTypes'][_0x26de('0x7c')]});}})[_0x26de('0x22')](respondWithResult(_0x2530f4,null))[_0x26de('0x3c')](handleError(_0x2530f4,null));};function runReport(_0x1d8a80,_0x145d2e,_0x31621e){var _0x52d0d5=_0x145d2e[_0x26de('0x28')];var _0x5ba249=0xa;var _0x53d641=[_0x26de('0x4b'),_0x26de('0x4c'),'right_join',_0x26de('0x7d')];var _0x130b09={'SUM':_0x26de('0x4e'),'COUNT':_0x26de('0x4f'),'COUNT DISTINCT':_0x26de('0x7e'),'MAX':_0x26de('0x50'),'MIN':'MIN(%s)','AVG':_0x26de('0x7f'),'GROUP_CONCAT':_0x26de('0x51'),'GROUP_CONCAT ASC':_0x26de('0x52'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x518a49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x26de('0x55'),'HOUR':_0x26de('0x56'),'ROUND':_0x26de('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x101178=function(_0x3ddd09){return!_[_0x26de('0x59')]([_0x26de('0x80'),_0x26de('0x5a'),_0x26de('0x81'),'IS\x20NOT\x20EMPTY'],_0x3ddd09);};var _0x9ee65d=function(_0x51d545){if(!_0x51d545||!_0x51d545[_0x26de('0x5c')][_0x26de('0x40')]){return'';}for(var _0x30988e='(',_0x2b98fe=0x0;_0x2b98fe<_0x51d545[_0x26de('0x5c')][_0x26de('0x40')];_0x2b98fe+=0x1){_0x2b98fe>0x0&&(_0x30988e+='\x20'+_0x51d545[_0x26de('0x82')]+'\x20');_0x30988e+=_0x51d545[_0x26de('0x5c')][_0x2b98fe][_0x26de('0x5d')]?_0x9ee65d(_0x51d545[_0x26de('0x5c')][_0x2b98fe][_0x26de('0x5d')]):_0x51d545['rules'][_0x2b98fe][_0x26de('0x5e')]+'\x20'+_0x51d545[_0x26de('0x5c')][_0x2b98fe][_0x26de('0x5f')]+(_0x101178(_0x51d545[_0x26de('0x5c')][_0x2b98fe][_0x26de('0x5f')])?'\x20'+_0x51d545[_0x26de('0x5c')][_0x2b98fe][_0x26de('0x60')]:'');}return _0x30988e+')';};var _0x3c8a15={'where':{'id':_0x1d8a80['id']}},_0x2c541e,_0x1f862c,_0x2bf9d2,_0x20e12a,_0x5f42ff;_0x3c8a15=_[_0x26de('0x37')]({},_0x3c8a15,_0x31621e);return db[_0x26de('0x2c')][_0x26de('0x41')](_0x3c8a15)['then'](function(_0x4eec8c){if(_0x4eec8c){_0x2c541e=_0x4eec8c;return _0x4eec8c[_0x26de('0x61')]();}return null;})[_0x26de('0x22')](function(_0x46ba46){if(_0x46ba46){if(!_0x46ba46[_0x26de('0x40')]){throw new db[(_0x26de('0x62'))][(_0x26de('0x63'))](_0x26de('0x64'),0x193);}_0x1f862c=_0x46ba46;return db[_0x26de('0x65')][_0x26de('0x3b')]({'raw':!![]});}return null;})[_0x26de('0x22')](function(_0x1d850d){if(_0x1d850d){_0x2bf9d2=_[_0x26de('0x66')](_0x1d850d,'id');var _0x291210;var _0x2e35bd=squel[_0x26de('0x67')]();_0x2e35bd['from'](_0x2c541e['table']);for(var _0x232c90=0x0;_0x232c90<_0x1f862c[_0x26de('0x40')];_0x232c90+=0x1){_0x291210=_0x1f862c[_0x232c90][_0x26de('0x69')]?_0x2bf9d2[_0x1f862c[_0x232c90][_0x26de('0x69')]][_0x26de('0x83')]:_0x1f862c[_0x232c90][_0x26de('0x5e')];_0x291210=_0x1f862c[_0x232c90][_0x26de('0x6a')]?_[_0x26de('0x6c')](_0x130b09[_0x1f862c[_0x232c90][_0x26de('0x6a')]],'%s',_0x291210):_0x291210;_0x291210=_0x1f862c[_0x232c90][_0x26de('0x6b')]?_[_0x26de('0x6c')](_0x518a49[_0x1f862c[_0x232c90][_0x26de('0x6b')]],'%s',_0x291210):_0x291210;if(_0x1f862c[_0x232c90][_0x26de('0x6d')]){_0x2e35bd[_0x26de('0x5d')](_0x291210);}_0x1f862c[_0x232c90][_0x26de('0x6e')]&&_0x2e35bd[_0x26de('0x34')](_0x291210,_0x1f862c[_0x232c90]['orderBy']==='DESC'?![]:!![]);_0x2e35bd[_0x26de('0x5e')](_0x291210,_0x1f862c[_0x232c90][_0x26de('0x84')]||_0x291210);}if(_0x2c541e[_0x26de('0x70')]){_0x2c541e[_0x26de('0x70')]=JSON[_0x26de('0x71')](_0x2c541e[_0x26de('0x70')]);for(var _0x536d00=0x0;_0x536d00<_0x2c541e[_0x26de('0x70')][_0x26de('0x40')];_0x536d00+=0x1){if(_0x2c541e['joins'][_0x536d00][_0x26de('0x72')]&&_[_0x26de('0x59')](_0x53d641,_0x2c541e[_0x26de('0x70')][_0x536d00]['type'])&&_0x2c541e[_0x26de('0x70')][_0x536d00][_0x26de('0x73')]&&_0x2c541e['joins'][_0x536d00][_0x26de('0x75')]&&_0x2c541e['joins'][_0x536d00][_0x26de('0x74')]){_0x2e35bd[_0x2c541e[_0x26de('0x70')][_0x536d00][_0x26de('0x72')]](_0x2c541e[_0x26de('0x70')][_0x536d00][_0x26de('0x75')],null,util[_0x26de('0x6b')]('%s.%s\x20=\x20%s.%s',_0x2c541e['table'],_0x2c541e[_0x26de('0x70')][_0x536d00]['parentKey'],_0x2c541e[_0x26de('0x70')][_0x536d00][_0x26de('0x75')],_0x2c541e[_0x26de('0x70')][_0x536d00][_0x26de('0x74')]));}}}if(_0x2c541e['conditions']){_0x2c541e[_0x26de('0x76')]=JSON[_0x26de('0x71')](_0x2c541e['conditions']);_0x2e35bd[_0x26de('0x77')](_0x9ee65d(_0x2c541e[_0x26de('0x76')][_0x26de('0x5d')]));}_0x5f42ff=_0x2e35bd[_0x26de('0x78')]();_0x2e35bd[_0x26de('0x1c')](_0x5ba249);_0x2e35bd[_0x26de('0x1a')](0x0);return;}})[_0x26de('0x22')](function(){if(_0x145d2e['output']==='web'){return null;}var _0xa85fad=_[_0x26de('0x37')](_0x145d2e,{'name':_0x145d2e[_0x26de('0x85')]||_0x145d2e[_0x26de('0x28')]||_0x2c541e[_0x26de('0x28')],'basename':_0x52d0d5,'savename':util[_0x26de('0x6b')]('%s-%s.%s',_0x145d2e['name']||_0x2c541e[_0x26de('0x28')],require(_0x26de('0x86'))[_0x26de('0x87')](0x4),_0x145d2e[_0x26de('0x88')]||'csv'),'reportId':_0x2c541e['id'],'reportType':'custom'});return db[_0x26de('0x89')]['create'](_0xa85fad,{'raw':!![]});})['then'](function(_0x5d6df4){if(_0x2c541e[_0x26de('0x8a')]==='cdr'){_0x5f42ff[_0x26de('0x77')](_0x2c541e[_0x26de('0x8a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x145d2e['startDate'],_0x145d2e['endDate']);}else{_0x5f42ff[_0x26de('0x77')](_0x2c541e[_0x26de('0x8a')]+_0x26de('0x8b'),_0x145d2e[_0x26de('0x8c')],_0x145d2e[_0x26de('0x8d')]);}if(_0x5d6df4){logger[_0x26de('0x8e')](_0x26de('0x8f'),_0x5f42ff[_0x26de('0x7a')]());require('child_process')[_0x26de('0x90')](path[_0x26de('0x4b')](__dirname,_0x26de('0x91'),_0x5d6df4[_0x26de('0x88')]),[_0x5d6df4['id'],_0x5f42ff[_0x26de('0x7a')](),path[_0x26de('0x4b')](__dirname,_0x26de('0x92'),_0x5d6df4[_0x26de('0x93')]),_0x52d0d5]);return _0x5d6df4;}else{var _0x4cc57f=squel['select']();_0x4cc57f['from']('('+_0x5f42ff['toString']()+')',_0x26de('0x94'));_0x4cc57f[_0x26de('0x5e')](_0x26de('0x95'),_0x26de('0x1d'));_0x5f42ff[_0x26de('0x1c')](_0x145d2e[_0x26de('0x1c')]||_0x5ba249);_0x5f42ff[_0x26de('0x1a')](_0x145d2e[_0x26de('0x1a')]||0x0);return dbH[_0x26de('0x7b')][_0x26de('0x2f')](_0x4cc57f[_0x26de('0x7a')](),{'type':dbH[_0x26de('0x7b')][_0x26de('0x96')][_0x26de('0x7c')]})[_0x26de('0x22')](function(_0x10fe5a){if(!_0x10fe5a[_0x26de('0x40')]){_0x20e12a=0x0;}else{_0x20e12a=_0x10fe5a[0x0][_0x26de('0x1d')]||0x0;}return dbH['sequelize'][_0x26de('0x2f')](_0x5f42ff[_0x26de('0x7a')](),{'type':dbH[_0x26de('0x7b')][_0x26de('0x96')]['SELECT']});})[_0x26de('0x22')](function(_0x224277){return{'rows':_0x224277||[],'count':_0x20e12a};});}});}exports[_0x26de('0x97')]=function(_0xd0fa9e,_0x38a939){return runReport(_0xd0fa9e[_0x26de('0x3e')],_0xd0fa9e[_0x26de('0x2f')],_0xd0fa9e['options'])['then'](respondWithResult(_0x38a939,null))[_0x26de('0x3c')](handleError(_0x38a939,null));};exports[_0x26de('0x98')]=runReport;exports[_0x26de('0x2f')]=function(_0x39fd02,_0x373b4d){var _0x4dfb34=0xa;var _0x5b3bad=[_0x26de('0x4b'),_0x26de('0x4c'),_0x26de('0x4d'),_0x26de('0x7d')];var _0x404850={'SUM':_0x26de('0x4e'),'COUNT':_0x26de('0x4f'),'COUNT DISTINCT':_0x26de('0x7e'),'MAX':_0x26de('0x50'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x26de('0x51'),'GROUP_CONCAT ASC':_0x26de('0x52'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x388506={'SEC_TO_TIME':_0x26de('0x54'),'DATE':_0x26de('0x55'),'HOUR':_0x26de('0x56'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x26de('0x58')};var _0x2fb2b5=function(_0x1d75fd){return!_['includes']([_0x26de('0x80'),_0x26de('0x5a'),_0x26de('0x81'),_0x26de('0x5b')],_0x1d75fd);};var _0x4e7fb9=function(_0x45325a){if(!_0x45325a||!_0x45325a[_0x26de('0x5c')]['length']){return'';}for(var _0x48b01a='(',_0x42dfa5=0x0;_0x42dfa5<_0x45325a['rules'][_0x26de('0x40')];_0x42dfa5+=0x1){_0x42dfa5>0x0&&(_0x48b01a+='\x20'+_0x45325a[_0x26de('0x82')]+'\x20');_0x48b01a+=_0x45325a[_0x26de('0x5c')][_0x42dfa5][_0x26de('0x5d')]?_0x4e7fb9(_0x45325a[_0x26de('0x5c')][_0x42dfa5][_0x26de('0x5d')]):_0x45325a['rules'][_0x42dfa5][_0x26de('0x5e')]+'\x20'+_0x45325a['rules'][_0x42dfa5][_0x26de('0x5f')]+(_0x2fb2b5(_0x45325a[_0x26de('0x5c')][_0x42dfa5]['condition'])?'\x20'+_0x45325a[_0x26de('0x5c')][_0x42dfa5][_0x26de('0x60')]:'');}return _0x48b01a+')';};var _0x25d5dd={'where':{'id':_0x39fd02[_0x26de('0x3e')]['id']}},_0x316e79,_0x28f7a3,_0x34f92f,_0x501ed2,_0x2453fb;_0x25d5dd=_[_0x26de('0x37')]({},_0x25d5dd,_0x39fd02['options']);return db[_0x26de('0x2c')][_0x26de('0x41')](_0x25d5dd)[_0x26de('0x22')](function(_0x1f94ab){if(_0x1f94ab){_0x316e79=_0x1f94ab;return _0x1f94ab[_0x26de('0x61')]();}return null;})[_0x26de('0x22')](function(_0x5b5d1b){if(_0x5b5d1b){if(!_0x5b5d1b[_0x26de('0x40')]){throw new db['Sequelize'][(_0x26de('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x28f7a3=_0x5b5d1b;return db[_0x26de('0x65')]['findAll']({'raw':!![]});}return null;})[_0x26de('0x22')](function(_0x476710){if(_0x476710){_0x34f92f=_[_0x26de('0x66')](_0x476710,'id');var _0x1f69aa;var _0x138d54=squel[_0x26de('0x67')]();_0x138d54[_0x26de('0x68')](_0x316e79[_0x26de('0x8a')]);for(var _0x2ae1dd=0x0;_0x2ae1dd<_0x28f7a3[_0x26de('0x40')];_0x2ae1dd+=0x1){_0x1f69aa=_0x28f7a3[_0x2ae1dd][_0x26de('0x69')]?_0x34f92f[_0x28f7a3[_0x2ae1dd][_0x26de('0x69')]]['metric']:_0x28f7a3[_0x2ae1dd]['field'];_0x1f69aa=_0x28f7a3[_0x2ae1dd][_0x26de('0x6a')]?_[_0x26de('0x6c')](_0x404850[_0x28f7a3[_0x2ae1dd][_0x26de('0x6a')]],'%s',_0x1f69aa):_0x1f69aa;_0x1f69aa=_0x28f7a3[_0x2ae1dd][_0x26de('0x6b')]?_[_0x26de('0x6c')](_0x388506[_0x28f7a3[_0x2ae1dd][_0x26de('0x6b')]],'%s',_0x1f69aa):_0x1f69aa;if(_0x28f7a3[_0x2ae1dd][_0x26de('0x6d')]){_0x138d54[_0x26de('0x5d')](_0x1f69aa);}_0x28f7a3[_0x2ae1dd][_0x26de('0x6e')]&&_0x138d54['order'](_0x1f69aa,_0x28f7a3[_0x2ae1dd]['orderBy']===_0x26de('0x6f')?![]:!![]);_0x138d54[_0x26de('0x5e')](_0x1f69aa,_0x28f7a3[_0x2ae1dd][_0x26de('0x84')]||_0x1f69aa);}if(_0x316e79[_0x26de('0x70')]){_0x316e79[_0x26de('0x70')]=JSON[_0x26de('0x71')](_0x316e79[_0x26de('0x70')]);for(var _0x499eb8=0x0;_0x499eb8<_0x316e79[_0x26de('0x70')]['length'];_0x499eb8+=0x1){if(_0x316e79[_0x26de('0x70')][_0x499eb8]['type']&&_[_0x26de('0x59')](_0x5b3bad,_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x72')])&&_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x73')]&&_0x316e79[_0x26de('0x70')][_0x499eb8]['foreignTable']&&_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x74')]){_0x138d54[_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x72')]](_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x75')],null,util[_0x26de('0x6b')]('%s.%s\x20=\x20%s.%s',_0x316e79[_0x26de('0x8a')],_0x316e79[_0x26de('0x70')][_0x499eb8]['parentKey'],_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x75')],_0x316e79[_0x26de('0x70')][_0x499eb8][_0x26de('0x74')]));}}}if(_0x316e79[_0x26de('0x76')]){_0x316e79[_0x26de('0x76')]=JSON['parse'](_0x316e79['conditions']);_0x138d54['where'](_0x4e7fb9(_0x316e79[_0x26de('0x76')][_0x26de('0x5d')]));}_0x2453fb=_0x138d54[_0x26de('0x78')]();_0x138d54['limit'](_0x4dfb34);_0x138d54[_0x26de('0x1a')](0x0);logger[_0x26de('0x79')](_0x26de('0x99'),_0x138d54['toString']());return dbH[_0x26de('0x7b')][_0x26de('0x2f')](_0x138d54[_0x26de('0x7a')](),{'type':dbH['sequelize'][_0x26de('0x96')][_0x26de('0x7c')]});}})[_0x26de('0x22')](function(){return{'sql':_0x2453fb[_0x26de('0x7a')]()};})[_0x26de('0x22')](respondWithResult(_0x373b4d,null))[_0x26de('0x3c')](handleError(_0x373b4d,null));}; \ No newline at end of file +var _0x09c2=['.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','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/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','filters','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','IS\x20EMPTY','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','cdr'];(function(_0x1b928a,_0x2f229d){var _0x376a42=function(_0x5c744a){while(--_0x5c744a){_0x1b928a['push'](_0x1b928a['shift']());}};_0x376a42(++_0x2f229d);}(_0x09c2,0x158));var _0x209c=function(_0x1c7377,_0x8a8698){_0x1c7377=_0x1c7377-0x0;var _0x5d03e3=_0x09c2[_0x1c7377];return _0x5d03e3;};'use strict';var emlformat=require(_0x209c('0x0'));var rimraf=require(_0x209c('0x1'));var zipdir=require(_0x209c('0x2'));var jsonpatch=require(_0x209c('0x3'));var rp=require('request-promise');var moment=require(_0x209c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x209c('0x5'));var util=require(_0x209c('0x6'));var path=require(_0x209c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x209c('0x8'));var fs=require('fs');var fs_extra=require(_0x209c('0x9'));var _=require('lodash');var squel=require(_0x209c('0xa'));var crypto=require(_0x209c('0xb'));var jsforce=require(_0x209c('0xc'));var deskjs=require(_0x209c('0xd'));var toCsv=require(_0x209c('0xe'));var querystring=require('querystring');var Papa=require(_0x209c('0xf'));var Redis=require(_0x209c('0x10'));var authService=require(_0x209c('0x11'));var qs=require(_0x209c('0x12'));var as=require(_0x209c('0x13'));var hardwareService=require(_0x209c('0x14'));var logger=require(_0x209c('0x15'))(_0x209c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x209c('0x17'));var db=require(_0x209c('0x18'))['db'];var dbH=require(_0x209c('0x18'))[_0x209c('0x19')];function respondWithStatusCode(_0xaef322,_0x273c44){_0x273c44=_0x273c44||0xcc;return function(_0x296f0c){if(_0x296f0c){return _0xaef322[_0x209c('0x1a')](_0x273c44);}return _0xaef322[_0x209c('0x1b')](_0x273c44)[_0x209c('0x1c')]();};}function respondWithResult(_0x27f8ab,_0x3aac22){_0x3aac22=_0x3aac22||0xc8;return function(_0x514b10){if(_0x514b10){return _0x27f8ab['status'](_0x3aac22)['json'](_0x514b10);}};}function respondWithFilteredResult(_0xdd5a8e,_0x191e78){return function(_0x421ddc){if(_0x421ddc){var _0xca2e47=typeof _0x191e78[_0x209c('0x1d')]===_0x209c('0x1e')&&typeof _0x191e78[_0x209c('0x1f')]===_0x209c('0x1e');var _0x14ab53=_0x421ddc[_0x209c('0x20')];var _0x4b6058=_0xca2e47?0x0:_0x191e78[_0x209c('0x1d')];var _0x425b2d=_0xca2e47?_0x421ddc[_0x209c('0x20')]:_0x191e78[_0x209c('0x1d')]+_0x191e78[_0x209c('0x1f')];var _0x7524ba;if(_0x425b2d>=_0x14ab53){_0x425b2d=_0x14ab53;_0x7524ba=0xc8;}else{_0x7524ba=0xce;}_0xdd5a8e[_0x209c('0x1b')](_0x7524ba);return _0xdd5a8e[_0x209c('0x21')](_0x209c('0x22'),_0x4b6058+'-'+_0x425b2d+'/'+_0x14ab53)[_0x209c('0x23')](_0x421ddc);}return null;};}function patchUpdates(_0x4d9704){return function(_0x340302){try{jsonpatch[_0x209c('0x24')](_0x340302,_0x4d9704,!![]);}catch(_0x449a0b){return BPromise[_0x209c('0x25')](_0x449a0b);}return _0x340302[_0x209c('0x26')]();};}function saveUpdates(_0x34a7e5,_0x5a1deb){return function(_0x977c65){if(_0x977c65){return _0x977c65['update'](_0x34a7e5)[_0x209c('0x27')](function(_0xfcc10c){return _0xfcc10c;});}return null;};}function removeEntity(_0x4b0d4c,_0x548af0){return function(_0x4cad34){if(_0x4cad34){return _0x4cad34[_0x209c('0x28')]()[_0x209c('0x27')](function(){var _0x1e4b10=_0x4cad34[_0x209c('0x29')]({'plain':!![]});var _0x20d968=_0x209c('0x2a');return db[_0x209c('0x2b')][_0x209c('0x28')]({'where':{'type':_0x20d968,'resourceId':_0x1e4b10['id']}})[_0x209c('0x27')](function(){return _0x4cad34;});})[_0x209c('0x27')](function(){_0x4b0d4c[_0x209c('0x1b')](0xcc)[_0x209c('0x1c')]();});}};}function handleEntityNotFound(_0x5c332b,_0xae49f7){return function(_0x489b39){if(!_0x489b39){_0x5c332b[_0x209c('0x1a')](0x194);}return _0x489b39;};}function handleError(_0x510a6f,_0x710864){_0x710864=_0x710864||0x1f4;return function(_0x221c65){logger[_0x209c('0x2c')](_0x221c65['stack']);if(_0x221c65[_0x209c('0x2d')]){delete _0x221c65['name'];}_0x510a6f[_0x209c('0x1b')](_0x710864)[_0x209c('0x2e')](_0x221c65);};}exports[_0x209c('0x2f')]=function(_0x2137dd,_0x9c4f1d){var _0x219ab5={},_0x3e16f3={},_0x2bfc98={'count':0x0,'rows':[]};var _0x2f68ea=_[_0x209c('0x30')](db[_0x209c('0x31')]['rawAttributes'],function(_0x270518){return{'name':_0x270518['fieldName'],'type':_0x270518[_0x209c('0x32')]['key']};});_0x3e16f3[_0x209c('0x33')]=_[_0x209c('0x30')](_0x2f68ea,_0x209c('0x2d'));_0x3e16f3['query']=_['keys'](_0x2137dd[_0x209c('0x34')]);_0x3e16f3['filters']=_[_0x209c('0x35')](_0x3e16f3[_0x209c('0x33')],_0x3e16f3[_0x209c('0x34')]);_0x219ab5[_0x209c('0x36')]=_['intersection'](_0x3e16f3[_0x209c('0x33')],qs[_0x209c('0x37')](_0x2137dd[_0x209c('0x34')][_0x209c('0x37')]));_0x219ab5[_0x209c('0x36')]=_0x219ab5[_0x209c('0x36')][_0x209c('0x38')]?_0x219ab5[_0x209c('0x36')]:_0x3e16f3[_0x209c('0x33')];if(!_0x2137dd[_0x209c('0x34')][_0x209c('0x39')]('nolimit')){_0x219ab5[_0x209c('0x1f')]=qs[_0x209c('0x1f')](_0x2137dd['query'][_0x209c('0x1f')]);_0x219ab5[_0x209c('0x1d')]=qs[_0x209c('0x1d')](_0x2137dd['query'][_0x209c('0x1d')]);}_0x219ab5[_0x209c('0x3a')]=qs['sort'](_0x2137dd[_0x209c('0x34')]['sort']);_0x219ab5['where']=qs[_0x209c('0x3b')](_[_0x209c('0x3c')](_0x2137dd[_0x209c('0x34')],_0x3e16f3[_0x209c('0x3b')]),_0x2f68ea);if(_0x2137dd[_0x209c('0x34')]['filter']){_0x219ab5[_0x209c('0x3d')]=_['merge'](_0x219ab5[_0x209c('0x3d')],{'$or':_[_0x209c('0x30')](_0x2f68ea,function(_0x570636){if(_0x570636[_0x209c('0x32')]!==_0x209c('0x3e')){var _0x11bdf1={};_0x11bdf1[_0x570636['name']]={'$like':'%'+_0x2137dd[_0x209c('0x34')][_0x209c('0x3f')]+'%'};return _0x11bdf1;}})});}_0x219ab5=_['merge']({},_0x219ab5,_0x2137dd[_0x209c('0x40')]);var _0x40afd7={'where':_0x219ab5[_0x209c('0x3d')]};return db['AnalyticCustomReport'][_0x209c('0x20')](_0x40afd7)[_0x209c('0x27')](function(_0x252fbf){_0x2bfc98['count']=_0x252fbf;if(_0x2137dd[_0x209c('0x34')][_0x209c('0x41')]){_0x219ab5[_0x209c('0x42')]=[{'all':!![]}];}return db[_0x209c('0x31')][_0x209c('0x43')](_0x219ab5);})['then'](function(_0x320668){_0x2bfc98['rows']=_0x320668;return _0x2bfc98;})[_0x209c('0x27')](respondWithFilteredResult(_0x9c4f1d,_0x219ab5))['catch'](handleError(_0x9c4f1d,null));};exports[_0x209c('0x44')]=function(_0x4cb5e8,_0x558c7e){var _0x1887d={'raw':![],'where':{'id':_0x4cb5e8[_0x209c('0x45')]['id']}},_0x35bd4d={};_0x35bd4d[_0x209c('0x33')]=_['keys'](db[_0x209c('0x31')][_0x209c('0x46')]);_0x35bd4d[_0x209c('0x34')]=_[_0x209c('0x47')](_0x4cb5e8[_0x209c('0x34')]);_0x35bd4d['filters']=_['intersection'](_0x35bd4d[_0x209c('0x33')],_0x35bd4d[_0x209c('0x34')]);_0x1887d[_0x209c('0x36')]=_[_0x209c('0x35')](_0x35bd4d[_0x209c('0x33')],qs[_0x209c('0x37')](_0x4cb5e8[_0x209c('0x34')][_0x209c('0x37')]));_0x1887d[_0x209c('0x36')]=_0x1887d[_0x209c('0x36')]['length']?_0x1887d[_0x209c('0x36')]:_0x35bd4d[_0x209c('0x33')];if(_0x4cb5e8[_0x209c('0x34')][_0x209c('0x41')]){_0x1887d[_0x209c('0x42')]=[{'all':!![]}];}_0x1887d=_['merge']({},_0x1887d,_0x4cb5e8[_0x209c('0x40')]);return db[_0x209c('0x31')][_0x209c('0x48')](_0x1887d)['then'](handleEntityNotFound(_0x558c7e,null))['then'](respondWithResult(_0x558c7e,null))[_0x209c('0x49')](handleError(_0x558c7e,null));};exports[_0x209c('0x4a')]=function(_0xa6f580,_0x738742){return db[_0x209c('0x31')][_0x209c('0x4a')](_0xa6f580[_0x209c('0x4b')],{})[_0x209c('0x27')](function(_0x3805c6){var _0x891823=_0xa6f580['user'][_0x209c('0x29')]({'plain':!![]});if(!_0x891823)throw new Error(_0x209c('0x4c'));if(_0x891823[_0x209c('0x4d')]===_0x209c('0x4e')){var _0xb2b2b4=_0x3805c6[_0x209c('0x29')]({'plain':!![]});var _0x1239f9='Reports';return db[_0x209c('0x4f')][_0x209c('0x48')]({'where':{'name':_0x1239f9,'userProfileId':_0x891823[_0x209c('0x50')]},'raw':!![]})['then'](function(_0x389e64){if(_0x389e64&&_0x389e64[_0x209c('0x51')]===0x0){return db[_0x209c('0x2b')][_0x209c('0x4a')]({'name':_0xb2b2b4[_0x209c('0x2d')],'resourceId':_0xb2b2b4['id'],'type':_0x209c('0x2a'),'sectionId':_0x389e64['id']},{})[_0x209c('0x27')](function(){return _0x3805c6;});}else{return _0x3805c6;}})[_0x209c('0x49')](function(_0x2c8ba7){logger[_0x209c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c8ba7);throw _0x2c8ba7;});}return _0x3805c6;})[_0x209c('0x27')](respondWithResult(_0x738742,0xc9))['catch'](handleError(_0x738742,null));};exports[_0x209c('0x52')]=function(_0x4904f5,_0x248c2d){if(_0x4904f5['body']['id']){delete _0x4904f5['body']['id'];}return db[_0x209c('0x31')][_0x209c('0x48')]({'where':{'id':_0x4904f5[_0x209c('0x45')]['id']}})[_0x209c('0x27')](handleEntityNotFound(_0x248c2d,null))[_0x209c('0x27')](saveUpdates(_0x4904f5[_0x209c('0x4b')],null))[_0x209c('0x27')](respondWithResult(_0x248c2d,null))['catch'](handleError(_0x248c2d,null));};exports[_0x209c('0x28')]=function(_0x2255aa,_0x3b3691){return db[_0x209c('0x31')][_0x209c('0x48')]({'where':{'id':_0x2255aa['params']['id']}})[_0x209c('0x27')](handleEntityNotFound(_0x3b3691,null))[_0x209c('0x27')](removeEntity(_0x3b3691,null))[_0x209c('0x49')](handleError(_0x3b3691,null));};exports[_0x209c('0x53')]=function(_0x4dbad7,_0x34f506){var _0x243ffa=0xa;var _0xd6f37e=[_0x209c('0x54'),_0x209c('0x55'),_0x209c('0x56'),_0x209c('0x57')];var _0x21ebe3={'SUM':_0x209c('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x209c('0x59'),'MAX':_0x209c('0x5a'),'MIN':_0x209c('0x5b'),'AVG':_0x209c('0x5c'),'GROUP_CONCAT':_0x209c('0x5d'),'GROUP_CONCAT ASC':_0x209c('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1c5700={'SEC_TO_TIME':_0x209c('0x5f'),'DATE':_0x209c('0x60'),'HOUR':_0x209c('0x61'),'ROUND':_0x209c('0x62'),'UNIX_TIMESTAMP':_0x209c('0x63')};var _0x181b0b=function(_0x241587){return!_[_0x209c('0x64')](['IS\x20NULL',_0x209c('0x65'),'IS\x20EMPTY',_0x209c('0x66')],_0x241587);};var _0x5bdca0=function(_0x1d774a){if(!_0x1d774a||!_0x1d774a[_0x209c('0x67')][_0x209c('0x38')]){return'';}for(var _0x1bf3b0='(',_0x469cf1=0x0;_0x469cf1<_0x1d774a[_0x209c('0x67')]['length'];_0x469cf1+=0x1){_0x469cf1>0x0&&(_0x1bf3b0+='\x20'+_0x1d774a[_0x209c('0x68')]+'\x20');_0x1bf3b0+=_0x1d774a[_0x209c('0x67')][_0x469cf1][_0x209c('0x69')]?_0x5bdca0(_0x1d774a[_0x209c('0x67')][_0x469cf1]['group']):_0x1d774a[_0x209c('0x67')][_0x469cf1][_0x209c('0x6a')]+'\x20'+_0x1d774a['rules'][_0x469cf1][_0x209c('0x6b')]+(_0x181b0b(_0x1d774a['rules'][_0x469cf1][_0x209c('0x6b')])?'\x20'+_0x1d774a[_0x209c('0x67')][_0x469cf1][_0x209c('0x6c')]:'');}return _0x1bf3b0+')';};var _0x32c411={'where':{'id':_0x4dbad7['params']['id']}},_0x142109,_0x1e087a,_0xf832da,_0x31ff51,_0x3186c8;_0x32c411=_[_0x209c('0x6d')]({},_0x32c411,_0x4dbad7[_0x209c('0x40')]);return db['AnalyticCustomReport'][_0x209c('0x48')](_0x32c411)[_0x209c('0x27')](function(_0x53130b){if(_0x53130b){_0x142109=_0x53130b;return _0x53130b[_0x209c('0x6e')]();}return null;})[_0x209c('0x27')](function(_0x5dc5de){if(_0x5dc5de){if(!_0x5dc5de['length']){throw new db[(_0x209c('0x6f'))][(_0x209c('0x70'))](_0x209c('0x71'),0x193);}_0x1e087a=_0x5dc5de;return db[_0x209c('0x72')][_0x209c('0x43')]({'raw':!![]});}return null;})[_0x209c('0x27')](function(_0x2ec4d9){if(_0x2ec4d9){_0xf832da=_[_0x209c('0x73')](_0x2ec4d9,'id');var _0x478d00;var _0x5602f0=squel[_0x209c('0x74')]();_0x5602f0[_0x209c('0x75')](_0x142109[_0x209c('0x76')]);for(var _0x49f791=0x0;_0x49f791<_0x1e087a[_0x209c('0x38')];_0x49f791+=0x1){_0x478d00=_0x1e087a[_0x49f791][_0x209c('0x77')]?_0xf832da[_0x1e087a[_0x49f791][_0x209c('0x77')]][_0x209c('0x78')]:_0x1e087a[_0x49f791][_0x209c('0x6a')];_0x478d00=_0x1e087a[_0x49f791][_0x209c('0x79')]?_[_0x209c('0x7a')](_0x21ebe3[_0x1e087a[_0x49f791][_0x209c('0x79')]],'%s',_0x478d00):_0x478d00;_0x478d00=_0x1e087a[_0x49f791][_0x209c('0x7b')]?_[_0x209c('0x7a')](_0x1c5700[_0x1e087a[_0x49f791][_0x209c('0x7b')]],'%s',_0x478d00):_0x478d00;if(_0x1e087a[_0x49f791][_0x209c('0x7c')]){_0x5602f0[_0x209c('0x69')](_0x478d00);}_0x1e087a[_0x49f791]['orderBy']&&_0x5602f0[_0x209c('0x3a')](_0x478d00,_0x1e087a[_0x49f791][_0x209c('0x7d')]===_0x209c('0x7e')?![]:!![]);_0x5602f0['field'](_0x478d00,_0x1e087a[_0x49f791][_0x209c('0x7f')]||_0x478d00);}if(_0x142109['joins']){_0x142109[_0x209c('0x80')]=JSON[_0x209c('0x81')](_0x142109[_0x209c('0x80')]);for(var _0xa2721e=0x0;_0xa2721e<_0x142109[_0x209c('0x80')][_0x209c('0x38')];_0xa2721e+=0x1){if(_0x142109[_0x209c('0x80')][_0xa2721e]['type']&&_[_0x209c('0x64')](_0xd6f37e,_0x142109[_0x209c('0x80')][_0xa2721e][_0x209c('0x32')])&&_0x142109[_0x209c('0x80')][_0xa2721e][_0x209c('0x82')]&&_0x142109[_0x209c('0x80')][_0xa2721e]['foreignTable']&&_0x142109['joins'][_0xa2721e]['foreignKey']){_0x5602f0[_0x142109[_0x209c('0x80')][_0xa2721e]['type']](_0x142109['joins'][_0xa2721e][_0x209c('0x83')],null,util[_0x209c('0x7b')]('%s.%s\x20=\x20%s.%s',_0x142109[_0x209c('0x76')],_0x142109[_0x209c('0x80')][_0xa2721e][_0x209c('0x82')],_0x142109['joins'][_0xa2721e][_0x209c('0x83')],_0x142109['joins'][_0xa2721e][_0x209c('0x84')]));}}}if(_0x142109[_0x209c('0x85')]){_0x142109[_0x209c('0x85')]=JSON[_0x209c('0x81')](_0x142109[_0x209c('0x85')]);_0x5602f0['where'](_0x5bdca0(_0x142109[_0x209c('0x85')][_0x209c('0x69')]));}_0x3186c8=_0x5602f0[_0x209c('0x86')]();_0x5602f0[_0x209c('0x1f')](_0x243ffa);_0x5602f0[_0x209c('0x1d')](0x0);logger[_0x209c('0x87')]('Limited\x20Query:',_0x5602f0[_0x209c('0x88')]());return dbH[_0x209c('0x89')][_0x209c('0x34')](_0x5602f0[_0x209c('0x88')](),{'type':dbH[_0x209c('0x89')][_0x209c('0x8a')][_0x209c('0x8b')]});}})['then'](respondWithResult(_0x34f506,null))[_0x209c('0x49')](handleError(_0x34f506,null));};function runReport(_0x9382f0,_0x57b1a3,_0x465977){var _0x9ab552=_0x57b1a3[_0x209c('0x2d')];var _0x5afc0f=0xa;var _0x3d5a6b=[_0x209c('0x54'),_0x209c('0x55'),_0x209c('0x56'),_0x209c('0x57')];var _0xefb809={'SUM':_0x209c('0x58'),'COUNT':_0x209c('0x8c'),'COUNT DISTINCT':_0x209c('0x59'),'MAX':_0x209c('0x5a'),'MIN':_0x209c('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x209c('0x5d'),'GROUP_CONCAT ASC':_0x209c('0x5e'),'GROUP_CONCAT DESC':_0x209c('0x8d')};var _0x59686a={'SEC_TO_TIME':_0x209c('0x5f'),'DATE':_0x209c('0x60'),'HOUR':_0x209c('0x61'),'ROUND':_0x209c('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2444c8=function(_0x3615f9){return!_[_0x209c('0x64')]([_0x209c('0x8e'),_0x209c('0x65'),_0x209c('0x8f'),_0x209c('0x66')],_0x3615f9);};var _0x2fad4b=function(_0x2c821c){if(!_0x2c821c||!_0x2c821c['rules']['length']){return'';}for(var _0x571492='(',_0x44c9ff=0x0;_0x44c9ff<_0x2c821c[_0x209c('0x67')][_0x209c('0x38')];_0x44c9ff+=0x1){_0x44c9ff>0x0&&(_0x571492+='\x20'+_0x2c821c[_0x209c('0x68')]+'\x20');_0x571492+=_0x2c821c[_0x209c('0x67')][_0x44c9ff][_0x209c('0x69')]?_0x2fad4b(_0x2c821c['rules'][_0x44c9ff][_0x209c('0x69')]):_0x2c821c[_0x209c('0x67')][_0x44c9ff][_0x209c('0x6a')]+'\x20'+_0x2c821c[_0x209c('0x67')][_0x44c9ff]['condition']+(_0x2444c8(_0x2c821c[_0x209c('0x67')][_0x44c9ff][_0x209c('0x6b')])?'\x20'+_0x2c821c[_0x209c('0x67')][_0x44c9ff][_0x209c('0x6c')]:'');}return _0x571492+')';};var _0x5e66d9={'where':{'id':_0x9382f0['id']}},_0xdf57ed,_0x3b757b,_0x18eef5,_0x2ee604,_0x13779b;_0x5e66d9=_['merge']({},_0x5e66d9,_0x465977);return db[_0x209c('0x31')][_0x209c('0x48')](_0x5e66d9)[_0x209c('0x27')](function(_0x284721){if(_0x284721){_0xdf57ed=_0x284721;return _0x284721[_0x209c('0x6e')]();}return null;})[_0x209c('0x27')](function(_0x1bad24){if(_0x1bad24){if(!_0x1bad24[_0x209c('0x38')]){throw new db[(_0x209c('0x6f'))][(_0x209c('0x70'))](_0x209c('0x71'),0x193);}_0x3b757b=_0x1bad24;return db[_0x209c('0x72')][_0x209c('0x43')]({'raw':!![]});}return null;})[_0x209c('0x27')](function(_0x12adac){if(_0x12adac){_0x18eef5=_[_0x209c('0x73')](_0x12adac,'id');var _0x3dd818;var _0x3a2cc1=squel[_0x209c('0x74')]();_0x3a2cc1[_0x209c('0x75')](_0xdf57ed[_0x209c('0x76')]);for(var _0x2ada42=0x0;_0x2ada42<_0x3b757b[_0x209c('0x38')];_0x2ada42+=0x1){_0x3dd818=_0x3b757b[_0x2ada42][_0x209c('0x77')]?_0x18eef5[_0x3b757b[_0x2ada42]['MetricId']]['metric']:_0x3b757b[_0x2ada42][_0x209c('0x6a')];_0x3dd818=_0x3b757b[_0x2ada42][_0x209c('0x79')]?_[_0x209c('0x7a')](_0xefb809[_0x3b757b[_0x2ada42][_0x209c('0x79')]],'%s',_0x3dd818):_0x3dd818;_0x3dd818=_0x3b757b[_0x2ada42][_0x209c('0x7b')]?_['replace'](_0x59686a[_0x3b757b[_0x2ada42][_0x209c('0x7b')]],'%s',_0x3dd818):_0x3dd818;if(_0x3b757b[_0x2ada42][_0x209c('0x7c')]){_0x3a2cc1[_0x209c('0x69')](_0x3dd818);}_0x3b757b[_0x2ada42]['orderBy']&&_0x3a2cc1[_0x209c('0x3a')](_0x3dd818,_0x3b757b[_0x2ada42]['orderBy']==='DESC'?![]:!![]);_0x3a2cc1[_0x209c('0x6a')](_0x3dd818,_0x3b757b[_0x2ada42]['alias']||_0x3dd818);}if(_0xdf57ed[_0x209c('0x80')]){_0xdf57ed[_0x209c('0x80')]=JSON[_0x209c('0x81')](_0xdf57ed[_0x209c('0x80')]);for(var _0x304a1e=0x0;_0x304a1e<_0xdf57ed[_0x209c('0x80')][_0x209c('0x38')];_0x304a1e+=0x1){if(_0xdf57ed['joins'][_0x304a1e][_0x209c('0x32')]&&_[_0x209c('0x64')](_0x3d5a6b,_0xdf57ed[_0x209c('0x80')][_0x304a1e][_0x209c('0x32')])&&_0xdf57ed['joins'][_0x304a1e][_0x209c('0x82')]&&_0xdf57ed['joins'][_0x304a1e][_0x209c('0x83')]&&_0xdf57ed[_0x209c('0x80')][_0x304a1e]['foreignKey']){_0x3a2cc1[_0xdf57ed[_0x209c('0x80')][_0x304a1e][_0x209c('0x32')]](_0xdf57ed['joins'][_0x304a1e][_0x209c('0x83')],null,util[_0x209c('0x7b')](_0x209c('0x90'),_0xdf57ed[_0x209c('0x76')],_0xdf57ed[_0x209c('0x80')][_0x304a1e][_0x209c('0x82')],_0xdf57ed[_0x209c('0x80')][_0x304a1e]['foreignTable'],_0xdf57ed[_0x209c('0x80')][_0x304a1e][_0x209c('0x84')]));}}}if(_0xdf57ed[_0x209c('0x85')]){_0xdf57ed[_0x209c('0x85')]=JSON[_0x209c('0x81')](_0xdf57ed['conditions']);_0x3a2cc1[_0x209c('0x3d')](_0x2fad4b(_0xdf57ed[_0x209c('0x85')][_0x209c('0x69')]));}_0x13779b=_0x3a2cc1[_0x209c('0x86')]();_0x3a2cc1[_0x209c('0x1f')](_0x5afc0f);_0x3a2cc1[_0x209c('0x1d')](0x0);return;}})[_0x209c('0x27')](function(){if(_0x57b1a3[_0x209c('0x91')]==='web'){return null;}var _0x1ebea0=_['merge'](_0x57b1a3,{'name':_0x57b1a3[_0x209c('0x92')]||_0x57b1a3['name']||_0xdf57ed[_0x209c('0x2d')],'basename':_0x9ab552,'savename':util[_0x209c('0x7b')](_0x209c('0x93'),_0x57b1a3['name']||_0xdf57ed[_0x209c('0x2d')],require('randomstring')['generate'](0x4),_0x57b1a3[_0x209c('0x91')]||_0x209c('0x94')),'reportId':_0xdf57ed['id'],'reportType':'custom'});return db[_0x209c('0x95')][_0x209c('0x4a')](_0x1ebea0,{'raw':!![]});})[_0x209c('0x27')](function(_0x82aae9){if(_0xdf57ed['table']===_0x209c('0x96')){_0x13779b[_0x209c('0x3d')](_0xdf57ed[_0x209c('0x76')]+_0x209c('0x97'),_0x57b1a3[_0x209c('0x98')],_0x57b1a3['endDate']);}else{_0x13779b[_0x209c('0x3d')](_0xdf57ed['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x57b1a3[_0x209c('0x98')],_0x57b1a3[_0x209c('0x99')]);}if(_0x82aae9){logger[_0x209c('0x9a')]('Run\x20Query:',_0x13779b[_0x209c('0x88')]());require(_0x209c('0x9b'))[_0x209c('0x9c')](path[_0x209c('0x54')](__dirname,_0x209c('0x9d'),_0x82aae9['output']),[_0x82aae9['id'],_0x13779b[_0x209c('0x88')](),path['join'](__dirname,_0x209c('0x9e'),_0x82aae9[_0x209c('0x9f')]),_0x9ab552]);return _0x82aae9;}else{var _0x4f1135=squel[_0x209c('0x74')]();_0x4f1135['from']('('+_0x13779b[_0x209c('0x88')]()+')',_0x209c('0xa0'));_0x4f1135[_0x209c('0x6a')](_0x209c('0xa1'),_0x209c('0x20'));_0x13779b['limit'](_0x57b1a3[_0x209c('0x1f')]||_0x5afc0f);_0x13779b['offset'](_0x57b1a3[_0x209c('0x1d')]||0x0);return dbH['sequelize']['query'](_0x4f1135['toString'](),{'type':dbH['sequelize'][_0x209c('0x8a')][_0x209c('0x8b')]})['then'](function(_0x49e479){if(!_0x49e479['length']){_0x2ee604=0x0;}else{_0x2ee604=_0x49e479[0x0][_0x209c('0x20')]||0x0;}return dbH[_0x209c('0x89')][_0x209c('0x34')](_0x13779b['toString'](),{'type':dbH[_0x209c('0x89')][_0x209c('0x8a')][_0x209c('0x8b')]});})[_0x209c('0x27')](function(_0x4ea338){return{'rows':_0x4ea338||[],'count':_0x2ee604};});}});}exports[_0x209c('0xa2')]=function(_0x85355e,_0x2823be){return runReport(_0x85355e['params'],_0x85355e[_0x209c('0x34')],_0x85355e[_0x209c('0x40')])[_0x209c('0x27')](respondWithResult(_0x2823be,null))[_0x209c('0x49')](handleError(_0x2823be,null));};exports[_0x209c('0xa3')]=runReport;exports['query']=function(_0x31c530,_0x4c68d9){var _0x42dd23=0xa;var _0x301f37=['join',_0x209c('0x55'),_0x209c('0x56'),'cross_join'];var _0x2042e7={'SUM':_0x209c('0x58'),'COUNT':_0x209c('0x8c'),'COUNT DISTINCT':_0x209c('0x59'),'MAX':_0x209c('0x5a'),'MIN':_0x209c('0x5b'),'AVG':_0x209c('0x5c'),'GROUP_CONCAT':_0x209c('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x209c('0x8d')};var _0x48b345={'SEC_TO_TIME':_0x209c('0x5f'),'DATE':_0x209c('0x60'),'HOUR':_0x209c('0x61'),'ROUND':_0x209c('0x62'),'UNIX_TIMESTAMP':_0x209c('0x63')};var _0x538e82=function(_0x3cb942){return!_[_0x209c('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x209c('0x8f'),_0x209c('0x66')],_0x3cb942);};var _0x78c3c0=function(_0x396f2c){if(!_0x396f2c||!_0x396f2c[_0x209c('0x67')][_0x209c('0x38')]){return'';}for(var _0x593bde='(',_0x5579d9=0x0;_0x5579d9<_0x396f2c[_0x209c('0x67')][_0x209c('0x38')];_0x5579d9+=0x1){_0x5579d9>0x0&&(_0x593bde+='\x20'+_0x396f2c[_0x209c('0x68')]+'\x20');_0x593bde+=_0x396f2c[_0x209c('0x67')][_0x5579d9]['group']?_0x78c3c0(_0x396f2c[_0x209c('0x67')][_0x5579d9][_0x209c('0x69')]):_0x396f2c[_0x209c('0x67')][_0x5579d9][_0x209c('0x6a')]+'\x20'+_0x396f2c[_0x209c('0x67')][_0x5579d9][_0x209c('0x6b')]+(_0x538e82(_0x396f2c[_0x209c('0x67')][_0x5579d9]['condition'])?'\x20'+_0x396f2c[_0x209c('0x67')][_0x5579d9][_0x209c('0x6c')]:'');}return _0x593bde+')';};var _0x37b319={'where':{'id':_0x31c530[_0x209c('0x45')]['id']}},_0x4d4145,_0x913207,_0x562158,_0x4251d4,_0x2579fb;_0x37b319=_['merge']({},_0x37b319,_0x31c530['options']);return db['AnalyticCustomReport']['find'](_0x37b319)[_0x209c('0x27')](function(_0x191a07){if(_0x191a07){_0x4d4145=_0x191a07;return _0x191a07['getFields']();}return null;})[_0x209c('0x27')](function(_0xb3254e){if(_0xb3254e){if(!_0xb3254e[_0x209c('0x38')]){throw new db[(_0x209c('0x6f'))]['ValidationErrorItem'](_0x209c('0x71'),0x193);}_0x913207=_0xb3254e;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x209c('0x27')](function(_0x5a873c){if(_0x5a873c){_0x562158=_[_0x209c('0x73')](_0x5a873c,'id');var _0x4e9fab;var _0x487472=squel[_0x209c('0x74')]();_0x487472['from'](_0x4d4145[_0x209c('0x76')]);for(var _0x5b27ae=0x0;_0x5b27ae<_0x913207['length'];_0x5b27ae+=0x1){_0x4e9fab=_0x913207[_0x5b27ae][_0x209c('0x77')]?_0x562158[_0x913207[_0x5b27ae]['MetricId']][_0x209c('0x78')]:_0x913207[_0x5b27ae][_0x209c('0x6a')];_0x4e9fab=_0x913207[_0x5b27ae][_0x209c('0x79')]?_[_0x209c('0x7a')](_0x2042e7[_0x913207[_0x5b27ae][_0x209c('0x79')]],'%s',_0x4e9fab):_0x4e9fab;_0x4e9fab=_0x913207[_0x5b27ae][_0x209c('0x7b')]?_[_0x209c('0x7a')](_0x48b345[_0x913207[_0x5b27ae][_0x209c('0x7b')]],'%s',_0x4e9fab):_0x4e9fab;if(_0x913207[_0x5b27ae]['groupBy']){_0x487472['group'](_0x4e9fab);}_0x913207[_0x5b27ae][_0x209c('0x7d')]&&_0x487472[_0x209c('0x3a')](_0x4e9fab,_0x913207[_0x5b27ae]['orderBy']===_0x209c('0x7e')?![]:!![]);_0x487472[_0x209c('0x6a')](_0x4e9fab,_0x913207[_0x5b27ae]['alias']||_0x4e9fab);}if(_0x4d4145[_0x209c('0x80')]){_0x4d4145[_0x209c('0x80')]=JSON['parse'](_0x4d4145[_0x209c('0x80')]);for(var _0x185441=0x0;_0x185441<_0x4d4145[_0x209c('0x80')][_0x209c('0x38')];_0x185441+=0x1){if(_0x4d4145['joins'][_0x185441][_0x209c('0x32')]&&_[_0x209c('0x64')](_0x301f37,_0x4d4145['joins'][_0x185441][_0x209c('0x32')])&&_0x4d4145[_0x209c('0x80')][_0x185441][_0x209c('0x82')]&&_0x4d4145['joins'][_0x185441][_0x209c('0x83')]&&_0x4d4145['joins'][_0x185441][_0x209c('0x84')]){_0x487472[_0x4d4145[_0x209c('0x80')][_0x185441][_0x209c('0x32')]](_0x4d4145[_0x209c('0x80')][_0x185441][_0x209c('0x83')],null,util[_0x209c('0x7b')](_0x209c('0x90'),_0x4d4145[_0x209c('0x76')],_0x4d4145['joins'][_0x185441][_0x209c('0x82')],_0x4d4145[_0x209c('0x80')][_0x185441][_0x209c('0x83')],_0x4d4145[_0x209c('0x80')][_0x185441][_0x209c('0x84')]));}}}if(_0x4d4145['conditions']){_0x4d4145[_0x209c('0x85')]=JSON['parse'](_0x4d4145['conditions']);_0x487472[_0x209c('0x3d')](_0x78c3c0(_0x4d4145[_0x209c('0x85')][_0x209c('0x69')]));}_0x2579fb=_0x487472[_0x209c('0x86')]();_0x487472[_0x209c('0x1f')](_0x42dd23);_0x487472[_0x209c('0x1d')](0x0);logger[_0x209c('0x87')](_0x209c('0xa4'),_0x487472[_0x209c('0x88')]());return dbH['sequelize'][_0x209c('0x34')](_0x487472[_0x209c('0x88')](),{'type':dbH[_0x209c('0x89')][_0x209c('0x8a')]['SELECT']});}})[_0x209c('0x27')](function(){return{'sql':_0x2579fb['toString']()};})['then'](respondWithResult(_0x4c68d9,null))['catch'](handleError(_0x4c68d9,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 53aca95..a4d8f93 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 _0x4e46=['path','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x522d42,_0x9e9a4e){var _0x29a207=function(_0x15b1c5){while(--_0x15b1c5){_0x522d42['push'](_0x522d42['shift']());}};_0x29a207(++_0x9e9a4e);}(_0x4e46,0x186));var _0x64e4=function(_0x2c6e27,_0x180fa8){_0x2c6e27=_0x2c6e27-0x0;var _0x3bc68c=_0x4e46[_0x2c6e27];return _0x3bc68c;};'use strict';var _=require(_0x64e4('0x0'));var util=require(_0x64e4('0x1'));var logger=require(_0x64e4('0x2'))(_0x64e4('0x3'));var moment=require(_0x64e4('0x4'));var BPromise=require(_0x64e4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64e4('0x6'));var rimraf=require(_0x64e4('0x7'));var config=require('../../config/environment');var attributes=require(_0x64e4('0x8'));module['exports']=function(_0x14a846,_0x3f331b){return _0x14a846[_0x64e4('0x9')](_0x64e4('0xa'),attributes,{'tableName':_0x64e4('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x469a=['api','moment','bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x5bccf5,_0x3ac98b){var _0x35a840=function(_0x46782b){while(--_0x46782b){_0x5bccf5['push'](_0x5bccf5['shift']());}};_0x35a840(++_0x3ac98b);}(_0x469a,0x1a2));var _0xa469=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x469a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa469('0x0'));var util=require(_0xa469('0x1'));var logger=require('../../config/logger')(_0xa469('0x2'));var moment=require(_0xa469('0x3'));var BPromise=require(_0xa469('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa469('0x5'));var rimraf=require('rimraf');var config=require(_0xa469('0x6'));var attributes=require(_0xa469('0x7'));module[_0xa469('0x8')]=function(_0x45bef4,_0x251f5c){return _0x45bef4[_0xa469('0x9')](_0xa469('0xa'),attributes,{'tableName':_0xa469('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 3a230fe..f489d3f 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 _0x3854=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x5d3c0e,_0x1ce1e7){var _0x3f9d4e=function(_0x260ff0){while(--_0x260ff0){_0x5d3c0e['push'](_0x5d3c0e['shift']());}};_0x3f9d4e(++_0x1ce1e7);}(_0x3854,0x184));var _0x4385=function(_0x52a8da,_0x5d9213){_0x52a8da=_0x52a8da-0x0;var _0x5e9460=_0x3854[_0x52a8da];return _0x5e9460;};'use strict';var _=require('lodash');var util=require(_0x4385('0x0'));var moment=require(_0x4385('0x1'));var BPromise=require(_0x4385('0x2'));var rs=require(_0x4385('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4385('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4385('0x5'))(_0x4385('0x6'));var config=require(_0x4385('0x7'));var jayson=require(_0x4385('0x8'));var client=jayson['client'][_0x4385('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f49f8,_0x54db25,_0xc693a){return new BPromise(function(_0x4e9304,_0x198d3b){return client['request'](_0x3f49f8,_0xc693a)[_0x4385('0xa')](function(_0x23a34f){logger[_0x4385('0xb')](_0x4385('0xc'),_0x54db25,'request\x20sent');logger['debug'](_0x4385('0xd'),_0x54db25,'request\x20sent',JSON[_0x4385('0xe')](_0x23a34f));if(_0x23a34f['error']){if(_0x23a34f['error']['code']===0x1f4){logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x23a34f[_0x4385('0xf')][_0x4385('0x10')]);return _0x198d3b(_0x23a34f['error'][_0x4385('0x10')]);}logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x23a34f[_0x4385('0xf')][_0x4385('0x10')]);return _0x4e9304(_0x23a34f['error']['message']);}else{logger['info'](_0x4385('0xc'),_0x54db25,_0x4385('0x11'));_0x4e9304(_0x23a34f[_0x4385('0x12')]['message']);}})[_0x4385('0x13')](function(_0x44e114){logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x44e114);_0x198d3b(_0x44e114);});});} \ No newline at end of file +var _0x2165=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x280213,_0x1072f7){var _0x2fcf53=function(_0x26019d){while(--_0x26019d){_0x280213['push'](_0x280213['shift']());}};_0x2fcf53(++_0x1072f7);}(_0x2165,0x7a));var _0x5216=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x2165[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5216('0x0'));var BPromise=require(_0x5216('0x1'));var rs=require(_0x5216('0x2'));var fs=require('fs');var Redis=require(_0x5216('0x3'));var db=require(_0x5216('0x4'))['db'];var utils=require(_0x5216('0x5'));var logger=require(_0x5216('0x6'))(_0x5216('0x7'));var config=require(_0x5216('0x8'));var jayson=require(_0x5216('0x9'));var client=jayson[_0x5216('0xa')][_0x5216('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14d3e7,_0x4c0b9c,_0x16a007){return new BPromise(function(_0x2ee674,_0x1c7ea3){return client['request'](_0x14d3e7,_0x16a007)[_0x5216('0xc')](function(_0xf588af){logger['info'](_0x5216('0xd'),_0x4c0b9c,_0x5216('0xe'));logger[_0x5216('0xf')](_0x5216('0x10'),_0x4c0b9c,_0x5216('0xe'),JSON[_0x5216('0x11')](_0xf588af));if(_0xf588af[_0x5216('0x12')]){if(_0xf588af['error'][_0x5216('0x13')]===0x1f4){logger[_0x5216('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c0b9c,_0xf588af[_0x5216('0x12')][_0x5216('0x14')]);return _0x1c7ea3(_0xf588af[_0x5216('0x12')][_0x5216('0x14')]);}logger[_0x5216('0x12')](_0x5216('0xd'),_0x4c0b9c,_0xf588af[_0x5216('0x12')][_0x5216('0x14')]);return _0x2ee674(_0xf588af['error'][_0x5216('0x14')]);}else{logger[_0x5216('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c0b9c,_0x5216('0xe'));_0x2ee674(_0xf588af[_0x5216('0x16')]['message']);}})[_0x5216('0x17')](function(_0x52bbf5){logger['error'](_0x5216('0xd'),_0x4c0b9c,_0x52bbf5);_0x1c7ea3(_0x52bbf5);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a028797..b87db78 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 _0x7529=['fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','/:id/query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2314dc,_0x22fc7e){var _0x56e6d2=function(_0x1556ac){while(--_0x1556ac){_0x2314dc['push'](_0x2314dc['shift']());}};_0x56e6d2(++_0x22fc7e);}(_0x7529,0x1c8));var _0x9752=function(_0x30c0bb,_0x250cd6){_0x30c0bb=_0x30c0bb-0x0;var _0x5442bd=_0x7529[_0x30c0bb];return _0x5442bd;};'use strict';var multer=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var path=require('path');var timeout=require(_0x9752('0x2'));var express=require(_0x9752('0x3'));var router=express['Router']();var fs_extra=require(_0x9752('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9752('0x5'));var config=require(_0x9752('0x6'));var controller=require(_0x9752('0x7'));router[_0x9752('0x8')]('/',auth['isAuthenticated'](),controller[_0x9752('0x9')]);router['get'](_0x9752('0xa'),auth[_0x9752('0xb')](),controller['show']);router[_0x9752('0x8')](_0x9752('0xc'),auth[_0x9752('0xb')](),controller['preview']);router[_0x9752('0x8')]('/:id/run',auth[_0x9752('0xb')](),controller['run']);router[_0x9752('0x8')](_0x9752('0xd'),auth[_0x9752('0xb')](),controller['query']);router[_0x9752('0xe')]('/',auth[_0x9752('0xb')](),controller[_0x9752('0xf')]);router['put'](_0x9752('0xa'),auth[_0x9752('0xb')](),controller[_0x9752('0x10')]);router[_0x9752('0x11')](_0x9752('0xa'),auth[_0x9752('0xb')](),controller[_0x9752('0x12')]);module[_0x9752('0x13')]=router; \ No newline at end of file +var _0x53d5=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put'];(function(_0x1f5b2c,_0xb26f1b){var _0x57f588=function(_0x16f16f){while(--_0x16f16f){_0x1f5b2c['push'](_0x1f5b2c['shift']());}};_0x57f588(++_0xb26f1b);}(_0x53d5,0x194));var _0x553d=function(_0x2253ea,_0x6320e){_0x2253ea=_0x2253ea-0x0;var _0x2d046c=_0x53d5[_0x2253ea];return _0x2d046c;};'use strict';var multer=require(_0x553d('0x0'));var util=require(_0x553d('0x1'));var path=require(_0x553d('0x2'));var timeout=require(_0x553d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x553d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x553d('0x5'));var config=require(_0x553d('0x6'));var controller=require(_0x553d('0x7'));router[_0x553d('0x8')]('/',auth[_0x553d('0x9')](),controller[_0x553d('0xa')]);router['get'](_0x553d('0xb'),auth[_0x553d('0x9')](),controller[_0x553d('0xc')]);router[_0x553d('0x8')](_0x553d('0xd'),auth[_0x553d('0x9')](),controller[_0x553d('0xe')]);router[_0x553d('0x8')](_0x553d('0xf'),auth[_0x553d('0x9')](),controller[_0x553d('0x10')]);router[_0x553d('0x8')](_0x553d('0x11'),auth[_0x553d('0x9')](),controller['query']);router[_0x553d('0x12')]('/',auth[_0x553d('0x9')](),controller[_0x553d('0x13')]);router[_0x553d('0x14')](_0x553d('0xb'),auth[_0x553d('0x9')](),controller[_0x553d('0x15')]);router[_0x553d('0x16')](_0x553d('0xb'),auth['isAuthenticated'](),controller[_0x553d('0x17')]);module[_0x553d('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 a114c17..b92e17b 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x38ccad,_0x4d3983){var _0x4de86a=function(_0x1e81b7){while(--_0x1e81b7){_0x38ccad['push'](_0x38ccad['shift']());}};_0x4de86a(++_0x4d3983);}(_0xeff8,0x186));var _0x8eff=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xeff8[_0x18fb16];return _0x147b0d;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x2675,0x75));var _0x5267=function(_0x42838a,_0x25bf15){_0x42838a=_0x42838a-0x0;var _0x23ce02=_0x2675[_0x42838a];return _0x23ce02;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 98ba47d..0b48c92 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x49f641,_0x5d3a7a){var _0x4aae8b=function(_0x43d354){while(--_0x43d354){_0x49f641['push'](_0x49f641['shift']());}};_0x4aae8b(++_0x5d3a7a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0x5fc3[_0x1c5950];return _0x2b720a;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x4058eb,_0x3a5fdd){var _0x316e44=function(_0x2e72c9){while(--_0x2e72c9){_0x4058eb['push'](_0x4058eb['shift']());}};_0x316e44(++_0x3a5fdd);}(_0x524e,0x15e));var _0xe524=function(_0x21d597,_0x5d9373){_0x21d597=_0x21d597-0x0;var _0x1d5fcf=_0x524e[_0x21d597];return _0x1d5fcf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index c4ca9a1..023c1ff 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 _0x8bba=['bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x529753,_0x3da23e){var _0x2b166c=function(_0x19fffa){while(--_0x19fffa){_0x529753['push'](_0x529753['shift']());}};_0x2b166c(++_0x3da23e);}(_0x8bba,0x18e));var _0xa8bb=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8bba[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xa8bb('0x0'));var util=require(_0xa8bb('0x1'));var logger=require(_0xa8bb('0x2'))(_0xa8bb('0x3'));var moment=require(_0xa8bb('0x4'));var BPromise=require(_0xa8bb('0x5'));var rp=require(_0xa8bb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8bb('0x7'));var attributes=require(_0xa8bb('0x8'));module[_0xa8bb('0x9')]=function(_0x595204,_0x3389e0){return _0x595204[_0xa8bb('0xa')](_0xa8bb('0xb'),attributes,{'tableName':_0xa8bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7b0=['path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','util','api','bluebird','request-promise'];(function(_0xb628ca,_0x53e3a5){var _0x381cc8=function(_0x7b343){while(--_0x7b343){_0xb628ca['push'](_0xb628ca['shift']());}};_0x381cc8(++_0x53e3a5);}(_0xd7b0,0x19e));var _0x0d7b=function(_0x368ed0,_0x3e2119){_0x368ed0=_0x368ed0-0x0;var _0x34ad64=_0xd7b0[_0x368ed0];return _0x34ad64;};'use strict';var _=require('lodash');var util=require(_0x0d7b('0x0'));var logger=require('../../config/logger')(_0x0d7b('0x1'));var moment=require('moment');var BPromise=require(_0x0d7b('0x2'));var rp=require(_0x0d7b('0x3'));var fs=require('fs');var path=require(_0x0d7b('0x4'));var rimraf=require(_0x0d7b('0x5'));var config=require(_0x0d7b('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x0d7b('0x7')]=function(_0x535b83,_0x5d249d){return _0x535b83[_0x0d7b('0x8')](_0x0d7b('0x9'),attributes,{'tableName':_0x0d7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index dd7bb51..a53ca19 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 _0xe5f6=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4a3727,_0x3a4b1d){var _0x299151=function(_0x3d4a9a){while(--_0x3d4a9a){_0x4a3727['push'](_0x4a3727['shift']());}};_0x299151(++_0x3a4b1d);}(_0xe5f6,0x177));var _0x6e5f=function(_0x3a7ed0,_0x2da3e4){_0x3a7ed0=_0x3a7ed0-0x0;var _0xe9256f=_0xe5f6[_0x3a7ed0];return _0xe9256f;};'use strict';var _=require(_0x6e5f('0x0'));var util=require('util');var moment=require(_0x6e5f('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e5f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e5f('0x3'))['db'];var utils=require(_0x6e5f('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6e5f('0x5'));var client=jayson[_0x6e5f('0x6')][_0x6e5f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ed1b9,_0xb799c0,_0x45e9a5){return new BPromise(function(_0x1487b0,_0x3ae34b){return client['request'](_0x5ed1b9,_0x45e9a5)[_0x6e5f('0x8')](function(_0xed35f1){logger[_0x6e5f('0x9')](_0x6e5f('0xa'),_0xb799c0,_0x6e5f('0xb'));logger[_0x6e5f('0xc')](_0x6e5f('0xd'),_0xb799c0,'request\x20sent',JSON['stringify'](_0xed35f1));if(_0xed35f1[_0x6e5f('0xe')]){if(_0xed35f1[_0x6e5f('0xe')]['code']===0x1f4){logger[_0x6e5f('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xb799c0,_0xed35f1[_0x6e5f('0xe')][_0x6e5f('0xf')]);return _0x3ae34b(_0xed35f1[_0x6e5f('0xe')][_0x6e5f('0xf')]);}logger[_0x6e5f('0xe')](_0x6e5f('0xa'),_0xb799c0,_0xed35f1[_0x6e5f('0xe')][_0x6e5f('0xf')]);return _0x1487b0(_0xed35f1[_0x6e5f('0xe')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0xb799c0,'request\x20sent');_0x1487b0(_0xed35f1['result']['message']);}})[_0x6e5f('0x10')](function(_0x49faa7){logger[_0x6e5f('0xe')](_0x6e5f('0xa'),_0xb799c0,_0x49faa7);_0x3ae34b(_0x49faa7);});});} \ No newline at end of file +var _0x827c=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x18ba85,_0x4fa115){var _0x8665cc=function(_0x174dfe){while(--_0x174dfe){_0x18ba85['push'](_0x18ba85['shift']());}};_0x8665cc(++_0x4fa115);}(_0x827c,0x1de));var _0xc827=function(_0x24b9e4,_0x927bce){_0x24b9e4=_0x24b9e4-0x0;var _0xdc8b54=_0x827c[_0x24b9e4];return _0xdc8b54;};'use strict';var _=require('lodash');var util=require(_0xc827('0x0'));var moment=require(_0xc827('0x1'));var BPromise=require(_0xc827('0x2'));var rs=require(_0xc827('0x3'));var fs=require('fs');var Redis=require(_0xc827('0x4'));var db=require(_0xc827('0x5'))['db'];var utils=require(_0xc827('0x6'));var logger=require(_0xc827('0x7'))(_0xc827('0x8'));var config=require(_0xc827('0x9'));var jayson=require(_0xc827('0xa'));var client=jayson[_0xc827('0xb')][_0xc827('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x155648,_0x2e108b,_0x68a47a){return new BPromise(function(_0x5a2b6e,_0x91776b){return client[_0xc827('0xd')](_0x155648,_0x68a47a)[_0xc827('0xe')](function(_0x8e8c2){logger['info'](_0xc827('0xf'),_0x2e108b,_0xc827('0x10'));logger[_0xc827('0x11')](_0xc827('0x12'),_0x2e108b,_0xc827('0x10'),JSON[_0xc827('0x13')](_0x8e8c2));if(_0x8e8c2[_0xc827('0x14')]){if(_0x8e8c2[_0xc827('0x14')][_0xc827('0x15')]===0x1f4){logger[_0xc827('0x14')](_0xc827('0xf'),_0x2e108b,_0x8e8c2[_0xc827('0x14')][_0xc827('0x16')]);return _0x91776b(_0x8e8c2['error'][_0xc827('0x16')]);}logger[_0xc827('0x14')](_0xc827('0xf'),_0x2e108b,_0x8e8c2[_0xc827('0x14')][_0xc827('0x16')]);return _0x5a2b6e(_0x8e8c2[_0xc827('0x14')][_0xc827('0x16')]);}else{logger[_0xc827('0x17')](_0xc827('0xf'),_0x2e108b,_0xc827('0x10'));_0x5a2b6e(_0x8e8c2[_0xc827('0x18')][_0xc827('0x16')]);}})[_0xc827('0x19')](function(_0x210ec3){logger[_0xc827('0x14')](_0xc827('0xf'),_0x2e108b,_0x210ec3);_0x91776b(_0x210ec3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a31eab4..6707405 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 _0x616f=['fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3cebba,_0x2fe545){var _0x28d991=function(_0x481313){while(--_0x481313){_0x3cebba['push'](_0x3cebba['shift']());}};_0x28d991(++_0x2fe545);}(_0x616f,0xcb));var _0xf616=function(_0x229e80,_0x414425){_0x229e80=_0x229e80-0x0;var _0x30c4a4=_0x616f[_0x229e80];return _0x30c4a4;};'use strict';var multer=require(_0xf616('0x0'));var util=require(_0xf616('0x1'));var path=require(_0xf616('0x2'));var timeout=require(_0xf616('0x3'));var express=require('express');var router=express[_0xf616('0x4')]();var fs_extra=require(_0xf616('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf616('0x6'));var config=require(_0xf616('0x7'));var controller=require(_0xf616('0x8'));router[_0xf616('0x9')]('/',auth['isAuthenticated'](),controller[_0xf616('0xa')]);router['get']('/:id',auth[_0xf616('0xb')](),controller[_0xf616('0xc')]);router['get'](_0xf616('0xd'),auth[_0xf616('0xb')](),controller[_0xf616('0xe')]);router[_0xf616('0x9')](_0xf616('0xf'),auth['isAuthenticated'](),controller[_0xf616('0x10')]);router[_0xf616('0x9')](_0xf616('0x11'),auth[_0xf616('0xb')](),controller[_0xf616('0x12')]);router[_0xf616('0x13')]('/',auth[_0xf616('0xb')](),controller[_0xf616('0x14')]);router[_0xf616('0x15')](_0xf616('0x16'),auth[_0xf616('0xb')](),controller['update']);router[_0xf616('0x17')]('/:id',auth[_0xf616('0xb')](),controller[_0xf616('0x18')]);module[_0xf616('0x19')]=router; \ No newline at end of file +var _0x3a53=['/:id/run','run','/:id/query','query','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview'];(function(_0x3f23dc,_0x3ea6a4){var _0x33edd4=function(_0x3664c5){while(--_0x3664c5){_0x3f23dc['push'](_0x3f23dc['shift']());}};_0x33edd4(++_0x3ea6a4);}(_0x3a53,0xa2));var _0x33a5=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0x3a53[_0x413727];return _0x5f46d7;};'use strict';var multer=require(_0x33a5('0x0'));var util=require(_0x33a5('0x1'));var path=require('path');var timeout=require(_0x33a5('0x2'));var express=require('express');var router=express[_0x33a5('0x3')]();var fs_extra=require(_0x33a5('0x4'));var auth=require(_0x33a5('0x5'));var interaction=require(_0x33a5('0x6'));var config=require(_0x33a5('0x7'));var controller=require(_0x33a5('0x8'));router[_0x33a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x33a5('0xa')]);router[_0x33a5('0x9')](_0x33a5('0xb'),auth[_0x33a5('0xc')](),controller['show']);router[_0x33a5('0x9')](_0x33a5('0xd'),auth[_0x33a5('0xc')](),controller['preview']);router[_0x33a5('0x9')](_0x33a5('0xe'),auth[_0x33a5('0xc')](),controller[_0x33a5('0xf')]);router[_0x33a5('0x9')](_0x33a5('0x10'),auth[_0x33a5('0xc')](),controller[_0x33a5('0x11')]);router['post']('/',auth[_0x33a5('0xc')](),controller['create']);router[_0x33a5('0x12')](_0x33a5('0xb'),auth[_0x33a5('0xc')](),controller[_0x33a5('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x33a5('0x14')]);module[_0x33a5('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0845d95..f32422c 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 _0xb467=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment','STRING','ENUM'];(function(_0x18c617,_0x44b6f7){var _0x139004=function(_0x9b3c09){while(--_0x9b3c09){_0x18c617['push'](_0x18c617['shift']());}};_0x139004(++_0x44b6f7);}(_0xb467,0x13c));var _0x7b46=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xb467[_0x52f1e6];return _0x21f104;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7b46('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b46('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x7b46('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x7b46('0x2')](_0x7b46('0x3'),_0x7b46('0x4'),_0x7b46('0x5')),'allowNull':![],'defaultValue':_0x7b46('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x7b46('0x6')]},'endDate':{'type':Sequelize[_0x7b46('0x6')]},'status':{'type':Sequelize[_0x7b46('0x1')],'defaultValue':_0x7b46('0x7')},'type':{'type':Sequelize[_0x7b46('0x2')](_0x7b46('0x8'),_0x7b46('0x9')),'allowNull':![],'defaultValue':_0x7b46('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x7b46('0xa')]},'reportType':{'type':Sequelize[_0x7b46('0x1')]}}; \ No newline at end of file +var _0xf095=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','sequelize'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf095,0x128));var _0x5f09=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0xf095[_0x4e9f29];return _0x8e1ab3;};'use strict';var Sequelize=require(_0x5f09('0x0'));var moment=require(_0x5f09('0x1'));module[_0x5f09('0x2')]={'name':{'type':Sequelize[_0x5f09('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5f09('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5f09('0x4')](_0x5f09('0x5'),_0x5f09('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x5f09('0x5')},'savename':{'type':Sequelize[_0x5f09('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x5f09('0x7')]},'status':{'type':Sequelize[_0x5f09('0x3')],'defaultValue':_0x5f09('0x8')},'type':{'type':Sequelize[_0x5f09('0x4')](_0x5f09('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x5f09('0x9')},'reportId':{'type':Sequelize[_0x5f09('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5f09('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 65de671..5c1fbe8 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 _0x69d3=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ExtractedReports','then','sendStatus','error','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x38b156,_0x4ddc19){var _0x197478=function(_0x361ba1){while(--_0x361ba1){_0x38b156['push'](_0x38b156['shift']());}};_0x197478(++_0x4ddc19);}(_0x69d3,0x1d8));var _0x369d=function(_0xeb2d79,_0x42b393){_0xeb2d79=_0xeb2d79-0x0;var _0x1db6ac=_0x69d3[_0xeb2d79];return _0x1db6ac;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require(_0x369d('0x3'));var rp=require(_0x369d('0x4'));var moment=require('moment');var BPromise=require(_0x369d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x369d('0x6'));var csv=require(_0x369d('0x7'));var ejs=require(_0x369d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x369d('0x9'));var jsforce=require(_0x369d('0xa'));var deskjs=require(_0x369d('0xb'));var toCsv=require(_0x369d('0x7'));var querystring=require(_0x369d('0xc'));var Papa=require(_0x369d('0xd'));var Redis=require('ioredis');var authService=require(_0x369d('0xe'));var qs=require(_0x369d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x369d('0x10'));var logger=require('../../config/logger')(_0x369d('0x11'));var utils=require(_0x369d('0x12'));var config=require(_0x369d('0x13'));var licenseUtil=require(_0x369d('0x14'));var db=require(_0x369d('0x15'))['db'];function respondWithStatusCode(_0x7578c8,_0x4881db){_0x4881db=_0x4881db||0xcc;return function(_0x515d67){if(_0x515d67){return _0x7578c8['sendStatus'](_0x4881db);}return _0x7578c8[_0x369d('0x16')](_0x4881db)[_0x369d('0x17')]();};}function respondWithResult(_0x2fe874,_0x2a2e5c){_0x2a2e5c=_0x2a2e5c||0xc8;return function(_0x4b09f8){if(_0x4b09f8){return _0x2fe874[_0x369d('0x16')](_0x2a2e5c)[_0x369d('0x18')](_0x4b09f8);}};}function respondWithFilteredResult(_0x261e64,_0x30a916){return function(_0x3f40e8){if(_0x3f40e8){var _0x21ffa0=typeof _0x30a916[_0x369d('0x19')]===_0x369d('0x1a')&&typeof _0x30a916[_0x369d('0x1b')]===_0x369d('0x1a');var _0x415a1a=_0x3f40e8[_0x369d('0x1c')];var _0xef257f=_0x21ffa0?0x0:_0x30a916[_0x369d('0x19')];var _0x5a2fef=_0x21ffa0?_0x3f40e8[_0x369d('0x1c')]:_0x30a916[_0x369d('0x19')]+_0x30a916[_0x369d('0x1b')];var _0x3f8d4a;if(_0x5a2fef>=_0x415a1a){_0x5a2fef=_0x415a1a;_0x3f8d4a=0xc8;}else{_0x3f8d4a=0xce;}_0x261e64[_0x369d('0x16')](_0x3f8d4a);return _0x261e64[_0x369d('0x1d')](_0x369d('0x1e'),_0xef257f+'-'+_0x5a2fef+'/'+_0x415a1a)[_0x369d('0x18')](_0x3f40e8);}return null;};}function patchUpdates(_0x524cec){return function(_0x152f98){try{jsonpatch[_0x369d('0x1f')](_0x152f98,_0x524cec,!![]);}catch(_0x4d46c7){return BPromise[_0x369d('0x20')](_0x4d46c7);}return _0x152f98[_0x369d('0x21')]();};}function saveUpdates(_0x3be63b,_0x5a4875){return function(_0x59d569){if(_0x59d569){return _0x59d569[_0x369d('0x22')](_0x3be63b)['then'](function(_0xc9e7ec){return _0xc9e7ec;});}return null;};}function removeEntity(_0x19dd25,_0xa3fca8){return function(_0x39375e){if(_0x39375e){return _0x39375e[_0x369d('0x23')]()['then'](function(){var _0x2e195a=_0x39375e[_0x369d('0x24')]({'plain':!![]});var _0x540363=_0x369d('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x540363,'resourceId':_0x2e195a['id']}})[_0x369d('0x26')](function(){return _0x39375e;});})[_0x369d('0x26')](function(){_0x19dd25[_0x369d('0x16')](0xcc)[_0x369d('0x17')]();});}};}function handleEntityNotFound(_0x513278,_0x154e1d){return function(_0x425bbe){if(!_0x425bbe){_0x513278[_0x369d('0x27')](0x194);}return _0x425bbe;};}function handleError(_0xd0aed7,_0x5df282){_0x5df282=_0x5df282||0x1f4;return function(_0xf8471d){logger[_0x369d('0x28')](_0xf8471d['stack']);if(_0xf8471d[_0x369d('0x29')]){delete _0xf8471d[_0x369d('0x29')];}_0xd0aed7[_0x369d('0x16')](_0x5df282)[_0x369d('0x2a')](_0xf8471d);};}exports[_0x369d('0x2b')]=function(_0x343318,_0x15d1f7){var _0x595445={},_0x4156e7={},_0x5c7f97={'count':0x0,'rows':[]};var _0x54b700=_[_0x369d('0x2c')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x41c112){return{'name':_0x41c112[_0x369d('0x2d')],'type':_0x41c112[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x4156e7['model']=_[_0x369d('0x2c')](_0x54b700,'name');_0x4156e7['query']=_[_0x369d('0x30')](_0x343318[_0x369d('0x31')]);_0x4156e7[_0x369d('0x32')]=_[_0x369d('0x33')](_0x4156e7[_0x369d('0x34')],_0x4156e7[_0x369d('0x31')]);_0x595445['attributes']=_['intersection'](_0x4156e7[_0x369d('0x34')],qs[_0x369d('0x35')](_0x343318['query'][_0x369d('0x35')]));_0x595445['attributes']=_0x595445['attributes'][_0x369d('0x36')]?_0x595445[_0x369d('0x37')]:_0x4156e7[_0x369d('0x34')];if(!_0x343318[_0x369d('0x31')][_0x369d('0x38')](_0x369d('0x39'))){_0x595445[_0x369d('0x1b')]=qs['limit'](_0x343318[_0x369d('0x31')]['limit']);_0x595445[_0x369d('0x19')]=qs[_0x369d('0x19')](_0x343318[_0x369d('0x31')][_0x369d('0x19')]);}_0x595445[_0x369d('0x3a')]=qs['sort'](_0x343318[_0x369d('0x31')][_0x369d('0x3b')]);_0x595445[_0x369d('0x3c')]=qs[_0x369d('0x32')](_[_0x369d('0x3d')](_0x343318[_0x369d('0x31')],_0x4156e7['filters']),_0x54b700);if(_0x343318[_0x369d('0x31')][_0x369d('0x3e')]){_0x595445[_0x369d('0x3c')]=_[_0x369d('0x3f')](_0x595445[_0x369d('0x3c')],{'$or':_[_0x369d('0x2c')](_0x54b700,function(_0x452c37){if(_0x452c37[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x442ebd={};_0x442ebd[_0x452c37['name']]={'$like':'%'+_0x343318['query'][_0x369d('0x3e')]+'%'};return _0x442ebd;}})});}_0x595445=_[_0x369d('0x3f')]({},_0x595445,_0x343318[_0x369d('0x41')]);var _0x5c8c3d={'where':_0x595445[_0x369d('0x3c')]};return db[_0x369d('0x42')][_0x369d('0x1c')](_0x5c8c3d)['then'](function(_0x522ecc){_0x5c7f97[_0x369d('0x1c')]=_0x522ecc;if(_0x343318[_0x369d('0x31')]['includeAll']){_0x595445[_0x369d('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x369d('0x44')](_0x595445);})[_0x369d('0x26')](function(_0x4b0dac){_0x5c7f97[_0x369d('0x45')]=_0x4b0dac;return _0x5c7f97;})[_0x369d('0x26')](respondWithFilteredResult(_0x15d1f7,_0x595445))[_0x369d('0x46')](handleError(_0x15d1f7,null));};exports[_0x369d('0x47')]=function(_0x4a4e76,_0xd258e){var _0x49bbf6={'raw':!![],'where':{'id':_0x4a4e76[_0x369d('0x48')]['id']}},_0x3d5b82={};_0x3d5b82[_0x369d('0x34')]=_[_0x369d('0x30')](db['AnalyticExtractedReport'][_0x369d('0x49')]);_0x3d5b82[_0x369d('0x31')]=_[_0x369d('0x30')](_0x4a4e76[_0x369d('0x31')]);_0x3d5b82[_0x369d('0x32')]=_[_0x369d('0x33')](_0x3d5b82[_0x369d('0x34')],_0x3d5b82[_0x369d('0x31')]);_0x49bbf6[_0x369d('0x37')]=_[_0x369d('0x33')](_0x3d5b82[_0x369d('0x34')],qs[_0x369d('0x35')](_0x4a4e76[_0x369d('0x31')][_0x369d('0x35')]));_0x49bbf6[_0x369d('0x37')]=_0x49bbf6[_0x369d('0x37')][_0x369d('0x36')]?_0x49bbf6['attributes']:_0x3d5b82[_0x369d('0x34')];if(_0x4a4e76[_0x369d('0x31')][_0x369d('0x4a')]){_0x49bbf6[_0x369d('0x43')]=[{'all':!![]}];}_0x49bbf6=_['merge']({},_0x49bbf6,_0x4a4e76['options']);return db['AnalyticExtractedReport'][_0x369d('0x4b')](_0x49bbf6)[_0x369d('0x26')](handleEntityNotFound(_0xd258e,null))[_0x369d('0x26')](respondWithResult(_0xd258e,null))[_0x369d('0x46')](handleError(_0xd258e,null));};exports[_0x369d('0x4c')]=function(_0x190685,_0xb87032){return db['AnalyticExtractedReport'][_0x369d('0x4c')](_0x190685[_0x369d('0x4d')],{})[_0x369d('0x26')](function(_0x5503e9){var _0x3516a7=_0x190685[_0x369d('0x4e')][_0x369d('0x24')]({'plain':!![]});if(!_0x3516a7)throw new Error(_0x369d('0x4f'));if(_0x3516a7['role']===_0x369d('0x4e')){var _0x4f75ec=_0x5503e9[_0x369d('0x24')]({'plain':!![]});var _0x4ed388='ExtractedReports';return db[_0x369d('0x50')][_0x369d('0x4b')]({'where':{'name':_0x4ed388,'userProfileId':_0x3516a7[_0x369d('0x51')]},'raw':!![]})[_0x369d('0x26')](function(_0x4c461d){if(_0x4c461d&&_0x4c461d[_0x369d('0x52')]===0x0){return db[_0x369d('0x53')]['create']({'name':_0x4f75ec[_0x369d('0x29')],'resourceId':_0x4f75ec['id'],'type':_0x4c461d[_0x369d('0x29')],'sectionId':_0x4c461d['id']},{})[_0x369d('0x26')](function(){return _0x5503e9;});}else{return _0x5503e9;}})['catch'](function(_0x19e41b){logger[_0x369d('0x28')](_0x369d('0x54'),_0x19e41b);throw _0x19e41b;});}return _0x5503e9;})[_0x369d('0x26')](respondWithResult(_0xb87032,0xc9))[_0x369d('0x46')](handleError(_0xb87032,null));};exports[_0x369d('0x22')]=function(_0x53d8e6,_0x5ec9a5){if(_0x53d8e6[_0x369d('0x4d')]['id']){delete _0x53d8e6[_0x369d('0x4d')]['id'];}return db[_0x369d('0x42')][_0x369d('0x4b')]({'where':{'id':_0x53d8e6['params']['id']}})[_0x369d('0x26')](handleEntityNotFound(_0x5ec9a5,null))[_0x369d('0x26')](saveUpdates(_0x53d8e6[_0x369d('0x4d')],null))[_0x369d('0x26')](respondWithResult(_0x5ec9a5,null))[_0x369d('0x46')](handleError(_0x5ec9a5,null));};exports[_0x369d('0x23')]=function(_0x3b03fc,_0x1508a6){return db[_0x369d('0x42')][_0x369d('0x4b')]({'where':{'id':_0x3b03fc[_0x369d('0x48')]['id']}})[_0x369d('0x26')](handleEntityNotFound(_0x1508a6,null))['then'](removeEntity(_0x1508a6,null))[_0x369d('0x46')](handleError(_0x1508a6,null));};exports[_0x369d('0x55')]=function(_0x24dc3c,_0x397bf8,_0x36c678){return db[_0x369d('0x42')][_0x369d('0x4b')]({'where':{'id':_0x24dc3c['params']['id']},'attributes':[_0x369d('0x29'),_0x369d('0x56'),_0x369d('0x57'),_0x369d('0x58')],'raw':!![]})[_0x369d('0x26')](handleEntityNotFound(_0x397bf8,null))[_0x369d('0x26')](function(_0x2fc06c){if(_0x2fc06c){if(!fs[_0x369d('0x59')](path['join'](config[_0x369d('0x5a')],_0x369d('0x5b'),_0x2fc06c[_0x369d('0x57')]))){throw new db[(_0x369d('0x5c'))]['ValidationError'](_0x369d('0x5d'));}if(_0x24dc3c['query']['exists']){return _0x397bf8[_0x369d('0x27')](0xc8);}return _0x397bf8[_0x369d('0x55')](path[_0x369d('0x5e')](config[_0x369d('0x5a')],'server/files/reports',_0x2fc06c[_0x369d('0x57')]),util[_0x369d('0x5f')](_0x369d('0x60'),_0x2fc06c['basename']||_0x2fc06c['name'],_0x2fc06c['output'][_0x369d('0x61')]()));}})['catch'](handleError(_0x397bf8,null));}; \ No newline at end of file +var _0x2048=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','findAll','rows','catch','show','params','keys','include','find','create','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','type','model','query'];(function(_0x4c7e8d,_0x3dd762){var _0x549cf6=function(_0x4dd8be){while(--_0x4dd8be){_0x4c7e8d['push'](_0x4c7e8d['shift']());}};_0x549cf6(++_0x3dd762);}(_0x2048,0x1a7));var _0x8204=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0x2048[_0x872f6f];return _0x59a5f4;};'use strict';var emlformat=require(_0x8204('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8204('0x1'));var jsonpatch=require(_0x8204('0x2'));var rp=require(_0x8204('0x3'));var moment=require(_0x8204('0x4'));var BPromise=require(_0x8204('0x5'));var Mustache=require('mustache');var util=require(_0x8204('0x6'));var path=require(_0x8204('0x7'));var sox=require(_0x8204('0x8'));var csv=require(_0x8204('0x9'));var ejs=require(_0x8204('0xa'));var fs=require('fs');var fs_extra=require(_0x8204('0xb'));var _=require(_0x8204('0xc'));var squel=require(_0x8204('0xd'));var crypto=require(_0x8204('0xe'));var jsforce=require(_0x8204('0xf'));var deskjs=require(_0x8204('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8204('0x11'));var Papa=require(_0x8204('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8204('0x13'));var as=require(_0x8204('0x14'));var hardwareService=require(_0x8204('0x15'));var logger=require(_0x8204('0x16'))(_0x8204('0x17'));var utils=require(_0x8204('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8204('0x19'))['db'];function respondWithStatusCode(_0x3ca01f,_0x48ac77){_0x48ac77=_0x48ac77||0xcc;return function(_0x369b9a){if(_0x369b9a){return _0x3ca01f[_0x8204('0x1a')](_0x48ac77);}return _0x3ca01f[_0x8204('0x1b')](_0x48ac77)[_0x8204('0x1c')]();};}function respondWithResult(_0x550d97,_0x84bd5d){_0x84bd5d=_0x84bd5d||0xc8;return function(_0x47f260){if(_0x47f260){return _0x550d97[_0x8204('0x1b')](_0x84bd5d)[_0x8204('0x1d')](_0x47f260);}};}function respondWithFilteredResult(_0x473a57,_0x563db6){return function(_0x59df55){if(_0x59df55){var _0x24dcb0=typeof _0x563db6[_0x8204('0x1e')]===_0x8204('0x1f')&&typeof _0x563db6['limit']===_0x8204('0x1f');var _0x413c51=_0x59df55['count'];var _0x1e2c21=_0x24dcb0?0x0:_0x563db6['offset'];var _0x3719a7=_0x24dcb0?_0x59df55[_0x8204('0x20')]:_0x563db6['offset']+_0x563db6['limit'];var _0x5bb1f7;if(_0x3719a7>=_0x413c51){_0x3719a7=_0x413c51;_0x5bb1f7=0xc8;}else{_0x5bb1f7=0xce;}_0x473a57['status'](_0x5bb1f7);return _0x473a57[_0x8204('0x21')](_0x8204('0x22'),_0x1e2c21+'-'+_0x3719a7+'/'+_0x413c51)[_0x8204('0x1d')](_0x59df55);}return null;};}function patchUpdates(_0x26ec4b){return function(_0x2f862e){try{jsonpatch[_0x8204('0x23')](_0x2f862e,_0x26ec4b,!![]);}catch(_0x281dbe){return BPromise[_0x8204('0x24')](_0x281dbe);}return _0x2f862e['save']();};}function saveUpdates(_0x5d2e90,_0x5d469e){return function(_0x2f3929){if(_0x2f3929){return _0x2f3929[_0x8204('0x25')](_0x5d2e90)[_0x8204('0x26')](function(_0x494837){return _0x494837;});}return null;};}function removeEntity(_0x46d2d4,_0x5898db){return function(_0x607393){if(_0x607393){return _0x607393[_0x8204('0x27')]()[_0x8204('0x26')](function(){var _0x5a603e=_0x607393[_0x8204('0x28')]({'plain':!![]});var _0xea3143=_0x8204('0x29');return db['UserProfileResource'][_0x8204('0x27')]({'where':{'type':_0xea3143,'resourceId':_0x5a603e['id']}})[_0x8204('0x26')](function(){return _0x607393;});})['then'](function(){_0x46d2d4[_0x8204('0x1b')](0xcc)[_0x8204('0x1c')]();});}};}function handleEntityNotFound(_0x2cfc57,_0x4df73a){return function(_0x496e40){if(!_0x496e40){_0x2cfc57[_0x8204('0x1a')](0x194);}return _0x496e40;};}function handleError(_0x120433,_0x5c25df){_0x5c25df=_0x5c25df||0x1f4;return function(_0x195595){logger[_0x8204('0x2a')](_0x195595[_0x8204('0x2b')]);if(_0x195595[_0x8204('0x2c')]){delete _0x195595['name'];}_0x120433['status'](_0x5c25df)[_0x8204('0x2d')](_0x195595);};}exports[_0x8204('0x2e')]=function(_0x538447,_0x3b5e1a){var _0x160ca4={},_0x9489e9={},_0x46b1c0={'count':0x0,'rows':[]};var _0x5a911d=_[_0x8204('0x2f')](db['AnalyticExtractedReport'][_0x8204('0x30')],function(_0xc14f21){return{'name':_0xc14f21['fieldName'],'type':_0xc14f21[_0x8204('0x31')]['key']};});_0x9489e9[_0x8204('0x32')]=_[_0x8204('0x2f')](_0x5a911d,_0x8204('0x2c'));_0x9489e9[_0x8204('0x33')]=_['keys'](_0x538447[_0x8204('0x33')]);_0x9489e9[_0x8204('0x34')]=_['intersection'](_0x9489e9[_0x8204('0x32')],_0x9489e9[_0x8204('0x33')]);_0x160ca4['attributes']=_[_0x8204('0x35')](_0x9489e9['model'],qs[_0x8204('0x36')](_0x538447[_0x8204('0x33')][_0x8204('0x36')]));_0x160ca4[_0x8204('0x37')]=_0x160ca4[_0x8204('0x37')][_0x8204('0x38')]?_0x160ca4[_0x8204('0x37')]:_0x9489e9[_0x8204('0x32')];if(!_0x538447[_0x8204('0x33')][_0x8204('0x39')](_0x8204('0x3a'))){_0x160ca4[_0x8204('0x3b')]=qs[_0x8204('0x3b')](_0x538447[_0x8204('0x33')][_0x8204('0x3b')]);_0x160ca4[_0x8204('0x1e')]=qs[_0x8204('0x1e')](_0x538447[_0x8204('0x33')][_0x8204('0x1e')]);}_0x160ca4[_0x8204('0x3c')]=qs[_0x8204('0x3d')](_0x538447[_0x8204('0x33')][_0x8204('0x3d')]);_0x160ca4[_0x8204('0x3e')]=qs['filters'](_[_0x8204('0x3f')](_0x538447['query'],_0x9489e9['filters']),_0x5a911d);if(_0x538447[_0x8204('0x33')][_0x8204('0x40')]){_0x160ca4['where']=_[_0x8204('0x41')](_0x160ca4[_0x8204('0x3e')],{'$or':_[_0x8204('0x2f')](_0x5a911d,function(_0x1cb1f0){if(_0x1cb1f0[_0x8204('0x31')]!=='VIRTUAL'){var _0x1f40d9={};_0x1f40d9[_0x1cb1f0[_0x8204('0x2c')]]={'$like':'%'+_0x538447[_0x8204('0x33')][_0x8204('0x40')]+'%'};return _0x1f40d9;}})});}_0x160ca4=_[_0x8204('0x41')]({},_0x160ca4,_0x538447[_0x8204('0x42')]);var _0x4d0164={'where':_0x160ca4[_0x8204('0x3e')]};return db[_0x8204('0x43')][_0x8204('0x20')](_0x4d0164)[_0x8204('0x26')](function(_0x4ce1c6){_0x46b1c0['count']=_0x4ce1c6;if(_0x538447['query']['includeAll']){_0x160ca4['include']=[{'all':!![]}];}return db[_0x8204('0x43')][_0x8204('0x44')](_0x160ca4);})['then'](function(_0x54323e){_0x46b1c0[_0x8204('0x45')]=_0x54323e;return _0x46b1c0;})[_0x8204('0x26')](respondWithFilteredResult(_0x3b5e1a,_0x160ca4))[_0x8204('0x46')](handleError(_0x3b5e1a,null));};exports[_0x8204('0x47')]=function(_0x3b9afa,_0x30ae8c){var _0x1c4bc2={'raw':!![],'where':{'id':_0x3b9afa[_0x8204('0x48')]['id']}},_0x394232={};_0x394232[_0x8204('0x32')]=_[_0x8204('0x49')](db[_0x8204('0x43')][_0x8204('0x30')]);_0x394232[_0x8204('0x33')]=_[_0x8204('0x49')](_0x3b9afa[_0x8204('0x33')]);_0x394232['filters']=_['intersection'](_0x394232[_0x8204('0x32')],_0x394232[_0x8204('0x33')]);_0x1c4bc2['attributes']=_[_0x8204('0x35')](_0x394232[_0x8204('0x32')],qs[_0x8204('0x36')](_0x3b9afa[_0x8204('0x33')][_0x8204('0x36')]));_0x1c4bc2[_0x8204('0x37')]=_0x1c4bc2[_0x8204('0x37')]['length']?_0x1c4bc2[_0x8204('0x37')]:_0x394232[_0x8204('0x32')];if(_0x3b9afa['query']['includeAll']){_0x1c4bc2[_0x8204('0x4a')]=[{'all':!![]}];}_0x1c4bc2=_['merge']({},_0x1c4bc2,_0x3b9afa[_0x8204('0x42')]);return db['AnalyticExtractedReport'][_0x8204('0x4b')](_0x1c4bc2)[_0x8204('0x26')](handleEntityNotFound(_0x30ae8c,null))[_0x8204('0x26')](respondWithResult(_0x30ae8c,null))['catch'](handleError(_0x30ae8c,null));};exports[_0x8204('0x4c')]=function(_0x3c0087,_0x8ab350){return db[_0x8204('0x43')][_0x8204('0x4c')](_0x3c0087['body'],{})['then'](function(_0x3b8b7f){var _0x3115d4=_0x3c0087['user']['get']({'plain':!![]});if(!_0x3115d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3115d4['role']==='user'){var _0x46aca2=_0x3b8b7f['get']({'plain':!![]});var _0x30e59f=_0x8204('0x29');return db[_0x8204('0x4d')][_0x8204('0x4b')]({'where':{'name':_0x30e59f,'userProfileId':_0x3115d4[_0x8204('0x4e')]},'raw':!![]})[_0x8204('0x26')](function(_0x5a8bb5){if(_0x5a8bb5&&_0x5a8bb5[_0x8204('0x4f')]===0x0){return db[_0x8204('0x50')][_0x8204('0x4c')]({'name':_0x46aca2[_0x8204('0x2c')],'resourceId':_0x46aca2['id'],'type':_0x5a8bb5[_0x8204('0x2c')],'sectionId':_0x5a8bb5['id']},{})['then'](function(){return _0x3b8b7f;});}else{return _0x3b8b7f;}})[_0x8204('0x46')](function(_0x222b0a){logger[_0x8204('0x2a')](_0x8204('0x51'),_0x222b0a);throw _0x222b0a;});}return _0x3b8b7f;})['then'](respondWithResult(_0x8ab350,0xc9))[_0x8204('0x46')](handleError(_0x8ab350,null));};exports[_0x8204('0x25')]=function(_0x36a0f7,_0x54e855){if(_0x36a0f7[_0x8204('0x52')]['id']){delete _0x36a0f7[_0x8204('0x52')]['id'];}return db[_0x8204('0x43')]['find']({'where':{'id':_0x36a0f7[_0x8204('0x48')]['id']}})['then'](handleEntityNotFound(_0x54e855,null))['then'](saveUpdates(_0x36a0f7[_0x8204('0x52')],null))[_0x8204('0x26')](respondWithResult(_0x54e855,null))['catch'](handleError(_0x54e855,null));};exports[_0x8204('0x27')]=function(_0x4c38dc,_0x4c87f0){return db['AnalyticExtractedReport'][_0x8204('0x4b')]({'where':{'id':_0x4c38dc[_0x8204('0x48')]['id']}})[_0x8204('0x26')](handleEntityNotFound(_0x4c87f0,null))[_0x8204('0x26')](removeEntity(_0x4c87f0,null))[_0x8204('0x46')](handleError(_0x4c87f0,null));};exports[_0x8204('0x53')]=function(_0x17da21,_0x37cd09,_0x59547a){return db[_0x8204('0x43')][_0x8204('0x4b')]({'where':{'id':_0x17da21['params']['id']},'attributes':['name',_0x8204('0x54'),_0x8204('0x55'),_0x8204('0x56')],'raw':!![]})[_0x8204('0x26')](handleEntityNotFound(_0x37cd09,null))['then'](function(_0x10b175){if(_0x10b175){if(!fs['existsSync'](path[_0x8204('0x57')](config[_0x8204('0x58')],_0x8204('0x59'),_0x10b175['savename']))){throw new db[(_0x8204('0x5a'))][(_0x8204('0x5b'))](_0x8204('0x5c'));}if(_0x17da21[_0x8204('0x33')]['exists']){return _0x37cd09[_0x8204('0x1a')](0xc8);}return _0x37cd09[_0x8204('0x53')](path[_0x8204('0x57')](config[_0x8204('0x58')],_0x8204('0x59'),_0x10b175[_0x8204('0x55')]),util[_0x8204('0x5d')](_0x8204('0x5e'),_0x10b175['basename']||_0x10b175['name'],_0x10b175[_0x8204('0x56')]['toLowerCase']()));}})[_0x8204('0x46')](handleError(_0x37cd09,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 73e02e2..1533888 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 _0x10b9=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x153c8d,_0x3ad23a){var _0x5b1ad0=function(_0x14d714){while(--_0x14d714){_0x153c8d['push'](_0x153c8d['shift']());}};_0x5b1ad0(++_0x3ad23a);}(_0x10b9,0x1b1));var _0x910b=function(_0x3303c0,_0x1eaa43){_0x3303c0=_0x3303c0-0x0;var _0x454848=_0x10b9[_0x3303c0];return _0x454848;};'use strict';var _=require(_0x910b('0x0'));var util=require(_0x910b('0x1'));var logger=require(_0x910b('0x2'))(_0x910b('0x3'));var moment=require('moment');var BPromise=require(_0x910b('0x4'));var rp=require(_0x910b('0x5'));var fs=require('fs');var path=require(_0x910b('0x6'));var rimraf=require(_0x910b('0x7'));var config=require(_0x910b('0x8'));var attributes=require(_0x910b('0x9'));module[_0x910b('0xa')]=function(_0x980bef,_0x5da574){return _0x980bef[_0x910b('0xb')](_0x910b('0xc'),attributes,{'tableName':_0x910b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa690=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment','bluebird'];(function(_0x10b187,_0x3d590f){var _0x4e8ec1=function(_0x5ac061){while(--_0x5ac061){_0x10b187['push'](_0x10b187['shift']());}};_0x4e8ec1(++_0x3d590f);}(_0xa690,0x140));var _0x0a69=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0xa690[_0x10bcc4];return _0x2da988;};'use strict';var _=require('lodash');var util=require(_0x0a69('0x0'));var logger=require(_0x0a69('0x1'))(_0x0a69('0x2'));var moment=require(_0x0a69('0x3'));var BPromise=require(_0x0a69('0x4'));var rp=require(_0x0a69('0x5'));var fs=require('fs');var path=require(_0x0a69('0x6'));var rimraf=require(_0x0a69('0x7'));var config=require(_0x0a69('0x8'));var attributes=require(_0x0a69('0x9'));module[_0x0a69('0xa')]=function(_0x3c4230,_0x3062fc){return _0x3c4230[_0x0a69('0xb')](_0x0a69('0xc'),attributes,{'tableName':'analytics_extracted_reports','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 f53a761..b1afd6c 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 _0x5351=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','bluebird','randomstring'];(function(_0x8d672b,_0x590368){var _0xdd43f=function(_0x50b4d8){while(--_0x50b4d8){_0x8d672b['push'](_0x8d672b['shift']());}};_0xdd43f(++_0x590368);}(_0x5351,0x140));var _0x1535=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5351[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1535('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1535('0x1'));var rs=require(_0x1535('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1535('0x3'))['db'];var utils=require(_0x1535('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1535('0x5'));var client=jayson[_0x1535('0x6')][_0x1535('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43bd51,_0x3d55b8,_0x5d6c4a){return new BPromise(function(_0x41793b,_0x10a794){return client[_0x1535('0x8')](_0x43bd51,_0x5d6c4a)[_0x1535('0x9')](function(_0x3e6192){logger['info'](_0x1535('0xa'),_0x3d55b8,_0x1535('0xb'));logger[_0x1535('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3d55b8,'request\x20sent',JSON[_0x1535('0xd')](_0x3e6192));if(_0x3e6192[_0x1535('0xe')]){if(_0x3e6192[_0x1535('0xe')][_0x1535('0xf')]===0x1f4){logger[_0x1535('0xe')](_0x1535('0xa'),_0x3d55b8,_0x3e6192['error'][_0x1535('0x10')]);return _0x10a794(_0x3e6192['error']['message']);}logger[_0x1535('0xe')](_0x1535('0xa'),_0x3d55b8,_0x3e6192[_0x1535('0xe')][_0x1535('0x10')]);return _0x41793b(_0x3e6192[_0x1535('0xe')][_0x1535('0x10')]);}else{logger[_0x1535('0x11')](_0x1535('0xa'),_0x3d55b8,_0x1535('0xb'));_0x41793b(_0x3e6192[_0x1535('0x12')][_0x1535('0x10')]);}})['catch'](function(_0x1a08a9){logger[_0x1535('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d55b8,_0x1a08a9);_0x10a794(_0x1a08a9);});});} \ No newline at end of file +var _0x9724=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis'];(function(_0x22ecfa,_0x5bbb67){var _0x22749d=function(_0xdfa439){while(--_0xdfa439){_0x22ecfa['push'](_0x22ecfa['shift']());}};_0x22749d(++_0x5bbb67);}(_0x9724,0x1f1));var _0x4972=function(_0x186140,_0x144c04){_0x186140=_0x186140-0x0;var _0x4fb796=_0x9724[_0x186140];return _0x4fb796;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4972('0x0'));var BPromise=require(_0x4972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4972('0x2'));var db=require(_0x4972('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4972('0x4'))(_0x4972('0x5'));var config=require(_0x4972('0x6'));var jayson=require(_0x4972('0x7'));var client=jayson['client'][_0x4972('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52259e,_0x3c65e6,_0x35134a){return new BPromise(function(_0x160e79,_0x4f974c){return client['request'](_0x52259e,_0x35134a)[_0x4972('0x9')](function(_0x458214){logger[_0x4972('0xa')](_0x4972('0xb'),_0x3c65e6,_0x4972('0xc'));logger['debug'](_0x4972('0xd'),_0x3c65e6,_0x4972('0xc'),JSON[_0x4972('0xe')](_0x458214));if(_0x458214[_0x4972('0xf')]){if(_0x458214[_0x4972('0xf')][_0x4972('0x10')]===0x1f4){logger[_0x4972('0xf')](_0x4972('0xb'),_0x3c65e6,_0x458214[_0x4972('0xf')]['message']);return _0x4f974c(_0x458214[_0x4972('0xf')][_0x4972('0x11')]);}logger[_0x4972('0xf')](_0x4972('0xb'),_0x3c65e6,_0x458214['error'][_0x4972('0x11')]);return _0x160e79(_0x458214[_0x4972('0xf')]['message']);}else{logger[_0x4972('0xa')](_0x4972('0xb'),_0x3c65e6,_0x4972('0xc'));_0x160e79(_0x458214[_0x4972('0x12')][_0x4972('0x11')]);}})[_0x4972('0x13')](function(_0x28e2c3){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3c65e6,_0x28e2c3);_0x4f974c(_0x28e2c3);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0d2fcf1..23b35c6 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 _0x1665=['../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1665,0x19f));var _0x5166=function(_0x1c5968,_0x68d40c){_0x1c5968=_0x1c5968-0x0;var _0x290441=_0x1665[_0x1c5968];return _0x290441;};'use strict';var multer=require(_0x5166('0x0'));var util=require(_0x5166('0x1'));var path=require('path');var timeout=require(_0x5166('0x2'));var express=require(_0x5166('0x3'));var router=express['Router']();var fs_extra=require(_0x5166('0x4'));var auth=require(_0x5166('0x5'));var interaction=require(_0x5166('0x6'));var config=require('../../config/environment');var controller=require(_0x5166('0x7'));router[_0x5166('0x8')]('/',auth[_0x5166('0x9')](),controller[_0x5166('0xa')]);router[_0x5166('0x8')]('/:id',auth[_0x5166('0x9')](),controller[_0x5166('0xb')]);router[_0x5166('0x8')](_0x5166('0xc'),auth[_0x5166('0x9')](),controller[_0x5166('0xd')]);router[_0x5166('0xe')]('/',auth['isAuthenticated'](),controller[_0x5166('0xf')]);router[_0x5166('0x10')](_0x5166('0x11'),auth[_0x5166('0x9')](),controller[_0x5166('0x12')]);router['delete'](_0x5166('0x11'),auth[_0x5166('0x9')](),controller[_0x5166('0x13')]);module[_0x5166('0x14')]=router; \ No newline at end of file +var _0x77fb=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','download','post','create','put','update','util','path'];(function(_0x3dd02e,_0x2a059c){var _0x4c4445=function(_0x4906d1){while(--_0x4906d1){_0x3dd02e['push'](_0x3dd02e['shift']());}};_0x4c4445(++_0x2a059c);}(_0x77fb,0x7e));var _0xb77f=function(_0x27445f,_0x357a96){_0x27445f=_0x27445f-0x0;var _0x2d2cd8=_0x77fb[_0x27445f];return _0x2d2cd8;};'use strict';var multer=require('multer');var util=require(_0xb77f('0x0'));var path=require(_0xb77f('0x1'));var timeout=require(_0xb77f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb77f('0x3'));var auth=require(_0xb77f('0x4'));var interaction=require(_0xb77f('0x5'));var config=require('../../config/environment');var controller=require(_0xb77f('0x6'));router[_0xb77f('0x7')]('/',auth[_0xb77f('0x8')](),controller['index']);router[_0xb77f('0x7')](_0xb77f('0x9'),auth[_0xb77f('0x8')](),controller[_0xb77f('0xa')]);router[_0xb77f('0x7')]('/:id/download',auth[_0xb77f('0x8')](),controller[_0xb77f('0xb')]);router[_0xb77f('0xc')]('/',auth['isAuthenticated'](),controller[_0xb77f('0xd')]);router[_0xb77f('0xe')](_0xb77f('0x9'),auth[_0xb77f('0x8')](),controller[_0xb77f('0xf')]);router['delete'](_0xb77f('0x9'),auth[_0xb77f('0x8')](),controller['destroy']);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 d86318d..2d6eb53 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 _0xca90=['sequelize','exports','STRING','BOOLEAN'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0xca90,0xfc));var _0x0ca9=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xca90[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x0ca9('0x0'));module[_0x0ca9('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0ca9('0x2')]},'function':{'type':Sequelize[_0x0ca9('0x2')]},'format':{'type':Sequelize[_0x0ca9('0x2')]},'groupBy':{'type':Sequelize[_0x0ca9('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0ca9('0x2')]},'custom':{'type':Sequelize[_0x0ca9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0047=['sequelize','STRING','BOOLEAN'];(function(_0x1ccfa1,_0x2eaded){var _0x5ea732=function(_0x12be39){while(--_0x12be39){_0x1ccfa1['push'](_0x1ccfa1['shift']());}};_0x5ea732(++_0x2eaded);}(_0x0047,0xff));var _0x7004=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x0047[_0x40b3f2];return _0x4ce90c;};'use strict';var Sequelize=require(_0x7004('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x7004('0x1')]},'function':{'type':Sequelize[_0x7004('0x1')]},'format':{'type':Sequelize[_0x7004('0x1')]},'groupBy':{'type':Sequelize[_0x7004('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7004('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index ac4bdbd..b66a282 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 _0x9950=['end','stack','name','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','AnalyticFieldReport','includeAll','include','catch','params','length','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x4aeb38,_0x3fb7f4){var _0x5afbe1=function(_0x37d581){while(--_0x37d581){_0x4aeb38['push'](_0x4aeb38['shift']());}};_0x5afbe1(++_0x3fb7f4);}(_0x9950,0x167));var _0x0995=function(_0x4f4a25,_0x377ace){_0x4f4a25=_0x4f4a25-0x0;var _0x2d8a06=_0x9950[_0x4f4a25];return _0x2d8a06;};'use strict';var emlformat=require(_0x0995('0x0'));var rimraf=require(_0x0995('0x1'));var zipdir=require(_0x0995('0x2'));var jsonpatch=require(_0x0995('0x3'));var rp=require(_0x0995('0x4'));var moment=require(_0x0995('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0995('0x6'));var util=require(_0x0995('0x7'));var path=require(_0x0995('0x8'));var sox=require(_0x0995('0x9'));var csv=require(_0x0995('0xa'));var ejs=require(_0x0995('0xb'));var fs=require('fs');var fs_extra=require(_0x0995('0xc'));var _=require('lodash');var squel=require(_0x0995('0xd'));var crypto=require(_0x0995('0xe'));var jsforce=require(_0x0995('0xf'));var deskjs=require(_0x0995('0x10'));var toCsv=require(_0x0995('0xa'));var querystring=require(_0x0995('0x11'));var Papa=require(_0x0995('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0995('0x13'));var as=require(_0x0995('0x14'));var hardwareService=require(_0x0995('0x15'));var logger=require(_0x0995('0x16'))(_0x0995('0x17'));var utils=require('../../config/utils');var config=require(_0x0995('0x18'));var licenseUtil=require(_0x0995('0x19'));var db=require(_0x0995('0x1a'))['db'];function respondWithStatusCode(_0x468389,_0x4e9cf0){_0x4e9cf0=_0x4e9cf0||0xcc;return function(_0x2e5959){if(_0x2e5959){return _0x468389[_0x0995('0x1b')](_0x4e9cf0);}return _0x468389[_0x0995('0x1c')](_0x4e9cf0)['end']();};}function respondWithResult(_0x450446,_0x2a252e){_0x2a252e=_0x2a252e||0xc8;return function(_0x3185a1){if(_0x3185a1){return _0x450446['status'](_0x2a252e)[_0x0995('0x1d')](_0x3185a1);}};}function respondWithFilteredResult(_0x38edbd,_0x24faf3){return function(_0x293d9e){if(_0x293d9e){var _0x5d90fa=typeof _0x24faf3['offset']===_0x0995('0x1e')&&typeof _0x24faf3[_0x0995('0x1f')]==='undefined';var _0x51b811=_0x293d9e['count'];var _0x4fc9a1=_0x5d90fa?0x0:_0x24faf3['offset'];var _0x215e71=_0x5d90fa?_0x293d9e[_0x0995('0x20')]:_0x24faf3[_0x0995('0x21')]+_0x24faf3[_0x0995('0x1f')];var _0x1508b7;if(_0x215e71>=_0x51b811){_0x215e71=_0x51b811;_0x1508b7=0xc8;}else{_0x1508b7=0xce;}_0x38edbd[_0x0995('0x1c')](_0x1508b7);return _0x38edbd[_0x0995('0x22')](_0x0995('0x23'),_0x4fc9a1+'-'+_0x215e71+'/'+_0x51b811)[_0x0995('0x1d')](_0x293d9e);}return null;};}function patchUpdates(_0x41aa7e){return function(_0x17dcff){try{jsonpatch[_0x0995('0x24')](_0x17dcff,_0x41aa7e,!![]);}catch(_0xcf99cb){return BPromise[_0x0995('0x25')](_0xcf99cb);}return _0x17dcff['save']();};}function saveUpdates(_0x1fa36f,_0x6cf02e){return function(_0x50b4f9){if(_0x50b4f9){return _0x50b4f9[_0x0995('0x26')](_0x1fa36f)[_0x0995('0x27')](function(_0x211847){return _0x211847;});}return null;};}function removeEntity(_0x53141a,_0x10fb4b){return function(_0x1d3bc9){if(_0x1d3bc9){return _0x1d3bc9[_0x0995('0x28')]()['then'](function(){_0x53141a[_0x0995('0x1c')](0xcc)[_0x0995('0x29')]();});}};}function handleEntityNotFound(_0x3e5ae3,_0x2edf43){return function(_0x4d4c79){if(!_0x4d4c79){_0x3e5ae3[_0x0995('0x1b')](0x194);}return _0x4d4c79;};}function handleError(_0x13c28c,_0x7a8fe1){_0x7a8fe1=_0x7a8fe1||0x1f4;return function(_0x1c6dd0){logger['error'](_0x1c6dd0[_0x0995('0x2a')]);if(_0x1c6dd0[_0x0995('0x2b')]){delete _0x1c6dd0[_0x0995('0x2b')];}_0x13c28c['status'](_0x7a8fe1)['send'](_0x1c6dd0);};}exports['index']=function(_0x4e0996,_0xded57f){var _0x37c3={},_0x23d851={},_0x477b0c={'count':0x0,'rows':[]};var _0x4dcd1c=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x2afddf){return{'name':_0x2afddf[_0x0995('0x2c')],'type':_0x2afddf['type'][_0x0995('0x2d')]};});_0x23d851[_0x0995('0x2e')]=_[_0x0995('0x2f')](_0x4dcd1c,_0x0995('0x2b'));_0x23d851[_0x0995('0x30')]=_[_0x0995('0x31')](_0x4e0996['query']);_0x23d851[_0x0995('0x32')]=_['intersection'](_0x23d851[_0x0995('0x2e')],_0x23d851[_0x0995('0x30')]);_0x37c3[_0x0995('0x33')]=_[_0x0995('0x34')](_0x23d851[_0x0995('0x2e')],qs[_0x0995('0x35')](_0x4e0996[_0x0995('0x30')]['fields']));_0x37c3[_0x0995('0x33')]=_0x37c3[_0x0995('0x33')]['length']?_0x37c3[_0x0995('0x33')]:_0x23d851[_0x0995('0x2e')];if(!_0x4e0996[_0x0995('0x30')]['hasOwnProperty']('nolimit')){_0x37c3[_0x0995('0x1f')]=qs['limit'](_0x4e0996[_0x0995('0x30')][_0x0995('0x1f')]);_0x37c3[_0x0995('0x21')]=qs['offset'](_0x4e0996[_0x0995('0x30')][_0x0995('0x21')]);}_0x37c3[_0x0995('0x36')]=qs[_0x0995('0x37')](_0x4e0996[_0x0995('0x30')][_0x0995('0x37')]);_0x37c3[_0x0995('0x38')]=qs[_0x0995('0x32')](_[_0x0995('0x39')](_0x4e0996['query'],_0x23d851[_0x0995('0x32')]),_0x4dcd1c);if(_0x4e0996[_0x0995('0x30')][_0x0995('0x3a')]){_0x37c3[_0x0995('0x38')]=_[_0x0995('0x3b')](_0x37c3['where'],{'$or':_[_0x0995('0x2f')](_0x4dcd1c,function(_0x24e8a8){if(_0x24e8a8[_0x0995('0x3c')]!==_0x0995('0x3d')){var _0xed46e4={};_0xed46e4[_0x24e8a8[_0x0995('0x2b')]]={'$like':'%'+_0x4e0996[_0x0995('0x30')]['filter']+'%'};return _0xed46e4;}})});}_0x37c3=_[_0x0995('0x3b')]({},_0x37c3,_0x4e0996['options']);var _0x351464={'where':_0x37c3[_0x0995('0x38')]};return db[_0x0995('0x3e')]['count'](_0x351464)[_0x0995('0x27')](function(_0x2e9b91){_0x477b0c[_0x0995('0x20')]=_0x2e9b91;if(_0x4e0996[_0x0995('0x30')][_0x0995('0x3f')]){_0x37c3[_0x0995('0x40')]=[{'all':!![]}];}return db[_0x0995('0x3e')]['findAll'](_0x37c3);})[_0x0995('0x27')](function(_0x4300d6){_0x477b0c['rows']=_0x4300d6;return _0x477b0c;})[_0x0995('0x27')](respondWithFilteredResult(_0xded57f,_0x37c3))[_0x0995('0x41')](handleError(_0xded57f,null));};exports['show']=function(_0x239d8a,_0x33aac0){var _0x5ae4b6={'raw':![],'where':{'id':_0x239d8a[_0x0995('0x42')]['id']}},_0x273da6={};_0x273da6[_0x0995('0x2e')]=_[_0x0995('0x31')](db[_0x0995('0x3e')]['rawAttributes']);_0x273da6[_0x0995('0x30')]=_[_0x0995('0x31')](_0x239d8a[_0x0995('0x30')]);_0x273da6[_0x0995('0x32')]=_[_0x0995('0x34')](_0x273da6[_0x0995('0x2e')],_0x273da6[_0x0995('0x30')]);_0x5ae4b6[_0x0995('0x33')]=_[_0x0995('0x34')](_0x273da6['model'],qs[_0x0995('0x35')](_0x239d8a[_0x0995('0x30')][_0x0995('0x35')]));_0x5ae4b6[_0x0995('0x33')]=_0x5ae4b6[_0x0995('0x33')][_0x0995('0x43')]?_0x5ae4b6[_0x0995('0x33')]:_0x273da6[_0x0995('0x2e')];if(_0x239d8a[_0x0995('0x30')][_0x0995('0x3f')]){_0x5ae4b6[_0x0995('0x40')]=[{'all':!![]}];}_0x5ae4b6=_[_0x0995('0x3b')]({},_0x5ae4b6,_0x239d8a['options']);return db[_0x0995('0x3e')]['find'](_0x5ae4b6)[_0x0995('0x27')](handleEntityNotFound(_0x33aac0,null))['then'](respondWithResult(_0x33aac0,null))[_0x0995('0x41')](handleError(_0x33aac0,null));};exports[_0x0995('0x44')]=function(_0x246cc1,_0x229ec6){return db[_0x0995('0x3e')]['create'](_0x246cc1[_0x0995('0x45')],{})['then'](respondWithResult(_0x229ec6,0xc9))['catch'](handleError(_0x229ec6,null));};exports[_0x0995('0x46')]=function(_0x37aa39,_0x551658){return db['AnalyticFieldReport']['bulkCreate'](_0x37aa39[_0x0995('0x45')],{'raw':![],'individualHooks':!![]})[_0x0995('0x27')](respondWithResult(_0x551658,0xc9))['catch'](handleError(_0x551658,null));};exports[_0x0995('0x26')]=function(_0x38f797,_0x5bfaf7){if(_0x38f797[_0x0995('0x45')]['id']){delete _0x38f797[_0x0995('0x45')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x38f797[_0x0995('0x42')]['id']}})[_0x0995('0x27')](handleEntityNotFound(_0x5bfaf7,null))[_0x0995('0x27')](saveUpdates(_0x38f797[_0x0995('0x45')],null))[_0x0995('0x27')](respondWithResult(_0x5bfaf7,null))['catch'](handleError(_0x5bfaf7,null));};exports[_0x0995('0x28')]=function(_0x422ea1,_0x439a3c){return db[_0x0995('0x3e')][_0x0995('0x47')]({'where':{'id':_0x422ea1['params']['id']}})[_0x0995('0x27')](handleEntityNotFound(_0x439a3c,null))[_0x0995('0x27')](removeEntity(_0x439a3c,null))[_0x0995('0x41')](handleError(_0x439a3c,null));};exports[_0x0995('0x48')]=function(_0x99b48a,_0x16f082){return db[_0x0995('0x3e')]['destroy']({'where':{'id':_0x99b48a[_0x0995('0x30')][_0x0995('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x0995('0x27')](respondWithResult(_0x16f082,0xcc))[_0x0995('0x41')](handleError(_0x16f082,null));};exports[_0x0995('0x4a')]=function(_0x336b56,_0x543269,_0x244ca2){return db[_0x0995('0x4b')][_0x0995('0x4c')]({'where':{'id':_0x336b56['params']['id']}})[_0x0995('0x27')](handleEntityNotFound(_0x543269,null))[_0x0995('0x27')](function(_0x2aec15){if(_0x2aec15){return db[_0x0995('0x4d')][_0x0995('0x4e')](function(_0x58c0f4){return db[_0x0995('0x3e')]['destroy']({'where':{'CustomReportId':_0x336b56[_0x0995('0x42')]['id']},'transaction':_0x58c0f4})[_0x0995('0x27')](function(_0x54d842){var _0x1bddaa=_[_0x0995('0x2f')](_0x336b56[_0x0995('0x45')],function(_0x49e717){delete _0x49e717['id'];_0x49e717[_0x0995('0x4f')]=_0x336b56[_0x0995('0x42')]['id'];return _0x49e717;});return db['AnalyticFieldReport'][_0x0995('0x46')](_0x1bddaa,{'transaction':_0x58c0f4});});})[_0x0995('0x27')](function(){return db[_0x0995('0x3e')]['findAll']({'where':{'CustomReportId':_0x336b56[_0x0995('0x42')]['id']}});});}})[_0x0995('0x27')](respondWithResult(_0x543269,null))[_0x0995('0x41')](handleError(_0x543269,null));}; \ No newline at end of file +var _0x626b=['sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','rows','show','params','include','find','catch','create','body','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order'];(function(_0x56923e,_0x2856cd){var _0x1034ef=function(_0x1b543b){while(--_0x1b543b){_0x56923e['push'](_0x56923e['shift']());}};_0x1034ef(++_0x2856cd);}(_0x626b,0x117));var _0xb626=function(_0x390a95,_0x4cefce){_0x390a95=_0x390a95-0x0;var _0x78eb63=_0x626b[_0x390a95];return _0x78eb63;};'use strict';var emlformat=require(_0xb626('0x0'));var rimraf=require(_0xb626('0x1'));var zipdir=require(_0xb626('0x2'));var jsonpatch=require(_0xb626('0x3'));var rp=require(_0xb626('0x4'));var moment=require(_0xb626('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb626('0x6'));var util=require('util');var path=require(_0xb626('0x7'));var sox=require(_0xb626('0x8'));var csv=require(_0xb626('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb626('0xa'));var squel=require(_0xb626('0xb'));var crypto=require(_0xb626('0xc'));var jsforce=require(_0xb626('0xd'));var deskjs=require(_0xb626('0xe'));var toCsv=require(_0xb626('0x9'));var querystring=require(_0xb626('0xf'));var Papa=require(_0xb626('0x10'));var Redis=require('ioredis');var authService=require(_0xb626('0x11'));var qs=require(_0xb626('0x12'));var as=require(_0xb626('0x13'));var hardwareService=require(_0xb626('0x14'));var logger=require(_0xb626('0x15'))('api');var utils=require(_0xb626('0x16'));var config=require(_0xb626('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb626('0x18'))['db'];function respondWithStatusCode(_0x117ae2,_0x2dc495){_0x2dc495=_0x2dc495||0xcc;return function(_0x504aa0){if(_0x504aa0){return _0x117ae2[_0xb626('0x19')](_0x2dc495);}return _0x117ae2[_0xb626('0x1a')](_0x2dc495)['end']();};}function respondWithResult(_0x347eb5,_0x5c853a){_0x5c853a=_0x5c853a||0xc8;return function(_0xc23400){if(_0xc23400){return _0x347eb5['status'](_0x5c853a)[_0xb626('0x1b')](_0xc23400);}};}function respondWithFilteredResult(_0x2760c0,_0x156b68){return function(_0x431703){if(_0x431703){var _0x249930=typeof _0x156b68[_0xb626('0x1c')]===_0xb626('0x1d')&&typeof _0x156b68['limit']===_0xb626('0x1d');var _0xe15b74=_0x431703[_0xb626('0x1e')];var _0x6cae59=_0x249930?0x0:_0x156b68[_0xb626('0x1c')];var _0x5029cd=_0x249930?_0x431703[_0xb626('0x1e')]:_0x156b68[_0xb626('0x1c')]+_0x156b68[_0xb626('0x1f')];var _0x5c90c8;if(_0x5029cd>=_0xe15b74){_0x5029cd=_0xe15b74;_0x5c90c8=0xc8;}else{_0x5c90c8=0xce;}_0x2760c0[_0xb626('0x1a')](_0x5c90c8);return _0x2760c0[_0xb626('0x20')](_0xb626('0x21'),_0x6cae59+'-'+_0x5029cd+'/'+_0xe15b74)[_0xb626('0x1b')](_0x431703);}return null;};}function patchUpdates(_0x265d6e){return function(_0x7449ce){try{jsonpatch[_0xb626('0x22')](_0x7449ce,_0x265d6e,!![]);}catch(_0x133275){return BPromise['reject'](_0x133275);}return _0x7449ce[_0xb626('0x23')]();};}function saveUpdates(_0x27409d,_0x2bb4ca){return function(_0x5e69fa){if(_0x5e69fa){return _0x5e69fa[_0xb626('0x24')](_0x27409d)['then'](function(_0x527dff){return _0x527dff;});}return null;};}function removeEntity(_0xd8e47a,_0x496776){return function(_0x5e3098){if(_0x5e3098){return _0x5e3098['destroy']()[_0xb626('0x25')](function(){_0xd8e47a[_0xb626('0x1a')](0xcc)[_0xb626('0x26')]();});}};}function handleEntityNotFound(_0x39631c,_0x1329d8){return function(_0x2da8a5){if(!_0x2da8a5){_0x39631c[_0xb626('0x19')](0x194);}return _0x2da8a5;};}function handleError(_0x349aa2,_0x4bad8b){_0x4bad8b=_0x4bad8b||0x1f4;return function(_0x1befd6){logger[_0xb626('0x27')](_0x1befd6[_0xb626('0x28')]);if(_0x1befd6['name']){delete _0x1befd6[_0xb626('0x29')];}_0x349aa2[_0xb626('0x1a')](_0x4bad8b)[_0xb626('0x2a')](_0x1befd6);};}exports[_0xb626('0x2b')]=function(_0x3d21f1,_0x39f8ad){var _0x47fe1a={},_0x1147eb={},_0x3f3ea8={'count':0x0,'rows':[]};var _0x5e8999=_[_0xb626('0x2c')](db['AnalyticFieldReport'][_0xb626('0x2d')],function(_0x4d9865){return{'name':_0x4d9865[_0xb626('0x2e')],'type':_0x4d9865['type'][_0xb626('0x2f')]};});_0x1147eb[_0xb626('0x30')]=_[_0xb626('0x2c')](_0x5e8999,'name');_0x1147eb[_0xb626('0x31')]=_[_0xb626('0x32')](_0x3d21f1['query']);_0x1147eb['filters']=_[_0xb626('0x33')](_0x1147eb[_0xb626('0x30')],_0x1147eb[_0xb626('0x31')]);_0x47fe1a[_0xb626('0x34')]=_[_0xb626('0x33')](_0x1147eb['model'],qs[_0xb626('0x35')](_0x3d21f1[_0xb626('0x31')]['fields']));_0x47fe1a[_0xb626('0x34')]=_0x47fe1a[_0xb626('0x34')][_0xb626('0x36')]?_0x47fe1a[_0xb626('0x34')]:_0x1147eb[_0xb626('0x30')];if(!_0x3d21f1[_0xb626('0x31')]['hasOwnProperty'](_0xb626('0x37'))){_0x47fe1a[_0xb626('0x1f')]=qs[_0xb626('0x1f')](_0x3d21f1[_0xb626('0x31')][_0xb626('0x1f')]);_0x47fe1a[_0xb626('0x1c')]=qs[_0xb626('0x1c')](_0x3d21f1[_0xb626('0x31')][_0xb626('0x1c')]);}_0x47fe1a[_0xb626('0x38')]=qs[_0xb626('0x39')](_0x3d21f1[_0xb626('0x31')]['sort']);_0x47fe1a[_0xb626('0x3a')]=qs[_0xb626('0x3b')](_['pick'](_0x3d21f1[_0xb626('0x31')],_0x1147eb[_0xb626('0x3b')]),_0x5e8999);if(_0x3d21f1[_0xb626('0x31')][_0xb626('0x3c')]){_0x47fe1a[_0xb626('0x3a')]=_[_0xb626('0x3d')](_0x47fe1a[_0xb626('0x3a')],{'$or':_['map'](_0x5e8999,function(_0x169449){if(_0x169449[_0xb626('0x3e')]!==_0xb626('0x3f')){var _0x3a959f={};_0x3a959f[_0x169449['name']]={'$like':'%'+_0x3d21f1['query'][_0xb626('0x3c')]+'%'};return _0x3a959f;}})});}_0x47fe1a=_[_0xb626('0x3d')]({},_0x47fe1a,_0x3d21f1[_0xb626('0x40')]);var _0xa1e87={'where':_0x47fe1a[_0xb626('0x3a')]};return db[_0xb626('0x41')][_0xb626('0x1e')](_0xa1e87)[_0xb626('0x25')](function(_0x58eb98){_0x3f3ea8[_0xb626('0x1e')]=_0x58eb98;if(_0x3d21f1[_0xb626('0x31')][_0xb626('0x42')]){_0x47fe1a['include']=[{'all':!![]}];}return db[_0xb626('0x41')]['findAll'](_0x47fe1a);})[_0xb626('0x25')](function(_0xab8ce9){_0x3f3ea8[_0xb626('0x43')]=_0xab8ce9;return _0x3f3ea8;})[_0xb626('0x25')](respondWithFilteredResult(_0x39f8ad,_0x47fe1a))['catch'](handleError(_0x39f8ad,null));};exports[_0xb626('0x44')]=function(_0x55cbe8,_0x4461bc){var _0x415d86={'raw':![],'where':{'id':_0x55cbe8[_0xb626('0x45')]['id']}},_0x213ad1={};_0x213ad1[_0xb626('0x30')]=_[_0xb626('0x32')](db['AnalyticFieldReport'][_0xb626('0x2d')]);_0x213ad1[_0xb626('0x31')]=_[_0xb626('0x32')](_0x55cbe8[_0xb626('0x31')]);_0x213ad1['filters']=_[_0xb626('0x33')](_0x213ad1[_0xb626('0x30')],_0x213ad1['query']);_0x415d86[_0xb626('0x34')]=_[_0xb626('0x33')](_0x213ad1[_0xb626('0x30')],qs['fields'](_0x55cbe8[_0xb626('0x31')][_0xb626('0x35')]));_0x415d86[_0xb626('0x34')]=_0x415d86[_0xb626('0x34')][_0xb626('0x36')]?_0x415d86['attributes']:_0x213ad1[_0xb626('0x30')];if(_0x55cbe8['query']['includeAll']){_0x415d86[_0xb626('0x46')]=[{'all':!![]}];}_0x415d86=_[_0xb626('0x3d')]({},_0x415d86,_0x55cbe8[_0xb626('0x40')]);return db[_0xb626('0x41')][_0xb626('0x47')](_0x415d86)['then'](handleEntityNotFound(_0x4461bc,null))[_0xb626('0x25')](respondWithResult(_0x4461bc,null))[_0xb626('0x48')](handleError(_0x4461bc,null));};exports['create']=function(_0x4f6be3,_0x46e8ef){return db[_0xb626('0x41')][_0xb626('0x49')](_0x4f6be3[_0xb626('0x4a')],{})[_0xb626('0x25')](respondWithResult(_0x46e8ef,0xc9))[_0xb626('0x48')](handleError(_0x46e8ef,null));};exports['bulkCreate']=function(_0x24aa63,_0x18bb9c){return db[_0xb626('0x41')][_0xb626('0x4b')](_0x24aa63[_0xb626('0x4a')],{'raw':![],'individualHooks':!![]})[_0xb626('0x25')](respondWithResult(_0x18bb9c,0xc9))['catch'](handleError(_0x18bb9c,null));};exports[_0xb626('0x24')]=function(_0xcff739,_0x591838){if(_0xcff739[_0xb626('0x4a')]['id']){delete _0xcff739[_0xb626('0x4a')]['id'];}return db[_0xb626('0x41')][_0xb626('0x47')]({'where':{'id':_0xcff739[_0xb626('0x45')]['id']}})[_0xb626('0x25')](handleEntityNotFound(_0x591838,null))[_0xb626('0x25')](saveUpdates(_0xcff739[_0xb626('0x4a')],null))[_0xb626('0x25')](respondWithResult(_0x591838,null))['catch'](handleError(_0x591838,null));};exports[_0xb626('0x4c')]=function(_0x3e971d,_0x35b9d2){return db[_0xb626('0x41')][_0xb626('0x47')]({'where':{'id':_0x3e971d[_0xb626('0x45')]['id']}})[_0xb626('0x25')](handleEntityNotFound(_0x35b9d2,null))[_0xb626('0x25')](removeEntity(_0x35b9d2,null))[_0xb626('0x48')](handleError(_0x35b9d2,null));};exports[_0xb626('0x4d')]=function(_0x3ac2be,_0x28b5f2){return db[_0xb626('0x41')]['destroy']({'where':{'id':_0x3ac2be[_0xb626('0x31')][_0xb626('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xb626('0x25')](respondWithResult(_0x28b5f2,0xcc))[_0xb626('0x48')](handleError(_0x28b5f2,null));};exports['addFields']=function(_0x4138cc,_0x353418,_0x26a622){return db[_0xb626('0x4f')][_0xb626('0x50')]({'where':{'id':_0x4138cc[_0xb626('0x45')]['id']}})[_0xb626('0x25')](handleEntityNotFound(_0x353418,null))[_0xb626('0x25')](function(_0x28047f){if(_0x28047f){return db[_0xb626('0x51')][_0xb626('0x52')](function(_0x599f48){return db[_0xb626('0x41')][_0xb626('0x4c')]({'where':{'CustomReportId':_0x4138cc['params']['id']},'transaction':_0x599f48})['then'](function(_0x4c82c4){var _0x4135bc=_[_0xb626('0x2c')](_0x4138cc['body'],function(_0x319bfd){delete _0x319bfd['id'];_0x319bfd['CustomReportId']=_0x4138cc[_0xb626('0x45')]['id'];return _0x319bfd;});return db['AnalyticFieldReport'][_0xb626('0x4b')](_0x4135bc,{'transaction':_0x599f48});});})['then'](function(){return db[_0xb626('0x41')][_0xb626('0x53')]({'where':{'CustomReportId':_0x4138cc[_0xb626('0x45')]['id']}});});}})['then'](respondWithResult(_0x353418,null))[_0xb626('0x48')](handleError(_0x353418,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index b3bffdc..d90edd7 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 _0xfb64=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise'];(function(_0x45fa54,_0x491b1d){var _0x578453=function(_0x416cae){while(--_0x416cae){_0x45fa54['push'](_0x45fa54['shift']());}};_0x578453(++_0x491b1d);}(_0xfb64,0x96));var _0x4fb6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfb64[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4fb6('0x0'));var util=require(_0x4fb6('0x1'));var logger=require('../../config/logger')(_0x4fb6('0x2'));var moment=require(_0x4fb6('0x3'));var BPromise=require(_0x4fb6('0x4'));var rp=require(_0x4fb6('0x5'));var fs=require('fs');var path=require(_0x4fb6('0x6'));var rimraf=require(_0x4fb6('0x7'));var config=require(_0x4fb6('0x8'));var attributes=require(_0x4fb6('0x9'));module[_0x4fb6('0xa')]=function(_0xd5ab56,_0x1ea035){return _0xd5ab56['define'](_0x4fb6('0xb'),attributes,{'tableName':_0x4fb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df7=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x20c304,_0x35f872){var _0x4114b6=function(_0x2de687){while(--_0x2de687){_0x20c304['push'](_0x20c304['shift']());}};_0x4114b6(++_0x35f872);}(_0x6df7,0x177));var _0x76df=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6df7[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x76df('0x0'))('api');var moment=require(_0x76df('0x1'));var BPromise=require(_0x76df('0x2'));var rp=require(_0x76df('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x76df('0x4'));var attributes=require(_0x76df('0x5'));module[_0x76df('0x6')]=function(_0x3ff6e5,_0xc6ce11){return _0x3ff6e5[_0x76df('0x7')](_0x76df('0x8'),attributes,{'tableName':_0x76df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index dd5c31e..31a5099 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 _0x9bdf=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x48d64b,_0x4fabc8){var _0x5616b=function(_0x464ef3){while(--_0x464ef3){_0x48d64b['push'](_0x48d64b['shift']());}};_0x5616b(++_0x4fabc8);}(_0x9bdf,0x103));var _0xf9bd=function(_0x10941b,_0x14c7da){_0x10941b=_0x10941b-0x0;var _0x3f6c2f=_0x9bdf[_0x10941b];return _0x3f6c2f;};'use strict';var _=require(_0xf9bd('0x0'));var util=require(_0xf9bd('0x1'));var moment=require(_0xf9bd('0x2'));var BPromise=require(_0xf9bd('0x3'));var rs=require(_0xf9bd('0x4'));var fs=require('fs');var Redis=require(_0xf9bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9bd('0x6'));var logger=require(_0xf9bd('0x7'))(_0xf9bd('0x8'));var config=require(_0xf9bd('0x9'));var jayson=require(_0xf9bd('0xa'));var client=jayson[_0xf9bd('0xb')][_0xf9bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4645af,_0x13ec0a,_0x4e7b26){return new BPromise(function(_0x5721e7,_0x2cfa99){return client['request'](_0x4645af,_0x4e7b26)[_0xf9bd('0xd')](function(_0x200e0a){logger[_0xf9bd('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13ec0a,_0xf9bd('0xf'));logger[_0xf9bd('0x10')](_0xf9bd('0x11'),_0x13ec0a,_0xf9bd('0xf'),JSON['stringify'](_0x200e0a));if(_0x200e0a[_0xf9bd('0x12')]){if(_0x200e0a[_0xf9bd('0x12')]['code']===0x1f4){logger[_0xf9bd('0x12')](_0xf9bd('0x13'),_0x13ec0a,_0x200e0a[_0xf9bd('0x12')][_0xf9bd('0x14')]);return _0x2cfa99(_0x200e0a[_0xf9bd('0x12')]['message']);}logger['error'](_0xf9bd('0x13'),_0x13ec0a,_0x200e0a['error'][_0xf9bd('0x14')]);return _0x5721e7(_0x200e0a['error'][_0xf9bd('0x14')]);}else{logger[_0xf9bd('0xe')](_0xf9bd('0x13'),_0x13ec0a,_0xf9bd('0xf'));_0x5721e7(_0x200e0a[_0xf9bd('0x15')]['message']);}})[_0xf9bd('0x16')](function(_0x477225){logger[_0xf9bd('0x12')](_0xf9bd('0x13'),_0x13ec0a,_0x477225);_0x2cfa99(_0x477225);});});} \ No newline at end of file +var _0x963c=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','code','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch'];(function(_0x1f51b9,_0x2ebd2b){var _0xf81150=function(_0xd31cca){while(--_0xd31cca){_0x1f51b9['push'](_0x1f51b9['shift']());}};_0xf81150(++_0x2ebd2b);}(_0x963c,0x1e3));var _0xc963=function(_0x271191,_0x3486bf){_0x271191=_0x271191-0x0;var _0x2765db=_0x963c[_0x271191];return _0x2765db;};'use strict';var _=require(_0xc963('0x0'));var util=require(_0xc963('0x1'));var moment=require(_0xc963('0x2'));var BPromise=require(_0xc963('0x3'));var rs=require(_0xc963('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc963('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc963('0x6'))(_0xc963('0x7'));var config=require(_0xc963('0x8'));var jayson=require(_0xc963('0x9'));var client=jayson[_0xc963('0xa')][_0xc963('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34313,_0x2a661f,_0x377787){return new BPromise(function(_0x499f84,_0x93cbb5){return client[_0xc963('0xc')](_0x34313,_0x377787)[_0xc963('0xd')](function(_0x35061d){logger[_0xc963('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a661f,_0xc963('0xf'));logger['debug'](_0xc963('0x10'),_0x2a661f,_0xc963('0xf'),JSON['stringify'](_0x35061d));if(_0x35061d['error']){if(_0x35061d['error'][_0xc963('0x11')]===0x1f4){logger[_0xc963('0x12')](_0xc963('0x13'),_0x2a661f,_0x35061d[_0xc963('0x12')][_0xc963('0x14')]);return _0x93cbb5(_0x35061d[_0xc963('0x12')][_0xc963('0x14')]);}logger[_0xc963('0x12')](_0xc963('0x13'),_0x2a661f,_0x35061d[_0xc963('0x12')][_0xc963('0x14')]);return _0x499f84(_0x35061d['error'][_0xc963('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2a661f,_0xc963('0xf'));_0x499f84(_0x35061d[_0xc963('0x15')]['message']);}})[_0xc963('0x16')](function(_0x41535d){logger[_0xc963('0x12')](_0xc963('0x13'),_0x2a661f,_0x41535d);_0x93cbb5(_0x41535d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b3d575f..1cc056a 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(_0xd8d76d,_0x24841e){var _0x36a635=function(_0x111d8b){while(--_0x111d8b){_0xd8d76d['push'](_0xd8d76d['shift']());}};_0x36a635(++_0x24841e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x147937,_0x520db4){var _0xb38aa1=function(_0x77c76c){while(--_0x77c76c){_0x147937['push'](_0x147937['shift']());}};_0xb38aa1(++_0x520db4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 320fd18..1126ca5 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 _0xe74e=['name','TEXT','exports','STRING'];(function(_0x1adaee,_0x300db1){var _0x49a4b0=function(_0x3c8edc){while(--_0x3c8edc){_0x1adaee['push'](_0x1adaee['shift']());}};_0x49a4b0(++_0x300db1);}(_0xe74e,0x10a));var _0xee74=function(_0x69c447,_0x86d371){_0x69c447=_0x69c447-0x0;var _0x36b5de=_0xe74e[_0x69c447];return _0x36b5de;};'use strict';var Sequelize=require('sequelize');module[_0xee74('0x0')]={'name':{'type':Sequelize[_0xee74('0x1')],'allowNull':![],'unique':_0xee74('0x2')},'table':{'type':Sequelize[_0xee74('0x1')]},'metric':{'type':Sequelize[_0xee74('0x3')]},'description':{'type':Sequelize[_0xee74('0x1')]}}; \ No newline at end of file +var _0x74f4=['name','STRING','sequelize','exports'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x74f4,0xaa));var _0x474f=function(_0x5a55ae,_0x54e98e){_0x5a55ae=_0x5a55ae-0x0;var _0x246e3d=_0x74f4[_0x5a55ae];return _0x246e3d;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x474f('0x2')},'table':{'type':Sequelize[_0x474f('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x474f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3c134cd..a54e2a8 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x6025f,_0x221a95){var _0x25b187=function(_0xaaac01){while(--_0xaaac01){_0x6025f['push'](_0x6025f['shift']());}};_0x25b187(++_0x221a95);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file +var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x544f36,_0x32f50c){var _0x3f7f11=function(_0x34ea99){while(--_0x34ea99){_0x544f36['push'](_0x544f36['shift']());}};_0x3f7f11(++_0x32f50c);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x112df0,_0x1a1c0e){_0x112df0=_0x112df0-0x0;var _0x392265=_0xd6d6[_0x112df0];return _0x392265;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index df2571d..c809354 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 _0x0755=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10694e,_0x49ef3c){var _0x585ca6=function(_0x4f415c){while(--_0x4f415c){_0x10694e['push'](_0x10694e['shift']());}};_0x585ca6(++_0x49ef3c);}(_0x0755,0x7c));var _0x5075=function(_0x5cba3b,_0x189355){_0x5cba3b=_0x5cba3b-0x0;var _0x50a58d=_0x0755[_0x5cba3b];return _0x50a58d;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var logger=require(_0x5075('0x2'))(_0x5075('0x3'));var moment=require(_0x5075('0x4'));var BPromise=require(_0x5075('0x5'));var rp=require(_0x5075('0x6'));var fs=require('fs');var path=require(_0x5075('0x7'));var rimraf=require(_0x5075('0x8'));var config=require(_0x5075('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x5075('0xa')]=function(_0x2a7be,_0x3f4fea){return _0x2a7be[_0x5075('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44c2=['../../config/environment','./analyticMetric.attributes','AnalyticMetric','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0x44c2,0x100));var _0x244c=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x44c2[_0x55cc58];return _0x26062e;};'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':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index f22b314..8502902 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 _0x9a07=['info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x1b3526,_0x236767){var _0x18e572=function(_0x483265){while(--_0x483265){_0x1b3526['push'](_0x1b3526['shift']());}};_0x18e572(++_0x236767);}(_0x9a07,0x1ad));var _0x79a0=function(_0x3fd68f,_0x5b5928){_0x3fd68f=_0x3fd68f-0x0;var _0xdf1d8a=_0x9a07[_0x3fd68f];return _0xdf1d8a;};'use strict';var _=require('lodash');var util=require(_0x79a0('0x0'));var moment=require(_0x79a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x79a0('0x2'));var fs=require('fs');var Redis=require(_0x79a0('0x3'));var db=require(_0x79a0('0x4'))['db'];var utils=require(_0x79a0('0x5'));var logger=require(_0x79a0('0x6'))(_0x79a0('0x7'));var config=require(_0x79a0('0x8'));var jayson=require(_0x79a0('0x9'));var client=jayson['client'][_0x79a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387f6d,_0x4a1999,_0x154917){return new BPromise(function(_0xd1eb97,_0x12d2b0){return client['request'](_0x387f6d,_0x154917)[_0x79a0('0xb')](function(_0x4418ae){logger[_0x79a0('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4a1999,_0x79a0('0xd'));logger[_0x79a0('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4a1999,_0x79a0('0xd'),JSON[_0x79a0('0xf')](_0x4418ae));if(_0x4418ae[_0x79a0('0x10')]){if(_0x4418ae[_0x79a0('0x10')][_0x79a0('0x11')]===0x1f4){logger[_0x79a0('0x10')](_0x79a0('0x12'),_0x4a1999,_0x4418ae['error'][_0x79a0('0x13')]);return _0x12d2b0(_0x4418ae[_0x79a0('0x10')]['message']);}logger['error'](_0x79a0('0x12'),_0x4a1999,_0x4418ae['error'][_0x79a0('0x13')]);return _0xd1eb97(_0x4418ae[_0x79a0('0x10')]['message']);}else{logger[_0x79a0('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4a1999,_0x79a0('0xd'));_0xd1eb97(_0x4418ae[_0x79a0('0x14')]['message']);}})['catch'](function(_0x195880){logger['error'](_0x79a0('0x12'),_0x4a1999,_0x195880);_0x12d2b0(_0x195880);});});} \ No newline at end of file +var _0xb55f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x9fcc57,_0x1e7d73){var _0x3caf84=function(_0x53e8ec){while(--_0x53e8ec){_0x9fcc57['push'](_0x9fcc57['shift']());}};_0x3caf84(++_0x1e7d73);}(_0xb55f,0x1f3));var _0xfb55=function(_0x2f3fc8,_0x591982){_0x2f3fc8=_0x2f3fc8-0x0;var _0x21c64a=_0xb55f[_0x2f3fc8];return _0x21c64a;};'use strict';var _=require(_0xfb55('0x0'));var util=require('util');var moment=require(_0xfb55('0x1'));var BPromise=require(_0xfb55('0x2'));var rs=require(_0xfb55('0x3'));var fs=require('fs');var Redis=require(_0xfb55('0x4'));var db=require(_0xfb55('0x5'))['db'];var utils=require(_0xfb55('0x6'));var logger=require('../../config/logger')(_0xfb55('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb55('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa919ea,_0xe2ebd,_0x28778a){return new BPromise(function(_0x104624,_0x15264b){return client[_0xfb55('0x9')](_0xa919ea,_0x28778a)[_0xfb55('0xa')](function(_0xcf813d){logger[_0xfb55('0xb')](_0xfb55('0xc'),_0xe2ebd,_0xfb55('0xd'));logger[_0xfb55('0xe')](_0xfb55('0xf'),_0xe2ebd,'request\x20sent',JSON['stringify'](_0xcf813d));if(_0xcf813d[_0xfb55('0x10')]){if(_0xcf813d[_0xfb55('0x10')][_0xfb55('0x11')]===0x1f4){logger[_0xfb55('0x10')](_0xfb55('0xc'),_0xe2ebd,_0xcf813d[_0xfb55('0x10')][_0xfb55('0x12')]);return _0x15264b(_0xcf813d['error'][_0xfb55('0x12')]);}logger[_0xfb55('0x10')](_0xfb55('0xc'),_0xe2ebd,_0xcf813d[_0xfb55('0x10')][_0xfb55('0x12')]);return _0x104624(_0xcf813d[_0xfb55('0x10')][_0xfb55('0x12')]);}else{logger[_0xfb55('0xb')](_0xfb55('0xc'),_0xe2ebd,_0xfb55('0xd'));_0x104624(_0xcf813d['result'][_0xfb55('0x12')]);}})[_0xfb55('0x13')](function(_0x141078){logger['error'](_0xfb55('0xc'),_0xe2ebd,_0x141078);_0x15264b(_0x141078);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0c9ee4a..cfb6fd5 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 _0x269f=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x42c56b,_0x58ae76){var _0x13f59d=function(_0x247dfe){while(--_0x247dfe){_0x42c56b['push'](_0x42c56b['shift']());}};_0x13f59d(++_0x58ae76);}(_0x269f,0xee));var _0xf269=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x269f[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xf269('0x0'));var util=require(_0xf269('0x1'));var path=require(_0xf269('0x2'));var timeout=require('connect-timeout');var express=require(_0xf269('0x3'));var router=express['Router']();var fs_extra=require(_0xf269('0x4'));var auth=require(_0xf269('0x5'));var interaction=require(_0xf269('0x6'));var config=require(_0xf269('0x7'));var controller=require(_0xf269('0x8'));router['get']('/',auth[_0xf269('0x9')](),controller[_0xf269('0xa')]);router[_0xf269('0xb')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller[_0xf269('0xd')]);router[_0xf269('0xe')]('/',auth['isAuthenticated'](),controller[_0xf269('0xf')]);router[_0xf269('0x10')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller[_0xf269('0x11')]);router[_0xf269('0x12')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa992=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xa992,0x18c));var _0x2a99=function(_0x3d908c,_0x5a4c42){_0x3d908c=_0x3d908c-0x0;var _0xef87c8=_0xa992[_0x3d908c];return _0xef87c8;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var fs_extra=require(_0x2a99('0x5'));var auth=require(_0x2a99('0x6'));var interaction=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var controller=require(_0x2a99('0x9'));router[_0x2a99('0xa')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xc')]);router[_0x2a99('0xa')]('/:id',auth[_0x2a99('0xb')](),controller[_0x2a99('0xd')]);router[_0x2a99('0xe')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x10')](_0x2a99('0x11'),auth[_0x2a99('0xb')](),controller[_0x2a99('0x12')]);router[_0x2a99('0x13')](_0x2a99('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a99('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e117793..9e64afb 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 _0x0493=['exports','TEXT','sequelize'];(function(_0x35271d,_0x4a363c){var _0x3198c6=function(_0xdd330d){while(--_0xdd330d){_0x35271d['push'](_0x35271d['shift']());}};_0x3198c6(++_0x4a363c);}(_0x0493,0x101));var _0x3049=function(_0x2928d8,_0x181be9){_0x2928d8=_0x2928d8-0x0;var _0x2fd2d7=_0x0493[_0x2928d8];return _0x2fd2d7;};'use strict';var Sequelize=require(_0x3049('0x0'));module[_0x3049('0x1')]={'tree':{'type':Sequelize[_0x3049('0x2')],'allowNull':![]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 1ed8a48..ced0736 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 _0x0500=['sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','attributes','find','catch','body','update','destroy','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x0500,0x7f));var _0x0050=function(_0x5f1ca7,_0x42c21e){_0x5f1ca7=_0x5f1ca7-0x0;var _0x3ee471=_0x0500[_0x5f1ca7];return _0x3ee471;};'use strict';var emlformat=require(_0x0050('0x0'));var rimraf=require(_0x0050('0x1'));var zipdir=require(_0x0050('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0050('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0050('0x4'));var util=require(_0x0050('0x5'));var path=require(_0x0050('0x6'));var sox=require(_0x0050('0x7'));var csv=require(_0x0050('0x8'));var ejs=require(_0x0050('0x9'));var fs=require('fs');var fs_extra=require(_0x0050('0xa'));var _=require(_0x0050('0xb'));var squel=require(_0x0050('0xc'));var crypto=require(_0x0050('0xd'));var jsforce=require(_0x0050('0xe'));var deskjs=require(_0x0050('0xf'));var toCsv=require(_0x0050('0x8'));var querystring=require('querystring');var Papa=require(_0x0050('0x10'));var Redis=require(_0x0050('0x11'));var authService=require(_0x0050('0x12'));var qs=require(_0x0050('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0050('0x14'));var logger=require('../../config/logger')(_0x0050('0x15'));var utils=require(_0x0050('0x16'));var config=require(_0x0050('0x17'));var licenseUtil=require(_0x0050('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dfe31,_0x152a89){_0x152a89=_0x152a89||0xcc;return function(_0x1c1fa3){if(_0x1c1fa3){return _0x5dfe31[_0x0050('0x19')](_0x152a89);}return _0x5dfe31[_0x0050('0x1a')](_0x152a89)[_0x0050('0x1b')]();};}function respondWithResult(_0x5e52e0,_0x106448){_0x106448=_0x106448||0xc8;return function(_0x4823bf){if(_0x4823bf){return _0x5e52e0[_0x0050('0x1a')](_0x106448)[_0x0050('0x1c')](_0x4823bf);}};}function respondWithFilteredResult(_0xfdf189,_0x5b9f9e){return function(_0x39ec1f){if(_0x39ec1f){var _0x2cdc1=typeof _0x5b9f9e['offset']===_0x0050('0x1d')&&typeof _0x5b9f9e['limit']===_0x0050('0x1d');var _0x1f284a=_0x39ec1f['count'];var _0x4eee11=_0x2cdc1?0x0:_0x5b9f9e[_0x0050('0x1e')];var _0x5b2ade=_0x2cdc1?_0x39ec1f[_0x0050('0x1f')]:_0x5b9f9e['offset']+_0x5b9f9e['limit'];var _0x485fd9;if(_0x5b2ade>=_0x1f284a){_0x5b2ade=_0x1f284a;_0x485fd9=0xc8;}else{_0x485fd9=0xce;}_0xfdf189[_0x0050('0x1a')](_0x485fd9);return _0xfdf189[_0x0050('0x20')](_0x0050('0x21'),_0x4eee11+'-'+_0x5b2ade+'/'+_0x1f284a)['json'](_0x39ec1f);}return null;};}function patchUpdates(_0x50ae6d){return function(_0x5c6ea1){try{jsonpatch[_0x0050('0x22')](_0x5c6ea1,_0x50ae6d,!![]);}catch(_0x14347c){return BPromise[_0x0050('0x23')](_0x14347c);}return _0x5c6ea1[_0x0050('0x24')]();};}function saveUpdates(_0x2cd57e,_0x3eb52c){return function(_0x2ba4a0){if(_0x2ba4a0){return _0x2ba4a0['update'](_0x2cd57e)[_0x0050('0x25')](function(_0x4db9b8){return _0x4db9b8;});}return null;};}function removeEntity(_0x447c9a,_0x3880e5){return function(_0x10f03d){if(_0x10f03d){return _0x10f03d['destroy']()[_0x0050('0x25')](function(){_0x447c9a['status'](0xcc)[_0x0050('0x1b')]();});}};}function handleEntityNotFound(_0x49c2e5,_0x3a79b5){return function(_0xe566b6){if(!_0xe566b6){_0x49c2e5[_0x0050('0x19')](0x194);}return _0xe566b6;};}function handleError(_0x4562f5,_0x48c290){_0x48c290=_0x48c290||0x1f4;return function(_0x520e5a){logger[_0x0050('0x26')](_0x520e5a[_0x0050('0x27')]);if(_0x520e5a[_0x0050('0x28')]){delete _0x520e5a['name'];}_0x4562f5['status'](_0x48c290)[_0x0050('0x29')](_0x520e5a);};}exports[_0x0050('0x2a')]=function(_0x37c833,_0x3a1692){var _0x4e54d2={},_0x58c037={},_0x14e105={'count':0x0,'rows':[]};var _0x2c2080=_[_0x0050('0x2b')](db[_0x0050('0x2c')][_0x0050('0x2d')],function(_0x2e84ad){return{'name':_0x2e84ad[_0x0050('0x2e')],'type':_0x2e84ad['type'][_0x0050('0x2f')]};});_0x58c037[_0x0050('0x30')]=_[_0x0050('0x2b')](_0x2c2080,_0x0050('0x28'));_0x58c037[_0x0050('0x31')]=_[_0x0050('0x32')](_0x37c833['query']);_0x58c037[_0x0050('0x33')]=_[_0x0050('0x34')](_0x58c037[_0x0050('0x30')],_0x58c037['query']);_0x4e54d2['attributes']=_[_0x0050('0x34')](_0x58c037['model'],qs[_0x0050('0x35')](_0x37c833[_0x0050('0x31')][_0x0050('0x35')]));_0x4e54d2['attributes']=_0x4e54d2['attributes'][_0x0050('0x36')]?_0x4e54d2['attributes']:_0x58c037[_0x0050('0x30')];if(!_0x37c833['query'][_0x0050('0x37')](_0x0050('0x38'))){_0x4e54d2[_0x0050('0x39')]=qs['limit'](_0x37c833[_0x0050('0x31')][_0x0050('0x39')]);_0x4e54d2[_0x0050('0x1e')]=qs[_0x0050('0x1e')](_0x37c833[_0x0050('0x31')][_0x0050('0x1e')]);}_0x4e54d2[_0x0050('0x3a')]=qs[_0x0050('0x3b')](_0x37c833[_0x0050('0x31')]['sort']);_0x4e54d2[_0x0050('0x3c')]=qs[_0x0050('0x33')](_[_0x0050('0x3d')](_0x37c833[_0x0050('0x31')],_0x58c037['filters']),_0x2c2080);if(_0x37c833[_0x0050('0x31')][_0x0050('0x3e')]){_0x4e54d2['where']=_[_0x0050('0x3f')](_0x4e54d2['where'],{'$or':_['map'](_0x2c2080,function(_0x21cf53){if(_0x21cf53['type']!==_0x0050('0x40')){var _0x3b649d={};_0x3b649d[_0x21cf53[_0x0050('0x28')]]={'$like':'%'+_0x37c833[_0x0050('0x31')][_0x0050('0x3e')]+'%'};return _0x3b649d;}})});}_0x4e54d2=_[_0x0050('0x3f')]({},_0x4e54d2,_0x37c833[_0x0050('0x41')]);var _0x4d353a={'where':_0x4e54d2[_0x0050('0x3c')]};return db['AnalyticTreeReport'][_0x0050('0x1f')](_0x4d353a)[_0x0050('0x25')](function(_0x59559e){_0x14e105[_0x0050('0x1f')]=_0x59559e;if(_0x37c833[_0x0050('0x31')][_0x0050('0x42')]){_0x4e54d2[_0x0050('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0050('0x44')](_0x4e54d2);})[_0x0050('0x25')](function(_0x2163a5){_0x14e105['rows']=_0x2163a5;return _0x14e105;})[_0x0050('0x25')](respondWithFilteredResult(_0x3a1692,_0x4e54d2))['catch'](handleError(_0x3a1692,null));};exports['show']=function(_0x53fd3e,_0x16397e){var _0x1b2fba={'raw':!![],'where':{'id':_0x53fd3e[_0x0050('0x45')]['id']}},_0x25eb4d={};_0x25eb4d['model']=_[_0x0050('0x32')](db[_0x0050('0x2c')][_0x0050('0x2d')]);_0x25eb4d[_0x0050('0x31')]=_[_0x0050('0x32')](_0x53fd3e['query']);_0x25eb4d[_0x0050('0x33')]=_[_0x0050('0x34')](_0x25eb4d[_0x0050('0x30')],_0x25eb4d['query']);_0x1b2fba[_0x0050('0x46')]=_[_0x0050('0x34')](_0x25eb4d[_0x0050('0x30')],qs[_0x0050('0x35')](_0x53fd3e[_0x0050('0x31')]['fields']));_0x1b2fba[_0x0050('0x46')]=_0x1b2fba['attributes'][_0x0050('0x36')]?_0x1b2fba[_0x0050('0x46')]:_0x25eb4d[_0x0050('0x30')];if(_0x53fd3e[_0x0050('0x31')][_0x0050('0x42')]){_0x1b2fba[_0x0050('0x43')]=[{'all':!![]}];}_0x1b2fba=_['merge']({},_0x1b2fba,_0x53fd3e['options']);return db['AnalyticTreeReport'][_0x0050('0x47')](_0x1b2fba)[_0x0050('0x25')](handleEntityNotFound(_0x16397e,null))[_0x0050('0x25')](respondWithResult(_0x16397e,null))[_0x0050('0x48')](handleError(_0x16397e,null));};exports['create']=function(_0x1ee8e5,_0x49a0a1){return db['AnalyticTreeReport']['create'](_0x1ee8e5[_0x0050('0x49')],{})[_0x0050('0x25')](respondWithResult(_0x49a0a1,0xc9))[_0x0050('0x48')](handleError(_0x49a0a1,null));};exports[_0x0050('0x4a')]=function(_0x377ef4,_0x8d06f2){if(_0x377ef4['body']['id']){delete _0x377ef4['body']['id'];}return db[_0x0050('0x2c')][_0x0050('0x47')]({'where':{'id':_0x377ef4[_0x0050('0x45')]['id']}})[_0x0050('0x25')](handleEntityNotFound(_0x8d06f2,null))['then'](saveUpdates(_0x377ef4[_0x0050('0x49')],null))['then'](respondWithResult(_0x8d06f2,null))[_0x0050('0x48')](handleError(_0x8d06f2,null));};exports[_0x0050('0x4b')]=function(_0x524f8e,_0x46d7ef){return db[_0x0050('0x2c')][_0x0050('0x47')]({'where':{'id':_0x524f8e[_0x0050('0x45')]['id']}})[_0x0050('0x25')](handleEntityNotFound(_0x46d7ef,null))[_0x0050('0x25')](removeEntity(_0x46d7ef,null))[_0x0050('0x48')](handleError(_0x46d7ef,null));}; \ No newline at end of file +var _0xde8b=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','create','catch','update','find','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs'];(function(_0x22cb3e,_0x32cefd){var _0xdc17f4=function(_0x4dcafc){while(--_0x4dcafc){_0x22cb3e['push'](_0x22cb3e['shift']());}};_0xdc17f4(++_0x32cefd);}(_0xde8b,0xcc));var _0xbde8=function(_0xd68ab1,_0x20f194){_0xd68ab1=_0xd68ab1-0x0;var _0x567995=_0xde8b[_0xd68ab1];return _0x567995;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbde8('0x0'));var zipdir=require(_0xbde8('0x1'));var jsonpatch=require(_0xbde8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbde8('0x3'));var util=require(_0xbde8('0x4'));var path=require(_0xbde8('0x5'));var sox=require(_0xbde8('0x6'));var csv=require(_0xbde8('0x7'));var ejs=require(_0xbde8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbde8('0x9'));var squel=require(_0xbde8('0xa'));var crypto=require(_0xbde8('0xb'));var jsforce=require(_0xbde8('0xc'));var deskjs=require(_0xbde8('0xd'));var toCsv=require(_0xbde8('0x7'));var querystring=require(_0xbde8('0xe'));var Papa=require(_0xbde8('0xf'));var Redis=require(_0xbde8('0x10'));var authService=require(_0xbde8('0x11'));var qs=require(_0xbde8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbde8('0x13'));var logger=require('../../config/logger')(_0xbde8('0x14'));var utils=require(_0xbde8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbde8('0x16'))['db'];function respondWithStatusCode(_0xd99646,_0x3aebf4){_0x3aebf4=_0x3aebf4||0xcc;return function(_0x484476){if(_0x484476){return _0xd99646[_0xbde8('0x17')](_0x3aebf4);}return _0xd99646['status'](_0x3aebf4)[_0xbde8('0x18')]();};}function respondWithResult(_0x1624b5,_0x1011f8){_0x1011f8=_0x1011f8||0xc8;return function(_0x462503){if(_0x462503){return _0x1624b5[_0xbde8('0x19')](_0x1011f8)[_0xbde8('0x1a')](_0x462503);}};}function respondWithFilteredResult(_0x18d156,_0x5a41c0){return function(_0x10be7d){if(_0x10be7d){var _0x426890=typeof _0x5a41c0['offset']===_0xbde8('0x1b')&&typeof _0x5a41c0['limit']==='undefined';var _0x3f9ddc=_0x10be7d['count'];var _0x126652=_0x426890?0x0:_0x5a41c0[_0xbde8('0x1c')];var _0x1a3cde=_0x426890?_0x10be7d[_0xbde8('0x1d')]:_0x5a41c0[_0xbde8('0x1c')]+_0x5a41c0['limit'];var _0x2aa65e;if(_0x1a3cde>=_0x3f9ddc){_0x1a3cde=_0x3f9ddc;_0x2aa65e=0xc8;}else{_0x2aa65e=0xce;}_0x18d156[_0xbde8('0x19')](_0x2aa65e);return _0x18d156[_0xbde8('0x1e')](_0xbde8('0x1f'),_0x126652+'-'+_0x1a3cde+'/'+_0x3f9ddc)[_0xbde8('0x1a')](_0x10be7d);}return null;};}function patchUpdates(_0x34df7d){return function(_0x27e864){try{jsonpatch[_0xbde8('0x20')](_0x27e864,_0x34df7d,!![]);}catch(_0x33f370){return BPromise[_0xbde8('0x21')](_0x33f370);}return _0x27e864['save']();};}function saveUpdates(_0x27f92f,_0x3bf423){return function(_0x498a6e){if(_0x498a6e){return _0x498a6e['update'](_0x27f92f)[_0xbde8('0x22')](function(_0x1d458f){return _0x1d458f;});}return null;};}function removeEntity(_0x3ead02,_0x339cfa){return function(_0x11d39e){if(_0x11d39e){return _0x11d39e[_0xbde8('0x23')]()[_0xbde8('0x22')](function(){_0x3ead02[_0xbde8('0x19')](0xcc)[_0xbde8('0x18')]();});}};}function handleEntityNotFound(_0xf682,_0x13dc8b){return function(_0x167c17){if(!_0x167c17){_0xf682['sendStatus'](0x194);}return _0x167c17;};}function handleError(_0x35e83e,_0x471dcf){_0x471dcf=_0x471dcf||0x1f4;return function(_0x545e66){logger['error'](_0x545e66[_0xbde8('0x24')]);if(_0x545e66[_0xbde8('0x25')]){delete _0x545e66[_0xbde8('0x25')];}_0x35e83e[_0xbde8('0x19')](_0x471dcf)[_0xbde8('0x26')](_0x545e66);};}exports['index']=function(_0x3febce,_0x19525f){var _0x288b78={},_0x4f4160={},_0x20d835={'count':0x0,'rows':[]};var _0x562a78=_['map'](db[_0xbde8('0x27')][_0xbde8('0x28')],function(_0x264a2e){return{'name':_0x264a2e[_0xbde8('0x29')],'type':_0x264a2e['type']['key']};});_0x4f4160[_0xbde8('0x2a')]=_[_0xbde8('0x2b')](_0x562a78,_0xbde8('0x25'));_0x4f4160[_0xbde8('0x2c')]=_[_0xbde8('0x2d')](_0x3febce[_0xbde8('0x2c')]);_0x4f4160[_0xbde8('0x2e')]=_['intersection'](_0x4f4160['model'],_0x4f4160[_0xbde8('0x2c')]);_0x288b78[_0xbde8('0x2f')]=_[_0xbde8('0x30')](_0x4f4160['model'],qs[_0xbde8('0x31')](_0x3febce[_0xbde8('0x2c')]['fields']));_0x288b78['attributes']=_0x288b78[_0xbde8('0x2f')][_0xbde8('0x32')]?_0x288b78[_0xbde8('0x2f')]:_0x4f4160['model'];if(!_0x3febce['query'][_0xbde8('0x33')](_0xbde8('0x34'))){_0x288b78['limit']=qs[_0xbde8('0x35')](_0x3febce[_0xbde8('0x2c')][_0xbde8('0x35')]);_0x288b78[_0xbde8('0x1c')]=qs['offset'](_0x3febce[_0xbde8('0x2c')][_0xbde8('0x1c')]);}_0x288b78[_0xbde8('0x36')]=qs[_0xbde8('0x37')](_0x3febce[_0xbde8('0x2c')][_0xbde8('0x37')]);_0x288b78[_0xbde8('0x38')]=qs['filters'](_['pick'](_0x3febce['query'],_0x4f4160['filters']),_0x562a78);if(_0x3febce['query'][_0xbde8('0x39')]){_0x288b78[_0xbde8('0x38')]=_['merge'](_0x288b78[_0xbde8('0x38')],{'$or':_[_0xbde8('0x2b')](_0x562a78,function(_0x5db813){if(_0x5db813[_0xbde8('0x3a')]!==_0xbde8('0x3b')){var _0x5bb36b={};_0x5bb36b[_0x5db813[_0xbde8('0x25')]]={'$like':'%'+_0x3febce['query']['filter']+'%'};return _0x5bb36b;}})});}_0x288b78=_['merge']({},_0x288b78,_0x3febce[_0xbde8('0x3c')]);var _0x49fdf0={'where':_0x288b78[_0xbde8('0x38')]};return db[_0xbde8('0x27')][_0xbde8('0x1d')](_0x49fdf0)['then'](function(_0x527db8){_0x20d835[_0xbde8('0x1d')]=_0x527db8;if(_0x3febce[_0xbde8('0x2c')][_0xbde8('0x3d')]){_0x288b78[_0xbde8('0x3e')]=[{'all':!![]}];}return db[_0xbde8('0x27')][_0xbde8('0x3f')](_0x288b78);})[_0xbde8('0x22')](function(_0xe83e3f){_0x20d835[_0xbde8('0x40')]=_0xe83e3f;return _0x20d835;})[_0xbde8('0x22')](respondWithFilteredResult(_0x19525f,_0x288b78))['catch'](handleError(_0x19525f,null));};exports['show']=function(_0x13cb47,_0x53f3af){var _0x3027d6={'raw':!![],'where':{'id':_0x13cb47[_0xbde8('0x41')]['id']}},_0x4245ed={};_0x4245ed[_0xbde8('0x2a')]=_[_0xbde8('0x2d')](db[_0xbde8('0x27')][_0xbde8('0x28')]);_0x4245ed['query']=_[_0xbde8('0x2d')](_0x13cb47[_0xbde8('0x2c')]);_0x4245ed['filters']=_[_0xbde8('0x30')](_0x4245ed[_0xbde8('0x2a')],_0x4245ed[_0xbde8('0x2c')]);_0x3027d6[_0xbde8('0x2f')]=_['intersection'](_0x4245ed[_0xbde8('0x2a')],qs[_0xbde8('0x31')](_0x13cb47['query'][_0xbde8('0x31')]));_0x3027d6['attributes']=_0x3027d6[_0xbde8('0x2f')]['length']?_0x3027d6[_0xbde8('0x2f')]:_0x4245ed['model'];if(_0x13cb47[_0xbde8('0x2c')][_0xbde8('0x3d')]){_0x3027d6[_0xbde8('0x3e')]=[{'all':!![]}];}_0x3027d6=_[_0xbde8('0x42')]({},_0x3027d6,_0x13cb47[_0xbde8('0x3c')]);return db[_0xbde8('0x27')]['find'](_0x3027d6)['then'](handleEntityNotFound(_0x53f3af,null))[_0xbde8('0x22')](respondWithResult(_0x53f3af,null))['catch'](handleError(_0x53f3af,null));};exports[_0xbde8('0x43')]=function(_0x21efba,_0x5c6aa8){return db[_0xbde8('0x27')]['create'](_0x21efba['body'],{})[_0xbde8('0x22')](respondWithResult(_0x5c6aa8,0xc9))[_0xbde8('0x44')](handleError(_0x5c6aa8,null));};exports[_0xbde8('0x45')]=function(_0x2bdb63,_0x3e3bc5){if(_0x2bdb63['body']['id']){delete _0x2bdb63['body']['id'];}return db[_0xbde8('0x27')]['find']({'where':{'id':_0x2bdb63['params']['id']}})[_0xbde8('0x22')](handleEntityNotFound(_0x3e3bc5,null))[_0xbde8('0x22')](saveUpdates(_0x2bdb63['body'],null))[_0xbde8('0x22')](respondWithResult(_0x3e3bc5,null))[_0xbde8('0x44')](handleError(_0x3e3bc5,null));};exports[_0xbde8('0x23')]=function(_0x98919a,_0x43f77f){return db['AnalyticTreeReport'][_0xbde8('0x46')]({'where':{'id':_0x98919a[_0xbde8('0x41')]['id']}})[_0xbde8('0x22')](handleEntityNotFound(_0x43f77f,null))[_0xbde8('0x22')](removeEntity(_0x43f77f,null))[_0xbde8('0x44')](handleError(_0x43f77f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 564cf50..90d77f5 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 _0x0d00=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger'];(function(_0x260d4b,_0x25be3a){var _0x32751f=function(_0xd7db96){while(--_0xd7db96){_0x260d4b['push'](_0x260d4b['shift']());}};_0x32751f(++_0x25be3a);}(_0x0d00,0xae));var _0x00d0=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x0d00[_0x183256];return _0x5394a2;};'use strict';var _=require('lodash');var util=require(_0x00d0('0x0'));var logger=require(_0x00d0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x00d0('0x2'));var fs=require('fs');var path=require(_0x00d0('0x3'));var rimraf=require(_0x00d0('0x4'));var config=require(_0x00d0('0x5'));var attributes=require(_0x00d0('0x6'));module[_0x00d0('0x7')]=function(_0x1e48a1,_0x22b330){return _0x1e48a1[_0x00d0('0x8')](_0x00d0('0x9'),attributes,{'tableName':_0x00d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x061b=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x44108d,_0x102d20){var _0x5945e3=function(_0x79244d){while(--_0x79244d){_0x44108d['push'](_0x44108d['shift']());}};_0x5945e3(++_0x102d20);}(_0x061b,0x8f));var _0xb061=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x061b[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xb061('0x0'));var util=require(_0xb061('0x1'));var logger=require(_0xb061('0x2'))(_0xb061('0x3'));var moment=require(_0xb061('0x4'));var BPromise=require(_0xb061('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb061('0x6'));var config=require(_0xb061('0x7'));var attributes=require(_0xb061('0x8'));module[_0xb061('0x9')]=function(_0x547fa7,_0xff6b8e){return _0x547fa7['define']('AnalyticTreeReport',attributes,{'tableName':_0xb061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 022d93d..3eeb0e9 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x34e6a0,_0x56ddfc){var _0x43607a=function(_0x26a05a){while(--_0x26a05a){_0x34e6a0['push'](_0x34e6a0['shift']());}};_0x43607a(++_0x56ddfc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _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(_0x125d87,_0x29848b){var _0x57a9ba=function(_0x2f544b){while(--_0x2f544b){_0x125d87['push'](_0x125d87['shift']());}};_0x57a9ba(++_0x29848b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('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 c945483..cd36559 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 _0x498a=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x5b3c01,_0x1b7706){var _0x4fc6c5=function(_0x179af8){while(--_0x179af8){_0x5b3c01['push'](_0x5b3c01['shift']());}};_0x4fc6c5(++_0x1b7706);}(_0x498a,0xd8));var _0xa498=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x498a[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xa498('0x0'));var path=require(_0xa498('0x1'));var timeout=require(_0xa498('0x2'));var express=require(_0xa498('0x3'));var router=express[_0xa498('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa498('0x5'));var config=require(_0xa498('0x6'));var controller=require(_0xa498('0x7'));router[_0xa498('0x8')]('/',auth['isAuthenticated'](),controller[_0xa498('0x9')]);router[_0xa498('0x8')](_0xa498('0xa'),auth[_0xa498('0xb')](),controller['show']);router[_0xa498('0xc')]('/',auth[_0xa498('0xb')](),controller['create']);router[_0xa498('0xd')](_0xa498('0xa'),auth['isAuthenticated'](),controller[_0xa498('0xe')]);router[_0xa498('0xf')](_0xa498('0xa'),auth[_0xa498('0xb')](),controller[_0xa498('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2c3e=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x1aa8f6,_0x1f1c93){var _0x3050ea=function(_0x3305a2){while(--_0x3305a2){_0x1aa8f6['push'](_0x1aa8f6['shift']());}};_0x3050ea(++_0x1f1c93);}(_0x2c3e,0x140));var _0xe2c3=function(_0x23bf67,_0x564d3d){_0x23bf67=_0x23bf67-0x0;var _0x8f2df5=_0x2c3e[_0x23bf67];return _0x8f2df5;};'use strict';var multer=require(_0xe2c3('0x0'));var util=require(_0xe2c3('0x1'));var path=require(_0xe2c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2c3('0x3')]();var fs_extra=require(_0xe2c3('0x4'));var auth=require(_0xe2c3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xe2c3('0x6')]('/',auth[_0xe2c3('0x7')](),controller[_0xe2c3('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe2c3('0x9')]);router[_0xe2c3('0xa')]('/',auth[_0xe2c3('0x7')](),controller[_0xe2c3('0xb')]);router[_0xe2c3('0xc')](_0xe2c3('0xd'),auth[_0xe2c3('0x7')](),controller[_0xe2c3('0xe')]);router[_0xe2c3('0xf')]('/:id',auth[_0xe2c3('0x7')](),controller[_0xe2c3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 1f6d17d..2525426 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 _0x089f=['STRING','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x089f,0x1c7));var _0xf089=function(_0x51908d,_0x5a8067){_0x51908d=_0x51908d-0x0;var _0x49219f=_0x089f[_0x51908d];return _0x49219f;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'name':{'type':Sequelize[_0xf089('0x1')]},'basename':{'type':Sequelize[_0xf089('0x1')]},'type':{'type':Sequelize[_0xf089('0x1')]}}; \ No newline at end of file +var _0x1280=['sequelize','exports','STRING'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0x1280,0xba));var _0x0128=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0x1280[_0x5ad67c];return _0xccce2e;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')]},'basename':{'type':Sequelize[_0x0128('0x2')]},'type':{'type':Sequelize[_0x0128('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c3e35f2..cc1e097 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 _0xe4e2=['options','count','includeAll','include','findAll','rows','find','catch','clone','params','merge','get','omit','updatedAt','body','createdAt','create','destroy','file','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','name','index','map','Attachment','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL'];(function(_0x4c0d96,_0x48e8b5){var _0x1b5618=function(_0x2360ce){while(--_0x2360ce){_0x4c0d96['push'](_0x4c0d96['shift']());}};_0x1b5618(++_0x48e8b5);}(_0xe4e2,0xca));var _0x2e4e=function(_0x48ac40,_0x1e3beb){_0x48ac40=_0x48ac40-0x0;var _0x55df02=_0xe4e2[_0x48ac40];return _0x55df02;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2e4e('0x0'));var jsonpatch=require(_0x2e4e('0x1'));var rp=require(_0x2e4e('0x2'));var moment=require('moment');var BPromise=require(_0x2e4e('0x3'));var Mustache=require(_0x2e4e('0x4'));var util=require(_0x2e4e('0x5'));var path=require(_0x2e4e('0x6'));var sox=require(_0x2e4e('0x7'));var csv=require(_0x2e4e('0x8'));var ejs=require(_0x2e4e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e4e('0xa'));var squel=require(_0x2e4e('0xb'));var crypto=require(_0x2e4e('0xc'));var jsforce=require(_0x2e4e('0xd'));var deskjs=require(_0x2e4e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e4e('0xf'));var Redis=require(_0x2e4e('0x10'));var authService=require(_0x2e4e('0x11'));var qs=require(_0x2e4e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e4e('0x13'));var logger=require(_0x2e4e('0x14'))('api');var utils=require(_0x2e4e('0x15'));var config=require(_0x2e4e('0x16'));var licenseUtil=require(_0x2e4e('0x17'));var db=require(_0x2e4e('0x18'))['db'];function respondWithStatusCode(_0xa612d2,_0x46c64c){_0x46c64c=_0x46c64c||0xcc;return function(_0x2da120){if(_0x2da120){return _0xa612d2[_0x2e4e('0x19')](_0x46c64c);}return _0xa612d2[_0x2e4e('0x1a')](_0x46c64c)[_0x2e4e('0x1b')]();};}function respondWithResult(_0x29c34d,_0x589af8){_0x589af8=_0x589af8||0xc8;return function(_0x4b6d7a){if(_0x4b6d7a){return _0x29c34d[_0x2e4e('0x1a')](_0x589af8)[_0x2e4e('0x1c')](_0x4b6d7a);}};}function respondWithFilteredResult(_0xaa75f,_0x417484){return function(_0x532899){if(_0x532899){var _0x966687=typeof _0x417484[_0x2e4e('0x1d')]==='undefined'&&typeof _0x417484[_0x2e4e('0x1e')]==='undefined';var _0x2bcd55=_0x532899['count'];var _0x37e731=_0x966687?0x0:_0x417484['offset'];var _0x2070c9=_0x966687?_0x532899['count']:_0x417484[_0x2e4e('0x1d')]+_0x417484['limit'];var _0x3c4470;if(_0x2070c9>=_0x2bcd55){_0x2070c9=_0x2bcd55;_0x3c4470=0xc8;}else{_0x3c4470=0xce;}_0xaa75f['status'](_0x3c4470);return _0xaa75f['set'](_0x2e4e('0x1f'),_0x37e731+'-'+_0x2070c9+'/'+_0x2bcd55)['json'](_0x532899);}return null;};}function patchUpdates(_0x20b207){return function(_0x36487d){try{jsonpatch[_0x2e4e('0x20')](_0x36487d,_0x20b207,!![]);}catch(_0x444edc){return BPromise[_0x2e4e('0x21')](_0x444edc);}return _0x36487d['save']();};}function saveUpdates(_0x1a39b5,_0x455821){return function(_0x31b8e4){if(_0x31b8e4){return _0x31b8e4[_0x2e4e('0x22')](_0x1a39b5)[_0x2e4e('0x23')](function(_0x105e50){return _0x105e50;});}return null;};}function removeEntity(_0x37b56e,_0x37c663){return function(_0x115ac3){if(_0x115ac3){return _0x115ac3['destroy']()['then'](function(){_0x37b56e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b46ce,_0x458818){return function(_0x47575e){if(!_0x47575e){_0x5b46ce[_0x2e4e('0x19')](0x194);}return _0x47575e;};}function handleError(_0x1e7d38,_0x3e84c4){_0x3e84c4=_0x3e84c4||0x1f4;return function(_0x1f3b1f){logger[_0x2e4e('0x24')](_0x1f3b1f['stack']);if(_0x1f3b1f['name']){delete _0x1f3b1f[_0x2e4e('0x25')];}_0x1e7d38[_0x2e4e('0x1a')](_0x3e84c4)['send'](_0x1f3b1f);};}exports[_0x2e4e('0x26')]=function(_0x3c2f80,_0x411188){var _0x49d3ea={},_0x2fb832={},_0x22fe83={'count':0x0,'rows':[]};var _0x1aa59c=_[_0x2e4e('0x27')](db[_0x2e4e('0x28')][_0x2e4e('0x29')],function(_0x15e32e){return{'name':_0x15e32e['fieldName'],'type':_0x15e32e['type'][_0x2e4e('0x2a')]};});_0x2fb832[_0x2e4e('0x2b')]=_[_0x2e4e('0x27')](_0x1aa59c,_0x2e4e('0x25'));_0x2fb832[_0x2e4e('0x2c')]=_[_0x2e4e('0x2d')](_0x3c2f80[_0x2e4e('0x2c')]);_0x2fb832[_0x2e4e('0x2e')]=_['intersection'](_0x2fb832[_0x2e4e('0x2b')],_0x2fb832['query']);_0x49d3ea[_0x2e4e('0x2f')]=_[_0x2e4e('0x30')](_0x2fb832[_0x2e4e('0x2b')],qs[_0x2e4e('0x31')](_0x3c2f80['query'][_0x2e4e('0x31')]));_0x49d3ea[_0x2e4e('0x2f')]=_0x49d3ea['attributes'][_0x2e4e('0x32')]?_0x49d3ea[_0x2e4e('0x2f')]:_0x2fb832['model'];if(!_0x3c2f80['query']['hasOwnProperty'](_0x2e4e('0x33'))){_0x49d3ea[_0x2e4e('0x1e')]=qs['limit'](_0x3c2f80['query'][_0x2e4e('0x1e')]);_0x49d3ea[_0x2e4e('0x1d')]=qs[_0x2e4e('0x1d')](_0x3c2f80['query']['offset']);}_0x49d3ea[_0x2e4e('0x34')]=qs[_0x2e4e('0x35')](_0x3c2f80['query'][_0x2e4e('0x35')]);_0x49d3ea[_0x2e4e('0x36')]=qs[_0x2e4e('0x2e')](_[_0x2e4e('0x37')](_0x3c2f80[_0x2e4e('0x2c')],_0x2fb832['filters']),_0x1aa59c);if(_0x3c2f80[_0x2e4e('0x2c')][_0x2e4e('0x38')]){_0x49d3ea['where']=_['merge'](_0x49d3ea[_0x2e4e('0x36')],{'$or':_['map'](_0x1aa59c,function(_0x36b488){if(_0x36b488[_0x2e4e('0x39')]!==_0x2e4e('0x3a')){var _0x144e63={};_0x144e63[_0x36b488[_0x2e4e('0x25')]]={'$like':'%'+_0x3c2f80[_0x2e4e('0x2c')][_0x2e4e('0x38')]+'%'};return _0x144e63;}})});}_0x49d3ea=_['merge']({},_0x49d3ea,_0x3c2f80[_0x2e4e('0x3b')]);var _0x3620a0={'where':_0x49d3ea[_0x2e4e('0x36')]};return db[_0x2e4e('0x28')]['count'](_0x3620a0)[_0x2e4e('0x23')](function(_0x18b606){_0x22fe83[_0x2e4e('0x3c')]=_0x18b606;if(_0x3c2f80['query'][_0x2e4e('0x3d')]){_0x49d3ea[_0x2e4e('0x3e')]=[{'all':!![]}];}return db[_0x2e4e('0x28')][_0x2e4e('0x3f')](_0x49d3ea);})[_0x2e4e('0x23')](function(_0x1a777b){_0x22fe83[_0x2e4e('0x40')]=_0x1a777b;return _0x22fe83;})[_0x2e4e('0x23')](respondWithFilteredResult(_0x411188,_0x49d3ea))['catch'](handleError(_0x411188,null));};exports['show']=function(_0x2d0995,_0x2bb6e0){var _0x59581b={'raw':!![],'where':{'id':_0x2d0995['params']['id']}},_0x22010d={};_0x22010d[_0x2e4e('0x2b')]=_[_0x2e4e('0x2d')](db[_0x2e4e('0x28')][_0x2e4e('0x29')]);_0x22010d[_0x2e4e('0x2c')]=_['keys'](_0x2d0995[_0x2e4e('0x2c')]);_0x22010d[_0x2e4e('0x2e')]=_[_0x2e4e('0x30')](_0x22010d[_0x2e4e('0x2b')],_0x22010d[_0x2e4e('0x2c')]);_0x59581b[_0x2e4e('0x2f')]=_['intersection'](_0x22010d[_0x2e4e('0x2b')],qs[_0x2e4e('0x31')](_0x2d0995[_0x2e4e('0x2c')]['fields']));_0x59581b[_0x2e4e('0x2f')]=_0x59581b[_0x2e4e('0x2f')][_0x2e4e('0x32')]?_0x59581b[_0x2e4e('0x2f')]:_0x22010d['model'];if(_0x2d0995[_0x2e4e('0x2c')][_0x2e4e('0x3d')]){_0x59581b[_0x2e4e('0x3e')]=[{'all':!![]}];}_0x59581b=_['merge']({},_0x59581b,_0x2d0995[_0x2e4e('0x3b')]);return db[_0x2e4e('0x28')][_0x2e4e('0x41')](_0x59581b)[_0x2e4e('0x23')](handleEntityNotFound(_0x2bb6e0,null))[_0x2e4e('0x23')](respondWithResult(_0x2bb6e0,null))[_0x2e4e('0x42')](handleError(_0x2bb6e0,null));};exports[_0x2e4e('0x43')]=function(_0x47fe0d,_0x22f26e){var _0x2183e6={'where':{'id':_0x47fe0d[_0x2e4e('0x44')]['id']}},_0x195d5a={};_0x195d5a['model']=_[_0x2e4e('0x2d')](db[_0x2e4e('0x28')][_0x2e4e('0x29')]);_0x2183e6[_0x2e4e('0x2f')]=_[_0x2e4e('0x30')](_0x195d5a[_0x2e4e('0x2b')],qs[_0x2e4e('0x31')](_0x47fe0d['query'][_0x2e4e('0x31')]));_0x2183e6[_0x2e4e('0x2f')]=_0x2183e6['attributes'][_0x2e4e('0x32')]?_0x2183e6[_0x2e4e('0x2f')]:_0x195d5a[_0x2e4e('0x2b')];if(_0x47fe0d[_0x2e4e('0x2c')]['includeAll']){_0x2183e6[_0x2e4e('0x3e')]=[{'all':!![]}];}_0x2183e6=_[_0x2e4e('0x45')]({},_0x2183e6,_0x47fe0d['options']);return db[_0x2e4e('0x28')][_0x2e4e('0x41')](_0x2183e6)['then'](handleEntityNotFound(_0x22f26e,null))[_0x2e4e('0x23')](function(_0x1e81a6){if(_0x1e81a6){var _0x2a2da4=_0x1e81a6[_0x2e4e('0x46')]({'plain':!![]});_0x2a2da4=qs[_0x2e4e('0x47')](_0x2a2da4,['id','createdAt',_0x2e4e('0x48')]);_0x47fe0d[_0x2e4e('0x49')]=_[_0x2e4e('0x47')](_0x47fe0d[_0x2e4e('0x49')],['id',_0x2e4e('0x4a'),_0x2e4e('0x48')]);return db[_0x2e4e('0x28')][_0x2e4e('0x4b')](_['merge'](_0x2a2da4,_0x47fe0d[_0x2e4e('0x49')]),{'include':_0x47fe0d[_0x2e4e('0x2c')][_0x2e4e('0x3d')]?[{'all':!![]}]:undefined});}})[_0x2e4e('0x23')](respondWithResult(_0x22f26e,0xc9))[_0x2e4e('0x42')](handleError(_0x22f26e,null));};exports[_0x2e4e('0x22')]=function(_0x261fbd,_0x18782f){if(_0x261fbd[_0x2e4e('0x49')]['id']){delete _0x261fbd[_0x2e4e('0x49')]['id'];}return db[_0x2e4e('0x28')][_0x2e4e('0x41')]({'where':{'id':_0x261fbd[_0x2e4e('0x44')]['id']}})[_0x2e4e('0x23')](handleEntityNotFound(_0x18782f,null))['then'](saveUpdates(_0x261fbd[_0x2e4e('0x49')],null))['then'](respondWithResult(_0x18782f,null))[_0x2e4e('0x42')](handleError(_0x18782f,null));};exports[_0x2e4e('0x4c')]=function(_0x18571d,_0x218cc6){return db[_0x2e4e('0x28')][_0x2e4e('0x41')]({'where':{'id':_0x18571d[_0x2e4e('0x44')]['id']}})[_0x2e4e('0x23')](handleEntityNotFound(_0x218cc6,null))['then'](removeEntity(_0x218cc6,null))[_0x2e4e('0x42')](handleError(_0x218cc6,null));};exports[_0x2e4e('0x4b')]=function(_0x62397c,_0x28acb0,_0x3808c3){_0x62397c[_0x2e4e('0x49')][_0x2e4e('0x25')]=_0x62397c[_0x2e4e('0x4d')]['originalname'];_0x62397c[_0x2e4e('0x49')][_0x2e4e('0x4e')]=_0x62397c['file']['filename'];_0x62397c[_0x2e4e('0x49')][_0x2e4e('0x39')]=_0x62397c[_0x2e4e('0x4d')][_0x2e4e('0x4f')];return db[_0x2e4e('0x28')][_0x2e4e('0x4b')](_0x62397c[_0x2e4e('0x49')])['then'](respondWithResult(_0x28acb0,0xc9))[_0x2e4e('0x42')](handleError(_0x28acb0,null));};exports[_0x2e4e('0x50')]=function(_0x4efed7,_0x4f25e3,_0x49f9d8){return db[_0x2e4e('0x28')][_0x2e4e('0x51')]({'where':{'id':_0x4efed7['params']['id']},'raw':!![]})[_0x2e4e('0x23')](handleEntityNotFound(_0x4f25e3,null))[_0x2e4e('0x23')](function(_0x848b0){if(_0x848b0){var _0x3d8046=_0x848b0[_0x2e4e('0x52')]!==null;var _0x4d5ad7=path[_0x2e4e('0x53')](config[_0x2e4e('0x54')],_0x2e4e('0x55'));if(_0x3d8046){_0x4d5ad7=path[_0x2e4e('0x53')](_0x4d5ad7,_0x2e4e('0x56'));}var _0x55b845=path[_0x2e4e('0x53')](_0x4d5ad7,_0x848b0[_0x2e4e('0x4e')]);return _0x4f25e3['download'](_0x55b845);}})[_0x2e4e('0x42')](handleError(_0x4f25e3,null));}; \ No newline at end of file +var _0x4395=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','clone','params','find','get','omit','updatedAt','body','createdAt','create','update','file','originalname','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','basename','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Attachment','fieldName'];(function(_0x2afda6,_0x36931a){var _0x4f46e6=function(_0x2c01bf){while(--_0x2c01bf){_0x2afda6['push'](_0x2afda6['shift']());}};_0x4f46e6(++_0x36931a);}(_0x4395,0xde));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5439('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5439('0x1'));var jsonpatch=require(_0x5439('0x2'));var rp=require(_0x5439('0x3'));var moment=require('moment');var BPromise=require(_0x5439('0x4'));var Mustache=require('mustache');var util=require(_0x5439('0x5'));var path=require(_0x5439('0x6'));var sox=require(_0x5439('0x7'));var csv=require(_0x5439('0x8'));var ejs=require(_0x5439('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5439('0xa'));var squel=require(_0x5439('0xb'));var crypto=require(_0x5439('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5439('0xd'));var toCsv=require(_0x5439('0x8'));var querystring=require(_0x5439('0xe'));var Papa=require(_0x5439('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5439('0x10'));var as=require(_0x5439('0x11'));var hardwareService=require(_0x5439('0x12'));var logger=require(_0x5439('0x13'))(_0x5439('0x14'));var utils=require('../../config/utils');var config=require(_0x5439('0x15'));var licenseUtil=require(_0x5439('0x16'));var db=require(_0x5439('0x17'))['db'];function respondWithStatusCode(_0x1f9725,_0x255e70){_0x255e70=_0x255e70||0xcc;return function(_0x41e34e){if(_0x41e34e){return _0x1f9725[_0x5439('0x18')](_0x255e70);}return _0x1f9725[_0x5439('0x19')](_0x255e70)[_0x5439('0x1a')]();};}function respondWithResult(_0x133fe8,_0x5ef431){_0x5ef431=_0x5ef431||0xc8;return function(_0x642930){if(_0x642930){return _0x133fe8[_0x5439('0x19')](_0x5ef431)[_0x5439('0x1b')](_0x642930);}};}function respondWithFilteredResult(_0x3ea695,_0x295865){return function(_0x53770c){if(_0x53770c){var _0x1c1c8c=typeof _0x295865[_0x5439('0x1c')]===_0x5439('0x1d')&&typeof _0x295865['limit']===_0x5439('0x1d');var _0x5950cc=_0x53770c['count'];var _0x2dd58f=_0x1c1c8c?0x0:_0x295865['offset'];var _0x2c746b=_0x1c1c8c?_0x53770c[_0x5439('0x1e')]:_0x295865[_0x5439('0x1c')]+_0x295865[_0x5439('0x1f')];var _0x36dd90;if(_0x2c746b>=_0x5950cc){_0x2c746b=_0x5950cc;_0x36dd90=0xc8;}else{_0x36dd90=0xce;}_0x3ea695[_0x5439('0x19')](_0x36dd90);return _0x3ea695[_0x5439('0x20')](_0x5439('0x21'),_0x2dd58f+'-'+_0x2c746b+'/'+_0x5950cc)['json'](_0x53770c);}return null;};}function patchUpdates(_0x57fba4){return function(_0x498e5b){try{jsonpatch[_0x5439('0x22')](_0x498e5b,_0x57fba4,!![]);}catch(_0x377c6e){return BPromise[_0x5439('0x23')](_0x377c6e);}return _0x498e5b[_0x5439('0x24')]();};}function saveUpdates(_0x21d745,_0x325b27){return function(_0x3a514b){if(_0x3a514b){return _0x3a514b['update'](_0x21d745)[_0x5439('0x25')](function(_0x4234bb){return _0x4234bb;});}return null;};}function removeEntity(_0x51f751,_0x2f5516){return function(_0x56253a){if(_0x56253a){return _0x56253a[_0x5439('0x26')]()[_0x5439('0x25')](function(){_0x51f751[_0x5439('0x19')](0xcc)[_0x5439('0x1a')]();});}};}function handleEntityNotFound(_0x4c7f5d,_0x492744){return function(_0x3cbf13){if(!_0x3cbf13){_0x4c7f5d[_0x5439('0x18')](0x194);}return _0x3cbf13;};}function handleError(_0x223fef,_0x5f2183){_0x5f2183=_0x5f2183||0x1f4;return function(_0x479c62){logger[_0x5439('0x27')](_0x479c62['stack']);if(_0x479c62[_0x5439('0x28')]){delete _0x479c62[_0x5439('0x28')];}_0x223fef[_0x5439('0x19')](_0x5f2183)[_0x5439('0x29')](_0x479c62);};}exports[_0x5439('0x2a')]=function(_0x4eaf9e,_0x283933){var _0x128577={},_0x46b634={},_0x592bf5={'count':0x0,'rows':[]};var _0x251777=_['map'](db[_0x5439('0x2b')]['rawAttributes'],function(_0x46520c){return{'name':_0x46520c[_0x5439('0x2c')],'type':_0x46520c['type']['key']};});_0x46b634[_0x5439('0x2d')]=_['map'](_0x251777,_0x5439('0x28'));_0x46b634[_0x5439('0x2e')]=_[_0x5439('0x2f')](_0x4eaf9e[_0x5439('0x2e')]);_0x46b634[_0x5439('0x30')]=_[_0x5439('0x31')](_0x46b634[_0x5439('0x2d')],_0x46b634[_0x5439('0x2e')]);_0x128577[_0x5439('0x32')]=_[_0x5439('0x31')](_0x46b634['model'],qs['fields'](_0x4eaf9e[_0x5439('0x2e')][_0x5439('0x33')]));_0x128577[_0x5439('0x32')]=_0x128577[_0x5439('0x32')][_0x5439('0x34')]?_0x128577[_0x5439('0x32')]:_0x46b634['model'];if(!_0x4eaf9e[_0x5439('0x2e')][_0x5439('0x35')](_0x5439('0x36'))){_0x128577[_0x5439('0x1f')]=qs['limit'](_0x4eaf9e[_0x5439('0x2e')]['limit']);_0x128577[_0x5439('0x1c')]=qs['offset'](_0x4eaf9e[_0x5439('0x2e')]['offset']);}_0x128577[_0x5439('0x37')]=qs['sort'](_0x4eaf9e[_0x5439('0x2e')]['sort']);_0x128577[_0x5439('0x38')]=qs[_0x5439('0x30')](_[_0x5439('0x39')](_0x4eaf9e['query'],_0x46b634[_0x5439('0x30')]),_0x251777);if(_0x4eaf9e['query'][_0x5439('0x3a')]){_0x128577[_0x5439('0x38')]=_[_0x5439('0x3b')](_0x128577[_0x5439('0x38')],{'$or':_['map'](_0x251777,function(_0x3ed264){if(_0x3ed264[_0x5439('0x3c')]!==_0x5439('0x3d')){var _0x2a3000={};_0x2a3000[_0x3ed264[_0x5439('0x28')]]={'$like':'%'+_0x4eaf9e['query'][_0x5439('0x3a')]+'%'};return _0x2a3000;}})});}_0x128577=_[_0x5439('0x3b')]({},_0x128577,_0x4eaf9e[_0x5439('0x3e')]);var _0x57db05={'where':_0x128577[_0x5439('0x38')]};return db['Attachment'][_0x5439('0x1e')](_0x57db05)[_0x5439('0x25')](function(_0x560dbb){_0x592bf5[_0x5439('0x1e')]=_0x560dbb;if(_0x4eaf9e[_0x5439('0x2e')][_0x5439('0x3f')]){_0x128577[_0x5439('0x40')]=[{'all':!![]}];}return db[_0x5439('0x2b')][_0x5439('0x41')](_0x128577);})[_0x5439('0x25')](function(_0x15dd83){_0x592bf5[_0x5439('0x42')]=_0x15dd83;return _0x592bf5;})[_0x5439('0x25')](respondWithFilteredResult(_0x283933,_0x128577))[_0x5439('0x43')](handleError(_0x283933,null));};exports['show']=function(_0x10b959,_0x2c86c6){var _0x43bdeb={'raw':!![],'where':{'id':_0x10b959['params']['id']}},_0x3d9b65={};_0x3d9b65[_0x5439('0x2d')]=_[_0x5439('0x2f')](db['Attachment'][_0x5439('0x44')]);_0x3d9b65[_0x5439('0x2e')]=_[_0x5439('0x2f')](_0x10b959[_0x5439('0x2e')]);_0x3d9b65[_0x5439('0x30')]=_['intersection'](_0x3d9b65[_0x5439('0x2d')],_0x3d9b65[_0x5439('0x2e')]);_0x43bdeb[_0x5439('0x32')]=_[_0x5439('0x31')](_0x3d9b65[_0x5439('0x2d')],qs[_0x5439('0x33')](_0x10b959[_0x5439('0x2e')][_0x5439('0x33')]));_0x43bdeb[_0x5439('0x32')]=_0x43bdeb[_0x5439('0x32')][_0x5439('0x34')]?_0x43bdeb[_0x5439('0x32')]:_0x3d9b65[_0x5439('0x2d')];if(_0x10b959[_0x5439('0x2e')][_0x5439('0x3f')]){_0x43bdeb[_0x5439('0x40')]=[{'all':!![]}];}_0x43bdeb=_[_0x5439('0x3b')]({},_0x43bdeb,_0x10b959[_0x5439('0x3e')]);return db[_0x5439('0x2b')]['find'](_0x43bdeb)[_0x5439('0x25')](handleEntityNotFound(_0x2c86c6,null))[_0x5439('0x25')](respondWithResult(_0x2c86c6,null))[_0x5439('0x43')](handleError(_0x2c86c6,null));};exports[_0x5439('0x45')]=function(_0x30ccb7,_0x5b236c){var _0x52d8b4={'where':{'id':_0x30ccb7[_0x5439('0x46')]['id']}},_0x229dd2={};_0x229dd2[_0x5439('0x2d')]=_[_0x5439('0x2f')](db['Attachment'][_0x5439('0x44')]);_0x52d8b4[_0x5439('0x32')]=_[_0x5439('0x31')](_0x229dd2[_0x5439('0x2d')],qs['fields'](_0x30ccb7[_0x5439('0x2e')][_0x5439('0x33')]));_0x52d8b4[_0x5439('0x32')]=_0x52d8b4[_0x5439('0x32')][_0x5439('0x34')]?_0x52d8b4[_0x5439('0x32')]:_0x229dd2[_0x5439('0x2d')];if(_0x30ccb7[_0x5439('0x2e')]['includeAll']){_0x52d8b4['include']=[{'all':!![]}];}_0x52d8b4=_[_0x5439('0x3b')]({},_0x52d8b4,_0x30ccb7[_0x5439('0x3e')]);return db['Attachment'][_0x5439('0x47')](_0x52d8b4)['then'](handleEntityNotFound(_0x5b236c,null))['then'](function(_0x2a797e){if(_0x2a797e){var _0x2ef4d7=_0x2a797e[_0x5439('0x48')]({'plain':!![]});_0x2ef4d7=qs[_0x5439('0x49')](_0x2ef4d7,['id','createdAt',_0x5439('0x4a')]);_0x30ccb7[_0x5439('0x4b')]=_[_0x5439('0x49')](_0x30ccb7[_0x5439('0x4b')],['id',_0x5439('0x4c'),'updatedAt']);return db['Attachment'][_0x5439('0x4d')](_[_0x5439('0x3b')](_0x2ef4d7,_0x30ccb7[_0x5439('0x4b')]),{'include':_0x30ccb7[_0x5439('0x2e')][_0x5439('0x3f')]?[{'all':!![]}]:undefined});}})[_0x5439('0x25')](respondWithResult(_0x5b236c,0xc9))['catch'](handleError(_0x5b236c,null));};exports[_0x5439('0x4e')]=function(_0x2b2d78,_0x26ad65){if(_0x2b2d78[_0x5439('0x4b')]['id']){delete _0x2b2d78[_0x5439('0x4b')]['id'];}return db[_0x5439('0x2b')][_0x5439('0x47')]({'where':{'id':_0x2b2d78[_0x5439('0x46')]['id']}})['then'](handleEntityNotFound(_0x26ad65,null))[_0x5439('0x25')](saveUpdates(_0x2b2d78[_0x5439('0x4b')],null))['then'](respondWithResult(_0x26ad65,null))[_0x5439('0x43')](handleError(_0x26ad65,null));};exports[_0x5439('0x26')]=function(_0x122781,_0x4b9543){return db[_0x5439('0x2b')][_0x5439('0x47')]({'where':{'id':_0x122781['params']['id']}})[_0x5439('0x25')](handleEntityNotFound(_0x4b9543,null))['then'](removeEntity(_0x4b9543,null))[_0x5439('0x43')](handleError(_0x4b9543,null));};exports[_0x5439('0x4d')]=function(_0x58f71b,_0x444ab9,_0x59a52f){_0x58f71b[_0x5439('0x4b')]['name']=_0x58f71b[_0x5439('0x4f')][_0x5439('0x50')];_0x58f71b[_0x5439('0x4b')]['basename']=_0x58f71b[_0x5439('0x4f')][_0x5439('0x51')];_0x58f71b[_0x5439('0x4b')]['type']=_0x58f71b['file']['mimetype'];return db[_0x5439('0x2b')][_0x5439('0x4d')](_0x58f71b[_0x5439('0x4b')])['then'](respondWithResult(_0x444ab9,0xc9))['catch'](handleError(_0x444ab9,null));};exports[_0x5439('0x52')]=function(_0x1d6083,_0x14fd3d,_0x1ebe27){return db[_0x5439('0x2b')][_0x5439('0x53')]({'where':{'id':_0x1d6083[_0x5439('0x46')]['id']},'raw':!![]})[_0x5439('0x25')](handleEntityNotFound(_0x14fd3d,null))['then'](function(_0x1e520b){if(_0x1e520b){var _0x5f2c3f=_0x1e520b[_0x5439('0x54')]!==null;var _0x464820=path[_0x5439('0x55')](config[_0x5439('0x56')],_0x5439('0x57'));if(_0x5f2c3f){_0x464820=path[_0x5439('0x55')](_0x464820,'offline-chat/');}var _0x1884f6=path[_0x5439('0x55')](_0x464820,_0x1e520b[_0x5439('0x58')]);return _0x14fd3d[_0x5439('0x52')](_0x1884f6);}})[_0x5439('0x43')](handleError(_0x14fd3d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b7ac590..3ed2d5d 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 _0xc091=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','../../config/logger','moment','bluebird'];(function(_0x26bb32,_0x1fac5c){var _0x262368=function(_0x44fdb3){while(--_0x44fdb3){_0x26bb32['push'](_0x26bb32['shift']());}};_0x262368(++_0x1fac5c);}(_0xc091,0x1f1));var _0x1c09=function(_0x2e10a4,_0x30f044){_0x2e10a4=_0x2e10a4-0x0;var _0x667dee=_0xc091[_0x2e10a4];return _0x667dee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c09('0x0'))('api');var moment=require(_0x1c09('0x1'));var BPromise=require(_0x1c09('0x2'));var rp=require(_0x1c09('0x3'));var fs=require('fs');var path=require(_0x1c09('0x4'));var rimraf=require(_0x1c09('0x5'));var config=require(_0x1c09('0x6'));var attributes=require(_0x1c09('0x7'));module['exports']=function(_0x2151b7,_0x2ec3e0){return _0x2151b7['define'](_0x1c09('0x8'),attributes,{'tableName':_0x1c09('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2115=['lodash','util','../../config/logger','moment','path','rimraf','./attachment.attributes','exports','Attachment','attachments'];(function(_0x368829,_0x1c4967){var _0x391808=function(_0x125b1c){while(--_0x125b1c){_0x368829['push'](_0x368829['shift']());}};_0x391808(++_0x1c4967);}(_0x2115,0x8c));var _0x5211=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x2115[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0x5211('0x0'));var util=require(_0x5211('0x1'));var logger=require(_0x5211('0x2'))('api');var moment=require(_0x5211('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5211('0x4'));var rimraf=require(_0x5211('0x5'));var config=require('../../config/environment');var attributes=require(_0x5211('0x6'));module[_0x5211('0x7')]=function(_0x43e996,_0x288f83){return _0x43e996['define'](_0x5211('0x8'),attributes,{'tableName':_0x5211('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 6f0eefa..91b32f5 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 _0x9234=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','body','options','raw','lodash','moment','bluebird'];(function(_0x394c7c,_0x385ac8){var _0x5e5371=function(_0x4ddcd9){while(--_0x4ddcd9){_0x394c7c['push'](_0x394c7c['shift']());}};_0x5e5371(++_0x385ac8);}(_0x9234,0x1bd));var _0x4923=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9234[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var moment=require(_0x4923('0x1'));var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require(_0x4923('0x6'))('rpc');var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson[_0x4923('0x9')][_0x4923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b854,_0x133b0d,_0x2de396){return new BPromise(function(_0x548676,_0x1fffc2){return client['request'](_0x17b854,_0x2de396)[_0x4923('0xb')](function(_0x2c4057){logger[_0x4923('0xc')]('Attachment,\x20%s,\x20%s',_0x133b0d,_0x4923('0xd'));logger[_0x4923('0xe')](_0x4923('0xf'),_0x133b0d,_0x4923('0xd'),JSON[_0x4923('0x10')](_0x2c4057));if(_0x2c4057[_0x4923('0x11')]){if(_0x2c4057[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x2c4057['error']['message']);return _0x1fffc2(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}logger[_0x4923('0x11')]('Attachment,\x20%s,\x20%s',_0x133b0d,_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);return _0x548676(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}else{logger[_0x4923('0xc')](_0x4923('0x13'),_0x133b0d,_0x4923('0xd'));_0x548676(_0x2c4057[_0x4923('0x15')][_0x4923('0x14')]);}})[_0x4923('0x16')](function(_0x559e4a){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x559e4a);_0x1fffc2(_0x559e4a);});});}exports[_0x4923('0x17')]=function(_0x1be04d){var _0x517b95=this;return new Promise(function(_0x50fd18,_0x16955b){return db['Attachment'][_0x4923('0x18')](_0x1be04d[_0x4923('0x19')],{'raw':_0x1be04d['options']?_0x1be04d[_0x4923('0x1a')][_0x4923('0x1b')]===undefined?!![]:![]:!![]})[_0x4923('0xb')](function(_0x8a9ab7){logger['info'](_0x4923('0x17'),_0x1be04d);logger[_0x4923('0xe')]('CreateAttachment',_0x1be04d,JSON[_0x4923('0x10')](_0x8a9ab7));_0x50fd18(_0x8a9ab7);})['catch'](function(_0x3de8f5){logger[_0x4923('0x11')]('CreateAttachment',_0x3de8f5[_0x4923('0x14')],_0x1be04d);_0x16955b(_0x517b95[_0x4923('0x11')](0x1f4,_0x3de8f5[_0x4923('0x14')]));});});}; \ No newline at end of file +var _0x18a9=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xf31a,_0x5f5b89){var _0x4df458=function(_0x1ceeaf){while(--_0x1ceeaf){_0xf31a['push'](_0xf31a['shift']());}};_0x4df458(++_0x5f5b89);}(_0x18a9,0x15b));var _0x918a=function(_0x1ee392,_0x434efa){_0x1ee392=_0x1ee392-0x0;var _0x3eec85=_0x18a9[_0x1ee392];return _0x3eec85;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Attachment,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Attachment,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});}exports[_0x918a('0x18')]=function(_0x51e467){var _0x199eb1=this;return new Promise(function(_0x22e347,_0x38ca45){return db[_0x918a('0x19')]['create'](_0x51e467[_0x918a('0x1a')],{'raw':_0x51e467[_0x918a('0x1b')]?_0x51e467[_0x918a('0x1b')][_0x918a('0x1c')]===undefined?!![]:![]:!![]})[_0x918a('0xd')](function(_0x161142){logger[_0x918a('0xe')]('CreateAttachment',_0x51e467);logger[_0x918a('0x1d')]('CreateAttachment',_0x51e467,JSON[_0x918a('0x12')](_0x161142));_0x22e347(_0x161142);})['catch'](function(_0x4c5993){logger['error'](_0x918a('0x18'),_0x4c5993['message'],_0x51e467);_0x38ca45(_0x199eb1[_0x918a('0x13')](0x1f4,_0x4c5993[_0x918a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 4031790..b482d55 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x0b0e,0x187));var _0xe0b0=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x0b0e[_0x328534];return _0x2796c0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 080e44f..dc70771 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 _0x3e30=['add','clearBlockUser','getLicense','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport-local','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0x3e30,0x17d));var _0x03e3=function(_0x2e11d3,_0x26a29a){_0x2e11d3=_0x2e11d3-0x0;var _0x3f7f7f=_0x3e30[_0x2e11d3];return _0x3f7f7f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x03e3('0x0'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x03e3('0x1'));var BPromise=require(_0x03e3('0x2'));var util=require(_0x03e3('0x3'));var db=require(_0x03e3('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x03e3('0x5'));var config=require(_0x03e3('0x6'));var logger=require('../../config/logger')(_0x03e3('0x7'));function isActiveDirectoryConfigured(_0x40630d){var _0x38c160=![];if(typeof _0x40630d[_0x03e3('0x8')]!=='undefined'){_0x38c160=_0x40630d[_0x03e3('0x8')][_0x03e3('0x9')]&&_0x40630d[_0x03e3('0x8')][_0x03e3('0xa')]&&_0x40630d[_0x03e3('0x8')][_0x03e3('0xb')];}return _0x38c160;}function adAuthenticate(_0x366e60,_0x15dafb,_0x1938e9){return new BPromise(function(_0x2436c8,_0xdfd9bd){try{var _0x3d4d48=new ActiveDirectory(_0x366e60);_0x3d4d48['authenticate'](_0x15dafb,_0x1938e9,function(_0x51228b,_0x107fc4){if(_0x51228b){logger['error'](_0x03e3('0xc'),_0x15dafb,util['inspect'](_0x51228b,{'showHidden':![],'depth':null}));_0xdfd9bd(_0x03e3('0xd'));}else if(!_0x107fc4){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x15dafb);_0xdfd9bd(_0x03e3('0xd'));}else{_0x2436c8(_0x107fc4);}});}catch(_0x39d434){_0xdfd9bd(_0x39d434);}});}function ActiveDirectoryAuthenticate(_0x131182,_0x17f75e,_0x289929,_0x4a7cc4){var _0x386fe1,_0x180468;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x03e3('0xe'),_0x17f75e);return _0x4a7cc4(null,![],{'message':_0x03e3('0xd')});}return db[_0x03e3('0xf')][_0x03e3('0x10')]({'where':{'id':0x1},'attributes':[_0x03e3('0x11'),_0x03e3('0x12')],'raw':!![]})[_0x03e3('0x13')](function(_0xc2f45a){_0x386fe1=_0xc2f45a;if(!_0x386fe1[_0x03e3('0x11')]){logger[_0x03e3('0x14')](_0x03e3('0x15'),_0x17f75e);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x131182[_0x03e3('0x10')]({'attributes':['id',_0x03e3('0x16'),_0x03e3('0x17'),_0x03e3('0x18'),_0x03e3('0x19'),_0x03e3('0x1a'),_0x03e3('0x1b'),_0x03e3('0x1c'),_0x03e3('0x1d')],'where':{'name':_0x17f75e,'role':{'$or':[_0x03e3('0x1e'),_0x03e3('0x1f'),_0x03e3('0x20')]},'adSsoEnabled':!![]}});})[_0x03e3('0x13')](function(_0x52d946){if(!_0x52d946||_0x52d946&&_0x52d946[_0x03e3('0x16')]!==_0x17f75e){throw new Error(_0x03e3('0xd'));}_0x180468=_0x52d946;var _0x4d1ec2=_0x180468['name']+'@'+config[_0x03e3('0x8')][_0x03e3('0xb')];return adAuthenticate(config['activedirectory'],_0x4d1ec2,_0x289929);})[_0x03e3('0x13')](function(_0x5b2120){if(_0x180468[_0x03e3('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x386fe1[_0x03e3('0x12')]>0x0){if(_0x180468[_0x03e3('0x1b')]){if(moment(_0x180468['blockedAt'])[_0x03e3('0x21')](_0x386fe1[_0x03e3('0x12')],'minutes')>moment()){throw new Error(_0x03e3('0xd'));}return utils[_0x03e3('0x22')](_0x180468,0x0,![],null)[_0x03e3('0x13')](function(){return utils[_0x03e3('0x23')](_0x180468);})[_0x03e3('0x13')](function(){return _0x4a7cc4(null,_0x180468);});}else{return utils['getLicense'](_0x180468)[_0x03e3('0x13')](function(){return _0x4a7cc4(null,_0x180468);});}}else{return utils[_0x03e3('0x23')](_0x180468)[_0x03e3('0x13')](function(){return _0x4a7cc4(null,_0x180468);});}})['catch'](function(_0x509d6f){return _0x4a7cc4(null,![],_0x509d6f);});}function handleError(_0x2ddc22,_0x40ca72,_0xfa734b){return _0x2ddc22[_0x03e3('0x24')](_0x40ca72||0x1f4)[_0x03e3('0x25')]({'message':_0xfa734b?_0xfa734b[_0x03e3('0x26')]||_0xfa734b:''});}exports[_0x03e3('0x27')]=function(_0x1b1817,_0x4017e1,_0x28f384){passport[_0x03e3('0x28')](_0x03e3('0x29'),function(_0x32f6ab,_0x1e2d28,_0x1eb94a){var _0x1ff058=_0x32f6ab||_0x1eb94a;if(_0x1ff058){return handleError(_0x4017e1,0x191,_0x1ff058);}if(!_0x1e2d28){return handleError(_0x4017e1,0x194,{'message':_0x03e3('0x2a')});}else{var _0x206795={'payload':{'id':_0x1e2d28['id'],'role':_0x1e2d28[_0x03e3('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x206795)[_0x03e3('0x13')](function(_0x2d2ed3){_0x4017e1[_0x03e3('0x2b')]({'id':_0x1e2d28['id'],'token':_0x2d2ed3,'statusCall':'','isAlreadyLogged':_0x1e2d28[_0x03e3('0x1d')]});});}})(_0x1b1817,_0x4017e1,_0x28f384);};passport[_0x03e3('0x2c')](_0x03e3('0x29'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x1fbb1e,_0x1daa2f,_0x57a8d6){return ActiveDirectoryAuthenticate(db[_0x03e3('0x2d')],_0x1fbb1e,_0x1daa2f,_0x57a8d6);})); \ No newline at end of file +var _0x58d0=['blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','disabled','blocked','blockedAt','online','user','agent','name','domain','add','minutes','clearBlockUser','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','passport','passport-local','Strategy','bluebird','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x58d0,0x1a4));var _0x058d=function(_0x36e4dc,_0x4cc695){_0x36e4dc=_0x36e4dc-0x0;var _0x303297=_0x58d0[_0x36e4dc];return _0x303297;};'use strict';var passport=require(_0x058d('0x0'));var LocalStrategy=require(_0x058d('0x1'))[_0x058d('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x058d('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x058d('0x4'));var utils=require(_0x058d('0x5'));var config=require('../../config/environment');var logger=require(_0x058d('0x6'))(_0x058d('0x7'));function isActiveDirectoryConfigured(_0xf63297){var _0x43a984=![];if(typeof _0xf63297[_0x058d('0x8')]!==_0x058d('0x9')){_0x43a984=_0xf63297[_0x058d('0x8')][_0x058d('0xa')]&&_0xf63297['activedirectory'][_0x058d('0xb')]&&_0xf63297['activedirectory']['domain'];}return _0x43a984;}function adAuthenticate(_0x445755,_0x503f15,_0x5b65dc){return new BPromise(function(_0x4164bc,_0x20e1dc){try{var _0x3cac90=new ActiveDirectory(_0x445755);_0x3cac90['authenticate'](_0x503f15,_0x5b65dc,function(_0x3629da,_0x3c005e){if(_0x3629da){logger[_0x058d('0xc')](_0x058d('0xd'),_0x503f15,util[_0x058d('0xe')](_0x3629da,{'showHidden':![],'depth':null}));_0x20e1dc(_0x058d('0xf'));}else if(!_0x3c005e){logger[_0x058d('0xc')](_0x058d('0x10'),_0x503f15);_0x20e1dc(_0x058d('0xf'));}else{_0x4164bc(_0x3c005e);}});}catch(_0x2547aa){_0x20e1dc(_0x2547aa);}});}function ActiveDirectoryAuthenticate(_0x2226ba,_0x46d4bb,_0x3300df,_0x2c17a4){var _0x4cf158,_0x1b791b;if(!isActiveDirectoryConfigured(config)){logger[_0x058d('0xc')](_0x058d('0x11'),_0x46d4bb);return _0x2c17a4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x058d('0x12')]({'where':{'id':0x1},'attributes':[_0x058d('0x13'),_0x058d('0x14')],'raw':!![]})[_0x058d('0x15')](function(_0x50046e){_0x4cf158=_0x50046e;if(!_0x4cf158[_0x058d('0x13')]){logger[_0x058d('0xc')](_0x058d('0x16'),_0x46d4bb);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2226ba[_0x058d('0x12')]({'attributes':['id','name',_0x058d('0x17'),'salt','role',_0x058d('0x18'),_0x058d('0x19'),_0x058d('0x1a'),_0x058d('0x1b')],'where':{'name':_0x46d4bb,'role':{'$or':['admin',_0x058d('0x1c'),_0x058d('0x1d')]},'adSsoEnabled':!![]}});})[_0x058d('0x15')](function(_0x274bdb){if(!_0x274bdb||_0x274bdb&&_0x274bdb[_0x058d('0x1e')]!==_0x46d4bb){throw new Error(_0x058d('0xf'));}_0x1b791b=_0x274bdb;var _0x32a29e=_0x1b791b[_0x058d('0x1e')]+'@'+config[_0x058d('0x8')][_0x058d('0x1f')];return adAuthenticate(config[_0x058d('0x8')],_0x32a29e,_0x3300df);})['then'](function(_0x247860){if(_0x1b791b[_0x058d('0x18')]){throw new Error(_0x058d('0xf'));}if(_0x4cf158[_0x058d('0x14')]>0x0){if(_0x1b791b['blocked']){if(moment(_0x1b791b[_0x058d('0x1a')])[_0x058d('0x20')](_0x4cf158[_0x058d('0x14')],_0x058d('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x058d('0x22')](_0x1b791b,0x0,![],null)[_0x058d('0x15')](function(){return utils['getLicense'](_0x1b791b);})['then'](function(){return _0x2c17a4(null,_0x1b791b);});}else{return utils['getLicense'](_0x1b791b)['then'](function(){return _0x2c17a4(null,_0x1b791b);});}}else{return utils[_0x058d('0x23')](_0x1b791b)[_0x058d('0x15')](function(){return _0x2c17a4(null,_0x1b791b);});}})['catch'](function(_0x47d8a9){return _0x2c17a4(null,![],_0x47d8a9);});}function handleError(_0x46048e,_0x3fa1bb,_0x4bff56){return _0x46048e[_0x058d('0x24')](_0x3fa1bb||0x1f4)[_0x058d('0x25')]({'message':_0x4bff56?_0x4bff56[_0x058d('0x26')]||_0x4bff56:''});}exports['login']=function(_0x588356,_0x584522,_0x1fcc90){passport['authenticate'](_0x058d('0x27'),function(_0x524435,_0x574d24,_0x13024f){var _0x4efa9e=_0x524435||_0x13024f;if(_0x4efa9e){return handleError(_0x584522,0x191,_0x4efa9e);}if(!_0x574d24){return handleError(_0x584522,0x194,{'message':_0x058d('0x28')});}else{var _0x39ccc9={'payload':{'id':_0x574d24['id'],'role':_0x574d24[_0x058d('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x058d('0x2a')](_0x39ccc9)[_0x058d('0x15')](function(_0x2cb9a8){_0x584522[_0x058d('0x2b')]({'id':_0x574d24['id'],'token':_0x2cb9a8,'statusCall':'','isAlreadyLogged':_0x574d24[_0x058d('0x1b')]});});}})(_0x588356,_0x584522,_0x1fcc90);};passport['use'](_0x058d('0x27'),new LocalStrategy({'usernameField':_0x058d('0x1e'),'passwordField':_0x058d('0x17')},function(_0xd4e8db,_0x22e3fe,_0x77fc40){return ActiveDirectoryAuthenticate(db['User'],_0xd4e8db,_0x22e3fe,_0x77fc40);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index f1b692a..d2891b4 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 _0xedb4=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x9e33f2,_0x28125d){var _0x45877b=function(_0x3b847e){while(--_0x3b847e){_0x9e33f2['push'](_0x9e33f2['shift']());}};_0x45877b(++_0x28125d);}(_0xedb4,0x19f));var _0x4edb=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xedb4[_0x2b7764];return _0x848dcb;};'use strict';var express=require('express');var router=express[_0x4edb('0x0')]();var controller=require(_0x4edb('0x1'));router[_0x4edb('0x2')]('/',controller[_0x4edb('0x3')]);module[_0x4edb('0x4')]=router; \ No newline at end of file +var _0xdffd=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xdffd,0x81));var _0xddff=function(_0x37375e,_0x2d4a40){_0x37375e=_0x37375e-0x0;var _0x35fdbb=_0xdffd[_0x37375e];return _0x35fdbb;};'use strict';var express=require(_0xddff('0x0'));var router=express[_0xddff('0x1')]();var controller=require(_0xddff('0x2'));router[_0xddff('0x3')]('/',controller[_0xddff('0x4')]);module[_0xddff('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c46d0b5..075061b 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(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x7a54,0x106));var _0x47a5=function(_0x37b0e0,_0xcc9227){_0x37b0e0=_0x37b0e0-0x0;var _0x2feb46=_0x7a54[_0x37b0e0];return _0x2feb46;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7a54,0x106));var _0x47a5=function(_0x186279,_0x496d23){_0x186279=_0x186279-0x0;var _0x34af1c=_0x7a54[_0x186279];return _0x34af1c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 5f8abcf..4b8b72b 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 _0x2a3a=['get','/callback','callback','isMiddleware','login','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x3f119a,_0x3c0650){var _0x2dd269=function(_0x138dcb){while(--_0x138dcb){_0x3f119a['push'](_0x3f119a['shift']());}};_0x2dd269(++_0x3c0650);}(_0x2a3a,0x119));var _0xa2a3=function(_0x4ba6e4,_0x56d3ab){_0x4ba6e4=_0x4ba6e4-0x0;var _0x30a380=_0x2a3a[_0x4ba6e4];return _0x30a380;};'use strict';var express=require(_0xa2a3('0x0'));var passport=require(_0xa2a3('0x1'));var router=express['Router']();var controller=require(_0xa2a3('0x2'));var userController=require(_0xa2a3('0x3'));var authService=require(_0xa2a3('0x4'));router[_0xa2a3('0x5')]('/',controller['login']);router[_0xa2a3('0x5')](_0xa2a3('0x6'),controller[_0xa2a3('0x7')],authService[_0xa2a3('0x8')],userController[_0xa2a3('0x9')],authService['setTokenCookie']);module[_0xa2a3('0xa')]=router; \ No newline at end of file +var _0x1cbc=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','setTokenCookie','express','Router'];(function(_0x145e2e,_0xbc9ae2){var _0x4d512f=function(_0x4346d2){while(--_0x4346d2){_0x145e2e['push'](_0x145e2e['shift']());}};_0x4d512f(++_0xbc9ae2);}(_0x1cbc,0x186));var _0xc1cb=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x1cbc[_0x40e854];return _0x1463b3;};'use strict';var express=require(_0xc1cb('0x0'));var passport=require('passport');var router=express[_0xc1cb('0x1')]();var controller=require(_0xc1cb('0x2'));var userController=require(_0xc1cb('0x3'));var authService=require(_0xc1cb('0x4'));router[_0xc1cb('0x5')]('/',controller['login']);router[_0xc1cb('0x5')]('/callback',controller['callback'],authService['isMiddleware'],userController['login'],authService[_0xc1cb('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 604ee8a..9bd5655 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 _0x9286=['token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','forgot','body','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x9286,0xf6));var _0x6928=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0x9286[_0x348652];return _0x18a9ea;};'use strict';var util=require(_0x6928('0x0'));var passport=require(_0x6928('0x1'));var LocalStrategy=require(_0x6928('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x6928('0x3'));var rs=require(_0x6928('0x4'));var moment=require('moment');var db=require(_0x6928('0x5'))['db'];var authService=require(_0x6928('0x6'));var utils=require('../../config/utils');var client=jayson['client'][_0x6928('0x7')]({'port':0x232b});function localAuthenticate(_0x1441d4,_0x1914ef,_0x36b6cf,_0x5a8186){var _0x52c50b,_0x2b8874;return db[_0x6928('0x8')][_0x6928('0x9')]({'where':{'id':0x1},'attributes':[_0x6928('0xa'),_0x6928('0xb')],'raw':!![]})[_0x6928('0xc')](function(_0x284f76){_0x52c50b=_0x284f76;return _0x1441d4[_0x6928('0x9')]({'attributes':['id',_0x6928('0xd'),_0x6928('0xe'),_0x6928('0xf'),_0x6928('0x10'),_0x6928('0x11'),_0x6928('0x12'),_0x6928('0x13'),'loginAttempts'],'where':{'name':_0x1914ef,'role':{'$or':[_0x6928('0x14'),_0x6928('0x15'),'agent']}}});})[_0x6928('0xc')](function(_0x417681){if(!_0x417681||_0x417681&&_0x417681[_0x6928('0xd')]!==_0x1914ef){throw new Error(_0x6928('0x16'));}else{_0x2b8874=_0x417681;return _0x2b8874;}})['then'](function(){_0x2b8874[_0x6928('0x17')](_0x36b6cf,function(_0x3c0ec6,_0x3fc7f5){var _0x30663f=_0x2b8874['loginAttempts']+0x1;if(_0x3c0ec6){return _0x5a8186(_0x3c0ec6);}else if(!_0x3fc7f5){if(_0x2b8874[_0x6928('0x11')]){return _0x5a8186(null,![],{'message':_0x6928('0x16')});}else if(_0x52c50b[_0x6928('0xa')]>0x0){if(_0x2b8874[_0x6928('0x12')]){if(_0x52c50b['blockDuration']>0x0){if(moment(_0x2b8874['blockedAt'])['add'](_0x52c50b['blockDuration'],_0x6928('0x18'))>moment()){return _0x5a8186(null,![],{'message':_0x6928('0x16')});}else{return utils[_0x6928('0x19')](_0x2b8874,_0x30663f,![],null)[_0x6928('0xc')](function(){return _0x5a8186(null,![],{'message':_0x6928('0x16')});});}}else{return _0x5a8186(null,![],{'message':_0x6928('0x16')});}}else{if(_0x30663f>=_0x52c50b['allowedLoginAttempts']){return utils[_0x6928('0x19')](_0x2b8874,0x0,!![],moment())['then'](function(){return _0x5a8186(null,![],{'message':_0x6928('0x16')});});}else{return utils[_0x6928('0x19')](_0x2b8874,_0x30663f,![],null)[_0x6928('0xc')](function(){return _0x5a8186(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5a8186(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2b8874[_0x6928('0x11')]){return _0x5a8186(null,![],{'message':_0x6928('0x16')});}else if(_0x52c50b['allowedLoginAttempts']>0x0){if(_0x2b8874[_0x6928('0x12')]){if(_0x52c50b[_0x6928('0xb')]>0x0){if(moment(_0x2b8874['blockedAt'])[_0x6928('0x1a')](_0x52c50b[_0x6928('0xb')],_0x6928('0x18'))>moment()){return _0x5a8186(null,![],{'message':_0x6928('0x16')});}else{return utils[_0x6928('0x19')](_0x2b8874,0x0,![],null)[_0x6928('0xc')](function(){return utils[_0x6928('0x1b')](_0x2b8874);})[_0x6928('0xc')](function(){return _0x5a8186(null,_0x2b8874);});}}else{return _0x5a8186(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x2b8874,0x0,![],null)[_0x6928('0xc')](function(){return utils[_0x6928('0x1b')](_0x2b8874);})[_0x6928('0xc')](function(){return _0x5a8186(null,_0x2b8874);})[_0x6928('0x1c')](function(_0xe70b81){return _0x5a8186(null,![],_0xe70b81);});}}else{if(_0x2b8874[_0x6928('0x12')]){return _0x5a8186(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x6928('0x1b')](_0x2b8874)[_0x6928('0xc')](function(){return _0x5a8186(null,_0x2b8874);});}}}});})['catch'](function(_0x8d25b){return _0x5a8186(null,![],_0x8d25b);});}function sendServiceMail(_0x3db359){return db[_0x6928('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0x6928('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x6928('0x1e'),'include':[{'model':db[_0x6928('0x1f')],'as':_0x6928('0x1f')}]}]})[_0x6928('0xc')](function(_0xc50869){if(!_0xc50869){throw new Error(_0x6928('0x20'));}var _0x5ac3e8=_0xc50869[_0x6928('0x21')]();var _0x1d1d7b={'account':_0x5ac3e8,'message':_[_0x6928('0x22')]({'from':util[_0x6928('0x23')](_0x6928('0x24'),_0xc50869[_0x6928('0xd')],_0xc50869[_0x6928('0x25')]||_0xc50869[_0x6928('0x1e')]['user'])},_0x3db359)};return client[_0x6928('0x26')](_0x6928('0x27'),_0x1d1d7b);})[_0x6928('0xc')](function(_0x26addf){if(_0x26addf['error']){throw new Error(util[_0x6928('0x23')](_0x6928('0x28'),_0x26addf['error'][_0x6928('0x29')]||JSON[_0x6928('0x2a')](_0x26addf[_0x6928('0x2b')])));}return!![];});}function handleError(_0x2e5123,_0x2a7fe7,_0x68d8ab){return _0x2e5123[_0x6928('0x2c')](_0x2a7fe7||0x1f4)[_0x6928('0x2d')]({'message':_0x68d8ab?_0x68d8ab[_0x6928('0x29')]||_0x68d8ab:''});}exports[_0x6928('0x2e')]=function(_0x4c12cd,_0x297187,_0x51d82d){passport[_0x6928('0x17')](_0x6928('0x2f'),function(_0x2eded9,_0x1fd6ee,_0x25768a){var _0x14d09b=_0x2eded9||_0x25768a;if(_0x14d09b){return handleError(_0x297187,0x191,_0x14d09b);}if(!_0x1fd6ee){return handleError(_0x297187,0x194,{'message':_0x6928('0x30')});}else{var _0x3625b3={'payload':{'id':_0x1fd6ee['id'],'role':_0x1fd6ee[_0x6928('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3625b3)['then'](function(_0x30a646){_0x297187['json']({'id':_0x1fd6ee['id'],'token':_0x30a646,'statusCall':'','isAlreadyLogged':_0x1fd6ee['online']});});}})(_0x4c12cd,_0x297187,_0x51d82d);};exports[_0x6928('0x31')]=function(_0x413e55,_0x10ea2b){if(!_0x413e55['body'][_0x6928('0x25')]){return handleError(_0x10ea2b,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x534d92=rs['generate']();_0x413e55[_0x6928('0x32')][_0x6928('0x25')]=_0x413e55[_0x6928('0x32')]['email'][_0x6928('0x33')]()[_0x6928('0x34')]();var _0x9bde68;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x6928('0xa'),_0x6928('0xb')],'raw':!![]})['then'](function(_0x135541){_0x9bde68=_0x135541;return db['User'][_0x6928('0x35')]({'where':{'email':_0x413e55['body'][_0x6928('0x25')]}});})[_0x6928('0xc')](function(_0x34d2ba){if(!_0x34d2ba){throw new Error(_0x6928('0x36'));}if(_0x34d2ba[_0x6928('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x34d2ba['blocked']){if(moment(_0x34d2ba['blockedAt'])[_0x6928('0x1a')](_0x9bde68[_0x6928('0xb')],_0x6928('0x18'))>moment()){throw new Error(_0x6928('0x37'));}else{_0x34d2ba[_0x6928('0x12')]=![];_0x34d2ba[_0x6928('0x13')]=null;}}_0x34d2ba[_0x6928('0x38')]=_0x534d92;_0x34d2ba[_0x6928('0x39')]=Date[_0x6928('0x3a')]()+0x36ee80;return _0x34d2ba[_0x6928('0x3b')]();})[_0x6928('0xc')](function(){return sendServiceMail({'to':_0x413e55['body']['email'],'subject':_0x6928('0x3c'),'text':_0x6928('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x6928('0x3e')+_0x413e55[_0x6928('0x3f')][_0x6928('0x40')]+_0x6928('0x41')+_0x534d92+'\x0a\x0a'+_0x6928('0x42')});})[_0x6928('0xc')](function(){_0x10ea2b[_0x6928('0x2c')](0xc8)[_0x6928('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x6928('0x1c')](function(_0xa2d3a5){return handleError(_0x10ea2b,0x1f4,_0xa2d3a5);});};exports[_0x6928('0x43')]=function(_0x11f909,_0x33322b){return db[_0x6928('0x44')][_0x6928('0x35')]({'where':{'resetPasswordToken':_0x11f909[_0x6928('0x45')][_0x6928('0x46')],'resetPasswordExpires':{'$gt':Date[_0x6928('0x3a')]()}}})[_0x6928('0xc')](function(_0x4c0be1){if(!_0x4c0be1){throw new Error(_0x6928('0x47'));}return db[_0x6928('0x8')][_0x6928('0x9')]({'attributes':['id',_0x6928('0x48'),_0x6928('0x49'),_0x6928('0x4a')]})[_0x6928('0xc')](function(_0x17d9f2){if(_0x17d9f2[_0x6928('0x48')])authService['validatePasswordPattern'](_0x11f909[_0x6928('0x32')][_0x6928('0xe')]);if(!_0x17d9f2['enforcePasswordHistory']||!_0x4c0be1[_0x6928('0x4b')])return _0x4c0be1;authService[_0x6928('0x4c')](_0x11f909[_0x6928('0x32')][_0x6928('0xe')],_0x4c0be1[_0x6928('0x4b')],_0x17d9f2[_0x6928('0x4a')]);return _0x4c0be1;})['then'](function(){_0x4c0be1[_0x6928('0xe')]=_0x11f909[_0x6928('0x32')][_0x6928('0xe')];_0x4c0be1[_0x6928('0x38')]=null;_0x4c0be1[_0x6928('0x39')]=null;return _0x4c0be1['save']();});})['then'](function(){_0x33322b['status'](0xc8)[_0x6928('0x2d')]({'message':_0x6928('0x4d')});})[_0x6928('0x1c')](function(_0x1da978){return handleError(_0x33322b,0x1f4,_0x1da978);});};passport[_0x6928('0x4e')](_0x6928('0x2f'),new LocalStrategy({'usernameField':_0x6928('0xd'),'passwordField':_0x6928('0xe')},function(_0x1d3256,_0x32bb46,_0x5b0d80){return localAuthenticate(db['User'],_0x1d3256,_0x32bb46,_0x5b0d80);})); \ No newline at end of file +var _0x0552=['save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','util','passport-local','jayson/promise','lodash','randomstring','moment','client','http','Setting','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','catch','getLicense','MailAccount','MailServerOut','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','findOne','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x42a141,_0x4073ed){var _0x190fca=function(_0x235510){while(--_0x235510){_0x42a141['push'](_0x42a141['shift']());}};_0x190fca(++_0x4073ed);}(_0x0552,0x137));var _0x2055=function(_0xe9c121,_0x3c8911){_0xe9c121=_0xe9c121-0x0;var _0x29149e=_0x0552[_0xe9c121];return _0x29149e;};'use strict';var util=require(_0x2055('0x0'));var passport=require('passport');var LocalStrategy=require(_0x2055('0x1'))['Strategy'];var jayson=require(_0x2055('0x2'));var _=require(_0x2055('0x3'));var rs=require(_0x2055('0x4'));var moment=require(_0x2055('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x2055('0x6')][_0x2055('0x7')]({'port':0x232b});function localAuthenticate(_0x3450cb,_0x2d4199,_0x304076,_0x35c8e8){var _0x2535f9,_0x4aa65c;return db[_0x2055('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x2055('0x9')](function(_0x3e7c8f){_0x2535f9=_0x3e7c8f;return _0x3450cb['findOne']({'attributes':['id',_0x2055('0xa'),_0x2055('0xb'),_0x2055('0xc'),_0x2055('0xd'),_0x2055('0xe'),_0x2055('0xf'),_0x2055('0x10'),_0x2055('0x11')],'where':{'name':_0x2d4199,'role':{'$or':[_0x2055('0x12'),_0x2055('0x13'),'agent']}}});})[_0x2055('0x9')](function(_0x1ebff6){if(!_0x1ebff6||_0x1ebff6&&_0x1ebff6['name']!==_0x2d4199){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4aa65c=_0x1ebff6;return _0x4aa65c;}})[_0x2055('0x9')](function(){_0x4aa65c[_0x2055('0x14')](_0x304076,function(_0x44dcc8,_0x5ea5ef){var _0x31077f=_0x4aa65c[_0x2055('0x11')]+0x1;if(_0x44dcc8){return _0x35c8e8(_0x44dcc8);}else if(!_0x5ea5ef){if(_0x4aa65c[_0x2055('0xe')]){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}else if(_0x2535f9[_0x2055('0x16')]>0x0){if(_0x4aa65c['blocked']){if(_0x2535f9[_0x2055('0x17')]>0x0){if(moment(_0x4aa65c['blockedAt'])[_0x2055('0x18')](_0x2535f9[_0x2055('0x17')],_0x2055('0x19'))>moment()){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}else{return utils[_0x2055('0x1a')](_0x4aa65c,_0x31077f,![],null)[_0x2055('0x9')](function(){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});});}}else{return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}}else{if(_0x31077f>=_0x2535f9[_0x2055('0x16')]){return utils[_0x2055('0x1a')](_0x4aa65c,0x0,!![],moment())[_0x2055('0x9')](function(){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});});}else{return utils[_0x2055('0x1a')](_0x4aa65c,_0x31077f,![],null)[_0x2055('0x9')](function(){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});});}}}else{return _0x35c8e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4aa65c['disabled']){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}else if(_0x2535f9[_0x2055('0x16')]>0x0){if(_0x4aa65c[_0x2055('0xf')]){if(_0x2535f9[_0x2055('0x17')]>0x0){if(moment(_0x4aa65c[_0x2055('0x10')])[_0x2055('0x18')](_0x2535f9[_0x2055('0x17')],_0x2055('0x19'))>moment()){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}else{return utils[_0x2055('0x1a')](_0x4aa65c,0x0,![],null)[_0x2055('0x9')](function(){return utils['getLicense'](_0x4aa65c);})[_0x2055('0x9')](function(){return _0x35c8e8(null,_0x4aa65c);});}}else{return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}}else{return utils['clearBlockUser'](_0x4aa65c,0x0,![],null)[_0x2055('0x9')](function(){return utils['getLicense'](_0x4aa65c);})['then'](function(){return _0x35c8e8(null,_0x4aa65c);})[_0x2055('0x1b')](function(_0x48229c){return _0x35c8e8(null,![],_0x48229c);});}}else{if(_0x4aa65c[_0x2055('0xf')]){return _0x35c8e8(null,![],{'message':_0x2055('0x15')});}else{return utils[_0x2055('0x1c')](_0x4aa65c)[_0x2055('0x9')](function(){return _0x35c8e8(null,_0x4aa65c);});}}}});})[_0x2055('0x1b')](function(_0x2cacbb){return _0x35c8e8(null,![],_0x2cacbb);});}function sendServiceMail(_0xd15929){return db[_0x2055('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x2055('0x1e')],'as':_0x2055('0x1f'),'include':[{'model':db[_0x2055('0x20')],'as':_0x2055('0x20')}]}]})['then'](function(_0x64ce9c){if(!_0x64ce9c){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1b5018=_0x64ce9c['getSmtpOptions']();var _0x380406={'account':_0x1b5018,'message':_['merge']({'from':util[_0x2055('0x21')](_0x2055('0x22'),_0x64ce9c['name'],_0x64ce9c['email']||_0x64ce9c[_0x2055('0x1f')][_0x2055('0x13')])},_0xd15929)};return client[_0x2055('0x23')]('SendMail',_0x380406);})[_0x2055('0x9')](function(_0xcabef9){if(_0xcabef9[_0x2055('0x24')]){throw new Error(util[_0x2055('0x21')](_0x2055('0x25'),_0xcabef9[_0x2055('0x24')][_0x2055('0x26')]||JSON['stringify'](_0xcabef9[_0x2055('0x24')])));}return!![];});}function handleError(_0x2ad2f8,_0x5e9881,_0xa0fbff){return _0x2ad2f8[_0x2055('0x27')](_0x5e9881||0x1f4)[_0x2055('0x28')]({'message':_0xa0fbff?_0xa0fbff[_0x2055('0x26')]||_0xa0fbff:''});}exports[_0x2055('0x29')]=function(_0x46bb42,_0x17d437,_0x40408c){passport[_0x2055('0x14')](_0x2055('0x2a'),function(_0x38bb90,_0x41c370,_0x2298e5){var _0x2048f1=_0x38bb90||_0x2298e5;if(_0x2048f1){return handleError(_0x17d437,0x191,_0x2048f1);}if(!_0x41c370){return handleError(_0x17d437,0x194,{'message':_0x2055('0x2b')});}else{var _0x5c8f6d={'payload':{'id':_0x41c370['id'],'role':_0x41c370[_0x2055('0xd')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5c8f6d)['then'](function(_0x347d84){_0x17d437[_0x2055('0x2c')]({'id':_0x41c370['id'],'token':_0x347d84,'statusCall':'','isAlreadyLogged':_0x41c370[_0x2055('0x2d')]});});}})(_0x46bb42,_0x17d437,_0x40408c);};exports[_0x2055('0x2e')]=function(_0x9fccde,_0x47c848){if(!_0x9fccde[_0x2055('0x2f')][_0x2055('0x30')]){return handleError(_0x47c848,0x1f4,{'message':_0x2055('0x31')});}var _0x4d7b90=rs['generate']();_0x9fccde[_0x2055('0x2f')]['email']=_0x9fccde[_0x2055('0x2f')][_0x2055('0x30')][_0x2055('0x32')]()[_0x2055('0x33')]();var _0x493016;return db[_0x2055('0x8')][_0x2055('0x34')]({'where':{'id':0x1},'attributes':[_0x2055('0x16'),'blockDuration'],'raw':!![]})[_0x2055('0x9')](function(_0x409a10){_0x493016=_0x409a10;return db[_0x2055('0x35')][_0x2055('0x36')]({'where':{'email':_0x9fccde[_0x2055('0x2f')][_0x2055('0x30')]}});})[_0x2055('0x9')](function(_0x382ca9){if(!_0x382ca9){throw new Error(_0x2055('0x37'));}if(_0x382ca9['disabled']){throw new Error(_0x2055('0x38'));}if(_0x382ca9['blocked']){if(moment(_0x382ca9[_0x2055('0x10')])['add'](_0x493016[_0x2055('0x17')],'minutes')>moment()){throw new Error(_0x2055('0x39'));}else{_0x382ca9[_0x2055('0xf')]=![];_0x382ca9[_0x2055('0x10')]=null;}}_0x382ca9[_0x2055('0x3a')]=_0x4d7b90;_0x382ca9['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x382ca9[_0x2055('0x3b')]();})[_0x2055('0x9')](function(){return sendServiceMail({'to':_0x9fccde[_0x2055('0x2f')]['email'],'subject':_0x2055('0x3c'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x2055('0x3d')+_0x2055('0x3e')+_0x9fccde['headers'][_0x2055('0x3f')]+'/reset/'+_0x4d7b90+'\x0a\x0a'+_0x2055('0x40')});})[_0x2055('0x9')](function(){_0x47c848[_0x2055('0x27')](0xc8)['send']({'message':_0x2055('0x41')});})[_0x2055('0x1b')](function(_0x37197d){return handleError(_0x47c848,0x1f4,_0x37197d);});};exports[_0x2055('0x42')]=function(_0x449166,_0x187944){return db[_0x2055('0x35')][_0x2055('0x36')]({'where':{'resetPasswordToken':_0x449166['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2055('0x9')](function(_0x5d4553){if(!_0x5d4553){throw new Error(_0x2055('0x43'));}return db['Setting'][_0x2055('0x34')]({'attributes':['id',_0x2055('0x44'),_0x2055('0x45'),'passwordHistoryLimit']})[_0x2055('0x9')](function(_0x1ee0be){if(_0x1ee0be[_0x2055('0x44')])authService['validatePasswordPattern'](_0x449166['body'][_0x2055('0xb')]);if(!_0x1ee0be[_0x2055('0x45')]||!_0x5d4553[_0x2055('0x46')])return _0x5d4553;authService[_0x2055('0x47')](_0x449166['body'][_0x2055('0xb')],_0x5d4553[_0x2055('0x46')],_0x1ee0be['passwordHistoryLimit']);return _0x5d4553;})[_0x2055('0x9')](function(){_0x5d4553['password']=_0x449166[_0x2055('0x2f')][_0x2055('0xb')];_0x5d4553['resetPasswordToken']=null;_0x5d4553[_0x2055('0x48')]=null;return _0x5d4553['save']();});})[_0x2055('0x9')](function(){_0x187944[_0x2055('0x27')](0xc8)[_0x2055('0x28')]({'message':'Password\x20reset!'});})['catch'](function(_0x11238d){return handleError(_0x187944,0x1f4,_0x11238d);});};passport[_0x2055('0x49')](_0x2055('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x2055('0xb')},function(_0x264d9f,_0x4e9843,_0x50d254){return localAuthenticate(db[_0x2055('0x35')],_0x264d9f,_0x4e9843,_0x50d254);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f1ea5f8..8a9344a 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 _0x857b=['reset','express','Router','./authLocal.controller','post','/forgot','forgot'];(function(_0x285cc9,_0x1733df){var _0x56ed9e=function(_0x936158){while(--_0x936158){_0x285cc9['push'](_0x285cc9['shift']());}};_0x56ed9e(++_0x1733df);}(_0x857b,0xda));var _0xb857=function(_0x4749e7,_0x1d35bb){_0x4749e7=_0x4749e7-0x0;var _0x1953aa=_0x857b[_0x4749e7];return _0x1953aa;};'use strict';var express=require(_0xb857('0x0'));var router=express[_0xb857('0x1')]();var controller=require(_0xb857('0x2'));router[_0xb857('0x3')]('/',controller['login']);router['post'](_0xb857('0x4'),controller[_0xb857('0x5')]);router[_0xb857('0x3')]('/reset/:token',controller[_0xb857('0x6')]);module['exports']=router; \ No newline at end of file +var _0xe784=['post','forgot','/reset/:token','reset','Router','./authLocal.controller','login'];(function(_0x7a1e06,_0x5f3dce){var _0x2f1182=function(_0xa0430f){while(--_0xa0430f){_0x7a1e06['push'](_0x7a1e06['shift']());}};_0x2f1182(++_0x5f3dce);}(_0xe784,0x7b));var _0x4e78=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe784[_0x4b055c];return _0x4b62bb;};'use strict';var express=require('express');var router=express[_0x4e78('0x0')]();var controller=require(_0x4e78('0x1'));router['post']('/',controller[_0x4e78('0x2')]);router[_0x4e78('0x3')]('/forgot',controller[_0x4e78('0x4')]);router[_0x4e78('0x3')](_0x4e78('0x5'),controller[_0x4e78('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a34af41..facd7ed 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 _0xaa23=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x397d26,_0x347d14){var _0x460956=function(_0x48864a){while(--_0x48864a){_0x397d26['push'](_0x397d26['shift']());}};_0x460956(++_0x347d14);}(_0xaa23,0xd8));var _0x3aa2=function(_0x261931,_0x5b654a){_0x261931=_0x261931-0x0;var _0x11083a=_0xaa23[_0x261931];return _0x11083a;};'use strict';var Sequelize=require('sequelize');module[_0x3aa2('0x0')]={'name':{'type':Sequelize[_0x3aa2('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3aa2('0x1')]},'description':{'type':Sequelize[_0x3aa2('0x1')]},'status':{'type':Sequelize[_0x3aa2('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3aa2('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x2008=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3ddb52,_0x7790cf){var _0x378940=function(_0x49dbbb){while(--_0x49dbbb){_0x3ddb52['push'](_0x3ddb52['shift']());}};_0x378940(++_0x7790cf);}(_0x2008,0x1de));var _0x8200=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x2008[_0x2c2980];return _0x2a20a9;};'use strict';var Sequelize=require(_0x8200('0x0'));module[_0x8200('0x1')]={'name':{'type':Sequelize[_0x8200('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8200('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x8200('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 511cd12..f969160 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 _0x2657=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','addConditions','Condition','ids','getConditions','findOne','nolimit','addActions','omit','getActions','Action','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x2657,0x166));var _0x7265=function(_0x22829f,_0x16f5d5){_0x22829f=_0x22829f-0x0;var _0x3fee6d=_0x2657[_0x22829f];return _0x3fee6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7265('0x0'));var zipdir=require(_0x7265('0x1'));var jsonpatch=require(_0x7265('0x2'));var rp=require(_0x7265('0x3'));var moment=require(_0x7265('0x4'));var BPromise=require(_0x7265('0x5'));var Mustache=require(_0x7265('0x6'));var util=require('util');var path=require(_0x7265('0x7'));var sox=require(_0x7265('0x8'));var csv=require(_0x7265('0x9'));var ejs=require(_0x7265('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7265('0xb'));var crypto=require(_0x7265('0xc'));var jsforce=require(_0x7265('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7265('0xe'));var Redis=require('ioredis');var authService=require(_0x7265('0xf'));var qs=require(_0x7265('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7265('0x11'));var logger=require(_0x7265('0x12'))(_0x7265('0x13'));var utils=require('../../config/utils');var config=require(_0x7265('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7265('0x15'))['db'];function respondWithStatusCode(_0x4f9e9c,_0x40203c){_0x40203c=_0x40203c||0xcc;return function(_0x35d00a){if(_0x35d00a){return _0x4f9e9c[_0x7265('0x16')](_0x40203c);}return _0x4f9e9c[_0x7265('0x17')](_0x40203c)[_0x7265('0x18')]();};}function respondWithResult(_0x422283,_0x54a4e4){_0x54a4e4=_0x54a4e4||0xc8;return function(_0x39508f){if(_0x39508f){return _0x422283[_0x7265('0x17')](_0x54a4e4)['json'](_0x39508f);}};}function respondWithFilteredResult(_0x1f38fc,_0x194724){return function(_0x4bd1d4){if(_0x4bd1d4){var _0x233de5=typeof _0x194724[_0x7265('0x19')]===_0x7265('0x1a')&&typeof _0x194724[_0x7265('0x1b')]===_0x7265('0x1a');var _0x53dd01=_0x4bd1d4['count'];var _0x4570e1=_0x233de5?0x0:_0x194724['offset'];var _0xcaf9bd=_0x233de5?_0x4bd1d4[_0x7265('0x1c')]:_0x194724[_0x7265('0x19')]+_0x194724[_0x7265('0x1b')];var _0x489d9f;if(_0xcaf9bd>=_0x53dd01){_0xcaf9bd=_0x53dd01;_0x489d9f=0xc8;}else{_0x489d9f=0xce;}_0x1f38fc[_0x7265('0x17')](_0x489d9f);return _0x1f38fc[_0x7265('0x1d')]('Content-Range',_0x4570e1+'-'+_0xcaf9bd+'/'+_0x53dd01)[_0x7265('0x1e')](_0x4bd1d4);}return null;};}function patchUpdates(_0x2af290){return function(_0x355283){try{jsonpatch['apply'](_0x355283,_0x2af290,!![]);}catch(_0x20bcf8){return BPromise[_0x7265('0x1f')](_0x20bcf8);}return _0x355283[_0x7265('0x20')]();};}function saveUpdates(_0xea80a9,_0x492dde){return function(_0x522489){if(_0x522489){return _0x522489[_0x7265('0x21')](_0xea80a9)[_0x7265('0x22')](function(_0x3a9271){return _0x3a9271;});}return null;};}function removeEntity(_0x145aa0,_0xb6b1f3){return function(_0x396519){if(_0x396519){return _0x396519[_0x7265('0x23')]()[_0x7265('0x22')](function(){_0x145aa0['status'](0xcc)[_0x7265('0x18')]();});}};}function handleEntityNotFound(_0x2d98dd,_0x451f57){return function(_0x1cb77f){if(!_0x1cb77f){_0x2d98dd['sendStatus'](0x194);}return _0x1cb77f;};}function handleError(_0x337502,_0x1b85b0){_0x1b85b0=_0x1b85b0||0x1f4;return function(_0x35c2ef){logger[_0x7265('0x24')](_0x35c2ef[_0x7265('0x25')]);if(_0x35c2ef['name']){delete _0x35c2ef[_0x7265('0x26')];}_0x337502[_0x7265('0x17')](_0x1b85b0)[_0x7265('0x27')](_0x35c2ef);};}exports[_0x7265('0x28')]=function(_0x37703e,_0x5006bd){var _0x616e2d={},_0x623906={},_0x51e9f5={'count':0x0,'rows':[]};var _0x43487a=_[_0x7265('0x29')](db[_0x7265('0x2a')][_0x7265('0x2b')],function(_0x4a3413){return{'name':_0x4a3413[_0x7265('0x2c')],'type':_0x4a3413[_0x7265('0x2d')][_0x7265('0x2e')]};});_0x623906['model']=_[_0x7265('0x29')](_0x43487a,_0x7265('0x26'));_0x623906[_0x7265('0x2f')]=_['keys'](_0x37703e[_0x7265('0x2f')]);_0x623906[_0x7265('0x30')]=_[_0x7265('0x31')](_0x623906[_0x7265('0x32')],_0x623906[_0x7265('0x2f')]);_0x616e2d[_0x7265('0x33')]=_['intersection'](_0x623906['model'],qs['fields'](_0x37703e[_0x7265('0x2f')][_0x7265('0x34')]));_0x616e2d[_0x7265('0x33')]=_0x616e2d['attributes'][_0x7265('0x35')]?_0x616e2d[_0x7265('0x33')]:_0x623906[_0x7265('0x32')];if(!_0x37703e[_0x7265('0x2f')][_0x7265('0x36')]('nolimit')){_0x616e2d['limit']=qs[_0x7265('0x1b')](_0x37703e[_0x7265('0x2f')][_0x7265('0x1b')]);_0x616e2d[_0x7265('0x19')]=qs[_0x7265('0x19')](_0x37703e[_0x7265('0x2f')][_0x7265('0x19')]);}_0x616e2d[_0x7265('0x37')]=qs['sort'](_0x37703e['query'][_0x7265('0x38')]);_0x616e2d[_0x7265('0x39')]=qs['filters'](_[_0x7265('0x3a')](_0x37703e[_0x7265('0x2f')],_0x623906['filters']),_0x43487a);if(_0x37703e[_0x7265('0x2f')][_0x7265('0x3b')]){_0x616e2d['where']=_[_0x7265('0x3c')](_0x616e2d[_0x7265('0x39')],{'$or':_[_0x7265('0x29')](_0x43487a,function(_0x2ef86a){if(_0x2ef86a[_0x7265('0x2d')]!==_0x7265('0x3d')){var _0x2e0b9c={};_0x2e0b9c[_0x2ef86a[_0x7265('0x26')]]={'$like':'%'+_0x37703e[_0x7265('0x2f')][_0x7265('0x3b')]+'%'};return _0x2e0b9c;}})});}_0x616e2d=_[_0x7265('0x3c')]({},_0x616e2d,_0x37703e[_0x7265('0x3e')]);var _0x2dcb8a={'where':_0x616e2d['where']};return db['Automation']['count'](_0x2dcb8a)['then'](function(_0x2cfc78){_0x51e9f5[_0x7265('0x1c')]=_0x2cfc78;if(_0x37703e['query'][_0x7265('0x3f')]){_0x616e2d[_0x7265('0x40')]=[{'all':!![]}];}return db[_0x7265('0x2a')]['findAll'](_0x616e2d);})[_0x7265('0x22')](function(_0x2767d6){_0x51e9f5['rows']=_0x2767d6;return _0x51e9f5;})[_0x7265('0x22')](respondWithFilteredResult(_0x5006bd,_0x616e2d))[_0x7265('0x41')](handleError(_0x5006bd,null));};exports[_0x7265('0x42')]=function(_0x4b13f8,_0x2932b4){var _0x5b9f23={'raw':![],'where':{'id':_0x4b13f8['params']['id']}},_0x59c053={};_0x59c053['model']=_[_0x7265('0x43')](db['Automation'][_0x7265('0x2b')]);_0x59c053['query']=_['keys'](_0x4b13f8[_0x7265('0x2f')]);_0x59c053[_0x7265('0x30')]=_['intersection'](_0x59c053[_0x7265('0x32')],_0x59c053[_0x7265('0x2f')]);_0x5b9f23[_0x7265('0x33')]=_[_0x7265('0x31')](_0x59c053[_0x7265('0x32')],qs[_0x7265('0x34')](_0x4b13f8[_0x7265('0x2f')][_0x7265('0x34')]));_0x5b9f23[_0x7265('0x33')]=_0x5b9f23[_0x7265('0x33')]['length']?_0x5b9f23[_0x7265('0x33')]:_0x59c053['model'];if(_0x4b13f8[_0x7265('0x2f')][_0x7265('0x3f')]){_0x5b9f23['include']=[{'all':!![]}];}_0x5b9f23=_[_0x7265('0x3c')]({},_0x5b9f23,_0x4b13f8['options']);return db[_0x7265('0x2a')][_0x7265('0x44')](_0x5b9f23)[_0x7265('0x22')](handleEntityNotFound(_0x2932b4,null))[_0x7265('0x22')](respondWithResult(_0x2932b4,null))[_0x7265('0x41')](handleError(_0x2932b4,null));};exports['create']=function(_0x1a11a9,_0x2179c0){return db['Automation'][_0x7265('0x45')](_0x1a11a9[_0x7265('0x46')],{})[_0x7265('0x22')](respondWithResult(_0x2179c0,0xc9))['catch'](handleError(_0x2179c0,null));};exports[_0x7265('0x21')]=function(_0x484712,_0x534465){if(_0x484712[_0x7265('0x46')]['id']){delete _0x484712['body']['id'];}return db['Automation']['find']({'where':{'id':_0x484712[_0x7265('0x47')]['id']}})[_0x7265('0x22')](handleEntityNotFound(_0x534465,null))[_0x7265('0x22')](saveUpdates(_0x484712['body'],null))[_0x7265('0x22')](respondWithResult(_0x534465,null))[_0x7265('0x41')](handleError(_0x534465,null));};exports[_0x7265('0x23')]=function(_0x309125,_0x2f8204){return db[_0x7265('0x2a')][_0x7265('0x44')]({'where':{'id':_0x309125['params']['id']}})[_0x7265('0x22')](handleEntityNotFound(_0x2f8204,null))['then'](removeEntity(_0x2f8204,null))[_0x7265('0x41')](handleError(_0x2f8204,null));};exports[_0x7265('0x48')]=function(_0x457bb8,_0x32d8b4,_0x2fd075){return db[_0x7265('0x49')]['find']({'where':{'id':_0x457bb8[_0x7265('0x47')]['id']}})[_0x7265('0x22')](handleEntityNotFound(_0x32d8b4,null))[_0x7265('0x22')](function(_0xc0055a){if(_0xc0055a){return _0xc0055a[_0x7265('0x48')](_0x457bb8[_0x7265('0x46')]['ids'],_['omit'](_0x457bb8[_0x7265('0x46')],[_0x7265('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x32d8b4,null))[_0x7265('0x41')](handleError(_0x32d8b4,null));};exports[_0x7265('0x4b')]=function(_0x157447,_0x144f47,_0x222590){var _0x177bff={};var _0x306253={};var _0x18f18b;var _0x3b3abd;return db[_0x7265('0x2a')][_0x7265('0x4c')]({'where':{'id':_0x157447[_0x7265('0x47')]['id']}})['then'](handleEntityNotFound(_0x144f47,null))[_0x7265('0x22')](function(_0x4aa698){if(_0x4aa698){_0x18f18b=_0x4aa698;_0x306253[_0x7265('0x32')]=_['keys'](db[_0x7265('0x49')]['rawAttributes']);_0x306253[_0x7265('0x2f')]=_['keys'](_0x157447[_0x7265('0x2f')]);_0x306253['filters']=_['intersection'](_0x306253['model'],_0x306253['query']);_0x177bff[_0x7265('0x33')]=_[_0x7265('0x31')](_0x306253[_0x7265('0x32')],qs[_0x7265('0x34')](_0x157447[_0x7265('0x2f')]['fields']));_0x177bff['attributes']=_0x177bff[_0x7265('0x33')][_0x7265('0x35')]?_0x177bff[_0x7265('0x33')]:_0x306253[_0x7265('0x32')];_0x177bff['order']=qs[_0x7265('0x38')](_0x157447[_0x7265('0x2f')]['sort']);_0x177bff[_0x7265('0x39')]=qs[_0x7265('0x30')](_[_0x7265('0x3a')](_0x157447[_0x7265('0x2f')],_0x306253['filters']));if(_0x157447[_0x7265('0x2f')][_0x7265('0x3b')]){_0x177bff[_0x7265('0x39')]=_[_0x7265('0x3c')](_0x177bff['where'],{'$or':_[_0x7265('0x29')](_0x177bff[_0x7265('0x33')],function(_0x3eefe7){var _0x63b9d2={};_0x63b9d2[_0x3eefe7]={'$like':'%'+_0x157447[_0x7265('0x2f')][_0x7265('0x3b')]+'%'};return _0x63b9d2;})});}_0x177bff=_[_0x7265('0x3c')]({},_0x177bff,_0x157447[_0x7265('0x3e')]);return _0x18f18b[_0x7265('0x4b')](_0x177bff);}})[_0x7265('0x22')](function(_0x44220b){if(_0x44220b){_0x3b3abd=_0x44220b[_0x7265('0x35')];if(!_0x157447['query'][_0x7265('0x36')](_0x7265('0x4d'))){_0x177bff[_0x7265('0x1b')]=qs[_0x7265('0x1b')](_0x157447[_0x7265('0x2f')][_0x7265('0x1b')]);_0x177bff[_0x7265('0x19')]=qs[_0x7265('0x19')](_0x157447[_0x7265('0x2f')]['offset']);}return _0x18f18b['getConditions'](_0x177bff);}})[_0x7265('0x22')](function(_0x7dab1a){if(_0x7dab1a){return _0x7dab1a?{'count':_0x3b3abd,'rows':_0x7dab1a}:null;}})[_0x7265('0x22')](respondWithResult(_0x144f47,null))[_0x7265('0x41')](handleError(_0x144f47,null));};exports['addActions']=function(_0x4dad66,_0x62b66c,_0x1cfd46){return db['Action']['find']({'where':{'id':_0x4dad66['params']['id']}})['then'](handleEntityNotFound(_0x62b66c,null))['then'](function(_0x5603c0){if(_0x5603c0){return _0x5603c0[_0x7265('0x4e')](_0x4dad66[_0x7265('0x46')]['ids'],_[_0x7265('0x4f')](_0x4dad66[_0x7265('0x46')],[_0x7265('0x4a'),'id'])||{});}})[_0x7265('0x22')](respondWithResult(_0x62b66c,null))['catch'](handleError(_0x62b66c,null));};exports[_0x7265('0x50')]=function(_0x43a9ce,_0x3fc89f,_0x406ee6){var _0x5aa290={};var _0x476533={};var _0x23144c;var _0x500d5c;return db[_0x7265('0x2a')][_0x7265('0x4c')]({'where':{'id':_0x43a9ce[_0x7265('0x47')]['id']}})[_0x7265('0x22')](handleEntityNotFound(_0x3fc89f,null))[_0x7265('0x22')](function(_0x1fd40d){if(_0x1fd40d){_0x23144c=_0x1fd40d;_0x476533[_0x7265('0x32')]=_[_0x7265('0x43')](db[_0x7265('0x51')][_0x7265('0x2b')]);_0x476533['query']=_[_0x7265('0x43')](_0x43a9ce[_0x7265('0x2f')]);_0x476533['filters']=_[_0x7265('0x31')](_0x476533['model'],_0x476533['query']);_0x5aa290[_0x7265('0x33')]=_[_0x7265('0x31')](_0x476533[_0x7265('0x32')],qs[_0x7265('0x34')](_0x43a9ce[_0x7265('0x2f')][_0x7265('0x34')]));_0x5aa290[_0x7265('0x33')]=_0x5aa290['attributes'][_0x7265('0x35')]?_0x5aa290[_0x7265('0x33')]:_0x476533[_0x7265('0x32')];_0x5aa290[_0x7265('0x37')]=qs[_0x7265('0x38')](_0x43a9ce[_0x7265('0x2f')]['sort']);_0x5aa290['where']=qs[_0x7265('0x30')](_['pick'](_0x43a9ce[_0x7265('0x2f')],_0x476533[_0x7265('0x30')]));if(_0x43a9ce['query'][_0x7265('0x3b')]){_0x5aa290[_0x7265('0x39')]=_[_0x7265('0x3c')](_0x5aa290[_0x7265('0x39')],{'$or':_[_0x7265('0x29')](_0x5aa290['attributes'],function(_0x8c69f8){var _0x8d74c1={};_0x8d74c1[_0x8c69f8]={'$like':'%'+_0x43a9ce[_0x7265('0x2f')][_0x7265('0x3b')]+'%'};return _0x8d74c1;})});}_0x5aa290=_[_0x7265('0x3c')]({},_0x5aa290,_0x43a9ce[_0x7265('0x3e')]);return _0x23144c[_0x7265('0x50')](_0x5aa290);}})['then'](function(_0x4f7012){if(_0x4f7012){_0x500d5c=_0x4f7012[_0x7265('0x35')];if(!_0x43a9ce[_0x7265('0x2f')][_0x7265('0x36')](_0x7265('0x4d'))){_0x5aa290['limit']=qs['limit'](_0x43a9ce[_0x7265('0x2f')][_0x7265('0x1b')]);_0x5aa290[_0x7265('0x19')]=qs[_0x7265('0x19')](_0x43a9ce[_0x7265('0x2f')][_0x7265('0x19')]);}return _0x23144c[_0x7265('0x50')](_0x5aa290);}})[_0x7265('0x22')](function(_0x203541){if(_0x203541){return _0x203541?{'count':_0x500d5c,'rows':_0x203541}:null;}})[_0x7265('0x22')](respondWithResult(_0x3fc89f,null))[_0x7265('0x41')](handleError(_0x3fc89f,null));}; \ No newline at end of file +var _0xaa2e=['merge','create','body','find','params','addConditions','Condition','ids','omit','getConditions','filters','length','hasOwnProperty','addActions','getActions','Action','eml-format','rimraf','zip-dir','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x42b072,_0xbb8f2e){var _0x2d0954=function(_0x9bf006){while(--_0x9bf006){_0x42b072['push'](_0x42b072['shift']());}};_0x2d0954(++_0xbb8f2e);}(_0xaa2e,0x1e4));var _0xeaa2=function(_0xd4be1,_0x43be9a){_0xd4be1=_0xd4be1-0x0;var _0xc7f898=_0xaa2e[_0xd4be1];return _0xc7f898;};'use strict';var emlformat=require(_0xeaa2('0x0'));var rimraf=require(_0xeaa2('0x1'));var zipdir=require(_0xeaa2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeaa2('0x3'));var util=require('util');var path=require(_0xeaa2('0x4'));var sox=require(_0xeaa2('0x5'));var csv=require(_0xeaa2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaa2('0x7'));var squel=require(_0xeaa2('0x8'));var crypto=require('crypto');var jsforce=require(_0xeaa2('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xeaa2('0x6'));var querystring=require(_0xeaa2('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeaa2('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xeaa2('0xc'));var hardwareService=require(_0xeaa2('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0xeaa2('0xe'));var config=require(_0xeaa2('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0xeaa2('0x10'))['db'];function respondWithStatusCode(_0x1fa7dc,_0x2794d7){_0x2794d7=_0x2794d7||0xcc;return function(_0x10d6fe){if(_0x10d6fe){return _0x1fa7dc[_0xeaa2('0x11')](_0x2794d7);}return _0x1fa7dc[_0xeaa2('0x12')](_0x2794d7)['end']();};}function respondWithResult(_0x16467a,_0xfa8cfb){_0xfa8cfb=_0xfa8cfb||0xc8;return function(_0x27b32a){if(_0x27b32a){return _0x16467a['status'](_0xfa8cfb)[_0xeaa2('0x13')](_0x27b32a);}};}function respondWithFilteredResult(_0x31f0f8,_0x39c03b){return function(_0x3a1e81){if(_0x3a1e81){var _0x13d456=typeof _0x39c03b[_0xeaa2('0x14')]===_0xeaa2('0x15')&&typeof _0x39c03b[_0xeaa2('0x16')]===_0xeaa2('0x15');var _0x41cc2d=_0x3a1e81[_0xeaa2('0x17')];var _0x5cef3f=_0x13d456?0x0:_0x39c03b[_0xeaa2('0x14')];var _0x25266f=_0x13d456?_0x3a1e81[_0xeaa2('0x17')]:_0x39c03b[_0xeaa2('0x14')]+_0x39c03b[_0xeaa2('0x16')];var _0xac67a7;if(_0x25266f>=_0x41cc2d){_0x25266f=_0x41cc2d;_0xac67a7=0xc8;}else{_0xac67a7=0xce;}_0x31f0f8['status'](_0xac67a7);return _0x31f0f8[_0xeaa2('0x18')]('Content-Range',_0x5cef3f+'-'+_0x25266f+'/'+_0x41cc2d)[_0xeaa2('0x13')](_0x3a1e81);}return null;};}function patchUpdates(_0x97fca7){return function(_0x441bbc){try{jsonpatch[_0xeaa2('0x19')](_0x441bbc,_0x97fca7,!![]);}catch(_0xf968ab){return BPromise[_0xeaa2('0x1a')](_0xf968ab);}return _0x441bbc[_0xeaa2('0x1b')]();};}function saveUpdates(_0x33f385,_0xbd4d40){return function(_0xdd3b58){if(_0xdd3b58){return _0xdd3b58[_0xeaa2('0x1c')](_0x33f385)[_0xeaa2('0x1d')](function(_0x21d448){return _0x21d448;});}return null;};}function removeEntity(_0x370460,_0x5902b){return function(_0x223134){if(_0x223134){return _0x223134[_0xeaa2('0x1e')]()['then'](function(){_0x370460[_0xeaa2('0x12')](0xcc)[_0xeaa2('0x1f')]();});}};}function handleEntityNotFound(_0x5ad150,_0xc8adc){return function(_0x5b9551){if(!_0x5b9551){_0x5ad150['sendStatus'](0x194);}return _0x5b9551;};}function handleError(_0x25986a,_0x15e717){_0x15e717=_0x15e717||0x1f4;return function(_0x3d1737){logger[_0xeaa2('0x20')](_0x3d1737[_0xeaa2('0x21')]);if(_0x3d1737[_0xeaa2('0x22')]){delete _0x3d1737['name'];}_0x25986a[_0xeaa2('0x12')](_0x15e717)[_0xeaa2('0x23')](_0x3d1737);};}exports[_0xeaa2('0x24')]=function(_0x1669e5,_0x30347e){var _0x1538f8={},_0x50e107={},_0x120593={'count':0x0,'rows':[]};var _0x2dd6ab=_['map'](db[_0xeaa2('0x25')][_0xeaa2('0x26')],function(_0x36f7ea){return{'name':_0x36f7ea[_0xeaa2('0x27')],'type':_0x36f7ea[_0xeaa2('0x28')][_0xeaa2('0x29')]};});_0x50e107[_0xeaa2('0x2a')]=_[_0xeaa2('0x2b')](_0x2dd6ab,'name');_0x50e107[_0xeaa2('0x2c')]=_[_0xeaa2('0x2d')](_0x1669e5[_0xeaa2('0x2c')]);_0x50e107['filters']=_[_0xeaa2('0x2e')](_0x50e107[_0xeaa2('0x2a')],_0x50e107['query']);_0x1538f8['attributes']=_[_0xeaa2('0x2e')](_0x50e107[_0xeaa2('0x2a')],qs[_0xeaa2('0x2f')](_0x1669e5[_0xeaa2('0x2c')][_0xeaa2('0x2f')]));_0x1538f8['attributes']=_0x1538f8['attributes']['length']?_0x1538f8[_0xeaa2('0x30')]:_0x50e107[_0xeaa2('0x2a')];if(!_0x1669e5['query']['hasOwnProperty'](_0xeaa2('0x31'))){_0x1538f8[_0xeaa2('0x16')]=qs[_0xeaa2('0x16')](_0x1669e5[_0xeaa2('0x2c')][_0xeaa2('0x16')]);_0x1538f8[_0xeaa2('0x14')]=qs[_0xeaa2('0x14')](_0x1669e5[_0xeaa2('0x2c')][_0xeaa2('0x14')]);}_0x1538f8[_0xeaa2('0x32')]=qs['sort'](_0x1669e5[_0xeaa2('0x2c')][_0xeaa2('0x33')]);_0x1538f8[_0xeaa2('0x34')]=qs['filters'](_[_0xeaa2('0x35')](_0x1669e5['query'],_0x50e107['filters']),_0x2dd6ab);if(_0x1669e5['query'][_0xeaa2('0x36')]){_0x1538f8[_0xeaa2('0x34')]=_['merge'](_0x1538f8[_0xeaa2('0x34')],{'$or':_['map'](_0x2dd6ab,function(_0x37531e){if(_0x37531e[_0xeaa2('0x28')]!==_0xeaa2('0x37')){var _0x2fa28b={};_0x2fa28b[_0x37531e[_0xeaa2('0x22')]]={'$like':'%'+_0x1669e5['query'][_0xeaa2('0x36')]+'%'};return _0x2fa28b;}})});}_0x1538f8=_['merge']({},_0x1538f8,_0x1669e5[_0xeaa2('0x38')]);var _0xf5b1f9={'where':_0x1538f8[_0xeaa2('0x34')]};return db['Automation'][_0xeaa2('0x17')](_0xf5b1f9)[_0xeaa2('0x1d')](function(_0x53771b){_0x120593['count']=_0x53771b;if(_0x1669e5[_0xeaa2('0x2c')][_0xeaa2('0x39')]){_0x1538f8[_0xeaa2('0x3a')]=[{'all':!![]}];}return db['Automation'][_0xeaa2('0x3b')](_0x1538f8);})['then'](function(_0xe1f272){_0x120593[_0xeaa2('0x3c')]=_0xe1f272;return _0x120593;})['then'](respondWithFilteredResult(_0x30347e,_0x1538f8))[_0xeaa2('0x3d')](handleError(_0x30347e,null));};exports['show']=function(_0x24a307,_0x91887e){var _0x4a9215={'raw':![],'where':{'id':_0x24a307['params']['id']}},_0x556383={};_0x556383[_0xeaa2('0x2a')]=_[_0xeaa2('0x2d')](db[_0xeaa2('0x25')]['rawAttributes']);_0x556383[_0xeaa2('0x2c')]=_['keys'](_0x24a307[_0xeaa2('0x2c')]);_0x556383['filters']=_[_0xeaa2('0x2e')](_0x556383[_0xeaa2('0x2a')],_0x556383[_0xeaa2('0x2c')]);_0x4a9215[_0xeaa2('0x30')]=_[_0xeaa2('0x2e')](_0x556383[_0xeaa2('0x2a')],qs['fields'](_0x24a307['query'][_0xeaa2('0x2f')]));_0x4a9215[_0xeaa2('0x30')]=_0x4a9215[_0xeaa2('0x30')]['length']?_0x4a9215[_0xeaa2('0x30')]:_0x556383['model'];if(_0x24a307[_0xeaa2('0x2c')]['includeAll']){_0x4a9215[_0xeaa2('0x3a')]=[{'all':!![]}];}_0x4a9215=_[_0xeaa2('0x3e')]({},_0x4a9215,_0x24a307[_0xeaa2('0x38')]);return db[_0xeaa2('0x25')]['find'](_0x4a9215)[_0xeaa2('0x1d')](handleEntityNotFound(_0x91887e,null))[_0xeaa2('0x1d')](respondWithResult(_0x91887e,null))[_0xeaa2('0x3d')](handleError(_0x91887e,null));};exports[_0xeaa2('0x3f')]=function(_0x562e18,_0x27255b){return db[_0xeaa2('0x25')]['create'](_0x562e18[_0xeaa2('0x40')],{})['then'](respondWithResult(_0x27255b,0xc9))[_0xeaa2('0x3d')](handleError(_0x27255b,null));};exports[_0xeaa2('0x1c')]=function(_0x5a5b84,_0x2a0a94){if(_0x5a5b84['body']['id']){delete _0x5a5b84[_0xeaa2('0x40')]['id'];}return db[_0xeaa2('0x25')][_0xeaa2('0x41')]({'where':{'id':_0x5a5b84[_0xeaa2('0x42')]['id']}})[_0xeaa2('0x1d')](handleEntityNotFound(_0x2a0a94,null))[_0xeaa2('0x1d')](saveUpdates(_0x5a5b84[_0xeaa2('0x40')],null))['then'](respondWithResult(_0x2a0a94,null))[_0xeaa2('0x3d')](handleError(_0x2a0a94,null));};exports['destroy']=function(_0x170bfc,_0x209104){return db['Automation'][_0xeaa2('0x41')]({'where':{'id':_0x170bfc[_0xeaa2('0x42')]['id']}})[_0xeaa2('0x1d')](handleEntityNotFound(_0x209104,null))[_0xeaa2('0x1d')](removeEntity(_0x209104,null))[_0xeaa2('0x3d')](handleError(_0x209104,null));};exports[_0xeaa2('0x43')]=function(_0x8ecae8,_0x4ec189,_0x1abbc6){return db[_0xeaa2('0x44')]['find']({'where':{'id':_0x8ecae8[_0xeaa2('0x42')]['id']}})[_0xeaa2('0x1d')](handleEntityNotFound(_0x4ec189,null))[_0xeaa2('0x1d')](function(_0x3bbacb){if(_0x3bbacb){return _0x3bbacb[_0xeaa2('0x43')](_0x8ecae8[_0xeaa2('0x40')][_0xeaa2('0x45')],_[_0xeaa2('0x46')](_0x8ecae8['body'],[_0xeaa2('0x45'),'id'])||{});}})['then'](respondWithResult(_0x4ec189,null))[_0xeaa2('0x3d')](handleError(_0x4ec189,null));};exports[_0xeaa2('0x47')]=function(_0x1bd53b,_0x224501,_0x1235dc){var _0xf9c622={};var _0x263bea={};var _0x429aae;var _0x237c66;return db[_0xeaa2('0x25')]['findOne']({'where':{'id':_0x1bd53b[_0xeaa2('0x42')]['id']}})['then'](handleEntityNotFound(_0x224501,null))[_0xeaa2('0x1d')](function(_0xd06944){if(_0xd06944){_0x429aae=_0xd06944;_0x263bea[_0xeaa2('0x2a')]=_[_0xeaa2('0x2d')](db[_0xeaa2('0x44')]['rawAttributes']);_0x263bea['query']=_[_0xeaa2('0x2d')](_0x1bd53b['query']);_0x263bea[_0xeaa2('0x48')]=_[_0xeaa2('0x2e')](_0x263bea[_0xeaa2('0x2a')],_0x263bea[_0xeaa2('0x2c')]);_0xf9c622[_0xeaa2('0x30')]=_[_0xeaa2('0x2e')](_0x263bea[_0xeaa2('0x2a')],qs[_0xeaa2('0x2f')](_0x1bd53b[_0xeaa2('0x2c')]['fields']));_0xf9c622[_0xeaa2('0x30')]=_0xf9c622[_0xeaa2('0x30')][_0xeaa2('0x49')]?_0xf9c622[_0xeaa2('0x30')]:_0x263bea[_0xeaa2('0x2a')];_0xf9c622[_0xeaa2('0x32')]=qs[_0xeaa2('0x33')](_0x1bd53b[_0xeaa2('0x2c')]['sort']);_0xf9c622['where']=qs[_0xeaa2('0x48')](_[_0xeaa2('0x35')](_0x1bd53b['query'],_0x263bea[_0xeaa2('0x48')]));if(_0x1bd53b[_0xeaa2('0x2c')]['filter']){_0xf9c622[_0xeaa2('0x34')]=_[_0xeaa2('0x3e')](_0xf9c622[_0xeaa2('0x34')],{'$or':_[_0xeaa2('0x2b')](_0xf9c622[_0xeaa2('0x30')],function(_0x36b5c6){var _0x5ed7b8={};_0x5ed7b8[_0x36b5c6]={'$like':'%'+_0x1bd53b[_0xeaa2('0x2c')][_0xeaa2('0x36')]+'%'};return _0x5ed7b8;})});}_0xf9c622=_['merge']({},_0xf9c622,_0x1bd53b[_0xeaa2('0x38')]);return _0x429aae['getConditions'](_0xf9c622);}})[_0xeaa2('0x1d')](function(_0x10f3fe){if(_0x10f3fe){_0x237c66=_0x10f3fe[_0xeaa2('0x49')];if(!_0x1bd53b[_0xeaa2('0x2c')][_0xeaa2('0x4a')](_0xeaa2('0x31'))){_0xf9c622['limit']=qs[_0xeaa2('0x16')](_0x1bd53b['query'][_0xeaa2('0x16')]);_0xf9c622[_0xeaa2('0x14')]=qs[_0xeaa2('0x14')](_0x1bd53b[_0xeaa2('0x2c')][_0xeaa2('0x14')]);}return _0x429aae[_0xeaa2('0x47')](_0xf9c622);}})[_0xeaa2('0x1d')](function(_0x2d203b){if(_0x2d203b){return _0x2d203b?{'count':_0x237c66,'rows':_0x2d203b}:null;}})[_0xeaa2('0x1d')](respondWithResult(_0x224501,null))[_0xeaa2('0x3d')](handleError(_0x224501,null));};exports[_0xeaa2('0x4b')]=function(_0x38358b,_0xf4691a,_0x57da06){return db['Action'][_0xeaa2('0x41')]({'where':{'id':_0x38358b['params']['id']}})[_0xeaa2('0x1d')](handleEntityNotFound(_0xf4691a,null))[_0xeaa2('0x1d')](function(_0x448b34){if(_0x448b34){return _0x448b34[_0xeaa2('0x4b')](_0x38358b[_0xeaa2('0x40')][_0xeaa2('0x45')],_['omit'](_0x38358b['body'],[_0xeaa2('0x45'),'id'])||{});}})[_0xeaa2('0x1d')](respondWithResult(_0xf4691a,null))[_0xeaa2('0x3d')](handleError(_0xf4691a,null));};exports[_0xeaa2('0x4c')]=function(_0x53c6ff,_0x1ce58e,_0x2eb7df){var _0x42a95d={};var _0x5dfff2={};var _0x5d3d1a;var _0x5439ec;return db[_0xeaa2('0x25')]['findOne']({'where':{'id':_0x53c6ff[_0xeaa2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ce58e,null))[_0xeaa2('0x1d')](function(_0x426d63){if(_0x426d63){_0x5d3d1a=_0x426d63;_0x5dfff2[_0xeaa2('0x2a')]=_['keys'](db[_0xeaa2('0x4d')][_0xeaa2('0x26')]);_0x5dfff2[_0xeaa2('0x2c')]=_[_0xeaa2('0x2d')](_0x53c6ff[_0xeaa2('0x2c')]);_0x5dfff2[_0xeaa2('0x48')]=_[_0xeaa2('0x2e')](_0x5dfff2[_0xeaa2('0x2a')],_0x5dfff2['query']);_0x42a95d['attributes']=_[_0xeaa2('0x2e')](_0x5dfff2[_0xeaa2('0x2a')],qs[_0xeaa2('0x2f')](_0x53c6ff['query'][_0xeaa2('0x2f')]));_0x42a95d[_0xeaa2('0x30')]=_0x42a95d[_0xeaa2('0x30')][_0xeaa2('0x49')]?_0x42a95d[_0xeaa2('0x30')]:_0x5dfff2[_0xeaa2('0x2a')];_0x42a95d[_0xeaa2('0x32')]=qs[_0xeaa2('0x33')](_0x53c6ff['query']['sort']);_0x42a95d[_0xeaa2('0x34')]=qs[_0xeaa2('0x48')](_['pick'](_0x53c6ff['query'],_0x5dfff2[_0xeaa2('0x48')]));if(_0x53c6ff[_0xeaa2('0x2c')][_0xeaa2('0x36')]){_0x42a95d['where']=_['merge'](_0x42a95d['where'],{'$or':_[_0xeaa2('0x2b')](_0x42a95d[_0xeaa2('0x30')],function(_0x29afc4){var _0x3bbe19={};_0x3bbe19[_0x29afc4]={'$like':'%'+_0x53c6ff['query'][_0xeaa2('0x36')]+'%'};return _0x3bbe19;})});}_0x42a95d=_[_0xeaa2('0x3e')]({},_0x42a95d,_0x53c6ff[_0xeaa2('0x38')]);return _0x5d3d1a[_0xeaa2('0x4c')](_0x42a95d);}})[_0xeaa2('0x1d')](function(_0x2adaf6){if(_0x2adaf6){_0x5439ec=_0x2adaf6[_0xeaa2('0x49')];if(!_0x53c6ff[_0xeaa2('0x2c')][_0xeaa2('0x4a')](_0xeaa2('0x31'))){_0x42a95d[_0xeaa2('0x16')]=qs[_0xeaa2('0x16')](_0x53c6ff[_0xeaa2('0x2c')][_0xeaa2('0x16')]);_0x42a95d[_0xeaa2('0x14')]=qs[_0xeaa2('0x14')](_0x53c6ff[_0xeaa2('0x2c')][_0xeaa2('0x14')]);}return _0x5d3d1a[_0xeaa2('0x4c')](_0x42a95d);}})[_0xeaa2('0x1d')](function(_0x55d4be){if(_0x55d4be){return _0x55d4be?{'count':_0x5439ec,'rows':_0x55d4be}:null;}})['then'](respondWithResult(_0x1ce58e,null))[_0xeaa2('0x3d')](handleError(_0x1ce58e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 8e7f406..6c0330a 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 _0x4d4b=['exports','Automation','tools_automations','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes'];(function(_0x2b1551,_0x1776fe){var _0x2fc2a1=function(_0x5d43c8){while(--_0x5d43c8){_0x2b1551['push'](_0x2b1551['shift']());}};_0x2fc2a1(++_0x1776fe);}(_0x4d4b,0xad));var _0xb4d4=function(_0x465054,_0x17a0a5){_0x465054=_0x465054-0x0;var _0x58779d=_0x4d4b[_0x465054];return _0x58779d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4d4('0x0'))(_0xb4d4('0x1'));var moment=require(_0xb4d4('0x2'));var BPromise=require(_0xb4d4('0x3'));var rp=require(_0xb4d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4d4('0x5'));var attributes=require(_0xb4d4('0x6'));module[_0xb4d4('0x7')]=function(_0xebd58d,_0x508de6){return _0xebd58d['define'](_0xb4d4('0x8'),attributes,{'tableName':_0xb4d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc00=['rimraf','../../config/environment','define','Automation','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x51a61f,_0x414d42){var _0x1cc9e4=function(_0x3538b9){while(--_0x3538b9){_0x51a61f['push'](_0x51a61f['shift']());}};_0x1cc9e4(++_0x414d42);}(_0xdc00,0x1d0));var _0x0dc0=function(_0x160702,_0x17a5d6){_0x160702=_0x160702-0x0;var _0x423111=_0xdc00[_0x160702];return _0x423111;};'use strict';var _=require(_0x0dc0('0x0'));var util=require(_0x0dc0('0x1'));var logger=require(_0x0dc0('0x2'))('api');var moment=require(_0x0dc0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dc0('0x4'));var fs=require('fs');var path=require(_0x0dc0('0x5'));var rimraf=require(_0x0dc0('0x6'));var config=require(_0x0dc0('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x2e2175,_0x26585e){return _0x2e2175[_0x0dc0('0x8')](_0x0dc0('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 1f07896..f5686a5 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 _0x38b8=['client','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x198541,_0x2e1dea){var _0x24c19a=function(_0x28f701){while(--_0x28f701){_0x198541['push'](_0x198541['shift']());}};_0x24c19a(++_0x2e1dea);}(_0x38b8,0x7f));var _0x838b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x38b8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c516c,_0x2d3e96,_0x15184b){return new BPromise(function(_0x4b9530,_0x552245){return client[_0x838b('0x8')](_0x5c516c,_0x15184b)[_0x838b('0x9')](function(_0x31ba84){logger['info'](_0x838b('0xa'),_0x2d3e96,'request\x20sent');logger[_0x838b('0xb')](_0x838b('0xc'),_0x2d3e96,_0x838b('0xd'),JSON[_0x838b('0xe')](_0x31ba84));if(_0x31ba84[_0x838b('0xf')]){if(_0x31ba84[_0x838b('0xf')]['code']===0x1f4){logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);return _0x552245(_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);}logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')]['message']);return _0x4b9530(_0x31ba84[_0x838b('0xf')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x2d3e96,_0x838b('0xd'));_0x4b9530(_0x31ba84[_0x838b('0x11')][_0x838b('0x10')]);}})[_0x838b('0x12')](function(_0x94e893){logger['error'](_0x838b('0xa'),_0x2d3e96,_0x94e893);_0x552245(_0x94e893);});});} \ No newline at end of file +var _0xbc95=['stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x320c98,_0x2198cc){var _0x165b9a=function(_0x5ad223){while(--_0x5ad223){_0x320c98['push'](_0x320c98['shift']());}};_0x165b9a(++_0x2198cc);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x16d972,_0x477088){_0x16d972=_0x16d972-0x0;var _0x384387=_0xbc95[_0x16d972];return _0x384387;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc9('0x5'))(_0x5bc9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5bc9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c02e9,_0x2fb0a2,_0x4bdc20){return new BPromise(function(_0x49ab1a,_0x6cc9f1){return client[_0x5bc9('0x8')](_0x5c02e9,_0x4bdc20)[_0x5bc9('0x9')](function(_0x357d27){logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,'request\x20sent');logger[_0x5bc9('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2fb0a2,'request\x20sent',JSON[_0x5bc9('0xd')](_0x357d27));if(_0x357d27['error']){if(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0xf')]===0x1f4){logger[_0x5bc9('0xe')](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27[_0x5bc9('0xe')]['message']);return _0x6cc9f1(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}logger['error'](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27['error']['message']);return _0x49ab1a(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}else{logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,_0x5bc9('0x11'));_0x49ab1a(_0x357d27[_0x5bc9('0x12')]['message']);}})['catch'](function(_0x617dad){logger[_0x5bc9('0xe')]('Automation,\x20%s,\x20%s',_0x2fb0a2,_0x617dad);_0x6cc9f1(_0x617dad);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 036f08b..0e04ba1 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 _0xf15e=['getConditions','/:id/actions','getActions','create','post','addActions','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions'];(function(_0x5d9f3f,_0x490914){var _0x419bd0=function(_0x44b5eb){while(--_0x44b5eb){_0x5d9f3f['push'](_0x5d9f3f['shift']());}};_0x419bd0(++_0x490914);}(_0xf15e,0xb9));var _0xef15=function(_0x2648d0,_0x3c8c30){_0x2648d0=_0x2648d0-0x0;var _0xb3f94f=_0xf15e[_0x2648d0];return _0xb3f94f;};'use strict';var multer=require(_0xef15('0x0'));var util=require('util');var path=require(_0xef15('0x1'));var timeout=require(_0xef15('0x2'));var express=require(_0xef15('0x3'));var router=express[_0xef15('0x4')]();var fs_extra=require(_0xef15('0x5'));var auth=require(_0xef15('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef15('0x7'));var controller=require(_0xef15('0x8'));router[_0xef15('0x9')]('/',auth[_0xef15('0xa')](),controller['index']);router[_0xef15('0x9')](_0xef15('0xb'),auth[_0xef15('0xa')](),controller['show']);router[_0xef15('0x9')](_0xef15('0xc'),auth[_0xef15('0xa')](),controller[_0xef15('0xd')]);router['get'](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0xf')]);router['post']('/',auth[_0xef15('0xa')](),controller[_0xef15('0x10')]);router[_0xef15('0x11')](_0xef15('0xc'),auth[_0xef15('0xa')](),controller['addConditions']);router['post'](_0xef15('0xe'),auth[_0xef15('0xa')](),controller[_0xef15('0x12')]);router['put'](_0xef15('0xb'),auth['isAuthenticated'](),controller[_0xef15('0x13')]);router[_0xef15('0x14')](_0xef15('0xb'),auth['isAuthenticated'](),controller[_0xef15('0x15')]);module['exports']=router; \ No newline at end of file +var _0xdffe=['getConditions','/:id/actions','getActions','post','create','addConditions','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions'];(function(_0x2f672d,_0x5a2171){var _0x5953a5=function(_0x5d7b99){while(--_0x5d7b99){_0x2f672d['push'](_0x2f672d['shift']());}};_0x5953a5(++_0x5a2171);}(_0xdffe,0x1d2));var _0xedff=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xdffe[_0x3b3f4f];return _0x174dbe;};'use strict';var multer=require('multer');var util=require(_0xedff('0x0'));var path=require('path');var timeout=require(_0xedff('0x1'));var express=require(_0xedff('0x2'));var router=express[_0xedff('0x3')]();var fs_extra=require(_0xedff('0x4'));var auth=require(_0xedff('0x5'));var interaction=require(_0xedff('0x6'));var config=require('../../config/environment');var controller=require(_0xedff('0x7'));router[_0xedff('0x8')]('/',auth[_0xedff('0x9')](),controller[_0xedff('0xa')]);router['get'](_0xedff('0xb'),auth[_0xedff('0x9')](),controller[_0xedff('0xc')]);router[_0xedff('0x8')](_0xedff('0xd'),auth[_0xedff('0x9')](),controller[_0xedff('0xe')]);router[_0xedff('0x8')](_0xedff('0xf'),auth[_0xedff('0x9')](),controller[_0xedff('0x10')]);router[_0xedff('0x11')]('/',auth[_0xedff('0x9')](),controller[_0xedff('0x12')]);router[_0xedff('0x11')](_0xedff('0xd'),auth[_0xedff('0x9')](),controller[_0xedff('0x13')]);router[_0xedff('0x11')]('/:id/actions',auth[_0xedff('0x9')](),controller['addActions']);router['put'](_0xedff('0xb'),auth['isAuthenticated'](),controller[_0xedff('0x14')]);router[_0xedff('0x15')]('/:id',auth[_0xedff('0x9')](),controller[_0xedff('0x16')]);module[_0xedff('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 21dc3fa..911ba16 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 _0xef75=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','sequelize','exports','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x38c213,_0x31ddad){var _0x401bde=function(_0x21459c){while(--_0x21459c){_0x38c213['push'](_0x38c213['shift']());}};_0x401bde(++_0x31ddad);}(_0xef75,0x13e));var _0x5ef7=function(_0x34c62a,_0x112ada){_0x34c62a=_0x34c62a-0x0;var _0x2334e0=_0xef75[_0x34c62a];return _0x2334e0;};'use strict';var Sequelize=require(_0x5ef7('0x0'));module[_0x5ef7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5ef7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x5ef7('0x3')},'description':{'type':Sequelize[_0x5ef7('0x4')]},'active':{'type':Sequelize[_0x5ef7('0x5')],'defaultValue':0x0,'comment':_0x5ef7('0x6')},'limitCalls':{'type':Sequelize[_0x5ef7('0x7')](0x4)[_0x5ef7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5ef7('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5ef7('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5ef7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)[_0x5ef7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)[_0x5ef7('0x8')],'defaultValue':0x3,'comment':_0x5ef7('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x5ef7('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5ef7('0x4')],'defaultValue':_0x5ef7('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5ef7('0x11')](_0x5ef7('0x12'),_0x5ef7('0x13'),'onlyIfOpen'),'defaultValue':_0x5ef7('0x12')},'dialAMDActive':{'type':Sequelize[_0x5ef7('0x5')],'defaultValue':0x0,'comment':_0x5ef7('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5ef7('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x5ef7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5ef7('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5ef7('0x7')](0x9)[_0x5ef7('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5ef7('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5ef7('0x7')](0x9)[_0x5ef7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5ef7('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x5ef7('0x7')](0x9)[_0x5ef7('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5ef7('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5ef7('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5ef7('0x7')](0x9)[_0x5ef7('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5ef7('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5ef7('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5ef7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5ef7('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5ef7('0x11')](_0x5ef7('0x1d'),_0x5ef7('0x1e')),'defaultValue':_0x5ef7('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5ef7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5ef7('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)[_0x5ef7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5ef7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)[_0x5ef7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5ef7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5ef7('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5ef7('0x7')](0x5)[_0x5ef7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5ef7('0x28')}}; \ No newline at end of file +var _0x1f66=['#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x1f66,0xd4));var _0x61f6=function(_0x49980f,_0x58fee9){_0x49980f=_0x49980f-0x0;var _0x398138=_0x1f66[_0x49980f];return _0x398138;};'use strict';var Sequelize=require(_0x61f6('0x0'));module[_0x61f6('0x1')]={'name':{'type':Sequelize[_0x61f6('0x2')],'unique':_0x61f6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x61f6('0x4')](_0x61f6('0x5')),'allowNull':![],'defaultValue':_0x61f6('0x5')},'description':{'type':Sequelize[_0x61f6('0x2')]},'active':{'type':Sequelize[_0x61f6('0x6')],'defaultValue':0x0,'comment':_0x61f6('0x7')},'limitCalls':{'type':Sequelize[_0x61f6('0x8')](0x4)[_0x61f6('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x61f6('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x61f6('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61f6('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61f6('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'comment':_0x61f6('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x61f6('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61f6('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x61f6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x61f6('0x2')],'defaultValue':_0x61f6('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x61f6('0x4')]('always',_0x61f6('0x12'),_0x61f6('0x13')),'defaultValue':_0x61f6('0x14')},'dialAMDActive':{'type':Sequelize[_0x61f6('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x61f6('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x61f6('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x61f6('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x61f6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x61f6('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x61f6('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x61f6('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x61f6('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x61f6('0x8')](0x5)[_0x61f6('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x61f6('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x61f6('0x8')](0x9)[_0x61f6('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x61f6('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x61f6('0x4')](_0x61f6('0x1d'),_0x61f6('0x1e')),'defaultValue':_0x61f6('0x1d')},'dialPrefix':{'type':Sequelize[_0x61f6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x61f6('0x1f')},'dialCutDigit':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x61f6('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)[_0x61f6('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x61f6('0x8')](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)[_0x61f6('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61f6('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)[_0x61f6('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x61f6('0x25')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x61f6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x61f6('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)[_0x61f6('0x9')],'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':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x61f6('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index fabc75a..2547ddc 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 _0x17a5=['cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','end','error','stack','name','send','map','Campaign','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','findAll','catch','show','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','params','getHoppers','findOne','nolimit','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from'];(function(_0x4d32ec,_0x1b7fa7){var _0x428df8=function(_0x2861ae){while(--_0x2861ae){_0x4d32ec['push'](_0x4d32ec['shift']());}};_0x428df8(++_0x1b7fa7);}(_0x17a5,0x1d5));var _0x517a=function(_0x133eb2,_0x56f0b7){_0x133eb2=_0x133eb2-0x0;var _0x5e2761=_0x17a5[_0x133eb2];return _0x5e2761;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x517a('0x0'));var zipdir=require(_0x517a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x517a('0x2'));var moment=require('moment');var BPromise=require(_0x517a('0x3'));var Mustache=require('mustache');var util=require(_0x517a('0x4'));var path=require('path');var sox=require(_0x517a('0x5'));var csv=require(_0x517a('0x6'));var ejs=require(_0x517a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x517a('0x8'));var squel=require(_0x517a('0x9'));var crypto=require(_0x517a('0xa'));var jsforce=require(_0x517a('0xb'));var deskjs=require(_0x517a('0xc'));var toCsv=require(_0x517a('0x6'));var querystring=require(_0x517a('0xd'));var Papa=require(_0x517a('0xe'));var Redis=require(_0x517a('0xf'));var authService=require(_0x517a('0x10'));var qs=require(_0x517a('0x11'));var as=require(_0x517a('0x12'));var hardwareService=require(_0x517a('0x13'));var logger=require(_0x517a('0x14'))('api');var utils=require(_0x517a('0x15'));var config=require(_0x517a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x517a('0x17'))['db'];function respondWithStatusCode(_0x17ad3b,_0x1fc360){_0x1fc360=_0x1fc360||0xcc;return function(_0x2cd178){if(_0x2cd178){return _0x17ad3b[_0x517a('0x18')](_0x1fc360);}return _0x17ad3b[_0x517a('0x19')](_0x1fc360)['end']();};}function respondWithResult(_0x19a7f9,_0x2394e0){_0x2394e0=_0x2394e0||0xc8;return function(_0x3ed49c){if(_0x3ed49c){return _0x19a7f9[_0x517a('0x19')](_0x2394e0)['json'](_0x3ed49c);}};}function respondWithFilteredResult(_0x94af6c,_0x4b6a2e){return function(_0x1f50c1){if(_0x1f50c1){var _0x33f503=typeof _0x4b6a2e[_0x517a('0x1a')]===_0x517a('0x1b')&&typeof _0x4b6a2e['limit']==='undefined';var _0x1a7160=_0x1f50c1[_0x517a('0x1c')];var _0x16650b=_0x33f503?0x0:_0x4b6a2e[_0x517a('0x1a')];var _0xec4143=_0x33f503?_0x1f50c1['count']:_0x4b6a2e[_0x517a('0x1a')]+_0x4b6a2e['limit'];var _0x1584b8;if(_0xec4143>=_0x1a7160){_0xec4143=_0x1a7160;_0x1584b8=0xc8;}else{_0x1584b8=0xce;}_0x94af6c[_0x517a('0x19')](_0x1584b8);return _0x94af6c['set'](_0x517a('0x1d'),_0x16650b+'-'+_0xec4143+'/'+_0x1a7160)['json'](_0x1f50c1);}return null;};}function patchUpdates(_0x3b2a91){return function(_0x17fdec){try{jsonpatch[_0x517a('0x1e')](_0x17fdec,_0x3b2a91,!![]);}catch(_0x1be570){return BPromise[_0x517a('0x1f')](_0x1be570);}return _0x17fdec['save']();};}function saveUpdates(_0x40db40,_0x406bee){return function(_0x4e8c14){if(_0x4e8c14){return _0x4e8c14[_0x517a('0x20')](_0x40db40)[_0x517a('0x21')](function(_0x365201){return _0x365201;});}return null;};}function removeEntity(_0x2ad400,_0x4cc37a){return function(_0x48cd42){if(_0x48cd42){return _0x48cd42[_0x517a('0x22')]()[_0x517a('0x21')](function(){var _0xbc9267=_0x48cd42[_0x517a('0x23')]({'plain':!![]});var _0x16155e=_0x517a('0x24');return db['UserProfileResource'][_0x517a('0x22')]({'where':{'type':_0x16155e,'resourceId':_0xbc9267['id']}})[_0x517a('0x21')](function(){return _0x48cd42;});})[_0x517a('0x21')](function(){_0x2ad400[_0x517a('0x19')](0xcc)[_0x517a('0x25')]();});}};}function handleEntityNotFound(_0x1e58d7,_0x5ea405){return function(_0x30d549){if(!_0x30d549){_0x1e58d7[_0x517a('0x18')](0x194);}return _0x30d549;};}function handleError(_0x396545,_0x305fcc){_0x305fcc=_0x305fcc||0x1f4;return function(_0x249a2e){logger[_0x517a('0x26')](_0x249a2e[_0x517a('0x27')]);if(_0x249a2e[_0x517a('0x28')]){delete _0x249a2e[_0x517a('0x28')];}_0x396545[_0x517a('0x19')](_0x305fcc)[_0x517a('0x29')](_0x249a2e);};}exports['index']=function(_0x26d59f,_0x396d19){var _0x309261={},_0x3fff1a={},_0x39ac10={'count':0x0,'rows':[]};var _0x3dad81=_[_0x517a('0x2a')](db[_0x517a('0x2b')][_0x517a('0x2c')],function(_0x52885){return{'name':_0x52885['fieldName'],'type':_0x52885[_0x517a('0x2d')][_0x517a('0x2e')]};});_0x3fff1a[_0x517a('0x2f')]=_['map'](_0x3dad81,'name');_0x3fff1a['query']=_[_0x517a('0x30')](_0x26d59f['query']);_0x3fff1a[_0x517a('0x31')]=_[_0x517a('0x32')](_0x3fff1a[_0x517a('0x2f')],_0x3fff1a[_0x517a('0x33')]);_0x309261[_0x517a('0x34')]=_[_0x517a('0x32')](_0x3fff1a['model'],qs[_0x517a('0x35')](_0x26d59f[_0x517a('0x33')][_0x517a('0x35')]));_0x309261['attributes']=_0x309261[_0x517a('0x34')][_0x517a('0x36')]?_0x309261['attributes']:_0x3fff1a[_0x517a('0x2f')];if(!_0x26d59f[_0x517a('0x33')][_0x517a('0x37')]('nolimit')){_0x309261['limit']=qs[_0x517a('0x38')](_0x26d59f[_0x517a('0x33')][_0x517a('0x38')]);_0x309261[_0x517a('0x1a')]=qs[_0x517a('0x1a')](_0x26d59f['query'][_0x517a('0x1a')]);}_0x309261[_0x517a('0x39')]=qs[_0x517a('0x3a')](_0x26d59f[_0x517a('0x33')]['sort']);_0x309261['where']=qs[_0x517a('0x31')](_[_0x517a('0x3b')](_0x26d59f['query'],_0x3fff1a[_0x517a('0x31')]),_0x3dad81);if(_0x26d59f[_0x517a('0x33')][_0x517a('0x3c')]){_0x309261[_0x517a('0x3d')]=_[_0x517a('0x3e')](_0x309261[_0x517a('0x3d')],{'$or':_[_0x517a('0x2a')](_0x3dad81,function(_0x4e44af){if(_0x4e44af['type']!=='VIRTUAL'){var _0x355e60={};_0x355e60[_0x4e44af[_0x517a('0x28')]]={'$like':'%'+_0x26d59f[_0x517a('0x33')]['filter']+'%'};return _0x355e60;}})});}_0x309261=_[_0x517a('0x3e')]({},_0x309261,_0x26d59f[_0x517a('0x3f')]);var _0x27f33a={'where':_0x309261[_0x517a('0x3d')]};return db[_0x517a('0x2b')][_0x517a('0x1c')](_0x27f33a)[_0x517a('0x21')](function(_0x550669){_0x39ac10['count']=_0x550669;if(_0x26d59f['query']['includeAll']){_0x309261['include']=[{'all':!![]}];}return db[_0x517a('0x2b')][_0x517a('0x40')](_0x309261);})[_0x517a('0x21')](function(_0x128f26){_0x39ac10['rows']=_0x128f26;return _0x39ac10;})['then'](respondWithFilteredResult(_0x396d19,_0x309261))[_0x517a('0x41')](handleError(_0x396d19,null));};exports[_0x517a('0x42')]=function(_0x447545,_0x4e875d){var _0x537473={'raw':![],'where':{'id':_0x447545['params']['id']}},_0x126723={};_0x126723['model']=_['keys'](db['Campaign'][_0x517a('0x2c')]);_0x126723[_0x517a('0x33')]=_['keys'](_0x447545[_0x517a('0x33')]);_0x126723['filters']=_['intersection'](_0x126723[_0x517a('0x2f')],_0x126723[_0x517a('0x33')]);_0x537473[_0x517a('0x34')]=_['intersection'](_0x126723[_0x517a('0x2f')],qs[_0x517a('0x35')](_0x447545['query'][_0x517a('0x35')]));_0x537473['attributes']=_0x537473[_0x517a('0x34')][_0x517a('0x36')]?_0x537473[_0x517a('0x34')]:_0x126723[_0x517a('0x2f')];if(_0x447545[_0x517a('0x33')][_0x517a('0x43')]){_0x537473['include']=[{'all':!![]}];}_0x537473=_['merge']({},_0x537473,_0x447545[_0x517a('0x3f')]);return db[_0x517a('0x2b')][_0x517a('0x44')](_0x537473)[_0x517a('0x21')](handleEntityNotFound(_0x4e875d,null))[_0x517a('0x21')](respondWithResult(_0x4e875d,null))[_0x517a('0x41')](handleError(_0x4e875d,null));};exports[_0x517a('0x45')]=function(_0x158aa9,_0x54b676){return db[_0x517a('0x2b')][_0x517a('0x45')](_0x158aa9[_0x517a('0x46')],{})[_0x517a('0x21')](function(_0x5e119b){var _0x1fd1e7=_0x158aa9[_0x517a('0x47')][_0x517a('0x23')]({'plain':!![]});if(!_0x1fd1e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fd1e7[_0x517a('0x48')]===_0x517a('0x47')){var _0x31c0cc=_0x5e119b[_0x517a('0x23')]({'plain':!![]});var _0x603e77=_0x517a('0x24');return db[_0x517a('0x49')][_0x517a('0x44')]({'where':{'name':_0x603e77,'userProfileId':_0x1fd1e7[_0x517a('0x4a')]},'raw':!![]})['then'](function(_0x56d461){if(_0x56d461&&_0x56d461[_0x517a('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x31c0cc[_0x517a('0x28')],'resourceId':_0x31c0cc['id'],'type':_0x56d461['name'],'sectionId':_0x56d461['id']},{})['then'](function(){return _0x5e119b;});}else{return _0x5e119b;}})[_0x517a('0x41')](function(_0x16400d){logger[_0x517a('0x26')](_0x517a('0x4c'),_0x16400d);throw _0x16400d;});}return _0x5e119b;})['then'](respondWithResult(_0x54b676,0xc9))[_0x517a('0x41')](handleError(_0x54b676,null));};exports[_0x517a('0x4d')]=function(_0x20ee67,_0x39b839){var _0x560b2d={'where':{'id':_0x20ee67['params']['id']}},_0x5d207b={};_0x5d207b[_0x517a('0x2f')]=_[_0x517a('0x30')](db[_0x517a('0x2b')][_0x517a('0x2c')]);_0x560b2d['attributes']=_['intersection'](_0x5d207b['model'],qs[_0x517a('0x35')](_0x20ee67[_0x517a('0x33')][_0x517a('0x35')]));_0x560b2d[_0x517a('0x34')]=_0x560b2d['attributes'][_0x517a('0x36')]?_0x560b2d[_0x517a('0x34')]:_0x5d207b[_0x517a('0x2f')];if(_0x20ee67[_0x517a('0x33')][_0x517a('0x43')]){_0x560b2d[_0x517a('0x4e')]=[{'all':!![]}];}_0x560b2d=_[_0x517a('0x3e')]({},_0x560b2d,_0x20ee67[_0x517a('0x3f')]);return db[_0x517a('0x2b')][_0x517a('0x44')](_0x560b2d)['then'](handleEntityNotFound(_0x39b839,null))[_0x517a('0x21')](function(_0x306bfd){if(_0x306bfd){var _0x47484e=_0x306bfd['get']({'plain':!![]});_0x47484e=qs[_0x517a('0x4f')](_0x47484e,['id',_0x517a('0x50'),_0x517a('0x51')]);_0x20ee67[_0x517a('0x46')]=_[_0x517a('0x4f')](_0x20ee67[_0x517a('0x46')],['id',_0x517a('0x50'),_0x517a('0x51')]);return db['Campaign'][_0x517a('0x45')](_[_0x517a('0x3e')](_0x47484e,_0x20ee67['body']),{'include':_0x20ee67['query'][_0x517a('0x43')]?[{'all':!![]}]:undefined})[_0x517a('0x21')](function(_0x24041a){var _0x4ad036=_0x20ee67[_0x517a('0x47')][_0x517a('0x23')]({'plain':!![]});if(!_0x4ad036)throw new Error(_0x517a('0x52'));if(_0x4ad036[_0x517a('0x48')]==='user'){var _0x610682=_0x24041a['get']({'plain':!![]});var _0x12a90a=_0x517a('0x24');return db[_0x517a('0x49')][_0x517a('0x44')]({'where':{'name':_0x12a90a,'userProfileId':_0x4ad036['userProfileId']},'raw':!![]})[_0x517a('0x21')](function(_0xea8685){if(_0xea8685&&_0xea8685[_0x517a('0x4b')]===0x0){return db[_0x517a('0x53')][_0x517a('0x45')]({'name':_0x610682['name'],'resourceId':_0x610682['id'],'type':_0xea8685[_0x517a('0x28')],'sectionId':_0xea8685['id']},{})[_0x517a('0x21')](function(){return _0x24041a;});}else{return _0x24041a;}})['catch'](function(_0x50d39c){logger['error'](_0x517a('0x4c'),_0x50d39c);throw _0x50d39c;});}return _0x24041a;});}})['then'](respondWithResult(_0x39b839,0xc9))[_0x517a('0x41')](handleError(_0x39b839,null));};exports[_0x517a('0x20')]=function(_0x17d3c4,_0x537c2d){if(_0x17d3c4['body']['id']){delete _0x17d3c4[_0x517a('0x46')]['id'];}return db['Campaign'][_0x517a('0x44')]({'where':{'id':_0x17d3c4[_0x517a('0x54')]['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x537c2d,null))[_0x517a('0x21')](saveUpdates(_0x17d3c4['body'],null))[_0x517a('0x21')](respondWithResult(_0x537c2d,null))['catch'](handleError(_0x537c2d,null));};exports[_0x517a('0x22')]=function(_0x2c3f71,_0x3af599){return db['Campaign']['find']({'where':{'id':_0x2c3f71[_0x517a('0x54')]['id']}})['then'](handleEntityNotFound(_0x3af599,null))[_0x517a('0x21')](removeEntity(_0x3af599,null))[_0x517a('0x41')](handleError(_0x3af599,null));};exports[_0x517a('0x55')]=function(_0x290c90,_0x21d15c,_0x32ec63){var _0x290a46={'raw':!![],'where':{}};var _0x5a7523={};var _0x48e7e1={'count':0x0,'rows':[]};return db['Campaign'][_0x517a('0x56')]({'where':{'id':_0x290c90['params']['id']}})['then'](handleEntityNotFound(_0x21d15c,null))['then'](function(_0x503f8e){if(_0x503f8e){_0x5a7523[_0x517a('0x2f')]=_[_0x517a('0x30')](db['CmHopper'][_0x517a('0x2c')]);_0x5a7523[_0x517a('0x33')]=_['keys'](_0x290c90[_0x517a('0x33')]);_0x5a7523['filters']=_['intersection'](_0x5a7523[_0x517a('0x2f')],_0x5a7523['query']);_0x290a46['attributes']=_[_0x517a('0x32')](_0x5a7523[_0x517a('0x2f')],qs[_0x517a('0x35')](_0x290c90[_0x517a('0x33')][_0x517a('0x35')]));_0x290a46[_0x517a('0x34')]=_0x290a46['attributes'][_0x517a('0x36')]?_0x290a46[_0x517a('0x34')]:_0x5a7523[_0x517a('0x2f')];if(!_0x290c90[_0x517a('0x33')][_0x517a('0x37')](_0x517a('0x57'))){_0x290a46[_0x517a('0x38')]=qs['limit'](_0x290c90[_0x517a('0x33')][_0x517a('0x38')]);_0x290a46[_0x517a('0x1a')]=qs[_0x517a('0x1a')](_0x290c90[_0x517a('0x33')][_0x517a('0x1a')]);}_0x290a46[_0x517a('0x39')]=qs[_0x517a('0x3a')](_0x290c90[_0x517a('0x33')][_0x517a('0x3a')]);_0x290a46[_0x517a('0x3d')]=qs[_0x517a('0x31')](_[_0x517a('0x3b')](_0x290c90[_0x517a('0x33')],_0x5a7523[_0x517a('0x31')]));_0x290a46[_0x517a('0x3d')][_0x517a('0x58')]=_0x503f8e['id'];if(_0x290c90[_0x517a('0x33')][_0x517a('0x3c')]){_0x290a46[_0x517a('0x3d')]=_['merge'](_0x290a46[_0x517a('0x3d')],{'$or':_[_0x517a('0x2a')](_0x290a46['attributes'],function(_0x25377a){var _0x3c503e={};_0x3c503e[_0x25377a]={'$like':'%'+_0x290c90['query'][_0x517a('0x3c')]+'%'};return _0x3c503e;})});}_0x290a46=_['merge']({},_0x290a46,_0x290c90[_0x517a('0x3f')]);return db['CmHopper'][_0x517a('0x1c')]({'where':_0x290a46[_0x517a('0x3d')]})['then'](function(_0x432d3d){_0x48e7e1['count']=_0x432d3d;if(_0x290c90[_0x517a('0x33')][_0x517a('0x43')]){_0x290a46[_0x517a('0x4e')]=[{'all':!![]}];}return db[_0x517a('0x59')]['findAll'](_0x290a46);})[_0x517a('0x21')](function(_0x55ce73){_0x48e7e1[_0x517a('0x5a')]=_0x55ce73;return _0x48e7e1;});}})[_0x517a('0x21')](respondWithFilteredResult(_0x21d15c,_0x290a46))[_0x517a('0x41')](handleError(_0x21d15c,null));};exports[_0x517a('0x5b')]=function(_0x376e17,_0x2a863d,_0x1a92e2){var _0x1b2933={'raw':!![],'where':{}};var _0x1dbafd={};var _0xbaec52={'count':0x0,'rows':[]};return db[_0x517a('0x2b')][_0x517a('0x56')]({'where':{'id':_0x376e17[_0x517a('0x54')]['id']}})['then'](handleEntityNotFound(_0x2a863d,null))[_0x517a('0x21')](function(_0x3423da){if(_0x3423da){_0x1dbafd[_0x517a('0x2f')]=_[_0x517a('0x30')](db['CmHopperHistory'][_0x517a('0x2c')]);_0x1dbafd[_0x517a('0x33')]=_[_0x517a('0x30')](_0x376e17['query']);_0x1dbafd[_0x517a('0x31')]=_[_0x517a('0x32')](_0x1dbafd[_0x517a('0x2f')],_0x1dbafd[_0x517a('0x33')]);_0x1b2933[_0x517a('0x34')]=_[_0x517a('0x32')](_0x1dbafd[_0x517a('0x2f')],qs[_0x517a('0x35')](_0x376e17[_0x517a('0x33')][_0x517a('0x35')]));_0x1b2933['attributes']=_0x1b2933[_0x517a('0x34')]['length']?_0x1b2933['attributes']:_0x1dbafd[_0x517a('0x2f')];if(!_0x376e17['query']['hasOwnProperty'](_0x517a('0x57'))){_0x1b2933['limit']=qs[_0x517a('0x38')](_0x376e17[_0x517a('0x33')][_0x517a('0x38')]);_0x1b2933[_0x517a('0x1a')]=qs['offset'](_0x376e17['query'][_0x517a('0x1a')]);}_0x1b2933[_0x517a('0x39')]=qs[_0x517a('0x3a')](_0x376e17[_0x517a('0x33')][_0x517a('0x3a')]);_0x1b2933['where']=qs[_0x517a('0x31')](_['pick'](_0x376e17[_0x517a('0x33')],_0x1dbafd[_0x517a('0x31')]));_0x1b2933[_0x517a('0x3d')]['CampaignId']=_0x3423da['id'];if(_0x376e17['query'][_0x517a('0x3c')]){_0x1b2933[_0x517a('0x3d')]=_['merge'](_0x1b2933[_0x517a('0x3d')],{'$or':_['map'](_0x1b2933[_0x517a('0x34')],function(_0x1a30b9){var _0x1eec3e={};_0x1eec3e[_0x1a30b9]={'$like':'%'+_0x376e17[_0x517a('0x33')][_0x517a('0x3c')]+'%'};return _0x1eec3e;})});}_0x1b2933=_['merge']({},_0x1b2933,_0x376e17[_0x517a('0x3f')]);return db[_0x517a('0x5c')][_0x517a('0x1c')]({'where':_0x1b2933[_0x517a('0x3d')]})[_0x517a('0x21')](function(_0x1b505b){_0xbaec52['count']=_0x1b505b;if(_0x376e17[_0x517a('0x33')]['includeAll']){_0x1b2933[_0x517a('0x4e')]=[{'all':!![]}];}return db[_0x517a('0x5c')][_0x517a('0x40')](_0x1b2933);})['then'](function(_0x67cb99){_0xbaec52[_0x517a('0x5a')]=_0x67cb99;return _0xbaec52;});}})[_0x517a('0x21')](respondWithFilteredResult(_0x2a863d,_0x1b2933))[_0x517a('0x41')](handleError(_0x2a863d,null));};exports['getHopperFinals']=function(_0x431671,_0x2cd0c1,_0x34f1f9){var _0x15b7a2={'raw':!![],'where':{}};var _0x308348={};var _0x3a92ad={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x431671['params']['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x2cd0c1,null))['then'](function(_0x10ddf0){if(_0x10ddf0){_0x308348[_0x517a('0x2f')]=_[_0x517a('0x30')](db[_0x517a('0x5d')]['rawAttributes']);_0x308348[_0x517a('0x33')]=_[_0x517a('0x30')](_0x431671[_0x517a('0x33')]);_0x308348[_0x517a('0x31')]=_[_0x517a('0x32')](_0x308348[_0x517a('0x2f')],_0x308348['query']);_0x15b7a2[_0x517a('0x34')]=_['intersection'](_0x308348['model'],qs[_0x517a('0x35')](_0x431671[_0x517a('0x33')][_0x517a('0x35')]));_0x15b7a2[_0x517a('0x34')]=_0x15b7a2[_0x517a('0x34')][_0x517a('0x36')]?_0x15b7a2['attributes']:_0x308348['model'];if(!_0x431671['query'][_0x517a('0x37')](_0x517a('0x57'))){_0x15b7a2[_0x517a('0x38')]=qs['limit'](_0x431671[_0x517a('0x33')][_0x517a('0x38')]);_0x15b7a2[_0x517a('0x1a')]=qs['offset'](_0x431671[_0x517a('0x33')][_0x517a('0x1a')]);}_0x15b7a2[_0x517a('0x39')]=qs[_0x517a('0x3a')](_0x431671[_0x517a('0x33')][_0x517a('0x3a')]);_0x15b7a2[_0x517a('0x3d')]=qs[_0x517a('0x31')](_['pick'](_0x431671[_0x517a('0x33')],_0x308348[_0x517a('0x31')]));_0x15b7a2[_0x517a('0x3d')][_0x517a('0x58')]=_0x10ddf0['id'];if(_0x431671['query'][_0x517a('0x3c')]){_0x15b7a2[_0x517a('0x3d')]=_['merge'](_0x15b7a2[_0x517a('0x3d')],{'$or':_['map'](_0x15b7a2[_0x517a('0x34')],function(_0xc1a31d){var _0x505ed7={};_0x505ed7[_0xc1a31d]={'$like':'%'+_0x431671[_0x517a('0x33')][_0x517a('0x3c')]+'%'};return _0x505ed7;})});}_0x15b7a2=_[_0x517a('0x3e')]({},_0x15b7a2,_0x431671[_0x517a('0x3f')]);return db[_0x517a('0x5d')][_0x517a('0x1c')]({'where':_0x15b7a2[_0x517a('0x3d')]})['then'](function(_0x24b9ee){_0x3a92ad[_0x517a('0x1c')]=_0x24b9ee;if(_0x431671[_0x517a('0x33')]['includeAll']){_0x15b7a2[_0x517a('0x4e')]=[{'all':!![]}];}return db[_0x517a('0x5d')][_0x517a('0x40')](_0x15b7a2);})[_0x517a('0x21')](function(_0x3696e1){_0x3a92ad[_0x517a('0x5a')]=_0x3696e1;return _0x3a92ad;});}})[_0x517a('0x21')](respondWithFilteredResult(_0x2cd0c1,_0x15b7a2))[_0x517a('0x41')](handleError(_0x2cd0c1,null));};exports[_0x517a('0x5e')]=function(_0x573c89,_0x5e7ef3,_0xdf7b99){var _0x286bf6={'raw':!![],'where':{}};var _0x22cc11={};var _0x1b5094={'count':0x0,'rows':[]};return db['Campaign'][_0x517a('0x56')]({'where':{'id':_0x573c89['params']['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x5e7ef3,null))[_0x517a('0x21')](function(_0x1002f0){if(_0x1002f0){_0x22cc11[_0x517a('0x2f')]=_['keys'](db[_0x517a('0x5f')][_0x517a('0x2c')]);_0x22cc11[_0x517a('0x33')]=_['keys'](_0x573c89[_0x517a('0x33')]);_0x22cc11['filters']=_['intersection'](_0x22cc11['model'],_0x22cc11['query']);_0x286bf6[_0x517a('0x34')]=_[_0x517a('0x32')](_0x22cc11['model'],qs[_0x517a('0x35')](_0x573c89['query'][_0x517a('0x35')]));_0x286bf6[_0x517a('0x34')]=_0x286bf6[_0x517a('0x34')][_0x517a('0x36')]?_0x286bf6['attributes']:_0x22cc11[_0x517a('0x2f')];if(!_0x573c89[_0x517a('0x33')][_0x517a('0x37')](_0x517a('0x57'))){_0x286bf6[_0x517a('0x38')]=qs[_0x517a('0x38')](_0x573c89[_0x517a('0x33')][_0x517a('0x38')]);_0x286bf6[_0x517a('0x1a')]=qs['offset'](_0x573c89[_0x517a('0x33')]['offset']);}_0x286bf6['order']=qs['sort'](_0x573c89[_0x517a('0x33')][_0x517a('0x3a')]);_0x286bf6['where']=qs['filters'](_[_0x517a('0x3b')](_0x573c89['query'],_0x22cc11['filters']));_0x286bf6[_0x517a('0x3d')][_0x517a('0x58')]=_0x1002f0['id'];if(_0x573c89[_0x517a('0x33')][_0x517a('0x3c')]){_0x286bf6[_0x517a('0x3d')]=_['merge'](_0x286bf6['where'],{'$or':_[_0x517a('0x2a')](_0x286bf6[_0x517a('0x34')],function(_0x141daf){var _0x59af7e={};_0x59af7e[_0x141daf]={'$like':'%'+_0x573c89[_0x517a('0x33')][_0x517a('0x3c')]+'%'};return _0x59af7e;})});}_0x286bf6=_['merge']({},_0x286bf6,_0x573c89['options']);return db[_0x517a('0x5f')]['count']({'where':_0x286bf6['where']})[_0x517a('0x21')](function(_0x1cfb46){_0x1b5094[_0x517a('0x1c')]=_0x1cfb46;if(_0x573c89[_0x517a('0x33')]['includeAll']){_0x286bf6['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x517a('0x40')](_0x286bf6);})[_0x517a('0x21')](function(_0x29be1a){_0x1b5094[_0x517a('0x5a')]=_0x29be1a;return _0x1b5094;});}})[_0x517a('0x21')](respondWithFilteredResult(_0x5e7ef3,_0x286bf6))[_0x517a('0x41')](handleError(_0x5e7ef3,null));};exports['getLists']=function(_0x1d445e,_0x3c9cb0,_0x4d880d){var _0x5ddf0c={};var _0x2dc17b={};var _0xf17a5d;var _0x38340d;return db[_0x517a('0x2b')]['findOne']({'where':{'id':_0x1d445e[_0x517a('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c9cb0,null))[_0x517a('0x21')](function(_0x5ef3de){if(_0x5ef3de){_0xf17a5d=_0x5ef3de;_0x2dc17b[_0x517a('0x2f')]=_['keys'](db[_0x517a('0x60')][_0x517a('0x2c')]);_0x2dc17b[_0x517a('0x33')]=_['keys'](_0x1d445e[_0x517a('0x33')]);_0x2dc17b[_0x517a('0x31')]=_[_0x517a('0x32')](_0x2dc17b['model'],_0x2dc17b[_0x517a('0x33')]);_0x5ddf0c['attributes']=_[_0x517a('0x32')](_0x2dc17b['model'],qs[_0x517a('0x35')](_0x1d445e[_0x517a('0x33')][_0x517a('0x35')]));_0x5ddf0c[_0x517a('0x34')]=_0x5ddf0c[_0x517a('0x34')]['length']?_0x5ddf0c[_0x517a('0x34')]:_0x2dc17b[_0x517a('0x2f')];_0x5ddf0c['order']=qs['sort'](_0x1d445e[_0x517a('0x33')][_0x517a('0x3a')]);_0x5ddf0c[_0x517a('0x3d')]=qs[_0x517a('0x31')](_['pick'](_0x1d445e[_0x517a('0x33')],_0x2dc17b[_0x517a('0x31')]));if(_0x1d445e['query']['filter']){_0x5ddf0c[_0x517a('0x3d')]=_[_0x517a('0x3e')](_0x5ddf0c['where'],{'$or':_['map'](_0x5ddf0c[_0x517a('0x34')],function(_0x6ae846){var _0x50a94d={};_0x50a94d[_0x6ae846]={'$like':'%'+_0x1d445e[_0x517a('0x33')][_0x517a('0x3c')]+'%'};return _0x50a94d;})});}_0x5ddf0c=_[_0x517a('0x3e')]({},_0x5ddf0c,_0x1d445e['options']);return _0xf17a5d[_0x517a('0x61')](_0x5ddf0c);}})['then'](function(_0x1dcf9c){if(_0x1dcf9c){_0x38340d=_0x1dcf9c[_0x517a('0x36')];if(!_0x1d445e[_0x517a('0x33')][_0x517a('0x37')](_0x517a('0x57'))){_0x5ddf0c['limit']=qs['limit'](_0x1d445e['query'][_0x517a('0x38')]);_0x5ddf0c[_0x517a('0x1a')]=qs[_0x517a('0x1a')](_0x1d445e[_0x517a('0x33')][_0x517a('0x1a')]);}return _0xf17a5d[_0x517a('0x61')](_0x5ddf0c);}})['then'](function(_0x284603){if(_0x284603){return _0x284603?{'count':_0x38340d,'rows':_0x284603}:null;}})[_0x517a('0x21')](respondWithResult(_0x3c9cb0,null))[_0x517a('0x41')](handleError(_0x3c9cb0,null));};exports['addLists']=function(_0x29deb0,_0x1c1ba0,_0x3b14d1){var _0x146841,_0x37adec;var _0x1157b3=[];var _0x34b32b=moment()[_0x517a('0x62')](_0x517a('0x63'));return db['Campaign'][_0x517a('0x44')]({'where':{'id':_0x29deb0[_0x517a('0x54')]['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x1c1ba0,null))[_0x517a('0x21')](function(_0x507227){if(_0x507227){_0x37adec=_0x507227;return _0x507227[_0x517a('0x64')](_0x29deb0[_0x517a('0x46')][_0x517a('0x65')],_[_0x517a('0x4f')](_0x29deb0[_0x517a('0x46')],[_0x517a('0x65'),'id'])||{});}return null;})[_0x517a('0x66')](function(_0xf1eb84){var _0x5e0da8;var _0x20b40c;_0x146841=_0xf1eb84||[];var _0x5dcce7=[];if(_0xf1eb84){for(var _0x16ab56=0x0;_0x16ab56<_0xf1eb84[_0x517a('0x36')];_0x16ab56+=0x1){var _0x3b1632=_0xf1eb84[_0x16ab56][_0x517a('0x23')]({'plain':!![]});_0x37adec['dialCheckDuplicateType']=_0x29deb0[_0x517a('0x46')]['dialCheckDuplicateType']?_0x29deb0[_0x517a('0x46')][_0x517a('0x67')]:_0x37adec[_0x517a('0x67')];switch(_0x37adec['dialCheckDuplicateType']){case _0x517a('0x68'):_0x5e0da8=squel[_0x517a('0x69')]()[_0x517a('0x6a')](_0x517a('0x6b'))[_0x517a('0x6c')](['phone',_0x517a('0x6d'),'ContactId',_0x517a('0x6e'),_0x517a('0x58'),_0x517a('0x50'),_0x517a('0x51')],squel[_0x517a('0x6f')]()[_0x517a('0x70')](_0x517a('0x71'),_0x517a('0x71'))['field'](_0x517a('0x72'),_0x517a('0x6d'))[_0x517a('0x70')]('id',_0x517a('0x73'))[_0x517a('0x70')](_0x3b1632[_0x517a('0x74')]['toString'](),_0x517a('0x6e'))[_0x517a('0x70')](_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')](),'CampaignId')[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x50'))[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x51'))[_0x517a('0x76')](_0x517a('0x77'))[_0x517a('0x3d')](_0x517a('0x78'))['where'](_0x517a('0x79'),_0x3b1632['CmListId'][_0x517a('0x75')]())['where'](_0x517a('0x7a'))['where'](_0x517a('0x7b'),squel[_0x517a('0x6f')]()['field'](_0x517a('0x7c'))[_0x517a('0x76')](_0x517a('0x7d'))[_0x517a('0x3d')]('CampaignId\x20=\x20?',_0x29deb0['params']['id'][_0x517a('0x75')]()))[_0x517a('0x3d')](_0x517a('0x7b'),squel[_0x517a('0x6f')]()[_0x517a('0x70')](_0x517a('0x7e'))[_0x517a('0x76')](_0x517a('0x6b'))[_0x517a('0x3d')]('CampaignId\x20=\x20?',_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')]())))[_0x517a('0x75')]();break;case'onlyIfOpen':_0x5e0da8=squel['insert']()[_0x517a('0x6a')](_0x517a('0x6b'))['fromQuery']([_0x517a('0x71'),_0x517a('0x6d'),'ContactId','ListId',_0x517a('0x58'),_0x517a('0x50'),_0x517a('0x51')],squel[_0x517a('0x6f')]()['field'](_0x517a('0x71'),_0x517a('0x71'))[_0x517a('0x70')](_0x517a('0x72'),_0x517a('0x6d'))[_0x517a('0x70')]('id',_0x517a('0x73'))[_0x517a('0x70')](_0x3b1632[_0x517a('0x74')][_0x517a('0x75')](),'ListId')['field'](_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')](),'CampaignId')[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x50'))[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x51'))[_0x517a('0x76')](_0x517a('0x77'))[_0x517a('0x3d')]('deletedAt\x20IS\x20NULL')[_0x517a('0x3d')](_0x517a('0x79'),_0x3b1632[_0x517a('0x74')][_0x517a('0x75')]())[_0x517a('0x3d')](_0x517a('0x7a'))[_0x517a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x517a('0x7e'))[_0x517a('0x76')](_0x517a('0x6b'))['where'](_0x517a('0x7f'),_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')]())))[_0x517a('0x75')]();break;default:_0x5e0da8=squel['insert']()[_0x517a('0x6a')](_0x517a('0x6b'))[_0x517a('0x6c')]([_0x517a('0x71'),_0x517a('0x6d'),_0x517a('0x73'),_0x517a('0x6e'),'CampaignId',_0x517a('0x50'),_0x517a('0x51')],squel[_0x517a('0x6f')]()[_0x517a('0x70')](_0x517a('0x71'),_0x517a('0x71'))[_0x517a('0x70')](_0x517a('0x72'),_0x517a('0x6d'))[_0x517a('0x70')]('id',_0x517a('0x73'))[_0x517a('0x70')](_0x3b1632['CmListId'][_0x517a('0x75')](),'ListId')[_0x517a('0x70')](_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')](),_0x517a('0x58'))['field']('\x27'+_0x34b32b+'\x27',_0x517a('0x50'))['field']('\x27'+_0x34b32b+'\x27',_0x517a('0x51'))[_0x517a('0x76')]('cm_contacts')[_0x517a('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x3b1632['CmListId'][_0x517a('0x75')]())[_0x517a('0x3d')](_0x517a('0x7a')))[_0x517a('0x75')]();}_0x20b40c=squel[_0x517a('0x69')]()['into'](_0x517a('0x80'))[_0x517a('0x6c')]([_0x517a('0x81'),'scheduledAt',_0x517a('0x71'),_0x517a('0x82'),_0x517a('0x50'),_0x517a('0x51')],squel[_0x517a('0x6f')]()[_0x517a('0x70')](_0x517a('0x83'),'id')[_0x517a('0x70')](_0x517a('0x72'),'scheduledAt')[_0x517a('0x70')](_0x517a('0x84'),_0x517a('0x71'))[_0x517a('0x70')](_0x517a('0x85'),_0x517a('0x82'))[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x50'))[_0x517a('0x70')]('\x27'+_0x34b32b+'\x27',_0x517a('0x51'))[_0x517a('0x76')](_0x517a('0x86'),'ci')[_0x517a('0x87')](_0x517a('0x6b'),'h',_0x517a('0x88'))['where'](_0x517a('0x89'),_0x3b1632['CmListId'][_0x517a('0x75')]())[_0x517a('0x3d')]('h.CampaignId=?',_0x29deb0[_0x517a('0x54')]['id'][_0x517a('0x75')]())[_0x517a('0x3d')](_0x517a('0x8a'),_0x34b32b))[_0x517a('0x75')]();_0x5dcce7['push'](db['sequelize'][_0x517a('0x33')](_0x5e0da8));_0x1157b3[_0x517a('0x8b')](db[_0x517a('0x8c')][_0x517a('0x33')](_0x20b40c));}return BPromise['all'](_0x5dcce7);}})[_0x517a('0x21')](function(){return BPromise['all'](_0x1157b3);})['then'](function(){return _0x146841;})['then'](respondWithResult(_0x1c1ba0,null))['catch'](handleError(_0x1c1ba0,null));};exports['removeLists']=function(_0x48c95b,_0x5d09e6,_0x3ca0f7){return db['Campaign'][_0x517a('0x44')]({'where':{'id':_0x48c95b[_0x517a('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d09e6,null))[_0x517a('0x21')](function(_0x2e0925){if(_0x2e0925){return _0x2e0925[_0x517a('0x8d')](_0x48c95b['query'][_0x517a('0x65')]);}})['then'](function(_0x416903){if(_0x416903){return db['CmHopper'][_0x517a('0x22')]({'where':{'ListId':_0x48c95b['query'][_0x517a('0x65')],'CampaignId':_0x48c95b['params']['id']}})['then'](function(){return _0x416903;});}})[_0x517a('0x21')](respondWithStatusCode(_0x5d09e6,null))[_0x517a('0x41')](handleError(_0x5d09e6,null));};exports['getBlackLists']=function(_0x3d2572,_0x36c332,_0xe4ea2){var _0x29c1b5={};var _0xfdf2e5={};var _0x775354;var _0x36a28e;return db[_0x517a('0x2b')][_0x517a('0x56')]({'where':{'id':_0x3d2572[_0x517a('0x54')]['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x36c332,null))[_0x517a('0x21')](function(_0x125014){if(_0x125014){_0x775354=_0x125014;_0xfdf2e5[_0x517a('0x2f')]=_[_0x517a('0x30')](db['CmList'][_0x517a('0x2c')]);_0xfdf2e5[_0x517a('0x33')]=_[_0x517a('0x30')](_0x3d2572[_0x517a('0x33')]);_0xfdf2e5['filters']=_[_0x517a('0x32')](_0xfdf2e5[_0x517a('0x2f')],_0xfdf2e5['query']);_0x29c1b5['attributes']=_[_0x517a('0x32')](_0xfdf2e5[_0x517a('0x2f')],qs['fields'](_0x3d2572[_0x517a('0x33')][_0x517a('0x35')]));_0x29c1b5[_0x517a('0x34')]=_0x29c1b5['attributes'][_0x517a('0x36')]?_0x29c1b5[_0x517a('0x34')]:_0xfdf2e5[_0x517a('0x2f')];_0x29c1b5['order']=qs[_0x517a('0x3a')](_0x3d2572['query'][_0x517a('0x3a')]);_0x29c1b5['where']=qs[_0x517a('0x31')](_[_0x517a('0x3b')](_0x3d2572[_0x517a('0x33')],_0xfdf2e5[_0x517a('0x31')]));if(_0x3d2572[_0x517a('0x33')][_0x517a('0x3c')]){_0x29c1b5[_0x517a('0x3d')]=_[_0x517a('0x3e')](_0x29c1b5[_0x517a('0x3d')],{'$or':_['map'](_0x29c1b5[_0x517a('0x34')],function(_0x3c4143){var _0x13d97e={};_0x13d97e[_0x3c4143]={'$like':'%'+_0x3d2572[_0x517a('0x33')][_0x517a('0x3c')]+'%'};return _0x13d97e;})});}_0x29c1b5=_[_0x517a('0x3e')]({},_0x29c1b5,_0x3d2572[_0x517a('0x3f')]);return _0x775354[_0x517a('0x8e')](_0x29c1b5);}})['then'](function(_0x3cd7ef){if(_0x3cd7ef){_0x36a28e=_0x3cd7ef['length'];if(!_0x3d2572['query'][_0x517a('0x37')](_0x517a('0x57'))){_0x29c1b5[_0x517a('0x38')]=qs[_0x517a('0x38')](_0x3d2572['query'][_0x517a('0x38')]);_0x29c1b5[_0x517a('0x1a')]=qs[_0x517a('0x1a')](_0x3d2572['query']['offset']);}return _0x775354[_0x517a('0x8e')](_0x29c1b5);}})[_0x517a('0x21')](function(_0x2012bc){if(_0x2012bc){return _0x2012bc?{'count':_0x36a28e,'rows':_0x2012bc}:null;}})['then'](respondWithResult(_0x36c332,null))[_0x517a('0x41')](handleError(_0x36c332,null));};exports[_0x517a('0x8f')]=function(_0x226765,_0x1f5215,_0x12f0e1){var _0x1fc780,_0x1ecdd9;var _0x22c2d8=[];var _0xe30450=moment()[_0x517a('0x62')](_0x517a('0x63'));return db['Campaign'][_0x517a('0x44')]({'where':{'id':_0x226765[_0x517a('0x54')]['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x1f5215,null))['then'](function(_0x41b195){if(_0x41b195){_0x1ecdd9=_0x41b195;return _0x41b195[_0x517a('0x8f')](_0x226765[_0x517a('0x46')][_0x517a('0x65')],_[_0x517a('0x4f')](_0x226765[_0x517a('0x46')],[_0x517a('0x65'),'id'])||{});}return null;})[_0x517a('0x66')](function(_0x2c48af){var _0x2fa78e;var _0x32a0ab;_0x1fc780=_0x2c48af||[];var _0x19a06c=[];if(_0x2c48af){for(var _0xbacf9f=0x0;_0xbacf9f<_0x2c48af[_0x517a('0x36')];_0xbacf9f+=0x1){var _0x4db6e0=_0x2c48af[_0xbacf9f][_0x517a('0x23')]({'plain':!![]});_0x2fa78e=squel[_0x517a('0x69')]()['into'](_0x517a('0x90'))[_0x517a('0x6c')](['phone',_0x517a('0x73'),_0x517a('0x6e'),_0x517a('0x58'),'createdAt','updatedAt'],squel[_0x517a('0x6f')]()['field']('phone',_0x517a('0x71'))[_0x517a('0x70')]('id',_0x517a('0x73'))[_0x517a('0x70')](_0x4db6e0[_0x517a('0x74')]['toString'](),_0x517a('0x6e'))[_0x517a('0x70')](_0x226765[_0x517a('0x54')]['id']['toString'](),_0x517a('0x58'))['field'](_0x517a('0x72'),_0x517a('0x50'))[_0x517a('0x70')]('NOW()',_0x517a('0x51'))[_0x517a('0x76')](_0x517a('0x77'))[_0x517a('0x3d')](_0x517a('0x78'))[_0x517a('0x3d')]('ListId\x20=\x20?',_0x4db6e0[_0x517a('0x74')][_0x517a('0x75')]())['where'](_0x517a('0x7a')))[_0x517a('0x75')]();_0x19a06c[_0x517a('0x8b')](db[_0x517a('0x8c')][_0x517a('0x33')](_0x2fa78e));}return BPromise[_0x517a('0x91')](_0x19a06c);}})['then'](function(){return _0x1fc780;})[_0x517a('0x21')](respondWithResult(_0x1f5215,null))['catch'](handleError(_0x1f5215,null));};exports['removeBlackLists']=function(_0x31d2c2,_0x5f065b,_0x3e564a){return db['Campaign'][_0x517a('0x44')]({'where':{'id':_0x31d2c2[_0x517a('0x54')]['id']}})[_0x517a('0x21')](handleEntityNotFound(_0x5f065b,null))[_0x517a('0x21')](function(_0x217361){if(_0x217361){return _0x217361[_0x517a('0x92')](_0x31d2c2['query'][_0x517a('0x65')]);}})[_0x517a('0x21')](function(_0x25fe69){if(_0x25fe69){return db[_0x517a('0x5f')][_0x517a('0x22')]({'where':{'ListId':_0x31d2c2['query'][_0x517a('0x65')],'CampaignId':_0x31d2c2[_0x517a('0x54')]['id']}})['then'](function(){return _0x25fe69;});}})[_0x517a('0x21')](respondWithStatusCode(_0x5f065b,null))[_0x517a('0x41')](handleError(_0x5f065b,null));}; \ No newline at end of file +var _0x4024=['rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','index','map','Campaign','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','CmListId','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format'];(function(_0x52572d,_0x1cb3da){var _0x200e3d=function(_0x254ae5){while(--_0x254ae5){_0x52572d['push'](_0x52572d['shift']());}};_0x200e3d(++_0x1cb3da);}(_0x4024,0x89));var _0x4402=function(_0x4a6d2b,_0x37b07b){_0x4a6d2b=_0x4a6d2b-0x0;var _0x415979=_0x4024[_0x4a6d2b];return _0x415979;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['Campaign'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['Campaign'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['Campaign'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['clone']=function(_0xe8a8e9,_0x642ab4){var _0x3f45c3={'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}},_0x295c9b={};_0x295c9b[_0x4402('0x2b')]=_[_0x4402('0x2d')](db['Campaign']['rawAttributes']);_0x3f45c3[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x295c9b[_0x4402('0x2b')],qs['fields'](_0xe8a8e9['query'][_0x4402('0x30')]));_0x3f45c3[_0x4402('0x2f')]=_0x3f45c3[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f45c3[_0x4402('0x2f')]:_0x295c9b[_0x4402('0x2b')];if(_0xe8a8e9[_0x4402('0x2c')][_0x4402('0x40')]){_0x3f45c3[_0x4402('0x39')]=[{'all':!![]}];}_0x3f45c3=_[_0x4402('0x38')]({},_0x3f45c3,_0xe8a8e9[_0x4402('0x41')]);return db[_0x4402('0x28')][_0x4402('0x42')](_0x3f45c3)['then'](handleEntityNotFound(_0x642ab4,null))[_0x4402('0x1f')](function(_0x4b7057){if(_0x4b7057){var _0xe4530a=_0x4b7057['get']({'plain':!![]});_0xe4530a=qs[_0x4402('0x4a')](_0xe4530a,['id',_0x4402('0x4b'),_0x4402('0x4c')]);_0xe8a8e9[_0x4402('0x44')]=_[_0x4402('0x4a')](_0xe8a8e9[_0x4402('0x44')],['id','createdAt',_0x4402('0x4c')]);return db[_0x4402('0x28')][_0x4402('0x43')](_[_0x4402('0x38')](_0xe4530a,_0xe8a8e9[_0x4402('0x44')]),{'include':_0xe8a8e9['query'][_0x4402('0x40')]?[{'all':!![]}]:undefined})[_0x4402('0x1f')](function(_0x474b04){var _0xc15c0b=_0xe8a8e9[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0xc15c0b)throw new Error(_0x4402('0x46'));if(_0xc15c0b[_0x4402('0x4d')]==='user'){var _0x11c1b8=_0x474b04[_0x4402('0x21')]({'plain':!![]});var _0x53a9f3=_0x4402('0x22');return db[_0x4402('0x47')]['find']({'where':{'name':_0x53a9f3,'userProfileId':_0xc15c0b['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x1746c6){if(_0x1746c6&&_0x1746c6[_0x4402('0x48')]===0x0){return db['UserProfileResource'][_0x4402('0x43')]({'name':_0x11c1b8[_0x4402('0x25')],'resourceId':_0x11c1b8['id'],'type':_0x1746c6[_0x4402('0x25')],'sectionId':_0x1746c6['id']},{})['then'](function(){return _0x474b04;});}else{return _0x474b04;}})[_0x4402('0x3c')](function(_0x41a2c6){logger[_0x4402('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41a2c6);throw _0x41a2c6;});}return _0x474b04;});}})[_0x4402('0x1f')](respondWithResult(_0x642ab4,0xc9))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['update']=function(_0x5cef56,_0x40869c){if(_0x5cef56['body']['id']){delete _0x5cef56[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')]['find']({'where':{'id':_0x5cef56['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x40869c,null))[_0x4402('0x1f')](saveUpdates(_0x5cef56[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x40869c,null))['catch'](handleError(_0x40869c,null));};exports[_0x4402('0x20')]=function(_0x30e5d5,_0x22ed41){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x30e5d5[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x22ed41,null))['then'](removeEntity(_0x22ed41,null))[_0x4402('0x3c')](handleError(_0x22ed41,null));};exports[_0x4402('0x4e')]=function(_0x559d1c,_0x508111,_0x2bee9d){var _0x4aaa60={'raw':!![],'where':{}};var _0x30569e={};var _0x586689={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x559d1c[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x508111,null))[_0x4402('0x1f')](function(_0x1c1857){if(_0x1c1857){_0x30569e[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x50')][_0x4402('0x29')]);_0x30569e[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x559d1c[_0x4402('0x2c')]);_0x30569e[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x30569e[_0x4402('0x2b')],_0x30569e['query']);_0x4aaa60[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x30569e[_0x4402('0x2b')],qs['fields'](_0x559d1c[_0x4402('0x2c')]['fields']));_0x4aaa60[_0x4402('0x2f')]=_0x4aaa60[_0x4402('0x2f')][_0x4402('0x31')]?_0x4aaa60[_0x4402('0x2f')]:_0x30569e['model'];if(!_0x559d1c[_0x4402('0x2c')]['hasOwnProperty'](_0x4402('0x33'))){_0x4aaa60[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x559d1c['query'][_0x4402('0x19')]);_0x4aaa60['offset']=qs[_0x4402('0x17')](_0x559d1c[_0x4402('0x2c')][_0x4402('0x17')]);}_0x4aaa60[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x559d1c[_0x4402('0x2c')][_0x4402('0x34')]);_0x4aaa60[_0x4402('0x35')]=qs[_0x4402('0x2e')](_['pick'](_0x559d1c[_0x4402('0x2c')],_0x30569e[_0x4402('0x2e')]));_0x4aaa60[_0x4402('0x35')][_0x4402('0x52')]=_0x1c1857['id'];if(_0x559d1c[_0x4402('0x2c')][_0x4402('0x36')]){_0x4aaa60[_0x4402('0x35')]=_[_0x4402('0x38')](_0x4aaa60[_0x4402('0x35')],{'$or':_['map'](_0x4aaa60[_0x4402('0x2f')],function(_0x2a6dc1){var _0x2eae1c={};_0x2eae1c[_0x2a6dc1]={'$like':'%'+_0x559d1c['query'][_0x4402('0x36')]+'%'};return _0x2eae1c;})});}_0x4aaa60=_['merge']({},_0x4aaa60,_0x559d1c[_0x4402('0x41')]);return db['CmHopper'][_0x4402('0x1a')]({'where':_0x4aaa60[_0x4402('0x35')]})['then'](function(_0x43b4aa){_0x586689['count']=_0x43b4aa;if(_0x559d1c[_0x4402('0x2c')][_0x4402('0x40')]){_0x4aaa60['include']=[{'all':!![]}];}return db[_0x4402('0x50')][_0x4402('0x3a')](_0x4aaa60);})['then'](function(_0x189259){_0x586689[_0x4402('0x3b')]=_0x189259;return _0x586689;});}})['then'](respondWithFilteredResult(_0x508111,_0x4aaa60))[_0x4402('0x3c')](handleError(_0x508111,null));};exports[_0x4402('0x53')]=function(_0x1a9163,_0x12b834,_0x439e95){var _0x17b133={'raw':!![],'where':{}};var _0x7f28d3={};var _0x370493={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x1a9163[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x12b834,null))[_0x4402('0x1f')](function(_0x2dd4b7){if(_0x2dd4b7){_0x7f28d3['model']=_[_0x4402('0x2d')](db[_0x4402('0x54')]['rawAttributes']);_0x7f28d3[_0x4402('0x2c')]=_['keys'](_0x1a9163[_0x4402('0x2c')]);_0x7f28d3[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x7f28d3['model'],_0x7f28d3[_0x4402('0x2c')]);_0x17b133[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x7f28d3['model'],qs[_0x4402('0x30')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x30')]));_0x17b133[_0x4402('0x2f')]=_0x17b133['attributes'][_0x4402('0x31')]?_0x17b133[_0x4402('0x2f')]:_0x7f28d3[_0x4402('0x2b')];if(!_0x1a9163[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x17b133[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x19')]);_0x17b133[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x1a9163[_0x4402('0x2c')]['offset']);}_0x17b133[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x1a9163[_0x4402('0x2c')][_0x4402('0x34')]);_0x17b133['where']=qs['filters'](_[_0x4402('0x55')](_0x1a9163[_0x4402('0x2c')],_0x7f28d3[_0x4402('0x2e')]));_0x17b133[_0x4402('0x35')]['CampaignId']=_0x2dd4b7['id'];if(_0x1a9163[_0x4402('0x2c')][_0x4402('0x36')]){_0x17b133['where']=_[_0x4402('0x38')](_0x17b133[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x17b133[_0x4402('0x2f')],function(_0x297884){var _0x5f5945={};_0x5f5945[_0x297884]={'$like':'%'+_0x1a9163[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x5f5945;})});}_0x17b133=_[_0x4402('0x38')]({},_0x17b133,_0x1a9163[_0x4402('0x41')]);return db[_0x4402('0x54')][_0x4402('0x1a')]({'where':_0x17b133[_0x4402('0x35')]})['then'](function(_0x218640){_0x370493[_0x4402('0x1a')]=_0x218640;if(_0x1a9163[_0x4402('0x2c')][_0x4402('0x40')]){_0x17b133[_0x4402('0x39')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4402('0x3a')](_0x17b133);})[_0x4402('0x1f')](function(_0x572e21){_0x370493[_0x4402('0x3b')]=_0x572e21;return _0x370493;});}})['then'](respondWithFilteredResult(_0x12b834,_0x17b133))['catch'](handleError(_0x12b834,null));};exports[_0x4402('0x56')]=function(_0x505a13,_0x32be98,_0x520907){var _0x51e85d={'raw':!![],'where':{}};var _0x16af14={};var _0x7adf6d={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x505a13[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x32be98,null))['then'](function(_0x596499){if(_0x596499){_0x16af14[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x57')]['rawAttributes']);_0x16af14['query']=_[_0x4402('0x2d')](_0x505a13['query']);_0x16af14[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x16af14[_0x4402('0x2b')],_0x16af14[_0x4402('0x2c')]);_0x51e85d[_0x4402('0x2f')]=_['intersection'](_0x16af14['model'],qs[_0x4402('0x30')](_0x505a13[_0x4402('0x2c')]['fields']));_0x51e85d[_0x4402('0x2f')]=_0x51e85d[_0x4402('0x2f')][_0x4402('0x31')]?_0x51e85d[_0x4402('0x2f')]:_0x16af14[_0x4402('0x2b')];if(!_0x505a13[_0x4402('0x2c')]['hasOwnProperty']('nolimit')){_0x51e85d[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x505a13[_0x4402('0x2c')][_0x4402('0x19')]);_0x51e85d[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x505a13['query'][_0x4402('0x17')]);}_0x51e85d[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x505a13[_0x4402('0x2c')][_0x4402('0x34')]);_0x51e85d['where']=qs[_0x4402('0x2e')](_[_0x4402('0x55')](_0x505a13[_0x4402('0x2c')],_0x16af14[_0x4402('0x2e')]));_0x51e85d[_0x4402('0x35')][_0x4402('0x52')]=_0x596499['id'];if(_0x505a13['query']['filter']){_0x51e85d[_0x4402('0x35')]=_['merge'](_0x51e85d[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x51e85d[_0x4402('0x2f')],function(_0x3eb7f0){var _0x3636e9={};_0x3636e9[_0x3eb7f0]={'$like':'%'+_0x505a13[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3636e9;})});}_0x51e85d=_[_0x4402('0x38')]({},_0x51e85d,_0x505a13[_0x4402('0x41')]);return db[_0x4402('0x57')][_0x4402('0x1a')]({'where':_0x51e85d[_0x4402('0x35')]})[_0x4402('0x1f')](function(_0x372c6e){_0x7adf6d[_0x4402('0x1a')]=_0x372c6e;if(_0x505a13[_0x4402('0x2c')][_0x4402('0x40')]){_0x51e85d[_0x4402('0x39')]=[{'all':!![]}];}return db[_0x4402('0x57')][_0x4402('0x3a')](_0x51e85d);})[_0x4402('0x1f')](function(_0x385b8e){_0x7adf6d[_0x4402('0x3b')]=_0x385b8e;return _0x7adf6d;});}})['then'](respondWithFilteredResult(_0x32be98,_0x51e85d))[_0x4402('0x3c')](handleError(_0x32be98,null));};exports[_0x4402('0x58')]=function(_0x3a3734,_0x2631bc,_0x98b130){var _0x3511f6={'raw':!![],'where':{}};var _0x5dfe53={};var _0x4ed2fa={'count':0x0,'rows':[]};return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x3a3734[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2631bc,null))['then'](function(_0x54fee3){if(_0x54fee3){_0x5dfe53['model']=_[_0x4402('0x2d')](db[_0x4402('0x59')][_0x4402('0x29')]);_0x5dfe53['query']=_[_0x4402('0x2d')](_0x3a3734[_0x4402('0x2c')]);_0x5dfe53[_0x4402('0x2e')]=_['intersection'](_0x5dfe53[_0x4402('0x2b')],_0x5dfe53['query']);_0x3511f6[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x5dfe53[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x3a3734[_0x4402('0x2c')][_0x4402('0x30')]));_0x3511f6['attributes']=_0x3511f6[_0x4402('0x2f')][_0x4402('0x31')]?_0x3511f6[_0x4402('0x2f')]:_0x5dfe53['model'];if(!_0x3a3734[_0x4402('0x2c')]['hasOwnProperty'](_0x4402('0x33'))){_0x3511f6[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x3a3734[_0x4402('0x2c')]['limit']);_0x3511f6[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x3a3734[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3511f6[_0x4402('0x51')]=qs['sort'](_0x3a3734[_0x4402('0x2c')][_0x4402('0x34')]);_0x3511f6['where']=qs['filters'](_['pick'](_0x3a3734[_0x4402('0x2c')],_0x5dfe53[_0x4402('0x2e')]));_0x3511f6[_0x4402('0x35')][_0x4402('0x52')]=_0x54fee3['id'];if(_0x3a3734['query'][_0x4402('0x36')]){_0x3511f6[_0x4402('0x35')]=_[_0x4402('0x38')](_0x3511f6[_0x4402('0x35')],{'$or':_['map'](_0x3511f6[_0x4402('0x2f')],function(_0x2949ce){var _0x30f26a={};_0x30f26a[_0x2949ce]={'$like':'%'+_0x3a3734['query']['filter']+'%'};return _0x30f26a;})});}_0x3511f6=_['merge']({},_0x3511f6,_0x3a3734[_0x4402('0x41')]);return db['CmHopperBlack'][_0x4402('0x1a')]({'where':_0x3511f6[_0x4402('0x35')]})[_0x4402('0x1f')](function(_0x117911){_0x4ed2fa[_0x4402('0x1a')]=_0x117911;if(_0x3a3734[_0x4402('0x2c')][_0x4402('0x40')]){_0x3511f6[_0x4402('0x39')]=[{'all':!![]}];}return db[_0x4402('0x59')][_0x4402('0x3a')](_0x3511f6);})[_0x4402('0x1f')](function(_0x329b60){_0x4ed2fa[_0x4402('0x3b')]=_0x329b60;return _0x4ed2fa;});}})[_0x4402('0x1f')](respondWithFilteredResult(_0x2631bc,_0x3511f6))['catch'](handleError(_0x2631bc,null));};exports[_0x4402('0x5a')]=function(_0x26f5a9,_0x4cc170,_0x5563e6){var _0x57fd83={};var _0x1aacd7={};var _0x5a3ec8;var _0x47aa8b;return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x26f5a9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4cc170,null))[_0x4402('0x1f')](function(_0x541cd0){if(_0x541cd0){_0x5a3ec8=_0x541cd0;_0x1aacd7[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x5b')][_0x4402('0x29')]);_0x1aacd7[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x26f5a9[_0x4402('0x2c')]);_0x1aacd7[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1aacd7[_0x4402('0x2b')],_0x1aacd7[_0x4402('0x2c')]);_0x57fd83['attributes']=_[_0x4402('0x3f')](_0x1aacd7[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x26f5a9[_0x4402('0x2c')]['fields']));_0x57fd83[_0x4402('0x2f')]=_0x57fd83['attributes'][_0x4402('0x31')]?_0x57fd83[_0x4402('0x2f')]:_0x1aacd7['model'];_0x57fd83['order']=qs[_0x4402('0x34')](_0x26f5a9[_0x4402('0x2c')][_0x4402('0x34')]);_0x57fd83[_0x4402('0x35')]=qs[_0x4402('0x2e')](_[_0x4402('0x55')](_0x26f5a9['query'],_0x1aacd7['filters']));if(_0x26f5a9[_0x4402('0x2c')][_0x4402('0x36')]){_0x57fd83[_0x4402('0x35')]=_[_0x4402('0x38')](_0x57fd83[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x57fd83['attributes'],function(_0x28720c){var _0x3e00bf={};_0x3e00bf[_0x28720c]={'$like':'%'+_0x26f5a9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x3e00bf;})});}_0x57fd83=_[_0x4402('0x38')]({},_0x57fd83,_0x26f5a9[_0x4402('0x41')]);return _0x5a3ec8['getLists'](_0x57fd83);}})['then'](function(_0x1a3393){if(_0x1a3393){_0x47aa8b=_0x1a3393['length'];if(!_0x26f5a9[_0x4402('0x2c')][_0x4402('0x32')]('nolimit')){_0x57fd83[_0x4402('0x19')]=qs['limit'](_0x26f5a9[_0x4402('0x2c')][_0x4402('0x19')]);_0x57fd83[_0x4402('0x17')]=qs['offset'](_0x26f5a9[_0x4402('0x2c')]['offset']);}return _0x5a3ec8[_0x4402('0x5a')](_0x57fd83);}})[_0x4402('0x1f')](function(_0x206058){if(_0x206058){return _0x206058?{'count':_0x47aa8b,'rows':_0x206058}:null;}})[_0x4402('0x1f')](respondWithResult(_0x4cc170,null))[_0x4402('0x3c')](handleError(_0x4cc170,null));};exports['addLists']=function(_0x4b999c,_0x135fac,_0x5c1e8e){var _0x2bc5a3,_0x38009f;var _0x559802=[];var _0x50d453=moment()[_0x4402('0x5c')](_0x4402('0x5d'));return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x4b999c[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x135fac,null))[_0x4402('0x1f')](function(_0x93b7b4){if(_0x93b7b4){_0x38009f=_0x93b7b4;return _0x93b7b4['addLists'](_0x4b999c['body'][_0x4402('0x5e')],_[_0x4402('0x4a')](_0x4b999c[_0x4402('0x44')],['ids','id'])||{});}return null;})[_0x4402('0x5f')](function(_0x5ef261){var _0x224182;var _0x1237a3;_0x2bc5a3=_0x5ef261||[];var _0x364423=[];if(_0x5ef261){for(var _0x4a0fd9=0x0;_0x4a0fd9<_0x5ef261[_0x4402('0x31')];_0x4a0fd9+=0x1){var _0x12569b=_0x5ef261[_0x4a0fd9]['get']({'plain':!![]});_0x38009f[_0x4402('0x60')]=_0x4b999c[_0x4402('0x44')][_0x4402('0x60')]?_0x4b999c[_0x4402('0x44')][_0x4402('0x60')]:_0x38009f[_0x4402('0x60')];switch(_0x38009f[_0x4402('0x60')]){case _0x4402('0x61'):_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x64'))[_0x4402('0x65')](['phone',_0x4402('0x66'),_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x6b'),'phone')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))['field']('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b['CmListId'][_0x4402('0x6d')](),_0x4402('0x68'))['field'](_0x4b999c['params']['id'][_0x4402('0x6d')](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))['field']('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))['from'](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))[_0x4402('0x35')](_0x4402('0x70'),_0x12569b['CmListId'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71'))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x73'))[_0x4402('0x74')](_0x4402('0x75'))[_0x4402('0x35')]('CampaignId\x20=\x20?',_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]()))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x76'))[_0x4402('0x74')](_0x4402('0x64'))[_0x4402('0x35')]('CampaignId\x20=\x20?',_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]())))[_0x4402('0x6d')]();break;case'onlyIfOpen':_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')]('cm_hopper')[_0x4402('0x65')]([_0x4402('0x6b'),_0x4402('0x66'),_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x6b'),'phone')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))['field'](_0x4b999c[_0x4402('0x3e')]['id']['toString'](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))[_0x4402('0x74')](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))['where'](_0x4402('0x70'),_0x12569b['CmListId'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71'))[_0x4402('0x35')](_0x4402('0x72'),squel[_0x4402('0x69')]()['field'](_0x4402('0x76'))['from'](_0x4402('0x64'))['where'](_0x4402('0x78'),_0x4b999c[_0x4402('0x3e')]['id'][_0x4402('0x6d')]())))[_0x4402('0x6d')]();break;default:_0x224182=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x64'))[_0x4402('0x65')]([_0x4402('0x6b'),'scheduledAt',_0x4402('0x67'),'ListId','CampaignId','createdAt',_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')]('phone',_0x4402('0x6b'))[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('id',_0x4402('0x67'))[_0x4402('0x6a')](_0x12569b[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))[_0x4402('0x6a')](_0x4b999c['params']['id']['toString'](),_0x4402('0x52'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))['from']('cm_contacts')[_0x4402('0x35')](_0x4402('0x6f'))[_0x4402('0x35')](_0x4402('0x70'),_0x12569b[_0x4402('0x77')][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x71')))[_0x4402('0x6d')]();}_0x1237a3=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x79'))[_0x4402('0x65')]([_0x4402('0x7a'),_0x4402('0x66'),_0x4402('0x6b'),_0x4402('0x7b'),_0x4402('0x4b'),_0x4402('0x4c')],squel[_0x4402('0x69')]()[_0x4402('0x6a')](_0x4402('0x7c'),'id')[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x66'))[_0x4402('0x6a')]('ci.item',_0x4402('0x6b'))[_0x4402('0x6a')](_0x4402('0x7d'),_0x4402('0x7b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4b'))[_0x4402('0x6a')]('\x27'+_0x50d453+'\x27',_0x4402('0x4c'))[_0x4402('0x74')]('cm_contact_has_items','ci')[_0x4402('0x7e')](_0x4402('0x64'),'h',_0x4402('0x7f'))[_0x4402('0x35')](_0x4402('0x80'),_0x12569b[_0x4402('0x77')][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x81'),_0x4b999c['params']['id'][_0x4402('0x6d')]())[_0x4402('0x35')](_0x4402('0x82'),_0x50d453))[_0x4402('0x6d')]();_0x364423[_0x4402('0x83')](db[_0x4402('0x84')][_0x4402('0x2c')](_0x224182));_0x559802['push'](db[_0x4402('0x84')][_0x4402('0x2c')](_0x1237a3));}return BPromise['all'](_0x364423);}})[_0x4402('0x1f')](function(){return BPromise[_0x4402('0x85')](_0x559802);})[_0x4402('0x1f')](function(){return _0x2bc5a3;})[_0x4402('0x1f')](respondWithResult(_0x135fac,null))[_0x4402('0x3c')](handleError(_0x135fac,null));};exports[_0x4402('0x86')]=function(_0x2433a1,_0x4069cf,_0x7be513){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x2433a1[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4069cf,null))[_0x4402('0x1f')](function(_0x1f2219){if(_0x1f2219){return _0x1f2219[_0x4402('0x86')](_0x2433a1[_0x4402('0x2c')][_0x4402('0x5e')]);}})[_0x4402('0x1f')](function(_0x2ecd1f){if(_0x2ecd1f){return db[_0x4402('0x50')][_0x4402('0x20')]({'where':{'ListId':_0x2433a1[_0x4402('0x2c')][_0x4402('0x5e')],'CampaignId':_0x2433a1[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](function(){return _0x2ecd1f;});}})[_0x4402('0x1f')](respondWithStatusCode(_0x4069cf,null))[_0x4402('0x3c')](handleError(_0x4069cf,null));};exports[_0x4402('0x87')]=function(_0x3f7f24,_0x24797a,_0x544a09){var _0x3ae530={};var _0x55efac={};var _0x53c06a;var _0x404464;return db[_0x4402('0x28')][_0x4402('0x4f')]({'where':{'id':_0x3f7f24[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x24797a,null))['then'](function(_0x2b5efe){if(_0x2b5efe){_0x53c06a=_0x2b5efe;_0x55efac[_0x4402('0x2b')]=_[_0x4402('0x2d')](db['CmList'][_0x4402('0x29')]);_0x55efac[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x3f7f24[_0x4402('0x2c')]);_0x55efac['filters']=_[_0x4402('0x3f')](_0x55efac[_0x4402('0x2b')],_0x55efac['query']);_0x3ae530['attributes']=_['intersection'](_0x55efac['model'],qs[_0x4402('0x30')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x30')]));_0x3ae530['attributes']=_0x3ae530[_0x4402('0x2f')][_0x4402('0x31')]?_0x3ae530[_0x4402('0x2f')]:_0x55efac['model'];_0x3ae530[_0x4402('0x51')]=qs[_0x4402('0x34')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x34')]);_0x3ae530[_0x4402('0x35')]=qs[_0x4402('0x2e')](_['pick'](_0x3f7f24[_0x4402('0x2c')],_0x55efac[_0x4402('0x2e')]));if(_0x3f7f24[_0x4402('0x2c')][_0x4402('0x36')]){_0x3ae530['where']=_[_0x4402('0x38')](_0x3ae530['where'],{'$or':_[_0x4402('0x27')](_0x3ae530['attributes'],function(_0x57bce0){var _0x4331a9={};_0x4331a9[_0x57bce0]={'$like':'%'+_0x3f7f24[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x4331a9;})});}_0x3ae530=_[_0x4402('0x38')]({},_0x3ae530,_0x3f7f24[_0x4402('0x41')]);return _0x53c06a[_0x4402('0x87')](_0x3ae530);}})[_0x4402('0x1f')](function(_0x87e1c){if(_0x87e1c){_0x404464=_0x87e1c['length'];if(!_0x3f7f24[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3ae530[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x3f7f24['query'][_0x4402('0x19')]);_0x3ae530['offset']=qs[_0x4402('0x17')](_0x3f7f24[_0x4402('0x2c')][_0x4402('0x17')]);}return _0x53c06a['getBlackLists'](_0x3ae530);}})[_0x4402('0x1f')](function(_0x284292){if(_0x284292){return _0x284292?{'count':_0x404464,'rows':_0x284292}:null;}})['then'](respondWithResult(_0x24797a,null))[_0x4402('0x3c')](handleError(_0x24797a,null));};exports[_0x4402('0x88')]=function(_0x1ad7ff,_0x19993b,_0x241a20){var _0x460e17,_0x44b691;var _0xe8f398=[];var _0x1e625b=moment()[_0x4402('0x5c')](_0x4402('0x5d'));return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x1ad7ff[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x19993b,null))[_0x4402('0x1f')](function(_0x1223ad){if(_0x1223ad){_0x44b691=_0x1223ad;return _0x1223ad[_0x4402('0x88')](_0x1ad7ff[_0x4402('0x44')][_0x4402('0x5e')],_[_0x4402('0x4a')](_0x1ad7ff[_0x4402('0x44')],[_0x4402('0x5e'),'id'])||{});}return null;})['spread'](function(_0x319331){var _0x268d01;var _0x45080b;_0x460e17=_0x319331||[];var _0x4ff63e=[];if(_0x319331){for(var _0x48121f=0x0;_0x48121f<_0x319331[_0x4402('0x31')];_0x48121f+=0x1){var _0x114ee0=_0x319331[_0x48121f][_0x4402('0x21')]({'plain':!![]});_0x268d01=squel[_0x4402('0x62')]()[_0x4402('0x63')](_0x4402('0x89'))['fromQuery'](['phone',_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x52'),_0x4402('0x4b'),_0x4402('0x4c')],squel['select']()[_0x4402('0x6a')](_0x4402('0x6b'),_0x4402('0x6b'))['field']('id',_0x4402('0x67'))['field'](_0x114ee0[_0x4402('0x77')][_0x4402('0x6d')](),_0x4402('0x68'))[_0x4402('0x6a')](_0x1ad7ff['params']['id'][_0x4402('0x6d')](),_0x4402('0x52'))[_0x4402('0x6a')](_0x4402('0x6c'),_0x4402('0x4b'))[_0x4402('0x6a')](_0x4402('0x6c'),'updatedAt')['from'](_0x4402('0x6e'))[_0x4402('0x35')](_0x4402('0x6f'))['where'](_0x4402('0x70'),_0x114ee0[_0x4402('0x77')][_0x4402('0x6d')]())['where'](_0x4402('0x71')))['toString']();_0x4ff63e[_0x4402('0x83')](db[_0x4402('0x84')][_0x4402('0x2c')](_0x268d01));}return BPromise['all'](_0x4ff63e);}})[_0x4402('0x1f')](function(){return _0x460e17;})[_0x4402('0x1f')](respondWithResult(_0x19993b,null))['catch'](handleError(_0x19993b,null));};exports['removeBlackLists']=function(_0x4bd840,_0x4b64a3,_0x1815d7){return db['Campaign']['find']({'where':{'id':_0x4bd840[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4b64a3,null))[_0x4402('0x1f')](function(_0x27c329){if(_0x27c329){return _0x27c329['removeBlackLists'](_0x4bd840[_0x4402('0x2c')][_0x4402('0x5e')]);}})[_0x4402('0x1f')](function(_0x5ebf6d){if(_0x5ebf6d){return db[_0x4402('0x59')]['destroy']({'where':{'ListId':_0x4bd840['query'][_0x4402('0x5e')],'CampaignId':_0x4bd840['params']['id']}})[_0x4402('0x1f')](function(){return _0x5ebf6d;});}})['then'](respondWithStatusCode(_0x4b64a3,null))[_0x4402('0x3c')](handleError(_0x4b64a3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 1581db0..c53ff6e 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2efc88,_0x514a6a){var _0x1e2532=function(_0x242da0){while(--_0x242da0){_0x2efc88['push'](_0x2efc88['shift']());}};_0x1e2532(++_0x514a6a);}(_0x7a54,0x106));var _0x47a5=function(_0x44b596,_0x5001cf){_0x44b596=_0x44b596-0x0;var _0x1a4b0c=_0x7a54[_0x44b596];return _0x1a4b0c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1058ac,_0x62763e){var _0x101f1b=function(_0x41292d){while(--_0x41292d){_0x1058ac['push'](_0x1058ac['shift']());}};_0x101f1b(++_0x62763e);}(_0x7a54,0x106));var _0x47a5=function(_0x1992a9,_0x1977fd){_0x1992a9=_0x1992a9-0x0;var _0x41b723=_0x7a54[_0x1992a9];return _0x41b723;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 82620b6..8a86410 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 _0xc831=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','Campaign,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','then','GetCampaign','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x2cb9af,_0x45ee00){var _0x9da4f9=function(_0x2d8878){while(--_0x2d8878){_0x2cb9af['push'](_0x2cb9af['shift']());}};_0x9da4f9(++_0x45ee00);}(_0xc831,0x103));var _0x1c83=function(_0xc9a004,_0x476a42){_0xc9a004=_0xc9a004-0x0;var _0x9fa78f=_0xc831[_0xc9a004];return _0x9fa78f;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var moment=require(_0x1c83('0x1'));var BPromise=require(_0x1c83('0x2'));var rs=require(_0x1c83('0x3'));var fs=require('fs');var Redis=require(_0x1c83('0x4'));var db=require(_0x1c83('0x5'))['db'];var utils=require(_0x1c83('0x6'));var logger=require(_0x1c83('0x7'))(_0x1c83('0x8'));var config=require(_0x1c83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ec70,_0x1ce77e,_0x1953e5){return new BPromise(function(_0x29ceee,_0x38f254){return client[_0x1c83('0xb')](_0x52ec70,_0x1953e5)['then'](function(_0x9cb1e2){logger[_0x1c83('0xc')]('Campaign,\x20%s,\x20%s',_0x1ce77e,'request\x20sent');logger[_0x1c83('0xd')](_0x1c83('0xe'),_0x1ce77e,_0x1c83('0xf'),JSON['stringify'](_0x9cb1e2));if(_0x9cb1e2[_0x1c83('0x10')]){if(_0x9cb1e2['error']['code']===0x1f4){logger[_0x1c83('0x10')](_0x1c83('0x11'),_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x38f254(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}logger[_0x1c83('0x10')]('Campaign,\x20%s,\x20%s',_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x29ceee(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}else{logger[_0x1c83('0xc')]('Campaign,\x20%s,\x20%s',_0x1ce77e,_0x1c83('0xf'));_0x29ceee(_0x9cb1e2[_0x1c83('0x13')][_0x1c83('0x12')]);}})[_0x1c83('0x14')](function(_0x596a69){logger[_0x1c83('0x10')]('Campaign,\x20%s,\x20%s',_0x1ce77e,_0x596a69);_0x38f254(_0x596a69);});});}exports['GetCampaign']=function(_0x3b3369){var _0x1d6027=this;return new Promise(function(_0x2ec743,_0x37a7ac){return db['Campaign'][_0x1c83('0x15')]({'raw':_0x3b3369['options']?_0x3b3369[_0x1c83('0x16')][_0x1c83('0x17')]===undefined?!![]:![]:!![],'where':_0x3b3369['options']?_0x3b3369[_0x1c83('0x16')][_0x1c83('0x18')]||null:null,'attributes':_0x3b3369['options']?_0x3b3369['options'][_0x1c83('0x19')]||null:null,'limit':_0x3b3369['options']?_0x3b3369['options'][_0x1c83('0x1a')]||null:null,'include':_0x3b3369[_0x1c83('0x16')]?_0x3b3369[_0x1c83('0x16')]['include']?_[_0x1c83('0x1b')](_0x3b3369[_0x1c83('0x16')][_0x1c83('0x1c')],function(_0x58a7d5){return{'model':db[_0x58a7d5[_0x1c83('0x1d')]],'as':_0x58a7d5['as'],'attributes':_0x58a7d5['attributes'],'include':_0x58a7d5[_0x1c83('0x1c')]?_[_0x1c83('0x1b')](_0x58a7d5[_0x1c83('0x1c')],function(_0x1096ed){return{'model':db[_0x1096ed[_0x1c83('0x1d')]],'as':_0x1096ed['as'],'attributes':_0x1096ed[_0x1c83('0x19')],'include':_0x1096ed[_0x1c83('0x1c')]?_[_0x1c83('0x1b')](_0x1096ed[_0x1c83('0x1c')],function(_0x578c37){return{'model':db[_0x578c37[_0x1c83('0x1d')]],'as':_0x578c37['as'],'attributes':_0x578c37['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c83('0x1e')](function(_0x4ef78a){logger[_0x1c83('0xc')](_0x1c83('0x1f'),_0x3b3369);logger[_0x1c83('0xd')](_0x1c83('0x1f'),_0x3b3369,JSON[_0x1c83('0x20')](_0x4ef78a));_0x2ec743(_0x4ef78a);})[_0x1c83('0x14')](function(_0x2671a9){logger[_0x1c83('0x10')](_0x1c83('0x1f'),_0x2671a9['message'],_0x3b3369);_0x37a7ac(_0x1d6027[_0x1c83('0x10')](0x1f4,_0x2671a9['message']));});});}; \ No newline at end of file +var _0x4c4e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird'];(function(_0x31abeb,_0x406e0c){var _0x439004=function(_0x53e039){while(--_0x53e039){_0x31abeb['push'](_0x31abeb['shift']());}};_0x439004(++_0x406e0c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x32698a,_0x309ec3){_0x32698a=_0x32698a-0x0;var _0x1e4c0a=_0x4c4e[_0x32698a];return _0x1e4c0a;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Campaign'][_0xe4c4('0x16')]({'raw':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x18')]===undefined?!![]:![]:!![],'where':_0x42242c['options']?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x19')]||null:null,'attributes':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1a')]||null:null,'limit':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1b')]||null:null,'include':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')]?_[_0xe4c4('0x1d')](_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')],function(_0x15873e){return{'model':db[_0x15873e['model']],'as':_0x15873e['as'],'attributes':_0x15873e['attributes'],'include':_0x15873e[_0xe4c4('0x1c')]?_['map'](_0x15873e[_0xe4c4('0x1c')],function(_0x5374fd){return{'model':db[_0x5374fd[_0xe4c4('0x1e')]],'as':_0x5374fd['as'],'attributes':_0x5374fd['attributes'],'include':_0x5374fd[_0xe4c4('0x1c')]?_['map'](_0x5374fd[_0xe4c4('0x1c')],function(_0x4a0199){return{'model':db[_0x4a0199['model']],'as':_0x4a0199['as'],'attributes':_0x4a0199['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3221cd){logger['info']('GetCampaign',_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON['stringify'](_0x3221cd));_0x43a9ce(_0x3221cd);})['catch'](function(_0x7428ad){logger[_0xe4c4('0x10')]('GetCampaign',_0x7428ad[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x7428ad[_0xe4c4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index accd2d2..7111da9 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 _0x1c6c=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','index','get','/:id','isAuthenticated','/:id/hoppers','getHoppers'];(function(_0x4a4295,_0x55fb74){var _0x57c2d6=function(_0x3a51ff){while(--_0x3a51ff){_0x4a4295['push'](_0x4a4295['shift']());}};_0x57c2d6(++_0x55fb74);}(_0x1c6c,0xbe));var _0xc1c6=function(_0x317384,_0x1f997e){_0x317384=_0x317384-0x0;var _0x1cf977=_0x1c6c[_0x317384];return _0x1cf977;};'use strict';var multer=require(_0xc1c6('0x0'));var util=require(_0xc1c6('0x1'));var path=require(_0xc1c6('0x2'));var timeout=require(_0xc1c6('0x3'));var express=require(_0xc1c6('0x4'));var router=express[_0xc1c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc1c6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc1c6('0x8')]);router[_0xc1c6('0x9')](_0xc1c6('0xa'),auth[_0xc1c6('0xb')](),controller['show']);router[_0xc1c6('0x9')](_0xc1c6('0xc'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0xd')]);router[_0xc1c6('0x9')](_0xc1c6('0xe'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0xf')]);router['get'](_0xc1c6('0x10'),auth[_0xc1c6('0xb')](),controller['getHopperFinals']);router[_0xc1c6('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xc1c6('0x11')]);router[_0xc1c6('0x9')](_0xc1c6('0x12'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x13')]);router[_0xc1c6('0x9')](_0xc1c6('0x14'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x15')]);router[_0xc1c6('0x16')]('/',auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x17')]);router['post'](_0xc1c6('0x18'),auth['isAuthenticated'](),controller[_0xc1c6('0x19')]);router['post'](_0xc1c6('0x12'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x1a')]);router[_0xc1c6('0x16')]('/:id/blacklists',auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x1b')]);router[_0xc1c6('0x1c')](_0xc1c6('0xa'),auth[_0xc1c6('0xb')](),controller['update']);router['delete'](_0xc1c6('0xa'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x1d')]);router['delete'](_0xc1c6('0x12'),auth[_0xc1c6('0xb')](),controller[_0xc1c6('0x1e')]);router[_0xc1c6('0x1f')](_0xc1c6('0x14'),auth['isAuthenticated'](),controller[_0xc1c6('0x20')]);module[_0xc1c6('0x21')]=router; \ No newline at end of file +var _0xa26d=['addBlackLists','put','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','create','post','/:id/lists','addLists'];(function(_0x4599d7,_0x188301){var _0x16c3db=function(_0x2e5471){while(--_0x2e5471){_0x4599d7['push'](_0x4599d7['shift']());}};_0x16c3db(++_0x188301);}(_0xa26d,0x91));var _0xda26=function(_0x185d22,_0xbc747c){_0x185d22=_0x185d22-0x0;var _0x5be221=_0xa26d[_0x185d22];return _0x5be221;};'use strict';var multer=require(_0xda26('0x0'));var util=require(_0xda26('0x1'));var path=require(_0xda26('0x2'));var timeout=require(_0xda26('0x3'));var express=require(_0xda26('0x4'));var router=express[_0xda26('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xda26('0x6'));var interaction=require(_0xda26('0x7'));var config=require(_0xda26('0x8'));var controller=require(_0xda26('0x9'));router[_0xda26('0xa')]('/',auth[_0xda26('0xb')](),controller['index']);router[_0xda26('0xa')](_0xda26('0xc'),auth[_0xda26('0xb')](),controller[_0xda26('0xd')]);router['get'](_0xda26('0xe'),auth[_0xda26('0xb')](),controller[_0xda26('0xf')]);router[_0xda26('0xa')](_0xda26('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xda26('0xa')](_0xda26('0x11'),auth['isAuthenticated'](),controller[_0xda26('0x12')]);router[_0xda26('0xa')](_0xda26('0x13'),auth[_0xda26('0xb')](),controller['getHopperBlacks']);router[_0xda26('0xa')]('/:id/lists',auth[_0xda26('0xb')](),controller[_0xda26('0x14')]);router[_0xda26('0xa')]('/:id/blacklists',auth[_0xda26('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0xda26('0xb')](),controller[_0xda26('0x15')]);router[_0xda26('0x16')]('/:id/clone',auth[_0xda26('0xb')](),controller['clone']);router['post'](_0xda26('0x17'),auth[_0xda26('0xb')](),controller[_0xda26('0x18')]);router[_0xda26('0x16')]('/:id/blacklists',auth[_0xda26('0xb')](),controller[_0xda26('0x19')]);router[_0xda26('0x1a')](_0xda26('0xc'),auth[_0xda26('0xb')](),controller[_0xda26('0x1b')]);router[_0xda26('0x1c')](_0xda26('0xc'),auth['isAuthenticated'](),controller[_0xda26('0x1d')]);router['delete'](_0xda26('0x17'),auth[_0xda26('0xb')](),controller[_0xda26('0x1e')]);router['delete'](_0xda26('0x1f'),auth[_0xda26('0xb')](),controller[_0xda26('0x20')]);module[_0xda26('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ae23360..963595b 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 _0x97ed=['key','exports','STRING','VIRTUAL'];(function(_0x3abdc6,_0x187036){var _0x495fbe=function(_0x5f0d65){while(--_0x5f0d65){_0x3abdc6['push'](_0x3abdc6['shift']());}};_0x495fbe(++_0x187036);}(_0x97ed,0x15d));var _0xd97e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x97ed[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module[_0xd97e('0x0')]={'key':{'type':Sequelize[_0xd97e('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xd97e('0x1')]},'name':{'type':Sequelize[_0xd97e('0x2')],'get':function(){return this['getDataValue'](_0xd97e('0x3'));}}}; \ No newline at end of file +var _0x8023=['key','sequelize','TEXT','VIRTUAL','getDataValue'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0x8023,0x155));var _0x3802=function(_0x274b4a,_0x53f24d){_0x274b4a=_0x274b4a-0x0;var _0xac968f=_0x8023[_0x274b4a];return _0xac968f;};'use strict';var Sequelize=require(_0x3802('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3802('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3802('0x2')],'get':function(){return this[_0x3802('0x3')](_0x3802('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 61e8d01..909e18e 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 _0xc51f=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index','map','CannedAnswer','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','rawAttributes','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir'];(function(_0x2960e3,_0x228f40){var _0x351b60=function(_0x24753d){while(--_0x24753d){_0x2960e3['push'](_0x2960e3['shift']());}};_0x351b60(++_0x228f40);}(_0xc51f,0x9e));var _0xfc51=function(_0x127074,_0x3bd855){_0x127074=_0x127074-0x0;var _0x4c9463=_0xc51f[_0x127074];return _0x4c9463;};'use strict';var emlformat=require(_0xfc51('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc51('0x1'));var jsonpatch=require(_0xfc51('0x2'));var rp=require(_0xfc51('0x3'));var moment=require('moment');var BPromise=require(_0xfc51('0x4'));var Mustache=require(_0xfc51('0x5'));var util=require(_0xfc51('0x6'));var path=require(_0xfc51('0x7'));var sox=require(_0xfc51('0x8'));var csv=require(_0xfc51('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc51('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc51('0xb'));var toCsv=require(_0xfc51('0x9'));var querystring=require(_0xfc51('0xc'));var Papa=require('papaparse');var Redis=require(_0xfc51('0xd'));var authService=require(_0xfc51('0xe'));var qs=require(_0xfc51('0xf'));var as=require(_0xfc51('0x10'));var hardwareService=require(_0xfc51('0x11'));var logger=require(_0xfc51('0x12'))(_0xfc51('0x13'));var utils=require('../../config/utils');var config=require(_0xfc51('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x356a34,_0x3b91bd){_0x3b91bd=_0x3b91bd||0xcc;return function(_0x46b9cc){if(_0x46b9cc){return _0x356a34['sendStatus'](_0x3b91bd);}return _0x356a34[_0xfc51('0x15')](_0x3b91bd)[_0xfc51('0x16')]();};}function respondWithResult(_0x2e2acc,_0x232784){_0x232784=_0x232784||0xc8;return function(_0x1ddd7e){if(_0x1ddd7e){return _0x2e2acc['status'](_0x232784)[_0xfc51('0x17')](_0x1ddd7e);}};}function respondWithFilteredResult(_0x2570fb,_0x279b8b){return function(_0x478a2c){if(_0x478a2c){var _0xd7b0fd=typeof _0x279b8b[_0xfc51('0x18')]==='undefined'&&typeof _0x279b8b[_0xfc51('0x19')]===_0xfc51('0x1a');var _0x3a81fd=_0x478a2c[_0xfc51('0x1b')];var _0x434c81=_0xd7b0fd?0x0:_0x279b8b[_0xfc51('0x18')];var _0xdaa55e=_0xd7b0fd?_0x478a2c[_0xfc51('0x1b')]:_0x279b8b[_0xfc51('0x18')]+_0x279b8b[_0xfc51('0x19')];var _0x1180d1;if(_0xdaa55e>=_0x3a81fd){_0xdaa55e=_0x3a81fd;_0x1180d1=0xc8;}else{_0x1180d1=0xce;}_0x2570fb['status'](_0x1180d1);return _0x2570fb[_0xfc51('0x1c')](_0xfc51('0x1d'),_0x434c81+'-'+_0xdaa55e+'/'+_0x3a81fd)['json'](_0x478a2c);}return null;};}function patchUpdates(_0x262a25){return function(_0x994538){try{jsonpatch['apply'](_0x994538,_0x262a25,!![]);}catch(_0x327413){return BPromise[_0xfc51('0x1e')](_0x327413);}return _0x994538[_0xfc51('0x1f')]();};}function saveUpdates(_0x2f1223,_0xda317){return function(_0x17b55e){if(_0x17b55e){return _0x17b55e[_0xfc51('0x20')](_0x2f1223)[_0xfc51('0x21')](function(_0x2dbd2d){return _0x2dbd2d;});}return null;};}function removeEntity(_0x503898,_0x591071){return function(_0x378a00){if(_0x378a00){return _0x378a00[_0xfc51('0x22')]()['then'](function(){var _0x16bd35=_0x378a00[_0xfc51('0x23')]({'plain':!![]});var _0x28bb1d=_0xfc51('0x24');return db[_0xfc51('0x25')][_0xfc51('0x22')]({'where':{'type':_0x28bb1d,'resourceId':_0x16bd35['id']}})[_0xfc51('0x21')](function(){return _0x378a00;});})[_0xfc51('0x21')](function(){_0x503898[_0xfc51('0x15')](0xcc)[_0xfc51('0x16')]();});}};}function handleEntityNotFound(_0x59f9ef,_0x182f98){return function(_0x3ebbc1){if(!_0x3ebbc1){_0x59f9ef[_0xfc51('0x26')](0x194);}return _0x3ebbc1;};}function handleError(_0xb65a95,_0x2bdfe){_0x2bdfe=_0x2bdfe||0x1f4;return function(_0x4a4bf2){logger[_0xfc51('0x27')](_0x4a4bf2[_0xfc51('0x28')]);if(_0x4a4bf2[_0xfc51('0x29')]){delete _0x4a4bf2['name'];}_0xb65a95['status'](_0x2bdfe)['send'](_0x4a4bf2);};}exports[_0xfc51('0x2a')]=function(_0x3e2429,_0x203ee3){var _0x1323ec={},_0x11b512={},_0x2f26bc={'count':0x0,'rows':[]};var _0x4bb239=_[_0xfc51('0x2b')](db[_0xfc51('0x2c')]['rawAttributes'],function(_0xeddde5){return{'name':_0xeddde5['fieldName'],'type':_0xeddde5['type'][_0xfc51('0x2d')]};});_0x11b512[_0xfc51('0x2e')]=_[_0xfc51('0x2b')](_0x4bb239,_0xfc51('0x29'));_0x11b512['query']=_[_0xfc51('0x2f')](_0x3e2429[_0xfc51('0x30')]);_0x11b512[_0xfc51('0x31')]=_[_0xfc51('0x32')](_0x11b512[_0xfc51('0x2e')],_0x11b512[_0xfc51('0x30')]);_0x1323ec[_0xfc51('0x33')]=_[_0xfc51('0x32')](_0x11b512['model'],qs[_0xfc51('0x34')](_0x3e2429[_0xfc51('0x30')][_0xfc51('0x34')]));_0x1323ec[_0xfc51('0x33')]=_0x1323ec[_0xfc51('0x33')][_0xfc51('0x35')]?_0x1323ec[_0xfc51('0x33')]:_0x11b512[_0xfc51('0x2e')];if(!_0x3e2429['query'][_0xfc51('0x36')](_0xfc51('0x37'))){_0x1323ec['limit']=qs[_0xfc51('0x19')](_0x3e2429[_0xfc51('0x30')]['limit']);_0x1323ec['offset']=qs[_0xfc51('0x18')](_0x3e2429['query'][_0xfc51('0x18')]);}_0x1323ec['order']=qs[_0xfc51('0x38')](_0x3e2429[_0xfc51('0x30')][_0xfc51('0x38')]);_0x1323ec[_0xfc51('0x39')]=qs[_0xfc51('0x31')](_['pick'](_0x3e2429[_0xfc51('0x30')],_0x11b512['filters']),_0x4bb239);if(_0x3e2429['query'][_0xfc51('0x3a')]){_0x1323ec[_0xfc51('0x39')]=_[_0xfc51('0x3b')](_0x1323ec[_0xfc51('0x39')],{'$or':[{'key':{'$like':'%'+_0x3e2429[_0xfc51('0x30')][_0xfc51('0x3a')]+'%'}},{'value':{'$like':'%'+_0x3e2429[_0xfc51('0x30')][_0xfc51('0x3a')]+'%'}}]});}_0x1323ec=_['merge']({},_0x1323ec,_0x3e2429[_0xfc51('0x3c')]);var _0x368855={'where':_0x1323ec[_0xfc51('0x39')]};return db[_0xfc51('0x2c')][_0xfc51('0x1b')](_0x368855)[_0xfc51('0x21')](function(_0x3192b9){_0x2f26bc[_0xfc51('0x1b')]=_0x3192b9;if(_0x3e2429[_0xfc51('0x30')][_0xfc51('0x3d')]){_0x1323ec[_0xfc51('0x3e')]=[{'all':!![]}];}return db[_0xfc51('0x2c')][_0xfc51('0x3f')](_0x1323ec);})['then'](function(_0x168008){_0x2f26bc['rows']=_0x168008;return _0x2f26bc;})['then'](respondWithFilteredResult(_0x203ee3,_0x1323ec))[_0xfc51('0x40')](handleError(_0x203ee3,null));};exports['show']=function(_0x35965d,_0x211c22){var _0x5d896a={'raw':!![],'where':{'id':_0x35965d['params']['id']}},_0x527f54={};_0x527f54[_0xfc51('0x2e')]=_['keys'](db[_0xfc51('0x2c')][_0xfc51('0x41')]);_0x527f54['query']=_['keys'](_0x35965d[_0xfc51('0x30')]);_0x527f54['filters']=_['intersection'](_0x527f54[_0xfc51('0x2e')],_0x527f54['query']);_0x5d896a[_0xfc51('0x33')]=_['intersection'](_0x527f54['model'],qs[_0xfc51('0x34')](_0x35965d[_0xfc51('0x30')][_0xfc51('0x34')]));_0x5d896a[_0xfc51('0x33')]=_0x5d896a['attributes'][_0xfc51('0x35')]?_0x5d896a[_0xfc51('0x33')]:_0x527f54[_0xfc51('0x2e')];if(_0x35965d['query'][_0xfc51('0x3d')]){_0x5d896a[_0xfc51('0x3e')]=[{'all':!![]}];}_0x5d896a=_['merge']({},_0x5d896a,_0x35965d[_0xfc51('0x3c')]);return db['CannedAnswer'][_0xfc51('0x42')](_0x5d896a)[_0xfc51('0x21')](handleEntityNotFound(_0x211c22,null))[_0xfc51('0x21')](respondWithResult(_0x211c22,null))[_0xfc51('0x40')](handleError(_0x211c22,null));};exports[_0xfc51('0x20')]=function(_0x5a6789,_0x3ec24c){if(_0x5a6789[_0xfc51('0x43')]['id']){delete _0x5a6789['body']['id'];}return db[_0xfc51('0x2c')][_0xfc51('0x42')]({'where':{'id':_0x5a6789['params']['id']}})[_0xfc51('0x21')](handleEntityNotFound(_0x3ec24c,null))[_0xfc51('0x21')](saveUpdates(_0x5a6789[_0xfc51('0x43')],null))[_0xfc51('0x21')](respondWithResult(_0x3ec24c,null))[_0xfc51('0x40')](handleError(_0x3ec24c,null));};exports[_0xfc51('0x22')]=function(_0x2c2808,_0x1d5e44){return db[_0xfc51('0x2c')][_0xfc51('0x42')]({'where':{'id':_0x2c2808[_0xfc51('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d5e44,null))[_0xfc51('0x21')](removeEntity(_0x1d5e44,null))[_0xfc51('0x40')](handleError(_0x1d5e44,null));};exports[_0xfc51('0x45')]=function(_0x40b8c8,_0x48e0a8){var _0x5ccb7d={'key':_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x2d')]};if(_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x46')]){_0x5ccb7d[_0xfc51('0x46')]=_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x46')];}else if(_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x47')]){_0x5ccb7d['SmsAccountId']=_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x47')];}else if(_0x40b8c8[_0xfc51('0x43')][_0xfc51('0x48')]){_0x5ccb7d[_0xfc51('0x48')]=_0x40b8c8[_0xfc51('0x43')]['OpenchannelAccountId'];}else if(_0x40b8c8[_0xfc51('0x43')]['ChatWebsiteId']){_0x5ccb7d[_0xfc51('0x49')]=_0x40b8c8['body'][_0xfc51('0x49')];}return db[_0xfc51('0x2c')][_0xfc51('0x42')]({'where':_0x5ccb7d})[_0xfc51('0x21')](function(_0x586061){if(_0x586061){throw new db[(_0xfc51('0x4a'))][(_0xfc51('0x4b'))](_0xfc51('0x4c'));}return db['CannedAnswer'][_0xfc51('0x45')](_0x40b8c8[_0xfc51('0x43')]);})[_0xfc51('0x21')](function(_0x5052df){var _0x531d89=_0x40b8c8['user'][_0xfc51('0x23')]({'plain':!![]});if(!_0x531d89)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x531d89[_0xfc51('0x4d')]==='user'){var _0x1d8b40=_0x5052df[_0xfc51('0x23')]({'plain':!![]});return db[_0xfc51('0x4e')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x531d89['userProfileId']},'raw':!![]})['then'](function(_0x4032b8){if(_0x4032b8&&_0x4032b8['autoAssociation']===0x0){return db['UserProfileResource'][_0xfc51('0x45')]({'name':_0x1d8b40[_0xfc51('0x29')],'resourceId':_0x1d8b40['id'],'type':_0x4032b8['name'],'sectionId':_0x4032b8['id']},{})[_0xfc51('0x21')](function(){return _0x5052df;});}else{return _0x5052df;}})[_0xfc51('0x40')](function(_0x4a69d8){logger[_0xfc51('0x27')](_0xfc51('0x4f'),_0x4a69d8);throw _0x4a69d8;});}return _0x5052df;})[_0xfc51('0x21')](respondWithResult(_0x48e0a8,0xc9))[_0xfc51('0x40')](handleError(_0x48e0a8,null));}; \ No newline at end of file +var _0xa906=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','CannedAnswer','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','find','catch','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa906,0x153));var _0x6a90=function(_0xea9908,_0x2e2fad){_0xea9908=_0xea9908-0x0;var _0x151d6e=_0xa906[_0xea9908];return _0x151d6e;};'use strict';var emlformat=require(_0x6a90('0x0'));var rimraf=require(_0x6a90('0x1'));var zipdir=require(_0x6a90('0x2'));var jsonpatch=require(_0x6a90('0x3'));var rp=require(_0x6a90('0x4'));var moment=require(_0x6a90('0x5'));var BPromise=require(_0x6a90('0x6'));var Mustache=require(_0x6a90('0x7'));var util=require(_0x6a90('0x8'));var path=require(_0x6a90('0x9'));var sox=require(_0x6a90('0xa'));var csv=require(_0x6a90('0xb'));var ejs=require(_0x6a90('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6a90('0xd'));var crypto=require('crypto');var jsforce=require(_0x6a90('0xe'));var deskjs=require(_0x6a90('0xf'));var toCsv=require(_0x6a90('0xb'));var querystring=require(_0x6a90('0x10'));var Papa=require(_0x6a90('0x11'));var Redis=require(_0x6a90('0x12'));var authService=require(_0x6a90('0x13'));var qs=require(_0x6a90('0x14'));var as=require(_0x6a90('0x15'));var hardwareService=require(_0x6a90('0x16'));var logger=require(_0x6a90('0x17'))(_0x6a90('0x18'));var utils=require(_0x6a90('0x19'));var config=require(_0x6a90('0x1a'));var licenseUtil=require(_0x6a90('0x1b'));var db=require(_0x6a90('0x1c'))['db'];function respondWithStatusCode(_0x17d920,_0xe77256){_0xe77256=_0xe77256||0xcc;return function(_0x40ac04){if(_0x40ac04){return _0x17d920[_0x6a90('0x1d')](_0xe77256);}return _0x17d920[_0x6a90('0x1e')](_0xe77256)[_0x6a90('0x1f')]();};}function respondWithResult(_0xc61ccf,_0x101604){_0x101604=_0x101604||0xc8;return function(_0x3d1866){if(_0x3d1866){return _0xc61ccf[_0x6a90('0x1e')](_0x101604)[_0x6a90('0x20')](_0x3d1866);}};}function respondWithFilteredResult(_0x1c7d8d,_0x5e6f74){return function(_0x49a26b){if(_0x49a26b){var _0x26d34f=typeof _0x5e6f74['offset']===_0x6a90('0x21')&&typeof _0x5e6f74[_0x6a90('0x22')]===_0x6a90('0x21');var _0x5ea154=_0x49a26b[_0x6a90('0x23')];var _0x298b71=_0x26d34f?0x0:_0x5e6f74[_0x6a90('0x24')];var _0xa7006d=_0x26d34f?_0x49a26b[_0x6a90('0x23')]:_0x5e6f74[_0x6a90('0x24')]+_0x5e6f74['limit'];var _0x10756b;if(_0xa7006d>=_0x5ea154){_0xa7006d=_0x5ea154;_0x10756b=0xc8;}else{_0x10756b=0xce;}_0x1c7d8d[_0x6a90('0x1e')](_0x10756b);return _0x1c7d8d[_0x6a90('0x25')](_0x6a90('0x26'),_0x298b71+'-'+_0xa7006d+'/'+_0x5ea154)[_0x6a90('0x20')](_0x49a26b);}return null;};}function patchUpdates(_0x384863){return function(_0x1e6057){try{jsonpatch['apply'](_0x1e6057,_0x384863,!![]);}catch(_0x1eaf64){return BPromise[_0x6a90('0x27')](_0x1eaf64);}return _0x1e6057[_0x6a90('0x28')]();};}function saveUpdates(_0x585c4f,_0x2fa6c0){return function(_0x32e132){if(_0x32e132){return _0x32e132[_0x6a90('0x29')](_0x585c4f)[_0x6a90('0x2a')](function(_0x589ed7){return _0x589ed7;});}return null;};}function removeEntity(_0x496eb2,_0x2e9bd0){return function(_0x2235b7){if(_0x2235b7){return _0x2235b7[_0x6a90('0x2b')]()[_0x6a90('0x2a')](function(){var _0x700d6f=_0x2235b7[_0x6a90('0x2c')]({'plain':!![]});var _0x4ba9e6='CannedAnswers';return db[_0x6a90('0x2d')][_0x6a90('0x2b')]({'where':{'type':_0x4ba9e6,'resourceId':_0x700d6f['id']}})[_0x6a90('0x2a')](function(){return _0x2235b7;});})[_0x6a90('0x2a')](function(){_0x496eb2[_0x6a90('0x1e')](0xcc)[_0x6a90('0x1f')]();});}};}function handleEntityNotFound(_0x3907dc,_0x4ab54c){return function(_0x2bb8e8){if(!_0x2bb8e8){_0x3907dc[_0x6a90('0x1d')](0x194);}return _0x2bb8e8;};}function handleError(_0x572390,_0x46b2ee){_0x46b2ee=_0x46b2ee||0x1f4;return function(_0x735830){logger[_0x6a90('0x2e')](_0x735830[_0x6a90('0x2f')]);if(_0x735830['name']){delete _0x735830[_0x6a90('0x30')];}_0x572390[_0x6a90('0x1e')](_0x46b2ee)['send'](_0x735830);};}exports[_0x6a90('0x31')]=function(_0x44d824,_0x11df9d){var _0x401206={},_0x1cc648={},_0x1d8656={'count':0x0,'rows':[]};var _0x3cd479=_[_0x6a90('0x32')](db[_0x6a90('0x33')]['rawAttributes'],function(_0x99a32f){return{'name':_0x99a32f['fieldName'],'type':_0x99a32f[_0x6a90('0x34')][_0x6a90('0x35')]};});_0x1cc648[_0x6a90('0x36')]=_[_0x6a90('0x32')](_0x3cd479,'name');_0x1cc648[_0x6a90('0x37')]=_[_0x6a90('0x38')](_0x44d824['query']);_0x1cc648[_0x6a90('0x39')]=_[_0x6a90('0x3a')](_0x1cc648[_0x6a90('0x36')],_0x1cc648[_0x6a90('0x37')]);_0x401206[_0x6a90('0x3b')]=_[_0x6a90('0x3a')](_0x1cc648['model'],qs[_0x6a90('0x3c')](_0x44d824['query'][_0x6a90('0x3c')]));_0x401206['attributes']=_0x401206['attributes'][_0x6a90('0x3d')]?_0x401206['attributes']:_0x1cc648['model'];if(!_0x44d824[_0x6a90('0x37')][_0x6a90('0x3e')](_0x6a90('0x3f'))){_0x401206[_0x6a90('0x22')]=qs[_0x6a90('0x22')](_0x44d824[_0x6a90('0x37')][_0x6a90('0x22')]);_0x401206['offset']=qs[_0x6a90('0x24')](_0x44d824['query'][_0x6a90('0x24')]);}_0x401206['order']=qs['sort'](_0x44d824[_0x6a90('0x37')][_0x6a90('0x40')]);_0x401206['where']=qs[_0x6a90('0x39')](_[_0x6a90('0x41')](_0x44d824[_0x6a90('0x37')],_0x1cc648[_0x6a90('0x39')]),_0x3cd479);if(_0x44d824['query'][_0x6a90('0x42')]){_0x401206[_0x6a90('0x43')]=_[_0x6a90('0x44')](_0x401206[_0x6a90('0x43')],{'$or':[{'key':{'$like':'%'+_0x44d824[_0x6a90('0x37')]['filter']+'%'}},{'value':{'$like':'%'+_0x44d824[_0x6a90('0x37')][_0x6a90('0x42')]+'%'}}]});}_0x401206=_[_0x6a90('0x44')]({},_0x401206,_0x44d824[_0x6a90('0x45')]);var _0x3db206={'where':_0x401206[_0x6a90('0x43')]};return db['CannedAnswer'][_0x6a90('0x23')](_0x3db206)[_0x6a90('0x2a')](function(_0x1ccab2){_0x1d8656[_0x6a90('0x23')]=_0x1ccab2;if(_0x44d824[_0x6a90('0x37')][_0x6a90('0x46')]){_0x401206[_0x6a90('0x47')]=[{'all':!![]}];}return db[_0x6a90('0x33')][_0x6a90('0x48')](_0x401206);})['then'](function(_0x422b3f){_0x1d8656[_0x6a90('0x49')]=_0x422b3f;return _0x1d8656;})[_0x6a90('0x2a')](respondWithFilteredResult(_0x11df9d,_0x401206))['catch'](handleError(_0x11df9d,null));};exports['show']=function(_0x57f210,_0x28c71b){var _0x156f98={'raw':!![],'where':{'id':_0x57f210['params']['id']}},_0x98f00f={};_0x98f00f[_0x6a90('0x36')]=_[_0x6a90('0x38')](db[_0x6a90('0x33')]['rawAttributes']);_0x98f00f['query']=_[_0x6a90('0x38')](_0x57f210[_0x6a90('0x37')]);_0x98f00f['filters']=_[_0x6a90('0x3a')](_0x98f00f[_0x6a90('0x36')],_0x98f00f[_0x6a90('0x37')]);_0x156f98[_0x6a90('0x3b')]=_[_0x6a90('0x3a')](_0x98f00f[_0x6a90('0x36')],qs['fields'](_0x57f210[_0x6a90('0x37')][_0x6a90('0x3c')]));_0x156f98['attributes']=_0x156f98[_0x6a90('0x3b')][_0x6a90('0x3d')]?_0x156f98['attributes']:_0x98f00f[_0x6a90('0x36')];if(_0x57f210[_0x6a90('0x37')][_0x6a90('0x46')]){_0x156f98['include']=[{'all':!![]}];}_0x156f98=_['merge']({},_0x156f98,_0x57f210[_0x6a90('0x45')]);return db[_0x6a90('0x33')][_0x6a90('0x4a')](_0x156f98)[_0x6a90('0x2a')](handleEntityNotFound(_0x28c71b,null))['then'](respondWithResult(_0x28c71b,null))[_0x6a90('0x4b')](handleError(_0x28c71b,null));};exports[_0x6a90('0x29')]=function(_0x34d409,_0x5c4dde){if(_0x34d409[_0x6a90('0x4c')]['id']){delete _0x34d409[_0x6a90('0x4c')]['id'];}return db[_0x6a90('0x33')][_0x6a90('0x4a')]({'where':{'id':_0x34d409[_0x6a90('0x4d')]['id']}})[_0x6a90('0x2a')](handleEntityNotFound(_0x5c4dde,null))[_0x6a90('0x2a')](saveUpdates(_0x34d409[_0x6a90('0x4c')],null))[_0x6a90('0x2a')](respondWithResult(_0x5c4dde,null))[_0x6a90('0x4b')](handleError(_0x5c4dde,null));};exports[_0x6a90('0x2b')]=function(_0x219e12,_0x172ca0){return db[_0x6a90('0x33')][_0x6a90('0x4a')]({'where':{'id':_0x219e12[_0x6a90('0x4d')]['id']}})[_0x6a90('0x2a')](handleEntityNotFound(_0x172ca0,null))[_0x6a90('0x2a')](removeEntity(_0x172ca0,null))[_0x6a90('0x4b')](handleError(_0x172ca0,null));};exports[_0x6a90('0x4e')]=function(_0x662dfa,_0x1e3caa){var _0x58fb39={'key':_0x662dfa['body'][_0x6a90('0x35')]};if(_0x662dfa[_0x6a90('0x4c')][_0x6a90('0x4f')]){_0x58fb39[_0x6a90('0x4f')]=_0x662dfa['body']['MailAccountId'];}else if(_0x662dfa[_0x6a90('0x4c')][_0x6a90('0x50')]){_0x58fb39[_0x6a90('0x50')]=_0x662dfa[_0x6a90('0x4c')]['SmsAccountId'];}else if(_0x662dfa[_0x6a90('0x4c')][_0x6a90('0x51')]){_0x58fb39['OpenchannelAccountId']=_0x662dfa[_0x6a90('0x4c')][_0x6a90('0x51')];}else if(_0x662dfa['body'][_0x6a90('0x52')]){_0x58fb39[_0x6a90('0x52')]=_0x662dfa[_0x6a90('0x4c')]['ChatWebsiteId'];}return db[_0x6a90('0x33')][_0x6a90('0x4a')]({'where':_0x58fb39})[_0x6a90('0x2a')](function(_0x1e0739){if(_0x1e0739){throw new db['Sequelize'][(_0x6a90('0x53'))](_0x6a90('0x54'));}return db[_0x6a90('0x33')]['create'](_0x662dfa['body']);})['then'](function(_0x3b1b88){var _0x5b64ca=_0x662dfa[_0x6a90('0x55')]['get']({'plain':!![]});if(!_0x5b64ca)throw new Error(_0x6a90('0x56'));if(_0x5b64ca[_0x6a90('0x57')]===_0x6a90('0x55')){var _0x10ba1c=_0x3b1b88[_0x6a90('0x2c')]({'plain':!![]});return db[_0x6a90('0x58')][_0x6a90('0x4a')]({'where':{'name':_0x6a90('0x59'),'userProfileId':_0x5b64ca[_0x6a90('0x5a')]},'raw':!![]})[_0x6a90('0x2a')](function(_0x260ca1){if(_0x260ca1&&_0x260ca1['autoAssociation']===0x0){return db['UserProfileResource'][_0x6a90('0x4e')]({'name':_0x10ba1c[_0x6a90('0x30')],'resourceId':_0x10ba1c['id'],'type':_0x260ca1[_0x6a90('0x30')],'sectionId':_0x260ca1['id']},{})[_0x6a90('0x2a')](function(){return _0x3b1b88;});}else{return _0x3b1b88;}})[_0x6a90('0x4b')](function(_0x15fcaa){logger[_0x6a90('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15fcaa);throw _0x15fcaa;});}return _0x3b1b88;})[_0x6a90('0x2a')](respondWithResult(_0x1e3caa,0xc9))['catch'](handleError(_0x1e3caa,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 69b32be..0da379c 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 _0x2db4=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CannedAnswer'];(function(_0x14d811,_0x516ede){var _0x5cc16b=function(_0x54bb8d){while(--_0x54bb8d){_0x14d811['push'](_0x14d811['shift']());}};_0x5cc16b(++_0x516ede);}(_0x2db4,0xd5));var _0x42db=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2db4[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x42db('0x0'));var logger=require(_0x42db('0x1'))(_0x42db('0x2'));var moment=require(_0x42db('0x3'));var BPromise=require(_0x42db('0x4'));var rp=require(_0x42db('0x5'));var fs=require('fs');var path=require(_0x42db('0x6'));var rimraf=require('rimraf');var config=require(_0x42db('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x42db('0x8')]=function(_0x1bccb4,_0x3b612c){return _0x1bccb4[_0x42db('0x9')](_0x42db('0xa'),attributes,{'tableName':_0x42db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42db('0xc'),'collate':_0x42db('0xd')});}; \ No newline at end of file +var _0x573d=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x573d,0x13d));var _0xd573=function(_0x50d32c,_0x35f9f6){_0x50d32c=_0x50d32c-0x0;var _0x3f9d9b=_0x573d[_0x50d32c];return _0x3f9d9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd573('0x0'))('api');var moment=require(_0xd573('0x1'));var BPromise=require('bluebird');var rp=require(_0xd573('0x2'));var fs=require('fs');var path=require(_0xd573('0x3'));var rimraf=require(_0xd573('0x4'));var config=require(_0xd573('0x5'));var attributes=require(_0xd573('0x6'));module[_0xd573('0x7')]=function(_0x116397,_0x453248){return _0x116397[_0xd573('0x8')](_0xd573('0x9'),attributes,{'tableName':_0xd573('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd573('0xb'),'collate':_0xd573('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b3cfbd7..6036461 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(_0x59214e,_0x51ccde){var _0x176bb3=function(_0x4c9a00){while(--_0x4c9a00){_0x59214e['push'](_0x59214e['shift']());}};_0x176bb3(++_0x51ccde);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x567e06,_0x5b5845){var _0x1041e2=function(_0xc8eab1){while(--_0xc8eab1){_0x567e06['push'](_0x567e06['shift']());}};_0x1041e2(++_0x5b5845);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 d077a3b..5029fc0 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 _0xd947=['delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','create','/:id','update'];(function(_0x4f24a5,_0x13038f){var _0x3d53e4=function(_0x1365f3){while(--_0x1365f3){_0x4f24a5['push'](_0x4f24a5['shift']());}};_0x3d53e4(++_0x13038f);}(_0xd947,0x1d0));var _0x7d94=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd947[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7d94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7d94('0x1'));var express=require(_0x7d94('0x2'));var router=express[_0x7d94('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d94('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7d94('0x5'));var controller=require(_0x7d94('0x6'));router['get']('/',auth[_0x7d94('0x7')](),controller['index']);router[_0x7d94('0x8')]('/:id',auth[_0x7d94('0x7')](),controller['show']);router['post']('/',auth[_0x7d94('0x7')](),controller[_0x7d94('0x9')]);router['put'](_0x7d94('0xa'),auth[_0x7d94('0x7')](),controller[_0x7d94('0xb')]);router[_0x7d94('0xc')](_0x7d94('0xa'),auth[_0x7d94('0x7')](),controller['destroy']);module[_0x7d94('0xd')]=router; \ No newline at end of file +var _0x41fe=['delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','/:id','show','post','update'];(function(_0xcdecea,_0x3337ac){var _0x2546cb=function(_0x3a4764){while(--_0x3a4764){_0xcdecea['push'](_0xcdecea['shift']());}};_0x2546cb(++_0x3337ac);}(_0x41fe,0x19b));var _0xe41f=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x41fe[_0x38eb23];return _0x48506a;};'use strict';var multer=require(_0xe41f('0x0'));var util=require('util');var path=require(_0xe41f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe41f('0x2')]();var fs_extra=require(_0xe41f('0x3'));var auth=require(_0xe41f('0x4'));var interaction=require(_0xe41f('0x5'));var config=require(_0xe41f('0x6'));var controller=require(_0xe41f('0x7'));router['get']('/',auth[_0xe41f('0x8')](),controller['index']);router[_0xe41f('0x9')](_0xe41f('0xa'),auth['isAuthenticated'](),controller[_0xe41f('0xb')]);router[_0xe41f('0xc')]('/',auth[_0xe41f('0x8')](),controller['create']);router['put']('/:id',auth[_0xe41f('0x8')](),controller[_0xe41f('0xd')]);router[_0xe41f('0xe')](_0xe41f('0xa'),auth[_0xe41f('0x8')](),controller[_0xe41f('0xf')]);module[_0xe41f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index fb5b276..4b1b968 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 _0x1cbb=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x5558c1,_0x8490c0){var _0xeba302=function(_0x4028d6){while(--_0x4028d6){_0x5558c1['push'](_0x5558c1['shift']());}};_0xeba302(++_0x8490c0);}(_0x1cbb,0x18f));var _0xb1cb=function(_0x2b6f51,_0xa34d8c){_0x2b6f51=_0x2b6f51-0x0;var _0x5db73e=_0x1cbb[_0x2b6f51];return _0x5db73e;};'use strict';var Sequelize=require(_0xb1cb('0x0'));module[_0xb1cb('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb1cb('0x2')},'clid':{'type':Sequelize[_0xb1cb('0x3')]},'src':{'type':Sequelize[_0xb1cb('0x3')]},'dst':{'type':Sequelize[_0xb1cb('0x3')]},'dcontext':{'type':Sequelize[_0xb1cb('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xb1cb('0x3')]},'lastapp':{'type':Sequelize[_0xb1cb('0x3')]},'lastdata':{'type':Sequelize[_0xb1cb('0x3')]},'duration':{'type':Sequelize[_0xb1cb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb1cb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb1cb('0x3')]},'amaflags':{'type':Sequelize[_0xb1cb('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb1cb('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb1cb('0x3')]},'sequence':{'type':Sequelize[_0xb1cb('0x3')]},'peeraccount':{'type':Sequelize[_0xb1cb('0x3')]},'type':{'type':Sequelize[_0xb1cb('0x3')]},'tag':{'type':Sequelize[_0xb1cb('0x3')]}}; \ No newline at end of file +var _0x2917=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x44f8bc,_0x2119e2){var _0x33aaa7=function(_0x34edee){while(--_0x34edee){_0x44f8bc['push'](_0x44f8bc['shift']());}};_0x33aaa7(++_0x2119e2);}(_0x2917,0x142));var _0x7291=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x2917[_0x15bbf1];return _0x5c4b47;};'use strict';var Sequelize=require(_0x7291('0x0'));module[_0x7291('0x1')]={'calldate':{'type':Sequelize[_0x7291('0x2')],'allowNull':![],'defaultValue':_0x7291('0x3')},'clid':{'type':Sequelize[_0x7291('0x4')]},'src':{'type':Sequelize[_0x7291('0x4')]},'dst':{'type':Sequelize[_0x7291('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7291('0x4')]},'lastapp':{'type':Sequelize[_0x7291('0x4')]},'lastdata':{'type':Sequelize[_0x7291('0x4')]},'duration':{'type':Sequelize[_0x7291('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7291('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7291('0x4')]},'amaflags':{'type':Sequelize[_0x7291('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7291('0x4')]},'userfield':{'type':Sequelize[_0x7291('0x4')]},'uniqueid':{'type':Sequelize[_0x7291('0x4')]},'linkedid':{'type':Sequelize[_0x7291('0x4')]},'sequence':{'type':Sequelize[_0x7291('0x4')]},'peeraccount':{'type':Sequelize[_0x7291('0x4')]},'type':{'type':Sequelize[_0x7291('0x4')]},'tag':{'type':Sequelize[_0x7291('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a36c7c6..5335ef5 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 _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','Cdr','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x38abf6,_0x845640){var _0x42a1ab=function(_0x9e1a88){while(--_0x9e1a88){_0x38abf6['push'](_0x38abf6['shift']());}};_0x42a1ab(++_0x845640);}(_0x814b,0x1a2));var _0xb814=function(_0x32f193,_0x612afc){_0x32f193=_0x32f193-0x0;var _0x5bb92e=_0x814b[_0x32f193];return _0x5bb92e;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['Cdr'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['Cdr'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));}; \ No newline at end of file +var _0x6363=['destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6363,0x13a));var _0x3636=function(_0x1deed5,_0x3e4a17){_0x1deed5=_0x1deed5-0x0;var _0xd943b1=_0x6363[_0x1deed5];return _0xd943b1;};'use strict';var emlformat=require(_0x3636('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3636('0x1'));var jsonpatch=require(_0x3636('0x2'));var rp=require(_0x3636('0x3'));var moment=require(_0x3636('0x4'));var BPromise=require(_0x3636('0x5'));var Mustache=require(_0x3636('0x6'));var util=require(_0x3636('0x7'));var path=require(_0x3636('0x8'));var sox=require(_0x3636('0x9'));var csv=require(_0x3636('0xa'));var ejs=require(_0x3636('0xb'));var fs=require('fs');var fs_extra=require(_0x3636('0xc'));var _=require(_0x3636('0xd'));var squel=require(_0x3636('0xe'));var crypto=require('crypto');var jsforce=require(_0x3636('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3636('0xa'));var querystring=require(_0x3636('0x10'));var Papa=require(_0x3636('0x11'));var Redis=require(_0x3636('0x12'));var authService=require(_0x3636('0x13'));var qs=require(_0x3636('0x14'));var as=require(_0x3636('0x15'));var hardwareService=require(_0x3636('0x16'));var logger=require(_0x3636('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3636('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3636('0x19'))['db'];function respondWithStatusCode(_0x41ddae,_0x62d6f9){_0x62d6f9=_0x62d6f9||0xcc;return function(_0x13ca35){if(_0x13ca35){return _0x41ddae[_0x3636('0x1a')](_0x62d6f9);}return _0x41ddae[_0x3636('0x1b')](_0x62d6f9)[_0x3636('0x1c')]();};}function respondWithResult(_0x12dfa9,_0x3295ab){_0x3295ab=_0x3295ab||0xc8;return function(_0x7b4b16){if(_0x7b4b16){return _0x12dfa9[_0x3636('0x1b')](_0x3295ab)[_0x3636('0x1d')](_0x7b4b16);}};}function respondWithFilteredResult(_0xcb2aa3,_0x3fc712){return function(_0x23cc34){if(_0x23cc34){var _0x3cbd0d=typeof _0x3fc712[_0x3636('0x1e')]==='undefined'&&typeof _0x3fc712[_0x3636('0x1f')]===_0x3636('0x20');var _0x4aa7fc=_0x23cc34[_0x3636('0x21')];var _0x5aa0ff=_0x3cbd0d?0x0:_0x3fc712['offset'];var _0xae6469=_0x3cbd0d?_0x23cc34[_0x3636('0x21')]:_0x3fc712[_0x3636('0x1e')]+_0x3fc712[_0x3636('0x1f')];var _0xe0e633;if(_0xae6469>=_0x4aa7fc){_0xae6469=_0x4aa7fc;_0xe0e633=0xc8;}else{_0xe0e633=0xce;}_0xcb2aa3[_0x3636('0x1b')](_0xe0e633);return _0xcb2aa3[_0x3636('0x22')](_0x3636('0x23'),_0x5aa0ff+'-'+_0xae6469+'/'+_0x4aa7fc)['json'](_0x23cc34);}return null;};}function patchUpdates(_0x48f598){return function(_0x316930){try{jsonpatch[_0x3636('0x24')](_0x316930,_0x48f598,!![]);}catch(_0x42b271){return BPromise['reject'](_0x42b271);}return _0x316930[_0x3636('0x25')]();};}function saveUpdates(_0xa46471,_0x15a0b3){return function(_0xe34cd9){if(_0xe34cd9){return _0xe34cd9[_0x3636('0x26')](_0xa46471)[_0x3636('0x27')](function(_0x4f5b0e){return _0x4f5b0e;});}return null;};}function removeEntity(_0x517fda,_0x368356){return function(_0x4ee098){if(_0x4ee098){return _0x4ee098['destroy']()[_0x3636('0x27')](function(){_0x517fda['status'](0xcc)[_0x3636('0x1c')]();});}};}function handleEntityNotFound(_0x4c24cf,_0x36f4c5){return function(_0x477c34){if(!_0x477c34){_0x4c24cf[_0x3636('0x1a')](0x194);}return _0x477c34;};}function handleError(_0x201ea1,_0x112b96){_0x112b96=_0x112b96||0x1f4;return function(_0x20ca8b){logger[_0x3636('0x28')](_0x20ca8b[_0x3636('0x29')]);if(_0x20ca8b[_0x3636('0x2a')]){delete _0x20ca8b[_0x3636('0x2a')];}_0x201ea1[_0x3636('0x1b')](_0x112b96)['send'](_0x20ca8b);};}exports[_0x3636('0x2b')]=function(_0x236f54,_0x2d644c){var _0x22b12f={},_0xd37c62={},_0x17e062={'count':0x0,'rows':[]};var _0x52ad91=_[_0x3636('0x2c')](db[_0x3636('0x2d')]['rawAttributes'],function(_0x8fffb0){return{'name':_0x8fffb0[_0x3636('0x2e')],'type':_0x8fffb0[_0x3636('0x2f')][_0x3636('0x30')]};});_0xd37c62[_0x3636('0x31')]=_['map'](_0x52ad91,_0x3636('0x2a'));_0xd37c62[_0x3636('0x32')]=_[_0x3636('0x33')](_0x236f54[_0x3636('0x32')]);_0xd37c62[_0x3636('0x34')]=_[_0x3636('0x35')](_0xd37c62[_0x3636('0x31')],_0xd37c62[_0x3636('0x32')]);_0x22b12f[_0x3636('0x36')]=_['intersection'](_0xd37c62['model'],qs[_0x3636('0x37')](_0x236f54['query']['fields']));_0x22b12f[_0x3636('0x36')]=_0x22b12f[_0x3636('0x36')][_0x3636('0x38')]?_0x22b12f['attributes']:_0xd37c62[_0x3636('0x31')];if(!_0x236f54[_0x3636('0x32')][_0x3636('0x39')](_0x3636('0x3a'))){_0x22b12f[_0x3636('0x1f')]=qs[_0x3636('0x1f')](_0x236f54[_0x3636('0x32')][_0x3636('0x1f')]);_0x22b12f[_0x3636('0x1e')]=qs[_0x3636('0x1e')](_0x236f54[_0x3636('0x32')][_0x3636('0x1e')]);}_0x22b12f[_0x3636('0x3b')]=qs['sort'](_0x236f54[_0x3636('0x32')][_0x3636('0x3c')]);_0x22b12f[_0x3636('0x3d')]=qs[_0x3636('0x34')](_['pick'](_0x236f54['query'],_0xd37c62[_0x3636('0x34')]),_0x52ad91);if(_0x236f54[_0x3636('0x32')][_0x3636('0x3e')]){_0x22b12f['where']=_[_0x3636('0x3f')](_0x22b12f[_0x3636('0x3d')],{'$or':_['map'](_0x52ad91,function(_0x58f03d){if(_0x58f03d[_0x3636('0x2f')]!=='VIRTUAL'){var _0x8c04cf={};_0x8c04cf[_0x58f03d[_0x3636('0x2a')]]={'$like':'%'+_0x236f54[_0x3636('0x32')][_0x3636('0x3e')]+'%'};return _0x8c04cf;}})});}_0x22b12f=_[_0x3636('0x3f')]({},_0x22b12f,_0x236f54[_0x3636('0x40')]);var _0x448397={'where':_0x22b12f[_0x3636('0x3d')]};return db[_0x3636('0x2d')]['count'](_0x448397)[_0x3636('0x27')](function(_0x44cb9c){_0x17e062[_0x3636('0x21')]=_0x44cb9c;if(_0x236f54[_0x3636('0x32')][_0x3636('0x41')]){_0x22b12f[_0x3636('0x42')]=[{'all':!![]}];}return db[_0x3636('0x2d')][_0x3636('0x43')](_0x22b12f);})[_0x3636('0x27')](function(_0x4df331){_0x17e062[_0x3636('0x44')]=_0x4df331;return _0x17e062;})[_0x3636('0x27')](respondWithFilteredResult(_0x2d644c,_0x22b12f))[_0x3636('0x45')](handleError(_0x2d644c,null));};exports[_0x3636('0x46')]=function(_0x9c59e0,_0x122cb2){var _0x201e2c={'raw':!![],'where':{'id':_0x9c59e0[_0x3636('0x47')]['id']}},_0x401281={};_0x401281[_0x3636('0x31')]=_[_0x3636('0x33')](db[_0x3636('0x2d')][_0x3636('0x48')]);_0x401281[_0x3636('0x32')]=_[_0x3636('0x33')](_0x9c59e0['query']);_0x401281[_0x3636('0x34')]=_[_0x3636('0x35')](_0x401281[_0x3636('0x31')],_0x401281[_0x3636('0x32')]);_0x201e2c[_0x3636('0x36')]=_[_0x3636('0x35')](_0x401281[_0x3636('0x31')],qs[_0x3636('0x37')](_0x9c59e0[_0x3636('0x32')][_0x3636('0x37')]));_0x201e2c[_0x3636('0x36')]=_0x201e2c[_0x3636('0x36')][_0x3636('0x38')]?_0x201e2c['attributes']:_0x401281['model'];if(_0x9c59e0['query'][_0x3636('0x41')]){_0x201e2c['include']=[{'all':!![]}];}_0x201e2c=_['merge']({},_0x201e2c,_0x9c59e0[_0x3636('0x40')]);return db[_0x3636('0x2d')][_0x3636('0x49')](_0x201e2c)['then'](handleEntityNotFound(_0x122cb2,null))[_0x3636('0x27')](respondWithResult(_0x122cb2,null))[_0x3636('0x45')](handleError(_0x122cb2,null));};exports[_0x3636('0x4a')]=function(_0x179410,_0x37a33e){return db[_0x3636('0x2d')][_0x3636('0x4a')](_0x179410[_0x3636('0x4b')],{})[_0x3636('0x27')](respondWithResult(_0x37a33e,0xc9))['catch'](handleError(_0x37a33e,null));};exports[_0x3636('0x26')]=function(_0x33c140,_0x16b65a){if(_0x33c140[_0x3636('0x4b')]['id']){delete _0x33c140[_0x3636('0x4b')]['id'];}return db[_0x3636('0x2d')]['find']({'where':{'id':_0x33c140[_0x3636('0x47')]['id']}})[_0x3636('0x27')](handleEntityNotFound(_0x16b65a,null))[_0x3636('0x27')](saveUpdates(_0x33c140[_0x3636('0x4b')],null))[_0x3636('0x27')](respondWithResult(_0x16b65a,null))['catch'](handleError(_0x16b65a,null));};exports[_0x3636('0x4c')]=function(_0x285ff1,_0xa61651){return db[_0x3636('0x2d')][_0x3636('0x49')]({'where':{'id':_0x285ff1['params']['id']}})[_0x3636('0x27')](handleEntityNotFound(_0xa61651,null))['then'](removeEntity(_0xa61651,null))['catch'](handleError(_0xa61651,null));};exports[_0x3636('0x4d')]=function(_0x1c1ec0,_0x2575ba){return db[_0x3636('0x2d')]['describe']()['then'](respondWithResult(_0x2575ba,null))[_0x3636('0x45')](handleError(_0x2575ba,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b65fdb1..ed96ec3 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xf188a6,_0x5b1e21){var _0x505194=function(_0x3cb441){while(--_0x3cb441){_0xf188a6['push'](_0xf188a6['shift']());}};_0x505194(++_0x5b1e21);}(_0x7a54,0x106));var _0x47a5=function(_0x58659a,_0xe67cc3){_0x58659a=_0x58659a-0x0;var _0x2aecd7=_0x7a54[_0x58659a];return _0x2aecd7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x16d5a5,_0x57b153){var _0x3681e8=function(_0x35cbc6){while(--_0x35cbc6){_0x16d5a5['push'](_0x16d5a5['shift']());}};_0x3681e8(++_0x57b153);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 2c861a7..8dd8218 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 _0xb61a=['info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0xcef9b7,_0x4baa48){var _0x363efe=function(_0x3cc747){while(--_0x3cc747){_0xcef9b7['push'](_0xcef9b7['shift']());}};_0x363efe(++_0x4baa48);}(_0xb61a,0x1d5));var _0xab61=function(_0x17cb1f,_0x4c252e){_0x17cb1f=_0x17cb1f-0x0;var _0x2e37ba=_0xb61a[_0x17cb1f];return _0x2e37ba;};'use strict';var _=require(_0xab61('0x0'));var util=require(_0xab61('0x1'));var moment=require(_0xab61('0x2'));var BPromise=require(_0xab61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab61('0x4'));var db=require(_0xab61('0x5'))['db'];var utils=require(_0xab61('0x6'));var logger=require('../../config/logger')(_0xab61('0x7'));var config=require(_0xab61('0x8'));var jayson=require(_0xab61('0x9'));var client=jayson[_0xab61('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1594f7,_0x411f7f,_0x56937d){return new BPromise(function(_0x2b21bd,_0x16e673){return client['request'](_0x1594f7,_0x56937d)[_0xab61('0xb')](function(_0x34bf26){logger['info'](_0xab61('0xc'),_0x411f7f,_0xab61('0xd'));logger[_0xab61('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x411f7f,_0xab61('0xd'),JSON['stringify'](_0x34bf26));if(_0x34bf26['error']){if(_0x34bf26[_0xab61('0xf')]['code']===0x1f4){logger[_0xab61('0xf')](_0xab61('0xc'),_0x411f7f,_0x34bf26['error']['message']);return _0x16e673(_0x34bf26[_0xab61('0xf')][_0xab61('0x10')]);}logger[_0xab61('0xf')](_0xab61('0xc'),_0x411f7f,_0x34bf26[_0xab61('0xf')][_0xab61('0x10')]);return _0x2b21bd(_0x34bf26[_0xab61('0xf')]['message']);}else{logger[_0xab61('0x11')](_0xab61('0xc'),_0x411f7f,_0xab61('0xd'));_0x2b21bd(_0x34bf26['result']['message']);}})['catch'](function(_0xa32800){logger[_0xab61('0xf')](_0xab61('0xc'),_0x411f7f,_0xa32800);_0x16e673(_0xa32800);});});} \ No newline at end of file +var _0x913f=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x553dd3,_0x250268){var _0x241581=function(_0x3ed57f){while(--_0x3ed57f){_0x553dd3['push'](_0x553dd3['shift']());}};_0x241581(++_0x250268);}(_0x913f,0x1cd));var _0xf913=function(_0xb82003,_0x26415a){_0xb82003=_0xb82003-0x0;var _0xceddc4=_0x913f[_0xb82003];return _0xceddc4;};'use strict';var _=require(_0xf913('0x0'));var util=require(_0xf913('0x1'));var moment=require(_0xf913('0x2'));var BPromise=require('bluebird');var rs=require(_0xf913('0x3'));var fs=require('fs');var Redis=require(_0xf913('0x4'));var db=require(_0xf913('0x5'))['db'];var utils=require(_0xf913('0x6'));var logger=require('../../config/logger')(_0xf913('0x7'));var config=require(_0xf913('0x8'));var jayson=require(_0xf913('0x9'));var client=jayson[_0xf913('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232da6,_0x2ac79e,_0x3ea330){return new BPromise(function(_0x4d974b,_0x4fa1d3){return client['request'](_0x232da6,_0x3ea330)[_0xf913('0xb')](function(_0x475b81){logger[_0xf913('0xc')](_0xf913('0xd'),_0x2ac79e,_0xf913('0xe'));logger[_0xf913('0xf')](_0xf913('0x10'),_0x2ac79e,_0xf913('0xe'),JSON['stringify'](_0x475b81));if(_0x475b81[_0xf913('0x11')]){if(_0x475b81['error']['code']===0x1f4){logger[_0xf913('0x11')]('Cdr,\x20%s,\x20%s',_0x2ac79e,_0x475b81[_0xf913('0x11')][_0xf913('0x12')]);return _0x4fa1d3(_0x475b81[_0xf913('0x11')]['message']);}logger['error'](_0xf913('0xd'),_0x2ac79e,_0x475b81['error'][_0xf913('0x12')]);return _0x4d974b(_0x475b81[_0xf913('0x11')]['message']);}else{logger[_0xf913('0xc')](_0xf913('0xd'),_0x2ac79e,'request\x20sent');_0x4d974b(_0x475b81['result'][_0xf913('0x12')]);}})[_0xf913('0x13')](function(_0x15b3a0){logger['error'](_0xf913('0xd'),_0x2ac79e,_0x15b3a0);_0x4fa1d3(_0x15b3a0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8c7c5ae..e744cd2 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x14bbdc,_0x49b365){var _0x5eac57=function(_0x4fa3b9){while(--_0x4fa3b9){_0x14bbdc['push'](_0x14bbdc['shift']());}};_0x5eac57(++_0x49b365);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 2a71cb5..e96e589 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 _0xcbce=['exports','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x491ad2,_0x7d2c12){var _0x4f1d5c=function(_0x290134){while(--_0x290134){_0x491ad2['push'](_0x491ad2['shift']());}};_0x4f1d5c(++_0x7d2c12);}(_0xcbce,0x6d));var _0xecbc=function(_0x204a72,_0x361f24){_0x204a72=_0x204a72-0x0;var _0x261dba=_0xcbce[_0x204a72];return _0x261dba;};'use strict';var Sequelize=require(_0xecbc('0x0'));module[_0xecbc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xecbc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xecbc('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xecbc('0x2')],'defaultValue':_0xecbc('0x4')}}; \ No newline at end of file +var _0x1946=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x5ad330,_0x3479c6){var _0x5ad041=function(_0xf86637){while(--_0xf86637){_0x5ad330['push'](_0x5ad330['shift']());}};_0x5ad041(++_0x3479c6);}(_0x1946,0x1d8));var _0x6194=function(_0x1f0ce3,_0xda3a91){_0x1f0ce3=_0x1f0ce3-0x0;var _0x395ebc=_0x1946[_0x1f0ce3];return _0x395ebc;};'use strict';var Sequelize=require(_0x6194('0x0'));module[_0x6194('0x1')]={'priority':{'type':Sequelize[_0x6194('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6194('0x3')],'allowNull':![],'defaultValue':_0x6194('0x4')},'appdata':{'type':Sequelize[_0x6194('0x5')]()},'description':{'type':Sequelize[_0x6194('0x3')]},'interval':{'type':Sequelize[_0x6194('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 68cf184..d1f4ee9 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 _0x7980=['mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','show','params','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x41b1ff,_0x15dc8a){var _0x36949c=function(_0x425ae5){while(--_0x425ae5){_0x41b1ff['push'](_0x41b1ff['shift']());}};_0x36949c(++_0x15dc8a);}(_0x7980,0xab));var _0x0798=function(_0x2a3e5e,_0x210fb0){_0x2a3e5e=_0x2a3e5e-0x0;var _0x5519a6=_0x7980[_0x2a3e5e];return _0x5519a6;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require('moment');var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0798('0xb'));var squel=require(_0x0798('0xc'));var crypto=require(_0x0798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0798('0xe'));var querystring=require(_0x0798('0xf'));var Papa=require(_0x0798('0x10'));var Redis=require(_0x0798('0x11'));var authService=require(_0x0798('0x12'));var qs=require(_0x0798('0x13'));var as=require(_0x0798('0x14'));var hardwareService=require(_0x0798('0x15'));var logger=require(_0x0798('0x16'))(_0x0798('0x17'));var utils=require('../../config/utils');var config=require(_0x0798('0x18'));var licenseUtil=require(_0x0798('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323e5,_0x588f9d){_0x588f9d=_0x588f9d||0xcc;return function(_0x376a60){if(_0x376a60){return _0x5323e5[_0x0798('0x1a')](_0x588f9d);}return _0x5323e5[_0x0798('0x1b')](_0x588f9d)[_0x0798('0x1c')]();};}function respondWithResult(_0x39bacd,_0xfd88af){_0xfd88af=_0xfd88af||0xc8;return function(_0x5f1640){if(_0x5f1640){return _0x39bacd['status'](_0xfd88af)[_0x0798('0x1d')](_0x5f1640);}};}function respondWithFilteredResult(_0x112362,_0x47be56){return function(_0x555c45){if(_0x555c45){var _0x21c30b=typeof _0x47be56[_0x0798('0x1e')]===_0x0798('0x1f')&&typeof _0x47be56['limit']==='undefined';var _0x1c6d6f=_0x555c45['count'];var _0x41e217=_0x21c30b?0x0:_0x47be56[_0x0798('0x1e')];var _0x288f41=_0x21c30b?_0x555c45[_0x0798('0x20')]:_0x47be56['offset']+_0x47be56[_0x0798('0x21')];var _0x3039d6;if(_0x288f41>=_0x1c6d6f){_0x288f41=_0x1c6d6f;_0x3039d6=0xc8;}else{_0x3039d6=0xce;}_0x112362['status'](_0x3039d6);return _0x112362[_0x0798('0x22')](_0x0798('0x23'),_0x41e217+'-'+_0x288f41+'/'+_0x1c6d6f)[_0x0798('0x1d')](_0x555c45);}return null;};}function patchUpdates(_0x44ac33){return function(_0xfbb4a5){try{jsonpatch[_0x0798('0x24')](_0xfbb4a5,_0x44ac33,!![]);}catch(_0x3a7f8b){return BPromise[_0x0798('0x25')](_0x3a7f8b);}return _0xfbb4a5[_0x0798('0x26')]();};}function saveUpdates(_0x4a86d5,_0x2aaabf){return function(_0x35c141){if(_0x35c141){return _0x35c141[_0x0798('0x27')](_0x4a86d5)[_0x0798('0x28')](function(_0x20654b){return _0x20654b;});}return null;};}function removeEntity(_0x23f283,_0x52037c){return function(_0x3f66e2){if(_0x3f66e2){return _0x3f66e2[_0x0798('0x29')]()[_0x0798('0x28')](function(){_0x23f283[_0x0798('0x1b')](0xcc)[_0x0798('0x1c')]();});}};}function handleEntityNotFound(_0x23d59c,_0x4f648a){return function(_0x43d99f){if(!_0x43d99f){_0x23d59c[_0x0798('0x1a')](0x194);}return _0x43d99f;};}function handleError(_0x11e24d,_0x4d4e0a){_0x4d4e0a=_0x4d4e0a||0x1f4;return function(_0x4bc3f3){logger['error'](_0x4bc3f3['stack']);if(_0x4bc3f3[_0x0798('0x2a')]){delete _0x4bc3f3[_0x0798('0x2a')];}_0x11e24d[_0x0798('0x1b')](_0x4d4e0a)[_0x0798('0x2b')](_0x4bc3f3);};}exports[_0x0798('0x2c')]=function(_0x161244,_0x30bec){var _0x23e770={'raw':!![],'where':{'id':_0x161244[_0x0798('0x2d')]['id']}},_0x5bbe3d={};_0x5bbe3d['model']=_['keys'](db[_0x0798('0x2e')]['rawAttributes']);_0x5bbe3d[_0x0798('0x2f')]=_['keys'](_0x161244[_0x0798('0x2f')]);_0x5bbe3d[_0x0798('0x30')]=_[_0x0798('0x31')](_0x5bbe3d[_0x0798('0x32')],_0x5bbe3d[_0x0798('0x2f')]);_0x23e770[_0x0798('0x33')]=_[_0x0798('0x31')](_0x5bbe3d[_0x0798('0x32')],qs[_0x0798('0x34')](_0x161244[_0x0798('0x2f')][_0x0798('0x34')]));_0x23e770[_0x0798('0x33')]=_0x23e770['attributes'][_0x0798('0x35')]?_0x23e770['attributes']:_0x5bbe3d['model'];if(_0x161244[_0x0798('0x2f')][_0x0798('0x36')]){_0x23e770['include']=[{'all':!![]}];}_0x23e770=_['merge']({},_0x23e770,_0x161244[_0x0798('0x37')]);return db[_0x0798('0x2e')][_0x0798('0x38')](_0x23e770)[_0x0798('0x28')](handleEntityNotFound(_0x30bec,null))[_0x0798('0x28')](respondWithResult(_0x30bec,null))[_0x0798('0x39')](handleError(_0x30bec,null));};exports['update']=function(_0x551418,_0x1db045){if(_0x551418[_0x0798('0x3a')]['id']){delete _0x551418[_0x0798('0x3a')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x551418['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x1db045,null))[_0x0798('0x28')](saveUpdates(_0x551418[_0x0798('0x3a')],null))[_0x0798('0x28')](respondWithResult(_0x1db045,null))[_0x0798('0x39')](handleError(_0x1db045,null));};exports[_0x0798('0x29')]=function(_0x238c99,_0x2524b0){return db['ChatApplication'][_0x0798('0x38')]({'where':{'id':_0x238c99['params']['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x2524b0,null))[_0x0798('0x28')](removeEntity(_0x2524b0,null))[_0x0798('0x39')](handleError(_0x2524b0,null));}; \ No newline at end of file +var _0x6324=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','show','model','keys','rawAttributes','intersection','query','fields','attributes','includeAll','include','options','ChatApplication','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x3997b8,_0x50b0d2){var _0x2fe8d5=function(_0x425119){while(--_0x425119){_0x3997b8['push'](_0x3997b8['shift']());}};_0x2fe8d5(++_0x50b0d2);}(_0x6324,0x142));var _0x4632=function(_0x3fe1ba,_0x1a33c5){_0x3fe1ba=_0x3fe1ba-0x0;var _0x5df1b4=_0x6324[_0x3fe1ba];return _0x5df1b4;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0xb074d,_0x1b8de0){return function(_0x4af026){if(!_0x4af026){_0xb074d[_0x4632('0x18')](0x194);}return _0x4af026;};}function handleError(_0x21118c,_0x372679){_0x372679=_0x372679||0x1f4;return function(_0x22d0f5){logger[_0x4632('0x28')](_0x22d0f5[_0x4632('0x29')]);if(_0x22d0f5['name']){delete _0x22d0f5['name'];}_0x21118c[_0x4632('0x19')](_0x372679)[_0x4632('0x2a')](_0x22d0f5);};}exports[_0x4632('0x2b')]=function(_0x35a533,_0x34079f){var _0x119d1b={'raw':!![],'where':{'id':_0x35a533['params']['id']}},_0x3570b2={};_0x3570b2[_0x4632('0x2c')]=_[_0x4632('0x2d')](db['ChatApplication'][_0x4632('0x2e')]);_0x3570b2['query']=_[_0x4632('0x2d')](_0x35a533['query']);_0x3570b2['filters']=_[_0x4632('0x2f')](_0x3570b2[_0x4632('0x2c')],_0x3570b2[_0x4632('0x30')]);_0x119d1b['attributes']=_['intersection'](_0x3570b2[_0x4632('0x2c')],qs[_0x4632('0x31')](_0x35a533['query']['fields']));_0x119d1b[_0x4632('0x32')]=_0x119d1b[_0x4632('0x32')]['length']?_0x119d1b[_0x4632('0x32')]:_0x3570b2[_0x4632('0x2c')];if(_0x35a533[_0x4632('0x30')][_0x4632('0x33')]){_0x119d1b[_0x4632('0x34')]=[{'all':!![]}];}_0x119d1b=_['merge']({},_0x119d1b,_0x35a533[_0x4632('0x35')]);return db[_0x4632('0x36')]['find'](_0x119d1b)['then'](handleEntityNotFound(_0x34079f,null))[_0x4632('0x26')](respondWithResult(_0x34079f,null))['catch'](handleError(_0x34079f,null));};exports['update']=function(_0x196b3b,_0x5d34ac){if(_0x196b3b[_0x4632('0x37')]['id']){delete _0x196b3b[_0x4632('0x37')]['id'];}return db[_0x4632('0x36')]['find']({'where':{'id':_0x196b3b[_0x4632('0x38')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x5d34ac,null))[_0x4632('0x26')](saveUpdates(_0x196b3b[_0x4632('0x37')],null))[_0x4632('0x26')](respondWithResult(_0x5d34ac,null))['catch'](handleError(_0x5d34ac,null));};exports['destroy']=function(_0x3114c4,_0xd90c7c){return db[_0x4632('0x36')]['find']({'where':{'id':_0x3114c4['params']['id']}})['then'](handleEntityNotFound(_0xd90c7c,null))[_0x4632('0x26')](removeEntity(_0xd90c7c,null))[_0x4632('0x39')](handleError(_0xd90c7c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4d12cd3..a2ddc46 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 _0x0e9f=['utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4'];(function(_0x4186fa,_0x26a01c){var _0x136990=function(_0x13324f){while(--_0x13324f){_0x4186fa['push'](_0x4186fa['shift']());}};_0x136990(++_0x26a01c);}(_0x0e9f,0x7a));var _0xf0e9=function(_0x26cad8,_0xf24972){_0x26cad8=_0x26cad8-0x0;var _0x152825=_0x0e9f[_0x26cad8];return _0x152825;};'use strict';var _=require('lodash');var util=require(_0xf0e9('0x0'));var logger=require(_0xf0e9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0e9('0x2'));var fs=require('fs');var path=require(_0xf0e9('0x3'));var rimraf=require(_0xf0e9('0x4'));var config=require(_0xf0e9('0x5'));var attributes=require(_0xf0e9('0x6'));module[_0xf0e9('0x7')]=function(_0xd7134d,_0x1c9a31){return _0xd7134d[_0xf0e9('0x8')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf0e9('0x9'),'collate':_0xf0e9('0xa')});}; \ No newline at end of file +var _0x3148=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x186ce8,_0x280b8c){var _0x303381=function(_0x598d53){while(--_0x598d53){_0x186ce8['push'](_0x186ce8['shift']());}};_0x303381(++_0x280b8c);}(_0x3148,0x172));var _0x8314=function(_0x5aba03,_0x161ec6){_0x5aba03=_0x5aba03-0x0;var _0x24d080=_0x3148[_0x5aba03];return _0x24d080;};'use strict';var _=require('lodash');var util=require(_0x8314('0x0'));var logger=require('../../config/logger')(_0x8314('0x1'));var moment=require(_0x8314('0x2'));var BPromise=require(_0x8314('0x3'));var rp=require(_0x8314('0x4'));var fs=require('fs');var path=require(_0x8314('0x5'));var rimraf=require(_0x8314('0x6'));var config=require('../../config/environment');var attributes=require(_0x8314('0x7'));module[_0x8314('0x8')]=function(_0x353ee9,_0x1891f5){return _0x353ee9[_0x8314('0x9')]('ChatApplication',attributes,{'tableName':_0x8314('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8314('0xb'),'collate':_0x8314('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 64ccda2..22e9582 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 _0x14f5=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x14f5,0x1e3));var _0x514f=function(_0x3cc7db,_0x36b9a5){_0x3cc7db=_0x3cc7db-0x0;var _0x3a9d0d=_0x14f5[_0x3cc7db];return _0x3a9d0d;};'use strict';var _=require(_0x514f('0x0'));var util=require('util');var moment=require(_0x514f('0x1'));var BPromise=require(_0x514f('0x2'));var rs=require(_0x514f('0x3'));var fs=require('fs');var Redis=require(_0x514f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x514f('0x5'))(_0x514f('0x6'));var config=require(_0x514f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x514f('0x8')][_0x514f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b1d66,_0x2c1f3b,_0x3da564){return new BPromise(function(_0x2bc8bc,_0x59cdf0){return client[_0x514f('0xa')](_0x5b1d66,_0x3da564)['then'](function(_0x4e4bae){logger[_0x514f('0xb')](_0x514f('0xc'),_0x2c1f3b,'request\x20sent');logger[_0x514f('0xd')](_0x514f('0xe'),_0x2c1f3b,_0x514f('0xf'),JSON[_0x514f('0x10')](_0x4e4bae));if(_0x4e4bae[_0x514f('0x11')]){if(_0x4e4bae[_0x514f('0x11')][_0x514f('0x12')]===0x1f4){logger['error'](_0x514f('0xc'),_0x2c1f3b,_0x4e4bae[_0x514f('0x11')][_0x514f('0x13')]);return _0x59cdf0(_0x4e4bae[_0x514f('0x11')][_0x514f('0x13')]);}logger['error'](_0x514f('0xc'),_0x2c1f3b,_0x4e4bae[_0x514f('0x11')][_0x514f('0x13')]);return _0x2bc8bc(_0x4e4bae[_0x514f('0x11')][_0x514f('0x13')]);}else{logger[_0x514f('0xb')]('ChatApplication,\x20%s,\x20%s',_0x2c1f3b,'request\x20sent');_0x2bc8bc(_0x4e4bae['result']['message']);}})[_0x514f('0x14')](function(_0x3160ba){logger[_0x514f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x2c1f3b,_0x3160ba);_0x59cdf0(_0x3160ba);});});} \ No newline at end of file +var _0xc724=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x4c9cfc,_0x4f2163){var _0x442708=function(_0x26ba25){while(--_0x26ba25){_0x4c9cfc['push'](_0x4c9cfc['shift']());}};_0x442708(++_0x4f2163);}(_0xc724,0x94));var _0x4c72=function(_0x355b11,_0x2dd13f){_0x355b11=_0x355b11-0x0;var _0x4e506c=_0xc724[_0x355b11];return _0x4e506c;};'use strict';var _=require(_0x4c72('0x0'));var util=require(_0x4c72('0x1'));var moment=require('moment');var BPromise=require(_0x4c72('0x2'));var rs=require(_0x4c72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c72('0x4'))['db'];var utils=require(_0x4c72('0x5'));var logger=require('../../config/logger')(_0x4c72('0x6'));var config=require(_0x4c72('0x7'));var jayson=require(_0x4c72('0x8'));var client=jayson[_0x4c72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8a30d,_0x5daf58,_0x800121){return new BPromise(function(_0x2761ff,_0x54e051){return client['request'](_0xe8a30d,_0x800121)[_0x4c72('0xa')](function(_0x76a1b9){logger[_0x4c72('0xb')](_0x4c72('0xc'),_0x5daf58,_0x4c72('0xd'));logger[_0x4c72('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5daf58,'request\x20sent',JSON['stringify'](_0x76a1b9));if(_0x76a1b9[_0x4c72('0xf')]){if(_0x76a1b9['error'][_0x4c72('0x10')]===0x1f4){logger[_0x4c72('0xf')](_0x4c72('0xc'),_0x5daf58,_0x76a1b9[_0x4c72('0xf')]['message']);return _0x54e051(_0x76a1b9[_0x4c72('0xf')]['message']);}logger[_0x4c72('0xf')](_0x4c72('0xc'),_0x5daf58,_0x76a1b9[_0x4c72('0xf')][_0x4c72('0x11')]);return _0x2761ff(_0x76a1b9[_0x4c72('0xf')][_0x4c72('0x11')]);}else{logger[_0x4c72('0xb')](_0x4c72('0xc'),_0x5daf58,_0x4c72('0xd'));_0x2761ff(_0x76a1b9[_0x4c72('0x12')][_0x4c72('0x11')]);}})[_0x4c72('0x13')](function(_0x3a6e99){logger[_0x4c72('0xf')](_0x4c72('0xc'),_0x5daf58,_0x3a6e99);_0x54e051(_0x3a6e99);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 47f5871..cef1b75 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 _0x11f5=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete'];(function(_0x5959ac,_0x3fba06){var _0x4ca53a=function(_0x425bf3){while(--_0x425bf3){_0x5959ac['push'](_0x5959ac['shift']());}};_0x4ca53a(++_0x3fba06);}(_0x11f5,0x1d2));var _0x511f=function(_0x1f188f,_0x29ad78){_0x1f188f=_0x1f188f-0x0;var _0x488519=_0x11f5[_0x1f188f];return _0x488519;};'use strict';var multer=require('multer');var util=require(_0x511f('0x0'));var path=require('path');var timeout=require(_0x511f('0x1'));var express=require('express');var router=express[_0x511f('0x2')]();var fs_extra=require(_0x511f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x511f('0x4'));var config=require(_0x511f('0x5'));var controller=require(_0x511f('0x6'));router[_0x511f('0x7')](_0x511f('0x8'),auth[_0x511f('0x9')](),controller[_0x511f('0xa')]);router[_0x511f('0xb')]('/:id',auth[_0x511f('0x9')](),controller[_0x511f('0xc')]);router[_0x511f('0xd')](_0x511f('0x8'),auth[_0x511f('0x9')](),controller[_0x511f('0xe')]);module[_0x511f('0xf')]=router; \ No newline at end of file +var _0xe47c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','exports'];(function(_0x18db10,_0x536cff){var _0x3109ba=function(_0x5571e0){while(--_0x5571e0){_0x18db10['push'](_0x18db10['shift']());}};_0x3109ba(++_0x536cff);}(_0xe47c,0x159));var _0xce47=function(_0x4d65c6,_0x3f733e){_0x4d65c6=_0x4d65c6-0x0;var _0x3885d2=_0xe47c[_0x4d65c6];return _0x3885d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce47('0x0'));var timeout=require(_0xce47('0x1'));var express=require(_0xce47('0x2'));var router=express[_0xce47('0x3')]();var fs_extra=require(_0xce47('0x4'));var auth=require(_0xce47('0x5'));var interaction=require(_0xce47('0x6'));var config=require(_0xce47('0x7'));var controller=require(_0xce47('0x8'));router[_0xce47('0x9')](_0xce47('0xa'),auth[_0xce47('0xb')](),controller[_0xce47('0xc')]);router['put']('/:id',auth[_0xce47('0xb')](),controller[_0xce47('0xd')]);router['delete'](_0xce47('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xce47('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b881f50..214887b 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 _0x76d0=['sequelize','exports','STRING'];(function(_0x27bcb2,_0x412da4){var _0xef0f33=function(_0x248910){while(--_0x248910){_0x27bcb2['push'](_0x27bcb2['shift']());}};_0xef0f33(++_0x412da4);}(_0x76d0,0x132));var _0x076d=function(_0x1f1fe7,_0x2dce47){_0x1f1fe7=_0x1f1fe7-0x0;var _0x44a94a=_0x76d0[_0x1f1fe7];return _0x44a94a;};'use strict';var Sequelize=require(_0x076d('0x0'));module[_0x076d('0x1')]={'name':{'type':Sequelize[_0x076d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x084b=['BOOLEAN','sequelize'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x084b,0xd5));var _0xb084=function(_0xcd6274,_0x136727){_0xcd6274=_0xcd6274-0x0;var _0x430b9a=_0x084b[_0xcd6274];return _0x430b9a;};'use strict';var Sequelize=require(_0xb084('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb084('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3f94d83..7ea0f95 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 _0x48d7=['count','limit','set','Content-Range','json','apply','reject','update','then','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','getUnread','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatInternalMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x48d7,0x9c));var _0x748d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x48d7[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x748d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x748d('0x1'));var BPromise=require(_0x748d('0x2'));var Mustache=require(_0x748d('0x3'));var util=require(_0x748d('0x4'));var path=require(_0x748d('0x5'));var sox=require(_0x748d('0x6'));var csv=require(_0x748d('0x7'));var ejs=require(_0x748d('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(_0x748d('0x9'));var deskjs=require(_0x748d('0xa'));var toCsv=require(_0x748d('0x7'));var querystring=require(_0x748d('0xb'));var Papa=require(_0x748d('0xc'));var Redis=require(_0x748d('0xd'));var authService=require(_0x748d('0xe'));var qs=require(_0x748d('0xf'));var as=require(_0x748d('0x10'));var hardwareService=require(_0x748d('0x11'));var logger=require('../../config/logger')(_0x748d('0x12'));var utils=require(_0x748d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x748d('0x14'));var db=require(_0x748d('0x15'))['db'];config['redis']=_[_0x748d('0x16')](config[_0x748d('0x17')],{'host':_0x748d('0x18'),'port':0x18eb});var socket=require(_0x748d('0x19'))(new Redis(config[_0x748d('0x17')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x222776,_0x343b28){_0x343b28=_0x343b28||0xcc;return function(_0x441ace){if(_0x441ace){return _0x222776[_0x748d('0x1a')](_0x343b28);}return _0x222776[_0x748d('0x1b')](_0x343b28)['end']();};}function respondWithResult(_0x585fe3,_0x2566f3){_0x2566f3=_0x2566f3||0xc8;return function(_0x5daa58){if(_0x5daa58){return _0x585fe3[_0x748d('0x1b')](_0x2566f3)['json'](_0x5daa58);}};}function respondWithFilteredResult(_0x2560a1,_0x84daeb){return function(_0x5f374f){if(_0x5f374f){var _0x1bc910=typeof _0x84daeb[_0x748d('0x1c')]===_0x748d('0x1d')&&typeof _0x84daeb['limit']==='undefined';var _0x414315=_0x5f374f['count'];var _0x21f347=_0x1bc910?0x0:_0x84daeb['offset'];var _0x4330e9=_0x1bc910?_0x5f374f[_0x748d('0x1e')]:_0x84daeb[_0x748d('0x1c')]+_0x84daeb[_0x748d('0x1f')];var _0x20e48b;if(_0x4330e9>=_0x414315){_0x4330e9=_0x414315;_0x20e48b=0xc8;}else{_0x20e48b=0xce;}_0x2560a1[_0x748d('0x1b')](_0x20e48b);return _0x2560a1[_0x748d('0x20')](_0x748d('0x21'),_0x21f347+'-'+_0x4330e9+'/'+_0x414315)[_0x748d('0x22')](_0x5f374f);}return null;};}function patchUpdates(_0x1dfe4f){return function(_0x424592){try{jsonpatch[_0x748d('0x23')](_0x424592,_0x1dfe4f,!![]);}catch(_0x518680){return BPromise[_0x748d('0x24')](_0x518680);}return _0x424592['save']();};}function saveUpdates(_0x44f26c,_0xa259f9){return function(_0x15e507){if(_0x15e507){return _0x15e507[_0x748d('0x25')](_0x44f26c)[_0x748d('0x26')](function(_0x8b1320){return _0x8b1320;});}return null;};}function removeEntity(_0x4d32ae,_0xee4d14){return function(_0xfffcd0){if(_0xfffcd0){return _0xfffcd0['destroy']()[_0x748d('0x26')](function(){_0x4d32ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ade1e,_0x274137){return function(_0x3c452d){if(!_0x3c452d){_0x4ade1e[_0x748d('0x1a')](0x194);}return _0x3c452d;};}function handleError(_0x28762b,_0x580833){_0x580833=_0x580833||0x1f4;return function(_0x1bf4ac){logger[_0x748d('0x27')](_0x1bf4ac['stack']);if(_0x1bf4ac[_0x748d('0x28')]){delete _0x1bf4ac[_0x748d('0x28')];}_0x28762b[_0x748d('0x1b')](_0x580833)[_0x748d('0x29')](_0x1bf4ac);};}exports[_0x748d('0x2a')]=function(_0x1bfe00,_0x256b97){var _0x54a1cf={},_0x76683b={},_0x392aee={'count':0x0,'rows':[]};var _0x32976a=_[_0x748d('0x2b')](db[_0x748d('0x2c')][_0x748d('0x2d')],function(_0x56918e){return{'name':_0x56918e[_0x748d('0x2e')],'type':_0x56918e['type']['key']};});_0x76683b[_0x748d('0x2f')]=_[_0x748d('0x2b')](_0x32976a,'name');_0x76683b[_0x748d('0x30')]=_[_0x748d('0x31')](_0x1bfe00[_0x748d('0x30')]);_0x76683b['filters']=_[_0x748d('0x32')](_0x76683b[_0x748d('0x2f')],_0x76683b[_0x748d('0x30')]);_0x54a1cf[_0x748d('0x33')]=_['intersection'](_0x76683b[_0x748d('0x2f')],qs['fields'](_0x1bfe00[_0x748d('0x30')]['fields']));_0x54a1cf[_0x748d('0x33')]=_0x54a1cf['attributes'][_0x748d('0x34')]?_0x54a1cf['attributes']:_0x76683b[_0x748d('0x2f')];if(!_0x1bfe00[_0x748d('0x30')][_0x748d('0x35')](_0x748d('0x36'))){_0x54a1cf[_0x748d('0x1f')]=qs[_0x748d('0x1f')](_0x1bfe00[_0x748d('0x30')][_0x748d('0x1f')]);_0x54a1cf[_0x748d('0x1c')]=qs['offset'](_0x1bfe00[_0x748d('0x30')][_0x748d('0x1c')]);}_0x54a1cf[_0x748d('0x37')]=qs[_0x748d('0x38')](_0x1bfe00[_0x748d('0x30')]['sort']);_0x54a1cf[_0x748d('0x39')]=qs[_0x748d('0x3a')](_[_0x748d('0x3b')](_0x1bfe00[_0x748d('0x30')],_0x76683b[_0x748d('0x3a')]),_0x32976a);if(_0x1bfe00[_0x748d('0x30')][_0x748d('0x3c')]){_0x54a1cf[_0x748d('0x39')]=_[_0x748d('0x3d')](_0x54a1cf[_0x748d('0x39')],{'$or':_[_0x748d('0x2b')](_0x32976a,function(_0x3382b2){if(_0x3382b2[_0x748d('0x3e')]!==_0x748d('0x3f')){var _0x3dd7a9={};_0x3dd7a9[_0x3382b2[_0x748d('0x28')]]={'$like':'%'+_0x1bfe00[_0x748d('0x30')][_0x748d('0x3c')]+'%'};return _0x3dd7a9;}})});}_0x54a1cf=_[_0x748d('0x3d')]({},_0x54a1cf,_0x1bfe00[_0x748d('0x40')]);var _0x52b515={'where':_0x54a1cf[_0x748d('0x39')]};return db[_0x748d('0x2c')][_0x748d('0x1e')](_0x52b515)[_0x748d('0x26')](function(_0x23a10a){_0x392aee['count']=_0x23a10a;if(_0x1bfe00[_0x748d('0x30')][_0x748d('0x41')]){_0x54a1cf[_0x748d('0x42')]=[{'all':!![]}];}return db['ChatGroup'][_0x748d('0x43')](_0x54a1cf);})[_0x748d('0x26')](function(_0x159f18){_0x392aee[_0x748d('0x44')]=_0x159f18;return _0x392aee;})[_0x748d('0x26')](respondWithFilteredResult(_0x256b97,_0x54a1cf))[_0x748d('0x45')](handleError(_0x256b97,null));};exports[_0x748d('0x46')]=function(_0x10a893,_0x422218){var _0xf8714d={'raw':!![],'where':{'id':_0x10a893[_0x748d('0x47')]['id']}},_0x1fa9fc={};_0x1fa9fc[_0x748d('0x2f')]=_['keys'](db[_0x748d('0x2c')][_0x748d('0x2d')]);_0x1fa9fc[_0x748d('0x30')]=_[_0x748d('0x31')](_0x10a893['query']);_0x1fa9fc['filters']=_[_0x748d('0x32')](_0x1fa9fc[_0x748d('0x2f')],_0x1fa9fc[_0x748d('0x30')]);_0xf8714d['attributes']=_[_0x748d('0x32')](_0x1fa9fc[_0x748d('0x2f')],qs[_0x748d('0x48')](_0x10a893[_0x748d('0x30')]['fields']));_0xf8714d[_0x748d('0x33')]=_0xf8714d[_0x748d('0x33')]['length']?_0xf8714d[_0x748d('0x33')]:_0x1fa9fc['model'];if(_0x10a893[_0x748d('0x30')][_0x748d('0x41')]){_0xf8714d[_0x748d('0x42')]=[{'all':!![]}];}_0xf8714d=_[_0x748d('0x3d')]({},_0xf8714d,_0x10a893['options']);return db[_0x748d('0x2c')][_0x748d('0x49')](_0xf8714d)[_0x748d('0x26')](handleEntityNotFound(_0x422218,null))['then'](respondWithResult(_0x422218,null))[_0x748d('0x45')](handleError(_0x422218,null));};exports[_0x748d('0x4a')]=function(_0x2aa79f,_0x558deb){return db[_0x748d('0x2c')][_0x748d('0x4a')](_0x2aa79f[_0x748d('0x4b')],{})[_0x748d('0x26')](respondWithResult(_0x558deb,0xc9))[_0x748d('0x45')](handleError(_0x558deb,null));};exports[_0x748d('0x25')]=function(_0x53a80e,_0x291b19){if(_0x53a80e[_0x748d('0x4b')]['id']){delete _0x53a80e[_0x748d('0x4b')]['id'];}return db[_0x748d('0x2c')][_0x748d('0x49')]({'where':{'id':_0x53a80e[_0x748d('0x47')]['id']}})[_0x748d('0x26')](handleEntityNotFound(_0x291b19,null))[_0x748d('0x26')](saveUpdates(_0x53a80e['body'],null))[_0x748d('0x26')](respondWithResult(_0x291b19,null))[_0x748d('0x45')](handleError(_0x291b19,null));};exports[_0x748d('0x4c')]=function(_0x263c29,_0x5df784){return db[_0x748d('0x2c')][_0x748d('0x49')]({'where':{'id':_0x263c29[_0x748d('0x47')]['id']}})[_0x748d('0x26')](handleEntityNotFound(_0x5df784,null))['then'](removeEntity(_0x5df784,null))[_0x748d('0x45')](handleError(_0x5df784,null));};exports['describe']=function(_0xc58783,_0x17c7b6){return db[_0x748d('0x2c')]['describe']()[_0x748d('0x26')](respondWithResult(_0x17c7b6,null))[_0x748d('0x45')](handleError(_0x17c7b6,null));};exports[_0x748d('0x4d')]=function(_0x5aefc1,_0x31e817,_0x26eb8b){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x5aefc1[_0x748d('0x47')]['id'],'ToId':_0x5aefc1[_0x748d('0x4e')]['id'],'read':![]}})[_0x748d('0x26')](function(_0x353d63){return{'id':_[_0x748d('0x4f')](_0x5aefc1['params']['id']),'count':_0x353d63};})[_0x748d('0x26')](respondWithResult(_0x31e817,null))[_0x748d('0x45')](handleError(_0x31e817,null));};exports[_0x748d('0x50')]=function(_0x141a79,_0x2ed88a,_0x513579){return db[_0x748d('0x2c')][_0x748d('0x49')]({'where':{'id':_0x141a79[_0x748d('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ed88a,null))['then'](function(_0x490dae){if(_0x490dae){return _0x490dae[_0x748d('0x50')](_0x141a79[_0x748d('0x4b')]['ids'],_[_0x748d('0x51')](_0x141a79[_0x748d('0x4b')],[_0x748d('0x52'),'id'])||{});}})[_0x748d('0x26')](respondWithResult(_0x2ed88a,null))[_0x748d('0x45')](handleError(_0x2ed88a,null));};exports[_0x748d('0x53')]=function(_0x1077ba,_0x1151fc,_0x2e9f89){var _0x3e47f8={};var _0x43b086={};var _0x2b383b;var _0x46714f;return db['ChatGroup'][_0x748d('0x54')]({'where':{'id':_0x1077ba[_0x748d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1151fc,null))['then'](function(_0x2b20f0){if(_0x2b20f0){_0x2b383b=_0x2b20f0;_0x43b086[_0x748d('0x2f')]=_[_0x748d('0x31')](db[_0x748d('0x55')][_0x748d('0x2d')]);_0x43b086[_0x748d('0x30')]=_['keys'](_0x1077ba[_0x748d('0x30')]);_0x43b086[_0x748d('0x3a')]=_[_0x748d('0x32')](_0x43b086[_0x748d('0x2f')],_0x43b086[_0x748d('0x30')]);_0x3e47f8[_0x748d('0x33')]=_[_0x748d('0x32')](_0x43b086['model'],qs['fields'](_0x1077ba['query']['fields']));_0x3e47f8[_0x748d('0x33')]=_0x3e47f8[_0x748d('0x33')][_0x748d('0x34')]?_0x3e47f8[_0x748d('0x33')]:_0x43b086[_0x748d('0x2f')];_0x3e47f8[_0x748d('0x37')]=qs[_0x748d('0x38')](_0x1077ba[_0x748d('0x30')][_0x748d('0x38')]);_0x3e47f8['where']=qs[_0x748d('0x3a')](_[_0x748d('0x3b')](_0x1077ba[_0x748d('0x30')],_0x43b086[_0x748d('0x3a')]));if(_0x1077ba[_0x748d('0x30')][_0x748d('0x3c')]){_0x3e47f8['where']=_[_0x748d('0x3d')](_0x3e47f8[_0x748d('0x39')],{'$or':_[_0x748d('0x2b')](_0x3e47f8[_0x748d('0x33')],function(_0x399a5c){var _0x1f60e7={};_0x1f60e7[_0x399a5c]={'$like':'%'+_0x1077ba['query'][_0x748d('0x3c')]+'%'};return _0x1f60e7;})});}_0x3e47f8=_['merge']({},_0x3e47f8,_0x1077ba['options']);return _0x2b383b['getMembers'](_0x3e47f8);}})[_0x748d('0x26')](function(_0x7fc3c){if(_0x7fc3c){_0x46714f=_0x7fc3c[_0x748d('0x34')];if(!_0x1077ba['query'][_0x748d('0x35')](_0x748d('0x36'))){_0x3e47f8[_0x748d('0x1f')]=qs['limit'](_0x1077ba['query'][_0x748d('0x1f')]);_0x3e47f8[_0x748d('0x1c')]=qs['offset'](_0x1077ba[_0x748d('0x30')]['offset']);}return _0x2b383b[_0x748d('0x53')](_0x3e47f8);}})['then'](function(_0xeb378e){if(_0xeb378e){return _0xeb378e?{'count':_0x46714f,'rows':_0xeb378e}:null;}})[_0x748d('0x26')](respondWithResult(_0x1151fc,null))[_0x748d('0x45')](handleError(_0x1151fc,null));};exports[_0x748d('0x56')]=function(_0x3a693b,_0x1e960a,_0x158937){return db['ChatGroup'][_0x748d('0x49')]({'where':{'id':_0x3a693b['params']['id']}})['then'](handleEntityNotFound(_0x1e960a,null))['then'](function(_0x2d937b){if(_0x2d937b){return _0x2d937b['removeMembers'](_0x3a693b['query'][_0x748d('0x52')]);}})[_0x748d('0x26')](respondWithStatusCode(_0x1e960a,null))[_0x748d('0x45')](handleError(_0x1e960a,null));};exports[_0x748d('0x57')]=function(_0x7232b5,_0x26ce4d,_0x55735d){if(_0x7232b5[_0x748d('0x4b')]['id']){delete _0x7232b5[_0x748d('0x4b')]['id'];}return db[_0x748d('0x2c')]['find']({'where':{'id':_0x7232b5['params']['id']}})[_0x748d('0x26')](handleEntityNotFound(_0x26ce4d,null))[_0x748d('0x26')](function(_0x3ae27e){if(_0x3ae27e){_0x7232b5['body']['ChatGroupId']=_0x3ae27e['id'];return db[_0x748d('0x58')]['create'](_0x7232b5[_0x748d('0x4b')]);}})[_0x748d('0x26')](respondWithResult(_0x26ce4d,null))[_0x748d('0x45')](handleError(_0x26ce4d,null));};exports['getMessages']=function(_0x40faab,_0x21b98e,_0x2c531c){var _0x885616={};var _0x37ce81={};var _0x5eab23;var _0x3191ee;return db[_0x748d('0x2c')]['findOne']({'where':{'id':_0x40faab[_0x748d('0x47')]['id']}})['then'](handleEntityNotFound(_0x21b98e,null))[_0x748d('0x26')](function(_0x1edeba){if(_0x1edeba){_0x5eab23=_0x1edeba;_0x37ce81[_0x748d('0x2f')]=_[_0x748d('0x31')](db['ChatInternalMessage']['rawAttributes']);_0x37ce81['query']=_[_0x748d('0x31')](_0x40faab['query']);_0x37ce81[_0x748d('0x3a')]=_[_0x748d('0x32')](_0x37ce81[_0x748d('0x2f')],_0x37ce81[_0x748d('0x30')]);_0x885616[_0x748d('0x33')]=_[_0x748d('0x32')](_0x37ce81['model'],qs[_0x748d('0x48')](_0x40faab['query']['fields']));_0x885616[_0x748d('0x33')]=_0x885616[_0x748d('0x33')][_0x748d('0x34')]?_0x885616[_0x748d('0x33')]:_0x37ce81['model'];_0x885616[_0x748d('0x37')]=qs[_0x748d('0x38')](_0x40faab[_0x748d('0x30')]['sort']);_0x885616['where']=qs[_0x748d('0x3a')](_[_0x748d('0x3b')](_0x40faab['query'],_0x37ce81[_0x748d('0x3a')]));if(_0x40faab['query'][_0x748d('0x3c')]){_0x885616[_0x748d('0x39')]=_['merge'](_0x885616['where'],{'$or':_[_0x748d('0x2b')](_0x885616[_0x748d('0x33')],function(_0x440a8f){var _0x50d71c={};_0x50d71c[_0x440a8f]={'$like':'%'+_0x40faab[_0x748d('0x30')][_0x748d('0x3c')]+'%'};return _0x50d71c;})});}if(_0x40faab['query'][_0x748d('0x59')]){var _0x1f8fa1=_0x40faab[_0x748d('0x30')][_0x748d('0x59')][_0x748d('0x5a')](',');var _0x27c33e={};_0x27c33e[_0x1f8fa1[0x0]]={'$gte':moment(_0x1f8fa1[0x1])['format'](_0x748d('0x5b'))};_0x885616[_0x748d('0x39')]=_[_0x748d('0x3d')](_0x885616[_0x748d('0x39')],_0x27c33e);}_0x885616=_[_0x748d('0x3d')]({},_0x885616,_0x40faab['options']);return _0x5eab23[_0x748d('0x5c')](_0x885616);}})[_0x748d('0x26')](function(_0x19da10){if(_0x19da10){_0x3191ee=_0x19da10['length'];if(!_0x40faab[_0x748d('0x30')][_0x748d('0x35')](_0x748d('0x36'))){_0x885616[_0x748d('0x1f')]=qs[_0x748d('0x1f')](_0x40faab['query'][_0x748d('0x1f')]);_0x885616[_0x748d('0x1c')]=qs[_0x748d('0x1c')](_0x40faab[_0x748d('0x30')][_0x748d('0x1c')]);}return _0x5eab23['getMessages'](_0x885616);}})[_0x748d('0x26')](function(_0xf5ea2){if(_0xf5ea2){return _0xf5ea2?{'count':_0x3191ee,'rows':_0xf5ea2}:null;}})[_0x748d('0x26')](respondWithResult(_0x21b98e,null))[_0x748d('0x45')](handleError(_0x21b98e,null));}; \ No newline at end of file +var _0x7bde=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ChatGroup','fieldName'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7bde,0xee));var _0xe7bd=function(_0x2306de,_0x5b9304){_0x2306de=_0x2306de-0x0;var _0x3143e9=_0x7bde[_0x2306de];return _0x3143e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe7bd('0x1'));var moment=require(_0xe7bd('0x2'));var BPromise=require(_0xe7bd('0x3'));var Mustache=require(_0xe7bd('0x4'));var util=require(_0xe7bd('0x5'));var path=require('path');var sox=require(_0xe7bd('0x6'));var csv=require(_0xe7bd('0x7'));var ejs=require(_0xe7bd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7bd('0x9'));var squel=require(_0xe7bd('0xa'));var crypto=require(_0xe7bd('0xb'));var jsforce=require(_0xe7bd('0xc'));var deskjs=require(_0xe7bd('0xd'));var toCsv=require(_0xe7bd('0x7'));var querystring=require(_0xe7bd('0xe'));var Papa=require('papaparse');var Redis=require(_0xe7bd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe7bd('0x10'));var utils=require('../../config/utils');var config=require(_0xe7bd('0x11'));var licenseUtil=require(_0xe7bd('0x12'));var db=require(_0xe7bd('0x13'))['db'];config[_0xe7bd('0x14')]=_[_0xe7bd('0x15')](config[_0xe7bd('0x14')],{'host':_0xe7bd('0x16'),'port':0x18eb});var socket=require(_0xe7bd('0x17'))(new Redis(config['redis']));require(_0xe7bd('0x18'))['register'](socket);function respondWithStatusCode(_0x25ee19,_0x16ff46){_0x16ff46=_0x16ff46||0xcc;return function(_0x176a1e){if(_0x176a1e){return _0x25ee19[_0xe7bd('0x19')](_0x16ff46);}return _0x25ee19[_0xe7bd('0x1a')](_0x16ff46)[_0xe7bd('0x1b')]();};}function respondWithResult(_0x26ca29,_0x5cf46a){_0x5cf46a=_0x5cf46a||0xc8;return function(_0x1fb02a){if(_0x1fb02a){return _0x26ca29[_0xe7bd('0x1a')](_0x5cf46a)[_0xe7bd('0x1c')](_0x1fb02a);}};}function respondWithFilteredResult(_0x45ccc2,_0x34f7fe){return function(_0x33a4af){if(_0x33a4af){var _0x3e3de9=typeof _0x34f7fe[_0xe7bd('0x1d')]==='undefined'&&typeof _0x34f7fe[_0xe7bd('0x1e')]===_0xe7bd('0x1f');var _0x52820b=_0x33a4af['count'];var _0x2e30cc=_0x3e3de9?0x0:_0x34f7fe[_0xe7bd('0x1d')];var _0x4fe3dd=_0x3e3de9?_0x33a4af[_0xe7bd('0x20')]:_0x34f7fe['offset']+_0x34f7fe[_0xe7bd('0x1e')];var _0xa4eb2e;if(_0x4fe3dd>=_0x52820b){_0x4fe3dd=_0x52820b;_0xa4eb2e=0xc8;}else{_0xa4eb2e=0xce;}_0x45ccc2['status'](_0xa4eb2e);return _0x45ccc2[_0xe7bd('0x21')](_0xe7bd('0x22'),_0x2e30cc+'-'+_0x4fe3dd+'/'+_0x52820b)['json'](_0x33a4af);}return null;};}function patchUpdates(_0x2c0caf){return function(_0x3f6cf6){try{jsonpatch[_0xe7bd('0x23')](_0x3f6cf6,_0x2c0caf,!![]);}catch(_0x44088b){return BPromise[_0xe7bd('0x24')](_0x44088b);}return _0x3f6cf6[_0xe7bd('0x25')]();};}function saveUpdates(_0x2514b4,_0x4209de){return function(_0xa35fe9){if(_0xa35fe9){return _0xa35fe9[_0xe7bd('0x26')](_0x2514b4)[_0xe7bd('0x27')](function(_0x4e9d0d){return _0x4e9d0d;});}return null;};}function removeEntity(_0x35f42d,_0x5dcc48){return function(_0x1a23b6){if(_0x1a23b6){return _0x1a23b6['destroy']()[_0xe7bd('0x27')](function(){_0x35f42d[_0xe7bd('0x1a')](0xcc)[_0xe7bd('0x1b')]();});}};}function handleEntityNotFound(_0x90ee9d,_0x25d33d){return function(_0x8b4049){if(!_0x8b4049){_0x90ee9d[_0xe7bd('0x19')](0x194);}return _0x8b4049;};}function handleError(_0x27f8a8,_0x743bac){_0x743bac=_0x743bac||0x1f4;return function(_0x120065){logger[_0xe7bd('0x28')](_0x120065[_0xe7bd('0x29')]);if(_0x120065[_0xe7bd('0x2a')]){delete _0x120065['name'];}_0x27f8a8[_0xe7bd('0x1a')](_0x743bac)[_0xe7bd('0x2b')](_0x120065);};}exports['index']=function(_0x16f9a0,_0x4a9916){var _0x18d069={},_0x15c8c2={},_0x29e98={'count':0x0,'rows':[]};var _0x1f15b5=_[_0xe7bd('0x2c')](db[_0xe7bd('0x2d')]['rawAttributes'],function(_0x5ce1c0){return{'name':_0x5ce1c0[_0xe7bd('0x2e')],'type':_0x5ce1c0[_0xe7bd('0x2f')][_0xe7bd('0x30')]};});_0x15c8c2[_0xe7bd('0x31')]=_[_0xe7bd('0x2c')](_0x1f15b5,'name');_0x15c8c2[_0xe7bd('0x32')]=_[_0xe7bd('0x33')](_0x16f9a0[_0xe7bd('0x32')]);_0x15c8c2[_0xe7bd('0x34')]=_[_0xe7bd('0x35')](_0x15c8c2['model'],_0x15c8c2[_0xe7bd('0x32')]);_0x18d069[_0xe7bd('0x36')]=_['intersection'](_0x15c8c2[_0xe7bd('0x31')],qs['fields'](_0x16f9a0['query'][_0xe7bd('0x37')]));_0x18d069['attributes']=_0x18d069['attributes'][_0xe7bd('0x38')]?_0x18d069[_0xe7bd('0x36')]:_0x15c8c2['model'];if(!_0x16f9a0[_0xe7bd('0x32')]['hasOwnProperty'](_0xe7bd('0x39'))){_0x18d069[_0xe7bd('0x1e')]=qs[_0xe7bd('0x1e')](_0x16f9a0[_0xe7bd('0x32')][_0xe7bd('0x1e')]);_0x18d069[_0xe7bd('0x1d')]=qs[_0xe7bd('0x1d')](_0x16f9a0[_0xe7bd('0x32')]['offset']);}_0x18d069[_0xe7bd('0x3a')]=qs[_0xe7bd('0x3b')](_0x16f9a0[_0xe7bd('0x32')]['sort']);_0x18d069['where']=qs[_0xe7bd('0x34')](_[_0xe7bd('0x3c')](_0x16f9a0[_0xe7bd('0x32')],_0x15c8c2[_0xe7bd('0x34')]),_0x1f15b5);if(_0x16f9a0[_0xe7bd('0x32')][_0xe7bd('0x3d')]){_0x18d069['where']=_[_0xe7bd('0x3e')](_0x18d069[_0xe7bd('0x3f')],{'$or':_['map'](_0x1f15b5,function(_0x300bec){if(_0x300bec[_0xe7bd('0x2f')]!==_0xe7bd('0x40')){var _0x131526={};_0x131526[_0x300bec[_0xe7bd('0x2a')]]={'$like':'%'+_0x16f9a0['query'][_0xe7bd('0x3d')]+'%'};return _0x131526;}})});}_0x18d069=_[_0xe7bd('0x3e')]({},_0x18d069,_0x16f9a0[_0xe7bd('0x41')]);var _0xdbb3a={'where':_0x18d069[_0xe7bd('0x3f')]};return db['ChatGroup'][_0xe7bd('0x20')](_0xdbb3a)[_0xe7bd('0x27')](function(_0x3dc844){_0x29e98[_0xe7bd('0x20')]=_0x3dc844;if(_0x16f9a0[_0xe7bd('0x32')][_0xe7bd('0x42')]){_0x18d069['include']=[{'all':!![]}];}return db[_0xe7bd('0x2d')][_0xe7bd('0x43')](_0x18d069);})[_0xe7bd('0x27')](function(_0x413c6f){_0x29e98[_0xe7bd('0x44')]=_0x413c6f;return _0x29e98;})[_0xe7bd('0x27')](respondWithFilteredResult(_0x4a9916,_0x18d069))[_0xe7bd('0x45')](handleError(_0x4a9916,null));};exports['show']=function(_0xfe7482,_0xac16ca){var _0x4e1a33={'raw':!![],'where':{'id':_0xfe7482[_0xe7bd('0x46')]['id']}},_0x526cae={};_0x526cae['model']=_[_0xe7bd('0x33')](db[_0xe7bd('0x2d')][_0xe7bd('0x47')]);_0x526cae[_0xe7bd('0x32')]=_[_0xe7bd('0x33')](_0xfe7482['query']);_0x526cae['filters']=_[_0xe7bd('0x35')](_0x526cae[_0xe7bd('0x31')],_0x526cae['query']);_0x4e1a33[_0xe7bd('0x36')]=_['intersection'](_0x526cae['model'],qs[_0xe7bd('0x37')](_0xfe7482[_0xe7bd('0x32')][_0xe7bd('0x37')]));_0x4e1a33['attributes']=_0x4e1a33['attributes'][_0xe7bd('0x38')]?_0x4e1a33[_0xe7bd('0x36')]:_0x526cae[_0xe7bd('0x31')];if(_0xfe7482[_0xe7bd('0x32')][_0xe7bd('0x42')]){_0x4e1a33[_0xe7bd('0x48')]=[{'all':!![]}];}_0x4e1a33=_['merge']({},_0x4e1a33,_0xfe7482[_0xe7bd('0x41')]);return db[_0xe7bd('0x2d')][_0xe7bd('0x49')](_0x4e1a33)[_0xe7bd('0x27')](handleEntityNotFound(_0xac16ca,null))[_0xe7bd('0x27')](respondWithResult(_0xac16ca,null))[_0xe7bd('0x45')](handleError(_0xac16ca,null));};exports[_0xe7bd('0x4a')]=function(_0x54061b,_0x3e379e){return db[_0xe7bd('0x2d')][_0xe7bd('0x4a')](_0x54061b[_0xe7bd('0x4b')],{})[_0xe7bd('0x27')](respondWithResult(_0x3e379e,0xc9))[_0xe7bd('0x45')](handleError(_0x3e379e,null));};exports[_0xe7bd('0x26')]=function(_0x589679,_0x82ed94){if(_0x589679[_0xe7bd('0x4b')]['id']){delete _0x589679['body']['id'];}return db[_0xe7bd('0x2d')][_0xe7bd('0x49')]({'where':{'id':_0x589679[_0xe7bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x82ed94,null))[_0xe7bd('0x27')](saveUpdates(_0x589679[_0xe7bd('0x4b')],null))[_0xe7bd('0x27')](respondWithResult(_0x82ed94,null))[_0xe7bd('0x45')](handleError(_0x82ed94,null));};exports[_0xe7bd('0x4c')]=function(_0x39b71d,_0x3a48fb){return db['ChatGroup'][_0xe7bd('0x49')]({'where':{'id':_0x39b71d[_0xe7bd('0x46')]['id']}})[_0xe7bd('0x27')](handleEntityNotFound(_0x3a48fb,null))[_0xe7bd('0x27')](removeEntity(_0x3a48fb,null))['catch'](handleError(_0x3a48fb,null));};exports[_0xe7bd('0x4d')]=function(_0x3a4b1c,_0x5e5b22){return db[_0xe7bd('0x2d')]['describe']()[_0xe7bd('0x27')](respondWithResult(_0x5e5b22,null))['catch'](handleError(_0x5e5b22,null));};exports[_0xe7bd('0x4e')]=function(_0x3baf48,_0x52507e,_0x47970e){return db[_0xe7bd('0x4f')][_0xe7bd('0x20')]({'where':{'ChatGroupId':_0x3baf48[_0xe7bd('0x46')]['id'],'ToId':_0x3baf48[_0xe7bd('0x50')]['id'],'read':![]}})[_0xe7bd('0x27')](function(_0x2e60e2){return{'id':_[_0xe7bd('0x51')](_0x3baf48[_0xe7bd('0x46')]['id']),'count':_0x2e60e2};})[_0xe7bd('0x27')](respondWithResult(_0x52507e,null))[_0xe7bd('0x45')](handleError(_0x52507e,null));};exports['addMembers']=function(_0x55e1d1,_0x536577,_0x169c3a){return db[_0xe7bd('0x2d')]['find']({'where':{'id':_0x55e1d1[_0xe7bd('0x46')]['id']}})[_0xe7bd('0x27')](handleEntityNotFound(_0x536577,null))[_0xe7bd('0x27')](function(_0x9389c0){if(_0x9389c0){return _0x9389c0[_0xe7bd('0x52')](_0x55e1d1['body'][_0xe7bd('0x53')],_[_0xe7bd('0x54')](_0x55e1d1[_0xe7bd('0x4b')],[_0xe7bd('0x53'),'id'])||{});}})[_0xe7bd('0x27')](respondWithResult(_0x536577,null))[_0xe7bd('0x45')](handleError(_0x536577,null));};exports[_0xe7bd('0x55')]=function(_0x164eec,_0x489b39,_0x2e5e32){var _0xaf2436={};var _0x3f245a={};var _0x219c95;var _0x2002c6;return db['ChatGroup'][_0xe7bd('0x56')]({'where':{'id':_0x164eec[_0xe7bd('0x46')]['id']}})[_0xe7bd('0x27')](handleEntityNotFound(_0x489b39,null))[_0xe7bd('0x27')](function(_0x5d50f6){if(_0x5d50f6){_0x219c95=_0x5d50f6;_0x3f245a[_0xe7bd('0x31')]=_['keys'](db[_0xe7bd('0x57')][_0xe7bd('0x47')]);_0x3f245a['query']=_[_0xe7bd('0x33')](_0x164eec[_0xe7bd('0x32')]);_0x3f245a[_0xe7bd('0x34')]=_[_0xe7bd('0x35')](_0x3f245a[_0xe7bd('0x31')],_0x3f245a[_0xe7bd('0x32')]);_0xaf2436[_0xe7bd('0x36')]=_['intersection'](_0x3f245a[_0xe7bd('0x31')],qs[_0xe7bd('0x37')](_0x164eec['query'][_0xe7bd('0x37')]));_0xaf2436[_0xe7bd('0x36')]=_0xaf2436[_0xe7bd('0x36')][_0xe7bd('0x38')]?_0xaf2436[_0xe7bd('0x36')]:_0x3f245a[_0xe7bd('0x31')];_0xaf2436[_0xe7bd('0x3a')]=qs['sort'](_0x164eec[_0xe7bd('0x32')]['sort']);_0xaf2436[_0xe7bd('0x3f')]=qs[_0xe7bd('0x34')](_['pick'](_0x164eec[_0xe7bd('0x32')],_0x3f245a['filters']));if(_0x164eec[_0xe7bd('0x32')][_0xe7bd('0x3d')]){_0xaf2436[_0xe7bd('0x3f')]=_['merge'](_0xaf2436[_0xe7bd('0x3f')],{'$or':_[_0xe7bd('0x2c')](_0xaf2436[_0xe7bd('0x36')],function(_0x31d10e){var _0x363957={};_0x363957[_0x31d10e]={'$like':'%'+_0x164eec[_0xe7bd('0x32')]['filter']+'%'};return _0x363957;})});}_0xaf2436=_[_0xe7bd('0x3e')]({},_0xaf2436,_0x164eec[_0xe7bd('0x41')]);return _0x219c95[_0xe7bd('0x55')](_0xaf2436);}})[_0xe7bd('0x27')](function(_0x5ba2ff){if(_0x5ba2ff){_0x2002c6=_0x5ba2ff['length'];if(!_0x164eec[_0xe7bd('0x32')][_0xe7bd('0x58')](_0xe7bd('0x39'))){_0xaf2436[_0xe7bd('0x1e')]=qs[_0xe7bd('0x1e')](_0x164eec['query']['limit']);_0xaf2436[_0xe7bd('0x1d')]=qs[_0xe7bd('0x1d')](_0x164eec[_0xe7bd('0x32')]['offset']);}return _0x219c95[_0xe7bd('0x55')](_0xaf2436);}})[_0xe7bd('0x27')](function(_0x9d37){if(_0x9d37){return _0x9d37?{'count':_0x2002c6,'rows':_0x9d37}:null;}})[_0xe7bd('0x27')](respondWithResult(_0x489b39,null))[_0xe7bd('0x45')](handleError(_0x489b39,null));};exports[_0xe7bd('0x59')]=function(_0x4e4823,_0x47c183,_0xd26ac5){return db[_0xe7bd('0x2d')][_0xe7bd('0x49')]({'where':{'id':_0x4e4823['params']['id']}})['then'](handleEntityNotFound(_0x47c183,null))[_0xe7bd('0x27')](function(_0x5b4c58){if(_0x5b4c58){return _0x5b4c58[_0xe7bd('0x59')](_0x4e4823['query']['ids']);}})[_0xe7bd('0x27')](respondWithStatusCode(_0x47c183,null))[_0xe7bd('0x45')](handleError(_0x47c183,null));};exports['addMessage']=function(_0x5f392a,_0x1ffc5c,_0x5d66a6){if(_0x5f392a[_0xe7bd('0x4b')]['id']){delete _0x5f392a[_0xe7bd('0x4b')]['id'];}return db[_0xe7bd('0x2d')][_0xe7bd('0x49')]({'where':{'id':_0x5f392a[_0xe7bd('0x46')]['id']}})[_0xe7bd('0x27')](handleEntityNotFound(_0x1ffc5c,null))['then'](function(_0x1a01fa){if(_0x1a01fa){_0x5f392a[_0xe7bd('0x4b')][_0xe7bd('0x5a')]=_0x1a01fa['id'];return db['ChatInternalMessage'][_0xe7bd('0x4a')](_0x5f392a[_0xe7bd('0x4b')]);}})['then'](respondWithResult(_0x1ffc5c,null))[_0xe7bd('0x45')](handleError(_0x1ffc5c,null));};exports[_0xe7bd('0x5b')]=function(_0x174b7b,_0x97ef2,_0xd58ee0){var _0x3a7206={};var _0x15bb9e={};var _0x14dccc;var _0x473c16;return db[_0xe7bd('0x2d')]['findOne']({'where':{'id':_0x174b7b[_0xe7bd('0x46')]['id']}})[_0xe7bd('0x27')](handleEntityNotFound(_0x97ef2,null))[_0xe7bd('0x27')](function(_0x136c4e){if(_0x136c4e){_0x14dccc=_0x136c4e;_0x15bb9e[_0xe7bd('0x31')]=_['keys'](db[_0xe7bd('0x4f')][_0xe7bd('0x47')]);_0x15bb9e[_0xe7bd('0x32')]=_[_0xe7bd('0x33')](_0x174b7b[_0xe7bd('0x32')]);_0x15bb9e[_0xe7bd('0x34')]=_[_0xe7bd('0x35')](_0x15bb9e[_0xe7bd('0x31')],_0x15bb9e[_0xe7bd('0x32')]);_0x3a7206[_0xe7bd('0x36')]=_['intersection'](_0x15bb9e[_0xe7bd('0x31')],qs['fields'](_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x37')]));_0x3a7206[_0xe7bd('0x36')]=_0x3a7206['attributes'][_0xe7bd('0x38')]?_0x3a7206[_0xe7bd('0x36')]:_0x15bb9e[_0xe7bd('0x31')];_0x3a7206[_0xe7bd('0x3a')]=qs[_0xe7bd('0x3b')](_0x174b7b['query']['sort']);_0x3a7206[_0xe7bd('0x3f')]=qs[_0xe7bd('0x34')](_['pick'](_0x174b7b[_0xe7bd('0x32')],_0x15bb9e[_0xe7bd('0x34')]));if(_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x3d')]){_0x3a7206[_0xe7bd('0x3f')]=_['merge'](_0x3a7206[_0xe7bd('0x3f')],{'$or':_[_0xe7bd('0x2c')](_0x3a7206[_0xe7bd('0x36')],function(_0x92e2c3){var _0x327fb8={};_0x327fb8[_0x92e2c3]={'$like':'%'+_0x174b7b['query'][_0xe7bd('0x3d')]+'%'};return _0x327fb8;})});}if(_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x5c')]){var _0x229101=_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x5c')][_0xe7bd('0x5d')](',');var _0xafb85f={};_0xafb85f[_0x229101[0x0]]={'$gte':moment(_0x229101[0x1])['format'](_0xe7bd('0x5e'))};_0x3a7206[_0xe7bd('0x3f')]=_[_0xe7bd('0x3e')](_0x3a7206[_0xe7bd('0x3f')],_0xafb85f);}_0x3a7206=_[_0xe7bd('0x3e')]({},_0x3a7206,_0x174b7b['options']);return _0x14dccc[_0xe7bd('0x5b')](_0x3a7206);}})[_0xe7bd('0x27')](function(_0x4bc2e0){if(_0x4bc2e0){_0x473c16=_0x4bc2e0[_0xe7bd('0x38')];if(!_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x58')](_0xe7bd('0x39'))){_0x3a7206[_0xe7bd('0x1e')]=qs['limit'](_0x174b7b[_0xe7bd('0x32')][_0xe7bd('0x1e')]);_0x3a7206[_0xe7bd('0x1d')]=qs[_0xe7bd('0x1d')](_0x174b7b['query'][_0xe7bd('0x1d')]);}return _0x14dccc['getMessages'](_0x3a7206);}})['then'](function(_0x474fbe){if(_0x474fbe){return _0x474fbe?{'count':_0x473c16,'rows':_0x474fbe}:null;}})[_0xe7bd('0x27')](respondWithResult(_0x97ef2,null))[_0xe7bd('0x45')](handleError(_0x97ef2,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d835c82..9cfb8b3 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 _0x6efe=['ChatGroup','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6efe,0xc6));var _0xe6ef=function(_0x29728b,_0x2baf20){_0x29728b=_0x29728b-0x0;var _0x17f4f9=_0x6efe[_0x29728b];return _0x17f4f9;};'use strict';var EventEmitter=require(_0xe6ef('0x0'));var ChatGroup=require(_0xe6ef('0x1'))['db'][_0xe6ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe6ef('0x3')](0x0);var events={'afterCreate':_0xe6ef('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6bb796){return function(_0x17ed3a,_0x340687,_0x40c086){ChatGroupEvents[_0xe6ef('0x5')](_0x6bb796+':'+_0x17ed3a['id'],_0x17ed3a);ChatGroupEvents['emit'](_0x6bb796,_0x17ed3a);_0x40c086(null);};}for(var e in events){if(events[_0xe6ef('0x6')](e)){var event=events[e];ChatGroup[_0xe6ef('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x3630=['emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x3630,0x199));var _0x0363=function(_0x37ee53,_0x4ca180){_0x37ee53=_0x37ee53-0x0;var _0x4bb74a=_0x3630[_0x37ee53];return _0x4bb74a;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x0363('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0363('0x1')](0x0);var events={'afterCreate':_0x0363('0x2'),'afterUpdate':_0x0363('0x3'),'afterDestroy':_0x0363('0x4')};function emitEvent(_0x319122){return function(_0x1727d3,_0x1c6740,_0x3c8e93){ChatGroupEvents[_0x0363('0x5')](_0x319122+':'+_0x1727d3['id'],_0x1727d3);ChatGroupEvents['emit'](_0x319122,_0x1727d3);_0x3c8e93(null);};}for(var e in events){if(events[_0x0363('0x6')](e)){var event=events[e];ChatGroup[_0x0363('0x7')](e,emitEvent(event));}}module[_0x0363('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index b2b5a53..29f43d2 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 _0xed6f=['../../config/environment','exports','define','chat_groups','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2cc0c5,_0x369ea3){var _0x4cfe8b=function(_0x422bff){while(--_0x422bff){_0x2cc0c5['push'](_0x2cc0c5['shift']());}};_0x4cfe8b(++_0x369ea3);}(_0xed6f,0x118));var _0xfed6=function(_0x3e5457,_0xd17e2d){_0x3e5457=_0x3e5457-0x0;var _0x1503b9=_0xed6f[_0x3e5457];return _0x1503b9;};'use strict';var _=require(_0xfed6('0x0'));var util=require(_0xfed6('0x1'));var logger=require('../../config/logger')(_0xfed6('0x2'));var moment=require(_0xfed6('0x3'));var BPromise=require(_0xfed6('0x4'));var rp=require(_0xfed6('0x5'));var fs=require('fs');var path=require(_0xfed6('0x6'));var rimraf=require(_0xfed6('0x7'));var config=require(_0xfed6('0x8'));var attributes=require('./chatGroup.attributes');module[_0xfed6('0x9')]=function(_0x2661d3,_0xf52d05){return _0x2661d3[_0xfed6('0xa')]('ChatGroup',attributes,{'tableName':_0xfed6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4edc=['../../config/logger','api','moment','bluebird','../../config/environment','./chatGroup.attributes','exports','define','lodash','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4edc,0x198));var _0xc4ed=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x4edc[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xc4ed('0x0'));var util=require(_0xc4ed('0x1'));var logger=require(_0xc4ed('0x2'))(_0xc4ed('0x3'));var moment=require(_0xc4ed('0x4'));var BPromise=require(_0xc4ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4ed('0x6'));var attributes=require(_0xc4ed('0x7'));module[_0xc4ed('0x8')]=function(_0x5513ea,_0xdfe88f){return _0x5513ea[_0xc4ed('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index ee17c1a..56aff95 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 _0xef7c=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x1478c3,_0x1b85c1){var _0x4c4900=function(_0x501331){while(--_0x501331){_0x1478c3['push'](_0x1478c3['shift']());}};_0x4c4900(++_0x1b85c1);}(_0xef7c,0xa5));var _0xcef7=function(_0x98ec8,_0x543a6e){_0x98ec8=_0x98ec8-0x0;var _0x91d2b0=_0xef7c[_0x98ec8];return _0x91d2b0;};'use strict';var _=require(_0xcef7('0x0'));var util=require(_0xcef7('0x1'));var moment=require(_0xcef7('0x2'));var BPromise=require(_0xcef7('0x3'));var rs=require(_0xcef7('0x4'));var fs=require('fs');var Redis=require(_0xcef7('0x5'));var db=require(_0xcef7('0x6'))['db'];var utils=require(_0xcef7('0x7'));var logger=require(_0xcef7('0x8'))(_0xcef7('0x9'));var config=require(_0xcef7('0xa'));var jayson=require(_0xcef7('0xb'));var client=jayson['client'][_0xcef7('0xc')]({'port':0x232a});config['redis']=_[_0xcef7('0xd')](config[_0xcef7('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcef7('0xe')]));require(_0xcef7('0xf'))[_0xcef7('0x10')](socket);function respondWithRpcPromise(_0x401317,_0x580adc,_0x526b2c){return new BPromise(function(_0x16e18f,_0x1cb814){return client[_0xcef7('0x11')](_0x401317,_0x526b2c)[_0xcef7('0x12')](function(_0x4e2a46){logger[_0xcef7('0x13')](_0xcef7('0x14'),_0x580adc,_0xcef7('0x15'));logger[_0xcef7('0x16')](_0xcef7('0x17'),_0x580adc,_0xcef7('0x15'),JSON['stringify'](_0x4e2a46));if(_0x4e2a46['error']){if(_0x4e2a46[_0xcef7('0x18')]['code']===0x1f4){logger[_0xcef7('0x18')](_0xcef7('0x14'),_0x580adc,_0x4e2a46[_0xcef7('0x18')][_0xcef7('0x19')]);return _0x1cb814(_0x4e2a46[_0xcef7('0x18')][_0xcef7('0x19')]);}logger[_0xcef7('0x18')]('ChatGroup,\x20%s,\x20%s',_0x580adc,_0x4e2a46[_0xcef7('0x18')][_0xcef7('0x19')]);return _0x16e18f(_0x4e2a46[_0xcef7('0x18')][_0xcef7('0x19')]);}else{logger['info'](_0xcef7('0x14'),_0x580adc,_0xcef7('0x15'));_0x16e18f(_0x4e2a46[_0xcef7('0x1a')][_0xcef7('0x19')]);}})['catch'](function(_0x3b7005){logger[_0xcef7('0x18')](_0xcef7('0x14'),_0x580adc,_0x3b7005);_0x1cb814(_0x3b7005);});});} \ No newline at end of file +var _0x723e=['defaults','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x4493d3,_0x456323){var _0x40ad19=function(_0x140071){while(--_0x140071){_0x4493d3['push'](_0x4493d3['shift']());}};_0x40ad19(++_0x456323);}(_0x723e,0x179));var _0xe723=function(_0x6490c4,_0x2b2190){_0x6490c4=_0x6490c4-0x0;var _0x1cccdc=_0x723e[_0x6490c4];return _0x1cccdc;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});config[_0xe723('0xc')]=_[_0xe723('0xd')](config[_0xe723('0xc')],{'host':_0xe723('0xe'),'port':0x18eb});var socket=require(_0xe723('0xf'))(new Redis(config[_0xe723('0xc')]));require('./chatGroup.socket')[_0xe723('0x10')](socket);function respondWithRpcPromise(_0x270346,_0x34831f,_0x5a43fb){return new BPromise(function(_0x24eef1,_0x3809af){return client[_0xe723('0x11')](_0x270346,_0x5a43fb)['then'](function(_0x146098){logger[_0xe723('0x12')](_0xe723('0x13'),_0x34831f,_0xe723('0x14'));logger[_0xe723('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x34831f,_0xe723('0x14'),JSON['stringify'](_0x146098));if(_0x146098['error']){if(_0x146098['error']['code']===0x1f4){logger[_0xe723('0x16')](_0xe723('0x13'),_0x34831f,_0x146098[_0xe723('0x16')][_0xe723('0x17')]);return _0x3809af(_0x146098[_0xe723('0x16')]['message']);}logger[_0xe723('0x16')](_0xe723('0x13'),_0x34831f,_0x146098[_0xe723('0x16')][_0xe723('0x17')]);return _0x24eef1(_0x146098[_0xe723('0x16')][_0xe723('0x17')]);}else{logger[_0xe723('0x12')](_0xe723('0x13'),_0x34831f,_0xe723('0x14'));_0x24eef1(_0x146098[_0xe723('0x18')][_0xe723('0x17')]);}})[_0xe723('0x19')](function(_0x262a8d){logger[_0xe723('0x16')]('ChatGroup,\x20%s,\x20%s',_0x34831f,_0x262a8d);_0x3809af(_0x262a8d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a9448a7..d694660 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 _0x390e=['./chatGroup.events','remove','update','register','chatGroup:'];(function(_0xb9da79,_0x18e04c){var _0xeb8c18=function(_0x4456d0){while(--_0x4456d0){_0xb9da79['push'](_0xb9da79['shift']());}};_0xeb8c18(++_0x18e04c);}(_0x390e,0x1a4));var _0xe390=function(_0x567d36,_0x55a9ac){_0x567d36=_0x567d36-0x0;var _0x3c0998=_0x390e[_0x567d36];return _0x3c0998;};'use strict';var ChatGroupEvents=require(_0xe390('0x0'));var events=['save',_0xe390('0x1'),_0xe390('0x2')];function createListener(_0x5597a9,_0x1147ad){return function(_0x55737c){_0x1147ad['emit'](_0x5597a9,_0x55737c);};}function removeListener(_0x5746fa,_0xe6da5a){return function(){ChatGroupEvents['removeListener'](_0x5746fa,_0xe6da5a);};}exports[_0xe390('0x3')]=function(_0x5a775e){for(var _0x420341=0x0,_0x328c26=events['length'];_0x420341<_0x328c26;_0x420341++){var _0x2a6e53=events[_0x420341];var _0x182247=createListener(_0xe390('0x4')+_0x2a6e53,_0x5a775e);ChatGroupEvents['on'](_0x2a6e53,_0x182247);}}; \ No newline at end of file +var _0x3c5c=['register','length','chatGroup:','save','remove','update','emit','removeListener'];(function(_0x1f7420,_0x46922d){var _0x5574ac=function(_0x48f0e4){while(--_0x48f0e4){_0x1f7420['push'](_0x1f7420['shift']());}};_0x5574ac(++_0x46922d);}(_0x3c5c,0xd3));var _0xc3c5=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x3c5c[_0x334841];return _0x5beb4b;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc3c5('0x0'),_0xc3c5('0x1'),_0xc3c5('0x2')];function createListener(_0x23515b,_0x589293){return function(_0x437aa8){_0x589293[_0xc3c5('0x3')](_0x23515b,_0x437aa8);};}function removeListener(_0x1d840d,_0x104e11){return function(){ChatGroupEvents[_0xc3c5('0x4')](_0x1d840d,_0x104e11);};}exports[_0xc3c5('0x5')]=function(_0x13d8b8){for(var _0x2aa9d0=0x0,_0x452c5d=events[_0xc3c5('0x6')];_0x2aa9d0<_0x452c5d;_0x2aa9d0++){var _0x20b7a9=events[_0x2aa9d0];var _0x5cdec1=createListener(_0xc3c5('0x7')+_0x20b7a9,_0x13d8b8);ChatGroupEvents['on'](_0x20b7a9,_0x5cdec1);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c20be13..4a5ea3e 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 _0x9161=['removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','update','delete'];(function(_0x55d0fd,_0x1b1bdd){var _0x40ce6f=function(_0x282df9){while(--_0x282df9){_0x55d0fd['push'](_0x55d0fd['shift']());}};_0x40ce6f(++_0x1b1bdd);}(_0x9161,0xca));var _0x1916=function(_0xfd2b3e,_0x57efea){_0xfd2b3e=_0xfd2b3e-0x0;var _0x45d1e8=_0x9161[_0xfd2b3e];return _0x45d1e8;};'use strict';var multer=require(_0x1916('0x0'));var util=require(_0x1916('0x1'));var path=require(_0x1916('0x2'));var timeout=require('connect-timeout');var express=require(_0x1916('0x3'));var router=express[_0x1916('0x4')]();var fs_extra=require(_0x1916('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1916('0x6'));var config=require(_0x1916('0x7'));var controller=require('./chatGroup.controller');router[_0x1916('0x8')]('/',auth[_0x1916('0x9')](),controller[_0x1916('0xa')]);router[_0x1916('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1916('0x8')](_0x1916('0xb'),auth[_0x1916('0x9')](),controller[_0x1916('0xc')]);router['get'](_0x1916('0xd'),auth['isAuthenticated'](),controller[_0x1916('0xe')]);router['get'](_0x1916('0xf'),auth[_0x1916('0x9')](),controller[_0x1916('0x10')]);router['get'](_0x1916('0x11'),auth[_0x1916('0x9')](),controller[_0x1916('0x12')]);router[_0x1916('0x13')]('/',auth[_0x1916('0x9')](),controller[_0x1916('0x14')]);router['post'](_0x1916('0xf'),auth[_0x1916('0x9')](),controller['addMembers']);router[_0x1916('0x13')](_0x1916('0x11'),auth[_0x1916('0x9')](),controller['addMessage']);router['put'](_0x1916('0xb'),auth['isAuthenticated'](),controller[_0x1916('0x15')]);router[_0x1916('0x16')]('/:id',auth[_0x1916('0x9')](),controller['destroy']);router[_0x1916('0x16')]('/:id/members',auth[_0x1916('0x9')](),controller[_0x1916('0x17')]);module[_0x1916('0x18')]=router; \ No newline at end of file +var _0x4a23=['addMessage','put','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','describe','show','/:id/members','getMembers','get','getMessages','create','post','addMembers','/:id/messages'];(function(_0x4814d2,_0x22c926){var _0x2bb7c8=function(_0x179769){while(--_0x179769){_0x4814d2['push'](_0x4814d2['shift']());}};_0x2bb7c8(++_0x22c926);}(_0x4a23,0x1af));var _0x34a2=function(_0x4b9f59,_0x3281ff){_0x4b9f59=_0x4b9f59-0x0;var _0x42e231=_0x4a23[_0x4b9f59];return _0x42e231;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x34a2('0x0'));var timeout=require(_0x34a2('0x1'));var express=require(_0x34a2('0x2'));var router=express[_0x34a2('0x3')]();var fs_extra=require(_0x34a2('0x4'));var auth=require(_0x34a2('0x5'));var interaction=require(_0x34a2('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x34a2('0x7')](),controller[_0x34a2('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x34a2('0x9')]);router['get']('/:id',auth[_0x34a2('0x7')](),controller[_0x34a2('0xa')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router['get'](_0x34a2('0xb'),auth['isAuthenticated'](),controller[_0x34a2('0xc')]);router[_0x34a2('0xd')]('/:id/messages',auth['isAuthenticated'](),controller[_0x34a2('0xe')]);router['post']('/',auth[_0x34a2('0x7')](),controller[_0x34a2('0xf')]);router[_0x34a2('0x10')]('/:id/members',auth[_0x34a2('0x7')](),controller[_0x34a2('0x11')]);router[_0x34a2('0x10')](_0x34a2('0x12'),auth['isAuthenticated'](),controller[_0x34a2('0x13')]);router[_0x34a2('0x14')](_0x34a2('0x15'),auth['isAuthenticated'](),controller[_0x34a2('0x16')]);router[_0x34a2('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x34a2('0xb'),auth[_0x34a2('0x7')](),controller['removeMembers']);module[_0x34a2('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4e775ea..57c95f2 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 _0xb677=['DATE','STRING','sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb677,0x119));var _0x7b67=function(_0x5024d7,_0x784883){_0x5024d7=_0x5024d7-0x0;var _0x19c8af=_0xb677[_0x5024d7];return _0x19c8af;};'use strict';var Sequelize=require(_0x7b67('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7b67('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7b67('0x2')]},'ratingType':{'type':Sequelize[_0x7b67('0x3')](_0x7b67('0x4'),_0x7b67('0x5')),'defaultValue':_0x7b67('0x4')},'ratingMessage':{'type':Sequelize[_0x7b67('0x6')]},'pathTranscript':{'type':Sequelize[_0x7b67('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7b67('0x7')]},'disposition':{'type':Sequelize[_0x7b67('0x8')]},'secondDisposition':{'type':Sequelize[_0x7b67('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7b67('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7b67('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x7b67('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x7b67('0x8')]},'referer':{'type':Sequelize[_0x7b67('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7b67('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7b67('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x7b67('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x7b67('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x3f8c=['DATE','STRING','TEXT','long','BOOLEAN','INTEGER','ENUM','star'];(function(_0x9bbf6a,_0x12d850){var _0x4aab02=function(_0x506c19){while(--_0x506c19){_0x9bbf6a['push'](_0x9bbf6a['shift']());}};_0x4aab02(++_0x12d850);}(_0x3f8c,0x104));var _0xc3f8=function(_0x29d586,_0x5aadbc){_0x29d586=_0x29d586-0x0;var _0x6bbb10=_0x3f8c[_0x29d586];return _0x6bbb10;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc3f8('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc3f8('0x1')]},'ratingType':{'type':Sequelize[_0xc3f8('0x2')](_0xc3f8('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc3f8('0x4')]},'disposition':{'type':Sequelize[_0xc3f8('0x5')]},'secondDisposition':{'type':Sequelize[_0xc3f8('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc3f8('0x5')]},'note':{'type':Sequelize[_0xc3f8('0x5')]},'browserName':{'type':Sequelize[_0xc3f8('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc3f8('0x5')]},'osVersion':{'type':Sequelize[_0xc3f8('0x5')]},'deviceModel':{'type':Sequelize[_0xc3f8('0x5')]},'deviceVendor':{'type':Sequelize[_0xc3f8('0x5')]},'deviceType':{'type':Sequelize[_0xc3f8('0x5')]},'referer':{'type':Sequelize[_0xc3f8('0x6')]},'customerIp':{'type':Sequelize[_0xc3f8('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xc3f8('0x7'))},'read1stAt':{'type':Sequelize[_0xc3f8('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc3f8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc3f8('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc3f8('0x5')]},'customerPort':{'type':Sequelize[_0xc3f8('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xc3f8('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xc3f8('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 58a3f77..6018b4b 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 _0x4444=['api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','user','show','model','keys','filters','intersection','attributes','fields','includeAll','options','create','find','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','length','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','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','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','order','filter','includeAgent','push','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','direction','read','get','mkdirSync','Chat','Account','Owner','N.A.','closedAt','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger'];(function(_0x526046,_0x154040){var _0x5b92a2=function(_0x1e92af){while(--_0x1e92af){_0x526046['push'](_0x526046['shift']());}};_0x5b92a2(++_0x154040);}(_0x4444,0x1a2));var _0x4444=function(_0x20d4e7,_0x5f29f7){_0x20d4e7=_0x20d4e7-0x0;var _0x125131=_0x4444[_0x20d4e7];return _0x125131;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4444('0x0'));var rp=require(_0x4444('0x1'));var moment=require(_0x4444('0x2'));var BPromise=require(_0x4444('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4444('0x4'));var ejs=require(_0x4444('0x5'));var fs=require('fs');var _=require(_0x4444('0x6'));var Redis=require(_0x4444('0x7'));var interaction=require(_0x4444('0x8'));var qs=require(_0x4444('0x9'));var pdf=require(_0x4444('0xa'));var logger=require(_0x4444('0xb'))(_0x4444('0xc'));var config=require(_0x4444('0xd'));var db=require(_0x4444('0xe'))['db'];config[_0x4444('0xf')]=_[_0x4444('0x10')](config[_0x4444('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4444('0x11'))(new Redis(config['redis']));require(_0x4444('0x12'))[_0x4444('0x13')](socket);var jayson=require(_0x4444('0x14'));var client=jayson[_0x4444('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x4444('0x15')][_0x4444('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x48d2fd,_0x4043b8,_0x171fce,_0x399edc){return new BPromise(function(_0x48cfef,_0x2fceff){var _0x54a3c5=_0x399edc||client;return _0x54a3c5[_0x4444('0x17')](_0x48d2fd,_0x171fce)[_0x4444('0x18')](function(_0x787e21){logger[_0x4444('0x19')](_0x4444('0x1a'),_0x4043b8,_0x4444('0x1b'));logger[_0x4444('0x1c')](_0x4444('0x1d'),_0x4043b8,_0x4444('0x1b'),JSON['stringify'](_0x787e21));if(_0x787e21['error']){if(_0x787e21['error']['code']===0x1f4){logger[_0x4444('0x1e')](_0x4444('0x1a'),_0x4043b8,_0x787e21[_0x4444('0x1e')]['message']);return _0x2fceff(_0x787e21[_0x4444('0x1e')][_0x4444('0x1f')]);}logger[_0x4444('0x1e')](_0x4444('0x1a'),_0x4043b8,_0x787e21[_0x4444('0x1e')][_0x4444('0x1f')]);return _0x48cfef(_0x787e21['error'][_0x4444('0x1f')]);}else{logger[_0x4444('0x19')](_0x4444('0x1a'),_0x4043b8,_0x4444('0x1b'));_0x48cfef(_0x787e21[_0x4444('0x20')][_0x4444('0x1f')]);}})[_0x4444('0x21')](function(_0x3956e8){logger['error'](_0x4444('0x1a'),_0x4043b8,_0x3956e8);_0x2fceff(_0x3956e8);});});}function respondWithStatusCode(_0x227e3c,_0x8be591){_0x8be591=_0x8be591||0xcc;return function(_0xdcbc5){if(_0xdcbc5){return _0x227e3c['sendStatus'](_0x8be591);}return _0x227e3c['status'](_0x8be591)[_0x4444('0x22')]();};}function respondWithResult(_0xd36027,_0x1e2496){_0x1e2496=_0x1e2496||0xc8;return function(_0x3d0bd9){if(_0x3d0bd9){return _0xd36027[_0x4444('0x23')](_0x1e2496)[_0x4444('0x24')](_0x3d0bd9);}};}function respondWithFilteredResult(_0x41e764,_0x35ab62){return function(_0xd6c02f){if(_0xd6c02f){var _0x79a26b=typeof _0x35ab62[_0x4444('0x25')]===_0x4444('0x26')&&typeof _0x35ab62[_0x4444('0x27')]===_0x4444('0x26');var _0x3a6636=_0xd6c02f[_0x4444('0x28')];var _0x13a6a1=_0x79a26b?0x0:_0x35ab62[_0x4444('0x25')];var _0x4129cc=_0x79a26b?_0xd6c02f[_0x4444('0x28')]:_0x35ab62['offset']+_0x35ab62[_0x4444('0x27')];var _0x341fd0;if(_0x4129cc>=_0x3a6636){_0x4129cc=_0x3a6636;_0x341fd0=0xc8;}else{_0x341fd0=0xce;}_0x41e764['status'](_0x341fd0);return _0x41e764[_0x4444('0x29')]('Content-Range',_0x13a6a1+'-'+_0x4129cc+'/'+_0x3a6636)[_0x4444('0x24')](_0xd6c02f);}return null;};}function saveUpdates(_0x334c50){return function(_0x355d1a){if(_0x355d1a){return _0x355d1a[_0x4444('0x2a')](_0x334c50)[_0x4444('0x18')](function(_0x48ab2d){return _0x48ab2d;});}return null;};}function removeEntity(_0x47fc68){return function(_0x39ebeb){if(_0x39ebeb){return _0x39ebeb[_0x4444('0x2b')]()[_0x4444('0x18')](function(){_0x47fc68['status'](0xcc)[_0x4444('0x22')]();});}};}function handleEntityNotFound(_0x409e72){return function(_0x400336){if(!_0x400336){_0x409e72[_0x4444('0x2c')](0x194);}return _0x400336;};}function handleError(_0x56ab51,_0x8350f5){_0x8350f5=_0x8350f5||0x1f4;return function(_0x23b0e8){logger[_0x4444('0x1e')](_0x23b0e8[_0x4444('0x2d')]);if(_0x23b0e8[_0x4444('0x2e')]){delete _0x23b0e8[_0x4444('0x2e')];}_0x56ab51[_0x4444('0x23')](_0x8350f5)[_0x4444('0x2f')](_0x23b0e8);};}function getMustacheRender(_0x4be0ca,_0x4ef4b3){return Mustache[_0x4444('0x30')](_0x4be0ca,_[_0x4444('0x31')](_0x4ef4b3[_0x4444('0x32')],{'contact':_0x4ef4b3[_0x4444('0x33')],'message':_0x4ef4b3['message'],'agent':_0x4ef4b3[_0x4444('0x34')],'interaction':_0x4ef4b3[_0x4444('0x35')],'account':_0x4ef4b3[_0x4444('0x36')]}))||'';}exports[_0x4444('0x37')]=function(_0x445fdc,_0x1e99d4){var _0x48095d={};var _0x2050f4=_[_0x4444('0x38')](db[_0x4444('0x39')][_0x4444('0x3a')],function(_0x392647){return{'name':_0x392647[_0x4444('0x3b')],'type':_0x392647[_0x4444('0x3c')]['key']};});_0x48095d=qs[_0x4444('0x3d')](_0x2050f4,_0x445fdc);return interaction[_0x4444('0x3e')](_0x4444('0x3f'),_0x445fdc[_0x4444('0x40')],_0x445fdc[_0x4444('0x41')],_0x48095d,_0x2050f4)[_0x4444('0x18')](respondWithFilteredResult(_0x1e99d4,_0x48095d))[_0x4444('0x21')](handleError(_0x1e99d4,null));};exports[_0x4444('0x42')]=function(_0x1b165f,_0x4f60e1){var _0x169914={'raw':![],'where':{'id':_0x1b165f['params']['id']}},_0x12a02b={};_0x12a02b[_0x4444('0x43')]=_[_0x4444('0x44')](db[_0x4444('0x39')][_0x4444('0x3a')]);_0x12a02b[_0x4444('0x40')]=_['keys'](_0x1b165f['query']);_0x12a02b[_0x4444('0x45')]=_[_0x4444('0x46')](_0x12a02b[_0x4444('0x43')],_0x12a02b[_0x4444('0x40')]);_0x169914[_0x4444('0x47')]=_[_0x4444('0x46')](_0x12a02b[_0x4444('0x43')],qs[_0x4444('0x48')](_0x1b165f['query'][_0x4444('0x48')]));_0x169914['attributes']=_0x169914['attributes']['length']?_0x169914[_0x4444('0x47')]:_0x12a02b['model'];if(_0x1b165f[_0x4444('0x40')][_0x4444('0x49')]){_0x169914['include']=[{'all':!![]}];}_0x169914=_[_0x4444('0x31')]({},_0x169914,_0x1b165f[_0x4444('0x4a')]);return db[_0x4444('0x39')]['find'](_0x169914)[_0x4444('0x18')](handleEntityNotFound(_0x4f60e1,null))['then'](respondWithResult(_0x4f60e1,null))['catch'](handleError(_0x4f60e1,null));};exports[_0x4444('0x4b')]=function(_0x1300be,_0x406e80){return db['ChatInteraction'][_0x4444('0x4b')](_0x1300be[_0x4444('0x32')],{})['then'](respondWithResult(_0x406e80,0xc9))[_0x4444('0x21')](handleError(_0x406e80,null));};exports['update']=function(_0x1c9881,_0x139762){if(_0x1c9881[_0x4444('0x32')]['id']){delete _0x1c9881[_0x4444('0x32')]['id'];}return db['ChatInteraction'][_0x4444('0x4c')]({'where':{'id':_0x1c9881['params']['id']}})[_0x4444('0x18')](handleEntityNotFound(_0x139762,null))['then'](saveUpdates(_0x1c9881[_0x4444('0x32')],null))[_0x4444('0x18')](respondWithResult(_0x139762,null))[_0x4444('0x21')](handleError(_0x139762,null));};exports['destroy']=function(_0x323c60,_0x12b361){return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x323c60[_0x4444('0x4d')]['id']}})[_0x4444('0x18')](handleEntityNotFound(_0x12b361,null))[_0x4444('0x18')](removeEntity(_0x12b361,null))[_0x4444('0x21')](handleError(_0x12b361,null));};exports[_0x4444('0x4e')]=function(_0x851c02,_0x2b24ad){return db['ChatInteraction'][_0x4444('0x4e')]()[_0x4444('0x18')](respondWithResult(_0x2b24ad,null))[_0x4444('0x21')](handleError(_0x2b24ad,null));};exports[_0x4444('0x4f')]=function(_0x1db50c,_0x152998){var _0x45d04d=_0x1db50c[_0x4444('0x4d')]['id'];var _0x2de253;var _0x42359e;var _0x3d2207;return db[_0x4444('0x39')][_0x4444('0x50')]({'where':{'id':_0x45d04d}})[_0x4444('0x18')](function(_0x354511){_0x2de253=_0x354511;return db[_0x4444('0x51')][_0x4444('0x50')]({'where':{'id':_0x354511[_0x4444('0x52')]},'attributes':['id',_0x4444('0x53'),'vidaooEscalation',_0x4444('0x54'),'vidaooNote',_0x4444('0x55')],'raw':!![]});})[_0x4444('0x18')](function(_0x2e4271){if(_0x2e4271&&_0x2e4271[_0x4444('0x53')]&&_0x2e4271[_0x4444('0x56')]){_0x42359e=_0x2e4271;var _0x9a91cd={'interaction':{'id':_0x45d04d},'agent':{'id':_0x1db50c[_0x4444('0x41')]['id'],'name':_0x1db50c[_0x4444('0x41')]['name'],'fullname':_0x1db50c[_0x4444('0x41')]['fullname'],'email':_0x1db50c[_0x4444('0x41')][_0x4444('0x57')]},'contact':_0x1db50c['body'][_0x4444('0x33')],'account':_0x1db50c['body']['account']};var _0xa00b9e={'rejectUnauthorized':![],'method':_0x4444('0x58'),'url':_0x4444('0x59'),'headers':{'X-APIKEY':_0x2e4271[_0x4444('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1db50c['user'][_0x4444('0x57')]],'buttons':null,'topic':_0x42359e[_0x4444('0x54')],'note':_[_0x4444('0x5a')](_0x42359e['vidaooNote'])?null:getMustacheRender(_0x42359e[_0x4444('0x5b')],_0x9a91cd),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4444('0x5a')](_0x42359e[_0x4444('0x55')])){var _0x5dd255=getMustacheRender(_0x42359e[_0x4444('0x55')],_0x9a91cd);var _0x34b62a=JSON[_0x4444('0x5c')](_0x5dd255);_0xa00b9e['body'][_0x4444('0x5d')]=_0x34b62a;}}catch(_0x544b81){throw new db[(_0x4444('0x5e'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xa00b9e);}else{throw new db[(_0x4444('0x5e'))][(_0x4444('0x5f'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x4444('0x18')](function(_0x5d9d9f){_0x3d2207=_0x5d9d9f;if(_0x3d2207['id']){var _0x2ca096={'body':_0x3d2207[_0x4444('0x60')],'ChatWebsiteId':_0x42359e['id'],'ChatInteractionId':_0x2de253['id'],'direction':_0x4444('0x61'),'UserId':_0x1db50c[_0x4444('0x41')]['id']};return db[_0x4444('0x62')][_0x4444('0x4b')](_0x2ca096,{});}else{throw new db[(_0x4444('0x5e'))][(_0x4444('0x5f'))](_0x4444('0x63'));}})[_0x4444('0x18')](function(){return _0x2de253[_0x4444('0x64')]({'vidaooSessionId':_0x3d2207['id']});})[_0x4444('0x18')](respondWithResult(_0x152998,null))[_0x4444('0x21')](handleError(_0x152998,null));};exports[_0x4444('0x65')]=function(_0x178e0a,_0x6b8126){if(_0x178e0a['body']['id']){delete _0x178e0a[_0x4444('0x32')]['id'];}return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x178e0a[_0x4444('0x4d')]['id']},'include':[{'model':db[_0x4444('0x66')],'as':_0x4444('0x67')}]})['then'](handleEntityNotFound(_0x6b8126,null))['then'](saveUpdates(_0x178e0a[_0x4444('0x32')],null))[_0x4444('0x18')](respondWithResult(_0x6b8126,null))[_0x4444('0x21')](handleError(_0x6b8126,null));};exports['abandon']=function(_0x25967c,_0x8ee18f){if(_0x25967c[_0x4444('0x32')]['id']){delete _0x25967c['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x25967c['params']['id']}})[_0x4444('0x18')](function(_0x3cb63a){if(!_0x3cb63a){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4444('0x68'),0x194,_0x4444('0x69'));_0x8ee18f[_0x4444('0x2c')](0x194);}else{if(_0x3cb63a[_0x4444('0x6a')]){throw new db[(_0x4444('0x5e'))][(_0x4444('0x5f'))](_0x4444('0x6b'));}}return _0x3cb63a;})['then'](function(_0x4296d7){if(_0x4296d7){return _0x4296d7[_0x4444('0x2a')]({'closed':_0x25967c[_0x4444('0x32')][_0x4444('0x6c')],'disposition':_0x25967c['body'][_0x4444('0x6d')]})['then'](function(_0x1e5ebc){return _0x1e5ebc;});}})[_0x4444('0x18')](function(){return respondWithRpcPromise(_0x4444('0x6e'),'abandon',_0x25967c[_0x4444('0x32')],client9004);})['then'](respondWithResult(_0x8ee18f,null))['catch'](handleError(_0x8ee18f,null));};exports[_0x4444('0x6f')]=function(_0x1574b5,_0x3dae41){_0x1574b5[_0x4444('0x32')][_0x4444('0x2e')]=_0x1574b5[_0x4444('0x70')]['originalname'];_0x1574b5[_0x4444('0x32')][_0x4444('0x71')]=_0x1574b5[_0x4444('0x70')]['filename'];_0x1574b5[_0x4444('0x32')][_0x4444('0x3c')]=_0x1574b5['file'][_0x4444('0x72')];return db['Attachment']['create'](_0x1574b5[_0x4444('0x32')])[_0x4444('0x18')](respondWithResult(_0x3dae41,0xc9))[_0x4444('0x21')](handleError(_0x3dae41,null));};exports['attachmentDownload']=function(_0x1ddedf,_0x2fdb1b){return db[_0x4444('0x39')][_0x4444('0x50')]({'where':{'id':_0x1ddedf[_0x4444('0x4d')]['id']},'raw':!![]})[_0x4444('0x18')](handleEntityNotFound(_0x2fdb1b,null))[_0x4444('0x18')](function(_0x5ef63d){if(_0x5ef63d){if(_0x5ef63d[_0x4444('0x6c')]){return _0x2fdb1b[_0x4444('0x23')](0x193)['json']({'status':0x193,'message':_0x4444('0x73')});}return db[_0x4444('0x74')][_0x4444('0x50')]({'where':{'id':_0x1ddedf[_0x4444('0x40')][_0x4444('0x75')]},'raw':!![]})[_0x4444('0x18')](handleEntityNotFound(_0x2fdb1b,null));}})['then'](function(_0x35e5b2){if(_0x35e5b2){var _0x297227=_0x35e5b2[_0x4444('0x76')]!==null;var _0x27ebac=path[_0x4444('0x77')](config[_0x4444('0x78')],_0x4444('0x79'));if(_0x297227){_0x27ebac=path[_0x4444('0x77')](_0x27ebac,'offline-chat/');}var _0x312ec2=path[_0x4444('0x77')](_0x27ebac,_0x35e5b2[_0x4444('0x71')]);return _0x2fdb1b[_0x4444('0x7a')](_0x312ec2);}})[_0x4444('0x21')](handleError(_0x2fdb1b,null));};exports[_0x4444('0x7b')]=function(_0x1f00e9,_0x54f1ea){var _0x1956ff=null;var _0x7cb030=null;var _0x2b8a56=null;if(_0x1f00e9[_0x4444('0x32')]['id']){delete _0x1f00e9[_0x4444('0x32')]['id'];}if(_0x1f00e9[_0x4444('0x32')][_0x4444('0x7c')]){_0x2b8a56=path[_0x4444('0x77')](config[_0x4444('0x78')],_0x4444('0x7d'),util[_0x4444('0x7e')](_0x4444('0x7f'),Date[_0x4444('0x80')]()));_0x1f00e9[_0x4444('0x32')]['pathTranscript']=_0x2b8a56;}return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x1f00e9[_0x4444('0x4d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x4444('0x81'),'include':[{'model':db[_0x4444('0x82')],'as':_0x4444('0x82')}]}]})['then'](handleEntityNotFound(_0x54f1ea,null))[_0x4444('0x18')](saveUpdates(_0x1f00e9[_0x4444('0x32')],null))['then'](function(_0x4d73fd){if(_0x4d73fd){_0x1956ff=_0x4d73fd;return db[_0x4444('0x51')][_0x4444('0x4c')]({'where':{'id':_0x1956ff[_0x4444('0x52')]}});}})[_0x4444('0x18')](function(_0x3d0fa8){if(_0x3d0fa8){_0x7cb030=_0x3d0fa8;return db['CmContact'][_0x4444('0x4c')]({'where':{'id':_0x1956ff[_0x4444('0x83')]}});}})[_0x4444('0x18')](function(_0x128b03){if(_0x128b03){if(_0x2b8a56){var _0x437397=null;for(var _0x4a4dff=0x1;_0x4a4dff<_0x1956ff[_0x4444('0x81')][_0x4444('0x84')];++_0x4a4dff){_0x437397=_0x1956ff['Messages'][_0x4a4dff];var _0x3e1482=_0x437397['UserId']?util[_0x4444('0x7e')](_0x4444('0x85'),_0x7cb030[_0x4444('0x86')],_0x437397[_0x4444('0x6a')]):_0x4444('0x87');var _0xc12139=_0x1f00e9['body'][_0x4444('0x88')]||util[_0x4444('0x7e')](_0x4444('0x85'),_0x4444('0x89'),_0x437397[_0x4444('0x83')]);switch(_0x7cb030['agentIdentifier']){case _0x4444('0x8a'):_0x3e1482=_0x437397[_0x4444('0x6a')]?util['format']('%s%d',_0x7cb030[_0x4444('0x86')],_0x437397[_0x4444('0x6a')]):_0x4444('0x87');break;case'agent_alias':_0x3e1482=_0x437397[_0x4444('0x6a')]?_0x437397['User'][_0x4444('0x8b')]||_0x437397[_0x4444('0x82')][_0x4444('0x8c')]:_0x4444('0x87');break;case _0x4444('0x8d'):_0x3e1482=_0x437397['UserId']?_0x437397[_0x4444('0x82')][_0x4444('0x8c')]:'System';break;default:_0x3e1482=_0x437397[_0x4444('0x6a')]?util['format']('%s%d',_0x7cb030['agentAlias'],_0x437397[_0x4444('0x6a')]):'System';}var _0x7b682a=util[_0x4444('0x7e')](_0x4444('0x8e'),moment(_0x437397[_0x4444('0x8f')])[_0x4444('0x7e')](_0x4444('0x90')),_0x437397['direction']==='in'?_0xc12139:_0x3e1482,_0x437397[_0x4444('0x32')]);if(!_0x437397[_0x4444('0x91')]){fs[_0x4444('0x92')](_0x2b8a56,_0x7b682a);}}return db[_0x4444('0x93')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4444('0x94')],'as':_0x4444('0x95'),'raw':!![],'include':[{'model':db[_0x4444('0x96')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x4444('0x18')](function(_0x3ad3d7){if(!_0x3ad3d7||!_0x3ad3d7[_0x4444('0x95')]||!_0x1f00e9['body'])return _0x1956ff;var _0x2f3625=_0x3ad3d7[_0x4444('0x97')]();return respondWithRpcPromise(_0x4444('0x98'),_0x4444('0x99'),{'account':_0x2f3625,'message':{'from':util[_0x4444('0x7e')](_0x4444('0x9a'),_0x3ad3d7['name'],_0x3ad3d7['email']||_0x3ad3d7[_0x4444('0x95')][_0x4444('0x41')]),'to':_0x1f00e9['body'][_0x4444('0x7c')],'subject':_0x4444('0x9b'),'text':util['format'](_0x4444('0x9c'),_0x1f00e9[_0x4444('0x32')]['mailTranscript']),'attachments':[{'path':_0x2b8a56}]}})[_0x4444('0x18')](function(){return _0x1956ff;})[_0x4444('0x21')](function(_0x5a3889){logger[_0x4444('0x1e')](_0x5a3889);});})['then'](respondWithStatusCode(_0x54f1ea,0xc8))['catch'](handleError(_0x54f1ea,null));};exports[_0x4444('0x9d')]=function(_0xd3e1a4,_0x2d5974){return db['ChatMessage'][_0x4444('0x4c')]({'where':{'id':_0xd3e1a4[_0x4444('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2d5974,null))[_0x4444('0x18')](function(_0x17ef31){if(_0x17ef31){return _0x17ef31['addMessage'](_0xd3e1a4[_0x4444('0x32')][_0x4444('0x9e')],_[_0x4444('0x9f')](_0xd3e1a4[_0x4444('0x32')],[_0x4444('0x9e'),'id'])||{});}})[_0x4444('0x18')](respondWithResult(_0x2d5974,null))[_0x4444('0x21')](handleError(_0x2d5974,null));};exports['getMessages']=function(_0x277663,_0x1d8a7c){var _0x2f2ac7={'raw':![],'where':{}};var _0x35708e={};var _0x2253d8={'count':0x0,'rows':[]};return db[_0x4444('0x39')]['findOne']({'where':{'id':_0x277663['params']['id']}})[_0x4444('0x18')](handleEntityNotFound(_0x1d8a7c,null))['then'](function(_0x287068){if(_0x287068){_0x35708e['model']=_[_0x4444('0x44')](db[_0x4444('0x62')]['rawAttributes']);_0x35708e[_0x4444('0x40')]=_[_0x4444('0x44')](_0x277663['query']);_0x35708e[_0x4444('0x45')]=_[_0x4444('0x46')](_0x35708e[_0x4444('0x43')],_0x35708e[_0x4444('0x40')]);_0x2f2ac7[_0x4444('0x47')]=_[_0x4444('0x46')](_0x35708e[_0x4444('0x43')],qs[_0x4444('0x48')](_0x277663[_0x4444('0x40')][_0x4444('0x48')]));_0x2f2ac7[_0x4444('0x47')]=_0x2f2ac7[_0x4444('0x47')]['length']?_0x2f2ac7[_0x4444('0x47')]:_0x35708e[_0x4444('0x43')];if(!_0x277663[_0x4444('0x40')][_0x4444('0xa0')](_0x4444('0xa1'))){_0x2f2ac7[_0x4444('0x27')]=qs[_0x4444('0x27')](_0x277663['query'][_0x4444('0x27')]);_0x2f2ac7[_0x4444('0x25')]=qs[_0x4444('0x25')](_0x277663[_0x4444('0x40')][_0x4444('0x25')]);}_0x2f2ac7['order']=qs[_0x4444('0xa2')](_0x277663[_0x4444('0x40')][_0x4444('0xa2')]);_0x2f2ac7[_0x4444('0xa3')]=qs[_0x4444('0x45')](_[_0x4444('0xa4')](_0x277663[_0x4444('0x40')],_0x35708e[_0x4444('0x45')]));_0x2f2ac7[_0x4444('0xa3')][_0x4444('0xa5')]=_0x287068['id'];if(_0x277663[_0x4444('0x40')]['filter']){_0x2f2ac7[_0x4444('0xa3')]=_[_0x4444('0x31')](_0x2f2ac7[_0x4444('0xa3')],{'$or':_[_0x4444('0x38')](_0x2f2ac7['attributes'],function(_0x5b1439){var _0x301260={};_0x301260[_0x5b1439]={'$like':'%'+_0x277663[_0x4444('0x40')]['filter']+'%'};return _0x301260;})});}if(_0x277663[_0x4444('0x40')][_0x4444('0xa6')]){var _0x43d867=_0x277663[_0x4444('0x40')][_0x4444('0xa6')][_0x4444('0xa7')](',');var _0x33d9a4={};_0x33d9a4[_0x43d867[0x0]]={'$gte':moment(_0x43d867[0x1])[_0x4444('0x7e')](_0x4444('0xa8'))};_0x2f2ac7[_0x4444('0xa3')]=_[_0x4444('0x31')](_0x2f2ac7[_0x4444('0xa3')],_0x33d9a4);}_0x2f2ac7=_[_0x4444('0x31')]({},_0x2f2ac7,_0x277663[_0x4444('0x4a')]);return db[_0x4444('0x62')][_0x4444('0x28')]({'where':_0x2f2ac7['where']})[_0x4444('0x18')](function(_0x190dbd){_0x2253d8[_0x4444('0x28')]=_0x190dbd;if(_0x277663[_0x4444('0x40')][_0x4444('0x49')]){_0x2f2ac7[_0x4444('0xa9')]=[{'all':!![]}];}return db[_0x4444('0x62')][_0x4444('0x3e')](_0x2f2ac7);})['then'](function(_0x49dd81){_0x2253d8[_0x4444('0xaa')]=_0x49dd81;return _0x2253d8;});}})[_0x4444('0x18')](respondWithFilteredResult(_0x1d8a7c,_0x2f2ac7))[_0x4444('0x21')](handleError(_0x1d8a7c,null));};exports[_0x4444('0xab')]=function(_0x41b939,_0x4634b8){var _0x395709={'where':{}},_0x1f008a={},_0x1e4630={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4444('0x50')]({'where':{'id':_0x41b939[_0x4444('0x4d')]['id']}})[_0x4444('0x18')](handleEntityNotFound(_0x4634b8,null))[_0x4444('0x18')](function(_0x524b1b){if(_0x524b1b){_0x1f008a[_0x4444('0x43')]=_[_0x4444('0x44')](db['ChatMessage']['rawAttributes']);_0x1f008a[_0x4444('0x40')]=_[_0x4444('0x44')](_0x41b939[_0x4444('0x40')]);_0x1f008a['filters']=_['intersection'](_0x1f008a[_0x4444('0x43')],_0x1f008a[_0x4444('0x40')]);_0x395709[_0x4444('0x47')]=_[_0x4444('0x46')](_0x1f008a[_0x4444('0x43')],qs[_0x4444('0x48')](_0x41b939['query'][_0x4444('0x48')]));_0x395709['attributes']=_0x395709[_0x4444('0x47')][_0x4444('0x84')]?_0x395709[_0x4444('0x47')]:_0x1f008a['model'];if(!_0x41b939[_0x4444('0x40')][_0x4444('0xa0')]('nolimit')){_0x395709[_0x4444('0x27')]=qs[_0x4444('0x27')](_0x41b939['query']['limit']);_0x395709[_0x4444('0x25')]=qs[_0x4444('0x25')](_0x41b939[_0x4444('0x40')]['offset']);}_0x395709[_0x4444('0xac')]=qs['sort'](_0x41b939[_0x4444('0x40')][_0x4444('0xa2')]);_0x395709[_0x4444('0xa3')]=qs[_0x4444('0x45')](_[_0x4444('0xa4')](_0x41b939[_0x4444('0x40')],_0x1f008a['filters']));_0x395709[_0x4444('0xa3')][_0x4444('0xa5')]=_0x524b1b['id'];if(_0x41b939[_0x4444('0x40')][_0x4444('0xad')]){_0x395709[_0x4444('0xa3')]=_[_0x4444('0x31')](_0x395709[_0x4444('0xa3')],{'$or':_['map'](_0x395709[_0x4444('0x47')],function(_0x5005e3){var _0xd9a80f={};_0xd9a80f[_0x5005e3]={'$like':'%'+_0x41b939[_0x4444('0x40')][_0x4444('0xad')]+'%'};return _0xd9a80f;})});}_0x395709[_0x4444('0xa3')]['secret']=![];if(_0x41b939[_0x4444('0x40')]['id']){_0x395709[_0x4444('0xa3')]['id']={'$gt':_0x41b939[_0x4444('0x40')]['id']};}_0x395709=_[_0x4444('0x31')]({},_0x395709,_0x41b939[_0x4444('0x4a')]);return db[_0x4444('0x62')]['count']({'where':_0x395709[_0x4444('0xa3')]})[_0x4444('0x18')](function(_0x1f9741){_0x1e4630[_0x4444('0x28')]=_0x1f9741;_0x395709[_0x4444('0xa9')]=[];if(_0x41b939['query'][_0x4444('0xae')]){_0x395709[_0x4444('0xa9')][_0x4444('0xaf')]({'model':db[_0x4444('0x82')],'as':'User','attributes':['id',_0x4444('0x8c'),'alias']});}if(_0x41b939[_0x4444('0x40')]['includeAll']){_0x395709[_0x4444('0xa9')]=[{'all':!![]}];}return db['ChatMessage'][_0x4444('0x3e')](_0x395709);})[_0x4444('0x18')](function(_0x2ae825){_0x1e4630['rows']=_0x2ae825;return _0x1e4630;});}})[_0x4444('0x18')](respondWithFilteredResult(_0x4634b8,_0x395709))[_0x4444('0x21')](handleError(_0x4634b8,null));};exports[_0x4444('0xb0')]=function(_0x41b4ae,_0x4fe10e){return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x41b4ae[_0x4444('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4fe10e,null))[_0x4444('0x18')](function(_0x400c95){if(_0x400c95){return _0x400c95[_0x4444('0xb1')](_0x41b4ae[_0x4444('0x32')][_0x4444('0x9e')],_[_0x4444('0x9f')](_0x41b4ae[_0x4444('0x32')],['ids','id'])||{})[_0x4444('0xb2')](function(){return db[_0x4444('0xb3')][_0x4444('0x3e')]({'attributes':['id',_0x4444('0x2e'),'color'],'where':{'id':_0x41b4ae['body'][_0x4444('0x9e')]}});})[_0x4444('0x18')](function(_0x351c8e){socket[_0x4444('0xb4')](_0x4444('0xb5'),{'id':Number(_0x41b4ae[_0x4444('0x4d')]['id']),'tags':_0x351c8e||[]});return{'id':Number(_0x41b4ae[_0x4444('0x4d')]['id']),'tags':_0x351c8e||[]};});}})[_0x4444('0x18')](respondWithResult(_0x4fe10e,null))[_0x4444('0x21')](handleError(_0x4fe10e,null));};exports[_0x4444('0xb6')]=function(_0x2704e2,_0x1f0815){return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x2704e2[_0x4444('0x4d')]['id']}})[_0x4444('0x18')](handleEntityNotFound(_0x1f0815,null))[_0x4444('0x18')](function(_0x254cdd){if(_0x254cdd){return _0x254cdd[_0x4444('0xb6')](_0x2704e2[_0x4444('0x40')][_0x4444('0x9e')]);}})[_0x4444('0x18')](respondWithStatusCode(_0x1f0815,null))[_0x4444('0x21')](handleError(_0x1f0815,null));};exports[_0x4444('0x7a')]=function(_0x265809,_0x7d6920){var _0x6fa054=moment()[_0x4444('0xb7')]()[_0x4444('0xb8')]();var _0x2f5683=path[_0x4444('0x77')](config['root'],_0x4444('0xb9'),_0x4444('0xba'),_0x4444('0xbb'));var _0x40acbe=path[_0x4444('0x77')](config[_0x4444('0x78')],_0x4444('0xb9'),_0x4444('0xba'),_0x4444('0xbc'));var _0x52b1d6=path[_0x4444('0x77')](_0x2f5683,_0x6fa054);var _0x1f34e3=util['format'](_0x4444('0xbd'),_0x265809[_0x4444('0x4d')]['id'],_0x6fa054);var _0x597728=path['join'](_0x2f5683,_0x1f34e3);var _0x3e1945=[];_0x3e1945[_0x4444('0xaf')]({'model':db['User'],'as':_0x4444('0x82'),'attributes':['id',_0x4444('0x8c')],'raw':!![]});_0x3e1945[_0x4444('0xaf')]({'model':db[_0x4444('0x66')],'as':_0x4444('0x67'),'attributes':['id',_0x4444('0xbe'),'lastName'],'raw':!![]});if(_0x265809[_0x4444('0x40')]['attachments']){_0x3e1945[_0x4444('0xaf')]({'model':db[_0x4444('0x74')],'as':'Attachment','raw':!![]});}var _0x4edcf7=[{'model':db[_0x4444('0x62')],'as':_0x4444('0x81'),'attributes':['id',_0x4444('0x32'),_0x4444('0x8f'),_0x4444('0xbf'),_0x4444('0x91'),_0x4444('0xc0')],'include':_0x3e1945}];_0x4edcf7[_0x4444('0xaf')]({'model':db[_0x4444('0x51')],'as':'Account','attributes':['id',_0x4444('0x2e')]});_0x4edcf7[_0x4444('0xaf')]({'model':db[_0x4444('0x82')],'as':'Owner','attributes':['id',_0x4444('0x8c')]});return db[_0x4444('0x39')][_0x4444('0x4c')]({'where':{'id':_0x265809[_0x4444('0x4d')]['id']},'include':_0x4edcf7})[_0x4444('0x18')](handleEntityNotFound(_0x7d6920,null))[_0x4444('0x18')](function(_0x10ae8d){if(_0x10ae8d){var _0x14fa0f=_0x10ae8d[_0x4444('0xc1')]({'plain':!![]});fs[_0x4444('0xc2')](_0x52b1d6);var _0x42c537={'channel':_0x4444('0xc3'),'account':_0x14fa0f[_0x4444('0xc4')][_0x4444('0x2e')],'agent':_0x14fa0f[_0x4444('0xc5')]?_0x14fa0f[_0x4444('0xc5')][_0x4444('0x8c')]:_0x4444('0xc6'),'createdAt':moment(_0x14fa0f[_0x4444('0x8f')])[_0x4444('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4444('0xb8')](),'closedAt':_0x14fa0f[_0x4444('0x6c')]?moment(_0x14fa0f[_0x4444('0xc7')])['format'](_0x4444('0xa8'))[_0x4444('0xb8')]():'','disposition':_0x14fa0f['disposition'],'chatInfo':{'browser':_0x14fa0f['browserName'],'os':_0x14fa0f['osName'],'referer':_0x14fa0f['referer'],'customerIp':_0x14fa0f[_0x4444('0xc8')],'customerPort':_0x14fa0f[_0x4444('0xc9')]?_0x14fa0f[_0x4444('0xc9')]:'N.A.'},'messages':_(_0x14fa0f[_0x4444('0x81')])[_0x4444('0xca')]()[_0x4444('0xad')]({'secret':![]})[_0x4444('0x38')](function(_0x3bd67c){if(_0x3bd67c[_0x4444('0x74')]){var _0x381762=path[_0x4444('0x77')](_0x40acbe,_0x3bd67c[_0x4444('0x74')]['basename']);if(fs['existsSync'](_0x381762)){fs[_0x4444('0xcb')](_0x381762)[_0x4444('0xcc')](fs[_0x4444('0xcd')](path[_0x4444('0x77')](_0x52b1d6,_0x3bd67c['Attachment']['basename'])));}}return{'date':moment(_0x3bd67c['createdAt'])[_0x4444('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3bd67c[_0x4444('0xbf')]==='out'?_0x3bd67c[_0x4444('0x82')]?_0x3bd67c[_0x4444('0x82')][_0x4444('0x8c')]:'System':_0x3bd67c['Contact'][_0x4444('0xbe')]+(_0x3bd67c[_0x4444('0x67')][_0x4444('0xce')]?'\x20'+_0x3bd67c[_0x4444('0x67')][_0x4444('0xce')]:''),'body':_0x3bd67c[_0x4444('0x74')]?_0x3bd67c[_0x4444('0x74')][_0x4444('0x71')]:_0x3bd67c['body'],'direction':_0x3bd67c[_0x4444('0xbf')]==='out'?'A':'C','secret':_0x3bd67c[_0x4444('0x91')],'read':_0x3bd67c[_0x4444('0xc0')],'attachment':_0x3bd67c[_0x4444('0x74')]};})[_0x4444('0xcf')]()};return ejs['renderFile'](path[_0x4444('0x77')](config[_0x4444('0x78')],'server',_0x4444('0xd0'),_0x4444('0xd1')),{'interaction':_0x42c537})[_0x4444('0x18')](function(_0xf0bf1b){var _0x31c910=path[_0x4444('0x77')](_0x52b1d6,_0x4444('0xd2')+_0x14fa0f['id']+'-'+_0x6fa054+_0x4444('0xd3'));var _0x3f5174={'path':_0x31c910,'channel':'Chat','interactionId':_0x14fa0f['id']};return pdf[_0x4444('0xd4')](_0xf0bf1b,_0x3f5174);})[_0x4444('0x18')](function(){return new Promise(function(_0x1df899,_0x502a9e){zipdir(_0x52b1d6,{'saveTo':_0x597728},function(_0x26392f,_0xe0a97f){if(_0x26392f)return _0x502a9e(_0x26392f);return _0x1df899(_0xe0a97f);});})[_0x4444('0x18')](function(){return new BPromise(function(_0x52f8bd,_0xda20f5){rimraf(_0x52b1d6,function(_0x49307f){if(_0x49307f)_0xda20f5(_0x49307f);return _0x52f8bd();});});})[_0x4444('0x18')](function(){return _0x7d6920[_0x4444('0x7a')](_0x597728,_0x1f34e3,function(_0x1ff675){if(_0x1ff675){logger['error'](_0x4444('0xd5'),_0x1ff675);}else{fs[_0x4444('0xd6')](_0x597728);}});});});}else{return _0x7d6920[_0x4444('0x2c')](0xc8);}})[_0x4444('0x21')](handleError(_0x7d6920,null));}; \ No newline at end of file +var _0xf62a=['rawAttributes','key','getOptions','findAll','chat','query','user','params','keys','intersection','attributes','model','fields','length','includeAll','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooNote','vidaooApiKey','fullname','email','vidaooTopic','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','nolimit','order','sort','filters','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','pick','includeAgent','include','push','alias','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','toString','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','Contact','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./chatInteraction.socket','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','merge','body','contact','account','index','map','ChatInteraction'];(function(_0x48f9d2,_0x33ba0d){var _0x5228da=function(_0x20e0cc){while(--_0x20e0cc){_0x48f9d2['push'](_0x48f9d2['shift']());}};_0x5228da(++_0x33ba0d);}(_0xf62a,0x162));var _0xaf62=function(_0x7e19de,_0x368cce){_0x7e19de=_0x7e19de-0x0;var _0x3b06be=_0xf62a[_0x7e19de];return _0x3b06be;};'use strict';var rimraf=require(_0xaf62('0x0'));var zipdir=require(_0xaf62('0x1'));var rp=require(_0xaf62('0x2'));var moment=require('moment');var BPromise=require(_0xaf62('0x3'));var Mustache=require(_0xaf62('0x4'));var util=require(_0xaf62('0x5'));var path=require(_0xaf62('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaf62('0x7'));var Redis=require(_0xaf62('0x8'));var interaction=require(_0xaf62('0x9'));var qs=require(_0xaf62('0xa'));var pdf=require(_0xaf62('0xb'));var logger=require(_0xaf62('0xc'))(_0xaf62('0xd'));var config=require('../../config/environment');var db=require(_0xaf62('0xe'))['db'];config[_0xaf62('0xf')]=_['defaults'](config['redis'],{'host':_0xaf62('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf62('0xf')]));require(_0xaf62('0x11'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf62('0x12')]['http']({'port':0x232b});var client9004=jayson[_0xaf62('0x12')][_0xaf62('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x244ac2,_0x1b2e36,_0x394f26,_0x4e26d3){return new BPromise(function(_0x7dc5dc,_0x337913){var _0x3b0d55=_0x4e26d3||client;return _0x3b0d55[_0xaf62('0x14')](_0x244ac2,_0x394f26)[_0xaf62('0x15')](function(_0x1894bc){logger['info'](_0xaf62('0x16'),_0x1b2e36,_0xaf62('0x17'));logger['debug'](_0xaf62('0x18'),_0x1b2e36,'request\x20sent',JSON[_0xaf62('0x19')](_0x1894bc));if(_0x1894bc[_0xaf62('0x1a')]){if(_0x1894bc['error']['code']===0x1f4){logger[_0xaf62('0x1a')](_0xaf62('0x16'),_0x1b2e36,_0x1894bc['error'][_0xaf62('0x1b')]);return _0x337913(_0x1894bc[_0xaf62('0x1a')][_0xaf62('0x1b')]);}logger['error'](_0xaf62('0x16'),_0x1b2e36,_0x1894bc[_0xaf62('0x1a')][_0xaf62('0x1b')]);return _0x7dc5dc(_0x1894bc[_0xaf62('0x1a')][_0xaf62('0x1b')]);}else{logger['info'](_0xaf62('0x16'),_0x1b2e36,_0xaf62('0x17'));_0x7dc5dc(_0x1894bc[_0xaf62('0x1c')][_0xaf62('0x1b')]);}})[_0xaf62('0x1d')](function(_0x2c2ff1){logger['error'](_0xaf62('0x16'),_0x1b2e36,_0x2c2ff1);_0x337913(_0x2c2ff1);});});}function respondWithStatusCode(_0x42805a,_0x54950b){_0x54950b=_0x54950b||0xcc;return function(_0x1ef225){if(_0x1ef225){return _0x42805a[_0xaf62('0x1e')](_0x54950b);}return _0x42805a[_0xaf62('0x1f')](_0x54950b)[_0xaf62('0x20')]();};}function respondWithResult(_0x3ec410,_0xbecc7a){_0xbecc7a=_0xbecc7a||0xc8;return function(_0x1e01f2){if(_0x1e01f2){return _0x3ec410[_0xaf62('0x1f')](_0xbecc7a)[_0xaf62('0x21')](_0x1e01f2);}};}function respondWithFilteredResult(_0x56e436,_0x3f2eec){return function(_0x2c84f7){if(_0x2c84f7){var _0x3bddb2=typeof _0x3f2eec[_0xaf62('0x22')]===_0xaf62('0x23')&&typeof _0x3f2eec[_0xaf62('0x24')]===_0xaf62('0x23');var _0x5eddc2=_0x2c84f7[_0xaf62('0x25')];var _0x594b2e=_0x3bddb2?0x0:_0x3f2eec[_0xaf62('0x22')];var _0x149d23=_0x3bddb2?_0x2c84f7[_0xaf62('0x25')]:_0x3f2eec[_0xaf62('0x22')]+_0x3f2eec[_0xaf62('0x24')];var _0x36a714;if(_0x149d23>=_0x5eddc2){_0x149d23=_0x5eddc2;_0x36a714=0xc8;}else{_0x36a714=0xce;}_0x56e436[_0xaf62('0x1f')](_0x36a714);return _0x56e436[_0xaf62('0x26')](_0xaf62('0x27'),_0x594b2e+'-'+_0x149d23+'/'+_0x5eddc2)['json'](_0x2c84f7);}return null;};}function saveUpdates(_0x3d70d9){return function(_0x54ff19){if(_0x54ff19){return _0x54ff19[_0xaf62('0x28')](_0x3d70d9)['then'](function(_0x1e25a9){return _0x1e25a9;});}return null;};}function removeEntity(_0x95cc90){return function(_0x3c207c){if(_0x3c207c){return _0x3c207c[_0xaf62('0x29')]()[_0xaf62('0x15')](function(){_0x95cc90[_0xaf62('0x1f')](0xcc)[_0xaf62('0x20')]();});}};}function handleEntityNotFound(_0xb0b248){return function(_0x2e7a9f){if(!_0x2e7a9f){_0xb0b248['sendStatus'](0x194);}return _0x2e7a9f;};}function handleError(_0x17c767,_0x4b00c){_0x4b00c=_0x4b00c||0x1f4;return function(_0x1808f2){logger[_0xaf62('0x1a')](_0x1808f2[_0xaf62('0x2a')]);if(_0x1808f2[_0xaf62('0x2b')]){delete _0x1808f2['name'];}_0x17c767[_0xaf62('0x1f')](_0x4b00c)[_0xaf62('0x2c')](_0x1808f2);};}function getMustacheRender(_0x4e7000,_0x9c22a){return Mustache['render'](_0x4e7000,_[_0xaf62('0x2d')](_0x9c22a[_0xaf62('0x2e')],{'contact':_0x9c22a[_0xaf62('0x2f')],'message':_0x9c22a[_0xaf62('0x1b')],'agent':_0x9c22a['agent'],'interaction':_0x9c22a['interaction'],'account':_0x9c22a[_0xaf62('0x30')]}))||'';}exports[_0xaf62('0x31')]=function(_0x2c331d,_0x49ed71){var _0x17137a={};var _0x464cb3=_[_0xaf62('0x32')](db[_0xaf62('0x33')][_0xaf62('0x34')],function(_0x47f733){return{'name':_0x47f733['fieldName'],'type':_0x47f733['type'][_0xaf62('0x35')]};});_0x17137a=qs[_0xaf62('0x36')](_0x464cb3,_0x2c331d);return interaction[_0xaf62('0x37')](_0xaf62('0x38'),_0x2c331d[_0xaf62('0x39')],_0x2c331d[_0xaf62('0x3a')],_0x17137a,_0x464cb3)[_0xaf62('0x15')](respondWithFilteredResult(_0x49ed71,_0x17137a))['catch'](handleError(_0x49ed71,null));};exports['show']=function(_0x40d7eb,_0x3f94ff){var _0x194c86={'raw':![],'where':{'id':_0x40d7eb[_0xaf62('0x3b')]['id']}},_0x131aae={};_0x131aae['model']=_['keys'](db[_0xaf62('0x33')][_0xaf62('0x34')]);_0x131aae['query']=_[_0xaf62('0x3c')](_0x40d7eb[_0xaf62('0x39')]);_0x131aae['filters']=_[_0xaf62('0x3d')](_0x131aae['model'],_0x131aae[_0xaf62('0x39')]);_0x194c86[_0xaf62('0x3e')]=_[_0xaf62('0x3d')](_0x131aae[_0xaf62('0x3f')],qs[_0xaf62('0x40')](_0x40d7eb[_0xaf62('0x39')][_0xaf62('0x40')]));_0x194c86[_0xaf62('0x3e')]=_0x194c86['attributes'][_0xaf62('0x41')]?_0x194c86[_0xaf62('0x3e')]:_0x131aae[_0xaf62('0x3f')];if(_0x40d7eb[_0xaf62('0x39')][_0xaf62('0x42')]){_0x194c86['include']=[{'all':!![]}];}_0x194c86=_[_0xaf62('0x2d')]({},_0x194c86,_0x40d7eb[_0xaf62('0x43')]);return db['ChatInteraction'][_0xaf62('0x44')](_0x194c86)[_0xaf62('0x15')](handleEntityNotFound(_0x3f94ff,null))['then'](respondWithResult(_0x3f94ff,null))[_0xaf62('0x1d')](handleError(_0x3f94ff,null));};exports[_0xaf62('0x45')]=function(_0x32966b,_0x3aff2f){return db[_0xaf62('0x33')]['create'](_0x32966b[_0xaf62('0x2e')],{})[_0xaf62('0x15')](respondWithResult(_0x3aff2f,0xc9))[_0xaf62('0x1d')](handleError(_0x3aff2f,null));};exports['update']=function(_0xb08bc5,_0x3be498){if(_0xb08bc5[_0xaf62('0x2e')]['id']){delete _0xb08bc5[_0xaf62('0x2e')]['id'];}return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0xb08bc5[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0x3be498,null))[_0xaf62('0x15')](saveUpdates(_0xb08bc5[_0xaf62('0x2e')],null))[_0xaf62('0x15')](respondWithResult(_0x3be498,null))[_0xaf62('0x1d')](handleError(_0x3be498,null));};exports[_0xaf62('0x29')]=function(_0x390c9d,_0x18b226){return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x390c9d[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0x18b226,null))[_0xaf62('0x15')](removeEntity(_0x18b226,null))[_0xaf62('0x1d')](handleError(_0x18b226,null));};exports[_0xaf62('0x46')]=function(_0x43c5e2,_0x603b12){return db[_0xaf62('0x33')][_0xaf62('0x46')]()['then'](respondWithResult(_0x603b12,null))[_0xaf62('0x1d')](handleError(_0x603b12,null));};exports[_0xaf62('0x47')]=function(_0x43459e,_0x3855b8){var _0x3778f7=_0x43459e[_0xaf62('0x3b')]['id'];var _0x2fccf5;var _0x584bb1;var _0x53adfb;return db['ChatInteraction'][_0xaf62('0x48')]({'where':{'id':_0x3778f7}})['then'](function(_0x4ada01){_0x2fccf5=_0x4ada01;return db[_0xaf62('0x49')]['findOne']({'where':{'id':_0x4ada01[_0xaf62('0x4a')]},'attributes':['id','vidaooApiKey',_0xaf62('0x4b'),'vidaooTopic',_0xaf62('0x4c'),'vidaooMetadata'],'raw':!![]});})[_0xaf62('0x15')](function(_0x135bfd){if(_0x135bfd&&_0x135bfd[_0xaf62('0x4d')]&&_0x135bfd[_0xaf62('0x4b')]){_0x584bb1=_0x135bfd;var _0x2d9b36={'interaction':{'id':_0x3778f7},'agent':{'id':_0x43459e[_0xaf62('0x3a')]['id'],'name':_0x43459e['user'][_0xaf62('0x2b')],'fullname':_0x43459e[_0xaf62('0x3a')][_0xaf62('0x4e')],'email':_0x43459e['user'][_0xaf62('0x4f')]},'contact':_0x43459e[_0xaf62('0x2e')][_0xaf62('0x2f')],'account':_0x43459e[_0xaf62('0x2e')][_0xaf62('0x30')]};var _0x5028b5={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x135bfd[_0xaf62('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x43459e[_0xaf62('0x3a')]['email']],'buttons':null,'topic':_0x584bb1[_0xaf62('0x50')],'note':_['isNull'](_0x584bb1['vidaooNote'])?null:getMustacheRender(_0x584bb1[_0xaf62('0x4c')],_0x2d9b36),'metadata':null},'redirect':_0xaf62('0x51'),'json':!![]};try{if(!_['isNull'](_0x584bb1[_0xaf62('0x52')])){var _0x1a8733=getMustacheRender(_0x584bb1['vidaooMetadata'],_0x2d9b36);var _0x301fac=JSON[_0xaf62('0x53')](_0x1a8733);_0x5028b5[_0xaf62('0x2e')][_0xaf62('0x54')]=_0x301fac;}}catch(_0xd4fbeb){throw new db[(_0xaf62('0x55'))][(_0xaf62('0x56'))](_0xaf62('0x57'));}return rp(_0x5028b5);}else{throw new db[(_0xaf62('0x55'))][(_0xaf62('0x56'))](_0xaf62('0x58'));}})[_0xaf62('0x15')](function(_0x3e8940){_0x53adfb=_0x3e8940;if(_0x53adfb['id']){var _0x245290={'body':_0x53adfb['join_url'],'ChatWebsiteId':_0x584bb1['id'],'ChatInteractionId':_0x2fccf5['id'],'direction':_0xaf62('0x59'),'UserId':_0x43459e['user']['id']};return db[_0xaf62('0x5a')]['create'](_0x245290,{});}else{throw new db[(_0xaf62('0x55'))][(_0xaf62('0x56'))](_0xaf62('0x5b'));}})['then'](function(){return _0x2fccf5[_0xaf62('0x5c')]({'vidaooSessionId':_0x53adfb['id']});})[_0xaf62('0x15')](respondWithResult(_0x3855b8,null))[_0xaf62('0x1d')](handleError(_0x3855b8,null));};exports[_0xaf62('0x5d')]=function(_0x553ab2,_0x366559){if(_0x553ab2[_0xaf62('0x2e')]['id']){delete _0x553ab2[_0xaf62('0x2e')]['id'];}return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x553ab2[_0xaf62('0x3b')]['id']},'include':[{'model':db[_0xaf62('0x5e')],'as':'Contact'}]})[_0xaf62('0x15')](handleEntityNotFound(_0x366559,null))[_0xaf62('0x15')](saveUpdates(_0x553ab2[_0xaf62('0x2e')],null))[_0xaf62('0x15')](respondWithResult(_0x366559,null))[_0xaf62('0x1d')](handleError(_0x366559,null));};exports[_0xaf62('0x5f')]=function(_0x4be503,_0x4c07e6){if(_0x4be503[_0xaf62('0x2e')]['id']){delete _0x4be503[_0xaf62('0x2e')]['id'];}return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x4be503[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](function(_0x246c8b){if(!_0x246c8b){logger['error'](_0xaf62('0x60'),_0xaf62('0x5f'),0x194,'entity\x20not\x20found');_0x4c07e6['sendStatus'](0x194);}else{if(_0x246c8b[_0xaf62('0x61')]){throw new db[(_0xaf62('0x55'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x246c8b;})[_0xaf62('0x15')](function(_0x4f27df){if(_0x4f27df){return _0x4f27df[_0xaf62('0x28')]({'closed':_0x4be503[_0xaf62('0x2e')][_0xaf62('0x62')],'disposition':_0x4be503['body'][_0xaf62('0x63')]})[_0xaf62('0x15')](function(_0x41b17f){return _0x41b17f;});}})[_0xaf62('0x15')](function(){return respondWithRpcPromise(_0xaf62('0x64'),_0xaf62('0x5f'),_0x4be503[_0xaf62('0x2e')],client9004);})[_0xaf62('0x15')](respondWithResult(_0x4c07e6,null))['catch'](handleError(_0x4c07e6,null));};exports['attachmentUpload']=function(_0x18105f,_0x3deedf){_0x18105f[_0xaf62('0x2e')][_0xaf62('0x2b')]=_0x18105f[_0xaf62('0x65')][_0xaf62('0x66')];_0x18105f[_0xaf62('0x2e')][_0xaf62('0x67')]=_0x18105f['file'][_0xaf62('0x68')];_0x18105f[_0xaf62('0x2e')][_0xaf62('0x69')]=_0x18105f[_0xaf62('0x65')][_0xaf62('0x6a')];return db[_0xaf62('0x6b')]['create'](_0x18105f[_0xaf62('0x2e')])[_0xaf62('0x15')](respondWithResult(_0x3deedf,0xc9))[_0xaf62('0x1d')](handleError(_0x3deedf,null));};exports[_0xaf62('0x6c')]=function(_0x187360,_0x14d0f3){return db[_0xaf62('0x33')]['findOne']({'where':{'id':_0x187360[_0xaf62('0x3b')]['id']},'raw':!![]})[_0xaf62('0x15')](handleEntityNotFound(_0x14d0f3,null))['then'](function(_0x4ca233){if(_0x4ca233){if(_0x4ca233['closed']){return _0x14d0f3[_0xaf62('0x1f')](0x193)[_0xaf62('0x21')]({'status':0x193,'message':_0xaf62('0x6d')});}return db[_0xaf62('0x6b')][_0xaf62('0x48')]({'where':{'id':_0x187360['query'][_0xaf62('0x6e')]},'raw':!![]})['then'](handleEntityNotFound(_0x14d0f3,null));}})[_0xaf62('0x15')](function(_0x146933){if(_0x146933){var _0x25c280=_0x146933[_0xaf62('0x6f')]!==null;var _0x1ddf07=path[_0xaf62('0x70')](config[_0xaf62('0x71')],'server/files/attachments/');if(_0x25c280){_0x1ddf07=path[_0xaf62('0x70')](_0x1ddf07,'offline-chat/');}var _0x39c5a1=path[_0xaf62('0x70')](_0x1ddf07,_0x146933[_0xaf62('0x67')]);return _0x14d0f3[_0xaf62('0x72')](_0x39c5a1);}})[_0xaf62('0x1d')](handleError(_0x14d0f3,null));};exports[_0xaf62('0x73')]=function(_0x5ca35e,_0x258ee5){var _0x30aa4e=null;var _0x41111f=null;var _0x46ce28=null;if(_0x5ca35e[_0xaf62('0x2e')]['id']){delete _0x5ca35e[_0xaf62('0x2e')]['id'];}if(_0x5ca35e[_0xaf62('0x2e')][_0xaf62('0x74')]){_0x46ce28=path['join'](config[_0xaf62('0x71')],_0xaf62('0x75'),util['format'](_0xaf62('0x76'),Date['now']()));_0x5ca35e[_0xaf62('0x2e')][_0xaf62('0x77')]=_0x46ce28;}return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x5ca35e[_0xaf62('0x3b')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xaf62('0x78'),'include':[{'model':db[_0xaf62('0x79')],'as':_0xaf62('0x79')}]}]})[_0xaf62('0x15')](handleEntityNotFound(_0x258ee5,null))[_0xaf62('0x15')](saveUpdates(_0x5ca35e[_0xaf62('0x2e')],null))[_0xaf62('0x15')](function(_0x4d85d3){if(_0x4d85d3){_0x30aa4e=_0x4d85d3;return db[_0xaf62('0x49')][_0xaf62('0x44')]({'where':{'id':_0x30aa4e[_0xaf62('0x4a')]}});}})[_0xaf62('0x15')](function(_0x2a8601){if(_0x2a8601){_0x41111f=_0x2a8601;return db[_0xaf62('0x5e')][_0xaf62('0x44')]({'where':{'id':_0x30aa4e[_0xaf62('0x7a')]}});}})[_0xaf62('0x15')](function(_0x1371fa){if(_0x1371fa){if(_0x46ce28){var _0x3cee56=null;for(var _0x568c06=0x1;_0x568c06<_0x30aa4e['Messages']['length'];++_0x568c06){_0x3cee56=_0x30aa4e[_0xaf62('0x78')][_0x568c06];var _0x2ee7f0=_0x3cee56[_0xaf62('0x61')]?util[_0xaf62('0x7b')]('%s%d',_0x41111f[_0xaf62('0x7c')],_0x3cee56['UserId']):_0xaf62('0x7d');var _0x68326f=_0x5ca35e[_0xaf62('0x2e')][_0xaf62('0x7e')]||util[_0xaf62('0x7b')](_0xaf62('0x7f'),_0xaf62('0x80'),_0x3cee56[_0xaf62('0x7a')]);switch(_0x41111f['agentIdentifier']){case'website_alias':_0x2ee7f0=_0x3cee56['UserId']?util['format'](_0xaf62('0x7f'),_0x41111f[_0xaf62('0x7c')],_0x3cee56[_0xaf62('0x61')]):_0xaf62('0x7d');break;case _0xaf62('0x81'):_0x2ee7f0=_0x3cee56[_0xaf62('0x61')]?_0x3cee56[_0xaf62('0x79')]['alias']||_0x3cee56[_0xaf62('0x79')][_0xaf62('0x4e')]:_0xaf62('0x7d');break;case _0xaf62('0x82'):_0x2ee7f0=_0x3cee56[_0xaf62('0x61')]?_0x3cee56[_0xaf62('0x79')][_0xaf62('0x4e')]:_0xaf62('0x7d');break;default:_0x2ee7f0=_0x3cee56['UserId']?util[_0xaf62('0x7b')]('%s%d',_0x41111f['agentAlias'],_0x3cee56['UserId']):_0xaf62('0x7d');}var _0x142083=util[_0xaf62('0x7b')](_0xaf62('0x83'),moment(_0x3cee56['createdAt'])[_0xaf62('0x7b')](_0xaf62('0x84')),_0x3cee56[_0xaf62('0x85')]==='in'?_0x68326f:_0x2ee7f0,_0x3cee56[_0xaf62('0x2e')]);if(!_0x3cee56[_0xaf62('0x86')]){fs['appendFileSync'](_0x46ce28,_0x142083);}}return db[_0xaf62('0x87')][_0xaf62('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xaf62('0x88')],'as':_0xaf62('0x89'),'raw':!![],'include':[{'model':db[_0xaf62('0x8a')],'as':_0xaf62('0x8a'),'raw':!![]}]}]});}}})['then'](function(_0x6f5fd7){if(!_0x6f5fd7||!_0x6f5fd7[_0xaf62('0x89')]||!_0x5ca35e[_0xaf62('0x2e')])return _0x30aa4e;var _0x3a76e8=_0x6f5fd7[_0xaf62('0x8b')]();return respondWithRpcPromise(_0xaf62('0x8c'),_0xaf62('0x8d'),{'account':_0x3a76e8,'message':{'from':util[_0xaf62('0x7b')](_0xaf62('0x8e'),_0x6f5fd7[_0xaf62('0x2b')],_0x6f5fd7[_0xaf62('0x4f')]||_0x6f5fd7['Smtp'][_0xaf62('0x3a')]),'to':_0x5ca35e[_0xaf62('0x2e')][_0xaf62('0x74')],'subject':'Mail\x20Transcript','text':util[_0xaf62('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5ca35e[_0xaf62('0x2e')][_0xaf62('0x74')]),'attachments':[{'path':_0x46ce28}]}})[_0xaf62('0x15')](function(){return _0x30aa4e;})['catch'](function(_0x5d1ab4){logger[_0xaf62('0x1a')](_0x5d1ab4);});})['then'](respondWithStatusCode(_0x258ee5,0xc8))['catch'](handleError(_0x258ee5,null));};exports[_0xaf62('0x8f')]=function(_0x21acab,_0x1c2648){return db['ChatMessage'][_0xaf62('0x44')]({'where':{'id':_0x21acab['params']['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0x1c2648,null))['then'](function(_0xcfb315){if(_0xcfb315){return _0xcfb315[_0xaf62('0x8f')](_0x21acab[_0xaf62('0x2e')][_0xaf62('0x90')],_[_0xaf62('0x91')](_0x21acab['body'],[_0xaf62('0x90'),'id'])||{});}})[_0xaf62('0x15')](respondWithResult(_0x1c2648,null))[_0xaf62('0x1d')](handleError(_0x1c2648,null));};exports['getMessages']=function(_0x14866a,_0x393bca){var _0x212c28={'raw':![],'where':{}};var _0x149392={};var _0x49572e={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x14866a[_0xaf62('0x3b')]['id']}})['then'](handleEntityNotFound(_0x393bca,null))[_0xaf62('0x15')](function(_0x5209fc){if(_0x5209fc){_0x149392[_0xaf62('0x3f')]=_['keys'](db[_0xaf62('0x5a')][_0xaf62('0x34')]);_0x149392[_0xaf62('0x39')]=_[_0xaf62('0x3c')](_0x14866a['query']);_0x149392['filters']=_[_0xaf62('0x3d')](_0x149392[_0xaf62('0x3f')],_0x149392[_0xaf62('0x39')]);_0x212c28[_0xaf62('0x3e')]=_[_0xaf62('0x3d')](_0x149392['model'],qs[_0xaf62('0x40')](_0x14866a[_0xaf62('0x39')][_0xaf62('0x40')]));_0x212c28[_0xaf62('0x3e')]=_0x212c28[_0xaf62('0x3e')][_0xaf62('0x41')]?_0x212c28[_0xaf62('0x3e')]:_0x149392[_0xaf62('0x3f')];if(!_0x14866a[_0xaf62('0x39')][_0xaf62('0x92')](_0xaf62('0x93'))){_0x212c28[_0xaf62('0x24')]=qs[_0xaf62('0x24')](_0x14866a['query'][_0xaf62('0x24')]);_0x212c28['offset']=qs[_0xaf62('0x22')](_0x14866a[_0xaf62('0x39')][_0xaf62('0x22')]);}_0x212c28[_0xaf62('0x94')]=qs['sort'](_0x14866a['query'][_0xaf62('0x95')]);_0x212c28['where']=qs['filters'](_['pick'](_0x14866a[_0xaf62('0x39')],_0x149392[_0xaf62('0x96')]));_0x212c28[_0xaf62('0x97')][_0xaf62('0x98')]=_0x5209fc['id'];if(_0x14866a[_0xaf62('0x39')][_0xaf62('0x99')]){_0x212c28['where']=_[_0xaf62('0x2d')](_0x212c28[_0xaf62('0x97')],{'$or':_[_0xaf62('0x32')](_0x212c28[_0xaf62('0x3e')],function(_0x1f0344){var _0x115557={};_0x115557[_0x1f0344]={'$like':'%'+_0x14866a[_0xaf62('0x39')]['filter']+'%'};return _0x115557;})});}if(_0x14866a['query'][_0xaf62('0x9a')]){var _0x567eee=_0x14866a[_0xaf62('0x39')][_0xaf62('0x9a')]['split'](',');var _0x5e7e8b={};_0x5e7e8b[_0x567eee[0x0]]={'$gte':moment(_0x567eee[0x1])['format'](_0xaf62('0x9b'))};_0x212c28[_0xaf62('0x97')]=_[_0xaf62('0x2d')](_0x212c28[_0xaf62('0x97')],_0x5e7e8b);}_0x212c28=_[_0xaf62('0x2d')]({},_0x212c28,_0x14866a[_0xaf62('0x43')]);return db['ChatMessage'][_0xaf62('0x25')]({'where':_0x212c28[_0xaf62('0x97')]})['then'](function(_0x2268f5){_0x49572e[_0xaf62('0x25')]=_0x2268f5;if(_0x14866a[_0xaf62('0x39')][_0xaf62('0x42')]){_0x212c28['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x212c28);})[_0xaf62('0x15')](function(_0x3eee5d){_0x49572e[_0xaf62('0x9c')]=_0x3eee5d;return _0x49572e;});}})[_0xaf62('0x15')](respondWithFilteredResult(_0x393bca,_0x212c28))['catch'](handleError(_0x393bca,null));};exports[_0xaf62('0x9d')]=function(_0x2b6189,_0xeb1818){var _0x231288={'where':{}},_0xa1b91e={},_0x1fc8f5={'count':0x0,'rows':[]};return db[_0xaf62('0x33')][_0xaf62('0x48')]({'where':{'id':_0x2b6189[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0xeb1818,null))['then'](function(_0x3eacf1){if(_0x3eacf1){_0xa1b91e[_0xaf62('0x3f')]=_[_0xaf62('0x3c')](db[_0xaf62('0x5a')][_0xaf62('0x34')]);_0xa1b91e['query']=_[_0xaf62('0x3c')](_0x2b6189[_0xaf62('0x39')]);_0xa1b91e[_0xaf62('0x96')]=_['intersection'](_0xa1b91e[_0xaf62('0x3f')],_0xa1b91e[_0xaf62('0x39')]);_0x231288['attributes']=_[_0xaf62('0x3d')](_0xa1b91e[_0xaf62('0x3f')],qs[_0xaf62('0x40')](_0x2b6189[_0xaf62('0x39')]['fields']));_0x231288[_0xaf62('0x3e')]=_0x231288[_0xaf62('0x3e')][_0xaf62('0x41')]?_0x231288[_0xaf62('0x3e')]:_0xa1b91e[_0xaf62('0x3f')];if(!_0x2b6189[_0xaf62('0x39')]['hasOwnProperty'](_0xaf62('0x93'))){_0x231288[_0xaf62('0x24')]=qs[_0xaf62('0x24')](_0x2b6189['query'][_0xaf62('0x24')]);_0x231288[_0xaf62('0x22')]=qs[_0xaf62('0x22')](_0x2b6189[_0xaf62('0x39')][_0xaf62('0x22')]);}_0x231288[_0xaf62('0x94')]=qs[_0xaf62('0x95')](_0x2b6189[_0xaf62('0x39')][_0xaf62('0x95')]);_0x231288[_0xaf62('0x97')]=qs[_0xaf62('0x96')](_[_0xaf62('0x9e')](_0x2b6189['query'],_0xa1b91e[_0xaf62('0x96')]));_0x231288['where'][_0xaf62('0x98')]=_0x3eacf1['id'];if(_0x2b6189[_0xaf62('0x39')][_0xaf62('0x99')]){_0x231288[_0xaf62('0x97')]=_[_0xaf62('0x2d')](_0x231288[_0xaf62('0x97')],{'$or':_['map'](_0x231288[_0xaf62('0x3e')],function(_0x484bd0){var _0x332b97={};_0x332b97[_0x484bd0]={'$like':'%'+_0x2b6189[_0xaf62('0x39')]['filter']+'%'};return _0x332b97;})});}_0x231288[_0xaf62('0x97')][_0xaf62('0x86')]=![];if(_0x2b6189['query']['id']){_0x231288['where']['id']={'$gt':_0x2b6189['query']['id']};}_0x231288=_[_0xaf62('0x2d')]({},_0x231288,_0x2b6189['options']);return db[_0xaf62('0x5a')][_0xaf62('0x25')]({'where':_0x231288[_0xaf62('0x97')]})['then'](function(_0x8aca40){_0x1fc8f5[_0xaf62('0x25')]=_0x8aca40;_0x231288['include']=[];if(_0x2b6189['query'][_0xaf62('0x9f')]){_0x231288[_0xaf62('0xa0')][_0xaf62('0xa1')]({'model':db[_0xaf62('0x79')],'as':_0xaf62('0x79'),'attributes':['id',_0xaf62('0x4e'),_0xaf62('0xa2')]});}if(_0x2b6189[_0xaf62('0x39')][_0xaf62('0x42')]){_0x231288[_0xaf62('0xa0')]=[{'all':!![]}];}return db[_0xaf62('0x5a')][_0xaf62('0x37')](_0x231288);})[_0xaf62('0x15')](function(_0x5f535e){_0x1fc8f5['rows']=_0x5f535e;return _0x1fc8f5;});}})['then'](respondWithFilteredResult(_0xeb1818,_0x231288))[_0xaf62('0x1d')](handleError(_0xeb1818,null));};exports[_0xaf62('0xa3')]=function(_0x48082a,_0x16fda6){return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x48082a[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0x16fda6,null))[_0xaf62('0x15')](function(_0x1bd8d5){if(_0x1bd8d5){return _0x1bd8d5['setTags'](_0x48082a[_0xaf62('0x2e')]['ids'],_[_0xaf62('0x91')](_0x48082a['body'],[_0xaf62('0x90'),'id'])||{})[_0xaf62('0xa4')](function(){return db[_0xaf62('0xa5')][_0xaf62('0x37')]({'attributes':['id',_0xaf62('0x2b'),'color'],'where':{'id':_0x48082a['body'][_0xaf62('0x90')]}});})[_0xaf62('0x15')](function(_0x13601c){socket[_0xaf62('0xa6')](_0xaf62('0xa7'),{'id':Number(_0x48082a['params']['id']),'tags':_0x13601c||[]});return{'id':Number(_0x48082a['params']['id']),'tags':_0x13601c||[]};});}})[_0xaf62('0x15')](respondWithResult(_0x16fda6,null))[_0xaf62('0x1d')](handleError(_0x16fda6,null));};exports[_0xaf62('0xa8')]=function(_0x423a7a,_0x428a14){return db[_0xaf62('0x33')]['find']({'where':{'id':_0x423a7a[_0xaf62('0x3b')]['id']}})[_0xaf62('0x15')](handleEntityNotFound(_0x428a14,null))[_0xaf62('0x15')](function(_0x289a93){if(_0x289a93){return _0x289a93[_0xaf62('0xa8')](_0x423a7a[_0xaf62('0x39')][_0xaf62('0x90')]);}})[_0xaf62('0x15')](respondWithStatusCode(_0x428a14,null))[_0xaf62('0x1d')](handleError(_0x428a14,null));};exports[_0xaf62('0x72')]=function(_0x5cf5e0,_0x58c5ef){var _0x5a3f68=moment()['unix']()[_0xaf62('0xa9')]();var _0x54d0f7=path[_0xaf62('0x70')](config[_0xaf62('0x71')],'server','files',_0xaf62('0xaa'));var _0x1350b2=path['join'](config['root'],'server',_0xaf62('0xab'),_0xaf62('0xac'));var _0x51a156=path['join'](_0x54d0f7,_0x5a3f68);var _0x1c1137=util['format'](_0xaf62('0xad'),_0x5cf5e0[_0xaf62('0x3b')]['id'],_0x5a3f68);var _0x1c1875=path[_0xaf62('0x70')](_0x54d0f7,_0x1c1137);var _0x367818=[];_0x367818['push']({'model':db[_0xaf62('0x79')],'as':_0xaf62('0x79'),'attributes':['id',_0xaf62('0x4e')],'raw':!![]});_0x367818[_0xaf62('0xa1')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xaf62('0xae'),_0xaf62('0xaf')],'raw':!![]});if(_0x5cf5e0['query'][_0xaf62('0xac')]){_0x367818['push']({'model':db[_0xaf62('0x6b')],'as':'Attachment','raw':!![]});}var _0x490f44=[{'model':db[_0xaf62('0x5a')],'as':_0xaf62('0x78'),'attributes':['id',_0xaf62('0x2e'),_0xaf62('0xb0'),'direction','secret',_0xaf62('0xb1')],'include':_0x367818}];_0x490f44['push']({'model':db[_0xaf62('0x49')],'as':_0xaf62('0xb2'),'attributes':['id',_0xaf62('0x2b')]});_0x490f44[_0xaf62('0xa1')]({'model':db[_0xaf62('0x79')],'as':_0xaf62('0xb3'),'attributes':['id',_0xaf62('0x4e')]});return db[_0xaf62('0x33')][_0xaf62('0x44')]({'where':{'id':_0x5cf5e0[_0xaf62('0x3b')]['id']},'include':_0x490f44})['then'](handleEntityNotFound(_0x58c5ef,null))[_0xaf62('0x15')](function(_0x2a6596){if(_0x2a6596){var _0x358b89=_0x2a6596[_0xaf62('0xb4')]({'plain':!![]});fs[_0xaf62('0xb5')](_0x51a156);var _0x5630b6={'channel':_0xaf62('0xb6'),'account':_0x358b89['Account']['name'],'agent':_0x358b89['Owner']?_0x358b89['Owner']['fullname']:'N.A.','createdAt':moment(_0x358b89['createdAt'])['format'](_0xaf62('0x9b'))[_0xaf62('0xa9')](),'closedAt':_0x358b89[_0xaf62('0x62')]?moment(_0x358b89[_0xaf62('0xb7')])[_0xaf62('0x7b')](_0xaf62('0x9b'))[_0xaf62('0xa9')]():'','disposition':_0x358b89[_0xaf62('0x63')],'chatInfo':{'browser':_0x358b89[_0xaf62('0xb8')],'os':_0x358b89['osName'],'referer':_0x358b89[_0xaf62('0xb9')],'customerIp':_0x358b89['customerIp'],'customerPort':_0x358b89['customerPort']?_0x358b89[_0xaf62('0xba')]:_0xaf62('0xbb')},'messages':_(_0x358b89[_0xaf62('0x78')])[_0xaf62('0xbc')]()['filter']({'secret':![]})[_0xaf62('0x32')](function(_0xcdf4ff){if(_0xcdf4ff[_0xaf62('0x6b')]){var _0x3d0adf=path[_0xaf62('0x70')](_0x1350b2,_0xcdf4ff[_0xaf62('0x6b')]['basename']);if(fs[_0xaf62('0xbd')](_0x3d0adf)){fs[_0xaf62('0xbe')](_0x3d0adf)[_0xaf62('0xbf')](fs['createWriteStream'](path[_0xaf62('0x70')](_0x51a156,_0xcdf4ff[_0xaf62('0x6b')][_0xaf62('0x67')])));}}return{'date':moment(_0xcdf4ff[_0xaf62('0xb0')])[_0xaf62('0x7b')](_0xaf62('0x9b'))[_0xaf62('0xa9')](),'sender':_0xcdf4ff['direction']===_0xaf62('0x59')?_0xcdf4ff[_0xaf62('0x79')]?_0xcdf4ff[_0xaf62('0x79')][_0xaf62('0x4e')]:_0xaf62('0x7d'):_0xcdf4ff[_0xaf62('0xc0')][_0xaf62('0xae')]+(_0xcdf4ff[_0xaf62('0xc0')][_0xaf62('0xaf')]?'\x20'+_0xcdf4ff[_0xaf62('0xc0')][_0xaf62('0xaf')]:''),'body':_0xcdf4ff[_0xaf62('0x6b')]?_0xcdf4ff[_0xaf62('0x6b')][_0xaf62('0x67')]:_0xcdf4ff[_0xaf62('0x2e')],'direction':_0xcdf4ff[_0xaf62('0x85')]===_0xaf62('0x59')?'A':'C','secret':_0xcdf4ff[_0xaf62('0x86')],'read':_0xcdf4ff['read'],'attachment':_0xcdf4ff[_0xaf62('0x6b')]};})[_0xaf62('0xc1')]()};return ejs[_0xaf62('0xc2')](path[_0xaf62('0x70')](config[_0xaf62('0x71')],_0xaf62('0xc3'),_0xaf62('0xc4'),_0xaf62('0xc5')),{'interaction':_0x5630b6})[_0xaf62('0x15')](function(_0x81885b){var _0x18634f=path[_0xaf62('0x70')](_0x51a156,_0xaf62('0xc6')+_0x358b89['id']+'-'+_0x5a3f68+_0xaf62('0xc7'));var _0x1fa3fd={'path':_0x18634f,'channel':_0xaf62('0xb6'),'interactionId':_0x358b89['id']};return pdf[_0xaf62('0xc8')](_0x81885b,_0x1fa3fd);})[_0xaf62('0x15')](function(){return new Promise(function(_0x479b15,_0x5a5750){zipdir(_0x51a156,{'saveTo':_0x1c1875},function(_0x5647ed,_0x3ef148){if(_0x5647ed)return _0x5a5750(_0x5647ed);return _0x479b15(_0x3ef148);});})['then'](function(){return new BPromise(function(_0x582b8e,_0x54e9a9){rimraf(_0x51a156,function(_0x1a2920){if(_0x1a2920)_0x54e9a9(_0x1a2920);return _0x582b8e();});});})[_0xaf62('0x15')](function(){return _0x58c5ef[_0xaf62('0x72')](_0x1c1875,_0x1c1137,function(_0x30ade9){if(_0x30ade9){logger[_0xaf62('0x1a')](_0xaf62('0xc9'),_0x30ade9);}else{fs[_0xaf62('0xca')](_0x1c1875);}});});});}else{return _0x58c5ef[_0xaf62('0x1e')](0xc8);}})[_0xaf62('0x1d')](handleError(_0x58c5ef,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 168acb2..c4f2d85 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 _0x6a3f=['ChatInteraction','ChatMessage','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','../../mysqldb'];(function(_0x1e5c91,_0x33771d){var _0x29c702=function(_0x5df712){while(--_0x5df712){_0x1e5c91['push'](_0x1e5c91['shift']());}};_0x29c702(++_0x33771d);}(_0x6a3f,0x6f));var _0xf6a3=function(_0x10a4da,_0x1e611c){_0x10a4da=_0x10a4da-0x0;var _0x1f7a4c=_0x6a3f[_0x10a4da];return _0x1f7a4c;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xf6a3('0x0'))['db'][_0xf6a3('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xf6a3('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6a3('0x3'),'afterDestroy':_0xf6a3('0x4')};function emitEvent(_0x561742){return function(_0x3d2470,_0x2baab2,_0x523567){_0x3d2470[_0xf6a3('0x5')]({'attributes':['id'],'raw':!![]})[_0xf6a3('0x6')](function(_0x1f758f){_0x3d2470[_0xf6a3('0x7')](_0xf6a3('0x8'),_0x1f758f['map'](function(_0x30ea9d){return{'id':_0x30ea9d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3d2470['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf6a3('0x6')](function(_0x151798){_0x3d2470[_0xf6a3('0x7')](_0xf6a3('0x9'),_0x151798[_0xf6a3('0xa')]);ChatInteractionEvents[_0xf6a3('0xb')](_0x561742+':'+_0x3d2470['id'],_0x3d2470);ChatInteractionEvents['emit'](_0x561742,_0x3d2470);_0x523567(null);})[_0xf6a3('0xc')](_0x523567(null));};}for(var e in events){if(events[_0xf6a3('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xb9f0=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','Users','findAll','setDataValue'];(function(_0x3b0ceb,_0x4dfb37){var _0x2446fc=function(_0x2a3ae3){while(--_0x2a3ae3){_0x3b0ceb['push'](_0x3b0ceb['shift']());}};_0x2446fc(++_0x4dfb37);}(_0xb9f0,0xd8));var _0x0b9f=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0xb9f0[_0x27eda0];return _0x2b63a5;};'use strict';var EventEmitter=require(_0x0b9f('0x0'));var ChatInteraction=require(_0x0b9f('0x1'))['db'][_0x0b9f('0x2')];var ChatMessage=require(_0x0b9f('0x1'))['db'][_0x0b9f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0b9f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b9f('0x5'),'afterDestroy':_0x0b9f('0x6')};function emitEvent(_0x9747e3){return function(_0x482c53,_0x543188,_0x551eb6){_0x482c53[_0x0b9f('0x7')]({'attributes':['id'],'raw':!![]})[_0x0b9f('0x8')](function(_0x20d8ac){_0x482c53['setDataValue'](_0x0b9f('0x9'),_0x20d8ac['map'](function(_0x2e209d){return{'id':_0x2e209d['id']};}));return ChatMessage[_0x0b9f('0xa')]({'where':{'ChatInteractionId':_0x482c53['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0b9f('0x8')](function(_0x44f728){_0x482c53[_0x0b9f('0xb')](_0x0b9f('0xc'),_0x44f728[_0x0b9f('0xd')]);ChatInteractionEvents[_0x0b9f('0xe')](_0x9747e3+':'+_0x482c53['id'],_0x482c53);ChatInteractionEvents[_0x0b9f('0xe')](_0x9747e3,_0x482c53);_0x551eb6(null);})[_0x0b9f('0xf')](_0x551eb6(null));};}for(var e in events){if(events[_0x0b9f('0x10')](e)){var event=events[e];ChatInteraction[_0x0b9f('0x11')](e,emitEvent(event));}}module[_0x0b9f('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 60327b2..4f3d08b 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 _0x409d=['request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x409d,0x1ec));var _0xd409=function(_0x5c5ddc,_0x2bd2a2){_0x5c5ddc=_0x5c5ddc-0x0;var _0xd3dbb3=_0x409d[_0x5c5ddc];return _0xd3dbb3;};'use strict';var _=require(_0xd409('0x0'));var util=require(_0xd409('0x1'));var logger=require(_0xd409('0x2'))('api');var moment=require(_0xd409('0x3'));var BPromise=require('bluebird');var rp=require(_0xd409('0x4'));var fs=require('fs');var path=require(_0xd409('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd409('0x6'));module[_0xd409('0x7')]=function(_0x133e1d,_0x38c732){return _0x133e1d[_0xd409('0x8')](_0xd409('0x9'),attributes,{'tableName':_0xd409('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x254787,_0x9f79,_0x34560f){if(_0x254787[_0xd409('0xb')]('closed')){_0x254787[_0xd409('0xc')]=moment()['format'](_0xd409('0xd'));}_0x34560f(null,_0x254787);}},'charset':_0xd409('0xe'),'collate':_0xd409('0xf')});}; \ No newline at end of file +var _0xcd0a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','changed','closed'];(function(_0xd02042,_0x571a85){var _0x4cc1fd=function(_0x391bb2){while(--_0x391bb2){_0xd02042['push'](_0xd02042['shift']());}};_0x4cc1fd(++_0x571a85);}(_0xcd0a,0x125));var _0xacd0=function(_0x59a566,_0x4ce596){_0x59a566=_0x59a566-0x0;var _0x3cc2df=_0xcd0a[_0x59a566];return _0x3cc2df;};'use strict';var _=require(_0xacd0('0x0'));var util=require(_0xacd0('0x1'));var logger=require(_0xacd0('0x2'))(_0xacd0('0x3'));var moment=require(_0xacd0('0x4'));var BPromise=require('bluebird');var rp=require(_0xacd0('0x5'));var fs=require('fs');var path=require(_0xacd0('0x6'));var rimraf=require(_0xacd0('0x7'));var config=require('../../config/environment');var attributes=require(_0xacd0('0x8'));module[_0xacd0('0x9')]=function(_0x126a6d,_0x30f2ff){return _0x126a6d[_0xacd0('0xa')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8883c7,_0x468120,_0x20664c){if(_0x8883c7[_0xacd0('0xb')](_0xacd0('0xc'))){_0x8883c7[_0xacd0('0xd')]=moment()[_0xacd0('0xe')](_0xacd0('0xf'));}_0x20664c(null,_0x8883c7);}},'charset':'utf8mb4','collate':_0xacd0('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 128ce41..d4db96a 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 _0x5438=['where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update','body','options','raw','UpdateChatInteraction','debug','catch','AddTagsToChatInteraction','find'];(function(_0x4142e4,_0x189d1e){var _0x30ee3e=function(_0x44eba9){while(--_0x44eba9){_0x4142e4['push'](_0x4142e4['shift']());}};_0x30ee3e(++_0x189d1e);}(_0x5438,0x10e));var _0x8543=function(_0x592f29,_0x2e0ba7){_0x592f29=_0x592f29-0x0;var _0x1e5d52=_0x5438[_0x592f29];return _0x1e5d52;};'use strict';var _=require(_0x8543('0x0'));var util=require(_0x8543('0x1'));var moment=require(_0x8543('0x2'));var BPromise=require(_0x8543('0x3'));var rs=require(_0x8543('0x4'));var fs=require('fs');var Redis=require(_0x8543('0x5'));var db=require(_0x8543('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8543('0x7'))(_0x8543('0x8'));var config=require(_0x8543('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8543('0xa')][_0x8543('0xb')]({'port':0x232a});config[_0x8543('0xc')]=_['defaults'](config['redis'],{'host':_0x8543('0xd'),'port':0x18eb});var socket=require(_0x8543('0xe'))(new Redis(config[_0x8543('0xc')]));require(_0x8543('0xf'))[_0x8543('0x10')](socket);function respondWithRpcPromise(_0x53d51,_0x40af79,_0x20b397){return new BPromise(function(_0x41049b,_0x316d4d){return client[_0x8543('0x11')](_0x53d51,_0x20b397)[_0x8543('0x12')](function(_0x5f4cb2){logger[_0x8543('0x13')](_0x8543('0x14'),_0x40af79,_0x8543('0x15'));logger['debug'](_0x8543('0x16'),_0x40af79,_0x8543('0x15'),JSON[_0x8543('0x17')](_0x5f4cb2));if(_0x5f4cb2[_0x8543('0x18')]){if(_0x5f4cb2['error'][_0x8543('0x19')]===0x1f4){logger['error'](_0x8543('0x14'),_0x40af79,_0x5f4cb2[_0x8543('0x18')][_0x8543('0x1a')]);return _0x316d4d(_0x5f4cb2[_0x8543('0x18')][_0x8543('0x1a')]);}logger[_0x8543('0x18')](_0x8543('0x14'),_0x40af79,_0x5f4cb2[_0x8543('0x18')][_0x8543('0x1a')]);return _0x41049b(_0x5f4cb2[_0x8543('0x18')][_0x8543('0x1a')]);}else{logger[_0x8543('0x13')](_0x8543('0x14'),_0x40af79,_0x8543('0x15'));_0x41049b(_0x5f4cb2[_0x8543('0x1b')]['message']);}})['catch'](function(_0x40154a){logger[_0x8543('0x18')](_0x8543('0x14'),_0x40af79,_0x40154a);_0x316d4d(_0x40154a);});});}exports['UpdateChatInteraction']=function(_0x4cf2cf){var _0x5e71a9=this;return new Promise(function(_0x43ef0a,_0xf3dcdd){return db[_0x8543('0x1c')][_0x8543('0x1d')](_0x4cf2cf[_0x8543('0x1e')],{'raw':_0x4cf2cf[_0x8543('0x1f')]?_0x4cf2cf[_0x8543('0x1f')][_0x8543('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf2cf[_0x8543('0x1f')]?_0x4cf2cf[_0x8543('0x1f')]['where']||null:null,'attributes':_0x4cf2cf[_0x8543('0x1f')]?_0x4cf2cf[_0x8543('0x1f')]['attributes']||null:null,'limit':_0x4cf2cf['options']?_0x4cf2cf['options']['limit']||null:null})[_0x8543('0x12')](function(_0x33d2b1){logger['info'](_0x8543('0x21'),_0x4cf2cf);logger[_0x8543('0x22')](_0x8543('0x21'),_0x4cf2cf,JSON[_0x8543('0x17')](_0x33d2b1));_0x43ef0a(_0x33d2b1);})[_0x8543('0x23')](function(_0xcf3a7b){logger['error']('UpdateChatInteraction',_0xcf3a7b[_0x8543('0x1a')],_0x4cf2cf);_0xf3dcdd(_0x5e71a9['error'](0x1f4,_0xcf3a7b['message']));});});};exports[_0x8543('0x24')]=function(_0x5dd749){return new Promise(function(_0x36ea49,_0x209ee9){return db[_0x8543('0x1c')][_0x8543('0x25')]({'where':_0x5dd749[_0x8543('0x1f')]?_0x5dd749[_0x8543('0x1f')][_0x8543('0x26')]||null:null})[_0x8543('0x12')](function(_0x2e9eb7){if(_0x2e9eb7){return _0x2e9eb7[_0x8543('0x27')](_0x5dd749['body'][_0x8543('0x28')],_[_0x8543('0x29')](_0x5dd749[_0x8543('0x1e')],[_0x8543('0x28'),'id'])||{});}})[_0x8543('0x2a')](function(_0x2e6e80){logger[_0x8543('0x13')]('AddTags',_0x5dd749);logger['debug'](_0x8543('0x2b'),_0x5dd749,JSON[_0x8543('0x17')](_0x2e6e80));_0x36ea49(_0x2e6e80);})[_0x8543('0x23')](function(_0x3151ba){logger[_0x8543('0x18')]('AddTags',_0x3151ba[_0x8543('0x1a')],_0x5dd749);_0x209ee9(_this[_0x8543('0x18')](0x1f4,_0x3151ba[_0x8543('0x1a')]));});});}; \ No newline at end of file +var _0x1f2d=['catch','UpdateChatInteraction','update','options','where','attributes','limit','ChatInteraction','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3e1d0d,_0x2337f7){var _0x56102a=function(_0x27c486){while(--_0x27c486){_0x3e1d0d['push'](_0x3e1d0d['shift']());}};_0x56102a(++_0x2337f7);}(_0x1f2d,0xfd));var _0xd1f2=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x1f2d[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0xd1f2('0x0'));var util=require('util');var moment=require(_0xd1f2('0x1'));var BPromise=require(_0xd1f2('0x2'));var rs=require(_0xd1f2('0x3'));var fs=require('fs');var Redis=require(_0xd1f2('0x4'));var db=require(_0xd1f2('0x5'))['db'];var utils=require(_0xd1f2('0x6'));var logger=require(_0xd1f2('0x7'))(_0xd1f2('0x8'));var config=require(_0xd1f2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd1f2('0xa')][_0xd1f2('0xb')]({'port':0x232a});config[_0xd1f2('0xc')]=_[_0xd1f2('0xd')](config['redis'],{'host':_0xd1f2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1f2('0xc')]));require(_0xd1f2('0xf'))[_0xd1f2('0x10')](socket);function respondWithRpcPromise(_0x26324a,_0x41b6f4,_0x5dec48){return new BPromise(function(_0x1775e4,_0x1bea3a){return client[_0xd1f2('0x11')](_0x26324a,_0x5dec48)['then'](function(_0x10217a){logger[_0xd1f2('0x12')](_0xd1f2('0x13'),_0x41b6f4,_0xd1f2('0x14'));logger[_0xd1f2('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x41b6f4,_0xd1f2('0x14'),JSON[_0xd1f2('0x16')](_0x10217a));if(_0x10217a[_0xd1f2('0x17')]){if(_0x10217a[_0xd1f2('0x17')][_0xd1f2('0x18')]===0x1f4){logger[_0xd1f2('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x41b6f4,_0x10217a[_0xd1f2('0x17')][_0xd1f2('0x19')]);return _0x1bea3a(_0x10217a[_0xd1f2('0x17')][_0xd1f2('0x19')]);}logger[_0xd1f2('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x41b6f4,_0x10217a['error'][_0xd1f2('0x19')]);return _0x1775e4(_0x10217a[_0xd1f2('0x17')][_0xd1f2('0x19')]);}else{logger[_0xd1f2('0x12')](_0xd1f2('0x13'),_0x41b6f4,'request\x20sent');_0x1775e4(_0x10217a[_0xd1f2('0x1a')][_0xd1f2('0x19')]);}})[_0xd1f2('0x1b')](function(_0x8dce37){logger[_0xd1f2('0x17')](_0xd1f2('0x13'),_0x41b6f4,_0x8dce37);_0x1bea3a(_0x8dce37);});});}exports[_0xd1f2('0x1c')]=function(_0x1cad2a){var _0x49afc5=this;return new Promise(function(_0x5f3b55,_0x5ebe0f){return db['ChatInteraction'][_0xd1f2('0x1d')](_0x1cad2a['body'],{'raw':_0x1cad2a[_0xd1f2('0x1e')]?_0x1cad2a[_0xd1f2('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cad2a[_0xd1f2('0x1e')]?_0x1cad2a[_0xd1f2('0x1e')][_0xd1f2('0x1f')]||null:null,'attributes':_0x1cad2a[_0xd1f2('0x1e')]?_0x1cad2a['options'][_0xd1f2('0x20')]||null:null,'limit':_0x1cad2a[_0xd1f2('0x1e')]?_0x1cad2a[_0xd1f2('0x1e')][_0xd1f2('0x21')]||null:null})['then'](function(_0xbe184c){logger['info'](_0xd1f2('0x1c'),_0x1cad2a);logger[_0xd1f2('0x15')](_0xd1f2('0x1c'),_0x1cad2a,JSON['stringify'](_0xbe184c));_0x5f3b55(_0xbe184c);})['catch'](function(_0x564162){logger[_0xd1f2('0x17')](_0xd1f2('0x1c'),_0x564162['message'],_0x1cad2a);_0x5ebe0f(_0x49afc5[_0xd1f2('0x17')](0x1f4,_0x564162['message']));});});};exports['AddTagsToChatInteraction']=function(_0x1216b4){return new Promise(function(_0x23d49b,_0x427239){return db[_0xd1f2('0x22')]['find']({'where':_0x1216b4[_0xd1f2('0x1e')]?_0x1216b4[_0xd1f2('0x1e')][_0xd1f2('0x1f')]||null:null})['then'](function(_0x5e2ebb){if(_0x5e2ebb){return _0x5e2ebb[_0xd1f2('0x23')](_0x1216b4[_0xd1f2('0x24')][_0xd1f2('0x25')],_['omit'](_0x1216b4[_0xd1f2('0x24')],['ids','id'])||{});}})[_0xd1f2('0x26')](function(_0x1006a9){logger[_0xd1f2('0x12')]('AddTags',_0x1216b4);logger['debug'](_0xd1f2('0x27'),_0x1216b4,JSON[_0xd1f2('0x16')](_0x1006a9));_0x23d49b(_0x1006a9);})[_0xd1f2('0x1b')](function(_0x2e8dd2){logger[_0xd1f2('0x17')]('AddTags',_0x2e8dd2[_0xd1f2('0x19')],_0x1216b4);_0x427239(_this[_0xd1f2('0x17')](0x1f4,_0x2e8dd2[_0xd1f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9ec5888..ff3c64d 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 _0x3de3=['removeListener','register','chatInteraction:','save','update','emit'];(function(_0x57494e,_0x2c4d3d){var _0x4099da=function(_0x38c521){while(--_0x38c521){_0x57494e['push'](_0x57494e['shift']());}};_0x4099da(++_0x2c4d3d);}(_0x3de3,0x135));var _0x33de=function(_0x1f2691,_0x2ce206){_0x1f2691=_0x1f2691-0x0;var _0x19128a=_0x3de3[_0x1f2691];return _0x19128a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x33de('0x0'),'remove',_0x33de('0x1')];function createListener(_0x821868,_0x366abe){return function(_0x3bc4c6){_0x366abe[_0x33de('0x2')](_0x821868,_0x3bc4c6);};}function removeListener(_0x1d6b78,_0x7d17ee){return function(){ChatInteractionEvents[_0x33de('0x3')](_0x1d6b78,_0x7d17ee);};}exports[_0x33de('0x4')]=function(_0x5afe5b){for(var _0x2a356a=0x0,_0x1523b0=events['length'];_0x2a356a<_0x1523b0;_0x2a356a++){var _0x9a4b40=events[_0x2a356a];var _0x189861=createListener(_0x33de('0x5')+_0x9a4b40,_0x5afe5b);ChatInteractionEvents['on'](_0x9a4b40,_0x189861);}}; \ No newline at end of file +var _0x4502=['chatInteraction:','./chatInteraction.events','remove','emit','removeListener','length'];(function(_0xd84c2a,_0x24602b){var _0x82ad7=function(_0x11b354){while(--_0x11b354){_0xd84c2a['push'](_0xd84c2a['shift']());}};_0x82ad7(++_0x24602b);}(_0x4502,0x157));var _0x2450=function(_0x364645,_0x301690){_0x364645=_0x364645-0x0;var _0x5d2cd4=_0x4502[_0x364645];return _0x5d2cd4;};'use strict';var ChatInteractionEvents=require(_0x2450('0x0'));var events=['save',_0x2450('0x1'),'update'];function createListener(_0x47ffa9,_0x2bcdc1){return function(_0x542b6d){_0x2bcdc1[_0x2450('0x2')](_0x47ffa9,_0x542b6d);};}function removeListener(_0x380824,_0x37fb9c){return function(){ChatInteractionEvents[_0x2450('0x3')](_0x380824,_0x37fb9c);};}exports['register']=function(_0x4fcf06){for(var _0x56dcc3=0x0,_0x227ebd=events[_0x2450('0x4')];_0x56dcc3<_0x227ebd;_0x56dcc3++){var _0x53d28b=events[_0x56dcc3];var _0x102e4a=createListener(_0x2450('0x5')+_0x53d28b,_0x4fcf06);ChatInteractionEvents['on'](_0x53d28b,_0x102e4a);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 7af3323..859095c 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 _0x1a0e=['update','put','/:id/custom_update','customUpdate','abandon','/:id/close','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','isAuthenticated','getMyMessages','/:id/download','download','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update'];(function(_0x47db2e,_0x41b2e3){var _0x467df3=function(_0x5b9e48){while(--_0x5b9e48){_0x47db2e['push'](_0x47db2e['shift']());}};_0x467df3(++_0x41b2e3);}(_0x1a0e,0x1f0));var _0xe1a0=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x1a0e[_0x5f1cf8];return _0x27d0fa;};'use strict';var multer=require(_0xe1a0('0x0'));var util=require(_0xe1a0('0x1'));var path=require(_0xe1a0('0x2'));var timeout=require('connect-timeout');var express=require(_0xe1a0('0x3'));var router=express[_0xe1a0('0x4')]();var fs_extra=require(_0xe1a0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe1a0('0x6'));var config=require(_0xe1a0('0x7'));var controller=require(_0xe1a0('0x8'));router[_0xe1a0('0x9')]('/',auth['isAuthenticated'](),controller[_0xe1a0('0xa')]);router['get'](_0xe1a0('0xb'),auth['isAuthenticated'](),controller[_0xe1a0('0xc')]);router['get'](_0xe1a0('0xd'),auth[_0xe1a0('0xe')](),controller[_0xe1a0('0xf')]);router[_0xe1a0('0x9')]('/:id/attachment_download',auth[_0xe1a0('0xe')](),controller[_0xe1a0('0x10')]);router[_0xe1a0('0x9')](_0xe1a0('0x11'),auth[_0xe1a0('0x12')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0xe1a0('0xe')](),controller[_0xe1a0('0x13')]);router[_0xe1a0('0x9')](_0xe1a0('0x14'),auth['isAuthenticated'](),controller[_0xe1a0('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe1a0('0x16')]);router['post'](_0xe1a0('0x17'),auth[_0xe1a0('0x12')](),controller[_0xe1a0('0x18')]);var upload=multer({'storage':multer[_0xe1a0('0x19')]({'destination':function(_0x27ca6c,_0x7e60a,_0x262065){_0x262065(null,path[_0xe1a0('0x1a')](config['root'],_0xe1a0('0x1b')));},'filename':function(_0x40d9c9,_0x2916b9,_0x57fdba){_0x57fdba(null,util['format'](_0xe1a0('0x1c'),Date[_0xe1a0('0x1d')](),_0x2916b9[_0xe1a0('0x1e')][_0xe1a0('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe1a0('0x20')](_0xe1a0('0x21'),upload[_0xe1a0('0x22')](_0xe1a0('0x23')),controller[_0xe1a0('0x24')]);router[_0xe1a0('0x20')]('/:id/messages',auth[_0xe1a0('0xe')](),controller[_0xe1a0('0x25')]);router[_0xe1a0('0x20')](_0xe1a0('0x26'),auth['isAuthenticated'](),interaction['tracked'](_0xe1a0('0x27'),_0xe1a0('0x28')),controller[_0xe1a0('0x29')]);router['put'](_0xe1a0('0xd'),auth[_0xe1a0('0x12')](),interaction[_0xe1a0('0x2a')](_0xe1a0('0x27'),_0xe1a0('0x2b')),controller[_0xe1a0('0x2c')]);router[_0xe1a0('0x2d')](_0xe1a0('0x2e'),controller[_0xe1a0('0x2f')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xe1a0('0x30')]);router[_0xe1a0('0x2d')](_0xe1a0('0x31'),controller['close']);router[_0xe1a0('0x32')](_0xe1a0('0xd'),auth['isAuthenticated'](),interaction[_0xe1a0('0x2a')](_0xe1a0('0x27'),'chatinteraction:destroy'),controller[_0xe1a0('0x33')]);router['delete'](_0xe1a0('0x26'),auth[_0xe1a0('0x12')](),controller[_0xe1a0('0x34')]);module[_0xe1a0('0x35')]=router; \ No newline at end of file +var _0x35c5=['addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x527733,_0x2c039e){var _0x47943b=function(_0x533ff4){while(--_0x533ff4){_0x527733['push'](_0x527733['shift']());}};_0x47943b(++_0x2c039e);}(_0x35c5,0x1b2));var _0x535c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x35c5[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x535c('0x0'));var util=require(_0x535c('0x1'));var path=require(_0x535c('0x2'));var timeout=require(_0x535c('0x3'));var express=require(_0x535c('0x4'));var router=express['Router']();var fs_extra=require(_0x535c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x535c('0x6'));var controller=require(_0x535c('0x7'));router[_0x535c('0x8')]('/',auth[_0x535c('0x9')](),controller[_0x535c('0xa')]);router[_0x535c('0x8')](_0x535c('0xb'),auth[_0x535c('0x9')](),controller[_0x535c('0xc')]);router[_0x535c('0x8')](_0x535c('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x535c('0xe')]);router[_0x535c('0x8')](_0x535c('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x535c('0x10'),auth['isAuthenticated'](),controller[_0x535c('0x11')]);router[_0x535c('0x8')](_0x535c('0x12'),auth[_0x535c('0x13')](),controller[_0x535c('0x14')]);router[_0x535c('0x8')](_0x535c('0x15'),auth[_0x535c('0x9')](),controller[_0x535c('0x16')]);router[_0x535c('0x17')]('/',auth['isAuthenticated'](),controller[_0x535c('0x18')]);router[_0x535c('0x17')](_0x535c('0x19'),auth[_0x535c('0x9')](),controller[_0x535c('0x1a')]);var upload=multer({'storage':multer[_0x535c('0x1b')]({'destination':function(_0x57254b,_0x2daf72,_0x2bbc3c){_0x2bbc3c(null,path[_0x535c('0x1c')](config[_0x535c('0x1d')],_0x535c('0x1e')));},'filename':function(_0x51d159,_0x5d32a6,_0x3870c1){_0x3870c1(null,util[_0x535c('0x1f')]('%s-%s',Date[_0x535c('0x20')](),_0x5d32a6[_0x535c('0x21')][_0x535c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x535c('0x17')](_0x535c('0x23'),upload[_0x535c('0x24')](_0x535c('0x25')),controller['attachmentUpload']);router[_0x535c('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x535c('0x26')]);router[_0x535c('0x17')](_0x535c('0x27'),auth[_0x535c('0x9')](),interaction[_0x535c('0x28')](_0x535c('0x29'),_0x535c('0x2a')),controller[_0x535c('0x2b')]);router[_0x535c('0x2c')]('/:id',auth[_0x535c('0x9')](),interaction[_0x535c('0x28')](_0x535c('0x29'),'chatinteraction:update'),controller['update']);router[_0x535c('0x2c')](_0x535c('0x2d'),controller[_0x535c('0x2e')]);router['put'](_0x535c('0x2f'),auth[_0x535c('0x13')](),controller[_0x535c('0x30')]);router[_0x535c('0x2c')]('/:id/close',controller['close']);router[_0x535c('0x31')](_0x535c('0xd'),auth[_0x535c('0x9')](),interaction['tracked'](_0x535c('0x29'),'chatinteraction:destroy'),controller[_0x535c('0x32')]);router['delete'](_0x535c('0x27'),auth[_0x535c('0x9')](),controller[_0x535c('0x33')]);module[_0x535c('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 825f7a9..21a6d6e 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 _0x67a7=['BOOLEAN','INTEGER','sequelize','TEXT','medium'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x67a7,0x8e));var _0x767a=function(_0x42506f,_0x6adadb){_0x42506f=_0x42506f-0x0;var _0x7a6b4b=_0x67a7[_0x42506f];return _0x7a6b4b;};'use strict';var Sequelize=require(_0x767a('0x0'));module['exports']={'body':{'type':Sequelize[_0x767a('0x1')](_0x767a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x767a('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x767a('0x4')]}}; \ No newline at end of file +var _0x59f0=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0x59f0,0x1e6));var _0x059f=function(_0x55bc0b,_0x52d197){_0x55bc0b=_0x55bc0b-0x0;var _0x55141d=_0x59f0[_0x55bc0b];return _0x55141d;};'use strict';var Sequelize=require(_0x059f('0x0'));module[_0x059f('0x1')]={'body':{'type':Sequelize[_0x059f('0x2')](_0x059f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x059f('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x059f('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 68ea588..5da5691 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 _0x4143=['resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','name','query','keys','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','create','body','find','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','isEmpty'];(function(_0x588901,_0x17249f){var _0x39c89c=function(_0x566dce){while(--_0x566dce){_0x588901['push'](_0x588901['shift']());}};_0x39c89c(++_0x17249f);}(_0x4143,0x79));var _0x3414=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x4143[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x3414('0x0'));var rimraf=require(_0x3414('0x1'));var zipdir=require(_0x3414('0x2'));var jsonpatch=require(_0x3414('0x3'));var rp=require(_0x3414('0x4'));var moment=require(_0x3414('0x5'));var BPromise=require(_0x3414('0x6'));var Mustache=require(_0x3414('0x7'));var util=require(_0x3414('0x8'));var path=require(_0x3414('0x9'));var sox=require(_0x3414('0xa'));var csv=require(_0x3414('0xb'));var ejs=require(_0x3414('0xc'));var fs=require('fs');var fs_extra=require(_0x3414('0xd'));var _=require(_0x3414('0xe'));var squel=require(_0x3414('0xf'));var crypto=require(_0x3414('0x10'));var jsforce=require(_0x3414('0x11'));var deskjs=require(_0x3414('0x12'));var toCsv=require('to-csv');var querystring=require(_0x3414('0x13'));var Papa=require(_0x3414('0x14'));var Redis=require('ioredis');var authService=require(_0x3414('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x3414('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3414('0x17'));var utils=require(_0x3414('0x18'));var config=require(_0x3414('0x19'));var licenseUtil=require(_0x3414('0x1a'));var db=require('../../mysqldb')['db'];config[_0x3414('0x1b')]=_[_0x3414('0x1c')](config[_0x3414('0x1b')],{'host':_0x3414('0x1d'),'port':0x18eb});var socket=require(_0x3414('0x1e'))(new Redis(config['redis']));require(_0x3414('0x1f'))[_0x3414('0x20')](socket);function respondWithStatusCode(_0x261bca,_0x2e36f6){_0x2e36f6=_0x2e36f6||0xcc;return function(_0x14274d){if(_0x14274d){return _0x261bca['sendStatus'](_0x2e36f6);}return _0x261bca[_0x3414('0x21')](_0x2e36f6)[_0x3414('0x22')]();};}function respondWithResult(_0x198cf4,_0x516eb1){_0x516eb1=_0x516eb1||0xc8;return function(_0x33503c){if(_0x33503c){return _0x198cf4['status'](_0x516eb1)['json'](_0x33503c);}};}function respondWithFilteredResult(_0x28f039,_0x415766){return function(_0xafc346){if(_0xafc346){var _0x402410=typeof _0x415766[_0x3414('0x23')]==='undefined'&&typeof _0x415766[_0x3414('0x24')]==='undefined';var _0x596aff=_0xafc346['count'];var _0xc35994=_0x402410?0x0:_0x415766['offset'];var _0x59c735=_0x402410?_0xafc346[_0x3414('0x25')]:_0x415766[_0x3414('0x23')]+_0x415766['limit'];var _0x6950f7;if(_0x59c735>=_0x596aff){_0x59c735=_0x596aff;_0x6950f7=0xc8;}else{_0x6950f7=0xce;}_0x28f039['status'](_0x6950f7);return _0x28f039[_0x3414('0x26')](_0x3414('0x27'),_0xc35994+'-'+_0x59c735+'/'+_0x596aff)['json'](_0xafc346);}return null;};}function patchUpdates(_0x4e2449){return function(_0x15a573){try{jsonpatch[_0x3414('0x28')](_0x15a573,_0x4e2449,!![]);}catch(_0x3aa6e4){return BPromise[_0x3414('0x29')](_0x3aa6e4);}return _0x15a573[_0x3414('0x2a')]();};}function saveUpdates(_0x1f33a6,_0x5714aa){return function(_0x43f186){if(_0x43f186){return _0x43f186[_0x3414('0x2b')](_0x1f33a6)[_0x3414('0x2c')](function(_0x4ebd8d){return _0x4ebd8d;});}return null;};}function removeEntity(_0x31d670,_0x2f386e){return function(_0x8f6f27){if(_0x8f6f27){return _0x8f6f27[_0x3414('0x2d')]()[_0x3414('0x2c')](function(){_0x31d670[_0x3414('0x21')](0xcc)[_0x3414('0x22')]();});}};}function handleEntityNotFound(_0x1e8bd8,_0x511c89){return function(_0x1329b2){if(!_0x1329b2){_0x1e8bd8[_0x3414('0x2e')](0x194);}return _0x1329b2;};}function handleError(_0x4eabac,_0x5b843c){_0x5b843c=_0x5b843c||0x1f4;return function(_0x26ca56){logger[_0x3414('0x2f')](_0x26ca56[_0x3414('0x30')]);if(_0x26ca56['name']){delete _0x26ca56['name'];}_0x4eabac[_0x3414('0x21')](_0x5b843c)['send'](_0x26ca56);};}exports[_0x3414('0x31')]=function(_0x1f3a93,_0x56f5e7){var _0x2a03ac={},_0x1c44e7={},_0x353c80={'count':0x0,'rows':[]};var _0x3b206f=_['map'](db[_0x3414('0x32')][_0x3414('0x33')],function(_0x3b58e8){return{'name':_0x3b58e8[_0x3414('0x34')],'type':_0x3b58e8[_0x3414('0x35')][_0x3414('0x36')]};});_0x1c44e7[_0x3414('0x37')]=_[_0x3414('0x38')](_0x3b206f,_0x3414('0x39'));_0x1c44e7[_0x3414('0x3a')]=_[_0x3414('0x3b')](_0x1f3a93[_0x3414('0x3a')]);_0x1c44e7['filters']=_['intersection'](_0x1c44e7[_0x3414('0x37')],_0x1c44e7['query']);_0x2a03ac['attributes']=_['intersection'](_0x1c44e7[_0x3414('0x37')],qs[_0x3414('0x3c')](_0x1f3a93[_0x3414('0x3a')][_0x3414('0x3c')]));_0x2a03ac['attributes']=_0x2a03ac[_0x3414('0x3d')][_0x3414('0x3e')]?_0x2a03ac[_0x3414('0x3d')]:_0x1c44e7['model'];if(!_0x1f3a93['query']['hasOwnProperty'](_0x3414('0x3f'))){_0x2a03ac[_0x3414('0x24')]=qs[_0x3414('0x24')](_0x1f3a93[_0x3414('0x3a')][_0x3414('0x24')]);_0x2a03ac[_0x3414('0x23')]=qs[_0x3414('0x23')](_0x1f3a93[_0x3414('0x3a')][_0x3414('0x23')]);}_0x2a03ac[_0x3414('0x40')]=qs[_0x3414('0x41')](_0x1f3a93[_0x3414('0x3a')][_0x3414('0x41')]);_0x2a03ac[_0x3414('0x42')]=qs['filters'](_[_0x3414('0x43')](_0x1f3a93[_0x3414('0x3a')],_0x1c44e7[_0x3414('0x44')]),_0x3b206f);if(_0x1f3a93[_0x3414('0x3a')][_0x3414('0x45')]){_0x2a03ac[_0x3414('0x42')]=_[_0x3414('0x46')](_0x2a03ac['where'],{'$or':_[_0x3414('0x38')](_0x3b206f,function(_0x342b7a){if(_0x342b7a[_0x3414('0x35')]!==_0x3414('0x47')){var _0x3737a3={};_0x3737a3[_0x342b7a['name']]={'$like':'%'+_0x1f3a93[_0x3414('0x3a')][_0x3414('0x45')]+'%'};return _0x3737a3;}})});}_0x2a03ac=_[_0x3414('0x46')]({},_0x2a03ac,_0x1f3a93[_0x3414('0x48')]);var _0x48f187={'where':_0x2a03ac[_0x3414('0x42')]};return db[_0x3414('0x32')][_0x3414('0x25')](_0x48f187)[_0x3414('0x2c')](function(_0x26d1eb){_0x353c80[_0x3414('0x25')]=_0x26d1eb;if(_0x1f3a93[_0x3414('0x3a')]['includeAll']){_0x2a03ac[_0x3414('0x49')]=[{'all':!![]}];}return db[_0x3414('0x32')][_0x3414('0x4a')](_0x2a03ac);})[_0x3414('0x2c')](function(_0x1dfa77){_0x353c80[_0x3414('0x4b')]=_0x1dfa77;return _0x353c80;})[_0x3414('0x2c')](respondWithFilteredResult(_0x56f5e7,_0x2a03ac))[_0x3414('0x4c')](handleError(_0x56f5e7,null));};exports[_0x3414('0x4d')]=function(_0x2bd539,_0x178bb3){var _0x58bb53={'raw':!![],'where':{'id':_0x2bd539[_0x3414('0x4e')]['id']}},_0x5349a1={};_0x5349a1[_0x3414('0x37')]=_[_0x3414('0x3b')](db[_0x3414('0x32')][_0x3414('0x33')]);_0x5349a1[_0x3414('0x3a')]=_[_0x3414('0x3b')](_0x2bd539['query']);_0x5349a1[_0x3414('0x44')]=_[_0x3414('0x4f')](_0x5349a1[_0x3414('0x37')],_0x5349a1[_0x3414('0x3a')]);_0x58bb53[_0x3414('0x3d')]=_[_0x3414('0x4f')](_0x5349a1[_0x3414('0x37')],qs['fields'](_0x2bd539['query']['fields']));_0x58bb53[_0x3414('0x3d')]=_0x58bb53[_0x3414('0x3d')][_0x3414('0x3e')]?_0x58bb53[_0x3414('0x3d')]:_0x5349a1['model'];if(_0x2bd539[_0x3414('0x3a')][_0x3414('0x50')]){_0x58bb53['include']=[{'all':!![]}];}_0x58bb53=_[_0x3414('0x46')]({},_0x58bb53,_0x2bd539[_0x3414('0x48')]);return db[_0x3414('0x32')]['find'](_0x58bb53)[_0x3414('0x2c')](handleEntityNotFound(_0x178bb3,null))[_0x3414('0x2c')](respondWithResult(_0x178bb3,null))[_0x3414('0x4c')](handleError(_0x178bb3,null));};exports[_0x3414('0x51')]=function(_0x388ba5,_0x382e63){return db[_0x3414('0x32')][_0x3414('0x51')](_0x388ba5[_0x3414('0x52')],{})[_0x3414('0x2c')](respondWithResult(_0x382e63,0xc9))['catch'](handleError(_0x382e63,null));};exports[_0x3414('0x2b')]=function(_0x21c5f7,_0x4452d4){if(_0x21c5f7['body']['id']){delete _0x21c5f7[_0x3414('0x52')]['id'];}return db[_0x3414('0x32')][_0x3414('0x53')]({'where':{'id':_0x21c5f7[_0x3414('0x4e')]['id']}})[_0x3414('0x2c')](handleEntityNotFound(_0x4452d4,null))[_0x3414('0x2c')](saveUpdates(_0x21c5f7[_0x3414('0x52')],null))[_0x3414('0x2c')](respondWithResult(_0x4452d4,null))['catch'](handleError(_0x4452d4,null));};exports[_0x3414('0x2d')]=function(_0x11053c,_0x343b64){return db['ChatInternalMessage'][_0x3414('0x53')]({'where':{'id':_0x11053c[_0x3414('0x4e')]['id']}})[_0x3414('0x2c')](handleEntityNotFound(_0x343b64,null))[_0x3414('0x2c')](removeEntity(_0x343b64,null))[_0x3414('0x4c')](handleError(_0x343b64,null));};exports[_0x3414('0x54')]=function(_0x2c1591,_0x4cc29d){return db['ChatInternalMessage'][_0x3414('0x54')]()[_0x3414('0x2c')](respondWithResult(_0x4cc29d,null))['catch'](handleError(_0x4cc29d,null));};function wrapUser(_0x522e57){return function(_0x5a6f0c){var _0x2a06c0=_0x522e57['get']({'plain':!![]});_0x2a06c0[_0x3414('0x55')]=[];if(_0x5a6f0c){_0x2a06c0[_0x3414('0x56')]=_0x5a6f0c[_0x3414('0x57')];_0x2a06c0[_0x3414('0x58')]=_0x5a6f0c;}else{_0x2a06c0[_0x3414('0x56')]=moment(0x0)[_0x3414('0x59')](_0x3414('0x5a'));_0x2a06c0[_0x3414('0x58')]={};}return _0x2a06c0;};}exports[_0x3414('0x5b')]=function(_0x3049f6,_0x5aa124,_0x2a8547){var _0x10aa56=[];return db['User'][_0x3414('0x4a')]({'where':{'role':['agent',_0x3414('0x5c'),_0x3414('0x5d')]},'attributes':['id',_0x3414('0x5e'),_0x3414('0x39'),_0x3414('0x5f'),_0x3414('0x60'),_0x3414('0x61'),_0x3414('0x62'),_0x3414('0x63'),_0x3414('0x64'),'showWebBar'],'order':qs[_0x3414('0x41')](_0x3414('0x65')),'include':[{'model':db[_0x3414('0x66')],'as':_0x3414('0x67'),'attributes':['id','name',_0x3414('0x35')],'through':{'attributes':[]}}]})['then'](function(_0xa5946b){if(_0xa5946b){var _0x48e984=_0x3049f6[_0x3414('0x5d')][_0x3414('0x68')]({'plain':!![]});if(!_0x48e984)throw new Error(_0x3414('0x69'));if(_0x48e984[_0x3414('0x5f')]===_0x3414('0x5d')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x48e984[_0x3414('0x6a')]},'raw':!![]})['then'](function(_0x306e2c){if(_0x306e2c){if(_0x306e2c[_0x3414('0x6b')]===0x0){return db['UserProfileResource'][_0x3414('0x4a')]({'where':{'sectionId':_0x306e2c['id']},'raw':!![]})[_0x3414('0x2c')](function(_0x4d6995){var _0x114735=[];if(_[_0x3414('0x6c')](_0x4d6995)){_0x114735=_[_0x3414('0x45')](_0xa5946b,function(_0x4c3514){if(_0x4c3514[_0x3414('0x5f')]!=='agent'){return _0x4c3514;}});return _0x114735;}else{for(var _0x8bcc48=0x0;_0x8bcc48<_0xa5946b[_0x3414('0x3e')];_0x8bcc48++){var _0x171598=_0xa5946b[_0x8bcc48];if(_0x171598['role']==='agent'){var _0x300fa4=_[_0x3414('0x53')](_0x4d6995,function(_0x4959e7){return _0x4959e7[_0x3414('0x6d')]===_0x171598['id'];});if(_0x300fa4)_0x114735[_0x3414('0x6e')](_0x171598);}else{_0x114735[_0x3414('0x6e')](_0x171598);}}return _0x114735;}});}else{return _0xa5946b;}}else{var _0xeebf4c=_['filter'](_0xa5946b,function(_0x262dfa){if(_0x262dfa[_0x3414('0x5f')]!=='agent'){return _0x262dfa;}});return _0xeebf4c;}});}else{return _0xa5946b;}}})['then'](function(_0x1914a9){var _0x1abfd5=[];if(_0x1914a9){_0x10aa56=_0x1914a9;for(var _0x11cb26=0x0;_0x11cb26<_0x1914a9[_0x3414('0x3e')];_0x11cb26+=0x1){_0x10aa56[_0x11cb26]['messages']=[];_0x1abfd5[_0x3414('0x6e')](db[_0x3414('0x32')][_0x3414('0x53')]({'where':{'FromId':[_0x3049f6['user']['id'],_0x1914a9[_0x11cb26]['id']],'ToId':[_0x3049f6[_0x3414('0x5d')]['id'],_0x1914a9[_0x11cb26]['id']],'ChatGroupId':null},'attributes':['id',_0x3414('0x57'),_0x3414('0x6f'),'ToId',_0x3414('0x70'),_0x3414('0x52')],'order':qs[_0x3414('0x41')](_0x3414('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3414('0x2c')](wrapUser(_0x1914a9[_0x11cb26])));}return BPromise[_0x3414('0x72')](_0x1abfd5);}return[];})[_0x3414('0x2c')](function(_0x127564){return{'rows':_0x127564,'count':_0x127564[_0x3414('0x3e')]};})[_0x3414('0x2c')](respondWithResult(_0x5aa124,null))[_0x3414('0x4c')](handleError(_0x5aa124,null));}; \ No newline at end of file +var _0xbd99=['format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','catch','intersection','includeAll','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt'];(function(_0x1f89ac,_0x1fbcb7){var _0x52520e=function(_0x1f10a2){while(--_0x1f10a2){_0x1f89ac['push'](_0x1f89ac['shift']());}};_0x52520e(++_0x1fbcb7);}(_0xbd99,0x1d3));var _0x9bd9=function(_0x340790,_0x1705b1){_0x340790=_0x340790-0x0;var _0x2ba8f0=_0xbd99[_0x340790];return _0x2ba8f0;};'use strict';var emlformat=require(_0x9bd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bd9('0x1'));var jsonpatch=require(_0x9bd9('0x2'));var rp=require(_0x9bd9('0x3'));var moment=require(_0x9bd9('0x4'));var BPromise=require(_0x9bd9('0x5'));var Mustache=require(_0x9bd9('0x6'));var util=require(_0x9bd9('0x7'));var path=require(_0x9bd9('0x8'));var sox=require(_0x9bd9('0x9'));var csv=require(_0x9bd9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bd9('0xb'));var _=require(_0x9bd9('0xc'));var squel=require('squel');var crypto=require(_0x9bd9('0xd'));var jsforce=require(_0x9bd9('0xe'));var deskjs=require(_0x9bd9('0xf'));var toCsv=require(_0x9bd9('0xa'));var querystring=require(_0x9bd9('0x10'));var Papa=require(_0x9bd9('0x11'));var Redis=require('ioredis');var authService=require(_0x9bd9('0x12'));var qs=require(_0x9bd9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bd9('0x14'))(_0x9bd9('0x15'));var utils=require(_0x9bd9('0x16'));var config=require(_0x9bd9('0x17'));var licenseUtil=require(_0x9bd9('0x18'));var db=require(_0x9bd9('0x19'))['db'];config[_0x9bd9('0x1a')]=_[_0x9bd9('0x1b')](config[_0x9bd9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9bd9('0x1a')]));require(_0x9bd9('0x1c'))['register'](socket);function respondWithStatusCode(_0x43fd3d,_0x50dd71){_0x50dd71=_0x50dd71||0xcc;return function(_0x2bfbd6){if(_0x2bfbd6){return _0x43fd3d[_0x9bd9('0x1d')](_0x50dd71);}return _0x43fd3d[_0x9bd9('0x1e')](_0x50dd71)[_0x9bd9('0x1f')]();};}function respondWithResult(_0x3765be,_0x2167e7){_0x2167e7=_0x2167e7||0xc8;return function(_0x3bee89){if(_0x3bee89){return _0x3765be[_0x9bd9('0x1e')](_0x2167e7)[_0x9bd9('0x20')](_0x3bee89);}};}function respondWithFilteredResult(_0x389fe3,_0x15ff94){return function(_0x255d31){if(_0x255d31){var _0x2c0624=typeof _0x15ff94[_0x9bd9('0x21')]===_0x9bd9('0x22')&&typeof _0x15ff94[_0x9bd9('0x23')]===_0x9bd9('0x22');var _0x1ae155=_0x255d31[_0x9bd9('0x24')];var _0x5148e7=_0x2c0624?0x0:_0x15ff94[_0x9bd9('0x21')];var _0x26a923=_0x2c0624?_0x255d31['count']:_0x15ff94[_0x9bd9('0x21')]+_0x15ff94[_0x9bd9('0x23')];var _0x586cb1;if(_0x26a923>=_0x1ae155){_0x26a923=_0x1ae155;_0x586cb1=0xc8;}else{_0x586cb1=0xce;}_0x389fe3[_0x9bd9('0x1e')](_0x586cb1);return _0x389fe3[_0x9bd9('0x25')](_0x9bd9('0x26'),_0x5148e7+'-'+_0x26a923+'/'+_0x1ae155)[_0x9bd9('0x20')](_0x255d31);}return null;};}function patchUpdates(_0x1b3005){return function(_0x2dd5e9){try{jsonpatch['apply'](_0x2dd5e9,_0x1b3005,!![]);}catch(_0x1f9836){return BPromise[_0x9bd9('0x27')](_0x1f9836);}return _0x2dd5e9[_0x9bd9('0x28')]();};}function saveUpdates(_0x309102,_0x5ba8e0){return function(_0x506798){if(_0x506798){return _0x506798[_0x9bd9('0x29')](_0x309102)[_0x9bd9('0x2a')](function(_0x2a9d04){return _0x2a9d04;});}return null;};}function removeEntity(_0x41285d,_0xac0091){return function(_0x552d00){if(_0x552d00){return _0x552d00[_0x9bd9('0x2b')]()['then'](function(){_0x41285d['status'](0xcc)[_0x9bd9('0x1f')]();});}};}function handleEntityNotFound(_0xde895f,_0x54736a){return function(_0x38e015){if(!_0x38e015){_0xde895f[_0x9bd9('0x1d')](0x194);}return _0x38e015;};}function handleError(_0x42689b,_0x4aba12){_0x4aba12=_0x4aba12||0x1f4;return function(_0x2c05f5){logger['error'](_0x2c05f5[_0x9bd9('0x2c')]);if(_0x2c05f5['name']){delete _0x2c05f5['name'];}_0x42689b[_0x9bd9('0x1e')](_0x4aba12)['send'](_0x2c05f5);};}exports[_0x9bd9('0x2d')]=function(_0x381d20,_0xf51a02){var _0x14c03e={},_0x44c5a2={},_0x52482e={'count':0x0,'rows':[]};var _0x14337d=_['map'](db['ChatInternalMessage'][_0x9bd9('0x2e')],function(_0xf6eee){return{'name':_0xf6eee[_0x9bd9('0x2f')],'type':_0xf6eee[_0x9bd9('0x30')]['key']};});_0x44c5a2[_0x9bd9('0x31')]=_[_0x9bd9('0x32')](_0x14337d,_0x9bd9('0x33'));_0x44c5a2[_0x9bd9('0x34')]=_[_0x9bd9('0x35')](_0x381d20[_0x9bd9('0x34')]);_0x44c5a2[_0x9bd9('0x36')]=_['intersection'](_0x44c5a2[_0x9bd9('0x31')],_0x44c5a2['query']);_0x14c03e[_0x9bd9('0x37')]=_['intersection'](_0x44c5a2['model'],qs[_0x9bd9('0x38')](_0x381d20['query']['fields']));_0x14c03e[_0x9bd9('0x37')]=_0x14c03e[_0x9bd9('0x37')][_0x9bd9('0x39')]?_0x14c03e[_0x9bd9('0x37')]:_0x44c5a2[_0x9bd9('0x31')];if(!_0x381d20[_0x9bd9('0x34')][_0x9bd9('0x3a')]('nolimit')){_0x14c03e[_0x9bd9('0x23')]=qs[_0x9bd9('0x23')](_0x381d20[_0x9bd9('0x34')][_0x9bd9('0x23')]);_0x14c03e[_0x9bd9('0x21')]=qs[_0x9bd9('0x21')](_0x381d20['query'][_0x9bd9('0x21')]);}_0x14c03e[_0x9bd9('0x3b')]=qs[_0x9bd9('0x3c')](_0x381d20[_0x9bd9('0x34')][_0x9bd9('0x3c')]);_0x14c03e['where']=qs['filters'](_[_0x9bd9('0x3d')](_0x381d20[_0x9bd9('0x34')],_0x44c5a2[_0x9bd9('0x36')]),_0x14337d);if(_0x381d20[_0x9bd9('0x34')][_0x9bd9('0x3e')]){_0x14c03e[_0x9bd9('0x3f')]=_[_0x9bd9('0x40')](_0x14c03e[_0x9bd9('0x3f')],{'$or':_['map'](_0x14337d,function(_0x57cd58){if(_0x57cd58[_0x9bd9('0x30')]!==_0x9bd9('0x41')){var _0x23bec9={};_0x23bec9[_0x57cd58['name']]={'$like':'%'+_0x381d20['query']['filter']+'%'};return _0x23bec9;}})});}_0x14c03e=_['merge']({},_0x14c03e,_0x381d20[_0x9bd9('0x42')]);var _0x343913={'where':_0x14c03e[_0x9bd9('0x3f')]};return db[_0x9bd9('0x43')]['count'](_0x343913)[_0x9bd9('0x2a')](function(_0x30c891){_0x52482e['count']=_0x30c891;if(_0x381d20[_0x9bd9('0x34')]['includeAll']){_0x14c03e[_0x9bd9('0x44')]=[{'all':!![]}];}return db[_0x9bd9('0x43')][_0x9bd9('0x45')](_0x14c03e);})[_0x9bd9('0x2a')](function(_0x348613){_0x52482e['rows']=_0x348613;return _0x52482e;})['then'](respondWithFilteredResult(_0xf51a02,_0x14c03e))[_0x9bd9('0x46')](handleError(_0xf51a02,null));};exports['show']=function(_0x207f9c,_0x18cd65){var _0x3b4a20={'raw':!![],'where':{'id':_0x207f9c['params']['id']}},_0x2f36b8={};_0x2f36b8['model']=_[_0x9bd9('0x35')](db[_0x9bd9('0x43')][_0x9bd9('0x2e')]);_0x2f36b8[_0x9bd9('0x34')]=_['keys'](_0x207f9c[_0x9bd9('0x34')]);_0x2f36b8[_0x9bd9('0x36')]=_['intersection'](_0x2f36b8[_0x9bd9('0x31')],_0x2f36b8['query']);_0x3b4a20[_0x9bd9('0x37')]=_[_0x9bd9('0x47')](_0x2f36b8[_0x9bd9('0x31')],qs['fields'](_0x207f9c['query']['fields']));_0x3b4a20[_0x9bd9('0x37')]=_0x3b4a20[_0x9bd9('0x37')][_0x9bd9('0x39')]?_0x3b4a20[_0x9bd9('0x37')]:_0x2f36b8[_0x9bd9('0x31')];if(_0x207f9c['query'][_0x9bd9('0x48')]){_0x3b4a20[_0x9bd9('0x44')]=[{'all':!![]}];}_0x3b4a20=_['merge']({},_0x3b4a20,_0x207f9c[_0x9bd9('0x42')]);return db[_0x9bd9('0x43')][_0x9bd9('0x49')](_0x3b4a20)[_0x9bd9('0x2a')](handleEntityNotFound(_0x18cd65,null))[_0x9bd9('0x2a')](respondWithResult(_0x18cd65,null))[_0x9bd9('0x46')](handleError(_0x18cd65,null));};exports[_0x9bd9('0x4a')]=function(_0x2e7fb1,_0x31a297){return db['ChatInternalMessage'][_0x9bd9('0x4a')](_0x2e7fb1[_0x9bd9('0x4b')],{})['then'](respondWithResult(_0x31a297,0xc9))[_0x9bd9('0x46')](handleError(_0x31a297,null));};exports[_0x9bd9('0x29')]=function(_0x312c4c,_0x53e77d){if(_0x312c4c[_0x9bd9('0x4b')]['id']){delete _0x312c4c[_0x9bd9('0x4b')]['id'];}return db[_0x9bd9('0x43')][_0x9bd9('0x49')]({'where':{'id':_0x312c4c[_0x9bd9('0x4c')]['id']}})[_0x9bd9('0x2a')](handleEntityNotFound(_0x53e77d,null))[_0x9bd9('0x2a')](saveUpdates(_0x312c4c[_0x9bd9('0x4b')],null))[_0x9bd9('0x2a')](respondWithResult(_0x53e77d,null))['catch'](handleError(_0x53e77d,null));};exports[_0x9bd9('0x2b')]=function(_0x52e2f1,_0x4aa134){return db[_0x9bd9('0x43')]['find']({'where':{'id':_0x52e2f1[_0x9bd9('0x4c')]['id']}})[_0x9bd9('0x2a')](handleEntityNotFound(_0x4aa134,null))[_0x9bd9('0x2a')](removeEntity(_0x4aa134,null))[_0x9bd9('0x46')](handleError(_0x4aa134,null));};exports[_0x9bd9('0x4d')]=function(_0x54195f,_0x4d9127){return db[_0x9bd9('0x43')]['describe']()[_0x9bd9('0x2a')](respondWithResult(_0x4d9127,null))['catch'](handleError(_0x4d9127,null));};function wrapUser(_0x1042de){return function(_0x43296a){var _0x11072e=_0x1042de[_0x9bd9('0x4e')]({'plain':!![]});_0x11072e[_0x9bd9('0x4f')]=[];if(_0x43296a){_0x11072e['lastMessageAt']=_0x43296a[_0x9bd9('0x50')];_0x11072e[_0x9bd9('0x51')]=_0x43296a;}else{_0x11072e[_0x9bd9('0x52')]=moment(0x0)[_0x9bd9('0x53')](_0x9bd9('0x54'));_0x11072e['lastMessage']={};}return _0x11072e;};}exports[_0x9bd9('0x55')]=function(_0x3fa871,_0x588650,_0x541142){var _0x296469=[];return db['User'][_0x9bd9('0x45')]({'where':{'role':[_0x9bd9('0x56'),_0x9bd9('0x57'),'user']},'attributes':['id',_0x9bd9('0x58'),'name',_0x9bd9('0x59'),_0x9bd9('0x5a'),_0x9bd9('0x5b'),_0x9bd9('0x5c'),_0x9bd9('0x5d'),_0x9bd9('0x5e'),_0x9bd9('0x5f')],'order':qs['sort'](_0x9bd9('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0x9bd9('0x61'),'attributes':['id',_0x9bd9('0x33'),_0x9bd9('0x30')],'through':{'attributes':[]}}]})[_0x9bd9('0x2a')](function(_0x568542){if(_0x568542){var _0x5c5f2f=_0x3fa871[_0x9bd9('0x62')]['get']({'plain':!![]});if(!_0x5c5f2f)throw new Error(_0x9bd9('0x63'));if(_0x5c5f2f[_0x9bd9('0x59')]===_0x9bd9('0x62')){return db['UserProfileSection'][_0x9bd9('0x49')]({'where':{'name':'Agents','userProfileId':_0x5c5f2f[_0x9bd9('0x64')]},'raw':!![]})[_0x9bd9('0x2a')](function(_0x140786){if(_0x140786){if(_0x140786[_0x9bd9('0x65')]===0x0){return db[_0x9bd9('0x66')][_0x9bd9('0x45')]({'where':{'sectionId':_0x140786['id']},'raw':!![]})[_0x9bd9('0x2a')](function(_0x307dd3){var _0x40f8b1=[];if(_[_0x9bd9('0x67')](_0x307dd3)){_0x40f8b1=_[_0x9bd9('0x3e')](_0x568542,function(_0x3ab58a){if(_0x3ab58a[_0x9bd9('0x59')]!==_0x9bd9('0x56')){return _0x3ab58a;}});return _0x40f8b1;}else{for(var _0x15853a=0x0;_0x15853a<_0x568542[_0x9bd9('0x39')];_0x15853a++){var _0x4fbb6e=_0x568542[_0x15853a];if(_0x4fbb6e['role']==='agent'){var _0x2e10ba=_['find'](_0x307dd3,function(_0x4abc95){return _0x4abc95[_0x9bd9('0x68')]===_0x4fbb6e['id'];});if(_0x2e10ba)_0x40f8b1[_0x9bd9('0x69')](_0x4fbb6e);}else{_0x40f8b1[_0x9bd9('0x69')](_0x4fbb6e);}}return _0x40f8b1;}});}else{return _0x568542;}}else{var _0x2422cd=_[_0x9bd9('0x3e')](_0x568542,function(_0xc8f24c){if(_0xc8f24c['role']!==_0x9bd9('0x56')){return _0xc8f24c;}});return _0x2422cd;}});}else{return _0x568542;}}})['then'](function(_0x4acb25){var _0xf3f46b=[];if(_0x4acb25){_0x296469=_0x4acb25;for(var _0x4583c1=0x0;_0x4583c1<_0x4acb25[_0x9bd9('0x39')];_0x4583c1+=0x1){_0x296469[_0x4583c1][_0x9bd9('0x4f')]=[];_0xf3f46b[_0x9bd9('0x69')](db[_0x9bd9('0x43')][_0x9bd9('0x49')]({'where':{'FromId':[_0x3fa871[_0x9bd9('0x62')]['id'],_0x4acb25[_0x4583c1]['id']],'ToId':[_0x3fa871['user']['id'],_0x4acb25[_0x4583c1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9bd9('0x6a'),'ToId',_0x9bd9('0x6b'),_0x9bd9('0x4b')],'order':qs['sort'](_0x9bd9('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9bd9('0x2a')](wrapUser(_0x4acb25[_0x4583c1])));}return BPromise[_0x9bd9('0x6d')](_0xf3f46b);}return[];})[_0x9bd9('0x2a')](function(_0x25f56d){return{'rows':_0x25f56d,'count':_0x25f56d[_0x9bd9('0x39')]};})[_0x9bd9('0x2a')](respondWithResult(_0x588650,null))[_0x9bd9('0x46')](handleError(_0x588650,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 31eb213..f7c49aa 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 _0x114d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x114d,0x144));var _0xd114=function(_0x5ea357,_0x5c463c){_0x5ea357=_0x5ea357-0x0;var _0x50f679=_0x114d[_0x5ea357];return _0x50f679;};'use strict';var EventEmitter=require(_0xd114('0x0'));var ChatInternalMessage=require(_0xd114('0x1'))['db'][_0xd114('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd114('0x3'),'afterUpdate':_0xd114('0x4'),'afterDestroy':_0xd114('0x5')};function emitEvent(_0x1bdf0e){return function(_0x4a93df,_0x543b66,_0x1fd49f){ChatInternalMessageEvents[_0xd114('0x6')](_0x1bdf0e+':'+_0x4a93df['id'],_0x4a93df);ChatInternalMessageEvents[_0xd114('0x6')](_0x1bdf0e,_0x4a93df);_0x1fd49f(null);};}for(var e in events){if(events[_0xd114('0x7')](e)){var event=events[e];ChatInternalMessage[_0xd114('0x8')](e,emitEvent(event));}}module[_0xd114('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6e78=['exports','events','ChatInternalMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5f4864,_0x48dd66){var _0xa73468=function(_0xcde800){while(--_0xcde800){_0x5f4864['push'](_0x5f4864['shift']());}};_0xa73468(++_0x48dd66);}(_0x6e78,0x169));var _0x86e7=function(_0x5d2791,_0x348d9a){_0x5d2791=_0x5d2791-0x0;var _0x3bb477=_0x6e78[_0x5d2791];return _0x3bb477;};'use strict';var EventEmitter=require(_0x86e7('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x86e7('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x86e7('0x2'),'afterUpdate':_0x86e7('0x3'),'afterDestroy':_0x86e7('0x4')};function emitEvent(_0x4fafc0){return function(_0x4383a3,_0x4d3299,_0x284090){ChatInternalMessageEvents[_0x86e7('0x5')](_0x4fafc0+':'+_0x4383a3['id'],_0x4383a3);ChatInternalMessageEvents[_0x86e7('0x5')](_0x4fafc0,_0x4383a3);_0x284090(null);};}for(var e in events){if(events[_0x86e7('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x86e7('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 0c2208c..91a0200 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 _0xb052=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x57aa1a,_0xd85bfd){var _0x4374c9=function(_0x429024){while(--_0x429024){_0x57aa1a['push'](_0x57aa1a['shift']());}};_0x4374c9(++_0xd85bfd);}(_0xb052,0x19b));var _0x2b05=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xb052[_0x3f2228];return _0x285ae4;};'use strict';var _=require(_0x2b05('0x0'));var util=require(_0x2b05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b05('0x2'));var BPromise=require(_0x2b05('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b05('0x4'));var rimraf=require(_0x2b05('0x5'));var config=require(_0x2b05('0x6'));var attributes=require(_0x2b05('0x7'));module[_0x2b05('0x8')]=function(_0x41c942,_0x2e9011){return _0x41c942[_0x2b05('0x9')](_0x2b05('0xa'),attributes,{'tableName':_0x2b05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b05('0xc'),'collate':_0x2b05('0xd')});}; \ No newline at end of file +var _0xbd3d=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xb2ab0e,_0x574a63){var _0x36ed77=function(_0x435adb){while(--_0x435adb){_0xb2ab0e['push'](_0xb2ab0e['shift']());}};_0x36ed77(++_0x574a63);}(_0xbd3d,0x1d4));var _0xdbd3=function(_0x134901,_0x70cfb5){_0x134901=_0x134901-0x0;var _0x57a65f=_0xbd3d[_0x134901];return _0x57a65f;};'use strict';var _=require(_0xdbd3('0x0'));var util=require('util');var logger=require(_0xdbd3('0x1'))('api');var moment=require(_0xdbd3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbd3('0x3'));var rimraf=require(_0xdbd3('0x4'));var config=require(_0xdbd3('0x5'));var attributes=require(_0xdbd3('0x6'));module[_0xdbd3('0x7')]=function(_0x35adb9,_0x2f5456){return _0x35adb9[_0xdbd3('0x8')](_0xdbd3('0x9'),attributes,{'tableName':_0xdbd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdbd3('0xb'),'collate':_0xdbd3('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a00e5e8..8bf2ded 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 _0x233b=['ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b00da,_0x160b65){var _0x296ada=function(_0x109340){while(--_0x109340){_0x4b00da['push'](_0x4b00da['shift']());}};_0x296ada(++_0x160b65);}(_0x233b,0xe3));var _0xb233=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x233b[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb233('0x2'));var fs=require('fs');var Redis=require(_0xb233('0x3'));var db=require(_0xb233('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb233('0x5'))(_0xb233('0x6'));var config=require(_0xb233('0x7'));var jayson=require(_0xb233('0x8'));var client=jayson[_0xb233('0x9')][_0xb233('0xa')]({'port':0x232a});config[_0xb233('0xb')]=_[_0xb233('0xc')](config[_0xb233('0xb')],{'host':_0xb233('0xd'),'port':0x18eb});var socket=require(_0xb233('0xe'))(new Redis(config[_0xb233('0xb')]));require('./chatInternalMessage.socket')[_0xb233('0xf')](socket);function respondWithRpcPromise(_0x7ca7fd,_0x5a1066,_0x2c66d7){return new BPromise(function(_0x345670,_0x4a8813){return client[_0xb233('0x10')](_0x7ca7fd,_0x2c66d7)[_0xb233('0x11')](function(_0x1d7bc6){logger[_0xb233('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a1066,_0xb233('0x13'));logger[_0xb233('0x14')](_0xb233('0x15'),_0x5a1066,_0xb233('0x13'),JSON[_0xb233('0x16')](_0x1d7bc6));if(_0x1d7bc6[_0xb233('0x17')]){if(_0x1d7bc6['error'][_0xb233('0x18')]===0x1f4){logger[_0xb233('0x17')](_0xb233('0x19'),_0x5a1066,_0x1d7bc6[_0xb233('0x17')]['message']);return _0x4a8813(_0x1d7bc6[_0xb233('0x17')][_0xb233('0x1a')]);}logger[_0xb233('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5a1066,_0x1d7bc6[_0xb233('0x17')]['message']);return _0x345670(_0x1d7bc6[_0xb233('0x17')][_0xb233('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5a1066,_0xb233('0x13'));_0x345670(_0x1d7bc6[_0xb233('0x1b')]['message']);}})['catch'](function(_0x58a74d){logger[_0xb233('0x17')](_0xb233('0x19'),_0x5a1066,_0x58a74d);_0x4a8813(_0x58a74d);});});} \ No newline at end of file +var _0x9264=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash'];(function(_0xdefd11,_0x54f0b5){var _0x354389=function(_0x295f2f){while(--_0x295f2f){_0xdefd11['push'](_0xdefd11['shift']());}};_0x354389(++_0x54f0b5);}(_0x9264,0xae));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var moment=require(_0x4926('0x2'));var BPromise=require(_0x4926('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4926('0x4'));var db=require(_0x4926('0x5'))['db'];var utils=require(_0x4926('0x6'));var logger=require(_0x4926('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4926('0x8'));var client=jayson['client'][_0x4926('0x9')]({'port':0x232a});config['redis']=_[_0x4926('0xa')](config[_0x4926('0xb')],{'host':_0x4926('0xc'),'port':0x18eb});var socket=require(_0x4926('0xd'))(new Redis(config[_0x4926('0xb')]));require('./chatInternalMessage.socket')[_0x4926('0xe')](socket);function respondWithRpcPromise(_0x25079f,_0x8e7092,_0x1d46ab){return new BPromise(function(_0xe8e37e,_0x415125){return client[_0x4926('0xf')](_0x25079f,_0x1d46ab)['then'](function(_0x211afa){logger[_0x4926('0x10')](_0x4926('0x11'),_0x8e7092,_0x4926('0x12'));logger['debug'](_0x4926('0x13'),_0x8e7092,_0x4926('0x12'),JSON['stringify'](_0x211afa));if(_0x211afa['error']){if(_0x211afa['error'][_0x4926('0x14')]===0x1f4){logger[_0x4926('0x15')](_0x4926('0x11'),_0x8e7092,_0x211afa[_0x4926('0x15')][_0x4926('0x16')]);return _0x415125(_0x211afa['error']['message']);}logger['error'](_0x4926('0x11'),_0x8e7092,_0x211afa['error'][_0x4926('0x16')]);return _0xe8e37e(_0x211afa[_0x4926('0x15')]['message']);}else{logger[_0x4926('0x10')](_0x4926('0x11'),_0x8e7092,_0x4926('0x12'));_0xe8e37e(_0x211afa[_0x4926('0x17')]['message']);}})[_0x4926('0x18')](function(_0x3fde52){logger[_0x4926('0x15')](_0x4926('0x11'),_0x8e7092,_0x3fde52);_0x415125(_0x3fde52);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 6a353a7..de96135 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 _0x7e7e=['save','remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x132e79,_0xdd654d){var _0x1cbae7=function(_0x118278){while(--_0x118278){_0x132e79['push'](_0x132e79['shift']());}};_0x1cbae7(++_0xdd654d);}(_0x7e7e,0xf7));var _0xe7e7=function(_0x50388d,_0x36a5e2){_0x50388d=_0x50388d-0x0;var _0x37c071=_0x7e7e[_0x50388d];return _0x37c071;};'use strict';var ChatInternalMessageEvents=require(_0xe7e7('0x0'));var events=[_0xe7e7('0x1'),_0xe7e7('0x2'),_0xe7e7('0x3')];function createListener(_0x4ba813,_0x41e3ad){return function(_0x171de9){_0x41e3ad[_0xe7e7('0x4')](_0x4ba813,_0x171de9);};}function removeListener(_0x1f0a88,_0x2ad372){return function(){ChatInternalMessageEvents['removeListener'](_0x1f0a88,_0x2ad372);};}exports[_0xe7e7('0x5')]=function(_0x32bd78){for(var _0x4a0f0d=0x0,_0x2f5fb7=events[_0xe7e7('0x6')];_0x4a0f0d<_0x2f5fb7;_0x4a0f0d++){var _0x5da753=events[_0x4a0f0d];var _0x502b13=createListener(_0xe7e7('0x7')+_0x5da753,_0x32bd78);ChatInternalMessageEvents['on'](_0x5da753,_0x502b13);}}; \ No newline at end of file +var _0x46ee=['./chatInternalMessage.events','save','emit','removeListener','chatInternalMessage:'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x46ee,0x13b));var _0xe46e=function(_0x41f919,_0xaaf9d2){_0x41f919=_0x41f919-0x0;var _0x35afc8=_0x46ee[_0x41f919];return _0x35afc8;};'use strict';var ChatInternalMessageEvents=require(_0xe46e('0x0'));var events=[_0xe46e('0x1'),'remove','update'];function createListener(_0x48732e,_0x33fbd0){return function(_0x181529){_0x33fbd0[_0xe46e('0x2')](_0x48732e,_0x181529);};}function removeListener(_0x344006,_0x49a30a){return function(){ChatInternalMessageEvents[_0xe46e('0x3')](_0x344006,_0x49a30a);};}exports['register']=function(_0x221516){for(var _0x4026bb=0x0,_0x3c919a=events['length'];_0x4026bb<_0x3c919a;_0x4026bb++){var _0x5ba3cf=events[_0x4026bb];var _0x209e31=createListener(_0xe46e('0x4')+_0x5ba3cf,_0x221516);ChatInternalMessageEvents['on'](_0x5ba3cf,_0x209e31);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index aaf23bb..03a144e 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 _0xa0d6=['destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id','show','post','update','delete'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa0d6,0x1f0));var _0x6a0d=function(_0x5b6452,_0xfa6874){_0x5b6452=_0x5b6452-0x0;var _0x166c77=_0xa0d6[_0x5b6452];return _0x166c77;};'use strict';var multer=require(_0x6a0d('0x0'));var util=require(_0x6a0d('0x1'));var path=require('path');var timeout=require(_0x6a0d('0x2'));var express=require(_0x6a0d('0x3'));var router=express[_0x6a0d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6a0d('0x5'));var controller=require(_0x6a0d('0x6'));router[_0x6a0d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6a0d('0x7')]('/describe',auth[_0x6a0d('0x8')](),controller[_0x6a0d('0x9')]);router[_0x6a0d('0x7')](_0x6a0d('0xa'),auth[_0x6a0d('0x8')](),controller[_0x6a0d('0xb')]);router[_0x6a0d('0x7')](_0x6a0d('0xc'),auth['isAuthenticated'](),controller[_0x6a0d('0xd')]);router[_0x6a0d('0xe')]('/',auth[_0x6a0d('0x8')](),controller['create']);router['put'](_0x6a0d('0xc'),controller[_0x6a0d('0xf')]);router[_0x6a0d('0x10')](_0x6a0d('0xc'),auth['isAuthenticated'](),controller[_0x6a0d('0x11')]);module[_0x6a0d('0x12')]=router; \ No newline at end of file +var _0x5e53=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/users','getUsers','/:id','show','post','create','update','destroy','exports','multer'];(function(_0x320c2b,_0x205222){var _0x169614=function(_0x16871e){while(--_0x16871e){_0x320c2b['push'](_0x320c2b['shift']());}};_0x169614(++_0x205222);}(_0x5e53,0x16f));var _0x35e5=function(_0x4ef17f,_0x10928a){_0x4ef17f=_0x4ef17f-0x0;var _0x3aa87f=_0x5e53[_0x4ef17f];return _0x3aa87f;};'use strict';var multer=require(_0x35e5('0x0'));var util=require(_0x35e5('0x1'));var path=require(_0x35e5('0x2'));var timeout=require(_0x35e5('0x3'));var express=require(_0x35e5('0x4'));var router=express[_0x35e5('0x5')]();var fs_extra=require(_0x35e5('0x6'));var auth=require(_0x35e5('0x7'));var interaction=require(_0x35e5('0x8'));var config=require(_0x35e5('0x9'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x35e5('0xa')](),controller['index']);router[_0x35e5('0xb')](_0x35e5('0xc'),auth[_0x35e5('0xa')](),controller[_0x35e5('0xd')]);router[_0x35e5('0xb')](_0x35e5('0xe'),auth[_0x35e5('0xa')](),controller[_0x35e5('0xf')]);router[_0x35e5('0xb')](_0x35e5('0x10'),auth[_0x35e5('0xa')](),controller[_0x35e5('0x11')]);router[_0x35e5('0x12')]('/',auth[_0x35e5('0xa')](),controller[_0x35e5('0x13')]);router['put']('/:id',controller[_0x35e5('0x14')]);router['delete']('/:id',auth[_0x35e5('0xa')](),controller[_0x35e5('0x15')]);module[_0x35e5('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 41aff15..99ed7bf 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x20e2c6,_0x3d5c99){var _0x379fdf=function(_0x488b0c){while(--_0x488b0c){_0x20e2c6['push'](_0x20e2c6['shift']());}};_0x379fdf(++_0x3d5c99);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}}; \ No newline at end of file +var _0xb7e2=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x95916a,_0x3707d7){var _0x2a0ac4=function(_0x4754c4){while(--_0x4754c4){_0x95916a['push'](_0x95916a['shift']());}};_0x2a0ac4(++_0x3707d7);}(_0xb7e2,0x103));var _0x2b7e=function(_0x5aa6b6,_0x14b25e){_0x5aa6b6=_0x5aa6b6-0x0;var _0x410ba4=_0xb7e2[_0x5aa6b6];return _0x410ba4;};'use strict';var Sequelize=require(_0x2b7e('0x0'));module['exports']={'body':{'type':Sequelize[_0x2b7e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2b7e('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b7e('0x3')]('in','out'),'defaultValue':_0x2b7e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2b7e('0x5')]},'providerName':{'type':Sequelize[_0x2b7e('0x6')]},'providerResponse':{'type':Sequelize[_0x2b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index eae0b78..d546f00 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 _0xa51c=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','ChatMessage','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','include','rows','show','includeAll','create','body','find','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','stringify','RejectMessage','rejectMessage','sequelize','fullname','internal','rejectmessage','parse','formData','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x39a79e,_0x21600d){var _0x569a10=function(_0x54472f){while(--_0x54472f){_0x39a79e['push'](_0x39a79e['shift']());}};_0x569a10(++_0x21600d);}(_0xa51c,0x193));var _0xca51=function(_0x43cca1,_0x3b7b29){_0x43cca1=_0x43cca1-0x0;var _0x31bcf5=_0xa51c[_0x43cca1];return _0x31bcf5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca51('0x0'));var zipdir=require(_0xca51('0x1'));var jsonpatch=require(_0xca51('0x2'));var rp=require(_0xca51('0x3'));var moment=require(_0xca51('0x4'));var BPromise=require(_0xca51('0x5'));var Mustache=require('mustache');var util=require(_0xca51('0x6'));var path=require(_0xca51('0x7'));var sox=require(_0xca51('0x8'));var csv=require(_0xca51('0x9'));var ejs=require(_0xca51('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca51('0xb'));var squel=require(_0xca51('0xc'));var crypto=require('crypto');var jsforce=require(_0xca51('0xd'));var deskjs=require(_0xca51('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca51('0xf'));var Redis=require('ioredis');var authService=require(_0xca51('0x10'));var qs=require(_0xca51('0x11'));var as=require(_0xca51('0x12'));var hardwareService=require(_0xca51('0x13'));var logger=require(_0xca51('0x14'))(_0xca51('0x15'));var utils=require(_0xca51('0x16'));var config=require(_0xca51('0x17'));var licenseUtil=require(_0xca51('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xca51('0x19')](config['redis'],{'host':_0xca51('0x1a'),'port':0x18eb});var socket=require(_0xca51('0x1b'))(new Redis(config[_0xca51('0x1c')]));require(_0xca51('0x1d'))[_0xca51('0x1e')](socket);var jayson=require(_0xca51('0x1f'));var client=jayson[_0xca51('0x20')][_0xca51('0x21')]({'port':0x232c});var client9002=jayson[_0xca51('0x20')][_0xca51('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5437de,_0x51d08d,_0x64f786,_0x3210cf){return new BPromise(function(_0x5d30a1,_0x16a6f0){var _0x43fb76=_0x3210cf||client;return _0x43fb76[_0xca51('0x22')](_0x5437de,_0x64f786)['then'](function(_0x25533f){logger[_0xca51('0x23')](_0xca51('0x24'),_0x51d08d,_0xca51('0x25'));logger['debug'](_0xca51('0x26'),_0x51d08d,'request\x20sent',JSON['stringify'](_0x25533f));if(_0x25533f[_0xca51('0x27')]){if(_0x25533f[_0xca51('0x27')][_0xca51('0x28')]===0x1f4){logger[_0xca51('0x27')](_0xca51('0x24'),_0x51d08d,_0x25533f[_0xca51('0x27')]['message']);return _0x16a6f0(_0x25533f[_0xca51('0x27')][_0xca51('0x29')]);}logger[_0xca51('0x27')](_0xca51('0x24'),_0x51d08d,_0x25533f[_0xca51('0x27')][_0xca51('0x29')]);return _0x5d30a1(_0x25533f[_0xca51('0x27')][_0xca51('0x29')]);}else{logger[_0xca51('0x23')](_0xca51('0x24'),_0x51d08d,'request\x20sent');_0x5d30a1(_0x25533f[_0xca51('0x2a')][_0xca51('0x29')]);}})[_0xca51('0x2b')](function(_0x9ed52c){logger['error'](_0xca51('0x24'),_0x51d08d,_0x9ed52c);_0x16a6f0(_0x9ed52c);});});}function respondWithStatusCode(_0x231462,_0x328e38){_0x328e38=_0x328e38||0xcc;return function(_0x116e53){if(_0x116e53){return _0x231462['sendStatus'](_0x328e38);}return _0x231462['status'](_0x328e38)['end']();};}function respondWithResult(_0x4bb262,_0x108cb5){_0x108cb5=_0x108cb5||0xc8;return function(_0x51183b){if(_0x51183b){return _0x4bb262[_0xca51('0x2c')](_0x108cb5)['json'](_0x51183b);}};}function respondWithFilteredResult(_0x2d1707,_0x4996ea){return function(_0x4c08f4){if(_0x4c08f4){var _0x1e0787=typeof _0x4996ea[_0xca51('0x2d')]==='undefined'&&typeof _0x4996ea[_0xca51('0x2e')]===_0xca51('0x2f');var _0x5bad9f=_0x4c08f4[_0xca51('0x30')];var _0x59f0d0=_0x1e0787?0x0:_0x4996ea[_0xca51('0x2d')];var _0x46a950=_0x1e0787?_0x4c08f4[_0xca51('0x30')]:_0x4996ea[_0xca51('0x2d')]+_0x4996ea[_0xca51('0x2e')];var _0x565dfb;if(_0x46a950>=_0x5bad9f){_0x46a950=_0x5bad9f;_0x565dfb=0xc8;}else{_0x565dfb=0xce;}_0x2d1707[_0xca51('0x2c')](_0x565dfb);return _0x2d1707[_0xca51('0x31')](_0xca51('0x32'),_0x59f0d0+'-'+_0x46a950+'/'+_0x5bad9f)[_0xca51('0x33')](_0x4c08f4);}return null;};}function patchUpdates(_0x6f6f52){return function(_0x1e7cfe){try{jsonpatch[_0xca51('0x34')](_0x1e7cfe,_0x6f6f52,!![]);}catch(_0x5381ad){return BPromise[_0xca51('0x35')](_0x5381ad);}return _0x1e7cfe[_0xca51('0x36')]();};}function saveUpdates(_0x4f1a51,_0x21db1f){return function(_0x591009){if(_0x591009){return _0x591009[_0xca51('0x37')](_0x4f1a51)[_0xca51('0x38')](function(_0x2f3380){return _0x2f3380;});}return null;};}function removeEntity(_0x290c03,_0xc6659e){return function(_0x470ce9){if(_0x470ce9){return _0x470ce9[_0xca51('0x39')]()[_0xca51('0x38')](function(){_0x290c03[_0xca51('0x2c')](0xcc)[_0xca51('0x3a')]();});}};}function handleEntityNotFound(_0x266001,_0x234f28){return function(_0x2b496d){if(!_0x2b496d){_0x266001[_0xca51('0x3b')](0x194);}return _0x2b496d;};}function handleError(_0x39bac4,_0x4f097c){_0x4f097c=_0x4f097c||0x1f4;return function(_0x3af643){logger[_0xca51('0x27')](_0x3af643[_0xca51('0x3c')]);if(_0x3af643[_0xca51('0x3d')]){delete _0x3af643[_0xca51('0x3d')];}_0x39bac4[_0xca51('0x2c')](_0x4f097c)['send'](_0x3af643);};}exports[_0xca51('0x3e')]=function(_0x23d5fe,_0x1a42c9){var _0x524c5a={},_0x25df41={},_0x565b4d={'count':0x0,'rows':[]};var _0x372fe7=_[_0xca51('0x3f')](db[_0xca51('0x40')][_0xca51('0x41')],function(_0x5f2396){return{'name':_0x5f2396['fieldName'],'type':_0x5f2396[_0xca51('0x42')]['key']};});_0x25df41[_0xca51('0x43')]=_[_0xca51('0x3f')](_0x372fe7,_0xca51('0x3d'));_0x25df41[_0xca51('0x44')]=_[_0xca51('0x45')](_0x23d5fe[_0xca51('0x44')]);_0x25df41['filters']=_[_0xca51('0x46')](_0x25df41[_0xca51('0x43')],_0x25df41[_0xca51('0x44')]);_0x524c5a[_0xca51('0x47')]=_[_0xca51('0x46')](_0x25df41[_0xca51('0x43')],qs[_0xca51('0x48')](_0x23d5fe[_0xca51('0x44')][_0xca51('0x48')]));_0x524c5a['attributes']=_0x524c5a['attributes'][_0xca51('0x49')]?_0x524c5a['attributes']:_0x25df41['model'];if(!_0x23d5fe[_0xca51('0x44')][_0xca51('0x4a')]('nolimit')){_0x524c5a[_0xca51('0x2e')]=qs[_0xca51('0x2e')](_0x23d5fe[_0xca51('0x44')][_0xca51('0x2e')]);_0x524c5a[_0xca51('0x2d')]=qs[_0xca51('0x2d')](_0x23d5fe['query'][_0xca51('0x2d')]);}_0x524c5a[_0xca51('0x4b')]=qs[_0xca51('0x4c')](_0x23d5fe[_0xca51('0x44')]['sort']);_0x524c5a[_0xca51('0x4d')]=qs[_0xca51('0x4e')](_[_0xca51('0x4f')](_0x23d5fe[_0xca51('0x44')],_0x25df41[_0xca51('0x4e')]),_0x372fe7);if(_0x23d5fe[_0xca51('0x44')]['filter']){_0x524c5a[_0xca51('0x4d')]=_[_0xca51('0x50')](_0x524c5a[_0xca51('0x4d')],{'$or':_[_0xca51('0x3f')](_0x372fe7,function(_0x3a1607){if(_0x3a1607[_0xca51('0x42')]!==_0xca51('0x51')){var _0x332042={};_0x332042[_0x3a1607[_0xca51('0x3d')]]={'$like':'%'+_0x23d5fe[_0xca51('0x44')]['filter']+'%'};return _0x332042;}})});}_0x524c5a=_[_0xca51('0x50')]({},_0x524c5a,_0x23d5fe[_0xca51('0x52')]);var _0x383415={'where':_0x524c5a['where']};return db[_0xca51('0x40')]['count'](_0x383415)[_0xca51('0x38')](function(_0x4e3f77){_0x565b4d[_0xca51('0x30')]=_0x4e3f77;if(_0x23d5fe[_0xca51('0x44')]['includeAll']){_0x524c5a[_0xca51('0x53')]=[{'all':!![]}];}return db[_0xca51('0x40')]['findAll'](_0x524c5a);})['then'](function(_0x5a0ace){_0x565b4d[_0xca51('0x54')]=_0x5a0ace;return _0x565b4d;})[_0xca51('0x38')](respondWithFilteredResult(_0x1a42c9,_0x524c5a))[_0xca51('0x2b')](handleError(_0x1a42c9,null));};exports[_0xca51('0x55')]=function(_0x424df5,_0x1b044d){var _0x468192={'raw':!![],'where':{'id':_0x424df5['params']['id']}},_0x4c06e8={};_0x4c06e8[_0xca51('0x43')]=_[_0xca51('0x45')](db[_0xca51('0x40')][_0xca51('0x41')]);_0x4c06e8[_0xca51('0x44')]=_[_0xca51('0x45')](_0x424df5[_0xca51('0x44')]);_0x4c06e8[_0xca51('0x4e')]=_[_0xca51('0x46')](_0x4c06e8['model'],_0x4c06e8[_0xca51('0x44')]);_0x468192['attributes']=_[_0xca51('0x46')](_0x4c06e8['model'],qs[_0xca51('0x48')](_0x424df5['query'][_0xca51('0x48')]));_0x468192[_0xca51('0x47')]=_0x468192[_0xca51('0x47')][_0xca51('0x49')]?_0x468192[_0xca51('0x47')]:_0x4c06e8[_0xca51('0x43')];if(_0x424df5[_0xca51('0x44')][_0xca51('0x56')]){_0x468192[_0xca51('0x53')]=[{'all':!![]}];}_0x468192=_[_0xca51('0x50')]({},_0x468192,_0x424df5['options']);return db[_0xca51('0x40')]['find'](_0x468192)[_0xca51('0x38')](handleEntityNotFound(_0x1b044d,null))[_0xca51('0x38')](respondWithResult(_0x1b044d,null))[_0xca51('0x2b')](handleError(_0x1b044d,null));};exports[_0xca51('0x57')]=function(_0x449bfa,_0x1770fe){return db[_0xca51('0x40')][_0xca51('0x57')](_0x449bfa[_0xca51('0x58')],{})[_0xca51('0x38')](respondWithResult(_0x1770fe,0xc9))['catch'](handleError(_0x1770fe,null));};exports['update']=function(_0x4cb9cc,_0x3ef7e0){if(_0x4cb9cc[_0xca51('0x58')]['id']){delete _0x4cb9cc[_0xca51('0x58')]['id'];}return db['ChatMessage'][_0xca51('0x59')]({'where':{'id':_0x4cb9cc[_0xca51('0x5a')]['id']}})[_0xca51('0x38')](handleEntityNotFound(_0x3ef7e0,null))[_0xca51('0x38')](saveUpdates(_0x4cb9cc[_0xca51('0x58')],null))[_0xca51('0x38')](respondWithResult(_0x3ef7e0,null))[_0xca51('0x2b')](handleError(_0x3ef7e0,null));};exports[_0xca51('0x39')]=function(_0x3bf590,_0x1fa301){return db['ChatMessage'][_0xca51('0x59')]({'where':{'id':_0x3bf590[_0xca51('0x5a')]['id']}})[_0xca51('0x38')](handleEntityNotFound(_0x1fa301,null))[_0xca51('0x38')](removeEntity(_0x1fa301,null))[_0xca51('0x2b')](handleError(_0x1fa301,null));};exports[_0xca51('0x5b')]=function(_0x1f16c8,_0x501d70){return db[_0xca51('0x40')][_0xca51('0x5b')]()['then'](respondWithResult(_0x501d70,null))[_0xca51('0x2b')](handleError(_0x501d70,null));};var interaction_log=require(_0xca51('0x14'))(_0xca51('0x5c'));exports[_0xca51('0x5d')]=function(_0x197b02,_0x1aa855,_0x363218){var _0x266c95={'agent':{},'channel':_0xca51('0x5e')};if(_0x197b02['body']['id']){delete _0x197b02[_0xca51('0x58')]['id'];}_0x197b02[_0xca51('0x58')][_0xca51('0x5f')]=!![];_0x197b02[_0xca51('0x58')][_0xca51('0x60')]=moment()[_0xca51('0x61')](_0xca51('0x62'));_0x197b02['body']['UserId']=_0x197b02['body'][_0xca51('0x63')]||_0x197b02['user']['id'];_0x266c95[_0xca51('0x64')]['id']=_0x197b02['body'][_0xca51('0x63')];return db[_0xca51('0x40')][_0xca51('0x59')]({'where':{'id':_0x197b02[_0xca51('0x5a')]['id'],'UserId':null}})[_0xca51('0x38')](handleEntityNotFound(_0x1aa855,null))[_0xca51('0x38')](saveUpdates(_0x197b02['body'],null))[_0xca51('0x38')](function(_0xf60f00){if(_0xf60f00){_0x266c95[_0xca51('0x29')]=_0xf60f00['get']({'plain':!![]});return db[_0xca51('0x65')][_0xca51('0x59')]({'where':{'id':_0xf60f00[_0xca51('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x1aa855,null))[_0xca51('0x38')](function(_0x24716c){if(_0x24716c){return _0x24716c['update']({'UserId':_0x197b02[_0xca51('0x58')][_0xca51('0x63')],'read1stAt':_[_0xca51('0x67')](_0x24716c[_0xca51('0x68')])?moment()[_0xca51('0x61')](_0xca51('0x62')):undefined});}return null;})[_0xca51('0x38')](function(_0x4f3313){if(_0x4f3313){_0x266c95['interaction']=_0x4f3313['get']({'plain':!![]});interaction_log[_0xca51('0x23')](_0xca51('0x69'),_0x197b02[_0xca51('0x6a')]['id'],_0x197b02[_0xca51('0x6a')][_0xca51('0x3d')],_0x197b02[_0xca51('0x6a')][_0xca51('0x6b')],_0x266c95[_0xca51('0x6c')]['id'],_0x197b02[_0xca51('0x58')]?JSON['stringify'](_0x197b02['body']):_0xca51('0x6d'));return respondWithRpcPromise(_0xca51('0x6e'),_0xca51('0x6f'),_0x266c95);}return null;})['then'](function(_0x3e5a0e){var _0x5de90c=_0xca51('0x70')+_0x3e5a0e[_0xca51('0x29')][_0xca51('0x71')];return db['sequelize'][_0xca51('0x44')](_0x5de90c,{'type':db[_0xca51('0x72')][_0xca51('0x73')][_0xca51('0x74')],'raw':!![]})[_0xca51('0x38')](function(_0x438682){return _0x438682;});})[_0xca51('0x38')](function(_0x4381ff){if(_0x4381ff){_0x266c95[_0xca51('0x29')][_0xca51('0x75')]=_0x4381ff[0x0];if(!_0x197b02[_0xca51('0x58')][_0xca51('0x63')])return;return db['User'][_0xca51('0x59')]({'where':{'id':_0x197b02[_0xca51('0x58')]['UserId'],'role':_0xca51('0x64')},'attributes':['id',_0xca51('0x3d'),'fullname',_0xca51('0x76'),'internal'],'raw':!![]});}return null;})[_0xca51('0x38')](function(_0x11c7c0){if(!_0x11c7c0)return null;_0x266c95[_0xca51('0x29')][_0xca51('0x64')]=_0x11c7c0;return _0x266c95;})[_0xca51('0x38')](function(_0x9ad06d){if(_0x9ad06d){if(_0x197b02[_0xca51('0x58')][_0xca51('0x77')]){_0x266c95[_0xca51('0x29')][_0xca51('0x78')]=util[_0xca51('0x61')](_0xca51('0x79'),_0x197b02[_0xca51('0x6a')][_0xca51('0x3d')]);_0x266c95[_0xca51('0x29')][_0xca51('0x7a')]=_0x266c95[_0xca51('0x7a')];_0x266c95[_0xca51('0x29')][_0xca51('0x7b')]=_0x266c95['channel'];_0x266c95['message'][_0xca51('0x7c')]=_0xca51('0x5d');return respondWithRpcPromise('EventManager',_0xca51('0x7d'),{'event':_0xca51('0x7e'),'message':_[_0xca51('0x50')](_0x266c95['message'],JSON['parse'](_0x266c95[_0xca51('0x6c')]['formData']))},client9002)[_0xca51('0x38')](function(){return _0x266c95;});}return _0x266c95;}return null;})[_0xca51('0x38')](respondWithResult(_0x1aa855,null))[_0xca51('0x2b')](handleError(_0x1aa855,null));};var interaction_log=require('../../config/logger')(_0xca51('0x5c'));exports[_0xca51('0x35')]=function(_0x54e9a3,_0x1d14ae,_0x409fe6){var _0x3ae076={'agent':{},'channel':_0xca51('0x5e')};if(_0x54e9a3[_0xca51('0x58')]['id']){delete _0x54e9a3[_0xca51('0x58')]['id'];}_0x54e9a3[_0xca51('0x58')]['UserId']=_0x54e9a3['body'][_0xca51('0x63')]||_0x54e9a3['user']['id'];_0x3ae076['agent']['id']=_0x54e9a3['body'][_0xca51('0x63')];return db[_0xca51('0x40')][_0xca51('0x59')]({'where':{'id':_0x54e9a3[_0xca51('0x5a')]['id'],'UserId':null}})[_0xca51('0x38')](handleEntityNotFound(_0x1d14ae,null))['then'](function(_0x196f0c){if(_0x196f0c){_0x3ae076['message']=_0x196f0c[_0xca51('0x7f')]({'plain':!![]});return db[_0xca51('0x65')][_0xca51('0x59')]({'where':{'id':_0x196f0c['ChatInteractionId']}});}return null;})[_0xca51('0x38')](handleEntityNotFound(_0x1d14ae,null))[_0xca51('0x38')](function(_0x31d5ce){if(_0x31d5ce){_0x3ae076[_0xca51('0x6c')]=_0x31d5ce[_0xca51('0x7f')]({'plain':!![]});interaction_log[_0xca51('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54e9a3[_0xca51('0x6a')]['id'],_0x54e9a3[_0xca51('0x6a')][_0xca51('0x3d')],_0x54e9a3[_0xca51('0x6a')]['role'],_0x3ae076[_0xca51('0x6c')]['id'],_0x54e9a3[_0xca51('0x58')]?JSON[_0xca51('0x80')](_0x54e9a3[_0xca51('0x58')]):'null');return respondWithRpcPromise(_0xca51('0x81'),_0xca51('0x82'),_0x3ae076);}return null;})[_0xca51('0x38')](function(_0x2a5df4){var _0x130b24='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a5df4['message'][_0xca51('0x71')];return db[_0xca51('0x83')]['query'](_0x130b24,{'type':db[_0xca51('0x72')]['QueryTypes'][_0xca51('0x74')],'raw':!![]})[_0xca51('0x38')](function(_0x46d698){return _0x46d698;});})[_0xca51('0x38')](function(_0x514131){if(_0x514131){_0x3ae076[_0xca51('0x29')][_0xca51('0x75')]=_0x514131[0x0];if(!_0x54e9a3['body'][_0xca51('0x63')])return;return db['User'][_0xca51('0x59')]({'where':{'id':_0x54e9a3['body'][_0xca51('0x63')],'role':_0xca51('0x64')},'attributes':['id',_0xca51('0x3d'),_0xca51('0x84'),_0xca51('0x76'),_0xca51('0x85')],'raw':!![]});}return null;})[_0xca51('0x38')](function(_0x181feb){if(!_0x181feb)return null;_0x3ae076[_0xca51('0x29')]['agent']=_0x181feb;return _0x3ae076;})['then'](function(_0x93f7ea){if(_0x93f7ea){_0x93f7ea[_0xca51('0x29')][_0xca51('0x78')]=util['format'](_0xca51('0x79'),_0x54e9a3[_0xca51('0x6a')][_0xca51('0x3d')]);_0x93f7ea[_0xca51('0x29')][_0xca51('0x7a')]=_0x3ae076[_0xca51('0x7a')];_0x93f7ea[_0xca51('0x29')]['motionChannel']=_0x3ae076[_0xca51('0x7a')];_0x93f7ea['message']['event']=_0xca51('0x35');respondWithRpcPromise(_0xca51('0x7d'),'EventManager',{'event':_0xca51('0x86'),'message':_[_0xca51('0x50')](_0x3ae076[_0xca51('0x29')],JSON[_0xca51('0x87')](_0x3ae076[_0xca51('0x6c')][_0xca51('0x88')]))},client9002);return _0x3ae076;}return null;})['then'](respondWithResult(_0x1d14ae,null))[_0xca51('0x2b')](handleError(_0x1d14ae,null));}; \ No newline at end of file +var _0xaca2=['rows','catch','show','params','keys','rawAttributes','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','internal','motionChannel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','map','ChatMessage','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xaca2,0xc4));var _0x2aca=function(_0x2cdfa7,_0x34eeb6){_0x2cdfa7=_0x2cdfa7-0x0;var _0x23a81a=_0xaca2[_0x2cdfa7];return _0x23a81a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2aca('0x0'));var zipdir=require(_0x2aca('0x1'));var jsonpatch=require(_0x2aca('0x2'));var rp=require(_0x2aca('0x3'));var moment=require('moment');var BPromise=require(_0x2aca('0x4'));var Mustache=require('mustache');var util=require(_0x2aca('0x5'));var path=require(_0x2aca('0x6'));var sox=require(_0x2aca('0x7'));var csv=require(_0x2aca('0x8'));var ejs=require(_0x2aca('0x9'));var fs=require('fs');var fs_extra=require(_0x2aca('0xa'));var _=require(_0x2aca('0xb'));var squel=require('squel');var crypto=require(_0x2aca('0xc'));var jsforce=require(_0x2aca('0xd'));var deskjs=require(_0x2aca('0xe'));var toCsv=require(_0x2aca('0x8'));var querystring=require(_0x2aca('0xf'));var Papa=require(_0x2aca('0x10'));var Redis=require(_0x2aca('0x11'));var authService=require(_0x2aca('0x12'));var qs=require(_0x2aca('0x13'));var as=require(_0x2aca('0x14'));var hardwareService=require(_0x2aca('0x15'));var logger=require(_0x2aca('0x16'))(_0x2aca('0x17'));var utils=require(_0x2aca('0x18'));var config=require(_0x2aca('0x19'));var licenseUtil=require(_0x2aca('0x1a'));var db=require(_0x2aca('0x1b'))['db'];config[_0x2aca('0x1c')]=_[_0x2aca('0x1d')](config[_0x2aca('0x1c')],{'host':_0x2aca('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aca('0x1c')]));require(_0x2aca('0x1f'))[_0x2aca('0x20')](socket);var jayson=require(_0x2aca('0x21'));var client=jayson[_0x2aca('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x2aca('0x22')][_0x2aca('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x10ef26,_0x34e6f7,_0x4fbf59,_0x43ab1c){return new BPromise(function(_0x4a8218,_0x89dcef){var _0x4fae34=_0x43ab1c||client;return _0x4fae34['request'](_0x10ef26,_0x4fbf59)['then'](function(_0x27d454){logger[_0x2aca('0x24')]('ChatMessage,\x20%s,\x20%s',_0x34e6f7,_0x2aca('0x25'));logger[_0x2aca('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x34e6f7,'request\x20sent',JSON[_0x2aca('0x27')](_0x27d454));if(_0x27d454['error']){if(_0x27d454[_0x2aca('0x28')][_0x2aca('0x29')]===0x1f4){logger['error'](_0x2aca('0x2a'),_0x34e6f7,_0x27d454[_0x2aca('0x28')][_0x2aca('0x2b')]);return _0x89dcef(_0x27d454[_0x2aca('0x28')][_0x2aca('0x2b')]);}logger['error'](_0x2aca('0x2a'),_0x34e6f7,_0x27d454[_0x2aca('0x28')]['message']);return _0x4a8218(_0x27d454[_0x2aca('0x28')][_0x2aca('0x2b')]);}else{logger[_0x2aca('0x24')](_0x2aca('0x2a'),_0x34e6f7,_0x2aca('0x25'));_0x4a8218(_0x27d454[_0x2aca('0x2c')][_0x2aca('0x2b')]);}})['catch'](function(_0x57f9fa){logger['error'](_0x2aca('0x2a'),_0x34e6f7,_0x57f9fa);_0x89dcef(_0x57f9fa);});});}function respondWithStatusCode(_0x3164d9,_0x48b962){_0x48b962=_0x48b962||0xcc;return function(_0x311b8f){if(_0x311b8f){return _0x3164d9['sendStatus'](_0x48b962);}return _0x3164d9[_0x2aca('0x2d')](_0x48b962)[_0x2aca('0x2e')]();};}function respondWithResult(_0x74122,_0x4f5400){_0x4f5400=_0x4f5400||0xc8;return function(_0x541f5e){if(_0x541f5e){return _0x74122[_0x2aca('0x2d')](_0x4f5400)[_0x2aca('0x2f')](_0x541f5e);}};}function respondWithFilteredResult(_0x4ea308,_0xd3def1){return function(_0x547772){if(_0x547772){var _0x335f4d=typeof _0xd3def1[_0x2aca('0x30')]==='undefined'&&typeof _0xd3def1[_0x2aca('0x31')]===_0x2aca('0x32');var _0x4b7288=_0x547772[_0x2aca('0x33')];var _0x370a81=_0x335f4d?0x0:_0xd3def1[_0x2aca('0x30')];var _0x57695a=_0x335f4d?_0x547772['count']:_0xd3def1['offset']+_0xd3def1[_0x2aca('0x31')];var _0x555840;if(_0x57695a>=_0x4b7288){_0x57695a=_0x4b7288;_0x555840=0xc8;}else{_0x555840=0xce;}_0x4ea308['status'](_0x555840);return _0x4ea308[_0x2aca('0x34')](_0x2aca('0x35'),_0x370a81+'-'+_0x57695a+'/'+_0x4b7288)[_0x2aca('0x2f')](_0x547772);}return null;};}function patchUpdates(_0x11f508){return function(_0x151a22){try{jsonpatch[_0x2aca('0x36')](_0x151a22,_0x11f508,!![]);}catch(_0x4e0ea3){return BPromise['reject'](_0x4e0ea3);}return _0x151a22[_0x2aca('0x37')]();};}function saveUpdates(_0x101aaa,_0x43094f){return function(_0x17e890){if(_0x17e890){return _0x17e890[_0x2aca('0x38')](_0x101aaa)['then'](function(_0x28a80a){return _0x28a80a;});}return null;};}function removeEntity(_0x2c963d,_0x2831f6){return function(_0x1bd93f){if(_0x1bd93f){return _0x1bd93f[_0x2aca('0x39')]()[_0x2aca('0x3a')](function(){_0x2c963d[_0x2aca('0x2d')](0xcc)[_0x2aca('0x2e')]();});}};}function handleEntityNotFound(_0x486fb9,_0x140966){return function(_0x3e4bfb){if(!_0x3e4bfb){_0x486fb9[_0x2aca('0x3b')](0x194);}return _0x3e4bfb;};}function handleError(_0x5ee2ff,_0x55fcf0){_0x55fcf0=_0x55fcf0||0x1f4;return function(_0x5a05a6){logger[_0x2aca('0x28')](_0x5a05a6[_0x2aca('0x3c')]);if(_0x5a05a6[_0x2aca('0x3d')]){delete _0x5a05a6[_0x2aca('0x3d')];}_0x5ee2ff[_0x2aca('0x2d')](_0x55fcf0)[_0x2aca('0x3e')](_0x5a05a6);};}exports['index']=function(_0x18eef6,_0x14a8ff){var _0x4b795d={},_0x530498={},_0xe703b5={'count':0x0,'rows':[]};var _0x9de195=_[_0x2aca('0x3f')](db[_0x2aca('0x40')]['rawAttributes'],function(_0xea0538){return{'name':_0xea0538['fieldName'],'type':_0xea0538['type'][_0x2aca('0x41')]};});_0x530498[_0x2aca('0x42')]=_[_0x2aca('0x3f')](_0x9de195,_0x2aca('0x3d'));_0x530498[_0x2aca('0x43')]=_['keys'](_0x18eef6[_0x2aca('0x43')]);_0x530498[_0x2aca('0x44')]=_[_0x2aca('0x45')](_0x530498[_0x2aca('0x42')],_0x530498[_0x2aca('0x43')]);_0x4b795d[_0x2aca('0x46')]=_[_0x2aca('0x45')](_0x530498['model'],qs[_0x2aca('0x47')](_0x18eef6[_0x2aca('0x43')][_0x2aca('0x47')]));_0x4b795d[_0x2aca('0x46')]=_0x4b795d['attributes'][_0x2aca('0x48')]?_0x4b795d['attributes']:_0x530498[_0x2aca('0x42')];if(!_0x18eef6[_0x2aca('0x43')][_0x2aca('0x49')](_0x2aca('0x4a'))){_0x4b795d['limit']=qs[_0x2aca('0x31')](_0x18eef6[_0x2aca('0x43')]['limit']);_0x4b795d[_0x2aca('0x30')]=qs[_0x2aca('0x30')](_0x18eef6[_0x2aca('0x43')][_0x2aca('0x30')]);}_0x4b795d[_0x2aca('0x4b')]=qs['sort'](_0x18eef6['query'][_0x2aca('0x4c')]);_0x4b795d[_0x2aca('0x4d')]=qs[_0x2aca('0x44')](_[_0x2aca('0x4e')](_0x18eef6[_0x2aca('0x43')],_0x530498['filters']),_0x9de195);if(_0x18eef6[_0x2aca('0x43')][_0x2aca('0x4f')]){_0x4b795d[_0x2aca('0x4d')]=_[_0x2aca('0x50')](_0x4b795d[_0x2aca('0x4d')],{'$or':_['map'](_0x9de195,function(_0x52414b){if(_0x52414b[_0x2aca('0x51')]!=='VIRTUAL'){var _0x230703={};_0x230703[_0x52414b[_0x2aca('0x3d')]]={'$like':'%'+_0x18eef6[_0x2aca('0x43')]['filter']+'%'};return _0x230703;}})});}_0x4b795d=_[_0x2aca('0x50')]({},_0x4b795d,_0x18eef6[_0x2aca('0x52')]);var _0x1aa6e7={'where':_0x4b795d[_0x2aca('0x4d')]};return db[_0x2aca('0x40')][_0x2aca('0x33')](_0x1aa6e7)[_0x2aca('0x3a')](function(_0x431aef){_0xe703b5[_0x2aca('0x33')]=_0x431aef;if(_0x18eef6[_0x2aca('0x43')][_0x2aca('0x53')]){_0x4b795d[_0x2aca('0x54')]=[{'all':!![]}];}return db[_0x2aca('0x40')][_0x2aca('0x55')](_0x4b795d);})[_0x2aca('0x3a')](function(_0x58c6c3){_0xe703b5[_0x2aca('0x56')]=_0x58c6c3;return _0xe703b5;})[_0x2aca('0x3a')](respondWithFilteredResult(_0x14a8ff,_0x4b795d))[_0x2aca('0x57')](handleError(_0x14a8ff,null));};exports[_0x2aca('0x58')]=function(_0x3b5f8a,_0x4248d6){var _0xe4e254={'raw':!![],'where':{'id':_0x3b5f8a[_0x2aca('0x59')]['id']}},_0x58c3ef={};_0x58c3ef['model']=_[_0x2aca('0x5a')](db[_0x2aca('0x40')][_0x2aca('0x5b')]);_0x58c3ef['query']=_[_0x2aca('0x5a')](_0x3b5f8a[_0x2aca('0x43')]);_0x58c3ef['filters']=_['intersection'](_0x58c3ef['model'],_0x58c3ef[_0x2aca('0x43')]);_0xe4e254[_0x2aca('0x46')]=_[_0x2aca('0x45')](_0x58c3ef[_0x2aca('0x42')],qs[_0x2aca('0x47')](_0x3b5f8a[_0x2aca('0x43')][_0x2aca('0x47')]));_0xe4e254[_0x2aca('0x46')]=_0xe4e254['attributes']['length']?_0xe4e254[_0x2aca('0x46')]:_0x58c3ef['model'];if(_0x3b5f8a[_0x2aca('0x43')]['includeAll']){_0xe4e254['include']=[{'all':!![]}];}_0xe4e254=_[_0x2aca('0x50')]({},_0xe4e254,_0x3b5f8a[_0x2aca('0x52')]);return db[_0x2aca('0x40')][_0x2aca('0x5c')](_0xe4e254)[_0x2aca('0x3a')](handleEntityNotFound(_0x4248d6,null))[_0x2aca('0x3a')](respondWithResult(_0x4248d6,null))[_0x2aca('0x57')](handleError(_0x4248d6,null));};exports['create']=function(_0x30fd99,_0x289471){return db[_0x2aca('0x40')][_0x2aca('0x5d')](_0x30fd99[_0x2aca('0x5e')],{})['then'](respondWithResult(_0x289471,0xc9))['catch'](handleError(_0x289471,null));};exports[_0x2aca('0x38')]=function(_0x4bf784,_0x34926a){if(_0x4bf784[_0x2aca('0x5e')]['id']){delete _0x4bf784[_0x2aca('0x5e')]['id'];}return db[_0x2aca('0x40')][_0x2aca('0x5c')]({'where':{'id':_0x4bf784[_0x2aca('0x59')]['id']}})[_0x2aca('0x3a')](handleEntityNotFound(_0x34926a,null))[_0x2aca('0x3a')](saveUpdates(_0x4bf784[_0x2aca('0x5e')],null))[_0x2aca('0x3a')](respondWithResult(_0x34926a,null))[_0x2aca('0x57')](handleError(_0x34926a,null));};exports[_0x2aca('0x39')]=function(_0x521c59,_0x4b277a){return db[_0x2aca('0x40')]['find']({'where':{'id':_0x521c59['params']['id']}})[_0x2aca('0x3a')](handleEntityNotFound(_0x4b277a,null))[_0x2aca('0x3a')](removeEntity(_0x4b277a,null))['catch'](handleError(_0x4b277a,null));};exports[_0x2aca('0x5f')]=function(_0x223582,_0x33408d){return db[_0x2aca('0x40')]['describe']()['then'](respondWithResult(_0x33408d,null))[_0x2aca('0x57')](handleError(_0x33408d,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x2aca('0x60')]=function(_0x4d5e41,_0xa17294,_0x42b6c8){var _0x3e2606={'agent':{},'channel':'chat'};if(_0x4d5e41['body']['id']){delete _0x4d5e41[_0x2aca('0x5e')]['id'];}_0x4d5e41[_0x2aca('0x5e')][_0x2aca('0x61')]=!![];_0x4d5e41['body'][_0x2aca('0x62')]=moment()[_0x2aca('0x63')](_0x2aca('0x64'));_0x4d5e41['body']['UserId']=_0x4d5e41[_0x2aca('0x5e')][_0x2aca('0x65')]||_0x4d5e41['user']['id'];_0x3e2606[_0x2aca('0x66')]['id']=_0x4d5e41['body'][_0x2aca('0x65')];return db[_0x2aca('0x40')]['find']({'where':{'id':_0x4d5e41[_0x2aca('0x59')]['id'],'UserId':null}})[_0x2aca('0x3a')](handleEntityNotFound(_0xa17294,null))[_0x2aca('0x3a')](saveUpdates(_0x4d5e41[_0x2aca('0x5e')],null))[_0x2aca('0x3a')](function(_0x112cf9){if(_0x112cf9){_0x3e2606['message']=_0x112cf9['get']({'plain':!![]});return db[_0x2aca('0x67')]['find']({'where':{'id':_0x112cf9[_0x2aca('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xa17294,null))[_0x2aca('0x3a')](function(_0xc39dbd){if(_0xc39dbd){return _0xc39dbd[_0x2aca('0x38')]({'UserId':_0x4d5e41['body']['UserId'],'read1stAt':_[_0x2aca('0x69')](_0xc39dbd[_0x2aca('0x6a')])?moment()[_0x2aca('0x63')](_0x2aca('0x64')):undefined});}return null;})[_0x2aca('0x3a')](function(_0x2d06d2){if(_0x2d06d2){_0x3e2606[_0x2aca('0x6b')]=_0x2d06d2[_0x2aca('0x6c')]({'plain':!![]});interaction_log[_0x2aca('0x24')](_0x2aca('0x6d'),_0x4d5e41[_0x2aca('0x6e')]['id'],_0x4d5e41[_0x2aca('0x6e')][_0x2aca('0x3d')],_0x4d5e41[_0x2aca('0x6e')][_0x2aca('0x6f')],_0x3e2606[_0x2aca('0x6b')]['id'],_0x4d5e41[_0x2aca('0x5e')]?JSON[_0x2aca('0x27')](_0x4d5e41[_0x2aca('0x5e')]):_0x2aca('0x70'));return respondWithRpcPromise(_0x2aca('0x71'),_0x2aca('0x72'),_0x3e2606);}return null;})[_0x2aca('0x3a')](function(_0x1105eb){var _0x36fb63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1105eb[_0x2aca('0x2b')][_0x2aca('0x73')];return db['sequelize'][_0x2aca('0x43')](_0x36fb63,{'type':db[_0x2aca('0x74')][_0x2aca('0x75')][_0x2aca('0x76')],'raw':!![]})['then'](function(_0x273415){return _0x273415;});})[_0x2aca('0x3a')](function(_0xfe12cc){if(_0xfe12cc){_0x3e2606['message'][_0x2aca('0x77')]=_0xfe12cc[0x0];if(!_0x4d5e41[_0x2aca('0x5e')][_0x2aca('0x65')])return;return db[_0x2aca('0x78')][_0x2aca('0x5c')]({'where':{'id':_0x4d5e41[_0x2aca('0x5e')][_0x2aca('0x65')],'role':_0x2aca('0x66')},'attributes':['id',_0x2aca('0x3d'),'fullname',_0x2aca('0x79'),'internal'],'raw':!![]});}return null;})[_0x2aca('0x3a')](function(_0x1f8543){if(!_0x1f8543)return null;_0x3e2606['message'][_0x2aca('0x66')]=_0x1f8543;return _0x3e2606;})[_0x2aca('0x3a')](function(_0x262968){if(_0x262968){if(_0x4d5e41[_0x2aca('0x5e')][_0x2aca('0x7a')]){_0x3e2606[_0x2aca('0x2b')][_0x2aca('0x7b')]=util[_0x2aca('0x63')](_0x2aca('0x7c'),_0x4d5e41[_0x2aca('0x6e')][_0x2aca('0x3d')]);_0x3e2606['message'][_0x2aca('0x7d')]=_0x3e2606[_0x2aca('0x7d')];_0x3e2606[_0x2aca('0x2b')]['motionChannel']=_0x3e2606['channel'];_0x3e2606[_0x2aca('0x2b')][_0x2aca('0x7e')]=_0x2aca('0x60');return respondWithRpcPromise(_0x2aca('0x7f'),'EventManager',{'event':_0x2aca('0x80'),'message':_[_0x2aca('0x50')](_0x3e2606[_0x2aca('0x2b')],JSON[_0x2aca('0x81')](_0x3e2606[_0x2aca('0x6b')][_0x2aca('0x82')]))},client9002)[_0x2aca('0x3a')](function(){return _0x3e2606;});}return _0x3e2606;}return null;})['then'](respondWithResult(_0xa17294,null))['catch'](handleError(_0xa17294,null));};var interaction_log=require(_0x2aca('0x16'))(_0x2aca('0x83'));exports['reject']=function(_0x52a185,_0x3fe0c7,_0x4d2596){var _0x28b221={'agent':{},'channel':_0x2aca('0x84')};if(_0x52a185[_0x2aca('0x5e')]['id']){delete _0x52a185['body']['id'];}_0x52a185[_0x2aca('0x5e')][_0x2aca('0x65')]=_0x52a185[_0x2aca('0x5e')]['UserId']||_0x52a185[_0x2aca('0x6e')]['id'];_0x28b221['agent']['id']=_0x52a185['body'][_0x2aca('0x65')];return db[_0x2aca('0x40')][_0x2aca('0x5c')]({'where':{'id':_0x52a185[_0x2aca('0x59')]['id'],'UserId':null}})[_0x2aca('0x3a')](handleEntityNotFound(_0x3fe0c7,null))[_0x2aca('0x3a')](function(_0x1081e1){if(_0x1081e1){_0x28b221[_0x2aca('0x2b')]=_0x1081e1['get']({'plain':!![]});return db[_0x2aca('0x67')][_0x2aca('0x5c')]({'where':{'id':_0x1081e1[_0x2aca('0x68')]}});}return null;})[_0x2aca('0x3a')](handleEntityNotFound(_0x3fe0c7,null))['then'](function(_0x353cf2){if(_0x353cf2){_0x28b221[_0x2aca('0x6b')]=_0x353cf2[_0x2aca('0x6c')]({'plain':!![]});interaction_log[_0x2aca('0x24')](_0x2aca('0x85'),_0x52a185[_0x2aca('0x6e')]['id'],_0x52a185[_0x2aca('0x6e')]['name'],_0x52a185[_0x2aca('0x6e')]['role'],_0x28b221['interaction']['id'],_0x52a185[_0x2aca('0x5e')]?JSON[_0x2aca('0x27')](_0x52a185[_0x2aca('0x5e')]):_0x2aca('0x70'));return respondWithRpcPromise(_0x2aca('0x86'),_0x2aca('0x87'),_0x28b221);}return null;})[_0x2aca('0x3a')](function(_0x4c77a1){var _0xa3e436=_0x2aca('0x88')+_0x4c77a1[_0x2aca('0x2b')][_0x2aca('0x73')];return db[_0x2aca('0x89')]['query'](_0xa3e436,{'type':db[_0x2aca('0x74')][_0x2aca('0x75')][_0x2aca('0x76')],'raw':!![]})['then'](function(_0x155e62){return _0x155e62;});})['then'](function(_0x374ddc){if(_0x374ddc){_0x28b221['message'][_0x2aca('0x77')]=_0x374ddc[0x0];if(!_0x52a185[_0x2aca('0x5e')][_0x2aca('0x65')])return;return db[_0x2aca('0x78')]['find']({'where':{'id':_0x52a185[_0x2aca('0x5e')][_0x2aca('0x65')],'role':_0x2aca('0x66')},'attributes':['id',_0x2aca('0x3d'),'fullname',_0x2aca('0x79'),_0x2aca('0x8a')],'raw':!![]});}return null;})['then'](function(_0x18c734){if(!_0x18c734)return null;_0x28b221[_0x2aca('0x2b')][_0x2aca('0x66')]=_0x18c734;return _0x28b221;})[_0x2aca('0x3a')](function(_0x363221){if(_0x363221){_0x363221[_0x2aca('0x2b')][_0x2aca('0x7b')]=util[_0x2aca('0x63')]('SIP/%s',_0x52a185[_0x2aca('0x6e')]['name']);_0x363221[_0x2aca('0x2b')][_0x2aca('0x7d')]=_0x28b221[_0x2aca('0x7d')];_0x363221[_0x2aca('0x2b')][_0x2aca('0x8b')]=_0x28b221[_0x2aca('0x7d')];_0x363221[_0x2aca('0x2b')][_0x2aca('0x7e')]='reject';respondWithRpcPromise(_0x2aca('0x7f'),_0x2aca('0x7f'),{'event':_0x2aca('0x8c'),'message':_[_0x2aca('0x50')](_0x28b221[_0x2aca('0x2b')],JSON['parse'](_0x28b221[_0x2aca('0x6b')][_0x2aca('0x82')]))},client9002);return _0x28b221;}return null;})[_0x2aca('0x3a')](respondWithResult(_0x3fe0c7,null))[_0x2aca('0x57')](handleError(_0x3fe0c7,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0eeda9e..74bb5a0 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 _0x6fd2=['hook','ChatMessage','save','emit'];(function(_0x34db13,_0x2f0ee1){var _0x5d840b=function(_0x4601d2){while(--_0x4601d2){_0x34db13['push'](_0x34db13['shift']());}};_0x5d840b(++_0x2f0ee1);}(_0x6fd2,0x125));var _0x26fd=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6fd2[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x26fd('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26fd('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x297066){return function(_0x136bb3,_0x36f2e8,_0x1227a0){ChatMessageEvents[_0x26fd('0x2')](_0x297066+':'+_0x136bb3['id'],_0x136bb3);ChatMessageEvents['emit'](_0x297066,_0x136bb3);_0x1227a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x26fd('0x3')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xdc46=['ChatMessage','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x11c913,_0x1c6f22){var _0x5ba6eb=function(_0xb20492){while(--_0xb20492){_0x11c913['push'](_0x11c913['shift']());}};_0x5ba6eb(++_0x1c6f22);}(_0xdc46,0x13a));var _0x6dc4=function(_0x6b97e9,_0x1ceb34){_0x6b97e9=_0x6b97e9-0x0;var _0x37794e=_0xdc46[_0x6b97e9];return _0x37794e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6dc4('0x0'))['db'][_0x6dc4('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6dc4('0x2'),'afterUpdate':_0x6dc4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x387e64){return function(_0x47db91,_0x5191bc,_0x59f47d){ChatMessageEvents[_0x6dc4('0x4')](_0x387e64+':'+_0x47db91['id'],_0x47db91);ChatMessageEvents[_0x6dc4('0x4')](_0x387e64,_0x47db91);_0x59f47d(null);};}for(var e in events){if(events[_0x6dc4('0x5')](e)){var event=events[e];ChatMessage[_0x6dc4('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index a7fc5af..fd662bb 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 _0xc4d2=['define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports'];(function(_0x4494ac,_0x15290e){var _0x3e42a6=function(_0x58e7a0){while(--_0x58e7a0){_0x4494ac['push'](_0x4494ac['shift']());}};_0x3e42a6(++_0x15290e);}(_0xc4d2,0x88));var _0x2c4d=function(_0x3e0eaf,_0x1ede1f){_0x3e0eaf=_0x3e0eaf-0x0;var _0x2d22de=_0xc4d2[_0x3e0eaf];return _0x2d22de;};'use strict';var _=require(_0x2c4d('0x0'));var util=require(_0x2c4d('0x1'));var logger=require(_0x2c4d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2c4d('0x3'));var rp=require(_0x2c4d('0x4'));var fs=require('fs');var path=require(_0x2c4d('0x5'));var rimraf=require(_0x2c4d('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c4d('0x7'));module[_0x2c4d('0x8')]=function(_0x4af5e1,_0x5ebe5d){return _0x4af5e1[_0x2c4d('0x9')](_0x2c4d('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x2c4d('0xb'),'fields':[_0x2c4d('0xc')],'type':_0x2c4d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1dca04,_0x42778e,_0x5eca2e){var _0x19cd49=_0x4af5e1[_0x2c4d('0xe')];var _0x77c734=_0x1dca04[_0x2c4d('0xf')]({'plain':!![]});if(_0x77c734['direction'][_0x2c4d('0x10')]()==='in'||_0x77c734[_0x2c4d('0x11')][_0x2c4d('0x10')]()===_0x2c4d('0x12')&&!_0x77c734[_0x2c4d('0x13')]&&!_[_0x2c4d('0x14')](_0x77c734[_0x2c4d('0x15')])){_0x19cd49['ChatInteraction'][_0x2c4d('0x16')]({'where':{'id':_0x77c734[_0x2c4d('0x17')]}})['then'](function(_0x167742){if(_0x167742){_0x167742[_0x2c4d('0x18')]({'lastMsgAt':_0x77c734[_0x2c4d('0x19')],'lastMsgDirection':_0x77c734[_0x2c4d('0x11')][_0x2c4d('0x10')]()});}})[_0x2c4d('0x1a')](function(_0x36b50e){console[_0x2c4d('0x1b')](_0x36b50e);});}_0x5eca2e();}},'charset':_0x2c4d('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb079=['secret','isNil','UserId','ChatInteraction','findOne','update','createdAt','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0xa1bea0,_0x2d6465){var _0x2b8194=function(_0x327652){while(--_0x327652){_0xa1bea0['push'](_0xa1bea0['shift']());}};_0x2b8194(++_0x2d6465);}(_0xb079,0x1c9));var _0x9b07=function(_0x1c12f3,_0x21ca53){_0x1c12f3=_0x1c12f3-0x0;var _0x2c9bcd=_0xb079[_0x1c12f3];return _0x2c9bcd;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var logger=require(_0x9b07('0x1'))(_0x9b07('0x2'));var moment=require(_0x9b07('0x3'));var BPromise=require(_0x9b07('0x4'));var rp=require(_0x9b07('0x5'));var fs=require('fs');var path=require(_0x9b07('0x6'));var rimraf=require(_0x9b07('0x7'));var config=require(_0x9b07('0x8'));var attributes=require(_0x9b07('0x9'));module[_0x9b07('0xa')]=function(_0x4a6f57,_0x1ebf90){return _0x4a6f57[_0x9b07('0xb')]('ChatMessage',attributes,{'tableName':_0x9b07('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x9b07('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x129473,_0x26ef60,_0x36e641){var _0x5e01dc=_0x4a6f57[_0x9b07('0xe')];var _0x1a88fe=_0x129473[_0x9b07('0xf')]({'plain':!![]});if(_0x1a88fe[_0x9b07('0x10')][_0x9b07('0x11')]()==='in'||_0x1a88fe[_0x9b07('0x10')][_0x9b07('0x11')]()===_0x9b07('0x12')&&!_0x1a88fe[_0x9b07('0x13')]&&!_[_0x9b07('0x14')](_0x1a88fe[_0x9b07('0x15')])){_0x5e01dc[_0x9b07('0x16')][_0x9b07('0x17')]({'where':{'id':_0x1a88fe['ChatInteractionId']}})['then'](function(_0x14d026){if(_0x14d026){_0x14d026[_0x9b07('0x18')]({'lastMsgAt':_0x1a88fe[_0x9b07('0x19')],'lastMsgDirection':_0x1a88fe[_0x9b07('0x10')][_0x9b07('0x11')]()});}})['catch'](function(_0x398a54){console[_0x9b07('0x1a')](_0x398a54);});}_0x36e641();}},'charset':_0x9b07('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index bdeb495..d1bc5ec 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 _0xbbac=['redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbbac,0x72));var _0xcbba=function(_0x5d6336,_0x2ed689){_0x5d6336=_0x5d6336-0x0;var _0x5b0b22=_0xbbac[_0x5d6336];return _0x5b0b22;};'use strict';var _=require(_0xcbba('0x0'));var util=require(_0xcbba('0x1'));var moment=require(_0xcbba('0x2'));var BPromise=require(_0xcbba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbba('0x5'));var logger=require(_0xcbba('0x6'))(_0xcbba('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbba('0x8'));var client=jayson['client'][_0xcbba('0x9')]({'port':0x232a});config[_0xcbba('0xa')]=_[_0xcbba('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcbba('0xc'))(new Redis(config['redis']));require(_0xcbba('0xd'))[_0xcbba('0xe')](socket);function respondWithRpcPromise(_0xe02f5b,_0x4644ef,_0xc3072d){return new BPromise(function(_0x5e613f,_0x5f4bc6){return client[_0xcbba('0xf')](_0xe02f5b,_0xc3072d)[_0xcbba('0x10')](function(_0x105983){logger[_0xcbba('0x11')](_0xcbba('0x12'),_0x4644ef,_0xcbba('0x13'));logger[_0xcbba('0x14')](_0xcbba('0x15'),_0x4644ef,_0xcbba('0x13'),JSON['stringify'](_0x105983));if(_0x105983[_0xcbba('0x16')]){if(_0x105983[_0xcbba('0x16')][_0xcbba('0x17')]===0x1f4){logger[_0xcbba('0x16')](_0xcbba('0x12'),_0x4644ef,_0x105983[_0xcbba('0x16')][_0xcbba('0x18')]);return _0x5f4bc6(_0x105983[_0xcbba('0x16')]['message']);}logger[_0xcbba('0x16')](_0xcbba('0x12'),_0x4644ef,_0x105983[_0xcbba('0x16')][_0xcbba('0x18')]);return _0x5e613f(_0x105983[_0xcbba('0x16')][_0xcbba('0x18')]);}else{logger[_0xcbba('0x11')](_0xcbba('0x12'),_0x4644ef,_0xcbba('0x13'));_0x5e613f(_0x105983[_0xcbba('0x19')][_0xcbba('0x18')]);}})[_0xcbba('0x1a')](function(_0x59da17){logger[_0xcbba('0x16')](_0xcbba('0x12'),_0x4644ef,_0x59da17);_0x5f4bc6(_0x59da17);});});}exports[_0xcbba('0x1b')]=function(_0x14ccaf){var _0x53bb8d=this;return new Promise(function(_0x1e0c2f,_0x5b081c){return db[_0xcbba('0x1c')][_0xcbba('0x1d')](_0x14ccaf['body'],{'raw':_0x14ccaf['options']?_0x14ccaf['options']['raw']===undefined?!![]:![]:!![]})[_0xcbba('0x10')](function(_0x5d9b58){logger[_0xcbba('0x11')](_0xcbba('0x1b'),_0x14ccaf);logger['debug'](_0xcbba('0x1b'),_0x14ccaf,JSON[_0xcbba('0x1e')](_0x5d9b58));_0x1e0c2f(_0x5d9b58);})[_0xcbba('0x1a')](function(_0x5eab49){logger[_0xcbba('0x16')](_0xcbba('0x1b'),_0x5eab49['message'],_0x14ccaf);_0x5b081c(_0x53bb8d[_0xcbba('0x16')](0x1f4,_0x5eab49[_0xcbba('0x18')]));});});}; \ No newline at end of file +var _0x8a87=['rpc','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','create','options','raw','then','CreateChatMessage','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b1f5f,_0x5c2497){var _0x1f91ac=function(_0x11e203){while(--_0x11e203){_0x5b1f5f['push'](_0x5b1f5f['shift']());}};_0x1f91ac(++_0x5c2497);}(_0x8a87,0x6b));var _0x78a8=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x8a87[_0x377fb1];return _0x3248e9;};'use strict';var _=require(_0x78a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78a8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78a8('0x2'));var db=require(_0x78a8('0x3'))['db'];var utils=require(_0x78a8('0x4'));var logger=require('../../config/logger')(_0x78a8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x78a8('0x6')][_0x78a8('0x7')]({'port':0x232a});config[_0x78a8('0x8')]=_[_0x78a8('0x9')](config[_0x78a8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x78a8('0xa'))(new Redis(config['redis']));require(_0x78a8('0xb'))['register'](socket);function respondWithRpcPromise(_0xc686c2,_0x2c90ab,_0x25bf0c){return new BPromise(function(_0x8e6cc,_0x2f7bbe){return client['request'](_0xc686c2,_0x25bf0c)['then'](function(_0x1acfb4){logger[_0x78a8('0xc')](_0x78a8('0xd'),_0x2c90ab,'request\x20sent');logger[_0x78a8('0xe')](_0x78a8('0xf'),_0x2c90ab,_0x78a8('0x10'),JSON[_0x78a8('0x11')](_0x1acfb4));if(_0x1acfb4['error']){if(_0x1acfb4[_0x78a8('0x12')][_0x78a8('0x13')]===0x1f4){logger[_0x78a8('0x12')](_0x78a8('0xd'),_0x2c90ab,_0x1acfb4[_0x78a8('0x12')][_0x78a8('0x14')]);return _0x2f7bbe(_0x1acfb4['error']['message']);}logger['error'](_0x78a8('0xd'),_0x2c90ab,_0x1acfb4[_0x78a8('0x12')][_0x78a8('0x14')]);return _0x8e6cc(_0x1acfb4[_0x78a8('0x12')][_0x78a8('0x14')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2c90ab,_0x78a8('0x10'));_0x8e6cc(_0x1acfb4[_0x78a8('0x15')]['message']);}})[_0x78a8('0x16')](function(_0x31c76b){logger['error'](_0x78a8('0xd'),_0x2c90ab,_0x31c76b);_0x2f7bbe(_0x31c76b);});});}exports['CreateChatMessage']=function(_0x5dd5ba){var _0x181237=this;return new Promise(function(_0xd91e6b,_0x14b31f){return db['ChatMessage'][_0x78a8('0x17')](_0x5dd5ba['body'],{'raw':_0x5dd5ba['options']?_0x5dd5ba[_0x78a8('0x18')][_0x78a8('0x19')]===undefined?!![]:![]:!![]})[_0x78a8('0x1a')](function(_0x257d3a){logger[_0x78a8('0xc')](_0x78a8('0x1b'),_0x5dd5ba);logger[_0x78a8('0xe')]('CreateChatMessage',_0x5dd5ba,JSON[_0x78a8('0x11')](_0x257d3a));_0xd91e6b(_0x257d3a);})['catch'](function(_0x2737b4){logger[_0x78a8('0x12')](_0x78a8('0x1b'),_0x2737b4[_0x78a8('0x14')],_0x5dd5ba);_0x14b31f(_0x181237[_0x78a8('0x12')](0x1f4,_0x2737b4[_0x78a8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 67ce59b..ff35c72 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 _0x5292=['length','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0xbd0b9e,_0x56b6e3){var _0x5b4815=function(_0x599340){while(--_0x599340){_0xbd0b9e['push'](_0xbd0b9e['shift']());}};_0x5b4815(++_0x56b6e3);}(_0x5292,0xf7));var _0x2529=function(_0xc0754,_0x37f107){_0xc0754=_0xc0754-0x0;var _0x195498=_0x5292[_0xc0754];return _0x195498;};'use strict';var ChatMessageEvents=require(_0x2529('0x0'));var events=[_0x2529('0x1'),'remove',_0x2529('0x2')];function createListener(_0x522ab4,_0x1540a9){return function(_0x2b088){_0x1540a9[_0x2529('0x3')](_0x522ab4,_0x2b088);};}function removeListener(_0x228165,_0x5d25dc){return function(){ChatMessageEvents[_0x2529('0x4')](_0x228165,_0x5d25dc);};}exports['register']=function(_0x4c9b4c){for(var _0x4e7a9e=0x0,_0x407277=events[_0x2529('0x5')];_0x4e7a9e<_0x407277;_0x4e7a9e++){var _0x5bb8a1=events[_0x4e7a9e];var _0x5c3355=createListener(_0x2529('0x6')+_0x5bb8a1,_0x4c9b4c);ChatMessageEvents['on'](_0x5bb8a1,_0x5c3355);}}; \ No newline at end of file +var _0xca8d=['register','length','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x443e1c,_0x229f8c){var _0x1a659a=function(_0x2b4b89){while(--_0x2b4b89){_0x443e1c['push'](_0x443e1c['shift']());}};_0x1a659a(++_0x229f8c);}(_0xca8d,0x172));var _0xdca8=function(_0x484209,_0x202d7d){_0x484209=_0x484209-0x0;var _0x5cc99f=_0xca8d[_0x484209];return _0x5cc99f;};'use strict';var ChatMessageEvents=require(_0xdca8('0x0'));var events=[_0xdca8('0x1'),_0xdca8('0x2'),_0xdca8('0x3')];function createListener(_0x25375b,_0x1f3c7b){return function(_0x1685a4){_0x1f3c7b[_0xdca8('0x4')](_0x25375b,_0x1685a4);};}function removeListener(_0x9e965e,_0x3bae79){return function(){ChatMessageEvents[_0xdca8('0x5')](_0x9e965e,_0x3bae79);};}exports[_0xdca8('0x6')]=function(_0x4d6383){for(var _0x3366d5=0x0,_0x1d18ba=events[_0xdca8('0x7')];_0x3366d5<_0x1d18ba;_0x3366d5++){var _0x2f034e=events[_0x3366d5];var _0x152d05=createListener('chatMessage:'+_0x2f034e,_0x4d6383);ChatMessageEvents['on'](_0x2f034e,_0x152d05);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 9d2c1f0..52b86c5 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 _0xd471=['/:id/reject','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','tracked','chatmessage:create','update','put','/:id/accept','accept'];(function(_0x33205a,_0x4a8239){var _0x4bce9d=function(_0x369478){while(--_0x369478){_0x33205a['push'](_0x33205a['shift']());}};_0x4bce9d(++_0x4a8239);}(_0xd471,0xc9));var _0x1d47=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xd471[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d47('0x0'));var timeout=require(_0x1d47('0x1'));var express=require('express');var router=express[_0x1d47('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1d47('0x3'));var interaction=require(_0x1d47('0x4'));var config=require(_0x1d47('0x5'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d47('0x6')]);router[_0x1d47('0x7')](_0x1d47('0x8'),auth[_0x1d47('0x9')](),controller['describe']);router[_0x1d47('0x7')](_0x1d47('0xa'),auth[_0x1d47('0x9')](),controller[_0x1d47('0xb')]);router[_0x1d47('0xc')]('/',auth[_0x1d47('0x9')](),interaction[_0x1d47('0xd')]('chat',_0x1d47('0xe')),controller['create']);router['put'](_0x1d47('0xa'),controller[_0x1d47('0xf')]);router[_0x1d47('0x10')](_0x1d47('0x11'),auth[_0x1d47('0x9')](),controller[_0x1d47('0x12')]);router[_0x1d47('0x10')](_0x1d47('0x13'),auth[_0x1d47('0x9')](),controller['reject']);router[_0x1d47('0x14')](_0x1d47('0xa'),auth[_0x1d47('0x9')](),controller[_0x1d47('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe016=['create','update','put','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked'];(function(_0x395354,_0x403c0b){var _0x30f992=function(_0x57f1db){while(--_0x57f1db){_0x395354['push'](_0x395354['shift']());}};_0x30f992(++_0x403c0b);}(_0xe016,0xf2));var _0x6e01=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xe016[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require(_0x6e01('0x0'));var util=require(_0x6e01('0x1'));var path=require(_0x6e01('0x2'));var timeout=require(_0x6e01('0x3'));var express=require('express');var router=express[_0x6e01('0x4')]();var fs_extra=require(_0x6e01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6e01('0x6'));var config=require(_0x6e01('0x7'));var controller=require(_0x6e01('0x8'));router[_0x6e01('0x9')]('/',auth[_0x6e01('0xa')](),controller[_0x6e01('0xb')]);router[_0x6e01('0x9')](_0x6e01('0xc'),auth['isAuthenticated'](),controller[_0x6e01('0xd')]);router['get'](_0x6e01('0xe'),auth['isAuthenticated'](),controller[_0x6e01('0xf')]);router[_0x6e01('0x10')]('/',auth[_0x6e01('0xa')](),interaction[_0x6e01('0x11')]('chat','chatmessage:create'),controller[_0x6e01('0x12')]);router['put'](_0x6e01('0xe'),controller[_0x6e01('0x13')]);router[_0x6e01('0x14')](_0x6e01('0x15'),auth[_0x6e01('0xa')](),controller[_0x6e01('0x16')]);router[_0x6e01('0x14')]('/:id/reject',auth[_0x6e01('0xa')](),controller[_0x6e01('0x17')]);router[_0x6e01('0x18')](_0x6e01('0xe'),auth[_0x6e01('0xa')](),controller[_0x6e01('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 81dc262..c798bd9 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x20926f,_0x146f25){var _0x540524=function(_0x5db625){while(--_0x5db625){_0x20926f['push'](_0x20926f['shift']());}};_0x540524(++_0x146f25);}(_0xdb28,0x106));var _0x8db2=function(_0x54bc1e,_0x1c61ef){_0x54bc1e=_0x54bc1e-0x0;var _0x4cffdc=_0xdb28[_0x54bc1e];return _0x4cffdc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x539f98,_0x2279d0){var _0x2994c2=function(_0x492771){while(--_0x492771){_0x539f98['push'](_0x539f98['shift']());}};_0x2994c2(++_0x2279d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x45f064,_0x5c77f2){_0x45f064=_0x45f064-0x0;var _0x409513=_0x5f2f[_0x45f064];return _0x409513;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c173651..97b939a 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(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x369bcf,_0x22adca){_0x369bcf=_0x369bcf-0x0;var _0x4c8871=_0x7a54[_0x369bcf];return _0x4c8871;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0x435ef3,_0x49d1fc){_0x435ef3=_0x435ef3-0x0;var _0x483a8e=_0x7a54[_0x435ef3];return _0x483a8e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 00149fb..d7f44c6 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 _0x5c00=['hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2179f2,_0x2dff7c){var _0x236d1b=function(_0x3a0e47){while(--_0x3a0e47){_0x2179f2['push'](_0x2179f2['shift']());}};_0x236d1b(++_0x2dff7c);}(_0x5c00,0x19b));var _0x05c0=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x5c00[_0x455c6c];return _0x488242;};'use strict';var EventEmitter=require(_0x05c0('0x0'));var ChatOfflineMessage=require(_0x05c0('0x1'))['db'][_0x05c0('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x05c0('0x3')](0x0);var events={'afterCreate':_0x05c0('0x4'),'afterUpdate':_0x05c0('0x5'),'afterDestroy':_0x05c0('0x6')};function emitEvent(_0x4cb97b){return function(_0x4cb75d,_0x22c8d5,_0x4713ba){ChatOfflineMessageEvents[_0x05c0('0x7')](_0x4cb97b+':'+_0x4cb75d['id'],_0x4cb75d);ChatOfflineMessageEvents['emit'](_0x4cb97b,_0x4cb75d);_0x4713ba(null);};}for(var e in events){if(events[_0x05c0('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x05c0('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xcf6a=['ChatOfflineMessage','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5c4139,_0x12479e){var _0x5df4b6=function(_0xb532ce){while(--_0xb532ce){_0x5c4139['push'](_0x5c4139['shift']());}};_0x5df4b6(++_0x12479e);}(_0xcf6a,0xbb));var _0xacf6=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xcf6a[_0x5037ab];return _0x512adb;};'use strict';var EventEmitter=require(_0xacf6('0x0'));var ChatOfflineMessage=require(_0xacf6('0x1'))['db'][_0xacf6('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xacf6('0x3'),'afterDestroy':_0xacf6('0x4')};function emitEvent(_0x234816){return function(_0x870e11,_0xb1c6e4,_0x4d7ca0){ChatOfflineMessageEvents[_0xacf6('0x5')](_0x234816+':'+_0x870e11['id'],_0x870e11);ChatOfflineMessageEvents[_0xacf6('0x5')](_0x234816,_0x870e11);_0x4d7ca0(null);};}for(var e in events){if(events[_0xacf6('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xacf6('0x7')](e,emitEvent(event));}}module[_0xacf6('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index bc75ac1..3ccd38d 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 _0x997a=['./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x4e256a,_0x5eed92){var _0x220de2=function(_0x554d18){while(--_0x554d18){_0x4e256a['push'](_0x4e256a['shift']());}};_0x220de2(++_0x5eed92);}(_0x997a,0x1e0));var _0xa997=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x997a[_0x2c91e9];return _0x13f0ff;};'use strict';var attributes=require(_0xa997('0x0'));module['exports']=function(_0x521b79){return _0x521b79[_0xa997('0x1')](_0xa997('0x2'),attributes,{'tableName':_0xa997('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa997('0x4')});}; \ No newline at end of file +var _0xb14f=['utf8mb4','utf8mb4_unicode_ci','exports','chat_offline_messages'];(function(_0x2f35a2,_0x9c1ac){var _0x503004=function(_0x41186f){while(--_0x41186f){_0x2f35a2['push'](_0x2f35a2['shift']());}};_0x503004(++_0x9c1ac);}(_0xb14f,0x8e));var _0xfb14=function(_0x55ad64,_0x1d70af){_0x55ad64=_0x55ad64-0x0;var _0x574d25=_0xb14f[_0x55ad64];return _0x574d25;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xfb14('0x0')]=function(_0x18a269){return _0x18a269['define']('ChatOfflineMessage',attributes,{'tableName':_0xfb14('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb14('0x2'),'collate':_0xfb14('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index b71c724..124b4b6 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 _0x65ac=['stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2a93f0,_0x1f8fb7){var _0x439217=function(_0xe07912){while(--_0xe07912){_0x2a93f0['push'](_0x2a93f0['shift']());}};_0x439217(++_0x1f8fb7);}(_0x65ac,0x100));var _0xc65a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x65ac[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require(_0xc65a('0x0'));var moment=require(_0xc65a('0x1'));var BPromise=require(_0xc65a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc65a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc65a('0x4'));var logger=require('../../config/logger')(_0xc65a('0x5'));var config=require(_0xc65a('0x6'));var jayson=require(_0xc65a('0x7'));var client=jayson[_0xc65a('0x8')][_0xc65a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34e48b,_0x74b31c,_0x1cbea3){return new BPromise(function(_0x29d016,_0x7ac755){return client[_0xc65a('0xa')](_0x34e48b,_0x1cbea3)[_0xc65a('0xb')](function(_0x3d567d){logger[_0xc65a('0xc')](_0xc65a('0xd'),_0x74b31c,_0xc65a('0xe'));logger[_0xc65a('0xf')](_0xc65a('0x10'),_0x74b31c,_0xc65a('0xe'),JSON[_0xc65a('0x11')](_0x3d567d));if(_0x3d567d[_0xc65a('0x12')]){if(_0x3d567d[_0xc65a('0x12')][_0xc65a('0x13')]===0x1f4){logger[_0xc65a('0x12')](_0xc65a('0xd'),_0x74b31c,_0x3d567d['error'][_0xc65a('0x14')]);return _0x7ac755(_0x3d567d[_0xc65a('0x12')][_0xc65a('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x74b31c,_0x3d567d[_0xc65a('0x12')][_0xc65a('0x14')]);return _0x29d016(_0x3d567d['error'][_0xc65a('0x14')]);}else{logger['info'](_0xc65a('0xd'),_0x74b31c,_0xc65a('0xe'));_0x29d016(_0x3d567d['result'][_0xc65a('0x14')]);}})['catch'](function(_0x1b6821){logger['error'](_0xc65a('0xd'),_0x74b31c,_0x1b6821);_0x7ac755(_0x1b6821);});});} \ No newline at end of file +var _0x9c50=['message','catch','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x9c50,0xec));var _0x09c5=function(_0x53152c,_0x3ad9ae){_0x53152c=_0x53152c-0x0;var _0xae4f1=_0x9c50[_0x53152c];return _0xae4f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x09c5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09c5('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x09c5('0x2'))(_0x09c5('0x3'));var config=require('../../config/environment');var jayson=require(_0x09c5('0x4'));var client=jayson['client'][_0x09c5('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2830e5,_0x1f068b,_0x51ff47){return new BPromise(function(_0x27d297,_0x2ca015){return client[_0x09c5('0x6')](_0x2830e5,_0x51ff47)[_0x09c5('0x7')](function(_0x4a8703){logger[_0x09c5('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1f068b,'request\x20sent');logger[_0x09c5('0x9')](_0x09c5('0xa'),_0x1f068b,_0x09c5('0xb'),JSON[_0x09c5('0xc')](_0x4a8703));if(_0x4a8703['error']){if(_0x4a8703[_0x09c5('0xd')][_0x09c5('0xe')]===0x1f4){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x2ca015(_0x4a8703['error']['message']);}logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x27d297(_0x4a8703['error']['message']);}else{logger[_0x09c5('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1f068b,'request\x20sent');_0x27d297(_0x4a8703['result'][_0x09c5('0x10')]);}})[_0x09c5('0x11')](function(_0x3d160f){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x3d160f);_0x2ca015(_0x3d160f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 8c346cc..db5072d 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 _0x430d=['/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x430d,0xa6));var _0xd430=function(_0x3db1ad,_0x301265){_0x3db1ad=_0x3db1ad-0x0;var _0x5c1ecc=_0x430d[_0x3db1ad];return _0x5c1ecc;};'use strict';var multer=require(_0xd430('0x0'));var util=require(_0xd430('0x1'));var path=require(_0xd430('0x2'));var timeout=require(_0xd430('0x3'));var express=require(_0xd430('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd430('0x5'));var interaction=require(_0xd430('0x6'));var config=require(_0xd430('0x7'));var controller=require(_0xd430('0x8'));router[_0xd430('0x9')]('/',auth['isAuthenticated'](),controller[_0xd430('0xa')]);router[_0xd430('0x9')](_0xd430('0xb'),auth[_0xd430('0xc')](),controller[_0xd430('0xd')]);router[_0xd430('0x9')](_0xd430('0xe'),auth[_0xd430('0xc')](),controller[_0xd430('0xf')]);router[_0xd430('0x10')]('/',auth['isAuthenticated'](),controller[_0xd430('0x11')]);router[_0xd430('0x12')](_0xd430('0xe'),auth[_0xd430('0xc')](),controller['update']);router[_0xd430('0x13')](_0xd430('0xe'),auth[_0xd430('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x45bf=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5f4006,_0x5b9f3e){var _0x4c2897=function(_0x532296){while(--_0x532296){_0x5f4006['push'](_0x5f4006['shift']());}};_0x4c2897(++_0x5b9f3e);}(_0x45bf,0x11e));var _0xf45b=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x45bf[_0x541ea6];return _0x3c3e84;};'use strict';var multer=require(_0xf45b('0x0'));var util=require(_0xf45b('0x1'));var path=require('path');var timeout=require(_0xf45b('0x2'));var express=require(_0xf45b('0x3'));var router=express[_0xf45b('0x4')]();var fs_extra=require(_0xf45b('0x5'));var auth=require(_0xf45b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf45b('0x7'));var controller=require(_0xf45b('0x8'));router[_0xf45b('0x9')]('/',auth[_0xf45b('0xa')](),controller[_0xf45b('0xb')]);router[_0xf45b('0x9')](_0xf45b('0xc'),auth[_0xf45b('0xa')](),controller['describe']);router['get'](_0xf45b('0xd'),auth[_0xf45b('0xa')](),controller[_0xf45b('0xe')]);router[_0xf45b('0xf')]('/',auth['isAuthenticated'](),controller[_0xf45b('0x10')]);router[_0xf45b('0x11')](_0xf45b('0xd'),auth[_0xf45b('0xa')](),controller[_0xf45b('0x12')]);router[_0xf45b('0x13')](_0xf45b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xf45b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 22e1084..6866b2c 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 _0x5763=['sequelize','exports','ENUM','mouseOver','timeout','INTEGER'];(function(_0x33e789,_0x5dd88f){var _0x26e2d0=function(_0x4d71e3){while(--_0x4d71e3){_0x33e789['push'](_0x33e789['shift']());}};_0x26e2d0(++_0x5dd88f);}(_0x5763,0xfc));var _0x3576=function(_0x2934e8,_0x3a29e5){_0x2934e8=_0x2934e8-0x0;var _0x45d5b2=_0x5763[_0x2934e8];return _0x45d5b2;};'use strict';var Sequelize=require(_0x3576('0x0'));module[_0x3576('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3576('0x2')](_0x3576('0x3'),_0x3576('0x4')),'defaultValue':_0x3576('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3576('0x5')]}}; \ No newline at end of file +var _0x331e=['ENUM','mouseOver','timeout','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x331e,0x1b7));var _0xe331=function(_0xcc4d3a,_0x104f66){_0xcc4d3a=_0xcc4d3a-0x0;var _0x20bae1=_0x331e[_0xcc4d3a];return _0x20bae1;};'use strict';var Sequelize=require(_0xe331('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe331('0x1')](_0xe331('0x2'),_0xe331('0x3')),'defaultValue':_0xe331('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 96226b2..ec24842 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 _0x3937=['model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','params','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show'];(function(_0x1b1b6c,_0x491608){var _0x2fa48f=function(_0x57ff04){while(--_0x57ff04){_0x1b1b6c['push'](_0x1b1b6c['shift']());}};_0x2fa48f(++_0x491608);}(_0x3937,0xbf));var _0x7393=function(_0x365d6c,_0x4a9f6b){_0x365d6c=_0x365d6c-0x0;var _0x13980e=_0x3937[_0x365d6c];return _0x13980e;};'use strict';var emlformat=require(_0x7393('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7393('0x1'));var jsonpatch=require(_0x7393('0x2'));var rp=require('request-promise');var moment=require(_0x7393('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7393('0x4'));var util=require('util');var path=require(_0x7393('0x5'));var sox=require(_0x7393('0x6'));var csv=require(_0x7393('0x7'));var ejs=require(_0x7393('0x8'));var fs=require('fs');var fs_extra=require(_0x7393('0x9'));var _=require(_0x7393('0xa'));var squel=require(_0x7393('0xb'));var crypto=require(_0x7393('0xc'));var jsforce=require(_0x7393('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7393('0xe'));var Papa=require(_0x7393('0xf'));var Redis=require(_0x7393('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7393('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7393('0x12'));var config=require(_0x7393('0x13'));var licenseUtil=require(_0x7393('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79fc4e,_0x470f09){_0x470f09=_0x470f09||0xcc;return function(_0x20fb41){if(_0x20fb41){return _0x79fc4e[_0x7393('0x15')](_0x470f09);}return _0x79fc4e[_0x7393('0x16')](_0x470f09)[_0x7393('0x17')]();};}function respondWithResult(_0x38eaad,_0x212f44){_0x212f44=_0x212f44||0xc8;return function(_0x11030d){if(_0x11030d){return _0x38eaad['status'](_0x212f44)['json'](_0x11030d);}};}function respondWithFilteredResult(_0x414c37,_0x5d0d2b){return function(_0x5b91a9){if(_0x5b91a9){var _0x4e7ec6=typeof _0x5d0d2b[_0x7393('0x18')]==='undefined'&&typeof _0x5d0d2b[_0x7393('0x19')]===_0x7393('0x1a');var _0x5b8b03=_0x5b91a9[_0x7393('0x1b')];var _0x5745cb=_0x4e7ec6?0x0:_0x5d0d2b['offset'];var _0x31c8c2=_0x4e7ec6?_0x5b91a9[_0x7393('0x1b')]:_0x5d0d2b[_0x7393('0x18')]+_0x5d0d2b[_0x7393('0x19')];var _0x31902f;if(_0x31c8c2>=_0x5b8b03){_0x31c8c2=_0x5b8b03;_0x31902f=0xc8;}else{_0x31902f=0xce;}_0x414c37[_0x7393('0x16')](_0x31902f);return _0x414c37[_0x7393('0x1c')](_0x7393('0x1d'),_0x5745cb+'-'+_0x31c8c2+'/'+_0x5b8b03)['json'](_0x5b91a9);}return null;};}function patchUpdates(_0x52cd6a){return function(_0x30eae3){try{jsonpatch[_0x7393('0x1e')](_0x30eae3,_0x52cd6a,!![]);}catch(_0x3979b7){return BPromise[_0x7393('0x1f')](_0x3979b7);}return _0x30eae3[_0x7393('0x20')]();};}function saveUpdates(_0x52f716,_0x4d7870){return function(_0x544487){if(_0x544487){return _0x544487[_0x7393('0x21')](_0x52f716)['then'](function(_0x4cfdf6){return _0x4cfdf6;});}return null;};}function removeEntity(_0x2bf7a9,_0xa8f852){return function(_0x5b4498){if(_0x5b4498){return _0x5b4498[_0x7393('0x22')]()[_0x7393('0x23')](function(){_0x2bf7a9[_0x7393('0x16')](0xcc)[_0x7393('0x17')]();});}};}function handleEntityNotFound(_0x3fe456,_0x2c025f){return function(_0x1b31b8){if(!_0x1b31b8){_0x3fe456[_0x7393('0x15')](0x194);}return _0x1b31b8;};}function handleError(_0x328c47,_0x3d8773){_0x3d8773=_0x3d8773||0x1f4;return function(_0x1d7188){logger[_0x7393('0x24')](_0x1d7188[_0x7393('0x25')]);if(_0x1d7188['name']){delete _0x1d7188[_0x7393('0x26')];}_0x328c47[_0x7393('0x16')](_0x3d8773)[_0x7393('0x27')](_0x1d7188);};}exports[_0x7393('0x28')]=function(_0x1013aa,_0xd8dfae){var _0x4a865e={'raw':!![],'where':{'id':_0x1013aa['params']['id']}},_0x850b37={};_0x850b37[_0x7393('0x29')]=_['keys'](db[_0x7393('0x2a')][_0x7393('0x2b')]);_0x850b37[_0x7393('0x2c')]=_[_0x7393('0x2d')](_0x1013aa[_0x7393('0x2c')]);_0x850b37[_0x7393('0x2e')]=_[_0x7393('0x2f')](_0x850b37[_0x7393('0x29')],_0x850b37[_0x7393('0x2c')]);_0x4a865e[_0x7393('0x30')]=_[_0x7393('0x2f')](_0x850b37[_0x7393('0x29')],qs['fields'](_0x1013aa['query'][_0x7393('0x31')]));_0x4a865e['attributes']=_0x4a865e[_0x7393('0x30')]['length']?_0x4a865e[_0x7393('0x30')]:_0x850b37['model'];if(_0x1013aa[_0x7393('0x2c')][_0x7393('0x32')]){_0x4a865e[_0x7393('0x33')]=[{'all':!![]}];}_0x4a865e=_[_0x7393('0x34')]({},_0x4a865e,_0x1013aa[_0x7393('0x35')]);return db[_0x7393('0x2a')][_0x7393('0x36')](_0x4a865e)[_0x7393('0x23')](handleEntityNotFound(_0xd8dfae,null))[_0x7393('0x23')](respondWithResult(_0xd8dfae,null))[_0x7393('0x37')](handleError(_0xd8dfae,null));};exports['create']=function(_0x17e110,_0x4c957d){return db[_0x7393('0x2a')]['create'](_0x17e110[_0x7393('0x38')],{})[_0x7393('0x23')](respondWithResult(_0x4c957d,0xc9))[_0x7393('0x37')](handleError(_0x4c957d,null));};exports[_0x7393('0x21')]=function(_0x121d48,_0x487a9b){if(_0x121d48[_0x7393('0x38')]['id']){delete _0x121d48['body']['id'];}return db[_0x7393('0x2a')][_0x7393('0x36')]({'where':{'id':_0x121d48[_0x7393('0x39')]['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x487a9b,null))[_0x7393('0x23')](saveUpdates(_0x121d48['body'],null))['then'](respondWithResult(_0x487a9b,null))[_0x7393('0x37')](handleError(_0x487a9b,null));};exports[_0x7393('0x22')]=function(_0xe44b1e,_0x327d2e){return db['ChatProactiveAction']['find']({'where':{'id':_0xe44b1e['params']['id']}})[_0x7393('0x23')](handleEntityNotFound(_0x327d2e,null))[_0x7393('0x23')](removeEntity(_0x327d2e,null))[_0x7393('0x37')](handleError(_0x327d2e,null));}; \ No newline at end of file +var _0x37cc=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x5982ca,_0x7c6e){var _0x41052c=function(_0x11734b){while(--_0x11734b){_0x5982ca['push'](_0x5982ca['shift']());}};_0x41052c(++_0x7c6e);}(_0x37cc,0x185));var _0xc37c=function(_0x4fa85b,_0x26e9bc){_0x4fa85b=_0x4fa85b-0x0;var _0x126e5c=_0x37cc[_0x4fa85b];return _0x126e5c;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require(_0xc37c('0x1'));var zipdir=require(_0xc37c('0x2'));var jsonpatch=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var moment=require(_0xc37c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc37c('0x6'));var path=require(_0xc37c('0x7'));var sox=require(_0xc37c('0x8'));var csv=require(_0xc37c('0x9'));var ejs=require(_0xc37c('0xa'));var fs=require('fs');var fs_extra=require(_0xc37c('0xb'));var _=require(_0xc37c('0xc'));var squel=require(_0xc37c('0xd'));var crypto=require(_0xc37c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc37c('0xf'));var toCsv=require(_0xc37c('0x9'));var querystring=require(_0xc37c('0x10'));var Papa=require(_0xc37c('0x11'));var Redis=require(_0xc37c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc37c('0x13'));var as=require(_0xc37c('0x14'));var hardwareService=require(_0xc37c('0x15'));var logger=require(_0xc37c('0x16'))(_0xc37c('0x17'));var utils=require(_0xc37c('0x18'));var config=require(_0xc37c('0x19'));var licenseUtil=require(_0xc37c('0x1a'));var db=require(_0xc37c('0x1b'))['db'];function respondWithStatusCode(_0xd90fc8,_0x43392c){_0x43392c=_0x43392c||0xcc;return function(_0x56ce39){if(_0x56ce39){return _0xd90fc8['sendStatus'](_0x43392c);}return _0xd90fc8[_0xc37c('0x1c')](_0x43392c)[_0xc37c('0x1d')]();};}function respondWithResult(_0x2d87c1,_0xac116d){_0xac116d=_0xac116d||0xc8;return function(_0x2dc501){if(_0x2dc501){return _0x2d87c1[_0xc37c('0x1c')](_0xac116d)['json'](_0x2dc501);}};}function respondWithFilteredResult(_0x329793,_0x500a3b){return function(_0x5b05f8){if(_0x5b05f8){var _0x128d81=typeof _0x500a3b[_0xc37c('0x1e')]===_0xc37c('0x1f')&&typeof _0x500a3b[_0xc37c('0x20')]==='undefined';var _0x577165=_0x5b05f8['count'];var _0x2d6129=_0x128d81?0x0:_0x500a3b['offset'];var _0x370c2f=_0x128d81?_0x5b05f8[_0xc37c('0x21')]:_0x500a3b['offset']+_0x500a3b[_0xc37c('0x20')];var _0x438e42;if(_0x370c2f>=_0x577165){_0x370c2f=_0x577165;_0x438e42=0xc8;}else{_0x438e42=0xce;}_0x329793[_0xc37c('0x1c')](_0x438e42);return _0x329793[_0xc37c('0x22')]('Content-Range',_0x2d6129+'-'+_0x370c2f+'/'+_0x577165)[_0xc37c('0x23')](_0x5b05f8);}return null;};}function patchUpdates(_0x4d3aa4){return function(_0x1f941b){try{jsonpatch[_0xc37c('0x24')](_0x1f941b,_0x4d3aa4,!![]);}catch(_0x237cc6){return BPromise[_0xc37c('0x25')](_0x237cc6);}return _0x1f941b[_0xc37c('0x26')]();};}function saveUpdates(_0x5e931a,_0x148334){return function(_0x33aa68){if(_0x33aa68){return _0x33aa68[_0xc37c('0x27')](_0x5e931a)[_0xc37c('0x28')](function(_0x358fc8){return _0x358fc8;});}return null;};}function removeEntity(_0x87a6a6,_0x15a392){return function(_0x70e0b5){if(_0x70e0b5){return _0x70e0b5[_0xc37c('0x29')]()[_0xc37c('0x28')](function(){_0x87a6a6[_0xc37c('0x1c')](0xcc)[_0xc37c('0x1d')]();});}};}function handleEntityNotFound(_0x3076fc,_0x59274a){return function(_0x214d0a){if(!_0x214d0a){_0x3076fc[_0xc37c('0x2a')](0x194);}return _0x214d0a;};}function handleError(_0x1d59fa,_0x484c43){_0x484c43=_0x484c43||0x1f4;return function(_0x53f062){logger[_0xc37c('0x2b')](_0x53f062[_0xc37c('0x2c')]);if(_0x53f062[_0xc37c('0x2d')]){delete _0x53f062[_0xc37c('0x2d')];}_0x1d59fa[_0xc37c('0x1c')](_0x484c43)[_0xc37c('0x2e')](_0x53f062);};}exports[_0xc37c('0x2f')]=function(_0x47266c,_0x5d13b3){var _0x14129d={'raw':!![],'where':{'id':_0x47266c[_0xc37c('0x30')]['id']}},_0x466094={};_0x466094[_0xc37c('0x31')]=_[_0xc37c('0x32')](db[_0xc37c('0x33')][_0xc37c('0x34')]);_0x466094[_0xc37c('0x35')]=_[_0xc37c('0x32')](_0x47266c[_0xc37c('0x35')]);_0x466094[_0xc37c('0x36')]=_[_0xc37c('0x37')](_0x466094[_0xc37c('0x31')],_0x466094['query']);_0x14129d[_0xc37c('0x38')]=_[_0xc37c('0x37')](_0x466094['model'],qs['fields'](_0x47266c[_0xc37c('0x35')][_0xc37c('0x39')]));_0x14129d[_0xc37c('0x38')]=_0x14129d['attributes'][_0xc37c('0x3a')]?_0x14129d['attributes']:_0x466094[_0xc37c('0x31')];if(_0x47266c[_0xc37c('0x35')]['includeAll']){_0x14129d[_0xc37c('0x3b')]=[{'all':!![]}];}_0x14129d=_[_0xc37c('0x3c')]({},_0x14129d,_0x47266c[_0xc37c('0x3d')]);return db[_0xc37c('0x33')][_0xc37c('0x3e')](_0x14129d)[_0xc37c('0x28')](handleEntityNotFound(_0x5d13b3,null))[_0xc37c('0x28')](respondWithResult(_0x5d13b3,null))['catch'](handleError(_0x5d13b3,null));};exports['create']=function(_0xef4b6c,_0x289f83){return db[_0xc37c('0x33')][_0xc37c('0x3f')](_0xef4b6c['body'],{})[_0xc37c('0x28')](respondWithResult(_0x289f83,0xc9))[_0xc37c('0x40')](handleError(_0x289f83,null));};exports[_0xc37c('0x27')]=function(_0x5d30b7,_0x2ae478){if(_0x5d30b7[_0xc37c('0x41')]['id']){delete _0x5d30b7['body']['id'];}return db[_0xc37c('0x33')][_0xc37c('0x3e')]({'where':{'id':_0x5d30b7['params']['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0x2ae478,null))[_0xc37c('0x28')](saveUpdates(_0x5d30b7[_0xc37c('0x41')],null))[_0xc37c('0x28')](respondWithResult(_0x2ae478,null))[_0xc37c('0x40')](handleError(_0x2ae478,null));};exports[_0xc37c('0x29')]=function(_0xccc652,_0xfed425){return db[_0xc37c('0x33')][_0xc37c('0x3e')]({'where':{'id':_0xccc652[_0xc37c('0x30')]['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0xfed425,null))[_0xc37c('0x28')](removeEntity(_0xfed425,null))[_0xc37c('0x40')](handleError(_0xfed425,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 42791fb..362ae06 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 _0xeade=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x13c7f2,_0x1125e2){var _0x4acc31=function(_0x39dc31){while(--_0x39dc31){_0x13c7f2['push'](_0x13c7f2['shift']());}};_0x4acc31(++_0x1125e2);}(_0xeade,0x77));var _0xeead=function(_0x5872cb,_0x3ea3e1){_0x5872cb=_0x5872cb-0x0;var _0xe0e5a1=_0xeade[_0x5872cb];return _0xe0e5a1;};'use strict';var _=require(_0xeead('0x0'));var util=require(_0xeead('0x1'));var logger=require(_0xeead('0x2'))(_0xeead('0x3'));var moment=require(_0xeead('0x4'));var BPromise=require(_0xeead('0x5'));var rp=require(_0xeead('0x6'));var fs=require('fs');var path=require(_0xeead('0x7'));var rimraf=require(_0xeead('0x8'));var config=require(_0xeead('0x9'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x32fadf,_0x38a0e4){return _0x32fadf[_0xeead('0xa')](_0xeead('0xb'),attributes,{'tableName':_0xeead('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef4a=['exports','define','ChatProactiveAction','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x44a206,_0x5bcab9){var _0x5cc243=function(_0xe9a829){while(--_0xe9a829){_0x44a206['push'](_0x44a206['shift']());}};_0x5cc243(++_0x5bcab9);}(_0xef4a,0x12b));var _0xaef4=function(_0x3595de,_0x43ab3b){_0x3595de=_0x3595de-0x0;var _0x58a255=_0xef4a[_0x3595de];return _0x58a255;};'use strict';var _=require('lodash');var util=require(_0xaef4('0x0'));var logger=require(_0xaef4('0x1'))('api');var moment=require(_0xaef4('0x2'));var BPromise=require('bluebird');var rp=require(_0xaef4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaef4('0x4'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xaef4('0x5')]=function(_0x4ea611,_0x44bc53){return _0x4ea611[_0xaef4('0x6')](_0xaef4('0x7'),attributes,{'tableName':'chat_proactive_actions','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 fb7d2a2..2f234ed 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 _0xb82c=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xb82c,0x171));var _0xcb82=function(_0x5480e5,_0x52e354){_0x5480e5=_0x5480e5-0x0;var _0x20b7cc=_0xb82c[_0x5480e5];return _0x20b7cc;};'use strict';var _=require(_0xcb82('0x0'));var util=require(_0xcb82('0x1'));var moment=require(_0xcb82('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb82('0x3'));var fs=require('fs');var Redis=require(_0xcb82('0x4'));var db=require(_0xcb82('0x5'))['db'];var utils=require(_0xcb82('0x6'));var logger=require(_0xcb82('0x7'))(_0xcb82('0x8'));var config=require('../../config/environment');var jayson=require(_0xcb82('0x9'));var client=jayson[_0xcb82('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6970,_0x66308f,_0x28778e){return new BPromise(function(_0x343345,_0x2e511c){return client[_0xcb82('0xb')](_0x2e6970,_0x28778e)['then'](function(_0x396fae){logger[_0xcb82('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x66308f,'request\x20sent');logger[_0xcb82('0xd')](_0xcb82('0xe'),_0x66308f,_0xcb82('0xf'),JSON[_0xcb82('0x10')](_0x396fae));if(_0x396fae['error']){if(_0x396fae[_0xcb82('0x11')][_0xcb82('0x12')]===0x1f4){logger[_0xcb82('0x11')](_0xcb82('0x13'),_0x66308f,_0x396fae['error']['message']);return _0x2e511c(_0x396fae['error'][_0xcb82('0x14')]);}logger['error'](_0xcb82('0x13'),_0x66308f,_0x396fae[_0xcb82('0x11')][_0xcb82('0x14')]);return _0x343345(_0x396fae[_0xcb82('0x11')][_0xcb82('0x14')]);}else{logger[_0xcb82('0xc')](_0xcb82('0x13'),_0x66308f,_0xcb82('0xf'));_0x343345(_0x396fae[_0xcb82('0x15')][_0xcb82('0x14')]);}})[_0xcb82('0x16')](function(_0x2aebab){logger[_0xcb82('0x11')](_0xcb82('0x13'),_0x66308f,_0x2aebab);_0x2e511c(_0x2aebab);});});} \ No newline at end of file +var _0x9c90=['rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0x9c90,0x1b1));var _0x09c9=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x9c90[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x09c9('0x0'));var util=require(_0x09c9('0x1'));var moment=require(_0x09c9('0x2'));var BPromise=require(_0x09c9('0x3'));var rs=require(_0x09c9('0x4'));var fs=require('fs');var Redis=require(_0x09c9('0x5'));var db=require(_0x09c9('0x6'))['db'];var utils=require(_0x09c9('0x7'));var logger=require(_0x09c9('0x8'))(_0x09c9('0x9'));var config=require(_0x09c9('0xa'));var jayson=require(_0x09c9('0xb'));var client=jayson[_0x09c9('0xc')][_0x09c9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15af2b,_0x31248c,_0x8889ee){return new BPromise(function(_0xd4b363,_0x336643){return client[_0x09c9('0xe')](_0x15af2b,_0x8889ee)['then'](function(_0x79e5c5){logger[_0x09c9('0xf')](_0x09c9('0x10'),_0x31248c,_0x09c9('0x11'));logger[_0x09c9('0x12')](_0x09c9('0x13'),_0x31248c,_0x09c9('0x11'),JSON[_0x09c9('0x14')](_0x79e5c5));if(_0x79e5c5['error']){if(_0x79e5c5['error'][_0x09c9('0x15')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x31248c,_0x79e5c5[_0x09c9('0x16')][_0x09c9('0x17')]);return _0x336643(_0x79e5c5['error'][_0x09c9('0x17')]);}logger[_0x09c9('0x16')](_0x09c9('0x10'),_0x31248c,_0x79e5c5['error'][_0x09c9('0x17')]);return _0xd4b363(_0x79e5c5[_0x09c9('0x16')][_0x09c9('0x17')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x31248c,_0x09c9('0x11'));_0xd4b363(_0x79e5c5[_0x09c9('0x18')][_0x09c9('0x17')]);}})[_0x09c9('0x19')](function(_0x5c5087){logger[_0x09c9('0x16')](_0x09c9('0x10'),_0x31248c,_0x5c5087);_0x336643(_0x5c5087);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d44c079..745a333 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x101292,_0x1c0c00){var _0x3e3db1=function(_0x2c30e7){while(--_0x2c30e7){_0x101292['push'](_0x101292['shift']());}};_0x3e3db1(++_0x1c0c00);}(_0xee14,0x13a));var _0x4ee1=function(_0x2eb40e,_0x41425f){_0x2eb40e=_0x2eb40e-0x0;var _0x57ed1a=_0xee14[_0x2eb40e];return _0x57ed1a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router; \ No newline at end of file +var _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x98c834,_0xbb9afa){var _0x5c7f5c=function(_0x4c8b3c){while(--_0x4c8b3c){_0x98c834['push'](_0x98c834['shift']());}};_0x5c7f5c(++_0xbb9afa);}(_0xe14b,0x93));var _0xbe14=function(_0xdd0017,_0x5d8d6b){_0xdd0017=_0xdd0017-0x0;var _0x45e60b=_0xe14b[_0xdd0017];return _0x45e60b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 46f4b94..f7832f9 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 _0xf8d8=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x23f4d7,_0xebd823){var _0x150b3d=function(_0x52cca7){while(--_0x52cca7){_0x23f4d7['push'](_0x23f4d7['shift']());}};_0x150b3d(++_0xebd823);}(_0xf8d8,0x113));var _0x8f8d=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xf8d8[_0x1bb812];return _0x372adb;};'use strict';var Sequelize=require('sequelize');module[_0x8f8d('0x0')]={'name':{'type':Sequelize[_0x8f8d('0x1')],'unique':_0x8f8d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f8d('0x1')]},'timeout':{'type':Sequelize[_0x8f8d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f8d('0x4')](_0x8f8d('0x5'),_0x8f8d('0x6'),_0x8f8d('0x7'))}}; \ No newline at end of file +var _0xabc4=['name','INTEGER','roundrobin','exports','STRING'];(function(_0x2f246e,_0x27b5be){var _0x4779e=function(_0x5d3951){while(--_0x5d3951){_0x2f246e['push'](_0x2f246e['shift']());}};_0x4779e(++_0x27b5be);}(_0xabc4,0xad));var _0x4abc=function(_0xf53094,_0x7be480){_0xf53094=_0xf53094-0x0;var _0x2013b0=_0xabc4[_0xf53094];return _0x2013b0;};'use strict';var Sequelize=require('sequelize');module[_0x4abc('0x0')]={'name':{'type':Sequelize[_0x4abc('0x1')],'unique':_0x4abc('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4abc('0x1')]},'timeout':{'type':Sequelize[_0x4abc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x4abc('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 90e7a77..ffecef0 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 _0x5533=['online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','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','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','get','ChatQueues','UserProfileResource','destroy','end','stack','name','index','ChatQueue','rawAttributes','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Agents'];(function(_0x5cd157,_0x2ca5d7){var _0x4e7b0b=function(_0x119d5f){while(--_0x119d5f){_0x5cd157['push'](_0x5cd157['shift']());}};_0x4e7b0b(++_0x2ca5d7);}(_0x5533,0x150));var _0x3553=function(_0x7bb56b,_0x429679){_0x7bb56b=_0x7bb56b-0x0;var _0x211689=_0x5533[_0x7bb56b];return _0x211689;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3553('0x0'));var jsonpatch=require(_0x3553('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3553('0x2'));var Mustache=require(_0x3553('0x3'));var util=require(_0x3553('0x4'));var path=require(_0x3553('0x5'));var sox=require(_0x3553('0x6'));var csv=require(_0x3553('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3553('0x8'));var _=require(_0x3553('0x9'));var squel=require('squel');var crypto=require(_0x3553('0xa'));var jsforce=require(_0x3553('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3553('0x7'));var querystring=require(_0x3553('0xc'));var Papa=require('papaparse');var Redis=require(_0x3553('0xd'));var authService=require(_0x3553('0xe'));var qs=require(_0x3553('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3553('0x10'));var logger=require(_0x3553('0x11'))(_0x3553('0x12'));var utils=require(_0x3553('0x13'));var config=require(_0x3553('0x14'));var licenseUtil=require(_0x3553('0x15'));var db=require(_0x3553('0x16'))['db'];config[_0x3553('0x17')]=_[_0x3553('0x18')](config[_0x3553('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3553('0x19'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x3553('0x1a')](socket);var jayson=require(_0x3553('0x1b'));var client=jayson[_0x3553('0x1c')][_0x3553('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5c5c20,_0x1a272b,_0x443d6a,_0x2debc1){return new BPromise(function(_0x16f95a,_0x2f9e43){var _0x538026=_0x2debc1||client;return _0x538026[_0x3553('0x1e')](_0x5c5c20,_0x443d6a)[_0x3553('0x1f')](function(_0x308760){logger[_0x3553('0x20')](_0x3553('0x21'),_0x1a272b,_0x3553('0x22'));logger[_0x3553('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1a272b,_0x3553('0x22'),JSON[_0x3553('0x24')](_0x308760));if(_0x308760[_0x3553('0x25')]){if(_0x308760[_0x3553('0x25')][_0x3553('0x26')]===0x1f4){logger[_0x3553('0x25')](_0x3553('0x21'),_0x1a272b,_0x308760[_0x3553('0x25')][_0x3553('0x27')]);return _0x2f9e43(_0x308760[_0x3553('0x25')]['message']);}logger[_0x3553('0x25')]('ChatQueue,\x20%s,\x20%s',_0x1a272b,_0x308760[_0x3553('0x25')][_0x3553('0x27')]);return _0x16f95a(_0x308760[_0x3553('0x25')][_0x3553('0x27')]);}else{logger['info'](_0x3553('0x21'),_0x1a272b,_0x3553('0x22'));_0x16f95a(_0x308760['result']['message']);}})[_0x3553('0x28')](function(_0x8ed84a){logger[_0x3553('0x25')](_0x3553('0x21'),_0x1a272b,_0x8ed84a);_0x2f9e43(_0x8ed84a);});});}function respondWithStatusCode(_0x2c99b0,_0x4672ba){_0x4672ba=_0x4672ba||0xcc;return function(_0x2a9ff1){if(_0x2a9ff1){return _0x2c99b0[_0x3553('0x29')](_0x4672ba);}return _0x2c99b0[_0x3553('0x2a')](_0x4672ba)['end']();};}function respondWithResult(_0x4e9f64,_0x3478b8){_0x3478b8=_0x3478b8||0xc8;return function(_0x9dda47){if(_0x9dda47){return _0x4e9f64[_0x3553('0x2a')](_0x3478b8)[_0x3553('0x2b')](_0x9dda47);}};}function respondWithFilteredResult(_0x224292,_0x1fdf74){return function(_0x12d398){if(_0x12d398){var _0xfb1ab9=typeof _0x1fdf74[_0x3553('0x2c')]===_0x3553('0x2d')&&typeof _0x1fdf74[_0x3553('0x2e')]==='undefined';var _0x47be70=_0x12d398['count'];var _0x4d2c28=_0xfb1ab9?0x0:_0x1fdf74[_0x3553('0x2c')];var _0x2a94d5=_0xfb1ab9?_0x12d398[_0x3553('0x2f')]:_0x1fdf74[_0x3553('0x2c')]+_0x1fdf74[_0x3553('0x2e')];var _0xc384;if(_0x2a94d5>=_0x47be70){_0x2a94d5=_0x47be70;_0xc384=0xc8;}else{_0xc384=0xce;}_0x224292['status'](_0xc384);return _0x224292[_0x3553('0x30')](_0x3553('0x31'),_0x4d2c28+'-'+_0x2a94d5+'/'+_0x47be70)[_0x3553('0x2b')](_0x12d398);}return null;};}function patchUpdates(_0xc1ad2e){return function(_0x264859){try{jsonpatch['apply'](_0x264859,_0xc1ad2e,!![]);}catch(_0x4966d9){return BPromise['reject'](_0x4966d9);}return _0x264859[_0x3553('0x32')]();};}function saveUpdates(_0x1a73e0,_0x3ffeb1){return function(_0x3616dd){if(_0x3616dd){return _0x3616dd[_0x3553('0x33')](_0x1a73e0)[_0x3553('0x1f')](function(_0x3d786d){return _0x3d786d;});}return null;};}function removeEntity(_0x18855c,_0x2ff1f3){return function(_0x167865){if(_0x167865){return _0x167865['destroy']()[_0x3553('0x1f')](function(){var _0x262694=_0x167865[_0x3553('0x34')]({'plain':!![]});var _0x420d05=_0x3553('0x35');return db[_0x3553('0x36')][_0x3553('0x37')]({'where':{'type':_0x420d05,'resourceId':_0x262694['id']}})[_0x3553('0x1f')](function(){return _0x167865;});})['then'](function(){_0x18855c[_0x3553('0x2a')](0xcc)[_0x3553('0x38')]();});}};}function handleEntityNotFound(_0x472602,_0x13e32b){return function(_0x9f948d){if(!_0x9f948d){_0x472602[_0x3553('0x29')](0x194);}return _0x9f948d;};}function handleError(_0x184c61,_0x10dd4e){_0x10dd4e=_0x10dd4e||0x1f4;return function(_0x339cb8){logger['error'](_0x339cb8[_0x3553('0x39')]);if(_0x339cb8[_0x3553('0x3a')]){delete _0x339cb8[_0x3553('0x3a')];}_0x184c61['status'](_0x10dd4e)['send'](_0x339cb8);};}exports[_0x3553('0x3b')]=function(_0x3baac0,_0x2589dd){var _0x40874b={},_0x2312d8={},_0xbcef17={'count':0x0,'rows':[]};var _0x1642c8=_['map'](db[_0x3553('0x3c')][_0x3553('0x3d')],function(_0x565e71){return{'name':_0x565e71['fieldName'],'type':_0x565e71['type']['key']};});_0x2312d8['model']=_[_0x3553('0x3e')](_0x1642c8,'name');_0x2312d8[_0x3553('0x3f')]=_['keys'](_0x3baac0[_0x3553('0x3f')]);_0x2312d8[_0x3553('0x40')]=_[_0x3553('0x41')](_0x2312d8[_0x3553('0x42')],_0x2312d8[_0x3553('0x3f')]);_0x40874b['attributes']=_[_0x3553('0x41')](_0x2312d8['model'],qs[_0x3553('0x43')](_0x3baac0[_0x3553('0x3f')][_0x3553('0x43')]));_0x40874b[_0x3553('0x44')]=_0x40874b['attributes']['length']?_0x40874b[_0x3553('0x44')]:_0x2312d8[_0x3553('0x42')];if(!_0x3baac0['query'][_0x3553('0x45')](_0x3553('0x46'))){_0x40874b['limit']=qs[_0x3553('0x2e')](_0x3baac0[_0x3553('0x3f')][_0x3553('0x2e')]);_0x40874b[_0x3553('0x2c')]=qs['offset'](_0x3baac0[_0x3553('0x3f')]['offset']);}_0x40874b[_0x3553('0x47')]=qs[_0x3553('0x48')](_0x3baac0[_0x3553('0x3f')][_0x3553('0x48')]);_0x40874b[_0x3553('0x49')]=qs[_0x3553('0x40')](_[_0x3553('0x4a')](_0x3baac0[_0x3553('0x3f')],_0x2312d8[_0x3553('0x40')]),_0x1642c8);if(_0x3baac0[_0x3553('0x3f')][_0x3553('0x4b')]){_0x40874b['where']=_[_0x3553('0x4c')](_0x40874b['where'],{'$or':_[_0x3553('0x3e')](_0x1642c8,function(_0x453d49){if(_0x453d49[_0x3553('0x4d')]!==_0x3553('0x4e')){var _0x6e4a14={};_0x6e4a14[_0x453d49[_0x3553('0x3a')]]={'$like':'%'+_0x3baac0[_0x3553('0x3f')][_0x3553('0x4b')]+'%'};return _0x6e4a14;}})});}_0x40874b=_[_0x3553('0x4c')]({},_0x40874b,_0x3baac0[_0x3553('0x4f')]);var _0x5dbe6b={'where':_0x40874b['where']};return db['ChatQueue'][_0x3553('0x2f')](_0x5dbe6b)[_0x3553('0x1f')](function(_0x2141fe){_0xbcef17[_0x3553('0x2f')]=_0x2141fe;if(_0x3baac0['query']['includeAll']){_0x40874b['include']=[{'all':!![]}];}return db['ChatQueue'][_0x3553('0x50')](_0x40874b);})['then'](function(_0x2de02e){_0xbcef17[_0x3553('0x51')]=_0x2de02e;return _0xbcef17;})[_0x3553('0x1f')](respondWithFilteredResult(_0x2589dd,_0x40874b))['catch'](handleError(_0x2589dd,null));};exports[_0x3553('0x52')]=function(_0x309cb3,_0x2df708){var _0x3d5da9={'raw':!![],'where':{'id':_0x309cb3[_0x3553('0x53')]['id']}},_0x2bb974={};_0x2bb974[_0x3553('0x42')]=_['keys'](db[_0x3553('0x3c')]['rawAttributes']);_0x2bb974[_0x3553('0x3f')]=_[_0x3553('0x54')](_0x309cb3[_0x3553('0x3f')]);_0x2bb974[_0x3553('0x40')]=_[_0x3553('0x41')](_0x2bb974[_0x3553('0x42')],_0x2bb974[_0x3553('0x3f')]);_0x3d5da9[_0x3553('0x44')]=_['intersection'](_0x2bb974['model'],qs[_0x3553('0x43')](_0x309cb3[_0x3553('0x3f')][_0x3553('0x43')]));_0x3d5da9['attributes']=_0x3d5da9['attributes'][_0x3553('0x55')]?_0x3d5da9['attributes']:_0x2bb974[_0x3553('0x42')];if(_0x309cb3[_0x3553('0x3f')]['includeAll']){_0x3d5da9[_0x3553('0x56')]=[{'all':!![]}];}_0x3d5da9=_[_0x3553('0x4c')]({},_0x3d5da9,_0x309cb3['options']);return db['ChatQueue'][_0x3553('0x57')](_0x3d5da9)['then'](handleEntityNotFound(_0x2df708,null))['then'](respondWithResult(_0x2df708,null))[_0x3553('0x28')](handleError(_0x2df708,null));};exports['create']=function(_0x4f3220,_0x565902){return db[_0x3553('0x3c')][_0x3553('0x58')](_0x4f3220[_0x3553('0x59')],{})['then'](function(_0x219a98){var _0x235baf=_0x4f3220[_0x3553('0x5a')][_0x3553('0x34')]({'plain':!![]});if(!_0x235baf)throw new Error(_0x3553('0x5b'));if(_0x235baf[_0x3553('0x5c')]===_0x3553('0x5a')){var _0x34f6ef=_0x219a98[_0x3553('0x34')]({'plain':!![]});var _0x4c0de7=_0x3553('0x35');return db[_0x3553('0x5d')]['find']({'where':{'name':_0x4c0de7,'userProfileId':_0x235baf[_0x3553('0x5e')]},'raw':!![]})[_0x3553('0x1f')](function(_0x50c55e){if(_0x50c55e&&_0x50c55e['autoAssociation']===0x0){return db[_0x3553('0x36')]['create']({'name':_0x34f6ef['name'],'resourceId':_0x34f6ef['id'],'type':_0x50c55e[_0x3553('0x3a')],'sectionId':_0x50c55e['id']},{})[_0x3553('0x1f')](function(){return _0x219a98;});}else{return _0x219a98;}})['catch'](function(_0x547478){logger[_0x3553('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x547478);throw _0x547478;});}return _0x219a98;})[_0x3553('0x1f')](respondWithResult(_0x565902,0xc9))['catch'](handleError(_0x565902,null));};exports[_0x3553('0x33')]=function(_0x2f33b5,_0x21c9e8){if(_0x2f33b5[_0x3553('0x59')]['id']){delete _0x2f33b5['body']['id'];}return db['ChatQueue'][_0x3553('0x57')]({'where':{'id':_0x2f33b5[_0x3553('0x53')]['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x21c9e8,null))['then'](saveUpdates(_0x2f33b5[_0x3553('0x59')],null))[_0x3553('0x1f')](respondWithResult(_0x21c9e8,null))[_0x3553('0x28')](handleError(_0x21c9e8,null));};exports[_0x3553('0x37')]=function(_0x33615b,_0x4d3149){return db['ChatQueue'][_0x3553('0x57')]({'where':{'id':_0x33615b[_0x3553('0x53')]['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x4d3149,null))[_0x3553('0x1f')](removeEntity(_0x4d3149,null))['catch'](handleError(_0x4d3149,null));};exports['describe']=function(_0x2d5450,_0x2f608a){return db[_0x3553('0x3c')]['describe']()[_0x3553('0x1f')](respondWithResult(_0x2f608a,null))['catch'](handleError(_0x2f608a,null));};exports[_0x3553('0x5f')]=function(_0xa789,_0x3f62e6,_0x2ea7e2){var _0x459f1d={'raw':!![],'where':{}},_0x1daa0a={},_0x5e0d04;return db['ChatQueue'][_0x3553('0x60')]({'where':{'id':_0xa789['params']['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x3f62e6,null))[_0x3553('0x1f')](function(_0x36ecca){if(_0x36ecca){_0x5e0d04=_0x36ecca['get']({'plain':!![]});_0x1daa0a[_0x3553('0x42')]=_['keys'](db['UserChatQueue'][_0x3553('0x3d')]);_0x1daa0a[_0x3553('0x3f')]=_[_0x3553('0x54')](_0xa789[_0x3553('0x3f')]);_0x1daa0a['filters']=_[_0x3553('0x41')](_0x1daa0a[_0x3553('0x42')],_0x1daa0a[_0x3553('0x3f')]);_0x459f1d[_0x3553('0x44')]=_[_0x3553('0x41')](_0x1daa0a[_0x3553('0x42')],qs[_0x3553('0x43')](_0xa789['query'][_0x3553('0x43')]));_0x459f1d[_0x3553('0x44')]=_0x459f1d[_0x3553('0x44')][_0x3553('0x55')]?_0x459f1d[_0x3553('0x44')]:_0x1daa0a[_0x3553('0x42')];if(!_0xa789[_0x3553('0x3f')][_0x3553('0x45')](_0x3553('0x46'))){_0x459f1d[_0x3553('0x2e')]=qs['limit'](_0xa789[_0x3553('0x3f')][_0x3553('0x2e')]);_0x459f1d[_0x3553('0x2c')]=qs[_0x3553('0x2c')](_0xa789['query'][_0x3553('0x2c')]);}_0x459f1d['order']=qs[_0x3553('0x48')](_0xa789[_0x3553('0x3f')]['sort']);_0x459f1d[_0x3553('0x49')]=qs[_0x3553('0x40')](_[_0x3553('0x4a')](_0xa789[_0x3553('0x3f')],_0x1daa0a[_0x3553('0x40')]));_0x459f1d[_0x3553('0x49')][_0x3553('0x61')]=_0x36ecca['id'];if(_0xa789[_0x3553('0x3f')][_0x3553('0x4b')]){_0x459f1d['where']=_[_0x3553('0x4c')](_0x459f1d['where'],{'$or':_['map'](_0x459f1d['attributes'],function(_0x328311){var _0x30cbe7={};_0x30cbe7[_0x328311]={'$like':'%'+_0xa789['query'][_0x3553('0x4b')]+'%'};return _0x30cbe7;})});}_0x459f1d=_[_0x3553('0x4c')]({},_0x459f1d,_0xa789[_0x3553('0x4f')]);return db[_0x3553('0x62')][_0x3553('0x50')](_0x459f1d);}})[_0x3553('0x1f')](function(_0x2b7264){if(_0x2b7264){return db[_0x3553('0x63')][_0x3553('0x64')]({'where':{'id':_['map'](_0x2b7264,'UserId'),'role':_0x3553('0x65')},'attributes':['id',_0x3553('0x3a'),_0x3553('0x66'),_0x3553('0x67'),_0x3553('0x68')]});}})['then'](function(_0x1d277a){if(_0x1d277a){return{'count':_0x1d277a['count'],'rows':_['map'](_0x1d277a[_0x3553('0x51')],function(_0x4db1b2){return{'membername':_0x4db1b2[_0x3553('0x3a')],'UserId':_0x4db1b2['id'],'queue_name':_0x5e0d04[_0x3553('0x3a')],'ChatQueueId':_0x5e0d04['id'],'interface':util['format'](_0x3553('0x69'),_0x3553('0x6a'),_0x4db1b2[_0x3553('0x3a')]),'penalty':0x0,'paused':_0x4db1b2[_0x3553('0x66')],'createdAt':_0x4db1b2[_0x3553('0x68')],'updatedAt':_0x4db1b2[_0x3553('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3553('0x1f')](respondWithFilteredResult(_0x3f62e6,_0x459f1d))[_0x3553('0x28')](handleError(_0x3f62e6,null));};exports[_0x3553('0x6b')]=function(_0x285955,_0x2ba921,_0x159161){var _0x2edd88={};var _0x415c57={};var _0x27711f;var _0x3abf0e;return db[_0x3553('0x3c')]['findOne']({'where':{'id':_0x285955[_0x3553('0x53')]['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x2ba921,null))[_0x3553('0x1f')](function(_0x5fe15){if(_0x5fe15){_0x27711f=_0x5fe15;_0x415c57['model']=_[_0x3553('0x54')](db['Team']['rawAttributes']);_0x415c57[_0x3553('0x3f')]=_[_0x3553('0x54')](_0x285955[_0x3553('0x3f')]);_0x415c57['filters']=_[_0x3553('0x41')](_0x415c57['model'],_0x415c57[_0x3553('0x3f')]);_0x2edd88[_0x3553('0x44')]=_[_0x3553('0x41')](_0x415c57[_0x3553('0x42')],qs[_0x3553('0x43')](_0x285955['query'][_0x3553('0x43')]));_0x2edd88[_0x3553('0x44')]=_0x2edd88[_0x3553('0x44')][_0x3553('0x55')]?_0x2edd88['attributes']:_0x415c57[_0x3553('0x42')];_0x2edd88[_0x3553('0x47')]=qs['sort'](_0x285955['query'][_0x3553('0x48')]);_0x2edd88[_0x3553('0x49')]=qs[_0x3553('0x40')](_[_0x3553('0x4a')](_0x285955['query'],_0x415c57['filters']));if(_0x285955[_0x3553('0x3f')][_0x3553('0x4b')]){_0x2edd88[_0x3553('0x49')]=_[_0x3553('0x4c')](_0x2edd88[_0x3553('0x49')],{'$or':_[_0x3553('0x3e')](_0x2edd88[_0x3553('0x44')],function(_0x5a0f66){var _0x4067ef={};_0x4067ef[_0x5a0f66]={'$like':'%'+_0x285955['query'][_0x3553('0x4b')]+'%'};return _0x4067ef;})});}_0x2edd88=_[_0x3553('0x4c')]({},_0x2edd88,_0x285955[_0x3553('0x4f')]);return _0x27711f[_0x3553('0x6b')](_0x2edd88);}})[_0x3553('0x1f')](function(_0x3e292d){if(_0x3e292d){_0x3abf0e=_0x3e292d['length'];if(!_0x285955[_0x3553('0x3f')][_0x3553('0x45')](_0x3553('0x46'))){_0x2edd88[_0x3553('0x2e')]=qs[_0x3553('0x2e')](_0x285955[_0x3553('0x3f')][_0x3553('0x2e')]);_0x2edd88['offset']=qs[_0x3553('0x2c')](_0x285955[_0x3553('0x3f')]['offset']);}return _0x27711f[_0x3553('0x6b')](_0x2edd88);}})['then'](function(_0x1c5ce0){if(_0x1c5ce0){return _0x1c5ce0?{'count':_0x3abf0e,'rows':_0x1c5ce0}:null;}})['then'](respondWithResult(_0x2ba921,null))[_0x3553('0x28')](handleError(_0x2ba921,null));};exports[_0x3553('0x6c')]=function(_0x3c4a66,_0x33c751,_0x34185a){var _0x3e7b72=_0x3c4a66[_0x3553('0x59')][_0x3553('0x6d')];return db['Team'][_0x3553('0x50')]({'where':{'id':_0x3e7b72},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3553('0x6e'),'attributes':['id',_0x3553('0x3a'),_0x3553('0x6f'),_0x3553('0x70'),_0x3553('0x71')],'raw':!![]}]})[_0x3553('0x1f')](function(_0x40176e){if(_0x40176e){var _0x1fc340=_[_0x3553('0x72')](_0x40176e,function(_0x5627c2){var _0x436da7=_0x5627c2[_0x3553('0x34')]({'plain':!![]});return _0x436da7[_0x3553('0x6e')];});return db['ChatQueue']['find']({'where':{'id':_0x3c4a66[_0x3553('0x53')]['id']}})[_0x3553('0x1f')](function(_0xc38a94){return db[_0x3553('0x73')][_0x3553('0x74')](function(_0x5ee55d){return _0xc38a94[_0x3553('0x6c')](_0x3e7b72,{'transaction':_0x5ee55d})[_0x3553('0x1f')](function(){return BPromise[_0x3553('0x75')](_0x1fc340,function(_0x7af417){return db[_0x3553('0x62')][_0x3553('0x76')]({'where':{'UserId':_0x7af417['id'],'ChatQueueId':_0x3c4a66[_0x3553('0x53')]['id']},'transaction':_0x5ee55d});});})[_0x3553('0x1f')](function(){_0x1fc340['forEach'](function(_0x3b6cbd){socket['emit'](_0x3553('0x77'),{'UserId':_0x3b6cbd['id'],'ChatQueueId':_0xc38a94['id']});});});});});}})[_0x3553('0x1f')](respondWithStatusCode(_0x33c751,null))[_0x3553('0x28')](handleError(_0x33c751,null));};exports[_0x3553('0x78')]=function(_0x24cbc2,_0x5a20ef,_0x2479c1){return db['Team']['findAll']({'where':{'id':_0x24cbc2['query'][_0x3553('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x3553('0x63')],'as':_0x3553('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a20ef,null))['then'](function(_0x5c5d8d){var _0x3780e9=_[_0x3553('0x3e')](_0x5c5d8d,'id');var _0x479ef9=[];var _0x763342=[];var _0x6d2c5c=squel[_0x3553('0x79')]();_0x6d2c5c[_0x3553('0x7a')](_0x3553('0x7b'))[_0x3553('0x7c')]('team_has_chat_queues','tq')['join'](_0x3553('0x7d'),'ut',_0x3553('0x7e'))['where'](_0x3553('0x7f'),_0x24cbc2[_0x3553('0x53')]['id']);for(var _0x155e1d=0x0;_0x155e1d<_0x5c5d8d[_0x3553('0x55')];_0x155e1d+=0x1){let _0x30d664=_0x5c5d8d[_0x155e1d];for(var _0x59cf4d=0x0;_0x59cf4d<_0x30d664[_0x3553('0x6e')][_0x3553('0x55')];_0x59cf4d+=0x1){let _0xfd0967=_0x30d664[_0x3553('0x6e')][_0x59cf4d];var _0x3a6a82=_0x6d2c5c[_0x3553('0x80')]();_0x3a6a82[_0x3553('0x49')](_0x3553('0x81'),_0xfd0967['id']);_0x763342[_0x3553('0x82')](db[_0x3553('0x73')][_0x3553('0x3f')](_0x3a6a82[_0x3553('0x83')](),{'type':db[_0x3553('0x73')][_0x3553('0x84')][_0x3553('0x85')]})[_0x3553('0x1f')](function(_0x4c5b5b){if(_0x4c5b5b[_0x3553('0x55')]===0x1){return _0xfd0967['id'];}else{var _0x492659=_[_0x3553('0x86')](_[_0x3553('0x3e')](_0x4c5b5b,_0x3553('0x87')),function(_0xcb4ed1){return _[_0x3553('0x88')](_0x3780e9,_0xcb4ed1);});if(_0x492659){return _0xfd0967['id'];}}}));}}return BPromise[_0x3553('0x89')](_0x763342)[_0x3553('0x1f')](function(_0x6090b1){_0x479ef9=_(_0x479ef9)[_0x3553('0x8a')](_0x6090b1)['compact']()[_0x3553('0x8b')]();return db[_0x3553('0x3c')][_0x3553('0x57')]({'where':{'id':_0x24cbc2['params']['id']}})[_0x3553('0x1f')](function(_0x233fd1){return db[_0x3553('0x73')][_0x3553('0x74')](function(_0x40eda3){return _0x233fd1[_0x3553('0x78')](_0x24cbc2['query'][_0x3553('0x6d')],{'transaction':_0x40eda3})['then'](function(){if(!_['isEmpty'](_0x479ef9)){return _0x233fd1[_0x3553('0x8c')](_0x479ef9,{'transaction':_0x40eda3});}})[_0x3553('0x1f')](function(){_0x479ef9[_0x3553('0x8d')](function(_0x429576){socket[_0x3553('0x8e')](_0x3553('0x8f'),{'UserId':_0x429576,'ChatQueueId':_0x233fd1['id']});});});});});});})[_0x3553('0x1f')](respondWithStatusCode(_0x5a20ef,null))[_0x3553('0x28')](handleError(_0x5a20ef,null));};exports['addAgents']=function(_0x1f306c,_0x6faade,_0x1b978a){return db[_0x3553('0x3c')][_0x3553('0x57')]({'where':{'id':_0x1f306c[_0x3553('0x53')]['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x6faade,null))[_0x3553('0x1f')](function(_0x3a59df){if(_0x3a59df){return _0x3a59df[_0x3553('0x90')](_0x1f306c['body'][_0x3553('0x6d')],_[_0x3553('0x91')](_0x1f306c[_0x3553('0x59')],[_0x3553('0x6d'),'id'])||{})[_0x3553('0x92')](function(_0x43f277){for(var _0x237805=0x0;_0x237805<_0x1f306c[_0x3553('0x59')][_0x3553('0x6d')]['length'];_0x237805+=0x1){socket[_0x3553('0x8e')]('userChatQueue:save',{'UserId':Number(_0x1f306c[_0x3553('0x59')][_0x3553('0x6d')][_0x237805]),'ChatQueueId':Number(_0x1f306c[_0x3553('0x53')]['id'])});}return _0x43f277;});}})[_0x3553('0x1f')](respondWithResult(_0x6faade,null))['catch'](handleError(_0x6faade,null));};exports['removeAgents']=function(_0x190cd8,_0x2cfbb2,_0x4de515){return db['ChatQueue'][_0x3553('0x57')]({'where':{'id':_0x190cd8['params']['id']}})[_0x3553('0x1f')](handleEntityNotFound(_0x2cfbb2,null))[_0x3553('0x1f')](function(_0x3e9e89){if(_0x3e9e89){return _0x3e9e89[_0x3553('0x8c')](_0x190cd8['query']['ids'])[_0x3553('0x1f')](function(){if(_[_0x3553('0x93')](_0x190cd8[_0x3553('0x3f')][_0x3553('0x6d')])){for(var _0x13be9=0x0;_0x13be9<_0x190cd8['query'][_0x3553('0x6d')][_0x3553('0x55')];_0x13be9+=0x1){socket[_0x3553('0x8e')](_0x3553('0x8f'),{'UserId':Number(_0x190cd8[_0x3553('0x3f')][_0x3553('0x6d')][_0x13be9]),'ChatQueueId':Number(_0x190cd8[_0x3553('0x53')]['id'])});}}else{socket[_0x3553('0x8e')](_0x3553('0x8f'),{'UserId':Number(_0x190cd8[_0x3553('0x3f')][_0x3553('0x6d')]),'ChatQueueId':Number(_0x190cd8['params']['id'])});}});}})[_0x3553('0x1f')](respondWithStatusCode(_0x2cfbb2,null))[_0x3553('0x28')](handleError(_0x2cfbb2,null));};exports[_0x3553('0x94')]=function(_0x4db2ad,_0x558734,_0x19ea78){var _0x39313a={};var _0x1ebf22={};var _0x30cead;var _0x4b0b8c;return db[_0x3553('0x3c')]['findOne']({'where':{'id':_0x4db2ad[_0x3553('0x53')]['id']}})['then'](handleEntityNotFound(_0x558734,null))[_0x3553('0x1f')](function(_0x22ff82){if(_0x22ff82){_0x30cead=_0x22ff82;_0x1ebf22[_0x3553('0x42')]=_[_0x3553('0x54')](db[_0x3553('0x63')]['rawAttributes']);_0x1ebf22[_0x3553('0x3f')]=_[_0x3553('0x54')](_0x4db2ad[_0x3553('0x3f')]);_0x1ebf22[_0x3553('0x40')]=_[_0x3553('0x41')](_0x1ebf22[_0x3553('0x42')],_0x1ebf22[_0x3553('0x3f')]);_0x39313a[_0x3553('0x44')]=_[_0x3553('0x41')](_0x1ebf22[_0x3553('0x42')],qs['fields'](_0x4db2ad[_0x3553('0x3f')][_0x3553('0x43')]));_0x39313a[_0x3553('0x44')]=_0x39313a['attributes'][_0x3553('0x55')]?_0x39313a[_0x3553('0x44')]:_0x1ebf22[_0x3553('0x42')];_0x39313a[_0x3553('0x47')]=qs['sort'](_0x4db2ad[_0x3553('0x3f')]['sort']);_0x39313a['where']=qs[_0x3553('0x40')](_[_0x3553('0x4a')](_0x4db2ad[_0x3553('0x3f')],_0x1ebf22[_0x3553('0x40')]));if(_0x4db2ad[_0x3553('0x3f')][_0x3553('0x4b')]){_0x39313a[_0x3553('0x49')]=_[_0x3553('0x4c')](_0x39313a[_0x3553('0x49')],{'$or':_[_0x3553('0x3e')](_0x39313a[_0x3553('0x44')],function(_0x1b2566){var _0x433bce={};_0x433bce[_0x1b2566]={'$like':'%'+_0x4db2ad[_0x3553('0x3f')][_0x3553('0x4b')]+'%'};return _0x433bce;})});}_0x39313a=_[_0x3553('0x4c')]({},_0x39313a,_0x4db2ad[_0x3553('0x4f')]);return _0x30cead[_0x3553('0x94')](_0x39313a);}})[_0x3553('0x1f')](function(_0x2aad5e){if(_0x2aad5e){_0x4b0b8c=_0x2aad5e[_0x3553('0x55')];if(!_0x4db2ad[_0x3553('0x3f')]['hasOwnProperty'](_0x3553('0x46'))){_0x39313a[_0x3553('0x2e')]=qs[_0x3553('0x2e')](_0x4db2ad[_0x3553('0x3f')][_0x3553('0x2e')]);_0x39313a['offset']=qs['offset'](_0x4db2ad[_0x3553('0x3f')][_0x3553('0x2c')]);}return _0x30cead[_0x3553('0x94')](_0x39313a);}})[_0x3553('0x1f')](function(_0x46e87c){if(_0x46e87c){return _0x46e87c?{'count':_0x4b0b8c,'rows':_0x46e87c}:null;}})[_0x3553('0x1f')](respondWithResult(_0x558734,null))[_0x3553('0x28')](handleError(_0x558734,null));}; \ No newline at end of file +var _0x193f=['push','toString','QueryTypes','SELECT','TeamId','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','ChatQueue','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','addTeams','ids','Team','online','flatMap','Agents','sequelize','transaction','each','forEach','emit','removeTeams','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone'];(function(_0xb08fec,_0x2f56bc){var _0x41c9fe=function(_0x44c471){while(--_0x44c471){_0xb08fec['push'](_0xb08fec['shift']());}};_0x41c9fe(++_0x2f56bc);}(_0x193f,0x9e));var _0xf193=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x193f[_0x324fe8];return _0x4a1cd9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf193('0x0'));var zipdir=require(_0xf193('0x1'));var jsonpatch=require(_0xf193('0x2'));var rp=require(_0xf193('0x3'));var moment=require(_0xf193('0x4'));var BPromise=require(_0xf193('0x5'));var Mustache=require(_0xf193('0x6'));var util=require('util');var path=require(_0xf193('0x7'));var sox=require(_0xf193('0x8'));var csv=require(_0xf193('0x9'));var ejs=require(_0xf193('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf193('0xb'));var squel=require('squel');var crypto=require(_0xf193('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf193('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf193('0xe'));var qs=require(_0xf193('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf193('0x10'));var logger=require(_0xf193('0x11'))(_0xf193('0x12'));var utils=require('../../config/utils');var config=require(_0xf193('0x13'));var licenseUtil=require(_0xf193('0x14'));var db=require(_0xf193('0x15'))['db'];config[_0xf193('0x16')]=_[_0xf193('0x17')](config[_0xf193('0x16')],{'host':_0xf193('0x18'),'port':0x18eb});var socket=require(_0xf193('0x19'))(new Redis(config[_0xf193('0x16')]));require(_0xf193('0x1a'))[_0xf193('0x1b')](socket);var jayson=require(_0xf193('0x1c'));var client=jayson[_0xf193('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x917ef9,_0x56f319,_0x128ca0,_0xdea3d0){return new BPromise(function(_0x4a13f3,_0x2b6b6a){var _0x23aa14=_0xdea3d0||client;return _0x23aa14['request'](_0x917ef9,_0x128ca0)[_0xf193('0x1e')](function(_0x540871){logger[_0xf193('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x56f319,_0xf193('0x20'));logger[_0xf193('0x21')](_0xf193('0x22'),_0x56f319,_0xf193('0x20'),JSON[_0xf193('0x23')](_0x540871));if(_0x540871[_0xf193('0x24')]){if(_0x540871[_0xf193('0x24')][_0xf193('0x25')]===0x1f4){logger[_0xf193('0x24')](_0xf193('0x26'),_0x56f319,_0x540871[_0xf193('0x24')][_0xf193('0x27')]);return _0x2b6b6a(_0x540871[_0xf193('0x24')][_0xf193('0x27')]);}logger['error'](_0xf193('0x26'),_0x56f319,_0x540871[_0xf193('0x24')]['message']);return _0x4a13f3(_0x540871[_0xf193('0x24')][_0xf193('0x27')]);}else{logger[_0xf193('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x56f319,_0xf193('0x20'));_0x4a13f3(_0x540871[_0xf193('0x28')]['message']);}})[_0xf193('0x29')](function(_0x5e5075){logger[_0xf193('0x24')](_0xf193('0x26'),_0x56f319,_0x5e5075);_0x2b6b6a(_0x5e5075);});});}function respondWithStatusCode(_0x5c6646,_0x3e98b0){_0x3e98b0=_0x3e98b0||0xcc;return function(_0x5bd266){if(_0x5bd266){return _0x5c6646[_0xf193('0x2a')](_0x3e98b0);}return _0x5c6646['status'](_0x3e98b0)[_0xf193('0x2b')]();};}function respondWithResult(_0x2269b9,_0x90233b){_0x90233b=_0x90233b||0xc8;return function(_0x10debb){if(_0x10debb){return _0x2269b9[_0xf193('0x2c')](_0x90233b)['json'](_0x10debb);}};}function respondWithFilteredResult(_0x8abc67,_0x198c84){return function(_0x1c207d){if(_0x1c207d){var _0x2f19eb=typeof _0x198c84['offset']===_0xf193('0x2d')&&typeof _0x198c84[_0xf193('0x2e')]==='undefined';var _0x328411=_0x1c207d['count'];var _0x1c6c1b=_0x2f19eb?0x0:_0x198c84['offset'];var _0x2b0e81=_0x2f19eb?_0x1c207d[_0xf193('0x2f')]:_0x198c84[_0xf193('0x30')]+_0x198c84[_0xf193('0x2e')];var _0x21b46c;if(_0x2b0e81>=_0x328411){_0x2b0e81=_0x328411;_0x21b46c=0xc8;}else{_0x21b46c=0xce;}_0x8abc67[_0xf193('0x2c')](_0x21b46c);return _0x8abc67[_0xf193('0x31')](_0xf193('0x32'),_0x1c6c1b+'-'+_0x2b0e81+'/'+_0x328411)[_0xf193('0x33')](_0x1c207d);}return null;};}function patchUpdates(_0x401f0d){return function(_0x57fdaf){try{jsonpatch[_0xf193('0x34')](_0x57fdaf,_0x401f0d,!![]);}catch(_0x29bff8){return BPromise[_0xf193('0x35')](_0x29bff8);}return _0x57fdaf[_0xf193('0x36')]();};}function saveUpdates(_0x19aeeb,_0x284b9f){return function(_0x3716ae){if(_0x3716ae){return _0x3716ae[_0xf193('0x37')](_0x19aeeb)['then'](function(_0x55d935){return _0x55d935;});}return null;};}function removeEntity(_0x3f1165,_0x3e76ea){return function(_0x4c5147){if(_0x4c5147){return _0x4c5147[_0xf193('0x38')]()[_0xf193('0x1e')](function(){var _0x2a1f1a=_0x4c5147[_0xf193('0x39')]({'plain':!![]});var _0x4d9b84=_0xf193('0x3a');return db[_0xf193('0x3b')][_0xf193('0x38')]({'where':{'type':_0x4d9b84,'resourceId':_0x2a1f1a['id']}})[_0xf193('0x1e')](function(){return _0x4c5147;});})[_0xf193('0x1e')](function(){_0x3f1165[_0xf193('0x2c')](0xcc)[_0xf193('0x2b')]();});}};}function handleEntityNotFound(_0x3644ee,_0x4cb0ea){return function(_0x1509e5){if(!_0x1509e5){_0x3644ee[_0xf193('0x2a')](0x194);}return _0x1509e5;};}function handleError(_0x2418d2,_0x4d65ec){_0x4d65ec=_0x4d65ec||0x1f4;return function(_0x588243){logger[_0xf193('0x24')](_0x588243[_0xf193('0x3c')]);if(_0x588243[_0xf193('0x3d')]){delete _0x588243[_0xf193('0x3d')];}_0x2418d2['status'](_0x4d65ec)['send'](_0x588243);};}exports['index']=function(_0x5bb1e5,_0x2f7098){var _0x521bbd={},_0x4f481a={},_0x30fdf4={'count':0x0,'rows':[]};var _0x691157=_['map'](db[_0xf193('0x3e')]['rawAttributes'],function(_0x351e94){return{'name':_0x351e94[_0xf193('0x3f')],'type':_0x351e94[_0xf193('0x40')][_0xf193('0x41')]};});_0x4f481a['model']=_[_0xf193('0x42')](_0x691157,_0xf193('0x3d'));_0x4f481a[_0xf193('0x43')]=_['keys'](_0x5bb1e5['query']);_0x4f481a[_0xf193('0x44')]=_[_0xf193('0x45')](_0x4f481a[_0xf193('0x46')],_0x4f481a[_0xf193('0x43')]);_0x521bbd[_0xf193('0x47')]=_[_0xf193('0x45')](_0x4f481a['model'],qs[_0xf193('0x48')](_0x5bb1e5[_0xf193('0x43')][_0xf193('0x48')]));_0x521bbd[_0xf193('0x47')]=_0x521bbd['attributes'][_0xf193('0x49')]?_0x521bbd[_0xf193('0x47')]:_0x4f481a['model'];if(!_0x5bb1e5['query'][_0xf193('0x4a')](_0xf193('0x4b'))){_0x521bbd[_0xf193('0x2e')]=qs[_0xf193('0x2e')](_0x5bb1e5[_0xf193('0x43')][_0xf193('0x2e')]);_0x521bbd[_0xf193('0x30')]=qs[_0xf193('0x30')](_0x5bb1e5[_0xf193('0x43')]['offset']);}_0x521bbd['order']=qs[_0xf193('0x4c')](_0x5bb1e5[_0xf193('0x43')][_0xf193('0x4c')]);_0x521bbd[_0xf193('0x4d')]=qs[_0xf193('0x44')](_[_0xf193('0x4e')](_0x5bb1e5['query'],_0x4f481a[_0xf193('0x44')]),_0x691157);if(_0x5bb1e5['query'][_0xf193('0x4f')]){_0x521bbd['where']=_[_0xf193('0x50')](_0x521bbd[_0xf193('0x4d')],{'$or':_[_0xf193('0x42')](_0x691157,function(_0x55e5ca){if(_0x55e5ca[_0xf193('0x40')]!==_0xf193('0x51')){var _0x82431c={};_0x82431c[_0x55e5ca[_0xf193('0x3d')]]={'$like':'%'+_0x5bb1e5[_0xf193('0x43')][_0xf193('0x4f')]+'%'};return _0x82431c;}})});}_0x521bbd=_[_0xf193('0x50')]({},_0x521bbd,_0x5bb1e5[_0xf193('0x52')]);var _0x525998={'where':_0x521bbd[_0xf193('0x4d')]};return db['ChatQueue'][_0xf193('0x2f')](_0x525998)[_0xf193('0x1e')](function(_0x21e46b){_0x30fdf4[_0xf193('0x2f')]=_0x21e46b;if(_0x5bb1e5['query'][_0xf193('0x53')]){_0x521bbd[_0xf193('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0xf193('0x55')](_0x521bbd);})[_0xf193('0x1e')](function(_0x1e2a54){_0x30fdf4['rows']=_0x1e2a54;return _0x30fdf4;})[_0xf193('0x1e')](respondWithFilteredResult(_0x2f7098,_0x521bbd))[_0xf193('0x29')](handleError(_0x2f7098,null));};exports['show']=function(_0x3a8ec0,_0x24e609){var _0x3a75fc={'raw':!![],'where':{'id':_0x3a8ec0[_0xf193('0x56')]['id']}},_0x5bf3be={};_0x5bf3be['model']=_['keys'](db[_0xf193('0x3e')][_0xf193('0x57')]);_0x5bf3be[_0xf193('0x43')]=_[_0xf193('0x58')](_0x3a8ec0[_0xf193('0x43')]);_0x5bf3be[_0xf193('0x44')]=_[_0xf193('0x45')](_0x5bf3be[_0xf193('0x46')],_0x5bf3be[_0xf193('0x43')]);_0x3a75fc[_0xf193('0x47')]=_[_0xf193('0x45')](_0x5bf3be[_0xf193('0x46')],qs['fields'](_0x3a8ec0[_0xf193('0x43')][_0xf193('0x48')]));_0x3a75fc[_0xf193('0x47')]=_0x3a75fc[_0xf193('0x47')][_0xf193('0x49')]?_0x3a75fc['attributes']:_0x5bf3be[_0xf193('0x46')];if(_0x3a8ec0[_0xf193('0x43')]['includeAll']){_0x3a75fc[_0xf193('0x54')]=[{'all':!![]}];}_0x3a75fc=_['merge']({},_0x3a75fc,_0x3a8ec0[_0xf193('0x52')]);return db[_0xf193('0x3e')][_0xf193('0x59')](_0x3a75fc)[_0xf193('0x1e')](handleEntityNotFound(_0x24e609,null))[_0xf193('0x1e')](respondWithResult(_0x24e609,null))[_0xf193('0x29')](handleError(_0x24e609,null));};exports[_0xf193('0x5a')]=function(_0x3aef5a,_0x436ca7){return db[_0xf193('0x3e')][_0xf193('0x5a')](_0x3aef5a['body'],{})[_0xf193('0x1e')](function(_0xa3f1a2){var _0x411b10=_0x3aef5a[_0xf193('0x5b')][_0xf193('0x39')]({'plain':!![]});if(!_0x411b10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x411b10[_0xf193('0x5c')]===_0xf193('0x5b')){var _0x315642=_0xa3f1a2[_0xf193('0x39')]({'plain':!![]});var _0x40a362=_0xf193('0x3a');return db[_0xf193('0x5d')][_0xf193('0x59')]({'where':{'name':_0x40a362,'userProfileId':_0x411b10[_0xf193('0x5e')]},'raw':!![]})[_0xf193('0x1e')](function(_0x4de160){if(_0x4de160&&_0x4de160[_0xf193('0x5f')]===0x0){return db['UserProfileResource'][_0xf193('0x5a')]({'name':_0x315642[_0xf193('0x3d')],'resourceId':_0x315642['id'],'type':_0x4de160[_0xf193('0x3d')],'sectionId':_0x4de160['id']},{})[_0xf193('0x1e')](function(){return _0xa3f1a2;});}else{return _0xa3f1a2;}})[_0xf193('0x29')](function(_0xd5c4c3){logger[_0xf193('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd5c4c3);throw _0xd5c4c3;});}return _0xa3f1a2;})[_0xf193('0x1e')](respondWithResult(_0x436ca7,0xc9))[_0xf193('0x29')](handleError(_0x436ca7,null));};exports[_0xf193('0x37')]=function(_0x5dca66,_0x3b95c7){if(_0x5dca66[_0xf193('0x60')]['id']){delete _0x5dca66[_0xf193('0x60')]['id'];}return db[_0xf193('0x3e')][_0xf193('0x59')]({'where':{'id':_0x5dca66['params']['id']}})[_0xf193('0x1e')](handleEntityNotFound(_0x3b95c7,null))[_0xf193('0x1e')](saveUpdates(_0x5dca66[_0xf193('0x60')],null))[_0xf193('0x1e')](respondWithResult(_0x3b95c7,null))['catch'](handleError(_0x3b95c7,null));};exports[_0xf193('0x38')]=function(_0x1fe5cc,_0x2f5546){return db['ChatQueue'][_0xf193('0x59')]({'where':{'id':_0x1fe5cc[_0xf193('0x56')]['id']}})[_0xf193('0x1e')](handleEntityNotFound(_0x2f5546,null))[_0xf193('0x1e')](removeEntity(_0x2f5546,null))[_0xf193('0x29')](handleError(_0x2f5546,null));};exports['describe']=function(_0x3c8d7e,_0x7b17e9){return db[_0xf193('0x3e')]['describe']()[_0xf193('0x1e')](respondWithResult(_0x7b17e9,null))[_0xf193('0x29')](handleError(_0x7b17e9,null));};exports[_0xf193('0x61')]=function(_0x35f45d,_0x1d9a8e,_0x51fd62){var _0x30b332={'raw':!![],'where':{}},_0xd38e61={},_0x1c7661;return db[_0xf193('0x3e')][_0xf193('0x62')]({'where':{'id':_0x35f45d[_0xf193('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d9a8e,null))[_0xf193('0x1e')](function(_0x4aa260){if(_0x4aa260){_0x1c7661=_0x4aa260[_0xf193('0x39')]({'plain':!![]});_0xd38e61[_0xf193('0x46')]=_[_0xf193('0x58')](db[_0xf193('0x63')][_0xf193('0x57')]);_0xd38e61['query']=_[_0xf193('0x58')](_0x35f45d[_0xf193('0x43')]);_0xd38e61[_0xf193('0x44')]=_[_0xf193('0x45')](_0xd38e61[_0xf193('0x46')],_0xd38e61[_0xf193('0x43')]);_0x30b332[_0xf193('0x47')]=_[_0xf193('0x45')](_0xd38e61[_0xf193('0x46')],qs[_0xf193('0x48')](_0x35f45d[_0xf193('0x43')][_0xf193('0x48')]));_0x30b332[_0xf193('0x47')]=_0x30b332['attributes'][_0xf193('0x49')]?_0x30b332[_0xf193('0x47')]:_0xd38e61[_0xf193('0x46')];if(!_0x35f45d[_0xf193('0x43')]['hasOwnProperty'](_0xf193('0x4b'))){_0x30b332[_0xf193('0x2e')]=qs[_0xf193('0x2e')](_0x35f45d[_0xf193('0x43')][_0xf193('0x2e')]);_0x30b332[_0xf193('0x30')]=qs[_0xf193('0x30')](_0x35f45d[_0xf193('0x43')][_0xf193('0x30')]);}_0x30b332[_0xf193('0x64')]=qs[_0xf193('0x4c')](_0x35f45d[_0xf193('0x43')][_0xf193('0x4c')]);_0x30b332[_0xf193('0x4d')]=qs[_0xf193('0x44')](_[_0xf193('0x4e')](_0x35f45d['query'],_0xd38e61[_0xf193('0x44')]));_0x30b332[_0xf193('0x4d')][_0xf193('0x65')]=_0x4aa260['id'];if(_0x35f45d[_0xf193('0x43')]['filter']){_0x30b332[_0xf193('0x4d')]=_[_0xf193('0x50')](_0x30b332['where'],{'$or':_[_0xf193('0x42')](_0x30b332['attributes'],function(_0x2a294c){var _0x558969={};_0x558969[_0x2a294c]={'$like':'%'+_0x35f45d[_0xf193('0x43')][_0xf193('0x4f')]+'%'};return _0x558969;})});}_0x30b332=_[_0xf193('0x50')]({},_0x30b332,_0x35f45d['options']);return db[_0xf193('0x63')]['findAll'](_0x30b332);}})['then'](function(_0xf5c409){if(_0xf5c409){return db[_0xf193('0x66')][_0xf193('0x67')]({'where':{'id':_[_0xf193('0x42')](_0xf5c409,_0xf193('0x68')),'role':'agent'},'attributes':['id',_0xf193('0x3d'),_0xf193('0x69'),_0xf193('0x6a'),_0xf193('0x6b')]});}})['then'](function(_0x3faf02){if(_0x3faf02){return{'count':_0x3faf02[_0xf193('0x2f')],'rows':_[_0xf193('0x42')](_0x3faf02[_0xf193('0x6c')],function(_0x343e3f){return{'membername':_0x343e3f[_0xf193('0x3d')],'UserId':_0x343e3f['id'],'queue_name':_0x1c7661[_0xf193('0x3d')],'ChatQueueId':_0x1c7661['id'],'interface':util['format'](_0xf193('0x6d'),_0xf193('0x6e'),_0x343e3f[_0xf193('0x3d')]),'penalty':0x0,'paused':_0x343e3f[_0xf193('0x69')],'createdAt':_0x343e3f[_0xf193('0x6b')],'updatedAt':_0x343e3f[_0xf193('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d9a8e,_0x30b332))['catch'](handleError(_0x1d9a8e,null));};exports[_0xf193('0x6f')]=function(_0x2ab55e,_0x2e8461,_0x23b811){var _0x1bbfeb={};var _0x4a8835={};var _0x59178e;var _0x2ee33d;return db[_0xf193('0x3e')][_0xf193('0x62')]({'where':{'id':_0x2ab55e['params']['id']}})['then'](handleEntityNotFound(_0x2e8461,null))[_0xf193('0x1e')](function(_0x108b8e){if(_0x108b8e){_0x59178e=_0x108b8e;_0x4a8835[_0xf193('0x46')]=_[_0xf193('0x58')](db['Team']['rawAttributes']);_0x4a8835[_0xf193('0x43')]=_[_0xf193('0x58')](_0x2ab55e['query']);_0x4a8835['filters']=_[_0xf193('0x45')](_0x4a8835[_0xf193('0x46')],_0x4a8835[_0xf193('0x43')]);_0x1bbfeb[_0xf193('0x47')]=_['intersection'](_0x4a8835[_0xf193('0x46')],qs[_0xf193('0x48')](_0x2ab55e[_0xf193('0x43')][_0xf193('0x48')]));_0x1bbfeb[_0xf193('0x47')]=_0x1bbfeb[_0xf193('0x47')][_0xf193('0x49')]?_0x1bbfeb['attributes']:_0x4a8835[_0xf193('0x46')];_0x1bbfeb[_0xf193('0x64')]=qs[_0xf193('0x4c')](_0x2ab55e[_0xf193('0x43')][_0xf193('0x4c')]);_0x1bbfeb[_0xf193('0x4d')]=qs[_0xf193('0x44')](_['pick'](_0x2ab55e['query'],_0x4a8835[_0xf193('0x44')]));if(_0x2ab55e[_0xf193('0x43')][_0xf193('0x4f')]){_0x1bbfeb[_0xf193('0x4d')]=_['merge'](_0x1bbfeb[_0xf193('0x4d')],{'$or':_[_0xf193('0x42')](_0x1bbfeb[_0xf193('0x47')],function(_0x4d48ba){var _0xca0e27={};_0xca0e27[_0x4d48ba]={'$like':'%'+_0x2ab55e[_0xf193('0x43')][_0xf193('0x4f')]+'%'};return _0xca0e27;})});}_0x1bbfeb=_[_0xf193('0x50')]({},_0x1bbfeb,_0x2ab55e[_0xf193('0x52')]);return _0x59178e[_0xf193('0x6f')](_0x1bbfeb);}})[_0xf193('0x1e')](function(_0x35f7f9){if(_0x35f7f9){_0x2ee33d=_0x35f7f9['length'];if(!_0x2ab55e[_0xf193('0x43')][_0xf193('0x4a')](_0xf193('0x4b'))){_0x1bbfeb['limit']=qs[_0xf193('0x2e')](_0x2ab55e[_0xf193('0x43')][_0xf193('0x2e')]);_0x1bbfeb[_0xf193('0x30')]=qs[_0xf193('0x30')](_0x2ab55e[_0xf193('0x43')][_0xf193('0x30')]);}return _0x59178e[_0xf193('0x6f')](_0x1bbfeb);}})[_0xf193('0x1e')](function(_0x34935f){if(_0x34935f){return _0x34935f?{'count':_0x2ee33d,'rows':_0x34935f}:null;}})[_0xf193('0x1e')](respondWithResult(_0x2e8461,null))[_0xf193('0x29')](handleError(_0x2e8461,null));};exports[_0xf193('0x70')]=function(_0x35d211,_0x4659b2,_0x16ccb3){var _0x570e9e=_0x35d211['body'][_0xf193('0x71')];return db[_0xf193('0x72')][_0xf193('0x55')]({'where':{'id':_0x570e9e},'attributes':['id'],'include':[{'model':db[_0xf193('0x66')],'as':'Agents','attributes':['id',_0xf193('0x3d'),_0xf193('0x73'),'voicePause','interface'],'raw':!![]}]})[_0xf193('0x1e')](function(_0x50a923){if(_0x50a923){var _0x1ac8b5=_[_0xf193('0x74')](_0x50a923,function(_0x36538e){var _0xac5598=_0x36538e['get']({'plain':!![]});return _0xac5598[_0xf193('0x75')];});return db['ChatQueue'][_0xf193('0x59')]({'where':{'id':_0x35d211[_0xf193('0x56')]['id']}})['then'](function(_0x38bf1a){return db[_0xf193('0x76')][_0xf193('0x77')](function(_0x573f1b){return _0x38bf1a[_0xf193('0x70')](_0x570e9e,{'transaction':_0x573f1b})[_0xf193('0x1e')](function(){return BPromise[_0xf193('0x78')](_0x1ac8b5,function(_0x7ec9ac){return db[_0xf193('0x63')]['findOrCreate']({'where':{'UserId':_0x7ec9ac['id'],'ChatQueueId':_0x35d211[_0xf193('0x56')]['id']},'transaction':_0x573f1b});});})[_0xf193('0x1e')](function(){_0x1ac8b5[_0xf193('0x79')](function(_0x34d418){socket[_0xf193('0x7a')]('userChatQueue:save',{'UserId':_0x34d418['id'],'ChatQueueId':_0x38bf1a['id']});});});});});}})[_0xf193('0x1e')](respondWithStatusCode(_0x4659b2,null))[_0xf193('0x29')](handleError(_0x4659b2,null));};exports[_0xf193('0x7b')]=function(_0x34b877,_0x42e069,_0x5764a5){return db[_0xf193('0x72')][_0xf193('0x55')]({'where':{'id':_0x34b877[_0xf193('0x43')][_0xf193('0x71')]},'attributes':['id'],'include':[{'model':db[_0xf193('0x66')],'as':_0xf193('0x75'),'attributes':['id'],'raw':!![]}]})[_0xf193('0x1e')](handleEntityNotFound(_0x42e069,null))[_0xf193('0x1e')](function(_0x540a80){var _0x5b90f5=_[_0xf193('0x42')](_0x540a80,'id');var _0x41e92f=[];var _0x347623=[];var _0x2355d5=squel['select']();_0x2355d5['field']('tq.TeamId')[_0xf193('0x7c')](_0xf193('0x7d'),'tq')[_0xf193('0x7e')]('user_has_teams','ut',_0xf193('0x7f'))[_0xf193('0x4d')](_0xf193('0x80'),_0x34b877[_0xf193('0x56')]['id']);for(var _0x42809e=0x0;_0x42809e<_0x540a80[_0xf193('0x49')];_0x42809e+=0x1){let _0x436275=_0x540a80[_0x42809e];for(var _0x4ad528=0x0;_0x4ad528<_0x436275[_0xf193('0x75')][_0xf193('0x49')];_0x4ad528+=0x1){let _0x38da5a=_0x436275[_0xf193('0x75')][_0x4ad528];var _0xf1bd47=_0x2355d5[_0xf193('0x81')]();_0xf1bd47['where']('ut.UserId\x20=\x20?',_0x38da5a['id']);_0x347623[_0xf193('0x82')](db[_0xf193('0x76')]['query'](_0xf1bd47[_0xf193('0x83')](),{'type':db[_0xf193('0x76')][_0xf193('0x84')][_0xf193('0x85')]})[_0xf193('0x1e')](function(_0x1a0bb3){if(_0x1a0bb3[_0xf193('0x49')]===0x1){return _0x38da5a['id'];}else{var _0x9eca3d=_['every'](_[_0xf193('0x42')](_0x1a0bb3,_0xf193('0x86')),function(_0x4af4f1){return _['includes'](_0x5b90f5,_0x4af4f1);});if(_0x9eca3d){return _0x38da5a['id'];}}}));}}return BPromise['all'](_0x347623)[_0xf193('0x1e')](function(_0x391fe1){_0x41e92f=_(_0x41e92f)['union'](_0x391fe1)['compact']()[_0xf193('0x87')]();return db['ChatQueue'][_0xf193('0x59')]({'where':{'id':_0x34b877[_0xf193('0x56')]['id']}})[_0xf193('0x1e')](function(_0xf0b482){return db[_0xf193('0x76')]['transaction'](function(_0x28d3ce){return _0xf0b482['removeTeams'](_0x34b877[_0xf193('0x43')]['ids'],{'transaction':_0x28d3ce})[_0xf193('0x1e')](function(){if(!_[_0xf193('0x88')](_0x41e92f)){return _0xf0b482['removeAgents'](_0x41e92f,{'transaction':_0x28d3ce});}})[_0xf193('0x1e')](function(){_0x41e92f[_0xf193('0x79')](function(_0x1262db){socket[_0xf193('0x7a')](_0xf193('0x89'),{'UserId':_0x1262db,'ChatQueueId':_0xf0b482['id']});});});});});});})[_0xf193('0x1e')](respondWithStatusCode(_0x42e069,null))[_0xf193('0x29')](handleError(_0x42e069,null));};exports['addAgents']=function(_0x3e1033,_0xec66f3,_0xfa12e0){return db[_0xf193('0x3e')][_0xf193('0x59')]({'where':{'id':_0x3e1033[_0xf193('0x56')]['id']}})[_0xf193('0x1e')](handleEntityNotFound(_0xec66f3,null))['then'](function(_0x57c9c8){if(_0x57c9c8){return _0x57c9c8[_0xf193('0x8a')](_0x3e1033[_0xf193('0x60')][_0xf193('0x71')],_[_0xf193('0x8b')](_0x3e1033['body'],['ids','id'])||{})[_0xf193('0x8c')](function(_0x13f4fd){for(var _0x435d94=0x0;_0x435d94<_0x3e1033[_0xf193('0x60')][_0xf193('0x71')]['length'];_0x435d94+=0x1){socket[_0xf193('0x7a')](_0xf193('0x8d'),{'UserId':Number(_0x3e1033[_0xf193('0x60')][_0xf193('0x71')][_0x435d94]),'ChatQueueId':Number(_0x3e1033[_0xf193('0x56')]['id'])});}return _0x13f4fd;});}})['then'](respondWithResult(_0xec66f3,null))['catch'](handleError(_0xec66f3,null));};exports['removeAgents']=function(_0x118998,_0x3544a2,_0x36011f){return db[_0xf193('0x3e')][_0xf193('0x59')]({'where':{'id':_0x118998[_0xf193('0x56')]['id']}})[_0xf193('0x1e')](handleEntityNotFound(_0x3544a2,null))['then'](function(_0x3cb29e){if(_0x3cb29e){return _0x3cb29e['removeAgents'](_0x118998[_0xf193('0x43')]['ids'])[_0xf193('0x1e')](function(){if(_[_0xf193('0x8e')](_0x118998[_0xf193('0x43')][_0xf193('0x71')])){for(var _0x144592=0x0;_0x144592<_0x118998[_0xf193('0x43')][_0xf193('0x71')]['length'];_0x144592+=0x1){socket[_0xf193('0x7a')](_0xf193('0x89'),{'UserId':Number(_0x118998[_0xf193('0x43')][_0xf193('0x71')][_0x144592]),'ChatQueueId':Number(_0x118998[_0xf193('0x56')]['id'])});}}else{socket[_0xf193('0x7a')](_0xf193('0x89'),{'UserId':Number(_0x118998[_0xf193('0x43')][_0xf193('0x71')]),'ChatQueueId':Number(_0x118998['params']['id'])});}});}})[_0xf193('0x1e')](respondWithStatusCode(_0x3544a2,null))[_0xf193('0x29')](handleError(_0x3544a2,null));};exports['getAgents']=function(_0x19d31d,_0x44a19b,_0x302b1f){var _0x428dc7={};var _0x5a717f={};var _0x258d70;var _0x25991c;return db[_0xf193('0x3e')][_0xf193('0x62')]({'where':{'id':_0x19d31d['params']['id']}})[_0xf193('0x1e')](handleEntityNotFound(_0x44a19b,null))[_0xf193('0x1e')](function(_0x12460e){if(_0x12460e){_0x258d70=_0x12460e;_0x5a717f[_0xf193('0x46')]=_['keys'](db[_0xf193('0x66')]['rawAttributes']);_0x5a717f['query']=_[_0xf193('0x58')](_0x19d31d[_0xf193('0x43')]);_0x5a717f['filters']=_[_0xf193('0x45')](_0x5a717f['model'],_0x5a717f[_0xf193('0x43')]);_0x428dc7[_0xf193('0x47')]=_[_0xf193('0x45')](_0x5a717f[_0xf193('0x46')],qs[_0xf193('0x48')](_0x19d31d['query'][_0xf193('0x48')]));_0x428dc7[_0xf193('0x47')]=_0x428dc7['attributes']['length']?_0x428dc7['attributes']:_0x5a717f['model'];_0x428dc7[_0xf193('0x64')]=qs[_0xf193('0x4c')](_0x19d31d['query'][_0xf193('0x4c')]);_0x428dc7[_0xf193('0x4d')]=qs[_0xf193('0x44')](_[_0xf193('0x4e')](_0x19d31d[_0xf193('0x43')],_0x5a717f[_0xf193('0x44')]));if(_0x19d31d[_0xf193('0x43')][_0xf193('0x4f')]){_0x428dc7['where']=_[_0xf193('0x50')](_0x428dc7[_0xf193('0x4d')],{'$or':_[_0xf193('0x42')](_0x428dc7['attributes'],function(_0x392c4b){var _0x79e864={};_0x79e864[_0x392c4b]={'$like':'%'+_0x19d31d[_0xf193('0x43')][_0xf193('0x4f')]+'%'};return _0x79e864;})});}_0x428dc7=_[_0xf193('0x50')]({},_0x428dc7,_0x19d31d[_0xf193('0x52')]);return _0x258d70[_0xf193('0x8f')](_0x428dc7);}})[_0xf193('0x1e')](function(_0x24a158){if(_0x24a158){_0x25991c=_0x24a158[_0xf193('0x49')];if(!_0x19d31d[_0xf193('0x43')][_0xf193('0x4a')](_0xf193('0x4b'))){_0x428dc7['limit']=qs[_0xf193('0x2e')](_0x19d31d['query'][_0xf193('0x2e')]);_0x428dc7[_0xf193('0x30')]=qs['offset'](_0x19d31d[_0xf193('0x43')][_0xf193('0x30')]);}return _0x258d70[_0xf193('0x8f')](_0x428dc7);}})[_0xf193('0x1e')](function(_0x31b74e){if(_0x31b74e){return _0x31b74e?{'count':_0x25991c,'rows':_0x31b74e}:null;}})['then'](respondWithResult(_0x44a19b,null))[_0xf193('0x29')](handleError(_0x44a19b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 48be06e..e75bdc2 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 _0x7e15=['update','remove','emit','hasOwnProperty','hook','ChatQueue','setMaxListeners','save'];(function(_0x417b8e,_0x9c41d3){var _0x57002f=function(_0x28ac3b){while(--_0x28ac3b){_0x417b8e['push'](_0x417b8e['shift']());}};_0x57002f(++_0x9c41d3);}(_0x7e15,0x1ad));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x57e1('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x57e1('0x1')](0x0);var events={'afterCreate':_0x57e1('0x2'),'afterUpdate':_0x57e1('0x3'),'afterDestroy':_0x57e1('0x4')};function emitEvent(_0x460e40){return function(_0x10d2ef,_0x4eebda,_0x18ef52){ChatQueueEvents[_0x57e1('0x5')](_0x460e40+':'+_0x10d2ef['id'],_0x10d2ef);ChatQueueEvents[_0x57e1('0x5')](_0x460e40,_0x10d2ef);_0x18ef52(null);};}for(var e in events){if(events[_0x57e1('0x6')](e)){var event=events[e];ChatQueue[_0x57e1('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x58b5=['update','emit','hasOwnProperty','exports','../../mysqldb','save'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x58b5,0xdc));var _0x558b=function(_0x39c081,_0x1604cb){_0x39c081=_0x39c081-0x0;var _0x3aed88=_0x58b5[_0x39c081];return _0x3aed88;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x558b('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x558b('0x1'),'afterUpdate':_0x558b('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3cd883){return function(_0x3b8d4d,_0x4644a8,_0x5deef2){ChatQueueEvents[_0x558b('0x3')](_0x3cd883+':'+_0x3b8d4d['id'],_0x3b8d4d);ChatQueueEvents[_0x558b('0x3')](_0x3cd883,_0x3b8d4d);_0x5deef2(null);};}for(var e in events){if(events[_0x558b('0x4')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x558b('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 334e2c9..a4ae87d 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 _0xf1ec=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf1ec,0x104));var _0xcf1e=function(_0x181d33,_0x4f8cf8){_0x181d33=_0x181d33-0x0;var _0xb0b97c=_0xf1ec[_0x181d33];return _0xb0b97c;};'use strict';var _=require(_0xcf1e('0x0'));var util=require(_0xcf1e('0x1'));var logger=require(_0xcf1e('0x2'))(_0xcf1e('0x3'));var moment=require(_0xcf1e('0x4'));var BPromise=require(_0xcf1e('0x5'));var rp=require(_0xcf1e('0x6'));var fs=require('fs');var path=require(_0xcf1e('0x7'));var rimraf=require(_0xcf1e('0x8'));var config=require(_0xcf1e('0x9'));var attributes=require(_0xcf1e('0xa'));module[_0xcf1e('0xb')]=function(_0x13b16b,_0x1fd4c5){return _0x13b16b[_0xcf1e('0xc')](_0xcf1e('0xd'),attributes,{'tableName':_0xcf1e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc900=['util','../../config/logger','api','request-promise','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x295189,_0x20c4d0){var _0x538766=function(_0x1f92b0){while(--_0x1f92b0){_0x295189['push'](_0x295189['shift']());}};_0x538766(++_0x20c4d0);}(_0xc900,0x1f4));var _0x0c90=function(_0x3e0f2d,_0x17a6f1){_0x3e0f2d=_0x3e0f2d-0x0;var _0x2ffd52=_0xc900[_0x3e0f2d];return _0x2ffd52;};'use strict';var _=require('lodash');var util=require(_0x0c90('0x0'));var logger=require(_0x0c90('0x1'))(_0x0c90('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c90('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0c90('0x4'));var attributes=require(_0x0c90('0x5'));module[_0x0c90('0x6')]=function(_0xb214d,_0x4592b5){return _0xb214d[_0x0c90('0x7')](_0x0c90('0x8'),attributes,{'tableName':_0x0c90('0x9'),'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 603465c..13cf82c 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 _0xa057=['register','then','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','info','catch','find','where','ShowChatQueue','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x152b03,_0x2b427f){var _0x5a5d4b=function(_0x3037a3){while(--_0x3037a3){_0x152b03['push'](_0x152b03['shift']());}};_0x5a5d4b(++_0x2b427f);}(_0xa057,0x123));var _0x7a05=function(_0x766ef4,_0xda63b8){_0x766ef4=_0x766ef4-0x0;var _0x27029e=_0xa057[_0x766ef4];return _0x27029e;};'use strict';var _=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var moment=require('moment');var BPromise=require(_0x7a05('0x2'));var rs=require(_0x7a05('0x3'));var fs=require('fs');var Redis=require(_0x7a05('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a05('0x5'));var logger=require(_0x7a05('0x6'))('rpc');var config=require(_0x7a05('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a05('0x8')]({'port':0x232a});config[_0x7a05('0x9')]=_[_0x7a05('0xa')](config['redis'],{'host':_0x7a05('0xb'),'port':0x18eb});var socket=require(_0x7a05('0xc'))(new Redis(config[_0x7a05('0x9')]));require('./chatQueue.socket')[_0x7a05('0xd')](socket);function respondWithRpcPromise(_0x48814a,_0x417ca9,_0x306fe1){return new BPromise(function(_0x1e2f9e,_0xa3c03e){return client['request'](_0x48814a,_0x306fe1)[_0x7a05('0xe')](function(_0x463a80){logger['info']('ChatQueue,\x20%s,\x20%s',_0x417ca9,_0x7a05('0xf'));logger[_0x7a05('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x417ca9,'request\x20sent',JSON['stringify'](_0x463a80));if(_0x463a80[_0x7a05('0x11')]){if(_0x463a80[_0x7a05('0x11')][_0x7a05('0x12')]===0x1f4){logger[_0x7a05('0x11')](_0x7a05('0x13'),_0x417ca9,_0x463a80[_0x7a05('0x11')][_0x7a05('0x14')]);return _0xa3c03e(_0x463a80[_0x7a05('0x11')]['message']);}logger['error'](_0x7a05('0x13'),_0x417ca9,_0x463a80[_0x7a05('0x11')]['message']);return _0x1e2f9e(_0x463a80[_0x7a05('0x11')][_0x7a05('0x14')]);}else{logger['info'](_0x7a05('0x13'),_0x417ca9,_0x7a05('0xf'));_0x1e2f9e(_0x463a80[_0x7a05('0x15')]['message']);}})['catch'](function(_0xc8eb5d){logger['error'](_0x7a05('0x13'),_0x417ca9,_0xc8eb5d);_0xa3c03e(_0xc8eb5d);});});}exports[_0x7a05('0x16')]=function(_0x4968f4){var _0x5a6588=this;return new Promise(function(_0x4d8c17,_0x2acc80){return db[_0x7a05('0x17')][_0x7a05('0x18')]({'raw':_0x4968f4[_0x7a05('0x19')]?_0x4968f4['options'][_0x7a05('0x1a')]===undefined?!![]:![]:!![],'where':_0x4968f4[_0x7a05('0x19')]?_0x4968f4[_0x7a05('0x19')]['where']||null:null,'attributes':_0x4968f4[_0x7a05('0x19')]?_0x4968f4[_0x7a05('0x19')][_0x7a05('0x1b')]||null:null,'limit':_0x4968f4[_0x7a05('0x19')]?_0x4968f4[_0x7a05('0x19')][_0x7a05('0x1c')]||null:null,'include':_0x4968f4[_0x7a05('0x19')]?_0x4968f4[_0x7a05('0x19')][_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x4968f4[_0x7a05('0x19')]['include'],function(_0x591ab5){return{'model':db[_0x591ab5['model']],'as':_0x591ab5['as'],'attributes':_0x591ab5[_0x7a05('0x1b')],'include':_0x591ab5[_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x591ab5[_0x7a05('0x1d')],function(_0x465dd6){return{'model':db[_0x465dd6[_0x7a05('0x1f')]],'as':_0x465dd6['as'],'attributes':_0x465dd6[_0x7a05('0x1b')],'include':_0x465dd6[_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x465dd6['include'],function(_0x49e37b){return{'model':db[_0x49e37b[_0x7a05('0x1f')]],'as':_0x49e37b['as'],'attributes':_0x49e37b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cd660){logger[_0x7a05('0x20')](_0x7a05('0x16'),_0x4968f4);logger[_0x7a05('0x10')](_0x7a05('0x16'),_0x4968f4,JSON['stringify'](_0x2cd660));_0x4d8c17(_0x2cd660);})[_0x7a05('0x21')](function(_0x272034){logger[_0x7a05('0x11')]('GetChatQueue',_0x272034[_0x7a05('0x14')],_0x4968f4);_0x2acc80(_0x5a6588[_0x7a05('0x11')](0x1f4,_0x272034[_0x7a05('0x14')]));});});};exports['ShowChatQueue']=function(_0x17579a){var _0x1ecb7e=this;return new Promise(function(_0x2803c6,_0x4919ff){return db['ChatQueue'][_0x7a05('0x22')]({'raw':_0x17579a['options']?_0x17579a[_0x7a05('0x19')][_0x7a05('0x1a')]===undefined?!![]:![]:!![],'where':_0x17579a['options']?_0x17579a[_0x7a05('0x19')][_0x7a05('0x23')]||null:null,'attributes':_0x17579a[_0x7a05('0x19')]?_0x17579a['options'][_0x7a05('0x1b')]||null:null,'include':_0x17579a[_0x7a05('0x19')]?_0x17579a['options'][_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x17579a['options']['include'],function(_0x3de609){return{'model':db[_0x3de609[_0x7a05('0x1f')]],'as':_0x3de609['as'],'attributes':_0x3de609['attributes'],'include':_0x3de609[_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x3de609[_0x7a05('0x1d')],function(_0x238ad2){return{'model':db[_0x238ad2['model']],'as':_0x238ad2['as'],'attributes':_0x238ad2[_0x7a05('0x1b')],'include':_0x238ad2[_0x7a05('0x1d')]?_[_0x7a05('0x1e')](_0x238ad2[_0x7a05('0x1d')],function(_0x58600c){return{'model':db[_0x58600c['model']],'as':_0x58600c['as'],'attributes':_0x58600c[_0x7a05('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19abe5){logger['info']('ShowChatQueue',_0x17579a);logger[_0x7a05('0x10')](_0x7a05('0x24'),_0x17579a,JSON[_0x7a05('0x25')](_0x19abe5));_0x2803c6(_0x19abe5);})[_0x7a05('0x21')](function(_0xcd67b9){logger[_0x7a05('0x11')](_0x7a05('0x24'),_0xcd67b9[_0x7a05('0x14')],_0x17579a);_0x4919ff(_0x1ecb7e[_0x7a05('0x11')](0x1f4,_0xcd67b9[_0x7a05('0x14')]));});});}; \ No newline at end of file +var _0x0554=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','info','debug','request\x20sent','error','ChatQueue,\x20%s,\x20%s','message','result'];(function(_0x3644f4,_0x1ce06a){var _0x1f818d=function(_0x132538){while(--_0x132538){_0x3644f4['push'](_0x3644f4['shift']());}};_0x1f818d(++_0x1ce06a);}(_0x0554,0x176));var _0x4055=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x0554[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x4055('0x0'));var util=require(_0x4055('0x1'));var moment=require('moment');var BPromise=require(_0x4055('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4055('0x3'));var db=require(_0x4055('0x4'))['db'];var utils=require(_0x4055('0x5'));var logger=require(_0x4055('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4055('0x7'));var client=jayson[_0x4055('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4055('0x9')](config[_0x4055('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4055('0xb'))(new Redis(config[_0x4055('0xa')]));require('./chatQueue.socket')[_0x4055('0xc')](socket);function respondWithRpcPromise(_0x1e0791,_0x134f26,_0x4fea58){return new BPromise(function(_0x424243,_0x49f69b){return client[_0x4055('0xd')](_0x1e0791,_0x4fea58)[_0x4055('0xe')](function(_0x91abcc){logger[_0x4055('0xf')]('ChatQueue,\x20%s,\x20%s',_0x134f26,'request\x20sent');logger[_0x4055('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x134f26,_0x4055('0x11'),JSON['stringify'](_0x91abcc));if(_0x91abcc[_0x4055('0x12')]){if(_0x91abcc['error']['code']===0x1f4){logger[_0x4055('0x12')](_0x4055('0x13'),_0x134f26,_0x91abcc[_0x4055('0x12')][_0x4055('0x14')]);return _0x49f69b(_0x91abcc[_0x4055('0x12')]['message']);}logger[_0x4055('0x12')](_0x4055('0x13'),_0x134f26,_0x91abcc[_0x4055('0x12')]['message']);return _0x424243(_0x91abcc[_0x4055('0x12')][_0x4055('0x14')]);}else{logger[_0x4055('0xf')](_0x4055('0x13'),_0x134f26,_0x4055('0x11'));_0x424243(_0x91abcc[_0x4055('0x15')]['message']);}})[_0x4055('0x16')](function(_0x142448){logger[_0x4055('0x12')](_0x4055('0x13'),_0x134f26,_0x142448);_0x49f69b(_0x142448);});});}exports[_0x4055('0x17')]=function(_0x559012){var _0x13c4e8=this;return new Promise(function(_0x53839e,_0x59dbdc){return db[_0x4055('0x18')][_0x4055('0x19')]({'raw':_0x559012[_0x4055('0x1a')]?_0x559012[_0x4055('0x1a')][_0x4055('0x1b')]===undefined?!![]:![]:!![],'where':_0x559012[_0x4055('0x1a')]?_0x559012[_0x4055('0x1a')][_0x4055('0x1c')]||null:null,'attributes':_0x559012[_0x4055('0x1a')]?_0x559012[_0x4055('0x1a')][_0x4055('0x1d')]||null:null,'limit':_0x559012[_0x4055('0x1a')]?_0x559012['options'][_0x4055('0x1e')]||null:null,'include':_0x559012['options']?_0x559012['options'][_0x4055('0x1f')]?_[_0x4055('0x20')](_0x559012[_0x4055('0x1a')][_0x4055('0x1f')],function(_0x1c0c52){return{'model':db[_0x1c0c52[_0x4055('0x21')]],'as':_0x1c0c52['as'],'attributes':_0x1c0c52['attributes'],'include':_0x1c0c52[_0x4055('0x1f')]?_[_0x4055('0x20')](_0x1c0c52[_0x4055('0x1f')],function(_0x2cbc36){return{'model':db[_0x2cbc36[_0x4055('0x21')]],'as':_0x2cbc36['as'],'attributes':_0x2cbc36[_0x4055('0x1d')],'include':_0x2cbc36[_0x4055('0x1f')]?_[_0x4055('0x20')](_0x2cbc36['include'],function(_0x4c78df){return{'model':db[_0x4c78df[_0x4055('0x21')]],'as':_0x4c78df['as'],'attributes':_0x4c78df[_0x4055('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4055('0xe')](function(_0x1e1b7e){logger[_0x4055('0xf')](_0x4055('0x17'),_0x559012);logger[_0x4055('0x10')]('GetChatQueue',_0x559012,JSON[_0x4055('0x22')](_0x1e1b7e));_0x53839e(_0x1e1b7e);})['catch'](function(_0x422175){logger[_0x4055('0x12')](_0x4055('0x17'),_0x422175[_0x4055('0x14')],_0x559012);_0x59dbdc(_0x13c4e8[_0x4055('0x12')](0x1f4,_0x422175[_0x4055('0x14')]));});});};exports[_0x4055('0x23')]=function(_0x2d87ce){var _0x52629e=this;return new Promise(function(_0x30c3a9,_0x25cce9){return db['ChatQueue']['find']({'raw':_0x2d87ce[_0x4055('0x1a')]?_0x2d87ce[_0x4055('0x1a')][_0x4055('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d87ce[_0x4055('0x1a')]?_0x2d87ce['options'][_0x4055('0x1c')]||null:null,'attributes':_0x2d87ce[_0x4055('0x1a')]?_0x2d87ce['options']['attributes']||null:null,'include':_0x2d87ce['options']?_0x2d87ce['options'][_0x4055('0x1f')]?_[_0x4055('0x20')](_0x2d87ce[_0x4055('0x1a')][_0x4055('0x1f')],function(_0x5a3209){return{'model':db[_0x5a3209[_0x4055('0x21')]],'as':_0x5a3209['as'],'attributes':_0x5a3209[_0x4055('0x1d')],'include':_0x5a3209[_0x4055('0x1f')]?_['map'](_0x5a3209['include'],function(_0x4f773e){return{'model':db[_0x4f773e[_0x4055('0x21')]],'as':_0x4f773e['as'],'attributes':_0x4f773e['attributes'],'include':_0x4f773e[_0x4055('0x1f')]?_[_0x4055('0x20')](_0x4f773e[_0x4055('0x1f')],function(_0x5ef27d){return{'model':db[_0x5ef27d[_0x4055('0x21')]],'as':_0x5ef27d['as'],'attributes':_0x5ef27d[_0x4055('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4055('0xe')](function(_0x2ecd03){logger[_0x4055('0xf')](_0x4055('0x23'),_0x2d87ce);logger[_0x4055('0x10')](_0x4055('0x23'),_0x2d87ce,JSON[_0x4055('0x22')](_0x2ecd03));_0x30c3a9(_0x2ecd03);})[_0x4055('0x16')](function(_0x5be1b2){logger[_0x4055('0x12')](_0x4055('0x23'),_0x5be1b2[_0x4055('0x14')],_0x2d87ce);_0x25cce9(_0x52629e['error'](0x1f4,_0x5be1b2['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d09180f..b72a8aa 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 _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x2966bb,_0x34e286){var _0x3a7a54=function(_0x343f98){while(--_0x343f98){_0x2966bb['push'](_0x2966bb['shift']());}};_0x3a7a54(++_0x34e286);}(_0x80d9,0x15c));var _0x980d=function(_0xdc0cbe,_0x450158){_0xdc0cbe=_0xdc0cbe-0x0;var _0x3036c8=_0x80d9[_0xdc0cbe];return _0x3036c8;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}}; \ No newline at end of file +var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x17bccc,_0x4cc003){var _0x16e5fe=function(_0x3f7b2a){while(--_0x3f7b2a){_0x17bccc['push'](_0x17bccc['shift']());}};_0x16e5fe(++_0x4cc003);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x5aa231,_0x434156){_0x5aa231=_0x5aa231-0x0;var _0x4739bf=_0x6f0d[_0x5aa231];return _0x4739bf;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 1deba89..5fc9722 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x28ac16,_0xfd3cf7){var _0x4b2382=function(_0x3fe610){while(--_0x3fe610){_0x28ac16['push'](_0x28ac16['shift']());}};_0x4b2382(++_0xfd3cf7);}(_0xe14b,0x93));var _0xbe14=function(_0x3e05ef,_0x39119c){_0x3e05ef=_0x3e05ef-0x0;var _0x22ff8f=_0xe14b[_0x3e05ef];return _0x22ff8f;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54e47d,_0x3e5841){var _0x163e34=function(_0x153eba){while(--_0x153eba){_0x54e47d['push'](_0x54e47d['shift']());}};_0x163e34(++_0x3e5841);}(_0x008c,0x188));var _0xc008=function(_0x3ed98d,_0x2f4af7){_0x3ed98d=_0x3ed98d-0x0;var _0x2b81e0=_0x008c[_0x3ed98d];return _0x2b81e0;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index c817875..9823389 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 _0x6395=['moment','exports','STRING','DATE'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x6395,0xc8));var _0x5639=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6395[_0x17d9e3];return _0x14192d;};'use strict';var moment=require(_0x5639('0x0'));var Sequelize=require('sequelize');module[_0x5639('0x1')]={'uniqueid':{'type':Sequelize[_0x5639('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5639('0x2')]},'joinAt':{'type':Sequelize[_0x5639('0x3')]},'leaveAt':{'type':Sequelize[_0x5639('0x3')]},'acceptAt':{'type':Sequelize[_0x5639('0x3')]},'exitAt':{'type':Sequelize[_0x5639('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc12f=['STRING','DATE','moment','sequelize','exports'];(function(_0x1b46f5,_0x89814f){var _0x40dd7e=function(_0x327a03){while(--_0x327a03){_0x1b46f5['push'](_0x1b46f5['shift']());}};_0x40dd7e(++_0x89814f);}(_0xc12f,0xe8));var _0xfc12=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0xc12f[_0x12a554];return _0x244ba0;};'use strict';var moment=require(_0xfc12('0x0'));var Sequelize=require(_0xfc12('0x1'));module[_0xfc12('0x2')]={'uniqueid':{'type':Sequelize[_0xfc12('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfc12('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfc12('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfc12('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8ac40a4..fb8b7f1 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 _0x9bd9=['ChatQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','name','index'];(function(_0x1b5b04,_0xab51a1){var _0x4d56f6=function(_0x4e053e){while(--_0x4e053e){_0x1b5b04['push'](_0x1b5b04['shift']());}};_0x4d56f6(++_0xab51a1);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x497a85,_0x2bd7cf){_0x497a85=_0x497a85-0x0;var _0x33207e=_0x9bd9[_0x497a85];return _0x33207e;};'use strict';var emlformat=require(_0x99bd('0x0'));var rimraf=require(_0x99bd('0x1'));var zipdir=require(_0x99bd('0x2'));var jsonpatch=require(_0x99bd('0x3'));var rp=require(_0x99bd('0x4'));var moment=require(_0x99bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99bd('0x6'));var util=require('util');var path=require(_0x99bd('0x7'));var sox=require(_0x99bd('0x8'));var csv=require('to-csv');var ejs=require(_0x99bd('0x9'));var fs=require('fs');var fs_extra=require(_0x99bd('0xa'));var _=require(_0x99bd('0xb'));var squel=require(_0x99bd('0xc'));var crypto=require(_0x99bd('0xd'));var jsforce=require(_0x99bd('0xe'));var deskjs=require(_0x99bd('0xf'));var toCsv=require(_0x99bd('0x10'));var querystring=require(_0x99bd('0x11'));var Papa=require(_0x99bd('0x12'));var Redis=require(_0x99bd('0x13'));var authService=require(_0x99bd('0x14'));var qs=require(_0x99bd('0x15'));var as=require(_0x99bd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bd('0x17'))('api');var utils=require(_0x99bd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x99bd('0x19'));var db=require(_0x99bd('0x1a'))['db'];function respondWithStatusCode(_0x4a8bd9,_0x22237c){_0x22237c=_0x22237c||0xcc;return function(_0x500cd2){if(_0x500cd2){return _0x4a8bd9[_0x99bd('0x1b')](_0x22237c);}return _0x4a8bd9['status'](_0x22237c)[_0x99bd('0x1c')]();};}function respondWithResult(_0x401299,_0x141159){_0x141159=_0x141159||0xc8;return function(_0x4a9770){if(_0x4a9770){return _0x401299[_0x99bd('0x1d')](_0x141159)[_0x99bd('0x1e')](_0x4a9770);}};}function respondWithFilteredResult(_0x2d918a,_0x42b619){return function(_0x65a2e5){if(_0x65a2e5){var _0x491d9=typeof _0x42b619[_0x99bd('0x1f')]===_0x99bd('0x20')&&typeof _0x42b619[_0x99bd('0x21')]==='undefined';var _0x378079=_0x65a2e5[_0x99bd('0x22')];var _0x2fe078=_0x491d9?0x0:_0x42b619['offset'];var _0x4b98fc=_0x491d9?_0x65a2e5[_0x99bd('0x22')]:_0x42b619[_0x99bd('0x1f')]+_0x42b619[_0x99bd('0x21')];var _0xfa6227;if(_0x4b98fc>=_0x378079){_0x4b98fc=_0x378079;_0xfa6227=0xc8;}else{_0xfa6227=0xce;}_0x2d918a[_0x99bd('0x1d')](_0xfa6227);return _0x2d918a['set'](_0x99bd('0x23'),_0x2fe078+'-'+_0x4b98fc+'/'+_0x378079)['json'](_0x65a2e5);}return null;};}function patchUpdates(_0x10f2fb){return function(_0x3085df){try{jsonpatch[_0x99bd('0x24')](_0x3085df,_0x10f2fb,!![]);}catch(_0x1d937b){return BPromise[_0x99bd('0x25')](_0x1d937b);}return _0x3085df['save']();};}function saveUpdates(_0x27c551,_0x229322){return function(_0x3e339c){if(_0x3e339c){return _0x3e339c['update'](_0x27c551)[_0x99bd('0x26')](function(_0x5e6081){return _0x5e6081;});}return null;};}function removeEntity(_0x4d3ebb,_0x1c5b82){return function(_0xfdc455){if(_0xfdc455){return _0xfdc455['destroy']()[_0x99bd('0x26')](function(){_0x4d3ebb[_0x99bd('0x1d')](0xcc)[_0x99bd('0x1c')]();});}};}function handleEntityNotFound(_0x3f7bf4,_0x51ff34){return function(_0x12daac){if(!_0x12daac){_0x3f7bf4['sendStatus'](0x194);}return _0x12daac;};}function handleError(_0x550b7f,_0x10d5cd){_0x10d5cd=_0x10d5cd||0x1f4;return function(_0x5ebeeb){logger[_0x99bd('0x27')](_0x5ebeeb['stack']);if(_0x5ebeeb[_0x99bd('0x28')]){delete _0x5ebeeb[_0x99bd('0x28')];}_0x550b7f['status'](_0x10d5cd)['send'](_0x5ebeeb);};}exports[_0x99bd('0x29')]=function(_0x1af1e6,_0x1eabb9){var _0x5903aa={},_0x957d48={},_0x1d0642={'count':0x0,'rows':[]};var _0x2250d8=_['map'](db[_0x99bd('0x2a')][_0x99bd('0x2b')],function(_0x4c5493){return{'name':_0x4c5493[_0x99bd('0x2c')],'type':_0x4c5493[_0x99bd('0x2d')][_0x99bd('0x2e')]};});_0x957d48[_0x99bd('0x2f')]=_['map'](_0x2250d8,_0x99bd('0x28'));_0x957d48[_0x99bd('0x30')]=_['keys'](_0x1af1e6[_0x99bd('0x30')]);_0x957d48['filters']=_['intersection'](_0x957d48['model'],_0x957d48[_0x99bd('0x30')]);_0x5903aa[_0x99bd('0x31')]=_[_0x99bd('0x32')](_0x957d48[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x33')]));_0x5903aa[_0x99bd('0x31')]=_0x5903aa[_0x99bd('0x31')][_0x99bd('0x34')]?_0x5903aa['attributes']:_0x957d48[_0x99bd('0x2f')];if(!_0x1af1e6['query'][_0x99bd('0x35')]('nolimit')){_0x5903aa['limit']=qs['limit'](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x21')]);_0x5903aa[_0x99bd('0x1f')]=qs[_0x99bd('0x1f')](_0x1af1e6['query'][_0x99bd('0x1f')]);}_0x5903aa[_0x99bd('0x36')]=qs[_0x99bd('0x37')](_0x1af1e6[_0x99bd('0x30')]['sort']);_0x5903aa[_0x99bd('0x38')]=qs[_0x99bd('0x39')](_[_0x99bd('0x3a')](_0x1af1e6[_0x99bd('0x30')],_0x957d48['filters']),_0x2250d8);if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]){_0x5903aa[_0x99bd('0x38')]=_[_0x99bd('0x3c')](_0x5903aa['where'],{'$or':_[_0x99bd('0x3d')](_0x2250d8,function(_0x3d2b0f){if(_0x3d2b0f[_0x99bd('0x2d')]!==_0x99bd('0x3e')){var _0x7e29ec={};_0x7e29ec[_0x3d2b0f[_0x99bd('0x28')]]={'$like':'%'+_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]+'%'};return _0x7e29ec;}})});}_0x5903aa=_[_0x99bd('0x3c')]({},_0x5903aa,_0x1af1e6[_0x99bd('0x3f')]);var _0x2fcf71={'where':_0x5903aa[_0x99bd('0x38')]};return db[_0x99bd('0x2a')]['count'](_0x2fcf71)[_0x99bd('0x26')](function(_0x1ecdd6){_0x1d0642[_0x99bd('0x22')]=_0x1ecdd6;if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x40')]){_0x5903aa[_0x99bd('0x41')]=[{'all':!![]}];}return db[_0x99bd('0x2a')][_0x99bd('0x42')](_0x5903aa);})[_0x99bd('0x26')](function(_0x7e84b1){_0x1d0642[_0x99bd('0x43')]=_0x7e84b1;return _0x1d0642;})[_0x99bd('0x26')](respondWithFilteredResult(_0x1eabb9,_0x5903aa))[_0x99bd('0x44')](handleError(_0x1eabb9,null));};exports[_0x99bd('0x45')]=function(_0xb0ffe5,_0x2d91be){var _0x369fb5={'raw':!![],'where':{'id':_0xb0ffe5[_0x99bd('0x46')]['id']}},_0x5a4a96={};_0x5a4a96[_0x99bd('0x2f')]=_[_0x99bd('0x47')](db[_0x99bd('0x2a')][_0x99bd('0x2b')]);_0x5a4a96[_0x99bd('0x30')]=_[_0x99bd('0x47')](_0xb0ffe5[_0x99bd('0x30')]);_0x5a4a96['filters']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],_0x5a4a96[_0x99bd('0x30')]);_0x369fb5['attributes']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0xb0ffe5['query'][_0x99bd('0x33')]));_0x369fb5['attributes']=_0x369fb5['attributes']['length']?_0x369fb5[_0x99bd('0x31')]:_0x5a4a96[_0x99bd('0x2f')];if(_0xb0ffe5[_0x99bd('0x30')]['includeAll']){_0x369fb5[_0x99bd('0x41')]=[{'all':!![]}];}_0x369fb5=_[_0x99bd('0x3c')]({},_0x369fb5,_0xb0ffe5[_0x99bd('0x3f')]);return db['ChatQueueReport'][_0x99bd('0x48')](_0x369fb5)[_0x99bd('0x26')](handleEntityNotFound(_0x2d91be,null))['then'](respondWithResult(_0x2d91be,null))['catch'](handleError(_0x2d91be,null));};exports[_0x99bd('0x49')]=function(_0x1d7ec0,_0x3487c6){return db['ChatQueueReport']['create'](_0x1d7ec0[_0x99bd('0x4a')],{})[_0x99bd('0x26')](respondWithResult(_0x3487c6,0xc9))[_0x99bd('0x44')](handleError(_0x3487c6,null));};exports['update']=function(_0x3fa8e1,_0x4e71b3){if(_0x3fa8e1[_0x99bd('0x4a')]['id']){delete _0x3fa8e1[_0x99bd('0x4a')]['id'];}return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x3fa8e1[_0x99bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e71b3,null))[_0x99bd('0x26')](saveUpdates(_0x3fa8e1['body'],null))[_0x99bd('0x26')](respondWithResult(_0x4e71b3,null))[_0x99bd('0x44')](handleError(_0x4e71b3,null));};exports[_0x99bd('0x4b')]=function(_0x1912ac,_0x2100c7){return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x1912ac['params']['id']}})['then'](handleEntityNotFound(_0x2100c7,null))[_0x99bd('0x26')](removeEntity(_0x2100c7,null))[_0x99bd('0x44')](handleError(_0x2100c7,null));};exports[_0x99bd('0x4c')]=function(_0x2f0fb7,_0x25c67d){return db[_0x99bd('0x2a')][_0x99bd('0x4c')]()['then'](respondWithResult(_0x25c67d,null))['catch'](handleError(_0x25c67d,null));}; \ No newline at end of file +var _0xfe91=['fast-json-patch','moment','bluebird','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/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','find','destroy','describe','eml-format'];(function(_0x1153b7,_0xb9921a){var _0x95b1b6=function(_0x1547b0){while(--_0x1547b0){_0x1153b7['push'](_0x1153b7['shift']());}};_0x95b1b6(++_0xb9921a);}(_0xfe91,0xd4));var _0x1fe9=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xfe91[_0x421eeb];return _0x2c7371;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1fe9('0x1'));var rp=require('request-promise');var moment=require(_0x1fe9('0x2'));var BPromise=require(_0x1fe9('0x3'));var Mustache=require(_0x1fe9('0x4'));var util=require(_0x1fe9('0x5'));var path=require(_0x1fe9('0x6'));var sox=require(_0x1fe9('0x7'));var csv=require(_0x1fe9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fe9('0x9'));var _=require(_0x1fe9('0xa'));var squel=require(_0x1fe9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xc'));var toCsv=require(_0x1fe9('0x8'));var querystring=require('querystring');var Papa=require(_0x1fe9('0xd'));var Redis=require(_0x1fe9('0xe'));var authService=require(_0x1fe9('0xf'));var qs=require(_0x1fe9('0x10'));var as=require(_0x1fe9('0x11'));var hardwareService=require(_0x1fe9('0x12'));var logger=require(_0x1fe9('0x13'))(_0x1fe9('0x14'));var utils=require('../../config/utils');var config=require(_0x1fe9('0x15'));var licenseUtil=require(_0x1fe9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d747e,_0x2deeaf){_0x2deeaf=_0x2deeaf||0xcc;return function(_0x4299dd){if(_0x4299dd){return _0x1d747e[_0x1fe9('0x17')](_0x2deeaf);}return _0x1d747e[_0x1fe9('0x18')](_0x2deeaf)['end']();};}function respondWithResult(_0x1c10ef,_0x1f6026){_0x1f6026=_0x1f6026||0xc8;return function(_0x4c5e41){if(_0x4c5e41){return _0x1c10ef[_0x1fe9('0x18')](_0x1f6026)['json'](_0x4c5e41);}};}function respondWithFilteredResult(_0x30d5c8,_0x3b6988){return function(_0x2f62a8){if(_0x2f62a8){var _0x5da3c1=typeof _0x3b6988[_0x1fe9('0x19')]===_0x1fe9('0x1a')&&typeof _0x3b6988[_0x1fe9('0x1b')]==='undefined';var _0x440e0a=_0x2f62a8[_0x1fe9('0x1c')];var _0x2085ac=_0x5da3c1?0x0:_0x3b6988['offset'];var _0x2070a3=_0x5da3c1?_0x2f62a8['count']:_0x3b6988[_0x1fe9('0x19')]+_0x3b6988[_0x1fe9('0x1b')];var _0x491bcb;if(_0x2070a3>=_0x440e0a){_0x2070a3=_0x440e0a;_0x491bcb=0xc8;}else{_0x491bcb=0xce;}_0x30d5c8[_0x1fe9('0x18')](_0x491bcb);return _0x30d5c8[_0x1fe9('0x1d')](_0x1fe9('0x1e'),_0x2085ac+'-'+_0x2070a3+'/'+_0x440e0a)[_0x1fe9('0x1f')](_0x2f62a8);}return null;};}function patchUpdates(_0x442ae7){return function(_0x125775){try{jsonpatch['apply'](_0x125775,_0x442ae7,!![]);}catch(_0x38ec4e){return BPromise['reject'](_0x38ec4e);}return _0x125775['save']();};}function saveUpdates(_0x15b582,_0xe32090){return function(_0x1859ee){if(_0x1859ee){return _0x1859ee[_0x1fe9('0x20')](_0x15b582)[_0x1fe9('0x21')](function(_0xa79582){return _0xa79582;});}return null;};}function removeEntity(_0x56d3bf,_0x18afe2){return function(_0xa92d55){if(_0xa92d55){return _0xa92d55['destroy']()[_0x1fe9('0x21')](function(){_0x56d3bf[_0x1fe9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e492f,_0x462537){return function(_0x5f135d){if(!_0x5f135d){_0x2e492f[_0x1fe9('0x17')](0x194);}return _0x5f135d;};}function handleError(_0x44ae36,_0x5206a0){_0x5206a0=_0x5206a0||0x1f4;return function(_0x297c4b){logger[_0x1fe9('0x22')](_0x297c4b[_0x1fe9('0x23')]);if(_0x297c4b[_0x1fe9('0x24')]){delete _0x297c4b[_0x1fe9('0x24')];}_0x44ae36[_0x1fe9('0x18')](_0x5206a0)[_0x1fe9('0x25')](_0x297c4b);};}exports[_0x1fe9('0x26')]=function(_0xed426c,_0x1828ca){var _0x2aea20={},_0x11f374={},_0x3551e4={'count':0x0,'rows':[]};var _0x538d33=_[_0x1fe9('0x27')](db[_0x1fe9('0x28')][_0x1fe9('0x29')],function(_0x5319d2){return{'name':_0x5319d2[_0x1fe9('0x2a')],'type':_0x5319d2[_0x1fe9('0x2b')]['key']};});_0x11f374[_0x1fe9('0x2c')]=_['map'](_0x538d33,_0x1fe9('0x24'));_0x11f374[_0x1fe9('0x2d')]=_[_0x1fe9('0x2e')](_0xed426c[_0x1fe9('0x2d')]);_0x11f374[_0x1fe9('0x2f')]=_[_0x1fe9('0x30')](_0x11f374[_0x1fe9('0x2c')],_0x11f374[_0x1fe9('0x2d')]);_0x2aea20[_0x1fe9('0x31')]=_['intersection'](_0x11f374[_0x1fe9('0x2c')],qs[_0x1fe9('0x32')](_0xed426c['query'][_0x1fe9('0x32')]));_0x2aea20[_0x1fe9('0x31')]=_0x2aea20[_0x1fe9('0x31')][_0x1fe9('0x33')]?_0x2aea20[_0x1fe9('0x31')]:_0x11f374[_0x1fe9('0x2c')];if(!_0xed426c['query']['hasOwnProperty'](_0x1fe9('0x34'))){_0x2aea20['limit']=qs['limit'](_0xed426c[_0x1fe9('0x2d')][_0x1fe9('0x1b')]);_0x2aea20[_0x1fe9('0x19')]=qs[_0x1fe9('0x19')](_0xed426c['query'][_0x1fe9('0x19')]);}_0x2aea20['order']=qs[_0x1fe9('0x35')](_0xed426c[_0x1fe9('0x2d')]['sort']);_0x2aea20[_0x1fe9('0x36')]=qs['filters'](_[_0x1fe9('0x37')](_0xed426c[_0x1fe9('0x2d')],_0x11f374[_0x1fe9('0x2f')]),_0x538d33);if(_0xed426c['query'][_0x1fe9('0x38')]){_0x2aea20[_0x1fe9('0x36')]=_[_0x1fe9('0x39')](_0x2aea20['where'],{'$or':_[_0x1fe9('0x27')](_0x538d33,function(_0x1bf2df){if(_0x1bf2df['type']!==_0x1fe9('0x3a')){var _0x36ef35={};_0x36ef35[_0x1bf2df[_0x1fe9('0x24')]]={'$like':'%'+_0xed426c[_0x1fe9('0x2d')][_0x1fe9('0x38')]+'%'};return _0x36ef35;}})});}_0x2aea20=_['merge']({},_0x2aea20,_0xed426c[_0x1fe9('0x3b')]);var _0xcb61ae={'where':_0x2aea20[_0x1fe9('0x36')]};return db[_0x1fe9('0x28')][_0x1fe9('0x1c')](_0xcb61ae)[_0x1fe9('0x21')](function(_0x110530){_0x3551e4['count']=_0x110530;if(_0xed426c['query']['includeAll']){_0x2aea20[_0x1fe9('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x2aea20);})[_0x1fe9('0x21')](function(_0x427db5){_0x3551e4[_0x1fe9('0x3d')]=_0x427db5;return _0x3551e4;})[_0x1fe9('0x21')](respondWithFilteredResult(_0x1828ca,_0x2aea20))[_0x1fe9('0x3e')](handleError(_0x1828ca,null));};exports[_0x1fe9('0x3f')]=function(_0x38f045,_0x2a9bf7){var _0x2b3f92={'raw':!![],'where':{'id':_0x38f045[_0x1fe9('0x40')]['id']}},_0xd4d387={};_0xd4d387[_0x1fe9('0x2c')]=_['keys'](db[_0x1fe9('0x28')]['rawAttributes']);_0xd4d387['query']=_[_0x1fe9('0x2e')](_0x38f045[_0x1fe9('0x2d')]);_0xd4d387[_0x1fe9('0x2f')]=_['intersection'](_0xd4d387['model'],_0xd4d387[_0x1fe9('0x2d')]);_0x2b3f92[_0x1fe9('0x31')]=_[_0x1fe9('0x30')](_0xd4d387['model'],qs[_0x1fe9('0x32')](_0x38f045[_0x1fe9('0x2d')][_0x1fe9('0x32')]));_0x2b3f92[_0x1fe9('0x31')]=_0x2b3f92[_0x1fe9('0x31')][_0x1fe9('0x33')]?_0x2b3f92[_0x1fe9('0x31')]:_0xd4d387[_0x1fe9('0x2c')];if(_0x38f045[_0x1fe9('0x2d')][_0x1fe9('0x41')]){_0x2b3f92[_0x1fe9('0x3c')]=[{'all':!![]}];}_0x2b3f92=_[_0x1fe9('0x39')]({},_0x2b3f92,_0x38f045[_0x1fe9('0x3b')]);return db[_0x1fe9('0x28')]['find'](_0x2b3f92)['then'](handleEntityNotFound(_0x2a9bf7,null))['then'](respondWithResult(_0x2a9bf7,null))[_0x1fe9('0x3e')](handleError(_0x2a9bf7,null));};exports[_0x1fe9('0x42')]=function(_0x2d490f,_0x3c9a4e){return db[_0x1fe9('0x28')][_0x1fe9('0x42')](_0x2d490f[_0x1fe9('0x43')],{})[_0x1fe9('0x21')](respondWithResult(_0x3c9a4e,0xc9))[_0x1fe9('0x3e')](handleError(_0x3c9a4e,null));};exports[_0x1fe9('0x20')]=function(_0x3f9a18,_0x2ccf57){if(_0x3f9a18[_0x1fe9('0x43')]['id']){delete _0x3f9a18[_0x1fe9('0x43')]['id'];}return db[_0x1fe9('0x28')][_0x1fe9('0x44')]({'where':{'id':_0x3f9a18['params']['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x2ccf57,null))[_0x1fe9('0x21')](saveUpdates(_0x3f9a18['body'],null))[_0x1fe9('0x21')](respondWithResult(_0x2ccf57,null))[_0x1fe9('0x3e')](handleError(_0x2ccf57,null));};exports[_0x1fe9('0x45')]=function(_0x85d38e,_0x4eea2d){return db[_0x1fe9('0x28')][_0x1fe9('0x44')]({'where':{'id':_0x85d38e[_0x1fe9('0x40')]['id']}})[_0x1fe9('0x21')](handleEntityNotFound(_0x4eea2d,null))[_0x1fe9('0x21')](removeEntity(_0x4eea2d,null))[_0x1fe9('0x3e')](handleError(_0x4eea2d,null));};exports[_0x1fe9('0x46')]=function(_0x5c4123,_0x3081f8){return db[_0x1fe9('0x28')]['describe']()[_0x1fe9('0x21')](respondWithResult(_0x3081f8,null))[_0x1fe9('0x3e')](handleError(_0x3081f8,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index a7bd846..989d8b3 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x3ce6d2,_0x90364d){var _0x4c1dd4=function(_0x3b2e50){while(--_0x3b2e50){_0x3ce6d2['push'](_0x3ce6d2['shift']());}};_0x4c1dd4(++_0x90364d);}(_0xb10b,0x12a));var _0xbb10=function(_0xa6180a,_0x508ff9){_0xa6180a=_0xa6180a-0x0;var _0x10f626=_0xb10b[_0xa6180a];return _0x10f626;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2342a4,_0x2d6b71){var _0x2d64d8=function(_0x4c347d){while(--_0x4c347d){_0x2342a4['push'](_0x2342a4['shift']());}};_0x2d64d8(++_0x2d6b71);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 51f91fc..86fa613 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 _0x1fd7=['UpdateChatQueueReport','update','body','where','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','options','raw','then'];(function(_0xb18948,_0x44499c){var _0x3eb80e=function(_0x1c09bb){while(--_0x1c09bb){_0xb18948['push'](_0xb18948['shift']());}};_0x3eb80e(++_0x44499c);}(_0x1fd7,0x12e));var _0x71fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1fd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x71fd('0x0'));var moment=require(_0x71fd('0x1'));var BPromise=require(_0x71fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71fd('0x3'))['db'];var utils=require(_0x71fd('0x4'));var logger=require('../../config/logger')(_0x71fd('0x5'));var config=require(_0x71fd('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x458fb8,_0x407e92,_0x363f80){return new BPromise(function(_0x39be34,_0x9be35c){return client[_0x71fd('0x7')](_0x458fb8,_0x363f80)['then'](function(_0x3d57b8){logger['info'](_0x71fd('0x8'),_0x407e92,_0x71fd('0x9'));logger[_0x71fd('0xa')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x407e92,_0x71fd('0x9'),JSON[_0x71fd('0xb')](_0x3d57b8));if(_0x3d57b8[_0x71fd('0xc')]){if(_0x3d57b8[_0x71fd('0xc')][_0x71fd('0xd')]===0x1f4){logger[_0x71fd('0xc')](_0x71fd('0x8'),_0x407e92,_0x3d57b8[_0x71fd('0xc')][_0x71fd('0xe')]);return _0x9be35c(_0x3d57b8[_0x71fd('0xc')][_0x71fd('0xe')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x407e92,_0x3d57b8['error'][_0x71fd('0xe')]);return _0x39be34(_0x3d57b8[_0x71fd('0xc')][_0x71fd('0xe')]);}else{logger[_0x71fd('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x407e92,_0x71fd('0x9'));_0x39be34(_0x3d57b8['result'][_0x71fd('0xe')]);}})[_0x71fd('0x10')](function(_0x549043){logger[_0x71fd('0xc')](_0x71fd('0x8'),_0x407e92,_0x549043);_0x9be35c(_0x549043);});});}exports[_0x71fd('0x11')]=function(_0x164794){var _0x17cce6=this;return new Promise(function(_0x462571,_0x448887){return db[_0x71fd('0x12')]['create'](_0x164794['body'],{'raw':_0x164794['options']?_0x164794[_0x71fd('0x13')][_0x71fd('0x14')]===undefined?!![]:![]:!![]})[_0x71fd('0x15')](function(_0x9f9414){logger[_0x71fd('0xf')]('CreateChatQueueReport',_0x164794);logger[_0x71fd('0xa')](_0x71fd('0x11'),_0x164794,JSON[_0x71fd('0xb')](_0x9f9414));_0x462571(_0x9f9414);})[_0x71fd('0x10')](function(_0x317640){logger[_0x71fd('0xc')](_0x71fd('0x11'),_0x317640['message'],_0x164794);_0x448887(_0x17cce6['error'](0x1f4,_0x317640[_0x71fd('0xe')]));});});};exports[_0x71fd('0x16')]=function(_0x3fb897){var _0x1371c6=this;return new Promise(function(_0x382625,_0x7aacfc){return db[_0x71fd('0x12')][_0x71fd('0x17')](_0x3fb897[_0x71fd('0x18')],{'raw':_0x3fb897['options']?_0x3fb897['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb897[_0x71fd('0x13')]?_0x3fb897[_0x71fd('0x13')][_0x71fd('0x19')]||null:null,'attributes':_0x3fb897['options']?_0x3fb897[_0x71fd('0x13')][_0x71fd('0x1a')]||null:null,'limit':_0x3fb897['options']?_0x3fb897[_0x71fd('0x13')]['limit']||null:null})[_0x71fd('0x15')](function(_0x4719af){logger[_0x71fd('0xf')]('UpdateChatQueueReport',_0x3fb897);logger[_0x71fd('0xa')](_0x71fd('0x16'),_0x3fb897,JSON[_0x71fd('0xb')](_0x4719af));_0x382625(_0x4719af);})[_0x71fd('0x10')](function(_0x4b29d9){logger[_0x71fd('0xc')](_0x71fd('0x16'),_0x4b29d9[_0x71fd('0xe')],_0x3fb897);_0x7aacfc(_0x1371c6['error'](0x1f4,_0x4b29d9[_0x71fd('0xe')]));});});}; \ No newline at end of file +var _0x2a4b=['info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','catch','CreateChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','ChatQueueReport','update','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2a4b,0x115));var _0xb2a4=function(_0x4d4bc1,_0x210bcc){_0x4d4bc1=_0x4d4bc1-0x0;var _0x21bd8f=_0x2a4b[_0x4d4bc1];return _0x21bd8f;};'use strict';var _=require(_0xb2a4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2a4('0x1'));var rs=require(_0xb2a4('0x2'));var fs=require('fs');var Redis=require(_0xb2a4('0x3'));var db=require(_0xb2a4('0x4'))['db'];var utils=require(_0xb2a4('0x5'));var logger=require(_0xb2a4('0x6'))(_0xb2a4('0x7'));var config=require(_0xb2a4('0x8'));var jayson=require(_0xb2a4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5d1d,_0x1accb3,_0x1e093a){return new BPromise(function(_0x46ae3e,_0x5d6783){return client[_0xb2a4('0xa')](_0x3e5d1d,_0x1e093a)['then'](function(_0x42fcf4){logger[_0xb2a4('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x1accb3,_0xb2a4('0xc'));logger['debug'](_0xb2a4('0xd'),_0x1accb3,_0xb2a4('0xc'),JSON[_0xb2a4('0xe')](_0x42fcf4));if(_0x42fcf4[_0xb2a4('0xf')]){if(_0x42fcf4[_0xb2a4('0xf')][_0xb2a4('0x10')]===0x1f4){logger[_0xb2a4('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1accb3,_0x42fcf4[_0xb2a4('0xf')]['message']);return _0x5d6783(_0x42fcf4['error'][_0xb2a4('0x11')]);}logger['error'](_0xb2a4('0x12'),_0x1accb3,_0x42fcf4[_0xb2a4('0xf')]['message']);return _0x46ae3e(_0x42fcf4[_0xb2a4('0xf')][_0xb2a4('0x11')]);}else{logger[_0xb2a4('0xb')](_0xb2a4('0x12'),_0x1accb3,_0xb2a4('0xc'));_0x46ae3e(_0x42fcf4['result']['message']);}})[_0xb2a4('0x13')](function(_0x4a6d91){logger['error'](_0xb2a4('0x12'),_0x1accb3,_0x4a6d91);_0x5d6783(_0x4a6d91);});});}exports[_0xb2a4('0x14')]=function(_0x3f647f){var _0x8e730f=this;return new Promise(function(_0x34d2f7,_0x15a499){return db['ChatQueueReport'][_0xb2a4('0x15')](_0x3f647f[_0xb2a4('0x16')],{'raw':_0x3f647f['options']?_0x3f647f[_0xb2a4('0x17')][_0xb2a4('0x18')]===undefined?!![]:![]:!![]})[_0xb2a4('0x19')](function(_0x1798df){logger['info'](_0xb2a4('0x14'),_0x3f647f);logger[_0xb2a4('0x1a')]('CreateChatQueueReport',_0x3f647f,JSON['stringify'](_0x1798df));_0x34d2f7(_0x1798df);})['catch'](function(_0xeb5206){logger[_0xb2a4('0xf')]('CreateChatQueueReport',_0xeb5206[_0xb2a4('0x11')],_0x3f647f);_0x15a499(_0x8e730f['error'](0x1f4,_0xeb5206[_0xb2a4('0x11')]));});});};exports[_0xb2a4('0x1b')]=function(_0x515b73){var _0xbf4e38=this;return new Promise(function(_0x811b74,_0x3eada2){return db[_0xb2a4('0x1c')][_0xb2a4('0x1d')](_0x515b73[_0xb2a4('0x16')],{'raw':_0x515b73['options']?_0x515b73[_0xb2a4('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x515b73[_0xb2a4('0x17')]?_0x515b73[_0xb2a4('0x17')][_0xb2a4('0x1e')]||null:null,'attributes':_0x515b73['options']?_0x515b73['options']['attributes']||null:null,'limit':_0x515b73[_0xb2a4('0x17')]?_0x515b73[_0xb2a4('0x17')][_0xb2a4('0x1f')]||null:null})[_0xb2a4('0x19')](function(_0x5b4716){logger['info'](_0xb2a4('0x1b'),_0x515b73);logger[_0xb2a4('0x1a')](_0xb2a4('0x1b'),_0x515b73,JSON[_0xb2a4('0xe')](_0x5b4716));_0x811b74(_0x5b4716);})['catch'](function(_0x594cc0){logger[_0xb2a4('0xf')](_0xb2a4('0x1b'),_0x594cc0[_0xb2a4('0x11')],_0x515b73);_0x3eada2(_0xbf4e38['error'](0x1f4,_0x594cc0[_0xb2a4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index bd4bde4..d6ed7b7 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 _0xa8ee=['./chatQueueReport.controller','isAuthenticated','index','get','/describe','show','post','update','delete','/:id','destroy','multer','util','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa8ee,0xb5));var _0xea8e=function(_0x5aba95,_0x3c9071){_0x5aba95=_0x5aba95-0x0;var _0x351c79=_0xa8ee[_0x5aba95];return _0x351c79;};'use strict';var multer=require(_0xea8e('0x0'));var util=require(_0xea8e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xea8e('0x2'));var router=express['Router']();var fs_extra=require(_0xea8e('0x3'));var auth=require(_0xea8e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea8e('0x5'));var controller=require(_0xea8e('0x6'));router['get']('/',auth[_0xea8e('0x7')](),controller[_0xea8e('0x8')]);router[_0xea8e('0x9')](_0xea8e('0xa'),auth[_0xea8e('0x7')](),controller['describe']);router[_0xea8e('0x9')]('/:id',auth[_0xea8e('0x7')](),controller[_0xea8e('0xb')]);router[_0xea8e('0xc')]('/',auth[_0xea8e('0x7')](),controller['create']);router['put']('/:id',auth[_0xea8e('0x7')](),controller[_0xea8e('0xd')]);router[_0xea8e('0xe')](_0xea8e('0xf'),auth[_0xea8e('0x7')](),controller[_0xea8e('0x10')]);module['exports']=router; \ No newline at end of file +var _0x00f7=['util','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','describe','show','put','/:id','update','delete','destroy','exports','multer'];(function(_0x284d1d,_0x34d794){var _0x351cfa=function(_0x45c45b){while(--_0x45c45b){_0x284d1d['push'](_0x284d1d['shift']());}};_0x351cfa(++_0x34d794);}(_0x00f7,0x164));var _0x700f=function(_0x6fc1f7,_0x5eb5ed){_0x6fc1f7=_0x6fc1f7-0x0;var _0xbdf91f=_0x00f7[_0x6fc1f7];return _0xbdf91f;};'use strict';var multer=require(_0x700f('0x0'));var util=require(_0x700f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x700f('0x2'));var router=express[_0x700f('0x3')]();var fs_extra=require(_0x700f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x700f('0x5'));var config=require('../../config/environment');var controller=require(_0x700f('0x6'));router[_0x700f('0x7')]('/',auth[_0x700f('0x8')](),controller['index']);router[_0x700f('0x7')]('/describe',auth[_0x700f('0x8')](),controller[_0x700f('0x9')]);router[_0x700f('0x7')]('/:id',auth[_0x700f('0x8')](),controller[_0x700f('0xa')]);router['post']('/',auth[_0x700f('0x8')](),controller['create']);router[_0x700f('0xb')](_0x700f('0xc'),auth['isAuthenticated'](),controller[_0x700f('0xd')]);router[_0x700f('0xe')](_0x700f('0xc'),auth[_0x700f('0x8')](),controller[_0x700f('0xf')]);module[_0x700f('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 5056e7d..59b8c41 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x25f3cf,_0xdbfde8){var _0x5417aa=function(_0xd4d386){while(--_0xd4d386){_0x25f3cf['push'](_0x25f3cf['shift']());}};_0x5417aa(++_0xdbfde8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xcb91[_0x5678b5];return _0x4c09a5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x279b97,_0x28cb69){var _0x4d373e=function(_0x1067e0){while(--_0x1067e0){_0x279b97['push'](_0x279b97['shift']());}};_0x4d373e(++_0x28cb69);}(_0xaa88,0x137));var _0x8aa8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xaa88[_0x369151];return _0x4292d5;};'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 diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2afd95c..2f5c4b3 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 _0x8556=['destroy','status','name','send','map','ChatTransferReport','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','apply','then'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x8556,0x1da));var _0x6855=function(_0x5acd84,_0x378158){_0x5acd84=_0x5acd84-0x0;var _0x4fbe2e=_0x8556[_0x5acd84];return _0x4fbe2e;};'use strict';var emlformat=require(_0x6855('0x0'));var rimraf=require(_0x6855('0x1'));var zipdir=require(_0x6855('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6855('0x3'));var moment=require(_0x6855('0x4'));var BPromise=require(_0x6855('0x5'));var Mustache=require(_0x6855('0x6'));var util=require(_0x6855('0x7'));var path=require(_0x6855('0x8'));var sox=require(_0x6855('0x9'));var csv=require(_0x6855('0xa'));var ejs=require(_0x6855('0xb'));var fs=require('fs');var fs_extra=require(_0x6855('0xc'));var _=require(_0x6855('0xd'));var squel=require('squel');var crypto=require(_0x6855('0xe'));var jsforce=require(_0x6855('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6855('0xa'));var querystring=require(_0x6855('0x10'));var Papa=require(_0x6855('0x11'));var Redis=require(_0x6855('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6855('0x13'));var as=require(_0x6855('0x14'));var hardwareService=require(_0x6855('0x15'));var logger=require('../../config/logger')(_0x6855('0x16'));var utils=require(_0x6855('0x17'));var config=require(_0x6855('0x18'));var licenseUtil=require(_0x6855('0x19'));var db=require(_0x6855('0x1a'))['db'];function respondWithStatusCode(_0x42a558,_0x21417f){_0x21417f=_0x21417f||0xcc;return function(_0x438870){if(_0x438870){return _0x42a558[_0x6855('0x1b')](_0x21417f);}return _0x42a558['status'](_0x21417f)[_0x6855('0x1c')]();};}function respondWithResult(_0x250071,_0x3c9fc3){_0x3c9fc3=_0x3c9fc3||0xc8;return function(_0x3c8fef){if(_0x3c8fef){return _0x250071['status'](_0x3c9fc3)['json'](_0x3c8fef);}};}function respondWithFilteredResult(_0x47dce7,_0x3c9b19){return function(_0x4b5422){if(_0x4b5422){var _0x523fb4=typeof _0x3c9b19[_0x6855('0x1d')]===_0x6855('0x1e')&&typeof _0x3c9b19[_0x6855('0x1f')]==='undefined';var _0x80db89=_0x4b5422[_0x6855('0x20')];var _0xe49dcc=_0x523fb4?0x0:_0x3c9b19[_0x6855('0x1d')];var _0x3ef1e5=_0x523fb4?_0x4b5422[_0x6855('0x20')]:_0x3c9b19[_0x6855('0x1d')]+_0x3c9b19['limit'];var _0x532b3d;if(_0x3ef1e5>=_0x80db89){_0x3ef1e5=_0x80db89;_0x532b3d=0xc8;}else{_0x532b3d=0xce;}_0x47dce7['status'](_0x532b3d);return _0x47dce7[_0x6855('0x21')](_0x6855('0x22'),_0xe49dcc+'-'+_0x3ef1e5+'/'+_0x80db89)['json'](_0x4b5422);}return null;};}function patchUpdates(_0x3fd295){return function(_0x1d454f){try{jsonpatch[_0x6855('0x23')](_0x1d454f,_0x3fd295,!![]);}catch(_0x1aa7d7){return BPromise['reject'](_0x1aa7d7);}return _0x1d454f['save']();};}function saveUpdates(_0x78a466,_0x4160c5){return function(_0x74319e){if(_0x74319e){return _0x74319e['update'](_0x78a466)[_0x6855('0x24')](function(_0x10af64){return _0x10af64;});}return null;};}function removeEntity(_0x5d9c1e,_0x5a589c){return function(_0x2db098){if(_0x2db098){return _0x2db098[_0x6855('0x25')]()[_0x6855('0x24')](function(){_0x5d9c1e[_0x6855('0x26')](0xcc)[_0x6855('0x1c')]();});}};}function handleEntityNotFound(_0x381174,_0x4b32e8){return function(_0x4aed3c){if(!_0x4aed3c){_0x381174[_0x6855('0x1b')](0x194);}return _0x4aed3c;};}function handleError(_0x3aa7f6,_0x54c94c){_0x54c94c=_0x54c94c||0x1f4;return function(_0x51ea76){logger['error'](_0x51ea76['stack']);if(_0x51ea76[_0x6855('0x27')]){delete _0x51ea76['name'];}_0x3aa7f6[_0x6855('0x26')](_0x54c94c)[_0x6855('0x28')](_0x51ea76);};}exports['index']=function(_0x360b6b,_0x17c049){var _0x34022b={},_0x3b9193={},_0x344dca={'count':0x0,'rows':[]};var _0x30c9c8=_[_0x6855('0x29')](db[_0x6855('0x2a')][_0x6855('0x2b')],function(_0x29a4dd){return{'name':_0x29a4dd['fieldName'],'type':_0x29a4dd[_0x6855('0x2c')][_0x6855('0x2d')]};});_0x3b9193['model']=_['map'](_0x30c9c8,_0x6855('0x27'));_0x3b9193[_0x6855('0x2e')]=_[_0x6855('0x2f')](_0x360b6b['query']);_0x3b9193['filters']=_[_0x6855('0x30')](_0x3b9193[_0x6855('0x31')],_0x3b9193['query']);_0x34022b[_0x6855('0x32')]=_[_0x6855('0x30')](_0x3b9193['model'],qs[_0x6855('0x33')](_0x360b6b[_0x6855('0x2e')][_0x6855('0x33')]));_0x34022b[_0x6855('0x32')]=_0x34022b[_0x6855('0x32')][_0x6855('0x34')]?_0x34022b[_0x6855('0x32')]:_0x3b9193['model'];if(!_0x360b6b[_0x6855('0x2e')][_0x6855('0x35')](_0x6855('0x36'))){_0x34022b[_0x6855('0x1f')]=qs[_0x6855('0x1f')](_0x360b6b[_0x6855('0x2e')][_0x6855('0x1f')]);_0x34022b[_0x6855('0x1d')]=qs['offset'](_0x360b6b[_0x6855('0x2e')]['offset']);}_0x34022b[_0x6855('0x37')]=qs[_0x6855('0x38')](_0x360b6b[_0x6855('0x2e')]['sort']);_0x34022b[_0x6855('0x39')]=qs[_0x6855('0x3a')](_[_0x6855('0x3b')](_0x360b6b[_0x6855('0x2e')],_0x3b9193[_0x6855('0x3a')]),_0x30c9c8);if(_0x360b6b['query'][_0x6855('0x3c')]){_0x34022b['where']=_[_0x6855('0x3d')](_0x34022b[_0x6855('0x39')],{'$or':_[_0x6855('0x29')](_0x30c9c8,function(_0x537ce5){if(_0x537ce5[_0x6855('0x2c')]!==_0x6855('0x3e')){var _0x2580a5={};_0x2580a5[_0x537ce5[_0x6855('0x27')]]={'$like':'%'+_0x360b6b[_0x6855('0x2e')][_0x6855('0x3c')]+'%'};return _0x2580a5;}})});}_0x34022b=_[_0x6855('0x3d')]({},_0x34022b,_0x360b6b[_0x6855('0x3f')]);var _0x12e1a3={'where':_0x34022b[_0x6855('0x39')]};return db[_0x6855('0x2a')][_0x6855('0x20')](_0x12e1a3)['then'](function(_0x531115){_0x344dca['count']=_0x531115;if(_0x360b6b[_0x6855('0x2e')][_0x6855('0x40')]){_0x34022b[_0x6855('0x41')]=[{'all':!![]}];}return db[_0x6855('0x2a')][_0x6855('0x42')](_0x34022b);})[_0x6855('0x24')](function(_0x42c8bd){_0x344dca['rows']=_0x42c8bd;return _0x344dca;})[_0x6855('0x24')](respondWithFilteredResult(_0x17c049,_0x34022b))[_0x6855('0x43')](handleError(_0x17c049,null));};exports[_0x6855('0x44')]=function(_0x389037,_0x7fb754){var _0x2ac855={'raw':!![],'where':{'id':_0x389037[_0x6855('0x45')]['id']}},_0x328089={};_0x328089[_0x6855('0x31')]=_[_0x6855('0x2f')](db[_0x6855('0x2a')][_0x6855('0x2b')]);_0x328089[_0x6855('0x2e')]=_[_0x6855('0x2f')](_0x389037[_0x6855('0x2e')]);_0x328089[_0x6855('0x3a')]=_[_0x6855('0x30')](_0x328089[_0x6855('0x31')],_0x328089[_0x6855('0x2e')]);_0x2ac855[_0x6855('0x32')]=_['intersection'](_0x328089[_0x6855('0x31')],qs[_0x6855('0x33')](_0x389037[_0x6855('0x2e')][_0x6855('0x33')]));_0x2ac855[_0x6855('0x32')]=_0x2ac855[_0x6855('0x32')][_0x6855('0x34')]?_0x2ac855['attributes']:_0x328089[_0x6855('0x31')];if(_0x389037[_0x6855('0x2e')][_0x6855('0x40')]){_0x2ac855[_0x6855('0x41')]=[{'all':!![]}];}_0x2ac855=_[_0x6855('0x3d')]({},_0x2ac855,_0x389037['options']);return db[_0x6855('0x2a')][_0x6855('0x46')](_0x2ac855)[_0x6855('0x24')](handleEntityNotFound(_0x7fb754,null))[_0x6855('0x24')](respondWithResult(_0x7fb754,null))[_0x6855('0x43')](handleError(_0x7fb754,null));};exports['create']=function(_0x45c91e,_0xe1504d){return db['ChatTransferReport']['create'](_0x45c91e[_0x6855('0x47')],{})['then'](respondWithResult(_0xe1504d,0xc9))[_0x6855('0x43')](handleError(_0xe1504d,null));};exports['update']=function(_0x5ae700,_0x438c60){if(_0x5ae700[_0x6855('0x47')]['id']){delete _0x5ae700[_0x6855('0x47')]['id'];}return db[_0x6855('0x2a')][_0x6855('0x46')]({'where':{'id':_0x5ae700[_0x6855('0x45')]['id']}})['then'](handleEntityNotFound(_0x438c60,null))[_0x6855('0x24')](saveUpdates(_0x5ae700[_0x6855('0x47')],null))['then'](respondWithResult(_0x438c60,null))['catch'](handleError(_0x438c60,null));};exports[_0x6855('0x25')]=function(_0x1bed5c,_0x14ddbf){return db['ChatTransferReport']['find']({'where':{'id':_0x1bed5c['params']['id']}})[_0x6855('0x24')](handleEntityNotFound(_0x14ddbf,null))[_0x6855('0x24')](removeEntity(_0x14ddbf,null))[_0x6855('0x43')](handleError(_0x14ddbf,null));};exports['describe']=function(_0x2697de,_0x233ccc){return db[_0x6855('0x2a')][_0x6855('0x48')]()['then'](respondWithResult(_0x233ccc,null))[_0x6855('0x43')](handleError(_0x233ccc,null));}; \ No newline at end of file +var _0x1663=['error','stack','name','send','map','ChatTransferReport','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1663,0x103));var _0x3166=function(_0x5f01aa,_0x561786){_0x5f01aa=_0x5f01aa-0x0;var _0x48ff2b=_0x1663[_0x5f01aa];return _0x48ff2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3166('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3166('0x1'));var moment=require(_0x3166('0x2'));var BPromise=require(_0x3166('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3166('0x4'));var sox=require(_0x3166('0x5'));var csv=require(_0x3166('0x6'));var ejs=require(_0x3166('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3166('0x8'));var squel=require(_0x3166('0x9'));var crypto=require(_0x3166('0xa'));var jsforce=require(_0x3166('0xb'));var deskjs=require(_0x3166('0xc'));var toCsv=require(_0x3166('0x6'));var querystring=require(_0x3166('0xd'));var Papa=require(_0x3166('0xe'));var Redis=require('ioredis');var authService=require(_0x3166('0xf'));var qs=require(_0x3166('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3166('0x11'));var utils=require(_0x3166('0x12'));var config=require(_0x3166('0x13'));var licenseUtil=require(_0x3166('0x14'));var db=require(_0x3166('0x15'))['db'];function respondWithStatusCode(_0x47f959,_0x2a1974){_0x2a1974=_0x2a1974||0xcc;return function(_0x36705e){if(_0x36705e){return _0x47f959[_0x3166('0x16')](_0x2a1974);}return _0x47f959[_0x3166('0x17')](_0x2a1974)['end']();};}function respondWithResult(_0x3f6f78,_0x584007){_0x584007=_0x584007||0xc8;return function(_0x52bd3a){if(_0x52bd3a){return _0x3f6f78[_0x3166('0x17')](_0x584007)[_0x3166('0x18')](_0x52bd3a);}};}function respondWithFilteredResult(_0x5be66f,_0xa10a78){return function(_0x2cfe4e){if(_0x2cfe4e){var _0x213de8=typeof _0xa10a78[_0x3166('0x19')]===_0x3166('0x1a')&&typeof _0xa10a78[_0x3166('0x1b')]===_0x3166('0x1a');var _0x1bf88d=_0x2cfe4e[_0x3166('0x1c')];var _0x346e04=_0x213de8?0x0:_0xa10a78['offset'];var _0x20a99a=_0x213de8?_0x2cfe4e[_0x3166('0x1c')]:_0xa10a78[_0x3166('0x19')]+_0xa10a78['limit'];var _0x75bb56;if(_0x20a99a>=_0x1bf88d){_0x20a99a=_0x1bf88d;_0x75bb56=0xc8;}else{_0x75bb56=0xce;}_0x5be66f[_0x3166('0x17')](_0x75bb56);return _0x5be66f[_0x3166('0x1d')](_0x3166('0x1e'),_0x346e04+'-'+_0x20a99a+'/'+_0x1bf88d)[_0x3166('0x18')](_0x2cfe4e);}return null;};}function patchUpdates(_0x15a5a8){return function(_0x36fa1d){try{jsonpatch['apply'](_0x36fa1d,_0x15a5a8,!![]);}catch(_0x5cfdfe){return BPromise[_0x3166('0x1f')](_0x5cfdfe);}return _0x36fa1d[_0x3166('0x20')]();};}function saveUpdates(_0x44c26f,_0xc25c6a){return function(_0x13c8af){if(_0x13c8af){return _0x13c8af[_0x3166('0x21')](_0x44c26f)['then'](function(_0x2e30ca){return _0x2e30ca;});}return null;};}function removeEntity(_0x2d6ca3,_0x3f9ed4){return function(_0x2857f0){if(_0x2857f0){return _0x2857f0[_0x3166('0x22')]()[_0x3166('0x23')](function(){_0x2d6ca3[_0x3166('0x17')](0xcc)[_0x3166('0x24')]();});}};}function handleEntityNotFound(_0x31ddf8,_0x21f502){return function(_0x40fb84){if(!_0x40fb84){_0x31ddf8[_0x3166('0x16')](0x194);}return _0x40fb84;};}function handleError(_0xf3f53f,_0x54e366){_0x54e366=_0x54e366||0x1f4;return function(_0x2d04b1){logger[_0x3166('0x25')](_0x2d04b1[_0x3166('0x26')]);if(_0x2d04b1['name']){delete _0x2d04b1[_0x3166('0x27')];}_0xf3f53f[_0x3166('0x17')](_0x54e366)[_0x3166('0x28')](_0x2d04b1);};}exports['index']=function(_0x4e26dd,_0x4318fe){var _0x4c2109={},_0x32bce8={},_0xc4050b={'count':0x0,'rows':[]};var _0x17a8a4=_[_0x3166('0x29')](db[_0x3166('0x2a')][_0x3166('0x2b')],function(_0x64e01d){return{'name':_0x64e01d['fieldName'],'type':_0x64e01d['type'][_0x3166('0x2c')]};});_0x32bce8['model']=_['map'](_0x17a8a4,_0x3166('0x27'));_0x32bce8[_0x3166('0x2d')]=_[_0x3166('0x2e')](_0x4e26dd[_0x3166('0x2d')]);_0x32bce8['filters']=_[_0x3166('0x2f')](_0x32bce8[_0x3166('0x30')],_0x32bce8[_0x3166('0x2d')]);_0x4c2109[_0x3166('0x31')]=_[_0x3166('0x2f')](_0x32bce8[_0x3166('0x30')],qs[_0x3166('0x32')](_0x4e26dd[_0x3166('0x2d')][_0x3166('0x32')]));_0x4c2109[_0x3166('0x31')]=_0x4c2109[_0x3166('0x31')][_0x3166('0x33')]?_0x4c2109['attributes']:_0x32bce8[_0x3166('0x30')];if(!_0x4e26dd['query'][_0x3166('0x34')](_0x3166('0x35'))){_0x4c2109['limit']=qs[_0x3166('0x1b')](_0x4e26dd[_0x3166('0x2d')][_0x3166('0x1b')]);_0x4c2109['offset']=qs[_0x3166('0x19')](_0x4e26dd[_0x3166('0x2d')]['offset']);}_0x4c2109[_0x3166('0x36')]=qs['sort'](_0x4e26dd[_0x3166('0x2d')][_0x3166('0x37')]);_0x4c2109['where']=qs[_0x3166('0x38')](_[_0x3166('0x39')](_0x4e26dd[_0x3166('0x2d')],_0x32bce8[_0x3166('0x38')]),_0x17a8a4);if(_0x4e26dd['query'][_0x3166('0x3a')]){_0x4c2109[_0x3166('0x3b')]=_[_0x3166('0x3c')](_0x4c2109['where'],{'$or':_[_0x3166('0x29')](_0x17a8a4,function(_0x4ad256){if(_0x4ad256[_0x3166('0x3d')]!==_0x3166('0x3e')){var _0x4019e0={};_0x4019e0[_0x4ad256['name']]={'$like':'%'+_0x4e26dd[_0x3166('0x2d')][_0x3166('0x3a')]+'%'};return _0x4019e0;}})});}_0x4c2109=_[_0x3166('0x3c')]({},_0x4c2109,_0x4e26dd['options']);var _0x3981e3={'where':_0x4c2109['where']};return db['ChatTransferReport']['count'](_0x3981e3)[_0x3166('0x23')](function(_0x35ca16){_0xc4050b[_0x3166('0x1c')]=_0x35ca16;if(_0x4e26dd[_0x3166('0x2d')][_0x3166('0x3f')]){_0x4c2109[_0x3166('0x40')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x4c2109);})['then'](function(_0x494081){_0xc4050b[_0x3166('0x41')]=_0x494081;return _0xc4050b;})['then'](respondWithFilteredResult(_0x4318fe,_0x4c2109))[_0x3166('0x42')](handleError(_0x4318fe,null));};exports[_0x3166('0x43')]=function(_0x50037d,_0x3d8d11){var _0x441503={'raw':!![],'where':{'id':_0x50037d[_0x3166('0x44')]['id']}},_0x1f7f21={};_0x1f7f21[_0x3166('0x30')]=_[_0x3166('0x2e')](db[_0x3166('0x2a')][_0x3166('0x2b')]);_0x1f7f21[_0x3166('0x2d')]=_[_0x3166('0x2e')](_0x50037d[_0x3166('0x2d')]);_0x1f7f21[_0x3166('0x38')]=_[_0x3166('0x2f')](_0x1f7f21[_0x3166('0x30')],_0x1f7f21[_0x3166('0x2d')]);_0x441503[_0x3166('0x31')]=_[_0x3166('0x2f')](_0x1f7f21[_0x3166('0x30')],qs[_0x3166('0x32')](_0x50037d[_0x3166('0x2d')][_0x3166('0x32')]));_0x441503[_0x3166('0x31')]=_0x441503['attributes'][_0x3166('0x33')]?_0x441503['attributes']:_0x1f7f21[_0x3166('0x30')];if(_0x50037d[_0x3166('0x2d')][_0x3166('0x3f')]){_0x441503[_0x3166('0x40')]=[{'all':!![]}];}_0x441503=_[_0x3166('0x3c')]({},_0x441503,_0x50037d[_0x3166('0x45')]);return db[_0x3166('0x2a')][_0x3166('0x46')](_0x441503)[_0x3166('0x23')](handleEntityNotFound(_0x3d8d11,null))['then'](respondWithResult(_0x3d8d11,null))[_0x3166('0x42')](handleError(_0x3d8d11,null));};exports[_0x3166('0x47')]=function(_0x3e5f4e,_0x30d0ce){return db['ChatTransferReport'][_0x3166('0x47')](_0x3e5f4e[_0x3166('0x48')],{})[_0x3166('0x23')](respondWithResult(_0x30d0ce,0xc9))[_0x3166('0x42')](handleError(_0x30d0ce,null));};exports['update']=function(_0xd76c02,_0x30a5f1){if(_0xd76c02[_0x3166('0x48')]['id']){delete _0xd76c02['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0xd76c02[_0x3166('0x44')]['id']}})[_0x3166('0x23')](handleEntityNotFound(_0x30a5f1,null))[_0x3166('0x23')](saveUpdates(_0xd76c02[_0x3166('0x48')],null))['then'](respondWithResult(_0x30a5f1,null))[_0x3166('0x42')](handleError(_0x30a5f1,null));};exports[_0x3166('0x22')]=function(_0x49ff46,_0x2beda1){return db['ChatTransferReport']['find']({'where':{'id':_0x49ff46[_0x3166('0x44')]['id']}})[_0x3166('0x23')](handleEntityNotFound(_0x2beda1,null))[_0x3166('0x23')](removeEntity(_0x2beda1,null))[_0x3166('0x42')](handleError(_0x2beda1,null));};exports[_0x3166('0x49')]=function(_0x6a496e,_0x4bac28){return db[_0x3166('0x2a')][_0x3166('0x49')]()[_0x3166('0x23')](respondWithResult(_0x4bac28,null))[_0x3166('0x42')](handleError(_0x4bac28,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3253cb2..658569c 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 _0xbfdb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','report_chat_transfer','uniqueid'];(function(_0x20d8fe,_0x14b2fc){var _0x4ef992=function(_0x365a6f){while(--_0x365a6f){_0x20d8fe['push'](_0x20d8fe['shift']());}};_0x4ef992(++_0x14b2fc);}(_0xbfdb,0x16b));var _0xbbfd=function(_0x320953,_0x59b52c){_0x320953=_0x320953-0x0;var _0xba899f=_0xbfdb[_0x320953];return _0xba899f;};'use strict';var _=require('lodash');var util=require(_0xbbfd('0x0'));var logger=require(_0xbbfd('0x1'))(_0xbbfd('0x2'));var moment=require(_0xbbfd('0x3'));var BPromise=require(_0xbbfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbfd('0x5'));var config=require(_0xbbfd('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xbbfd('0x7')]=function(_0x1f6332,_0x3c746a){return _0x1f6332[_0xbbfd('0x8')]('ChatTransferReport',attributes,{'tableName':_0xbbfd('0x9'),'paranoid':![],'indexes':[{'name':_0xbbfd('0xa'),'fields':[_0xbbfd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a1c=['rimraf','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x4b4ce5,_0x573d2d){var _0x6522f3=function(_0x3ea0d7){while(--_0x3ea0d7){_0x4b4ce5['push'](_0x4b4ce5['shift']());}};_0x6522f3(++_0x573d2d);}(_0x0a1c,0x18c));var _0xc0a1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0a1c[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc0a1('0x0'));var util=require(_0xc0a1('0x1'));var logger=require(_0xc0a1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc0a1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0a1('0x4'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xc0a1('0x5')]=function(_0x45788e,_0x6b439c){return _0x45788e[_0xc0a1('0x6')](_0xc0a1('0x7'),attributes,{'tableName':_0xc0a1('0x8'),'paranoid':![],'indexes':[{'name':_0xc0a1('0x9'),'fields':[_0xc0a1('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index e8fcd71..89f9ab2 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 _0x7fb0=['../../config/environment','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1e1350,_0x54a677){var _0x3786a9=function(_0x617bed){while(--_0x617bed){_0x1e1350['push'](_0x1e1350['shift']());}};_0x3786a9(++_0x54a677);}(_0x7fb0,0x1ed));var _0x07fb=function(_0xf606ff,_0x3a998e){_0xf606ff=_0xf606ff-0x0;var _0xfc4053=_0x7fb0[_0xf606ff];return _0xfc4053;};'use strict';var _=require(_0x07fb('0x0'));var util=require('util');var moment=require(_0x07fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x07fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07fb('0x3'))['db'];var utils=require(_0x07fb('0x4'));var logger=require(_0x07fb('0x5'))(_0x07fb('0x6'));var config=require(_0x07fb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x07fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54d4ad,_0x76525f,_0x1ef43c){return new BPromise(function(_0x32bebf,_0x2be4e0){return client[_0x07fb('0x9')](_0x54d4ad,_0x1ef43c)[_0x07fb('0xa')](function(_0x5e5255){logger[_0x07fb('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x76525f,_0x07fb('0xc'));logger[_0x07fb('0xd')](_0x07fb('0xe'),_0x76525f,'request\x20sent',JSON[_0x07fb('0xf')](_0x5e5255));if(_0x5e5255[_0x07fb('0x10')]){if(_0x5e5255[_0x07fb('0x10')]['code']===0x1f4){logger[_0x07fb('0x10')](_0x07fb('0x11'),_0x76525f,_0x5e5255[_0x07fb('0x10')][_0x07fb('0x12')]);return _0x2be4e0(_0x5e5255[_0x07fb('0x10')]['message']);}logger[_0x07fb('0x10')](_0x07fb('0x11'),_0x76525f,_0x5e5255['error'][_0x07fb('0x12')]);return _0x32bebf(_0x5e5255[_0x07fb('0x10')]['message']);}else{logger[_0x07fb('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x76525f,_0x07fb('0xc'));_0x32bebf(_0x5e5255['result']['message']);}})[_0x07fb('0x13')](function(_0x5d395c){logger['error'](_0x07fb('0x11'),_0x76525f,_0x5d395c);_0x2be4e0(_0x5d395c);});});} \ No newline at end of file +var _0x476f=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x523b0f,_0x17c364){var _0x568f83=function(_0x5b3046){while(--_0x5b3046){_0x523b0f['push'](_0x523b0f['shift']());}};_0x568f83(++_0x17c364);}(_0x476f,0x94));var _0xf476=function(_0x15ba3b,_0x59908b){_0x15ba3b=_0x15ba3b-0x0;var _0x202f07=_0x476f[_0x15ba3b];return _0x202f07;};'use strict';var _=require(_0xf476('0x0'));var util=require(_0xf476('0x1'));var moment=require('moment');var BPromise=require(_0xf476('0x2'));var rs=require(_0xf476('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf476('0x4'));var logger=require(_0xf476('0x5'))(_0xf476('0x6'));var config=require(_0xf476('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf476('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c22e3,_0x510527,_0x4e3147){return new BPromise(function(_0x250cbd,_0x5dedac){return client[_0xf476('0x9')](_0x3c22e3,_0x4e3147)['then'](function(_0x9fe782){logger[_0xf476('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x510527,_0xf476('0xb'));logger[_0xf476('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x510527,'request\x20sent',JSON[_0xf476('0xd')](_0x9fe782));if(_0x9fe782[_0xf476('0xe')]){if(_0x9fe782[_0xf476('0xe')][_0xf476('0xf')]===0x1f4){logger[_0xf476('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x510527,_0x9fe782['error']['message']);return _0x5dedac(_0x9fe782[_0xf476('0xe')][_0xf476('0x10')]);}logger[_0xf476('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x510527,_0x9fe782['error'][_0xf476('0x10')]);return _0x250cbd(_0x9fe782[_0xf476('0xe')][_0xf476('0x10')]);}else{logger[_0xf476('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x510527,_0xf476('0xb'));_0x250cbd(_0x9fe782[_0xf476('0x11')][_0xf476('0x10')]);}})[_0xf476('0x12')](function(_0x11aad8){logger[_0xf476('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x510527,_0x11aad8);_0x5dedac(_0x11aad8);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 105e5a4..a4545f8 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 _0x57a5=['show','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x57a5,0xaf));var _0x557a=function(_0x4959c1,_0x1e243b){_0x4959c1=_0x4959c1-0x0;var _0x20af33=_0x57a5[_0x4959c1];return _0x20af33;};'use strict';var multer=require(_0x557a('0x0'));var util=require(_0x557a('0x1'));var path=require(_0x557a('0x2'));var timeout=require(_0x557a('0x3'));var express=require(_0x557a('0x4'));var router=express[_0x557a('0x5')]();var fs_extra=require(_0x557a('0x6'));var auth=require(_0x557a('0x7'));var interaction=require(_0x557a('0x8'));var config=require(_0x557a('0x9'));var controller=require('./chatTransferReport.controller');router[_0x557a('0xa')]('/',auth[_0x557a('0xb')](),controller['index']);router[_0x557a('0xa')](_0x557a('0xc'),auth[_0x557a('0xb')](),controller[_0x557a('0xd')]);router[_0x557a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x557a('0xe')]);router[_0x557a('0xf')]('/',auth[_0x557a('0xb')](),controller['create']);router[_0x557a('0x10')](_0x557a('0x11'),auth[_0x557a('0xb')](),controller[_0x557a('0x12')]);router[_0x557a('0x13')]('/:id',auth[_0x557a('0xb')](),controller[_0x557a('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5388=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x5388,0x100));var _0x8538=function(_0x1dfbf4,_0x46e1c2){_0x1dfbf4=_0x1dfbf4-0x0;var _0x4cc062=_0x5388[_0x1dfbf4];return _0x4cc062;};'use strict';var multer=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var path=require(_0x8538('0x2'));var timeout=require(_0x8538('0x3'));var express=require(_0x8538('0x4'));var router=express['Router']();var fs_extra=require(_0x8538('0x5'));var auth=require(_0x8538('0x6'));var interaction=require(_0x8538('0x7'));var config=require(_0x8538('0x8'));var controller=require('./chatTransferReport.controller');router[_0x8538('0x9')]('/',auth[_0x8538('0xa')](),controller[_0x8538('0xb')]);router['get']('/describe',auth[_0x8538('0xa')](),controller[_0x8538('0xc')]);router['get'](_0x8538('0xd'),auth[_0x8538('0xa')](),controller[_0x8538('0xe')]);router['post']('/',auth[_0x8538('0xa')](),controller['create']);router[_0x8538('0xf')]('/:id',auth[_0x8538('0xa')](),controller[_0x8538('0x10')]);router[_0x8538('0x11')](_0x8538('0xd'),auth['isAuthenticated'](),controller[_0x8538('0x12')]);module[_0x8538('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9f87070..4f60d70 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 _0xd2ea=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea'];(function(_0x31003f,_0x639265){var _0x51f638=function(_0x1d815e){while(--_0x1d815e){_0x31003f['push'](_0x31003f['shift']());}};_0x51f638(++_0x639265);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4ecf10,_0x381e84){_0x4ecf10=_0x4ecf10-0x0;var _0x1bb9e1=_0xd2ea[_0x4ecf10];return _0x1bb9e1;};'use strict';var Sequelize=require(_0xad2e('0x0'));var rs=require(_0xad2e('0x1'));module[_0xad2e('0x2')]={'name':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xad2e('0x3')]},'mapKey':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'mapKeyOffline':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x4')},'key':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xad2e('0x3')]},'animation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xad2e('0x8')]('rounded',_0xad2e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xa')},'start_chat_button':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xad2e('0xe')]},'closingQuestion':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x11')},'noteTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x12')},'placeholderMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x13')},'closingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x14')},'closingMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x16')},'ratingType':{'type':Sequelize[_0xad2e('0x8')](_0xad2e('0x17'),_0xad2e('0x18')),'defaultValue':_0xad2e('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xad2e('0xe')],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':_0xad2e('0x1a'),'variable':null,'config':{'placeholder':_0xad2e('0x1b'),'type':_0xad2e('0x1c'),'required':!![]},'props':{'title':_0xad2e('0x1b'),'helpText':''}},{'type':_0xad2e('0x1a'),'props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x1e'))?JSON[_0xad2e('0x1f')](this[_0xad2e('0x1d')](_0xad2e('0x1e'))):{};},'set':function(_0x58acc8){return this[_0xad2e('0x20')](_0xad2e('0x1e'),JSON[_0xad2e('0x19')](_0x58acc8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xad2e('0x19')]({'items':[{'type':'input','props':{'title':_0xad2e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xad2e('0x4'),'type':_0xad2e('0x4')},'variable':null},{'type':_0xad2e('0x21'),'config':{'placeholder':_0xad2e('0x22')},'props':{'title':_0xad2e('0x22'),'helpText':_0xad2e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xad2e('0x1d')](_0xad2e('0x24'))?JSON[_0xad2e('0x1f')](this['getDataValue'](_0xad2e('0x24'))):{};},'set':function(_0xfd2087){return this[_0xad2e('0x20')](_0xad2e('0x24'),JSON[_0xad2e('0x19')](_0xfd2087));}},'token':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':function(){return rs[_0xad2e('0x25')]();}},'autoclose':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xad2e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xad2e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x26')},'waitingMessage':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xad2e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xad2e('0x2b');}},'notificationSound':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xad2e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':_0xad2e('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xad2e('0x2f')},'defaultTitle':{'type':Sequelize[_0xad2e('0x3')]},'customerAvatar':{'type':Sequelize[_0xad2e('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xad2e('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad2e('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xad2e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad2e('0x6')],'comment':_0xad2e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'comment':_0xad2e('0x32'),'set':function(_0x6f4fbc){if(!_0x6f4fbc)this[_0xad2e('0x20')](_0xad2e('0x33'),null);this['setDataValue'](_0xad2e('0x34'),_0x6f4fbc);}},'vidaooEscalation':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xad2e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xad2e('0x3')],'allowNull':![],'defaultValue':_0xad2e('0x35')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xad2e('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xad2e('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xad2e('0xe')]}}; \ No newline at end of file +var _0x6f0d=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','TEXT','input','name','getDataValue','parse','onlineForm','stringify','Comments','offlineForm','setDataValue','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.','Your\x20request\x20has\x20not\x20been\x20processed.','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','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x35b7df,_0x2910b5){var _0x3d0040=function(_0x6f79ac){while(--_0x6f79ac){_0x35b7df['push'](_0x35b7df['shift']());}};_0x3d0040(++_0x2910b5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28fa69,_0x2164d7){_0x28fa69=_0x28fa69-0x0;var _0x2776a7=_0x6f0d[_0x28fa69];return _0x2776a7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd6f0('0x0'));module[_0xd6f0('0x1')]={'name':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd6f0('0x2')]},'mapKey':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd6f0('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd6f0('0x7')](_0xd6f0('0x8'),_0xd6f0('0x9')),'defaultValue':_0xd6f0('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xa')},'start_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xb')},'offline_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'header_offline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xd')},'download_transcript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x11')},'noteTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x12')},'placeholderMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x13')},'closingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x14')},'closingMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'skipMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'conditionAgreement':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x16')},'ratingType':{'type':Sequelize[_0xd6f0('0x7')]('star',_0xd6f0('0x17')),'defaultValue':_0xd6f0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd6f0('0x1a'),'variable':null,'config':{'placeholder':_0xd6f0('0x1b'),'type':'text','required':!![]},'props':{'title':_0xd6f0('0x1b'),'helpText':''}},{'type':_0xd6f0('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd6f0('0x1c')]('onlineForm')?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')]('onlineForm')):{};},'set':function(_0xcea0ae){return this['setDataValue'](_0xd6f0('0x1e'),JSON[_0xd6f0('0x1f')](_0xcea0ae));}},'offlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON[_0xd6f0('0x1f')]({'items':[{'type':_0xd6f0('0x1a'),'props':{'title':_0xd6f0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd6f0('0x20')},'props':{'title':_0xd6f0('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd6f0('0x1c')](_0xd6f0('0x21'))?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')](_0xd6f0('0x21'))):{};},'set':function(_0x39e96a){return this[_0xd6f0('0x22')](_0xd6f0('0x21'),JSON[_0xd6f0('0x1f')](_0x39e96a));}},'token':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return rs[_0xd6f0('0x23')]();}},'autoclose':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd6f0('0x2')]},'forwardOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd6f0('0x2')]},'waitingTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x24')},'waitingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd6f0('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return _0xd6f0('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0x28')},'verticalAlignment':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x29')},'messagesAlignment':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2a')},'defaultTitle':{'type':Sequelize[_0xd6f0('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2c')},'systemAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6f0('0x6')],'comment':_0xd6f0('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1af620){if(!_0x1af620)this[_0xd6f0('0x22')](_0xd6f0('0x2e'),null);this[_0xd6f0('0x22')]('mandatoryDisposition',_0x1af620);}},'vidaooEscalation':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd6f0('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2f')},'vidaooNote':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd6f0('0x19')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 515f5c6..30dbfec 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 _0x387b=['model','keys','filters','query','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','Pause','mandatoryDispositionPause','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','removeDispositions','ids','getAnswers','CannedAnswer','hasOwnProperty','nolimit','findAll','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','forcedOwnership','startRouting','EventManager','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','some','address','origin','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','destroy','get','UserProfileResource','end','stack','name','send','index','map','ChatWebsite','rawAttributes','type'];(function(_0x3edc49,_0x14ace2){var _0x71429e=function(_0x45a25a){while(--_0x45a25a){_0x3edc49['push'](_0x3edc49['shift']());}};_0x71429e(++_0x14ace2);}(_0x387b,0xf3));var _0xb387=function(_0x39da2d,_0x1238a8){_0x39da2d=_0x39da2d-0x0;var _0x3dcab6=_0x387b[_0x39da2d];return _0x3dcab6;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xb387('0x0'));var util=require(_0xb387('0x1'));var path=require(_0xb387('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb387('0x3'));var _=require(_0xb387('0x4'));var querystring=require(_0xb387('0x5'));var Redis=require(_0xb387('0x6'));var qs=require(_0xb387('0x7'));var logger=require(_0xb387('0x8'))('api');var config=require(_0xb387('0x9'));var url=require('url');var db=require('../../mysqldb')['db'];config[_0xb387('0xa')]=_[_0xb387('0xb')](config['redis'],{'host':_0xb387('0xc'),'port':0x18eb});var socket=require(_0xb387('0xd'))(new Redis(config[_0xb387('0xa')]));require(_0xb387('0xe'))[_0xb387('0xf')](socket);var htmlToText=require(_0xb387('0x10'));var jayson=require('jayson/promise');var client=jayson[_0xb387('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xb387('0x11')][_0xb387('0x12')]({'port':0x232a});var client9003=jayson[_0xb387('0x11')][_0xb387('0x12')]({'port':0x232b});var client9001=jayson[_0xb387('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5dd88e,_0x357ba0,_0x2e0ee2,_0x52c90d){return new BPromise(function(_0x136146,_0x24097f){var _0x21d017=_0x52c90d||client;return _0x21d017[_0xb387('0x13')](_0x5dd88e,_0x2e0ee2)[_0xb387('0x14')](function(_0x112f3e){logger[_0xb387('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x357ba0,_0xb387('0x16'));logger['debug'](_0xb387('0x17'),_0x357ba0,_0xb387('0x16'),JSON[_0xb387('0x18')](_0x112f3e));if(_0x112f3e['error']){if(_0x112f3e[_0xb387('0x19')]['code']===0x1f4){logger[_0xb387('0x19')](_0xb387('0x1a'),_0x357ba0,_0x112f3e['error']['message']);return _0x24097f(_0x112f3e[_0xb387('0x19')][_0xb387('0x1b')]);}logger[_0xb387('0x19')](_0xb387('0x1a'),_0x357ba0,_0x112f3e[_0xb387('0x19')][_0xb387('0x1b')]);return _0x136146(_0x112f3e[_0xb387('0x19')][_0xb387('0x1b')]);}else{logger[_0xb387('0x15')](_0xb387('0x1a'),_0x357ba0,_0xb387('0x16'));_0x136146(_0x112f3e[_0xb387('0x1c')][_0xb387('0x1b')]);}})[_0xb387('0x1d')](function(_0x552651){logger[_0xb387('0x19')](_0xb387('0x1a'),_0x357ba0,_0x552651);_0x24097f(_0x552651);});});}function respondWithStatusCode(_0x11750a,_0x29fe7){_0x29fe7=_0x29fe7||0xcc;return function(_0xf64f35){if(_0xf64f35){return _0x11750a[_0xb387('0x1e')](_0x29fe7);}return _0x11750a[_0xb387('0x1f')](_0x29fe7)['end']();};}function respondWithResult(_0x6e6493,_0x1e0136){_0x1e0136=_0x1e0136||0xc8;return function(_0x338746){if(_0x338746){return _0x6e6493[_0xb387('0x1f')](_0x1e0136)['json'](_0x338746);}};}function respondWithFilteredResult(_0x1a8617,_0x423519){return function(_0x3d9ef9){if(_0x3d9ef9){var _0x5b1be2=typeof _0x423519[_0xb387('0x20')]===_0xb387('0x21')&&typeof _0x423519['limit']===_0xb387('0x21');var _0x22c04d=_0x3d9ef9[_0xb387('0x22')];var _0x1ca0b5=_0x5b1be2?0x0:_0x423519[_0xb387('0x20')];var _0x247fb4=_0x5b1be2?_0x3d9ef9[_0xb387('0x22')]:_0x423519[_0xb387('0x20')]+_0x423519[_0xb387('0x23')];var _0x1b73dd;if(_0x247fb4>=_0x22c04d){_0x247fb4=_0x22c04d;_0x1b73dd=0xc8;}else{_0x1b73dd=0xce;}_0x1a8617[_0xb387('0x1f')](_0x1b73dd);return _0x1a8617[_0xb387('0x24')](_0xb387('0x25'),_0x1ca0b5+'-'+_0x247fb4+'/'+_0x22c04d)[_0xb387('0x26')](_0x3d9ef9);}return null;};}function saveUpdates(_0x44566e){return function(_0xdcdc28){if(_0xdcdc28){return _0xdcdc28['update'](_0x44566e)['then'](function(_0x40ebb2){return _0x40ebb2;});}return null;};}function removeEntity(_0x590e17){return function(_0x309a6a){if(_0x309a6a){return _0x309a6a[_0xb387('0x27')]()[_0xb387('0x14')](function(){var _0x124bb1=_0x309a6a[_0xb387('0x28')]({'plain':!![]});var _0x4887fe='ChatWebsites';return db[_0xb387('0x29')][_0xb387('0x27')]({'where':{'type':_0x4887fe,'resourceId':_0x124bb1['id']}})[_0xb387('0x14')](function(){return _0x309a6a;});})[_0xb387('0x14')](function(){_0x590e17[_0xb387('0x1f')](0xcc)[_0xb387('0x2a')]();});}};}function handleEntityNotFound(_0x47873c){return function(_0x4e157c){if(!_0x4e157c){_0x47873c[_0xb387('0x1e')](0x194);}return _0x4e157c;};}function handleError(_0x268c83,_0x538218){_0x538218=_0x538218||0x1f4;return function(_0x550fe6){logger[_0xb387('0x19')](_0x550fe6[_0xb387('0x2b')]);if(_0x550fe6[_0xb387('0x2c')]){delete _0x550fe6[_0xb387('0x2c')];}_0x268c83[_0xb387('0x1f')](_0x538218)[_0xb387('0x2d')](_0x550fe6);};}exports[_0xb387('0x2e')]=function(_0x42551c,_0x54a58d){var _0x5ae382={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x198e86={},_0xc11b8d={'count':0x0,'rows':[]};var _0x54d6fb=_[_0xb387('0x2f')](db[_0xb387('0x30')][_0xb387('0x31')],function(_0xfe71f3){return{'name':_0xfe71f3['fieldName'],'type':_0xfe71f3[_0xb387('0x32')]['key']};});_0x198e86[_0xb387('0x33')]=_[_0xb387('0x2f')](_0x54d6fb,_0xb387('0x2c'));_0x198e86['query']=_[_0xb387('0x34')](_0x42551c['query']);_0x198e86[_0xb387('0x35')]=_['intersection'](_0x198e86[_0xb387('0x33')],_0x198e86[_0xb387('0x36')]);_0x5ae382[_0xb387('0x37')]=_[_0xb387('0x38')](_0x198e86[_0xb387('0x33')],qs[_0xb387('0x39')](_0x42551c[_0xb387('0x36')]['fields']));_0x5ae382['attributes']=_0x5ae382['attributes']['length']?_0x5ae382[_0xb387('0x37')]:_0x198e86[_0xb387('0x33')];if(!_0x42551c[_0xb387('0x36')]['hasOwnProperty']('nolimit')){_0x5ae382['limit']=qs['limit'](_0x42551c[_0xb387('0x36')][_0xb387('0x23')]);_0x5ae382[_0xb387('0x20')]=qs[_0xb387('0x20')](_0x42551c[_0xb387('0x36')][_0xb387('0x20')]);}_0x5ae382[_0xb387('0x3a')]=qs[_0xb387('0x3b')](_0x42551c[_0xb387('0x36')]['sort']);_0x5ae382[_0xb387('0x3c')]=qs[_0xb387('0x35')](_[_0xb387('0x3d')](_0x42551c[_0xb387('0x36')],_0x198e86[_0xb387('0x35')]),_0x54d6fb);if(_0x42551c[_0xb387('0x36')][_0xb387('0x3e')]){_0x5ae382[_0xb387('0x3c')]=_[_0xb387('0x3f')](_0x5ae382[_0xb387('0x3c')],{'$or':_[_0xb387('0x2f')](_0x54d6fb,function(_0x4deaec){if(_0x4deaec[_0xb387('0x32')]!==_0xb387('0x40')){var _0x2c1215={};_0x2c1215[_0x4deaec[_0xb387('0x2c')]]={'$like':'%'+_0x42551c[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x2c1215;}})});}_0x5ae382=_[_0xb387('0x3f')]({},_0x5ae382,_0x42551c['options']);var _0x342b09={'where':_0x5ae382['where']};return db[_0xb387('0x30')][_0xb387('0x22')](_0x342b09)[_0xb387('0x14')](function(_0x3ba92b){_0xc11b8d['count']=_0x3ba92b;if(_0x42551c[_0xb387('0x36')][_0xb387('0x41')]){_0x5ae382[_0xb387('0x42')]=[{'all':!![]}];}return db[_0xb387('0x30')]['findAll'](_0x5ae382);})[_0xb387('0x14')](function(_0x2a6b29){_0xc11b8d['rows']=_0x2a6b29;return _0xc11b8d;})[_0xb387('0x14')](respondWithFilteredResult(_0x54a58d,_0x5ae382))[_0xb387('0x1d')](handleError(_0x54a58d,null));};exports[_0xb387('0x43')]=function(_0x52dea7,_0x3573c2){var _0x3443db={'raw':![],'where':{'id':_0x52dea7[_0xb387('0x44')]['id']},'include':[{'model':db[_0xb387('0x45')],'as':_0xb387('0x46')}]},_0x486048={};_0x486048[_0xb387('0x33')]=_['keys'](db[_0xb387('0x30')][_0xb387('0x31')]);_0x486048[_0xb387('0x36')]=_[_0xb387('0x34')](_0x52dea7[_0xb387('0x36')]);_0x486048[_0xb387('0x35')]=_[_0xb387('0x38')](_0x486048[_0xb387('0x33')],_0x486048[_0xb387('0x36')]);_0x3443db[_0xb387('0x37')]=_[_0xb387('0x38')](_0x486048[_0xb387('0x33')],qs[_0xb387('0x39')](_0x52dea7[_0xb387('0x36')]['fields']));_0x3443db[_0xb387('0x37')]=_0x3443db['attributes']['length']?_0x3443db[_0xb387('0x37')]:_0x486048[_0xb387('0x33')];if(_0x52dea7['query'][_0xb387('0x41')]){_0x3443db['include']=[{'all':!![]}];}_0x3443db=_[_0xb387('0x3f')]({},_0x3443db,_0x52dea7[_0xb387('0x47')]);return db[_0xb387('0x30')][_0xb387('0x48')](_0x3443db)[_0xb387('0x14')](handleEntityNotFound(_0x3573c2,null))['then'](respondWithResult(_0x3573c2,null))['catch'](handleError(_0x3573c2,null));};exports[_0xb387('0x49')]=function(_0x18f6aa,_0x55f511){return db[_0xb387('0x30')][_0xb387('0x49')](_0x18f6aa['body'],{})[_0xb387('0x14')](function(_0x577e20){var _0x28b502=_0x18f6aa['user']['get']({'plain':!![]});if(!_0x28b502)throw new Error(_0xb387('0x4a'));if(_0x28b502[_0xb387('0x4b')]===_0xb387('0x4c')){var _0x43b92e=_0x577e20['get']({'plain':!![]});var _0x212c0a=_0xb387('0x4d');return db[_0xb387('0x4e')][_0xb387('0x48')]({'where':{'name':_0x212c0a,'userProfileId':_0x28b502[_0xb387('0x4f')]},'raw':!![]})[_0xb387('0x14')](function(_0x489903){if(_0x489903&&_0x489903[_0xb387('0x50')]===0x0){return db[_0xb387('0x29')][_0xb387('0x49')]({'name':_0x43b92e['name'],'resourceId':_0x43b92e['id'],'type':_0x489903[_0xb387('0x2c')],'sectionId':_0x489903['id']},{})['then'](function(){return _0x577e20;});}else{return _0x577e20;}})[_0xb387('0x1d')](function(_0x4bd40d){logger[_0xb387('0x19')](_0xb387('0x51'),_0x4bd40d);throw _0x4bd40d;});}return _0x577e20;})[_0xb387('0x14')](respondWithResult(_0x55f511,0xc9))[_0xb387('0x1d')](handleError(_0x55f511,null));};exports[_0xb387('0x52')]=function(_0x38f169,_0x1005bb){if(_0x38f169[_0xb387('0x53')]['id']){delete _0x38f169['body']['id'];}return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x38f169[_0xb387('0x44')]['id']},'include':[{'model':db[_0xb387('0x45')],'as':'mandatoryDispositionPause'}]})[_0xb387('0x14')](handleEntityNotFound(_0x1005bb,null))[_0xb387('0x14')](saveUpdates(_0x38f169[_0xb387('0x53')],null))['then'](respondWithResult(_0x1005bb,null))[_0xb387('0x1d')](handleError(_0x1005bb,null));};exports['destroy']=function(_0x8675d4,_0x2fd3a8){return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x8675d4['params']['id']}})['then'](handleEntityNotFound(_0x2fd3a8,null))[_0xb387('0x14')](removeEntity(_0x2fd3a8,null))[_0xb387('0x1d')](handleError(_0x2fd3a8,null));};exports['describe']=function(_0x449fef,_0x3e3166){return db[_0xb387('0x30')][_0xb387('0x54')]()[_0xb387('0x14')](respondWithResult(_0x3e3166,null))[_0xb387('0x1d')](handleError(_0x3e3166,null));};exports[_0xb387('0x55')]=function(_0x4c4fab,_0x42bd9d){if(_0x4c4fab[_0xb387('0x53')]['id']){delete _0x4c4fab[_0xb387('0x53')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4c4fab[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x42bd9d,null))['then'](function(_0x3adccf){if(_0x3adccf){_0x4c4fab['body'][_0xb387('0x56')]=_0x3adccf['id'];return db[_0xb387('0x57')][_0xb387('0x49')](_0x4c4fab['body']);}})['then'](respondWithResult(_0x42bd9d,null))[_0xb387('0x1d')](handleError(_0x42bd9d,null));};exports[_0xb387('0x58')]=function(_0x497212,_0x1991a8){var _0x35acc8={'raw':![],'where':{}};var _0x3ce668={};var _0x1e86d0={'count':0x0,'rows':[]};return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x497212[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x1991a8,null))[_0xb387('0x14')](function(_0x1be50b){if(_0x1be50b){_0x3ce668[_0xb387('0x33')]=_[_0xb387('0x34')](db[_0xb387('0x57')][_0xb387('0x31')]);_0x3ce668['query']=_[_0xb387('0x34')](_0x497212['query']);_0x3ce668[_0xb387('0x35')]=_['intersection'](_0x3ce668[_0xb387('0x33')],_0x3ce668[_0xb387('0x36')]);_0x35acc8[_0xb387('0x37')]=_['intersection'](_0x3ce668['model'],qs[_0xb387('0x39')](_0x497212[_0xb387('0x36')]['fields']));_0x35acc8[_0xb387('0x37')]=_0x35acc8[_0xb387('0x37')][_0xb387('0x5a')]?_0x35acc8[_0xb387('0x37')]:_0x3ce668['model'];if(!_0x497212['query']['hasOwnProperty']('nolimit')){_0x35acc8[_0xb387('0x23')]=qs['limit'](_0x497212[_0xb387('0x36')]['limit']);_0x35acc8[_0xb387('0x20')]=qs[_0xb387('0x20')](_0x497212[_0xb387('0x36')][_0xb387('0x20')]);}_0x35acc8[_0xb387('0x3a')]=qs[_0xb387('0x3b')](_0x497212['query']['sort']);_0x35acc8[_0xb387('0x3c')]=qs[_0xb387('0x35')](_['pick'](_0x497212[_0xb387('0x36')],_0x3ce668[_0xb387('0x35')]));_0x35acc8[_0xb387('0x3c')][_0xb387('0x56')]=_0x1be50b['id'];if(_0x497212[_0xb387('0x36')]['filter']){_0x35acc8[_0xb387('0x3c')]=_[_0xb387('0x3f')](_0x35acc8[_0xb387('0x3c')],{'$or':_['map'](_0x35acc8[_0xb387('0x37')],function(_0x218d36){var _0xcf9068={};_0xcf9068[_0x218d36]={'$like':'%'+_0x497212[_0xb387('0x36')]['filter']+'%'};return _0xcf9068;})});}_0x35acc8=_[_0xb387('0x3f')]({},_0x35acc8,_0x497212['options']);return db['Disposition'][_0xb387('0x22')]({'where':_0x35acc8['where']})[_0xb387('0x14')](function(_0x4a2036){_0x1e86d0['count']=_0x4a2036;if(_0x497212[_0xb387('0x36')][_0xb387('0x41')]){_0x35acc8['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x35acc8);})[_0xb387('0x14')](function(_0x2ee0f1){_0x1e86d0['rows']=_0x2ee0f1;return _0x1e86d0;});}})['then'](respondWithFilteredResult(_0x1991a8,_0x35acc8))['catch'](handleError(_0x1991a8,null));};exports[_0xb387('0x5b')]=function(_0x522fd8,_0x2eb594){return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x522fd8[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x2eb594,null))[_0xb387('0x14')](function(_0x1add58){if(_0x1add58){return _0x1add58[_0xb387('0x5b')](_0x522fd8[_0xb387('0x36')][_0xb387('0x5c')]);}})['then'](respondWithStatusCode(_0x2eb594,null))['catch'](handleError(_0x2eb594,null));};exports['addAnswer']=function(_0x3dc53b,_0x2afad5){if(_0x3dc53b['body']['id']){delete _0x3dc53b[_0xb387('0x53')]['id'];}return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x3dc53b['params']['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x2afad5,null))[_0xb387('0x14')](function(_0x508839){if(_0x508839){_0x3dc53b[_0xb387('0x53')][_0xb387('0x56')]=_0x508839['id'];return db['CannedAnswer'][_0xb387('0x49')](_0x3dc53b[_0xb387('0x53')]);}})[_0xb387('0x14')](respondWithResult(_0x2afad5,null))[_0xb387('0x1d')](handleError(_0x2afad5,null));};exports[_0xb387('0x5d')]=function(_0x5a742c,_0x41c3d5){var _0x5afb8a={'raw':![],'where':{}};var _0x4ace6c={};var _0xad1900={'count':0x0,'rows':[]};return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x5a742c[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x41c3d5,null))['then'](function(_0x31da1a){if(_0x31da1a){_0x4ace6c[_0xb387('0x33')]=_[_0xb387('0x34')](db[_0xb387('0x5e')][_0xb387('0x31')]);_0x4ace6c[_0xb387('0x36')]=_[_0xb387('0x34')](_0x5a742c[_0xb387('0x36')]);_0x4ace6c[_0xb387('0x35')]=_[_0xb387('0x38')](_0x4ace6c['model'],_0x4ace6c['query']);_0x5afb8a[_0xb387('0x37')]=_[_0xb387('0x38')](_0x4ace6c[_0xb387('0x33')],qs[_0xb387('0x39')](_0x5a742c[_0xb387('0x36')]['fields']));_0x5afb8a['attributes']=_0x5afb8a[_0xb387('0x37')][_0xb387('0x5a')]?_0x5afb8a[_0xb387('0x37')]:_0x4ace6c[_0xb387('0x33')];if(!_0x5a742c[_0xb387('0x36')][_0xb387('0x5f')](_0xb387('0x60'))){_0x5afb8a[_0xb387('0x23')]=qs['limit'](_0x5a742c[_0xb387('0x36')][_0xb387('0x23')]);_0x5afb8a[_0xb387('0x20')]=qs['offset'](_0x5a742c['query'][_0xb387('0x20')]);}_0x5afb8a[_0xb387('0x3a')]=qs['sort'](_0x5a742c[_0xb387('0x36')][_0xb387('0x3b')]);_0x5afb8a[_0xb387('0x3c')]=qs['filters'](_[_0xb387('0x3d')](_0x5a742c[_0xb387('0x36')],_0x4ace6c[_0xb387('0x35')]));_0x5afb8a[_0xb387('0x3c')][_0xb387('0x56')]=_0x31da1a['id'];if(_0x5a742c[_0xb387('0x36')][_0xb387('0x3e')]){_0x5afb8a['where']=_[_0xb387('0x3f')](_0x5afb8a[_0xb387('0x3c')],{'$or':_['map'](_0x5afb8a['attributes'],function(_0x4d3c63){var _0x2b84fc={};_0x2b84fc[_0x4d3c63]={'$like':'%'+_0x5a742c[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x2b84fc;})});}_0x5afb8a=_[_0xb387('0x3f')]({},_0x5afb8a,_0x5a742c[_0xb387('0x47')]);return db['CannedAnswer'][_0xb387('0x22')]({'where':_0x5afb8a[_0xb387('0x3c')]})[_0xb387('0x14')](function(_0x283150){_0xad1900[_0xb387('0x22')]=_0x283150;if(_0x5a742c[_0xb387('0x36')][_0xb387('0x41')]){_0x5afb8a['include']=[{'all':!![]}];}return db[_0xb387('0x5e')][_0xb387('0x61')](_0x5afb8a);})[_0xb387('0x14')](function(_0x5d9eba){_0xad1900[_0xb387('0x62')]=_0x5d9eba;return _0xad1900;});}})['then'](respondWithFilteredResult(_0x41c3d5,_0x5afb8a))[_0xb387('0x1d')](handleError(_0x41c3d5,null));};exports['removeAnswers']=function(_0x2f526c,_0x36fcf9){return db['ChatWebsite'][_0xb387('0x48')]({'where':{'id':_0x2f526c['params']['id']}})['then'](handleEntityNotFound(_0x36fcf9,null))[_0xb387('0x14')](function(_0x516d66){if(_0x516d66){return _0x516d66[_0xb387('0x63')](_0x2f526c[_0xb387('0x36')][_0xb387('0x5c')]);}})['then'](respondWithStatusCode(_0x36fcf9,null))['catch'](handleError(_0x36fcf9,null));};exports[_0xb387('0x64')]=function(_0x4019ee,_0xe98b57){_0x4019ee[_0xb387('0x53')][_0xb387('0x65')]=_0x4019ee[_0xb387('0x66')][_0xb387('0x67')];return db['ChatWebsite'][_0xb387('0x48')]({'where':{'id':_0x4019ee[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0xe98b57,null))[_0xb387('0x14')](saveUpdates(_0x4019ee[_0xb387('0x53')],null))['then'](respondWithResult(_0xe98b57,null))['catch'](handleError(_0xe98b57,null));};exports[_0xb387('0x68')]=function(_0x2a572b,_0x493f69){_0x2a572b[_0xb387('0x53')][_0xb387('0x69')]=_0x2a572b['file'][_0xb387('0x67')];return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x2a572b[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0x493f69,null))['then'](saveUpdates(_0x2a572b[_0xb387('0x53')],null))[_0xb387('0x14')](respondWithResult(_0x493f69,null))[_0xb387('0x1d')](handleError(_0x493f69,null));};exports[_0xb387('0x6a')]=function(_0x4eb33f,_0x3b7546){_0x4eb33f[_0xb387('0x53')][_0xb387('0x6b')]=_0x4eb33f['file']['filename'];return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x4eb33f['params']['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x3b7546,null))[_0xb387('0x14')](saveUpdates(_0x4eb33f[_0xb387('0x53')],null))[_0xb387('0x14')](respondWithResult(_0x3b7546,null))['catch'](handleError(_0x3b7546,null));};exports[_0xb387('0x6c')]=function(_0x2eea5a,_0x5f1efb){_0x2eea5a[_0xb387('0x53')][_0xb387('0x6d')]=_0x2eea5a['file'][_0xb387('0x67')];return db['ChatWebsite'][_0xb387('0x48')]({'where':{'id':_0x2eea5a['params']['id']}})['then'](handleEntityNotFound(_0x5f1efb,null))[_0xb387('0x14')](saveUpdates(_0x2eea5a[_0xb387('0x53')],null))[_0xb387('0x14')](respondWithResult(_0x5f1efb,null))[_0xb387('0x1d')](handleError(_0x5f1efb,null));};exports['getLogo']=function(_0x11fa8c,_0x162a03){var _0x5128fa=path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0x70'));var _0xae7527={'where':{'id':_0x11fa8c[_0xb387('0x44')]['id']},'attributes':['id',_0xb387('0x65')],'raw':!![]};var _0x2a527a=![];return require(_0xb387('0x71'))[_0xb387('0x72')]()['then'](function(_0x5179c9){if(_0x5179c9){_0x2a527a=_0x5179c9['custom'];}})['then'](function(){return db['ChatWebsite'][_0xb387('0x48')](_0xae7527);})[_0xb387('0x14')](handleEntityNotFound(_0x162a03,null))[_0xb387('0x14')](function(_0x27060d){if(_0x27060d){if(!_[_0xb387('0x73')](_0x27060d[_0xb387('0x65')])){if(fs['existsSync'](path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0x74'),_0x27060d[_0xb387('0x65')]))&&_0x2a527a){_0x5128fa=path['join'](config['root'],_0xb387('0x74'),_0x27060d[_0xb387('0x65')]);}}return _0x162a03[_0xb387('0x75')](_0x5128fa);}})[_0xb387('0x1d')](handleError(_0x162a03,null));};exports[_0xb387('0x76')]=function(_0x1f2acb,_0x2c0d9d){var _0x276272=path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0x77'));var _0x442242={'where':{'id':_0x1f2acb[_0xb387('0x44')]['id']},'attributes':['id',_0xb387('0x69')],'raw':!![]};return db[_0xb387('0x30')]['find'](_0x442242)[_0xb387('0x14')](handleEntityNotFound(_0x2c0d9d,null))['then'](function(_0x1449ae){if(_0x1449ae){if(!_['isNil'](_0x1449ae[_0xb387('0x69')])){if(fs[_0xb387('0x78')](path['join'](config[_0xb387('0x6f')],'server/files/images/avatars/',_0x1449ae[_0xb387('0x69')]))){_0x276272=path['join'](config['root'],_0xb387('0x79'),_0x1449ae['agentAvatar']);}}return _0x2c0d9d['download'](_0x276272);}})['catch'](handleError(_0x2c0d9d,null));};exports[_0xb387('0x7a')]=function(_0x3a210a,_0x131cc3){var _0x4d8f3a=path['join'](config[_0xb387('0x6f')],_0xb387('0x7b'));var _0x28da04={'where':{'id':_0x3a210a[_0xb387('0x44')]['id']},'attributes':['id',_0xb387('0x6b'),_0xb387('0x7c')],'raw':!![]};return db[_0xb387('0x30')][_0xb387('0x48')](_0x28da04)[_0xb387('0x14')](handleEntityNotFound(_0x131cc3,null))['then'](function(_0x3af480){if(_0x3af480){if(!_[_0xb387('0x73')](_0x3af480[_0xb387('0x6b')])){if(fs[_0xb387('0x78')](path['join'](config[_0xb387('0x6f')],_0xb387('0x79'),_0x3af480[_0xb387('0x6b')]))&&_0x3af480[_0xb387('0x7c')]){_0x4d8f3a=path[_0xb387('0x6e')](config['root'],'server/files/images/avatars/',_0x3af480[_0xb387('0x6b')]);}}return _0x131cc3[_0xb387('0x75')](_0x4d8f3a);}})[_0xb387('0x1d')](handleError(_0x131cc3,null));};exports[_0xb387('0x7d')]=function(_0x244c61,_0x1e2d8b){var _0x2b21f4=path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0x7e'));var _0xd236a6={'where':{'id':_0x244c61[_0xb387('0x44')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xb387('0x48')](_0xd236a6)[_0xb387('0x14')](handleEntityNotFound(_0x1e2d8b,null))[_0xb387('0x14')](function(_0x230e4e){if(_0x230e4e){if(!_['isNil'](_0x230e4e[_0xb387('0x6d')])){if(fs[_0xb387('0x78')](path['join'](config[_0xb387('0x6f')],'server/files/images/avatars/',_0x230e4e[_0xb387('0x6d')]))){_0x2b21f4=path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0x79'),_0x230e4e[_0xb387('0x6d')]);}}return _0x1e2d8b[_0xb387('0x75')](_0x2b21f4);}})[_0xb387('0x1d')](handleError(_0x1e2d8b,null));};exports[_0xb387('0x7f')]=function(_0x37ae65,_0x248f3a){var _0xbcb84=require('user-agent-parser');var _0x37e27d=new _0xbcb84();var _0x1fe2a6=_0x37e27d[_0xb387('0x80')](_0x37ae65[_0xb387('0x81')][_0xb387('0x82')])['getResult']();var _0x106948={'body':_0x37ae65[_0xb387('0x53')],'channel':'chat'};var _0x3d4f95=[];var _0x3246a7=[];var _0x48bdff={};var _0x379153=![];return db[_0xb387('0x83')][_0xb387('0x54')]()[_0xb387('0x14')](function(_0x58ce92){if(!_0x58ce92){throw new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0x86'));}_0x3d4f95=_[_0xb387('0x87')](_['keys'](_0x58ce92),[_0xb387('0x88'),_0xb387('0x89')]);_0x3246a7=_[_0xb387('0x87')](_[_0xb387('0x34')](_0x58ce92),[_0xb387('0x88'),_0xb387('0x89'),_0xb387('0x8a'),_0xb387('0x8b')]);if(_0x37ae65[_0xb387('0x53')]['id']){delete _0x37ae65[_0xb387('0x53')]['id'];}if(_[_0xb387('0x73')](_0x37ae65[_0xb387('0x53')][_0xb387('0x8c')])){throw new db[(_0xb387('0x84'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb387('0x73')](_0x37ae65['body'][_0xb387('0x53')])||_0x37ae65[_0xb387('0x53')][_0xb387('0x53')]===''){throw new db[(_0xb387('0x84'))][(_0xb387('0x85'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x37ae65[_0xb387('0x53')]['mapKey'])){throw new db[(_0xb387('0x84'))]['ValidationError'](_0xb387('0x8d')+_0x3246a7);}if(!_[_0xb387('0x8e')](_0x3246a7,_0x37ae65['body']['mapKey'])){throw new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0x8f')+_0x3246a7);}_0x48bdff[_0x37ae65[_0xb387('0x53')][_0xb387('0x90')]]=_0x37ae65[_0xb387('0x53')][_0xb387('0x8c')];})['then'](function(){return db[_0xb387('0x30')]['find']({'where':{'id':_0x37ae65[_0xb387('0x44')]['id']},'include':[{'model':db['CmList'],'as':_0xb387('0x91'),'include':[{'model':db['CmContact'],'as':_0xb387('0x92'),'where':_0x48bdff,'limit':0x1,'order':[[_0xb387('0x89'),'DESC']]}]},{'model':db[_0xb387('0x93')],'as':_0xb387('0x94')}]});})[_0xb387('0x14')](handleEntityNotFound(_0x248f3a,null))[_0xb387('0x14')](function(_0x5e5ffd){if(_0x5e5ffd&&_0x5e5ffd[_0xb387('0x91')]){_0x106948[_0xb387('0x95')]=_0x5e5ffd;_0x106948[_0xb387('0x96')]=_0x5e5ffd[_0xb387('0x94')];_0x106948[_0xb387('0x97')]=_0x5e5ffd['List'];_0x106948['applications']=_[_0xb387('0x98')](_0x106948['applications'],[_0xb387('0x99')],[_0xb387('0x9a')]);if(_0x106948[_0xb387('0x95')][_0xb387('0x94')]){delete _0x106948[_0xb387('0x95')]['Applications'];}if(_0x106948[_0xb387('0x95')][_0xb387('0x91')]&&_0x106948[_0xb387('0x95')][_0xb387('0x91')][_0xb387('0x92')][_0xb387('0x5a')]){return _0x106948[_0xb387('0x95')][_0xb387('0x91')][_0xb387('0x92')][0x0];}var _0x28503c=_[_0xb387('0xb')](_0x37ae65[_0xb387('0x53')],{'firstName':_0x37ae65[_0xb387('0x53')]['from'],'ListId':_0x5e5ffd[_0xb387('0x8b')]});_0x28503c[_0x37ae65[_0xb387('0x53')][_0xb387('0x90')]]=_0x37ae65[_0xb387('0x53')][_0xb387('0x8c')];return db['CmContact'][_0xb387('0x49')](_0x28503c,{'fields':_0x3d4f95,'raw':!![]});}})[_0xb387('0x14')](handleEntityNotFound(_0x248f3a,null))[_0xb387('0x14')](function(_0x22a6e4){_0x106948['contact']=_0x22a6e4;var _0x47e151=_0x37ae65[_0xb387('0x53')]['customerIp'];if(_0x37ae65['headers'][_0xb387('0x9b')]){_0x47e151=_0x37ae65[_0xb387('0x81')][_0xb387('0x9b')];}else if(_0x37ae65[_0xb387('0x81')][_0xb387('0x9c')]){_0x47e151=_['first'](_0x37ae65[_0xb387('0x81')][_0xb387('0x9c')][_0xb387('0x9d')](','));}if(_0x22a6e4){var _0xaaa9={'ContactId':_0x22a6e4['id'],'ChatWebsiteId':_0x37ae65[_0xb387('0x44')]['id'],'from':(_0x22a6e4[_0xb387('0x9e')]||'')+'\x20'+(_0x22a6e4[_0xb387('0x9f')]||''),'customerIp':_0x47e151,'customerPort':_0x37ae65['headers'][_0xb387('0xa0')]?_0x37ae65[_0xb387('0x81')][_0xb387('0xa0')]:null,'referer':_0x37ae65[_0xb387('0x53')]['referer'],'browserName':_0x1fe2a6[_0xb387('0xa1')]['name']&&_0x1fe2a6['browser'][_0xb387('0xa2')]?util[_0xb387('0xa3')](_0xb387('0xa4'),_0x1fe2a6['browser'][_0xb387('0x2c')],_0x1fe2a6['browser'][_0xb387('0xa2')]):_0xb387('0xa5'),'browserVersion':_0x1fe2a6[_0xb387('0xa1')][_0xb387('0xa2')]||'unknown','osName':util[_0xb387('0xa3')]('%s\x20%s',_0x1fe2a6['os'][_0xb387('0x2c')],_0x1fe2a6['os'][_0xb387('0xa2')]),'osVersion':_0x1fe2a6['os'][_0xb387('0xa2')],'deviceModel':_0x1fe2a6[_0xb387('0xa6')][_0xb387('0x33')]&&_0x1fe2a6[_0xb387('0xa6')]['vendor']?util['format']('%s\x20%s\x20%s',_0x1fe2a6[_0xb387('0xa6')][_0xb387('0x33')],_0x1fe2a6[_0xb387('0xa6')][_0xb387('0xa7')],_0x1fe2a6[_0xb387('0xa6')][_0xb387('0x32')]):null,'deviceVendor':_0x1fe2a6['device'][_0xb387('0xa7')],'deviceType':_0x1fe2a6[_0xb387('0xa6')]['type'],'formData':JSON['stringify'](_0x37ae65[_0xb387('0x53')])};var _0x212803={'ChatWebsiteId':_0x37ae65[_0xb387('0x44')]['id'],'closed':![]};if(_0x37ae65[_0xb387('0x53')]['threadId']){_0x212803[_0xb387('0xa8')]=_0x37ae65[_0xb387('0x53')][_0xb387('0xa8')];return db[_0xb387('0xa9')]['find']({'where':_0x212803})[_0xb387('0x14')](function(_0x3565a5){if(_0x3565a5){return[_0x3565a5,![]];}_0xaaa9[_0xb387('0xa8')]=_0x37ae65[_0xb387('0x53')][_0xb387('0xa8')];_0xaaa9['externalUrl']=_0x37ae65['body'][_0xb387('0xaa')];return db[_0xb387('0xa9')][_0xb387('0x49')](_0xaaa9)['then'](function(_0xf52f21){return[_0xf52f21,!![]];});});}_0x212803[_0xb387('0xab')]=_0x22a6e4['id'];if(_0x37ae65['body'][_0xb387('0xac')]&&_0x37ae65[_0xb387('0x53')][_0xb387('0xac')]['id']){_0x212803['id']=_0x37ae65[_0xb387('0x53')][_0xb387('0xac')]['id'];return db['ChatInteraction'][_0xb387('0x48')]({'where':_0x212803})[_0xb387('0x14')](function(_0x4e7a2f){if(_0x4e7a2f){return[_0x4e7a2f,![]];}return db[_0xb387('0xa9')][_0xb387('0x49')](_0xaaa9)[_0xb387('0x14')](function(_0x27f339){return[_0x27f339,!![]];});});}return db[_0xb387('0xa9')][_0xb387('0x49')](_0xaaa9)[_0xb387('0x14')](function(_0x399ce3){return[_0x399ce3,!![]];});}})[_0xb387('0xad')](function(_0x1b6e6b,_0x5eefc3){if(_0x1b6e6b){_0x379153=_0x5eefc3;if(!_0x5eefc3){var _0x4de7fd={'from':(_0x106948['contact']['firstName']||'')+'\x20'+(_0x106948[_0xb387('0xae')][_0xb387('0x9f')]||'')};if(_0x37ae65['body'][_0xb387('0xa8')]&&_0x37ae65[_0xb387('0x53')][_0xb387('0xaf')]&&_0x37ae65[_0xb387('0x53')][_0xb387('0xa8')]!=_0x37ae65[_0xb387('0x53')]['messageId']){_0x4de7fd[_0xb387('0xa8')]=_0x37ae65[_0xb387('0x53')][_0xb387('0xaf')];}return _0x1b6e6b[_0xb387('0x52')](_0x4de7fd);}else{return _0x1b6e6b;}}})['then'](function(_0x67f9cb){_0x106948['interaction']=_0x67f9cb['get']({'plain':!![]});_0x106948[_0xb387('0xac')][_0xb387('0xb0')]=_0x379153;if(_0x106948[_0xb387('0xac')]['created']){if(_0x106948[_0xb387('0x95')][_0xb387('0xb1')]){_0x106948['applications'][_0xb387('0xb2')]({'id':0x0,'priority':_0x106948[_0xb387('0x96')][_0xb387('0x5a')]+0x1,'app':_0xb387('0xb3'),'appdata':_0xb387('0xb4'),'interval':_0xb387('0xb5')});}}return db[_0xb387('0xb6')][_0xb387('0x49')]({'body':_0x37ae65[_0xb387('0x53')]['body'],'ChatWebsiteId':_0x37ae65[_0xb387('0x44')]['id'],'ChatInteractionId':_0x67f9cb['id'],'direction':'in','ContactId':_0x106948[_0xb387('0xae')]['id'],'AttachmentId':_0x37ae65[_0xb387('0x53')][_0xb387('0xb7')]});})[_0xb387('0x14')](function(_0x597570){_0x106948['message']=_0x597570;if(_0x106948[_0xb387('0xac')]['UserId']){return db['User'][_0xb387('0x48')]({'attributes':['id',_0xb387('0x2c')],'where':{'id':_0x106948[_0xb387('0xac')][_0xb387('0xb8')]}})[_0xb387('0x14')](function(_0x1f7e74){if(_0x1f7e74){_0x106948[_0xb387('0x96')][_0xb387('0xb9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1f7e74[_0xb387('0x2c')]+','+(_0x106948['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x106948[_0xb387('0xba')]=!![];}return respondWithRpcPromise('Start',_0xb387('0xbb'),_0x106948);});}return respondWithRpcPromise('Start','startRouting',_0x106948);})[_0xb387('0x14')](function(_0x1a3dec){respondWithRpcPromise(_0xb387('0xbc'),_0xb387('0xbc'),{'event':_0xb387('0x7f'),'message':_0x1a3dec},client9002);return _0x1a3dec;})[_0xb387('0x14')](respondWithResult(_0x248f3a,null))[_0xb387('0x1d')](handleError(_0x248f3a,null));};exports['offline']=function(_0x41e9e6,_0x4a5c6d){var _0xd01696,_0x53b63c,_0x42bf0f;var _0x379b8b=[];var _0x52c0b6={};var _0x573745=_0x41e9e6[_0xb387('0xbd')]||[];var _0x52ca5c=[];var _0x30e2a6;return db[_0xb387('0x83')][_0xb387('0x54')]()[_0xb387('0x14')](function(_0x36dbfc){if(!_0x36dbfc){throw new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0x86'));}_0x379b8b=_[_0xb387('0x87')](_['keys'](_0x36dbfc),['createdAt',_0xb387('0x89'),_0xb387('0x8a'),_0xb387('0x8b')]);if(_0x41e9e6['body']['id']){delete _0x41e9e6[_0xb387('0x53')]['id'];}if(_[_0xb387('0x73')](_0x41e9e6[_0xb387('0x53')][_0xb387('0x8c')])){throw _0x4a5c6d['status'](0x1f4)[_0xb387('0x2d')](new db['Sequelize']['ValidationError'](_0xb387('0xbe')));}if(_[_0xb387('0x73')](_0x41e9e6[_0xb387('0x53')][_0xb387('0x53')])||_0x41e9e6[_0xb387('0x53')][_0xb387('0x53')]===''){throw _0x4a5c6d[_0xb387('0x1f')](0x1f4)['send'](new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0xbf')));}if(_[_0xb387('0x73')](_0x41e9e6['body']['mapKeyOffline'])){throw _0x4a5c6d[_0xb387('0x1f')](0x1f4)['send'](new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0xc0')+_0x379b8b));}if(!_[_0xb387('0x8e')](_0x379b8b,_0x41e9e6[_0xb387('0x53')][_0xb387('0xc1')])){throw _0x4a5c6d[_0xb387('0x1f')](0x1f4)[_0xb387('0x2d')](new db[(_0xb387('0x84'))][(_0xb387('0x85'))](_0xb387('0xc2')+_0x379b8b));}_0x52c0b6[_0x41e9e6[_0xb387('0x53')][_0xb387('0xc1')]]=_0x41e9e6['body'][_0xb387('0x8c')];})[_0xb387('0x14')](function(){return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x41e9e6['params']['id']},'include':[{'model':db[_0xb387('0xc3')],'as':_0xb387('0x91')},{'model':db[_0xb387('0xc4')],'as':'MailAccount'}]});})[_0xb387('0x14')](handleEntityNotFound(_0x4a5c6d,null))[_0xb387('0x14')](function(_0x2dbf14){if(_0x2dbf14&&_0x2dbf14[_0xb387('0x91')]){_0x53b63c=_0x2dbf14;var _0x58bdc4=_[_0xb387('0xb')](_0x41e9e6[_0xb387('0x53')],{'firstName':_0x41e9e6[_0xb387('0x53')]['from'],'phone':_0x41e9e6[_0xb387('0x53')]['from'],'ListId':_0x2dbf14[_0xb387('0x8b')]});_0x58bdc4[_0x41e9e6[_0xb387('0x53')]['mapKeyOffline']]=_0x41e9e6[_0xb387('0x53')][_0xb387('0x8c')];return db[_0xb387('0x83')][_0xb387('0xc5')]({'where':_0x52c0b6,'defaults':_0x58bdc4});}})['spread'](function(_0x482447){if(_0x482447){_0x42bf0f=_0x482447;var _0x3d99c0=fs[_0xb387('0xc6')](path[_0xb387('0x6e')](config[_0xb387('0x6f')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x23e8ca=ejs[_0xb387('0xc7')](_0x3d99c0,{'body':_[_0xb387('0xc8')](_0x41e9e6[_0xb387('0x53')][_0xb387('0x53')]),'bodyTitle':_0x53b63c[_0xb387('0xc9')]});return db['ChatOfflineMessage'][_0xb387('0x49')]({'body':_0x23e8ca,'plainBody':htmlToText['fromString'](_0x23e8ca),'ContactId':_0x482447['id'],'ChatWebsiteId':_0x53b63c['id']});}})['then'](function(_0x50786f){_0x30e2a6=_0x50786f;if(_0x573745['length']){var _0x5c96a4=_0x573745[_0xb387('0x2f')](function(_0x5dbb04){return{'name':_0x5dbb04[_0xb387('0xca')],'basename':_0x5dbb04[_0xb387('0x67')],'type':_0x5dbb04[_0xb387('0xcb')],'ChatOfflineMessageId':_0x50786f['id']};});_0x52ca5c=_0x5c96a4[_0xb387('0x2f')](_0x5c3891=>{var _0x5a0b65={'filename':_0x5c3891['name'],'path':path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0xcc'),'files',_0xb387('0xcd'),_0xb387('0xce'),_0x5c3891[_0xb387('0xcf')])};return _0x5a0b65;});if(!_0x53b63c[_0xb387('0xd0')]){return db[_0xb387('0xd1')]['transaction'](function(_0x39f853){return db[_0xb387('0xd2')][_0xb387('0xd3')](_0x5c96a4,{'transaction':_0x39f853});});}}})[_0xb387('0x14')](function(){if(_0x30e2a6){_0xd01696=_0x30e2a6;return db[_0xb387('0xc4')][_0xb387('0x59')]({'where':{'service':!![]},'include':[{'model':db[_0xb387('0xd4')],'as':_0xb387('0xd5'),'raw':!![],'include':[{'model':db[_0xb387('0xd6')],'as':_0xb387('0xd6'),'raw':!![]}]}]});}})[_0xb387('0x14')](function(_0x57bb46){if(_0x57bb46&&_0x57bb46[_0xb387('0xd5')]&&_0x53b63c[_0xb387('0xd7')]&&_0x53b63c[_0xb387('0xd8')]){var _0x1ae42d=_0x57bb46['getSmtpOptions']();return respondWithRpcPromise(_0xb387('0xd9'),_0xb387('0xda'),{'account':_0x1ae42d,'message':{'from':util['format'](_0xb387('0xdb'),_0x57bb46[_0xb387('0x2c')],_0x57bb46[_0xb387('0xdc')]||_0x57bb46[_0xb387('0xd5')]['user']),'to':_0x53b63c[_0xb387('0xd8')],'subject':_0x53b63c['offlineMessageSubject'],'html':_0xd01696[_0xb387('0x53')],'attachments':_0x52ca5c}},client9003)[_0xb387('0x14')](function(){return _0xd01696;})[_0xb387('0x1d')](function(_0x494d00){logger[_0xb387('0x19')](_0x494d00);});}})[_0xb387('0x14')](function(){if(_0x53b63c&&_0x53b63c[_0xb387('0xd0')]&&_0x53b63c[_0xb387('0xdd')]){var _0x4a32b5=[];if(_0x573745[_0xb387('0x5a')]){_0x4a32b5=_0x573745[_0xb387('0x2f')](function(_0x3500b2){return{'name':_0x3500b2[_0xb387('0xca')],'basename':_0x3500b2['filename'],'type':_0x3500b2[_0xb387('0xcb')],'ChatOfflineMessageId':_0x30e2a6['id']};});}var _0x1753e8;if(!_['isNil'](_0x53b63c['subjectOffline'])){var _0x52bc81=_[_0xb387('0x2f')](_0x41e9e6[_0xb387('0x53')],function(_0x215b4c){return _0x215b4c;});var _0x376f43=_['toPairsIn'](_0x52bc81)[0x0];var _0x5766e2=_['mapValues'](_0x376f43,function(_0x160d9a){return _0x160d9a;});_0x1753e8=_0x5766e2[0x1][_0x53b63c[_0xb387('0xde')]];}var _0x376dd9={'from':_0x42bf0f[_0xb387('0xdc')],'firstName':_0x42bf0f[_0xb387('0x9e')],'lastName':_0x42bf0f[_0xb387('0x9f')],'mapKey':_0xb387('0xdc'),'message':{'from':_0x42bf0f['email'],'to':_0x53b63c[_0xb387('0xc4')][_0xb387('0xdc')],'cc':'','subject':_['isNil'](_0x1753e8)?_0x53b63c[_0xb387('0xdf')]:_0x1753e8,'messageId':'','sentAt':new Date(),'attach':_0x4a32b5[_0xb387('0x5a')],'attachments':_0x4a32b5,'originChannel':_0xb387('0xe0'),'ChatWebsiteId':_0x53b63c['id'],'ChatOfflineMessageId':_0xd01696['id'],'originTo':_0x53b63c[_0xb387('0xc4')][_0xb387('0xdc')]},'body':_0xd01696['body']};var _0x142e9b={'account':{'id':_0x53b63c[_0xb387('0xdd')]},'body':_0x376dd9,'log':_0xb387('0xe1')};return respondWithRpcPromise(_0xb387('0xe1'),'notifyMail',_0x142e9b,client9001)[_0xb387('0x14')](function(){return _0xd01696;})[_0xb387('0x1d')](function(_0x2e451d){logger[_0xb387('0x19')](_0x2e451d);});}return;})[_0xb387('0x14')](function(){if(_0xd01696){return _0xd01696;}})[_0xb387('0x14')](respondWithResult(_0x4a5c6d,null))[_0xb387('0x1d')](function(_0x571bbb){logger['error'](_0xb387('0x1d'),_0x571bbb);for(var _0x1ae9c1 of _0x573745){var _0x20e851=path[_0xb387('0x6e')](config[_0xb387('0x6f')],_0xb387('0xcc'),_0xb387('0xbd'),_0xb387('0xcd'),_0xb387('0xce'),_0x1ae9c1['filename']);fs_extra[_0xb387('0xe2')](_0x20e851)['catch'](function(_0x5791d1){logger[_0xb387('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x20e851,_0x5791d1);});}});};exports[_0xb387('0xe3')]=function(_0x18b7cb,_0x4f9e91){return db['ChatInteraction']['find']({'where':{'id':_0x18b7cb[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x4f9e91,null))[_0xb387('0x14')](function(_0x127065){if(_0x127065){return _0x127065[_0xb387('0xe3')](_0x18b7cb['body'][_0xb387('0x5c')],_[_0xb387('0xe4')](_0x18b7cb[_0xb387('0x53')],['ids','id'])||{});}})[_0xb387('0x14')](respondWithResult(_0x4f9e91,null))[_0xb387('0x1d')](handleError(_0x4f9e91,null));};exports[_0xb387('0xe5')]=function(_0x2c3a65,_0x495994){var _0x45575b={'raw':![],'where':{}};var _0x52c1d9={};var _0x58eac8={'count':0x0,'rows':[]};return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x2c3a65[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0x495994,null))['then'](function(_0x584450){if(_0x584450){_0x52c1d9['model']=_[_0xb387('0x34')](db[_0xb387('0xa9')]['rawAttributes']);_0x52c1d9[_0xb387('0x36')]=_[_0xb387('0x34')](_0x2c3a65[_0xb387('0x36')]);_0x52c1d9[_0xb387('0x35')]=_[_0xb387('0x38')](_0x52c1d9[_0xb387('0x33')],_0x52c1d9[_0xb387('0x36')]);_0x45575b[_0xb387('0x37')]=_[_0xb387('0x38')](_0x52c1d9[_0xb387('0x33')],qs['fields'](_0x2c3a65[_0xb387('0x36')][_0xb387('0x39')]));_0x45575b[_0xb387('0x37')]=_0x45575b['attributes']['length']?_0x45575b[_0xb387('0x37')]:_0x52c1d9[_0xb387('0x33')];if(!_0x2c3a65[_0xb387('0x36')][_0xb387('0x5f')]('nolimit')){_0x45575b[_0xb387('0x23')]=qs[_0xb387('0x23')](_0x2c3a65['query'][_0xb387('0x23')]);_0x45575b['offset']=qs[_0xb387('0x20')](_0x2c3a65[_0xb387('0x36')][_0xb387('0x20')]);}_0x45575b['order']=qs['sort'](_0x2c3a65[_0xb387('0x36')][_0xb387('0x3b')]);_0x45575b[_0xb387('0x3c')]=qs['filters'](_[_0xb387('0x3d')](_0x2c3a65[_0xb387('0x36')],_0x52c1d9[_0xb387('0x35')]));_0x45575b[_0xb387('0x3c')]['ChatWebsiteId']=_0x584450['id'];if(_0x2c3a65[_0xb387('0x36')][_0xb387('0x3e')]){_0x45575b[_0xb387('0x3c')]=_[_0xb387('0x3f')](_0x45575b[_0xb387('0x3c')],{'$or':_[_0xb387('0x2f')](_0x45575b[_0xb387('0x37')],function(_0x58eff7){var _0x3a44bf={};_0x3a44bf[_0x58eff7]={'$like':'%'+_0x2c3a65['query'][_0xb387('0x3e')]+'%'};return _0x3a44bf;})});}_0x45575b=_[_0xb387('0x3f')]({},_0x45575b,_0x2c3a65[_0xb387('0x47')]);return db[_0xb387('0xa9')][_0xb387('0x22')]({'where':_0x45575b[_0xb387('0x3c')]})[_0xb387('0x14')](function(_0x41b1fa){_0x58eac8[_0xb387('0x22')]=_0x41b1fa;if(_0x2c3a65[_0xb387('0x36')][_0xb387('0x41')]){_0x45575b[_0xb387('0x42')]=[{'model':db[_0xb387('0x83')],'as':_0xb387('0xe6'),'required':![]},{'model':db[_0xb387('0xe7')],'as':_0xb387('0xe8'),'attributes':[_0xb387('0x2c'),_0xb387('0xe9'),'internal'],'required':![]},{'model':db[_0xb387('0xea')],'as':_0xb387('0xeb'),'attributes':['id',_0xb387('0x2c'),_0xb387('0xec')],'where':_0x2c3a65[_0xb387('0x36')][_0xb387('0xed')]?{'id':_0x2c3a65['query'][_0xb387('0xed')]}:undefined,'required':_0x2c3a65['query'][_0xb387('0xed')]?!![]:![]}];}return db[_0xb387('0xa9')]['findAll'](_0x45575b);})[_0xb387('0x14')](function(_0x351a33){_0x58eac8[_0xb387('0x62')]=_0x351a33;return _0x58eac8;});}})[_0xb387('0x14')](respondWithFilteredResult(_0x495994,_0x45575b))[_0xb387('0x1d')](handleError(_0x495994,null));};function iftimePromise(_0x26f0f6,_0x2135e3){return respondWithRpcPromise(_0xb387('0xee'),_0xb387('0xef'),{'command':_0x2135e3[_0xb387('0xf0')]?util[_0xb387('0xa3')](_0xb387('0xf1'),_0x26f0f6[_0xb387('0xf2')],_0x2135e3[_0xb387('0xf0')]):util[_0xb387('0xa3')](_0xb387('0xf3'),_0x26f0f6[_0xb387('0xf2')])},client9002)['then'](function(_0x3109c3){var _0x389446=_0x3109c3&&_0x3109c3[_0xb387('0xf4')]('true')>=0x0?!![]:![];logger[_0xb387('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2135e3['id'],_0x26f0f6['id'],_0x26f0f6['interval'],_0x389446?_0xb387('0xf5'):_0xb387('0xf6'),_0x2135e3[_0xb387('0xf0')]?_0x2135e3['timezone']:_0xb387('0xf7'));return _0x389446;})[_0xb387('0x1d')](function(_0x526aca){logger[_0xb387('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2135e3['id'],_0x26f0f6['id'],_0x26f0f6['interval'],util[_0xb387('0xf8')](_0x526aca,{'showHidden':![],'depth':null}),_0x2135e3[_0xb387('0xf0')]?_0x2135e3['timezone']:'No\x20timezone');return![];});}exports[_0xb387('0xef')]=function(_0x21c29b,_0x224e32){var _0x1e767a=0x0;var _0x243616=0x0;var _0x145b97=![];var _0x2941ba;var _0x3aa3fb;return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0x21c29b[_0xb387('0x44')]['id']},'include':[{'model':db['Interval'],'as':_0xb387('0xf9'),'include':[{'model':db[_0xb387('0xf9')],'as':_0xb387('0xfa'),'attributes':['id',_0xb387('0xf2')],'raw':!![]}]}]})[_0xb387('0x14')](handleEntityNotFound(_0x224e32,null))[_0xb387('0x14')](function(_0x334631){if(_0x334631){_0x2941ba=_0x334631;return _0x334631[_0xb387('0xfb')]({'raw':!![]});}})[_0xb387('0x14')](function(_0x2f0653){if(_0x2941ba){if(_0x2f0653){_0x3aa3fb=_0x2f0653;}}return require(_0xb387('0x71'))[_0xb387('0x72')]();})['then'](function(_0x57e31d){if(_0x57e31d){_0x243616=_0x57e31d[_0xb387('0xfc')];_0x145b97=_0x57e31d[_0xb387('0xfd')];}})[_0xb387('0x14')](function(){return db[_0xb387('0xa9')]['count']({'where':{'closed':![]}});})[_0xb387('0x14')](function(_0xce59){_0x1e767a=_0xce59;if(_0x243616&&_0xce59>_0x243616){return db[_0xb387('0xfe')]['findOne']({'where':{'id':0x1}})['then'](function(_0x323ccb){if(_0x323ccb){_0x323ccb[_0xb387('0xff')](_0xb387('0x100'));}});}})[_0xb387('0x14')](function(){if(_0x2941ba[_0xb387('0xf9')]&&_0x2941ba['Interval'][_0xb387('0xfa')]){var _0x3413ce=[];for(var _0x48fdda=0x0;_0x48fdda<_0x2941ba[_0xb387('0xf9')][_0xb387('0xfa')][_0xb387('0x5a')];_0x48fdda++){var _0x2a26c2=_0x2941ba['Interval'][_0xb387('0xfa')][_0x48fdda][_0xb387('0x28')]({'plain':!![]});_0x3413ce['push'](iftimePromise(_0x2a26c2,_0x2941ba));}return BPromise[_0xb387('0x101')](_0x3413ce)[_0xb387('0x14')](function(_0x5dd905){return _[_0xb387('0x102')](_0x5dd905);});}else{return!![];}})['then'](function(_0x3c0a80){var _0x132710=fs[_0xb387('0xc6')](path[_0xb387('0x6e')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x3e5dbb=new url['URL'](_0x2941ba[_0xb387('0x103')])[_0xb387('0x104')];var _0xaf705e='3.2.0';var _0x525110=![];var _0x394674={'chatVersion':_0xaf705e,'chatWebsiteAddressOrigin':_0x3e5dbb,'remote':_0x2941ba[_0xb387('0x105')],'query':querystring[_0xb387('0x18')](_[_0xb387('0x3f')](_0x2941ba[_0xb387('0x28')]({'plain':!![]}),{'customerIp':_0x21c29b[_0xb387('0x81')][_0xb387('0x9c')]||_0x21c29b[_0xb387('0x81')][_0xb387('0x106')]||_0x21c29b[_0xb387('0x107')][_0xb387('0x108')]||_0x21c29b['ip'],'referer':_0x21c29b[_0xb387('0x81')][_0xb387('0x109')],'openedInteractions':_0x1e767a,'maxInteractions':_0x243616,'virtual':_0x145b97[_0xb387('0xfc')],'online':_0x3c0a80,'custom':_0x145b97}))[_0xb387('0x10a')](/'/g,'\x5c\x27')};_0x224e32[_0xb387('0x2d')](ejs[_0xb387('0xc7')](Mustache['render'](_0x132710,_0x394674),{'proactiveActions':_0x3aa3fb,'alignment':_0x2941ba[_0xb387('0x10b')],'verticalAlignment':_0x2941ba[_0xb387('0x10c')],'div_color':_0x2941ba[_0xb387('0xec')],'labelText':_0x2941ba['labelText'],'text_color':_0x2941ba['textColor'],'text_button_color':_0x2941ba[_0xb387('0x10d')],'button_color':_0x2941ba[_0xb387('0x10e')],'background_color':_0x2941ba['backgroundColor'],'hideWhenOffline':_0x2941ba[_0xb387('0x10f')],'intervalId':_0x2941ba[_0xb387('0x110')],'isDevelopment':_0x525110,'chatVersion':_0xaf705e}));})[_0xb387('0x1d')](handleError(_0x224e32,null));};exports[_0xb387('0x111')]=function(_0x1e227e,_0xc73b49){var _0x2d6925=_0x1e227e[_0xb387('0x44')]['id'];var _0x3e15f6=_0x1e227e[_0xb387('0x53')];var _0x59625e=0xc8;var _0xcb40d5=null;return db['sequelize'][_0xb387('0x112')]({'isolationLevel':db[_0xb387('0xd1')][_0xb387('0x113')][_0xb387('0x114')]['READ_COMMITTED']},function(_0x1407af){return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x2d6925},'transaction':_0x1407af})['then'](function(_0x3ca5cd){if(_0x3ca5cd){return db[_0xb387('0x93')][_0xb387('0x27')]({'where':{'ChatWebsiteId':_0x2d6925},'transaction':_0x1407af})[_0xb387('0x14')](function(){var _0x15186b=_[_0xb387('0x2f')](_0x3e15f6,function(_0x3c9de4){_0x3c9de4[_0xb387('0x56')]=_0x2d6925;return _0x3c9de4;});return db[_0xb387('0x93')][_0xb387('0xd3')](_0x15186b,{'transaction':_0x1407af});});}else{_0x59625e=0x194;_0xcb40d5=[];}});})[_0xb387('0x14')](function(){if(_0x59625e!==0x194){return db[_0xb387('0x93')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2d6925},'order':_0xb387('0x99')})[_0xb387('0x14')](function(_0x4cfec2){_0xcb40d5=_0x4cfec2;});}})['catch'](function(_0x3677c8){_0x59625e=0x1f4;logger[_0xb387('0x19')](_0x3677c8[_0xb387('0x2b')]);if(_0x3677c8['name']){delete _0x3677c8[_0xb387('0x2c')];}_0xcb40d5=_0x3677c8;})[_0xb387('0x115')](function(){if(_0xcb40d5===null){_0xc73b49['sendStatus'](_0x59625e);}else{if(_0x59625e===0x1f4){_0xc73b49[_0xb387('0x1f')](_0x59625e)[_0xb387('0x2d')](_0xcb40d5);}else{_0xc73b49[_0xb387('0x1f')](_0x59625e)[_0xb387('0x26')](_0xcb40d5);}}});};exports[_0xb387('0x116')]=function(_0x4c5439,_0x1b8387){var _0x295574={};var _0x3cc62c={};var _0x10327b;var _0x3ad2a6;return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x4c5439[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x1b8387,null))[_0xb387('0x14')](function(_0x381489){if(_0x381489){_0x10327b=_0x381489;_0x3cc62c['model']=_[_0xb387('0x34')](db[_0xb387('0x93')][_0xb387('0x31')]);_0x3cc62c[_0xb387('0x36')]=_['keys'](_0x4c5439[_0xb387('0x36')]);_0x3cc62c[_0xb387('0x35')]=_[_0xb387('0x38')](_0x3cc62c['model'],_0x3cc62c[_0xb387('0x36')]);_0x295574['attributes']=_['intersection'](_0x3cc62c['model'],qs['fields'](_0x4c5439[_0xb387('0x36')]['fields']));_0x295574['attributes']=_0x295574[_0xb387('0x37')][_0xb387('0x5a')]?_0x295574[_0xb387('0x37')]:_0x3cc62c[_0xb387('0x33')];_0x295574[_0xb387('0x3a')]=qs[_0xb387('0x3b')](_0x4c5439[_0xb387('0x36')][_0xb387('0x3b')]);_0x295574[_0xb387('0x3c')]=qs[_0xb387('0x35')](_['pick'](_0x4c5439['query'],_0x3cc62c['filters']));if(_0x4c5439['query'][_0xb387('0x3e')]){_0x295574['where']=_[_0xb387('0x3f')](_0x295574[_0xb387('0x3c')],{'$or':_[_0xb387('0x2f')](_0x295574[_0xb387('0x37')],function(_0x3a41c4){var _0x3a7deb={};_0x3a7deb[_0x3a41c4]={'$like':'%'+_0x4c5439[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x3a7deb;})});}_0x295574=_[_0xb387('0x3f')]({},_0x295574,_0x4c5439[_0xb387('0x47')]);return _0x10327b[_0xb387('0x116')](_0x295574);}})[_0xb387('0x14')](function(_0x389e20){if(_0x389e20){_0x3ad2a6=_0x389e20[_0xb387('0x5a')];if(!_0x4c5439[_0xb387('0x36')][_0xb387('0x5f')](_0xb387('0x60'))){_0x295574[_0xb387('0x23')]=qs[_0xb387('0x23')](_0x4c5439[_0xb387('0x36')]['limit']);_0x295574['offset']=qs[_0xb387('0x20')](_0x4c5439[_0xb387('0x36')]['offset']);}return _0x10327b[_0xb387('0x116')](_0x295574);}})['then'](function(_0x4df3e1){if(_0x4df3e1){return _0x4df3e1?{'count':_0x3ad2a6,'rows':_0x4df3e1}:null;}})[_0xb387('0x14')](respondWithResult(_0x1b8387,null))[_0xb387('0x1d')](handleError(_0x1b8387,null));};exports[_0xb387('0x117')]=function(_0x117e7f,_0x830240){return db[_0xb387('0x118')][_0xb387('0x48')]({'where':{'id':_0x117e7f[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x830240,null))[_0xb387('0x14')](function(_0x912846){if(_0x912846){return _0x912846[_0xb387('0x117')](_0x117e7f[_0xb387('0x53')]['ids'],_['omit'](_0x117e7f['body'],['ids','id'])||{});}})[_0xb387('0x14')](respondWithResult(_0x830240,null))[_0xb387('0x1d')](handleError(_0x830240,null));};exports[_0xb387('0xfb')]=function(_0x5a5b05,_0x50d1a7){var _0x1063ac={};var _0x13a38c={};var _0x241c2b;var _0x3a7b3a;return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x5a5b05[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x50d1a7,null))[_0xb387('0x14')](function(_0x31ed34){if(_0x31ed34){_0x241c2b=_0x31ed34;_0x13a38c[_0xb387('0x33')]=_[_0xb387('0x34')](db['ChatProactiveAction'][_0xb387('0x31')]);_0x13a38c['query']=_[_0xb387('0x34')](_0x5a5b05[_0xb387('0x36')]);_0x13a38c[_0xb387('0x35')]=_[_0xb387('0x38')](_0x13a38c[_0xb387('0x33')],_0x13a38c['query']);_0x1063ac[_0xb387('0x37')]=_[_0xb387('0x38')](_0x13a38c[_0xb387('0x33')],qs[_0xb387('0x39')](_0x5a5b05['query'][_0xb387('0x39')]));_0x1063ac[_0xb387('0x37')]=_0x1063ac[_0xb387('0x37')]['length']?_0x1063ac[_0xb387('0x37')]:_0x13a38c['model'];_0x1063ac['order']=qs['sort'](_0x5a5b05['query'][_0xb387('0x3b')]);_0x1063ac['where']=qs[_0xb387('0x35')](_[_0xb387('0x3d')](_0x5a5b05[_0xb387('0x36')],_0x13a38c[_0xb387('0x35')]));if(_0x5a5b05[_0xb387('0x36')]['filter']){_0x1063ac[_0xb387('0x3c')]=_['merge'](_0x1063ac['where'],{'$or':_[_0xb387('0x2f')](_0x1063ac['attributes'],function(_0x90afd){var _0x2c2784={};_0x2c2784[_0x90afd]={'$like':'%'+_0x5a5b05[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x2c2784;})});}_0x1063ac=_[_0xb387('0x3f')]({},_0x1063ac,_0x5a5b05[_0xb387('0x47')]);return _0x241c2b[_0xb387('0xfb')](_0x1063ac);}})[_0xb387('0x14')](function(_0x26dc48){if(_0x26dc48){_0x3a7b3a=_0x26dc48[_0xb387('0x5a')];if(!_0x5a5b05[_0xb387('0x36')]['hasOwnProperty'](_0xb387('0x60'))){_0x1063ac[_0xb387('0x23')]=qs[_0xb387('0x23')](_0x5a5b05['query'][_0xb387('0x23')]);_0x1063ac['offset']=qs[_0xb387('0x20')](_0x5a5b05['query'][_0xb387('0x20')]);}return _0x241c2b[_0xb387('0xfb')](_0x1063ac);}})[_0xb387('0x14')](function(_0x482c6b){if(_0x482c6b){return _0x482c6b?{'count':_0x3a7b3a,'rows':_0x482c6b}:null;}})[_0xb387('0x14')](respondWithResult(_0x50d1a7,null))[_0xb387('0x1d')](handleError(_0x50d1a7,null));};exports[_0xb387('0x119')]=function(_0x2cab6b,_0x3835fa){var _0x13bafb=_0x2cab6b['query']['online']===_0xb387('0x11a')?_0xb387('0x11b'):_0xb387('0x11c');return db[_0xb387('0x30')][_0xb387('0x48')]({'attributes':['id',_0x13bafb],'where':{'id':_0x2cab6b[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x3835fa,null))[_0xb387('0x14')](function(_0x16e156){if(_0x16e156){var _0x25636f=_0x16e156[_0x13bafb];var _0x4c92bc=_0x25636f&&_0x25636f[_0xb387('0x11d')]?_0x25636f['items']:[];_0x3835fa[_0xb387('0x2d')]({'fromKey':_[_0xb387('0x73')](_0x25636f[_0xb387('0x11e')])?undefined:_0x25636f[_0xb387('0x11e')],'count':_0x4c92bc[_0xb387('0x5a')],'rows':_0x4c92bc});}})[_0xb387('0x1d')](handleError(_0x3835fa,null));};exports['getOfflineMessages']=function(_0x212e3d,_0x49ff8d){var _0x3ae4d3={'raw':![],'where':{}};var _0x3addb8={};var _0x484fd3={'count':0x0,'rows':[]};return db[_0xb387('0x30')][_0xb387('0x59')]({'where':{'id':_0x212e3d[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0x49ff8d,null))[_0xb387('0x14')](function(_0x14e472){if(_0x14e472){_0x3addb8[_0xb387('0x33')]=_[_0xb387('0x34')](db[_0xb387('0x11f')][_0xb387('0x31')]);_0x3addb8[_0xb387('0x36')]=_[_0xb387('0x34')](_0x212e3d['query']);_0x3addb8[_0xb387('0x35')]=_['intersection'](_0x3addb8[_0xb387('0x33')],_0x3addb8[_0xb387('0x36')]);_0x3ae4d3[_0xb387('0x37')]=_[_0xb387('0x38')](_0x3addb8['model'],qs[_0xb387('0x39')](_0x212e3d[_0xb387('0x36')]['fields']));_0x3ae4d3['attributes']=_0x3ae4d3[_0xb387('0x37')][_0xb387('0x5a')]?_0x3ae4d3[_0xb387('0x37')]:_0x3addb8[_0xb387('0x33')];if(!_0x212e3d[_0xb387('0x36')][_0xb387('0x5f')]('nolimit')){_0x3ae4d3[_0xb387('0x23')]=qs[_0xb387('0x23')](_0x212e3d[_0xb387('0x36')][_0xb387('0x23')]);_0x3ae4d3[_0xb387('0x20')]=qs[_0xb387('0x20')](_0x212e3d['query'][_0xb387('0x20')]);}_0x3ae4d3[_0xb387('0x3a')]=qs['sort'](_0x212e3d[_0xb387('0x36')][_0xb387('0x3b')]);_0x3ae4d3[_0xb387('0x3c')]=qs[_0xb387('0x35')](_['pick'](_0x212e3d['query'],_0x3addb8[_0xb387('0x35')]));_0x3ae4d3[_0xb387('0x3c')]['ChatWebsiteId']=_0x14e472['id'];if(_0x212e3d[_0xb387('0x36')][_0xb387('0x3e')]){_0x3ae4d3['where']=_[_0xb387('0x3f')](_0x3ae4d3[_0xb387('0x3c')],{'$or':_[_0xb387('0x2f')](_0x3ae4d3[_0xb387('0x37')],function(_0x34c8c2){var _0x11f76f={};_0x11f76f[_0x34c8c2]={'$like':'%'+_0x212e3d[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x11f76f;})});}_0x3ae4d3=_[_0xb387('0x3f')]({},_0x3ae4d3,_0x212e3d[_0xb387('0x47')]);return db[_0xb387('0x11f')][_0xb387('0x22')]({'where':_0x3ae4d3[_0xb387('0x3c')]})[_0xb387('0x14')](function(_0x3ac70c){_0x484fd3['count']=_0x3ac70c;if(_0x212e3d[_0xb387('0x36')][_0xb387('0x41')]){_0x3ae4d3['include']=[{'all':!![]}];}else{_0x3ae4d3[_0xb387('0x42')]=[{'model':db[_0xb387('0x83')],'as':_0xb387('0xe6'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xb387('0x11f')][_0xb387('0x61')](_0x3ae4d3);})[_0xb387('0x14')](function(_0x132344){_0x484fd3['rows']=_0x132344;return _0x484fd3;});}})[_0xb387('0x14')](respondWithFilteredResult(_0x49ff8d,_0x3ae4d3))['catch'](handleError(_0x49ff8d,null));};exports[_0xb387('0x120')]=function(_0x1cef4f,_0x5d14cf){return db['ChatWebsite'][_0xb387('0x48')]({'where':{'id':_0x1cef4f[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d14cf,null))[_0xb387('0x14')](function(_0x41ea12){if(_0x41ea12){return _0x41ea12['addAgents'](_0x1cef4f[_0xb387('0x53')][_0xb387('0x5c')],_['omit'](_0x1cef4f[_0xb387('0x53')],[_0xb387('0x5c'),'id'])||{})[_0xb387('0xad')](function(_0x2f0a8e){for(var _0x2c1b5c=0x0;_0x2c1b5c<_0x1cef4f[_0xb387('0x53')][_0xb387('0x5c')][_0xb387('0x5a')];_0x2c1b5c+=0x1){socket[_0xb387('0x121')](_0xb387('0x122'),{'UserId':Number(_0x1cef4f[_0xb387('0x53')]['ids'][_0x2c1b5c]),'ChatWebsiteId':Number(_0x1cef4f[_0xb387('0x44')]['id'])});}return _0x2f0a8e;});}})['then'](respondWithResult(_0x5d14cf,null))[_0xb387('0x1d')](handleError(_0x5d14cf,null));};exports[_0xb387('0x123')]=function(_0xd73de1,_0x2cfc37){return db[_0xb387('0x30')][_0xb387('0x48')]({'where':{'id':_0xd73de1[_0xb387('0x44')]['id']}})[_0xb387('0x14')](handleEntityNotFound(_0x2cfc37,null))[_0xb387('0x14')](function(_0x339f55){if(_0x339f55){return _0x339f55[_0xb387('0x123')](_0xd73de1[_0xb387('0x36')][_0xb387('0x5c')])[_0xb387('0x14')](function(){if(_['isArray'](_0xd73de1['query']['ids'])){for(var _0x2ffc9e=0x0;_0x2ffc9e<_0xd73de1['query'][_0xb387('0x5c')][_0xb387('0x5a')];_0x2ffc9e+=0x1){socket['emit'](_0xb387('0x124'),{'UserId':Number(_0xd73de1['query'][_0xb387('0x5c')][_0x2ffc9e]),'ChatWebsiteId':Number(_0xd73de1[_0xb387('0x44')]['id'])});}}else{socket[_0xb387('0x121')](_0xb387('0x124'),{'UserId':Number(_0xd73de1['query'][_0xb387('0x5c')]),'ChatWebsiteId':Number(_0xd73de1[_0xb387('0x44')]['id'])});}});}})[_0xb387('0x14')](respondWithStatusCode(_0x2cfc37,null))[_0xb387('0x1d')](handleError(_0x2cfc37,null));};exports[_0xb387('0x125')]=function(_0x736e38,_0x10451b){var _0x43bb48={};var _0x1865ca={};var _0xd693e5;var _0x4ae6df;return db['ChatWebsite'][_0xb387('0x59')]({'where':{'id':_0x736e38[_0xb387('0x44')]['id']}})['then'](handleEntityNotFound(_0x10451b,null))['then'](function(_0x13d992){if(_0x13d992){_0xd693e5=_0x13d992;_0x1865ca[_0xb387('0x33')]=_[_0xb387('0x34')](db[_0xb387('0xe7')][_0xb387('0x31')]);_0x1865ca[_0xb387('0x36')]=_['keys'](_0x736e38[_0xb387('0x36')]);_0x1865ca[_0xb387('0x35')]=_[_0xb387('0x38')](_0x1865ca[_0xb387('0x33')],_0x1865ca[_0xb387('0x36')]);_0x43bb48[_0xb387('0x37')]=_[_0xb387('0x38')](_0x1865ca['model'],qs['fields'](_0x736e38[_0xb387('0x36')]['fields']));_0x43bb48[_0xb387('0x37')]=_0x43bb48[_0xb387('0x37')][_0xb387('0x5a')]?_0x43bb48[_0xb387('0x37')]:_0x1865ca[_0xb387('0x33')];_0x43bb48[_0xb387('0x3a')]=qs[_0xb387('0x3b')](_0x736e38[_0xb387('0x36')][_0xb387('0x3b')]);_0x43bb48[_0xb387('0x3c')]=qs['filters'](_['pick'](_0x736e38[_0xb387('0x36')],_0x1865ca[_0xb387('0x35')]));if(_0x736e38[_0xb387('0x36')]['filter']){_0x43bb48[_0xb387('0x3c')]=_[_0xb387('0x3f')](_0x43bb48[_0xb387('0x3c')],{'$or':_['map'](_0x43bb48[_0xb387('0x37')],function(_0x38bef0){var _0x710a7a={};_0x710a7a[_0x38bef0]={'$like':'%'+_0x736e38[_0xb387('0x36')][_0xb387('0x3e')]+'%'};return _0x710a7a;})});}_0x43bb48=_[_0xb387('0x3f')]({},_0x43bb48,_0x736e38['options']);return _0xd693e5[_0xb387('0x125')](_0x43bb48);}})[_0xb387('0x14')](function(_0x1dc551){if(_0x1dc551){_0x4ae6df=_0x1dc551['length'];if(!_0x736e38['query'][_0xb387('0x5f')](_0xb387('0x60'))){_0x43bb48['limit']=qs[_0xb387('0x23')](_0x736e38[_0xb387('0x36')][_0xb387('0x23')]);_0x43bb48[_0xb387('0x20')]=qs['offset'](_0x736e38[_0xb387('0x36')][_0xb387('0x20')]);}return _0xd693e5[_0xb387('0x125')](_0x43bb48);}})[_0xb387('0x14')](function(_0x1e9358){if(_0x1e9358){return _0x1e9358?{'count':_0x4ae6df,'rows':_0x1e9358}:null;}})[_0xb387('0x14')](respondWithResult(_0x10451b,null))['catch'](handleError(_0x10451b,null));}; \ No newline at end of file +var _0x1296=['finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','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','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','ids','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','sitepic','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','server/files/images/avatars/system_avatar.png','systemAvatar','isNil','notify','user-agent-parser','headers','user-agent','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','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','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','originalname','toPairsIn','mapValues','lastName','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','URL','origin','3.2.0','remote','x-real-ip','connection','remoteAddress','alignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll'];(function(_0x311bfd,_0x333a53){var _0x570d59=function(_0x2b722e){while(--_0x2b722e){_0x311bfd['push'](_0x311bfd['shift']());}};_0x570d59(++_0x333a53);}(_0x1296,0x13f));var _0x6129=function(_0x52c6d5,_0x584ab3){_0x52c6d5=_0x52c6d5-0x0;var _0x4216a8=_0x1296[_0x52c6d5];return _0x4216a8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x6129('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x6129('0x1'));var fs=require('fs');var fs_extra=require(_0x6129('0x2'));var _=require(_0x6129('0x3'));var querystring=require(_0x6129('0x4'));var Redis=require(_0x6129('0x5'));var qs=require(_0x6129('0x6'));var logger=require(_0x6129('0x7'))(_0x6129('0x8'));var config=require(_0x6129('0x9'));var url=require('url');var db=require(_0x6129('0xa'))['db'];config[_0x6129('0xb')]=_[_0x6129('0xc')](config[_0x6129('0xb')],{'host':_0x6129('0xd'),'port':0x18eb});var socket=require(_0x6129('0xe'))(new Redis(config[_0x6129('0xb')]));require('./chatWebsite.socket')[_0x6129('0xf')](socket);var htmlToText=require(_0x6129('0x10'));var jayson=require(_0x6129('0x11'));var client=jayson[_0x6129('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x6129('0x12')][_0x6129('0x13')]({'port':0x232a});var client9003=jayson[_0x6129('0x12')][_0x6129('0x13')]({'port':0x232b});var client9001=jayson[_0x6129('0x12')][_0x6129('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x2a50c7,_0x1d929e,_0x473832,_0x3539c6){return new BPromise(function(_0x4ba836,_0x1a3094){var _0x5f423e=_0x3539c6||client;return _0x5f423e[_0x6129('0x14')](_0x2a50c7,_0x473832)[_0x6129('0x15')](function(_0x37d32b){logger[_0x6129('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1d929e,_0x6129('0x17'));logger[_0x6129('0x18')](_0x6129('0x19'),_0x1d929e,_0x6129('0x17'),JSON[_0x6129('0x1a')](_0x37d32b));if(_0x37d32b[_0x6129('0x1b')]){if(_0x37d32b[_0x6129('0x1b')][_0x6129('0x1c')]===0x1f4){logger[_0x6129('0x1b')](_0x6129('0x1d'),_0x1d929e,_0x37d32b[_0x6129('0x1b')][_0x6129('0x1e')]);return _0x1a3094(_0x37d32b[_0x6129('0x1b')][_0x6129('0x1e')]);}logger[_0x6129('0x1b')](_0x6129('0x1d'),_0x1d929e,_0x37d32b['error'][_0x6129('0x1e')]);return _0x4ba836(_0x37d32b[_0x6129('0x1b')][_0x6129('0x1e')]);}else{logger[_0x6129('0x16')](_0x6129('0x1d'),_0x1d929e,_0x6129('0x17'));_0x4ba836(_0x37d32b[_0x6129('0x1f')][_0x6129('0x1e')]);}})['catch'](function(_0x182567){logger[_0x6129('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x1d929e,_0x182567);_0x1a3094(_0x182567);});});}function respondWithStatusCode(_0x17a7a8,_0x2d1886){_0x2d1886=_0x2d1886||0xcc;return function(_0x1549ab){if(_0x1549ab){return _0x17a7a8[_0x6129('0x20')](_0x2d1886);}return _0x17a7a8[_0x6129('0x21')](_0x2d1886)[_0x6129('0x22')]();};}function respondWithResult(_0x4123c1,_0x2c0fab){_0x2c0fab=_0x2c0fab||0xc8;return function(_0x3cd67d){if(_0x3cd67d){return _0x4123c1['status'](_0x2c0fab)[_0x6129('0x23')](_0x3cd67d);}};}function respondWithFilteredResult(_0x55535d,_0x4f8cc3){return function(_0x352af2){if(_0x352af2){var _0x2b2a65=typeof _0x4f8cc3['offset']==='undefined'&&typeof _0x4f8cc3['limit']===_0x6129('0x24');var _0x3397c4=_0x352af2[_0x6129('0x25')];var _0x373f2b=_0x2b2a65?0x0:_0x4f8cc3['offset'];var _0x2c5ac8=_0x2b2a65?_0x352af2[_0x6129('0x25')]:_0x4f8cc3[_0x6129('0x26')]+_0x4f8cc3[_0x6129('0x27')];var _0x1dc38;if(_0x2c5ac8>=_0x3397c4){_0x2c5ac8=_0x3397c4;_0x1dc38=0xc8;}else{_0x1dc38=0xce;}_0x55535d['status'](_0x1dc38);return _0x55535d[_0x6129('0x28')]('Content-Range',_0x373f2b+'-'+_0x2c5ac8+'/'+_0x3397c4)[_0x6129('0x23')](_0x352af2);}return null;};}function saveUpdates(_0x210eff){return function(_0xcdcfe9){if(_0xcdcfe9){return _0xcdcfe9['update'](_0x210eff)[_0x6129('0x15')](function(_0x1fb045){return _0x1fb045;});}return null;};}function removeEntity(_0x5dbefe){return function(_0xf02116){if(_0xf02116){return _0xf02116[_0x6129('0x29')]()[_0x6129('0x15')](function(){var _0x35e076=_0xf02116[_0x6129('0x2a')]({'plain':!![]});var _0x496f56=_0x6129('0x2b');return db[_0x6129('0x2c')]['destroy']({'where':{'type':_0x496f56,'resourceId':_0x35e076['id']}})['then'](function(){return _0xf02116;});})[_0x6129('0x15')](function(){_0x5dbefe[_0x6129('0x21')](0xcc)[_0x6129('0x22')]();});}};}function handleEntityNotFound(_0x3e1e17){return function(_0x2947c7){if(!_0x2947c7){_0x3e1e17['sendStatus'](0x194);}return _0x2947c7;};}function handleError(_0x1e5121,_0x58cc4a){_0x58cc4a=_0x58cc4a||0x1f4;return function(_0x3754bc){logger[_0x6129('0x1b')](_0x3754bc[_0x6129('0x2d')]);if(_0x3754bc[_0x6129('0x2e')]){delete _0x3754bc[_0x6129('0x2e')];}_0x1e5121[_0x6129('0x21')](_0x58cc4a)['send'](_0x3754bc);};}exports[_0x6129('0x2f')]=function(_0x141410,_0x315db6){var _0x117e9a={'include':[{'model':db[_0x6129('0x30')],'as':_0x6129('0x31')}]},_0x204c31={},_0x59f5b4={'count':0x0,'rows':[]};var _0x3d286b=_[_0x6129('0x32')](db[_0x6129('0x33')]['rawAttributes'],function(_0x2b049d){return{'name':_0x2b049d[_0x6129('0x34')],'type':_0x2b049d[_0x6129('0x35')][_0x6129('0x36')]};});_0x204c31[_0x6129('0x37')]=_['map'](_0x3d286b,_0x6129('0x2e'));_0x204c31[_0x6129('0x38')]=_[_0x6129('0x39')](_0x141410['query']);_0x204c31[_0x6129('0x3a')]=_[_0x6129('0x3b')](_0x204c31[_0x6129('0x37')],_0x204c31[_0x6129('0x38')]);_0x117e9a['attributes']=_['intersection'](_0x204c31['model'],qs[_0x6129('0x3c')](_0x141410[_0x6129('0x38')][_0x6129('0x3c')]));_0x117e9a['attributes']=_0x117e9a['attributes']['length']?_0x117e9a[_0x6129('0x3d')]:_0x204c31['model'];if(!_0x141410[_0x6129('0x38')][_0x6129('0x3e')](_0x6129('0x3f'))){_0x117e9a['limit']=qs['limit'](_0x141410['query']['limit']);_0x117e9a[_0x6129('0x26')]=qs[_0x6129('0x26')](_0x141410[_0x6129('0x38')]['offset']);}_0x117e9a['order']=qs['sort'](_0x141410['query'][_0x6129('0x40')]);_0x117e9a[_0x6129('0x41')]=qs[_0x6129('0x3a')](_[_0x6129('0x42')](_0x141410[_0x6129('0x38')],_0x204c31[_0x6129('0x3a')]),_0x3d286b);if(_0x141410[_0x6129('0x38')][_0x6129('0x43')]){_0x117e9a[_0x6129('0x41')]=_[_0x6129('0x44')](_0x117e9a[_0x6129('0x41')],{'$or':_[_0x6129('0x32')](_0x3d286b,function(_0x3863b3){if(_0x3863b3['type']!==_0x6129('0x45')){var _0x54e5aa={};_0x54e5aa[_0x3863b3[_0x6129('0x2e')]]={'$like':'%'+_0x141410[_0x6129('0x38')][_0x6129('0x43')]+'%'};return _0x54e5aa;}})});}_0x117e9a=_[_0x6129('0x44')]({},_0x117e9a,_0x141410[_0x6129('0x46')]);var _0x27e171={'where':_0x117e9a['where']};return db['ChatWebsite']['count'](_0x27e171)[_0x6129('0x15')](function(_0x77bcac){_0x59f5b4[_0x6129('0x25')]=_0x77bcac;if(_0x141410[_0x6129('0x38')][_0x6129('0x47')]){_0x117e9a[_0x6129('0x48')]=[{'all':!![]}];}return db[_0x6129('0x33')][_0x6129('0x49')](_0x117e9a);})[_0x6129('0x15')](function(_0x1acca9){_0x59f5b4[_0x6129('0x4a')]=_0x1acca9;return _0x59f5b4;})['then'](respondWithFilteredResult(_0x315db6,_0x117e9a))[_0x6129('0x4b')](handleError(_0x315db6,null));};exports[_0x6129('0x4c')]=function(_0x4ee4e6,_0x5d5210){var _0x4922ae={'raw':![],'where':{'id':_0x4ee4e6[_0x6129('0x4d')]['id']},'include':[{'model':db[_0x6129('0x30')],'as':_0x6129('0x31')}]},_0x2cd6ba={};_0x2cd6ba[_0x6129('0x37')]=_['keys'](db[_0x6129('0x33')][_0x6129('0x4e')]);_0x2cd6ba[_0x6129('0x38')]=_[_0x6129('0x39')](_0x4ee4e6['query']);_0x2cd6ba[_0x6129('0x3a')]=_[_0x6129('0x3b')](_0x2cd6ba['model'],_0x2cd6ba[_0x6129('0x38')]);_0x4922ae[_0x6129('0x3d')]=_['intersection'](_0x2cd6ba['model'],qs[_0x6129('0x3c')](_0x4ee4e6[_0x6129('0x38')]['fields']));_0x4922ae['attributes']=_0x4922ae['attributes']['length']?_0x4922ae[_0x6129('0x3d')]:_0x2cd6ba[_0x6129('0x37')];if(_0x4ee4e6['query'][_0x6129('0x47')]){_0x4922ae[_0x6129('0x48')]=[{'all':!![]}];}_0x4922ae=_[_0x6129('0x44')]({},_0x4922ae,_0x4ee4e6[_0x6129('0x46')]);return db[_0x6129('0x33')][_0x6129('0x4f')](_0x4922ae)['then'](handleEntityNotFound(_0x5d5210,null))[_0x6129('0x15')](respondWithResult(_0x5d5210,null))['catch'](handleError(_0x5d5210,null));};exports[_0x6129('0x50')]=function(_0x1a753f,_0x34da7a){return db[_0x6129('0x33')]['create'](_0x1a753f[_0x6129('0x51')],{})[_0x6129('0x15')](function(_0x42828b){var _0x58672a=_0x1a753f[_0x6129('0x52')][_0x6129('0x2a')]({'plain':!![]});if(!_0x58672a)throw new Error(_0x6129('0x53'));if(_0x58672a[_0x6129('0x54')]===_0x6129('0x52')){var _0x28f54b=_0x42828b[_0x6129('0x2a')]({'plain':!![]});var _0x5b1f70=_0x6129('0x2b');return db[_0x6129('0x55')][_0x6129('0x4f')]({'where':{'name':_0x5b1f70,'userProfileId':_0x58672a[_0x6129('0x56')]},'raw':!![]})['then'](function(_0xfa75d1){if(_0xfa75d1&&_0xfa75d1['autoAssociation']===0x0){return db[_0x6129('0x2c')][_0x6129('0x50')]({'name':_0x28f54b['name'],'resourceId':_0x28f54b['id'],'type':_0xfa75d1[_0x6129('0x2e')],'sectionId':_0xfa75d1['id']},{})[_0x6129('0x15')](function(){return _0x42828b;});}else{return _0x42828b;}})['catch'](function(_0x50aea1){logger[_0x6129('0x1b')](_0x6129('0x57'),_0x50aea1);throw _0x50aea1;});}return _0x42828b;})['then'](respondWithResult(_0x34da7a,0xc9))[_0x6129('0x4b')](handleError(_0x34da7a,null));};exports[_0x6129('0x58')]=function(_0x4dea05,_0x3398d7){if(_0x4dea05[_0x6129('0x51')]['id']){delete _0x4dea05['body']['id'];}return db[_0x6129('0x33')]['find']({'where':{'id':_0x4dea05['params']['id']},'include':[{'model':db['Pause'],'as':_0x6129('0x31')}]})[_0x6129('0x15')](handleEntityNotFound(_0x3398d7,null))[_0x6129('0x15')](saveUpdates(_0x4dea05[_0x6129('0x51')],null))[_0x6129('0x15')](respondWithResult(_0x3398d7,null))[_0x6129('0x4b')](handleError(_0x3398d7,null));};exports[_0x6129('0x29')]=function(_0x59d6d4,_0x41ef61){return db['ChatWebsite'][_0x6129('0x4f')]({'where':{'id':_0x59d6d4[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x41ef61,null))[_0x6129('0x15')](removeEntity(_0x41ef61,null))[_0x6129('0x4b')](handleError(_0x41ef61,null));};exports[_0x6129('0x59')]=function(_0x213f9e,_0x1024af){return db[_0x6129('0x33')][_0x6129('0x59')]()[_0x6129('0x15')](respondWithResult(_0x1024af,null))['catch'](handleError(_0x1024af,null));};exports[_0x6129('0x5a')]=function(_0x3c77c9,_0x40afb0){if(_0x3c77c9[_0x6129('0x51')]['id']){delete _0x3c77c9['body']['id'];}return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x3c77c9['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x40afb0,null))[_0x6129('0x15')](function(_0x957395){if(_0x957395){_0x3c77c9[_0x6129('0x51')][_0x6129('0x5b')]=_0x957395['id'];return db[_0x6129('0x5c')][_0x6129('0x50')](_0x3c77c9[_0x6129('0x51')]);}})['then'](respondWithResult(_0x40afb0,null))['catch'](handleError(_0x40afb0,null));};exports[_0x6129('0x5d')]=function(_0x40710b,_0x4edd04){var _0x307b77={'raw':![],'where':{}};var _0x574815={};var _0x15cd2c={'count':0x0,'rows':[]};return db[_0x6129('0x33')][_0x6129('0x5e')]({'where':{'id':_0x40710b[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x4edd04,null))[_0x6129('0x15')](function(_0x45e05b){if(_0x45e05b){_0x574815[_0x6129('0x37')]=_['keys'](db[_0x6129('0x5c')][_0x6129('0x4e')]);_0x574815[_0x6129('0x38')]=_[_0x6129('0x39')](_0x40710b[_0x6129('0x38')]);_0x574815[_0x6129('0x3a')]=_['intersection'](_0x574815[_0x6129('0x37')],_0x574815['query']);_0x307b77['attributes']=_[_0x6129('0x3b')](_0x574815[_0x6129('0x37')],qs['fields'](_0x40710b['query'][_0x6129('0x3c')]));_0x307b77[_0x6129('0x3d')]=_0x307b77[_0x6129('0x3d')]['length']?_0x307b77['attributes']:_0x574815[_0x6129('0x37')];if(!_0x40710b[_0x6129('0x38')][_0x6129('0x3e')](_0x6129('0x3f'))){_0x307b77[_0x6129('0x27')]=qs['limit'](_0x40710b[_0x6129('0x38')][_0x6129('0x27')]);_0x307b77['offset']=qs[_0x6129('0x26')](_0x40710b[_0x6129('0x38')][_0x6129('0x26')]);}_0x307b77[_0x6129('0x5f')]=qs[_0x6129('0x40')](_0x40710b['query'][_0x6129('0x40')]);_0x307b77[_0x6129('0x41')]=qs[_0x6129('0x3a')](_['pick'](_0x40710b[_0x6129('0x38')],_0x574815[_0x6129('0x3a')]));_0x307b77[_0x6129('0x41')][_0x6129('0x5b')]=_0x45e05b['id'];if(_0x40710b[_0x6129('0x38')][_0x6129('0x43')]){_0x307b77['where']=_['merge'](_0x307b77[_0x6129('0x41')],{'$or':_['map'](_0x307b77[_0x6129('0x3d')],function(_0x46e222){var _0x4b8cbf={};_0x4b8cbf[_0x46e222]={'$like':'%'+_0x40710b[_0x6129('0x38')][_0x6129('0x43')]+'%'};return _0x4b8cbf;})});}_0x307b77=_[_0x6129('0x44')]({},_0x307b77,_0x40710b[_0x6129('0x46')]);return db[_0x6129('0x5c')][_0x6129('0x25')]({'where':_0x307b77[_0x6129('0x41')]})[_0x6129('0x15')](function(_0x76addc){_0x15cd2c[_0x6129('0x25')]=_0x76addc;if(_0x40710b[_0x6129('0x38')]['includeAll']){_0x307b77['include']=[{'all':!![]}];}return db[_0x6129('0x5c')][_0x6129('0x49')](_0x307b77);})['then'](function(_0x4a45f8){_0x15cd2c[_0x6129('0x4a')]=_0x4a45f8;return _0x15cd2c;});}})[_0x6129('0x15')](respondWithFilteredResult(_0x4edd04,_0x307b77))[_0x6129('0x4b')](handleError(_0x4edd04,null));};exports[_0x6129('0x60')]=function(_0x514d2d,_0x3251d2){return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x514d2d[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x3251d2,null))[_0x6129('0x15')](function(_0x205947){if(_0x205947){return _0x205947[_0x6129('0x60')](_0x514d2d[_0x6129('0x38')]['ids']);}})[_0x6129('0x15')](respondWithStatusCode(_0x3251d2,null))[_0x6129('0x4b')](handleError(_0x3251d2,null));};exports[_0x6129('0x61')]=function(_0x275f85,_0x5bc334){if(_0x275f85[_0x6129('0x51')]['id']){delete _0x275f85['body']['id'];}return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x275f85['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x5bc334,null))[_0x6129('0x15')](function(_0x4ab930){if(_0x4ab930){_0x275f85[_0x6129('0x51')]['ChatWebsiteId']=_0x4ab930['id'];return db[_0x6129('0x62')][_0x6129('0x50')](_0x275f85[_0x6129('0x51')]);}})['then'](respondWithResult(_0x5bc334,null))[_0x6129('0x4b')](handleError(_0x5bc334,null));};exports[_0x6129('0x63')]=function(_0x4d0ea5,_0x391ded){var _0x36c42f={'raw':![],'where':{}};var _0x41c89d={};var _0x3dfbe8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6129('0x5e')]({'where':{'id':_0x4d0ea5['params']['id']}})['then'](handleEntityNotFound(_0x391ded,null))[_0x6129('0x15')](function(_0x1d5843){if(_0x1d5843){_0x41c89d['model']=_['keys'](db[_0x6129('0x62')][_0x6129('0x4e')]);_0x41c89d[_0x6129('0x38')]=_[_0x6129('0x39')](_0x4d0ea5['query']);_0x41c89d[_0x6129('0x3a')]=_['intersection'](_0x41c89d['model'],_0x41c89d['query']);_0x36c42f['attributes']=_['intersection'](_0x41c89d['model'],qs[_0x6129('0x3c')](_0x4d0ea5[_0x6129('0x38')][_0x6129('0x3c')]));_0x36c42f[_0x6129('0x3d')]=_0x36c42f[_0x6129('0x3d')][_0x6129('0x64')]?_0x36c42f[_0x6129('0x3d')]:_0x41c89d[_0x6129('0x37')];if(!_0x4d0ea5[_0x6129('0x38')]['hasOwnProperty'](_0x6129('0x3f'))){_0x36c42f[_0x6129('0x27')]=qs[_0x6129('0x27')](_0x4d0ea5[_0x6129('0x38')][_0x6129('0x27')]);_0x36c42f[_0x6129('0x26')]=qs[_0x6129('0x26')](_0x4d0ea5[_0x6129('0x38')]['offset']);}_0x36c42f['order']=qs['sort'](_0x4d0ea5[_0x6129('0x38')][_0x6129('0x40')]);_0x36c42f[_0x6129('0x41')]=qs[_0x6129('0x3a')](_['pick'](_0x4d0ea5[_0x6129('0x38')],_0x41c89d[_0x6129('0x3a')]));_0x36c42f[_0x6129('0x41')]['ChatWebsiteId']=_0x1d5843['id'];if(_0x4d0ea5[_0x6129('0x38')]['filter']){_0x36c42f[_0x6129('0x41')]=_[_0x6129('0x44')](_0x36c42f['where'],{'$or':_[_0x6129('0x32')](_0x36c42f[_0x6129('0x3d')],function(_0x4cdd39){var _0x6dcc05={};_0x6dcc05[_0x4cdd39]={'$like':'%'+_0x4d0ea5[_0x6129('0x38')][_0x6129('0x43')]+'%'};return _0x6dcc05;})});}_0x36c42f=_[_0x6129('0x44')]({},_0x36c42f,_0x4d0ea5[_0x6129('0x46')]);return db[_0x6129('0x62')][_0x6129('0x25')]({'where':_0x36c42f[_0x6129('0x41')]})[_0x6129('0x15')](function(_0x71d78a){_0x3dfbe8[_0x6129('0x25')]=_0x71d78a;if(_0x4d0ea5[_0x6129('0x38')][_0x6129('0x47')]){_0x36c42f[_0x6129('0x48')]=[{'all':!![]}];}return db[_0x6129('0x62')][_0x6129('0x49')](_0x36c42f);})[_0x6129('0x15')](function(_0x2427ca){_0x3dfbe8['rows']=_0x2427ca;return _0x3dfbe8;});}})[_0x6129('0x15')](respondWithFilteredResult(_0x391ded,_0x36c42f))[_0x6129('0x4b')](handleError(_0x391ded,null));};exports[_0x6129('0x65')]=function(_0x1468dc,_0x4dd67c){return db['ChatWebsite'][_0x6129('0x4f')]({'where':{'id':_0x1468dc['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x4dd67c,null))[_0x6129('0x15')](function(_0x55fb0d){if(_0x55fb0d){return _0x55fb0d[_0x6129('0x65')](_0x1468dc[_0x6129('0x38')][_0x6129('0x66')]);}})['then'](respondWithStatusCode(_0x4dd67c,null))[_0x6129('0x4b')](handleError(_0x4dd67c,null));};exports['addLogo']=function(_0x181aed,_0x10ae1c){_0x181aed[_0x6129('0x51')]['sitepic']=_0x181aed['file']['filename'];return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x181aed[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x10ae1c,null))[_0x6129('0x15')](saveUpdates(_0x181aed['body'],null))[_0x6129('0x15')](respondWithResult(_0x10ae1c,null))['catch'](handleError(_0x10ae1c,null));};exports[_0x6129('0x67')]=function(_0x59ad87,_0x1e4370){_0x59ad87[_0x6129('0x51')][_0x6129('0x68')]=_0x59ad87[_0x6129('0x69')][_0x6129('0x6a')];return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x59ad87[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x1e4370,null))[_0x6129('0x15')](saveUpdates(_0x59ad87[_0x6129('0x51')],null))[_0x6129('0x15')](respondWithResult(_0x1e4370,null))[_0x6129('0x4b')](handleError(_0x1e4370,null));};exports[_0x6129('0x6b')]=function(_0x5bf03c,_0x4d99c1){_0x5bf03c[_0x6129('0x51')][_0x6129('0x6c')]=_0x5bf03c['file']['filename'];return db[_0x6129('0x33')]['find']({'where':{'id':_0x5bf03c[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x4d99c1,null))[_0x6129('0x15')](saveUpdates(_0x5bf03c[_0x6129('0x51')],null))['then'](respondWithResult(_0x4d99c1,null))[_0x6129('0x4b')](handleError(_0x4d99c1,null));};exports['addSystemAvatar']=function(_0x14a0ed,_0x2448df){_0x14a0ed[_0x6129('0x51')]['systemAvatar']=_0x14a0ed[_0x6129('0x69')]['filename'];return db['ChatWebsite'][_0x6129('0x4f')]({'where':{'id':_0x14a0ed['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x2448df,null))[_0x6129('0x15')](saveUpdates(_0x14a0ed[_0x6129('0x51')],null))[_0x6129('0x15')](respondWithResult(_0x2448df,null))['catch'](handleError(_0x2448df,null));};exports['getLogo']=function(_0x2a6364,_0x12f20d){var _0x36a32f=path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x6f'));var _0xf34191={'where':{'id':_0x2a6364['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x8e7441=![];return require(_0x6129('0x70'))[_0x6129('0x71')]()[_0x6129('0x15')](function(_0x43837f){if(_0x43837f){_0x8e7441=_0x43837f['custom'];}})['then'](function(){return db['ChatWebsite'][_0x6129('0x4f')](_0xf34191);})[_0x6129('0x15')](handleEntityNotFound(_0x12f20d,null))[_0x6129('0x15')](function(_0x5b0b22){if(_0x5b0b22){if(!_['isNil'](_0x5b0b22[_0x6129('0x72')])){if(fs[_0x6129('0x73')](path[_0x6129('0x6d')](config['root'],_0x6129('0x74'),_0x5b0b22[_0x6129('0x72')]))&&_0x8e7441){_0x36a32f=path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x74'),_0x5b0b22[_0x6129('0x72')]);}}return _0x12f20d[_0x6129('0x75')](_0x36a32f);}})[_0x6129('0x4b')](handleError(_0x12f20d,null));};exports['getAvatar']=function(_0x35748f,_0x170c90){var _0x4094cf=path['join'](config[_0x6129('0x6e')],_0x6129('0x76'));var _0x5b1e95={'where':{'id':_0x35748f[_0x6129('0x4d')]['id']},'attributes':['id',_0x6129('0x68')],'raw':!![]};return db[_0x6129('0x33')][_0x6129('0x4f')](_0x5b1e95)[_0x6129('0x15')](handleEntityNotFound(_0x170c90,null))['then'](function(_0x26449b){if(_0x26449b){if(!_['isNil'](_0x26449b[_0x6129('0x68')])){if(fs[_0x6129('0x73')](path['join'](config[_0x6129('0x6e')],_0x6129('0x77'),_0x26449b[_0x6129('0x68')]))){_0x4094cf=path['join'](config['root'],_0x6129('0x77'),_0x26449b[_0x6129('0x68')]);}}return _0x170c90[_0x6129('0x75')](_0x4094cf);}})[_0x6129('0x4b')](handleError(_0x170c90,null));};exports[_0x6129('0x78')]=function(_0x1afe78,_0x161b7e){var _0x4b108d=path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x79'));var _0x2ba463={'where':{'id':_0x1afe78[_0x6129('0x4d')]['id']},'attributes':['id',_0x6129('0x6c'),'showCustomerAvatar'],'raw':!![]};return db[_0x6129('0x33')]['find'](_0x2ba463)['then'](handleEntityNotFound(_0x161b7e,null))['then'](function(_0x391a29){if(_0x391a29){if(!_['isNil'](_0x391a29[_0x6129('0x6c')])){if(fs['existsSync'](path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x77'),_0x391a29[_0x6129('0x6c')]))&&_0x391a29[_0x6129('0x7a')]){_0x4b108d=path[_0x6129('0x6d')](config['root'],_0x6129('0x77'),_0x391a29[_0x6129('0x6c')]);}}return _0x161b7e['download'](_0x4b108d);}})[_0x6129('0x4b')](handleError(_0x161b7e,null));};exports['getSystemAvatar']=function(_0x53c069,_0x824743){var _0x44d626=path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x7b'));var _0x311dd9={'where':{'id':_0x53c069[_0x6129('0x4d')]['id']},'attributes':['id',_0x6129('0x7c')],'raw':!![]};return db['ChatWebsite']['find'](_0x311dd9)[_0x6129('0x15')](handleEntityNotFound(_0x824743,null))['then'](function(_0x395340){if(_0x395340){if(!_[_0x6129('0x7d')](_0x395340[_0x6129('0x7c')])){if(fs[_0x6129('0x73')](path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0x77'),_0x395340[_0x6129('0x7c')]))){_0x44d626=path[_0x6129('0x6d')](config['root'],_0x6129('0x77'),_0x395340[_0x6129('0x7c')]);}}return _0x824743[_0x6129('0x75')](_0x44d626);}})[_0x6129('0x4b')](handleError(_0x824743,null));};exports[_0x6129('0x7e')]=function(_0x1cab4f,_0x50af62){var _0xfbb4e=require(_0x6129('0x7f'));var _0x2576bb=new _0xfbb4e();var _0x4f21f9=_0x2576bb['setUA'](_0x1cab4f[_0x6129('0x80')][_0x6129('0x81')])['getResult']();var _0x35f38b={'body':_0x1cab4f['body'],'channel':_0x6129('0x82')};var _0x56f55e=[];var _0x16049c=[];var _0x7c04d0={};var _0x3cb30f=![];return db[_0x6129('0x83')][_0x6129('0x59')]()[_0x6129('0x15')](function(_0x39fcb9){if(!_0x39fcb9){throw new db['Sequelize'][(_0x6129('0x84'))]('no\x20available\x20attributes');}_0x56f55e=_[_0x6129('0x85')](_[_0x6129('0x39')](_0x39fcb9),[_0x6129('0x86'),_0x6129('0x87')]);_0x16049c=_[_0x6129('0x85')](_[_0x6129('0x39')](_0x39fcb9),[_0x6129('0x86'),'updatedAt',_0x6129('0x88'),_0x6129('0x89')]);if(_0x1cab4f[_0x6129('0x51')]['id']){delete _0x1cab4f['body']['id'];}if(_[_0x6129('0x7d')](_0x1cab4f['body'][_0x6129('0x8a')])){throw new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0x8c'));}if(_[_0x6129('0x7d')](_0x1cab4f[_0x6129('0x51')][_0x6129('0x51')])||_0x1cab4f['body'][_0x6129('0x51')]===''){throw new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0x8d'));}if(_[_0x6129('0x7d')](_0x1cab4f[_0x6129('0x51')][_0x6129('0x8e')])){throw new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0x8f')+_0x16049c);}if(!_[_0x6129('0x90')](_0x16049c,_0x1cab4f[_0x6129('0x51')][_0x6129('0x8e')])){throw new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0x91')+_0x16049c);}_0x7c04d0[_0x1cab4f[_0x6129('0x51')][_0x6129('0x8e')]]=_0x1cab4f[_0x6129('0x51')][_0x6129('0x8a')];})[_0x6129('0x15')](function(){return db['ChatWebsite'][_0x6129('0x4f')]({'where':{'id':_0x1cab4f['params']['id']},'include':[{'model':db[_0x6129('0x92')],'as':'List','include':[{'model':db[_0x6129('0x83')],'as':'Contacts','where':_0x7c04d0,'limit':0x1,'order':[[_0x6129('0x87'),'DESC']]}]},{'model':db[_0x6129('0x93')],'as':_0x6129('0x94')}]});})[_0x6129('0x15')](handleEntityNotFound(_0x50af62,null))[_0x6129('0x15')](function(_0x4cf6fe){if(_0x4cf6fe&&_0x4cf6fe[_0x6129('0x95')]){_0x35f38b[_0x6129('0x96')]=_0x4cf6fe;_0x35f38b[_0x6129('0x97')]=_0x4cf6fe['Applications'];_0x35f38b[_0x6129('0x98')]=_0x4cf6fe[_0x6129('0x95')];_0x35f38b[_0x6129('0x97')]=_[_0x6129('0x99')](_0x35f38b['applications'],[_0x6129('0x9a')],[_0x6129('0x9b')]);if(_0x35f38b[_0x6129('0x96')][_0x6129('0x94')]){delete _0x35f38b[_0x6129('0x96')][_0x6129('0x94')];}if(_0x35f38b[_0x6129('0x96')]['List']&&_0x35f38b[_0x6129('0x96')][_0x6129('0x95')][_0x6129('0x9c')][_0x6129('0x64')]){return _0x35f38b['account']['List'][_0x6129('0x9c')][0x0];}var _0x236846=_[_0x6129('0xc')](_0x1cab4f[_0x6129('0x51')],{'firstName':_0x1cab4f[_0x6129('0x51')][_0x6129('0x8a')],'ListId':_0x4cf6fe[_0x6129('0x89')]});_0x236846[_0x1cab4f[_0x6129('0x51')][_0x6129('0x8e')]]=_0x1cab4f['body'][_0x6129('0x8a')];return db[_0x6129('0x83')][_0x6129('0x50')](_0x236846,{'fields':_0x56f55e,'raw':!![]});}})[_0x6129('0x15')](handleEntityNotFound(_0x50af62,null))['then'](function(_0x13cb0e){_0x35f38b[_0x6129('0x9d')]=_0x13cb0e;var _0x5ba424=_0x1cab4f[_0x6129('0x51')][_0x6129('0x9e')];if(_0x1cab4f['headers']['cf-connecting-ip']){_0x5ba424=_0x1cab4f[_0x6129('0x80')][_0x6129('0x9f')];}else if(_0x1cab4f[_0x6129('0x80')]['x-forwarded-for']){_0x5ba424=_[_0x6129('0xa0')](_0x1cab4f[_0x6129('0x80')][_0x6129('0xa1')][_0x6129('0xa2')](','));}if(_0x13cb0e){var _0x4a3fbd={'ContactId':_0x13cb0e['id'],'ChatWebsiteId':_0x1cab4f[_0x6129('0x4d')]['id'],'from':(_0x13cb0e[_0x6129('0xa3')]||'')+'\x20'+(_0x13cb0e['lastName']||''),'customerIp':_0x5ba424,'customerPort':_0x1cab4f[_0x6129('0x80')][_0x6129('0xa4')]?_0x1cab4f[_0x6129('0x80')][_0x6129('0xa4')]:null,'referer':_0x1cab4f[_0x6129('0x51')][_0x6129('0xa5')],'browserName':_0x4f21f9['browser'][_0x6129('0x2e')]&&_0x4f21f9['browser'][_0x6129('0xa6')]?util[_0x6129('0xa7')](_0x6129('0xa8'),_0x4f21f9[_0x6129('0xa9')]['name'],_0x4f21f9['browser'][_0x6129('0xa6')]):_0x6129('0xaa'),'browserVersion':_0x4f21f9['browser'][_0x6129('0xa6')]||_0x6129('0xaa'),'osName':util[_0x6129('0xa7')]('%s\x20%s',_0x4f21f9['os'][_0x6129('0x2e')],_0x4f21f9['os'][_0x6129('0xa6')]),'osVersion':_0x4f21f9['os'][_0x6129('0xa6')],'deviceModel':_0x4f21f9['device'][_0x6129('0x37')]&&_0x4f21f9['device']['vendor']?util[_0x6129('0xa7')]('%s\x20%s\x20%s',_0x4f21f9[_0x6129('0xab')]['model'],_0x4f21f9[_0x6129('0xab')][_0x6129('0xac')],_0x4f21f9[_0x6129('0xab')][_0x6129('0x35')]):null,'deviceVendor':_0x4f21f9['device']['vendor'],'deviceType':_0x4f21f9[_0x6129('0xab')][_0x6129('0x35')],'formData':JSON[_0x6129('0x1a')](_0x1cab4f[_0x6129('0x51')])};var _0x400902={'ChatWebsiteId':_0x1cab4f[_0x6129('0x4d')]['id'],'closed':![]};if(_0x1cab4f['body'][_0x6129('0xad')]){_0x400902['threadId']=_0x1cab4f[_0x6129('0x51')][_0x6129('0xad')];return db[_0x6129('0xae')][_0x6129('0x4f')]({'where':_0x400902})[_0x6129('0x15')](function(_0xdc7f62){if(_0xdc7f62){return[_0xdc7f62,![]];}_0x4a3fbd[_0x6129('0xad')]=_0x1cab4f['body'][_0x6129('0xad')];_0x4a3fbd[_0x6129('0xaf')]=_0x1cab4f[_0x6129('0x51')][_0x6129('0xaf')];return db[_0x6129('0xae')][_0x6129('0x50')](_0x4a3fbd)[_0x6129('0x15')](function(_0x109f23){return[_0x109f23,!![]];});});}_0x400902[_0x6129('0xb0')]=_0x13cb0e['id'];if(_0x1cab4f['body'][_0x6129('0xb1')]&&_0x1cab4f[_0x6129('0x51')]['interaction']['id']){_0x400902['id']=_0x1cab4f['body'][_0x6129('0xb1')]['id'];return db[_0x6129('0xae')]['find']({'where':_0x400902})[_0x6129('0x15')](function(_0x3a6540){if(_0x3a6540){return[_0x3a6540,![]];}return db[_0x6129('0xae')]['create'](_0x4a3fbd)['then'](function(_0x47190f){return[_0x47190f,!![]];});});}return db[_0x6129('0xae')][_0x6129('0x50')](_0x4a3fbd)[_0x6129('0x15')](function(_0x29bc5d){return[_0x29bc5d,!![]];});}})[_0x6129('0xb2')](function(_0x28640a,_0x907d65){if(_0x28640a){_0x3cb30f=_0x907d65;if(!_0x907d65){var _0xa1874f={'from':(_0x35f38b['contact'][_0x6129('0xa3')]||'')+'\x20'+(_0x35f38b[_0x6129('0x9d')]['lastName']||'')};if(_0x1cab4f[_0x6129('0x51')][_0x6129('0xad')]&&_0x1cab4f[_0x6129('0x51')][_0x6129('0xb3')]&&_0x1cab4f[_0x6129('0x51')][_0x6129('0xad')]!=_0x1cab4f[_0x6129('0x51')]['messageId']){_0xa1874f['threadId']=_0x1cab4f['body'][_0x6129('0xb3')];}return _0x28640a['update'](_0xa1874f);}else{return _0x28640a;}}})['then'](function(_0x413fc4){_0x35f38b[_0x6129('0xb1')]=_0x413fc4['get']({'plain':!![]});_0x35f38b['interaction'][_0x6129('0xb4')]=_0x3cb30f;if(_0x35f38b[_0x6129('0xb1')][_0x6129('0xb4')]){if(_0x35f38b['account'][_0x6129('0xb5')]){_0x35f38b[_0x6129('0x97')][_0x6129('0xb6')]({'id':0x0,'priority':_0x35f38b[_0x6129('0x97')]['length']+0x1,'app':_0x6129('0xb7'),'appdata':_0x6129('0xb8'),'interval':_0x6129('0xb9')});}}return db['ChatMessage'][_0x6129('0x50')]({'body':_0x1cab4f['body'][_0x6129('0x51')],'ChatWebsiteId':_0x1cab4f[_0x6129('0x4d')]['id'],'ChatInteractionId':_0x413fc4['id'],'direction':'in','ContactId':_0x35f38b[_0x6129('0x9d')]['id'],'AttachmentId':_0x1cab4f['body'][_0x6129('0xba')]});})[_0x6129('0x15')](function(_0x43708b){_0x35f38b[_0x6129('0x1e')]=_0x43708b;if(_0x35f38b['interaction'][_0x6129('0xbb')]){return db[_0x6129('0xbc')][_0x6129('0x4f')]({'attributes':['id','name'],'where':{'id':_0x35f38b[_0x6129('0xb1')][_0x6129('0xbb')]}})[_0x6129('0x15')](function(_0x5bd210){if(_0x5bd210){_0x35f38b['applications'][_0x6129('0xbd')]({'id':0x0,'priority':0x0,'app':_0x6129('0xbe'),'appdata':_0x5bd210[_0x6129('0x2e')]+','+(_0x35f38b[_0x6129('0x96')][_0x6129('0xbf')]||0xa),'interval':_0x6129('0xb9')});_0x35f38b[_0x6129('0xc0')]=!![];}return respondWithRpcPromise(_0x6129('0xc1'),_0x6129('0xc2'),_0x35f38b);});}return respondWithRpcPromise(_0x6129('0xc1'),_0x6129('0xc2'),_0x35f38b);})[_0x6129('0x15')](function(_0x57cf83){respondWithRpcPromise(_0x6129('0xc3'),_0x6129('0xc3'),{'event':_0x6129('0x7e'),'message':_0x57cf83},client9002);return _0x57cf83;})[_0x6129('0x15')](respondWithResult(_0x50af62,null))[_0x6129('0x4b')](handleError(_0x50af62,null));};exports[_0x6129('0xc4')]=function(_0x91c0d9,_0x4a8d39){var _0x3779b2,_0x393790,_0x179a83;var _0x1c399c=[];var _0x2d5373={};var _0x34ede3=_0x91c0d9[_0x6129('0xc5')]||[];var _0x3d6720=[];var _0x150baa;return db[_0x6129('0x83')][_0x6129('0x59')]()['then'](function(_0x3d15b5){if(!_0x3d15b5){throw new db[(_0x6129('0x8b'))][(_0x6129('0x84'))]('no\x20available\x20attributes');}_0x1c399c=_[_0x6129('0x85')](_['keys'](_0x3d15b5),[_0x6129('0x86'),_0x6129('0x87'),_0x6129('0x88'),_0x6129('0x89')]);if(_0x91c0d9[_0x6129('0x51')]['id']){delete _0x91c0d9[_0x6129('0x51')]['id'];}if(_['isNil'](_0x91c0d9[_0x6129('0x51')][_0x6129('0x8a')])){throw _0x4a8d39[_0x6129('0x21')](0x1f4)[_0x6129('0xc6')](new db[(_0x6129('0x8b'))]['ValidationError'](_0x6129('0x8c')));}if(_[_0x6129('0x7d')](_0x91c0d9[_0x6129('0x51')][_0x6129('0x51')])||_0x91c0d9[_0x6129('0x51')][_0x6129('0x51')]===''){throw _0x4a8d39[_0x6129('0x21')](0x1f4)[_0x6129('0xc6')](new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0x8d')));}if(_['isNil'](_0x91c0d9['body'][_0x6129('0xc7')])){throw _0x4a8d39[_0x6129('0x21')](0x1f4)[_0x6129('0xc6')](new db[(_0x6129('0x8b'))]['ValidationError'](_0x6129('0xc8')+_0x1c399c));}if(!_[_0x6129('0x90')](_0x1c399c,_0x91c0d9[_0x6129('0x51')]['mapKeyOffline'])){throw _0x4a8d39['status'](0x1f4)['send'](new db[(_0x6129('0x8b'))][(_0x6129('0x84'))](_0x6129('0xc9')+_0x1c399c));}_0x2d5373[_0x91c0d9[_0x6129('0x51')]['mapKeyOffline']]=_0x91c0d9[_0x6129('0x51')][_0x6129('0x8a')];})[_0x6129('0x15')](function(){return db[_0x6129('0x33')]['find']({'where':{'id':_0x91c0d9[_0x6129('0x4d')]['id']},'include':[{'model':db[_0x6129('0x92')],'as':'List'},{'model':db[_0x6129('0xca')],'as':_0x6129('0xca')}]});})[_0x6129('0x15')](handleEntityNotFound(_0x4a8d39,null))['then'](function(_0x2ea475){if(_0x2ea475&&_0x2ea475[_0x6129('0x95')]){_0x393790=_0x2ea475;var _0x4f2fd9=_[_0x6129('0xc')](_0x91c0d9[_0x6129('0x51')],{'firstName':_0x91c0d9[_0x6129('0x51')]['from'],'phone':_0x91c0d9['body'][_0x6129('0x8a')],'ListId':_0x2ea475[_0x6129('0x89')]});_0x4f2fd9[_0x91c0d9['body']['mapKeyOffline']]=_0x91c0d9[_0x6129('0x51')][_0x6129('0x8a')];return db[_0x6129('0x83')][_0x6129('0xcb')]({'where':_0x2d5373,'defaults':_0x4f2fd9});}})[_0x6129('0xb2')](function(_0x257a53){if(_0x257a53){_0x179a83=_0x257a53;var _0x5672b3=fs[_0x6129('0xcc')](path['join'](config['root'],_0x6129('0xcd')),_0x6129('0xce'));var _0x19f9b3=ejs[_0x6129('0xcf')](_0x5672b3,{'body':_[_0x6129('0xd0')](_0x91c0d9[_0x6129('0x51')][_0x6129('0x51')]),'bodyTitle':_0x393790[_0x6129('0xd1')]});return db[_0x6129('0xd2')][_0x6129('0x50')]({'body':_0x19f9b3,'plainBody':htmlToText[_0x6129('0xd3')](_0x19f9b3),'ContactId':_0x257a53['id'],'ChatWebsiteId':_0x393790['id']});}})[_0x6129('0x15')](function(_0x3152ca){_0x150baa=_0x3152ca;if(_0x34ede3[_0x6129('0x64')]){var _0x303d65=_0x34ede3[_0x6129('0x32')](function(_0x2e5cfb){return{'name':_0x2e5cfb['originalname'],'basename':_0x2e5cfb[_0x6129('0x6a')],'type':_0x2e5cfb[_0x6129('0xd4')],'ChatOfflineMessageId':_0x3152ca['id']};});_0x3d6720=_0x303d65[_0x6129('0x32')](_0x5aee59=>{var _0x2d40cd={'filename':_0x5aee59[_0x6129('0x2e')],'path':path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0xd5'),_0x6129('0xc5'),_0x6129('0xd6'),_0x6129('0xd7'),_0x5aee59[_0x6129('0xd8')])};return _0x2d40cd;});if(!_0x393790[_0x6129('0xd9')]){return db[_0x6129('0xda')][_0x6129('0xdb')](function(_0x584db8){return db[_0x6129('0xdc')][_0x6129('0xdd')](_0x303d65,{'transaction':_0x584db8});});}}})['then'](function(){if(_0x150baa){_0x3779b2=_0x150baa;return db[_0x6129('0xca')][_0x6129('0x5e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6129('0xde'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6129('0xdf'),'raw':!![]}]}]});}})[_0x6129('0x15')](function(_0x1c0e0){if(_0x1c0e0&&_0x1c0e0['Smtp']&&_0x393790['forwardOffline']&&_0x393790['forwardOfflineAddress']){var _0x2e3d6b=_0x1c0e0['getSmtpOptions']();return respondWithRpcPromise(_0x6129('0xe0'),_0x6129('0xe1'),{'account':_0x2e3d6b,'message':{'from':util[_0x6129('0xa7')](_0x6129('0xe2'),_0x1c0e0[_0x6129('0x2e')],_0x1c0e0[_0x6129('0xe3')]||_0x1c0e0[_0x6129('0xde')]['user']),'to':_0x393790[_0x6129('0xe4')],'subject':_0x393790['offlineMessageSubject'],'html':_0x3779b2[_0x6129('0x51')],'attachments':_0x3d6720}},client9003)[_0x6129('0x15')](function(){return _0x3779b2;})[_0x6129('0x4b')](function(_0x5eed2d){logger[_0x6129('0x1b')](_0x5eed2d);});}})[_0x6129('0x15')](function(){if(_0x393790&&_0x393790['openNewInteraction']&&_0x393790[_0x6129('0xe5')]){var _0x534a75=[];if(_0x34ede3[_0x6129('0x64')]){_0x534a75=_0x34ede3[_0x6129('0x32')](function(_0x1be77c){return{'name':_0x1be77c[_0x6129('0xe6')],'basename':_0x1be77c[_0x6129('0x6a')],'type':_0x1be77c[_0x6129('0xd4')],'ChatOfflineMessageId':_0x150baa['id']};});}var _0x3ca73a;if(!_[_0x6129('0x7d')](_0x393790['subjectOffline'])){var _0xa21c87=_[_0x6129('0x32')](_0x91c0d9[_0x6129('0x51')],function(_0x282084){return _0x282084;});var _0x26927c=_[_0x6129('0xe7')](_0xa21c87)[0x0];var _0x290a46=_[_0x6129('0xe8')](_0x26927c,function(_0x349fd2){return _0x349fd2;});_0x3ca73a=_0x290a46[0x1][_0x393790['subjectOffline']];}var _0x61301f={'from':_0x179a83['email'],'firstName':_0x179a83['firstName'],'lastName':_0x179a83[_0x6129('0xe9')],'mapKey':_0x6129('0xe3'),'message':{'from':_0x179a83[_0x6129('0xe3')],'to':_0x393790['MailAccount'][_0x6129('0xe3')],'cc':'','subject':_[_0x6129('0x7d')](_0x3ca73a)?_0x393790['offlineMessageSubject']:_0x3ca73a,'messageId':'','sentAt':new Date(),'attach':_0x534a75[_0x6129('0x64')],'attachments':_0x534a75,'originChannel':'Chat','ChatWebsiteId':_0x393790['id'],'ChatOfflineMessageId':_0x3779b2['id'],'originTo':_0x393790[_0x6129('0xca')][_0x6129('0xe3')]},'body':_0x3779b2[_0x6129('0x51')]};var _0x2d0616={'account':{'id':_0x393790[_0x6129('0xe5')]},'body':_0x61301f,'log':_0x6129('0xea')};return respondWithRpcPromise(_0x6129('0xea'),_0x6129('0xeb'),_0x2d0616,client9001)['then'](function(){return _0x3779b2;})[_0x6129('0x4b')](function(_0x78d033){logger[_0x6129('0x1b')](_0x78d033);});}return;})[_0x6129('0x15')](function(){if(_0x3779b2){return _0x3779b2;}})['then'](respondWithResult(_0x4a8d39,null))[_0x6129('0x4b')](function(_0xb9d475){logger['error'](_0x6129('0x4b'),_0xb9d475);for(var _0x2d89a5 of _0x34ede3){var _0x38d30f=path[_0x6129('0x6d')](config[_0x6129('0x6e')],_0x6129('0xd5'),'files','attachments',_0x6129('0xd7'),_0x2d89a5['filename']);fs_extra['remove'](_0x38d30f)['catch'](function(_0x4dc059){logger['error'](_0x6129('0xec'),_0x38d30f,_0x4dc059);});}});};exports[_0x6129('0xed')]=function(_0x303dfc,_0xda457a){return db[_0x6129('0xae')]['find']({'where':{'id':_0x303dfc[_0x6129('0x4d')]['id']}})['then'](handleEntityNotFound(_0xda457a,null))[_0x6129('0x15')](function(_0x54f5ca){if(_0x54f5ca){return _0x54f5ca[_0x6129('0xed')](_0x303dfc[_0x6129('0x51')][_0x6129('0x66')],_[_0x6129('0xee')](_0x303dfc['body'],[_0x6129('0x66'),'id'])||{});}})[_0x6129('0x15')](respondWithResult(_0xda457a,null))[_0x6129('0x4b')](handleError(_0xda457a,null));};exports[_0x6129('0xef')]=function(_0x5a4976,_0x2a25a4){var _0x21bc48={'raw':![],'where':{}};var _0x36543f={};var _0x18c60d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6129('0x5e')]({'where':{'id':_0x5a4976[_0x6129('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a25a4,null))[_0x6129('0x15')](function(_0xbc9da9){if(_0xbc9da9){_0x36543f['model']=_[_0x6129('0x39')](db[_0x6129('0xae')][_0x6129('0x4e')]);_0x36543f[_0x6129('0x38')]=_['keys'](_0x5a4976['query']);_0x36543f['filters']=_[_0x6129('0x3b')](_0x36543f['model'],_0x36543f[_0x6129('0x38')]);_0x21bc48[_0x6129('0x3d')]=_[_0x6129('0x3b')](_0x36543f[_0x6129('0x37')],qs[_0x6129('0x3c')](_0x5a4976[_0x6129('0x38')]['fields']));_0x21bc48['attributes']=_0x21bc48[_0x6129('0x3d')][_0x6129('0x64')]?_0x21bc48['attributes']:_0x36543f['model'];if(!_0x5a4976['query']['hasOwnProperty'](_0x6129('0x3f'))){_0x21bc48[_0x6129('0x27')]=qs[_0x6129('0x27')](_0x5a4976['query'][_0x6129('0x27')]);_0x21bc48[_0x6129('0x26')]=qs['offset'](_0x5a4976[_0x6129('0x38')]['offset']);}_0x21bc48[_0x6129('0x5f')]=qs[_0x6129('0x40')](_0x5a4976[_0x6129('0x38')][_0x6129('0x40')]);_0x21bc48[_0x6129('0x41')]=qs[_0x6129('0x3a')](_[_0x6129('0x42')](_0x5a4976[_0x6129('0x38')],_0x36543f[_0x6129('0x3a')]));_0x21bc48['where'][_0x6129('0x5b')]=_0xbc9da9['id'];if(_0x5a4976['query'][_0x6129('0x43')]){_0x21bc48[_0x6129('0x41')]=_['merge'](_0x21bc48['where'],{'$or':_[_0x6129('0x32')](_0x21bc48[_0x6129('0x3d')],function(_0x519d6f){var _0x58dc4c={};_0x58dc4c[_0x519d6f]={'$like':'%'+_0x5a4976[_0x6129('0x38')]['filter']+'%'};return _0x58dc4c;})});}_0x21bc48=_[_0x6129('0x44')]({},_0x21bc48,_0x5a4976[_0x6129('0x46')]);return db[_0x6129('0xae')]['count']({'where':_0x21bc48[_0x6129('0x41')]})['then'](function(_0x32c950){_0x18c60d['count']=_0x32c950;if(_0x5a4976['query'][_0x6129('0x47')]){_0x21bc48[_0x6129('0x48')]=[{'model':db[_0x6129('0x83')],'as':_0x6129('0xf0'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6129('0x2e'),_0x6129('0xf1'),_0x6129('0xf2')],'required':![]},{'model':db[_0x6129('0xf3')],'as':_0x6129('0xf4'),'attributes':['id',_0x6129('0x2e'),'color'],'where':_0x5a4976[_0x6129('0x38')]['tag']?{'id':_0x5a4976[_0x6129('0x38')][_0x6129('0xf5')]}:undefined,'required':_0x5a4976[_0x6129('0x38')][_0x6129('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0x6129('0x49')](_0x21bc48);})[_0x6129('0x15')](function(_0x36e208){_0x18c60d[_0x6129('0x4a')]=_0x36e208;return _0x18c60d;});}})[_0x6129('0x15')](respondWithFilteredResult(_0x2a25a4,_0x21bc48))[_0x6129('0x4b')](handleError(_0x2a25a4,null));};function iftimePromise(_0x140001,_0x1943c0){return respondWithRpcPromise(_0x6129('0xf6'),_0x6129('0xf7'),{'command':_0x1943c0[_0x6129('0xf8')]?util['format']('iftime\x20%s,%s',_0x140001[_0x6129('0xf9')],_0x1943c0[_0x6129('0xf8')]):util[_0x6129('0xa7')]('iftime\x20%s',_0x140001[_0x6129('0xf9')])},client9002)[_0x6129('0x15')](function(_0x469c0b){var _0xbe6c33=_0x469c0b&&_0x469c0b['indexOf'](_0x6129('0xfa'))>=0x0?!![]:![];logger[_0x6129('0x16')](_0x6129('0xfb'),_0x1943c0['id'],_0x140001['id'],_0x140001[_0x6129('0xf9')],_0xbe6c33?'ONLINE':_0x6129('0xfc'),_0x1943c0[_0x6129('0xf8')]?_0x1943c0[_0x6129('0xf8')]:_0x6129('0xfd'));return _0xbe6c33;})[_0x6129('0x4b')](function(_0x1c0366){logger[_0x6129('0x1b')](_0x6129('0xfb'),_0x1943c0['id'],_0x140001['id'],_0x140001[_0x6129('0xf9')],util[_0x6129('0xfe')](_0x1c0366,{'showHidden':![],'depth':null}),_0x1943c0[_0x6129('0xf8')]?_0x1943c0[_0x6129('0xf8')]:'No\x20timezone');return![];});}exports[_0x6129('0xf7')]=function(_0x48e5bb,_0x3bd902){var _0x5ec532=0x0;var _0x2393ca=0x0;var _0x169b44=![];var _0x288b8b;var _0x43106b;return db['ChatWebsite']['find']({'where':{'id':_0x48e5bb[_0x6129('0x4d')]['id']},'include':[{'model':db[_0x6129('0xff')],'as':'Interval','include':[{'model':db[_0x6129('0xff')],'as':'Intervals','attributes':['id',_0x6129('0xf9')],'raw':!![]}]}]})[_0x6129('0x15')](handleEntityNotFound(_0x3bd902,null))['then'](function(_0x225d34){if(_0x225d34){_0x288b8b=_0x225d34;return _0x225d34[_0x6129('0x100')]({'raw':!![]});}})[_0x6129('0x15')](function(_0x45094d){if(_0x288b8b){if(_0x45094d){_0x43106b=_0x45094d;}}return require(_0x6129('0x70'))[_0x6129('0x71')]();})[_0x6129('0x15')](function(_0x4687d3){if(_0x4687d3){_0x2393ca=_0x4687d3[_0x6129('0x101')];_0x169b44=_0x4687d3['custom'];}})['then'](function(){return db[_0x6129('0xae')][_0x6129('0x25')]({'where':{'closed':![]}});})[_0x6129('0x15')](function(_0x54fb39){_0x5ec532=_0x54fb39;if(_0x2393ca&&_0x54fb39>_0x2393ca){return db[_0x6129('0x102')][_0x6129('0x5e')]({'where':{'id':0x1}})[_0x6129('0x15')](function(_0x585f76){if(_0x585f76){_0x585f76[_0x6129('0x103')](_0x6129('0x104'));}});}})['then'](function(){if(_0x288b8b['Interval']&&_0x288b8b[_0x6129('0xff')]['Intervals']){var _0x531b0a=[];for(var _0x41c94a=0x0;_0x41c94a<_0x288b8b[_0x6129('0xff')][_0x6129('0x105')][_0x6129('0x64')];_0x41c94a++){var _0xce1f7a=_0x288b8b['Interval'][_0x6129('0x105')][_0x41c94a][_0x6129('0x2a')]({'plain':!![]});_0x531b0a[_0x6129('0xb6')](iftimePromise(_0xce1f7a,_0x288b8b));}return BPromise['all'](_0x531b0a)[_0x6129('0x15')](function(_0x53fa92){return _[_0x6129('0x106')](_0x53fa92);});}else{return!![];}})['then'](function(_0x7718fc){var _0x5128e1=fs[_0x6129('0xcc')](path['join'](config[_0x6129('0x6e')],_0x6129('0x107')),'utf8');var _0x424f3d=new url[(_0x6129('0x108'))](_0x288b8b['address'])[_0x6129('0x109')];var _0x4d8ec1=_0x6129('0x10a');var _0x4fceea=![];var _0x341afd={'chatVersion':_0x4d8ec1,'chatWebsiteAddressOrigin':_0x424f3d,'remote':_0x288b8b[_0x6129('0x10b')],'query':querystring['stringify'](_[_0x6129('0x44')](_0x288b8b['get']({'plain':!![]}),{'customerIp':_0x48e5bb[_0x6129('0x80')]['x-forwarded-for']||_0x48e5bb[_0x6129('0x80')][_0x6129('0x10c')]||_0x48e5bb[_0x6129('0x10d')][_0x6129('0x10e')]||_0x48e5bb['ip'],'referer':_0x48e5bb['headers'][_0x6129('0xa5')],'openedInteractions':_0x5ec532,'maxInteractions':_0x2393ca,'virtual':_0x169b44['virtual'],'online':_0x7718fc,'custom':_0x169b44}))['replace'](/'/g,'\x5c\x27')};_0x3bd902['send'](ejs['render'](Mustache[_0x6129('0xcf')](_0x5128e1,_0x341afd),{'proactiveActions':_0x43106b,'alignment':_0x288b8b[_0x6129('0x10f')],'verticalAlignment':_0x288b8b['verticalAlignment'],'div_color':_0x288b8b[_0x6129('0x110')],'labelText':_0x288b8b[_0x6129('0x111')],'text_color':_0x288b8b[_0x6129('0x112')],'text_button_color':_0x288b8b[_0x6129('0x113')],'button_color':_0x288b8b[_0x6129('0x114')],'background_color':_0x288b8b[_0x6129('0x115')],'hideWhenOffline':_0x288b8b[_0x6129('0x116')],'intervalId':_0x288b8b[_0x6129('0x117')],'isDevelopment':_0x4fceea,'chatVersion':_0x4d8ec1}));})[_0x6129('0x4b')](handleError(_0x3bd902,null));};exports[_0x6129('0x118')]=function(_0x22ad38,_0x243bde){var _0x2f3b7f=_0x22ad38[_0x6129('0x4d')]['id'];var _0x4a0374=_0x22ad38[_0x6129('0x51')];var _0x5d0c22=0xc8;var _0x476bd2=null;return db[_0x6129('0xda')][_0x6129('0xdb')]({'isolationLevel':db[_0x6129('0xda')][_0x6129('0x119')][_0x6129('0x11a')][_0x6129('0x11b')]},function(_0x4ad0c2){return db[_0x6129('0x33')][_0x6129('0x5e')]({'where':{'id':_0x2f3b7f},'transaction':_0x4ad0c2})[_0x6129('0x15')](function(_0x311a37){if(_0x311a37){return db[_0x6129('0x93')][_0x6129('0x29')]({'where':{'ChatWebsiteId':_0x2f3b7f},'transaction':_0x4ad0c2})[_0x6129('0x15')](function(){var _0x5e815d=_['map'](_0x4a0374,function(_0x5d9854){_0x5d9854[_0x6129('0x5b')]=_0x2f3b7f;return _0x5d9854;});return db[_0x6129('0x93')]['bulkCreate'](_0x5e815d,{'transaction':_0x4ad0c2});});}else{_0x5d0c22=0x194;_0x476bd2=[];}});})[_0x6129('0x15')](function(){if(_0x5d0c22!==0x194){return db[_0x6129('0x93')][_0x6129('0x11c')]({'where':{'ChatWebsiteId':_0x2f3b7f},'order':_0x6129('0x9a')})[_0x6129('0x15')](function(_0x276e9c){_0x476bd2=_0x276e9c;});}})[_0x6129('0x4b')](function(_0x1d91d3){_0x5d0c22=0x1f4;logger[_0x6129('0x1b')](_0x1d91d3[_0x6129('0x2d')]);if(_0x1d91d3[_0x6129('0x2e')]){delete _0x1d91d3[_0x6129('0x2e')];}_0x476bd2=_0x1d91d3;})[_0x6129('0x11d')](function(){if(_0x476bd2===null){_0x243bde['sendStatus'](_0x5d0c22);}else{if(_0x5d0c22===0x1f4){_0x243bde[_0x6129('0x21')](_0x5d0c22)[_0x6129('0xc6')](_0x476bd2);}else{_0x243bde['status'](_0x5d0c22)[_0x6129('0x23')](_0x476bd2);}}});};exports[_0x6129('0x11e')]=function(_0x4391b8,_0x586c54){var _0x186b12={};var _0x4e2032={};var _0x48de4e;var _0x53f0a3;return db[_0x6129('0x33')]['findOne']({'where':{'id':_0x4391b8[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x586c54,null))[_0x6129('0x15')](function(_0x46486b){if(_0x46486b){_0x48de4e=_0x46486b;_0x4e2032['model']=_[_0x6129('0x39')](db[_0x6129('0x93')]['rawAttributes']);_0x4e2032['query']=_['keys'](_0x4391b8[_0x6129('0x38')]);_0x4e2032[_0x6129('0x3a')]=_[_0x6129('0x3b')](_0x4e2032['model'],_0x4e2032[_0x6129('0x38')]);_0x186b12[_0x6129('0x3d')]=_[_0x6129('0x3b')](_0x4e2032['model'],qs[_0x6129('0x3c')](_0x4391b8[_0x6129('0x38')][_0x6129('0x3c')]));_0x186b12[_0x6129('0x3d')]=_0x186b12[_0x6129('0x3d')][_0x6129('0x64')]?_0x186b12['attributes']:_0x4e2032[_0x6129('0x37')];_0x186b12[_0x6129('0x5f')]=qs['sort'](_0x4391b8[_0x6129('0x38')][_0x6129('0x40')]);_0x186b12['where']=qs[_0x6129('0x3a')](_['pick'](_0x4391b8[_0x6129('0x38')],_0x4e2032[_0x6129('0x3a')]));if(_0x4391b8['query'][_0x6129('0x43')]){_0x186b12[_0x6129('0x41')]=_[_0x6129('0x44')](_0x186b12[_0x6129('0x41')],{'$or':_[_0x6129('0x32')](_0x186b12[_0x6129('0x3d')],function(_0x29bea1){var _0x56b42a={};_0x56b42a[_0x29bea1]={'$like':'%'+_0x4391b8[_0x6129('0x38')]['filter']+'%'};return _0x56b42a;})});}_0x186b12=_[_0x6129('0x44')]({},_0x186b12,_0x4391b8[_0x6129('0x46')]);return _0x48de4e[_0x6129('0x11e')](_0x186b12);}})[_0x6129('0x15')](function(_0x16fed2){if(_0x16fed2){_0x53f0a3=_0x16fed2['length'];if(!_0x4391b8['query'][_0x6129('0x3e')]('nolimit')){_0x186b12[_0x6129('0x27')]=qs[_0x6129('0x27')](_0x4391b8['query'][_0x6129('0x27')]);_0x186b12[_0x6129('0x26')]=qs['offset'](_0x4391b8[_0x6129('0x38')][_0x6129('0x26')]);}return _0x48de4e[_0x6129('0x11e')](_0x186b12);}})['then'](function(_0x2a6dc2){if(_0x2a6dc2){return _0x2a6dc2?{'count':_0x53f0a3,'rows':_0x2a6dc2}:null;}})['then'](respondWithResult(_0x586c54,null))['catch'](handleError(_0x586c54,null));};exports[_0x6129('0x11f')]=function(_0x3169b8,_0xb9a651){return db['chatProactiveAction'][_0x6129('0x4f')]({'where':{'id':_0x3169b8['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0xb9a651,null))['then'](function(_0x2f0cb4){if(_0x2f0cb4){return _0x2f0cb4[_0x6129('0x11f')](_0x3169b8[_0x6129('0x51')][_0x6129('0x66')],_['omit'](_0x3169b8[_0x6129('0x51')],[_0x6129('0x66'),'id'])||{});}})['then'](respondWithResult(_0xb9a651,null))[_0x6129('0x4b')](handleError(_0xb9a651,null));};exports[_0x6129('0x100')]=function(_0x25fffe,_0x2cff01){var _0x5d56be={};var _0x4f297c={};var _0x218d12;var _0x8a769;return db[_0x6129('0x33')][_0x6129('0x5e')]({'where':{'id':_0x25fffe[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x2cff01,null))[_0x6129('0x15')](function(_0x2703d7){if(_0x2703d7){_0x218d12=_0x2703d7;_0x4f297c['model']=_[_0x6129('0x39')](db[_0x6129('0x120')]['rawAttributes']);_0x4f297c[_0x6129('0x38')]=_[_0x6129('0x39')](_0x25fffe[_0x6129('0x38')]);_0x4f297c[_0x6129('0x3a')]=_['intersection'](_0x4f297c[_0x6129('0x37')],_0x4f297c[_0x6129('0x38')]);_0x5d56be[_0x6129('0x3d')]=_[_0x6129('0x3b')](_0x4f297c[_0x6129('0x37')],qs[_0x6129('0x3c')](_0x25fffe[_0x6129('0x38')][_0x6129('0x3c')]));_0x5d56be[_0x6129('0x3d')]=_0x5d56be[_0x6129('0x3d')][_0x6129('0x64')]?_0x5d56be[_0x6129('0x3d')]:_0x4f297c['model'];_0x5d56be[_0x6129('0x5f')]=qs[_0x6129('0x40')](_0x25fffe[_0x6129('0x38')][_0x6129('0x40')]);_0x5d56be[_0x6129('0x41')]=qs['filters'](_['pick'](_0x25fffe[_0x6129('0x38')],_0x4f297c[_0x6129('0x3a')]));if(_0x25fffe[_0x6129('0x38')]['filter']){_0x5d56be[_0x6129('0x41')]=_['merge'](_0x5d56be[_0x6129('0x41')],{'$or':_[_0x6129('0x32')](_0x5d56be[_0x6129('0x3d')],function(_0x3d8472){var _0x29c39b={};_0x29c39b[_0x3d8472]={'$like':'%'+_0x25fffe[_0x6129('0x38')]['filter']+'%'};return _0x29c39b;})});}_0x5d56be=_[_0x6129('0x44')]({},_0x5d56be,_0x25fffe[_0x6129('0x46')]);return _0x218d12[_0x6129('0x100')](_0x5d56be);}})['then'](function(_0x31323e){if(_0x31323e){_0x8a769=_0x31323e['length'];if(!_0x25fffe[_0x6129('0x38')][_0x6129('0x3e')]('nolimit')){_0x5d56be[_0x6129('0x27')]=qs[_0x6129('0x27')](_0x25fffe[_0x6129('0x38')][_0x6129('0x27')]);_0x5d56be['offset']=qs['offset'](_0x25fffe[_0x6129('0x38')][_0x6129('0x26')]);}return _0x218d12[_0x6129('0x100')](_0x5d56be);}})[_0x6129('0x15')](function(_0x2b3e76){if(_0x2b3e76){return _0x2b3e76?{'count':_0x8a769,'rows':_0x2b3e76}:null;}})[_0x6129('0x15')](respondWithResult(_0x2cff01,null))[_0x6129('0x4b')](handleError(_0x2cff01,null));};exports[_0x6129('0x121')]=function(_0x247101,_0x3ee25b){var _0x159508=_0x247101[_0x6129('0x38')][_0x6129('0x122')]==='false'?'offlineForm':_0x6129('0x123');return db[_0x6129('0x33')][_0x6129('0x4f')]({'attributes':['id',_0x159508],'where':{'id':_0x247101['params']['id']}})['then'](handleEntityNotFound(_0x3ee25b,null))[_0x6129('0x15')](function(_0x9e3a71){if(_0x9e3a71){var _0x356a41=_0x9e3a71[_0x159508];var _0x1662b4=_0x356a41&&_0x356a41[_0x6129('0x124')]?_0x356a41[_0x6129('0x124')]:[];_0x3ee25b[_0x6129('0xc6')]({'fromKey':_[_0x6129('0x7d')](_0x356a41[_0x6129('0x125')])?undefined:_0x356a41[_0x6129('0x125')],'count':_0x1662b4[_0x6129('0x64')],'rows':_0x1662b4});}})[_0x6129('0x4b')](handleError(_0x3ee25b,null));};exports[_0x6129('0x126')]=function(_0x357dbb,_0x2fc407){var _0x3a9b74={'raw':![],'where':{}};var _0xa61b7d={};var _0x4182a1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6129('0x5e')]({'where':{'id':_0x357dbb['params']['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x2fc407,null))[_0x6129('0x15')](function(_0x40d55f){if(_0x40d55f){_0xa61b7d[_0x6129('0x37')]=_[_0x6129('0x39')](db[_0x6129('0xd2')][_0x6129('0x4e')]);_0xa61b7d[_0x6129('0x38')]=_[_0x6129('0x39')](_0x357dbb['query']);_0xa61b7d['filters']=_[_0x6129('0x3b')](_0xa61b7d[_0x6129('0x37')],_0xa61b7d[_0x6129('0x38')]);_0x3a9b74[_0x6129('0x3d')]=_['intersection'](_0xa61b7d['model'],qs[_0x6129('0x3c')](_0x357dbb[_0x6129('0x38')]['fields']));_0x3a9b74[_0x6129('0x3d')]=_0x3a9b74['attributes'][_0x6129('0x64')]?_0x3a9b74['attributes']:_0xa61b7d['model'];if(!_0x357dbb[_0x6129('0x38')]['hasOwnProperty']('nolimit')){_0x3a9b74['limit']=qs[_0x6129('0x27')](_0x357dbb[_0x6129('0x38')][_0x6129('0x27')]);_0x3a9b74[_0x6129('0x26')]=qs['offset'](_0x357dbb[_0x6129('0x38')][_0x6129('0x26')]);}_0x3a9b74['order']=qs[_0x6129('0x40')](_0x357dbb[_0x6129('0x38')][_0x6129('0x40')]);_0x3a9b74[_0x6129('0x41')]=qs[_0x6129('0x3a')](_['pick'](_0x357dbb[_0x6129('0x38')],_0xa61b7d['filters']));_0x3a9b74[_0x6129('0x41')][_0x6129('0x5b')]=_0x40d55f['id'];if(_0x357dbb[_0x6129('0x38')][_0x6129('0x43')]){_0x3a9b74['where']=_[_0x6129('0x44')](_0x3a9b74[_0x6129('0x41')],{'$or':_[_0x6129('0x32')](_0x3a9b74['attributes'],function(_0x5624db){var _0x455ffa={};_0x455ffa[_0x5624db]={'$like':'%'+_0x357dbb[_0x6129('0x38')][_0x6129('0x43')]+'%'};return _0x455ffa;})});}_0x3a9b74=_[_0x6129('0x44')]({},_0x3a9b74,_0x357dbb[_0x6129('0x46')]);return db[_0x6129('0xd2')]['count']({'where':_0x3a9b74['where']})[_0x6129('0x15')](function(_0x40e4f2){_0x4182a1[_0x6129('0x25')]=_0x40e4f2;if(_0x357dbb[_0x6129('0x38')]['includeAll']){_0x3a9b74[_0x6129('0x48')]=[{'all':!![]}];}else{_0x3a9b74['include']=[{'model':db[_0x6129('0x83')],'as':'Contact','required':![]},{'model':db[_0x6129('0xdc')],'as':_0x6129('0x127'),'required':![]}];}return db[_0x6129('0xd2')][_0x6129('0x49')](_0x3a9b74);})[_0x6129('0x15')](function(_0xa7180f){_0x4182a1[_0x6129('0x4a')]=_0xa7180f;return _0x4182a1;});}})[_0x6129('0x15')](respondWithFilteredResult(_0x2fc407,_0x3a9b74))['catch'](handleError(_0x2fc407,null));};exports[_0x6129('0x128')]=function(_0x5acb55,_0x592614){return db[_0x6129('0x33')][_0x6129('0x4f')]({'where':{'id':_0x5acb55[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x592614,null))[_0x6129('0x15')](function(_0x27925b){if(_0x27925b){return _0x27925b[_0x6129('0x128')](_0x5acb55[_0x6129('0x51')][_0x6129('0x66')],_[_0x6129('0xee')](_0x5acb55[_0x6129('0x51')],[_0x6129('0x66'),'id'])||{})[_0x6129('0xb2')](function(_0x258405){for(var _0x5e5d34=0x0;_0x5e5d34<_0x5acb55[_0x6129('0x51')][_0x6129('0x66')][_0x6129('0x64')];_0x5e5d34+=0x1){socket[_0x6129('0x129')](_0x6129('0x12a'),{'UserId':Number(_0x5acb55[_0x6129('0x51')][_0x6129('0x66')][_0x5e5d34]),'ChatWebsiteId':Number(_0x5acb55[_0x6129('0x4d')]['id'])});}return _0x258405;});}})['then'](respondWithResult(_0x592614,null))['catch'](handleError(_0x592614,null));};exports[_0x6129('0x12b')]=function(_0x2f3298,_0x20361f){return db['ChatWebsite'][_0x6129('0x4f')]({'where':{'id':_0x2f3298[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x20361f,null))[_0x6129('0x15')](function(_0xf7c360){if(_0xf7c360){return _0xf7c360[_0x6129('0x12b')](_0x2f3298[_0x6129('0x38')]['ids'])[_0x6129('0x15')](function(){if(_['isArray'](_0x2f3298[_0x6129('0x38')][_0x6129('0x66')])){for(var _0x2b7512=0x0;_0x2b7512<_0x2f3298[_0x6129('0x38')][_0x6129('0x66')][_0x6129('0x64')];_0x2b7512+=0x1){socket['emit'](_0x6129('0x12c'),{'UserId':Number(_0x2f3298['query'][_0x6129('0x66')][_0x2b7512]),'ChatWebsiteId':Number(_0x2f3298[_0x6129('0x4d')]['id'])});}}else{socket[_0x6129('0x129')](_0x6129('0x12c'),{'UserId':Number(_0x2f3298[_0x6129('0x38')][_0x6129('0x66')]),'ChatWebsiteId':Number(_0x2f3298[_0x6129('0x4d')]['id'])});}});}})[_0x6129('0x15')](respondWithStatusCode(_0x20361f,null))[_0x6129('0x4b')](handleError(_0x20361f,null));};exports[_0x6129('0x12d')]=function(_0x12ebe9,_0x4e49c9){var _0x1433d5={};var _0xcedb26={};var _0x37484e;var _0x5c4d73;return db['ChatWebsite']['findOne']({'where':{'id':_0x12ebe9[_0x6129('0x4d')]['id']}})[_0x6129('0x15')](handleEntityNotFound(_0x4e49c9,null))[_0x6129('0x15')](function(_0x117fa2){if(_0x117fa2){_0x37484e=_0x117fa2;_0xcedb26['model']=_['keys'](db['User'][_0x6129('0x4e')]);_0xcedb26[_0x6129('0x38')]=_[_0x6129('0x39')](_0x12ebe9[_0x6129('0x38')]);_0xcedb26['filters']=_['intersection'](_0xcedb26[_0x6129('0x37')],_0xcedb26['query']);_0x1433d5[_0x6129('0x3d')]=_['intersection'](_0xcedb26[_0x6129('0x37')],qs['fields'](_0x12ebe9[_0x6129('0x38')][_0x6129('0x3c')]));_0x1433d5[_0x6129('0x3d')]=_0x1433d5['attributes'][_0x6129('0x64')]?_0x1433d5[_0x6129('0x3d')]:_0xcedb26[_0x6129('0x37')];_0x1433d5['order']=qs[_0x6129('0x40')](_0x12ebe9[_0x6129('0x38')][_0x6129('0x40')]);_0x1433d5['where']=qs[_0x6129('0x3a')](_['pick'](_0x12ebe9[_0x6129('0x38')],_0xcedb26['filters']));if(_0x12ebe9[_0x6129('0x38')]['filter']){_0x1433d5[_0x6129('0x41')]=_['merge'](_0x1433d5['where'],{'$or':_[_0x6129('0x32')](_0x1433d5[_0x6129('0x3d')],function(_0x2345ee){var _0x271f78={};_0x271f78[_0x2345ee]={'$like':'%'+_0x12ebe9['query'][_0x6129('0x43')]+'%'};return _0x271f78;})});}_0x1433d5=_[_0x6129('0x44')]({},_0x1433d5,_0x12ebe9[_0x6129('0x46')]);return _0x37484e[_0x6129('0x12d')](_0x1433d5);}})[_0x6129('0x15')](function(_0x2077db){if(_0x2077db){_0x5c4d73=_0x2077db[_0x6129('0x64')];if(!_0x12ebe9[_0x6129('0x38')][_0x6129('0x3e')](_0x6129('0x3f'))){_0x1433d5[_0x6129('0x27')]=qs[_0x6129('0x27')](_0x12ebe9[_0x6129('0x38')][_0x6129('0x27')]);_0x1433d5[_0x6129('0x26')]=qs[_0x6129('0x26')](_0x12ebe9[_0x6129('0x38')]['offset']);}return _0x37484e[_0x6129('0x12d')](_0x1433d5);}})[_0x6129('0x15')](function(_0x13b962){if(_0x13b962){return _0x13b962?{'count':_0x5c4d73,'rows':_0x13b962}:null;}})[_0x6129('0x15')](respondWithResult(_0x4e49c9,null))[_0x6129('0x4b')](handleError(_0x4e49c9,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d7e310c..7d31813 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 _0x0048=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','save','update'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x0048,0x129));var _0x8004=function(_0x78d11b,_0x1c2611){_0x78d11b=_0x78d11b-0x0;var _0x5f2e27=_0x0048[_0x78d11b];return _0x5f2e27;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8004('0x0'))['db'][_0x8004('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8004('0x2'),'afterUpdate':_0x8004('0x3'),'afterDestroy':'remove'};function emitEvent(_0x336cf5){return function(_0x360fff,_0x14cc27,_0x2e2520){ChatWebsiteEvents['emit'](_0x336cf5+':'+_0x360fff['id'],_0x360fff);ChatWebsiteEvents['emit'](_0x336cf5,_0x360fff);_0x2e2520(null);};}for(var e in events){if(events[_0x8004('0x4')](e)){var event=events[e];ChatWebsite[_0x8004('0x5')](e,emitEvent(event));}}module[_0x8004('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x35aa=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatWebsite'];(function(_0x44883b,_0x10ad73){var _0x18a264=function(_0x42f053){while(--_0x42f053){_0x44883b['push'](_0x44883b['shift']());}};_0x18a264(++_0x10ad73);}(_0x35aa,0xbe));var _0xa35a=function(_0x56aabf,_0x461d46){_0x56aabf=_0x56aabf-0x0;var _0x8b2a1e=_0x35aa[_0x56aabf];return _0x8b2a1e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xa35a('0x0'))['db'][_0xa35a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa35a('0x2')](0x0);var events={'afterCreate':_0xa35a('0x3'),'afterUpdate':'update','afterDestroy':_0xa35a('0x4')};function emitEvent(_0x4303b4){return function(_0x24cc2,_0x11f841,_0x45278e){ChatWebsiteEvents[_0xa35a('0x5')](_0x4303b4+':'+_0x24cc2['id'],_0x24cc2);ChatWebsiteEvents[_0xa35a('0x5')](_0x4303b4,_0x24cc2);_0x45278e(null);};}for(var e in events){if(events[_0xa35a('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xa35a('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index be47218..d6e55dc 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 _0x31e7=['define','chat_websites','util','../../config/logger','api','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0xeb0309,_0x55340a){var _0x4fa64c=function(_0x128cce){while(--_0x128cce){_0xeb0309['push'](_0xeb0309['shift']());}};_0x4fa64c(++_0x55340a);}(_0x31e7,0x188));var _0x731e=function(_0x50e864,_0x4f9d5e){_0x50e864=_0x50e864-0x0;var _0x2b02c6=_0x31e7[_0x50e864];return _0x2b02c6;};'use strict';var _=require('lodash');var util=require(_0x731e('0x0'));var logger=require(_0x731e('0x1'))(_0x731e('0x2'));var moment=require('moment');var BPromise=require(_0x731e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x731e('0x4'));var rimraf=require('rimraf');var config=require(_0x731e('0x5'));var attributes=require(_0x731e('0x6'));module[_0x731e('0x7')]=function(_0x3b870e,_0x1f0c43){return _0x3b870e[_0x731e('0x8')]('ChatWebsite',attributes,{'tableName':_0x731e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16f1=['chat_websites','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0x16f1,0x97));var _0x116f=function(_0x249178,_0x2cabaf){_0x249178=_0x249178-0x0;var _0x502a79=_0x16f1[_0x249178];return _0x502a79;};'use strict';var _=require(_0x116f('0x0'));var util=require('util');var logger=require(_0x116f('0x1'))(_0x116f('0x2'));var moment=require(_0x116f('0x3'));var BPromise=require(_0x116f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x116f('0x5'));var config=require(_0x116f('0x6'));var attributes=require(_0x116f('0x7'));module['exports']=function(_0x1454c3,_0x32eb73){return _0x1454c3['define'](_0x116f('0x8'),attributes,{'tableName':_0x116f('0x9'),'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 75f071b..acbf40e 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 _0x16ad=['stringify','error','message','ChatWebsite,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x16ad,0x1e0));var _0xd16a=function(_0x53bcd4,_0x4dc740){_0x53bcd4=_0x53bcd4-0x0;var _0x455aff=_0x16ad[_0x53bcd4];return _0x455aff;};'use strict';var _=require(_0xd16a('0x0'));var util=require(_0xd16a('0x1'));var moment=require(_0xd16a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd16a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd16a('0x4'));var logger=require(_0xd16a('0x5'))(_0xd16a('0x6'));var config=require(_0xd16a('0x7'));var jayson=require(_0xd16a('0x8'));var client=jayson[_0xd16a('0x9')]['http']({'port':0x232a});config[_0xd16a('0xa')]=_[_0xd16a('0xb')](config['redis'],{'host':_0xd16a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd16a('0xa')]));require(_0xd16a('0xd'))[_0xd16a('0xe')](socket);function respondWithRpcPromise(_0x2abcce,_0xb89eac,_0x23844b){return new BPromise(function(_0x3a6452,_0x20f44f){return client[_0xd16a('0xf')](_0x2abcce,_0x23844b)[_0xd16a('0x10')](function(_0xbfce38){logger[_0xd16a('0x11')]('ChatWebsite,\x20%s,\x20%s',_0xb89eac,_0xd16a('0x12'));logger['debug'](_0xd16a('0x13'),_0xb89eac,'request\x20sent',JSON[_0xd16a('0x14')](_0xbfce38));if(_0xbfce38[_0xd16a('0x15')]){if(_0xbfce38[_0xd16a('0x15')]['code']===0x1f4){logger[_0xd16a('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xb89eac,_0xbfce38[_0xd16a('0x15')][_0xd16a('0x16')]);return _0x20f44f(_0xbfce38[_0xd16a('0x15')][_0xd16a('0x16')]);}logger[_0xd16a('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xb89eac,_0xbfce38[_0xd16a('0x15')][_0xd16a('0x16')]);return _0x3a6452(_0xbfce38['error'][_0xd16a('0x16')]);}else{logger[_0xd16a('0x11')](_0xd16a('0x17'),_0xb89eac,_0xd16a('0x12'));_0x3a6452(_0xbfce38['result'][_0xd16a('0x16')]);}})[_0xd16a('0x18')](function(_0x8dd46d){logger[_0xd16a('0x15')](_0xd16a('0x17'),_0xb89eac,_0x8dd46d);_0x20f44f(_0x8dd46d);});});} \ No newline at end of file +var _0xc146=['debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc146,0xcb));var _0x6c14=function(_0x3522ec,_0x2f1774){_0x3522ec=_0x3522ec-0x0;var _0x1a73e9=_0xc146[_0x3522ec];return _0x1a73e9;};'use strict';var _=require(_0x6c14('0x0'));var util=require('util');var moment=require(_0x6c14('0x1'));var BPromise=require(_0x6c14('0x2'));var rs=require(_0x6c14('0x3'));var fs=require('fs');var Redis=require(_0x6c14('0x4'));var db=require(_0x6c14('0x5'))['db'];var utils=require(_0x6c14('0x6'));var logger=require(_0x6c14('0x7'))(_0x6c14('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c14('0x9'));var client=jayson[_0x6c14('0xa')][_0x6c14('0xb')]({'port':0x232a});config['redis']=_[_0x6c14('0xc')](config[_0x6c14('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c14('0xe'))(new Redis(config[_0x6c14('0xd')]));require(_0x6c14('0xf'))[_0x6c14('0x10')](socket);function respondWithRpcPromise(_0x8dffa4,_0x327b1c,_0x4faaa6){return new BPromise(function(_0x277e7f,_0x230ff6){return client[_0x6c14('0x11')](_0x8dffa4,_0x4faaa6)['then'](function(_0x154286){logger[_0x6c14('0x12')](_0x6c14('0x13'),_0x327b1c,_0x6c14('0x14'));logger[_0x6c14('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x327b1c,'request\x20sent',JSON[_0x6c14('0x16')](_0x154286));if(_0x154286[_0x6c14('0x17')]){if(_0x154286[_0x6c14('0x17')][_0x6c14('0x18')]===0x1f4){logger[_0x6c14('0x17')](_0x6c14('0x13'),_0x327b1c,_0x154286[_0x6c14('0x17')][_0x6c14('0x19')]);return _0x230ff6(_0x154286[_0x6c14('0x17')][_0x6c14('0x19')]);}logger[_0x6c14('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x327b1c,_0x154286['error'][_0x6c14('0x19')]);return _0x277e7f(_0x154286['error'][_0x6c14('0x19')]);}else{logger[_0x6c14('0x12')](_0x6c14('0x13'),_0x327b1c,_0x6c14('0x14'));_0x277e7f(_0x154286[_0x6c14('0x1a')][_0x6c14('0x19')]);}})[_0x6c14('0x1b')](function(_0x1c345b){logger[_0x6c14('0x17')](_0x6c14('0x13'),_0x327b1c,_0x1c345b);_0x230ff6(_0x1c345b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 9c0c4d5..e9b9004 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 _0xfe1f=['emit','removeListener','register','./chatWebsite.events','remove'];(function(_0x3207a4,_0x1b9024){var _0x5c8dff=function(_0x4611b9){while(--_0x4611b9){_0x3207a4['push'](_0x3207a4['shift']());}};_0x5c8dff(++_0x1b9024);}(_0xfe1f,0xc6));var _0xffe1=function(_0x4794b5,_0x34efd1){_0x4794b5=_0x4794b5-0x0;var _0x1ff218=_0xfe1f[_0x4794b5];return _0x1ff218;};'use strict';var ChatWebsiteEvents=require(_0xffe1('0x0'));var events=['save',_0xffe1('0x1'),'update'];function createListener(_0x442e9c,_0xd6ef67){return function(_0x185d82){_0xd6ef67[_0xffe1('0x2')](_0x442e9c,_0x185d82);};}function removeListener(_0x1b1381,_0x5d1b07){return function(){ChatWebsiteEvents[_0xffe1('0x3')](_0x1b1381,_0x5d1b07);};}exports[_0xffe1('0x4')]=function(_0x456752){for(var _0x1ead28=0x0,_0x44bf26=events['length'];_0x1ead28<_0x44bf26;_0x1ead28++){var _0x4c1fef=events[_0x1ead28];var _0x536d0c=createListener('chatWebsite:'+_0x4c1fef,_0x456752);ChatWebsiteEvents['on'](_0x4c1fef,_0x536d0c);}}; \ No newline at end of file +var _0x81d2=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x1e47c7,_0x5cb9f9){var _0x31773d=function(_0x3a6093){while(--_0x3a6093){_0x1e47c7['push'](_0x1e47c7['shift']());}};_0x31773d(++_0x5cb9f9);}(_0x81d2,0x187));var _0x281d=function(_0x329652,_0x3c2172){_0x329652=_0x329652-0x0;var _0x1f1133=_0x81d2[_0x329652];return _0x1f1133;};'use strict';var ChatWebsiteEvents=require(_0x281d('0x0'));var events=[_0x281d('0x1'),_0x281d('0x2'),_0x281d('0x3')];function createListener(_0x5baec9,_0x24a739){return function(_0x212f0b){_0x24a739[_0x281d('0x4')](_0x5baec9,_0x212f0b);};}function removeListener(_0x1a2416,_0x1aeef4){return function(){ChatWebsiteEvents[_0x281d('0x5')](_0x1a2416,_0x1aeef4);};}exports[_0x281d('0x6')]=function(_0x19dfcf){for(var _0x9b2c3a=0x0,_0x4d8840=events[_0x281d('0x7')];_0x9b2c3a<_0x4d8840;_0x9b2c3a++){var _0x54a77a=events[_0x9b2c3a];var _0xb3479a=createListener(_0x281d('0x8')+_0x54a77a,_0x19dfcf);ChatWebsiteEvents['on'](_0x54a77a,_0xb3479a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ffdb743..c6ea1ad 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 _0x03bc=['file','addLogo','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','single'];(function(_0x527bfa,_0x127d42){var _0x80439a=function(_0xc066f8){while(--_0xc066f8){_0x527bfa['push'](_0x527bfa['shift']());}};_0x80439a(++_0x127d42);}(_0x03bc,0xee));var _0xc03b=function(_0x180ee9,_0x36736b){_0x180ee9=_0x180ee9-0x0;var _0x85f75d=_0x03bc[_0x180ee9];return _0x85f75d;};'use strict';var multer=require(_0xc03b('0x0'));var util=require(_0xc03b('0x1'));var path=require(_0xc03b('0x2'));var timeout=require(_0xc03b('0x3'));var express=require(_0xc03b('0x4'));var router=express[_0xc03b('0x5')]();var fs_extra=require(_0xc03b('0x6'));var auth=require(_0xc03b('0x7'));var interaction=require(_0xc03b('0x8'));var config=require(_0xc03b('0x9'));var controller=require(_0xc03b('0xa'));router[_0xc03b('0xb')]('/',auth[_0xc03b('0xc')](),controller['index']);router[_0xc03b('0xb')]('/describe',auth[_0xc03b('0xc')](),controller[_0xc03b('0xd')]);router[_0xc03b('0xb')](_0xc03b('0xe'),auth[_0xc03b('0xc')](),controller[_0xc03b('0xf')]);router[_0xc03b('0xb')]('/:id/dispositions',auth[_0xc03b('0xc')](),controller[_0xc03b('0x10')]);router[_0xc03b('0xb')]('/:id/canned_answers',auth[_0xc03b('0xc')](),controller[_0xc03b('0x11')]);router['get']('/:id/logo',controller['getLogo']);router[_0xc03b('0xb')](_0xc03b('0x12'),controller['getAvatar']);router[_0xc03b('0xb')](_0xc03b('0x13'),controller[_0xc03b('0x14')]);router[_0xc03b('0xb')](_0xc03b('0x15'),controller[_0xc03b('0x16')]);router['get'](_0xc03b('0x17'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x18')]);router[_0xc03b('0xb')](_0xc03b('0x19'),controller[_0xc03b('0x1a')]);router['get']('/:id/applications',auth[_0xc03b('0xc')](),controller['getApplications']);router[_0xc03b('0xb')](_0xc03b('0x1b'),auth['isAuthenticated'](),controller[_0xc03b('0x1c')]);router[_0xc03b('0xb')](_0xc03b('0x1d'),controller['getFields']);router[_0xc03b('0xb')](_0xc03b('0x1e'),auth['isAuthenticated'](),controller[_0xc03b('0x1f')]);router[_0xc03b('0xb')](_0xc03b('0x20'),auth[_0xc03b('0xc')](),controller['getAgents']);router['post']('/',auth[_0xc03b('0xc')](),controller[_0xc03b('0x21')]);router[_0xc03b('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc03b('0x23')]);router[_0xc03b('0x22')](_0xc03b('0x24'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x25')]);var upload=multer({'storage':multer[_0xc03b('0x26')]({'destination':function(_0x13cb77,_0x513005,_0x1f4c25){_0x1f4c25(null,path[_0xc03b('0x27')](config[_0xc03b('0x28')],_0xc03b('0x29')));},'filename':function(_0x2b7554,_0x5c0339,_0x4b8e4f){_0x4b8e4f(null,util['format'](_0xc03b('0x2a'),Date[_0xc03b('0x2b')](),_0x5c0339[_0xc03b('0x2c')]));}})});router[_0xc03b('0x22')]('/:id/logo',upload[_0xc03b('0x2d')](_0xc03b('0x2e')),controller[_0xc03b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a3c62,_0x311d38,_0xe61c13){_0xe61c13(null,path[_0xc03b('0x27')](config[_0xc03b('0x28')],_0xc03b('0x30')));},'filename':function(_0x34ed35,_0x51d7bb,_0x4d46f7){_0x4d46f7(null,util[_0xc03b('0x31')](_0xc03b('0x2a'),Date[_0xc03b('0x2b')](),_0x51d7bb['originalname']));}})});router[_0xc03b('0x22')]('/:id/avatar',upload['single']('file'),controller[_0xc03b('0x32')]);var upload=multer({'storage':multer[_0xc03b('0x26')]({'destination':function(_0x1cd78f,_0x22878e,_0x404456){_0x404456(null,path[_0xc03b('0x27')](config[_0xc03b('0x28')],_0xc03b('0x30')));},'filename':function(_0x7d8717,_0x2107fe,_0x15657d){_0x15657d(null,util[_0xc03b('0x31')](_0xc03b('0x2a'),Date[_0xc03b('0x2b')](),_0x2107fe[_0xc03b('0x2c')]));}})});router[_0xc03b('0x22')](_0xc03b('0x13'),upload[_0xc03b('0x2d')](_0xc03b('0x2e')),controller[_0xc03b('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x333e8c,_0xeba2f9,_0x3b4a12){_0x3b4a12(null,path['join'](config[_0xc03b('0x28')],_0xc03b('0x30')));},'filename':function(_0x1f3371,_0xbb97b5,_0x8b9489){_0x8b9489(null,util[_0xc03b('0x31')]('%s-%s',Date[_0xc03b('0x2b')](),_0xbb97b5[_0xc03b('0x2c')]));}})});router['post'](_0xc03b('0x15'),upload[_0xc03b('0x2d')](_0xc03b('0x2e')),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0xc03b('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5b8f6d,_0x5263fc,_0x1a964f){const _0x4a6ea5=path[_0xc03b('0x27')](config[_0xc03b('0x28')],_0xc03b('0x35'),_0xc03b('0x36'),_0xc03b('0x37'));fs_extra[_0xc03b('0x38')](_0x4a6ea5,function(){_0x1a964f(null,_0x4a6ea5);});},'filename':function(_0x14a544,_0x19be98,_0x40bd5f){const _0xfa9ad2=_0x19be98['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2cbf2c=path[_0xc03b('0x39')](_0xfa9ad2);const _0x3996d1=Date[_0xc03b('0x2b')]()+'-'+_0xfa9ad2[_0xc03b('0x3a')](_0x2cbf2c,'')+_0x2cbf2c;_0x40bd5f(null,_0x3996d1);}})});router['post'](_0xc03b('0x3b'),offlineUploadMulter[_0xc03b('0x3c')](),controller['offline']);router[_0xc03b('0x22')](_0xc03b('0x17'),auth['isAuthenticated'](),controller[_0xc03b('0x3d')]);router[_0xc03b('0x22')]('/:id/applications',auth[_0xc03b('0xc')](),controller[_0xc03b('0x3e')]);router[_0xc03b('0x22')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xc03b('0x3f')]);router['post'](_0xc03b('0x20'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x40')]);router[_0xc03b('0x41')](_0xc03b('0xe'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x42')]);router[_0xc03b('0x43')](_0xc03b('0xe'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x44')]);router[_0xc03b('0x43')](_0xc03b('0x45'),auth[_0xc03b('0xc')](),controller[_0xc03b('0x46')]);router[_0xc03b('0x43')](_0xc03b('0x24'),auth[_0xc03b('0xc')](),controller['removeAnswers']);router[_0xc03b('0x43')](_0xc03b('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x4c8f=['now','single','file','addLogo','server/files/images/avatars/','%s-%s','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x4c8f,0xb7));var _0xf4c8=function(_0x375d76,_0x43e2e9){_0x375d76=_0x375d76-0x0;var _0x44ab8e=_0x4c8f[_0x375d76];return _0x44ab8e;};'use strict';var multer=require(_0xf4c8('0x0'));var util=require(_0xf4c8('0x1'));var path=require(_0xf4c8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf4c8('0x3')]();var fs_extra=require(_0xf4c8('0x4'));var auth=require(_0xf4c8('0x5'));var interaction=require(_0xf4c8('0x6'));var config=require('../../config/environment');var controller=require(_0xf4c8('0x7'));router[_0xf4c8('0x8')]('/',auth[_0xf4c8('0x9')](),controller['index']);router[_0xf4c8('0x8')](_0xf4c8('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf4c8('0x8')](_0xf4c8('0xb'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0xc')]);router['get'](_0xf4c8('0xd'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0xe')]);router[_0xf4c8('0x8')](_0xf4c8('0xf'),auth['isAuthenticated'](),controller[_0xf4c8('0x10')]);router[_0xf4c8('0x8')](_0xf4c8('0x11'),controller['getLogo']);router[_0xf4c8('0x8')](_0xf4c8('0x12'),controller[_0xf4c8('0x13')]);router[_0xf4c8('0x8')](_0xf4c8('0x14'),controller[_0xf4c8('0x15')]);router[_0xf4c8('0x8')](_0xf4c8('0x16'),controller[_0xf4c8('0x17')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0xf4c8('0x18')]);router['get'](_0xf4c8('0x19'),controller['getSnippet']);router['get'](_0xf4c8('0x1a'),auth[_0xf4c8('0x9')](),controller['getApplications']);router[_0xf4c8('0x8')](_0xf4c8('0x1b'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x1c')]);router[_0xf4c8('0x8')](_0xf4c8('0x1d'),controller[_0xf4c8('0x1e')]);router[_0xf4c8('0x8')](_0xf4c8('0x1f'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x20')]);router['get']('/:id/users',auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x21')]);router[_0xf4c8('0x22')]('/',auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x23')]);router['post'](_0xf4c8('0xd'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x24')]);router[_0xf4c8('0x22')](_0xf4c8('0xf'),auth[_0xf4c8('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xf4c8('0x25')]({'destination':function(_0x245a7b,_0x5e9ea4,_0x358916){_0x358916(null,path[_0xf4c8('0x26')](config[_0xf4c8('0x27')],_0xf4c8('0x28')));},'filename':function(_0x5b235e,_0x5caa10,_0x3d124b){_0x3d124b(null,util[_0xf4c8('0x29')]('%s-%s',Date[_0xf4c8('0x2a')](),_0x5caa10['originalname']));}})});router['post'](_0xf4c8('0x11'),upload[_0xf4c8('0x2b')](_0xf4c8('0x2c')),controller[_0xf4c8('0x2d')]);var upload=multer({'storage':multer[_0xf4c8('0x25')]({'destination':function(_0x434412,_0x9e0757,_0xe434c1){_0xe434c1(null,path[_0xf4c8('0x26')](config[_0xf4c8('0x27')],_0xf4c8('0x2e')));},'filename':function(_0x433c8c,_0x637876,_0x552b13){_0x552b13(null,util[_0xf4c8('0x29')](_0xf4c8('0x2f'),Date['now'](),_0x637876[_0xf4c8('0x30')]));}})});router[_0xf4c8('0x22')](_0xf4c8('0x12'),upload[_0xf4c8('0x2b')](_0xf4c8('0x2c')),controller[_0xf4c8('0x31')]);var upload=multer({'storage':multer[_0xf4c8('0x25')]({'destination':function(_0x46f67b,_0x2695ab,_0x5def1a){_0x5def1a(null,path[_0xf4c8('0x26')](config[_0xf4c8('0x27')],_0xf4c8('0x2e')));},'filename':function(_0x1dffbc,_0x2b95d7,_0x2587aa){_0x2587aa(null,util[_0xf4c8('0x29')](_0xf4c8('0x2f'),Date[_0xf4c8('0x2a')](),_0x2b95d7[_0xf4c8('0x30')]));}})});router[_0xf4c8('0x22')](_0xf4c8('0x14'),upload[_0xf4c8('0x2b')]('file'),controller[_0xf4c8('0x32')]);var upload=multer({'storage':multer[_0xf4c8('0x25')]({'destination':function(_0x4f7583,_0x5e2ca8,_0x206163){_0x206163(null,path[_0xf4c8('0x26')](config[_0xf4c8('0x27')],_0xf4c8('0x2e')));},'filename':function(_0x4a42f5,_0x2bd190,_0x16fdd5){_0x16fdd5(null,util[_0xf4c8('0x29')](_0xf4c8('0x2f'),Date[_0xf4c8('0x2a')](),_0x2bd190[_0xf4c8('0x30')]));}})});router[_0xf4c8('0x22')]('/:id/system_avatar',upload[_0xf4c8('0x2b')](_0xf4c8('0x2c')),controller[_0xf4c8('0x33')]);router[_0xf4c8('0x22')](_0xf4c8('0x34'),controller[_0xf4c8('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xf4c8('0x25')]({'destination':function(_0x305093,_0x4ea47c,_0x500906){const _0x586119=path[_0xf4c8('0x26')](config[_0xf4c8('0x27')],_0xf4c8('0x36'),_0xf4c8('0x37'),_0xf4c8('0x38'));fs_extra[_0xf4c8('0x39')](_0x586119,function(){_0x500906(null,_0x586119);});},'filename':function(_0x1bf6af,_0x38434e,_0x175bf1){const _0x38977f=_0x38434e[_0xf4c8('0x30')][_0xf4c8('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x49b57e=path[_0xf4c8('0x3b')](_0x38977f);const _0x5d3188=Date['now']()+'-'+_0x38977f['replace'](_0x49b57e,'')+_0x49b57e;_0x175bf1(null,_0x5d3188);}})});router[_0xf4c8('0x22')](_0xf4c8('0x3c'),offlineUploadMulter[_0xf4c8('0x3d')](),controller[_0xf4c8('0x3e')]);router['post'](_0xf4c8('0x3f'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x40')]);router[_0xf4c8('0x22')](_0xf4c8('0x1a'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x41')]);router[_0xf4c8('0x22')](_0xf4c8('0x1b'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x42')]);router[_0xf4c8('0x22')](_0xf4c8('0x43'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x44')]);router[_0xf4c8('0x45')](_0xf4c8('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf4c8('0x46')](_0xf4c8('0xb'),auth[_0xf4c8('0x9')](),controller['destroy']);router[_0xf4c8('0x46')]('/:id/dispositions',auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x47')]);router[_0xf4c8('0x46')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf4c8('0x48')]);router[_0xf4c8('0x46')](_0xf4c8('0x43'),auth[_0xf4c8('0x9')](),controller[_0xf4c8('0x49')]);module[_0xf4c8('0x4a')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 8938a7a..5c41e05 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 _0x5099=['Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','env','production','app','get'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5099,0x10d));var _0x9509=function(_0x535246,_0x20318e){_0x535246=_0x535246-0x0;var _0x13d5d4=_0x5099[_0x535246];return _0x13d5d4;};var beaverLogger=require(_0x9509('0x0'));var express=require('express');var auth=require(_0x9509('0x1'));var config=require('../config/environment');var router=express[_0x9509('0x2')]();var isProduction=config[_0x9509('0x3')]===_0x9509('0x4')||![];function clientSideLogs(_0x1f1f19,_0x2a4666,_0x314e79){var _0x983bae=_0x1f1f19[_0x9509('0x5')][_0x9509('0x6')]('client-side-logger');if(!_0x983bae){throw new Error(_0x9509('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x9509('0x8'),'logger':_0x983bae,'enableCors':!isProduction})(_0x1f1f19,_0x2a4666,_0x314e79);}router[_0x9509('0x9')](auth[_0x9509('0xa')](),clientSideLogs);module[_0x9509('0xb')]=router; \ No newline at end of file +var _0xaac9=['express','../components/auth/service','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xaac9,0x82));var _0x9aac=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xaac9[_0xc6b104];return _0x1c6fce;};var beaverLogger=require('beaver-logger/server');var express=require(_0x9aac('0x0'));var auth=require(_0x9aac('0x1'));var config=require('../config/environment');var router=express[_0x9aac('0x2')]();var isProduction=config[_0x9aac('0x3')]===_0x9aac('0x4')||![];function clientSideLogs(_0x4c01c8,_0x31c2e5,_0x26ed77){var _0x18db3d=_0x4c01c8[_0x9aac('0x5')][_0x9aac('0x6')](_0x9aac('0x7'));if(!_0x18db3d){throw new Error(_0x9aac('0x8'));}return beaverLogger[_0x9aac('0x9')]({'uri':_0x9aac('0xa'),'logger':_0x18db3d,'enableCors':!isProduction})(_0x4c01c8,_0x31c2e5,_0x26ed77);}router[_0x9aac('0xb')](auth[_0x9aac('0xc')](),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 6d800f7..9b74d13 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 _0x6262=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x1ba6a1,_0x3cb246){var _0x26e3b1=function(_0x169728){while(--_0x169728){_0x1ba6a1['push'](_0x1ba6a1['shift']());}};_0x26e3b1(++_0x3cb246);}(_0x6262,0xec));var _0x2626=function(_0x9e72c8,_0x5ac1a9){_0x9e72c8=_0x9e72c8-0x0;var _0x1468b2=_0x6262[_0x9e72c8];return _0x1468b2;};'use strict';var Sequelize=require(_0x2626('0x0'));module[_0x2626('0x1')]={'name':{'type':Sequelize[_0x2626('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2626('0x3')](_0x2626('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2626('0x3')](_0x2626('0x5'),_0x2626('0x6'))},'data1':{'type':Sequelize[_0x2626('0x2')],'comment':_0x2626('0x7')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x2626('0x2')],'comment':_0x2626('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x2626('0x9')},'data5':{'type':Sequelize[_0x2626('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x2626('0xa')],'comment':_0x2626('0xb')},'data7':{'type':Sequelize[_0x2626('0xa')],'comment':_0x2626('0xc')}}; \ No newline at end of file +var _0x5465=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','AmazonAWS','Outlook365','Dynamics365','STRING'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0x5465,0x14c));var _0x5546=function(_0x77ab15,_0x5a2f81){_0x77ab15=_0x77ab15-0x0;var _0x4a0b15=_0x5465[_0x77ab15];return _0x4a0b15;};'use strict';var Sequelize=require(_0x5546('0x0'));module[_0x5546('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5546('0x2'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x5546('0x3'),_0x5546('0x4'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x5546('0x5')],'comment':_0x5546('0x6')},'data3':{'type':Sequelize[_0x5546('0x5')],'comment':_0x5546('0x7')},'data4':{'type':Sequelize[_0x5546('0x5')],'comment':_0x5546('0x8')},'data5':{'type':Sequelize[_0x5546('0x9')],'comment':_0x5546('0xa')},'data6':{'type':Sequelize[_0x5546('0x9')],'comment':_0x5546('0xb')},'data7':{'type':Sequelize[_0x5546('0x9')],'comment':_0x5546('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 13324ab..45f5bac 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 _0xfac7=['index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','CloudProvider','then','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','params','length','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','includes','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','api','defaults','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','limit','undefined','count','stack','name','send'];(function(_0x5a401e,_0x2de782){var _0x2aa2cc=function(_0x1150e7){while(--_0x1150e7){_0x5a401e['push'](_0x5a401e['shift']());}};_0x2aa2cc(++_0x2de782);}(_0xfac7,0xf7));var _0x7fac=function(_0x140202,_0x4245c7){_0x140202=_0x140202-0x0;var _0x3037c2=_0xfac7[_0x140202];return _0x3037c2;};'use strict';var _=require(_0x7fac('0x0'));var Redis=require('ioredis');var qs=require(_0x7fac('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x7fac('0x2'));var logger=require(_0x7fac('0x3'))(_0x7fac('0x4'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x7fac('0x5')](config['redis'],{'host':_0x7fac('0x6'),'port':0x18eb});var socket=require(_0x7fac('0x7'))(new Redis(config[_0x7fac('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x576d84,_0x168b2d){_0x168b2d=_0x168b2d||0xcc;return function(_0x51be14){if(_0x51be14){return _0x576d84[_0x7fac('0x9')](_0x168b2d);}return _0x576d84[_0x7fac('0xa')](_0x168b2d)[_0x7fac('0xb')]();};}function respondWithResult(_0x2d842a,_0x42a0b2){_0x42a0b2=_0x42a0b2||0xc8;return function(_0x4d2f28){if(_0x4d2f28){return _0x2d842a['status'](_0x42a0b2)[_0x7fac('0xc')](_0x4d2f28);}};}function respondWithFilteredResult(_0x2a13f9,_0x322215){return function(_0x4c5797){if(_0x4c5797){var _0x3fcde7=typeof _0x322215[_0x7fac('0xd')]==='undefined'&&typeof _0x322215[_0x7fac('0xe')]===_0x7fac('0xf');var _0x5c9109=_0x4c5797[_0x7fac('0x10')];var _0x75788=_0x3fcde7?0x0:_0x322215[_0x7fac('0xd')];var _0x5930b1=_0x3fcde7?_0x4c5797['count']:_0x322215[_0x7fac('0xd')]+_0x322215['limit'];var _0x23b22d;if(_0x5930b1>=_0x5c9109){_0x5930b1=_0x5c9109;_0x23b22d=0xc8;}else{_0x23b22d=0xce;}_0x2a13f9['status'](_0x23b22d);return _0x2a13f9['set']('Content-Range',_0x75788+'-'+_0x5930b1+'/'+_0x5c9109)[_0x7fac('0xc')](_0x4c5797);}return null;};}function saveUpdates(_0x25ce70){return function(_0x7ee094){if(_0x7ee094){return _0x7ee094['update'](_0x25ce70)['then'](function(_0xbb1392){return _0xbb1392;});}return null;};}function removeEntity(_0x39a8de){return function(_0x28c635){if(_0x28c635){return _0x28c635['destroy']()['then'](function(){_0x39a8de[_0x7fac('0xa')](0xcc)[_0x7fac('0xb')]();});}};}function handleEntityNotFound(_0xef1d3b){return function(_0x30a4e6){if(!_0x30a4e6){_0xef1d3b[_0x7fac('0x9')](0x194);}return _0x30a4e6;};}function handleError(_0x280435,_0x9774aa){_0x9774aa=_0x9774aa||0x1f4;return function(_0x4ba590){logger['error'](_0x4ba590[_0x7fac('0x11')]);if(_0x4ba590[_0x7fac('0x12')]){delete _0x4ba590[_0x7fac('0x12')];}_0x280435['status'](_0x9774aa)[_0x7fac('0x13')](_0x4ba590);};}function maskClientSecret(_0x546262){return _['padEnd'](_0x546262['slice'](0x0,0x3),0x14,'*');}exports[_0x7fac('0x14')]=function(_0x3ddf95,_0x38dfce){var _0x4fc4e1={},_0x27f8df={},_0x1da404={'count':0x0,'rows':[]};var _0x2a0252=_[_0x7fac('0x15')](db['CloudProvider'][_0x7fac('0x16')],function(_0x5f3db8){return{'name':_0x5f3db8['fieldName'],'type':_0x5f3db8[_0x7fac('0x17')][_0x7fac('0x18')]};});_0x27f8df['model']=_[_0x7fac('0x15')](_0x2a0252,'name');_0x27f8df[_0x7fac('0x19')]=_[_0x7fac('0x1a')](_0x3ddf95['query']);_0x27f8df['filters']=_[_0x7fac('0x1b')](_0x27f8df[_0x7fac('0x1c')],_0x27f8df[_0x7fac('0x19')]);_0x4fc4e1[_0x7fac('0x1d')]=_[_0x7fac('0x1b')](_0x27f8df['model'],qs[_0x7fac('0x1e')](_0x3ddf95['query'][_0x7fac('0x1e')]));_0x4fc4e1[_0x7fac('0x1d')]=_0x4fc4e1['attributes']['length']?_0x4fc4e1[_0x7fac('0x1d')]:_0x27f8df[_0x7fac('0x1c')];if(!_0x3ddf95[_0x7fac('0x19')][_0x7fac('0x1f')](_0x7fac('0x20'))){_0x4fc4e1[_0x7fac('0xe')]=qs[_0x7fac('0xe')](_0x3ddf95[_0x7fac('0x19')]['limit']);_0x4fc4e1[_0x7fac('0xd')]=qs[_0x7fac('0xd')](_0x3ddf95['query']['offset']);}_0x4fc4e1['order']=qs[_0x7fac('0x21')](_0x3ddf95[_0x7fac('0x19')]['sort']);_0x4fc4e1[_0x7fac('0x22')]=qs[_0x7fac('0x23')](_[_0x7fac('0x24')](_0x3ddf95['query'],_0x27f8df['filters']),_0x2a0252);if(_0x3ddf95[_0x7fac('0x19')]['filter']){_0x4fc4e1[_0x7fac('0x22')]=_[_0x7fac('0x25')](_0x4fc4e1[_0x7fac('0x22')],{'$or':_['map'](_0x2a0252,function(_0x3e936d){if(_0x3e936d[_0x7fac('0x17')]!==_0x7fac('0x26')){var _0x32e13a={};_0x32e13a[_0x3e936d[_0x7fac('0x12')]]={'$like':'%'+_0x3ddf95[_0x7fac('0x19')][_0x7fac('0x27')]+'%'};return _0x32e13a;}})});}_0x4fc4e1=_['merge']({},_0x4fc4e1,_0x3ddf95[_0x7fac('0x28')]);var _0x5b304b={'where':_0x4fc4e1[_0x7fac('0x22')]};return db[_0x7fac('0x29')]['count'](_0x5b304b)[_0x7fac('0x2a')](function(_0x4ade51){_0x1da404[_0x7fac('0x10')]=_0x4ade51;if(_0x3ddf95[_0x7fac('0x19')][_0x7fac('0x2b')]){_0x4fc4e1[_0x7fac('0x2c')]=[{'all':!![]}];}return db[_0x7fac('0x29')][_0x7fac('0x2d')](_0x4fc4e1);})[_0x7fac('0x2a')](function(_0x55ed4a){_0x1da404['rows']=_[_0x7fac('0x15')](_0x55ed4a,function(_0x3b24b6){if(_0x3b24b6[_0x7fac('0x2e')]===_0x7fac('0x2f')){var _0x5ab2ab=encryptor['decryptString'](_0x3b24b6[_0x7fac('0x30')]);_0x3b24b6[_0x7fac('0x30')]=maskClientSecret(_0x5ab2ab);}return _0x3b24b6;});return _0x1da404;})[_0x7fac('0x2a')](respondWithFilteredResult(_0x38dfce,_0x4fc4e1))[_0x7fac('0x31')](handleError(_0x38dfce,null));};exports['show']=function(_0x56277f,_0x5c8c87){var _0xa0b30e={'raw':!![],'where':{'id':_0x56277f[_0x7fac('0x32')]['id']}},_0x5a1618={};_0x5a1618[_0x7fac('0x1c')]=_[_0x7fac('0x1a')](db['CloudProvider'][_0x7fac('0x16')]);_0x5a1618[_0x7fac('0x19')]=_['keys'](_0x56277f[_0x7fac('0x19')]);_0x5a1618[_0x7fac('0x23')]=_[_0x7fac('0x1b')](_0x5a1618['model'],_0x5a1618[_0x7fac('0x19')]);_0xa0b30e[_0x7fac('0x1d')]=_[_0x7fac('0x1b')](_0x5a1618[_0x7fac('0x1c')],qs[_0x7fac('0x1e')](_0x56277f[_0x7fac('0x19')][_0x7fac('0x1e')]));_0xa0b30e[_0x7fac('0x1d')]=_0xa0b30e['attributes'][_0x7fac('0x33')]?_0xa0b30e[_0x7fac('0x1d')]:_0x5a1618[_0x7fac('0x1c')];if(_0x56277f[_0x7fac('0x19')][_0x7fac('0x2b')]){_0xa0b30e[_0x7fac('0x2c')]=[{'all':!![]}];}_0xa0b30e=_['merge']({},_0xa0b30e,_0x56277f['options']);return db[_0x7fac('0x29')][_0x7fac('0x34')](_0xa0b30e)['then'](handleEntityNotFound(_0x5c8c87,null))[_0x7fac('0x2a')](function(_0x35aa18){if(_0x35aa18[_0x7fac('0x2e')]===_0x7fac('0x2f')){var _0x43da12=encryptor[_0x7fac('0x35')](_0x35aa18['data3']);_0x35aa18[_0x7fac('0x30')]=maskClientSecret(_0x43da12);}return _0x35aa18;})[_0x7fac('0x2a')](respondWithResult(_0x5c8c87,null))[_0x7fac('0x31')](handleError(_0x5c8c87,null));};exports[_0x7fac('0x36')]=function(_0x5b4382,_0x7436b0){if(!_0x5b4382[_0x7fac('0x37')][_0x7fac('0x12')])throw new Error(_0x7fac('0x38'));if(!_0x5b4382['body'][_0x7fac('0x2e')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x2bdf16=db[_0x7fac('0x29')][_0x7fac('0x16')][_0x7fac('0x2e')][_0x7fac('0x39')];if(!_0x2bdf16[_0x7fac('0x3a')](_0x5b4382[_0x7fac('0x37')][_0x7fac('0x2e')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2bdf16[_0x7fac('0x3b')](',\x20'));if(_0x5b4382['body'][_0x7fac('0x2e')]===_0x7fac('0x2f')&&_0x5b4382[_0x7fac('0x37')]['data3']){_0x5b4382['body']['data3']=encryptor[_0x7fac('0x3c')](_0x5b4382['body'][_0x7fac('0x30')]);}return db[_0x7fac('0x29')]['create'](_0x5b4382[_0x7fac('0x37')],{})['then'](respondWithResult(_0x7436b0,0xc9))[_0x7fac('0x31')](handleError(_0x7436b0,null));};exports[_0x7fac('0x3d')]=function(_0xc2a7c5,_0xcddc09){if(_0xc2a7c5[_0x7fac('0x37')]['id']){delete _0xc2a7c5[_0x7fac('0x37')]['id'];}return db[_0x7fac('0x29')][_0x7fac('0x34')]({'where':{'id':_0xc2a7c5[_0x7fac('0x32')]['id']}})[_0x7fac('0x2a')](handleEntityNotFound(_0xcddc09,null))['then'](function(_0xc7387c){if(_0xc7387c[_0x7fac('0x2e')]===_0x7fac('0x2f')&&_0xc2a7c5['body'][_0x7fac('0x30')]){_0xc2a7c5[_0x7fac('0x37')][_0x7fac('0x30')]=encryptor[_0x7fac('0x3c')](_0xc2a7c5[_0x7fac('0x37')][_0x7fac('0x30')]);}return _0xc7387c;})[_0x7fac('0x2a')](saveUpdates(_0xc2a7c5[_0x7fac('0x37')],null))[_0x7fac('0x2a')](respondWithResult(_0xcddc09,null))['catch'](handleError(_0xcddc09,null));};exports[_0x7fac('0x3e')]=function(_0x50685e,_0x273f21){return db['CloudProvider']['find']({'where':{'id':_0x50685e[_0x7fac('0x32')]['id']}})[_0x7fac('0x2a')](handleEntityNotFound(_0x273f21,null))[_0x7fac('0x2a')](removeEntity(_0x273f21,null))[_0x7fac('0x31')](handleError(_0x273f21,null));};exports[_0x7fac('0x3f')]=function(_0x4187e0,_0x5ec0c4){return db[_0x7fac('0x29')]['findOne']({'where':{'id':_0x4187e0[_0x7fac('0x32')]['id']},'raw':!![]})['then'](function(_0x4cf3e3){if(!_0x4cf3e3)return _0x5ec0c4[_0x7fac('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4cf3e3,_0x4187e0[_0x7fac('0x40')]['id'])};})[_0x7fac('0x2a')](respondWithResult(_0x5ec0c4,null))[_0x7fac('0x31')](handleError(_0x5ec0c4,null));};exports[_0x7fac('0x41')]=function(_0x913fe7,_0x3171f7){var _0x4ef587=_0x913fe7[_0x7fac('0x37')];var _0x1ae9e0;var _0x2667b2;if(_0x4ef587[_0x7fac('0x42')])throw _0x4ef587;redis[_0x7fac('0x43')](_0x4ef587[_0x7fac('0x44')])[_0x7fac('0x2a')](function(_0x2b29e8){if(!_0x2b29e8)throw new Error(_0x7fac('0x45'));_0x1ae9e0=JSON[_0x7fac('0x46')](_0x2b29e8);var _0x4c2d0c=Buffer[_0x7fac('0x47')](_0x4ef587[_0x7fac('0x44')],_0x7fac('0x48'))[_0x7fac('0x49')]('ascii');_0x2667b2=JSON[_0x7fac('0x46')](_0x4c2d0c);if(!oauth['isValidIdToken'](_0x4ef587['id_token'],_0x1ae9e0['oauth2Claims']))throw new Error(_0x7fac('0x4a'));redis[_0x7fac('0x4b')](_0x4ef587[_0x7fac('0x44')]);return oauth[_0x7fac('0x4c')](_0x4ef587[_0x7fac('0x4d')],_0x1ae9e0);})[_0x7fac('0x2a')](function(_0xcac6b4){_0x1ae9e0[_0x7fac('0x4e')]=_0xcac6b4[_0x7fac('0x4f')];_0x1ae9e0[_0x7fac('0x50')]=_0xcac6b4[_0x7fac('0x51')];return db[_0x7fac('0x29')]['update']({'data5':_0x1ae9e0['data5'],'data6':_0x1ae9e0[_0x7fac('0x50')]},{'where':{'id':_0x1ae9e0['id']}});})[_0x7fac('0x2a')](function(){oauth[_0x7fac('0x52')](_0x1ae9e0);socket[_0x7fac('0x53')](_0x7fac('0x54'),{'id':_0x2667b2['id']});return;})[_0x7fac('0x2a')](respondWithStatusCode(_0x3171f7,null))[_0x7fac('0x31')](function(_0x4ca706){if(_0x2667b2){socket[_0x7fac('0x53')](_0x7fac('0x55'),{'id':_0x2667b2['id']});}if(!_0x1ae9e0){logger[_0x7fac('0x42')](_0x7fac('0x56'),_0x4ca706);return _0x3171f7[_0x7fac('0xa')](0x1f4)[_0x7fac('0x13')](_0x4ca706[_0x7fac('0x57')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1ae9e0['id'],JSON[_0x7fac('0x58')](_0x4ca706));});}; \ No newline at end of file +var _0xc860=['end','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','stack','name','send','slice','index','map','CloudProvider','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','rawAttributes','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','destroy','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','redis','status'];(function(_0x35c2e3,_0x3125b6){var _0x3c5dfb=function(_0x451387){while(--_0x451387){_0x35c2e3['push'](_0x35c2e3['shift']());}};_0x3c5dfb(++_0x3125b6);}(_0xc860,0x10c));var _0x0c86=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xc860[_0x4bc65f];return _0x44f85f;};'use strict';var _=require('lodash');var Redis=require(_0x0c86('0x0'));var qs=require(_0x0c86('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x0c86('0x2'));var logger=require(_0x0c86('0x3'))(_0x0c86('0x4'));var db=require(_0x0c86('0x5'))['db'];var oauth=require(_0x0c86('0x6'));config['redis']=_[_0x0c86('0x7')](config['redis'],{'host':_0x0c86('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c86('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4b138c,_0x4fe9da){_0x4fe9da=_0x4fe9da||0xcc;return function(_0x1c9de3){if(_0x1c9de3){return _0x4b138c['sendStatus'](_0x4fe9da);}return _0x4b138c[_0x0c86('0xa')](_0x4fe9da)[_0x0c86('0xb')]();};}function respondWithResult(_0x157c07,_0x20853f){_0x20853f=_0x20853f||0xc8;return function(_0x254201){if(_0x254201){return _0x157c07[_0x0c86('0xa')](_0x20853f)[_0x0c86('0xc')](_0x254201);}};}function respondWithFilteredResult(_0x86daeb,_0x297e5c){return function(_0x3b1b5a){if(_0x3b1b5a){var _0x5aa587=typeof _0x297e5c[_0x0c86('0xd')]===_0x0c86('0xe')&&typeof _0x297e5c[_0x0c86('0xf')]==='undefined';var _0x1282d7=_0x3b1b5a[_0x0c86('0x10')];var _0x171310=_0x5aa587?0x0:_0x297e5c[_0x0c86('0xd')];var _0x2943b5=_0x5aa587?_0x3b1b5a[_0x0c86('0x10')]:_0x297e5c['offset']+_0x297e5c[_0x0c86('0xf')];var _0x29e71a;if(_0x2943b5>=_0x1282d7){_0x2943b5=_0x1282d7;_0x29e71a=0xc8;}else{_0x29e71a=0xce;}_0x86daeb['status'](_0x29e71a);return _0x86daeb['set'](_0x0c86('0x11'),_0x171310+'-'+_0x2943b5+'/'+_0x1282d7)['json'](_0x3b1b5a);}return null;};}function saveUpdates(_0x2d12f4){return function(_0x36b7eb){if(_0x36b7eb){return _0x36b7eb[_0x0c86('0x12')](_0x2d12f4)[_0x0c86('0x13')](function(_0x175fa9){return _0x175fa9;});}return null;};}function removeEntity(_0x1ddb3d){return function(_0x24e7b9){if(_0x24e7b9){return _0x24e7b9['destroy']()['then'](function(){_0x1ddb3d[_0x0c86('0xa')](0xcc)[_0x0c86('0xb')]();});}};}function handleEntityNotFound(_0x5568ff){return function(_0x4f6001){if(!_0x4f6001){_0x5568ff[_0x0c86('0x14')](0x194);}return _0x4f6001;};}function handleError(_0x47c365,_0x39bbce){_0x39bbce=_0x39bbce||0x1f4;return function(_0xb6d7a5){logger['error'](_0xb6d7a5[_0x0c86('0x15')]);if(_0xb6d7a5[_0x0c86('0x16')]){delete _0xb6d7a5[_0x0c86('0x16')];}_0x47c365['status'](_0x39bbce)[_0x0c86('0x17')](_0xb6d7a5);};}function maskClientSecret(_0x392fb1){return _['padEnd'](_0x392fb1[_0x0c86('0x18')](0x0,0x3),0x14,'*');}exports[_0x0c86('0x19')]=function(_0x1cc7e5,_0x1ca63a){var _0x500b3f={},_0x10b19d={},_0x2e53fa={'count':0x0,'rows':[]};var _0x1d41d5=_[_0x0c86('0x1a')](db[_0x0c86('0x1b')]['rawAttributes'],function(_0x512ed7){return{'name':_0x512ed7[_0x0c86('0x1c')],'type':_0x512ed7[_0x0c86('0x1d')][_0x0c86('0x1e')]};});_0x10b19d[_0x0c86('0x1f')]=_[_0x0c86('0x1a')](_0x1d41d5,'name');_0x10b19d['query']=_[_0x0c86('0x20')](_0x1cc7e5[_0x0c86('0x21')]);_0x10b19d['filters']=_[_0x0c86('0x22')](_0x10b19d[_0x0c86('0x1f')],_0x10b19d['query']);_0x500b3f[_0x0c86('0x23')]=_[_0x0c86('0x22')](_0x10b19d[_0x0c86('0x1f')],qs[_0x0c86('0x24')](_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0x24')]));_0x500b3f[_0x0c86('0x23')]=_0x500b3f[_0x0c86('0x23')][_0x0c86('0x25')]?_0x500b3f[_0x0c86('0x23')]:_0x10b19d['model'];if(!_0x1cc7e5['query']['hasOwnProperty'](_0x0c86('0x26'))){_0x500b3f[_0x0c86('0xf')]=qs['limit'](_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0xf')]);_0x500b3f[_0x0c86('0xd')]=qs[_0x0c86('0xd')](_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0xd')]);}_0x500b3f[_0x0c86('0x27')]=qs[_0x0c86('0x28')](_0x1cc7e5['query'][_0x0c86('0x28')]);_0x500b3f[_0x0c86('0x29')]=qs[_0x0c86('0x2a')](_[_0x0c86('0x2b')](_0x1cc7e5['query'],_0x10b19d['filters']),_0x1d41d5);if(_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0x2c')]){_0x500b3f[_0x0c86('0x29')]=_[_0x0c86('0x2d')](_0x500b3f[_0x0c86('0x29')],{'$or':_[_0x0c86('0x1a')](_0x1d41d5,function(_0x46bc33){if(_0x46bc33[_0x0c86('0x1d')]!==_0x0c86('0x2e')){var _0x583983={};_0x583983[_0x46bc33[_0x0c86('0x16')]]={'$like':'%'+_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0x2c')]+'%'};return _0x583983;}})});}_0x500b3f=_[_0x0c86('0x2d')]({},_0x500b3f,_0x1cc7e5[_0x0c86('0x2f')]);var _0x2e995e={'where':_0x500b3f[_0x0c86('0x29')]};return db[_0x0c86('0x1b')][_0x0c86('0x10')](_0x2e995e)['then'](function(_0x4fa53c){_0x2e53fa[_0x0c86('0x10')]=_0x4fa53c;if(_0x1cc7e5[_0x0c86('0x21')][_0x0c86('0x30')]){_0x500b3f[_0x0c86('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x0c86('0x32')](_0x500b3f);})['then'](function(_0x4c2b97){_0x2e53fa[_0x0c86('0x33')]=_[_0x0c86('0x1a')](_0x4c2b97,function(_0x4d2968){if(_0x4d2968[_0x0c86('0x34')]===_0x0c86('0x35')){var _0x5ec868=encryptor[_0x0c86('0x36')](_0x4d2968[_0x0c86('0x37')]);_0x4d2968['data3']=maskClientSecret(_0x5ec868);}return _0x4d2968;});return _0x2e53fa;})[_0x0c86('0x13')](respondWithFilteredResult(_0x1ca63a,_0x500b3f))['catch'](handleError(_0x1ca63a,null));};exports[_0x0c86('0x38')]=function(_0x4bfa75,_0x96eb81){var _0x1fae4d={'raw':!![],'where':{'id':_0x4bfa75['params']['id']}},_0x2570b9={};_0x2570b9[_0x0c86('0x1f')]=_['keys'](db['CloudProvider'][_0x0c86('0x39')]);_0x2570b9['query']=_[_0x0c86('0x20')](_0x4bfa75[_0x0c86('0x21')]);_0x2570b9[_0x0c86('0x2a')]=_['intersection'](_0x2570b9[_0x0c86('0x1f')],_0x2570b9[_0x0c86('0x21')]);_0x1fae4d[_0x0c86('0x23')]=_['intersection'](_0x2570b9[_0x0c86('0x1f')],qs[_0x0c86('0x24')](_0x4bfa75[_0x0c86('0x21')]['fields']));_0x1fae4d[_0x0c86('0x23')]=_0x1fae4d[_0x0c86('0x23')][_0x0c86('0x25')]?_0x1fae4d[_0x0c86('0x23')]:_0x2570b9[_0x0c86('0x1f')];if(_0x4bfa75[_0x0c86('0x21')][_0x0c86('0x30')]){_0x1fae4d[_0x0c86('0x31')]=[{'all':!![]}];}_0x1fae4d=_[_0x0c86('0x2d')]({},_0x1fae4d,_0x4bfa75[_0x0c86('0x2f')]);return db['CloudProvider'][_0x0c86('0x3a')](_0x1fae4d)[_0x0c86('0x13')](handleEntityNotFound(_0x96eb81,null))[_0x0c86('0x13')](function(_0x34d273){if(_0x34d273[_0x0c86('0x34')]===_0x0c86('0x35')){var _0xf7954a=encryptor[_0x0c86('0x36')](_0x34d273[_0x0c86('0x37')]);_0x34d273[_0x0c86('0x37')]=maskClientSecret(_0xf7954a);}return _0x34d273;})[_0x0c86('0x13')](respondWithResult(_0x96eb81,null))[_0x0c86('0x3b')](handleError(_0x96eb81,null));};exports[_0x0c86('0x3c')]=function(_0x2ec276,_0x5700e0){if(!_0x2ec276[_0x0c86('0x3d')][_0x0c86('0x16')])throw new Error(_0x0c86('0x3e'));if(!_0x2ec276[_0x0c86('0x3d')]['service'])throw new Error(_0x0c86('0x3f'));var _0xdca53e=db[_0x0c86('0x1b')]['rawAttributes'][_0x0c86('0x34')]['values'];if(!_0xdca53e[_0x0c86('0x40')](_0x2ec276['body'][_0x0c86('0x34')]))throw new Error(_0x0c86('0x41')+_0xdca53e[_0x0c86('0x42')](',\x20'));if(_0x2ec276['body']['service']===_0x0c86('0x35')&&_0x2ec276[_0x0c86('0x3d')][_0x0c86('0x37')]){_0x2ec276[_0x0c86('0x3d')][_0x0c86('0x37')]=encryptor[_0x0c86('0x43')](_0x2ec276[_0x0c86('0x3d')][_0x0c86('0x37')]);}return db[_0x0c86('0x1b')][_0x0c86('0x3c')](_0x2ec276[_0x0c86('0x3d')],{})[_0x0c86('0x13')](respondWithResult(_0x5700e0,0xc9))[_0x0c86('0x3b')](handleError(_0x5700e0,null));};exports['update']=function(_0x460aa2,_0x200b1f){if(_0x460aa2[_0x0c86('0x3d')]['id']){delete _0x460aa2[_0x0c86('0x3d')]['id'];}return db[_0x0c86('0x1b')][_0x0c86('0x3a')]({'where':{'id':_0x460aa2[_0x0c86('0x44')]['id']}})[_0x0c86('0x13')](handleEntityNotFound(_0x200b1f,null))[_0x0c86('0x13')](function(_0x51e445){if(_0x51e445[_0x0c86('0x34')]===_0x0c86('0x35')&&_0x460aa2['body']['data3']){_0x460aa2['body'][_0x0c86('0x37')]=encryptor[_0x0c86('0x43')](_0x460aa2['body'][_0x0c86('0x37')]);}return _0x51e445;})[_0x0c86('0x13')](saveUpdates(_0x460aa2[_0x0c86('0x3d')],null))[_0x0c86('0x13')](respondWithResult(_0x200b1f,null))['catch'](handleError(_0x200b1f,null));};exports[_0x0c86('0x45')]=function(_0x288824,_0x1c3621){return db['CloudProvider'][_0x0c86('0x3a')]({'where':{'id':_0x288824[_0x0c86('0x44')]['id']}})[_0x0c86('0x13')](handleEntityNotFound(_0x1c3621,null))[_0x0c86('0x13')](removeEntity(_0x1c3621,null))[_0x0c86('0x3b')](handleError(_0x1c3621,null));};exports[_0x0c86('0x46')]=function(_0x45cad9,_0x3b961d){return db[_0x0c86('0x1b')]['findOne']({'where':{'id':_0x45cad9[_0x0c86('0x44')]['id']},'raw':!![]})[_0x0c86('0x13')](function(_0x4a6cfc){if(!_0x4a6cfc)return _0x3b961d['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4a6cfc,_0x45cad9[_0x0c86('0x47')]['id'])};})[_0x0c86('0x13')](respondWithResult(_0x3b961d,null))['catch'](handleError(_0x3b961d,null));};exports[_0x0c86('0x48')]=function(_0x3fa123,_0x1daba5){var _0x4cbd3a=_0x3fa123['body'];var _0x3c771d;var _0x1f57a7;if(_0x4cbd3a[_0x0c86('0x49')])throw _0x4cbd3a;redis[_0x0c86('0x4a')](_0x4cbd3a['state'])[_0x0c86('0x13')](function(_0x38e06c){if(!_0x38e06c)throw new Error(_0x0c86('0x4b'));_0x3c771d=JSON[_0x0c86('0x4c')](_0x38e06c);var _0x4c7e81=Buffer[_0x0c86('0x4d')](_0x4cbd3a[_0x0c86('0x4e')],_0x0c86('0x4f'))[_0x0c86('0x50')](_0x0c86('0x51'));_0x1f57a7=JSON['parse'](_0x4c7e81);if(!oauth['isValidIdToken'](_0x4cbd3a['id_token'],_0x3c771d['oauth2Claims']))throw new Error(_0x0c86('0x52'));redis[_0x0c86('0x53')](_0x4cbd3a[_0x0c86('0x4e')]);return oauth[_0x0c86('0x54')](_0x4cbd3a[_0x0c86('0x55')],_0x3c771d);})[_0x0c86('0x13')](function(_0x1231da){_0x3c771d[_0x0c86('0x56')]=_0x1231da[_0x0c86('0x57')];_0x3c771d[_0x0c86('0x58')]=_0x1231da[_0x0c86('0x59')];return db['CloudProvider'][_0x0c86('0x12')]({'data5':_0x3c771d[_0x0c86('0x56')],'data6':_0x3c771d['data6']},{'where':{'id':_0x3c771d['id']}});})[_0x0c86('0x13')](function(){oauth['startRefreshInterval'](_0x3c771d);socket['emit'](_0x0c86('0x5a'),{'id':_0x1f57a7['id']});return;})[_0x0c86('0x13')](respondWithStatusCode(_0x1daba5,null))['catch'](function(_0x59ce20){if(_0x1f57a7){socket[_0x0c86('0x5b')](_0x0c86('0x5c'),{'id':_0x1f57a7['id']});}if(!_0x3c771d){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x59ce20);return _0x1daba5[_0x0c86('0xa')](0x1f4)[_0x0c86('0x17')](_0x59ce20['message']);}logger[_0x0c86('0x49')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3c771d['id'],JSON['stringify'](_0x59ce20));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b89cdb6..0e06182 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 _0xb72a=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d39b4,_0x245407){var _0x14bd1a=function(_0x57b4a3){while(--_0x57b4a3){_0x3d39b4['push'](_0x3d39b4['shift']());}};_0x14bd1a(++_0x245407);}(_0xb72a,0xb8));var _0xab72=function(_0x1e2eee,_0x468851){_0x1e2eee=_0x1e2eee-0x0;var _0x3f3320=_0xb72a[_0x1e2eee];return _0x3f3320;};'use strict';var _=require(_0xab72('0x0'));var util=require('util');var logger=require(_0xab72('0x1'))(_0xab72('0x2'));var moment=require('moment');var BPromise=require(_0xab72('0x3'));var rp=require(_0xab72('0x4'));var fs=require('fs');var path=require(_0xab72('0x5'));var rimraf=require(_0xab72('0x6'));var config=require(_0xab72('0x7'));var attributes=require(_0xab72('0x8'));module[_0xab72('0x9')]=function(_0x2611a1,_0x4ee67f){return _0x2611a1[_0xab72('0xa')](_0xab72('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1541=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','lodash','util','../../config/logger','api','moment'];(function(_0x205091,_0x5d0738){var _0x3b1348=function(_0x5b285b){while(--_0x5b285b){_0x205091['push'](_0x205091['shift']());}};_0x3b1348(++_0x5d0738);}(_0x1541,0xaf));var _0x1154=function(_0x102f97,_0x5bda2f){_0x102f97=_0x102f97-0x0;var _0xd22058=_0x1541[_0x102f97];return _0xd22058;};'use strict';var _=require(_0x1154('0x0'));var util=require(_0x1154('0x1'));var logger=require(_0x1154('0x2'))(_0x1154('0x3'));var moment=require(_0x1154('0x4'));var BPromise=require('bluebird');var rp=require(_0x1154('0x5'));var fs=require('fs');var path=require(_0x1154('0x6'));var rimraf=require(_0x1154('0x7'));var config=require(_0x1154('0x8'));var attributes=require(_0x1154('0x9'));module['exports']=function(_0x3b384d,_0x484005){return _0x3b384d[_0x1154('0xa')](_0x1154('0xb'),attributes,{'tableName':'cloud_providers','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 eb6c56e..118ac07 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 _0x498d=['../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','toString','base64','hex','data1','redirect_uri','data4','response_mode','scope','state','nonce','map','key','oauth2Claims','set','stringify','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','access_token','data6','update','catch','error','authorization_code','intervals','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../config/environment','../../config/logger','api'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x498d,0x8d));var _0xd498=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x498d[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0xd498('0x0'));var crypto=require(_0xd498('0x1'));var jwt=require(_0xd498('0x2'));var moment=require(_0xd498('0x3'));var Redis=require('ioredis');var rp=require(_0xd498('0x4'));var util=require(_0xd498('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0xd498('0x6'));var logger=require(_0xd498('0x7'))(_0xd498('0x8'));var schedule=require(_0xd498('0x9'));var db=require('../../mysqldb')['db'];config[_0xd498('0xa')]=_[_0xd498('0xb')](config[_0xd498('0xa')],{'host':_0xd498('0xc'),'port':0x18eb});var redis=new Redis(config[_0xd498('0xa')]);var MICROSOFT_AUTH_URL=_0xd498('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd498('0xe'),_0xd498('0xf'),_0xd498('0x10'),'offline_access',_0xd498('0x11'),_0xd498('0x12'),_0xd498('0x13')],'Dynamics365':[_0xd498('0xe'),_0xd498('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0xd498('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x143019){var _0x5eeee5=_['map'](AZURE_AUTH_SCOPES[_0x143019[_0xd498('0x16')]]);if(_0x143019['type']===_0xd498('0x17'))_0x5eeee5[_0xd498('0x18')](_0x143019[_0xd498('0x19')]+_0xd498('0x1a'));return _0x5eeee5[_0xd498('0x1b')]('\x20');}function getAccessTokenScope(_0x308231){if(_0x308231['type']===_0xd498('0x1c'))return _0xd498('0x11');if(_0x308231[_0xd498('0x16')]==='Dynamics365')return _0x308231[_0xd498('0x19')]+_0xd498('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1620af,_0xb1d108){var _0xc29a1d=MICROSOFT_AUTH_URL[_0xd498('0x1d')](_0xd498('0x1e'),_0x1620af[_0xd498('0x1f')]);var _0x3f1c4a=[_0xd498('0x20'),_0xd498('0x21')];var _0x45c3a5=Buffer['from'](JSON['stringify']({'id':_0xb1d108}))[_0xd498('0x22')](_0xd498('0x23'));var _0x27755c=crypto['randomBytes'](0x10)[_0xd498('0x22')](_0xd498('0x24'));var _0x5646a5=getAuthorizationScopes(_0x1620af);var _0x25dbcf=[{'key':'client_id','value':_0x1620af[_0xd498('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x3f1c4a['join']('\x20'))},{'key':_0xd498('0x26'),'value':_0x1620af[_0xd498('0x27')]},{'key':_0xd498('0x28'),'value':'form_post'},{'key':_0xd498('0x29'),'value':encodeURIComponent(_0x5646a5)},{'key':_0xd498('0x2a'),'value':_0x45c3a5},{'key':_0xd498('0x2b'),'value':_0x27755c},{'key':'prompt','value':'login'}];var _0x25ae1b=_0xc29a1d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd498('0x2c')](_0x25dbcf,function(_0x35a17c){return _0x35a17c[_0xd498('0x2d')]+'='+_0x35a17c['value'];})[_0xd498('0x1b')]('&');_0x1620af[_0xd498('0x2e')]={'issuer':_0xc29a1d[_0xd498('0x1d')]('oauth2/',''),'audience':_0x1620af[_0xd498('0x25')],'state':_0x45c3a5,'nonce':_0x27755c};redis[_0xd498('0x2f')](_0x45c3a5,JSON[_0xd498('0x30')](_0x1620af));return _0x25ae1b;}function isValidIdToken(_0x2849da,_0x420730){try{var _0x29d616=jwt[_0xd498('0x31')](_0x2849da,{'complete':!![]});var _0x4ccdd0=_0x29d616[_0xd498('0x32')];if(_0x4ccdd0[_0xd498('0x33')]!==_0x420730[_0xd498('0x34')])return![];if(_0x4ccdd0[_0xd498('0x35')]!==_0x420730[_0xd498('0x36')])return![];if(_0x4ccdd0['nonce']!==_0x420730['nonce'])return![];if(moment()[_0xd498('0x37')](moment[_0xd498('0x38')](_0x4ccdd0['exp'])))return![];return!![];}catch(_0xe787b1){throw _0xe787b1;}}function refreshOauth2MicrosoftAccessToken(_0x37ef26){return Promise[_0xd498('0x39')]()[_0xd498('0x3a')](function(){if(_0x37ef26[_0xd498('0x3b')])return _0x37ef26;return db[_0xd498('0x3c')][_0xd498('0x3d')]({'where':{'id':_0x37ef26['id']},'raw':!![]});})['then'](function(_0x4ebd75){var _0x284b6f={'grant_type':_0xd498('0x3e'),'refresh_token':_0x4ebd75['data6'],'scope':getAccessTokenScope(_0x4ebd75),'redirect_uri':_0x4ebd75[_0xd498('0x27')],'client_id':_0x4ebd75[_0xd498('0x25')],'client_secret':encryptor[_0xd498('0x3f')](_0x4ebd75[_0xd498('0x3b')])};var _0x1e74cf={'method':_0xd498('0x40'),'uri':MICROSOFT_AUTH_URL[_0xd498('0x1d')](_0xd498('0x1e'),_0x4ebd75[_0xd498('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x284b6f,'json':!![]};return rp(_0x1e74cf);})[_0xd498('0x3a')](function(_0x172a9e){_0x37ef26['data5']=_0x172a9e[_0xd498('0x41')];_0x37ef26[_0xd498('0x42')]=_0x172a9e['refresh_token'];return db[_0xd498('0x3c')][_0xd498('0x43')]({'data5':_0x37ef26['data5'],'data6':_0x37ef26[_0xd498('0x42')]},{'where':{'id':_0x37ef26['id']}});})['then'](function(){return _0x37ef26;})[_0xd498('0x44')](function(_0x47b5c4){logger[_0xd498('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x37ef26['id'],_0x47b5c4);});}function getOauth2MicrosoftAccessToken(_0x2b6b4a,_0x57a8f4){var _0x5c3f33={'grant_type':_0xd498('0x46'),'code':_0x2b6b4a,'scope':getAccessTokenScope(_0x57a8f4),'redirect_uri':_0x57a8f4[_0xd498('0x27')],'client_id':_0x57a8f4[_0xd498('0x25')],'client_secret':encryptor[_0xd498('0x3f')](_0x57a8f4[_0xd498('0x3b')])};var _0x39333f={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xd498('0x1d')](_0xd498('0x1e'),_0x57a8f4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c3f33,'json':!![]};return rp(_0x39333f);}function startRefreshInterval(_0x169d25){var _0x4f06bc=schedule[_0xd498('0x47')];if(_0x4f06bc[_0x169d25['id']])clearInterval(_0x4f06bc[_0x169d25['id']]);_0x4f06bc[_0x169d25['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x169d25['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd498('0x47')]=_0x4f06bc;}function startAllRefreshIntervals(){return db[_0xd498('0x3c')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x433a9a){var _0x34624c=_0x433a9a[_0xd498('0x2c')](function(_0x416b13){return refreshOauth2MicrosoftAccessToken(_0x416b13)[_0xd498('0x3a')](function(_0x1c27e7){startRefreshInterval(_0x1c27e7);});});return Promise['all'](_0x34624c);})[_0xd498('0x44')](function(_0x6093a9){var _0x240586=_0x6093a9?util[_0xd498('0x48')](_0x6093a9,{'showHidden':![],'depth':null}):'';logger[_0xd498('0x45')](_0xd498('0x49'),_0x240586);});}module[_0xd498('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xaeeb=['stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','scope','state','nonce','map','replace','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data2','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','[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','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','type','push','data7','/.default','join','Outlook365','Dynamics365','{TENANT_ID}','code','id_token','from'];(function(_0x9d5391,_0x12d6e9){var _0x331e74=function(_0x58b9cc){while(--_0x58b9cc){_0x9d5391['push'](_0x9d5391['shift']());}};_0x331e74(++_0x12d6e9);}(_0xaeeb,0x1a8));var _0xbaee=function(_0x1c4b8d,_0x146a41){_0x1c4b8d=_0x1c4b8d-0x0;var _0x203346=_0xaeeb[_0x1c4b8d];return _0x203346;};'use strict';var _=require(_0xbaee('0x0'));var crypto=require(_0xbaee('0x1'));var jwt=require(_0xbaee('0x2'));var moment=require(_0xbaee('0x3'));var Redis=require(_0xbaee('0x4'));var rp=require('request-promise');var util=require(_0xbaee('0x5'));var encryptor=require(_0xbaee('0x6'));var config=require('../../config/environment');var logger=require(_0xbaee('0x7'))(_0xbaee('0x8'));var schedule=require(_0xbaee('0x9'));var db=require(_0xbaee('0xa'))['db'];config[_0xbaee('0xb')]=_[_0xbaee('0xc')](config[_0xbaee('0xb')],{'host':_0xbaee('0xd'),'port':0x18eb});var redis=new Redis(config[_0xbaee('0xb')]);var MICROSOFT_AUTH_URL=_0xbaee('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbaee('0xf'),'profile',_0xbaee('0x10'),'offline_access',_0xbaee('0x11'),_0xbaee('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xbaee('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbaee('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xbaee('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x306a24){var _0x5a368a=_['map'](AZURE_AUTH_SCOPES[_0x306a24[_0xbaee('0x15')]]);if(_0x306a24[_0xbaee('0x15')]==='Dynamics365')_0x5a368a[_0xbaee('0x16')](_0x306a24[_0xbaee('0x17')]+_0xbaee('0x18'));return _0x5a368a[_0xbaee('0x19')]('\x20');}function getAccessTokenScope(_0xdbaf56){if(_0xdbaf56[_0xbaee('0x15')]===_0xbaee('0x1a'))return _0xbaee('0x11');if(_0xdbaf56[_0xbaee('0x15')]===_0xbaee('0x1b'))return _0xdbaf56[_0xbaee('0x17')]+_0xbaee('0x18');}function generateMicrosoftAuthorizationUrl(_0x2f437c,_0x307d1d){var _0x38254c=MICROSOFT_AUTH_URL['replace'](_0xbaee('0x1c'),_0x2f437c['data2']);var _0x46223f=[_0xbaee('0x1d'),_0xbaee('0x1e')];var _0x1f85d8=Buffer[_0xbaee('0x1f')](JSON[_0xbaee('0x20')]({'id':_0x307d1d}))[_0xbaee('0x21')](_0xbaee('0x22'));var _0x476010=crypto[_0xbaee('0x23')](0x10)[_0xbaee('0x21')](_0xbaee('0x24'));var _0x422651=getAuthorizationScopes(_0x2f437c);var _0x3bb58f=[{'key':_0xbaee('0x25'),'value':_0x2f437c[_0xbaee('0x26')]},{'key':_0xbaee('0x27'),'value':encodeURIComponent(_0x46223f[_0xbaee('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x2f437c[_0xbaee('0x28')]},{'key':_0xbaee('0x29'),'value':'form_post'},{'key':_0xbaee('0x2a'),'value':encodeURIComponent(_0x422651)},{'key':_0xbaee('0x2b'),'value':_0x1f85d8},{'key':_0xbaee('0x2c'),'value':_0x476010},{'key':'prompt','value':'login'}];var _0x3f6ed0=_0x38254c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbaee('0x2d')](_0x3bb58f,function(_0x44ee35){return _0x44ee35['key']+'='+_0x44ee35['value'];})['join']('&');_0x2f437c['oauth2Claims']={'issuer':_0x38254c[_0xbaee('0x2e')](_0xbaee('0x2f'),''),'audience':_0x2f437c['data1'],'state':_0x1f85d8,'nonce':_0x476010};redis[_0xbaee('0x30')](_0x1f85d8,JSON[_0xbaee('0x20')](_0x2f437c));return _0x3f6ed0;}function isValidIdToken(_0x46b25a,_0x532768){try{var _0x10559e=jwt[_0xbaee('0x31')](_0x46b25a,{'complete':!![]});var _0x5da55b=_0x10559e[_0xbaee('0x32')];if(_0x5da55b[_0xbaee('0x33')]!==_0x532768[_0xbaee('0x34')])return![];if(_0x5da55b['aud']!==_0x532768[_0xbaee('0x35')])return![];if(_0x5da55b[_0xbaee('0x2c')]!==_0x532768[_0xbaee('0x2c')])return![];if(moment()[_0xbaee('0x36')](moment[_0xbaee('0x37')](_0x5da55b[_0xbaee('0x38')])))return![];return!![];}catch(_0x5c5d05){throw _0x5c5d05;}}function refreshOauth2MicrosoftAccessToken(_0x5ba4c2){return Promise['resolve']()[_0xbaee('0x39')](function(){if(_0x5ba4c2[_0xbaee('0x3a')])return _0x5ba4c2;return db[_0xbaee('0x3b')][_0xbaee('0x3c')]({'where':{'id':_0x5ba4c2['id']},'raw':!![]});})[_0xbaee('0x39')](function(_0xabfa7c){var _0x2dd485={'grant_type':_0xbaee('0x3d'),'refresh_token':_0xabfa7c[_0xbaee('0x3e')],'scope':getAccessTokenScope(_0xabfa7c),'redirect_uri':_0xabfa7c[_0xbaee('0x28')],'client_id':_0xabfa7c['data1'],'client_secret':encryptor[_0xbaee('0x3f')](_0xabfa7c[_0xbaee('0x3a')])};var _0x2c7f24={'method':_0xbaee('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xbaee('0x1c'),_0xabfa7c[_0xbaee('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2dd485,'json':!![]};return rp(_0x2c7f24);})[_0xbaee('0x39')](function(_0x3673ea){_0x5ba4c2['data5']=_0x3673ea['access_token'];_0x5ba4c2[_0xbaee('0x3e')]=_0x3673ea['refresh_token'];return db[_0xbaee('0x3b')][_0xbaee('0x42')]({'data5':_0x5ba4c2[_0xbaee('0x43')],'data6':_0x5ba4c2[_0xbaee('0x3e')]},{'where':{'id':_0x5ba4c2['id']}});})[_0xbaee('0x39')](function(){return _0x5ba4c2;})[_0xbaee('0x44')](function(_0x53325a){logger[_0xbaee('0x45')](_0xbaee('0x46'),_0x5ba4c2['id'],_0x53325a);});}function getOauth2MicrosoftAccessToken(_0x4d916c,_0x1a2edd){var _0x3368f0={'grant_type':'authorization_code','code':_0x4d916c,'scope':getAccessTokenScope(_0x1a2edd),'redirect_uri':_0x1a2edd[_0xbaee('0x28')],'client_id':_0x1a2edd[_0xbaee('0x26')],'client_secret':encryptor['decryptString'](_0x1a2edd[_0xbaee('0x3a')])};var _0x24e1af={'method':_0xbaee('0x40'),'uri':MICROSOFT_AUTH_URL[_0xbaee('0x2e')](_0xbaee('0x1c'),_0x1a2edd[_0xbaee('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3368f0,'json':!![]};return rp(_0x24e1af);}function startRefreshInterval(_0x3a7342){var _0x676a93=schedule[_0xbaee('0x47')];if(_0x676a93[_0x3a7342['id']])clearInterval(_0x676a93[_0x3a7342['id']]);_0x676a93[_0x3a7342['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3a7342['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xbaee('0x47')]=_0x676a93;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xbaee('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xbaee('0x39')](function(_0x10e0a7){var _0x2fcfd2=_0x10e0a7['map'](function(_0x2ac7f0){return refreshOauth2MicrosoftAccessToken(_0x2ac7f0)[_0xbaee('0x39')](function(_0x3153df){startRefreshInterval(_0x3153df);});});return Promise[_0xbaee('0x49')](_0x2fcfd2);})['catch'](function(_0x7b5be3){var _0x17a09e=_0x7b5be3?util[_0xbaee('0x4a')](_0x7b5be3,{'showHidden':![],'depth':null}):'';logger['error'](_0xbaee('0x4b'),_0x17a09e);});}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 feb43da..46ff5b8 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 _0x8325=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','randomstring'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8325,0x1f1));var _0x5832=function(_0x43cc3f,_0x46621f){_0x43cc3f=_0x43cc3f-0x0;var _0x2266b0=_0x8325[_0x43cc3f];return _0x2266b0;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var moment=require(_0x5832('0x1'));var BPromise=require('bluebird');var rs=require(_0x5832('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5832('0x3'))['db'];var utils=require(_0x5832('0x4'));var logger=require(_0x5832('0x5'))(_0x5832('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5832('0x7')][_0x5832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b3b30,_0xe80d1d,_0xb4e9b9){return new BPromise(function(_0x333780,_0x495531){return client[_0x5832('0x9')](_0x8b3b30,_0xb4e9b9)[_0x5832('0xa')](function(_0x10192d){logger[_0x5832('0xb')](_0x5832('0xc'),_0xe80d1d,_0x5832('0xd'));logger[_0x5832('0xe')](_0x5832('0xf'),_0xe80d1d,_0x5832('0xd'),JSON['stringify'](_0x10192d));if(_0x10192d['error']){if(_0x10192d[_0x5832('0x10')][_0x5832('0x11')]===0x1f4){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error']['message']);return _0x495531(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error'][_0x5832('0x12')]);return _0x333780(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}else{logger[_0x5832('0xb')]('CloudProvider,\x20%s,\x20%s',_0xe80d1d,_0x5832('0xd'));_0x333780(_0x10192d[_0x5832('0x13')][_0x5832('0x12')]);}})['catch'](function(_0x32d360){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x32d360);_0x495531(_0x32d360);});});} \ No newline at end of file +var _0x6888=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x49db65,_0x596d19){var _0x3a8c31=function(_0x2f3246){while(--_0x2f3246){_0x49db65['push'](_0x49db65['shift']());}};_0x3a8c31(++_0x596d19);}(_0x6888,0xd2));var _0x8688=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6888[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var moment=require(_0x8688('0x1'));var BPromise=require(_0x8688('0x2'));var rs=require(_0x8688('0x3'));var fs=require('fs');var Redis=require(_0x8688('0x4'));var db=require(_0x8688('0x5'))['db'];var utils=require(_0x8688('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8688('0x7'));var jayson=require(_0x8688('0x8'));var client=jayson[_0x8688('0x9')][_0x8688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa1a28,_0xcc92be,_0x5860a8){return new BPromise(function(_0x457991,_0x15f2b9){return client[_0x8688('0xb')](_0xfa1a28,_0x5860a8)[_0x8688('0xc')](function(_0x18723c){logger['info']('CloudProvider,\x20%s,\x20%s',_0xcc92be,_0x8688('0xd'));logger[_0x8688('0xe')](_0x8688('0xf'),_0xcc92be,_0x8688('0xd'),JSON[_0x8688('0x10')](_0x18723c));if(_0x18723c[_0x8688('0x11')]){if(_0x18723c[_0x8688('0x11')][_0x8688('0x12')]===0x1f4){logger[_0x8688('0x11')]('CloudProvider,\x20%s,\x20%s',_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x15f2b9(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x457991(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}else{logger[_0x8688('0x15')](_0x8688('0x14'),_0xcc92be,'request\x20sent');_0x457991(_0x18723c[_0x8688('0x16')][_0x8688('0x13')]);}})[_0x8688('0x17')](function(_0x5ef2e6){logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x5ef2e6);_0x15f2b9(_0x5ef2e6);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 92d088d..c2bcbf1 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4ac424,_0x554b5d){var _0xe1b890=function(_0x5e85c4){while(--_0x5e85c4){_0x4ac424['push'](_0x4ac424['shift']());}};_0xe1b890(++_0x554b5d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54670b,_0x4a68ce){_0x54670b=_0x54670b-0x0;var _0x18df3b=_0x5f2f[_0x54670b];return _0x18df3b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0xd0afb1,_0x1700b6){var _0x3928ed=function(_0x51e09e){while(--_0x51e09e){_0xd0afb1['push'](_0xd0afb1['shift']());}};_0x3928ed(++_0x1700b6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 6477a9f..d568ee0 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 _0x9d0d=['sequelize','STRING','name'];(function(_0x53e6b9,_0x13b6ee){var _0x9a0e10=function(_0x24319e){while(--_0x24319e){_0x53e6b9['push'](_0x53e6b9['shift']());}};_0x9a0e10(++_0x13b6ee);}(_0x9d0d,0xe7));var _0xd9d0=function(_0x1f2cbb,_0x57921f){_0x1f2cbb=_0x1f2cbb-0x0;var _0x39041f=_0x9d0d[_0x1f2cbb];return _0x39041f;};'use strict';var Sequelize=require(_0xd9d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9d0('0x1')],'unique':_0xd9d0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd9d0('0x1')]},'companyId':{'type':Sequelize[_0xd9d0('0x1')]},'website':{'type':Sequelize[_0xd9d0('0x1')]},'phone':{'type':Sequelize[_0xd9d0('0x1')]},'fax':{'type':Sequelize[_0xd9d0('0x1')]},'type':{'type':Sequelize[_0xd9d0('0x1')]},'street':{'type':Sequelize[_0xd9d0('0x1')]},'postalCode':{'type':Sequelize[_0xd9d0('0x1')]},'city':{'type':Sequelize[_0xd9d0('0x1')]},'country':{'type':Sequelize[_0xd9d0('0x1')]},'email':{'type':Sequelize[_0xd9d0('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xd9d0('0x1')]},'sCity':{'type':Sequelize[_0xd9d0('0x1')]},'sCountry':{'type':Sequelize[_0xd9d0('0x1')]},'description':{'type':Sequelize[_0xd9d0('0x1')]}}; \ No newline at end of file +var _0xeaee=['name','STRING'];(function(_0x433ea1,_0x30559c){var _0x4e0fae=function(_0x567112){while(--_0x567112){_0x433ea1['push'](_0x433ea1['shift']());}};_0x4e0fae(++_0x30559c);}(_0xeaee,0x1c1));var _0xeeae=function(_0x500541,_0x1cb901){_0x500541=_0x500541-0x0;var _0x1de570=_0xeaee[_0x500541];return _0x1de570;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeeae('0x0')],'unique':_0xeeae('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xeeae('0x0')]},'companyId':{'type':Sequelize[_0xeeae('0x0')]},'website':{'type':Sequelize[_0xeeae('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xeeae('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xeeae('0x0')]},'country':{'type':Sequelize[_0xeeae('0x0')]},'email':{'type':Sequelize[_0xeeae('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xeeae('0x0')]},'sPostalCode':{'type':Sequelize[_0xeeae('0x0')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xeeae('0x0')]},'description':{'type':Sequelize[_0xeeae('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2ad0a4f..5019cfa 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 _0x1172=['rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','describe','model','query','keys','intersection','fields','attributes','sort','where','pick','filters','filter','merge','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','omit','getContacts','order','map','hasOwnProperty'];(function(_0x2c8d76,_0x367f6f){var _0x2eed52=function(_0xf0cea0){while(--_0xf0cea0){_0x2c8d76['push'](_0x2c8d76['shift']());}};_0x2eed52(++_0x367f6f);}(_0x1172,0x160));var _0x2117=function(_0x4841d0,_0x36c16f){_0x4841d0=_0x4841d0-0x0;var _0x551437=_0x1172[_0x4841d0];return _0x551437;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2117('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2117('0x1'));var rp=require(_0x2117('0x2'));var moment=require(_0x2117('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2117('0x4'));var util=require('util');var path=require(_0x2117('0x5'));var sox=require('sox');var csv=require(_0x2117('0x6'));var ejs=require(_0x2117('0x7'));var fs=require('fs');var fs_extra=require(_0x2117('0x8'));var _=require(_0x2117('0x9'));var squel=require('squel');var crypto=require(_0x2117('0xa'));var jsforce=require(_0x2117('0xb'));var deskjs=require(_0x2117('0xc'));var toCsv=require(_0x2117('0x6'));var querystring=require(_0x2117('0xd'));var Papa=require(_0x2117('0xe'));var Redis=require(_0x2117('0xf'));var authService=require(_0x2117('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2117('0x11'));var hardwareService=require(_0x2117('0x12'));var logger=require(_0x2117('0x13'))(_0x2117('0x14'));var utils=require('../../config/utils');var config=require(_0x2117('0x15'));var licenseUtil=require(_0x2117('0x16'));var db=require(_0x2117('0x17'))['db'];function respondWithStatusCode(_0x422f92,_0x1972d6){_0x1972d6=_0x1972d6||0xcc;return function(_0x214c1b){if(_0x214c1b){return _0x422f92['sendStatus'](_0x1972d6);}return _0x422f92[_0x2117('0x18')](_0x1972d6)['end']();};}function respondWithResult(_0x5cbb0f,_0x315568){_0x315568=_0x315568||0xc8;return function(_0x37e521){if(_0x37e521){return _0x5cbb0f[_0x2117('0x18')](_0x315568)[_0x2117('0x19')](_0x37e521);}};}function respondWithFilteredResult(_0x1ea5d5,_0x36244c){return function(_0x4ab20a){if(_0x4ab20a){var _0x58fe73=typeof _0x36244c[_0x2117('0x1a')]==='undefined'&&typeof _0x36244c[_0x2117('0x1b')]===_0x2117('0x1c');var _0xcf1da0=_0x4ab20a[_0x2117('0x1d')];var _0x464983=_0x58fe73?0x0:_0x36244c[_0x2117('0x1a')];var _0x28c2cb=_0x58fe73?_0x4ab20a['count']:_0x36244c[_0x2117('0x1a')]+_0x36244c[_0x2117('0x1b')];var _0x12c2b3;if(_0x28c2cb>=_0xcf1da0){_0x28c2cb=_0xcf1da0;_0x12c2b3=0xc8;}else{_0x12c2b3=0xce;}_0x1ea5d5[_0x2117('0x18')](_0x12c2b3);return _0x1ea5d5[_0x2117('0x1e')](_0x2117('0x1f'),_0x464983+'-'+_0x28c2cb+'/'+_0xcf1da0)[_0x2117('0x19')](_0x4ab20a);}return null;};}function patchUpdates(_0x26ff67){return function(_0x55d233){try{jsonpatch[_0x2117('0x20')](_0x55d233,_0x26ff67,!![]);}catch(_0x1c5c06){return BPromise[_0x2117('0x21')](_0x1c5c06);}return _0x55d233[_0x2117('0x22')]();};}function saveUpdates(_0x5bf9f0,_0x50d444){return function(_0x173769){if(_0x173769){return _0x173769['update'](_0x5bf9f0)[_0x2117('0x23')](function(_0x289751){return _0x289751;});}return null;};}function removeEntity(_0x52d9af,_0x5f3675){return function(_0x20864e){if(_0x20864e){return _0x20864e['destroy']()['then'](function(){var _0x84cdcf=_0x20864e[_0x2117('0x24')]({'plain':!![]});var _0x3ba559=_0x2117('0x25');return db[_0x2117('0x26')][_0x2117('0x27')]({'where':{'type':_0x3ba559,'resourceId':_0x84cdcf['id']}})['then'](function(){return _0x20864e;});})[_0x2117('0x23')](function(){_0x52d9af[_0x2117('0x18')](0xcc)[_0x2117('0x28')]();});}};}function handleEntityNotFound(_0x2f9b3c,_0x74a96f){return function(_0x3581a8){if(!_0x3581a8){_0x2f9b3c[_0x2117('0x29')](0x194);}return _0x3581a8;};}function handleError(_0x32088e,_0x2b42c5){_0x2b42c5=_0x2b42c5||0x1f4;return function(_0x3e3f2b){logger[_0x2117('0x2a')](_0x3e3f2b[_0x2117('0x2b')]);if(_0x3e3f2b['name']){delete _0x3e3f2b[_0x2117('0x2c')];}_0x32088e[_0x2117('0x18')](_0x2b42c5)[_0x2117('0x2d')](_0x3e3f2b);};}exports[_0x2117('0x2e')]=function(_0x44ba73,_0x17f2d7){var _0x39a779={},_0x4f659b={},_0x1e0498={'count':0x0,'rows':[]};return db['CmCompany'][_0x2117('0x2f')]()[_0x2117('0x23')](function(_0x2f0cb1){_0x4f659b[_0x2117('0x30')]=_['keys'](_0x2f0cb1);_0x4f659b[_0x2117('0x31')]=_[_0x2117('0x32')](_0x44ba73[_0x2117('0x31')]);_0x4f659b['filters']=_[_0x2117('0x33')](_0x4f659b[_0x2117('0x30')],_0x4f659b['query']);_0x39a779['attributes']=_['intersection'](_0x4f659b[_0x2117('0x30')],qs[_0x2117('0x34')](_0x44ba73[_0x2117('0x31')][_0x2117('0x34')]));_0x39a779[_0x2117('0x35')]=_0x39a779[_0x2117('0x35')]['length']?_0x39a779[_0x2117('0x35')]:_0x4f659b[_0x2117('0x30')];if(!_0x44ba73[_0x2117('0x31')]['hasOwnProperty']('nolimit')){_0x39a779[_0x2117('0x1b')]=qs[_0x2117('0x1b')](_0x44ba73[_0x2117('0x31')][_0x2117('0x1b')]);_0x39a779[_0x2117('0x1a')]=qs[_0x2117('0x1a')](_0x44ba73['query'][_0x2117('0x1a')]);}_0x39a779['order']=qs[_0x2117('0x36')](_0x44ba73[_0x2117('0x31')][_0x2117('0x36')]);_0x39a779[_0x2117('0x37')]=qs['filters'](_[_0x2117('0x38')](_0x44ba73[_0x2117('0x31')],_0x4f659b[_0x2117('0x39')]),_0x2f0cb1);if(_0x44ba73[_0x2117('0x31')][_0x2117('0x3a')]){_0x39a779[_0x2117('0x37')]=_[_0x2117('0x3b')](_0x39a779['where'],{'$or':_['map'](_0x39a779[_0x2117('0x35')],function(_0x6973fa){var _0x3c910f={};_0x3c910f[_0x6973fa]={'$like':'%'+_0x44ba73[_0x2117('0x31')][_0x2117('0x3a')]+'%'};return _0x3c910f;})});}_0x39a779=_[_0x2117('0x3b')]({},_0x39a779,_0x44ba73['options']);var _0x28e4f7={'where':_0x39a779[_0x2117('0x37')]};return db[_0x2117('0x3c')][_0x2117('0x1d')](_0x28e4f7)[_0x2117('0x23')](function(_0x5c37cb){_0x1e0498[_0x2117('0x1d')]=_0x5c37cb;if(_0x44ba73[_0x2117('0x31')][_0x2117('0x3d')]){_0x39a779['include']=[{'all':!![]}];}return db[_0x2117('0x3c')][_0x2117('0x3e')](_0x39a779);})[_0x2117('0x23')](function(_0x15e694){_0x1e0498[_0x2117('0x3f')]=_0x15e694;return _0x1e0498;})[_0x2117('0x23')](respondWithFilteredResult(_0x17f2d7,_0x39a779))[_0x2117('0x40')](handleError(_0x17f2d7,null));})[_0x2117('0x40')](handleError(_0x17f2d7,null));};exports[_0x2117('0x41')]=function(_0x73ba64,_0x51baa3){var _0xc99cf6={'raw':![],'where':{'id':_0x73ba64[_0x2117('0x42')]['id']}},_0x1151e0={};_0x1151e0[_0x2117('0x30')]=_[_0x2117('0x32')](db[_0x2117('0x3c')][_0x2117('0x43')]);_0x1151e0[_0x2117('0x31')]=_[_0x2117('0x32')](_0x73ba64['query']);_0x1151e0[_0x2117('0x39')]=_[_0x2117('0x33')](_0x1151e0['model'],_0x1151e0[_0x2117('0x31')]);_0xc99cf6['attributes']=_[_0x2117('0x33')](_0x1151e0[_0x2117('0x30')],qs[_0x2117('0x34')](_0x73ba64[_0x2117('0x31')][_0x2117('0x34')]));_0xc99cf6[_0x2117('0x35')]=_0xc99cf6[_0x2117('0x35')][_0x2117('0x44')]?_0xc99cf6[_0x2117('0x35')]:_0x1151e0[_0x2117('0x30')];if(_0x73ba64[_0x2117('0x31')][_0x2117('0x3d')]){_0xc99cf6['include']=[{'all':!![]}];}_0xc99cf6=_['merge']({},_0xc99cf6,_0x73ba64[_0x2117('0x45')]);return db['CmCompany'][_0x2117('0x46')](_0xc99cf6)[_0x2117('0x23')](handleEntityNotFound(_0x51baa3,null))[_0x2117('0x23')](respondWithResult(_0x51baa3,null))[_0x2117('0x40')](handleError(_0x51baa3,null));};exports[_0x2117('0x47')]=function(_0x5248de,_0x5cdbf8){return db['CmCompany']['create'](_0x5248de['body'],{})[_0x2117('0x23')](function(_0x717756){var _0x2ab6fe=_0x5248de[_0x2117('0x48')][_0x2117('0x24')]({'plain':!![]});if(!_0x2ab6fe)throw new Error(_0x2117('0x49'));if(_0x2ab6fe[_0x2117('0x4a')]===_0x2117('0x48')){var _0x229844=_0x717756[_0x2117('0x24')]({'plain':!![]});var _0xfeb6c4=_0x2117('0x25');return db['UserProfileSection']['find']({'where':{'name':_0xfeb6c4,'userProfileId':_0x2ab6fe[_0x2117('0x4b')]},'raw':!![]})[_0x2117('0x23')](function(_0x4422e8){if(_0x4422e8&&_0x4422e8[_0x2117('0x4c')]===0x0){return db[_0x2117('0x26')][_0x2117('0x47')]({'name':_0x229844[_0x2117('0x2c')],'resourceId':_0x229844['id'],'type':_0x4422e8[_0x2117('0x2c')],'sectionId':_0x4422e8['id']},{})[_0x2117('0x23')](function(){return _0x717756;});}else{return _0x717756;}})[_0x2117('0x40')](function(_0x109792){logger['error'](_0x2117('0x4d'),_0x109792);throw _0x109792;});}return _0x717756;})[_0x2117('0x23')](respondWithResult(_0x5cdbf8,0xc9))['catch'](handleError(_0x5cdbf8,null));};exports[_0x2117('0x4e')]=function(_0x2161bf,_0x8ec37a){if(_0x2161bf[_0x2117('0x4f')]['id']){delete _0x2161bf[_0x2117('0x4f')]['id'];}return db[_0x2117('0x3c')]['find']({'where':{'id':_0x2161bf[_0x2117('0x42')]['id']}})[_0x2117('0x23')](handleEntityNotFound(_0x8ec37a,null))['then'](saveUpdates(_0x2161bf[_0x2117('0x4f')],null))[_0x2117('0x23')](respondWithResult(_0x8ec37a,null))[_0x2117('0x40')](handleError(_0x8ec37a,null));};exports[_0x2117('0x27')]=function(_0x7a85e7,_0x41434a){return db[_0x2117('0x3c')][_0x2117('0x46')]({'where':{'id':_0x7a85e7[_0x2117('0x42')]['id']}})[_0x2117('0x23')](handleEntityNotFound(_0x41434a,null))[_0x2117('0x23')](removeEntity(_0x41434a,null))[_0x2117('0x40')](handleError(_0x41434a,null));};exports[_0x2117('0x2f')]=function(_0x5d743e,_0xff33e4){return db[_0x2117('0x3c')][_0x2117('0x2f')]()['then'](respondWithResult(_0xff33e4,null))[_0x2117('0x40')](handleError(_0xff33e4,null));};exports[_0x2117('0x50')]=function(_0x54c2d3,_0x59e2f7,_0x3a4a00){return db[_0x2117('0x51')][_0x2117('0x46')]({'where':{'id':_0x54c2d3[_0x2117('0x42')]['id']}})['then'](handleEntityNotFound(_0x59e2f7,null))[_0x2117('0x23')](function(_0x238bcf){if(_0x238bcf){return _0x238bcf[_0x2117('0x50')](_0x54c2d3[_0x2117('0x4f')][_0x2117('0x52')],_[_0x2117('0x53')](_0x54c2d3[_0x2117('0x4f')],[_0x2117('0x52'),'id'])||{});}})[_0x2117('0x23')](respondWithResult(_0x59e2f7,null))['catch'](handleError(_0x59e2f7,null));};exports[_0x2117('0x54')]=function(_0x53db18,_0x4c1d2f,_0x399606){var _0x58848f={};var _0x4dad6e={};var _0x19b7a4;var _0x2aa234;return db['CmCompany']['findOne']({'where':{'id':_0x53db18[_0x2117('0x42')]['id']}})[_0x2117('0x23')](handleEntityNotFound(_0x4c1d2f,null))[_0x2117('0x23')](function(_0xe7bab4){if(_0xe7bab4){_0x19b7a4=_0xe7bab4;_0x4dad6e[_0x2117('0x30')]=_[_0x2117('0x32')](db[_0x2117('0x51')][_0x2117('0x43')]);_0x4dad6e['query']=_[_0x2117('0x32')](_0x53db18[_0x2117('0x31')]);_0x4dad6e['filters']=_['intersection'](_0x4dad6e[_0x2117('0x30')],_0x4dad6e[_0x2117('0x31')]);_0x58848f['attributes']=_[_0x2117('0x33')](_0x4dad6e[_0x2117('0x30')],qs[_0x2117('0x34')](_0x53db18[_0x2117('0x31')]['fields']));_0x58848f[_0x2117('0x35')]=_0x58848f['attributes'][_0x2117('0x44')]?_0x58848f[_0x2117('0x35')]:_0x4dad6e[_0x2117('0x30')];_0x58848f[_0x2117('0x55')]=qs[_0x2117('0x36')](_0x53db18[_0x2117('0x31')][_0x2117('0x36')]);_0x58848f['where']=qs['filters'](_['pick'](_0x53db18[_0x2117('0x31')],_0x4dad6e[_0x2117('0x39')]));if(_0x53db18[_0x2117('0x31')]['filter']){_0x58848f[_0x2117('0x37')]=_['merge'](_0x58848f['where'],{'$or':_[_0x2117('0x56')](_0x58848f[_0x2117('0x35')],function(_0x2f2fac){var _0x596731={};_0x596731[_0x2f2fac]={'$like':'%'+_0x53db18[_0x2117('0x31')]['filter']+'%'};return _0x596731;})});}_0x58848f=_[_0x2117('0x3b')]({},_0x58848f,_0x53db18[_0x2117('0x45')]);return _0x19b7a4[_0x2117('0x54')](_0x58848f);}})['then'](function(_0x503432){if(_0x503432){_0x2aa234=_0x503432['length'];if(!_0x53db18['query'][_0x2117('0x57')]('nolimit')){_0x58848f[_0x2117('0x1b')]=qs[_0x2117('0x1b')](_0x53db18[_0x2117('0x31')][_0x2117('0x1b')]);_0x58848f[_0x2117('0x1a')]=qs[_0x2117('0x1a')](_0x53db18['query'][_0x2117('0x1a')]);}return _0x19b7a4[_0x2117('0x54')](_0x58848f);}})['then'](function(_0x468de7){if(_0x468de7){return _0x468de7?{'count':_0x2aa234,'rows':_0x468de7}:null;}})[_0x2117('0x23')](respondWithResult(_0x4c1d2f,null))[_0x2117('0x40')](handleError(_0x4c1d2f,null));}; \ No newline at end of file +var _0x533e=['params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','get','destroy','error','name','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x533e,0x10d));var _0xe533=function(_0x1b489f,_0xbe7814){_0x1b489f=_0x1b489f-0x0;var _0x4cdc4e=_0x533e[_0x1b489f];return _0x4cdc4e;};'use strict';var emlformat=require(_0xe533('0x0'));var rimraf=require(_0xe533('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe533('0x2'));var rp=require(_0xe533('0x3'));var moment=require(_0xe533('0x4'));var BPromise=require(_0xe533('0x5'));var Mustache=require('mustache');var util=require(_0xe533('0x6'));var path=require(_0xe533('0x7'));var sox=require(_0xe533('0x8'));var csv=require(_0xe533('0x9'));var ejs=require(_0xe533('0xa'));var fs=require('fs');var fs_extra=require(_0xe533('0xb'));var _=require('lodash');var squel=require(_0xe533('0xc'));var crypto=require(_0xe533('0xd'));var jsforce=require(_0xe533('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe533('0x9'));var querystring=require('querystring');var Papa=require(_0xe533('0xf'));var Redis=require(_0xe533('0x10'));var authService=require(_0xe533('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe533('0x12'));var hardwareService=require(_0xe533('0x13'));var logger=require(_0xe533('0x14'))(_0xe533('0x15'));var utils=require(_0xe533('0x16'));var config=require(_0xe533('0x17'));var licenseUtil=require(_0xe533('0x18'));var db=require(_0xe533('0x19'))['db'];function respondWithStatusCode(_0x347082,_0x54f445){_0x54f445=_0x54f445||0xcc;return function(_0x531a0f){if(_0x531a0f){return _0x347082[_0xe533('0x1a')](_0x54f445);}return _0x347082[_0xe533('0x1b')](_0x54f445)[_0xe533('0x1c')]();};}function respondWithResult(_0x41315f,_0x33400e){_0x33400e=_0x33400e||0xc8;return function(_0xdceb85){if(_0xdceb85){return _0x41315f[_0xe533('0x1b')](_0x33400e)['json'](_0xdceb85);}};}function respondWithFilteredResult(_0x4be399,_0x56634b){return function(_0x50fdbe){if(_0x50fdbe){var _0x1378c3=typeof _0x56634b[_0xe533('0x1d')]==='undefined'&&typeof _0x56634b[_0xe533('0x1e')]===_0xe533('0x1f');var _0xf379fc=_0x50fdbe['count'];var _0xe51230=_0x1378c3?0x0:_0x56634b[_0xe533('0x1d')];var _0x155e02=_0x1378c3?_0x50fdbe[_0xe533('0x20')]:_0x56634b[_0xe533('0x1d')]+_0x56634b[_0xe533('0x1e')];var _0x13b26c;if(_0x155e02>=_0xf379fc){_0x155e02=_0xf379fc;_0x13b26c=0xc8;}else{_0x13b26c=0xce;}_0x4be399[_0xe533('0x1b')](_0x13b26c);return _0x4be399['set'](_0xe533('0x21'),_0xe51230+'-'+_0x155e02+'/'+_0xf379fc)[_0xe533('0x22')](_0x50fdbe);}return null;};}function patchUpdates(_0x737f49){return function(_0x861da4){try{jsonpatch['apply'](_0x861da4,_0x737f49,!![]);}catch(_0x4d17a4){return BPromise['reject'](_0x4d17a4);}return _0x861da4[_0xe533('0x23')]();};}function saveUpdates(_0x36f88b,_0x4be864){return function(_0x3a5595){if(_0x3a5595){return _0x3a5595[_0xe533('0x24')](_0x36f88b)[_0xe533('0x25')](function(_0x1b5f00){return _0x1b5f00;});}return null;};}function removeEntity(_0x29b713,_0x1c43d6){return function(_0x6e33ff){if(_0x6e33ff){return _0x6e33ff['destroy']()[_0xe533('0x25')](function(){var _0x4233f9=_0x6e33ff[_0xe533('0x26')]({'plain':!![]});var _0x50f154='Companies';return db['UserProfileResource'][_0xe533('0x27')]({'where':{'type':_0x50f154,'resourceId':_0x4233f9['id']}})[_0xe533('0x25')](function(){return _0x6e33ff;});})[_0xe533('0x25')](function(){_0x29b713['status'](0xcc)[_0xe533('0x1c')]();});}};}function handleEntityNotFound(_0x5e8d52,_0x5aa5d8){return function(_0x28dfe7){if(!_0x28dfe7){_0x5e8d52[_0xe533('0x1a')](0x194);}return _0x28dfe7;};}function handleError(_0x2b5b61,_0x481a7c){_0x481a7c=_0x481a7c||0x1f4;return function(_0x101d43){logger[_0xe533('0x28')](_0x101d43['stack']);if(_0x101d43[_0xe533('0x29')]){delete _0x101d43['name'];}_0x2b5b61[_0xe533('0x1b')](_0x481a7c)['send'](_0x101d43);};}exports['index']=function(_0x5955b1,_0x1eb6cc){var _0x2425e0={},_0xe6b3a6={},_0x43c87f={'count':0x0,'rows':[]};return db[_0xe533('0x2a')][_0xe533('0x2b')]()[_0xe533('0x25')](function(_0x58a786){_0xe6b3a6['model']=_[_0xe533('0x2c')](_0x58a786);_0xe6b3a6[_0xe533('0x2d')]=_['keys'](_0x5955b1[_0xe533('0x2d')]);_0xe6b3a6[_0xe533('0x2e')]=_['intersection'](_0xe6b3a6[_0xe533('0x2f')],_0xe6b3a6[_0xe533('0x2d')]);_0x2425e0[_0xe533('0x30')]=_[_0xe533('0x31')](_0xe6b3a6['model'],qs[_0xe533('0x32')](_0x5955b1['query'][_0xe533('0x32')]));_0x2425e0[_0xe533('0x30')]=_0x2425e0['attributes'][_0xe533('0x33')]?_0x2425e0[_0xe533('0x30')]:_0xe6b3a6[_0xe533('0x2f')];if(!_0x5955b1[_0xe533('0x2d')][_0xe533('0x34')](_0xe533('0x35'))){_0x2425e0[_0xe533('0x1e')]=qs['limit'](_0x5955b1[_0xe533('0x2d')]['limit']);_0x2425e0['offset']=qs[_0xe533('0x1d')](_0x5955b1[_0xe533('0x2d')][_0xe533('0x1d')]);}_0x2425e0[_0xe533('0x36')]=qs[_0xe533('0x37')](_0x5955b1['query'][_0xe533('0x37')]);_0x2425e0[_0xe533('0x38')]=qs[_0xe533('0x2e')](_[_0xe533('0x39')](_0x5955b1[_0xe533('0x2d')],_0xe6b3a6['filters']),_0x58a786);if(_0x5955b1[_0xe533('0x2d')][_0xe533('0x3a')]){_0x2425e0['where']=_[_0xe533('0x3b')](_0x2425e0[_0xe533('0x38')],{'$or':_[_0xe533('0x3c')](_0x2425e0[_0xe533('0x30')],function(_0x5c9292){var _0x6650e7={};_0x6650e7[_0x5c9292]={'$like':'%'+_0x5955b1[_0xe533('0x2d')][_0xe533('0x3a')]+'%'};return _0x6650e7;})});}_0x2425e0=_['merge']({},_0x2425e0,_0x5955b1[_0xe533('0x3d')]);var _0x47f14f={'where':_0x2425e0[_0xe533('0x38')]};return db[_0xe533('0x2a')]['count'](_0x47f14f)[_0xe533('0x25')](function(_0x27df24){_0x43c87f[_0xe533('0x20')]=_0x27df24;if(_0x5955b1['query'][_0xe533('0x3e')]){_0x2425e0[_0xe533('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0xe533('0x40')](_0x2425e0);})['then'](function(_0x40a2be){_0x43c87f['rows']=_0x40a2be;return _0x43c87f;})['then'](respondWithFilteredResult(_0x1eb6cc,_0x2425e0))[_0xe533('0x41')](handleError(_0x1eb6cc,null));})[_0xe533('0x41')](handleError(_0x1eb6cc,null));};exports[_0xe533('0x42')]=function(_0x5a14ca,_0x1fadb7){var _0x8a9f0a={'raw':![],'where':{'id':_0x5a14ca[_0xe533('0x43')]['id']}},_0x1dfe78={};_0x1dfe78[_0xe533('0x2f')]=_[_0xe533('0x2c')](db[_0xe533('0x2a')]['rawAttributes']);_0x1dfe78[_0xe533('0x2d')]=_[_0xe533('0x2c')](_0x5a14ca[_0xe533('0x2d')]);_0x1dfe78[_0xe533('0x2e')]=_[_0xe533('0x31')](_0x1dfe78[_0xe533('0x2f')],_0x1dfe78[_0xe533('0x2d')]);_0x8a9f0a['attributes']=_['intersection'](_0x1dfe78[_0xe533('0x2f')],qs[_0xe533('0x32')](_0x5a14ca['query'][_0xe533('0x32')]));_0x8a9f0a[_0xe533('0x30')]=_0x8a9f0a[_0xe533('0x30')][_0xe533('0x33')]?_0x8a9f0a[_0xe533('0x30')]:_0x1dfe78[_0xe533('0x2f')];if(_0x5a14ca[_0xe533('0x2d')]['includeAll']){_0x8a9f0a['include']=[{'all':!![]}];}_0x8a9f0a=_[_0xe533('0x3b')]({},_0x8a9f0a,_0x5a14ca[_0xe533('0x3d')]);return db[_0xe533('0x2a')][_0xe533('0x44')](_0x8a9f0a)[_0xe533('0x25')](handleEntityNotFound(_0x1fadb7,null))['then'](respondWithResult(_0x1fadb7,null))[_0xe533('0x41')](handleError(_0x1fadb7,null));};exports[_0xe533('0x45')]=function(_0x2abda7,_0x288365){return db[_0xe533('0x2a')][_0xe533('0x45')](_0x2abda7[_0xe533('0x46')],{})[_0xe533('0x25')](function(_0x3ec108){var _0x15c574=_0x2abda7[_0xe533('0x47')]['get']({'plain':!![]});if(!_0x15c574)throw new Error(_0xe533('0x48'));if(_0x15c574[_0xe533('0x49')]===_0xe533('0x47')){var _0x1410fb=_0x3ec108['get']({'plain':!![]});var _0x3ef0e9=_0xe533('0x4a');return db[_0xe533('0x4b')][_0xe533('0x44')]({'where':{'name':_0x3ef0e9,'userProfileId':_0x15c574['userProfileId']},'raw':!![]})[_0xe533('0x25')](function(_0x49e99d){if(_0x49e99d&&_0x49e99d[_0xe533('0x4c')]===0x0){return db[_0xe533('0x4d')][_0xe533('0x45')]({'name':_0x1410fb['name'],'resourceId':_0x1410fb['id'],'type':_0x49e99d[_0xe533('0x29')],'sectionId':_0x49e99d['id']},{})[_0xe533('0x25')](function(){return _0x3ec108;});}else{return _0x3ec108;}})[_0xe533('0x41')](function(_0x47d5c5){logger[_0xe533('0x28')](_0xe533('0x4e'),_0x47d5c5);throw _0x47d5c5;});}return _0x3ec108;})[_0xe533('0x25')](respondWithResult(_0x288365,0xc9))[_0xe533('0x41')](handleError(_0x288365,null));};exports['update']=function(_0xd39f7f,_0x28cf65){if(_0xd39f7f[_0xe533('0x46')]['id']){delete _0xd39f7f[_0xe533('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0xd39f7f[_0xe533('0x43')]['id']}})['then'](handleEntityNotFound(_0x28cf65,null))[_0xe533('0x25')](saveUpdates(_0xd39f7f['body'],null))[_0xe533('0x25')](respondWithResult(_0x28cf65,null))[_0xe533('0x41')](handleError(_0x28cf65,null));};exports[_0xe533('0x27')]=function(_0x1ad0f5,_0x3e0ceb){return db[_0xe533('0x2a')]['find']({'where':{'id':_0x1ad0f5[_0xe533('0x43')]['id']}})[_0xe533('0x25')](handleEntityNotFound(_0x3e0ceb,null))[_0xe533('0x25')](removeEntity(_0x3e0ceb,null))[_0xe533('0x41')](handleError(_0x3e0ceb,null));};exports[_0xe533('0x2b')]=function(_0x36f9f1,_0x6e7b73){return db[_0xe533('0x2a')]['describe']()[_0xe533('0x25')](respondWithResult(_0x6e7b73,null))['catch'](handleError(_0x6e7b73,null));};exports[_0xe533('0x4f')]=function(_0x42e04e,_0x5c56d1,_0x115fd2){return db[_0xe533('0x50')][_0xe533('0x44')]({'where':{'id':_0x42e04e['params']['id']}})[_0xe533('0x25')](handleEntityNotFound(_0x5c56d1,null))[_0xe533('0x25')](function(_0x37be15){if(_0x37be15){return _0x37be15[_0xe533('0x4f')](_0x42e04e[_0xe533('0x46')]['ids'],_[_0xe533('0x51')](_0x42e04e[_0xe533('0x46')],['ids','id'])||{});}})[_0xe533('0x25')](respondWithResult(_0x5c56d1,null))['catch'](handleError(_0x5c56d1,null));};exports[_0xe533('0x52')]=function(_0x3f7a4e,_0x31e2c2,_0x55e7c6){var _0x46ff14={};var _0xfef7f4={};var _0x16c56b;var _0x140a3a;return db[_0xe533('0x2a')][_0xe533('0x53')]({'where':{'id':_0x3f7a4e[_0xe533('0x43')]['id']}})[_0xe533('0x25')](handleEntityNotFound(_0x31e2c2,null))[_0xe533('0x25')](function(_0x2a6115){if(_0x2a6115){_0x16c56b=_0x2a6115;_0xfef7f4['model']=_[_0xe533('0x2c')](db[_0xe533('0x50')]['rawAttributes']);_0xfef7f4['query']=_['keys'](_0x3f7a4e[_0xe533('0x2d')]);_0xfef7f4[_0xe533('0x2e')]=_[_0xe533('0x31')](_0xfef7f4['model'],_0xfef7f4[_0xe533('0x2d')]);_0x46ff14['attributes']=_['intersection'](_0xfef7f4[_0xe533('0x2f')],qs[_0xe533('0x32')](_0x3f7a4e['query'][_0xe533('0x32')]));_0x46ff14['attributes']=_0x46ff14[_0xe533('0x30')][_0xe533('0x33')]?_0x46ff14[_0xe533('0x30')]:_0xfef7f4[_0xe533('0x2f')];_0x46ff14[_0xe533('0x36')]=qs[_0xe533('0x37')](_0x3f7a4e[_0xe533('0x2d')]['sort']);_0x46ff14['where']=qs[_0xe533('0x2e')](_[_0xe533('0x39')](_0x3f7a4e[_0xe533('0x2d')],_0xfef7f4[_0xe533('0x2e')]));if(_0x3f7a4e[_0xe533('0x2d')][_0xe533('0x3a')]){_0x46ff14[_0xe533('0x38')]=_[_0xe533('0x3b')](_0x46ff14[_0xe533('0x38')],{'$or':_['map'](_0x46ff14[_0xe533('0x30')],function(_0x58685d){var _0x168ebb={};_0x168ebb[_0x58685d]={'$like':'%'+_0x3f7a4e[_0xe533('0x2d')][_0xe533('0x3a')]+'%'};return _0x168ebb;})});}_0x46ff14=_[_0xe533('0x3b')]({},_0x46ff14,_0x3f7a4e[_0xe533('0x3d')]);return _0x16c56b['getContacts'](_0x46ff14);}})[_0xe533('0x25')](function(_0x42bed5){if(_0x42bed5){_0x140a3a=_0x42bed5[_0xe533('0x33')];if(!_0x3f7a4e['query']['hasOwnProperty'](_0xe533('0x35'))){_0x46ff14[_0xe533('0x1e')]=qs[_0xe533('0x1e')](_0x3f7a4e[_0xe533('0x2d')][_0xe533('0x1e')]);_0x46ff14[_0xe533('0x1d')]=qs['offset'](_0x3f7a4e[_0xe533('0x2d')]['offset']);}return _0x16c56b[_0xe533('0x52')](_0x46ff14);}})['then'](function(_0x2140b7){if(_0x2140b7){return _0x2140b7?{'count':_0x140a3a,'rows':_0x2140b7}:null;}})['then'](respondWithResult(_0x31e2c2,null))[_0xe533('0x41')](handleError(_0x31e2c2,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9e0d233..3f1bd3e 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 _0x88cd=['../../config/logger','api','bluebird','request-promise','path','./cmCompany.attributes','exports','define','CmCompany','lodash','util'];(function(_0x507ec7,_0x52f9c6){var _0x2b7b8a=function(_0x1d614d){while(--_0x1d614d){_0x507ec7['push'](_0x507ec7['shift']());}};_0x2b7b8a(++_0x52f9c6);}(_0x88cd,0x195));var _0xd88c=function(_0x9af50,_0x5c200e){_0x9af50=_0x9af50-0x0;var _0x568c6c=_0x88cd[_0x9af50];return _0x568c6c;};'use strict';var _=require(_0xd88c('0x0'));var util=require(_0xd88c('0x1'));var logger=require(_0xd88c('0x2'))(_0xd88c('0x3'));var moment=require('moment');var BPromise=require(_0xd88c('0x4'));var rp=require(_0xd88c('0x5'));var fs=require('fs');var path=require(_0xd88c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd88c('0x7'));module[_0xd88c('0x8')]=function(_0x598cfb,_0x5c8685){return _0x598cfb[_0xd88c('0x9')](_0xd88c('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eac=['lodash','api','moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x225d44,_0x399b52){var _0x4aa98a=function(_0xeffa74){while(--_0xeffa74){_0x225d44['push'](_0x225d44['shift']());}};_0x4aa98a(++_0x399b52);}(_0x6eac,0x120));var _0xc6ea=function(_0x4e2b51,_0x41d4be){_0x4e2b51=_0x4e2b51-0x0;var _0x8a31b8=_0x6eac[_0x4e2b51];return _0x8a31b8;};'use strict';var _=require(_0xc6ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6ea('0x1'));var moment=require(_0xc6ea('0x2'));var BPromise=require(_0xc6ea('0x3'));var rp=require(_0xc6ea('0x4'));var fs=require('fs');var path=require(_0xc6ea('0x5'));var rimraf=require(_0xc6ea('0x6'));var config=require('../../config/environment');var attributes=require(_0xc6ea('0x7'));module[_0xc6ea('0x8')]=function(_0x4dc652,_0x324218){return _0x4dc652[_0xc6ea('0x9')](_0xc6ea('0xa'),attributes,{'tableName':_0xc6ea('0xb'),'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 855fdea..2b81732 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 _0x4637=['then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4637,0x1ec));var _0x7463=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4637[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x7463('0x0'));var util=require('util');var moment=require(_0x7463('0x1'));var BPromise=require(_0x7463('0x2'));var rs=require(_0x7463('0x3'));var fs=require('fs');var Redis=require(_0x7463('0x4'));var db=require(_0x7463('0x5'))['db'];var utils=require(_0x7463('0x6'));var logger=require(_0x7463('0x7'))(_0x7463('0x8'));var config=require(_0x7463('0x9'));var jayson=require(_0x7463('0xa'));var client=jayson[_0x7463('0xb')][_0x7463('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42d0a9,_0x28428c,_0x192b6e){return new BPromise(function(_0x5bb65e,_0x28dca5){return client[_0x7463('0xd')](_0x42d0a9,_0x192b6e)[_0x7463('0xe')](function(_0x1bc4b5){logger[_0x7463('0xf')]('CmCompany,\x20%s,\x20%s',_0x28428c,_0x7463('0x10'));logger['debug'](_0x7463('0x11'),_0x28428c,_0x7463('0x10'),JSON[_0x7463('0x12')](_0x1bc4b5));if(_0x1bc4b5['error']){if(_0x1bc4b5[_0x7463('0x13')]['code']===0x1f4){logger[_0x7463('0x13')](_0x7463('0x14'),_0x28428c,_0x1bc4b5[_0x7463('0x13')][_0x7463('0x15')]);return _0x28dca5(_0x1bc4b5[_0x7463('0x13')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x28428c,_0x1bc4b5['error'][_0x7463('0x15')]);return _0x5bb65e(_0x1bc4b5[_0x7463('0x13')][_0x7463('0x15')]);}else{logger[_0x7463('0xf')](_0x7463('0x14'),_0x28428c,'request\x20sent');_0x5bb65e(_0x1bc4b5[_0x7463('0x16')]['message']);}})['catch'](function(_0x75a631){logger[_0x7463('0x13')](_0x7463('0x14'),_0x28428c,_0x75a631);_0x28dca5(_0x75a631);});});} \ No newline at end of file +var _0x2856=['client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x384855,_0x4812f4){var _0x5d4471=function(_0x5f1b2d){while(--_0x5f1b2d){_0x384855['push'](_0x384855['shift']());}};_0x5d4471(++_0x4812f4);}(_0x2856,0xe8));var _0x6285=function(_0x584229,_0x11c7c9){_0x584229=_0x584229-0x0;var _0x334eae=_0x2856[_0x584229];return _0x334eae;};'use strict';var _=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var moment=require('moment');var BPromise=require(_0x6285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6285('0x3'))['db'];var utils=require(_0x6285('0x4'));var logger=require(_0x6285('0x5'))('rpc');var config=require(_0x6285('0x6'));var jayson=require(_0x6285('0x7'));var client=jayson[_0x6285('0x8')][_0x6285('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4abed5,_0x4470fb,_0x3dad04){return new BPromise(function(_0xc15f62,_0x5849de){return client[_0x6285('0xa')](_0x4abed5,_0x3dad04)[_0x6285('0xb')](function(_0xb005ee){logger[_0x6285('0xc')](_0x6285('0xd'),_0x4470fb,_0x6285('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x4470fb,_0x6285('0xe'),JSON['stringify'](_0xb005ee));if(_0xb005ee['error']){if(_0xb005ee['error'][_0x6285('0xf')]===0x1f4){logger[_0x6285('0x10')]('CmCompany,\x20%s,\x20%s',_0x4470fb,_0xb005ee[_0x6285('0x10')][_0x6285('0x11')]);return _0x5849de(_0xb005ee['error'][_0x6285('0x11')]);}logger[_0x6285('0x10')](_0x6285('0xd'),_0x4470fb,_0xb005ee[_0x6285('0x10')]['message']);return _0xc15f62(_0xb005ee[_0x6285('0x10')][_0x6285('0x11')]);}else{logger['info'](_0x6285('0xd'),_0x4470fb,'request\x20sent');_0xc15f62(_0xb005ee[_0x6285('0x12')]['message']);}})[_0x6285('0x13')](function(_0x4283c1){logger['error'](_0x6285('0xd'),_0x4470fb,_0x4283c1);_0x5849de(_0x4283c1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a9b2bec..b051a85 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 _0xf715=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','create','addContacts','delete','destroy','exports'];(function(_0x2de8dc,_0x17a7fb){var _0x5368f0=function(_0xf5b1b){while(--_0xf5b1b){_0x2de8dc['push'](_0x2de8dc['shift']());}};_0x5368f0(++_0x17a7fb);}(_0xf715,0x90));var _0x5f71=function(_0x3913d9,_0xeba18f){_0x3913d9=_0x3913d9-0x0;var _0x45e794=_0xf715[_0x3913d9];return _0x45e794;};'use strict';var multer=require('multer');var util=require(_0x5f71('0x0'));var path=require('path');var timeout=require(_0x5f71('0x1'));var express=require(_0x5f71('0x2'));var router=express[_0x5f71('0x3')]();var fs_extra=require(_0x5f71('0x4'));var auth=require(_0x5f71('0x5'));var interaction=require(_0x5f71('0x6'));var config=require('../../config/environment');var controller=require(_0x5f71('0x7'));router[_0x5f71('0x8')]('/',auth[_0x5f71('0x9')](),controller[_0x5f71('0xa')]);router[_0x5f71('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5f71('0xb')]);router[_0x5f71('0x8')](_0x5f71('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5f71('0x8')]('/:id/contacts',auth[_0x5f71('0x9')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0x5f71('0xd')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x5f71('0xe')]);router['put'](_0x5f71('0xc'),auth[_0x5f71('0x9')](),controller['update']);router[_0x5f71('0xf')](_0x5f71('0xc'),auth[_0x5f71('0x9')](),controller[_0x5f71('0x10')]);module[_0x5f71('0x11')]=router; \ No newline at end of file +var _0x4c0c=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','update','delete'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4c0c,0x98));var _0xc4c0=function(_0x4420da,_0x4c65fc){_0x4420da=_0x4420da-0x0;var _0x51f9c3=_0x4c0c[_0x4420da];return _0x51f9c3;};'use strict';var multer=require(_0xc4c0('0x0'));var util=require('util');var path=require(_0xc4c0('0x1'));var timeout=require(_0xc4c0('0x2'));var express=require(_0xc4c0('0x3'));var router=express[_0xc4c0('0x4')]();var fs_extra=require(_0xc4c0('0x5'));var auth=require(_0xc4c0('0x6'));var interaction=require(_0xc4c0('0x7'));var config=require(_0xc4c0('0x8'));var controller=require(_0xc4c0('0x9'));router[_0xc4c0('0xa')]('/',auth[_0xc4c0('0xb')](),controller[_0xc4c0('0xc')]);router[_0xc4c0('0xa')](_0xc4c0('0xd'),auth[_0xc4c0('0xb')](),controller[_0xc4c0('0xe')]);router[_0xc4c0('0xa')](_0xc4c0('0xf'),auth['isAuthenticated'](),controller[_0xc4c0('0x10')]);router[_0xc4c0('0xa')](_0xc4c0('0x11'),auth[_0xc4c0('0xb')](),controller[_0xc4c0('0x12')]);router[_0xc4c0('0x13')]('/',auth[_0xc4c0('0xb')](),controller['create']);router[_0xc4c0('0x13')](_0xc4c0('0x11'),auth['isAuthenticated'](),controller[_0xc4c0('0x14')]);router['put'](_0xc4c0('0xf'),auth[_0xc4c0('0xb')](),controller[_0xc4c0('0x15')]);router[_0xc4c0('0x16')](_0xc4c0('0xf'),auth[_0xc4c0('0xb')](),controller[_0xc4c0('0x17')]);module[_0xc4c0('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index bbaa213..f616a3a 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 _0x8cc0=['INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT'];(function(_0x4ccf04,_0x300c1f){var _0x50bc93=function(_0x517eba){while(--_0x517eba){_0x4ccf04['push'](_0x4ccf04['shift']());}};_0x50bc93(++_0x300c1f);}(_0x8cc0,0x173));var _0x08cc=function(_0x13cdbe,_0x540770){_0x13cdbe=_0x13cdbe-0x0;var _0x302e89=_0x8cc0[_0x13cdbe];return _0x302e89;};'use strict';var _=require(_0x08cc('0x0'));var Sequelize=require(_0x08cc('0x1'));module[_0x08cc('0x2')]={'firstName':{'type':Sequelize[_0x08cc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x08cc('0x3')]},'country':{'type':Sequelize[_0x08cc('0x3')]},'dateOfBirth':{'type':Sequelize[_0x08cc('0x3')]},'description':{'type':Sequelize[_0x08cc('0x4')]},'phone':{'type':Sequelize[_0x08cc('0x3')]},'mobile':{'type':Sequelize[_0x08cc('0x3')]},'fax':{'type':Sequelize[_0x08cc('0x3')]},'email':{'type':Sequelize[_0x08cc('0x3')]},'url':{'type':Sequelize[_0x08cc('0x3')]},'facebook':{'type':Sequelize[_0x08cc('0x3')]},'fb_data':{'type':Sequelize[_0x08cc('0x3')]},'twitter':{'type':Sequelize[_0x08cc('0x3')]},'skype':{'type':Sequelize[_0x08cc('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x08cc('0x3')]},'line':{'type':Sequelize[_0x08cc('0x3')]},'wechat':{'type':Sequelize[_0x08cc('0x3')]},'telegram':{'type':Sequelize[_0x08cc('0x3')]},'UserId':{'type':Sequelize[_0x08cc('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x08cc('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x08cc('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x08cc('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x08cc('0x3')]},'utcOffset':{'type':Sequelize[_0x08cc('0x5')]}}; \ No newline at end of file +var _0x3874=['INTEGER','lodash','sequelize','STRING','TEXT','UNSIGNED','NOW'];(function(_0x50ebca,_0xe8912b){var _0x513156=function(_0x1e2049){while(--_0x1e2049){_0x50ebca['push'](_0x50ebca['shift']());}};_0x513156(++_0xe8912b);}(_0x3874,0x1c8));var _0x4387=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3874[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x4387('0x0'));var Sequelize=require(_0x4387('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4387('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4387('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4387('0x2')]},'city':{'type':Sequelize[_0x4387('0x2')]},'country':{'type':Sequelize[_0x4387('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4387('0x2')]},'description':{'type':Sequelize[_0x4387('0x3')]},'phone':{'type':Sequelize[_0x4387('0x2')]},'mobile':{'type':Sequelize[_0x4387('0x2')]},'fax':{'type':Sequelize[_0x4387('0x2')]},'email':{'type':Sequelize[_0x4387('0x2')]},'url':{'type':Sequelize[_0x4387('0x2')]},'facebook':{'type':Sequelize[_0x4387('0x2')]},'fb_data':{'type':Sequelize[_0x4387('0x2')]},'twitter':{'type':Sequelize[_0x4387('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4387('0x2')]},'viber':{'type':Sequelize[_0x4387('0x2')]},'line':{'type':Sequelize[_0x4387('0x2')]},'wechat':{'type':Sequelize[_0x4387('0x2')]},'telegram':{'type':Sequelize[_0x4387('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x4387('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4387('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4387('0x5')]},'dialTimezone':{'type':Sequelize[_0x4387('0x2')]},'utcOffset':{'type':Sequelize[_0x4387('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5dc3c9f..dd16f89 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 _0xb5f8=['SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','length','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','hasOwnProperty','contact','all','show','Tag','Tags','ContactItemType','sequelize','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','isEmpty','table','cm_contacts','setFields','text','values','phone','getTags','rawAttributes','filters','model','attributes','intersection','order','sort','pick','merge','filter','options','nolimit','setTags','findOne','ids','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','CmHopperId','ItemType','literal','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','fields','ContactId','includeAll','include','rows','getHopperFinals','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','file','filename','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','meta','import','User','agent','binding','firstName','child_process','fork','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','mail','sms','fax','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','range','createdAt','findAndCountAll','startCase','chat','Website','closed','closedAt','disposition','secondDisposition','Account','key','Owner','color','browserName','customerIp','deviceModel','osName','ratingMessage','ratingValue','referer','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','moment','util','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','offset','undefined','limit','count','set','json','update','then','end','sendStatus','error','stack','name','index','getOptions','findAll','user','destroy','CmContact','find','params','describe','tags','keys','startsWith','cf_','columnName','displayName','query','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','catch','body','get','mergeWith','isArray','join','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction'];(function(_0x5e3f3d,_0x1f0ec7){var _0x1c7efc=function(_0x505e53){while(--_0x505e53){_0x5e3f3d['push'](_0x5e3f3d['shift']());}};_0x1c7efc(++_0x1f0ec7);}(_0xb5f8,0x1a6));var _0x8b5f=function(_0x418ce4,_0x1ec039){_0x418ce4=_0x418ce4-0x0;var _0x43ff44=_0xb5f8[_0x418ce4];return _0x43ff44;};'use strict';var moment=require(_0x8b5f('0x0'));var BPromise=require('bluebird');var util=require(_0x8b5f('0x1'));var path=require(_0x8b5f('0x2'));var fs=require('fs');var _=require(_0x8b5f('0x3'));var squel=require(_0x8b5f('0x4'));var Papa=require(_0x8b5f('0x5'));var Redis=require('ioredis');var contacts=require(_0x8b5f('0x6'));var qs=require(_0x8b5f('0x7'));var logger=require('../../config/logger')(_0x8b5f('0x8'));var config=require(_0x8b5f('0x9'));var shared=require(_0x8b5f('0xa'));var db=require(_0x8b5f('0xb'))['db'];config[_0x8b5f('0xc')]=_[_0x8b5f('0xd')](config[_0x8b5f('0xc')],{'host':_0x8b5f('0xe'),'port':0x18eb});var socket=require(_0x8b5f('0xf'))(new Redis(config[_0x8b5f('0xc')]));require(_0x8b5f('0x10'))['register'](socket);function respondWithResult(_0x4df410,_0x3be3a4){_0x3be3a4=_0x3be3a4||0xc8;return function(_0x548384){if(_0x548384){return _0x4df410[_0x8b5f('0x11')](_0x3be3a4)['json'](_0x548384);}};}function respondWithFilteredResult(_0x57a6e5,_0x1e0178){return function(_0x58f135){if(_0x58f135){var _0xd5e1f1=typeof _0x1e0178[_0x8b5f('0x12')]===_0x8b5f('0x13')&&typeof _0x1e0178[_0x8b5f('0x14')]===_0x8b5f('0x13');var _0x5cbcc7=_0x58f135[_0x8b5f('0x15')];var _0x55a52e=_0xd5e1f1?0x0:_0x1e0178[_0x8b5f('0x12')];var _0xfb1935=_0xd5e1f1?_0x58f135[_0x8b5f('0x15')]:_0x1e0178[_0x8b5f('0x12')]+_0x1e0178[_0x8b5f('0x14')];var _0x3ca4af;if(_0xfb1935>=_0x5cbcc7){_0xfb1935=_0x5cbcc7;_0x3ca4af=0xc8;}else{_0x3ca4af=0xce;}_0x57a6e5[_0x8b5f('0x11')](_0x3ca4af);return _0x57a6e5[_0x8b5f('0x16')]('Content-Range',_0x55a52e+'-'+_0xfb1935+'/'+_0x5cbcc7)[_0x8b5f('0x17')](_0x58f135);}return null;};}function saveUpdates(_0x315347){return function(_0xfb1618){if(_0xfb1618){return _0xfb1618[_0x8b5f('0x18')](_0x315347)[_0x8b5f('0x19')](function(_0x15ccad){return _0x15ccad;});}return null;};}function removeEntity(_0x5203d3){return function(_0x19331c){if(_0x19331c){return _0x19331c['destroy']()[_0x8b5f('0x19')](function(){_0x5203d3[_0x8b5f('0x11')](0xcc)[_0x8b5f('0x1a')]();});}};}function handleEntityNotFound(_0x4013c9){return function(_0x3cebad){if(!_0x3cebad){_0x4013c9[_0x8b5f('0x1b')](0x194);}return _0x3cebad;};}function handleError(_0x355fe2,_0x543331){_0x543331=_0x543331||0x1f4;return function(_0x20219b){logger[_0x8b5f('0x1c')](_0x20219b[_0x8b5f('0x1d')]);if(_0x20219b[_0x8b5f('0x1e')]){delete _0x20219b[_0x8b5f('0x1e')];}_0x355fe2[_0x8b5f('0x11')](_0x543331)['send'](_0x20219b);};}exports[_0x8b5f('0x1f')]=function(_0xd11335,_0x47396f){var _0x161ede={};return contacts['describe']()[_0x8b5f('0x19')](function(_0x189fb4){_0x161ede=qs[_0x8b5f('0x20')](_0x189fb4,_0xd11335);return contacts[_0x8b5f('0x21')](_0xd11335['query'],_0xd11335[_0x8b5f('0x22')],_0x161ede,_0x189fb4);})[_0x8b5f('0x19')](respondWithFilteredResult(_0x47396f,_0x161ede))['catch'](handleError(_0x47396f,null));};exports[_0x8b5f('0x23')]=function(_0x293844,_0x4a0d3c){return db[_0x8b5f('0x24')][_0x8b5f('0x25')]({'where':{'id':_0x293844[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x4a0d3c,null))[_0x8b5f('0x19')](removeEntity(_0x4a0d3c,null))['catch'](handleError(_0x4a0d3c,null));};exports[_0x8b5f('0x27')]=function(_0x5d1531,_0x3ad54d){return db['CmContact'][_0x8b5f('0x27')]()[_0x8b5f('0x19')](function(_0x2c7ab5){delete _0x2c7ab5[_0x8b5f('0x28')];for(var _0x4c6820=0x0;_0x4c68200x0){return new Promise(function(_0x7f3b84){var _0x4e3766=[];for(var _0x51f172=0x0;_0x51f172<_0x5b1454[_0x8b5f('0x51')];_0x51f172++){_0x4e3766[_0x8b5f('0x5c')](insertAdditionalPhones(_0x5b1454[_0x51f172][_0x8b5f('0x60')],_0x5b1454[_0x51f172][_0x8b5f('0x56')]));}Promise[_0x8b5f('0x61')](_0x4e3766)[_0x8b5f('0x19')](function(){_0x7f3b84(0x1);});})[_0x8b5f('0x19')](function(){return{'success':_0x55d395,'failure':_0x3e749b,'duplicates':_0x2609fb};});}else{return{'success':_0x55d395,'failure':_0x3e749b,'duplicates':_0x2609fb};}}})['then'](respondWithResult(_0x509010,0xc9))[_0x8b5f('0x33')](handleError(_0x509010,null));};exports[_0x8b5f('0x62')]=function(_0x308378,_0x5978de){var _0x135c7c;return db['CmContact'][_0x8b5f('0x27')]()[_0x8b5f('0x19')](function(_0x2083ae){return db[_0x8b5f('0x24')]['find']({'where':{'id':_0x308378['params']['id']},'include':[{'model':db[_0x8b5f('0x63')],'as':_0x8b5f('0x64'),'attributes':['id','name','color'],'required':_0x308378['query']['tag']?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x308378[_0x8b5f('0x26')]['id']},'required':![],'include':[{'model':db[_0x8b5f('0x65')],'as':'ItemType'}]}],'order':[db[_0x8b5f('0x66')]['literal'](_0x8b5f('0x67'))],'attributes':_[_0x8b5f('0x29')](_0x2083ae)});})['then'](function(_0x44f092){if(!_['isNil'](_0x44f092)){_0x135c7c=_0x44f092[_0x8b5f('0x35')]({'plain':!![]});var _0x4fc2cc={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x44f092&&_0x44f092[_0x8b5f('0x5d')]){if(_0x44f092[_0x8b5f('0x5d')]){_0x4fc2cc[_0x8b5f('0x5a')][_0x8b5f('0x68')][_0x8b5f('0x5c')]({'ListId':{'$ne':_0x44f092[_0x8b5f('0x5d')]}});}}return db[_0x8b5f('0x69')][_0x8b5f('0x21')](_0x4fc2cc);}})[_0x8b5f('0x19')](function(_0x4d44f8){if(!_['isNil'](_0x4d44f8)){return _[_0x8b5f('0x6a')](_0x135c7c,_[_0x8b5f('0x6b')](_0x4d44f8,function(_0x2f1fe1){return util['format'](_0x8b5f('0x6c'),_0x2f1fe1['id']);}));}})['then'](handleEntityNotFound(_0x5978de,null))[_0x8b5f('0x19')](respondWithResult(_0x5978de,null))[_0x8b5f('0x33')](handleError(_0x5978de,null));};exports[_0x8b5f('0x18')]=function(_0x518803,_0x5c0d74){var _0x333455;if(_0x518803[_0x8b5f('0x34')]['id']){delete _0x518803[_0x8b5f('0x34')]['id'];}if(!_[_0x8b5f('0x52')](_0x518803[_0x8b5f('0x34')][_0x8b5f('0x53')])){var _0x5b386f=_0x518803[_0x8b5f('0x34')][_0x8b5f('0x53')];if(!_['isNil'](shared[_0x8b5f('0x54')][_0x5b386f]))_0x518803[_0x8b5f('0x34')][_0x8b5f('0x55')]=shared[_0x8b5f('0x54')][_0x5b386f]['utcOffset'];}return db[_0x8b5f('0x24')][_0x8b5f('0x25')]({'where':{'id':_0x518803[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x5c0d74,null))['then'](saveUpdates(_0x518803[_0x8b5f('0x34')],null))[_0x8b5f('0x19')](function(_0x55881b){_0x333455=_0x55881b;var _0x236122={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x55881b&&_0x55881b['ListId']){if(_0x55881b['ListId']){_0x236122[_0x8b5f('0x5a')][_0x8b5f('0x68')][_0x8b5f('0x5c')]({'ListId':{'$ne':_0x55881b[_0x8b5f('0x5d')]}});}}return db[_0x8b5f('0x69')][_0x8b5f('0x21')](_0x236122);})[_0x8b5f('0x19')](function(_0x3ee7c7){if(_0x3ee7c7){return _['omit'](_['pickBy'](_0x518803[_0x8b5f('0x34')],function(_0x55be58,_0x3ced76){return _[_0x8b5f('0x2a')](_0x3ced76,_0x8b5f('0x2b'));}),_[_0x8b5f('0x6b')](_0x3ee7c7,function(_0x57e19b){return util['format'](_0x8b5f('0x6c'),_0x57e19b['id']);}));}})[_0x8b5f('0x19')](function(_0x3a48ae){if(_0x3a48ae&&!_[_0x8b5f('0x6d')](_0x3a48ae)){var _0x5a5e9a=squel[_0x8b5f('0x18')]()[_0x8b5f('0x6e')](_0x8b5f('0x6f'))[_0x8b5f('0x70')](_0x3a48ae)[_0x8b5f('0x5a')]('id\x20=\x20?',_0x518803[_0x8b5f('0x26')]['id'])['toParam']();return db[_0x8b5f('0x66')]['query'](_0x5a5e9a[_0x8b5f('0x71')],{'replacements':_0x5a5e9a[_0x8b5f('0x72')]});}})['then'](function(){if(_0x518803[_0x8b5f('0x34')]['phone']&&_0x333455){return db['CmHopper']['update']({'phone':_0x518803[_0x8b5f('0x34')][_0x8b5f('0x73')],'OrderBy':0x0},{'where':{'ContactId':_0x333455['id']}});}})[_0x8b5f('0x19')](function(){return _0x333455;})[_0x8b5f('0x19')](respondWithResult(_0x5c0d74,null))['catch'](handleError(_0x5c0d74,null));};exports[_0x8b5f('0x74')]=function(_0x14de2f,_0x4a6236){var _0x2229d1={};var _0x55235b={};var _0x586ec8;var _0x21e611;return db[_0x8b5f('0x24')]['findOne']({'where':{'id':_0x14de2f[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x4a6236,null))[_0x8b5f('0x19')](function(_0x210fe7){if(_0x210fe7){_0x586ec8=_0x210fe7;_0x55235b['model']=_[_0x8b5f('0x29')](db[_0x8b5f('0x63')][_0x8b5f('0x75')]);_0x55235b['query']=_[_0x8b5f('0x29')](_0x14de2f[_0x8b5f('0x2e')]);_0x55235b[_0x8b5f('0x76')]=_['intersection'](_0x55235b[_0x8b5f('0x77')],_0x55235b['query']);_0x2229d1[_0x8b5f('0x78')]=_[_0x8b5f('0x79')](_0x55235b[_0x8b5f('0x77')],qs['fields'](_0x14de2f['query']['fields']));_0x2229d1['attributes']=_0x2229d1['attributes'][_0x8b5f('0x51')]?_0x2229d1['attributes']:_0x55235b[_0x8b5f('0x77')];_0x2229d1[_0x8b5f('0x7a')]=qs[_0x8b5f('0x7b')](_0x14de2f['query'][_0x8b5f('0x7b')]);_0x2229d1[_0x8b5f('0x5a')]=qs[_0x8b5f('0x76')](_[_0x8b5f('0x7c')](_0x14de2f[_0x8b5f('0x2e')],_0x55235b[_0x8b5f('0x76')]));if(_0x14de2f['query']['filter']){_0x2229d1['where']=_[_0x8b5f('0x7d')](_0x2229d1[_0x8b5f('0x5a')],{'$or':_[_0x8b5f('0x6b')](_0x2229d1[_0x8b5f('0x78')],function(_0x1086f9){var _0xb8215f={};_0xb8215f[_0x1086f9]={'$like':'%'+_0x14de2f[_0x8b5f('0x2e')][_0x8b5f('0x7e')]+'%'};return _0xb8215f;})});}_0x2229d1=_[_0x8b5f('0x7d')]({},_0x2229d1,_0x14de2f[_0x8b5f('0x7f')]);return _0x586ec8[_0x8b5f('0x74')](_0x2229d1);}})[_0x8b5f('0x19')](function(_0x44b71b){if(_0x44b71b){_0x21e611=_0x44b71b['length'];if(!_0x14de2f['query'][_0x8b5f('0x5f')](_0x8b5f('0x80'))){_0x2229d1[_0x8b5f('0x14')]=qs['limit'](_0x14de2f[_0x8b5f('0x2e')][_0x8b5f('0x14')]);_0x2229d1['offset']=qs['offset'](_0x14de2f[_0x8b5f('0x2e')][_0x8b5f('0x12')]);}return _0x586ec8[_0x8b5f('0x74')](_0x2229d1);}})['then'](function(_0x50428e){if(_0x50428e){return _0x50428e?{'count':_0x21e611,'rows':_0x50428e}:null;}})['then'](respondWithResult(_0x4a6236,null))['catch'](handleError(_0x4a6236,null));};exports[_0x8b5f('0x81')]=function(_0x52d386,_0x371a34){if(_0x52d386[_0x8b5f('0x34')]['id']){delete _0x52d386['body']['id'];}return db[_0x8b5f('0x24')][_0x8b5f('0x82')]({'where':{'id':_0x52d386[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x371a34,null))[_0x8b5f('0x19')](function(_0x20d8b5){if(_0x20d8b5){return _0x20d8b5['setTags'](_0x52d386[_0x8b5f('0x34')][_0x8b5f('0x83')]||[]);}return null;})['then'](respondWithResult(_0x371a34,null))[_0x8b5f('0x33')](handleError(_0x371a34,null));};exports['setAdditionalPhones']=function(_0x18de68,_0x28baf1){var _0x49ccea=[];_0x49ccea[_0x8b5f('0x5c')](addAdditionalPhones(_0x18de68[_0x8b5f('0x34')]));Promise[_0x8b5f('0x61')](_0x49ccea)[_0x8b5f('0x19')](function(){_0x49ccea=[];_0x49ccea[_0x8b5f('0x5c')](deleteCmHopperPhones(_0x18de68[_0x8b5f('0x34')]['id']));_0x49ccea[_0x8b5f('0x5c')](addCmHopperPhones(_0x18de68[_0x8b5f('0x34')]['id']));Promise[_0x8b5f('0x61')](_0x49ccea)['then'](function(){return[0x1];})[_0x8b5f('0x19')](respondWithResult(_0x28baf1,null));});};function addAdditionalPhones(_0x5ea0ec){var _0x274d43;return new Promise(function(_0x3cd57c){return db[_0x8b5f('0x48')][_0x8b5f('0x23')]({'where':{'CmContactId':_0x5ea0ec['id']}})[_0x8b5f('0x19')](function(){db[_0x8b5f('0x65')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x1dd45c){var _0x5324ea=[];for(var _0x4b4856=0x0;_0x4b4856<_0x5ea0ec[_0x8b5f('0x84')][_0x8b5f('0x51')];_0x4b4856++){var _0x229075=_0x5ea0ec[_0x8b5f('0x85')]?_[_0x8b5f('0x52')](_0x5ea0ec[_0x8b5f('0x85')][_0x4b4856])?'':_0x5ea0ec[_0x8b5f('0x85')][_0x4b4856]:_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856]['ItemTypeId']?_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856][_0x8b5f('0x86')]:'';var _0x154533=_[_0x8b5f('0x52')](_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856]['description'])?'':_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856][_0x8b5f('0x87')];var _0x278089=_0x229075+':'+_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856]['phone']+'§'+_0x154533;if(_['isNil'](_0x274d43))_0x274d43=_0x278089;else _0x274d43+=';'+_0x278089;var _0x32645a=null;var _0x1f0a8f=null;if(_0x5ea0ec[_0x8b5f('0x85')]){if(!_[_0x8b5f('0x52')](_0x5ea0ec[_0x8b5f('0x85')][_0x4b4856])){_0x1f0a8f=_[_0x8b5f('0x25')](_0x1dd45c,function(_0x29adc0){return _0x29adc0['id']===_0x5ea0ec['item_types'][_0x4b4856];});if(!_[_0x8b5f('0x52')](_0x1f0a8f)){_0x32645a=_0x1f0a8f[_0x8b5f('0x88')];}}}else{if(!_[_0x8b5f('0x52')](_0x5ea0ec['items'][_0x4b4856])){_0x1f0a8f=_[_0x8b5f('0x25')](_0x1dd45c,function(_0x4de8d9){return _0x4de8d9['id']===_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856][_0x8b5f('0x86')];});if(!_[_0x8b5f('0x52')](_0x1f0a8f)){_0x32645a=_0x4b4856;}}}if(_[_0x8b5f('0x52')](_0x32645a)){_0x32645a=0x64;}_0x5324ea['push'](addAdditionalPhone(_0x5ea0ec['id'],_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856][_0x8b5f('0x73')],_0x5ea0ec[_0x8b5f('0x85')]?_[_0x8b5f('0x52')](_0x5ea0ec[_0x8b5f('0x85')][_0x4b4856])?null:_0x5ea0ec[_0x8b5f('0x85')][_0x4b4856]:_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856][_0x8b5f('0x86')]?_0x5ea0ec[_0x8b5f('0x84')][_0x4b4856]['ItemTypeId']:null,_0x32645a,_0x154533));}Promise[_0x8b5f('0x61')](_0x5324ea)['then'](function(){db['CmContact']['update']({'AdditionalPhones':_0x274d43},{'where':{'id':_0x5ea0ec['id']}})[_0x8b5f('0x19')](function(){_0x3cd57c(0x1);});});});});});}function addAdditionalPhone(_0x561e95,_0x343e84,_0x35a8b6,_0x52ef11,_0x5a3d86){return db['CmContactHasItem'][_0x8b5f('0x25')]({'where':{'CmContactId':_0x561e95,'item':_0x343e84}})['then'](function(_0x3f3241){if(_0x3f3241)logger[_0x8b5f('0x30')](_0x8b5f('0x89'),_0x3f3241);else{db['CmContactHasItem'][_0x8b5f('0x3e')]({'CmContactId':_0x561e95,'item':_0x343e84,'ItemTypeId':_0x35a8b6,'OrderBy':_0x52ef11,'ItemClass':'PHONE','description':_0x5a3d86});}});}function deleteCmHopperPhones(_0x4aaac4){return new Promise(function(_0x5854fa){return db[_0x8b5f('0x3a')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4aaac4}})[_0x8b5f('0x19')](function(_0x200f8c){db[_0x8b5f('0x8a')][_0x8b5f('0x23')]({'where':{'CmHopperId':{'$in':_[_0x8b5f('0x6b')](_0x200f8c,'id')}}});})['then'](function(){_0x5854fa(0x1);});});}function addCmHopperPhones(_0x4499d4){return new Promise(function(_0x13adcf){return db['CmHopper'][_0x8b5f('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4499d4}})[_0x8b5f('0x19')](function(_0x455c8d){var _0xfed580=[];_[_0x8b5f('0x6b')](_0x455c8d,function(_0x56b1fc){_0xfed580['push'](createCmHopperPhone(_0x4499d4,_0x56b1fc['id']));});Promise['all'](_0xfed580)[_0x8b5f('0x19')](function(){_0x13adcf(0x1);});});});}function createCmHopperPhone(_0x1ff81f,_0x5063be){return new Promise(function(_0x3cff68){db[_0x8b5f('0x48')]['findAll']({'raw':!![],'attributes':[_0x8b5f('0x8b'),_0x8b5f('0x88')],'where':{'CmContactId':_0x1ff81f,'ItemClass':_0x8b5f('0x8c')},'include':[{'model':db[_0x8b5f('0x65')],'attributes':[_0x8b5f('0x88')],'as':'ItemType'}],'order':[_0x8b5f('0x88'),db[_0x8b5f('0x66')]['literal']('`ItemType`.OrderBy')]})[_0x8b5f('0x19')](function(_0x2a9cde){var _0x858038=0x1;var _0x5ae7e3=_['map'](_0x2a9cde,function(_0x4fb60e){_0x4fb60e[_0x8b5f('0x8d')]=_0x5063be;_0x4fb60e['phone']=_0x4fb60e[_0x8b5f('0x8b')];_0x4fb60e[_0x8b5f('0x88')]=_0x858038;delete _0x4fb60e['ItemType.OrderBy'];_0x858038=_0x858038+0x1;return _0x4fb60e;});return db['CmHopperAdditionalPhone']['bulkCreate'](_0x5ae7e3,{});})[_0x8b5f('0x19')](function(){_0x3cff68(0x1);});});}function insertAdditionalPhones(_0x3a945b,_0x479c89){return new Promise(function(_0x29e8f9){var _0x30436d=[];for(var _0x55c39b=0x0;_0x55c39b<_0x479c89[_0x8b5f('0x51')];_0x55c39b++){var _0x5382fb=_0x479c89[_0x55c39b];_0x30436d[_0x8b5f('0x5c')](parseContactItemType(_0x5382fb));}Promise[_0x8b5f('0x61')](_0x30436d)[_0x8b5f('0x19')](function(){var _0x326318={'id':_0x3a945b['id'],'items':_0x479c89};return addAdditionalPhones(_0x326318)[_0x8b5f('0x19')](function(){return addCmHopperPhones(_0x3a945b['id']);});})[_0x8b5f('0x19')](function(){_0x29e8f9(_0x3a945b);});});}function parseContactItemType(_0x1c0ccb){return new Promise(function(_0x32a33a){if(_0x1c0ccb['hasOwnProperty']('ItemTypeId')){_0x32a33a(_0x1c0ccb);}else{return db[_0x8b5f('0x65')][_0x8b5f('0x25')]({'where':{'name':_0x1c0ccb[_0x8b5f('0x8e')]}})['then'](function(_0x546186){if(_[_0x8b5f('0x52')](_0x546186))_0x1c0ccb['ItemTypeId']=null;else _0x1c0ccb['ItemTypeId']=_0x546186['id'];_0x32a33a(_0x1c0ccb);});}});}exports['getAdditionalPhones']=function(_0x154657,_0x18b33b){return db['CmContactHasItem'][_0x8b5f('0x21')]({'raw':!![],'where':{'CmContactId':_0x154657['params']['id'],'ItemClass':_0x8b5f('0x8c')},'include':[{'model':db[_0x8b5f('0x65')],'as':_0x8b5f('0x8e')}],'order':[[_0x8b5f('0x88')],[db[_0x8b5f('0x66')][_0x8b5f('0x8f')](_0x8b5f('0x90'))]]})[_0x8b5f('0x19')](function(_0x383773){return _0x383773;})[_0x8b5f('0x19')](respondWithResult(_0x18b33b,null))[_0x8b5f('0x33')](handleError(_0x18b33b,null));};exports[_0x8b5f('0x91')]=function(_0x5c0715,_0x44a0d4){return db[_0x8b5f('0x48')][_0x8b5f('0x21')]({'raw':!![],'where':{'CmContactId':_0x5c0715[_0x8b5f('0x34')][_0x8b5f('0x92')]}})[_0x8b5f('0x19')](function(_0x522b7d){var _0x20160f=_[_0x8b5f('0x6b')](_0x522b7d,function(_0x21b4a7){_0x21b4a7[_0x8b5f('0x93')]=_0x5c0715[_0x8b5f('0x34')][_0x8b5f('0x94')];return _0x21b4a7;});return db[_0x8b5f('0x48')][_0x8b5f('0x57')](_0x20160f,{});})[_0x8b5f('0x19')](function(){return addCmHopperPhones(_0x5c0715['body'][_0x8b5f('0x94')]);})[_0x8b5f('0x19')](function(){return['ok'];})['then'](respondWithResult(_0x44a0d4,null))[_0x8b5f('0x33')](handleError(_0x44a0d4,null));};exports['rescheduleAdditionalPhones']=function(_0x4c1d59,_0x5425ea){var _0x320910=[];_0x320910[_0x8b5f('0x5c')](createCmHopperPhone(_0x4c1d59['body']['id'],_0x4c1d59['body'][_0x8b5f('0x95')]));Promise[_0x8b5f('0x61')](_0x320910)['then'](function(){return[0x1];})[_0x8b5f('0x19')](respondWithResult(_0x5425ea,null));};exports[_0x8b5f('0x96')]=function(_0x410013,_0x4f3b86){var _0x246077={'raw':![],'where':{}};var _0x5bfa5b={};var _0x5b9fcd={'count':0x0,'rows':[]};return db[_0x8b5f('0x24')][_0x8b5f('0x82')]({'where':{'id':_0x410013[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x4f3b86,null))['then'](function(_0x241d34){if(_0x241d34){_0x5bfa5b[_0x8b5f('0x77')]=_[_0x8b5f('0x29')](db['CmHopper'][_0x8b5f('0x75')]);_0x5bfa5b[_0x8b5f('0x2e')]=_[_0x8b5f('0x29')](_0x410013[_0x8b5f('0x2e')]);_0x5bfa5b[_0x8b5f('0x76')]=_[_0x8b5f('0x79')](_0x5bfa5b['model'],_0x5bfa5b[_0x8b5f('0x2e')]);_0x246077[_0x8b5f('0x78')]=_[_0x8b5f('0x79')](_0x5bfa5b[_0x8b5f('0x77')],qs[_0x8b5f('0x97')](_0x410013[_0x8b5f('0x2e')][_0x8b5f('0x97')]));_0x246077[_0x8b5f('0x78')]=_0x246077[_0x8b5f('0x78')][_0x8b5f('0x51')]?_0x246077[_0x8b5f('0x78')]:_0x5bfa5b[_0x8b5f('0x77')];if(!_0x410013[_0x8b5f('0x2e')][_0x8b5f('0x5f')](_0x8b5f('0x80'))){_0x246077[_0x8b5f('0x14')]=qs['limit'](_0x410013[_0x8b5f('0x2e')]['limit']);_0x246077[_0x8b5f('0x12')]=qs[_0x8b5f('0x12')](_0x410013['query'][_0x8b5f('0x12')]);}_0x246077[_0x8b5f('0x7a')]=qs[_0x8b5f('0x7b')](_0x410013['query'][_0x8b5f('0x7b')]);_0x246077[_0x8b5f('0x5a')]=qs['filters'](_[_0x8b5f('0x7c')](_0x410013[_0x8b5f('0x2e')],_0x5bfa5b['filters']));_0x246077[_0x8b5f('0x5a')][_0x8b5f('0x98')]=_0x241d34['id'];if(_0x410013[_0x8b5f('0x2e')][_0x8b5f('0x7e')]){_0x246077[_0x8b5f('0x5a')]=_[_0x8b5f('0x7d')](_0x246077[_0x8b5f('0x5a')],{'$or':_['map'](_0x246077['attributes'],function(_0x2a4fa0){var _0x317675={};_0x317675[_0x2a4fa0]={'$like':'%'+_0x410013['query']['filter']+'%'};return _0x317675;})});}_0x246077=_[_0x8b5f('0x7d')]({},_0x246077,_0x410013['options']);return db[_0x8b5f('0x3a')][_0x8b5f('0x15')]({'where':_0x246077[_0x8b5f('0x5a')]})[_0x8b5f('0x19')](function(_0x5ea782){_0x5b9fcd[_0x8b5f('0x15')]=_0x5ea782;if(_0x410013[_0x8b5f('0x2e')][_0x8b5f('0x99')]){_0x246077[_0x8b5f('0x9a')]=[{'all':!![]}];}return db[_0x8b5f('0x3a')][_0x8b5f('0x21')](_0x246077);})['then'](function(_0x59fc25){_0x5b9fcd[_0x8b5f('0x9b')]=_0x59fc25;return _0x5b9fcd;});}})['then'](respondWithFilteredResult(_0x4f3b86,_0x246077))[_0x8b5f('0x33')](handleError(_0x4f3b86,null));};exports['getHopperHistories']=function(_0x2d5349,_0x24d493){var _0x2929ad={'raw':!![],'where':{}};var _0x4a809e={};var _0x2a63c1={'count':0x0,'rows':[]};return db[_0x8b5f('0x24')]['findOne']({'where':{'id':_0x2d5349[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x24d493,null))[_0x8b5f('0x19')](function(_0x4faead){if(_0x4faead){_0x4a809e['model']=_[_0x8b5f('0x29')](db[_0x8b5f('0x4a')]['rawAttributes']);_0x4a809e[_0x8b5f('0x2e')]=_[_0x8b5f('0x29')](_0x2d5349[_0x8b5f('0x2e')]);_0x4a809e[_0x8b5f('0x76')]=_[_0x8b5f('0x79')](_0x4a809e['model'],_0x4a809e[_0x8b5f('0x2e')]);_0x2929ad[_0x8b5f('0x78')]=_[_0x8b5f('0x79')](_0x4a809e[_0x8b5f('0x77')],qs[_0x8b5f('0x97')](_0x2d5349[_0x8b5f('0x2e')]['fields']));_0x2929ad['attributes']=_0x2929ad['attributes'][_0x8b5f('0x51')]?_0x2929ad[_0x8b5f('0x78')]:_0x4a809e[_0x8b5f('0x77')];if(!_0x2d5349['query'][_0x8b5f('0x5f')](_0x8b5f('0x80'))){_0x2929ad[_0x8b5f('0x14')]=qs[_0x8b5f('0x14')](_0x2d5349[_0x8b5f('0x2e')][_0x8b5f('0x14')]);_0x2929ad[_0x8b5f('0x12')]=qs[_0x8b5f('0x12')](_0x2d5349['query'][_0x8b5f('0x12')]);}_0x2929ad[_0x8b5f('0x7a')]=qs['sort'](_0x2d5349[_0x8b5f('0x2e')]['sort']);_0x2929ad[_0x8b5f('0x5a')]=qs['filters'](_[_0x8b5f('0x7c')](_0x2d5349[_0x8b5f('0x2e')],_0x4a809e[_0x8b5f('0x76')]));_0x2929ad[_0x8b5f('0x5a')][_0x8b5f('0x98')]=_0x4faead['id'];if(_0x2d5349[_0x8b5f('0x2e')]['filter']){_0x2929ad[_0x8b5f('0x5a')]=_[_0x8b5f('0x7d')](_0x2929ad['where'],{'$or':_[_0x8b5f('0x6b')](_0x2929ad[_0x8b5f('0x78')],function(_0x103fa0){var _0x1d0ad3={};_0x1d0ad3[_0x103fa0]={'$like':'%'+_0x2d5349[_0x8b5f('0x2e')][_0x8b5f('0x7e')]+'%'};return _0x1d0ad3;})});}_0x2929ad=_['merge']({},_0x2929ad,_0x2d5349[_0x8b5f('0x7f')]);return db[_0x8b5f('0x4a')][_0x8b5f('0x15')]({'where':_0x2929ad['where']})['then'](function(_0x166bf8){_0x2a63c1['count']=_0x166bf8;if(_0x2d5349[_0x8b5f('0x2e')][_0x8b5f('0x99')]){_0x2929ad[_0x8b5f('0x9a')]=[{'all':!![]}];}return db[_0x8b5f('0x4a')][_0x8b5f('0x21')](_0x2929ad);})[_0x8b5f('0x19')](function(_0x484c37){_0x2a63c1['rows']=_0x484c37;return _0x2a63c1;});}})[_0x8b5f('0x19')](respondWithFilteredResult(_0x24d493,_0x2929ad))['catch'](handleError(_0x24d493,null));};exports[_0x8b5f('0x9c')]=function(_0x29fe13,_0x431b14){var _0xac29c5={'raw':!![],'where':{}};var _0x4515c8={};var _0x5465b4={'count':0x0,'rows':[]};return db[_0x8b5f('0x24')][_0x8b5f('0x82')]({'where':{'id':_0x29fe13[_0x8b5f('0x26')]['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x431b14,null))[_0x8b5f('0x19')](function(_0x15637f){if(_0x15637f){_0x4515c8[_0x8b5f('0x77')]=_[_0x8b5f('0x29')](db[_0x8b5f('0x49')][_0x8b5f('0x75')]);_0x4515c8['query']=_[_0x8b5f('0x29')](_0x29fe13[_0x8b5f('0x2e')]);_0x4515c8[_0x8b5f('0x76')]=_[_0x8b5f('0x79')](_0x4515c8[_0x8b5f('0x77')],_0x4515c8[_0x8b5f('0x2e')]);_0xac29c5[_0x8b5f('0x78')]=_['intersection'](_0x4515c8[_0x8b5f('0x77')],qs[_0x8b5f('0x97')](_0x29fe13[_0x8b5f('0x2e')][_0x8b5f('0x97')]));_0xac29c5[_0x8b5f('0x78')]=_0xac29c5['attributes'][_0x8b5f('0x51')]?_0xac29c5['attributes']:_0x4515c8['model'];if(!_0x29fe13[_0x8b5f('0x2e')][_0x8b5f('0x5f')](_0x8b5f('0x80'))){_0xac29c5[_0x8b5f('0x14')]=qs[_0x8b5f('0x14')](_0x29fe13[_0x8b5f('0x2e')][_0x8b5f('0x14')]);_0xac29c5[_0x8b5f('0x12')]=qs['offset'](_0x29fe13['query'][_0x8b5f('0x12')]);}_0xac29c5[_0x8b5f('0x7a')]=qs[_0x8b5f('0x7b')](_0x29fe13['query'][_0x8b5f('0x7b')]);_0xac29c5[_0x8b5f('0x5a')]=qs[_0x8b5f('0x76')](_[_0x8b5f('0x7c')](_0x29fe13['query'],_0x4515c8['filters']));_0xac29c5[_0x8b5f('0x5a')][_0x8b5f('0x98')]=_0x15637f['id'];if(_0x29fe13['query'][_0x8b5f('0x7e')]){_0xac29c5['where']=_[_0x8b5f('0x7d')](_0xac29c5[_0x8b5f('0x5a')],{'$or':_[_0x8b5f('0x6b')](_0xac29c5['attributes'],function(_0x48b616){var _0x1f2b10={};_0x1f2b10[_0x48b616]={'$like':'%'+_0x29fe13['query']['filter']+'%'};return _0x1f2b10;})});}_0xac29c5=_[_0x8b5f('0x7d')]({},_0xac29c5,_0x29fe13['options']);return db[_0x8b5f('0x49')][_0x8b5f('0x15')]({'where':_0xac29c5[_0x8b5f('0x5a')]})[_0x8b5f('0x19')](function(_0x1f5416){_0x5465b4[_0x8b5f('0x15')]=_0x1f5416;if(_0x29fe13[_0x8b5f('0x2e')][_0x8b5f('0x99')]){_0xac29c5['include']=[{'all':!![]}];}return db[_0x8b5f('0x49')][_0x8b5f('0x21')](_0xac29c5);})[_0x8b5f('0x19')](function(_0x82242){_0x5465b4['rows']=_0x82242;return _0x5465b4;});}})[_0x8b5f('0x19')](respondWithFilteredResult(_0x431b14,_0xac29c5))[_0x8b5f('0x33')](handleError(_0x431b14,null));};exports['getJscriptySessions']=function(_0xc7e1fa,_0x3f9988){var _0x53a1d1={'raw':!![],'where':{}};var _0xc05ec7={};var _0x24b160={'count':0x0,'rows':[]};return db[_0x8b5f('0x24')]['findOne']({'where':{'id':_0xc7e1fa['params']['id']}})[_0x8b5f('0x19')](handleEntityNotFound(_0x3f9988,null))[_0x8b5f('0x19')](function(_0x14dea6){if(_0x14dea6){_0xc05ec7[_0x8b5f('0x77')]=_[_0x8b5f('0x29')](db[_0x8b5f('0x9d')][_0x8b5f('0x75')]);_0xc05ec7['query']=_[_0x8b5f('0x29')](_0xc7e1fa[_0x8b5f('0x2e')]);_0xc05ec7['filters']=_[_0x8b5f('0x79')](_0xc05ec7[_0x8b5f('0x77')],_0xc05ec7[_0x8b5f('0x2e')]);_0x53a1d1[_0x8b5f('0x78')]=_[_0x8b5f('0x79')](_0xc05ec7[_0x8b5f('0x77')],qs[_0x8b5f('0x97')](_0xc7e1fa['query']['fields']));_0x53a1d1[_0x8b5f('0x78')]=_0x53a1d1[_0x8b5f('0x78')]['length']?_0x53a1d1['attributes']:_0xc05ec7[_0x8b5f('0x77')];if(!_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x5f')](_0x8b5f('0x80'))){_0x53a1d1[_0x8b5f('0x14')]=qs['limit'](_0xc7e1fa['query']['limit']);_0x53a1d1[_0x8b5f('0x12')]=qs[_0x8b5f('0x12')](_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x12')]);}_0x53a1d1[_0x8b5f('0x7a')]=qs[_0x8b5f('0x7b')](_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x7b')]);_0x53a1d1['where']=qs['filters'](_['pick'](_0xc7e1fa['query'],_0xc05ec7['filters']));_0x53a1d1['where'][_0x8b5f('0x98')]=_0x14dea6['id'];if(_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x7e')]){_0x53a1d1[_0x8b5f('0x5a')]=_['merge'](_0x53a1d1[_0x8b5f('0x5a')],{'$or':_[_0x8b5f('0x6b')](_0x53a1d1[_0x8b5f('0x78')],function(_0x547bea){var _0x3a49f1={};_0x3a49f1[_0x547bea]={'$like':'%'+_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x7e')]+'%'};return _0x3a49f1;})});}_0x53a1d1=_[_0x8b5f('0x7d')]({},_0x53a1d1,_0xc7e1fa[_0x8b5f('0x7f')]);return db[_0x8b5f('0x9d')][_0x8b5f('0x15')]({'where':_0x53a1d1['where']})['then'](function(_0x17dcc9){_0x24b160['count']=_0x17dcc9;if(_0xc7e1fa[_0x8b5f('0x2e')][_0x8b5f('0x99')]){_0x53a1d1[_0x8b5f('0x9a')]=[{'all':!![]}];}return db[_0x8b5f('0x9d')]['findAll'](_0x53a1d1);})[_0x8b5f('0x19')](function(_0x4eea20){_0x24b160[_0x8b5f('0x9b')]=_0x4eea20;return _0x24b160;});}})['then'](respondWithFilteredResult(_0x3f9988,_0x53a1d1))[_0x8b5f('0x33')](handleError(_0x3f9988,null));};exports[_0x8b5f('0x9e')]=function(_0x2c1c4d,_0x4468d5){try{if(!_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0x5d')]){throw new Error(_0x8b5f('0x9f'));}if(!_0x2c1c4d[_0x8b5f('0x34')]['binding_keys']){throw new Error(_0x8b5f('0xa0'));}if(!_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xa1')]){throw new Error(_0x8b5f('0xa2'));}if(!_0x2c1c4d[_0x8b5f('0x34')]['socket_timestamp']){throw new Error(_0x8b5f('0xa3'));}var _0x46ddc8=_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xa4')]['split'](',');var _0x56a496=_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xa1')][_0x8b5f('0xa5')](',');if(!_0x46ddc8[_0x8b5f('0x51')]||!_0x56a496['length']||_0x46ddc8['length']!==_0x56a496[_0x8b5f('0x51')]){throw new Error(_0x8b5f('0xa6'));}_0x2c1c4d[_0x8b5f('0x34')]['fields']=_[_0x8b5f('0xa7')](_0x46ddc8,_0x56a496);if(!_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0x97')][_0x8b5f('0x73')]){throw new Error(_0x8b5f('0xa8'));}if(!_0x2c1c4d[_0x8b5f('0x34')]['fields']['firstName']){throw new Error(_0x8b5f('0xa9'));}var _0x274d52=path[_0x8b5f('0x38')](config['root'],'server/files/tmp',_0x2c1c4d[_0x8b5f('0xaa')][_0x8b5f('0xab')]);fs['chmodSync'](_0x274d52,parseInt('0777',0x8));var _0x1384f2=require('child_process')['fork'](path[_0x8b5f('0x38')](__dirname,_0x8b5f('0xac')),[_0x274d52,_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xa4')],_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xa1')],_0x2c1c4d['body'][_0x8b5f('0x5d')],_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xad')],_0x2c1c4d[_0x8b5f('0x34')]['duplicates'],_0x2c1c4d[_0x8b5f('0x34')][_0x8b5f('0xae')]]);return _0x4468d5[_0x8b5f('0x11')](0xc8)[_0x8b5f('0x17')]({'message':_0x8b5f('0xaf'),'pid':_0x1384f2[_0x8b5f('0xb0')]});}catch(_0x2dd920){return _0x4468d5[_0x8b5f('0x11')](0x1f4)[_0x8b5f('0xb1')](_0x2dd920);}};exports[_0x8b5f('0xb2')]=function(_0x3f9053,_0x226da4){var _0x467959=fs['createReadStream'](_0x3f9053[_0x8b5f('0xaa')][_0x8b5f('0x2')]);Papa['parse'](_0x467959,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4dc1f1){return _0x226da4[_0x8b5f('0x11')](0xc8)['json']({'file':_0x3f9053[_0x8b5f('0xaa')],'fields':_0x4dc1f1[_0x8b5f('0xb3')][_0x8b5f('0x97')]});}});};exports[_0x8b5f('0xb4')]=function(_0x4cadb6,_0x38d8a2){return db[_0x8b5f('0xb5')][_0x8b5f('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8b5f('0xb6')}})[_0x8b5f('0x19')](function(_0x5e628c){var _0x3bfc01=![];if(!_0x4cadb6[_0x8b5f('0x34')][_0x8b5f('0x5d')]){throw new Error(_0x8b5f('0x9f'));}if(!_0x4cadb6[_0x8b5f('0x34')][_0x8b5f('0xb7')][_0x8b5f('0x73')]){throw new Error(_0x8b5f('0xa8'));}if(!_0x4cadb6[_0x8b5f('0x34')]['binding'][_0x8b5f('0xb8')]){throw new Error(_0x8b5f('0xa9'));}if(!_0x4cadb6['body'][_0x8b5f('0xae')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x312c38=require(_0x8b5f('0xb9'))[_0x8b5f('0xba')](path[_0x8b5f('0x38')](__dirname,'../../components/import/cm/csv2'),[_0x4cadb6[_0x8b5f('0x26')]['id'],JSON[_0x8b5f('0xbb')](_0x4cadb6[_0x8b5f('0x34')]),JSON['stringify'](_0x5e628c)]);_0x312c38['on'](_0x8b5f('0xbc'),function(){_0x3bfc01=!![];return _0x38d8a2['status'](0xc8)[_0x8b5f('0x17')]({'message':_0x8b5f('0xbd'),'pid':_0x312c38[_0x8b5f('0xb0')]});});_0x312c38['on'](_0x8b5f('0xbe'),function(_0x10ee08){if(_0x10ee08&&!_0x3bfc01){return _0x38d8a2[_0x8b5f('0x11')](0x1f4)[_0x8b5f('0x17')]({'message':_0x8b5f('0xbf'),'pid':_0x312c38[_0x8b5f('0xb0')]});}});})[_0x8b5f('0x33')](handleError(_0x38d8a2,null));};exports['importUpdates']=function(_0x494840,_0x3840d7){return db['User'][_0x8b5f('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8b5f('0xb6')}})['then'](function(_0x3d33d0){var _0x47def9=![];if(!_0x494840[_0x8b5f('0x34')][_0x8b5f('0x5d')]){throw new Error(_0x8b5f('0x9f'));}if(!_0x494840[_0x8b5f('0x34')][_0x8b5f('0xb7')][_0x8b5f('0x73')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x494840[_0x8b5f('0x34')][_0x8b5f('0xb7')][_0x8b5f('0xb8')]){throw new Error(_0x8b5f('0xa9'));}if(!_0x494840[_0x8b5f('0x34')][_0x8b5f('0xae')]){throw new Error(_0x8b5f('0xa3'));}var _0x1c53bc=require(_0x8b5f('0xb9'))['fork'](path[_0x8b5f('0x38')](__dirname,_0x8b5f('0xc0')),[_0x494840[_0x8b5f('0x26')]['id'],JSON[_0x8b5f('0xbb')](_0x494840[_0x8b5f('0x34')]),JSON[_0x8b5f('0xbb')](_0x3d33d0)]);_0x1c53bc['on'](_0x8b5f('0xbc'),function(){_0x47def9=!![];return _0x3840d7[_0x8b5f('0x11')](0xc8)['json']({'message':_0x8b5f('0xbd'),'pid':_0x1c53bc['pid']});});_0x1c53bc['on'](_0x8b5f('0xbe'),function(_0xbba573){if(_0xbba573&&!_0x47def9){return _0x3840d7[_0x8b5f('0x11')](0x1f4)[_0x8b5f('0x17')]({'message':_0x8b5f('0xbf'),'pid':_0x1c53bc['pid']});}});})[_0x8b5f('0x33')](handleError(_0x3840d7,null));};exports['getJourney']=function(_0x555b93,_0x58cf62){var _0x82b1a0=[_0x8b5f('0xc1'),'chat',_0x8b5f('0xc2'),'openchannel',_0x8b5f('0xc3'),'whatsapp',_0x8b5f('0xc4')];var _0x5b14b0={'offset':0x0,'order':qs[_0x8b5f('0x7b')](_0x8b5f('0xc5'))},_0xe538e={'count':0x0,'rows':[]};Promise['resolve']()[_0x8b5f('0x19')](function(){if(_0x555b93['query'][_0x8b5f('0xc6')]){if(!_['includes'](_0x82b1a0,_0x555b93[_0x8b5f('0x2e')][_0x8b5f('0xc6')][_0x8b5f('0xc7')]())){throw new Error(_0x8b5f('0xc8'));}_0x82b1a0=[_0x555b93[_0x8b5f('0x2e')]['channel']['toLowerCase']()];}if(_0x555b93[_0x8b5f('0x2e')]['range']){try{var _0x5d0656=JSON['parse'](_0x555b93[_0x8b5f('0x2e')]['range']);if(!moment(_0x5d0656[_0x8b5f('0x39')])['isValid']()){throw new Error(_0x8b5f('0xc9'));}if(!moment(_0x5d0656['to'])[_0x8b5f('0xca')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4d6f5c){throw new Error(_0x8b5f('0xcb'));}}if(!_0x555b93[_0x8b5f('0x2e')][_0x8b5f('0x5f')]('nolimit')){_0x5b14b0[_0x8b5f('0x14')]=qs[_0x8b5f('0x14')](_0x555b93['query'][_0x8b5f('0x14')]||0xa);_0x5b14b0[_0x8b5f('0x12')]=qs[_0x8b5f('0x12')](_0x555b93[_0x8b5f('0x2e')][_0x8b5f('0x12')]);}var _0x14ffe4=_0x82b1a0[_0x8b5f('0x6b')](function(_0x2a344a){if(_0x2a344a==='voice'){var _0x21b48c={'attributes':['id',_0x8b5f('0xcc'),'type',_0x8b5f('0xcd'),_0x8b5f('0xce'),_0x8b5f('0xcf'),'starttime','endtime',_0x8b5f('0xd0'),_0x8b5f('0xd1'),'createdAt',_0x8b5f('0xd2'),_0x8b5f('0xd3'),_0x8b5f('0xd4'),_0x8b5f('0xd5')],'where':{'ContactId':_0x555b93['params']['id']},'include':[{'model':db['User'],'as':'User','attributes':['id','name',_0x8b5f('0xd6'),_0x8b5f('0xd7')]}],'order':[['createdAt',_0x8b5f('0xd8')]]};if(_0x555b93[_0x8b5f('0x2e')][_0x8b5f('0xd9')]){_0x21b48c[_0x8b5f('0x5a')][_0x8b5f('0xda')]={'$gte':_0x5d0656[_0x8b5f('0x39')],'$lte':_0x5d0656['to']};}return db[_0x8b5f('0x4b')][_0x8b5f('0xdb')](_0x21b48c)[_0x8b5f('0x19')](function(_0x31da09){_0xe538e[_0x8b5f('0x15')]+=_0x31da09['count'];return _[_0x8b5f('0x6b')](_0x31da09['rows'],function(_0x24a412){var _0xd8e076=_0x24a412['get']({'plain':!![]});_0xd8e076[_0x8b5f('0xc6')]=_0x2a344a;if(_0xd8e076['User']){_0xd8e076['User']={'id':_0xd8e076[_0x8b5f('0xb5')]['id'],'name':_0xd8e076[_0x8b5f('0xb5')][_0x8b5f('0x1e')],'fullname':_0xd8e076[_0x8b5f('0xb5')]['fullname'],'alias':_0xd8e076['User'][_0x8b5f('0xd7')]};}return _0xd8e076;});});}else{var _0x2d7e89=_[_0x8b5f('0xdc')](_0x2a344a)+(_0x2a344a===_0x8b5f('0xdd')?_0x8b5f('0xde'):'Account');var _0x34b7b0={'attributes':['id',_0x8b5f('0xdf'),_0x8b5f('0xe0'),_0x8b5f('0xda'),_0x8b5f('0xd1'),_0x8b5f('0xe1'),_0x8b5f('0xe2'),'thirdDisposition','UserId',_0x2d7e89+'Id'],'where':{'ContactId':_0x555b93['params']['id']},'include':[{'model':db[_0x2d7e89],'as':_0x8b5f('0xe3'),'attributes':['id',_0x8b5f('0x1e'),_0x8b5f('0xe4')]},{'model':db[_0x8b5f('0xb5')],'as':_0x8b5f('0xe5'),'attributes':['id',_0x8b5f('0x1e'),_0x8b5f('0xd6')]},{'model':db[_0x8b5f('0x63')],'as':'Tags','attributes':['id',_0x8b5f('0x1e'),_0x8b5f('0xe6')],'through':{'attributes':[]}}],'order':[[_0x8b5f('0xda'),_0x8b5f('0xd8')]]};if(_0x555b93['query'][_0x8b5f('0xd9')]){_0x34b7b0['where'][_0x8b5f('0xda')]={'$gte':_0x5d0656[_0x8b5f('0x39')],'$lte':_0x5d0656['to']};}switch(_0x2a344a){case _0x8b5f('0xdd'):_0x34b7b0[_0x8b5f('0x78')][_0x8b5f('0x5c')](_0x8b5f('0xe7'),_0x8b5f('0xe8'),'customerPort',_0x8b5f('0xe9'),_0x8b5f('0xea'),_0x8b5f('0xeb'),'ratingType',_0x8b5f('0xec'),_0x8b5f('0xed'));break;case _0x8b5f('0xc1'):_0x34b7b0[_0x8b5f('0x78')][_0x8b5f('0x5c')]('subject',_0x8b5f('0xee'));break;case'openchannel':_0x34b7b0[_0x8b5f('0x78')][_0x8b5f('0x5c')](_0x8b5f('0xef'),'threadId');break;}return db[_[_0x8b5f('0xdc')](_0x2a344a)+_0x8b5f('0xf0')][_0x8b5f('0xdb')](_0x34b7b0)[_0x8b5f('0x19')](function(_0x3f72bf){_0xe538e[_0x8b5f('0x15')]+=_0x3f72bf[_0x8b5f('0x15')];return _[_0x8b5f('0x6b')](_0x3f72bf[_0x8b5f('0x9b')],function(_0x30592a){var _0x25c61a=_0x30592a[_0x8b5f('0x35')]({'plain':!![]});_0x25c61a['channel']=_0x2a344a;if(_0x25c61a['Owner']){_0x25c61a[_0x8b5f('0xe5')]={'id':_0x25c61a['Owner']['id'],'name':_0x25c61a[_0x8b5f('0xe5')][_0x8b5f('0x1e')],'fullname':_0x25c61a[_0x8b5f('0xe5')]['fullname']};}return _0x25c61a;});});}});return Promise[_0x8b5f('0x61')](_0x14ffe4);})[_0x8b5f('0x19')](function(_0x25211b){return _(_0x25211b)[_0x8b5f('0xf1')]()[_0x8b5f('0xf2')]('createdAt')[_0x8b5f('0xf3')]()['value']();})['then'](function(_0x1ac9ee){_0xe538e['rows']=_0x5b14b0['limit']?_0x1ac9ee[_0x8b5f('0xf4')](_0x5b14b0['offset'],_0x5b14b0[_0x8b5f('0x12')]+_0x5b14b0['limit']):_0x1ac9ee;return _0xe538e;})[_0x8b5f('0x19')](respondWithFilteredResult(_0x58cf62,_0x5b14b0))[_0x8b5f('0x33')](handleError(_0x58cf62,null));}; \ No newline at end of file +var _0xbfad=['startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','ratingMessage','ratingType','ratingValue','substatus','openchannel','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','util','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','status','limit','count','offset','set','Content-Range','json','update','destroy','end','error','name','send','index','describe','then','getOptions','findAll','query','user','catch','params','CmContact','tags','keys','cf_','displayName','length','alias','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','columnName','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','contact','all','show','find','Tags','color','tag','Phones','ItemType','sequelize','literal','isNil','$and','CmCustomField','omit','map','format','pickBy','startsWith','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','findOne','Tag','rawAttributes','filters','intersection','model','fields','attributes','sort','pick','filter','options','getTags','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','hasOwnProperty','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','order','ContactId','includeAll','include','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','nolimit','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','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','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','import','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','User','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','includes','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','fullname','DESC','VoiceCallReport','findAndCountAll'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbfad,0x118));var _0xdbfa=function(_0x4fc79b,_0x35443b){_0x4fc79b=_0x4fc79b-0x0;var _0x467360=_0xbfad[_0x4fc79b];return _0x467360;};'use strict';var moment=require(_0xdbfa('0x0'));var BPromise=require('bluebird');var util=require(_0xdbfa('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xdbfa('0x2'));var squel=require(_0xdbfa('0x3'));var Papa=require(_0xdbfa('0x4'));var Redis=require(_0xdbfa('0x5'));var contacts=require(_0xdbfa('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xdbfa('0x7'))(_0xdbfa('0x8'));var config=require(_0xdbfa('0x9'));var shared=require(_0xdbfa('0xa'));var db=require('../../mysqldb')['db'];config[_0xdbfa('0xb')]=_[_0xdbfa('0xc')](config[_0xdbfa('0xb')],{'host':_0xdbfa('0xd'),'port':0x18eb});var socket=require(_0xdbfa('0xe'))(new Redis(config[_0xdbfa('0xb')]));require('./cmContact.socket')[_0xdbfa('0xf')](socket);function respondWithResult(_0x33a20b,_0x39f524){_0x39f524=_0x39f524||0xc8;return function(_0x1ffcf1){if(_0x1ffcf1){return _0x33a20b[_0xdbfa('0x10')](_0x39f524)['json'](_0x1ffcf1);}};}function respondWithFilteredResult(_0xffcecf,_0x3ff487){return function(_0x3e8dbd){if(_0x3e8dbd){var _0x379f87=typeof _0x3ff487['offset']==='undefined'&&typeof _0x3ff487[_0xdbfa('0x11')]==='undefined';var _0x4b99cd=_0x3e8dbd[_0xdbfa('0x12')];var _0x1bdcb8=_0x379f87?0x0:_0x3ff487[_0xdbfa('0x13')];var _0x24a71b=_0x379f87?_0x3e8dbd['count']:_0x3ff487[_0xdbfa('0x13')]+_0x3ff487['limit'];var _0x2bd502;if(_0x24a71b>=_0x4b99cd){_0x24a71b=_0x4b99cd;_0x2bd502=0xc8;}else{_0x2bd502=0xce;}_0xffcecf[_0xdbfa('0x10')](_0x2bd502);return _0xffcecf[_0xdbfa('0x14')](_0xdbfa('0x15'),_0x1bdcb8+'-'+_0x24a71b+'/'+_0x4b99cd)[_0xdbfa('0x16')](_0x3e8dbd);}return null;};}function saveUpdates(_0x44a87e){return function(_0x1ff3fa){if(_0x1ff3fa){return _0x1ff3fa[_0xdbfa('0x17')](_0x44a87e)['then'](function(_0x4207d4){return _0x4207d4;});}return null;};}function removeEntity(_0x3c2cf9){return function(_0x1b0afa){if(_0x1b0afa){return _0x1b0afa[_0xdbfa('0x18')]()['then'](function(){_0x3c2cf9[_0xdbfa('0x10')](0xcc)[_0xdbfa('0x19')]();});}};}function handleEntityNotFound(_0x4b7599){return function(_0x5c1809){if(!_0x5c1809){_0x4b7599['sendStatus'](0x194);}return _0x5c1809;};}function handleError(_0x521b9f,_0x29ba0a){_0x29ba0a=_0x29ba0a||0x1f4;return function(_0x15fdaf){logger[_0xdbfa('0x1a')](_0x15fdaf['stack']);if(_0x15fdaf[_0xdbfa('0x1b')]){delete _0x15fdaf['name'];}_0x521b9f[_0xdbfa('0x10')](_0x29ba0a)[_0xdbfa('0x1c')](_0x15fdaf);};}exports[_0xdbfa('0x1d')]=function(_0x38c65b,_0x34de3a){var _0x4a4e44={};return contacts[_0xdbfa('0x1e')]()[_0xdbfa('0x1f')](function(_0x13d7a7){_0x4a4e44=qs[_0xdbfa('0x20')](_0x13d7a7,_0x38c65b);return contacts[_0xdbfa('0x21')](_0x38c65b[_0xdbfa('0x22')],_0x38c65b[_0xdbfa('0x23')],_0x4a4e44,_0x13d7a7);})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x34de3a,_0x4a4e44))[_0xdbfa('0x24')](handleError(_0x34de3a,null));};exports['destroy']=function(_0x2d89a7,_0x152bb8){return db['CmContact']['find']({'where':{'id':_0x2d89a7[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x152bb8,null))['then'](removeEntity(_0x152bb8,null))[_0xdbfa('0x24')](handleError(_0x152bb8,null));};exports[_0xdbfa('0x1e')]=function(_0x34025d,_0x16e4f5){return db[_0xdbfa('0x26')]['describe']()[_0xdbfa('0x1f')](function(_0x36e363){delete _0x36e363[_0xdbfa('0x27')];for(var _0x5dbb70=0x0;_0x5dbb700x0){return new Promise(function(_0x21a3fa){var _0x2a0f05=[];for(var _0x143ef1=0x0;_0x143ef1<_0x3cbbfc[_0xdbfa('0x2b')];_0x143ef1++){_0x2a0f05[_0xdbfa('0x59')](insertAdditionalPhones(_0x3cbbfc[_0x143ef1][_0xdbfa('0x5c')],_0x3cbbfc[_0x143ef1][_0xdbfa('0x54')]));}Promise[_0xdbfa('0x5d')](_0x2a0f05)[_0xdbfa('0x1f')](function(){_0x21a3fa(0x1);});})[_0xdbfa('0x1f')](function(){return{'success':_0x36ca07,'failure':_0x38a63b,'duplicates':_0x1920be};});}else{return{'success':_0x36ca07,'failure':_0x38a63b,'duplicates':_0x1920be};}}})[_0xdbfa('0x1f')](respondWithResult(_0x5a9e7d,0xc9))['catch'](handleError(_0x5a9e7d,null));};exports[_0xdbfa('0x5e')]=function(_0x762c57,_0x4caafa){var _0x2b9162;return db['CmContact'][_0xdbfa('0x1e')]()['then'](function(_0x48cf7e){return db['CmContact'][_0xdbfa('0x5f')]({'where':{'id':_0x762c57[_0xdbfa('0x25')]['id']},'include':[{'model':db['Tag'],'as':_0xdbfa('0x60'),'attributes':['id','name',_0xdbfa('0x61')],'required':_0x762c57[_0xdbfa('0x22')][_0xdbfa('0x62')]?!![]:![]},{'model':db[_0xdbfa('0x47')],'as':_0xdbfa('0x63'),'where':{'CmContactId':_0x762c57[_0xdbfa('0x25')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xdbfa('0x64')}]}],'order':[db[_0xdbfa('0x65')][_0xdbfa('0x66')]('Phones.OrderBy')],'attributes':_[_0xdbfa('0x28')](_0x48cf7e)});})[_0xdbfa('0x1f')](function(_0x11506f){if(!_[_0xdbfa('0x67')](_0x11506f)){_0x2b9162=_0x11506f[_0xdbfa('0x35')]({'plain':!![]});var _0x428140={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x11506f&&_0x11506f[_0xdbfa('0x5a')]){if(_0x11506f['ListId']){_0x428140[_0xdbfa('0x57')][_0xdbfa('0x68')]['push']({'ListId':{'$ne':_0x11506f[_0xdbfa('0x5a')]}});}}return db[_0xdbfa('0x69')][_0xdbfa('0x21')](_0x428140);}})['then'](function(_0x1abe42){if(!_['isNil'](_0x1abe42)){return _[_0xdbfa('0x6a')](_0x2b9162,_[_0xdbfa('0x6b')](_0x1abe42,function(_0x197fab){return util[_0xdbfa('0x6c')]('cf_%d',_0x197fab['id']);}));}})['then'](handleEntityNotFound(_0x4caafa,null))['then'](respondWithResult(_0x4caafa,null))['catch'](handleError(_0x4caafa,null));};exports[_0xdbfa('0x17')]=function(_0x4b526d,_0x109301){var _0x3beb88;if(_0x4b526d[_0xdbfa('0x33')]['id']){delete _0x4b526d[_0xdbfa('0x33')]['id'];}if(!_['isNil'](_0x4b526d[_0xdbfa('0x33')][_0xdbfa('0x51')])){var _0x5579d7=_0x4b526d[_0xdbfa('0x33')][_0xdbfa('0x51')];if(!_['isNil'](shared[_0xdbfa('0x52')][_0x5579d7]))_0x4b526d[_0xdbfa('0x33')][_0xdbfa('0x53')]=shared['timezones'][_0x5579d7][_0xdbfa('0x53')];}return db[_0xdbfa('0x26')][_0xdbfa('0x5f')]({'where':{'id':_0x4b526d[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x109301,null))[_0xdbfa('0x1f')](saveUpdates(_0x4b526d[_0xdbfa('0x33')],null))[_0xdbfa('0x1f')](function(_0x185d01){_0x3beb88=_0x185d01;var _0x1873c0={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x185d01&&_0x185d01['ListId']){if(_0x185d01['ListId']){_0x1873c0[_0xdbfa('0x57')]['$and'][_0xdbfa('0x59')]({'ListId':{'$ne':_0x185d01[_0xdbfa('0x5a')]}});}}return db[_0xdbfa('0x69')][_0xdbfa('0x21')](_0x1873c0);})[_0xdbfa('0x1f')](function(_0x24a9c6){if(_0x24a9c6){return _[_0xdbfa('0x6a')](_[_0xdbfa('0x6d')](_0x4b526d[_0xdbfa('0x33')],function(_0x4196bd,_0x1db2bc){return _[_0xdbfa('0x6e')](_0x1db2bc,_0xdbfa('0x29'));}),_[_0xdbfa('0x6b')](_0x24a9c6,function(_0x20a4d5){return util[_0xdbfa('0x6c')](_0xdbfa('0x6f'),_0x20a4d5['id']);}));}})[_0xdbfa('0x1f')](function(_0x11d42b){if(_0x11d42b&&!_[_0xdbfa('0x70')](_0x11d42b)){var _0x5dacb1=squel[_0xdbfa('0x17')]()['table'](_0xdbfa('0x71'))['setFields'](_0x11d42b)[_0xdbfa('0x57')](_0xdbfa('0x72'),_0x4b526d[_0xdbfa('0x25')]['id'])[_0xdbfa('0x73')]();return db[_0xdbfa('0x65')]['query'](_0x5dacb1[_0xdbfa('0x74')],{'replacements':_0x5dacb1[_0xdbfa('0x2d')]});}})[_0xdbfa('0x1f')](function(){if(_0x4b526d['body'][_0xdbfa('0x75')]&&_0x3beb88){return db[_0xdbfa('0x39')]['update']({'phone':_0x4b526d[_0xdbfa('0x33')][_0xdbfa('0x75')],'OrderBy':0x0},{'where':{'ContactId':_0x3beb88['id']}});}})['then'](function(){return _0x3beb88;})[_0xdbfa('0x1f')](respondWithResult(_0x109301,null))[_0xdbfa('0x24')](handleError(_0x109301,null));};exports['getTags']=function(_0x5bdcb3,_0xe54634){var _0x4c5ff0={};var _0x4bbf0e={};var _0x5298ed;var _0x166be5;return db['CmContact'][_0xdbfa('0x76')]({'where':{'id':_0x5bdcb3[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0xe54634,null))[_0xdbfa('0x1f')](function(_0x2a8661){if(_0x2a8661){_0x5298ed=_0x2a8661;_0x4bbf0e['model']=_['keys'](db[_0xdbfa('0x77')][_0xdbfa('0x78')]);_0x4bbf0e[_0xdbfa('0x22')]=_[_0xdbfa('0x28')](_0x5bdcb3[_0xdbfa('0x22')]);_0x4bbf0e[_0xdbfa('0x79')]=_[_0xdbfa('0x7a')](_0x4bbf0e[_0xdbfa('0x7b')],_0x4bbf0e[_0xdbfa('0x22')]);_0x4c5ff0['attributes']=_[_0xdbfa('0x7a')](_0x4bbf0e['model'],qs['fields'](_0x5bdcb3['query'][_0xdbfa('0x7c')]));_0x4c5ff0['attributes']=_0x4c5ff0[_0xdbfa('0x7d')]['length']?_0x4c5ff0['attributes']:_0x4bbf0e[_0xdbfa('0x7b')];_0x4c5ff0['order']=qs[_0xdbfa('0x7e')](_0x5bdcb3[_0xdbfa('0x22')][_0xdbfa('0x7e')]);_0x4c5ff0[_0xdbfa('0x57')]=qs[_0xdbfa('0x79')](_[_0xdbfa('0x7f')](_0x5bdcb3[_0xdbfa('0x22')],_0x4bbf0e[_0xdbfa('0x79')]));if(_0x5bdcb3[_0xdbfa('0x22')][_0xdbfa('0x80')]){_0x4c5ff0[_0xdbfa('0x57')]=_[_0xdbfa('0x32')](_0x4c5ff0[_0xdbfa('0x57')],{'$or':_[_0xdbfa('0x6b')](_0x4c5ff0['attributes'],function(_0x21a5d0){var _0xcac3ac={};_0xcac3ac[_0x21a5d0]={'$like':'%'+_0x5bdcb3[_0xdbfa('0x22')]['filter']+'%'};return _0xcac3ac;})});}_0x4c5ff0=_[_0xdbfa('0x32')]({},_0x4c5ff0,_0x5bdcb3[_0xdbfa('0x81')]);return _0x5298ed[_0xdbfa('0x82')](_0x4c5ff0);}})[_0xdbfa('0x1f')](function(_0xa55256){if(_0xa55256){_0x166be5=_0xa55256[_0xdbfa('0x2b')];if(!_0x5bdcb3[_0xdbfa('0x22')]['hasOwnProperty']('nolimit')){_0x4c5ff0[_0xdbfa('0x11')]=qs['limit'](_0x5bdcb3[_0xdbfa('0x22')][_0xdbfa('0x11')]);_0x4c5ff0[_0xdbfa('0x13')]=qs[_0xdbfa('0x13')](_0x5bdcb3[_0xdbfa('0x22')][_0xdbfa('0x13')]);}return _0x5298ed[_0xdbfa('0x82')](_0x4c5ff0);}})[_0xdbfa('0x1f')](function(_0x30ef91){if(_0x30ef91){return _0x30ef91?{'count':_0x166be5,'rows':_0x30ef91}:null;}})[_0xdbfa('0x1f')](respondWithResult(_0xe54634,null))[_0xdbfa('0x24')](handleError(_0xe54634,null));};exports['setTags']=function(_0x5c3f7f,_0x168d50){if(_0x5c3f7f['body']['id']){delete _0x5c3f7f[_0xdbfa('0x33')]['id'];}return db[_0xdbfa('0x26')][_0xdbfa('0x76')]({'where':{'id':_0x5c3f7f[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x168d50,null))['then'](function(_0x45f186){if(_0x45f186){return _0x45f186[_0xdbfa('0x83')](_0x5c3f7f[_0xdbfa('0x33')][_0xdbfa('0x84')]||[]);}return null;})[_0xdbfa('0x1f')](respondWithResult(_0x168d50,null))[_0xdbfa('0x24')](handleError(_0x168d50,null));};exports[_0xdbfa('0x85')]=function(_0x38a765,_0x1aaa2e){var _0x33c37c=[];_0x33c37c[_0xdbfa('0x59')](addAdditionalPhones(_0x38a765['body']));Promise['all'](_0x33c37c)['then'](function(){_0x33c37c=[];_0x33c37c[_0xdbfa('0x59')](deleteCmHopperPhones(_0x38a765['body']['id']));_0x33c37c[_0xdbfa('0x59')](addCmHopperPhones(_0x38a765[_0xdbfa('0x33')]['id']));Promise['all'](_0x33c37c)[_0xdbfa('0x1f')](function(){return[0x1];})[_0xdbfa('0x1f')](respondWithResult(_0x1aaa2e,null));});};function addAdditionalPhones(_0x4a9c15){var _0x311345;return new Promise(function(_0x52b312){return db[_0xdbfa('0x47')][_0xdbfa('0x18')]({'where':{'CmContactId':_0x4a9c15['id']}})[_0xdbfa('0x1f')](function(){db[_0xdbfa('0x86')]['findAll']({'raw':!![],'attributes':['id',_0xdbfa('0x87')]})[_0xdbfa('0x1f')](function(_0x55749c){var _0x3fffdb=[];for(var _0x260f35=0x0;_0x260f35<_0x4a9c15[_0xdbfa('0x88')][_0xdbfa('0x2b')];_0x260f35++){var _0x36a801=_0x4a9c15[_0xdbfa('0x89')]?_[_0xdbfa('0x67')](_0x4a9c15[_0xdbfa('0x89')][_0x260f35])?'':_0x4a9c15[_0xdbfa('0x89')][_0x260f35]:_0x4a9c15[_0xdbfa('0x88')][_0x260f35][_0xdbfa('0x8a')]?_0x4a9c15[_0xdbfa('0x88')][_0x260f35][_0xdbfa('0x8a')]:'';var _0x2f22f2=_['isNil'](_0x4a9c15[_0xdbfa('0x88')][_0x260f35][_0xdbfa('0x8b')])?'':_0x4a9c15['items'][_0x260f35][_0xdbfa('0x8b')];var _0x239e79=_0x36a801+':'+_0x4a9c15['items'][_0x260f35][_0xdbfa('0x75')]+'§'+_0x2f22f2;if(_[_0xdbfa('0x67')](_0x311345))_0x311345=_0x239e79;else _0x311345+=';'+_0x239e79;var _0x414996=null;var _0x51ccfe=null;if(_0x4a9c15[_0xdbfa('0x89')]){if(!_[_0xdbfa('0x67')](_0x4a9c15[_0xdbfa('0x89')][_0x260f35])){_0x51ccfe=_['find'](_0x55749c,function(_0x54bfea){return _0x54bfea['id']===_0x4a9c15[_0xdbfa('0x89')][_0x260f35];});if(!_[_0xdbfa('0x67')](_0x51ccfe)){_0x414996=_0x51ccfe['OrderBy'];}}}else{if(!_[_0xdbfa('0x67')](_0x4a9c15['items'][_0x260f35])){_0x51ccfe=_['find'](_0x55749c,function(_0x361f6d){return _0x361f6d['id']===_0x4a9c15[_0xdbfa('0x88')][_0x260f35]['ItemTypeId'];});if(!_['isNil'](_0x51ccfe)){_0x414996=_0x260f35;}}}if(_[_0xdbfa('0x67')](_0x414996)){_0x414996=0x64;}_0x3fffdb['push'](addAdditionalPhone(_0x4a9c15['id'],_0x4a9c15[_0xdbfa('0x88')][_0x260f35][_0xdbfa('0x75')],_0x4a9c15['item_types']?_[_0xdbfa('0x67')](_0x4a9c15[_0xdbfa('0x89')][_0x260f35])?null:_0x4a9c15[_0xdbfa('0x89')][_0x260f35]:_0x4a9c15[_0xdbfa('0x88')][_0x260f35][_0xdbfa('0x8a')]?_0x4a9c15[_0xdbfa('0x88')][_0x260f35]['ItemTypeId']:null,_0x414996,_0x2f22f2));}Promise[_0xdbfa('0x5d')](_0x3fffdb)['then'](function(){db[_0xdbfa('0x26')][_0xdbfa('0x17')]({'AdditionalPhones':_0x311345},{'where':{'id':_0x4a9c15['id']}})[_0xdbfa('0x1f')](function(){_0x52b312(0x1);});});});});});}function addAdditionalPhone(_0x1a9f8f,_0x81b19b,_0x2bd0aa,_0x45403e,_0x42f1d4){return db[_0xdbfa('0x47')][_0xdbfa('0x5f')]({'where':{'CmContactId':_0x1a9f8f,'item':_0x81b19b}})[_0xdbfa('0x1f')](function(_0x1d4de9){if(_0x1d4de9)logger[_0xdbfa('0x2e')](_0xdbfa('0x8c'),_0x1d4de9);else{db[_0xdbfa('0x47')][_0xdbfa('0x3d')]({'CmContactId':_0x1a9f8f,'item':_0x81b19b,'ItemTypeId':_0x2bd0aa,'OrderBy':_0x45403e,'ItemClass':_0xdbfa('0x8d'),'description':_0x42f1d4});}});}function deleteCmHopperPhones(_0x19fa74){return new Promise(function(_0x4fdde6){return db[_0xdbfa('0x39')][_0xdbfa('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19fa74}})[_0xdbfa('0x1f')](function(_0x3028da){db[_0xdbfa('0x8e')][_0xdbfa('0x18')]({'where':{'CmHopperId':{'$in':_[_0xdbfa('0x6b')](_0x3028da,'id')}}});})[_0xdbfa('0x1f')](function(){_0x4fdde6(0x1);});});}function addCmHopperPhones(_0x43c405){return new Promise(function(_0x2b7b69){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x43c405}})[_0xdbfa('0x1f')](function(_0x509c3f){var _0x5895c8=[];_['map'](_0x509c3f,function(_0x510705){_0x5895c8[_0xdbfa('0x59')](createCmHopperPhone(_0x43c405,_0x510705['id']));});Promise[_0xdbfa('0x5d')](_0x5895c8)[_0xdbfa('0x1f')](function(){_0x2b7b69(0x1);});});});}function createCmHopperPhone(_0xb99f35,_0x3986b3){return new Promise(function(_0x6c4929){db[_0xdbfa('0x47')]['findAll']({'raw':!![],'attributes':[_0xdbfa('0x8f'),_0xdbfa('0x87')],'where':{'CmContactId':_0xb99f35,'ItemClass':_0xdbfa('0x8d')},'include':[{'model':db['ContactItemType'],'attributes':[_0xdbfa('0x87')],'as':'ItemType'}],'order':[_0xdbfa('0x87'),db[_0xdbfa('0x65')][_0xdbfa('0x66')](_0xdbfa('0x90'))]})[_0xdbfa('0x1f')](function(_0x57e62d){var _0xae3c4c=0x1;var _0x4d2422=_[_0xdbfa('0x6b')](_0x57e62d,function(_0x13386a){_0x13386a[_0xdbfa('0x91')]=_0x3986b3;_0x13386a[_0xdbfa('0x75')]=_0x13386a[_0xdbfa('0x8f')];_0x13386a[_0xdbfa('0x87')]=_0xae3c4c;delete _0x13386a[_0xdbfa('0x92')];_0xae3c4c=_0xae3c4c+0x1;return _0x13386a;});return db[_0xdbfa('0x8e')][_0xdbfa('0x55')](_0x4d2422,{});})['then'](function(){_0x6c4929(0x1);});});}function insertAdditionalPhones(_0x4f6a2b,_0x3f5046){return new Promise(function(_0x30a78e){var _0x5beae3=[];for(var _0x45c8b1=0x0;_0x45c8b1<_0x3f5046[_0xdbfa('0x2b')];_0x45c8b1++){var _0x4758eb=_0x3f5046[_0x45c8b1];_0x5beae3[_0xdbfa('0x59')](parseContactItemType(_0x4758eb));}Promise[_0xdbfa('0x5d')](_0x5beae3)[_0xdbfa('0x1f')](function(){var _0x363e59={'id':_0x4f6a2b['id'],'items':_0x3f5046};return addAdditionalPhones(_0x363e59)[_0xdbfa('0x1f')](function(){return addCmHopperPhones(_0x4f6a2b['id']);});})[_0xdbfa('0x1f')](function(){_0x30a78e(_0x4f6a2b);});});}function parseContactItemType(_0x61b5b0){return new Promise(function(_0x894ed5){if(_0x61b5b0[_0xdbfa('0x93')](_0xdbfa('0x8a'))){_0x894ed5(_0x61b5b0);}else{return db['ContactItemType'][_0xdbfa('0x5f')]({'where':{'name':_0x61b5b0[_0xdbfa('0x64')]}})['then'](function(_0x2c96be){if(_[_0xdbfa('0x67')](_0x2c96be))_0x61b5b0[_0xdbfa('0x8a')]=null;else _0x61b5b0[_0xdbfa('0x8a')]=_0x2c96be['id'];_0x894ed5(_0x61b5b0);});}});}exports['getAdditionalPhones']=function(_0x8c470c,_0x3c53b6){return db[_0xdbfa('0x47')]['findAll']({'raw':!![],'where':{'CmContactId':_0x8c470c[_0xdbfa('0x25')]['id'],'ItemClass':_0xdbfa('0x8d')},'include':[{'model':db[_0xdbfa('0x86')],'as':_0xdbfa('0x64')}],'order':[[_0xdbfa('0x87')],[db['sequelize']['literal']('`ItemType`.OrderBy')]]})['then'](function(_0x1fff4b){return _0x1fff4b;})['then'](respondWithResult(_0x3c53b6,null))['catch'](handleError(_0x3c53b6,null));};exports['duplicateAdditionalPhones']=function(_0x2ce2ca,_0x11d273){return db[_0xdbfa('0x47')][_0xdbfa('0x21')]({'raw':!![],'where':{'CmContactId':_0x2ce2ca[_0xdbfa('0x33')]['fromContactId']}})[_0xdbfa('0x1f')](function(_0x246954){var _0x14105e=_['map'](_0x246954,function(_0x5eb609){_0x5eb609[_0xdbfa('0x94')]=_0x2ce2ca[_0xdbfa('0x33')][_0xdbfa('0x95')];return _0x5eb609;});return db[_0xdbfa('0x47')][_0xdbfa('0x55')](_0x14105e,{});})[_0xdbfa('0x1f')](function(){return addCmHopperPhones(_0x2ce2ca[_0xdbfa('0x33')][_0xdbfa('0x95')]);})[_0xdbfa('0x1f')](function(){return['ok'];})[_0xdbfa('0x1f')](respondWithResult(_0x11d273,null))[_0xdbfa('0x24')](handleError(_0x11d273,null));};exports[_0xdbfa('0x96')]=function(_0x324b55,_0x1468a4){var _0xe3d35e=[];_0xe3d35e[_0xdbfa('0x59')](createCmHopperPhone(_0x324b55[_0xdbfa('0x33')]['id'],_0x324b55[_0xdbfa('0x33')]['hopperId']));Promise[_0xdbfa('0x5d')](_0xe3d35e)[_0xdbfa('0x1f')](function(){return[0x1];})['then'](respondWithResult(_0x1468a4,null));};exports[_0xdbfa('0x97')]=function(_0x2541de,_0x2d0477){var _0x145662={'raw':![],'where':{}};var _0x124283={};var _0x5c7465={'count':0x0,'rows':[]};return db[_0xdbfa('0x26')]['findOne']({'where':{'id':_0x2541de[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x2d0477,null))['then'](function(_0x300493){if(_0x300493){_0x124283[_0xdbfa('0x7b')]=_['keys'](db[_0xdbfa('0x39')]['rawAttributes']);_0x124283[_0xdbfa('0x22')]=_['keys'](_0x2541de[_0xdbfa('0x22')]);_0x124283[_0xdbfa('0x79')]=_[_0xdbfa('0x7a')](_0x124283[_0xdbfa('0x7b')],_0x124283['query']);_0x145662[_0xdbfa('0x7d')]=_[_0xdbfa('0x7a')](_0x124283[_0xdbfa('0x7b')],qs[_0xdbfa('0x7c')](_0x2541de[_0xdbfa('0x22')][_0xdbfa('0x7c')]));_0x145662[_0xdbfa('0x7d')]=_0x145662['attributes']['length']?_0x145662['attributes']:_0x124283[_0xdbfa('0x7b')];if(!_0x2541de['query']['hasOwnProperty']('nolimit')){_0x145662['limit']=qs['limit'](_0x2541de[_0xdbfa('0x22')][_0xdbfa('0x11')]);_0x145662['offset']=qs['offset'](_0x2541de[_0xdbfa('0x22')][_0xdbfa('0x13')]);}_0x145662[_0xdbfa('0x98')]=qs['sort'](_0x2541de[_0xdbfa('0x22')]['sort']);_0x145662[_0xdbfa('0x57')]=qs[_0xdbfa('0x79')](_['pick'](_0x2541de[_0xdbfa('0x22')],_0x124283[_0xdbfa('0x79')]));_0x145662[_0xdbfa('0x57')][_0xdbfa('0x99')]=_0x300493['id'];if(_0x2541de['query']['filter']){_0x145662[_0xdbfa('0x57')]=_[_0xdbfa('0x32')](_0x145662[_0xdbfa('0x57')],{'$or':_['map'](_0x145662[_0xdbfa('0x7d')],function(_0x443db1){var _0x152d2e={};_0x152d2e[_0x443db1]={'$like':'%'+_0x2541de['query'][_0xdbfa('0x80')]+'%'};return _0x152d2e;})});}_0x145662=_[_0xdbfa('0x32')]({},_0x145662,_0x2541de[_0xdbfa('0x81')]);return db[_0xdbfa('0x39')][_0xdbfa('0x12')]({'where':_0x145662[_0xdbfa('0x57')]})[_0xdbfa('0x1f')](function(_0x1f3713){_0x5c7465[_0xdbfa('0x12')]=_0x1f3713;if(_0x2541de[_0xdbfa('0x22')][_0xdbfa('0x9a')]){_0x145662[_0xdbfa('0x9b')]=[{'all':!![]}];}return db['CmHopper'][_0xdbfa('0x21')](_0x145662);})[_0xdbfa('0x1f')](function(_0xda7146){_0x5c7465[_0xdbfa('0x9c')]=_0xda7146;return _0x5c7465;});}})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x2d0477,_0x145662))['catch'](handleError(_0x2d0477,null));};exports['getHopperHistories']=function(_0x1a8df8,_0x4ca624){var _0x1b6c41={'raw':!![],'where':{}};var _0x3b8324={};var _0x3a7327={'count':0x0,'rows':[]};return db['CmContact'][_0xdbfa('0x76')]({'where':{'id':_0x1a8df8['params']['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x4ca624,null))[_0xdbfa('0x1f')](function(_0x31a306){if(_0x31a306){_0x3b8324['model']=_[_0xdbfa('0x28')](db[_0xdbfa('0x49')][_0xdbfa('0x78')]);_0x3b8324['query']=_[_0xdbfa('0x28')](_0x1a8df8['query']);_0x3b8324['filters']=_[_0xdbfa('0x7a')](_0x3b8324[_0xdbfa('0x7b')],_0x3b8324['query']);_0x1b6c41[_0xdbfa('0x7d')]=_[_0xdbfa('0x7a')](_0x3b8324['model'],qs[_0xdbfa('0x7c')](_0x1a8df8[_0xdbfa('0x22')][_0xdbfa('0x7c')]));_0x1b6c41[_0xdbfa('0x7d')]=_0x1b6c41[_0xdbfa('0x7d')]['length']?_0x1b6c41[_0xdbfa('0x7d')]:_0x3b8324['model'];if(!_0x1a8df8[_0xdbfa('0x22')][_0xdbfa('0x93')]('nolimit')){_0x1b6c41[_0xdbfa('0x11')]=qs['limit'](_0x1a8df8['query']['limit']);_0x1b6c41[_0xdbfa('0x13')]=qs['offset'](_0x1a8df8[_0xdbfa('0x22')]['offset']);}_0x1b6c41[_0xdbfa('0x98')]=qs[_0xdbfa('0x7e')](_0x1a8df8['query']['sort']);_0x1b6c41['where']=qs[_0xdbfa('0x79')](_[_0xdbfa('0x7f')](_0x1a8df8[_0xdbfa('0x22')],_0x3b8324[_0xdbfa('0x79')]));_0x1b6c41[_0xdbfa('0x57')][_0xdbfa('0x99')]=_0x31a306['id'];if(_0x1a8df8[_0xdbfa('0x22')][_0xdbfa('0x80')]){_0x1b6c41[_0xdbfa('0x57')]=_[_0xdbfa('0x32')](_0x1b6c41[_0xdbfa('0x57')],{'$or':_[_0xdbfa('0x6b')](_0x1b6c41[_0xdbfa('0x7d')],function(_0x560b02){var _0x28b5ab={};_0x28b5ab[_0x560b02]={'$like':'%'+_0x1a8df8[_0xdbfa('0x22')][_0xdbfa('0x80')]+'%'};return _0x28b5ab;})});}_0x1b6c41=_[_0xdbfa('0x32')]({},_0x1b6c41,_0x1a8df8[_0xdbfa('0x81')]);return db['CmHopperHistory'][_0xdbfa('0x12')]({'where':_0x1b6c41[_0xdbfa('0x57')]})[_0xdbfa('0x1f')](function(_0x29245c){_0x3a7327[_0xdbfa('0x12')]=_0x29245c;if(_0x1a8df8[_0xdbfa('0x22')][_0xdbfa('0x9a')]){_0x1b6c41[_0xdbfa('0x9b')]=[{'all':!![]}];}return db[_0xdbfa('0x49')][_0xdbfa('0x21')](_0x1b6c41);})[_0xdbfa('0x1f')](function(_0x425286){_0x3a7327[_0xdbfa('0x9c')]=_0x425286;return _0x3a7327;});}})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x4ca624,_0x1b6c41))[_0xdbfa('0x24')](handleError(_0x4ca624,null));};exports[_0xdbfa('0x9d')]=function(_0x45e6d2,_0x2b3870){var _0x681960={'raw':!![],'where':{}};var _0x460760={};var _0x5e93b4={'count':0x0,'rows':[]};return db[_0xdbfa('0x26')][_0xdbfa('0x76')]({'where':{'id':_0x45e6d2[_0xdbfa('0x25')]['id']}})[_0xdbfa('0x1f')](handleEntityNotFound(_0x2b3870,null))['then'](function(_0x1b3094){if(_0x1b3094){_0x460760['model']=_[_0xdbfa('0x28')](db[_0xdbfa('0x48')][_0xdbfa('0x78')]);_0x460760[_0xdbfa('0x22')]=_['keys'](_0x45e6d2[_0xdbfa('0x22')]);_0x460760['filters']=_[_0xdbfa('0x7a')](_0x460760[_0xdbfa('0x7b')],_0x460760['query']);_0x681960[_0xdbfa('0x7d')]=_[_0xdbfa('0x7a')](_0x460760[_0xdbfa('0x7b')],qs[_0xdbfa('0x7c')](_0x45e6d2[_0xdbfa('0x22')][_0xdbfa('0x7c')]));_0x681960[_0xdbfa('0x7d')]=_0x681960[_0xdbfa('0x7d')][_0xdbfa('0x2b')]?_0x681960[_0xdbfa('0x7d')]:_0x460760[_0xdbfa('0x7b')];if(!_0x45e6d2[_0xdbfa('0x22')][_0xdbfa('0x93')]('nolimit')){_0x681960['limit']=qs['limit'](_0x45e6d2[_0xdbfa('0x22')][_0xdbfa('0x11')]);_0x681960[_0xdbfa('0x13')]=qs[_0xdbfa('0x13')](_0x45e6d2[_0xdbfa('0x22')][_0xdbfa('0x13')]);}_0x681960[_0xdbfa('0x98')]=qs[_0xdbfa('0x7e')](_0x45e6d2[_0xdbfa('0x22')][_0xdbfa('0x7e')]);_0x681960[_0xdbfa('0x57')]=qs[_0xdbfa('0x79')](_[_0xdbfa('0x7f')](_0x45e6d2[_0xdbfa('0x22')],_0x460760[_0xdbfa('0x79')]));_0x681960['where'][_0xdbfa('0x99')]=_0x1b3094['id'];if(_0x45e6d2['query'][_0xdbfa('0x80')]){_0x681960['where']=_[_0xdbfa('0x32')](_0x681960['where'],{'$or':_[_0xdbfa('0x6b')](_0x681960[_0xdbfa('0x7d')],function(_0x3e8b9f){var _0x158392={};_0x158392[_0x3e8b9f]={'$like':'%'+_0x45e6d2['query'][_0xdbfa('0x80')]+'%'};return _0x158392;})});}_0x681960=_[_0xdbfa('0x32')]({},_0x681960,_0x45e6d2[_0xdbfa('0x81')]);return db[_0xdbfa('0x48')][_0xdbfa('0x12')]({'where':_0x681960['where']})['then'](function(_0x4b4b2b){_0x5e93b4[_0xdbfa('0x12')]=_0x4b4b2b;if(_0x45e6d2['query']['includeAll']){_0x681960[_0xdbfa('0x9b')]=[{'all':!![]}];}return db[_0xdbfa('0x48')][_0xdbfa('0x21')](_0x681960);})[_0xdbfa('0x1f')](function(_0xc093fa){_0x5e93b4[_0xdbfa('0x9c')]=_0xc093fa;return _0x5e93b4;});}})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x2b3870,_0x681960))[_0xdbfa('0x24')](handleError(_0x2b3870,null));};exports[_0xdbfa('0x9e')]=function(_0x47f32c,_0x4bc893){var _0x422a4c={'raw':!![],'where':{}};var _0x251dcb={};var _0x3ede01={'count':0x0,'rows':[]};return db[_0xdbfa('0x26')]['findOne']({'where':{'id':_0x47f32c[_0xdbfa('0x25')]['id']}})['then'](handleEntityNotFound(_0x4bc893,null))['then'](function(_0x32096d){if(_0x32096d){_0x251dcb['model']=_[_0xdbfa('0x28')](db[_0xdbfa('0x9f')][_0xdbfa('0x78')]);_0x251dcb[_0xdbfa('0x22')]=_[_0xdbfa('0x28')](_0x47f32c[_0xdbfa('0x22')]);_0x251dcb[_0xdbfa('0x79')]=_['intersection'](_0x251dcb['model'],_0x251dcb[_0xdbfa('0x22')]);_0x422a4c[_0xdbfa('0x7d')]=_[_0xdbfa('0x7a')](_0x251dcb[_0xdbfa('0x7b')],qs['fields'](_0x47f32c[_0xdbfa('0x22')][_0xdbfa('0x7c')]));_0x422a4c[_0xdbfa('0x7d')]=_0x422a4c['attributes']['length']?_0x422a4c[_0xdbfa('0x7d')]:_0x251dcb[_0xdbfa('0x7b')];if(!_0x47f32c[_0xdbfa('0x22')]['hasOwnProperty'](_0xdbfa('0xa0'))){_0x422a4c[_0xdbfa('0x11')]=qs[_0xdbfa('0x11')](_0x47f32c[_0xdbfa('0x22')]['limit']);_0x422a4c[_0xdbfa('0x13')]=qs[_0xdbfa('0x13')](_0x47f32c[_0xdbfa('0x22')][_0xdbfa('0x13')]);}_0x422a4c[_0xdbfa('0x98')]=qs[_0xdbfa('0x7e')](_0x47f32c['query'][_0xdbfa('0x7e')]);_0x422a4c[_0xdbfa('0x57')]=qs['filters'](_[_0xdbfa('0x7f')](_0x47f32c[_0xdbfa('0x22')],_0x251dcb[_0xdbfa('0x79')]));_0x422a4c[_0xdbfa('0x57')][_0xdbfa('0x99')]=_0x32096d['id'];if(_0x47f32c[_0xdbfa('0x22')][_0xdbfa('0x80')]){_0x422a4c[_0xdbfa('0x57')]=_[_0xdbfa('0x32')](_0x422a4c[_0xdbfa('0x57')],{'$or':_[_0xdbfa('0x6b')](_0x422a4c[_0xdbfa('0x7d')],function(_0x3a5342){var _0x39ee27={};_0x39ee27[_0x3a5342]={'$like':'%'+_0x47f32c[_0xdbfa('0x22')][_0xdbfa('0x80')]+'%'};return _0x39ee27;})});}_0x422a4c=_[_0xdbfa('0x32')]({},_0x422a4c,_0x47f32c['options']);return db[_0xdbfa('0x9f')][_0xdbfa('0x12')]({'where':_0x422a4c['where']})[_0xdbfa('0x1f')](function(_0x1742b6){_0x3ede01[_0xdbfa('0x12')]=_0x1742b6;if(_0x47f32c[_0xdbfa('0x22')]['includeAll']){_0x422a4c[_0xdbfa('0x9b')]=[{'all':!![]}];}return db[_0xdbfa('0x9f')][_0xdbfa('0x21')](_0x422a4c);})[_0xdbfa('0x1f')](function(_0x29ff0c){_0x3ede01[_0xdbfa('0x9c')]=_0x29ff0c;return _0x3ede01;});}})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x4bc893,_0x422a4c))[_0xdbfa('0x24')](handleError(_0x4bc893,null));};exports[_0xdbfa('0xa1')]=function(_0x7b5eb3,_0x4466dc){try{if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0x5a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa2')]){throw new Error(_0xdbfa('0xa3'));}if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa4')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa5')]){throw new Error(_0xdbfa('0xa6'));}var _0x49b9d0=_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa2')]['split'](',');var _0x5d5f4d=_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa4')][_0xdbfa('0xa7')](',');if(!_0x49b9d0[_0xdbfa('0x2b')]||!_0x5d5f4d['length']||_0x49b9d0[_0xdbfa('0x2b')]!==_0x5d5f4d[_0xdbfa('0x2b')]){throw new Error(_0xdbfa('0xa8'));}_0x7b5eb3['body']['fields']=_[_0xdbfa('0xa9')](_0x49b9d0,_0x5d5f4d);if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0x7c')][_0xdbfa('0x75')]){throw new Error(_0xdbfa('0xaa'));}if(!_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0x7c')][_0xdbfa('0xab')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x3cadc4=path[_0xdbfa('0x37')](config[_0xdbfa('0xac')],_0xdbfa('0xad'),_0x7b5eb3[_0xdbfa('0xae')][_0xdbfa('0xaf')]);fs['chmodSync'](_0x3cadc4,parseInt(_0xdbfa('0xb0'),0x8));var _0x2c5b76=require(_0xdbfa('0xb1'))[_0xdbfa('0xb2')](path[_0xdbfa('0x37')](__dirname,_0xdbfa('0xb3')),[_0x3cadc4,_0x7b5eb3['body'][_0xdbfa('0xa2')],_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xa4')],_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0x5a')],_0x7b5eb3[_0xdbfa('0x33')][_0xdbfa('0xb4')],_0x7b5eb3['body']['duplicates'],_0x7b5eb3['body'][_0xdbfa('0xa5')]]);return _0x4466dc[_0xdbfa('0x10')](0xc8)[_0xdbfa('0x16')]({'message':_0xdbfa('0xb5'),'pid':_0x2c5b76[_0xdbfa('0xb6')]});}catch(_0x3924e0){return _0x4466dc[_0xdbfa('0x10')](0x1f4)[_0xdbfa('0x1c')](_0x3924e0);}};exports[_0xdbfa('0xb7')]=function(_0x1a37f1,_0x328954){var _0x775304=fs[_0xdbfa('0xb8')](_0x1a37f1['file'][_0xdbfa('0xb9')]);Papa[_0xdbfa('0xba')](_0x775304,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x56cd11){return _0x328954[_0xdbfa('0x10')](0xc8)[_0xdbfa('0x16')]({'file':_0x1a37f1[_0xdbfa('0xae')],'fields':_0x56cd11[_0xdbfa('0xbb')]['fields']});}});};exports[_0xdbfa('0xbc')]=function(_0x2ec2e5,_0x5c2680){return db['User'][_0xdbfa('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0xdbfa('0xbd')}})[_0xdbfa('0x1f')](function(_0x3ac022){var _0x142b3=![];if(!_0x2ec2e5[_0xdbfa('0x33')][_0xdbfa('0x5a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2ec2e5[_0xdbfa('0x33')][_0xdbfa('0xbe')]['phone']){throw new Error(_0xdbfa('0xaa'));}if(!_0x2ec2e5[_0xdbfa('0x33')]['binding']['firstName']){throw new Error(_0xdbfa('0xbf'));}if(!_0x2ec2e5[_0xdbfa('0x33')]['socket_timestamp']){throw new Error(_0xdbfa('0xa6'));}var _0x3c2463=require('child_process')[_0xdbfa('0xb2')](path[_0xdbfa('0x37')](__dirname,_0xdbfa('0xc0')),[_0x2ec2e5[_0xdbfa('0x25')]['id'],JSON['stringify'](_0x2ec2e5[_0xdbfa('0x33')]),JSON[_0xdbfa('0xc1')](_0x3ac022)]);_0x3c2463['on']('message',function(){_0x142b3=!![];return _0x5c2680[_0xdbfa('0x10')](0xc8)[_0xdbfa('0x16')]({'message':_0xdbfa('0xc2'),'pid':_0x3c2463[_0xdbfa('0xb6')]});});_0x3c2463['on'](_0xdbfa('0xc3'),function(_0x11b062){if(_0x11b062&&!_0x142b3){return _0x5c2680['status'](0x1f4)[_0xdbfa('0x16')]({'message':_0xdbfa('0xc4'),'pid':_0x3c2463[_0xdbfa('0xb6')]});}});})[_0xdbfa('0x24')](handleError(_0x5c2680,null));};exports['importUpdates']=function(_0x58b720,_0x41405a){return db[_0xdbfa('0xc5')][_0xdbfa('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xdbfa('0x1f')](function(_0x2c56aa){var _0x5b4f72=![];if(!_0x58b720['body'][_0xdbfa('0x5a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x58b720['body']['binding'][_0xdbfa('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x58b720[_0xdbfa('0x33')][_0xdbfa('0xbe')]['firstName']){throw new Error(_0xdbfa('0xbf'));}if(!_0x58b720[_0xdbfa('0x33')][_0xdbfa('0xa5')]){throw new Error(_0xdbfa('0xa6'));}var _0x21dd6c=require(_0xdbfa('0xb1'))['fork'](path[_0xdbfa('0x37')](__dirname,_0xdbfa('0xc6')),[_0x58b720[_0xdbfa('0x25')]['id'],JSON['stringify'](_0x58b720[_0xdbfa('0x33')]),JSON['stringify'](_0x2c56aa)]);_0x21dd6c['on']('message',function(){_0x5b4f72=!![];return _0x41405a['status'](0xc8)[_0xdbfa('0x16')]({'message':_0xdbfa('0xc2'),'pid':_0x21dd6c['pid']});});_0x21dd6c['on']('exit',function(_0x28ed55){if(_0x28ed55&&!_0x5b4f72){return _0x41405a['status'](0x1f4)[_0xdbfa('0x16')]({'message':_0xdbfa('0xc4'),'pid':_0x21dd6c['pid']});}});})[_0xdbfa('0x24')](handleError(_0x41405a,null));};exports[_0xdbfa('0xc7')]=function(_0x2d55db,_0x239c61){var _0xb4311=[_0xdbfa('0xc8'),_0xdbfa('0xc9'),_0xdbfa('0xca'),'openchannel',_0xdbfa('0xcb'),_0xdbfa('0xcc'),_0xdbfa('0xcd')];var _0x5c5ba7={'offset':0x0,'order':qs['sort'](_0xdbfa('0xce'))},_0x41325c={'count':0x0,'rows':[]};Promise[_0xdbfa('0xcf')]()[_0xdbfa('0x1f')](function(){if(_0x2d55db['query']['channel']){if(!_[_0xdbfa('0xd0')](_0xb4311,_0x2d55db[_0xdbfa('0x22')]['channel'][_0xdbfa('0xd1')]())){throw new Error(_0xdbfa('0xd2'));}_0xb4311=[_0x2d55db['query'][_0xdbfa('0xd3')]['toLowerCase']()];}if(_0x2d55db['query'][_0xdbfa('0xd4')]){try{var _0x38b4f0=JSON[_0xdbfa('0xba')](_0x2d55db['query'][_0xdbfa('0xd4')]);if(!moment(_0x38b4f0[_0xdbfa('0x34')])[_0xdbfa('0xd5')]()){throw new Error(_0xdbfa('0xd6'));}if(!moment(_0x38b4f0['to'])[_0xdbfa('0xd5')]()){throw new Error(_0xdbfa('0xd7'));}}catch(_0x5a76fa){throw new Error(_0xdbfa('0xd8'));}}if(!_0x2d55db['query']['hasOwnProperty']('nolimit')){_0x5c5ba7[_0xdbfa('0x11')]=qs[_0xdbfa('0x11')](_0x2d55db[_0xdbfa('0x22')]['limit']||0xa);_0x5c5ba7[_0xdbfa('0x13')]=qs[_0xdbfa('0x13')](_0x2d55db[_0xdbfa('0x22')][_0xdbfa('0x13')]);}var _0x2f8eb4=_0xb4311[_0xdbfa('0x6b')](function(_0x605fdc){if(_0x605fdc===_0xdbfa('0xcd')){var _0x3e3fe7={'attributes':['id',_0xdbfa('0xd9'),'type',_0xdbfa('0xda'),_0xdbfa('0xdb'),_0xdbfa('0xdc'),_0xdbfa('0xdd'),_0xdbfa('0xde'),_0xdbfa('0xdf'),_0xdbfa('0xe0'),_0xdbfa('0xe1'),'userDisposition','userSecondDisposition','userThirdDisposition','UserId'],'where':{'ContactId':_0x2d55db[_0xdbfa('0x25')]['id']},'include':[{'model':db[_0xdbfa('0xc5')],'as':_0xdbfa('0xc5'),'attributes':['id',_0xdbfa('0x1b'),_0xdbfa('0xe2'),_0xdbfa('0x2c')]}],'order':[[_0xdbfa('0xe1'),_0xdbfa('0xe3')]]};if(_0x2d55db['query'][_0xdbfa('0xd4')]){_0x3e3fe7['where'][_0xdbfa('0xe1')]={'$gte':_0x38b4f0[_0xdbfa('0x34')],'$lte':_0x38b4f0['to']};}return db[_0xdbfa('0xe4')][_0xdbfa('0xe5')](_0x3e3fe7)[_0xdbfa('0x1f')](function(_0x56e465){_0x41325c[_0xdbfa('0x12')]+=_0x56e465[_0xdbfa('0x12')];return _[_0xdbfa('0x6b')](_0x56e465[_0xdbfa('0x9c')],function(_0x494ff9){var _0x554444=_0x494ff9['get']({'plain':!![]});_0x554444[_0xdbfa('0xd3')]=_0x605fdc;if(_0x554444[_0xdbfa('0xc5')]){_0x554444['User']={'id':_0x554444[_0xdbfa('0xc5')]['id'],'name':_0x554444['User'][_0xdbfa('0x1b')],'fullname':_0x554444[_0xdbfa('0xc5')]['fullname'],'alias':_0x554444[_0xdbfa('0xc5')]['alias']};}return _0x554444;});});}else{var _0x258973=_[_0xdbfa('0xe6')](_0x605fdc)+(_0x605fdc==='chat'?_0xdbfa('0xe7'):_0xdbfa('0xe8'));var _0x1a7e43={'attributes':['id','closed',_0xdbfa('0xe9'),_0xdbfa('0xe1'),_0xdbfa('0xe0'),_0xdbfa('0xea'),_0xdbfa('0xeb'),_0xdbfa('0xec'),'UserId',_0x258973+'Id'],'where':{'ContactId':_0x2d55db[_0xdbfa('0x25')]['id']},'include':[{'model':db[_0x258973],'as':'Account','attributes':['id','name',_0xdbfa('0xed')]},{'model':db['User'],'as':_0xdbfa('0xee'),'attributes':['id',_0xdbfa('0x1b'),_0xdbfa('0xe2')]},{'model':db[_0xdbfa('0x77')],'as':_0xdbfa('0x60'),'attributes':['id',_0xdbfa('0x1b'),'color'],'through':{'attributes':[]}}],'order':[['createdAt',_0xdbfa('0xe3')]]};if(_0x2d55db[_0xdbfa('0x22')][_0xdbfa('0xd4')]){_0x1a7e43[_0xdbfa('0x57')][_0xdbfa('0xe1')]={'$gte':_0x38b4f0[_0xdbfa('0x34')],'$lte':_0x38b4f0['to']};}switch(_0x605fdc){case'chat':_0x1a7e43[_0xdbfa('0x7d')][_0xdbfa('0x59')](_0xdbfa('0xef'),_0xdbfa('0xf0'),'customerPort',_0xdbfa('0xf1'),'osName',_0xdbfa('0xf2'),_0xdbfa('0xf3'),_0xdbfa('0xf4'),'referer');break;case'mail':_0x1a7e43[_0xdbfa('0x7d')][_0xdbfa('0x59')]('subject',_0xdbfa('0xf5'));break;case _0xdbfa('0xf6'):_0x1a7e43['attributes'][_0xdbfa('0x59')](_0xdbfa('0xf7'),_0xdbfa('0xf8'));break;}return db[_[_0xdbfa('0xe6')](_0x605fdc)+_0xdbfa('0xf9')]['findAndCountAll'](_0x1a7e43)[_0xdbfa('0x1f')](function(_0xdbb720){_0x41325c[_0xdbfa('0x12')]+=_0xdbb720[_0xdbfa('0x12')];return _['map'](_0xdbb720[_0xdbfa('0x9c')],function(_0x169b1a){var _0x36a89e=_0x169b1a[_0xdbfa('0x35')]({'plain':!![]});_0x36a89e[_0xdbfa('0xd3')]=_0x605fdc;if(_0x36a89e[_0xdbfa('0xee')]){_0x36a89e['Owner']={'id':_0x36a89e[_0xdbfa('0xee')]['id'],'name':_0x36a89e[_0xdbfa('0xee')]['name'],'fullname':_0x36a89e[_0xdbfa('0xee')]['fullname']};}return _0x36a89e;});});}});return Promise[_0xdbfa('0x5d')](_0x2f8eb4);})[_0xdbfa('0x1f')](function(_0xa659b2){return _(_0xa659b2)[_0xdbfa('0xfa')]()[_0xdbfa('0xfb')](_0xdbfa('0xe1'))[_0xdbfa('0xfc')]()[_0xdbfa('0xfd')]();})['then'](function(_0x39c1b5){_0x41325c[_0xdbfa('0x9c')]=_0x5c5ba7[_0xdbfa('0x11')]?_0x39c1b5[_0xdbfa('0xfe')](_0x5c5ba7['offset'],_0x5c5ba7[_0xdbfa('0x13')]+_0x5c5ba7[_0xdbfa('0x11')]):_0x39c1b5;return _0x41325c;})[_0xdbfa('0x1f')](respondWithFilteredResult(_0x239c61,_0x5c5ba7))[_0xdbfa('0x24')](handleError(_0x239c61,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index a0f43f6..1b8e485 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 _0x069e=['exports','events','../../mysqldb','CmContact','emit','hasOwnProperty','hook'];(function(_0x7b8ddc,_0x2a903f){var _0x5f5050=function(_0x52b7d9){while(--_0x52b7d9){_0x7b8ddc['push'](_0x7b8ddc['shift']());}};_0x5f5050(++_0x2a903f);}(_0x069e,0x189));var _0xe069=function(_0x3e7b59,_0x14a4cd){_0x3e7b59=_0x3e7b59-0x0;var _0x4bd64a=_0x069e[_0x3e7b59];return _0x4bd64a;};'use strict';var EventEmitter=require(_0xe069('0x0'));var CmContact=require(_0xe069('0x1'))['db'][_0xe069('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50216b){return function(_0x189d29,_0xfe5321,_0x27d526){CmContactEvents[_0xe069('0x3')](_0x50216b+':'+_0x189d29['id'],_0x189d29);CmContactEvents[_0xe069('0x3')](_0x50216b,_0x189d29);_0x27d526(null);};}for(var e in events){if(events[_0xe069('0x4')](e)){var event=events[e];CmContact[_0xe069('0x5')](e,emitEvent(event));}}module[_0xe069('0x6')]=CmContactEvents; \ No newline at end of file +var _0xff4d=['hook','exports','events','CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x31abbb,_0x201368){var _0x2623ad=function(_0x391c4c){while(--_0x391c4c){_0x31abbb['push'](_0x31abbb['shift']());}};_0x2623ad(++_0x201368);}(_0xff4d,0xa4));var _0xdff4=function(_0x208d6f,_0x576241){_0x208d6f=_0x208d6f-0x0;var _0x398bbf=_0xff4d[_0x208d6f];return _0x398bbf;};'use strict';var EventEmitter=require(_0xdff4('0x0'));var CmContact=require('../../mysqldb')['db'][_0xdff4('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xdff4('0x2')](0x0);var events={'afterCreate':_0xdff4('0x3'),'afterUpdate':_0xdff4('0x4'),'afterDestroy':_0xdff4('0x5')};function emitEvent(_0x4833f3){return function(_0x175390,_0x63336a,_0x182d03){CmContactEvents[_0xdff4('0x6')](_0x4833f3+':'+_0x175390['id'],_0x175390);CmContactEvents['emit'](_0x4833f3,_0x175390);_0x182d03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xdff4('0x7')](e,emitEvent(event));}}module[_0xdff4('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index effb34e..7148fde 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 _0x92ec=['mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones','utcOffset','add','minutes','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x92ec,0x119));var _0xc92e=function(_0x4e3ec7,_0x55cfcc){_0x4e3ec7=_0x4e3ec7-0x0;var _0x3d67fd=_0x92ec[_0x4e3ec7];return _0x3d67fd;};'use strict';var _=require(_0xc92e('0x0'));var util=require(_0xc92e('0x1'));var logger=require(_0xc92e('0x2'))(_0xc92e('0x3'));var moment=require(_0xc92e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc92e('0x5'));var config=require(_0xc92e('0x6'));var shared=require(_0xc92e('0x7'));var attributes=require('./cmContact.attributes');module[_0xc92e('0x8')]=function(_0x4cdcd5,_0x5579b9){return _0x4cdcd5[_0xc92e('0x9')](_0xc92e('0xa'),attributes,{'tableName':_0xc92e('0xb'),'paranoid':!![],'indexes':[{'name':_0xc92e('0xc'),'fields':[_0xc92e('0xc')]},{'name':_0xc92e('0xd'),'fields':['firstName',_0xc92e('0xe'),_0xc92e('0xc'),_0xc92e('0xf'),_0xc92e('0x10'),_0xc92e('0x11')],'type':_0xc92e('0x12')}],'timestamps':!![],'charset':_0xc92e('0x13'),'collate':_0xc92e('0x14'),'hooks':{'afterCreate':function(_0x2982e3,_0x9e93d,_0x3c4303){var _0x49b21a=_0x4cdcd5[_0xc92e('0x15')];var _0xe7c624=_0x2982e3[_0xc92e('0x16')]({'plain':!![]});function _0x375b9d(){return function(_0x3a1a6e){logger[_0xc92e('0x17')](_0xc92e('0x18'),_0xc92e('0x19'),util[_0xc92e('0x1a')](_0x3a1a6e,{'showHidden':![],'depth':null}));};}function _0xa3ba4a(_0x1ace4b,_0x2daf7e){var _0xc35d33=_0x2daf7e[_0xc92e('0x1b')]?_0x2daf7e[_0xc92e('0x1b')]:moment()[_0xc92e('0x1c')](_0xc92e('0x1d'));return new BPromise(function(_0x555ebe,_0x30716d){if(_[_0xc92e('0x1e')](_0x2daf7e[_0xc92e('0x1f')])){_0x555ebe({'ret':_0xc35d33});}else{_0x49b21a[_0xc92e('0x20')]['findOne']({'where':{'id':_0x1ace4b['id']}})[_0xc92e('0x21')](function(_0x1c959d){if(!_['isNil'](_0x1c959d)){var _0x592232=_0x1c959d['dialTimezone'];if(!_[_0xc92e('0x1e')](_0x592232)){var _0x6b6a38=shared[_0xc92e('0x22')];var _0x3cfbd1=_0x6b6a38[_0x592232];var _0x6e4a1d=_0x6b6a38[_0x2daf7e[_0xc92e('0x1f')]];if(!_[_0xc92e('0x1e')](_0x3cfbd1)&&!_[_0xc92e('0x1e')](_0x6e4a1d)){var _0x57642c=_0x3cfbd1['utcOffset']-_0x6e4a1d[_0xc92e('0x23')];_0xc35d33=_0x2daf7e[_0xc92e('0x1b')]?_0x2daf7e[_0xc92e('0x1b')]:moment();var _0x28353a=moment(_0xc35d33)[_0xc92e('0x24')](_0x57642c,_0xc92e('0x25'));_0x555ebe({'ret':_0x28353a[_0xc92e('0x1c')](_0xc92e('0x1d'))});}else _0x555ebe({'ret':_0xc35d33});}else _0x555ebe({'ret':_0xc35d33});}else{_0x555ebe({'ret':_0xc35d33});}});}});return 0xa;}var _0x3331cb=function(_0x2edea0){return new BPromise(function(_0x162922,_0x479559){_0xa3ba4a(_0x2edea0,_0xe7c624)[_0xc92e('0x21')](function(_0x28c0ff){_0xe7c624[_0xc92e('0x1b')]=_0x28c0ff['ret'];_0x49b21a['CmHopper'][_0xc92e('0x26')]({'where':{'phone':_0xe7c624[_0xc92e('0xc')],'VoiceQueueId':_0x2edea0['id']}})[_0xc92e('0x21')](function(_0x2332d7){if(!_[_0xc92e('0x1e')](_0x2332d7)){throw new Error(_0xc92e('0x27')+_0xe7c624[_0xc92e('0xc')]+_0xc92e('0x28')+_0x2edea0['id']);}return _0x49b21a[_0xc92e('0x29')][_0xc92e('0x2a')]({'phone':_0xe7c624['phone'],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624[_0xc92e('0x2b')],'priority':_0xe7c624[_0xc92e('0x2c')]?_0xe7c624[_0xc92e('0x2c')]:0x2,'scheduledat':_0xe7c624[_0xc92e('0x1b')]?_0xe7c624[_0xc92e('0x1b')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xe7c624['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624[_0xc92e('0x2d')]:undefined,'callbackat':_0xe7c624['callbackUniqueid']?moment()['format'](_0xc92e('0x1d')):undefined,'VoiceQueueId':_0x2edea0['id']});})[_0xc92e('0x2e')](function(_0xf5d8b){_0x479559(_0xf5d8b);});});});};var _0x575f2d=function(_0x1eb01f){return new BPromise(function(_0x320080,_0x4643c9){_0xa3ba4a(_0x1eb01f,_0xe7c624)[_0xc92e('0x21')](function(_0x17acb){_0xe7c624['scheduledat']=_0x17acb[_0xc92e('0x2f')];_0x49b21a[_0xc92e('0x29')][_0xc92e('0x26')]({'where':{'phone':_0xe7c624[_0xc92e('0xc')],'VoiceQueueId':_0x1eb01f['id']}})['then'](function(_0x3cfa3c){if(!_[_0xc92e('0x1e')](_0x3cfa3c)){throw new Error(_0xc92e('0x27')+_0xe7c624[_0xc92e('0xc')]+_0xc92e('0x30')+_0x1eb01f['id']);}return _0x49b21a[_0xc92e('0x31')][_0xc92e('0x26')]({'where':{'calleridnum':_0xe7c624[_0xc92e('0xc')],'VoiceQueueId':_0x1eb01f['id']}});})[_0xc92e('0x21')](function(_0x6fb787){if(!_[_0xc92e('0x1e')](_0x6fb787)){throw new Error(_0xc92e('0x32')+_0xe7c624[_0xc92e('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x1eb01f['id']);}return _0x49b21a[_0xc92e('0x29')]['create']({'phone':_0xe7c624['phone'],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624[_0xc92e('0x2b')],'priority':_0xe7c624[_0xc92e('0x2c')]?_0xe7c624[_0xc92e('0x2c')]:0x2,'scheduledat':_0xe7c624[_0xc92e('0x1b')]?_0xe7c624[_0xc92e('0x1b')]:moment()[_0xc92e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xe7c624['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624[_0xc92e('0x2d')]:undefined,'callbackat':_0xe7c624[_0xc92e('0x2d')]?moment()[_0xc92e('0x1c')](_0xc92e('0x1d')):undefined,'VoiceQueueId':_0x1eb01f['id']});})[_0xc92e('0x2e')](function(_0xaaffc1){_0x4643c9(_0xaaffc1);});});});};function _0x4b361e(){return function(_0x4c503f){logger['error'](_0xc92e('0x18'),_0xc92e('0x19'),util[_0xc92e('0x1a')](_0x4c503f,{'showHidden':![],'depth':null}));};}function _0x151d8a(_0x1418ba,_0x24c558){var _0x51a9ba=_0x24c558[_0xc92e('0x1b')]?_0x24c558[_0xc92e('0x1b')]:moment()['format'](_0xc92e('0x1d'));return new BPromise(function(_0x10b8a9,_0x27baf3){if(_['isNil'](_0x24c558[_0xc92e('0x1f')])){_0x10b8a9({'ret':_0x51a9ba});}else{_0x49b21a[_0xc92e('0x33')][_0xc92e('0x26')]({'where':{'id':_0x1418ba['id']}})[_0xc92e('0x21')](function(_0xe305d9){if(!_['isNil'](_0xe305d9)){var _0x10b807=_0xe305d9[_0xc92e('0x1f')];if(!_[_0xc92e('0x1e')](_0x10b807)){var _0x49e6ce=shared[_0xc92e('0x22')];var _0x1d2ecc=_0x49e6ce[_0x10b807];var _0x5e9ed5=_0x49e6ce[_0x24c558['dialTimezone']];if(!_[_0xc92e('0x1e')](_0x1d2ecc)&&!_[_0xc92e('0x1e')](_0x5e9ed5)){var _0x255bb7=_0x1d2ecc[_0xc92e('0x23')]-_0x5e9ed5[_0xc92e('0x23')];_0x51a9ba=_0x24c558[_0xc92e('0x1b')]?_0x24c558[_0xc92e('0x1b')]:moment();var _0x40a14a=moment(_0x51a9ba)[_0xc92e('0x24')](_0x255bb7,_0xc92e('0x25'));_0x10b8a9({'ret':_0x40a14a[_0xc92e('0x1c')](_0xc92e('0x1d'))});}else _0x10b8a9({'ret':_0x51a9ba});}else _0x10b8a9({'ret':_0x51a9ba});}else{_0x10b8a9({'ret':_0x51a9ba});}});}});return 0xa;}var _0x27fcc0=function(_0x1c000b){return new BPromise(function(_0x566e57,_0x5ccb17){_0x151d8a(_0x1c000b,_0xe7c624)[_0xc92e('0x21')](function(_0x94755a){_0xe7c624[_0xc92e('0x1b')]=_0x94755a[_0xc92e('0x2f')];_0x49b21a[_0xc92e('0x29')][_0xc92e('0x26')]({'where':{'phone':_0xe7c624[_0xc92e('0xc')],'CampaignId':_0x1c000b['id']}})['then'](function(_0x3b8b20){if(!_[_0xc92e('0x1e')](_0x3b8b20)){throw new Error(_0xc92e('0x27')+_0xe7c624['phone']+_0xc92e('0x34')+_0x1c000b['id']);}return _0x49b21a['CmHopper']['create']({'phone':_0xe7c624['phone'],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624['ListId'],'priority':_0xe7c624[_0xc92e('0x2c')]?_0xe7c624[_0xc92e('0x2c')]:0x2,'scheduledat':_0xe7c624[_0xc92e('0x1b')]?_0xe7c624[_0xc92e('0x1b')]:moment()[_0xc92e('0x1c')](_0xc92e('0x1d')),'callback':_0xe7c624[_0xc92e('0x2d')]?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624[_0xc92e('0x2d')]:undefined,'callbackat':_0xe7c624[_0xc92e('0x2d')]?moment()[_0xc92e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1c000b['id']});})[_0xc92e('0x2e')](function(_0x889d6c){_0x5ccb17(_0x889d6c);});});});};var _0x22feba=function(_0x4f5c48){return new BPromise(function(_0x500042,_0x105832){_0x151d8a(_0x4f5c48,_0xe7c624)[_0xc92e('0x21')](function(_0x377fd2){_0xe7c624['scheduledat']=_0x377fd2[_0xc92e('0x2f')];_0x49b21a[_0xc92e('0x29')][_0xc92e('0x26')]({'where':{'phone':_0xe7c624[_0xc92e('0xc')],'CampaignId':_0x4f5c48['id']}})['then'](function(_0x5284ad){if(!_[_0xc92e('0x1e')](_0x5284ad)){throw new Error(_0xc92e('0x27')+_0xe7c624['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4f5c48['id']);}return _0x49b21a[_0xc92e('0x31')]['findOne']({'where':{'calleridnum':_0xe7c624[_0xc92e('0xc')],'CampaignId':_0x4f5c48['id']}});})[_0xc92e('0x21')](function(_0x1fb96a){if(!_[_0xc92e('0x1e')](_0x1fb96a)){throw new Error(_0xc92e('0x32')+_0xe7c624[_0xc92e('0xc')]+_0xc92e('0x35')+_0x4f5c48['id']);}return _0x49b21a[_0xc92e('0x29')][_0xc92e('0x2a')]({'phone':_0xe7c624[_0xc92e('0xc')],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624['ListId'],'priority':_0xe7c624['priority']?_0xe7c624[_0xc92e('0x2c')]:0x2,'scheduledat':_0xe7c624[_0xc92e('0x1b')]?_0xe7c624[_0xc92e('0x1b')]:moment()['format'](_0xc92e('0x1d')),'callback':_0xe7c624['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624['callbackUniqueid']:undefined,'callbackat':_0xe7c624[_0xc92e('0x2d')]?moment()[_0xc92e('0x1c')](_0xc92e('0x1d')):undefined,'CampaignId':_0x4f5c48['id']});})[_0xc92e('0x2e')](function(_0x2a3843){_0x105832(_0x2a3843);});});});};if(_0xe7c624[_0xc92e('0x2b')]){_0x49b21a[_0xc92e('0x20')][_0xc92e('0x36')]({'where':{'type':'outbound'},'attributes':['id',_0xc92e('0x37'),_0xc92e('0x1f')],'include':[{'model':_0x49b21a[_0xc92e('0x38')],'as':_0xc92e('0x39'),'where':{'id':_0xe7c624['ListId']}}]})['then'](function(_0x4fb504){if(_0x4fb504){var _0x31456e=[];for(var _0xca6c53=0x0,_0x5dccbe;_0xca6c53<_0x4fb504[_0xc92e('0x3a')];_0xca6c53+=0x1){_0x5dccbe=_0x4fb504[_0xca6c53][_0xc92e('0x16')]({'plain':!![]});switch(_0x5dccbe[_0xc92e('0x37')]){case _0xc92e('0x3b'):_0x575f2d(_0x5dccbe)[_0xc92e('0x2e')](_0x375b9d());break;case _0xc92e('0x3c'):_0x3331cb(_0x5dccbe)['catch'](_0x375b9d());break;default:_0x151d8a(_0x5dccbe,_0xe7c624)[_0xc92e('0x21')](function(_0x3c9d4){_0xe7c624[_0xc92e('0x1b')]=_0x3c9d4[_0xc92e('0x2f')];_0x49b21a[_0xc92e('0x29')]['create']({'phone':_0xe7c624[_0xc92e('0xc')],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624[_0xc92e('0x2b')],'scheduledat':_0xe7c624[_0xc92e('0x1b')]?_0xe7c624[_0xc92e('0x1b')]:moment()[_0xc92e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xe7c624[_0xc92e('0x2c')]?_0xe7c624['priority']:0x2,'callback':_0xe7c624[_0xc92e('0x2d')]?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624['callbackUniqueid']:undefined,'callbackat':_0xe7c624[_0xc92e('0x2d')]?moment()[_0xc92e('0x1c')](_0xc92e('0x1d')):undefined,'VoiceQueueId':_0x5dccbe['id']})[_0xc92e('0x2e')](_0x375b9d());});}}}})[_0xc92e('0x21')](function(){return _0x49b21a[_0xc92e('0x20')]['findAll']({'where':{'type':_0xc92e('0x3d')},'attributes':['id'],'include':[{'model':_0x49b21a[_0xc92e('0x38')],'as':_0xc92e('0x3e'),'where':{'id':_0xe7c624[_0xc92e('0x2b')]}}]})['then'](function(_0x373fcd){if(_0x373fcd){var _0x29a621=[];for(var _0xe2dea=0x0,_0x5f106e;_0xe2dea<_0x373fcd[_0xc92e('0x3a')];_0xe2dea+=0x1){_0x5f106e=_0x373fcd[_0xe2dea][_0xc92e('0x16')]({'plain':!![]});_0x49b21a[_0xc92e('0x3f')][_0xc92e('0x2a')]({'phone':_0xe7c624[_0xc92e('0xc')],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624['ListId'],'VoiceQueueId':_0x5f106e['id']})[_0xc92e('0x2e')](function(_0x5f0993){logger[_0xc92e('0x17')](_0xc92e('0x40'),_0xc92e('0x19'),_0x5f0993[_0xc92e('0x41')]);});}}});})[_0xc92e('0x21')](function(){return _0x49b21a[_0xc92e('0x33')][_0xc92e('0x36')]({'attributes':['id',_0xc92e('0x37'),_0xc92e('0x1f')],'include':[{'model':_0x49b21a[_0xc92e('0x38')],'as':'Lists','where':{'id':_0xe7c624['ListId']}}]})[_0xc92e('0x21')](function(_0xfb135b){if(_0xfb135b){var _0x3e3917=[];for(var _0x56eff8=0x0,_0x552fe2;_0x56eff8<_0xfb135b[_0xc92e('0x3a')];_0x56eff8+=0x1){_0x552fe2=_0xfb135b[_0x56eff8][_0xc92e('0x16')]({'plain':!![]});switch(_0x552fe2[_0xc92e('0x37')]){case _0xc92e('0x3b'):_0x22feba(_0x552fe2)['catch'](_0x4b361e());break;case'onlyIfOpen':_0x27fcc0(_0x552fe2)[_0xc92e('0x2e')](_0x4b361e());break;default:_0x49b21a[_0xc92e('0x29')][_0xc92e('0x2a')]({'phone':_0xe7c624[_0xc92e('0xc')],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624[_0xc92e('0x2b')],'scheduledat':_0xe7c624['scheduledat']?_0xe7c624[_0xc92e('0x1b')]:moment()[_0xc92e('0x1c')](_0xc92e('0x1d')),'priority':_0xe7c624[_0xc92e('0x2c')]?_0xe7c624[_0xc92e('0x2c')]:0x2,'callback':_0xe7c624['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xe7c624[_0xc92e('0x2d')]?_0xe7c624[_0xc92e('0x2d')]:undefined,'callbackat':_0xe7c624[_0xc92e('0x2d')]?moment()[_0xc92e('0x1c')](_0xc92e('0x1d')):undefined,'CampaignId':_0x552fe2['id']})['catch'](_0x4b361e());}}}});})[_0xc92e('0x21')](function(){return _0x49b21a[_0xc92e('0x33')]['findAll']({'attributes':['id'],'include':[{'model':_0x49b21a[_0xc92e('0x38')],'as':'BlackLists','where':{'id':_0xe7c624[_0xc92e('0x2b')]}}]})[_0xc92e('0x21')](function(_0x397d42){if(_0x397d42){var _0x4c4cef=[];for(var _0x3e6420=0x0,_0x3af907;_0x3e6420<_0x397d42['length'];_0x3e6420+=0x1){_0x3af907=_0x397d42[_0x3e6420][_0xc92e('0x16')]({'plain':!![]});_0x49b21a[_0xc92e('0x3f')][_0xc92e('0x2a')]({'phone':_0xe7c624[_0xc92e('0xc')],'ContactId':_0xe7c624['id'],'ListId':_0xe7c624[_0xc92e('0x2b')],'CampaignId':_0x3af907['id']})[_0xc92e('0x2e')](function(_0x589b4b){logger[_0xc92e('0x17')](_0xc92e('0x40'),_0xc92e('0x19'),_0x589b4b[_0xc92e('0x41')]);});}}});})[_0xc92e('0x21')](function(){_0x3c4303();})['catch'](function(_0x34e026){logger['error'](_0xc92e('0x40'),_0xc92e('0x19'),_0x34e026[_0xc92e('0x41')]);_0x3c4303(_0x34e026);});}else{_0x3c4303(new Error(_0xc92e('0x42')));}},'afterDestroy':function(_0xa89684,_0x299bff,_0x2046a3){var _0x4fa61f=_0x4cdcd5[_0xc92e('0x15')];var _0x5c4b26=_0xa89684[_0xc92e('0x16')]({'plain':!![]});return _0x4fa61f['CmHopper'][_0xc92e('0x36')]({'raw':!![],'where':{'ListId':_0x5c4b26[_0xc92e('0x2b')],'ContactId':_0x5c4b26['id']}})[_0xc92e('0x21')](function(_0xf07ce7){if(!_[_0xc92e('0x43')](_0xf07ce7)){var _0x415ca7=[];for(var _0x476388=0x0;_0x476388<_0xf07ce7[_0xc92e('0x3a')];_0x476388+=0x1){var _0x1c5f50=_0x4fa61f[_0xc92e('0x29')]['destroy']({'where':{'ListId':_0xf07ce7[_0x476388][_0xc92e('0x2b')],'ContactId':_0xf07ce7[_0x476388][_0xc92e('0x44')],'VoiceQueueId':_0xf07ce7[_0x476388][_0xc92e('0x45')],'CampaignId':_0xf07ce7[_0x476388]['CampaignId']}});_0x415ca7['push'](_0x1c5f50);}return BPromise[_0xc92e('0x46')](_0x415ca7);}})[_0xc92e('0x21')](function(_0x3a5b85){logger[_0xc92e('0x47')](_0xc92e('0x48'),util[_0xc92e('0x1a')](_0x3a5b85,{'showHidden':![],'depth':null}));_0x2046a3();})[_0xc92e('0x2e')](function(_0x4f0b63){logger['error'](_0xc92e('0x49'),util[_0xc92e('0x1a')](_0x4f0b63,{'showHidden':![],'depth':null}));_0x2046a3(_0x4f0b63);});}}});}; \ No newline at end of file +var _0x0939=['priority','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','catch','cmContact','Campaign','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','outbound','BlackLists','CmHopperBlack','error','cmContact,\x20%s,\x20%s','findAll','message','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','get','afterCreate','inspect','scheduledat','format','isNil','VoiceQueue','findOne','dialTimezone','timezones','add','minutes','ret','CmHopper','then','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId'];(function(_0x457f99,_0x1664ac){var _0x58ce1b=function(_0x17720f){while(--_0x17720f){_0x457f99['push'](_0x457f99['shift']());}};_0x58ce1b(++_0x1664ac);}(_0x0939,0x195));var _0x9093=function(_0x6fd1fb,_0x382e82){_0x6fd1fb=_0x6fd1fb-0x0;var _0x462d53=_0x0939[_0x6fd1fb];return _0x462d53;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9093('0x0'))(_0x9093('0x1'));var moment=require(_0x9093('0x2'));var BPromise=require(_0x9093('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9093('0x4'));var rimraf=require(_0x9093('0x5'));var config=require(_0x9093('0x6'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module[_0x9093('0x7')]=function(_0x4ee96d,_0x4ebcc5){return _0x4ee96d[_0x9093('0x8')](_0x9093('0x9'),attributes,{'tableName':_0x9093('0xa'),'paranoid':!![],'indexes':[{'name':_0x9093('0xb'),'fields':[_0x9093('0xb')]},{'name':_0x9093('0xc'),'fields':[_0x9093('0xd'),_0x9093('0xe'),_0x9093('0xb'),_0x9093('0xf'),_0x9093('0x10'),_0x9093('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x9093('0x12'),'collate':_0x9093('0x13'),'hooks':{'afterCreate':function(_0x403371,_0x7901f0,_0xcd0fdd){var _0x5c16a2=_0x4ee96d['models'];var _0x4cdc88=_0x403371[_0x9093('0x14')]({'plain':!![]});function _0x373108(){return function(_0xebcbf4){logger['error']('cmContact',_0x9093('0x15'),util[_0x9093('0x16')](_0xebcbf4,{'showHidden':![],'depth':null}));};}function _0xde86e(_0x11e2da,_0x5063cc){var _0x5553fa=_0x5063cc[_0x9093('0x17')]?_0x5063cc[_0x9093('0x17')]:moment()[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x10b37e,_0x1fbb5d){if(_[_0x9093('0x19')](_0x5063cc['dialTimezone'])){_0x10b37e({'ret':_0x5553fa});}else{_0x5c16a2[_0x9093('0x1a')][_0x9093('0x1b')]({'where':{'id':_0x11e2da['id']}})['then'](function(_0x5ee1d4){if(!_[_0x9093('0x19')](_0x5ee1d4)){var _0x451e08=_0x5ee1d4[_0x9093('0x1c')];if(!_['isNil'](_0x451e08)){var _0x4e8824=shared[_0x9093('0x1d')];var _0x372647=_0x4e8824[_0x451e08];var _0x227577=_0x4e8824[_0x5063cc[_0x9093('0x1c')]];if(!_[_0x9093('0x19')](_0x372647)&&!_['isNil'](_0x227577)){var _0x398743=_0x372647['utcOffset']-_0x227577['utcOffset'];_0x5553fa=_0x5063cc['scheduledat']?_0x5063cc[_0x9093('0x17')]:moment();var _0x1fe8cb=moment(_0x5553fa)[_0x9093('0x1e')](_0x398743,_0x9093('0x1f'));_0x10b37e({'ret':_0x1fe8cb[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x10b37e({'ret':_0x5553fa});}else _0x10b37e({'ret':_0x5553fa});}else{_0x10b37e({'ret':_0x5553fa});}});}});return 0xa;}var _0x5dd766=function(_0x1f135d){return new BPromise(function(_0x44834f,_0x56fb4f){_0xde86e(_0x1f135d,_0x4cdc88)['then'](function(_0x2a2a52){_0x4cdc88['scheduledat']=_0x2a2a52[_0x9093('0x20')];_0x5c16a2[_0x9093('0x21')][_0x9093('0x1b')]({'where':{'phone':_0x4cdc88[_0x9093('0xb')],'VoiceQueueId':_0x1f135d['id']}})[_0x9093('0x22')](function(_0x33fcc2){if(!_[_0x9093('0x19')](_0x33fcc2)){throw new Error(_0x9093('0x23')+_0x4cdc88[_0x9093('0xb')]+_0x9093('0x24')+_0x1f135d['id']);}return _0x5c16a2[_0x9093('0x21')][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'priority':_0x4cdc88[_0x9093('0x27')]?_0x4cdc88['priority']:0x2,'scheduledat':_0x4cdc88[_0x9093('0x17')]?_0x4cdc88[_0x9093('0x17')]:moment()[_0x9093('0x18')](_0x9093('0x28')),'callback':_0x4cdc88[_0x9093('0x29')]?!![]:![],'callbackuniqueid':_0x4cdc88['callbackUniqueid']?_0x4cdc88[_0x9093('0x29')]:undefined,'callbackat':_0x4cdc88[_0x9093('0x29')]?moment()[_0x9093('0x18')](_0x9093('0x28')):undefined,'VoiceQueueId':_0x1f135d['id']});})['catch'](function(_0x5ed7d9){_0x56fb4f(_0x5ed7d9);});});});};var _0x90c5f9=function(_0x42c524){return new BPromise(function(_0x593ab6,_0x5c6b32){_0xde86e(_0x42c524,_0x4cdc88)[_0x9093('0x22')](function(_0xf66703){_0x4cdc88[_0x9093('0x17')]=_0xf66703['ret'];_0x5c16a2[_0x9093('0x21')][_0x9093('0x1b')]({'where':{'phone':_0x4cdc88[_0x9093('0xb')],'VoiceQueueId':_0x42c524['id']}})[_0x9093('0x22')](function(_0x32ae3c){if(!_['isNil'](_0x32ae3c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4cdc88[_0x9093('0xb')]+_0x9093('0x2a')+_0x42c524['id']);}return _0x5c16a2[_0x9093('0x2b')][_0x9093('0x1b')]({'where':{'calleridnum':_0x4cdc88[_0x9093('0xb')],'VoiceQueueId':_0x42c524['id']}});})[_0x9093('0x22')](function(_0x4cdebf){if(!_[_0x9093('0x19')](_0x4cdebf)){throw new Error(_0x9093('0x2c')+_0x4cdc88[_0x9093('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x42c524['id']);}return _0x5c16a2['CmHopper'][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'priority':_0x4cdc88['priority']?_0x4cdc88['priority']:0x2,'scheduledat':_0x4cdc88[_0x9093('0x17')]?_0x4cdc88[_0x9093('0x17')]:moment()[_0x9093('0x18')](_0x9093('0x28')),'callback':_0x4cdc88[_0x9093('0x29')]?!![]:![],'callbackuniqueid':_0x4cdc88[_0x9093('0x29')]?_0x4cdc88[_0x9093('0x29')]:undefined,'callbackat':_0x4cdc88[_0x9093('0x29')]?moment()[_0x9093('0x18')](_0x9093('0x28')):undefined,'VoiceQueueId':_0x42c524['id']});})[_0x9093('0x2d')](function(_0xc5f499){_0x5c6b32(_0xc5f499);});});});};function _0x4349fd(){return function(_0x4bf3f9){logger['error'](_0x9093('0x2e'),_0x9093('0x15'),util[_0x9093('0x16')](_0x4bf3f9,{'showHidden':![],'depth':null}));};}function _0x123468(_0x4e6ed4,_0x41270c){var _0x23f3d3=_0x41270c['scheduledat']?_0x41270c[_0x9093('0x17')]:moment()[_0x9093('0x18')](_0x9093('0x28'));return new BPromise(function(_0x1952a0,_0x4f2c85){if(_[_0x9093('0x19')](_0x41270c['dialTimezone'])){_0x1952a0({'ret':_0x23f3d3});}else{_0x5c16a2[_0x9093('0x2f')][_0x9093('0x1b')]({'where':{'id':_0x4e6ed4['id']}})['then'](function(_0x59f72b){if(!_[_0x9093('0x19')](_0x59f72b)){var _0x59204f=_0x59f72b[_0x9093('0x1c')];if(!_[_0x9093('0x19')](_0x59204f)){var _0x49066d=shared[_0x9093('0x1d')];var _0x10d650=_0x49066d[_0x59204f];var _0x15c953=_0x49066d[_0x41270c[_0x9093('0x1c')]];if(!_[_0x9093('0x19')](_0x10d650)&&!_[_0x9093('0x19')](_0x15c953)){var _0x208b4b=_0x10d650[_0x9093('0x30')]-_0x15c953[_0x9093('0x30')];_0x23f3d3=_0x41270c['scheduledat']?_0x41270c[_0x9093('0x17')]:moment();var _0x4f8a96=moment(_0x23f3d3)['add'](_0x208b4b,_0x9093('0x1f'));_0x1952a0({'ret':_0x4f8a96[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1952a0({'ret':_0x23f3d3});}else _0x1952a0({'ret':_0x23f3d3});}else{_0x1952a0({'ret':_0x23f3d3});}});}});return 0xa;}var _0x21ce0e=function(_0x2a679e){return new BPromise(function(_0x3e16e3,_0xb9e55b){_0x123468(_0x2a679e,_0x4cdc88)[_0x9093('0x22')](function(_0x59c1bd){_0x4cdc88[_0x9093('0x17')]=_0x59c1bd[_0x9093('0x20')];_0x5c16a2[_0x9093('0x21')][_0x9093('0x1b')]({'where':{'phone':_0x4cdc88['phone'],'CampaignId':_0x2a679e['id']}})[_0x9093('0x22')](function(_0x4827f7){if(!_[_0x9093('0x19')](_0x4827f7)){throw new Error(_0x9093('0x23')+_0x4cdc88[_0x9093('0xb')]+_0x9093('0x31')+_0x2a679e['id']);}return _0x5c16a2[_0x9093('0x21')][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'priority':_0x4cdc88['priority']?_0x4cdc88[_0x9093('0x27')]:0x2,'scheduledat':_0x4cdc88[_0x9093('0x17')]?_0x4cdc88[_0x9093('0x17')]:moment()[_0x9093('0x18')](_0x9093('0x28')),'callback':_0x4cdc88['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cdc88[_0x9093('0x29')]?_0x4cdc88[_0x9093('0x29')]:undefined,'callbackat':_0x4cdc88[_0x9093('0x29')]?moment()[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2a679e['id']});})[_0x9093('0x2d')](function(_0x22922d){_0xb9e55b(_0x22922d);});});});};var _0x23eec4=function(_0x2533d8){return new BPromise(function(_0x8b03ac,_0x85e32a){_0x123468(_0x2533d8,_0x4cdc88)['then'](function(_0x202765){_0x4cdc88[_0x9093('0x17')]=_0x202765[_0x9093('0x20')];_0x5c16a2[_0x9093('0x21')][_0x9093('0x1b')]({'where':{'phone':_0x4cdc88['phone'],'CampaignId':_0x2533d8['id']}})[_0x9093('0x22')](function(_0x21ce1f){if(!_[_0x9093('0x19')](_0x21ce1f)){throw new Error(_0x9093('0x23')+_0x4cdc88[_0x9093('0xb')]+_0x9093('0x32')+_0x2533d8['id']);}return _0x5c16a2[_0x9093('0x2b')][_0x9093('0x1b')]({'where':{'calleridnum':_0x4cdc88['phone'],'CampaignId':_0x2533d8['id']}});})[_0x9093('0x22')](function(_0x1bc4f0){if(!_['isNil'](_0x1bc4f0)){throw new Error(_0x9093('0x2c')+_0x4cdc88[_0x9093('0xb')]+_0x9093('0x33')+_0x2533d8['id']);}return _0x5c16a2[_0x9093('0x21')][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'priority':_0x4cdc88[_0x9093('0x27')]?_0x4cdc88['priority']:0x2,'scheduledat':_0x4cdc88[_0x9093('0x17')]?_0x4cdc88[_0x9093('0x17')]:moment()[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4cdc88['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cdc88[_0x9093('0x29')]?_0x4cdc88[_0x9093('0x29')]:undefined,'callbackat':_0x4cdc88[_0x9093('0x29')]?moment()[_0x9093('0x18')](_0x9093('0x28')):undefined,'CampaignId':_0x2533d8['id']});})[_0x9093('0x2d')](function(_0x496611){_0x85e32a(_0x496611);});});});};if(_0x4cdc88[_0x9093('0x26')]){_0x5c16a2[_0x9093('0x1a')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x9093('0x34'),_0x9093('0x1c')],'include':[{'model':_0x5c16a2[_0x9093('0x35')],'as':_0x9093('0x36'),'where':{'id':_0x4cdc88['ListId']}}]})[_0x9093('0x22')](function(_0x557660){if(_0x557660){var _0x59080c=[];for(var _0x318ea5=0x0,_0x5597c8;_0x318ea5<_0x557660[_0x9093('0x37')];_0x318ea5+=0x1){_0x5597c8=_0x557660[_0x318ea5]['get']({'plain':!![]});switch(_0x5597c8[_0x9093('0x34')]){case _0x9093('0x38'):_0x90c5f9(_0x5597c8)['catch'](_0x373108());break;case _0x9093('0x39'):_0x5dd766(_0x5597c8)[_0x9093('0x2d')](_0x373108());break;default:_0x123468(_0x5597c8,_0x4cdc88)[_0x9093('0x22')](function(_0x1630f0){_0x4cdc88['scheduledat']=_0x1630f0[_0x9093('0x20')];_0x5c16a2[_0x9093('0x21')][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88['ListId'],'scheduledat':_0x4cdc88[_0x9093('0x17')]?_0x4cdc88['scheduledat']:moment()[_0x9093('0x18')](_0x9093('0x28')),'priority':_0x4cdc88[_0x9093('0x27')]?_0x4cdc88[_0x9093('0x27')]:0x2,'callback':_0x4cdc88['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4cdc88['callbackUniqueid']?_0x4cdc88['callbackUniqueid']:undefined,'callbackat':_0x4cdc88['callbackUniqueid']?moment()['format'](_0x9093('0x28')):undefined,'VoiceQueueId':_0x5597c8['id']})[_0x9093('0x2d')](_0x373108());});}}}})[_0x9093('0x22')](function(){return _0x5c16a2[_0x9093('0x1a')]['findAll']({'where':{'type':_0x9093('0x3a')},'attributes':['id'],'include':[{'model':_0x5c16a2[_0x9093('0x35')],'as':_0x9093('0x3b'),'where':{'id':_0x4cdc88[_0x9093('0x26')]}}]})[_0x9093('0x22')](function(_0x135e6e){if(_0x135e6e){var _0x19a255=[];for(var _0x3e15a1=0x0,_0x24223d;_0x3e15a1<_0x135e6e[_0x9093('0x37')];_0x3e15a1+=0x1){_0x24223d=_0x135e6e[_0x3e15a1][_0x9093('0x14')]({'plain':!![]});_0x5c16a2[_0x9093('0x3c')][_0x9093('0x25')]({'phone':_0x4cdc88[_0x9093('0xb')],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'VoiceQueueId':_0x24223d['id']})['catch'](function(_0x1a3334){logger[_0x9093('0x3d')](_0x9093('0x3e'),_0x9093('0x15'),_0x1a3334['message']);});}}});})[_0x9093('0x22')](function(){return _0x5c16a2[_0x9093('0x2f')][_0x9093('0x3f')]({'attributes':['id',_0x9093('0x34'),_0x9093('0x1c')],'include':[{'model':_0x5c16a2[_0x9093('0x35')],'as':_0x9093('0x36'),'where':{'id':_0x4cdc88[_0x9093('0x26')]}}]})[_0x9093('0x22')](function(_0x30040a){if(_0x30040a){var _0x13bccf=[];for(var _0x1e574c=0x0,_0x522e76;_0x1e574c<_0x30040a[_0x9093('0x37')];_0x1e574c+=0x1){_0x522e76=_0x30040a[_0x1e574c][_0x9093('0x14')]({'plain':!![]});switch(_0x522e76[_0x9093('0x34')]){case _0x9093('0x38'):_0x23eec4(_0x522e76)[_0x9093('0x2d')](_0x4349fd());break;case _0x9093('0x39'):_0x21ce0e(_0x522e76)[_0x9093('0x2d')](_0x4349fd());break;default:_0x5c16a2['CmHopper'][_0x9093('0x25')]({'phone':_0x4cdc88['phone'],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'scheduledat':_0x4cdc88['scheduledat']?_0x4cdc88[_0x9093('0x17')]:moment()[_0x9093('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4cdc88['priority']?_0x4cdc88[_0x9093('0x27')]:0x2,'callback':_0x4cdc88[_0x9093('0x29')]?!![]:![],'callbackuniqueid':_0x4cdc88[_0x9093('0x29')]?_0x4cdc88[_0x9093('0x29')]:undefined,'callbackat':_0x4cdc88[_0x9093('0x29')]?moment()['format'](_0x9093('0x28')):undefined,'CampaignId':_0x522e76['id']})[_0x9093('0x2d')](_0x4349fd());}}}});})[_0x9093('0x22')](function(){return _0x5c16a2[_0x9093('0x2f')][_0x9093('0x3f')]({'attributes':['id'],'include':[{'model':_0x5c16a2[_0x9093('0x35')],'as':_0x9093('0x3b'),'where':{'id':_0x4cdc88[_0x9093('0x26')]}}]})[_0x9093('0x22')](function(_0x1e537f){if(_0x1e537f){var _0x1a49aa=[];for(var _0x2c38eb=0x0,_0x39075e;_0x2c38eb<_0x1e537f[_0x9093('0x37')];_0x2c38eb+=0x1){_0x39075e=_0x1e537f[_0x2c38eb][_0x9093('0x14')]({'plain':!![]});_0x5c16a2['CmHopperBlack'][_0x9093('0x25')]({'phone':_0x4cdc88['phone'],'ContactId':_0x4cdc88['id'],'ListId':_0x4cdc88[_0x9093('0x26')],'CampaignId':_0x39075e['id']})[_0x9093('0x2d')](function(_0x26b98c){logger['error'](_0x9093('0x3e'),'afterCreate',_0x26b98c['message']);});}}});})[_0x9093('0x22')](function(){_0xcd0fdd();})[_0x9093('0x2d')](function(_0x6b43cd){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x6b43cd[_0x9093('0x40')]);_0xcd0fdd(_0x6b43cd);});}else{_0xcd0fdd(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x584873,_0x1c36e9,_0x1c2f47){var _0xe07b71=_0x4ee96d['models'];var _0x3855fe=_0x584873['get']({'plain':!![]});return _0xe07b71[_0x9093('0x21')][_0x9093('0x3f')]({'raw':!![],'where':{'ListId':_0x3855fe[_0x9093('0x26')],'ContactId':_0x3855fe['id']}})[_0x9093('0x22')](function(_0x1f9d39){if(!_[_0x9093('0x41')](_0x1f9d39)){var _0x2deeb8=[];for(var _0x107590=0x0;_0x107590<_0x1f9d39[_0x9093('0x37')];_0x107590+=0x1){var _0x512bd0=_0xe07b71[_0x9093('0x21')][_0x9093('0x42')]({'where':{'ListId':_0x1f9d39[_0x107590]['ListId'],'ContactId':_0x1f9d39[_0x107590][_0x9093('0x43')],'VoiceQueueId':_0x1f9d39[_0x107590][_0x9093('0x44')],'CampaignId':_0x1f9d39[_0x107590]['CampaignId']}});_0x2deeb8[_0x9093('0x45')](_0x512bd0);}return BPromise[_0x9093('0x46')](_0x2deeb8);}})[_0x9093('0x22')](function(_0x29f2b6){logger[_0x9093('0x47')](_0x9093('0x48'),util[_0x9093('0x16')](_0x29f2b6,{'showHidden':![],'depth':null}));_0x1c2f47();})[_0x9093('0x2d')](function(_0x57026b){logger[_0x9093('0x3d')](_0x9093('0x49'),util[_0x9093('0x16')](_0x57026b,{'showHidden':![],'depth':null}));_0x1c2f47(_0x57026b);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 0e7e654..74fcb46 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(_0x47684c,_0x513a49){var _0x4024c3=function(_0x327d6a){while(--_0x327d6a){_0x47684c['push'](_0x47684c['shift']());}};_0x4024c3(++_0x513a49);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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(_0x45d575,_0x3ef021){var _0xa39404=function(_0x3cda3a){while(--_0x3cda3a){_0x45d575['push'](_0x45d575['shift']());}};_0xa39404(++_0x3ef021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 fe48d52..bff47f1 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 _0xdeb3=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0xcff572,_0x5af75c){var _0x28b904=function(_0x73233a){while(--_0x73233a){_0xcff572['push'](_0xcff572['shift']());}};_0x28b904(++_0x5af75c);}(_0xdeb3,0xeb));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x3deb('0x0'));module[_0x3deb('0x1')]={'CmContactId':{'type':Sequelize[_0x3deb('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x3deb('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x3deb('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x3deb('0x3')],'defaultValue':_0x3deb('0x4')},'OrderBy':{'type':Sequelize[_0x3deb('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x3deb('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x4016=['STRING','exports','INTEGER','PHONE'];(function(_0x284240,_0x555b56){var _0x390667=function(_0x409454){while(--_0x409454){_0x284240['push'](_0x284240['shift']());}};_0x390667(++_0x555b56);}(_0x4016,0x131));var _0x6401=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4016[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x6401('0x0')]={'CmContactId':{'type':Sequelize[_0x6401('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x6401('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x6401('0x3')],'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 0b1b768..a327492 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 _0x2e20=['then','destroy','get','CmContactHasItems','UserProfileResource','sendStatus','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0x532402,_0x127c1d){var _0x5d35d9=function(_0xa5f80){while(--_0xa5f80){_0x532402['push'](_0x532402['shift']());}};_0x5d35d9(++_0x127c1d);}(_0x2e20,0x122));var _0x02e2=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x2e20[_0x485abd];return _0x3379f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02e2('0x0'));var zipdir=require(_0x02e2('0x1'));var jsonpatch=require(_0x02e2('0x2'));var rp=require(_0x02e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x02e2('0x4'));var sox=require(_0x02e2('0x5'));var csv=require(_0x02e2('0x6'));var ejs=require(_0x02e2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02e2('0x8'));var squel=require(_0x02e2('0x9'));var crypto=require(_0x02e2('0xa'));var jsforce=require(_0x02e2('0xb'));var deskjs=require(_0x02e2('0xc'));var toCsv=require(_0x02e2('0x6'));var querystring=require('querystring');var Papa=require(_0x02e2('0xd'));var Redis=require(_0x02e2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x02e2('0xf'));var as=require(_0x02e2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x02e2('0x11'));var utils=require(_0x02e2('0x12'));var config=require(_0x02e2('0x13'));var licenseUtil=require(_0x02e2('0x14'));var db=require(_0x02e2('0x15'))['db'];function respondWithStatusCode(_0x30026a,_0x3d5d1e){_0x3d5d1e=_0x3d5d1e||0xcc;return function(_0x3aaeed){if(_0x3aaeed){return _0x30026a['sendStatus'](_0x3d5d1e);}return _0x30026a[_0x02e2('0x16')](_0x3d5d1e)[_0x02e2('0x17')]();};}function respondWithResult(_0x5588bf,_0x5830cf){_0x5830cf=_0x5830cf||0xc8;return function(_0x375af2){if(_0x375af2){return _0x5588bf[_0x02e2('0x16')](_0x5830cf)['json'](_0x375af2);}};}function respondWithFilteredResult(_0x484125,_0x3625c8){return function(_0x2095f4){if(_0x2095f4){var _0xa2e196=typeof _0x3625c8['offset']==='undefined'&&typeof _0x3625c8[_0x02e2('0x18')]===_0x02e2('0x19');var _0x471e32=_0x2095f4[_0x02e2('0x1a')];var _0x2d898f=_0xa2e196?0x0:_0x3625c8[_0x02e2('0x1b')];var _0x3698dd=_0xa2e196?_0x2095f4[_0x02e2('0x1a')]:_0x3625c8['offset']+_0x3625c8['limit'];var _0x2a9945;if(_0x3698dd>=_0x471e32){_0x3698dd=_0x471e32;_0x2a9945=0xc8;}else{_0x2a9945=0xce;}_0x484125[_0x02e2('0x16')](_0x2a9945);return _0x484125[_0x02e2('0x1c')](_0x02e2('0x1d'),_0x2d898f+'-'+_0x3698dd+'/'+_0x471e32)[_0x02e2('0x1e')](_0x2095f4);}return null;};}function patchUpdates(_0x3e4a44){return function(_0x1f967f){try{jsonpatch[_0x02e2('0x1f')](_0x1f967f,_0x3e4a44,!![]);}catch(_0x47a941){return BPromise[_0x02e2('0x20')](_0x47a941);}return _0x1f967f[_0x02e2('0x21')]();};}function saveUpdates(_0x324793,_0x86cb78){return function(_0x266518){if(_0x266518){return _0x266518['update'](_0x324793)[_0x02e2('0x22')](function(_0x55cb6c){return _0x55cb6c;});}return null;};}function removeEntity(_0x3ee9a4,_0x3d7dd8){return function(_0x3cfe0b){if(_0x3cfe0b){return _0x3cfe0b[_0x02e2('0x23')]()[_0x02e2('0x22')](function(){var _0x3ab19b=_0x3cfe0b[_0x02e2('0x24')]({'plain':!![]});var _0x3bf899=_0x02e2('0x25');return db[_0x02e2('0x26')]['destroy']({'where':{'type':_0x3bf899,'resourceId':_0x3ab19b['id']}})[_0x02e2('0x22')](function(){return _0x3cfe0b;});})[_0x02e2('0x22')](function(){_0x3ee9a4[_0x02e2('0x16')](0xcc)[_0x02e2('0x17')]();});}};}function handleEntityNotFound(_0x22734e,_0xc9e0c6){return function(_0x211f8c){if(!_0x211f8c){_0x22734e[_0x02e2('0x27')](0x194);}return _0x211f8c;};}function handleError(_0x3854ed,_0x40835d){_0x40835d=_0x40835d||0x1f4;return function(_0x2e17fa){logger['error'](_0x2e17fa['stack']);if(_0x2e17fa[_0x02e2('0x28')]){delete _0x2e17fa['name'];}_0x3854ed['status'](_0x40835d)[_0x02e2('0x29')](_0x2e17fa);};}exports[_0x02e2('0x2a')]=function(_0x535cef,_0x1a3438){var _0x46916f={},_0x49d80d={},_0x1e9152={'count':0x0,'rows':[]};var _0x504ba9=_['map'](db[_0x02e2('0x2b')][_0x02e2('0x2c')],function(_0x29d12f){return{'name':_0x29d12f[_0x02e2('0x2d')],'type':_0x29d12f[_0x02e2('0x2e')][_0x02e2('0x2f')]};});_0x49d80d['model']=_[_0x02e2('0x30')](_0x504ba9,'name');_0x49d80d[_0x02e2('0x31')]=_[_0x02e2('0x32')](_0x535cef[_0x02e2('0x31')]);_0x49d80d['filters']=_[_0x02e2('0x33')](_0x49d80d[_0x02e2('0x34')],_0x49d80d[_0x02e2('0x31')]);_0x46916f['attributes']=_[_0x02e2('0x33')](_0x49d80d[_0x02e2('0x34')],qs[_0x02e2('0x35')](_0x535cef[_0x02e2('0x31')][_0x02e2('0x35')]));_0x46916f[_0x02e2('0x36')]=_0x46916f[_0x02e2('0x36')][_0x02e2('0x37')]?_0x46916f[_0x02e2('0x36')]:_0x49d80d[_0x02e2('0x34')];if(!_0x535cef[_0x02e2('0x31')]['hasOwnProperty'](_0x02e2('0x38'))){_0x46916f['limit']=qs[_0x02e2('0x18')](_0x535cef['query'][_0x02e2('0x18')]);_0x46916f[_0x02e2('0x1b')]=qs['offset'](_0x535cef[_0x02e2('0x31')][_0x02e2('0x1b')]);}_0x46916f[_0x02e2('0x39')]=qs[_0x02e2('0x3a')](_0x535cef[_0x02e2('0x31')][_0x02e2('0x3a')]);_0x46916f['where']=qs[_0x02e2('0x3b')](_[_0x02e2('0x3c')](_0x535cef['query'],_0x49d80d[_0x02e2('0x3b')]),_0x504ba9);if(_0x535cef['query']['filter']){_0x46916f[_0x02e2('0x3d')]=_[_0x02e2('0x3e')](_0x46916f[_0x02e2('0x3d')],{'$or':_[_0x02e2('0x30')](_0x504ba9,function(_0x19f94e){if(_0x19f94e[_0x02e2('0x2e')]!==_0x02e2('0x3f')){var _0x279391={};_0x279391[_0x19f94e[_0x02e2('0x28')]]={'$like':'%'+_0x535cef[_0x02e2('0x31')]['filter']+'%'};return _0x279391;}})});}_0x46916f=_[_0x02e2('0x3e')]({},_0x46916f,_0x535cef['options']);var _0x3af74d={'where':_0x46916f['where']};return db['CmContactHasItem'][_0x02e2('0x1a')](_0x3af74d)[_0x02e2('0x22')](function(_0x43b227){_0x1e9152[_0x02e2('0x1a')]=_0x43b227;if(_0x535cef[_0x02e2('0x31')][_0x02e2('0x40')]){_0x46916f[_0x02e2('0x41')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x02e2('0x42')](_0x46916f);})['then'](function(_0x141c6c){_0x1e9152[_0x02e2('0x43')]=_0x141c6c;return _0x1e9152;})['then'](respondWithFilteredResult(_0x1a3438,_0x46916f))['catch'](handleError(_0x1a3438,null));};exports[_0x02e2('0x44')]=function(_0x5863fb,_0x16638f){var _0x2c76ee={'raw':!![],'where':{'id':_0x5863fb[_0x02e2('0x45')]['id']}},_0x29656b={};_0x29656b[_0x02e2('0x34')]=_[_0x02e2('0x32')](db[_0x02e2('0x2b')][_0x02e2('0x2c')]);_0x29656b[_0x02e2('0x31')]=_['keys'](_0x5863fb[_0x02e2('0x31')]);_0x29656b['filters']=_[_0x02e2('0x33')](_0x29656b['model'],_0x29656b[_0x02e2('0x31')]);_0x2c76ee[_0x02e2('0x36')]=_['intersection'](_0x29656b[_0x02e2('0x34')],qs[_0x02e2('0x35')](_0x5863fb[_0x02e2('0x31')]['fields']));_0x2c76ee[_0x02e2('0x36')]=_0x2c76ee[_0x02e2('0x36')]['length']?_0x2c76ee[_0x02e2('0x36')]:_0x29656b[_0x02e2('0x34')];if(_0x5863fb[_0x02e2('0x31')]['includeAll']){_0x2c76ee['include']=[{'all':!![]}];}_0x2c76ee=_[_0x02e2('0x3e')]({},_0x2c76ee,_0x5863fb[_0x02e2('0x46')]);return db[_0x02e2('0x2b')][_0x02e2('0x47')](_0x2c76ee)[_0x02e2('0x22')](handleEntityNotFound(_0x16638f,null))[_0x02e2('0x22')](respondWithResult(_0x16638f,null))[_0x02e2('0x48')](handleError(_0x16638f,null));};exports['create']=function(_0x57bbd2,_0xfe94a5){return db[_0x02e2('0x2b')][_0x02e2('0x49')](_0x57bbd2[_0x02e2('0x4a')],{})[_0x02e2('0x22')](function(_0x2c0fcb){var _0x34ee77=_0x57bbd2[_0x02e2('0x4b')]['get']({'plain':!![]});if(!_0x34ee77)throw new Error(_0x02e2('0x4c'));if(_0x34ee77[_0x02e2('0x4d')]===_0x02e2('0x4b')){var _0x1e753c=_0x2c0fcb[_0x02e2('0x24')]({'plain':!![]});var _0x571cdc=_0x02e2('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x571cdc,'userProfileId':_0x34ee77[_0x02e2('0x4e')]},'raw':!![]})[_0x02e2('0x22')](function(_0x53acc4){if(_0x53acc4&&_0x53acc4[_0x02e2('0x4f')]===0x0){return db['UserProfileResource'][_0x02e2('0x49')]({'name':_0x1e753c['name'],'resourceId':_0x1e753c['id'],'type':_0x53acc4[_0x02e2('0x28')],'sectionId':_0x53acc4['id']},{})[_0x02e2('0x22')](function(){return _0x2c0fcb;});}else{return _0x2c0fcb;}})[_0x02e2('0x48')](function(_0x3cdf03){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cdf03);throw _0x3cdf03;});}return _0x2c0fcb;})[_0x02e2('0x22')](respondWithResult(_0xfe94a5,0xc9))[_0x02e2('0x48')](handleError(_0xfe94a5,null));};exports[_0x02e2('0x50')]=function(_0x4d3cbb,_0x5ce11d){if(_0x4d3cbb['body']['id']){delete _0x4d3cbb['body']['id'];}return db[_0x02e2('0x2b')][_0x02e2('0x47')]({'where':{'id':_0x4d3cbb[_0x02e2('0x45')]['id']}})[_0x02e2('0x22')](handleEntityNotFound(_0x5ce11d,null))[_0x02e2('0x22')](saveUpdates(_0x4d3cbb[_0x02e2('0x4a')],null))[_0x02e2('0x22')](respondWithResult(_0x5ce11d,null))[_0x02e2('0x48')](handleError(_0x5ce11d,null));};exports['destroy']=function(_0x74217,_0x4ce7da){return db['CmContactHasItem']['find']({'where':{'id':_0x74217[_0x02e2('0x45')]['id']}})[_0x02e2('0x22')](handleEntityNotFound(_0x4ce7da,null))['then'](removeEntity(_0x4ce7da,null))[_0x02e2('0x48')](handleError(_0x4ce7da,null));}; \ No newline at end of file +var _0x6bc1=['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','set','Content-Range','apply','reject','update','then','CmContactHasItems','UserProfileResource','error','stack','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','model','map','filters','attributes','length','query','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','intersection','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','destroy','eml-format','rimraf','request-promise','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse'];(function(_0x2929a0,_0x2c81c4){var _0x39cf7e=function(_0x12108a){while(--_0x12108a){_0x2929a0['push'](_0x2929a0['shift']());}};_0x39cf7e(++_0x2c81c4);}(_0x6bc1,0x1d2));var _0x16bc=function(_0x1c05ec,_0x344d58){_0x1c05ec=_0x1c05ec-0x0;var _0x3fe0a2=_0x6bc1[_0x1c05ec];return _0x3fe0a2;};'use strict';var emlformat=require(_0x16bc('0x0'));var rimraf=require(_0x16bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16bc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x16bc('0x3'));var util=require(_0x16bc('0x4'));var path=require(_0x16bc('0x5'));var sox=require(_0x16bc('0x6'));var csv=require('to-csv');var ejs=require(_0x16bc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16bc('0x8'));var squel=require(_0x16bc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x16bc('0xa'));var toCsv=require(_0x16bc('0xb'));var querystring=require(_0x16bc('0xc'));var Papa=require(_0x16bc('0xd'));var Redis=require(_0x16bc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x16bc('0xf'));var as=require(_0x16bc('0x10'));var hardwareService=require(_0x16bc('0x11'));var logger=require(_0x16bc('0x12'))(_0x16bc('0x13'));var utils=require(_0x16bc('0x14'));var config=require(_0x16bc('0x15'));var licenseUtil=require(_0x16bc('0x16'));var db=require(_0x16bc('0x17'))['db'];function respondWithStatusCode(_0x301d2e,_0x2a6184){_0x2a6184=_0x2a6184||0xcc;return function(_0x5033ac){if(_0x5033ac){return _0x301d2e['sendStatus'](_0x2a6184);}return _0x301d2e[_0x16bc('0x18')](_0x2a6184)[_0x16bc('0x19')]();};}function respondWithResult(_0x5de5c,_0x5a5345){_0x5a5345=_0x5a5345||0xc8;return function(_0x4f29bb){if(_0x4f29bb){return _0x5de5c[_0x16bc('0x18')](_0x5a5345)[_0x16bc('0x1a')](_0x4f29bb);}};}function respondWithFilteredResult(_0x5ab66b,_0x5f0f4f){return function(_0x51c9e5){if(_0x51c9e5){var _0x77fe2d=typeof _0x5f0f4f[_0x16bc('0x1b')]===_0x16bc('0x1c')&&typeof _0x5f0f4f[_0x16bc('0x1d')]===_0x16bc('0x1c');var _0x2c4a7a=_0x51c9e5[_0x16bc('0x1e')];var _0x4d6128=_0x77fe2d?0x0:_0x5f0f4f['offset'];var _0x25b803=_0x77fe2d?_0x51c9e5[_0x16bc('0x1e')]:_0x5f0f4f['offset']+_0x5f0f4f[_0x16bc('0x1d')];var _0x18b4b2;if(_0x25b803>=_0x2c4a7a){_0x25b803=_0x2c4a7a;_0x18b4b2=0xc8;}else{_0x18b4b2=0xce;}_0x5ab66b[_0x16bc('0x18')](_0x18b4b2);return _0x5ab66b[_0x16bc('0x1f')](_0x16bc('0x20'),_0x4d6128+'-'+_0x25b803+'/'+_0x2c4a7a)[_0x16bc('0x1a')](_0x51c9e5);}return null;};}function patchUpdates(_0x49080b){return function(_0x6377c2){try{jsonpatch[_0x16bc('0x21')](_0x6377c2,_0x49080b,!![]);}catch(_0x2c3643){return BPromise[_0x16bc('0x22')](_0x2c3643);}return _0x6377c2['save']();};}function saveUpdates(_0x7bc128,_0xfb552f){return function(_0x5b0e52){if(_0x5b0e52){return _0x5b0e52[_0x16bc('0x23')](_0x7bc128)[_0x16bc('0x24')](function(_0x2afaf4){return _0x2afaf4;});}return null;};}function removeEntity(_0x3adab3,_0x1b703b){return function(_0x4d66b9){if(_0x4d66b9){return _0x4d66b9['destroy']()['then'](function(){var _0x8dd361=_0x4d66b9['get']({'plain':!![]});var _0x5ead03=_0x16bc('0x25');return db[_0x16bc('0x26')]['destroy']({'where':{'type':_0x5ead03,'resourceId':_0x8dd361['id']}})[_0x16bc('0x24')](function(){return _0x4d66b9;});})['then'](function(){_0x3adab3[_0x16bc('0x18')](0xcc)[_0x16bc('0x19')]();});}};}function handleEntityNotFound(_0x45e5d9,_0x360f3a){return function(_0x232a59){if(!_0x232a59){_0x45e5d9['sendStatus'](0x194);}return _0x232a59;};}function handleError(_0xe56acc,_0x385d6a){_0x385d6a=_0x385d6a||0x1f4;return function(_0x345dc3){logger[_0x16bc('0x27')](_0x345dc3[_0x16bc('0x28')]);if(_0x345dc3[_0x16bc('0x29')]){delete _0x345dc3[_0x16bc('0x29')];}_0xe56acc[_0x16bc('0x18')](_0x385d6a)[_0x16bc('0x2a')](_0x345dc3);};}exports[_0x16bc('0x2b')]=function(_0x4668f9,_0x3e9f0c){var _0x10f419={},_0x2ecf55={},_0x2399bb={'count':0x0,'rows':[]};var _0x354a4e=_['map'](db[_0x16bc('0x2c')][_0x16bc('0x2d')],function(_0x19451a){return{'name':_0x19451a[_0x16bc('0x2e')],'type':_0x19451a[_0x16bc('0x2f')]['key']};});_0x2ecf55[_0x16bc('0x30')]=_[_0x16bc('0x31')](_0x354a4e,_0x16bc('0x29'));_0x2ecf55['query']=_['keys'](_0x4668f9['query']);_0x2ecf55[_0x16bc('0x32')]=_['intersection'](_0x2ecf55[_0x16bc('0x30')],_0x2ecf55['query']);_0x10f419[_0x16bc('0x33')]=_['intersection'](_0x2ecf55[_0x16bc('0x30')],qs['fields'](_0x4668f9['query']['fields']));_0x10f419[_0x16bc('0x33')]=_0x10f419[_0x16bc('0x33')][_0x16bc('0x34')]?_0x10f419[_0x16bc('0x33')]:_0x2ecf55['model'];if(!_0x4668f9[_0x16bc('0x35')]['hasOwnProperty'](_0x16bc('0x36'))){_0x10f419[_0x16bc('0x1d')]=qs[_0x16bc('0x1d')](_0x4668f9['query'][_0x16bc('0x1d')]);_0x10f419['offset']=qs[_0x16bc('0x1b')](_0x4668f9['query'][_0x16bc('0x1b')]);}_0x10f419['order']=qs[_0x16bc('0x37')](_0x4668f9['query'][_0x16bc('0x37')]);_0x10f419[_0x16bc('0x38')]=qs[_0x16bc('0x32')](_[_0x16bc('0x39')](_0x4668f9[_0x16bc('0x35')],_0x2ecf55['filters']),_0x354a4e);if(_0x4668f9[_0x16bc('0x35')]['filter']){_0x10f419[_0x16bc('0x38')]=_['merge'](_0x10f419[_0x16bc('0x38')],{'$or':_[_0x16bc('0x31')](_0x354a4e,function(_0x4152a6){if(_0x4152a6['type']!==_0x16bc('0x3a')){var _0x5ac691={};_0x5ac691[_0x4152a6[_0x16bc('0x29')]]={'$like':'%'+_0x4668f9['query'][_0x16bc('0x3b')]+'%'};return _0x5ac691;}})});}_0x10f419=_[_0x16bc('0x3c')]({},_0x10f419,_0x4668f9[_0x16bc('0x3d')]);var _0x54a1fa={'where':_0x10f419[_0x16bc('0x38')]};return db[_0x16bc('0x2c')][_0x16bc('0x1e')](_0x54a1fa)[_0x16bc('0x24')](function(_0x2f98c4){_0x2399bb[_0x16bc('0x1e')]=_0x2f98c4;if(_0x4668f9[_0x16bc('0x35')][_0x16bc('0x3e')]){_0x10f419['include']=[{'all':!![]}];}return db[_0x16bc('0x2c')][_0x16bc('0x3f')](_0x10f419);})['then'](function(_0x3fdf4d){_0x2399bb[_0x16bc('0x40')]=_0x3fdf4d;return _0x2399bb;})['then'](respondWithFilteredResult(_0x3e9f0c,_0x10f419))[_0x16bc('0x41')](handleError(_0x3e9f0c,null));};exports[_0x16bc('0x42')]=function(_0x1fe116,_0x3cb136){var _0x4fdd82={'raw':!![],'where':{'id':_0x1fe116[_0x16bc('0x43')]['id']}},_0x4049d8={};_0x4049d8[_0x16bc('0x30')]=_['keys'](db[_0x16bc('0x2c')][_0x16bc('0x2d')]);_0x4049d8['query']=_['keys'](_0x1fe116[_0x16bc('0x35')]);_0x4049d8['filters']=_[_0x16bc('0x44')](_0x4049d8['model'],_0x4049d8['query']);_0x4fdd82['attributes']=_[_0x16bc('0x44')](_0x4049d8[_0x16bc('0x30')],qs[_0x16bc('0x45')](_0x1fe116[_0x16bc('0x35')]['fields']));_0x4fdd82[_0x16bc('0x33')]=_0x4fdd82[_0x16bc('0x33')]['length']?_0x4fdd82[_0x16bc('0x33')]:_0x4049d8[_0x16bc('0x30')];if(_0x1fe116[_0x16bc('0x35')][_0x16bc('0x3e')]){_0x4fdd82['include']=[{'all':!![]}];}_0x4fdd82=_[_0x16bc('0x3c')]({},_0x4fdd82,_0x1fe116[_0x16bc('0x3d')]);return db['CmContactHasItem'][_0x16bc('0x46')](_0x4fdd82)[_0x16bc('0x24')](handleEntityNotFound(_0x3cb136,null))[_0x16bc('0x24')](respondWithResult(_0x3cb136,null))[_0x16bc('0x41')](handleError(_0x3cb136,null));};exports[_0x16bc('0x47')]=function(_0x5e4846,_0x3d72e1){return db['CmContactHasItem'][_0x16bc('0x47')](_0x5e4846[_0x16bc('0x48')],{})['then'](function(_0x2d6db2){var _0x41e892=_0x5e4846['user'][_0x16bc('0x49')]({'plain':!![]});if(!_0x41e892)throw new Error(_0x16bc('0x4a'));if(_0x41e892[_0x16bc('0x4b')]===_0x16bc('0x4c')){var _0x10bc96=_0x2d6db2[_0x16bc('0x49')]({'plain':!![]});var _0x2d1413=_0x16bc('0x25');return db[_0x16bc('0x4d')][_0x16bc('0x46')]({'where':{'name':_0x2d1413,'userProfileId':_0x41e892[_0x16bc('0x4e')]},'raw':!![]})[_0x16bc('0x24')](function(_0x41a69f){if(_0x41a69f&&_0x41a69f['autoAssociation']===0x0){return db[_0x16bc('0x26')][_0x16bc('0x47')]({'name':_0x10bc96[_0x16bc('0x29')],'resourceId':_0x10bc96['id'],'type':_0x41a69f[_0x16bc('0x29')],'sectionId':_0x41a69f['id']},{})[_0x16bc('0x24')](function(){return _0x2d6db2;});}else{return _0x2d6db2;}})[_0x16bc('0x41')](function(_0x2c0359){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c0359);throw _0x2c0359;});}return _0x2d6db2;})[_0x16bc('0x24')](respondWithResult(_0x3d72e1,0xc9))[_0x16bc('0x41')](handleError(_0x3d72e1,null));};exports['update']=function(_0x45cbe2,_0x43f38b){if(_0x45cbe2[_0x16bc('0x48')]['id']){delete _0x45cbe2[_0x16bc('0x48')]['id'];}return db[_0x16bc('0x2c')][_0x16bc('0x46')]({'where':{'id':_0x45cbe2[_0x16bc('0x43')]['id']}})[_0x16bc('0x24')](handleEntityNotFound(_0x43f38b,null))[_0x16bc('0x24')](saveUpdates(_0x45cbe2[_0x16bc('0x48')],null))['then'](respondWithResult(_0x43f38b,null))[_0x16bc('0x41')](handleError(_0x43f38b,null));};exports[_0x16bc('0x4f')]=function(_0x3e3a4b,_0x3d1b81){return db[_0x16bc('0x2c')][_0x16bc('0x46')]({'where':{'id':_0x3e3a4b[_0x16bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d1b81,null))[_0x16bc('0x24')](removeEntity(_0x3d1b81,null))[_0x16bc('0x41')](handleError(_0x3d1b81,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 0a682b5..8baa593 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 _0xac53=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api'];(function(_0x47cedd,_0x35f120){var _0x2fd2ce=function(_0x28cffb){while(--_0x28cffb){_0x47cedd['push'](_0x47cedd['shift']());}};_0x2fd2ce(++_0x35f120);}(_0xac53,0xf4));var _0x3ac5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac53[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3ac5('0x0'));var logger=require(_0x3ac5('0x1'))(_0x3ac5('0x2'));var moment=require(_0x3ac5('0x3'));var BPromise=require(_0x3ac5('0x4'));var rp=require(_0x3ac5('0x5'));var fs=require('fs');var path=require(_0x3ac5('0x6'));var rimraf=require(_0x3ac5('0x7'));var config=require(_0x3ac5('0x8'));var attributes=require(_0x3ac5('0x9'));module[_0x3ac5('0xa')]=function(_0xe26e52,_0x58e3a1){return _0xe26e52['define'](_0x3ac5('0xb'),attributes,{'tableName':_0x3ac5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7910=['api','moment','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x1c2d36,_0x3365f1){var _0x2d240e=function(_0x5c80d2){while(--_0x5c80d2){_0x1c2d36['push'](_0x1c2d36['shift']());}};_0x2d240e(++_0x3365f1);}(_0x7910,0x19e));var _0x0791=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x7910[_0x4bacb6];return _0x58c029;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0791('0x0'));var moment=require(_0x0791('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0791('0x2'));var rimraf=require(_0x0791('0x3'));var config=require(_0x0791('0x4'));var attributes=require(_0x0791('0x5'));module[_0x0791('0x6')]=function(_0x115381,_0x1d68a4){return _0x115381[_0x0791('0x7')](_0x0791('0x8'),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 7d57a31..51d00a3 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 _0x594c=['error','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x594c,0x1bb));var _0xc594=function(_0x3ce7da,_0xab31d){_0x3ce7da=_0x3ce7da-0x0;var _0x3a90b6=_0x594c[_0x3ce7da];return _0x3a90b6;};'use strict';var _=require(_0xc594('0x0'));var util=require('util');var moment=require(_0xc594('0x1'));var BPromise=require(_0xc594('0x2'));var rs=require(_0xc594('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc594('0x4'))['db'];var utils=require(_0xc594('0x5'));var logger=require(_0xc594('0x6'))(_0xc594('0x7'));var config=require(_0xc594('0x8'));var jayson=require(_0xc594('0x9'));var client=jayson[_0xc594('0xa')][_0xc594('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2374d8,_0x303459,_0x33cd1d){return new BPromise(function(_0x4598ae,_0x50f9c0){return client['request'](_0x2374d8,_0x33cd1d)[_0xc594('0xc')](function(_0x2bd6cd){logger[_0xc594('0xd')](_0xc594('0xe'),_0x303459,_0xc594('0xf'));logger['debug'](_0xc594('0x10'),_0x303459,'request\x20sent',JSON[_0xc594('0x11')](_0x2bd6cd));if(_0x2bd6cd['error']){if(_0x2bd6cd['error'][_0xc594('0x12')]===0x1f4){logger[_0xc594('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x303459,_0x2bd6cd[_0xc594('0x13')][_0xc594('0x14')]);return _0x50f9c0(_0x2bd6cd[_0xc594('0x13')][_0xc594('0x14')]);}logger[_0xc594('0x13')](_0xc594('0xe'),_0x303459,_0x2bd6cd[_0xc594('0x13')][_0xc594('0x14')]);return _0x4598ae(_0x2bd6cd[_0xc594('0x13')]['message']);}else{logger[_0xc594('0xd')](_0xc594('0xe'),_0x303459,_0xc594('0xf'));_0x4598ae(_0x2bd6cd['result'][_0xc594('0x14')]);}})['catch'](function(_0x396bb2){logger[_0xc594('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x303459,_0x396bb2);_0x50f9c0(_0x396bb2);});});} \ No newline at end of file +var _0x48f3=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x21f591,_0x1924f6){var _0x4a10b3=function(_0x5a5cf9){while(--_0x5a5cf9){_0x21f591['push'](_0x21f591['shift']());}};_0x4a10b3(++_0x1924f6);}(_0x48f3,0xc7));var _0x348f=function(_0x17f8dd,_0x538286){_0x17f8dd=_0x17f8dd-0x0;var _0x5049de=_0x48f3[_0x17f8dd];return _0x5049de;};'use strict';var _=require(_0x348f('0x0'));var util=require(_0x348f('0x1'));var moment=require(_0x348f('0x2'));var BPromise=require(_0x348f('0x3'));var rs=require(_0x348f('0x4'));var fs=require('fs');var Redis=require(_0x348f('0x5'));var db=require(_0x348f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x348f('0x7'))(_0x348f('0x8'));var config=require(_0x348f('0x9'));var jayson=require(_0x348f('0xa'));var client=jayson[_0x348f('0xb')][_0x348f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xecedb4,_0x2ea805,_0x4e350b){return new BPromise(function(_0x5afd98,_0x3835b4){return client['request'](_0xecedb4,_0x4e350b)['then'](function(_0x275b1b){logger[_0x348f('0xd')](_0x348f('0xe'),_0x2ea805,_0x348f('0xf'));logger[_0x348f('0x10')](_0x348f('0x11'),_0x2ea805,'request\x20sent',JSON['stringify'](_0x275b1b));if(_0x275b1b['error']){if(_0x275b1b[_0x348f('0x12')][_0x348f('0x13')]===0x1f4){logger[_0x348f('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x2ea805,_0x275b1b[_0x348f('0x12')][_0x348f('0x14')]);return _0x3835b4(_0x275b1b[_0x348f('0x12')][_0x348f('0x14')]);}logger[_0x348f('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x2ea805,_0x275b1b['error'][_0x348f('0x14')]);return _0x5afd98(_0x275b1b[_0x348f('0x12')][_0x348f('0x14')]);}else{logger[_0x348f('0xd')](_0x348f('0xe'),_0x2ea805,_0x348f('0xf'));_0x5afd98(_0x275b1b[_0x348f('0x15')][_0x348f('0x14')]);}})['catch'](function(_0x214dd5){logger['error'](_0x348f('0xe'),_0x2ea805,_0x214dd5);_0x3835b4(_0x214dd5);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index cdbca2b..ec8cdac 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 _0xbc76=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','/:id'];(function(_0x5038c5,_0x3ac003){var _0x3c0dac=function(_0x492591){while(--_0x492591){_0x5038c5['push'](_0x5038c5['shift']());}};_0x3c0dac(++_0x3ac003);}(_0xbc76,0x101));var _0x6bc7=function(_0x1b1f21,_0x8a5d9a){_0x1b1f21=_0x1b1f21-0x0;var _0x80fb44=_0xbc76[_0x1b1f21];return _0x80fb44;};'use strict';var multer=require(_0x6bc7('0x0'));var util=require(_0x6bc7('0x1'));var path=require(_0x6bc7('0x2'));var timeout=require(_0x6bc7('0x3'));var express=require(_0x6bc7('0x4'));var router=express[_0x6bc7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6bc7('0x6'));var interaction=require(_0x6bc7('0x7'));var config=require(_0x6bc7('0x8'));var controller=require('./cmContactHasItem.controller');router[_0x6bc7('0x9')]('/',auth[_0x6bc7('0xa')](),controller[_0x6bc7('0xb')]);router[_0x6bc7('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6bc7('0xc')]('/',auth['isAuthenticated'](),controller[_0x6bc7('0xd')]);router['put'](_0x6bc7('0xe'),auth[_0x6bc7('0xa')](),controller['update']);router[_0x6bc7('0xf')](_0x6bc7('0xe'),auth['isAuthenticated'](),controller[_0x6bc7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x31df=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1ac32b,_0xfc9126){var _0x42e2b3=function(_0x17735f){while(--_0x17735f){_0x1ac32b['push'](_0x1ac32b['shift']());}};_0x42e2b3(++_0xfc9126);}(_0x31df,0x11a));var _0xf31d=function(_0x175e8f,_0x4cc90c){_0x175e8f=_0x175e8f-0x0;var _0x4cf996=_0x31df[_0x175e8f];return _0x4cf996;};'use strict';var multer=require('multer');var util=require(_0xf31d('0x0'));var path=require(_0xf31d('0x1'));var timeout=require('connect-timeout');var express=require(_0xf31d('0x2'));var router=express[_0xf31d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf31d('0x4'));var interaction=require(_0xf31d('0x5'));var config=require(_0xf31d('0x6'));var controller=require(_0xf31d('0x7'));router[_0xf31d('0x8')]('/',auth[_0xf31d('0x9')](),controller[_0xf31d('0xa')]);router['get'](_0xf31d('0xb'),auth[_0xf31d('0x9')](),controller[_0xf31d('0xc')]);router[_0xf31d('0xd')]('/',auth[_0xf31d('0x9')](),controller[_0xf31d('0xe')]);router[_0xf31d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf31d('0x10')]);router['delete'](_0xf31d('0xb'),auth[_0xf31d('0x9')](),controller[_0xf31d('0x11')]);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 8f83bb1..b5eff78 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 _0xb984=['long','select','parse','values','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','exports','getDataValue','alias','STRING'];(function(_0x5a6944,_0x3bdc0a){var _0x32cecd=function(_0x23fa45){while(--_0x23fa45){_0x5a6944['push'](_0x5a6944['shift']());}};_0x32cecd(++_0x3bdc0a);}(_0xb984,0x105));var _0x4b98=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb984[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x4b98('0x0'));var _=require('lodash');module[_0x4b98('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x160639){return this[_0x4b98('0x2')](_0x4b98('0x3'));}},'alias':{'type':Sequelize[_0x4b98('0x4')],'allowNull':![],'set':function(_0x38ef3e){this['setDataValue'](_0x4b98('0x3'),_0x38ef3e?_0x38ef3e:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x4b98('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x4b98('0x5')),'get':function(){if(this[_0x4b98('0x2')]('type')===_0x4b98('0x6')){return JSON[_0x4b98('0x7')](this[_0x4b98('0x2')](_0x4b98('0x8')));}else{return this[_0x4b98('0x2')](_0x4b98('0x8'));}},'set':function(_0x147700){if(Array['isArray'](_0x147700)){this[_0x4b98('0x9')](_0x4b98('0x8'),JSON[_0x4b98('0xa')](_0x147700));}else{this['setDataValue'](_0x4b98('0x8'),_0x147700);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4b98('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x4b98('0xc')](_0x4b98('0xd'))}}; \ No newline at end of file +var _0xa4ef=['setDataValue','TEXT','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM','exports','VIRTUAL','getDataValue','alias','STRING'];(function(_0x393645,_0x23a039){var _0x4a4035=function(_0x3a972c){while(--_0x3a972c){_0x393645['push'](_0x393645['shift']());}};_0x4a4035(++_0x23a039);}(_0xa4ef,0x73));var _0xfa4e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa4ef[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xfa4e('0x0')]={'name':{'type':Sequelize[_0xfa4e('0x1')],'get':function(_0x9222ca){return this[_0xfa4e('0x2')](_0xfa4e('0x3'));}},'alias':{'type':Sequelize[_0xfa4e('0x4')],'allowNull':![],'set':function(_0x1372f1){this[_0xfa4e('0x5')]('alias',_0x1372f1?_0x1372f1:this[_0xfa4e('0x2')]('name'));}},'type':{'type':Sequelize[_0xfa4e('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xfa4e('0x6')](_0xfa4e('0x7')),'get':function(){if(this[_0xfa4e('0x2')](_0xfa4e('0x8'))==='select'){return JSON[_0xfa4e('0x9')](this[_0xfa4e('0x2')](_0xfa4e('0xa')));}else{return this['getDataValue'](_0xfa4e('0xa'));}},'set':function(_0x67e4d8){if(Array[_0xfa4e('0xb')](_0x67e4d8)){this[_0xfa4e('0x5')](_0xfa4e('0xa'),JSON[_0xfa4e('0xc')](_0x67e4d8));}else{this['setDataValue'](_0xfa4e('0xa'),_0x67e4d8);}}},'required':{'type':Sequelize[_0xfa4e('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xfa4e('0xe')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 260e532..a4567e4 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 _0x1f99=['addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','CmCustomField','fieldName','key','model','differenceBy','keys','query','filters','attributes','intersection','length','order','sort','filter','where','type','merge','includeAll','findAll','rows','params','rawAttributes','fields','include','options','find','catch','update','body','create','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface'];(function(_0x3b4c2c,_0x4e1507){var _0x261489=function(_0x4daf38){while(--_0x4daf38){_0x3b4c2c['push'](_0x3b4c2c['shift']());}};_0x261489(++_0x4e1507);}(_0x1f99,0x1ee));var _0x91f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f99[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91f9('0x0'));var rimraf=require(_0x91f9('0x1'));var zipdir=require(_0x91f9('0x2'));var jsonpatch=require(_0x91f9('0x3'));var rp=require(_0x91f9('0x4'));var moment=require(_0x91f9('0x5'));var BPromise=require(_0x91f9('0x6'));var Mustache=require(_0x91f9('0x7'));var util=require(_0x91f9('0x8'));var path=require(_0x91f9('0x9'));var sox=require('sox');var csv=require(_0x91f9('0xa'));var ejs=require(_0x91f9('0xb'));var fs=require('fs');var fs_extra=require(_0x91f9('0xc'));var _=require(_0x91f9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x91f9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x91f9('0xf'));var Papa=require(_0x91f9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x91f9('0x11'));var hardwareService=require(_0x91f9('0x12'));var logger=require(_0x91f9('0x13'))(_0x91f9('0x14'));var utils=require('../../config/utils');var config=require(_0x91f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x91f9('0x16'))['db'];function respondWithStatusCode(_0x487ed6,_0x2155ce){_0x2155ce=_0x2155ce||0xcc;return function(_0x216571){if(_0x216571){return _0x487ed6['sendStatus'](_0x2155ce);}return _0x487ed6[_0x91f9('0x17')](_0x2155ce)[_0x91f9('0x18')]();};}function respondWithResult(_0x39848e,_0x5853f3){_0x5853f3=_0x5853f3||0xc8;return function(_0x11bb17){if(_0x11bb17){return _0x39848e[_0x91f9('0x17')](_0x5853f3)[_0x91f9('0x19')](_0x11bb17);}};}function respondWithFilteredResult(_0x409671,_0x10845d){return function(_0x346e63){if(_0x346e63){var _0x155060=typeof _0x10845d['offset']==='undefined'&&typeof _0x10845d[_0x91f9('0x1a')]===_0x91f9('0x1b');var _0x303613=_0x346e63['count'];var _0x17bcb4=_0x155060?0x0:_0x10845d[_0x91f9('0x1c')];var _0x556f6f=_0x155060?_0x346e63[_0x91f9('0x1d')]:_0x10845d[_0x91f9('0x1c')]+_0x10845d[_0x91f9('0x1a')];var _0x760b16;if(_0x556f6f>=_0x303613){_0x556f6f=_0x303613;_0x760b16=0xc8;}else{_0x760b16=0xce;}_0x409671['status'](_0x760b16);return _0x409671[_0x91f9('0x1e')](_0x91f9('0x1f'),_0x17bcb4+'-'+_0x556f6f+'/'+_0x303613)[_0x91f9('0x19')](_0x346e63);}return null;};}function patchUpdates(_0x959076){return function(_0x3b8ee2){try{jsonpatch[_0x91f9('0x20')](_0x3b8ee2,_0x959076,!![]);}catch(_0x7ca1b3){return BPromise[_0x91f9('0x21')](_0x7ca1b3);}return _0x3b8ee2[_0x91f9('0x22')]();};}function saveUpdates(_0x59bfb6,_0xee0d73){return function(_0x3aee60){if(_0x3aee60){return _0x3aee60['update'](_0x59bfb6)[_0x91f9('0x23')](function(_0x5bdfd3){return _0x5bdfd3;});}return null;};}function removeEntity(_0x5bfd4d,_0x1d7aa3){return function(_0x9be3b4){if(_0x9be3b4){return _0x9be3b4[_0x91f9('0x24')]()[_0x91f9('0x23')](function(){_0x5bfd4d[_0x91f9('0x17')](0xcc)[_0x91f9('0x18')]();});}};}function handleEntityNotFound(_0x469429,_0x14647b){return function(_0x5f42ad){if(!_0x5f42ad){_0x469429['sendStatus'](0x194);}return _0x5f42ad;};}function handleError(_0x28cf87,_0x54b948){_0x54b948=_0x54b948||0x1f4;return function(_0x230034){logger[_0x91f9('0x25')](_0x230034[_0x91f9('0x26')]);if(_0x230034[_0x91f9('0x27')]){delete _0x230034[_0x91f9('0x27')];}_0x28cf87[_0x91f9('0x17')](_0x54b948)['send'](_0x230034);};}exports[_0x91f9('0x28')]=function(_0x79eba9,_0x1ac081){var _0x5dc94e={},_0x2af721={},_0x20a026={'count':0x0,'rows':[]};var _0x347333=_[_0x91f9('0x29')](db[_0x91f9('0x2a')]['rawAttributes'],function(_0x419a63){return{'name':_0x419a63[_0x91f9('0x2b')],'type':_0x419a63['type'][_0x91f9('0x2c')]};});_0x2af721[_0x91f9('0x2d')]=_[_0x91f9('0x2e')](_[_0x91f9('0x29')](_0x347333,_0x91f9('0x27')),[_0x91f9('0x27')]);_0x2af721['query']=_[_0x91f9('0x2f')](_0x79eba9[_0x91f9('0x30')]);_0x2af721[_0x91f9('0x31')]=_['intersection'](_0x2af721['model'],_0x2af721['query']);_0x5dc94e[_0x91f9('0x32')]=_[_0x91f9('0x33')](_0x2af721['model'],qs['fields'](_0x79eba9[_0x91f9('0x30')]['fields']));_0x5dc94e[_0x91f9('0x32')]=_0x5dc94e['attributes'][_0x91f9('0x34')]?_0x5dc94e[_0x91f9('0x32')]:_0x2af721[_0x91f9('0x2d')];if(!_0x79eba9[_0x91f9('0x30')]['hasOwnProperty']('nolimit')){_0x5dc94e[_0x91f9('0x1a')]=qs[_0x91f9('0x1a')](_0x79eba9[_0x91f9('0x30')]['limit']);_0x5dc94e[_0x91f9('0x1c')]=qs[_0x91f9('0x1c')](_0x79eba9['query'][_0x91f9('0x1c')]);}_0x5dc94e[_0x91f9('0x35')]=qs['sort'](_0x79eba9[_0x91f9('0x30')][_0x91f9('0x36')]);_0x5dc94e['where']=qs[_0x91f9('0x31')](_['pick'](_0x79eba9[_0x91f9('0x30')],_0x2af721[_0x91f9('0x31')]),_0x347333);if(_0x79eba9[_0x91f9('0x30')][_0x91f9('0x37')]){_0x5dc94e[_0x91f9('0x38')]=_['merge'](_0x5dc94e['where'],{'$or':_[_0x91f9('0x29')](_0x347333,function(_0x49440f){if(_0x49440f[_0x91f9('0x39')]!=='VIRTUAL'){var _0x37a979={};_0x37a979[_0x49440f[_0x91f9('0x27')]]={'$like':'%'+_0x79eba9[_0x91f9('0x30')][_0x91f9('0x37')]+'%'};return _0x37a979;}})});}_0x5dc94e=_[_0x91f9('0x3a')]({},_0x5dc94e,_0x79eba9['options']);var _0x381d57={'where':_0x5dc94e['where']};return db[_0x91f9('0x2a')][_0x91f9('0x1d')](_0x381d57)[_0x91f9('0x23')](function(_0x21d53c){_0x20a026[_0x91f9('0x1d')]=_0x21d53c;if(_0x79eba9[_0x91f9('0x30')][_0x91f9('0x3b')]){_0x5dc94e['include']=[{'all':!![]}];}return db[_0x91f9('0x2a')][_0x91f9('0x3c')](_0x5dc94e);})['then'](function(_0x46cfbc){_0x20a026[_0x91f9('0x3d')]=_0x46cfbc;return _0x20a026;})[_0x91f9('0x23')](respondWithFilteredResult(_0x1ac081,_0x5dc94e))['catch'](handleError(_0x1ac081,null));};exports['show']=function(_0x106913,_0x2bc783){var _0x46522c={'raw':!![],'where':{'id':_0x106913[_0x91f9('0x3e')]['id']}},_0x212a76={};_0x212a76[_0x91f9('0x2d')]=_[_0x91f9('0x2f')](db[_0x91f9('0x2a')][_0x91f9('0x3f')]);_0x212a76[_0x91f9('0x30')]=_[_0x91f9('0x2f')](_0x106913[_0x91f9('0x30')]);_0x212a76[_0x91f9('0x31')]=_[_0x91f9('0x33')](_0x212a76['model'],_0x212a76[_0x91f9('0x30')]);_0x46522c['attributes']=_[_0x91f9('0x33')](_0x212a76['model'],qs[_0x91f9('0x40')](_0x106913[_0x91f9('0x30')]['fields']));_0x46522c[_0x91f9('0x32')]=_0x46522c[_0x91f9('0x32')][_0x91f9('0x34')]?_0x46522c[_0x91f9('0x32')]:_0x212a76[_0x91f9('0x2d')];if(_0x106913[_0x91f9('0x30')][_0x91f9('0x3b')]){_0x46522c[_0x91f9('0x41')]=[{'all':!![]}];}_0x46522c=_[_0x91f9('0x3a')]({},_0x46522c,_0x106913[_0x91f9('0x42')]);return db[_0x91f9('0x2a')][_0x91f9('0x43')](_0x46522c)[_0x91f9('0x23')](handleEntityNotFound(_0x2bc783,null))[_0x91f9('0x23')](respondWithResult(_0x2bc783,null))[_0x91f9('0x44')](handleError(_0x2bc783,null));};exports[_0x91f9('0x45')]=function(_0x1aa2c6,_0x11f303){if(_0x1aa2c6[_0x91f9('0x46')]['id']){delete _0x1aa2c6['body']['id'];}return db[_0x91f9('0x2a')][_0x91f9('0x43')]({'where':{'id':_0x1aa2c6[_0x91f9('0x3e')]['id']}})[_0x91f9('0x23')](handleEntityNotFound(_0x11f303,null))[_0x91f9('0x23')](saveUpdates(_0x1aa2c6[_0x91f9('0x46')],null))[_0x91f9('0x23')](respondWithResult(_0x11f303,null))[_0x91f9('0x44')](handleError(_0x11f303,null));};exports[_0x91f9('0x24')]=function(_0x5a4f30,_0x2f435c){return db[_0x91f9('0x2a')][_0x91f9('0x43')]({'where':{'id':_0x5a4f30[_0x91f9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2f435c,null))[_0x91f9('0x23')](removeEntity(_0x2f435c,null))[_0x91f9('0x44')](handleError(_0x2f435c,null));};exports[_0x91f9('0x47')]=function(_0x36614c,_0x39d8ca){var _0x59ab04;return db['sequelize'][_0x91f9('0x48')](function(_0x1ab5b8){return db[_0x91f9('0x2a')]['create'](_0x36614c[_0x91f9('0x46')],{'transaction':_0x1ab5b8})[_0x91f9('0x23')](function(_0x2b3a09){_0x59ab04=_0x2b3a09;var _0x5b918e={'type':db[_0x91f9('0x49')][_0x91f9('0x4a')],'transaction':_0x1ab5b8};switch(_0x36614c[_0x91f9('0x46')][_0x91f9('0x39')]){case _0x91f9('0x4b'):_0x5b918e['type']=db['Sequelize']['TEXT'];break;case'number':_0x5b918e[_0x91f9('0x39')]=db[_0x91f9('0x49')]['INTEGER'];break;case _0x91f9('0x4c'):_0x5b918e[_0x91f9('0x39')]=db[_0x91f9('0x49')][_0x91f9('0x4d')];_0x5b918e[_0x91f9('0x4e')]=![];break;default:}return db['sequelize'][_0x91f9('0x4f')][_0x91f9('0x50')](_0x91f9('0x51'),util['format']('cf_%d',_0x59ab04['id']),_0x5b918e);})[_0x91f9('0x23')](function(){return _0x59ab04;});})['then'](respondWithResult(_0x39d8ca,0xc9))[_0x91f9('0x44')](handleError(_0x39d8ca,null));}; \ No newline at end of file +var _0x44e3=['number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','json','reject','update','then','end','error','name','send','index','map','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','CmCustomField','includeAll','include','findAll','rows','catch','params','rawAttributes','options','body','find','destroy','create','sequelize','transaction','Sequelize'];(function(_0x1b69aa,_0x5aa147){var _0x42647d=function(_0x1743fd){while(--_0x1743fd){_0x1b69aa['push'](_0x1b69aa['shift']());}};_0x42647d(++_0x5aa147);}(_0x44e3,0xa9));var _0x344e=function(_0x1f18ea,_0x1daa75){_0x1f18ea=_0x1f18ea-0x0;var _0x12eb1c=_0x44e3[_0x1f18ea];return _0x12eb1c;};'use strict';var emlformat=require(_0x344e('0x0'));var rimraf=require(_0x344e('0x1'));var zipdir=require(_0x344e('0x2'));var jsonpatch=require(_0x344e('0x3'));var rp=require(_0x344e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x344e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x344e('0x6'));var csv=require('to-csv');var ejs=require(_0x344e('0x7'));var fs=require('fs');var fs_extra=require(_0x344e('0x8'));var _=require(_0x344e('0x9'));var squel=require('squel');var crypto=require(_0x344e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x344e('0xb'));var toCsv=require(_0x344e('0xc'));var querystring=require('querystring');var Papa=require(_0x344e('0xd'));var Redis=require('ioredis');var authService=require(_0x344e('0xe'));var qs=require(_0x344e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x344e('0x10'));var logger=require(_0x344e('0x11'))(_0x344e('0x12'));var utils=require(_0x344e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x344e('0x14'));var db=require(_0x344e('0x15'))['db'];function respondWithStatusCode(_0x2b4f64,_0x4ef481){_0x4ef481=_0x4ef481||0xcc;return function(_0x42b0aa){if(_0x42b0aa){return _0x2b4f64[_0x344e('0x16')](_0x4ef481);}return _0x2b4f64[_0x344e('0x17')](_0x4ef481)['end']();};}function respondWithResult(_0x42f6f0,_0x5377c4){_0x5377c4=_0x5377c4||0xc8;return function(_0x2e8743){if(_0x2e8743){return _0x42f6f0['status'](_0x5377c4)['json'](_0x2e8743);}};}function respondWithFilteredResult(_0x488058,_0x194b77){return function(_0x4f921d){if(_0x4f921d){var _0x114e96=typeof _0x194b77[_0x344e('0x18')]==='undefined'&&typeof _0x194b77[_0x344e('0x19')]==='undefined';var _0x34b725=_0x4f921d[_0x344e('0x1a')];var _0x1c9c71=_0x114e96?0x0:_0x194b77[_0x344e('0x18')];var _0xf67382=_0x114e96?_0x4f921d[_0x344e('0x1a')]:_0x194b77[_0x344e('0x18')]+_0x194b77[_0x344e('0x19')];var _0x40d45c;if(_0xf67382>=_0x34b725){_0xf67382=_0x34b725;_0x40d45c=0xc8;}else{_0x40d45c=0xce;}_0x488058['status'](_0x40d45c);return _0x488058[_0x344e('0x1b')]('Content-Range',_0x1c9c71+'-'+_0xf67382+'/'+_0x34b725)[_0x344e('0x1c')](_0x4f921d);}return null;};}function patchUpdates(_0x3a57fd){return function(_0xc46152){try{jsonpatch['apply'](_0xc46152,_0x3a57fd,!![]);}catch(_0x8d95a3){return BPromise[_0x344e('0x1d')](_0x8d95a3);}return _0xc46152['save']();};}function saveUpdates(_0x5aaa82,_0x598276){return function(_0xa50a7b){if(_0xa50a7b){return _0xa50a7b[_0x344e('0x1e')](_0x5aaa82)[_0x344e('0x1f')](function(_0x3e7d9d){return _0x3e7d9d;});}return null;};}function removeEntity(_0x1fba43,_0x15620e){return function(_0x42728d){if(_0x42728d){return _0x42728d['destroy']()[_0x344e('0x1f')](function(){_0x1fba43[_0x344e('0x17')](0xcc)[_0x344e('0x20')]();});}};}function handleEntityNotFound(_0x13d865,_0x1a6d77){return function(_0x3b11f5){if(!_0x3b11f5){_0x13d865[_0x344e('0x16')](0x194);}return _0x3b11f5;};}function handleError(_0xbbb609,_0x5d86fb){_0x5d86fb=_0x5d86fb||0x1f4;return function(_0x140ea8){logger[_0x344e('0x21')](_0x140ea8['stack']);if(_0x140ea8[_0x344e('0x22')]){delete _0x140ea8[_0x344e('0x22')];}_0xbbb609[_0x344e('0x17')](_0x5d86fb)[_0x344e('0x23')](_0x140ea8);};}exports[_0x344e('0x24')]=function(_0xf69d07,_0x90d075){var _0x30ede1={},_0x3ac272={},_0x3ae054={'count':0x0,'rows':[]};var _0x363ade=_[_0x344e('0x25')](db['CmCustomField']['rawAttributes'],function(_0x548327){return{'name':_0x548327[_0x344e('0x26')],'type':_0x548327[_0x344e('0x27')][_0x344e('0x28')]};});_0x3ac272[_0x344e('0x29')]=_[_0x344e('0x2a')](_[_0x344e('0x25')](_0x363ade,_0x344e('0x22')),['name']);_0x3ac272[_0x344e('0x2b')]=_[_0x344e('0x2c')](_0xf69d07['query']);_0x3ac272[_0x344e('0x2d')]=_[_0x344e('0x2e')](_0x3ac272['model'],_0x3ac272[_0x344e('0x2b')]);_0x30ede1['attributes']=_['intersection'](_0x3ac272['model'],qs[_0x344e('0x2f')](_0xf69d07[_0x344e('0x2b')][_0x344e('0x2f')]));_0x30ede1[_0x344e('0x30')]=_0x30ede1[_0x344e('0x30')][_0x344e('0x31')]?_0x30ede1[_0x344e('0x30')]:_0x3ac272['model'];if(!_0xf69d07[_0x344e('0x2b')]['hasOwnProperty']('nolimit')){_0x30ede1[_0x344e('0x19')]=qs[_0x344e('0x19')](_0xf69d07['query'][_0x344e('0x19')]);_0x30ede1[_0x344e('0x18')]=qs[_0x344e('0x18')](_0xf69d07[_0x344e('0x2b')][_0x344e('0x18')]);}_0x30ede1['order']=qs[_0x344e('0x32')](_0xf69d07[_0x344e('0x2b')][_0x344e('0x32')]);_0x30ede1['where']=qs[_0x344e('0x2d')](_[_0x344e('0x33')](_0xf69d07[_0x344e('0x2b')],_0x3ac272[_0x344e('0x2d')]),_0x363ade);if(_0xf69d07[_0x344e('0x2b')][_0x344e('0x34')]){_0x30ede1[_0x344e('0x35')]=_[_0x344e('0x36')](_0x30ede1[_0x344e('0x35')],{'$or':_[_0x344e('0x25')](_0x363ade,function(_0x29537d){if(_0x29537d[_0x344e('0x27')]!=='VIRTUAL'){var _0xd84b45={};_0xd84b45[_0x29537d[_0x344e('0x22')]]={'$like':'%'+_0xf69d07[_0x344e('0x2b')]['filter']+'%'};return _0xd84b45;}})});}_0x30ede1=_[_0x344e('0x36')]({},_0x30ede1,_0xf69d07['options']);var _0x13e94c={'where':_0x30ede1[_0x344e('0x35')]};return db[_0x344e('0x37')][_0x344e('0x1a')](_0x13e94c)[_0x344e('0x1f')](function(_0x70f3b3){_0x3ae054['count']=_0x70f3b3;if(_0xf69d07[_0x344e('0x2b')][_0x344e('0x38')]){_0x30ede1[_0x344e('0x39')]=[{'all':!![]}];}return db[_0x344e('0x37')][_0x344e('0x3a')](_0x30ede1);})['then'](function(_0x414482){_0x3ae054[_0x344e('0x3b')]=_0x414482;return _0x3ae054;})[_0x344e('0x1f')](respondWithFilteredResult(_0x90d075,_0x30ede1))[_0x344e('0x3c')](handleError(_0x90d075,null));};exports['show']=function(_0x1b5548,_0x284d26){var _0x290ec4={'raw':!![],'where':{'id':_0x1b5548[_0x344e('0x3d')]['id']}},_0x39a017={};_0x39a017['model']=_['keys'](db['CmCustomField'][_0x344e('0x3e')]);_0x39a017['query']=_[_0x344e('0x2c')](_0x1b5548['query']);_0x39a017['filters']=_['intersection'](_0x39a017[_0x344e('0x29')],_0x39a017[_0x344e('0x2b')]);_0x290ec4[_0x344e('0x30')]=_[_0x344e('0x2e')](_0x39a017[_0x344e('0x29')],qs['fields'](_0x1b5548[_0x344e('0x2b')]['fields']));_0x290ec4[_0x344e('0x30')]=_0x290ec4['attributes']['length']?_0x290ec4['attributes']:_0x39a017['model'];if(_0x1b5548['query']['includeAll']){_0x290ec4[_0x344e('0x39')]=[{'all':!![]}];}_0x290ec4=_['merge']({},_0x290ec4,_0x1b5548[_0x344e('0x3f')]);return db[_0x344e('0x37')]['find'](_0x290ec4)[_0x344e('0x1f')](handleEntityNotFound(_0x284d26,null))[_0x344e('0x1f')](respondWithResult(_0x284d26,null))[_0x344e('0x3c')](handleError(_0x284d26,null));};exports['update']=function(_0x15aae5,_0x1a6ccd){if(_0x15aae5['body']['id']){delete _0x15aae5[_0x344e('0x40')]['id'];}return db[_0x344e('0x37')][_0x344e('0x41')]({'where':{'id':_0x15aae5[_0x344e('0x3d')]['id']}})[_0x344e('0x1f')](handleEntityNotFound(_0x1a6ccd,null))['then'](saveUpdates(_0x15aae5[_0x344e('0x40')],null))[_0x344e('0x1f')](respondWithResult(_0x1a6ccd,null))[_0x344e('0x3c')](handleError(_0x1a6ccd,null));};exports[_0x344e('0x42')]=function(_0x4fcbec,_0x1f70e6){return db[_0x344e('0x37')][_0x344e('0x41')]({'where':{'id':_0x4fcbec[_0x344e('0x3d')]['id']}})[_0x344e('0x1f')](handleEntityNotFound(_0x1f70e6,null))[_0x344e('0x1f')](removeEntity(_0x1f70e6,null))['catch'](handleError(_0x1f70e6,null));};exports[_0x344e('0x43')]=function(_0x1dd4bf,_0x46c1a9){var _0x2567ec;return db[_0x344e('0x44')][_0x344e('0x45')](function(_0x423a2){return db[_0x344e('0x37')][_0x344e('0x43')](_0x1dd4bf[_0x344e('0x40')],{'transaction':_0x423a2})[_0x344e('0x1f')](function(_0x13fd10){_0x2567ec=_0x13fd10;var _0x4942b5={'type':db[_0x344e('0x46')]['TEXT'],'transaction':_0x423a2};switch(_0x1dd4bf[_0x344e('0x40')]['type']){case'text':_0x4942b5[_0x344e('0x27')]=db[_0x344e('0x46')]['TEXT'];break;case _0x344e('0x47'):_0x4942b5[_0x344e('0x27')]=db[_0x344e('0x46')][_0x344e('0x48')];break;case _0x344e('0x49'):_0x4942b5[_0x344e('0x27')]=db[_0x344e('0x46')]['BOOLEAN'];_0x4942b5[_0x344e('0x4a')]=![];break;default:}return db[_0x344e('0x44')][_0x344e('0x4b')][_0x344e('0x4c')](_0x344e('0x4d'),util[_0x344e('0x4e')](_0x344e('0x4f'),_0x2567ec['id']),_0x4942b5);})[_0x344e('0x1f')](function(){return _0x2567ec;});})[_0x344e('0x1f')](respondWithResult(_0x46c1a9,0xc9))[_0x344e('0x3c')](handleError(_0x46c1a9,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e444cc4..b28db61 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 _0x4f96=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x2ba428,_0x2c4da2){var _0x51dfc3=function(_0x59e7e3){while(--_0x59e7e3){_0x2ba428['push'](_0x2ba428['shift']());}};_0x51dfc3(++_0x2c4da2);}(_0x4f96,0x1d6));var _0x64f9=function(_0x167d25,_0x3fbd87){_0x167d25=_0x167d25-0x0;var _0x313f62=_0x4f96[_0x167d25];return _0x313f62;};'use strict';var _=require(_0x64f9('0x0'));var util=require(_0x64f9('0x1'));var logger=require(_0x64f9('0x2'))('api');var moment=require(_0x64f9('0x3'));var BPromise=require('bluebird');var rp=require(_0x64f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64f9('0x5'));var config=require(_0x64f9('0x6'));var attributes=require(_0x64f9('0x7'));module[_0x64f9('0x8')]=function(_0x33197b,_0x14d32c){return _0x33197b[_0x64f9('0x9')](_0x64f9('0xa'),attributes,{'tableName':_0x64f9('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a5f=['exports','CmCustomField','cm_custom_fields','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a5f,0x14d));var _0xf1a5=function(_0x491803,_0x445d92){_0x491803=_0x491803-0x0;var _0x1625a9=_0x1a5f[_0x491803];return _0x1625a9;};'use strict';var _=require('lodash');var util=require(_0xf1a5('0x0'));var logger=require(_0xf1a5('0x1'))('api');var moment=require(_0xf1a5('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1a5('0x3'));var fs=require('fs');var path=require(_0xf1a5('0x4'));var rimraf=require(_0xf1a5('0x5'));var config=require(_0xf1a5('0x6'));var attributes=require(_0xf1a5('0x7'));module[_0xf1a5('0x8')]=function(_0x1bbc71,_0x3e9783){return _0x1bbc71['define'](_0xf1a5('0x9'),attributes,{'tableName':_0xf1a5('0xa'),'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 2607317..dc551aa 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 _0x3b56=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x270c77,_0x59128e){var _0x51f074=function(_0x6b3edb){while(--_0x6b3edb){_0x270c77['push'](_0x270c77['shift']());}};_0x51f074(++_0x59128e);}(_0x3b56,0x194));var _0x63b5=function(_0x113764,_0x2b3583){_0x113764=_0x113764-0x0;var _0x508fd3=_0x3b56[_0x113764];return _0x508fd3;};'use strict';var _=require(_0x63b5('0x0'));var util=require(_0x63b5('0x1'));var moment=require('moment');var BPromise=require(_0x63b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63b5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x63b5('0x4'))(_0x63b5('0x5'));var config=require(_0x63b5('0x6'));var jayson=require(_0x63b5('0x7'));var client=jayson[_0x63b5('0x8')][_0x63b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55534f,_0x3b4cd2,_0x449b7d){return new BPromise(function(_0x56c003,_0x2e475c){return client[_0x63b5('0xa')](_0x55534f,_0x449b7d)['then'](function(_0x1e5f88){logger['info'](_0x63b5('0xb'),_0x3b4cd2,_0x63b5('0xc'));logger[_0x63b5('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x3b4cd2,_0x63b5('0xc'),JSON['stringify'](_0x1e5f88));if(_0x1e5f88[_0x63b5('0xe')]){if(_0x1e5f88[_0x63b5('0xe')][_0x63b5('0xf')]===0x1f4){logger[_0x63b5('0xe')](_0x63b5('0xb'),_0x3b4cd2,_0x1e5f88[_0x63b5('0xe')][_0x63b5('0x10')]);return _0x2e475c(_0x1e5f88['error'][_0x63b5('0x10')]);}logger[_0x63b5('0xe')]('CmCustomField,\x20%s,\x20%s',_0x3b4cd2,_0x1e5f88['error'][_0x63b5('0x10')]);return _0x56c003(_0x1e5f88[_0x63b5('0xe')][_0x63b5('0x10')]);}else{logger['info'](_0x63b5('0xb'),_0x3b4cd2,'request\x20sent');_0x56c003(_0x1e5f88[_0x63b5('0x11')][_0x63b5('0x10')]);}})[_0x63b5('0x12')](function(_0x547fa6){logger[_0x63b5('0xe')](_0x63b5('0xb'),_0x3b4cd2,_0x547fa6);_0x2e475c(_0x547fa6);});});} \ No newline at end of file +var _0xc278=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x36c416,_0x280aec){var _0x4002a3=function(_0x3410bc){while(--_0x3410bc){_0x36c416['push'](_0x36c416['shift']());}};_0x4002a3(++_0x280aec);}(_0xc278,0xc9));var _0x8c27=function(_0x399566,_0x1a5db6){_0x399566=_0x399566-0x0;var _0x313fd5=_0xc278[_0x399566];return _0x313fd5;};'use strict';var _=require(_0x8c27('0x0'));var util=require(_0x8c27('0x1'));var moment=require(_0x8c27('0x2'));var BPromise=require(_0x8c27('0x3'));var rs=require(_0x8c27('0x4'));var fs=require('fs');var Redis=require(_0x8c27('0x5'));var db=require(_0x8c27('0x6'))['db'];var utils=require(_0x8c27('0x7'));var logger=require(_0x8c27('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c27('0x9'));var client=jayson[_0x8c27('0xa')][_0x8c27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52398b,_0x1e9ae0,_0x39acf5){return new BPromise(function(_0x4d70cb,_0x5c6ab6){return client[_0x8c27('0xc')](_0x52398b,_0x39acf5)[_0x8c27('0xd')](function(_0x221226){logger['info'](_0x8c27('0xe'),_0x1e9ae0,_0x8c27('0xf'));logger[_0x8c27('0x10')](_0x8c27('0x11'),_0x1e9ae0,'request\x20sent',JSON[_0x8c27('0x12')](_0x221226));if(_0x221226[_0x8c27('0x13')]){if(_0x221226[_0x8c27('0x13')][_0x8c27('0x14')]===0x1f4){logger[_0x8c27('0x13')](_0x8c27('0xe'),_0x1e9ae0,_0x221226[_0x8c27('0x13')][_0x8c27('0x15')]);return _0x5c6ab6(_0x221226[_0x8c27('0x13')]['message']);}logger[_0x8c27('0x13')](_0x8c27('0xe'),_0x1e9ae0,_0x221226['error'][_0x8c27('0x15')]);return _0x4d70cb(_0x221226[_0x8c27('0x13')]['message']);}else{logger[_0x8c27('0x16')](_0x8c27('0xe'),_0x1e9ae0,'request\x20sent');_0x4d70cb(_0x221226[_0x8c27('0x17')][_0x8c27('0x15')]);}})[_0x8c27('0x18')](function(_0x3da0aa){logger[_0x8c27('0x13')](_0x8c27('0xe'),_0x1e9ae0,_0x3da0aa);_0x5c6ab6(_0x3da0aa);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 864b475..d4e8dd1 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 _0x2842=['get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller'];(function(_0x4c93d9,_0x276f05){var _0xc4dc99=function(_0x1421e3){while(--_0x1421e3){_0x4c93d9['push'](_0x4c93d9['shift']());}};_0xc4dc99(++_0x276f05);}(_0x2842,0x1ba));var _0x2284=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2842[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x2284('0x0'));var path=require(_0x2284('0x1'));var timeout=require(_0x2284('0x2'));var express=require(_0x2284('0x3'));var router=express[_0x2284('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2284('0x5'));var interaction=require(_0x2284('0x6'));var config=require('../../config/environment');var controller=require(_0x2284('0x7'));router[_0x2284('0x8')]('/',auth[_0x2284('0x9')](),controller[_0x2284('0xa')]);router[_0x2284('0x8')](_0x2284('0xb'),auth['isAuthenticated'](),controller[_0x2284('0xc')]);router['post']('/',auth[_0x2284('0x9')](),controller[_0x2284('0xd')]);router[_0x2284('0xe')]('/:id',auth[_0x2284('0x9')](),controller['update']);router[_0x2284('0xf')](_0x2284('0xb'),auth[_0x2284('0x9')](),controller[_0x2284('0x10')]);module[_0x2284('0x11')]=router; \ No newline at end of file +var _0x3e1d=['isAuthenticated','/:id','show','post','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x566f9b,_0x3a1196){var _0x173521=function(_0x159fa2){while(--_0x159fa2){_0x566f9b['push'](_0x566f9b['shift']());}};_0x173521(++_0x3a1196);}(_0x3e1d,0x70));var _0xd3e1=function(_0x2c40bf,_0x5ce37a){_0x2c40bf=_0x2c40bf-0x0;var _0x31ab19=_0x3e1d[_0x2c40bf];return _0x31ab19;};'use strict';var multer=require(_0xd3e1('0x0'));var util=require('util');var path=require(_0xd3e1('0x1'));var timeout=require(_0xd3e1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require(_0xd3e1('0x6'));router[_0xd3e1('0x7')]('/',auth[_0xd3e1('0x8')](),controller['index']);router[_0xd3e1('0x7')](_0xd3e1('0x9'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xa')]);router[_0xd3e1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd3e1('0x9'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xc')]);router[_0xd3e1('0xd')]('/:id',auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 0835e3f..1d20f73 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 _0xf7ee=['sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','moment'];(function(_0x57b5bf,_0x37c3da){var _0x50ec77=function(_0x697b31){while(--_0x697b31){_0x57b5bf['push'](_0x57b5bf['shift']());}};_0x50ec77(++_0x37c3da);}(_0xf7ee,0xe9));var _0xef7e=function(_0x5d6d28,_0x14d669){_0x5d6d28=_0x5d6d28-0x0;var _0x4d2ad1=_0xf7ee[_0x5d6d28];return _0x4d2ad1;};'use strict';var moment=require(_0xef7e('0x0'));var Sequelize=require(_0xef7e('0x1'));module[_0xef7e('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xef7e('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xef7e('0x4')],'defaultValue':moment()[_0xef7e('0x5')](_0xef7e('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef7e('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xef7e('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xef7e('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xef7e('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xef7e('0x4')]},'priority':{'type':Sequelize[_0xef7e('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xef7e('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xef7e('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xef7e('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xef7e('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xef7e('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xef7e('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef7e('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xef7e('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xef7e('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0xef7e('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xf726=['DATE','format','INTEGER','STRING','UNSIGNED','contactListQueue','sequelize','BOOLEAN'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf726,0x8e));var _0x6f72=function(_0x4992d4,_0x36ee57){_0x4992d4=_0x4992d4-0x0;var _0x1b72fa=_0xf726[_0x4992d4];return _0x1b72fa;};'use strict';var moment=require('moment');var Sequelize=require(_0x6f72('0x0'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x6f72('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6f72('0x2')],'defaultValue':moment()[_0x6f72('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6f72('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6f72('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f72('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f72('0x2')]},'priority':{'type':Sequelize[_0x6f72('0x4')](0x2)[_0x6f72('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6f72('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6f72('0x4')],'unique':_0x6f72('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6f72('0x7')},'UserId':{'type':Sequelize[_0x6f72('0x4')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6f72('0x7')},'CampaignId':{'type':Sequelize[_0x6f72('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x6f72('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6f72('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f72('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6f72('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6f72('0x5')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c27ec40..3bb2d9a 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 _0x8d0e=['Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','VoiceQueue','dialActive','Company','Queue','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','then','sendStatus','stack','name','send','map','rawAttributes','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','CmHopper','rows','catch','show','params','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId'];(function(_0x5b42a7,_0x5a2c77){var _0x149826=function(_0xe97539){while(--_0xe97539){_0x5b42a7['push'](_0x5b42a7['shift']());}};_0x149826(++_0x5a2c77);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5a271e,_0x1b35ae){_0x5a271e=_0x5a271e-0x0;var _0x176eb1=_0x8d0e[_0x5a271e];return _0x176eb1;};'use strict';var moment=require(_0xe8d0('0x0'));var _=require(_0xe8d0('0x1'));var qs=require(_0xe8d0('0x2'));var logger=require(_0xe8d0('0x3'))(_0xe8d0('0x4'));var shared=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];function respondWithResult(_0x940176,_0x32cee9){_0x32cee9=_0x32cee9||0xc8;return function(_0x579cb9){if(_0x579cb9){return _0x940176[_0xe8d0('0x7')](_0x32cee9)['json'](_0x579cb9);}};}function respondWithFilteredResult(_0x560dab,_0x2e2985){return function(_0x92483d){if(_0x92483d){var _0x469d37=typeof _0x2e2985[_0xe8d0('0x8')]===_0xe8d0('0x9')&&typeof _0x2e2985[_0xe8d0('0xa')]===_0xe8d0('0x9');var _0x37deac=_0x92483d['count'];var _0x10e56c=_0x469d37?0x0:_0x2e2985[_0xe8d0('0x8')];var _0x463159=_0x469d37?_0x92483d['count']:_0x2e2985['offset']+_0x2e2985[_0xe8d0('0xa')];var _0x25e6b8;if(_0x463159>=_0x37deac){_0x463159=_0x37deac;_0x25e6b8=0xc8;}else{_0x25e6b8=0xce;}_0x560dab[_0xe8d0('0x7')](_0x25e6b8);return _0x560dab[_0xe8d0('0xb')](_0xe8d0('0xc'),_0x10e56c+'-'+_0x463159+'/'+_0x37deac)[_0xe8d0('0xd')](_0x92483d);}return null;};}function saveUpdates(_0x5934b2,_0x38fac0){return function(_0x15b9e5){if(_0x15b9e5){return _0x15b9e5['update'](_0x5934b2)[_0xe8d0('0xe')](function(_0x4cbd26){return _0x4cbd26;});}return null;};}function handleEntityNotFound(_0x59b4b7,_0x90a1ea){return function(_0x2aa906){if(!_0x2aa906){_0x59b4b7[_0xe8d0('0xf')](0x194);}return _0x2aa906;};}function handleError(_0x291b49,_0x15d3a1){_0x15d3a1=_0x15d3a1||0x1f4;return function(_0x7151c6){logger['error'](_0x7151c6[_0xe8d0('0x10')]);if(_0x7151c6['name']){delete _0x7151c6[_0xe8d0('0x11')];}_0x291b49[_0xe8d0('0x7')](_0x15d3a1)[_0xe8d0('0x12')](_0x7151c6);};}exports['index']=function(_0x4d0ddb,_0x47c67a){var _0x1bdd94={},_0x384854={},_0x27b910={'count':0x0,'rows':[]};var _0x44bbe4=_[_0xe8d0('0x13')](db['CmHopper'][_0xe8d0('0x14')],function(_0x12ebf4){return{'name':_0x12ebf4['fieldName'],'type':_0x12ebf4['type']['key']};});_0x384854[_0xe8d0('0x15')]=_[_0xe8d0('0x13')](_0x44bbe4,_0xe8d0('0x11'));_0x384854[_0xe8d0('0x16')]=_[_0xe8d0('0x17')](_0x4d0ddb[_0xe8d0('0x16')]);_0x384854[_0xe8d0('0x18')]=_[_0xe8d0('0x19')](_0x384854[_0xe8d0('0x15')],_0x384854['query']);_0x384854[_0xe8d0('0x18')]=_[_0xe8d0('0x1a')](_0x384854['filters'],[_0xe8d0('0x1b'),_0xe8d0('0x1c'),_0xe8d0('0x1d'),_0xe8d0('0x1e'),_0xe8d0('0x1f'),_0xe8d0('0x20'),_0xe8d0('0x21'),_0xe8d0('0x22'),_0xe8d0('0x23'),_0xe8d0('0x24'),_0xe8d0('0x25'),'$in',_0xe8d0('0x26'),_0xe8d0('0x27'),_0xe8d0('0x28'),'$iLike',_0xe8d0('0x29'),_0xe8d0('0x27'),'$overlap',_0xe8d0('0x2a'),_0xe8d0('0x2b'),_0xe8d0('0x2c')]);_0x1bdd94[_0xe8d0('0x2d')]=_[_0xe8d0('0x19')](_0x384854['model'],qs[_0xe8d0('0x2e')](_0x4d0ddb['query']['fields']));_0x1bdd94['attributes']=_0x1bdd94[_0xe8d0('0x2d')][_0xe8d0('0x2f')]?_0x1bdd94[_0xe8d0('0x2d')]:_0x384854['model'];if(!_0x4d0ddb['query'][_0xe8d0('0x30')]('nolimit')){_0x1bdd94[_0xe8d0('0xa')]=qs[_0xe8d0('0xa')](_0x4d0ddb[_0xe8d0('0x16')][_0xe8d0('0xa')]);_0x1bdd94[_0xe8d0('0x8')]=qs['offset'](_0x4d0ddb[_0xe8d0('0x16')][_0xe8d0('0x8')]);}_0x1bdd94[_0xe8d0('0x31')]=qs[_0xe8d0('0x32')](_0x4d0ddb['query'][_0xe8d0('0x32')]);_0x1bdd94[_0xe8d0('0x33')]=qs['filters'](_[_0xe8d0('0x34')](_0x4d0ddb['query'],_0x384854[_0xe8d0('0x18')]),_0x44bbe4);if(_0x4d0ddb['query'][_0xe8d0('0x35')]){_0x1bdd94['where']=_[_0xe8d0('0x36')](_0x1bdd94[_0xe8d0('0x33')],{'$or':_[_0xe8d0('0x13')](_0x44bbe4,function(_0x320565){if(_0x320565['type']!==_0xe8d0('0x37')){var _0x354e19={};_0x354e19[_0x320565[_0xe8d0('0x11')]]={'$like':'%'+_0x4d0ddb['query'][_0xe8d0('0x35')]+'%'};return _0x354e19;}})});}_0x1bdd94=_[_0xe8d0('0x36')]({},_0x1bdd94,_0x4d0ddb[_0xe8d0('0x38')]);var _0x9cb99b={'where':_0x1bdd94[_0xe8d0('0x33')]};return db['CmHopper'][_0xe8d0('0x39')](_0x9cb99b)[_0xe8d0('0xe')](function(_0x10970d){_0x27b910[_0xe8d0('0x39')]=_0x10970d;if(_0x4d0ddb[_0xe8d0('0x16')][_0xe8d0('0x3a')]){_0x1bdd94[_0xe8d0('0x3b')]=[{'all':!![]}];}return db[_0xe8d0('0x3c')]['findAll'](_0x1bdd94);})['then'](function(_0xdca203){_0x27b910[_0xe8d0('0x3d')]=_0xdca203;return _0x27b910;})[_0xe8d0('0xe')](respondWithFilteredResult(_0x47c67a,_0x1bdd94))[_0xe8d0('0x3e')](handleError(_0x47c67a,null));};exports[_0xe8d0('0x3f')]=function(_0x585d27,_0x2e4362){var _0x4bd7a2={'raw':!![],'where':{'id':_0x585d27[_0xe8d0('0x40')]['id']}},_0x2da076={};_0x2da076[_0xe8d0('0x15')]=_['keys'](db[_0xe8d0('0x3c')][_0xe8d0('0x14')]);_0x2da076[_0xe8d0('0x16')]=_[_0xe8d0('0x17')](_0x585d27[_0xe8d0('0x16')]);_0x2da076['filters']=_['intersection'](_0x2da076['model'],_0x2da076['query']);_0x4bd7a2[_0xe8d0('0x2d')]=_['intersection'](_0x2da076[_0xe8d0('0x15')],qs[_0xe8d0('0x2e')](_0x585d27[_0xe8d0('0x16')][_0xe8d0('0x2e')]));_0x4bd7a2[_0xe8d0('0x2d')]=_0x4bd7a2[_0xe8d0('0x2d')][_0xe8d0('0x2f')]?_0x4bd7a2[_0xe8d0('0x2d')]:_0x2da076['model'];if(_0x585d27[_0xe8d0('0x16')][_0xe8d0('0x3a')]){_0x4bd7a2['include']=[{'all':!![]}];}_0x4bd7a2=_['merge']({},_0x4bd7a2,_0x585d27[_0xe8d0('0x38')]);return db[_0xe8d0('0x3c')][_0xe8d0('0x41')](_0x4bd7a2)['then'](handleEntityNotFound(_0x2e4362,null))[_0xe8d0('0xe')](respondWithResult(_0x2e4362,null))[_0xe8d0('0x3e')](handleError(_0x2e4362,null));};exports['create']=function(_0x19731d,_0x415046){return db['CmHopper'][_0xe8d0('0x42')](_0x19731d[_0xe8d0('0x43')],{})[_0xe8d0('0xe')](respondWithResult(_0x415046,0xc9))[_0xe8d0('0x3e')](handleError(_0x415046,null));};exports[_0xe8d0('0x44')]=function(_0x2a6760,_0x11339d){if(_0x2a6760[_0xe8d0('0x43')]['id']){delete _0x2a6760['body']['id'];}return db[_0xe8d0('0x3c')][_0xe8d0('0x41')]({'where':{'id':_0x2a6760[_0xe8d0('0x40')]['id']}})[_0xe8d0('0xe')](handleEntityNotFound(_0x11339d,null))[_0xe8d0('0xe')](saveUpdates(_0x2a6760[_0xe8d0('0x43')],null))[_0xe8d0('0xe')](respondWithResult(_0x11339d,null))[_0xe8d0('0x3e')](handleError(_0x11339d,null));};exports[_0xe8d0('0x45')]=function(_0x2e2c05,_0x361e3d){return db[_0xe8d0('0x3c')]['describe']()[_0xe8d0('0xe')](respondWithResult(_0x361e3d,null))[_0xe8d0('0x3e')](handleError(_0x361e3d,null));};exports[_0xe8d0('0x46')]=function(_0xad7d94,_0x34047c){var _0x2e4caf;var _0x5a0c7e=_0xad7d94['params']['id'];return db[_0xe8d0('0x3c')][_0xe8d0('0x41')]({'where':{'id':_0xad7d94[_0xe8d0('0x40')]['id']}})[_0xe8d0('0xe')](handleEntityNotFound(_0x34047c,null))['then'](function(_0x2272ea){if(_0x2272ea){return _0x2272ea['destroy']()[_0xe8d0('0xe')](function(_0x382ae9){return _0x382ae9;});}})[_0xe8d0('0xe')](function(_0x158d24){_0x2e4caf=_0x158d24;if(_0x158d24){if(_0x158d24[_0xe8d0('0x47')]||_0x158d24[_0xe8d0('0x48')]){return db[_0x158d24[_0xe8d0('0x47')]?'VoiceQueue':_0xe8d0('0x49')]['find']({'where':{'id':_0x158d24['VoiceQueueId']?_0x158d24[_0xe8d0('0x47')]:_0x158d24['CampaignId']},'attributes':['id',_0xe8d0('0x11')],'raw':!![]});}}})['then'](function(_0x1f8fcc){var _0x28494c={};if(_0x1f8fcc){_[_0xe8d0('0x36')](_0x28494c,_[_0xe8d0('0x4a')](_0x2e4caf['dataValues'],[_0xe8d0('0x4b'),_0xe8d0('0x4c'),'id']));_0x28494c[_0xe8d0('0x4d')]=0x15;_0x28494c[_0xe8d0('0x4e')]=_0xe8d0('0x4f');_0x28494c['campaign']=_0x1f8fcc[_0xe8d0('0x11')];_0x28494c[_0xe8d0('0x50')]=_0xad7d94[_0xe8d0('0x51')]['name'];_0x28494c[_0xe8d0('0x52')]=_0xad7d94['user']['id'];_0x28494c['deleted']=!![];_0x28494c[_0xe8d0('0x53')]=moment()[_0xe8d0('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x28494c[_0xe8d0('0x55')]=_0x2e4caf[_0xe8d0('0x56')];_0x28494c['campaigntype']=_0x2e4caf[_0xe8d0('0x47')]?_0xe8d0('0x57'):_0xe8d0('0x58');return db[_0xe8d0('0x59')]['find']({'where':{'id':_0x28494c[_0xe8d0('0x5a')]},'attributes':[_0xe8d0('0x5b'),_0xe8d0('0x5c')]})[_0xe8d0('0xe')](function(_0x51930e){if(!_[_0xe8d0('0x5d')](_0x34047c)&&!_[_0xe8d0('0x5d')](_0x51930e[_0xe8d0('0x5b')])){_0x28494c[_0xe8d0('0x5e')]=_0x51930e[_0xe8d0('0x5b')];if(!_[_0xe8d0('0x5d')](_0x51930e['lastName'])){_0x28494c['calleridname']+='\x20'+_0x51930e[_0xe8d0('0x5c')];}}})['finally'](function(){return db[_0xe8d0('0x5f')][_0xe8d0('0x42')](_0x28494c);});}})['then'](function(_0x5ac1ae){return db[_0xe8d0('0x60')]['destroy']({'where':{'CmHopperId':_0x5a0c7e}});})[_0xe8d0('0xe')](function(){return _0x34047c['status'](0xcc)[_0xe8d0('0x61')]();})[_0xe8d0('0x3e')](handleError(_0x34047c,null));};exports[_0xe8d0('0x62')]=function(_0x4e2abc,_0x3091fb){var _0x3cbc9f=[];return db['CmContact'][_0xe8d0('0x45')]()['then'](function(_0x3d0908){_0x3cbc9f=_['keys'](_0x3d0908);return _0x4e2abc[_0xe8d0('0x51')][_0xe8d0('0x63')]({'where':{'type':_0xe8d0('0x64'),'dialActive':!![],'dialMethod':_0xe8d0('0x65')},'attributes':['id',_0xe8d0('0x66'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0xd7d433){if(_0xd7d433&&_0xd7d433['length']){return db[_0xe8d0('0x67')][_0xe8d0('0x68')](function(_0xbbe457){var _0x95565d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe8d0('0x54')](_0xe8d0('0x69'))},'VoiceQueueId':{'$in':_[_0xe8d0('0x13')](_0xd7d433,'id')},'$or':[{'UserId':null},{'UserId':_0x4e2abc[_0xe8d0('0x51')]['id']}]};var _0x7557d9={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xd7d433)[_0xe8d0('0x35')]([_0xe8d0('0x6a'),0x0])[_0xe8d0('0x13')]('id')[_0xe8d0('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x4e2abc[_0xe8d0('0x51')]['id']}]};var _0x22992f={'$or':[_0x95565d,_0x7557d9]};var _0x4a68d5=[];if(_0x4e2abc[_0xe8d0('0x43')][_0xe8d0('0x6c')]&&_0x4e2abc[_0xe8d0('0x43')][_0xe8d0('0x6c')]===_0xe8d0('0x6d')){if(!_['isEmpty'](_0x4e2abc[_0xe8d0('0x43')][_0xe8d0('0x6e')])){_0x22992f['id']={'$in':_0x4e2abc[_0xe8d0('0x43')][_0xe8d0('0x6e')]};}_0x4a68d5=[[_0xe8d0('0x6f'),_0xe8d0('0x70')],[_0xe8d0('0x71'),_0xd7d433[0x0][_0xe8d0('0x66')]===_0xe8d0('0x70')?_0xe8d0('0x72'):_0xe8d0('0x70')],db[_0xe8d0('0x67')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe8d0('0x72')]];}else{if(!_['isEmpty'](_0x4e2abc[_0xe8d0('0x43')][_0xe8d0('0x6e')])){_0x22992f['id']={'$notIn':_0x4e2abc['body'][_0xe8d0('0x6e')]};}_0x4a68d5=[[_0xe8d0('0x6f'),_0xe8d0('0x72')],[_0xe8d0('0x71'),_0xd7d433[0x0][_0xe8d0('0x66')]],db[_0xe8d0('0x67')][_0xe8d0('0x73')](_0xe8d0('0x74')),['id',_0xe8d0('0x70')]];}return db[_0xe8d0('0x3c')][_0xe8d0('0x75')]({'attributes':['id',_0xe8d0('0x76'),_0xe8d0('0x56'),_0xe8d0('0x77')],'where':_0x22992f,'order':_0x4a68d5,'transaction':_0xbbe457,'lock':_0xbbe457[_0xe8d0('0x78')][_0xe8d0('0x79')],'include':[{'model':db[_0xe8d0('0x59')],'as':_0xe8d0('0x7a'),'attributes':_0x3cbc9f,'include':[{'model':db[_0xe8d0('0x7b')],'as':'Company','attributes':['id',_0xe8d0('0x11')]}]},{'model':db[_0xe8d0('0x7c')],'as':_0xe8d0('0x7d'),'attributes':['id','name']},{'model':db[_0xe8d0('0x7e')],'as':'Queue','attributes':['id',_0xe8d0('0x11'),_0xe8d0('0x7f')]}]})[_0xe8d0('0xe')](function(_0x561eb3){if(_0x561eb3){return _0x561eb3[_0xe8d0('0x44')]({'UserId':_0x4e2abc[_0xe8d0('0x51')]['id']},{'transaction':_0xbbe457});}});});}})[_0xe8d0('0xe')](handleEntityNotFound(_0x3091fb,null))[_0xe8d0('0xe')](respondWithResult(_0x3091fb,null))[_0xe8d0('0x3e')](handleError(_0x3091fb,null));};exports['getPreviewRecall']=function(_0x42c686,_0xbd7ee,_0x23ba49){var _0xe4cb93=[];var _0x252f0e=_0x42c686[_0xe8d0('0x40')]['id'];var _0x16818f=_0x42c686[_0xe8d0('0x51')]['id'];return db['CmContact'][_0xe8d0('0x45')]()[_0xe8d0('0xe')](function(_0x14d722){_0xe4cb93=_[_0xe8d0('0x17')](_0x14d722);return db['sequelize'][_0xe8d0('0x68')](function(_0x2f6382){const _0xea8c98={'id':_0x252f0e};return db['CmHopper'][_0xe8d0('0x75')]({'attributes':['id','scheduledat',_0xe8d0('0x77')],'where':_0xea8c98,'transaction':_0x2f6382,'lock':_0x2f6382['LOCK'][_0xe8d0('0x79')],'include':[{'model':db[_0xe8d0('0x59')],'as':_0xe8d0('0x7a'),'attributes':_0xe4cb93,'include':[{'model':db[_0xe8d0('0x7b')],'as':_0xe8d0('0x80'),'attributes':['id',_0xe8d0('0x11')]}]},{'model':db[_0xe8d0('0x7c')],'as':_0xe8d0('0x7d'),'attributes':['id',_0xe8d0('0x11')]},{'model':db[_0xe8d0('0x7e')],'as':_0xe8d0('0x81'),'attributes':['id',_0xe8d0('0x11'),'dialActive']}]})[_0xe8d0('0xe')](function(_0x1fa61e){if(_0x1fa61e){return _0x1fa61e[_0xe8d0('0x44')]({'UserId':_0x16818f},{'transaction':_0x2f6382});}});});})[_0xe8d0('0xe')](handleEntityNotFound(_0xbd7ee,null))[_0xe8d0('0xe')](respondWithResult(_0xbd7ee,null))[_0xe8d0('0x3e')](handleError(_0xbd7ee,null));};exports[_0xe8d0('0x82')]=function(_0x605b5f,_0x2f9702){return _0x605b5f[_0xe8d0('0x51')]['getVoiceQueues']({'where':{'type':_0xe8d0('0x64'),'dialActive':!![],'dialMethod':_0xe8d0('0x65')},'attributes':['id'],'raw':!![]})[_0xe8d0('0xe')](function(_0xebc89e){if(_0xebc89e&&_0xebc89e[_0xe8d0('0x2f')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe8d0('0x54')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe8d0('0x13')](_0xebc89e,'id')},'$or':[{'UserId':null},{'UserId':_0x605b5f[_0xe8d0('0x51')]['id']}]}});}return 0x0;})[_0xe8d0('0xe')](function(_0x50e397){if(!_[_0xe8d0('0x5d')](_0x50e397)&&_['isNumber'](_0x50e397)){return _0x2f9702[_0xe8d0('0x7')](0xc8)[_0xe8d0('0xd')]({'contacts':_0x50e397});}else{logger[_0xe8d0('0x83')](_0xe8d0('0x84'),_0xe8d0('0x82'),0x194,'entity\x20not\x20found');_0x2f9702['sendStatus'](0x194);}})[_0xe8d0('0x3e')](handleError(_0x2f9702,null));};exports[_0xe8d0('0x85')]=function(_0x18ec80,_0xa1163b){var _0x2bb013=shared[_0xe8d0('0x86')];var _0x2790f=[];_[_0xe8d0('0x13')](_0x2bb013,function(_0x1e69f7){_0x2790f['push']({'id':_0x1e69f7[_0xe8d0('0x11')],'name':_0x1e69f7[_0xe8d0('0x11')],'utcOffset':_0x1e69f7[_0xe8d0('0x87')]});});return _0xa1163b[_0xe8d0('0x7')](0xc8)['json']({'tz':_0x2790f});};exports['getTimezone']=function(_0xde507a,_0x1c0d37){var _0x2ed585=shared[_0xe8d0('0x86')];var _0x38a2dc={};if(!_[_0xe8d0('0x5d')](_0x2ed585[_0xde507a[_0xe8d0('0x43')]['id']]))_0x38a2dc=_0x2ed585[_0xde507a[_0xe8d0('0x43')]['id']];return _0x1c0d37[_0xe8d0('0x7')](0xc8)[_0xe8d0('0xd')](_0x38a2dc);}; \ No newline at end of file +var _0x5089=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','lastName','isNil','calleridname','firstName','CmHopperFinal','CmHopperAdditionalPhone','destroy','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','Queue','getOpenContacts','isNumber','entity\x20not\x20found','sendStatus','getTimezones','push','moment','lodash','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','limit','undefined','count','set','update','then','error','stack','name','status','send','index','map','type','model','query','keys','filters','concat','$and','$or','$lt','$eq','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','CmHopper','includeAll','findAll','rows','catch','params','rawAttributes','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','state','campaign','user','UserId','deleted','deletedat','format'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x5089,0x1bb));var _0x9508=function(_0x3f92bc,_0x482ad4){_0x3f92bc=_0x3f92bc-0x0;var _0xa15d20=_0x5089[_0x3f92bc];return _0xa15d20;};'use strict';var moment=require(_0x9508('0x0'));var _=require(_0x9508('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9508('0x2'))(_0x9508('0x3'));var shared=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];function respondWithResult(_0x172549,_0x59d3ee){_0x59d3ee=_0x59d3ee||0xc8;return function(_0x86540d){if(_0x86540d){return _0x172549['status'](_0x59d3ee)[_0x9508('0x6')](_0x86540d);}};}function respondWithFilteredResult(_0x4538dd,_0x257318){return function(_0x4ab3c6){if(_0x4ab3c6){var _0x1dc04c=typeof _0x257318[_0x9508('0x7')]==='undefined'&&typeof _0x257318[_0x9508('0x8')]===_0x9508('0x9');var _0x4f6720=_0x4ab3c6[_0x9508('0xa')];var _0x5c9dc9=_0x1dc04c?0x0:_0x257318[_0x9508('0x7')];var _0x26cc8a=_0x1dc04c?_0x4ab3c6[_0x9508('0xa')]:_0x257318[_0x9508('0x7')]+_0x257318[_0x9508('0x8')];var _0x317f6e;if(_0x26cc8a>=_0x4f6720){_0x26cc8a=_0x4f6720;_0x317f6e=0xc8;}else{_0x317f6e=0xce;}_0x4538dd['status'](_0x317f6e);return _0x4538dd[_0x9508('0xb')]('Content-Range',_0x5c9dc9+'-'+_0x26cc8a+'/'+_0x4f6720)[_0x9508('0x6')](_0x4ab3c6);}return null;};}function saveUpdates(_0x396896,_0x554c90){return function(_0x11dc7f){if(_0x11dc7f){return _0x11dc7f[_0x9508('0xc')](_0x396896)[_0x9508('0xd')](function(_0x4701de){return _0x4701de;});}return null;};}function handleEntityNotFound(_0x51ef92,_0x440709){return function(_0x21b2d1){if(!_0x21b2d1){_0x51ef92['sendStatus'](0x194);}return _0x21b2d1;};}function handleError(_0x2a281d,_0x539746){_0x539746=_0x539746||0x1f4;return function(_0x25d4d6){logger[_0x9508('0xe')](_0x25d4d6[_0x9508('0xf')]);if(_0x25d4d6[_0x9508('0x10')]){delete _0x25d4d6[_0x9508('0x10')];}_0x2a281d[_0x9508('0x11')](_0x539746)[_0x9508('0x12')](_0x25d4d6);};}exports[_0x9508('0x13')]=function(_0x5a303c,_0x22ba9c){var _0x378749={},_0xfcc29d={},_0x1ba7e6={'count':0x0,'rows':[]};var _0x23c30e=_[_0x9508('0x14')](db['CmHopper']['rawAttributes'],function(_0x17e43c){return{'name':_0x17e43c['fieldName'],'type':_0x17e43c[_0x9508('0x15')]['key']};});_0xfcc29d[_0x9508('0x16')]=_[_0x9508('0x14')](_0x23c30e,_0x9508('0x10'));_0xfcc29d[_0x9508('0x17')]=_[_0x9508('0x18')](_0x5a303c[_0x9508('0x17')]);_0xfcc29d[_0x9508('0x19')]=_['intersection'](_0xfcc29d['model'],_0xfcc29d[_0x9508('0x17')]);_0xfcc29d[_0x9508('0x19')]=_[_0x9508('0x1a')](_0xfcc29d[_0x9508('0x19')],[_0x9508('0x1b'),_0x9508('0x1c'),'$gt','$gte',_0x9508('0x1d'),'$lte','$ne',_0x9508('0x1e'),'$not','$between',_0x9508('0x1f'),_0x9508('0x20'),'$notIn',_0x9508('0x21'),_0x9508('0x22'),_0x9508('0x23'),_0x9508('0x24'),_0x9508('0x21'),_0x9508('0x25'),_0x9508('0x26'),_0x9508('0x27'),_0x9508('0x28')]);_0x378749[_0x9508('0x29')]=_[_0x9508('0x2a')](_0xfcc29d['model'],qs[_0x9508('0x2b')](_0x5a303c[_0x9508('0x17')][_0x9508('0x2b')]));_0x378749['attributes']=_0x378749[_0x9508('0x29')][_0x9508('0x2c')]?_0x378749['attributes']:_0xfcc29d[_0x9508('0x16')];if(!_0x5a303c[_0x9508('0x17')]['hasOwnProperty'](_0x9508('0x2d'))){_0x378749[_0x9508('0x8')]=qs[_0x9508('0x8')](_0x5a303c[_0x9508('0x17')]['limit']);_0x378749['offset']=qs[_0x9508('0x7')](_0x5a303c[_0x9508('0x17')][_0x9508('0x7')]);}_0x378749['order']=qs['sort'](_0x5a303c[_0x9508('0x17')][_0x9508('0x2e')]);_0x378749[_0x9508('0x2f')]=qs[_0x9508('0x19')](_[_0x9508('0x30')](_0x5a303c[_0x9508('0x17')],_0xfcc29d[_0x9508('0x19')]),_0x23c30e);if(_0x5a303c[_0x9508('0x17')][_0x9508('0x31')]){_0x378749[_0x9508('0x2f')]=_['merge'](_0x378749[_0x9508('0x2f')],{'$or':_[_0x9508('0x14')](_0x23c30e,function(_0x5d7098){if(_0x5d7098[_0x9508('0x15')]!==_0x9508('0x32')){var _0x3f69b1={};_0x3f69b1[_0x5d7098[_0x9508('0x10')]]={'$like':'%'+_0x5a303c[_0x9508('0x17')][_0x9508('0x31')]+'%'};return _0x3f69b1;}})});}_0x378749=_[_0x9508('0x33')]({},_0x378749,_0x5a303c[_0x9508('0x34')]);var _0xfb6676={'where':_0x378749[_0x9508('0x2f')]};return db[_0x9508('0x35')]['count'](_0xfb6676)[_0x9508('0xd')](function(_0x5b690e){_0x1ba7e6[_0x9508('0xa')]=_0x5b690e;if(_0x5a303c[_0x9508('0x17')][_0x9508('0x36')]){_0x378749['include']=[{'all':!![]}];}return db['CmHopper'][_0x9508('0x37')](_0x378749);})[_0x9508('0xd')](function(_0x1277b1){_0x1ba7e6[_0x9508('0x38')]=_0x1277b1;return _0x1ba7e6;})['then'](respondWithFilteredResult(_0x22ba9c,_0x378749))[_0x9508('0x39')](handleError(_0x22ba9c,null));};exports['show']=function(_0x37b8a2,_0x174e83){var _0x5205f8={'raw':!![],'where':{'id':_0x37b8a2[_0x9508('0x3a')]['id']}},_0x33e412={};_0x33e412['model']=_[_0x9508('0x18')](db[_0x9508('0x35')][_0x9508('0x3b')]);_0x33e412[_0x9508('0x17')]=_['keys'](_0x37b8a2['query']);_0x33e412[_0x9508('0x19')]=_['intersection'](_0x33e412[_0x9508('0x16')],_0x33e412[_0x9508('0x17')]);_0x5205f8[_0x9508('0x29')]=_[_0x9508('0x2a')](_0x33e412['model'],qs['fields'](_0x37b8a2['query'][_0x9508('0x2b')]));_0x5205f8['attributes']=_0x5205f8[_0x9508('0x29')]['length']?_0x5205f8[_0x9508('0x29')]:_0x33e412[_0x9508('0x16')];if(_0x37b8a2[_0x9508('0x17')][_0x9508('0x36')]){_0x5205f8['include']=[{'all':!![]}];}_0x5205f8=_[_0x9508('0x33')]({},_0x5205f8,_0x37b8a2[_0x9508('0x34')]);return db[_0x9508('0x35')]['find'](_0x5205f8)[_0x9508('0xd')](handleEntityNotFound(_0x174e83,null))[_0x9508('0xd')](respondWithResult(_0x174e83,null))['catch'](handleError(_0x174e83,null));};exports[_0x9508('0x3c')]=function(_0x50a4ba,_0xd6d570){return db['CmHopper']['create'](_0x50a4ba[_0x9508('0x3d')],{})[_0x9508('0xd')](respondWithResult(_0xd6d570,0xc9))[_0x9508('0x39')](handleError(_0xd6d570,null));};exports[_0x9508('0xc')]=function(_0xf17d3a,_0x169daf){if(_0xf17d3a['body']['id']){delete _0xf17d3a[_0x9508('0x3d')]['id'];}return db[_0x9508('0x35')][_0x9508('0x3e')]({'where':{'id':_0xf17d3a['params']['id']}})[_0x9508('0xd')](handleEntityNotFound(_0x169daf,null))[_0x9508('0xd')](saveUpdates(_0xf17d3a[_0x9508('0x3d')],null))[_0x9508('0xd')](respondWithResult(_0x169daf,null))['catch'](handleError(_0x169daf,null));};exports[_0x9508('0x3f')]=function(_0x552d10,_0x155928){return db[_0x9508('0x35')]['describe']()[_0x9508('0xd')](respondWithResult(_0x155928,null))[_0x9508('0x39')](handleError(_0x155928,null));};exports['destroy']=function(_0x61eb2c,_0x22306e){var _0x5125c9;var _0x39215b=_0x61eb2c['params']['id'];return db[_0x9508('0x35')]['find']({'where':{'id':_0x61eb2c[_0x9508('0x3a')]['id']}})['then'](handleEntityNotFound(_0x22306e,null))['then'](function(_0x55a158){if(_0x55a158){return _0x55a158['destroy']()[_0x9508('0xd')](function(_0x13cedc){return _0x13cedc;});}})[_0x9508('0xd')](function(_0x2eead6){_0x5125c9=_0x2eead6;if(_0x2eead6){if(_0x2eead6[_0x9508('0x40')]||_0x2eead6[_0x9508('0x41')]){return db[_0x2eead6[_0x9508('0x40')]?_0x9508('0x42'):_0x9508('0x43')]['find']({'where':{'id':_0x2eead6[_0x9508('0x40')]?_0x2eead6[_0x9508('0x40')]:_0x2eead6[_0x9508('0x41')]},'attributes':['id',_0x9508('0x10')],'raw':!![]});}}})[_0x9508('0xd')](function(_0x539f5c){var _0x5c0467={};if(_0x539f5c){_[_0x9508('0x33')](_0x5c0467,_['omit'](_0x5125c9[_0x9508('0x44')],[_0x9508('0x45'),'updatedAt','id']));_0x5c0467[_0x9508('0x46')]=0x15;_0x5c0467['statedesc']='deleted';_0x5c0467[_0x9508('0x47')]=_0x539f5c[_0x9508('0x10')];_0x5c0467['membername']=_0x61eb2c[_0x9508('0x48')][_0x9508('0x10')];_0x5c0467[_0x9508('0x49')]=_0x61eb2c[_0x9508('0x48')]['id'];_0x5c0467[_0x9508('0x4a')]=!![];_0x5c0467[_0x9508('0x4b')]=moment()[_0x9508('0x4c')](_0x9508('0x4d'));_0x5c0467[_0x9508('0x4e')]=_0x5125c9[_0x9508('0x4f')];_0x5c0467[_0x9508('0x50')]=_0x5125c9[_0x9508('0x40')]?_0x9508('0x51'):_0x9508('0x52');return db['CmContact'][_0x9508('0x3e')]({'where':{'id':_0x5c0467[_0x9508('0x53')]},'attributes':['firstName',_0x9508('0x54')]})['then'](function(_0x53d35a){if(!_[_0x9508('0x55')](_0x22306e)&&!_[_0x9508('0x55')](_0x53d35a['firstName'])){_0x5c0467[_0x9508('0x56')]=_0x53d35a[_0x9508('0x57')];if(!_['isNil'](_0x53d35a[_0x9508('0x54')])){_0x5c0467[_0x9508('0x56')]+='\x20'+_0x53d35a[_0x9508('0x54')];}}})['finally'](function(){return db[_0x9508('0x58')][_0x9508('0x3c')](_0x5c0467);});}})[_0x9508('0xd')](function(_0x692368){return db[_0x9508('0x59')][_0x9508('0x5a')]({'where':{'CmHopperId':_0x39215b}});})['then'](function(){return _0x22306e[_0x9508('0x11')](0xcc)[_0x9508('0x5b')]();})[_0x9508('0x39')](handleError(_0x22306e,null));};exports[_0x9508('0x5c')]=function(_0x5bab99,_0x2ff0bb){var _0x5e2dab=[];return db[_0x9508('0x5d')][_0x9508('0x3f')]()['then'](function(_0x308fb0){_0x5e2dab=_[_0x9508('0x18')](_0x308fb0);return _0x5bab99['user'][_0x9508('0x5e')]({'where':{'type':_0x9508('0x5f'),'dialActive':!![],'dialMethod':_0x9508('0x60')},'attributes':['id',_0x9508('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x9508('0xd')](function(_0x3b028a){if(_0x3b028a&&_0x3b028a[_0x9508('0x2c')]){return db[_0x9508('0x62')][_0x9508('0x63')](function(_0x9a59f7){var _0x67371f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9508('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9508('0x14')](_0x3b028a,'id')},'$or':[{'UserId':null},{'UserId':_0x5bab99[_0x9508('0x48')]['id']}]};var _0x44b61a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3b028a)['filter']([_0x9508('0x64'),0x0])['map']('id')[_0x9508('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x5bab99['user']['id']}]};var _0x53e277={'$or':[_0x67371f,_0x44b61a]};var _0x54f0f3=[];if(_0x5bab99[_0x9508('0x3d')][_0x9508('0x66')]&&_0x5bab99[_0x9508('0x3d')]['direction']===_0x9508('0x67')){if(!_[_0x9508('0x68')](_0x5bab99[_0x9508('0x3d')][_0x9508('0x69')])){_0x53e277['id']={'$in':_0x5bab99[_0x9508('0x3d')]['hopperIds']};}_0x54f0f3=[['priority',_0x9508('0x6a')],[_0x9508('0x6b'),_0x3b028a[0x0][_0x9508('0x61')]===_0x9508('0x6a')?_0x9508('0x6c'):_0x9508('0x6a')],db[_0x9508('0x62')][_0x9508('0x6d')](_0x9508('0x6e')),['id',_0x9508('0x6c')]];}else{if(!_[_0x9508('0x68')](_0x5bab99[_0x9508('0x3d')]['hopperIds'])){_0x53e277['id']={'$notIn':_0x5bab99['body'][_0x9508('0x69')]};}_0x54f0f3=[['priority',_0x9508('0x6c')],['scheduledAt',_0x3b028a[0x0]['dialOrderByScheduledAt']],db[_0x9508('0x62')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x9508('0x6a')]];}return db[_0x9508('0x35')][_0x9508('0x6f')]({'attributes':['id',_0x9508('0x70'),_0x9508('0x4f'),_0x9508('0x71')],'where':_0x53e277,'order':_0x54f0f3,'transaction':_0x9a59f7,'lock':_0x9a59f7[_0x9508('0x72')][_0x9508('0x73')],'include':[{'model':db[_0x9508('0x5d')],'as':_0x9508('0x74'),'attributes':_0x5e2dab,'include':[{'model':db[_0x9508('0x75')],'as':_0x9508('0x76'),'attributes':['id',_0x9508('0x10')]}]},{'model':db[_0x9508('0x77')],'as':_0x9508('0x78'),'attributes':['id','name']},{'model':db[_0x9508('0x42')],'as':'Queue','attributes':['id',_0x9508('0x10'),_0x9508('0x79')]}]})[_0x9508('0xd')](function(_0x42dfdb){if(_0x42dfdb){return _0x42dfdb[_0x9508('0xc')]({'UserId':_0x5bab99[_0x9508('0x48')]['id']},{'transaction':_0x9a59f7});}});});}})[_0x9508('0xd')](handleEntityNotFound(_0x2ff0bb,null))[_0x9508('0xd')](respondWithResult(_0x2ff0bb,null))[_0x9508('0x39')](handleError(_0x2ff0bb,null));};exports[_0x9508('0x7a')]=function(_0x2f292b,_0x470f52,_0x5d0d94){var _0x2db0af=[];var _0x2020bd=_0x2f292b[_0x9508('0x3a')]['id'];var _0x4bddc1=_0x2f292b['user']['id'];return db[_0x9508('0x5d')][_0x9508('0x3f')]()[_0x9508('0xd')](function(_0x27be4b){_0x2db0af=_[_0x9508('0x18')](_0x27be4b);return db[_0x9508('0x62')][_0x9508('0x63')](function(_0x5aa6da){const _0x2bf12b={'id':_0x2020bd};return db['CmHopper']['findOne']({'attributes':['id',_0x9508('0x70'),'recallme'],'where':_0x2bf12b,'transaction':_0x5aa6da,'lock':_0x5aa6da[_0x9508('0x72')][_0x9508('0x73')],'include':[{'model':db['CmContact'],'as':_0x9508('0x74'),'attributes':_0x2db0af,'include':[{'model':db['CmCompany'],'as':_0x9508('0x76'),'attributes':['id','name']}]},{'model':db[_0x9508('0x77')],'as':_0x9508('0x78'),'attributes':['id',_0x9508('0x10')]},{'model':db[_0x9508('0x42')],'as':_0x9508('0x7b'),'attributes':['id',_0x9508('0x10'),_0x9508('0x79')]}]})[_0x9508('0xd')](function(_0x12892f){if(_0x12892f){return _0x12892f[_0x9508('0xc')]({'UserId':_0x4bddc1},{'transaction':_0x5aa6da});}});});})['then'](handleEntityNotFound(_0x470f52,null))[_0x9508('0xd')](respondWithResult(_0x470f52,null))[_0x9508('0x39')](handleError(_0x470f52,null));};exports[_0x9508('0x7c')]=function(_0x175c74,_0xf094d1){return _0x175c74[_0x9508('0x48')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9508('0x60')},'attributes':['id'],'raw':!![]})[_0x9508('0xd')](function(_0x1ad750){if(_0x1ad750&&_0x1ad750['length']){return db['CmHopper'][_0x9508('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9508('0x4d'))},'VoiceQueueId':{'$in':_[_0x9508('0x14')](_0x1ad750,'id')},'$or':[{'UserId':null},{'UserId':_0x175c74[_0x9508('0x48')]['id']}]}});}return 0x0;})['then'](function(_0x3809c3){if(!_[_0x9508('0x55')](_0x3809c3)&&_[_0x9508('0x7d')](_0x3809c3)){return _0xf094d1[_0x9508('0x11')](0xc8)[_0x9508('0x6')]({'contacts':_0x3809c3});}else{logger[_0x9508('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x9508('0x7e'));_0xf094d1[_0x9508('0x7f')](0x194);}})['catch'](handleError(_0xf094d1,null));};exports[_0x9508('0x80')]=function(_0xa88073,_0xdf4171){var _0x4959a6=shared['timezones'];var _0x2b84f4=[];_['map'](_0x4959a6,function(_0x22015f){_0x2b84f4[_0x9508('0x81')]({'id':_0x22015f[_0x9508('0x10')],'name':_0x22015f[_0x9508('0x10')],'utcOffset':_0x22015f['utcOffset']});});return _0xdf4171[_0x9508('0x11')](0xc8)[_0x9508('0x6')]({'tz':_0x2b84f4});};exports['getTimezone']=function(_0x25b463,_0x146d98){var _0xa89fca=shared['timezones'];var _0x130c4a={};if(!_['isNil'](_0xa89fca[_0x25b463[_0x9508('0x3d')]['id']]))_0x130c4a=_0xa89fca[_0x25b463[_0x9508('0x3d')]['id']];return _0x146d98[_0x9508('0x11')](0xc8)[_0x9508('0x6')](_0x130c4a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 78df36f..dff5811 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x34ad69,_0x5a2805){var _0x102612=function(_0xfd4b53){while(--_0xfd4b53){_0x34ad69['push'](_0x34ad69['shift']());}};_0x102612(++_0x5a2805);}(_0x4819,0xcd));var _0x9481=function(_0x1adc50,_0x2ec177){_0x1adc50=_0x1adc50-0x0;var _0x2bfee4=_0x4819[_0x1adc50];return _0x2bfee4;};'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':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x1c694e,_0x5ec027){var _0x45f9f8=function(_0x5ab327){while(--_0x5ab327){_0x1c694e['push'](_0x1c694e['shift']());}};_0x45f9f8(++_0x5ec027);}(_0xf494,0x1c6));var _0x4f49=function(_0x4ce3c8,_0x3039ae){_0x4ce3c8=_0x4ce3c8-0x0;var _0x4b13a2=_0xf494[_0x4ce3c8];return _0x4b13a2;};'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')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 29bb256..08fd158 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 _0xc5a8=['getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','../../config/logger','rpc','GetCmHopper','raw','options','where','attributes','limit','include','model','map','then','debug','stringify','catch','error','message','ShowCmHopper','CmHopper','find','CreateCmHopper','create','body','info','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','voicePause','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CountReScheduled','findAll','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','order','all','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','dialTimezone','DESC'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0xc5a8,0x144));var _0x8c5a=function(_0x2891c0,_0x279d8b){_0x2891c0=_0x2891c0-0x0;var _0x26ebd0=_0xc5a8[_0x2891c0];return _0x26ebd0;};'use strict';var _=require(_0x8c5a('0x0'));var util=require(_0x8c5a('0x1'));var moment=require('moment');var BPromise=require(_0x8c5a('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x8c5a('0x3'))(_0x8c5a('0x4'));exports[_0x8c5a('0x5')]=function(_0x2550b6){var _0x3f5cb0=this;return new Promise(function(_0x3722e4,_0x10cab5){return db['CmHopper']['findAll']({'raw':_0x2550b6['options']?_0x2550b6['options'][_0x8c5a('0x6')]===undefined?!![]:![]:!![],'where':_0x2550b6[_0x8c5a('0x7')]?_0x2550b6[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0x2550b6[_0x8c5a('0x7')]?_0x2550b6['options'][_0x8c5a('0x9')]||null:null,'limit':_0x2550b6[_0x8c5a('0x7')]?_0x2550b6['options'][_0x8c5a('0xa')]||null:null,'include':_0x2550b6[_0x8c5a('0x7')]?_0x2550b6['options'][_0x8c5a('0xb')]?_['map'](_0x2550b6[_0x8c5a('0x7')][_0x8c5a('0xb')],function(_0x1aa810){return{'model':db[_0x1aa810[_0x8c5a('0xc')]],'as':_0x1aa810['as'],'attributes':_0x1aa810[_0x8c5a('0x9')],'include':_0x1aa810['include']?_[_0x8c5a('0xd')](_0x1aa810[_0x8c5a('0xb')],function(_0x29388d){return{'model':db[_0x29388d[_0x8c5a('0xc')]],'as':_0x29388d['as'],'attributes':_0x29388d[_0x8c5a('0x9')],'include':_0x29388d[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x29388d[_0x8c5a('0xb')],function(_0x397521){return{'model':db[_0x397521['model']],'as':_0x397521['as'],'attributes':_0x397521[_0x8c5a('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8c5a('0xe')](function(_0x22f4ba){logger['info'](_0x8c5a('0x5'),_0x2550b6);logger[_0x8c5a('0xf')](_0x8c5a('0x5'),_0x2550b6,JSON[_0x8c5a('0x10')](_0x22f4ba));_0x3722e4(_0x22f4ba);})[_0x8c5a('0x11')](function(_0x39bb31){logger[_0x8c5a('0x12')](_0x8c5a('0x5'),_0x39bb31[_0x8c5a('0x13')],_0x2550b6);_0x10cab5(_0x3f5cb0[_0x8c5a('0x12')](0x1f4,_0x39bb31['message']));});});};exports[_0x8c5a('0x14')]=function(_0x483f79){var _0x566eac=this;return new Promise(function(_0x1a639b,_0x3722d3){return db[_0x8c5a('0x15')][_0x8c5a('0x16')]({'raw':_0x483f79[_0x8c5a('0x7')]?_0x483f79['options'][_0x8c5a('0x6')]===undefined?!![]:![]:!![],'where':_0x483f79[_0x8c5a('0x7')]?_0x483f79[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0x483f79['options']?_0x483f79['options'][_0x8c5a('0x9')]||null:null,'include':_0x483f79[_0x8c5a('0x7')]?_0x483f79[_0x8c5a('0x7')][_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x483f79[_0x8c5a('0x7')]['include'],function(_0x47c19c){return{'model':db[_0x47c19c[_0x8c5a('0xc')]],'as':_0x47c19c['as'],'attributes':_0x47c19c[_0x8c5a('0x9')],'include':_0x47c19c[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x47c19c[_0x8c5a('0xb')],function(_0x570adf){return{'model':db[_0x570adf['model']],'as':_0x570adf['as'],'attributes':_0x570adf[_0x8c5a('0x9')],'include':_0x570adf[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x570adf[_0x8c5a('0xb')],function(_0x45daa0){return{'model':db[_0x45daa0[_0x8c5a('0xc')]],'as':_0x45daa0['as'],'attributes':_0x45daa0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2789d9){logger['info'](_0x8c5a('0x14'),_0x483f79);logger[_0x8c5a('0xf')]('ShowCmHopper',_0x483f79,JSON[_0x8c5a('0x10')](_0x2789d9));_0x1a639b(_0x2789d9);})['catch'](function(_0x3f19d3){logger[_0x8c5a('0x12')](_0x8c5a('0x14'),_0x3f19d3[_0x8c5a('0x13')],_0x483f79);_0x3722d3(_0x566eac[_0x8c5a('0x12')](0x1f4,_0x3f19d3[_0x8c5a('0x13')]));});});};exports[_0x8c5a('0x17')]=function(_0x508d4a){var _0x9dcc53=this;return new Promise(function(_0x47d41c,_0x3d8eb5){return db[_0x8c5a('0x15')][_0x8c5a('0x18')](_0x508d4a[_0x8c5a('0x19')],{'raw':_0x508d4a['options']?_0x508d4a['options']['raw']===undefined?!![]:![]:!![]})[_0x8c5a('0xe')](function(_0x4e2c9a){logger[_0x8c5a('0x1a')]('CreateCmHopper',_0x508d4a);logger[_0x8c5a('0xf')]('CreateCmHopper',_0x508d4a,JSON[_0x8c5a('0x10')](_0x4e2c9a));_0x47d41c(_0x4e2c9a);})[_0x8c5a('0x11')](function(_0x26342f){logger[_0x8c5a('0x12')](_0x8c5a('0x17'),_0x26342f[_0x8c5a('0x13')],_0x508d4a);_0x3d8eb5(_0x9dcc53['error'](0x1f4,_0x26342f['message']));});});};exports[_0x8c5a('0x1b')]=function(_0x17b895){var _0x3f8981=this;return new Promise(function(_0x5b13ff,_0x31d7fd){return db[_0x8c5a('0x15')][_0x8c5a('0x1c')](_0x17b895[_0x8c5a('0x19')],{'raw':_0x17b895[_0x8c5a('0x7')]?_0x17b895[_0x8c5a('0x7')][_0x8c5a('0x6')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b895['options']?_0x17b895[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0x17b895[_0x8c5a('0x7')]?_0x17b895[_0x8c5a('0x7')][_0x8c5a('0x9')]||null:null,'limit':_0x17b895[_0x8c5a('0x7')]?_0x17b895[_0x8c5a('0x7')][_0x8c5a('0xa')]||null:null})[_0x8c5a('0xe')](function(_0x64c41e){logger['info'](_0x8c5a('0x1b'),_0x17b895);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x8c5a('0x10')](_0x17b895[_0x8c5a('0x7')][_0x8c5a('0x8')]),_0x17b895[_0x8c5a('0x19')][_0x8c5a('0x1d')]);logger[_0x8c5a('0xf')](_0x8c5a('0x1b'),_0x17b895,JSON[_0x8c5a('0x10')](_0x64c41e));_0x5b13ff(_0x64c41e);})[_0x8c5a('0x11')](function(_0x4f1158){logger[_0x8c5a('0x12')](_0x8c5a('0x1b'),_0x4f1158[_0x8c5a('0x13')],_0x17b895);_0x31d7fd(_0x3f8981[_0x8c5a('0x12')](0x1f4,_0x4f1158[_0x8c5a('0x13')]));});});};exports[_0x8c5a('0x1e')]=function(_0x542919){var _0xec7eed=this;return new Promise(function(_0x36590f,_0x4b9129){return db[_0x8c5a('0x15')][_0x8c5a('0x1f')]({'where':_0x542919[_0x8c5a('0x7')]?_0x542919[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null})[_0x8c5a('0xe')](function(_0x53dcfa){logger[_0x8c5a('0x1a')](_0x8c5a('0x1e'),_0x542919);logger['debug'](_0x8c5a('0x1e'),_0x542919,JSON[_0x8c5a('0x10')](_0x53dcfa));_0x36590f(_0x53dcfa);})[_0x8c5a('0x11')](function(_0x28594f){logger[_0x8c5a('0x12')]('DestroyCmHopper',_0x28594f[_0x8c5a('0x13')],_0x542919);_0x4b9129(_0xec7eed[_0x8c5a('0x12')](0x1f4,_0x28594f[_0x8c5a('0x13')]));});});};exports[_0x8c5a('0x20')]=function(_0xd7a3){var _0x44869a=this;return new Promise(function(_0xce61ff,_0x85c45a){return db['CmContact'][_0x8c5a('0x21')]()[_0x8c5a('0xe')](function(_0x9e54a8){return db[_0x8c5a('0x22')][_0x8c5a('0x23')](function(_0x22a4dc){return db[_0x8c5a('0x15')]['findAll']({'where':_0xd7a3[_0x8c5a('0x7')]?_0xd7a3[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0xd7a3['options']?_0xd7a3[_0x8c5a('0x7')][_0x8c5a('0x9')]||null:null,'limit':_0xd7a3[_0x8c5a('0x7')]?_0xd7a3[_0x8c5a('0x7')]['limit']||null:null,'order':_0xd7a3[_0x8c5a('0x7')]?_0xd7a3[_0x8c5a('0x7')]['order']||null:null,'transaction':_0x22a4dc,'lock':_0x22a4dc[_0x8c5a('0x24')][_0x8c5a('0x25')],'include':[{'model':db[_0x8c5a('0x26')],'as':_0x8c5a('0x27'),'attributes':_[_0x8c5a('0x28')](_0x9e54a8)},{'model':db[_0x8c5a('0x29')],'as':_0x8c5a('0x2a'),'attributes':['id','name',_0x8c5a('0x2b')]}]})['then'](function(_0x151809){var _0x24d05e=[];var _0x226c82=[];for(var _0x19e696=0x0;_0x19e696<_0x151809[_0x8c5a('0x2c')];_0x19e696+=0x1){var _0x81602f=_0x151809[_0x19e696][_0x8c5a('0x2d')];if(_0x81602f===null){_0x24d05e[_0x8c5a('0x2e')](_0x151809[_0x19e696][_0x8c5a('0x1c')](_0xd7a3[_0x8c5a('0x19')],{'transaction':_0x22a4dc}));}else if(!_0x226c82[_0x8c5a('0x2f')](_0x81602f)){_0x226c82[_0x8c5a('0x2e')](_0x81602f);_0x24d05e['push'](_0x151809[_0x19e696][_0x8c5a('0x1c')](_0xd7a3[_0x8c5a('0x19')],{'transaction':_0x22a4dc}));}}return BPromise['all'](_0x24d05e);});})[_0x8c5a('0xe')](function(_0x414f9d){logger[_0x8c5a('0x1a')](_0x8c5a('0x20'),_0xd7a3);if(_0x414f9d[_0x8c5a('0x2c')]>0x0){logger[_0x8c5a('0x1a')](_0x8c5a('0x30'),_0x414f9d[0x0][_0x8c5a('0x31')]['id'],_0x414f9d[0x0]['dataValues'][_0x8c5a('0x32')],_0x414f9d[0x0][_0x8c5a('0x31')][_0x8c5a('0x1d')]);}logger[_0x8c5a('0xf')](_0x8c5a('0x20'),_0xd7a3,JSON[_0x8c5a('0x10')](_0x414f9d));_0xce61ff(_0x414f9d);})[_0x8c5a('0x11')](function(_0x19fc7d){logger[_0x8c5a('0x12')](_0x8c5a('0x20'),_0x19fc7d[_0x8c5a('0x13')],_0xd7a3);_0x85c45a(_0x44869a[_0x8c5a('0x12')](0x1f4,_0x19fc7d[_0x8c5a('0x13')]));});});});};exports[_0x8c5a('0x33')]=function(_0x53e38c){var _0x150fb3=this;return new Promise(function(_0x51412b,_0x4c0f12){return db[_0x8c5a('0x22')][_0x8c5a('0x23')](function(_0x74c53b){return db['CmHopperFinal'][_0x8c5a('0x18')](_0x53e38c['body'],{'raw':_0x53e38c[_0x8c5a('0x7')]?_0x53e38c[_0x8c5a('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x74c53b})[_0x8c5a('0xe')](function(){logger[_0x8c5a('0x1a')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x53e38c[_0x8c5a('0x7')][_0x8c5a('0x8')]),_0x53e38c[_0x8c5a('0x7')][_0x8c5a('0x8')][_0x8c5a('0x1d')]);return db[_0x8c5a('0x15')][_0x8c5a('0x1f')]({'where':_0x53e38c[_0x8c5a('0x7')]?_0x53e38c['options'][_0x8c5a('0x8')]||null:null,'transaction':_0x74c53b});});})['then'](function(_0x4130f9){logger[_0x8c5a('0x1a')](_0x8c5a('0x33'),_0x53e38c);logger[_0x8c5a('0xf')](_0x8c5a('0x33'),_0x53e38c,JSON[_0x8c5a('0x10')](_0x4130f9));_0x51412b(_0x4130f9);})['catch'](function(_0x58d59e){logger['error']('MoveContactManagedDialer',_0x58d59e[_0x8c5a('0x13')],_0x53e38c);_0x4c0f12(_0x150fb3[_0x8c5a('0x12')](0x1f4,_0x58d59e[_0x8c5a('0x13')]));});});};exports[_0x8c5a('0x34')]=function(_0x29fbe8){var _0x2bf20b=this;return new Promise(function(_0x1114b7,_0x454f6e){return db['CmHopper'][_0x8c5a('0x35')]({'raw':_0x29fbe8[_0x8c5a('0x7')]?_0x29fbe8[_0x8c5a('0x7')][_0x8c5a('0x6')]===undefined?!![]:![]:!![],'where':_0x29fbe8['options']?_0x29fbe8[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':[[db[_0x8c5a('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8c5a('0x22')]['literal'](_0x8c5a('0x36')+util[_0x8c5a('0x37')](_0x8c5a('0x38'),moment()[_0x8c5a('0x37')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x8c5a('0x39')))),_0x8c5a('0x3a')]]})[_0x8c5a('0xe')](function(_0x165d75){logger[_0x8c5a('0x1a')](_0x8c5a('0x34'),_0x29fbe8);logger[_0x8c5a('0xf')](_0x8c5a('0x34'),_0x29fbe8,JSON[_0x8c5a('0x10')](_0x165d75));_0x1114b7(_0x165d75);})[_0x8c5a('0x11')](function(_0x13f9ed){logger['error'](_0x8c5a('0x34'),_0x13f9ed[_0x8c5a('0x13')],_0x29fbe8);_0x454f6e(_0x2bf20b[_0x8c5a('0x12')](0x1f4,_0x13f9ed['message']));});});};exports['GetContactRecallMe']=function(_0x4c756c){var _0xd355a4=this;return new Promise(function(_0x7af70d,_0x486124){return db[_0x8c5a('0x26')][_0x8c5a('0x21')]()[_0x8c5a('0xe')](function(){return db[_0x8c5a('0x22')][_0x8c5a('0x23')](function(_0x219d71){return db['CmHopper']['findAll']({'where':_0x4c756c[_0x8c5a('0x7')]?_0x4c756c[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0x4c756c[_0x8c5a('0x7')]?_0x4c756c[_0x8c5a('0x7')][_0x8c5a('0x9')]||null:null,'limit':0x1,'order':_0x4c756c['options']?_0x4c756c['options'][_0x8c5a('0x3b')]||null:null,'group':db[_0x8c5a('0x15')]['UserId'],'transaction':_0x219d71,'lock':_0x219d71[_0x8c5a('0x24')][_0x8c5a('0x25')],'include':_0x4c756c['options']?_0x4c756c[_0x8c5a('0x7')][_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x4c756c[_0x8c5a('0x7')][_0x8c5a('0xb')],function(_0x462c54){return{'model':db[_0x462c54[_0x8c5a('0xc')]],'as':_0x462c54['as'],'attributes':_0x462c54['attributes'],'include':_0x462c54[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x462c54[_0x8c5a('0xb')],function(_0x57c6fe){return{'model':db[_0x57c6fe[_0x8c5a('0xc')]],'as':_0x57c6fe['as'],'attributes':_0x57c6fe['attributes'],'include':_0x57c6fe[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x57c6fe[_0x8c5a('0xb')],function(_0x4658df){return{'model':db[_0x4658df[_0x8c5a('0xc')]],'as':_0x4658df['as'],'attributes':_0x4658df[_0x8c5a('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8c5a('0xe')](function(_0x22a279){var _0x32de38=[];for(var _0x209126=0x0;_0x209126<_0x22a279[_0x8c5a('0x2c')];_0x209126+=0x1){_0x32de38['push'](_0x22a279[_0x209126][_0x8c5a('0x1c')](_0x4c756c['body'],{'transaction':_0x219d71}));}return BPromise[_0x8c5a('0x3c')](_0x32de38);});})[_0x8c5a('0xe')](function(_0x2ae676){logger['info'](_0x8c5a('0x3d'),_0x4c756c);logger[_0x8c5a('0xf')](_0x8c5a('0x3d'),_0x4c756c,JSON['stringify'](_0x2ae676));_0x7af70d(_0x2ae676);})[_0x8c5a('0x11')](function(_0xf1e256){logger[_0x8c5a('0x12')]('GetContactRecallMe',_0xf1e256['message'],_0x4c756c);_0x486124(_0xd355a4[_0x8c5a('0x12')](0x1f4,_0xf1e256[_0x8c5a('0x13')]));});});});};exports[_0x8c5a('0x3e')]=function(_0x120a40){var _0x2c3642=this;return new Promise(function(_0x189d10,_0x5449f0){db[_0x8c5a('0x26')]['describe']()[_0x8c5a('0xe')](function(_0x5b2464){return db[_0x8c5a('0x15')][_0x8c5a('0x35')]({'raw':_0x120a40[_0x8c5a('0x7')]?_0x120a40[_0x8c5a('0x7')][_0x8c5a('0x6')]===undefined?!![]:![]:!![],'where':_0x120a40[_0x8c5a('0x7')]?_0x120a40[_0x8c5a('0x7')][_0x8c5a('0x8')]||null:null,'attributes':_0x120a40[_0x8c5a('0x7')]?_0x120a40['options'][_0x8c5a('0x9')]||null:null,'limit':_0x120a40[_0x8c5a('0x7')]?_0x120a40['options'][_0x8c5a('0xa')]||null:null,'include':_0x120a40[_0x8c5a('0x7')]?_0x120a40['options'][_0x8c5a('0xb')]?_['map'](_0x120a40[_0x8c5a('0x7')][_0x8c5a('0xb')],function(_0x439530){return{'model':db[_0x439530[_0x8c5a('0xc')]],'as':_0x439530['as'],'attributes':_0x439530['as']===_0x8c5a('0x27')?_['keys'](_0x5b2464):_0x439530['attributes'],'include':_0x439530[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x439530[_0x8c5a('0xb')],function(_0x4e58cf){return{'model':db[_0x4e58cf[_0x8c5a('0xc')]],'as':_0x4e58cf['as'],'attributes':_0x4e58cf[_0x8c5a('0x9')],'include':_0x4e58cf[_0x8c5a('0xb')]?_[_0x8c5a('0xd')](_0x4e58cf['include'],function(_0x115981){return{'model':db[_0x115981[_0x8c5a('0xc')]],'as':_0x115981['as'],'attributes':_0x115981[_0x8c5a('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8c5a('0xe')](function(_0x471379){logger[_0x8c5a('0x1a')](_0x8c5a('0x5'),_0x120a40);logger['debug'](_0x8c5a('0x5'),_0x120a40,JSON[_0x8c5a('0x10')](_0x471379));_0x189d10(_0x471379);})[_0x8c5a('0x11')](function(_0x21968c){logger[_0x8c5a('0x12')](_0x8c5a('0x5'),_0x21968c[_0x8c5a('0x13')],_0x120a40);_0x5449f0(_0x2c3642['error'](0x1f4,_0x21968c[_0x8c5a('0x13')]));});});});};exports[_0x8c5a('0x3f')]=function(_0x1350b8){var _0x1f0c41=this;return new Promise(function(_0x245ad0,_0x5bb799){return db[_0x8c5a('0x26')]['findOne']({'raw':!![],'where':{'phone':_0x1350b8[_0x8c5a('0x7')][_0x8c5a('0x8')]['phone']},'attributes':['id',_0x8c5a('0x40')],'order':[['id',_0x8c5a('0x41')]]})[_0x8c5a('0xe')](function(_0x4f53ea){logger[_0x8c5a('0x1a')](_0x8c5a('0x42'),_0x1350b8);logger[_0x8c5a('0xf')](_0x8c5a('0x42'),_0x1350b8,JSON[_0x8c5a('0x10')](_0x4f53ea));_0x245ad0(_0x4f53ea);})[_0x8c5a('0x11')](function(_0x42b2c0){logger['error']('getContactByPhone',_0x42b2c0[_0x8c5a('0x13')],_0x1350b8);_0x5bb799(_0x1f0c41[_0x8c5a('0x12')](0x1f4,_0x42b2c0[_0x8c5a('0x13')]));});});};exports[_0x8c5a('0x43')]=function(_0x2f6172){var _0x1ffcb7=this;return new Promise(function(_0x5840ed,_0x1f8050){return db[_0x8c5a('0x22')]['transaction'](function(_0x2ceefc){var _0x4c0c88=_0x2f6172[_0x8c5a('0x7')]&&_0x2f6172[_0x8c5a('0x7')]['where']?_0x2f6172[_0x8c5a('0x7')][_0x8c5a('0x8')]:{};return db[_0x8c5a('0x15')][_0x8c5a('0x1c')](_0x2f6172['body'],{'where':_0x4c0c88,'transaction':_0x2ceefc})[_0x8c5a('0xe')](function(_0x259ee3){logger[_0x8c5a('0x1a')](_0x8c5a('0x43'),_0x2f6172);logger[_0x8c5a('0xf')](_0x8c5a('0x43'),_0x2f6172,JSON[_0x8c5a('0x10')](_0x259ee3));_0x5840ed(_0x259ee3);})[_0x8c5a('0x11')](function(_0x550075){logger[_0x8c5a('0x12')](_0x8c5a('0x43'),_0x550075[_0x8c5a('0x13')],_0x2f6172);_0x1f8050(_0x1ffcb7[_0x8c5a('0x12')](0x1f4,_0x550075[_0x8c5a('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3a11e3){var _0x47e54e=this;var _0x38fb5d=_0x3a11e3['body']['where'][_0x8c5a('0x44')];var _0x3493a4=_0x3a11e3['body'][_0x8c5a('0x8')][_0x8c5a('0x45')];var _0x5aeda1=_0x3a11e3[_0x8c5a('0x19')][_0x8c5a('0x8')][_0x8c5a('0x46')];return new Promise(function(_0x572560,_0x4dcb58){return db['CmHopper'][_0x8c5a('0x35')]({'where':{'voiceQueueId':{'$in':_0x38fb5d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8c5a('0x22')][_0x8c5a('0x47')](_0x8c5a('0x48')+_0x3493a4+'\x20MINUTE'),'$gt':db[_0x8c5a('0x22')][_0x8c5a('0x47')](_0x8c5a('0x49'))}},'UserId':{'$in':_0x5aeda1}},'include':[{'model':db[_0x8c5a('0x26')],'as':'Contact'},{'model':db[_0x8c5a('0x29')],'as':_0x8c5a('0x2a'),'attributes':['id',_0x8c5a('0x4a'),'voicePause']},{'model':db[_0x8c5a('0x4b')],'as':_0x8c5a('0x4c')}]})[_0x8c5a('0xe')](function(_0x81762b){if(_0x81762b[_0x8c5a('0x2c')]>0x0){return db[_0x8c5a('0x22')][_0x8c5a('0x23')](function(_0x2c3676){return db[_0x8c5a('0x15')][_0x8c5a('0x1c')]({'recallmeNotifiedDate':db[_0x8c5a('0x22')][_0x8c5a('0x47')](_0x8c5a('0x49'))},{'where':{'id':{'$in':_['map'](_0x81762b,'id')}},'transaction':_0x2c3676})['then'](function(){_0x572560(_0x81762b);})[_0x8c5a('0x11')](function(_0x30284b){logger[_0x8c5a('0x12')](_0x8c5a('0x4d'),_0x30284b[_0x8c5a('0x13')],_0x3a11e3);_0x4dcb58(_0x47e54e[_0x8c5a('0x12')](0x1f4,_0x30284b['message']));});})['catch'](function(_0x2b65d4){logger[_0x8c5a('0x12')](_0x8c5a('0x4d'),_0x2b65d4[_0x8c5a('0x13')],_0x3a11e3);_0x4dcb58(_0x47e54e[_0x8c5a('0x12')](0x1f4,_0x2b65d4[_0x8c5a('0x13')]));});}else{_0x572560(_0x81762b);}});});}; \ No newline at end of file +var _0x96ff=['then','CreateCmHopper','body','debug','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','keys','User','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','moment','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','raw','options','attributes','limit','include','model','map','info','stringify','catch','error','message','ShowCmHopper','find','where'];(function(_0x4b7fc0,_0x40ea7b){var _0x1a55c9=function(_0x3c97d9){while(--_0x3c97d9){_0x4b7fc0['push'](_0x4b7fc0['shift']());}};_0x1a55c9(++_0x40ea7b);}(_0x96ff,0xd8));var _0xf96f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x96ff[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf96f('0x0'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xf96f('0x1'))(_0xf96f('0x2'));exports[_0xf96f('0x3')]=function(_0x349a4e){var _0x1f7419=this;return new Promise(function(_0x1ba41d,_0x32e40d){return db[_0xf96f('0x4')][_0xf96f('0x5')]({'raw':_0x349a4e['options']?_0x349a4e['options'][_0xf96f('0x6')]===undefined?!![]:![]:!![],'where':_0x349a4e[_0xf96f('0x7')]?_0x349a4e[_0xf96f('0x7')]['where']||null:null,'attributes':_0x349a4e[_0xf96f('0x7')]?_0x349a4e[_0xf96f('0x7')][_0xf96f('0x8')]||null:null,'limit':_0x349a4e[_0xf96f('0x7')]?_0x349a4e[_0xf96f('0x7')][_0xf96f('0x9')]||null:null,'include':_0x349a4e[_0xf96f('0x7')]?_0x349a4e['options'][_0xf96f('0xa')]?_['map'](_0x349a4e[_0xf96f('0x7')][_0xf96f('0xa')],function(_0x12f5c5){return{'model':db[_0x12f5c5[_0xf96f('0xb')]],'as':_0x12f5c5['as'],'attributes':_0x12f5c5[_0xf96f('0x8')],'include':_0x12f5c5['include']?_[_0xf96f('0xc')](_0x12f5c5[_0xf96f('0xa')],function(_0x2d3199){return{'model':db[_0x2d3199['model']],'as':_0x2d3199['as'],'attributes':_0x2d3199['attributes'],'include':_0x2d3199[_0xf96f('0xa')]?_['map'](_0x2d3199[_0xf96f('0xa')],function(_0x1e3bea){return{'model':db[_0x1e3bea[_0xf96f('0xb')]],'as':_0x1e3bea['as'],'attributes':_0x1e3bea['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x236dd){logger[_0xf96f('0xd')]('GetCmHopper',_0x349a4e);logger['debug'](_0xf96f('0x3'),_0x349a4e,JSON[_0xf96f('0xe')](_0x236dd));_0x1ba41d(_0x236dd);})[_0xf96f('0xf')](function(_0x2ff45d){logger[_0xf96f('0x10')](_0xf96f('0x3'),_0x2ff45d[_0xf96f('0x11')],_0x349a4e);_0x32e40d(_0x1f7419['error'](0x1f4,_0x2ff45d[_0xf96f('0x11')]));});});};exports[_0xf96f('0x12')]=function(_0x3ec023){var _0x57b902=this;return new Promise(function(_0x1f54d8,_0x419402){return db[_0xf96f('0x4')][_0xf96f('0x13')]({'raw':_0x3ec023['options']?_0x3ec023[_0xf96f('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x3ec023[_0xf96f('0x7')]?_0x3ec023[_0xf96f('0x7')][_0xf96f('0x14')]||null:null,'attributes':_0x3ec023[_0xf96f('0x7')]?_0x3ec023[_0xf96f('0x7')]['attributes']||null:null,'include':_0x3ec023[_0xf96f('0x7')]?_0x3ec023[_0xf96f('0x7')]['include']?_[_0xf96f('0xc')](_0x3ec023[_0xf96f('0x7')][_0xf96f('0xa')],function(_0x1d1238){return{'model':db[_0x1d1238['model']],'as':_0x1d1238['as'],'attributes':_0x1d1238[_0xf96f('0x8')],'include':_0x1d1238[_0xf96f('0xa')]?_[_0xf96f('0xc')](_0x1d1238['include'],function(_0x3c1be4){return{'model':db[_0x3c1be4['model']],'as':_0x3c1be4['as'],'attributes':_0x3c1be4[_0xf96f('0x8')],'include':_0x3c1be4['include']?_['map'](_0x3c1be4[_0xf96f('0xa')],function(_0x66edc0){return{'model':db[_0x66edc0['model']],'as':_0x66edc0['as'],'attributes':_0x66edc0[_0xf96f('0x8')]};}):[]};}):[]};}):[]:[]})[_0xf96f('0x15')](function(_0x515405){logger[_0xf96f('0xd')](_0xf96f('0x12'),_0x3ec023);logger['debug'](_0xf96f('0x12'),_0x3ec023,JSON[_0xf96f('0xe')](_0x515405));_0x1f54d8(_0x515405);})[_0xf96f('0xf')](function(_0x42c516){logger['error']('ShowCmHopper',_0x42c516[_0xf96f('0x11')],_0x3ec023);_0x419402(_0x57b902[_0xf96f('0x10')](0x1f4,_0x42c516[_0xf96f('0x11')]));});});};exports[_0xf96f('0x16')]=function(_0x4605f4){var _0x385581=this;return new Promise(function(_0x48dbdb,_0x3f65b9){return db['CmHopper']['create'](_0x4605f4[_0xf96f('0x17')],{'raw':_0x4605f4[_0xf96f('0x7')]?_0x4605f4[_0xf96f('0x7')][_0xf96f('0x6')]===undefined?!![]:![]:!![]})['then'](function(_0x47d511){logger[_0xf96f('0xd')](_0xf96f('0x16'),_0x4605f4);logger[_0xf96f('0x18')](_0xf96f('0x16'),_0x4605f4,JSON[_0xf96f('0xe')](_0x47d511));_0x48dbdb(_0x47d511);})[_0xf96f('0xf')](function(_0x47de43){logger[_0xf96f('0x10')](_0xf96f('0x16'),_0x47de43[_0xf96f('0x11')],_0x4605f4);_0x3f65b9(_0x385581[_0xf96f('0x10')](0x1f4,_0x47de43[_0xf96f('0x11')]));});});};exports[_0xf96f('0x19')]=function(_0x5c2cb0){var _0x52537f=this;return new Promise(function(_0x2ad998,_0xa03022){return db[_0xf96f('0x4')][_0xf96f('0x1a')](_0x5c2cb0[_0xf96f('0x17')],{'raw':_0x5c2cb0[_0xf96f('0x7')]?_0x5c2cb0[_0xf96f('0x7')][_0xf96f('0x6')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2cb0[_0xf96f('0x7')]?_0x5c2cb0[_0xf96f('0x7')]['where']||null:null,'attributes':_0x5c2cb0[_0xf96f('0x7')]?_0x5c2cb0['options'][_0xf96f('0x8')]||null:null,'limit':_0x5c2cb0['options']?_0x5c2cb0['options'][_0xf96f('0x9')]||null:null})[_0xf96f('0x15')](function(_0x2c6a97){logger[_0xf96f('0xd')](_0xf96f('0x19'),_0x5c2cb0);logger[_0xf96f('0xd')](_0xf96f('0x1b'),JSON[_0xf96f('0xe')](_0x5c2cb0[_0xf96f('0x7')][_0xf96f('0x14')]),_0x5c2cb0[_0xf96f('0x17')][_0xf96f('0x1c')]);logger['debug'](_0xf96f('0x19'),_0x5c2cb0,JSON[_0xf96f('0xe')](_0x2c6a97));_0x2ad998(_0x2c6a97);})['catch'](function(_0x45648f){logger[_0xf96f('0x10')](_0xf96f('0x19'),_0x45648f[_0xf96f('0x11')],_0x5c2cb0);_0xa03022(_0x52537f[_0xf96f('0x10')](0x1f4,_0x45648f['message']));});});};exports[_0xf96f('0x1d')]=function(_0x420df5){var _0x8eea04=this;return new Promise(function(_0x4b5e23,_0x44f140){return db[_0xf96f('0x4')][_0xf96f('0x1e')]({'where':_0x420df5[_0xf96f('0x7')]?_0x420df5[_0xf96f('0x7')]['where']||null:null})[_0xf96f('0x15')](function(_0x44878e){logger[_0xf96f('0xd')](_0xf96f('0x1d'),_0x420df5);logger[_0xf96f('0x18')](_0xf96f('0x1d'),_0x420df5,JSON[_0xf96f('0xe')](_0x44878e));_0x4b5e23(_0x44878e);})[_0xf96f('0xf')](function(_0x4ae620){logger[_0xf96f('0x10')](_0xf96f('0x1d'),_0x4ae620[_0xf96f('0x11')],_0x420df5);_0x44f140(_0x8eea04[_0xf96f('0x10')](0x1f4,_0x4ae620[_0xf96f('0x11')]));});});};exports[_0xf96f('0x1f')]=function(_0x185568){var _0x2bc1ce=this;return new Promise(function(_0x262cf5,_0x3cca5a){return db[_0xf96f('0x20')][_0xf96f('0x21')]()[_0xf96f('0x15')](function(_0x1673a7){return db[_0xf96f('0x22')][_0xf96f('0x23')](function(_0x513765){return db['CmHopper']['findAll']({'where':_0x185568['options']?_0x185568['options']['where']||null:null,'attributes':_0x185568[_0xf96f('0x7')]?_0x185568[_0xf96f('0x7')]['attributes']||null:null,'limit':_0x185568[_0xf96f('0x7')]?_0x185568['options'][_0xf96f('0x9')]||null:null,'order':_0x185568['options']?_0x185568['options']['order']||null:null,'transaction':_0x513765,'lock':_0x513765[_0xf96f('0x24')][_0xf96f('0x25')],'include':[{'model':db[_0xf96f('0x20')],'as':'Contact','attributes':_[_0xf96f('0x26')](_0x1673a7)},{'model':db[_0xf96f('0x27')],'as':_0xf96f('0x28'),'attributes':['id',_0xf96f('0x29'),'voicePause']}]})[_0xf96f('0x15')](function(_0x78c4a9){var _0x58ca03=[];var _0x2d61c8=[];for(var _0x10aa69=0x0;_0x10aa69<_0x78c4a9[_0xf96f('0x2a')];_0x10aa69+=0x1){var _0x513c65=_0x78c4a9[_0x10aa69][_0xf96f('0x2b')];if(_0x513c65===null){_0x58ca03[_0xf96f('0x2c')](_0x78c4a9[_0x10aa69][_0xf96f('0x1a')](_0x185568[_0xf96f('0x17')],{'transaction':_0x513765}));}else if(!_0x2d61c8[_0xf96f('0x2d')](_0x513c65)){_0x2d61c8['push'](_0x513c65);_0x58ca03['push'](_0x78c4a9[_0x10aa69][_0xf96f('0x1a')](_0x185568[_0xf96f('0x17')],{'transaction':_0x513765}));}}return BPromise[_0xf96f('0x2e')](_0x58ca03);});})[_0xf96f('0x15')](function(_0x3d644e){logger[_0xf96f('0xd')](_0xf96f('0x1f'),_0x185568);if(_0x3d644e[_0xf96f('0x2a')]>0x0){logger['info'](_0xf96f('0x2f'),_0x3d644e[0x0][_0xf96f('0x30')]['id'],_0x3d644e[0x0][_0xf96f('0x30')][_0xf96f('0x31')],_0x3d644e[0x0][_0xf96f('0x30')]['active']);}logger[_0xf96f('0x18')](_0xf96f('0x1f'),_0x185568,JSON['stringify'](_0x3d644e));_0x262cf5(_0x3d644e);})['catch'](function(_0x10f8e0){logger['error'](_0xf96f('0x1f'),_0x10f8e0[_0xf96f('0x11')],_0x185568);_0x3cca5a(_0x2bc1ce[_0xf96f('0x10')](0x1f4,_0x10f8e0[_0xf96f('0x11')]));});});});};exports[_0xf96f('0x32')]=function(_0x11f832){var _0x452b37=this;return new Promise(function(_0x62fe32,_0x36772d){return db[_0xf96f('0x22')][_0xf96f('0x23')](function(_0x4bdec8){return db[_0xf96f('0x33')][_0xf96f('0x34')](_0x11f832[_0xf96f('0x17')],{'raw':_0x11f832[_0xf96f('0x7')]?_0x11f832[_0xf96f('0x7')][_0xf96f('0x6')]===undefined?!![]:![]:!![],'transaction':_0x4bdec8})['then'](function(){logger[_0xf96f('0xd')](_0xf96f('0x35'),JSON[_0xf96f('0xe')](_0x11f832['options'][_0xf96f('0x14')]),_0x11f832[_0xf96f('0x7')][_0xf96f('0x14')][_0xf96f('0x1c')]);return db['CmHopper']['destroy']({'where':_0x11f832[_0xf96f('0x7')]?_0x11f832[_0xf96f('0x7')][_0xf96f('0x14')]||null:null,'transaction':_0x4bdec8});});})[_0xf96f('0x15')](function(_0x4aab74){logger[_0xf96f('0xd')](_0xf96f('0x32'),_0x11f832);logger['debug'](_0xf96f('0x32'),_0x11f832,JSON['stringify'](_0x4aab74));_0x62fe32(_0x4aab74);})[_0xf96f('0xf')](function(_0x288052){logger[_0xf96f('0x10')](_0xf96f('0x32'),_0x288052[_0xf96f('0x11')],_0x11f832);_0x36772d(_0x452b37['error'](0x1f4,_0x288052[_0xf96f('0x11')]));});});};exports['CountReScheduled']=function(_0x1aaefb){var _0x584067=this;return new Promise(function(_0x3adc47,_0x3f11d9){return db[_0xf96f('0x4')][_0xf96f('0x5')]({'raw':_0x1aaefb[_0xf96f('0x7')]?_0x1aaefb[_0xf96f('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x1aaefb['options']?_0x1aaefb['options'][_0xf96f('0x14')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf96f('0x36'),db[_0xf96f('0x22')]['fn']('IF',db[_0xf96f('0x22')]['literal'](_0xf96f('0x37')+util[_0xf96f('0x38')](_0xf96f('0x39'),moment()[_0xf96f('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xf96f('0x3a')))),_0xf96f('0x3b')]]})[_0xf96f('0x15')](function(_0x14cebc){logger[_0xf96f('0xd')]('CountReScheduled',_0x1aaefb);logger[_0xf96f('0x18')](_0xf96f('0x3c'),_0x1aaefb,JSON[_0xf96f('0xe')](_0x14cebc));_0x3adc47(_0x14cebc);})[_0xf96f('0xf')](function(_0x41a99f){logger['error'](_0xf96f('0x3c'),_0x41a99f[_0xf96f('0x11')],_0x1aaefb);_0x3f11d9(_0x584067[_0xf96f('0x10')](0x1f4,_0x41a99f[_0xf96f('0x11')]));});});};exports[_0xf96f('0x3d')]=function(_0x126e7d){var _0x4a5101=this;return new Promise(function(_0x55db46,_0x1f6647){return db[_0xf96f('0x20')][_0xf96f('0x21')]()[_0xf96f('0x15')](function(){return db['sequelize'][_0xf96f('0x23')](function(_0x5eecbf){return db[_0xf96f('0x4')][_0xf96f('0x5')]({'where':_0x126e7d[_0xf96f('0x7')]?_0x126e7d[_0xf96f('0x7')][_0xf96f('0x14')]||null:null,'attributes':_0x126e7d[_0xf96f('0x7')]?_0x126e7d[_0xf96f('0x7')][_0xf96f('0x8')]||null:null,'limit':0x1,'order':_0x126e7d[_0xf96f('0x7')]?_0x126e7d[_0xf96f('0x7')][_0xf96f('0x3e')]||null:null,'group':db[_0xf96f('0x4')]['UserId'],'transaction':_0x5eecbf,'lock':_0x5eecbf[_0xf96f('0x24')][_0xf96f('0x25')],'include':_0x126e7d[_0xf96f('0x7')]?_0x126e7d[_0xf96f('0x7')][_0xf96f('0xa')]?_[_0xf96f('0xc')](_0x126e7d[_0xf96f('0x7')][_0xf96f('0xa')],function(_0x44ce4a){return{'model':db[_0x44ce4a[_0xf96f('0xb')]],'as':_0x44ce4a['as'],'attributes':_0x44ce4a[_0xf96f('0x8')],'include':_0x44ce4a[_0xf96f('0xa')]?_[_0xf96f('0xc')](_0x44ce4a['include'],function(_0x1ad3fd){return{'model':db[_0x1ad3fd['model']],'as':_0x1ad3fd['as'],'attributes':_0x1ad3fd[_0xf96f('0x8')],'include':_0x1ad3fd[_0xf96f('0xa')]?_[_0xf96f('0xc')](_0x1ad3fd[_0xf96f('0xa')],function(_0x51d8b9){return{'model':db[_0x51d8b9['model']],'as':_0x51d8b9['as'],'attributes':_0x51d8b9[_0xf96f('0x8')]};}):[]};}):[]};}):[]:[]})[_0xf96f('0x15')](function(_0x454a14){var _0x151338=[];for(var _0x2beac8=0x0;_0x2beac8<_0x454a14['length'];_0x2beac8+=0x1){_0x151338['push'](_0x454a14[_0x2beac8][_0xf96f('0x1a')](_0x126e7d[_0xf96f('0x17')],{'transaction':_0x5eecbf}));}return BPromise[_0xf96f('0x2e')](_0x151338);});})[_0xf96f('0x15')](function(_0xc0a658){logger['info']('GetContactRecallMe',_0x126e7d);logger[_0xf96f('0x18')](_0xf96f('0x3d'),_0x126e7d,JSON[_0xf96f('0xe')](_0xc0a658));_0x55db46(_0xc0a658);})['catch'](function(_0x12d186){logger[_0xf96f('0x10')]('GetContactRecallMe',_0x12d186[_0xf96f('0x11')],_0x126e7d);_0x1f6647(_0x4a5101['error'](0x1f4,_0x12d186[_0xf96f('0x11')]));});});});};exports[_0xf96f('0x3f')]=function(_0x16e9d7){var _0x10d4b8=this;return new Promise(function(_0x3dac06,_0x4b394d){db[_0xf96f('0x20')][_0xf96f('0x21')]()['then'](function(_0x5df53e){return db[_0xf96f('0x4')]['findAll']({'raw':_0x16e9d7[_0xf96f('0x7')]?_0x16e9d7[_0xf96f('0x7')][_0xf96f('0x6')]===undefined?!![]:![]:!![],'where':_0x16e9d7[_0xf96f('0x7')]?_0x16e9d7[_0xf96f('0x7')][_0xf96f('0x14')]||null:null,'attributes':_0x16e9d7['options']?_0x16e9d7[_0xf96f('0x7')][_0xf96f('0x8')]||null:null,'limit':_0x16e9d7[_0xf96f('0x7')]?_0x16e9d7[_0xf96f('0x7')][_0xf96f('0x9')]||null:null,'include':_0x16e9d7['options']?_0x16e9d7[_0xf96f('0x7')]['include']?_[_0xf96f('0xc')](_0x16e9d7[_0xf96f('0x7')]['include'],function(_0x887d09){return{'model':db[_0x887d09[_0xf96f('0xb')]],'as':_0x887d09['as'],'attributes':_0x887d09['as']===_0xf96f('0x40')?_['keys'](_0x5df53e):_0x887d09[_0xf96f('0x8')],'include':_0x887d09['include']?_[_0xf96f('0xc')](_0x887d09[_0xf96f('0xa')],function(_0x4de836){return{'model':db[_0x4de836[_0xf96f('0xb')]],'as':_0x4de836['as'],'attributes':_0x4de836['attributes'],'include':_0x4de836[_0xf96f('0xa')]?_['map'](_0x4de836['include'],function(_0x51c704){return{'model':db[_0x51c704[_0xf96f('0xb')]],'as':_0x51c704['as'],'attributes':_0x51c704[_0xf96f('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e6c79){logger[_0xf96f('0xd')](_0xf96f('0x3'),_0x16e9d7);logger[_0xf96f('0x18')](_0xf96f('0x3'),_0x16e9d7,JSON[_0xf96f('0xe')](_0x5e6c79));_0x3dac06(_0x5e6c79);})[_0xf96f('0xf')](function(_0x3afedf){logger[_0xf96f('0x10')](_0xf96f('0x3'),_0x3afedf[_0xf96f('0x11')],_0x16e9d7);_0x4b394d(_0x10d4b8[_0xf96f('0x10')](0x1f4,_0x3afedf[_0xf96f('0x11')]));});});});};exports[_0xf96f('0x41')]=function(_0x2ca3a6){var _0x25f5dd=this;return new Promise(function(_0x9a9561,_0x4f498f){return db['CmContact'][_0xf96f('0x42')]({'raw':!![],'where':{'phone':_0x2ca3a6[_0xf96f('0x7')]['where'][_0xf96f('0x43')]},'attributes':['id',_0xf96f('0x44')],'order':[['id','DESC']]})[_0xf96f('0x15')](function(_0x1c0364){logger[_0xf96f('0xd')]('getContactByPhone',_0x2ca3a6);logger[_0xf96f('0x18')](_0xf96f('0x45'),_0x2ca3a6,JSON['stringify'](_0x1c0364));_0x9a9561(_0x1c0364);})[_0xf96f('0xf')](function(_0x14b874){logger[_0xf96f('0x10')](_0xf96f('0x45'),_0x14b874['message'],_0x2ca3a6);_0x4f498f(_0x25f5dd[_0xf96f('0x10')](0x1f4,_0x14b874[_0xf96f('0x11')]));});});};exports[_0xf96f('0x46')]=function(_0x54325a){var _0xe67cc1=this;return new Promise(function(_0x18c83d,_0x5e3e56){return db[_0xf96f('0x22')][_0xf96f('0x23')](function(_0xfab98f){var _0x5afa69=_0x54325a['options']&&_0x54325a['options'][_0xf96f('0x14')]?_0x54325a['options']['where']:{};return db[_0xf96f('0x4')][_0xf96f('0x1a')](_0x54325a['body'],{'where':_0x5afa69,'transaction':_0xfab98f})[_0xf96f('0x15')](function(_0x3f1e30){logger[_0xf96f('0xd')](_0xf96f('0x46'),_0x54325a);logger[_0xf96f('0x18')](_0xf96f('0x46'),_0x54325a,JSON[_0xf96f('0xe')](_0x3f1e30));_0x18c83d(_0x3f1e30);})[_0xf96f('0xf')](function(_0x403ac1){logger['error'](_0xf96f('0x46'),_0x403ac1[_0xf96f('0x11')],_0x54325a);_0x5e3e56(_0xe67cc1[_0xf96f('0x10')](0x1f4,_0x403ac1[_0xf96f('0x11')]));});});});};exports[_0xf96f('0x47')]=function(_0x583d14){var _0x5ce602=this;var _0x405a3d=_0x583d14[_0xf96f('0x17')][_0xf96f('0x14')][_0xf96f('0x48')];var _0x1306ab=_0x583d14['body']['where']['interval'];var _0x15a4c9=_0x583d14[_0xf96f('0x17')][_0xf96f('0x14')][_0xf96f('0x49')];return new Promise(function(_0x5f4e8,_0xf4f866){return db['CmHopper'][_0xf96f('0x5')]({'where':{'voiceQueueId':{'$in':_0x405a3d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf96f('0x22')][_0xf96f('0x4a')](_0xf96f('0x4b')+_0x1306ab+'\x20MINUTE'),'$gt':db['sequelize'][_0xf96f('0x4a')](_0xf96f('0x4c'))}},'UserId':{'$in':_0x15a4c9}},'include':[{'model':db[_0xf96f('0x20')],'as':'Contact'},{'model':db[_0xf96f('0x27')],'as':_0xf96f('0x28'),'attributes':['id',_0xf96f('0x29'),'voicePause']},{'model':db[_0xf96f('0x4d')],'as':_0xf96f('0x4e')}]})[_0xf96f('0x15')](function(_0x3b44ac){if(_0x3b44ac[_0xf96f('0x2a')]>0x0){return db['sequelize']['transaction'](function(_0x102d26){return db[_0xf96f('0x4')][_0xf96f('0x1a')]({'recallmeNotifiedDate':db['sequelize'][_0xf96f('0x4a')](_0xf96f('0x4c'))},{'where':{'id':{'$in':_[_0xf96f('0xc')](_0x3b44ac,'id')}},'transaction':_0x102d26})[_0xf96f('0x15')](function(){_0x5f4e8(_0x3b44ac);})[_0xf96f('0xf')](function(_0x45d004){logger[_0xf96f('0x10')](_0xf96f('0x47'),_0x45d004[_0xf96f('0x11')],_0x583d14);_0xf4f866(_0x5ce602['error'](0x1f4,_0x45d004['message']));});})[_0xf96f('0xf')](function(_0x59e1e9){logger[_0xf96f('0x10')](_0xf96f('0x47'),_0x59e1e9[_0xf96f('0x11')],_0x583d14);_0xf4f866(_0x5ce602[_0xf96f('0x10')](0x1f4,_0x59e1e9[_0xf96f('0x11')]));});}else{_0x5f4e8(_0x3b44ac);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b2dd1a1..3628cb5 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 _0x8bd2=['isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id','update','delete','exports','express','Router','./cmHopper.controller','get'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8bd2,0x14c));var _0x28bd=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x8bd2[_0x631a3c];return _0x2bdfa3;};'use strict';var express=require(_0x28bd('0x0'));var router=express[_0x28bd('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x28bd('0x2'));router[_0x28bd('0x3')]('/',auth[_0x28bd('0x4')](),controller['index']);router[_0x28bd('0x3')](_0x28bd('0x5'),auth[_0x28bd('0x4')](),controller[_0x28bd('0x6')]);router['get'](_0x28bd('0x7'),auth['isAuthenticated'](),controller[_0x28bd('0x8')]);router[_0x28bd('0x3')](_0x28bd('0x9'),auth[_0x28bd('0x4')](),controller[_0x28bd('0xa')]);router['get']('/:id',auth[_0x28bd('0x4')](),controller[_0x28bd('0xb')]);router[_0x28bd('0x3')](_0x28bd('0xc'),auth['isAuthenticated'](),controller[_0x28bd('0xd')]);router[_0x28bd('0xe')]('/',auth[_0x28bd('0x4')](),controller[_0x28bd('0xf')]);router[_0x28bd('0xe')](_0x28bd('0x10'),auth['isAuthenticated'](),controller[_0x28bd('0x11')]);router[_0x28bd('0xe')](_0x28bd('0x12'),auth[_0x28bd('0x4')](),controller['getTimezone']);router[_0x28bd('0x13')](_0x28bd('0x14'),auth['isAuthenticated'](),controller[_0x28bd('0x15')]);router[_0x28bd('0x16')](_0x28bd('0x14'),auth[_0x28bd('0x4')](),controller['destroy']);module[_0x28bd('0x17')]=router; \ No newline at end of file +var _0x235e=['/timezones','show','/:id/previewrecall','post','create','/preview','/timezone','getTimezone','put','update','/:id','destroy','exports','express','Router','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x11ac64,_0x55cd47){var _0x15e739=function(_0x14d0ac){while(--_0x14d0ac){_0x11ac64['push'](_0x11ac64['shift']());}};_0x15e739(++_0x55cd47);}(_0x235e,0x7b));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xe235('0x0'));var router=express[_0xe235('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe235('0x2'));router[_0xe235('0x3')]('/',auth[_0xe235('0x4')](),controller[_0xe235('0x5')]);router[_0xe235('0x3')](_0xe235('0x6'),auth[_0xe235('0x4')](),controller['describe']);router[_0xe235('0x3')](_0xe235('0x7'),auth['isAuthenticated'](),controller[_0xe235('0x8')]);router[_0xe235('0x3')](_0xe235('0x9'),auth[_0xe235('0x4')](),controller['getTimezones']);router[_0xe235('0x3')]('/:id',auth['isAuthenticated'](),controller[_0xe235('0xa')]);router[_0xe235('0x3')](_0xe235('0xb'),auth[_0xe235('0x4')](),controller['getPreviewRecall']);router[_0xe235('0xc')]('/',auth[_0xe235('0x4')](),controller[_0xe235('0xd')]);router[_0xe235('0xc')](_0xe235('0xe'),auth['isAuthenticated'](),controller['getPreview']);router['post'](_0xe235('0xf'),auth[_0xe235('0x4')](),controller[_0xe235('0x10')]);router[_0xe235('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe235('0x12')]);router['delete'](_0xe235('0x13'),auth[_0xe235('0x4')](),controller[_0xe235('0x14')]);module[_0xe235('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index c570e57..d5dc7ff 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 _0xd90b=['sequelize','exports','INTEGER','STRING','DATE','format','moment'];(function(_0x3e6af8,_0x1038e5){var _0x353dac=function(_0xe187c7){while(--_0xe187c7){_0x3e6af8['push'](_0x3e6af8['shift']());}};_0x353dac(++_0x1038e5);}(_0xd90b,0xb5));var _0xbd90=function(_0x36cf32,_0x257bd1){_0x36cf32=_0x36cf32-0x0;var _0x155924=_0xd90b[_0x36cf32];return _0x155924;};'use strict';var moment=require(_0xbd90('0x0'));var Sequelize=require(_0xbd90('0x1'));module[_0xbd90('0x2')]={'CmHopperId':{'type':Sequelize[_0xbd90('0x3')]},'phone':{'type':Sequelize[_0xbd90('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xbd90('0x5')],'defaultValue':moment()[_0xbd90('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbd90('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1232=['sequelize','INTEGER','STRING','format','moment'];(function(_0x4179bf,_0x204c43){var _0x2b7cb8=function(_0x27c052){while(--_0x27c052){_0x4179bf['push'](_0x4179bf['shift']());}};_0x2b7cb8(++_0x204c43);}(_0x1232,0x117));var _0x2123=function(_0x27b40a,_0x56bbc0){_0x27b40a=_0x27b40a-0x0;var _0x258ec8=_0x1232[_0x27b40a];return _0x258ec8;};'use strict';var moment=require(_0x2123('0x0'));var Sequelize=require(_0x2123('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x2123('0x2')]},'phone':{'type':Sequelize[_0x2123('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x2123('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2123('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index f4002b4..b8f1ba9 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 _0x0613=['fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes'];(function(_0x5df25b,_0x1bc928){var _0x19f252=function(_0x41de28){while(--_0x41de28){_0x5df25b['push'](_0x5df25b['shift']());}};_0x19f252(++_0x1bc928);}(_0x0613,0x10b));var _0x3061=function(_0x495c47,_0x20e4e1){_0x495c47=_0x495c47-0x0;var _0x204106=_0x0613[_0x495c47];return _0x204106;};'use strict';var emlformat=require(_0x3061('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3061('0x1'));var rp=require(_0x3061('0x2'));var moment=require(_0x3061('0x3'));var BPromise=require(_0x3061('0x4'));var Mustache=require('mustache');var util=require(_0x3061('0x5'));var path=require(_0x3061('0x6'));var sox=require(_0x3061('0x7'));var csv=require(_0x3061('0x8'));var ejs=require(_0x3061('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3061('0xa'));var squel=require(_0x3061('0xb'));var crypto=require('crypto');var jsforce=require(_0x3061('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3061('0x8'));var querystring=require(_0x3061('0xd'));var Papa=require(_0x3061('0xe'));var Redis=require(_0x3061('0xf'));var authService=require(_0x3061('0x10'));var qs=require(_0x3061('0x11'));var as=require(_0x3061('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3061('0x13'))(_0x3061('0x14'));var utils=require(_0x3061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3061('0x16'))['db'];function respondWithStatusCode(_0x4e1893,_0xdaf625){_0xdaf625=_0xdaf625||0xcc;return function(_0x3d60f2){if(_0x3d60f2){return _0x4e1893[_0x3061('0x17')](_0xdaf625);}return _0x4e1893[_0x3061('0x18')](_0xdaf625)[_0x3061('0x19')]();};}function respondWithResult(_0x3a9bc4,_0x1ced40){_0x1ced40=_0x1ced40||0xc8;return function(_0x2499a7){if(_0x2499a7){return _0x3a9bc4['status'](_0x1ced40)[_0x3061('0x1a')](_0x2499a7);}};}function respondWithFilteredResult(_0x17ab34,_0x180d66){return function(_0xd2c6fd){if(_0xd2c6fd){var _0x17931e=typeof _0x180d66[_0x3061('0x1b')]===_0x3061('0x1c')&&typeof _0x180d66[_0x3061('0x1d')]==='undefined';var _0x1508fa=_0xd2c6fd[_0x3061('0x1e')];var _0x230f6f=_0x17931e?0x0:_0x180d66[_0x3061('0x1b')];var _0x303a71=_0x17931e?_0xd2c6fd['count']:_0x180d66['offset']+_0x180d66['limit'];var _0x1077a9;if(_0x303a71>=_0x1508fa){_0x303a71=_0x1508fa;_0x1077a9=0xc8;}else{_0x1077a9=0xce;}_0x17ab34[_0x3061('0x18')](_0x1077a9);return _0x17ab34['set'](_0x3061('0x1f'),_0x230f6f+'-'+_0x303a71+'/'+_0x1508fa)['json'](_0xd2c6fd);}return null;};}function patchUpdates(_0x5cdc48){return function(_0x4ca35b){try{jsonpatch[_0x3061('0x20')](_0x4ca35b,_0x5cdc48,!![]);}catch(_0x309b4e){return BPromise[_0x3061('0x21')](_0x309b4e);}return _0x4ca35b['save']();};}function saveUpdates(_0x134438,_0x1d578e){return function(_0x545fdf){if(_0x545fdf){return _0x545fdf[_0x3061('0x22')](_0x134438)['then'](function(_0x13e525){return _0x13e525;});}return null;};}function removeEntity(_0x558fe5,_0x475afe){return function(_0x338da7){if(_0x338da7){return _0x338da7['destroy']()[_0x3061('0x23')](function(){var _0x4a4ae6=_0x338da7[_0x3061('0x24')]({'plain':!![]});var _0x2be8df='CmHopperAdditionalPhones';return db[_0x3061('0x25')]['destroy']({'where':{'type':_0x2be8df,'resourceId':_0x4a4ae6['id']}})[_0x3061('0x23')](function(){return _0x338da7;});})[_0x3061('0x23')](function(){_0x558fe5[_0x3061('0x18')](0xcc)[_0x3061('0x19')]();});}};}function handleEntityNotFound(_0x155c40,_0x4fa523){return function(_0xc0931b){if(!_0xc0931b){_0x155c40[_0x3061('0x17')](0x194);}return _0xc0931b;};}function handleError(_0x49bcd7,_0x2d986b){_0x2d986b=_0x2d986b||0x1f4;return function(_0x5e9c53){logger[_0x3061('0x26')](_0x5e9c53[_0x3061('0x27')]);if(_0x5e9c53[_0x3061('0x28')]){delete _0x5e9c53[_0x3061('0x28')];}_0x49bcd7[_0x3061('0x18')](_0x2d986b)[_0x3061('0x29')](_0x5e9c53);};}exports[_0x3061('0x2a')]=function(_0x28bfc4,_0x5c2a13){var _0x54b1e2={},_0x35d858={},_0x1ca495={'count':0x0,'rows':[]};var _0xe3d7b8=_['map'](db[_0x3061('0x2b')][_0x3061('0x2c')],function(_0x18f9a9){return{'name':_0x18f9a9[_0x3061('0x2d')],'type':_0x18f9a9[_0x3061('0x2e')]['key']};});_0x35d858[_0x3061('0x2f')]=_[_0x3061('0x30')](_0xe3d7b8,'name');_0x35d858[_0x3061('0x31')]=_['keys'](_0x28bfc4['query']);_0x35d858[_0x3061('0x32')]=_[_0x3061('0x33')](_0x35d858[_0x3061('0x2f')],_0x35d858['query']);_0x54b1e2[_0x3061('0x34')]=_[_0x3061('0x33')](_0x35d858[_0x3061('0x2f')],qs[_0x3061('0x35')](_0x28bfc4[_0x3061('0x31')][_0x3061('0x35')]));_0x54b1e2[_0x3061('0x34')]=_0x54b1e2['attributes'][_0x3061('0x36')]?_0x54b1e2[_0x3061('0x34')]:_0x35d858[_0x3061('0x2f')];if(!_0x28bfc4['query'][_0x3061('0x37')]('nolimit')){_0x54b1e2[_0x3061('0x1d')]=qs[_0x3061('0x1d')](_0x28bfc4[_0x3061('0x31')][_0x3061('0x1d')]);_0x54b1e2[_0x3061('0x1b')]=qs[_0x3061('0x1b')](_0x28bfc4[_0x3061('0x31')][_0x3061('0x1b')]);}_0x54b1e2[_0x3061('0x38')]=qs[_0x3061('0x39')](_0x28bfc4[_0x3061('0x31')][_0x3061('0x39')]);_0x54b1e2['where']=qs[_0x3061('0x32')](_['pick'](_0x28bfc4[_0x3061('0x31')],_0x35d858['filters']),_0xe3d7b8);if(_0x28bfc4[_0x3061('0x31')][_0x3061('0x3a')]){_0x54b1e2['where']=_['merge'](_0x54b1e2[_0x3061('0x3b')],{'$or':_[_0x3061('0x30')](_0xe3d7b8,function(_0x1503db){if(_0x1503db[_0x3061('0x2e')]!=='VIRTUAL'){var _0x134dd4={};_0x134dd4[_0x1503db[_0x3061('0x28')]]={'$like':'%'+_0x28bfc4[_0x3061('0x31')]['filter']+'%'};return _0x134dd4;}})});}_0x54b1e2=_['merge']({},_0x54b1e2,_0x28bfc4[_0x3061('0x3c')]);var _0x5ea145={'where':_0x54b1e2[_0x3061('0x3b')]};return db['CmHopperAdditionalPhone'][_0x3061('0x1e')](_0x5ea145)['then'](function(_0xad04db){_0x1ca495[_0x3061('0x1e')]=_0xad04db;if(_0x28bfc4[_0x3061('0x31')][_0x3061('0x3d')]){_0x54b1e2['include']=[{'all':!![]}];}return db[_0x3061('0x2b')][_0x3061('0x3e')](_0x54b1e2);})[_0x3061('0x23')](function(_0x5994f2){_0x1ca495[_0x3061('0x3f')]=_0x5994f2;return _0x1ca495;})[_0x3061('0x23')](respondWithFilteredResult(_0x5c2a13,_0x54b1e2))[_0x3061('0x40')](handleError(_0x5c2a13,null));};exports[_0x3061('0x41')]=function(_0x41dff4,_0x486945){var _0x523f28={'raw':!![],'where':{'id':_0x41dff4[_0x3061('0x42')]['id']}},_0x346a2f={};_0x346a2f[_0x3061('0x2f')]=_[_0x3061('0x43')](db['CmHopperAdditionalPhone'][_0x3061('0x2c')]);_0x346a2f[_0x3061('0x31')]=_[_0x3061('0x43')](_0x41dff4['query']);_0x346a2f[_0x3061('0x32')]=_[_0x3061('0x33')](_0x346a2f['model'],_0x346a2f['query']);_0x523f28[_0x3061('0x34')]=_[_0x3061('0x33')](_0x346a2f['model'],qs['fields'](_0x41dff4[_0x3061('0x31')][_0x3061('0x35')]));_0x523f28['attributes']=_0x523f28[_0x3061('0x34')][_0x3061('0x36')]?_0x523f28[_0x3061('0x34')]:_0x346a2f[_0x3061('0x2f')];if(_0x41dff4[_0x3061('0x31')]['includeAll']){_0x523f28[_0x3061('0x44')]=[{'all':!![]}];}_0x523f28=_['merge']({},_0x523f28,_0x41dff4[_0x3061('0x3c')]);return db[_0x3061('0x2b')]['find'](_0x523f28)[_0x3061('0x23')](handleEntityNotFound(_0x486945,null))[_0x3061('0x23')](respondWithResult(_0x486945,null))[_0x3061('0x40')](handleError(_0x486945,null));};exports['create']=function(_0x210898,_0x30d458){return db['CmHopperAdditionalPhone'][_0x3061('0x45')](_0x210898[_0x3061('0x46')],{})[_0x3061('0x23')](function(_0x3fa84c){var _0x2c279b=_0x210898[_0x3061('0x47')][_0x3061('0x24')]({'plain':!![]});if(!_0x2c279b)throw new Error(_0x3061('0x48'));if(_0x2c279b['role']===_0x3061('0x47')){var _0x4e8d67=_0x3fa84c[_0x3061('0x24')]({'plain':!![]});var _0x42d37d=_0x3061('0x49');return db['UserProfileSection'][_0x3061('0x4a')]({'where':{'name':_0x42d37d,'userProfileId':_0x2c279b[_0x3061('0x4b')]},'raw':!![]})['then'](function(_0x37094f){if(_0x37094f&&_0x37094f[_0x3061('0x4c')]===0x0){return db[_0x3061('0x25')][_0x3061('0x45')]({'name':_0x4e8d67[_0x3061('0x28')],'resourceId':_0x4e8d67['id'],'type':_0x37094f[_0x3061('0x28')],'sectionId':_0x37094f['id']},{})['then'](function(){return _0x3fa84c;});}else{return _0x3fa84c;}})[_0x3061('0x40')](function(_0xba2cea){logger[_0x3061('0x26')](_0x3061('0x4d'),_0xba2cea);throw _0xba2cea;});}return _0x3fa84c;})[_0x3061('0x23')](respondWithResult(_0x30d458,0xc9))[_0x3061('0x40')](handleError(_0x30d458,null));};exports[_0x3061('0x22')]=function(_0x450e5b,_0xa3a9ba){if(_0x450e5b['body']['id']){delete _0x450e5b[_0x3061('0x46')]['id'];}return db[_0x3061('0x2b')][_0x3061('0x4a')]({'where':{'id':_0x450e5b['params']['id']}})[_0x3061('0x23')](handleEntityNotFound(_0xa3a9ba,null))[_0x3061('0x23')](saveUpdates(_0x450e5b[_0x3061('0x46')],null))[_0x3061('0x23')](respondWithResult(_0xa3a9ba,null))[_0x3061('0x40')](handleError(_0xa3a9ba,null));};exports['destroy']=function(_0x38e77c,_0x5ecf35){return db['CmHopperAdditionalPhone'][_0x3061('0x4a')]({'where':{'id':_0x38e77c[_0x3061('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ecf35,null))[_0x3061('0x23')](removeEntity(_0x5ecf35,null))[_0x3061('0x40')](handleError(_0x5ecf35,null));}; \ No newline at end of file +var _0xc354=['rows','catch','show','params','length','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','end','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include'];(function(_0x1d7cc3,_0x5dfffe){var _0x4468ae=function(_0x4c765f){while(--_0x4c765f){_0x1d7cc3['push'](_0x1d7cc3['shift']());}};_0x4468ae(++_0x5dfffe);}(_0xc354,0x1b1));var _0x4c35=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc354[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4c35('0x0'));var rimraf=require(_0x4c35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c35('0x2'));var rp=require(_0x4c35('0x3'));var moment=require(_0x4c35('0x4'));var BPromise=require(_0x4c35('0x5'));var Mustache=require(_0x4c35('0x6'));var util=require(_0x4c35('0x7'));var path=require(_0x4c35('0x8'));var sox=require('sox');var csv=require(_0x4c35('0x9'));var ejs=require(_0x4c35('0xa'));var fs=require('fs');var fs_extra=require(_0x4c35('0xb'));var _=require(_0x4c35('0xc'));var squel=require(_0x4c35('0xd'));var crypto=require(_0x4c35('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c35('0x9'));var querystring=require('querystring');var Papa=require(_0x4c35('0xf'));var Redis=require('ioredis');var authService=require(_0x4c35('0x10'));var qs=require(_0x4c35('0x11'));var as=require(_0x4c35('0x12'));var hardwareService=require(_0x4c35('0x13'));var logger=require(_0x4c35('0x14'))('api');var utils=require(_0x4c35('0x15'));var config=require(_0x4c35('0x16'));var licenseUtil=require(_0x4c35('0x17'));var db=require(_0x4c35('0x18'))['db'];function respondWithStatusCode(_0x2e7632,_0x51700d){_0x51700d=_0x51700d||0xcc;return function(_0x46a7b5){if(_0x46a7b5){return _0x2e7632[_0x4c35('0x19')](_0x51700d);}return _0x2e7632[_0x4c35('0x1a')](_0x51700d)['end']();};}function respondWithResult(_0x34604f,_0x52e7bc){_0x52e7bc=_0x52e7bc||0xc8;return function(_0x852328){if(_0x852328){return _0x34604f['status'](_0x52e7bc)[_0x4c35('0x1b')](_0x852328);}};}function respondWithFilteredResult(_0x126d37,_0x5f5b00){return function(_0x438914){if(_0x438914){var _0x58138c=typeof _0x5f5b00[_0x4c35('0x1c')]===_0x4c35('0x1d')&&typeof _0x5f5b00[_0x4c35('0x1e')]===_0x4c35('0x1d');var _0x5a01c8=_0x438914[_0x4c35('0x1f')];var _0x4e9362=_0x58138c?0x0:_0x5f5b00[_0x4c35('0x1c')];var _0x4baf92=_0x58138c?_0x438914[_0x4c35('0x1f')]:_0x5f5b00[_0x4c35('0x1c')]+_0x5f5b00['limit'];var _0x43d6a9;if(_0x4baf92>=_0x5a01c8){_0x4baf92=_0x5a01c8;_0x43d6a9=0xc8;}else{_0x43d6a9=0xce;}_0x126d37[_0x4c35('0x1a')](_0x43d6a9);return _0x126d37[_0x4c35('0x20')](_0x4c35('0x21'),_0x4e9362+'-'+_0x4baf92+'/'+_0x5a01c8)['json'](_0x438914);}return null;};}function patchUpdates(_0x3e213c){return function(_0x36fdb9){try{jsonpatch[_0x4c35('0x22')](_0x36fdb9,_0x3e213c,!![]);}catch(_0x5eb6ee){return BPromise[_0x4c35('0x23')](_0x5eb6ee);}return _0x36fdb9[_0x4c35('0x24')]();};}function saveUpdates(_0x52cfa4,_0x3c18a1){return function(_0x4e45a0){if(_0x4e45a0){return _0x4e45a0[_0x4c35('0x25')](_0x52cfa4)[_0x4c35('0x26')](function(_0x14f6fe){return _0x14f6fe;});}return null;};}function removeEntity(_0x43e32c,_0x127c64){return function(_0x42fbd0){if(_0x42fbd0){return _0x42fbd0['destroy']()['then'](function(){var _0x589cc4=_0x42fbd0[_0x4c35('0x27')]({'plain':!![]});var _0x504f97=_0x4c35('0x28');return db[_0x4c35('0x29')][_0x4c35('0x2a')]({'where':{'type':_0x504f97,'resourceId':_0x589cc4['id']}})[_0x4c35('0x26')](function(){return _0x42fbd0;});})['then'](function(){_0x43e32c[_0x4c35('0x1a')](0xcc)[_0x4c35('0x2b')]();});}};}function handleEntityNotFound(_0x10bfff,_0x1818e5){return function(_0x5c3efc){if(!_0x5c3efc){_0x10bfff['sendStatus'](0x194);}return _0x5c3efc;};}function handleError(_0x5781c6,_0x2bf8f3){_0x2bf8f3=_0x2bf8f3||0x1f4;return function(_0x2e26ce){logger[_0x4c35('0x2c')](_0x2e26ce[_0x4c35('0x2d')]);if(_0x2e26ce[_0x4c35('0x2e')]){delete _0x2e26ce[_0x4c35('0x2e')];}_0x5781c6[_0x4c35('0x1a')](_0x2bf8f3)[_0x4c35('0x2f')](_0x2e26ce);};}exports[_0x4c35('0x30')]=function(_0x8ae79b,_0x5111e3){var _0xb1cc90={},_0x960265={},_0x414f4c={'count':0x0,'rows':[]};var _0x281b62=_[_0x4c35('0x31')](db[_0x4c35('0x32')][_0x4c35('0x33')],function(_0x3e7515){return{'name':_0x3e7515[_0x4c35('0x34')],'type':_0x3e7515[_0x4c35('0x35')][_0x4c35('0x36')]};});_0x960265[_0x4c35('0x37')]=_['map'](_0x281b62,_0x4c35('0x2e'));_0x960265[_0x4c35('0x38')]=_[_0x4c35('0x39')](_0x8ae79b['query']);_0x960265[_0x4c35('0x3a')]=_['intersection'](_0x960265[_0x4c35('0x37')],_0x960265['query']);_0xb1cc90['attributes']=_[_0x4c35('0x3b')](_0x960265['model'],qs['fields'](_0x8ae79b[_0x4c35('0x38')][_0x4c35('0x3c')]));_0xb1cc90['attributes']=_0xb1cc90[_0x4c35('0x3d')]['length']?_0xb1cc90[_0x4c35('0x3d')]:_0x960265[_0x4c35('0x37')];if(!_0x8ae79b[_0x4c35('0x38')][_0x4c35('0x3e')]('nolimit')){_0xb1cc90[_0x4c35('0x1e')]=qs['limit'](_0x8ae79b[_0x4c35('0x38')][_0x4c35('0x1e')]);_0xb1cc90[_0x4c35('0x1c')]=qs['offset'](_0x8ae79b[_0x4c35('0x38')][_0x4c35('0x1c')]);}_0xb1cc90[_0x4c35('0x3f')]=qs['sort'](_0x8ae79b['query'][_0x4c35('0x40')]);_0xb1cc90['where']=qs[_0x4c35('0x3a')](_[_0x4c35('0x41')](_0x8ae79b[_0x4c35('0x38')],_0x960265['filters']),_0x281b62);if(_0x8ae79b[_0x4c35('0x38')]['filter']){_0xb1cc90[_0x4c35('0x42')]=_[_0x4c35('0x43')](_0xb1cc90[_0x4c35('0x42')],{'$or':_['map'](_0x281b62,function(_0x25e05e){if(_0x25e05e[_0x4c35('0x35')]!=='VIRTUAL'){var _0x20e881={};_0x20e881[_0x25e05e[_0x4c35('0x2e')]]={'$like':'%'+_0x8ae79b[_0x4c35('0x38')]['filter']+'%'};return _0x20e881;}})});}_0xb1cc90=_[_0x4c35('0x43')]({},_0xb1cc90,_0x8ae79b[_0x4c35('0x44')]);var _0x2c464f={'where':_0xb1cc90['where']};return db['CmHopperAdditionalPhone']['count'](_0x2c464f)[_0x4c35('0x26')](function(_0x16a6a9){_0x414f4c['count']=_0x16a6a9;if(_0x8ae79b[_0x4c35('0x38')][_0x4c35('0x45')]){_0xb1cc90[_0x4c35('0x46')]=[{'all':!![]}];}return db[_0x4c35('0x32')]['findAll'](_0xb1cc90);})[_0x4c35('0x26')](function(_0x54ac7f){_0x414f4c[_0x4c35('0x47')]=_0x54ac7f;return _0x414f4c;})[_0x4c35('0x26')](respondWithFilteredResult(_0x5111e3,_0xb1cc90))[_0x4c35('0x48')](handleError(_0x5111e3,null));};exports[_0x4c35('0x49')]=function(_0x51affc,_0x4eced0){var _0x395711={'raw':!![],'where':{'id':_0x51affc[_0x4c35('0x4a')]['id']}},_0x2aa1b1={};_0x2aa1b1[_0x4c35('0x37')]=_[_0x4c35('0x39')](db[_0x4c35('0x32')]['rawAttributes']);_0x2aa1b1['query']=_[_0x4c35('0x39')](_0x51affc[_0x4c35('0x38')]);_0x2aa1b1['filters']=_[_0x4c35('0x3b')](_0x2aa1b1[_0x4c35('0x37')],_0x2aa1b1[_0x4c35('0x38')]);_0x395711['attributes']=_[_0x4c35('0x3b')](_0x2aa1b1['model'],qs[_0x4c35('0x3c')](_0x51affc[_0x4c35('0x38')]['fields']));_0x395711[_0x4c35('0x3d')]=_0x395711['attributes'][_0x4c35('0x4b')]?_0x395711['attributes']:_0x2aa1b1[_0x4c35('0x37')];if(_0x51affc['query'][_0x4c35('0x45')]){_0x395711[_0x4c35('0x46')]=[{'all':!![]}];}_0x395711=_[_0x4c35('0x43')]({},_0x395711,_0x51affc[_0x4c35('0x44')]);return db[_0x4c35('0x32')][_0x4c35('0x4c')](_0x395711)['then'](handleEntityNotFound(_0x4eced0,null))[_0x4c35('0x26')](respondWithResult(_0x4eced0,null))[_0x4c35('0x48')](handleError(_0x4eced0,null));};exports[_0x4c35('0x4d')]=function(_0x297645,_0x252ec1){return db[_0x4c35('0x32')]['create'](_0x297645[_0x4c35('0x4e')],{})[_0x4c35('0x26')](function(_0x3aa000){var _0x1b776d=_0x297645[_0x4c35('0x4f')][_0x4c35('0x27')]({'plain':!![]});if(!_0x1b776d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b776d['role']===_0x4c35('0x4f')){var _0x504d93=_0x3aa000['get']({'plain':!![]});var _0x446d29=_0x4c35('0x28');return db[_0x4c35('0x50')][_0x4c35('0x4c')]({'where':{'name':_0x446d29,'userProfileId':_0x1b776d[_0x4c35('0x51')]},'raw':!![]})['then'](function(_0x5e14bb){if(_0x5e14bb&&_0x5e14bb[_0x4c35('0x52')]===0x0){return db[_0x4c35('0x29')][_0x4c35('0x4d')]({'name':_0x504d93[_0x4c35('0x2e')],'resourceId':_0x504d93['id'],'type':_0x5e14bb['name'],'sectionId':_0x5e14bb['id']},{})[_0x4c35('0x26')](function(){return _0x3aa000;});}else{return _0x3aa000;}})['catch'](function(_0x3a3c43){logger['error'](_0x4c35('0x53'),_0x3a3c43);throw _0x3a3c43;});}return _0x3aa000;})[_0x4c35('0x26')](respondWithResult(_0x252ec1,0xc9))[_0x4c35('0x48')](handleError(_0x252ec1,null));};exports[_0x4c35('0x25')]=function(_0x9cdce4,_0x5bedc5){if(_0x9cdce4[_0x4c35('0x4e')]['id']){delete _0x9cdce4[_0x4c35('0x4e')]['id'];}return db[_0x4c35('0x32')][_0x4c35('0x4c')]({'where':{'id':_0x9cdce4[_0x4c35('0x4a')]['id']}})[_0x4c35('0x26')](handleEntityNotFound(_0x5bedc5,null))[_0x4c35('0x26')](saveUpdates(_0x9cdce4[_0x4c35('0x4e')],null))[_0x4c35('0x26')](respondWithResult(_0x5bedc5,null))['catch'](handleError(_0x5bedc5,null));};exports['destroy']=function(_0x1081b4,_0x30390e){return db[_0x4c35('0x32')][_0x4c35('0x4c')]({'where':{'id':_0x1081b4[_0x4c35('0x4a')]['id']}})[_0x4c35('0x26')](handleEntityNotFound(_0x30390e,null))['then'](removeEntity(_0x30390e,null))[_0x4c35('0x48')](handleError(_0x30390e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 68eacb5..8355414 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 _0xe795=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xe795,0x1bc));var _0x5e79=function(_0x600f59,_0x5b8a03){_0x600f59=_0x600f59-0x0;var _0x312fd6=_0xe795[_0x600f59];return _0x312fd6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e79('0x0'))(_0x5e79('0x1'));var moment=require(_0x5e79('0x2'));var BPromise=require(_0x5e79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e79('0x4'));var rimraf=require(_0x5e79('0x5'));var config=require(_0x5e79('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x5e79('0x7')]=function(_0x5e61f4,_0x2f8b7a){return _0x5e61f4[_0x5e79('0x8')](_0x5e79('0x9'),attributes,{'tableName':_0x5e79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdee=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash'];(function(_0x3c4a81,_0xa850cd){var _0x1ef464=function(_0x57781e){while(--_0x57781e){_0x3c4a81['push'](_0x3c4a81['shift']());}};_0x1ef464(++_0xa850cd);}(_0xfdee,0xf6));var _0xefde=function(_0x2f421,_0x5144c4){_0x2f421=_0x2f421-0x0;var _0x27b4af=_0xfdee[_0x2f421];return _0x27b4af;};'use strict';var _=require(_0xefde('0x0'));var util=require(_0xefde('0x1'));var logger=require(_0xefde('0x2'))(_0xefde('0x3'));var moment=require(_0xefde('0x4'));var BPromise=require(_0xefde('0x5'));var rp=require(_0xefde('0x6'));var fs=require('fs');var path=require(_0xefde('0x7'));var rimraf=require(_0xefde('0x8'));var config=require(_0xefde('0x9'));var attributes=require(_0xefde('0xa'));module[_0xefde('0xb')]=function(_0x10326c,_0x3c514f){return _0x10326c['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xefde('0xc'),'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 2049234..25455ba 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 _0xfc6c=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','SwapAdditionalPhones','CmHopper','VoiceQueueId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x183146,_0x53d702){var _0x2324c8=function(_0x3ad46b){while(--_0x3ad46b){_0x183146['push'](_0x183146['shift']());}};_0x2324c8(++_0x53d702);}(_0xfc6c,0x1e2));var _0xcfc6=function(_0x48045e,_0x3cffc4){_0x48045e=_0x48045e-0x0;var _0x37b53e=_0xfc6c[_0x48045e];return _0x37b53e;};'use strict';var _=require(_0xcfc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcfc6('0x1'));var rs=require(_0xcfc6('0x2'));var fs=require('fs');var Redis=require(_0xcfc6('0x3'));var db=require(_0xcfc6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfc6('0x5'))('rpc');var config=require(_0xcfc6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcfc6('0x7')][_0xcfc6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ea774,_0x3f5f82,_0x5072f7){return new BPromise(function(_0x5618ad,_0x2223e7){return client[_0xcfc6('0x9')](_0x1ea774,_0x5072f7)[_0xcfc6('0xa')](function(_0xee1e2){logger['info'](_0xcfc6('0xb'),_0x3f5f82,'request\x20sent');logger[_0xcfc6('0xc')](_0xcfc6('0xd'),_0x3f5f82,_0xcfc6('0xe'),JSON['stringify'](_0xee1e2));if(_0xee1e2[_0xcfc6('0xf')]){if(_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x10')]===0x1f4){logger[_0xcfc6('0xf')](_0xcfc6('0xb'),_0x3f5f82,_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x11')]);return _0x2223e7(_0xee1e2['error'][_0xcfc6('0x11')]);}logger[_0xcfc6('0xf')](_0xcfc6('0xb'),_0x3f5f82,_0xee1e2[_0xcfc6('0xf')][_0xcfc6('0x11')]);return _0x5618ad(_0xee1e2['error'][_0xcfc6('0x11')]);}else{logger['info'](_0xcfc6('0xb'),_0x3f5f82,_0xcfc6('0xe'));_0x5618ad(_0xee1e2[_0xcfc6('0x12')][_0xcfc6('0x11')]);}})[_0xcfc6('0x13')](function(_0x5e7269){logger['error'](_0xcfc6('0xb'),_0x3f5f82,_0x5e7269);_0x2223e7(_0x5e7269);});});}exports[_0xcfc6('0x14')]=function(_0x36b98f){var _0x51bc52=this;return new Promise(function(_0x47f139,_0x49db5f){return db['CmHopper'][_0xcfc6('0x15')]({'raw':!![],'where':{'ContactId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x17')],'ListId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x18')],'VoiceQueueId':_0x36b98f[_0xcfc6('0x16')]['VoiceQueueId']===undefined?null:_0x36b98f[_0xcfc6('0x16')]['VoiceQueueId'],'CampaignId':_0x36b98f[_0xcfc6('0x16')][_0xcfc6('0x19')]===undefined?null:_0x36b98f['body'][_0xcfc6('0x19')]}})[_0xcfc6('0xa')](function(_0x2d3618){if(_0x2d3618!=null){return db['CmHopperAdditionalPhone'][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2d3618['id'],'OrderBy':{'$gt':_0x2d3618[_0xcfc6('0x1a')]}},'order':[['OrderBy',_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x49db51){var _0x3f1e07=0x0;if(_0x49db51){if(_0x49db51[_0xcfc6('0x1c')]+_0x49db51[_0xcfc6('0x1d')]+_0x49db51[_0xcfc6('0x1e')]+_0x49db51[_0xcfc6('0x1f')]+_0x49db51[_0xcfc6('0x20')]+_0x49db51[_0xcfc6('0x21')]+_0x49db51[_0xcfc6('0x22')]+_0x49db51[_0xcfc6('0x23')]<_0x36b98f[_0xcfc6('0x24')][_0xcfc6('0x25')])_0x3f1e07=0x1;_0x47f139({'additional':_0x3f1e07});}else{return db[_0xcfc6('0x26')][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2d3618['id']},'order':[[_0xcfc6('0x1a'),_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x31aef9){var _0x85b39e=0x0;if(_0x31aef9){if(_0x31aef9[_0xcfc6('0x1c')]+_0x31aef9[_0xcfc6('0x1d')]+_0x31aef9[_0xcfc6('0x1e')]+_0x31aef9[_0xcfc6('0x1f')]+_0x31aef9[_0xcfc6('0x20')]+_0x31aef9[_0xcfc6('0x21')]+_0x31aef9['countmachineretry']+_0x31aef9['countagentrejectretry']<_0x36b98f['entity'][_0xcfc6('0x25')])_0x85b39e=0x1;_0x47f139({'additional':_0x85b39e});}else{_0x47f139({'additional':0x0});}})[_0xcfc6('0x13')](function(_0x4da42a){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0x4da42a[_0xcfc6('0x11')]);_0x49db5f(_0x51bc52[_0xcfc6('0xf')](0x1f4,_0x4da42a[_0xcfc6('0x11')]));});}})[_0xcfc6('0x13')](function(_0x2fd073){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0x2fd073[_0xcfc6('0x11')]);_0x49db5f(_0x51bc52['error'](0x1f4,_0x2fd073[_0xcfc6('0x11')]));});}else _0x47f139({'additional':0x0});});});};exports[_0xcfc6('0x27')]=function(_0x300c4e){var _0x16bbb9=this;return new Promise(function(_0x9ef86d,_0x196674){return db[_0xcfc6('0x28')][_0xcfc6('0x15')]({'raw':!![],'where':{'ContactId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x17')],'ListId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x18')],'VoiceQueueId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x29')]===undefined?null:_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x29')],'CampaignId':_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x19')]===undefined?null:_0x300c4e[_0xcfc6('0x16')][_0xcfc6('0x19')]}})['then'](function(_0x2c2d25){if(_0x2c2d25!=null){return db['CmHopperAdditionalPhone'][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2c2d25['id'],'OrderBy':{'$gte':_0x2c2d25[_0xcfc6('0x1a')]}},'order':[['OrderBy',_0xcfc6('0x1b')]]})[_0xcfc6('0xa')](function(_0x266545){if(_0x266545)return activateAdditionalPhone(_0x2c2d25,_0x300c4e['body'],_0x266545,_0x300c4e[_0xcfc6('0x2a')],_0x300c4e[_0xcfc6('0x2b')])[_0xcfc6('0xa')](function(_0x5ecfcd){_0x9ef86d(_0x5ecfcd);});else{return db[_0xcfc6('0x26')][_0xcfc6('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2c2d25['id']},'order':[['OrderBy',_0xcfc6('0x1b')]]})['then'](function(_0xf710ff){if(_0xf710ff)return activateAdditionalPhone(_0x2c2d25,_0x300c4e[_0xcfc6('0x16')],_0xf710ff,_0x300c4e[_0xcfc6('0x2a')],_0x300c4e['waitTime'])[_0xcfc6('0xa')](function(_0x27f3f1){_0x9ef86d(_0x27f3f1);});else{_0x9ef86d({'id':_0x2c2d25['id'],'phone':''});}})[_0xcfc6('0x13')](function(_0xe00a85){logger[_0xcfc6('0xf')](_0xcfc6('0x14'),_0xe00a85[_0xcfc6('0x11')]);_0x196674(_0x16bbb9[_0xcfc6('0xf')](0x1f4,_0xe00a85[_0xcfc6('0x11')]));});}})[_0xcfc6('0x13')](function(_0x55a127){logger['error']('VerifyAdditionalPhones',_0x55a127['message']);_0x196674(_0x16bbb9['error'](0x1f4,_0x55a127[_0xcfc6('0x11')]));});}else _0x9ef86d(0x1);});});};function activateAdditionalPhone(_0x9a4360,_0x1ea0fb,_0x35d610,_0x22e80,_0x37bb37){return new Promise(function(_0x1bcba7,_0xb323aa){var _0x1d1ef4;if(_[_0xcfc6('0x2c')](_0x35d610[_0xcfc6('0x2d')])){_0x35d610['scheduledat']=moment();}if(moment()>moment(_0x35d610[_0xcfc6('0x2d')])){_0x1d1ef4=moment()[_0xcfc6('0x2e')](_0x37bb37||0x3,'minutes');}else{if(_0x35d610[_0xcfc6('0x1a')]==0x0){_0x1d1ef4=moment(_0x35d610[_0xcfc6('0x2d')]);}else{_0x1d1ef4=moment()[_0xcfc6('0x2e')](_0x37bb37||0x3,_0xcfc6('0x2f'));}}if(_['isNil'](_0x1d1ef4)){_0x1d1ef4=moment()['add'](_0x37bb37||0x3,_0xcfc6('0x2f'));}var _0x33eb60={'phone':_0x9a4360['phone'],'active':0x0,'OrderBy':_[_0xcfc6('0x2c')](_0x9a4360[_0xcfc6('0x1a')])?0x0:_0x9a4360[_0xcfc6('0x1a')],'scheduledat':moment()[_0xcfc6('0x2e')](_0x22e80||0x1,_0xcfc6('0x2f')),'countbusyretry':_0x1ea0fb[_0xcfc6('0x1c')],'countcongestionretry':_0x1ea0fb['countcongestionretry'],'countnoanswerretry':_0x1ea0fb[_0xcfc6('0x1e')],'countnosuchnumberretry':_0x1ea0fb[_0xcfc6('0x1f')],'countdropretry':_0x1ea0fb[_0xcfc6('0x20')],'countabandonedretry':_0x1ea0fb[_0xcfc6('0x21')],'countmachineretry':_0x1ea0fb[_0xcfc6('0x22')],'countagentrejectretry':_0x1ea0fb[_0xcfc6('0x23')],'createdAt':_0x1ea0fb[_0xcfc6('0x30')],'updatedAt':_0x1ea0fb[_0xcfc6('0x31')]};var _0x2a1f95={'CmHopperId':_0x9a4360['id'],'phone':_0x35d610[_0xcfc6('0x32')],'active':0x0,'OrderBy':_[_0xcfc6('0x2c')](_0x35d610[_0xcfc6('0x1a')])?0x0:_0x35d610[_0xcfc6('0x1a')],'scheduledat':_0x1d1ef4,'countbusyretry':_0x35d610['countbusyretry'],'countcongestionretry':_0x35d610[_0xcfc6('0x1d')],'countnoanswerretry':_0x35d610[_0xcfc6('0x1e')],'countnosuchnumberretry':_0x35d610[_0xcfc6('0x1f')],'countdropretry':_0x35d610[_0xcfc6('0x20')],'countabandonedretry':_0x35d610[_0xcfc6('0x21')],'countmachineretry':_0x35d610[_0xcfc6('0x22')],'countagentrejectretry':_0x35d610[_0xcfc6('0x23')],'createdAt':_0x35d610[_0xcfc6('0x30')],'updatedAt':_0x35d610[_0xcfc6('0x31')]};return db[_0xcfc6('0x33')][_0xcfc6('0x34')](function(_0x374c42){return db['CmHopperAdditionalPhone'][_0xcfc6('0x35')](_0x33eb60,{'where':{'id':_0x35d610['id']}},{'transaction':_0x374c42})[_0xcfc6('0xa')](function(){return db[_0xcfc6('0x28')][_0xcfc6('0x35')](_0x2a1f95,{'where':{'id':_0x9a4360['id']}},{'transaction':_0x374c42});});})[_0xcfc6('0xa')](function(_0x23cb30){_0x1bcba7({'id':_0x9a4360['id'],'phone':_0x35d610['phone']});})['catch'](function(_0x967bad){logger[_0xcfc6('0xf')](_0xcfc6('0x36'),_0x967bad['message']);_0xb323aa({'error':_0x967bad['message']});});});}exports['IncrementPreviewCounters']=function(_0x4d0522){var _0x14a0ee=this;return new Promise(function(_0x29a050,_0x32b39f){return db[_0xcfc6('0x28')]['update'](_0x4d0522[_0xcfc6('0x16')][_0xcfc6('0x37')],{'where':{'id':_0x4d0522[_0xcfc6('0x16')]['id']}})['then'](function(_0xa37766){_0x29a050(_0xa37766);})[_0xcfc6('0x13')](function(_0x3f6c0d){logger[_0xcfc6('0xf')](_0xcfc6('0x38'),_0x3f6c0d[_0xcfc6('0x11')]);_0x32b39f(_0x14a0ee[_0xcfc6('0xf')](0x1f4,_0x3f6c0d['message']));});});}; \ No newline at end of file +var _0xec12=['VoiceQueueId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','countdropretry','SwapAdditionalPhones','ContactId','CampaignId','duration','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xec12,0xff));var _0x2ec1=function(_0x52c3e1,_0x2107d0){_0x52c3e1=_0x52c3e1-0x0;var _0x4cf675=_0xec12[_0x52c3e1];return _0x4cf675;};'use strict';var _=require(_0x2ec1('0x0'));var util=require('util');var moment=require(_0x2ec1('0x1'));var BPromise=require(_0x2ec1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ec1('0x3'));var db=require(_0x2ec1('0x4'))['db'];var utils=require(_0x2ec1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ec1('0x6'));var jayson=require(_0x2ec1('0x7'));var client=jayson[_0x2ec1('0x8')][_0x2ec1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57ee4f,_0x4491e0,_0x358d4d){return new BPromise(function(_0x1e6b0a,_0x56c4c6){return client[_0x2ec1('0xa')](_0x57ee4f,_0x358d4d)[_0x2ec1('0xb')](function(_0x371425){logger[_0x2ec1('0xc')](_0x2ec1('0xd'),_0x4491e0,_0x2ec1('0xe'));logger[_0x2ec1('0xf')](_0x2ec1('0x10'),_0x4491e0,_0x2ec1('0xe'),JSON['stringify'](_0x371425));if(_0x371425[_0x2ec1('0x11')]){if(_0x371425[_0x2ec1('0x11')]['code']===0x1f4){logger[_0x2ec1('0x11')](_0x2ec1('0xd'),_0x4491e0,_0x371425[_0x2ec1('0x11')][_0x2ec1('0x12')]);return _0x56c4c6(_0x371425[_0x2ec1('0x11')][_0x2ec1('0x12')]);}logger[_0x2ec1('0x11')](_0x2ec1('0xd'),_0x4491e0,_0x371425['error'][_0x2ec1('0x12')]);return _0x1e6b0a(_0x371425[_0x2ec1('0x11')][_0x2ec1('0x12')]);}else{logger[_0x2ec1('0xc')](_0x2ec1('0xd'),_0x4491e0,_0x2ec1('0xe'));_0x1e6b0a(_0x371425['result'][_0x2ec1('0x12')]);}})[_0x2ec1('0x13')](function(_0x5813a3){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4491e0,_0x5813a3);_0x56c4c6(_0x5813a3);});});}exports[_0x2ec1('0x14')]=function(_0x57f2b9){var _0x4ce933=this;return new Promise(function(_0x7f52b2,_0x25116f){return db[_0x2ec1('0x15')][_0x2ec1('0x16')]({'raw':!![],'where':{'ContactId':_0x57f2b9['body']['ContactId'],'ListId':_0x57f2b9[_0x2ec1('0x17')][_0x2ec1('0x18')],'VoiceQueueId':_0x57f2b9['body'][_0x2ec1('0x19')]===undefined?null:_0x57f2b9[_0x2ec1('0x17')]['VoiceQueueId'],'CampaignId':_0x57f2b9['body']['CampaignId']===undefined?null:_0x57f2b9[_0x2ec1('0x17')]['CampaignId']}})[_0x2ec1('0xb')](function(_0x3224bb){if(_0x3224bb!=null){return db[_0x2ec1('0x1a')][_0x2ec1('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3224bb['id'],'OrderBy':{'$gt':_0x3224bb[_0x2ec1('0x1b')]}},'order':[['OrderBy',_0x2ec1('0x1c')]]})[_0x2ec1('0xb')](function(_0x225574){var _0x1dec68=0x0;if(_0x225574){if(_0x225574['countbusyretry']+_0x225574[_0x2ec1('0x1d')]+_0x225574[_0x2ec1('0x1e')]+_0x225574[_0x2ec1('0x1f')]+_0x225574['countdropretry']+_0x225574[_0x2ec1('0x20')]+_0x225574[_0x2ec1('0x21')]+_0x225574[_0x2ec1('0x22')]<_0x57f2b9[_0x2ec1('0x23')][_0x2ec1('0x24')])_0x1dec68=0x1;_0x7f52b2({'additional':_0x1dec68});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3224bb['id']},'order':[[_0x2ec1('0x1b'),_0x2ec1('0x1c')]]})[_0x2ec1('0xb')](function(_0x112034){var _0x266bb8=0x0;if(_0x112034){if(_0x112034[_0x2ec1('0x25')]+_0x112034[_0x2ec1('0x1d')]+_0x112034[_0x2ec1('0x1e')]+_0x112034['countnosuchnumberretry']+_0x112034[_0x2ec1('0x26')]+_0x112034[_0x2ec1('0x20')]+_0x112034['countmachineretry']+_0x112034[_0x2ec1('0x22')]<_0x57f2b9[_0x2ec1('0x23')][_0x2ec1('0x24')])_0x266bb8=0x1;_0x7f52b2({'additional':_0x266bb8});}else{_0x7f52b2({'additional':0x0});}})[_0x2ec1('0x13')](function(_0x37170f){logger[_0x2ec1('0x11')](_0x2ec1('0x14'),_0x37170f[_0x2ec1('0x12')]);_0x25116f(_0x4ce933[_0x2ec1('0x11')](0x1f4,_0x37170f['message']));});}})['catch'](function(_0x38f06b){logger['error']('VerifyAdditionalPhones',_0x38f06b[_0x2ec1('0x12')]);_0x25116f(_0x4ce933['error'](0x1f4,_0x38f06b[_0x2ec1('0x12')]));});}else _0x7f52b2({'additional':0x0});});});};exports[_0x2ec1('0x27')]=function(_0x37d486){var _0x20478c=this;return new Promise(function(_0x30e322,_0x32cb29){return db[_0x2ec1('0x15')][_0x2ec1('0x16')]({'raw':!![],'where':{'ContactId':_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x28')],'ListId':_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x18')],'VoiceQueueId':_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x19')]===undefined?null:_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x19')],'CampaignId':_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x29')]===undefined?null:_0x37d486[_0x2ec1('0x17')][_0x2ec1('0x29')]}})[_0x2ec1('0xb')](function(_0x811d1f){if(_0x811d1f!=null){return db[_0x2ec1('0x1a')][_0x2ec1('0x16')]({'raw':!![],'where':{'CmHopperId':_0x811d1f['id'],'OrderBy':{'$gte':_0x811d1f['OrderBy']}},'order':[[_0x2ec1('0x1b'),_0x2ec1('0x1c')]]})[_0x2ec1('0xb')](function(_0x439f03){if(_0x439f03)return activateAdditionalPhone(_0x811d1f,_0x37d486['body'],_0x439f03,_0x37d486[_0x2ec1('0x2a')],_0x37d486[_0x2ec1('0x2b')])[_0x2ec1('0xb')](function(_0x2f68a1){_0x30e322(_0x2f68a1);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x811d1f['id']},'order':[[_0x2ec1('0x1b'),_0x2ec1('0x1c')]]})[_0x2ec1('0xb')](function(_0x4440a2){if(_0x4440a2)return activateAdditionalPhone(_0x811d1f,_0x37d486[_0x2ec1('0x17')],_0x4440a2,_0x37d486[_0x2ec1('0x2a')],_0x37d486[_0x2ec1('0x2b')])[_0x2ec1('0xb')](function(_0x36d8fd){_0x30e322(_0x36d8fd);});else{_0x30e322({'id':_0x811d1f['id'],'phone':''});}})['catch'](function(_0xbcd352){logger[_0x2ec1('0x11')](_0x2ec1('0x14'),_0xbcd352[_0x2ec1('0x12')]);_0x32cb29(_0x20478c[_0x2ec1('0x11')](0x1f4,_0xbcd352['message']));});}})[_0x2ec1('0x13')](function(_0x1af547){logger[_0x2ec1('0x11')]('VerifyAdditionalPhones',_0x1af547[_0x2ec1('0x12')]);_0x32cb29(_0x20478c[_0x2ec1('0x11')](0x1f4,_0x1af547[_0x2ec1('0x12')]));});}else _0x30e322(0x1);});});};function activateAdditionalPhone(_0xb9e869,_0x241b0a,_0x5ee669,_0x353c94,_0x13dc79){return new Promise(function(_0x351d48,_0x2f530b){var _0x3bfa5d;if(_['isNil'](_0x5ee669[_0x2ec1('0x2c')])){_0x5ee669[_0x2ec1('0x2c')]=moment();}if(moment()>moment(_0x5ee669[_0x2ec1('0x2c')])){_0x3bfa5d=moment()[_0x2ec1('0x2d')](_0x13dc79||0x3,_0x2ec1('0x2e'));}else{if(_0x5ee669[_0x2ec1('0x1b')]==0x0){_0x3bfa5d=moment(_0x5ee669[_0x2ec1('0x2c')]);}else{_0x3bfa5d=moment()[_0x2ec1('0x2d')](_0x13dc79||0x3,_0x2ec1('0x2e'));}}if(_[_0x2ec1('0x2f')](_0x3bfa5d)){_0x3bfa5d=moment()['add'](_0x13dc79||0x3,'minutes');}var _0x4033a4={'phone':_0xb9e869[_0x2ec1('0x30')],'active':0x0,'OrderBy':_['isNil'](_0xb9e869[_0x2ec1('0x1b')])?0x0:_0xb9e869[_0x2ec1('0x1b')],'scheduledat':moment()['add'](_0x353c94||0x1,_0x2ec1('0x2e')),'countbusyretry':_0x241b0a['countbusyretry'],'countcongestionretry':_0x241b0a[_0x2ec1('0x1d')],'countnoanswerretry':_0x241b0a['countnoanswerretry'],'countnosuchnumberretry':_0x241b0a['countnosuchnumberretry'],'countdropretry':_0x241b0a[_0x2ec1('0x26')],'countabandonedretry':_0x241b0a[_0x2ec1('0x20')],'countmachineretry':_0x241b0a[_0x2ec1('0x21')],'countagentrejectretry':_0x241b0a[_0x2ec1('0x22')],'createdAt':_0x241b0a[_0x2ec1('0x31')],'updatedAt':_0x241b0a['updatedAt']};var _0xe51a0e={'CmHopperId':_0xb9e869['id'],'phone':_0x5ee669[_0x2ec1('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x5ee669[_0x2ec1('0x1b')])?0x0:_0x5ee669[_0x2ec1('0x1b')],'scheduledat':_0x3bfa5d,'countbusyretry':_0x5ee669['countbusyretry'],'countcongestionretry':_0x5ee669[_0x2ec1('0x1d')],'countnoanswerretry':_0x5ee669[_0x2ec1('0x1e')],'countnosuchnumberretry':_0x5ee669[_0x2ec1('0x1f')],'countdropretry':_0x5ee669[_0x2ec1('0x26')],'countabandonedretry':_0x5ee669[_0x2ec1('0x20')],'countmachineretry':_0x5ee669[_0x2ec1('0x21')],'countagentrejectretry':_0x5ee669[_0x2ec1('0x22')],'createdAt':_0x5ee669[_0x2ec1('0x31')],'updatedAt':_0x5ee669['updatedAt']};return db[_0x2ec1('0x32')][_0x2ec1('0x33')](function(_0x570298){return db[_0x2ec1('0x1a')][_0x2ec1('0x34')](_0x4033a4,{'where':{'id':_0x5ee669['id']}},{'transaction':_0x570298})[_0x2ec1('0xb')](function(){return db[_0x2ec1('0x15')][_0x2ec1('0x34')](_0xe51a0e,{'where':{'id':_0xb9e869['id']}},{'transaction':_0x570298});});})[_0x2ec1('0xb')](function(_0x2a3123){_0x351d48({'id':_0xb9e869['id'],'phone':_0x5ee669['phone']});})['catch'](function(_0x259002){logger[_0x2ec1('0x11')](_0x2ec1('0x35'),_0x259002[_0x2ec1('0x12')]);_0x2f530b({'error':_0x259002[_0x2ec1('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x3705f1){var _0x188cb1=this;return new Promise(function(_0x499cd1,_0x64fd0f){return db[_0x2ec1('0x15')]['update'](_0x3705f1['body'][_0x2ec1('0x36')],{'where':{'id':_0x3705f1[_0x2ec1('0x17')]['id']}})[_0x2ec1('0xb')](function(_0xfadc57){_0x499cd1(_0xfadc57);})[_0x2ec1('0x13')](function(_0x521b51){logger[_0x2ec1('0x11')](_0x2ec1('0x37'),_0x521b51[_0x2ec1('0x12')]);_0x64fd0f(_0x188cb1['error'](0x1f4,_0x521b51[_0x2ec1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index a318fdf..0537288 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 _0xcdce=['create','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post'];(function(_0x3c57b5,_0x27eff0){var _0x5d26ef=function(_0x34b5e0){while(--_0x34b5e0){_0x3c57b5['push'](_0x3c57b5['shift']());}};_0x5d26ef(++_0x27eff0);}(_0xcdce,0x15a));var _0xecdc=function(_0x2617f4,_0x54ed65){_0x2617f4=_0x2617f4-0x0;var _0x10e5ae=_0xcdce[_0x2617f4];return _0x10e5ae;};'use strict';var multer=require('multer');var util=require(_0xecdc('0x0'));var path=require(_0xecdc('0x1'));var timeout=require(_0xecdc('0x2'));var express=require(_0xecdc('0x3'));var router=express[_0xecdc('0x4')]();var fs_extra=require(_0xecdc('0x5'));var auth=require(_0xecdc('0x6'));var interaction=require(_0xecdc('0x7'));var config=require(_0xecdc('0x8'));var controller=require(_0xecdc('0x9'));router[_0xecdc('0xa')]('/',auth[_0xecdc('0xb')](),controller['index']);router[_0xecdc('0xa')](_0xecdc('0xc'),auth['isAuthenticated'](),controller[_0xecdc('0xd')]);router[_0xecdc('0xe')]('/',auth['isAuthenticated'](),controller[_0xecdc('0xf')]);router[_0xecdc('0x10')](_0xecdc('0xc'),auth['isAuthenticated'](),controller[_0xecdc('0x11')]);router['delete'](_0xecdc('0xc'),auth[_0xecdc('0xb')](),controller[_0xecdc('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe8cd=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0x218ff6,_0x407f2c){var _0x43006a=function(_0x240665){while(--_0x240665){_0x218ff6['push'](_0x218ff6['shift']());}};_0x43006a(++_0x407f2c);}(_0xe8cd,0x90));var _0xde8c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xe8cd[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0xde8c('0x0'));var path=require(_0xde8c('0x1'));var timeout=require(_0xde8c('0x2'));var express=require(_0xde8c('0x3'));var router=express['Router']();var fs_extra=require(_0xde8c('0x4'));var auth=require(_0xde8c('0x5'));var interaction=require(_0xde8c('0x6'));var config=require('../../config/environment');var controller=require(_0xde8c('0x7'));router[_0xde8c('0x8')]('/',auth['isAuthenticated'](),controller[_0xde8c('0x9')]);router[_0xde8c('0x8')]('/:id',auth[_0xde8c('0xa')](),controller[_0xde8c('0xb')]);router['post']('/',auth[_0xde8c('0xa')](),controller[_0xde8c('0xc')]);router[_0xde8c('0xd')](_0xde8c('0xe'),auth[_0xde8c('0xa')](),controller[_0xde8c('0xf')]);router[_0xde8c('0x10')](_0xde8c('0xe'),auth['isAuthenticated'](),controller[_0xde8c('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 213acee..1df2700 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 _0x86f4=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x364c48,_0x1723c8){var _0x39b3ac=function(_0x364771){while(--_0x364771){_0x364c48['push'](_0x364c48['shift']());}};_0x39b3ac(++_0x1723c8);}(_0x86f4,0x18a));var _0x486f=function(_0x5be09e,_0x132c59){_0x5be09e=_0x5be09e-0x0;var _0x162b18=_0x86f4[_0x5be09e];return _0x162b18;};'use strict';var moment=require(_0x486f('0x0'));var Sequelize=require(_0x486f('0x1'));module[_0x486f('0x2')]={'phone':{'type':Sequelize[_0x486f('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x486f('0x4')],'unique':_0x486f('0x5')},'ListId':{'type':Sequelize[_0x486f('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x486f('0x4')],'unique':_0x486f('0x5')}}; \ No newline at end of file +var _0xacea=['contactListQueue','moment','sequelize','exports','INTEGER'];(function(_0x2e1ab3,_0x587812){var _0x283ab7=function(_0x5ff9a9){while(--_0x5ff9a9){_0x2e1ab3['push'](_0x2e1ab3['shift']());}};_0x283ab7(++_0x587812);}(_0xacea,0x1d2));var _0xaace=function(_0x18a604,_0x38f20d){_0x18a604=_0x18a604-0x0;var _0x54acca=_0xacea[_0x18a604];return _0x54acca;};'use strict';var moment=require(_0xaace('0x0'));var Sequelize=require(_0xaace('0x1'));module[_0xaace('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xaace('0x3')],'unique':_0xaace('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xaace('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xaace('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 26c5c32..6556440 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 _0xecef=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecef,0xdd));var _0xfece=function(_0x154d61,_0x536dba){_0x154d61=_0x154d61-0x0;var _0x2cd133=_0xecef[_0x154d61];return _0x2cd133;};'use strict';var emlformat=require(_0xfece('0x0'));var rimraf=require(_0xfece('0x1'));var zipdir=require(_0xfece('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfece('0x3'));var moment=require('moment');var BPromise=require(_0xfece('0x4'));var Mustache=require(_0xfece('0x5'));var util=require(_0xfece('0x6'));var path=require(_0xfece('0x7'));var sox=require(_0xfece('0x8'));var csv=require(_0xfece('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfece('0xa'));var _=require(_0xfece('0xb'));var squel=require(_0xfece('0xc'));var crypto=require('crypto');var jsforce=require(_0xfece('0xd'));var deskjs=require(_0xfece('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfece('0xf'));var Papa=require(_0xfece('0x10'));var Redis=require(_0xfece('0x11'));var authService=require(_0xfece('0x12'));var qs=require(_0xfece('0x13'));var as=require(_0xfece('0x14'));var hardwareService=require(_0xfece('0x15'));var logger=require(_0xfece('0x16'))(_0xfece('0x17'));var utils=require(_0xfece('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfece('0x19'))['db'];function respondWithStatusCode(_0x323cec,_0x3270a4){_0x3270a4=_0x3270a4||0xcc;return function(_0x20cc5b){if(_0x20cc5b){return _0x323cec[_0xfece('0x1a')](_0x3270a4);}return _0x323cec[_0xfece('0x1b')](_0x3270a4)[_0xfece('0x1c')]();};}function respondWithResult(_0x19405c,_0x101e13){_0x101e13=_0x101e13||0xc8;return function(_0x36a82c){if(_0x36a82c){return _0x19405c[_0xfece('0x1b')](_0x101e13)[_0xfece('0x1d')](_0x36a82c);}};}function respondWithFilteredResult(_0x52ee0a,_0x2d3ea7){return function(_0x5ca4f1){if(_0x5ca4f1){var _0x353117=typeof _0x2d3ea7['offset']===_0xfece('0x1e')&&typeof _0x2d3ea7['limit']==='undefined';var _0x312ae6=_0x5ca4f1[_0xfece('0x1f')];var _0x3ee9e9=_0x353117?0x0:_0x2d3ea7['offset'];var _0x297711=_0x353117?_0x5ca4f1[_0xfece('0x1f')]:_0x2d3ea7['offset']+_0x2d3ea7['limit'];var _0x45a12f;if(_0x297711>=_0x312ae6){_0x297711=_0x312ae6;_0x45a12f=0xc8;}else{_0x45a12f=0xce;}_0x52ee0a['status'](_0x45a12f);return _0x52ee0a[_0xfece('0x20')]('Content-Range',_0x3ee9e9+'-'+_0x297711+'/'+_0x312ae6)[_0xfece('0x1d')](_0x5ca4f1);}return null;};}function patchUpdates(_0x46fdbf){return function(_0x441c05){try{jsonpatch[_0xfece('0x21')](_0x441c05,_0x46fdbf,!![]);}catch(_0x2b49cf){return BPromise[_0xfece('0x22')](_0x2b49cf);}return _0x441c05[_0xfece('0x23')]();};}function saveUpdates(_0x1966cc,_0x57df3a){return function(_0x4b2bce){if(_0x4b2bce){return _0x4b2bce['update'](_0x1966cc)[_0xfece('0x24')](function(_0x5b6659){return _0x5b6659;});}return null;};}function removeEntity(_0x59179e,_0x345541){return function(_0x3093e6){if(_0x3093e6){return _0x3093e6[_0xfece('0x25')]()['then'](function(){_0x59179e[_0xfece('0x1b')](0xcc)[_0xfece('0x1c')]();});}};}function handleEntityNotFound(_0x5a19a3,_0x580419){return function(_0x5c158a){if(!_0x5c158a){_0x5a19a3[_0xfece('0x1a')](0x194);}return _0x5c158a;};}function handleError(_0x2d7083,_0x593b16){_0x593b16=_0x593b16||0x1f4;return function(_0x29630e){logger[_0xfece('0x26')](_0x29630e[_0xfece('0x27')]);if(_0x29630e[_0xfece('0x28')]){delete _0x29630e[_0xfece('0x28')];}_0x2d7083[_0xfece('0x1b')](_0x593b16)['send'](_0x29630e);};}exports['index']=function(_0x46b976,_0x53e170){var _0x1bb24b={},_0x45615e={},_0x11213a={'count':0x0,'rows':[]};var _0x37eaf5=_[_0xfece('0x29')](db[_0xfece('0x2a')][_0xfece('0x2b')],function(_0x30bddc){return{'name':_0x30bddc[_0xfece('0x2c')],'type':_0x30bddc[_0xfece('0x2d')][_0xfece('0x2e')]};});_0x45615e[_0xfece('0x2f')]=_['map'](_0x37eaf5,_0xfece('0x28'));_0x45615e['query']=_[_0xfece('0x30')](_0x46b976[_0xfece('0x31')]);_0x45615e[_0xfece('0x32')]=_[_0xfece('0x33')](_0x45615e[_0xfece('0x2f')],_0x45615e[_0xfece('0x31')]);_0x1bb24b[_0xfece('0x34')]=_[_0xfece('0x33')](_0x45615e['model'],qs[_0xfece('0x35')](_0x46b976[_0xfece('0x31')][_0xfece('0x35')]));_0x1bb24b[_0xfece('0x34')]=_0x1bb24b['attributes']['length']?_0x1bb24b[_0xfece('0x34')]:_0x45615e['model'];if(!_0x46b976[_0xfece('0x31')]['hasOwnProperty'](_0xfece('0x36'))){_0x1bb24b[_0xfece('0x37')]=qs[_0xfece('0x37')](_0x46b976[_0xfece('0x31')][_0xfece('0x37')]);_0x1bb24b['offset']=qs[_0xfece('0x38')](_0x46b976['query'][_0xfece('0x38')]);}_0x1bb24b[_0xfece('0x39')]=qs[_0xfece('0x3a')](_0x46b976[_0xfece('0x31')][_0xfece('0x3a')]);_0x1bb24b[_0xfece('0x3b')]=qs[_0xfece('0x32')](_[_0xfece('0x3c')](_0x46b976[_0xfece('0x31')],_0x45615e[_0xfece('0x32')]),_0x37eaf5);if(_0x46b976[_0xfece('0x31')][_0xfece('0x3d')]){_0x1bb24b[_0xfece('0x3b')]=_[_0xfece('0x3e')](_0x1bb24b[_0xfece('0x3b')],{'$or':_['map'](_0x37eaf5,function(_0x4adc82){if(_0x4adc82[_0xfece('0x2d')]!==_0xfece('0x3f')){var _0x1af351={};_0x1af351[_0x4adc82[_0xfece('0x28')]]={'$like':'%'+_0x46b976['query'][_0xfece('0x3d')]+'%'};return _0x1af351;}})});}_0x1bb24b=_[_0xfece('0x3e')]({},_0x1bb24b,_0x46b976[_0xfece('0x40')]);var _0x5691cb={'where':_0x1bb24b['where']};return db['CmHopperBlack'][_0xfece('0x1f')](_0x5691cb)['then'](function(_0x1887b3){_0x11213a['count']=_0x1887b3;if(_0x46b976[_0xfece('0x31')]['includeAll']){_0x1bb24b[_0xfece('0x41')]=[{'all':!![]}];}return db[_0xfece('0x2a')][_0xfece('0x42')](_0x1bb24b);})[_0xfece('0x24')](function(_0x2b97f4){_0x11213a[_0xfece('0x43')]=_0x2b97f4;return _0x11213a;})[_0xfece('0x24')](respondWithFilteredResult(_0x53e170,_0x1bb24b))[_0xfece('0x44')](handleError(_0x53e170,null));};exports[_0xfece('0x45')]=function(_0x3457a6,_0x1db86c){var _0x70eac={'raw':!![],'where':{'id':_0x3457a6[_0xfece('0x46')]['id']}},_0x168d95={};_0x168d95['model']=_[_0xfece('0x30')](db[_0xfece('0x2a')][_0xfece('0x2b')]);_0x168d95[_0xfece('0x31')]=_[_0xfece('0x30')](_0x3457a6[_0xfece('0x31')]);_0x168d95['filters']=_[_0xfece('0x33')](_0x168d95[_0xfece('0x2f')],_0x168d95['query']);_0x70eac[_0xfece('0x34')]=_['intersection'](_0x168d95[_0xfece('0x2f')],qs[_0xfece('0x35')](_0x3457a6['query']['fields']));_0x70eac[_0xfece('0x34')]=_0x70eac[_0xfece('0x34')][_0xfece('0x47')]?_0x70eac[_0xfece('0x34')]:_0x168d95[_0xfece('0x2f')];if(_0x3457a6[_0xfece('0x31')][_0xfece('0x48')]){_0x70eac[_0xfece('0x41')]=[{'all':!![]}];}_0x70eac=_[_0xfece('0x3e')]({},_0x70eac,_0x3457a6[_0xfece('0x40')]);return db[_0xfece('0x2a')][_0xfece('0x49')](_0x70eac)['then'](handleEntityNotFound(_0x1db86c,null))[_0xfece('0x24')](respondWithResult(_0x1db86c,null))[_0xfece('0x44')](handleError(_0x1db86c,null));};exports['update']=function(_0x2f5281,_0x5282f2){if(_0x2f5281['body']['id']){delete _0x2f5281[_0xfece('0x4a')]['id'];}return db['CmHopperBlack'][_0xfece('0x49')]({'where':{'id':_0x2f5281[_0xfece('0x46')]['id']}})[_0xfece('0x24')](handleEntityNotFound(_0x5282f2,null))[_0xfece('0x24')](saveUpdates(_0x2f5281[_0xfece('0x4a')],null))[_0xfece('0x24')](respondWithResult(_0x5282f2,null))[_0xfece('0x44')](handleError(_0x5282f2,null));};exports['destroy']=function(_0x51a142,_0x5af88d){return db[_0xfece('0x2a')]['find']({'where':{'id':_0x51a142[_0xfece('0x46')]['id']}})[_0xfece('0x24')](handleEntityNotFound(_0x5af88d,null))[_0xfece('0x24')](removeEntity(_0x5af88d,null))[_0xfece('0x44')](handleError(_0x5af88d,null));};exports[_0xfece('0x4b')]=function(_0x61bfa0,_0x16b7a1){return db[_0xfece('0x2a')][_0xfece('0x4b')]()[_0xfece('0x24')](respondWithResult(_0x16b7a1,null))['catch'](handleError(_0x16b7a1,null));}; \ No newline at end of file +var _0x8c6c=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','update','body','describe','eml-format','rimraf','fast-json-patch','moment','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','stack','name','send','CmHopperBlack','rawAttributes','fieldName','type','key'];(function(_0x2cea86,_0x1d4186){var _0x334ec9=function(_0x1dcbde){while(--_0x1dcbde){_0x2cea86['push'](_0x2cea86['shift']());}};_0x334ec9(++_0x1d4186);}(_0x8c6c,0x133));var _0xc8c6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8c6c[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xc8c6('0x0'));var rimraf=require(_0xc8c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8c6('0x2'));var rp=require('request-promise');var moment=require(_0xc8c6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc8c6('0x4'));var path=require(_0xc8c6('0x5'));var sox=require(_0xc8c6('0x6'));var csv=require('to-csv');var ejs=require(_0xc8c6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8c6('0x8'));var crypto=require('crypto');var jsforce=require(_0xc8c6('0x9'));var deskjs=require(_0xc8c6('0xa'));var toCsv=require(_0xc8c6('0xb'));var querystring=require(_0xc8c6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc8c6('0xd'));var authService=require(_0xc8c6('0xe'));var qs=require(_0xc8c6('0xf'));var as=require(_0xc8c6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8c6('0x11'))(_0xc8c6('0x12'));var utils=require(_0xc8c6('0x13'));var config=require(_0xc8c6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc8c6('0x15'))['db'];function respondWithStatusCode(_0xd9c8f0,_0x523fc8){_0x523fc8=_0x523fc8||0xcc;return function(_0x2a0732){if(_0x2a0732){return _0xd9c8f0[_0xc8c6('0x16')](_0x523fc8);}return _0xd9c8f0[_0xc8c6('0x17')](_0x523fc8)[_0xc8c6('0x18')]();};}function respondWithResult(_0x95c5ec,_0x3b20d4){_0x3b20d4=_0x3b20d4||0xc8;return function(_0xff14af){if(_0xff14af){return _0x95c5ec[_0xc8c6('0x17')](_0x3b20d4)[_0xc8c6('0x19')](_0xff14af);}};}function respondWithFilteredResult(_0x175f57,_0x12a8a1){return function(_0x280323){if(_0x280323){var _0xab935f=typeof _0x12a8a1[_0xc8c6('0x1a')]===_0xc8c6('0x1b')&&typeof _0x12a8a1['limit']===_0xc8c6('0x1b');var _0x412ed3=_0x280323['count'];var _0x35ad89=_0xab935f?0x0:_0x12a8a1[_0xc8c6('0x1a')];var _0xbc2480=_0xab935f?_0x280323[_0xc8c6('0x1c')]:_0x12a8a1[_0xc8c6('0x1a')]+_0x12a8a1[_0xc8c6('0x1d')];var _0x3c50cf;if(_0xbc2480>=_0x412ed3){_0xbc2480=_0x412ed3;_0x3c50cf=0xc8;}else{_0x3c50cf=0xce;}_0x175f57[_0xc8c6('0x17')](_0x3c50cf);return _0x175f57[_0xc8c6('0x1e')](_0xc8c6('0x1f'),_0x35ad89+'-'+_0xbc2480+'/'+_0x412ed3)[_0xc8c6('0x19')](_0x280323);}return null;};}function patchUpdates(_0x2f8ada){return function(_0x3f259a){try{jsonpatch['apply'](_0x3f259a,_0x2f8ada,!![]);}catch(_0x4bd296){return BPromise[_0xc8c6('0x20')](_0x4bd296);}return _0x3f259a['save']();};}function saveUpdates(_0x4e0669,_0x4f7c03){return function(_0x35d827){if(_0x35d827){return _0x35d827['update'](_0x4e0669)[_0xc8c6('0x21')](function(_0x52442d){return _0x52442d;});}return null;};}function removeEntity(_0x308f35,_0x13e3b7){return function(_0x4b6948){if(_0x4b6948){return _0x4b6948[_0xc8c6('0x22')]()[_0xc8c6('0x21')](function(){_0x308f35['status'](0xcc)[_0xc8c6('0x18')]();});}};}function handleEntityNotFound(_0x18bbe6,_0x405cea){return function(_0x56033b){if(!_0x56033b){_0x18bbe6[_0xc8c6('0x16')](0x194);}return _0x56033b;};}function handleError(_0x22f6e6,_0x28d8ca){_0x28d8ca=_0x28d8ca||0x1f4;return function(_0x148568){logger['error'](_0x148568[_0xc8c6('0x23')]);if(_0x148568[_0xc8c6('0x24')]){delete _0x148568[_0xc8c6('0x24')];}_0x22f6e6[_0xc8c6('0x17')](_0x28d8ca)[_0xc8c6('0x25')](_0x148568);};}exports['index']=function(_0xc6dde3,_0xeaa4ee){var _0x5830d2={},_0x126a9d={},_0x5a215a={'count':0x0,'rows':[]};var _0xe5b410=_['map'](db[_0xc8c6('0x26')][_0xc8c6('0x27')],function(_0x2a9012){return{'name':_0x2a9012[_0xc8c6('0x28')],'type':_0x2a9012[_0xc8c6('0x29')][_0xc8c6('0x2a')]};});_0x126a9d[_0xc8c6('0x2b')]=_['map'](_0xe5b410,_0xc8c6('0x24'));_0x126a9d['query']=_[_0xc8c6('0x2c')](_0xc6dde3[_0xc8c6('0x2d')]);_0x126a9d[_0xc8c6('0x2e')]=_[_0xc8c6('0x2f')](_0x126a9d['model'],_0x126a9d[_0xc8c6('0x2d')]);_0x5830d2[_0xc8c6('0x30')]=_['intersection'](_0x126a9d['model'],qs[_0xc8c6('0x31')](_0xc6dde3['query'][_0xc8c6('0x31')]));_0x5830d2[_0xc8c6('0x30')]=_0x5830d2[_0xc8c6('0x30')][_0xc8c6('0x32')]?_0x5830d2[_0xc8c6('0x30')]:_0x126a9d[_0xc8c6('0x2b')];if(!_0xc6dde3[_0xc8c6('0x2d')][_0xc8c6('0x33')](_0xc8c6('0x34'))){_0x5830d2['limit']=qs[_0xc8c6('0x1d')](_0xc6dde3['query'][_0xc8c6('0x1d')]);_0x5830d2[_0xc8c6('0x1a')]=qs[_0xc8c6('0x1a')](_0xc6dde3[_0xc8c6('0x2d')][_0xc8c6('0x1a')]);}_0x5830d2[_0xc8c6('0x35')]=qs[_0xc8c6('0x36')](_0xc6dde3[_0xc8c6('0x2d')][_0xc8c6('0x36')]);_0x5830d2[_0xc8c6('0x37')]=qs[_0xc8c6('0x2e')](_[_0xc8c6('0x38')](_0xc6dde3[_0xc8c6('0x2d')],_0x126a9d[_0xc8c6('0x2e')]),_0xe5b410);if(_0xc6dde3[_0xc8c6('0x2d')][_0xc8c6('0x39')]){_0x5830d2[_0xc8c6('0x37')]=_[_0xc8c6('0x3a')](_0x5830d2[_0xc8c6('0x37')],{'$or':_['map'](_0xe5b410,function(_0xb3f7b3){if(_0xb3f7b3[_0xc8c6('0x29')]!=='VIRTUAL'){var _0x2e1d10={};_0x2e1d10[_0xb3f7b3[_0xc8c6('0x24')]]={'$like':'%'+_0xc6dde3[_0xc8c6('0x2d')]['filter']+'%'};return _0x2e1d10;}})});}_0x5830d2=_[_0xc8c6('0x3a')]({},_0x5830d2,_0xc6dde3[_0xc8c6('0x3b')]);var _0x2029f8={'where':_0x5830d2['where']};return db[_0xc8c6('0x26')][_0xc8c6('0x1c')](_0x2029f8)['then'](function(_0x576146){_0x5a215a['count']=_0x576146;if(_0xc6dde3[_0xc8c6('0x2d')][_0xc8c6('0x3c')]){_0x5830d2[_0xc8c6('0x3d')]=[{'all':!![]}];}return db[_0xc8c6('0x26')][_0xc8c6('0x3e')](_0x5830d2);})[_0xc8c6('0x21')](function(_0x1b56bd){_0x5a215a[_0xc8c6('0x3f')]=_0x1b56bd;return _0x5a215a;})['then'](respondWithFilteredResult(_0xeaa4ee,_0x5830d2))[_0xc8c6('0x40')](handleError(_0xeaa4ee,null));};exports[_0xc8c6('0x41')]=function(_0x45efc8,_0x45ce13){var _0x181e32={'raw':!![],'where':{'id':_0x45efc8[_0xc8c6('0x42')]['id']}},_0x2da23c={};_0x2da23c['model']=_[_0xc8c6('0x2c')](db[_0xc8c6('0x26')]['rawAttributes']);_0x2da23c[_0xc8c6('0x2d')]=_[_0xc8c6('0x2c')](_0x45efc8[_0xc8c6('0x2d')]);_0x2da23c[_0xc8c6('0x2e')]=_['intersection'](_0x2da23c[_0xc8c6('0x2b')],_0x2da23c[_0xc8c6('0x2d')]);_0x181e32[_0xc8c6('0x30')]=_[_0xc8c6('0x2f')](_0x2da23c[_0xc8c6('0x2b')],qs[_0xc8c6('0x31')](_0x45efc8[_0xc8c6('0x2d')]['fields']));_0x181e32['attributes']=_0x181e32[_0xc8c6('0x30')]['length']?_0x181e32[_0xc8c6('0x30')]:_0x2da23c[_0xc8c6('0x2b')];if(_0x45efc8[_0xc8c6('0x2d')][_0xc8c6('0x3c')]){_0x181e32[_0xc8c6('0x3d')]=[{'all':!![]}];}_0x181e32=_['merge']({},_0x181e32,_0x45efc8[_0xc8c6('0x3b')]);return db['CmHopperBlack']['find'](_0x181e32)[_0xc8c6('0x21')](handleEntityNotFound(_0x45ce13,null))[_0xc8c6('0x21')](respondWithResult(_0x45ce13,null))[_0xc8c6('0x40')](handleError(_0x45ce13,null));};exports[_0xc8c6('0x43')]=function(_0x538d93,_0x2447a0){if(_0x538d93['body']['id']){delete _0x538d93[_0xc8c6('0x44')]['id'];}return db[_0xc8c6('0x26')]['find']({'where':{'id':_0x538d93[_0xc8c6('0x42')]['id']}})[_0xc8c6('0x21')](handleEntityNotFound(_0x2447a0,null))[_0xc8c6('0x21')](saveUpdates(_0x538d93[_0xc8c6('0x44')],null))[_0xc8c6('0x21')](respondWithResult(_0x2447a0,null))['catch'](handleError(_0x2447a0,null));};exports[_0xc8c6('0x22')]=function(_0x5c3094,_0x2c519f){return db[_0xc8c6('0x26')]['find']({'where':{'id':_0x5c3094['params']['id']}})[_0xc8c6('0x21')](handleEntityNotFound(_0x2c519f,null))['then'](removeEntity(_0x2c519f,null))['catch'](handleError(_0x2c519f,null));};exports[_0xc8c6('0x45')]=function(_0x184ac2,_0x577956){return db[_0xc8c6('0x26')]['describe']()['then'](respondWithResult(_0x577956,null))[_0xc8c6('0x40')](handleError(_0x577956,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 5e404f6..0b85476 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 _0xa79f=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xa79f,0x188));var _0xfa79=function(_0x580b3e,_0x371a8){_0x580b3e=_0x580b3e-0x0;var _0x550722=_0xa79f[_0x580b3e];return _0x550722;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa79('0x0'))(_0xfa79('0x1'));var moment=require(_0xfa79('0x2'));var BPromise=require(_0xfa79('0x3'));var rp=require(_0xfa79('0x4'));var fs=require('fs');var path=require(_0xfa79('0x5'));var rimraf=require(_0xfa79('0x6'));var config=require(_0xfa79('0x7'));var attributes=require(_0xfa79('0x8'));module['exports']=function(_0x289104,_0x25a187){return _0x289104['define'](_0xfa79('0x9'),attributes,{'tableName':_0xfa79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e9=['lodash','util','../../config/logger','moment','request-promise','rimraf','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black'];(function(_0x2a7b16,_0x598218){var _0x231cff=function(_0x3b587b){while(--_0x3b587b){_0x2a7b16['push'](_0x2a7b16['shift']());}};_0x231cff(++_0x598218);}(_0xa3e9,0x1ae));var _0x9a3e=function(_0x5df941,_0x15dfeb){_0x5df941=_0x5df941-0x0;var _0xc3750c=_0xa3e9[_0x5df941];return _0xc3750c;};'use strict';var _=require(_0x9a3e('0x0'));var util=require(_0x9a3e('0x1'));var logger=require(_0x9a3e('0x2'))('api');var moment=require(_0x9a3e('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a3e('0x5'));var config=require('../../config/environment');var attributes=require(_0x9a3e('0x6'));module[_0x9a3e('0x7')]=function(_0x5e372c,_0x5ebeb7){return _0x5e372c['define'](_0x9a3e('0x8'),attributes,{'tableName':_0x9a3e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 1d7b8b7..f20c693 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 _0x208e=['map','model','then','info','UpdateCmHopperBlack','update','limit','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include'];(function(_0x1ee35d,_0x56b6a8){var _0x1338d2=function(_0x16820d){while(--_0x16820d){_0x1ee35d['push'](_0x1ee35d['shift']());}};_0x1338d2(++_0x56b6a8);}(_0x208e,0xc7));var _0xe208=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x208e[_0x903228];return _0xcec81d;};'use strict';var _=require(_0xe208('0x0'));var util=require(_0xe208('0x1'));var moment=require(_0xe208('0x2'));var BPromise=require(_0xe208('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe208('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe208('0x5'));var logger=require(_0xe208('0x6'))(_0xe208('0x7'));var config=require(_0xe208('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe208('0x9')][_0xe208('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38d0c4,_0x20e1cc,_0x5d31ce){return new BPromise(function(_0x3a2a66,_0x1ed628){return client['request'](_0x38d0c4,_0x5d31ce)['then'](function(_0x6fbd64){logger['info'](_0xe208('0xb'),_0x20e1cc,_0xe208('0xc'));logger[_0xe208('0xd')](_0xe208('0xe'),_0x20e1cc,_0xe208('0xc'),JSON[_0xe208('0xf')](_0x6fbd64));if(_0x6fbd64[_0xe208('0x10')]){if(_0x6fbd64[_0xe208('0x10')][_0xe208('0x11')]===0x1f4){logger['error'](_0xe208('0xb'),_0x20e1cc,_0x6fbd64[_0xe208('0x10')][_0xe208('0x12')]);return _0x1ed628(_0x6fbd64[_0xe208('0x10')]['message']);}logger[_0xe208('0x10')](_0xe208('0xb'),_0x20e1cc,_0x6fbd64['error']['message']);return _0x3a2a66(_0x6fbd64[_0xe208('0x10')][_0xe208('0x12')]);}else{logger['info'](_0xe208('0xb'),_0x20e1cc,'request\x20sent');_0x3a2a66(_0x6fbd64[_0xe208('0x13')]['message']);}})[_0xe208('0x14')](function(_0x38d4dd){logger[_0xe208('0x10')](_0xe208('0xb'),_0x20e1cc,_0x38d4dd);_0x1ed628(_0x38d4dd);});});}exports[_0xe208('0x15')]=function(_0x2162af){var _0x47067d=this;return new Promise(function(_0x506b60,_0x41e400){return db[_0xe208('0x16')][_0xe208('0x17')]({'raw':_0x2162af[_0xe208('0x18')]?_0x2162af[_0xe208('0x18')][_0xe208('0x19')]===undefined?!![]:![]:!![],'where':_0x2162af[_0xe208('0x18')]?_0x2162af[_0xe208('0x18')][_0xe208('0x1a')]||null:null,'attributes':_0x2162af[_0xe208('0x18')]?_0x2162af['options'][_0xe208('0x1b')]||null:null,'limit':_0x2162af[_0xe208('0x18')]?_0x2162af[_0xe208('0x18')]['limit']||null:null,'include':_0x2162af[_0xe208('0x18')]?_0x2162af[_0xe208('0x18')][_0xe208('0x1c')]?_[_0xe208('0x1d')](_0x2162af[_0xe208('0x18')]['include'],function(_0x3a7feb){return{'model':db[_0x3a7feb['model']],'as':_0x3a7feb['as'],'attributes':_0x3a7feb[_0xe208('0x1b')],'include':_0x3a7feb['include']?_['map'](_0x3a7feb[_0xe208('0x1c')],function(_0x2e086a){return{'model':db[_0x2e086a[_0xe208('0x1e')]],'as':_0x2e086a['as'],'attributes':_0x2e086a[_0xe208('0x1b')],'include':_0x2e086a[_0xe208('0x1c')]?_[_0xe208('0x1d')](_0x2e086a['include'],function(_0x4da226){return{'model':db[_0x4da226['model']],'as':_0x4da226['as'],'attributes':_0x4da226[_0xe208('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe208('0x1f')](function(_0x91c163){logger[_0xe208('0x20')](_0xe208('0x15'),_0x2162af);logger[_0xe208('0xd')](_0xe208('0x15'),_0x2162af,JSON[_0xe208('0xf')](_0x91c163));_0x506b60(_0x91c163);})[_0xe208('0x14')](function(_0x3e1682){logger[_0xe208('0x10')](_0xe208('0x15'),_0x3e1682[_0xe208('0x12')],_0x2162af);_0x41e400(_0x47067d[_0xe208('0x10')](0x1f4,_0x3e1682[_0xe208('0x12')]));});});};exports[_0xe208('0x21')]=function(_0x3b5853){var _0x16d9cb=this;return new Promise(function(_0x2b4777,_0x14049a){return db[_0xe208('0x16')][_0xe208('0x22')](_0x3b5853['body'],{'raw':_0x3b5853[_0xe208('0x18')]?_0x3b5853[_0xe208('0x18')][_0xe208('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b5853[_0xe208('0x18')]?_0x3b5853[_0xe208('0x18')]['where']||null:null,'attributes':_0x3b5853['options']?_0x3b5853['options'][_0xe208('0x1b')]||null:null,'limit':_0x3b5853[_0xe208('0x18')]?_0x3b5853[_0xe208('0x18')][_0xe208('0x23')]||null:null})[_0xe208('0x1f')](function(_0x4f5d66){logger[_0xe208('0x20')](_0xe208('0x21'),_0x3b5853);logger['debug'](_0xe208('0x21'),_0x3b5853,JSON[_0xe208('0xf')](_0x4f5d66));_0x2b4777(_0x4f5d66);})[_0xe208('0x14')](function(_0x4c5359){logger[_0xe208('0x10')](_0xe208('0x21'),_0x4c5359[_0xe208('0x12')],_0x3b5853);_0x14049a(_0x16d9cb['error'](0x1f4,_0x4c5359['message']));});});};exports['DestroyCmHopperBlack']=function(_0x82aa3b){var _0x192a46=this;return new Promise(function(_0x47a496,_0x522603){return db['CmHopperBlack'][_0xe208('0x24')]({'where':_0x82aa3b[_0xe208('0x18')]?_0x82aa3b['options'][_0xe208('0x1a')]||null:null})[_0xe208('0x1f')](function(_0x470f17){logger['info']('DestroyCmHopperBlack',_0x82aa3b);logger['debug']('DestroyCmHopperBlack',_0x82aa3b,JSON[_0xe208('0xf')](_0x470f17));_0x47a496(_0x470f17);})['catch'](function(_0xaa55eb){logger[_0xe208('0x10')](_0xe208('0x25'),_0xaa55eb[_0xe208('0x12')],_0x82aa3b);_0x522603(_0x192a46[_0xe208('0x10')](0x1f4,_0xaa55eb[_0xe208('0x12')]));});});}; \ No newline at end of file +var _0x7eb6=['info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x583ba8,_0x40bb0d){var _0x515683=function(_0x4172e9){while(--_0x4172e9){_0x583ba8['push'](_0x583ba8['shift']());}};_0x515683(++_0x40bb0d);}(_0x7eb6,0x167));var _0x67eb=function(_0x5ceb6f,_0x28522e){_0x5ceb6f=_0x5ceb6f-0x0;var _0x5aa54f=_0x7eb6[_0x5ceb6f];return _0x5aa54f;};'use strict';var _=require(_0x67eb('0x0'));var util=require(_0x67eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x67eb('0x2'));var fs=require('fs');var Redis=require(_0x67eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67eb('0x4'));var logger=require(_0x67eb('0x5'))(_0x67eb('0x6'));var config=require(_0x67eb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x67eb('0x8')][_0x67eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd047,_0x33cf35,_0x5c6f11){return new BPromise(function(_0x5cad1d,_0x39a81a){return client['request'](_0x2fd047,_0x5c6f11)[_0x67eb('0xa')](function(_0x34b3e9){logger[_0x67eb('0xb')](_0x67eb('0xc'),_0x33cf35,'request\x20sent');logger[_0x67eb('0xd')](_0x67eb('0xe'),_0x33cf35,_0x67eb('0xf'),JSON[_0x67eb('0x10')](_0x34b3e9));if(_0x34b3e9[_0x67eb('0x11')]){if(_0x34b3e9[_0x67eb('0x11')][_0x67eb('0x12')]===0x1f4){logger['error'](_0x67eb('0xc'),_0x33cf35,_0x34b3e9['error'][_0x67eb('0x13')]);return _0x39a81a(_0x34b3e9[_0x67eb('0x11')]['message']);}logger['error'](_0x67eb('0xc'),_0x33cf35,_0x34b3e9[_0x67eb('0x11')]['message']);return _0x5cad1d(_0x34b3e9[_0x67eb('0x11')]['message']);}else{logger[_0x67eb('0xb')](_0x67eb('0xc'),_0x33cf35,'request\x20sent');_0x5cad1d(_0x34b3e9[_0x67eb('0x14')]['message']);}})['catch'](function(_0x2be7ad){logger[_0x67eb('0x11')](_0x67eb('0xc'),_0x33cf35,_0x2be7ad);_0x39a81a(_0x2be7ad);});});}exports[_0x67eb('0x15')]=function(_0x4cf1c2){var _0x5369bb=this;return new Promise(function(_0x15b736,_0x29fa94){return db[_0x67eb('0x16')][_0x67eb('0x17')]({'raw':_0x4cf1c2[_0x67eb('0x18')]?_0x4cf1c2[_0x67eb('0x18')][_0x67eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4cf1c2[_0x67eb('0x18')]?_0x4cf1c2[_0x67eb('0x18')][_0x67eb('0x1a')]||null:null,'attributes':_0x4cf1c2['options']?_0x4cf1c2[_0x67eb('0x18')][_0x67eb('0x1b')]||null:null,'limit':_0x4cf1c2[_0x67eb('0x18')]?_0x4cf1c2[_0x67eb('0x18')][_0x67eb('0x1c')]||null:null,'include':_0x4cf1c2['options']?_0x4cf1c2['options'][_0x67eb('0x1d')]?_[_0x67eb('0x1e')](_0x4cf1c2[_0x67eb('0x18')][_0x67eb('0x1d')],function(_0x2749a3){return{'model':db[_0x2749a3[_0x67eb('0x1f')]],'as':_0x2749a3['as'],'attributes':_0x2749a3[_0x67eb('0x1b')],'include':_0x2749a3['include']?_['map'](_0x2749a3[_0x67eb('0x1d')],function(_0x9459c0){return{'model':db[_0x9459c0[_0x67eb('0x1f')]],'as':_0x9459c0['as'],'attributes':_0x9459c0[_0x67eb('0x1b')],'include':_0x9459c0[_0x67eb('0x1d')]?_[_0x67eb('0x1e')](_0x9459c0['include'],function(_0x4beab9){return{'model':db[_0x4beab9[_0x67eb('0x1f')]],'as':_0x4beab9['as'],'attributes':_0x4beab9[_0x67eb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x67eb('0xa')](function(_0x39f917){logger[_0x67eb('0xb')](_0x67eb('0x15'),_0x4cf1c2);logger['debug'](_0x67eb('0x15'),_0x4cf1c2,JSON['stringify'](_0x39f917));_0x15b736(_0x39f917);})[_0x67eb('0x20')](function(_0x541a26){logger['error'](_0x67eb('0x15'),_0x541a26['message'],_0x4cf1c2);_0x29fa94(_0x5369bb[_0x67eb('0x11')](0x1f4,_0x541a26[_0x67eb('0x13')]));});});};exports[_0x67eb('0x21')]=function(_0x3442ec){var _0x2fd983=this;return new Promise(function(_0x2926b5,_0x46566e){return db[_0x67eb('0x16')][_0x67eb('0x22')](_0x3442ec[_0x67eb('0x23')],{'raw':_0x3442ec[_0x67eb('0x18')]?_0x3442ec[_0x67eb('0x18')][_0x67eb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3442ec[_0x67eb('0x18')]?_0x3442ec[_0x67eb('0x18')][_0x67eb('0x1a')]||null:null,'attributes':_0x3442ec[_0x67eb('0x18')]?_0x3442ec[_0x67eb('0x18')]['attributes']||null:null,'limit':_0x3442ec['options']?_0x3442ec[_0x67eb('0x18')][_0x67eb('0x1c')]||null:null})[_0x67eb('0xa')](function(_0x159478){logger['info'](_0x67eb('0x21'),_0x3442ec);logger['debug'](_0x67eb('0x21'),_0x3442ec,JSON['stringify'](_0x159478));_0x2926b5(_0x159478);})['catch'](function(_0x58e68c){logger[_0x67eb('0x11')](_0x67eb('0x21'),_0x58e68c[_0x67eb('0x13')],_0x3442ec);_0x46566e(_0x2fd983['error'](0x1f4,_0x58e68c[_0x67eb('0x13')]));});});};exports[_0x67eb('0x24')]=function(_0x1f0cf6){var _0xf83934=this;return new Promise(function(_0x592835,_0x11e50c){return db[_0x67eb('0x16')]['destroy']({'where':_0x1f0cf6[_0x67eb('0x18')]?_0x1f0cf6['options'][_0x67eb('0x1a')]||null:null})[_0x67eb('0xa')](function(_0x1f04c2){logger[_0x67eb('0xb')](_0x67eb('0x24'),_0x1f0cf6);logger[_0x67eb('0xd')](_0x67eb('0x24'),_0x1f0cf6,JSON[_0x67eb('0x10')](_0x1f04c2));_0x592835(_0x1f04c2);})[_0x67eb('0x20')](function(_0x121641){logger[_0x67eb('0x11')](_0x67eb('0x24'),_0x121641[_0x67eb('0x13')],_0x1f0cf6);_0x11e50c(_0xf83934[_0x67eb('0x11')](0x1f4,_0x121641[_0x67eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 94761b6..8dd7e7a 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 _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','show','put','/:id','update','delete'];(function(_0x482c73,_0x3b312b){var _0x4a02a6=function(_0x185cea){while(--_0x185cea){_0x482c73['push'](_0x482c73['shift']());}};_0x4a02a6(++_0x3b312b);}(_0x7046,0x144));var _0x6704=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7046[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller[_0x6704('0x10')]);router[_0x6704('0x11')](_0x6704('0xf'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router; \ No newline at end of file +var _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0xd58cb,_0x21fbea){var _0x4b0d91=function(_0x4c5714){while(--_0x4c5714){_0xd58cb['push'](_0xd58cb['shift']());}};_0x4b0d91(++_0x21fbea);}(_0xf072,0x1cf));var _0x2f07=function(_0x534835,_0x24a844){_0x534835=_0x534835-0x0;var _0x15f523=_0xf072[_0x534835];return _0x15f523;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 84afcca..f5d168a 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 _0x9ba4=['BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds'];(function(_0x397bd2,_0x23670d){var _0x2a81ea=function(_0xce5ac6){while(--_0xce5ac6){_0x397bd2['push'](_0x397bd2['shift']());}};_0x2a81ea(++_0x23670d);}(_0x9ba4,0x123));var _0x49ba=function(_0x55273d,_0x40f3f3){_0x55273d=_0x55273d-0x0;var _0x262a71=_0x9ba4[_0x55273d];return _0x262a71;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x49ba('0x0')]={'state':{'type':Sequelize[_0x49ba('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x49ba('0x2')]},'scheduledat':{'type':Sequelize[_0x49ba('0x3')]},'countbusyretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x49ba('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x49ba('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x49ba('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x49ba('0x3')]},'responsetime':{'type':Sequelize[_0x49ba('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x49ba('0x3')]},'endtime':{'type':Sequelize[_0x49ba('0x3')]},'ringtime':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x49ba('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x49ba('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x49ba('0x2')]},'disposition':{'type':Sequelize[_0x49ba('0x2')]},'secondDisposition':{'type':Sequelize[_0x49ba('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x588f04){var _0x2ece6d=this[_0x49ba('0x4')]('endtime');if(_0x2ece6d&&_0x588f04){this[_0x49ba('0x5')](_0x49ba('0x6'),moment(_0x588f04)[_0x49ba('0x7')](moment(_0x2ece6d),_0x49ba('0x8')));}}},'amd':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x49ba('0x3')]},'callback':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x49ba('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x49ba('0x3')]},'recallme':{'type':Sequelize[_0x49ba('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x49ba('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x49ba('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa405=['sequelize','moment','INTEGER','STRING','DATE','endtime','followuptime','diff','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa405,0x7e));var _0x5a40=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa405[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x5a40('0x0'));var moment=require(_0x5a40('0x1'));module['exports']={'state':{'type':Sequelize[_0x5a40('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5a40('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5a40('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5a40('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5a40('0x3')]},'calleridnum':{'type':Sequelize[_0x5a40('0x3')]},'calleridname':{'type':Sequelize[_0x5a40('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5a40('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5a40('0x4')]},'endtime':{'type':Sequelize[_0x5a40('0x4')]},'ringtime':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5a40('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5a40('0x3')]},'reason':{'type':Sequelize[_0x5a40('0x3')]},'disposition':{'type':Sequelize[_0x5a40('0x3')]},'secondDisposition':{'type':Sequelize[_0x5a40('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5a40('0x3')]},'dispositionat':{'type':Sequelize[_0x5a40('0x4')],'set':function(_0x2634c8){var _0x24d003=this['getDataValue'](_0x5a40('0x5'));if(_0x24d003&&_0x2634c8){this['setDataValue'](_0x5a40('0x6'),moment(_0x2634c8)[_0x5a40('0x7')](moment(_0x24d003),'seconds'));}}},'amd':{'type':Sequelize[_0x5a40('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5a40('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5a40('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5a40('0x4')]},'callback':{'type':Sequelize[_0x5a40('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5a40('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5a40('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5a40('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5a40('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5a40('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e902df2..5358655 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x44fc33,_0x480283){var _0x1e64a1=function(_0x2b642b){while(--_0x2b642b){_0x44fc33['push'](_0x44fc33['shift']());}};_0x1e64a1(++_0x480283);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0xfdbd[_0x45f6cb];return _0x5b7f93;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file +var _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x814b,0x1a2));var _0xb814=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x814b[_0x27604f];return _0x40d189;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2e3d641..1907a86 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 _0xba50=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define'];(function(_0x35b4e4,_0x6b89e5){var _0x5c56ab=function(_0x19ea1c){while(--_0x19ea1c){_0x35b4e4['push'](_0x35b4e4['shift']());}};_0x5c56ab(++_0x6b89e5);}(_0xba50,0xc4));var _0x0ba5=function(_0x2df387,_0x1d3ea1){_0x2df387=_0x2df387-0x0;var _0x3b1708=_0xba50[_0x2df387];return _0x3b1708;};'use strict';var _=require(_0x0ba5('0x0'));var util=require(_0x0ba5('0x1'));var logger=require(_0x0ba5('0x2'))(_0x0ba5('0x3'));var moment=require(_0x0ba5('0x4'));var BPromise=require(_0x0ba5('0x5'));var rp=require(_0x0ba5('0x6'));var fs=require('fs');var path=require(_0x0ba5('0x7'));var rimraf=require('rimraf');var config=require(_0x0ba5('0x8'));var attributes=require(_0x0ba5('0x9'));module[_0x0ba5('0xa')]=function(_0x511c4e,_0x263ec6){return _0x511c4e[_0x0ba5('0xb')](_0x0ba5('0xc'),attributes,{'tableName':_0x0ba5('0xd'),'paranoid':![],'indexes':[{'name':_0x0ba5('0xe'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x0ba5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47c8=['exports','define','CmHopperFinal','cm_hopper_final','util','api','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x122ba8,_0x18d4b0){var _0x5dbb55=function(_0x49ace5){while(--_0x49ace5){_0x122ba8['push'](_0x122ba8['shift']());}};_0x5dbb55(++_0x18d4b0);}(_0x47c8,0x122));var _0x847c=function(_0x197ced,_0x123087){_0x197ced=_0x197ced-0x0;var _0x6b552b=_0x47c8[_0x197ced];return _0x6b552b;};'use strict';var _=require('lodash');var util=require(_0x847c('0x0'));var logger=require('../../config/logger')(_0x847c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x847c('0x2'));var fs=require('fs');var path=require(_0x847c('0x3'));var rimraf=require(_0x847c('0x4'));var config=require(_0x847c('0x5'));var attributes=require(_0x847c('0x6'));module[_0x847c('0x7')]=function(_0x785925,_0x38a07c){return _0x785925[_0x847c('0x8')](_0x847c('0x9'),attributes,{'tableName':_0x847c('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 71bc8e4..9298cb7 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x212801,_0x22b3c7){var _0x1555ac=function(_0x464034){while(--_0x464034){_0x212801['push'](_0x212801['shift']());}};_0x1555ac(++_0x22b3c7);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a1ff7,_0x4e44cb){_0x2a1ff7=_0x2a1ff7-0x0;var _0x168537=_0xb10b[_0x2a1ff7];return _0x168537;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x43081f,_0x2ef3db){var _0x1048e2=function(_0x2902f5){while(--_0x2902f5){_0x43081f['push'](_0x43081f['shift']());}};_0x1048e2(++_0x2ef3db);}(_0xb10b,0x12a));var _0xbb10=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xb10b[_0x888385];return _0x22d5c2;};'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 9d764ae..fd58e54 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 _0xce2e=['/:id','isAuthenticated','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','checkContactHopper','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe'];(function(_0x4ccbda,_0x35803f){var _0x54af89=function(_0x3a2396){while(--_0x3a2396){_0x4ccbda['push'](_0x4ccbda['shift']());}};_0x54af89(++_0x35803f);}(_0xce2e,0x1d8));var _0xece2=function(_0x15ef28,_0xad6108){_0x15ef28=_0x15ef28-0x0;var _0x3b6c49=_0xce2e[_0x15ef28];return _0x3b6c49;};'use strict';var multer=require(_0xece2('0x0'));var util=require(_0xece2('0x1'));var path=require(_0xece2('0x2'));var timeout=require(_0xece2('0x3'));var express=require(_0xece2('0x4'));var router=express[_0xece2('0x5')]();var fs_extra=require(_0xece2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xece2('0x7'));var config=require(_0xece2('0x8'));var controller=require(_0xece2('0x9'));router[_0xece2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xece2('0xa')](_0xece2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xece2('0xa')](_0xece2('0xc'),auth[_0xece2('0xd')](),controller['show']);router[_0xece2('0xa')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xece2('0xe')]);router[_0xece2('0xa')]('/campaign/countAttributes/:id',auth[_0xece2('0xd')](),controller[_0xece2('0xf')]);router[_0xece2('0x10')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xece2('0x11')]);router[_0xece2('0x10')](_0xece2('0x12'),auth[_0xece2('0xd')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0xece2('0xd')](),controller[_0xece2('0x13')]);router[_0xece2('0x14')](_0xece2('0xc'),auth[_0xece2('0xd')](),controller['update']);module[_0xece2('0x15')]=router; \ No newline at end of file +var _0xe20c=['express','Router','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path'];(function(_0x4323cd,_0x9d1cb7){var _0x502dea=function(_0x43ccf0){while(--_0x43ccf0){_0x4323cd['push'](_0x4323cd['shift']());}};_0x502dea(++_0x9d1cb7);}(_0xe20c,0x9f));var _0xce20=function(_0x2889e1,_0x488166){_0x2889e1=_0x2889e1-0x0;var _0x40157b=_0xe20c[_0x2889e1];return _0x40157b;};'use strict';var multer=require(_0xce20('0x0'));var util=require('util');var path=require(_0xce20('0x1'));var timeout=require('connect-timeout');var express=require(_0xce20('0x2'));var router=express[_0xce20('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce20('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0xce20('0x5')](),controller['index']);router[_0xce20('0x6')](_0xce20('0x7'),auth[_0xce20('0x5')](),controller[_0xce20('0x8')]);router[_0xce20('0x6')](_0xce20('0x9'),auth[_0xce20('0x5')](),controller[_0xce20('0xa')]);router[_0xce20('0x6')](_0xce20('0xb'),auth[_0xce20('0x5')](),controller[_0xce20('0xc')]);router[_0xce20('0x6')]('/campaign/countAttributes/:id',auth[_0xce20('0x5')](),controller[_0xce20('0xd')]);router[_0xce20('0xe')](_0xce20('0xf'),auth[_0xce20('0x5')](),controller[_0xce20('0x10')]);router[_0xce20('0xe')]('/voice/campaign/moveContacts/:id',auth[_0xce20('0x5')](),controller[_0xce20('0x11')]);router[_0xce20('0xe')](_0xce20('0x12'),auth[_0xce20('0x5')](),controller[_0xce20('0x13')]);router[_0xce20('0x14')](_0xce20('0x9'),auth[_0xce20('0x5')](),controller[_0xce20('0x15')]);module[_0xce20('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index eeeb076..36266c6 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 _0xda3b=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x48cb7d,_0x3135a1){var _0x417b09=function(_0x354096){while(--_0x354096){_0x48cb7d['push'](_0x48cb7d['shift']());}};_0x417b09(++_0x3135a1);}(_0xda3b,0x18d));var _0xbda3=function(_0x10acce,_0x3459d4){_0x10acce=_0x10acce-0x0;var _0x501ce1=_0xda3b[_0x10acce];return _0x501ce1;};'use strict';var Sequelize=require(_0xbda3('0x0'));module[_0xbda3('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xbda3('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbda3('0x3')]},'calleridnum':{'type':Sequelize[_0xbda3('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xbda3('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xbda3('0x4')]},'droptime':{'type':Sequelize[_0xbda3('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbda3('0x3')]},'campaign':{'type':Sequelize[_0xbda3('0x3')]},'campaigntype':{'type':Sequelize[_0xbda3('0x3')]},'membername':{'type':Sequelize[_0xbda3('0x3')]},'reason':{'type':Sequelize[_0xbda3('0x3')]},'amd':{'type':Sequelize[_0xbda3('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbda3('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbda3('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbda3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xbda3('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbda3('0x4')]},'edited':{'type':Sequelize[_0xbda3('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbda3('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbda3('0x3')]}}; \ No newline at end of file +var _0xb247=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x19dc37,_0x5280e0){var _0xd9acd2=function(_0x1f730f){while(--_0x1f730f){_0x19dc37['push'](_0x19dc37['shift']());}};_0xd9acd2(++_0x5280e0);}(_0xb247,0x98));var _0x7b24=function(_0x6376b0,_0x52d8c1){_0x6376b0=_0x6376b0-0x0;var _0x47ac71=_0xb247[_0x6376b0];return _0x47ac71;};'use strict';var Sequelize=require(_0x7b24('0x0'));module[_0x7b24('0x1')]={'state':{'type':Sequelize[_0x7b24('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7b24('0x3')]},'scheduledat':{'type':Sequelize[_0x7b24('0x4')]},'countbusyretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7b24('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7b24('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7b24('0x4')]},'responsetime':{'type':Sequelize[_0x7b24('0x4')]},'answertime':{'type':Sequelize[_0x7b24('0x4')]},'droptime':{'type':Sequelize[_0x7b24('0x4')]},'endtime':{'type':Sequelize[_0x7b24('0x4')]},'ringtime':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7b24('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7b24('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x7b24('0x3')]},'amd':{'type':Sequelize[_0x7b24('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7b24('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7b24('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7b24('0x4')]},'recallme':{'type':Sequelize[_0x7b24('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7b24('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7b24('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7b24('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 93e7789..3fd25b9 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 _0x44da=['order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','sendStatus','error','stack','send','map','CmHopperHistory','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x16c4a5,_0x575569){var _0x1311ac=function(_0xeeb61c){while(--_0xeeb61c){_0x16c4a5['push'](_0x16c4a5['shift']());}};_0x1311ac(++_0x575569);}(_0x44da,0x12f));var _0xa44d=function(_0x2d9f9e,_0x59355f){_0x2d9f9e=_0x2d9f9e-0x0;var _0xe59409=_0x44da[_0x2d9f9e];return _0xe59409;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa44d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa44d('0x1'));var rp=require(_0xa44d('0x2'));var moment=require(_0xa44d('0x3'));var BPromise=require(_0xa44d('0x4'));var Mustache=require('mustache');var util=require(_0xa44d('0x5'));var path=require(_0xa44d('0x6'));var sox=require('sox');var csv=require(_0xa44d('0x7'));var ejs=require(_0xa44d('0x8'));var fs=require('fs');var fs_extra=require(_0xa44d('0x9'));var _=require(_0xa44d('0xa'));var squel=require(_0xa44d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa44d('0x7'));var querystring=require('querystring');var Papa=require(_0xa44d('0xc'));var Redis=require(_0xa44d('0xd'));var authService=require(_0xa44d('0xe'));var qs=require(_0xa44d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa44d('0x10'))(_0xa44d('0x11'));var utils=require(_0xa44d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa44d('0x13'));var db=require(_0xa44d('0x14'))['db'];function respondWithStatusCode(_0x53e2be,_0xf10a44){_0xf10a44=_0xf10a44||0xcc;return function(_0x5cf777){if(_0x5cf777){return _0x53e2be['sendStatus'](_0xf10a44);}return _0x53e2be[_0xa44d('0x15')](_0xf10a44)[_0xa44d('0x16')]();};}function respondWithResult(_0x108a7a,_0x581324){_0x581324=_0x581324||0xc8;return function(_0x44ad43){if(_0x44ad43){return _0x108a7a[_0xa44d('0x15')](_0x581324)[_0xa44d('0x17')](_0x44ad43);}};}function respondWithFilteredResult(_0x45c880,_0x38c0dc){return function(_0x89cf30){if(_0x89cf30){var _0x29db43=typeof _0x38c0dc[_0xa44d('0x18')]===_0xa44d('0x19')&&typeof _0x38c0dc[_0xa44d('0x1a')]===_0xa44d('0x19');var _0xba8548=_0x89cf30[_0xa44d('0x1b')];var _0x43874f=_0x29db43?0x0:_0x38c0dc['offset'];var _0x1e7bd6=_0x29db43?_0x89cf30[_0xa44d('0x1b')]:_0x38c0dc[_0xa44d('0x18')]+_0x38c0dc[_0xa44d('0x1a')];var _0xbf10b4;if(_0x1e7bd6>=_0xba8548){_0x1e7bd6=_0xba8548;_0xbf10b4=0xc8;}else{_0xbf10b4=0xce;}_0x45c880['status'](_0xbf10b4);return _0x45c880['set'](_0xa44d('0x1c'),_0x43874f+'-'+_0x1e7bd6+'/'+_0xba8548)[_0xa44d('0x17')](_0x89cf30);}return null;};}function patchUpdates(_0x20d466){return function(_0x396ecc){try{jsonpatch[_0xa44d('0x1d')](_0x396ecc,_0x20d466,!![]);}catch(_0x5b936a){return BPromise['reject'](_0x5b936a);}return _0x396ecc['save']();};}function saveUpdates(_0xbaf449,_0x281bfb){return function(_0x3bdcf6){if(_0x3bdcf6){return _0x3bdcf6[_0xa44d('0x1e')](_0xbaf449)[_0xa44d('0x1f')](function(_0x1a99ab){return _0x1a99ab;});}return null;};}function removeEntity(_0x92b8e,_0x576ddd){return function(_0xc69adc){if(_0xc69adc){return _0xc69adc['destroy']()[_0xa44d('0x1f')](function(){_0x92b8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c46c,_0x45cb92){return function(_0x4e8ceb){if(!_0x4e8ceb){_0x36c46c[_0xa44d('0x20')](0x194);}return _0x4e8ceb;};}function handleError(_0x50fdf6,_0x5a1718){_0x5a1718=_0x5a1718||0x1f4;return function(_0x21519e){logger[_0xa44d('0x21')](_0x21519e[_0xa44d('0x22')]);if(_0x21519e['name']){delete _0x21519e['name'];}_0x50fdf6[_0xa44d('0x15')](_0x5a1718)[_0xa44d('0x23')](_0x21519e);};}exports['index']=function(_0x5d31fd,_0x16e893){var _0x49099a={},_0x5dabae={},_0x293633={'count':0x0,'rows':[]};var _0x4ac987=_[_0xa44d('0x24')](db[_0xa44d('0x25')][_0xa44d('0x26')],function(_0x5c140e){return{'name':_0x5c140e[_0xa44d('0x27')],'type':_0x5c140e[_0xa44d('0x28')]['key']};});_0x5dabae[_0xa44d('0x29')]=_[_0xa44d('0x24')](_0x4ac987,_0xa44d('0x2a'));_0x5dabae[_0xa44d('0x2b')]=_[_0xa44d('0x2c')](_0x5d31fd[_0xa44d('0x2b')]);_0x5dabae[_0xa44d('0x2d')]=_[_0xa44d('0x2e')](_0x5dabae[_0xa44d('0x29')],_0x5dabae[_0xa44d('0x2b')]);_0x49099a[_0xa44d('0x2f')]=_[_0xa44d('0x2e')](_0x5dabae[_0xa44d('0x29')],qs[_0xa44d('0x30')](_0x5d31fd[_0xa44d('0x2b')]['fields']));_0x49099a[_0xa44d('0x2f')]=_0x49099a[_0xa44d('0x2f')][_0xa44d('0x31')]?_0x49099a[_0xa44d('0x2f')]:_0x5dabae['model'];if(!_0x5d31fd['query'][_0xa44d('0x32')](_0xa44d('0x33'))){_0x49099a[_0xa44d('0x1a')]=qs[_0xa44d('0x1a')](_0x5d31fd[_0xa44d('0x2b')][_0xa44d('0x1a')]);_0x49099a[_0xa44d('0x18')]=qs[_0xa44d('0x18')](_0x5d31fd[_0xa44d('0x2b')][_0xa44d('0x18')]);}_0x49099a[_0xa44d('0x34')]=qs[_0xa44d('0x35')](_0x5d31fd[_0xa44d('0x2b')][_0xa44d('0x35')]);_0x49099a['where']=qs['filters'](_[_0xa44d('0x36')](_0x5d31fd[_0xa44d('0x2b')],_0x5dabae[_0xa44d('0x2d')]),_0x4ac987);if(_0x5d31fd[_0xa44d('0x2b')][_0xa44d('0x37')]){_0x49099a[_0xa44d('0x38')]=_[_0xa44d('0x39')](_0x49099a[_0xa44d('0x38')],{'$or':_[_0xa44d('0x24')](_0x4ac987,function(_0x356a1e){if(_0x356a1e['type']!==_0xa44d('0x3a')){var _0x10c84a={};_0x10c84a[_0x356a1e['name']]={'$like':'%'+_0x5d31fd[_0xa44d('0x2b')]['filter']+'%'};return _0x10c84a;}})});}_0x49099a=_[_0xa44d('0x39')]({},_0x49099a,_0x5d31fd[_0xa44d('0x3b')]);var _0x59abcd={'where':_0x49099a['where']};return db['CmHopperHistory'][_0xa44d('0x1b')](_0x59abcd)[_0xa44d('0x1f')](function(_0x3927f6){_0x293633[_0xa44d('0x1b')]=_0x3927f6;if(_0x5d31fd['query']['includeAll']){_0x49099a[_0xa44d('0x3c')]=[{'all':!![]}];}return db[_0xa44d('0x25')]['findAll'](_0x49099a);})[_0xa44d('0x1f')](function(_0x56fbbb){_0x293633[_0xa44d('0x3d')]=_0x56fbbb;return _0x293633;})[_0xa44d('0x1f')](respondWithFilteredResult(_0x16e893,_0x49099a))[_0xa44d('0x3e')](handleError(_0x16e893,null));};exports[_0xa44d('0x3f')]=function(_0x2c1f3b,_0x20c895){var _0x374279={'raw':!![],'where':{'id':_0x2c1f3b[_0xa44d('0x40')]['id']}},_0x397371={};_0x397371['model']=_[_0xa44d('0x2c')](db[_0xa44d('0x25')][_0xa44d('0x26')]);_0x397371[_0xa44d('0x2b')]=_['keys'](_0x2c1f3b[_0xa44d('0x2b')]);_0x397371[_0xa44d('0x2d')]=_['intersection'](_0x397371['model'],_0x397371[_0xa44d('0x2b')]);_0x374279[_0xa44d('0x2f')]=_[_0xa44d('0x2e')](_0x397371[_0xa44d('0x29')],qs[_0xa44d('0x30')](_0x2c1f3b[_0xa44d('0x2b')][_0xa44d('0x30')]));_0x374279[_0xa44d('0x2f')]=_0x374279[_0xa44d('0x2f')][_0xa44d('0x31')]?_0x374279[_0xa44d('0x2f')]:_0x397371[_0xa44d('0x29')];if(_0x2c1f3b[_0xa44d('0x2b')][_0xa44d('0x41')]){_0x374279[_0xa44d('0x3c')]=[{'all':!![]}];}_0x374279=_[_0xa44d('0x39')]({},_0x374279,_0x2c1f3b[_0xa44d('0x3b')]);return db[_0xa44d('0x25')][_0xa44d('0x42')](_0x374279)[_0xa44d('0x1f')](handleEntityNotFound(_0x20c895,null))[_0xa44d('0x1f')](respondWithResult(_0x20c895,null))[_0xa44d('0x3e')](handleError(_0x20c895,null));};exports[_0xa44d('0x43')]=function(_0x18bc4f,_0x34286a){return db[_0xa44d('0x25')]['create'](_0x18bc4f[_0xa44d('0x44')],{})['then'](respondWithResult(_0x34286a,0xc9))[_0xa44d('0x3e')](handleError(_0x34286a,null));};exports[_0xa44d('0x45')]=function(_0x5f1b1c,_0x58b132){return db[_0xa44d('0x25')]['describe']()[_0xa44d('0x1f')](respondWithResult(_0x58b132,null))[_0xa44d('0x3e')](handleError(_0x58b132,null));};exports[_0xa44d('0x1e')]=function(_0x29f9a2,_0x496bcf){if(_0x29f9a2['body'][_0xa44d('0x46')]){delete _0x29f9a2[_0xa44d('0x44')]['uniqueid'];}return db[_0xa44d('0x25')]['find']({'where':{'uniqueid':_0x29f9a2[_0xa44d('0x40')]['id']}})['then'](handleEntityNotFound(_0x496bcf,null))[_0xa44d('0x1f')](saveUpdates(_0x29f9a2[_0xa44d('0x44')],null))[_0xa44d('0x1f')](respondWithResult(_0x496bcf,null))[_0xa44d('0x3e')](handleError(_0x496bcf,null));}; \ No newline at end of file +var _0x3543=['save','update','then','destroy','error','name','index','CmHopperHistory','rawAttributes','type','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x5cf337,_0x345992){var _0x2867a0=function(_0x791b0c){while(--_0x791b0c){_0x5cf337['push'](_0x5cf337['shift']());}};_0x2867a0(++_0x345992);}(_0x3543,0xc0));var _0x3354=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3543[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x3354('0x0'));var rimraf=require(_0x3354('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3354('0x2'));var rp=require(_0x3354('0x3'));var moment=require(_0x3354('0x4'));var BPromise=require(_0x3354('0x5'));var Mustache=require(_0x3354('0x6'));var util=require(_0x3354('0x7'));var path=require(_0x3354('0x8'));var sox=require(_0x3354('0x9'));var csv=require(_0x3354('0xa'));var ejs=require(_0x3354('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3354('0xc'));var squel=require(_0x3354('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3354('0xe'));var toCsv=require(_0x3354('0xa'));var querystring=require('querystring');var Papa=require(_0x3354('0xf'));var Redis=require(_0x3354('0x10'));var authService=require(_0x3354('0x11'));var qs=require(_0x3354('0x12'));var as=require(_0x3354('0x13'));var hardwareService=require(_0x3354('0x14'));var logger=require(_0x3354('0x15'))(_0x3354('0x16'));var utils=require('../../config/utils');var config=require(_0x3354('0x17'));var licenseUtil=require(_0x3354('0x18'));var db=require(_0x3354('0x19'))['db'];function respondWithStatusCode(_0x3a59d4,_0xbabfcb){_0xbabfcb=_0xbabfcb||0xcc;return function(_0x14d5a3){if(_0x14d5a3){return _0x3a59d4[_0x3354('0x1a')](_0xbabfcb);}return _0x3a59d4[_0x3354('0x1b')](_0xbabfcb)[_0x3354('0x1c')]();};}function respondWithResult(_0x3a42c7,_0x416d13){_0x416d13=_0x416d13||0xc8;return function(_0x3b12e4){if(_0x3b12e4){return _0x3a42c7[_0x3354('0x1b')](_0x416d13)[_0x3354('0x1d')](_0x3b12e4);}};}function respondWithFilteredResult(_0x1b77f4,_0x17a8d1){return function(_0x5ea8e7){if(_0x5ea8e7){var _0x5f3716=typeof _0x17a8d1[_0x3354('0x1e')]===_0x3354('0x1f')&&typeof _0x17a8d1[_0x3354('0x20')]===_0x3354('0x1f');var _0x3b3f75=_0x5ea8e7[_0x3354('0x21')];var _0x1bf87c=_0x5f3716?0x0:_0x17a8d1['offset'];var _0x927134=_0x5f3716?_0x5ea8e7[_0x3354('0x21')]:_0x17a8d1['offset']+_0x17a8d1[_0x3354('0x20')];var _0x2c3424;if(_0x927134>=_0x3b3f75){_0x927134=_0x3b3f75;_0x2c3424=0xc8;}else{_0x2c3424=0xce;}_0x1b77f4[_0x3354('0x1b')](_0x2c3424);return _0x1b77f4[_0x3354('0x22')]('Content-Range',_0x1bf87c+'-'+_0x927134+'/'+_0x3b3f75)[_0x3354('0x1d')](_0x5ea8e7);}return null;};}function patchUpdates(_0x3b827e){return function(_0x2d309f){try{jsonpatch[_0x3354('0x23')](_0x2d309f,_0x3b827e,!![]);}catch(_0x1180a5){return BPromise['reject'](_0x1180a5);}return _0x2d309f[_0x3354('0x24')]();};}function saveUpdates(_0x3f8d1c,_0x4282a4){return function(_0x42d709){if(_0x42d709){return _0x42d709[_0x3354('0x25')](_0x3f8d1c)[_0x3354('0x26')](function(_0x138650){return _0x138650;});}return null;};}function removeEntity(_0x560576,_0xf0cf56){return function(_0x1dc31f){if(_0x1dc31f){return _0x1dc31f[_0x3354('0x27')]()[_0x3354('0x26')](function(){_0x560576['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7a58,_0x267f6f){return function(_0x435c48){if(!_0x435c48){_0x4c7a58[_0x3354('0x1a')](0x194);}return _0x435c48;};}function handleError(_0x6bf96d,_0x30f740){_0x30f740=_0x30f740||0x1f4;return function(_0x282069){logger[_0x3354('0x28')](_0x282069['stack']);if(_0x282069[_0x3354('0x29')]){delete _0x282069[_0x3354('0x29')];}_0x6bf96d[_0x3354('0x1b')](_0x30f740)['send'](_0x282069);};}exports[_0x3354('0x2a')]=function(_0x4fc981,_0x249928){var _0x3aa9dd={},_0x21e966={},_0x267bcb={'count':0x0,'rows':[]};var _0xc837c8=_['map'](db[_0x3354('0x2b')][_0x3354('0x2c')],function(_0x48b084){return{'name':_0x48b084['fieldName'],'type':_0x48b084[_0x3354('0x2d')][_0x3354('0x2e')]};});_0x21e966['model']=_[_0x3354('0x2f')](_0xc837c8,_0x3354('0x29'));_0x21e966[_0x3354('0x30')]=_[_0x3354('0x31')](_0x4fc981[_0x3354('0x30')]);_0x21e966['filters']=_[_0x3354('0x32')](_0x21e966['model'],_0x21e966[_0x3354('0x30')]);_0x3aa9dd[_0x3354('0x33')]=_[_0x3354('0x32')](_0x21e966[_0x3354('0x34')],qs['fields'](_0x4fc981['query'][_0x3354('0x35')]));_0x3aa9dd[_0x3354('0x33')]=_0x3aa9dd[_0x3354('0x33')][_0x3354('0x36')]?_0x3aa9dd['attributes']:_0x21e966[_0x3354('0x34')];if(!_0x4fc981[_0x3354('0x30')][_0x3354('0x37')](_0x3354('0x38'))){_0x3aa9dd[_0x3354('0x20')]=qs[_0x3354('0x20')](_0x4fc981[_0x3354('0x30')][_0x3354('0x20')]);_0x3aa9dd[_0x3354('0x1e')]=qs['offset'](_0x4fc981[_0x3354('0x30')]['offset']);}_0x3aa9dd['order']=qs[_0x3354('0x39')](_0x4fc981[_0x3354('0x30')][_0x3354('0x39')]);_0x3aa9dd[_0x3354('0x3a')]=qs[_0x3354('0x3b')](_[_0x3354('0x3c')](_0x4fc981[_0x3354('0x30')],_0x21e966['filters']),_0xc837c8);if(_0x4fc981[_0x3354('0x30')][_0x3354('0x3d')]){_0x3aa9dd['where']=_['merge'](_0x3aa9dd[_0x3354('0x3a')],{'$or':_[_0x3354('0x2f')](_0xc837c8,function(_0x55eaac){if(_0x55eaac[_0x3354('0x2d')]!==_0x3354('0x3e')){var _0xc18544={};_0xc18544[_0x55eaac[_0x3354('0x29')]]={'$like':'%'+_0x4fc981[_0x3354('0x30')][_0x3354('0x3d')]+'%'};return _0xc18544;}})});}_0x3aa9dd=_[_0x3354('0x3f')]({},_0x3aa9dd,_0x4fc981['options']);var _0x15afcb={'where':_0x3aa9dd[_0x3354('0x3a')]};return db[_0x3354('0x2b')][_0x3354('0x21')](_0x15afcb)[_0x3354('0x26')](function(_0x44825c){_0x267bcb['count']=_0x44825c;if(_0x4fc981[_0x3354('0x30')][_0x3354('0x40')]){_0x3aa9dd[_0x3354('0x41')]=[{'all':!![]}];}return db[_0x3354('0x2b')][_0x3354('0x42')](_0x3aa9dd);})[_0x3354('0x26')](function(_0x4fa846){_0x267bcb[_0x3354('0x43')]=_0x4fa846;return _0x267bcb;})['then'](respondWithFilteredResult(_0x249928,_0x3aa9dd))[_0x3354('0x44')](handleError(_0x249928,null));};exports[_0x3354('0x45')]=function(_0x109384,_0x53bd86){var _0x55b05b={'raw':!![],'where':{'id':_0x109384[_0x3354('0x46')]['id']}},_0xa96051={};_0xa96051[_0x3354('0x34')]=_[_0x3354('0x31')](db[_0x3354('0x2b')]['rawAttributes']);_0xa96051[_0x3354('0x30')]=_['keys'](_0x109384[_0x3354('0x30')]);_0xa96051[_0x3354('0x3b')]=_[_0x3354('0x32')](_0xa96051[_0x3354('0x34')],_0xa96051[_0x3354('0x30')]);_0x55b05b[_0x3354('0x33')]=_[_0x3354('0x32')](_0xa96051['model'],qs[_0x3354('0x35')](_0x109384['query'][_0x3354('0x35')]));_0x55b05b[_0x3354('0x33')]=_0x55b05b[_0x3354('0x33')][_0x3354('0x36')]?_0x55b05b[_0x3354('0x33')]:_0xa96051[_0x3354('0x34')];if(_0x109384[_0x3354('0x30')][_0x3354('0x40')]){_0x55b05b[_0x3354('0x41')]=[{'all':!![]}];}_0x55b05b=_[_0x3354('0x3f')]({},_0x55b05b,_0x109384['options']);return db[_0x3354('0x2b')]['find'](_0x55b05b)[_0x3354('0x26')](handleEntityNotFound(_0x53bd86,null))[_0x3354('0x26')](respondWithResult(_0x53bd86,null))[_0x3354('0x44')](handleError(_0x53bd86,null));};exports[_0x3354('0x47')]=function(_0x3640d5,_0x346728){return db['CmHopperHistory'][_0x3354('0x47')](_0x3640d5[_0x3354('0x48')],{})[_0x3354('0x26')](respondWithResult(_0x346728,0xc9))[_0x3354('0x44')](handleError(_0x346728,null));};exports[_0x3354('0x49')]=function(_0x21c016,_0x551cd9){return db[_0x3354('0x2b')][_0x3354('0x49')]()[_0x3354('0x26')](respondWithResult(_0x551cd9,null))[_0x3354('0x44')](handleError(_0x551cd9,null));};exports['update']=function(_0x32b984,_0x2403cd){if(_0x32b984['body']['uniqueid']){delete _0x32b984['body'][_0x3354('0x4a')];}return db[_0x3354('0x2b')][_0x3354('0x4b')]({'where':{'uniqueid':_0x32b984[_0x3354('0x46')]['id']}})['then'](handleEntityNotFound(_0x2403cd,null))['then'](saveUpdates(_0x32b984[_0x3354('0x48')],null))[_0x3354('0x26')](respondWithResult(_0x2403cd,null))[_0x3354('0x44')](handleError(_0x2403cd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 305cdc3..1953f61 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 _0x5ae0=['rimraf','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5ae0,0xf8));var _0x05ae=function(_0x4827ed,_0x1cd3d2){_0x4827ed=_0x4827ed-0x0;var _0x3b65bf=_0x5ae0[_0x4827ed];return _0x3b65bf;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var logger=require(_0x05ae('0x1'))('api');var moment=require(_0x05ae('0x2'));var BPromise=require(_0x05ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05ae('0x4'));var rimraf=require(_0x05ae('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x05ae('0x6')]=function(_0x40b966,_0x2c4e6c){return _0x40b966['define'](_0x05ae('0x7'),attributes,{'tableName':_0x05ae('0x8'),'paranoid':![],'indexes':[{'name':_0x05ae('0x9'),'fields':[_0x05ae('0x9')]},{'name':_0x05ae('0xa'),'fields':[_0x05ae('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88c7=['uniqueid','lodash','api','moment','path','rimraf','./cmHopperHistory.attributes','exports','define','endtime'];(function(_0x13ae89,_0x832c38){var _0x1744a0=function(_0x4c406a){while(--_0x4c406a){_0x13ae89['push'](_0x13ae89['shift']());}};_0x1744a0(++_0x832c38);}(_0x88c7,0x6f));var _0x788c=function(_0x12cc56,_0x3062ec){_0x12cc56=_0x12cc56-0x0;var _0x380889=_0x88c7[_0x12cc56];return _0x380889;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x788c('0x1'));var moment=require(_0x788c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x788c('0x3'));var rimraf=require(_0x788c('0x4'));var config=require('../../config/environment');var attributes=require(_0x788c('0x5'));module[_0x788c('0x6')]=function(_0x4e6f8b,_0xbde9d1){return _0x4e6f8b[_0x788c('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x788c('0x8'),'fields':[_0x788c('0x8')]},{'name':_0x788c('0x9'),'fields':[_0x788c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index f0e8f46..21a2959 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 _0x7f1b=['error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2dd2cd,_0x24681b){var _0x3768f2=function(_0x226d71){while(--_0x226d71){_0x2dd2cd['push'](_0x2dd2cd['shift']());}};_0x3768f2(++_0x24681b);}(_0x7f1b,0x12b));var _0xb7f1=function(_0x19a4a6,_0x3930e8){_0x19a4a6=_0x19a4a6-0x0;var _0x4a30c0=_0x7f1b[_0x19a4a6];return _0x4a30c0;};'use strict';var _=require(_0xb7f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb7f1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb7f1('0x2'));var logger=require(_0xb7f1('0x3'))(_0xb7f1('0x4'));var config=require(_0xb7f1('0x5'));var jayson=require(_0xb7f1('0x6'));var client=jayson['client'][_0xb7f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29e686,_0x7a94a1,_0x2504b3){return new BPromise(function(_0x3bee91,_0x463026){return client[_0xb7f1('0x8')](_0x29e686,_0x2504b3)[_0xb7f1('0x9')](function(_0x435f32){logger[_0xb7f1('0xa')](_0xb7f1('0xb'),_0x7a94a1,_0xb7f1('0xc'));logger[_0xb7f1('0xd')](_0xb7f1('0xe'),_0x7a94a1,_0xb7f1('0xc'),JSON[_0xb7f1('0xf')](_0x435f32));if(_0x435f32['error']){if(_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x11')]===0x1f4){logger[_0xb7f1('0x10')](_0xb7f1('0xb'),_0x7a94a1,_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x12')]);return _0x463026(_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x12')]);}logger[_0xb7f1('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x7a94a1,_0x435f32['error'][_0xb7f1('0x12')]);return _0x3bee91(_0x435f32['error']['message']);}else{logger[_0xb7f1('0xa')](_0xb7f1('0xb'),_0x7a94a1,'request\x20sent');_0x3bee91(_0x435f32[_0xb7f1('0x13')][_0xb7f1('0x12')]);}})[_0xb7f1('0x14')](function(_0x3ced85){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x7a94a1,_0x3ced85);_0x463026(_0x3ced85);});});}exports[_0xb7f1('0x15')]=function(_0x195035){var _0x536194=this;return new Promise(function(_0xbc2361,_0x4b7db2){return db[_0xb7f1('0x16')]['create'](_0x195035[_0xb7f1('0x17')],{'raw':_0x195035[_0xb7f1('0x18')]?_0x195035[_0xb7f1('0x18')][_0xb7f1('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xa11f0c){logger[_0xb7f1('0xa')](_0xb7f1('0x15'),_0x195035);logger[_0xb7f1('0xd')]('CreateCmHopperHistory',_0x195035,JSON[_0xb7f1('0xf')](_0xa11f0c));_0xbc2361(_0xa11f0c);})[_0xb7f1('0x14')](function(_0x49f3ad){logger['error'](_0xb7f1('0x15'),_0x49f3ad['message'],_0x195035);_0x4b7db2(_0x536194[_0xb7f1('0x10')](0x1f4,_0x49f3ad['message']));});});};exports[_0xb7f1('0x1a')]=function(_0x25c61a){var _0x243474=this;return new Promise(function(_0xbf1b8e,_0x2ab151){return db[_0xb7f1('0x16')][_0xb7f1('0x1b')]({'raw':_0x25c61a[_0xb7f1('0x18')]?_0x25c61a['options'][_0xb7f1('0x19')]===undefined?!![]:![]:!![],'where':_0x25c61a['options']?_0x25c61a['options'][_0xb7f1('0x1c')]||null:null,'attributes':[[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')][_0xb7f1('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db['sequelize']['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x21')))),_0xb7f1('0x22')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x23')))),_0xb7f1('0x24')],[db['sequelize']['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x26'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xb7f1('0x27')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x26'),db['sequelize']['fn']('IF',db[_0xb7f1('0x1d')]['literal'](_0xb7f1('0x28')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x108861){logger[_0xb7f1('0xa')](_0xb7f1('0x1a'),_0x25c61a);logger[_0xb7f1('0xd')](_0xb7f1('0x1a'),_0x25c61a,JSON[_0xb7f1('0xf')](_0x108861));_0xbf1b8e(_0x108861);})[_0xb7f1('0x14')](function(_0x513276){logger['error'](_0xb7f1('0x1a'),_0x513276[_0xb7f1('0x12')],_0x25c61a);_0x2ab151(_0x243474[_0xb7f1('0x10')](0x1f4,_0x513276[_0xb7f1('0x12')]));});});};exports[_0xb7f1('0x29')]=function(_0x375ec7){var _0x2666c5=this;return new Promise(function(_0x9bdd36,_0x27c247){return db[_0xb7f1('0x16')][_0xb7f1('0x1b')]({'raw':_0x375ec7['options']?_0x375ec7['options'][_0xb7f1('0x19')]===undefined?!![]:![]:!![],'where':_0x375ec7['options']?_0x375ec7[_0xb7f1('0x18')][_0xb7f1('0x1c')]||null:null,'attributes':[[_0xb7f1('0x2a'),_0xb7f1('0x2b')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0xb7f1('0x2c')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')]['literal'](_0xb7f1('0x2d')))),_0xb7f1('0x2e')],[db['sequelize']['fn'](_0xb7f1('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xb7f1('0x20')](_0xb7f1('0x2f')))),_0xb7f1('0x30')],[db[_0xb7f1('0x1d')]['fn']('COUNT',db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x31')))),'outboundDropCallsDayTimeout'],[db[_0xb7f1('0x1d')]['fn']('COUNT',db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb7f1('0x32')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x33')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')]['literal'](_0xb7f1('0x34')))),_0xb7f1('0x35')],[db['sequelize']['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x36')))),_0xb7f1('0x37')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db['sequelize'][_0xb7f1('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x38')))),_0xb7f1('0x39')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x3a')))),_0xb7f1('0x3b')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xb7f1('0x2a')]})[_0xb7f1('0x9')](function(_0x258d0b){logger[_0xb7f1('0xa')](_0xb7f1('0x29'),_0x375ec7);logger['debug']('GetVoiceQueueHopperHistory',_0x375ec7,JSON[_0xb7f1('0xf')](_0x258d0b));_0x9bdd36(_0x258d0b);})[_0xb7f1('0x14')](function(_0x33ce7e){logger[_0xb7f1('0x10')](_0xb7f1('0x29'),_0x33ce7e['message'],_0x375ec7);_0x27c247(_0x2666c5['error'](0x1f4,_0x33ce7e[_0xb7f1('0x12')]));});});};exports[_0xb7f1('0x3c')]=function(_0x365bb4){var _0x35af3d=this;return new Promise(function(_0x164568,_0x524db2){return db[_0xb7f1('0x16')][_0xb7f1('0x1b')]({'raw':_0x365bb4[_0xb7f1('0x18')]?_0x365bb4[_0xb7f1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x365bb4[_0xb7f1('0x18')]?_0x365bb4['options'][_0xb7f1('0x1c')]||null:null,'attributes':[[_0xb7f1('0x2a'),_0xb7f1('0x2b')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')][_0xb7f1('0x1f')]('id')),_0xb7f1('0x3d')],[db[_0xb7f1('0x1d')]['fn'](_0xb7f1('0x1e'),db[_0xb7f1('0x1d')]['fn']('IF',db[_0xb7f1('0x1d')][_0xb7f1('0x20')](_0xb7f1('0x21')))),_0xb7f1('0x3e')]],'group':[_0xb7f1('0x2a')]})[_0xb7f1('0x9')](function(_0x1d96a0){logger['info'](_0xb7f1('0x3c'),_0x365bb4);logger['debug'](_0xb7f1('0x3c'),_0x365bb4,JSON[_0xb7f1('0xf')](_0x1d96a0));_0x164568(_0x1d96a0);})[_0xb7f1('0x14')](function(_0x129989){logger[_0xb7f1('0x10')](_0xb7f1('0x3c'),_0x129989[_0xb7f1('0x12')],_0x365bb4);_0x524db2(_0x35af3d[_0xb7f1('0x10')](0x1f4,_0x129989[_0xb7f1('0x12')]));});});}; \ No newline at end of file +var _0x222f=['literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','debug','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x222f,0x1a4));var _0xf222=function(_0x4b03d3,_0x32f1d2){_0x4b03d3=_0x4b03d3-0x0;var _0x58a968=_0x222f[_0x4b03d3];return _0x58a968;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var moment=require(_0xf222('0x2'));var BPromise=require(_0xf222('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf222('0x4'))['db'];var utils=require(_0xf222('0x5'));var logger=require(_0xf222('0x6'))(_0xf222('0x7'));var config=require('../../config/environment');var jayson=require(_0xf222('0x8'));var client=jayson['client'][_0xf222('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f129,_0x518ebb,_0xf5a105){return new BPromise(function(_0x302d7a,_0x4aceb4){return client[_0xf222('0xa')](_0x26f129,_0xf5a105)[_0xf222('0xb')](function(_0x878804){logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));logger['debug'](_0xf222('0xf'),_0x518ebb,_0xf222('0xe'),JSON[_0xf222('0x10')](_0x878804));if(_0x878804[_0xf222('0x11')]){if(_0x878804['error'][_0xf222('0x12')]===0x1f4){logger[_0xf222('0x11')](_0xf222('0xd'),_0x518ebb,_0x878804[_0xf222('0x11')][_0xf222('0x13')]);return _0x4aceb4(_0x878804[_0xf222('0x11')][_0xf222('0x13')]);}logger[_0xf222('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x518ebb,_0x878804['error'][_0xf222('0x13')]);return _0x302d7a(_0x878804[_0xf222('0x11')]['message']);}else{logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));_0x302d7a(_0x878804[_0xf222('0x14')][_0xf222('0x13')]);}})[_0xf222('0x15')](function(_0x30b646){logger['error'](_0xf222('0xd'),_0x518ebb,_0x30b646);_0x4aceb4(_0x30b646);});});}exports[_0xf222('0x16')]=function(_0x8783ab){var _0xfb4ddf=this;return new Promise(function(_0x12a2e4,_0x1e57ee){return db[_0xf222('0x17')]['create'](_0x8783ab[_0xf222('0x18')],{'raw':_0x8783ab[_0xf222('0x19')]?_0x8783ab[_0xf222('0x19')][_0xf222('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5cd899){logger[_0xf222('0xc')](_0xf222('0x16'),_0x8783ab);logger[_0xf222('0x1b')](_0xf222('0x16'),_0x8783ab,JSON[_0xf222('0x10')](_0x5cd899));_0x12a2e4(_0x5cd899);})[_0xf222('0x15')](function(_0x51b872){logger[_0xf222('0x11')](_0xf222('0x16'),_0x51b872[_0xf222('0x13')],_0x8783ab);_0x1e57ee(_0xfb4ddf[_0xf222('0x11')](0x1f4,_0x51b872[_0xf222('0x13')]));});});};exports[_0xf222('0x1c')]=function(_0x4616de){var _0x144775=this;return new Promise(function(_0x50407b,_0x145e2e){return db[_0xf222('0x17')][_0xf222('0x1d')]({'raw':_0x4616de[_0xf222('0x19')]?_0x4616de[_0xf222('0x19')][_0xf222('0x1a')]===undefined?!![]:![]:!![],'where':_0x4616de[_0xf222('0x19')]?_0x4616de[_0xf222('0x19')][_0xf222('0x1e')]||null:null,'attributes':[[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db['sequelize'][_0xf222('0x21')]('id')),_0xf222('0x22')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x24')))),_0xf222('0x25')],[db['sequelize']['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')]['literal'](_0xf222('0x26')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x27')))),_0xf222('0x28')],[db['sequelize']['fn']('AVG',db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x29')))),_0xf222('0x2a')],[db[_0xf222('0x1f')]['fn']('AVG',db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xf222('0x2b')]]})[_0xf222('0xb')](function(_0x104522){logger['info'](_0xf222('0x1c'),_0x4616de);logger[_0xf222('0x1b')](_0xf222('0x1c'),_0x4616de,JSON['stringify'](_0x104522));_0x50407b(_0x104522);})[_0xf222('0x15')](function(_0x23ed1d){logger[_0xf222('0x11')](_0xf222('0x1c'),_0x23ed1d[_0xf222('0x13')],_0x4616de);_0x145e2e(_0x144775['error'](0x1f4,_0x23ed1d[_0xf222('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x220214){var _0x38db1b=this;return new Promise(function(_0x29d6ff,_0x5eb639){return db[_0xf222('0x17')][_0xf222('0x1d')]({'raw':_0x220214['options']?_0x220214[_0xf222('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x220214[_0xf222('0x19')]?_0x220214[_0xf222('0x19')][_0xf222('0x1e')]||null:null,'attributes':[['campaign',_0xf222('0x2c')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0xf222('0x2d')],[db[_0xf222('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf222('0x1f')]['literal'](_0xf222('0x2e')))),_0xf222('0x2f')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xf222('0x23')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x30')))),'outboundBusyCallsDay'],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db['sequelize']['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xf222('0x31')],[db['sequelize']['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x32')))),_0xf222('0x33')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0xf222('0x34')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db['sequelize'][_0xf222('0x23')](_0xf222('0x35')))),_0xf222('0x36')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x37')))),_0xf222('0x38')],[db['sequelize']['fn']('COUNT',db[_0xf222('0x1f')]['fn']('IF',db['sequelize'][_0xf222('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),_0xf222('0x39')],[db['sequelize']['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0xf222('0x3a')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')](_0xf222('0x3b')))),_0xf222('0x39')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xf222('0x3c')]],'group':[_0xf222('0x3d')]})[_0xf222('0xb')](function(_0xfb75f0){logger[_0xf222('0xc')](_0xf222('0x3e'),_0x220214);logger[_0xf222('0x1b')](_0xf222('0x3e'),_0x220214,JSON[_0xf222('0x10')](_0xfb75f0));_0x29d6ff(_0xfb75f0);})[_0xf222('0x15')](function(_0x19d859){logger['error']('GetVoiceQueueHopperHistory',_0x19d859[_0xf222('0x13')],_0x220214);_0x5eb639(_0x38db1b[_0xf222('0x11')](0x1f4,_0x19d859[_0xf222('0x13')]));});});};exports[_0xf222('0x3f')]=function(_0x43dac3){var _0x6eb194=this;return new Promise(function(_0x22bc07,_0x2002e3){return db[_0xf222('0x17')][_0xf222('0x1d')]({'raw':_0x43dac3[_0xf222('0x19')]?_0x43dac3[_0xf222('0x19')][_0xf222('0x1a')]===undefined?!![]:![]:!![],'where':_0x43dac3[_0xf222('0x19')]?_0x43dac3['options'][_0xf222('0x1e')]||null:null,'attributes':[['campaign',_0xf222('0x2c')],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['col']('id')),'ivrTotalCallsDays'],[db[_0xf222('0x1f')]['fn'](_0xf222('0x20'),db[_0xf222('0x1f')]['fn']('IF',db[_0xf222('0x1f')][_0xf222('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xf222('0x40')]],'group':['campaign']})[_0xf222('0xb')](function(_0x3f9b99){logger['info'](_0xf222('0x3f'),_0x43dac3);logger['debug'](_0xf222('0x3f'),_0x43dac3,JSON[_0xf222('0x10')](_0x3f9b99));_0x22bc07(_0x3f9b99);})[_0xf222('0x15')](function(_0x5c69be){logger[_0xf222('0x11')](_0xf222('0x3f'),_0x5c69be[_0xf222('0x13')],_0x43dac3);_0x2002e3(_0x6eb194[_0xf222('0x11')](0x1f4,_0x5c69be[_0xf222('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1dc8c25..410ba8a 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 _0xcfca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0xa88ff,_0x55379f){var _0x50cd39=function(_0x350407){while(--_0x350407){_0xa88ff['push'](_0xa88ff['shift']());}};_0x50cd39(++_0x55379f);}(_0xcfca,0xf6));var _0xacfc=function(_0x2deebf,_0x27cb84){_0x2deebf=_0x2deebf-0x0;var _0x1c6df8=_0xcfca[_0x2deebf];return _0x1c6df8;};'use strict';var multer=require(_0xacfc('0x0'));var util=require(_0xacfc('0x1'));var path=require(_0xacfc('0x2'));var timeout=require(_0xacfc('0x3'));var express=require(_0xacfc('0x4'));var router=express[_0xacfc('0x5')]();var fs_extra=require(_0xacfc('0x6'));var auth=require(_0xacfc('0x7'));var interaction=require(_0xacfc('0x8'));var config=require(_0xacfc('0x9'));var controller=require('./cmHopperHistory.controller');router[_0xacfc('0xa')]('/',auth['isAuthenticated'](),controller[_0xacfc('0xb')]);router['get'](_0xacfc('0xc'),auth[_0xacfc('0xd')](),controller[_0xacfc('0xe')]);router[_0xacfc('0xa')](_0xacfc('0xf'),auth['isAuthenticated'](),controller[_0xacfc('0x10')]);router[_0xacfc('0x11')]('/',auth[_0xacfc('0xd')](),controller[_0xacfc('0x12')]);router[_0xacfc('0x13')]('/:id',auth[_0xacfc('0xd')](),controller[_0xacfc('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6c30=['isAuthenticated','index','/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x54dabe,_0x562882){var _0x141143=function(_0x389629){while(--_0x389629){_0x54dabe['push'](_0x54dabe['shift']());}};_0x141143(++_0x562882);}(_0x6c30,0x182));var _0x06c3=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x6c30[_0x542da8];return _0x533d7e;};'use strict';var multer=require(_0x06c3('0x0'));var util=require(_0x06c3('0x1'));var path=require(_0x06c3('0x2'));var timeout=require(_0x06c3('0x3'));var express=require(_0x06c3('0x4'));var router=express[_0x06c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x06c3('0x6'));var interaction=require(_0x06c3('0x7'));var config=require(_0x06c3('0x8'));var controller=require('./cmHopperHistory.controller');router[_0x06c3('0x9')]('/',auth[_0x06c3('0xa')](),controller[_0x06c3('0xb')]);router[_0x06c3('0x9')](_0x06c3('0xc'),auth['isAuthenticated'](),controller[_0x06c3('0xd')]);router['get'](_0x06c3('0xe'),auth['isAuthenticated'](),controller[_0x06c3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x06c3('0x10')](_0x06c3('0xe'),auth[_0x06c3('0xa')](),controller[_0x06c3('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 6f87ee4..5fcfe10 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 _0x5af0=['exports','STRING','name','sequelize'];(function(_0x3dab82,_0x2bbbba){var _0x507c45=function(_0x4e2f69){while(--_0x4e2f69){_0x3dab82['push'](_0x3dab82['shift']());}};_0x507c45(++_0x2bbbba);}(_0x5af0,0x1eb));var _0x05af=function(_0x590114,_0x2ca735){_0x590114=_0x590114-0x0;var _0x149e50=_0x5af0[_0x590114];return _0x149e50;};'use strict';var Sequelize=require(_0x05af('0x0'));module[_0x05af('0x1')]={'name':{'type':Sequelize[_0x05af('0x2')],'unique':_0x05af('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x05af('0x2')]},'dialPrefix':{'type':Sequelize[_0x05af('0x2')]}}; \ No newline at end of file +var _0x76bb=['STRING','name','exports'];(function(_0x1df40d,_0x5757c0){var _0x4e0a57=function(_0x2a8dca){while(--_0x2a8dca){_0x1df40d['push'](_0x1df40d['shift']());}};_0x4e0a57(++_0x5757c0);}(_0x76bb,0x16a));var _0xb76b=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x76bb[_0x4503df];return _0x3f1b2b;};'use strict';var Sequelize=require('sequelize');module[_0xb76b('0x0')]={'name':{'type':Sequelize[_0xb76b('0x1')],'unique':_0xb76b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb76b('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c99fdb7..7e11150 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 _0x5c98=['errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','ContactItemType','alias','select','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','now','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','Lists','end','error','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','getDispositions','findOne','Disposition','nolimit','pick','removeDispositions','ids','addContacts','tags','isArray','push','each','CmContact','omit','success'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x5c98,0xd4));var _0x85c9=function(_0x2c3000,_0x414590){_0x2c3000=_0x2c3000-0x0;var _0x4846df=_0x5c98[_0x2c3000];return _0x4846df;};'use strict';var emlformat=require(_0x85c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85c9('0x1'));var jsonpatch=require(_0x85c9('0x2'));var rp=require(_0x85c9('0x3'));var moment=require('moment');var BPromise=require(_0x85c9('0x4'));var Mustache=require(_0x85c9('0x5'));var util=require(_0x85c9('0x6'));var path=require(_0x85c9('0x7'));var sox=require('sox');var csv=require(_0x85c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85c9('0x9'));var squel=require(_0x85c9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85c9('0xb'));var toCsv=require(_0x85c9('0x8'));var querystring=require(_0x85c9('0xc'));var Papa=require(_0x85c9('0xd'));var Redis=require('ioredis');var authService=require(_0x85c9('0xe'));var qs=require(_0x85c9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85c9('0x10'))(_0x85c9('0x11'));var utils=require('../../config/utils');var config=require(_0x85c9('0x12'));var licenseUtil=require(_0x85c9('0x13'));var db=require(_0x85c9('0x14'))['db'];var csv_results;config[_0x85c9('0x15')]=_['defaults'](config[_0x85c9('0x15')],{'host':_0x85c9('0x16'),'port':0x18eb});var socket=require(_0x85c9('0x17'))(new Redis(config['redis']));require(_0x85c9('0x18'))[_0x85c9('0x19')](socket);function respondWithStatusCode(_0x391cbd,_0x4b5984){_0x4b5984=_0x4b5984||0xcc;return function(_0x54dc32){if(_0x54dc32){return _0x391cbd[_0x85c9('0x1a')](_0x4b5984);}return _0x391cbd[_0x85c9('0x1b')](_0x4b5984)['end']();};}function respondWithResult(_0x36d2d6,_0x30d24a){_0x30d24a=_0x30d24a||0xc8;return function(_0x3393be){if(_0x3393be){return _0x36d2d6[_0x85c9('0x1b')](_0x30d24a)[_0x85c9('0x1c')](_0x3393be);}};}function respondWithFilteredResult(_0x30c657,_0x41f1dd){return function(_0x8ec672){if(_0x8ec672){var _0x59926e=typeof _0x41f1dd[_0x85c9('0x1d')]==='undefined'&&typeof _0x41f1dd['limit']===_0x85c9('0x1e');var _0x129034=_0x8ec672['count'];var _0x3e38c3=_0x59926e?0x0:_0x41f1dd['offset'];var _0x3102d7=_0x59926e?_0x8ec672[_0x85c9('0x1f')]:_0x41f1dd[_0x85c9('0x1d')]+_0x41f1dd[_0x85c9('0x20')];var _0x108ebc;if(_0x3102d7>=_0x129034){_0x3102d7=_0x129034;_0x108ebc=0xc8;}else{_0x108ebc=0xce;}_0x30c657[_0x85c9('0x1b')](_0x108ebc);return _0x30c657[_0x85c9('0x21')](_0x85c9('0x22'),_0x3e38c3+'-'+_0x3102d7+'/'+_0x129034)[_0x85c9('0x1c')](_0x8ec672);}return null;};}function patchUpdates(_0x5f0d12){return function(_0x2837cd){try{jsonpatch[_0x85c9('0x23')](_0x2837cd,_0x5f0d12,!![]);}catch(_0x4e4f41){return BPromise['reject'](_0x4e4f41);}return _0x2837cd['save']();};}function saveUpdates(_0x424efe,_0x2d4f63){return function(_0x1f5f7f){if(_0x1f5f7f){return _0x1f5f7f[_0x85c9('0x24')](_0x424efe)[_0x85c9('0x25')](function(_0x52da89){return _0x52da89;});}return null;};}function removeEntity(_0x49c90a,_0x2e9095){return function(_0x18d8b3){if(_0x18d8b3){return _0x18d8b3[_0x85c9('0x26')]()['then'](function(){var _0x560fff=_0x18d8b3['get']({'plain':!![]});var _0x9c6789=_0x85c9('0x27');return db['UserProfileResource'][_0x85c9('0x26')]({'where':{'type':_0x9c6789,'resourceId':_0x560fff['id']}})[_0x85c9('0x25')](function(){return _0x18d8b3;});})[_0x85c9('0x25')](function(){_0x49c90a[_0x85c9('0x1b')](0xcc)[_0x85c9('0x28')]();});}};}function handleEntityNotFound(_0x312703,_0x759edb){return function(_0x58e52f){if(!_0x58e52f){_0x312703[_0x85c9('0x1a')](0x194);}return _0x58e52f;};}function handleError(_0x588106,_0x4d6ab7){_0x4d6ab7=_0x4d6ab7||0x1f4;return function(_0x3aa3d9){logger[_0x85c9('0x29')](_0x3aa3d9['stack']);if(_0x3aa3d9[_0x85c9('0x2a')]){delete _0x3aa3d9['name'];}_0x588106['status'](_0x4d6ab7)[_0x85c9('0x2b')](_0x3aa3d9);};}exports[_0x85c9('0x2c')]=function(_0x2120c5,_0x2926af){var _0x44ef19={},_0x2ce133={},_0x24c572={'count':0x0,'rows':[]};var _0x2cecf2=_['map'](db[_0x85c9('0x2d')][_0x85c9('0x2e')],function(_0xcce41){return{'name':_0xcce41[_0x85c9('0x2f')],'type':_0xcce41[_0x85c9('0x30')][_0x85c9('0x31')]};});_0x2ce133[_0x85c9('0x32')]=_[_0x85c9('0x33')](_0x2cecf2,_0x85c9('0x2a'));_0x2ce133['query']=_[_0x85c9('0x34')](_0x2120c5[_0x85c9('0x35')]);_0x2ce133[_0x85c9('0x36')]=_[_0x85c9('0x37')](_0x2ce133['model'],_0x2ce133[_0x85c9('0x35')]);_0x44ef19['attributes']=_[_0x85c9('0x37')](_0x2ce133[_0x85c9('0x32')],qs[_0x85c9('0x38')](_0x2120c5[_0x85c9('0x35')][_0x85c9('0x38')]));_0x44ef19[_0x85c9('0x39')]=_0x44ef19[_0x85c9('0x39')][_0x85c9('0x3a')]?_0x44ef19[_0x85c9('0x39')]:_0x2ce133[_0x85c9('0x32')];if(!_0x2120c5[_0x85c9('0x35')][_0x85c9('0x3b')]('nolimit')){_0x44ef19[_0x85c9('0x20')]=qs[_0x85c9('0x20')](_0x2120c5[_0x85c9('0x35')]['limit']);_0x44ef19[_0x85c9('0x1d')]=qs[_0x85c9('0x1d')](_0x2120c5[_0x85c9('0x35')][_0x85c9('0x1d')]);}_0x44ef19[_0x85c9('0x3c')]=qs[_0x85c9('0x3d')](_0x2120c5['query']['sort']);_0x44ef19[_0x85c9('0x3e')]=qs[_0x85c9('0x36')](_['pick'](_0x2120c5['query'],_0x2ce133[_0x85c9('0x36')]),_0x2cecf2);if(_0x2120c5[_0x85c9('0x35')][_0x85c9('0x3f')]){_0x44ef19['where']=_[_0x85c9('0x40')](_0x44ef19[_0x85c9('0x3e')],{'$or':_[_0x85c9('0x33')](_0x2cecf2,function(_0x18bdac){if(_0x18bdac['type']!==_0x85c9('0x41')){var _0x382645={};_0x382645[_0x18bdac['name']]={'$like':'%'+_0x2120c5[_0x85c9('0x35')][_0x85c9('0x3f')]+'%'};return _0x382645;}})});}_0x44ef19=_['merge']({},_0x44ef19,_0x2120c5[_0x85c9('0x42')]);var _0x1d05d6={'where':_0x44ef19[_0x85c9('0x3e')]};return db[_0x85c9('0x2d')][_0x85c9('0x1f')](_0x1d05d6)['then'](function(_0x7e2be3){_0x24c572[_0x85c9('0x1f')]=_0x7e2be3;if(_0x2120c5['query'][_0x85c9('0x43')]){_0x44ef19[_0x85c9('0x44')]=[{'all':!![]}];}return db[_0x85c9('0x2d')][_0x85c9('0x45')](_0x44ef19);})[_0x85c9('0x25')](function(_0x484278){_0x24c572['rows']=_0x484278;return _0x24c572;})[_0x85c9('0x25')](respondWithFilteredResult(_0x2926af,_0x44ef19))[_0x85c9('0x46')](handleError(_0x2926af,null));};exports['show']=function(_0x26fde5,_0x5c8be7){var _0x588faf={'raw':![],'where':{'id':_0x26fde5[_0x85c9('0x47')]['id']}},_0x4be40d={};_0x4be40d['model']=_[_0x85c9('0x34')](db['CmList'][_0x85c9('0x2e')]);_0x4be40d['query']=_[_0x85c9('0x34')](_0x26fde5['query']);_0x4be40d[_0x85c9('0x36')]=_[_0x85c9('0x37')](_0x4be40d[_0x85c9('0x32')],_0x4be40d['query']);_0x588faf[_0x85c9('0x39')]=_[_0x85c9('0x37')](_0x4be40d[_0x85c9('0x32')],qs['fields'](_0x26fde5[_0x85c9('0x35')][_0x85c9('0x38')]));_0x588faf[_0x85c9('0x39')]=_0x588faf['attributes'][_0x85c9('0x3a')]?_0x588faf[_0x85c9('0x39')]:_0x4be40d[_0x85c9('0x32')];if(_0x26fde5[_0x85c9('0x35')]['includeAll']){_0x588faf['include']=[{'all':!![]}];}_0x588faf=_[_0x85c9('0x40')]({},_0x588faf,_0x26fde5[_0x85c9('0x42')]);return db['CmList']['find'](_0x588faf)[_0x85c9('0x25')](handleEntityNotFound(_0x5c8be7,null))[_0x85c9('0x25')](respondWithResult(_0x5c8be7,null))['catch'](handleError(_0x5c8be7,null));};exports[_0x85c9('0x48')]=function(_0x14f5d0,_0x2bc473){return db[_0x85c9('0x2d')][_0x85c9('0x48')](_0x14f5d0[_0x85c9('0x49')],{})['then'](function(_0x410043){var _0xe488ea=_0x14f5d0[_0x85c9('0x4a')][_0x85c9('0x4b')]({'plain':!![]});if(!_0xe488ea)throw new Error(_0x85c9('0x4c'));if(_0xe488ea[_0x85c9('0x4d')]===_0x85c9('0x4a')){var _0x23a2ab=_0x410043[_0x85c9('0x4b')]({'plain':!![]});var _0x7649dd=_0x85c9('0x27');return db[_0x85c9('0x4e')][_0x85c9('0x4f')]({'where':{'name':_0x7649dd,'userProfileId':_0xe488ea['userProfileId']},'raw':!![]})[_0x85c9('0x25')](function(_0x414d86){if(_0x414d86&&_0x414d86[_0x85c9('0x50')]===0x0){return db[_0x85c9('0x51')]['create']({'name':_0x23a2ab[_0x85c9('0x2a')],'resourceId':_0x23a2ab['id'],'type':_0x414d86['name'],'sectionId':_0x414d86['id']},{})['then'](function(){return _0x410043;});}else{return _0x410043;}})[_0x85c9('0x46')](function(_0x5a1a6b){logger[_0x85c9('0x29')](_0x85c9('0x52'),_0x5a1a6b);throw _0x5a1a6b;});}return _0x410043;})['then'](respondWithResult(_0x2bc473,0xc9))[_0x85c9('0x46')](handleError(_0x2bc473,null));};exports[_0x85c9('0x24')]=function(_0x2e722d,_0x344270){if(_0x2e722d[_0x85c9('0x49')]['id']){delete _0x2e722d[_0x85c9('0x49')]['id'];}return db[_0x85c9('0x2d')][_0x85c9('0x4f')]({'where':{'id':_0x2e722d['params']['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x344270,null))['then'](saveUpdates(_0x2e722d[_0x85c9('0x49')],null))['then'](respondWithResult(_0x344270,null))[_0x85c9('0x46')](handleError(_0x344270,null));};exports[_0x85c9('0x26')]=function(_0x108963,_0x25cab2){return db[_0x85c9('0x2d')][_0x85c9('0x4f')]({'where':{'id':_0x108963[_0x85c9('0x47')]['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x25cab2,null))[_0x85c9('0x25')](removeEntity(_0x25cab2,null))[_0x85c9('0x46')](handleError(_0x25cab2,null));};exports['describe']=function(_0x3cf8a8,_0xa8cd6){return db[_0x85c9('0x2d')][_0x85c9('0x53')]()['then'](respondWithResult(_0xa8cd6,null))[_0x85c9('0x46')](handleError(_0xa8cd6,null));};exports['addDisposition']=function(_0x210ad9,_0x2b3885,_0x5f4391){if(_0x210ad9['body']['id']){delete _0x210ad9[_0x85c9('0x49')]['id'];}return db[_0x85c9('0x2d')][_0x85c9('0x4f')]({'where':{'id':_0x210ad9[_0x85c9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b3885,null))[_0x85c9('0x25')](function(_0x32c2ae){if(_0x32c2ae){_0x210ad9[_0x85c9('0x49')][_0x85c9('0x54')]=_0x32c2ae['id'];return db['Disposition'][_0x85c9('0x48')](_0x210ad9[_0x85c9('0x49')]);}})[_0x85c9('0x25')](respondWithResult(_0x2b3885,null))[_0x85c9('0x46')](handleError(_0x2b3885,null));};exports[_0x85c9('0x55')]=function(_0x5b4ca9,_0x35670f,_0x2d3ea0){var _0x190f73={'raw':![],'where':{}};var _0x3f3480={};var _0x284846={'count':0x0,'rows':[]};return db[_0x85c9('0x2d')][_0x85c9('0x56')]({'where':{'id':_0x5b4ca9[_0x85c9('0x47')]['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x35670f,null))[_0x85c9('0x25')](function(_0x1c6346){if(_0x1c6346){_0x3f3480[_0x85c9('0x32')]=_[_0x85c9('0x34')](db[_0x85c9('0x57')]['rawAttributes']);_0x3f3480[_0x85c9('0x35')]=_[_0x85c9('0x34')](_0x5b4ca9[_0x85c9('0x35')]);_0x3f3480['filters']=_[_0x85c9('0x37')](_0x3f3480['model'],_0x3f3480[_0x85c9('0x35')]);_0x190f73[_0x85c9('0x39')]=_[_0x85c9('0x37')](_0x3f3480[_0x85c9('0x32')],qs[_0x85c9('0x38')](_0x5b4ca9['query'][_0x85c9('0x38')]));_0x190f73[_0x85c9('0x39')]=_0x190f73[_0x85c9('0x39')][_0x85c9('0x3a')]?_0x190f73['attributes']:_0x3f3480[_0x85c9('0x32')];if(!_0x5b4ca9[_0x85c9('0x35')][_0x85c9('0x3b')](_0x85c9('0x58'))){_0x190f73[_0x85c9('0x20')]=qs[_0x85c9('0x20')](_0x5b4ca9['query'][_0x85c9('0x20')]);_0x190f73['offset']=qs[_0x85c9('0x1d')](_0x5b4ca9[_0x85c9('0x35')]['offset']);}_0x190f73[_0x85c9('0x3c')]=qs['sort'](_0x5b4ca9[_0x85c9('0x35')][_0x85c9('0x3d')]);_0x190f73['where']=qs[_0x85c9('0x36')](_[_0x85c9('0x59')](_0x5b4ca9[_0x85c9('0x35')],_0x3f3480[_0x85c9('0x36')]));_0x190f73[_0x85c9('0x3e')][_0x85c9('0x54')]=_0x1c6346['id'];if(_0x5b4ca9[_0x85c9('0x35')][_0x85c9('0x3f')]){_0x190f73[_0x85c9('0x3e')]=_[_0x85c9('0x40')](_0x190f73[_0x85c9('0x3e')],{'$or':_['map'](_0x190f73[_0x85c9('0x39')],function(_0x2d3fde){var _0x17e1c6={};_0x17e1c6[_0x2d3fde]={'$like':'%'+_0x5b4ca9['query'][_0x85c9('0x3f')]+'%'};return _0x17e1c6;})});}_0x190f73=_[_0x85c9('0x40')]({},_0x190f73,_0x5b4ca9['options']);return db[_0x85c9('0x57')]['count']({'where':_0x190f73[_0x85c9('0x3e')]})['then'](function(_0x11fc83){_0x284846['count']=_0x11fc83;if(_0x5b4ca9['query'][_0x85c9('0x43')]){_0x190f73['include']=[{'all':!![]}];}return db['Disposition'][_0x85c9('0x45')](_0x190f73);})[_0x85c9('0x25')](function(_0x573799){_0x284846['rows']=_0x573799;return _0x284846;});}})[_0x85c9('0x25')](respondWithFilteredResult(_0x35670f,_0x190f73))['catch'](handleError(_0x35670f,null));};exports[_0x85c9('0x5a')]=function(_0x2bf310,_0x416415,_0x3940f0){return db['CmList'][_0x85c9('0x4f')]({'where':{'id':_0x2bf310[_0x85c9('0x47')]['id']}})['then'](handleEntityNotFound(_0x416415,null))['then'](function(_0x20fec8){if(_0x20fec8){return _0x20fec8[_0x85c9('0x5a')](_0x2bf310[_0x85c9('0x35')][_0x85c9('0x5b')]);}})[_0x85c9('0x25')](respondWithStatusCode(_0x416415,null))[_0x85c9('0x46')](handleError(_0x416415,null));};exports[_0x85c9('0x5c')]=function(_0x21a146,_0x5d15e8,_0x48b837){return db[_0x85c9('0x2d')][_0x85c9('0x4f')]({'where':{'id':_0x21a146['params']['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x5d15e8,null))[_0x85c9('0x25')](function(_0x6393c3){if(_0x6393c3){var _0x916811=[];var _0xa5411e={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x85c9('0x25')](function(_0x4c65e3){if(_0x21a146[_0x85c9('0x49')][_0x85c9('0x5d')]&&_[_0x85c9('0x5e')](_0x21a146[_0x85c9('0x49')][_0x85c9('0x5d')])){if(_0x21a146['body'][_0x85c9('0x5d')]['length']){_0x21a146[_0x85c9('0x49')]['tags']=_0x21a146[_0x85c9('0x49')]['tags']['join'](';')+';';}else{_0x21a146[_0x85c9('0x49')][_0x85c9('0x5d')]=null;}}else{_0x21a146[_0x85c9('0x49')][_0x85c9('0x5d')]=null;}if(_0x21a146['body']&&_['isArray'](_0x21a146[_0x85c9('0x49')])){for(var _0x3441dd=0x0;_0x3441dd<_0x21a146[_0x85c9('0x49')]['length'];_0x3441dd+=0x1){_0x21a146[_0x85c9('0x49')][_0x3441dd][_0x85c9('0x54')]=_0x21a146[_0x85c9('0x47')]['id'];_0x916811[_0x85c9('0x5f')](_0x21a146[_0x85c9('0x49')][_0x3441dd]);}return BPromise[_0x85c9('0x60')](_0x916811,function(_0x546c4f){return db[_0x85c9('0x61')][_0x85c9('0x48')](_[_0x85c9('0x62')](_0x546c4f,['ids','id'])||{},{'fields':_[_0x85c9('0x34')](_0x4c65e3),'raw':!![]})[_0x85c9('0x25')](function(_0x237ac7){_0xa5411e[_0x85c9('0x63')][_0x85c9('0x5f')](_0x237ac7['dataValues']);})['catch'](function(_0xf20385){_0xa5411e[_0x85c9('0x64')][_0x85c9('0x5f')]({'data':_0x546c4f,'error':_0xf20385[_0x85c9('0x65')]});});})[_0x85c9('0x25')](function(_0x32ce43){return _0xa5411e;})[_0x85c9('0x46')](function(_0x6aaa2d){return _0x6aaa2d;});}else{_0x5d15e8[_0x85c9('0x1b')](0x190)[_0x85c9('0x1c')]({'message':_0x85c9('0x66')});}});}})[_0x85c9('0x25')](respondWithResult(_0x5d15e8,null))[_0x85c9('0x46')](handleError(_0x5d15e8,null));};exports[_0x85c9('0x67')]=function(_0x1bf388,_0x70daa7,_0x1d3780){var _0x1533bd;return db[_0x85c9('0x2d')][_0x85c9('0x4f')]({'where':{'id':_0x1bf388[_0x85c9('0x47')]['id']},'include':[{'model':db[_0x85c9('0x68')],'as':_0x85c9('0x69')}]})[_0x85c9('0x25')](handleEntityNotFound(_0x70daa7,null))['then'](function(_0xb706e1){if(_0xb706e1){_0x1533bd=_0xb706e1;return db[_0x85c9('0x61')][_0x85c9('0x2e')];}})[_0x85c9('0x25')](function(_0x598e20){if(_0x598e20){var _0x3f19e3={};var _0xa48a0c={};_0xa48a0c[_0x85c9('0x32')]=_[_0x85c9('0x6a')](_[_0x85c9('0x34')](_0x598e20),_[_0x85c9('0x33')](_0x1533bd[_0x85c9('0x69')],function(_0x27563d){return util[_0x85c9('0x6b')]('cf_%d',_0x27563d['id']);}));_0xa48a0c['query']=_['keys'](_0x1bf388[_0x85c9('0x35')]);_0xa48a0c[_0x85c9('0x36')]=_[_0x85c9('0x37')](_0xa48a0c[_0x85c9('0x32')],_0xa48a0c[_0x85c9('0x35')]);_0x3f19e3[_0x85c9('0x39')]=_['intersection'](_0xa48a0c['model'],qs[_0x85c9('0x38')](_0x1bf388[_0x85c9('0x35')][_0x85c9('0x38')]));_0x3f19e3[_0x85c9('0x39')]=_0x3f19e3[_0x85c9('0x39')][_0x85c9('0x3a')]?_0x3f19e3['attributes']:_0xa48a0c['model'];if(!_0x1bf388['query'][_0x85c9('0x3b')](_0x85c9('0x58'))){_0x3f19e3['limit']=qs['limit'](_0x1bf388[_0x85c9('0x35')][_0x85c9('0x20')]);_0x3f19e3[_0x85c9('0x1d')]=qs[_0x85c9('0x1d')](_0x1bf388[_0x85c9('0x35')][_0x85c9('0x1d')]);}_0x3f19e3[_0x85c9('0x3c')]=qs[_0x85c9('0x3d')](_0x1bf388[_0x85c9('0x35')][_0x85c9('0x3d')]);_0x3f19e3[_0x85c9('0x3e')]=qs[_0x85c9('0x36')](_[_0x85c9('0x59')](_0x1bf388[_0x85c9('0x35')],_0xa48a0c[_0x85c9('0x36')]));_0x3f19e3[_0x85c9('0x6c')]=!![];if(_0x1bf388[_0x85c9('0x35')][_0x85c9('0x3f')]){_0x3f19e3['where']=_['merge'](_0x3f19e3[_0x85c9('0x3e')],{'$or':_[_0x85c9('0x33')](_0x3f19e3[_0x85c9('0x39')],function(_0x39b969){var _0x28002f={};_0x28002f[_0x39b969]={'$like':'%'+_0x1bf388[_0x85c9('0x35')][_0x85c9('0x3f')]+'%'};return _0x28002f;})});}_0x3f19e3=_[_0x85c9('0x40')]({},_0x3f19e3,_0x1bf388[_0x85c9('0x42')]);return _0x1533bd['getContacts'](_0x3f19e3);}})['then'](respondWithResult(_0x70daa7,null))[_0x85c9('0x46')](handleError(_0x70daa7,null));};exports['getContactsCsv']=function(_0x4c7a15,_0x3d6bd2,_0x5936cd){var _0x37c322;var _0x8005df;var _0x57b8b2;var _0x390d33=_0x4c7a15[_0x85c9('0x47')]['id'];csv_results=[];return db[_0x85c9('0x6d')][_0x85c9('0x45')]({'attributes':['id',_0x85c9('0x2a')],'raw':!![],'order':['OrderBy']})[_0x85c9('0x25')](function(_0x5a3794){_0x37c322=_0x5a3794;var _0x2f448c=_[_0x85c9('0x34')](db[_0x85c9('0x61')][_0x85c9('0x2e')]);return db[_0x85c9('0x68')][_0x85c9('0x45')]({'raw':!![],'attributes':['id',_0x85c9('0x6e')]})[_0x85c9('0x25')](function(_0x43c160){_0x8005df=_0x43c160;var _0x4ee925=squel[_0x85c9('0x6f')]()[_0x85c9('0x38')](_0x2f448c)['from'](_0x85c9('0x70'),'c')['where'](_0x85c9('0x71'),_0x390d33)['where']('c.deletedAt\x20is\x20null')[_0x85c9('0x72')]();for(var _0x33af4f=0x0;_0x33af4f<_0x8005df[_0x85c9('0x3a')];_0x33af4f++){_0x4ee925[_0x85c9('0x73')](_0x85c9('0x74')+_0x8005df[_0x33af4f]['id'],_0x85c9('0x75')+_0x8005df[_0x33af4f]['alias']);}for(var _0x33af4f=0x0;_0x33af4f<_0x37c322[_0x85c9('0x3a')];_0x33af4f++){_0x4ee925[_0x85c9('0x73')](squel[_0x85c9('0x6f')]()['field'](_0x85c9('0x76'))[_0x85c9('0x77')](_0x85c9('0x78'))[_0x85c9('0x3e')](_0x85c9('0x79'),_0x37c322[_0x33af4f]['id'])[_0x85c9('0x3e')]('CmContactId\x20=\x20c.id'),_0x85c9('0x7a')+_0x37c322[_0x33af4f][_0x85c9('0x2a')]);_0x4ee925[_0x85c9('0x73')](squel[_0x85c9('0x6f')]()['field'](_0x85c9('0x7b'))[_0x85c9('0x77')](_0x85c9('0x78'))[_0x85c9('0x3e')](_0x85c9('0x79'),_0x37c322[_0x33af4f]['id'])[_0x85c9('0x3e')](_0x85c9('0x7c')),'description_additionalPhone_'+_0x37c322[_0x33af4f][_0x85c9('0x2a')]);}var _0x163d3d=[];_0x163d3d[_0x85c9('0x5f')](_0x4ee925[_0x85c9('0x7d')]());BPromise[_0x85c9('0x60')](_0x163d3d,handleQuery)[_0x85c9('0x25')](function(_0x2e1eae){handleQuery(_0x4ee925[_0x85c9('0x7d')]());var _0x499a58=csv_results[0x0];if(!_['isEmpty'](_0x499a58)){var _0x2ea2d7=toCsv(_0x499a58);var _0x12fc5e=Date[_0x85c9('0x7e')]();fs['writeFileSync'](util[_0x85c9('0x6b')](_0x85c9('0x7f'),_0x390d33,_0x12fc5e),_0x2ea2d7);_0x3d6bd2['setHeader']('Content-disposition',_0x85c9('0x80')+util[_0x85c9('0x6b')](_0x85c9('0x81'),_0x390d33,_0x12fc5e));_0x3d6bd2[_0x85c9('0x82')]('Content-type',_0x85c9('0x83'));return _0x3d6bd2[_0x85c9('0x84')](util[_0x85c9('0x6b')]('/tmp/list_%d_%s.csv',_0x390d33,_0x12fc5e));}else{return _0x3d6bd2[_0x85c9('0x1a')](0xcc);}});});});};exports[_0x85c9('0x85')]=function(_0x261b51,_0x23fe93,_0x65af77){var _0x29a245;delete _0x261b51[_0x85c9('0x49')]['id'];return db['CmList'][_0x85c9('0x56')]({'where':{'id':_0x261b51[_0x85c9('0x47')]['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x23fe93,null))[_0x85c9('0x25')](function(_0x43bbaa){if(_0x43bbaa){return db['sequelize'][_0x85c9('0x86')](function(_0x49f8f9){return db['CmCustomField'][_0x85c9('0x48')](_0x261b51['body'],{'transaction':_0x49f8f9})[_0x85c9('0x25')](function(_0x375e20){_0x29a245=_0x375e20;return _0x43bbaa[_0x85c9('0x87')](_0x375e20,{'transaction':_0x49f8f9});})[_0x85c9('0x25')](function(){var _0x4495de={'type':db[_0x85c9('0x88')][_0x85c9('0x89')],'transaction':_0x49f8f9};switch(_0x261b51[_0x85c9('0x49')][_0x85c9('0x30')]){case'text':_0x4495de[_0x85c9('0x30')]=db[_0x85c9('0x88')][_0x85c9('0x89')];break;case _0x85c9('0x8a'):_0x4495de[_0x85c9('0x30')]=db[_0x85c9('0x88')][_0x85c9('0x8b')];break;case'switch':_0x4495de['type']=db[_0x85c9('0x88')][_0x85c9('0x8c')];_0x4495de[_0x85c9('0x8d')]=![];break;default:}return db[_0x85c9('0x8e')][_0x85c9('0x8f')][_0x85c9('0x90')](_0x85c9('0x70'),util[_0x85c9('0x6b')](_0x85c9('0x91'),_0x29a245['id']),_0x4495de);})[_0x85c9('0x25')](function(){return _0x29a245;});});}})[_0x85c9('0x25')](respondWithResult(_0x23fe93,null))[_0x85c9('0x46')](handleError(_0x23fe93,null));};exports[_0x85c9('0x92')]=function(_0x2bb003,_0x260653,_0x5dfe71){var _0x7c94df={};var _0x4c09ea={};var _0xe88134;var _0x252fe6;return db[_0x85c9('0x2d')][_0x85c9('0x56')]({'where':{'id':_0x2bb003['params']['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x260653,null))[_0x85c9('0x25')](function(_0x42ac43){if(_0x42ac43){_0xe88134=_0x42ac43;_0x4c09ea[_0x85c9('0x32')]=_[_0x85c9('0x34')](db[_0x85c9('0x68')]['rawAttributes']);_0x4c09ea[_0x85c9('0x35')]=_[_0x85c9('0x34')](_0x2bb003[_0x85c9('0x35')]);_0x4c09ea[_0x85c9('0x36')]=_[_0x85c9('0x37')](_0x4c09ea['model'],_0x4c09ea[_0x85c9('0x35')]);_0x7c94df['attributes']=_[_0x85c9('0x37')](_0x4c09ea['model'],qs[_0x85c9('0x38')](_0x2bb003[_0x85c9('0x35')][_0x85c9('0x38')]));_0x7c94df[_0x85c9('0x39')]=_0x7c94df[_0x85c9('0x39')][_0x85c9('0x3a')]?_0x7c94df[_0x85c9('0x39')]:_0x4c09ea[_0x85c9('0x32')];_0x7c94df[_0x85c9('0x3c')]=qs[_0x85c9('0x3d')](_0x2bb003[_0x85c9('0x35')]['sort']);_0x7c94df[_0x85c9('0x3e')]=qs[_0x85c9('0x36')](_[_0x85c9('0x59')](_0x2bb003[_0x85c9('0x35')],_0x4c09ea['filters']));_0x7c94df[_0x85c9('0x3e')]=_['merge'](_0x7c94df[_0x85c9('0x3e')],{'$or':[{'ListId':_0x42ac43['id']},{'ListId':null}]});if(_0x2bb003['query']['filter']){_0x7c94df[_0x85c9('0x3e')]=_[_0x85c9('0x40')](_0x7c94df[_0x85c9('0x3e')],{'$or':_['map'](_0x7c94df[_0x85c9('0x39')],function(_0x40d4b7){var _0x41b9f5={};_0x41b9f5[_0x40d4b7]={'$like':'%'+_0x2bb003[_0x85c9('0x35')][_0x85c9('0x3f')]+'%'};return _0x41b9f5;})});}_0x7c94df=_[_0x85c9('0x40')]({},_0x7c94df,_0x2bb003[_0x85c9('0x42')]);return db[_0x85c9('0x68')][_0x85c9('0x93')](_0x7c94df);}})[_0x85c9('0x25')](respondWithResult(_0x260653,null))['catch'](handleError(_0x260653,null));};exports[_0x85c9('0x94')]=function(_0x34795b,_0x2859b7){return db[_0x85c9('0x68')]['findAndCountAll']({'where':{'ListId':null}})[_0x85c9('0x25')](handleEntityNotFound(_0x2859b7,null))[_0x85c9('0x25')](function(_0x238ab6){return _0x238ab6;})[_0x85c9('0x25')](respondWithResult(_0x2859b7,null))['catch'](handleError(_0x2859b7,null));};exports[_0x85c9('0x95')]=function(_0x2606fa,_0x42e0c5,_0x190302){return db['CmList'][_0x85c9('0x4f')]({'where':{'id':_0x2606fa['params']['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x42e0c5,null))[_0x85c9('0x25')](function(_0xc9f3a4){if(_0xc9f3a4){return _0xc9f3a4['addAgents'](_0x2606fa['body'][_0x85c9('0x5b')],_['omit'](_0x2606fa['body'],[_0x85c9('0x5b'),'id'])||{})[_0x85c9('0x96')](function(_0x3b44c2){for(var _0x5bc612=0x0;_0x5bc612<_0x2606fa[_0x85c9('0x49')][_0x85c9('0x5b')][_0x85c9('0x3a')];_0x5bc612+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x2606fa['body'][_0x85c9('0x5b')][_0x5bc612]),'CmListId':Number(_0x2606fa[_0x85c9('0x47')]['id'])});}return _0x3b44c2;});}})[_0x85c9('0x25')](respondWithResult(_0x42e0c5,null))[_0x85c9('0x46')](handleError(_0x42e0c5,null));};exports[_0x85c9('0x97')]=function(_0x39084f,_0x5a65b3,_0x2493ca){return db[_0x85c9('0x2d')]['find']({'where':{'id':_0x39084f[_0x85c9('0x47')]['id']}})[_0x85c9('0x25')](handleEntityNotFound(_0x5a65b3,null))[_0x85c9('0x25')](function(_0xe10dbc){if(_0xe10dbc){return _0xe10dbc['removeAgents'](_0x39084f[_0x85c9('0x35')]['ids'])[_0x85c9('0x25')](function(){if(_[_0x85c9('0x5e')](_0x39084f[_0x85c9('0x35')][_0x85c9('0x5b')])){for(var _0x949ea1=0x0;_0x949ea1<_0x39084f['query']['ids'][_0x85c9('0x3a')];_0x949ea1+=0x1){socket[_0x85c9('0x98')]('userCmList:remove',{'UserId':Number(_0x39084f[_0x85c9('0x35')][_0x85c9('0x5b')][_0x949ea1]),'CmListId':Number(_0x39084f[_0x85c9('0x47')]['id'])});}}else{socket[_0x85c9('0x98')](_0x85c9('0x99'),{'UserId':Number(_0x39084f[_0x85c9('0x35')][_0x85c9('0x5b')]),'CmListId':Number(_0x39084f[_0x85c9('0x47')]['id'])});}});}})[_0x85c9('0x25')](respondWithStatusCode(_0x5a65b3,null))[_0x85c9('0x46')](handleError(_0x5a65b3,null));};exports[_0x85c9('0x9a')]=function(_0x55d300,_0xcc6082,_0x2f75ef){var _0xbad408={};var _0x5da931={};var _0x56efb2;var _0x6809e4;return db['CmList']['findOne']({'where':{'id':_0x55d300['params']['id']}})['then'](handleEntityNotFound(_0xcc6082,null))[_0x85c9('0x25')](function(_0x305880){if(_0x305880){_0x56efb2=_0x305880;_0x5da931[_0x85c9('0x32')]=_[_0x85c9('0x34')](db[_0x85c9('0x9b')]['rawAttributes']);_0x5da931[_0x85c9('0x35')]=_[_0x85c9('0x34')](_0x55d300[_0x85c9('0x35')]);_0x5da931[_0x85c9('0x36')]=_[_0x85c9('0x37')](_0x5da931[_0x85c9('0x32')],_0x5da931[_0x85c9('0x35')]);_0xbad408[_0x85c9('0x39')]=_[_0x85c9('0x37')](_0x5da931[_0x85c9('0x32')],qs[_0x85c9('0x38')](_0x55d300[_0x85c9('0x35')]['fields']));_0xbad408[_0x85c9('0x39')]=_0xbad408[_0x85c9('0x39')][_0x85c9('0x3a')]?_0xbad408['attributes']:_0x5da931[_0x85c9('0x32')];_0xbad408[_0x85c9('0x3c')]=qs['sort'](_0x55d300['query']['sort']);_0xbad408['where']=qs[_0x85c9('0x36')](_['pick'](_0x55d300[_0x85c9('0x35')],_0x5da931[_0x85c9('0x36')]));if(_0x55d300[_0x85c9('0x35')][_0x85c9('0x3f')]){_0xbad408[_0x85c9('0x3e')]=_[_0x85c9('0x40')](_0xbad408[_0x85c9('0x3e')],{'$or':_[_0x85c9('0x33')](_0xbad408[_0x85c9('0x39')],function(_0x463b28){var _0x3abe41={};_0x3abe41[_0x463b28]={'$like':'%'+_0x55d300[_0x85c9('0x35')][_0x85c9('0x3f')]+'%'};return _0x3abe41;})});}_0xbad408=_['merge']({},_0xbad408,_0x55d300[_0x85c9('0x42')]);return _0x56efb2[_0x85c9('0x9a')](_0xbad408);}})[_0x85c9('0x25')](function(_0x5a7ae7){if(_0x5a7ae7){_0x6809e4=_0x5a7ae7[_0x85c9('0x3a')];if(!_0x55d300['query'][_0x85c9('0x3b')]('nolimit')){_0xbad408['limit']=qs['limit'](_0x55d300[_0x85c9('0x35')]['limit']);_0xbad408[_0x85c9('0x1d')]=qs[_0x85c9('0x1d')](_0x55d300[_0x85c9('0x35')][_0x85c9('0x1d')]);}return _0x56efb2[_0x85c9('0x9a')](_0xbad408);}})[_0x85c9('0x25')](function(_0x157189){if(_0x157189){return _0x157189?{'count':_0x6809e4,'rows':_0x157189}:null;}})[_0x85c9('0x25')](respondWithResult(_0xcc6082,null))[_0x85c9('0x46')](handleError(_0xcc6082,null));};function handleQuery(_0x50fa2f){logger['info'](_0x50fa2f);return db[_0x85c9('0x8e')][_0x85c9('0x35')](_0x50fa2f)[_0x85c9('0x96')](function(_0x520d7c){csv_results[_0x85c9('0x5f')](_0x520d7c);})[_0x85c9('0x46')](function(_0x3a12d6){logger[_0x85c9('0x29')](_0x3a12d6['message']);});} \ No newline at end of file +var _0x7583=['INTEGER','switch','BOOLEAN','cf_%s','getCustomFields','findOne','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','redis','socket.io-emitter','./cmList.socket','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','get','Lists','UserProfileResource','end','sendStatus','error','stack','name','send','map','CmList','rawAttributes','fieldName','type','key','filters','model','attributes','intersection','fields','query','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','keys','hasOwnProperty','rows','removeDispositions','addContacts','isArray','tags','join','push','omit','ids','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','concat','cf_%d','raw','options','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','item','ItemTypeId\x20=\x20?','cm_contact_has_items','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','each','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7583,0xac));var _0x3758=function(_0xab92b5,_0x184d79){_0xab92b5=_0xab92b5-0x0;var _0x3a758c=_0x7583[_0xab92b5];return _0x3a758c;};'use strict';var emlformat=require(_0x3758('0x0'));var rimraf=require(_0x3758('0x1'));var zipdir=require(_0x3758('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3758('0x3'));var moment=require('moment');var BPromise=require(_0x3758('0x4'));var Mustache=require(_0x3758('0x5'));var util=require(_0x3758('0x6'));var path=require('path');var sox=require(_0x3758('0x7'));var csv=require(_0x3758('0x8'));var ejs=require(_0x3758('0x9'));var fs=require('fs');var fs_extra=require(_0x3758('0xa'));var _=require(_0x3758('0xb'));var squel=require(_0x3758('0xc'));var crypto=require(_0x3758('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3758('0xe'));var toCsv=require(_0x3758('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3758('0xf'));var authService=require(_0x3758('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3758('0x11'));var logger=require('../../config/logger')(_0x3758('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3758('0x13'))['db'];var csv_results;config[_0x3758('0x14')]=_['defaults'](config[_0x3758('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x3758('0x15'))(new Redis(config['redis']));require(_0x3758('0x16'))['register'](socket);function respondWithStatusCode(_0x2a9da2,_0xfd341f){_0xfd341f=_0xfd341f||0xcc;return function(_0x2eed00){if(_0x2eed00){return _0x2a9da2['sendStatus'](_0xfd341f);}return _0x2a9da2[_0x3758('0x17')](_0xfd341f)['end']();};}function respondWithResult(_0x26ef89,_0x55fe24){_0x55fe24=_0x55fe24||0xc8;return function(_0x36d8b7){if(_0x36d8b7){return _0x26ef89[_0x3758('0x17')](_0x55fe24)[_0x3758('0x18')](_0x36d8b7);}};}function respondWithFilteredResult(_0x50c0af,_0x562317){return function(_0x1b7c54){if(_0x1b7c54){var _0x49407a=typeof _0x562317[_0x3758('0x19')]==='undefined'&&typeof _0x562317['limit']===_0x3758('0x1a');var _0x39f603=_0x1b7c54['count'];var _0x24700c=_0x49407a?0x0:_0x562317[_0x3758('0x19')];var _0x4b73cf=_0x49407a?_0x1b7c54[_0x3758('0x1b')]:_0x562317[_0x3758('0x19')]+_0x562317[_0x3758('0x1c')];var _0x2ffd39;if(_0x4b73cf>=_0x39f603){_0x4b73cf=_0x39f603;_0x2ffd39=0xc8;}else{_0x2ffd39=0xce;}_0x50c0af['status'](_0x2ffd39);return _0x50c0af['set'](_0x3758('0x1d'),_0x24700c+'-'+_0x4b73cf+'/'+_0x39f603)[_0x3758('0x18')](_0x1b7c54);}return null;};}function patchUpdates(_0x1926bf){return function(_0x291833){try{jsonpatch[_0x3758('0x1e')](_0x291833,_0x1926bf,!![]);}catch(_0x5af23c){return BPromise['reject'](_0x5af23c);}return _0x291833['save']();};}function saveUpdates(_0x386e6e,_0x5fd239){return function(_0x2b68ad){if(_0x2b68ad){return _0x2b68ad[_0x3758('0x1f')](_0x386e6e)[_0x3758('0x20')](function(_0x31ce97){return _0x31ce97;});}return null;};}function removeEntity(_0x3a46c7,_0x38f3ef){return function(_0x90db69){if(_0x90db69){return _0x90db69[_0x3758('0x21')]()[_0x3758('0x20')](function(){var _0x38490b=_0x90db69[_0x3758('0x22')]({'plain':!![]});var _0xeb669b=_0x3758('0x23');return db[_0x3758('0x24')][_0x3758('0x21')]({'where':{'type':_0xeb669b,'resourceId':_0x38490b['id']}})[_0x3758('0x20')](function(){return _0x90db69;});})['then'](function(){_0x3a46c7[_0x3758('0x17')](0xcc)[_0x3758('0x25')]();});}};}function handleEntityNotFound(_0x4dde73,_0xaac795){return function(_0x305d84){if(!_0x305d84){_0x4dde73[_0x3758('0x26')](0x194);}return _0x305d84;};}function handleError(_0x5a414e,_0x598a2c){_0x598a2c=_0x598a2c||0x1f4;return function(_0x3bd348){logger[_0x3758('0x27')](_0x3bd348[_0x3758('0x28')]);if(_0x3bd348['name']){delete _0x3bd348[_0x3758('0x29')];}_0x5a414e[_0x3758('0x17')](_0x598a2c)[_0x3758('0x2a')](_0x3bd348);};}exports['index']=function(_0x3a6bfc,_0x4a2647){var _0x526d94={},_0x54a729={},_0x2475e4={'count':0x0,'rows':[]};var _0x42c40b=_[_0x3758('0x2b')](db[_0x3758('0x2c')][_0x3758('0x2d')],function(_0x367c35){return{'name':_0x367c35[_0x3758('0x2e')],'type':_0x367c35[_0x3758('0x2f')][_0x3758('0x30')]};});_0x54a729['model']=_['map'](_0x42c40b,'name');_0x54a729['query']=_['keys'](_0x3a6bfc['query']);_0x54a729[_0x3758('0x31')]=_['intersection'](_0x54a729[_0x3758('0x32')],_0x54a729['query']);_0x526d94[_0x3758('0x33')]=_[_0x3758('0x34')](_0x54a729[_0x3758('0x32')],qs[_0x3758('0x35')](_0x3a6bfc[_0x3758('0x36')][_0x3758('0x35')]));_0x526d94[_0x3758('0x33')]=_0x526d94[_0x3758('0x33')][_0x3758('0x37')]?_0x526d94['attributes']:_0x54a729[_0x3758('0x32')];if(!_0x3a6bfc[_0x3758('0x36')]['hasOwnProperty'](_0x3758('0x38'))){_0x526d94[_0x3758('0x1c')]=qs[_0x3758('0x1c')](_0x3a6bfc[_0x3758('0x36')][_0x3758('0x1c')]);_0x526d94[_0x3758('0x19')]=qs[_0x3758('0x19')](_0x3a6bfc[_0x3758('0x36')][_0x3758('0x19')]);}_0x526d94[_0x3758('0x39')]=qs[_0x3758('0x3a')](_0x3a6bfc[_0x3758('0x36')][_0x3758('0x3a')]);_0x526d94['where']=qs[_0x3758('0x31')](_[_0x3758('0x3b')](_0x3a6bfc[_0x3758('0x36')],_0x54a729['filters']),_0x42c40b);if(_0x3a6bfc[_0x3758('0x36')]['filter']){_0x526d94[_0x3758('0x3c')]=_['merge'](_0x526d94[_0x3758('0x3c')],{'$or':_[_0x3758('0x2b')](_0x42c40b,function(_0x54a883){if(_0x54a883[_0x3758('0x2f')]!==_0x3758('0x3d')){var _0x1a890e={};_0x1a890e[_0x54a883[_0x3758('0x29')]]={'$like':'%'+_0x3a6bfc[_0x3758('0x36')][_0x3758('0x3e')]+'%'};return _0x1a890e;}})});}_0x526d94=_[_0x3758('0x3f')]({},_0x526d94,_0x3a6bfc['options']);var _0x32c25d={'where':_0x526d94[_0x3758('0x3c')]};return db[_0x3758('0x2c')][_0x3758('0x1b')](_0x32c25d)[_0x3758('0x20')](function(_0x2f3acb){_0x2475e4[_0x3758('0x1b')]=_0x2f3acb;if(_0x3a6bfc[_0x3758('0x36')][_0x3758('0x40')]){_0x526d94['include']=[{'all':!![]}];}return db['CmList'][_0x3758('0x41')](_0x526d94);})[_0x3758('0x20')](function(_0x490273){_0x2475e4['rows']=_0x490273;return _0x2475e4;})[_0x3758('0x20')](respondWithFilteredResult(_0x4a2647,_0x526d94))[_0x3758('0x42')](handleError(_0x4a2647,null));};exports['show']=function(_0xd93d42,_0x1a55ad){var _0x459257={'raw':![],'where':{'id':_0xd93d42[_0x3758('0x43')]['id']}},_0x5e3d38={};_0x5e3d38[_0x3758('0x32')]=_['keys'](db[_0x3758('0x2c')]['rawAttributes']);_0x5e3d38[_0x3758('0x36')]=_['keys'](_0xd93d42[_0x3758('0x36')]);_0x5e3d38[_0x3758('0x31')]=_['intersection'](_0x5e3d38[_0x3758('0x32')],_0x5e3d38[_0x3758('0x36')]);_0x459257[_0x3758('0x33')]=_[_0x3758('0x34')](_0x5e3d38[_0x3758('0x32')],qs[_0x3758('0x35')](_0xd93d42[_0x3758('0x36')][_0x3758('0x35')]));_0x459257[_0x3758('0x33')]=_0x459257[_0x3758('0x33')][_0x3758('0x37')]?_0x459257[_0x3758('0x33')]:_0x5e3d38[_0x3758('0x32')];if(_0xd93d42[_0x3758('0x36')][_0x3758('0x40')]){_0x459257[_0x3758('0x44')]=[{'all':!![]}];}_0x459257=_[_0x3758('0x3f')]({},_0x459257,_0xd93d42['options']);return db['CmList'][_0x3758('0x45')](_0x459257)[_0x3758('0x20')](handleEntityNotFound(_0x1a55ad,null))['then'](respondWithResult(_0x1a55ad,null))[_0x3758('0x42')](handleError(_0x1a55ad,null));};exports['create']=function(_0x1908b1,_0x46c919){return db['CmList'][_0x3758('0x46')](_0x1908b1[_0x3758('0x47')],{})[_0x3758('0x20')](function(_0x231858){var _0x58a90a=_0x1908b1[_0x3758('0x48')]['get']({'plain':!![]});if(!_0x58a90a)throw new Error(_0x3758('0x49'));if(_0x58a90a[_0x3758('0x4a')]===_0x3758('0x48')){var _0x3641bd=_0x231858[_0x3758('0x22')]({'plain':!![]});var _0x41da85=_0x3758('0x23');return db[_0x3758('0x4b')][_0x3758('0x45')]({'where':{'name':_0x41da85,'userProfileId':_0x58a90a[_0x3758('0x4c')]},'raw':!![]})[_0x3758('0x20')](function(_0x36222e){if(_0x36222e&&_0x36222e['autoAssociation']===0x0){return db['UserProfileResource'][_0x3758('0x46')]({'name':_0x3641bd[_0x3758('0x29')],'resourceId':_0x3641bd['id'],'type':_0x36222e['name'],'sectionId':_0x36222e['id']},{})[_0x3758('0x20')](function(){return _0x231858;});}else{return _0x231858;}})[_0x3758('0x42')](function(_0x43de0a){logger[_0x3758('0x27')](_0x3758('0x4d'),_0x43de0a);throw _0x43de0a;});}return _0x231858;})['then'](respondWithResult(_0x46c919,0xc9))['catch'](handleError(_0x46c919,null));};exports[_0x3758('0x1f')]=function(_0x3176a5,_0x27fcd7){if(_0x3176a5[_0x3758('0x47')]['id']){delete _0x3176a5[_0x3758('0x47')]['id'];}return db[_0x3758('0x2c')][_0x3758('0x45')]({'where':{'id':_0x3176a5['params']['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x27fcd7,null))[_0x3758('0x20')](saveUpdates(_0x3176a5[_0x3758('0x47')],null))['then'](respondWithResult(_0x27fcd7,null))[_0x3758('0x42')](handleError(_0x27fcd7,null));};exports[_0x3758('0x21')]=function(_0xb2385c,_0x1a6e2c){return db['CmList']['find']({'where':{'id':_0xb2385c['params']['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x1a6e2c,null))[_0x3758('0x20')](removeEntity(_0x1a6e2c,null))[_0x3758('0x42')](handleError(_0x1a6e2c,null));};exports[_0x3758('0x4e')]=function(_0x4e5be6,_0x358809){return db[_0x3758('0x2c')]['describe']()[_0x3758('0x20')](respondWithResult(_0x358809,null))[_0x3758('0x42')](handleError(_0x358809,null));};exports['addDisposition']=function(_0x3821c1,_0x357135,_0x34ab18){if(_0x3821c1[_0x3758('0x47')]['id']){delete _0x3821c1[_0x3758('0x47')]['id'];}return db[_0x3758('0x2c')][_0x3758('0x45')]({'where':{'id':_0x3821c1['params']['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x357135,null))[_0x3758('0x20')](function(_0x1d6936){if(_0x1d6936){_0x3821c1[_0x3758('0x47')][_0x3758('0x4f')]=_0x1d6936['id'];return db[_0x3758('0x50')][_0x3758('0x46')](_0x3821c1[_0x3758('0x47')]);}})[_0x3758('0x20')](respondWithResult(_0x357135,null))[_0x3758('0x42')](handleError(_0x357135,null));};exports[_0x3758('0x51')]=function(_0x556d86,_0x23acaa,_0x528ed9){var _0x22dba9={'raw':![],'where':{}};var _0x88bcb8={};var _0x402ee1={'count':0x0,'rows':[]};return db[_0x3758('0x2c')]['findOne']({'where':{'id':_0x556d86['params']['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x23acaa,null))[_0x3758('0x20')](function(_0x48221b){if(_0x48221b){_0x88bcb8['model']=_[_0x3758('0x52')](db[_0x3758('0x50')][_0x3758('0x2d')]);_0x88bcb8['query']=_[_0x3758('0x52')](_0x556d86['query']);_0x88bcb8[_0x3758('0x31')]=_[_0x3758('0x34')](_0x88bcb8[_0x3758('0x32')],_0x88bcb8[_0x3758('0x36')]);_0x22dba9[_0x3758('0x33')]=_['intersection'](_0x88bcb8[_0x3758('0x32')],qs['fields'](_0x556d86[_0x3758('0x36')][_0x3758('0x35')]));_0x22dba9[_0x3758('0x33')]=_0x22dba9['attributes'][_0x3758('0x37')]?_0x22dba9['attributes']:_0x88bcb8[_0x3758('0x32')];if(!_0x556d86['query'][_0x3758('0x53')]('nolimit')){_0x22dba9['limit']=qs[_0x3758('0x1c')](_0x556d86['query'][_0x3758('0x1c')]);_0x22dba9[_0x3758('0x19')]=qs[_0x3758('0x19')](_0x556d86[_0x3758('0x36')][_0x3758('0x19')]);}_0x22dba9[_0x3758('0x39')]=qs['sort'](_0x556d86[_0x3758('0x36')][_0x3758('0x3a')]);_0x22dba9['where']=qs['filters'](_['pick'](_0x556d86[_0x3758('0x36')],_0x88bcb8['filters']));_0x22dba9[_0x3758('0x3c')][_0x3758('0x4f')]=_0x48221b['id'];if(_0x556d86[_0x3758('0x36')]['filter']){_0x22dba9[_0x3758('0x3c')]=_['merge'](_0x22dba9[_0x3758('0x3c')],{'$or':_[_0x3758('0x2b')](_0x22dba9[_0x3758('0x33')],function(_0x5bd40a){var _0x1b5f40={};_0x1b5f40[_0x5bd40a]={'$like':'%'+_0x556d86['query'][_0x3758('0x3e')]+'%'};return _0x1b5f40;})});}_0x22dba9=_[_0x3758('0x3f')]({},_0x22dba9,_0x556d86['options']);return db[_0x3758('0x50')]['count']({'where':_0x22dba9[_0x3758('0x3c')]})[_0x3758('0x20')](function(_0x5de78f){_0x402ee1[_0x3758('0x1b')]=_0x5de78f;if(_0x556d86['query'][_0x3758('0x40')]){_0x22dba9[_0x3758('0x44')]=[{'all':!![]}];}return db[_0x3758('0x50')]['findAll'](_0x22dba9);})[_0x3758('0x20')](function(_0x335971){_0x402ee1[_0x3758('0x54')]=_0x335971;return _0x402ee1;});}})['then'](respondWithFilteredResult(_0x23acaa,_0x22dba9))[_0x3758('0x42')](handleError(_0x23acaa,null));};exports[_0x3758('0x55')]=function(_0x45b30f,_0x4e04fb,_0x4f9429){return db['CmList'][_0x3758('0x45')]({'where':{'id':_0x45b30f[_0x3758('0x43')]['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x4e04fb,null))['then'](function(_0x15ade4){if(_0x15ade4){return _0x15ade4[_0x3758('0x55')](_0x45b30f['query']['ids']);}})[_0x3758('0x20')](respondWithStatusCode(_0x4e04fb,null))[_0x3758('0x42')](handleError(_0x4e04fb,null));};exports[_0x3758('0x56')]=function(_0x396153,_0x3b47a6,_0x1d7900){return db[_0x3758('0x2c')][_0x3758('0x45')]({'where':{'id':_0x396153[_0x3758('0x43')]['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x3b47a6,null))[_0x3758('0x20')](function(_0x3fae18){if(_0x3fae18){var _0x84d182=[];var _0x419263={'success':[],'errors':[]};return db['CmContact'][_0x3758('0x4e')]()[_0x3758('0x20')](function(_0x21f491){if(_0x396153['body']['tags']&&_[_0x3758('0x57')](_0x396153[_0x3758('0x47')][_0x3758('0x58')])){if(_0x396153[_0x3758('0x47')][_0x3758('0x58')][_0x3758('0x37')]){_0x396153[_0x3758('0x47')][_0x3758('0x58')]=_0x396153[_0x3758('0x47')][_0x3758('0x58')][_0x3758('0x59')](';')+';';}else{_0x396153['body'][_0x3758('0x58')]=null;}}else{_0x396153[_0x3758('0x47')]['tags']=null;}if(_0x396153[_0x3758('0x47')]&&_[_0x3758('0x57')](_0x396153[_0x3758('0x47')])){for(var _0x3db7c8=0x0;_0x3db7c8<_0x396153['body']['length'];_0x3db7c8+=0x1){_0x396153[_0x3758('0x47')][_0x3db7c8]['ListId']=_0x396153['params']['id'];_0x84d182[_0x3758('0x5a')](_0x396153[_0x3758('0x47')][_0x3db7c8]);}return BPromise['each'](_0x84d182,function(_0x2c32bd){return db['CmContact'][_0x3758('0x46')](_[_0x3758('0x5b')](_0x2c32bd,[_0x3758('0x5c'),'id'])||{},{'fields':_[_0x3758('0x52')](_0x21f491),'raw':!![]})[_0x3758('0x20')](function(_0x389b16){_0x419263['success']['push'](_0x389b16['dataValues']);})['catch'](function(_0x4ad23b){_0x419263[_0x3758('0x5d')][_0x3758('0x5a')]({'data':_0x2c32bd,'error':_0x4ad23b['message']});});})['then'](function(_0x45d852){return _0x419263;})[_0x3758('0x42')](function(_0x11b080){return _0x11b080;});}else{_0x3b47a6[_0x3758('0x17')](0x190)[_0x3758('0x18')]({'message':_0x3758('0x5e')});}});}})[_0x3758('0x20')](respondWithResult(_0x3b47a6,null))[_0x3758('0x42')](handleError(_0x3b47a6,null));};exports[_0x3758('0x5f')]=function(_0x230aa0,_0x58b0e8,_0x26a301){var _0xa6eaa9;return db[_0x3758('0x2c')]['find']({'where':{'id':_0x230aa0['params']['id']},'include':[{'model':db[_0x3758('0x60')],'as':_0x3758('0x61')}]})[_0x3758('0x20')](handleEntityNotFound(_0x58b0e8,null))[_0x3758('0x20')](function(_0x596232){if(_0x596232){_0xa6eaa9=_0x596232;return db[_0x3758('0x62')]['rawAttributes'];}})[_0x3758('0x20')](function(_0x3467ad){if(_0x3467ad){var _0x26b762={};var _0x4c6c2e={};_0x4c6c2e[_0x3758('0x32')]=_[_0x3758('0x63')](_[_0x3758('0x52')](_0x3467ad),_['map'](_0xa6eaa9[_0x3758('0x61')],function(_0x309833){return util['format'](_0x3758('0x64'),_0x309833['id']);}));_0x4c6c2e['query']=_[_0x3758('0x52')](_0x230aa0[_0x3758('0x36')]);_0x4c6c2e[_0x3758('0x31')]=_[_0x3758('0x34')](_0x4c6c2e[_0x3758('0x32')],_0x4c6c2e['query']);_0x26b762[_0x3758('0x33')]=_[_0x3758('0x34')](_0x4c6c2e['model'],qs[_0x3758('0x35')](_0x230aa0[_0x3758('0x36')][_0x3758('0x35')]));_0x26b762[_0x3758('0x33')]=_0x26b762[_0x3758('0x33')][_0x3758('0x37')]?_0x26b762[_0x3758('0x33')]:_0x4c6c2e[_0x3758('0x32')];if(!_0x230aa0[_0x3758('0x36')][_0x3758('0x53')](_0x3758('0x38'))){_0x26b762[_0x3758('0x1c')]=qs[_0x3758('0x1c')](_0x230aa0[_0x3758('0x36')][_0x3758('0x1c')]);_0x26b762[_0x3758('0x19')]=qs[_0x3758('0x19')](_0x230aa0[_0x3758('0x36')][_0x3758('0x19')]);}_0x26b762['order']=qs[_0x3758('0x3a')](_0x230aa0[_0x3758('0x36')]['sort']);_0x26b762[_0x3758('0x3c')]=qs[_0x3758('0x31')](_['pick'](_0x230aa0['query'],_0x4c6c2e[_0x3758('0x31')]));_0x26b762[_0x3758('0x65')]=!![];if(_0x230aa0[_0x3758('0x36')][_0x3758('0x3e')]){_0x26b762[_0x3758('0x3c')]=_[_0x3758('0x3f')](_0x26b762['where'],{'$or':_[_0x3758('0x2b')](_0x26b762[_0x3758('0x33')],function(_0x4e315e){var _0x3063c6={};_0x3063c6[_0x4e315e]={'$like':'%'+_0x230aa0['query'][_0x3758('0x3e')]+'%'};return _0x3063c6;})});}_0x26b762=_['merge']({},_0x26b762,_0x230aa0[_0x3758('0x66')]);return _0xa6eaa9[_0x3758('0x5f')](_0x26b762);}})['then'](respondWithResult(_0x58b0e8,null))[_0x3758('0x42')](handleError(_0x58b0e8,null));};exports[_0x3758('0x67')]=function(_0x3bcca5,_0x512cb0,_0x4d7669){var _0x84f1b0;var _0x10d222;var _0x5a773e;var _0x4e9c2b=_0x3bcca5[_0x3758('0x43')]['id'];csv_results=[];return db[_0x3758('0x68')][_0x3758('0x41')]({'attributes':['id',_0x3758('0x29')],'raw':!![],'order':['OrderBy']})['then'](function(_0x3b8cb9){_0x84f1b0=_0x3b8cb9;var _0x50d714=_[_0x3758('0x52')](db[_0x3758('0x62')][_0x3758('0x2d')]);return db[_0x3758('0x60')][_0x3758('0x41')]({'raw':!![],'attributes':['id',_0x3758('0x69')]})[_0x3758('0x20')](function(_0x4bb092){_0x10d222=_0x4bb092;var _0x469812=squel[_0x3758('0x6a')]()[_0x3758('0x35')](_0x50d714)[_0x3758('0x6b')](_0x3758('0x6c'),'c')[_0x3758('0x3c')]('c.ListId\x20=\x20?',_0x4e9c2b)[_0x3758('0x3c')](_0x3758('0x6d'))['distinct']();for(var _0xff3c28=0x0;_0xff3c28<_0x10d222[_0x3758('0x37')];_0xff3c28++){_0x469812[_0x3758('0x6e')](_0x3758('0x6f')+_0x10d222[_0xff3c28]['id'],'customField_'+_0x10d222[_0xff3c28]['alias']);}for(var _0xff3c28=0x0;_0xff3c28<_0x84f1b0[_0x3758('0x37')];_0xff3c28++){_0x469812[_0x3758('0x6e')](squel[_0x3758('0x6a')]()[_0x3758('0x6e')](_0x3758('0x70'))['from']('cm_contact_has_items')['where'](_0x3758('0x71'),_0x84f1b0[_0xff3c28]['id'])[_0x3758('0x3c')]('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x84f1b0[_0xff3c28][_0x3758('0x29')]);_0x469812[_0x3758('0x6e')](squel[_0x3758('0x6a')]()[_0x3758('0x6e')]('description')[_0x3758('0x6b')](_0x3758('0x72'))[_0x3758('0x3c')](_0x3758('0x71'),_0x84f1b0[_0xff3c28]['id'])['where'](_0x3758('0x73')),_0x3758('0x74')+_0x84f1b0[_0xff3c28][_0x3758('0x29')]);}var _0x3b0a35=[];_0x3b0a35[_0x3758('0x5a')](_0x469812[_0x3758('0x75')]());BPromise[_0x3758('0x76')](_0x3b0a35,handleQuery)[_0x3758('0x20')](function(_0x4f4caf){handleQuery(_0x469812[_0x3758('0x75')]());var _0x2db394=csv_results[0x0];if(!_['isEmpty'](_0x2db394)){var _0x6cb271=toCsv(_0x2db394);var _0xee56c9=Date[_0x3758('0x77')]();fs[_0x3758('0x78')](util[_0x3758('0x79')](_0x3758('0x7a'),_0x4e9c2b,_0xee56c9),_0x6cb271);_0x512cb0[_0x3758('0x7b')]('Content-disposition','attachment;\x20filename='+util[_0x3758('0x79')](_0x3758('0x7c'),_0x4e9c2b,_0xee56c9));_0x512cb0[_0x3758('0x7b')](_0x3758('0x7d'),_0x3758('0x7e'));return _0x512cb0[_0x3758('0x7f')](util[_0x3758('0x79')](_0x3758('0x7a'),_0x4e9c2b,_0xee56c9));}else{return _0x512cb0[_0x3758('0x26')](0xcc);}});});});};exports[_0x3758('0x80')]=function(_0x445f66,_0x47d74b,_0x218707){var _0xd1c533;delete _0x445f66[_0x3758('0x47')]['id'];return db[_0x3758('0x2c')]['findOne']({'where':{'id':_0x445f66[_0x3758('0x43')]['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x47d74b,null))[_0x3758('0x20')](function(_0x2676db){if(_0x2676db){return db[_0x3758('0x81')][_0x3758('0x82')](function(_0x39af6a){return db[_0x3758('0x60')]['create'](_0x445f66['body'],{'transaction':_0x39af6a})[_0x3758('0x20')](function(_0x3c883f){_0xd1c533=_0x3c883f;return _0x2676db[_0x3758('0x83')](_0x3c883f,{'transaction':_0x39af6a});})[_0x3758('0x20')](function(){var _0x56fec5={'type':db[_0x3758('0x84')][_0x3758('0x85')],'transaction':_0x39af6a};switch(_0x445f66[_0x3758('0x47')][_0x3758('0x2f')]){case _0x3758('0x86'):_0x56fec5[_0x3758('0x2f')]=db[_0x3758('0x84')][_0x3758('0x85')];break;case _0x3758('0x87'):_0x56fec5['type']=db[_0x3758('0x84')][_0x3758('0x88')];break;case _0x3758('0x89'):_0x56fec5[_0x3758('0x2f')]=db['Sequelize'][_0x3758('0x8a')];_0x56fec5['defaultValue']=![];break;default:}return db['sequelize']['queryInterface']['addColumn']('cm_contacts',util[_0x3758('0x79')](_0x3758('0x8b'),_0xd1c533['id']),_0x56fec5);})[_0x3758('0x20')](function(){return _0xd1c533;});});}})[_0x3758('0x20')](respondWithResult(_0x47d74b,null))[_0x3758('0x42')](handleError(_0x47d74b,null));};exports[_0x3758('0x8c')]=function(_0x24af9d,_0x4a92c2,_0x373d8a){var _0x57a33c={};var _0x41919f={};var _0x5a90ff;var _0x51e4d8;return db[_0x3758('0x2c')][_0x3758('0x8d')]({'where':{'id':_0x24af9d['params']['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x4a92c2,null))[_0x3758('0x20')](function(_0x2c11a8){if(_0x2c11a8){_0x5a90ff=_0x2c11a8;_0x41919f[_0x3758('0x32')]=_[_0x3758('0x52')](db['CmCustomField']['rawAttributes']);_0x41919f[_0x3758('0x36')]=_[_0x3758('0x52')](_0x24af9d[_0x3758('0x36')]);_0x41919f['filters']=_['intersection'](_0x41919f['model'],_0x41919f[_0x3758('0x36')]);_0x57a33c[_0x3758('0x33')]=_[_0x3758('0x34')](_0x41919f[_0x3758('0x32')],qs[_0x3758('0x35')](_0x24af9d[_0x3758('0x36')][_0x3758('0x35')]));_0x57a33c[_0x3758('0x33')]=_0x57a33c[_0x3758('0x33')][_0x3758('0x37')]?_0x57a33c['attributes']:_0x41919f[_0x3758('0x32')];_0x57a33c[_0x3758('0x39')]=qs['sort'](_0x24af9d[_0x3758('0x36')][_0x3758('0x3a')]);_0x57a33c['where']=qs['filters'](_[_0x3758('0x3b')](_0x24af9d[_0x3758('0x36')],_0x41919f['filters']));_0x57a33c['where']=_[_0x3758('0x3f')](_0x57a33c[_0x3758('0x3c')],{'$or':[{'ListId':_0x2c11a8['id']},{'ListId':null}]});if(_0x24af9d[_0x3758('0x36')][_0x3758('0x3e')]){_0x57a33c[_0x3758('0x3c')]=_[_0x3758('0x3f')](_0x57a33c['where'],{'$or':_[_0x3758('0x2b')](_0x57a33c[_0x3758('0x33')],function(_0x28ee68){var _0x2ac5ba={};_0x2ac5ba[_0x28ee68]={'$like':'%'+_0x24af9d[_0x3758('0x36')][_0x3758('0x3e')]+'%'};return _0x2ac5ba;})});}_0x57a33c=_['merge']({},_0x57a33c,_0x24af9d['options']);return db['CmCustomField']['findAndCountAll'](_0x57a33c);}})[_0x3758('0x20')](respondWithResult(_0x4a92c2,null))[_0x3758('0x42')](handleError(_0x4a92c2,null));};exports[_0x3758('0x8e')]=function(_0x441fb7,_0x4a1232){return db['CmCustomField'][_0x3758('0x8f')]({'where':{'ListId':null}})[_0x3758('0x20')](handleEntityNotFound(_0x4a1232,null))[_0x3758('0x20')](function(_0x56ec32){return _0x56ec32;})['then'](respondWithResult(_0x4a1232,null))[_0x3758('0x42')](handleError(_0x4a1232,null));};exports[_0x3758('0x90')]=function(_0x11627f,_0x5ab727,_0x4aad59){return db[_0x3758('0x2c')][_0x3758('0x45')]({'where':{'id':_0x11627f[_0x3758('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ab727,null))[_0x3758('0x20')](function(_0x44ae72){if(_0x44ae72){return _0x44ae72[_0x3758('0x90')](_0x11627f['body'][_0x3758('0x5c')],_['omit'](_0x11627f[_0x3758('0x47')],[_0x3758('0x5c'),'id'])||{})[_0x3758('0x91')](function(_0x432c65){for(var _0x36043f=0x0;_0x36043f<_0x11627f[_0x3758('0x47')][_0x3758('0x5c')][_0x3758('0x37')];_0x36043f+=0x1){socket[_0x3758('0x92')](_0x3758('0x93'),{'UserId':Number(_0x11627f['body']['ids'][_0x36043f]),'CmListId':Number(_0x11627f['params']['id'])});}return _0x432c65;});}})[_0x3758('0x20')](respondWithResult(_0x5ab727,null))[_0x3758('0x42')](handleError(_0x5ab727,null));};exports[_0x3758('0x94')]=function(_0x4ca3a3,_0x86177a,_0x47f2f6){return db[_0x3758('0x2c')]['find']({'where':{'id':_0x4ca3a3[_0x3758('0x43')]['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x86177a,null))[_0x3758('0x20')](function(_0x5e1e5f){if(_0x5e1e5f){return _0x5e1e5f[_0x3758('0x94')](_0x4ca3a3['query'][_0x3758('0x5c')])['then'](function(){if(_[_0x3758('0x57')](_0x4ca3a3[_0x3758('0x36')][_0x3758('0x5c')])){for(var _0x385f85=0x0;_0x385f85<_0x4ca3a3[_0x3758('0x36')]['ids'][_0x3758('0x37')];_0x385f85+=0x1){socket[_0x3758('0x92')](_0x3758('0x95'),{'UserId':Number(_0x4ca3a3[_0x3758('0x36')]['ids'][_0x385f85]),'CmListId':Number(_0x4ca3a3['params']['id'])});}}else{socket[_0x3758('0x92')]('userCmList:remove',{'UserId':Number(_0x4ca3a3[_0x3758('0x36')][_0x3758('0x5c')]),'CmListId':Number(_0x4ca3a3[_0x3758('0x43')]['id'])});}});}})[_0x3758('0x20')](respondWithStatusCode(_0x86177a,null))['catch'](handleError(_0x86177a,null));};exports[_0x3758('0x96')]=function(_0x36e176,_0x1a4ac7,_0x124147){var _0x45a4de={};var _0x398827={};var _0x2cdb24;var _0x1a1ead;return db[_0x3758('0x2c')][_0x3758('0x8d')]({'where':{'id':_0x36e176[_0x3758('0x43')]['id']}})[_0x3758('0x20')](handleEntityNotFound(_0x1a4ac7,null))[_0x3758('0x20')](function(_0x34ba13){if(_0x34ba13){_0x2cdb24=_0x34ba13;_0x398827[_0x3758('0x32')]=_[_0x3758('0x52')](db[_0x3758('0x97')][_0x3758('0x2d')]);_0x398827[_0x3758('0x36')]=_['keys'](_0x36e176[_0x3758('0x36')]);_0x398827[_0x3758('0x31')]=_[_0x3758('0x34')](_0x398827['model'],_0x398827['query']);_0x45a4de[_0x3758('0x33')]=_[_0x3758('0x34')](_0x398827['model'],qs[_0x3758('0x35')](_0x36e176[_0x3758('0x36')]['fields']));_0x45a4de[_0x3758('0x33')]=_0x45a4de[_0x3758('0x33')]['length']?_0x45a4de[_0x3758('0x33')]:_0x398827['model'];_0x45a4de[_0x3758('0x39')]=qs[_0x3758('0x3a')](_0x36e176[_0x3758('0x36')][_0x3758('0x3a')]);_0x45a4de[_0x3758('0x3c')]=qs[_0x3758('0x31')](_['pick'](_0x36e176[_0x3758('0x36')],_0x398827[_0x3758('0x31')]));if(_0x36e176[_0x3758('0x36')]['filter']){_0x45a4de['where']=_[_0x3758('0x3f')](_0x45a4de['where'],{'$or':_[_0x3758('0x2b')](_0x45a4de['attributes'],function(_0x48812a){var _0x43e3d0={};_0x43e3d0[_0x48812a]={'$like':'%'+_0x36e176[_0x3758('0x36')]['filter']+'%'};return _0x43e3d0;})});}_0x45a4de=_[_0x3758('0x3f')]({},_0x45a4de,_0x36e176[_0x3758('0x66')]);return _0x2cdb24['getAgents'](_0x45a4de);}})[_0x3758('0x20')](function(_0x3883b1){if(_0x3883b1){_0x1a1ead=_0x3883b1['length'];if(!_0x36e176[_0x3758('0x36')][_0x3758('0x53')](_0x3758('0x38'))){_0x45a4de[_0x3758('0x1c')]=qs[_0x3758('0x1c')](_0x36e176[_0x3758('0x36')][_0x3758('0x1c')]);_0x45a4de[_0x3758('0x19')]=qs[_0x3758('0x19')](_0x36e176[_0x3758('0x36')][_0x3758('0x19')]);}return _0x2cdb24['getAgents'](_0x45a4de);}})[_0x3758('0x20')](function(_0x45daab){if(_0x45daab){return _0x45daab?{'count':_0x1a1ead,'rows':_0x45daab}:null;}})[_0x3758('0x20')](respondWithResult(_0x1a4ac7,null))[_0x3758('0x42')](handleError(_0x1a4ac7,null));};function handleQuery(_0x11d3c2){logger[_0x3758('0x98')](_0x11d3c2);return db['sequelize'][_0x3758('0x36')](_0x11d3c2)[_0x3758('0x91')](function(_0x4f6a2e){csv_results[_0x3758('0x5a')](_0x4f6a2e);})['catch'](function(_0x427f82){logger['error'](_0x427f82[_0x3758('0x99')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1656cb5..99384b5 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x55ca[_0x42f687];return _0x108838;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe14b,0x93));var _0xbe14=function(_0xce7312,_0x4e77e9){_0xce7312=_0xce7312-0x0;var _0x4fb4ac=_0xe14b[_0xce7312];return _0x4fb4ac;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index aae1c67..ad65e2b 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 _0x0bb5=['define','CmList','cm_lists','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x245e2d,_0x1515a6){var _0x2d1b6f=function(_0xd5b890){while(--_0xd5b890){_0x245e2d['push'](_0x245e2d['shift']());}};_0x2d1b6f(++_0x1515a6);}(_0x0bb5,0x148));var _0x50bb=function(_0x54baee,_0x282adf){_0x54baee=_0x54baee-0x0;var _0x9cbc54=_0x0bb5[_0x54baee];return _0x9cbc54;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x153f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmList.attributes','exports','define','cm_lists','lodash'];(function(_0x5ad433,_0x29827d){var _0x4f5c07=function(_0x2d9f43){while(--_0x2d9f43){_0x5ad433['push'](_0x5ad433['shift']());}};_0x4f5c07(++_0x29827d);}(_0x153f,0x15b));var _0xf153=function(_0x352f53,_0x9fcf8e){_0x352f53=_0x352f53-0x0;var _0x5e8e18=_0x153f[_0x352f53];return _0x5e8e18;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf153('0x7'));var config=require('../../config/environment');var attributes=require(_0xf153('0x8'));module[_0xf153('0x9')]=function(_0x342a45,_0xafd987){return _0x342a45[_0xf153('0xa')]('CmList',attributes,{'tableName':_0xf153('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 d77f6c3..f2c82fc 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 _0x1d66=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1d66,0x1f3));var _0x61d6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1d66[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x61d6('0x0'));var util=require(_0x61d6('0x1'));var moment=require(_0x61d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x61d6('0x3'));var fs=require('fs');var Redis=require(_0x61d6('0x4'));var db=require(_0x61d6('0x5'))['db'];var utils=require(_0x61d6('0x6'));var logger=require(_0x61d6('0x7'))('rpc');var config=require(_0x61d6('0x8'));var jayson=require(_0x61d6('0x9'));var client=jayson[_0x61d6('0xa')][_0x61d6('0xb')]({'port':0x232a});config['redis']=_[_0x61d6('0xc')](config[_0x61d6('0xd')],{'host':_0x61d6('0xe'),'port':0x18eb});var socket=require(_0x61d6('0xf'))(new Redis(config[_0x61d6('0xd')]));require(_0x61d6('0x10'))[_0x61d6('0x11')](socket);function respondWithRpcPromise(_0x1dc991,_0x9d566d,_0x5ba85f){return new BPromise(function(_0x2e8cc5,_0x3cd98e){return client['request'](_0x1dc991,_0x5ba85f)[_0x61d6('0x12')](function(_0x9d156f){logger[_0x61d6('0x13')](_0x61d6('0x14'),_0x9d566d,_0x61d6('0x15'));logger[_0x61d6('0x16')](_0x61d6('0x17'),_0x9d566d,'request\x20sent',JSON[_0x61d6('0x18')](_0x9d156f));if(_0x9d156f[_0x61d6('0x19')]){if(_0x9d156f[_0x61d6('0x19')]['code']===0x1f4){logger[_0x61d6('0x19')]('CmList,\x20%s,\x20%s',_0x9d566d,_0x9d156f['error'][_0x61d6('0x1a')]);return _0x3cd98e(_0x9d156f[_0x61d6('0x19')][_0x61d6('0x1a')]);}logger[_0x61d6('0x19')](_0x61d6('0x14'),_0x9d566d,_0x9d156f[_0x61d6('0x19')]['message']);return _0x2e8cc5(_0x9d156f[_0x61d6('0x19')][_0x61d6('0x1a')]);}else{logger[_0x61d6('0x13')](_0x61d6('0x14'),_0x9d566d,_0x61d6('0x15'));_0x2e8cc5(_0x9d156f[_0x61d6('0x1b')]['message']);}})[_0x61d6('0x1c')](function(_0x347e3e){logger[_0x61d6('0x19')](_0x61d6('0x14'),_0x9d566d,_0x347e3e);_0x3cd98e(_0x347e3e);});});} \ No newline at end of file +var _0x769f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0x769f,0xea));var _0xf769=function(_0x58a663,_0x32e12b){_0x58a663=_0x58a663-0x0;var _0x3d989d=_0x769f[_0x58a663];return _0x3d989d;};'use strict';var _=require('lodash');var util=require(_0xf769('0x0'));var moment=require('moment');var BPromise=require(_0xf769('0x1'));var rs=require(_0xf769('0x2'));var fs=require('fs');var Redis=require(_0xf769('0x3'));var db=require(_0xf769('0x4'))['db'];var utils=require(_0xf769('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf769('0x6'));var jayson=require(_0xf769('0x7'));var client=jayson[_0xf769('0x8')][_0xf769('0x9')]({'port':0x232a});config[_0xf769('0xa')]=_[_0xf769('0xb')](config[_0xf769('0xa')],{'host':_0xf769('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf769('0xa')]));require(_0xf769('0xd'))[_0xf769('0xe')](socket);function respondWithRpcPromise(_0x3bd069,_0x587132,_0x7cc414){return new BPromise(function(_0x267f5c,_0xbb0822){return client[_0xf769('0xf')](_0x3bd069,_0x7cc414)['then'](function(_0x47d8e5){logger[_0xf769('0x10')](_0xf769('0x11'),_0x587132,'request\x20sent');logger['debug'](_0xf769('0x12'),_0x587132,'request\x20sent',JSON[_0xf769('0x13')](_0x47d8e5));if(_0x47d8e5[_0xf769('0x14')]){if(_0x47d8e5[_0xf769('0x14')]['code']===0x1f4){logger[_0xf769('0x14')](_0xf769('0x11'),_0x587132,_0x47d8e5[_0xf769('0x14')][_0xf769('0x15')]);return _0xbb0822(_0x47d8e5[_0xf769('0x14')][_0xf769('0x15')]);}logger[_0xf769('0x14')](_0xf769('0x11'),_0x587132,_0x47d8e5[_0xf769('0x14')][_0xf769('0x15')]);return _0x267f5c(_0x47d8e5['error'][_0xf769('0x15')]);}else{logger[_0xf769('0x10')](_0xf769('0x11'),_0x587132,'request\x20sent');_0x267f5c(_0x47d8e5[_0xf769('0x16')]['message']);}})[_0xf769('0x17')](function(_0x4632b6){logger[_0xf769('0x14')](_0xf769('0x11'),_0x587132,_0x4632b6);_0xbb0822(_0x4632b6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1570aa7..f375256 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 _0x5cee=['remove','update','register','cmList:','./cmList.events'];(function(_0x545312,_0x563053){var _0x52bc56=function(_0x14a75d){while(--_0x14a75d){_0x545312['push'](_0x545312['shift']());}};_0x52bc56(++_0x563053);}(_0x5cee,0x19e));var _0xe5ce=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x5cee[_0x4d613c];return _0x301fe3;};'use strict';var CmListEvents=require(_0xe5ce('0x0'));var events=['save',_0xe5ce('0x1'),_0xe5ce('0x2')];function createListener(_0x56489f,_0x5bc380){return function(_0x1b007f){_0x5bc380['emit'](_0x56489f,_0x1b007f);};}function removeListener(_0x1e6983,_0x1f7168){return function(){CmListEvents['removeListener'](_0x1e6983,_0x1f7168);};}exports[_0xe5ce('0x3')]=function(_0x207102){for(var _0x24973b=0x0,_0x1d14ac=events['length'];_0x24973b<_0x1d14ac;_0x24973b++){var _0x3ec2bd=events[_0x24973b];var _0x2bff67=createListener(_0xe5ce('0x4')+_0x3ec2bd,_0x207102);CmListEvents['on'](_0x3ec2bd,_0x2bff67);}}; \ No newline at end of file +var _0x54de=['remove','update','emit','./cmList.events'];(function(_0x4307f7,_0x4f8a99){var _0x35eea0=function(_0x18fd09){while(--_0x18fd09){_0x4307f7['push'](_0x4307f7['shift']());}};_0x35eea0(++_0x4f8a99);}(_0x54de,0x14f));var _0xe54d=function(_0x4dc81d,_0x4b9209){_0x4dc81d=_0x4dc81d-0x0;var _0x34a072=_0x54de[_0x4dc81d];return _0x34a072;};'use strict';var CmListEvents=require(_0xe54d('0x0'));var events=['save',_0xe54d('0x1'),_0xe54d('0x2')];function createListener(_0x194685,_0x488186){return function(_0x141a5f){_0x488186[_0xe54d('0x3')](_0x194685,_0x141a5f);};}function removeListener(_0x279524,_0x49d81f){return function(){CmListEvents['removeListener'](_0x279524,_0x49d81f);};}exports['register']=function(_0x3f8e6d){for(var _0x23fd7c=0x0,_0x15b5a8=events['length'];_0x23fd7c<_0x15b5a8;_0x23fd7c++){var _0x124092=events[_0x23fd7c];var _0x5f0b7a=createListener('cmList:'+_0x124092,_0x3f8e6d);CmListEvents['on'](_0x124092,_0x5f0b7a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0f530bb..44ced32 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 _0x64fa=['/:id','/:id/dispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/contacts','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields'];(function(_0x2dbfa5,_0x46ff7e){var _0xb8b54e=function(_0x4501ff){while(--_0x4501ff){_0x2dbfa5['push'](_0x2dbfa5['shift']());}};_0xb8b54e(++_0x46ff7e);}(_0x64fa,0xbf));var _0xa64f=function(_0x314fa4,_0x284d9a){_0x314fa4=_0x314fa4-0x0;var _0x40fc67=_0x64fa[_0x314fa4];return _0x40fc67;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa64f('0x0'));var express=require(_0xa64f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa64f('0x2'));var interaction=require(_0xa64f('0x3'));var config=require(_0xa64f('0x4'));var controller=require(_0xa64f('0x5'));router[_0xa64f('0x6')]('/',auth[_0xa64f('0x7')](),controller[_0xa64f('0x8')]);router[_0xa64f('0x6')](_0xa64f('0x9'),auth[_0xa64f('0x7')](),controller[_0xa64f('0xa')]);router[_0xa64f('0x6')](_0xa64f('0xb'),auth[_0xa64f('0x7')](),controller[_0xa64f('0xc')]);router[_0xa64f('0x6')](_0xa64f('0xd'),auth[_0xa64f('0x7')](),controller['show']);router[_0xa64f('0x6')](_0xa64f('0xe'),auth[_0xa64f('0x7')](),controller['getDispositions']);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0xa64f('0xf')]);router[_0xa64f('0x6')]('/:id/contacts/csv',auth[_0xa64f('0x7')](),controller[_0xa64f('0x10')]);router[_0xa64f('0x6')](_0xa64f('0x11'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x12')]);router[_0xa64f('0x6')](_0xa64f('0x13'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x14')]);router[_0xa64f('0x15')]('/',auth[_0xa64f('0x7')](),controller[_0xa64f('0x16')]);router[_0xa64f('0x15')](_0xa64f('0xe'),auth[_0xa64f('0x7')](),controller['addDisposition']);router[_0xa64f('0x15')](_0xa64f('0x17'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x18')]);router[_0xa64f('0x15')](_0xa64f('0x11'),auth['isAuthenticated'](),controller[_0xa64f('0x19')]);router[_0xa64f('0x15')](_0xa64f('0x13'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x1a')]);router[_0xa64f('0x1b')](_0xa64f('0xd'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x1c')]);router[_0xa64f('0x1d')](_0xa64f('0xd'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x1e')]);router[_0xa64f('0x1d')](_0xa64f('0xe'),auth[_0xa64f('0x7')](),controller[_0xa64f('0x1f')]);router[_0xa64f('0x1d')]('/:id/users',auth[_0xa64f('0x7')](),controller[_0xa64f('0x20')]);module[_0xa64f('0x21')]=router; \ No newline at end of file +var _0x860a=['getContactsCsv','/:id/fields','/:id/users','post','create','addContacts','addCustomField','update','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','isAuthenticated','/describe','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0x860a,0x14a));var _0xa860=function(_0x2461f9,_0x401977){_0x2461f9=_0x2461f9-0x0;var _0x109aa6=_0x860a[_0x2461f9];return _0x109aa6;};'use strict';var multer=require(_0xa860('0x0'));var util=require(_0xa860('0x1'));var path=require(_0xa860('0x2'));var timeout=require(_0xa860('0x3'));var express=require(_0xa860('0x4'));var router=express[_0xa860('0x5')]();var fs_extra=require(_0xa860('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa860('0x7'));var config=require('../../config/environment');var controller=require(_0xa860('0x8'));router[_0xa860('0x9')]('/',auth[_0xa860('0xa')](),controller['index']);router['get'](_0xa860('0xb'),auth[_0xa860('0xa')](),controller['describe']);router[_0xa860('0x9')]('/global_fields',auth[_0xa860('0xa')](),controller[_0xa860('0xc')]);router[_0xa860('0x9')](_0xa860('0xd'),auth[_0xa860('0xa')](),controller['show']);router[_0xa860('0x9')](_0xa860('0xe'),auth[_0xa860('0xa')](),controller[_0xa860('0xf')]);router[_0xa860('0x9')](_0xa860('0x10'),auth['isAuthenticated'](),controller['getContacts']);router[_0xa860('0x9')](_0xa860('0x11'),auth[_0xa860('0xa')](),controller[_0xa860('0x12')]);router[_0xa860('0x9')](_0xa860('0x13'),auth[_0xa860('0xa')](),controller['getCustomFields']);router['get'](_0xa860('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa860('0x15')]('/',auth[_0xa860('0xa')](),controller[_0xa860('0x16')]);router[_0xa860('0x15')](_0xa860('0xe'),auth[_0xa860('0xa')](),controller['addDisposition']);router[_0xa860('0x15')](_0xa860('0x10'),auth['isAuthenticated'](),controller[_0xa860('0x17')]);router['post'](_0xa860('0x13'),auth[_0xa860('0xa')](),controller[_0xa860('0x18')]);router['post'](_0xa860('0x14'),auth[_0xa860('0xa')](),controller['addAgents']);router['put'](_0xa860('0xd'),auth['isAuthenticated'](),controller[_0xa860('0x19')]);router[_0xa860('0x1a')]('/:id',auth[_0xa860('0xa')](),controller['destroy']);router[_0xa860('0x1a')](_0xa860('0xe'),auth[_0xa860('0xa')](),controller[_0xa860('0x1b')]);router[_0xa860('0x1a')]('/:id/users',auth[_0xa860('0xa')](),controller[_0xa860('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d3c2775..d33a20f 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 _0xca7c=['STRING','getDataValue','field'];(function(_0x22c4c2,_0x545de5){var _0x4705b2=function(_0x2e707e){while(--_0x2e707e){_0x22c4c2['push'](_0x22c4c2['shift']());}};_0x4705b2(++_0x545de5);}(_0xca7c,0x1a5));var _0xcca7=function(_0x1b62c0,_0x5006cd){_0x1b62c0=_0x1b62c0-0x0;var _0x4d2e68=_0xca7c[_0x1b62c0];return _0x4d2e68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ad0f4){return this[_0xcca7('0x0')](_0xcca7('0x1'));}},'field':{'type':Sequelize[_0xcca7('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0xcca7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xcca7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbc2e=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x437d78,_0x3b0bed){var _0x48b6dd=function(_0x217114){while(--_0x217114){_0x437d78['push'](_0x437d78['shift']());}};_0x48b6dd(++_0x3b0bed);}(_0xbc2e,0x79));var _0xebc2=function(_0x5b44d5,_0x2c8671){_0x5b44d5=_0x5b44d5-0x0;var _0x50c79c=_0xbc2e[_0x5b44d5];return _0x50c79c;};'use strict';var Sequelize=require(_0xebc2('0x0'));module['exports']={'name':{'type':Sequelize[_0xebc2('0x1')],'get':function(_0x448181){return this[_0xebc2('0x2')](_0xebc2('0x3'));}},'field':{'type':Sequelize[_0xebc2('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xebc2('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index bf32cbb..97fae49 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(_0x1436b3,_0x2761ff){var _0x2ddf48=function(_0x5c9386){while(--_0x5c9386){_0x1436b3['push'](_0x1436b3['shift']());}};_0x2ddf48(++_0x2761ff);}(_0x7a54,0x106));var _0x47a5=function(_0x214901,_0x2bf7fe){_0x214901=_0x214901-0x0;var _0x10747a=_0x7a54[_0x214901];return _0x10747a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2b318f,_0x896386){var _0x3b9722=function(_0x205c9e){while(--_0x205c9e){_0x2b318f['push'](_0x2b318f['shift']());}};_0x3b9722(++_0x896386);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 3bb5d5a..03e8d37 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 _0xddbc=['bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0xddbc,0x97));var _0xcddb=function(_0x1abfa1,_0x37ebb9){_0x1abfa1=_0x1abfa1-0x0;var _0xbecf93=_0xddbc[_0x1abfa1];return _0xbecf93;};'use strict';var _=require(_0xcddb('0x0'));var util=require(_0xcddb('0x1'));var logger=require(_0xcddb('0x2'))(_0xcddb('0x3'));var moment=require(_0xcddb('0x4'));var BPromise=require(_0xcddb('0x5'));var rp=require(_0xcddb('0x6'));var fs=require('fs');var path=require(_0xcddb('0x7'));var rimraf=require(_0xcddb('0x8'));var config=require('../../config/environment');var attributes=require(_0xcddb('0x9'));module[_0xcddb('0xa')]=function(_0x3ce81f,_0x5551ee){return _0x3ce81f[_0xcddb('0xb')]('Condition',attributes,{'tableName':_0xcddb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0449=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','util','moment','bluebird'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0449,0xe0));var _0x9044=function(_0x5d670e,_0x726ea9){_0x5d670e=_0x5d670e-0x0;var _0x10acc4=_0x0449[_0x5d670e];return _0x10acc4;};'use strict';var _=require(_0x9044('0x0'));var util=require(_0x9044('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9044('0x2'));var BPromise=require(_0x9044('0x3'));var rp=require(_0x9044('0x4'));var fs=require('fs');var path=require(_0x9044('0x5'));var rimraf=require(_0x9044('0x6'));var config=require(_0x9044('0x7'));var attributes=require(_0x9044('0x8'));module[_0x9044('0x9')]=function(_0x12aa96,_0x8c6c48){return _0x12aa96[_0x9044('0xa')](_0x9044('0xb'),attributes,{'tableName':'tools_conditions','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 1d65506..4afa3f3 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 _0x23d0=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cb0af,_0x4dd493){var _0x1a871a=function(_0x5cb36c){while(--_0x5cb36c){_0x5cb0af['push'](_0x5cb0af['shift']());}};_0x1a871a(++_0x4dd493);}(_0x23d0,0x1ba));var _0x023d=function(_0x138ea8,_0x239dd4){_0x138ea8=_0x138ea8-0x0;var _0x15f2d4=_0x23d0[_0x138ea8];return _0x15f2d4;};'use strict';var _=require('lodash');var util=require(_0x023d('0x0'));var moment=require('moment');var BPromise=require(_0x023d('0x1'));var rs=require(_0x023d('0x2'));var fs=require('fs');var Redis=require(_0x023d('0x3'));var db=require(_0x023d('0x4'))['db'];var utils=require(_0x023d('0x5'));var logger=require(_0x023d('0x6'))(_0x023d('0x7'));var config=require(_0x023d('0x8'));var jayson=require(_0x023d('0x9'));var client=jayson['client'][_0x023d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x100751,_0x1cf34d,_0x3d74c0){return new BPromise(function(_0x2c633e,_0x40b375){return client[_0x023d('0xb')](_0x100751,_0x3d74c0)[_0x023d('0xc')](function(_0x2b8f9b){logger['info'](_0x023d('0xd'),_0x1cf34d,_0x023d('0xe'));logger[_0x023d('0xf')](_0x023d('0x10'),_0x1cf34d,'request\x20sent',JSON[_0x023d('0x11')](_0x2b8f9b));if(_0x2b8f9b[_0x023d('0x12')]){if(_0x2b8f9b[_0x023d('0x12')][_0x023d('0x13')]===0x1f4){logger[_0x023d('0x12')](_0x023d('0xd'),_0x1cf34d,_0x2b8f9b[_0x023d('0x12')][_0x023d('0x14')]);return _0x40b375(_0x2b8f9b[_0x023d('0x12')]['message']);}logger[_0x023d('0x12')](_0x023d('0xd'),_0x1cf34d,_0x2b8f9b[_0x023d('0x12')][_0x023d('0x14')]);return _0x2c633e(_0x2b8f9b['error'][_0x023d('0x14')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x1cf34d,_0x023d('0xe'));_0x2c633e(_0x2b8f9b['result'][_0x023d('0x14')]);}})[_0x023d('0x15')](function(_0x1d0a31){logger[_0x023d('0x12')](_0x023d('0xd'),_0x1cf34d,_0x1d0a31);_0x40b375(_0x1d0a31);});});} \ No newline at end of file +var _0x9b3c=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x57056c,_0x12c8a1){var _0xb624a2=function(_0x3933fc){while(--_0x3933fc){_0x57056c['push'](_0x57056c['shift']());}};_0xb624a2(++_0x12c8a1);}(_0x9b3c,0x1dd));var _0xc9b3=function(_0x15ffd1,_0xf47433){_0x15ffd1=_0x15ffd1-0x0;var _0x280d70=_0x9b3c[_0x15ffd1];return _0x280d70;};'use strict';var _=require(_0xc9b3('0x0'));var util=require('util');var moment=require(_0xc9b3('0x1'));var BPromise=require(_0xc9b3('0x2'));var rs=require(_0xc9b3('0x3'));var fs=require('fs');var Redis=require(_0xc9b3('0x4'));var db=require(_0xc9b3('0x5'))['db'];var utils=require(_0xc9b3('0x6'));var logger=require(_0xc9b3('0x7'))(_0xc9b3('0x8'));var config=require(_0xc9b3('0x9'));var jayson=require(_0xc9b3('0xa'));var client=jayson[_0xc9b3('0xb')][_0xc9b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4997dd,_0x1bfef7,_0x5e1129){return new BPromise(function(_0x449e24,_0x207588){return client[_0xc9b3('0xd')](_0x4997dd,_0x5e1129)[_0xc9b3('0xe')](function(_0x374657){logger[_0xc9b3('0xf')](_0xc9b3('0x10'),_0x1bfef7,_0xc9b3('0x11'));logger[_0xc9b3('0x12')]('Condition,\x20%s,\x20%s,\x20%s',_0x1bfef7,'request\x20sent',JSON[_0xc9b3('0x13')](_0x374657));if(_0x374657['error']){if(_0x374657['error'][_0xc9b3('0x14')]===0x1f4){logger[_0xc9b3('0x15')]('Condition,\x20%s,\x20%s',_0x1bfef7,_0x374657[_0xc9b3('0x15')][_0xc9b3('0x16')]);return _0x207588(_0x374657[_0xc9b3('0x15')][_0xc9b3('0x16')]);}logger[_0xc9b3('0x15')](_0xc9b3('0x10'),_0x1bfef7,_0x374657[_0xc9b3('0x15')][_0xc9b3('0x16')]);return _0x449e24(_0x374657[_0xc9b3('0x15')][_0xc9b3('0x16')]);}else{logger['info'](_0xc9b3('0x10'),_0x1bfef7,_0xc9b3('0x11'));_0x449e24(_0x374657[_0xc9b3('0x17')][_0xc9b3('0x16')]);}})[_0xc9b3('0x18')](function(_0x94566a){logger[_0xc9b3('0x15')](_0xc9b3('0x10'),_0x1bfef7,_0x94566a);_0x207588(_0x94566a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8c97a15..dbd21eb 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 _0xaec3=['delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaec3,0x161));var _0x3aec=function(_0x4b76ff,_0x1e79a9){_0x4b76ff=_0x4b76ff-0x0;var _0x1d8249=_0xaec3[_0x4b76ff];return _0x1d8249;};'use strict';var multer=require('multer');var util=require(_0x3aec('0x0'));var path=require('path');var timeout=require(_0x3aec('0x1'));var express=require(_0x3aec('0x2'));var router=express[_0x3aec('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3aec('0x4'));var interaction=require(_0x3aec('0x5'));var config=require(_0x3aec('0x6'));var controller=require(_0x3aec('0x7'));router[_0x3aec('0x8')](_0x3aec('0x9'),auth[_0x3aec('0xa')](),controller['update']);router[_0x3aec('0xb')](_0x3aec('0x9'),auth[_0x3aec('0xa')](),controller[_0x3aec('0xc')]);module[_0x3aec('0xd')]=router; \ No newline at end of file +var _0xf625=['delete','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xf625,0x1b6));var _0x5f62=function(_0x204c59,_0x5614ee){_0x204c59=_0x204c59-0x0;var _0x4cd35b=_0xf625[_0x204c59];return _0x4cd35b;};'use strict';var multer=require(_0x5f62('0x0'));var util=require(_0x5f62('0x1'));var path=require(_0x5f62('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f62('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5f62('0x4'));var interaction=require(_0x5f62('0x5'));var config=require(_0x5f62('0x6'));var controller=require(_0x5f62('0x7'));router[_0x5f62('0x8')]('/:id',auth[_0x5f62('0x9')](),controller['update']);router[_0x5f62('0xa')](_0x5f62('0xb'),auth[_0x5f62('0x9')](),controller[_0x5f62('0xc')]);module[_0x5f62('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 33f10f3..baf24f0 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 _0x308b=['sequelize','exports','STRING','name'];(function(_0x5bc93e,_0x48529d){var _0x3012da=function(_0x5372b8){while(--_0x5372b8){_0x5bc93e['push'](_0x5bc93e['shift']());}};_0x3012da(++_0x48529d);}(_0x308b,0x1d4));var _0xb308=function(_0x7f2908,_0x1067e5){_0x7f2908=_0x7f2908-0x0;var _0x12648b=_0x308b[_0x7f2908];return _0x12648b;};'use strict';var Sequelize=require(_0xb308('0x0'));module[_0xb308('0x1')]={'name':{'type':Sequelize[_0xb308('0x2')],'allowNull':![],'unique':_0xb308('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb308('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7772=['STRING','name','INTEGER','sequelize'];(function(_0x29d1f8,_0x4c7331){var _0x4720ca=function(_0x594d85){while(--_0x594d85){_0x29d1f8['push'](_0x29d1f8['shift']());}};_0x4720ca(++_0x4c7331);}(_0x7772,0x1b7));var _0x2777=function(_0x10a5fb,_0x8b109b){_0x10a5fb=_0x10a5fb-0x0;var _0x57ea51=_0x7772[_0x10a5fb];return _0x57ea51;};'use strict';var Sequelize=require(_0x2777('0x0'));module['exports']={'name':{'type':Sequelize[_0x2777('0x1')],'allowNull':![],'unique':_0x2777('0x2')},'OrderBy':{'type':Sequelize[_0x2777('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2777('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index c6d3521..8226174 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 _0xd4a2=['stack','name','send','index','map','ContactItemType','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1e0ac1,_0x21dee2){_0x1e0ac1=_0x1e0ac1-0x0;var _0x457c93=_0xd4a2[_0x1e0ac1];return _0x457c93;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];function respondWithStatusCode(_0x45b9fb,_0x5ac803){_0x5ac803=_0x5ac803||0xcc;return function(_0x2f785f){if(_0x2f785f){return _0x45b9fb[_0x2d4a('0x17')](_0x5ac803);}return _0x45b9fb[_0x2d4a('0x18')](_0x5ac803)[_0x2d4a('0x19')]();};}function respondWithResult(_0x544622,_0x4be8b4){_0x4be8b4=_0x4be8b4||0xc8;return function(_0x2a1d0f){if(_0x2a1d0f){return _0x544622['status'](_0x4be8b4)[_0x2d4a('0x1a')](_0x2a1d0f);}};}function respondWithFilteredResult(_0x175bda,_0x11896d){return function(_0x3a3156){if(_0x3a3156){var _0x4c5287=typeof _0x11896d[_0x2d4a('0x1b')]==='undefined'&&typeof _0x11896d[_0x2d4a('0x1c')]==='undefined';var _0x435687=_0x3a3156[_0x2d4a('0x1d')];var _0x2188b2=_0x4c5287?0x0:_0x11896d[_0x2d4a('0x1b')];var _0x498956=_0x4c5287?_0x3a3156['count']:_0x11896d['offset']+_0x11896d[_0x2d4a('0x1c')];var _0x1966d1;if(_0x498956>=_0x435687){_0x498956=_0x435687;_0x1966d1=0xc8;}else{_0x1966d1=0xce;}_0x175bda[_0x2d4a('0x18')](_0x1966d1);return _0x175bda[_0x2d4a('0x1e')](_0x2d4a('0x1f'),_0x2188b2+'-'+_0x498956+'/'+_0x435687)[_0x2d4a('0x1a')](_0x3a3156);}return null;};}function patchUpdates(_0x56445a){return function(_0x49f378){try{jsonpatch[_0x2d4a('0x20')](_0x49f378,_0x56445a,!![]);}catch(_0x1f3e17){return BPromise[_0x2d4a('0x21')](_0x1f3e17);}return _0x49f378[_0x2d4a('0x22')]();};}function saveUpdates(_0x1a2d20,_0x2e7736){return function(_0x22dd0b){if(_0x22dd0b){return _0x22dd0b[_0x2d4a('0x23')](_0x1a2d20)['then'](function(_0x26e7b8){return _0x26e7b8;});}return null;};}function removeEntity(_0x3240a2,_0x2c3799){return function(_0x42d813){if(_0x42d813){return _0x42d813[_0x2d4a('0x24')]()[_0x2d4a('0x25')](function(){var _0x456d38=_0x42d813[_0x2d4a('0x26')]({'plain':!![]});var _0x54c910='ContactItemTypes';return db['UserProfileResource'][_0x2d4a('0x24')]({'where':{'type':_0x54c910,'resourceId':_0x456d38['id']}})['then'](function(){return _0x42d813;});})[_0x2d4a('0x25')](function(){_0x3240a2[_0x2d4a('0x18')](0xcc)[_0x2d4a('0x19')]();});}};}function handleEntityNotFound(_0x1d2fa6,_0x13e769){return function(_0x326c38){if(!_0x326c38){_0x1d2fa6[_0x2d4a('0x17')](0x194);}return _0x326c38;};}function handleError(_0x27b358,_0x4f1fc8){_0x4f1fc8=_0x4f1fc8||0x1f4;return function(_0x436f53){logger['error'](_0x436f53[_0x2d4a('0x27')]);if(_0x436f53[_0x2d4a('0x28')]){delete _0x436f53[_0x2d4a('0x28')];}_0x27b358[_0x2d4a('0x18')](_0x4f1fc8)[_0x2d4a('0x29')](_0x436f53);};}exports[_0x2d4a('0x2a')]=function(_0x25ac5c,_0x2e8063){var _0x51b447={},_0x45a4fa={},_0x3d94b7={'count':0x0,'rows':[]};var _0xda1ef2=_[_0x2d4a('0x2b')](db[_0x2d4a('0x2c')]['rawAttributes'],function(_0x217653){return{'name':_0x217653[_0x2d4a('0x2d')],'type':_0x217653[_0x2d4a('0x2e')][_0x2d4a('0x2f')]};});_0x45a4fa[_0x2d4a('0x30')]=_['map'](_0xda1ef2,_0x2d4a('0x28'));_0x45a4fa[_0x2d4a('0x31')]=_[_0x2d4a('0x32')](_0x25ac5c[_0x2d4a('0x31')]);_0x45a4fa[_0x2d4a('0x33')]=_[_0x2d4a('0x34')](_0x45a4fa['model'],_0x45a4fa[_0x2d4a('0x31')]);_0x51b447[_0x2d4a('0x35')]=_[_0x2d4a('0x34')](_0x45a4fa[_0x2d4a('0x30')],qs[_0x2d4a('0x36')](_0x25ac5c['query'][_0x2d4a('0x36')]));_0x51b447[_0x2d4a('0x35')]=_0x51b447['attributes'][_0x2d4a('0x37')]?_0x51b447[_0x2d4a('0x35')]:_0x45a4fa[_0x2d4a('0x30')];if(!_0x25ac5c[_0x2d4a('0x31')][_0x2d4a('0x38')](_0x2d4a('0x39'))){_0x51b447['limit']=qs[_0x2d4a('0x1c')](_0x25ac5c[_0x2d4a('0x31')][_0x2d4a('0x1c')]);_0x51b447[_0x2d4a('0x1b')]=qs[_0x2d4a('0x1b')](_0x25ac5c[_0x2d4a('0x31')]['offset']);}_0x51b447['order']=qs[_0x2d4a('0x3a')](_0x25ac5c['query'][_0x2d4a('0x3a')]);_0x51b447[_0x2d4a('0x3b')]=qs['filters'](_[_0x2d4a('0x3c')](_0x25ac5c[_0x2d4a('0x31')],_0x45a4fa[_0x2d4a('0x33')]),_0xda1ef2);if(_0x25ac5c[_0x2d4a('0x31')][_0x2d4a('0x3d')]){_0x51b447[_0x2d4a('0x3b')]=_[_0x2d4a('0x3e')](_0x51b447[_0x2d4a('0x3b')],{'$or':_[_0x2d4a('0x2b')](_0xda1ef2,function(_0x2d64b0){if(_0x2d64b0[_0x2d4a('0x2e')]!=='VIRTUAL'){var _0x8bc995={};_0x8bc995[_0x2d64b0[_0x2d4a('0x28')]]={'$like':'%'+_0x25ac5c[_0x2d4a('0x31')][_0x2d4a('0x3d')]+'%'};return _0x8bc995;}})});}_0x51b447=_[_0x2d4a('0x3e')]({},_0x51b447,_0x25ac5c['options']);var _0x50dbc3={'where':_0x51b447['where']};return db['ContactItemType'][_0x2d4a('0x1d')](_0x50dbc3)[_0x2d4a('0x25')](function(_0xf39020){_0x3d94b7[_0x2d4a('0x1d')]=_0xf39020;if(_0x25ac5c['query'][_0x2d4a('0x3f')]){_0x51b447[_0x2d4a('0x40')]=[{'all':!![]}];}return db['ContactItemType'][_0x2d4a('0x41')](_0x51b447);})[_0x2d4a('0x25')](function(_0x8a9375){_0x3d94b7[_0x2d4a('0x42')]=_0x8a9375;return _0x3d94b7;})[_0x2d4a('0x25')](respondWithFilteredResult(_0x2e8063,_0x51b447))[_0x2d4a('0x43')](handleError(_0x2e8063,null));};exports['show']=function(_0x236fbf,_0x2d6eca){var _0x12c899={'raw':!![],'where':{'id':_0x236fbf[_0x2d4a('0x44')]['id']}},_0x365399={};_0x365399[_0x2d4a('0x30')]=_['keys'](db[_0x2d4a('0x2c')][_0x2d4a('0x45')]);_0x365399[_0x2d4a('0x31')]=_['keys'](_0x236fbf[_0x2d4a('0x31')]);_0x365399['filters']=_[_0x2d4a('0x34')](_0x365399[_0x2d4a('0x30')],_0x365399[_0x2d4a('0x31')]);_0x12c899[_0x2d4a('0x35')]=_[_0x2d4a('0x34')](_0x365399['model'],qs['fields'](_0x236fbf[_0x2d4a('0x31')][_0x2d4a('0x36')]));_0x12c899['attributes']=_0x12c899[_0x2d4a('0x35')]['length']?_0x12c899[_0x2d4a('0x35')]:_0x365399[_0x2d4a('0x30')];if(_0x236fbf[_0x2d4a('0x31')]['includeAll']){_0x12c899[_0x2d4a('0x40')]=[{'all':!![]}];}_0x12c899=_['merge']({},_0x12c899,_0x236fbf[_0x2d4a('0x46')]);return db[_0x2d4a('0x2c')][_0x2d4a('0x47')](_0x12c899)[_0x2d4a('0x25')](handleEntityNotFound(_0x2d6eca,null))[_0x2d4a('0x25')](respondWithResult(_0x2d6eca,null))[_0x2d4a('0x43')](handleError(_0x2d6eca,null));};exports[_0x2d4a('0x48')]=function(_0x2b2f4b,_0x1ffb96){return db[_0x2d4a('0x2c')][_0x2d4a('0x48')](_0x2b2f4b['body'],{})[_0x2d4a('0x25')](function(_0x26a070){var _0x3336b2=_0x2b2f4b[_0x2d4a('0x49')][_0x2d4a('0x26')]({'plain':!![]});if(!_0x3336b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3336b2[_0x2d4a('0x4a')]===_0x2d4a('0x49')){var _0x2123e8=_0x26a070[_0x2d4a('0x26')]({'plain':!![]});var _0x2f038a='ContactItemTypes';return db['UserProfileSection'][_0x2d4a('0x47')]({'where':{'name':_0x2f038a,'userProfileId':_0x3336b2[_0x2d4a('0x4b')]},'raw':!![]})['then'](function(_0x15e204){if(_0x15e204&&_0x15e204[_0x2d4a('0x4c')]===0x0){return db[_0x2d4a('0x4d')][_0x2d4a('0x48')]({'name':_0x2123e8['name'],'resourceId':_0x2123e8['id'],'type':_0x15e204[_0x2d4a('0x28')],'sectionId':_0x15e204['id']},{})['then'](function(){return _0x26a070;});}else{return _0x26a070;}})[_0x2d4a('0x43')](function(_0x3fe91b){logger[_0x2d4a('0x4e')](_0x2d4a('0x4f'),_0x3fe91b);throw _0x3fe91b;});}return _0x26a070;})[_0x2d4a('0x25')](respondWithResult(_0x1ffb96,0xc9))[_0x2d4a('0x43')](handleError(_0x1ffb96,null));};exports[_0x2d4a('0x23')]=function(_0x1b088c,_0x5d086a){if(_0x1b088c[_0x2d4a('0x50')]['id']){delete _0x1b088c[_0x2d4a('0x50')]['id'];}return db[_0x2d4a('0x2c')][_0x2d4a('0x47')]({'where':{'id':_0x1b088c[_0x2d4a('0x44')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x5d086a,null))[_0x2d4a('0x25')](saveUpdates(_0x1b088c[_0x2d4a('0x50')],null))[_0x2d4a('0x25')](respondWithResult(_0x5d086a,null))[_0x2d4a('0x43')](handleError(_0x5d086a,null));};exports[_0x2d4a('0x24')]=function(_0x113bc4,_0x1b4ae7){return db[_0x2d4a('0x2c')][_0x2d4a('0x47')]({'where':{'id':_0x113bc4[_0x2d4a('0x44')]['id']}})[_0x2d4a('0x25')](handleEntityNotFound(_0x1b4ae7,null))['then'](db[_0x2d4a('0x51')][_0x2d4a('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x113bc4['params']['id']}}))[_0x2d4a('0x25')](removeEntity(_0x1b4ae7,null))[_0x2d4a('0x43')](handleError(_0x1b4ae7,null));}; \ No newline at end of file +var _0xd914=['count','set','Content-Range','apply','reject','update','then','destroy','ContactItemTypes','UserProfileResource','name','send','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','options','ContactItemType','includeAll','include','rows','catch','show','params','merge','find','create','body','get','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x139154,_0x1548cf){var _0x5c2447=function(_0x81588a){while(--_0x81588a){_0x139154['push'](_0x139154['shift']());}};_0x5c2447(++_0x1548cf);}(_0xd914,0x17f));var _0x4d91=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xd914[_0x146a97];return _0x259d5c;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){var _0x55356b=_0x12b722['get']({'plain':!![]});var _0x1ee6b3=_0x4d91('0x28');return db[_0x4d91('0x29')][_0x4d91('0x27')]({'where':{'type':_0x1ee6b3,'resourceId':_0x55356b['id']}})[_0x4d91('0x26')](function(){return _0x12b722;});})[_0x4d91('0x26')](function(){_0x9cb864[_0x4d91('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc353,_0xda9802){return function(_0x12ac74){if(!_0x12ac74){_0x3dc353['sendStatus'](0x194);}return _0x12ac74;};}function handleError(_0x480a56,_0x299f27){_0x299f27=_0x299f27||0x1f4;return function(_0x470079){logger['error'](_0x470079['stack']);if(_0x470079[_0x4d91('0x2a')]){delete _0x470079[_0x4d91('0x2a')];}_0x480a56[_0x4d91('0x1b')](_0x299f27)[_0x4d91('0x2b')](_0x470079);};}exports['index']=function(_0x2587a1,_0x31bbf8){var _0x468e95={},_0xee7535={},_0xa63422={'count':0x0,'rows':[]};var _0x3466f3=_[_0x4d91('0x2c')](db['ContactItemType'][_0x4d91('0x2d')],function(_0x4f44ff){return{'name':_0x4f44ff['fieldName'],'type':_0x4f44ff[_0x4d91('0x2e')][_0x4d91('0x2f')]};});_0xee7535['model']=_[_0x4d91('0x2c')](_0x3466f3,_0x4d91('0x2a'));_0xee7535[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x2587a1[_0x4d91('0x30')]);_0xee7535['filters']=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],_0xee7535[_0x4d91('0x30')]);_0x468e95[_0x4d91('0x34')]=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],qs['fields'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x35')]));_0x468e95['attributes']=_0x468e95[_0x4d91('0x34')][_0x4d91('0x36')]?_0x468e95[_0x4d91('0x34')]:_0xee7535['model'];if(!_0x2587a1[_0x4d91('0x30')][_0x4d91('0x37')](_0x4d91('0x38'))){_0x468e95[_0x4d91('0x39')]=qs['limit'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x39')]);_0x468e95[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x2587a1['query']['offset']);}_0x468e95[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x2587a1['query'][_0x4d91('0x3b')]);_0x468e95[_0x4d91('0x3c')]=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x2587a1['query'],_0xee7535[_0x4d91('0x3d')]),_0x3466f3);if(_0x2587a1[_0x4d91('0x30')]['filter']){_0x468e95[_0x4d91('0x3c')]=_['merge'](_0x468e95[_0x4d91('0x3c')],{'$or':_['map'](_0x3466f3,function(_0x2dc892){if(_0x2dc892['type']!==_0x4d91('0x3f')){var _0x2782d2={};_0x2782d2[_0x2dc892[_0x4d91('0x2a')]]={'$like':'%'+_0x2587a1[_0x4d91('0x30')]['filter']+'%'};return _0x2782d2;}})});}_0x468e95=_['merge']({},_0x468e95,_0x2587a1[_0x4d91('0x40')]);var _0x55c8d0={'where':_0x468e95[_0x4d91('0x3c')]};return db[_0x4d91('0x41')]['count'](_0x55c8d0)[_0x4d91('0x26')](function(_0x2ae356){_0xa63422[_0x4d91('0x20')]=_0x2ae356;if(_0x2587a1[_0x4d91('0x30')][_0x4d91('0x42')]){_0x468e95[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x41')]['findAll'](_0x468e95);})[_0x4d91('0x26')](function(_0x4c70af){_0xa63422[_0x4d91('0x44')]=_0x4c70af;return _0xa63422;})[_0x4d91('0x26')](respondWithFilteredResult(_0x31bbf8,_0x468e95))[_0x4d91('0x45')](handleError(_0x31bbf8,null));};exports[_0x4d91('0x46')]=function(_0x20ec78,_0x1fc884){var _0x4b8e12={'raw':!![],'where':{'id':_0x20ec78[_0x4d91('0x47')]['id']}},_0x4ffc08={};_0x4ffc08[_0x4d91('0x33')]=_['keys'](db[_0x4d91('0x41')][_0x4d91('0x2d')]);_0x4ffc08[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x20ec78[_0x4d91('0x30')]);_0x4ffc08[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x4ffc08[_0x4d91('0x33')],_0x4ffc08[_0x4d91('0x30')]);_0x4b8e12['attributes']=_['intersection'](_0x4ffc08[_0x4d91('0x33')],qs['fields'](_0x20ec78[_0x4d91('0x30')][_0x4d91('0x35')]));_0x4b8e12[_0x4d91('0x34')]=_0x4b8e12[_0x4d91('0x34')]['length']?_0x4b8e12[_0x4d91('0x34')]:_0x4ffc08['model'];if(_0x20ec78['query'][_0x4d91('0x42')]){_0x4b8e12[_0x4d91('0x43')]=[{'all':!![]}];}_0x4b8e12=_[_0x4d91('0x48')]({},_0x4b8e12,_0x20ec78[_0x4d91('0x40')]);return db[_0x4d91('0x41')][_0x4d91('0x49')](_0x4b8e12)['then'](handleEntityNotFound(_0x1fc884,null))[_0x4d91('0x26')](respondWithResult(_0x1fc884,null))[_0x4d91('0x45')](handleError(_0x1fc884,null));};exports[_0x4d91('0x4a')]=function(_0x449dd8,_0x106e5b){return db[_0x4d91('0x41')][_0x4d91('0x4a')](_0x449dd8[_0x4d91('0x4b')],{})[_0x4d91('0x26')](function(_0x145dfd){var _0x16f776=_0x449dd8['user'][_0x4d91('0x4c')]({'plain':!![]});if(!_0x16f776)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f776[_0x4d91('0x4d')]===_0x4d91('0x4e')){var _0x195e65=_0x145dfd[_0x4d91('0x4c')]({'plain':!![]});var _0x436a3d=_0x4d91('0x28');return db[_0x4d91('0x4f')][_0x4d91('0x49')]({'where':{'name':_0x436a3d,'userProfileId':_0x16f776['userProfileId']},'raw':!![]})[_0x4d91('0x26')](function(_0x43e72c){if(_0x43e72c&&_0x43e72c[_0x4d91('0x50')]===0x0){return db[_0x4d91('0x29')][_0x4d91('0x4a')]({'name':_0x195e65[_0x4d91('0x2a')],'resourceId':_0x195e65['id'],'type':_0x43e72c[_0x4d91('0x2a')],'sectionId':_0x43e72c['id']},{})['then'](function(){return _0x145dfd;});}else{return _0x145dfd;}})[_0x4d91('0x45')](function(_0x2159e4){logger[_0x4d91('0x51')](_0x4d91('0x52'),_0x2159e4);throw _0x2159e4;});}return _0x145dfd;})[_0x4d91('0x26')](respondWithResult(_0x106e5b,0xc9))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x25')]=function(_0x4138c5,_0x645923){if(_0x4138c5[_0x4d91('0x4b')]['id']){delete _0x4138c5[_0x4d91('0x4b')]['id'];}return db[_0x4d91('0x41')][_0x4d91('0x49')]({'where':{'id':_0x4138c5[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x645923,null))[_0x4d91('0x26')](saveUpdates(_0x4138c5[_0x4d91('0x4b')],null))['then'](respondWithResult(_0x645923,null))['catch'](handleError(_0x645923,null));};exports['destroy']=function(_0x45cf4e,_0x10c1dd){return db[_0x4d91('0x41')]['find']({'where':{'id':_0x45cf4e[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x10c1dd,null))[_0x4d91('0x26')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x45cf4e['params']['id']}}))[_0x4d91('0x26')](removeEntity(_0x10c1dd,null))[_0x4d91('0x45')](handleError(_0x10c1dd,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 1c668a5..d9e27ce 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 _0xf650=['bluebird','rimraf','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0xdfd1c4,_0x5243e7){var _0x32d156=function(_0x589d50){while(--_0x589d50){_0xdfd1c4['push'](_0xdfd1c4['shift']());}};_0x32d156(++_0x5243e7);}(_0xf650,0xe7));var _0x0f65=function(_0x1a4f64,_0x206299){_0x1a4f64=_0x1a4f64-0x0;var _0x469434=_0xf650[_0x1a4f64];return _0x469434;};'use strict';var _=require(_0x0f65('0x0'));var util=require(_0x0f65('0x1'));var logger=require(_0x0f65('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f65('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f65('0x4'));var config=require('../../config/environment');var attributes=require(_0x0f65('0x5'));module[_0x0f65('0x6')]=function(_0x405b3b,_0x5133e3){return _0x405b3b[_0x0f65('0x7')]('ContactItemType',attributes,{'tableName':_0x0f65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8686=['api','moment','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger'];(function(_0x368cd6,_0x275b63){var _0x16161d=function(_0x360aec){while(--_0x360aec){_0x368cd6['push'](_0x368cd6['shift']());}};_0x16161d(++_0x275b63);}(_0x8686,0x142));var _0x6868=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x8686[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x6868('0x0'));var util=require('util');var logger=require(_0x6868('0x1'))(_0x6868('0x2'));var moment=require(_0x6868('0x3'));var BPromise=require('bluebird');var rp=require(_0x6868('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6868('0x5'));var config=require(_0x6868('0x6'));var attributes=require(_0x6868('0x7'));module[_0x6868('0x8')]=function(_0x3ab6cb,_0x1e97c9){return _0x3ab6cb[_0x6868('0x9')](_0x6868('0xa'),attributes,{'tableName':_0x6868('0xb'),'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 107f0d0..949cb8f 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 _0x7072=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7072,0x8e));var _0x2707=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7072[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2707('0x3'));var db=require(_0x2707('0x4'))['db'];var utils=require(_0x2707('0x5'));var logger=require('../../config/logger')(_0x2707('0x6'));var config=require(_0x2707('0x7'));var jayson=require(_0x2707('0x8'));var client=jayson[_0x2707('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54facf,_0x155b7f,_0x431013){return new BPromise(function(_0x27cca2,_0x475b50){return client[_0x2707('0xa')](_0x54facf,_0x431013)[_0x2707('0xb')](function(_0x853f7f){logger[_0x2707('0xc')](_0x2707('0xd'),_0x155b7f,_0x2707('0xe'));logger[_0x2707('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x155b7f,'request\x20sent',JSON['stringify'](_0x853f7f));if(_0x853f7f[_0x2707('0x10')]){if(_0x853f7f[_0x2707('0x10')][_0x2707('0x11')]===0x1f4){logger[_0x2707('0x10')](_0x2707('0xd'),_0x155b7f,_0x853f7f[_0x2707('0x10')][_0x2707('0x12')]);return _0x475b50(_0x853f7f[_0x2707('0x10')][_0x2707('0x12')]);}logger[_0x2707('0x10')]('ContactItemType,\x20%s,\x20%s',_0x155b7f,_0x853f7f[_0x2707('0x10')][_0x2707('0x12')]);return _0x27cca2(_0x853f7f[_0x2707('0x10')][_0x2707('0x12')]);}else{logger[_0x2707('0xc')](_0x2707('0xd'),_0x155b7f,_0x2707('0xe'));_0x27cca2(_0x853f7f[_0x2707('0x13')]['message']);}})[_0x2707('0x14')](function(_0x363809){logger[_0x2707('0x10')]('ContactItemType,\x20%s,\x20%s',_0x155b7f,_0x363809);_0x475b50(_0x363809);});});} \ No newline at end of file +var _0xa454=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','info'];(function(_0x2ff687,_0x1b8943){var _0x3c96a3=function(_0x4f9d3c){while(--_0x4f9d3c){_0x2ff687['push'](_0x2ff687['shift']());}};_0x3c96a3(++_0x1b8943);}(_0xa454,0xc8));var _0x4a45=function(_0x3a84ae,_0x36abf4){_0x3a84ae=_0x3a84ae-0x0;var _0x4bdcab=_0xa454[_0x3a84ae];return _0x4bdcab;};'use strict';var _=require('lodash');var util=require(_0x4a45('0x0'));var moment=require(_0x4a45('0x1'));var BPromise=require(_0x4a45('0x2'));var rs=require(_0x4a45('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a45('0x4'));var logger=require(_0x4a45('0x5'))('rpc');var config=require(_0x4a45('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4a45('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27c288,_0x4b45f1,_0x474a82){return new BPromise(function(_0x1217c5,_0x4a4696){return client['request'](_0x27c288,_0x474a82)['then'](function(_0x2c5f6c){logger[_0x4a45('0x8')](_0x4a45('0x9'),_0x4b45f1,_0x4a45('0xa'));logger[_0x4a45('0xb')](_0x4a45('0xc'),_0x4b45f1,_0x4a45('0xa'),JSON[_0x4a45('0xd')](_0x2c5f6c));if(_0x2c5f6c[_0x4a45('0xe')]){if(_0x2c5f6c[_0x4a45('0xe')][_0x4a45('0xf')]===0x1f4){logger[_0x4a45('0xe')](_0x4a45('0x9'),_0x4b45f1,_0x2c5f6c[_0x4a45('0xe')][_0x4a45('0x10')]);return _0x4a4696(_0x2c5f6c[_0x4a45('0xe')]['message']);}logger[_0x4a45('0xe')]('ContactItemType,\x20%s,\x20%s',_0x4b45f1,_0x2c5f6c[_0x4a45('0xe')][_0x4a45('0x10')]);return _0x1217c5(_0x2c5f6c[_0x4a45('0xe')][_0x4a45('0x10')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x4b45f1,_0x4a45('0xa'));_0x1217c5(_0x2c5f6c[_0x4a45('0x11')][_0x4a45('0x10')]);}})[_0x4a45('0x12')](function(_0x25580f){logger[_0x4a45('0xe')]('ContactItemType,\x20%s,\x20%s',_0x4b45f1,_0x25580f);_0x4a4696(_0x25580f);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 8a49054..8c8fd32 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 _0xafb3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','/:id','show','put','update','multer','util','path','connect-timeout'];(function(_0x46dab8,_0x4ef8ed){var _0x3d1e3a=function(_0x4579fe){while(--_0x4579fe){_0x46dab8['push'](_0x46dab8['shift']());}};_0x3d1e3a(++_0x4ef8ed);}(_0xafb3,0x13c));var _0x3afb=function(_0x267d8b,_0x46274f){_0x267d8b=_0x267d8b-0x0;var _0x43779e=_0xafb3[_0x267d8b];return _0x43779e;};'use strict';var multer=require(_0x3afb('0x0'));var util=require(_0x3afb('0x1'));var path=require(_0x3afb('0x2'));var timeout=require(_0x3afb('0x3'));var express=require(_0x3afb('0x4'));var router=express[_0x3afb('0x5')]();var fs_extra=require(_0x3afb('0x6'));var auth=require(_0x3afb('0x7'));var interaction=require(_0x3afb('0x8'));var config=require('../../config/environment');var controller=require(_0x3afb('0x9'));router[_0x3afb('0xa')]('/',auth[_0x3afb('0xb')](),controller['index']);router[_0x3afb('0xa')](_0x3afb('0xc'),auth[_0x3afb('0xb')](),controller[_0x3afb('0xd')]);router['post']('/',auth[_0x3afb('0xb')](),controller['create']);router[_0x3afb('0xe')](_0x3afb('0xc'),auth['isAuthenticated'](),controller[_0x3afb('0xf')]);router['delete'](_0x3afb('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5047=['../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x5047,0x177));var _0x7504=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5047[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7504('0x0'));var util=require(_0x7504('0x1'));var path=require(_0x7504('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7504('0x3')]();var fs_extra=require(_0x7504('0x4'));var auth=require(_0x7504('0x5'));var interaction=require(_0x7504('0x6'));var config=require(_0x7504('0x7'));var controller=require(_0x7504('0x8'));router[_0x7504('0x9')]('/',auth[_0x7504('0xa')](),controller['index']);router[_0x7504('0x9')](_0x7504('0xb'),auth['isAuthenticated'](),controller[_0x7504('0xc')]);router[_0x7504('0xd')]('/',auth['isAuthenticated'](),controller[_0x7504('0xe')]);router[_0x7504('0xf')]('/:id',auth[_0x7504('0xa')](),controller[_0x7504('0x10')]);router[_0x7504('0x11')](_0x7504('0xb'),auth['isAuthenticated'](),controller[_0x7504('0x12')]);module[_0x7504('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index d1858a7..0a99c37 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x249a35,_0x14a727){var _0x1c3b3e=function(_0x2a07e0){while(--_0x2a07e0){_0x249a35['push'](_0x249a35['shift']());}};_0x1c3b3e(++_0x14a727);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 85b5a1d..32a601f 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 _0xd344=['attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','error','stack','name','map','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','Dashboard','includeAll','include','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','CustomDashboards','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report'];(function(_0x2558b8,_0x413e51){var _0x13db94=function(_0x4c3a76){while(--_0x4c3a76){_0x2558b8['push'](_0x2558b8['shift']());}};_0x13db94(++_0x413e51);}(_0xd344,0x100));var _0x4d34=function(_0x28d444,_0x54ddc4){_0x28d444=_0x28d444-0x0;var _0x45c0ef=_0xd344[_0x28d444];return _0x45c0ef;};'use strict';var emlformat=require(_0x4d34('0x0'));var rimraf=require(_0x4d34('0x1'));var zipdir=require(_0x4d34('0x2'));var jsonpatch=require(_0x4d34('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d34('0x4'));var Mustache=require(_0x4d34('0x5'));var util=require(_0x4d34('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4d34('0x7'));var ejs=require(_0x4d34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d34('0x9'));var squel=require(_0x4d34('0xa'));var crypto=require(_0x4d34('0xb'));var jsforce=require(_0x4d34('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d34('0xd'));var Papa=require('papaparse');var Redis=require(_0x4d34('0xe'));var authService=require(_0x4d34('0xf'));var qs=require(_0x4d34('0x10'));var as=require(_0x4d34('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d34('0x12'))('api');var utils=require(_0x4d34('0x13'));var config=require(_0x4d34('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d34('0x15'))['db'];config['redis']=_[_0x4d34('0x16')](config['redis'],{'host':_0x4d34('0x17'),'port':0x18eb});var socket=require(_0x4d34('0x18'))(new Redis(config[_0x4d34('0x19')]));require('./dashboard.socket')[_0x4d34('0x1a')](socket);function respondWithStatusCode(_0xec88a,_0x36bbd8){_0x36bbd8=_0x36bbd8||0xcc;return function(_0x53cc22){if(_0x53cc22){return _0xec88a[_0x4d34('0x1b')](_0x36bbd8);}return _0xec88a[_0x4d34('0x1c')](_0x36bbd8)['end']();};}function respondWithResult(_0x1dc743,_0x4d9b7b){_0x4d9b7b=_0x4d9b7b||0xc8;return function(_0x2c473e){if(_0x2c473e){return _0x1dc743[_0x4d34('0x1c')](_0x4d9b7b)[_0x4d34('0x1d')](_0x2c473e);}};}function respondWithFilteredResult(_0x4ba42c,_0x310dd7){return function(_0x43f16c){if(_0x43f16c){var _0x221d59=typeof _0x310dd7[_0x4d34('0x1e')]===_0x4d34('0x1f')&&typeof _0x310dd7[_0x4d34('0x20')]===_0x4d34('0x1f');var _0x3c589d=_0x43f16c['count'];var _0x27df01=_0x221d59?0x0:_0x310dd7[_0x4d34('0x1e')];var _0x365b42=_0x221d59?_0x43f16c[_0x4d34('0x21')]:_0x310dd7[_0x4d34('0x1e')]+_0x310dd7[_0x4d34('0x20')];var _0x16ff95;if(_0x365b42>=_0x3c589d){_0x365b42=_0x3c589d;_0x16ff95=0xc8;}else{_0x16ff95=0xce;}_0x4ba42c[_0x4d34('0x1c')](_0x16ff95);return _0x4ba42c[_0x4d34('0x22')](_0x4d34('0x23'),_0x27df01+'-'+_0x365b42+'/'+_0x3c589d)[_0x4d34('0x1d')](_0x43f16c);}return null;};}function patchUpdates(_0x1051f3){return function(_0x56bf87){try{jsonpatch['apply'](_0x56bf87,_0x1051f3,!![]);}catch(_0x378292){return BPromise[_0x4d34('0x24')](_0x378292);}return _0x56bf87[_0x4d34('0x25')]();};}function saveUpdates(_0x4a964e,_0x46bff0){return function(_0x14dae4){if(_0x14dae4){return _0x14dae4[_0x4d34('0x26')](_0x4a964e)[_0x4d34('0x27')](function(_0x335dd8){return _0x335dd8;});}return null;};}function removeEntity(_0x184b9f,_0x3ced8a){return function(_0x2c889c){if(_0x2c889c){return _0x2c889c['destroy']()['then'](function(){var _0x451f34=_0x2c889c['get']({'plain':!![]});var _0xb995c9='CustomDashboards';return db[_0x4d34('0x28')][_0x4d34('0x29')]({'where':{'type':_0xb995c9,'resourceId':_0x451f34['id']}})[_0x4d34('0x27')](function(){return _0x2c889c;});})[_0x4d34('0x27')](function(){_0x184b9f[_0x4d34('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1539b6,_0x5750a2){return function(_0x43375f){if(!_0x43375f){_0x1539b6[_0x4d34('0x1b')](0x194);}return _0x43375f;};}function handleError(_0x355bba,_0x31f4fb){_0x31f4fb=_0x31f4fb||0x1f4;return function(_0x1ff4dc){logger[_0x4d34('0x2a')](_0x1ff4dc[_0x4d34('0x2b')]);if(_0x1ff4dc[_0x4d34('0x2c')]){delete _0x1ff4dc[_0x4d34('0x2c')];}_0x355bba[_0x4d34('0x1c')](_0x31f4fb)['send'](_0x1ff4dc);};}exports['index']=function(_0x3037d5,_0x42ce92){var _0x3fb665={},_0x5f4fc7={},_0x468e68={'count':0x0,'rows':[]};var _0x2fa2f0=_[_0x4d34('0x2d')](db['Dashboard'][_0x4d34('0x2e')],function(_0x203a14){return{'name':_0x203a14['fieldName'],'type':_0x203a14[_0x4d34('0x2f')]['key']};});_0x5f4fc7['model']=_['map'](_0x2fa2f0,_0x4d34('0x2c'));_0x5f4fc7[_0x4d34('0x30')]=_[_0x4d34('0x31')](_0x3037d5[_0x4d34('0x30')]);_0x5f4fc7['filters']=_[_0x4d34('0x32')](_0x5f4fc7[_0x4d34('0x33')],_0x5f4fc7[_0x4d34('0x30')]);_0x3fb665['attributes']=_[_0x4d34('0x32')](_0x5f4fc7[_0x4d34('0x33')],qs[_0x4d34('0x34')](_0x3037d5[_0x4d34('0x30')][_0x4d34('0x34')]));_0x3fb665[_0x4d34('0x35')]=_0x3fb665['attributes'][_0x4d34('0x36')]?_0x3fb665[_0x4d34('0x35')]:_0x5f4fc7[_0x4d34('0x33')];if(!_0x3037d5[_0x4d34('0x30')][_0x4d34('0x37')](_0x4d34('0x38'))){_0x3fb665[_0x4d34('0x20')]=qs['limit'](_0x3037d5[_0x4d34('0x30')][_0x4d34('0x20')]);_0x3fb665['offset']=qs[_0x4d34('0x1e')](_0x3037d5['query']['offset']);}_0x3fb665[_0x4d34('0x39')]=qs[_0x4d34('0x3a')](_0x3037d5['query']['sort']);_0x3fb665[_0x4d34('0x3b')]=qs['filters'](_[_0x4d34('0x3c')](_0x3037d5[_0x4d34('0x30')],_0x5f4fc7[_0x4d34('0x3d')]),_0x2fa2f0);if(_0x3037d5[_0x4d34('0x30')][_0x4d34('0x3e')]){_0x3fb665[_0x4d34('0x3b')]=_['merge'](_0x3fb665[_0x4d34('0x3b')],{'$or':_[_0x4d34('0x2d')](_0x2fa2f0,function(_0x361008){if(_0x361008[_0x4d34('0x2f')]!==_0x4d34('0x3f')){var _0x142074={};_0x142074[_0x361008[_0x4d34('0x2c')]]={'$like':'%'+_0x3037d5[_0x4d34('0x30')][_0x4d34('0x3e')]+'%'};return _0x142074;}})});}_0x3fb665=_[_0x4d34('0x40')]({},_0x3fb665,_0x3037d5[_0x4d34('0x41')]);var _0x3f2231={'where':_0x3fb665[_0x4d34('0x3b')]};return db[_0x4d34('0x42')][_0x4d34('0x21')](_0x3f2231)['then'](function(_0x161d17){_0x468e68[_0x4d34('0x21')]=_0x161d17;if(_0x3037d5[_0x4d34('0x30')][_0x4d34('0x43')]){_0x3fb665[_0x4d34('0x44')]=[{'all':!![]}];}return db[_0x4d34('0x42')][_0x4d34('0x45')](_0x3fb665);})['then'](function(_0x4b17fc){_0x468e68['rows']=_0x4b17fc;return _0x468e68;})['then'](respondWithFilteredResult(_0x42ce92,_0x3fb665))[_0x4d34('0x46')](handleError(_0x42ce92,null));};exports[_0x4d34('0x47')]=function(_0x29d5e6,_0x343109){var _0x1085e7={'raw':![],'where':{'id':_0x29d5e6[_0x4d34('0x48')]['id']}},_0x1e6165={};_0x1e6165['model']=_[_0x4d34('0x31')](db[_0x4d34('0x42')][_0x4d34('0x2e')]);_0x1e6165[_0x4d34('0x30')]=_['keys'](_0x29d5e6[_0x4d34('0x30')]);_0x1e6165[_0x4d34('0x3d')]=_['intersection'](_0x1e6165[_0x4d34('0x33')],_0x1e6165['query']);_0x1085e7[_0x4d34('0x35')]=_['intersection'](_0x1e6165[_0x4d34('0x33')],qs[_0x4d34('0x34')](_0x29d5e6[_0x4d34('0x30')][_0x4d34('0x34')]));_0x1085e7[_0x4d34('0x35')]=_0x1085e7[_0x4d34('0x35')][_0x4d34('0x36')]?_0x1085e7[_0x4d34('0x35')]:_0x1e6165[_0x4d34('0x33')];if(_0x29d5e6[_0x4d34('0x30')][_0x4d34('0x43')]){_0x1085e7[_0x4d34('0x44')]=[{'all':!![]}];}_0x1085e7=_['merge']({},_0x1085e7,_0x29d5e6[_0x4d34('0x41')]);return db[_0x4d34('0x42')][_0x4d34('0x49')](_0x1085e7)[_0x4d34('0x27')](handleEntityNotFound(_0x343109,null))['then'](respondWithResult(_0x343109,null))['catch'](handleError(_0x343109,null));};exports[_0x4d34('0x4a')]=function(_0x1d1d31,_0x4654e0){return db['Dashboard'][_0x4d34('0x4a')](_0x1d1d31[_0x4d34('0x4b')],{})[_0x4d34('0x27')](function(_0x5c0a9a){var _0x2db79e=_0x1d1d31[_0x4d34('0x4c')][_0x4d34('0x4d')]({'plain':!![]});if(!_0x2db79e)throw new Error(_0x4d34('0x4e'));if(_0x2db79e[_0x4d34('0x4f')]===_0x4d34('0x4c')){var _0x22b5a7=_0x5c0a9a[_0x4d34('0x4d')]({'plain':!![]});var _0x12930a='CustomDashboards';return db[_0x4d34('0x50')]['find']({'where':{'name':_0x12930a,'userProfileId':_0x2db79e[_0x4d34('0x51')]},'raw':!![]})['then'](function(_0x1b741c){if(_0x1b741c&&_0x1b741c[_0x4d34('0x52')]===0x0){return db[_0x4d34('0x28')][_0x4d34('0x4a')]({'name':_0x22b5a7[_0x4d34('0x2c')],'resourceId':_0x22b5a7['id'],'type':_0x1b741c['name'],'sectionId':_0x1b741c['id']},{})[_0x4d34('0x27')](function(){return _0x5c0a9a;});}else{return _0x5c0a9a;}})[_0x4d34('0x46')](function(_0xb28aa2){logger[_0x4d34('0x2a')](_0x4d34('0x53'),_0xb28aa2);throw _0xb28aa2;});}return _0x5c0a9a;})[_0x4d34('0x27')](respondWithResult(_0x4654e0,0xc9))[_0x4d34('0x46')](handleError(_0x4654e0,null));};exports['clone']=function(_0x3aaf7d,_0x1a3536){var _0x4f9e03={'where':{'id':_0x3aaf7d[_0x4d34('0x48')]['id']}},_0x1eb590={};_0x1eb590['model']=_[_0x4d34('0x31')](db[_0x4d34('0x42')][_0x4d34('0x2e')]);_0x4f9e03[_0x4d34('0x35')]=_[_0x4d34('0x32')](_0x1eb590[_0x4d34('0x33')],qs[_0x4d34('0x34')](_0x3aaf7d[_0x4d34('0x30')][_0x4d34('0x34')]));_0x4f9e03[_0x4d34('0x35')]=_0x4f9e03[_0x4d34('0x35')][_0x4d34('0x36')]?_0x4f9e03[_0x4d34('0x35')]:_0x1eb590[_0x4d34('0x33')];if(_0x3aaf7d[_0x4d34('0x30')][_0x4d34('0x43')]){_0x4f9e03[_0x4d34('0x44')]=[{'all':!![]}];}_0x4f9e03=_[_0x4d34('0x40')]({},_0x4f9e03,_0x3aaf7d[_0x4d34('0x41')]);return db[_0x4d34('0x42')][_0x4d34('0x49')](_0x4f9e03)[_0x4d34('0x27')](handleEntityNotFound(_0x1a3536,null))['then'](function(_0x2cb44d){if(_0x2cb44d){var _0x44e931=_0x2cb44d[_0x4d34('0x4d')]({'plain':!![]});_0x44e931=qs[_0x4d34('0x54')](_0x44e931,['id',_0x4d34('0x55'),'updatedAt']);_0x3aaf7d['body']=_['omit'](_0x3aaf7d[_0x4d34('0x4b')],['id',_0x4d34('0x55'),'updatedAt']);return db[_0x4d34('0x42')][_0x4d34('0x4a')](_[_0x4d34('0x40')](_0x44e931,_0x3aaf7d[_0x4d34('0x4b')]),{'include':_0x3aaf7d[_0x4d34('0x30')][_0x4d34('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x282e4a){var _0x34f98f=_0x3aaf7d[_0x4d34('0x4c')][_0x4d34('0x4d')]({'plain':!![]});if(!_0x34f98f)throw new Error(_0x4d34('0x4e'));if(_0x34f98f[_0x4d34('0x4f')]===_0x4d34('0x4c')){var _0x77e9ac=_0x282e4a['get']({'plain':!![]});var _0x208810=_0x4d34('0x56');return db[_0x4d34('0x50')][_0x4d34('0x49')]({'where':{'name':_0x208810,'userProfileId':_0x34f98f[_0x4d34('0x51')]},'raw':!![]})[_0x4d34('0x27')](function(_0xb33e62){if(_0xb33e62&&_0xb33e62[_0x4d34('0x52')]===0x0){return db[_0x4d34('0x28')]['create']({'name':_0x77e9ac[_0x4d34('0x2c')],'resourceId':_0x77e9ac['id'],'type':_0xb33e62[_0x4d34('0x2c')],'sectionId':_0xb33e62['id']},{})[_0x4d34('0x27')](function(){return _0x282e4a;});}else{return _0x282e4a;}})[_0x4d34('0x46')](function(_0x5e13ae){logger[_0x4d34('0x2a')](_0x4d34('0x53'),_0x5e13ae);throw _0x5e13ae;});}return _0x282e4a;});}})[_0x4d34('0x27')](respondWithResult(_0x1a3536,0xc9))[_0x4d34('0x46')](handleError(_0x1a3536,null));};exports['update']=function(_0x2faa6e,_0x4a7780){if(_0x2faa6e[_0x4d34('0x4b')]['id']){delete _0x2faa6e[_0x4d34('0x4b')]['id'];}return db[_0x4d34('0x42')][_0x4d34('0x49')]({'where':{'id':_0x2faa6e[_0x4d34('0x48')]['id']}})[_0x4d34('0x27')](handleEntityNotFound(_0x4a7780,null))[_0x4d34('0x27')](saveUpdates(_0x2faa6e['body'],null))[_0x4d34('0x27')](respondWithResult(_0x4a7780,null))[_0x4d34('0x46')](handleError(_0x4a7780,null));};exports[_0x4d34('0x29')]=function(_0xacc8b5,_0x5087b9){return db['Dashboard'][_0x4d34('0x49')]({'where':{'id':_0xacc8b5['params']['id']}})[_0x4d34('0x27')](handleEntityNotFound(_0x5087b9,null))[_0x4d34('0x27')](removeEntity(_0x5087b9,null))[_0x4d34('0x46')](handleError(_0x5087b9,null));};function widgetAttributes(_0x977b30){try{switch(_0x977b30[_0x4d34('0x2f')]){case'iframe':return[{'name':_0x4d34('0x57'),'value':_0x977b30[_0x4d34('0x57')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x0]?_0x977b30[_0x4d34('0x58')][0x0][_0x4d34('0x59')]:undefined)||_0x4d34('0x5a')}];case _0x4d34('0x5b'):return[{'name':'attrPath','value':_0x977b30[_0x4d34('0x5c')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x0]?_0x977b30['attrs'][0x0][_0x4d34('0x59')]:undefined)||''}];case _0x4d34('0x5d'):return[{'name':_0x4d34('0x5e'),'value':_0x977b30[_0x4d34('0x5e')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x0]?_0x977b30[_0x4d34('0x58')][0x0][_0x4d34('0x59')]:undefined)||'HH:mm:ss'},{'name':_0x4d34('0x5f'),'value':_0x977b30[_0x4d34('0x5f')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x1]?_0x977b30['attrs'][0x1][_0x4d34('0x59')]:undefined)||_0x4d34('0x60')},{'name':_0x4d34('0x61'),'value':_0x977b30[_0x4d34('0x61')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x2]?_0x977b30['attrs'][0x2][_0x4d34('0x59')]:undefined)||0xc}];case _0x4d34('0x62'):return[{'name':_0x4d34('0x63'),'value':_0x977b30[_0x4d34('0x63')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x0]?_0x977b30[_0x4d34('0x58')][0x0][_0x4d34('0x59')]:undefined)||_0x4d34('0x64')},{'name':_0x4d34('0x65'),'value':_0x977b30[_0x4d34('0x65')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x1]?_0x977b30[_0x4d34('0x58')][0x1][_0x4d34('0x59')]:undefined)||[]},{'name':_0x4d34('0x61'),'value':_0x977b30[_0x4d34('0x61')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x2]?_0x977b30[_0x4d34('0x58')][0x2][_0x4d34('0x59')]:undefined)||0x14},{'name':'attrChannel','value':_0x977b30[_0x4d34('0x66')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x3]?_0x977b30['attrs'][0x3][_0x4d34('0x59')]:undefined)||_0x4d34('0x67')},{'name':_0x4d34('0x68'),'value':_0x977b30['attrEmailAccounts']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x4]?_0x977b30['attrs'][0x4]['value']:undefined)||''},{'name':_0x4d34('0x69'),'value':_0x977b30['attrFaxAccounts']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x5]?_0x977b30[_0x4d34('0x58')][0x5][_0x4d34('0x59')]:undefined)||''},{'name':_0x4d34('0x6a'),'value':_0x977b30['attrSmsAccounts']||(_0x977b30['attrs']&&_0x977b30[_0x4d34('0x58')][0x6]?_0x977b30['attrs'][0x6][_0x4d34('0x59')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x977b30[_0x4d34('0x6b')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x7]?_0x977b30[_0x4d34('0x58')][0x7][_0x4d34('0x59')]:undefined)||''},{'name':_0x4d34('0x6c'),'value':_0x977b30['attrWhatsappAccounts']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x8]?_0x977b30[_0x4d34('0x58')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x977b30[_0x4d34('0x6d')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x9]?_0x977b30['attrs'][0x9]['value']:undefined)||''}];case _0x4d34('0x6e'):case _0x4d34('0x6f'):return[{'name':_0x4d34('0x70'),'value':_0x977b30[_0x4d34('0x70')]||(_0x977b30['attrs']&&_0x977b30[_0x4d34('0x58')][0x0]?_0x977b30['attrs'][0x0][_0x4d34('0x59')]:undefined)||_0x4d34('0x64')},{'name':'attrSerie2','value':_0x977b30[_0x4d34('0x71')]||(_0x977b30['attrs']&&_0x977b30[_0x4d34('0x58')][0x1]?_0x977b30[_0x4d34('0x58')][0x1][_0x4d34('0x59')]:undefined)||null},{'name':_0x4d34('0x72'),'value':_0x977b30[_0x4d34('0x72')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x2]?_0x977b30[_0x4d34('0x58')][0x2][_0x4d34('0x59')]:undefined)||null},{'name':_0x4d34('0x65'),'value':_0x977b30['attrVoiceQueues']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x3]?_0x977b30[_0x4d34('0x58')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x977b30[_0x4d34('0x66')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x4]?_0x977b30['attrs'][0x4][_0x4d34('0x59')]:undefined)||'voice'},{'name':_0x4d34('0x68'),'value':_0x977b30['attrEmailAccounts']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30['attrs'][0x5]?_0x977b30[_0x4d34('0x58')][0x5][_0x4d34('0x59')]:undefined)||''},{'name':_0x4d34('0x69'),'value':_0x977b30[_0x4d34('0x69')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x6]?_0x977b30[_0x4d34('0x58')][0x6][_0x4d34('0x59')]:undefined)||''},{'name':_0x4d34('0x6a'),'value':_0x977b30[_0x4d34('0x6a')]||(_0x977b30['attrs']&&_0x977b30['attrs'][0x7]?_0x977b30[_0x4d34('0x58')][0x7][_0x4d34('0x59')]:undefined)||''},{'name':_0x4d34('0x6b'),'value':_0x977b30['attrOpenchannelAccounts']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x8]?_0x977b30[_0x4d34('0x58')][0x8]['value']:undefined)||''},{'name':_0x4d34('0x6c'),'value':_0x977b30[_0x4d34('0x6c')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x9]?_0x977b30[_0x4d34('0x58')][0x9][_0x4d34('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x977b30[_0x4d34('0x6d')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0xa]?_0x977b30[_0x4d34('0x58')][0xa][_0x4d34('0x59')]:undefined)||''}];case _0x4d34('0x73'):return[{'name':_0x4d34('0x74'),'type':_0x977b30[_0x4d34('0x75')]||(_0x977b30['attrs']&&_0x977b30[_0x4d34('0x58')][0x0]?_0x977b30[_0x4d34('0x58')][0x0][_0x4d34('0x2f')]:undefined)||null,'value':_0x977b30[_0x4d34('0x74')]||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x0]?_0x977b30[_0x4d34('0x58')][0x0]['value']:undefined)||null},{'name':_0x4d34('0x76'),'value':_0x977b30['attrRefresh']||(_0x977b30[_0x4d34('0x58')]&&_0x977b30[_0x4d34('0x58')][0x1]?_0x977b30[_0x4d34('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x9a5448){logger[_0x4d34('0x2a')](_0x4d34('0x77'),JSON[_0x4d34('0x78')](_0x9a5448));return[];}}exports[_0x4d34('0x79')]=function(_0x381b01,_0x33c9e8,_0x4f316e){if(_0x381b01[_0x4d34('0x4b')]['id']){delete _0x381b01[_0x4d34('0x4b')]['id'];}return db[_0x4d34('0x42')][_0x4d34('0x49')]({'where':{'id':_0x381b01['params']['id']}})[_0x4d34('0x27')](handleEntityNotFound(_0x33c9e8,null))[_0x4d34('0x27')](function(_0x5ec903){if(_0x5ec903){_0x381b01[_0x4d34('0x4b')][_0x4d34('0x7a')]=_0x5ec903['id'];_0x381b01['body'][_0x4d34('0x58')]=widgetAttributes(_0x381b01['body']);return db['DashboardItem']['create'](_0x381b01[_0x4d34('0x4b')]);}})[_0x4d34('0x27')](respondWithResult(_0x33c9e8,null))['catch'](handleError(_0x33c9e8,null));};exports[_0x4d34('0x7b')]=function(_0x48fefc,_0x5b356b,_0x21fed9){var _0x4f7d2b={};var _0x181213={};var _0x52991a;var _0x3b0862;return db['Dashboard']['findOne']({'where':{'id':_0x48fefc[_0x4d34('0x48')]['id']}})[_0x4d34('0x27')](handleEntityNotFound(_0x5b356b,null))['then'](function(_0x29f04b){if(_0x29f04b){_0x52991a=_0x29f04b;_0x181213[_0x4d34('0x33')]=_['keys'](db['DashboardItem'][_0x4d34('0x2e')]);_0x181213[_0x4d34('0x30')]=_[_0x4d34('0x31')](_0x48fefc[_0x4d34('0x30')]);_0x181213[_0x4d34('0x3d')]=_['intersection'](_0x181213[_0x4d34('0x33')],_0x181213[_0x4d34('0x30')]);_0x4f7d2b['attributes']=_[_0x4d34('0x32')](_0x181213[_0x4d34('0x33')],qs['fields'](_0x48fefc['query']['fields']));_0x4f7d2b[_0x4d34('0x35')]=_0x4f7d2b['attributes'][_0x4d34('0x36')]?_0x4f7d2b[_0x4d34('0x35')]:_0x181213[_0x4d34('0x33')];_0x4f7d2b[_0x4d34('0x39')]=qs[_0x4d34('0x3a')](_0x48fefc[_0x4d34('0x30')]['sort']);_0x4f7d2b['where']=qs[_0x4d34('0x3d')](_[_0x4d34('0x3c')](_0x48fefc[_0x4d34('0x30')],_0x181213[_0x4d34('0x3d')]));if(_0x48fefc[_0x4d34('0x30')][_0x4d34('0x3e')]){_0x4f7d2b['where']=_[_0x4d34('0x40')](_0x4f7d2b['where'],{'$or':_['map'](_0x4f7d2b[_0x4d34('0x35')],function(_0x286806){var _0x3fd558={};_0x3fd558[_0x286806]={'$like':'%'+_0x48fefc[_0x4d34('0x30')][_0x4d34('0x3e')]+'%'};return _0x3fd558;})});}_0x4f7d2b=_[_0x4d34('0x40')]({},_0x4f7d2b,_0x48fefc[_0x4d34('0x41')]);return _0x52991a[_0x4d34('0x7b')](_0x4f7d2b);}})[_0x4d34('0x27')](function(_0x5eab7e){if(_0x5eab7e){_0x3b0862=_0x5eab7e[_0x4d34('0x36')];if(!_0x48fefc[_0x4d34('0x30')]['hasOwnProperty'](_0x4d34('0x38'))){_0x4f7d2b[_0x4d34('0x20')]=qs[_0x4d34('0x20')](_0x48fefc[_0x4d34('0x30')][_0x4d34('0x20')]);_0x4f7d2b['offset']=qs[_0x4d34('0x1e')](_0x48fefc[_0x4d34('0x30')]['offset']);}return _0x52991a[_0x4d34('0x7b')](_0x4f7d2b);}})[_0x4d34('0x27')](function(_0x53bb09){if(_0x53bb09){return _0x53bb09?{'count':_0x3b0862,'rows':_0x53bb09}:null;}})[_0x4d34('0x27')](respondWithResult(_0x5b356b,null))[_0x4d34('0x46')](handleError(_0x5b356b,null));}; \ No newline at end of file +var _0x7f75=['util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','role','CustomDashboards','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3ee433,_0x32f136){var _0x1407fe=function(_0x2a3f34){while(--_0x2a3f34){_0x3ee433['push'](_0x3ee433['shift']());}};_0x1407fe(++_0x32f136);}(_0x7f75,0x7b));var _0x57f7=function(_0x2c5480,_0x4ef992){_0x2c5480=_0x2c5480-0x0;var _0x5caa95=_0x7f75[_0x2c5480];return _0x5caa95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57f7('0x0'));var zipdir=require(_0x57f7('0x1'));var jsonpatch=require(_0x57f7('0x2'));var rp=require('request-promise');var moment=require(_0x57f7('0x3'));var BPromise=require(_0x57f7('0x4'));var Mustache=require(_0x57f7('0x5'));var util=require(_0x57f7('0x6'));var path=require(_0x57f7('0x7'));var sox=require('sox');var csv=require(_0x57f7('0x8'));var ejs=require(_0x57f7('0x9'));var fs=require('fs');var fs_extra=require(_0x57f7('0xa'));var _=require('lodash');var squel=require(_0x57f7('0xb'));var crypto=require(_0x57f7('0xc'));var jsforce=require(_0x57f7('0xd'));var deskjs=require(_0x57f7('0xe'));var toCsv=require(_0x57f7('0x8'));var querystring=require('querystring');var Papa=require(_0x57f7('0xf'));var Redis=require(_0x57f7('0x10'));var authService=require(_0x57f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x57f7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x57f7('0x13'));var config=require(_0x57f7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x57f7('0x15'))['db'];config[_0x57f7('0x16')]=_[_0x57f7('0x17')](config['redis'],{'host':_0x57f7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57f7('0x16')]));require(_0x57f7('0x19'))['register'](socket);function respondWithStatusCode(_0x9ac6ef,_0x268261){_0x268261=_0x268261||0xcc;return function(_0x3c9a54){if(_0x3c9a54){return _0x9ac6ef[_0x57f7('0x1a')](_0x268261);}return _0x9ac6ef[_0x57f7('0x1b')](_0x268261)['end']();};}function respondWithResult(_0xdf8259,_0x52663e){_0x52663e=_0x52663e||0xc8;return function(_0x379fa1){if(_0x379fa1){return _0xdf8259[_0x57f7('0x1b')](_0x52663e)['json'](_0x379fa1);}};}function respondWithFilteredResult(_0x26fa90,_0x5e5955){return function(_0xde7964){if(_0xde7964){var _0x53e789=typeof _0x5e5955[_0x57f7('0x1c')]===_0x57f7('0x1d')&&typeof _0x5e5955[_0x57f7('0x1e')]===_0x57f7('0x1d');var _0xab0fdb=_0xde7964[_0x57f7('0x1f')];var _0x522a15=_0x53e789?0x0:_0x5e5955[_0x57f7('0x1c')];var _0x5f2e97=_0x53e789?_0xde7964[_0x57f7('0x1f')]:_0x5e5955[_0x57f7('0x1c')]+_0x5e5955[_0x57f7('0x1e')];var _0x57ee88;if(_0x5f2e97>=_0xab0fdb){_0x5f2e97=_0xab0fdb;_0x57ee88=0xc8;}else{_0x57ee88=0xce;}_0x26fa90['status'](_0x57ee88);return _0x26fa90['set'](_0x57f7('0x20'),_0x522a15+'-'+_0x5f2e97+'/'+_0xab0fdb)[_0x57f7('0x21')](_0xde7964);}return null;};}function patchUpdates(_0x1d5824){return function(_0x333bad){try{jsonpatch[_0x57f7('0x22')](_0x333bad,_0x1d5824,!![]);}catch(_0x11bdb2){return BPromise[_0x57f7('0x23')](_0x11bdb2);}return _0x333bad[_0x57f7('0x24')]();};}function saveUpdates(_0x64a93e,_0x305bb4){return function(_0x28d9be){if(_0x28d9be){return _0x28d9be[_0x57f7('0x25')](_0x64a93e)[_0x57f7('0x26')](function(_0x417cd6){return _0x417cd6;});}return null;};}function removeEntity(_0x3d7ce0,_0x5e1917){return function(_0x4809f2){if(_0x4809f2){return _0x4809f2[_0x57f7('0x27')]()['then'](function(){var _0x4bf249=_0x4809f2['get']({'plain':!![]});var _0x17e890='CustomDashboards';return db[_0x57f7('0x28')]['destroy']({'where':{'type':_0x17e890,'resourceId':_0x4bf249['id']}})[_0x57f7('0x26')](function(){return _0x4809f2;});})[_0x57f7('0x26')](function(){_0x3d7ce0[_0x57f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x348dd6,_0x5432e0){return function(_0x4506bf){if(!_0x4506bf){_0x348dd6[_0x57f7('0x1a')](0x194);}return _0x4506bf;};}function handleError(_0x1c3b29,_0xaaa429){_0xaaa429=_0xaaa429||0x1f4;return function(_0x1d76d9){logger['error'](_0x1d76d9[_0x57f7('0x29')]);if(_0x1d76d9[_0x57f7('0x2a')]){delete _0x1d76d9[_0x57f7('0x2a')];}_0x1c3b29['status'](_0xaaa429)[_0x57f7('0x2b')](_0x1d76d9);};}exports[_0x57f7('0x2c')]=function(_0x1294f8,_0x172cde){var _0x50805c={},_0x58a2aa={},_0x5077ce={'count':0x0,'rows':[]};var _0x4fd5ca=_['map'](db['Dashboard'][_0x57f7('0x2d')],function(_0x5405d7){return{'name':_0x5405d7[_0x57f7('0x2e')],'type':_0x5405d7[_0x57f7('0x2f')][_0x57f7('0x30')]};});_0x58a2aa['model']=_[_0x57f7('0x31')](_0x4fd5ca,_0x57f7('0x2a'));_0x58a2aa[_0x57f7('0x32')]=_[_0x57f7('0x33')](_0x1294f8[_0x57f7('0x32')]);_0x58a2aa[_0x57f7('0x34')]=_[_0x57f7('0x35')](_0x58a2aa[_0x57f7('0x36')],_0x58a2aa['query']);_0x50805c[_0x57f7('0x37')]=_[_0x57f7('0x35')](_0x58a2aa[_0x57f7('0x36')],qs['fields'](_0x1294f8[_0x57f7('0x32')][_0x57f7('0x38')]));_0x50805c[_0x57f7('0x37')]=_0x50805c['attributes'][_0x57f7('0x39')]?_0x50805c[_0x57f7('0x37')]:_0x58a2aa['model'];if(!_0x1294f8[_0x57f7('0x32')][_0x57f7('0x3a')](_0x57f7('0x3b'))){_0x50805c[_0x57f7('0x1e')]=qs[_0x57f7('0x1e')](_0x1294f8[_0x57f7('0x32')][_0x57f7('0x1e')]);_0x50805c[_0x57f7('0x1c')]=qs['offset'](_0x1294f8[_0x57f7('0x32')][_0x57f7('0x1c')]);}_0x50805c[_0x57f7('0x3c')]=qs[_0x57f7('0x3d')](_0x1294f8[_0x57f7('0x32')]['sort']);_0x50805c[_0x57f7('0x3e')]=qs[_0x57f7('0x34')](_[_0x57f7('0x3f')](_0x1294f8[_0x57f7('0x32')],_0x58a2aa[_0x57f7('0x34')]),_0x4fd5ca);if(_0x1294f8[_0x57f7('0x32')][_0x57f7('0x40')]){_0x50805c[_0x57f7('0x3e')]=_[_0x57f7('0x41')](_0x50805c[_0x57f7('0x3e')],{'$or':_[_0x57f7('0x31')](_0x4fd5ca,function(_0x5ffedd){if(_0x5ffedd[_0x57f7('0x2f')]!==_0x57f7('0x42')){var _0x5a90cb={};_0x5a90cb[_0x5ffedd['name']]={'$like':'%'+_0x1294f8[_0x57f7('0x32')][_0x57f7('0x40')]+'%'};return _0x5a90cb;}})});}_0x50805c=_[_0x57f7('0x41')]({},_0x50805c,_0x1294f8[_0x57f7('0x43')]);var _0x3f520f={'where':_0x50805c['where']};return db[_0x57f7('0x44')][_0x57f7('0x1f')](_0x3f520f)['then'](function(_0x3d99a1){_0x5077ce['count']=_0x3d99a1;if(_0x1294f8[_0x57f7('0x32')][_0x57f7('0x45')]){_0x50805c[_0x57f7('0x46')]=[{'all':!![]}];}return db[_0x57f7('0x44')][_0x57f7('0x47')](_0x50805c);})[_0x57f7('0x26')](function(_0x1cfe86){_0x5077ce[_0x57f7('0x48')]=_0x1cfe86;return _0x5077ce;})['then'](respondWithFilteredResult(_0x172cde,_0x50805c))[_0x57f7('0x49')](handleError(_0x172cde,null));};exports[_0x57f7('0x4a')]=function(_0x710abb,_0x2ad9a4){var _0x3956e3={'raw':![],'where':{'id':_0x710abb[_0x57f7('0x4b')]['id']}},_0x3cf5f1={};_0x3cf5f1['model']=_[_0x57f7('0x33')](db[_0x57f7('0x44')][_0x57f7('0x2d')]);_0x3cf5f1['query']=_[_0x57f7('0x33')](_0x710abb[_0x57f7('0x32')]);_0x3cf5f1[_0x57f7('0x34')]=_[_0x57f7('0x35')](_0x3cf5f1[_0x57f7('0x36')],_0x3cf5f1[_0x57f7('0x32')]);_0x3956e3[_0x57f7('0x37')]=_[_0x57f7('0x35')](_0x3cf5f1['model'],qs[_0x57f7('0x38')](_0x710abb[_0x57f7('0x32')][_0x57f7('0x38')]));_0x3956e3[_0x57f7('0x37')]=_0x3956e3[_0x57f7('0x37')][_0x57f7('0x39')]?_0x3956e3[_0x57f7('0x37')]:_0x3cf5f1[_0x57f7('0x36')];if(_0x710abb[_0x57f7('0x32')][_0x57f7('0x45')]){_0x3956e3[_0x57f7('0x46')]=[{'all':!![]}];}_0x3956e3=_[_0x57f7('0x41')]({},_0x3956e3,_0x710abb[_0x57f7('0x43')]);return db[_0x57f7('0x44')]['find'](_0x3956e3)[_0x57f7('0x26')](handleEntityNotFound(_0x2ad9a4,null))[_0x57f7('0x26')](respondWithResult(_0x2ad9a4,null))[_0x57f7('0x49')](handleError(_0x2ad9a4,null));};exports['create']=function(_0x2e329e,_0x38c2b1){return db[_0x57f7('0x44')][_0x57f7('0x4c')](_0x2e329e[_0x57f7('0x4d')],{})[_0x57f7('0x26')](function(_0x4aa8d3){var _0x287e55=_0x2e329e[_0x57f7('0x4e')][_0x57f7('0x4f')]({'plain':!![]});if(!_0x287e55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x287e55[_0x57f7('0x50')]===_0x57f7('0x4e')){var _0x4a2663=_0x4aa8d3[_0x57f7('0x4f')]({'plain':!![]});var _0x4a53bd=_0x57f7('0x51');return db[_0x57f7('0x52')][_0x57f7('0x53')]({'where':{'name':_0x4a53bd,'userProfileId':_0x287e55[_0x57f7('0x54')]},'raw':!![]})[_0x57f7('0x26')](function(_0x23ea7b){if(_0x23ea7b&&_0x23ea7b['autoAssociation']===0x0){return db['UserProfileResource'][_0x57f7('0x4c')]({'name':_0x4a2663[_0x57f7('0x2a')],'resourceId':_0x4a2663['id'],'type':_0x23ea7b[_0x57f7('0x2a')],'sectionId':_0x23ea7b['id']},{})[_0x57f7('0x26')](function(){return _0x4aa8d3;});}else{return _0x4aa8d3;}})['catch'](function(_0x167335){logger[_0x57f7('0x55')](_0x57f7('0x56'),_0x167335);throw _0x167335;});}return _0x4aa8d3;})[_0x57f7('0x26')](respondWithResult(_0x38c2b1,0xc9))['catch'](handleError(_0x38c2b1,null));};exports[_0x57f7('0x57')]=function(_0x37e421,_0xd39095){var _0x2041a3={'where':{'id':_0x37e421[_0x57f7('0x4b')]['id']}},_0x1461b0={};_0x1461b0['model']=_[_0x57f7('0x33')](db['Dashboard'][_0x57f7('0x2d')]);_0x2041a3[_0x57f7('0x37')]=_[_0x57f7('0x35')](_0x1461b0['model'],qs[_0x57f7('0x38')](_0x37e421[_0x57f7('0x32')][_0x57f7('0x38')]));_0x2041a3[_0x57f7('0x37')]=_0x2041a3['attributes'][_0x57f7('0x39')]?_0x2041a3[_0x57f7('0x37')]:_0x1461b0['model'];if(_0x37e421['query'][_0x57f7('0x45')]){_0x2041a3['include']=[{'all':!![]}];}_0x2041a3=_[_0x57f7('0x41')]({},_0x2041a3,_0x37e421[_0x57f7('0x43')]);return db['Dashboard'][_0x57f7('0x53')](_0x2041a3)[_0x57f7('0x26')](handleEntityNotFound(_0xd39095,null))[_0x57f7('0x26')](function(_0x2e9728){if(_0x2e9728){var _0x22d7cf=_0x2e9728[_0x57f7('0x4f')]({'plain':!![]});_0x22d7cf=qs[_0x57f7('0x58')](_0x22d7cf,['id',_0x57f7('0x59'),'updatedAt']);_0x37e421[_0x57f7('0x4d')]=_[_0x57f7('0x58')](_0x37e421['body'],['id',_0x57f7('0x59'),_0x57f7('0x5a')]);return db[_0x57f7('0x44')]['create'](_[_0x57f7('0x41')](_0x22d7cf,_0x37e421[_0x57f7('0x4d')]),{'include':_0x37e421[_0x57f7('0x32')][_0x57f7('0x45')]?[{'all':!![]}]:undefined})[_0x57f7('0x26')](function(_0xddaeda){var _0x32cfdb=_0x37e421[_0x57f7('0x4e')]['get']({'plain':!![]});if(!_0x32cfdb)throw new Error(_0x57f7('0x5b'));if(_0x32cfdb[_0x57f7('0x50')]==='user'){var _0x5da897=_0xddaeda[_0x57f7('0x4f')]({'plain':!![]});var _0x44c1da=_0x57f7('0x51');return db[_0x57f7('0x52')]['find']({'where':{'name':_0x44c1da,'userProfileId':_0x32cfdb['userProfileId']},'raw':!![]})['then'](function(_0x45a9a7){if(_0x45a9a7&&_0x45a9a7[_0x57f7('0x5c')]===0x0){return db['UserProfileResource'][_0x57f7('0x4c')]({'name':_0x5da897[_0x57f7('0x2a')],'resourceId':_0x5da897['id'],'type':_0x45a9a7[_0x57f7('0x2a')],'sectionId':_0x45a9a7['id']},{})['then'](function(){return _0xddaeda;});}else{return _0xddaeda;}})[_0x57f7('0x49')](function(_0x5076ee){logger[_0x57f7('0x55')](_0x57f7('0x56'),_0x5076ee);throw _0x5076ee;});}return _0xddaeda;});}})['then'](respondWithResult(_0xd39095,0xc9))[_0x57f7('0x49')](handleError(_0xd39095,null));};exports[_0x57f7('0x25')]=function(_0x1c590f,_0x3aad55){if(_0x1c590f[_0x57f7('0x4d')]['id']){delete _0x1c590f[_0x57f7('0x4d')]['id'];}return db[_0x57f7('0x44')]['find']({'where':{'id':_0x1c590f[_0x57f7('0x4b')]['id']}})[_0x57f7('0x26')](handleEntityNotFound(_0x3aad55,null))[_0x57f7('0x26')](saveUpdates(_0x1c590f[_0x57f7('0x4d')],null))[_0x57f7('0x26')](respondWithResult(_0x3aad55,null))[_0x57f7('0x49')](handleError(_0x3aad55,null));};exports[_0x57f7('0x27')]=function(_0x519c50,_0xac13d4){return db[_0x57f7('0x44')][_0x57f7('0x53')]({'where':{'id':_0x519c50[_0x57f7('0x4b')]['id']}})[_0x57f7('0x26')](handleEntityNotFound(_0xac13d4,null))['then'](removeEntity(_0xac13d4,null))['catch'](handleError(_0xac13d4,null));};function widgetAttributes(_0x4b9cb6){try{switch(_0x4b9cb6[_0x57f7('0x2f')]){case'iframe':return[{'name':_0x57f7('0x5d'),'value':_0x4b9cb6[_0x57f7('0x5d')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6['attrs'][0x0]?_0x4b9cb6[_0x57f7('0x5e')][0x0][_0x57f7('0x5f')]:undefined)||_0x57f7('0x60')}];case _0x57f7('0x61'):return[{'name':'attrPath','value':_0x4b9cb6[_0x57f7('0x62')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x0]?_0x4b9cb6['attrs'][0x0][_0x57f7('0x5f')]:undefined)||''}];case _0x57f7('0x63'):return[{'name':_0x57f7('0x64'),'value':_0x4b9cb6[_0x57f7('0x64')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x0]?_0x4b9cb6[_0x57f7('0x5e')][0x0][_0x57f7('0x5f')]:undefined)||_0x57f7('0x65')},{'name':_0x57f7('0x66'),'value':_0x4b9cb6[_0x57f7('0x66')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x1]?_0x4b9cb6[_0x57f7('0x5e')][0x1]['value']:undefined)||_0x57f7('0x67')},{'name':'attrFontSize','value':_0x4b9cb6['attrFontSize']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6['attrs'][0x2]?_0x4b9cb6[_0x57f7('0x5e')][0x2][_0x57f7('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x57f7('0x68'),'value':_0x4b9cb6['attrMetric']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6['attrs'][0x0]?_0x4b9cb6['attrs'][0x0][_0x57f7('0x5f')]:undefined)||_0x57f7('0x69')},{'name':_0x57f7('0x6a'),'value':_0x4b9cb6[_0x57f7('0x6a')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x1]?_0x4b9cb6['attrs'][0x1][_0x57f7('0x5f')]:undefined)||[]},{'name':_0x57f7('0x6b'),'value':_0x4b9cb6[_0x57f7('0x6b')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x2]?_0x4b9cb6[_0x57f7('0x5e')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x4b9cb6[_0x57f7('0x6c')]||(_0x4b9cb6['attrs']&&_0x4b9cb6[_0x57f7('0x5e')][0x3]?_0x4b9cb6[_0x57f7('0x5e')][0x3]['value']:undefined)||'voice'},{'name':_0x57f7('0x6d'),'value':_0x4b9cb6[_0x57f7('0x6d')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x4]?_0x4b9cb6[_0x57f7('0x5e')][0x4][_0x57f7('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x4b9cb6[_0x57f7('0x6e')]||(_0x4b9cb6['attrs']&&_0x4b9cb6[_0x57f7('0x5e')][0x5]?_0x4b9cb6[_0x57f7('0x5e')][0x5][_0x57f7('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4b9cb6[_0x57f7('0x6f')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x6]?_0x4b9cb6[_0x57f7('0x5e')][0x6][_0x57f7('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4b9cb6[_0x57f7('0x70')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x7]?_0x4b9cb6[_0x57f7('0x5e')][0x7]['value']:undefined)||''},{'name':_0x57f7('0x71'),'value':_0x4b9cb6['attrWhatsappAccounts']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x8]?_0x4b9cb6[_0x57f7('0x5e')][0x8][_0x57f7('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4b9cb6[_0x57f7('0x72')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x9]?_0x4b9cb6['attrs'][0x9][_0x57f7('0x5f')]:undefined)||''}];case'multibar-chart':case _0x57f7('0x73'):return[{'name':_0x57f7('0x74'),'value':_0x4b9cb6[_0x57f7('0x74')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x0]?_0x4b9cb6['attrs'][0x0][_0x57f7('0x5f')]:undefined)||_0x57f7('0x69')},{'name':_0x57f7('0x75'),'value':_0x4b9cb6['attrSerie2']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x1]?_0x4b9cb6[_0x57f7('0x5e')][0x1][_0x57f7('0x5f')]:undefined)||null},{'name':_0x57f7('0x76'),'value':_0x4b9cb6['attrSerie3']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x2]?_0x4b9cb6[_0x57f7('0x5e')][0x2][_0x57f7('0x5f')]:undefined)||null},{'name':_0x57f7('0x6a'),'value':_0x4b9cb6[_0x57f7('0x6a')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x3]?_0x4b9cb6[_0x57f7('0x5e')][0x3]['value']:undefined)||[]},{'name':_0x57f7('0x6c'),'value':_0x4b9cb6[_0x57f7('0x6c')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x4]?_0x4b9cb6[_0x57f7('0x5e')][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x4b9cb6[_0x57f7('0x6d')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x5]?_0x4b9cb6[_0x57f7('0x5e')][0x5]['value']:undefined)||''},{'name':_0x57f7('0x6e'),'value':_0x4b9cb6['attrFaxAccounts']||(_0x4b9cb6['attrs']&&_0x4b9cb6[_0x57f7('0x5e')][0x6]?_0x4b9cb6[_0x57f7('0x5e')][0x6]['value']:undefined)||''},{'name':_0x57f7('0x6f'),'value':_0x4b9cb6[_0x57f7('0x6f')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x7]?_0x4b9cb6['attrs'][0x7][_0x57f7('0x5f')]:undefined)||''},{'name':_0x57f7('0x70'),'value':_0x4b9cb6[_0x57f7('0x70')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x8]?_0x4b9cb6[_0x57f7('0x5e')][0x8][_0x57f7('0x5f')]:undefined)||''},{'name':_0x57f7('0x71'),'value':_0x4b9cb6[_0x57f7('0x71')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x9]?_0x4b9cb6['attrs'][0x9][_0x57f7('0x5f')]:undefined)||''},{'name':_0x57f7('0x72'),'value':_0x4b9cb6[_0x57f7('0x72')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0xa]?_0x4b9cb6['attrs'][0xa]['value']:undefined)||''}];case _0x57f7('0x77'):return[{'name':_0x57f7('0x78'),'type':_0x4b9cb6[_0x57f7('0x79')]||(_0x4b9cb6['attrs']&&_0x4b9cb6[_0x57f7('0x5e')][0x0]?_0x4b9cb6['attrs'][0x0]['type']:undefined)||null,'value':_0x4b9cb6['attrReport']||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6['attrs'][0x0]?_0x4b9cb6[_0x57f7('0x5e')][0x0][_0x57f7('0x5f')]:undefined)||null},{'name':_0x57f7('0x7a'),'value':_0x4b9cb6[_0x57f7('0x7a')]||(_0x4b9cb6[_0x57f7('0x5e')]&&_0x4b9cb6[_0x57f7('0x5e')][0x1]?_0x4b9cb6['attrs'][0x1][_0x57f7('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x26f6b6){logger['error'](_0x57f7('0x7b'),JSON[_0x57f7('0x7c')](_0x26f6b6));return[];}}exports[_0x57f7('0x7d')]=function(_0x468d19,_0x3fd850,_0x1b14ad){if(_0x468d19[_0x57f7('0x4d')]['id']){delete _0x468d19['body']['id'];}return db[_0x57f7('0x44')]['find']({'where':{'id':_0x468d19[_0x57f7('0x4b')]['id']}})[_0x57f7('0x26')](handleEntityNotFound(_0x3fd850,null))['then'](function(_0x1af48e){if(_0x1af48e){_0x468d19[_0x57f7('0x4d')]['DashboardId']=_0x1af48e['id'];_0x468d19['body'][_0x57f7('0x5e')]=widgetAttributes(_0x468d19[_0x57f7('0x4d')]);return db[_0x57f7('0x7e')][_0x57f7('0x4c')](_0x468d19[_0x57f7('0x4d')]);}})['then'](respondWithResult(_0x3fd850,null))[_0x57f7('0x49')](handleError(_0x3fd850,null));};exports[_0x57f7('0x7f')]=function(_0x40bab6,_0x469345,_0x1e2816){var _0x364f03={};var _0x2293a1={};var _0x5bdeee;var _0x1632e9;return db['Dashboard'][_0x57f7('0x80')]({'where':{'id':_0x40bab6[_0x57f7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x469345,null))['then'](function(_0x3c0389){if(_0x3c0389){_0x5bdeee=_0x3c0389;_0x2293a1[_0x57f7('0x36')]=_[_0x57f7('0x33')](db[_0x57f7('0x7e')]['rawAttributes']);_0x2293a1[_0x57f7('0x32')]=_[_0x57f7('0x33')](_0x40bab6[_0x57f7('0x32')]);_0x2293a1['filters']=_[_0x57f7('0x35')](_0x2293a1['model'],_0x2293a1[_0x57f7('0x32')]);_0x364f03[_0x57f7('0x37')]=_[_0x57f7('0x35')](_0x2293a1[_0x57f7('0x36')],qs[_0x57f7('0x38')](_0x40bab6[_0x57f7('0x32')][_0x57f7('0x38')]));_0x364f03[_0x57f7('0x37')]=_0x364f03[_0x57f7('0x37')][_0x57f7('0x39')]?_0x364f03[_0x57f7('0x37')]:_0x2293a1[_0x57f7('0x36')];_0x364f03[_0x57f7('0x3c')]=qs[_0x57f7('0x3d')](_0x40bab6[_0x57f7('0x32')][_0x57f7('0x3d')]);_0x364f03[_0x57f7('0x3e')]=qs['filters'](_[_0x57f7('0x3f')](_0x40bab6[_0x57f7('0x32')],_0x2293a1[_0x57f7('0x34')]));if(_0x40bab6[_0x57f7('0x32')][_0x57f7('0x40')]){_0x364f03[_0x57f7('0x3e')]=_[_0x57f7('0x41')](_0x364f03['where'],{'$or':_[_0x57f7('0x31')](_0x364f03[_0x57f7('0x37')],function(_0x224485){var _0x324aaf={};_0x324aaf[_0x224485]={'$like':'%'+_0x40bab6[_0x57f7('0x32')][_0x57f7('0x40')]+'%'};return _0x324aaf;})});}_0x364f03=_[_0x57f7('0x41')]({},_0x364f03,_0x40bab6[_0x57f7('0x43')]);return _0x5bdeee[_0x57f7('0x7f')](_0x364f03);}})[_0x57f7('0x26')](function(_0x96f0cc){if(_0x96f0cc){_0x1632e9=_0x96f0cc[_0x57f7('0x39')];if(!_0x40bab6['query'][_0x57f7('0x3a')]('nolimit')){_0x364f03[_0x57f7('0x1e')]=qs[_0x57f7('0x1e')](_0x40bab6[_0x57f7('0x32')]['limit']);_0x364f03[_0x57f7('0x1c')]=qs['offset'](_0x40bab6[_0x57f7('0x32')][_0x57f7('0x1c')]);}return _0x5bdeee[_0x57f7('0x7f')](_0x364f03);}})[_0x57f7('0x26')](function(_0x379dad){if(_0x379dad){return _0x379dad?{'count':_0x1632e9,'rows':_0x379dad}:null;}})[_0x57f7('0x26')](respondWithResult(_0x469345,null))[_0x57f7('0x49')](handleError(_0x469345,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4254e37..8a1bde2 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 _0x90ec=['hook','exports','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x30442d,_0xa0c1bc){var _0x599016=function(_0x2132c0){while(--_0x2132c0){_0x30442d['push'](_0x30442d['shift']());}};_0x599016(++_0xa0c1bc);}(_0x90ec,0x159));var _0xc90e=function(_0x8ffcf,_0x331803){_0x8ffcf=_0x8ffcf-0x0;var _0x565137=_0x90ec[_0x8ffcf];return _0x565137;};'use strict';var EventEmitter=require(_0xc90e('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc90e('0x1')](0x0);var events={'afterCreate':_0xc90e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x41cc62){return function(_0x2ce303,_0x3796ea,_0x2fba8b){DashboardEvents[_0xc90e('0x3')](_0x41cc62+':'+_0x2ce303['id'],_0x2ce303);DashboardEvents[_0xc90e('0x3')](_0x41cc62,_0x2ce303);_0x2fba8b(null);};}for(var e in events){if(events[_0xc90e('0x4')](e)){var event=events[e];Dashboard[_0xc90e('0x5')](e,emitEvent(event));}}module[_0xc90e('0x6')]=DashboardEvents; \ No newline at end of file +var _0x2a23=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','update','emit'];(function(_0x32b13e,_0x211d38){var _0x242a0b=function(_0x51e779){while(--_0x51e779){_0x32b13e['push'](_0x32b13e['shift']());}};_0x242a0b(++_0x211d38);}(_0x2a23,0x8b));var _0x32a2=function(_0x236b87,_0x8eaba6){_0x236b87=_0x236b87-0x0;var _0x577129=_0x2a23[_0x236b87];return _0x577129;};'use strict';var EventEmitter=require(_0x32a2('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x32a2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x32a2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32a2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x517ae8){return function(_0x58a388,_0x586ba4,_0x41a60a){DashboardEvents[_0x32a2('0x4')](_0x517ae8+':'+_0x58a388['id'],_0x58a388);DashboardEvents[_0x32a2('0x4')](_0x517ae8,_0x58a388);_0x41a60a(null);};}for(var e in events){if(events[_0x32a2('0x5')](e)){var event=events[e];Dashboard[_0x32a2('0x6')](e,emitEvent(event));}}module[_0x32a2('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4debd95..afec09f 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 _0xd934=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd934,0x15d));var _0x4d93=function(_0xae3833,_0xbb4b22){_0xae3833=_0xae3833-0x0;var _0x169f64=_0xd934[_0xae3833];return _0x169f64;};'use strict';var _=require(_0x4d93('0x0'));var util=require(_0x4d93('0x1'));var logger=require(_0x4d93('0x2'))(_0x4d93('0x3'));var moment=require(_0x4d93('0x4'));var BPromise=require(_0x4d93('0x5'));var rp=require(_0x4d93('0x6'));var fs=require('fs');var path=require(_0x4d93('0x7'));var rimraf=require(_0x4d93('0x8'));var config=require(_0x4d93('0x9'));var attributes=require(_0x4d93('0xa'));module[_0x4d93('0xb')]=function(_0x579f98,_0x19e053){return _0x579f98[_0x4d93('0xc')]('Dashboard',attributes,{'tableName':_0x4d93('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb927=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards'];(function(_0x1d75e5,_0x6d9fb3){var _0x1d8789=function(_0xfbdf1c){while(--_0xfbdf1c){_0x1d75e5['push'](_0x1d75e5['shift']());}};_0x1d8789(++_0x6d9fb3);}(_0xb927,0xa9));var _0x7b92=function(_0x76bd02,_0x955ef8){_0x76bd02=_0x76bd02-0x0;var _0x5b4011=_0xb927[_0x76bd02];return _0x5b4011;};'use strict';var _=require('lodash');var util=require(_0x7b92('0x0'));var logger=require(_0x7b92('0x1'))(_0x7b92('0x2'));var moment=require(_0x7b92('0x3'));var BPromise=require(_0x7b92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b92('0x5'));var rimraf=require(_0x7b92('0x6'));var config=require(_0x7b92('0x7'));var attributes=require(_0x7b92('0x8'));module[_0x7b92('0x9')]=function(_0x181217,_0x37a67b){return _0x181217[_0x7b92('0xa')](_0x7b92('0xb'),attributes,{'tableName':_0x7b92('0xc'),'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 336727f..7783463 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 _0x1d06=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dashboard,\x20%s,\x20%s','info','result','lodash','util'];(function(_0x8db6bb,_0x4dea35){var _0x454289=function(_0x4ff293){while(--_0x4ff293){_0x8db6bb['push'](_0x8db6bb['shift']());}};_0x454289(++_0x4dea35);}(_0x1d06,0x148));var _0x61d0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d06[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x61d0('0x0'));var util=require(_0x61d0('0x1'));var moment=require(_0x61d0('0x2'));var BPromise=require('bluebird');var rs=require(_0x61d0('0x3'));var fs=require('fs');var Redis=require(_0x61d0('0x4'));var db=require(_0x61d0('0x5'))['db'];var utils=require(_0x61d0('0x6'));var logger=require(_0x61d0('0x7'))(_0x61d0('0x8'));var config=require(_0x61d0('0x9'));var jayson=require(_0x61d0('0xa'));var client=jayson[_0x61d0('0xb')][_0x61d0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x61d0('0xd')],{'host':_0x61d0('0xe'),'port':0x18eb});var socket=require(_0x61d0('0xf'))(new Redis(config['redis']));require(_0x61d0('0x10'))[_0x61d0('0x11')](socket);function respondWithRpcPromise(_0x58059a,_0x4053e8,_0x339b68){return new BPromise(function(_0x2929b4,_0x57f2c2){return client[_0x61d0('0x12')](_0x58059a,_0x339b68)[_0x61d0('0x13')](function(_0x26400a){logger['info']('Dashboard,\x20%s,\x20%s',_0x4053e8,_0x61d0('0x14'));logger[_0x61d0('0x15')](_0x61d0('0x16'),_0x4053e8,_0x61d0('0x14'),JSON[_0x61d0('0x17')](_0x26400a));if(_0x26400a[_0x61d0('0x18')]){if(_0x26400a[_0x61d0('0x18')][_0x61d0('0x19')]===0x1f4){logger[_0x61d0('0x18')]('Dashboard,\x20%s,\x20%s',_0x4053e8,_0x26400a[_0x61d0('0x18')][_0x61d0('0x1a')]);return _0x57f2c2(_0x26400a[_0x61d0('0x18')]['message']);}logger[_0x61d0('0x18')](_0x61d0('0x1b'),_0x4053e8,_0x26400a[_0x61d0('0x18')]['message']);return _0x2929b4(_0x26400a[_0x61d0('0x18')]['message']);}else{logger[_0x61d0('0x1c')](_0x61d0('0x1b'),_0x4053e8,_0x61d0('0x14'));_0x2929b4(_0x26400a[_0x61d0('0x1d')][_0x61d0('0x1a')]);}})['catch'](function(_0x24537a){logger[_0x61d0('0x18')](_0x61d0('0x1b'),_0x4053e8,_0x24537a);_0x57f2c2(_0x24537a);});});} \ No newline at end of file +var _0x1310=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','moment','randomstring','../../mysqldb'];(function(_0x1523cc,_0x22cc8b){var _0x262231=function(_0x32ea91){while(--_0x32ea91){_0x1523cc['push'](_0x1523cc['shift']());}};_0x262231(++_0x22cc8b);}(_0x1310,0x1ac));var _0x0131=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1310[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0131('0x0'));var util=require('util');var moment=require(_0x0131('0x1'));var BPromise=require('bluebird');var rs=require(_0x0131('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0131('0x3'))['db'];var utils=require(_0x0131('0x4'));var logger=require(_0x0131('0x5'))('rpc');var config=require(_0x0131('0x6'));var jayson=require(_0x0131('0x7'));var client=jayson[_0x0131('0x8')][_0x0131('0x9')]({'port':0x232a});config[_0x0131('0xa')]=_[_0x0131('0xb')](config[_0x0131('0xa')],{'host':_0x0131('0xc'),'port':0x18eb});var socket=require(_0x0131('0xd'))(new Redis(config[_0x0131('0xa')]));require(_0x0131('0xe'))[_0x0131('0xf')](socket);function respondWithRpcPromise(_0x4353a5,_0x58b1df,_0x40de98){return new BPromise(function(_0x3b0d8b,_0x3886a8){return client[_0x0131('0x10')](_0x4353a5,_0x40de98)[_0x0131('0x11')](function(_0x212fa0){logger['info'](_0x0131('0x12'),_0x58b1df,_0x0131('0x13'));logger[_0x0131('0x14')](_0x0131('0x15'),_0x58b1df,_0x0131('0x13'),JSON['stringify'](_0x212fa0));if(_0x212fa0[_0x0131('0x16')]){if(_0x212fa0[_0x0131('0x16')][_0x0131('0x17')]===0x1f4){logger[_0x0131('0x16')](_0x0131('0x12'),_0x58b1df,_0x212fa0[_0x0131('0x16')][_0x0131('0x18')]);return _0x3886a8(_0x212fa0[_0x0131('0x16')][_0x0131('0x18')]);}logger[_0x0131('0x16')](_0x0131('0x12'),_0x58b1df,_0x212fa0['error']['message']);return _0x3b0d8b(_0x212fa0['error']['message']);}else{logger[_0x0131('0x19')](_0x0131('0x12'),_0x58b1df,'request\x20sent');_0x3b0d8b(_0x212fa0[_0x0131('0x1a')]['message']);}})['catch'](function(_0x5c3f2f){logger['error']('Dashboard,\x20%s,\x20%s',_0x58b1df,_0x5c3f2f);_0x3886a8(_0x5c3f2f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 15c295c..91f52ed 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 _0xcaef=['remove','emit','save'];(function(_0x13ac91,_0x709aa4){var _0x457a2e=function(_0x56cf8a){while(--_0x56cf8a){_0x13ac91['push'](_0x13ac91['shift']());}};_0x457a2e(++_0x709aa4);}(_0xcaef,0x77));var _0xfcae=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xcaef[_0x1b4b23];return _0x2a325b;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xfcae('0x0'),_0xfcae('0x1'),'update'];function createListener(_0xe58746,_0x43a371){return function(_0x3794eb){_0x43a371[_0xfcae('0x2')](_0xe58746,_0x3794eb);};}function removeListener(_0x2e3919,_0x255da7){return function(){DashboardEvents['removeListener'](_0x2e3919,_0x255da7);};}exports['register']=function(_0x84a042){for(var _0x41ca0a=0x0,_0x5ba2fb=events['length'];_0x41ca0a<_0x5ba2fb;_0x41ca0a++){var _0x309bd9=events[_0x41ca0a];var _0x45d52c=createListener('dashboard:'+_0x309bd9,_0x84a042);DashboardEvents['on'](_0x309bd9,_0x45d52c);}}; \ No newline at end of file +var _0xb0c8=['./dashboard.events','update','emit','removeListener','register','dashboard:'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xb0c8,0xb4));var _0x8b0c=function(_0x2e1276,_0x140513){_0x2e1276=_0x2e1276-0x0;var _0x2cff93=_0xb0c8[_0x2e1276];return _0x2cff93;};'use strict';var DashboardEvents=require(_0x8b0c('0x0'));var events=['save','remove',_0x8b0c('0x1')];function createListener(_0x22232f,_0x232b9a){return function(_0x4084c9){_0x232b9a[_0x8b0c('0x2')](_0x22232f,_0x4084c9);};}function removeListener(_0x1b13b2,_0x713c71){return function(){DashboardEvents[_0x8b0c('0x3')](_0x1b13b2,_0x713c71);};}exports[_0x8b0c('0x4')]=function(_0x4e386f){for(var _0x5e6939=0x0,_0x4ebd33=events['length'];_0x5e6939<_0x4ebd33;_0x5e6939++){var _0x1c9e97=events[_0x5e6939];var _0x479a6b=createListener(_0x8b0c('0x5')+_0x1c9e97,_0x4e386f);DashboardEvents['on'](_0x1c9e97,_0x479a6b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index a6a2621..eacc9a7 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 _0xf68d=['addItem','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone'];(function(_0x19dc49,_0x2d25b7){var _0x3ccd40=function(_0x48f4a5){while(--_0x48f4a5){_0x19dc49['push'](_0x19dc49['shift']());}};_0x3ccd40(++_0x2d25b7);}(_0xf68d,0xae));var _0xdf68=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xf68d[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf68('0x0'));var timeout=require(_0xdf68('0x1'));var express=require(_0xdf68('0x2'));var router=express[_0xdf68('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf68('0x4'));var interaction=require(_0xdf68('0x5'));var config=require(_0xdf68('0x6'));var controller=require(_0xdf68('0x7'));router[_0xdf68('0x8')]('/',auth[_0xdf68('0x9')](),controller['index']);router[_0xdf68('0x8')](_0xdf68('0xa'),auth[_0xdf68('0x9')](),controller[_0xdf68('0xb')]);router[_0xdf68('0x8')](_0xdf68('0xc'),auth[_0xdf68('0x9')](),controller[_0xdf68('0xd')]);router['post']('/',auth[_0xdf68('0x9')](),controller[_0xdf68('0xe')]);router[_0xdf68('0xf')](_0xdf68('0x10'),auth['isAuthenticated'](),controller[_0xdf68('0x11')]);router[_0xdf68('0xf')](_0xdf68('0xc'),auth[_0xdf68('0x9')](),controller[_0xdf68('0x12')]);router[_0xdf68('0x13')](_0xdf68('0xa'),auth[_0xdf68('0x9')](),controller[_0xdf68('0x14')]);router[_0xdf68('0x15')]('/:id',auth[_0xdf68('0x9')](),controller[_0xdf68('0x16')]);module[_0xdf68('0x17')]=router; \ No newline at end of file +var _0x59ac=['clone','addItem','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','isAuthenticated','/:id/items','getItems','post'];(function(_0x359096,_0x228963){var _0x3a90fa=function(_0x2bc825){while(--_0x2bc825){_0x359096['push'](_0x359096['shift']());}};_0x3a90fa(++_0x228963);}(_0x59ac,0xee));var _0xc59a=function(_0x5c7633,_0x5830b2){_0x5c7633=_0x5c7633-0x0;var _0x18a951=_0x59ac[_0x5c7633];return _0x18a951;};'use strict';var multer=require(_0xc59a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc59a('0x1'));var express=require(_0xc59a('0x2'));var router=express[_0xc59a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc59a('0x4'));var config=require(_0xc59a('0x5'));var controller=require(_0xc59a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc59a('0x7')]);router[_0xc59a('0x8')](_0xc59a('0x9'),auth[_0xc59a('0xa')](),controller['show']);router[_0xc59a('0x8')](_0xc59a('0xb'),auth[_0xc59a('0xa')](),controller[_0xc59a('0xc')]);router[_0xc59a('0xd')]('/',auth[_0xc59a('0xa')](),controller['create']);router[_0xc59a('0xd')]('/:id/clone',auth[_0xc59a('0xa')](),controller[_0xc59a('0xe')]);router['post'](_0xc59a('0xb'),auth['isAuthenticated'](),controller[_0xc59a('0xf')]);router[_0xc59a('0x10')](_0xc59a('0x9'),auth['isAuthenticated'](),controller[_0xc59a('0x11')]);router[_0xc59a('0x12')]('/:id',auth[_0xc59a('0xa')](),controller[_0xc59a('0x13')]);module[_0xc59a('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 24dec4f..387d83d 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 _0x524e=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0x3c78f5,_0x496a14){var _0xd94db7=function(_0x3403f1){while(--_0x3403f1){_0x3c78f5['push'](_0x3c78f5['shift']());}};_0xd94db7(++_0x496a14);}(_0x524e,0x15e));var _0xe524=function(_0x58f73a,_0x2b3a54){_0x58f73a=_0x58f73a-0x0;var _0x20db15=_0x524e[_0x58f73a];return _0x20db15;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0xe524('0x0'));module[_0xe524('0x1')]={'title':{'type':Sequelize[_0xe524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe524('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe524('0x3')](_0xe524('0x4')),'get':function(){try{return JSON[_0xe524('0x5')](this[_0xe524('0x6')](_0xe524('0x7')));}catch(_0x110cff){return[];}},'set':function(_0x4f75d6){try{this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')](_0x4f75d6));}catch(_0x533c14){this[_0xe524('0x8')](_0xe524('0x7'),JSON[_0xe524('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe524('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe524('0xa')]},'col':{'type':Sequelize[_0xe524('0xa')]},'background':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe524('0x2')],'allowNull':![],'defaultValue':_0xe524('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe524('0x2')]},'titleFontSize':{'type':Sequelize[_0xe524('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x40e330,_0x2a6350){var _0x59197b=function(_0x36ebcd){while(--_0x36ebcd){_0x40e330['push'](_0x40e330['shift']());}};_0x59197b(++_0x2a6350);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x53fdbf,_0x181cf3){_0x53fdbf=_0x53fdbf-0x0;var _0x1a5a67=_0xc6ac[_0x53fdbf];return _0x1a5a67;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'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 c87b26c..d0731e5 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 _0x1a44=['create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','reportType','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify'];(function(_0x2c5159,_0x547c55){var _0x201c59=function(_0x563447){while(--_0x563447){_0x2c5159['push'](_0x2c5159['shift']());}};_0x201c59(++_0x547c55);}(_0x1a44,0xc4));var _0x41a4=function(_0x4711f6,_0x4904e1){_0x4711f6=_0x4711f6-0x0;var _0x1022cd=_0x1a44[_0x4711f6];return _0x1022cd;};'use strict';var emlformat=require(_0x41a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x41a4('0x1'));var jsonpatch=require(_0x41a4('0x2'));var rp=require(_0x41a4('0x3'));var moment=require(_0x41a4('0x4'));var BPromise=require(_0x41a4('0x5'));var Mustache=require(_0x41a4('0x6'));var util=require(_0x41a4('0x7'));var path=require('path');var sox=require(_0x41a4('0x8'));var csv=require(_0x41a4('0x9'));var ejs=require(_0x41a4('0xa'));var fs=require('fs');var fs_extra=require(_0x41a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x41a4('0xc'));var jsforce=require(_0x41a4('0xd'));var deskjs=require(_0x41a4('0xe'));var toCsv=require(_0x41a4('0x9'));var querystring=require(_0x41a4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41a4('0x10'));var qs=require(_0x41a4('0x11'));var as=require(_0x41a4('0x12'));var hardwareService=require(_0x41a4('0x13'));var logger=require(_0x41a4('0x14'))(_0x41a4('0x15'));var utils=require('../../config/utils');var config=require(_0x41a4('0x16'));var licenseUtil=require(_0x41a4('0x17'));var db=require(_0x41a4('0x18'))['db'];config[_0x41a4('0x19')]=_['defaults'](config[_0x41a4('0x19')],{'host':_0x41a4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41a4('0x19')]));require(_0x41a4('0x1b'))['register'](socket);function respondWithStatusCode(_0x59a178,_0xb4c27e){_0xb4c27e=_0xb4c27e||0xcc;return function(_0x25acc1){if(_0x25acc1){return _0x59a178[_0x41a4('0x1c')](_0xb4c27e);}return _0x59a178[_0x41a4('0x1d')](_0xb4c27e)[_0x41a4('0x1e')]();};}function respondWithResult(_0x59dc91,_0x4f7967){_0x4f7967=_0x4f7967||0xc8;return function(_0x5043f5){if(_0x5043f5){return _0x59dc91[_0x41a4('0x1d')](_0x4f7967)[_0x41a4('0x1f')](_0x5043f5);}};}function respondWithFilteredResult(_0x1c45db,_0x35e658){return function(_0x239912){if(_0x239912){var _0x1b5788=typeof _0x35e658[_0x41a4('0x20')]===_0x41a4('0x21')&&typeof _0x35e658[_0x41a4('0x22')]===_0x41a4('0x21');var _0xea3da1=_0x239912['count'];var _0x2faa2a=_0x1b5788?0x0:_0x35e658[_0x41a4('0x20')];var _0x347403=_0x1b5788?_0x239912['count']:_0x35e658[_0x41a4('0x20')]+_0x35e658[_0x41a4('0x22')];var _0x3669dd;if(_0x347403>=_0xea3da1){_0x347403=_0xea3da1;_0x3669dd=0xc8;}else{_0x3669dd=0xce;}_0x1c45db[_0x41a4('0x1d')](_0x3669dd);return _0x1c45db['set'](_0x41a4('0x23'),_0x2faa2a+'-'+_0x347403+'/'+_0xea3da1)[_0x41a4('0x1f')](_0x239912);}return null;};}function patchUpdates(_0x4b86be){return function(_0x110a18){try{jsonpatch['apply'](_0x110a18,_0x4b86be,!![]);}catch(_0x14d401){return BPromise[_0x41a4('0x24')](_0x14d401);}return _0x110a18[_0x41a4('0x25')]();};}function saveUpdates(_0x18e3dd,_0x3b1fbc){return function(_0x327fe9){if(_0x327fe9){return _0x327fe9[_0x41a4('0x26')](_0x18e3dd)[_0x41a4('0x27')](function(_0x263639){return _0x263639;});}return null;};}function removeEntity(_0x2a7c16,_0x3890eb){return function(_0x1ddd4f){if(_0x1ddd4f){return _0x1ddd4f['destroy']()[_0x41a4('0x27')](function(){_0x2a7c16[_0x41a4('0x1d')](0xcc)[_0x41a4('0x1e')]();});}};}function handleEntityNotFound(_0x54590b,_0x3478dd){return function(_0x99bcec){if(!_0x99bcec){_0x54590b[_0x41a4('0x1c')](0x194);}return _0x99bcec;};}function handleError(_0x298073,_0x4b2f83){_0x4b2f83=_0x4b2f83||0x1f4;return function(_0x2f7305){logger['error'](_0x2f7305[_0x41a4('0x28')]);if(_0x2f7305[_0x41a4('0x29')]){delete _0x2f7305[_0x41a4('0x29')];}_0x298073['status'](_0x4b2f83)[_0x41a4('0x2a')](_0x2f7305);};}exports[_0x41a4('0x2b')]=function(_0x3bbcc5,_0x3c1371){var _0x2cfe57={'raw':![],'where':{'id':_0x3bbcc5[_0x41a4('0x2c')]['id']}},_0x3ad2fa={};_0x3ad2fa[_0x41a4('0x2d')]=_[_0x41a4('0x2e')](db['DashboardItem'][_0x41a4('0x2f')]);_0x3ad2fa[_0x41a4('0x30')]=_['keys'](_0x3bbcc5['query']);_0x3ad2fa[_0x41a4('0x31')]=_[_0x41a4('0x32')](_0x3ad2fa['model'],_0x3ad2fa[_0x41a4('0x30')]);_0x2cfe57[_0x41a4('0x33')]=_[_0x41a4('0x32')](_0x3ad2fa[_0x41a4('0x2d')],qs[_0x41a4('0x34')](_0x3bbcc5[_0x41a4('0x30')][_0x41a4('0x34')]));_0x2cfe57[_0x41a4('0x33')]=_0x2cfe57[_0x41a4('0x33')][_0x41a4('0x35')]?_0x2cfe57['attributes']:_0x3ad2fa[_0x41a4('0x2d')];if(_0x3bbcc5[_0x41a4('0x30')][_0x41a4('0x36')]){_0x2cfe57[_0x41a4('0x37')]=[{'all':!![]}];}_0x2cfe57=_[_0x41a4('0x38')]({},_0x2cfe57,_0x3bbcc5[_0x41a4('0x39')]);return db[_0x41a4('0x3a')][_0x41a4('0x3b')](_0x2cfe57)[_0x41a4('0x27')](handleEntityNotFound(_0x3c1371,null))['then'](respondWithResult(_0x3c1371,null))[_0x41a4('0x3c')](handleError(_0x3c1371,null));};exports['destroy']=function(_0x65ab1,_0x156d90){return db[_0x41a4('0x3a')][_0x41a4('0x3b')]({'where':{'id':_0x65ab1[_0x41a4('0x2c')]['id']}})[_0x41a4('0x27')](handleEntityNotFound(_0x156d90,null))[_0x41a4('0x27')](removeEntity(_0x156d90,null))['catch'](handleError(_0x156d90,null));};function widgetAttributes(_0x489603){try{switch(_0x489603['type']){case'iframe':return[{'name':_0x41a4('0x3d'),'value':_0x489603[_0x41a4('0x3d')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x0]?_0x489603['attrs'][0x0][_0x41a4('0x3f')]:undefined)||_0x41a4('0x40')}];case _0x41a4('0x41'):return[{'name':_0x41a4('0x42'),'value':_0x489603[_0x41a4('0x42')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x0]?_0x489603['attrs'][0x0][_0x41a4('0x3f')]:undefined)||''}];case _0x41a4('0x43'):return[{'name':_0x41a4('0x44'),'value':_0x489603[_0x41a4('0x44')]||(_0x489603['attrs']&&_0x489603['attrs'][0x0]?_0x489603['attrs'][0x0][_0x41a4('0x3f')]:undefined)||_0x41a4('0x45')},{'name':_0x41a4('0x46'),'value':_0x489603[_0x41a4('0x46')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x1]?_0x489603[_0x41a4('0x3e')][0x1][_0x41a4('0x3f')]:undefined)||'0.00'},{'name':_0x41a4('0x47'),'value':_0x489603[_0x41a4('0x47')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x2]?_0x489603[_0x41a4('0x3e')][0x2][_0x41a4('0x3f')]:undefined)||0xc}];case _0x41a4('0x48'):return[{'name':'attrMetric','value':_0x489603['attrMetric']||(_0x489603['attrs']&&_0x489603[_0x41a4('0x3e')][0x0]?_0x489603[_0x41a4('0x3e')][0x0][_0x41a4('0x3f')]:undefined)||_0x41a4('0x49')},{'name':_0x41a4('0x4a'),'value':_0x489603['attrVoiceQueues']||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x1]?_0x489603['attrs'][0x1][_0x41a4('0x3f')]:undefined)||[]},{'name':'attrFontSize','value':_0x489603[_0x41a4('0x47')]||(_0x489603['attrs']&&_0x489603[_0x41a4('0x3e')][0x2]?_0x489603[_0x41a4('0x3e')][0x2][_0x41a4('0x3f')]:undefined)||0x14},{'name':_0x41a4('0x4b'),'value':_0x489603['attrChannel']||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x3]?_0x489603[_0x41a4('0x3e')][0x3][_0x41a4('0x3f')]:undefined)||_0x41a4('0x4c')},{'name':'attrEmailAccounts','value':_0x489603[_0x41a4('0x4d')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x4]?_0x489603[_0x41a4('0x3e')][0x4][_0x41a4('0x3f')]:undefined)||''},{'name':_0x41a4('0x4e'),'value':_0x489603['attrFaxAccounts']||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x5]?_0x489603[_0x41a4('0x3e')][0x5][_0x41a4('0x3f')]:undefined)||''},{'name':_0x41a4('0x4f'),'value':_0x489603[_0x41a4('0x4f')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x6]?_0x489603[_0x41a4('0x3e')][0x6]['value']:undefined)||''},{'name':_0x41a4('0x50'),'value':_0x489603[_0x41a4('0x50')]||(_0x489603['attrs']&&_0x489603['attrs'][0x7]?_0x489603[_0x41a4('0x3e')][0x7][_0x41a4('0x3f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x489603['attrWhatsappAccounts']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x8]?_0x489603[_0x41a4('0x3e')][0x8]['value']:undefined)||''},{'name':_0x41a4('0x51'),'value':_0x489603['attrChatWebsites']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x9]?_0x489603[_0x41a4('0x3e')][0x9]['value']:undefined)||''}];case _0x41a4('0x52'):case _0x41a4('0x53'):return[{'name':_0x41a4('0x54'),'value':_0x489603['attrSerie1']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x0]?_0x489603['attrs'][0x0]['value']:undefined)||_0x41a4('0x49')},{'name':_0x41a4('0x55'),'value':_0x489603[_0x41a4('0x55')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x1]?_0x489603[_0x41a4('0x3e')][0x1][_0x41a4('0x3f')]:undefined)||null},{'name':_0x41a4('0x56'),'value':_0x489603['attrSerie3']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x2]?_0x489603[_0x41a4('0x3e')][0x2][_0x41a4('0x3f')]:undefined)||null},{'name':_0x41a4('0x4a'),'value':_0x489603[_0x41a4('0x4a')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x3]?_0x489603[_0x41a4('0x3e')][0x3]['value']:undefined)||[]},{'name':_0x41a4('0x4b'),'value':_0x489603['attrChannel']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x4]?_0x489603[_0x41a4('0x3e')][0x4][_0x41a4('0x3f')]:undefined)||_0x41a4('0x4c')},{'name':_0x41a4('0x4d'),'value':_0x489603['attrEmailAccounts']||(_0x489603['attrs']&&_0x489603['attrs'][0x5]?_0x489603[_0x41a4('0x3e')][0x5]['value']:undefined)||''},{'name':_0x41a4('0x4e'),'value':_0x489603[_0x41a4('0x4e')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x6]?_0x489603[_0x41a4('0x3e')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x489603[_0x41a4('0x4f')]||(_0x489603['attrs']&&_0x489603['attrs'][0x7]?_0x489603[_0x41a4('0x3e')][0x7][_0x41a4('0x3f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x489603['attrOpenchannelAccounts']||(_0x489603[_0x41a4('0x3e')]&&_0x489603['attrs'][0x8]?_0x489603[_0x41a4('0x3e')][0x8][_0x41a4('0x3f')]:undefined)||''},{'name':_0x41a4('0x57'),'value':_0x489603[_0x41a4('0x57')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x9]?_0x489603['attrs'][0x9][_0x41a4('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x489603['attrChatWebsites']||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0xa]?_0x489603[_0x41a4('0x3e')][0xa][_0x41a4('0x3f')]:undefined)||''}];case _0x41a4('0x58'):return[{'name':'attrReport','type':_0x489603[_0x41a4('0x59')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x0]?_0x489603[_0x41a4('0x3e')][0x0]['type']:undefined)||null,'value':_0x489603[_0x41a4('0x5a')]||(_0x489603[_0x41a4('0x3e')]&&_0x489603[_0x41a4('0x3e')][0x0]?_0x489603[_0x41a4('0x3e')][0x0][_0x41a4('0x3f')]:undefined)||null},{'name':_0x41a4('0x5b'),'value':_0x489603[_0x41a4('0x5b')]||(_0x489603['attrs']&&_0x489603[_0x41a4('0x3e')][0x1]?_0x489603['attrs'][0x1][_0x41a4('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5c2c21){logger[_0x41a4('0x5c')](_0x41a4('0x5d'),JSON[_0x41a4('0x5e')](_0x5c2c21));return[];}}exports[_0x41a4('0x5f')]=function(_0x3b47ae,_0x2d8c0c){if(_0x3b47ae[_0x41a4('0x60')]){_0x3b47ae[_0x41a4('0x60')][_0x41a4('0x3e')]=widgetAttributes(_0x3b47ae[_0x41a4('0x60')]);}return db[_0x41a4('0x3a')][_0x41a4('0x5f')](_0x3b47ae[_0x41a4('0x60')],{})[_0x41a4('0x27')](respondWithResult(_0x2d8c0c,0xc9))['catch'](handleError(_0x2d8c0c,null));};exports[_0x41a4('0x26')]=function(_0x187b03,_0x523703){if(_0x187b03[_0x41a4('0x60')]['id']){delete _0x187b03['body']['id'];}_0x187b03[_0x41a4('0x60')][_0x41a4('0x3e')]=widgetAttributes(_0x187b03[_0x41a4('0x60')]);return db['DashboardItem']['find']({'where':{'id':_0x187b03[_0x41a4('0x2c')]['id']}})[_0x41a4('0x27')](handleEntityNotFound(_0x523703,null))[_0x41a4('0x27')](saveUpdates(_0x187b03[_0x41a4('0x60')],null))['then'](respondWithResult(_0x523703,null))['catch'](handleError(_0x523703,null));}; \ No newline at end of file +var _0x6075=['attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','name','send','show','params','model','DashboardItem','query','keys','filters','intersection','fields','attributes','length','include','merge','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total'];(function(_0x4d8642,_0x49c7a6){var _0x39d3a6=function(_0x3db485){while(--_0x3db485){_0x4d8642['push'](_0x4d8642['shift']());}};_0x39d3a6(++_0x49c7a6);}(_0x6075,0x191));var _0x5607=function(_0x217ec2,_0x4ffe2d){_0x217ec2=_0x217ec2-0x0;var _0x3581e0=_0x6075[_0x217ec2];return _0x3581e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5607('0x0'));var zipdir=require(_0x5607('0x1'));var jsonpatch=require(_0x5607('0x2'));var rp=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require(_0x5607('0x7'));var path=require(_0x5607('0x8'));var sox=require('sox');var csv=require(_0x5607('0x9'));var ejs=require(_0x5607('0xa'));var fs=require('fs');var fs_extra=require(_0x5607('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5607('0xc'));var jsforce=require(_0x5607('0xd'));var deskjs=require(_0x5607('0xe'));var toCsv=require(_0x5607('0x9'));var querystring=require(_0x5607('0xf'));var Papa=require('papaparse');var Redis=require(_0x5607('0x10'));var authService=require(_0x5607('0x11'));var qs=require(_0x5607('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5607('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5607('0x14'));var config=require(_0x5607('0x15'));var licenseUtil=require(_0x5607('0x16'));var db=require('../../mysqldb')['db'];config[_0x5607('0x17')]=_[_0x5607('0x18')](config[_0x5607('0x17')],{'host':_0x5607('0x19'),'port':0x18eb});var socket=require(_0x5607('0x1a'))(new Redis(config[_0x5607('0x17')]));require(_0x5607('0x1b'))[_0x5607('0x1c')](socket);function respondWithStatusCode(_0x2daf4c,_0x4e1167){_0x4e1167=_0x4e1167||0xcc;return function(_0x1b0720){if(_0x1b0720){return _0x2daf4c[_0x5607('0x1d')](_0x4e1167);}return _0x2daf4c[_0x5607('0x1e')](_0x4e1167)['end']();};}function respondWithResult(_0x556397,_0x3f149e){_0x3f149e=_0x3f149e||0xc8;return function(_0x50e498){if(_0x50e498){return _0x556397[_0x5607('0x1e')](_0x3f149e)[_0x5607('0x1f')](_0x50e498);}};}function respondWithFilteredResult(_0x1fa238,_0x1375e9){return function(_0x3eaaa0){if(_0x3eaaa0){var _0x16a8d9=typeof _0x1375e9['offset']===_0x5607('0x20')&&typeof _0x1375e9['limit']===_0x5607('0x20');var _0x3e071b=_0x3eaaa0[_0x5607('0x21')];var _0x5f080d=_0x16a8d9?0x0:_0x1375e9[_0x5607('0x22')];var _0x6e4868=_0x16a8d9?_0x3eaaa0[_0x5607('0x21')]:_0x1375e9['offset']+_0x1375e9[_0x5607('0x23')];var _0x2fdc13;if(_0x6e4868>=_0x3e071b){_0x6e4868=_0x3e071b;_0x2fdc13=0xc8;}else{_0x2fdc13=0xce;}_0x1fa238[_0x5607('0x1e')](_0x2fdc13);return _0x1fa238['set'](_0x5607('0x24'),_0x5f080d+'-'+_0x6e4868+'/'+_0x3e071b)['json'](_0x3eaaa0);}return null;};}function patchUpdates(_0x49f918){return function(_0x39a9f4){try{jsonpatch[_0x5607('0x25')](_0x39a9f4,_0x49f918,!![]);}catch(_0x32d30a){return BPromise[_0x5607('0x26')](_0x32d30a);}return _0x39a9f4[_0x5607('0x27')]();};}function saveUpdates(_0x34df69,_0x43077d){return function(_0x20918c){if(_0x20918c){return _0x20918c[_0x5607('0x28')](_0x34df69)[_0x5607('0x29')](function(_0x593df7){return _0x593df7;});}return null;};}function removeEntity(_0x20ae60,_0x27e144){return function(_0x482842){if(_0x482842){return _0x482842[_0x5607('0x2a')]()[_0x5607('0x29')](function(){_0x20ae60[_0x5607('0x1e')](0xcc)[_0x5607('0x2b')]();});}};}function handleEntityNotFound(_0x447042,_0x34642e){return function(_0x4a9e32){if(!_0x4a9e32){_0x447042[_0x5607('0x1d')](0x194);}return _0x4a9e32;};}function handleError(_0x570e62,_0xcd4e9f){_0xcd4e9f=_0xcd4e9f||0x1f4;return function(_0x309ede){logger['error'](_0x309ede['stack']);if(_0x309ede[_0x5607('0x2c')]){delete _0x309ede[_0x5607('0x2c')];}_0x570e62[_0x5607('0x1e')](_0xcd4e9f)[_0x5607('0x2d')](_0x309ede);};}exports[_0x5607('0x2e')]=function(_0x536071,_0x2575c3){var _0x4bc522={'raw':![],'where':{'id':_0x536071[_0x5607('0x2f')]['id']}},_0xd6c90a={};_0xd6c90a[_0x5607('0x30')]=_['keys'](db[_0x5607('0x31')]['rawAttributes']);_0xd6c90a[_0x5607('0x32')]=_[_0x5607('0x33')](_0x536071[_0x5607('0x32')]);_0xd6c90a[_0x5607('0x34')]=_[_0x5607('0x35')](_0xd6c90a['model'],_0xd6c90a[_0x5607('0x32')]);_0x4bc522['attributes']=_[_0x5607('0x35')](_0xd6c90a[_0x5607('0x30')],qs['fields'](_0x536071[_0x5607('0x32')][_0x5607('0x36')]));_0x4bc522[_0x5607('0x37')]=_0x4bc522['attributes'][_0x5607('0x38')]?_0x4bc522[_0x5607('0x37')]:_0xd6c90a[_0x5607('0x30')];if(_0x536071[_0x5607('0x32')]['includeAll']){_0x4bc522[_0x5607('0x39')]=[{'all':!![]}];}_0x4bc522=_[_0x5607('0x3a')]({},_0x4bc522,_0x536071['options']);return db[_0x5607('0x31')][_0x5607('0x3b')](_0x4bc522)[_0x5607('0x29')](handleEntityNotFound(_0x2575c3,null))['then'](respondWithResult(_0x2575c3,null))[_0x5607('0x3c')](handleError(_0x2575c3,null));};exports['destroy']=function(_0x2ed4c2,_0x287430){return db[_0x5607('0x31')]['find']({'where':{'id':_0x2ed4c2['params']['id']}})['then'](handleEntityNotFound(_0x287430,null))[_0x5607('0x29')](removeEntity(_0x287430,null))[_0x5607('0x3c')](handleError(_0x287430,null));};function widgetAttributes(_0x341b93){try{switch(_0x341b93[_0x5607('0x3d')]){case _0x5607('0x3e'):return[{'name':_0x5607('0x3f'),'value':_0x341b93[_0x5607('0x3f')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x0]?_0x341b93[_0x5607('0x40')][0x0][_0x5607('0x41')]:undefined)||_0x5607('0x42')}];case _0x5607('0x43'):return[{'name':'attrPath','value':_0x341b93[_0x5607('0x44')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x0]?_0x341b93['attrs'][0x0][_0x5607('0x41')]:undefined)||''}];case _0x5607('0x45'):return[{'name':_0x5607('0x46'),'value':_0x341b93['attrHourFormat']||(_0x341b93['attrs']&&_0x341b93['attrs'][0x0]?_0x341b93[_0x5607('0x40')][0x0][_0x5607('0x41')]:undefined)||_0x5607('0x47')},{'name':'attrTimezone','value':_0x341b93[_0x5607('0x48')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x1]?_0x341b93[_0x5607('0x40')][0x1][_0x5607('0x41')]:undefined)||_0x5607('0x49')},{'name':_0x5607('0x4a'),'value':_0x341b93['attrFontSize']||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x2]?_0x341b93[_0x5607('0x40')][0x2][_0x5607('0x41')]:undefined)||0xc}];case'counter':return[{'name':_0x5607('0x4b'),'value':_0x341b93[_0x5607('0x4b')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x0]?_0x341b93[_0x5607('0x40')][0x0]['value']:undefined)||'total'},{'name':_0x5607('0x4c'),'value':_0x341b93[_0x5607('0x4c')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x1]?_0x341b93[_0x5607('0x40')][0x1][_0x5607('0x41')]:undefined)||[]},{'name':'attrFontSize','value':_0x341b93[_0x5607('0x4a')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x2]?_0x341b93[_0x5607('0x40')][0x2][_0x5607('0x41')]:undefined)||0x14},{'name':_0x5607('0x4d'),'value':_0x341b93['attrChannel']||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x3]?_0x341b93[_0x5607('0x40')][0x3][_0x5607('0x41')]:undefined)||_0x5607('0x4e')},{'name':'attrEmailAccounts','value':_0x341b93[_0x5607('0x4f')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x4]?_0x341b93[_0x5607('0x40')][0x4][_0x5607('0x41')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x341b93[_0x5607('0x50')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x5]?_0x341b93[_0x5607('0x40')][0x5][_0x5607('0x41')]:undefined)||''},{'name':_0x5607('0x51'),'value':_0x341b93[_0x5607('0x51')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x6]?_0x341b93['attrs'][0x6]['value']:undefined)||''},{'name':_0x5607('0x52'),'value':_0x341b93[_0x5607('0x52')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x7]?_0x341b93[_0x5607('0x40')][0x7][_0x5607('0x41')]:undefined)||''},{'name':_0x5607('0x53'),'value':_0x341b93[_0x5607('0x53')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x8]?_0x341b93[_0x5607('0x40')][0x8][_0x5607('0x41')]:undefined)||''},{'name':_0x5607('0x54'),'value':_0x341b93[_0x5607('0x54')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x9]?_0x341b93[_0x5607('0x40')][0x9][_0x5607('0x41')]:undefined)||''}];case _0x5607('0x55'):case _0x5607('0x56'):return[{'name':'attrSerie1','value':_0x341b93[_0x5607('0x57')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x0]?_0x341b93[_0x5607('0x40')][0x0][_0x5607('0x41')]:undefined)||_0x5607('0x58')},{'name':_0x5607('0x59'),'value':_0x341b93[_0x5607('0x59')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x1]?_0x341b93['attrs'][0x1]['value']:undefined)||null},{'name':_0x5607('0x5a'),'value':_0x341b93[_0x5607('0x5a')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x2]?_0x341b93['attrs'][0x2][_0x5607('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x341b93[_0x5607('0x4c')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x3]?_0x341b93[_0x5607('0x40')][0x3]['value']:undefined)||[]},{'name':_0x5607('0x4d'),'value':_0x341b93[_0x5607('0x4d')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x4]?_0x341b93['attrs'][0x4][_0x5607('0x41')]:undefined)||_0x5607('0x4e')},{'name':_0x5607('0x4f'),'value':_0x341b93[_0x5607('0x4f')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x5]?_0x341b93[_0x5607('0x40')][0x5][_0x5607('0x41')]:undefined)||''},{'name':_0x5607('0x50'),'value':_0x341b93[_0x5607('0x50')]||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x6]?_0x341b93[_0x5607('0x40')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x341b93[_0x5607('0x51')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x7]?_0x341b93[_0x5607('0x40')][0x7][_0x5607('0x41')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x341b93['attrOpenchannelAccounts']||(_0x341b93[_0x5607('0x40')]&&_0x341b93['attrs'][0x8]?_0x341b93[_0x5607('0x40')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x341b93['attrWhatsappAccounts']||(_0x341b93['attrs']&&_0x341b93[_0x5607('0x40')][0x9]?_0x341b93[_0x5607('0x40')][0x9][_0x5607('0x41')]:undefined)||''},{'name':_0x5607('0x54'),'value':_0x341b93[_0x5607('0x54')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0xa]?_0x341b93['attrs'][0xa][_0x5607('0x41')]:undefined)||''}];case _0x5607('0x5b'):return[{'name':_0x5607('0x5c'),'type':_0x341b93['reportType']||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x0]?_0x341b93['attrs'][0x0][_0x5607('0x3d')]:undefined)||null,'value':_0x341b93['attrReport']||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x0]?_0x341b93['attrs'][0x0][_0x5607('0x41')]:undefined)||null},{'name':_0x5607('0x5d'),'value':_0x341b93[_0x5607('0x5d')]||(_0x341b93[_0x5607('0x40')]&&_0x341b93[_0x5607('0x40')][0x1]?_0x341b93[_0x5607('0x40')][0x1][_0x5607('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x509ff8){logger['error'](_0x5607('0x5e'),JSON[_0x5607('0x5f')](_0x509ff8));return[];}}exports[_0x5607('0x60')]=function(_0x1beed7,_0x6b3b5a){if(_0x1beed7[_0x5607('0x61')]){_0x1beed7[_0x5607('0x61')][_0x5607('0x40')]=widgetAttributes(_0x1beed7[_0x5607('0x61')]);}return db[_0x5607('0x31')]['create'](_0x1beed7[_0x5607('0x61')],{})['then'](respondWithResult(_0x6b3b5a,0xc9))[_0x5607('0x3c')](handleError(_0x6b3b5a,null));};exports[_0x5607('0x28')]=function(_0x2946b9,_0x4c4857){if(_0x2946b9['body']['id']){delete _0x2946b9[_0x5607('0x61')]['id'];}_0x2946b9['body']['attrs']=widgetAttributes(_0x2946b9['body']);return db['DashboardItem'][_0x5607('0x3b')]({'where':{'id':_0x2946b9[_0x5607('0x2f')]['id']}})[_0x5607('0x29')](handleEntityNotFound(_0x4c4857,null))[_0x5607('0x29')](saveUpdates(_0x2946b9[_0x5607('0x61')],null))[_0x5607('0x29')](respondWithResult(_0x4c4857,null))[_0x5607('0x3c')](handleError(_0x4c4857,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0f6938e..555a4ef 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 _0x13b1=['hook','exports','../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty'];(function(_0x736a72,_0x574f49){var _0x3741ad=function(_0x412a42){while(--_0x412a42){_0x736a72['push'](_0x736a72['shift']());}};_0x3741ad(++_0x574f49);}(_0x13b1,0xda));var _0x113b=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x13b1[_0x1fc84d];return _0x2658fa;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x113b('0x0'))['db'][_0x113b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x113b('0x2'),'afterUpdate':_0x113b('0x3'),'afterDestroy':_0x113b('0x4')};function emitEvent(_0x15c7e8){return function(_0x18c03a,_0x3bc68f,_0x1843bc){DashboardItemEvents[_0x113b('0x5')](_0x15c7e8+':'+_0x18c03a['id'],_0x18c03a);DashboardItemEvents[_0x113b('0x5')](_0x15c7e8,_0x18c03a);_0x1843bc(null);};}for(var e in events){if(events[_0x113b('0x6')](e)){var event=events[e];DashboardItem[_0x113b('0x7')](e,emitEvent(event));}}module[_0x113b('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x4c67=['../../mysqldb','DashboardItem','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x96fcfe,_0x5536a6){var _0xdde894=function(_0x48f6c9){while(--_0x48f6c9){_0x96fcfe['push'](_0x96fcfe['shift']());}};_0xdde894(++_0x5536a6);}(_0x4c67,0x95));var _0x74c6=function(_0x19bd89,_0x48ee11){_0x19bd89=_0x19bd89-0x0;var _0x43a89c=_0x4c67[_0x19bd89];return _0x43a89c;};'use strict';var EventEmitter=require(_0x74c6('0x0'));var DashboardItem=require(_0x74c6('0x1'))['db'][_0x74c6('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x74c6('0x3'),'afterUpdate':_0x74c6('0x4'),'afterDestroy':_0x74c6('0x5')};function emitEvent(_0xc7655f){return function(_0x98ad18,_0x120694,_0x3de0b1){DashboardItemEvents[_0x74c6('0x6')](_0xc7655f+':'+_0x98ad18['id'],_0x98ad18);DashboardItemEvents[_0x74c6('0x6')](_0xc7655f,_0x98ad18);_0x3de0b1(null);};}for(var e in events){if(events[_0x74c6('0x7')](e)){var event=events[e];DashboardItem[_0x74c6('0x8')](e,emitEvent(event));}}module[_0x74c6('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index a6fda1b..33379a8 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 _0xe5e5=['./dashboardItem.attributes','exports','define','DashboardItem','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x427206,_0x4a096d){var _0x2d5fe8=function(_0x46bf44){while(--_0x46bf44){_0x427206['push'](_0x427206['shift']());}};_0x2d5fe8(++_0x4a096d);}(_0xe5e5,0x7c));var _0x5e5e=function(_0x1d2560,_0x1ffa41){_0x1d2560=_0x1d2560-0x0;var _0x361a00=_0xe5e5[_0x1d2560];return _0x361a00;};'use strict';var _=require(_0x5e5e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e5e('0x1'));var moment=require(_0x5e5e('0x2'));var BPromise=require(_0x5e5e('0x3'));var rp=require(_0x5e5e('0x4'));var fs=require('fs');var path=require(_0x5e5e('0x5'));var rimraf=require(_0x5e5e('0x6'));var config=require(_0x5e5e('0x7'));var attributes=require(_0x5e5e('0x8'));module[_0x5e5e('0x9')]=function(_0x3e2f33,_0x430013){return _0x3e2f33[_0x5e5e('0xa')](_0x5e5e('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85fc=['bluebird','request-promise','rimraf','../../config/environment','exports','DashboardItem','lodash','api','moment'];(function(_0x5e1120,_0x3f0a7b){var _0x520a25=function(_0x5f52b5){while(--_0x5f52b5){_0x5e1120['push'](_0x5e1120['shift']());}};_0x520a25(++_0x3f0a7b);}(_0x85fc,0x7b));var _0xc85f=function(_0x4ee828,_0xcfd57){_0x4ee828=_0x4ee828-0x0;var _0x383eb8=_0x85fc[_0x4ee828];return _0x383eb8;};'use strict';var _=require(_0xc85f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc85f('0x1'));var moment=require(_0xc85f('0x2'));var BPromise=require(_0xc85f('0x3'));var rp=require(_0xc85f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc85f('0x5'));var config=require(_0xc85f('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xc85f('0x7')]=function(_0x5e1ead,_0x5a45b3){return _0x5e1ead['define'](_0xc85f('0x8'),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 b0c4e89..908d50f 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 _0xdd23=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xdd23,0x184));var _0x3dd2=function(_0x1ac8cd,_0x173f97){_0x1ac8cd=_0x1ac8cd-0x0;var _0x489191=_0xdd23[_0x1ac8cd];return _0x489191;};'use strict';var _=require(_0x3dd2('0x0'));var util=require(_0x3dd2('0x1'));var moment=require(_0x3dd2('0x2'));var BPromise=require(_0x3dd2('0x3'));var rs=require(_0x3dd2('0x4'));var fs=require('fs');var Redis=require(_0x3dd2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3dd2('0x6'));var logger=require('../../config/logger')(_0x3dd2('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dd2('0x8'));var client=jayson[_0x3dd2('0x9')]['http']({'port':0x232a});config[_0x3dd2('0xa')]=_['defaults'](config['redis'],{'host':_0x3dd2('0xb'),'port':0x18eb});var socket=require(_0x3dd2('0xc'))(new Redis(config[_0x3dd2('0xa')]));require(_0x3dd2('0xd'))[_0x3dd2('0xe')](socket);function respondWithRpcPromise(_0x26e441,_0x3683e8,_0x4b6107){return new BPromise(function(_0x5c52e0,_0x2b8d6c){return client[_0x3dd2('0xf')](_0x26e441,_0x4b6107)[_0x3dd2('0x10')](function(_0x287380){logger[_0x3dd2('0x11')](_0x3dd2('0x12'),_0x3683e8,_0x3dd2('0x13'));logger[_0x3dd2('0x14')](_0x3dd2('0x15'),_0x3683e8,'request\x20sent',JSON[_0x3dd2('0x16')](_0x287380));if(_0x287380[_0x3dd2('0x17')]){if(_0x287380['error'][_0x3dd2('0x18')]===0x1f4){logger[_0x3dd2('0x17')](_0x3dd2('0x12'),_0x3683e8,_0x287380[_0x3dd2('0x17')][_0x3dd2('0x19')]);return _0x2b8d6c(_0x287380[_0x3dd2('0x17')][_0x3dd2('0x19')]);}logger[_0x3dd2('0x17')](_0x3dd2('0x12'),_0x3683e8,_0x287380[_0x3dd2('0x17')][_0x3dd2('0x19')]);return _0x5c52e0(_0x287380[_0x3dd2('0x17')][_0x3dd2('0x19')]);}else{logger[_0x3dd2('0x11')]('DashboardItem,\x20%s,\x20%s',_0x3683e8,_0x3dd2('0x13'));_0x5c52e0(_0x287380['result']['message']);}})[_0x3dd2('0x1a')](function(_0x15e667){logger[_0x3dd2('0x17')](_0x3dd2('0x12'),_0x3683e8,_0x15e667);_0x2b8d6c(_0x15e667);});});} \ No newline at end of file +var _0x5558=['catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x2ff88b,_0x559d50){var _0x52bca0=function(_0x395b40){while(--_0x395b40){_0x2ff88b['push'](_0x2ff88b['shift']());}};_0x52bca0(++_0x559d50);}(_0x5558,0xd0));var _0x8555=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5558[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x8555('0x0'));var util=require('util');var moment=require(_0x8555('0x1'));var BPromise=require(_0x8555('0x2'));var rs=require(_0x8555('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8555('0x4'));var logger=require(_0x8555('0x5'))('rpc');var config=require(_0x8555('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8555('0x7')][_0x8555('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8555('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8555('0xa'))(new Redis(config[_0x8555('0x9')]));require(_0x8555('0xb'))['register'](socket);function respondWithRpcPromise(_0x493d6a,_0x51e2c4,_0x35e599){return new BPromise(function(_0x1028f6,_0x5782cc){return client[_0x8555('0xc')](_0x493d6a,_0x35e599)[_0x8555('0xd')](function(_0x4f5233){logger[_0x8555('0xe')](_0x8555('0xf'),_0x51e2c4,'request\x20sent');logger[_0x8555('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x51e2c4,_0x8555('0x11'),JSON[_0x8555('0x12')](_0x4f5233));if(_0x4f5233[_0x8555('0x13')]){if(_0x4f5233[_0x8555('0x13')][_0x8555('0x14')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x51e2c4,_0x4f5233[_0x8555('0x13')]['message']);return _0x5782cc(_0x4f5233['error'][_0x8555('0x15')]);}logger[_0x8555('0x13')](_0x8555('0xf'),_0x51e2c4,_0x4f5233['error']['message']);return _0x1028f6(_0x4f5233['error'][_0x8555('0x15')]);}else{logger[_0x8555('0xe')]('DashboardItem,\x20%s,\x20%s',_0x51e2c4,_0x8555('0x11'));_0x1028f6(_0x4f5233['result'][_0x8555('0x15')]);}})[_0x8555('0x16')](function(_0x5c9e7a){logger[_0x8555('0x13')](_0x8555('0xf'),_0x51e2c4,_0x5c9e7a);_0x5782cc(_0x5c9e7a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3412279..cf5136b 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 _0xa1ae=['dashboardItem:','./dashboardItem.events','remove','removeListener'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xa1ae,0x125));var _0xea1a=function(_0x492ff2,_0x3c6c94){_0x492ff2=_0x492ff2-0x0;var _0x5061fd=_0xa1ae[_0x492ff2];return _0x5061fd;};'use strict';var DashboardItemEvents=require(_0xea1a('0x0'));var events=['save',_0xea1a('0x1'),'update'];function createListener(_0x1a5d8a,_0x998cf3){return function(_0x3b362d){_0x998cf3['emit'](_0x1a5d8a,_0x3b362d);};}function removeListener(_0x2c557d,_0x289903){return function(){DashboardItemEvents[_0xea1a('0x2')](_0x2c557d,_0x289903);};}exports['register']=function(_0x9ac31d){for(var _0x798bf4=0x0,_0x55d642=events['length'];_0x798bf4<_0x55d642;_0x798bf4++){var _0x8f93fa=events[_0x798bf4];var _0x33755c=createListener(_0xea1a('0x3')+_0x8f93fa,_0x9ac31d);DashboardItemEvents['on'](_0x8f93fa,_0x33755c);}}; \ No newline at end of file +var _0x81dd=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x3e3f8b,_0x98ea26){var _0x354e47=function(_0x5a4894){while(--_0x5a4894){_0x3e3f8b['push'](_0x3e3f8b['shift']());}};_0x354e47(++_0x98ea26);}(_0x81dd,0x1c5));var _0xd81d=function(_0x34e3ad,_0x4d0208){_0x34e3ad=_0x34e3ad-0x0;var _0x560b10=_0x81dd[_0x34e3ad];return _0x560b10;};'use strict';var DashboardItemEvents=require(_0xd81d('0x0'));var events=[_0xd81d('0x1'),_0xd81d('0x2'),_0xd81d('0x3')];function createListener(_0x103899,_0x158509){return function(_0x5bac56){_0x158509[_0xd81d('0x4')](_0x103899,_0x5bac56);};}function removeListener(_0x73198c,_0xc58931){return function(){DashboardItemEvents[_0xd81d('0x5')](_0x73198c,_0xc58931);};}exports[_0xd81d('0x6')]=function(_0x2090e5){for(var _0x4df346=0x0,_0x24768e=events[_0xd81d('0x7')];_0x4df346<_0x24768e;_0x4df346++){var _0xb712d7=events[_0x4df346];var _0x48b178=createListener(_0xd81d('0x8')+_0xb712d7,_0x2090e5);DashboardItemEvents['on'](_0xb712d7,_0x48b178);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 74ec9e0..2578564 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 _0xe4f8=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x5040c7,_0x254319){var _0x24f7d4=function(_0x3b5880){while(--_0x3b5880){_0x5040c7['push'](_0x5040c7['shift']());}};_0x24f7d4(++_0x254319);}(_0xe4f8,0xa6));var _0x8e4f=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0xe4f8[_0x36feb2];return _0x292b43;};'use strict';var multer=require(_0x8e4f('0x0'));var util=require('util');var path=require(_0x8e4f('0x1'));var timeout=require(_0x8e4f('0x2'));var express=require(_0x8e4f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e4f('0x4'));var config=require(_0x8e4f('0x5'));var controller=require(_0x8e4f('0x6'));router[_0x8e4f('0x7')](_0x8e4f('0x8'),auth[_0x8e4f('0x9')](),controller[_0x8e4f('0xa')]);router[_0x8e4f('0xb')]('/',auth[_0x8e4f('0x9')](),controller[_0x8e4f('0xc')]);router[_0x8e4f('0xd')](_0x8e4f('0x8'),auth[_0x8e4f('0x9')](),controller[_0x8e4f('0xe')]);router[_0x8e4f('0xf')](_0x8e4f('0x8'),auth['isAuthenticated'](),controller[_0x8e4f('0x10')]);module[_0x8e4f('0x11')]=router; \ No newline at end of file +var _0x7602=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','destroy'];(function(_0x425b10,_0xe4cbbe){var _0x1eecfe=function(_0x2233f1){while(--_0x2233f1){_0x425b10['push'](_0x425b10['shift']());}};_0x1eecfe(++_0xe4cbbe);}(_0x7602,0x12d));var _0x2760=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7602[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require('multer');var util=require(_0x2760('0x0'));var path=require(_0x2760('0x1'));var timeout=require('connect-timeout');var express=require(_0x2760('0x2'));var router=express[_0x2760('0x3')]();var fs_extra=require(_0x2760('0x4'));var auth=require(_0x2760('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2760('0x6'));var controller=require('./dashboardItem.controller');router[_0x2760('0x7')](_0x2760('0x8'),auth[_0x2760('0x9')](),controller['show']);router[_0x2760('0xa')]('/',auth[_0x2760('0x9')](),controller[_0x2760('0xb')]);router[_0x2760('0xc')](_0x2760('0x8'),auth[_0x2760('0x9')](),controller['update']);router['delete'](_0x2760('0x8'),auth[_0x2760('0x9')](),controller[_0x2760('0xd')]);module[_0x2760('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index e74f383..73f09a4 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 _0xe32c=['exports','ENUM','first','second','third','sequelize'];(function(_0x2a4efa,_0x2d84d1){var _0x593399=function(_0x40786e){while(--_0x40786e){_0x2a4efa['push'](_0x2a4efa['shift']());}};_0x593399(++_0x2d84d1);}(_0xe32c,0x14f));var _0xce32=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0xe32c[_0x364b32];return _0x3f3ea0;};'use strict';var Sequelize=require(_0xce32('0x0'));module[_0xce32('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xce32('0x2')](_0xce32('0x3'),_0xce32('0x4'),_0xce32('0x5')),'allowNull':![],'defaultValue':_0xce32('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x52dc=['third','STRING','ENUM','first','second'];(function(_0x1c46cc,_0x3865b0){var _0x3d6591=function(_0xdee3ac){while(--_0xdee3ac){_0x1c46cc['push'](_0x1c46cc['shift']());}};_0x3d6591(++_0x3865b0);}(_0x52dc,0xd8));var _0xc52d=function(_0x1ea7bf,_0x43f577){_0x1ea7bf=_0x1ea7bf-0x0;var _0x58a064=_0x52dc[_0x1ea7bf];return _0x58a064;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc52d('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xc52d('0x1')](_0xc52d('0x2'),_0xc52d('0x3'),_0xc52d('0x4')),'allowNull':![],'defaultValue':_0xc52d('0x2')},'description':{'type':Sequelize[_0xc52d('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 66ecb9a..a4320b0 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 _0xa008=['filter','where','merge','VIRTUAL','include','findAll','catch','keys','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','Dispositions','UserProfileResource','end','error','stack','name','send','map','Disposition','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x31910b,_0x6b7c1c){var _0x7388e6=function(_0x5b1b0b){while(--_0x5b1b0b){_0x31910b['push'](_0x31910b['shift']());}};_0x7388e6(++_0x6b7c1c);}(_0xa008,0x64));var _0x8a00=function(_0x501fa2,_0x3a48e1){_0x501fa2=_0x501fa2-0x0;var _0x377d83=_0xa008[_0x501fa2];return _0x377d83;};'use strict';var emlformat=require(_0x8a00('0x0'));var rimraf=require(_0x8a00('0x1'));var zipdir=require(_0x8a00('0x2'));var jsonpatch=require(_0x8a00('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a00('0x4'));var util=require(_0x8a00('0x5'));var path=require(_0x8a00('0x6'));var sox=require(_0x8a00('0x7'));var csv=require(_0x8a00('0x8'));var ejs=require(_0x8a00('0x9'));var fs=require('fs');var fs_extra=require(_0x8a00('0xa'));var _=require(_0x8a00('0xb'));var squel=require(_0x8a00('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a00('0xd'));var toCsv=require(_0x8a00('0x8'));var querystring=require(_0x8a00('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a00('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a00('0x10'));var logger=require(_0x8a00('0x11'))(_0x8a00('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8a00('0x13'));var db=require(_0x8a00('0x14'))['db'];function respondWithStatusCode(_0x2b472b,_0x16be6b){_0x16be6b=_0x16be6b||0xcc;return function(_0x1b89c1){if(_0x1b89c1){return _0x2b472b[_0x8a00('0x15')](_0x16be6b);}return _0x2b472b[_0x8a00('0x16')](_0x16be6b)['end']();};}function respondWithResult(_0x5b7698,_0x1b96ed){_0x1b96ed=_0x1b96ed||0xc8;return function(_0x3c140a){if(_0x3c140a){return _0x5b7698[_0x8a00('0x16')](_0x1b96ed)[_0x8a00('0x17')](_0x3c140a);}};}function respondWithFilteredResult(_0x170d32,_0x4170e7){return function(_0x6abcb1){if(_0x6abcb1){var _0x42a4bc=typeof _0x4170e7['offset']==='undefined'&&typeof _0x4170e7[_0x8a00('0x18')]===_0x8a00('0x19');var _0x10c0a5=_0x6abcb1[_0x8a00('0x1a')];var _0x49312f=_0x42a4bc?0x0:_0x4170e7[_0x8a00('0x1b')];var _0x372e49=_0x42a4bc?_0x6abcb1[_0x8a00('0x1a')]:_0x4170e7[_0x8a00('0x1b')]+_0x4170e7[_0x8a00('0x18')];var _0xbe41ee;if(_0x372e49>=_0x10c0a5){_0x372e49=_0x10c0a5;_0xbe41ee=0xc8;}else{_0xbe41ee=0xce;}_0x170d32['status'](_0xbe41ee);return _0x170d32[_0x8a00('0x1c')](_0x8a00('0x1d'),_0x49312f+'-'+_0x372e49+'/'+_0x10c0a5)[_0x8a00('0x17')](_0x6abcb1);}return null;};}function patchUpdates(_0x3bf76f){return function(_0x128a63){try{jsonpatch[_0x8a00('0x1e')](_0x128a63,_0x3bf76f,!![]);}catch(_0x5226ca){return BPromise[_0x8a00('0x1f')](_0x5226ca);}return _0x128a63[_0x8a00('0x20')]();};}function saveUpdates(_0x1ed2b8,_0x4f8741){return function(_0xdda14){if(_0xdda14){return _0xdda14['update'](_0x1ed2b8)[_0x8a00('0x21')](function(_0x1decc1){return _0x1decc1;});}return null;};}function removeEntity(_0xb9e0b4,_0x53b9e0){return function(_0x4ff1a7){if(_0x4ff1a7){return _0x4ff1a7[_0x8a00('0x22')]()['then'](function(){var _0xc5073=_0x4ff1a7['get']({'plain':!![]});var _0x4f3ef8=_0x8a00('0x23');return db[_0x8a00('0x24')][_0x8a00('0x22')]({'where':{'type':_0x4f3ef8,'resourceId':_0xc5073['id']}})[_0x8a00('0x21')](function(){return _0x4ff1a7;});})[_0x8a00('0x21')](function(){_0xb9e0b4['status'](0xcc)[_0x8a00('0x25')]();});}};}function handleEntityNotFound(_0x221a55,_0x588a93){return function(_0x5a2834){if(!_0x5a2834){_0x221a55[_0x8a00('0x15')](0x194);}return _0x5a2834;};}function handleError(_0xe080cc,_0x3a5745){_0x3a5745=_0x3a5745||0x1f4;return function(_0x13fb0b){logger[_0x8a00('0x26')](_0x13fb0b[_0x8a00('0x27')]);if(_0x13fb0b[_0x8a00('0x28')]){delete _0x13fb0b['name'];}_0xe080cc['status'](_0x3a5745)[_0x8a00('0x29')](_0x13fb0b);};}exports['index']=function(_0x50a249,_0x31adef){var _0x12500b={},_0x34802d={},_0x4cd081={'count':0x0,'rows':[]};var _0x547ecd=_[_0x8a00('0x2a')](db[_0x8a00('0x2b')][_0x8a00('0x2c')],function(_0x406d65){return{'name':_0x406d65['fieldName'],'type':_0x406d65[_0x8a00('0x2d')]['key']};});_0x34802d['model']=_[_0x8a00('0x2a')](_0x547ecd,_0x8a00('0x28'));_0x34802d[_0x8a00('0x2e')]=_['keys'](_0x50a249[_0x8a00('0x2e')]);_0x34802d['filters']=_[_0x8a00('0x2f')](_0x34802d[_0x8a00('0x30')],_0x34802d['query']);_0x12500b[_0x8a00('0x31')]=_['intersection'](_0x34802d[_0x8a00('0x30')],qs[_0x8a00('0x32')](_0x50a249[_0x8a00('0x2e')][_0x8a00('0x32')]));_0x12500b[_0x8a00('0x31')]=_0x12500b[_0x8a00('0x31')][_0x8a00('0x33')]?_0x12500b[_0x8a00('0x31')]:_0x34802d[_0x8a00('0x30')];if(!_0x50a249[_0x8a00('0x2e')][_0x8a00('0x34')](_0x8a00('0x35'))){_0x12500b[_0x8a00('0x18')]=qs[_0x8a00('0x18')](_0x50a249[_0x8a00('0x2e')][_0x8a00('0x18')]);_0x12500b['offset']=qs[_0x8a00('0x1b')](_0x50a249[_0x8a00('0x2e')][_0x8a00('0x1b')]);}_0x12500b[_0x8a00('0x36')]=qs[_0x8a00('0x37')](_0x50a249['query'][_0x8a00('0x37')]);_0x12500b['where']=qs[_0x8a00('0x38')](_[_0x8a00('0x39')](_0x50a249['query'],_0x34802d[_0x8a00('0x38')]),_0x547ecd);if(_0x50a249[_0x8a00('0x2e')][_0x8a00('0x3a')]){_0x12500b[_0x8a00('0x3b')]=_[_0x8a00('0x3c')](_0x12500b[_0x8a00('0x3b')],{'$or':_['map'](_0x547ecd,function(_0x31bd50){if(_0x31bd50[_0x8a00('0x2d')]!==_0x8a00('0x3d')){var _0x4f0bad={};_0x4f0bad[_0x31bd50[_0x8a00('0x28')]]={'$like':'%'+_0x50a249[_0x8a00('0x2e')]['filter']+'%'};return _0x4f0bad;}})});}_0x12500b=_['merge']({},_0x12500b,_0x50a249['options']);var _0x45561e={'where':_0x12500b['where']};return db[_0x8a00('0x2b')][_0x8a00('0x1a')](_0x45561e)[_0x8a00('0x21')](function(_0x59e106){_0x4cd081[_0x8a00('0x1a')]=_0x59e106;if(_0x50a249[_0x8a00('0x2e')]['includeAll']){_0x12500b[_0x8a00('0x3e')]=[{'all':!![]}];}return db[_0x8a00('0x2b')][_0x8a00('0x3f')](_0x12500b);})[_0x8a00('0x21')](function(_0x23738c){_0x4cd081['rows']=_0x23738c;return _0x4cd081;})[_0x8a00('0x21')](respondWithFilteredResult(_0x31adef,_0x12500b))[_0x8a00('0x40')](handleError(_0x31adef,null));};exports['show']=function(_0x1d6b15,_0x4da341){var _0xe34146={'raw':!![],'where':{'id':_0x1d6b15['params']['id']}},_0x1c8dd4={};_0x1c8dd4[_0x8a00('0x30')]=_[_0x8a00('0x41')](db[_0x8a00('0x2b')][_0x8a00('0x2c')]);_0x1c8dd4[_0x8a00('0x2e')]=_['keys'](_0x1d6b15['query']);_0x1c8dd4['filters']=_['intersection'](_0x1c8dd4[_0x8a00('0x30')],_0x1c8dd4[_0x8a00('0x2e')]);_0xe34146['attributes']=_[_0x8a00('0x2f')](_0x1c8dd4[_0x8a00('0x30')],qs['fields'](_0x1d6b15[_0x8a00('0x2e')][_0x8a00('0x32')]));_0xe34146[_0x8a00('0x31')]=_0xe34146[_0x8a00('0x31')]['length']?_0xe34146[_0x8a00('0x31')]:_0x1c8dd4[_0x8a00('0x30')];if(_0x1d6b15[_0x8a00('0x2e')]['includeAll']){_0xe34146[_0x8a00('0x3e')]=[{'all':!![]}];}_0xe34146=_['merge']({},_0xe34146,_0x1d6b15[_0x8a00('0x42')]);return db[_0x8a00('0x2b')][_0x8a00('0x43')](_0xe34146)[_0x8a00('0x21')](handleEntityNotFound(_0x4da341,null))['then'](respondWithResult(_0x4da341,null))['catch'](handleError(_0x4da341,null));};exports[_0x8a00('0x44')]=function(_0x2158f2,_0x4c5840){return db[_0x8a00('0x2b')][_0x8a00('0x44')](_0x2158f2[_0x8a00('0x45')],{})[_0x8a00('0x21')](function(_0x1d2639){var _0x338058=_0x2158f2['user'][_0x8a00('0x46')]({'plain':!![]});if(!_0x338058)throw new Error(_0x8a00('0x47'));if(_0x338058[_0x8a00('0x48')]==='user'){var _0x3b5bdd=_0x1d2639[_0x8a00('0x46')]({'plain':!![]});var _0x32d727='Dispositions';return db[_0x8a00('0x49')][_0x8a00('0x43')]({'where':{'name':_0x32d727,'userProfileId':_0x338058[_0x8a00('0x4a')]},'raw':!![]})[_0x8a00('0x21')](function(_0xf52d6d){if(_0xf52d6d&&_0xf52d6d[_0x8a00('0x4b')]===0x0){return db['UserProfileResource'][_0x8a00('0x44')]({'name':_0x3b5bdd[_0x8a00('0x28')],'resourceId':_0x3b5bdd['id'],'type':_0xf52d6d[_0x8a00('0x28')],'sectionId':_0xf52d6d['id']},{})['then'](function(){return _0x1d2639;});}else{return _0x1d2639;}})[_0x8a00('0x40')](function(_0x27f575){logger['error'](_0x8a00('0x4c'),_0x27f575);throw _0x27f575;});}return _0x1d2639;})[_0x8a00('0x21')](respondWithResult(_0x4c5840,0xc9))[_0x8a00('0x40')](handleError(_0x4c5840,null));};exports[_0x8a00('0x4d')]=function(_0x4b775c,_0x2e1d5c){if(_0x4b775c['body']['id']){delete _0x4b775c[_0x8a00('0x45')]['id'];}return db[_0x8a00('0x2b')][_0x8a00('0x43')]({'where':{'id':_0x4b775c['params']['id']}})[_0x8a00('0x21')](handleEntityNotFound(_0x2e1d5c,null))[_0x8a00('0x21')](saveUpdates(_0x4b775c['body'],null))[_0x8a00('0x21')](respondWithResult(_0x2e1d5c,null))[_0x8a00('0x40')](handleError(_0x2e1d5c,null));};exports[_0x8a00('0x22')]=function(_0x2bf8fa,_0x25c87d){return db['Disposition'][_0x8a00('0x43')]({'where':{'id':_0x2bf8fa[_0x8a00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x25c87d,null))[_0x8a00('0x21')](removeEntity(_0x25c87d,null))['catch'](handleError(_0x25c87d,null));}; \ No newline at end of file +var _0xfb51=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys'];(function(_0x2c1ee4,_0x2f8c89){var _0x1be996=function(_0x5e8af4){while(--_0x5e8af4){_0x2c1ee4['push'](_0x2c1ee4['shift']());}};_0x1be996(++_0x2f8c89);}(_0xfb51,0x1b5));var _0x1fb5=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0xfb51[_0x4dbdda];return _0x1acbf1;};'use strict';var emlformat=require(_0x1fb5('0x0'));var rimraf=require(_0x1fb5('0x1'));var zipdir=require(_0x1fb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fb5('0x3'));var moment=require(_0x1fb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fb5('0x5'));var util=require(_0x1fb5('0x6'));var path=require(_0x1fb5('0x7'));var sox=require(_0x1fb5('0x8'));var csv=require(_0x1fb5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fb5('0xa'));var _=require(_0x1fb5('0xb'));var squel=require(_0x1fb5('0xc'));var crypto=require(_0x1fb5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fb5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1fb5('0xf'));var Papa=require(_0x1fb5('0x10'));var Redis=require(_0x1fb5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1fb5('0x12'));var as=require(_0x1fb5('0x13'));var hardwareService=require(_0x1fb5('0x14'));var logger=require('../../config/logger')(_0x1fb5('0x15'));var utils=require(_0x1fb5('0x16'));var config=require(_0x1fb5('0x17'));var licenseUtil=require(_0x1fb5('0x18'));var db=require(_0x1fb5('0x19'))['db'];function respondWithStatusCode(_0x3c2d85,_0x28cbfa){_0x28cbfa=_0x28cbfa||0xcc;return function(_0x1b0d95){if(_0x1b0d95){return _0x3c2d85[_0x1fb5('0x1a')](_0x28cbfa);}return _0x3c2d85[_0x1fb5('0x1b')](_0x28cbfa)[_0x1fb5('0x1c')]();};}function respondWithResult(_0x136a31,_0x4b9ba6){_0x4b9ba6=_0x4b9ba6||0xc8;return function(_0x5c3572){if(_0x5c3572){return _0x136a31[_0x1fb5('0x1b')](_0x4b9ba6)['json'](_0x5c3572);}};}function respondWithFilteredResult(_0x8f3562,_0x4337e){return function(_0x21deed){if(_0x21deed){var _0x42ad30=typeof _0x4337e[_0x1fb5('0x1d')]===_0x1fb5('0x1e')&&typeof _0x4337e['limit']===_0x1fb5('0x1e');var _0x3680a6=_0x21deed[_0x1fb5('0x1f')];var _0x17a408=_0x42ad30?0x0:_0x4337e[_0x1fb5('0x1d')];var _0x1f8d1d=_0x42ad30?_0x21deed['count']:_0x4337e[_0x1fb5('0x1d')]+_0x4337e[_0x1fb5('0x20')];var _0x57c26e;if(_0x1f8d1d>=_0x3680a6){_0x1f8d1d=_0x3680a6;_0x57c26e=0xc8;}else{_0x57c26e=0xce;}_0x8f3562[_0x1fb5('0x1b')](_0x57c26e);return _0x8f3562[_0x1fb5('0x21')](_0x1fb5('0x22'),_0x17a408+'-'+_0x1f8d1d+'/'+_0x3680a6)[_0x1fb5('0x23')](_0x21deed);}return null;};}function patchUpdates(_0x40ea88){return function(_0x59be83){try{jsonpatch[_0x1fb5('0x24')](_0x59be83,_0x40ea88,!![]);}catch(_0x4a18b4){return BPromise['reject'](_0x4a18b4);}return _0x59be83[_0x1fb5('0x25')]();};}function saveUpdates(_0x6aa83e,_0x15c7ad){return function(_0x393374){if(_0x393374){return _0x393374['update'](_0x6aa83e)[_0x1fb5('0x26')](function(_0xcee693){return _0xcee693;});}return null;};}function removeEntity(_0x264468,_0x215f9d){return function(_0x39440e){if(_0x39440e){return _0x39440e[_0x1fb5('0x27')]()[_0x1fb5('0x26')](function(){var _0x49e1ec=_0x39440e[_0x1fb5('0x28')]({'plain':!![]});var _0x123805=_0x1fb5('0x29');return db[_0x1fb5('0x2a')][_0x1fb5('0x27')]({'where':{'type':_0x123805,'resourceId':_0x49e1ec['id']}})[_0x1fb5('0x26')](function(){return _0x39440e;});})[_0x1fb5('0x26')](function(){_0x264468[_0x1fb5('0x1b')](0xcc)[_0x1fb5('0x1c')]();});}};}function handleEntityNotFound(_0x46cf7e,_0x175326){return function(_0x553705){if(!_0x553705){_0x46cf7e['sendStatus'](0x194);}return _0x553705;};}function handleError(_0x2292eb,_0x3f02d3){_0x3f02d3=_0x3f02d3||0x1f4;return function(_0x5d9b8d){logger['error'](_0x5d9b8d[_0x1fb5('0x2b')]);if(_0x5d9b8d[_0x1fb5('0x2c')]){delete _0x5d9b8d[_0x1fb5('0x2c')];}_0x2292eb[_0x1fb5('0x1b')](_0x3f02d3)[_0x1fb5('0x2d')](_0x5d9b8d);};}exports[_0x1fb5('0x2e')]=function(_0x5e31f4,_0x239200){var _0x4c7adf={},_0x5da38b={},_0x196b2c={'count':0x0,'rows':[]};var _0x49f459=_[_0x1fb5('0x2f')](db[_0x1fb5('0x30')][_0x1fb5('0x31')],function(_0x3afc74){return{'name':_0x3afc74[_0x1fb5('0x32')],'type':_0x3afc74['type'][_0x1fb5('0x33')]};});_0x5da38b[_0x1fb5('0x34')]=_['map'](_0x49f459,_0x1fb5('0x2c'));_0x5da38b[_0x1fb5('0x35')]=_[_0x1fb5('0x36')](_0x5e31f4[_0x1fb5('0x35')]);_0x5da38b[_0x1fb5('0x37')]=_[_0x1fb5('0x38')](_0x5da38b['model'],_0x5da38b[_0x1fb5('0x35')]);_0x4c7adf['attributes']=_[_0x1fb5('0x38')](_0x5da38b['model'],qs[_0x1fb5('0x39')](_0x5e31f4[_0x1fb5('0x35')][_0x1fb5('0x39')]));_0x4c7adf[_0x1fb5('0x3a')]=_0x4c7adf[_0x1fb5('0x3a')][_0x1fb5('0x3b')]?_0x4c7adf['attributes']:_0x5da38b[_0x1fb5('0x34')];if(!_0x5e31f4[_0x1fb5('0x35')][_0x1fb5('0x3c')](_0x1fb5('0x3d'))){_0x4c7adf['limit']=qs['limit'](_0x5e31f4[_0x1fb5('0x35')][_0x1fb5('0x20')]);_0x4c7adf[_0x1fb5('0x1d')]=qs[_0x1fb5('0x1d')](_0x5e31f4['query'][_0x1fb5('0x1d')]);}_0x4c7adf['order']=qs[_0x1fb5('0x3e')](_0x5e31f4['query'][_0x1fb5('0x3e')]);_0x4c7adf[_0x1fb5('0x3f')]=qs[_0x1fb5('0x37')](_[_0x1fb5('0x40')](_0x5e31f4['query'],_0x5da38b[_0x1fb5('0x37')]),_0x49f459);if(_0x5e31f4['query']['filter']){_0x4c7adf['where']=_[_0x1fb5('0x41')](_0x4c7adf[_0x1fb5('0x3f')],{'$or':_[_0x1fb5('0x2f')](_0x49f459,function(_0x19f0a7){if(_0x19f0a7[_0x1fb5('0x42')]!==_0x1fb5('0x43')){var _0x328af5={};_0x328af5[_0x19f0a7[_0x1fb5('0x2c')]]={'$like':'%'+_0x5e31f4[_0x1fb5('0x35')][_0x1fb5('0x44')]+'%'};return _0x328af5;}})});}_0x4c7adf=_[_0x1fb5('0x41')]({},_0x4c7adf,_0x5e31f4[_0x1fb5('0x45')]);var _0x31db89={'where':_0x4c7adf[_0x1fb5('0x3f')]};return db[_0x1fb5('0x30')][_0x1fb5('0x1f')](_0x31db89)[_0x1fb5('0x26')](function(_0x1a78a3){_0x196b2c['count']=_0x1a78a3;if(_0x5e31f4[_0x1fb5('0x35')][_0x1fb5('0x46')]){_0x4c7adf[_0x1fb5('0x47')]=[{'all':!![]}];}return db[_0x1fb5('0x30')]['findAll'](_0x4c7adf);})[_0x1fb5('0x26')](function(_0x140046){_0x196b2c['rows']=_0x140046;return _0x196b2c;})[_0x1fb5('0x26')](respondWithFilteredResult(_0x239200,_0x4c7adf))[_0x1fb5('0x48')](handleError(_0x239200,null));};exports[_0x1fb5('0x49')]=function(_0x6463c9,_0x50206a){var _0x49a72a={'raw':!![],'where':{'id':_0x6463c9['params']['id']}},_0x414d89={};_0x414d89[_0x1fb5('0x34')]=_['keys'](db[_0x1fb5('0x30')]['rawAttributes']);_0x414d89[_0x1fb5('0x35')]=_[_0x1fb5('0x36')](_0x6463c9['query']);_0x414d89['filters']=_[_0x1fb5('0x38')](_0x414d89[_0x1fb5('0x34')],_0x414d89[_0x1fb5('0x35')]);_0x49a72a[_0x1fb5('0x3a')]=_['intersection'](_0x414d89[_0x1fb5('0x34')],qs[_0x1fb5('0x39')](_0x6463c9['query'][_0x1fb5('0x39')]));_0x49a72a['attributes']=_0x49a72a[_0x1fb5('0x3a')][_0x1fb5('0x3b')]?_0x49a72a[_0x1fb5('0x3a')]:_0x414d89[_0x1fb5('0x34')];if(_0x6463c9[_0x1fb5('0x35')][_0x1fb5('0x46')]){_0x49a72a['include']=[{'all':!![]}];}_0x49a72a=_[_0x1fb5('0x41')]({},_0x49a72a,_0x6463c9['options']);return db[_0x1fb5('0x30')]['find'](_0x49a72a)[_0x1fb5('0x26')](handleEntityNotFound(_0x50206a,null))[_0x1fb5('0x26')](respondWithResult(_0x50206a,null))[_0x1fb5('0x48')](handleError(_0x50206a,null));};exports[_0x1fb5('0x4a')]=function(_0x2eb171,_0x245ad3){return db['Disposition']['create'](_0x2eb171[_0x1fb5('0x4b')],{})[_0x1fb5('0x26')](function(_0x2f7656){var _0x3fe929=_0x2eb171['user'][_0x1fb5('0x28')]({'plain':!![]});if(!_0x3fe929)throw new Error(_0x1fb5('0x4c'));if(_0x3fe929['role']===_0x1fb5('0x4d')){var _0x10a53f=_0x2f7656[_0x1fb5('0x28')]({'plain':!![]});var _0x56a15=_0x1fb5('0x29');return db['UserProfileSection'][_0x1fb5('0x4e')]({'where':{'name':_0x56a15,'userProfileId':_0x3fe929[_0x1fb5('0x4f')]},'raw':!![]})[_0x1fb5('0x26')](function(_0x26be56){if(_0x26be56&&_0x26be56[_0x1fb5('0x50')]===0x0){return db['UserProfileResource'][_0x1fb5('0x4a')]({'name':_0x10a53f[_0x1fb5('0x2c')],'resourceId':_0x10a53f['id'],'type':_0x26be56[_0x1fb5('0x2c')],'sectionId':_0x26be56['id']},{})[_0x1fb5('0x26')](function(){return _0x2f7656;});}else{return _0x2f7656;}})['catch'](function(_0x2da74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2da74);throw _0x2da74;});}return _0x2f7656;})[_0x1fb5('0x26')](respondWithResult(_0x245ad3,0xc9))[_0x1fb5('0x48')](handleError(_0x245ad3,null));};exports['update']=function(_0x175ff0,_0x235af9){if(_0x175ff0[_0x1fb5('0x4b')]['id']){delete _0x175ff0[_0x1fb5('0x4b')]['id'];}return db[_0x1fb5('0x30')][_0x1fb5('0x4e')]({'where':{'id':_0x175ff0[_0x1fb5('0x51')]['id']}})[_0x1fb5('0x26')](handleEntityNotFound(_0x235af9,null))[_0x1fb5('0x26')](saveUpdates(_0x175ff0[_0x1fb5('0x4b')],null))[_0x1fb5('0x26')](respondWithResult(_0x235af9,null))['catch'](handleError(_0x235af9,null));};exports[_0x1fb5('0x27')]=function(_0x49453d,_0xa1518f){return db[_0x1fb5('0x30')]['find']({'where':{'id':_0x49453d[_0x1fb5('0x51')]['id']}})[_0x1fb5('0x26')](handleEntityNotFound(_0xa1518f,null))[_0x1fb5('0x26')](removeEntity(_0xa1518f,null))[_0x1fb5('0x48')](handleError(_0xa1518f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 45d1d61..a569529 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 _0x2823=['name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','Disposition','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0xdb3151,_0x527339){var _0x47c776=function(_0x79fd16){while(--_0x79fd16){_0xdb3151['push'](_0xdb3151['shift']());}};_0x47c776(++_0x527339);}(_0x2823,0x10d));var _0x3282=function(_0x3329ad,_0xd546e3){_0x3329ad=_0x3329ad-0x0;var _0x654c1b=_0x2823[_0x3329ad];return _0x654c1b;};'use strict';var _=require(_0x3282('0x0'));var util=require(_0x3282('0x1'));var logger=require(_0x3282('0x2'))(_0x3282('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3282('0x4'));var fs=require('fs');var path=require(_0x3282('0x5'));var rimraf=require(_0x3282('0x6'));var config=require(_0x3282('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x2f5f5b,_0x25f52a){return _0x2f5f5b[_0x3282('0x8')](_0x3282('0x9'),attributes,{'tableName':_0x3282('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3282('0xb'),'fields':[_0x3282('0xc'),'ListId']},{'unique':!![],'name':_0x3282('0xd'),'fields':[_0x3282('0xc'),_0x3282('0xe')]},{'unique':!![],'name':_0x3282('0xf'),'fields':['name',_0x3282('0x10')]},{'unique':!![],'name':_0x3282('0x11'),'fields':[_0x3282('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x3282('0x12'),'fields':[_0x3282('0xc'),_0x3282('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0x3282('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x3282('0x14'),'fields':['name',_0x3282('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3942=['exports','define','Disposition','name_voice','ListId','name_chat','name','MailAccountId','name_sms','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x47b02c,_0x50efcf){var _0x1526e3=function(_0x1692b2){while(--_0x1692b2){_0x47b02c['push'](_0x47b02c['shift']());}};_0x1526e3(++_0x50efcf);}(_0x3942,0x1c5));var _0x2394=function(_0x1bb003,_0x521704){_0x1bb003=_0x1bb003-0x0;var _0x12e006=_0x3942[_0x1bb003];return _0x12e006;};'use strict';var _=require('lodash');var util=require(_0x2394('0x0'));var logger=require(_0x2394('0x1'))(_0x2394('0x2'));var moment=require(_0x2394('0x3'));var BPromise=require(_0x2394('0x4'));var rp=require(_0x2394('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2394('0x6'));var attributes=require('./disposition.attributes');module[_0x2394('0x7')]=function(_0x27f7c2,_0x580466){return _0x27f7c2[_0x2394('0x8')](_0x2394('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x2394('0xa'),'fields':['name',_0x2394('0xb')]},{'unique':!![],'name':_0x2394('0xc'),'fields':[_0x2394('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x2394('0xd'),_0x2394('0xe')]},{'unique':!![],'name':_0x2394('0xf'),'fields':[_0x2394('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x2394('0xd'),_0x2394('0x10')]},{'unique':!![],'name':_0x2394('0x11'),'fields':[_0x2394('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x2394('0x12'),'fields':['name',_0x2394('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9aad66c..f2a9f0a 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(_0x1683f1,_0x810a0f){var _0x49480b=function(_0x2639c4){while(--_0x2639c4){_0x1683f1['push'](_0x1683f1['shift']());}};_0x49480b(++_0x810a0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x3b8f8c,_0x222838){var _0x33eea0=function(_0xe8c4a1){while(--_0xe8c4a1){_0x3b8f8c['push'](_0x3b8f8c['shift']());}};_0x33eea0(++_0x222838);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 84c7142..6e23264 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 _0xc0c5=['index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x408f34,_0x1eb189){var _0x3c25c9=function(_0x3d481e){while(--_0x3d481e){_0x408f34['push'](_0x408f34['shift']());}};_0x3c25c9(++_0x1eb189);}(_0xc0c5,0xa0));var _0x5c0c=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xc0c5[_0x593752];return _0x4612be;};'use strict';var multer=require(_0x5c0c('0x0'));var util=require(_0x5c0c('0x1'));var path=require(_0x5c0c('0x2'));var timeout=require(_0x5c0c('0x3'));var express=require(_0x5c0c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5c0c('0x5'));var interaction=require(_0x5c0c('0x6'));var config=require(_0x5c0c('0x7'));var controller=require(_0x5c0c('0x8'));router[_0x5c0c('0x9')]('/',auth[_0x5c0c('0xa')](),controller[_0x5c0c('0xb')]);router[_0x5c0c('0x9')](_0x5c0c('0xc'),auth[_0x5c0c('0xa')](),controller[_0x5c0c('0xd')]);router[_0x5c0c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c0c('0xf')]('/:id',auth[_0x5c0c('0xa')](),controller['update']);router[_0x5c0c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5c0c('0x11')]);module[_0x5c0c('0x12')]=router; \ No newline at end of file +var _0x3bff=['../../components/interaction/service','../../config/environment','./disposition.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x55f95a,_0x28c042){var _0x13e20f=function(_0x25bddc){while(--_0x25bddc){_0x55f95a['push'](_0x55f95a['shift']());}};_0x13e20f(++_0x28c042);}(_0x3bff,0xb8));var _0xf3bf=function(_0x3819c3,_0x4c5e9a){_0x3819c3=_0x3819c3-0x0;var _0x1ce0f5=_0x3bff[_0x3819c3];return _0x1ce0f5;};'use strict';var multer=require(_0xf3bf('0x0'));var util=require(_0xf3bf('0x1'));var path=require(_0xf3bf('0x2'));var timeout=require(_0xf3bf('0x3'));var express=require(_0xf3bf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf3bf('0x5'));var interaction=require(_0xf3bf('0x6'));var config=require(_0xf3bf('0x7'));var controller=require(_0xf3bf('0x8'));router[_0xf3bf('0x9')]('/',auth['isAuthenticated'](),controller[_0xf3bf('0xa')]);router[_0xf3bf('0x9')]('/:id',auth[_0xf3bf('0xb')](),controller[_0xf3bf('0xc')]);router[_0xf3bf('0xd')]('/',auth['isAuthenticated'](),controller[_0xf3bf('0xe')]);router['put'](_0xf3bf('0xf'),auth['isAuthenticated'](),controller[_0xf3bf('0x10')]);router[_0xf3bf('0x11')](_0xf3bf('0xf'),auth[_0xf3bf('0xb')](),controller[_0xf3bf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 7efbad7..1711c80 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 _0xe4a0=['2400','4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM'];(function(_0x38a547,_0x22c39d){var _0x1d7eb8=function(_0x381715){while(--_0x381715){_0x38a547['push'](_0x38a547['shift']());}};_0x1d7eb8(++_0x22c39d);}(_0xe4a0,0x19a));var _0x0e4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe4a0[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x0e4a('0x0'));module[_0x0e4a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0e4a('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x0e4a('0x3'),'no'),'defaultValue':_0x0e4a('0x3')},'headerinfo':{'type':Sequelize[_0x0e4a('0x2')],'defaultValue':_0x0e4a('0x4')},'localstationid':{'type':Sequelize[_0x0e4a('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x0e4a('0x5')](_0x0e4a('0x6'),_0x0e4a('0x7'),_0x0e4a('0x8'),'9600',_0x0e4a('0x9'),_0x0e4a('0xa')),'defaultValue':_0x0e4a('0x7')},'maxrate':{'type':Sequelize[_0x0e4a('0x5')]('2400',_0x0e4a('0x7'),_0x0e4a('0x8'),_0x0e4a('0xb'),'12000',_0x0e4a('0xa')),'defaultValue':_0x0e4a('0xa')},'modem':{'type':Sequelize[_0x0e4a('0x2')],'defaultValue':_0x0e4a('0xc')},'gateway':{'type':Sequelize[_0x0e4a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0e4a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0e4a('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x0e4a('0xe'),_0x0e4a('0xf'),_0x0e4a('0x10'),_0x0e4a('0x11')),'defaultValue':_0x0e4a('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0e4a('0x12')],'defaultValue':function(){return _0x0e4a('0x13');}},'notificationSound':{'type':Sequelize[_0x0e4a('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0e4a('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0e4a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0e4a('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0e4a('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0e4a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0e4a('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x0e4a('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x0e4a('0x14')],'defaultValue':![],'comment':_0x0e4a('0x16'),'set':function(_0x288fc0){if(!_0x288fc0)this[_0x0e4a('0x17')](_0x0e4a('0x18'),null);this[_0x0e4a('0x17')](_0x0e4a('0x19'),_0x288fc0);}}}; \ No newline at end of file +var _0x4062=['INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','yes','localstationid','ENUM','2400','4800','7200','9600','12000','v17,v27,v29'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0x4062,0x1ae));var _0x2406=function(_0x42dec8,_0x12ff07){_0x42dec8=_0x42dec8-0x0;var _0x4f1820=_0x4062[_0x42dec8];return _0x4f1820;};'use strict';var Sequelize=require('sequelize');module[_0x2406('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2406('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x2406('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x2406('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x2406('0x1')],'unique':_0x2406('0x3')},'minrate':{'type':Sequelize[_0x2406('0x4')](_0x2406('0x5'),_0x2406('0x6'),_0x2406('0x7'),_0x2406('0x8'),_0x2406('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x2406('0x4')](_0x2406('0x5'),'4800',_0x2406('0x7'),_0x2406('0x8'),'12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x2406('0x1')],'defaultValue':_0x2406('0xa')},'gateway':{'type':Sequelize[_0x2406('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2406('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2406('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2406('0x4')](_0x2406('0xc'),_0x2406('0xd'),_0x2406('0xe'),_0x2406('0xf')),'defaultValue':_0x2406('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2406('0x10')],'defaultValue':function(){return _0x2406('0x11');}},'notificationSound':{'type':Sequelize[_0x2406('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2406('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2406('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2406('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2406('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2406('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2406('0x12')],'defaultValue':![],'comment':_0x2406('0x13'),'set':function(_0x59ee1a){if(!_0x59ee1a)this['setDataValue'](_0x2406('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x59ee1a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index a3bdcc4..ed1dcfa 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 _0x36cc=['FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','findOne','nolimit','findAll','rows','ids','addAnswer','CannedAnswer','order','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Owner','fullname','internal','Tags','tag','transaction','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updatedAt','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','Messages','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','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/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','info'];(function(_0x51a620,_0x12c3f9){var _0x49a826=function(_0x3f31d9){while(--_0x3f31d9){_0x51a620['push'](_0x51a620['shift']());}};_0x49a826(++_0x12c3f9);}(_0x36cc,0x9f));var _0xc36c=function(_0x50644c,_0x2e3e31){_0x50644c=_0x50644c-0x0;var _0x496769=_0x36cc[_0x50644c];return _0x496769;};'use strict';var emlformat=require(_0xc36c('0x0'));var rimraf=require(_0xc36c('0x1'));var zipdir=require(_0xc36c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc36c('0x3'));var moment=require(_0xc36c('0x4'));var BPromise=require(_0xc36c('0x5'));var Mustache=require(_0xc36c('0x6'));var util=require(_0xc36c('0x7'));var path=require(_0xc36c('0x8'));var sox=require(_0xc36c('0x9'));var csv=require(_0xc36c('0xa'));var ejs=require(_0xc36c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc36c('0xc'));var squel=require(_0xc36c('0xd'));var crypto=require(_0xc36c('0xe'));var jsforce=require(_0xc36c('0xf'));var deskjs=require(_0xc36c('0x10'));var toCsv=require(_0xc36c('0xa'));var querystring=require(_0xc36c('0x11'));var Papa=require(_0xc36c('0x12'));var Redis=require(_0xc36c('0x13'));var authService=require(_0xc36c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc36c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc36c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc36c('0x17'));var licenseUtil=require(_0xc36c('0x18'));var db=require(_0xc36c('0x19'))['db'];config[_0xc36c('0x1a')]=_['defaults'](config[_0xc36c('0x1a')],{'host':_0xc36c('0x1b'),'port':0x18eb});var socket=require(_0xc36c('0x1c'))(new Redis(config[_0xc36c('0x1a')]));require(_0xc36c('0x1d'))[_0xc36c('0x1e')](socket);var jayson=require(_0xc36c('0x1f'));var client=jayson['client'][_0xc36c('0x20')]({'port':0x232c});var client9002=jayson[_0xc36c('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7b32c4,_0x54c6e4,_0x32f21b,_0xb1975a){return new BPromise(function(_0x48da7c,_0x28efaa){var _0x4b7a9a=_0xb1975a||client;return _0x4b7a9a[_0xc36c('0x22')](_0x7b32c4,_0x32f21b)[_0xc36c('0x23')](function(_0x535a3a){logger[_0xc36c('0x24')](_0xc36c('0x25'),_0x54c6e4,'request\x20sent');logger[_0xc36c('0x26')](_0xc36c('0x27'),_0x54c6e4,_0xc36c('0x28'),JSON[_0xc36c('0x29')](_0x535a3a));if(_0x535a3a[_0xc36c('0x2a')]){if(_0x535a3a[_0xc36c('0x2a')][_0xc36c('0x2b')]===0x1f4){logger[_0xc36c('0x2a')](_0xc36c('0x25'),_0x54c6e4,_0x535a3a[_0xc36c('0x2a')]['message']);return _0x28efaa(_0x535a3a['error']['message']);}logger[_0xc36c('0x2a')](_0xc36c('0x25'),_0x54c6e4,_0x535a3a[_0xc36c('0x2a')][_0xc36c('0x2c')]);return _0x48da7c(_0x535a3a[_0xc36c('0x2a')][_0xc36c('0x2c')]);}else{logger[_0xc36c('0x24')](_0xc36c('0x25'),_0x54c6e4,_0xc36c('0x28'));_0x48da7c(_0x535a3a[_0xc36c('0x2d')][_0xc36c('0x2c')]);}})[_0xc36c('0x2e')](function(_0x5640ae){logger['error']('FaxAccount,\x20%s,\x20%s',_0x54c6e4,_0x5640ae);_0x28efaa(_0x5640ae);});});}function respondWithStatusCode(_0x35b227,_0x18d65d){_0x18d65d=_0x18d65d||0xcc;return function(_0x14362e){if(_0x14362e){return _0x35b227['sendStatus'](_0x18d65d);}return _0x35b227[_0xc36c('0x2f')](_0x18d65d)[_0xc36c('0x30')]();};}function respondWithResult(_0x579495,_0x4aae74){_0x4aae74=_0x4aae74||0xc8;return function(_0x41e463){if(_0x41e463){return _0x579495[_0xc36c('0x2f')](_0x4aae74)['json'](_0x41e463);}};}function respondWithFilteredResult(_0x4229b1,_0x306de8){return function(_0x4f4b0f){if(_0x4f4b0f){var _0x23b82b=typeof _0x306de8['offset']==='undefined'&&typeof _0x306de8[_0xc36c('0x31')]==='undefined';var _0x4ad2d0=_0x4f4b0f[_0xc36c('0x32')];var _0x177f1d=_0x23b82b?0x0:_0x306de8['offset'];var _0x2f6ead=_0x23b82b?_0x4f4b0f['count']:_0x306de8[_0xc36c('0x33')]+_0x306de8[_0xc36c('0x31')];var _0x271be0;if(_0x2f6ead>=_0x4ad2d0){_0x2f6ead=_0x4ad2d0;_0x271be0=0xc8;}else{_0x271be0=0xce;}_0x4229b1[_0xc36c('0x2f')](_0x271be0);return _0x4229b1[_0xc36c('0x34')](_0xc36c('0x35'),_0x177f1d+'-'+_0x2f6ead+'/'+_0x4ad2d0)[_0xc36c('0x36')](_0x4f4b0f);}return null;};}function patchUpdates(_0x5bc648){return function(_0x2a6e3f){try{jsonpatch[_0xc36c('0x37')](_0x2a6e3f,_0x5bc648,!![]);}catch(_0x4a9e81){return BPromise[_0xc36c('0x38')](_0x4a9e81);}return _0x2a6e3f[_0xc36c('0x39')]();};}function saveUpdates(_0x1a25d6,_0x2a3f30){return function(_0x2c80d1){if(_0x2c80d1){return _0x2c80d1[_0xc36c('0x3a')](_0x1a25d6)[_0xc36c('0x23')](function(_0xcafdcf){return _0xcafdcf;});}return null;};}function removeEntity(_0x35f45a,_0x3719c6){return function(_0x5732ab){if(_0x5732ab){return _0x5732ab[_0xc36c('0x3b')]()[_0xc36c('0x23')](function(){var _0x2cddde=_0x5732ab[_0xc36c('0x3c')]({'plain':!![]});var _0x20ad3f=_0xc36c('0x3d');return db[_0xc36c('0x3e')][_0xc36c('0x3b')]({'where':{'type':_0x20ad3f,'resourceId':_0x2cddde['id']}})[_0xc36c('0x23')](function(){return _0x5732ab;});})[_0xc36c('0x23')](function(){_0x35f45a[_0xc36c('0x2f')](0xcc)[_0xc36c('0x30')]();});}};}function handleEntityNotFound(_0x31784a,_0x295695){return function(_0x20390e){if(!_0x20390e){_0x31784a[_0xc36c('0x3f')](0x194);}return _0x20390e;};}function handleError(_0x40a9bf,_0x54bfeb){_0x54bfeb=_0x54bfeb||0x1f4;return function(_0xeadcc5){logger[_0xc36c('0x2a')](_0xeadcc5[_0xc36c('0x40')]);if(_0xeadcc5['name']){delete _0xeadcc5[_0xc36c('0x41')];}_0x40a9bf[_0xc36c('0x2f')](_0x54bfeb)[_0xc36c('0x42')](_0xeadcc5);};}exports['index']=function(_0x1679c8,_0x28de9d){var _0x37046c={'include':[{'model':db[_0xc36c('0x43')],'as':_0xc36c('0x44')}]},_0x15adf8={},_0x2eaa71={'count':0x0,'rows':[]};var _0x5e6b75=_[_0xc36c('0x45')](db[_0xc36c('0x46')][_0xc36c('0x47')],function(_0xb2db00){return{'name':_0xb2db00[_0xc36c('0x48')],'type':_0xb2db00[_0xc36c('0x49')][_0xc36c('0x4a')]};});_0x15adf8[_0xc36c('0x4b')]=_['map'](_0x5e6b75,'name');_0x15adf8[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x1679c8['query']);_0x15adf8[_0xc36c('0x4e')]=_[_0xc36c('0x4f')](_0x15adf8[_0xc36c('0x4b')],_0x15adf8[_0xc36c('0x4c')]);_0x37046c[_0xc36c('0x50')]=_['intersection'](_0x15adf8[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x1679c8[_0xc36c('0x4c')]['fields']));_0x37046c[_0xc36c('0x50')]=_0x37046c[_0xc36c('0x50')][_0xc36c('0x52')]?_0x37046c[_0xc36c('0x50')]:_0x15adf8[_0xc36c('0x4b')];if(!_0x1679c8[_0xc36c('0x4c')][_0xc36c('0x53')]('nolimit')){_0x37046c[_0xc36c('0x31')]=qs[_0xc36c('0x31')](_0x1679c8[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x37046c[_0xc36c('0x33')]=qs[_0xc36c('0x33')](_0x1679c8['query'][_0xc36c('0x33')]);}_0x37046c['order']=qs[_0xc36c('0x54')](_0x1679c8['query'][_0xc36c('0x54')]);_0x37046c[_0xc36c('0x55')]=qs['filters'](_[_0xc36c('0x56')](_0x1679c8[_0xc36c('0x4c')],_0x15adf8['filters']),_0x5e6b75);if(_0x1679c8['query'][_0xc36c('0x57')]){_0x37046c['where']=_[_0xc36c('0x58')](_0x37046c[_0xc36c('0x55')],{'$or':_['map'](_0x5e6b75,function(_0x240d7d){if(_0x240d7d[_0xc36c('0x49')]!==_0xc36c('0x59')){var _0x3cd232={};_0x3cd232[_0x240d7d['name']]={'$like':'%'+_0x1679c8[_0xc36c('0x4c')][_0xc36c('0x57')]+'%'};return _0x3cd232;}})});}_0x37046c=_['merge']({},_0x37046c,_0x1679c8[_0xc36c('0x5a')]);var _0x49ce34={'where':_0x37046c[_0xc36c('0x55')]};return db['FaxAccount'][_0xc36c('0x32')](_0x49ce34)[_0xc36c('0x23')](function(_0x30d145){_0x2eaa71['count']=_0x30d145;if(_0x1679c8[_0xc36c('0x4c')][_0xc36c('0x5b')]){_0x37046c[_0xc36c('0x5c')]=[{'all':!![]}];}return db[_0xc36c('0x46')]['findAll'](_0x37046c);})[_0xc36c('0x23')](function(_0x5129bf){_0x2eaa71['rows']=_0x5129bf;return _0x2eaa71;})[_0xc36c('0x23')](respondWithFilteredResult(_0x28de9d,_0x37046c))[_0xc36c('0x2e')](handleError(_0x28de9d,null));};exports[_0xc36c('0x5d')]=function(_0x1af6a2,_0x4b227){var _0x9c0ea5={'raw':![],'where':{'id':_0x1af6a2[_0xc36c('0x5e')]['id']},'include':[{'model':db[_0xc36c('0x43')],'as':_0xc36c('0x44')}]},_0x411f65={};_0x411f65[_0xc36c('0x4b')]=_[_0xc36c('0x4d')](db['FaxAccount']['rawAttributes']);_0x411f65[_0xc36c('0x4c')]=_['keys'](_0x1af6a2[_0xc36c('0x4c')]);_0x411f65[_0xc36c('0x4e')]=_['intersection'](_0x411f65[_0xc36c('0x4b')],_0x411f65[_0xc36c('0x4c')]);_0x9c0ea5[_0xc36c('0x50')]=_['intersection'](_0x411f65[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x1af6a2[_0xc36c('0x4c')][_0xc36c('0x51')]));_0x9c0ea5[_0xc36c('0x50')]=_0x9c0ea5[_0xc36c('0x50')][_0xc36c('0x52')]?_0x9c0ea5[_0xc36c('0x50')]:_0x411f65['model'];if(_0x1af6a2['query'][_0xc36c('0x5b')]){_0x9c0ea5[_0xc36c('0x5c')]=[{'all':!![]}];}_0x9c0ea5=_['merge']({},_0x9c0ea5,_0x1af6a2[_0xc36c('0x5a')]);return db[_0xc36c('0x46')][_0xc36c('0x5f')](_0x9c0ea5)[_0xc36c('0x23')](handleEntityNotFound(_0x4b227,null))[_0xc36c('0x23')](respondWithResult(_0x4b227,null))['catch'](handleError(_0x4b227,null));};exports[_0xc36c('0x60')]=function(_0x5e347e,_0x49ed64){return db['FaxAccount'][_0xc36c('0x60')](_0x5e347e['body'],{})[_0xc36c('0x23')](function(_0x19d4b3){var _0xfb1778=_0x5e347e[_0xc36c('0x61')]['get']({'plain':!![]});if(!_0xfb1778)throw new Error(_0xc36c('0x62'));if(_0xfb1778[_0xc36c('0x63')]===_0xc36c('0x61')){var _0x47719f=_0x19d4b3[_0xc36c('0x3c')]({'plain':!![]});var _0x441ddf=_0xc36c('0x3d');return db['UserProfileSection']['find']({'where':{'name':_0x441ddf,'userProfileId':_0xfb1778[_0xc36c('0x64')]},'raw':!![]})[_0xc36c('0x23')](function(_0xaadd4e){if(_0xaadd4e&&_0xaadd4e[_0xc36c('0x65')]===0x0){return db['UserProfileResource'][_0xc36c('0x60')]({'name':_0x47719f['name'],'resourceId':_0x47719f['id'],'type':_0xaadd4e[_0xc36c('0x41')],'sectionId':_0xaadd4e['id']},{})[_0xc36c('0x23')](function(){return _0x19d4b3;});}else{return _0x19d4b3;}})[_0xc36c('0x2e')](function(_0x32c012){logger[_0xc36c('0x2a')](_0xc36c('0x66'),_0x32c012);throw _0x32c012;});}return _0x19d4b3;})['then'](respondWithResult(_0x49ed64,0xc9))[_0xc36c('0x2e')](handleError(_0x49ed64,null));};exports['update']=function(_0x4b4e29,_0x378c29){if(_0x4b4e29[_0xc36c('0x67')]['id']){delete _0x4b4e29['body']['id'];}return db[_0xc36c('0x46')][_0xc36c('0x5f')]({'where':{'id':_0x4b4e29[_0xc36c('0x5e')]['id']},'include':[{'model':db[_0xc36c('0x43')],'as':_0xc36c('0x44')}]})[_0xc36c('0x23')](handleEntityNotFound(_0x378c29,null))[_0xc36c('0x23')](saveUpdates(_0x4b4e29[_0xc36c('0x67')],null))[_0xc36c('0x23')](respondWithResult(_0x378c29,null))['catch'](handleError(_0x378c29,null));};exports['destroy']=function(_0x4082f3,_0x588fe7){return db['FaxAccount'][_0xc36c('0x5f')]({'where':{'id':_0x4082f3[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x588fe7,null))[_0xc36c('0x23')](removeEntity(_0x588fe7,null))['catch'](handleError(_0x588fe7,null));};exports[_0xc36c('0x68')]=function(_0x27757b,_0x3a860a){return db[_0xc36c('0x46')][_0xc36c('0x68')]()['then'](respondWithResult(_0x3a860a,null))[_0xc36c('0x2e')](handleError(_0x3a860a,null));};exports[_0xc36c('0x69')]=function(_0x4f5525,_0x4e3231,_0x7bfe8b){if(_0x4f5525['body']['id']){delete _0x4f5525[_0xc36c('0x67')]['id'];}return db['FaxAccount'][_0xc36c('0x5f')]({'where':{'id':_0x4f5525[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x4e3231,null))[_0xc36c('0x23')](function(_0x1702fa){if(_0x1702fa){_0x4f5525[_0xc36c('0x67')][_0xc36c('0x6a')]=_0x1702fa['id'];return db[_0xc36c('0x6b')]['create'](_0x4f5525['body']);}})[_0xc36c('0x23')](respondWithResult(_0x4e3231,null))['catch'](handleError(_0x4e3231,null));};exports['getDispositions']=function(_0x3518e5,_0x14f964,_0x17ecf7){var _0x2584df={'raw':![],'where':{}};var _0x318dc6={};var _0x3c3e0e={'count':0x0,'rows':[]};return db[_0xc36c('0x46')][_0xc36c('0x6c')]({'where':{'id':_0x3518e5[_0xc36c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x14f964,null))[_0xc36c('0x23')](function(_0x34d38){if(_0x34d38){_0x318dc6[_0xc36c('0x4b')]=_['keys'](db[_0xc36c('0x6b')][_0xc36c('0x47')]);_0x318dc6['query']=_['keys'](_0x3518e5[_0xc36c('0x4c')]);_0x318dc6['filters']=_[_0xc36c('0x4f')](_0x318dc6[_0xc36c('0x4b')],_0x318dc6[_0xc36c('0x4c')]);_0x2584df[_0xc36c('0x50')]=_[_0xc36c('0x4f')](_0x318dc6[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x3518e5['query'][_0xc36c('0x51')]));_0x2584df[_0xc36c('0x50')]=_0x2584df[_0xc36c('0x50')][_0xc36c('0x52')]?_0x2584df[_0xc36c('0x50')]:_0x318dc6[_0xc36c('0x4b')];if(!_0x3518e5['query']['hasOwnProperty'](_0xc36c('0x6d'))){_0x2584df['limit']=qs[_0xc36c('0x31')](_0x3518e5[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x2584df[_0xc36c('0x33')]=qs['offset'](_0x3518e5[_0xc36c('0x4c')][_0xc36c('0x33')]);}_0x2584df['order']=qs[_0xc36c('0x54')](_0x3518e5[_0xc36c('0x4c')][_0xc36c('0x54')]);_0x2584df[_0xc36c('0x55')]=qs[_0xc36c('0x4e')](_[_0xc36c('0x56')](_0x3518e5[_0xc36c('0x4c')],_0x318dc6[_0xc36c('0x4e')]));_0x2584df[_0xc36c('0x55')][_0xc36c('0x6a')]=_0x34d38['id'];if(_0x3518e5[_0xc36c('0x4c')][_0xc36c('0x57')]){_0x2584df['where']=_[_0xc36c('0x58')](_0x2584df[_0xc36c('0x55')],{'$or':_['map'](_0x2584df[_0xc36c('0x50')],function(_0x4eed33){var _0x45184a={};_0x45184a[_0x4eed33]={'$like':'%'+_0x3518e5[_0xc36c('0x4c')][_0xc36c('0x57')]+'%'};return _0x45184a;})});}_0x2584df=_[_0xc36c('0x58')]({},_0x2584df,_0x3518e5[_0xc36c('0x5a')]);return db[_0xc36c('0x6b')][_0xc36c('0x32')]({'where':_0x2584df[_0xc36c('0x55')]})['then'](function(_0x54f3b1){_0x3c3e0e['count']=_0x54f3b1;if(_0x3518e5[_0xc36c('0x4c')]['includeAll']){_0x2584df['include']=[{'all':!![]}];}return db[_0xc36c('0x6b')][_0xc36c('0x6e')](_0x2584df);})[_0xc36c('0x23')](function(_0x55d998){_0x3c3e0e[_0xc36c('0x6f')]=_0x55d998;return _0x3c3e0e;});}})[_0xc36c('0x23')](respondWithFilteredResult(_0x14f964,_0x2584df))[_0xc36c('0x2e')](handleError(_0x14f964,null));};exports['removeDispositions']=function(_0x19380a,_0x314d8f,_0x5ce596){return db[_0xc36c('0x46')][_0xc36c('0x5f')]({'where':{'id':_0x19380a[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x314d8f,null))[_0xc36c('0x23')](function(_0x1eeeac){if(_0x1eeeac){return _0x1eeeac['removeDispositions'](_0x19380a[_0xc36c('0x4c')][_0xc36c('0x70')]);}})[_0xc36c('0x23')](respondWithStatusCode(_0x314d8f,null))['catch'](handleError(_0x314d8f,null));};exports[_0xc36c('0x71')]=function(_0x18fd7c,_0x261099,_0x2d29c6){if(_0x18fd7c[_0xc36c('0x67')]['id']){delete _0x18fd7c[_0xc36c('0x67')]['id'];}return db[_0xc36c('0x46')][_0xc36c('0x5f')]({'where':{'id':_0x18fd7c[_0xc36c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x261099,null))['then'](function(_0xf4d91c){if(_0xf4d91c){_0x18fd7c['body'][_0xc36c('0x6a')]=_0xf4d91c['id'];return db[_0xc36c('0x72')][_0xc36c('0x60')](_0x18fd7c[_0xc36c('0x67')]);}})[_0xc36c('0x23')](respondWithResult(_0x261099,null))[_0xc36c('0x2e')](handleError(_0x261099,null));};exports['getAnswers']=function(_0x2d6a42,_0x54c1a5,_0x3498d0){var _0x2e4b4f={'raw':![],'where':{}};var _0x54e0e9={};var _0x374282={'count':0x0,'rows':[]};return db[_0xc36c('0x46')][_0xc36c('0x6c')]({'where':{'id':_0x2d6a42[_0xc36c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x54c1a5,null))['then'](function(_0x2ae87c){if(_0x2ae87c){_0x54e0e9[_0xc36c('0x4b')]=_[_0xc36c('0x4d')](db[_0xc36c('0x72')][_0xc36c('0x47')]);_0x54e0e9[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x2d6a42[_0xc36c('0x4c')]);_0x54e0e9[_0xc36c('0x4e')]=_[_0xc36c('0x4f')](_0x54e0e9['model'],_0x54e0e9['query']);_0x2e4b4f[_0xc36c('0x50')]=_[_0xc36c('0x4f')](_0x54e0e9[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x2d6a42[_0xc36c('0x4c')]['fields']));_0x2e4b4f['attributes']=_0x2e4b4f['attributes']['length']?_0x2e4b4f['attributes']:_0x54e0e9[_0xc36c('0x4b')];if(!_0x2d6a42[_0xc36c('0x4c')]['hasOwnProperty'](_0xc36c('0x6d'))){_0x2e4b4f[_0xc36c('0x31')]=qs[_0xc36c('0x31')](_0x2d6a42['query'][_0xc36c('0x31')]);_0x2e4b4f[_0xc36c('0x33')]=qs[_0xc36c('0x33')](_0x2d6a42[_0xc36c('0x4c')][_0xc36c('0x33')]);}_0x2e4b4f[_0xc36c('0x73')]=qs[_0xc36c('0x54')](_0x2d6a42[_0xc36c('0x4c')][_0xc36c('0x54')]);_0x2e4b4f['where']=qs[_0xc36c('0x4e')](_['pick'](_0x2d6a42['query'],_0x54e0e9[_0xc36c('0x4e')]));_0x2e4b4f[_0xc36c('0x55')][_0xc36c('0x6a')]=_0x2ae87c['id'];if(_0x2d6a42['query'][_0xc36c('0x57')]){_0x2e4b4f[_0xc36c('0x55')]=_[_0xc36c('0x58')](_0x2e4b4f[_0xc36c('0x55')],{'$or':_[_0xc36c('0x45')](_0x2e4b4f[_0xc36c('0x50')],function(_0x526030){var _0x5e9f8e={};_0x5e9f8e[_0x526030]={'$like':'%'+_0x2d6a42['query']['filter']+'%'};return _0x5e9f8e;})});}_0x2e4b4f=_[_0xc36c('0x58')]({},_0x2e4b4f,_0x2d6a42[_0xc36c('0x5a')]);return db[_0xc36c('0x72')][_0xc36c('0x32')]({'where':_0x2e4b4f['where']})[_0xc36c('0x23')](function(_0x14a1e5){_0x374282[_0xc36c('0x32')]=_0x14a1e5;if(_0x2d6a42[_0xc36c('0x4c')][_0xc36c('0x5b')]){_0x2e4b4f[_0xc36c('0x5c')]=[{'all':!![]}];}return db[_0xc36c('0x72')][_0xc36c('0x6e')](_0x2e4b4f);})[_0xc36c('0x23')](function(_0x9a1fad){_0x374282[_0xc36c('0x6f')]=_0x9a1fad;return _0x374282;});}})[_0xc36c('0x23')](respondWithFilteredResult(_0x54c1a5,_0x2e4b4f))[_0xc36c('0x2e')](handleError(_0x54c1a5,null));};exports[_0xc36c('0x74')]=function(_0x9cf545,_0x2ef5f4,_0x1cc8ef){return db[_0xc36c('0x46')]['find']({'where':{'id':_0x9cf545[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x2ef5f4,null))[_0xc36c('0x23')](function(_0x50d079){if(_0x50d079){return _0x50d079[_0xc36c('0x74')](_0x9cf545[_0xc36c('0x4c')][_0xc36c('0x70')]);}})[_0xc36c('0x23')](respondWithStatusCode(_0x2ef5f4,null))[_0xc36c('0x2e')](handleError(_0x2ef5f4,null));};exports[_0xc36c('0x75')]=function(_0x5b0571,_0x5966d6,_0x2aca6d){return db[_0xc36c('0x76')][_0xc36c('0x5f')]({'where':{'id':_0x5b0571['params']['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x5966d6,null))[_0xc36c('0x23')](function(_0x3a3c14){if(_0x3a3c14){return _0x3a3c14['addInteraction'](_0x5b0571[_0xc36c('0x67')][_0xc36c('0x70')],_[_0xc36c('0x77')](_0x5b0571[_0xc36c('0x67')],[_0xc36c('0x70'),'id'])||{});}})[_0xc36c('0x23')](respondWithResult(_0x5966d6,null))[_0xc36c('0x2e')](handleError(_0x5966d6,null));};exports['getInteractions']=function(_0x340edd,_0x53edc1,_0x53329a){var _0x3fde4a={'raw':![],'where':{}};var _0xc4a4f8={};var _0x1d6bd7={'count':0x0,'rows':[]};return db[_0xc36c('0x46')]['findOne']({'where':{'id':_0x340edd['params']['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x53edc1,null))[_0xc36c('0x23')](function(_0x33ee4f){if(_0x33ee4f){_0xc4a4f8[_0xc36c('0x4b')]=_['keys'](db['FaxInteraction'][_0xc36c('0x47')]);_0xc4a4f8[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x340edd[_0xc36c('0x4c')]);_0xc4a4f8['filters']=_['intersection'](_0xc4a4f8['model'],_0xc4a4f8['query']);_0x3fde4a[_0xc36c('0x50')]=_[_0xc36c('0x4f')](_0xc4a4f8[_0xc36c('0x4b')],qs['fields'](_0x340edd['query']['fields']));_0x3fde4a[_0xc36c('0x50')]=_0x3fde4a['attributes'][_0xc36c('0x52')]?_0x3fde4a[_0xc36c('0x50')]:_0xc4a4f8[_0xc36c('0x4b')];if(!_0x340edd[_0xc36c('0x4c')][_0xc36c('0x53')]('nolimit')){_0x3fde4a[_0xc36c('0x31')]=qs[_0xc36c('0x31')](_0x340edd[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x3fde4a[_0xc36c('0x33')]=qs[_0xc36c('0x33')](_0x340edd[_0xc36c('0x4c')][_0xc36c('0x33')]);}_0x3fde4a[_0xc36c('0x73')]=qs['sort'](_0x340edd[_0xc36c('0x4c')][_0xc36c('0x54')]);_0x3fde4a[_0xc36c('0x55')]=qs[_0xc36c('0x4e')](_['pick'](_0x340edd[_0xc36c('0x4c')],_0xc4a4f8[_0xc36c('0x4e')]));_0x3fde4a[_0xc36c('0x55')]['FaxAccountId']=_0x33ee4f['id'];if(_0x340edd[_0xc36c('0x4c')]['filter']){_0x3fde4a[_0xc36c('0x55')]=_[_0xc36c('0x58')](_0x3fde4a[_0xc36c('0x55')],{'$or':_[_0xc36c('0x45')](_0x3fde4a['attributes'],function(_0x2e10b5){var _0x5948a4={};_0x5948a4[_0x2e10b5]={'$like':'%'+_0x340edd[_0xc36c('0x4c')][_0xc36c('0x57')]+'%'};return _0x5948a4;})});}_0x3fde4a=_[_0xc36c('0x58')]({},_0x3fde4a,_0x340edd[_0xc36c('0x5a')]);return db[_0xc36c('0x76')]['count']({'where':_0x3fde4a[_0xc36c('0x55')]})[_0xc36c('0x23')](function(_0xe4b019){_0x1d6bd7[_0xc36c('0x32')]=_0xe4b019;if(_0x340edd[_0xc36c('0x4c')][_0xc36c('0x5b')]){_0x3fde4a[_0xc36c('0x5c')]=[{'model':db[_0xc36c('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xc36c('0x79'),'attributes':[_0xc36c('0x41'),_0xc36c('0x7a'),_0xc36c('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xc36c('0x7c'),'attributes':['id',_0xc36c('0x41'),'color'],'where':_0x340edd[_0xc36c('0x4c')]['tag']?{'id':_0x340edd['query'][_0xc36c('0x7d')]}:undefined,'required':_0x340edd['query']['tag']?!![]:![]}];}return db[_0xc36c('0x76')][_0xc36c('0x6e')](_0x3fde4a);})['then'](function(_0x4d31b2){_0x1d6bd7[_0xc36c('0x6f')]=_0x4d31b2;return _0x1d6bd7;});}})[_0xc36c('0x23')](respondWithFilteredResult(_0x53edc1,_0x3fde4a))['catch'](handleError(_0x53edc1,null));};exports['addApplications']=function(_0x51a2a8,_0x10b227){var _0x5d89ed=_0x51a2a8[_0xc36c('0x5e')]['id'];var _0x531511=_0x51a2a8['body'];var _0x54ef0f=0xc8;var _0x4d0b8d=null;return db['sequelize'][_0xc36c('0x7e')]({'isolationLevel':db[_0xc36c('0x7f')][_0xc36c('0x80')]['ISOLATION_LEVELS'][_0xc36c('0x81')]},function(_0x26aca7){return db['FaxAccount'][_0xc36c('0x6c')]({'where':{'id':_0x5d89ed},'transaction':_0x26aca7})[_0xc36c('0x23')](function(_0x7c2942){if(_0x7c2942){return db['FaxApplication'][_0xc36c('0x3b')]({'where':{'FaxAccountId':_0x5d89ed},'transaction':_0x26aca7})['then'](function(){var _0x25e8ac=_[_0xc36c('0x45')](_0x531511,function(_0x26b285){_0x26b285[_0xc36c('0x6a')]=_0x5d89ed;return _0x26b285;});return db[_0xc36c('0x82')][_0xc36c('0x83')](_0x25e8ac,{'transaction':_0x26aca7});});}else{_0x54ef0f=0x194;_0x4d0b8d=[];}});})['then'](function(){if(_0x54ef0f!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x5d89ed},'order':_0xc36c('0x84')})[_0xc36c('0x23')](function(_0x4436ed){_0x4d0b8d=_0x4436ed;});}})[_0xc36c('0x2e')](function(_0x25cfda){_0x54ef0f=0x1f4;logger[_0xc36c('0x2a')](_0x25cfda[_0xc36c('0x40')]);if(_0x25cfda['name']){delete _0x25cfda['name'];}_0x4d0b8d=_0x25cfda;})[_0xc36c('0x85')](function(){if(_0x4d0b8d===null){_0x10b227[_0xc36c('0x3f')](_0x54ef0f);}else{if(_0x54ef0f===0x1f4){_0x10b227[_0xc36c('0x2f')](_0x54ef0f)[_0xc36c('0x42')](_0x4d0b8d);}else{_0x10b227[_0xc36c('0x2f')](_0x54ef0f)[_0xc36c('0x36')](_0x4d0b8d);}}});};exports[_0xc36c('0x86')]=function(_0x412aa3,_0x48c3da,_0x238c22){var _0x34078b={};var _0x17911e={};var _0x114188;var _0x53bbed;return db[_0xc36c('0x46')][_0xc36c('0x6c')]({'where':{'id':_0x412aa3[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x48c3da,null))[_0xc36c('0x23')](function(_0x56e7de){if(_0x56e7de){_0x114188=_0x56e7de;_0x17911e[_0xc36c('0x4b')]=_['keys'](db[_0xc36c('0x82')][_0xc36c('0x47')]);_0x17911e[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x412aa3['query']);_0x17911e[_0xc36c('0x4e')]=_[_0xc36c('0x4f')](_0x17911e[_0xc36c('0x4b')],_0x17911e['query']);_0x34078b[_0xc36c('0x50')]=_[_0xc36c('0x4f')](_0x17911e[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x412aa3['query'][_0xc36c('0x51')]));_0x34078b[_0xc36c('0x50')]=_0x34078b['attributes']['length']?_0x34078b[_0xc36c('0x50')]:_0x17911e['model'];_0x34078b['order']=qs[_0xc36c('0x54')](_0x412aa3['query'][_0xc36c('0x54')]);_0x34078b[_0xc36c('0x55')]=qs['filters'](_[_0xc36c('0x56')](_0x412aa3[_0xc36c('0x4c')],_0x17911e[_0xc36c('0x4e')]));if(_0x412aa3[_0xc36c('0x4c')]['filter']){_0x34078b[_0xc36c('0x55')]=_[_0xc36c('0x58')](_0x34078b[_0xc36c('0x55')],{'$or':_['map'](_0x34078b[_0xc36c('0x50')],function(_0x13bb1b){var _0x2d8d82={};_0x2d8d82[_0x13bb1b]={'$like':'%'+_0x412aa3[_0xc36c('0x4c')][_0xc36c('0x57')]+'%'};return _0x2d8d82;})});}_0x34078b=_['merge']({},_0x34078b,_0x412aa3[_0xc36c('0x5a')]);return _0x114188['getApplications'](_0x34078b);}})[_0xc36c('0x23')](function(_0x41f60c){if(_0x41f60c){_0x53bbed=_0x41f60c['length'];if(!_0x412aa3[_0xc36c('0x4c')][_0xc36c('0x53')](_0xc36c('0x6d'))){_0x34078b[_0xc36c('0x31')]=qs[_0xc36c('0x31')](_0x412aa3[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x34078b['offset']=qs[_0xc36c('0x33')](_0x412aa3['query'][_0xc36c('0x33')]);}return _0x114188['getApplications'](_0x34078b);}})['then'](function(_0x27a898){if(_0x27a898){return _0x27a898?{'count':_0x53bbed,'rows':_0x27a898}:null;}})[_0xc36c('0x23')](respondWithResult(_0x48c3da,null))['catch'](handleError(_0x48c3da,null));};function Extension(_0x539b8f,_0x455f43,_0x420379,_0x2f0b39){this[_0xc36c('0x87')]=_0xc36c('0x88');this[_0xc36c('0x89')]=_0x539b8f[_0xc36c('0x8a')];this[_0xc36c('0x8b')]=_0x2f0b39;this['type']='system';this[_0xc36c('0x8c')]=_0xc36c('0x8d');this[_0xc36c('0x6a')]=_0x539b8f['id'];this['priority']=_0x455f43;this[_0xc36c('0x8e')]=_0x420379;}function createExtensionsReciveFax(_0x309853){var _0x448bd1=0x1;var _0x5b433c=[];_0x5b433c[_0xc36c('0x8f')](new Extension(_0x309853,_0x448bd1,'','Answer'));_0x448bd1+=0x1;_0x5b433c[_0xc36c('0x8f')](new Extension(_0x309853,_0x448bd1,_0xc36c('0x90'),_0xc36c('0x91')));_0x448bd1+=0x1;for(var _0x19efff in _0x309853){if(_0x309853[_0xc36c('0x53')](_0x19efff)&&(_0x19efff===_0xc36c('0x92')||_0x19efff===_0xc36c('0x8a')||_0x19efff===_0xc36c('0x93')||_0x19efff===_0xc36c('0x94')||_0x19efff===_0xc36c('0x95')||_0x19efff===_0xc36c('0x96')||_0x19efff===_0xc36c('0x97')||_0x19efff==='modem'||_0x19efff===_0xc36c('0x98'))){_0x5b433c[_0xc36c('0x8f')](new Extension(_0x309853,_0x448bd1,_0xc36c('0x99')+_0x19efff+')='+_0x309853[_0x19efff],_0xc36c('0x91')));_0x448bd1+=0x1;}}_0x5b433c['push'](new Extension(_0x309853,_0x448bd1,'6',_0xc36c('0x9a')));_0x448bd1+=0x1;_0x5b433c[_0xc36c('0x8f')](new Extension(_0x309853,_0x448bd1,'/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',_0xc36c('0x9b')));_0x448bd1=0x0;return _0x5b433c;}exports[_0xc36c('0x9c')]=function(_0x3eb5f7,_0x498f19,_0x3875ee){var _0x2e95eb;return db[_0xc36c('0x7f')][_0xc36c('0x7e')](function(_0x2390ed){return db[_0xc36c('0x46')][_0xc36c('0x60')](_0x3eb5f7['body'],{'transaction':_0x2390ed})[_0xc36c('0x23')](function(_0x4353f6){_0x2e95eb=_0x4353f6[_0xc36c('0x3c')]({'plain':!![]});return db[_0xc36c('0x9d')][_0xc36c('0x83')](createExtensionsReciveFax(_0x2e95eb),{'transaction':_0x2390ed});});})['then'](function(){return _0x2e95eb;})['then'](respondWithResult(_0x498f19,null))[_0xc36c('0x2e')](handleError(_0x498f19,null));};exports['updateAccountApplications']=function(_0x1ea1ad,_0x264130,_0x1e42d9){var _0x11b014;return db['sequelize']['transaction'](function(_0x241c5c){return db[_0xc36c('0x46')][_0xc36c('0x3a')](_0x1ea1ad[_0xc36c('0x67')],{'where':{'id':_0x1ea1ad[_0xc36c('0x67')]['id']},'transaction':_0x241c5c})[_0xc36c('0x23')](function(_0x4873b3){return db[_0xc36c('0x9d')][_0xc36c('0x3b')]({'where':{'FaxAccountId':_0x1ea1ad[_0xc36c('0x67')]['id']},'transaction':_0x241c5c})[_0xc36c('0x23')](function(_0x32133c){return db[_0xc36c('0x9d')][_0xc36c('0x83')](createExtensionsReciveFax(_[_0xc36c('0x77')](_0x1ea1ad[_0xc36c('0x67')],['tech','key','createdAt',_0xc36c('0x9e'),'TrunkId',_0xc36c('0x9f')])),{'transaction':_0x241c5c});});});})[_0xc36c('0x23')](function(){return db['FaxAccount']['findById'](_0x1ea1ad['body']['id']);})[_0xc36c('0x23')](respondWithResult(_0x264130,null))['catch'](handleError(_0x264130,null));};exports[_0xc36c('0xa0')]=function(_0x40ae00,_0x378c1a,_0x2f4454){var _0x541916={'raw':!![],'where':{}};var _0x3c6cef={};var _0x2dcc5b={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x40ae00[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x378c1a,null))['then'](function(_0x4e019c){if(_0x4e019c){_0x3c6cef[_0xc36c('0x4b')]=_['keys'](db[_0xc36c('0xa1')][_0xc36c('0x47')]);_0x3c6cef[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x40ae00[_0xc36c('0x4c')]);_0x3c6cef[_0xc36c('0x4e')]=_['intersection'](_0x3c6cef[_0xc36c('0x4b')],_0x3c6cef['query']);_0x541916[_0xc36c('0x50')]=_['intersection'](_0x3c6cef[_0xc36c('0x4b')],qs['fields'](_0x40ae00['query'][_0xc36c('0x51')]));_0x541916['attributes']=_0x541916[_0xc36c('0x50')][_0xc36c('0x52')]?_0x541916[_0xc36c('0x50')]:_0x3c6cef[_0xc36c('0x4b')];if(!_0x40ae00['query'][_0xc36c('0x53')]('nolimit')){_0x541916[_0xc36c('0x31')]=qs['limit'](_0x40ae00[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x541916[_0xc36c('0x33')]=qs['offset'](_0x40ae00['query']['offset']);}_0x541916[_0xc36c('0x73')]=qs[_0xc36c('0x54')](_0x40ae00['query'][_0xc36c('0x54')]);_0x541916[_0xc36c('0x55')]=qs['filters'](_[_0xc36c('0x56')](_0x40ae00['query'],_0x3c6cef['filters']));_0x541916[_0xc36c('0x55')][_0xc36c('0x6a')]=_0x4e019c['id'];if(_0x40ae00[_0xc36c('0x4c')][_0xc36c('0x57')]){_0x541916['where']=_[_0xc36c('0x58')](_0x541916[_0xc36c('0x55')],{'$or':_['map'](_0x541916[_0xc36c('0x50')],function(_0x35e4fc){var _0xc8162b={};_0xc8162b[_0x35e4fc]={'$like':'%'+_0x40ae00[_0xc36c('0x4c')]['filter']+'%'};return _0xc8162b;})});}if(_0x40ae00['query'][_0xc36c('0xa2')]){var _0xe64bee=_0x40ae00[_0xc36c('0x4c')][_0xc36c('0xa2')][_0xc36c('0xa3')](',');var _0x46cd39={};_0x46cd39[_0xe64bee[0x0]]={'$gte':moment(_0xe64bee[0x1])['format'](_0xc36c('0xa4'))};_0x541916[_0xc36c('0x55')]=_[_0xc36c('0x58')](_0x541916[_0xc36c('0x55')],_0x46cd39);}_0x541916=_[_0xc36c('0x58')]({},_0x541916,_0x40ae00[_0xc36c('0x5a')]);return db[_0xc36c('0xa1')][_0xc36c('0x32')]({'where':_0x541916[_0xc36c('0x55')]})['then'](function(_0x23f7ad){_0x2dcc5b[_0xc36c('0x32')]=_0x23f7ad;if(_0x40ae00[_0xc36c('0x4c')][_0xc36c('0x5b')]){_0x541916['include']=[{'all':!![]}];}return db[_0xc36c('0xa1')][_0xc36c('0x6e')](_0x541916);})['then'](function(_0x27b2bd){_0x2dcc5b['rows']=_0x27b2bd;return _0x2dcc5b;});}})[_0xc36c('0x23')](respondWithFilteredResult(_0x378c1a,_0x541916))[_0xc36c('0x2e')](handleError(_0x378c1a,null));};exports[_0xc36c('0x42')]=function(_0x344aeb,_0x37ecc0,_0xcce21c){var _0x9b1118,_0x53fbef={},_0x17014a;if(_0x344aeb['body']['to']){_0x17014a=_0x344aeb['body']['to'][0x0];}return db[_0xc36c('0x46')][_0xc36c('0x5f')]({'where':{'id':_0x344aeb['params']['id']},'include':[{'model':db[_0xc36c('0xa5')],'as':_0xc36c('0xa6'),'include':[{'model':db[_0xc36c('0x78')],'as':_0xc36c('0xa7'),'where':{'fax':_0x17014a},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xc36c('0x23')](handleEntityNotFound(_0x37ecc0,null))[_0xc36c('0x23')](function(_0x197184){_0x9b1118=_0x197184;if(_0x344aeb['body'][_0xc36c('0xa8')]&&_0x344aeb[_0xc36c('0x67')]['attachments'][_0xc36c('0x52')]){for(var _0x5cda6b=0x0;_0x5cda6b<_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][_0xc36c('0x52')];_0x5cda6b+=0x1){_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][_0x5cda6b]={'filename':_0x344aeb[_0xc36c('0x67')]['attachments'][_0x5cda6b][_0xc36c('0x41')],'id':_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][_0x5cda6b]['id'],'path':path[_0xc36c('0xa9')](config[_0xc36c('0xaa')],_0xc36c('0xab'),_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][_0x5cda6b][_0xc36c('0xac')])};}}return respondWithRpcPromise(_0xc36c('0xad'),_0xc36c('0xad'),{'FaxAccountId':_[_0xc36c('0xae')](_0x344aeb['params']['id'])?undefined:_0x344aeb[_0xc36c('0x5e')]['id'],'path':_[_0xc36c('0xae')](_0x344aeb[_0xc36c('0x67')]['attachments'][0x0]['path'])?undefined:_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][0x0][_0xc36c('0x8')],'fax':_[_0xc36c('0xae')](_0x344aeb[_0xc36c('0x67')]['to'][0x0])?undefined:_0x344aeb[_0xc36c('0x67')]['to'][0x0]},client9002);})[_0xc36c('0x23')](function(){if(_0x9b1118){if(_[_0xc36c('0xae')](_0x344aeb[_0xc36c('0x67')][_0xc36c('0xaf')])){_0x344aeb[_0xc36c('0x67')]['from']=util[_0xc36c('0xb0')](_0xc36c('0xb1'),_0x9b1118['name'],_0x9b1118[_0xc36c('0xb2')]);}if(_0x9b1118[_0xc36c('0xa6')]){if(_0x9b1118['List']['Contacts'][_0xc36c('0x52')]){return _0x9b1118[_0xc36c('0xa6')][_0xc36c('0xa7')][0x0];}else{return db[_0xc36c('0x78')][_0xc36c('0x60')](_[_0xc36c('0xb3')](_0x344aeb[_0xc36c('0x67')],{'firstName':_0x344aeb[_0xc36c('0x67')]['to'][0x0],'phone':_0x344aeb[_0xc36c('0x67')]['to'][0x0],'fax':_0x344aeb['body']['to'][0x0],'ListId':_0x9b1118['ListId']}));}}else{throw new Error(_0xc36c('0xb4'));}}else{throw new Error(_0xc36c('0xb5'));}})[_0xc36c('0x23')](function(_0x2f80c8){if(_0x2f80c8){return db['FaxInteraction']['find']({'where':{'ContactId':_0x2f80c8['id'],'closed':![],'FaxAccountId':_0x9b1118['id']}})[_0xc36c('0x23')](function(_0x5169b3){if(_0x5169b3){return[_0x5169b3,![]];}return db[_0xc36c('0x76')]['create']({'UserId':_0x344aeb[_0xc36c('0x61')]['id'],'ContactId':_0x2f80c8['id'],'FaxAccountId':_0x9b1118['id'],'fax':_0x344aeb[_0xc36c('0x67')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xc36c('0x58')](_0x344aeb[_0xc36c('0x67')],{'read':![],'body':_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][0x0]['filename'],'FaxAccountId':_0x9b1118['id'],'UserId':_0x344aeb['user']['id'],'ContactId':_0x2f80c8['id'],'AttachmentId':_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xc36c('0xa1')],'as':_0xc36c('0xb6')}]})[_0xc36c('0x23')](function(_0x42355){return[_0x42355,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc36c('0xb7')](function(_0x4deafb,_0x2367cb){if(_0x2367cb){return _0x4deafb;}return db[_0xc36c('0xa1')]['create']({'direction':_0xc36c('0xb8'),'read':![],'body':_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][0x0][_0xc36c('0xb9')],'FaxAccountId':_0x9b1118['id'],'FaxInteractionId':_0x4deafb['id'],'UserId':_0x344aeb[_0xc36c('0x61')]['id'],'ContactId':_0x4deafb[_0xc36c('0xba')],'AttachmentId':_0x344aeb['body'][_0xc36c('0xa8')][0x0]['id']})[_0xc36c('0x23')](function(_0xccdbcd){_0x4deafb[_0xc36c('0xbb')][_0xc36c('0xb6')]=[];_0x4deafb[_0xc36c('0xbb')]['Messages'][_0xc36c('0x8f')](_0xccdbcd[_0xc36c('0xbb')]);return _0x4deafb;});})[_0xc36c('0x23')](function(_0xd649b6){respondWithRpcPromise(_0xc36c('0xbc'),'SendFax',{'FaxAccountId':_['isNil'](_0x344aeb[_0xc36c('0x5e')]['id'])?undefined:_0x344aeb[_0xc36c('0x5e')]['id'],'path':_['isNil'](_0x344aeb[_0xc36c('0x67')][_0xc36c('0xa8')][0x0][_0xc36c('0x8')])?undefined:_0x344aeb[_0xc36c('0x67')]['attachments'][0x0][_0xc36c('0x8')],'fax':_[_0xc36c('0xae')](_0x344aeb[_0xc36c('0x67')]['to'][0x0])?undefined:_0x344aeb['body']['to'][0x0],'AttachmentId':_0x344aeb['body'][_0xc36c('0xa8')][0x0]['id']},client9002)[_0xc36c('0x23')](function(_0x5024e8){logger[_0xc36c('0x24')](_0xc36c('0xbd'),_0x5024e8);})[_0xc36c('0x2e')](function(_0x1fe6e7){logger['info'](_0xc36c('0xbd'),_0x1fe6e7);});return _0xd649b6;})['then'](respondWithResult(_0x37ecc0,null))[_0xc36c('0x2e')](handleError(_0x37ecc0,null));};exports[_0xc36c('0xbe')]=function(_0x2ac416,_0x202af7,_0x2afae8){return db[_0xc36c('0x46')]['find']({'where':{'id':_0x2ac416[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x202af7,null))['then'](function(_0x3bbe77){if(_0x3bbe77){return _0x3bbe77['addAgents'](_0x2ac416[_0xc36c('0x67')][_0xc36c('0x70')],_[_0xc36c('0x77')](_0x2ac416[_0xc36c('0x67')],['ids','id'])||{})[_0xc36c('0xb7')](function(_0x4672f3){for(var _0x30a135=0x0;_0x30a135<_0x2ac416[_0xc36c('0x67')]['ids'][_0xc36c('0x52')];_0x30a135+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x2ac416[_0xc36c('0x67')][_0xc36c('0x70')][_0x30a135]),'FaxAccountId':Number(_0x2ac416[_0xc36c('0x5e')]['id'])});}return _0x4672f3;});}})[_0xc36c('0x23')](respondWithResult(_0x202af7,null))[_0xc36c('0x2e')](handleError(_0x202af7,null));};exports[_0xc36c('0xbf')]=function(_0x4ae141,_0xdb37e8,_0x278b21){return db[_0xc36c('0x46')]['find']({'where':{'id':_0x4ae141['params']['id']}})['then'](handleEntityNotFound(_0xdb37e8,null))[_0xc36c('0x23')](function(_0xd5ca71){if(_0xd5ca71){return _0xd5ca71['removeAgents'](_0x4ae141[_0xc36c('0x4c')][_0xc36c('0x70')])[_0xc36c('0x23')](function(){if(_[_0xc36c('0xc0')](_0x4ae141[_0xc36c('0x4c')][_0xc36c('0x70')])){for(var _0x4421a6=0x0;_0x4421a6<_0x4ae141['query'][_0xc36c('0x70')][_0xc36c('0x52')];_0x4421a6+=0x1){socket[_0xc36c('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x4ae141[_0xc36c('0x4c')][_0xc36c('0x70')][_0x4421a6]),'FaxAccountId':Number(_0x4ae141[_0xc36c('0x5e')]['id'])});}}else{socket[_0xc36c('0xc1')](_0xc36c('0xc2'),{'UserId':Number(_0x4ae141[_0xc36c('0x4c')]['ids']),'FaxAccountId':Number(_0x4ae141['params']['id'])});}});}})['then'](respondWithStatusCode(_0xdb37e8,null))[_0xc36c('0x2e')](handleError(_0xdb37e8,null));};exports[_0xc36c('0xc3')]=function(_0x44ded2,_0x81284,_0x32ad6c){var _0x2d17de={};var _0x3887e7={};var _0x519ed6;var _0x3628cb;return db['FaxAccount']['findOne']({'where':{'id':_0x44ded2[_0xc36c('0x5e')]['id']}})[_0xc36c('0x23')](handleEntityNotFound(_0x81284,null))['then'](function(_0x573494){if(_0x573494){_0x519ed6=_0x573494;_0x3887e7[_0xc36c('0x4b')]=_['keys'](db['User'][_0xc36c('0x47')]);_0x3887e7[_0xc36c('0x4c')]=_[_0xc36c('0x4d')](_0x44ded2[_0xc36c('0x4c')]);_0x3887e7[_0xc36c('0x4e')]=_[_0xc36c('0x4f')](_0x3887e7[_0xc36c('0x4b')],_0x3887e7[_0xc36c('0x4c')]);_0x2d17de['attributes']=_[_0xc36c('0x4f')](_0x3887e7[_0xc36c('0x4b')],qs[_0xc36c('0x51')](_0x44ded2[_0xc36c('0x4c')][_0xc36c('0x51')]));_0x2d17de[_0xc36c('0x50')]=_0x2d17de[_0xc36c('0x50')][_0xc36c('0x52')]?_0x2d17de['attributes']:_0x3887e7['model'];_0x2d17de['order']=qs[_0xc36c('0x54')](_0x44ded2[_0xc36c('0x4c')]['sort']);_0x2d17de[_0xc36c('0x55')]=qs[_0xc36c('0x4e')](_[_0xc36c('0x56')](_0x44ded2['query'],_0x3887e7['filters']));if(_0x44ded2['query'][_0xc36c('0x57')]){_0x2d17de[_0xc36c('0x55')]=_['merge'](_0x2d17de[_0xc36c('0x55')],{'$or':_[_0xc36c('0x45')](_0x2d17de[_0xc36c('0x50')],function(_0x7f4a90){var _0x46e703={};_0x46e703[_0x7f4a90]={'$like':'%'+_0x44ded2[_0xc36c('0x4c')][_0xc36c('0x57')]+'%'};return _0x46e703;})});}_0x2d17de=_[_0xc36c('0x58')]({},_0x2d17de,_0x44ded2[_0xc36c('0x5a')]);return _0x519ed6['getAgents'](_0x2d17de);}})[_0xc36c('0x23')](function(_0x16d74c){if(_0x16d74c){_0x3628cb=_0x16d74c[_0xc36c('0x52')];if(!_0x44ded2[_0xc36c('0x4c')][_0xc36c('0x53')]('nolimit')){_0x2d17de[_0xc36c('0x31')]=qs[_0xc36c('0x31')](_0x44ded2[_0xc36c('0x4c')][_0xc36c('0x31')]);_0x2d17de[_0xc36c('0x33')]=qs[_0xc36c('0x33')](_0x44ded2[_0xc36c('0x4c')][_0xc36c('0x33')]);}return _0x519ed6['getAgents'](_0x2d17de);}})[_0xc36c('0x23')](function(_0x1b0cb9){if(_0x1b0cb9){return _0x1b0cb9?{'count':_0x3628cb,'rows':_0x1b0cb9}:null;}})[_0xc36c('0x23')](respondWithResult(_0x81284,null))[_0xc36c('0x2e')](handleError(_0x81284,null));}; \ No newline at end of file +var _0xdfa7=['then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','FaxAccount','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','hasOwnProperty','ids','addAnswer','CannedAnswer','length','removeAnswers','FaxInteraction','addInteraction','omit','findOne','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','getApplications','from-voip-provider','exten','localstationid','system','description','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','/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','bulkCreate','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','FaxMessage','CmList','List','DESC','attachments','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request'];(function(_0x381c49,_0x12595b){var _0x42db9e=function(_0x56ae63){while(--_0x56ae63){_0x381c49['push'](_0x381c49['shift']());}};_0x42db9e(++_0x12595b);}(_0xdfa7,0x164));var _0x7dfa=function(_0x5895e1,_0x43927d){_0x5895e1=_0x5895e1-0x0;var _0x460aa1=_0xdfa7[_0x5895e1];return _0x460aa1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7dfa('0x0'));var zipdir=require(_0x7dfa('0x1'));var jsonpatch=require(_0x7dfa('0x2'));var rp=require(_0x7dfa('0x3'));var moment=require(_0x7dfa('0x4'));var BPromise=require(_0x7dfa('0x5'));var Mustache=require(_0x7dfa('0x6'));var util=require(_0x7dfa('0x7'));var path=require(_0x7dfa('0x8'));var sox=require(_0x7dfa('0x9'));var csv=require(_0x7dfa('0xa'));var ejs=require(_0x7dfa('0xb'));var fs=require('fs');var fs_extra=require(_0x7dfa('0xc'));var _=require(_0x7dfa('0xd'));var squel=require(_0x7dfa('0xe'));var crypto=require(_0x7dfa('0xf'));var jsforce=require(_0x7dfa('0x10'));var deskjs=require(_0x7dfa('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7dfa('0x12'));var Papa=require(_0x7dfa('0x13'));var Redis=require(_0x7dfa('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x7dfa('0x15'));var as=require(_0x7dfa('0x16'));var hardwareService=require(_0x7dfa('0x17'));var logger=require(_0x7dfa('0x18'))(_0x7dfa('0x19'));var utils=require(_0x7dfa('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x7dfa('0x1b'));var db=require(_0x7dfa('0x1c'))['db'];config[_0x7dfa('0x1d')]=_['defaults'](config[_0x7dfa('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x7dfa('0x1e'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x7dfa('0x1f')](socket);var jayson=require(_0x7dfa('0x20'));var client=jayson[_0x7dfa('0x21')][_0x7dfa('0x22')]({'port':0x232c});var client9002=jayson[_0x7dfa('0x21')][_0x7dfa('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xd49750,_0x156ef4,_0x2335cb,_0x318eea){return new BPromise(function(_0x40ecfb,_0x3fa396){var _0x2381d5=_0x318eea||client;return _0x2381d5[_0x7dfa('0x23')](_0xd49750,_0x2335cb)[_0x7dfa('0x24')](function(_0x3b3457){logger['info'](_0x7dfa('0x25'),_0x156ef4,'request\x20sent');logger[_0x7dfa('0x26')](_0x7dfa('0x27'),_0x156ef4,_0x7dfa('0x28'),JSON['stringify'](_0x3b3457));if(_0x3b3457[_0x7dfa('0x29')]){if(_0x3b3457[_0x7dfa('0x29')]['code']===0x1f4){logger[_0x7dfa('0x29')](_0x7dfa('0x25'),_0x156ef4,_0x3b3457[_0x7dfa('0x29')][_0x7dfa('0x2a')]);return _0x3fa396(_0x3b3457['error'][_0x7dfa('0x2a')]);}logger[_0x7dfa('0x29')](_0x7dfa('0x25'),_0x156ef4,_0x3b3457[_0x7dfa('0x29')][_0x7dfa('0x2a')]);return _0x40ecfb(_0x3b3457[_0x7dfa('0x29')][_0x7dfa('0x2a')]);}else{logger[_0x7dfa('0x2b')](_0x7dfa('0x25'),_0x156ef4,_0x7dfa('0x28'));_0x40ecfb(_0x3b3457[_0x7dfa('0x2c')][_0x7dfa('0x2a')]);}})[_0x7dfa('0x2d')](function(_0x991fcd){logger[_0x7dfa('0x29')]('FaxAccount,\x20%s,\x20%s',_0x156ef4,_0x991fcd);_0x3fa396(_0x991fcd);});});}function respondWithStatusCode(_0x3165e0,_0x2ae0f2){_0x2ae0f2=_0x2ae0f2||0xcc;return function(_0x588943){if(_0x588943){return _0x3165e0['sendStatus'](_0x2ae0f2);}return _0x3165e0['status'](_0x2ae0f2)[_0x7dfa('0x2e')]();};}function respondWithResult(_0x53de28,_0x6e5738){_0x6e5738=_0x6e5738||0xc8;return function(_0x5c7d15){if(_0x5c7d15){return _0x53de28[_0x7dfa('0x2f')](_0x6e5738)[_0x7dfa('0x30')](_0x5c7d15);}};}function respondWithFilteredResult(_0x1cf7ec,_0x5cccf3){return function(_0x434400){if(_0x434400){var _0x2c2700=typeof _0x5cccf3['offset']===_0x7dfa('0x31')&&typeof _0x5cccf3['limit']==='undefined';var _0x44fc96=_0x434400[_0x7dfa('0x32')];var _0x50f0f2=_0x2c2700?0x0:_0x5cccf3[_0x7dfa('0x33')];var _0xe5c30c=_0x2c2700?_0x434400[_0x7dfa('0x32')]:_0x5cccf3[_0x7dfa('0x33')]+_0x5cccf3[_0x7dfa('0x34')];var _0x3028cc;if(_0xe5c30c>=_0x44fc96){_0xe5c30c=_0x44fc96;_0x3028cc=0xc8;}else{_0x3028cc=0xce;}_0x1cf7ec[_0x7dfa('0x2f')](_0x3028cc);return _0x1cf7ec['set'](_0x7dfa('0x35'),_0x50f0f2+'-'+_0xe5c30c+'/'+_0x44fc96)[_0x7dfa('0x30')](_0x434400);}return null;};}function patchUpdates(_0x5c226f){return function(_0x2db980){try{jsonpatch[_0x7dfa('0x36')](_0x2db980,_0x5c226f,!![]);}catch(_0xefcbf4){return BPromise[_0x7dfa('0x37')](_0xefcbf4);}return _0x2db980['save']();};}function saveUpdates(_0x14655b,_0x106139){return function(_0x51045d){if(_0x51045d){return _0x51045d['update'](_0x14655b)[_0x7dfa('0x24')](function(_0x598e4b){return _0x598e4b;});}return null;};}function removeEntity(_0x4b8ebe,_0x8ee1df){return function(_0x281de8){if(_0x281de8){return _0x281de8[_0x7dfa('0x38')]()[_0x7dfa('0x24')](function(){var _0x182c9f=_0x281de8[_0x7dfa('0x39')]({'plain':!![]});var _0x3eb515=_0x7dfa('0x3a');return db[_0x7dfa('0x3b')][_0x7dfa('0x38')]({'where':{'type':_0x3eb515,'resourceId':_0x182c9f['id']}})[_0x7dfa('0x24')](function(){return _0x281de8;});})[_0x7dfa('0x24')](function(){_0x4b8ebe['status'](0xcc)[_0x7dfa('0x2e')]();});}};}function handleEntityNotFound(_0xa0fc90,_0xbe8f9d){return function(_0x588a1b){if(!_0x588a1b){_0xa0fc90[_0x7dfa('0x3c')](0x194);}return _0x588a1b;};}function handleError(_0x374d64,_0x1aaeac){_0x1aaeac=_0x1aaeac||0x1f4;return function(_0x56612f){logger['error'](_0x56612f['stack']);if(_0x56612f[_0x7dfa('0x3d')]){delete _0x56612f['name'];}_0x374d64[_0x7dfa('0x2f')](_0x1aaeac)[_0x7dfa('0x3e')](_0x56612f);};}exports[_0x7dfa('0x3f')]=function(_0x41eab8,_0x33253d){var _0x585348={'include':[{'model':db[_0x7dfa('0x40')],'as':_0x7dfa('0x41')}]},_0x13c8ab={},_0xfab05b={'count':0x0,'rows':[]};var _0xd90e40=_['map'](db['FaxAccount'][_0x7dfa('0x42')],function(_0x1323b9){return{'name':_0x1323b9[_0x7dfa('0x43')],'type':_0x1323b9[_0x7dfa('0x44')][_0x7dfa('0x45')]};});_0x13c8ab[_0x7dfa('0x46')]=_[_0x7dfa('0x47')](_0xd90e40,_0x7dfa('0x3d'));_0x13c8ab['query']=_[_0x7dfa('0x48')](_0x41eab8[_0x7dfa('0x49')]);_0x13c8ab[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x13c8ab[_0x7dfa('0x46')],_0x13c8ab[_0x7dfa('0x49')]);_0x585348[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x13c8ab[_0x7dfa('0x46')],qs[_0x7dfa('0x4d')](_0x41eab8[_0x7dfa('0x49')][_0x7dfa('0x4d')]));_0x585348[_0x7dfa('0x4c')]=_0x585348[_0x7dfa('0x4c')]['length']?_0x585348[_0x7dfa('0x4c')]:_0x13c8ab[_0x7dfa('0x46')];if(!_0x41eab8[_0x7dfa('0x49')]['hasOwnProperty'](_0x7dfa('0x4e'))){_0x585348['limit']=qs[_0x7dfa('0x34')](_0x41eab8[_0x7dfa('0x49')]['limit']);_0x585348[_0x7dfa('0x33')]=qs[_0x7dfa('0x33')](_0x41eab8['query'][_0x7dfa('0x33')]);}_0x585348[_0x7dfa('0x4f')]=qs['sort'](_0x41eab8[_0x7dfa('0x49')][_0x7dfa('0x50')]);_0x585348[_0x7dfa('0x51')]=qs[_0x7dfa('0x4a')](_[_0x7dfa('0x52')](_0x41eab8[_0x7dfa('0x49')],_0x13c8ab[_0x7dfa('0x4a')]),_0xd90e40);if(_0x41eab8['query'][_0x7dfa('0x53')]){_0x585348['where']=_['merge'](_0x585348[_0x7dfa('0x51')],{'$or':_[_0x7dfa('0x47')](_0xd90e40,function(_0xcdee20){if(_0xcdee20[_0x7dfa('0x44')]!==_0x7dfa('0x54')){var _0x3a43fc={};_0x3a43fc[_0xcdee20[_0x7dfa('0x3d')]]={'$like':'%'+_0x41eab8[_0x7dfa('0x49')][_0x7dfa('0x53')]+'%'};return _0x3a43fc;}})});}_0x585348=_[_0x7dfa('0x55')]({},_0x585348,_0x41eab8[_0x7dfa('0x56')]);var _0x25d927={'where':_0x585348['where']};return db[_0x7dfa('0x57')]['count'](_0x25d927)[_0x7dfa('0x24')](function(_0xafc169){_0xfab05b[_0x7dfa('0x32')]=_0xafc169;if(_0x41eab8[_0x7dfa('0x49')][_0x7dfa('0x58')]){_0x585348[_0x7dfa('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0x7dfa('0x5a')](_0x585348);})[_0x7dfa('0x24')](function(_0x4bed61){_0xfab05b[_0x7dfa('0x5b')]=_0x4bed61;return _0xfab05b;})['then'](respondWithFilteredResult(_0x33253d,_0x585348))[_0x7dfa('0x2d')](handleError(_0x33253d,null));};exports['show']=function(_0xb93b50,_0xa2f38c){var _0x4ac0d4={'raw':![],'where':{'id':_0xb93b50[_0x7dfa('0x5c')]['id']},'include':[{'model':db[_0x7dfa('0x40')],'as':_0x7dfa('0x41')}]},_0x57ca73={};_0x57ca73['model']=_[_0x7dfa('0x48')](db['FaxAccount'][_0x7dfa('0x42')]);_0x57ca73['query']=_[_0x7dfa('0x48')](_0xb93b50[_0x7dfa('0x49')]);_0x57ca73[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x57ca73[_0x7dfa('0x46')],_0x57ca73[_0x7dfa('0x49')]);_0x4ac0d4[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x57ca73['model'],qs[_0x7dfa('0x4d')](_0xb93b50[_0x7dfa('0x49')]['fields']));_0x4ac0d4[_0x7dfa('0x4c')]=_0x4ac0d4[_0x7dfa('0x4c')]['length']?_0x4ac0d4[_0x7dfa('0x4c')]:_0x57ca73[_0x7dfa('0x46')];if(_0xb93b50['query']['includeAll']){_0x4ac0d4['include']=[{'all':!![]}];}_0x4ac0d4=_[_0x7dfa('0x55')]({},_0x4ac0d4,_0xb93b50[_0x7dfa('0x56')]);return db['FaxAccount'][_0x7dfa('0x5d')](_0x4ac0d4)[_0x7dfa('0x24')](handleEntityNotFound(_0xa2f38c,null))[_0x7dfa('0x24')](respondWithResult(_0xa2f38c,null))['catch'](handleError(_0xa2f38c,null));};exports[_0x7dfa('0x5e')]=function(_0x1956cb,_0x6ca6ca){return db[_0x7dfa('0x57')][_0x7dfa('0x5e')](_0x1956cb[_0x7dfa('0x5f')],{})[_0x7dfa('0x24')](function(_0x5ef9ea){var _0x310781=_0x1956cb[_0x7dfa('0x60')][_0x7dfa('0x39')]({'plain':!![]});if(!_0x310781)throw new Error(_0x7dfa('0x61'));if(_0x310781[_0x7dfa('0x62')]===_0x7dfa('0x60')){var _0x46d9b2=_0x5ef9ea[_0x7dfa('0x39')]({'plain':!![]});var _0x2f53c7='FaxAccounts';return db[_0x7dfa('0x63')]['find']({'where':{'name':_0x2f53c7,'userProfileId':_0x310781[_0x7dfa('0x64')]},'raw':!![]})[_0x7dfa('0x24')](function(_0x1b8990){if(_0x1b8990&&_0x1b8990[_0x7dfa('0x65')]===0x0){return db[_0x7dfa('0x3b')][_0x7dfa('0x5e')]({'name':_0x46d9b2[_0x7dfa('0x3d')],'resourceId':_0x46d9b2['id'],'type':_0x1b8990[_0x7dfa('0x3d')],'sectionId':_0x1b8990['id']},{})[_0x7dfa('0x24')](function(){return _0x5ef9ea;});}else{return _0x5ef9ea;}})[_0x7dfa('0x2d')](function(_0x415076){logger['error'](_0x7dfa('0x66'),_0x415076);throw _0x415076;});}return _0x5ef9ea;})[_0x7dfa('0x24')](respondWithResult(_0x6ca6ca,0xc9))[_0x7dfa('0x2d')](handleError(_0x6ca6ca,null));};exports[_0x7dfa('0x67')]=function(_0x420ed5,_0x8b102c){if(_0x420ed5[_0x7dfa('0x5f')]['id']){delete _0x420ed5[_0x7dfa('0x5f')]['id'];}return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0x420ed5[_0x7dfa('0x5c')]['id']},'include':[{'model':db[_0x7dfa('0x40')],'as':_0x7dfa('0x41')}]})[_0x7dfa('0x24')](handleEntityNotFound(_0x8b102c,null))[_0x7dfa('0x24')](saveUpdates(_0x420ed5[_0x7dfa('0x5f')],null))['then'](respondWithResult(_0x8b102c,null))['catch'](handleError(_0x8b102c,null));};exports[_0x7dfa('0x38')]=function(_0x542e87,_0x1d7523){return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0x542e87[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x1d7523,null))[_0x7dfa('0x24')](removeEntity(_0x1d7523,null))[_0x7dfa('0x2d')](handleError(_0x1d7523,null));};exports[_0x7dfa('0x68')]=function(_0xcf4665,_0x515604){return db[_0x7dfa('0x57')][_0x7dfa('0x68')]()[_0x7dfa('0x24')](respondWithResult(_0x515604,null))[_0x7dfa('0x2d')](handleError(_0x515604,null));};exports[_0x7dfa('0x69')]=function(_0x37c1cf,_0x2c72b4,_0x5b94bb){if(_0x37c1cf['body']['id']){delete _0x37c1cf[_0x7dfa('0x5f')]['id'];}return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0x37c1cf[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x2c72b4,null))[_0x7dfa('0x24')](function(_0x5003b2){if(_0x5003b2){_0x37c1cf['body'][_0x7dfa('0x6a')]=_0x5003b2['id'];return db[_0x7dfa('0x6b')]['create'](_0x37c1cf[_0x7dfa('0x5f')]);}})['then'](respondWithResult(_0x2c72b4,null))[_0x7dfa('0x2d')](handleError(_0x2c72b4,null));};exports[_0x7dfa('0x6c')]=function(_0x4cff9b,_0x2e6d04,_0x5c3004){var _0xf7fa0a={'raw':![],'where':{}};var _0x34d6c6={};var _0x11419b={'count':0x0,'rows':[]};return db[_0x7dfa('0x57')]['findOne']({'where':{'id':_0x4cff9b[_0x7dfa('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e6d04,null))[_0x7dfa('0x24')](function(_0x33de4e){if(_0x33de4e){_0x34d6c6[_0x7dfa('0x46')]=_[_0x7dfa('0x48')](db[_0x7dfa('0x6b')][_0x7dfa('0x42')]);_0x34d6c6[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0x4cff9b['query']);_0x34d6c6[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x34d6c6[_0x7dfa('0x46')],_0x34d6c6[_0x7dfa('0x49')]);_0xf7fa0a[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x34d6c6[_0x7dfa('0x46')],qs[_0x7dfa('0x4d')](_0x4cff9b[_0x7dfa('0x49')][_0x7dfa('0x4d')]));_0xf7fa0a['attributes']=_0xf7fa0a[_0x7dfa('0x4c')]['length']?_0xf7fa0a[_0x7dfa('0x4c')]:_0x34d6c6['model'];if(!_0x4cff9b['query'][_0x7dfa('0x6d')]('nolimit')){_0xf7fa0a[_0x7dfa('0x34')]=qs[_0x7dfa('0x34')](_0x4cff9b[_0x7dfa('0x49')]['limit']);_0xf7fa0a['offset']=qs['offset'](_0x4cff9b[_0x7dfa('0x49')]['offset']);}_0xf7fa0a[_0x7dfa('0x4f')]=qs[_0x7dfa('0x50')](_0x4cff9b[_0x7dfa('0x49')][_0x7dfa('0x50')]);_0xf7fa0a[_0x7dfa('0x51')]=qs[_0x7dfa('0x4a')](_[_0x7dfa('0x52')](_0x4cff9b[_0x7dfa('0x49')],_0x34d6c6[_0x7dfa('0x4a')]));_0xf7fa0a[_0x7dfa('0x51')]['FaxAccountId']=_0x33de4e['id'];if(_0x4cff9b[_0x7dfa('0x49')]['filter']){_0xf7fa0a[_0x7dfa('0x51')]=_[_0x7dfa('0x55')](_0xf7fa0a['where'],{'$or':_['map'](_0xf7fa0a['attributes'],function(_0x3881bb){var _0x619cd9={};_0x619cd9[_0x3881bb]={'$like':'%'+_0x4cff9b[_0x7dfa('0x49')]['filter']+'%'};return _0x619cd9;})});}_0xf7fa0a=_[_0x7dfa('0x55')]({},_0xf7fa0a,_0x4cff9b[_0x7dfa('0x56')]);return db[_0x7dfa('0x6b')]['count']({'where':_0xf7fa0a[_0x7dfa('0x51')]})[_0x7dfa('0x24')](function(_0x2727fd){_0x11419b[_0x7dfa('0x32')]=_0x2727fd;if(_0x4cff9b[_0x7dfa('0x49')][_0x7dfa('0x58')]){_0xf7fa0a['include']=[{'all':!![]}];}return db[_0x7dfa('0x6b')][_0x7dfa('0x5a')](_0xf7fa0a);})[_0x7dfa('0x24')](function(_0xa055){_0x11419b[_0x7dfa('0x5b')]=_0xa055;return _0x11419b;});}})['then'](respondWithFilteredResult(_0x2e6d04,_0xf7fa0a))[_0x7dfa('0x2d')](handleError(_0x2e6d04,null));};exports['removeDispositions']=function(_0x58b30d,_0x149507,_0x387b5c){return db[_0x7dfa('0x57')]['find']({'where':{'id':_0x58b30d[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x149507,null))[_0x7dfa('0x24')](function(_0x464685){if(_0x464685){return _0x464685['removeDispositions'](_0x58b30d[_0x7dfa('0x49')][_0x7dfa('0x6e')]);}})[_0x7dfa('0x24')](respondWithStatusCode(_0x149507,null))['catch'](handleError(_0x149507,null));};exports[_0x7dfa('0x6f')]=function(_0x450005,_0x34bec7,_0x38e414){if(_0x450005['body']['id']){delete _0x450005[_0x7dfa('0x5f')]['id'];}return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0x450005[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x34bec7,null))['then'](function(_0x4f4acb){if(_0x4f4acb){_0x450005[_0x7dfa('0x5f')][_0x7dfa('0x6a')]=_0x4f4acb['id'];return db[_0x7dfa('0x70')]['create'](_0x450005['body']);}})['then'](respondWithResult(_0x34bec7,null))[_0x7dfa('0x2d')](handleError(_0x34bec7,null));};exports['getAnswers']=function(_0x6aff27,_0x296b2d,_0x574bdc){var _0x352026={'raw':![],'where':{}};var _0x2ee464={};var _0x273b99={'count':0x0,'rows':[]};return db[_0x7dfa('0x57')]['findOne']({'where':{'id':_0x6aff27[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x296b2d,null))[_0x7dfa('0x24')](function(_0x58ceef){if(_0x58ceef){_0x2ee464[_0x7dfa('0x46')]=_[_0x7dfa('0x48')](db[_0x7dfa('0x70')][_0x7dfa('0x42')]);_0x2ee464[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0x6aff27[_0x7dfa('0x49')]);_0x2ee464[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x2ee464['model'],_0x2ee464['query']);_0x352026[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x2ee464[_0x7dfa('0x46')],qs[_0x7dfa('0x4d')](_0x6aff27[_0x7dfa('0x49')]['fields']));_0x352026[_0x7dfa('0x4c')]=_0x352026['attributes'][_0x7dfa('0x71')]?_0x352026[_0x7dfa('0x4c')]:_0x2ee464[_0x7dfa('0x46')];if(!_0x6aff27[_0x7dfa('0x49')]['hasOwnProperty'](_0x7dfa('0x4e'))){_0x352026[_0x7dfa('0x34')]=qs[_0x7dfa('0x34')](_0x6aff27[_0x7dfa('0x49')]['limit']);_0x352026['offset']=qs[_0x7dfa('0x33')](_0x6aff27['query'][_0x7dfa('0x33')]);}_0x352026[_0x7dfa('0x4f')]=qs[_0x7dfa('0x50')](_0x6aff27['query'][_0x7dfa('0x50')]);_0x352026['where']=qs[_0x7dfa('0x4a')](_[_0x7dfa('0x52')](_0x6aff27[_0x7dfa('0x49')],_0x2ee464[_0x7dfa('0x4a')]));_0x352026[_0x7dfa('0x51')][_0x7dfa('0x6a')]=_0x58ceef['id'];if(_0x6aff27['query'][_0x7dfa('0x53')]){_0x352026['where']=_[_0x7dfa('0x55')](_0x352026[_0x7dfa('0x51')],{'$or':_[_0x7dfa('0x47')](_0x352026['attributes'],function(_0x35654f){var _0x5c26e9={};_0x5c26e9[_0x35654f]={'$like':'%'+_0x6aff27[_0x7dfa('0x49')][_0x7dfa('0x53')]+'%'};return _0x5c26e9;})});}_0x352026=_[_0x7dfa('0x55')]({},_0x352026,_0x6aff27[_0x7dfa('0x56')]);return db['CannedAnswer']['count']({'where':_0x352026[_0x7dfa('0x51')]})[_0x7dfa('0x24')](function(_0xa2ff0){_0x273b99[_0x7dfa('0x32')]=_0xa2ff0;if(_0x6aff27[_0x7dfa('0x49')][_0x7dfa('0x58')]){_0x352026[_0x7dfa('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7dfa('0x5a')](_0x352026);})[_0x7dfa('0x24')](function(_0x5edbb7){_0x273b99[_0x7dfa('0x5b')]=_0x5edbb7;return _0x273b99;});}})[_0x7dfa('0x24')](respondWithFilteredResult(_0x296b2d,_0x352026))[_0x7dfa('0x2d')](handleError(_0x296b2d,null));};exports[_0x7dfa('0x72')]=function(_0x3e026b,_0x41a0a1,_0x27716a){return db['FaxAccount'][_0x7dfa('0x5d')]({'where':{'id':_0x3e026b[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x41a0a1,null))[_0x7dfa('0x24')](function(_0x115cf8){if(_0x115cf8){return _0x115cf8[_0x7dfa('0x72')](_0x3e026b[_0x7dfa('0x49')][_0x7dfa('0x6e')]);}})['then'](respondWithStatusCode(_0x41a0a1,null))[_0x7dfa('0x2d')](handleError(_0x41a0a1,null));};exports['addInteraction']=function(_0x1a315f,_0x291d16,_0x223d82){return db[_0x7dfa('0x73')][_0x7dfa('0x5d')]({'where':{'id':_0x1a315f[_0x7dfa('0x5c')]['id']}})['then'](handleEntityNotFound(_0x291d16,null))[_0x7dfa('0x24')](function(_0x5e638a){if(_0x5e638a){return _0x5e638a[_0x7dfa('0x74')](_0x1a315f['body'][_0x7dfa('0x6e')],_[_0x7dfa('0x75')](_0x1a315f['body'],[_0x7dfa('0x6e'),'id'])||{});}})[_0x7dfa('0x24')](respondWithResult(_0x291d16,null))[_0x7dfa('0x2d')](handleError(_0x291d16,null));};exports['getInteractions']=function(_0x24366a,_0x310d3f,_0x1ac3c5){var _0x391410={'raw':![],'where':{}};var _0x1550aa={};var _0x2ea373={'count':0x0,'rows':[]};return db[_0x7dfa('0x57')][_0x7dfa('0x76')]({'where':{'id':_0x24366a[_0x7dfa('0x5c')]['id']}})['then'](handleEntityNotFound(_0x310d3f,null))[_0x7dfa('0x24')](function(_0x31bde6){if(_0x31bde6){_0x1550aa[_0x7dfa('0x46')]=_[_0x7dfa('0x48')](db['FaxInteraction'][_0x7dfa('0x42')]);_0x1550aa[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0x24366a[_0x7dfa('0x49')]);_0x1550aa[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x1550aa['model'],_0x1550aa[_0x7dfa('0x49')]);_0x391410['attributes']=_[_0x7dfa('0x4b')](_0x1550aa[_0x7dfa('0x46')],qs[_0x7dfa('0x4d')](_0x24366a['query'][_0x7dfa('0x4d')]));_0x391410[_0x7dfa('0x4c')]=_0x391410[_0x7dfa('0x4c')][_0x7dfa('0x71')]?_0x391410[_0x7dfa('0x4c')]:_0x1550aa[_0x7dfa('0x46')];if(!_0x24366a[_0x7dfa('0x49')]['hasOwnProperty'](_0x7dfa('0x4e'))){_0x391410[_0x7dfa('0x34')]=qs[_0x7dfa('0x34')](_0x24366a['query'][_0x7dfa('0x34')]);_0x391410[_0x7dfa('0x33')]=qs[_0x7dfa('0x33')](_0x24366a[_0x7dfa('0x49')][_0x7dfa('0x33')]);}_0x391410[_0x7dfa('0x4f')]=qs['sort'](_0x24366a[_0x7dfa('0x49')][_0x7dfa('0x50')]);_0x391410[_0x7dfa('0x51')]=qs['filters'](_['pick'](_0x24366a[_0x7dfa('0x49')],_0x1550aa[_0x7dfa('0x4a')]));_0x391410[_0x7dfa('0x51')]['FaxAccountId']=_0x31bde6['id'];if(_0x24366a[_0x7dfa('0x49')]['filter']){_0x391410[_0x7dfa('0x51')]=_[_0x7dfa('0x55')](_0x391410[_0x7dfa('0x51')],{'$or':_['map'](_0x391410[_0x7dfa('0x4c')],function(_0x13e7dd){var _0x45d3b7={};_0x45d3b7[_0x13e7dd]={'$like':'%'+_0x24366a[_0x7dfa('0x49')]['filter']+'%'};return _0x45d3b7;})});}_0x391410=_[_0x7dfa('0x55')]({},_0x391410,_0x24366a[_0x7dfa('0x56')]);return db['FaxInteraction']['count']({'where':_0x391410[_0x7dfa('0x51')]})[_0x7dfa('0x24')](function(_0x496fac){_0x2ea373[_0x7dfa('0x32')]=_0x496fac;if(_0x24366a['query'][_0x7dfa('0x58')]){_0x391410[_0x7dfa('0x59')]=[{'model':db['CmContact'],'as':_0x7dfa('0x77'),'required':![]},{'model':db[_0x7dfa('0x78')],'as':_0x7dfa('0x79'),'attributes':[_0x7dfa('0x3d'),_0x7dfa('0x7a'),_0x7dfa('0x7b')],'required':![]},{'model':db[_0x7dfa('0x7c')],'as':'Tags','attributes':['id','name','color'],'where':_0x24366a[_0x7dfa('0x49')]['tag']?{'id':_0x24366a[_0x7dfa('0x49')][_0x7dfa('0x7d')]}:undefined,'required':_0x24366a['query'][_0x7dfa('0x7d')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x391410);})[_0x7dfa('0x24')](function(_0xf74b77){_0x2ea373[_0x7dfa('0x5b')]=_0xf74b77;return _0x2ea373;});}})[_0x7dfa('0x24')](respondWithFilteredResult(_0x310d3f,_0x391410))[_0x7dfa('0x2d')](handleError(_0x310d3f,null));};exports[_0x7dfa('0x7e')]=function(_0x1dab3c,_0x4267e9){var _0x5ca078=_0x1dab3c[_0x7dfa('0x5c')]['id'];var _0x580d91=_0x1dab3c['body'];var _0x538f6d=0xc8;var _0x288936=null;return db[_0x7dfa('0x7f')][_0x7dfa('0x80')]({'isolationLevel':db[_0x7dfa('0x7f')]['Transaction'][_0x7dfa('0x81')][_0x7dfa('0x82')]},function(_0x3c5d4f){return db[_0x7dfa('0x57')]['findOne']({'where':{'id':_0x5ca078},'transaction':_0x3c5d4f})[_0x7dfa('0x24')](function(_0x34a80c){if(_0x34a80c){return db['FaxApplication'][_0x7dfa('0x38')]({'where':{'FaxAccountId':_0x5ca078},'transaction':_0x3c5d4f})[_0x7dfa('0x24')](function(){var _0x2943e4=_['map'](_0x580d91,function(_0x6ca45a){_0x6ca45a[_0x7dfa('0x6a')]=_0x5ca078;return _0x6ca45a;});return db[_0x7dfa('0x83')]['bulkCreate'](_0x2943e4,{'transaction':_0x3c5d4f});});}else{_0x538f6d=0x194;_0x288936=[];}});})['then'](function(){if(_0x538f6d!==0x194){return db[_0x7dfa('0x83')][_0x7dfa('0x84')]({'where':{'FaxAccountId':_0x5ca078},'order':'priority'})[_0x7dfa('0x24')](function(_0x5121be){_0x288936=_0x5121be;});}})[_0x7dfa('0x2d')](function(_0x2450f2){_0x538f6d=0x1f4;logger[_0x7dfa('0x29')](_0x2450f2['stack']);if(_0x2450f2[_0x7dfa('0x3d')]){delete _0x2450f2[_0x7dfa('0x3d')];}_0x288936=_0x2450f2;})['finally'](function(){if(_0x288936===null){_0x4267e9['sendStatus'](_0x538f6d);}else{if(_0x538f6d===0x1f4){_0x4267e9[_0x7dfa('0x2f')](_0x538f6d)[_0x7dfa('0x3e')](_0x288936);}else{_0x4267e9[_0x7dfa('0x2f')](_0x538f6d)[_0x7dfa('0x30')](_0x288936);}}});};exports[_0x7dfa('0x85')]=function(_0x2592dc,_0x279414,_0x5f27da){var _0xc83c31={};var _0x50ba05={};var _0x314bd7;var _0x1b0569;return db[_0x7dfa('0x57')][_0x7dfa('0x76')]({'where':{'id':_0x2592dc[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x279414,null))['then'](function(_0x21f667){if(_0x21f667){_0x314bd7=_0x21f667;_0x50ba05['model']=_[_0x7dfa('0x48')](db[_0x7dfa('0x83')][_0x7dfa('0x42')]);_0x50ba05[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0x2592dc[_0x7dfa('0x49')]);_0x50ba05[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x50ba05[_0x7dfa('0x46')],_0x50ba05[_0x7dfa('0x49')]);_0xc83c31[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x50ba05['model'],qs[_0x7dfa('0x4d')](_0x2592dc[_0x7dfa('0x49')][_0x7dfa('0x4d')]));_0xc83c31[_0x7dfa('0x4c')]=_0xc83c31[_0x7dfa('0x4c')][_0x7dfa('0x71')]?_0xc83c31[_0x7dfa('0x4c')]:_0x50ba05[_0x7dfa('0x46')];_0xc83c31[_0x7dfa('0x4f')]=qs['sort'](_0x2592dc[_0x7dfa('0x49')]['sort']);_0xc83c31['where']=qs[_0x7dfa('0x4a')](_['pick'](_0x2592dc[_0x7dfa('0x49')],_0x50ba05[_0x7dfa('0x4a')]));if(_0x2592dc[_0x7dfa('0x49')][_0x7dfa('0x53')]){_0xc83c31['where']=_[_0x7dfa('0x55')](_0xc83c31[_0x7dfa('0x51')],{'$or':_['map'](_0xc83c31[_0x7dfa('0x4c')],function(_0x51c30b){var _0xa68f32={};_0xa68f32[_0x51c30b]={'$like':'%'+_0x2592dc[_0x7dfa('0x49')][_0x7dfa('0x53')]+'%'};return _0xa68f32;})});}_0xc83c31=_[_0x7dfa('0x55')]({},_0xc83c31,_0x2592dc['options']);return _0x314bd7['getApplications'](_0xc83c31);}})[_0x7dfa('0x24')](function(_0x4ab2b5){if(_0x4ab2b5){_0x1b0569=_0x4ab2b5[_0x7dfa('0x71')];if(!_0x2592dc[_0x7dfa('0x49')][_0x7dfa('0x6d')](_0x7dfa('0x4e'))){_0xc83c31[_0x7dfa('0x34')]=qs[_0x7dfa('0x34')](_0x2592dc['query'][_0x7dfa('0x34')]);_0xc83c31[_0x7dfa('0x33')]=qs[_0x7dfa('0x33')](_0x2592dc['query']['offset']);}return _0x314bd7[_0x7dfa('0x85')](_0xc83c31);}})[_0x7dfa('0x24')](function(_0xb54f6a){if(_0xb54f6a){return _0xb54f6a?{'count':_0x1b0569,'rows':_0xb54f6a}:null;}})[_0x7dfa('0x24')](respondWithResult(_0x279414,null))[_0x7dfa('0x2d')](handleError(_0x279414,null));};function Extension(_0x1d8bd1,_0xe95f5d,_0x18b932,_0xa6dc0c){this['context']=_0x7dfa('0x86');this[_0x7dfa('0x87')]=_0x1d8bd1[_0x7dfa('0x88')];this['app']=_0xa6dc0c;this['type']=_0x7dfa('0x89');this[_0x7dfa('0x8a')]='Fax\x20Extension';this['FaxAccountId']=_0x1d8bd1['id'];this['priority']=_0xe95f5d;this[_0x7dfa('0x8b')]=_0x18b932;}function createExtensionsReciveFax(_0x1d8f1a){var _0x449393=0x1;var _0x1b52a4=[];_0x1b52a4[_0x7dfa('0x8c')](new Extension(_0x1d8f1a,_0x449393,'',_0x7dfa('0x8d')));_0x449393+=0x1;_0x1b52a4[_0x7dfa('0x8c')](new Extension(_0x1d8f1a,_0x449393,_0x7dfa('0x8e'),'Set'));_0x449393+=0x1;for(var _0x54980e in _0x1d8f1a){if(_0x1d8f1a[_0x7dfa('0x6d')](_0x54980e)&&(_0x54980e===_0x7dfa('0x8f')||_0x54980e===_0x7dfa('0x88')||_0x54980e===_0x7dfa('0x90')||_0x54980e==='faxdetect'||_0x54980e===_0x7dfa('0x91')||_0x54980e===_0x7dfa('0x92')||_0x54980e===_0x7dfa('0x93')||_0x54980e===_0x7dfa('0x94')||_0x54980e===_0x7dfa('0x95'))){_0x1b52a4[_0x7dfa('0x8c')](new Extension(_0x1d8f1a,_0x449393,_0x7dfa('0x96')+_0x54980e+')='+_0x1d8f1a[_0x54980e],_0x7dfa('0x97')));_0x449393+=0x1;}}_0x1b52a4[_0x7dfa('0x8c')](new Extension(_0x1d8f1a,_0x449393,'6','Wait'));_0x449393+=0x1;_0x1b52a4[_0x7dfa('0x8c')](new Extension(_0x1d8f1a,_0x449393,_0x7dfa('0x98'),_0x7dfa('0x99')));_0x449393=0x0;return _0x1b52a4;}exports[_0x7dfa('0x9a')]=function(_0x108db4,_0x137829,_0x3e48db){var _0x3c84a4;return db[_0x7dfa('0x7f')]['transaction'](function(_0x548b46){return db['FaxAccount']['create'](_0x108db4[_0x7dfa('0x5f')],{'transaction':_0x548b46})[_0x7dfa('0x24')](function(_0x2b8e65){_0x3c84a4=_0x2b8e65[_0x7dfa('0x39')]({'plain':!![]});return db[_0x7dfa('0x9b')][_0x7dfa('0x9c')](createExtensionsReciveFax(_0x3c84a4),{'transaction':_0x548b46});});})['then'](function(){return _0x3c84a4;})[_0x7dfa('0x24')](respondWithResult(_0x137829,null))['catch'](handleError(_0x137829,null));};exports[_0x7dfa('0x9d')]=function(_0x25e92b,_0x2df968,_0x11a9ef){var _0x2a9a1e;return db['sequelize']['transaction'](function(_0x256855){return db[_0x7dfa('0x57')][_0x7dfa('0x67')](_0x25e92b[_0x7dfa('0x5f')],{'where':{'id':_0x25e92b[_0x7dfa('0x5f')]['id']},'transaction':_0x256855})[_0x7dfa('0x24')](function(_0x52f5fe){return db['VoiceExtension'][_0x7dfa('0x38')]({'where':{'FaxAccountId':_0x25e92b[_0x7dfa('0x5f')]['id']},'transaction':_0x256855})[_0x7dfa('0x24')](function(_0x320c8b){return db['VoiceExtension'][_0x7dfa('0x9c')](createExtensionsReciveFax(_[_0x7dfa('0x75')](_0x25e92b[_0x7dfa('0x5f')],[_0x7dfa('0x9e'),_0x7dfa('0x45'),'createdAt',_0x7dfa('0x9f'),_0x7dfa('0xa0'),_0x7dfa('0xa1')])),{'transaction':_0x256855});});});})[_0x7dfa('0x24')](function(){return db[_0x7dfa('0x57')][_0x7dfa('0xa2')](_0x25e92b[_0x7dfa('0x5f')]['id']);})['then'](respondWithResult(_0x2df968,null))['catch'](handleError(_0x2df968,null));};exports[_0x7dfa('0xa3')]=function(_0x21bfff,_0x344623,_0x728ab1){var _0x1e9302={'raw':!![],'where':{}};var _0x56dd37={};var _0x49fc64={'count':0x0,'rows':[]};return db[_0x7dfa('0x57')]['findOne']({'where':{'id':_0x21bfff[_0x7dfa('0x5c')]['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x344623,null))[_0x7dfa('0x24')](function(_0x1444e1){if(_0x1444e1){_0x56dd37['model']=_[_0x7dfa('0x48')](db['FaxMessage']['rawAttributes']);_0x56dd37[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0x21bfff[_0x7dfa('0x49')]);_0x56dd37[_0x7dfa('0x4a')]=_[_0x7dfa('0x4b')](_0x56dd37[_0x7dfa('0x46')],_0x56dd37['query']);_0x1e9302[_0x7dfa('0x4c')]=_['intersection'](_0x56dd37[_0x7dfa('0x46')],qs[_0x7dfa('0x4d')](_0x21bfff[_0x7dfa('0x49')]['fields']));_0x1e9302[_0x7dfa('0x4c')]=_0x1e9302[_0x7dfa('0x4c')][_0x7dfa('0x71')]?_0x1e9302[_0x7dfa('0x4c')]:_0x56dd37['model'];if(!_0x21bfff['query'][_0x7dfa('0x6d')](_0x7dfa('0x4e'))){_0x1e9302[_0x7dfa('0x34')]=qs['limit'](_0x21bfff[_0x7dfa('0x49')][_0x7dfa('0x34')]);_0x1e9302[_0x7dfa('0x33')]=qs[_0x7dfa('0x33')](_0x21bfff['query']['offset']);}_0x1e9302[_0x7dfa('0x4f')]=qs[_0x7dfa('0x50')](_0x21bfff[_0x7dfa('0x49')]['sort']);_0x1e9302[_0x7dfa('0x51')]=qs[_0x7dfa('0x4a')](_[_0x7dfa('0x52')](_0x21bfff[_0x7dfa('0x49')],_0x56dd37[_0x7dfa('0x4a')]));_0x1e9302['where'][_0x7dfa('0x6a')]=_0x1444e1['id'];if(_0x21bfff[_0x7dfa('0x49')]['filter']){_0x1e9302[_0x7dfa('0x51')]=_[_0x7dfa('0x55')](_0x1e9302[_0x7dfa('0x51')],{'$or':_['map'](_0x1e9302['attributes'],function(_0x475d8d){var _0x3ae7e0={};_0x3ae7e0[_0x475d8d]={'$like':'%'+_0x21bfff[_0x7dfa('0x49')][_0x7dfa('0x53')]+'%'};return _0x3ae7e0;})});}if(_0x21bfff[_0x7dfa('0x49')][_0x7dfa('0xa4')]){var _0x2790f2=_0x21bfff[_0x7dfa('0x49')][_0x7dfa('0xa4')][_0x7dfa('0xa5')](',');var _0x30637c={};_0x30637c[_0x2790f2[0x0]]={'$gte':moment(_0x2790f2[0x1])[_0x7dfa('0xa6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1e9302['where']=_[_0x7dfa('0x55')](_0x1e9302[_0x7dfa('0x51')],_0x30637c);}_0x1e9302=_[_0x7dfa('0x55')]({},_0x1e9302,_0x21bfff[_0x7dfa('0x56')]);return db[_0x7dfa('0xa7')][_0x7dfa('0x32')]({'where':_0x1e9302['where']})[_0x7dfa('0x24')](function(_0x138c45){_0x49fc64['count']=_0x138c45;if(_0x21bfff[_0x7dfa('0x49')][_0x7dfa('0x58')]){_0x1e9302[_0x7dfa('0x59')]=[{'all':!![]}];}return db[_0x7dfa('0xa7')][_0x7dfa('0x5a')](_0x1e9302);})[_0x7dfa('0x24')](function(_0x34e81b){_0x49fc64['rows']=_0x34e81b;return _0x49fc64;});}})[_0x7dfa('0x24')](respondWithFilteredResult(_0x344623,_0x1e9302))['catch'](handleError(_0x344623,null));};exports[_0x7dfa('0x3e')]=function(_0xd6a71c,_0x4345b5,_0x27d266){var _0x23f2ff,_0x49d29a={},_0x2a93b1;if(_0xd6a71c[_0x7dfa('0x5f')]['to']){_0x2a93b1=_0xd6a71c['body']['to'][0x0];}return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0xd6a71c[_0x7dfa('0x5c')]['id']},'include':[{'model':db[_0x7dfa('0xa8')],'as':_0x7dfa('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x2a93b1},'limit':0x1,'order':[[_0x7dfa('0x9f'),_0x7dfa('0xaa')]]}]}]})[_0x7dfa('0x24')](handleEntityNotFound(_0x4345b5,null))['then'](function(_0x4187f9){_0x23f2ff=_0x4187f9;if(_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')]&&_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')]['length']){for(var _0x2555ba=0x0;_0x2555ba<_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][_0x7dfa('0x71')];_0x2555ba+=0x1){_0xd6a71c['body'][_0x7dfa('0xab')][_0x2555ba]={'filename':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][_0x2555ba]['name'],'id':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][_0x2555ba]['id'],'path':path['join'](config[_0x7dfa('0xac')],'server/files/attachments',_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][_0x2555ba][_0x7dfa('0xad')])};}}return respondWithRpcPromise(_0x7dfa('0xae'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0xd6a71c[_0x7dfa('0x5c')]['id'])?undefined:_0xd6a71c[_0x7dfa('0x5c')]['id'],'path':_[_0x7dfa('0xaf')](_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][0x0][_0x7dfa('0x8')])?undefined:_0xd6a71c[_0x7dfa('0x5f')]['attachments'][0x0][_0x7dfa('0x8')],'fax':_[_0x7dfa('0xaf')](_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0])?undefined:_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0]},client9002);})[_0x7dfa('0x24')](function(){if(_0x23f2ff){if(_[_0x7dfa('0xaf')](_0xd6a71c['body'][_0x7dfa('0xb0')])){_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xb0')]=util[_0x7dfa('0xa6')](_0x7dfa('0xb1'),_0x23f2ff[_0x7dfa('0x3d')],_0x23f2ff[_0x7dfa('0xb2')]);}if(_0x23f2ff[_0x7dfa('0xa9')]){if(_0x23f2ff[_0x7dfa('0xa9')]['Contacts'][_0x7dfa('0x71')]){return _0x23f2ff[_0x7dfa('0xa9')][_0x7dfa('0xb3')][0x0];}else{return db['CmContact']['create'](_[_0x7dfa('0xb4')](_0xd6a71c[_0x7dfa('0x5f')],{'firstName':_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0],'phone':_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0],'fax':_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0],'ListId':_0x23f2ff[_0x7dfa('0xa1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x7dfa('0xb5'));}})['then'](function(_0x536d4f){if(_0x536d4f){return db[_0x7dfa('0x73')][_0x7dfa('0x5d')]({'where':{'ContactId':_0x536d4f['id'],'closed':![],'FaxAccountId':_0x23f2ff['id']}})[_0x7dfa('0x24')](function(_0x56051d){if(_0x56051d){return[_0x56051d,![]];}return db['FaxInteraction'][_0x7dfa('0x5e')]({'UserId':_0xd6a71c[_0x7dfa('0x60')]['id'],'ContactId':_0x536d4f['id'],'FaxAccountId':_0x23f2ff['id'],'fax':_0xd6a71c['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x7dfa('0x55')](_0xd6a71c[_0x7dfa('0x5f')],{'read':![],'body':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][0x0]['filename'],'FaxAccountId':_0x23f2ff['id'],'UserId':_0xd6a71c[_0x7dfa('0x60')]['id'],'ContactId':_0x536d4f['id'],'AttachmentId':_0xd6a71c['body'][_0x7dfa('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x7dfa('0xa7')],'as':_0x7dfa('0xb6')}]})['then'](function(_0x7d2840){return[_0x7d2840,!![]];});});}else{throw new Error(_0x7dfa('0xb7'));}})[_0x7dfa('0xb8')](function(_0x3ec167,_0x534ffd){if(_0x534ffd){return _0x3ec167;}return db['FaxMessage'][_0x7dfa('0x5e')]({'direction':_0x7dfa('0xb9'),'read':![],'body':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][0x0][_0x7dfa('0xba')],'FaxAccountId':_0x23f2ff['id'],'FaxInteractionId':_0x3ec167['id'],'UserId':_0xd6a71c['user']['id'],'ContactId':_0x3ec167[_0x7dfa('0xbb')],'AttachmentId':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][0x0]['id']})[_0x7dfa('0x24')](function(_0x4a9d96){_0x3ec167['dataValues']['Messages']=[];_0x3ec167[_0x7dfa('0xbc')][_0x7dfa('0xb6')][_0x7dfa('0x8c')](_0x4a9d96['dataValues']);return _0x3ec167;});})['then'](function(_0x4fca01){respondWithRpcPromise('SendFax',_0x7dfa('0xbd'),{'FaxAccountId':_[_0x7dfa('0xaf')](_0xd6a71c[_0x7dfa('0x5c')]['id'])?undefined:_0xd6a71c[_0x7dfa('0x5c')]['id'],'path':_['isNil'](_0xd6a71c[_0x7dfa('0x5f')]['attachments'][0x0][_0x7dfa('0x8')])?undefined:_0xd6a71c['body'][_0x7dfa('0xab')][0x0][_0x7dfa('0x8')],'fax':_[_0x7dfa('0xaf')](_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0])?undefined:_0xd6a71c[_0x7dfa('0x5f')]['to'][0x0],'AttachmentId':_0xd6a71c[_0x7dfa('0x5f')][_0x7dfa('0xab')][0x0]['id']},client9002)[_0x7dfa('0x24')](function(_0x437108){logger[_0x7dfa('0x2b')](_0x7dfa('0xbe'),_0x437108);})[_0x7dfa('0x2d')](function(_0xe1274e){logger['info'](_0x7dfa('0xbe'),_0xe1274e);});return _0x4fca01;})[_0x7dfa('0x24')](respondWithResult(_0x4345b5,null))[_0x7dfa('0x2d')](handleError(_0x4345b5,null));};exports[_0x7dfa('0xbf')]=function(_0x512974,_0x26d449,_0x57f538){return db[_0x7dfa('0x57')][_0x7dfa('0x5d')]({'where':{'id':_0x512974[_0x7dfa('0x5c')]['id']}})['then'](handleEntityNotFound(_0x26d449,null))['then'](function(_0x4c9e74){if(_0x4c9e74){return _0x4c9e74[_0x7dfa('0xbf')](_0x512974[_0x7dfa('0x5f')]['ids'],_[_0x7dfa('0x75')](_0x512974['body'],[_0x7dfa('0x6e'),'id'])||{})[_0x7dfa('0xb8')](function(_0x33b52a){for(var _0x37261c=0x0;_0x37261c<_0x512974[_0x7dfa('0x5f')][_0x7dfa('0x6e')][_0x7dfa('0x71')];_0x37261c+=0x1){socket[_0x7dfa('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x512974[_0x7dfa('0x5f')][_0x7dfa('0x6e')][_0x37261c]),'FaxAccountId':Number(_0x512974[_0x7dfa('0x5c')]['id'])});}return _0x33b52a;});}})[_0x7dfa('0x24')](respondWithResult(_0x26d449,null))[_0x7dfa('0x2d')](handleError(_0x26d449,null));};exports[_0x7dfa('0xc1')]=function(_0x100b12,_0x296f3a,_0x43c38f){return db['FaxAccount'][_0x7dfa('0x5d')]({'where':{'id':_0x100b12['params']['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x296f3a,null))[_0x7dfa('0x24')](function(_0x3f4147){if(_0x3f4147){return _0x3f4147['removeAgents'](_0x100b12[_0x7dfa('0x49')][_0x7dfa('0x6e')])['then'](function(){if(_['isArray'](_0x100b12[_0x7dfa('0x49')][_0x7dfa('0x6e')])){for(var _0x1ce877=0x0;_0x1ce877<_0x100b12[_0x7dfa('0x49')][_0x7dfa('0x6e')][_0x7dfa('0x71')];_0x1ce877+=0x1){socket['emit'](_0x7dfa('0xc2'),{'UserId':Number(_0x100b12[_0x7dfa('0x49')][_0x7dfa('0x6e')][_0x1ce877]),'FaxAccountId':Number(_0x100b12[_0x7dfa('0x5c')]['id'])});}}else{socket[_0x7dfa('0xc0')](_0x7dfa('0xc2'),{'UserId':Number(_0x100b12['query'][_0x7dfa('0x6e')]),'FaxAccountId':Number(_0x100b12['params']['id'])});}});}})[_0x7dfa('0x24')](respondWithStatusCode(_0x296f3a,null))['catch'](handleError(_0x296f3a,null));};exports['getAgents']=function(_0xc93acf,_0x5870ef,_0x55eb13){var _0x50a03e={};var _0x5cbcd0={};var _0x422846;var _0x4620ba;return db[_0x7dfa('0x57')][_0x7dfa('0x76')]({'where':{'id':_0xc93acf['params']['id']}})[_0x7dfa('0x24')](handleEntityNotFound(_0x5870ef,null))['then'](function(_0x17be27){if(_0x17be27){_0x422846=_0x17be27;_0x5cbcd0[_0x7dfa('0x46')]=_[_0x7dfa('0x48')](db['User'][_0x7dfa('0x42')]);_0x5cbcd0[_0x7dfa('0x49')]=_[_0x7dfa('0x48')](_0xc93acf[_0x7dfa('0x49')]);_0x5cbcd0[_0x7dfa('0x4a')]=_['intersection'](_0x5cbcd0[_0x7dfa('0x46')],_0x5cbcd0[_0x7dfa('0x49')]);_0x50a03e[_0x7dfa('0x4c')]=_[_0x7dfa('0x4b')](_0x5cbcd0[_0x7dfa('0x46')],qs['fields'](_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x4d')]));_0x50a03e[_0x7dfa('0x4c')]=_0x50a03e['attributes'][_0x7dfa('0x71')]?_0x50a03e[_0x7dfa('0x4c')]:_0x5cbcd0[_0x7dfa('0x46')];_0x50a03e[_0x7dfa('0x4f')]=qs[_0x7dfa('0x50')](_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x50')]);_0x50a03e[_0x7dfa('0x51')]=qs[_0x7dfa('0x4a')](_[_0x7dfa('0x52')](_0xc93acf['query'],_0x5cbcd0[_0x7dfa('0x4a')]));if(_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x53')]){_0x50a03e[_0x7dfa('0x51')]=_[_0x7dfa('0x55')](_0x50a03e[_0x7dfa('0x51')],{'$or':_['map'](_0x50a03e[_0x7dfa('0x4c')],function(_0x2a0c93){var _0x4c0987={};_0x4c0987[_0x2a0c93]={'$like':'%'+_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x53')]+'%'};return _0x4c0987;})});}_0x50a03e=_[_0x7dfa('0x55')]({},_0x50a03e,_0xc93acf[_0x7dfa('0x56')]);return _0x422846[_0x7dfa('0xc3')](_0x50a03e);}})['then'](function(_0x2d126e){if(_0x2d126e){_0x4620ba=_0x2d126e[_0x7dfa('0x71')];if(!_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x6d')](_0x7dfa('0x4e'))){_0x50a03e[_0x7dfa('0x34')]=qs[_0x7dfa('0x34')](_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x34')]);_0x50a03e[_0x7dfa('0x33')]=qs[_0x7dfa('0x33')](_0xc93acf[_0x7dfa('0x49')][_0x7dfa('0x33')]);}return _0x422846['getAgents'](_0x50a03e);}})['then'](function(_0x11cb2f){if(_0x11cb2f){return _0x11cb2f?{'count':_0x4620ba,'rows':_0x11cb2f}:null;}})[_0x7dfa('0x24')](respondWithResult(_0x5870ef,null))[_0x7dfa('0x2d')](handleError(_0x5870ef,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 27799c8..8db1c6b 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 _0x1bae=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x1bae,0xa4));var _0xe1ba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1bae[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe1ba('0x0'));var FaxAccount=require(_0xe1ba('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe1ba('0x2')](0x0);var events={'afterCreate':_0xe1ba('0x3'),'afterUpdate':_0xe1ba('0x4'),'afterDestroy':_0xe1ba('0x5')};function emitEvent(_0x19ba60){return function(_0x1eaab4,_0x5bc4ad,_0x464c95){FaxAccountEvents[_0xe1ba('0x6')](_0x19ba60+':'+_0x1eaab4['id'],_0x1eaab4);FaxAccountEvents['emit'](_0x19ba60,_0x1eaab4);_0x464c95(null);};}for(var e in events){if(events[_0xe1ba('0x7')](e)){var event=events[e];FaxAccount[_0xe1ba('0x8')](e,emitEvent(event));}}module[_0xe1ba('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x3111=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x4755ac,_0x56f72b){var _0x929125=function(_0x36f386){while(--_0x36f386){_0x4755ac['push'](_0x4755ac['shift']());}};_0x929125(++_0x56f72b);}(_0x3111,0x9f));var _0x1311=function(_0x390f85,_0x49c796){_0x390f85=_0x390f85-0x0;var _0x163544=_0x3111[_0x390f85];return _0x163544;};'use strict';var EventEmitter=require(_0x1311('0x0'));var FaxAccount=require(_0x1311('0x1'))['db'][_0x1311('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1311('0x3')](0x0);var events={'afterCreate':_0x1311('0x4'),'afterUpdate':_0x1311('0x5'),'afterDestroy':_0x1311('0x6')};function emitEvent(_0x27e7ca){return function(_0x3a5fe5,_0x35b5a4,_0x469806){FaxAccountEvents['emit'](_0x27e7ca+':'+_0x3a5fe5['id'],_0x3a5fe5);FaxAccountEvents[_0x1311('0x7')](_0x27e7ca,_0x3a5fe5);_0x469806(null);};}for(var e in events){if(events[_0x1311('0x8')](e)){var event=events[e];FaxAccount[_0x1311('0x9')](e,emitEvent(event));}}module[_0x1311('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 6d1f310..5df6c7e 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 _0x018a=['exports','define','FaxAccount','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x018a,0xf3));var _0xa018=function(_0x42ad47,_0x2439b1){_0x42ad47=_0x42ad47-0x0;var _0x53cadd=_0x018a[_0x42ad47];return _0x53cadd;};'use strict';var _=require(_0xa018('0x0'));var util=require(_0xa018('0x1'));var logger=require(_0xa018('0x2'))(_0xa018('0x3'));var moment=require(_0xa018('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa018('0x5'));var rimraf=require(_0xa018('0x6'));var config=require(_0xa018('0x7'));var attributes=require(_0xa018('0x8'));module[_0xa018('0x9')]=function(_0x547df9,_0x4760f0){return _0x547df9[_0xa018('0xa')](_0xa018('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0f8=['fax_accounts','lodash','util','api','moment','request-promise','rimraf','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xe0f8,0x14b));var _0x8e0f=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe0f8[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x8e0f('0x0'));var util=require(_0x8e0f('0x1'));var logger=require('../../config/logger')(_0x8e0f('0x2'));var moment=require(_0x8e0f('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e0f('0x5'));var config=require('../../config/environment');var attributes=require(_0x8e0f('0x6'));module[_0x8e0f('0x7')]=function(_0x538293,_0x2dfa94){return _0x538293[_0x8e0f('0x8')](_0x8e0f('0x9'),attributes,{'tableName':_0x8e0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 98264cd..8e71d20 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 _0xb3b4=['agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','map','include','model','then','GetFaxAccount','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','ContactId','UserId'];(function(_0x59d4d0,_0x504513){var _0x166a02=function(_0xcf34f6){while(--_0xcf34f6){_0x59d4d0['push'](_0x59d4d0['shift']());}};_0x166a02(++_0x504513);}(_0xb3b4,0x1b8));var _0x4b3b=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xb3b4[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x4b3b('0x0'));var util=require('util');var moment=require(_0x4b3b('0x1'));var BPromise=require(_0x4b3b('0x2'));var rs=require(_0x4b3b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b3b('0x4'))['db'];var utils=require(_0x4b3b('0x5'));var logger=require(_0x4b3b('0x6'))(_0x4b3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b3b('0x8'));var client=jayson[_0x4b3b('0x9')][_0x4b3b('0xa')]({'port':0x232c});config[_0x4b3b('0xb')]=_[_0x4b3b('0xc')](config[_0x4b3b('0xb')],{'host':_0x4b3b('0xd'),'port':0x18eb});var socket=require(_0x4b3b('0xe'))(new Redis(config[_0x4b3b('0xb')]));require(_0x4b3b('0xf'))[_0x4b3b('0x10')](socket);function respondWithRpcPromise(_0x190a7e,_0x57bb49,_0x42fa60){return new BPromise(function(_0x145860,_0x557963){return client['request'](_0x190a7e,_0x42fa60)['then'](function(_0x1bb4ed){logger[_0x4b3b('0x11')]('FaxAccount,\x20%s,\x20%s',_0x57bb49,'request\x20sent');logger[_0x4b3b('0x12')](_0x4b3b('0x13'),_0x57bb49,_0x4b3b('0x14'),JSON[_0x4b3b('0x15')](_0x1bb4ed));if(_0x1bb4ed['error']){if(_0x1bb4ed[_0x4b3b('0x16')][_0x4b3b('0x17')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x57bb49,_0x1bb4ed[_0x4b3b('0x16')]['message']);return _0x557963(_0x1bb4ed[_0x4b3b('0x16')]['message']);}logger[_0x4b3b('0x16')](_0x4b3b('0x18'),_0x57bb49,_0x1bb4ed[_0x4b3b('0x16')]['message']);return _0x145860(_0x1bb4ed['error'][_0x4b3b('0x19')]);}else{logger['info'](_0x4b3b('0x18'),_0x57bb49,_0x4b3b('0x14'));_0x145860(_0x1bb4ed[_0x4b3b('0x1a')][_0x4b3b('0x19')]);}})[_0x4b3b('0x1b')](function(_0x1a7413){logger[_0x4b3b('0x16')]('FaxAccount,\x20%s,\x20%s',_0x57bb49,_0x1a7413);_0x557963(_0x1a7413);});});}exports['GetFaxAccount']=function(_0x2514e1){var _0x105c7d=this;return new Promise(function(_0x3d068b,_0x141919){return db['FaxAccount'][_0x4b3b('0x1c')]({'raw':_0x2514e1['options']?_0x2514e1[_0x4b3b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2514e1[_0x4b3b('0x1d')]?_0x2514e1[_0x4b3b('0x1d')][_0x4b3b('0x1e')]||null:null,'attributes':_0x2514e1['options']?_0x2514e1[_0x4b3b('0x1d')][_0x4b3b('0x1f')]||null:null,'limit':_0x2514e1['options']?_0x2514e1[_0x4b3b('0x1d')]['limit']||null:null,'include':_0x2514e1[_0x4b3b('0x1d')]?_0x2514e1[_0x4b3b('0x1d')]['include']?_[_0x4b3b('0x20')](_0x2514e1['options'][_0x4b3b('0x21')],function(_0x36c094){return{'model':db[_0x36c094[_0x4b3b('0x22')]],'as':_0x36c094['as'],'attributes':_0x36c094['attributes'],'include':_0x36c094[_0x4b3b('0x21')]?_['map'](_0x36c094[_0x4b3b('0x21')],function(_0x30c61a){return{'model':db[_0x30c61a[_0x4b3b('0x22')]],'as':_0x30c61a['as'],'attributes':_0x30c61a[_0x4b3b('0x1f')],'include':_0x30c61a['include']?_[_0x4b3b('0x20')](_0x30c61a[_0x4b3b('0x21')],function(_0x3f73cd){return{'model':db[_0x3f73cd[_0x4b3b('0x22')]],'as':_0x3f73cd['as'],'attributes':_0x3f73cd[_0x4b3b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4b3b('0x23')](function(_0x425bb2){logger[_0x4b3b('0x11')](_0x4b3b('0x24'),_0x2514e1);logger[_0x4b3b('0x12')](_0x4b3b('0x24'),_0x2514e1,JSON[_0x4b3b('0x15')](_0x425bb2));_0x3d068b(_0x425bb2);})['catch'](function(_0x1027ff){logger[_0x4b3b('0x16')]('GetFaxAccount',_0x1027ff[_0x4b3b('0x19')],_0x2514e1);_0x141919(_0x105c7d[_0x4b3b('0x16')](0x1f4,_0x1027ff[_0x4b3b('0x19')]));});});};exports[_0x4b3b('0x25')]=function(_0xb1829e,_0x5486e8,_0x4f5233){var _0x562704=this;return new Promise(function(_0x835a4f,_0x442e20){var _0x2846da={'body':_0xb1829e[_0x4b3b('0x26')],'channel':_0x4b3b('0x27')};var _0x3364df=[];var _0x720059=[];var _0x29f873={};return db['CmContact'][_0x4b3b('0x28')]()[_0x4b3b('0x23')](function(_0x1458b9){if(!_0x1458b9){throw new db[(_0x4b3b('0x29'))]['ValidationError'](_0x4b3b('0x2a'));}_0x3364df=_[_0x4b3b('0x2b')](_['keys'](_0x1458b9),['createdAt',_0x4b3b('0x2c')]);_0x720059=_['difference'](_[_0x4b3b('0x2d')](_0x1458b9),[_0x4b3b('0x2e'),_0x4b3b('0x2c'),_0x4b3b('0x2f'),'ListId']);if(_0xb1829e[_0x4b3b('0x26')]['id']){delete _0xb1829e['body']['id'];}if(_[_0x4b3b('0x30')](_0xb1829e['body'][_0x4b3b('0x31')])){throw new db[(_0x4b3b('0x29'))][(_0x4b3b('0x32'))](_0x4b3b('0x33'));}if(_[_0x4b3b('0x30')](_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x26')])||_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x26')]===''){throw new db[(_0x4b3b('0x29'))]['ValidationError'](_0x4b3b('0x34'));}if(_[_0x4b3b('0x30')](_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x35')])){throw new db[(_0x4b3b('0x29'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x720059);}if(!_['includes'](_0x720059,_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x35')])){throw new db[(_0x4b3b('0x29'))][(_0x4b3b('0x32'))](_0x4b3b('0x36')+_0x720059);}_0x29f873[_0xb1829e[_0x4b3b('0x26')]['mapKey']]=_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x31')];})[_0x4b3b('0x23')](function(){return db[_0x4b3b('0x37')][_0x4b3b('0x38')]({'where':{'id':_0xb1829e[_0x4b3b('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x4b3b('0x3a'),'include':[{'model':db[_0x4b3b('0x3b')],'as':_0x4b3b('0x3c'),'where':_0x29f873,'limit':0x1,'order':[[_0x4b3b('0x2c'),_0x4b3b('0x3d')]]}]},{'model':db[_0x4b3b('0x3e')],'as':_0x4b3b('0x3f')}]});})[_0x4b3b('0x23')](function(_0x46d7f6){if(_0x46d7f6&&_0x46d7f6[_0x4b3b('0x3a')]){var _0xf6f622=_0x46d7f6[_0x4b3b('0x40')]({'plain':!![]});_0x2846da['account']=_0xf6f622;_0x2846da[_0x4b3b('0x41')]=_0xf6f622[_0x4b3b('0x3f')];_0x2846da['list']=_0xf6f622[_0x4b3b('0x3a')];_0x2846da['applications']=_[_0x4b3b('0x42')](_0x2846da[_0x4b3b('0x41')],['priority'],[_0x4b3b('0x43')]);if(_0x2846da[_0x4b3b('0x39')][_0x4b3b('0x3f')]){delete _0x2846da[_0x4b3b('0x39')][_0x4b3b('0x3f')];}if(_0x2846da['account']['List']&&_0x2846da['account'][_0x4b3b('0x3a')][_0x4b3b('0x3c')][_0x4b3b('0x44')]){return _0x2846da[_0x4b3b('0x39')][_0x4b3b('0x3a')]['Contacts'][0x0];}var _0x471bf9=_[_0x4b3b('0xc')](_0xb1829e[_0x4b3b('0x26')],{'firstName':_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x31')],'ListId':_0xf6f622['ListId']});_0x471bf9[_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x35')]]=_0xb1829e['body'][_0x4b3b('0x31')];return db['CmContact'][_0x4b3b('0x45')](_0x471bf9,{'fields':_0x3364df,'raw':!![]});}})[_0x4b3b('0x23')](function(_0x3fc487){_0x2846da[_0x4b3b('0x46')]=_0x3fc487;if(_0x3fc487){var _0x148204={'ContactId':_0x3fc487['id'],'FaxAccountId':_0xb1829e['account']['id'],'fax':_0x3fc487['fax']};return db[_0x4b3b('0x47')]['find']({'where':{'ContactId':_0x3fc487['id'],'closed':![],'FaxAccountId':_0xb1829e[_0x4b3b('0x39')]['id']}})['then'](function(_0x18aa90){if(_0x18aa90){return[_0x18aa90,![]];}return db[_0x4b3b('0x47')][_0x4b3b('0x45')](_0x148204)[_0x4b3b('0x23')](function(_0xd31ed2){return[_0xd31ed2,!![]];});});}else{throw new Error(_0x4b3b('0x48'));}})[_0x4b3b('0x49')](function(_0x71d122,_0x2c8b7b){var _0x10cfc6=_0x71d122[_0x4b3b('0x40')]({'plain':!![]});if(_0x2c8b7b){if(_0x2846da[_0x4b3b('0x39')][_0x4b3b('0x4a')]){_0x2846da['applications'][_0x4b3b('0x4b')]({'id':0x0,'priority':_0x2846da['applications'][_0x4b3b('0x44')]+0x1,'app':'close','appdata':_0x4b3b('0x4c'),'interval':_0x4b3b('0x4d')});}_0x10cfc6[_0x4b3b('0x4e')]=!![];}else{_0x10cfc6[_0x4b3b('0x4e')]=![];}_0x2846da[_0x4b3b('0x4f')]=_0x10cfc6;return db['FaxMessage'][_0x4b3b('0x45')]({'body':_0xb1829e[_0x4b3b('0x26')][_0x4b3b('0x26')],'FaxAccountId':_0xb1829e[_0x4b3b('0x39')]['id'],'FaxInteractionId':_0x71d122['id'],'direction':'in','ContactId':_0x71d122[_0x4b3b('0x50')],'AttachmentId':_0xb1829e['body']['AttachmentId']});})['then'](function(_0x448dcf){_0x2846da[_0x4b3b('0x19')]=_0x448dcf;if(_0x2846da['interaction'][_0x4b3b('0x51')]){return db['User'][_0x4b3b('0x38')]({'attributes':['id','name'],'where':{'id':_0x2846da[_0x4b3b('0x4f')][_0x4b3b('0x51')]}})['then'](function(_0x1410cc){if(_0x1410cc){_0x2846da[_0x4b3b('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4b3b('0x52'),'appdata':_0x1410cc[_0x4b3b('0x53')]+','+(_0x2846da[_0x4b3b('0x39')][_0x4b3b('0x54')]||0xa),'interval':_0x4b3b('0x4d')});}return respondWithRpcPromise(_0x4b3b('0x55'),_0x4b3b('0x56'),_0x2846da);});}return respondWithRpcPromise(_0x4b3b('0x55'),_0x4b3b('0x56'),_0x2846da);})[_0x4b3b('0x23')](function(_0x1349b5){_0x835a4f(_0x1349b5);})['catch'](function(_0x196529){_0x442e20(_0x562704[_0x4b3b('0x16')](0x1f4,_0x196529[_0x4b3b('0x19')]));});});}; \ No newline at end of file +var _0xcd24=['describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','ListId','isNil','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','from','find','account','CmList','Contacts','DESC','get','applications','Applications','List','orderBy','priority','asc','length','create','contact','fax','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','map','include','model','NotifyFaxAccount','body','CmContact'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0xcd24,0xea));var _0x4cd2=function(_0x3e9e2d,_0x35b99a){_0x3e9e2d=_0x3e9e2d-0x0;var _0x509a97=_0xcd24[_0x3e9e2d];return _0x509a97;};'use strict';var _=require('lodash');var util=require(_0x4cd2('0x0'));var moment=require(_0x4cd2('0x1'));var BPromise=require(_0x4cd2('0x2'));var rs=require(_0x4cd2('0x3'));var fs=require('fs');var Redis=require(_0x4cd2('0x4'));var db=require(_0x4cd2('0x5'))['db'];var utils=require(_0x4cd2('0x6'));var logger=require(_0x4cd2('0x7'))(_0x4cd2('0x8'));var config=require(_0x4cd2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4cd2('0xa')][_0x4cd2('0xb')]({'port':0x232c});config[_0x4cd2('0xc')]=_[_0x4cd2('0xd')](config[_0x4cd2('0xc')],{'host':_0x4cd2('0xe'),'port':0x18eb});var socket=require(_0x4cd2('0xf'))(new Redis(config[_0x4cd2('0xc')]));require(_0x4cd2('0x10'))[_0x4cd2('0x11')](socket);function respondWithRpcPromise(_0x318e8d,_0x323e54,_0xf1f9a1){return new BPromise(function(_0x448aaa,_0x378442){return client[_0x4cd2('0x12')](_0x318e8d,_0xf1f9a1)[_0x4cd2('0x13')](function(_0x218279){logger[_0x4cd2('0x14')]('FaxAccount,\x20%s,\x20%s',_0x323e54,_0x4cd2('0x15'));logger['debug'](_0x4cd2('0x16'),_0x323e54,_0x4cd2('0x15'),JSON[_0x4cd2('0x17')](_0x218279));if(_0x218279[_0x4cd2('0x18')]){if(_0x218279[_0x4cd2('0x18')][_0x4cd2('0x19')]===0x1f4){logger[_0x4cd2('0x18')]('FaxAccount,\x20%s,\x20%s',_0x323e54,_0x218279['error'][_0x4cd2('0x1a')]);return _0x378442(_0x218279[_0x4cd2('0x18')][_0x4cd2('0x1a')]);}logger[_0x4cd2('0x18')](_0x4cd2('0x1b'),_0x323e54,_0x218279['error'][_0x4cd2('0x1a')]);return _0x448aaa(_0x218279[_0x4cd2('0x18')][_0x4cd2('0x1a')]);}else{logger[_0x4cd2('0x14')](_0x4cd2('0x1b'),_0x323e54,_0x4cd2('0x15'));_0x448aaa(_0x218279['result'][_0x4cd2('0x1a')]);}})[_0x4cd2('0x1c')](function(_0x182184){logger['error'](_0x4cd2('0x1b'),_0x323e54,_0x182184);_0x378442(_0x182184);});});}exports[_0x4cd2('0x1d')]=function(_0x1bfe66){var _0x1c6956=this;return new Promise(function(_0x4bab64,_0x1a82dc){return db[_0x4cd2('0x1e')][_0x4cd2('0x1f')]({'raw':_0x1bfe66[_0x4cd2('0x20')]?_0x1bfe66['options'][_0x4cd2('0x21')]===undefined?!![]:![]:!![],'where':_0x1bfe66[_0x4cd2('0x20')]?_0x1bfe66[_0x4cd2('0x20')][_0x4cd2('0x22')]||null:null,'attributes':_0x1bfe66['options']?_0x1bfe66['options'][_0x4cd2('0x23')]||null:null,'limit':_0x1bfe66[_0x4cd2('0x20')]?_0x1bfe66[_0x4cd2('0x20')]['limit']||null:null,'include':_0x1bfe66[_0x4cd2('0x20')]?_0x1bfe66['options']['include']?_[_0x4cd2('0x24')](_0x1bfe66[_0x4cd2('0x20')][_0x4cd2('0x25')],function(_0x592f11){return{'model':db[_0x592f11[_0x4cd2('0x26')]],'as':_0x592f11['as'],'attributes':_0x592f11['attributes'],'include':_0x592f11['include']?_[_0x4cd2('0x24')](_0x592f11[_0x4cd2('0x25')],function(_0x1276af){return{'model':db[_0x1276af[_0x4cd2('0x26')]],'as':_0x1276af['as'],'attributes':_0x1276af['attributes'],'include':_0x1276af[_0x4cd2('0x25')]?_[_0x4cd2('0x24')](_0x1276af[_0x4cd2('0x25')],function(_0x5b14ed){return{'model':db[_0x5b14ed[_0x4cd2('0x26')]],'as':_0x5b14ed['as'],'attributes':_0x5b14ed[_0x4cd2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4cd2('0x13')](function(_0x4dadbd){logger[_0x4cd2('0x14')]('GetFaxAccount',_0x1bfe66);logger['debug'](_0x4cd2('0x1d'),_0x1bfe66,JSON['stringify'](_0x4dadbd));_0x4bab64(_0x4dadbd);})[_0x4cd2('0x1c')](function(_0x82e233){logger[_0x4cd2('0x18')](_0x4cd2('0x1d'),_0x82e233[_0x4cd2('0x1a')],_0x1bfe66);_0x1a82dc(_0x1c6956[_0x4cd2('0x18')](0x1f4,_0x82e233[_0x4cd2('0x1a')]));});});};exports[_0x4cd2('0x27')]=function(_0x2fbbc3,_0x495aef,_0x56ddcf){var _0x140d3f=this;return new Promise(function(_0xfda67e,_0x31844a){var _0x13e190={'body':_0x2fbbc3[_0x4cd2('0x28')],'channel':'fax'};var _0x3e31d1=[];var _0x34f1a4=[];var _0x481678={};return db[_0x4cd2('0x29')][_0x4cd2('0x2a')]()[_0x4cd2('0x13')](function(_0x2d892b){if(!_0x2d892b){throw new db[(_0x4cd2('0x2b'))][(_0x4cd2('0x2c'))](_0x4cd2('0x2d'));}_0x3e31d1=_['difference'](_[_0x4cd2('0x2e')](_0x2d892b),['createdAt',_0x4cd2('0x2f')]);_0x34f1a4=_[_0x4cd2('0x30')](_[_0x4cd2('0x2e')](_0x2d892b),['createdAt',_0x4cd2('0x2f'),'CompanyId',_0x4cd2('0x31')]);if(_0x2fbbc3['body']['id']){delete _0x2fbbc3[_0x4cd2('0x28')]['id'];}if(_[_0x4cd2('0x32')](_0x2fbbc3['body']['from'])){throw new db[(_0x4cd2('0x2b'))][(_0x4cd2('0x2c'))](_0x4cd2('0x33'));}if(_[_0x4cd2('0x32')](_0x2fbbc3['body'][_0x4cd2('0x28')])||_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x28')]===''){throw new db[(_0x4cd2('0x2b'))]['ValidationError'](_0x4cd2('0x34'));}if(_[_0x4cd2('0x32')](_0x2fbbc3[_0x4cd2('0x28')]['mapKey'])){throw new db[(_0x4cd2('0x2b'))]['ValidationError'](_0x4cd2('0x35')+_0x34f1a4);}if(!_[_0x4cd2('0x36')](_0x34f1a4,_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x37')])){throw new db[(_0x4cd2('0x2b'))][(_0x4cd2('0x2c'))](_0x4cd2('0x38')+_0x34f1a4);}_0x481678[_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x37')]]=_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x39')];})[_0x4cd2('0x13')](function(){return db[_0x4cd2('0x1e')][_0x4cd2('0x3a')]({'where':{'id':_0x2fbbc3[_0x4cd2('0x3b')]['id']},'include':[{'model':db[_0x4cd2('0x3c')],'as':'List','include':[{'model':db[_0x4cd2('0x29')],'as':_0x4cd2('0x3d'),'where':_0x481678,'limit':0x1,'order':[[_0x4cd2('0x2f'),_0x4cd2('0x3e')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x4cd2('0x13')](function(_0x42b42f){if(_0x42b42f&&_0x42b42f['List']){var _0x3c4da0=_0x42b42f[_0x4cd2('0x3f')]({'plain':!![]});_0x13e190['account']=_0x3c4da0;_0x13e190[_0x4cd2('0x40')]=_0x3c4da0[_0x4cd2('0x41')];_0x13e190['list']=_0x3c4da0[_0x4cd2('0x42')];_0x13e190[_0x4cd2('0x40')]=_[_0x4cd2('0x43')](_0x13e190[_0x4cd2('0x40')],[_0x4cd2('0x44')],[_0x4cd2('0x45')]);if(_0x13e190[_0x4cd2('0x3b')][_0x4cd2('0x41')]){delete _0x13e190[_0x4cd2('0x3b')][_0x4cd2('0x41')];}if(_0x13e190[_0x4cd2('0x3b')][_0x4cd2('0x42')]&&_0x13e190['account'][_0x4cd2('0x42')][_0x4cd2('0x3d')][_0x4cd2('0x46')]){return _0x13e190[_0x4cd2('0x3b')]['List'][_0x4cd2('0x3d')][0x0];}var _0xf49520=_[_0x4cd2('0xd')](_0x2fbbc3[_0x4cd2('0x28')],{'firstName':_0x2fbbc3['body'][_0x4cd2('0x39')],'ListId':_0x3c4da0[_0x4cd2('0x31')]});_0xf49520[_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x37')]]=_0x2fbbc3[_0x4cd2('0x28')]['from'];return db['CmContact'][_0x4cd2('0x47')](_0xf49520,{'fields':_0x3e31d1,'raw':!![]});}})['then'](function(_0x4932ea){_0x13e190[_0x4cd2('0x48')]=_0x4932ea;if(_0x4932ea){var _0x5e8315={'ContactId':_0x4932ea['id'],'FaxAccountId':_0x2fbbc3[_0x4cd2('0x3b')]['id'],'fax':_0x4932ea[_0x4cd2('0x49')]};return db['FaxInteraction'][_0x4cd2('0x3a')]({'where':{'ContactId':_0x4932ea['id'],'closed':![],'FaxAccountId':_0x2fbbc3[_0x4cd2('0x3b')]['id']}})[_0x4cd2('0x13')](function(_0x343d65){if(_0x343d65){return[_0x343d65,![]];}return db['FaxInteraction'][_0x4cd2('0x47')](_0x5e8315)['then'](function(_0x1aa8d2){return[_0x1aa8d2,!![]];});});}else{throw new Error(_0x4cd2('0x4a'));}})[_0x4cd2('0x4b')](function(_0xaabfe5,_0x16b05a){var _0x5eeff5=_0xaabfe5[_0x4cd2('0x3f')]({'plain':!![]});if(_0x16b05a){if(_0x13e190['account'][_0x4cd2('0x4c')]){_0x13e190['applications'][_0x4cd2('0x4d')]({'id':0x0,'priority':_0x13e190[_0x4cd2('0x40')][_0x4cd2('0x46')]+0x1,'app':_0x4cd2('0x4e'),'appdata':_0x4cd2('0x4f'),'interval':_0x4cd2('0x50')});}_0x5eeff5[_0x4cd2('0x51')]=!![];}else{_0x5eeff5[_0x4cd2('0x51')]=![];}_0x13e190[_0x4cd2('0x52')]=_0x5eeff5;return db[_0x4cd2('0x53')][_0x4cd2('0x47')]({'body':_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x28')],'FaxAccountId':_0x2fbbc3[_0x4cd2('0x3b')]['id'],'FaxInteractionId':_0xaabfe5['id'],'direction':'in','ContactId':_0xaabfe5[_0x4cd2('0x54')],'AttachmentId':_0x2fbbc3[_0x4cd2('0x28')][_0x4cd2('0x55')]});})[_0x4cd2('0x13')](function(_0x4f865b){_0x13e190[_0x4cd2('0x1a')]=_0x4f865b;if(_0x13e190[_0x4cd2('0x52')][_0x4cd2('0x56')]){return db['User']['find']({'attributes':['id',_0x4cd2('0x57')],'where':{'id':_0x13e190['interaction'][_0x4cd2('0x56')]}})[_0x4cd2('0x13')](function(_0xdbb76f){if(_0xdbb76f){_0x13e190[_0x4cd2('0x40')][_0x4cd2('0x58')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdbb76f[_0x4cd2('0x57')]+','+(_0x13e190['account'][_0x4cd2('0x59')]||0xa),'interval':_0x4cd2('0x50')});}return respondWithRpcPromise(_0x4cd2('0x5a'),_0x4cd2('0x5b'),_0x13e190);});}return respondWithRpcPromise(_0x4cd2('0x5a'),'startRouting',_0x13e190);})[_0x4cd2('0x13')](function(_0x195a92){_0xfda67e(_0x195a92);})[_0x4cd2('0x1c')](function(_0x37c414){_0x31844a(_0x140d3f['error'](0x1f4,_0x37c414[_0x4cd2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 915034c..bfba823 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 _0x2a68=['emit','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0x2a68,0x13c));var _0x82a6=function(_0x409975,_0x28f3cd){_0x409975=_0x409975-0x0;var _0x51b21b=_0x2a68[_0x409975];return _0x51b21b;};'use strict';var FaxAccountEvents=require(_0x82a6('0x0'));var events=[_0x82a6('0x1'),_0x82a6('0x2'),_0x82a6('0x3')];function createListener(_0x1df6aa,_0x2615e8){return function(_0x3a1565){_0x2615e8[_0x82a6('0x4')](_0x1df6aa,_0x3a1565);};}function removeListener(_0x2cd415,_0x2a3a78){return function(){FaxAccountEvents['removeListener'](_0x2cd415,_0x2a3a78);};}exports[_0x82a6('0x5')]=function(_0x40f3d7){for(var _0x4d5a4b=0x0,_0x4b3787=events[_0x82a6('0x6')];_0x4d5a4b<_0x4b3787;_0x4d5a4b++){var _0x294ef3=events[_0x4d5a4b];var _0x1deee8=createListener(_0x82a6('0x7')+_0x294ef3,_0x40f3d7);FaxAccountEvents['on'](_0x294ef3,_0x1deee8);}}; \ No newline at end of file +var _0x4989=['save','remove','update','emit','removeListener','register','length','./faxAccount.events'];(function(_0xf5e69c,_0x80e8e5){var _0x5cb064=function(_0x587335){while(--_0x587335){_0xf5e69c['push'](_0xf5e69c['shift']());}};_0x5cb064(++_0x80e8e5);}(_0x4989,0x10f));var _0x9498=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x4989[_0x179b53];return _0x38a146;};'use strict';var FaxAccountEvents=require(_0x9498('0x0'));var events=[_0x9498('0x1'),_0x9498('0x2'),_0x9498('0x3')];function createListener(_0x13fb54,_0x5262b4){return function(_0x312621){_0x5262b4[_0x9498('0x4')](_0x13fb54,_0x312621);};}function removeListener(_0x3568af,_0x198904){return function(){FaxAccountEvents[_0x9498('0x5')](_0x3568af,_0x198904);};}exports[_0x9498('0x6')]=function(_0x29b1d4){for(var _0x34dbba=0x0,_0x1123a5=events[_0x9498('0x7')];_0x34dbba<_0x1123a5;_0x34dbba++){var _0x4b77ff=events[_0x34dbba];var _0xa54166=createListener('faxAccount:'+_0x4b77ff,_0x29b1d4);FaxAccountEvents['on'](_0x4b77ff,_0xa54166);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index c0ec238..72c88b8 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x226b97,_0x200b04){var _0x336bae=function(_0x5bac35){while(--_0x5bac35){_0x226b97['push'](_0x226b97['shift']());}};_0x336bae(++_0x200b04);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x12aa04,_0x40899a){var _0x3c72df=function(_0x3f826a){while(--_0x3f826a){_0x12aa04['push'](_0x12aa04['shift']());}};_0x3c72df(++_0x40899a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 827b06d..929a45e 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 _0x62ab=['noop','*,*,*,*','STRING'];(function(_0x431c2b,_0x13baf3){var _0x384637=function(_0x46191f){while(--_0x46191f){_0x431c2b['push'](_0x431c2b['shift']());}};_0x384637(++_0x13baf3);}(_0x62ab,0x15b));var _0xb62a=function(_0x12af66,_0x51f8ad){_0x12af66=_0x12af66-0x0;var _0x361507=_0x62ab[_0x12af66];return _0x361507;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb62a('0x0')],'allowNull':![],'defaultValue':_0xb62a('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb62a('0x0')]},'interval':{'type':Sequelize[_0xb62a('0x0')],'defaultValue':_0xb62a('0x2')}}; \ No newline at end of file +var _0xf542=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0xf542,0x87));var _0x2f54=function(_0x50879d,_0x11e42e){_0x50879d=_0x50879d-0x0;var _0x3ba310=_0xf542[_0x50879d];return _0x3ba310;};'use strict';var Sequelize=require(_0x2f54('0x0'));module[_0x2f54('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2f54('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2f54('0x3')]()},'description':{'type':Sequelize[_0x2f54('0x2')]},'interval':{'type':Sequelize[_0x2f54('0x2')],'defaultValue':_0x2f54('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e3933f0..bc74e41 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 _0xa9b6=['catch','params','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9b6,0xef));var _0x6a9b=function(_0x33862c,_0x14d030){_0x33862c=_0x33862c-0x0;var _0x4c8e02=_0xa9b6[_0x33862c];return _0x4c8e02;};'use strict';var emlformat=require(_0x6a9b('0x0'));var rimraf=require(_0x6a9b('0x1'));var zipdir=require(_0x6a9b('0x2'));var jsonpatch=require(_0x6a9b('0x3'));var rp=require(_0x6a9b('0x4'));var moment=require(_0x6a9b('0x5'));var BPromise=require(_0x6a9b('0x6'));var Mustache=require(_0x6a9b('0x7'));var util=require(_0x6a9b('0x8'));var path=require(_0x6a9b('0x9'));var sox=require(_0x6a9b('0xa'));var csv=require('to-csv');var ejs=require(_0x6a9b('0xb'));var fs=require('fs');var fs_extra=require(_0x6a9b('0xc'));var _=require(_0x6a9b('0xd'));var squel=require(_0x6a9b('0xe'));var crypto=require('crypto');var jsforce=require(_0x6a9b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6a9b('0x10'));var querystring=require('querystring');var Papa=require(_0x6a9b('0x11'));var Redis=require(_0x6a9b('0x12'));var authService=require(_0x6a9b('0x13'));var qs=require(_0x6a9b('0x14'));var as=require(_0x6a9b('0x15'));var hardwareService=require(_0x6a9b('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6a9b('0x17'));var licenseUtil=require(_0x6a9b('0x18'));var db=require(_0x6a9b('0x19'))['db'];function respondWithStatusCode(_0x56b8cc,_0xca2ecc){_0xca2ecc=_0xca2ecc||0xcc;return function(_0x297964){if(_0x297964){return _0x56b8cc[_0x6a9b('0x1a')](_0xca2ecc);}return _0x56b8cc[_0x6a9b('0x1b')](_0xca2ecc)['end']();};}function respondWithResult(_0x986df1,_0x178379){_0x178379=_0x178379||0xc8;return function(_0x53b47d){if(_0x53b47d){return _0x986df1[_0x6a9b('0x1b')](_0x178379)[_0x6a9b('0x1c')](_0x53b47d);}};}function respondWithFilteredResult(_0x27b023,_0x978f5){return function(_0x17de2d){if(_0x17de2d){var _0x2107bd=typeof _0x978f5[_0x6a9b('0x1d')]===_0x6a9b('0x1e')&&typeof _0x978f5[_0x6a9b('0x1f')]===_0x6a9b('0x1e');var _0x59201c=_0x17de2d[_0x6a9b('0x20')];var _0x27d0c8=_0x2107bd?0x0:_0x978f5[_0x6a9b('0x1d')];var _0x35830=_0x2107bd?_0x17de2d['count']:_0x978f5['offset']+_0x978f5[_0x6a9b('0x1f')];var _0xde13bf;if(_0x35830>=_0x59201c){_0x35830=_0x59201c;_0xde13bf=0xc8;}else{_0xde13bf=0xce;}_0x27b023[_0x6a9b('0x1b')](_0xde13bf);return _0x27b023[_0x6a9b('0x21')]('Content-Range',_0x27d0c8+'-'+_0x35830+'/'+_0x59201c)[_0x6a9b('0x1c')](_0x17de2d);}return null;};}function patchUpdates(_0x245b2a){return function(_0x2f411a){try{jsonpatch[_0x6a9b('0x22')](_0x2f411a,_0x245b2a,!![]);}catch(_0x4b5420){return BPromise[_0x6a9b('0x23')](_0x4b5420);}return _0x2f411a[_0x6a9b('0x24')]();};}function saveUpdates(_0x4f0e40,_0x43fca7){return function(_0x35560d){if(_0x35560d){return _0x35560d[_0x6a9b('0x25')](_0x4f0e40)[_0x6a9b('0x26')](function(_0x15c600){return _0x15c600;});}return null;};}function removeEntity(_0x2e436b,_0x515a10){return function(_0x560113){if(_0x560113){return _0x560113['destroy']()[_0x6a9b('0x26')](function(){_0x2e436b[_0x6a9b('0x1b')](0xcc)[_0x6a9b('0x27')]();});}};}function handleEntityNotFound(_0x108ac1,_0x111f6c){return function(_0x56aff4){if(!_0x56aff4){_0x108ac1[_0x6a9b('0x1a')](0x194);}return _0x56aff4;};}function handleError(_0x245023,_0x7dd35){_0x7dd35=_0x7dd35||0x1f4;return function(_0x58daea){logger[_0x6a9b('0x28')](_0x58daea[_0x6a9b('0x29')]);if(_0x58daea[_0x6a9b('0x2a')]){delete _0x58daea[_0x6a9b('0x2a')];}_0x245023[_0x6a9b('0x1b')](_0x7dd35)[_0x6a9b('0x2b')](_0x58daea);};}exports[_0x6a9b('0x2c')]=function(_0x1c6bf4,_0x3153e1){var _0x4c45d7={},_0x4b05fa={},_0x573fb0={'count':0x0,'rows':[]};var _0x311050=_[_0x6a9b('0x2d')](db[_0x6a9b('0x2e')][_0x6a9b('0x2f')],function(_0x50a20d){return{'name':_0x50a20d[_0x6a9b('0x30')],'type':_0x50a20d[_0x6a9b('0x31')][_0x6a9b('0x32')]};});_0x4b05fa['model']=_[_0x6a9b('0x2d')](_0x311050,_0x6a9b('0x2a'));_0x4b05fa[_0x6a9b('0x33')]=_[_0x6a9b('0x34')](_0x1c6bf4[_0x6a9b('0x33')]);_0x4b05fa[_0x6a9b('0x35')]=_[_0x6a9b('0x36')](_0x4b05fa['model'],_0x4b05fa[_0x6a9b('0x33')]);_0x4c45d7[_0x6a9b('0x37')]=_[_0x6a9b('0x36')](_0x4b05fa[_0x6a9b('0x38')],qs[_0x6a9b('0x39')](_0x1c6bf4['query'][_0x6a9b('0x39')]));_0x4c45d7['attributes']=_0x4c45d7[_0x6a9b('0x37')][_0x6a9b('0x3a')]?_0x4c45d7[_0x6a9b('0x37')]:_0x4b05fa['model'];if(!_0x1c6bf4[_0x6a9b('0x33')][_0x6a9b('0x3b')](_0x6a9b('0x3c'))){_0x4c45d7[_0x6a9b('0x1f')]=qs[_0x6a9b('0x1f')](_0x1c6bf4['query'][_0x6a9b('0x1f')]);_0x4c45d7[_0x6a9b('0x1d')]=qs[_0x6a9b('0x1d')](_0x1c6bf4['query'][_0x6a9b('0x1d')]);}_0x4c45d7['order']=qs[_0x6a9b('0x3d')](_0x1c6bf4[_0x6a9b('0x33')][_0x6a9b('0x3d')]);_0x4c45d7[_0x6a9b('0x3e')]=qs[_0x6a9b('0x35')](_[_0x6a9b('0x3f')](_0x1c6bf4['query'],_0x4b05fa[_0x6a9b('0x35')]),_0x311050);if(_0x1c6bf4[_0x6a9b('0x33')][_0x6a9b('0x40')]){_0x4c45d7[_0x6a9b('0x3e')]=_[_0x6a9b('0x41')](_0x4c45d7[_0x6a9b('0x3e')],{'$or':_[_0x6a9b('0x2d')](_0x311050,function(_0x326a69){if(_0x326a69['type']!==_0x6a9b('0x42')){var _0x1f082b={};_0x1f082b[_0x326a69['name']]={'$like':'%'+_0x1c6bf4[_0x6a9b('0x33')][_0x6a9b('0x40')]+'%'};return _0x1f082b;}})});}_0x4c45d7=_[_0x6a9b('0x41')]({},_0x4c45d7,_0x1c6bf4['options']);var _0x4b3b39={'where':_0x4c45d7['where']};return db['FaxApplication']['count'](_0x4b3b39)[_0x6a9b('0x26')](function(_0x390a4f){_0x573fb0['count']=_0x390a4f;if(_0x1c6bf4[_0x6a9b('0x33')]['includeAll']){_0x4c45d7[_0x6a9b('0x43')]=[{'all':!![]}];}return db[_0x6a9b('0x2e')][_0x6a9b('0x44')](_0x4c45d7);})[_0x6a9b('0x26')](function(_0x35d399){_0x573fb0['rows']=_0x35d399;return _0x573fb0;})[_0x6a9b('0x26')](respondWithFilteredResult(_0x3153e1,_0x4c45d7))[_0x6a9b('0x45')](handleError(_0x3153e1,null));};exports['show']=function(_0x3d9bd4,_0x2a61c6){var _0x188f8d={'raw':!![],'where':{'id':_0x3d9bd4[_0x6a9b('0x46')]['id']}},_0x1f9c55={};_0x1f9c55[_0x6a9b('0x38')]=_[_0x6a9b('0x34')](db['FaxApplication']['rawAttributes']);_0x1f9c55['query']=_[_0x6a9b('0x34')](_0x3d9bd4[_0x6a9b('0x33')]);_0x1f9c55['filters']=_['intersection'](_0x1f9c55[_0x6a9b('0x38')],_0x1f9c55[_0x6a9b('0x33')]);_0x188f8d['attributes']=_['intersection'](_0x1f9c55[_0x6a9b('0x38')],qs[_0x6a9b('0x39')](_0x3d9bd4[_0x6a9b('0x33')]['fields']));_0x188f8d['attributes']=_0x188f8d['attributes'][_0x6a9b('0x3a')]?_0x188f8d[_0x6a9b('0x37')]:_0x1f9c55[_0x6a9b('0x38')];if(_0x3d9bd4[_0x6a9b('0x33')][_0x6a9b('0x47')]){_0x188f8d[_0x6a9b('0x43')]=[{'all':!![]}];}_0x188f8d=_[_0x6a9b('0x41')]({},_0x188f8d,_0x3d9bd4[_0x6a9b('0x48')]);return db[_0x6a9b('0x2e')][_0x6a9b('0x49')](_0x188f8d)[_0x6a9b('0x26')](handleEntityNotFound(_0x2a61c6,null))['then'](respondWithResult(_0x2a61c6,null))[_0x6a9b('0x45')](handleError(_0x2a61c6,null));};exports[_0x6a9b('0x4a')]=function(_0x3da345,_0x1c09de){return db[_0x6a9b('0x2e')][_0x6a9b('0x4a')](_0x3da345[_0x6a9b('0x4b')],{})[_0x6a9b('0x26')](respondWithResult(_0x1c09de,0xc9))[_0x6a9b('0x45')](handleError(_0x1c09de,null));};exports['update']=function(_0x1e9e31,_0x317004){if(_0x1e9e31[_0x6a9b('0x4b')]['id']){delete _0x1e9e31[_0x6a9b('0x4b')]['id'];}return db['FaxApplication'][_0x6a9b('0x49')]({'where':{'id':_0x1e9e31[_0x6a9b('0x46')]['id']}})[_0x6a9b('0x26')](handleEntityNotFound(_0x317004,null))[_0x6a9b('0x26')](saveUpdates(_0x1e9e31[_0x6a9b('0x4b')],null))[_0x6a9b('0x26')](respondWithResult(_0x317004,null))[_0x6a9b('0x45')](handleError(_0x317004,null));};exports[_0x6a9b('0x4c')]=function(_0x1b0dbc,_0x4ac289){return db[_0x6a9b('0x2e')][_0x6a9b('0x49')]({'where':{'id':_0x1b0dbc['params']['id']}})[_0x6a9b('0x26')](handleEntityNotFound(_0x4ac289,null))['then'](removeEntity(_0x4ac289,null))[_0x6a9b('0x45')](handleError(_0x4ac289,null));}; \ No newline at end of file +var _0x5a6a=['catch','show','rawAttributes','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x52ef1e,_0x3e8549){var _0xcf493a=function(_0x306ac3){while(--_0x306ac3){_0x52ef1e['push'](_0x52ef1e['shift']());}};_0xcf493a(++_0x3e8549);}(_0x5a6a,0x1f4));var _0xa5a6=function(_0x57eac9,_0x1db0bc){_0x57eac9=_0x57eac9-0x0;var _0x5bea1a=_0x5a6a[_0x57eac9];return _0x5bea1a;};'use strict';var emlformat=require(_0xa5a6('0x0'));var rimraf=require(_0xa5a6('0x1'));var zipdir=require(_0xa5a6('0x2'));var jsonpatch=require(_0xa5a6('0x3'));var rp=require(_0xa5a6('0x4'));var moment=require(_0xa5a6('0x5'));var BPromise=require(_0xa5a6('0x6'));var Mustache=require(_0xa5a6('0x7'));var util=require(_0xa5a6('0x8'));var path=require(_0xa5a6('0x9'));var sox=require(_0xa5a6('0xa'));var csv=require(_0xa5a6('0xb'));var ejs=require(_0xa5a6('0xc'));var fs=require('fs');var fs_extra=require(_0xa5a6('0xd'));var _=require(_0xa5a6('0xe'));var squel=require(_0xa5a6('0xf'));var crypto=require(_0xa5a6('0x10'));var jsforce=require(_0xa5a6('0x11'));var deskjs=require(_0xa5a6('0x12'));var toCsv=require(_0xa5a6('0xb'));var querystring=require(_0xa5a6('0x13'));var Papa=require(_0xa5a6('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa5a6('0x15'));var as=require(_0xa5a6('0x16'));var hardwareService=require(_0xa5a6('0x17'));var logger=require(_0xa5a6('0x18'))(_0xa5a6('0x19'));var utils=require(_0xa5a6('0x1a'));var config=require(_0xa5a6('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5a6('0x1c'))['db'];function respondWithStatusCode(_0x4e4b67,_0x2224cb){_0x2224cb=_0x2224cb||0xcc;return function(_0x56f1fc){if(_0x56f1fc){return _0x4e4b67[_0xa5a6('0x1d')](_0x2224cb);}return _0x4e4b67[_0xa5a6('0x1e')](_0x2224cb)[_0xa5a6('0x1f')]();};}function respondWithResult(_0x46d122,_0x1f8238){_0x1f8238=_0x1f8238||0xc8;return function(_0x283d73){if(_0x283d73){return _0x46d122[_0xa5a6('0x1e')](_0x1f8238)[_0xa5a6('0x20')](_0x283d73);}};}function respondWithFilteredResult(_0x51f7d0,_0x3f9401){return function(_0x9d7d05){if(_0x9d7d05){var _0x3cc21b=typeof _0x3f9401[_0xa5a6('0x21')]===_0xa5a6('0x22')&&typeof _0x3f9401['limit']===_0xa5a6('0x22');var _0xf4e5dd=_0x9d7d05[_0xa5a6('0x23')];var _0x4abd5a=_0x3cc21b?0x0:_0x3f9401[_0xa5a6('0x21')];var _0x39bb87=_0x3cc21b?_0x9d7d05[_0xa5a6('0x23')]:_0x3f9401[_0xa5a6('0x21')]+_0x3f9401[_0xa5a6('0x24')];var _0x2735ea;if(_0x39bb87>=_0xf4e5dd){_0x39bb87=_0xf4e5dd;_0x2735ea=0xc8;}else{_0x2735ea=0xce;}_0x51f7d0[_0xa5a6('0x1e')](_0x2735ea);return _0x51f7d0[_0xa5a6('0x25')](_0xa5a6('0x26'),_0x4abd5a+'-'+_0x39bb87+'/'+_0xf4e5dd)[_0xa5a6('0x20')](_0x9d7d05);}return null;};}function patchUpdates(_0x3099ee){return function(_0xf8a654){try{jsonpatch['apply'](_0xf8a654,_0x3099ee,!![]);}catch(_0x5b8aca){return BPromise['reject'](_0x5b8aca);}return _0xf8a654[_0xa5a6('0x27')]();};}function saveUpdates(_0x36615e,_0x345750){return function(_0x2ab00a){if(_0x2ab00a){return _0x2ab00a[_0xa5a6('0x28')](_0x36615e)['then'](function(_0x304d88){return _0x304d88;});}return null;};}function removeEntity(_0x373cf9,_0x1fdefe){return function(_0x26a69a){if(_0x26a69a){return _0x26a69a[_0xa5a6('0x29')]()[_0xa5a6('0x2a')](function(){_0x373cf9[_0xa5a6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30755c,_0x47c069){return function(_0x382881){if(!_0x382881){_0x30755c[_0xa5a6('0x1d')](0x194);}return _0x382881;};}function handleError(_0x573739,_0x140d5e){_0x140d5e=_0x140d5e||0x1f4;return function(_0x1e841b){logger[_0xa5a6('0x2b')](_0x1e841b[_0xa5a6('0x2c')]);if(_0x1e841b[_0xa5a6('0x2d')]){delete _0x1e841b[_0xa5a6('0x2d')];}_0x573739[_0xa5a6('0x1e')](_0x140d5e)[_0xa5a6('0x2e')](_0x1e841b);};}exports[_0xa5a6('0x2f')]=function(_0x36031a,_0x1a31f2){var _0xccd1dc={},_0x466903={},_0x48dfb6={'count':0x0,'rows':[]};var _0x5ad96e=_[_0xa5a6('0x30')](db[_0xa5a6('0x31')]['rawAttributes'],function(_0x5ee1ac){return{'name':_0x5ee1ac[_0xa5a6('0x32')],'type':_0x5ee1ac[_0xa5a6('0x33')][_0xa5a6('0x34')]};});_0x466903[_0xa5a6('0x35')]=_[_0xa5a6('0x30')](_0x5ad96e,'name');_0x466903['query']=_[_0xa5a6('0x36')](_0x36031a[_0xa5a6('0x37')]);_0x466903[_0xa5a6('0x38')]=_[_0xa5a6('0x39')](_0x466903[_0xa5a6('0x35')],_0x466903[_0xa5a6('0x37')]);_0xccd1dc[_0xa5a6('0x3a')]=_[_0xa5a6('0x39')](_0x466903[_0xa5a6('0x35')],qs['fields'](_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x3b')]));_0xccd1dc[_0xa5a6('0x3a')]=_0xccd1dc['attributes'][_0xa5a6('0x3c')]?_0xccd1dc[_0xa5a6('0x3a')]:_0x466903[_0xa5a6('0x35')];if(!_0x36031a['query'][_0xa5a6('0x3d')](_0xa5a6('0x3e'))){_0xccd1dc[_0xa5a6('0x24')]=qs['limit'](_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x24')]);_0xccd1dc['offset']=qs['offset'](_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x21')]);}_0xccd1dc[_0xa5a6('0x3f')]=qs[_0xa5a6('0x40')](_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x40')]);_0xccd1dc[_0xa5a6('0x41')]=qs[_0xa5a6('0x38')](_[_0xa5a6('0x42')](_0x36031a[_0xa5a6('0x37')],_0x466903[_0xa5a6('0x38')]),_0x5ad96e);if(_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x43')]){_0xccd1dc['where']=_[_0xa5a6('0x44')](_0xccd1dc[_0xa5a6('0x41')],{'$or':_[_0xa5a6('0x30')](_0x5ad96e,function(_0x336c41){if(_0x336c41['type']!==_0xa5a6('0x45')){var _0x47dd5c={};_0x47dd5c[_0x336c41[_0xa5a6('0x2d')]]={'$like':'%'+_0x36031a['query'][_0xa5a6('0x43')]+'%'};return _0x47dd5c;}})});}_0xccd1dc=_[_0xa5a6('0x44')]({},_0xccd1dc,_0x36031a[_0xa5a6('0x46')]);var _0x1d9960={'where':_0xccd1dc[_0xa5a6('0x41')]};return db['FaxApplication'][_0xa5a6('0x23')](_0x1d9960)[_0xa5a6('0x2a')](function(_0x194912){_0x48dfb6[_0xa5a6('0x23')]=_0x194912;if(_0x36031a[_0xa5a6('0x37')][_0xa5a6('0x47')]){_0xccd1dc['include']=[{'all':!![]}];}return db['FaxApplication'][_0xa5a6('0x48')](_0xccd1dc);})[_0xa5a6('0x2a')](function(_0x2a7921){_0x48dfb6[_0xa5a6('0x49')]=_0x2a7921;return _0x48dfb6;})[_0xa5a6('0x2a')](respondWithFilteredResult(_0x1a31f2,_0xccd1dc))[_0xa5a6('0x4a')](handleError(_0x1a31f2,null));};exports[_0xa5a6('0x4b')]=function(_0x5df76f,_0x24fdb){var _0x408784={'raw':!![],'where':{'id':_0x5df76f['params']['id']}},_0xb79b9f={};_0xb79b9f[_0xa5a6('0x35')]=_[_0xa5a6('0x36')](db[_0xa5a6('0x31')][_0xa5a6('0x4c')]);_0xb79b9f[_0xa5a6('0x37')]=_['keys'](_0x5df76f[_0xa5a6('0x37')]);_0xb79b9f[_0xa5a6('0x38')]=_['intersection'](_0xb79b9f[_0xa5a6('0x35')],_0xb79b9f[_0xa5a6('0x37')]);_0x408784[_0xa5a6('0x3a')]=_[_0xa5a6('0x39')](_0xb79b9f[_0xa5a6('0x35')],qs['fields'](_0x5df76f[_0xa5a6('0x37')][_0xa5a6('0x3b')]));_0x408784[_0xa5a6('0x3a')]=_0x408784['attributes'][_0xa5a6('0x3c')]?_0x408784['attributes']:_0xb79b9f['model'];if(_0x5df76f[_0xa5a6('0x37')][_0xa5a6('0x47')]){_0x408784[_0xa5a6('0x4d')]=[{'all':!![]}];}_0x408784=_[_0xa5a6('0x44')]({},_0x408784,_0x5df76f[_0xa5a6('0x46')]);return db[_0xa5a6('0x31')][_0xa5a6('0x4e')](_0x408784)[_0xa5a6('0x2a')](handleEntityNotFound(_0x24fdb,null))[_0xa5a6('0x2a')](respondWithResult(_0x24fdb,null))['catch'](handleError(_0x24fdb,null));};exports[_0xa5a6('0x4f')]=function(_0x168dc8,_0x332146){return db[_0xa5a6('0x31')]['create'](_0x168dc8['body'],{})['then'](respondWithResult(_0x332146,0xc9))['catch'](handleError(_0x332146,null));};exports['update']=function(_0x248ea2,_0x371ae7){if(_0x248ea2['body']['id']){delete _0x248ea2[_0xa5a6('0x50')]['id'];}return db[_0xa5a6('0x31')]['find']({'where':{'id':_0x248ea2['params']['id']}})[_0xa5a6('0x2a')](handleEntityNotFound(_0x371ae7,null))[_0xa5a6('0x2a')](saveUpdates(_0x248ea2[_0xa5a6('0x50')],null))[_0xa5a6('0x2a')](respondWithResult(_0x371ae7,null))[_0xa5a6('0x4a')](handleError(_0x371ae7,null));};exports[_0xa5a6('0x29')]=function(_0x521ccb,_0x3a2396){return db[_0xa5a6('0x31')][_0xa5a6('0x4e')]({'where':{'id':_0x521ccb[_0xa5a6('0x51')]['id']}})[_0xa5a6('0x2a')](handleEntityNotFound(_0x3a2396,null))[_0xa5a6('0x2a')](removeEntity(_0x3a2396,null))[_0xa5a6('0x4a')](handleError(_0x3a2396,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 47df8e8..5fc8416 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 _0x5233=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x30213f,_0x250df6){var _0x46c6a6=function(_0x16458e){while(--_0x16458e){_0x30213f['push'](_0x30213f['shift']());}};_0x46c6a6(++_0x250df6);}(_0x5233,0xcd));var _0x3523=function(_0x894410,_0x51b635){_0x894410=_0x894410-0x0;var _0x1dbfb0=_0x5233[_0x894410];return _0x1dbfb0;};'use strict';var _=require(_0x3523('0x0'));var util=require('util');var logger=require(_0x3523('0x1'))(_0x3523('0x2'));var moment=require(_0x3523('0x3'));var BPromise=require(_0x3523('0x4'));var rp=require(_0x3523('0x5'));var fs=require('fs');var path=require(_0x3523('0x6'));var rimraf=require(_0x3523('0x7'));var config=require(_0x3523('0x8'));var attributes=require('./faxApplication.attributes');module[_0x3523('0x9')]=function(_0x13950c,_0x43392a){return _0x13950c['define'](_0x3523('0xa'),attributes,{'tableName':_0x3523('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3523('0xc')});}; \ No newline at end of file +var _0xd73f=['api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x42c209,_0x5550f6){var _0x4f6b85=function(_0x4137ba){while(--_0x4137ba){_0x42c209['push'](_0x42c209['shift']());}};_0x4f6b85(++_0x5550f6);}(_0xd73f,0x11c));var _0xfd73=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xd73f[_0x99868f];return _0x27a71b;};'use strict';var _=require(_0xfd73('0x0'));var util=require('util');var logger=require(_0xfd73('0x1'))(_0xfd73('0x2'));var moment=require(_0xfd73('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd73('0x4'));var fs=require('fs');var path=require(_0xfd73('0x5'));var rimraf=require('rimraf');var config=require(_0xfd73('0x6'));var attributes=require(_0xfd73('0x7'));module[_0xfd73('0x8')]=function(_0x330c0a,_0x1d1863){return _0x330c0a[_0xfd73('0x9')](_0xfd73('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd73('0xb'),'collate':_0xfd73('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index fb1352d..cbd9a9d 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 _0x57e3=['error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x217217,_0x11af96){var _0x13d6e8=function(_0x3bbfcf){while(--_0x3bbfcf){_0x217217['push'](_0x217217['shift']());}};_0x13d6e8(++_0x11af96);}(_0x57e3,0x1b0));var _0x357e=function(_0x24916f,_0x5f4db5){_0x24916f=_0x24916f-0x0;var _0x2f0e83=_0x57e3[_0x24916f];return _0x2f0e83;};'use strict';var _=require('lodash');var util=require(_0x357e('0x0'));var moment=require(_0x357e('0x1'));var BPromise=require(_0x357e('0x2'));var rs=require(_0x357e('0x3'));var fs=require('fs');var Redis=require(_0x357e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x357e('0x5'));var logger=require(_0x357e('0x6'))(_0x357e('0x7'));var config=require(_0x357e('0x8'));var jayson=require(_0x357e('0x9'));var client=jayson[_0x357e('0xa')][_0x357e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x559b2c,_0x514704,_0x1b72d0){return new BPromise(function(_0x17be7b,_0x335664){return client['request'](_0x559b2c,_0x1b72d0)[_0x357e('0xc')](function(_0x3df4aa){logger[_0x357e('0xd')](_0x357e('0xe'),_0x514704,_0x357e('0xf'));logger[_0x357e('0x10')](_0x357e('0x11'),_0x514704,_0x357e('0xf'),JSON['stringify'](_0x3df4aa));if(_0x3df4aa[_0x357e('0x12')]){if(_0x3df4aa['error'][_0x357e('0x13')]===0x1f4){logger['error'](_0x357e('0xe'),_0x514704,_0x3df4aa[_0x357e('0x12')][_0x357e('0x14')]);return _0x335664(_0x3df4aa[_0x357e('0x12')]['message']);}logger[_0x357e('0x12')](_0x357e('0xe'),_0x514704,_0x3df4aa[_0x357e('0x12')]['message']);return _0x17be7b(_0x3df4aa[_0x357e('0x12')][_0x357e('0x14')]);}else{logger[_0x357e('0xd')](_0x357e('0xe'),_0x514704,_0x357e('0xf'));_0x17be7b(_0x3df4aa[_0x357e('0x15')][_0x357e('0x14')]);}})[_0x357e('0x16')](function(_0x468b8e){logger[_0x357e('0x12')](_0x357e('0xe'),_0x514704,_0x468b8e);_0x335664(_0x468b8e);});});}exports[_0x357e('0x17')]=function(_0x585430){var _0x8054b8=this;return new Promise(function(_0x49dd1f,_0x54c691){return db[_0x357e('0x18')][_0x357e('0x19')](_0x585430[_0x357e('0x1a')],{'raw':_0x585430[_0x357e('0x1b')]?_0x585430[_0x357e('0x1b')][_0x357e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x585430['options']?_0x585430[_0x357e('0x1b')][_0x357e('0x1d')]||null:null,'attributes':_0x585430['options']?_0x585430[_0x357e('0x1b')]['attributes']||null:null,'limit':_0x585430[_0x357e('0x1b')]?_0x585430[_0x357e('0x1b')]['limit']||null:null})[_0x357e('0xc')](function(_0x82f10a){logger['info'](_0x357e('0x17'),_0x585430);logger['debug'](_0x357e('0x17'),_0x585430,JSON['stringify'](_0x82f10a));_0x49dd1f(_0x82f10a);})['catch'](function(_0x5a11c8){logger[_0x357e('0x12')](_0x357e('0x17'),_0x5a11c8['message'],_0x585430);_0x54c691(_0x8054b8['error'](0x1f4,_0x5a11c8[_0x357e('0x14')]));});});}; \ No newline at end of file +var _0x844e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird'];(function(_0x1d486f,_0x2f36f2){var _0x445420=function(_0x1db1f7){while(--_0x1db1f7){_0x1d486f['push'](_0x1d486f['shift']());}};_0x445420(++_0x2f36f2);}(_0x844e,0x7c));var _0xe844=function(_0x34e947,_0x6cde76){_0x34e947=_0x34e947-0x0;var _0x591c2c=_0x844e[_0x34e947];return _0x591c2c;};'use strict';var _=require(_0xe844('0x0'));var util=require(_0xe844('0x1'));var moment=require(_0xe844('0x2'));var BPromise=require(_0xe844('0x3'));var rs=require(_0xe844('0x4'));var fs=require('fs');var Redis=require(_0xe844('0x5'));var db=require(_0xe844('0x6'))['db'];var utils=require(_0xe844('0x7'));var logger=require(_0xe844('0x8'))(_0xe844('0x9'));var config=require(_0xe844('0xa'));var jayson=require(_0xe844('0xb'));var client=jayson[_0xe844('0xc')][_0xe844('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2543e7,_0x256eb3,_0x50dcb3){return new BPromise(function(_0x417886,_0x234f4f){return client['request'](_0x2543e7,_0x50dcb3)[_0xe844('0xe')](function(_0x147038){logger[_0xe844('0xf')](_0xe844('0x10'),_0x256eb3,_0xe844('0x11'));logger[_0xe844('0x12')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x256eb3,'request\x20sent',JSON[_0xe844('0x13')](_0x147038));if(_0x147038[_0xe844('0x14')]){if(_0x147038[_0xe844('0x14')][_0xe844('0x15')]===0x1f4){logger[_0xe844('0x14')](_0xe844('0x10'),_0x256eb3,_0x147038[_0xe844('0x14')]['message']);return _0x234f4f(_0x147038[_0xe844('0x14')]['message']);}logger[_0xe844('0x14')](_0xe844('0x10'),_0x256eb3,_0x147038[_0xe844('0x14')][_0xe844('0x16')]);return _0x417886(_0x147038[_0xe844('0x14')][_0xe844('0x16')]);}else{logger[_0xe844('0xf')]('FaxApplication,\x20%s,\x20%s',_0x256eb3,_0xe844('0x11'));_0x417886(_0x147038['result']['message']);}})[_0xe844('0x17')](function(_0x280f76){logger[_0xe844('0x14')](_0xe844('0x10'),_0x256eb3,_0x280f76);_0x234f4f(_0x280f76);});});}exports[_0xe844('0x18')]=function(_0x5413aa){var _0x2380ce=this;return new Promise(function(_0x22d7d9,_0x4a0bd4){return db[_0xe844('0x19')][_0xe844('0x1a')](_0x5413aa[_0xe844('0x1b')],{'raw':_0x5413aa[_0xe844('0x1c')]?_0x5413aa[_0xe844('0x1c')][_0xe844('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5413aa['options']?_0x5413aa[_0xe844('0x1c')][_0xe844('0x1e')]||null:null,'attributes':_0x5413aa[_0xe844('0x1c')]?_0x5413aa['options']['attributes']||null:null,'limit':_0x5413aa[_0xe844('0x1c')]?_0x5413aa['options'][_0xe844('0x1f')]||null:null})[_0xe844('0xe')](function(_0x2c199c){logger[_0xe844('0xf')](_0xe844('0x18'),_0x5413aa);logger[_0xe844('0x12')](_0xe844('0x18'),_0x5413aa,JSON[_0xe844('0x13')](_0x2c199c));_0x22d7d9(_0x2c199c);})['catch'](function(_0x4dc032){logger[_0xe844('0x14')](_0xe844('0x18'),_0x4dc032['message'],_0x5413aa);_0x4a0bd4(_0x2380ce[_0xe844('0x14')](0x1f4,_0x4dc032[_0xe844('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 6434eb3..7c00f46 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 _0xef0f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0xef0f,0x168));var _0xfef0=function(_0xb52a30,_0x9b4336){_0xb52a30=_0xb52a30-0x0;var _0x160875=_0xef0f[_0xb52a30];return _0x160875;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['post']('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xd')]);router[_0xfef0('0xe')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xf')]);router[_0xfef0('0x10')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x11')]);module[_0xfef0('0x12')]=router; \ No newline at end of file +var _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x37d57e,_0x3fa870){var _0xb20f2f=function(_0x1da285){while(--_0x1da285){_0x37d57e['push'](_0x37d57e['shift']());}};_0xb20f2f(++_0x3fa870);}(_0x7708,0x188));var _0x8770=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0x7708[_0x2d8f6c];return _0x3a00f6;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d4ffd6c..2f9c769 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 _0x654c=['out','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x3947aa,_0x2b6e88){var _0x2b7b02=function(_0x2abbb7){while(--_0x2abbb7){_0x3947aa['push'](_0x3947aa['shift']());}};_0x2b7b02(++_0x2b6e88);}(_0x654c,0x11b));var _0xc654=function(_0x3e33f0,_0x479359){_0x3e33f0=_0x3e33f0-0x0;var _0x1f8e53=_0x654c[_0x3e33f0];return _0x1f8e53;};'use strict';var Sequelize=require('sequelize');module[_0xc654('0x0')]={'closed':{'type':Sequelize[_0xc654('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc654('0x2')]},'secondDisposition':{'type':Sequelize[_0xc654('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc654('0x2')]},'read1stAt':{'type':Sequelize[_0xc654('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xc654('0x4')]('in',_0xc654('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc654('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc654('0x4')]('in',_0xc654('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6462=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x3da695,_0x13fbd7){var _0x2cf602=function(_0x2b49f1){while(--_0x2b49f1){_0x3da695['push'](_0x3da695['shift']());}};_0x2cf602(++_0x13fbd7);}(_0x6462,0x163));var _0x2646=function(_0x2accee,_0x7dcc8){_0x2accee=_0x2accee-0x0;var _0x250a88=_0x6462[_0x2accee];return _0x250a88;};'use strict';var Sequelize=require(_0x2646('0x0'));module[_0x2646('0x1')]={'closed':{'type':Sequelize[_0x2646('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2646('0x3')]},'secondDisposition':{'type':Sequelize[_0x2646('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2646('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2646('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x2646('0x5')]('in',_0x2646('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2646('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2646('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f9df95d..e0e5dc6 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 _0x3f43=['findAll','rows','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','log','unlinkSync','rimraf','zip-dir','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','show','params','model','keys','query','filters','attributes','fields','length','includeAll','merge','options','catch','create','body','find','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','intersection','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include'];(function(_0x25936c,_0x3eade9){var _0x152624=function(_0x1ff27a){while(--_0x1ff27a){_0x25936c['push'](_0x25936c['shift']());}};_0x152624(++_0x3eade9);}(_0x3f43,0xf6));var _0x33f4=function(_0x9c7a11,_0x215614){_0x9c7a11=_0x9c7a11-0x0;var _0x5331da=_0x3f43[_0x9c7a11];return _0x5331da;};'use strict';var rimraf=require(_0x33f4('0x0'));var zipdir=require(_0x33f4('0x1'));var moment=require('moment');var BPromise=require(_0x33f4('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x33f4('0x3'));var Redis=require(_0x33f4('0x4'));var interaction=require(_0x33f4('0x5'));var qs=require(_0x33f4('0x6'));var logger=require(_0x33f4('0x7'))('api');var config=require(_0x33f4('0x8'));var db=require(_0x33f4('0x9'))['db'];config['redis']=_[_0x33f4('0xa')](config[_0x33f4('0xb')],{'host':_0x33f4('0xc'),'port':0x18eb});var socket=require(_0x33f4('0xd'))(new Redis(config['redis']));require(_0x33f4('0xe'))[_0x33f4('0xf')](socket);function respondWithStatusCode(_0x28b72c,_0x555e1d){_0x555e1d=_0x555e1d||0xcc;return function(_0x28f1f7){if(_0x28f1f7){return _0x28b72c[_0x33f4('0x10')](_0x555e1d);}return _0x28b72c[_0x33f4('0x11')](_0x555e1d)[_0x33f4('0x12')]();};}function respondWithResult(_0x5d28ce,_0x451487){_0x451487=_0x451487||0xc8;return function(_0x3e18f0){if(_0x3e18f0){return _0x5d28ce[_0x33f4('0x11')](_0x451487)[_0x33f4('0x13')](_0x3e18f0);}};}function respondWithFilteredResult(_0x1f000e,_0x3289d2){return function(_0xae1e65){if(_0xae1e65){var _0x50cf84=typeof _0x3289d2[_0x33f4('0x14')]===_0x33f4('0x15')&&typeof _0x3289d2['limit']==='undefined';var _0x321294=_0xae1e65[_0x33f4('0x16')];var _0x18638e=_0x50cf84?0x0:_0x3289d2[_0x33f4('0x14')];var _0x42a657=_0x50cf84?_0xae1e65['count']:_0x3289d2[_0x33f4('0x14')]+_0x3289d2[_0x33f4('0x17')];var _0x48e16c;if(_0x42a657>=_0x321294){_0x42a657=_0x321294;_0x48e16c=0xc8;}else{_0x48e16c=0xce;}_0x1f000e[_0x33f4('0x11')](_0x48e16c);return _0x1f000e[_0x33f4('0x18')](_0x33f4('0x19'),_0x18638e+'-'+_0x42a657+'/'+_0x321294)[_0x33f4('0x13')](_0xae1e65);}return null;};}function saveUpdates(_0x27f21a){return function(_0x2a2d3e){if(_0x2a2d3e){return _0x2a2d3e[_0x33f4('0x1a')](_0x27f21a)[_0x33f4('0x1b')](function(_0x1bfb3a){return _0x1bfb3a;});}return null;};}function removeEntity(_0x3af829){return function(_0x2fdc24){if(_0x2fdc24){return _0x2fdc24[_0x33f4('0x1c')]()[_0x33f4('0x1b')](function(){_0x3af829[_0x33f4('0x11')](0xcc)[_0x33f4('0x12')]();});}};}function handleEntityNotFound(_0xc31c9b){return function(_0x2dd1b4){if(!_0x2dd1b4){_0xc31c9b[_0x33f4('0x10')](0x194);}return _0x2dd1b4;};}function handleError(_0x264660,_0x49e3ea){_0x49e3ea=_0x49e3ea||0x1f4;return function(_0x309ed0){logger[_0x33f4('0x1d')](_0x309ed0[_0x33f4('0x1e')]);if(_0x309ed0['name']){delete _0x309ed0[_0x33f4('0x1f')];}_0x264660['status'](_0x49e3ea)[_0x33f4('0x20')](_0x309ed0);};}exports[_0x33f4('0x21')]=function(_0x471431,_0x30760c){var _0x5e5cab={};var _0xdfa50e=_[_0x33f4('0x22')](db[_0x33f4('0x23')][_0x33f4('0x24')],function(_0x55ad2d){return{'name':_0x55ad2d[_0x33f4('0x25')],'type':_0x55ad2d[_0x33f4('0x26')][_0x33f4('0x27')]};});_0x5e5cab=qs[_0x33f4('0x28')](_0xdfa50e,_0x471431);return interaction['findAll']('fax',_0x471431['query'],_0x471431['user'],_0x5e5cab,_0xdfa50e)['then'](respondWithFilteredResult(_0x30760c,_0x5e5cab))['catch'](handleError(_0x30760c,null));};exports[_0x33f4('0x29')]=function(_0x333d24,_0x5f2e8f){var _0x5660f0={'raw':![],'where':{'id':_0x333d24[_0x33f4('0x2a')]['id']}},_0x383270={};_0x383270[_0x33f4('0x2b')]=_[_0x33f4('0x2c')](db[_0x33f4('0x23')][_0x33f4('0x24')]);_0x383270[_0x33f4('0x2d')]=_[_0x33f4('0x2c')](_0x333d24[_0x33f4('0x2d')]);_0x383270[_0x33f4('0x2e')]=_['intersection'](_0x383270[_0x33f4('0x2b')],_0x383270[_0x33f4('0x2d')]);_0x5660f0[_0x33f4('0x2f')]=_['intersection'](_0x383270[_0x33f4('0x2b')],qs[_0x33f4('0x30')](_0x333d24[_0x33f4('0x2d')][_0x33f4('0x30')]));_0x5660f0[_0x33f4('0x2f')]=_0x5660f0[_0x33f4('0x2f')][_0x33f4('0x31')]?_0x5660f0['attributes']:_0x383270[_0x33f4('0x2b')];if(_0x333d24[_0x33f4('0x2d')][_0x33f4('0x32')]){_0x5660f0['include']=[{'all':!![]}];}_0x5660f0=_[_0x33f4('0x33')]({},_0x5660f0,_0x333d24[_0x33f4('0x34')]);return db[_0x33f4('0x23')]['find'](_0x5660f0)[_0x33f4('0x1b')](handleEntityNotFound(_0x5f2e8f,null))[_0x33f4('0x1b')](respondWithResult(_0x5f2e8f,null))[_0x33f4('0x35')](handleError(_0x5f2e8f,null));};exports['create']=function(_0x357651,_0x4831c0){return db['FaxInteraction'][_0x33f4('0x36')](_0x357651['body'],{})['then'](respondWithResult(_0x4831c0,0xc9))[_0x33f4('0x35')](handleError(_0x4831c0,null));};exports[_0x33f4('0x1a')]=function(_0x1d8143,_0x7bf190){if(_0x1d8143[_0x33f4('0x37')]['id']){delete _0x1d8143[_0x33f4('0x37')]['id'];}return db['FaxInteraction'][_0x33f4('0x38')]({'where':{'id':_0x1d8143[_0x33f4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x7bf190,null))[_0x33f4('0x1b')](saveUpdates(_0x1d8143[_0x33f4('0x37')],null))[_0x33f4('0x1b')](respondWithResult(_0x7bf190,null))[_0x33f4('0x35')](handleError(_0x7bf190,null));};exports[_0x33f4('0x1c')]=function(_0x4bba3d,_0x51d8c3){return db['FaxInteraction']['find']({'where':{'id':_0x4bba3d['params']['id']}})['then'](handleEntityNotFound(_0x51d8c3,null))['then'](removeEntity(_0x51d8c3,null))[_0x33f4('0x35')](handleError(_0x51d8c3,null));};exports[_0x33f4('0x39')]=function(_0x476678,_0x4d696a){return db[_0x33f4('0x23')]['describe']()['then'](respondWithResult(_0x4d696a,null))[_0x33f4('0x35')](handleError(_0x4d696a,null));};exports['addMessage']=function(_0x46e957,_0x195e22){return db[_0x33f4('0x3a')][_0x33f4('0x38')]({'where':{'id':_0x46e957[_0x33f4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x195e22,null))[_0x33f4('0x1b')](function(_0x5d89d6){if(_0x5d89d6){return _0x5d89d6[_0x33f4('0x3b')](_0x46e957[_0x33f4('0x37')][_0x33f4('0x3c')],_[_0x33f4('0x3d')](_0x46e957['body'],[_0x33f4('0x3c'),'id'])||{});}})[_0x33f4('0x1b')](respondWithResult(_0x195e22,null))[_0x33f4('0x35')](handleError(_0x195e22,null));};exports[_0x33f4('0x3e')]=function(_0x153d84,_0x48b131){var _0x249104={'raw':![],'where':{}};var _0x3137e3={};var _0xb07acc={'count':0x0,'rows':[]};return db[_0x33f4('0x23')][_0x33f4('0x3f')]({'where':{'id':_0x153d84[_0x33f4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48b131,null))[_0x33f4('0x1b')](function(_0x22c80f){if(_0x22c80f){_0x3137e3[_0x33f4('0x2b')]=_[_0x33f4('0x2c')](db[_0x33f4('0x3a')][_0x33f4('0x24')]);_0x3137e3[_0x33f4('0x2d')]=_[_0x33f4('0x2c')](_0x153d84[_0x33f4('0x2d')]);_0x3137e3[_0x33f4('0x2e')]=_[_0x33f4('0x40')](_0x3137e3[_0x33f4('0x2b')],_0x3137e3['query']);_0x249104[_0x33f4('0x2f')]=_[_0x33f4('0x40')](_0x3137e3[_0x33f4('0x2b')],qs[_0x33f4('0x30')](_0x153d84[_0x33f4('0x2d')]['fields']));_0x249104['attributes']=_0x249104[_0x33f4('0x2f')][_0x33f4('0x31')]?_0x249104['attributes']:_0x3137e3[_0x33f4('0x2b')];if(!_0x153d84[_0x33f4('0x2d')]['hasOwnProperty'](_0x33f4('0x41'))){_0x249104['limit']=qs['limit'](_0x153d84['query'][_0x33f4('0x17')]);_0x249104[_0x33f4('0x14')]=qs['offset'](_0x153d84[_0x33f4('0x2d')][_0x33f4('0x14')]);}_0x249104[_0x33f4('0x42')]=qs[_0x33f4('0x43')](_0x153d84[_0x33f4('0x2d')][_0x33f4('0x43')]);_0x249104[_0x33f4('0x44')]=qs[_0x33f4('0x2e')](_[_0x33f4('0x45')](_0x153d84[_0x33f4('0x2d')],_0x3137e3[_0x33f4('0x2e')]));_0x249104[_0x33f4('0x44')]['FaxInteractionId']=_0x22c80f['id'];if(_0x153d84[_0x33f4('0x2d')][_0x33f4('0x46')]){_0x249104[_0x33f4('0x44')]=_[_0x33f4('0x33')](_0x249104[_0x33f4('0x44')],{'$or':_['map'](_0x249104[_0x33f4('0x2f')],function(_0x51e410){var _0x48e2ae={};_0x48e2ae[_0x51e410]={'$like':'%'+_0x153d84[_0x33f4('0x2d')]['filter']+'%'};return _0x48e2ae;})});}if(_0x153d84[_0x33f4('0x2d')]['$gte']){var _0x491f26=_0x153d84[_0x33f4('0x2d')][_0x33f4('0x47')][_0x33f4('0x48')](',');var _0xaabbd3={};_0xaabbd3[_0x491f26[0x0]]={'$gte':moment(_0x491f26[0x1])['format'](_0x33f4('0x49'))};_0x249104[_0x33f4('0x44')]=_[_0x33f4('0x33')](_0x249104['where'],_0xaabbd3);}_0x249104=_[_0x33f4('0x33')]({},_0x249104,_0x153d84['options']);return db[_0x33f4('0x3a')][_0x33f4('0x16')]({'where':_0x249104[_0x33f4('0x44')]})['then'](function(_0x26c10c){_0xb07acc[_0x33f4('0x16')]=_0x26c10c;if(_0x153d84[_0x33f4('0x2d')][_0x33f4('0x32')]){_0x249104[_0x33f4('0x4a')]=[{'all':!![]}];}return db[_0x33f4('0x3a')][_0x33f4('0x4b')](_0x249104);})[_0x33f4('0x1b')](function(_0x71fd35){_0xb07acc[_0x33f4('0x4c')]=_0x71fd35;return _0xb07acc;});}})[_0x33f4('0x1b')](respondWithFilteredResult(_0x48b131,_0x249104))[_0x33f4('0x35')](handleError(_0x48b131,null));};exports['addTags']=function(_0x1f8ff7,_0x9faf0f){return db['FaxInteraction'][_0x33f4('0x38')]({'where':{'id':_0x1f8ff7[_0x33f4('0x2a')]['id']}})[_0x33f4('0x1b')](handleEntityNotFound(_0x9faf0f,null))[_0x33f4('0x1b')](function(_0x95ce7f){if(_0x95ce7f){return _0x95ce7f[_0x33f4('0x4d')](_0x1f8ff7[_0x33f4('0x37')]['ids'],_['omit'](_0x1f8ff7['body'],['ids','id'])||{})[_0x33f4('0x4e')](function(){return db['Tag'][_0x33f4('0x4b')]({'attributes':['id','name',_0x33f4('0x4f')],'where':{'id':_0x1f8ff7[_0x33f4('0x37')]['ids']}});})['then'](function(_0x424c3e){socket[_0x33f4('0x50')](_0x33f4('0x51'),{'id':Number(_0x1f8ff7[_0x33f4('0x2a')]['id']),'tags':_0x424c3e||[]});return{'id':Number(_0x1f8ff7[_0x33f4('0x2a')]['id']),'tags':_0x424c3e||[]};});}})[_0x33f4('0x1b')](respondWithResult(_0x9faf0f,null))[_0x33f4('0x35')](handleError(_0x9faf0f,null));};exports[_0x33f4('0x52')]=function(_0x1595ee,_0x16113e){return db[_0x33f4('0x23')][_0x33f4('0x38')]({'where':{'id':_0x1595ee[_0x33f4('0x2a')]['id']}})['then'](handleEntityNotFound(_0x16113e,null))[_0x33f4('0x1b')](function(_0x4c3545){if(_0x4c3545){return _0x4c3545[_0x33f4('0x52')](_0x1595ee[_0x33f4('0x2d')]['ids']);}})[_0x33f4('0x1b')](respondWithStatusCode(_0x16113e,null))[_0x33f4('0x35')](handleError(_0x16113e,null));};exports[_0x33f4('0x53')]=function(_0x40e1ae,_0x139072){var _0x360cfc=moment()[_0x33f4('0x54')]()[_0x33f4('0x55')]();var _0x1c4a7e=path[_0x33f4('0x56')](config[_0x33f4('0x57')],_0x33f4('0x58'),_0x33f4('0x59'),_0x33f4('0x5a'));var _0x2aa803=path[_0x33f4('0x56')](config[_0x33f4('0x57')],_0x33f4('0x58'),_0x33f4('0x59'),_0x33f4('0x5b'));var _0x35379b=path[_0x33f4('0x56')](_0x1c4a7e,_0x360cfc);var _0x393d9d=util[_0x33f4('0x5c')](_0x33f4('0x5d'),_0x40e1ae[_0x33f4('0x2a')]['id'],_0x360cfc);var _0x204994=path['join'](_0x1c4a7e,_0x393d9d);var _0x163fca=[];_0x163fca[_0x33f4('0x5e')]({'model':db[_0x33f4('0x5f')],'as':_0x33f4('0x5f'),'raw':!![]});var _0x347f5d=[{'model':db[_0x33f4('0x3a')],'as':_0x33f4('0x60'),'attributes':['id',_0x33f4('0x37'),_0x33f4('0x61')],'include':_0x163fca}];return db[_0x33f4('0x23')][_0x33f4('0x38')]({'where':{'id':_0x40e1ae[_0x33f4('0x2a')]['id']},'include':_0x347f5d})[_0x33f4('0x1b')](handleEntityNotFound(_0x139072,null))[_0x33f4('0x1b')](function(_0x118685){if(_0x118685&&_0x118685[_0x33f4('0x60')]){var _0x7f8bc7=_0x118685[_0x33f4('0x62')]({'plain':!![]});fs[_0x33f4('0x63')](_0x35379b);for(var _0x3c9e4c=0x0;_0x3c9e4c<_0x7f8bc7[_0x33f4('0x60')][_0x33f4('0x31')];_0x3c9e4c++){var _0xb37f54=_0x7f8bc7[_0x33f4('0x60')][_0x3c9e4c]['Attachment'];if(_0xb37f54){var _0x502891=path[_0x33f4('0x56')](_0x2aa803,_0xb37f54[_0x33f4('0x64')]);if(fs[_0x33f4('0x65')](_0x502891)){fs[_0x33f4('0x66')](_0x502891)[_0x33f4('0x67')](fs['createWriteStream'](path[_0x33f4('0x56')](_0x35379b,_0xb37f54[_0x33f4('0x64')])));}}}return BPromise[_0x33f4('0x68')]()[_0x33f4('0x1b')](function(){return new BPromise(function(_0x4c8ee1,_0x4e74e9){zipdir(_0x35379b,{'saveTo':_0x204994},function(_0x2a5d52,_0x337a36){if(_0x2a5d52)return _0x4e74e9(_0x2a5d52);return _0x4c8ee1(_0x337a36);});})[_0x33f4('0x1b')](function(){return new BPromise(function(_0x54d522,_0x6e3451){rimraf(_0x35379b,function(_0x5a0b8a){if(_0x5a0b8a)_0x6e3451(_0x5a0b8a);return _0x54d522();});});})[_0x33f4('0x1b')](function(){return _0x139072[_0x33f4('0x53')](_0x204994,_0x393d9d,function(_0x11ea48){if(_0x11ea48){console[_0x33f4('0x69')]('err',_0x11ea48);}else{fs[_0x33f4('0x6a')](_0x204994);}});});});}else{return _0x139072[_0x33f4('0x10')](0xc8);}})[_0x33f4('0x35')](handleError(_0x139072,null));}; \ No newline at end of file +var _0xe810=['join','server','files','tmp','transcript-%d-%s.zip','push','Attachment','Messages','basename','existsSync','createReadStream','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','destroy','then','stack','name','send','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','user','catch','show','keys','query','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','order','where','pick','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','download','toString'];(function(_0xeb2f3e,_0x19cd2d){var _0xb15151=function(_0x1b051c){while(--_0x1b051c){_0xeb2f3e['push'](_0xeb2f3e['shift']());}};_0xb15151(++_0x19cd2d);}(_0xe810,0xd4));var _0x0e81=function(_0x134e02,_0x4b2b9b){_0x134e02=_0x134e02-0x0;var _0x211937=_0xe810[_0x134e02];return _0x211937;};'use strict';var rimraf=require(_0x0e81('0x0'));var zipdir=require(_0x0e81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0e81('0x2'));var path=require(_0x0e81('0x3'));var fs=require('fs');var _=require(_0x0e81('0x4'));var Redis=require(_0x0e81('0x5'));var interaction=require(_0x0e81('0x6'));var qs=require(_0x0e81('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x0e81('0x8'));var db=require(_0x0e81('0x9'))['db'];config[_0x0e81('0xa')]=_['defaults'](config[_0x0e81('0xa')],{'host':_0x0e81('0xb'),'port':0x18eb});var socket=require(_0x0e81('0xc'))(new Redis(config[_0x0e81('0xa')]));require(_0x0e81('0xd'))[_0x0e81('0xe')](socket);function respondWithStatusCode(_0x2ce6c9,_0x3d4ce0){_0x3d4ce0=_0x3d4ce0||0xcc;return function(_0x69d64a){if(_0x69d64a){return _0x2ce6c9[_0x0e81('0xf')](_0x3d4ce0);}return _0x2ce6c9[_0x0e81('0x10')](_0x3d4ce0)[_0x0e81('0x11')]();};}function respondWithResult(_0x187e31,_0x10d16e){_0x10d16e=_0x10d16e||0xc8;return function(_0x1cf405){if(_0x1cf405){return _0x187e31[_0x0e81('0x10')](_0x10d16e)[_0x0e81('0x12')](_0x1cf405);}};}function respondWithFilteredResult(_0x14b110,_0x24683c){return function(_0x2891d6){if(_0x2891d6){var _0x31fee0=typeof _0x24683c['offset']===_0x0e81('0x13')&&typeof _0x24683c['limit']==='undefined';var _0x3ca485=_0x2891d6['count'];var _0x1ed6d4=_0x31fee0?0x0:_0x24683c[_0x0e81('0x14')];var _0x317888=_0x31fee0?_0x2891d6[_0x0e81('0x15')]:_0x24683c['offset']+_0x24683c[_0x0e81('0x16')];var _0x52634f;if(_0x317888>=_0x3ca485){_0x317888=_0x3ca485;_0x52634f=0xc8;}else{_0x52634f=0xce;}_0x14b110['status'](_0x52634f);return _0x14b110[_0x0e81('0x17')](_0x0e81('0x18'),_0x1ed6d4+'-'+_0x317888+'/'+_0x3ca485)[_0x0e81('0x12')](_0x2891d6);}return null;};}function saveUpdates(_0xaa5ee2){return function(_0x8e2a4){if(_0x8e2a4){return _0x8e2a4['update'](_0xaa5ee2)['then'](function(_0x4b9b76){return _0x4b9b76;});}return null;};}function removeEntity(_0x1fe87a){return function(_0x34589b){if(_0x34589b){return _0x34589b[_0x0e81('0x19')]()[_0x0e81('0x1a')](function(){_0x1fe87a['status'](0xcc)[_0x0e81('0x11')]();});}};}function handleEntityNotFound(_0x5e69fc){return function(_0x39355a){if(!_0x39355a){_0x5e69fc[_0x0e81('0xf')](0x194);}return _0x39355a;};}function handleError(_0x6f8dc6,_0x253654){_0x253654=_0x253654||0x1f4;return function(_0xb9a654){logger['error'](_0xb9a654[_0x0e81('0x1b')]);if(_0xb9a654[_0x0e81('0x1c')]){delete _0xb9a654[_0x0e81('0x1c')];}_0x6f8dc6[_0x0e81('0x10')](_0x253654)[_0x0e81('0x1d')](_0xb9a654);};}exports['index']=function(_0x45a2ef,_0x1db2a1){var _0x17c856={};var _0x48bc4b=_['map'](db[_0x0e81('0x1e')][_0x0e81('0x1f')],function(_0x3e0f81){return{'name':_0x3e0f81['fieldName'],'type':_0x3e0f81[_0x0e81('0x20')][_0x0e81('0x21')]};});_0x17c856=qs[_0x0e81('0x22')](_0x48bc4b,_0x45a2ef);return interaction[_0x0e81('0x23')](_0x0e81('0x24'),_0x45a2ef['query'],_0x45a2ef[_0x0e81('0x25')],_0x17c856,_0x48bc4b)['then'](respondWithFilteredResult(_0x1db2a1,_0x17c856))[_0x0e81('0x26')](handleError(_0x1db2a1,null));};exports[_0x0e81('0x27')]=function(_0x40d691,_0x47fa85){var _0x3f8f54={'raw':![],'where':{'id':_0x40d691['params']['id']}},_0xcc9a88={};_0xcc9a88['model']=_[_0x0e81('0x28')](db[_0x0e81('0x1e')]['rawAttributes']);_0xcc9a88['query']=_[_0x0e81('0x28')](_0x40d691[_0x0e81('0x29')]);_0xcc9a88['filters']=_['intersection'](_0xcc9a88[_0x0e81('0x2a')],_0xcc9a88['query']);_0x3f8f54[_0x0e81('0x2b')]=_[_0x0e81('0x2c')](_0xcc9a88['model'],qs[_0x0e81('0x2d')](_0x40d691[_0x0e81('0x29')]['fields']));_0x3f8f54[_0x0e81('0x2b')]=_0x3f8f54['attributes'][_0x0e81('0x2e')]?_0x3f8f54['attributes']:_0xcc9a88[_0x0e81('0x2a')];if(_0x40d691['query'][_0x0e81('0x2f')]){_0x3f8f54[_0x0e81('0x30')]=[{'all':!![]}];}_0x3f8f54=_[_0x0e81('0x31')]({},_0x3f8f54,_0x40d691[_0x0e81('0x32')]);return db['FaxInteraction'][_0x0e81('0x33')](_0x3f8f54)['then'](handleEntityNotFound(_0x47fa85,null))[_0x0e81('0x1a')](respondWithResult(_0x47fa85,null))[_0x0e81('0x26')](handleError(_0x47fa85,null));};exports[_0x0e81('0x34')]=function(_0x57a7a8,_0x495b56){return db[_0x0e81('0x1e')][_0x0e81('0x34')](_0x57a7a8[_0x0e81('0x35')],{})[_0x0e81('0x1a')](respondWithResult(_0x495b56,0xc9))[_0x0e81('0x26')](handleError(_0x495b56,null));};exports[_0x0e81('0x36')]=function(_0x5931b7,_0x3bddd8){if(_0x5931b7[_0x0e81('0x35')]['id']){delete _0x5931b7[_0x0e81('0x35')]['id'];}return db['FaxInteraction'][_0x0e81('0x33')]({'where':{'id':_0x5931b7[_0x0e81('0x37')]['id']}})['then'](handleEntityNotFound(_0x3bddd8,null))[_0x0e81('0x1a')](saveUpdates(_0x5931b7[_0x0e81('0x35')],null))[_0x0e81('0x1a')](respondWithResult(_0x3bddd8,null))[_0x0e81('0x26')](handleError(_0x3bddd8,null));};exports[_0x0e81('0x19')]=function(_0x2ea2bd,_0x43490e){return db[_0x0e81('0x1e')]['find']({'where':{'id':_0x2ea2bd[_0x0e81('0x37')]['id']}})[_0x0e81('0x1a')](handleEntityNotFound(_0x43490e,null))['then'](removeEntity(_0x43490e,null))['catch'](handleError(_0x43490e,null));};exports[_0x0e81('0x38')]=function(_0x45c23d,_0x1cde59){return db['FaxInteraction'][_0x0e81('0x38')]()['then'](respondWithResult(_0x1cde59,null))[_0x0e81('0x26')](handleError(_0x1cde59,null));};exports[_0x0e81('0x39')]=function(_0x556b33,_0x5a4a90){return db[_0x0e81('0x3a')][_0x0e81('0x33')]({'where':{'id':_0x556b33[_0x0e81('0x37')]['id']}})[_0x0e81('0x1a')](handleEntityNotFound(_0x5a4a90,null))[_0x0e81('0x1a')](function(_0x15c694){if(_0x15c694){return _0x15c694['addMessage'](_0x556b33[_0x0e81('0x35')]['ids'],_[_0x0e81('0x3b')](_0x556b33[_0x0e81('0x35')],[_0x0e81('0x3c'),'id'])||{});}})[_0x0e81('0x1a')](respondWithResult(_0x5a4a90,null))[_0x0e81('0x26')](handleError(_0x5a4a90,null));};exports[_0x0e81('0x3d')]=function(_0x18beef,_0x86c926){var _0x2b16aa={'raw':![],'where':{}};var _0x2ad564={};var _0x5cc6bb={'count':0x0,'rows':[]};return db[_0x0e81('0x1e')][_0x0e81('0x3e')]({'where':{'id':_0x18beef['params']['id']}})['then'](handleEntityNotFound(_0x86c926,null))['then'](function(_0xab516d){if(_0xab516d){_0x2ad564[_0x0e81('0x2a')]=_['keys'](db['FaxMessage'][_0x0e81('0x1f')]);_0x2ad564[_0x0e81('0x29')]=_[_0x0e81('0x28')](_0x18beef['query']);_0x2ad564[_0x0e81('0x3f')]=_[_0x0e81('0x2c')](_0x2ad564[_0x0e81('0x2a')],_0x2ad564[_0x0e81('0x29')]);_0x2b16aa[_0x0e81('0x2b')]=_[_0x0e81('0x2c')](_0x2ad564[_0x0e81('0x2a')],qs[_0x0e81('0x2d')](_0x18beef['query']['fields']));_0x2b16aa['attributes']=_0x2b16aa[_0x0e81('0x2b')][_0x0e81('0x2e')]?_0x2b16aa[_0x0e81('0x2b')]:_0x2ad564[_0x0e81('0x2a')];if(!_0x18beef['query'][_0x0e81('0x40')]('nolimit')){_0x2b16aa[_0x0e81('0x16')]=qs['limit'](_0x18beef[_0x0e81('0x29')][_0x0e81('0x16')]);_0x2b16aa['offset']=qs['offset'](_0x18beef['query'][_0x0e81('0x14')]);}_0x2b16aa[_0x0e81('0x41')]=qs['sort'](_0x18beef['query']['sort']);_0x2b16aa[_0x0e81('0x42')]=qs[_0x0e81('0x3f')](_[_0x0e81('0x43')](_0x18beef[_0x0e81('0x29')],_0x2ad564[_0x0e81('0x3f')]));_0x2b16aa[_0x0e81('0x42')][_0x0e81('0x44')]=_0xab516d['id'];if(_0x18beef[_0x0e81('0x29')][_0x0e81('0x45')]){_0x2b16aa[_0x0e81('0x42')]=_[_0x0e81('0x31')](_0x2b16aa[_0x0e81('0x42')],{'$or':_['map'](_0x2b16aa[_0x0e81('0x2b')],function(_0x30e17c){var _0x4437a3={};_0x4437a3[_0x30e17c]={'$like':'%'+_0x18beef['query'][_0x0e81('0x45')]+'%'};return _0x4437a3;})});}if(_0x18beef[_0x0e81('0x29')][_0x0e81('0x46')]){var _0x542fca=_0x18beef[_0x0e81('0x29')][_0x0e81('0x46')]['split'](',');var _0x4bebe0={};_0x4bebe0[_0x542fca[0x0]]={'$gte':moment(_0x542fca[0x1])[_0x0e81('0x47')](_0x0e81('0x48'))};_0x2b16aa['where']=_[_0x0e81('0x31')](_0x2b16aa[_0x0e81('0x42')],_0x4bebe0);}_0x2b16aa=_['merge']({},_0x2b16aa,_0x18beef[_0x0e81('0x32')]);return db['FaxMessage']['count']({'where':_0x2b16aa[_0x0e81('0x42')]})['then'](function(_0x384cb4){_0x5cc6bb['count']=_0x384cb4;if(_0x18beef[_0x0e81('0x29')]['includeAll']){_0x2b16aa[_0x0e81('0x30')]=[{'all':!![]}];}return db[_0x0e81('0x3a')][_0x0e81('0x23')](_0x2b16aa);})['then'](function(_0x3bfe51){_0x5cc6bb[_0x0e81('0x49')]=_0x3bfe51;return _0x5cc6bb;});}})['then'](respondWithFilteredResult(_0x86c926,_0x2b16aa))[_0x0e81('0x26')](handleError(_0x86c926,null));};exports[_0x0e81('0x4a')]=function(_0x27ff80,_0x3907d0){return db[_0x0e81('0x1e')][_0x0e81('0x33')]({'where':{'id':_0x27ff80[_0x0e81('0x37')]['id']}})[_0x0e81('0x1a')](handleEntityNotFound(_0x3907d0,null))[_0x0e81('0x1a')](function(_0x4c6284){if(_0x4c6284){return _0x4c6284[_0x0e81('0x4b')](_0x27ff80[_0x0e81('0x35')]['ids'],_[_0x0e81('0x3b')](_0x27ff80['body'],[_0x0e81('0x3c'),'id'])||{})[_0x0e81('0x4c')](function(){return db[_0x0e81('0x4d')][_0x0e81('0x23')]({'attributes':['id','name',_0x0e81('0x4e')],'where':{'id':_0x27ff80['body']['ids']}});})[_0x0e81('0x1a')](function(_0x12338c){socket[_0x0e81('0x4f')]('faxInteractionTags:save',{'id':Number(_0x27ff80['params']['id']),'tags':_0x12338c||[]});return{'id':Number(_0x27ff80['params']['id']),'tags':_0x12338c||[]};});}})[_0x0e81('0x1a')](respondWithResult(_0x3907d0,null))[_0x0e81('0x26')](handleError(_0x3907d0,null));};exports['removeTags']=function(_0x3681b1,_0x5a3ed4){return db[_0x0e81('0x1e')]['find']({'where':{'id':_0x3681b1[_0x0e81('0x37')]['id']}})['then'](handleEntityNotFound(_0x5a3ed4,null))[_0x0e81('0x1a')](function(_0x5912f2){if(_0x5912f2){return _0x5912f2['removeTags'](_0x3681b1['query'][_0x0e81('0x3c')]);}})[_0x0e81('0x1a')](respondWithStatusCode(_0x5a3ed4,null))[_0x0e81('0x26')](handleError(_0x5a3ed4,null));};exports[_0x0e81('0x50')]=function(_0x1d9f27,_0x536a6e){var _0x2ff336=moment()['unix']()[_0x0e81('0x51')]();var _0x2c7dec=path[_0x0e81('0x52')](config['root'],_0x0e81('0x53'),_0x0e81('0x54'),_0x0e81('0x55'));var _0x53cd53=path['join'](config['root'],_0x0e81('0x53'),'files','attachments');var _0x125f99=path['join'](_0x2c7dec,_0x2ff336);var _0xa94d43=util['format'](_0x0e81('0x56'),_0x1d9f27[_0x0e81('0x37')]['id'],_0x2ff336);var _0x573a7c=path[_0x0e81('0x52')](_0x2c7dec,_0xa94d43);var _0x1c67c2=[];_0x1c67c2[_0x0e81('0x57')]({'model':db[_0x0e81('0x58')],'as':_0x0e81('0x58'),'raw':!![]});var _0x40e519=[{'model':db[_0x0e81('0x3a')],'as':_0x0e81('0x59'),'attributes':['id',_0x0e81('0x35'),'createdAt'],'include':_0x1c67c2}];return db[_0x0e81('0x1e')][_0x0e81('0x33')]({'where':{'id':_0x1d9f27['params']['id']},'include':_0x40e519})[_0x0e81('0x1a')](handleEntityNotFound(_0x536a6e,null))[_0x0e81('0x1a')](function(_0x1b1221){if(_0x1b1221&&_0x1b1221[_0x0e81('0x59')]){var _0x7df8d7=_0x1b1221['get']({'plain':!![]});fs['mkdirSync'](_0x125f99);for(var _0x5ea8c9=0x0;_0x5ea8c9<_0x7df8d7[_0x0e81('0x59')]['length'];_0x5ea8c9++){var _0x3450d7=_0x7df8d7['Messages'][_0x5ea8c9][_0x0e81('0x58')];if(_0x3450d7){var _0x560012=path[_0x0e81('0x52')](_0x53cd53,_0x3450d7[_0x0e81('0x5a')]);if(fs[_0x0e81('0x5b')](_0x560012)){fs[_0x0e81('0x5c')](_0x560012)['pipe'](fs[_0x0e81('0x5d')](path[_0x0e81('0x52')](_0x125f99,_0x3450d7[_0x0e81('0x5a')])));}}}return BPromise[_0x0e81('0x5e')]()[_0x0e81('0x1a')](function(){return new BPromise(function(_0x252198,_0x41a93f){zipdir(_0x125f99,{'saveTo':_0x573a7c},function(_0x5c115d,_0x16f5b2){if(_0x5c115d)return _0x41a93f(_0x5c115d);return _0x252198(_0x16f5b2);});})[_0x0e81('0x1a')](function(){return new BPromise(function(_0x20e822,_0x5c3f1c){rimraf(_0x125f99,function(_0x57b967){if(_0x57b967)_0x5c3f1c(_0x57b967);return _0x20e822();});});})['then'](function(){return _0x536a6e[_0x0e81('0x50')](_0x573a7c,_0xa94d43,function(_0x4e7e5f){if(_0x4e7e5f){console[_0x0e81('0x5f')](_0x0e81('0x60'),_0x4e7e5f);}else{fs[_0x0e81('0x61')](_0x573a7c);}});});});}else{return _0x536a6e[_0x0e81('0xf')](0xc8);}})['catch'](handleError(_0x536a6e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f3dd8aa..057ba66 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 _0x43e0=['../../mysqldb','FaxMessage','setMaxListeners','remove','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','hook','exports','events','FaxInteraction'];(function(_0x46cc22,_0x101380){var _0x3e69bc=function(_0x7bf8){while(--_0x7bf8){_0x46cc22['push'](_0x46cc22['shift']());}};_0x3e69bc(++_0x101380);}(_0x43e0,0x1ed));var _0x043e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x43e0[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x043e('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x043e('0x1')];var FaxMessage=require(_0x043e('0x2'))['db'][_0x043e('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x043e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x043e('0x5')};function emitEvent(_0x3c2a6b){return function(_0xbef792,_0x565195,_0x434da1){_0xbef792['getUsers']({'attributes':['id'],'raw':!![]})[_0x043e('0x6')](function(_0x2de806){_0xbef792[_0x043e('0x7')](_0x043e('0x8'),_0x2de806[_0x043e('0x9')](function(_0x5ca821){return{'id':_0x5ca821['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xbef792['id'],'direction':'in','read':![]},'raw':!![]});})[_0x043e('0x6')](function(_0x402348){_0xbef792['setDataValue'](_0x043e('0xa'),_0x402348['length']);FaxInteractionEvents[_0x043e('0xb')](_0x3c2a6b+':'+_0xbef792['id'],_0xbef792);FaxInteractionEvents[_0x043e('0xb')](_0x3c2a6b,_0xbef792);_0x434da1(null);})['catch'](_0x434da1(null));};}for(var e in events){if(events[_0x043e('0xc')](e)){var event=events[e];FaxInteraction[_0x043e('0xd')](e,emitEvent(event));}}module[_0x043e('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x7ec7=['Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x218863,_0x2a18f5){var _0x7319f4=function(_0x4d7cbd){while(--_0x4d7cbd){_0x218863['push'](_0x218863['shift']());}};_0x7319f4(++_0x2a18f5);}(_0x7ec7,0x171));var _0x77ec=function(_0x5def97,_0x1f9a49){_0x5def97=_0x5def97-0x0;var _0x55ba05=_0x7ec7[_0x5def97];return _0x55ba05;};'use strict';var EventEmitter=require(_0x77ec('0x0'));var FaxInteraction=require(_0x77ec('0x1'))['db'][_0x77ec('0x2')];var FaxMessage=require(_0x77ec('0x1'))['db'][_0x77ec('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x77ec('0x4')](0x0);var events={'afterCreate':_0x77ec('0x5'),'afterUpdate':_0x77ec('0x6'),'afterDestroy':_0x77ec('0x7')};function emitEvent(_0x3c1c1e){return function(_0x13631d,_0x329346,_0x310cf7){_0x13631d[_0x77ec('0x8')]({'attributes':['id'],'raw':!![]})[_0x77ec('0x9')](function(_0x375b2f){_0x13631d[_0x77ec('0xa')](_0x77ec('0xb'),_0x375b2f[_0x77ec('0xc')](function(_0x420b0f){return{'id':_0x420b0f['id']};}));return FaxMessage[_0x77ec('0xd')]({'where':{'FaxInteractionId':_0x13631d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x77ec('0x9')](function(_0x5c3a6d){_0x13631d[_0x77ec('0xa')](_0x77ec('0xe'),_0x5c3a6d[_0x77ec('0xf')]);FaxInteractionEvents[_0x77ec('0x10')](_0x3c1c1e+':'+_0x13631d['id'],_0x13631d);FaxInteractionEvents[_0x77ec('0x10')](_0x3c1c1e,_0x13631d);_0x310cf7(null);})['catch'](_0x310cf7(null));};}for(var e in events){if(events[_0x77ec('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x77ec('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f963c51..3a96d38 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 _0xf969=['fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0xc29295,_0x95662c){var _0x5b992b=function(_0x204712){while(--_0x204712){_0xc29295['push'](_0xc29295['shift']());}};_0x5b992b(++_0x95662c);}(_0xf969,0xc5));var _0x9f96=function(_0x404b64,_0x151649){_0x404b64=_0x404b64-0x0;var _0x32743a=_0xf969[_0x404b64];return _0x32743a;};'use strict';var _=require(_0x9f96('0x0'));var util=require(_0x9f96('0x1'));var logger=require(_0x9f96('0x2'))(_0x9f96('0x3'));var moment=require(_0x9f96('0x4'));var BPromise=require(_0x9f96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f96('0x6'));var rimraf=require('rimraf');var config=require(_0x9f96('0x7'));var attributes=require(_0x9f96('0x8'));module[_0x9f96('0x9')]=function(_0x45ccd5,_0x5955b1){return _0x45ccd5['define'](_0x9f96('0xa'),attributes,{'tableName':_0x9f96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48b184,_0x486456,_0x23fd42){if(_0x48b184[_0x9f96('0xc')](_0x9f96('0xd'))){_0x48b184[_0x9f96('0xe')]=moment()['format'](_0x9f96('0xf'));}_0x23fd42(null,_0x48b184);}}});}; \ No newline at end of file +var _0x82f8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','format','util','../../config/logger'];(function(_0x3d81fe,_0x2e89c1){var _0x3e5d8a=function(_0x1a67eb){while(--_0x1a67eb){_0x3d81fe['push'](_0x3d81fe['shift']());}};_0x3e5d8a(++_0x2e89c1);}(_0x82f8,0x157));var _0x882f=function(_0x533b93,_0x191ded){_0x533b93=_0x533b93-0x0;var _0x598465=_0x82f8[_0x533b93];return _0x598465;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var logger=require(_0x882f('0x1'))('api');var moment=require(_0x882f('0x2'));var BPromise=require(_0x882f('0x3'));var rp=require(_0x882f('0x4'));var fs=require('fs');var path=require(_0x882f('0x5'));var rimraf=require(_0x882f('0x6'));var config=require(_0x882f('0x7'));var attributes=require(_0x882f('0x8'));module[_0x882f('0x9')]=function(_0x4efdc9,_0x57fc29){return _0x4efdc9[_0x882f('0xa')](_0x882f('0xb'),attributes,{'tableName':_0x882f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e6f92,_0x4f9dd6,_0x3ad83c){if(_0x2e6f92['changed'](_0x882f('0xd'))){_0x2e6f92['closedAt']=moment()[_0x882f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ad83c(null,_0x2e6f92);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 622238f..10e7c86 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 _0xc8a4=['limit','stringify','AddTagsToFaxInteraction','addTags','ids','spread','debug','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes'];(function(_0x3ced00,_0x588cc1){var _0x16af63=function(_0xdfad11){while(--_0xdfad11){_0x3ced00['push'](_0x3ced00['shift']());}};_0x16af63(++_0x588cc1);}(_0xc8a4,0x17a));var _0x4c8a=function(_0x1967b9,_0x34e3e4){_0x1967b9=_0x1967b9-0x0;var _0x5ace66=_0xc8a4[_0x1967b9];return _0x5ace66;};'use strict';var _=require(_0x4c8a('0x0'));var util=require('util');var moment=require(_0x4c8a('0x1'));var BPromise=require(_0x4c8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c8a('0x4'));var logger=require('../../config/logger')(_0x4c8a('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c8a('0x6'));var client=jayson['client'][_0x4c8a('0x7')]({'port':0x232a});config[_0x4c8a('0x8')]=_[_0x4c8a('0x9')](config['redis'],{'host':_0x4c8a('0xa'),'port':0x18eb});var socket=require(_0x4c8a('0xb'))(new Redis(config[_0x4c8a('0x8')]));require(_0x4c8a('0xc'))[_0x4c8a('0xd')](socket);function respondWithRpcPromise(_0x3dd054,_0x44582d,_0x58f729){return new BPromise(function(_0x8bae1f,_0x5d27e7){return client['request'](_0x3dd054,_0x58f729)[_0x4c8a('0xe')](function(_0x35eb53){logger[_0x4c8a('0xf')](_0x4c8a('0x10'),_0x44582d,'request\x20sent');logger['debug'](_0x4c8a('0x11'),_0x44582d,'request\x20sent',JSON['stringify'](_0x35eb53));if(_0x35eb53[_0x4c8a('0x12')]){if(_0x35eb53[_0x4c8a('0x12')][_0x4c8a('0x13')]===0x1f4){logger[_0x4c8a('0x12')](_0x4c8a('0x10'),_0x44582d,_0x35eb53[_0x4c8a('0x12')][_0x4c8a('0x14')]);return _0x5d27e7(_0x35eb53['error'][_0x4c8a('0x14')]);}logger[_0x4c8a('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x44582d,_0x35eb53[_0x4c8a('0x12')][_0x4c8a('0x14')]);return _0x8bae1f(_0x35eb53[_0x4c8a('0x12')][_0x4c8a('0x14')]);}else{logger[_0x4c8a('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x44582d,_0x4c8a('0x15'));_0x8bae1f(_0x35eb53['result'][_0x4c8a('0x14')]);}})[_0x4c8a('0x16')](function(_0x35ccf7){logger['error'](_0x4c8a('0x10'),_0x44582d,_0x35ccf7);_0x5d27e7(_0x35ccf7);});});}exports[_0x4c8a('0x17')]=function(_0xcdb13e){var _0x5d6dbf=this;return new Promise(function(_0x253c13,_0x243bf9){return db[_0x4c8a('0x18')]['update'](_0xcdb13e[_0x4c8a('0x19')],{'raw':_0xcdb13e[_0x4c8a('0x1a')]?_0xcdb13e[_0x4c8a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcdb13e[_0x4c8a('0x1a')]?_0xcdb13e['options'][_0x4c8a('0x1b')]||null:null,'attributes':_0xcdb13e[_0x4c8a('0x1a')]?_0xcdb13e['options'][_0x4c8a('0x1c')]||null:null,'limit':_0xcdb13e[_0x4c8a('0x1a')]?_0xcdb13e[_0x4c8a('0x1a')][_0x4c8a('0x1d')]||null:null})[_0x4c8a('0xe')](function(_0x3673cc){logger[_0x4c8a('0xf')](_0x4c8a('0x17'),_0xcdb13e);logger['debug'](_0x4c8a('0x17'),_0xcdb13e,JSON[_0x4c8a('0x1e')](_0x3673cc));_0x253c13(_0x3673cc);})[_0x4c8a('0x16')](function(_0x44f53b){logger[_0x4c8a('0x12')](_0x4c8a('0x17'),_0x44f53b['message'],_0xcdb13e);_0x243bf9(_0x5d6dbf[_0x4c8a('0x12')](0x1f4,_0x44f53b[_0x4c8a('0x14')]));});});};exports[_0x4c8a('0x1f')]=function(_0x9c294e){return new Promise(function(_0x4fc3c5,_0x44d4c0){return db['FaxInteraction']['find']({'where':_0x9c294e[_0x4c8a('0x1a')]?_0x9c294e[_0x4c8a('0x1a')][_0x4c8a('0x1b')]||null:null})[_0x4c8a('0xe')](function(_0x3e8b02){if(_0x3e8b02){return _0x3e8b02[_0x4c8a('0x20')](_0x9c294e[_0x4c8a('0x19')][_0x4c8a('0x21')],_['omit'](_0x9c294e['body'],[_0x4c8a('0x21'),'id'])||{});}})[_0x4c8a('0x22')](function(_0x42607a){logger[_0x4c8a('0xf')]('AddTags',_0x9c294e);logger[_0x4c8a('0x23')](_0x4c8a('0x24'),_0x9c294e,JSON[_0x4c8a('0x1e')](_0x42607a));_0x4fc3c5(_0x42607a);})['catch'](function(_0x1a644d){logger[_0x4c8a('0x12')]('AddTags',_0x1a644d['message'],_0x9c294e);_0x44d4c0(_this[_0x4c8a('0x12')](0x1f4,_0x1a644d[_0x4c8a('0x14')]));});});}; \ No newline at end of file +var _0x0330=['update','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction'];(function(_0x15aaf4,_0x927b1c){var _0x49e676=function(_0x27f1e9){while(--_0x27f1e9){_0x15aaf4['push'](_0x15aaf4['shift']());}};_0x49e676(++_0x927b1c);}(_0x0330,0x1ce));var _0x0033=function(_0x472843,_0x7fb52a){_0x472843=_0x472843-0x0;var _0x512d71=_0x0330[_0x472843];return _0x512d71;};'use strict';var _=require(_0x0033('0x0'));var util=require(_0x0033('0x1'));var moment=require(_0x0033('0x2'));var BPromise=require('bluebird');var rs=require(_0x0033('0x3'));var fs=require('fs');var Redis=require(_0x0033('0x4'));var db=require(_0x0033('0x5'))['db'];var utils=require(_0x0033('0x6'));var logger=require(_0x0033('0x7'))(_0x0033('0x8'));var config=require(_0x0033('0x9'));var jayson=require(_0x0033('0xa'));var client=jayson[_0x0033('0xb')][_0x0033('0xc')]({'port':0x232a});config[_0x0033('0xd')]=_[_0x0033('0xe')](config[_0x0033('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x0033('0xf'))(new Redis(config[_0x0033('0xd')]));require(_0x0033('0x10'))[_0x0033('0x11')](socket);function respondWithRpcPromise(_0x55d608,_0x38c6be,_0x37a81b){return new BPromise(function(_0x3ee499,_0x73f274){return client[_0x0033('0x12')](_0x55d608,_0x37a81b)[_0x0033('0x13')](function(_0x549027){logger[_0x0033('0x14')](_0x0033('0x15'),_0x38c6be,_0x0033('0x16'));logger[_0x0033('0x17')](_0x0033('0x18'),_0x38c6be,_0x0033('0x16'),JSON[_0x0033('0x19')](_0x549027));if(_0x549027[_0x0033('0x1a')]){if(_0x549027['error'][_0x0033('0x1b')]===0x1f4){logger[_0x0033('0x1a')](_0x0033('0x15'),_0x38c6be,_0x549027['error'][_0x0033('0x1c')]);return _0x73f274(_0x549027[_0x0033('0x1a')][_0x0033('0x1c')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x38c6be,_0x549027[_0x0033('0x1a')][_0x0033('0x1c')]);return _0x3ee499(_0x549027[_0x0033('0x1a')][_0x0033('0x1c')]);}else{logger[_0x0033('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x38c6be,_0x0033('0x16'));_0x3ee499(_0x549027[_0x0033('0x1d')][_0x0033('0x1c')]);}})[_0x0033('0x1e')](function(_0x22c446){logger[_0x0033('0x1a')](_0x0033('0x15'),_0x38c6be,_0x22c446);_0x73f274(_0x22c446);});});}exports[_0x0033('0x1f')]=function(_0x5b2996){var _0x4511c3=this;return new Promise(function(_0x35d9a8,_0x2f541c){return db[_0x0033('0x20')][_0x0033('0x21')](_0x5b2996[_0x0033('0x22')],{'raw':_0x5b2996[_0x0033('0x23')]?_0x5b2996[_0x0033('0x23')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2996[_0x0033('0x23')]?_0x5b2996[_0x0033('0x23')][_0x0033('0x24')]||null:null,'attributes':_0x5b2996[_0x0033('0x23')]?_0x5b2996[_0x0033('0x23')][_0x0033('0x25')]||null:null,'limit':_0x5b2996[_0x0033('0x23')]?_0x5b2996[_0x0033('0x23')][_0x0033('0x26')]||null:null})[_0x0033('0x13')](function(_0x191200){logger[_0x0033('0x14')]('UpdateFaxInteraction',_0x5b2996);logger[_0x0033('0x17')]('UpdateFaxInteraction',_0x5b2996,JSON[_0x0033('0x19')](_0x191200));_0x35d9a8(_0x191200);})[_0x0033('0x1e')](function(_0x250804){logger[_0x0033('0x1a')]('UpdateFaxInteraction',_0x250804['message'],_0x5b2996);_0x2f541c(_0x4511c3['error'](0x1f4,_0x250804['message']));});});};exports[_0x0033('0x27')]=function(_0x4deb42){return new Promise(function(_0x3c1e09,_0x73d63b){return db[_0x0033('0x20')][_0x0033('0x28')]({'where':_0x4deb42['options']?_0x4deb42[_0x0033('0x23')][_0x0033('0x24')]||null:null})[_0x0033('0x13')](function(_0x5318fe){if(_0x5318fe){return _0x5318fe['addTags'](_0x4deb42[_0x0033('0x22')][_0x0033('0x29')],_[_0x0033('0x2a')](_0x4deb42[_0x0033('0x22')],[_0x0033('0x29'),'id'])||{});}})[_0x0033('0x2b')](function(_0x5ebba8){logger['info'](_0x0033('0x2c'),_0x4deb42);logger[_0x0033('0x17')](_0x0033('0x2c'),_0x4deb42,JSON[_0x0033('0x19')](_0x5ebba8));_0x3c1e09(_0x5ebba8);})['catch'](function(_0x256cfe){logger[_0x0033('0x1a')]('AddTags',_0x256cfe[_0x0033('0x1c')],_0x4deb42);_0x73d63b(_this[_0x0033('0x1a')](0x1f4,_0x256cfe[_0x0033('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 77c3a18..1bfe8ec 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 _0xe29d=['save','remove','removeListener','faxInteraction:','./faxInteraction.events'];(function(_0x5de5b,_0x43b863){var _0x5a9ad7=function(_0x1fa6c4){while(--_0x1fa6c4){_0x5de5b['push'](_0x5de5b['shift']());}};_0x5a9ad7(++_0x43b863);}(_0xe29d,0x10d));var _0xde29=function(_0x18fb69,_0x5158ae){_0x18fb69=_0x18fb69-0x0;var _0x219ae3=_0xe29d[_0x18fb69];return _0x219ae3;};'use strict';var FaxInteractionEvents=require(_0xde29('0x0'));var events=[_0xde29('0x1'),_0xde29('0x2'),'update'];function createListener(_0xcec4e3,_0x2e508c){return function(_0x24a407){_0x2e508c['emit'](_0xcec4e3,_0x24a407);};}function removeListener(_0x31f333,_0x283650){return function(){FaxInteractionEvents[_0xde29('0x3')](_0x31f333,_0x283650);};}exports['register']=function(_0x14ce4e){for(var _0x203cf9=0x0,_0x3c28ab=events['length'];_0x203cf9<_0x3c28ab;_0x203cf9++){var _0x54095f=events[_0x203cf9];var _0x9ddf49=createListener(_0xde29('0x4')+_0x54095f,_0x14ce4e);FaxInteractionEvents['on'](_0x54095f,_0x9ddf49);}}; \ No newline at end of file +var _0x027a=['./faxInteraction.events','save','remove','update','removeListener','register','length','faxInteraction:'];(function(_0x1bba24,_0x70391e){var _0x5ada1b=function(_0x277d3c){while(--_0x277d3c){_0x1bba24['push'](_0x1bba24['shift']());}};_0x5ada1b(++_0x70391e);}(_0x027a,0x178));var _0xa027=function(_0x16da9f,_0x39e305){_0x16da9f=_0x16da9f-0x0;var _0x4635d5=_0x027a[_0x16da9f];return _0x4635d5;};'use strict';var FaxInteractionEvents=require(_0xa027('0x0'));var events=[_0xa027('0x1'),_0xa027('0x2'),_0xa027('0x3')];function createListener(_0x5260ff,_0x1f91cb){return function(_0x4413bc){_0x1f91cb['emit'](_0x5260ff,_0x4413bc);};}function removeListener(_0x524716,_0x111147){return function(){FaxInteractionEvents[_0xa027('0x4')](_0x524716,_0x111147);};}exports[_0xa027('0x5')]=function(_0x2b215e){for(var _0x163d36=0x0,_0x15c7bd=events[_0xa027('0x6')];_0x163d36<_0x15c7bd;_0x163d36++){var _0x4f8201=events[_0x163d36];var _0x3880ea=createListener(_0xa027('0x7')+_0x4f8201,_0x2b215e);FaxInteractionEvents['on'](_0x4f8201,_0x3880ea);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 40ad913..226331d 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 _0xdb6f=['./faxInteraction.controller','index','get','/describe','isAuthenticated','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','/:id','tracked','faxinteraction:update','delete','faxinteraction:destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd074,_0x5508c3){var _0x299c7f=function(_0x236910){while(--_0x236910){_0x3dd074['push'](_0x3dd074['shift']());}};_0x299c7f(++_0x5508c3);}(_0xdb6f,0x93));var _0xfdb6=function(_0x549444,_0x41c180){_0x549444=_0x549444-0x0;var _0x2348d2=_0xdb6f[_0x549444];return _0x2348d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfdb6('0x0'));var timeout=require(_0xfdb6('0x1'));var express=require(_0xfdb6('0x2'));var router=express[_0xfdb6('0x3')]();var fs_extra=require(_0xfdb6('0x4'));var auth=require(_0xfdb6('0x5'));var interaction=require(_0xfdb6('0x6'));var config=require(_0xfdb6('0x7'));var controller=require(_0xfdb6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfdb6('0x9')]);router[_0xfdb6('0xa')](_0xfdb6('0xb'),auth[_0xfdb6('0xc')](),controller['describe']);router[_0xfdb6('0xa')]('/:id',auth[_0xfdb6('0xc')](),controller[_0xfdb6('0xd')]);router[_0xfdb6('0xa')]('/:id/messages',auth[_0xfdb6('0xc')](),controller['getMessages']);router[_0xfdb6('0xa')](_0xfdb6('0xe'),auth[_0xfdb6('0xc')](),controller[_0xfdb6('0xf')]);router[_0xfdb6('0x10')]('/',auth[_0xfdb6('0xc')](),controller[_0xfdb6('0x11')]);router[_0xfdb6('0x10')](_0xfdb6('0x12'),auth['isAuthenticated'](),controller[_0xfdb6('0x13')]);router[_0xfdb6('0x10')](_0xfdb6('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xfdb6('0x15'),_0xfdb6('0x16')),controller[_0xfdb6('0x17')]);router['put'](_0xfdb6('0x18'),auth[_0xfdb6('0xc')](),interaction[_0xfdb6('0x19')](_0xfdb6('0x15'),_0xfdb6('0x1a')),controller['update']);router[_0xfdb6('0x1b')](_0xfdb6('0x18'),auth['isAuthenticated'](),interaction[_0xfdb6('0x19')]('fax',_0xfdb6('0x1c')),controller['destroy']);router[_0xfdb6('0x1b')](_0xfdb6('0x14'),auth[_0xfdb6('0xc')](),controller[_0xfdb6('0x1d')]);module[_0xfdb6('0x1e')]=router; \ No newline at end of file +var _0x7192=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','faxinteraction:destroy','destroy','removeTags','exports'];(function(_0x40bce5,_0x213ba9){var _0x3d27dc=function(_0x44768e){while(--_0x44768e){_0x40bce5['push'](_0x40bce5['shift']());}};_0x3d27dc(++_0x213ba9);}(_0x7192,0x1ad));var _0x2719=function(_0x3cdc29,_0x32dae7){_0x3cdc29=_0x3cdc29-0x0;var _0x25ea0a=_0x7192[_0x3cdc29];return _0x25ea0a;};'use strict';var multer=require('multer');var util=require(_0x2719('0x0'));var path=require(_0x2719('0x1'));var timeout=require(_0x2719('0x2'));var express=require('express');var router=express[_0x2719('0x3')]();var fs_extra=require(_0x2719('0x4'));var auth=require(_0x2719('0x5'));var interaction=require(_0x2719('0x6'));var config=require(_0x2719('0x7'));var controller=require(_0x2719('0x8'));router[_0x2719('0x9')]('/',auth['isAuthenticated'](),controller[_0x2719('0xa')]);router[_0x2719('0x9')](_0x2719('0xb'),auth[_0x2719('0xc')](),controller[_0x2719('0xd')]);router[_0x2719('0x9')](_0x2719('0xe'),auth[_0x2719('0xc')](),controller[_0x2719('0xf')]);router[_0x2719('0x9')](_0x2719('0x10'),auth[_0x2719('0xc')](),controller[_0x2719('0x11')]);router[_0x2719('0x9')](_0x2719('0x12'),auth[_0x2719('0xc')](),controller[_0x2719('0x13')]);router[_0x2719('0x14')]('/',auth[_0x2719('0xc')](),controller[_0x2719('0x15')]);router[_0x2719('0x14')](_0x2719('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x2719('0x14')](_0x2719('0x16'),auth[_0x2719('0xc')](),interaction[_0x2719('0x17')](_0x2719('0x18'),_0x2719('0x19')),controller[_0x2719('0x1a')]);router[_0x2719('0x1b')](_0x2719('0xe'),auth['isAuthenticated'](),interaction[_0x2719('0x17')]('fax',_0x2719('0x1c')),controller['update']);router['delete'](_0x2719('0xe'),auth[_0x2719('0xc')](),interaction[_0x2719('0x17')](_0x2719('0x18'),_0x2719('0x1d')),controller[_0x2719('0x1e')]);router['delete'](_0x2719('0x16'),auth[_0x2719('0xc')](),controller[_0x2719('0x1f')]);module[_0x2719('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9d9036c..f178136 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 _0x5044=['ENUM','out','TEXT','DATE','exports','medium','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5044,0xc8));var _0x4504=function(_0x7f5ef2,_0x28f7ea){_0x7f5ef2=_0x7f5ef2-0x0;var _0x55e9bc=_0x5044[_0x7f5ef2];return _0x55e9bc;};'use strict';var Sequelize=require('sequelize');module[_0x4504('0x0')]={'body':{'type':Sequelize['TEXT'](_0x4504('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4504('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4504('0x3')]('in',_0x4504('0x4')),'defaultValue':_0x4504('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4504('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4504('0x6')]}}; \ No newline at end of file +var _0xf874=['ENUM','out','DATE','TEXT','medium','BOOLEAN'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xf874,0xed));var _0x4f87=function(_0x415528,_0x1ebede){_0x415528=_0x415528-0x0;var _0x9a0acd=_0xf874[_0x415528];return _0x9a0acd;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x4f87('0x0')](_0x4f87('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4f87('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f87('0x3')]('in',_0x4f87('0x4')),'defaultValue':_0x4f87('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x4f87('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d1be976..3653211 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 _0xc131=['fullname','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','fax-interactions','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','email','interface','event','rejectmessage','create','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','FaxMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','filter','options','include','findAll','rows','params','includeAll','find','body','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xc131,0x1ce));var _0x1c13=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc131[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x1c13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c13('0x2'));var moment=require(_0x1c13('0x3'));var BPromise=require(_0x1c13('0x4'));var Mustache=require(_0x1c13('0x5'));var util=require(_0x1c13('0x6'));var path=require(_0x1c13('0x7'));var sox=require(_0x1c13('0x8'));var csv=require(_0x1c13('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c13('0xa'));var _=require(_0x1c13('0xb'));var squel=require(_0x1c13('0xc'));var crypto=require(_0x1c13('0xd'));var jsforce=require(_0x1c13('0xe'));var deskjs=require(_0x1c13('0xf'));var toCsv=require(_0x1c13('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c13('0x10'));var authService=require(_0x1c13('0x11'));var qs=require(_0x1c13('0x12'));var as=require(_0x1c13('0x13'));var hardwareService=require(_0x1c13('0x14'));var logger=require('../../config/logger')(_0x1c13('0x15'));var utils=require(_0x1c13('0x16'));var config=require(_0x1c13('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x1c13('0x18')],{'host':_0x1c13('0x19'),'port':0x18eb});var socket=require(_0x1c13('0x1a'))(new Redis(config['redis']));require(_0x1c13('0x1b'))[_0x1c13('0x1c')](socket);var jayson=require(_0x1c13('0x1d'));var client=jayson[_0x1c13('0x1e')][_0x1c13('0x1f')]({'port':0x232c});var client9002=jayson[_0x1c13('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d231,_0x52834f,_0x300eb1,_0x23375c){return new BPromise(function(_0x1451b9,_0x177f66){var _0x4c0ea5=_0x23375c||client;return _0x4c0ea5['request'](_0x10d231,_0x300eb1)[_0x1c13('0x20')](function(_0x45b79a){logger[_0x1c13('0x21')](_0x1c13('0x22'),_0x52834f,'request\x20sent');logger[_0x1c13('0x23')](_0x1c13('0x24'),_0x52834f,_0x1c13('0x25'),JSON['stringify'](_0x45b79a));if(_0x45b79a[_0x1c13('0x26')]){if(_0x45b79a[_0x1c13('0x26')]['code']===0x1f4){logger[_0x1c13('0x26')](_0x1c13('0x22'),_0x52834f,_0x45b79a['error'][_0x1c13('0x27')]);return _0x177f66(_0x45b79a[_0x1c13('0x26')][_0x1c13('0x27')]);}logger[_0x1c13('0x26')]('FaxMessage,\x20%s,\x20%s',_0x52834f,_0x45b79a[_0x1c13('0x26')]['message']);return _0x1451b9(_0x45b79a[_0x1c13('0x26')][_0x1c13('0x27')]);}else{logger[_0x1c13('0x21')](_0x1c13('0x22'),_0x52834f,_0x1c13('0x25'));_0x1451b9(_0x45b79a[_0x1c13('0x28')][_0x1c13('0x27')]);}})[_0x1c13('0x29')](function(_0x776c8f){logger[_0x1c13('0x26')](_0x1c13('0x22'),_0x52834f,_0x776c8f);_0x177f66(_0x776c8f);});});}function respondWithStatusCode(_0x10c7ea,_0x85a9a0){_0x85a9a0=_0x85a9a0||0xcc;return function(_0x47aea6){if(_0x47aea6){return _0x10c7ea[_0x1c13('0x2a')](_0x85a9a0);}return _0x10c7ea[_0x1c13('0x2b')](_0x85a9a0)['end']();};}function respondWithResult(_0x24c92d,_0x5875cb){_0x5875cb=_0x5875cb||0xc8;return function(_0x4d20a3){if(_0x4d20a3){return _0x24c92d['status'](_0x5875cb)[_0x1c13('0x2c')](_0x4d20a3);}};}function respondWithFilteredResult(_0x1a3484,_0x1ec9b2){return function(_0x4b75b7){if(_0x4b75b7){var _0x2f2422=typeof _0x1ec9b2[_0x1c13('0x2d')]===_0x1c13('0x2e')&&typeof _0x1ec9b2[_0x1c13('0x2f')]==='undefined';var _0x29987c=_0x4b75b7[_0x1c13('0x30')];var _0x41dde9=_0x2f2422?0x0:_0x1ec9b2[_0x1c13('0x2d')];var _0x460135=_0x2f2422?_0x4b75b7[_0x1c13('0x30')]:_0x1ec9b2[_0x1c13('0x2d')]+_0x1ec9b2[_0x1c13('0x2f')];var _0x1bfc65;if(_0x460135>=_0x29987c){_0x460135=_0x29987c;_0x1bfc65=0xc8;}else{_0x1bfc65=0xce;}_0x1a3484[_0x1c13('0x2b')](_0x1bfc65);return _0x1a3484[_0x1c13('0x31')](_0x1c13('0x32'),_0x41dde9+'-'+_0x460135+'/'+_0x29987c)[_0x1c13('0x2c')](_0x4b75b7);}return null;};}function patchUpdates(_0x453e63){return function(_0x21740b){try{jsonpatch[_0x1c13('0x33')](_0x21740b,_0x453e63,!![]);}catch(_0x342d93){return BPromise[_0x1c13('0x34')](_0x342d93);}return _0x21740b[_0x1c13('0x35')]();};}function saveUpdates(_0x26a14c,_0x21935a){return function(_0x34648e){if(_0x34648e){return _0x34648e[_0x1c13('0x36')](_0x26a14c)[_0x1c13('0x20')](function(_0x565c6f){return _0x565c6f;});}return null;};}function removeEntity(_0x45b6fc,_0x167248){return function(_0x4c036f){if(_0x4c036f){return _0x4c036f[_0x1c13('0x37')]()['then'](function(){_0x45b6fc[_0x1c13('0x2b')](0xcc)[_0x1c13('0x38')]();});}};}function handleEntityNotFound(_0x50a1c9,_0x12db00){return function(_0x4fa592){if(!_0x4fa592){_0x50a1c9[_0x1c13('0x2a')](0x194);}return _0x4fa592;};}function handleError(_0x4988b1,_0x176bc5){_0x176bc5=_0x176bc5||0x1f4;return function(_0x6040e5){logger[_0x1c13('0x26')](_0x6040e5['stack']);if(_0x6040e5['name']){delete _0x6040e5[_0x1c13('0x39')];}_0x4988b1[_0x1c13('0x2b')](_0x176bc5)[_0x1c13('0x3a')](_0x6040e5);};}exports[_0x1c13('0x3b')]=function(_0x3a2d11,_0x5de96f){var _0x47d3cd={},_0x5ee58e={},_0x14fd59={'count':0x0,'rows':[]};var _0x3cad28=_['map'](db[_0x1c13('0x3c')][_0x1c13('0x3d')],function(_0x10f908){return{'name':_0x10f908[_0x1c13('0x3e')],'type':_0x10f908['type']['key']};});_0x5ee58e[_0x1c13('0x3f')]=_['map'](_0x3cad28,_0x1c13('0x39'));_0x5ee58e[_0x1c13('0x40')]=_[_0x1c13('0x41')](_0x3a2d11[_0x1c13('0x40')]);_0x5ee58e[_0x1c13('0x42')]=_[_0x1c13('0x43')](_0x5ee58e[_0x1c13('0x3f')],_0x5ee58e[_0x1c13('0x40')]);_0x47d3cd[_0x1c13('0x44')]=_['intersection'](_0x5ee58e['model'],qs[_0x1c13('0x45')](_0x3a2d11['query']['fields']));_0x47d3cd['attributes']=_0x47d3cd[_0x1c13('0x44')][_0x1c13('0x46')]?_0x47d3cd[_0x1c13('0x44')]:_0x5ee58e[_0x1c13('0x3f')];if(!_0x3a2d11[_0x1c13('0x40')][_0x1c13('0x47')](_0x1c13('0x48'))){_0x47d3cd[_0x1c13('0x2f')]=qs[_0x1c13('0x2f')](_0x3a2d11[_0x1c13('0x40')]['limit']);_0x47d3cd['offset']=qs['offset'](_0x3a2d11[_0x1c13('0x40')][_0x1c13('0x2d')]);}_0x47d3cd[_0x1c13('0x49')]=qs[_0x1c13('0x4a')](_0x3a2d11[_0x1c13('0x40')]['sort']);_0x47d3cd[_0x1c13('0x4b')]=qs[_0x1c13('0x42')](_[_0x1c13('0x4c')](_0x3a2d11[_0x1c13('0x40')],_0x5ee58e[_0x1c13('0x42')]),_0x3cad28);if(_0x3a2d11[_0x1c13('0x40')]['filter']){_0x47d3cd['where']=_['merge'](_0x47d3cd[_0x1c13('0x4b')],{'$or':_[_0x1c13('0x4d')](_0x3cad28,function(_0x48bdd9){if(_0x48bdd9[_0x1c13('0x4e')]!=='VIRTUAL'){var _0x1bd17f={};_0x1bd17f[_0x48bdd9[_0x1c13('0x39')]]={'$like':'%'+_0x3a2d11[_0x1c13('0x40')][_0x1c13('0x4f')]+'%'};return _0x1bd17f;}})});}_0x47d3cd=_['merge']({},_0x47d3cd,_0x3a2d11[_0x1c13('0x50')]);var _0x5be85f={'where':_0x47d3cd[_0x1c13('0x4b')]};return db[_0x1c13('0x3c')][_0x1c13('0x30')](_0x5be85f)[_0x1c13('0x20')](function(_0x42754c){_0x14fd59[_0x1c13('0x30')]=_0x42754c;if(_0x3a2d11[_0x1c13('0x40')]['includeAll']){_0x47d3cd[_0x1c13('0x51')]=[{'all':!![]}];}return db[_0x1c13('0x3c')][_0x1c13('0x52')](_0x47d3cd);})[_0x1c13('0x20')](function(_0x104221){_0x14fd59[_0x1c13('0x53')]=_0x104221;return _0x14fd59;})[_0x1c13('0x20')](respondWithFilteredResult(_0x5de96f,_0x47d3cd))[_0x1c13('0x29')](handleError(_0x5de96f,null));};exports['show']=function(_0xc4e418,_0x2769f2){var _0x4dd58d={'raw':!![],'where':{'id':_0xc4e418[_0x1c13('0x54')]['id']}},_0x5ba736={};_0x5ba736[_0x1c13('0x3f')]=_[_0x1c13('0x41')](db[_0x1c13('0x3c')][_0x1c13('0x3d')]);_0x5ba736['query']=_[_0x1c13('0x41')](_0xc4e418[_0x1c13('0x40')]);_0x5ba736[_0x1c13('0x42')]=_['intersection'](_0x5ba736[_0x1c13('0x3f')],_0x5ba736[_0x1c13('0x40')]);_0x4dd58d['attributes']=_[_0x1c13('0x43')](_0x5ba736[_0x1c13('0x3f')],qs['fields'](_0xc4e418['query'][_0x1c13('0x45')]));_0x4dd58d[_0x1c13('0x44')]=_0x4dd58d[_0x1c13('0x44')][_0x1c13('0x46')]?_0x4dd58d['attributes']:_0x5ba736[_0x1c13('0x3f')];if(_0xc4e418['query'][_0x1c13('0x55')]){_0x4dd58d['include']=[{'all':!![]}];}_0x4dd58d=_['merge']({},_0x4dd58d,_0xc4e418[_0x1c13('0x50')]);return db[_0x1c13('0x3c')][_0x1c13('0x56')](_0x4dd58d)[_0x1c13('0x20')](handleEntityNotFound(_0x2769f2,null))['then'](respondWithResult(_0x2769f2,null))[_0x1c13('0x29')](handleError(_0x2769f2,null));};exports[_0x1c13('0x36')]=function(_0x1ab16d,_0x779ee9){if(_0x1ab16d['body']['id']){delete _0x1ab16d['body']['id'];}return db[_0x1c13('0x3c')][_0x1c13('0x56')]({'where':{'id':_0x1ab16d[_0x1c13('0x54')]['id']}})[_0x1c13('0x20')](handleEntityNotFound(_0x779ee9,null))['then'](saveUpdates(_0x1ab16d[_0x1c13('0x57')],null))[_0x1c13('0x20')](respondWithResult(_0x779ee9,null))[_0x1c13('0x29')](handleError(_0x779ee9,null));};exports[_0x1c13('0x37')]=function(_0x3796c8,_0xe998c){return db[_0x1c13('0x3c')][_0x1c13('0x56')]({'where':{'id':_0x3796c8[_0x1c13('0x54')]['id']}})['then'](handleEntityNotFound(_0xe998c,null))[_0x1c13('0x20')](removeEntity(_0xe998c,null))[_0x1c13('0x29')](handleError(_0xe998c,null));};exports[_0x1c13('0x58')]=function(_0x34a431,_0x28d731){return db['FaxMessage'][_0x1c13('0x58')]()[_0x1c13('0x20')](respondWithResult(_0x28d731,null))[_0x1c13('0x29')](handleError(_0x28d731,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x1c13('0x59')]=function(_0x21697f,_0x4f25e6,_0x1f0240){var _0x28f0aa={'agent':{},'channel':_0x1c13('0x5a')};if(_0x21697f[_0x1c13('0x57')]['id']){delete _0x21697f[_0x1c13('0x57')]['id'];}_0x21697f[_0x1c13('0x57')][_0x1c13('0x5b')]=!![];_0x21697f[_0x1c13('0x57')]['readAt']=moment()[_0x1c13('0x5c')](_0x1c13('0x5d'));_0x21697f[_0x1c13('0x57')][_0x1c13('0x5e')]=_0x21697f[_0x1c13('0x57')][_0x1c13('0x5e')]||_0x21697f['user']['id'];_0x28f0aa[_0x1c13('0x5f')]['id']=_0x21697f[_0x1c13('0x57')][_0x1c13('0x5e')];return db[_0x1c13('0x3c')]['find']({'where':{'id':_0x21697f[_0x1c13('0x54')]['id'],'UserId':null}})[_0x1c13('0x20')](handleEntityNotFound(_0x4f25e6,null))[_0x1c13('0x20')](saveUpdates(_0x21697f[_0x1c13('0x57')],null))[_0x1c13('0x20')](function(_0x366133){if(_0x366133){_0x28f0aa[_0x1c13('0x27')]=_0x366133[_0x1c13('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x1c13('0x56')]({'where':{'id':_0x366133['FaxInteractionId']}});}return null;})[_0x1c13('0x20')](handleEntityNotFound(_0x4f25e6,null))[_0x1c13('0x20')](function(_0x51d79f){if(_0x51d79f){return _0x51d79f[_0x1c13('0x36')]({'UserId':_0x21697f['body'][_0x1c13('0x5e')],'read1stAt':_['isNil'](_0x51d79f['read1stAt'])?moment()[_0x1c13('0x5c')](_0x1c13('0x5d')):undefined});}return null;})['then'](function(_0x23b439){if(_0x23b439){_0x28f0aa[_0x1c13('0x61')]=_0x23b439[_0x1c13('0x60')]({'plain':!![]});interaction_log[_0x1c13('0x21')](_0x1c13('0x62'),_0x21697f[_0x1c13('0x63')]['id'],_0x21697f[_0x1c13('0x63')]['name'],_0x21697f[_0x1c13('0x63')][_0x1c13('0x64')],_0x28f0aa[_0x1c13('0x61')]['id'],_0x21697f[_0x1c13('0x57')]?JSON[_0x1c13('0x65')](_0x21697f[_0x1c13('0x57')]):_0x1c13('0x66'));return respondWithRpcPromise(_0x1c13('0x67'),'acceptMessage',_0x28f0aa);}return null;})[_0x1c13('0x20')](function(_0x163edd){var _0x5d4c1b=_0x1c13('0x68')+_0x163edd['message'][_0x1c13('0x69')];return db['sequelize'][_0x1c13('0x40')](_0x5d4c1b,{'type':db['Sequelize'][_0x1c13('0x6a')][_0x1c13('0x6b')],'raw':!![]})['then'](function(_0xc4fb22){return _0xc4fb22;});})[_0x1c13('0x20')](function(_0x2c72b7){if(_0x2c72b7){_0x28f0aa[_0x1c13('0x27')][_0x1c13('0x6c')]=_0x2c72b7[0x0];if(!_0x21697f[_0x1c13('0x57')][_0x1c13('0x5e')])return;return db[_0x1c13('0x6d')][_0x1c13('0x56')]({'where':{'id':_0x21697f[_0x1c13('0x57')][_0x1c13('0x5e')],'role':'agent'},'attributes':['id','name',_0x1c13('0x6e'),'email',_0x1c13('0x6f')],'raw':!![]});}return null;})[_0x1c13('0x20')](function(_0x57ce0c){if(!_0x57ce0c)return null;_0x28f0aa['message'][_0x1c13('0x5f')]=_0x57ce0c;return _0x28f0aa;})['then'](function(_0x105988){if(_0x105988){if(_0x21697f[_0x1c13('0x57')][_0x1c13('0x70')]){_0x28f0aa[_0x1c13('0x27')]['interface']=util[_0x1c13('0x5c')](_0x1c13('0x71'),_0x21697f[_0x1c13('0x63')][_0x1c13('0x39')]);_0x28f0aa[_0x1c13('0x27')]['channel']=_0x28f0aa[_0x1c13('0x72')];_0x28f0aa['message'][_0x1c13('0x73')]=_0x28f0aa['channel'];_0x28f0aa['message']['event']=_0x1c13('0x59');return respondWithRpcPromise(_0x1c13('0x74'),_0x1c13('0x74'),{'event':_0x1c13('0x75'),'message':_0x28f0aa[_0x1c13('0x27')]},client9002)['then'](function(){return _0x28f0aa;});}return _0x28f0aa;}return null;})[_0x1c13('0x20')](respondWithResult(_0x4f25e6,null))[_0x1c13('0x29')](handleError(_0x4f25e6,null));};var interaction_log=require(_0x1c13('0x76'))(_0x1c13('0x77'));exports[_0x1c13('0x34')]=function(_0x1fd6ff,_0x27758f,_0x2d59dd){var _0x338e8b={'agent':{},'channel':_0x1c13('0x5a')};if(_0x1fd6ff[_0x1c13('0x57')]['id']){delete _0x1fd6ff[_0x1c13('0x57')]['id'];}_0x1fd6ff[_0x1c13('0x57')]['UserId']=_0x1fd6ff[_0x1c13('0x57')][_0x1c13('0x5e')]||_0x1fd6ff['user']['id'];_0x338e8b[_0x1c13('0x5f')]['id']=_0x1fd6ff[_0x1c13('0x57')][_0x1c13('0x5e')];return db[_0x1c13('0x3c')][_0x1c13('0x56')]({'where':{'id':_0x1fd6ff['params']['id'],'UserId':null}})[_0x1c13('0x20')](handleEntityNotFound(_0x27758f,null))['then'](function(_0x1a6f28){if(_0x1a6f28){_0x338e8b[_0x1c13('0x27')]=_0x1a6f28['get']({'plain':!![]});return db[_0x1c13('0x78')][_0x1c13('0x56')]({'where':{'id':_0x1a6f28[_0x1c13('0x79')]}});}return null;})[_0x1c13('0x20')](handleEntityNotFound(_0x27758f,null))['then'](function(_0x1d886e){if(_0x1d886e){_0x338e8b[_0x1c13('0x61')]=_0x1d886e[_0x1c13('0x60')]({'plain':!![]});interaction_log[_0x1c13('0x21')](_0x1c13('0x7a'),_0x1fd6ff[_0x1c13('0x63')]['id'],_0x1fd6ff[_0x1c13('0x63')][_0x1c13('0x39')],_0x1fd6ff[_0x1c13('0x63')][_0x1c13('0x64')],_0x338e8b[_0x1c13('0x61')]['id'],_0x1fd6ff[_0x1c13('0x57')]?JSON['stringify'](_0x1fd6ff[_0x1c13('0x57')]):_0x1c13('0x66'));return respondWithRpcPromise(_0x1c13('0x7b'),'rejectMessage',_0x338e8b);}return null;})[_0x1c13('0x20')](function(_0x12c121){var _0x2fed6f=_0x1c13('0x68')+_0x12c121[_0x1c13('0x27')]['ContactId'];return db[_0x1c13('0x7c')][_0x1c13('0x40')](_0x2fed6f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x1c13('0x20')](function(_0x5532fb){return _0x5532fb;});})[_0x1c13('0x20')](function(_0x6087ce){if(_0x6087ce){_0x338e8b['message'][_0x1c13('0x6c')]=_0x6087ce[0x0];if(!_0x1fd6ff[_0x1c13('0x57')][_0x1c13('0x5e')])return;return db['User']['find']({'where':{'id':_0x1fd6ff[_0x1c13('0x57')][_0x1c13('0x5e')],'role':_0x1c13('0x5f')},'attributes':['id',_0x1c13('0x39'),_0x1c13('0x6e'),_0x1c13('0x7d'),_0x1c13('0x6f')],'raw':!![]});}return null;})['then'](function(_0x1ec842){if(!_0x1ec842)return null;_0x338e8b[_0x1c13('0x27')][_0x1c13('0x5f')]=_0x1ec842;return _0x338e8b;})['then'](function(_0x2ef654){if(_0x2ef654){_0x2ef654[_0x1c13('0x27')][_0x1c13('0x7e')]=util[_0x1c13('0x5c')]('SIP/%s',_0x1fd6ff['user'][_0x1c13('0x39')]);_0x2ef654[_0x1c13('0x27')][_0x1c13('0x72')]=_0x338e8b[_0x1c13('0x72')];_0x2ef654['message'][_0x1c13('0x73')]=_0x338e8b[_0x1c13('0x72')];_0x2ef654[_0x1c13('0x27')][_0x1c13('0x7f')]='reject';respondWithRpcPromise(_0x1c13('0x74'),_0x1c13('0x74'),{'event':_0x1c13('0x80'),'message':_0x2ef654[_0x1c13('0x27')]},client9002);return _0x338e8b;}return null;})[_0x1c13('0x20')](respondWithResult(_0x27758f,null))[_0x1c13('0x29')](handleError(_0x27758f,null));};exports[_0x1c13('0x81')]=function(_0x5bcc38,_0x495439){var _0x1f7cec;return db[_0x1c13('0x3c')]['create'](_0x5bcc38[_0x1c13('0x57')],{})['then'](function(_0x41d827){_0x1f7cec=_0x41d827;return db['CmContact'][_0x1c13('0x82')]({'where':{'id':_0x1f7cec['ContactId']}});})[_0x1c13('0x20')](function(_0x362326){if(_[_0x1c13('0x83')](_0x362326)){return;}else{_0x1f7cec[_0x1c13('0x5a')]=_0x362326[_0x1c13('0x5a')];return db[_0x1c13('0x84')]['findOne']({'where':{'id':_0x1f7cec[_0x1c13('0x85')]}});}})[_0x1c13('0x20')](function(_0x52876d){return respondWithRpcPromise('SendFax',_0x1c13('0x86'),{'FaxAccountId':_['isNil'](_0x5bcc38[_0x1c13('0x57')])?undefined:_0x5bcc38[_0x1c13('0x57')][_0x1c13('0x87')],'path':_[_0x1c13('0x83')](_0x52876d)?undefined:util[_0x1c13('0x5c')](_0x1c13('0x88'),_0x52876d[_0x1c13('0x89')]),'fax':_[_0x1c13('0x83')](_0x1f7cec[_0x1c13('0x5a')])?undefined:_0x1f7cec[_0x1c13('0x5a')],'AttachmentId':_0x1f7cec[_0x1c13('0x85')]},client9002);})[_0x1c13('0x20')](respondWithResult(_0x495439,0xc9))['catch'](handleError(_0x495439,null));};exports['download']=function(_0x38a242,_0x4e573a){var _0x16f049=path[_0x1c13('0x8a')](config['root'],_0x1c13('0x8b'),_0x1c13('0x8c'),_0x1c13('0x8d'));return db['FaxMessage'][_0x1c13('0x56')]({'where':{'id':_0x38a242[_0x1c13('0x54')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x4e573a,null))[_0x1c13('0x20')](function(_0x2a2ded){if(_0x2a2ded){return _0x4e573a[_0x1c13('0x8e')](path[_0x1c13('0x8a')](_0x16f049,_0x2a2ded['Attachment'][_0x1c13('0x89')]));}})[_0x1c13('0x29')](handleError(_0x4e573a,null));}; \ No newline at end of file +var _0x5d75=['findOne','fax','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','FaxMessage','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','keys','find','body','describe','../../config/logger','fax-interactions','accept','read','readAt','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[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','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','channel','event','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','interface','SIP/%s','motionChannel','rejectmessage','create'];(function(_0x7f1644,_0x268f86){var _0x5518b0=function(_0x977aba){while(--_0x977aba){_0x7f1644['push'](_0x7f1644['shift']());}};_0x5518b0(++_0x268f86);}(_0x5d75,0x9a));var _0x55d7=function(_0x1e92df,_0x1fd37c){_0x1e92df=_0x1e92df-0x0;var _0x238e28=_0x5d75[_0x1e92df];return _0x238e28;};'use strict';var emlformat=require(_0x55d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55d7('0x1'));var jsonpatch=require(_0x55d7('0x2'));var rp=require(_0x55d7('0x3'));var moment=require(_0x55d7('0x4'));var BPromise=require(_0x55d7('0x5'));var Mustache=require(_0x55d7('0x6'));var util=require('util');var path=require(_0x55d7('0x7'));var sox=require('sox');var csv=require(_0x55d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55d7('0x9'));var _=require(_0x55d7('0xa'));var squel=require(_0x55d7('0xb'));var crypto=require(_0x55d7('0xc'));var jsforce=require(_0x55d7('0xd'));var deskjs=require(_0x55d7('0xe'));var toCsv=require(_0x55d7('0x8'));var querystring=require(_0x55d7('0xf'));var Papa=require('papaparse');var Redis=require(_0x55d7('0x10'));var authService=require(_0x55d7('0x11'));var qs=require(_0x55d7('0x12'));var as=require(_0x55d7('0x13'));var hardwareService=require(_0x55d7('0x14'));var logger=require('../../config/logger')(_0x55d7('0x15'));var utils=require(_0x55d7('0x16'));var config=require(_0x55d7('0x17'));var licenseUtil=require(_0x55d7('0x18'));var db=require(_0x55d7('0x19'))['db'];config[_0x55d7('0x1a')]=_['defaults'](config[_0x55d7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x55d7('0x1b'))(new Redis(config[_0x55d7('0x1a')]));require('./faxMessage.socket')[_0x55d7('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x55d7('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x55d7('0x1d')][_0x55d7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e79,_0x5c92ec,_0x22ca10,_0x5422f5){return new BPromise(function(_0x5d9d24,_0x46eae1){var _0x15719f=_0x5422f5||client;return _0x15719f[_0x55d7('0x1f')](_0x4a0e79,_0x22ca10)[_0x55d7('0x20')](function(_0x3bdd6d){logger[_0x55d7('0x21')](_0x55d7('0x22'),_0x5c92ec,'request\x20sent');logger[_0x55d7('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c92ec,'request\x20sent',JSON[_0x55d7('0x24')](_0x3bdd6d));if(_0x3bdd6d['error']){if(_0x3bdd6d[_0x55d7('0x25')][_0x55d7('0x26')]===0x1f4){logger[_0x55d7('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5c92ec,_0x3bdd6d['error']['message']);return _0x46eae1(_0x3bdd6d['error'][_0x55d7('0x27')]);}logger[_0x55d7('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5c92ec,_0x3bdd6d[_0x55d7('0x25')][_0x55d7('0x27')]);return _0x5d9d24(_0x3bdd6d[_0x55d7('0x25')][_0x55d7('0x27')]);}else{logger[_0x55d7('0x21')](_0x55d7('0x22'),_0x5c92ec,_0x55d7('0x28'));_0x5d9d24(_0x3bdd6d['result'][_0x55d7('0x27')]);}})['catch'](function(_0x7835b2){logger['error'](_0x55d7('0x22'),_0x5c92ec,_0x7835b2);_0x46eae1(_0x7835b2);});});}function respondWithStatusCode(_0x2a258c,_0x3a9a34){_0x3a9a34=_0x3a9a34||0xcc;return function(_0x216da1){if(_0x216da1){return _0x2a258c[_0x55d7('0x29')](_0x3a9a34);}return _0x2a258c[_0x55d7('0x2a')](_0x3a9a34)[_0x55d7('0x2b')]();};}function respondWithResult(_0x59805b,_0x5d4c06){_0x5d4c06=_0x5d4c06||0xc8;return function(_0x32800b){if(_0x32800b){return _0x59805b[_0x55d7('0x2a')](_0x5d4c06)[_0x55d7('0x2c')](_0x32800b);}};}function respondWithFilteredResult(_0x306723,_0x4dd18c){return function(_0x258995){if(_0x258995){var _0x298eb4=typeof _0x4dd18c[_0x55d7('0x2d')]===_0x55d7('0x2e')&&typeof _0x4dd18c[_0x55d7('0x2f')]===_0x55d7('0x2e');var _0x2038b3=_0x258995['count'];var _0x4535fa=_0x298eb4?0x0:_0x4dd18c[_0x55d7('0x2d')];var _0x2a7587=_0x298eb4?_0x258995[_0x55d7('0x30')]:_0x4dd18c['offset']+_0x4dd18c[_0x55d7('0x2f')];var _0x57b7d9;if(_0x2a7587>=_0x2038b3){_0x2a7587=_0x2038b3;_0x57b7d9=0xc8;}else{_0x57b7d9=0xce;}_0x306723['status'](_0x57b7d9);return _0x306723[_0x55d7('0x31')](_0x55d7('0x32'),_0x4535fa+'-'+_0x2a7587+'/'+_0x2038b3)[_0x55d7('0x2c')](_0x258995);}return null;};}function patchUpdates(_0x3d3067){return function(_0x22c152){try{jsonpatch['apply'](_0x22c152,_0x3d3067,!![]);}catch(_0x3e0ae6){return BPromise[_0x55d7('0x33')](_0x3e0ae6);}return _0x22c152[_0x55d7('0x34')]();};}function saveUpdates(_0x399244,_0x5cfbcc){return function(_0x6bb6ff){if(_0x6bb6ff){return _0x6bb6ff[_0x55d7('0x35')](_0x399244)[_0x55d7('0x20')](function(_0x439c7d){return _0x439c7d;});}return null;};}function removeEntity(_0x4af21e,_0x5a1abd){return function(_0x311846){if(_0x311846){return _0x311846[_0x55d7('0x36')]()[_0x55d7('0x20')](function(){_0x4af21e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bc4d8,_0x7d9160){return function(_0x221019){if(!_0x221019){_0x4bc4d8[_0x55d7('0x29')](0x194);}return _0x221019;};}function handleError(_0x6f33c5,_0x1039e5){_0x1039e5=_0x1039e5||0x1f4;return function(_0x3b4f4b){logger[_0x55d7('0x25')](_0x3b4f4b[_0x55d7('0x37')]);if(_0x3b4f4b[_0x55d7('0x38')]){delete _0x3b4f4b[_0x55d7('0x38')];}_0x6f33c5[_0x55d7('0x2a')](_0x1039e5)[_0x55d7('0x39')](_0x3b4f4b);};}exports[_0x55d7('0x3a')]=function(_0x25c0c2,_0x504fd6){var _0x11d19c={},_0xbe84ba={},_0x311710={'count':0x0,'rows':[]};var _0xa2e99b=_['map'](db[_0x55d7('0x3b')]['rawAttributes'],function(_0x2c6d2e){return{'name':_0x2c6d2e['fieldName'],'type':_0x2c6d2e[_0x55d7('0x3c')]['key']};});_0xbe84ba[_0x55d7('0x3d')]=_[_0x55d7('0x3e')](_0xa2e99b,_0x55d7('0x38'));_0xbe84ba['query']=_['keys'](_0x25c0c2[_0x55d7('0x3f')]);_0xbe84ba[_0x55d7('0x40')]=_[_0x55d7('0x41')](_0xbe84ba[_0x55d7('0x3d')],_0xbe84ba[_0x55d7('0x3f')]);_0x11d19c[_0x55d7('0x42')]=_[_0x55d7('0x41')](_0xbe84ba['model'],qs[_0x55d7('0x43')](_0x25c0c2[_0x55d7('0x3f')][_0x55d7('0x43')]));_0x11d19c['attributes']=_0x11d19c[_0x55d7('0x42')][_0x55d7('0x44')]?_0x11d19c['attributes']:_0xbe84ba[_0x55d7('0x3d')];if(!_0x25c0c2['query'][_0x55d7('0x45')](_0x55d7('0x46'))){_0x11d19c[_0x55d7('0x2f')]=qs[_0x55d7('0x2f')](_0x25c0c2['query'][_0x55d7('0x2f')]);_0x11d19c[_0x55d7('0x2d')]=qs[_0x55d7('0x2d')](_0x25c0c2[_0x55d7('0x3f')][_0x55d7('0x2d')]);}_0x11d19c[_0x55d7('0x47')]=qs[_0x55d7('0x48')](_0x25c0c2['query'][_0x55d7('0x48')]);_0x11d19c['where']=qs['filters'](_['pick'](_0x25c0c2['query'],_0xbe84ba[_0x55d7('0x40')]),_0xa2e99b);if(_0x25c0c2[_0x55d7('0x3f')][_0x55d7('0x49')]){_0x11d19c[_0x55d7('0x4a')]=_[_0x55d7('0x4b')](_0x11d19c[_0x55d7('0x4a')],{'$or':_[_0x55d7('0x3e')](_0xa2e99b,function(_0x163e0a){if(_0x163e0a['type']!==_0x55d7('0x4c')){var _0x391124={};_0x391124[_0x163e0a[_0x55d7('0x38')]]={'$like':'%'+_0x25c0c2[_0x55d7('0x3f')]['filter']+'%'};return _0x391124;}})});}_0x11d19c=_[_0x55d7('0x4b')]({},_0x11d19c,_0x25c0c2[_0x55d7('0x4d')]);var _0x5e7147={'where':_0x11d19c['where']};return db[_0x55d7('0x3b')][_0x55d7('0x30')](_0x5e7147)[_0x55d7('0x20')](function(_0x183bc1){_0x311710[_0x55d7('0x30')]=_0x183bc1;if(_0x25c0c2[_0x55d7('0x3f')][_0x55d7('0x4e')]){_0x11d19c[_0x55d7('0x4f')]=[{'all':!![]}];}return db[_0x55d7('0x3b')]['findAll'](_0x11d19c);})[_0x55d7('0x20')](function(_0xc2612d){_0x311710[_0x55d7('0x50')]=_0xc2612d;return _0x311710;})[_0x55d7('0x20')](respondWithFilteredResult(_0x504fd6,_0x11d19c))[_0x55d7('0x51')](handleError(_0x504fd6,null));};exports['show']=function(_0x23076d,_0x209d1c){var _0x60c807={'raw':!![],'where':{'id':_0x23076d[_0x55d7('0x52')]['id']}},_0x2c9acd={};_0x2c9acd[_0x55d7('0x3d')]=_['keys'](db[_0x55d7('0x3b')][_0x55d7('0x53')]);_0x2c9acd['query']=_[_0x55d7('0x54')](_0x23076d[_0x55d7('0x3f')]);_0x2c9acd[_0x55d7('0x40')]=_[_0x55d7('0x41')](_0x2c9acd[_0x55d7('0x3d')],_0x2c9acd['query']);_0x60c807[_0x55d7('0x42')]=_[_0x55d7('0x41')](_0x2c9acd[_0x55d7('0x3d')],qs[_0x55d7('0x43')](_0x23076d['query']['fields']));_0x60c807[_0x55d7('0x42')]=_0x60c807[_0x55d7('0x42')]['length']?_0x60c807[_0x55d7('0x42')]:_0x2c9acd[_0x55d7('0x3d')];if(_0x23076d[_0x55d7('0x3f')][_0x55d7('0x4e')]){_0x60c807[_0x55d7('0x4f')]=[{'all':!![]}];}_0x60c807=_[_0x55d7('0x4b')]({},_0x60c807,_0x23076d['options']);return db[_0x55d7('0x3b')][_0x55d7('0x55')](_0x60c807)[_0x55d7('0x20')](handleEntityNotFound(_0x209d1c,null))[_0x55d7('0x20')](respondWithResult(_0x209d1c,null))[_0x55d7('0x51')](handleError(_0x209d1c,null));};exports[_0x55d7('0x35')]=function(_0x391997,_0x538270){if(_0x391997[_0x55d7('0x56')]['id']){delete _0x391997[_0x55d7('0x56')]['id'];}return db[_0x55d7('0x3b')][_0x55d7('0x55')]({'where':{'id':_0x391997['params']['id']}})[_0x55d7('0x20')](handleEntityNotFound(_0x538270,null))[_0x55d7('0x20')](saveUpdates(_0x391997[_0x55d7('0x56')],null))[_0x55d7('0x20')](respondWithResult(_0x538270,null))[_0x55d7('0x51')](handleError(_0x538270,null));};exports[_0x55d7('0x36')]=function(_0x3dd8f5,_0x145e19){return db['FaxMessage'][_0x55d7('0x55')]({'where':{'id':_0x3dd8f5[_0x55d7('0x52')]['id']}})[_0x55d7('0x20')](handleEntityNotFound(_0x145e19,null))['then'](removeEntity(_0x145e19,null))[_0x55d7('0x51')](handleError(_0x145e19,null));};exports[_0x55d7('0x57')]=function(_0x52be5b,_0x1409e4){return db[_0x55d7('0x3b')][_0x55d7('0x57')]()[_0x55d7('0x20')](respondWithResult(_0x1409e4,null))['catch'](handleError(_0x1409e4,null));};var interaction_log=require(_0x55d7('0x58'))(_0x55d7('0x59'));exports[_0x55d7('0x5a')]=function(_0x31c24c,_0x1ca779,_0x3fede6){var _0x36b12f={'agent':{},'channel':'fax'};if(_0x31c24c[_0x55d7('0x56')]['id']){delete _0x31c24c[_0x55d7('0x56')]['id'];}_0x31c24c[_0x55d7('0x56')][_0x55d7('0x5b')]=!![];_0x31c24c[_0x55d7('0x56')][_0x55d7('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x31c24c['body'][_0x55d7('0x5d')]=_0x31c24c[_0x55d7('0x56')][_0x55d7('0x5d')]||_0x31c24c[_0x55d7('0x5e')]['id'];_0x36b12f['agent']['id']=_0x31c24c[_0x55d7('0x56')][_0x55d7('0x5d')];return db[_0x55d7('0x3b')]['find']({'where':{'id':_0x31c24c[_0x55d7('0x52')]['id'],'UserId':null}})[_0x55d7('0x20')](handleEntityNotFound(_0x1ca779,null))['then'](saveUpdates(_0x31c24c['body'],null))[_0x55d7('0x20')](function(_0x27bad9){if(_0x27bad9){_0x36b12f[_0x55d7('0x27')]=_0x27bad9['get']({'plain':!![]});return db[_0x55d7('0x5f')]['find']({'where':{'id':_0x27bad9[_0x55d7('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1ca779,null))[_0x55d7('0x20')](function(_0x2991e0){if(_0x2991e0){return _0x2991e0['update']({'UserId':_0x31c24c[_0x55d7('0x56')]['UserId'],'read1stAt':_[_0x55d7('0x61')](_0x2991e0[_0x55d7('0x62')])?moment()[_0x55d7('0x63')](_0x55d7('0x64')):undefined});}return null;})['then'](function(_0x3401f3){if(_0x3401f3){_0x36b12f[_0x55d7('0x65')]=_0x3401f3[_0x55d7('0x66')]({'plain':!![]});interaction_log[_0x55d7('0x21')](_0x55d7('0x67'),_0x31c24c['user']['id'],_0x31c24c['user']['name'],_0x31c24c[_0x55d7('0x5e')][_0x55d7('0x68')],_0x36b12f[_0x55d7('0x65')]['id'],_0x31c24c[_0x55d7('0x56')]?JSON['stringify'](_0x31c24c[_0x55d7('0x56')]):_0x55d7('0x69'));return respondWithRpcPromise(_0x55d7('0x6a'),'acceptMessage',_0x36b12f);}return null;})[_0x55d7('0x20')](function(_0xc8f75e){var _0x2de500=_0x55d7('0x6b')+_0xc8f75e['message'][_0x55d7('0x6c')];return db[_0x55d7('0x6d')][_0x55d7('0x3f')](_0x2de500,{'type':db[_0x55d7('0x6e')][_0x55d7('0x6f')][_0x55d7('0x70')],'raw':!![]})[_0x55d7('0x20')](function(_0x57c1f3){return _0x57c1f3;});})[_0x55d7('0x20')](function(_0x3b8f69){if(_0x3b8f69){_0x36b12f[_0x55d7('0x27')][_0x55d7('0x71')]=_0x3b8f69[0x0];if(!_0x31c24c['body']['UserId'])return;return db[_0x55d7('0x72')][_0x55d7('0x55')]({'where':{'id':_0x31c24c[_0x55d7('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x55d7('0x38'),_0x55d7('0x73'),'email',_0x55d7('0x74')],'raw':!![]});}return null;})[_0x55d7('0x20')](function(_0x3d4ff6){if(!_0x3d4ff6)return null;_0x36b12f['message']['agent']=_0x3d4ff6;return _0x36b12f;})[_0x55d7('0x20')](function(_0x1ca24b){if(_0x1ca24b){if(_0x31c24c[_0x55d7('0x56')][_0x55d7('0x75')]){_0x36b12f['message']['interface']=util[_0x55d7('0x63')]('SIP/%s',_0x31c24c[_0x55d7('0x5e')]['name']);_0x36b12f['message'][_0x55d7('0x76')]=_0x36b12f[_0x55d7('0x76')];_0x36b12f[_0x55d7('0x27')]['motionChannel']=_0x36b12f[_0x55d7('0x76')];_0x36b12f[_0x55d7('0x27')][_0x55d7('0x77')]=_0x55d7('0x5a');return respondWithRpcPromise(_0x55d7('0x78'),_0x55d7('0x78'),{'event':_0x55d7('0x79'),'message':_0x36b12f['message']},client9002)[_0x55d7('0x20')](function(){return _0x36b12f;});}return _0x36b12f;}return null;})[_0x55d7('0x20')](respondWithResult(_0x1ca779,null))[_0x55d7('0x51')](handleError(_0x1ca779,null));};var interaction_log=require(_0x55d7('0x58'))(_0x55d7('0x59'));exports[_0x55d7('0x33')]=function(_0x1d504f,_0x2ed641,_0x267516){var _0x49c959={'agent':{},'channel':'fax'};if(_0x1d504f['body']['id']){delete _0x1d504f[_0x55d7('0x56')]['id'];}_0x1d504f[_0x55d7('0x56')][_0x55d7('0x5d')]=_0x1d504f[_0x55d7('0x56')][_0x55d7('0x5d')]||_0x1d504f[_0x55d7('0x5e')]['id'];_0x49c959[_0x55d7('0x7a')]['id']=_0x1d504f['body'][_0x55d7('0x5d')];return db[_0x55d7('0x3b')][_0x55d7('0x55')]({'where':{'id':_0x1d504f[_0x55d7('0x52')]['id'],'UserId':null}})[_0x55d7('0x20')](handleEntityNotFound(_0x2ed641,null))[_0x55d7('0x20')](function(_0x4eda23){if(_0x4eda23){_0x49c959[_0x55d7('0x27')]=_0x4eda23['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4eda23['FaxInteractionId']}});}return null;})[_0x55d7('0x20')](handleEntityNotFound(_0x2ed641,null))['then'](function(_0x5c3bb8){if(_0x5c3bb8){_0x49c959[_0x55d7('0x65')]=_0x5c3bb8[_0x55d7('0x66')]({'plain':!![]});interaction_log[_0x55d7('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d504f[_0x55d7('0x5e')]['id'],_0x1d504f[_0x55d7('0x5e')][_0x55d7('0x38')],_0x1d504f[_0x55d7('0x5e')][_0x55d7('0x68')],_0x49c959[_0x55d7('0x65')]['id'],_0x1d504f[_0x55d7('0x56')]?JSON[_0x55d7('0x24')](_0x1d504f[_0x55d7('0x56')]):_0x55d7('0x69'));return respondWithRpcPromise(_0x55d7('0x7b'),_0x55d7('0x7c'),_0x49c959);}return null;})[_0x55d7('0x20')](function(_0x55dac3){var _0x307d51=_0x55d7('0x6b')+_0x55dac3[_0x55d7('0x27')][_0x55d7('0x6c')];return db[_0x55d7('0x6d')][_0x55d7('0x3f')](_0x307d51,{'type':db[_0x55d7('0x6e')][_0x55d7('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x1daa66){return _0x1daa66;});})[_0x55d7('0x20')](function(_0x3d6a83){if(_0x3d6a83){_0x49c959[_0x55d7('0x27')]['contact']=_0x3d6a83[0x0];if(!_0x1d504f[_0x55d7('0x56')][_0x55d7('0x5d')])return;return db[_0x55d7('0x72')]['find']({'where':{'id':_0x1d504f[_0x55d7('0x56')]['UserId'],'role':_0x55d7('0x7a')},'attributes':['id',_0x55d7('0x38'),'fullname','email',_0x55d7('0x74')],'raw':!![]});}return null;})[_0x55d7('0x20')](function(_0x30894e){if(!_0x30894e)return null;_0x49c959[_0x55d7('0x27')]['agent']=_0x30894e;return _0x49c959;})[_0x55d7('0x20')](function(_0x2c46d5){if(_0x2c46d5){_0x2c46d5[_0x55d7('0x27')][_0x55d7('0x7d')]=util[_0x55d7('0x63')](_0x55d7('0x7e'),_0x1d504f[_0x55d7('0x5e')][_0x55d7('0x38')]);_0x2c46d5[_0x55d7('0x27')][_0x55d7('0x76')]=_0x49c959[_0x55d7('0x76')];_0x2c46d5[_0x55d7('0x27')][_0x55d7('0x7f')]=_0x49c959[_0x55d7('0x76')];_0x2c46d5['message'][_0x55d7('0x77')]='reject';respondWithRpcPromise(_0x55d7('0x78'),_0x55d7('0x78'),{'event':_0x55d7('0x80'),'message':_0x2c46d5['message']},client9002);return _0x49c959;}return null;})[_0x55d7('0x20')](respondWithResult(_0x2ed641,null))[_0x55d7('0x51')](handleError(_0x2ed641,null));};exports[_0x55d7('0x81')]=function(_0x205213,_0x2e3eea){var _0x45baa7;return db[_0x55d7('0x3b')][_0x55d7('0x81')](_0x205213[_0x55d7('0x56')],{})[_0x55d7('0x20')](function(_0x4d0d8d){_0x45baa7=_0x4d0d8d;return db['CmContact'][_0x55d7('0x82')]({'where':{'id':_0x45baa7['ContactId']}});})['then'](function(_0x28b78b){if(_[_0x55d7('0x61')](_0x28b78b)){return;}else{_0x45baa7[_0x55d7('0x83')]=_0x28b78b['fax'];return db[_0x55d7('0x84')]['findOne']({'where':{'id':_0x45baa7['AttachmentId']}});}})[_0x55d7('0x20')](function(_0xfecb32){return respondWithRpcPromise(_0x55d7('0x85'),_0x55d7('0x85'),{'FaxAccountId':_[_0x55d7('0x61')](_0x205213[_0x55d7('0x56')])?undefined:_0x205213[_0x55d7('0x56')][_0x55d7('0x86')],'path':_['isNil'](_0xfecb32)?undefined:util[_0x55d7('0x63')](_0x55d7('0x87'),_0xfecb32['basename']),'fax':_['isNil'](_0x45baa7[_0x55d7('0x83')])?undefined:_0x45baa7['fax'],'AttachmentId':_0x45baa7['AttachmentId']},client9002);})[_0x55d7('0x20')](respondWithResult(_0x2e3eea,0xc9))[_0x55d7('0x51')](handleError(_0x2e3eea,null));};exports[_0x55d7('0x88')]=function(_0x317d1c,_0x2da5c2){var _0x39170e=path[_0x55d7('0x89')](config[_0x55d7('0x8a')],_0x55d7('0x8b'),_0x55d7('0x8c'),_0x55d7('0x8d'));return db[_0x55d7('0x3b')][_0x55d7('0x55')]({'where':{'id':_0x317d1c[_0x55d7('0x52')]['id']},'include':[{'model':db[_0x55d7('0x84')],'as':_0x55d7('0x84')}]})[_0x55d7('0x20')](handleEntityNotFound(_0x2da5c2,null))[_0x55d7('0x20')](function(_0x2155f7){if(_0x2155f7){return _0x2da5c2[_0x55d7('0x88')](path[_0x55d7('0x89')](_0x39170e,_0x2155f7[_0x55d7('0x84')]['basename']));}})[_0x55d7('0x51')](handleError(_0x2da5c2,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 8f9c198..f9434e7 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 _0x103f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5e6ddc,_0x43868b){var _0x260177=function(_0x20f39f){while(--_0x20f39f){_0x5e6ddc['push'](_0x5e6ddc['shift']());}};_0x260177(++_0x43868b);}(_0x103f,0x13e));var _0xf103=function(_0x1f1348,_0x3b16f4){_0x1f1348=_0x1f1348-0x0;var _0x16b0e7=_0x103f[_0x1f1348];return _0x16b0e7;};'use strict';var EventEmitter=require(_0xf103('0x0'));var FaxMessage=require(_0xf103('0x1'))['db'][_0xf103('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xf103('0x3')](0x0);var events={'afterCreate':_0xf103('0x4'),'afterUpdate':_0xf103('0x5'),'afterDestroy':_0xf103('0x6')};function emitEvent(_0x13898d){return function(_0x2db927,_0x2e15c9,_0x5a617c){FaxMessageEvents[_0xf103('0x7')](_0x13898d+':'+_0x2db927['id'],_0x2db927);FaxMessageEvents[_0xf103('0x7')](_0x13898d,_0x2db927);_0x5a617c(null);};}for(var e in events){if(events[_0xf103('0x8')](e)){var event=events[e];FaxMessage[_0xf103('0x9')](e,emitEvent(event));}}module[_0xf103('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x66da=['../../mysqldb','FaxMessage','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x2962d7,_0x2c1711){var _0x57425d=function(_0x247936){while(--_0x247936){_0x2962d7['push'](_0x2962d7['shift']());}};_0x57425d(++_0x2c1711);}(_0x66da,0x16f));var _0xa66d=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x66da[_0x3d9b04];return _0x557936;};'use strict';var EventEmitter=require(_0xa66d('0x0'));var FaxMessage=require(_0xa66d('0x1'))['db'][_0xa66d('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa66d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17b831){return function(_0x950036,_0x1326e8,_0x436606){FaxMessageEvents[_0xa66d('0x4')](_0x17b831+':'+_0x950036['id'],_0x950036);FaxMessageEvents['emit'](_0x17b831,_0x950036);_0x436606(null);};}for(var e in events){if(events[_0xa66d('0x5')](e)){var event=events[e];FaxMessage[_0xa66d('0x6')](e,emitEvent(event));}}module[_0xa66d('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 5b7516d..37029b3 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 _0x517b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','error','utf8mb4_unicode_ci','lodash','util'];(function(_0x3377f8,_0x27a400){var _0x1c65af=function(_0x4eb02f){while(--_0x4eb02f){_0x3377f8['push'](_0x3377f8['shift']());}};_0x1c65af(++_0x27a400);}(_0x517b,0xd0));var _0xb517=function(_0x21ce6a,_0x36f62d){_0x21ce6a=_0x21ce6a-0x0;var _0x408b6f=_0x517b[_0x21ce6a];return _0x408b6f;};'use strict';var _=require(_0xb517('0x0'));var util=require(_0xb517('0x1'));var logger=require(_0xb517('0x2'))(_0xb517('0x3'));var moment=require(_0xb517('0x4'));var BPromise=require(_0xb517('0x5'));var rp=require(_0xb517('0x6'));var fs=require('fs');var path=require(_0xb517('0x7'));var rimraf=require('rimraf');var config=require(_0xb517('0x8'));var attributes=require(_0xb517('0x9'));module[_0xb517('0xa')]=function(_0x517a7c,_0x521bf8){return _0x517a7c[_0xb517('0xb')](_0xb517('0xc'),attributes,{'tableName':_0xb517('0xd'),'paranoid':![],'indexes':[{'name':_0xb517('0xe'),'fields':[_0xb517('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34d5ec,_0x3ded63,_0x765850){var _0x3451e5=_0x517a7c[_0xb517('0x10')];var _0x5879b0=_0x34d5ec[_0xb517('0x11')]({'plain':!![]});if(_0x5879b0[_0xb517('0x12')]['toLowerCase']()==='in'||_0x5879b0['direction'][_0xb517('0x13')]()==='out'&&!_0x5879b0[_0xb517('0x14')]&&!_[_0xb517('0x15')](_0x5879b0[_0xb517('0x16')])){_0x3451e5[_0xb517('0x17')][_0xb517('0x18')]({'where':{'id':_0x5879b0[_0xb517('0x19')]}})[_0xb517('0x1a')](function(_0x50ca28){if(_0x50ca28){_0x50ca28[_0xb517('0x1b')]({'lastMsgAt':_0x5879b0['createdAt'],'lastMsgDirection':_0x5879b0['direction'][_0xb517('0x13')]()});}})['catch'](function(_0x4b2f38){console[_0xb517('0x1c')](_0x4b2f38);});}_0x765850();}},'charset':'utf8mb4','collate':_0xb517('0x1d')});}; \ No newline at end of file +var _0xfca0=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1d1a9c,_0x2274db){var _0x3e0c65=function(_0x2c41c5){while(--_0x2c41c5){_0x1d1a9c['push'](_0x1d1a9c['shift']());}};_0x3e0c65(++_0x2274db);}(_0xfca0,0xc0));var _0x0fca=function(_0xb57c58,_0x559be0){_0xb57c58=_0xb57c58-0x0;var _0x5b4105=_0xfca0[_0xb57c58];return _0x5b4105;};'use strict';var _=require(_0x0fca('0x0'));var util=require(_0x0fca('0x1'));var logger=require(_0x0fca('0x2'))(_0x0fca('0x3'));var moment=require(_0x0fca('0x4'));var BPromise=require(_0x0fca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fca('0x6'));var config=require(_0x0fca('0x7'));var attributes=require(_0x0fca('0x8'));module[_0x0fca('0x9')]=function(_0x36da62,_0x55def0){return _0x36da62[_0x0fca('0xa')](_0x0fca('0xb'),attributes,{'tableName':_0x0fca('0xc'),'paranoid':![],'indexes':[{'name':_0x0fca('0xd'),'fields':[_0x0fca('0xe')],'type':_0x0fca('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa6a4eb,_0x1231cf,_0x106c9a){var _0x49e187=_0x36da62[_0x0fca('0x10')];var _0x41299e=_0xa6a4eb['get']({'plain':!![]});if(_0x41299e[_0x0fca('0x11')][_0x0fca('0x12')]()==='in'||_0x41299e['direction'][_0x0fca('0x12')]()===_0x0fca('0x13')&&!_0x41299e[_0x0fca('0x14')]&&!_[_0x0fca('0x15')](_0x41299e[_0x0fca('0x16')])){_0x49e187[_0x0fca('0x17')]['findOne']({'where':{'id':_0x41299e[_0x0fca('0x18')]}})[_0x0fca('0x19')](function(_0x467fe9){if(_0x467fe9){_0x467fe9[_0x0fca('0x1a')]({'lastMsgAt':_0x41299e[_0x0fca('0x1b')],'lastMsgDirection':_0x41299e[_0x0fca('0x11')][_0x0fca('0x12')]()});}})[_0x0fca('0x1c')](function(_0x38f84){console[_0x0fca('0x1d')](_0x38f84);});}_0x106c9a();}},'charset':_0x0fca('0x1e'),'collate':_0x0fca('0x1f')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 9f07feb..a48fa62 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 _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fd1,0x155));var _0x15fd=function(_0x2b336a,_0x1cf250){_0x2b336a=_0x2b336a-0x0;var _0x3ec6db=_0x5fd1[_0x2b336a];return _0x3ec6db;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0x55ca=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','code','error','message','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0x55ca[_0x161f59];return _0x3ffa0e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});config[_0xa55c('0xa')]=_['defaults'](config[_0xa55c('0xa')],{'host':_0xa55c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0xa')]));require(_0xa55c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5849ad,_0x473d0e,_0x20c76a){return new BPromise(function(_0x381d07,_0x5d8e5a){return client[_0xa55c('0xd')](_0x5849ad,_0x20c76a)[_0xa55c('0xe')](function(_0x508342){logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x473d0e,_0xa55c('0x11'),JSON['stringify'](_0x508342));if(_0x508342['error']){if(_0x508342['error'][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x5d8e5a(_0x508342[_0xa55c('0x13')]['message']);}logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x381d07(_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);}else{logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));_0x381d07(_0x508342['result'][_0xa55c('0x14')]);}})[_0xa55c('0x15')](function(_0x461284){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x461284);_0x5d8e5a(_0x461284);});});}exports[_0xa55c('0x16')]=function(_0x4c0daf){var _0x5f5158=this;return new Promise(function(_0xd643cc,_0x3776ac){return db[_0xa55c('0x17')]['create'](_0x4c0daf[_0xa55c('0x18')],{'raw':_0x4c0daf[_0xa55c('0x19')]?_0x4c0daf['options'][_0xa55c('0x1a')]===undefined?!![]:![]:!![]})[_0xa55c('0xe')](function(_0x940f28){logger[_0xa55c('0xf')](_0xa55c('0x16'),_0x4c0daf);logger['debug'](_0xa55c('0x16'),_0x4c0daf,JSON['stringify'](_0x940f28));_0xd643cc(_0x940f28);})['catch'](function(_0x59d89a){logger[_0xa55c('0x13')]('CreateFaxMessage',_0x59d89a[_0xa55c('0x14')],_0x4c0daf);_0x3776ac(_0x5f5158[_0xa55c('0x13')](0x1f4,_0x59d89a[_0xa55c('0x14')]));});});};exports[_0xa55c('0x1b')]=function(_0x2313a9){var _0x170ba4=this;return new Promise(function(_0x1da633,_0x11e7f7){return db[_0xa55c('0x17')][_0xa55c('0x1c')](_0x2313a9[_0xa55c('0x18')],{'raw':_0x2313a9['options']?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')]['where']||null:null,'attributes':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1d')]||null:null,'limit':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1e')]||null:null})['then'](function(_0x23e698){logger['info'](_0xa55c('0x1b'),_0x2313a9);logger[_0xa55c('0x1f')](_0xa55c('0x1b'),_0x2313a9,JSON[_0xa55c('0x20')](_0x23e698));_0x1da633(_0x23e698);})['catch'](function(_0x3d28fb){logger[_0xa55c('0x13')](_0xa55c('0x1b'),_0x3d28fb[_0xa55c('0x14')],_0x2313a9);_0x11e7f7(_0x170ba4[_0xa55c('0x13')](0x1f4,_0x3d28fb[_0xa55c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 986ed48..d619dc8 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 _0x293c=['faxMessage:','remove','update','emit','removeListener','register'];(function(_0x10eaa2,_0x3038b4){var _0x58748f=function(_0x20f138){while(--_0x20f138){_0x10eaa2['push'](_0x10eaa2['shift']());}};_0x58748f(++_0x3038b4);}(_0x293c,0x121));var _0xc293=function(_0x55d6e3,_0xacdb0f){_0x55d6e3=_0x55d6e3-0x0;var _0x4ded90=_0x293c[_0x55d6e3];return _0x4ded90;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xc293('0x0'),_0xc293('0x1')];function createListener(_0x56de77,_0x139908){return function(_0x11a1fe){_0x139908[_0xc293('0x2')](_0x56de77,_0x11a1fe);};}function removeListener(_0x13e9d4,_0x12b39e){return function(){FaxMessageEvents[_0xc293('0x3')](_0x13e9d4,_0x12b39e);};}exports[_0xc293('0x4')]=function(_0x5e37d9){for(var _0x2acac9=0x0,_0xc95110=events['length'];_0x2acac9<_0xc95110;_0x2acac9++){var _0x175f65=events[_0x2acac9];var _0x437f1a=createListener(_0xc293('0x5')+_0x175f65,_0x5e37d9);FaxMessageEvents['on'](_0x175f65,_0x437f1a);}}; \ No newline at end of file +var _0x728e=['remove','update','emit','register','./faxMessage.events','save'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x728e,0x11e));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';var FaxMessageEvents=require(_0xe728('0x0'));var events=[_0xe728('0x1'),_0xe728('0x2'),_0xe728('0x3')];function createListener(_0x29ecc2,_0x17ac5c){return function(_0x29acc3){_0x17ac5c[_0xe728('0x4')](_0x29ecc2,_0x29acc3);};}function removeListener(_0xad034e,_0x550466){return function(){FaxMessageEvents['removeListener'](_0xad034e,_0x550466);};}exports[_0xe728('0x5')]=function(_0x2a526a){for(var _0x1d657f=0x0,_0x55c323=events['length'];_0x1d657f<_0x55c323;_0x1d657f++){var _0x28f1cf=events[_0x1d657f];var _0x77127b=createListener('faxMessage:'+_0x28f1cf,_0x2a526a);FaxMessageEvents['on'](_0x28f1cf,_0x77127b);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 2382cfc..9abc826 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 _0xbdb7=['accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','index','get','describe','show','/:id/download','isAuthenticated','download','post','tracked','put','/:id','update'];(function(_0x8668ef,_0xd2b52d){var _0x530cfa=function(_0x3771e4){while(--_0x3771e4){_0x8668ef['push'](_0x8668ef['shift']());}};_0x530cfa(++_0xd2b52d);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5c48ea,_0x2191a2){_0x5c48ea=_0x5c48ea-0x0;var _0x1262dc=_0xbdb7[_0x5c48ea];return _0x1262dc;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')]('/',auth[_0x7bdb('0xf')](),interaction[_0x7bdb('0x12')]('fax','faxmessage:create'),controller['create']);router[_0x7bdb('0x13')](_0x7bdb('0x14'),auth['isAuthenticated'](),controller[_0x7bdb('0x15')]);router['put']('/:id/accept',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x7bdb('0x17')]);router[_0x7bdb('0x18')](_0x7bdb('0x14'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x19')]);module[_0x7bdb('0x1a')]=router; \ No newline at end of file +var _0x4ea3=['isAuthenticated','index','/describe','/:id','/:id/download','post','tracked','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./faxMessage.controller','get'];(function(_0x37a0b1,_0xd86c26){var _0x492809=function(_0x553ce5){while(--_0x553ce5){_0x37a0b1['push'](_0x37a0b1['shift']());}};_0x492809(++_0xd86c26);}(_0x4ea3,0x70));var _0x34ea=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4ea3[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),auth[_0x34ea('0x8')](),controller['describe']);router[_0x34ea('0x7')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['show']);router[_0x34ea('0x7')](_0x34ea('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x34ea('0xd')]('/',auth[_0x34ea('0x8')](),interaction[_0x34ea('0xe')]('fax',_0x34ea('0xf')),controller[_0x34ea('0x10')]);router[_0x34ea('0x11')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller[_0x34ea('0x12')]);router[_0x34ea('0x11')](_0x34ea('0x13'),auth[_0x34ea('0x8')](),controller[_0x34ea('0x14')]);router[_0x34ea('0x11')]('/:id/reject',auth[_0x34ea('0x8')](),controller[_0x34ea('0x15')]);router[_0x34ea('0x16')](_0x34ea('0xb'),auth[_0x34ea('0x8')](),controller['destroy']);module[_0x34ea('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index c50294b..6cdb167 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 _0xf74b=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x86f50d,_0x30bdc1){var _0x3969c9=function(_0x2c5f38){while(--_0x2c5f38){_0x86f50d['push'](_0x86f50d['shift']());}};_0x3969c9(++_0x30bdc1);}(_0xf74b,0x97));var _0xbf74=function(_0x49894b,_0x331d1a){_0x49894b=_0x49894b-0x0;var _0x5a6001=_0xf74b[_0x49894b];return _0x5a6001;};'use strict';var Sequelize=require(_0xbf74('0x0'));module[_0xbf74('0x1')]={'name':{'type':Sequelize[_0xbf74('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbf74('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf74('0x4')](_0xbf74('0x5'),_0xbf74('0x6'),_0xbf74('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbf74('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x55f5=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4e2d2e,_0x193b09){var _0x5a3d21=function(_0x425cea){while(--_0x425cea){_0x4e2d2e['push'](_0x4e2d2e['shift']());}};_0x5a3d21(++_0x193b09);}(_0x55f5,0xae));var _0x555f=function(_0x668979,_0x3629f3){_0x668979=_0x668979-0x0;var _0x458bce=_0x55f5[_0x668979];return _0x458bce;};'use strict';var Sequelize=require(_0x555f('0x0'));module[_0x555f('0x1')]={'name':{'type':Sequelize[_0x555f('0x2')],'unique':_0x555f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x555f('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x555f('0x5')](_0x555f('0x6'),_0x555f('0x7'),_0x555f('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x555f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index a9f9b52..e67e283 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 _0x4fbf=['create','body','role','FaxQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','FaxQueueId','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','pick','getTeams','addTeams','User','online','voicePause','Agents','sequelize','transaction','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','get','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','FaxQueue','includeAll','include','findAll','rows','catch','params','find'];(function(_0x54079a,_0x2151a8){var _0x1fcd06=function(_0x2229b5){while(--_0x2229b5){_0x54079a['push'](_0x54079a['shift']());}};_0x1fcd06(++_0x2151a8);}(_0x4fbf,0x1db));var _0xf4fb=function(_0x583a6e,_0x4d8361){_0x583a6e=_0x583a6e-0x0;var _0x5cff56=_0x4fbf[_0x583a6e];return _0x5cff56;};'use strict';var emlformat=require(_0xf4fb('0x0'));var rimraf=require(_0xf4fb('0x1'));var zipdir=require(_0xf4fb('0x2'));var jsonpatch=require(_0xf4fb('0x3'));var rp=require(_0xf4fb('0x4'));var moment=require(_0xf4fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf4fb('0x6'));var util=require(_0xf4fb('0x7'));var path=require(_0xf4fb('0x8'));var sox=require(_0xf4fb('0x9'));var csv=require(_0xf4fb('0xa'));var ejs=require(_0xf4fb('0xb'));var fs=require('fs');var fs_extra=require(_0xf4fb('0xc'));var _=require(_0xf4fb('0xd'));var squel=require(_0xf4fb('0xe'));var crypto=require('crypto');var jsforce=require(_0xf4fb('0xf'));var deskjs=require(_0xf4fb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf4fb('0x11'));var Papa=require(_0xf4fb('0x12'));var Redis=require(_0xf4fb('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf4fb('0x14'));var as=require(_0xf4fb('0x15'));var hardwareService=require(_0xf4fb('0x16'));var logger=require(_0xf4fb('0x17'))(_0xf4fb('0x18'));var utils=require(_0xf4fb('0x19'));var config=require(_0xf4fb('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4fb('0x1b'))['db'];config[_0xf4fb('0x1c')]=_[_0xf4fb('0x1d')](config[_0xf4fb('0x1c')],{'host':_0xf4fb('0x1e'),'port':0x18eb});var socket=require(_0xf4fb('0x1f'))(new Redis(config[_0xf4fb('0x1c')]));require(_0xf4fb('0x20'))[_0xf4fb('0x21')](socket);function respondWithStatusCode(_0x59aac7,_0x1d7fe8){_0x1d7fe8=_0x1d7fe8||0xcc;return function(_0x5b2d5e){if(_0x5b2d5e){return _0x59aac7[_0xf4fb('0x22')](_0x1d7fe8);}return _0x59aac7[_0xf4fb('0x23')](_0x1d7fe8)[_0xf4fb('0x24')]();};}function respondWithResult(_0x1cca3f,_0x1d7769){_0x1d7769=_0x1d7769||0xc8;return function(_0x5aac41){if(_0x5aac41){return _0x1cca3f[_0xf4fb('0x23')](_0x1d7769)[_0xf4fb('0x25')](_0x5aac41);}};}function respondWithFilteredResult(_0x53c0cc,_0xbeb503){return function(_0x38caf5){if(_0x38caf5){var _0x5a4058=typeof _0xbeb503[_0xf4fb('0x26')]===_0xf4fb('0x27')&&typeof _0xbeb503[_0xf4fb('0x28')]===_0xf4fb('0x27');var _0x5c7137=_0x38caf5[_0xf4fb('0x29')];var _0x5854e9=_0x5a4058?0x0:_0xbeb503['offset'];var _0x5aeec6=_0x5a4058?_0x38caf5[_0xf4fb('0x29')]:_0xbeb503[_0xf4fb('0x26')]+_0xbeb503['limit'];var _0xa29328;if(_0x5aeec6>=_0x5c7137){_0x5aeec6=_0x5c7137;_0xa29328=0xc8;}else{_0xa29328=0xce;}_0x53c0cc['status'](_0xa29328);return _0x53c0cc[_0xf4fb('0x2a')]('Content-Range',_0x5854e9+'-'+_0x5aeec6+'/'+_0x5c7137)[_0xf4fb('0x25')](_0x38caf5);}return null;};}function patchUpdates(_0x1d7d03){return function(_0x1ec1f4){try{jsonpatch['apply'](_0x1ec1f4,_0x1d7d03,!![]);}catch(_0x150685){return BPromise['reject'](_0x150685);}return _0x1ec1f4[_0xf4fb('0x2b')]();};}function saveUpdates(_0x1c8ecc,_0x559ad8){return function(_0x38ad71){if(_0x38ad71){return _0x38ad71['update'](_0x1c8ecc)[_0xf4fb('0x2c')](function(_0x1088c2){return _0x1088c2;});}return null;};}function removeEntity(_0x68abd5,_0xa06c86){return function(_0x3352d0){if(_0x3352d0){return _0x3352d0[_0xf4fb('0x2d')]()['then'](function(){var _0x44a9aa=_0x3352d0[_0xf4fb('0x2e')]({'plain':!![]});var _0x338852='FaxQueues';return db['UserProfileResource'][_0xf4fb('0x2d')]({'where':{'type':_0x338852,'resourceId':_0x44a9aa['id']}})['then'](function(){return _0x3352d0;});})[_0xf4fb('0x2c')](function(){_0x68abd5['status'](0xcc)[_0xf4fb('0x24')]();});}};}function handleEntityNotFound(_0x104784,_0x1830fd){return function(_0x21cd1c){if(!_0x21cd1c){_0x104784[_0xf4fb('0x22')](0x194);}return _0x21cd1c;};}function handleError(_0x290153,_0x122b01){_0x122b01=_0x122b01||0x1f4;return function(_0x5803cb){logger[_0xf4fb('0x2f')](_0x5803cb[_0xf4fb('0x30')]);if(_0x5803cb['name']){delete _0x5803cb[_0xf4fb('0x31')];}_0x290153['status'](_0x122b01)['send'](_0x5803cb);};}exports[_0xf4fb('0x32')]=function(_0x51fffc,_0x235690){var _0x2ab28f={},_0x265add={},_0x536d3f={'count':0x0,'rows':[]};var _0x1b112f=_[_0xf4fb('0x33')](db['FaxQueue'][_0xf4fb('0x34')],function(_0x45e460){return{'name':_0x45e460[_0xf4fb('0x35')],'type':_0x45e460[_0xf4fb('0x36')][_0xf4fb('0x37')]};});_0x265add[_0xf4fb('0x38')]=_[_0xf4fb('0x33')](_0x1b112f,'name');_0x265add[_0xf4fb('0x39')]=_[_0xf4fb('0x3a')](_0x51fffc[_0xf4fb('0x39')]);_0x265add[_0xf4fb('0x3b')]=_[_0xf4fb('0x3c')](_0x265add[_0xf4fb('0x38')],_0x265add['query']);_0x2ab28f[_0xf4fb('0x3d')]=_[_0xf4fb('0x3c')](_0x265add['model'],qs['fields'](_0x51fffc['query'][_0xf4fb('0x3e')]));_0x2ab28f[_0xf4fb('0x3d')]=_0x2ab28f[_0xf4fb('0x3d')][_0xf4fb('0x3f')]?_0x2ab28f[_0xf4fb('0x3d')]:_0x265add[_0xf4fb('0x38')];if(!_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x40')](_0xf4fb('0x41'))){_0x2ab28f[_0xf4fb('0x28')]=qs[_0xf4fb('0x28')](_0x51fffc[_0xf4fb('0x39')]['limit']);_0x2ab28f[_0xf4fb('0x26')]=qs['offset'](_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x26')]);}_0x2ab28f[_0xf4fb('0x42')]=qs[_0xf4fb('0x43')](_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x43')]);_0x2ab28f[_0xf4fb('0x44')]=qs[_0xf4fb('0x3b')](_['pick'](_0x51fffc[_0xf4fb('0x39')],_0x265add['filters']),_0x1b112f);if(_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x45')]){_0x2ab28f[_0xf4fb('0x44')]=_['merge'](_0x2ab28f['where'],{'$or':_[_0xf4fb('0x33')](_0x1b112f,function(_0x27c636){if(_0x27c636[_0xf4fb('0x36')]!==_0xf4fb('0x46')){var _0x96d6bb={};_0x96d6bb[_0x27c636[_0xf4fb('0x31')]]={'$like':'%'+_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x45')]+'%'};return _0x96d6bb;}})});}_0x2ab28f=_[_0xf4fb('0x47')]({},_0x2ab28f,_0x51fffc[_0xf4fb('0x48')]);var _0xd6a0d1={'where':_0x2ab28f['where']};return db[_0xf4fb('0x49')]['count'](_0xd6a0d1)[_0xf4fb('0x2c')](function(_0x21266a){_0x536d3f[_0xf4fb('0x29')]=_0x21266a;if(_0x51fffc[_0xf4fb('0x39')][_0xf4fb('0x4a')]){_0x2ab28f[_0xf4fb('0x4b')]=[{'all':!![]}];}return db[_0xf4fb('0x49')][_0xf4fb('0x4c')](_0x2ab28f);})['then'](function(_0x3c80de){_0x536d3f[_0xf4fb('0x4d')]=_0x3c80de;return _0x536d3f;})[_0xf4fb('0x2c')](respondWithFilteredResult(_0x235690,_0x2ab28f))[_0xf4fb('0x4e')](handleError(_0x235690,null));};exports['show']=function(_0x2dda3a,_0x223662){var _0x290ba1={'raw':!![],'where':{'id':_0x2dda3a[_0xf4fb('0x4f')]['id']}},_0x964368={};_0x964368['model']=_['keys'](db[_0xf4fb('0x49')]['rawAttributes']);_0x964368[_0xf4fb('0x39')]=_[_0xf4fb('0x3a')](_0x2dda3a['query']);_0x964368['filters']=_[_0xf4fb('0x3c')](_0x964368[_0xf4fb('0x38')],_0x964368['query']);_0x290ba1[_0xf4fb('0x3d')]=_[_0xf4fb('0x3c')](_0x964368[_0xf4fb('0x38')],qs['fields'](_0x2dda3a[_0xf4fb('0x39')][_0xf4fb('0x3e')]));_0x290ba1[_0xf4fb('0x3d')]=_0x290ba1['attributes'][_0xf4fb('0x3f')]?_0x290ba1['attributes']:_0x964368[_0xf4fb('0x38')];if(_0x2dda3a[_0xf4fb('0x39')][_0xf4fb('0x4a')]){_0x290ba1[_0xf4fb('0x4b')]=[{'all':!![]}];}_0x290ba1=_[_0xf4fb('0x47')]({},_0x290ba1,_0x2dda3a[_0xf4fb('0x48')]);return db[_0xf4fb('0x49')][_0xf4fb('0x50')](_0x290ba1)['then'](handleEntityNotFound(_0x223662,null))['then'](respondWithResult(_0x223662,null))['catch'](handleError(_0x223662,null));};exports[_0xf4fb('0x51')]=function(_0x4cb19b,_0x18dee2){return db[_0xf4fb('0x49')]['create'](_0x4cb19b[_0xf4fb('0x52')],{})[_0xf4fb('0x2c')](function(_0x405279){var _0x456b1b=_0x4cb19b['user'][_0xf4fb('0x2e')]({'plain':!![]});if(!_0x456b1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x456b1b[_0xf4fb('0x53')]==='user'){var _0x4c72a5=_0x405279[_0xf4fb('0x2e')]({'plain':!![]});var _0xf107f=_0xf4fb('0x54');return db['UserProfileSection']['find']({'where':{'name':_0xf107f,'userProfileId':_0x456b1b['userProfileId']},'raw':!![]})['then'](function(_0x19782f){if(_0x19782f&&_0x19782f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf4fb('0x51')]({'name':_0x4c72a5[_0xf4fb('0x31')],'resourceId':_0x4c72a5['id'],'type':_0x19782f[_0xf4fb('0x31')],'sectionId':_0x19782f['id']},{})[_0xf4fb('0x2c')](function(){return _0x405279;});}else{return _0x405279;}})[_0xf4fb('0x4e')](function(_0x38b1a8){logger[_0xf4fb('0x2f')](_0xf4fb('0x55'),_0x38b1a8);throw _0x38b1a8;});}return _0x405279;})[_0xf4fb('0x2c')](respondWithResult(_0x18dee2,0xc9))[_0xf4fb('0x4e')](handleError(_0x18dee2,null));};exports[_0xf4fb('0x56')]=function(_0x4113a1,_0x57fe47){if(_0x4113a1[_0xf4fb('0x52')]['id']){delete _0x4113a1[_0xf4fb('0x52')]['id'];}return db[_0xf4fb('0x49')][_0xf4fb('0x50')]({'where':{'id':_0x4113a1[_0xf4fb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57fe47,null))[_0xf4fb('0x2c')](saveUpdates(_0x4113a1[_0xf4fb('0x52')],null))[_0xf4fb('0x2c')](respondWithResult(_0x57fe47,null))[_0xf4fb('0x4e')](handleError(_0x57fe47,null));};exports[_0xf4fb('0x2d')]=function(_0x8297e4,_0x1646c6){return db['FaxQueue'][_0xf4fb('0x50')]({'where':{'id':_0x8297e4[_0xf4fb('0x4f')]['id']}})[_0xf4fb('0x2c')](handleEntityNotFound(_0x1646c6,null))[_0xf4fb('0x2c')](removeEntity(_0x1646c6,null))[_0xf4fb('0x4e')](handleError(_0x1646c6,null));};exports[_0xf4fb('0x57')]=function(_0x2c32e5,_0x4f8443){return db[_0xf4fb('0x49')][_0xf4fb('0x57')]()['then'](respondWithResult(_0x4f8443,null))[_0xf4fb('0x4e')](handleError(_0x4f8443,null));};exports[_0xf4fb('0x58')]=function(_0x187db8,_0x42e964,_0x43e530){var _0x335c28={'raw':!![],'where':{}},_0x5c2699={},_0x359f7a;return db[_0xf4fb('0x49')][_0xf4fb('0x59')]({'where':{'id':_0x187db8[_0xf4fb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42e964,null))[_0xf4fb('0x2c')](function(_0x53b868){if(_0x53b868){_0x359f7a=_0x53b868[_0xf4fb('0x2e')]({'plain':!![]});_0x5c2699[_0xf4fb('0x38')]=_[_0xf4fb('0x3a')](db['UserFaxQueue'][_0xf4fb('0x34')]);_0x5c2699[_0xf4fb('0x39')]=_['keys'](_0x187db8[_0xf4fb('0x39')]);_0x5c2699[_0xf4fb('0x3b')]=_['intersection'](_0x5c2699[_0xf4fb('0x38')],_0x5c2699[_0xf4fb('0x39')]);_0x335c28['attributes']=_[_0xf4fb('0x3c')](_0x5c2699[_0xf4fb('0x38')],qs[_0xf4fb('0x3e')](_0x187db8['query']['fields']));_0x335c28[_0xf4fb('0x3d')]=_0x335c28[_0xf4fb('0x3d')][_0xf4fb('0x3f')]?_0x335c28[_0xf4fb('0x3d')]:_0x5c2699[_0xf4fb('0x38')];if(!_0x187db8[_0xf4fb('0x39')][_0xf4fb('0x40')](_0xf4fb('0x41'))){_0x335c28[_0xf4fb('0x28')]=qs[_0xf4fb('0x28')](_0x187db8[_0xf4fb('0x39')][_0xf4fb('0x28')]);_0x335c28[_0xf4fb('0x26')]=qs[_0xf4fb('0x26')](_0x187db8[_0xf4fb('0x39')][_0xf4fb('0x26')]);}_0x335c28['order']=qs['sort'](_0x187db8[_0xf4fb('0x39')][_0xf4fb('0x43')]);_0x335c28['where']=qs[_0xf4fb('0x3b')](_['pick'](_0x187db8[_0xf4fb('0x39')],_0x5c2699['filters']));_0x335c28[_0xf4fb('0x44')][_0xf4fb('0x5a')]=_0x53b868['id'];if(_0x187db8['query'][_0xf4fb('0x45')]){_0x335c28[_0xf4fb('0x44')]=_['merge'](_0x335c28[_0xf4fb('0x44')],{'$or':_[_0xf4fb('0x33')](_0x335c28[_0xf4fb('0x3d')],function(_0x53c5c8){var _0x55aca1={};_0x55aca1[_0x53c5c8]={'$like':'%'+_0x187db8[_0xf4fb('0x39')]['filter']+'%'};return _0x55aca1;})});}_0x335c28=_[_0xf4fb('0x47')]({},_0x335c28,_0x187db8[_0xf4fb('0x48')]);return db[_0xf4fb('0x5b')]['findAll'](_0x335c28);}})[_0xf4fb('0x2c')](function(_0x27a9af){if(_0x27a9af){return db['User'][_0xf4fb('0x5c')]({'where':{'id':_[_0xf4fb('0x33')](_0x27a9af,_0xf4fb('0x5d')),'role':_0xf4fb('0x5e')},'attributes':['id',_0xf4fb('0x31'),_0xf4fb('0x5f'),_0xf4fb('0x60'),_0xf4fb('0x61')]});}})[_0xf4fb('0x2c')](function(_0x406a21){if(_0x406a21){return{'count':_0x406a21['count'],'rows':_[_0xf4fb('0x33')](_0x406a21[_0xf4fb('0x4d')],function(_0x1bd1c1){return{'membername':_0x1bd1c1['name'],'UserId':_0x1bd1c1['id'],'queue_name':_0x359f7a[_0xf4fb('0x31')],'FaxQueueId':_0x359f7a['id'],'interface':util[_0xf4fb('0x62')](_0xf4fb('0x63'),_0xf4fb('0x64'),_0x1bd1c1['name']),'penalty':0x0,'paused':_0x1bd1c1[_0xf4fb('0x5f')],'createdAt':_0x1bd1c1[_0xf4fb('0x61')],'updatedAt':_0x1bd1c1[_0xf4fb('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf4fb('0x2c')](respondWithFilteredResult(_0x42e964,_0x335c28))[_0xf4fb('0x4e')](handleError(_0x42e964,null));};exports['getTeams']=function(_0x2a251c,_0x3d2d28,_0x363c71){var _0x20ae7e={};var _0x59ae02={};var _0x2f39c2;var _0x1f6aa6;return db[_0xf4fb('0x49')][_0xf4fb('0x59')]({'where':{'id':_0x2a251c[_0xf4fb('0x4f')]['id']}})[_0xf4fb('0x2c')](handleEntityNotFound(_0x3d2d28,null))[_0xf4fb('0x2c')](function(_0x3c153f){if(_0x3c153f){_0x2f39c2=_0x3c153f;_0x59ae02[_0xf4fb('0x38')]=_['keys'](db[_0xf4fb('0x65')]['rawAttributes']);_0x59ae02['query']=_[_0xf4fb('0x3a')](_0x2a251c[_0xf4fb('0x39')]);_0x59ae02[_0xf4fb('0x3b')]=_[_0xf4fb('0x3c')](_0x59ae02[_0xf4fb('0x38')],_0x59ae02[_0xf4fb('0x39')]);_0x20ae7e['attributes']=_[_0xf4fb('0x3c')](_0x59ae02[_0xf4fb('0x38')],qs[_0xf4fb('0x3e')](_0x2a251c['query'][_0xf4fb('0x3e')]));_0x20ae7e[_0xf4fb('0x3d')]=_0x20ae7e[_0xf4fb('0x3d')][_0xf4fb('0x3f')]?_0x20ae7e[_0xf4fb('0x3d')]:_0x59ae02['model'];_0x20ae7e[_0xf4fb('0x42')]=qs[_0xf4fb('0x43')](_0x2a251c[_0xf4fb('0x39')][_0xf4fb('0x43')]);_0x20ae7e[_0xf4fb('0x44')]=qs['filters'](_[_0xf4fb('0x66')](_0x2a251c[_0xf4fb('0x39')],_0x59ae02[_0xf4fb('0x3b')]));if(_0x2a251c[_0xf4fb('0x39')][_0xf4fb('0x45')]){_0x20ae7e['where']=_[_0xf4fb('0x47')](_0x20ae7e[_0xf4fb('0x44')],{'$or':_['map'](_0x20ae7e[_0xf4fb('0x3d')],function(_0x55fa5b){var _0x1520a1={};_0x1520a1[_0x55fa5b]={'$like':'%'+_0x2a251c['query'][_0xf4fb('0x45')]+'%'};return _0x1520a1;})});}_0x20ae7e=_[_0xf4fb('0x47')]({},_0x20ae7e,_0x2a251c[_0xf4fb('0x48')]);return _0x2f39c2[_0xf4fb('0x67')](_0x20ae7e);}})['then'](function(_0x4897ff){if(_0x4897ff){_0x1f6aa6=_0x4897ff[_0xf4fb('0x3f')];if(!_0x2a251c['query'][_0xf4fb('0x40')](_0xf4fb('0x41'))){_0x20ae7e[_0xf4fb('0x28')]=qs[_0xf4fb('0x28')](_0x2a251c[_0xf4fb('0x39')][_0xf4fb('0x28')]);_0x20ae7e[_0xf4fb('0x26')]=qs[_0xf4fb('0x26')](_0x2a251c[_0xf4fb('0x39')][_0xf4fb('0x26')]);}return _0x2f39c2[_0xf4fb('0x67')](_0x20ae7e);}})[_0xf4fb('0x2c')](function(_0x711eb){if(_0x711eb){return _0x711eb?{'count':_0x1f6aa6,'rows':_0x711eb}:null;}})[_0xf4fb('0x2c')](respondWithResult(_0x3d2d28,null))[_0xf4fb('0x4e')](handleError(_0x3d2d28,null));};exports[_0xf4fb('0x68')]=function(_0x5a9e10,_0x3e3c1a,_0x166662){var _0x534a1c=_0x5a9e10[_0xf4fb('0x52')]['ids'];return db['Team']['findAll']({'where':{'id':_0x534a1c},'attributes':['id'],'include':[{'model':db[_0xf4fb('0x69')],'as':'Agents','attributes':['id','name',_0xf4fb('0x6a'),_0xf4fb('0x6b'),'interface'],'raw':!![]}]})[_0xf4fb('0x2c')](function(_0x50137b){if(_0x50137b){var _0x301b3c=_['flatMap'](_0x50137b,function(_0x240925){var _0x1a2c27=_0x240925[_0xf4fb('0x2e')]({'plain':!![]});return _0x1a2c27[_0xf4fb('0x6c')];});return db[_0xf4fb('0x49')]['find']({'where':{'id':_0x5a9e10['params']['id']}})[_0xf4fb('0x2c')](function(_0x462b43){return db[_0xf4fb('0x6d')][_0xf4fb('0x6e')](function(_0x3d5d1e){return _0x462b43[_0xf4fb('0x68')](_0x534a1c,{'transaction':_0x3d5d1e})[_0xf4fb('0x2c')](function(){return BPromise['each'](_0x301b3c,function(_0x5382f6){return db[_0xf4fb('0x5b')]['findOrCreate']({'where':{'UserId':_0x5382f6['id'],'FaxQueueId':_0x5a9e10['params']['id']},'transaction':_0x3d5d1e});});})['then'](function(){_0x301b3c['forEach'](function(_0x23c2a7){socket[_0xf4fb('0x6f')](_0xf4fb('0x70'),{'UserId':_0x23c2a7['id'],'FaxQueueId':_0x462b43['id']});});});});});}})[_0xf4fb('0x2c')](respondWithStatusCode(_0x3e3c1a,null))[_0xf4fb('0x4e')](handleError(_0x3e3c1a,null));};exports[_0xf4fb('0x71')]=function(_0x13f1b3,_0x76056,_0x459403){return db[_0xf4fb('0x65')][_0xf4fb('0x4c')]({'where':{'id':_0x13f1b3[_0xf4fb('0x39')][_0xf4fb('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf4fb('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf4fb('0x2c')](handleEntityNotFound(_0x76056,null))['then'](function(_0x7b7eda){var _0x5993b7=_[_0xf4fb('0x33')](_0x7b7eda,'id');var _0x22dc19=[];var _0x58ba11=[];var _0x3c194b=squel[_0xf4fb('0x73')]();_0x3c194b[_0xf4fb('0x74')](_0xf4fb('0x75'))[_0xf4fb('0x76')](_0xf4fb('0x77'),'tq')['join'](_0xf4fb('0x78'),'ut',_0xf4fb('0x79'))[_0xf4fb('0x44')](_0xf4fb('0x7a'),_0x13f1b3['params']['id']);for(var _0x31122b=0x0;_0x31122b<_0x7b7eda['length'];_0x31122b+=0x1){let _0x520f6a=_0x7b7eda[_0x31122b];for(var _0x116280=0x0;_0x116280<_0x520f6a['Agents'][_0xf4fb('0x3f')];_0x116280+=0x1){let _0x3f39eb=_0x520f6a[_0xf4fb('0x6c')][_0x116280];var _0x457a3d=_0x3c194b['clone']();_0x457a3d[_0xf4fb('0x44')]('ut.UserId\x20=\x20?',_0x3f39eb['id']);_0x58ba11[_0xf4fb('0x7b')](db[_0xf4fb('0x6d')][_0xf4fb('0x39')](_0x457a3d[_0xf4fb('0x7c')](),{'type':db['sequelize'][_0xf4fb('0x7d')][_0xf4fb('0x7e')]})[_0xf4fb('0x2c')](function(_0x2c455){if(_0x2c455[_0xf4fb('0x3f')]===0x1){return _0x3f39eb['id'];}else{var _0x4491cc=_[_0xf4fb('0x7f')](_[_0xf4fb('0x33')](_0x2c455,_0xf4fb('0x80')),function(_0x57ae42){return _[_0xf4fb('0x81')](_0x5993b7,_0x57ae42);});if(_0x4491cc){return _0x3f39eb['id'];}}}));}}return BPromise[_0xf4fb('0x82')](_0x58ba11)[_0xf4fb('0x2c')](function(_0x32427b){_0x22dc19=_(_0x22dc19)['union'](_0x32427b)['compact']()['value']();return db['FaxQueue'][_0xf4fb('0x50')]({'where':{'id':_0x13f1b3[_0xf4fb('0x4f')]['id']}})[_0xf4fb('0x2c')](function(_0x4d6e48){return db['sequelize'][_0xf4fb('0x6e')](function(_0x3c663e){return _0x4d6e48[_0xf4fb('0x71')](_0x13f1b3[_0xf4fb('0x39')][_0xf4fb('0x72')],{'transaction':_0x3c663e})[_0xf4fb('0x2c')](function(){if(!_[_0xf4fb('0x83')](_0x22dc19)){return _0x4d6e48[_0xf4fb('0x84')](_0x22dc19,{'transaction':_0x3c663e});}})['then'](function(){_0x22dc19[_0xf4fb('0x85')](function(_0x47af66){socket[_0xf4fb('0x6f')](_0xf4fb('0x86'),{'UserId':_0x47af66,'FaxQueueId':_0x4d6e48['id']});});});});});});})[_0xf4fb('0x2c')](respondWithStatusCode(_0x76056,null))[_0xf4fb('0x4e')](handleError(_0x76056,null));};exports[_0xf4fb('0x87')]=function(_0x4fa146,_0x5dd7ce,_0x19548e){return db['FaxQueue']['find']({'where':{'id':_0x4fa146['params']['id']}})[_0xf4fb('0x2c')](handleEntityNotFound(_0x5dd7ce,null))['then'](function(_0x6bab66){if(_0x6bab66){return _0x6bab66[_0xf4fb('0x87')](_0x4fa146[_0xf4fb('0x52')][_0xf4fb('0x72')],_[_0xf4fb('0x88')](_0x4fa146[_0xf4fb('0x52')],[_0xf4fb('0x72'),'id'])||{})[_0xf4fb('0x89')](function(_0x5b52c1){for(var _0x3784ab=0x0;_0x3784ab<_0x4fa146['body'][_0xf4fb('0x72')][_0xf4fb('0x3f')];_0x3784ab+=0x1){socket[_0xf4fb('0x6f')](_0xf4fb('0x70'),{'UserId':Number(_0x4fa146[_0xf4fb('0x52')][_0xf4fb('0x72')][_0x3784ab]),'FaxQueueId':Number(_0x4fa146[_0xf4fb('0x4f')]['id'])});}return _0x5b52c1;});}})['then'](respondWithResult(_0x5dd7ce,null))[_0xf4fb('0x4e')](handleError(_0x5dd7ce,null));};exports['removeAgents']=function(_0x4731e8,_0x17264b,_0x3cb862){return db[_0xf4fb('0x49')][_0xf4fb('0x50')]({'where':{'id':_0x4731e8[_0xf4fb('0x4f')]['id']}})[_0xf4fb('0x2c')](handleEntityNotFound(_0x17264b,null))['then'](function(_0x36b10c){if(_0x36b10c){return _0x36b10c[_0xf4fb('0x84')](_0x4731e8[_0xf4fb('0x39')][_0xf4fb('0x72')])[_0xf4fb('0x2c')](function(){if(_['isArray'](_0x4731e8['query'][_0xf4fb('0x72')])){for(var _0x47c757=0x0;_0x47c757<_0x4731e8[_0xf4fb('0x39')]['ids']['length'];_0x47c757+=0x1){socket[_0xf4fb('0x6f')](_0xf4fb('0x86'),{'UserId':Number(_0x4731e8['query'][_0xf4fb('0x72')][_0x47c757]),'FaxQueueId':Number(_0x4731e8[_0xf4fb('0x4f')]['id'])});}}else{socket[_0xf4fb('0x6f')](_0xf4fb('0x86'),{'UserId':Number(_0x4731e8[_0xf4fb('0x39')]['ids']),'FaxQueueId':Number(_0x4731e8['params']['id'])});}});}})[_0xf4fb('0x2c')](respondWithStatusCode(_0x17264b,null))['catch'](handleError(_0x17264b,null));};exports[_0xf4fb('0x8a')]=function(_0x30c144,_0x21855e,_0x5420f4){var _0x27bb8b={};var _0x2672fa={};var _0x3e74d6;var _0x1df473;return db['FaxQueue'][_0xf4fb('0x59')]({'where':{'id':_0x30c144[_0xf4fb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x21855e,null))['then'](function(_0x1d7c97){if(_0x1d7c97){_0x3e74d6=_0x1d7c97;_0x2672fa['model']=_[_0xf4fb('0x3a')](db[_0xf4fb('0x69')][_0xf4fb('0x34')]);_0x2672fa['query']=_['keys'](_0x30c144[_0xf4fb('0x39')]);_0x2672fa[_0xf4fb('0x3b')]=_[_0xf4fb('0x3c')](_0x2672fa[_0xf4fb('0x38')],_0x2672fa[_0xf4fb('0x39')]);_0x27bb8b[_0xf4fb('0x3d')]=_[_0xf4fb('0x3c')](_0x2672fa[_0xf4fb('0x38')],qs[_0xf4fb('0x3e')](_0x30c144['query'][_0xf4fb('0x3e')]));_0x27bb8b[_0xf4fb('0x3d')]=_0x27bb8b[_0xf4fb('0x3d')]['length']?_0x27bb8b[_0xf4fb('0x3d')]:_0x2672fa[_0xf4fb('0x38')];_0x27bb8b['order']=qs[_0xf4fb('0x43')](_0x30c144[_0xf4fb('0x39')][_0xf4fb('0x43')]);_0x27bb8b['where']=qs['filters'](_[_0xf4fb('0x66')](_0x30c144['query'],_0x2672fa[_0xf4fb('0x3b')]));if(_0x30c144[_0xf4fb('0x39')][_0xf4fb('0x45')]){_0x27bb8b['where']=_[_0xf4fb('0x47')](_0x27bb8b[_0xf4fb('0x44')],{'$or':_['map'](_0x27bb8b[_0xf4fb('0x3d')],function(_0x41d87e){var _0x45adda={};_0x45adda[_0x41d87e]={'$like':'%'+_0x30c144[_0xf4fb('0x39')][_0xf4fb('0x45')]+'%'};return _0x45adda;})});}_0x27bb8b=_[_0xf4fb('0x47')]({},_0x27bb8b,_0x30c144['options']);return _0x3e74d6[_0xf4fb('0x8a')](_0x27bb8b);}})[_0xf4fb('0x2c')](function(_0x208d64){if(_0x208d64){_0x1df473=_0x208d64[_0xf4fb('0x3f')];if(!_0x30c144[_0xf4fb('0x39')][_0xf4fb('0x40')]('nolimit')){_0x27bb8b[_0xf4fb('0x28')]=qs[_0xf4fb('0x28')](_0x30c144[_0xf4fb('0x39')]['limit']);_0x27bb8b[_0xf4fb('0x26')]=qs[_0xf4fb('0x26')](_0x30c144['query'][_0xf4fb('0x26')]);}return _0x3e74d6['getAgents'](_0x27bb8b);}})[_0xf4fb('0x2c')](function(_0x10871b){if(_0x10871b){return _0x10871b?{'count':_0x1df473,'rows':_0x10871b}:null;}})[_0xf4fb('0x2c')](respondWithResult(_0x21855e,null))[_0xf4fb('0x4e')](handleError(_0x21855e,null));}; \ No newline at end of file +var _0xead6=['UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','FaxQueues','UserProfileResource','end','error','name','send','index','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','options','FaxQueue','count','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserFaxQueue','length','sort','pick','FaxQueueId','User','findAndCountAll'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xead6,0xc2));var _0x6ead=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xead6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6ead('0x0'));var rimraf=require(_0x6ead('0x1'));var zipdir=require(_0x6ead('0x2'));var jsonpatch=require(_0x6ead('0x3'));var rp=require(_0x6ead('0x4'));var moment=require(_0x6ead('0x5'));var BPromise=require(_0x6ead('0x6'));var Mustache=require(_0x6ead('0x7'));var util=require(_0x6ead('0x8'));var path=require(_0x6ead('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6ead('0xa'));var fs=require('fs');var fs_extra=require(_0x6ead('0xb'));var _=require(_0x6ead('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6ead('0xd'));var deskjs=require(_0x6ead('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ead('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6ead('0x10'));var qs=require(_0x6ead('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ead('0x12'));var logger=require('../../config/logger')(_0x6ead('0x13'));var utils=require(_0x6ead('0x14'));var config=require(_0x6ead('0x15'));var licenseUtil=require(_0x6ead('0x16'));var db=require('../../mysqldb')['db'];config[_0x6ead('0x17')]=_[_0x6ead('0x18')](config[_0x6ead('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ead('0x17')]));require(_0x6ead('0x19'))[_0x6ead('0x1a')](socket);function respondWithStatusCode(_0x37a947,_0x489200){_0x489200=_0x489200||0xcc;return function(_0x312005){if(_0x312005){return _0x37a947[_0x6ead('0x1b')](_0x489200);}return _0x37a947[_0x6ead('0x1c')](_0x489200)['end']();};}function respondWithResult(_0x15dd19,_0x558cd3){_0x558cd3=_0x558cd3||0xc8;return function(_0x5edaf3){if(_0x5edaf3){return _0x15dd19['status'](_0x558cd3)['json'](_0x5edaf3);}};}function respondWithFilteredResult(_0x3eb91d,_0xb439dd){return function(_0x3f1145){if(_0x3f1145){var _0x1126be=typeof _0xb439dd[_0x6ead('0x1d')]==='undefined'&&typeof _0xb439dd['limit']===_0x6ead('0x1e');var _0x11920c=_0x3f1145['count'];var _0x56f0fb=_0x1126be?0x0:_0xb439dd[_0x6ead('0x1d')];var _0x3dc75f=_0x1126be?_0x3f1145['count']:_0xb439dd[_0x6ead('0x1d')]+_0xb439dd[_0x6ead('0x1f')];var _0x289383;if(_0x3dc75f>=_0x11920c){_0x3dc75f=_0x11920c;_0x289383=0xc8;}else{_0x289383=0xce;}_0x3eb91d[_0x6ead('0x1c')](_0x289383);return _0x3eb91d[_0x6ead('0x20')](_0x6ead('0x21'),_0x56f0fb+'-'+_0x3dc75f+'/'+_0x11920c)[_0x6ead('0x22')](_0x3f1145);}return null;};}function patchUpdates(_0x3b3890){return function(_0x49f935){try{jsonpatch[_0x6ead('0x23')](_0x49f935,_0x3b3890,!![]);}catch(_0x313130){return BPromise[_0x6ead('0x24')](_0x313130);}return _0x49f935[_0x6ead('0x25')]();};}function saveUpdates(_0x21e8c9,_0x5bb359){return function(_0x3e862e){if(_0x3e862e){return _0x3e862e['update'](_0x21e8c9)[_0x6ead('0x26')](function(_0x1a9cf4){return _0x1a9cf4;});}return null;};}function removeEntity(_0x340827,_0x394741){return function(_0x256d71){if(_0x256d71){return _0x256d71[_0x6ead('0x27')]()[_0x6ead('0x26')](function(){var _0x34d8fd=_0x256d71[_0x6ead('0x28')]({'plain':!![]});var _0x502eb1=_0x6ead('0x29');return db[_0x6ead('0x2a')][_0x6ead('0x27')]({'where':{'type':_0x502eb1,'resourceId':_0x34d8fd['id']}})['then'](function(){return _0x256d71;});})[_0x6ead('0x26')](function(){_0x340827[_0x6ead('0x1c')](0xcc)[_0x6ead('0x2b')]();});}};}function handleEntityNotFound(_0x335914,_0x4ce5bd){return function(_0x329973){if(!_0x329973){_0x335914[_0x6ead('0x1b')](0x194);}return _0x329973;};}function handleError(_0x37747b,_0xc4d234){_0xc4d234=_0xc4d234||0x1f4;return function(_0x126f35){logger[_0x6ead('0x2c')](_0x126f35['stack']);if(_0x126f35[_0x6ead('0x2d')]){delete _0x126f35[_0x6ead('0x2d')];}_0x37747b[_0x6ead('0x1c')](_0xc4d234)[_0x6ead('0x2e')](_0x126f35);};}exports[_0x6ead('0x2f')]=function(_0xd2fd27,_0x1cd5f0){var _0x5a1d6e={},_0x526732={},_0x21d4f6={'count':0x0,'rows':[]};var _0x2a0b2e=_['map'](db['FaxQueue'][_0x6ead('0x30')],function(_0x12b7c1){return{'name':_0x12b7c1['fieldName'],'type':_0x12b7c1[_0x6ead('0x31')][_0x6ead('0x32')]};});_0x526732['model']=_[_0x6ead('0x33')](_0x2a0b2e,_0x6ead('0x2d'));_0x526732[_0x6ead('0x34')]=_[_0x6ead('0x35')](_0xd2fd27[_0x6ead('0x34')]);_0x526732[_0x6ead('0x36')]=_['intersection'](_0x526732[_0x6ead('0x37')],_0x526732['query']);_0x5a1d6e[_0x6ead('0x38')]=_[_0x6ead('0x39')](_0x526732[_0x6ead('0x37')],qs['fields'](_0xd2fd27[_0x6ead('0x34')][_0x6ead('0x3a')]));_0x5a1d6e['attributes']=_0x5a1d6e['attributes']['length']?_0x5a1d6e['attributes']:_0x526732[_0x6ead('0x37')];if(!_0xd2fd27[_0x6ead('0x34')][_0x6ead('0x3b')](_0x6ead('0x3c'))){_0x5a1d6e[_0x6ead('0x1f')]=qs[_0x6ead('0x1f')](_0xd2fd27[_0x6ead('0x34')][_0x6ead('0x1f')]);_0x5a1d6e['offset']=qs[_0x6ead('0x1d')](_0xd2fd27[_0x6ead('0x34')]['offset']);}_0x5a1d6e[_0x6ead('0x3d')]=qs['sort'](_0xd2fd27[_0x6ead('0x34')]['sort']);_0x5a1d6e[_0x6ead('0x3e')]=qs[_0x6ead('0x36')](_['pick'](_0xd2fd27[_0x6ead('0x34')],_0x526732['filters']),_0x2a0b2e);if(_0xd2fd27[_0x6ead('0x34')]['filter']){_0x5a1d6e[_0x6ead('0x3e')]=_[_0x6ead('0x3f')](_0x5a1d6e['where'],{'$or':_['map'](_0x2a0b2e,function(_0x5dc9dc){if(_0x5dc9dc[_0x6ead('0x31')]!==_0x6ead('0x40')){var _0x1f8570={};_0x1f8570[_0x5dc9dc[_0x6ead('0x2d')]]={'$like':'%'+_0xd2fd27[_0x6ead('0x34')][_0x6ead('0x41')]+'%'};return _0x1f8570;}})});}_0x5a1d6e=_[_0x6ead('0x3f')]({},_0x5a1d6e,_0xd2fd27[_0x6ead('0x42')]);var _0x511cf6={'where':_0x5a1d6e[_0x6ead('0x3e')]};return db[_0x6ead('0x43')][_0x6ead('0x44')](_0x511cf6)['then'](function(_0x117b4f){_0x21d4f6['count']=_0x117b4f;if(_0xd2fd27[_0x6ead('0x34')][_0x6ead('0x45')]){_0x5a1d6e[_0x6ead('0x46')]=[{'all':!![]}];}return db[_0x6ead('0x43')][_0x6ead('0x47')](_0x5a1d6e);})['then'](function(_0x22be58){_0x21d4f6[_0x6ead('0x48')]=_0x22be58;return _0x21d4f6;})['then'](respondWithFilteredResult(_0x1cd5f0,_0x5a1d6e))[_0x6ead('0x49')](handleError(_0x1cd5f0,null));};exports['show']=function(_0x3fc3cf,_0x5887f9){var _0x34e575={'raw':!![],'where':{'id':_0x3fc3cf[_0x6ead('0x4a')]['id']}},_0x14f31d={};_0x14f31d[_0x6ead('0x37')]=_[_0x6ead('0x35')](db[_0x6ead('0x43')][_0x6ead('0x30')]);_0x14f31d[_0x6ead('0x34')]=_['keys'](_0x3fc3cf['query']);_0x14f31d[_0x6ead('0x36')]=_[_0x6ead('0x39')](_0x14f31d[_0x6ead('0x37')],_0x14f31d['query']);_0x34e575[_0x6ead('0x38')]=_['intersection'](_0x14f31d['model'],qs[_0x6ead('0x3a')](_0x3fc3cf[_0x6ead('0x34')][_0x6ead('0x3a')]));_0x34e575[_0x6ead('0x38')]=_0x34e575['attributes']['length']?_0x34e575[_0x6ead('0x38')]:_0x14f31d[_0x6ead('0x37')];if(_0x3fc3cf[_0x6ead('0x34')]['includeAll']){_0x34e575['include']=[{'all':!![]}];}_0x34e575=_[_0x6ead('0x3f')]({},_0x34e575,_0x3fc3cf[_0x6ead('0x42')]);return db[_0x6ead('0x43')][_0x6ead('0x4b')](_0x34e575)[_0x6ead('0x26')](handleEntityNotFound(_0x5887f9,null))[_0x6ead('0x26')](respondWithResult(_0x5887f9,null))[_0x6ead('0x49')](handleError(_0x5887f9,null));};exports['create']=function(_0x3d8fef,_0x5405c3){return db[_0x6ead('0x43')][_0x6ead('0x4c')](_0x3d8fef['body'],{})['then'](function(_0x414e8a){var _0x13dd54=_0x3d8fef[_0x6ead('0x4d')][_0x6ead('0x28')]({'plain':!![]});if(!_0x13dd54)throw new Error(_0x6ead('0x4e'));if(_0x13dd54[_0x6ead('0x4f')]==='user'){var _0x5ab93b=_0x414e8a[_0x6ead('0x28')]({'plain':!![]});var _0x1399c1=_0x6ead('0x29');return db[_0x6ead('0x50')][_0x6ead('0x4b')]({'where':{'name':_0x1399c1,'userProfileId':_0x13dd54[_0x6ead('0x51')]},'raw':!![]})[_0x6ead('0x26')](function(_0x20a5bc){if(_0x20a5bc&&_0x20a5bc[_0x6ead('0x52')]===0x0){return db['UserProfileResource'][_0x6ead('0x4c')]({'name':_0x5ab93b[_0x6ead('0x2d')],'resourceId':_0x5ab93b['id'],'type':_0x20a5bc[_0x6ead('0x2d')],'sectionId':_0x20a5bc['id']},{})[_0x6ead('0x26')](function(){return _0x414e8a;});}else{return _0x414e8a;}})[_0x6ead('0x49')](function(_0x43626d){logger[_0x6ead('0x2c')](_0x6ead('0x53'),_0x43626d);throw _0x43626d;});}return _0x414e8a;})[_0x6ead('0x26')](respondWithResult(_0x5405c3,0xc9))[_0x6ead('0x49')](handleError(_0x5405c3,null));};exports[_0x6ead('0x54')]=function(_0x43d17e,_0x549b5d){if(_0x43d17e[_0x6ead('0x55')]['id']){delete _0x43d17e['body']['id'];}return db[_0x6ead('0x43')][_0x6ead('0x4b')]({'where':{'id':_0x43d17e[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x549b5d,null))[_0x6ead('0x26')](saveUpdates(_0x43d17e[_0x6ead('0x55')],null))[_0x6ead('0x26')](respondWithResult(_0x549b5d,null))[_0x6ead('0x49')](handleError(_0x549b5d,null));};exports[_0x6ead('0x27')]=function(_0x39d8b9,_0x5b40e5){return db[_0x6ead('0x43')][_0x6ead('0x4b')]({'where':{'id':_0x39d8b9[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x5b40e5,null))[_0x6ead('0x26')](removeEntity(_0x5b40e5,null))[_0x6ead('0x49')](handleError(_0x5b40e5,null));};exports['describe']=function(_0x1aef45,_0x3800ef){return db[_0x6ead('0x43')][_0x6ead('0x56')]()[_0x6ead('0x26')](respondWithResult(_0x3800ef,null))[_0x6ead('0x49')](handleError(_0x3800ef,null));};exports[_0x6ead('0x57')]=function(_0x58d419,_0x1e6320,_0x57bceb){var _0x59b330={'raw':!![],'where':{}},_0x174b6b={},_0x3bcbae;return db['FaxQueue'][_0x6ead('0x58')]({'where':{'id':_0x58d419['params']['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x1e6320,null))['then'](function(_0x58d926){if(_0x58d926){_0x3bcbae=_0x58d926['get']({'plain':!![]});_0x174b6b[_0x6ead('0x37')]=_[_0x6ead('0x35')](db[_0x6ead('0x59')][_0x6ead('0x30')]);_0x174b6b[_0x6ead('0x34')]=_['keys'](_0x58d419[_0x6ead('0x34')]);_0x174b6b[_0x6ead('0x36')]=_['intersection'](_0x174b6b[_0x6ead('0x37')],_0x174b6b[_0x6ead('0x34')]);_0x59b330[_0x6ead('0x38')]=_[_0x6ead('0x39')](_0x174b6b['model'],qs['fields'](_0x58d419['query'][_0x6ead('0x3a')]));_0x59b330[_0x6ead('0x38')]=_0x59b330['attributes'][_0x6ead('0x5a')]?_0x59b330[_0x6ead('0x38')]:_0x174b6b['model'];if(!_0x58d419['query']['hasOwnProperty']('nolimit')){_0x59b330[_0x6ead('0x1f')]=qs[_0x6ead('0x1f')](_0x58d419['query'][_0x6ead('0x1f')]);_0x59b330[_0x6ead('0x1d')]=qs['offset'](_0x58d419[_0x6ead('0x34')]['offset']);}_0x59b330[_0x6ead('0x3d')]=qs[_0x6ead('0x5b')](_0x58d419[_0x6ead('0x34')]['sort']);_0x59b330[_0x6ead('0x3e')]=qs[_0x6ead('0x36')](_[_0x6ead('0x5c')](_0x58d419['query'],_0x174b6b[_0x6ead('0x36')]));_0x59b330[_0x6ead('0x3e')][_0x6ead('0x5d')]=_0x58d926['id'];if(_0x58d419['query'][_0x6ead('0x41')]){_0x59b330[_0x6ead('0x3e')]=_[_0x6ead('0x3f')](_0x59b330[_0x6ead('0x3e')],{'$or':_[_0x6ead('0x33')](_0x59b330[_0x6ead('0x38')],function(_0x596282){var _0x3720ab={};_0x3720ab[_0x596282]={'$like':'%'+_0x58d419['query'][_0x6ead('0x41')]+'%'};return _0x3720ab;})});}_0x59b330=_['merge']({},_0x59b330,_0x58d419[_0x6ead('0x42')]);return db[_0x6ead('0x59')][_0x6ead('0x47')](_0x59b330);}})[_0x6ead('0x26')](function(_0x57d22c){if(_0x57d22c){return db[_0x6ead('0x5e')][_0x6ead('0x5f')]({'where':{'id':_['map'](_0x57d22c,_0x6ead('0x60')),'role':_0x6ead('0x61')},'attributes':['id','name',_0x6ead('0x62'),_0x6ead('0x63'),_0x6ead('0x64')]});}})[_0x6ead('0x26')](function(_0x382c4a){if(_0x382c4a){return{'count':_0x382c4a[_0x6ead('0x44')],'rows':_['map'](_0x382c4a[_0x6ead('0x48')],function(_0x4177e1){return{'membername':_0x4177e1[_0x6ead('0x2d')],'UserId':_0x4177e1['id'],'queue_name':_0x3bcbae[_0x6ead('0x2d')],'FaxQueueId':_0x3bcbae['id'],'interface':util[_0x6ead('0x65')](_0x6ead('0x66'),'SIP',_0x4177e1[_0x6ead('0x2d')]),'penalty':0x0,'paused':_0x4177e1[_0x6ead('0x62')],'createdAt':_0x4177e1[_0x6ead('0x64')],'updatedAt':_0x4177e1[_0x6ead('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ead('0x26')](respondWithFilteredResult(_0x1e6320,_0x59b330))[_0x6ead('0x49')](handleError(_0x1e6320,null));};exports[_0x6ead('0x67')]=function(_0x38b2de,_0x378de3,_0x413ef5){var _0x4ec0f5={};var _0x263e7b={};var _0x3d7ec6;var _0x481be9;return db[_0x6ead('0x43')][_0x6ead('0x58')]({'where':{'id':_0x38b2de[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x378de3,null))['then'](function(_0x4b18f4){if(_0x4b18f4){_0x3d7ec6=_0x4b18f4;_0x263e7b[_0x6ead('0x37')]=_['keys'](db[_0x6ead('0x68')][_0x6ead('0x30')]);_0x263e7b[_0x6ead('0x34')]=_[_0x6ead('0x35')](_0x38b2de[_0x6ead('0x34')]);_0x263e7b[_0x6ead('0x36')]=_[_0x6ead('0x39')](_0x263e7b[_0x6ead('0x37')],_0x263e7b['query']);_0x4ec0f5[_0x6ead('0x38')]=_[_0x6ead('0x39')](_0x263e7b[_0x6ead('0x37')],qs[_0x6ead('0x3a')](_0x38b2de['query']['fields']));_0x4ec0f5[_0x6ead('0x38')]=_0x4ec0f5['attributes'][_0x6ead('0x5a')]?_0x4ec0f5['attributes']:_0x263e7b[_0x6ead('0x37')];_0x4ec0f5['order']=qs['sort'](_0x38b2de[_0x6ead('0x34')][_0x6ead('0x5b')]);_0x4ec0f5['where']=qs[_0x6ead('0x36')](_[_0x6ead('0x5c')](_0x38b2de[_0x6ead('0x34')],_0x263e7b[_0x6ead('0x36')]));if(_0x38b2de['query'][_0x6ead('0x41')]){_0x4ec0f5[_0x6ead('0x3e')]=_[_0x6ead('0x3f')](_0x4ec0f5[_0x6ead('0x3e')],{'$or':_['map'](_0x4ec0f5[_0x6ead('0x38')],function(_0x25e69b){var _0x3f9e92={};_0x3f9e92[_0x25e69b]={'$like':'%'+_0x38b2de[_0x6ead('0x34')][_0x6ead('0x41')]+'%'};return _0x3f9e92;})});}_0x4ec0f5=_[_0x6ead('0x3f')]({},_0x4ec0f5,_0x38b2de[_0x6ead('0x42')]);return _0x3d7ec6['getTeams'](_0x4ec0f5);}})[_0x6ead('0x26')](function(_0x581f7a){if(_0x581f7a){_0x481be9=_0x581f7a[_0x6ead('0x5a')];if(!_0x38b2de[_0x6ead('0x34')][_0x6ead('0x3b')](_0x6ead('0x3c'))){_0x4ec0f5[_0x6ead('0x1f')]=qs[_0x6ead('0x1f')](_0x38b2de['query'][_0x6ead('0x1f')]);_0x4ec0f5['offset']=qs[_0x6ead('0x1d')](_0x38b2de['query']['offset']);}return _0x3d7ec6[_0x6ead('0x67')](_0x4ec0f5);}})[_0x6ead('0x26')](function(_0x5adc41){if(_0x5adc41){return _0x5adc41?{'count':_0x481be9,'rows':_0x5adc41}:null;}})[_0x6ead('0x26')](respondWithResult(_0x378de3,null))[_0x6ead('0x49')](handleError(_0x378de3,null));};exports[_0x6ead('0x69')]=function(_0x57634d,_0x3ba4f2,_0x23be81){var _0x4d94a0=_0x57634d[_0x6ead('0x55')][_0x6ead('0x6a')];return db[_0x6ead('0x68')]['findAll']({'where':{'id':_0x4d94a0},'attributes':['id'],'include':[{'model':db[_0x6ead('0x5e')],'as':_0x6ead('0x6b'),'attributes':['id','name',_0x6ead('0x6c'),'voicePause',_0x6ead('0x6d')],'raw':!![]}]})['then'](function(_0x4a46b1){if(_0x4a46b1){var _0x41f825=_[_0x6ead('0x6e')](_0x4a46b1,function(_0x235d81){var _0x2c52b8=_0x235d81[_0x6ead('0x28')]({'plain':!![]});return _0x2c52b8['Agents'];});return db['FaxQueue'][_0x6ead('0x4b')]({'where':{'id':_0x57634d[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](function(_0x24dc35){return db['sequelize'][_0x6ead('0x6f')](function(_0x1aabdf){return _0x24dc35[_0x6ead('0x69')](_0x4d94a0,{'transaction':_0x1aabdf})[_0x6ead('0x26')](function(){return BPromise[_0x6ead('0x70')](_0x41f825,function(_0x3127c6){return db[_0x6ead('0x59')][_0x6ead('0x71')]({'where':{'UserId':_0x3127c6['id'],'FaxQueueId':_0x57634d[_0x6ead('0x4a')]['id']},'transaction':_0x1aabdf});});})[_0x6ead('0x26')](function(){_0x41f825[_0x6ead('0x72')](function(_0x387da5){socket[_0x6ead('0x73')](_0x6ead('0x74'),{'UserId':_0x387da5['id'],'FaxQueueId':_0x24dc35['id']});});});});});}})[_0x6ead('0x26')](respondWithStatusCode(_0x3ba4f2,null))[_0x6ead('0x49')](handleError(_0x3ba4f2,null));};exports[_0x6ead('0x75')]=function(_0x1dff9f,_0x32baa2,_0xb8e0e){return db[_0x6ead('0x68')][_0x6ead('0x47')]({'where':{'id':_0x1dff9f[_0x6ead('0x34')][_0x6ead('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x6ead('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6ead('0x26')](handleEntityNotFound(_0x32baa2,null))[_0x6ead('0x26')](function(_0x1a3833){var _0x1b656d=_[_0x6ead('0x33')](_0x1a3833,'id');var _0x355a68=[];var _0xafb4c6=[];var _0x3f5877=squel[_0x6ead('0x76')]();_0x3f5877[_0x6ead('0x77')](_0x6ead('0x78'))[_0x6ead('0x79')](_0x6ead('0x7a'),'tq')[_0x6ead('0x7b')](_0x6ead('0x7c'),'ut',_0x6ead('0x7d'))[_0x6ead('0x3e')](_0x6ead('0x7e'),_0x1dff9f['params']['id']);for(var _0x1c4323=0x0;_0x1c4323<_0x1a3833[_0x6ead('0x5a')];_0x1c4323+=0x1){let _0x1c030=_0x1a3833[_0x1c4323];for(var _0x378ec7=0x0;_0x378ec7<_0x1c030[_0x6ead('0x6b')][_0x6ead('0x5a')];_0x378ec7+=0x1){let _0x27a7e4=_0x1c030[_0x6ead('0x6b')][_0x378ec7];var _0x4f2921=_0x3f5877['clone']();_0x4f2921[_0x6ead('0x3e')](_0x6ead('0x7f'),_0x27a7e4['id']);_0xafb4c6['push'](db[_0x6ead('0x80')][_0x6ead('0x34')](_0x4f2921[_0x6ead('0x81')](),{'type':db[_0x6ead('0x80')][_0x6ead('0x82')]['SELECT']})[_0x6ead('0x26')](function(_0x5d02d7){if(_0x5d02d7[_0x6ead('0x5a')]===0x1){return _0x27a7e4['id'];}else{var _0x3cf7b3=_[_0x6ead('0x83')](_[_0x6ead('0x33')](_0x5d02d7,_0x6ead('0x84')),function(_0x17d34d){return _[_0x6ead('0x85')](_0x1b656d,_0x17d34d);});if(_0x3cf7b3){return _0x27a7e4['id'];}}}));}}return BPromise[_0x6ead('0x86')](_0xafb4c6)['then'](function(_0x4a9988){_0x355a68=_(_0x355a68)['union'](_0x4a9988)[_0x6ead('0x87')]()[_0x6ead('0x88')]();return db[_0x6ead('0x43')][_0x6ead('0x4b')]({'where':{'id':_0x1dff9f[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](function(_0x1c87b2){return db['sequelize'][_0x6ead('0x6f')](function(_0x238eb5){return _0x1c87b2['removeTeams'](_0x1dff9f[_0x6ead('0x34')][_0x6ead('0x6a')],{'transaction':_0x238eb5})[_0x6ead('0x26')](function(){if(!_[_0x6ead('0x89')](_0x355a68)){return _0x1c87b2[_0x6ead('0x8a')](_0x355a68,{'transaction':_0x238eb5});}})[_0x6ead('0x26')](function(){_0x355a68[_0x6ead('0x72')](function(_0xfd9ca0){socket[_0x6ead('0x73')](_0x6ead('0x8b'),{'UserId':_0xfd9ca0,'FaxQueueId':_0x1c87b2['id']});});});});});});})[_0x6ead('0x26')](respondWithStatusCode(_0x32baa2,null))[_0x6ead('0x49')](handleError(_0x32baa2,null));};exports['addAgents']=function(_0x533aa0,_0x33047c,_0x4531b2){return db[_0x6ead('0x43')][_0x6ead('0x4b')]({'where':{'id':_0x533aa0[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x33047c,null))[_0x6ead('0x26')](function(_0x915e5e){if(_0x915e5e){return _0x915e5e[_0x6ead('0x8c')](_0x533aa0[_0x6ead('0x55')][_0x6ead('0x6a')],_[_0x6ead('0x8d')](_0x533aa0[_0x6ead('0x55')],['ids','id'])||{})[_0x6ead('0x8e')](function(_0x291b8d){for(var _0x84eb1=0x0;_0x84eb1<_0x533aa0[_0x6ead('0x55')][_0x6ead('0x6a')]['length'];_0x84eb1+=0x1){socket[_0x6ead('0x73')]('userFaxQueue:save',{'UserId':Number(_0x533aa0[_0x6ead('0x55')]['ids'][_0x84eb1]),'FaxQueueId':Number(_0x533aa0[_0x6ead('0x4a')]['id'])});}return _0x291b8d;});}})[_0x6ead('0x26')](respondWithResult(_0x33047c,null))[_0x6ead('0x49')](handleError(_0x33047c,null));};exports[_0x6ead('0x8a')]=function(_0x2e65f8,_0x5abe0c,_0x4883ca){return db[_0x6ead('0x43')][_0x6ead('0x4b')]({'where':{'id':_0x2e65f8['params']['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x5abe0c,null))['then'](function(_0x21ae96){if(_0x21ae96){return _0x21ae96[_0x6ead('0x8a')](_0x2e65f8[_0x6ead('0x34')][_0x6ead('0x6a')])['then'](function(){if(_[_0x6ead('0x8f')](_0x2e65f8[_0x6ead('0x34')][_0x6ead('0x6a')])){for(var _0x281770=0x0;_0x281770<_0x2e65f8[_0x6ead('0x34')]['ids'][_0x6ead('0x5a')];_0x281770+=0x1){socket[_0x6ead('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x2e65f8[_0x6ead('0x34')][_0x6ead('0x6a')][_0x281770]),'FaxQueueId':Number(_0x2e65f8[_0x6ead('0x4a')]['id'])});}}else{socket[_0x6ead('0x73')](_0x6ead('0x8b'),{'UserId':Number(_0x2e65f8[_0x6ead('0x34')][_0x6ead('0x6a')]),'FaxQueueId':Number(_0x2e65f8[_0x6ead('0x4a')]['id'])});}});}})[_0x6ead('0x26')](respondWithStatusCode(_0x5abe0c,null))[_0x6ead('0x49')](handleError(_0x5abe0c,null));};exports[_0x6ead('0x90')]=function(_0x48d758,_0x1b3337,_0x2001f0){var _0x4182ed={};var _0x1851a5={};var _0x442301;var _0x408378;return db[_0x6ead('0x43')][_0x6ead('0x58')]({'where':{'id':_0x48d758[_0x6ead('0x4a')]['id']}})[_0x6ead('0x26')](handleEntityNotFound(_0x1b3337,null))[_0x6ead('0x26')](function(_0x5b6468){if(_0x5b6468){_0x442301=_0x5b6468;_0x1851a5['model']=_[_0x6ead('0x35')](db['User'][_0x6ead('0x30')]);_0x1851a5['query']=_[_0x6ead('0x35')](_0x48d758[_0x6ead('0x34')]);_0x1851a5[_0x6ead('0x36')]=_[_0x6ead('0x39')](_0x1851a5[_0x6ead('0x37')],_0x1851a5[_0x6ead('0x34')]);_0x4182ed[_0x6ead('0x38')]=_[_0x6ead('0x39')](_0x1851a5[_0x6ead('0x37')],qs[_0x6ead('0x3a')](_0x48d758['query'][_0x6ead('0x3a')]));_0x4182ed[_0x6ead('0x38')]=_0x4182ed['attributes'][_0x6ead('0x5a')]?_0x4182ed[_0x6ead('0x38')]:_0x1851a5['model'];_0x4182ed[_0x6ead('0x3d')]=qs[_0x6ead('0x5b')](_0x48d758[_0x6ead('0x34')][_0x6ead('0x5b')]);_0x4182ed['where']=qs[_0x6ead('0x36')](_[_0x6ead('0x5c')](_0x48d758[_0x6ead('0x34')],_0x1851a5[_0x6ead('0x36')]));if(_0x48d758[_0x6ead('0x34')][_0x6ead('0x41')]){_0x4182ed['where']=_[_0x6ead('0x3f')](_0x4182ed['where'],{'$or':_['map'](_0x4182ed[_0x6ead('0x38')],function(_0x14565a){var _0x44425e={};_0x44425e[_0x14565a]={'$like':'%'+_0x48d758['query'][_0x6ead('0x41')]+'%'};return _0x44425e;})});}_0x4182ed=_[_0x6ead('0x3f')]({},_0x4182ed,_0x48d758['options']);return _0x442301[_0x6ead('0x90')](_0x4182ed);}})[_0x6ead('0x26')](function(_0x229045){if(_0x229045){_0x408378=_0x229045['length'];if(!_0x48d758[_0x6ead('0x34')][_0x6ead('0x3b')](_0x6ead('0x3c'))){_0x4182ed[_0x6ead('0x1f')]=qs['limit'](_0x48d758[_0x6ead('0x34')][_0x6ead('0x1f')]);_0x4182ed['offset']=qs[_0x6ead('0x1d')](_0x48d758[_0x6ead('0x34')][_0x6ead('0x1d')]);}return _0x442301[_0x6ead('0x90')](_0x4182ed);}})[_0x6ead('0x26')](function(_0x32cf65){if(_0x32cf65){return _0x32cf65?{'count':_0x408378,'rows':_0x32cf65}:null;}})[_0x6ead('0x26')](respondWithResult(_0x1b3337,null))['catch'](handleError(_0x1b3337,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 5aab5e9..d75650e 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 _0xdba7=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x57a304,_0x5f2ae5){var _0x279baa=function(_0x49dd15){while(--_0x49dd15){_0x57a304['push'](_0x57a304['shift']());}};_0x279baa(++_0x5f2ae5);}(_0xdba7,0x15c));var _0x7dba=function(_0x3bda81,_0x3b8342){_0x3bda81=_0x3bda81-0x0;var _0x3279ca=_0xdba7[_0x3bda81];return _0x3279ca;};'use strict';var EventEmitter=require(_0x7dba('0x0'));var FaxQueue=require(_0x7dba('0x1'))['db'][_0x7dba('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7dba('0x3')](0x0);var events={'afterCreate':_0x7dba('0x4'),'afterUpdate':_0x7dba('0x5'),'afterDestroy':_0x7dba('0x6')};function emitEvent(_0x434b11){return function(_0x5d870c,_0x37c023,_0x53ff11){FaxQueueEvents[_0x7dba('0x7')](_0x434b11+':'+_0x5d870c['id'],_0x5d870c);FaxQueueEvents['emit'](_0x434b11,_0x5d870c);_0x53ff11(null);};}for(var e in events){if(events[_0x7dba('0x8')](e)){var event=events[e];FaxQueue[_0x7dba('0x9')](e,emitEvent(event));}}module[_0x7dba('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x933f=['../../mysqldb','FaxQueue','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4de112,_0x6ab598){var _0x4c57f8=function(_0x27f880){while(--_0x27f880){_0x4de112['push'](_0x4de112['shift']());}};_0x4c57f8(++_0x6ab598);}(_0x933f,0x1bf));var _0xf933=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x933f[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xf933('0x0'));var FaxQueue=require(_0xf933('0x1'))['db'][_0xf933('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf933('0x3')};function emitEvent(_0x4e7f36){return function(_0x1cc601,_0x2ac97b,_0x5bddc2){FaxQueueEvents[_0xf933('0x4')](_0x4e7f36+':'+_0x1cc601['id'],_0x1cc601);FaxQueueEvents[_0xf933('0x4')](_0x4e7f36,_0x1cc601);_0x5bddc2(null);};}for(var e in events){if(events[_0xf933('0x5')](e)){var event=events[e];FaxQueue[_0xf933('0x6')](e,emitEvent(event));}}module[_0xf933('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0c5bac1..46118b1 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 _0x150a=['bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','FaxQueue','lodash','../../config/logger','api'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x150a,0xa7));var _0xa150=function(_0x3fa127,_0x557c3d){_0x3fa127=_0x3fa127-0x0;var _0x4c32d5=_0x150a[_0x3fa127];return _0x4c32d5;};'use strict';var _=require(_0xa150('0x0'));var util=require('util');var logger=require(_0xa150('0x1'))(_0xa150('0x2'));var moment=require('moment');var BPromise=require(_0xa150('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa150('0x4'));var rimraf=require(_0xa150('0x5'));var config=require(_0xa150('0x6'));var attributes=require(_0xa150('0x7'));module[_0xa150('0x8')]=function(_0x4d5cb0,_0x1a576a){return _0x4d5cb0['define'](_0xa150('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f3=['rimraf','./faxQueue.attributes','exports','define','FaxQueue','util','api','bluebird','path'];(function(_0x3cd975,_0x186d4f){var _0x19bb5a=function(_0x107007){while(--_0x107007){_0x3cd975['push'](_0x3cd975['shift']());}};_0x19bb5a(++_0x186d4f);}(_0xe3f3,0x113));var _0x3e3f=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xe3f3[_0x44946b];return _0x249bc4;};'use strict';var _=require('lodash');var util=require(_0x3e3f('0x0'));var logger=require('../../config/logger')(_0x3e3f('0x1'));var moment=require('moment');var BPromise=require(_0x3e3f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e3f('0x3'));var rimraf=require(_0x3e3f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3e3f('0x5'));module[_0x3e3f('0x6')]=function(_0xcb935d,_0x5447e7){return _0xcb935d[_0x3e3f('0x7')](_0x3e3f('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index cb2e947..e8939a9 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 _0xe73c=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetFaxQueue','ShowFaxQueue','util'];(function(_0x4e735d,_0x4280e3){var _0x490df6=function(_0x4de55a){while(--_0x4de55a){_0x4e735d['push'](_0x4e735d['shift']());}};_0x490df6(++_0x4280e3);}(_0xe73c,0x6b));var _0xce73=function(_0x2d4283,_0x26c420){_0x2d4283=_0x2d4283-0x0;var _0x360c58=_0xe73c[_0x2d4283];return _0x360c58;};'use strict';var _=require('lodash');var util=require(_0xce73('0x0'));var moment=require(_0xce73('0x1'));var BPromise=require('bluebird');var rs=require(_0xce73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce73('0x3'));var logger=require(_0xce73('0x4'))(_0xce73('0x5'));var config=require(_0xce73('0x6'));var jayson=require(_0xce73('0x7'));var client=jayson['client'][_0xce73('0x8')]({'port':0x232a});config[_0xce73('0x9')]=_[_0xce73('0xa')](config[_0xce73('0x9')],{'host':_0xce73('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce73('0x9')]));require('./faxQueue.socket')[_0xce73('0xc')](socket);function respondWithRpcPromise(_0x5bee15,_0x42d52b,_0x291d33){return new BPromise(function(_0x2de571,_0x410ec8){return client['request'](_0x5bee15,_0x291d33)[_0xce73('0xd')](function(_0x33ef62){logger[_0xce73('0xe')]('FaxQueue,\x20%s,\x20%s',_0x42d52b,'request\x20sent');logger[_0xce73('0xf')](_0xce73('0x10'),_0x42d52b,_0xce73('0x11'),JSON[_0xce73('0x12')](_0x33ef62));if(_0x33ef62[_0xce73('0x13')]){if(_0x33ef62[_0xce73('0x13')][_0xce73('0x14')]===0x1f4){logger[_0xce73('0x13')](_0xce73('0x15'),_0x42d52b,_0x33ef62[_0xce73('0x13')]['message']);return _0x410ec8(_0x33ef62['error']['message']);}logger[_0xce73('0x13')]('FaxQueue,\x20%s,\x20%s',_0x42d52b,_0x33ef62['error']['message']);return _0x2de571(_0x33ef62['error'][_0xce73('0x16')]);}else{logger[_0xce73('0xe')](_0xce73('0x15'),_0x42d52b,_0xce73('0x11'));_0x2de571(_0x33ef62['result'][_0xce73('0x16')]);}})[_0xce73('0x17')](function(_0x2e4527){logger[_0xce73('0x13')](_0xce73('0x15'),_0x42d52b,_0x2e4527);_0x410ec8(_0x2e4527);});});}exports['GetFaxQueue']=function(_0x2d6fac){var _0x98d221=this;return new Promise(function(_0x943a0c,_0x1b0f93){return db[_0xce73('0x18')][_0xce73('0x19')]({'raw':_0x2d6fac['options']?_0x2d6fac[_0xce73('0x1a')][_0xce73('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d6fac['options']?_0x2d6fac['options'][_0xce73('0x1c')]||null:null,'attributes':_0x2d6fac[_0xce73('0x1a')]?_0x2d6fac[_0xce73('0x1a')][_0xce73('0x1d')]||null:null,'limit':_0x2d6fac[_0xce73('0x1a')]?_0x2d6fac['options'][_0xce73('0x1e')]||null:null,'include':_0x2d6fac['options']?_0x2d6fac[_0xce73('0x1a')]['include']?_[_0xce73('0x1f')](_0x2d6fac[_0xce73('0x1a')][_0xce73('0x20')],function(_0x22365c){return{'model':db[_0x22365c[_0xce73('0x21')]],'as':_0x22365c['as'],'attributes':_0x22365c[_0xce73('0x1d')],'include':_0x22365c[_0xce73('0x20')]?_[_0xce73('0x1f')](_0x22365c[_0xce73('0x20')],function(_0x330353){return{'model':db[_0x330353[_0xce73('0x21')]],'as':_0x330353['as'],'attributes':_0x330353['attributes'],'include':_0x330353['include']?_[_0xce73('0x1f')](_0x330353[_0xce73('0x20')],function(_0x129d54){return{'model':db[_0x129d54[_0xce73('0x21')]],'as':_0x129d54['as'],'attributes':_0x129d54[_0xce73('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xce73('0xd')](function(_0xfae43a){logger[_0xce73('0xe')](_0xce73('0x22'),_0x2d6fac);logger['debug'](_0xce73('0x22'),_0x2d6fac,JSON[_0xce73('0x12')](_0xfae43a));_0x943a0c(_0xfae43a);})[_0xce73('0x17')](function(_0xedde1d){logger[_0xce73('0x13')](_0xce73('0x22'),_0xedde1d['message'],_0x2d6fac);_0x1b0f93(_0x98d221['error'](0x1f4,_0xedde1d[_0xce73('0x16')]));});});};exports[_0xce73('0x23')]=function(_0x78edff){var _0x1ecaf1=this;return new Promise(function(_0x3384f9,_0x3fb1f9){return db[_0xce73('0x18')]['find']({'raw':_0x78edff['options']?_0x78edff[_0xce73('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x78edff[_0xce73('0x1a')]?_0x78edff[_0xce73('0x1a')][_0xce73('0x1c')]||null:null,'attributes':_0x78edff[_0xce73('0x1a')]?_0x78edff['options'][_0xce73('0x1d')]||null:null,'include':_0x78edff[_0xce73('0x1a')]?_0x78edff[_0xce73('0x1a')][_0xce73('0x20')]?_['map'](_0x78edff[_0xce73('0x1a')][_0xce73('0x20')],function(_0x1d1aef){return{'model':db[_0x1d1aef[_0xce73('0x21')]],'as':_0x1d1aef['as'],'attributes':_0x1d1aef['attributes'],'include':_0x1d1aef[_0xce73('0x20')]?_[_0xce73('0x1f')](_0x1d1aef[_0xce73('0x20')],function(_0x53af50){return{'model':db[_0x53af50['model']],'as':_0x53af50['as'],'attributes':_0x53af50[_0xce73('0x1d')],'include':_0x53af50['include']?_[_0xce73('0x1f')](_0x53af50['include'],function(_0x4365df){return{'model':db[_0x4365df[_0xce73('0x21')]],'as':_0x4365df['as'],'attributes':_0x4365df[_0xce73('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xce73('0xd')](function(_0x3033f0){logger[_0xce73('0xe')]('ShowFaxQueue',_0x78edff);logger[_0xce73('0xf')](_0xce73('0x23'),_0x78edff,JSON['stringify'](_0x3033f0));_0x3384f9(_0x3033f0);})[_0xce73('0x17')](function(_0xdcde54){logger[_0xce73('0x13')]('ShowFaxQueue',_0xdcde54[_0xce73('0x16')],_0x78edff);_0x3fb1f9(_0x1ecaf1[_0xce73('0x13')](0x1f4,_0xdcde54[_0xce73('0x16')]));});});}; \ No newline at end of file +var _0xdfd7=['message','FaxQueue,\x20%s,\x20%s','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','ShowFaxQueue','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxQueue.socket','register','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x112f2d,_0x12c41e){var _0x2e357e=function(_0x51bcd0){while(--_0x51bcd0){_0x112f2d['push'](_0x112f2d['shift']());}};_0x2e357e(++_0x12c41e);}(_0xdfd7,0x172));var _0x7dfd=function(_0x2444a9,_0xc0b42c){_0x2444a9=_0x2444a9-0x0;var _0x14d793=_0xdfd7[_0x2444a9];return _0x14d793;};'use strict';var _=require(_0x7dfd('0x0'));var util=require(_0x7dfd('0x1'));var moment=require('moment');var BPromise=require(_0x7dfd('0x2'));var rs=require(_0x7dfd('0x3'));var fs=require('fs');var Redis=require(_0x7dfd('0x4'));var db=require(_0x7dfd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7dfd('0x6'))('rpc');var config=require(_0x7dfd('0x7'));var jayson=require(_0x7dfd('0x8'));var client=jayson['client'][_0x7dfd('0x9')]({'port':0x232a});config[_0x7dfd('0xa')]=_[_0x7dfd('0xb')](config[_0x7dfd('0xa')],{'host':_0x7dfd('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dfd('0xa')]));require(_0x7dfd('0xd'))[_0x7dfd('0xe')](socket);function respondWithRpcPromise(_0x2735a8,_0x3531fb,_0x3c3248){return new BPromise(function(_0x342781,_0x52c18f){return client['request'](_0x2735a8,_0x3c3248)['then'](function(_0x161091){logger['info']('FaxQueue,\x20%s,\x20%s',_0x3531fb,'request\x20sent');logger['debug'](_0x7dfd('0xf'),_0x3531fb,_0x7dfd('0x10'),JSON[_0x7dfd('0x11')](_0x161091));if(_0x161091['error']){if(_0x161091[_0x7dfd('0x12')][_0x7dfd('0x13')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3531fb,_0x161091[_0x7dfd('0x12')][_0x7dfd('0x14')]);return _0x52c18f(_0x161091[_0x7dfd('0x12')][_0x7dfd('0x14')]);}logger['error'](_0x7dfd('0x15'),_0x3531fb,_0x161091['error'][_0x7dfd('0x14')]);return _0x342781(_0x161091[_0x7dfd('0x12')][_0x7dfd('0x14')]);}else{logger[_0x7dfd('0x16')](_0x7dfd('0x15'),_0x3531fb,_0x7dfd('0x10'));_0x342781(_0x161091[_0x7dfd('0x17')][_0x7dfd('0x14')]);}})['catch'](function(_0x2ed04c){logger[_0x7dfd('0x12')](_0x7dfd('0x15'),_0x3531fb,_0x2ed04c);_0x52c18f(_0x2ed04c);});});}exports[_0x7dfd('0x18')]=function(_0x29d6d4){var _0x176dae=this;return new Promise(function(_0x23c646,_0x5311f7){return db[_0x7dfd('0x19')][_0x7dfd('0x1a')]({'raw':_0x29d6d4['options']?_0x29d6d4[_0x7dfd('0x1b')][_0x7dfd('0x1c')]===undefined?!![]:![]:!![],'where':_0x29d6d4[_0x7dfd('0x1b')]?_0x29d6d4[_0x7dfd('0x1b')][_0x7dfd('0x1d')]||null:null,'attributes':_0x29d6d4['options']?_0x29d6d4[_0x7dfd('0x1b')]['attributes']||null:null,'limit':_0x29d6d4['options']?_0x29d6d4[_0x7dfd('0x1b')][_0x7dfd('0x1e')]||null:null,'include':_0x29d6d4['options']?_0x29d6d4[_0x7dfd('0x1b')][_0x7dfd('0x1f')]?_[_0x7dfd('0x20')](_0x29d6d4[_0x7dfd('0x1b')][_0x7dfd('0x1f')],function(_0x334bd8){return{'model':db[_0x334bd8['model']],'as':_0x334bd8['as'],'attributes':_0x334bd8[_0x7dfd('0x21')],'include':_0x334bd8[_0x7dfd('0x1f')]?_['map'](_0x334bd8['include'],function(_0xdfb127){return{'model':db[_0xdfb127['model']],'as':_0xdfb127['as'],'attributes':_0xdfb127[_0x7dfd('0x21')],'include':_0xdfb127[_0x7dfd('0x1f')]?_[_0x7dfd('0x20')](_0xdfb127[_0x7dfd('0x1f')],function(_0x595126){return{'model':db[_0x595126[_0x7dfd('0x22')]],'as':_0x595126['as'],'attributes':_0x595126[_0x7dfd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7dfd('0x23')](function(_0xd1c60c){logger[_0x7dfd('0x16')](_0x7dfd('0x18'),_0x29d6d4);logger['debug'](_0x7dfd('0x18'),_0x29d6d4,JSON[_0x7dfd('0x11')](_0xd1c60c));_0x23c646(_0xd1c60c);})['catch'](function(_0x1a52b7){logger[_0x7dfd('0x12')](_0x7dfd('0x18'),_0x1a52b7[_0x7dfd('0x14')],_0x29d6d4);_0x5311f7(_0x176dae['error'](0x1f4,_0x1a52b7[_0x7dfd('0x14')]));});});};exports[_0x7dfd('0x24')]=function(_0xe34f7d){var _0x203f30=this;return new Promise(function(_0x3c7f60,_0x42d372){return db[_0x7dfd('0x19')]['find']({'raw':_0xe34f7d[_0x7dfd('0x1b')]?_0xe34f7d[_0x7dfd('0x1b')][_0x7dfd('0x1c')]===undefined?!![]:![]:!![],'where':_0xe34f7d[_0x7dfd('0x1b')]?_0xe34f7d[_0x7dfd('0x1b')][_0x7dfd('0x1d')]||null:null,'attributes':_0xe34f7d['options']?_0xe34f7d[_0x7dfd('0x1b')][_0x7dfd('0x21')]||null:null,'include':_0xe34f7d[_0x7dfd('0x1b')]?_0xe34f7d['options'][_0x7dfd('0x1f')]?_[_0x7dfd('0x20')](_0xe34f7d[_0x7dfd('0x1b')][_0x7dfd('0x1f')],function(_0x5b9ecd){return{'model':db[_0x5b9ecd[_0x7dfd('0x22')]],'as':_0x5b9ecd['as'],'attributes':_0x5b9ecd[_0x7dfd('0x21')],'include':_0x5b9ecd[_0x7dfd('0x1f')]?_['map'](_0x5b9ecd[_0x7dfd('0x1f')],function(_0x44c552){return{'model':db[_0x44c552[_0x7dfd('0x22')]],'as':_0x44c552['as'],'attributes':_0x44c552[_0x7dfd('0x21')],'include':_0x44c552['include']?_[_0x7dfd('0x20')](_0x44c552[_0x7dfd('0x1f')],function(_0x5f0add){return{'model':db[_0x5f0add['model']],'as':_0x5f0add['as'],'attributes':_0x5f0add[_0x7dfd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7dfd('0x23')](function(_0x550173){logger[_0x7dfd('0x16')](_0x7dfd('0x24'),_0xe34f7d);logger[_0x7dfd('0x25')]('ShowFaxQueue',_0xe34f7d,JSON['stringify'](_0x550173));_0x3c7f60(_0x550173);})[_0x7dfd('0x26')](function(_0x149c17){logger[_0x7dfd('0x12')](_0x7dfd('0x24'),_0x149c17[_0x7dfd('0x14')],_0xe34f7d);_0x42d372(_0x203f30['error'](0x1f4,_0x149c17[_0x7dfd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b748d2f..8ba8608 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 _0x19d1=['./faxQueue.events','save','update','emit','removeListener','register','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x19d1,0x16c));var _0x119d=function(_0x55c9ae,_0x26ed52){_0x55c9ae=_0x55c9ae-0x0;var _0x6f0b40=_0x19d1[_0x55c9ae];return _0x6f0b40;};'use strict';var FaxQueueEvents=require(_0x119d('0x0'));var events=[_0x119d('0x1'),'remove',_0x119d('0x2')];function createListener(_0x19a473,_0x73c25e){return function(_0x5a79d3){_0x73c25e[_0x119d('0x3')](_0x19a473,_0x5a79d3);};}function removeListener(_0x4dd235,_0x4239d3){return function(){FaxQueueEvents[_0x119d('0x4')](_0x4dd235,_0x4239d3);};}exports[_0x119d('0x5')]=function(_0x3db3d9){for(var _0x1a58d5=0x0,_0x10a169=events[_0x119d('0x6')];_0x1a58d5<_0x10a169;_0x1a58d5++){var _0x48958d=events[_0x1a58d5];var _0x412932=createListener('faxQueue:'+_0x48958d,_0x3db3d9);FaxQueueEvents['on'](_0x48958d,_0x412932);}}; \ No newline at end of file +var _0xb218=['remove','update','emit','removeListener','register','faxQueue:','save'];(function(_0x2b27be,_0x2bb74d){var _0x1eef8d=function(_0x627e60){while(--_0x627e60){_0x2b27be['push'](_0x2b27be['shift']());}};_0x1eef8d(++_0x2bb74d);}(_0xb218,0x1bf));var _0x8b21=function(_0x9867c1,_0x158928){_0x9867c1=_0x9867c1-0x0;var _0x3d72e2=_0xb218[_0x9867c1];return _0x3d72e2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x8b21('0x0'),_0x8b21('0x1'),_0x8b21('0x2')];function createListener(_0x560aef,_0x3f765e){return function(_0x34851e){_0x3f765e[_0x8b21('0x3')](_0x560aef,_0x34851e);};}function removeListener(_0x3c0b41,_0x39bca2){return function(){FaxQueueEvents[_0x8b21('0x4')](_0x3c0b41,_0x39bca2);};}exports[_0x8b21('0x5')]=function(_0x3bfde1){for(var _0x5dc769=0x0,_0x5d4c99=events['length'];_0x5dc769<_0x5d4c99;_0x5dc769++){var _0x13f42f=events[_0x5dc769];var _0x2b630c=createListener(_0x8b21('0x6')+_0x13f42f,_0x3bfde1);FaxQueueEvents['on'](_0x13f42f,_0x2b630c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f5c335b..379e182 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 _0xbff5=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/users','getAgents','create','/:id/teams','addAgents','update','destroy','removeTeams'];(function(_0x247953,_0x2853a1){var _0x316c38=function(_0x7fc4f3){while(--_0x7fc4f3){_0x247953['push'](_0x247953['shift']());}};_0x316c38(++_0x2853a1);}(_0xbff5,0x1bc));var _0x5bff=function(_0x5779f3,_0x484f8b){_0x5779f3=_0x5779f3-0x0;var _0xa00107=_0xbff5[_0x5779f3];return _0xa00107;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['get'](_0x5bff('0xf'),auth[_0x5bff('0x9')](),controller['getMembers']);router[_0x5bff('0x8')]('/:id/teams',auth[_0x5bff('0x9')](),controller['getTeams']);router[_0x5bff('0x8')](_0x5bff('0x10'),auth['isAuthenticated'](),controller[_0x5bff('0x11')]);router['post']('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0x12')]);router['post'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller['addTeams']);router['post'](_0x5bff('0x10'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x14')]);router['put'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x15')]);router['delete'](_0x5bff('0xd'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x16')]);router['delete'](_0x5bff('0x13'),auth[_0x5bff('0x9')](),controller[_0x5bff('0x17')]);router[_0x5bff('0x18')]('/:id/users',auth[_0x5bff('0x9')](),controller['removeAgents']);module[_0x5bff('0x19')]=router; \ No newline at end of file +var _0xaf1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x4b6dd8,_0x5d188e){var _0x46b535=function(_0x56d8c9){while(--_0x56d8c9){_0x4b6dd8['push'](_0x4b6dd8['shift']());}};_0x46b535(++_0x5d188e);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x33358d,_0x4cbad9){_0x33358d=_0x33358d-0x0;var _0xaab2ac=_0xaf1b[_0x33358d];return _0xaab2ac;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMembers']);router[_0xbaf1('0xb')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0xb')](_0xbaf1('0x14'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x17')](_0xbaf1('0x18'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x19')]);router[_0xbaf1('0x17')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1a')]);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1c')]);router[_0xbaf1('0x1d')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller['destroy']);router[_0xbaf1('0x1d')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1e')]);router[_0xbaf1('0x1d')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 856ba4d..ace6592 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 _0xa5cd=['STRING','DATE','moment','sequelize','exports'];(function(_0x567d68,_0x495209){var _0x282ccc=function(_0x47b6d1){while(--_0x47b6d1){_0x567d68['push'](_0x567d68['shift']());}};_0x282ccc(++_0x495209);}(_0xa5cd,0x151));var _0xda5c=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xa5cd[_0x1a36a5];return _0x746243;};'use strict';var moment=require(_0xda5c('0x0'));var Sequelize=require(_0xda5c('0x1'));module[_0xda5c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xda5c('0x3')]},'joinAt':{'type':Sequelize[_0xda5c('0x4')]},'leaveAt':{'type':Sequelize[_0xda5c('0x4')]},'acceptAt':{'type':Sequelize[_0xda5c('0x4')]},'exitAt':{'type':Sequelize[_0xda5c('0x4')]},'reason':{'type':Sequelize[_0xda5c('0x3')]}}; \ No newline at end of file +var _0xe9bb=['exports','STRING','DATE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe9bb,0x15f));var _0xbe9b=function(_0x29802a,_0x2d2a54){_0x29802a=_0x29802a-0x0;var _0x11eb27=_0xe9bb[_0x29802a];return _0x11eb27;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xbe9b('0x0')]={'uniqueid':{'type':Sequelize[_0xbe9b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xbe9b('0x1')]},'joinAt':{'type':Sequelize[_0xbe9b('0x2')]},'leaveAt':{'type':Sequelize[_0xbe9b('0x2')]},'acceptAt':{'type':Sequelize[_0xbe9b('0x2')]},'exitAt':{'type':Sequelize[_0xbe9b('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7d5aab5..db47e29 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 _0x04b8=['undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FaxQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x1d690d,_0x358525){var _0x42844e=function(_0x4da501){while(--_0x4da501){_0x1d690d['push'](_0x1d690d['shift']());}};_0x42844e(++_0x358525);}(_0x04b8,0x159));var _0x804b=function(_0x35a5d2,_0x26dd88){_0x35a5d2=_0x35a5d2-0x0;var _0x109435=_0x04b8[_0x35a5d2];return _0x109435;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de812,_0x7d9c33){return function(_0x4e7266){if(!_0x4e7266){_0x2de812[_0x804b('0x18')](0x194);}return _0x4e7266;};}function handleError(_0x2366b6,_0x1117a5){_0x1117a5=_0x1117a5||0x1f4;return function(_0x27d5ec){logger[_0x804b('0x26')](_0x27d5ec['stack']);if(_0x27d5ec[_0x804b('0x27')]){delete _0x27d5ec[_0x804b('0x27')];}_0x2366b6[_0x804b('0x19')](_0x1117a5)[_0x804b('0x28')](_0x27d5ec);};}exports[_0x804b('0x29')]=function(_0x4a6079,_0x3eb531){var _0x2931ff={},_0x410871={},_0x5c7026={'count':0x0,'rows':[]};var _0x3dbd41=_[_0x804b('0x2a')](db[_0x804b('0x2b')]['rawAttributes'],function(_0x408857){return{'name':_0x408857[_0x804b('0x2c')],'type':_0x408857['type'][_0x804b('0x2d')]};});_0x410871[_0x804b('0x2e')]=_[_0x804b('0x2a')](_0x3dbd41,_0x804b('0x27'));_0x410871[_0x804b('0x2f')]=_[_0x804b('0x30')](_0x4a6079['query']);_0x410871[_0x804b('0x31')]=_[_0x804b('0x32')](_0x410871[_0x804b('0x2e')],_0x410871[_0x804b('0x2f')]);_0x2931ff[_0x804b('0x33')]=_[_0x804b('0x32')](_0x410871[_0x804b('0x2e')],qs[_0x804b('0x34')](_0x4a6079[_0x804b('0x2f')][_0x804b('0x34')]));_0x2931ff[_0x804b('0x33')]=_0x2931ff[_0x804b('0x33')][_0x804b('0x35')]?_0x2931ff[_0x804b('0x33')]:_0x410871[_0x804b('0x2e')];if(!_0x4a6079[_0x804b('0x2f')][_0x804b('0x36')](_0x804b('0x37'))){_0x2931ff[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x4a6079[_0x804b('0x2f')][_0x804b('0x1d')]);_0x2931ff[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x4a6079[_0x804b('0x2f')]['offset']);}_0x2931ff['order']=qs['sort'](_0x4a6079[_0x804b('0x2f')][_0x804b('0x38')]);_0x2931ff[_0x804b('0x39')]=qs['filters'](_['pick'](_0x4a6079['query'],_0x410871[_0x804b('0x31')]),_0x3dbd41);if(_0x4a6079[_0x804b('0x2f')][_0x804b('0x3a')]){_0x2931ff[_0x804b('0x39')]=_[_0x804b('0x3b')](_0x2931ff[_0x804b('0x39')],{'$or':_[_0x804b('0x2a')](_0x3dbd41,function(_0xc5eefa){if(_0xc5eefa[_0x804b('0x3c')]!==_0x804b('0x3d')){var _0x878dac={};_0x878dac[_0xc5eefa[_0x804b('0x27')]]={'$like':'%'+_0x4a6079[_0x804b('0x2f')]['filter']+'%'};return _0x878dac;}})});}_0x2931ff=_[_0x804b('0x3b')]({},_0x2931ff,_0x4a6079[_0x804b('0x3e')]);var _0xb877d6={'where':_0x2931ff[_0x804b('0x39')]};return db[_0x804b('0x2b')]['count'](_0xb877d6)['then'](function(_0x203890){_0x5c7026[_0x804b('0x1f')]=_0x203890;if(_0x4a6079[_0x804b('0x2f')]['includeAll']){_0x2931ff[_0x804b('0x3f')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x804b('0x40')](_0x2931ff);})[_0x804b('0x24')](function(_0x20ccc7){_0x5c7026[_0x804b('0x41')]=_0x20ccc7;return _0x5c7026;})[_0x804b('0x24')](respondWithFilteredResult(_0x3eb531,_0x2931ff))[_0x804b('0x42')](handleError(_0x3eb531,null));};exports[_0x804b('0x43')]=function(_0x51c8ff,_0x17972a){var _0x1c0363={'raw':!![],'where':{'id':_0x51c8ff[_0x804b('0x44')]['id']}},_0x1dcec8={};_0x1dcec8['model']=_[_0x804b('0x30')](db[_0x804b('0x2b')][_0x804b('0x45')]);_0x1dcec8[_0x804b('0x2f')]=_[_0x804b('0x30')](_0x51c8ff[_0x804b('0x2f')]);_0x1dcec8[_0x804b('0x31')]=_[_0x804b('0x32')](_0x1dcec8['model'],_0x1dcec8[_0x804b('0x2f')]);_0x1c0363['attributes']=_['intersection'](_0x1dcec8['model'],qs[_0x804b('0x34')](_0x51c8ff['query'][_0x804b('0x34')]));_0x1c0363[_0x804b('0x33')]=_0x1c0363[_0x804b('0x33')][_0x804b('0x35')]?_0x1c0363['attributes']:_0x1dcec8[_0x804b('0x2e')];if(_0x51c8ff[_0x804b('0x2f')][_0x804b('0x46')]){_0x1c0363['include']=[{'all':!![]}];}_0x1c0363=_[_0x804b('0x3b')]({},_0x1c0363,_0x51c8ff[_0x804b('0x3e')]);return db[_0x804b('0x2b')]['find'](_0x1c0363)[_0x804b('0x24')](handleEntityNotFound(_0x17972a,null))[_0x804b('0x24')](respondWithResult(_0x17972a,null))[_0x804b('0x42')](handleError(_0x17972a,null));};exports[_0x804b('0x47')]=function(_0x1051e9,_0x3a39f5){return db[_0x804b('0x2b')][_0x804b('0x47')](_0x1051e9[_0x804b('0x48')],{})[_0x804b('0x24')](respondWithResult(_0x3a39f5,0xc9))[_0x804b('0x42')](handleError(_0x3a39f5,null));};exports[_0x804b('0x49')]=function(_0x20862f,_0x2c1796){if(_0x20862f['body']['id']){delete _0x20862f['body']['id'];}return db[_0x804b('0x2b')][_0x804b('0x4a')]({'where':{'id':_0x20862f[_0x804b('0x44')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2c1796,null))[_0x804b('0x24')](saveUpdates(_0x20862f['body'],null))[_0x804b('0x24')](respondWithResult(_0x2c1796,null))[_0x804b('0x42')](handleError(_0x2c1796,null));};exports[_0x804b('0x25')]=function(_0x3ca9ff,_0x47247c){return db[_0x804b('0x2b')]['find']({'where':{'id':_0x3ca9ff['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x47247c,null))[_0x804b('0x24')](removeEntity(_0x47247c,null))['catch'](handleError(_0x47247c,null));};exports['describe']=function(_0x2fa47d,_0x3d56bb){return db[_0x804b('0x2b')]['describe']()[_0x804b('0x24')](respondWithResult(_0x3d56bb,null))[_0x804b('0x42')](handleError(_0x3d56bb,null));}; \ No newline at end of file +var _0xbe45=['pick','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x578a3c,_0x287693){var _0x31fd56=function(_0x5bb5eb){while(--_0x5bb5eb){_0x578a3c['push'](_0x578a3c['shift']());}};_0x31fd56(++_0x287693);}(_0xbe45,0xf0));var _0x5be4=function(_0xd82de6,_0x3155f2){_0xd82de6=_0xd82de6-0x0;var _0x5c004f=_0xbe45[_0xd82de6];return _0x5c004f;};'use strict';var emlformat=require(_0x5be4('0x0'));var rimraf=require(_0x5be4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be4('0x2'));var rp=require(_0x5be4('0x3'));var moment=require(_0x5be4('0x4'));var BPromise=require(_0x5be4('0x5'));var Mustache=require(_0x5be4('0x6'));var util=require(_0x5be4('0x7'));var path=require('path');var sox=require(_0x5be4('0x8'));var csv=require(_0x5be4('0x9'));var ejs=require(_0x5be4('0xa'));var fs=require('fs');var fs_extra=require(_0x5be4('0xb'));var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0x9'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5be4('0x18'))['db'];function respondWithStatusCode(_0x43a60f,_0x1d7960){_0x1d7960=_0x1d7960||0xcc;return function(_0x5c6615){if(_0x5c6615){return _0x43a60f[_0x5be4('0x19')](_0x1d7960);}return _0x43a60f['status'](_0x1d7960)[_0x5be4('0x1a')]();};}function respondWithResult(_0x2afee8,_0x2dd93e){_0x2dd93e=_0x2dd93e||0xc8;return function(_0x335842){if(_0x335842){return _0x2afee8[_0x5be4('0x1b')](_0x2dd93e)[_0x5be4('0x1c')](_0x335842);}};}function respondWithFilteredResult(_0x3980fc,_0x5ebe65){return function(_0x3e830e){if(_0x3e830e){var _0x8466a7=typeof _0x5ebe65[_0x5be4('0x1d')]===_0x5be4('0x1e')&&typeof _0x5ebe65[_0x5be4('0x1f')]===_0x5be4('0x1e');var _0x94f434=_0x3e830e[_0x5be4('0x20')];var _0x51662a=_0x8466a7?0x0:_0x5ebe65[_0x5be4('0x1d')];var _0x50b970=_0x8466a7?_0x3e830e['count']:_0x5ebe65[_0x5be4('0x1d')]+_0x5ebe65[_0x5be4('0x1f')];var _0x4cce93;if(_0x50b970>=_0x94f434){_0x50b970=_0x94f434;_0x4cce93=0xc8;}else{_0x4cce93=0xce;}_0x3980fc[_0x5be4('0x1b')](_0x4cce93);return _0x3980fc[_0x5be4('0x21')]('Content-Range',_0x51662a+'-'+_0x50b970+'/'+_0x94f434)['json'](_0x3e830e);}return null;};}function patchUpdates(_0x2690be){return function(_0x207948){try{jsonpatch['apply'](_0x207948,_0x2690be,!![]);}catch(_0x553f59){return BPromise[_0x5be4('0x22')](_0x553f59);}return _0x207948[_0x5be4('0x23')]();};}function saveUpdates(_0x2843e3,_0x3ccd67){return function(_0xa20552){if(_0xa20552){return _0xa20552['update'](_0x2843e3)[_0x5be4('0x24')](function(_0x51d7a7){return _0x51d7a7;});}return null;};}function removeEntity(_0x242005,_0x12b9cd){return function(_0x4d6eff){if(_0x4d6eff){return _0x4d6eff[_0x5be4('0x25')]()[_0x5be4('0x24')](function(){_0x242005['status'](0xcc)[_0x5be4('0x1a')]();});}};}function handleEntityNotFound(_0x2b2e2c,_0x353a65){return function(_0x39cf54){if(!_0x39cf54){_0x2b2e2c[_0x5be4('0x19')](0x194);}return _0x39cf54;};}function handleError(_0x13779f,_0x112728){_0x112728=_0x112728||0x1f4;return function(_0x5b49ea){logger['error'](_0x5b49ea[_0x5be4('0x26')]);if(_0x5b49ea[_0x5be4('0x27')]){delete _0x5b49ea[_0x5be4('0x27')];}_0x13779f['status'](_0x112728)[_0x5be4('0x28')](_0x5b49ea);};}exports[_0x5be4('0x29')]=function(_0x3bd842,_0x412ef6){var _0x16f3bf={},_0x1e0485={},_0x4b9029={'count':0x0,'rows':[]};var _0x1661c2=_[_0x5be4('0x2a')](db['FaxQueueReport'][_0x5be4('0x2b')],function(_0x49780a){return{'name':_0x49780a[_0x5be4('0x2c')],'type':_0x49780a[_0x5be4('0x2d')]['key']};});_0x1e0485[_0x5be4('0x2e')]=_['map'](_0x1661c2,'name');_0x1e0485[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x3bd842[_0x5be4('0x2f')]);_0x1e0485[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],_0x1e0485[_0x5be4('0x2f')]);_0x16f3bf[_0x5be4('0x33')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],qs[_0x5be4('0x34')](_0x3bd842[_0x5be4('0x2f')]['fields']));_0x16f3bf['attributes']=_0x16f3bf[_0x5be4('0x33')][_0x5be4('0x35')]?_0x16f3bf[_0x5be4('0x33')]:_0x1e0485[_0x5be4('0x2e')];if(!_0x3bd842['query'][_0x5be4('0x36')]('nolimit')){_0x16f3bf[_0x5be4('0x1f')]=qs['limit'](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x1f')]);_0x16f3bf['offset']=qs['offset'](_0x3bd842[_0x5be4('0x2f')]['offset']);}_0x16f3bf['order']=qs[_0x5be4('0x37')](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x37')]);_0x16f3bf['where']=qs[_0x5be4('0x31')](_[_0x5be4('0x38')](_0x3bd842['query'],_0x1e0485[_0x5be4('0x31')]),_0x1661c2);if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x39')]){_0x16f3bf[_0x5be4('0x3a')]=_['merge'](_0x16f3bf[_0x5be4('0x3a')],{'$or':_[_0x5be4('0x2a')](_0x1661c2,function(_0x178500){if(_0x178500[_0x5be4('0x2d')]!==_0x5be4('0x3b')){var _0x3ddba4={};_0x3ddba4[_0x178500[_0x5be4('0x27')]]={'$like':'%'+_0x3bd842[_0x5be4('0x2f')]['filter']+'%'};return _0x3ddba4;}})});}_0x16f3bf=_[_0x5be4('0x3c')]({},_0x16f3bf,_0x3bd842[_0x5be4('0x3d')]);var _0x348c30={'where':_0x16f3bf[_0x5be4('0x3a')]};return db[_0x5be4('0x3e')]['count'](_0x348c30)[_0x5be4('0x24')](function(_0x344411){_0x4b9029['count']=_0x344411;if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x3f')]){_0x16f3bf['include']=[{'all':!![]}];}return db[_0x5be4('0x3e')][_0x5be4('0x40')](_0x16f3bf);})[_0x5be4('0x24')](function(_0x1d480c){_0x4b9029[_0x5be4('0x41')]=_0x1d480c;return _0x4b9029;})[_0x5be4('0x24')](respondWithFilteredResult(_0x412ef6,_0x16f3bf))[_0x5be4('0x42')](handleError(_0x412ef6,null));};exports[_0x5be4('0x43')]=function(_0x2313d6,_0x53974f){var _0x1add45={'raw':!![],'where':{'id':_0x2313d6[_0x5be4('0x44')]['id']}},_0x536473={};_0x536473[_0x5be4('0x2e')]=_['keys'](db[_0x5be4('0x3e')]['rawAttributes']);_0x536473['query']=_[_0x5be4('0x30')](_0x2313d6[_0x5be4('0x2f')]);_0x536473[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x536473[_0x5be4('0x2e')],_0x536473[_0x5be4('0x2f')]);_0x1add45[_0x5be4('0x33')]=_['intersection'](_0x536473[_0x5be4('0x2e')],qs['fields'](_0x2313d6[_0x5be4('0x2f')]['fields']));_0x1add45[_0x5be4('0x33')]=_0x1add45[_0x5be4('0x33')]['length']?_0x1add45[_0x5be4('0x33')]:_0x536473[_0x5be4('0x2e')];if(_0x2313d6[_0x5be4('0x2f')]['includeAll']){_0x1add45[_0x5be4('0x45')]=[{'all':!![]}];}_0x1add45=_[_0x5be4('0x3c')]({},_0x1add45,_0x2313d6['options']);return db[_0x5be4('0x3e')]['find'](_0x1add45)['then'](handleEntityNotFound(_0x53974f,null))[_0x5be4('0x24')](respondWithResult(_0x53974f,null))[_0x5be4('0x42')](handleError(_0x53974f,null));};exports['create']=function(_0x47734f,_0x57f25d){return db['FaxQueueReport'][_0x5be4('0x46')](_0x47734f[_0x5be4('0x47')],{})[_0x5be4('0x24')](respondWithResult(_0x57f25d,0xc9))['catch'](handleError(_0x57f25d,null));};exports['update']=function(_0x378ae7,_0x2fb7cd){if(_0x378ae7[_0x5be4('0x47')]['id']){delete _0x378ae7[_0x5be4('0x47')]['id'];}return db['FaxQueueReport'][_0x5be4('0x48')]({'where':{'id':_0x378ae7[_0x5be4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fb7cd,null))[_0x5be4('0x24')](saveUpdates(_0x378ae7[_0x5be4('0x47')],null))[_0x5be4('0x24')](respondWithResult(_0x2fb7cd,null))['catch'](handleError(_0x2fb7cd,null));};exports[_0x5be4('0x25')]=function(_0x3481c9,_0xc9ca2f){return db[_0x5be4('0x3e')][_0x5be4('0x48')]({'where':{'id':_0x3481c9[_0x5be4('0x44')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0xc9ca2f,null))[_0x5be4('0x24')](removeEntity(_0xc9ca2f,null))[_0x5be4('0x42')](handleError(_0xc9ca2f,null));};exports[_0x5be4('0x49')]=function(_0x5f0999,_0x2caec3){return db['FaxQueueReport'][_0x5be4('0x49')]()[_0x5be4('0x24')](respondWithResult(_0x2caec3,null))[_0x5be4('0x42')](handleError(_0x2caec3,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index ecf31d0..8fbd82a 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x3267ed,_0x3dd58b){var _0x32b1dd=function(_0x21165d){while(--_0x21165d){_0x3267ed['push'](_0x3267ed['shift']());}};_0x32b1dd(++_0x3dd58b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x50fb34,_0x56b847){_0x50fb34=_0x50fb34-0x0;var _0x478797=_0x7fbe[_0x50fb34];return _0x478797;};'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'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x4d02a7,_0x5aba13){var _0x151469=function(_0xca6f87){while(--_0xca6f87){_0x4d02a7['push'](_0x4d02a7['shift']());}};_0x151469(++_0x5aba13);}(_0x0295,0x1f0));var _0x5029=function(_0x1cd7f1,_0x44236f){_0x1cd7f1=_0x1cd7f1-0x0;var _0x5adfde=_0x0295[_0x1cd7f1];return _0x5adfde;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7e1d703..cbeaff5 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 _0xa3f3=['debug','stringify','update','where','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa3f3,0x1d5));var _0x3a3f=function(_0x43b6ec,_0x759d){_0x43b6ec=_0x43b6ec-0x0;var _0x5d1299=_0xa3f3[_0x43b6ec];return _0x5d1299;};'use strict';var _=require(_0x3a3f('0x0'));var util=require('util');var moment=require(_0x3a3f('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a3f('0x2'));var fs=require('fs');var Redis=require(_0x3a3f('0x3'));var db=require(_0x3a3f('0x4'))['db'];var utils=require(_0x3a3f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3a3f('0x6'));var client=jayson[_0x3a3f('0x7')][_0x3a3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fb9f1,_0x5c49b2,_0x51d50f){return new BPromise(function(_0x25e1b0,_0xb21133){return client['request'](_0x4fb9f1,_0x51d50f)[_0x3a3f('0x9')](function(_0x37964b){logger[_0x3a3f('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x5c49b2,_0x3a3f('0xb'));logger['debug'](_0x3a3f('0xc'),_0x5c49b2,'request\x20sent',JSON['stringify'](_0x37964b));if(_0x37964b[_0x3a3f('0xd')]){if(_0x37964b[_0x3a3f('0xd')]['code']===0x1f4){logger[_0x3a3f('0xd')](_0x3a3f('0xe'),_0x5c49b2,_0x37964b['error']['message']);return _0xb21133(_0x37964b[_0x3a3f('0xd')][_0x3a3f('0xf')]);}logger[_0x3a3f('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x5c49b2,_0x37964b[_0x3a3f('0xd')]['message']);return _0x25e1b0(_0x37964b[_0x3a3f('0xd')]['message']);}else{logger[_0x3a3f('0xa')](_0x3a3f('0xe'),_0x5c49b2,_0x3a3f('0xb'));_0x25e1b0(_0x37964b[_0x3a3f('0x10')][_0x3a3f('0xf')]);}})[_0x3a3f('0x11')](function(_0x43aaa8){logger[_0x3a3f('0xd')](_0x3a3f('0xe'),_0x5c49b2,_0x43aaa8);_0xb21133(_0x43aaa8);});});}exports[_0x3a3f('0x12')]=function(_0x5d2a96){var _0x2648a6=this;return new Promise(function(_0x50ceb2,_0x5a28ce){return db[_0x3a3f('0x13')][_0x3a3f('0x14')](_0x5d2a96[_0x3a3f('0x15')],{'raw':_0x5d2a96[_0x3a3f('0x16')]?_0x5d2a96[_0x3a3f('0x16')][_0x3a3f('0x17')]===undefined?!![]:![]:!![]})[_0x3a3f('0x9')](function(_0x5de83f){logger['info'](_0x3a3f('0x12'),_0x5d2a96);logger[_0x3a3f('0x18')](_0x3a3f('0x12'),_0x5d2a96,JSON[_0x3a3f('0x19')](_0x5de83f));_0x50ceb2(_0x5de83f);})['catch'](function(_0x217109){logger[_0x3a3f('0xd')](_0x3a3f('0x12'),_0x217109[_0x3a3f('0xf')],_0x5d2a96);_0x5a28ce(_0x2648a6['error'](0x1f4,_0x217109[_0x3a3f('0xf')]));});});};exports['UpdateFaxQueueReport']=function(_0xbc353d){var _0x1715c1=this;return new Promise(function(_0x15834c,_0x4cfb9f){return db[_0x3a3f('0x13')][_0x3a3f('0x1a')](_0xbc353d['body'],{'raw':_0xbc353d[_0x3a3f('0x16')]?_0xbc353d[_0x3a3f('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc353d['options']?_0xbc353d[_0x3a3f('0x16')][_0x3a3f('0x1b')]||null:null,'attributes':_0xbc353d[_0x3a3f('0x16')]?_0xbc353d[_0x3a3f('0x16')][_0x3a3f('0x1c')]||null:null,'limit':_0xbc353d['options']?_0xbc353d[_0x3a3f('0x16')]['limit']||null:null})[_0x3a3f('0x9')](function(_0x175336){logger['info']('UpdateFaxQueueReport',_0xbc353d);logger[_0x3a3f('0x18')]('UpdateFaxQueueReport',_0xbc353d,JSON['stringify'](_0x175336));_0x15834c(_0x175336);})[_0x3a3f('0x11')](function(_0x32ac73){logger[_0x3a3f('0xd')]('UpdateFaxQueueReport',_0x32ac73[_0x3a3f('0xf')],_0xbc353d);_0x4cfb9f(_0x1715c1[_0x3a3f('0xd')](0x1f4,_0x32ac73['message']));});});}; \ No newline at end of file +var _0x1e6d=['FaxQueueReport','body','options','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport'];(function(_0x48e710,_0x43804a){var _0x407742=function(_0x30c10f){while(--_0x30c10f){_0x48e710['push'](_0x48e710['shift']());}};_0x407742(++_0x43804a);}(_0x1e6d,0x1b5));var _0xd1e6=function(_0x1af655,_0x28b928){_0x1af655=_0x1af655-0x0;var _0x29da01=_0x1e6d[_0x1af655];return _0x29da01;};'use strict';var _=require(_0xd1e6('0x0'));var util=require(_0xd1e6('0x1'));var moment=require(_0xd1e6('0x2'));var BPromise=require(_0xd1e6('0x3'));var rs=require(_0xd1e6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd1e6('0x5'));var logger=require(_0xd1e6('0x6'))('rpc');var config=require(_0xd1e6('0x7'));var jayson=require(_0xd1e6('0x8'));var client=jayson[_0xd1e6('0x9')][_0xd1e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ac301,_0x5da2a8,_0x26daf0){return new BPromise(function(_0x5b19a8,_0xe03f36){return client[_0xd1e6('0xb')](_0x3ac301,_0x26daf0)[_0xd1e6('0xc')](function(_0x38bb8b){logger['info'](_0xd1e6('0xd'),_0x5da2a8,_0xd1e6('0xe'));logger[_0xd1e6('0xf')](_0xd1e6('0x10'),_0x5da2a8,'request\x20sent',JSON[_0xd1e6('0x11')](_0x38bb8b));if(_0x38bb8b[_0xd1e6('0x12')]){if(_0x38bb8b[_0xd1e6('0x12')][_0xd1e6('0x13')]===0x1f4){logger['error'](_0xd1e6('0xd'),_0x5da2a8,_0x38bb8b[_0xd1e6('0x12')][_0xd1e6('0x14')]);return _0xe03f36(_0x38bb8b['error'][_0xd1e6('0x14')]);}logger[_0xd1e6('0x12')](_0xd1e6('0xd'),_0x5da2a8,_0x38bb8b[_0xd1e6('0x12')][_0xd1e6('0x14')]);return _0x5b19a8(_0x38bb8b['error'][_0xd1e6('0x14')]);}else{logger[_0xd1e6('0x15')](_0xd1e6('0xd'),_0x5da2a8,'request\x20sent');_0x5b19a8(_0x38bb8b[_0xd1e6('0x16')][_0xd1e6('0x14')]);}})[_0xd1e6('0x17')](function(_0x5a7cb9){logger[_0xd1e6('0x12')](_0xd1e6('0xd'),_0x5da2a8,_0x5a7cb9);_0xe03f36(_0x5a7cb9);});});}exports[_0xd1e6('0x18')]=function(_0x3f9d4b){var _0x58e9f5=this;return new Promise(function(_0x24fcd4,_0x9f9b65){return db[_0xd1e6('0x19')]['create'](_0x3f9d4b[_0xd1e6('0x1a')],{'raw':_0x3f9d4b[_0xd1e6('0x1b')]?_0x3f9d4b['options'][_0xd1e6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x18e847){logger['info']('CreateFaxQueueReport',_0x3f9d4b);logger[_0xd1e6('0xf')]('CreateFaxQueueReport',_0x3f9d4b,JSON[_0xd1e6('0x11')](_0x18e847));_0x24fcd4(_0x18e847);})[_0xd1e6('0x17')](function(_0x1a693d){logger[_0xd1e6('0x12')](_0xd1e6('0x18'),_0x1a693d[_0xd1e6('0x14')],_0x3f9d4b);_0x9f9b65(_0x58e9f5[_0xd1e6('0x12')](0x1f4,_0x1a693d['message']));});});};exports['UpdateFaxQueueReport']=function(_0x127b03){var _0x9d526e=this;return new Promise(function(_0x9ff3b,_0xf54e26){return db[_0xd1e6('0x19')]['update'](_0x127b03[_0xd1e6('0x1a')],{'raw':_0x127b03[_0xd1e6('0x1b')]?_0x127b03[_0xd1e6('0x1b')][_0xd1e6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b03[_0xd1e6('0x1b')]?_0x127b03[_0xd1e6('0x1b')][_0xd1e6('0x1d')]||null:null,'attributes':_0x127b03[_0xd1e6('0x1b')]?_0x127b03[_0xd1e6('0x1b')][_0xd1e6('0x1e')]||null:null,'limit':_0x127b03[_0xd1e6('0x1b')]?_0x127b03[_0xd1e6('0x1b')][_0xd1e6('0x1f')]||null:null})['then'](function(_0x1b827d){logger['info'](_0xd1e6('0x20'),_0x127b03);logger[_0xd1e6('0xf')](_0xd1e6('0x20'),_0x127b03,JSON[_0xd1e6('0x11')](_0x1b827d));_0x9ff3b(_0x1b827d);})['catch'](function(_0x512abe){logger[_0xd1e6('0x12')](_0xd1e6('0x20'),_0x512abe[_0xd1e6('0x14')],_0x127b03);_0xf54e26(_0x9d526e[_0xd1e6('0x12')](0x1f4,_0x512abe[_0xd1e6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e0f7310..4d4ef16 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 _0xf3fa=['isAuthenticated','describe','/:id','show','post','put','update','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','index','get','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf3fa,0x1ca));var _0xaf3f=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0xf3fa[_0x131e60];return _0x4bc497;};'use strict';var multer=require(_0xaf3f('0x0'));var util=require(_0xaf3f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaf3f('0x2'));var router=express['Router']();var fs_extra=require(_0xaf3f('0x3'));var auth=require(_0xaf3f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf3f('0x5'));var controller=require(_0xaf3f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xaf3f('0x7')]);router[_0xaf3f('0x8')](_0xaf3f('0x9'),auth[_0xaf3f('0xa')](),controller[_0xaf3f('0xb')]);router['get'](_0xaf3f('0xc'),auth[_0xaf3f('0xa')](),controller[_0xaf3f('0xd')]);router[_0xaf3f('0xe')]('/',auth[_0xaf3f('0xa')](),controller['create']);router[_0xaf3f('0xf')](_0xaf3f('0xc'),auth[_0xaf3f('0xa')](),controller[_0xaf3f('0x10')]);router['delete'](_0xaf3f('0xc'),auth[_0xaf3f('0xa')](),controller['destroy']);module[_0xaf3f('0x11')]=router; \ No newline at end of file +var _0xa936=['Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa936,0xf8));var _0x6a93=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa936[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x6a93('0x0'));var util=require(_0x6a93('0x1'));var path=require(_0x6a93('0x2'));var timeout=require(_0x6a93('0x3'));var express=require('express');var router=express[_0x6a93('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6a93('0x5'));var config=require(_0x6a93('0x6'));var controller=require(_0x6a93('0x7'));router['get']('/',auth[_0x6a93('0x8')](),controller[_0x6a93('0x9')]);router[_0x6a93('0xa')]('/describe',auth[_0x6a93('0x8')](),controller[_0x6a93('0xb')]);router[_0x6a93('0xa')]('/:id',auth[_0x6a93('0x8')](),controller[_0x6a93('0xc')]);router[_0x6a93('0xd')]('/',auth['isAuthenticated'](),controller[_0x6a93('0xe')]);router[_0x6a93('0xf')](_0x6a93('0x10'),auth[_0x6a93('0x8')](),controller['update']);router['delete'](_0x6a93('0x10'),auth[_0x6a93('0x8')](),controller[_0x6a93('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 30f131d..40c755c 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5a8152,_0x1fe43e){var _0x12ffe2=function(_0x41837f){while(--_0x41837f){_0x5a8152['push'](_0x5a8152['shift']());}};_0x12ffe2(++_0x1fe43e);}(_0x70e0,0x17b));var _0x070e=function(_0x4f4b4d,_0x1de83c){_0x4f4b4d=_0x4f4b4d-0x0;var _0x34e1c4=_0x70e0[_0x4f4b4d];return _0x34e1c4;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x336b06,_0x55a44f){var _0x2023ac=function(_0x3eb5e8){while(--_0x3eb5e8){_0x336b06['push'](_0x336b06['shift']());}};_0x2023ac(++_0x55a44f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2becd6,_0x11ba16){_0x2becd6=_0x2becd6-0x0;var _0x4f3680=_0xf4eb[_0x2becd6];return _0x4f3680;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 4d27698..57fcc09 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 _0x7118=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','FaxTransferReport','findAll','rows','catch','show','params','length','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0x7118,0x191));var _0x8711=function(_0x34599f,_0x122240){_0x34599f=_0x34599f-0x0;var _0x4904b4=_0x7118[_0x34599f];return _0x4904b4;};'use strict';var emlformat=require(_0x8711('0x0'));var rimraf=require(_0x8711('0x1'));var zipdir=require(_0x8711('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require(_0x8711('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require(_0x8711('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x14'));var logger=require(_0x8711('0x15'))(_0x8711('0x16'));var utils=require(_0x8711('0x17'));var config=require(_0x8711('0x18'));var licenseUtil=require(_0x8711('0x19'));var db=require(_0x8711('0x1a'))['db'];function respondWithStatusCode(_0x304b6b,_0x3b3e7f){_0x3b3e7f=_0x3b3e7f||0xcc;return function(_0x1191a1){if(_0x1191a1){return _0x304b6b[_0x8711('0x1b')](_0x3b3e7f);}return _0x304b6b[_0x8711('0x1c')](_0x3b3e7f)[_0x8711('0x1d')]();};}function respondWithResult(_0x51b4e0,_0x43f74f){_0x43f74f=_0x43f74f||0xc8;return function(_0x411088){if(_0x411088){return _0x51b4e0['status'](_0x43f74f)[_0x8711('0x1e')](_0x411088);}};}function respondWithFilteredResult(_0x50126d,_0x42a9dc){return function(_0x3f8199){if(_0x3f8199){var _0x26bbb5=typeof _0x42a9dc[_0x8711('0x1f')]===_0x8711('0x20')&&typeof _0x42a9dc[_0x8711('0x21')]===_0x8711('0x20');var _0x285bdf=_0x3f8199[_0x8711('0x22')];var _0xcaf088=_0x26bbb5?0x0:_0x42a9dc[_0x8711('0x1f')];var _0x42e2cd=_0x26bbb5?_0x3f8199[_0x8711('0x22')]:_0x42a9dc[_0x8711('0x1f')]+_0x42a9dc[_0x8711('0x21')];var _0x9a9b35;if(_0x42e2cd>=_0x285bdf){_0x42e2cd=_0x285bdf;_0x9a9b35=0xc8;}else{_0x9a9b35=0xce;}_0x50126d[_0x8711('0x1c')](_0x9a9b35);return _0x50126d[_0x8711('0x23')](_0x8711('0x24'),_0xcaf088+'-'+_0x42e2cd+'/'+_0x285bdf)[_0x8711('0x1e')](_0x3f8199);}return null;};}function patchUpdates(_0x10fd09){return function(_0x1f8696){try{jsonpatch[_0x8711('0x25')](_0x1f8696,_0x10fd09,!![]);}catch(_0x5b9e5b){return BPromise[_0x8711('0x26')](_0x5b9e5b);}return _0x1f8696[_0x8711('0x27')]();};}function saveUpdates(_0x44df3b,_0x23995a){return function(_0x15145c){if(_0x15145c){return _0x15145c[_0x8711('0x28')](_0x44df3b)['then'](function(_0xa96f7e){return _0xa96f7e;});}return null;};}function removeEntity(_0x393546,_0x572103){return function(_0x2bc8f5){if(_0x2bc8f5){return _0x2bc8f5[_0x8711('0x29')]()[_0x8711('0x2a')](function(){_0x393546['status'](0xcc)[_0x8711('0x1d')]();});}};}function handleEntityNotFound(_0x384a81,_0x4ff201){return function(_0x5cd740){if(!_0x5cd740){_0x384a81[_0x8711('0x1b')](0x194);}return _0x5cd740;};}function handleError(_0x29380e,_0x492e3d){_0x492e3d=_0x492e3d||0x1f4;return function(_0x118eec){logger['error'](_0x118eec[_0x8711('0x2b')]);if(_0x118eec['name']){delete _0x118eec[_0x8711('0x2c')];}_0x29380e['status'](_0x492e3d)[_0x8711('0x2d')](_0x118eec);};}exports[_0x8711('0x2e')]=function(_0x530ddb,_0x383389){var _0x5cc159={},_0x3ae58a={},_0x5f5608={'count':0x0,'rows':[]};var _0x3ba7a4=_['map'](db['FaxTransferReport'][_0x8711('0x2f')],function(_0x3e2fa4){return{'name':_0x3e2fa4[_0x8711('0x30')],'type':_0x3e2fa4[_0x8711('0x31')][_0x8711('0x32')]};});_0x3ae58a[_0x8711('0x33')]=_[_0x8711('0x34')](_0x3ba7a4,_0x8711('0x2c'));_0x3ae58a['query']=_[_0x8711('0x35')](_0x530ddb[_0x8711('0x36')]);_0x3ae58a[_0x8711('0x37')]=_[_0x8711('0x38')](_0x3ae58a[_0x8711('0x33')],_0x3ae58a[_0x8711('0x36')]);_0x5cc159[_0x8711('0x39')]=_[_0x8711('0x38')](_0x3ae58a[_0x8711('0x33')],qs[_0x8711('0x3a')](_0x530ddb['query'][_0x8711('0x3a')]));_0x5cc159[_0x8711('0x39')]=_0x5cc159[_0x8711('0x39')]['length']?_0x5cc159[_0x8711('0x39')]:_0x3ae58a[_0x8711('0x33')];if(!_0x530ddb[_0x8711('0x36')][_0x8711('0x3b')](_0x8711('0x3c'))){_0x5cc159[_0x8711('0x21')]=qs[_0x8711('0x21')](_0x530ddb[_0x8711('0x36')][_0x8711('0x21')]);_0x5cc159[_0x8711('0x1f')]=qs[_0x8711('0x1f')](_0x530ddb[_0x8711('0x36')][_0x8711('0x1f')]);}_0x5cc159[_0x8711('0x3d')]=qs[_0x8711('0x3e')](_0x530ddb[_0x8711('0x36')][_0x8711('0x3e')]);_0x5cc159[_0x8711('0x3f')]=qs[_0x8711('0x37')](_[_0x8711('0x40')](_0x530ddb[_0x8711('0x36')],_0x3ae58a[_0x8711('0x37')]),_0x3ba7a4);if(_0x530ddb[_0x8711('0x36')]['filter']){_0x5cc159[_0x8711('0x3f')]=_[_0x8711('0x41')](_0x5cc159[_0x8711('0x3f')],{'$or':_[_0x8711('0x34')](_0x3ba7a4,function(_0xf84b4b){if(_0xf84b4b[_0x8711('0x31')]!=='VIRTUAL'){var _0x50ae51={};_0x50ae51[_0xf84b4b[_0x8711('0x2c')]]={'$like':'%'+_0x530ddb[_0x8711('0x36')][_0x8711('0x42')]+'%'};return _0x50ae51;}})});}_0x5cc159=_[_0x8711('0x41')]({},_0x5cc159,_0x530ddb['options']);var _0x3ead30={'where':_0x5cc159[_0x8711('0x3f')]};return db[_0x8711('0x43')]['count'](_0x3ead30)[_0x8711('0x2a')](function(_0x397e60){_0x5f5608[_0x8711('0x22')]=_0x397e60;if(_0x530ddb['query']['includeAll']){_0x5cc159['include']=[{'all':!![]}];}return db[_0x8711('0x43')][_0x8711('0x44')](_0x5cc159);})[_0x8711('0x2a')](function(_0x857c42){_0x5f5608[_0x8711('0x45')]=_0x857c42;return _0x5f5608;})['then'](respondWithFilteredResult(_0x383389,_0x5cc159))[_0x8711('0x46')](handleError(_0x383389,null));};exports[_0x8711('0x47')]=function(_0x281663,_0x114287){var _0x4f65da={'raw':!![],'where':{'id':_0x281663[_0x8711('0x48')]['id']}},_0x1a6c34={};_0x1a6c34[_0x8711('0x33')]=_[_0x8711('0x35')](db[_0x8711('0x43')]['rawAttributes']);_0x1a6c34[_0x8711('0x36')]=_[_0x8711('0x35')](_0x281663['query']);_0x1a6c34['filters']=_[_0x8711('0x38')](_0x1a6c34['model'],_0x1a6c34[_0x8711('0x36')]);_0x4f65da[_0x8711('0x39')]=_[_0x8711('0x38')](_0x1a6c34[_0x8711('0x33')],qs[_0x8711('0x3a')](_0x281663[_0x8711('0x36')][_0x8711('0x3a')]));_0x4f65da[_0x8711('0x39')]=_0x4f65da[_0x8711('0x39')][_0x8711('0x49')]?_0x4f65da['attributes']:_0x1a6c34[_0x8711('0x33')];if(_0x281663['query'][_0x8711('0x4a')]){_0x4f65da[_0x8711('0x4b')]=[{'all':!![]}];}_0x4f65da=_[_0x8711('0x41')]({},_0x4f65da,_0x281663[_0x8711('0x4c')]);return db[_0x8711('0x43')][_0x8711('0x4d')](_0x4f65da)[_0x8711('0x2a')](handleEntityNotFound(_0x114287,null))[_0x8711('0x2a')](respondWithResult(_0x114287,null))[_0x8711('0x46')](handleError(_0x114287,null));};exports[_0x8711('0x4e')]=function(_0x4d3865,_0x4a158b){return db[_0x8711('0x43')]['create'](_0x4d3865['body'],{})[_0x8711('0x2a')](respondWithResult(_0x4a158b,0xc9))[_0x8711('0x46')](handleError(_0x4a158b,null));};exports[_0x8711('0x28')]=function(_0x516924,_0x4e1221){if(_0x516924[_0x8711('0x4f')]['id']){delete _0x516924[_0x8711('0x4f')]['id'];}return db[_0x8711('0x43')][_0x8711('0x4d')]({'where':{'id':_0x516924[_0x8711('0x48')]['id']}})[_0x8711('0x2a')](handleEntityNotFound(_0x4e1221,null))[_0x8711('0x2a')](saveUpdates(_0x516924['body'],null))[_0x8711('0x2a')](respondWithResult(_0x4e1221,null))[_0x8711('0x46')](handleError(_0x4e1221,null));};exports[_0x8711('0x29')]=function(_0x1ad356,_0x1fd646){return db['FaxTransferReport'][_0x8711('0x4d')]({'where':{'id':_0x1ad356[_0x8711('0x48')]['id']}})[_0x8711('0x2a')](handleEntityNotFound(_0x1fd646,null))[_0x8711('0x2a')](removeEntity(_0x1fd646,null))[_0x8711('0x46')](handleError(_0x1fd646,null));};exports[_0x8711('0x50')]=function(_0x2ff3bd,_0x57ab5f){return db['FaxTransferReport'][_0x8711('0x50')]()[_0x8711('0x2a')](respondWithResult(_0x57ab5f,null))['catch'](handleError(_0x57ab5f,null));}; \ No newline at end of file +var _0x386f=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x5cf90e,_0x5df405){var _0xae958d=function(_0x52c27c){while(--_0x52c27c){_0x5cf90e['push'](_0x5cf90e['shift']());}};_0xae958d(++_0x5df405);}(_0x386f,0x69));var _0xf386=function(_0x1829cd,_0x8c860f){_0x1829cd=_0x1829cd-0x0;var _0x1e4457=_0x386f[_0x1829cd];return _0x1e4457;};'use strict';var emlformat=require(_0xf386('0x0'));var rimraf=require(_0xf386('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf386('0x2'));var rp=require(_0xf386('0x3'));var moment=require(_0xf386('0x4'));var BPromise=require(_0xf386('0x5'));var Mustache=require(_0xf386('0x6'));var util=require(_0xf386('0x7'));var path=require('path');var sox=require(_0xf386('0x8'));var csv=require(_0xf386('0x9'));var ejs=require(_0xf386('0xa'));var fs=require('fs');var fs_extra=require(_0xf386('0xb'));var _=require(_0xf386('0xc'));var squel=require(_0xf386('0xd'));var crypto=require('crypto');var jsforce=require(_0xf386('0xe'));var deskjs=require(_0xf386('0xf'));var toCsv=require(_0xf386('0x9'));var querystring=require(_0xf386('0x10'));var Papa=require(_0xf386('0x11'));var Redis=require(_0xf386('0x12'));var authService=require(_0xf386('0x13'));var qs=require(_0xf386('0x14'));var as=require(_0xf386('0x15'));var hardwareService=require(_0xf386('0x16'));var logger=require('../../config/logger')(_0xf386('0x17'));var utils=require(_0xf386('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf386('0x19'));var db=require(_0xf386('0x1a'))['db'];function respondWithStatusCode(_0x4fdca7,_0x356af6){_0x356af6=_0x356af6||0xcc;return function(_0x2b7243){if(_0x2b7243){return _0x4fdca7[_0xf386('0x1b')](_0x356af6);}return _0x4fdca7['status'](_0x356af6)['end']();};}function respondWithResult(_0xcd95a,_0x5a4423){_0x5a4423=_0x5a4423||0xc8;return function(_0x16bb4c){if(_0x16bb4c){return _0xcd95a[_0xf386('0x1c')](_0x5a4423)[_0xf386('0x1d')](_0x16bb4c);}};}function respondWithFilteredResult(_0x293d55,_0x182a70){return function(_0x4dba79){if(_0x4dba79){var _0xa1dc1c=typeof _0x182a70[_0xf386('0x1e')]===_0xf386('0x1f')&&typeof _0x182a70[_0xf386('0x20')]==='undefined';var _0x550462=_0x4dba79[_0xf386('0x21')];var _0x5a4775=_0xa1dc1c?0x0:_0x182a70[_0xf386('0x1e')];var _0x242b9f=_0xa1dc1c?_0x4dba79[_0xf386('0x21')]:_0x182a70[_0xf386('0x1e')]+_0x182a70[_0xf386('0x20')];var _0x5247cb;if(_0x242b9f>=_0x550462){_0x242b9f=_0x550462;_0x5247cb=0xc8;}else{_0x5247cb=0xce;}_0x293d55[_0xf386('0x1c')](_0x5247cb);return _0x293d55['set'](_0xf386('0x22'),_0x5a4775+'-'+_0x242b9f+'/'+_0x550462)[_0xf386('0x1d')](_0x4dba79);}return null;};}function patchUpdates(_0x4abe3e){return function(_0x10ed49){try{jsonpatch[_0xf386('0x23')](_0x10ed49,_0x4abe3e,!![]);}catch(_0x3dc2ea){return BPromise[_0xf386('0x24')](_0x3dc2ea);}return _0x10ed49[_0xf386('0x25')]();};}function saveUpdates(_0x140ffc,_0x186c8c){return function(_0xa996df){if(_0xa996df){return _0xa996df[_0xf386('0x26')](_0x140ffc)['then'](function(_0x6be9b7){return _0x6be9b7;});}return null;};}function removeEntity(_0x35b735,_0x5347cc){return function(_0x565317){if(_0x565317){return _0x565317['destroy']()[_0xf386('0x27')](function(){_0x35b735[_0xf386('0x1c')](0xcc)[_0xf386('0x28')]();});}};}function handleEntityNotFound(_0x58487e,_0xe39747){return function(_0x4a4b0e){if(!_0x4a4b0e){_0x58487e[_0xf386('0x1b')](0x194);}return _0x4a4b0e;};}function handleError(_0x20a50b,_0xb8b5e){_0xb8b5e=_0xb8b5e||0x1f4;return function(_0x478114){logger['error'](_0x478114[_0xf386('0x29')]);if(_0x478114[_0xf386('0x2a')]){delete _0x478114[_0xf386('0x2a')];}_0x20a50b[_0xf386('0x1c')](_0xb8b5e)[_0xf386('0x2b')](_0x478114);};}exports[_0xf386('0x2c')]=function(_0x1c49a4,_0x202096){var _0x2f8c7c={},_0x2e6517={},_0x343a41={'count':0x0,'rows':[]};var _0x1d2c3e=_[_0xf386('0x2d')](db[_0xf386('0x2e')][_0xf386('0x2f')],function(_0x2c2618){return{'name':_0x2c2618[_0xf386('0x30')],'type':_0x2c2618[_0xf386('0x31')][_0xf386('0x32')]};});_0x2e6517[_0xf386('0x33')]=_[_0xf386('0x2d')](_0x1d2c3e,_0xf386('0x2a'));_0x2e6517['query']=_['keys'](_0x1c49a4[_0xf386('0x34')]);_0x2e6517[_0xf386('0x35')]=_['intersection'](_0x2e6517[_0xf386('0x33')],_0x2e6517[_0xf386('0x34')]);_0x2f8c7c[_0xf386('0x36')]=_[_0xf386('0x37')](_0x2e6517[_0xf386('0x33')],qs[_0xf386('0x38')](_0x1c49a4[_0xf386('0x34')][_0xf386('0x38')]));_0x2f8c7c[_0xf386('0x36')]=_0x2f8c7c[_0xf386('0x36')][_0xf386('0x39')]?_0x2f8c7c[_0xf386('0x36')]:_0x2e6517[_0xf386('0x33')];if(!_0x1c49a4[_0xf386('0x34')][_0xf386('0x3a')](_0xf386('0x3b'))){_0x2f8c7c[_0xf386('0x20')]=qs['limit'](_0x1c49a4[_0xf386('0x34')]['limit']);_0x2f8c7c[_0xf386('0x1e')]=qs['offset'](_0x1c49a4['query'][_0xf386('0x1e')]);}_0x2f8c7c['order']=qs[_0xf386('0x3c')](_0x1c49a4[_0xf386('0x34')][_0xf386('0x3c')]);_0x2f8c7c[_0xf386('0x3d')]=qs[_0xf386('0x35')](_[_0xf386('0x3e')](_0x1c49a4[_0xf386('0x34')],_0x2e6517[_0xf386('0x35')]),_0x1d2c3e);if(_0x1c49a4[_0xf386('0x34')][_0xf386('0x3f')]){_0x2f8c7c[_0xf386('0x3d')]=_[_0xf386('0x40')](_0x2f8c7c['where'],{'$or':_['map'](_0x1d2c3e,function(_0x2d171f){if(_0x2d171f[_0xf386('0x31')]!==_0xf386('0x41')){var _0x2594b2={};_0x2594b2[_0x2d171f['name']]={'$like':'%'+_0x1c49a4[_0xf386('0x34')][_0xf386('0x3f')]+'%'};return _0x2594b2;}})});}_0x2f8c7c=_[_0xf386('0x40')]({},_0x2f8c7c,_0x1c49a4[_0xf386('0x42')]);var _0x178cb5={'where':_0x2f8c7c[_0xf386('0x3d')]};return db['FaxTransferReport'][_0xf386('0x21')](_0x178cb5)['then'](function(_0x2aa854){_0x343a41[_0xf386('0x21')]=_0x2aa854;if(_0x1c49a4['query'][_0xf386('0x43')]){_0x2f8c7c[_0xf386('0x44')]=[{'all':!![]}];}return db[_0xf386('0x2e')][_0xf386('0x45')](_0x2f8c7c);})[_0xf386('0x27')](function(_0x4eaa6e){_0x343a41['rows']=_0x4eaa6e;return _0x343a41;})['then'](respondWithFilteredResult(_0x202096,_0x2f8c7c))[_0xf386('0x46')](handleError(_0x202096,null));};exports[_0xf386('0x47')]=function(_0x464a4f,_0x54b3a2){var _0x2c04be={'raw':!![],'where':{'id':_0x464a4f[_0xf386('0x48')]['id']}},_0xb7d4c0={};_0xb7d4c0[_0xf386('0x33')]=_[_0xf386('0x49')](db[_0xf386('0x2e')][_0xf386('0x2f')]);_0xb7d4c0['query']=_[_0xf386('0x49')](_0x464a4f[_0xf386('0x34')]);_0xb7d4c0[_0xf386('0x35')]=_[_0xf386('0x37')](_0xb7d4c0[_0xf386('0x33')],_0xb7d4c0[_0xf386('0x34')]);_0x2c04be[_0xf386('0x36')]=_['intersection'](_0xb7d4c0[_0xf386('0x33')],qs[_0xf386('0x38')](_0x464a4f[_0xf386('0x34')][_0xf386('0x38')]));_0x2c04be[_0xf386('0x36')]=_0x2c04be[_0xf386('0x36')][_0xf386('0x39')]?_0x2c04be['attributes']:_0xb7d4c0[_0xf386('0x33')];if(_0x464a4f[_0xf386('0x34')][_0xf386('0x43')]){_0x2c04be[_0xf386('0x44')]=[{'all':!![]}];}_0x2c04be=_[_0xf386('0x40')]({},_0x2c04be,_0x464a4f[_0xf386('0x42')]);return db[_0xf386('0x2e')]['find'](_0x2c04be)[_0xf386('0x27')](handleEntityNotFound(_0x54b3a2,null))[_0xf386('0x27')](respondWithResult(_0x54b3a2,null))[_0xf386('0x46')](handleError(_0x54b3a2,null));};exports[_0xf386('0x4a')]=function(_0x45b317,_0x53b780){return db[_0xf386('0x2e')][_0xf386('0x4a')](_0x45b317[_0xf386('0x4b')],{})[_0xf386('0x27')](respondWithResult(_0x53b780,0xc9))[_0xf386('0x46')](handleError(_0x53b780,null));};exports[_0xf386('0x26')]=function(_0x1c1520,_0x44ea12){if(_0x1c1520[_0xf386('0x4b')]['id']){delete _0x1c1520['body']['id'];}return db[_0xf386('0x2e')][_0xf386('0x4c')]({'where':{'id':_0x1c1520[_0xf386('0x48')]['id']}})['then'](handleEntityNotFound(_0x44ea12,null))[_0xf386('0x27')](saveUpdates(_0x1c1520[_0xf386('0x4b')],null))[_0xf386('0x27')](respondWithResult(_0x44ea12,null))[_0xf386('0x46')](handleError(_0x44ea12,null));};exports[_0xf386('0x4d')]=function(_0x5ea3dd,_0x57cf9d){return db[_0xf386('0x2e')][_0xf386('0x4c')]({'where':{'id':_0x5ea3dd[_0xf386('0x48')]['id']}})[_0xf386('0x27')](handleEntityNotFound(_0x57cf9d,null))[_0xf386('0x27')](removeEntity(_0x57cf9d,null))['catch'](handleError(_0x57cf9d,null));};exports[_0xf386('0x4e')]=function(_0x508c3d,_0x5cd0a1){return db[_0xf386('0x2e')][_0xf386('0x4e')]()[_0xf386('0x27')](respondWithResult(_0x5cd0a1,null))[_0xf386('0x46')](handleError(_0x5cd0a1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 20c8707..40e08a8 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 _0x4dd9=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x3e64ed,_0x491816){var _0x14d8bc=function(_0x171983){while(--_0x171983){_0x3e64ed['push'](_0x3e64ed['shift']());}};_0x14d8bc(++_0x491816);}(_0x4dd9,0x1f2));var _0x94dd=function(_0xa03db6,_0x436e2c){_0xa03db6=_0xa03db6-0x0;var _0x1e7e80=_0x4dd9[_0xa03db6];return _0x1e7e80;};'use strict';var _=require(_0x94dd('0x0'));var util=require(_0x94dd('0x1'));var logger=require(_0x94dd('0x2'))(_0x94dd('0x3'));var moment=require(_0x94dd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x94dd('0x5'));var rimraf=require(_0x94dd('0x6'));var config=require(_0x94dd('0x7'));var attributes=require(_0x94dd('0x8'));module['exports']=function(_0x3d7c3c,_0x4f4320){return _0x3d7c3c[_0x94dd('0x9')](_0x94dd('0xa'),attributes,{'tableName':_0x94dd('0xb'),'paranoid':![],'indexes':[{'name':_0x94dd('0xc'),'fields':[_0x94dd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15ad=['bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','lodash','moment'];(function(_0x3e2406,_0x4d3cc7){var _0x1e9958=function(_0x5132c0){while(--_0x5132c0){_0x3e2406['push'](_0x3e2406['shift']());}};_0x1e9958(++_0x4d3cc7);}(_0x15ad,0xb2));var _0xd15a=function(_0x171fa2,_0x17cda4){_0x171fa2=_0x171fa2-0x0;var _0x4cdd70=_0x15ad[_0x171fa2];return _0x4cdd70;};'use strict';var _=require(_0xd15a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd15a('0x1'));var BPromise=require(_0xd15a('0x2'));var rp=require(_0xd15a('0x3'));var fs=require('fs');var path=require(_0xd15a('0x4'));var rimraf=require('rimraf');var config=require(_0xd15a('0x5'));var attributes=require(_0xd15a('0x6'));module[_0xd15a('0x7')]=function(_0x86997a,_0x322a55){return _0x86997a['define'](_0xd15a('0x8'),attributes,{'tableName':_0xd15a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 7828572..7411c6d 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 _0x73e0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x402962,_0x130dd9){var _0x1149ee=function(_0x5d80cb){while(--_0x5d80cb){_0x402962['push'](_0x402962['shift']());}};_0x1149ee(++_0x130dd9);}(_0x73e0,0xa6));var _0x073e=function(_0x295dc3,_0x4db701){_0x295dc3=_0x295dc3-0x0;var _0xf6f2b6=_0x73e0[_0x295dc3];return _0xf6f2b6;};'use strict';var _=require(_0x073e('0x0'));var util=require(_0x073e('0x1'));var moment=require('moment');var BPromise=require(_0x073e('0x2'));var rs=require(_0x073e('0x3'));var fs=require('fs');var Redis=require(_0x073e('0x4'));var db=require(_0x073e('0x5'))['db'];var utils=require(_0x073e('0x6'));var logger=require(_0x073e('0x7'))('rpc');var config=require(_0x073e('0x8'));var jayson=require(_0x073e('0x9'));var client=jayson[_0x073e('0xa')][_0x073e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ea028,_0x4649c1,_0xa84f07){return new BPromise(function(_0x41f85c,_0x1c53a9){return client[_0x073e('0xc')](_0x1ea028,_0xa84f07)[_0x073e('0xd')](function(_0x2adc9e){logger[_0x073e('0xe')](_0x073e('0xf'),_0x4649c1,_0x073e('0x10'));logger[_0x073e('0x11')](_0x073e('0x12'),_0x4649c1,_0x073e('0x10'),JSON['stringify'](_0x2adc9e));if(_0x2adc9e[_0x073e('0x13')]){if(_0x2adc9e['error'][_0x073e('0x14')]===0x1f4){logger[_0x073e('0x13')](_0x073e('0xf'),_0x4649c1,_0x2adc9e[_0x073e('0x13')][_0x073e('0x15')]);return _0x1c53a9(_0x2adc9e[_0x073e('0x13')][_0x073e('0x15')]);}logger[_0x073e('0x13')](_0x073e('0xf'),_0x4649c1,_0x2adc9e[_0x073e('0x13')][_0x073e('0x15')]);return _0x41f85c(_0x2adc9e[_0x073e('0x13')][_0x073e('0x15')]);}else{logger[_0x073e('0xe')](_0x073e('0xf'),_0x4649c1,_0x073e('0x10'));_0x41f85c(_0x2adc9e[_0x073e('0x16')][_0x073e('0x15')]);}})[_0x073e('0x17')](function(_0x5649a2){logger[_0x073e('0x13')](_0x073e('0xf'),_0x4649c1,_0x5649a2);_0x1c53a9(_0x5649a2);});});} \ No newline at end of file +var _0x9640=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','rpc','../../config/environment','http','request','then'];(function(_0x34caf7,_0x421cc9){var _0x2a50ef=function(_0x5c7a2c){while(--_0x5c7a2c){_0x34caf7['push'](_0x34caf7['shift']());}};_0x2a50ef(++_0x421cc9);}(_0x9640,0x172));var _0x0964=function(_0x76275e,_0x458779){_0x76275e=_0x76275e-0x0;var _0x430c61=_0x9640[_0x76275e];return _0x430c61;};'use strict';var _=require(_0x0964('0x0'));var util=require(_0x0964('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0964('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0964('0x3'));var config=require(_0x0964('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0964('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1b3c65,_0xbae383,_0x2e573f){return new BPromise(function(_0xcfc22d,_0x291550){return client[_0x0964('0x6')](_0x1b3c65,_0x2e573f)[_0x0964('0x7')](function(_0x1bfa0c){logger[_0x0964('0x8')](_0x0964('0x9'),_0xbae383,_0x0964('0xa'));logger[_0x0964('0xb')](_0x0964('0xc'),_0xbae383,_0x0964('0xa'),JSON['stringify'](_0x1bfa0c));if(_0x1bfa0c[_0x0964('0xd')]){if(_0x1bfa0c[_0x0964('0xd')][_0x0964('0xe')]===0x1f4){logger[_0x0964('0xd')](_0x0964('0x9'),_0xbae383,_0x1bfa0c[_0x0964('0xd')][_0x0964('0xf')]);return _0x291550(_0x1bfa0c[_0x0964('0xd')][_0x0964('0xf')]);}logger[_0x0964('0xd')](_0x0964('0x9'),_0xbae383,_0x1bfa0c[_0x0964('0xd')][_0x0964('0xf')]);return _0xcfc22d(_0x1bfa0c[_0x0964('0xd')]['message']);}else{logger['info'](_0x0964('0x9'),_0xbae383,_0x0964('0xa'));_0xcfc22d(_0x1bfa0c[_0x0964('0x10')]['message']);}})[_0x0964('0x11')](function(_0x381d1e){logger[_0x0964('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0xbae383,_0x381d1e);_0x291550(_0x381d1e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 43eec5b..f0443bc 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 _0xd53b=['index','get','/describe','describe','/:id','create','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated'];(function(_0x16b6e2,_0xe97706){var _0x237dfc=function(_0x17a659){while(--_0x17a659){_0x16b6e2['push'](_0x16b6e2['shift']());}};_0x237dfc(++_0xe97706);}(_0xd53b,0x126));var _0xbd53=function(_0x5b9cd7,_0xee677b){_0x5b9cd7=_0x5b9cd7-0x0;var _0x1c4b5e=_0xd53b[_0x5b9cd7];return _0x1c4b5e;};'use strict';var multer=require(_0xbd53('0x0'));var util=require(_0xbd53('0x1'));var path=require(_0xbd53('0x2'));var timeout=require(_0xbd53('0x3'));var express=require('express');var router=express[_0xbd53('0x4')]();var fs_extra=require(_0xbd53('0x5'));var auth=require(_0xbd53('0x6'));var interaction=require(_0xbd53('0x7'));var config=require('../../config/environment');var controller=require(_0xbd53('0x8'));router['get']('/',auth[_0xbd53('0x9')](),controller[_0xbd53('0xa')]);router[_0xbd53('0xb')](_0xbd53('0xc'),auth[_0xbd53('0x9')](),controller[_0xbd53('0xd')]);router[_0xbd53('0xb')](_0xbd53('0xe'),auth[_0xbd53('0x9')](),controller['show']);router['post']('/',auth[_0xbd53('0x9')](),controller[_0xbd53('0xf')]);router[_0xbd53('0x10')](_0xbd53('0xe'),auth[_0xbd53('0x9')](),controller[_0xbd53('0x11')]);router['delete'](_0xbd53('0xe'),auth[_0xbd53('0x9')](),controller[_0xbd53('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9957=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x274d73,_0x5cdcc7){var _0x6c21d5=function(_0x88c505){while(--_0x88c505){_0x274d73['push'](_0x274d73['shift']());}};_0x6c21d5(++_0x5cdcc7);}(_0x9957,0xf3));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7995('0x0'));var timeout=require(_0x7995('0x1'));var express=require(_0x7995('0x2'));var router=express[_0x7995('0x3')]();var fs_extra=require(_0x7995('0x4'));var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require('../../config/environment');var controller=require(_0x7995('0x7'));router[_0x7995('0x8')]('/',auth['isAuthenticated'](),controller[_0x7995('0x9')]);router[_0x7995('0x8')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0x8')](_0x7995('0xd'),auth[_0x7995('0xb')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7995('0x10')](_0x7995('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7995('0x11')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 948cfd3..3024a9f 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 _0x67f1=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','./intDeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x67f1,0x156));var _0x167f=function(_0x45d157,_0x4867ba){_0x45d157=_0x45d157-0x0;var _0x4280a7=_0x67f1[_0x45d157];return _0x4280a7;};'use strict';var multer=require(_0x167f('0x0'));var util=require(_0x167f('0x1'));var path=require(_0x167f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x167f('0x3')]();var fs_extra=require(_0x167f('0x4'));var auth=require(_0x167f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x167f('0x6'));router[_0x167f('0x7')]('/',auth['isAuthenticated'](),controller[_0x167f('0x8')]);router['get'](_0x167f('0x9'),auth[_0x167f('0xa')](),controller['show']);router[_0x167f('0x7')](_0x167f('0xb'),auth[_0x167f('0xa')](),controller[_0x167f('0xc')]);router[_0x167f('0x7')](_0x167f('0xd'),auth[_0x167f('0xa')](),controller[_0x167f('0xe')]);router[_0x167f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x167f('0xf')]('/:id/configurations',auth[_0x167f('0xa')](),controller[_0x167f('0x10')]);router['put'](_0x167f('0x9'),auth[_0x167f('0xa')](),controller['update']);router[_0x167f('0x11')](_0x167f('0x9'),auth[_0x167f('0xa')](),controller[_0x167f('0x12')]);module[_0x167f('0x13')]=router; \ No newline at end of file +var _0x04c1=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x04c1,0x187));var _0x104c=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x04c1[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0x104c('0x0'));var util=require(_0x104c('0x1'));var path=require(_0x104c('0x2'));var timeout=require('connect-timeout');var express=require(_0x104c('0x3'));var router=express[_0x104c('0x4')]();var fs_extra=require(_0x104c('0x5'));var auth=require(_0x104c('0x6'));var interaction=require(_0x104c('0x7'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x104c('0x8')]('/',auth[_0x104c('0x9')](),controller[_0x104c('0xa')]);router['get'](_0x104c('0xb'),auth[_0x104c('0x9')](),controller[_0x104c('0xc')]);router[_0x104c('0x8')]('/:id/configurations',auth[_0x104c('0x9')](),controller[_0x104c('0xd')]);router[_0x104c('0x8')](_0x104c('0xe'),auth[_0x104c('0x9')](),controller[_0x104c('0xf')]);router[_0x104c('0x10')]('/',auth[_0x104c('0x9')](),controller[_0x104c('0x11')]);router[_0x104c('0x10')](_0x104c('0x12'),auth[_0x104c('0x9')](),controller['addConfiguration']);router[_0x104c('0x13')](_0x104c('0xb'),auth[_0x104c('0x9')](),controller[_0x104c('0x14')]);router[_0x104c('0x15')](_0x104c('0xb'),auth[_0x104c('0x9')](),controller[_0x104c('0x16')]);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 cf3caf6..edfbb60 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 _0x927a=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x3aeaf9,_0x280c32){var _0x244d41=function(_0x4192d4){while(--_0x4192d4){_0x3aeaf9['push'](_0x3aeaf9['shift']());}};_0x244d41(++_0x280c32);}(_0x927a,0x19d));var _0xa927=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x927a[_0x4b7b69];return _0x173b4c;};'use strict';var Sequelize=require(_0xa927('0x0'));module[_0xa927('0x1')]={'name':{'type':Sequelize[_0xa927('0x2')]},'description':{'type':Sequelize[_0xa927('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa927('0x2')]},'authType':{'type':Sequelize[_0xa927('0x3')](_0xa927('0x4')),'defaultValue':_0xa927('0x4')},'password':{'type':Sequelize[_0xa927('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa927('0x2')]},'tokenSecret':{'type':Sequelize[_0xa927('0x2')]},'serverUrl':{'type':Sequelize[_0xa927('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa927('0x3')](_0xa927('0x5'),_0xa927('0x6')),'defaultValue':_0xa927('0x5')}}; \ No newline at end of file +var _0x76b1=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x3bc158,_0x436e3a){var _0x977671=function(_0xa675fa){while(--_0xa675fa){_0x3bc158['push'](_0x3bc158['shift']());}};_0x977671(++_0x436e3a);}(_0x76b1,0x1e7));var _0x176b=function(_0x54862f,_0x2c6c3b){_0x54862f=_0x54862f-0x0;var _0x1db9bb=_0x76b1[_0x54862f];return _0x1db9bb;};'use strict';var Sequelize=require(_0x176b('0x0'));module[_0x176b('0x1')]={'name':{'type':Sequelize[_0x176b('0x2')]},'description':{'type':Sequelize[_0x176b('0x2')]},'username':{'type':Sequelize[_0x176b('0x2')]},'remoteUri':{'type':Sequelize[_0x176b('0x2')]},'authType':{'type':Sequelize[_0x176b('0x3')](_0x176b('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x176b('0x2')]},'consumerKey':{'type':Sequelize[_0x176b('0x2')]},'consumerSecret':{'type':Sequelize[_0x176b('0x2')]},'token':{'type':Sequelize[_0x176b('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x176b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x176b('0x3')](_0x176b('0x5'),'newTab'),'defaultValue':_0x176b('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b9f0cd9..a18bc7e 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 _0x4f3a=['count','includeAll','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','options','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','authType','username','consumerSecret','token','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','password','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','DeskAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4f3a,0x10c));var _0xa4f3=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x4f3a[_0x3ef2d5];return _0x2fefb2;};'use strict';var emlformat=require(_0xa4f3('0x0'));var rimraf=require(_0xa4f3('0x1'));var zipdir=require(_0xa4f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4f3('0x3'));var moment=require('moment');var BPromise=require(_0xa4f3('0x4'));var Mustache=require(_0xa4f3('0x5'));var util=require('util');var path=require(_0xa4f3('0x6'));var sox=require(_0xa4f3('0x7'));var csv=require(_0xa4f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4f3('0x9'));var _=require(_0xa4f3('0xa'));var squel=require(_0xa4f3('0xb'));var crypto=require(_0xa4f3('0xc'));var jsforce=require(_0xa4f3('0xd'));var deskjs=require(_0xa4f3('0xe'));var toCsv=require(_0xa4f3('0x8'));var querystring=require('querystring');var Papa=require(_0xa4f3('0xf'));var Redis=require(_0xa4f3('0x10'));var authService=require(_0xa4f3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4f3('0x12'));var logger=require(_0xa4f3('0x13'))(_0xa4f3('0x14'));var utils=require(_0xa4f3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa4f3('0x16'));var db=require(_0xa4f3('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ffcea,_0x43c0a1){_0x43c0a1=_0x43c0a1||0xcc;return function(_0xe34628){if(_0xe34628){return _0x2ffcea[_0xa4f3('0x18')](_0x43c0a1);}return _0x2ffcea[_0xa4f3('0x19')](_0x43c0a1)[_0xa4f3('0x1a')]();};}function respondWithResult(_0x46f1dc,_0x79be1f){_0x79be1f=_0x79be1f||0xc8;return function(_0x5e4042){if(_0x5e4042){return _0x46f1dc[_0xa4f3('0x19')](_0x79be1f)[_0xa4f3('0x1b')](_0x5e4042);}};}function respondWithFilteredResult(_0x4d7f18,_0x2b1d9f){return function(_0x3782a3){if(_0x3782a3){var _0x3f7afe=typeof _0x2b1d9f[_0xa4f3('0x1c')]==='undefined'&&typeof _0x2b1d9f[_0xa4f3('0x1d')]===_0xa4f3('0x1e');var _0xc9e0b2=_0x3782a3['count'];var _0x3db673=_0x3f7afe?0x0:_0x2b1d9f[_0xa4f3('0x1c')];var _0x1567e0=_0x3f7afe?_0x3782a3['count']:_0x2b1d9f[_0xa4f3('0x1c')]+_0x2b1d9f[_0xa4f3('0x1d')];var _0x3c7420;if(_0x1567e0>=_0xc9e0b2){_0x1567e0=_0xc9e0b2;_0x3c7420=0xc8;}else{_0x3c7420=0xce;}_0x4d7f18[_0xa4f3('0x19')](_0x3c7420);return _0x4d7f18[_0xa4f3('0x1f')]('Content-Range',_0x3db673+'-'+_0x1567e0+'/'+_0xc9e0b2)[_0xa4f3('0x1b')](_0x3782a3);}return null;};}function patchUpdates(_0x189ff4){return function(_0xc913d6){try{jsonpatch['apply'](_0xc913d6,_0x189ff4,!![]);}catch(_0x2dac12){return BPromise['reject'](_0x2dac12);}return _0xc913d6[_0xa4f3('0x20')]();};}function saveUpdates(_0x5ada51,_0xdc7684){return function(_0x5d9913){if(_0x5d9913){return _0x5d9913[_0xa4f3('0x21')](_0x5ada51)['then'](function(_0x204098){return _0x204098;});}return null;};}function removeEntity(_0x581d8b,_0x387146){return function(_0x5b89fb){if(_0x5b89fb){return _0x5b89fb[_0xa4f3('0x22')]()[_0xa4f3('0x23')](function(){_0x581d8b[_0xa4f3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3750,_0x39c210){return function(_0x34a9cf){if(!_0x34a9cf){_0x1f3750[_0xa4f3('0x18')](0x194);}return _0x34a9cf;};}function handleError(_0x13238d,_0xb5fcbd){_0xb5fcbd=_0xb5fcbd||0x1f4;return function(_0x3e0cf7){logger[_0xa4f3('0x24')](_0x3e0cf7[_0xa4f3('0x25')]);if(_0x3e0cf7[_0xa4f3('0x26')]){delete _0x3e0cf7[_0xa4f3('0x26')];}_0x13238d[_0xa4f3('0x19')](_0xb5fcbd)[_0xa4f3('0x27')](_0x3e0cf7);};}exports[_0xa4f3('0x28')]=function(_0x4bfcc6,_0x3cc9d7){var _0x2793c4={},_0xd353a2={},_0x285e22={'count':0x0,'rows':[]};var _0x106eae=_[_0xa4f3('0x29')](db['DeskAccount'][_0xa4f3('0x2a')],function(_0x390f10){return{'name':_0x390f10[_0xa4f3('0x2b')],'type':_0x390f10[_0xa4f3('0x2c')][_0xa4f3('0x2d')]};});_0xd353a2[_0xa4f3('0x2e')]=_[_0xa4f3('0x29')](_0x106eae,_0xa4f3('0x26'));_0xd353a2[_0xa4f3('0x2f')]=_['keys'](_0x4bfcc6[_0xa4f3('0x2f')]);_0xd353a2[_0xa4f3('0x30')]=_[_0xa4f3('0x31')](_0xd353a2[_0xa4f3('0x2e')],_0xd353a2['query']);_0x2793c4[_0xa4f3('0x32')]=_['intersection'](_0xd353a2['model'],qs[_0xa4f3('0x33')](_0x4bfcc6['query'][_0xa4f3('0x33')]));_0x2793c4[_0xa4f3('0x32')]=_0x2793c4[_0xa4f3('0x32')][_0xa4f3('0x34')]?_0x2793c4[_0xa4f3('0x32')]:_0xd353a2[_0xa4f3('0x2e')];if(!_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x35')](_0xa4f3('0x36'))){_0x2793c4['limit']=qs[_0xa4f3('0x1d')](_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x1d')]);_0x2793c4['offset']=qs[_0xa4f3('0x1c')](_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x1c')]);}_0x2793c4[_0xa4f3('0x37')]=qs['sort'](_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x38')]);_0x2793c4[_0xa4f3('0x39')]=qs[_0xa4f3('0x30')](_['pick'](_0x4bfcc6[_0xa4f3('0x2f')],_0xd353a2['filters']),_0x106eae);if(_0x4bfcc6['query'][_0xa4f3('0x3a')]){_0x2793c4[_0xa4f3('0x39')]=_[_0xa4f3('0x3b')](_0x2793c4[_0xa4f3('0x39')],{'$or':_[_0xa4f3('0x29')](_0x106eae,function(_0x4975d1){if(_0x4975d1[_0xa4f3('0x2c')]!==_0xa4f3('0x3c')){var _0x2308bf={};_0x2308bf[_0x4975d1[_0xa4f3('0x26')]]={'$like':'%'+_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x3a')]+'%'};return _0x2308bf;}})});}_0x2793c4=_['merge']({},_0x2793c4,_0x4bfcc6['options']);var _0x316bd7={'where':_0x2793c4[_0xa4f3('0x39')]};return db[_0xa4f3('0x3d')]['count'](_0x316bd7)[_0xa4f3('0x23')](function(_0x420127){_0x285e22[_0xa4f3('0x3e')]=_0x420127;if(_0x4bfcc6[_0xa4f3('0x2f')][_0xa4f3('0x3f')]){_0x2793c4[_0xa4f3('0x40')]=[{'all':!![]}];}return db[_0xa4f3('0x3d')][_0xa4f3('0x41')](_0x2793c4);})['then'](function(_0x471f36){_0x285e22['rows']=_0x471f36;return _0x285e22;})[_0xa4f3('0x23')](respondWithFilteredResult(_0x3cc9d7,_0x2793c4))[_0xa4f3('0x42')](handleError(_0x3cc9d7,null));};exports[_0xa4f3('0x43')]=function(_0x16ed77,_0x202500){var _0x47dc43={'raw':![],'where':{'id':_0x16ed77[_0xa4f3('0x44')]['id']}},_0x42b3c3={};_0x42b3c3[_0xa4f3('0x2e')]=_[_0xa4f3('0x45')](db[_0xa4f3('0x3d')]['rawAttributes']);_0x42b3c3[_0xa4f3('0x2f')]=_[_0xa4f3('0x45')](_0x16ed77[_0xa4f3('0x2f')]);_0x42b3c3[_0xa4f3('0x30')]=_[_0xa4f3('0x31')](_0x42b3c3[_0xa4f3('0x2e')],_0x42b3c3[_0xa4f3('0x2f')]);_0x47dc43[_0xa4f3('0x32')]=_[_0xa4f3('0x31')](_0x42b3c3[_0xa4f3('0x2e')],qs[_0xa4f3('0x33')](_0x16ed77[_0xa4f3('0x2f')]['fields']));_0x47dc43[_0xa4f3('0x32')]=_0x47dc43['attributes'][_0xa4f3('0x34')]?_0x47dc43[_0xa4f3('0x32')]:_0x42b3c3[_0xa4f3('0x2e')];if(_0x16ed77[_0xa4f3('0x2f')][_0xa4f3('0x3f')]){_0x47dc43[_0xa4f3('0x40')]=[{'all':!![]}];}_0x47dc43=_[_0xa4f3('0x3b')]({},_0x47dc43,_0x16ed77['options']);return db[_0xa4f3('0x3d')][_0xa4f3('0x46')](_0x47dc43)[_0xa4f3('0x23')](handleEntityNotFound(_0x202500,null))['then'](respondWithResult(_0x202500,null))['catch'](handleError(_0x202500,null));};exports[_0xa4f3('0x47')]=function(_0x57a228,_0x24becc){return db[_0xa4f3('0x3d')][_0xa4f3('0x47')](_0x57a228[_0xa4f3('0x48')],{})['then'](respondWithResult(_0x24becc,0xc9))[_0xa4f3('0x42')](handleError(_0x24becc,null));};exports[_0xa4f3('0x21')]=function(_0x2ad4dd,_0x6af2b7){if(_0x2ad4dd[_0xa4f3('0x48')]['id']){delete _0x2ad4dd['body']['id'];}return db['DeskAccount'][_0xa4f3('0x46')]({'where':{'id':_0x2ad4dd[_0xa4f3('0x44')]['id']}})[_0xa4f3('0x23')](handleEntityNotFound(_0x6af2b7,null))[_0xa4f3('0x23')](saveUpdates(_0x2ad4dd[_0xa4f3('0x48')],null))[_0xa4f3('0x23')](respondWithResult(_0x6af2b7,null))['catch'](handleError(_0x6af2b7,null));};exports[_0xa4f3('0x22')]=function(_0x589005,_0x1fc1a9){return db[_0xa4f3('0x3d')][_0xa4f3('0x46')]({'where':{'id':_0x589005['params']['id']}})[_0xa4f3('0x23')](handleEntityNotFound(_0x1fc1a9,null))[_0xa4f3('0x23')](removeEntity(_0x1fc1a9,null))['catch'](handleError(_0x1fc1a9,null));};exports[_0xa4f3('0x49')]=function(_0x215c55,_0x4f08b5,_0x272774){var _0x2cc160={};var _0x1d7142={};var _0xa94357;var _0x319470;return db[_0xa4f3('0x3d')][_0xa4f3('0x4a')]({'where':{'id':_0x215c55[_0xa4f3('0x44')]['id']}})[_0xa4f3('0x23')](handleEntityNotFound(_0x4f08b5,null))[_0xa4f3('0x23')](function(_0x1e5a07){if(_0x1e5a07){_0xa94357=_0x1e5a07;_0x1d7142['model']=_[_0xa4f3('0x45')](db[_0xa4f3('0x4b')][_0xa4f3('0x2a')]);_0x1d7142[_0xa4f3('0x2f')]=_['keys'](_0x215c55[_0xa4f3('0x2f')]);_0x1d7142[_0xa4f3('0x30')]=_[_0xa4f3('0x31')](_0x1d7142[_0xa4f3('0x2e')],_0x1d7142[_0xa4f3('0x2f')]);_0x2cc160['attributes']=_[_0xa4f3('0x31')](_0x1d7142['model'],qs[_0xa4f3('0x33')](_0x215c55[_0xa4f3('0x2f')][_0xa4f3('0x33')]));_0x2cc160[_0xa4f3('0x32')]=_0x2cc160[_0xa4f3('0x32')][_0xa4f3('0x34')]?_0x2cc160['attributes']:_0x1d7142[_0xa4f3('0x2e')];_0x2cc160['order']=qs['sort'](_0x215c55['query'][_0xa4f3('0x38')]);_0x2cc160['where']=qs['filters'](_[_0xa4f3('0x4c')](_0x215c55[_0xa4f3('0x2f')],_0x1d7142[_0xa4f3('0x30')]));if(_0x215c55[_0xa4f3('0x2f')][_0xa4f3('0x3a')]){_0x2cc160[_0xa4f3('0x39')]=_[_0xa4f3('0x3b')](_0x2cc160[_0xa4f3('0x39')],{'$or':_[_0xa4f3('0x29')](_0x2cc160[_0xa4f3('0x32')],function(_0x4f40da){var _0x57f41e={};_0x57f41e[_0x4f40da]={'$like':'%'+_0x215c55['query']['filter']+'%'};return _0x57f41e;})});}_0x2cc160=_[_0xa4f3('0x3b')]({},_0x2cc160,_0x215c55[_0xa4f3('0x4d')]);return _0xa94357[_0xa4f3('0x49')](_0x2cc160);}})['then'](function(_0x42de52){if(_0x42de52){_0x319470=_0x42de52[_0xa4f3('0x34')];if(!_0x215c55['query'][_0xa4f3('0x35')](_0xa4f3('0x36'))){_0x2cc160[_0xa4f3('0x1d')]=qs[_0xa4f3('0x1d')](_0x215c55[_0xa4f3('0x2f')][_0xa4f3('0x1d')]);_0x2cc160[_0xa4f3('0x1c')]=qs[_0xa4f3('0x1c')](_0x215c55[_0xa4f3('0x2f')][_0xa4f3('0x1c')]);}return _0xa94357[_0xa4f3('0x49')](_0x2cc160);}})[_0xa4f3('0x23')](function(_0x2b685f){if(_0x2b685f){return _0x2b685f?{'count':_0x319470,'rows':_0x2b685f}:null;}})[_0xa4f3('0x23')](respondWithResult(_0x4f08b5,null))[_0xa4f3('0x42')](handleError(_0x4f08b5,null));};exports[_0xa4f3('0x4e')]=function(_0x1ce0b1,_0x2e27d8,_0x971a21){if(_0x1ce0b1[_0xa4f3('0x48')]['id']){delete _0x1ce0b1['body']['id'];}return db[_0xa4f3('0x3d')][_0xa4f3('0x4a')]({'where':{'id':_0x1ce0b1[_0xa4f3('0x44')]['id']}})[_0xa4f3('0x23')](handleEntityNotFound(_0x2e27d8,null))[_0xa4f3('0x23')](function(_0x446021){if(_0x446021){_0x1ce0b1[_0xa4f3('0x48')][_0xa4f3('0x4f')]=_0x446021['id'];_0x1ce0b1[_0xa4f3('0x48')][_0xa4f3('0x50')]=integrations[_0xa4f3('0x51')](_0x1ce0b1['body']['channel'],_0x1ce0b1[_0xa4f3('0x48')]['type']);_0x1ce0b1[_0xa4f3('0x48')][_0xa4f3('0x52')]=integrations['getDescriptions'](_0x1ce0b1[_0xa4f3('0x48')][_0xa4f3('0x53')],_0x1ce0b1[_0xa4f3('0x48')][_0xa4f3('0x2c')]);return db['DeskConfiguration'][_0xa4f3('0x47')](_0x1ce0b1[_0xa4f3('0x48')],{'include':[{'model':db[_0xa4f3('0x54')],'as':_0xa4f3('0x50')},{'model':db[_0xa4f3('0x54')],'as':_0xa4f3('0x52')}]});}return null;})[_0xa4f3('0x23')](respondWithResult(_0x2e27d8,null))[_0xa4f3('0x42')](handleError(_0x2e27d8,null));};exports[_0xa4f3('0x55')]=function(_0x36c90f,_0x3f4fec,_0x2b8910){var _0x47efb7=[{'name':'priority','label':_0xa4f3('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 _0x133844='';return db[_0xa4f3('0x3d')][_0xa4f3('0x4a')]({'where':{'id':_0x36c90f['params']['id']},'attributes':['id','remoteUri',_0xa4f3('0x57'),_0xa4f3('0x58'),'password','consumerKey',_0xa4f3('0x59'),_0xa4f3('0x5a'),'tokenSecret']})[_0xa4f3('0x23')](handleEntityNotFound(_0x3f4fec,null))[_0xa4f3('0x23')](function(_0x560d67){if(_0x560d67){_0x133844=_0x560d67['remoteUri'];var _0x537d54=_0x133844[_0xa4f3('0x5b')](-0x1);if(_0x537d54==='/'){_0x133844=_0x133844['substring'](0x0,_0x133844[_0xa4f3('0x5c')](_0x537d54));}var _0x148157={'method':'GET','uri':util[_0xa4f3('0x5d')](_0xa4f3('0x5e'),_0x133844),'headers':{'Content-Type':'application/json','Accept':_0xa4f3('0x5f')},'json':!![]};if(_0x560d67[_0xa4f3('0x57')]===_0xa4f3('0x60')){_0x148157[_0xa4f3('0x61')]['Authorization']=util[_0xa4f3('0x5d')](_0xa4f3('0x62'),new Buffer(util[_0xa4f3('0x5d')]('%s:%s',_0x560d67[_0xa4f3('0x58')],_0x560d67[_0xa4f3('0x63')]))[_0xa4f3('0x64')](_0xa4f3('0x65')));}return rp(_0x148157)[_0xa4f3('0x23')](function(_0x187404){return _0x47efb7[_0xa4f3('0x66')](_[_0xa4f3('0x29')](_0x187404[_0xa4f3('0x67')][_0xa4f3('0x68')],function(_0x365e9a){return{'id':_0x365e9a[_0xa4f3('0x26')],'name':_0x365e9a[_0xa4f3('0x26')],'type':_0x365e9a[_0xa4f3('0x2c')],'active':_0x365e9a[_0xa4f3('0x69')],'label':_0x365e9a[_0xa4f3('0x6a')],'custom':!![]};}));});}})[_0xa4f3('0x23')](function(_0x1cd6d0){return{'count':_0x1cd6d0[_0xa4f3('0x34')],'rows':_0x1cd6d0};})[_0xa4f3('0x23')](respondWithResult(_0x3f4fec,null))['catch'](function(_0x3b69d8){var _0x4f7893=_0x36c90f[_0xa4f3('0x2f')][_0xa4f3('0x6b')]?0x1f4:_0x3b69d8[_0xa4f3('0x6c')]||0x1f4;logger[_0xa4f3('0x24')](_0xa4f3('0x6d'),_0xa4f3('0x55'),_0x4f7893,JSON['stringify'](_0x3b69d8));delete _0x3b69d8[_0xa4f3('0x26')];if(_0x4f7893===0x191){_0x4f7893=0x190;}_0x3f4fec[_0xa4f3('0x19')](_0x4f7893)[_0xa4f3('0x27')](_0x36c90f[_0xa4f3('0x2f')][_0xa4f3('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x3b69d8['statusCode']}:_0x3b69d8);});}; \ No newline at end of file +var _0xc9a7=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','getConfigurations','findOne','DeskConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','DeskField','priority','remoteUri','authType','username','password','consumerKey','tokenSecret','slice','substring','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4a965e,_0xc0a319){var _0x2553aa=function(_0x59f714){while(--_0x59f714){_0x4a965e['push'](_0x4a965e['shift']());}};_0x2553aa(++_0xc0a319);}(_0xc9a7,0xd1));var _0x7c9a=function(_0x586985,_0xbfb970){_0x586985=_0x586985-0x0;var _0x3e3b29=_0xc9a7[_0x586985];return _0x3e3b29;};'use strict';var emlformat=require(_0x7c9a('0x0'));var rimraf=require(_0x7c9a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c9a('0x2'));var rp=require('request-promise');var moment=require(_0x7c9a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c9a('0x4'));var util=require(_0x7c9a('0x5'));var path=require(_0x7c9a('0x6'));var sox=require('sox');var csv=require(_0x7c9a('0x7'));var ejs=require(_0x7c9a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c9a('0x9'));var squel=require(_0x7c9a('0xa'));var crypto=require(_0x7c9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7c9a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7c9a('0xd'));var Papa=require(_0x7c9a('0xe'));var Redis=require(_0x7c9a('0xf'));var authService=require(_0x7c9a('0x10'));var qs=require(_0x7c9a('0x11'));var as=require(_0x7c9a('0x12'));var hardwareService=require(_0x7c9a('0x13'));var logger=require(_0x7c9a('0x14'))(_0x7c9a('0x15'));var utils=require(_0x7c9a('0x16'));var config=require(_0x7c9a('0x17'));var licenseUtil=require(_0x7c9a('0x18'));var db=require(_0x7c9a('0x19'))['db'];var integrations=require(_0x7c9a('0x1a'));function respondWithStatusCode(_0x4b6ff5,_0x419866){_0x419866=_0x419866||0xcc;return function(_0x1395f5){if(_0x1395f5){return _0x4b6ff5['sendStatus'](_0x419866);}return _0x4b6ff5[_0x7c9a('0x1b')](_0x419866)[_0x7c9a('0x1c')]();};}function respondWithResult(_0xdbf9c3,_0x6b48bc){_0x6b48bc=_0x6b48bc||0xc8;return function(_0x459482){if(_0x459482){return _0xdbf9c3[_0x7c9a('0x1b')](_0x6b48bc)[_0x7c9a('0x1d')](_0x459482);}};}function respondWithFilteredResult(_0x125372,_0x5b76c7){return function(_0xbf1653){if(_0xbf1653){var _0x3f2920=typeof _0x5b76c7[_0x7c9a('0x1e')]===_0x7c9a('0x1f')&&typeof _0x5b76c7[_0x7c9a('0x20')]==='undefined';var _0x543c1d=_0xbf1653[_0x7c9a('0x21')];var _0x163030=_0x3f2920?0x0:_0x5b76c7[_0x7c9a('0x1e')];var _0x22fbb7=_0x3f2920?_0xbf1653['count']:_0x5b76c7['offset']+_0x5b76c7[_0x7c9a('0x20')];var _0x53d5d6;if(_0x22fbb7>=_0x543c1d){_0x22fbb7=_0x543c1d;_0x53d5d6=0xc8;}else{_0x53d5d6=0xce;}_0x125372['status'](_0x53d5d6);return _0x125372[_0x7c9a('0x22')](_0x7c9a('0x23'),_0x163030+'-'+_0x22fbb7+'/'+_0x543c1d)['json'](_0xbf1653);}return null;};}function patchUpdates(_0x488d56){return function(_0x5287e3){try{jsonpatch[_0x7c9a('0x24')](_0x5287e3,_0x488d56,!![]);}catch(_0x2719aa){return BPromise['reject'](_0x2719aa);}return _0x5287e3[_0x7c9a('0x25')]();};}function saveUpdates(_0x52c8e1,_0x7045f6){return function(_0x2df740){if(_0x2df740){return _0x2df740[_0x7c9a('0x26')](_0x52c8e1)[_0x7c9a('0x27')](function(_0x38f1fe){return _0x38f1fe;});}return null;};}function removeEntity(_0x1fcc7c,_0x4b0849){return function(_0x3daab1){if(_0x3daab1){return _0x3daab1['destroy']()[_0x7c9a('0x27')](function(){_0x1fcc7c[_0x7c9a('0x1b')](0xcc)[_0x7c9a('0x1c')]();});}};}function handleEntityNotFound(_0x4f374c,_0x4b4fc4){return function(_0x5511fa){if(!_0x5511fa){_0x4f374c[_0x7c9a('0x28')](0x194);}return _0x5511fa;};}function handleError(_0xa2542a,_0x40aa41){_0x40aa41=_0x40aa41||0x1f4;return function(_0x1a4b8a){logger[_0x7c9a('0x29')](_0x1a4b8a[_0x7c9a('0x2a')]);if(_0x1a4b8a[_0x7c9a('0x2b')]){delete _0x1a4b8a[_0x7c9a('0x2b')];}_0xa2542a['status'](_0x40aa41)[_0x7c9a('0x2c')](_0x1a4b8a);};}exports['index']=function(_0x50631e,_0x2c0a33){var _0x326d48={},_0x507b7c={},_0x4d467b={'count':0x0,'rows':[]};var _0x55b0ae=_[_0x7c9a('0x2d')](db[_0x7c9a('0x2e')][_0x7c9a('0x2f')],function(_0x8a23d6){return{'name':_0x8a23d6[_0x7c9a('0x30')],'type':_0x8a23d6[_0x7c9a('0x31')]['key']};});_0x507b7c[_0x7c9a('0x32')]=_[_0x7c9a('0x2d')](_0x55b0ae,_0x7c9a('0x2b'));_0x507b7c[_0x7c9a('0x33')]=_[_0x7c9a('0x34')](_0x50631e['query']);_0x507b7c[_0x7c9a('0x35')]=_[_0x7c9a('0x36')](_0x507b7c[_0x7c9a('0x32')],_0x507b7c['query']);_0x326d48[_0x7c9a('0x37')]=_[_0x7c9a('0x36')](_0x507b7c[_0x7c9a('0x32')],qs[_0x7c9a('0x38')](_0x50631e[_0x7c9a('0x33')][_0x7c9a('0x38')]));_0x326d48[_0x7c9a('0x37')]=_0x326d48[_0x7c9a('0x37')][_0x7c9a('0x39')]?_0x326d48['attributes']:_0x507b7c[_0x7c9a('0x32')];if(!_0x50631e[_0x7c9a('0x33')][_0x7c9a('0x3a')](_0x7c9a('0x3b'))){_0x326d48[_0x7c9a('0x20')]=qs[_0x7c9a('0x20')](_0x50631e[_0x7c9a('0x33')][_0x7c9a('0x20')]);_0x326d48[_0x7c9a('0x1e')]=qs[_0x7c9a('0x1e')](_0x50631e['query'][_0x7c9a('0x1e')]);}_0x326d48[_0x7c9a('0x3c')]=qs[_0x7c9a('0x3d')](_0x50631e[_0x7c9a('0x33')]['sort']);_0x326d48['where']=qs[_0x7c9a('0x35')](_[_0x7c9a('0x3e')](_0x50631e[_0x7c9a('0x33')],_0x507b7c[_0x7c9a('0x35')]),_0x55b0ae);if(_0x50631e[_0x7c9a('0x33')]['filter']){_0x326d48[_0x7c9a('0x3f')]=_[_0x7c9a('0x40')](_0x326d48[_0x7c9a('0x3f')],{'$or':_['map'](_0x55b0ae,function(_0x4e998c){if(_0x4e998c[_0x7c9a('0x31')]!==_0x7c9a('0x41')){var _0x323702={};_0x323702[_0x4e998c[_0x7c9a('0x2b')]]={'$like':'%'+_0x50631e[_0x7c9a('0x33')]['filter']+'%'};return _0x323702;}})});}_0x326d48=_['merge']({},_0x326d48,_0x50631e[_0x7c9a('0x42')]);var _0x4eaab1={'where':_0x326d48[_0x7c9a('0x3f')]};return db[_0x7c9a('0x2e')][_0x7c9a('0x21')](_0x4eaab1)[_0x7c9a('0x27')](function(_0x929bf8){_0x4d467b[_0x7c9a('0x21')]=_0x929bf8;if(_0x50631e[_0x7c9a('0x33')][_0x7c9a('0x43')]){_0x326d48[_0x7c9a('0x44')]=[{'all':!![]}];}return db[_0x7c9a('0x2e')][_0x7c9a('0x45')](_0x326d48);})[_0x7c9a('0x27')](function(_0x1fa8d7){_0x4d467b[_0x7c9a('0x46')]=_0x1fa8d7;return _0x4d467b;})[_0x7c9a('0x27')](respondWithFilteredResult(_0x2c0a33,_0x326d48))[_0x7c9a('0x47')](handleError(_0x2c0a33,null));};exports['show']=function(_0x240454,_0x1c90e2){var _0x57a720={'raw':![],'where':{'id':_0x240454[_0x7c9a('0x48')]['id']}},_0x3cdfdd={};_0x3cdfdd[_0x7c9a('0x32')]=_[_0x7c9a('0x34')](db[_0x7c9a('0x2e')][_0x7c9a('0x2f')]);_0x3cdfdd[_0x7c9a('0x33')]=_['keys'](_0x240454[_0x7c9a('0x33')]);_0x3cdfdd['filters']=_[_0x7c9a('0x36')](_0x3cdfdd[_0x7c9a('0x32')],_0x3cdfdd['query']);_0x57a720[_0x7c9a('0x37')]=_['intersection'](_0x3cdfdd[_0x7c9a('0x32')],qs['fields'](_0x240454[_0x7c9a('0x33')][_0x7c9a('0x38')]));_0x57a720[_0x7c9a('0x37')]=_0x57a720[_0x7c9a('0x37')]['length']?_0x57a720[_0x7c9a('0x37')]:_0x3cdfdd[_0x7c9a('0x32')];if(_0x240454[_0x7c9a('0x33')]['includeAll']){_0x57a720[_0x7c9a('0x44')]=[{'all':!![]}];}_0x57a720=_[_0x7c9a('0x40')]({},_0x57a720,_0x240454[_0x7c9a('0x42')]);return db['DeskAccount'][_0x7c9a('0x49')](_0x57a720)[_0x7c9a('0x27')](handleEntityNotFound(_0x1c90e2,null))[_0x7c9a('0x27')](respondWithResult(_0x1c90e2,null))['catch'](handleError(_0x1c90e2,null));};exports['create']=function(_0x2b4a65,_0x3f03ab){return db['DeskAccount']['create'](_0x2b4a65[_0x7c9a('0x4a')],{})['then'](respondWithResult(_0x3f03ab,0xc9))['catch'](handleError(_0x3f03ab,null));};exports[_0x7c9a('0x26')]=function(_0x6ee476,_0x1bc95e){if(_0x6ee476['body']['id']){delete _0x6ee476['body']['id'];}return db[_0x7c9a('0x2e')][_0x7c9a('0x49')]({'where':{'id':_0x6ee476[_0x7c9a('0x48')]['id']}})[_0x7c9a('0x27')](handleEntityNotFound(_0x1bc95e,null))[_0x7c9a('0x27')](saveUpdates(_0x6ee476[_0x7c9a('0x4a')],null))['then'](respondWithResult(_0x1bc95e,null))[_0x7c9a('0x47')](handleError(_0x1bc95e,null));};exports['destroy']=function(_0x35e71d,_0x1257a8){return db[_0x7c9a('0x2e')]['find']({'where':{'id':_0x35e71d[_0x7c9a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1257a8,null))[_0x7c9a('0x27')](removeEntity(_0x1257a8,null))[_0x7c9a('0x47')](handleError(_0x1257a8,null));};exports[_0x7c9a('0x4b')]=function(_0x585570,_0x5557b5,_0x2c2aaf){var _0x2129b9={};var _0x2b6f64={};var _0x17e186;var _0x3eb89;return db['DeskAccount'][_0x7c9a('0x4c')]({'where':{'id':_0x585570[_0x7c9a('0x48')]['id']}})['then'](handleEntityNotFound(_0x5557b5,null))[_0x7c9a('0x27')](function(_0x2c1184){if(_0x2c1184){_0x17e186=_0x2c1184;_0x2b6f64[_0x7c9a('0x32')]=_[_0x7c9a('0x34')](db[_0x7c9a('0x4d')][_0x7c9a('0x2f')]);_0x2b6f64[_0x7c9a('0x33')]=_[_0x7c9a('0x34')](_0x585570[_0x7c9a('0x33')]);_0x2b6f64[_0x7c9a('0x35')]=_[_0x7c9a('0x36')](_0x2b6f64[_0x7c9a('0x32')],_0x2b6f64[_0x7c9a('0x33')]);_0x2129b9['attributes']=_[_0x7c9a('0x36')](_0x2b6f64[_0x7c9a('0x32')],qs['fields'](_0x585570['query'][_0x7c9a('0x38')]));_0x2129b9['attributes']=_0x2129b9[_0x7c9a('0x37')][_0x7c9a('0x39')]?_0x2129b9[_0x7c9a('0x37')]:_0x2b6f64[_0x7c9a('0x32')];_0x2129b9[_0x7c9a('0x3c')]=qs[_0x7c9a('0x3d')](_0x585570[_0x7c9a('0x33')][_0x7c9a('0x3d')]);_0x2129b9[_0x7c9a('0x3f')]=qs['filters'](_[_0x7c9a('0x3e')](_0x585570['query'],_0x2b6f64['filters']));if(_0x585570[_0x7c9a('0x33')][_0x7c9a('0x4e')]){_0x2129b9[_0x7c9a('0x3f')]=_['merge'](_0x2129b9[_0x7c9a('0x3f')],{'$or':_[_0x7c9a('0x2d')](_0x2129b9[_0x7c9a('0x37')],function(_0x180db6){var _0x6d07f7={};_0x6d07f7[_0x180db6]={'$like':'%'+_0x585570[_0x7c9a('0x33')][_0x7c9a('0x4e')]+'%'};return _0x6d07f7;})});}_0x2129b9=_[_0x7c9a('0x40')]({},_0x2129b9,_0x585570['options']);return _0x17e186[_0x7c9a('0x4b')](_0x2129b9);}})[_0x7c9a('0x27')](function(_0x38ec89){if(_0x38ec89){_0x3eb89=_0x38ec89['length'];if(!_0x585570[_0x7c9a('0x33')][_0x7c9a('0x3a')]('nolimit')){_0x2129b9[_0x7c9a('0x20')]=qs[_0x7c9a('0x20')](_0x585570[_0x7c9a('0x33')][_0x7c9a('0x20')]);_0x2129b9[_0x7c9a('0x1e')]=qs[_0x7c9a('0x1e')](_0x585570[_0x7c9a('0x33')][_0x7c9a('0x1e')]);}return _0x17e186[_0x7c9a('0x4b')](_0x2129b9);}})[_0x7c9a('0x27')](function(_0x14f9ea){if(_0x14f9ea){return _0x14f9ea?{'count':_0x3eb89,'rows':_0x14f9ea}:null;}})[_0x7c9a('0x27')](respondWithResult(_0x5557b5,null))['catch'](handleError(_0x5557b5,null));};exports[_0x7c9a('0x4f')]=function(_0x2637d6,_0x9f12ec,_0x15ba71){if(_0x2637d6[_0x7c9a('0x4a')]['id']){delete _0x2637d6[_0x7c9a('0x4a')]['id'];}return db[_0x7c9a('0x2e')]['findOne']({'where':{'id':_0x2637d6[_0x7c9a('0x48')]['id']}})['then'](handleEntityNotFound(_0x9f12ec,null))[_0x7c9a('0x27')](function(_0x9532e8){if(_0x9532e8){_0x2637d6[_0x7c9a('0x4a')][_0x7c9a('0x50')]=_0x9532e8['id'];_0x2637d6[_0x7c9a('0x4a')][_0x7c9a('0x51')]=integrations[_0x7c9a('0x52')](_0x2637d6[_0x7c9a('0x4a')]['channel'],_0x2637d6[_0x7c9a('0x4a')][_0x7c9a('0x31')]);_0x2637d6['body'][_0x7c9a('0x53')]=integrations[_0x7c9a('0x54')](_0x2637d6['body'][_0x7c9a('0x55')],_0x2637d6[_0x7c9a('0x4a')][_0x7c9a('0x31')]);return db[_0x7c9a('0x4d')][_0x7c9a('0x56')](_0x2637d6[_0x7c9a('0x4a')],{'include':[{'model':db[_0x7c9a('0x57')],'as':_0x7c9a('0x51')},{'model':db[_0x7c9a('0x57')],'as':'Descriptions'}]});}return null;})[_0x7c9a('0x27')](respondWithResult(_0x9f12ec,null))[_0x7c9a('0x47')](handleError(_0x9f12ec,null));};exports['getFields']=function(_0x335eaa,_0x607e42,_0x4b3a5a){var _0x4ac42f=[{'name':_0x7c9a('0x58'),'label':_0x7c9a('0x58'),'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 _0x1f42c1='';return db[_0x7c9a('0x2e')][_0x7c9a('0x4c')]({'where':{'id':_0x335eaa[_0x7c9a('0x48')]['id']},'attributes':['id',_0x7c9a('0x59'),_0x7c9a('0x5a'),_0x7c9a('0x5b'),_0x7c9a('0x5c'),_0x7c9a('0x5d'),'consumerSecret','token',_0x7c9a('0x5e')]})[_0x7c9a('0x27')](handleEntityNotFound(_0x607e42,null))[_0x7c9a('0x27')](function(_0x12e550){if(_0x12e550){_0x1f42c1=_0x12e550['remoteUri'];var _0x30095b=_0x1f42c1[_0x7c9a('0x5f')](-0x1);if(_0x30095b==='/'){_0x1f42c1=_0x1f42c1[_0x7c9a('0x60')](0x0,_0x1f42c1['lastIndexOf'](_0x30095b));}var _0x10db36={'method':_0x7c9a('0x61'),'uri':util[_0x7c9a('0x62')](_0x7c9a('0x63'),_0x1f42c1),'headers':{'Content-Type':_0x7c9a('0x64'),'Accept':_0x7c9a('0x64')},'json':!![]};if(_0x12e550[_0x7c9a('0x5a')]===_0x7c9a('0x65')){_0x10db36[_0x7c9a('0x66')][_0x7c9a('0x67')]=util[_0x7c9a('0x62')](_0x7c9a('0x68'),new Buffer(util[_0x7c9a('0x62')](_0x7c9a('0x69'),_0x12e550['username'],_0x12e550['password']))[_0x7c9a('0x6a')](_0x7c9a('0x6b')));}return rp(_0x10db36)[_0x7c9a('0x27')](function(_0x27da00){return _0x4ac42f[_0x7c9a('0x6c')](_[_0x7c9a('0x2d')](_0x27da00['_embedded']['entries'],function(_0x323020){return{'id':_0x323020[_0x7c9a('0x2b')],'name':_0x323020[_0x7c9a('0x2b')],'type':_0x323020[_0x7c9a('0x31')],'active':_0x323020[_0x7c9a('0x6d')],'label':_0x323020[_0x7c9a('0x6e')],'custom':!![]};}));});}})[_0x7c9a('0x27')](function(_0x1032b0){return{'count':_0x1032b0['length'],'rows':_0x1032b0};})[_0x7c9a('0x27')](respondWithResult(_0x607e42,null))[_0x7c9a('0x47')](function(_0x29066e){var _0x1166de=_0x335eaa[_0x7c9a('0x33')]['test']?0x1f4:_0x29066e['statusCode']||0x1f4;logger[_0x7c9a('0x29')](_0x7c9a('0x6f'),'getFields',_0x1166de,JSON[_0x7c9a('0x70')](_0x29066e));delete _0x29066e[_0x7c9a('0x2b')];if(_0x1166de===0x191){_0x1166de=0x190;}_0x607e42[_0x7c9a('0x1b')](_0x1166de)[_0x7c9a('0x2c')](_0x335eaa[_0x7c9a('0x33')][_0x7c9a('0x71')]?{'message':_0x7c9a('0x72'),'statusCode':_0x29066e[_0x7c9a('0x73')]}:_0x29066e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 2fde16d..67c36d3 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 _0xddac=['exports','define','DeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x5e9590,_0x390b30){var _0x3d0ecd=function(_0x4a1738){while(--_0x4a1738){_0x5e9590['push'](_0x5e9590['shift']());}};_0x3d0ecd(++_0x390b30);}(_0xddac,0xfa));var _0xcdda=function(_0x383ff7,_0x5e33a3){_0x383ff7=_0x383ff7-0x0;var _0x5d2576=_0xddac[_0x383ff7];return _0x5d2576;};'use strict';var _=require(_0xcdda('0x0'));var util=require(_0xcdda('0x1'));var logger=require(_0xcdda('0x2'))(_0xcdda('0x3'));var moment=require(_0xcdda('0x4'));var BPromise=require(_0xcdda('0x5'));var rp=require(_0xcdda('0x6'));var fs=require('fs');var path=require(_0xcdda('0x7'));var rimraf=require('rimraf');var config=require(_0xcdda('0x8'));var attributes=require(_0xcdda('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xcdda('0xa')]=function(_0x4a12ea,_0x807be4){return _0x4a12ea[_0xcdda('0xb')](_0xcdda('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9161=['DeskAccount','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9161,0x90));var _0x1916=function(_0x300f50,_0x517ea4){_0x300f50=_0x300f50-0x0;var _0x23a387=_0x9161[_0x300f50];return _0x23a387;};'use strict';var _=require(_0x1916('0x0'));var util=require(_0x1916('0x1'));var logger=require(_0x1916('0x2'))(_0x1916('0x3'));var moment=require('moment');var BPromise=require(_0x1916('0x4'));var rp=require(_0x1916('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1916('0x6'));var attributes=require(_0x1916('0x7'));var integrations=require(_0x1916('0x8'));module['exports']=function(_0x63c432,_0x563e64){return _0x63c432[_0x1916('0x9')](_0x1916('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 1aa0113..6daca71 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 _0xa5b1=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','raw','where','attributes','include','model','map','GetDeskAccount','DeskAccount','find','ShowDeskAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x4e380c,_0x321a2d){var _0x2e0d40=function(_0x51e140){while(--_0x51e140){_0x4e380c['push'](_0x4e380c['shift']());}};_0x2e0d40(++_0x321a2d);}(_0xa5b1,0xda));var _0x1a5b=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0xa5b1[_0x50cc54];return _0x28ecca;};'use strict';var _=require(_0x1a5b('0x0'));var util=require(_0x1a5b('0x1'));var moment=require(_0x1a5b('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a5b('0x3'));var fs=require('fs');var Redis=require(_0x1a5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5b('0x5'));var logger=require(_0x1a5b('0x6'))(_0x1a5b('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a5b('0x8'));var client=jayson['client'][_0x1a5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24c091,_0x4fd8cd,_0x51e6ae){return new BPromise(function(_0x30e4b4,_0x3049e6){return client[_0x1a5b('0xa')](_0x24c091,_0x51e6ae)[_0x1a5b('0xb')](function(_0x3aa4f2){logger[_0x1a5b('0xc')](_0x1a5b('0xd'),_0x4fd8cd,_0x1a5b('0xe'));logger[_0x1a5b('0xf')](_0x1a5b('0x10'),_0x4fd8cd,'request\x20sent',JSON[_0x1a5b('0x11')](_0x3aa4f2));if(_0x3aa4f2['error']){if(_0x3aa4f2[_0x1a5b('0x12')][_0x1a5b('0x13')]===0x1f4){logger['error'](_0x1a5b('0xd'),_0x4fd8cd,_0x3aa4f2[_0x1a5b('0x12')]['message']);return _0x3049e6(_0x3aa4f2['error'][_0x1a5b('0x14')]);}logger['error'](_0x1a5b('0xd'),_0x4fd8cd,_0x3aa4f2['error']['message']);return _0x30e4b4(_0x3aa4f2['error'][_0x1a5b('0x14')]);}else{logger[_0x1a5b('0xc')](_0x1a5b('0xd'),_0x4fd8cd,'request\x20sent');_0x30e4b4(_0x3aa4f2['result']['message']);}})['catch'](function(_0x494cd0){logger['error'](_0x1a5b('0xd'),_0x4fd8cd,_0x494cd0);_0x3049e6(_0x494cd0);});});}exports['GetDeskAccount']=function(_0x45893b){var _0x2eae93=this;return new Promise(function(_0x4ada26,_0x2a66b9){return db['DeskAccount'][_0x1a5b('0x15')]({'raw':_0x45893b[_0x1a5b('0x16')]?_0x45893b['options'][_0x1a5b('0x17')]===undefined?!![]:![]:!![],'where':_0x45893b[_0x1a5b('0x16')]?_0x45893b[_0x1a5b('0x16')][_0x1a5b('0x18')]||null:null,'attributes':_0x45893b[_0x1a5b('0x16')]?_0x45893b[_0x1a5b('0x16')][_0x1a5b('0x19')]||null:null,'limit':_0x45893b[_0x1a5b('0x16')]?_0x45893b[_0x1a5b('0x16')]['limit']||null:null,'include':_0x45893b[_0x1a5b('0x16')]?_0x45893b[_0x1a5b('0x16')]['include']?_['map'](_0x45893b[_0x1a5b('0x16')][_0x1a5b('0x1a')],function(_0x4c6f16){return{'model':db[_0x4c6f16[_0x1a5b('0x1b')]],'as':_0x4c6f16['as'],'attributes':_0x4c6f16[_0x1a5b('0x19')],'include':_0x4c6f16[_0x1a5b('0x1a')]?_[_0x1a5b('0x1c')](_0x4c6f16[_0x1a5b('0x1a')],function(_0x3724b5){return{'model':db[_0x3724b5[_0x1a5b('0x1b')]],'as':_0x3724b5['as'],'attributes':_0x3724b5['attributes'],'include':_0x3724b5[_0x1a5b('0x1a')]?_['map'](_0x3724b5['include'],function(_0x4dd73d){return{'model':db[_0x4dd73d[_0x1a5b('0x1b')]],'as':_0x4dd73d['as'],'attributes':_0x4dd73d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a5b('0xb')](function(_0x41ffb0){logger['info'](_0x1a5b('0x1d'),_0x45893b);logger[_0x1a5b('0xf')](_0x1a5b('0x1d'),_0x45893b,JSON['stringify'](_0x41ffb0));_0x4ada26(_0x41ffb0);})['catch'](function(_0x4d430e){logger[_0x1a5b('0x12')](_0x1a5b('0x1d'),_0x4d430e[_0x1a5b('0x14')],_0x45893b);_0x2a66b9(_0x2eae93[_0x1a5b('0x12')](0x1f4,_0x4d430e[_0x1a5b('0x14')]));});});};exports['ShowDeskAccount']=function(_0x18131e){var _0x441a86=this;return new Promise(function(_0x20e34a,_0x5b947d){return db[_0x1a5b('0x1e')][_0x1a5b('0x1f')]({'raw':_0x18131e[_0x1a5b('0x16')]?_0x18131e['options'][_0x1a5b('0x17')]===undefined?!![]:![]:!![],'where':_0x18131e[_0x1a5b('0x16')]?_0x18131e[_0x1a5b('0x16')][_0x1a5b('0x18')]||null:null,'attributes':_0x18131e[_0x1a5b('0x16')]?_0x18131e['options']['attributes']||null:null,'include':_0x18131e[_0x1a5b('0x16')]?_0x18131e[_0x1a5b('0x16')][_0x1a5b('0x1a')]?_[_0x1a5b('0x1c')](_0x18131e['options'][_0x1a5b('0x1a')],function(_0x3f77a9){return{'model':db[_0x3f77a9[_0x1a5b('0x1b')]],'as':_0x3f77a9['as'],'attributes':_0x3f77a9[_0x1a5b('0x19')],'include':_0x3f77a9[_0x1a5b('0x1a')]?_[_0x1a5b('0x1c')](_0x3f77a9[_0x1a5b('0x1a')],function(_0x52801f){return{'model':db[_0x52801f['model']],'as':_0x52801f['as'],'attributes':_0x52801f['attributes'],'include':_0x52801f[_0x1a5b('0x1a')]?_[_0x1a5b('0x1c')](_0x52801f[_0x1a5b('0x1a')],function(_0x29a318){return{'model':db[_0x29a318[_0x1a5b('0x1b')]],'as':_0x29a318['as'],'attributes':_0x29a318[_0x1a5b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1a5b('0xb')](function(_0x469a31){logger[_0x1a5b('0xc')](_0x1a5b('0x20'),_0x18131e);logger[_0x1a5b('0xf')](_0x1a5b('0x20'),_0x18131e,JSON['stringify'](_0x469a31));_0x20e34a(_0x469a31);})['catch'](function(_0x368a4){logger['error']('ShowDeskAccount',_0x368a4[_0x1a5b('0x14')],_0x18131e);_0x5b947d(_0x441a86[_0x1a5b('0x12')](0x1f4,_0x368a4[_0x1a5b('0x14')]));});});}; \ No newline at end of file +var _0xf3b4=['info','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','catch','DeskAccount','options','attributes','limit','include','map','model','then','GetDeskAccount','debug','ShowDeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3727c4,_0x33a964){var _0x9d46ea=function(_0x43719b){while(--_0x43719b){_0x3727c4['push'](_0x3727c4['shift']());}};_0x9d46ea(++_0x33a964);}(_0xf3b4,0x174));var _0x4f3b=function(_0x4f4420,_0x463712){_0x4f4420=_0x4f4420-0x0;var _0x3ac414=_0xf3b4[_0x4f4420];return _0x3ac414;};'use strict';var _=require('lodash');var util=require(_0x4f3b('0x0'));var moment=require(_0x4f3b('0x1'));var BPromise=require(_0x4f3b('0x2'));var rs=require(_0x4f3b('0x3'));var fs=require('fs');var Redis=require(_0x4f3b('0x4'));var db=require(_0x4f3b('0x5'))['db'];var utils=require(_0x4f3b('0x6'));var logger=require(_0x4f3b('0x7'))(_0x4f3b('0x8'));var config=require(_0x4f3b('0x9'));var jayson=require(_0x4f3b('0xa'));var client=jayson['client'][_0x4f3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x217b05,_0x4bf2f4,_0x4f35ce){return new BPromise(function(_0x2b2ed8,_0x18b901){return client[_0x4f3b('0xc')](_0x217b05,_0x4f35ce)['then'](function(_0x809779){logger[_0x4f3b('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4bf2f4,'request\x20sent');logger['debug'](_0x4f3b('0xe'),_0x4bf2f4,_0x4f3b('0xf'),JSON[_0x4f3b('0x10')](_0x809779));if(_0x809779[_0x4f3b('0x11')]){if(_0x809779[_0x4f3b('0x11')][_0x4f3b('0x12')]===0x1f4){logger[_0x4f3b('0x11')](_0x4f3b('0x13'),_0x4bf2f4,_0x809779[_0x4f3b('0x11')][_0x4f3b('0x14')]);return _0x18b901(_0x809779[_0x4f3b('0x11')]['message']);}logger[_0x4f3b('0x11')](_0x4f3b('0x13'),_0x4bf2f4,_0x809779[_0x4f3b('0x11')][_0x4f3b('0x14')]);return _0x2b2ed8(_0x809779[_0x4f3b('0x11')][_0x4f3b('0x14')]);}else{logger['info'](_0x4f3b('0x13'),_0x4bf2f4,'request\x20sent');_0x2b2ed8(_0x809779['result'][_0x4f3b('0x14')]);}})[_0x4f3b('0x15')](function(_0xc8fa0a){logger[_0x4f3b('0x11')](_0x4f3b('0x13'),_0x4bf2f4,_0xc8fa0a);_0x18b901(_0xc8fa0a);});});}exports['GetDeskAccount']=function(_0x272e81){var _0x225907=this;return new Promise(function(_0x3c9eb1,_0x55a215){return db[_0x4f3b('0x16')]['findAll']({'raw':_0x272e81[_0x4f3b('0x17')]?_0x272e81['options']['raw']===undefined?!![]:![]:!![],'where':_0x272e81[_0x4f3b('0x17')]?_0x272e81[_0x4f3b('0x17')]['where']||null:null,'attributes':_0x272e81['options']?_0x272e81['options'][_0x4f3b('0x18')]||null:null,'limit':_0x272e81[_0x4f3b('0x17')]?_0x272e81[_0x4f3b('0x17')][_0x4f3b('0x19')]||null:null,'include':_0x272e81[_0x4f3b('0x17')]?_0x272e81['options'][_0x4f3b('0x1a')]?_[_0x4f3b('0x1b')](_0x272e81['options']['include'],function(_0xb3de0){return{'model':db[_0xb3de0[_0x4f3b('0x1c')]],'as':_0xb3de0['as'],'attributes':_0xb3de0['attributes'],'include':_0xb3de0[_0x4f3b('0x1a')]?_[_0x4f3b('0x1b')](_0xb3de0[_0x4f3b('0x1a')],function(_0x589b35){return{'model':db[_0x589b35[_0x4f3b('0x1c')]],'as':_0x589b35['as'],'attributes':_0x589b35[_0x4f3b('0x18')],'include':_0x589b35['include']?_[_0x4f3b('0x1b')](_0x589b35[_0x4f3b('0x1a')],function(_0x73dcf3){return{'model':db[_0x73dcf3[_0x4f3b('0x1c')]],'as':_0x73dcf3['as'],'attributes':_0x73dcf3[_0x4f3b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4f3b('0x1d')](function(_0x5cf694){logger[_0x4f3b('0xd')](_0x4f3b('0x1e'),_0x272e81);logger[_0x4f3b('0x1f')]('GetDeskAccount',_0x272e81,JSON[_0x4f3b('0x10')](_0x5cf694));_0x3c9eb1(_0x5cf694);})[_0x4f3b('0x15')](function(_0x1cef0d){logger[_0x4f3b('0x11')](_0x4f3b('0x1e'),_0x1cef0d['message'],_0x272e81);_0x55a215(_0x225907[_0x4f3b('0x11')](0x1f4,_0x1cef0d[_0x4f3b('0x14')]));});});};exports[_0x4f3b('0x20')]=function(_0x43960a){var _0x40ac34=this;return new Promise(function(_0x1111a8,_0x5a2593){return db[_0x4f3b('0x16')][_0x4f3b('0x21')]({'raw':_0x43960a[_0x4f3b('0x17')]?_0x43960a[_0x4f3b('0x17')][_0x4f3b('0x22')]===undefined?!![]:![]:!![],'where':_0x43960a['options']?_0x43960a[_0x4f3b('0x17')]['where']||null:null,'attributes':_0x43960a[_0x4f3b('0x17')]?_0x43960a['options']['attributes']||null:null,'include':_0x43960a[_0x4f3b('0x17')]?_0x43960a[_0x4f3b('0x17')][_0x4f3b('0x1a')]?_[_0x4f3b('0x1b')](_0x43960a['options'][_0x4f3b('0x1a')],function(_0x52751d){return{'model':db[_0x52751d[_0x4f3b('0x1c')]],'as':_0x52751d['as'],'attributes':_0x52751d['attributes'],'include':_0x52751d[_0x4f3b('0x1a')]?_[_0x4f3b('0x1b')](_0x52751d['include'],function(_0x1aac8b){return{'model':db[_0x1aac8b['model']],'as':_0x1aac8b['as'],'attributes':_0x1aac8b[_0x4f3b('0x18')],'include':_0x1aac8b['include']?_[_0x4f3b('0x1b')](_0x1aac8b['include'],function(_0x110031){return{'model':db[_0x110031[_0x4f3b('0x1c')]],'as':_0x110031['as'],'attributes':_0x110031['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f3b('0x1d')](function(_0x34c233){logger[_0x4f3b('0xd')](_0x4f3b('0x20'),_0x43960a);logger['debug'](_0x4f3b('0x20'),_0x43960a,JSON['stringify'](_0x34c233));_0x1111a8(_0x34c233);})[_0x4f3b('0x15')](function(_0x4d0ba2){logger[_0x4f3b('0x11')](_0x4f3b('0x20'),_0x4d0ba2['message'],_0x43960a);_0x5a2593(_0x40ac34[_0x4f3b('0x11')](0x1f4,_0x4d0ba2[_0x4f3b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index e09981e..ff20414 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x3fd531,_0x538738){var _0x5bd9db=function(_0x676411){while(--_0x676411){_0x3fd531['push'](_0x3fd531['shift']());}};_0x5bd9db(++_0x538738);}(_0x55ca,0x126));var _0xa55c=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x55ca[_0x456b57];return _0x18f49f;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +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(_0x349964,_0x15ed64){var _0x39c82e=function(_0x977f22){while(--_0x977f22){_0x349964['push'](_0x349964['shift']());}};_0x39c82e(++_0x15ed64);}(_0xedd9,0xfc));var _0x9edd=function(_0x23e4b9,_0x5410bd){_0x23e4b9=_0x23e4b9-0x0;var _0x87ca8c=_0xedd9[_0x23e4b9];return _0x87ca8c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 30a35a8..c17688c 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 _0x2e2f=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e2f,0x194));var _0xf2e2=function(_0x455ed5,_0xab57cc){_0x455ed5=_0x455ed5-0x0;var _0x481ac4=_0x2e2f[_0x455ed5];return _0x481ac4;};'use strict';var Sequelize=require(_0xf2e2('0x0'));module[_0xf2e2('0x1')]={'name':{'type':Sequelize[_0xf2e2('0x2')]},'description':{'type':Sequelize[_0xf2e2('0x2')]}}; \ No newline at end of file +var _0x3c16=['exports','STRING'];(function(_0x30b8ce,_0x3a8718){var _0x2fb314=function(_0x6c0684){while(--_0x6c0684){_0x30b8ce['push'](_0x30b8ce['shift']());}};_0x2fb314(++_0x3a8718);}(_0x3c16,0x96));var _0x63c1=function(_0x2dee32,_0x1c04e0){_0x2dee32=_0x2dee32-0x0;var _0x1b1419=_0x3c16[_0x2dee32];return _0x1b1419;};'use strict';var Sequelize=require('sequelize');module[_0x63c1('0x0')]={'name':{'type':Sequelize[_0x63c1('0x1')]},'description':{'type':Sequelize[_0x63c1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7c1dcd1..6d51852 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 _0xef5f=['catch','show','find','create','update','body','params','destroy','getFields','findOne','DeskField','rawAttributes','pick','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','end','error','stack','name','send','index','map','DeskConfiguration','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x54f806,_0x3fb549){var _0xa3a374=function(_0x378c5b){while(--_0x378c5b){_0x54f806['push'](_0x54f806['shift']());}};_0xa3a374(++_0x3fb549);}(_0xef5f,0x174));var _0xfef5=function(_0xd34075,_0x1e15f2){_0xd34075=_0xd34075-0x0;var _0x40468e=_0xef5f[_0xd34075];return _0x40468e;};'use strict';var emlformat=require(_0xfef5('0x0'));var rimraf=require(_0xfef5('0x1'));var zipdir=require(_0xfef5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfef5('0x3'));var moment=require(_0xfef5('0x4'));var BPromise=require(_0xfef5('0x5'));var Mustache=require(_0xfef5('0x6'));var util=require(_0xfef5('0x7'));var path=require(_0xfef5('0x8'));var sox=require('sox');var csv=require(_0xfef5('0x9'));var ejs=require(_0xfef5('0xa'));var fs=require('fs');var fs_extra=require(_0xfef5('0xb'));var _=require('lodash');var squel=require(_0xfef5('0xc'));var crypto=require(_0xfef5('0xd'));var jsforce=require(_0xfef5('0xe'));var deskjs=require(_0xfef5('0xf'));var toCsv=require(_0xfef5('0x9'));var querystring=require(_0xfef5('0x10'));var Papa=require(_0xfef5('0x11'));var Redis=require(_0xfef5('0x12'));var authService=require(_0xfef5('0x13'));var qs=require(_0xfef5('0x14'));var as=require(_0xfef5('0x15'));var hardwareService=require(_0xfef5('0x16'));var logger=require(_0xfef5('0x17'))('api');var utils=require(_0xfef5('0x18'));var config=require(_0xfef5('0x19'));var licenseUtil=require(_0xfef5('0x1a'));var db=require(_0xfef5('0x1b'))['db'];function respondWithStatusCode(_0x1084ed,_0x454f39){_0x454f39=_0x454f39||0xcc;return function(_0x248caf){if(_0x248caf){return _0x1084ed[_0xfef5('0x1c')](_0x454f39);}return _0x1084ed[_0xfef5('0x1d')](_0x454f39)['end']();};}function respondWithResult(_0x422950,_0x20739b){_0x20739b=_0x20739b||0xc8;return function(_0x2114b3){if(_0x2114b3){return _0x422950[_0xfef5('0x1d')](_0x20739b)[_0xfef5('0x1e')](_0x2114b3);}};}function respondWithFilteredResult(_0xcd068e,_0x45f7b1){return function(_0xb963b3){if(_0xb963b3){var _0x295067=typeof _0x45f7b1[_0xfef5('0x1f')]===_0xfef5('0x20')&&typeof _0x45f7b1[_0xfef5('0x21')]===_0xfef5('0x20');var _0xdcc5f=_0xb963b3[_0xfef5('0x22')];var _0x20d46e=_0x295067?0x0:_0x45f7b1['offset'];var _0x2b0c11=_0x295067?_0xb963b3[_0xfef5('0x22')]:_0x45f7b1[_0xfef5('0x1f')]+_0x45f7b1[_0xfef5('0x21')];var _0x1a05d8;if(_0x2b0c11>=_0xdcc5f){_0x2b0c11=_0xdcc5f;_0x1a05d8=0xc8;}else{_0x1a05d8=0xce;}_0xcd068e[_0xfef5('0x1d')](_0x1a05d8);return _0xcd068e[_0xfef5('0x23')](_0xfef5('0x24'),_0x20d46e+'-'+_0x2b0c11+'/'+_0xdcc5f)[_0xfef5('0x1e')](_0xb963b3);}return null;};}function patchUpdates(_0x34330f){return function(_0x1e7204){try{jsonpatch['apply'](_0x1e7204,_0x34330f,!![]);}catch(_0x5a2b7d){return BPromise[_0xfef5('0x25')](_0x5a2b7d);}return _0x1e7204['save']();};}function saveUpdates(_0x578091,_0x5f130e){return function(_0x16f5b0){if(_0x16f5b0){return _0x16f5b0['update'](_0x578091)[_0xfef5('0x26')](function(_0x2b6da3){return _0x2b6da3;});}return null;};}function removeEntity(_0x1cd8c1,_0x29cb7e){return function(_0x21f68d){if(_0x21f68d){return _0x21f68d['destroy']()['then'](function(){_0x1cd8c1[_0xfef5('0x1d')](0xcc)[_0xfef5('0x27')]();});}};}function handleEntityNotFound(_0x480a66,_0x48287c){return function(_0x400c5f){if(!_0x400c5f){_0x480a66[_0xfef5('0x1c')](0x194);}return _0x400c5f;};}function handleError(_0x51ca01,_0x4c25c2){_0x4c25c2=_0x4c25c2||0x1f4;return function(_0x28bc73){logger[_0xfef5('0x28')](_0x28bc73[_0xfef5('0x29')]);if(_0x28bc73['name']){delete _0x28bc73[_0xfef5('0x2a')];}_0x51ca01[_0xfef5('0x1d')](_0x4c25c2)[_0xfef5('0x2b')](_0x28bc73);};}exports[_0xfef5('0x2c')]=function(_0x2efc2f,_0x62e097){var _0x2001da={},_0x2ee125={},_0x96e558={'count':0x0,'rows':[]};var _0x497af8=_[_0xfef5('0x2d')](db[_0xfef5('0x2e')]['rawAttributes'],function(_0x59cc06){return{'name':_0x59cc06['fieldName'],'type':_0x59cc06[_0xfef5('0x2f')][_0xfef5('0x30')]};});_0x2ee125[_0xfef5('0x31')]=_[_0xfef5('0x2d')](_0x497af8,_0xfef5('0x2a'));_0x2ee125[_0xfef5('0x32')]=_[_0xfef5('0x33')](_0x2efc2f[_0xfef5('0x32')]);_0x2ee125['filters']=_['intersection'](_0x2ee125['model'],_0x2ee125[_0xfef5('0x32')]);_0x2001da[_0xfef5('0x34')]=_[_0xfef5('0x35')](_0x2ee125[_0xfef5('0x31')],qs[_0xfef5('0x36')](_0x2efc2f['query'][_0xfef5('0x36')]));_0x2001da[_0xfef5('0x34')]=_0x2001da[_0xfef5('0x34')][_0xfef5('0x37')]?_0x2001da['attributes']:_0x2ee125['model'];if(!_0x2efc2f[_0xfef5('0x32')]['hasOwnProperty'](_0xfef5('0x38'))){_0x2001da[_0xfef5('0x21')]=qs[_0xfef5('0x21')](_0x2efc2f['query'][_0xfef5('0x21')]);_0x2001da[_0xfef5('0x1f')]=qs[_0xfef5('0x1f')](_0x2efc2f['query'][_0xfef5('0x1f')]);}_0x2001da[_0xfef5('0x39')]=qs['sort'](_0x2efc2f['query'][_0xfef5('0x3a')]);_0x2001da[_0xfef5('0x3b')]=qs['filters'](_['pick'](_0x2efc2f[_0xfef5('0x32')],_0x2ee125[_0xfef5('0x3c')]),_0x497af8);if(_0x2efc2f[_0xfef5('0x32')][_0xfef5('0x3d')]){_0x2001da[_0xfef5('0x3b')]=_['merge'](_0x2001da[_0xfef5('0x3b')],{'$or':_[_0xfef5('0x2d')](_0x497af8,function(_0x11a475){if(_0x11a475[_0xfef5('0x2f')]!==_0xfef5('0x3e')){var _0x1cffed={};_0x1cffed[_0x11a475['name']]={'$like':'%'+_0x2efc2f[_0xfef5('0x32')][_0xfef5('0x3d')]+'%'};return _0x1cffed;}})});}_0x2001da=_[_0xfef5('0x3f')]({},_0x2001da,_0x2efc2f[_0xfef5('0x40')]);var _0xbbfec8={'where':_0x2001da[_0xfef5('0x3b')]};return db[_0xfef5('0x2e')][_0xfef5('0x22')](_0xbbfec8)['then'](function(_0x1f429f){_0x96e558[_0xfef5('0x22')]=_0x1f429f;if(_0x2efc2f[_0xfef5('0x32')][_0xfef5('0x41')]){_0x2001da[_0xfef5('0x42')]=[{'all':!![]}];}return db[_0xfef5('0x2e')][_0xfef5('0x43')](_0x2001da);})['then'](function(_0x284934){_0x96e558['rows']=_0x284934;return _0x96e558;})['then'](respondWithFilteredResult(_0x62e097,_0x2001da))[_0xfef5('0x44')](handleError(_0x62e097,null));};exports[_0xfef5('0x45')]=function(_0x4edb1c,_0x33ae0c){var _0x594d3c={'raw':![],'where':{'id':_0x4edb1c['params']['id']}},_0x4a06b7={};_0x4a06b7[_0xfef5('0x31')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x4a06b7[_0xfef5('0x32')]=_[_0xfef5('0x33')](_0x4edb1c[_0xfef5('0x32')]);_0x4a06b7[_0xfef5('0x3c')]=_[_0xfef5('0x35')](_0x4a06b7[_0xfef5('0x31')],_0x4a06b7[_0xfef5('0x32')]);_0x594d3c['attributes']=_[_0xfef5('0x35')](_0x4a06b7[_0xfef5('0x31')],qs[_0xfef5('0x36')](_0x4edb1c[_0xfef5('0x32')][_0xfef5('0x36')]));_0x594d3c[_0xfef5('0x34')]=_0x594d3c[_0xfef5('0x34')]['length']?_0x594d3c[_0xfef5('0x34')]:_0x4a06b7[_0xfef5('0x31')];if(_0x4edb1c[_0xfef5('0x32')][_0xfef5('0x41')]){_0x594d3c[_0xfef5('0x42')]=[{'all':!![]}];}_0x594d3c=_[_0xfef5('0x3f')]({},_0x594d3c,_0x4edb1c['options']);return db['DeskConfiguration'][_0xfef5('0x46')](_0x594d3c)[_0xfef5('0x26')](handleEntityNotFound(_0x33ae0c,null))[_0xfef5('0x26')](respondWithResult(_0x33ae0c,null))['catch'](handleError(_0x33ae0c,null));};exports['create']=function(_0x25f68e,_0x34ec91){return db[_0xfef5('0x2e')][_0xfef5('0x47')](_0x25f68e['body'],{})[_0xfef5('0x26')](respondWithResult(_0x34ec91,0xc9))[_0xfef5('0x44')](handleError(_0x34ec91,null));};exports[_0xfef5('0x48')]=function(_0x3ba37a,_0x22f29a){if(_0x3ba37a[_0xfef5('0x49')]['id']){delete _0x3ba37a[_0xfef5('0x49')]['id'];}return db['DeskConfiguration'][_0xfef5('0x46')]({'where':{'id':_0x3ba37a[_0xfef5('0x4a')]['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0x22f29a,null))[_0xfef5('0x26')](saveUpdates(_0x3ba37a[_0xfef5('0x49')],null))[_0xfef5('0x26')](respondWithResult(_0x22f29a,null))['catch'](handleError(_0x22f29a,null));};exports[_0xfef5('0x4b')]=function(_0x501a24,_0x41cdd7){return db[_0xfef5('0x2e')][_0xfef5('0x46')]({'where':{'id':_0x501a24['params']['id']}})['then'](handleEntityNotFound(_0x41cdd7,null))[_0xfef5('0x26')](removeEntity(_0x41cdd7,null))[_0xfef5('0x44')](handleError(_0x41cdd7,null));};exports[_0xfef5('0x4c')]=function(_0x37e6ce,_0x1e580d,_0x5d5bd1){var _0x201cf6={};var _0x4a3357={};var _0x427712;var _0x1ff6ca;return db[_0xfef5('0x2e')][_0xfef5('0x4d')]({'where':{'id':_0x37e6ce['params']['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0x1e580d,null))[_0xfef5('0x26')](function(_0x54aa97){if(_0x54aa97){_0x427712=_0x54aa97;_0x4a3357['model']=_[_0xfef5('0x33')](db[_0xfef5('0x4e')][_0xfef5('0x4f')]);_0x4a3357[_0xfef5('0x32')]=_[_0xfef5('0x33')](_0x37e6ce['query']);_0x4a3357[_0xfef5('0x3c')]=_['intersection'](_0x4a3357['model'],_0x4a3357[_0xfef5('0x32')]);_0x201cf6[_0xfef5('0x34')]=_[_0xfef5('0x35')](_0x4a3357[_0xfef5('0x31')],qs[_0xfef5('0x36')](_0x37e6ce[_0xfef5('0x32')][_0xfef5('0x36')]));_0x201cf6[_0xfef5('0x34')]=_0x201cf6[_0xfef5('0x34')][_0xfef5('0x37')]?_0x201cf6['attributes']:_0x4a3357[_0xfef5('0x31')];_0x201cf6[_0xfef5('0x39')]=qs[_0xfef5('0x3a')](_0x37e6ce[_0xfef5('0x32')][_0xfef5('0x3a')]);_0x201cf6[_0xfef5('0x3b')]=qs['filters'](_[_0xfef5('0x50')](_0x37e6ce[_0xfef5('0x32')],_0x4a3357[_0xfef5('0x3c')]));if(_0x37e6ce['query'][_0xfef5('0x3d')]){_0x201cf6[_0xfef5('0x3b')]=_[_0xfef5('0x3f')](_0x201cf6[_0xfef5('0x3b')],{'$or':_[_0xfef5('0x2d')](_0x201cf6[_0xfef5('0x34')],function(_0xae8071){var _0x4a2fa5={};_0x4a2fa5[_0xae8071]={'$like':'%'+_0x37e6ce[_0xfef5('0x32')][_0xfef5('0x3d')]+'%'};return _0x4a2fa5;})});}_0x201cf6=_[_0xfef5('0x3f')]({},_0x201cf6,_0x37e6ce['options']);return _0x427712[_0xfef5('0x4c')](_0x201cf6);}})[_0xfef5('0x26')](function(_0x3ce32e){if(_0x3ce32e){_0x1ff6ca=_0x3ce32e[_0xfef5('0x37')];if(!_0x37e6ce[_0xfef5('0x32')]['hasOwnProperty']('nolimit')){_0x201cf6[_0xfef5('0x21')]=qs[_0xfef5('0x21')](_0x37e6ce[_0xfef5('0x32')][_0xfef5('0x21')]);_0x201cf6[_0xfef5('0x1f')]=qs[_0xfef5('0x1f')](_0x37e6ce['query'][_0xfef5('0x1f')]);}return _0x427712[_0xfef5('0x4c')](_0x201cf6);}})[_0xfef5('0x26')](function(_0x2661f1){if(_0x2661f1){return _0x2661f1?{'count':_0x1ff6ca,'rows':_0x2661f1}:null;}})['then'](respondWithResult(_0x1e580d,null))[_0xfef5('0x44')](handleError(_0x1e580d,null));};exports[_0xfef5('0x51')]=function(_0x284f47,_0x26eeb1,_0x379223){var _0x2f5b42={};var _0xb74d59={};var _0x62755c;var _0x5d4b66;return db[_0xfef5('0x2e')][_0xfef5('0x4d')]({'where':{'id':_0x284f47[_0xfef5('0x4a')]['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0x26eeb1,null))[_0xfef5('0x26')](function(_0x3f4691){if(_0x3f4691){_0x62755c=_0x3f4691;_0xb74d59[_0xfef5('0x31')]=_[_0xfef5('0x33')](db['DeskField'][_0xfef5('0x4f')]);_0xb74d59[_0xfef5('0x32')]=_[_0xfef5('0x33')](_0x284f47['query']);_0xb74d59[_0xfef5('0x3c')]=_['intersection'](_0xb74d59[_0xfef5('0x31')],_0xb74d59['query']);_0x2f5b42['attributes']=_[_0xfef5('0x35')](_0xb74d59[_0xfef5('0x31')],qs[_0xfef5('0x36')](_0x284f47[_0xfef5('0x32')]['fields']));_0x2f5b42['attributes']=_0x2f5b42['attributes'][_0xfef5('0x37')]?_0x2f5b42['attributes']:_0xb74d59[_0xfef5('0x31')];_0x2f5b42[_0xfef5('0x39')]=qs[_0xfef5('0x3a')](_0x284f47[_0xfef5('0x32')][_0xfef5('0x3a')]);_0x2f5b42[_0xfef5('0x3b')]=qs[_0xfef5('0x3c')](_[_0xfef5('0x50')](_0x284f47[_0xfef5('0x32')],_0xb74d59[_0xfef5('0x3c')]));if(_0x284f47[_0xfef5('0x32')][_0xfef5('0x3d')]){_0x2f5b42['where']=_['merge'](_0x2f5b42['where'],{'$or':_[_0xfef5('0x2d')](_0x2f5b42[_0xfef5('0x34')],function(_0x15755b){var _0x19b9fd={};_0x19b9fd[_0x15755b]={'$like':'%'+_0x284f47[_0xfef5('0x32')][_0xfef5('0x3d')]+'%'};return _0x19b9fd;})});}_0x2f5b42=_['merge']({},_0x2f5b42,_0x284f47[_0xfef5('0x40')]);return _0x62755c[_0xfef5('0x51')](_0x2f5b42);}})[_0xfef5('0x26')](function(_0x337331){if(_0x337331){_0x5d4b66=_0x337331[_0xfef5('0x37')];if(!_0x284f47[_0xfef5('0x32')]['hasOwnProperty']('nolimit')){_0x2f5b42[_0xfef5('0x21')]=qs['limit'](_0x284f47[_0xfef5('0x32')][_0xfef5('0x21')]);_0x2f5b42[_0xfef5('0x1f')]=qs[_0xfef5('0x1f')](_0x284f47[_0xfef5('0x32')][_0xfef5('0x1f')]);}return _0x62755c[_0xfef5('0x51')](_0x2f5b42);}})[_0xfef5('0x26')](function(_0x4d4254){if(_0x4d4254){return _0x4d4254?{'count':_0x5d4b66,'rows':_0x4d4254}:null;}})[_0xfef5('0x26')](respondWithResult(_0x26eeb1,null))['catch'](handleError(_0x26eeb1,null));};exports[_0xfef5('0x52')]=function(_0x32b9de,_0x3c10df,_0x34723c){var _0x18d6e4={};var _0x2b02f0={};var _0x50b8d4;var _0x483e6e;return db[_0xfef5('0x2e')][_0xfef5('0x4d')]({'where':{'id':_0x32b9de['params']['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0x3c10df,null))[_0xfef5('0x26')](function(_0xb387d5){if(_0xb387d5){_0x50b8d4=_0xb387d5;_0x2b02f0[_0xfef5('0x31')]=_['keys'](db['DeskField'][_0xfef5('0x4f')]);_0x2b02f0['query']=_[_0xfef5('0x33')](_0x32b9de['query']);_0x2b02f0[_0xfef5('0x3c')]=_[_0xfef5('0x35')](_0x2b02f0['model'],_0x2b02f0[_0xfef5('0x32')]);_0x18d6e4[_0xfef5('0x34')]=_[_0xfef5('0x35')](_0x2b02f0['model'],qs['fields'](_0x32b9de[_0xfef5('0x32')][_0xfef5('0x36')]));_0x18d6e4['attributes']=_0x18d6e4[_0xfef5('0x34')][_0xfef5('0x37')]?_0x18d6e4[_0xfef5('0x34')]:_0x2b02f0[_0xfef5('0x31')];_0x18d6e4[_0xfef5('0x39')]=qs[_0xfef5('0x3a')](_0x32b9de['query'][_0xfef5('0x3a')]);_0x18d6e4[_0xfef5('0x3b')]=qs[_0xfef5('0x3c')](_['pick'](_0x32b9de['query'],_0x2b02f0['filters']));if(_0x32b9de[_0xfef5('0x32')][_0xfef5('0x3d')]){_0x18d6e4[_0xfef5('0x3b')]=_[_0xfef5('0x3f')](_0x18d6e4[_0xfef5('0x3b')],{'$or':_[_0xfef5('0x2d')](_0x18d6e4[_0xfef5('0x34')],function(_0x31b36c){var _0x25a700={};_0x25a700[_0x31b36c]={'$like':'%'+_0x32b9de[_0xfef5('0x32')][_0xfef5('0x3d')]+'%'};return _0x25a700;})});}_0x18d6e4=_['merge']({},_0x18d6e4,_0x32b9de[_0xfef5('0x40')]);return _0x50b8d4[_0xfef5('0x52')](_0x18d6e4);}})[_0xfef5('0x26')](function(_0x17d046){if(_0x17d046){_0x483e6e=_0x17d046[_0xfef5('0x37')];if(!_0x32b9de[_0xfef5('0x32')][_0xfef5('0x53')]('nolimit')){_0x18d6e4['limit']=qs[_0xfef5('0x21')](_0x32b9de[_0xfef5('0x32')][_0xfef5('0x21')]);_0x18d6e4[_0xfef5('0x1f')]=qs[_0xfef5('0x1f')](_0x32b9de[_0xfef5('0x32')]['offset']);}return _0x50b8d4[_0xfef5('0x52')](_0x18d6e4);}})[_0xfef5('0x26')](function(_0x57019e){if(_0x57019e){return _0x57019e?{'count':_0x483e6e,'rows':_0x57019e}:null;}})[_0xfef5('0x26')](respondWithResult(_0x3c10df,null))['catch'](handleError(_0x3c10df,null));};exports[_0xfef5('0x54')]=function(_0x562541,_0x5324fe,_0x53be40){var _0x56d3d5={};var _0x149497={};var _0x4a7b7c;var _0x3dd583;return db['DeskConfiguration'][_0xfef5('0x4d')]({'where':{'id':_0x562541['params']['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0x5324fe,null))[_0xfef5('0x26')](function(_0x3414c4){if(_0x3414c4){_0x4a7b7c=_0x3414c4;_0x149497[_0xfef5('0x31')]=_[_0xfef5('0x33')](db[_0xfef5('0x55')][_0xfef5('0x4f')]);_0x149497[_0xfef5('0x32')]=_[_0xfef5('0x33')](_0x562541[_0xfef5('0x32')]);_0x149497[_0xfef5('0x3c')]=_['intersection'](_0x149497[_0xfef5('0x31')],_0x149497[_0xfef5('0x32')]);_0x56d3d5[_0xfef5('0x34')]=_['intersection'](_0x149497[_0xfef5('0x31')],qs[_0xfef5('0x36')](_0x562541['query'][_0xfef5('0x36')]));_0x56d3d5[_0xfef5('0x34')]=_0x56d3d5[_0xfef5('0x34')]['length']?_0x56d3d5['attributes']:_0x149497['model'];_0x56d3d5['order']=qs['sort'](_0x562541[_0xfef5('0x32')][_0xfef5('0x3a')]);_0x56d3d5['where']=qs[_0xfef5('0x3c')](_['pick'](_0x562541[_0xfef5('0x32')],_0x149497[_0xfef5('0x3c')]));if(_0x562541[_0xfef5('0x32')][_0xfef5('0x3d')]){_0x56d3d5[_0xfef5('0x3b')]=_[_0xfef5('0x3f')](_0x56d3d5[_0xfef5('0x3b')],{'$or':_[_0xfef5('0x2d')](_0x56d3d5[_0xfef5('0x34')],function(_0x2bb62){var _0x5a4a2f={};_0x5a4a2f[_0x2bb62]={'$like':'%'+_0x562541[_0xfef5('0x32')][_0xfef5('0x3d')]+'%'};return _0x5a4a2f;})});}_0x56d3d5=_[_0xfef5('0x3f')]({},_0x56d3d5,_0x562541[_0xfef5('0x40')]);return _0x4a7b7c['getTags'](_0x56d3d5);}})[_0xfef5('0x26')](function(_0x52e55e){if(_0x52e55e){_0x3dd583=_0x52e55e[_0xfef5('0x37')];if(!_0x562541['query'][_0xfef5('0x53')](_0xfef5('0x38'))){_0x56d3d5[_0xfef5('0x21')]=qs[_0xfef5('0x21')](_0x562541[_0xfef5('0x32')][_0xfef5('0x21')]);_0x56d3d5[_0xfef5('0x1f')]=qs[_0xfef5('0x1f')](_0x562541[_0xfef5('0x32')][_0xfef5('0x1f')]);}return _0x4a7b7c[_0xfef5('0x54')](_0x56d3d5);}})[_0xfef5('0x26')](function(_0x285f0b){if(_0x285f0b){return _0x285f0b?{'count':_0x3dd583,'rows':_0x285f0b}:null;}})[_0xfef5('0x26')](respondWithResult(_0x5324fe,null))['catch'](handleError(_0x5324fe,null));};exports[_0xfef5('0x56')]=function(_0x36913b,_0xa202b7,_0x24189e){if(_0x36913b[_0xfef5('0x49')]['id']){delete _0x36913b['body']['id'];}return db[_0xfef5('0x2e')]['findOne']({'where':{'id':_0x36913b[_0xfef5('0x4a')]['id']}})[_0xfef5('0x26')](handleEntityNotFound(_0xa202b7,null))[_0xfef5('0x26')](function(_0x42d6cf){if(_0x42d6cf){return _0x42d6cf['setTags'](_0x36913b[_0xfef5('0x49')][_0xfef5('0x57')]||[]);}return null;})['then'](respondWithResult(_0xa202b7,null))[_0xfef5('0x44')](handleError(_0xa202b7,null));}; \ No newline at end of file +var _0xd215=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','count','limit','set','json','save','then','destroy','end','sendStatus','error','name','send','map','DeskConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getFields','findOne','DeskField','filter','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x4bd83d,_0x1e9bbd){var _0x1c5694=function(_0x5d1863){while(--_0x5d1863){_0x4bd83d['push'](_0x4bd83d['shift']());}};_0x1c5694(++_0x1e9bbd);}(_0xd215,0x191));var _0x5d21=function(_0x36a0f8,_0x326d04){_0x36a0f8=_0x36a0f8-0x0;var _0x54c411=_0xd215[_0x36a0f8];return _0x54c411;};'use strict';var emlformat=require(_0x5d21('0x0'));var rimraf=require(_0x5d21('0x1'));var zipdir=require(_0x5d21('0x2'));var jsonpatch=require(_0x5d21('0x3'));var rp=require(_0x5d21('0x4'));var moment=require(_0x5d21('0x5'));var BPromise=require(_0x5d21('0x6'));var Mustache=require(_0x5d21('0x7'));var util=require(_0x5d21('0x8'));var path=require(_0x5d21('0x9'));var sox=require(_0x5d21('0xa'));var csv=require('to-csv');var ejs=require(_0x5d21('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d21('0xc'));var squel=require(_0x5d21('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d21('0xe'));var deskjs=require(_0x5d21('0xf'));var toCsv=require(_0x5d21('0x10'));var querystring=require(_0x5d21('0x11'));var Papa=require(_0x5d21('0x12'));var Redis=require('ioredis');var authService=require(_0x5d21('0x13'));var qs=require(_0x5d21('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d21('0x15'));var logger=require(_0x5d21('0x16'))(_0x5d21('0x17'));var utils=require(_0x5d21('0x18'));var config=require(_0x5d21('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d21('0x1a'))['db'];function respondWithStatusCode(_0x440ce7,_0x30c08d){_0x30c08d=_0x30c08d||0xcc;return function(_0xcb298c){if(_0xcb298c){return _0x440ce7['sendStatus'](_0x30c08d);}return _0x440ce7[_0x5d21('0x1b')](_0x30c08d)['end']();};}function respondWithResult(_0x55348d,_0x4a684a){_0x4a684a=_0x4a684a||0xc8;return function(_0x1b21f8){if(_0x1b21f8){return _0x55348d['status'](_0x4a684a)['json'](_0x1b21f8);}};}function respondWithFilteredResult(_0x2d0b53,_0x191358){return function(_0x25a651){if(_0x25a651){var _0x5322d7=typeof _0x191358[_0x5d21('0x1c')]==='undefined'&&typeof _0x191358['limit']==='undefined';var _0x21f200=_0x25a651[_0x5d21('0x1d')];var _0x31377d=_0x5322d7?0x0:_0x191358['offset'];var _0x542763=_0x5322d7?_0x25a651[_0x5d21('0x1d')]:_0x191358['offset']+_0x191358[_0x5d21('0x1e')];var _0x3dabe2;if(_0x542763>=_0x21f200){_0x542763=_0x21f200;_0x3dabe2=0xc8;}else{_0x3dabe2=0xce;}_0x2d0b53['status'](_0x3dabe2);return _0x2d0b53[_0x5d21('0x1f')]('Content-Range',_0x31377d+'-'+_0x542763+'/'+_0x21f200)[_0x5d21('0x20')](_0x25a651);}return null;};}function patchUpdates(_0x3dbaf1){return function(_0x414d14){try{jsonpatch['apply'](_0x414d14,_0x3dbaf1,!![]);}catch(_0x3f5032){return BPromise['reject'](_0x3f5032);}return _0x414d14[_0x5d21('0x21')]();};}function saveUpdates(_0x3abf0f,_0x361bbc){return function(_0x5adfa8){if(_0x5adfa8){return _0x5adfa8['update'](_0x3abf0f)[_0x5d21('0x22')](function(_0x70ea0c){return _0x70ea0c;});}return null;};}function removeEntity(_0x594c99,_0x51868d){return function(_0x59bad7){if(_0x59bad7){return _0x59bad7[_0x5d21('0x23')]()[_0x5d21('0x22')](function(){_0x594c99['status'](0xcc)[_0x5d21('0x24')]();});}};}function handleEntityNotFound(_0x14f7bc,_0x6bed01){return function(_0x2f7137){if(!_0x2f7137){_0x14f7bc[_0x5d21('0x25')](0x194);}return _0x2f7137;};}function handleError(_0x501a47,_0x4c39d0){_0x4c39d0=_0x4c39d0||0x1f4;return function(_0x30e201){logger[_0x5d21('0x26')](_0x30e201['stack']);if(_0x30e201[_0x5d21('0x27')]){delete _0x30e201['name'];}_0x501a47[_0x5d21('0x1b')](_0x4c39d0)[_0x5d21('0x28')](_0x30e201);};}exports['index']=function(_0x43842b,_0x3f719b){var _0x19349f={},_0x2e2ce9={},_0x44b1eb={'count':0x0,'rows':[]};var _0x51adec=_[_0x5d21('0x29')](db[_0x5d21('0x2a')][_0x5d21('0x2b')],function(_0x1896d8){return{'name':_0x1896d8[_0x5d21('0x2c')],'type':_0x1896d8['type'][_0x5d21('0x2d')]};});_0x2e2ce9['model']=_['map'](_0x51adec,_0x5d21('0x27'));_0x2e2ce9[_0x5d21('0x2e')]=_[_0x5d21('0x2f')](_0x43842b[_0x5d21('0x2e')]);_0x2e2ce9[_0x5d21('0x30')]=_['intersection'](_0x2e2ce9[_0x5d21('0x31')],_0x2e2ce9[_0x5d21('0x2e')]);_0x19349f['attributes']=_[_0x5d21('0x32')](_0x2e2ce9['model'],qs[_0x5d21('0x33')](_0x43842b[_0x5d21('0x2e')][_0x5d21('0x33')]));_0x19349f[_0x5d21('0x34')]=_0x19349f[_0x5d21('0x34')][_0x5d21('0x35')]?_0x19349f[_0x5d21('0x34')]:_0x2e2ce9[_0x5d21('0x31')];if(!_0x43842b[_0x5d21('0x2e')][_0x5d21('0x36')]('nolimit')){_0x19349f[_0x5d21('0x1e')]=qs[_0x5d21('0x1e')](_0x43842b[_0x5d21('0x2e')]['limit']);_0x19349f[_0x5d21('0x1c')]=qs[_0x5d21('0x1c')](_0x43842b[_0x5d21('0x2e')][_0x5d21('0x1c')]);}_0x19349f[_0x5d21('0x37')]=qs[_0x5d21('0x38')](_0x43842b['query'][_0x5d21('0x38')]);_0x19349f['where']=qs[_0x5d21('0x30')](_[_0x5d21('0x39')](_0x43842b[_0x5d21('0x2e')],_0x2e2ce9[_0x5d21('0x30')]),_0x51adec);if(_0x43842b[_0x5d21('0x2e')]['filter']){_0x19349f[_0x5d21('0x3a')]=_[_0x5d21('0x3b')](_0x19349f[_0x5d21('0x3a')],{'$or':_[_0x5d21('0x29')](_0x51adec,function(_0x3edf68){if(_0x3edf68[_0x5d21('0x3c')]!==_0x5d21('0x3d')){var _0x185dc3={};_0x185dc3[_0x3edf68[_0x5d21('0x27')]]={'$like':'%'+_0x43842b[_0x5d21('0x2e')]['filter']+'%'};return _0x185dc3;}})});}_0x19349f=_[_0x5d21('0x3b')]({},_0x19349f,_0x43842b[_0x5d21('0x3e')]);var _0x1b7e64={'where':_0x19349f[_0x5d21('0x3a')]};return db[_0x5d21('0x2a')][_0x5d21('0x1d')](_0x1b7e64)[_0x5d21('0x22')](function(_0x5ae2f9){_0x44b1eb[_0x5d21('0x1d')]=_0x5ae2f9;if(_0x43842b[_0x5d21('0x2e')][_0x5d21('0x3f')]){_0x19349f[_0x5d21('0x40')]=[{'all':!![]}];}return db[_0x5d21('0x2a')]['findAll'](_0x19349f);})[_0x5d21('0x22')](function(_0x42f507){_0x44b1eb[_0x5d21('0x41')]=_0x42f507;return _0x44b1eb;})[_0x5d21('0x22')](respondWithFilteredResult(_0x3f719b,_0x19349f))[_0x5d21('0x42')](handleError(_0x3f719b,null));};exports[_0x5d21('0x43')]=function(_0xa13089,_0x4c3974){var _0x1ec08b={'raw':![],'where':{'id':_0xa13089[_0x5d21('0x44')]['id']}},_0x1a8613={};_0x1a8613[_0x5d21('0x31')]=_['keys'](db[_0x5d21('0x2a')][_0x5d21('0x2b')]);_0x1a8613[_0x5d21('0x2e')]=_['keys'](_0xa13089[_0x5d21('0x2e')]);_0x1a8613['filters']=_[_0x5d21('0x32')](_0x1a8613['model'],_0x1a8613[_0x5d21('0x2e')]);_0x1ec08b[_0x5d21('0x34')]=_['intersection'](_0x1a8613[_0x5d21('0x31')],qs[_0x5d21('0x33')](_0xa13089[_0x5d21('0x2e')][_0x5d21('0x33')]));_0x1ec08b[_0x5d21('0x34')]=_0x1ec08b[_0x5d21('0x34')][_0x5d21('0x35')]?_0x1ec08b['attributes']:_0x1a8613[_0x5d21('0x31')];if(_0xa13089['query'][_0x5d21('0x3f')]){_0x1ec08b[_0x5d21('0x40')]=[{'all':!![]}];}_0x1ec08b=_[_0x5d21('0x3b')]({},_0x1ec08b,_0xa13089[_0x5d21('0x3e')]);return db['DeskConfiguration']['find'](_0x1ec08b)[_0x5d21('0x22')](handleEntityNotFound(_0x4c3974,null))[_0x5d21('0x22')](respondWithResult(_0x4c3974,null))[_0x5d21('0x42')](handleError(_0x4c3974,null));};exports['create']=function(_0x509143,_0x1c5b13){return db[_0x5d21('0x2a')][_0x5d21('0x45')](_0x509143[_0x5d21('0x46')],{})[_0x5d21('0x22')](respondWithResult(_0x1c5b13,0xc9))[_0x5d21('0x42')](handleError(_0x1c5b13,null));};exports['update']=function(_0x2a90ab,_0x59d9c1){if(_0x2a90ab[_0x5d21('0x46')]['id']){delete _0x2a90ab['body']['id'];}return db['DeskConfiguration'][_0x5d21('0x47')]({'where':{'id':_0x2a90ab[_0x5d21('0x44')]['id']}})[_0x5d21('0x22')](handleEntityNotFound(_0x59d9c1,null))['then'](saveUpdates(_0x2a90ab['body'],null))[_0x5d21('0x22')](respondWithResult(_0x59d9c1,null))[_0x5d21('0x42')](handleError(_0x59d9c1,null));};exports[_0x5d21('0x23')]=function(_0x275add,_0x47b5c8){return db[_0x5d21('0x2a')][_0x5d21('0x47')]({'where':{'id':_0x275add[_0x5d21('0x44')]['id']}})[_0x5d21('0x22')](handleEntityNotFound(_0x47b5c8,null))[_0x5d21('0x22')](removeEntity(_0x47b5c8,null))[_0x5d21('0x42')](handleError(_0x47b5c8,null));};exports[_0x5d21('0x48')]=function(_0x2ac40a,_0x4cf251,_0x182795){var _0x1de9fd={};var _0x593720={};var _0xe7672f;var _0x1412c7;return db['DeskConfiguration'][_0x5d21('0x49')]({'where':{'id':_0x2ac40a[_0x5d21('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cf251,null))[_0x5d21('0x22')](function(_0x1c8b3c){if(_0x1c8b3c){_0xe7672f=_0x1c8b3c;_0x593720[_0x5d21('0x31')]=_[_0x5d21('0x2f')](db[_0x5d21('0x4a')][_0x5d21('0x2b')]);_0x593720[_0x5d21('0x2e')]=_[_0x5d21('0x2f')](_0x2ac40a[_0x5d21('0x2e')]);_0x593720[_0x5d21('0x30')]=_[_0x5d21('0x32')](_0x593720[_0x5d21('0x31')],_0x593720['query']);_0x1de9fd[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x593720[_0x5d21('0x31')],qs[_0x5d21('0x33')](_0x2ac40a[_0x5d21('0x2e')]['fields']));_0x1de9fd[_0x5d21('0x34')]=_0x1de9fd['attributes'][_0x5d21('0x35')]?_0x1de9fd[_0x5d21('0x34')]:_0x593720['model'];_0x1de9fd['order']=qs[_0x5d21('0x38')](_0x2ac40a[_0x5d21('0x2e')][_0x5d21('0x38')]);_0x1de9fd['where']=qs[_0x5d21('0x30')](_[_0x5d21('0x39')](_0x2ac40a[_0x5d21('0x2e')],_0x593720[_0x5d21('0x30')]));if(_0x2ac40a[_0x5d21('0x2e')]['filter']){_0x1de9fd[_0x5d21('0x3a')]=_[_0x5d21('0x3b')](_0x1de9fd['where'],{'$or':_[_0x5d21('0x29')](_0x1de9fd[_0x5d21('0x34')],function(_0x4d764b){var _0x149ce7={};_0x149ce7[_0x4d764b]={'$like':'%'+_0x2ac40a[_0x5d21('0x2e')][_0x5d21('0x4b')]+'%'};return _0x149ce7;})});}_0x1de9fd=_['merge']({},_0x1de9fd,_0x2ac40a[_0x5d21('0x3e')]);return _0xe7672f[_0x5d21('0x48')](_0x1de9fd);}})[_0x5d21('0x22')](function(_0x479838){if(_0x479838){_0x1412c7=_0x479838[_0x5d21('0x35')];if(!_0x2ac40a[_0x5d21('0x2e')]['hasOwnProperty'](_0x5d21('0x4c'))){_0x1de9fd['limit']=qs['limit'](_0x2ac40a[_0x5d21('0x2e')][_0x5d21('0x1e')]);_0x1de9fd[_0x5d21('0x1c')]=qs['offset'](_0x2ac40a[_0x5d21('0x2e')][_0x5d21('0x1c')]);}return _0xe7672f['getFields'](_0x1de9fd);}})[_0x5d21('0x22')](function(_0x36530f){if(_0x36530f){return _0x36530f?{'count':_0x1412c7,'rows':_0x36530f}:null;}})[_0x5d21('0x22')](respondWithResult(_0x4cf251,null))['catch'](handleError(_0x4cf251,null));};exports[_0x5d21('0x4d')]=function(_0x1cddb3,_0x4e6b2b,_0xcae58b){var _0x6b9661={};var _0x1baaf7={};var _0x90ecee;var _0x508d09;return db[_0x5d21('0x2a')][_0x5d21('0x49')]({'where':{'id':_0x1cddb3[_0x5d21('0x44')]['id']}})[_0x5d21('0x22')](handleEntityNotFound(_0x4e6b2b,null))['then'](function(_0x1bbde8){if(_0x1bbde8){_0x90ecee=_0x1bbde8;_0x1baaf7[_0x5d21('0x31')]=_['keys'](db['DeskField']['rawAttributes']);_0x1baaf7[_0x5d21('0x2e')]=_[_0x5d21('0x2f')](_0x1cddb3[_0x5d21('0x2e')]);_0x1baaf7['filters']=_[_0x5d21('0x32')](_0x1baaf7[_0x5d21('0x31')],_0x1baaf7[_0x5d21('0x2e')]);_0x6b9661[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x1baaf7['model'],qs[_0x5d21('0x33')](_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x33')]));_0x6b9661[_0x5d21('0x34')]=_0x6b9661[_0x5d21('0x34')]['length']?_0x6b9661[_0x5d21('0x34')]:_0x1baaf7[_0x5d21('0x31')];_0x6b9661['order']=qs[_0x5d21('0x38')](_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x38')]);_0x6b9661[_0x5d21('0x3a')]=qs['filters'](_[_0x5d21('0x39')](_0x1cddb3[_0x5d21('0x2e')],_0x1baaf7['filters']));if(_0x1cddb3['query']['filter']){_0x6b9661[_0x5d21('0x3a')]=_[_0x5d21('0x3b')](_0x6b9661['where'],{'$or':_[_0x5d21('0x29')](_0x6b9661[_0x5d21('0x34')],function(_0x45bde8){var _0x489e36={};_0x489e36[_0x45bde8]={'$like':'%'+_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x4b')]+'%'};return _0x489e36;})});}_0x6b9661=_[_0x5d21('0x3b')]({},_0x6b9661,_0x1cddb3[_0x5d21('0x3e')]);return _0x90ecee[_0x5d21('0x4d')](_0x6b9661);}})['then'](function(_0x567a26){if(_0x567a26){_0x508d09=_0x567a26['length'];if(!_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x36')](_0x5d21('0x4c'))){_0x6b9661[_0x5d21('0x1e')]=qs['limit'](_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x1e')]);_0x6b9661['offset']=qs['offset'](_0x1cddb3[_0x5d21('0x2e')][_0x5d21('0x1c')]);}return _0x90ecee[_0x5d21('0x4d')](_0x6b9661);}})[_0x5d21('0x22')](function(_0x539346){if(_0x539346){return _0x539346?{'count':_0x508d09,'rows':_0x539346}:null;}})[_0x5d21('0x22')](respondWithResult(_0x4e6b2b,null))[_0x5d21('0x42')](handleError(_0x4e6b2b,null));};exports[_0x5d21('0x4e')]=function(_0x42db0f,_0x499f3e,_0x5b69c3){var _0x3eb443={};var _0x54f41b={};var _0x5c54f7;var _0x14946c;return db['DeskConfiguration']['findOne']({'where':{'id':_0x42db0f[_0x5d21('0x44')]['id']}})['then'](handleEntityNotFound(_0x499f3e,null))[_0x5d21('0x22')](function(_0x3b70a9){if(_0x3b70a9){_0x5c54f7=_0x3b70a9;_0x54f41b[_0x5d21('0x31')]=_[_0x5d21('0x2f')](db[_0x5d21('0x4a')][_0x5d21('0x2b')]);_0x54f41b[_0x5d21('0x2e')]=_['keys'](_0x42db0f[_0x5d21('0x2e')]);_0x54f41b[_0x5d21('0x30')]=_[_0x5d21('0x32')](_0x54f41b[_0x5d21('0x31')],_0x54f41b['query']);_0x3eb443[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x54f41b[_0x5d21('0x31')],qs['fields'](_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x33')]));_0x3eb443[_0x5d21('0x34')]=_0x3eb443['attributes']['length']?_0x3eb443['attributes']:_0x54f41b[_0x5d21('0x31')];_0x3eb443['order']=qs[_0x5d21('0x38')](_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x38')]);_0x3eb443[_0x5d21('0x3a')]=qs[_0x5d21('0x30')](_[_0x5d21('0x39')](_0x42db0f[_0x5d21('0x2e')],_0x54f41b[_0x5d21('0x30')]));if(_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x4b')]){_0x3eb443[_0x5d21('0x3a')]=_[_0x5d21('0x3b')](_0x3eb443['where'],{'$or':_['map'](_0x3eb443[_0x5d21('0x34')],function(_0x1ca488){var _0x557186={};_0x557186[_0x1ca488]={'$like':'%'+_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x4b')]+'%'};return _0x557186;})});}_0x3eb443=_[_0x5d21('0x3b')]({},_0x3eb443,_0x42db0f['options']);return _0x5c54f7[_0x5d21('0x4e')](_0x3eb443);}})[_0x5d21('0x22')](function(_0x29c712){if(_0x29c712){_0x14946c=_0x29c712['length'];if(!_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x36')]('nolimit')){_0x3eb443[_0x5d21('0x1e')]=qs[_0x5d21('0x1e')](_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x1e')]);_0x3eb443['offset']=qs[_0x5d21('0x1c')](_0x42db0f[_0x5d21('0x2e')][_0x5d21('0x1c')]);}return _0x5c54f7[_0x5d21('0x4e')](_0x3eb443);}})[_0x5d21('0x22')](function(_0x1b1b1a){if(_0x1b1b1a){return _0x1b1b1a?{'count':_0x14946c,'rows':_0x1b1b1a}:null;}})[_0x5d21('0x22')](respondWithResult(_0x499f3e,null))[_0x5d21('0x42')](handleError(_0x499f3e,null));};exports[_0x5d21('0x4f')]=function(_0x404a9c,_0x58f2c2,_0x41bbb0){var _0x2ef7c5={};var _0x18a50e={};var _0x48a368;var _0x27ad0e;return db[_0x5d21('0x2a')][_0x5d21('0x49')]({'where':{'id':_0x404a9c[_0x5d21('0x44')]['id']}})[_0x5d21('0x22')](handleEntityNotFound(_0x58f2c2,null))[_0x5d21('0x22')](function(_0x12f954){if(_0x12f954){_0x48a368=_0x12f954;_0x18a50e[_0x5d21('0x31')]=_[_0x5d21('0x2f')](db[_0x5d21('0x50')][_0x5d21('0x2b')]);_0x18a50e[_0x5d21('0x2e')]=_[_0x5d21('0x2f')](_0x404a9c[_0x5d21('0x2e')]);_0x18a50e[_0x5d21('0x30')]=_[_0x5d21('0x32')](_0x18a50e['model'],_0x18a50e[_0x5d21('0x2e')]);_0x2ef7c5[_0x5d21('0x34')]=_[_0x5d21('0x32')](_0x18a50e[_0x5d21('0x31')],qs[_0x5d21('0x33')](_0x404a9c[_0x5d21('0x2e')]['fields']));_0x2ef7c5[_0x5d21('0x34')]=_0x2ef7c5[_0x5d21('0x34')][_0x5d21('0x35')]?_0x2ef7c5[_0x5d21('0x34')]:_0x18a50e[_0x5d21('0x31')];_0x2ef7c5[_0x5d21('0x37')]=qs[_0x5d21('0x38')](_0x404a9c[_0x5d21('0x2e')][_0x5d21('0x38')]);_0x2ef7c5[_0x5d21('0x3a')]=qs['filters'](_[_0x5d21('0x39')](_0x404a9c[_0x5d21('0x2e')],_0x18a50e['filters']));if(_0x404a9c[_0x5d21('0x2e')][_0x5d21('0x4b')]){_0x2ef7c5['where']=_[_0x5d21('0x3b')](_0x2ef7c5[_0x5d21('0x3a')],{'$or':_['map'](_0x2ef7c5[_0x5d21('0x34')],function(_0x1aff01){var _0x6677ab={};_0x6677ab[_0x1aff01]={'$like':'%'+_0x404a9c[_0x5d21('0x2e')][_0x5d21('0x4b')]+'%'};return _0x6677ab;})});}_0x2ef7c5=_['merge']({},_0x2ef7c5,_0x404a9c['options']);return _0x48a368[_0x5d21('0x4f')](_0x2ef7c5);}})['then'](function(_0xaa665){if(_0xaa665){_0x27ad0e=_0xaa665[_0x5d21('0x35')];if(!_0x404a9c['query'][_0x5d21('0x36')](_0x5d21('0x4c'))){_0x2ef7c5[_0x5d21('0x1e')]=qs[_0x5d21('0x1e')](_0x404a9c['query']['limit']);_0x2ef7c5[_0x5d21('0x1c')]=qs[_0x5d21('0x1c')](_0x404a9c[_0x5d21('0x2e')]['offset']);}return _0x48a368[_0x5d21('0x4f')](_0x2ef7c5);}})[_0x5d21('0x22')](function(_0xf8000e){if(_0xf8000e){return _0xf8000e?{'count':_0x27ad0e,'rows':_0xf8000e}:null;}})[_0x5d21('0x22')](respondWithResult(_0x58f2c2,null))[_0x5d21('0x42')](handleError(_0x58f2c2,null));};exports[_0x5d21('0x51')]=function(_0x33b947,_0x2cd7ee,_0x5947d0){if(_0x33b947[_0x5d21('0x46')]['id']){delete _0x33b947[_0x5d21('0x46')]['id'];}return db['DeskConfiguration'][_0x5d21('0x49')]({'where':{'id':_0x33b947[_0x5d21('0x44')]['id']}})[_0x5d21('0x22')](handleEntityNotFound(_0x2cd7ee,null))[_0x5d21('0x22')](function(_0x119a7b){if(_0x119a7b){return _0x119a7b['setTags'](_0x33b947[_0x5d21('0x46')][_0x5d21('0x52')]||[]);}return null;})[_0x5d21('0x22')](respondWithResult(_0x2cd7ee,null))[_0x5d21('0x42')](handleError(_0x2cd7ee,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 18d08c5..8d152ad 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 _0xdafd=['../../config/logger','moment','bluebird','path','../../config/environment','exports','lodash','util'];(function(_0x3fd7c8,_0x453506){var _0xa9f40b=function(_0x4a1f4b){while(--_0x4a1f4b){_0x3fd7c8['push'](_0x3fd7c8['shift']());}};_0xa9f40b(++_0x453506);}(_0xdafd,0x146));var _0xddaf=function(_0x52b321,_0x5c4c41){_0x52b321=_0x52b321-0x0;var _0x285e8a=_0xdafd[_0x52b321];return _0x285e8a;};'use strict';var _=require(_0xddaf('0x0'));var util=require(_0xddaf('0x1'));var logger=require(_0xddaf('0x2'))('api');var moment=require(_0xddaf('0x3'));var BPromise=require(_0xddaf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddaf('0x5'));var rimraf=require('rimraf');var config=require(_0xddaf('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0xddaf('0x7')]=function(_0x1cbe9c,_0x33cadd){return _0x1cbe9c['define']('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf87d=['util','moment','request-promise','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x32355d,_0xa6b12e){var _0x995a4f=function(_0xf240ac){while(--_0xf240ac){_0x32355d['push'](_0x32355d['shift']());}};_0x995a4f(++_0xa6b12e);}(_0xf87d,0x8f));var _0xdf87=function(_0x35b015,_0x395bfb){_0x35b015=_0x35b015-0x0;var _0x377c7a=_0xf87d[_0x35b015];return _0x377c7a;};'use strict';var _=require(_0xdf87('0x0'));var util=require(_0xdf87('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf87('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf87('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdf87('0x4'));var attributes=require(_0xdf87('0x5'));module[_0xdf87('0x6')]=function(_0x293928,_0x159bac){return _0x293928['define'](_0xdf87('0x7'),attributes,{'tableName':_0xdf87('0x8'),'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 2635b82..b3a3a72 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 _0xcdf0=['request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0xcdf0,0xa8));var _0x0cdf=function(_0x238834,_0x265837){_0x238834=_0x238834-0x0;var _0x2f1dce=_0xcdf0[_0x238834];return _0x2f1dce;};'use strict';var _=require(_0x0cdf('0x0'));var util=require(_0x0cdf('0x1'));var moment=require(_0x0cdf('0x2'));var BPromise=require(_0x0cdf('0x3'));var rs=require(_0x0cdf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cdf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cdf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0cdf('0x7'));var client=jayson[_0x0cdf('0x8')][_0x0cdf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x658ceb,_0x45b4d9,_0x5415ef){return new BPromise(function(_0x47f3ea,_0x238a0b){return client['request'](_0x658ceb,_0x5415ef)[_0x0cdf('0xa')](function(_0x275bc9){logger['info'](_0x0cdf('0xb'),_0x45b4d9,_0x0cdf('0xc'));logger[_0x0cdf('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x45b4d9,_0x0cdf('0xc'),JSON[_0x0cdf('0xe')](_0x275bc9));if(_0x275bc9[_0x0cdf('0xf')]){if(_0x275bc9[_0x0cdf('0xf')]['code']===0x1f4){logger[_0x0cdf('0xf')](_0x0cdf('0xb'),_0x45b4d9,_0x275bc9['error'][_0x0cdf('0x10')]);return _0x238a0b(_0x275bc9[_0x0cdf('0xf')][_0x0cdf('0x10')]);}logger[_0x0cdf('0xf')](_0x0cdf('0xb'),_0x45b4d9,_0x275bc9[_0x0cdf('0xf')]['message']);return _0x47f3ea(_0x275bc9[_0x0cdf('0xf')][_0x0cdf('0x10')]);}else{logger['info'](_0x0cdf('0xb'),_0x45b4d9,_0x0cdf('0xc'));_0x47f3ea(_0x275bc9[_0x0cdf('0x11')][_0x0cdf('0x10')]);}})['catch'](function(_0x5b1261){logger[_0x0cdf('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x45b4d9,_0x5b1261);_0x238a0b(_0x5b1261);});});} \ No newline at end of file +var _0x51d7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x51d7,0xcf));var _0x751d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51d7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x751d('0x0'));var util=require(_0x751d('0x1'));var moment=require(_0x751d('0x2'));var BPromise=require(_0x751d('0x3'));var rs=require(_0x751d('0x4'));var fs=require('fs');var Redis=require(_0x751d('0x5'));var db=require(_0x751d('0x6'))['db'];var utils=require(_0x751d('0x7'));var logger=require(_0x751d('0x8'))(_0x751d('0x9'));var config=require(_0x751d('0xa'));var jayson=require(_0x751d('0xb'));var client=jayson[_0x751d('0xc')][_0x751d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d579,_0x1550f2,_0x2ff1e4){return new BPromise(function(_0x18370c,_0x110ac8){return client[_0x751d('0xe')](_0x3d579,_0x2ff1e4)[_0x751d('0xf')](function(_0x3b7c3c){logger[_0x751d('0x10')](_0x751d('0x11'),_0x1550f2,_0x751d('0x12'));logger[_0x751d('0x13')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1550f2,_0x751d('0x12'),JSON[_0x751d('0x14')](_0x3b7c3c));if(_0x3b7c3c[_0x751d('0x15')]){if(_0x3b7c3c[_0x751d('0x15')][_0x751d('0x16')]===0x1f4){logger['error'](_0x751d('0x11'),_0x1550f2,_0x3b7c3c[_0x751d('0x15')][_0x751d('0x17')]);return _0x110ac8(_0x3b7c3c['error'][_0x751d('0x17')]);}logger['error'](_0x751d('0x11'),_0x1550f2,_0x3b7c3c[_0x751d('0x15')]['message']);return _0x18370c(_0x3b7c3c[_0x751d('0x15')][_0x751d('0x17')]);}else{logger[_0x751d('0x10')](_0x751d('0x11'),_0x1550f2,'request\x20sent');_0x18370c(_0x3b7c3c[_0x751d('0x18')][_0x751d('0x17')]);}})[_0x751d('0x19')](function(_0x326894){logger[_0x751d('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x1550f2,_0x326894);_0x110ac8(_0x326894);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f480c78..dd477d2 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 _0xebd3=['path','express','Router','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','multer'];(function(_0x29a467,_0x469a8d){var _0x2effc4=function(_0x205d8d){while(--_0x205d8d){_0x29a467['push'](_0x29a467['shift']());}};_0x2effc4(++_0x469a8d);}(_0xebd3,0x194));var _0x3ebd=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0xebd3[_0x540dcb];return _0x49353c;};'use strict';var multer=require(_0x3ebd('0x0'));var util=require('util');var path=require(_0x3ebd('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ebd('0x2'));var router=express[_0x3ebd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ebd('0x4'));var controller=require(_0x3ebd('0x5'));router[_0x3ebd('0x6')]('/',auth[_0x3ebd('0x7')](),controller[_0x3ebd('0x8')]);router[_0x3ebd('0x6')](_0x3ebd('0x9'),auth[_0x3ebd('0x7')](),controller[_0x3ebd('0xa')]);router[_0x3ebd('0xb')]('/',auth['isAuthenticated'](),controller[_0x3ebd('0xc')]);router['put'](_0x3ebd('0x9'),auth[_0x3ebd('0x7')](),controller[_0x3ebd('0xd')]);router['delete'](_0x3ebd('0x9'),auth['isAuthenticated'](),controller[_0x3ebd('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb8c1=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','./intDeskField.controller','get'];(function(_0xe8b317,_0x46bf88){var _0x2e6593=function(_0x17ec8a){while(--_0x17ec8a){_0xe8b317['push'](_0xe8b317['shift']());}};_0x2e6593(++_0x46bf88);}(_0xb8c1,0x91));var _0x1b8c=function(_0x471233,_0x48bede){_0x471233=_0x471233-0x0;var _0x2ce114=_0xb8c1[_0x471233];return _0x2ce114;};'use strict';var multer=require('multer');var util=require(_0x1b8c('0x0'));var path=require(_0x1b8c('0x1'));var timeout=require(_0x1b8c('0x2'));var express=require(_0x1b8c('0x3'));var router=express[_0x1b8c('0x4')]();var fs_extra=require(_0x1b8c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b8c('0x6'));router[_0x1b8c('0x7')]('/',auth[_0x1b8c('0x8')](),controller[_0x1b8c('0x9')]);router[_0x1b8c('0x7')](_0x1b8c('0xa'),auth[_0x1b8c('0x8')](),controller[_0x1b8c('0xb')]);router['post']('/',auth[_0x1b8c('0x8')](),controller[_0x1b8c('0xc')]);router['put'](_0x1b8c('0xa'),auth[_0x1b8c('0x8')](),controller[_0x1b8c('0xd')]);router[_0x1b8c('0xe')](_0x1b8c('0xa'),auth[_0x1b8c('0x8')](),controller[_0x1b8c('0xf')]);module[_0x1b8c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c44de0b..feaef9a 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 _0x1f8b=['variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x1f8b,0x1e7));var _0xb1f8=function(_0x1f03f1,_0x14d47e){_0x1f03f1=_0x1f03f1-0x0;var _0x592f30=_0x1f8b[_0x1f03f1];return _0x592f30;};'use strict';var Sequelize=require(_0xb1f8('0x0'));module[_0xb1f8('0x1')]={'type':{'type':Sequelize[_0xb1f8('0x2')]('string',_0xb1f8('0x3'),_0xb1f8('0x4'),_0xb1f8('0x5'),_0xb1f8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb1f8('0x7')]},'keyType':{'type':Sequelize[_0xb1f8('0x2')](_0xb1f8('0x8'),_0xb1f8('0x3'),_0xb1f8('0x4'))},'keyContent':{'type':Sequelize[_0xb1f8('0x7')]},'idField':{'type':Sequelize[_0xb1f8('0x7')]},'nameField':{'type':Sequelize[_0xb1f8('0x7')]},'customField':{'type':Sequelize[_0xb1f8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x034c=['sequelize','exports','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x69b22d,_0x418108){var _0x1c8adf=function(_0x1d54c8){while(--_0x1d54c8){_0x69b22d['push'](_0x69b22d['shift']());}};_0x1c8adf(++_0x418108);}(_0x034c,0x150));var _0xc034=function(_0x495aa4,_0x5b3cb4){_0x495aa4=_0x495aa4-0x0;var _0x3b34a0=_0x034c[_0x495aa4];return _0x3b34a0;};'use strict';var Sequelize=require(_0xc034('0x0'));module[_0xc034('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc034('0x2'),_0xc034('0x3'),_0xc034('0x4'),'keyValue','picklist'),'defaultValue':_0xc034('0x2')},'content':{'type':Sequelize[_0xc034('0x5')]},'key':{'type':Sequelize[_0xc034('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xc034('0x2'),'variable',_0xc034('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc034('0x5')]},'nameField':{'type':Sequelize[_0xc034('0x5')]},'customField':{'type':Sequelize[_0xc034('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc034('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3f85adb..ad5caf2 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 _0x3d41=['intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','filters'];(function(_0x4328fc,_0x6a1aa2){var _0xbcbe50=function(_0x1d89fa){while(--_0x1d89fa){_0x4328fc['push'](_0x4328fc['shift']());}};_0xbcbe50(++_0x6a1aa2);}(_0x3d41,0xea));var _0x13d4=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x3d41[_0x589f71];return _0x5763bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13d4('0x0'));var zipdir=require(_0x13d4('0x1'));var jsonpatch=require(_0x13d4('0x2'));var rp=require(_0x13d4('0x3'));var moment=require(_0x13d4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13d4('0x5'));var path=require(_0x13d4('0x6'));var sox=require('sox');var csv=require(_0x13d4('0x7'));var ejs=require(_0x13d4('0x8'));var fs=require('fs');var fs_extra=require(_0x13d4('0x9'));var _=require(_0x13d4('0xa'));var squel=require(_0x13d4('0xb'));var crypto=require(_0x13d4('0xc'));var jsforce=require(_0x13d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x13d4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x13d4('0xe'));var authService=require(_0x13d4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x13d4('0x10'));var hardwareService=require(_0x13d4('0x11'));var logger=require('../../config/logger')(_0x13d4('0x12'));var utils=require(_0x13d4('0x13'));var config=require(_0x13d4('0x14'));var licenseUtil=require(_0x13d4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f0132,_0x38cb2c){_0x38cb2c=_0x38cb2c||0xcc;return function(_0x1c8166){if(_0x1c8166){return _0x2f0132['sendStatus'](_0x38cb2c);}return _0x2f0132[_0x13d4('0x16')](_0x38cb2c)['end']();};}function respondWithResult(_0x205efa,_0x1fc8c1){_0x1fc8c1=_0x1fc8c1||0xc8;return function(_0x398cd9){if(_0x398cd9){return _0x205efa[_0x13d4('0x16')](_0x1fc8c1)[_0x13d4('0x17')](_0x398cd9);}};}function respondWithFilteredResult(_0xc5f125,_0x21cb32){return function(_0x549027){if(_0x549027){var _0x2195b9=typeof _0x21cb32[_0x13d4('0x18')]==='undefined'&&typeof _0x21cb32['limit']==='undefined';var _0x20706c=_0x549027[_0x13d4('0x19')];var _0x185e89=_0x2195b9?0x0:_0x21cb32[_0x13d4('0x18')];var _0x353ad6=_0x2195b9?_0x549027[_0x13d4('0x19')]:_0x21cb32[_0x13d4('0x18')]+_0x21cb32['limit'];var _0x2e0cfc;if(_0x353ad6>=_0x20706c){_0x353ad6=_0x20706c;_0x2e0cfc=0xc8;}else{_0x2e0cfc=0xce;}_0xc5f125['status'](_0x2e0cfc);return _0xc5f125[_0x13d4('0x1a')](_0x13d4('0x1b'),_0x185e89+'-'+_0x353ad6+'/'+_0x20706c)[_0x13d4('0x17')](_0x549027);}return null;};}function patchUpdates(_0x2dec6e){return function(_0x3e67c1){try{jsonpatch[_0x13d4('0x1c')](_0x3e67c1,_0x2dec6e,!![]);}catch(_0x1fc525){return BPromise[_0x13d4('0x1d')](_0x1fc525);}return _0x3e67c1[_0x13d4('0x1e')]();};}function saveUpdates(_0x56e263,_0x58bc69){return function(_0x1a3b22){if(_0x1a3b22){return _0x1a3b22[_0x13d4('0x1f')](_0x56e263)[_0x13d4('0x20')](function(_0x8bd494){return _0x8bd494;});}return null;};}function removeEntity(_0x32a692,_0x5e4e1e){return function(_0x3f84d1){if(_0x3f84d1){return _0x3f84d1[_0x13d4('0x21')]()[_0x13d4('0x20')](function(){_0x32a692[_0x13d4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ee56,_0x4a8ca1){return function(_0x4eba9a){if(!_0x4eba9a){_0x25ee56[_0x13d4('0x22')](0x194);}return _0x4eba9a;};}function handleError(_0x5db049,_0x773ee){_0x773ee=_0x773ee||0x1f4;return function(_0x233434){logger[_0x13d4('0x23')](_0x233434['stack']);if(_0x233434[_0x13d4('0x24')]){delete _0x233434[_0x13d4('0x24')];}_0x5db049[_0x13d4('0x16')](_0x773ee)[_0x13d4('0x25')](_0x233434);};}exports['index']=function(_0x4eb040,_0x3c7c3f){var _0x266307={},_0x72345e={},_0x2d514d={'count':0x0,'rows':[]};var _0x5bee68=_[_0x13d4('0x26')](db[_0x13d4('0x27')][_0x13d4('0x28')],function(_0x4e4f78){return{'name':_0x4e4f78[_0x13d4('0x29')],'type':_0x4e4f78[_0x13d4('0x2a')]['key']};});_0x72345e[_0x13d4('0x2b')]=_[_0x13d4('0x26')](_0x5bee68,_0x13d4('0x24'));_0x72345e[_0x13d4('0x2c')]=_['keys'](_0x4eb040['query']);_0x72345e[_0x13d4('0x2d')]=_[_0x13d4('0x2e')](_0x72345e[_0x13d4('0x2b')],_0x72345e['query']);_0x266307[_0x13d4('0x2f')]=_['intersection'](_0x72345e[_0x13d4('0x2b')],qs[_0x13d4('0x30')](_0x4eb040[_0x13d4('0x2c')]['fields']));_0x266307[_0x13d4('0x2f')]=_0x266307[_0x13d4('0x2f')][_0x13d4('0x31')]?_0x266307[_0x13d4('0x2f')]:_0x72345e[_0x13d4('0x2b')];if(!_0x4eb040['query']['hasOwnProperty'](_0x13d4('0x32'))){_0x266307[_0x13d4('0x33')]=qs[_0x13d4('0x33')](_0x4eb040[_0x13d4('0x2c')][_0x13d4('0x33')]);_0x266307[_0x13d4('0x18')]=qs['offset'](_0x4eb040[_0x13d4('0x2c')]['offset']);}_0x266307[_0x13d4('0x34')]=qs[_0x13d4('0x35')](_0x4eb040['query'][_0x13d4('0x35')]);_0x266307[_0x13d4('0x36')]=qs[_0x13d4('0x2d')](_[_0x13d4('0x37')](_0x4eb040[_0x13d4('0x2c')],_0x72345e[_0x13d4('0x2d')]),_0x5bee68);if(_0x4eb040[_0x13d4('0x2c')]['filter']){_0x266307[_0x13d4('0x36')]=_['merge'](_0x266307[_0x13d4('0x36')],{'$or':_[_0x13d4('0x26')](_0x5bee68,function(_0x115d52){if(_0x115d52['type']!==_0x13d4('0x38')){var _0x25ad99={};_0x25ad99[_0x115d52['name']]={'$like':'%'+_0x4eb040[_0x13d4('0x2c')][_0x13d4('0x39')]+'%'};return _0x25ad99;}})});}_0x266307=_[_0x13d4('0x3a')]({},_0x266307,_0x4eb040['options']);var _0x2d1589={'where':_0x266307[_0x13d4('0x36')]};return db[_0x13d4('0x27')][_0x13d4('0x19')](_0x2d1589)[_0x13d4('0x20')](function(_0x3c820c){_0x2d514d[_0x13d4('0x19')]=_0x3c820c;if(_0x4eb040[_0x13d4('0x2c')]['includeAll']){_0x266307[_0x13d4('0x3b')]=[{'all':!![]}];}return db['DeskField'][_0x13d4('0x3c')](_0x266307);})[_0x13d4('0x20')](function(_0x5d5302){_0x2d514d[_0x13d4('0x3d')]=_0x5d5302;return _0x2d514d;})[_0x13d4('0x20')](respondWithFilteredResult(_0x3c7c3f,_0x266307))[_0x13d4('0x3e')](handleError(_0x3c7c3f,null));};exports[_0x13d4('0x3f')]=function(_0x256962,_0x49bb1d){var _0x3186c0={'raw':!![],'where':{'id':_0x256962[_0x13d4('0x40')]['id']}},_0x340aed={};_0x340aed['model']=_[_0x13d4('0x41')](db[_0x13d4('0x27')][_0x13d4('0x28')]);_0x340aed['query']=_[_0x13d4('0x41')](_0x256962['query']);_0x340aed[_0x13d4('0x2d')]=_['intersection'](_0x340aed[_0x13d4('0x2b')],_0x340aed[_0x13d4('0x2c')]);_0x3186c0['attributes']=_['intersection'](_0x340aed[_0x13d4('0x2b')],qs[_0x13d4('0x30')](_0x256962[_0x13d4('0x2c')][_0x13d4('0x30')]));_0x3186c0['attributes']=_0x3186c0[_0x13d4('0x2f')][_0x13d4('0x31')]?_0x3186c0[_0x13d4('0x2f')]:_0x340aed['model'];if(_0x256962[_0x13d4('0x2c')][_0x13d4('0x42')]){_0x3186c0[_0x13d4('0x3b')]=[{'all':!![]}];}_0x3186c0=_[_0x13d4('0x3a')]({},_0x3186c0,_0x256962['options']);return db[_0x13d4('0x27')][_0x13d4('0x43')](_0x3186c0)[_0x13d4('0x20')](handleEntityNotFound(_0x49bb1d,null))['then'](respondWithResult(_0x49bb1d,null))[_0x13d4('0x3e')](handleError(_0x49bb1d,null));};exports[_0x13d4('0x44')]=function(_0x4b0552,_0x3c0214){return db[_0x13d4('0x27')][_0x13d4('0x44')](_0x4b0552[_0x13d4('0x45')],{})[_0x13d4('0x20')](respondWithResult(_0x3c0214,0xc9))[_0x13d4('0x3e')](handleError(_0x3c0214,null));};exports[_0x13d4('0x1f')]=function(_0x44219a,_0x38238d){if(_0x44219a['body']['id']){delete _0x44219a[_0x13d4('0x45')]['id'];}return db[_0x13d4('0x27')][_0x13d4('0x43')]({'where':{'id':_0x44219a[_0x13d4('0x40')]['id']}})[_0x13d4('0x20')](handleEntityNotFound(_0x38238d,null))[_0x13d4('0x20')](saveUpdates(_0x44219a[_0x13d4('0x45')],null))[_0x13d4('0x20')](respondWithResult(_0x38238d,null))[_0x13d4('0x3e')](handleError(_0x38238d,null));};exports['destroy']=function(_0x19e212,_0x230d8f){return db[_0x13d4('0x27')]['find']({'where':{'id':_0x19e212[_0x13d4('0x40')]['id']}})[_0x13d4('0x20')](handleEntityNotFound(_0x230d8f,null))['then'](removeEntity(_0x230d8f,null))[_0x13d4('0x3e')](handleError(_0x230d8f,null));}; \ No newline at end of file +var _0x8ba5=['../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','DeskField','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x1da10a,_0x1fe948){var _0x5aea64=function(_0x1fa637){while(--_0x1fa637){_0x1da10a['push'](_0x1da10a['shift']());}};_0x5aea64(++_0x1fe948);}(_0x8ba5,0x1da));var _0x58ba=function(_0xc52550,_0x53feb1){_0xc52550=_0xc52550-0x0;var _0x30605b=_0x8ba5[_0xc52550];return _0x30605b;};'use strict';var emlformat=require(_0x58ba('0x0'));var rimraf=require(_0x58ba('0x1'));var zipdir=require(_0x58ba('0x2'));var jsonpatch=require(_0x58ba('0x3'));var rp=require(_0x58ba('0x4'));var moment=require('moment');var BPromise=require(_0x58ba('0x5'));var Mustache=require(_0x58ba('0x6'));var util=require(_0x58ba('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x58ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x58ba('0x9'));var crypto=require(_0x58ba('0xa'));var jsforce=require(_0x58ba('0xb'));var deskjs=require(_0x58ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x58ba('0xd'));var Papa=require('papaparse');var Redis=require(_0x58ba('0xe'));var authService=require(_0x58ba('0xf'));var qs=require(_0x58ba('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58ba('0x11'));var logger=require('../../config/logger')(_0x58ba('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58ba('0x13'));var db=require(_0x58ba('0x14'))['db'];function respondWithStatusCode(_0x50bfdf,_0x16c111){_0x16c111=_0x16c111||0xcc;return function(_0x312cbf){if(_0x312cbf){return _0x50bfdf[_0x58ba('0x15')](_0x16c111);}return _0x50bfdf[_0x58ba('0x16')](_0x16c111)[_0x58ba('0x17')]();};}function respondWithResult(_0x5b6cc0,_0x2be273){_0x2be273=_0x2be273||0xc8;return function(_0x235a5a){if(_0x235a5a){return _0x5b6cc0['status'](_0x2be273)[_0x58ba('0x18')](_0x235a5a);}};}function respondWithFilteredResult(_0x3dbbdb,_0x464b8e){return function(_0x59dee8){if(_0x59dee8){var _0x4e448d=typeof _0x464b8e[_0x58ba('0x19')]==='undefined'&&typeof _0x464b8e[_0x58ba('0x1a')]===_0x58ba('0x1b');var _0x782e73=_0x59dee8['count'];var _0x5783de=_0x4e448d?0x0:_0x464b8e[_0x58ba('0x19')];var _0x317421=_0x4e448d?_0x59dee8[_0x58ba('0x1c')]:_0x464b8e[_0x58ba('0x19')]+_0x464b8e[_0x58ba('0x1a')];var _0x3a1909;if(_0x317421>=_0x782e73){_0x317421=_0x782e73;_0x3a1909=0xc8;}else{_0x3a1909=0xce;}_0x3dbbdb[_0x58ba('0x16')](_0x3a1909);return _0x3dbbdb[_0x58ba('0x1d')](_0x58ba('0x1e'),_0x5783de+'-'+_0x317421+'/'+_0x782e73)[_0x58ba('0x18')](_0x59dee8);}return null;};}function patchUpdates(_0x3c3f94){return function(_0x22d994){try{jsonpatch[_0x58ba('0x1f')](_0x22d994,_0x3c3f94,!![]);}catch(_0x52c4c9){return BPromise[_0x58ba('0x20')](_0x52c4c9);}return _0x22d994['save']();};}function saveUpdates(_0x1e62f8,_0x78c779){return function(_0x28844c){if(_0x28844c){return _0x28844c[_0x58ba('0x21')](_0x1e62f8)[_0x58ba('0x22')](function(_0x9c3926){return _0x9c3926;});}return null;};}function removeEntity(_0x4bc628,_0x2bc60a){return function(_0x561cc4){if(_0x561cc4){return _0x561cc4[_0x58ba('0x23')]()['then'](function(){_0x4bc628[_0x58ba('0x16')](0xcc)[_0x58ba('0x17')]();});}};}function handleEntityNotFound(_0x47e6a7,_0x260c36){return function(_0x650c7c){if(!_0x650c7c){_0x47e6a7['sendStatus'](0x194);}return _0x650c7c;};}function handleError(_0x149fa9,_0x5824c9){_0x5824c9=_0x5824c9||0x1f4;return function(_0x3131f9){logger['error'](_0x3131f9[_0x58ba('0x24')]);if(_0x3131f9['name']){delete _0x3131f9[_0x58ba('0x25')];}_0x149fa9[_0x58ba('0x16')](_0x5824c9)[_0x58ba('0x26')](_0x3131f9);};}exports[_0x58ba('0x27')]=function(_0x5c0c06,_0x48f91a){var _0x13e87b={},_0x596236={},_0x30238b={'count':0x0,'rows':[]};var _0x14cf8a=_['map'](db['DeskField']['rawAttributes'],function(_0x4f5f8a){return{'name':_0x4f5f8a[_0x58ba('0x28')],'type':_0x4f5f8a[_0x58ba('0x29')][_0x58ba('0x2a')]};});_0x596236[_0x58ba('0x2b')]=_[_0x58ba('0x2c')](_0x14cf8a,_0x58ba('0x25'));_0x596236['query']=_['keys'](_0x5c0c06[_0x58ba('0x2d')]);_0x596236[_0x58ba('0x2e')]=_[_0x58ba('0x2f')](_0x596236[_0x58ba('0x2b')],_0x596236['query']);_0x13e87b['attributes']=_[_0x58ba('0x2f')](_0x596236[_0x58ba('0x2b')],qs[_0x58ba('0x30')](_0x5c0c06[_0x58ba('0x2d')][_0x58ba('0x30')]));_0x13e87b['attributes']=_0x13e87b[_0x58ba('0x31')][_0x58ba('0x32')]?_0x13e87b[_0x58ba('0x31')]:_0x596236[_0x58ba('0x2b')];if(!_0x5c0c06[_0x58ba('0x2d')]['hasOwnProperty'](_0x58ba('0x33'))){_0x13e87b[_0x58ba('0x1a')]=qs[_0x58ba('0x1a')](_0x5c0c06['query'][_0x58ba('0x1a')]);_0x13e87b[_0x58ba('0x19')]=qs['offset'](_0x5c0c06[_0x58ba('0x2d')]['offset']);}_0x13e87b[_0x58ba('0x34')]=qs[_0x58ba('0x35')](_0x5c0c06['query']['sort']);_0x13e87b[_0x58ba('0x36')]=qs[_0x58ba('0x2e')](_[_0x58ba('0x37')](_0x5c0c06['query'],_0x596236[_0x58ba('0x2e')]),_0x14cf8a);if(_0x5c0c06[_0x58ba('0x2d')]['filter']){_0x13e87b['where']=_['merge'](_0x13e87b['where'],{'$or':_[_0x58ba('0x2c')](_0x14cf8a,function(_0x407605){if(_0x407605[_0x58ba('0x29')]!=='VIRTUAL'){var _0x12a7e1={};_0x12a7e1[_0x407605[_0x58ba('0x25')]]={'$like':'%'+_0x5c0c06['query'][_0x58ba('0x38')]+'%'};return _0x12a7e1;}})});}_0x13e87b=_[_0x58ba('0x39')]({},_0x13e87b,_0x5c0c06[_0x58ba('0x3a')]);var _0x42627c={'where':_0x13e87b['where']};return db[_0x58ba('0x3b')][_0x58ba('0x1c')](_0x42627c)[_0x58ba('0x22')](function(_0x19ed83){_0x30238b['count']=_0x19ed83;if(_0x5c0c06[_0x58ba('0x2d')]['includeAll']){_0x13e87b[_0x58ba('0x3c')]=[{'all':!![]}];}return db[_0x58ba('0x3b')][_0x58ba('0x3d')](_0x13e87b);})[_0x58ba('0x22')](function(_0x5ae58d){_0x30238b['rows']=_0x5ae58d;return _0x30238b;})['then'](respondWithFilteredResult(_0x48f91a,_0x13e87b))[_0x58ba('0x3e')](handleError(_0x48f91a,null));};exports[_0x58ba('0x3f')]=function(_0x1dddb2,_0x2703c3){var _0x78ce83={'raw':!![],'where':{'id':_0x1dddb2[_0x58ba('0x40')]['id']}},_0x32665e={};_0x32665e[_0x58ba('0x2b')]=_[_0x58ba('0x41')](db[_0x58ba('0x3b')][_0x58ba('0x42')]);_0x32665e[_0x58ba('0x2d')]=_[_0x58ba('0x41')](_0x1dddb2[_0x58ba('0x2d')]);_0x32665e[_0x58ba('0x2e')]=_[_0x58ba('0x2f')](_0x32665e[_0x58ba('0x2b')],_0x32665e['query']);_0x78ce83['attributes']=_[_0x58ba('0x2f')](_0x32665e['model'],qs[_0x58ba('0x30')](_0x1dddb2[_0x58ba('0x2d')][_0x58ba('0x30')]));_0x78ce83['attributes']=_0x78ce83[_0x58ba('0x31')][_0x58ba('0x32')]?_0x78ce83[_0x58ba('0x31')]:_0x32665e['model'];if(_0x1dddb2[_0x58ba('0x2d')][_0x58ba('0x43')]){_0x78ce83[_0x58ba('0x3c')]=[{'all':!![]}];}_0x78ce83=_[_0x58ba('0x39')]({},_0x78ce83,_0x1dddb2[_0x58ba('0x3a')]);return db[_0x58ba('0x3b')][_0x58ba('0x44')](_0x78ce83)['then'](handleEntityNotFound(_0x2703c3,null))['then'](respondWithResult(_0x2703c3,null))['catch'](handleError(_0x2703c3,null));};exports['create']=function(_0xefdb6d,_0x31a2b8){return db[_0x58ba('0x3b')]['create'](_0xefdb6d[_0x58ba('0x45')],{})[_0x58ba('0x22')](respondWithResult(_0x31a2b8,0xc9))[_0x58ba('0x3e')](handleError(_0x31a2b8,null));};exports[_0x58ba('0x21')]=function(_0x582f51,_0x191c8f){if(_0x582f51[_0x58ba('0x45')]['id']){delete _0x582f51[_0x58ba('0x45')]['id'];}return db[_0x58ba('0x3b')][_0x58ba('0x44')]({'where':{'id':_0x582f51[_0x58ba('0x40')]['id']}})[_0x58ba('0x22')](handleEntityNotFound(_0x191c8f,null))['then'](saveUpdates(_0x582f51['body'],null))[_0x58ba('0x22')](respondWithResult(_0x191c8f,null))[_0x58ba('0x3e')](handleError(_0x191c8f,null));};exports['destroy']=function(_0x495c8a,_0x4f8eed){return db[_0x58ba('0x3b')][_0x58ba('0x44')]({'where':{'id':_0x495c8a[_0x58ba('0x40')]['id']}})[_0x58ba('0x22')](handleEntityNotFound(_0x4f8eed,null))[_0x58ba('0x22')](removeEntity(_0x4f8eed,null))['catch'](handleError(_0x4f8eed,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 33b24c4..1271355 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 _0x1c58=['DeskField','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x34ddee,_0x4ba642){var _0x256bb9=function(_0x497071){while(--_0x497071){_0x34ddee['push'](_0x34ddee['shift']());}};_0x256bb9(++_0x4ba642);}(_0x1c58,0x1d1));var _0x81c5=function(_0x2ce069,_0x5ecd19){_0x2ce069=_0x2ce069-0x0;var _0x528d33=_0x1c58[_0x2ce069];return _0x528d33;};'use strict';var _=require(_0x81c5('0x0'));var util=require(_0x81c5('0x1'));var logger=require(_0x81c5('0x2'))('api');var moment=require(_0x81c5('0x3'));var BPromise=require(_0x81c5('0x4'));var rp=require(_0x81c5('0x5'));var fs=require('fs');var path=require(_0x81c5('0x6'));var rimraf=require(_0x81c5('0x7'));var config=require(_0x81c5('0x8'));var attributes=require('./intDeskField.attributes');module[_0x81c5('0x9')]=function(_0x381ce5,_0xd4cfa3){return _0x381ce5[_0x81c5('0xa')](_0x81c5('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x81c5('0xc'),_0x81c5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93f3=['api','moment','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x93f3,0x116));var _0x393f=function(_0x5b68ad,_0x51cfd8){_0x5b68ad=_0x5b68ad-0x0;var _0x3800f8=_0x93f3[_0x5b68ad];return _0x3800f8;};'use strict';var _=require('lodash');var util=require(_0x393f('0x0'));var logger=require(_0x393f('0x1'))(_0x393f('0x2'));var moment=require(_0x393f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x393f('0x4'));var rimraf=require(_0x393f('0x5'));var config=require(_0x393f('0x6'));var attributes=require(_0x393f('0x7'));module[_0x393f('0x8')]=function(_0x35cb70,_0x514b01){return _0x35cb70[_0x393f('0x9')]('DeskField',attributes,{'tableName':_0x393f('0xa'),'paranoid':![],'indexes':[{'name':_0x393f('0xb'),'fields':[_0x393f('0xc'),_0x393f('0xd')],'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 9dcb8d1..599b1e6 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 _0x90b4=['client','http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x47968c,_0x378d9d){var _0x44045a=function(_0x5c0a77){while(--_0x5c0a77){_0x47968c['push'](_0x47968c['shift']());}};_0x44045a(++_0x378d9d);}(_0x90b4,0x1ae));var _0x490b=function(_0x4355a9,_0x4d3871){_0x4355a9=_0x4355a9-0x0;var _0x5e3a3f=_0x90b4[_0x4355a9];return _0x5e3a3f;};'use strict';var _=require(_0x490b('0x0'));var util=require(_0x490b('0x1'));var moment=require(_0x490b('0x2'));var BPromise=require(_0x490b('0x3'));var rs=require(_0x490b('0x4'));var fs=require('fs');var Redis=require(_0x490b('0x5'));var db=require(_0x490b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x490b('0x7'))(_0x490b('0x8'));var config=require(_0x490b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x490b('0xa')][_0x490b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46f530,_0x44845c,_0x3e8484){return new BPromise(function(_0x204abb,_0x3d71d1){return client['request'](_0x46f530,_0x3e8484)[_0x490b('0xc')](function(_0x4f43d6){logger['info'](_0x490b('0xd'),_0x44845c,_0x490b('0xe'));logger[_0x490b('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x44845c,_0x490b('0xe'),JSON[_0x490b('0x10')](_0x4f43d6));if(_0x4f43d6[_0x490b('0x11')]){if(_0x4f43d6['error'][_0x490b('0x12')]===0x1f4){logger[_0x490b('0x11')](_0x490b('0xd'),_0x44845c,_0x4f43d6[_0x490b('0x11')]['message']);return _0x3d71d1(_0x4f43d6[_0x490b('0x11')][_0x490b('0x13')]);}logger[_0x490b('0x11')](_0x490b('0xd'),_0x44845c,_0x4f43d6[_0x490b('0x11')][_0x490b('0x13')]);return _0x204abb(_0x4f43d6[_0x490b('0x11')][_0x490b('0x13')]);}else{logger['info'](_0x490b('0xd'),_0x44845c,_0x490b('0xe'));_0x204abb(_0x4f43d6[_0x490b('0x14')][_0x490b('0x13')]);}})[_0x490b('0x15')](function(_0x800ca6){logger[_0x490b('0x11')](_0x490b('0xd'),_0x44845c,_0x800ca6);_0x3d71d1(_0x800ca6);});});} \ No newline at end of file +var _0x76fa=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x30303e,_0x40fce4){var _0x1d52f3=function(_0x447753){while(--_0x447753){_0x30303e['push'](_0x30303e['shift']());}};_0x1d52f3(++_0x40fce4);}(_0x76fa,0x1f1));var _0xa76f=function(_0x2854e9,_0x4022bd){_0x2854e9=_0x2854e9-0x0;var _0x69dd78=_0x76fa[_0x2854e9];return _0x69dd78;};'use strict';var _=require(_0xa76f('0x0'));var util=require(_0xa76f('0x1'));var moment=require('moment');var BPromise=require(_0xa76f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa76f('0x3'));var db=require(_0xa76f('0x4'))['db'];var utils=require(_0xa76f('0x5'));var logger=require(_0xa76f('0x6'))(_0xa76f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa76f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2449,_0xe936c1,_0x4abf51){return new BPromise(function(_0x32a790,_0x4a3ca3){return client['request'](_0x1b2449,_0x4abf51)[_0xa76f('0x9')](function(_0xe5a4e5){logger[_0xa76f('0xa')](_0xa76f('0xb'),_0xe936c1,'request\x20sent');logger[_0xa76f('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0xe936c1,_0xa76f('0xd'),JSON['stringify'](_0xe5a4e5));if(_0xe5a4e5[_0xa76f('0xe')]){if(_0xe5a4e5[_0xa76f('0xe')][_0xa76f('0xf')]===0x1f4){logger[_0xa76f('0xe')]('DeskField,\x20%s,\x20%s',_0xe936c1,_0xe5a4e5[_0xa76f('0xe')][_0xa76f('0x10')]);return _0x4a3ca3(_0xe5a4e5['error'][_0xa76f('0x10')]);}logger[_0xa76f('0xe')]('DeskField,\x20%s,\x20%s',_0xe936c1,_0xe5a4e5[_0xa76f('0xe')]['message']);return _0x32a790(_0xe5a4e5['error'][_0xa76f('0x10')]);}else{logger['info'](_0xa76f('0xb'),_0xe936c1,_0xa76f('0xd'));_0x32a790(_0xe5a4e5[_0xa76f('0x11')][_0xa76f('0x10')]);}})[_0xa76f('0x12')](function(_0x17cac4){logger['error'](_0xa76f('0xb'),_0xe936c1,_0x17cac4);_0x4a3ca3(_0x17cac4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d047fd8..ddb54de 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 _0x4248=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x5cca9f,_0x154684){var _0x55edda=function(_0x115aa2){while(--_0x115aa2){_0x5cca9f['push'](_0x5cca9f['shift']());}};_0x55edda(++_0x154684);}(_0x4248,0x1ac));var _0x8424=function(_0x15876c,_0x510dd4){_0x15876c=_0x15876c-0x0;var _0x39d91b=_0x4248[_0x15876c];return _0x39d91b;};'use strict';var multer=require(_0x8424('0x0'));var util=require('util');var path=require(_0x8424('0x1'));var timeout=require(_0x8424('0x2'));var express=require('express');var router=express[_0x8424('0x3')]();var fs_extra=require(_0x8424('0x4'));var auth=require(_0x8424('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8424('0x6'));var controller=require(_0x8424('0x7'));router[_0x8424('0x8')]('/',auth[_0x8424('0x9')](),controller['index']);router[_0x8424('0x8')](_0x8424('0xa'),auth[_0x8424('0x9')](),controller[_0x8424('0xb')]);router['get'](_0x8424('0xc'),auth['isAuthenticated'](),controller[_0x8424('0xd')]);router[_0x8424('0x8')](_0x8424('0xe'),auth['isAuthenticated'](),controller[_0x8424('0xf')]);router[_0x8424('0x10')]('/',auth[_0x8424('0x9')](),controller['create']);router[_0x8424('0x10')](_0x8424('0xc'),auth[_0x8424('0x9')](),controller[_0x8424('0x11')]);router[_0x8424('0x12')]('/:id',auth[_0x8424('0x9')](),controller['update']);router[_0x8424('0x13')]('/:id',auth[_0x8424('0x9')](),controller['destroy']);module[_0x8424('0x14')]=router; \ No newline at end of file +var _0xb38d=['update','delete','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','put'];(function(_0xc3a262,_0x5ccdab){var _0x5679ec=function(_0x16001b){while(--_0x16001b){_0xc3a262['push'](_0xc3a262['shift']());}};_0x5679ec(++_0x5ccdab);}(_0xb38d,0xa6));var _0xdb38=function(_0x267ce4,_0x7db485){_0x267ce4=_0x267ce4-0x0;var _0x32b33b=_0xb38d[_0x267ce4];return _0x32b33b;};'use strict';var multer=require(_0xdb38('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb38('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb38('0x2'));var interaction=require(_0xdb38('0x3'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0xdb38('0x4')](),controller[_0xdb38('0x5')]);router[_0xdb38('0x6')](_0xdb38('0x7'),auth[_0xdb38('0x4')](),controller[_0xdb38('0x8')]);router[_0xdb38('0x6')](_0xdb38('0x9'),auth[_0xdb38('0x4')](),controller['getConfigurations']);router[_0xdb38('0x6')](_0xdb38('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xdb38('0xb')]('/',auth[_0xdb38('0x4')](),controller['create']);router[_0xdb38('0xb')](_0xdb38('0x9'),auth[_0xdb38('0x4')](),controller[_0xdb38('0xc')]);router[_0xdb38('0xd')](_0xdb38('0x7'),auth[_0xdb38('0x4')](),controller[_0xdb38('0xe')]);router[_0xdb38('0xf')]('/:id',auth[_0xdb38('0x4')](),controller[_0xdb38('0x10')]);module[_0xdb38('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a69a6f4..2a1ff23 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 _0xaf1b=['STRING','BOOLEAN','sequelize','exports'];(function(_0x435bff,_0x43bfdd){var _0x2bd5b6=function(_0x342835){while(--_0x342835){_0x435bff['push'](_0x435bff['shift']());}};_0x2bd5b6(++_0x43bfdd);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x1f3a8e,_0x2ff3fd){_0x1f3a8e=_0x1f3a8e-0x0;var _0x27cde4=_0xaf1b[_0x1f3a8e];return _0x27cde4;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'name':{'type':Sequelize[_0xbaf1('0x2')]},'username':{'type':Sequelize[_0xbaf1('0x2')]},'password':{'type':Sequelize[_0xbaf1('0x2')]},'remoteUri':{'type':Sequelize[_0xbaf1('0x2')]},'tenantId':{'type':Sequelize[_0xbaf1('0x2')]},'clientId':{'type':Sequelize[_0xbaf1('0x2')]},'clientSecret':{'type':Sequelize[_0xbaf1('0x2')]},'serverUrl':{'type':Sequelize[_0xbaf1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbaf1('0x2')]},'modernAuthentication':{'type':Sequelize[_0xbaf1('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa13d=['BOOLEAN','sequelize','STRING'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0xa13d,0x154));var _0xda13=function(_0x5f3c34,_0x3fb6a0){_0x5f3c34=_0x5f3c34-0x0;var _0x51d741=_0xa13d[_0x5f3c34];return _0x51d741;};'use strict';var Sequelize=require(_0xda13('0x0'));module['exports']={'name':{'type':Sequelize[_0xda13('0x1')]},'username':{'type':Sequelize[_0xda13('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xda13('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xda13('0x1')]},'clientSecret':{'type':Sequelize[_0xda13('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xda13('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 22fd2b1..4c8c8ee 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 _0x459c=['%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','owneridname','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','https://login.microsoftonline.com/','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','MetadataId','forEach','isNil','push','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','all','statusCode','error','send',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','Content-Range','update','destroy','then','sendStatus','stack','name','index','map','Dynamics365Account','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','length','include','find','create','body','params','getConfigurations','Dynamics365Configuration','sort','nolimit','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','Dynamics365Field','slice','substring'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x459c,0x12b));var _0xc459=function(_0x38cc75,_0x1706e6){_0x38cc75=_0x38cc75-0x0;var _0x3ca60f=_0x459c[_0x38cc75];return _0x3ca60f;};'use strict';var rp=require('request-promise');var util=require(_0xc459('0x0'));var _=require('lodash');var qs=require(_0xc459('0x1'));var logger=require(_0xc459('0x2'))(_0xc459('0x3'));var db=require(_0xc459('0x4'))['db'];var integrations=require(_0xc459('0x5'));function respondWithResult(_0x23fd3c,_0xaf1655){_0xaf1655=_0xaf1655||0xc8;return function(_0x14bdb6){if(_0x14bdb6){return _0x23fd3c['status'](_0xaf1655)[_0xc459('0x6')](_0x14bdb6);}};}function respondWithFilteredResult(_0x105dbe,_0x5a41d6){return function(_0x51dcc0){if(_0x51dcc0){var _0x2bc5b9=typeof _0x5a41d6[_0xc459('0x7')]===_0xc459('0x8')&&typeof _0x5a41d6[_0xc459('0x9')]===_0xc459('0x8');var _0x40857f=_0x51dcc0[_0xc459('0xa')];var _0x4883a3=_0x2bc5b9?0x0:_0x5a41d6[_0xc459('0x7')];var _0x4312b5=_0x2bc5b9?_0x51dcc0[_0xc459('0xa')]:_0x5a41d6['offset']+_0x5a41d6[_0xc459('0x9')];var _0x5e765f;if(_0x4312b5>=_0x40857f){_0x4312b5=_0x40857f;_0x5e765f=0xc8;}else{_0x5e765f=0xce;}_0x105dbe[_0xc459('0xb')](_0x5e765f);return _0x105dbe['set'](_0xc459('0xc'),_0x4883a3+'-'+_0x4312b5+'/'+_0x40857f)[_0xc459('0x6')](_0x51dcc0);}return null;};}function saveUpdates(_0x196320){return function(_0x4fd627){if(_0x4fd627){return _0x4fd627[_0xc459('0xd')](_0x196320)['then'](function(_0x46577c){return _0x46577c;});}return null;};}function removeEntity(_0x4fb98e){return function(_0x3fa44a){if(_0x3fa44a){return _0x3fa44a[_0xc459('0xe')]()[_0xc459('0xf')](function(){_0x4fb98e[_0xc459('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x138406){return function(_0x53c032){if(!_0x53c032){_0x138406[_0xc459('0x10')](0x194);}return _0x53c032;};}function handleError(_0x4b6099,_0x1b9536){_0x1b9536=_0x1b9536||0x1f4;return function(_0xeef20c){logger['error'](_0xeef20c[_0xc459('0x11')]);if(_0xeef20c[_0xc459('0x12')]){delete _0xeef20c[_0xc459('0x12')];}_0x4b6099['status'](_0x1b9536)['send'](_0xeef20c);};}exports[_0xc459('0x13')]=function(_0x4f9fe2,_0x197708){var _0x6bb6f3={},_0x47af3f={},_0x55e2f0={'count':0x0,'rows':[]};var _0x63848b=_[_0xc459('0x14')](db[_0xc459('0x15')]['rawAttributes'],function(_0x46ffbe){return{'name':_0x46ffbe[_0xc459('0x16')],'type':_0x46ffbe[_0xc459('0x17')][_0xc459('0x18')]};});_0x47af3f['model']=_[_0xc459('0x14')](_0x63848b,_0xc459('0x12'));_0x47af3f[_0xc459('0x19')]=_['keys'](_0x4f9fe2[_0xc459('0x19')]);_0x47af3f[_0xc459('0x1a')]=_[_0xc459('0x1b')](_0x47af3f[_0xc459('0x1c')],_0x47af3f[_0xc459('0x19')]);_0x6bb6f3['attributes']=_[_0xc459('0x1b')](_0x47af3f['model'],qs['fields'](_0x4f9fe2[_0xc459('0x19')][_0xc459('0x1d')]));_0x6bb6f3[_0xc459('0x1e')]=_0x6bb6f3['attributes']['length']?_0x6bb6f3[_0xc459('0x1e')]:_0x47af3f[_0xc459('0x1c')];if(!_0x4f9fe2[_0xc459('0x19')][_0xc459('0x1f')]('nolimit')){_0x6bb6f3[_0xc459('0x9')]=qs[_0xc459('0x9')](_0x4f9fe2[_0xc459('0x19')][_0xc459('0x9')]);_0x6bb6f3[_0xc459('0x7')]=qs[_0xc459('0x7')](_0x4f9fe2['query']['offset']);}_0x6bb6f3[_0xc459('0x20')]=qs['sort'](_0x4f9fe2[_0xc459('0x19')]['sort']);_0x6bb6f3[_0xc459('0x21')]=qs[_0xc459('0x1a')](_[_0xc459('0x22')](_0x4f9fe2[_0xc459('0x19')],_0x47af3f[_0xc459('0x1a')]),_0x63848b);if(_0x4f9fe2[_0xc459('0x19')][_0xc459('0x23')]){_0x6bb6f3[_0xc459('0x21')]=_[_0xc459('0x24')](_0x6bb6f3[_0xc459('0x21')],{'$or':_[_0xc459('0x14')](_0x63848b,function(_0x333be6){if(_0x333be6['type']!==_0xc459('0x25')){var _0x359736={};_0x359736[_0x333be6[_0xc459('0x12')]]={'$like':'%'+_0x4f9fe2[_0xc459('0x19')][_0xc459('0x23')]+'%'};return _0x359736;}})});}_0x6bb6f3=_['merge']({},_0x6bb6f3,_0x4f9fe2[_0xc459('0x26')]);var _0x1ed971={'where':_0x6bb6f3['where']};return db[_0xc459('0x15')][_0xc459('0xa')](_0x1ed971)[_0xc459('0xf')](function(_0x3e8bb){_0x55e2f0[_0xc459('0xa')]=_0x3e8bb;if(_0x4f9fe2[_0xc459('0x19')][_0xc459('0x27')]){_0x6bb6f3['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0xc459('0x28')](_0x6bb6f3);})['then'](function(_0x176574){_0x55e2f0[_0xc459('0x29')]=_0x176574;return _0x55e2f0;})['then'](respondWithFilteredResult(_0x197708,_0x6bb6f3))[_0xc459('0x2a')](handleError(_0x197708,null));};exports[_0xc459('0x2b')]=function(_0x4fd9c1,_0x3dd8ee){var _0x48c7da={'raw':![],'where':{'id':_0x4fd9c1['params']['id']}},_0x4e8e1f={};_0x4e8e1f['model']=_[_0xc459('0x2c')](db[_0xc459('0x15')][_0xc459('0x2d')]);_0x4e8e1f[_0xc459('0x19')]=_[_0xc459('0x2c')](_0x4fd9c1['query']);_0x4e8e1f[_0xc459('0x1a')]=_['intersection'](_0x4e8e1f[_0xc459('0x1c')],_0x4e8e1f[_0xc459('0x19')]);_0x48c7da[_0xc459('0x1e')]=_[_0xc459('0x1b')](_0x4e8e1f[_0xc459('0x1c')],qs['fields'](_0x4fd9c1[_0xc459('0x19')][_0xc459('0x1d')]));_0x48c7da[_0xc459('0x1e')]=_0x48c7da[_0xc459('0x1e')][_0xc459('0x2e')]?_0x48c7da[_0xc459('0x1e')]:_0x4e8e1f['model'];if(_0x4fd9c1['query'][_0xc459('0x27')]){_0x48c7da[_0xc459('0x2f')]=[{'all':!![]}];}_0x48c7da=_['merge']({},_0x48c7da,_0x4fd9c1[_0xc459('0x26')]);return db[_0xc459('0x15')][_0xc459('0x30')](_0x48c7da)[_0xc459('0xf')](handleEntityNotFound(_0x3dd8ee,null))[_0xc459('0xf')](respondWithResult(_0x3dd8ee,null))[_0xc459('0x2a')](handleError(_0x3dd8ee,null));};exports[_0xc459('0x31')]=function(_0x15fc68,_0x325b0b){return db[_0xc459('0x15')][_0xc459('0x31')](_0x15fc68[_0xc459('0x32')],{})['then'](respondWithResult(_0x325b0b,0xc9))[_0xc459('0x2a')](handleError(_0x325b0b,null));};exports[_0xc459('0xd')]=function(_0x5e3a7d,_0x24ce3e){if(_0x5e3a7d['body']['id']){delete _0x5e3a7d[_0xc459('0x32')]['id'];}return db[_0xc459('0x15')]['find']({'where':{'id':_0x5e3a7d[_0xc459('0x33')]['id']}})[_0xc459('0xf')](handleEntityNotFound(_0x24ce3e,null))['then'](saveUpdates(_0x5e3a7d['body'],null))[_0xc459('0xf')](respondWithResult(_0x24ce3e,null))[_0xc459('0x2a')](handleError(_0x24ce3e,null));};exports[_0xc459('0xe')]=function(_0x43a550,_0x2adf90){return db[_0xc459('0x15')][_0xc459('0x30')]({'where':{'id':_0x43a550[_0xc459('0x33')]['id']}})['then'](handleEntityNotFound(_0x2adf90,null))['then'](removeEntity(_0x2adf90,null))[_0xc459('0x2a')](handleError(_0x2adf90,null));};exports[_0xc459('0x34')]=function(_0x464da3,_0x5a4fc1){var _0x2c22a9={};var _0x5cad29={};var _0x5c6422;var _0x392f7f;return db[_0xc459('0x15')]['findOne']({'where':{'id':_0x464da3[_0xc459('0x33')]['id']}})[_0xc459('0xf')](handleEntityNotFound(_0x5a4fc1,null))[_0xc459('0xf')](function(_0x590a7a){if(_0x590a7a){_0x5c6422=_0x590a7a;_0x5cad29[_0xc459('0x1c')]=_[_0xc459('0x2c')](db[_0xc459('0x35')][_0xc459('0x2d')]);_0x5cad29[_0xc459('0x19')]=_[_0xc459('0x2c')](_0x464da3[_0xc459('0x19')]);_0x5cad29['filters']=_[_0xc459('0x1b')](_0x5cad29[_0xc459('0x1c')],_0x5cad29[_0xc459('0x19')]);_0x2c22a9[_0xc459('0x1e')]=_[_0xc459('0x1b')](_0x5cad29['model'],qs['fields'](_0x464da3[_0xc459('0x19')][_0xc459('0x1d')]));_0x2c22a9[_0xc459('0x1e')]=_0x2c22a9[_0xc459('0x1e')]['length']?_0x2c22a9['attributes']:_0x5cad29[_0xc459('0x1c')];_0x2c22a9[_0xc459('0x20')]=qs[_0xc459('0x36')](_0x464da3[_0xc459('0x19')][_0xc459('0x36')]);_0x2c22a9['where']=qs['filters'](_['pick'](_0x464da3['query'],_0x5cad29[_0xc459('0x1a')]));if(_0x464da3[_0xc459('0x19')]['filter']){_0x2c22a9[_0xc459('0x21')]=_['merge'](_0x2c22a9['where'],{'$or':_[_0xc459('0x14')](_0x2c22a9['attributes'],function(_0xde52c8){var _0x68b9b0={};_0x68b9b0[_0xde52c8]={'$like':'%'+_0x464da3['query'][_0xc459('0x23')]+'%'};return _0x68b9b0;})});}_0x2c22a9=_[_0xc459('0x24')]({},_0x2c22a9,_0x464da3[_0xc459('0x26')]);return _0x5c6422['getConfigurations'](_0x2c22a9);}})[_0xc459('0xf')](function(_0x29b6af){if(_0x29b6af){_0x392f7f=_0x29b6af['length'];if(!_0x464da3[_0xc459('0x19')][_0xc459('0x1f')](_0xc459('0x37'))){_0x2c22a9[_0xc459('0x9')]=qs[_0xc459('0x9')](_0x464da3[_0xc459('0x19')][_0xc459('0x9')]);_0x2c22a9['offset']=qs[_0xc459('0x7')](_0x464da3[_0xc459('0x19')][_0xc459('0x7')]);}return _0x5c6422['getConfigurations'](_0x2c22a9);}})[_0xc459('0xf')](function(_0x5a9f65){if(_0x5a9f65){return _0x5a9f65?{'count':_0x392f7f,'rows':_0x5a9f65}:null;}})['then'](respondWithResult(_0x5a4fc1,null))[_0xc459('0x2a')](handleError(_0x5a4fc1,null));};exports[_0xc459('0x38')]=function(_0x1bce2d,_0x1c8bfd){if(_0x1bce2d[_0xc459('0x32')]['id']){delete _0x1bce2d[_0xc459('0x32')]['id'];}return db[_0xc459('0x15')][_0xc459('0x39')]({'where':{'id':_0x1bce2d[_0xc459('0x33')]['id']}})[_0xc459('0xf')](handleEntityNotFound(_0x1c8bfd,null))['then'](function(_0x460e8a){if(_0x460e8a){_0x1bce2d[_0xc459('0x32')][_0xc459('0x3a')]=_0x460e8a['id'];_0x1bce2d['body']['Subjects']=integrations[_0xc459('0x3b')](_0x1bce2d[_0xc459('0x32')][_0xc459('0x3c')],_0x1bce2d[_0xc459('0x32')][_0xc459('0x17')]);_0x1bce2d[_0xc459('0x32')][_0xc459('0x3d')]=integrations[_0xc459('0x3e')](_0x1bce2d['body'][_0xc459('0x3c')],_0x1bce2d['body']['type']);return db[_0xc459('0x35')][_0xc459('0x31')](_0x1bce2d[_0xc459('0x32')],{'include':[{'model':db['Dynamics365Field'],'as':_0xc459('0x3f')},{'model':db[_0xc459('0x40')],'as':_0xc459('0x3d')}]});}return null;})[_0xc459('0xf')](respondWithResult(_0x1c8bfd,null))[_0xc459('0x2a')](handleError(_0x1c8bfd,null));};function sanitizeRemoteUri(_0x1609e8){var _0x3ee4ab=_0x1609e8[_0xc459('0x41')](-0x1);if(_0x3ee4ab==='/')return _0x1609e8[_0xc459('0x42')](0x0,_0x1609e8['lastIndexOf'](_0x3ee4ab));return _0x1609e8;}function getWebApiUrl(_0x260e78){return util['format'](_0xc459('0x43'),_0x260e78);}exports['getFields']=function(_0x28b5b3,_0x48f4a2){var _0x3f0878=_0x28b5b3[_0xc459('0x19')][_0xc459('0x44')];var _0x2f961e=_0x3f0878===_0xc459('0x45')?_0xc459('0x46'):_0xc459('0x47');var _0x3eb36d='';var _0x2e387a='';var _0x47426f='';var _0x2315bd='';var _0x3ef67d='';var _0x1a20f3='';var _0x375faa='';var _0x134181='';var _0x306a74=[_0xc459('0x48'),_0xc459('0x49'),'customerid','ownerid',_0xc459('0x4a'),_0xc459('0x4b'),'phonenumber',_0xc459('0x4c'),'directioncode',_0xc459('0x4d')];var _0x95be0e=[_0xc459('0x4e'),_0xc459('0x4f'),_0xc459('0x50'),'billedserviceunits',_0xc459('0x51'),'contactidyominame',_0xc459('0x52'),'contractidname',_0xc459('0x53'),'createdbyexternalpartyyominame',_0xc459('0x54'),'createdbyyominame','createdon',_0xc459('0x55'),_0xc459('0x56'),_0xc459('0x57'),_0xc459('0x58'),_0xc459('0x59'),_0xc459('0x5a'),'entitlementidname',_0xc459('0x5b'),'entityimage_url',_0xc459('0x5c'),_0xc459('0x5d'),_0xc459('0x5e'),_0xc459('0x5f'),_0xc459('0x60'),_0xc459('0x61'),_0xc459('0x62'),'lastonholdtime','masteridname',_0xc459('0x63'),_0xc459('0x64'),'modifiedbyname',_0xc459('0x65'),_0xc459('0x66'),_0xc459('0x67'),_0xc459('0x68'),_0xc459('0x69'),'msdyn_iotalertname','numberofchildincidents',_0xc459('0x6a'),'overriddencreatedon',_0xc459('0x6b'),'owneridtype',_0xc459('0x6c'),_0xc459('0x6d'),_0xc459('0x6e'),'primarycontactidyominame','prioritycodename',_0xc459('0x6f'),_0xc459('0x70'),_0xc459('0x71'),'resolvebykpiidname','responseby',_0xc459('0x72'),_0xc459('0x73'),_0xc459('0x74'),_0xc459('0x75'),_0xc459('0x76'),_0xc459('0x77'),_0xc459('0x78'),_0xc459('0x79'),_0xc459('0x7a'),_0xc459('0x7b'),_0xc459('0x7c'),_0xc459('0x7d'),_0xc459('0x7e'),'utcconversiontimezonecode',_0xc459('0x7f')];var _0x5140a6=_0x306a74[_0xc459('0x80')](_0x95be0e);return db[_0xc459('0x15')][_0xc459('0x39')]({'where':{'id':_0x28b5b3['params']['id']},'attributes':['id','username',_0xc459('0x81'),_0xc459('0x82'),_0xc459('0x83'),_0xc459('0x84'),_0xc459('0x85'),_0xc459('0x86')],'include':[{'model':db[_0xc459('0x87')],'as':_0xc459('0x87'),'attributes':['id',_0xc459('0x88'),'data7']}]})[_0xc459('0xf')](handleEntityNotFound(_0x48f4a2,null))[_0xc459('0xf')](function(_0x4e61da){if(_0x4e61da){if(_0x4e61da[_0xc459('0x86')]){_0x4e61da[_0xc459('0x89')]=_0x4e61da[_0xc459('0x87')][_0xc459('0x88')];_0x134181=sanitizeRemoteUri(_0x4e61da[_0xc459('0x87')][_0xc459('0x8a')]);_0x375faa=getWebApiUrl(_0x134181);return _0x4e61da;}_0x134181=sanitizeRemoteUri(_0x4e61da[_0xc459('0x82')]);_0x375faa=getWebApiUrl(_0x134181);var _0x2916ae={'method':'POST','uri':_0xc459('0x8b')+_0x4e61da[_0xc459('0x83')]+'/oauth2/token','form':{'client_id':_0x4e61da['clientId'],'resource':_0x134181,'username':_0x4e61da[_0xc459('0x8c')],'password':_0x4e61da['password'],'grant_type':_0xc459('0x81'),'client_secret':_0x4e61da[_0xc459('0x85')]},'json':!![]};return rp(_0x2916ae);}})['then'](function(_0x12b1bc){_0x1a20f3=_0x12b1bc[_0xc459('0x89')];var _0x1d2231={'method':_0xc459('0x8d'),'uri':encodeURI(_0x375faa+_0xc459('0x8e')+_0x2f961e+'\x27'),'headers':{'Authorization':_0xc459('0x8f')+_0x1a20f3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d2231);})[_0xc459('0xf')](function(_0x208fd5){var _0x50fb1d=_0x208fd5[_0xc459('0x90')][0x0];var _0x6c958d=_0x50fb1d['MetadataId'];var _0x13d199={'method':'GET','uri':_0x375faa+_0xc459('0x91')+_0x6c958d+_0xc459('0x92'),'headers':{'Authorization':_0xc459('0x8f')+_0x1a20f3,'If-None-Match':null,'OData-Version':_0xc459('0x93')},'json':!![]};return rp(_0x13d199);})[_0xc459('0xf')](function(_0x13a003){_0x3eb36d=_0x13a003;_0x2e387a=_0x3eb36d[_0xc459('0x94')];_0x2e387a=_['remove'](_0x2e387a,function(_0x463e98){return!_0x5140a6['includes'](_0x463e98[_0xc459('0x95')]);});var _0xc333f9=[];var _0x10d26f=[];_0x2e387a['forEach'](function(_0x719516){if(_0x719516[_0xc459('0x96')]){var _0x422581=_0x719516[_0xc459('0x96')]['substring'](_0x719516[_0xc459('0x96')][_0xc459('0x97')]('.')+0x1);if(_0x422581===_0xc459('0x98')){_0xc333f9['push'](getSelectList(_0x375faa,_0x3f0878,_0x10d26f,_0x3eb36d[_0xc459('0x99')],_0x719516[_0xc459('0x99')],_0x1a20f3));}}});return Promise['all'](_0xc333f9);})['then'](function(_0x1a543d){_0x47426f=_0x1a543d[0x0];var _0x2bc91f=[];var _0x55f0ff=[];_0x2e387a[_0xc459('0x9a')](function(_0x50b74c){if(!_[_0xc459('0x9b')](_0x50b74c[_0xc459('0x96')])){var _0x1c7898=_0x50b74c[_0xc459('0x96')]['substring'](_0x50b74c[_0xc459('0x96')][_0xc459('0x97')]('.')+0x1);if(_0x1c7898==='BooleanAttributeMetadata'){_0x2bc91f[_0xc459('0x9c')](getBooleanList(_0x375faa,_0x3f0878,_0x55f0ff,_0x3eb36d[_0xc459('0x99')],_0x50b74c[_0xc459('0x99')],_0x1a20f3));}}});return Promise['all'](_0x2bc91f);})['then'](function(_0x2c4982){_0x2315bd=_0x2c4982[0x0];var _0xdfecc2=[];var _0x398b98=[];_0x2e387a['forEach'](function(_0x471f58){if(_0x471f58[_0xc459('0x96')]){var _0x4cd8ac=_0x471f58[_0xc459('0x96')]['substring'](_0x471f58['@odata.type']['lastIndexOf']('.')+0x1);if(_0x4cd8ac==='StringAttributeMetadata'||_0x4cd8ac==='DoubleAttributeMetadata'||_0x4cd8ac===_0xc459('0x9d')||_0x4cd8ac===_0xc459('0x9e')||_0x4cd8ac===_0xc459('0x9f')||_0x4cd8ac===_0xc459('0xa0')||_0x4cd8ac===_0xc459('0xa1')||_0x4cd8ac===_0xc459('0xa2')||_0x4cd8ac==='StateAttributeMetadata'||_0x4cd8ac===_0xc459('0xa3')){_0xdfecc2[_0xc459('0x9c')](getInputList(_0x375faa,_0x3f0878,_0x4cd8ac,_0x398b98,_0x3eb36d[_0xc459('0x99')],_0x471f58['MetadataId'],_0x1a20f3));}}});return Promise[_0xc459('0xa4')](_0xdfecc2);})[_0xc459('0xf')](function(_0x4d085d){_0x3ef67d=_0x4d085d[0x0];var _0x1b0985=_0x47426f[_0xc459('0x80')](_0x2315bd)[_0xc459('0x80')](_0x3ef67d);var _0x33f177={'count':_0x1b0985[_0xc459('0x2e')],'rows':_0x1b0985};return _0x33f177;})[_0xc459('0xf')](respondWithResult(_0x48f4a2,null))['catch'](function(_0x4906f9){var _0x2942f9=_0x28b5b3[_0xc459('0x19')]['test']?0x1f4:_0x4906f9[_0xc459('0xa5')]||0x1f4;logger[_0xc459('0xa6')](_0x4906f9[_0xc459('0x11')]);delete _0x4906f9[_0xc459('0x12')];if(_0x2942f9===0x191){_0x2942f9=0x190;}_0x48f4a2[_0xc459('0xb')](_0x2942f9)[_0xc459('0xa7')](_0x28b5b3['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x4906f9['statusCode']}:_0x4906f9);});};function getSelectList(_0x44a574,_0x20bf46,_0x56458,_0x2bc38d,_0x3637dc,_0x166880){var _0x34010d={'method':_0xc459('0x8d'),'uri':_0x44a574+'EntityDefinitions('+_0x2bc38d+')/Attributes('+_0x3637dc+_0xc459('0xa8')+_0xc459('0xa9'),'headers':{'Authorization':_0xc459('0x8f')+_0x166880,'If-None-Match':null,'OData-Version':_0xc459('0x93')},'json':!![]};return rp(_0x34010d)[_0xc459('0xf')](function(_0x268308){var _0x4df64c=[];var _0x52b50c=_0x268308[_0xc459('0xaa')][_0xc459('0xab')];_0x52b50c['forEach'](function(_0x20b549){_0x4df64c[_0xc459('0x9c')]({'name':_0x20b549[_0xc459('0xac')]['UserLocalizedLabel']['Label'],'value':String(_0x20b549[_0xc459('0xad')])});});var _0xeea8db={'id':_0x20bf46+'_'+_0x268308[_0xc459('0x95')],'name':_0x268308[_0xc459('0xae')][_0xc459('0xaf')]['Label'],'custom':![],'options':_0x4df64c};_0x56458[_0xc459('0x9c')](_0xeea8db);return _0x56458;});}function getBooleanList(_0x24e35f,_0x6c799b,_0x2acf78,_0x1aa839,_0xe0b980,_0x2ef91d){var _0x4ec398={'method':'GET','uri':_0x24e35f+_0xc459('0x91')+_0x1aa839+_0xc459('0xb0')+_0xe0b980+_0xc459('0xb1'),'headers':{'Authorization':_0xc459('0x8f')+_0x2ef91d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ec398)[_0xc459('0xf')](function(_0x9ab9ca){var _0x50214f=[];_0x50214f[_0xc459('0x9c')]({'name':_0x9ab9ca[_0xc459('0xaa')][_0xc459('0xb2')][_0xc459('0xac')][_0xc459('0xaf')][_0xc459('0xac')],'value':_0xc459('0xb3')},{'name':_0x9ab9ca[_0xc459('0xaa')][_0xc459('0xb4')]['Label'][_0xc459('0xaf')][_0xc459('0xac')],'value':_0xc459('0xb5')});var _0x3d428c={'id':_0x6c799b+'_'+_0x9ab9ca['LogicalName'],'name':_0x9ab9ca[_0xc459('0xae')][_0xc459('0xaf')][_0xc459('0xac')],'custom':![],'options':_0x50214f};_0x2acf78[_0xc459('0x9c')](_0x3d428c);return _0x2acf78;});}function getInputList(_0x4b5b6f,_0x310b9c,_0xbefece,_0x3ef6e9,_0x5e3cde,_0x66b094,_0x13e5f3){var _0x321fed={'method':_0xc459('0x8d'),'uri':_0x4b5b6f+_0xc459('0x91')+_0x5e3cde+')/Attributes('+_0x66b094+')/Microsoft.Dynamics.CRM.'+_0xbefece+_0xc459('0xb6'),'headers':{'Authorization':_0xc459('0x8f')+_0x13e5f3,'If-None-Match':null,'OData-Version':_0xc459('0x93')},'json':!![]};return rp(_0x321fed)['then'](function(_0x1a6707){var _0x3f5ffa={'id':_0x310b9c+'_'+_0x1a6707[_0xc459('0x95')],'name':_0x1a6707[_0xc459('0xae')][_0xc459('0xaf')]?_0x1a6707[_0xc459('0xae')][_0xc459('0xaf')][_0xc459('0xac')]:_0x1a6707[_0xc459('0x95')],'custom':![],'options':[]};_0x3ef6e9[_0xc459('0x9c')](_0x3f5ffa);return _0x3ef6e9;});} \ No newline at end of file +var _0x865c=['show','params','keys','create','body','update','find','findOne','Dynamics365Configuration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','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','push','isNil','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','api','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x865c,0x91));var _0xc865=function(_0x38112d,_0x31f071){_0x38112d=_0x38112d-0x0;var _0x32e277=_0x865c[_0x38112d];return _0x32e277;};'use strict';var rp=require(_0xc865('0x0'));var util=require(_0xc865('0x1'));var _=require('lodash');var qs=require(_0xc865('0x2'));var logger=require('../../config/logger')(_0xc865('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc865('0x4'));function respondWithResult(_0x3e0064,_0x382ffc){_0x382ffc=_0x382ffc||0xc8;return function(_0x9798a0){if(_0x9798a0){return _0x3e0064[_0xc865('0x5')](_0x382ffc)['json'](_0x9798a0);}};}function respondWithFilteredResult(_0x3fe9e1,_0x36404c){return function(_0x1897c0){if(_0x1897c0){var _0x2290c5=typeof _0x36404c[_0xc865('0x6')]===_0xc865('0x7')&&typeof _0x36404c[_0xc865('0x8')]===_0xc865('0x7');var _0x374800=_0x1897c0[_0xc865('0x9')];var _0x267e35=_0x2290c5?0x0:_0x36404c[_0xc865('0x6')];var _0x101c2f=_0x2290c5?_0x1897c0[_0xc865('0x9')]:_0x36404c['offset']+_0x36404c[_0xc865('0x8')];var _0x4a9bf2;if(_0x101c2f>=_0x374800){_0x101c2f=_0x374800;_0x4a9bf2=0xc8;}else{_0x4a9bf2=0xce;}_0x3fe9e1[_0xc865('0x5')](_0x4a9bf2);return _0x3fe9e1[_0xc865('0xa')](_0xc865('0xb'),_0x267e35+'-'+_0x101c2f+'/'+_0x374800)[_0xc865('0xc')](_0x1897c0);}return null;};}function saveUpdates(_0x4d0ff1){return function(_0xc14127){if(_0xc14127){return _0xc14127['update'](_0x4d0ff1)[_0xc865('0xd')](function(_0x5bf114){return _0x5bf114;});}return null;};}function removeEntity(_0x45cfd9){return function(_0x1af8df){if(_0x1af8df){return _0x1af8df[_0xc865('0xe')]()[_0xc865('0xd')](function(){_0x45cfd9[_0xc865('0x5')](0xcc)[_0xc865('0xf')]();});}};}function handleEntityNotFound(_0xc3c9dc){return function(_0x1b8db1){if(!_0x1b8db1){_0xc3c9dc[_0xc865('0x10')](0x194);}return _0x1b8db1;};}function handleError(_0x3c2bec,_0x130a0a){_0x130a0a=_0x130a0a||0x1f4;return function(_0x5c1799){logger[_0xc865('0x11')](_0x5c1799[_0xc865('0x12')]);if(_0x5c1799[_0xc865('0x13')]){delete _0x5c1799['name'];}_0x3c2bec[_0xc865('0x5')](_0x130a0a)[_0xc865('0x14')](_0x5c1799);};}exports[_0xc865('0x15')]=function(_0x8df587,_0x389562){var _0x1a3909={},_0x4fe4ab={},_0x3e2d17={'count':0x0,'rows':[]};var _0x5b35ac=_[_0xc865('0x16')](db[_0xc865('0x17')][_0xc865('0x18')],function(_0xcfdbf7){return{'name':_0xcfdbf7[_0xc865('0x19')],'type':_0xcfdbf7[_0xc865('0x1a')][_0xc865('0x1b')]};});_0x4fe4ab[_0xc865('0x1c')]=_[_0xc865('0x16')](_0x5b35ac,_0xc865('0x13'));_0x4fe4ab[_0xc865('0x1d')]=_['keys'](_0x8df587['query']);_0x4fe4ab[_0xc865('0x1e')]=_[_0xc865('0x1f')](_0x4fe4ab['model'],_0x4fe4ab['query']);_0x1a3909[_0xc865('0x20')]=_['intersection'](_0x4fe4ab[_0xc865('0x1c')],qs[_0xc865('0x21')](_0x8df587['query']['fields']));_0x1a3909[_0xc865('0x20')]=_0x1a3909['attributes'][_0xc865('0x22')]?_0x1a3909['attributes']:_0x4fe4ab[_0xc865('0x1c')];if(!_0x8df587[_0xc865('0x1d')][_0xc865('0x23')]('nolimit')){_0x1a3909[_0xc865('0x8')]=qs['limit'](_0x8df587[_0xc865('0x1d')]['limit']);_0x1a3909[_0xc865('0x6')]=qs['offset'](_0x8df587['query'][_0xc865('0x6')]);}_0x1a3909[_0xc865('0x24')]=qs[_0xc865('0x25')](_0x8df587[_0xc865('0x1d')]['sort']);_0x1a3909[_0xc865('0x26')]=qs['filters'](_[_0xc865('0x27')](_0x8df587[_0xc865('0x1d')],_0x4fe4ab[_0xc865('0x1e')]),_0x5b35ac);if(_0x8df587[_0xc865('0x1d')][_0xc865('0x28')]){_0x1a3909['where']=_[_0xc865('0x29')](_0x1a3909[_0xc865('0x26')],{'$or':_[_0xc865('0x16')](_0x5b35ac,function(_0x1d94fd){if(_0x1d94fd[_0xc865('0x1a')]!==_0xc865('0x2a')){var _0x5652aa={};_0x5652aa[_0x1d94fd['name']]={'$like':'%'+_0x8df587[_0xc865('0x1d')][_0xc865('0x28')]+'%'};return _0x5652aa;}})});}_0x1a3909=_[_0xc865('0x29')]({},_0x1a3909,_0x8df587[_0xc865('0x2b')]);var _0x27c654={'where':_0x1a3909[_0xc865('0x26')]};return db[_0xc865('0x17')][_0xc865('0x9')](_0x27c654)[_0xc865('0xd')](function(_0x28d1a3){_0x3e2d17['count']=_0x28d1a3;if(_0x8df587[_0xc865('0x1d')][_0xc865('0x2c')]){_0x1a3909[_0xc865('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xc865('0x2e')](_0x1a3909);})[_0xc865('0xd')](function(_0x37e05d){_0x3e2d17[_0xc865('0x2f')]=_0x37e05d;return _0x3e2d17;})[_0xc865('0xd')](respondWithFilteredResult(_0x389562,_0x1a3909))[_0xc865('0x30')](handleError(_0x389562,null));};exports[_0xc865('0x31')]=function(_0x43ef9c,_0x2b3c20){var _0x2d5a0c={'raw':![],'where':{'id':_0x43ef9c[_0xc865('0x32')]['id']}},_0x61d8eb={};_0x61d8eb['model']=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x61d8eb[_0xc865('0x1d')]=_[_0xc865('0x33')](_0x43ef9c[_0xc865('0x1d')]);_0x61d8eb[_0xc865('0x1e')]=_[_0xc865('0x1f')](_0x61d8eb[_0xc865('0x1c')],_0x61d8eb[_0xc865('0x1d')]);_0x2d5a0c[_0xc865('0x20')]=_['intersection'](_0x61d8eb[_0xc865('0x1c')],qs[_0xc865('0x21')](_0x43ef9c[_0xc865('0x1d')]['fields']));_0x2d5a0c['attributes']=_0x2d5a0c[_0xc865('0x20')][_0xc865('0x22')]?_0x2d5a0c[_0xc865('0x20')]:_0x61d8eb[_0xc865('0x1c')];if(_0x43ef9c['query'][_0xc865('0x2c')]){_0x2d5a0c[_0xc865('0x2d')]=[{'all':!![]}];}_0x2d5a0c=_['merge']({},_0x2d5a0c,_0x43ef9c[_0xc865('0x2b')]);return db[_0xc865('0x17')]['find'](_0x2d5a0c)[_0xc865('0xd')](handleEntityNotFound(_0x2b3c20,null))[_0xc865('0xd')](respondWithResult(_0x2b3c20,null))[_0xc865('0x30')](handleError(_0x2b3c20,null));};exports[_0xc865('0x34')]=function(_0x4d317e,_0x33a6c9){return db[_0xc865('0x17')]['create'](_0x4d317e[_0xc865('0x35')],{})[_0xc865('0xd')](respondWithResult(_0x33a6c9,0xc9))['catch'](handleError(_0x33a6c9,null));};exports[_0xc865('0x36')]=function(_0x4ab563,_0x2277e4){if(_0x4ab563[_0xc865('0x35')]['id']){delete _0x4ab563['body']['id'];}return db[_0xc865('0x17')]['find']({'where':{'id':_0x4ab563[_0xc865('0x32')]['id']}})[_0xc865('0xd')](handleEntityNotFound(_0x2277e4,null))['then'](saveUpdates(_0x4ab563[_0xc865('0x35')],null))[_0xc865('0xd')](respondWithResult(_0x2277e4,null))[_0xc865('0x30')](handleError(_0x2277e4,null));};exports['destroy']=function(_0x48f886,_0x339b43){return db[_0xc865('0x17')][_0xc865('0x37')]({'where':{'id':_0x48f886[_0xc865('0x32')]['id']}})[_0xc865('0xd')](handleEntityNotFound(_0x339b43,null))[_0xc865('0xd')](removeEntity(_0x339b43,null))[_0xc865('0x30')](handleError(_0x339b43,null));};exports['getConfigurations']=function(_0x5b6ffc,_0x23a0ff){var _0x413e85={};var _0x156465={};var _0x1104c7;var _0x27efd6;return db['Dynamics365Account'][_0xc865('0x38')]({'where':{'id':_0x5b6ffc['params']['id']}})[_0xc865('0xd')](handleEntityNotFound(_0x23a0ff,null))[_0xc865('0xd')](function(_0x1ddd25){if(_0x1ddd25){_0x1104c7=_0x1ddd25;_0x156465['model']=_['keys'](db[_0xc865('0x39')][_0xc865('0x18')]);_0x156465[_0xc865('0x1d')]=_[_0xc865('0x33')](_0x5b6ffc[_0xc865('0x1d')]);_0x156465[_0xc865('0x1e')]=_[_0xc865('0x1f')](_0x156465[_0xc865('0x1c')],_0x156465['query']);_0x413e85[_0xc865('0x20')]=_['intersection'](_0x156465[_0xc865('0x1c')],qs['fields'](_0x5b6ffc[_0xc865('0x1d')][_0xc865('0x21')]));_0x413e85[_0xc865('0x20')]=_0x413e85[_0xc865('0x20')][_0xc865('0x22')]?_0x413e85[_0xc865('0x20')]:_0x156465[_0xc865('0x1c')];_0x413e85['order']=qs[_0xc865('0x25')](_0x5b6ffc[_0xc865('0x1d')][_0xc865('0x25')]);_0x413e85[_0xc865('0x26')]=qs[_0xc865('0x1e')](_[_0xc865('0x27')](_0x5b6ffc[_0xc865('0x1d')],_0x156465['filters']));if(_0x5b6ffc[_0xc865('0x1d')]['filter']){_0x413e85['where']=_[_0xc865('0x29')](_0x413e85[_0xc865('0x26')],{'$or':_[_0xc865('0x16')](_0x413e85[_0xc865('0x20')],function(_0x17f86b){var _0x56edab={};_0x56edab[_0x17f86b]={'$like':'%'+_0x5b6ffc[_0xc865('0x1d')]['filter']+'%'};return _0x56edab;})});}_0x413e85=_[_0xc865('0x29')]({},_0x413e85,_0x5b6ffc[_0xc865('0x2b')]);return _0x1104c7[_0xc865('0x3a')](_0x413e85);}})[_0xc865('0xd')](function(_0x56e6ee){if(_0x56e6ee){_0x27efd6=_0x56e6ee[_0xc865('0x22')];if(!_0x5b6ffc['query']['hasOwnProperty'](_0xc865('0x3b'))){_0x413e85[_0xc865('0x8')]=qs[_0xc865('0x8')](_0x5b6ffc[_0xc865('0x1d')][_0xc865('0x8')]);_0x413e85['offset']=qs[_0xc865('0x6')](_0x5b6ffc['query'][_0xc865('0x6')]);}return _0x1104c7[_0xc865('0x3a')](_0x413e85);}})[_0xc865('0xd')](function(_0x3608e8){if(_0x3608e8){return _0x3608e8?{'count':_0x27efd6,'rows':_0x3608e8}:null;}})['then'](respondWithResult(_0x23a0ff,null))[_0xc865('0x30')](handleError(_0x23a0ff,null));};exports[_0xc865('0x3c')]=function(_0x1effe0,_0x1d635d){if(_0x1effe0[_0xc865('0x35')]['id']){delete _0x1effe0[_0xc865('0x35')]['id'];}return db[_0xc865('0x17')][_0xc865('0x38')]({'where':{'id':_0x1effe0[_0xc865('0x32')]['id']}})[_0xc865('0xd')](handleEntityNotFound(_0x1d635d,null))['then'](function(_0x21f4a7){if(_0x21f4a7){_0x1effe0[_0xc865('0x35')][_0xc865('0x3d')]=_0x21f4a7['id'];_0x1effe0[_0xc865('0x35')]['Subjects']=integrations[_0xc865('0x3e')](_0x1effe0[_0xc865('0x35')][_0xc865('0x3f')],_0x1effe0[_0xc865('0x35')][_0xc865('0x1a')]);_0x1effe0['body'][_0xc865('0x40')]=integrations[_0xc865('0x41')](_0x1effe0['body'][_0xc865('0x3f')],_0x1effe0['body']['type']);return db['Dynamics365Configuration'][_0xc865('0x34')](_0x1effe0[_0xc865('0x35')],{'include':[{'model':db['Dynamics365Field'],'as':_0xc865('0x42')},{'model':db[_0xc865('0x43')],'as':_0xc865('0x40')}]});}return null;})[_0xc865('0xd')](respondWithResult(_0x1d635d,null))['catch'](handleError(_0x1d635d,null));};function sanitizeRemoteUri(_0x3eb9c2){var _0x5f3e7f=_0x3eb9c2[_0xc865('0x44')](-0x1);if(_0x5f3e7f==='/')return _0x3eb9c2[_0xc865('0x45')](0x0,_0x3eb9c2[_0xc865('0x46')](_0x5f3e7f));return _0x3eb9c2;}function getWebApiUrl(_0xb88836){return util[_0xc865('0x47')](_0xc865('0x48'),_0xb88836);}exports['getFields']=function(_0x1db673,_0x5e4bbe){var _0x4e3cf5=_0x1db673[_0xc865('0x1d')][_0xc865('0x49')];var _0x258bd8=_0x4e3cf5===_0xc865('0x4a')?_0xc865('0x4b'):_0xc865('0x4c');var _0x51c883='';var _0x3b5897='';var _0x16ea4f='';var _0x49dc12='';var _0x120771='';var _0x28f1cb='';var _0x186b55='';var _0x2bed1b='';var _0x2c039f=['title',_0xc865('0x4d'),_0xc865('0x4e'),_0xc865('0x4f'),_0xc865('0x50'),_0xc865('0x51'),_0xc865('0x52'),_0xc865('0x53'),_0xc865('0x54'),_0xc865('0x55')];var _0x1e2c10=['accountidname',_0xc865('0x56'),_0xc865('0x57'),_0xc865('0x58'),'contactidname','contactidyominame',_0xc865('0x59'),_0xc865('0x5a'),_0xc865('0x5b'),_0xc865('0x5c'),_0xc865('0x5d'),'createdbyyominame',_0xc865('0x5e'),_0xc865('0x5f'),'createdonbehalfbyyominame',_0xc865('0x60'),_0xc865('0x61'),'customeridyominame',_0xc865('0x62'),_0xc865('0x63'),_0xc865('0x64'),_0xc865('0x65'),'escalatedon',_0xc865('0x66'),'firstresponsebykpiidname',_0xc865('0x67'),_0xc865('0x68'),_0xc865('0x69'),_0xc865('0x6a'),_0xc865('0x6b'),_0xc865('0x6c'),_0xc865('0x6d'),'modifiedbyexternalpartyyominame',_0xc865('0x6e'),_0xc865('0x6f'),'modifiedon',_0xc865('0x70'),_0xc865('0x71'),'msdyn_incidenttypename',_0xc865('0x72'),_0xc865('0x73'),_0xc865('0x74'),_0xc865('0x75'),_0xc865('0x76'),_0xc865('0x77'),_0xc865('0x78'),'parentcaseidname',_0xc865('0x79'),_0xc865('0x7a'),_0xc865('0x7b'),_0xc865('0x7c'),_0xc865('0x7d'),_0xc865('0x7e'),_0xc865('0x7f'),_0xc865('0x80'),'responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname',_0xc865('0x81'),_0xc865('0x82'),_0xc865('0x83'),_0xc865('0x84'),_0xc865('0x85'),_0xc865('0x86'),_0xc865('0x87'),_0xc865('0x88'),_0xc865('0x89'),_0xc865('0x8a'),'versionnumber'];var _0xc3da60=_0x2c039f[_0xc865('0x8b')](_0x1e2c10);return db[_0xc865('0x17')][_0xc865('0x38')]({'where':{'id':_0x1db673[_0xc865('0x32')]['id']},'attributes':['id',_0xc865('0x8c'),_0xc865('0x8d'),_0xc865('0x8e'),_0xc865('0x8f'),_0xc865('0x90'),'clientSecret',_0xc865('0x91')],'include':[{'model':db[_0xc865('0x92')],'as':_0xc865('0x92'),'attributes':['id',_0xc865('0x93'),_0xc865('0x94')]}]})[_0xc865('0xd')](handleEntityNotFound(_0x5e4bbe,null))['then'](function(_0x2b5099){if(_0x2b5099){if(_0x2b5099[_0xc865('0x91')]){_0x2b5099['access_token']=_0x2b5099[_0xc865('0x92')][_0xc865('0x93')];_0x2bed1b=sanitizeRemoteUri(_0x2b5099['CloudProvider']['data7']);_0x186b55=getWebApiUrl(_0x2bed1b);return _0x2b5099;}_0x2bed1b=sanitizeRemoteUri(_0x2b5099['remoteUri']);_0x186b55=getWebApiUrl(_0x2bed1b);var _0x96b865={'method':_0xc865('0x95'),'uri':_0xc865('0x96')+_0x2b5099[_0xc865('0x8f')]+_0xc865('0x97'),'form':{'client_id':_0x2b5099[_0xc865('0x90')],'resource':_0x2bed1b,'username':_0x2b5099[_0xc865('0x8c')],'password':_0x2b5099[_0xc865('0x8d')],'grant_type':_0xc865('0x8d'),'client_secret':_0x2b5099[_0xc865('0x98')]},'json':!![]};return rp(_0x96b865);}})[_0xc865('0xd')](function(_0xc0b922){_0x28f1cb=_0xc0b922[_0xc865('0x99')];var _0x4833ea={'method':_0xc865('0x9a'),'uri':encodeURI(_0x186b55+_0xc865('0x9b')+_0x258bd8+'\x27'),'headers':{'Authorization':_0xc865('0x9c')+_0x28f1cb,'If-None-Match':null,'OData-Version':_0xc865('0x9d')},'json':!![]};return rp(_0x4833ea);})[_0xc865('0xd')](function(_0x33dd8c){var _0x21235c=_0x33dd8c['value'][0x0];var _0x160cfc=_0x21235c[_0xc865('0x9e')];var _0x1bedc0={'method':_0xc865('0x9a'),'uri':_0x186b55+_0xc865('0x9f')+_0x160cfc+_0xc865('0xa0'),'headers':{'Authorization':_0xc865('0x9c')+_0x28f1cb,'If-None-Match':null,'OData-Version':_0xc865('0x9d')},'json':!![]};return rp(_0x1bedc0);})[_0xc865('0xd')](function(_0x44d9b4){_0x51c883=_0x44d9b4;_0x3b5897=_0x51c883[_0xc865('0xa1')];_0x3b5897=_[_0xc865('0xa2')](_0x3b5897,function(_0x4400f1){return!_0xc3da60[_0xc865('0xa3')](_0x4400f1[_0xc865('0xa4')]);});var _0x38c5f3=[];var _0xc48a8d=[];_0x3b5897[_0xc865('0xa5')](function(_0x1b85ad){if(_0x1b85ad[_0xc865('0xa6')]){var _0x1236b9=_0x1b85ad[_0xc865('0xa6')][_0xc865('0x45')](_0x1b85ad[_0xc865('0xa6')]['lastIndexOf']('.')+0x1);if(_0x1236b9==='PicklistAttributeMetadata'){_0x38c5f3[_0xc865('0xa7')](getSelectList(_0x186b55,_0x4e3cf5,_0xc48a8d,_0x51c883['MetadataId'],_0x1b85ad[_0xc865('0x9e')],_0x28f1cb));}}});return Promise['all'](_0x38c5f3);})[_0xc865('0xd')](function(_0x599847){_0x16ea4f=_0x599847[0x0];var _0x266a4c=[];var _0x2be072=[];_0x3b5897['forEach'](function(_0x5b41c6){if(!_[_0xc865('0xa8')](_0x5b41c6['@odata.type'])){var _0x59cad2=_0x5b41c6[_0xc865('0xa6')][_0xc865('0x45')](_0x5b41c6['@odata.type'][_0xc865('0x46')]('.')+0x1);if(_0x59cad2==='BooleanAttributeMetadata'){_0x266a4c['push'](getBooleanList(_0x186b55,_0x4e3cf5,_0x2be072,_0x51c883['MetadataId'],_0x5b41c6[_0xc865('0x9e')],_0x28f1cb));}}});return Promise[_0xc865('0xa9')](_0x266a4c);})[_0xc865('0xd')](function(_0x14b5f0){_0x49dc12=_0x14b5f0[0x0];var _0x208c37=[];var _0xab5c5d=[];_0x3b5897['forEach'](function(_0xd535d8){if(_0xd535d8[_0xc865('0xa6')]){var _0x24b6af=_0xd535d8['@odata.type']['substring'](_0xd535d8[_0xc865('0xa6')][_0xc865('0x46')]('.')+0x1);if(_0x24b6af===_0xc865('0xaa')||_0x24b6af===_0xc865('0xab')||_0x24b6af==='BigIntAttributeMetadata'||_0x24b6af===_0xc865('0xac')||_0x24b6af==='MemoAttributeMetadata'||_0x24b6af===_0xc865('0xad')||_0x24b6af===_0xc865('0xae')||_0x24b6af===_0xc865('0xaf')||_0x24b6af==='StateAttributeMetadata'||_0x24b6af===_0xc865('0xb0')){_0x208c37[_0xc865('0xa7')](getInputList(_0x186b55,_0x4e3cf5,_0x24b6af,_0xab5c5d,_0x51c883[_0xc865('0x9e')],_0xd535d8[_0xc865('0x9e')],_0x28f1cb));}}});return Promise[_0xc865('0xa9')](_0x208c37);})['then'](function(_0x2de878){_0x120771=_0x2de878[0x0];var _0x281794=_0x16ea4f[_0xc865('0x8b')](_0x49dc12)[_0xc865('0x8b')](_0x120771);var _0x4cf673={'count':_0x281794['length'],'rows':_0x281794};return _0x4cf673;})[_0xc865('0xd')](respondWithResult(_0x5e4bbe,null))[_0xc865('0x30')](function(_0x4433f4){var _0x5fde29=_0x1db673[_0xc865('0x1d')][_0xc865('0xb1')]?0x1f4:_0x4433f4[_0xc865('0xb2')]||0x1f4;logger[_0xc865('0x11')](_0x4433f4['stack']);delete _0x4433f4[_0xc865('0x13')];if(_0x5fde29===0x191){_0x5fde29=0x190;}_0x5e4bbe[_0xc865('0x5')](_0x5fde29)['send'](_0x1db673[_0xc865('0x1d')][_0xc865('0xb1')]?{'message':'Wrong\x20credentials','statusCode':_0x4433f4['statusCode']}:_0x4433f4);});};function getSelectList(_0x1646e6,_0x44d67d,_0x35ccc1,_0xbf5f65,_0x20f4c9,_0x38f266){var _0x19d187={'method':_0xc865('0x9a'),'uri':_0x1646e6+_0xc865('0x9f')+_0xbf5f65+_0xc865('0xb3')+_0x20f4c9+_0xc865('0xb4')+_0xc865('0xb5'),'headers':{'Authorization':_0xc865('0x9c')+_0x38f266,'If-None-Match':null,'OData-Version':_0xc865('0x9d')},'json':!![]};return rp(_0x19d187)['then'](function(_0x4e5c2f){var _0x1184d5=[];var _0x5f4066=_0x4e5c2f[_0xc865('0xb6')][_0xc865('0xb7')];_0x5f4066[_0xc865('0xa5')](function(_0x5f581b){_0x1184d5[_0xc865('0xa7')]({'name':_0x5f581b[_0xc865('0xb8')][_0xc865('0xb9')]['Label'],'value':String(_0x5f581b[_0xc865('0xba')])});});var _0x56caa2={'id':_0x44d67d+'_'+_0x4e5c2f[_0xc865('0xa4')],'name':_0x4e5c2f[_0xc865('0xbb')]['UserLocalizedLabel'][_0xc865('0xb8')],'custom':![],'options':_0x1184d5};_0x35ccc1['push'](_0x56caa2);return _0x35ccc1;});}function getBooleanList(_0x1da7b7,_0x53dde0,_0x186a6d,_0x291460,_0x429521,_0x2b7a7b){var _0x146bc9={'method':'GET','uri':_0x1da7b7+_0xc865('0x9f')+_0x291460+')/Attributes('+_0x429521+_0xc865('0xbc'),'headers':{'Authorization':_0xc865('0x9c')+_0x2b7a7b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x146bc9)[_0xc865('0xd')](function(_0x2f652f){var _0x415d91=[];_0x415d91[_0xc865('0xa7')]({'name':_0x2f652f[_0xc865('0xb6')]['TrueOption'][_0xc865('0xb8')][_0xc865('0xb9')]['Label'],'value':_0xc865('0xbd')},{'name':_0x2f652f[_0xc865('0xb6')][_0xc865('0xbe')]['Label'][_0xc865('0xb9')][_0xc865('0xb8')],'value':_0xc865('0xbf')});var _0x5a0923={'id':_0x53dde0+'_'+_0x2f652f[_0xc865('0xa4')],'name':_0x2f652f['DisplayName'][_0xc865('0xb9')]['Label'],'custom':![],'options':_0x415d91};_0x186a6d[_0xc865('0xa7')](_0x5a0923);return _0x186a6d;});}function getInputList(_0x1dd6f9,_0x12ab78,_0x4570ec,_0x55ccaf,_0x312a28,_0x22ae65,_0x3a499a){var _0x30b5d6={'method':_0xc865('0x9a'),'uri':_0x1dd6f9+_0xc865('0x9f')+_0x312a28+')/Attributes('+_0x22ae65+_0xc865('0xc0')+_0x4570ec+_0xc865('0xc1'),'headers':{'Authorization':_0xc865('0x9c')+_0x3a499a,'If-None-Match':null,'OData-Version':_0xc865('0x9d')},'json':!![]};return rp(_0x30b5d6)[_0xc865('0xd')](function(_0x194350){var _0x4d0cc2={'id':_0x12ab78+'_'+_0x194350[_0xc865('0xa4')],'name':_0x194350[_0xc865('0xbb')][_0xc865('0xb9')]?_0x194350[_0xc865('0xbb')][_0xc865('0xb9')]['Label']:_0x194350['LogicalName'],'custom':![],'options':[]};_0x55ccaf['push'](_0x4d0cc2);return _0x55ccaf;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b101b53..2b57bf4 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(_0x5a2318,_0xed64c9){var _0x473bcd=function(_0x328279){while(--_0x328279){_0x5a2318['push'](_0x5a2318['shift']());}};_0x473bcd(++_0xed64c9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xcb91[_0x11f226];return _0x30be77;};'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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0xecef0a,_0x576a92){var _0xa5043e=function(_0x48b109){while(--_0x48b109){_0xecef0a['push'](_0xecef0a['shift']());}};_0xa5043e(++_0x576a92);}(_0xe706,0xa3));var _0x6e70=function(_0x53263b,_0x299c08){_0x53263b=_0x53263b-0x0;var _0x3fd94b=_0xe706[_0x53263b];return _0x3fd94b;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'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 5d9742e..4a0fe24 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 _0x846a=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetDynamics365Account','findAll','options','attributes','limit','include','map','model','ShowDynamics365Account','find','raw','where','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x846a,0x120));var _0xa846=function(_0x2b2f81,_0x4b0a45){_0x2b2f81=_0x2b2f81-0x0;var _0xf2791f=_0x846a[_0x2b2f81];return _0xf2791f;};'use strict';var _=require(_0xa846('0x0'));var util=require(_0xa846('0x1'));var moment=require(_0xa846('0x2'));var BPromise=require('bluebird');var rs=require(_0xa846('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa846('0x4'))['db'];var utils=require(_0xa846('0x5'));var logger=require(_0xa846('0x6'))(_0xa846('0x7'));var config=require(_0xa846('0x8'));var jayson=require(_0xa846('0x9'));var client=jayson[_0xa846('0xa')][_0xa846('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbdf92d,_0x2989d8,_0x2d1c18){return new BPromise(function(_0x506db3,_0x1b8aa0){return client[_0xa846('0xc')](_0xbdf92d,_0x2d1c18)[_0xa846('0xd')](function(_0x4a8030){logger[_0xa846('0xe')](_0xa846('0xf'),_0x2989d8,_0xa846('0x10'));logger[_0xa846('0x11')](_0xa846('0x12'),_0x2989d8,_0xa846('0x10'),JSON['stringify'](_0x4a8030));if(_0x4a8030['error']){if(_0x4a8030['error'][_0xa846('0x13')]===0x1f4){logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x4a8030[_0xa846('0x14')][_0xa846('0x15')]);return _0x1b8aa0(_0x4a8030['error'][_0xa846('0x15')]);}logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x4a8030['error'][_0xa846('0x15')]);return _0x506db3(_0x4a8030[_0xa846('0x14')]['message']);}else{logger[_0xa846('0xe')](_0xa846('0xf'),_0x2989d8,_0xa846('0x10'));_0x506db3(_0x4a8030[_0xa846('0x16')]['message']);}})[_0xa846('0x17')](function(_0x37d005){logger[_0xa846('0x14')](_0xa846('0xf'),_0x2989d8,_0x37d005);_0x1b8aa0(_0x37d005);});});}exports[_0xa846('0x18')]=function(_0x24031f){var _0x540b50=this;return new Promise(function(_0xf5c724,_0x2a218e){return db['Dynamics365Account'][_0xa846('0x19')]({'raw':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24031f[_0xa846('0x1a')]?_0x24031f['options']['where']||null:null,'attributes':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1b')]||null:null,'limit':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1c')]||null:null,'include':_0x24031f[_0xa846('0x1a')]?_0x24031f[_0xa846('0x1a')][_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x24031f['options']['include'],function(_0x57b647){return{'model':db[_0x57b647[_0xa846('0x1f')]],'as':_0x57b647['as'],'attributes':_0x57b647['attributes'],'include':_0x57b647[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x57b647[_0xa846('0x1d')],function(_0x539527){return{'model':db[_0x539527[_0xa846('0x1f')]],'as':_0x539527['as'],'attributes':_0x539527[_0xa846('0x1b')],'include':_0x539527[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x539527[_0xa846('0x1d')],function(_0x47f533){return{'model':db[_0x47f533[_0xa846('0x1f')]],'as':_0x47f533['as'],'attributes':_0x47f533[_0xa846('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa846('0xd')](function(_0x48a4c8){logger[_0xa846('0xe')](_0xa846('0x18'),_0x24031f);logger['debug']('GetDynamics365Account',_0x24031f,JSON['stringify'](_0x48a4c8));_0xf5c724(_0x48a4c8);})['catch'](function(_0x585567){logger[_0xa846('0x14')](_0xa846('0x18'),_0x585567[_0xa846('0x15')],_0x24031f);_0x2a218e(_0x540b50[_0xa846('0x14')](0x1f4,_0x585567[_0xa846('0x15')]));});});};exports[_0xa846('0x20')]=function(_0xbb1cdb){var _0x18612b=this;return new Promise(function(_0x20dfbb,_0x28e4ce){return db['Dynamics365Account'][_0xa846('0x21')]({'raw':_0xbb1cdb[_0xa846('0x1a')]?_0xbb1cdb['options'][_0xa846('0x22')]===undefined?!![]:![]:!![],'where':_0xbb1cdb['options']?_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x23')]||null:null,'attributes':_0xbb1cdb['options']?_0xbb1cdb['options']['attributes']||null:null,'include':_0xbb1cdb[_0xa846('0x1a')]?_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x1d')]?_['map'](_0xbb1cdb[_0xa846('0x1a')][_0xa846('0x1d')],function(_0x338539){return{'model':db[_0x338539[_0xa846('0x1f')]],'as':_0x338539['as'],'attributes':_0x338539[_0xa846('0x1b')],'include':_0x338539[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x338539[_0xa846('0x1d')],function(_0x54368d){return{'model':db[_0x54368d[_0xa846('0x1f')]],'as':_0x54368d['as'],'attributes':_0x54368d[_0xa846('0x1b')],'include':_0x54368d[_0xa846('0x1d')]?_[_0xa846('0x1e')](_0x54368d[_0xa846('0x1d')],function(_0x40b1af){return{'model':db[_0x40b1af[_0xa846('0x1f')]],'as':_0x40b1af['as'],'attributes':_0x40b1af['attributes']};}):[]};}):[]};}):[]:[]})[_0xa846('0xd')](function(_0x11d204){logger[_0xa846('0xe')](_0xa846('0x20'),_0xbb1cdb);logger[_0xa846('0x11')](_0xa846('0x20'),_0xbb1cdb,JSON[_0xa846('0x24')](_0x11d204));_0x20dfbb(_0x11d204);})[_0xa846('0x17')](function(_0x1fc6b1){logger[_0xa846('0x14')](_0xa846('0x20'),_0x1fc6b1[_0xa846('0x15')],_0xbb1cdb);_0x28e4ce(_0x18612b[_0xa846('0x14')](0x1f4,_0x1fc6b1[_0xa846('0x15')]));});});}; \ No newline at end of file +var _0x1a95=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','debug','request\x20sent','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','Dynamics365Account','options','raw','where','include','model','attributes','map','then','stringify','GetDynamics365Account','ShowDynamics365Account','lodash'];(function(_0x49c0e7,_0xc32be3){var _0x2c7b0d=function(_0x558ceb){while(--_0x558ceb){_0x49c0e7['push'](_0x49c0e7['shift']());}};_0x2c7b0d(++_0xc32be3);}(_0x1a95,0xf7));var _0x51a9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1a95[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x51a9('0x0'));var util=require(_0x51a9('0x1'));var moment=require('moment');var BPromise=require(_0x51a9('0x2'));var rs=require(_0x51a9('0x3'));var fs=require('fs');var Redis=require(_0x51a9('0x4'));var db=require(_0x51a9('0x5'))['db'];var utils=require(_0x51a9('0x6'));var logger=require(_0x51a9('0x7'))(_0x51a9('0x8'));var config=require(_0x51a9('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x297fe9,_0x10f354,_0x4b0a9e){return new BPromise(function(_0x5dc7b3,_0x5c2c68){return client[_0x51a9('0xa')](_0x297fe9,_0x4b0a9e)['then'](function(_0x47a61a){logger[_0x51a9('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x10f354,'request\x20sent');logger[_0x51a9('0xc')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x10f354,_0x51a9('0xd'),JSON['stringify'](_0x47a61a));if(_0x47a61a[_0x51a9('0xe')]){if(_0x47a61a[_0x51a9('0xe')][_0x51a9('0xf')]===0x1f4){logger['error'](_0x51a9('0x10'),_0x10f354,_0x47a61a[_0x51a9('0xe')][_0x51a9('0x11')]);return _0x5c2c68(_0x47a61a['error']['message']);}logger['error'](_0x51a9('0x10'),_0x10f354,_0x47a61a['error']['message']);return _0x5dc7b3(_0x47a61a[_0x51a9('0xe')][_0x51a9('0x11')]);}else{logger[_0x51a9('0xb')](_0x51a9('0x10'),_0x10f354,'request\x20sent');_0x5dc7b3(_0x47a61a['result']['message']);}})[_0x51a9('0x12')](function(_0x42eea6){logger['error'](_0x51a9('0x10'),_0x10f354,_0x42eea6);_0x5c2c68(_0x42eea6);});});}exports['GetDynamics365Account']=function(_0xd03e22){var _0x4e54d6=this;return new Promise(function(_0x27626b,_0x47bc53){return db[_0x51a9('0x13')]['findAll']({'raw':_0xd03e22[_0x51a9('0x14')]?_0xd03e22['options'][_0x51a9('0x15')]===undefined?!![]:![]:!![],'where':_0xd03e22[_0x51a9('0x14')]?_0xd03e22[_0x51a9('0x14')][_0x51a9('0x16')]||null:null,'attributes':_0xd03e22['options']?_0xd03e22[_0x51a9('0x14')]['attributes']||null:null,'limit':_0xd03e22['options']?_0xd03e22[_0x51a9('0x14')]['limit']||null:null,'include':_0xd03e22[_0x51a9('0x14')]?_0xd03e22[_0x51a9('0x14')][_0x51a9('0x17')]?_['map'](_0xd03e22[_0x51a9('0x14')]['include'],function(_0x5f2eb8){return{'model':db[_0x5f2eb8[_0x51a9('0x18')]],'as':_0x5f2eb8['as'],'attributes':_0x5f2eb8[_0x51a9('0x19')],'include':_0x5f2eb8[_0x51a9('0x17')]?_[_0x51a9('0x1a')](_0x5f2eb8[_0x51a9('0x17')],function(_0x33ecf5){return{'model':db[_0x33ecf5[_0x51a9('0x18')]],'as':_0x33ecf5['as'],'attributes':_0x33ecf5[_0x51a9('0x19')],'include':_0x33ecf5[_0x51a9('0x17')]?_[_0x51a9('0x1a')](_0x33ecf5['include'],function(_0x4a7fa7){return{'model':db[_0x4a7fa7[_0x51a9('0x18')]],'as':_0x4a7fa7['as'],'attributes':_0x4a7fa7[_0x51a9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x51a9('0x1b')](function(_0x37d83c){logger[_0x51a9('0xb')]('GetDynamics365Account',_0xd03e22);logger['debug']('GetDynamics365Account',_0xd03e22,JSON[_0x51a9('0x1c')](_0x37d83c));_0x27626b(_0x37d83c);})[_0x51a9('0x12')](function(_0x2d2807){logger[_0x51a9('0xe')](_0x51a9('0x1d'),_0x2d2807[_0x51a9('0x11')],_0xd03e22);_0x47bc53(_0x4e54d6['error'](0x1f4,_0x2d2807['message']));});});};exports['ShowDynamics365Account']=function(_0x58123a){var _0x172868=this;return new Promise(function(_0x1040f0,_0x3d2b7c){return db[_0x51a9('0x13')]['find']({'raw':_0x58123a[_0x51a9('0x14')]?_0x58123a[_0x51a9('0x14')][_0x51a9('0x15')]===undefined?!![]:![]:!![],'where':_0x58123a[_0x51a9('0x14')]?_0x58123a[_0x51a9('0x14')][_0x51a9('0x16')]||null:null,'attributes':_0x58123a['options']?_0x58123a['options'][_0x51a9('0x19')]||null:null,'include':_0x58123a[_0x51a9('0x14')]?_0x58123a[_0x51a9('0x14')][_0x51a9('0x17')]?_['map'](_0x58123a[_0x51a9('0x14')]['include'],function(_0x25f462){return{'model':db[_0x25f462['model']],'as':_0x25f462['as'],'attributes':_0x25f462[_0x51a9('0x19')],'include':_0x25f462[_0x51a9('0x17')]?_[_0x51a9('0x1a')](_0x25f462[_0x51a9('0x17')],function(_0x57aa26){return{'model':db[_0x57aa26[_0x51a9('0x18')]],'as':_0x57aa26['as'],'attributes':_0x57aa26[_0x51a9('0x19')],'include':_0x57aa26[_0x51a9('0x17')]?_['map'](_0x57aa26[_0x51a9('0x17')],function(_0x1cf5a3){return{'model':db[_0x1cf5a3[_0x51a9('0x18')]],'as':_0x1cf5a3['as'],'attributes':_0x1cf5a3[_0x51a9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x51a9('0x1b')](function(_0x56683f){logger[_0x51a9('0xb')](_0x51a9('0x1e'),_0x58123a);logger[_0x51a9('0xc')](_0x51a9('0x1e'),_0x58123a,JSON[_0x51a9('0x1c')](_0x56683f));_0x1040f0(_0x56683f);})['catch'](function(_0x5a73ee){logger['error'](_0x51a9('0x1e'),_0x5a73ee[_0x51a9('0x11')],_0x58123a);_0x3d2b7c(_0x172868[_0x51a9('0xe')](0x1f4,_0x5a73ee[_0x51a9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index e1e1507..ca8cad7 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 _0x5ad1=['./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','getDescriptions','post','create','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2f35c8,_0x3d478b){var _0x2cd0aa=function(_0x25b9fa){while(--_0x25b9fa){_0x2f35c8['push'](_0x2f35c8['shift']());}};_0x2cd0aa(++_0x3d478b);}(_0x5ad1,0x12c));var _0x15ad=function(_0x567446,_0x5c6189){_0x567446=_0x567446-0x0;var _0x5b4024=_0x5ad1[_0x567446];return _0x5b4024;};'use strict';var multer=require(_0x15ad('0x0'));var util=require(_0x15ad('0x1'));var path=require('path');var timeout=require(_0x15ad('0x2'));var express=require('express');var router=express[_0x15ad('0x3')]();var fs_extra=require(_0x15ad('0x4'));var auth=require(_0x15ad('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15ad('0x6'));router[_0x15ad('0x7')]('/',auth[_0x15ad('0x8')](),controller[_0x15ad('0x9')]);router[_0x15ad('0x7')](_0x15ad('0xa'),auth[_0x15ad('0x8')](),controller['show']);router[_0x15ad('0x7')](_0x15ad('0xb'),auth[_0x15ad('0x8')](),controller['getFields']);router[_0x15ad('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x15ad('0xc')]);router[_0x15ad('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x15ad('0xd')]);router[_0x15ad('0xe')]('/',auth[_0x15ad('0x8')](),controller[_0x15ad('0xf')]);router['put'](_0x15ad('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x15ad('0x10')](_0x15ad('0xa'),auth[_0x15ad('0x8')](),controller[_0x15ad('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3c90=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x3c90,0xfd));var _0x03c9=function(_0x18530b,_0x19d0fd){_0x18530b=_0x18530b-0x0;var _0x80350d=_0x3c90[_0x18530b];return _0x80350d;};'use strict';var multer=require('multer');var util=require(_0x03c9('0x0'));var path=require(_0x03c9('0x1'));var timeout=require(_0x03c9('0x2'));var express=require(_0x03c9('0x3'));var router=express[_0x03c9('0x4')]();var fs_extra=require(_0x03c9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x03c9('0x6'));var config=require('../../config/environment');var controller=require(_0x03c9('0x7'));router[_0x03c9('0x8')]('/',auth[_0x03c9('0x9')](),controller[_0x03c9('0xa')]);router[_0x03c9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth[_0x03c9('0x9')](),controller[_0x03c9('0xb')]);router[_0x03c9('0x8')](_0x03c9('0xc'),auth[_0x03c9('0x9')](),controller['getSubjects']);router[_0x03c9('0x8')](_0x03c9('0xd'),auth['isAuthenticated'](),controller[_0x03c9('0xe')]);router[_0x03c9('0xf')]('/',auth['isAuthenticated'](),controller[_0x03c9('0x10')]);router[_0x03c9('0x11')]('/:id',auth[_0x03c9('0x9')](),controller[_0x03c9('0x12')]);router[_0x03c9('0x13')](_0x03c9('0x14'),auth[_0x03c9('0x9')](),controller[_0x03c9('0x15')]);module[_0x03c9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 723ccea..076e8d4 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 _0xca7e=['contact','BOOLEAN','sequelize','STRING','incident'];(function(_0x434467,_0x2c6a75){var _0x5248ba=function(_0x5a3811){while(--_0x5a3811){_0x434467['push'](_0x434467['shift']());}};_0x5248ba(++_0x2c6a75);}(_0xca7e,0xed));var _0xeca7=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xca7e[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0xeca7('0x0'));module['exports']={'name':{'type':Sequelize[_0xeca7('0x1')]},'description':{'type':Sequelize[_0xeca7('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':_0xeca7('0x2')},'moduleCreate':{'type':Sequelize['ENUM'](_0xeca7('0x3'),'nothing'),'defaultValue':_0xeca7('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xeca7('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xeca7('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa2db=['ENUM','incident','phonecall','contact','nothing','BOOLEAN','sequelize','STRING'];(function(_0x3da374,_0x484671){var _0x2f9738=function(_0x2eb23e){while(--_0x2eb23e){_0x3da374['push'](_0x3da374['shift']());}};_0x2f9738(++_0x484671);}(_0xa2db,0x1b6));var _0xba2d=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xa2db[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0xba2d('0x0'));module['exports']={'name':{'type':Sequelize[_0xba2d('0x1')]},'description':{'type':Sequelize[_0xba2d('0x1')]},'ticketType':{'type':Sequelize[_0xba2d('0x2')](_0xba2d('0x3'),_0xba2d('0x4')),'defaultValue':_0xba2d('0x3')},'moduleCreate':{'type':Sequelize[_0xba2d('0x2')](_0xba2d('0x5'),_0xba2d('0x6')),'defaultValue':_0xba2d('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xba2d('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xba2d('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 1faa119..f511914 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 _0x55ab=['params','find','catch','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','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/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','findAll','rows','show'];(function(_0x4d4a28,_0x21c426){var _0x166ae0=function(_0x3bcf84){while(--_0x3bcf84){_0x4d4a28['push'](_0x4d4a28['shift']());}};_0x166ae0(++_0x21c426);}(_0x55ab,0x1f0));var _0xb55a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x55ab[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xb55a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb55a('0x1'));var jsonpatch=require(_0xb55a('0x2'));var rp=require('request-promise');var moment=require(_0xb55a('0x3'));var BPromise=require(_0xb55a('0x4'));var Mustache=require(_0xb55a('0x5'));var util=require(_0xb55a('0x6'));var path=require('path');var sox=require(_0xb55a('0x7'));var csv=require(_0xb55a('0x8'));var ejs=require(_0xb55a('0x9'));var fs=require('fs');var fs_extra=require(_0xb55a('0xa'));var _=require(_0xb55a('0xb'));var squel=require(_0xb55a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb55a('0xd'));var deskjs=require(_0xb55a('0xe'));var toCsv=require(_0xb55a('0x8'));var querystring=require(_0xb55a('0xf'));var Papa=require(_0xb55a('0x10'));var Redis=require(_0xb55a('0x11'));var authService=require(_0xb55a('0x12'));var qs=require(_0xb55a('0x13'));var as=require(_0xb55a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb55a('0x15'))(_0xb55a('0x16'));var utils=require(_0xb55a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb55a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425c5a,_0x22fd21){_0x22fd21=_0x22fd21||0xcc;return function(_0x112b72){if(_0x112b72){return _0x425c5a[_0xb55a('0x19')](_0x22fd21);}return _0x425c5a[_0xb55a('0x1a')](_0x22fd21)[_0xb55a('0x1b')]();};}function respondWithResult(_0x19b68a,_0x4da783){_0x4da783=_0x4da783||0xc8;return function(_0x30bc38){if(_0x30bc38){return _0x19b68a[_0xb55a('0x1a')](_0x4da783)[_0xb55a('0x1c')](_0x30bc38);}};}function respondWithFilteredResult(_0xe0b717,_0x2f57bf){return function(_0x1eef50){if(_0x1eef50){var _0x597e0f=typeof _0x2f57bf[_0xb55a('0x1d')]==='undefined'&&typeof _0x2f57bf[_0xb55a('0x1e')]===_0xb55a('0x1f');var _0x431fb8=_0x1eef50['count'];var _0x44f5bb=_0x597e0f?0x0:_0x2f57bf[_0xb55a('0x1d')];var _0x1082ec=_0x597e0f?_0x1eef50[_0xb55a('0x20')]:_0x2f57bf[_0xb55a('0x1d')]+_0x2f57bf[_0xb55a('0x1e')];var _0x84e06;if(_0x1082ec>=_0x431fb8){_0x1082ec=_0x431fb8;_0x84e06=0xc8;}else{_0x84e06=0xce;}_0xe0b717['status'](_0x84e06);return _0xe0b717['set'](_0xb55a('0x21'),_0x44f5bb+'-'+_0x1082ec+'/'+_0x431fb8)['json'](_0x1eef50);}return null;};}function patchUpdates(_0x5bbd13){return function(_0x1cc91d){try{jsonpatch['apply'](_0x1cc91d,_0x5bbd13,!![]);}catch(_0x378381){return BPromise[_0xb55a('0x22')](_0x378381);}return _0x1cc91d[_0xb55a('0x23')]();};}function saveUpdates(_0x4011c8,_0x1f32d9){return function(_0x56bba9){if(_0x56bba9){return _0x56bba9[_0xb55a('0x24')](_0x4011c8)['then'](function(_0x3a4995){return _0x3a4995;});}return null;};}function removeEntity(_0x2f34ef,_0x4f01fc){return function(_0x624e84){if(_0x624e84){return _0x624e84[_0xb55a('0x25')]()['then'](function(){_0x2f34ef[_0xb55a('0x1a')](0xcc)[_0xb55a('0x1b')]();});}};}function handleEntityNotFound(_0x45d43c,_0x54cf13){return function(_0x54cd92){if(!_0x54cd92){_0x45d43c[_0xb55a('0x19')](0x194);}return _0x54cd92;};}function handleError(_0x192400,_0x2ed4b1){_0x2ed4b1=_0x2ed4b1||0x1f4;return function(_0x390d5c){logger[_0xb55a('0x26')](_0x390d5c[_0xb55a('0x27')]);if(_0x390d5c[_0xb55a('0x28')]){delete _0x390d5c[_0xb55a('0x28')];}_0x192400['status'](_0x2ed4b1)[_0xb55a('0x29')](_0x390d5c);};}exports['index']=function(_0x38f005,_0x4e49bc){var _0x3b16b9={},_0x7ea4a8={},_0x38492c={'count':0x0,'rows':[]};var _0x27a1c3=_[_0xb55a('0x2a')](db[_0xb55a('0x2b')][_0xb55a('0x2c')],function(_0x21d302){return{'name':_0x21d302[_0xb55a('0x2d')],'type':_0x21d302[_0xb55a('0x2e')][_0xb55a('0x2f')]};});_0x7ea4a8[_0xb55a('0x30')]=_[_0xb55a('0x2a')](_0x27a1c3,_0xb55a('0x28'));_0x7ea4a8[_0xb55a('0x31')]=_[_0xb55a('0x32')](_0x38f005[_0xb55a('0x31')]);_0x7ea4a8['filters']=_[_0xb55a('0x33')](_0x7ea4a8['model'],_0x7ea4a8['query']);_0x3b16b9[_0xb55a('0x34')]=_[_0xb55a('0x33')](_0x7ea4a8[_0xb55a('0x30')],qs['fields'](_0x38f005[_0xb55a('0x31')][_0xb55a('0x35')]));_0x3b16b9[_0xb55a('0x34')]=_0x3b16b9[_0xb55a('0x34')][_0xb55a('0x36')]?_0x3b16b9[_0xb55a('0x34')]:_0x7ea4a8[_0xb55a('0x30')];if(!_0x38f005[_0xb55a('0x31')][_0xb55a('0x37')](_0xb55a('0x38'))){_0x3b16b9[_0xb55a('0x1e')]=qs['limit'](_0x38f005[_0xb55a('0x31')][_0xb55a('0x1e')]);_0x3b16b9[_0xb55a('0x1d')]=qs['offset'](_0x38f005[_0xb55a('0x31')][_0xb55a('0x1d')]);}_0x3b16b9[_0xb55a('0x39')]=qs[_0xb55a('0x3a')](_0x38f005[_0xb55a('0x31')][_0xb55a('0x3a')]);_0x3b16b9[_0xb55a('0x3b')]=qs[_0xb55a('0x3c')](_[_0xb55a('0x3d')](_0x38f005[_0xb55a('0x31')],_0x7ea4a8[_0xb55a('0x3c')]),_0x27a1c3);if(_0x38f005['query'][_0xb55a('0x3e')]){_0x3b16b9[_0xb55a('0x3b')]=_[_0xb55a('0x3f')](_0x3b16b9[_0xb55a('0x3b')],{'$or':_[_0xb55a('0x2a')](_0x27a1c3,function(_0x50464d){if(_0x50464d[_0xb55a('0x2e')]!=='VIRTUAL'){var _0x3e899e={};_0x3e899e[_0x50464d['name']]={'$like':'%'+_0x38f005[_0xb55a('0x31')][_0xb55a('0x3e')]+'%'};return _0x3e899e;}})});}_0x3b16b9=_[_0xb55a('0x3f')]({},_0x3b16b9,_0x38f005[_0xb55a('0x40')]);var _0x12be0e={'where':_0x3b16b9[_0xb55a('0x3b')]};return db[_0xb55a('0x2b')][_0xb55a('0x20')](_0x12be0e)[_0xb55a('0x41')](function(_0xe31a44){_0x38492c[_0xb55a('0x20')]=_0xe31a44;if(_0x38f005[_0xb55a('0x31')][_0xb55a('0x42')]){_0x3b16b9[_0xb55a('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb55a('0x44')](_0x3b16b9);})[_0xb55a('0x41')](function(_0x1f6983){_0x38492c[_0xb55a('0x45')]=_0x1f6983;return _0x38492c;})[_0xb55a('0x41')](respondWithFilteredResult(_0x4e49bc,_0x3b16b9))['catch'](handleError(_0x4e49bc,null));};exports[_0xb55a('0x46')]=function(_0x106e5a,_0x15a8f6){var _0x2d8331={'raw':![],'where':{'id':_0x106e5a[_0xb55a('0x47')]['id']}},_0x2d13ba={};_0x2d13ba[_0xb55a('0x30')]=_[_0xb55a('0x32')](db[_0xb55a('0x2b')]['rawAttributes']);_0x2d13ba[_0xb55a('0x31')]=_[_0xb55a('0x32')](_0x106e5a[_0xb55a('0x31')]);_0x2d13ba[_0xb55a('0x3c')]=_['intersection'](_0x2d13ba['model'],_0x2d13ba['query']);_0x2d8331[_0xb55a('0x34')]=_[_0xb55a('0x33')](_0x2d13ba[_0xb55a('0x30')],qs[_0xb55a('0x35')](_0x106e5a[_0xb55a('0x31')][_0xb55a('0x35')]));_0x2d8331[_0xb55a('0x34')]=_0x2d8331['attributes'][_0xb55a('0x36')]?_0x2d8331[_0xb55a('0x34')]:_0x2d13ba[_0xb55a('0x30')];if(_0x106e5a[_0xb55a('0x31')][_0xb55a('0x42')]){_0x2d8331[_0xb55a('0x43')]=[{'all':!![]}];}_0x2d8331=_[_0xb55a('0x3f')]({},_0x2d8331,_0x106e5a[_0xb55a('0x40')]);return db['Dynamics365Configuration'][_0xb55a('0x48')](_0x2d8331)[_0xb55a('0x41')](handleEntityNotFound(_0x15a8f6,null))[_0xb55a('0x41')](respondWithResult(_0x15a8f6,null))[_0xb55a('0x49')](handleError(_0x15a8f6,null));};exports[_0xb55a('0x4a')]=function(_0x3e76ce,_0x502b20){return db[_0xb55a('0x2b')][_0xb55a('0x4a')](_0x3e76ce[_0xb55a('0x4b')],{})[_0xb55a('0x41')](respondWithResult(_0x502b20,0xc9))[_0xb55a('0x49')](handleError(_0x502b20,null));};exports[_0xb55a('0x24')]=function(_0x1b5ca6,_0x3e0055){if(_0x1b5ca6[_0xb55a('0x4b')]['id']){delete _0x1b5ca6[_0xb55a('0x4b')]['id'];}return db[_0xb55a('0x2b')][_0xb55a('0x48')]({'where':{'id':_0x1b5ca6['params']['id']}})[_0xb55a('0x41')](handleEntityNotFound(_0x3e0055,null))['then'](saveUpdates(_0x1b5ca6[_0xb55a('0x4b')],null))[_0xb55a('0x41')](respondWithResult(_0x3e0055,null))[_0xb55a('0x49')](handleError(_0x3e0055,null));};exports[_0xb55a('0x25')]=function(_0x4cd7b3,_0xe80b05){return db[_0xb55a('0x2b')][_0xb55a('0x48')]({'where':{'id':_0x4cd7b3[_0xb55a('0x47')]['id']}})[_0xb55a('0x41')](handleEntityNotFound(_0xe80b05,null))[_0xb55a('0x41')](removeEntity(_0xe80b05,null))[_0xb55a('0x49')](handleError(_0xe80b05,null));};exports[_0xb55a('0x4c')]=function(_0x1c6143,_0x3d23e3,_0x5158af){var _0x1eb9ae={};var _0x43a661={};var _0x1da988;var _0x458fc9;return db[_0xb55a('0x2b')][_0xb55a('0x4d')]({'where':{'id':_0x1c6143[_0xb55a('0x47')]['id']}})[_0xb55a('0x41')](handleEntityNotFound(_0x3d23e3,null))['then'](function(_0x20ff2f){if(_0x20ff2f){_0x1da988=_0x20ff2f;_0x43a661['model']=_[_0xb55a('0x32')](db[_0xb55a('0x4e')]['rawAttributes']);_0x43a661[_0xb55a('0x31')]=_['keys'](_0x1c6143['query']);_0x43a661[_0xb55a('0x3c')]=_['intersection'](_0x43a661[_0xb55a('0x30')],_0x43a661[_0xb55a('0x31')]);_0x1eb9ae['attributes']=_[_0xb55a('0x33')](_0x43a661[_0xb55a('0x30')],qs['fields'](_0x1c6143[_0xb55a('0x31')][_0xb55a('0x35')]));_0x1eb9ae[_0xb55a('0x34')]=_0x1eb9ae[_0xb55a('0x34')][_0xb55a('0x36')]?_0x1eb9ae[_0xb55a('0x34')]:_0x43a661[_0xb55a('0x30')];_0x1eb9ae[_0xb55a('0x39')]=qs[_0xb55a('0x3a')](_0x1c6143[_0xb55a('0x31')][_0xb55a('0x3a')]);_0x1eb9ae[_0xb55a('0x3b')]=qs['filters'](_[_0xb55a('0x3d')](_0x1c6143[_0xb55a('0x31')],_0x43a661[_0xb55a('0x3c')]));if(_0x1c6143[_0xb55a('0x31')][_0xb55a('0x3e')]){_0x1eb9ae[_0xb55a('0x3b')]=_['merge'](_0x1eb9ae[_0xb55a('0x3b')],{'$or':_['map'](_0x1eb9ae[_0xb55a('0x34')],function(_0x3aa9fc){var _0x3462cd={};_0x3462cd[_0x3aa9fc]={'$like':'%'+_0x1c6143[_0xb55a('0x31')][_0xb55a('0x3e')]+'%'};return _0x3462cd;})});}_0x1eb9ae=_[_0xb55a('0x3f')]({},_0x1eb9ae,_0x1c6143[_0xb55a('0x40')]);return _0x1da988[_0xb55a('0x4c')](_0x1eb9ae);}})[_0xb55a('0x41')](function(_0x7027f2){if(_0x7027f2){_0x458fc9=_0x7027f2[_0xb55a('0x36')];if(!_0x1c6143['query'][_0xb55a('0x37')]('nolimit')){_0x1eb9ae[_0xb55a('0x1e')]=qs[_0xb55a('0x1e')](_0x1c6143[_0xb55a('0x31')][_0xb55a('0x1e')]);_0x1eb9ae[_0xb55a('0x1d')]=qs[_0xb55a('0x1d')](_0x1c6143['query'][_0xb55a('0x1d')]);}return _0x1da988[_0xb55a('0x4c')](_0x1eb9ae);}})['then'](function(_0x5dc274){if(_0x5dc274){return _0x5dc274?{'count':_0x458fc9,'rows':_0x5dc274}:null;}})[_0xb55a('0x41')](respondWithResult(_0x3d23e3,null))[_0xb55a('0x49')](handleError(_0x3d23e3,null));};exports[_0xb55a('0x4f')]=function(_0x2c5b18,_0x5007e3,_0x3113e3){var _0x5d288a={};var _0x27f98d={};var _0x581376;var _0x298c36;return db[_0xb55a('0x2b')][_0xb55a('0x4d')]({'where':{'id':_0x2c5b18[_0xb55a('0x47')]['id']}})[_0xb55a('0x41')](handleEntityNotFound(_0x5007e3,null))[_0xb55a('0x41')](function(_0x469d95){if(_0x469d95){_0x581376=_0x469d95;_0x27f98d[_0xb55a('0x30')]=_[_0xb55a('0x32')](db[_0xb55a('0x4e')]['rawAttributes']);_0x27f98d[_0xb55a('0x31')]=_['keys'](_0x2c5b18[_0xb55a('0x31')]);_0x27f98d['filters']=_[_0xb55a('0x33')](_0x27f98d[_0xb55a('0x30')],_0x27f98d['query']);_0x5d288a[_0xb55a('0x34')]=_['intersection'](_0x27f98d[_0xb55a('0x30')],qs[_0xb55a('0x35')](_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x35')]));_0x5d288a[_0xb55a('0x34')]=_0x5d288a[_0xb55a('0x34')][_0xb55a('0x36')]?_0x5d288a[_0xb55a('0x34')]:_0x27f98d[_0xb55a('0x30')];_0x5d288a[_0xb55a('0x39')]=qs[_0xb55a('0x3a')](_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x3a')]);_0x5d288a['where']=qs[_0xb55a('0x3c')](_[_0xb55a('0x3d')](_0x2c5b18[_0xb55a('0x31')],_0x27f98d[_0xb55a('0x3c')]));if(_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x3e')]){_0x5d288a['where']=_['merge'](_0x5d288a[_0xb55a('0x3b')],{'$or':_['map'](_0x5d288a[_0xb55a('0x34')],function(_0x2361d1){var _0x1d81b9={};_0x1d81b9[_0x2361d1]={'$like':'%'+_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x3e')]+'%'};return _0x1d81b9;})});}_0x5d288a=_[_0xb55a('0x3f')]({},_0x5d288a,_0x2c5b18[_0xb55a('0x40')]);return _0x581376[_0xb55a('0x4f')](_0x5d288a);}})[_0xb55a('0x41')](function(_0x5581b3){if(_0x5581b3){_0x298c36=_0x5581b3['length'];if(!_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x37')]('nolimit')){_0x5d288a['limit']=qs['limit'](_0x2c5b18['query'][_0xb55a('0x1e')]);_0x5d288a['offset']=qs[_0xb55a('0x1d')](_0x2c5b18[_0xb55a('0x31')][_0xb55a('0x1d')]);}return _0x581376[_0xb55a('0x4f')](_0x5d288a);}})['then'](function(_0x5816f7){if(_0x5816f7){return _0x5816f7?{'count':_0x298c36,'rows':_0x5816f7}:null;}})[_0xb55a('0x41')](respondWithResult(_0x5007e3,null))[_0xb55a('0x49')](handleError(_0x5007e3,null));};exports[_0xb55a('0x50')]=function(_0x21a52e,_0x965e72,_0x1e72c){var _0x5107ed={};var _0x258b0e={};var _0x1d92b9;var _0x4785d1;return db[_0xb55a('0x2b')][_0xb55a('0x4d')]({'where':{'id':_0x21a52e['params']['id']}})[_0xb55a('0x41')](handleEntityNotFound(_0x965e72,null))[_0xb55a('0x41')](function(_0x5ef21f){if(_0x5ef21f){_0x1d92b9=_0x5ef21f;_0x258b0e['model']=_[_0xb55a('0x32')](db[_0xb55a('0x4e')][_0xb55a('0x2c')]);_0x258b0e[_0xb55a('0x31')]=_[_0xb55a('0x32')](_0x21a52e[_0xb55a('0x31')]);_0x258b0e['filters']=_['intersection'](_0x258b0e['model'],_0x258b0e[_0xb55a('0x31')]);_0x5107ed[_0xb55a('0x34')]=_[_0xb55a('0x33')](_0x258b0e[_0xb55a('0x30')],qs[_0xb55a('0x35')](_0x21a52e[_0xb55a('0x31')]['fields']));_0x5107ed[_0xb55a('0x34')]=_0x5107ed['attributes'][_0xb55a('0x36')]?_0x5107ed['attributes']:_0x258b0e[_0xb55a('0x30')];_0x5107ed[_0xb55a('0x39')]=qs[_0xb55a('0x3a')](_0x21a52e[_0xb55a('0x31')][_0xb55a('0x3a')]);_0x5107ed[_0xb55a('0x3b')]=qs['filters'](_[_0xb55a('0x3d')](_0x21a52e['query'],_0x258b0e['filters']));if(_0x21a52e[_0xb55a('0x31')][_0xb55a('0x3e')]){_0x5107ed['where']=_[_0xb55a('0x3f')](_0x5107ed[_0xb55a('0x3b')],{'$or':_['map'](_0x5107ed[_0xb55a('0x34')],function(_0x1b56dc){var _0x485f67={};_0x485f67[_0x1b56dc]={'$like':'%'+_0x21a52e[_0xb55a('0x31')]['filter']+'%'};return _0x485f67;})});}_0x5107ed=_[_0xb55a('0x3f')]({},_0x5107ed,_0x21a52e['options']);return _0x1d92b9[_0xb55a('0x50')](_0x5107ed);}})['then'](function(_0x4f2f62){if(_0x4f2f62){_0x4785d1=_0x4f2f62[_0xb55a('0x36')];if(!_0x21a52e['query'][_0xb55a('0x37')](_0xb55a('0x38'))){_0x5107ed[_0xb55a('0x1e')]=qs[_0xb55a('0x1e')](_0x21a52e[_0xb55a('0x31')][_0xb55a('0x1e')]);_0x5107ed[_0xb55a('0x1d')]=qs[_0xb55a('0x1d')](_0x21a52e['query'][_0xb55a('0x1d')]);}return _0x1d92b9[_0xb55a('0x50')](_0x5107ed);}})[_0xb55a('0x41')](function(_0x2028fc){if(_0x2028fc){return _0x2028fc?{'count':_0x4785d1,'rows':_0x2028fc}:null;}})['then'](respondWithResult(_0x965e72,null))[_0xb55a('0x49')](handleError(_0x965e72,null));}; \ No newline at end of file +var _0x55f4=['stack','send','index','map','Dynamics365Configuration','key','model','name','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','Dynamics365Field','getFields','getSubjects','getDescriptions','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x55f4,0x74));var _0x455f=function(_0x465371,_0xc830d0){_0x465371=_0x465371-0x0;var _0x3bfb77=_0x55f4[_0x465371];return _0x3bfb77;};'use strict';var emlformat=require(_0x455f('0x0'));var rimraf=require(_0x455f('0x1'));var zipdir=require(_0x455f('0x2'));var jsonpatch=require(_0x455f('0x3'));var rp=require(_0x455f('0x4'));var moment=require(_0x455f('0x5'));var BPromise=require(_0x455f('0x6'));var Mustache=require(_0x455f('0x7'));var util=require('util');var path=require(_0x455f('0x8'));var sox=require(_0x455f('0x9'));var csv=require(_0x455f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x455f('0xb'));var squel=require('squel');var crypto=require(_0x455f('0xc'));var jsforce=require(_0x455f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x455f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x455f('0xe'));var authService=require(_0x455f('0xf'));var qs=require(_0x455f('0x10'));var as=require(_0x455f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x455f('0x12'))(_0x455f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x455f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337a00,_0xbc0bb2){_0xbc0bb2=_0xbc0bb2||0xcc;return function(_0x3937c4){if(_0x3937c4){return _0x337a00['sendStatus'](_0xbc0bb2);}return _0x337a00[_0x455f('0x15')](_0xbc0bb2)[_0x455f('0x16')]();};}function respondWithResult(_0x382f35,_0x5d7e5e){_0x5d7e5e=_0x5d7e5e||0xc8;return function(_0x333777){if(_0x333777){return _0x382f35[_0x455f('0x15')](_0x5d7e5e)[_0x455f('0x17')](_0x333777);}};}function respondWithFilteredResult(_0xedf8fd,_0x6a909f){return function(_0x221922){if(_0x221922){var _0x1ee65c=typeof _0x6a909f[_0x455f('0x18')]===_0x455f('0x19')&&typeof _0x6a909f[_0x455f('0x1a')]===_0x455f('0x19');var _0x2eb0bb=_0x221922[_0x455f('0x1b')];var _0x3c4337=_0x1ee65c?0x0:_0x6a909f['offset'];var _0x558f3f=_0x1ee65c?_0x221922[_0x455f('0x1b')]:_0x6a909f['offset']+_0x6a909f[_0x455f('0x1a')];var _0x6d2d93;if(_0x558f3f>=_0x2eb0bb){_0x558f3f=_0x2eb0bb;_0x6d2d93=0xc8;}else{_0x6d2d93=0xce;}_0xedf8fd[_0x455f('0x15')](_0x6d2d93);return _0xedf8fd['set']('Content-Range',_0x3c4337+'-'+_0x558f3f+'/'+_0x2eb0bb)[_0x455f('0x17')](_0x221922);}return null;};}function patchUpdates(_0x24f75c){return function(_0x29921d){try{jsonpatch[_0x455f('0x1c')](_0x29921d,_0x24f75c,!![]);}catch(_0x2b8705){return BPromise[_0x455f('0x1d')](_0x2b8705);}return _0x29921d[_0x455f('0x1e')]();};}function saveUpdates(_0x564c6e,_0x1b81c6){return function(_0x13915f){if(_0x13915f){return _0x13915f[_0x455f('0x1f')](_0x564c6e)[_0x455f('0x20')](function(_0x232672){return _0x232672;});}return null;};}function removeEntity(_0x26f505,_0x23d44d){return function(_0x268898){if(_0x268898){return _0x268898[_0x455f('0x21')]()[_0x455f('0x20')](function(){_0x26f505['status'](0xcc)[_0x455f('0x16')]();});}};}function handleEntityNotFound(_0x54aac8,_0x19b229){return function(_0x2c187b){if(!_0x2c187b){_0x54aac8[_0x455f('0x22')](0x194);}return _0x2c187b;};}function handleError(_0x5aa6ae,_0x3eac05){_0x3eac05=_0x3eac05||0x1f4;return function(_0x24703a){logger[_0x455f('0x23')](_0x24703a[_0x455f('0x24')]);if(_0x24703a['name']){delete _0x24703a['name'];}_0x5aa6ae['status'](_0x3eac05)[_0x455f('0x25')](_0x24703a);};}exports[_0x455f('0x26')]=function(_0x2999e5,_0x18d15e){var _0x52ffa4={},_0x244fde={},_0x3a878e={'count':0x0,'rows':[]};var _0x45a612=_[_0x455f('0x27')](db[_0x455f('0x28')]['rawAttributes'],function(_0x22c30b){return{'name':_0x22c30b['fieldName'],'type':_0x22c30b['type'][_0x455f('0x29')]};});_0x244fde[_0x455f('0x2a')]=_[_0x455f('0x27')](_0x45a612,_0x455f('0x2b'));_0x244fde['query']=_[_0x455f('0x2c')](_0x2999e5[_0x455f('0x2d')]);_0x244fde['filters']=_['intersection'](_0x244fde[_0x455f('0x2a')],_0x244fde[_0x455f('0x2d')]);_0x52ffa4[_0x455f('0x2e')]=_[_0x455f('0x2f')](_0x244fde[_0x455f('0x2a')],qs[_0x455f('0x30')](_0x2999e5[_0x455f('0x2d')][_0x455f('0x30')]));_0x52ffa4[_0x455f('0x2e')]=_0x52ffa4[_0x455f('0x2e')][_0x455f('0x31')]?_0x52ffa4['attributes']:_0x244fde[_0x455f('0x2a')];if(!_0x2999e5[_0x455f('0x2d')]['hasOwnProperty'](_0x455f('0x32'))){_0x52ffa4[_0x455f('0x1a')]=qs[_0x455f('0x1a')](_0x2999e5[_0x455f('0x2d')][_0x455f('0x1a')]);_0x52ffa4[_0x455f('0x18')]=qs[_0x455f('0x18')](_0x2999e5[_0x455f('0x2d')][_0x455f('0x18')]);}_0x52ffa4[_0x455f('0x33')]=qs[_0x455f('0x34')](_0x2999e5['query'][_0x455f('0x34')]);_0x52ffa4[_0x455f('0x35')]=qs[_0x455f('0x36')](_[_0x455f('0x37')](_0x2999e5['query'],_0x244fde[_0x455f('0x36')]),_0x45a612);if(_0x2999e5[_0x455f('0x2d')][_0x455f('0x38')]){_0x52ffa4[_0x455f('0x35')]=_['merge'](_0x52ffa4['where'],{'$or':_[_0x455f('0x27')](_0x45a612,function(_0x35ab9d){if(_0x35ab9d['type']!==_0x455f('0x39')){var _0x5a3271={};_0x5a3271[_0x35ab9d['name']]={'$like':'%'+_0x2999e5[_0x455f('0x2d')]['filter']+'%'};return _0x5a3271;}})});}_0x52ffa4=_[_0x455f('0x3a')]({},_0x52ffa4,_0x2999e5[_0x455f('0x3b')]);var _0x408ec2={'where':_0x52ffa4['where']};return db[_0x455f('0x28')][_0x455f('0x1b')](_0x408ec2)[_0x455f('0x20')](function(_0x29700c){_0x3a878e['count']=_0x29700c;if(_0x2999e5[_0x455f('0x2d')][_0x455f('0x3c')]){_0x52ffa4[_0x455f('0x3d')]=[{'all':!![]}];}return db[_0x455f('0x28')][_0x455f('0x3e')](_0x52ffa4);})['then'](function(_0x2ee756){_0x3a878e[_0x455f('0x3f')]=_0x2ee756;return _0x3a878e;})['then'](respondWithFilteredResult(_0x18d15e,_0x52ffa4))[_0x455f('0x40')](handleError(_0x18d15e,null));};exports['show']=function(_0x14f457,_0x2d60a0){var _0x291f30={'raw':![],'where':{'id':_0x14f457[_0x455f('0x41')]['id']}},_0x1f0610={};_0x1f0610[_0x455f('0x2a')]=_['keys'](db[_0x455f('0x28')][_0x455f('0x42')]);_0x1f0610[_0x455f('0x2d')]=_['keys'](_0x14f457[_0x455f('0x2d')]);_0x1f0610[_0x455f('0x36')]=_[_0x455f('0x2f')](_0x1f0610[_0x455f('0x2a')],_0x1f0610[_0x455f('0x2d')]);_0x291f30[_0x455f('0x2e')]=_[_0x455f('0x2f')](_0x1f0610[_0x455f('0x2a')],qs[_0x455f('0x30')](_0x14f457[_0x455f('0x2d')][_0x455f('0x30')]));_0x291f30[_0x455f('0x2e')]=_0x291f30[_0x455f('0x2e')][_0x455f('0x31')]?_0x291f30['attributes']:_0x1f0610[_0x455f('0x2a')];if(_0x14f457['query'][_0x455f('0x3c')]){_0x291f30['include']=[{'all':!![]}];}_0x291f30=_[_0x455f('0x3a')]({},_0x291f30,_0x14f457[_0x455f('0x3b')]);return db[_0x455f('0x28')]['find'](_0x291f30)[_0x455f('0x20')](handleEntityNotFound(_0x2d60a0,null))[_0x455f('0x20')](respondWithResult(_0x2d60a0,null))['catch'](handleError(_0x2d60a0,null));};exports[_0x455f('0x43')]=function(_0x3eb882,_0x2a08aa){return db[_0x455f('0x28')][_0x455f('0x43')](_0x3eb882['body'],{})[_0x455f('0x20')](respondWithResult(_0x2a08aa,0xc9))[_0x455f('0x40')](handleError(_0x2a08aa,null));};exports[_0x455f('0x1f')]=function(_0x3ec592,_0x14c601){if(_0x3ec592[_0x455f('0x44')]['id']){delete _0x3ec592[_0x455f('0x44')]['id'];}return db[_0x455f('0x28')]['find']({'where':{'id':_0x3ec592['params']['id']}})[_0x455f('0x20')](handleEntityNotFound(_0x14c601,null))['then'](saveUpdates(_0x3ec592['body'],null))['then'](respondWithResult(_0x14c601,null))[_0x455f('0x40')](handleError(_0x14c601,null));};exports['destroy']=function(_0x4ea533,_0x68fbf4){return db['Dynamics365Configuration'][_0x455f('0x45')]({'where':{'id':_0x4ea533['params']['id']}})[_0x455f('0x20')](handleEntityNotFound(_0x68fbf4,null))[_0x455f('0x20')](removeEntity(_0x68fbf4,null))[_0x455f('0x40')](handleError(_0x68fbf4,null));};exports['getFields']=function(_0x93c3d,_0x459c33,_0x728415){var _0x2efbdf={};var _0x4c710a={};var _0x49beeb;var _0x101e0e;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x93c3d[_0x455f('0x41')]['id']}})[_0x455f('0x20')](handleEntityNotFound(_0x459c33,null))['then'](function(_0x225d18){if(_0x225d18){_0x49beeb=_0x225d18;_0x4c710a['model']=_[_0x455f('0x2c')](db[_0x455f('0x46')][_0x455f('0x42')]);_0x4c710a[_0x455f('0x2d')]=_[_0x455f('0x2c')](_0x93c3d[_0x455f('0x2d')]);_0x4c710a['filters']=_[_0x455f('0x2f')](_0x4c710a[_0x455f('0x2a')],_0x4c710a[_0x455f('0x2d')]);_0x2efbdf[_0x455f('0x2e')]=_['intersection'](_0x4c710a[_0x455f('0x2a')],qs[_0x455f('0x30')](_0x93c3d['query'][_0x455f('0x30')]));_0x2efbdf[_0x455f('0x2e')]=_0x2efbdf['attributes'][_0x455f('0x31')]?_0x2efbdf[_0x455f('0x2e')]:_0x4c710a['model'];_0x2efbdf[_0x455f('0x33')]=qs[_0x455f('0x34')](_0x93c3d[_0x455f('0x2d')][_0x455f('0x34')]);_0x2efbdf[_0x455f('0x35')]=qs[_0x455f('0x36')](_[_0x455f('0x37')](_0x93c3d[_0x455f('0x2d')],_0x4c710a['filters']));if(_0x93c3d['query']['filter']){_0x2efbdf['where']=_[_0x455f('0x3a')](_0x2efbdf[_0x455f('0x35')],{'$or':_[_0x455f('0x27')](_0x2efbdf['attributes'],function(_0x122066){var _0x22d8e2={};_0x22d8e2[_0x122066]={'$like':'%'+_0x93c3d[_0x455f('0x2d')][_0x455f('0x38')]+'%'};return _0x22d8e2;})});}_0x2efbdf=_['merge']({},_0x2efbdf,_0x93c3d[_0x455f('0x3b')]);return _0x49beeb[_0x455f('0x47')](_0x2efbdf);}})[_0x455f('0x20')](function(_0x52daf5){if(_0x52daf5){_0x101e0e=_0x52daf5['length'];if(!_0x93c3d[_0x455f('0x2d')]['hasOwnProperty'](_0x455f('0x32'))){_0x2efbdf[_0x455f('0x1a')]=qs['limit'](_0x93c3d['query'][_0x455f('0x1a')]);_0x2efbdf[_0x455f('0x18')]=qs['offset'](_0x93c3d['query'][_0x455f('0x18')]);}return _0x49beeb[_0x455f('0x47')](_0x2efbdf);}})[_0x455f('0x20')](function(_0x717fd8){if(_0x717fd8){return _0x717fd8?{'count':_0x101e0e,'rows':_0x717fd8}:null;}})[_0x455f('0x20')](respondWithResult(_0x459c33,null))[_0x455f('0x40')](handleError(_0x459c33,null));};exports['getSubjects']=function(_0x2594d3,_0x1b41a5,_0x8acf86){var _0x2ed189={};var _0x2da9cb={};var _0x2ec34c;var _0x7c28f0;return db[_0x455f('0x28')]['findOne']({'where':{'id':_0x2594d3[_0x455f('0x41')]['id']}})[_0x455f('0x20')](handleEntityNotFound(_0x1b41a5,null))[_0x455f('0x20')](function(_0x2a4b10){if(_0x2a4b10){_0x2ec34c=_0x2a4b10;_0x2da9cb[_0x455f('0x2a')]=_[_0x455f('0x2c')](db[_0x455f('0x46')]['rawAttributes']);_0x2da9cb[_0x455f('0x2d')]=_[_0x455f('0x2c')](_0x2594d3[_0x455f('0x2d')]);_0x2da9cb[_0x455f('0x36')]=_['intersection'](_0x2da9cb[_0x455f('0x2a')],_0x2da9cb[_0x455f('0x2d')]);_0x2ed189[_0x455f('0x2e')]=_['intersection'](_0x2da9cb[_0x455f('0x2a')],qs[_0x455f('0x30')](_0x2594d3[_0x455f('0x2d')][_0x455f('0x30')]));_0x2ed189[_0x455f('0x2e')]=_0x2ed189['attributes']['length']?_0x2ed189['attributes']:_0x2da9cb[_0x455f('0x2a')];_0x2ed189[_0x455f('0x33')]=qs[_0x455f('0x34')](_0x2594d3[_0x455f('0x2d')][_0x455f('0x34')]);_0x2ed189[_0x455f('0x35')]=qs[_0x455f('0x36')](_[_0x455f('0x37')](_0x2594d3['query'],_0x2da9cb[_0x455f('0x36')]));if(_0x2594d3[_0x455f('0x2d')][_0x455f('0x38')]){_0x2ed189[_0x455f('0x35')]=_[_0x455f('0x3a')](_0x2ed189[_0x455f('0x35')],{'$or':_[_0x455f('0x27')](_0x2ed189['attributes'],function(_0x1c41b4){var _0x3e3bce={};_0x3e3bce[_0x1c41b4]={'$like':'%'+_0x2594d3[_0x455f('0x2d')][_0x455f('0x38')]+'%'};return _0x3e3bce;})});}_0x2ed189=_[_0x455f('0x3a')]({},_0x2ed189,_0x2594d3['options']);return _0x2ec34c[_0x455f('0x48')](_0x2ed189);}})['then'](function(_0x326a8f){if(_0x326a8f){_0x7c28f0=_0x326a8f[_0x455f('0x31')];if(!_0x2594d3['query']['hasOwnProperty'](_0x455f('0x32'))){_0x2ed189[_0x455f('0x1a')]=qs[_0x455f('0x1a')](_0x2594d3['query'][_0x455f('0x1a')]);_0x2ed189[_0x455f('0x18')]=qs[_0x455f('0x18')](_0x2594d3['query']['offset']);}return _0x2ec34c[_0x455f('0x48')](_0x2ed189);}})[_0x455f('0x20')](function(_0x43a971){if(_0x43a971){return _0x43a971?{'count':_0x7c28f0,'rows':_0x43a971}:null;}})['then'](respondWithResult(_0x1b41a5,null))['catch'](handleError(_0x1b41a5,null));};exports[_0x455f('0x49')]=function(_0x5be448,_0x466069,_0x38ebd4){var _0x40c41c={};var _0x582503={};var _0x4b3a6b;var _0x51ed22;return db['Dynamics365Configuration'][_0x455f('0x4a')]({'where':{'id':_0x5be448['params']['id']}})[_0x455f('0x20')](handleEntityNotFound(_0x466069,null))['then'](function(_0x9c819a){if(_0x9c819a){_0x4b3a6b=_0x9c819a;_0x582503[_0x455f('0x2a')]=_[_0x455f('0x2c')](db['Dynamics365Field'][_0x455f('0x42')]);_0x582503[_0x455f('0x2d')]=_[_0x455f('0x2c')](_0x5be448[_0x455f('0x2d')]);_0x582503[_0x455f('0x36')]=_[_0x455f('0x2f')](_0x582503[_0x455f('0x2a')],_0x582503[_0x455f('0x2d')]);_0x40c41c[_0x455f('0x2e')]=_['intersection'](_0x582503[_0x455f('0x2a')],qs[_0x455f('0x30')](_0x5be448[_0x455f('0x2d')][_0x455f('0x30')]));_0x40c41c[_0x455f('0x2e')]=_0x40c41c[_0x455f('0x2e')][_0x455f('0x31')]?_0x40c41c[_0x455f('0x2e')]:_0x582503[_0x455f('0x2a')];_0x40c41c[_0x455f('0x33')]=qs[_0x455f('0x34')](_0x5be448[_0x455f('0x2d')][_0x455f('0x34')]);_0x40c41c[_0x455f('0x35')]=qs[_0x455f('0x36')](_[_0x455f('0x37')](_0x5be448['query'],_0x582503['filters']));if(_0x5be448['query']['filter']){_0x40c41c[_0x455f('0x35')]=_[_0x455f('0x3a')](_0x40c41c[_0x455f('0x35')],{'$or':_[_0x455f('0x27')](_0x40c41c[_0x455f('0x2e')],function(_0x10f8a8){var _0x391990={};_0x391990[_0x10f8a8]={'$like':'%'+_0x5be448[_0x455f('0x2d')][_0x455f('0x38')]+'%'};return _0x391990;})});}_0x40c41c=_[_0x455f('0x3a')]({},_0x40c41c,_0x5be448[_0x455f('0x3b')]);return _0x4b3a6b['getDescriptions'](_0x40c41c);}})['then'](function(_0x4cfafa){if(_0x4cfafa){_0x51ed22=_0x4cfafa[_0x455f('0x31')];if(!_0x5be448[_0x455f('0x2d')][_0x455f('0x4b')](_0x455f('0x32'))){_0x40c41c[_0x455f('0x1a')]=qs[_0x455f('0x1a')](_0x5be448[_0x455f('0x2d')][_0x455f('0x1a')]);_0x40c41c['offset']=qs[_0x455f('0x18')](_0x5be448[_0x455f('0x2d')][_0x455f('0x18')]);}return _0x4b3a6b[_0x455f('0x49')](_0x40c41c);}})[_0x455f('0x20')](function(_0x48df61){if(_0x48df61){return _0x48df61?{'count':_0x51ed22,'rows':_0x48df61}:null;}})[_0x455f('0x20')](respondWithResult(_0x466069,null))['catch'](handleError(_0x466069,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f0a1d2d..a5072a6 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 _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x41c035,_0x44d9ef){var _0x2f1a39=function(_0x8de275){while(--_0x8de275){_0x41c035['push'](_0x41c035['shift']());}};_0x2f1a39(++_0x44d9ef);}(_0xbec5,0xe5));var _0x5bec=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xbec5[_0x421c56];return _0x49b244;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x24358b,_0x11ba19){_0x24358b=_0x24358b-0x0;var _0xae1267=_0xe5b3[_0x24358b];return _0xae1267;};'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 a063e9c..79c211b 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 _0xdd9a=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3e4c83,_0x136c53){var _0x942b5d=function(_0x566bbf){while(--_0x566bbf){_0x3e4c83['push'](_0x3e4c83['shift']());}};_0x942b5d(++_0x136c53);}(_0xdd9a,0xdd));var _0xadd9=function(_0x2d52d7,_0x2802e9){_0x2d52d7=_0x2d52d7-0x0;var _0x239633=_0xdd9a[_0x2d52d7];return _0x239633;};'use strict';var _=require('lodash');var util=require(_0xadd9('0x0'));var moment=require(_0xadd9('0x1'));var BPromise=require(_0xadd9('0x2'));var rs=require(_0xadd9('0x3'));var fs=require('fs');var Redis=require(_0xadd9('0x4'));var db=require(_0xadd9('0x5'))['db'];var utils=require(_0xadd9('0x6'));var logger=require(_0xadd9('0x7'))('rpc');var config=require(_0xadd9('0x8'));var jayson=require(_0xadd9('0x9'));var client=jayson[_0xadd9('0xa')][_0xadd9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25e7e7,_0x248333,_0x47cefb){return new BPromise(function(_0xf17272,_0x37660b){return client[_0xadd9('0xc')](_0x25e7e7,_0x47cefb)[_0xadd9('0xd')](function(_0x4ecdf2){logger[_0xadd9('0xe')](_0xadd9('0xf'),_0x248333,_0xadd9('0x10'));logger['debug'](_0xadd9('0x11'),_0x248333,_0xadd9('0x10'),JSON['stringify'](_0x4ecdf2));if(_0x4ecdf2[_0xadd9('0x12')]){if(_0x4ecdf2[_0xadd9('0x12')][_0xadd9('0x13')]===0x1f4){logger['error'](_0xadd9('0xf'),_0x248333,_0x4ecdf2[_0xadd9('0x12')][_0xadd9('0x14')]);return _0x37660b(_0x4ecdf2[_0xadd9('0x12')]['message']);}logger[_0xadd9('0x12')](_0xadd9('0xf'),_0x248333,_0x4ecdf2[_0xadd9('0x12')]['message']);return _0xf17272(_0x4ecdf2[_0xadd9('0x12')][_0xadd9('0x14')]);}else{logger[_0xadd9('0xe')](_0xadd9('0xf'),_0x248333,_0xadd9('0x10'));_0xf17272(_0x4ecdf2[_0xadd9('0x15')][_0xadd9('0x14')]);}})['catch'](function(_0x9f5be){logger[_0xadd9('0x12')](_0xadd9('0xf'),_0x248333,_0x9f5be);_0x37660b(_0x9f5be);});});} \ No newline at end of file +var _0x7578=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','util'];(function(_0xa0a0f,_0x351a51){var _0x423d1b=function(_0x260be7){while(--_0x260be7){_0xa0a0f['push'](_0xa0a0f['shift']());}};_0x423d1b(++_0x351a51);}(_0x7578,0x70));var _0x8757=function(_0x770dd7,_0x279f59){_0x770dd7=_0x770dd7-0x0;var _0x2ee9f5=_0x7578[_0x770dd7];return _0x2ee9f5;};'use strict';var _=require(_0x8757('0x0'));var util=require(_0x8757('0x1'));var moment=require('moment');var BPromise=require(_0x8757('0x2'));var rs=require(_0x8757('0x3'));var fs=require('fs');var Redis=require(_0x8757('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8757('0x5'));var logger=require(_0x8757('0x6'))(_0x8757('0x7'));var config=require(_0x8757('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5286e5,_0xf89e6c,_0x588a36){return new BPromise(function(_0x8f6a0,_0x9cb6d0){return client[_0x8757('0x9')](_0x5286e5,_0x588a36)[_0x8757('0xa')](function(_0x52cc8f){logger[_0x8757('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0xf89e6c,_0x8757('0xc'));logger['debug'](_0x8757('0xd'),_0xf89e6c,_0x8757('0xc'),JSON['stringify'](_0x52cc8f));if(_0x52cc8f['error']){if(_0x52cc8f[_0x8757('0xe')][_0x8757('0xf')]===0x1f4){logger[_0x8757('0xe')](_0x8757('0x10'),_0xf89e6c,_0x52cc8f[_0x8757('0xe')]['message']);return _0x9cb6d0(_0x52cc8f[_0x8757('0xe')][_0x8757('0x11')]);}logger[_0x8757('0xe')](_0x8757('0x10'),_0xf89e6c,_0x52cc8f[_0x8757('0xe')]['message']);return _0x8f6a0(_0x52cc8f[_0x8757('0xe')][_0x8757('0x11')]);}else{logger['info'](_0x8757('0x10'),_0xf89e6c,_0x8757('0xc'));_0x8f6a0(_0x52cc8f[_0x8757('0x12')][_0x8757('0x11')]);}})['catch'](function(_0x5f2e2c){logger[_0x8757('0xe')](_0x8757('0x10'),_0xf89e6c,_0x5f2e2c);_0x9cb6d0(_0x5f2e2c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index cb0c21d..e14784f 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 _0x3f64=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x3f64,0xc2));var _0x43f6=function(_0x20ec74,_0x3a8843){_0x20ec74=_0x20ec74-0x0;var _0x89b81b=_0x3f64[_0x20ec74];return _0x89b81b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x43f6('0x0'));var timeout=require(_0x43f6('0x1'));var express=require(_0x43f6('0x2'));var router=express[_0x43f6('0x3')]();var fs_extra=require(_0x43f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43f6('0x5'));var config=require(_0x43f6('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x43f6('0x7')]('/',auth[_0x43f6('0x8')](),controller[_0x43f6('0x9')]);router['get'](_0x43f6('0xa'),auth[_0x43f6('0x8')](),controller['show']);router[_0x43f6('0xb')]('/',auth[_0x43f6('0x8')](),controller[_0x43f6('0xc')]);router[_0x43f6('0xd')](_0x43f6('0xa'),auth['isAuthenticated'](),controller[_0x43f6('0xe')]);router[_0x43f6('0xf')](_0x43f6('0xa'),auth['isAuthenticated'](),controller[_0x43f6('0x10')]);module[_0x43f6('0x11')]=router; \ No newline at end of file +var _0xfda5=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x5d3550,_0x107033){var _0x5d1299=function(_0x5edaa1){while(--_0x5edaa1){_0x5d3550['push'](_0x5d3550['shift']());}};_0x5d1299(++_0x107033);}(_0xfda5,0x14c));var _0x5fda=function(_0x415c06,_0x4ec6b0){_0x415c06=_0x415c06-0x0;var _0x5f5704=_0xfda5[_0x415c06];return _0x5f5704;};'use strict';var multer=require(_0x5fda('0x0'));var util=require('util');var path=require(_0x5fda('0x1'));var timeout=require(_0x5fda('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5fda('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5fda('0x4'));var config=require(_0x5fda('0x5'));var controller=require('./intDynamics365Field.controller');router[_0x5fda('0x6')]('/',auth[_0x5fda('0x7')](),controller[_0x5fda('0x8')]);router['get'](_0x5fda('0x9'),auth[_0x5fda('0x7')](),controller[_0x5fda('0xa')]);router[_0x5fda('0xb')]('/',auth[_0x5fda('0x7')](),controller['create']);router['put'](_0x5fda('0x9'),auth[_0x5fda('0x7')](),controller[_0x5fda('0xc')]);router[_0x5fda('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5fda('0xe')]);module[_0x5fda('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index c7fa4a3..4bd8ffc 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 _0x7a90=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3b8bc6,_0xf97075){var _0x1d8009=function(_0x376f7e){while(--_0x376f7e){_0x3b8bc6['push'](_0x3b8bc6['shift']());}};_0x1d8009(++_0xf97075);}(_0x7a90,0x1a2));var _0x07a9=function(_0x26c9fc,_0x2fc5f6){_0x26c9fc=_0x26c9fc-0x0;var _0x4db1a3=_0x7a90[_0x26c9fc];return _0x4db1a3;};'use strict';var Sequelize=require(_0x07a9('0x0'));module[_0x07a9('0x1')]={'type':{'type':Sequelize[_0x07a9('0x2')](_0x07a9('0x3'),_0x07a9('0x4'),_0x07a9('0x5'),'keyValue',_0x07a9('0x6')),'defaultValue':_0x07a9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x07a9('0x3'),_0x07a9('0x4'),_0x07a9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x07a9('0x7')]}}; \ No newline at end of file +var _0x1cdf=['variable','customVariable','picklist','string','STRING','BOOLEAN','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cdf,0xed));var _0xf1cd=function(_0x32c9c2,_0x11a6a9){_0x32c9c2=_0x32c9c2-0x0;var _0x490212=_0x1cdf[_0x32c9c2];return _0x490212;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf1cd('0x0')]('string',_0xf1cd('0x1'),_0xf1cd('0x2'),'keyValue',_0xf1cd('0x3')),'defaultValue':_0xf1cd('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf1cd('0x5')]},'keyType':{'type':Sequelize[_0xf1cd('0x0')](_0xf1cd('0x4'),_0xf1cd('0x1'),_0xf1cd('0x2'))},'keyContent':{'type':Sequelize[_0xf1cd('0x5')]},'idField':{'type':Sequelize[_0xf1cd('0x5')]},'nameField':{'type':Sequelize[_0xf1cd('0x5')]},'customField':{'type':Sequelize[_0xf1cd('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf1cd('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index e7955bc..2496f50 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 _0x5b46=['include','rows','catch','show','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','options'];(function(_0x1583c6,_0x2ed606){var _0x3d6507=function(_0x2520ae){while(--_0x2520ae){_0x1583c6['push'](_0x1583c6['shift']());}};_0x3d6507(++_0x2ed606);}(_0x5b46,0x97));var _0x65b4=function(_0xaf1bd7,_0x3493e2){_0xaf1bd7=_0xaf1bd7-0x0;var _0x40364d=_0x5b46[_0xaf1bd7];return _0x40364d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65b4('0x0'));var zipdir=require(_0x65b4('0x1'));var jsonpatch=require(_0x65b4('0x2'));var rp=require(_0x65b4('0x3'));var moment=require('moment');var BPromise=require(_0x65b4('0x4'));var Mustache=require(_0x65b4('0x5'));var util=require(_0x65b4('0x6'));var path=require(_0x65b4('0x7'));var sox=require(_0x65b4('0x8'));var csv=require(_0x65b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65b4('0xa'));var crypto=require('crypto');var jsforce=require(_0x65b4('0xb'));var deskjs=require(_0x65b4('0xc'));var toCsv=require(_0x65b4('0x9'));var querystring=require(_0x65b4('0xd'));var Papa=require(_0x65b4('0xe'));var Redis=require('ioredis');var authService=require(_0x65b4('0xf'));var qs=require(_0x65b4('0x10'));var as=require(_0x65b4('0x11'));var hardwareService=require(_0x65b4('0x12'));var logger=require(_0x65b4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x65b4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x65b4('0x15'))['db'];function respondWithStatusCode(_0x3104d1,_0x1100a2){_0x1100a2=_0x1100a2||0xcc;return function(_0x4ccd51){if(_0x4ccd51){return _0x3104d1[_0x65b4('0x16')](_0x1100a2);}return _0x3104d1[_0x65b4('0x17')](_0x1100a2)[_0x65b4('0x18')]();};}function respondWithResult(_0x44c483,_0x1b3e44){_0x1b3e44=_0x1b3e44||0xc8;return function(_0x527611){if(_0x527611){return _0x44c483['status'](_0x1b3e44)[_0x65b4('0x19')](_0x527611);}};}function respondWithFilteredResult(_0x2c9815,_0x158841){return function(_0x2e1e04){if(_0x2e1e04){var _0x2ee252=typeof _0x158841[_0x65b4('0x1a')]===_0x65b4('0x1b')&&typeof _0x158841[_0x65b4('0x1c')]===_0x65b4('0x1b');var _0x266bd1=_0x2e1e04[_0x65b4('0x1d')];var _0x3b7876=_0x2ee252?0x0:_0x158841[_0x65b4('0x1a')];var _0x163025=_0x2ee252?_0x2e1e04[_0x65b4('0x1d')]:_0x158841[_0x65b4('0x1a')]+_0x158841['limit'];var _0x3358f5;if(_0x163025>=_0x266bd1){_0x163025=_0x266bd1;_0x3358f5=0xc8;}else{_0x3358f5=0xce;}_0x2c9815['status'](_0x3358f5);return _0x2c9815[_0x65b4('0x1e')](_0x65b4('0x1f'),_0x3b7876+'-'+_0x163025+'/'+_0x266bd1)[_0x65b4('0x19')](_0x2e1e04);}return null;};}function patchUpdates(_0x42a4eb){return function(_0x2d000a){try{jsonpatch[_0x65b4('0x20')](_0x2d000a,_0x42a4eb,!![]);}catch(_0x43836e){return BPromise['reject'](_0x43836e);}return _0x2d000a[_0x65b4('0x21')]();};}function saveUpdates(_0x1d2caa,_0x11d379){return function(_0x5b1e75){if(_0x5b1e75){return _0x5b1e75[_0x65b4('0x22')](_0x1d2caa)[_0x65b4('0x23')](function(_0x92673a){return _0x92673a;});}return null;};}function removeEntity(_0x2c6f0d,_0x2ccb68){return function(_0x1df4fc){if(_0x1df4fc){return _0x1df4fc['destroy']()['then'](function(){_0x2c6f0d[_0x65b4('0x17')](0xcc)[_0x65b4('0x18')]();});}};}function handleEntityNotFound(_0x24301d,_0x9d89ee){return function(_0x460be7){if(!_0x460be7){_0x24301d[_0x65b4('0x16')](0x194);}return _0x460be7;};}function handleError(_0xfdfb15,_0x54eea9){_0x54eea9=_0x54eea9||0x1f4;return function(_0x29f3c1){logger['error'](_0x29f3c1[_0x65b4('0x24')]);if(_0x29f3c1[_0x65b4('0x25')]){delete _0x29f3c1[_0x65b4('0x25')];}_0xfdfb15[_0x65b4('0x17')](_0x54eea9)[_0x65b4('0x26')](_0x29f3c1);};}exports[_0x65b4('0x27')]=function(_0x3e3e85,_0x108c50){var _0x1b7fc9={},_0x4efe8e={},_0x2b4936={'count':0x0,'rows':[]};var _0x505a3d=_[_0x65b4('0x28')](db[_0x65b4('0x29')][_0x65b4('0x2a')],function(_0x33ac08){return{'name':_0x33ac08[_0x65b4('0x2b')],'type':_0x33ac08[_0x65b4('0x2c')][_0x65b4('0x2d')]};});_0x4efe8e[_0x65b4('0x2e')]=_[_0x65b4('0x28')](_0x505a3d,_0x65b4('0x25'));_0x4efe8e[_0x65b4('0x2f')]=_[_0x65b4('0x30')](_0x3e3e85['query']);_0x4efe8e['filters']=_['intersection'](_0x4efe8e['model'],_0x4efe8e['query']);_0x1b7fc9[_0x65b4('0x31')]=_[_0x65b4('0x32')](_0x4efe8e[_0x65b4('0x2e')],qs[_0x65b4('0x33')](_0x3e3e85[_0x65b4('0x2f')][_0x65b4('0x33')]));_0x1b7fc9['attributes']=_0x1b7fc9['attributes'][_0x65b4('0x34')]?_0x1b7fc9[_0x65b4('0x31')]:_0x4efe8e['model'];if(!_0x3e3e85['query'][_0x65b4('0x35')]('nolimit')){_0x1b7fc9[_0x65b4('0x1c')]=qs[_0x65b4('0x1c')](_0x3e3e85[_0x65b4('0x2f')][_0x65b4('0x1c')]);_0x1b7fc9[_0x65b4('0x1a')]=qs['offset'](_0x3e3e85[_0x65b4('0x2f')]['offset']);}_0x1b7fc9[_0x65b4('0x36')]=qs[_0x65b4('0x37')](_0x3e3e85[_0x65b4('0x2f')]['sort']);_0x1b7fc9['where']=qs[_0x65b4('0x38')](_['pick'](_0x3e3e85['query'],_0x4efe8e[_0x65b4('0x38')]),_0x505a3d);if(_0x3e3e85[_0x65b4('0x2f')][_0x65b4('0x39')]){_0x1b7fc9['where']=_[_0x65b4('0x3a')](_0x1b7fc9[_0x65b4('0x3b')],{'$or':_['map'](_0x505a3d,function(_0x410e5e){if(_0x410e5e['type']!==_0x65b4('0x3c')){var _0x5710ab={};_0x5710ab[_0x410e5e[_0x65b4('0x25')]]={'$like':'%'+_0x3e3e85[_0x65b4('0x2f')][_0x65b4('0x39')]+'%'};return _0x5710ab;}})});}_0x1b7fc9=_[_0x65b4('0x3a')]({},_0x1b7fc9,_0x3e3e85[_0x65b4('0x3d')]);var _0x2723bb={'where':_0x1b7fc9[_0x65b4('0x3b')]};return db[_0x65b4('0x29')][_0x65b4('0x1d')](_0x2723bb)[_0x65b4('0x23')](function(_0x3499a7){_0x2b4936[_0x65b4('0x1d')]=_0x3499a7;if(_0x3e3e85[_0x65b4('0x2f')]['includeAll']){_0x1b7fc9[_0x65b4('0x3e')]=[{'all':!![]}];}return db[_0x65b4('0x29')]['findAll'](_0x1b7fc9);})[_0x65b4('0x23')](function(_0x3653d2){_0x2b4936[_0x65b4('0x3f')]=_0x3653d2;return _0x2b4936;})[_0x65b4('0x23')](respondWithFilteredResult(_0x108c50,_0x1b7fc9))[_0x65b4('0x40')](handleError(_0x108c50,null));};exports[_0x65b4('0x41')]=function(_0x287553,_0x8adf62){var _0x43825d={'raw':!![],'where':{'id':_0x287553['params']['id']}},_0x14f3f8={};_0x14f3f8['model']=_[_0x65b4('0x30')](db[_0x65b4('0x29')][_0x65b4('0x2a')]);_0x14f3f8[_0x65b4('0x2f')]=_[_0x65b4('0x30')](_0x287553[_0x65b4('0x2f')]);_0x14f3f8['filters']=_[_0x65b4('0x32')](_0x14f3f8[_0x65b4('0x2e')],_0x14f3f8['query']);_0x43825d['attributes']=_[_0x65b4('0x32')](_0x14f3f8[_0x65b4('0x2e')],qs[_0x65b4('0x33')](_0x287553['query']['fields']));_0x43825d[_0x65b4('0x31')]=_0x43825d[_0x65b4('0x31')]['length']?_0x43825d[_0x65b4('0x31')]:_0x14f3f8[_0x65b4('0x2e')];if(_0x287553[_0x65b4('0x2f')]['includeAll']){_0x43825d[_0x65b4('0x3e')]=[{'all':!![]}];}_0x43825d=_['merge']({},_0x43825d,_0x287553['options']);return db[_0x65b4('0x29')][_0x65b4('0x42')](_0x43825d)[_0x65b4('0x23')](handleEntityNotFound(_0x8adf62,null))[_0x65b4('0x23')](respondWithResult(_0x8adf62,null))[_0x65b4('0x40')](handleError(_0x8adf62,null));};exports[_0x65b4('0x43')]=function(_0x177477,_0x198886){return db['Dynamics365Field'][_0x65b4('0x43')](_0x177477[_0x65b4('0x44')],{})['then'](respondWithResult(_0x198886,0xc9))['catch'](handleError(_0x198886,null));};exports[_0x65b4('0x22')]=function(_0x32ce9e,_0x4ce556){if(_0x32ce9e['body']['id']){delete _0x32ce9e[_0x65b4('0x44')]['id'];}return db['Dynamics365Field'][_0x65b4('0x42')]({'where':{'id':_0x32ce9e[_0x65b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ce556,null))[_0x65b4('0x23')](saveUpdates(_0x32ce9e['body'],null))['then'](respondWithResult(_0x4ce556,null))[_0x65b4('0x40')](handleError(_0x4ce556,null));};exports[_0x65b4('0x46')]=function(_0x355878,_0x5b0285){return db[_0x65b4('0x29')]['find']({'where':{'id':_0x355878[_0x65b4('0x45')]['id']}})[_0x65b4('0x23')](handleEntityNotFound(_0x5b0285,null))[_0x65b4('0x23')](removeEntity(_0x5b0285,null))['catch'](handleError(_0x5b0285,null));}; \ No newline at end of file +var _0x8194=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','map','Dynamics365Field','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','update','eml-format','rimraf','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x14c7b3,_0x4677b7){var _0x1518ef=function(_0x3bc379){while(--_0x3bc379){_0x14c7b3['push'](_0x14c7b3['shift']());}};_0x1518ef(++_0x4677b7);}(_0x8194,0x16c));var _0x4819=function(_0x1f7909,_0x1aefbd){_0x1f7909=_0x1f7909-0x0;var _0x2cb51f=_0x8194[_0x1f7909];return _0x2cb51f;};'use strict';var emlformat=require(_0x4819('0x0'));var rimraf=require(_0x4819('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4819('0x2'));var util=require(_0x4819('0x3'));var path=require(_0x4819('0x4'));var sox=require(_0x4819('0x5'));var csv=require(_0x4819('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4819('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4819('0x8'));var jsforce=require(_0x4819('0x9'));var deskjs=require(_0x4819('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4819('0xb'));var Papa=require('papaparse');var Redis=require(_0x4819('0xc'));var authService=require(_0x4819('0xd'));var qs=require(_0x4819('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4819('0xf'));var logger=require(_0x4819('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4819('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4819('0x12'))['db'];function respondWithStatusCode(_0x2ce603,_0x4178ba){_0x4178ba=_0x4178ba||0xcc;return function(_0x221fcb){if(_0x221fcb){return _0x2ce603[_0x4819('0x13')](_0x4178ba);}return _0x2ce603['status'](_0x4178ba)['end']();};}function respondWithResult(_0x1d82b1,_0x215056){_0x215056=_0x215056||0xc8;return function(_0x3989e4){if(_0x3989e4){return _0x1d82b1[_0x4819('0x14')](_0x215056)[_0x4819('0x15')](_0x3989e4);}};}function respondWithFilteredResult(_0xc0b851,_0x22ed25){return function(_0xacf872){if(_0xacf872){var _0x23de53=typeof _0x22ed25[_0x4819('0x16')]===_0x4819('0x17')&&typeof _0x22ed25[_0x4819('0x18')]===_0x4819('0x17');var _0x4adca6=_0xacf872[_0x4819('0x19')];var _0x1323ff=_0x23de53?0x0:_0x22ed25['offset'];var _0x40468e=_0x23de53?_0xacf872[_0x4819('0x19')]:_0x22ed25[_0x4819('0x16')]+_0x22ed25[_0x4819('0x18')];var _0x1d64a3;if(_0x40468e>=_0x4adca6){_0x40468e=_0x4adca6;_0x1d64a3=0xc8;}else{_0x1d64a3=0xce;}_0xc0b851[_0x4819('0x14')](_0x1d64a3);return _0xc0b851[_0x4819('0x1a')]('Content-Range',_0x1323ff+'-'+_0x40468e+'/'+_0x4adca6)[_0x4819('0x15')](_0xacf872);}return null;};}function patchUpdates(_0x52ffd7){return function(_0x153ad8){try{jsonpatch['apply'](_0x153ad8,_0x52ffd7,!![]);}catch(_0xe31245){return BPromise['reject'](_0xe31245);}return _0x153ad8[_0x4819('0x1b')]();};}function saveUpdates(_0x3fc8e6,_0x3c8833){return function(_0x445c36){if(_0x445c36){return _0x445c36['update'](_0x3fc8e6)[_0x4819('0x1c')](function(_0x1fd398){return _0x1fd398;});}return null;};}function removeEntity(_0x13cf76,_0x299f2a){return function(_0x2df549){if(_0x2df549){return _0x2df549[_0x4819('0x1d')]()['then'](function(){_0x13cf76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe61057,_0x244913){return function(_0x20cca0){if(!_0x20cca0){_0xe61057[_0x4819('0x13')](0x194);}return _0x20cca0;};}function handleError(_0x1c47da,_0x575abc){_0x575abc=_0x575abc||0x1f4;return function(_0x3f144e){logger[_0x4819('0x1e')](_0x3f144e[_0x4819('0x1f')]);if(_0x3f144e['name']){delete _0x3f144e[_0x4819('0x20')];}_0x1c47da[_0x4819('0x14')](_0x575abc)[_0x4819('0x21')](_0x3f144e);};}exports['index']=function(_0x52f30a,_0x5b9405){var _0x219fa0={},_0x15384f={},_0x1c3667={'count':0x0,'rows':[]};var _0x5ca53c=_[_0x4819('0x22')](db[_0x4819('0x23')][_0x4819('0x24')],function(_0xff8c4){return{'name':_0xff8c4['fieldName'],'type':_0xff8c4[_0x4819('0x25')]['key']};});_0x15384f['model']=_['map'](_0x5ca53c,'name');_0x15384f[_0x4819('0x26')]=_[_0x4819('0x27')](_0x52f30a[_0x4819('0x26')]);_0x15384f[_0x4819('0x28')]=_[_0x4819('0x29')](_0x15384f[_0x4819('0x2a')],_0x15384f['query']);_0x219fa0[_0x4819('0x2b')]=_['intersection'](_0x15384f[_0x4819('0x2a')],qs[_0x4819('0x2c')](_0x52f30a['query'][_0x4819('0x2c')]));_0x219fa0['attributes']=_0x219fa0['attributes'][_0x4819('0x2d')]?_0x219fa0['attributes']:_0x15384f[_0x4819('0x2a')];if(!_0x52f30a[_0x4819('0x26')][_0x4819('0x2e')](_0x4819('0x2f'))){_0x219fa0['limit']=qs['limit'](_0x52f30a[_0x4819('0x26')]['limit']);_0x219fa0[_0x4819('0x16')]=qs[_0x4819('0x16')](_0x52f30a[_0x4819('0x26')][_0x4819('0x16')]);}_0x219fa0[_0x4819('0x30')]=qs[_0x4819('0x31')](_0x52f30a['query'][_0x4819('0x31')]);_0x219fa0[_0x4819('0x32')]=qs[_0x4819('0x28')](_[_0x4819('0x33')](_0x52f30a[_0x4819('0x26')],_0x15384f['filters']),_0x5ca53c);if(_0x52f30a[_0x4819('0x26')][_0x4819('0x34')]){_0x219fa0[_0x4819('0x32')]=_[_0x4819('0x35')](_0x219fa0[_0x4819('0x32')],{'$or':_[_0x4819('0x22')](_0x5ca53c,function(_0x4f835c){if(_0x4f835c[_0x4819('0x25')]!==_0x4819('0x36')){var _0x14b6c={};_0x14b6c[_0x4f835c['name']]={'$like':'%'+_0x52f30a[_0x4819('0x26')]['filter']+'%'};return _0x14b6c;}})});}_0x219fa0=_[_0x4819('0x35')]({},_0x219fa0,_0x52f30a[_0x4819('0x37')]);var _0xf2eb3c={'where':_0x219fa0[_0x4819('0x32')]};return db[_0x4819('0x23')]['count'](_0xf2eb3c)['then'](function(_0xf48aa5){_0x1c3667['count']=_0xf48aa5;if(_0x52f30a['query'][_0x4819('0x38')]){_0x219fa0['include']=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x219fa0);})[_0x4819('0x1c')](function(_0x5e4afc){_0x1c3667['rows']=_0x5e4afc;return _0x1c3667;})[_0x4819('0x1c')](respondWithFilteredResult(_0x5b9405,_0x219fa0))[_0x4819('0x39')](handleError(_0x5b9405,null));};exports['show']=function(_0x5b8e78,_0x2b435c){var _0x5b9702={'raw':!![],'where':{'id':_0x5b8e78[_0x4819('0x3a')]['id']}},_0x1a9108={};_0x1a9108[_0x4819('0x2a')]=_['keys'](db[_0x4819('0x23')][_0x4819('0x24')]);_0x1a9108['query']=_[_0x4819('0x27')](_0x5b8e78[_0x4819('0x26')]);_0x1a9108[_0x4819('0x28')]=_[_0x4819('0x29')](_0x1a9108[_0x4819('0x2a')],_0x1a9108[_0x4819('0x26')]);_0x5b9702[_0x4819('0x2b')]=_[_0x4819('0x29')](_0x1a9108[_0x4819('0x2a')],qs[_0x4819('0x2c')](_0x5b8e78[_0x4819('0x26')][_0x4819('0x2c')]));_0x5b9702[_0x4819('0x2b')]=_0x5b9702['attributes'][_0x4819('0x2d')]?_0x5b9702['attributes']:_0x1a9108['model'];if(_0x5b8e78['query'][_0x4819('0x38')]){_0x5b9702[_0x4819('0x3b')]=[{'all':!![]}];}_0x5b9702=_['merge']({},_0x5b9702,_0x5b8e78['options']);return db[_0x4819('0x23')][_0x4819('0x3c')](_0x5b9702)[_0x4819('0x1c')](handleEntityNotFound(_0x2b435c,null))[_0x4819('0x1c')](respondWithResult(_0x2b435c,null))[_0x4819('0x39')](handleError(_0x2b435c,null));};exports[_0x4819('0x3d')]=function(_0x11e16e,_0x167628){return db[_0x4819('0x23')]['create'](_0x11e16e['body'],{})[_0x4819('0x1c')](respondWithResult(_0x167628,0xc9))[_0x4819('0x39')](handleError(_0x167628,null));};exports[_0x4819('0x3e')]=function(_0x3928ec,_0x38dd83){if(_0x3928ec['body']['id']){delete _0x3928ec['body']['id'];}return db[_0x4819('0x23')][_0x4819('0x3c')]({'where':{'id':_0x3928ec[_0x4819('0x3a')]['id']}})[_0x4819('0x1c')](handleEntityNotFound(_0x38dd83,null))[_0x4819('0x1c')](saveUpdates(_0x3928ec['body'],null))['then'](respondWithResult(_0x38dd83,null))[_0x4819('0x39')](handleError(_0x38dd83,null));};exports[_0x4819('0x1d')]=function(_0x341c4d,_0x24e5bc){return db['Dynamics365Field'][_0x4819('0x3c')]({'where':{'id':_0x341c4d[_0x4819('0x3a')]['id']}})[_0x4819('0x1c')](handleEntityNotFound(_0x24e5bc,null))[_0x4819('0x1c')](removeEntity(_0x24e5bc,null))['catch'](handleError(_0x24e5bc,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 424d98e..84c02e8 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 _0x4a24=['int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define'];(function(_0x45588c,_0x56b8d){var _0x3823a5=function(_0x3c1233){while(--_0x3c1233){_0x45588c['push'](_0x45588c['shift']());}};_0x3823a5(++_0x56b8d);}(_0x4a24,0x1ed));var _0x44a2=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0x4a24[_0x5e9a69];return _0x5979c8;};'use strict';var _=require(_0x44a2('0x0'));var util=require(_0x44a2('0x1'));var logger=require(_0x44a2('0x2'))('api');var moment=require(_0x44a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x44a2('0x4'));var fs=require('fs');var path=require(_0x44a2('0x5'));var rimraf=require(_0x44a2('0x6'));var config=require(_0x44a2('0x7'));var attributes=require(_0x44a2('0x8'));module[_0x44a2('0x9')]=function(_0x20669b,_0x5e0120){return _0x20669b[_0x44a2('0xa')]('Dynamics365Field',attributes,{'tableName':_0x44a2('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x44a2('0xc'),_0x44a2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x97e0=['../../config/environment','define','Dynamics365Field','int_dynamics365_fields','idField','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b60db,_0x393e9c){var _0x261f63=function(_0x5215bf){while(--_0x5215bf){_0x1b60db['push'](_0x1b60db['shift']());}};_0x261f63(++_0x393e9c);}(_0x97e0,0x179));var _0x097e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x97e0[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x097e('0x0'));var logger=require('../../config/logger')(_0x097e('0x1'));var moment=require(_0x097e('0x2'));var BPromise=require(_0x097e('0x3'));var rp=require(_0x097e('0x4'));var fs=require('fs');var path=require(_0x097e('0x5'));var rimraf=require(_0x097e('0x6'));var config=require(_0x097e('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x445f30,_0x204364){return _0x445f30[_0x097e('0x8')](_0x097e('0x9'),attributes,{'tableName':_0x097e('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x097e('0xb'),'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 e963e54..5b490ff 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 _0x2af1=['rpc','../../config/environment','client','request','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x120da6,_0x15f450){var _0x3d6c07=function(_0x5acddd){while(--_0x5acddd){_0x120da6['push'](_0x120da6['shift']());}};_0x3d6c07(++_0x15f450);}(_0x2af1,0xde));var _0x12af=function(_0x30d84e,_0x455dd2){_0x30d84e=_0x30d84e-0x0;var _0x21f31b=_0x2af1[_0x30d84e];return _0x21f31b;};'use strict';var _=require(_0x12af('0x0'));var util=require(_0x12af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12af('0x2'));var fs=require('fs');var Redis=require(_0x12af('0x3'));var db=require(_0x12af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x12af('0x5'))(_0x12af('0x6'));var config=require(_0x12af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x228b50,_0x3c8259,_0x15b7d4){return new BPromise(function(_0x46692f,_0x2bad96){return client[_0x12af('0x9')](_0x228b50,_0x15b7d4)[_0x12af('0xa')](function(_0xf3d7d5){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3c8259,'request\x20sent');logger[_0x12af('0xb')](_0x12af('0xc'),_0x3c8259,_0x12af('0xd'),JSON['stringify'](_0xf3d7d5));if(_0xf3d7d5[_0x12af('0xe')]){if(_0xf3d7d5['error'][_0x12af('0xf')]===0x1f4){logger['error'](_0x12af('0x10'),_0x3c8259,_0xf3d7d5[_0x12af('0xe')][_0x12af('0x11')]);return _0x2bad96(_0xf3d7d5[_0x12af('0xe')]['message']);}logger['error'](_0x12af('0x10'),_0x3c8259,_0xf3d7d5[_0x12af('0xe')][_0x12af('0x11')]);return _0x46692f(_0xf3d7d5[_0x12af('0xe')][_0x12af('0x11')]);}else{logger['info'](_0x12af('0x10'),_0x3c8259,_0x12af('0xd'));_0x46692f(_0xf3d7d5['result'][_0x12af('0x11')]);}})[_0x12af('0x12')](function(_0x4e8fbd){logger[_0x12af('0xe')](_0x12af('0x10'),_0x3c8259,_0x4e8fbd);_0x2bad96(_0x4e8fbd);});});} \ No newline at end of file +var _0x2321=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch'];(function(_0x449783,_0x3164d6){var _0x3c2cf8=function(_0x484fc1){while(--_0x484fc1){_0x449783['push'](_0x449783['shift']());}};_0x3c2cf8(++_0x3164d6);}(_0x2321,0x12b));var _0x1232=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0x2321[_0x59ee41];return _0x3ecd3e;};'use strict';var _=require(_0x1232('0x0'));var util=require(_0x1232('0x1'));var moment=require(_0x1232('0x2'));var BPromise=require(_0x1232('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1232('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1232('0x5'));var logger=require(_0x1232('0x6'))(_0x1232('0x7'));var config=require('../../config/environment');var jayson=require(_0x1232('0x8'));var client=jayson[_0x1232('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd72402,_0x5685d0,_0x184e64){return new BPromise(function(_0x2c63a3,_0x205e31){return client[_0x1232('0xa')](_0xd72402,_0x184e64)[_0x1232('0xb')](function(_0x3af804){logger[_0x1232('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5685d0,_0x1232('0xd'));logger[_0x1232('0xe')](_0x1232('0xf'),_0x5685d0,_0x1232('0xd'),JSON[_0x1232('0x10')](_0x3af804));if(_0x3af804['error']){if(_0x3af804[_0x1232('0x11')][_0x1232('0x12')]===0x1f4){logger[_0x1232('0x11')](_0x1232('0x13'),_0x5685d0,_0x3af804[_0x1232('0x11')][_0x1232('0x14')]);return _0x205e31(_0x3af804[_0x1232('0x11')][_0x1232('0x14')]);}logger[_0x1232('0x11')](_0x1232('0x13'),_0x5685d0,_0x3af804['error']['message']);return _0x2c63a3(_0x3af804[_0x1232('0x11')][_0x1232('0x14')]);}else{logger[_0x1232('0xc')](_0x1232('0x13'),_0x5685d0,'request\x20sent');_0x2c63a3(_0x3af804[_0x1232('0x15')][_0x1232('0x14')]);}})[_0x1232('0x16')](function(_0x13b39e){logger[_0x1232('0x11')](_0x1232('0x13'),_0x5685d0,_0x13b39e);_0x205e31(_0x13b39e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b16038e..1a8caea 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 _0xb209=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x2542c4,_0x2e7962){var _0x3a13f7=function(_0x5721ed){while(--_0x5721ed){_0x2542c4['push'](_0x2542c4['shift']());}};_0x3a13f7(++_0x2e7962);}(_0xb209,0x174));var _0x9b20=function(_0x1235ab,_0x2ab31c){_0x1235ab=_0x1235ab-0x0;var _0x125b56=_0xb209[_0x1235ab];return _0x125b56;};'use strict';var multer=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var path=require('path');var timeout=require(_0x9b20('0x2'));var express=require(_0x9b20('0x3'));var router=express[_0x9b20('0x4')]();var fs_extra=require(_0x9b20('0x5'));var auth=require(_0x9b20('0x6'));var interaction=require(_0x9b20('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x9b20('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9b20('0x9'),auth[_0x9b20('0xa')](),controller[_0x9b20('0xb')]);router[_0x9b20('0x8')]('/:id/configurations',auth[_0x9b20('0xa')](),controller[_0x9b20('0xc')]);router['get'](_0x9b20('0xd'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x9b20('0xa')](),controller['create']);router[_0x9b20('0xe')](_0x9b20('0xf'),auth[_0x9b20('0xa')](),controller[_0x9b20('0x10')]);router[_0x9b20('0x11')](_0x9b20('0x9'),auth[_0x9b20('0xa')](),controller[_0x9b20('0x12')]);router[_0x9b20('0x13')](_0x9b20('0x9'),auth['isAuthenticated'](),controller[_0x9b20('0x14')]);module[_0x9b20('0x15')]=router; \ No newline at end of file +var _0x543f=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x543f,0xe2));var _0xf543=function(_0x274dcd,_0x2233a2){_0x274dcd=_0x274dcd-0x0;var _0x194aca=_0x543f[_0x274dcd];return _0x194aca;};'use strict';var multer=require(_0xf543('0x0'));var util=require(_0xf543('0x1'));var path=require(_0xf543('0x2'));var timeout=require(_0xf543('0x3'));var express=require('express');var router=express[_0xf543('0x4')]();var fs_extra=require(_0xf543('0x5'));var auth=require(_0xf543('0x6'));var interaction=require(_0xf543('0x7'));var config=require(_0xf543('0x8'));var controller=require(_0xf543('0x9'));router['get']('/',auth[_0xf543('0xa')](),controller['index']);router[_0xf543('0xb')](_0xf543('0xc'),auth[_0xf543('0xa')](),controller[_0xf543('0xd')]);router['get'](_0xf543('0xe'),auth['isAuthenticated'](),controller[_0xf543('0xf')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xf543('0x10')]);router[_0xf543('0x11')]('/',auth['isAuthenticated'](),controller[_0xf543('0x12')]);router[_0xf543('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf543('0x13')]);router[_0xf543('0x14')]('/:id',auth[_0xf543('0xa')](),controller[_0xf543('0x15')]);router[_0xf543('0x16')](_0xf543('0xc'),auth[_0xf543('0xa')](),controller[_0xf543('0x17')]);module[_0xf543('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index ce5152d..00f5685 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 _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x4100f5,_0x3c859a){var _0x45771b=function(_0x4f5473){while(--_0x4f5473){_0x4100f5['push'](_0x4100f5['shift']());}};_0x45771b(++_0x3c859a);}(_0xef0f,0x168));var _0xfef0=function(_0x34abc5,_0x364e73){_0x34abc5=_0x34abc5-0x0;var _0x44ac0c=_0xef0f[_0x34abc5];return _0x44ac0c;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa30a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x31690f,_0x48683b){var _0x2d3f01=function(_0xf8e5b8){while(--_0xf8e5b8){_0x31690f['push'](_0x31690f['shift']());}};_0x2d3f01(++_0x48683b);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x3')},'apiKey':{'type':Sequelize[_0xaa30('0x2')]},'remoteUri':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x4')},'serverUrl':{'type':Sequelize[_0xaa30('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9c3ef6e..5018769 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 _0xa769=['FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','%s/%s','api/v2/ticket_fields','format','toString','base64','requester','subject','agent','description','group','ticket_type','company','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','destroy','then','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','options','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','Subjects','channel','type','getDescriptions'];(function(_0x280004,_0x5688eb){var _0x49822b=function(_0x2c6293){while(--_0x2c6293){_0x280004['push'](_0x280004['shift']());}};_0x49822b(++_0x5688eb);}(_0xa769,0xfb));var _0x9a76=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa769[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x9a76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a76('0x1'));var jsonpatch=require(_0x9a76('0x2'));var rp=require(_0x9a76('0x3'));var moment=require('moment');var BPromise=require(_0x9a76('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a76('0x5'));var sox=require(_0x9a76('0x6'));var csv=require('to-csv');var ejs=require(_0x9a76('0x7'));var fs=require('fs');var fs_extra=require(_0x9a76('0x8'));var _=require(_0x9a76('0x9'));var squel=require(_0x9a76('0xa'));var crypto=require(_0x9a76('0xb'));var jsforce=require(_0x9a76('0xc'));var deskjs=require(_0x9a76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9a76('0xe'));var Papa=require(_0x9a76('0xf'));var Redis=require(_0x9a76('0x10'));var authService=require(_0x9a76('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a76('0x12'));var logger=require('../../config/logger')(_0x9a76('0x13'));var utils=require(_0x9a76('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a76('0x15'));var db=require(_0x9a76('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x34b7c9,_0x30d1be){_0x30d1be=_0x30d1be||0xcc;return function(_0x2ee3be){if(_0x2ee3be){return _0x34b7c9[_0x9a76('0x17')](_0x30d1be);}return _0x34b7c9[_0x9a76('0x18')](_0x30d1be)[_0x9a76('0x19')]();};}function respondWithResult(_0x204e33,_0x28ebac){_0x28ebac=_0x28ebac||0xc8;return function(_0x45668c){if(_0x45668c){return _0x204e33[_0x9a76('0x18')](_0x28ebac)[_0x9a76('0x1a')](_0x45668c);}};}function respondWithFilteredResult(_0x259664,_0x1e687a){return function(_0x54028e){if(_0x54028e){var _0x2beff0=typeof _0x1e687a['offset']===_0x9a76('0x1b')&&typeof _0x1e687a[_0x9a76('0x1c')]===_0x9a76('0x1b');var _0x2617fd=_0x54028e[_0x9a76('0x1d')];var _0x2f3fdc=_0x2beff0?0x0:_0x1e687a['offset'];var _0x582d9a=_0x2beff0?_0x54028e[_0x9a76('0x1d')]:_0x1e687a[_0x9a76('0x1e')]+_0x1e687a[_0x9a76('0x1c')];var _0x18c6d7;if(_0x582d9a>=_0x2617fd){_0x582d9a=_0x2617fd;_0x18c6d7=0xc8;}else{_0x18c6d7=0xce;}_0x259664[_0x9a76('0x18')](_0x18c6d7);return _0x259664[_0x9a76('0x1f')]('Content-Range',_0x2f3fdc+'-'+_0x582d9a+'/'+_0x2617fd)[_0x9a76('0x1a')](_0x54028e);}return null;};}function patchUpdates(_0x3ebe6c){return function(_0x5530d5){try{jsonpatch[_0x9a76('0x20')](_0x5530d5,_0x3ebe6c,!![]);}catch(_0x43840c){return BPromise['reject'](_0x43840c);}return _0x5530d5[_0x9a76('0x21')]();};}function saveUpdates(_0x35b608,_0x3e978f){return function(_0x422b73){if(_0x422b73){return _0x422b73[_0x9a76('0x22')](_0x35b608)['then'](function(_0x1a4667){return _0x1a4667;});}return null;};}function removeEntity(_0x5c3afa,_0x523727){return function(_0x1e8ff7){if(_0x1e8ff7){return _0x1e8ff7[_0x9a76('0x23')]()[_0x9a76('0x24')](function(){_0x5c3afa['status'](0xcc)[_0x9a76('0x19')]();});}};}function handleEntityNotFound(_0x4d8d8d,_0x57d6d7){return function(_0x42d642){if(!_0x42d642){_0x4d8d8d['sendStatus'](0x194);}return _0x42d642;};}function handleError(_0xa848f,_0x33707a){_0x33707a=_0x33707a||0x1f4;return function(_0x1ef926){logger[_0x9a76('0x25')](_0x1ef926[_0x9a76('0x26')]);if(_0x1ef926[_0x9a76('0x27')]){delete _0x1ef926[_0x9a76('0x27')];}_0xa848f[_0x9a76('0x18')](_0x33707a)['send'](_0x1ef926);};}exports[_0x9a76('0x28')]=function(_0x49cc2f,_0xd81bb8){var _0x328458={},_0xa4585b={},_0x502345={'count':0x0,'rows':[]};var _0xa239e1=_[_0x9a76('0x29')](db[_0x9a76('0x2a')][_0x9a76('0x2b')],function(_0x266e54){return{'name':_0x266e54[_0x9a76('0x2c')],'type':_0x266e54['type'][_0x9a76('0x2d')]};});_0xa4585b[_0x9a76('0x2e')]=_[_0x9a76('0x29')](_0xa239e1,_0x9a76('0x27'));_0xa4585b['query']=_[_0x9a76('0x2f')](_0x49cc2f[_0x9a76('0x30')]);_0xa4585b[_0x9a76('0x31')]=_['intersection'](_0xa4585b[_0x9a76('0x2e')],_0xa4585b[_0x9a76('0x30')]);_0x328458[_0x9a76('0x32')]=_['intersection'](_0xa4585b[_0x9a76('0x2e')],qs[_0x9a76('0x33')](_0x49cc2f[_0x9a76('0x30')][_0x9a76('0x33')]));_0x328458[_0x9a76('0x32')]=_0x328458['attributes'][_0x9a76('0x34')]?_0x328458['attributes']:_0xa4585b[_0x9a76('0x2e')];if(!_0x49cc2f[_0x9a76('0x30')][_0x9a76('0x35')]('nolimit')){_0x328458['limit']=qs['limit'](_0x49cc2f[_0x9a76('0x30')][_0x9a76('0x1c')]);_0x328458['offset']=qs[_0x9a76('0x1e')](_0x49cc2f[_0x9a76('0x30')][_0x9a76('0x1e')]);}_0x328458[_0x9a76('0x36')]=qs[_0x9a76('0x37')](_0x49cc2f[_0x9a76('0x30')]['sort']);_0x328458[_0x9a76('0x38')]=qs['filters'](_[_0x9a76('0x39')](_0x49cc2f['query'],_0xa4585b[_0x9a76('0x31')]),_0xa239e1);if(_0x49cc2f['query'][_0x9a76('0x3a')]){_0x328458[_0x9a76('0x38')]=_[_0x9a76('0x3b')](_0x328458['where'],{'$or':_['map'](_0xa239e1,function(_0xa60451){if(_0xa60451['type']!==_0x9a76('0x3c')){var _0x257087={};_0x257087[_0xa60451[_0x9a76('0x27')]]={'$like':'%'+_0x49cc2f[_0x9a76('0x30')]['filter']+'%'};return _0x257087;}})});}_0x328458=_[_0x9a76('0x3b')]({},_0x328458,_0x49cc2f['options']);var _0x3da544={'where':_0x328458[_0x9a76('0x38')]};return db[_0x9a76('0x2a')][_0x9a76('0x1d')](_0x3da544)[_0x9a76('0x24')](function(_0x21a455){_0x502345[_0x9a76('0x1d')]=_0x21a455;if(_0x49cc2f[_0x9a76('0x30')][_0x9a76('0x3d')]){_0x328458[_0x9a76('0x3e')]=[{'all':!![]}];}return db[_0x9a76('0x2a')][_0x9a76('0x3f')](_0x328458);})['then'](function(_0x381cd7){_0x502345['rows']=_0x381cd7;return _0x502345;})['then'](respondWithFilteredResult(_0xd81bb8,_0x328458))[_0x9a76('0x40')](handleError(_0xd81bb8,null));};exports[_0x9a76('0x41')]=function(_0x56d298,_0x391265){var _0x4a32ca={'raw':![],'where':{'id':_0x56d298[_0x9a76('0x42')]['id']}},_0x59fd36={};_0x59fd36[_0x9a76('0x2e')]=_[_0x9a76('0x2f')](db[_0x9a76('0x2a')][_0x9a76('0x2b')]);_0x59fd36['query']=_[_0x9a76('0x2f')](_0x56d298[_0x9a76('0x30')]);_0x59fd36[_0x9a76('0x31')]=_[_0x9a76('0x43')](_0x59fd36[_0x9a76('0x2e')],_0x59fd36['query']);_0x4a32ca[_0x9a76('0x32')]=_[_0x9a76('0x43')](_0x59fd36[_0x9a76('0x2e')],qs[_0x9a76('0x33')](_0x56d298[_0x9a76('0x30')]['fields']));_0x4a32ca[_0x9a76('0x32')]=_0x4a32ca[_0x9a76('0x32')][_0x9a76('0x34')]?_0x4a32ca['attributes']:_0x59fd36[_0x9a76('0x2e')];if(_0x56d298[_0x9a76('0x30')][_0x9a76('0x3d')]){_0x4a32ca[_0x9a76('0x3e')]=[{'all':!![]}];}_0x4a32ca=_[_0x9a76('0x3b')]({},_0x4a32ca,_0x56d298[_0x9a76('0x44')]);return db['FreshdeskAccount'][_0x9a76('0x45')](_0x4a32ca)[_0x9a76('0x24')](handleEntityNotFound(_0x391265,null))[_0x9a76('0x24')](respondWithResult(_0x391265,null))[_0x9a76('0x40')](handleError(_0x391265,null));};exports[_0x9a76('0x46')]=function(_0x556548,_0x4970bf){return db[_0x9a76('0x2a')][_0x9a76('0x46')](_0x556548['body'],{})['then'](respondWithResult(_0x4970bf,0xc9))[_0x9a76('0x40')](handleError(_0x4970bf,null));};exports[_0x9a76('0x22')]=function(_0x17cc8f,_0x27db34){if(_0x17cc8f[_0x9a76('0x47')]['id']){delete _0x17cc8f['body']['id'];}return db[_0x9a76('0x2a')]['find']({'where':{'id':_0x17cc8f['params']['id']}})[_0x9a76('0x24')](handleEntityNotFound(_0x27db34,null))['then'](saveUpdates(_0x17cc8f['body'],null))[_0x9a76('0x24')](respondWithResult(_0x27db34,null))[_0x9a76('0x40')](handleError(_0x27db34,null));};exports['destroy']=function(_0x4170d4,_0x95d953){return db[_0x9a76('0x2a')]['find']({'where':{'id':_0x4170d4[_0x9a76('0x42')]['id']}})['then'](handleEntityNotFound(_0x95d953,null))[_0x9a76('0x24')](removeEntity(_0x95d953,null))['catch'](handleError(_0x95d953,null));};exports['getConfigurations']=function(_0x3fe2b4,_0x1792ff,_0xf78b75){var _0x5d8265={};var _0x487a93={};var _0x399fe4;var _0x3d1d86;return db[_0x9a76('0x2a')][_0x9a76('0x48')]({'where':{'id':_0x3fe2b4[_0x9a76('0x42')]['id']}})[_0x9a76('0x24')](handleEntityNotFound(_0x1792ff,null))['then'](function(_0x1cd9b2){if(_0x1cd9b2){_0x399fe4=_0x1cd9b2;_0x487a93[_0x9a76('0x2e')]=_[_0x9a76('0x2f')](db[_0x9a76('0x49')][_0x9a76('0x2b')]);_0x487a93[_0x9a76('0x30')]=_[_0x9a76('0x2f')](_0x3fe2b4['query']);_0x487a93[_0x9a76('0x31')]=_[_0x9a76('0x43')](_0x487a93[_0x9a76('0x2e')],_0x487a93['query']);_0x5d8265[_0x9a76('0x32')]=_[_0x9a76('0x43')](_0x487a93['model'],qs['fields'](_0x3fe2b4['query']['fields']));_0x5d8265[_0x9a76('0x32')]=_0x5d8265[_0x9a76('0x32')][_0x9a76('0x34')]?_0x5d8265[_0x9a76('0x32')]:_0x487a93[_0x9a76('0x2e')];_0x5d8265[_0x9a76('0x36')]=qs[_0x9a76('0x37')](_0x3fe2b4[_0x9a76('0x30')]['sort']);_0x5d8265[_0x9a76('0x38')]=qs[_0x9a76('0x31')](_[_0x9a76('0x39')](_0x3fe2b4[_0x9a76('0x30')],_0x487a93[_0x9a76('0x31')]));if(_0x3fe2b4[_0x9a76('0x30')][_0x9a76('0x3a')]){_0x5d8265[_0x9a76('0x38')]=_[_0x9a76('0x3b')](_0x5d8265[_0x9a76('0x38')],{'$or':_['map'](_0x5d8265[_0x9a76('0x32')],function(_0x39abcd){var _0xf57f7d={};_0xf57f7d[_0x39abcd]={'$like':'%'+_0x3fe2b4[_0x9a76('0x30')][_0x9a76('0x3a')]+'%'};return _0xf57f7d;})});}_0x5d8265=_['merge']({},_0x5d8265,_0x3fe2b4[_0x9a76('0x44')]);return _0x399fe4[_0x9a76('0x4a')](_0x5d8265);}})[_0x9a76('0x24')](function(_0x544308){if(_0x544308){_0x3d1d86=_0x544308[_0x9a76('0x34')];if(!_0x3fe2b4[_0x9a76('0x30')][_0x9a76('0x35')]('nolimit')){_0x5d8265[_0x9a76('0x1c')]=qs[_0x9a76('0x1c')](_0x3fe2b4[_0x9a76('0x30')][_0x9a76('0x1c')]);_0x5d8265[_0x9a76('0x1e')]=qs[_0x9a76('0x1e')](_0x3fe2b4[_0x9a76('0x30')]['offset']);}return _0x399fe4[_0x9a76('0x4a')](_0x5d8265);}})[_0x9a76('0x24')](function(_0x92af1d){if(_0x92af1d){return _0x92af1d?{'count':_0x3d1d86,'rows':_0x92af1d}:null;}})['then'](respondWithResult(_0x1792ff,null))[_0x9a76('0x40')](handleError(_0x1792ff,null));};exports['addConfiguration']=function(_0x4404b1,_0x51950d,_0x582159){if(_0x4404b1['body']['id']){delete _0x4404b1['body']['id'];}return db[_0x9a76('0x2a')][_0x9a76('0x48')]({'where':{'id':_0x4404b1[_0x9a76('0x42')]['id']}})['then'](handleEntityNotFound(_0x51950d,null))[_0x9a76('0x24')](function(_0x2d82a1){if(_0x2d82a1){_0x4404b1[_0x9a76('0x47')]['AccountId']=_0x2d82a1['id'];_0x4404b1['body'][_0x9a76('0x4b')]=integrations['getSubjects'](_0x4404b1[_0x9a76('0x47')][_0x9a76('0x4c')],_0x4404b1['body'][_0x9a76('0x4d')]);_0x4404b1['body']['Descriptions']=integrations[_0x9a76('0x4e')](_0x4404b1[_0x9a76('0x47')][_0x9a76('0x4c')],_0x4404b1[_0x9a76('0x47')][_0x9a76('0x4d')]);return db['FreshdeskConfiguration'][_0x9a76('0x46')](_0x4404b1[_0x9a76('0x47')],{'include':[{'model':db[_0x9a76('0x4f')],'as':_0x9a76('0x4b')},{'model':db[_0x9a76('0x4f')],'as':_0x9a76('0x50')}]});}return null;})[_0x9a76('0x24')](respondWithResult(_0x51950d,null))[_0x9a76('0x40')](handleError(_0x51950d,null));};exports[_0x9a76('0x51')]=function(_0x3af4b5,_0x278778,_0x511650){var _0x22b63e='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x3af4b5[_0x9a76('0x42')]['id']},'attributes':['id',_0x9a76('0x52'),_0x9a76('0x53')]})[_0x9a76('0x24')](handleEntityNotFound(_0x278778,null))[_0x9a76('0x24')](function(_0x2c55d4){if(_0x2c55d4){_0x22b63e=_0x2c55d4[_0x9a76('0x52')];var _0x2b9fe8=_0x22b63e[_0x9a76('0x54')](-0x1);if(_0x2b9fe8==='/'){_0x22b63e=_0x22b63e[_0x9a76('0x55')](0x0,_0x22b63e['lastIndexOf'](_0x2b9fe8));}return rp({'method':'GET','uri':util['format'](_0x9a76('0x56'),_0x22b63e,_0x9a76('0x57')),'headers':{'Authorization':util[_0x9a76('0x58')]('Basic\x20%s',new Buffer(util[_0x9a76('0x58')]('%s:X',_0x2c55d4[_0x9a76('0x53')]))[_0x9a76('0x59')](_0x9a76('0x5a')))},'json':!![]});}})[_0x9a76('0x24')](function(_0x5a57dd){if(_0x5a57dd){var _0x2b487e=[_0x9a76('0x5b'),_0x9a76('0x5c'),_0x9a76('0x5d'),_0x9a76('0x5e'),_0x9a76('0x18'),'priority',_0x9a76('0x5f'),'source',_0x9a76('0x60'),_0x9a76('0x5f'),_0x9a76('0x61')];_['remove'](_0x5a57dd,function(_0x7b71bd){return _0x2b487e[_0x9a76('0x62')](_0x7b71bd[_0x9a76('0x27')])||!_0x7b71bd[_0x9a76('0x63')]&&_0x7b71bd[_0x9a76('0x4d')]!=='custom_text'&&_0x7b71bd['type']!==_0x9a76('0x64');});return{'count':_0x5a57dd[_0x9a76('0x34')],'rows':_[_0x9a76('0x29')](_0x5a57dd,function(_0xfdc177){return{'id':_0xfdc177[_0x9a76('0x27')],'name':_0xfdc177[_0x9a76('0x65')],'custom':!_0xfdc177[_0x9a76('0x63')],'options':_0xfdc177[_0x9a76('0x66')]?_['map'](_0xfdc177[_0x9a76('0x66')],function(_0x1400c5){return{'name':_[_0x9a76('0x67')](_0x1400c5),'value':_0x1400c5};}):[]};})};}})['then'](respondWithResult(_0x278778,null))['catch'](function(_0x1404af){var _0x3f0789=_0x3af4b5[_0x9a76('0x30')][_0x9a76('0x68')]?0x1f4:_0x1404af[_0x9a76('0x69')]||0x1f4;logger['error'](_0x9a76('0x6a'),_0x9a76('0x51'),_0x3f0789,JSON[_0x9a76('0x6b')](_0x1404af));delete _0x1404af[_0x9a76('0x27')];if(_0x3f0789===0x191){_0x3f0789=0x190;}_0x278778[_0x9a76('0x18')](_0x3f0789)[_0x9a76('0x6c')](_0x3af4b5[_0x9a76('0x30')]['test']?{'message':_0x9a76('0x6d'),'statusCode':_0x1404af[_0x9a76('0x69')]}:_0x1404af);});}; \ No newline at end of file +var _0x608a=['includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','keys','FreshdeskConfiguration','sort','addConfiguration','Subjects','getDescriptions','FreshdeskField','remoteUri','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','apiKey','requester','subject','agent','group','source','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','error','getFields','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','FreshdeskAccount','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','pick','filter','type','merge','options'];(function(_0x4c3987,_0x46acbf){var _0x4a7411=function(_0xd656d){while(--_0xd656d){_0x4c3987['push'](_0x4c3987['shift']());}};_0x4a7411(++_0x46acbf);}(_0x608a,0xff));var _0xa608=function(_0x1a44b0,_0x38d998){_0x1a44b0=_0x1a44b0-0x0;var _0x50bfab=_0x608a[_0x1a44b0];return _0x50bfab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa608('0x0'));var zipdir=require(_0xa608('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa608('0x2'));var moment=require(_0xa608('0x3'));var BPromise=require(_0xa608('0x4'));var Mustache=require(_0xa608('0x5'));var util=require('util');var path=require(_0xa608('0x6'));var sox=require(_0xa608('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa608('0x8'));var _=require('lodash');var squel=require(_0xa608('0x9'));var crypto=require(_0xa608('0xa'));var jsforce=require(_0xa608('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa608('0xc'));var querystring=require('querystring');var Papa=require(_0xa608('0xd'));var Redis=require(_0xa608('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa608('0xf'));var as=require(_0xa608('0x10'));var hardwareService=require(_0xa608('0x11'));var logger=require(_0xa608('0x12'))('api');var utils=require(_0xa608('0x13'));var config=require(_0xa608('0x14'));var licenseUtil=require(_0xa608('0x15'));var db=require(_0xa608('0x16'))['db'];var integrations=require(_0xa608('0x17'));function respondWithStatusCode(_0x520a27,_0x2030c4){_0x2030c4=_0x2030c4||0xcc;return function(_0x32b1fd){if(_0x32b1fd){return _0x520a27['sendStatus'](_0x2030c4);}return _0x520a27['status'](_0x2030c4)[_0xa608('0x18')]();};}function respondWithResult(_0x31b33f,_0x1eb156){_0x1eb156=_0x1eb156||0xc8;return function(_0x1b223c){if(_0x1b223c){return _0x31b33f['status'](_0x1eb156)[_0xa608('0x19')](_0x1b223c);}};}function respondWithFilteredResult(_0x4564f5,_0x49d154){return function(_0xf4fcf6){if(_0xf4fcf6){var _0x2d6790=typeof _0x49d154['offset']==='undefined'&&typeof _0x49d154['limit']===_0xa608('0x1a');var _0x473003=_0xf4fcf6[_0xa608('0x1b')];var _0x1c09c4=_0x2d6790?0x0:_0x49d154['offset'];var _0x5c4167=_0x2d6790?_0xf4fcf6[_0xa608('0x1b')]:_0x49d154['offset']+_0x49d154[_0xa608('0x1c')];var _0xa98b9a;if(_0x5c4167>=_0x473003){_0x5c4167=_0x473003;_0xa98b9a=0xc8;}else{_0xa98b9a=0xce;}_0x4564f5[_0xa608('0x1d')](_0xa98b9a);return _0x4564f5[_0xa608('0x1e')](_0xa608('0x1f'),_0x1c09c4+'-'+_0x5c4167+'/'+_0x473003)[_0xa608('0x19')](_0xf4fcf6);}return null;};}function patchUpdates(_0x46cbf8){return function(_0x2fa192){try{jsonpatch[_0xa608('0x20')](_0x2fa192,_0x46cbf8,!![]);}catch(_0x272fd2){return BPromise[_0xa608('0x21')](_0x272fd2);}return _0x2fa192[_0xa608('0x22')]();};}function saveUpdates(_0xb145ca,_0x3f53fa){return function(_0x566424){if(_0x566424){return _0x566424[_0xa608('0x23')](_0xb145ca)['then'](function(_0x4f218f){return _0x4f218f;});}return null;};}function removeEntity(_0x215f00,_0x262fb3){return function(_0x239761){if(_0x239761){return _0x239761[_0xa608('0x24')]()[_0xa608('0x25')](function(){_0x215f00[_0xa608('0x1d')](0xcc)[_0xa608('0x18')]();});}};}function handleEntityNotFound(_0x22df89,_0x497107){return function(_0x491f35){if(!_0x491f35){_0x22df89[_0xa608('0x26')](0x194);}return _0x491f35;};}function handleError(_0x464270,_0x38d67b){_0x38d67b=_0x38d67b||0x1f4;return function(_0x3f74b2){logger['error'](_0x3f74b2[_0xa608('0x27')]);if(_0x3f74b2[_0xa608('0x28')]){delete _0x3f74b2[_0xa608('0x28')];}_0x464270[_0xa608('0x1d')](_0x38d67b)[_0xa608('0x29')](_0x3f74b2);};}exports['index']=function(_0x449633,_0x1d9977){var _0x529f42={},_0x2d6ca4={},_0x5a20e0={'count':0x0,'rows':[]};var _0x376d8b=_[_0xa608('0x2a')](db[_0xa608('0x2b')][_0xa608('0x2c')],function(_0x589346){return{'name':_0x589346['fieldName'],'type':_0x589346['type'][_0xa608('0x2d')]};});_0x2d6ca4[_0xa608('0x2e')]=_['map'](_0x376d8b,'name');_0x2d6ca4['query']=_['keys'](_0x449633[_0xa608('0x2f')]);_0x2d6ca4[_0xa608('0x30')]=_[_0xa608('0x31')](_0x2d6ca4[_0xa608('0x2e')],_0x2d6ca4[_0xa608('0x2f')]);_0x529f42['attributes']=_['intersection'](_0x2d6ca4[_0xa608('0x2e')],qs['fields'](_0x449633[_0xa608('0x2f')][_0xa608('0x32')]));_0x529f42['attributes']=_0x529f42[_0xa608('0x33')][_0xa608('0x34')]?_0x529f42['attributes']:_0x2d6ca4['model'];if(!_0x449633[_0xa608('0x2f')][_0xa608('0x35')](_0xa608('0x36'))){_0x529f42['limit']=qs[_0xa608('0x1c')](_0x449633[_0xa608('0x2f')][_0xa608('0x1c')]);_0x529f42[_0xa608('0x37')]=qs[_0xa608('0x37')](_0x449633['query'][_0xa608('0x37')]);}_0x529f42[_0xa608('0x38')]=qs['sort'](_0x449633[_0xa608('0x2f')]['sort']);_0x529f42[_0xa608('0x39')]=qs[_0xa608('0x30')](_[_0xa608('0x3a')](_0x449633[_0xa608('0x2f')],_0x2d6ca4[_0xa608('0x30')]),_0x376d8b);if(_0x449633[_0xa608('0x2f')][_0xa608('0x3b')]){_0x529f42['where']=_['merge'](_0x529f42['where'],{'$or':_[_0xa608('0x2a')](_0x376d8b,function(_0x2172fc){if(_0x2172fc[_0xa608('0x3c')]!=='VIRTUAL'){var _0x29de65={};_0x29de65[_0x2172fc['name']]={'$like':'%'+_0x449633['query'][_0xa608('0x3b')]+'%'};return _0x29de65;}})});}_0x529f42=_[_0xa608('0x3d')]({},_0x529f42,_0x449633[_0xa608('0x3e')]);var _0x193913={'where':_0x529f42['where']};return db[_0xa608('0x2b')][_0xa608('0x1b')](_0x193913)[_0xa608('0x25')](function(_0x384858){_0x5a20e0[_0xa608('0x1b')]=_0x384858;if(_0x449633[_0xa608('0x2f')][_0xa608('0x3f')]){_0x529f42[_0xa608('0x40')]=[{'all':!![]}];}return db[_0xa608('0x2b')][_0xa608('0x41')](_0x529f42);})[_0xa608('0x25')](function(_0x456811){_0x5a20e0[_0xa608('0x42')]=_0x456811;return _0x5a20e0;})[_0xa608('0x25')](respondWithFilteredResult(_0x1d9977,_0x529f42))['catch'](handleError(_0x1d9977,null));};exports[_0xa608('0x43')]=function(_0xaf5845,_0x449997){var _0xe1c3fb={'raw':![],'where':{'id':_0xaf5845[_0xa608('0x44')]['id']}},_0x94a453={};_0x94a453[_0xa608('0x2e')]=_['keys'](db[_0xa608('0x2b')][_0xa608('0x2c')]);_0x94a453[_0xa608('0x2f')]=_['keys'](_0xaf5845[_0xa608('0x2f')]);_0x94a453[_0xa608('0x30')]=_[_0xa608('0x31')](_0x94a453[_0xa608('0x2e')],_0x94a453['query']);_0xe1c3fb[_0xa608('0x33')]=_[_0xa608('0x31')](_0x94a453[_0xa608('0x2e')],qs[_0xa608('0x32')](_0xaf5845[_0xa608('0x2f')]['fields']));_0xe1c3fb[_0xa608('0x33')]=_0xe1c3fb[_0xa608('0x33')][_0xa608('0x34')]?_0xe1c3fb[_0xa608('0x33')]:_0x94a453[_0xa608('0x2e')];if(_0xaf5845['query'][_0xa608('0x3f')]){_0xe1c3fb[_0xa608('0x40')]=[{'all':!![]}];}_0xe1c3fb=_[_0xa608('0x3d')]({},_0xe1c3fb,_0xaf5845['options']);return db[_0xa608('0x2b')]['find'](_0xe1c3fb)[_0xa608('0x25')](handleEntityNotFound(_0x449997,null))['then'](respondWithResult(_0x449997,null))[_0xa608('0x45')](handleError(_0x449997,null));};exports[_0xa608('0x46')]=function(_0x85c01b,_0x318972){return db['FreshdeskAccount']['create'](_0x85c01b[_0xa608('0x47')],{})[_0xa608('0x25')](respondWithResult(_0x318972,0xc9))[_0xa608('0x45')](handleError(_0x318972,null));};exports['update']=function(_0x155922,_0x14b022){if(_0x155922['body']['id']){delete _0x155922[_0xa608('0x47')]['id'];}return db[_0xa608('0x2b')][_0xa608('0x48')]({'where':{'id':_0x155922['params']['id']}})[_0xa608('0x25')](handleEntityNotFound(_0x14b022,null))[_0xa608('0x25')](saveUpdates(_0x155922['body'],null))[_0xa608('0x25')](respondWithResult(_0x14b022,null))[_0xa608('0x45')](handleError(_0x14b022,null));};exports['destroy']=function(_0x486e3b,_0xd05957){return db[_0xa608('0x2b')][_0xa608('0x48')]({'where':{'id':_0x486e3b[_0xa608('0x44')]['id']}})[_0xa608('0x25')](handleEntityNotFound(_0xd05957,null))[_0xa608('0x25')](removeEntity(_0xd05957,null))[_0xa608('0x45')](handleError(_0xd05957,null));};exports[_0xa608('0x49')]=function(_0x950ce1,_0x4ce700,_0x43e076){var _0x4f672b={};var _0x40d409={};var _0x14f85a;var _0x3230ed;return db[_0xa608('0x2b')][_0xa608('0x4a')]({'where':{'id':_0x950ce1[_0xa608('0x44')]['id']}})[_0xa608('0x25')](handleEntityNotFound(_0x4ce700,null))[_0xa608('0x25')](function(_0x5d87ba){if(_0x5d87ba){_0x14f85a=_0x5d87ba;_0x40d409[_0xa608('0x2e')]=_[_0xa608('0x4b')](db[_0xa608('0x4c')][_0xa608('0x2c')]);_0x40d409[_0xa608('0x2f')]=_[_0xa608('0x4b')](_0x950ce1['query']);_0x40d409[_0xa608('0x30')]=_[_0xa608('0x31')](_0x40d409[_0xa608('0x2e')],_0x40d409[_0xa608('0x2f')]);_0x4f672b[_0xa608('0x33')]=_[_0xa608('0x31')](_0x40d409[_0xa608('0x2e')],qs[_0xa608('0x32')](_0x950ce1[_0xa608('0x2f')]['fields']));_0x4f672b[_0xa608('0x33')]=_0x4f672b[_0xa608('0x33')][_0xa608('0x34')]?_0x4f672b[_0xa608('0x33')]:_0x40d409[_0xa608('0x2e')];_0x4f672b['order']=qs[_0xa608('0x4d')](_0x950ce1['query'][_0xa608('0x4d')]);_0x4f672b[_0xa608('0x39')]=qs[_0xa608('0x30')](_[_0xa608('0x3a')](_0x950ce1[_0xa608('0x2f')],_0x40d409[_0xa608('0x30')]));if(_0x950ce1[_0xa608('0x2f')]['filter']){_0x4f672b[_0xa608('0x39')]=_[_0xa608('0x3d')](_0x4f672b[_0xa608('0x39')],{'$or':_['map'](_0x4f672b['attributes'],function(_0x24c4ef){var _0x4bb1e1={};_0x4bb1e1[_0x24c4ef]={'$like':'%'+_0x950ce1[_0xa608('0x2f')][_0xa608('0x3b')]+'%'};return _0x4bb1e1;})});}_0x4f672b=_['merge']({},_0x4f672b,_0x950ce1[_0xa608('0x3e')]);return _0x14f85a[_0xa608('0x49')](_0x4f672b);}})['then'](function(_0x1d1d3c){if(_0x1d1d3c){_0x3230ed=_0x1d1d3c[_0xa608('0x34')];if(!_0x950ce1[_0xa608('0x2f')]['hasOwnProperty']('nolimit')){_0x4f672b[_0xa608('0x1c')]=qs[_0xa608('0x1c')](_0x950ce1[_0xa608('0x2f')][_0xa608('0x1c')]);_0x4f672b[_0xa608('0x37')]=qs['offset'](_0x950ce1[_0xa608('0x2f')][_0xa608('0x37')]);}return _0x14f85a[_0xa608('0x49')](_0x4f672b);}})['then'](function(_0x281f5a){if(_0x281f5a){return _0x281f5a?{'count':_0x3230ed,'rows':_0x281f5a}:null;}})[_0xa608('0x25')](respondWithResult(_0x4ce700,null))[_0xa608('0x45')](handleError(_0x4ce700,null));};exports[_0xa608('0x4e')]=function(_0x31f43c,_0x3901da,_0x1cca6f){if(_0x31f43c[_0xa608('0x47')]['id']){delete _0x31f43c['body']['id'];}return db[_0xa608('0x2b')][_0xa608('0x4a')]({'where':{'id':_0x31f43c['params']['id']}})[_0xa608('0x25')](handleEntityNotFound(_0x3901da,null))[_0xa608('0x25')](function(_0x415ced){if(_0x415ced){_0x31f43c[_0xa608('0x47')]['AccountId']=_0x415ced['id'];_0x31f43c['body'][_0xa608('0x4f')]=integrations['getSubjects'](_0x31f43c[_0xa608('0x47')]['channel'],_0x31f43c[_0xa608('0x47')][_0xa608('0x3c')]);_0x31f43c['body']['Descriptions']=integrations[_0xa608('0x50')](_0x31f43c[_0xa608('0x47')]['channel'],_0x31f43c['body'][_0xa608('0x3c')]);return db[_0xa608('0x4c')]['create'](_0x31f43c['body'],{'include':[{'model':db[_0xa608('0x51')],'as':_0xa608('0x4f')},{'model':db[_0xa608('0x51')],'as':'Descriptions'}]});}return null;})[_0xa608('0x25')](respondWithResult(_0x3901da,null))[_0xa608('0x45')](handleError(_0x3901da,null));};exports['getFields']=function(_0x49c171,_0x28ff87,_0x195cd0){var _0x2e8971='';return db['FreshdeskAccount'][_0xa608('0x4a')]({'where':{'id':_0x49c171[_0xa608('0x44')]['id']},'attributes':['id',_0xa608('0x52'),'apiKey']})[_0xa608('0x25')](handleEntityNotFound(_0x28ff87,null))['then'](function(_0x393770){if(_0x393770){_0x2e8971=_0x393770[_0xa608('0x52')];var _0x3915d4=_0x2e8971['slice'](-0x1);if(_0x3915d4==='/'){_0x2e8971=_0x2e8971['substring'](0x0,_0x2e8971[_0xa608('0x53')](_0x3915d4));}return rp({'method':_0xa608('0x54'),'uri':util[_0xa608('0x55')]('%s/%s',_0x2e8971,_0xa608('0x56')),'headers':{'Authorization':util[_0xa608('0x55')]('Basic\x20%s',new Buffer(util['format'](_0xa608('0x57'),_0x393770[_0xa608('0x58')]))['toString']('base64'))},'json':!![]});}})['then'](function(_0x2ac1e5){if(_0x2ac1e5){var _0x4109a3=[_0xa608('0x59'),_0xa608('0x5a'),_0xa608('0x5b'),'description',_0xa608('0x1d'),'priority',_0xa608('0x5c'),_0xa608('0x5d'),'ticket_type',_0xa608('0x5c'),'company'];_[_0xa608('0x5e')](_0x2ac1e5,function(_0xf0fde9){return _0x4109a3[_0xa608('0x5f')](_0xf0fde9[_0xa608('0x28')])||!_0xf0fde9[_0xa608('0x60')]&&_0xf0fde9[_0xa608('0x3c')]!==_0xa608('0x61')&&_0xf0fde9[_0xa608('0x3c')]!==_0xa608('0x62');});return{'count':_0x2ac1e5[_0xa608('0x34')],'rows':_[_0xa608('0x2a')](_0x2ac1e5,function(_0x45f3da){return{'id':_0x45f3da[_0xa608('0x28')],'name':_0x45f3da['label'],'custom':!_0x45f3da[_0xa608('0x60')],'options':_0x45f3da[_0xa608('0x63')]?_[_0xa608('0x2a')](_0x45f3da[_0xa608('0x63')],function(_0x58fab1){return{'name':_[_0xa608('0x64')](_0x58fab1),'value':_0x58fab1};}):[]};})};}})[_0xa608('0x25')](respondWithResult(_0x28ff87,null))[_0xa608('0x45')](function(_0x4ff85a){var _0x535ce0=_0x49c171[_0xa608('0x2f')][_0xa608('0x65')]?0x1f4:_0x4ff85a[_0xa608('0x66')]||0x1f4;logger[_0xa608('0x67')]('getFields,\x20%s,\x20%s,\x20%s',_0xa608('0x68'),_0x535ce0,JSON['stringify'](_0x4ff85a));delete _0x4ff85a[_0xa608('0x28')];if(_0x535ce0===0x191){_0x535ce0=0x190;}_0x28ff87['status'](_0x535ce0)[_0xa608('0x29')](_0x49c171[_0xa608('0x2f')][_0xa608('0x65')]?{'message':_0xa608('0x69'),'statusCode':_0x4ff85a['statusCode']}:_0x4ff85a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9497753..c6390bf 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 _0x4254=['moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x16ce07,_0x402370){var _0x1eb612=function(_0x3593f3){while(--_0x3593f3){_0x16ce07['push'](_0x16ce07['shift']());}};_0x1eb612(++_0x402370);}(_0x4254,0x1d0));var _0x4425=function(_0x56db98,_0x4c956c){_0x56db98=_0x56db98-0x0;var _0x213382=_0x4254[_0x56db98];return _0x213382;};'use strict';var _=require(_0x4425('0x0'));var util=require(_0x4425('0x1'));var logger=require(_0x4425('0x2'))(_0x4425('0x3'));var moment=require(_0x4425('0x4'));var BPromise=require(_0x4425('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4425('0x6'));var rimraf=require(_0x4425('0x7'));var config=require('../../config/environment');var attributes=require(_0x4425('0x8'));var integrations=require(_0x4425('0x9'));module['exports']=function(_0x244c31,_0x5cc9df){return _0x244c31['define'](_0x4425('0xa'),attributes,{'tableName':_0x4425('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb31=['../../config/environment','exports','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xfb31,0x112));var _0x1fb3=function(_0x17449b,_0x3050a7){_0x17449b=_0x17449b-0x0;var _0x13d1d0=_0xfb31[_0x17449b];return _0x13d1d0;};'use strict';var _=require('lodash');var util=require(_0x1fb3('0x0'));var logger=require(_0x1fb3('0x1'))('api');var moment=require(_0x1fb3('0x2'));var BPromise=require('bluebird');var rp=require(_0x1fb3('0x3'));var fs=require('fs');var path=require(_0x1fb3('0x4'));var rimraf=require(_0x1fb3('0x5'));var config=require(_0x1fb3('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x1fb3('0x7')]=function(_0x28e882,_0x47ed7b){return _0x28e882['define'](_0x1fb3('0x8'),attributes,{'tableName':_0x1fb3('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 40b1f23..218dc97 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 _0xf3a8=['message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x485ad8,_0x2b40e1){var _0xf06b2=function(_0x3cdae2){while(--_0x3cdae2){_0x485ad8['push'](_0x485ad8['shift']());}};_0xf06b2(++_0x2b40e1);}(_0xf3a8,0x93));var _0x8f3a=function(_0x2b7f76,_0x3b35a9){_0x2b7f76=_0x2b7f76-0x0;var _0x36225d=_0xf3a8[_0x2b7f76];return _0x36225d;};'use strict';var _=require(_0x8f3a('0x0'));var util=require(_0x8f3a('0x1'));var moment=require(_0x8f3a('0x2'));var BPromise=require(_0x8f3a('0x3'));var rs=require(_0x8f3a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f3a('0x5'))['db'];var utils=require(_0x8f3a('0x6'));var logger=require(_0x8f3a('0x7'))(_0x8f3a('0x8'));var config=require('../../config/environment');var jayson=require(_0x8f3a('0x9'));var client=jayson[_0x8f3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e5f0,_0x3b5a2a,_0x314e36){return new BPromise(function(_0x471780,_0xcd5368){return client['request'](_0x53e5f0,_0x314e36)[_0x8f3a('0xb')](function(_0x4e5363){logger[_0x8f3a('0xc')](_0x8f3a('0xd'),_0x3b5a2a,_0x8f3a('0xe'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3b5a2a,_0x8f3a('0xe'),JSON[_0x8f3a('0xf')](_0x4e5363));if(_0x4e5363[_0x8f3a('0x10')]){if(_0x4e5363[_0x8f3a('0x10')][_0x8f3a('0x11')]===0x1f4){logger[_0x8f3a('0x10')](_0x8f3a('0xd'),_0x3b5a2a,_0x4e5363['error']['message']);return _0xcd5368(_0x4e5363[_0x8f3a('0x10')][_0x8f3a('0x12')]);}logger[_0x8f3a('0x10')](_0x8f3a('0xd'),_0x3b5a2a,_0x4e5363['error'][_0x8f3a('0x12')]);return _0x471780(_0x4e5363[_0x8f3a('0x10')][_0x8f3a('0x12')]);}else{logger[_0x8f3a('0xc')](_0x8f3a('0xd'),_0x3b5a2a,_0x8f3a('0xe'));_0x471780(_0x4e5363['result']['message']);}})[_0x8f3a('0x13')](function(_0x16bdc0){logger[_0x8f3a('0x10')](_0x8f3a('0xd'),_0x3b5a2a,_0x16bdc0);_0xcd5368(_0x16bdc0);});});}exports['GetFreshdeskAccount']=function(_0x26d2ec){var _0x21cd06=this;return new Promise(function(_0x3171ac,_0x37e5b6){return db[_0x8f3a('0x14')][_0x8f3a('0x15')]({'raw':_0x26d2ec[_0x8f3a('0x16')]?_0x26d2ec[_0x8f3a('0x16')][_0x8f3a('0x17')]===undefined?!![]:![]:!![],'where':_0x26d2ec[_0x8f3a('0x16')]?_0x26d2ec['options'][_0x8f3a('0x18')]||null:null,'attributes':_0x26d2ec[_0x8f3a('0x16')]?_0x26d2ec[_0x8f3a('0x16')][_0x8f3a('0x19')]||null:null,'limit':_0x26d2ec['options']?_0x26d2ec['options']['limit']||null:null,'include':_0x26d2ec['options']?_0x26d2ec[_0x8f3a('0x16')][_0x8f3a('0x1a')]?_[_0x8f3a('0x1b')](_0x26d2ec[_0x8f3a('0x16')][_0x8f3a('0x1a')],function(_0x28faee){return{'model':db[_0x28faee[_0x8f3a('0x1c')]],'as':_0x28faee['as'],'attributes':_0x28faee[_0x8f3a('0x19')],'include':_0x28faee[_0x8f3a('0x1a')]?_[_0x8f3a('0x1b')](_0x28faee[_0x8f3a('0x1a')],function(_0x48fbec){return{'model':db[_0x48fbec['model']],'as':_0x48fbec['as'],'attributes':_0x48fbec[_0x8f3a('0x19')],'include':_0x48fbec[_0x8f3a('0x1a')]?_[_0x8f3a('0x1b')](_0x48fbec['include'],function(_0x25c8b4){return{'model':db[_0x25c8b4['model']],'as':_0x25c8b4['as'],'attributes':_0x25c8b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f14db){logger['info'](_0x8f3a('0x1d'),_0x26d2ec);logger['debug']('GetFreshdeskAccount',_0x26d2ec,JSON[_0x8f3a('0xf')](_0x3f14db));_0x3171ac(_0x3f14db);})[_0x8f3a('0x13')](function(_0x31cced){logger[_0x8f3a('0x10')](_0x8f3a('0x1d'),_0x31cced['message'],_0x26d2ec);_0x37e5b6(_0x21cd06[_0x8f3a('0x10')](0x1f4,_0x31cced[_0x8f3a('0x12')]));});});};exports[_0x8f3a('0x1e')]=function(_0x1b3022){var _0x2a6add=this;return new Promise(function(_0x58b1cf,_0x4807bc){return db[_0x8f3a('0x14')][_0x8f3a('0x1f')]({'raw':_0x1b3022[_0x8f3a('0x16')]?_0x1b3022[_0x8f3a('0x16')][_0x8f3a('0x17')]===undefined?!![]:![]:!![],'where':_0x1b3022[_0x8f3a('0x16')]?_0x1b3022[_0x8f3a('0x16')][_0x8f3a('0x18')]||null:null,'attributes':_0x1b3022[_0x8f3a('0x16')]?_0x1b3022[_0x8f3a('0x16')][_0x8f3a('0x19')]||null:null,'include':_0x1b3022['options']?_0x1b3022[_0x8f3a('0x16')]['include']?_[_0x8f3a('0x1b')](_0x1b3022['options'][_0x8f3a('0x1a')],function(_0x1be965){return{'model':db[_0x1be965[_0x8f3a('0x1c')]],'as':_0x1be965['as'],'attributes':_0x1be965[_0x8f3a('0x19')],'include':_0x1be965[_0x8f3a('0x1a')]?_[_0x8f3a('0x1b')](_0x1be965[_0x8f3a('0x1a')],function(_0x3f6414){return{'model':db[_0x3f6414[_0x8f3a('0x1c')]],'as':_0x3f6414['as'],'attributes':_0x3f6414[_0x8f3a('0x19')],'include':_0x3f6414['include']?_[_0x8f3a('0x1b')](_0x3f6414[_0x8f3a('0x1a')],function(_0x1c5848){return{'model':db[_0x1c5848[_0x8f3a('0x1c')]],'as':_0x1c5848['as'],'attributes':_0x1c5848[_0x8f3a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8f3a('0xb')](function(_0x2cb62c){logger[_0x8f3a('0xc')](_0x8f3a('0x1e'),_0x1b3022);logger[_0x8f3a('0x20')](_0x8f3a('0x1e'),_0x1b3022,JSON['stringify'](_0x2cb62c));_0x58b1cf(_0x2cb62c);})['catch'](function(_0x3f85e8){logger['error'](_0x8f3a('0x1e'),_0x3f85e8[_0x8f3a('0x12')],_0x1b3022);_0x4807bc(_0x2a6add['error'](0x1f4,_0x3f85e8['message']));});});}; \ No newline at end of file +var _0x5861=['debug','request\x20sent','stringify','error','message','result','FreshdeskAccount','findAll','options','raw','include','model','attributes','map','info','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x5861,0x114));var _0x1586=function(_0x41bf70,_0xb6a8e8){_0x41bf70=_0x41bf70-0x0;var _0x4b0089=_0x5861[_0x41bf70];return _0x4b0089;};'use strict';var _=require('lodash');var util=require(_0x1586('0x0'));var moment=require(_0x1586('0x1'));var BPromise=require(_0x1586('0x2'));var rs=require(_0x1586('0x3'));var fs=require('fs');var Redis=require(_0x1586('0x4'));var db=require(_0x1586('0x5'))['db'];var utils=require(_0x1586('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1586('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1586('0x8')][_0x1586('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f192e,_0xca8523,_0x606af1){return new BPromise(function(_0x553920,_0x5e4f23){return client['request'](_0x2f192e,_0x606af1)[_0x1586('0xa')](function(_0x102748){logger['info'](_0x1586('0xb'),_0xca8523,'request\x20sent');logger[_0x1586('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xca8523,_0x1586('0xd'),JSON[_0x1586('0xe')](_0x102748));if(_0x102748[_0x1586('0xf')]){if(_0x102748[_0x1586('0xf')]['code']===0x1f4){logger[_0x1586('0xf')](_0x1586('0xb'),_0xca8523,_0x102748['error'][_0x1586('0x10')]);return _0x5e4f23(_0x102748[_0x1586('0xf')][_0x1586('0x10')]);}logger[_0x1586('0xf')](_0x1586('0xb'),_0xca8523,_0x102748[_0x1586('0xf')][_0x1586('0x10')]);return _0x553920(_0x102748[_0x1586('0xf')][_0x1586('0x10')]);}else{logger['info'](_0x1586('0xb'),_0xca8523,_0x1586('0xd'));_0x553920(_0x102748[_0x1586('0x11')]['message']);}})['catch'](function(_0x373d79){logger[_0x1586('0xf')](_0x1586('0xb'),_0xca8523,_0x373d79);_0x5e4f23(_0x373d79);});});}exports['GetFreshdeskAccount']=function(_0x1ca38d){var _0x2f3b6c=this;return new Promise(function(_0x17a8af,_0x20f821){return db[_0x1586('0x12')][_0x1586('0x13')]({'raw':_0x1ca38d[_0x1586('0x14')]?_0x1ca38d['options'][_0x1586('0x15')]===undefined?!![]:![]:!![],'where':_0x1ca38d[_0x1586('0x14')]?_0x1ca38d[_0x1586('0x14')]['where']||null:null,'attributes':_0x1ca38d[_0x1586('0x14')]?_0x1ca38d[_0x1586('0x14')]['attributes']||null:null,'limit':_0x1ca38d[_0x1586('0x14')]?_0x1ca38d[_0x1586('0x14')]['limit']||null:null,'include':_0x1ca38d[_0x1586('0x14')]?_0x1ca38d[_0x1586('0x14')][_0x1586('0x16')]?_['map'](_0x1ca38d['options']['include'],function(_0x1ed348){return{'model':db[_0x1ed348[_0x1586('0x17')]],'as':_0x1ed348['as'],'attributes':_0x1ed348[_0x1586('0x18')],'include':_0x1ed348[_0x1586('0x16')]?_[_0x1586('0x19')](_0x1ed348['include'],function(_0x1fa385){return{'model':db[_0x1fa385[_0x1586('0x17')]],'as':_0x1fa385['as'],'attributes':_0x1fa385[_0x1586('0x18')],'include':_0x1fa385['include']?_['map'](_0x1fa385['include'],function(_0x4ab482){return{'model':db[_0x4ab482[_0x1586('0x17')]],'as':_0x4ab482['as'],'attributes':_0x4ab482[_0x1586('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb39cc7){logger[_0x1586('0x1a')](_0x1586('0x1b'),_0x1ca38d);logger[_0x1586('0xc')](_0x1586('0x1b'),_0x1ca38d,JSON[_0x1586('0xe')](_0xb39cc7));_0x17a8af(_0xb39cc7);})[_0x1586('0x1c')](function(_0x2ddd74){logger[_0x1586('0xf')](_0x1586('0x1b'),_0x2ddd74[_0x1586('0x10')],_0x1ca38d);_0x20f821(_0x2f3b6c[_0x1586('0xf')](0x1f4,_0x2ddd74['message']));});});};exports[_0x1586('0x1d')]=function(_0x3eda44){var _0x174cba=this;return new Promise(function(_0x5827d7,_0x5d7106){return db[_0x1586('0x12')][_0x1586('0x1e')]({'raw':_0x3eda44[_0x1586('0x14')]?_0x3eda44['options'][_0x1586('0x15')]===undefined?!![]:![]:!![],'where':_0x3eda44['options']?_0x3eda44['options'][_0x1586('0x1f')]||null:null,'attributes':_0x3eda44['options']?_0x3eda44[_0x1586('0x14')]['attributes']||null:null,'include':_0x3eda44[_0x1586('0x14')]?_0x3eda44[_0x1586('0x14')][_0x1586('0x16')]?_[_0x1586('0x19')](_0x3eda44[_0x1586('0x14')]['include'],function(_0x5459fd){return{'model':db[_0x5459fd[_0x1586('0x17')]],'as':_0x5459fd['as'],'attributes':_0x5459fd['attributes'],'include':_0x5459fd[_0x1586('0x16')]?_[_0x1586('0x19')](_0x5459fd[_0x1586('0x16')],function(_0x3e3147){return{'model':db[_0x3e3147['model']],'as':_0x3e3147['as'],'attributes':_0x3e3147[_0x1586('0x18')],'include':_0x3e3147['include']?_[_0x1586('0x19')](_0x3e3147[_0x1586('0x16')],function(_0x44df02){return{'model':db[_0x44df02[_0x1586('0x17')]],'as':_0x44df02['as'],'attributes':_0x44df02[_0x1586('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1586('0xa')](function(_0xc4bba0){logger[_0x1586('0x1a')](_0x1586('0x1d'),_0x3eda44);logger[_0x1586('0xc')](_0x1586('0x1d'),_0x3eda44,JSON[_0x1586('0xe')](_0xc4bba0));_0x5827d7(_0xc4bba0);})[_0x1586('0x1c')](function(_0x4a8b34){logger[_0x1586('0xf')](_0x1586('0x1d'),_0x4a8b34[_0x1586('0x10')],_0x3eda44);_0x5d7106(_0x174cba[_0x1586('0xf')](0x1f4,_0x4a8b34[_0x1586('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 01271f3..2d2ec25 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 _0xa1ae=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','destroy','exports'];(function(_0x2fffb0,_0x4c6fdb){var _0x5ad0ce=function(_0x2c27b6){while(--_0x2c27b6){_0x2fffb0['push'](_0x2fffb0['shift']());}};_0x5ad0ce(++_0x4c6fdb);}(_0xa1ae,0x113));var _0xea1a=function(_0x3cec22,_0x2ffd4b){_0x3cec22=_0x3cec22-0x0;var _0x179623=_0xa1ae[_0x3cec22];return _0x179623;};'use strict';var multer=require(_0xea1a('0x0'));var util=require('util');var path=require(_0xea1a('0x1'));var timeout=require(_0xea1a('0x2'));var express=require('express');var router=express[_0xea1a('0x3')]();var fs_extra=require(_0xea1a('0x4'));var auth=require(_0xea1a('0x5'));var interaction=require(_0xea1a('0x6'));var config=require(_0xea1a('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xea1a('0x8')]('/',auth[_0xea1a('0x9')](),controller[_0xea1a('0xa')]);router['get'](_0xea1a('0xb'),auth[_0xea1a('0x9')](),controller[_0xea1a('0xc')]);router[_0xea1a('0x8')]('/:id/fields',auth[_0xea1a('0x9')](),controller[_0xea1a('0xd')]);router[_0xea1a('0x8')](_0xea1a('0xe'),auth[_0xea1a('0x9')](),controller['getSubjects']);router['get'](_0xea1a('0xf'),auth[_0xea1a('0x9')](),controller[_0xea1a('0x10')]);router[_0xea1a('0x8')](_0xea1a('0x11'),auth[_0xea1a('0x9')](),controller[_0xea1a('0x12')]);router[_0xea1a('0x13')]('/',auth[_0xea1a('0x9')](),controller[_0xea1a('0x14')]);router[_0xea1a('0x13')]('/:id/tags',auth[_0xea1a('0x9')](),controller[_0xea1a('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xea1a('0x16')]);router['delete'](_0xea1a('0xb'),auth['isAuthenticated'](),controller[_0xea1a('0x17')]);module[_0xea1a('0x18')]=router; \ No newline at end of file +var _0x7e92=['getSubjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields'];(function(_0x562b39,_0x508024){var _0x4204de=function(_0x423f38){while(--_0x423f38){_0x562b39['push'](_0x562b39['shift']());}};_0x4204de(++_0x508024);}(_0x7e92,0x10f));var _0x27e9=function(_0x4813d5,_0x399520){_0x4813d5=_0x4813d5-0x0;var _0x47f743=_0x7e92[_0x4813d5];return _0x47f743;};'use strict';var multer=require(_0x27e9('0x0'));var util=require(_0x27e9('0x1'));var path=require('path');var timeout=require(_0x27e9('0x2'));var express=require(_0x27e9('0x3'));var router=express['Router']();var fs_extra=require(_0x27e9('0x4'));var auth=require(_0x27e9('0x5'));var interaction=require(_0x27e9('0x6'));var config=require(_0x27e9('0x7'));var controller=require(_0x27e9('0x8'));router[_0x27e9('0x9')]('/',auth['isAuthenticated'](),controller[_0x27e9('0xa')]);router['get']('/:id',auth[_0x27e9('0xb')](),controller[_0x27e9('0xc')]);router[_0x27e9('0x9')](_0x27e9('0xd'),auth[_0x27e9('0xb')](),controller[_0x27e9('0xe')]);router[_0x27e9('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x27e9('0xf')]);router['get'](_0x27e9('0x10'),auth['isAuthenticated'](),controller[_0x27e9('0x11')]);router[_0x27e9('0x9')]('/:id/tags',auth[_0x27e9('0xb')](),controller['getTags']);router['post']('/',auth[_0x27e9('0xb')](),controller[_0x27e9('0x12')]);router[_0x27e9('0x13')](_0x27e9('0x14'),auth[_0x27e9('0xb')](),controller[_0x27e9('0x15')]);router['put'](_0x27e9('0x16'),auth[_0x27e9('0xb')](),controller[_0x27e9('0x17')]);router['delete'](_0x27e9('0x16'),auth[_0x27e9('0xb')](),controller[_0x27e9('0x18')]);module[_0x27e9('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index f399536..db39bf5 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 _0x8548=['STRING','sequelize','exports'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x8548,0x1de));var _0x8854=function(_0x32b781,_0x46c4bc){_0x32b781=_0x32b781-0x0;var _0xdcc973=_0x8548[_0x32b781];return _0xdcc973;};'use strict';var Sequelize=require(_0x8854('0x0'));module[_0x8854('0x1')]={'name':{'type':Sequelize[_0x8854('0x2')]},'description':{'type':Sequelize[_0x8854('0x2')]}}; \ No newline at end of file +var _0xd83e=['sequelize','STRING'];(function(_0x4054e2,_0x31572a){var _0x54ebdf=function(_0x2d79b1){while(--_0x2d79b1){_0x4054e2['push'](_0x4054e2['shift']());}};_0x54ebdf(++_0x31572a);}(_0xd83e,0x13a));var _0xed83=function(_0x1ec2c0,_0x3d94d3){_0x1ec2c0=_0x1ec2c0-0x0;var _0x2642f3=_0xd83e[_0x1ec2c0];return _0x2642f3;};'use strict';var Sequelize=require(_0xed83('0x0'));module['exports']={'name':{'type':Sequelize[_0xed83('0x1')]},'description':{'type':Sequelize[_0xed83('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 26dcf7c..7e228c3 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 _0xc3b6=['name','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','getFields','findOne','order','nolimit','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','send','index','map','fieldName','type'];(function(_0x833d9b,_0x19a5d6){var _0x2cc2a4=function(_0x206446){while(--_0x206446){_0x833d9b['push'](_0x833d9b['shift']());}};_0x2cc2a4(++_0x19a5d6);}(_0xc3b6,0x16d));var _0x6c3b=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xc3b6[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0x6c3b('0x0'));var rimraf=require(_0x6c3b('0x1'));var zipdir=require(_0x6c3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c3b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c3b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6c3b('0x5'));var csv=require(_0x6c3b('0x6'));var ejs=require(_0x6c3b('0x7'));var fs=require('fs');var fs_extra=require(_0x6c3b('0x8'));var _=require(_0x6c3b('0x9'));var squel=require(_0x6c3b('0xa'));var crypto=require(_0x6c3b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c3b('0x6'));var querystring=require('querystring');var Papa=require(_0x6c3b('0xc'));var Redis=require(_0x6c3b('0xd'));var authService=require(_0x6c3b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6c3b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6c3b('0x10'));var config=require(_0x6c3b('0x11'));var licenseUtil=require(_0x6c3b('0x12'));var db=require(_0x6c3b('0x13'))['db'];function respondWithStatusCode(_0x366438,_0x4840b4){_0x4840b4=_0x4840b4||0xcc;return function(_0x459839){if(_0x459839){return _0x366438[_0x6c3b('0x14')](_0x4840b4);}return _0x366438[_0x6c3b('0x15')](_0x4840b4)[_0x6c3b('0x16')]();};}function respondWithResult(_0x22737f,_0x3aacad){_0x3aacad=_0x3aacad||0xc8;return function(_0x5a0e08){if(_0x5a0e08){return _0x22737f[_0x6c3b('0x15')](_0x3aacad)[_0x6c3b('0x17')](_0x5a0e08);}};}function respondWithFilteredResult(_0x32002b,_0x122863){return function(_0x4e8044){if(_0x4e8044){var _0x73e3fb=typeof _0x122863[_0x6c3b('0x18')]===_0x6c3b('0x19')&&typeof _0x122863[_0x6c3b('0x1a')]===_0x6c3b('0x19');var _0x449aec=_0x4e8044[_0x6c3b('0x1b')];var _0x188d92=_0x73e3fb?0x0:_0x122863[_0x6c3b('0x18')];var _0x1bca4e=_0x73e3fb?_0x4e8044[_0x6c3b('0x1b')]:_0x122863[_0x6c3b('0x18')]+_0x122863[_0x6c3b('0x1a')];var _0x1252df;if(_0x1bca4e>=_0x449aec){_0x1bca4e=_0x449aec;_0x1252df=0xc8;}else{_0x1252df=0xce;}_0x32002b[_0x6c3b('0x15')](_0x1252df);return _0x32002b['set'](_0x6c3b('0x1c'),_0x188d92+'-'+_0x1bca4e+'/'+_0x449aec)['json'](_0x4e8044);}return null;};}function patchUpdates(_0x44eea1){return function(_0x543595){try{jsonpatch[_0x6c3b('0x1d')](_0x543595,_0x44eea1,!![]);}catch(_0x54854d){return BPromise['reject'](_0x54854d);}return _0x543595[_0x6c3b('0x1e')]();};}function saveUpdates(_0xf6d842,_0x342c41){return function(_0x49667b){if(_0x49667b){return _0x49667b['update'](_0xf6d842)[_0x6c3b('0x1f')](function(_0x111a26){return _0x111a26;});}return null;};}function removeEntity(_0x4f2e2f,_0x4a04d4){return function(_0x362aa2){if(_0x362aa2){return _0x362aa2[_0x6c3b('0x20')]()[_0x6c3b('0x1f')](function(){_0x4f2e2f[_0x6c3b('0x15')](0xcc)[_0x6c3b('0x16')]();});}};}function handleEntityNotFound(_0x38fa3e,_0x3b658f){return function(_0x4695d2){if(!_0x4695d2){_0x38fa3e[_0x6c3b('0x14')](0x194);}return _0x4695d2;};}function handleError(_0x13b832,_0x5b1d95){_0x5b1d95=_0x5b1d95||0x1f4;return function(_0x3eee1f){logger[_0x6c3b('0x21')](_0x3eee1f[_0x6c3b('0x22')]);if(_0x3eee1f['name']){delete _0x3eee1f['name'];}_0x13b832[_0x6c3b('0x15')](_0x5b1d95)[_0x6c3b('0x23')](_0x3eee1f);};}exports[_0x6c3b('0x24')]=function(_0x50c141,_0x25cbe4){var _0x5d1768={},_0x3b49e7={},_0x224efe={'count':0x0,'rows':[]};var _0x416463=_[_0x6c3b('0x25')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x445454){return{'name':_0x445454[_0x6c3b('0x26')],'type':_0x445454[_0x6c3b('0x27')]['key']};});_0x3b49e7['model']=_['map'](_0x416463,_0x6c3b('0x28'));_0x3b49e7['query']=_[_0x6c3b('0x29')](_0x50c141['query']);_0x3b49e7[_0x6c3b('0x2a')]=_[_0x6c3b('0x2b')](_0x3b49e7[_0x6c3b('0x2c')],_0x3b49e7['query']);_0x5d1768[_0x6c3b('0x2d')]=_['intersection'](_0x3b49e7[_0x6c3b('0x2c')],qs[_0x6c3b('0x2e')](_0x50c141[_0x6c3b('0x2f')]['fields']));_0x5d1768[_0x6c3b('0x2d')]=_0x5d1768[_0x6c3b('0x2d')][_0x6c3b('0x30')]?_0x5d1768['attributes']:_0x3b49e7[_0x6c3b('0x2c')];if(!_0x50c141[_0x6c3b('0x2f')][_0x6c3b('0x31')]('nolimit')){_0x5d1768['limit']=qs['limit'](_0x50c141[_0x6c3b('0x2f')][_0x6c3b('0x1a')]);_0x5d1768[_0x6c3b('0x18')]=qs[_0x6c3b('0x18')](_0x50c141[_0x6c3b('0x2f')]['offset']);}_0x5d1768['order']=qs[_0x6c3b('0x32')](_0x50c141['query'][_0x6c3b('0x32')]);_0x5d1768[_0x6c3b('0x33')]=qs['filters'](_[_0x6c3b('0x34')](_0x50c141[_0x6c3b('0x2f')],_0x3b49e7[_0x6c3b('0x2a')]),_0x416463);if(_0x50c141['query'][_0x6c3b('0x35')]){_0x5d1768[_0x6c3b('0x33')]=_[_0x6c3b('0x36')](_0x5d1768['where'],{'$or':_[_0x6c3b('0x25')](_0x416463,function(_0x54ae39){if(_0x54ae39[_0x6c3b('0x27')]!==_0x6c3b('0x37')){var _0x4a5195={};_0x4a5195[_0x54ae39[_0x6c3b('0x28')]]={'$like':'%'+_0x50c141[_0x6c3b('0x2f')][_0x6c3b('0x35')]+'%'};return _0x4a5195;}})});}_0x5d1768=_[_0x6c3b('0x36')]({},_0x5d1768,_0x50c141[_0x6c3b('0x38')]);var _0x83890={'where':_0x5d1768[_0x6c3b('0x33')]};return db[_0x6c3b('0x39')][_0x6c3b('0x1b')](_0x83890)[_0x6c3b('0x1f')](function(_0x4f8699){_0x224efe['count']=_0x4f8699;if(_0x50c141['query'][_0x6c3b('0x3a')]){_0x5d1768[_0x6c3b('0x3b')]=[{'all':!![]}];}return db[_0x6c3b('0x39')][_0x6c3b('0x3c')](_0x5d1768);})[_0x6c3b('0x1f')](function(_0xc4401a){_0x224efe[_0x6c3b('0x3d')]=_0xc4401a;return _0x224efe;})[_0x6c3b('0x1f')](respondWithFilteredResult(_0x25cbe4,_0x5d1768))['catch'](handleError(_0x25cbe4,null));};exports[_0x6c3b('0x3e')]=function(_0x596f90,_0x475a93){var _0x392037={'raw':![],'where':{'id':_0x596f90[_0x6c3b('0x3f')]['id']}},_0x2b86e8={};_0x2b86e8[_0x6c3b('0x2c')]=_[_0x6c3b('0x29')](db[_0x6c3b('0x39')][_0x6c3b('0x40')]);_0x2b86e8['query']=_[_0x6c3b('0x29')](_0x596f90[_0x6c3b('0x2f')]);_0x2b86e8['filters']=_[_0x6c3b('0x2b')](_0x2b86e8[_0x6c3b('0x2c')],_0x2b86e8[_0x6c3b('0x2f')]);_0x392037['attributes']=_['intersection'](_0x2b86e8[_0x6c3b('0x2c')],qs[_0x6c3b('0x2e')](_0x596f90[_0x6c3b('0x2f')]['fields']));_0x392037[_0x6c3b('0x2d')]=_0x392037['attributes'][_0x6c3b('0x30')]?_0x392037[_0x6c3b('0x2d')]:_0x2b86e8['model'];if(_0x596f90['query'][_0x6c3b('0x3a')]){_0x392037[_0x6c3b('0x3b')]=[{'all':!![]}];}_0x392037=_[_0x6c3b('0x36')]({},_0x392037,_0x596f90[_0x6c3b('0x38')]);return db[_0x6c3b('0x39')]['find'](_0x392037)[_0x6c3b('0x1f')](handleEntityNotFound(_0x475a93,null))[_0x6c3b('0x1f')](respondWithResult(_0x475a93,null))[_0x6c3b('0x41')](handleError(_0x475a93,null));};exports[_0x6c3b('0x42')]=function(_0x4f33c4,_0x1ccf3a){return db[_0x6c3b('0x39')][_0x6c3b('0x42')](_0x4f33c4[_0x6c3b('0x43')],{})[_0x6c3b('0x1f')](respondWithResult(_0x1ccf3a,0xc9))[_0x6c3b('0x41')](handleError(_0x1ccf3a,null));};exports[_0x6c3b('0x44')]=function(_0x2f863e,_0x1bba6e){if(_0x2f863e[_0x6c3b('0x43')]['id']){delete _0x2f863e[_0x6c3b('0x43')]['id'];}return db['FreshdeskConfiguration'][_0x6c3b('0x45')]({'where':{'id':_0x2f863e[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0x1bba6e,null))['then'](saveUpdates(_0x2f863e[_0x6c3b('0x43')],null))[_0x6c3b('0x1f')](respondWithResult(_0x1bba6e,null))[_0x6c3b('0x41')](handleError(_0x1bba6e,null));};exports[_0x6c3b('0x20')]=function(_0x3fb91a,_0xc17d68){return db[_0x6c3b('0x39')][_0x6c3b('0x45')]({'where':{'id':_0x3fb91a[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0xc17d68,null))[_0x6c3b('0x1f')](removeEntity(_0xc17d68,null))[_0x6c3b('0x41')](handleError(_0xc17d68,null));};exports[_0x6c3b('0x46')]=function(_0x240984,_0x299574,_0x3df5c9){var _0x25c395={};var _0x1aec33={};var _0x304305;var _0x5665e5;return db[_0x6c3b('0x39')][_0x6c3b('0x47')]({'where':{'id':_0x240984[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0x299574,null))[_0x6c3b('0x1f')](function(_0x597eb0){if(_0x597eb0){_0x304305=_0x597eb0;_0x1aec33[_0x6c3b('0x2c')]=_[_0x6c3b('0x29')](db['FreshdeskField'][_0x6c3b('0x40')]);_0x1aec33[_0x6c3b('0x2f')]=_[_0x6c3b('0x29')](_0x240984[_0x6c3b('0x2f')]);_0x1aec33[_0x6c3b('0x2a')]=_[_0x6c3b('0x2b')](_0x1aec33[_0x6c3b('0x2c')],_0x1aec33[_0x6c3b('0x2f')]);_0x25c395[_0x6c3b('0x2d')]=_['intersection'](_0x1aec33['model'],qs[_0x6c3b('0x2e')](_0x240984[_0x6c3b('0x2f')][_0x6c3b('0x2e')]));_0x25c395[_0x6c3b('0x2d')]=_0x25c395['attributes'][_0x6c3b('0x30')]?_0x25c395[_0x6c3b('0x2d')]:_0x1aec33[_0x6c3b('0x2c')];_0x25c395[_0x6c3b('0x48')]=qs[_0x6c3b('0x32')](_0x240984['query']['sort']);_0x25c395[_0x6c3b('0x33')]=qs[_0x6c3b('0x2a')](_[_0x6c3b('0x34')](_0x240984['query'],_0x1aec33[_0x6c3b('0x2a')]));if(_0x240984[_0x6c3b('0x2f')][_0x6c3b('0x35')]){_0x25c395[_0x6c3b('0x33')]=_['merge'](_0x25c395[_0x6c3b('0x33')],{'$or':_[_0x6c3b('0x25')](_0x25c395[_0x6c3b('0x2d')],function(_0x498cd0){var _0x405977={};_0x405977[_0x498cd0]={'$like':'%'+_0x240984[_0x6c3b('0x2f')][_0x6c3b('0x35')]+'%'};return _0x405977;})});}_0x25c395=_[_0x6c3b('0x36')]({},_0x25c395,_0x240984[_0x6c3b('0x38')]);return _0x304305['getFields'](_0x25c395);}})[_0x6c3b('0x1f')](function(_0x13ce02){if(_0x13ce02){_0x5665e5=_0x13ce02['length'];if(!_0x240984[_0x6c3b('0x2f')][_0x6c3b('0x31')](_0x6c3b('0x49'))){_0x25c395[_0x6c3b('0x1a')]=qs[_0x6c3b('0x1a')](_0x240984['query'][_0x6c3b('0x1a')]);_0x25c395[_0x6c3b('0x18')]=qs[_0x6c3b('0x18')](_0x240984[_0x6c3b('0x2f')][_0x6c3b('0x18')]);}return _0x304305[_0x6c3b('0x46')](_0x25c395);}})[_0x6c3b('0x1f')](function(_0x43648e){if(_0x43648e){return _0x43648e?{'count':_0x5665e5,'rows':_0x43648e}:null;}})[_0x6c3b('0x1f')](respondWithResult(_0x299574,null))[_0x6c3b('0x41')](handleError(_0x299574,null));};exports['getSubjects']=function(_0xb2abf6,_0x2cf8e1,_0x129b6a){var _0xb9b8c6={};var _0x158571={};var _0x4f166c;var _0x3ba80a;return db[_0x6c3b('0x39')][_0x6c3b('0x47')]({'where':{'id':_0xb2abf6[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0x2cf8e1,null))[_0x6c3b('0x1f')](function(_0x563f27){if(_0x563f27){_0x4f166c=_0x563f27;_0x158571[_0x6c3b('0x2c')]=_[_0x6c3b('0x29')](db[_0x6c3b('0x4a')][_0x6c3b('0x40')]);_0x158571[_0x6c3b('0x2f')]=_[_0x6c3b('0x29')](_0xb2abf6[_0x6c3b('0x2f')]);_0x158571[_0x6c3b('0x2a')]=_[_0x6c3b('0x2b')](_0x158571['model'],_0x158571[_0x6c3b('0x2f')]);_0xb9b8c6[_0x6c3b('0x2d')]=_['intersection'](_0x158571[_0x6c3b('0x2c')],qs[_0x6c3b('0x2e')](_0xb2abf6[_0x6c3b('0x2f')]['fields']));_0xb9b8c6[_0x6c3b('0x2d')]=_0xb9b8c6[_0x6c3b('0x2d')]['length']?_0xb9b8c6[_0x6c3b('0x2d')]:_0x158571['model'];_0xb9b8c6[_0x6c3b('0x48')]=qs['sort'](_0xb2abf6[_0x6c3b('0x2f')][_0x6c3b('0x32')]);_0xb9b8c6['where']=qs[_0x6c3b('0x2a')](_[_0x6c3b('0x34')](_0xb2abf6[_0x6c3b('0x2f')],_0x158571[_0x6c3b('0x2a')]));if(_0xb2abf6['query'][_0x6c3b('0x35')]){_0xb9b8c6[_0x6c3b('0x33')]=_['merge'](_0xb9b8c6[_0x6c3b('0x33')],{'$or':_[_0x6c3b('0x25')](_0xb9b8c6[_0x6c3b('0x2d')],function(_0x344a14){var _0x4d5ed5={};_0x4d5ed5[_0x344a14]={'$like':'%'+_0xb2abf6['query'][_0x6c3b('0x35')]+'%'};return _0x4d5ed5;})});}_0xb9b8c6=_[_0x6c3b('0x36')]({},_0xb9b8c6,_0xb2abf6[_0x6c3b('0x38')]);return _0x4f166c['getSubjects'](_0xb9b8c6);}})['then'](function(_0x2a4941){if(_0x2a4941){_0x3ba80a=_0x2a4941['length'];if(!_0xb2abf6[_0x6c3b('0x2f')][_0x6c3b('0x31')](_0x6c3b('0x49'))){_0xb9b8c6[_0x6c3b('0x1a')]=qs[_0x6c3b('0x1a')](_0xb2abf6['query'][_0x6c3b('0x1a')]);_0xb9b8c6[_0x6c3b('0x18')]=qs['offset'](_0xb2abf6[_0x6c3b('0x2f')][_0x6c3b('0x18')]);}return _0x4f166c[_0x6c3b('0x4b')](_0xb9b8c6);}})['then'](function(_0xb90b68){if(_0xb90b68){return _0xb90b68?{'count':_0x3ba80a,'rows':_0xb90b68}:null;}})['then'](respondWithResult(_0x2cf8e1,null))[_0x6c3b('0x41')](handleError(_0x2cf8e1,null));};exports[_0x6c3b('0x4c')]=function(_0x2d4e10,_0x574390,_0x49b35f){var _0x6313f0={};var _0x59bf31={};var _0x4a5701;var _0x5e5620;return db[_0x6c3b('0x39')][_0x6c3b('0x47')]({'where':{'id':_0x2d4e10[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0x574390,null))[_0x6c3b('0x1f')](function(_0x13732a){if(_0x13732a){_0x4a5701=_0x13732a;_0x59bf31[_0x6c3b('0x2c')]=_[_0x6c3b('0x29')](db[_0x6c3b('0x4a')][_0x6c3b('0x40')]);_0x59bf31[_0x6c3b('0x2f')]=_[_0x6c3b('0x29')](_0x2d4e10['query']);_0x59bf31[_0x6c3b('0x2a')]=_['intersection'](_0x59bf31['model'],_0x59bf31[_0x6c3b('0x2f')]);_0x6313f0[_0x6c3b('0x2d')]=_['intersection'](_0x59bf31[_0x6c3b('0x2c')],qs[_0x6c3b('0x2e')](_0x2d4e10['query'][_0x6c3b('0x2e')]));_0x6313f0[_0x6c3b('0x2d')]=_0x6313f0['attributes']['length']?_0x6313f0[_0x6c3b('0x2d')]:_0x59bf31[_0x6c3b('0x2c')];_0x6313f0['order']=qs['sort'](_0x2d4e10[_0x6c3b('0x2f')]['sort']);_0x6313f0[_0x6c3b('0x33')]=qs['filters'](_[_0x6c3b('0x34')](_0x2d4e10[_0x6c3b('0x2f')],_0x59bf31[_0x6c3b('0x2a')]));if(_0x2d4e10[_0x6c3b('0x2f')][_0x6c3b('0x35')]){_0x6313f0['where']=_[_0x6c3b('0x36')](_0x6313f0[_0x6c3b('0x33')],{'$or':_[_0x6c3b('0x25')](_0x6313f0['attributes'],function(_0x14dcba){var _0x410fb9={};_0x410fb9[_0x14dcba]={'$like':'%'+_0x2d4e10['query'][_0x6c3b('0x35')]+'%'};return _0x410fb9;})});}_0x6313f0=_[_0x6c3b('0x36')]({},_0x6313f0,_0x2d4e10[_0x6c3b('0x38')]);return _0x4a5701['getDescriptions'](_0x6313f0);}})[_0x6c3b('0x1f')](function(_0x15afc6){if(_0x15afc6){_0x5e5620=_0x15afc6[_0x6c3b('0x30')];if(!_0x2d4e10[_0x6c3b('0x2f')][_0x6c3b('0x31')](_0x6c3b('0x49'))){_0x6313f0[_0x6c3b('0x1a')]=qs['limit'](_0x2d4e10[_0x6c3b('0x2f')][_0x6c3b('0x1a')]);_0x6313f0[_0x6c3b('0x18')]=qs[_0x6c3b('0x18')](_0x2d4e10[_0x6c3b('0x2f')][_0x6c3b('0x18')]);}return _0x4a5701['getDescriptions'](_0x6313f0);}})[_0x6c3b('0x1f')](function(_0x501d78){if(_0x501d78){return _0x501d78?{'count':_0x5e5620,'rows':_0x501d78}:null;}})[_0x6c3b('0x1f')](respondWithResult(_0x574390,null))[_0x6c3b('0x41')](handleError(_0x574390,null));};exports['getTags']=function(_0x96e5f7,_0x40771e,_0xad9920){var _0xd8f583={};var _0x57fd99={};var _0x84225d;var _0x319685;return db['FreshdeskConfiguration'][_0x6c3b('0x47')]({'where':{'id':_0x96e5f7[_0x6c3b('0x3f')]['id']}})[_0x6c3b('0x1f')](handleEntityNotFound(_0x40771e,null))[_0x6c3b('0x1f')](function(_0x2216b3){if(_0x2216b3){_0x84225d=_0x2216b3;_0x57fd99[_0x6c3b('0x2c')]=_[_0x6c3b('0x29')](db[_0x6c3b('0x4d')][_0x6c3b('0x40')]);_0x57fd99['query']=_[_0x6c3b('0x29')](_0x96e5f7[_0x6c3b('0x2f')]);_0x57fd99[_0x6c3b('0x2a')]=_[_0x6c3b('0x2b')](_0x57fd99[_0x6c3b('0x2c')],_0x57fd99[_0x6c3b('0x2f')]);_0xd8f583['attributes']=_[_0x6c3b('0x2b')](_0x57fd99[_0x6c3b('0x2c')],qs[_0x6c3b('0x2e')](_0x96e5f7[_0x6c3b('0x2f')][_0x6c3b('0x2e')]));_0xd8f583[_0x6c3b('0x2d')]=_0xd8f583['attributes'][_0x6c3b('0x30')]?_0xd8f583['attributes']:_0x57fd99[_0x6c3b('0x2c')];_0xd8f583['order']=qs[_0x6c3b('0x32')](_0x96e5f7[_0x6c3b('0x2f')]['sort']);_0xd8f583['where']=qs[_0x6c3b('0x2a')](_[_0x6c3b('0x34')](_0x96e5f7['query'],_0x57fd99[_0x6c3b('0x2a')]));if(_0x96e5f7[_0x6c3b('0x2f')][_0x6c3b('0x35')]){_0xd8f583[_0x6c3b('0x33')]=_[_0x6c3b('0x36')](_0xd8f583['where'],{'$or':_[_0x6c3b('0x25')](_0xd8f583[_0x6c3b('0x2d')],function(_0x56e061){var _0x4cb3e2={};_0x4cb3e2[_0x56e061]={'$like':'%'+_0x96e5f7[_0x6c3b('0x2f')][_0x6c3b('0x35')]+'%'};return _0x4cb3e2;})});}_0xd8f583=_[_0x6c3b('0x36')]({},_0xd8f583,_0x96e5f7[_0x6c3b('0x38')]);return _0x84225d['getTags'](_0xd8f583);}})['then'](function(_0x2aa02a){if(_0x2aa02a){_0x319685=_0x2aa02a[_0x6c3b('0x30')];if(!_0x96e5f7[_0x6c3b('0x2f')][_0x6c3b('0x31')](_0x6c3b('0x49'))){_0xd8f583[_0x6c3b('0x1a')]=qs[_0x6c3b('0x1a')](_0x96e5f7[_0x6c3b('0x2f')][_0x6c3b('0x1a')]);_0xd8f583[_0x6c3b('0x18')]=qs[_0x6c3b('0x18')](_0x96e5f7['query']['offset']);}return _0x84225d[_0x6c3b('0x4e')](_0xd8f583);}})[_0x6c3b('0x1f')](function(_0x4c7468){if(_0x4c7468){return _0x4c7468?{'count':_0x319685,'rows':_0x4c7468}:null;}})[_0x6c3b('0x1f')](respondWithResult(_0x40771e,null))['catch'](handleError(_0x40771e,null));};exports['setTags']=function(_0x444b6f,_0x599875,_0x3100f7){if(_0x444b6f[_0x6c3b('0x43')]['id']){delete _0x444b6f[_0x6c3b('0x43')]['id'];}return db[_0x6c3b('0x39')][_0x6c3b('0x47')]({'where':{'id':_0x444b6f[_0x6c3b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x599875,null))[_0x6c3b('0x1f')](function(_0x32a70e){if(_0x32a70e){return _0x32a70e[_0x6c3b('0x4f')](_0x444b6f['body'][_0x6c3b('0x50')]||[]);}return null;})['then'](respondWithResult(_0x599875,null))[_0x6c3b('0x41')](handleError(_0x599875,null));}; \ No newline at end of file +var _0x75a8=['keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','getFields','FreshdeskField','sort','findOne','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map'];(function(_0x1417ce,_0xdd03c1){var _0x4856e4=function(_0x5ba17d){while(--_0x5ba17d){_0x1417ce['push'](_0x1417ce['shift']());}};_0x4856e4(++_0xdd03c1);}(_0x75a8,0x1cb));var _0x875a=function(_0x518e99,_0x56b8ad){_0x518e99=_0x518e99-0x0;var _0x35dfb8=_0x75a8[_0x518e99];return _0x35dfb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x875a('0x0'));var zipdir=require(_0x875a('0x1'));var jsonpatch=require(_0x875a('0x2'));var rp=require(_0x875a('0x3'));var moment=require(_0x875a('0x4'));var BPromise=require(_0x875a('0x5'));var Mustache=require(_0x875a('0x6'));var util=require(_0x875a('0x7'));var path=require(_0x875a('0x8'));var sox=require('sox');var csv=require(_0x875a('0x9'));var ejs=require(_0x875a('0xa'));var fs=require('fs');var fs_extra=require(_0x875a('0xb'));var _=require(_0x875a('0xc'));var squel=require(_0x875a('0xd'));var crypto=require(_0x875a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x875a('0xf'));var toCsv=require(_0x875a('0x9'));var querystring=require('querystring');var Papa=require(_0x875a('0x10'));var Redis=require(_0x875a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x875a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x875a('0x13'));var logger=require(_0x875a('0x14'))(_0x875a('0x15'));var utils=require(_0x875a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x875a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x392010,_0xecffd9){_0xecffd9=_0xecffd9||0xcc;return function(_0x18706e){if(_0x18706e){return _0x392010[_0x875a('0x18')](_0xecffd9);}return _0x392010[_0x875a('0x19')](_0xecffd9)[_0x875a('0x1a')]();};}function respondWithResult(_0x1a9eb8,_0x3ec077){_0x3ec077=_0x3ec077||0xc8;return function(_0x294549){if(_0x294549){return _0x1a9eb8[_0x875a('0x19')](_0x3ec077)[_0x875a('0x1b')](_0x294549);}};}function respondWithFilteredResult(_0xba22a3,_0x473c98){return function(_0x3bdca4){if(_0x3bdca4){var _0x4e5aa2=typeof _0x473c98['offset']==='undefined'&&typeof _0x473c98[_0x875a('0x1c')]===_0x875a('0x1d');var _0x432aef=_0x3bdca4[_0x875a('0x1e')];var _0x38a460=_0x4e5aa2?0x0:_0x473c98[_0x875a('0x1f')];var _0x5a0a05=_0x4e5aa2?_0x3bdca4['count']:_0x473c98[_0x875a('0x1f')]+_0x473c98[_0x875a('0x1c')];var _0x273105;if(_0x5a0a05>=_0x432aef){_0x5a0a05=_0x432aef;_0x273105=0xc8;}else{_0x273105=0xce;}_0xba22a3[_0x875a('0x19')](_0x273105);return _0xba22a3[_0x875a('0x20')](_0x875a('0x21'),_0x38a460+'-'+_0x5a0a05+'/'+_0x432aef)[_0x875a('0x1b')](_0x3bdca4);}return null;};}function patchUpdates(_0x54ac57){return function(_0x405b99){try{jsonpatch[_0x875a('0x22')](_0x405b99,_0x54ac57,!![]);}catch(_0x786c11){return BPromise[_0x875a('0x23')](_0x786c11);}return _0x405b99[_0x875a('0x24')]();};}function saveUpdates(_0x48c1f2,_0x302164){return function(_0xe609b5){if(_0xe609b5){return _0xe609b5[_0x875a('0x25')](_0x48c1f2)[_0x875a('0x26')](function(_0x2ca744){return _0x2ca744;});}return null;};}function removeEntity(_0x30a82e,_0x2642e6){return function(_0xe61b23){if(_0xe61b23){return _0xe61b23[_0x875a('0x27')]()[_0x875a('0x26')](function(){_0x30a82e[_0x875a('0x19')](0xcc)[_0x875a('0x1a')]();});}};}function handleEntityNotFound(_0x4858ed,_0x2f0c28){return function(_0x1ce267){if(!_0x1ce267){_0x4858ed[_0x875a('0x18')](0x194);}return _0x1ce267;};}function handleError(_0x424810,_0x4bdc5c){_0x4bdc5c=_0x4bdc5c||0x1f4;return function(_0x5d73e8){logger['error'](_0x5d73e8[_0x875a('0x28')]);if(_0x5d73e8[_0x875a('0x29')]){delete _0x5d73e8['name'];}_0x424810['status'](_0x4bdc5c)[_0x875a('0x2a')](_0x5d73e8);};}exports[_0x875a('0x2b')]=function(_0x3d983e,_0x10e76d){var _0x197651={},_0x1c92f5={},_0x5ef161={'count':0x0,'rows':[]};var _0x20d3af=_['map'](db[_0x875a('0x2c')][_0x875a('0x2d')],function(_0x19979a){return{'name':_0x19979a[_0x875a('0x2e')],'type':_0x19979a[_0x875a('0x2f')][_0x875a('0x30')]};});_0x1c92f5[_0x875a('0x31')]=_[_0x875a('0x32')](_0x20d3af,_0x875a('0x29'));_0x1c92f5['query']=_[_0x875a('0x33')](_0x3d983e[_0x875a('0x34')]);_0x1c92f5[_0x875a('0x35')]=_[_0x875a('0x36')](_0x1c92f5[_0x875a('0x31')],_0x1c92f5[_0x875a('0x34')]);_0x197651[_0x875a('0x37')]=_[_0x875a('0x36')](_0x1c92f5[_0x875a('0x31')],qs['fields'](_0x3d983e[_0x875a('0x34')][_0x875a('0x38')]));_0x197651[_0x875a('0x37')]=_0x197651['attributes']['length']?_0x197651[_0x875a('0x37')]:_0x1c92f5[_0x875a('0x31')];if(!_0x3d983e[_0x875a('0x34')][_0x875a('0x39')](_0x875a('0x3a'))){_0x197651[_0x875a('0x1c')]=qs[_0x875a('0x1c')](_0x3d983e[_0x875a('0x34')][_0x875a('0x1c')]);_0x197651[_0x875a('0x1f')]=qs[_0x875a('0x1f')](_0x3d983e[_0x875a('0x34')]['offset']);}_0x197651[_0x875a('0x3b')]=qs['sort'](_0x3d983e[_0x875a('0x34')]['sort']);_0x197651[_0x875a('0x3c')]=qs[_0x875a('0x35')](_[_0x875a('0x3d')](_0x3d983e[_0x875a('0x34')],_0x1c92f5[_0x875a('0x35')]),_0x20d3af);if(_0x3d983e[_0x875a('0x34')][_0x875a('0x3e')]){_0x197651[_0x875a('0x3c')]=_[_0x875a('0x3f')](_0x197651[_0x875a('0x3c')],{'$or':_[_0x875a('0x32')](_0x20d3af,function(_0x128c9c){if(_0x128c9c[_0x875a('0x2f')]!==_0x875a('0x40')){var _0x425716={};_0x425716[_0x128c9c[_0x875a('0x29')]]={'$like':'%'+_0x3d983e['query'][_0x875a('0x3e')]+'%'};return _0x425716;}})});}_0x197651=_['merge']({},_0x197651,_0x3d983e[_0x875a('0x41')]);var _0x118b4c={'where':_0x197651[_0x875a('0x3c')]};return db['FreshdeskConfiguration']['count'](_0x118b4c)[_0x875a('0x26')](function(_0x2c373d){_0x5ef161['count']=_0x2c373d;if(_0x3d983e[_0x875a('0x34')]['includeAll']){_0x197651[_0x875a('0x42')]=[{'all':!![]}];}return db[_0x875a('0x2c')][_0x875a('0x43')](_0x197651);})[_0x875a('0x26')](function(_0x5032c6){_0x5ef161[_0x875a('0x44')]=_0x5032c6;return _0x5ef161;})[_0x875a('0x26')](respondWithFilteredResult(_0x10e76d,_0x197651))[_0x875a('0x45')](handleError(_0x10e76d,null));};exports[_0x875a('0x46')]=function(_0x5ef399,_0x597691){var _0x11030e={'raw':![],'where':{'id':_0x5ef399[_0x875a('0x47')]['id']}},_0x307639={};_0x307639[_0x875a('0x31')]=_[_0x875a('0x33')](db[_0x875a('0x2c')]['rawAttributes']);_0x307639['query']=_[_0x875a('0x33')](_0x5ef399['query']);_0x307639[_0x875a('0x35')]=_[_0x875a('0x36')](_0x307639[_0x875a('0x31')],_0x307639[_0x875a('0x34')]);_0x11030e[_0x875a('0x37')]=_['intersection'](_0x307639[_0x875a('0x31')],qs['fields'](_0x5ef399['query'][_0x875a('0x38')]));_0x11030e[_0x875a('0x37')]=_0x11030e[_0x875a('0x37')][_0x875a('0x48')]?_0x11030e['attributes']:_0x307639[_0x875a('0x31')];if(_0x5ef399[_0x875a('0x34')][_0x875a('0x49')]){_0x11030e[_0x875a('0x42')]=[{'all':!![]}];}_0x11030e=_[_0x875a('0x3f')]({},_0x11030e,_0x5ef399[_0x875a('0x41')]);return db[_0x875a('0x2c')][_0x875a('0x4a')](_0x11030e)['then'](handleEntityNotFound(_0x597691,null))[_0x875a('0x26')](respondWithResult(_0x597691,null))[_0x875a('0x45')](handleError(_0x597691,null));};exports['create']=function(_0x3294b6,_0x4c3b86){return db['FreshdeskConfiguration'][_0x875a('0x4b')](_0x3294b6[_0x875a('0x4c')],{})['then'](respondWithResult(_0x4c3b86,0xc9))['catch'](handleError(_0x4c3b86,null));};exports[_0x875a('0x25')]=function(_0x12d5cc,_0x5ee538){if(_0x12d5cc[_0x875a('0x4c')]['id']){delete _0x12d5cc[_0x875a('0x4c')]['id'];}return db[_0x875a('0x2c')]['find']({'where':{'id':_0x12d5cc[_0x875a('0x47')]['id']}})[_0x875a('0x26')](handleEntityNotFound(_0x5ee538,null))[_0x875a('0x26')](saveUpdates(_0x12d5cc[_0x875a('0x4c')],null))[_0x875a('0x26')](respondWithResult(_0x5ee538,null))['catch'](handleError(_0x5ee538,null));};exports[_0x875a('0x27')]=function(_0x3de8b2,_0x125124){return db[_0x875a('0x2c')][_0x875a('0x4a')]({'where':{'id':_0x3de8b2[_0x875a('0x47')]['id']}})['then'](handleEntityNotFound(_0x125124,null))[_0x875a('0x26')](removeEntity(_0x125124,null))[_0x875a('0x45')](handleError(_0x125124,null));};exports[_0x875a('0x4d')]=function(_0x5bb2bc,_0x36cdf4,_0x424834){var _0x29f09e={};var _0xdfdad={};var _0x8804c0;var _0x8dbd3c;return db[_0x875a('0x2c')]['findOne']({'where':{'id':_0x5bb2bc[_0x875a('0x47')]['id']}})[_0x875a('0x26')](handleEntityNotFound(_0x36cdf4,null))['then'](function(_0x1937f6){if(_0x1937f6){_0x8804c0=_0x1937f6;_0xdfdad[_0x875a('0x31')]=_['keys'](db[_0x875a('0x4e')][_0x875a('0x2d')]);_0xdfdad[_0x875a('0x34')]=_['keys'](_0x5bb2bc[_0x875a('0x34')]);_0xdfdad[_0x875a('0x35')]=_[_0x875a('0x36')](_0xdfdad[_0x875a('0x31')],_0xdfdad['query']);_0x29f09e[_0x875a('0x37')]=_['intersection'](_0xdfdad[_0x875a('0x31')],qs[_0x875a('0x38')](_0x5bb2bc['query'][_0x875a('0x38')]));_0x29f09e[_0x875a('0x37')]=_0x29f09e[_0x875a('0x37')]['length']?_0x29f09e['attributes']:_0xdfdad[_0x875a('0x31')];_0x29f09e[_0x875a('0x3b')]=qs[_0x875a('0x4f')](_0x5bb2bc[_0x875a('0x34')][_0x875a('0x4f')]);_0x29f09e['where']=qs[_0x875a('0x35')](_[_0x875a('0x3d')](_0x5bb2bc[_0x875a('0x34')],_0xdfdad[_0x875a('0x35')]));if(_0x5bb2bc[_0x875a('0x34')]['filter']){_0x29f09e[_0x875a('0x3c')]=_[_0x875a('0x3f')](_0x29f09e[_0x875a('0x3c')],{'$or':_[_0x875a('0x32')](_0x29f09e[_0x875a('0x37')],function(_0x46a551){var _0x3dd154={};_0x3dd154[_0x46a551]={'$like':'%'+_0x5bb2bc[_0x875a('0x34')]['filter']+'%'};return _0x3dd154;})});}_0x29f09e=_['merge']({},_0x29f09e,_0x5bb2bc['options']);return _0x8804c0['getFields'](_0x29f09e);}})[_0x875a('0x26')](function(_0x5d4171){if(_0x5d4171){_0x8dbd3c=_0x5d4171[_0x875a('0x48')];if(!_0x5bb2bc[_0x875a('0x34')][_0x875a('0x39')]('nolimit')){_0x29f09e[_0x875a('0x1c')]=qs[_0x875a('0x1c')](_0x5bb2bc[_0x875a('0x34')][_0x875a('0x1c')]);_0x29f09e[_0x875a('0x1f')]=qs[_0x875a('0x1f')](_0x5bb2bc['query']['offset']);}return _0x8804c0[_0x875a('0x4d')](_0x29f09e);}})[_0x875a('0x26')](function(_0x42f8f8){if(_0x42f8f8){return _0x42f8f8?{'count':_0x8dbd3c,'rows':_0x42f8f8}:null;}})[_0x875a('0x26')](respondWithResult(_0x36cdf4,null))[_0x875a('0x45')](handleError(_0x36cdf4,null));};exports['getSubjects']=function(_0x516aa3,_0x2261d3,_0x106cfa){var _0x48b6d1={};var _0x32210c={};var _0x10c728;var _0x56c957;return db[_0x875a('0x2c')][_0x875a('0x50')]({'where':{'id':_0x516aa3[_0x875a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2261d3,null))[_0x875a('0x26')](function(_0x27a304){if(_0x27a304){_0x10c728=_0x27a304;_0x32210c[_0x875a('0x31')]=_[_0x875a('0x33')](db[_0x875a('0x4e')][_0x875a('0x2d')]);_0x32210c[_0x875a('0x34')]=_[_0x875a('0x33')](_0x516aa3[_0x875a('0x34')]);_0x32210c['filters']=_[_0x875a('0x36')](_0x32210c[_0x875a('0x31')],_0x32210c['query']);_0x48b6d1[_0x875a('0x37')]=_[_0x875a('0x36')](_0x32210c[_0x875a('0x31')],qs[_0x875a('0x38')](_0x516aa3[_0x875a('0x34')][_0x875a('0x38')]));_0x48b6d1['attributes']=_0x48b6d1[_0x875a('0x37')][_0x875a('0x48')]?_0x48b6d1[_0x875a('0x37')]:_0x32210c[_0x875a('0x31')];_0x48b6d1[_0x875a('0x3b')]=qs[_0x875a('0x4f')](_0x516aa3['query']['sort']);_0x48b6d1[_0x875a('0x3c')]=qs[_0x875a('0x35')](_[_0x875a('0x3d')](_0x516aa3[_0x875a('0x34')],_0x32210c['filters']));if(_0x516aa3[_0x875a('0x34')][_0x875a('0x3e')]){_0x48b6d1[_0x875a('0x3c')]=_[_0x875a('0x3f')](_0x48b6d1[_0x875a('0x3c')],{'$or':_[_0x875a('0x32')](_0x48b6d1[_0x875a('0x37')],function(_0x10ec9d){var _0x44f554={};_0x44f554[_0x10ec9d]={'$like':'%'+_0x516aa3[_0x875a('0x34')]['filter']+'%'};return _0x44f554;})});}_0x48b6d1=_[_0x875a('0x3f')]({},_0x48b6d1,_0x516aa3[_0x875a('0x41')]);return _0x10c728['getSubjects'](_0x48b6d1);}})[_0x875a('0x26')](function(_0x1513fb){if(_0x1513fb){_0x56c957=_0x1513fb[_0x875a('0x48')];if(!_0x516aa3['query']['hasOwnProperty'](_0x875a('0x3a'))){_0x48b6d1[_0x875a('0x1c')]=qs[_0x875a('0x1c')](_0x516aa3['query'][_0x875a('0x1c')]);_0x48b6d1['offset']=qs[_0x875a('0x1f')](_0x516aa3[_0x875a('0x34')][_0x875a('0x1f')]);}return _0x10c728['getSubjects'](_0x48b6d1);}})[_0x875a('0x26')](function(_0x545ccf){if(_0x545ccf){return _0x545ccf?{'count':_0x56c957,'rows':_0x545ccf}:null;}})['then'](respondWithResult(_0x2261d3,null))[_0x875a('0x45')](handleError(_0x2261d3,null));};exports[_0x875a('0x51')]=function(_0x2de781,_0x5d5331,_0x10d2b4){var _0x36b26c={};var _0x3d11f3={};var _0x1c518c;var _0x51da31;return db[_0x875a('0x2c')][_0x875a('0x50')]({'where':{'id':_0x2de781['params']['id']}})[_0x875a('0x26')](handleEntityNotFound(_0x5d5331,null))['then'](function(_0x46132f){if(_0x46132f){_0x1c518c=_0x46132f;_0x3d11f3[_0x875a('0x31')]=_[_0x875a('0x33')](db[_0x875a('0x4e')][_0x875a('0x2d')]);_0x3d11f3['query']=_['keys'](_0x2de781[_0x875a('0x34')]);_0x3d11f3['filters']=_[_0x875a('0x36')](_0x3d11f3[_0x875a('0x31')],_0x3d11f3[_0x875a('0x34')]);_0x36b26c['attributes']=_[_0x875a('0x36')](_0x3d11f3[_0x875a('0x31')],qs['fields'](_0x2de781[_0x875a('0x34')][_0x875a('0x38')]));_0x36b26c[_0x875a('0x37')]=_0x36b26c[_0x875a('0x37')][_0x875a('0x48')]?_0x36b26c[_0x875a('0x37')]:_0x3d11f3[_0x875a('0x31')];_0x36b26c[_0x875a('0x3b')]=qs['sort'](_0x2de781[_0x875a('0x34')]['sort']);_0x36b26c['where']=qs['filters'](_[_0x875a('0x3d')](_0x2de781[_0x875a('0x34')],_0x3d11f3['filters']));if(_0x2de781[_0x875a('0x34')]['filter']){_0x36b26c[_0x875a('0x3c')]=_['merge'](_0x36b26c[_0x875a('0x3c')],{'$or':_['map'](_0x36b26c[_0x875a('0x37')],function(_0x143e27){var _0x2da905={};_0x2da905[_0x143e27]={'$like':'%'+_0x2de781[_0x875a('0x34')]['filter']+'%'};return _0x2da905;})});}_0x36b26c=_[_0x875a('0x3f')]({},_0x36b26c,_0x2de781[_0x875a('0x41')]);return _0x1c518c[_0x875a('0x51')](_0x36b26c);}})[_0x875a('0x26')](function(_0x57551b){if(_0x57551b){_0x51da31=_0x57551b[_0x875a('0x48')];if(!_0x2de781['query'][_0x875a('0x39')](_0x875a('0x3a'))){_0x36b26c[_0x875a('0x1c')]=qs[_0x875a('0x1c')](_0x2de781[_0x875a('0x34')]['limit']);_0x36b26c['offset']=qs[_0x875a('0x1f')](_0x2de781[_0x875a('0x34')]['offset']);}return _0x1c518c[_0x875a('0x51')](_0x36b26c);}})[_0x875a('0x26')](function(_0x1bc21f){if(_0x1bc21f){return _0x1bc21f?{'count':_0x51da31,'rows':_0x1bc21f}:null;}})[_0x875a('0x26')](respondWithResult(_0x5d5331,null))['catch'](handleError(_0x5d5331,null));};exports[_0x875a('0x52')]=function(_0x2d4aae,_0x3ec199,_0x4fefc1){var _0x15ca85={};var _0x40d9f0={};var _0x4554f4;var _0x11622e;return db[_0x875a('0x2c')][_0x875a('0x50')]({'where':{'id':_0x2d4aae['params']['id']}})[_0x875a('0x26')](handleEntityNotFound(_0x3ec199,null))[_0x875a('0x26')](function(_0x582d27){if(_0x582d27){_0x4554f4=_0x582d27;_0x40d9f0[_0x875a('0x31')]=_[_0x875a('0x33')](db['Tag']['rawAttributes']);_0x40d9f0[_0x875a('0x34')]=_['keys'](_0x2d4aae['query']);_0x40d9f0[_0x875a('0x35')]=_[_0x875a('0x36')](_0x40d9f0[_0x875a('0x31')],_0x40d9f0[_0x875a('0x34')]);_0x15ca85[_0x875a('0x37')]=_[_0x875a('0x36')](_0x40d9f0[_0x875a('0x31')],qs['fields'](_0x2d4aae[_0x875a('0x34')][_0x875a('0x38')]));_0x15ca85[_0x875a('0x37')]=_0x15ca85[_0x875a('0x37')][_0x875a('0x48')]?_0x15ca85['attributes']:_0x40d9f0['model'];_0x15ca85[_0x875a('0x3b')]=qs[_0x875a('0x4f')](_0x2d4aae['query'][_0x875a('0x4f')]);_0x15ca85['where']=qs[_0x875a('0x35')](_[_0x875a('0x3d')](_0x2d4aae[_0x875a('0x34')],_0x40d9f0[_0x875a('0x35')]));if(_0x2d4aae['query'][_0x875a('0x3e')]){_0x15ca85[_0x875a('0x3c')]=_[_0x875a('0x3f')](_0x15ca85[_0x875a('0x3c')],{'$or':_['map'](_0x15ca85[_0x875a('0x37')],function(_0x5543df){var _0x673946={};_0x673946[_0x5543df]={'$like':'%'+_0x2d4aae[_0x875a('0x34')]['filter']+'%'};return _0x673946;})});}_0x15ca85=_[_0x875a('0x3f')]({},_0x15ca85,_0x2d4aae[_0x875a('0x41')]);return _0x4554f4['getTags'](_0x15ca85);}})[_0x875a('0x26')](function(_0x3c9792){if(_0x3c9792){_0x11622e=_0x3c9792[_0x875a('0x48')];if(!_0x2d4aae[_0x875a('0x34')][_0x875a('0x39')]('nolimit')){_0x15ca85['limit']=qs[_0x875a('0x1c')](_0x2d4aae[_0x875a('0x34')]['limit']);_0x15ca85[_0x875a('0x1f')]=qs[_0x875a('0x1f')](_0x2d4aae[_0x875a('0x34')]['offset']);}return _0x4554f4['getTags'](_0x15ca85);}})[_0x875a('0x26')](function(_0x38f450){if(_0x38f450){return _0x38f450?{'count':_0x11622e,'rows':_0x38f450}:null;}})[_0x875a('0x26')](respondWithResult(_0x3ec199,null))[_0x875a('0x45')](handleError(_0x3ec199,null));};exports[_0x875a('0x53')]=function(_0x408bfc,_0x528a6e,_0x390c28){if(_0x408bfc[_0x875a('0x4c')]['id']){delete _0x408bfc[_0x875a('0x4c')]['id'];}return db[_0x875a('0x2c')][_0x875a('0x50')]({'where':{'id':_0x408bfc[_0x875a('0x47')]['id']}})[_0x875a('0x26')](handleEntityNotFound(_0x528a6e,null))[_0x875a('0x26')](function(_0x1fac96){if(_0x1fac96){return _0x1fac96['setTags'](_0x408bfc['body'][_0x875a('0x54')]||[]);}return null;})[_0x875a('0x26')](respondWithResult(_0x528a6e,null))['catch'](handleError(_0x528a6e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 73a5234..747a139 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 _0xb995=['bluebird','request-promise','path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb995,0x187));var _0x5b99=function(_0x410632,_0x13ec4a){_0x410632=_0x410632-0x0;var _0x42ac58=_0xb995[_0x410632];return _0x42ac58;};'use strict';var _=require(_0x5b99('0x0'));var util=require(_0x5b99('0x1'));var logger=require(_0x5b99('0x2'))(_0x5b99('0x3'));var moment=require(_0x5b99('0x4'));var BPromise=require(_0x5b99('0x5'));var rp=require(_0x5b99('0x6'));var fs=require('fs');var path=require(_0x5b99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5b99('0x8'));module[_0x5b99('0x9')]=function(_0x565ab1,_0x204642){return _0x565ab1[_0x5b99('0xa')](_0x5b99('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab88=['request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xab88,0x14b));var _0x8ab8=function(_0x1eb5da,_0x1974ec){_0x1eb5da=_0x1eb5da-0x0;var _0x579a2f=_0xab88[_0x1eb5da];return _0x579a2f;};'use strict';var _=require(_0x8ab8('0x0'));var util=require('util');var logger=require(_0x8ab8('0x1'))(_0x8ab8('0x2'));var moment=require(_0x8ab8('0x3'));var BPromise=require(_0x8ab8('0x4'));var rp=require(_0x8ab8('0x5'));var fs=require('fs');var path=require(_0x8ab8('0x6'));var rimraf=require(_0x8ab8('0x7'));var config=require('../../config/environment');var attributes=require(_0x8ab8('0x8'));module[_0x8ab8('0x9')]=function(_0x2cc123,_0x323060){return _0x2cc123[_0x8ab8('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x8ab8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 2e3e18d..d4ad5b0 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 _0x6c18=['rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f817e,_0x2b9271){var _0x26d4d6=function(_0x822fe0){while(--_0x822fe0){_0x2f817e['push'](_0x2f817e['shift']());}};_0x26d4d6(++_0x2b9271);}(_0x6c18,0x75));var _0x86c1=function(_0x349387,_0x5eab3e){_0x349387=_0x349387-0x0;var _0x4449e0=_0x6c18[_0x349387];return _0x4449e0;};'use strict';var _=require(_0x86c1('0x0'));var util=require(_0x86c1('0x1'));var moment=require('moment');var BPromise=require(_0x86c1('0x2'));var rs=require(_0x86c1('0x3'));var fs=require('fs');var Redis=require(_0x86c1('0x4'));var db=require(_0x86c1('0x5'))['db'];var utils=require(_0x86c1('0x6'));var logger=require(_0x86c1('0x7'))(_0x86c1('0x8'));var config=require(_0x86c1('0x9'));var jayson=require(_0x86c1('0xa'));var client=jayson[_0x86c1('0xb')][_0x86c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56133e,_0x38241,_0x17f23b){return new BPromise(function(_0x4575f8,_0x167ed5){return client[_0x86c1('0xd')](_0x56133e,_0x17f23b)['then'](function(_0x3783fe){logger[_0x86c1('0xe')](_0x86c1('0xf'),_0x38241,'request\x20sent');logger[_0x86c1('0x10')](_0x86c1('0x11'),_0x38241,'request\x20sent',JSON[_0x86c1('0x12')](_0x3783fe));if(_0x3783fe[_0x86c1('0x13')]){if(_0x3783fe[_0x86c1('0x13')][_0x86c1('0x14')]===0x1f4){logger[_0x86c1('0x13')](_0x86c1('0xf'),_0x38241,_0x3783fe[_0x86c1('0x13')]['message']);return _0x167ed5(_0x3783fe[_0x86c1('0x13')][_0x86c1('0x15')]);}logger[_0x86c1('0x13')](_0x86c1('0xf'),_0x38241,_0x3783fe[_0x86c1('0x13')][_0x86c1('0x15')]);return _0x4575f8(_0x3783fe[_0x86c1('0x13')][_0x86c1('0x15')]);}else{logger[_0x86c1('0xe')](_0x86c1('0xf'),_0x38241,_0x86c1('0x16'));_0x4575f8(_0x3783fe[_0x86c1('0x17')][_0x86c1('0x15')]);}})[_0x86c1('0x18')](function(_0x13364b){logger[_0x86c1('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x38241,_0x13364b);_0x167ed5(_0x13364b);});});} \ No newline at end of file +var _0x0353=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0353,0x1a9));var _0x3035=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x0353[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x3035('0x0'));var moment=require(_0x3035('0x1'));var BPromise=require(_0x3035('0x2'));var rs=require(_0x3035('0x3'));var fs=require('fs');var Redis=require(_0x3035('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3035('0x5'))(_0x3035('0x6'));var config=require('../../config/environment');var jayson=require(_0x3035('0x7'));var client=jayson[_0x3035('0x8')][_0x3035('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d0daf,_0x51e213,_0x19a7e6){return new BPromise(function(_0x593fa8,_0x2a30ac){return client[_0x3035('0xa')](_0x3d0daf,_0x19a7e6)['then'](function(_0x45add3){logger[_0x3035('0xb')](_0x3035('0xc'),_0x51e213,_0x3035('0xd'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x51e213,_0x3035('0xd'),JSON[_0x3035('0xe')](_0x45add3));if(_0x45add3[_0x3035('0xf')]){if(_0x45add3[_0x3035('0xf')][_0x3035('0x10')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x51e213,_0x45add3[_0x3035('0xf')][_0x3035('0x11')]);return _0x2a30ac(_0x45add3[_0x3035('0xf')][_0x3035('0x11')]);}logger[_0x3035('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x51e213,_0x45add3['error'][_0x3035('0x11')]);return _0x593fa8(_0x45add3[_0x3035('0xf')][_0x3035('0x11')]);}else{logger[_0x3035('0xb')](_0x3035('0xc'),_0x51e213,_0x3035('0xd'));_0x593fa8(_0x45add3[_0x3035('0x12')][_0x3035('0x11')]);}})[_0x3035('0x13')](function(_0x595382){logger['error'](_0x3035('0xc'),_0x51e213,_0x595382);_0x2a30ac(_0x595382);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index bff5b7d..83f0f29 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 _0x5271=['get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x7661f6,_0x1bf319){var _0x58723d=function(_0x5bd45b){while(--_0x5bd45b){_0x7661f6['push'](_0x7661f6['shift']());}};_0x58723d(++_0x1bf319);}(_0x5271,0x1cd));var _0x1527=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x5271[_0x2642cb];return _0xe6e41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1527('0x0'));var timeout=require(_0x1527('0x1'));var express=require(_0x1527('0x2'));var router=express[_0x1527('0x3')]();var fs_extra=require(_0x1527('0x4'));var auth=require(_0x1527('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1527('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x1527('0x7')]('/',auth[_0x1527('0x8')](),controller['index']);router[_0x1527('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1527('0x9')]);router[_0x1527('0xa')]('/',auth[_0x1527('0x8')](),controller[_0x1527('0xb')]);router[_0x1527('0xc')](_0x1527('0xd'),auth[_0x1527('0x8')](),controller[_0x1527('0xe')]);router[_0x1527('0xf')](_0x1527('0xd'),auth[_0x1527('0x8')](),controller[_0x1527('0x10')]);module[_0x1527('0x11')]=router; \ No newline at end of file +var _0x1582=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x3de185,_0x2626e5){var _0x49f091=function(_0x58a045){while(--_0x58a045){_0x3de185['push'](_0x3de185['shift']());}};_0x49f091(++_0x2626e5);}(_0x1582,0x10f));var _0x2158=function(_0x3d6ac0,_0x1c52e2){_0x3d6ac0=_0x3d6ac0-0x0;var _0x359130=_0x1582[_0x3d6ac0];return _0x359130;};'use strict';var multer=require(_0x2158('0x0'));var util=require(_0x2158('0x1'));var path=require(_0x2158('0x2'));var timeout=require(_0x2158('0x3'));var express=require(_0x2158('0x4'));var router=express[_0x2158('0x5')]();var fs_extra=require(_0x2158('0x6'));var auth=require(_0x2158('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2158('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x2158('0x9')]('/',auth[_0x2158('0xa')](),controller[_0x2158('0xb')]);router['get'](_0x2158('0xc'),auth[_0x2158('0xa')](),controller['show']);router[_0x2158('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2158('0xe')]('/:id',auth[_0x2158('0xa')](),controller[_0x2158('0xf')]);router[_0x2158('0x10')](_0x2158('0xc'),auth[_0x2158('0xa')](),controller[_0x2158('0x11')]);module[_0x2158('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index db01f3b..730c7bf 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 _0xe2c7=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0xa9430,_0x14f536){var _0x220b68=function(_0x591147){while(--_0x591147){_0xa9430['push'](_0xa9430['shift']());}};_0x220b68(++_0x14f536);}(_0xe2c7,0x1b2));var _0x7e2c=function(_0x59af24,_0x201f0e){_0x59af24=_0x59af24-0x0;var _0x5d79d4=_0xe2c7[_0x59af24];return _0x5d79d4;};'use strict';var Sequelize=require(_0x7e2c('0x0'));module['exports']={'type':{'type':Sequelize[_0x7e2c('0x1')]('string',_0x7e2c('0x2'),_0x7e2c('0x3'),_0x7e2c('0x4'),_0x7e2c('0x5')),'defaultValue':_0x7e2c('0x6')},'content':{'type':Sequelize[_0x7e2c('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7e2c('0x1')](_0x7e2c('0x6'),_0x7e2c('0x2'),_0x7e2c('0x3'))},'keyContent':{'type':Sequelize[_0x7e2c('0x7')]},'idField':{'type':Sequelize[_0x7e2c('0x7')]},'nameField':{'type':Sequelize[_0x7e2c('0x7')]},'customField':{'type':Sequelize[_0x7e2c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7e2c('0x7')]}}; \ No newline at end of file +var _0x688f=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x41ed0f,_0x315b0c){var _0x1c2fc3=function(_0x19fe87){while(--_0x19fe87){_0x41ed0f['push'](_0x41ed0f['shift']());}};_0x1c2fc3(++_0x315b0c);}(_0x688f,0x16d));var _0xf688=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x688f[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require('sequelize');module[_0xf688('0x0')]={'type':{'type':Sequelize[_0xf688('0x1')](_0xf688('0x2'),_0xf688('0x3'),_0xf688('0x4'),_0xf688('0x5'),_0xf688('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf688('0x7')]},'key':{'type':Sequelize[_0xf688('0x7')]},'keyType':{'type':Sequelize[_0xf688('0x1')](_0xf688('0x2'),'variable',_0xf688('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf688('0x7')]},'nameField':{'type':Sequelize[_0xf688('0x7')]},'customField':{'type':Sequelize[_0xf688('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf688('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6085ac3..984160a 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 _0x4ea3=['count','set','Content-Range','reject','save','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','fields','query','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','FreshdeskField','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x34ea('0x0'));var rimraf=require(_0x34ea('0x1'));var zipdir=require(_0x34ea('0x2'));var jsonpatch=require(_0x34ea('0x3'));var rp=require('request-promise');var moment=require(_0x34ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x34ea('0x5'));var util=require('util');var path=require('path');var sox=require(_0x34ea('0x6'));var csv=require(_0x34ea('0x7'));var ejs=require(_0x34ea('0x8'));var fs=require('fs');var fs_extra=require(_0x34ea('0x9'));var _=require(_0x34ea('0xa'));var squel=require(_0x34ea('0xb'));var crypto=require(_0x34ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x34ea('0xd'));var toCsv=require(_0x34ea('0x7'));var querystring=require(_0x34ea('0xe'));var Papa=require('papaparse');var Redis=require(_0x34ea('0xf'));var authService=require(_0x34ea('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34ea('0x11'));var logger=require(_0x34ea('0x12'))(_0x34ea('0x13'));var utils=require('../../config/utils');var config=require(_0x34ea('0x14'));var licenseUtil=require(_0x34ea('0x15'));var db=require(_0x34ea('0x16'))['db'];function respondWithStatusCode(_0x233b11,_0x60725f){_0x60725f=_0x60725f||0xcc;return function(_0xc56a7d){if(_0xc56a7d){return _0x233b11[_0x34ea('0x17')](_0x60725f);}return _0x233b11[_0x34ea('0x18')](_0x60725f)[_0x34ea('0x19')]();};}function respondWithResult(_0x2a19c6,_0x36a4c6){_0x36a4c6=_0x36a4c6||0xc8;return function(_0x5ef9ae){if(_0x5ef9ae){return _0x2a19c6[_0x34ea('0x18')](_0x36a4c6)[_0x34ea('0x1a')](_0x5ef9ae);}};}function respondWithFilteredResult(_0x14ebb9,_0x3f9ffe){return function(_0x44e44e){if(_0x44e44e){var _0x56b2d7=typeof _0x3f9ffe[_0x34ea('0x1b')]===_0x34ea('0x1c')&&typeof _0x3f9ffe[_0x34ea('0x1d')]===_0x34ea('0x1c');var _0x5f420f=_0x44e44e[_0x34ea('0x1e')];var _0x34caea=_0x56b2d7?0x0:_0x3f9ffe[_0x34ea('0x1b')];var _0x5340a4=_0x56b2d7?_0x44e44e[_0x34ea('0x1e')]:_0x3f9ffe[_0x34ea('0x1b')]+_0x3f9ffe[_0x34ea('0x1d')];var _0x127308;if(_0x5340a4>=_0x5f420f){_0x5340a4=_0x5f420f;_0x127308=0xc8;}else{_0x127308=0xce;}_0x14ebb9['status'](_0x127308);return _0x14ebb9[_0x34ea('0x1f')](_0x34ea('0x20'),_0x34caea+'-'+_0x5340a4+'/'+_0x5f420f)[_0x34ea('0x1a')](_0x44e44e);}return null;};}function patchUpdates(_0x247ee7){return function(_0x4fc1a2){try{jsonpatch['apply'](_0x4fc1a2,_0x247ee7,!![]);}catch(_0xe3b292){return BPromise[_0x34ea('0x21')](_0xe3b292);}return _0x4fc1a2[_0x34ea('0x22')]();};}function saveUpdates(_0x51022f,_0x5197a2){return function(_0x2eafc6){if(_0x2eafc6){return _0x2eafc6[_0x34ea('0x23')](_0x51022f)[_0x34ea('0x24')](function(_0x30c4b0){return _0x30c4b0;});}return null;};}function removeEntity(_0x12e7e9,_0x697475){return function(_0x5ade46){if(_0x5ade46){return _0x5ade46[_0x34ea('0x25')]()[_0x34ea('0x24')](function(){_0x12e7e9[_0x34ea('0x18')](0xcc)[_0x34ea('0x19')]();});}};}function handleEntityNotFound(_0x5b5885,_0x56f320){return function(_0x564d1b){if(!_0x564d1b){_0x5b5885[_0x34ea('0x17')](0x194);}return _0x564d1b;};}function handleError(_0x187306,_0x37c214){_0x37c214=_0x37c214||0x1f4;return function(_0x4204d7){logger['error'](_0x4204d7[_0x34ea('0x26')]);if(_0x4204d7[_0x34ea('0x27')]){delete _0x4204d7[_0x34ea('0x27')];}_0x187306['status'](_0x37c214)['send'](_0x4204d7);};}exports['index']=function(_0x4d4360,_0x2942ce){var _0x6227db={},_0x859b7e={},_0x162081={'count':0x0,'rows':[]};var _0x56c9dd=_[_0x34ea('0x28')](db['FreshdeskField'][_0x34ea('0x29')],function(_0x4f2b77){return{'name':_0x4f2b77[_0x34ea('0x2a')],'type':_0x4f2b77[_0x34ea('0x2b')][_0x34ea('0x2c')]};});_0x859b7e['model']=_[_0x34ea('0x28')](_0x56c9dd,_0x34ea('0x27'));_0x859b7e['query']=_[_0x34ea('0x2d')](_0x4d4360['query']);_0x859b7e[_0x34ea('0x2e')]=_[_0x34ea('0x2f')](_0x859b7e[_0x34ea('0x30')],_0x859b7e['query']);_0x6227db['attributes']=_[_0x34ea('0x2f')](_0x859b7e['model'],qs[_0x34ea('0x31')](_0x4d4360[_0x34ea('0x32')]['fields']));_0x6227db[_0x34ea('0x33')]=_0x6227db[_0x34ea('0x33')][_0x34ea('0x34')]?_0x6227db[_0x34ea('0x33')]:_0x859b7e['model'];if(!_0x4d4360['query']['hasOwnProperty'](_0x34ea('0x35'))){_0x6227db[_0x34ea('0x1d')]=qs[_0x34ea('0x1d')](_0x4d4360['query']['limit']);_0x6227db['offset']=qs[_0x34ea('0x1b')](_0x4d4360[_0x34ea('0x32')]['offset']);}_0x6227db[_0x34ea('0x36')]=qs[_0x34ea('0x37')](_0x4d4360[_0x34ea('0x32')][_0x34ea('0x37')]);_0x6227db[_0x34ea('0x38')]=qs[_0x34ea('0x2e')](_['pick'](_0x4d4360[_0x34ea('0x32')],_0x859b7e[_0x34ea('0x2e')]),_0x56c9dd);if(_0x4d4360[_0x34ea('0x32')][_0x34ea('0x39')]){_0x6227db['where']=_['merge'](_0x6227db[_0x34ea('0x38')],{'$or':_[_0x34ea('0x28')](_0x56c9dd,function(_0xf39615){if(_0xf39615[_0x34ea('0x2b')]!==_0x34ea('0x3a')){var _0x4c696f={};_0x4c696f[_0xf39615[_0x34ea('0x27')]]={'$like':'%'+_0x4d4360[_0x34ea('0x32')][_0x34ea('0x39')]+'%'};return _0x4c696f;}})});}_0x6227db=_[_0x34ea('0x3b')]({},_0x6227db,_0x4d4360[_0x34ea('0x3c')]);var _0x4743f1={'where':_0x6227db[_0x34ea('0x38')]};return db[_0x34ea('0x3d')][_0x34ea('0x1e')](_0x4743f1)[_0x34ea('0x24')](function(_0x448bc0){_0x162081[_0x34ea('0x1e')]=_0x448bc0;if(_0x4d4360[_0x34ea('0x32')][_0x34ea('0x3e')]){_0x6227db[_0x34ea('0x3f')]=[{'all':!![]}];}return db[_0x34ea('0x3d')]['findAll'](_0x6227db);})[_0x34ea('0x24')](function(_0x4ae353){_0x162081[_0x34ea('0x40')]=_0x4ae353;return _0x162081;})[_0x34ea('0x24')](respondWithFilteredResult(_0x2942ce,_0x6227db))[_0x34ea('0x41')](handleError(_0x2942ce,null));};exports[_0x34ea('0x42')]=function(_0x2a57b5,_0x1b785b){var _0x35d81d={'raw':!![],'where':{'id':_0x2a57b5[_0x34ea('0x43')]['id']}},_0x17ba01={};_0x17ba01['model']=_[_0x34ea('0x2d')](db['FreshdeskField'][_0x34ea('0x29')]);_0x17ba01[_0x34ea('0x32')]=_[_0x34ea('0x2d')](_0x2a57b5[_0x34ea('0x32')]);_0x17ba01[_0x34ea('0x2e')]=_[_0x34ea('0x2f')](_0x17ba01['model'],_0x17ba01[_0x34ea('0x32')]);_0x35d81d[_0x34ea('0x33')]=_['intersection'](_0x17ba01[_0x34ea('0x30')],qs[_0x34ea('0x31')](_0x2a57b5[_0x34ea('0x32')][_0x34ea('0x31')]));_0x35d81d[_0x34ea('0x33')]=_0x35d81d['attributes'][_0x34ea('0x34')]?_0x35d81d[_0x34ea('0x33')]:_0x17ba01[_0x34ea('0x30')];if(_0x2a57b5[_0x34ea('0x32')][_0x34ea('0x3e')]){_0x35d81d[_0x34ea('0x3f')]=[{'all':!![]}];}_0x35d81d=_['merge']({},_0x35d81d,_0x2a57b5['options']);return db[_0x34ea('0x3d')][_0x34ea('0x44')](_0x35d81d)[_0x34ea('0x24')](handleEntityNotFound(_0x1b785b,null))['then'](respondWithResult(_0x1b785b,null))[_0x34ea('0x41')](handleError(_0x1b785b,null));};exports['create']=function(_0x16e9b7,_0x4cc586){return db[_0x34ea('0x3d')][_0x34ea('0x45')](_0x16e9b7[_0x34ea('0x46')],{})['then'](respondWithResult(_0x4cc586,0xc9))[_0x34ea('0x41')](handleError(_0x4cc586,null));};exports['update']=function(_0x404a59,_0x3fb739){if(_0x404a59[_0x34ea('0x46')]['id']){delete _0x404a59[_0x34ea('0x46')]['id'];}return db['FreshdeskField'][_0x34ea('0x44')]({'where':{'id':_0x404a59[_0x34ea('0x43')]['id']}})[_0x34ea('0x24')](handleEntityNotFound(_0x3fb739,null))[_0x34ea('0x24')](saveUpdates(_0x404a59[_0x34ea('0x46')],null))[_0x34ea('0x24')](respondWithResult(_0x3fb739,null))[_0x34ea('0x41')](handleError(_0x3fb739,null));};exports['destroy']=function(_0x1059dc,_0x224c53){return db[_0x34ea('0x3d')][_0x34ea('0x44')]({'where':{'id':_0x1059dc[_0x34ea('0x43')]['id']}})[_0x34ea('0x24')](handleEntityNotFound(_0x224c53,null))[_0x34ea('0x24')](removeEntity(_0x224c53,null))[_0x34ea('0x41')](handleError(_0x224c53,null));}; \ No newline at end of file +var _0xb469=['undefined','count','limit','set','Content-Range','apply','update','then','error','stack','name','index','map','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','params','includeAll','options','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xb469,0x13b));var _0x9b46=function(_0x2dfc9f,_0x93ece0){_0x2dfc9f=_0x2dfc9f-0x0;var _0x5ad8e6=_0xb469[_0x2dfc9f];return _0x5ad8e6;};'use strict';var emlformat=require(_0x9b46('0x0'));var rimraf=require(_0x9b46('0x1'));var zipdir=require(_0x9b46('0x2'));var jsonpatch=require(_0x9b46('0x3'));var rp=require(_0x9b46('0x4'));var moment=require(_0x9b46('0x5'));var BPromise=require(_0x9b46('0x6'));var Mustache=require('mustache');var util=require(_0x9b46('0x7'));var path=require(_0x9b46('0x8'));var sox=require('sox');var csv=require(_0x9b46('0x9'));var ejs=require(_0x9b46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b46('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b46('0x9'));var querystring=require(_0x9b46('0xd'));var Papa=require(_0x9b46('0xe'));var Redis=require('ioredis');var authService=require(_0x9b46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9b46('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b46('0x11'))('api');var utils=require(_0x9b46('0x12'));var config=require(_0x9b46('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b46('0x14'))['db'];function respondWithStatusCode(_0x417df5,_0x5b65c2){_0x5b65c2=_0x5b65c2||0xcc;return function(_0x14362a){if(_0x14362a){return _0x417df5[_0x9b46('0x15')](_0x5b65c2);}return _0x417df5[_0x9b46('0x16')](_0x5b65c2)[_0x9b46('0x17')]();};}function respondWithResult(_0xa8f4ac,_0x35c5c1){_0x35c5c1=_0x35c5c1||0xc8;return function(_0x2136bc){if(_0x2136bc){return _0xa8f4ac[_0x9b46('0x16')](_0x35c5c1)[_0x9b46('0x18')](_0x2136bc);}};}function respondWithFilteredResult(_0x178293,_0xbc1ba6){return function(_0x135cc2){if(_0x135cc2){var _0x1e6911=typeof _0xbc1ba6['offset']==='undefined'&&typeof _0xbc1ba6['limit']===_0x9b46('0x19');var _0x5a380c=_0x135cc2[_0x9b46('0x1a')];var _0x5c5cc9=_0x1e6911?0x0:_0xbc1ba6['offset'];var _0x3d9efa=_0x1e6911?_0x135cc2['count']:_0xbc1ba6['offset']+_0xbc1ba6[_0x9b46('0x1b')];var _0x3a15cc;if(_0x3d9efa>=_0x5a380c){_0x3d9efa=_0x5a380c;_0x3a15cc=0xc8;}else{_0x3a15cc=0xce;}_0x178293['status'](_0x3a15cc);return _0x178293[_0x9b46('0x1c')](_0x9b46('0x1d'),_0x5c5cc9+'-'+_0x3d9efa+'/'+_0x5a380c)['json'](_0x135cc2);}return null;};}function patchUpdates(_0x55aece){return function(_0xbec2ea){try{jsonpatch[_0x9b46('0x1e')](_0xbec2ea,_0x55aece,!![]);}catch(_0x204098){return BPromise['reject'](_0x204098);}return _0xbec2ea['save']();};}function saveUpdates(_0x2b3440,_0x51d2ca){return function(_0x21dacb){if(_0x21dacb){return _0x21dacb[_0x9b46('0x1f')](_0x2b3440)['then'](function(_0xadff19){return _0xadff19;});}return null;};}function removeEntity(_0x5182b1,_0x141cb6){return function(_0x2b6f72){if(_0x2b6f72){return _0x2b6f72['destroy']()[_0x9b46('0x20')](function(){_0x5182b1[_0x9b46('0x16')](0xcc)[_0x9b46('0x17')]();});}};}function handleEntityNotFound(_0x319930,_0x33ea06){return function(_0x3e4899){if(!_0x3e4899){_0x319930[_0x9b46('0x15')](0x194);}return _0x3e4899;};}function handleError(_0x5dc377,_0xdd756c){_0xdd756c=_0xdd756c||0x1f4;return function(_0x3ac37e){logger[_0x9b46('0x21')](_0x3ac37e[_0x9b46('0x22')]);if(_0x3ac37e[_0x9b46('0x23')]){delete _0x3ac37e[_0x9b46('0x23')];}_0x5dc377[_0x9b46('0x16')](_0xdd756c)['send'](_0x3ac37e);};}exports[_0x9b46('0x24')]=function(_0xee519e,_0x3630bf){var _0x376ccc={},_0x28b289={},_0x869993={'count':0x0,'rows':[]};var _0xc062ec=_[_0x9b46('0x25')](db[_0x9b46('0x26')][_0x9b46('0x27')],function(_0x2e1c51){return{'name':_0x2e1c51['fieldName'],'type':_0x2e1c51[_0x9b46('0x28')][_0x9b46('0x29')]};});_0x28b289[_0x9b46('0x2a')]=_[_0x9b46('0x25')](_0xc062ec,_0x9b46('0x23'));_0x28b289[_0x9b46('0x2b')]=_[_0x9b46('0x2c')](_0xee519e[_0x9b46('0x2b')]);_0x28b289[_0x9b46('0x2d')]=_[_0x9b46('0x2e')](_0x28b289[_0x9b46('0x2a')],_0x28b289['query']);_0x376ccc[_0x9b46('0x2f')]=_['intersection'](_0x28b289[_0x9b46('0x2a')],qs[_0x9b46('0x30')](_0xee519e[_0x9b46('0x2b')]['fields']));_0x376ccc[_0x9b46('0x2f')]=_0x376ccc[_0x9b46('0x2f')][_0x9b46('0x31')]?_0x376ccc[_0x9b46('0x2f')]:_0x28b289[_0x9b46('0x2a')];if(!_0xee519e['query']['hasOwnProperty'](_0x9b46('0x32'))){_0x376ccc[_0x9b46('0x1b')]=qs[_0x9b46('0x1b')](_0xee519e[_0x9b46('0x2b')]['limit']);_0x376ccc[_0x9b46('0x33')]=qs['offset'](_0xee519e[_0x9b46('0x2b')][_0x9b46('0x33')]);}_0x376ccc[_0x9b46('0x34')]=qs[_0x9b46('0x35')](_0xee519e['query'][_0x9b46('0x35')]);_0x376ccc['where']=qs[_0x9b46('0x2d')](_[_0x9b46('0x36')](_0xee519e[_0x9b46('0x2b')],_0x28b289[_0x9b46('0x2d')]),_0xc062ec);if(_0xee519e[_0x9b46('0x2b')][_0x9b46('0x37')]){_0x376ccc[_0x9b46('0x38')]=_[_0x9b46('0x39')](_0x376ccc[_0x9b46('0x38')],{'$or':_[_0x9b46('0x25')](_0xc062ec,function(_0x1c4147){if(_0x1c4147['type']!==_0x9b46('0x3a')){var _0x5aac02={};_0x5aac02[_0x1c4147[_0x9b46('0x23')]]={'$like':'%'+_0xee519e[_0x9b46('0x2b')]['filter']+'%'};return _0x5aac02;}})});}_0x376ccc=_[_0x9b46('0x39')]({},_0x376ccc,_0xee519e['options']);var _0x416538={'where':_0x376ccc['where']};return db[_0x9b46('0x26')][_0x9b46('0x1a')](_0x416538)[_0x9b46('0x20')](function(_0x22ab5d){_0x869993[_0x9b46('0x1a')]=_0x22ab5d;if(_0xee519e['query']['includeAll']){_0x376ccc[_0x9b46('0x3b')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x376ccc);})['then'](function(_0x4e1911){_0x869993[_0x9b46('0x3c')]=_0x4e1911;return _0x869993;})['then'](respondWithFilteredResult(_0x3630bf,_0x376ccc))[_0x9b46('0x3d')](handleError(_0x3630bf,null));};exports['show']=function(_0x3fa46c,_0xe807bf){var _0x2e92aa={'raw':!![],'where':{'id':_0x3fa46c[_0x9b46('0x3e')]['id']}},_0xa14b={};_0xa14b[_0x9b46('0x2a')]=_[_0x9b46('0x2c')](db[_0x9b46('0x26')][_0x9b46('0x27')]);_0xa14b['query']=_[_0x9b46('0x2c')](_0x3fa46c[_0x9b46('0x2b')]);_0xa14b[_0x9b46('0x2d')]=_[_0x9b46('0x2e')](_0xa14b[_0x9b46('0x2a')],_0xa14b[_0x9b46('0x2b')]);_0x2e92aa[_0x9b46('0x2f')]=_[_0x9b46('0x2e')](_0xa14b[_0x9b46('0x2a')],qs[_0x9b46('0x30')](_0x3fa46c[_0x9b46('0x2b')][_0x9b46('0x30')]));_0x2e92aa[_0x9b46('0x2f')]=_0x2e92aa[_0x9b46('0x2f')]['length']?_0x2e92aa['attributes']:_0xa14b[_0x9b46('0x2a')];if(_0x3fa46c[_0x9b46('0x2b')][_0x9b46('0x3f')]){_0x2e92aa['include']=[{'all':!![]}];}_0x2e92aa=_['merge']({},_0x2e92aa,_0x3fa46c[_0x9b46('0x40')]);return db[_0x9b46('0x26')][_0x9b46('0x41')](_0x2e92aa)[_0x9b46('0x20')](handleEntityNotFound(_0xe807bf,null))[_0x9b46('0x20')](respondWithResult(_0xe807bf,null))[_0x9b46('0x3d')](handleError(_0xe807bf,null));};exports['create']=function(_0x6d1e73,_0x32e34d){return db[_0x9b46('0x26')]['create'](_0x6d1e73[_0x9b46('0x42')],{})['then'](respondWithResult(_0x32e34d,0xc9))[_0x9b46('0x3d')](handleError(_0x32e34d,null));};exports[_0x9b46('0x1f')]=function(_0x16e6d8,_0x566bad){if(_0x16e6d8[_0x9b46('0x42')]['id']){delete _0x16e6d8[_0x9b46('0x42')]['id'];}return db[_0x9b46('0x26')][_0x9b46('0x41')]({'where':{'id':_0x16e6d8[_0x9b46('0x3e')]['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x566bad,null))['then'](saveUpdates(_0x16e6d8[_0x9b46('0x42')],null))[_0x9b46('0x20')](respondWithResult(_0x566bad,null))[_0x9b46('0x3d')](handleError(_0x566bad,null));};exports[_0x9b46('0x43')]=function(_0x362311,_0x36a492){return db['FreshdeskField'][_0x9b46('0x41')]({'where':{'id':_0x362311['params']['id']}})[_0x9b46('0x20')](handleEntityNotFound(_0x36a492,null))[_0x9b46('0x20')](removeEntity(_0x36a492,null))[_0x9b46('0x3d')](handleError(_0x36a492,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a84520d..7b63a78 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 _0xe27c=['bluebird','request-promise','rimraf','FreshdeskField','int_freshdesk_fields','idField','lodash','util','../../config/logger','api'];(function(_0x4f31f6,_0x5b4cc6){var _0x5a2433=function(_0xbbc174){while(--_0xbbc174){_0x4f31f6['push'](_0x4f31f6['shift']());}};_0x5a2433(++_0x5b4cc6);}(_0xe27c,0xec));var _0xce27=function(_0xa1b7a1,_0x50e094){_0xa1b7a1=_0xa1b7a1-0x0;var _0x4dae95=_0xe27c[_0xa1b7a1];return _0x4dae95;};'use strict';var _=require(_0xce27('0x0'));var util=require(_0xce27('0x1'));var logger=require(_0xce27('0x2'))(_0xce27('0x3'));var moment=require('moment');var BPromise=require(_0xce27('0x4'));var rp=require(_0xce27('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce27('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x42c128,_0x586471){return _0x42c128['define'](_0xce27('0x7'),attributes,{'tableName':_0xce27('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xce27('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x033f=['request-promise','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29b08f,_0x2e5471){var _0x3828de=function(_0x35d791){while(--_0x35d791){_0x29b08f['push'](_0x29b08f['shift']());}};_0x3828de(++_0x2e5471);}(_0x033f,0x135));var _0xf033=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x033f[_0x36fbef];return _0x45e270;};'use strict';var _=require(_0xf033('0x0'));var util=require(_0xf033('0x1'));var logger=require(_0xf033('0x2'))(_0xf033('0x3'));var moment=require(_0xf033('0x4'));var BPromise=require(_0xf033('0x5'));var rp=require(_0xf033('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf033('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xf033('0x8')]=function(_0x488d0e,_0x1824c2){return _0x488d0e[_0xf033('0x9')](_0xf033('0xa'),attributes,{'tableName':_0xf033('0xb'),'paranoid':![],'indexes':[{'name':_0xf033('0xc'),'fields':[_0xf033('0xd'),_0xf033('0xe')],'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 8ada8fa..2c35bf9 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 _0x62aa=['client','http','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','request\x20sent','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47e1a4,_0x4df61e){var _0x4495f6=function(_0x5652cc){while(--_0x5652cc){_0x47e1a4['push'](_0x47e1a4['shift']());}};_0x4495f6(++_0x4df61e);}(_0x62aa,0x17d));var _0xa62a=function(_0xc3e61d,_0x32dcb3){_0xc3e61d=_0xc3e61d-0x0;var _0x4ba832=_0x62aa[_0xc3e61d];return _0x4ba832;};'use strict';var _=require('lodash');var util=require(_0xa62a('0x0'));var moment=require(_0xa62a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa62a('0x2'));var fs=require('fs');var Redis=require(_0xa62a('0x3'));var db=require(_0xa62a('0x4'))['db'];var utils=require(_0xa62a('0x5'));var logger=require(_0xa62a('0x6'))(_0xa62a('0x7'));var config=require(_0xa62a('0x8'));var jayson=require(_0xa62a('0x9'));var client=jayson[_0xa62a('0xa')][_0xa62a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41be1c,_0x5edad8,_0x50ab0d){return new BPromise(function(_0x157eb7,_0x13e7a4){return client['request'](_0x41be1c,_0x50ab0d)[_0xa62a('0xc')](function(_0x197793){logger[_0xa62a('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x5edad8,'request\x20sent');logger[_0xa62a('0xe')](_0xa62a('0xf'),_0x5edad8,'request\x20sent',JSON[_0xa62a('0x10')](_0x197793));if(_0x197793[_0xa62a('0x11')]){if(_0x197793[_0xa62a('0x11')][_0xa62a('0x12')]===0x1f4){logger['error'](_0xa62a('0x13'),_0x5edad8,_0x197793[_0xa62a('0x11')]['message']);return _0x13e7a4(_0x197793['error']['message']);}logger[_0xa62a('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x5edad8,_0x197793[_0xa62a('0x11')]['message']);return _0x157eb7(_0x197793[_0xa62a('0x11')][_0xa62a('0x14')]);}else{logger['info'](_0xa62a('0x13'),_0x5edad8,_0xa62a('0x15'));_0x157eb7(_0x197793[_0xa62a('0x16')][_0xa62a('0x14')]);}})['catch'](function(_0x44fc27){logger[_0xa62a('0x11')](_0xa62a('0x13'),_0x5edad8,_0x44fc27);_0x13e7a4(_0x44fc27);});});} \ No newline at end of file +var _0x3c2a=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4035e1,_0x10b4cd){var _0x1b7fa9=function(_0x5ab5b2){while(--_0x5ab5b2){_0x4035e1['push'](_0x4035e1['shift']());}};_0x1b7fa9(++_0x10b4cd);}(_0x3c2a,0x1b9));var _0xa3c2=function(_0x463800,_0x45ceef){_0x463800=_0x463800-0x0;var _0x3f6a50=_0x3c2a[_0x463800];return _0x3f6a50;};'use strict';var _=require(_0xa3c2('0x0'));var util=require(_0xa3c2('0x1'));var moment=require(_0xa3c2('0x2'));var BPromise=require(_0xa3c2('0x3'));var rs=require(_0xa3c2('0x4'));var fs=require('fs');var Redis=require(_0xa3c2('0x5'));var db=require(_0xa3c2('0x6'))['db'];var utils=require(_0xa3c2('0x7'));var logger=require(_0xa3c2('0x8'))(_0xa3c2('0x9'));var config=require('../../config/environment');var jayson=require(_0xa3c2('0xa'));var client=jayson[_0xa3c2('0xb')][_0xa3c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2823c9,_0x1014cc,_0x40930b){return new BPromise(function(_0x286aca,_0x322f05){return client[_0xa3c2('0xd')](_0x2823c9,_0x40930b)[_0xa3c2('0xe')](function(_0x162796){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x1014cc,_0xa3c2('0xf'));logger[_0xa3c2('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x1014cc,_0xa3c2('0xf'),JSON[_0xa3c2('0x11')](_0x162796));if(_0x162796['error']){if(_0x162796[_0xa3c2('0x12')][_0xa3c2('0x13')]===0x1f4){logger[_0xa3c2('0x12')](_0xa3c2('0x14'),_0x1014cc,_0x162796[_0xa3c2('0x12')][_0xa3c2('0x15')]);return _0x322f05(_0x162796[_0xa3c2('0x12')][_0xa3c2('0x15')]);}logger[_0xa3c2('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x1014cc,_0x162796['error']['message']);return _0x286aca(_0x162796[_0xa3c2('0x12')][_0xa3c2('0x15')]);}else{logger[_0xa3c2('0x16')](_0xa3c2('0x14'),_0x1014cc,_0xa3c2('0xf'));_0x286aca(_0x162796[_0xa3c2('0x17')][_0xa3c2('0x15')]);}})[_0xa3c2('0x18')](function(_0x337b5b){logger['error'](_0xa3c2('0x14'),_0x1014cc,_0x337b5b);_0x322f05(_0x337b5b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0c75910..7374ecc 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 _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x16d2,0x123));var _0x216d=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x16d2[_0x589f71];return _0x5763bd;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router; \ No newline at end of file +var _0x087b=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x396204,_0x595d56){var _0x42497c=function(_0xca8c56){while(--_0xca8c56){_0x396204['push'](_0x396204['shift']());}};_0x42497c(++_0x595d56);}(_0x087b,0x11a));var _0xb087=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x087b[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/fields',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x10')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x10')](_0xb087('0xd'),auth['isAuthenticated'](),controller[_0xb087('0x12')]);router[_0xb087('0x13')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x15')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);module[_0xb087('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c480077..19f9fd9 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 _0xbbbc=['remoteUri','sequelize','exports','STRING','username'];(function(_0x20210f,_0x475e26){var _0x4357c9=function(_0x2d8350){while(--_0x2d8350){_0x20210f['push'](_0x20210f['shift']());}};_0x4357c9(++_0x475e26);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x2e7237,_0x5be71b){_0x2e7237=_0x2e7237-0x0;var _0x2cf3cc=_0xbbbc[_0x2e7237];return _0x2cf3cc;};'use strict';var Sequelize=require(_0xcbbb('0x0'));module[_0xcbbb('0x1')]={'name':{'type':Sequelize[_0xcbbb('0x2')]},'description':{'type':Sequelize[_0xcbbb('0x2')]},'username':{'type':Sequelize[_0xcbbb('0x2')],'unique':_0xcbbb('0x3')},'apiKey':{'type':Sequelize[_0xcbbb('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcbbb('0x4')},'serverUrl':{'type':Sequelize[_0xcbbb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5204=['exports','STRING','username','sequelize'];(function(_0x57bb23,_0x4e8844){var _0x5e7b73=function(_0x5f2df1){while(--_0x5f2df1){_0x57bb23['push'](_0x57bb23['shift']());}};_0x5e7b73(++_0x4e8844);}(_0x5204,0xdf));var _0x4520=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5204[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 98d0e46..70baf22 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 _0x0d8a=['../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','FreshsalesAccount','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getConfigurations','FreshsalesConfiguration','rawAttributes','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','findOne','username','remoteUri','slice','lastIndexOf','%s%s','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4db62f,_0x15a206){var _0xbedd45=function(_0x368276){while(--_0x368276){_0x4db62f['push'](_0x4db62f['shift']());}};_0xbedd45(++_0x15a206);}(_0x0d8a,0x18e));var _0xa0d8=function(_0x23d64b,_0x4fd0a7){_0x23d64b=_0x23d64b-0x0;var _0x1097a3=_0x0d8a[_0x23d64b];return _0x1097a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0d8('0x0'));var zipdir=require(_0xa0d8('0x1'));var jsonpatch=require(_0xa0d8('0x2'));var rp=require(_0xa0d8('0x3'));var moment=require(_0xa0d8('0x4'));var BPromise=require(_0xa0d8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa0d8('0x6'));var csv=require('to-csv');var ejs=require(_0xa0d8('0x7'));var fs=require('fs');var fs_extra=require(_0xa0d8('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0d8('0x9'));var jsforce=require(_0xa0d8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa0d8('0xb'));var querystring=require(_0xa0d8('0xc'));var Papa=require(_0xa0d8('0xd'));var Redis=require(_0xa0d8('0xe'));var authService=require(_0xa0d8('0xf'));var qs=require(_0xa0d8('0x10'));var as=require(_0xa0d8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0d8('0x12'))(_0xa0d8('0x13'));var utils=require(_0xa0d8('0x14'));var config=require(_0xa0d8('0x15'));var licenseUtil=require(_0xa0d8('0x16'));var db=require(_0xa0d8('0x17'))['db'];var integrations=require(_0xa0d8('0x18'));function respondWithStatusCode(_0x5cde67,_0x5206f5){_0x5206f5=_0x5206f5||0xcc;return function(_0x27f694){if(_0x27f694){return _0x5cde67[_0xa0d8('0x19')](_0x5206f5);}return _0x5cde67[_0xa0d8('0x1a')](_0x5206f5)[_0xa0d8('0x1b')]();};}function respondWithResult(_0x3e6ab1,_0x4d7393){_0x4d7393=_0x4d7393||0xc8;return function(_0x36bfe1){if(_0x36bfe1){return _0x3e6ab1['status'](_0x4d7393)[_0xa0d8('0x1c')](_0x36bfe1);}};}function respondWithFilteredResult(_0x18b057,_0x1d0bcd){return function(_0x32249e){if(_0x32249e){var _0x4e5124=typeof _0x1d0bcd['offset']===_0xa0d8('0x1d')&&typeof _0x1d0bcd[_0xa0d8('0x1e')]===_0xa0d8('0x1d');var _0x2eb53f=_0x32249e[_0xa0d8('0x1f')];var _0x5bd3de=_0x4e5124?0x0:_0x1d0bcd[_0xa0d8('0x20')];var _0xb71c2c=_0x4e5124?_0x32249e[_0xa0d8('0x1f')]:_0x1d0bcd[_0xa0d8('0x20')]+_0x1d0bcd[_0xa0d8('0x1e')];var _0x231eee;if(_0xb71c2c>=_0x2eb53f){_0xb71c2c=_0x2eb53f;_0x231eee=0xc8;}else{_0x231eee=0xce;}_0x18b057[_0xa0d8('0x1a')](_0x231eee);return _0x18b057['set'](_0xa0d8('0x21'),_0x5bd3de+'-'+_0xb71c2c+'/'+_0x2eb53f)[_0xa0d8('0x1c')](_0x32249e);}return null;};}function patchUpdates(_0x4b1dad){return function(_0x58accc){try{jsonpatch[_0xa0d8('0x22')](_0x58accc,_0x4b1dad,!![]);}catch(_0x309ba5){return BPromise[_0xa0d8('0x23')](_0x309ba5);}return _0x58accc[_0xa0d8('0x24')]();};}function saveUpdates(_0x103cfc,_0x3d6d73){return function(_0x6dd19f){if(_0x6dd19f){return _0x6dd19f[_0xa0d8('0x25')](_0x103cfc)[_0xa0d8('0x26')](function(_0x3b4ba9){return _0x3b4ba9;});}return null;};}function removeEntity(_0x2aa5e0,_0x2f5e82){return function(_0x122602){if(_0x122602){return _0x122602['destroy']()[_0xa0d8('0x26')](function(){_0x2aa5e0[_0xa0d8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512796,_0x245133){return function(_0xb38c82){if(!_0xb38c82){_0x512796[_0xa0d8('0x19')](0x194);}return _0xb38c82;};}function handleError(_0x469e71,_0x2c9ca5){_0x2c9ca5=_0x2c9ca5||0x1f4;return function(_0x28ad74){logger[_0xa0d8('0x27')](_0x28ad74[_0xa0d8('0x28')]);if(_0x28ad74[_0xa0d8('0x29')]){delete _0x28ad74[_0xa0d8('0x29')];}_0x469e71['status'](_0x2c9ca5)['send'](_0x28ad74);};}exports[_0xa0d8('0x2a')]=function(_0x3e1980,_0x2bd046){var _0x4495ae={},_0x318b91={},_0x3d071e={'count':0x0,'rows':[]};var _0xa3619c=_[_0xa0d8('0x2b')](db[_0xa0d8('0x2c')]['rawAttributes'],function(_0x481ef8){return{'name':_0x481ef8[_0xa0d8('0x2d')],'type':_0x481ef8[_0xa0d8('0x2e')][_0xa0d8('0x2f')]};});_0x318b91[_0xa0d8('0x30')]=_['map'](_0xa3619c,_0xa0d8('0x29'));_0x318b91['query']=_[_0xa0d8('0x31')](_0x3e1980['query']);_0x318b91[_0xa0d8('0x32')]=_[_0xa0d8('0x33')](_0x318b91['model'],_0x318b91[_0xa0d8('0x34')]);_0x4495ae['attributes']=_[_0xa0d8('0x33')](_0x318b91[_0xa0d8('0x30')],qs[_0xa0d8('0x35')](_0x3e1980['query'][_0xa0d8('0x35')]));_0x4495ae[_0xa0d8('0x36')]=_0x4495ae[_0xa0d8('0x36')][_0xa0d8('0x37')]?_0x4495ae['attributes']:_0x318b91[_0xa0d8('0x30')];if(!_0x3e1980[_0xa0d8('0x34')][_0xa0d8('0x38')]('nolimit')){_0x4495ae[_0xa0d8('0x1e')]=qs[_0xa0d8('0x1e')](_0x3e1980[_0xa0d8('0x34')]['limit']);_0x4495ae[_0xa0d8('0x20')]=qs[_0xa0d8('0x20')](_0x3e1980[_0xa0d8('0x34')][_0xa0d8('0x20')]);}_0x4495ae[_0xa0d8('0x39')]=qs['sort'](_0x3e1980['query']['sort']);_0x4495ae[_0xa0d8('0x3a')]=qs[_0xa0d8('0x32')](_[_0xa0d8('0x3b')](_0x3e1980['query'],_0x318b91['filters']),_0xa3619c);if(_0x3e1980['query'][_0xa0d8('0x3c')]){_0x4495ae[_0xa0d8('0x3a')]=_[_0xa0d8('0x3d')](_0x4495ae[_0xa0d8('0x3a')],{'$or':_['map'](_0xa3619c,function(_0x46bf73){if(_0x46bf73['type']!==_0xa0d8('0x3e')){var _0x54f3f1={};_0x54f3f1[_0x46bf73[_0xa0d8('0x29')]]={'$like':'%'+_0x3e1980[_0xa0d8('0x34')][_0xa0d8('0x3c')]+'%'};return _0x54f3f1;}})});}_0x4495ae=_[_0xa0d8('0x3d')]({},_0x4495ae,_0x3e1980[_0xa0d8('0x3f')]);var _0x4193dd={'where':_0x4495ae[_0xa0d8('0x3a')]};return db['FreshsalesAccount'][_0xa0d8('0x1f')](_0x4193dd)['then'](function(_0xd9286d){_0x3d071e['count']=_0xd9286d;if(_0x3e1980[_0xa0d8('0x34')]['includeAll']){_0x4495ae[_0xa0d8('0x40')]=[{'all':!![]}];}return db[_0xa0d8('0x2c')][_0xa0d8('0x41')](_0x4495ae);})[_0xa0d8('0x26')](function(_0x19a367){_0x3d071e[_0xa0d8('0x42')]=_0x19a367;return _0x3d071e;})[_0xa0d8('0x26')](respondWithFilteredResult(_0x2bd046,_0x4495ae))[_0xa0d8('0x43')](handleError(_0x2bd046,null));};exports[_0xa0d8('0x44')]=function(_0x2ccce1,_0x144878){var _0x1d5532={'raw':![],'where':{'id':_0x2ccce1[_0xa0d8('0x45')]['id']}},_0x477179={};_0x477179[_0xa0d8('0x30')]=_[_0xa0d8('0x31')](db[_0xa0d8('0x2c')]['rawAttributes']);_0x477179['query']=_[_0xa0d8('0x31')](_0x2ccce1[_0xa0d8('0x34')]);_0x477179[_0xa0d8('0x32')]=_['intersection'](_0x477179[_0xa0d8('0x30')],_0x477179[_0xa0d8('0x34')]);_0x1d5532[_0xa0d8('0x36')]=_[_0xa0d8('0x33')](_0x477179[_0xa0d8('0x30')],qs[_0xa0d8('0x35')](_0x2ccce1['query'][_0xa0d8('0x35')]));_0x1d5532[_0xa0d8('0x36')]=_0x1d5532[_0xa0d8('0x36')][_0xa0d8('0x37')]?_0x1d5532[_0xa0d8('0x36')]:_0x477179['model'];if(_0x2ccce1['query'][_0xa0d8('0x46')]){_0x1d5532[_0xa0d8('0x40')]=[{'all':!![]}];}_0x1d5532=_[_0xa0d8('0x3d')]({},_0x1d5532,_0x2ccce1['options']);return db['FreshsalesAccount'][_0xa0d8('0x47')](_0x1d5532)['then'](handleEntityNotFound(_0x144878,null))['then'](respondWithResult(_0x144878,null))[_0xa0d8('0x43')](handleError(_0x144878,null));};exports[_0xa0d8('0x48')]=function(_0x25bba3,_0x1bb00a){return db[_0xa0d8('0x2c')][_0xa0d8('0x48')](_0x25bba3[_0xa0d8('0x49')],{})[_0xa0d8('0x26')](respondWithResult(_0x1bb00a,0xc9))[_0xa0d8('0x43')](handleError(_0x1bb00a,null));};exports[_0xa0d8('0x25')]=function(_0x178761,_0x1d5a14){if(_0x178761['body']['id']){delete _0x178761[_0xa0d8('0x49')]['id'];}return db[_0xa0d8('0x2c')][_0xa0d8('0x47')]({'where':{'id':_0x178761[_0xa0d8('0x45')]['id']}})[_0xa0d8('0x26')](handleEntityNotFound(_0x1d5a14,null))[_0xa0d8('0x26')](saveUpdates(_0x178761[_0xa0d8('0x49')],null))['then'](respondWithResult(_0x1d5a14,null))[_0xa0d8('0x43')](handleError(_0x1d5a14,null));};exports[_0xa0d8('0x4a')]=function(_0x3320bd,_0x1baab3){return db[_0xa0d8('0x2c')][_0xa0d8('0x47')]({'where':{'id':_0x3320bd[_0xa0d8('0x45')]['id']}})[_0xa0d8('0x26')](handleEntityNotFound(_0x1baab3,null))[_0xa0d8('0x26')](removeEntity(_0x1baab3,null))[_0xa0d8('0x43')](handleError(_0x1baab3,null));};exports[_0xa0d8('0x4b')]=function(_0x4d8334,_0x8167cc,_0x58ffb8){var _0x2bd57d={};var _0x2189d8={};var _0x33de44;var _0x2a5f9b;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x4d8334[_0xa0d8('0x45')]['id']}})[_0xa0d8('0x26')](handleEntityNotFound(_0x8167cc,null))['then'](function(_0x5885be){if(_0x5885be){_0x33de44=_0x5885be;_0x2189d8[_0xa0d8('0x30')]=_[_0xa0d8('0x31')](db[_0xa0d8('0x4c')][_0xa0d8('0x4d')]);_0x2189d8['query']=_[_0xa0d8('0x31')](_0x4d8334[_0xa0d8('0x34')]);_0x2189d8[_0xa0d8('0x32')]=_[_0xa0d8('0x33')](_0x2189d8[_0xa0d8('0x30')],_0x2189d8[_0xa0d8('0x34')]);_0x2bd57d[_0xa0d8('0x36')]=_[_0xa0d8('0x33')](_0x2189d8[_0xa0d8('0x30')],qs[_0xa0d8('0x35')](_0x4d8334['query']['fields']));_0x2bd57d[_0xa0d8('0x36')]=_0x2bd57d[_0xa0d8('0x36')]['length']?_0x2bd57d['attributes']:_0x2189d8[_0xa0d8('0x30')];_0x2bd57d[_0xa0d8('0x39')]=qs[_0xa0d8('0x4e')](_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x4e')]);_0x2bd57d[_0xa0d8('0x3a')]=qs[_0xa0d8('0x32')](_[_0xa0d8('0x3b')](_0x4d8334[_0xa0d8('0x34')],_0x2189d8['filters']));if(_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x3c')]){_0x2bd57d[_0xa0d8('0x3a')]=_[_0xa0d8('0x3d')](_0x2bd57d[_0xa0d8('0x3a')],{'$or':_[_0xa0d8('0x2b')](_0x2bd57d[_0xa0d8('0x36')],function(_0x50a60c){var _0x217b11={};_0x217b11[_0x50a60c]={'$like':'%'+_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x3c')]+'%'};return _0x217b11;})});}_0x2bd57d=_[_0xa0d8('0x3d')]({},_0x2bd57d,_0x4d8334[_0xa0d8('0x3f')]);return _0x33de44[_0xa0d8('0x4b')](_0x2bd57d);}})['then'](function(_0x4ef284){if(_0x4ef284){_0x2a5f9b=_0x4ef284[_0xa0d8('0x37')];if(!_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x38')](_0xa0d8('0x4f'))){_0x2bd57d['limit']=qs[_0xa0d8('0x1e')](_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x1e')]);_0x2bd57d['offset']=qs[_0xa0d8('0x20')](_0x4d8334[_0xa0d8('0x34')][_0xa0d8('0x20')]);}return _0x33de44[_0xa0d8('0x4b')](_0x2bd57d);}})[_0xa0d8('0x26')](function(_0x2e169c){if(_0x2e169c){return _0x2e169c?{'count':_0x2a5f9b,'rows':_0x2e169c}:null;}})[_0xa0d8('0x26')](respondWithResult(_0x8167cc,null))[_0xa0d8('0x43')](handleError(_0x8167cc,null));};exports[_0xa0d8('0x50')]=function(_0x35937d,_0x2e5e1b,_0x31a928){if(_0x35937d[_0xa0d8('0x49')]['id']){delete _0x35937d[_0xa0d8('0x49')]['id'];}return db[_0xa0d8('0x2c')]['findOne']({'where':{'id':_0x35937d['params']['id']}})[_0xa0d8('0x26')](handleEntityNotFound(_0x2e5e1b,null))[_0xa0d8('0x26')](function(_0x302913){if(_0x302913){_0x35937d[_0xa0d8('0x49')][_0xa0d8('0x51')]=_0x302913['id'];_0x35937d[_0xa0d8('0x49')][_0xa0d8('0x52')]=integrations[_0xa0d8('0x53')](_0x35937d[_0xa0d8('0x49')]['channel'],_0x35937d[_0xa0d8('0x49')][_0xa0d8('0x2e')]);_0x35937d[_0xa0d8('0x49')][_0xa0d8('0x54')]=integrations[_0xa0d8('0x55')](_0x35937d[_0xa0d8('0x49')][_0xa0d8('0x56')],_0x35937d[_0xa0d8('0x49')]['type']);return db[_0xa0d8('0x4c')][_0xa0d8('0x48')](_0x35937d[_0xa0d8('0x49')],{'include':[{'model':db[_0xa0d8('0x57')],'as':_0xa0d8('0x52')},{'model':db[_0xa0d8('0x57')],'as':'Descriptions'}]});}return null;})[_0xa0d8('0x26')](respondWithResult(_0x2e5e1b,null))[_0xa0d8('0x43')](handleError(_0x2e5e1b,null));};exports['getFields']=function(_0x43cae0,_0x5908d3,_0x304132){var _0xbd3cd='';var _0x49409a='';return db[_0xa0d8('0x2c')][_0xa0d8('0x58')]({'where':{'id':_0x43cae0[_0xa0d8('0x45')]['id']},'attributes':['id',_0xa0d8('0x59'),_0xa0d8('0x5a'),'apiKey']})['then'](handleEntityNotFound(_0x5908d3,null))[_0xa0d8('0x26')](function(_0x23d02a){if(_0x23d02a){_0x49409a=_0x23d02a[_0xa0d8('0x59')];_0xbd3cd=_0x23d02a['remoteUri'];var _0x4d56c8=_0x23d02a[_0xa0d8('0x5a')][_0xa0d8('0x5b')](-0x1);if(_0x4d56c8==='/'){_0xbd3cd=_0xbd3cd['substring'](0x0,_0xbd3cd[_0xa0d8('0x5c')](_0x4d56c8));}return rp({'method':'GET','uri':util['format'](_0xa0d8('0x5d'),_0xbd3cd,'/api/selector/owners'),'headers':{'Authorization':_0xa0d8('0x5e')+_0x23d02a[_0xa0d8('0x5f')]},'json':!![]});}})[_0xa0d8('0x26')](function(_0x181f6a){if(_0x181f6a){var _0x3acb1b=_0x181f6a[_0xa0d8('0x60')];var _0x410850=![];var _0x30a0b3=null;for(_0x30a0b3=0x0;_0x30a0b3<_0x3acb1b[_0xa0d8('0x37')];_0x30a0b3++){if(_0x3acb1b[_0x30a0b3][_0xa0d8('0x61')]===_0x49409a){_0x410850=!![];}}if(_0x410850){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa0d8('0x62')});}}})[_0xa0d8('0x26')](respondWithResult(_0x5908d3,null))[_0xa0d8('0x43')](function(_0x21e870){var _0x8b45b=_0x43cae0[_0xa0d8('0x34')][_0xa0d8('0x63')]?0x1f4:_0x21e870[_0xa0d8('0x64')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xa0d8('0x65'),_0x8b45b,JSON[_0xa0d8('0x66')](_0x21e870));delete _0x21e870[_0xa0d8('0x29')];if(_0x8b45b===0x191){_0x8b45b=0x190;}_0x5908d3[_0xa0d8('0x1a')](_0x8b45b)[_0xa0d8('0x67')](_0x43cae0[_0xa0d8('0x34')][_0xa0d8('0x63')]?{'message':_0xa0d8('0x68'),'statusCode':_0x21e870[_0xa0d8('0x64')]}:_0x21e870);});}; \ No newline at end of file +var _0x1d38=['merge','find','create','body','destroy','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','type','FreshsalesConfiguration','FreshsalesField','remoteUri','apiKey','slice','substring','GET','format','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','then','stack','name','send','index','map','FreshsalesAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1d38,0x153));var _0x81d3=function(_0x4ea965,_0x23dd31){_0x4ea965=_0x4ea965-0x0;var _0x14b2ef=_0x1d38[_0x4ea965];return _0x14b2ef;};'use strict';var emlformat=require(_0x81d3('0x0'));var rimraf=require(_0x81d3('0x1'));var zipdir=require(_0x81d3('0x2'));var jsonpatch=require(_0x81d3('0x3'));var rp=require(_0x81d3('0x4'));var moment=require(_0x81d3('0x5'));var BPromise=require(_0x81d3('0x6'));var Mustache=require(_0x81d3('0x7'));var util=require('util');var path=require(_0x81d3('0x8'));var sox=require('sox');var csv=require(_0x81d3('0x9'));var ejs=require(_0x81d3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81d3('0xb'));var squel=require(_0x81d3('0xc'));var crypto=require('crypto');var jsforce=require(_0x81d3('0xd'));var deskjs=require(_0x81d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x81d3('0xf'));var Papa=require(_0x81d3('0x10'));var Redis=require('ioredis');var authService=require(_0x81d3('0x11'));var qs=require(_0x81d3('0x12'));var as=require(_0x81d3('0x13'));var hardwareService=require(_0x81d3('0x14'));var logger=require(_0x81d3('0x15'))(_0x81d3('0x16'));var utils=require(_0x81d3('0x17'));var config=require(_0x81d3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x81d3('0x19'))['db'];var integrations=require(_0x81d3('0x1a'));function respondWithStatusCode(_0x5dba62,_0x5d9a71){_0x5d9a71=_0x5d9a71||0xcc;return function(_0x499499){if(_0x499499){return _0x5dba62[_0x81d3('0x1b')](_0x5d9a71);}return _0x5dba62[_0x81d3('0x1c')](_0x5d9a71)[_0x81d3('0x1d')]();};}function respondWithResult(_0x4a1514,_0x40f4fe){_0x40f4fe=_0x40f4fe||0xc8;return function(_0x40c53e){if(_0x40c53e){return _0x4a1514[_0x81d3('0x1c')](_0x40f4fe)['json'](_0x40c53e);}};}function respondWithFilteredResult(_0xac25f7,_0x522499){return function(_0x547343){if(_0x547343){var _0x4c1bef=typeof _0x522499[_0x81d3('0x1e')]==='undefined'&&typeof _0x522499[_0x81d3('0x1f')]===_0x81d3('0x20');var _0x42742b=_0x547343[_0x81d3('0x21')];var _0x57e1f3=_0x4c1bef?0x0:_0x522499[_0x81d3('0x1e')];var _0x3080df=_0x4c1bef?_0x547343[_0x81d3('0x21')]:_0x522499[_0x81d3('0x1e')]+_0x522499[_0x81d3('0x1f')];var _0x185094;if(_0x3080df>=_0x42742b){_0x3080df=_0x42742b;_0x185094=0xc8;}else{_0x185094=0xce;}_0xac25f7['status'](_0x185094);return _0xac25f7[_0x81d3('0x22')]('Content-Range',_0x57e1f3+'-'+_0x3080df+'/'+_0x42742b)[_0x81d3('0x23')](_0x547343);}return null;};}function patchUpdates(_0x448667){return function(_0x25bcd0){try{jsonpatch[_0x81d3('0x24')](_0x25bcd0,_0x448667,!![]);}catch(_0x1680a8){return BPromise['reject'](_0x1680a8);}return _0x25bcd0[_0x81d3('0x25')]();};}function saveUpdates(_0x57f0aa,_0x4d537e){return function(_0x558590){if(_0x558590){return _0x558590[_0x81d3('0x26')](_0x57f0aa)['then'](function(_0x3ac2d6){return _0x3ac2d6;});}return null;};}function removeEntity(_0x566faf,_0x53971a){return function(_0x53bcaa){if(_0x53bcaa){return _0x53bcaa['destroy']()[_0x81d3('0x27')](function(){_0x566faf[_0x81d3('0x1c')](0xcc)[_0x81d3('0x1d')]();});}};}function handleEntityNotFound(_0x1463e9,_0x11c605){return function(_0x5ed3a6){if(!_0x5ed3a6){_0x1463e9['sendStatus'](0x194);}return _0x5ed3a6;};}function handleError(_0xbadabb,_0xc0f6fa){_0xc0f6fa=_0xc0f6fa||0x1f4;return function(_0x541f18){logger['error'](_0x541f18[_0x81d3('0x28')]);if(_0x541f18['name']){delete _0x541f18[_0x81d3('0x29')];}_0xbadabb[_0x81d3('0x1c')](_0xc0f6fa)[_0x81d3('0x2a')](_0x541f18);};}exports[_0x81d3('0x2b')]=function(_0x3f58f8,_0x59e002){var _0x40a53e={},_0x210ce2={},_0x4bf2f1={'count':0x0,'rows':[]};var _0x3fea3b=_[_0x81d3('0x2c')](db[_0x81d3('0x2d')]['rawAttributes'],function(_0x56cc1c){return{'name':_0x56cc1c[_0x81d3('0x2e')],'type':_0x56cc1c['type'][_0x81d3('0x2f')]};});_0x210ce2[_0x81d3('0x30')]=_[_0x81d3('0x2c')](_0x3fea3b,_0x81d3('0x29'));_0x210ce2[_0x81d3('0x31')]=_[_0x81d3('0x32')](_0x3f58f8['query']);_0x210ce2[_0x81d3('0x33')]=_[_0x81d3('0x34')](_0x210ce2[_0x81d3('0x30')],_0x210ce2['query']);_0x40a53e[_0x81d3('0x35')]=_[_0x81d3('0x34')](_0x210ce2[_0x81d3('0x30')],qs['fields'](_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x36')]));_0x40a53e[_0x81d3('0x35')]=_0x40a53e[_0x81d3('0x35')][_0x81d3('0x37')]?_0x40a53e[_0x81d3('0x35')]:_0x210ce2[_0x81d3('0x30')];if(!_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x38')](_0x81d3('0x39'))){_0x40a53e[_0x81d3('0x1f')]=qs[_0x81d3('0x1f')](_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x1f')]);_0x40a53e[_0x81d3('0x1e')]=qs[_0x81d3('0x1e')](_0x3f58f8['query'][_0x81d3('0x1e')]);}_0x40a53e[_0x81d3('0x3a')]=qs[_0x81d3('0x3b')](_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x3b')]);_0x40a53e[_0x81d3('0x3c')]=qs[_0x81d3('0x33')](_[_0x81d3('0x3d')](_0x3f58f8[_0x81d3('0x31')],_0x210ce2[_0x81d3('0x33')]),_0x3fea3b);if(_0x3f58f8[_0x81d3('0x31')]['filter']){_0x40a53e[_0x81d3('0x3c')]=_['merge'](_0x40a53e[_0x81d3('0x3c')],{'$or':_['map'](_0x3fea3b,function(_0x2c1635){if(_0x2c1635['type']!==_0x81d3('0x3e')){var _0x3a00a8={};_0x3a00a8[_0x2c1635[_0x81d3('0x29')]]={'$like':'%'+_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x3f')]+'%'};return _0x3a00a8;}})});}_0x40a53e=_['merge']({},_0x40a53e,_0x3f58f8[_0x81d3('0x40')]);var _0x60e8eb={'where':_0x40a53e[_0x81d3('0x3c')]};return db[_0x81d3('0x2d')]['count'](_0x60e8eb)[_0x81d3('0x27')](function(_0x44eab5){_0x4bf2f1[_0x81d3('0x21')]=_0x44eab5;if(_0x3f58f8[_0x81d3('0x31')][_0x81d3('0x41')]){_0x40a53e[_0x81d3('0x42')]=[{'all':!![]}];}return db[_0x81d3('0x2d')][_0x81d3('0x43')](_0x40a53e);})[_0x81d3('0x27')](function(_0x54dce2){_0x4bf2f1[_0x81d3('0x44')]=_0x54dce2;return _0x4bf2f1;})[_0x81d3('0x27')](respondWithFilteredResult(_0x59e002,_0x40a53e))[_0x81d3('0x45')](handleError(_0x59e002,null));};exports[_0x81d3('0x46')]=function(_0x140803,_0x319d42){var _0x1cd60e={'raw':![],'where':{'id':_0x140803[_0x81d3('0x47')]['id']}},_0xeb3744={};_0xeb3744[_0x81d3('0x30')]=_[_0x81d3('0x32')](db[_0x81d3('0x2d')][_0x81d3('0x48')]);_0xeb3744[_0x81d3('0x31')]=_[_0x81d3('0x32')](_0x140803['query']);_0xeb3744['filters']=_['intersection'](_0xeb3744[_0x81d3('0x30')],_0xeb3744['query']);_0x1cd60e['attributes']=_[_0x81d3('0x34')](_0xeb3744[_0x81d3('0x30')],qs[_0x81d3('0x36')](_0x140803[_0x81d3('0x31')][_0x81d3('0x36')]));_0x1cd60e[_0x81d3('0x35')]=_0x1cd60e[_0x81d3('0x35')][_0x81d3('0x37')]?_0x1cd60e[_0x81d3('0x35')]:_0xeb3744['model'];if(_0x140803['query']['includeAll']){_0x1cd60e[_0x81d3('0x42')]=[{'all':!![]}];}_0x1cd60e=_[_0x81d3('0x49')]({},_0x1cd60e,_0x140803[_0x81d3('0x40')]);return db[_0x81d3('0x2d')][_0x81d3('0x4a')](_0x1cd60e)['then'](handleEntityNotFound(_0x319d42,null))['then'](respondWithResult(_0x319d42,null))[_0x81d3('0x45')](handleError(_0x319d42,null));};exports[_0x81d3('0x4b')]=function(_0x128c9e,_0x12fcce){return db[_0x81d3('0x2d')][_0x81d3('0x4b')](_0x128c9e[_0x81d3('0x4c')],{})[_0x81d3('0x27')](respondWithResult(_0x12fcce,0xc9))[_0x81d3('0x45')](handleError(_0x12fcce,null));};exports[_0x81d3('0x26')]=function(_0x3d4e61,_0x1873ca){if(_0x3d4e61[_0x81d3('0x4c')]['id']){delete _0x3d4e61['body']['id'];}return db[_0x81d3('0x2d')][_0x81d3('0x4a')]({'where':{'id':_0x3d4e61[_0x81d3('0x47')]['id']}})['then'](handleEntityNotFound(_0x1873ca,null))[_0x81d3('0x27')](saveUpdates(_0x3d4e61[_0x81d3('0x4c')],null))[_0x81d3('0x27')](respondWithResult(_0x1873ca,null))[_0x81d3('0x45')](handleError(_0x1873ca,null));};exports[_0x81d3('0x4d')]=function(_0x4dd070,_0x5ab9e9){return db['FreshsalesAccount'][_0x81d3('0x4a')]({'where':{'id':_0x4dd070[_0x81d3('0x47')]['id']}})[_0x81d3('0x27')](handleEntityNotFound(_0x5ab9e9,null))[_0x81d3('0x27')](removeEntity(_0x5ab9e9,null))[_0x81d3('0x45')](handleError(_0x5ab9e9,null));};exports['getConfigurations']=function(_0x5ec813,_0x4ffa9d,_0x5ba95a){var _0xa55533={};var _0x10e905={};var _0x5e7c47;var _0x51ce94;return db[_0x81d3('0x2d')]['findOne']({'where':{'id':_0x5ec813[_0x81d3('0x47')]['id']}})[_0x81d3('0x27')](handleEntityNotFound(_0x4ffa9d,null))[_0x81d3('0x27')](function(_0x50cfe9){if(_0x50cfe9){_0x5e7c47=_0x50cfe9;_0x10e905[_0x81d3('0x30')]=_[_0x81d3('0x32')](db['FreshsalesConfiguration'][_0x81d3('0x48')]);_0x10e905['query']=_[_0x81d3('0x32')](_0x5ec813[_0x81d3('0x31')]);_0x10e905[_0x81d3('0x33')]=_[_0x81d3('0x34')](_0x10e905[_0x81d3('0x30')],_0x10e905['query']);_0xa55533['attributes']=_[_0x81d3('0x34')](_0x10e905[_0x81d3('0x30')],qs[_0x81d3('0x36')](_0x5ec813[_0x81d3('0x31')][_0x81d3('0x36')]));_0xa55533['attributes']=_0xa55533[_0x81d3('0x35')][_0x81d3('0x37')]?_0xa55533[_0x81d3('0x35')]:_0x10e905[_0x81d3('0x30')];_0xa55533[_0x81d3('0x3a')]=qs[_0x81d3('0x3b')](_0x5ec813[_0x81d3('0x31')][_0x81d3('0x3b')]);_0xa55533['where']=qs[_0x81d3('0x33')](_[_0x81d3('0x3d')](_0x5ec813[_0x81d3('0x31')],_0x10e905[_0x81d3('0x33')]));if(_0x5ec813[_0x81d3('0x31')][_0x81d3('0x3f')]){_0xa55533[_0x81d3('0x3c')]=_[_0x81d3('0x49')](_0xa55533['where'],{'$or':_[_0x81d3('0x2c')](_0xa55533[_0x81d3('0x35')],function(_0x29a129){var _0x4b3c5b={};_0x4b3c5b[_0x29a129]={'$like':'%'+_0x5ec813[_0x81d3('0x31')][_0x81d3('0x3f')]+'%'};return _0x4b3c5b;})});}_0xa55533=_[_0x81d3('0x49')]({},_0xa55533,_0x5ec813[_0x81d3('0x40')]);return _0x5e7c47['getConfigurations'](_0xa55533);}})[_0x81d3('0x27')](function(_0x402709){if(_0x402709){_0x51ce94=_0x402709[_0x81d3('0x37')];if(!_0x5ec813['query'][_0x81d3('0x38')](_0x81d3('0x39'))){_0xa55533['limit']=qs[_0x81d3('0x1f')](_0x5ec813[_0x81d3('0x31')][_0x81d3('0x1f')]);_0xa55533[_0x81d3('0x1e')]=qs[_0x81d3('0x1e')](_0x5ec813[_0x81d3('0x31')][_0x81d3('0x1e')]);}return _0x5e7c47[_0x81d3('0x4e')](_0xa55533);}})['then'](function(_0x4a7064){if(_0x4a7064){return _0x4a7064?{'count':_0x51ce94,'rows':_0x4a7064}:null;}})[_0x81d3('0x27')](respondWithResult(_0x4ffa9d,null))[_0x81d3('0x45')](handleError(_0x4ffa9d,null));};exports[_0x81d3('0x4f')]=function(_0x1b1a1c,_0x286ef7,_0x3a0f65){if(_0x1b1a1c[_0x81d3('0x4c')]['id']){delete _0x1b1a1c[_0x81d3('0x4c')]['id'];}return db[_0x81d3('0x2d')][_0x81d3('0x50')]({'where':{'id':_0x1b1a1c[_0x81d3('0x47')]['id']}})['then'](handleEntityNotFound(_0x286ef7,null))[_0x81d3('0x27')](function(_0x55f99a){if(_0x55f99a){_0x1b1a1c[_0x81d3('0x4c')]['AccountId']=_0x55f99a['id'];_0x1b1a1c['body'][_0x81d3('0x51')]=integrations[_0x81d3('0x52')](_0x1b1a1c[_0x81d3('0x4c')]['channel'],_0x1b1a1c[_0x81d3('0x4c')]['type']);_0x1b1a1c[_0x81d3('0x4c')][_0x81d3('0x53')]=integrations[_0x81d3('0x54')](_0x1b1a1c[_0x81d3('0x4c')]['channel'],_0x1b1a1c[_0x81d3('0x4c')][_0x81d3('0x55')]);return db[_0x81d3('0x56')][_0x81d3('0x4b')](_0x1b1a1c[_0x81d3('0x4c')],{'include':[{'model':db[_0x81d3('0x57')],'as':'Subjects'},{'model':db[_0x81d3('0x57')],'as':_0x81d3('0x53')}]});}return null;})[_0x81d3('0x27')](respondWithResult(_0x286ef7,null))[_0x81d3('0x45')](handleError(_0x286ef7,null));};exports['getFields']=function(_0x13215e,_0x540e1a,_0x3b6927){var _0xd79683='';var _0x1603e2='';return db['FreshsalesAccount'][_0x81d3('0x50')]({'where':{'id':_0x13215e['params']['id']},'attributes':['id','username',_0x81d3('0x58'),_0x81d3('0x59')]})[_0x81d3('0x27')](handleEntityNotFound(_0x540e1a,null))[_0x81d3('0x27')](function(_0x4ce90f){if(_0x4ce90f){_0x1603e2=_0x4ce90f['username'];_0xd79683=_0x4ce90f['remoteUri'];var _0x514247=_0x4ce90f[_0x81d3('0x58')][_0x81d3('0x5a')](-0x1);if(_0x514247==='/'){_0xd79683=_0xd79683[_0x81d3('0x5b')](0x0,_0xd79683['lastIndexOf'](_0x514247));}return rp({'method':_0x81d3('0x5c'),'uri':util[_0x81d3('0x5d')]('%s%s',_0xd79683,_0x81d3('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x4ce90f[_0x81d3('0x59')]},'json':!![]});}})[_0x81d3('0x27')](function(_0x2e6ee3){if(_0x2e6ee3){var _0x53d6aa=_0x2e6ee3[_0x81d3('0x5f')];var _0x5a6c63=![];var _0x15c36c=null;for(_0x15c36c=0x0;_0x15c36c<_0x53d6aa[_0x81d3('0x37')];_0x15c36c++){if(_0x53d6aa[_0x15c36c][_0x81d3('0x60')]===_0x1603e2){_0x5a6c63=!![];}}if(_0x5a6c63){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x81d3('0x61')});}}})[_0x81d3('0x27')](respondWithResult(_0x540e1a,null))['catch'](function(_0x5c96fa){var _0x293afe=_0x13215e[_0x81d3('0x31')][_0x81d3('0x62')]?0x1f4:_0x5c96fa[_0x81d3('0x63')]||0x1f4;logger['error'](_0x81d3('0x64'),_0x81d3('0x65'),_0x293afe,JSON['stringify'](_0x5c96fa));delete _0x5c96fa[_0x81d3('0x29')];if(_0x293afe===0x191){_0x293afe=0x190;}_0x540e1a['status'](_0x293afe)[_0x81d3('0x2a')](_0x13215e['query'][_0x81d3('0x62')]?{'message':_0x81d3('0x66'),'statusCode':_0x5c96fa[_0x81d3('0x63')]}:_0x5c96fa);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index fd99fde..5cf5b20 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 _0x1623=['path','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x5e2bdd,_0x20233c){var _0x1bd497=function(_0x19c8a1){while(--_0x19c8a1){_0x5e2bdd['push'](_0x5e2bdd['shift']());}};_0x1bd497(++_0x20233c);}(_0x1623,0xab));var _0x3162=function(_0x5aa9b2,_0x2db983){_0x5aa9b2=_0x5aa9b2-0x0;var _0x1f4d94=_0x1623[_0x5aa9b2];return _0x1f4d94;};'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'));var integrations=require('../../components/integrations/configuration');module[_0x3162('0x7')]=function(_0x428de6,_0x53260d){return _0x428de6[_0x3162('0x8')](_0x3162('0x9'),attributes,{'tableName':_0x3162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x46652d,_0x37f677){_0x46652d=_0x46652d-0x0;var _0x175796=_0x3f8a[_0x46652d];return _0x175796;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'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 5650ef7..68b09ea 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 _0x6a55=['client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x2fc5d5,_0x1e2a88){var _0x467aca=function(_0x514587){while(--_0x514587){_0x2fc5d5['push'](_0x2fc5d5['shift']());}};_0x467aca(++_0x1e2a88);}(_0x6a55,0xdb));var _0x56a5=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x6a55[_0x2136a6];return _0x55b948;};'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['FreshsalesAccount'][_0x56a5('0x14')]({'raw':_0x28fe74[_0x56a5('0x15')]?_0x28fe74[_0x56a5('0x15')][_0x56a5('0x16')]===undefined?!![]:![]:!![],'where':_0x28fe74['options']?_0x28fe74[_0x56a5('0x15')][_0x56a5('0x17')]||null:null,'attributes':_0x28fe74[_0x56a5('0x15')]?_0x28fe74[_0x56a5('0x15')][_0x56a5('0x18')]||null:null,'limit':_0x28fe74['options']?_0x28fe74['options'][_0x56a5('0x19')]||null:null,'include':_0x28fe74[_0x56a5('0x15')]?_0x28fe74['options'][_0x56a5('0x1a')]?_[_0x56a5('0x1b')](_0x28fe74[_0x56a5('0x15')][_0x56a5('0x1a')],function(_0xe1ded0){return{'model':db[_0xe1ded0[_0x56a5('0x1c')]],'as':_0xe1ded0['as'],'attributes':_0xe1ded0[_0x56a5('0x18')],'include':_0xe1ded0[_0x56a5('0x1a')]?_[_0x56a5('0x1b')](_0xe1ded0[_0x56a5('0x1a')],function(_0xcf212){return{'model':db[_0xcf212[_0x56a5('0x1c')]],'as':_0xcf212['as'],'attributes':_0xcf212[_0x56a5('0x18')],'include':_0xcf212['include']?_[_0x56a5('0x1b')](_0xcf212[_0x56a5('0x1a')],function(_0x42cd45){return{'model':db[_0x42cd45[_0x56a5('0x1c')]],'as':_0x42cd45['as'],'attributes':_0x42cd45[_0x56a5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18e863){logger['info'](_0x56a5('0x13'),_0x28fe74);logger[_0x56a5('0xb')](_0x56a5('0x13'),_0x28fe74,JSON[_0x56a5('0xd')](_0x18e863));_0x143f3d(_0x18e863);})['catch'](function(_0x3b55e6){logger[_0x56a5('0xf')](_0x56a5('0x13'),_0x3b55e6['message'],_0x28fe74);_0x1dddec(_0x1ba472[_0x56a5('0xf')](0x1f4,_0x3b55e6[_0x56a5('0x10')]));});});};exports[_0x56a5('0x1d')]=function(_0x214649){var _0x55978e=this;return new Promise(function(_0x4e1a6b,_0x78b2b1){return db[_0x56a5('0x1e')][_0x56a5('0x1f')]({'raw':_0x214649[_0x56a5('0x15')]?_0x214649[_0x56a5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x214649['options']?_0x214649[_0x56a5('0x15')][_0x56a5('0x17')]||null:null,'attributes':_0x214649[_0x56a5('0x15')]?_0x214649['options'][_0x56a5('0x18')]||null:null,'include':_0x214649[_0x56a5('0x15')]?_0x214649['options']['include']?_['map'](_0x214649['options'][_0x56a5('0x1a')],function(_0x29c8f1){return{'model':db[_0x29c8f1[_0x56a5('0x1c')]],'as':_0x29c8f1['as'],'attributes':_0x29c8f1['attributes'],'include':_0x29c8f1[_0x56a5('0x1a')]?_['map'](_0x29c8f1[_0x56a5('0x1a')],function(_0x2a1d66){return{'model':db[_0x2a1d66['model']],'as':_0x2a1d66['as'],'attributes':_0x2a1d66[_0x56a5('0x18')],'include':_0x2a1d66['include']?_[_0x56a5('0x1b')](_0x2a1d66[_0x56a5('0x1a')],function(_0x3798f8){return{'model':db[_0x3798f8['model']],'as':_0x3798f8['as'],'attributes':_0x3798f8[_0x56a5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x56a5('0x7')](function(_0x4240eb){logger['info'](_0x56a5('0x1d'),_0x214649);logger[_0x56a5('0xb')](_0x56a5('0x1d'),_0x214649,JSON[_0x56a5('0xd')](_0x4240eb));_0x4e1a6b(_0x4240eb);})[_0x56a5('0x12')](function(_0x594b14){logger['error'](_0x56a5('0x1d'),_0x594b14[_0x56a5('0x10')],_0x214649);_0x78b2b1(_0x55978e[_0x56a5('0xf')](0x1f4,_0x594b14[_0x56a5('0x10')]));});});}; \ No newline at end of file +var _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5bc75f,_0x230e2c){var _0x163842=function(_0x5357d9){while(--_0x5357d9){_0x5bc75f['push'](_0x5bc75f['shift']());}};_0x163842(++_0x230e2c);}(_0x3a6d,0x143));var _0xd3a6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3a6d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b2b04e3..40ce8a9 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 _0x38bb=['./intFreshsalesConfiguration.controller','/:id','show','isAuthenticated','getDescriptions','get','/:id/fields','getFields','post','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x2f711a,_0x1f8813){var _0x544f7d=function(_0x298c70){while(--_0x298c70){_0x2f711a['push'](_0x2f711a['shift']());}};_0x544f7d(++_0x1f8813);}(_0x38bb,0x14c));var _0xb38b=function(_0x5b6ce6,_0x580eef){_0x5b6ce6=_0x5b6ce6-0x0;var _0x30ac56=_0x38bb[_0x5b6ce6];return _0x30ac56;};'use strict';var multer=require(_0xb38b('0x0'));var util=require(_0xb38b('0x1'));var path=require(_0xb38b('0x2'));var timeout=require(_0xb38b('0x3'));var express=require(_0xb38b('0x4'));var router=express[_0xb38b('0x5')]();var fs_extra=require(_0xb38b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb38b('0x7'));var controller=require(_0xb38b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb38b('0x9'),auth['isAuthenticated'](),controller[_0xb38b('0xa')]);router['get']('/:id/subjects',auth[_0xb38b('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xb38b('0xb')](),controller[_0xb38b('0xc')]);router[_0xb38b('0xd')](_0xb38b('0xe'),auth[_0xb38b('0xb')](),controller[_0xb38b('0xf')]);router[_0xb38b('0x10')]('/',auth['isAuthenticated'](),controller[_0xb38b('0x11')]);router['put'](_0xb38b('0x9'),auth[_0xb38b('0xb')](),controller[_0xb38b('0x12')]);router['delete'](_0xb38b('0x9'),auth[_0xb38b('0xb')](),controller[_0xb38b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2489=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x2489,0x65));var _0x9248=function(_0x2f2dbf,_0x44b6fa){_0x2f2dbf=_0x2f2dbf-0x0;var _0x3fa04c=_0x2489[_0x2f2dbf];return _0x3fa04c;};'use strict';var multer=require(_0x9248('0x0'));var util=require(_0x9248('0x1'));var path=require(_0x9248('0x2'));var timeout=require(_0x9248('0x3'));var express=require(_0x9248('0x4'));var router=express[_0x9248('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9248('0x6'));var controller=require(_0x9248('0x7'));router[_0x9248('0x8')]('/',auth[_0x9248('0x9')](),controller[_0x9248('0xa')]);router['get'](_0x9248('0xb'),auth[_0x9248('0x9')](),controller[_0x9248('0xc')]);router[_0x9248('0x8')](_0x9248('0xd'),auth[_0x9248('0x9')](),controller[_0x9248('0xe')]);router[_0x9248('0x8')](_0x9248('0xf'),auth[_0x9248('0x9')](),controller[_0x9248('0x10')]);router[_0x9248('0x8')](_0x9248('0x11'),auth[_0x9248('0x9')](),controller['getFields']);router[_0x9248('0x12')]('/',auth[_0x9248('0x9')](),controller[_0x9248('0x13')]);router[_0x9248('0x14')](_0x9248('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9248('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9248('0x16')]);module[_0x9248('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 701d8e2..845f25a 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 _0xb17b=['exports','STRING','sequelize'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xb17b,0x1ca));var _0xbb17=function(_0xbfaf0f,_0x36a3f6){_0xbfaf0f=_0xbfaf0f-0x0;var _0x524592=_0xb17b[_0xbfaf0f];return _0x524592;};'use strict';var Sequelize=require(_0xbb17('0x0'));module[_0xbb17('0x1')]={'name':{'type':Sequelize[_0xbb17('0x2')]},'description':{'type':Sequelize[_0xbb17('0x2')]}}; \ No newline at end of file +var _0xcf05=['sequelize','exports','STRING'];(function(_0x43e843,_0x280ca3){var _0x1657b7=function(_0x1ee48c){while(--_0x1ee48c){_0x43e843['push'](_0x43e843['shift']());}};_0x1657b7(++_0x280ca3);}(_0xcf05,0xed));var _0x5cf0=function(_0x518e48,_0x320c6a){_0x518e48=_0x518e48-0x0;var _0x1cb891=_0xcf05[_0x518e48];return _0x1cb891;};'use strict';var Sequelize=require(_0x5cf0('0x0'));module[_0x5cf0('0x1')]={'name':{'type':Sequelize[_0x5cf0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 889b0cd..013c852 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 _0x31d9=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','FreshsalesConfiguration','findAll','rows','catch','show','params','include','find','create','body','destroy','getSubjects','FreshsalesField','order','hasOwnProperty','findOne','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x31d9,0x197));var _0x931d=function(_0x257a01,_0x143777){_0x257a01=_0x257a01-0x0;var _0xc2cd98=_0x31d9[_0x257a01];return _0xc2cd98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x931d('0x0'));var zipdir=require(_0x931d('0x1'));var jsonpatch=require(_0x931d('0x2'));var rp=require(_0x931d('0x3'));var moment=require(_0x931d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x931d('0x5'));var util=require(_0x931d('0x6'));var path=require(_0x931d('0x7'));var sox=require('sox');var csv=require(_0x931d('0x8'));var ejs=require(_0x931d('0x9'));var fs=require('fs');var fs_extra=require(_0x931d('0xa'));var _=require('lodash');var squel=require(_0x931d('0xb'));var crypto=require(_0x931d('0xc'));var jsforce=require(_0x931d('0xd'));var deskjs=require(_0x931d('0xe'));var toCsv=require(_0x931d('0x8'));var querystring=require('querystring');var Papa=require(_0x931d('0xf'));var Redis=require('ioredis');var authService=require(_0x931d('0x10'));var qs=require(_0x931d('0x11'));var as=require(_0x931d('0x12'));var hardwareService=require(_0x931d('0x13'));var logger=require(_0x931d('0x14'))('api');var utils=require(_0x931d('0x15'));var config=require(_0x931d('0x16'));var licenseUtil=require(_0x931d('0x17'));var db=require(_0x931d('0x18'))['db'];function respondWithStatusCode(_0x19a77b,_0x22c355){_0x22c355=_0x22c355||0xcc;return function(_0x56ceaf){if(_0x56ceaf){return _0x19a77b[_0x931d('0x19')](_0x22c355);}return _0x19a77b[_0x931d('0x1a')](_0x22c355)['end']();};}function respondWithResult(_0x19b5e3,_0x721ecd){_0x721ecd=_0x721ecd||0xc8;return function(_0x2195b7){if(_0x2195b7){return _0x19b5e3[_0x931d('0x1a')](_0x721ecd)[_0x931d('0x1b')](_0x2195b7);}};}function respondWithFilteredResult(_0x353b41,_0x18a581){return function(_0x398549){if(_0x398549){var _0x2ebb79=typeof _0x18a581[_0x931d('0x1c')]===_0x931d('0x1d')&&typeof _0x18a581[_0x931d('0x1e')]===_0x931d('0x1d');var _0x1b8a30=_0x398549[_0x931d('0x1f')];var _0x5cb6b9=_0x2ebb79?0x0:_0x18a581[_0x931d('0x1c')];var _0x498313=_0x2ebb79?_0x398549['count']:_0x18a581[_0x931d('0x1c')]+_0x18a581[_0x931d('0x1e')];var _0x41397e;if(_0x498313>=_0x1b8a30){_0x498313=_0x1b8a30;_0x41397e=0xc8;}else{_0x41397e=0xce;}_0x353b41['status'](_0x41397e);return _0x353b41['set'](_0x931d('0x20'),_0x5cb6b9+'-'+_0x498313+'/'+_0x1b8a30)[_0x931d('0x1b')](_0x398549);}return null;};}function patchUpdates(_0x47127b){return function(_0x370fb2){try{jsonpatch[_0x931d('0x21')](_0x370fb2,_0x47127b,!![]);}catch(_0x2058ca){return BPromise[_0x931d('0x22')](_0x2058ca);}return _0x370fb2['save']();};}function saveUpdates(_0x5a0f5c,_0xdb122d){return function(_0x4f4756){if(_0x4f4756){return _0x4f4756[_0x931d('0x23')](_0x5a0f5c)[_0x931d('0x24')](function(_0xaa2197){return _0xaa2197;});}return null;};}function removeEntity(_0x36cc6f,_0x57540d){return function(_0x72f94a){if(_0x72f94a){return _0x72f94a['destroy']()[_0x931d('0x24')](function(){_0x36cc6f['status'](0xcc)[_0x931d('0x25')]();});}};}function handleEntityNotFound(_0x4efd17,_0x2fbc34){return function(_0x4f1afb){if(!_0x4f1afb){_0x4efd17[_0x931d('0x19')](0x194);}return _0x4f1afb;};}function handleError(_0x538ad0,_0x3c1c74){_0x3c1c74=_0x3c1c74||0x1f4;return function(_0x354bef){logger['error'](_0x354bef[_0x931d('0x26')]);if(_0x354bef[_0x931d('0x27')]){delete _0x354bef['name'];}_0x538ad0['status'](_0x3c1c74)[_0x931d('0x28')](_0x354bef);};}exports[_0x931d('0x29')]=function(_0x15b300,_0x5a66f9){var _0xfb3730={},_0x37703f={},_0x2f3665={'count':0x0,'rows':[]};var _0x68505=_[_0x931d('0x2a')](db['FreshsalesConfiguration'][_0x931d('0x2b')],function(_0x4547b7){return{'name':_0x4547b7[_0x931d('0x2c')],'type':_0x4547b7['type'][_0x931d('0x2d')]};});_0x37703f[_0x931d('0x2e')]=_[_0x931d('0x2a')](_0x68505,_0x931d('0x27'));_0x37703f['query']=_[_0x931d('0x2f')](_0x15b300[_0x931d('0x30')]);_0x37703f[_0x931d('0x31')]=_[_0x931d('0x32')](_0x37703f[_0x931d('0x2e')],_0x37703f[_0x931d('0x30')]);_0xfb3730['attributes']=_[_0x931d('0x32')](_0x37703f[_0x931d('0x2e')],qs['fields'](_0x15b300['query'][_0x931d('0x33')]));_0xfb3730[_0x931d('0x34')]=_0xfb3730['attributes'][_0x931d('0x35')]?_0xfb3730['attributes']:_0x37703f[_0x931d('0x2e')];if(!_0x15b300[_0x931d('0x30')]['hasOwnProperty'](_0x931d('0x36'))){_0xfb3730['limit']=qs['limit'](_0x15b300['query']['limit']);_0xfb3730[_0x931d('0x1c')]=qs['offset'](_0x15b300[_0x931d('0x30')][_0x931d('0x1c')]);}_0xfb3730['order']=qs['sort'](_0x15b300[_0x931d('0x30')][_0x931d('0x37')]);_0xfb3730[_0x931d('0x38')]=qs[_0x931d('0x31')](_[_0x931d('0x39')](_0x15b300[_0x931d('0x30')],_0x37703f[_0x931d('0x31')]),_0x68505);if(_0x15b300[_0x931d('0x30')]['filter']){_0xfb3730[_0x931d('0x38')]=_[_0x931d('0x3a')](_0xfb3730['where'],{'$or':_[_0x931d('0x2a')](_0x68505,function(_0x32e3df){if(_0x32e3df[_0x931d('0x3b')]!==_0x931d('0x3c')){var _0x2ddee4={};_0x2ddee4[_0x32e3df['name']]={'$like':'%'+_0x15b300[_0x931d('0x30')][_0x931d('0x3d')]+'%'};return _0x2ddee4;}})});}_0xfb3730=_['merge']({},_0xfb3730,_0x15b300[_0x931d('0x3e')]);var _0x8a8410={'where':_0xfb3730[_0x931d('0x38')]};return db['FreshsalesConfiguration'][_0x931d('0x1f')](_0x8a8410)[_0x931d('0x24')](function(_0x449d63){_0x2f3665['count']=_0x449d63;if(_0x15b300[_0x931d('0x30')][_0x931d('0x3f')]){_0xfb3730['include']=[{'all':!![]}];}return db[_0x931d('0x40')][_0x931d('0x41')](_0xfb3730);})['then'](function(_0x30e074){_0x2f3665[_0x931d('0x42')]=_0x30e074;return _0x2f3665;})[_0x931d('0x24')](respondWithFilteredResult(_0x5a66f9,_0xfb3730))[_0x931d('0x43')](handleError(_0x5a66f9,null));};exports[_0x931d('0x44')]=function(_0x30ada8,_0x15cc88){var _0x36a53e={'raw':![],'where':{'id':_0x30ada8[_0x931d('0x45')]['id']}},_0x8a9ccf={};_0x8a9ccf[_0x931d('0x2e')]=_[_0x931d('0x2f')](db[_0x931d('0x40')][_0x931d('0x2b')]);_0x8a9ccf['query']=_[_0x931d('0x2f')](_0x30ada8[_0x931d('0x30')]);_0x8a9ccf['filters']=_[_0x931d('0x32')](_0x8a9ccf[_0x931d('0x2e')],_0x8a9ccf[_0x931d('0x30')]);_0x36a53e['attributes']=_['intersection'](_0x8a9ccf['model'],qs['fields'](_0x30ada8[_0x931d('0x30')][_0x931d('0x33')]));_0x36a53e[_0x931d('0x34')]=_0x36a53e['attributes'][_0x931d('0x35')]?_0x36a53e[_0x931d('0x34')]:_0x8a9ccf[_0x931d('0x2e')];if(_0x30ada8['query'][_0x931d('0x3f')]){_0x36a53e[_0x931d('0x46')]=[{'all':!![]}];}_0x36a53e=_[_0x931d('0x3a')]({},_0x36a53e,_0x30ada8[_0x931d('0x3e')]);return db[_0x931d('0x40')][_0x931d('0x47')](_0x36a53e)[_0x931d('0x24')](handleEntityNotFound(_0x15cc88,null))[_0x931d('0x24')](respondWithResult(_0x15cc88,null))['catch'](handleError(_0x15cc88,null));};exports[_0x931d('0x48')]=function(_0x4d78e8,_0x366e95){return db['FreshsalesConfiguration'][_0x931d('0x48')](_0x4d78e8[_0x931d('0x49')],{})[_0x931d('0x24')](respondWithResult(_0x366e95,0xc9))[_0x931d('0x43')](handleError(_0x366e95,null));};exports[_0x931d('0x23')]=function(_0x58bf95,_0x689778){if(_0x58bf95[_0x931d('0x49')]['id']){delete _0x58bf95[_0x931d('0x49')]['id'];}return db[_0x931d('0x40')][_0x931d('0x47')]({'where':{'id':_0x58bf95['params']['id']}})['then'](handleEntityNotFound(_0x689778,null))[_0x931d('0x24')](saveUpdates(_0x58bf95[_0x931d('0x49')],null))['then'](respondWithResult(_0x689778,null))[_0x931d('0x43')](handleError(_0x689778,null));};exports[_0x931d('0x4a')]=function(_0x3f81f9,_0x1b0bf2){return db[_0x931d('0x40')][_0x931d('0x47')]({'where':{'id':_0x3f81f9['params']['id']}})[_0x931d('0x24')](handleEntityNotFound(_0x1b0bf2,null))[_0x931d('0x24')](removeEntity(_0x1b0bf2,null))['catch'](handleError(_0x1b0bf2,null));};exports[_0x931d('0x4b')]=function(_0x2c15a0,_0x574195,_0xbd49b7){var _0x46a60d={};var _0x438cea={};var _0x2c14db;var _0x469632;return db[_0x931d('0x40')]['findOne']({'where':{'id':_0x2c15a0['params']['id']}})[_0x931d('0x24')](handleEntityNotFound(_0x574195,null))['then'](function(_0x1b44a8){if(_0x1b44a8){_0x2c14db=_0x1b44a8;_0x438cea[_0x931d('0x2e')]=_[_0x931d('0x2f')](db[_0x931d('0x4c')][_0x931d('0x2b')]);_0x438cea[_0x931d('0x30')]=_[_0x931d('0x2f')](_0x2c15a0[_0x931d('0x30')]);_0x438cea[_0x931d('0x31')]=_[_0x931d('0x32')](_0x438cea['model'],_0x438cea[_0x931d('0x30')]);_0x46a60d['attributes']=_['intersection'](_0x438cea[_0x931d('0x2e')],qs[_0x931d('0x33')](_0x2c15a0[_0x931d('0x30')]['fields']));_0x46a60d[_0x931d('0x34')]=_0x46a60d['attributes']['length']?_0x46a60d['attributes']:_0x438cea[_0x931d('0x2e')];_0x46a60d[_0x931d('0x4d')]=qs[_0x931d('0x37')](_0x2c15a0[_0x931d('0x30')]['sort']);_0x46a60d[_0x931d('0x38')]=qs[_0x931d('0x31')](_[_0x931d('0x39')](_0x2c15a0['query'],_0x438cea[_0x931d('0x31')]));if(_0x2c15a0[_0x931d('0x30')][_0x931d('0x3d')]){_0x46a60d[_0x931d('0x38')]=_[_0x931d('0x3a')](_0x46a60d[_0x931d('0x38')],{'$or':_[_0x931d('0x2a')](_0x46a60d['attributes'],function(_0x252654){var _0x530a68={};_0x530a68[_0x252654]={'$like':'%'+_0x2c15a0[_0x931d('0x30')]['filter']+'%'};return _0x530a68;})});}_0x46a60d=_[_0x931d('0x3a')]({},_0x46a60d,_0x2c15a0[_0x931d('0x3e')]);return _0x2c14db[_0x931d('0x4b')](_0x46a60d);}})[_0x931d('0x24')](function(_0x1f2195){if(_0x1f2195){_0x469632=_0x1f2195[_0x931d('0x35')];if(!_0x2c15a0[_0x931d('0x30')][_0x931d('0x4e')](_0x931d('0x36'))){_0x46a60d['limit']=qs['limit'](_0x2c15a0[_0x931d('0x30')][_0x931d('0x1e')]);_0x46a60d['offset']=qs[_0x931d('0x1c')](_0x2c15a0[_0x931d('0x30')][_0x931d('0x1c')]);}return _0x2c14db[_0x931d('0x4b')](_0x46a60d);}})['then'](function(_0x555532){if(_0x555532){return _0x555532?{'count':_0x469632,'rows':_0x555532}:null;}})[_0x931d('0x24')](respondWithResult(_0x574195,null))[_0x931d('0x43')](handleError(_0x574195,null));};exports['getDescriptions']=function(_0x247112,_0x1b9491,_0xaf14bb){var _0x58afe5={};var _0x1658bc={};var _0x25cd06;var _0x423aa4;return db[_0x931d('0x40')][_0x931d('0x4f')]({'where':{'id':_0x247112['params']['id']}})['then'](handleEntityNotFound(_0x1b9491,null))[_0x931d('0x24')](function(_0x2b6364){if(_0x2b6364){_0x25cd06=_0x2b6364;_0x1658bc[_0x931d('0x2e')]=_['keys'](db[_0x931d('0x4c')][_0x931d('0x2b')]);_0x1658bc[_0x931d('0x30')]=_[_0x931d('0x2f')](_0x247112[_0x931d('0x30')]);_0x1658bc[_0x931d('0x31')]=_[_0x931d('0x32')](_0x1658bc[_0x931d('0x2e')],_0x1658bc['query']);_0x58afe5[_0x931d('0x34')]=_[_0x931d('0x32')](_0x1658bc['model'],qs[_0x931d('0x33')](_0x247112[_0x931d('0x30')]['fields']));_0x58afe5[_0x931d('0x34')]=_0x58afe5[_0x931d('0x34')][_0x931d('0x35')]?_0x58afe5[_0x931d('0x34')]:_0x1658bc[_0x931d('0x2e')];_0x58afe5['order']=qs[_0x931d('0x37')](_0x247112[_0x931d('0x30')][_0x931d('0x37')]);_0x58afe5[_0x931d('0x38')]=qs['filters'](_[_0x931d('0x39')](_0x247112['query'],_0x1658bc['filters']));if(_0x247112['query'][_0x931d('0x3d')]){_0x58afe5[_0x931d('0x38')]=_[_0x931d('0x3a')](_0x58afe5[_0x931d('0x38')],{'$or':_[_0x931d('0x2a')](_0x58afe5['attributes'],function(_0x147895){var _0x41ea8f={};_0x41ea8f[_0x147895]={'$like':'%'+_0x247112[_0x931d('0x30')][_0x931d('0x3d')]+'%'};return _0x41ea8f;})});}_0x58afe5=_[_0x931d('0x3a')]({},_0x58afe5,_0x247112['options']);return _0x25cd06[_0x931d('0x50')](_0x58afe5);}})[_0x931d('0x24')](function(_0x7f502d){if(_0x7f502d){_0x423aa4=_0x7f502d['length'];if(!_0x247112[_0x931d('0x30')][_0x931d('0x4e')](_0x931d('0x36'))){_0x58afe5[_0x931d('0x1e')]=qs['limit'](_0x247112[_0x931d('0x30')][_0x931d('0x1e')]);_0x58afe5[_0x931d('0x1c')]=qs['offset'](_0x247112[_0x931d('0x30')]['offset']);}return _0x25cd06['getDescriptions'](_0x58afe5);}})[_0x931d('0x24')](function(_0x2bb5fc){if(_0x2bb5fc){return _0x2bb5fc?{'count':_0x423aa4,'rows':_0x2bb5fc}:null;}})[_0x931d('0x24')](respondWithResult(_0x1b9491,null))[_0x931d('0x43')](handleError(_0x1b9491,null));};exports[_0x931d('0x51')]=function(_0x2cb276,_0x32328a,_0x319536){var _0x4a358f={};var _0x4a2130={};var _0x43f30b;var _0x4543ac;return db[_0x931d('0x40')][_0x931d('0x4f')]({'where':{'id':_0x2cb276[_0x931d('0x45')]['id']}})['then'](handleEntityNotFound(_0x32328a,null))[_0x931d('0x24')](function(_0x265d0b){if(_0x265d0b){_0x43f30b=_0x265d0b;_0x4a2130[_0x931d('0x2e')]=_['keys'](db[_0x931d('0x4c')][_0x931d('0x2b')]);_0x4a2130[_0x931d('0x30')]=_[_0x931d('0x2f')](_0x2cb276[_0x931d('0x30')]);_0x4a2130[_0x931d('0x31')]=_[_0x931d('0x32')](_0x4a2130[_0x931d('0x2e')],_0x4a2130[_0x931d('0x30')]);_0x4a358f[_0x931d('0x34')]=_[_0x931d('0x32')](_0x4a2130[_0x931d('0x2e')],qs['fields'](_0x2cb276[_0x931d('0x30')]['fields']));_0x4a358f[_0x931d('0x34')]=_0x4a358f[_0x931d('0x34')][_0x931d('0x35')]?_0x4a358f[_0x931d('0x34')]:_0x4a2130['model'];_0x4a358f[_0x931d('0x4d')]=qs['sort'](_0x2cb276[_0x931d('0x30')][_0x931d('0x37')]);_0x4a358f['where']=qs[_0x931d('0x31')](_['pick'](_0x2cb276[_0x931d('0x30')],_0x4a2130['filters']));if(_0x2cb276['query'][_0x931d('0x3d')]){_0x4a358f[_0x931d('0x38')]=_[_0x931d('0x3a')](_0x4a358f[_0x931d('0x38')],{'$or':_['map'](_0x4a358f[_0x931d('0x34')],function(_0x311989){var _0x3fa4ae={};_0x3fa4ae[_0x311989]={'$like':'%'+_0x2cb276[_0x931d('0x30')][_0x931d('0x3d')]+'%'};return _0x3fa4ae;})});}_0x4a358f=_[_0x931d('0x3a')]({},_0x4a358f,_0x2cb276['options']);return _0x43f30b[_0x931d('0x51')](_0x4a358f);}})[_0x931d('0x24')](function(_0x4c6272){if(_0x4c6272){_0x4543ac=_0x4c6272[_0x931d('0x35')];if(!_0x2cb276['query'][_0x931d('0x4e')]('nolimit')){_0x4a358f['limit']=qs[_0x931d('0x1e')](_0x2cb276[_0x931d('0x30')][_0x931d('0x1e')]);_0x4a358f['offset']=qs[_0x931d('0x1c')](_0x2cb276[_0x931d('0x30')][_0x931d('0x1c')]);}return _0x43f30b[_0x931d('0x51')](_0x4a358f);}})[_0x931d('0x24')](function(_0x4d32be){if(_0x4d32be){return _0x4d32be?{'count':_0x4543ac,'rows':_0x4d32be}:null;}})[_0x931d('0x24')](respondWithResult(_0x32328a,null))['catch'](handleError(_0x32328a,null));}; \ No newline at end of file +var _0x01b9=['create','body','getSubjects','findOne','FreshsalesField','pick','nolimit','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','FreshsalesConfiguration','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x4b8509,_0x279182){var _0x7249d1=function(_0x4e1def){while(--_0x4e1def){_0x4b8509['push'](_0x4b8509['shift']());}};_0x7249d1(++_0x279182);}(_0x01b9,0x1ef));var _0x901b=function(_0x2ca86a,_0x4d4163){_0x2ca86a=_0x2ca86a-0x0;var _0x55bb3a=_0x01b9[_0x2ca86a];return _0x55bb3a;};'use strict';var emlformat=require(_0x901b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x901b('0x1'));var jsonpatch=require(_0x901b('0x2'));var rp=require(_0x901b('0x3'));var moment=require('moment');var BPromise=require(_0x901b('0x4'));var Mustache=require(_0x901b('0x5'));var util=require(_0x901b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x901b('0x7'));var ejs=require(_0x901b('0x8'));var fs=require('fs');var fs_extra=require(_0x901b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x901b('0xa'));var deskjs=require(_0x901b('0xb'));var toCsv=require(_0x901b('0x7'));var querystring=require(_0x901b('0xc'));var Papa=require(_0x901b('0xd'));var Redis=require(_0x901b('0xe'));var authService=require(_0x901b('0xf'));var qs=require(_0x901b('0x10'));var as=require(_0x901b('0x11'));var hardwareService=require(_0x901b('0x12'));var logger=require(_0x901b('0x13'))('api');var utils=require(_0x901b('0x14'));var config=require(_0x901b('0x15'));var licenseUtil=require(_0x901b('0x16'));var db=require(_0x901b('0x17'))['db'];function respondWithStatusCode(_0x7195f0,_0x14ea38){_0x14ea38=_0x14ea38||0xcc;return function(_0x426710){if(_0x426710){return _0x7195f0[_0x901b('0x18')](_0x14ea38);}return _0x7195f0[_0x901b('0x19')](_0x14ea38)['end']();};}function respondWithResult(_0x2e4e73,_0x28c8a8){_0x28c8a8=_0x28c8a8||0xc8;return function(_0x4fc400){if(_0x4fc400){return _0x2e4e73[_0x901b('0x19')](_0x28c8a8)[_0x901b('0x1a')](_0x4fc400);}};}function respondWithFilteredResult(_0x1012ec,_0x35686b){return function(_0x2ff4b4){if(_0x2ff4b4){var _0x180972=typeof _0x35686b[_0x901b('0x1b')]===_0x901b('0x1c')&&typeof _0x35686b[_0x901b('0x1d')]==='undefined';var _0x1897ed=_0x2ff4b4[_0x901b('0x1e')];var _0x33baf4=_0x180972?0x0:_0x35686b[_0x901b('0x1b')];var _0x2028b6=_0x180972?_0x2ff4b4['count']:_0x35686b[_0x901b('0x1b')]+_0x35686b[_0x901b('0x1d')];var _0x282457;if(_0x2028b6>=_0x1897ed){_0x2028b6=_0x1897ed;_0x282457=0xc8;}else{_0x282457=0xce;}_0x1012ec[_0x901b('0x19')](_0x282457);return _0x1012ec[_0x901b('0x1f')](_0x901b('0x20'),_0x33baf4+'-'+_0x2028b6+'/'+_0x1897ed)[_0x901b('0x1a')](_0x2ff4b4);}return null;};}function patchUpdates(_0x5abfa1){return function(_0x1fcbcf){try{jsonpatch[_0x901b('0x21')](_0x1fcbcf,_0x5abfa1,!![]);}catch(_0x5670d8){return BPromise['reject'](_0x5670d8);}return _0x1fcbcf['save']();};}function saveUpdates(_0x3f491f,_0x2ca0c2){return function(_0x5b4dae){if(_0x5b4dae){return _0x5b4dae[_0x901b('0x22')](_0x3f491f)[_0x901b('0x23')](function(_0x64f9a1){return _0x64f9a1;});}return null;};}function removeEntity(_0x3a7bc6,_0x408029){return function(_0x330074){if(_0x330074){return _0x330074[_0x901b('0x24')]()[_0x901b('0x23')](function(){_0x3a7bc6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1171eb,_0x510a07){return function(_0x4be0d7){if(!_0x4be0d7){_0x1171eb[_0x901b('0x18')](0x194);}return _0x4be0d7;};}function handleError(_0x4b7025,_0x48e6d6){_0x48e6d6=_0x48e6d6||0x1f4;return function(_0x457ac5){logger[_0x901b('0x25')](_0x457ac5[_0x901b('0x26')]);if(_0x457ac5[_0x901b('0x27')]){delete _0x457ac5[_0x901b('0x27')];}_0x4b7025['status'](_0x48e6d6)[_0x901b('0x28')](_0x457ac5);};}exports[_0x901b('0x29')]=function(_0x19171e,_0x4504f9){var _0x4e51ca={},_0x1321fb={},_0x3c15e0={'count':0x0,'rows':[]};var _0x2060e7=_[_0x901b('0x2a')](db['FreshsalesConfiguration'][_0x901b('0x2b')],function(_0x3279e6){return{'name':_0x3279e6[_0x901b('0x2c')],'type':_0x3279e6[_0x901b('0x2d')][_0x901b('0x2e')]};});_0x1321fb['model']=_[_0x901b('0x2a')](_0x2060e7,_0x901b('0x27'));_0x1321fb[_0x901b('0x2f')]=_[_0x901b('0x30')](_0x19171e['query']);_0x1321fb[_0x901b('0x31')]=_[_0x901b('0x32')](_0x1321fb[_0x901b('0x33')],_0x1321fb['query']);_0x4e51ca[_0x901b('0x34')]=_['intersection'](_0x1321fb['model'],qs['fields'](_0x19171e[_0x901b('0x2f')][_0x901b('0x35')]));_0x4e51ca[_0x901b('0x34')]=_0x4e51ca['attributes'][_0x901b('0x36')]?_0x4e51ca[_0x901b('0x34')]:_0x1321fb[_0x901b('0x33')];if(!_0x19171e[_0x901b('0x2f')][_0x901b('0x37')]('nolimit')){_0x4e51ca[_0x901b('0x1d')]=qs['limit'](_0x19171e[_0x901b('0x2f')][_0x901b('0x1d')]);_0x4e51ca[_0x901b('0x1b')]=qs[_0x901b('0x1b')](_0x19171e[_0x901b('0x2f')][_0x901b('0x1b')]);}_0x4e51ca[_0x901b('0x38')]=qs[_0x901b('0x39')](_0x19171e[_0x901b('0x2f')][_0x901b('0x39')]);_0x4e51ca['where']=qs['filters'](_['pick'](_0x19171e['query'],_0x1321fb[_0x901b('0x31')]),_0x2060e7);if(_0x19171e[_0x901b('0x2f')][_0x901b('0x3a')]){_0x4e51ca['where']=_[_0x901b('0x3b')](_0x4e51ca[_0x901b('0x3c')],{'$or':_['map'](_0x2060e7,function(_0x4c058c){if(_0x4c058c['type']!==_0x901b('0x3d')){var _0x3d2e8a={};_0x3d2e8a[_0x4c058c[_0x901b('0x27')]]={'$like':'%'+_0x19171e[_0x901b('0x2f')][_0x901b('0x3a')]+'%'};return _0x3d2e8a;}})});}_0x4e51ca=_['merge']({},_0x4e51ca,_0x19171e[_0x901b('0x3e')]);var _0x1c7312={'where':_0x4e51ca[_0x901b('0x3c')]};return db[_0x901b('0x3f')][_0x901b('0x1e')](_0x1c7312)[_0x901b('0x23')](function(_0x5192d5){_0x3c15e0[_0x901b('0x1e')]=_0x5192d5;if(_0x19171e[_0x901b('0x2f')]['includeAll']){_0x4e51ca[_0x901b('0x40')]=[{'all':!![]}];}return db[_0x901b('0x3f')][_0x901b('0x41')](_0x4e51ca);})[_0x901b('0x23')](function(_0x585f5d){_0x3c15e0[_0x901b('0x42')]=_0x585f5d;return _0x3c15e0;})[_0x901b('0x23')](respondWithFilteredResult(_0x4504f9,_0x4e51ca))[_0x901b('0x43')](handleError(_0x4504f9,null));};exports[_0x901b('0x44')]=function(_0x2a5390,_0x340509){var _0x4310d4={'raw':![],'where':{'id':_0x2a5390[_0x901b('0x45')]['id']}},_0x1945a4={};_0x1945a4[_0x901b('0x33')]=_['keys'](db[_0x901b('0x3f')][_0x901b('0x2b')]);_0x1945a4[_0x901b('0x2f')]=_['keys'](_0x2a5390[_0x901b('0x2f')]);_0x1945a4[_0x901b('0x31')]=_[_0x901b('0x32')](_0x1945a4[_0x901b('0x33')],_0x1945a4[_0x901b('0x2f')]);_0x4310d4['attributes']=_['intersection'](_0x1945a4[_0x901b('0x33')],qs[_0x901b('0x35')](_0x2a5390[_0x901b('0x2f')][_0x901b('0x35')]));_0x4310d4[_0x901b('0x34')]=_0x4310d4[_0x901b('0x34')][_0x901b('0x36')]?_0x4310d4[_0x901b('0x34')]:_0x1945a4[_0x901b('0x33')];if(_0x2a5390['query'][_0x901b('0x46')]){_0x4310d4[_0x901b('0x40')]=[{'all':!![]}];}_0x4310d4=_['merge']({},_0x4310d4,_0x2a5390[_0x901b('0x3e')]);return db[_0x901b('0x3f')][_0x901b('0x47')](_0x4310d4)['then'](handleEntityNotFound(_0x340509,null))[_0x901b('0x23')](respondWithResult(_0x340509,null))[_0x901b('0x43')](handleError(_0x340509,null));};exports[_0x901b('0x48')]=function(_0x222697,_0x3d8676){return db[_0x901b('0x3f')]['create'](_0x222697[_0x901b('0x49')],{})['then'](respondWithResult(_0x3d8676,0xc9))[_0x901b('0x43')](handleError(_0x3d8676,null));};exports[_0x901b('0x22')]=function(_0x494348,_0x4d78bc){if(_0x494348[_0x901b('0x49')]['id']){delete _0x494348[_0x901b('0x49')]['id'];}return db['FreshsalesConfiguration'][_0x901b('0x47')]({'where':{'id':_0x494348[_0x901b('0x45')]['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x4d78bc,null))['then'](saveUpdates(_0x494348['body'],null))[_0x901b('0x23')](respondWithResult(_0x4d78bc,null))['catch'](handleError(_0x4d78bc,null));};exports['destroy']=function(_0xd63949,_0x6ceec5){return db[_0x901b('0x3f')][_0x901b('0x47')]({'where':{'id':_0xd63949[_0x901b('0x45')]['id']}})['then'](handleEntityNotFound(_0x6ceec5,null))[_0x901b('0x23')](removeEntity(_0x6ceec5,null))[_0x901b('0x43')](handleError(_0x6ceec5,null));};exports[_0x901b('0x4a')]=function(_0x58e71e,_0x555418,_0x5830a6){var _0x2063e7={};var _0x593e2e={};var _0x191734;var _0x24bf8c;return db[_0x901b('0x3f')][_0x901b('0x4b')]({'where':{'id':_0x58e71e[_0x901b('0x45')]['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x555418,null))['then'](function(_0x6f84af){if(_0x6f84af){_0x191734=_0x6f84af;_0x593e2e[_0x901b('0x33')]=_[_0x901b('0x30')](db[_0x901b('0x4c')][_0x901b('0x2b')]);_0x593e2e[_0x901b('0x2f')]=_[_0x901b('0x30')](_0x58e71e['query']);_0x593e2e[_0x901b('0x31')]=_[_0x901b('0x32')](_0x593e2e[_0x901b('0x33')],_0x593e2e['query']);_0x2063e7[_0x901b('0x34')]=_[_0x901b('0x32')](_0x593e2e['model'],qs['fields'](_0x58e71e[_0x901b('0x2f')]['fields']));_0x2063e7[_0x901b('0x34')]=_0x2063e7[_0x901b('0x34')][_0x901b('0x36')]?_0x2063e7['attributes']:_0x593e2e[_0x901b('0x33')];_0x2063e7[_0x901b('0x38')]=qs[_0x901b('0x39')](_0x58e71e[_0x901b('0x2f')][_0x901b('0x39')]);_0x2063e7[_0x901b('0x3c')]=qs[_0x901b('0x31')](_[_0x901b('0x4d')](_0x58e71e[_0x901b('0x2f')],_0x593e2e[_0x901b('0x31')]));if(_0x58e71e[_0x901b('0x2f')][_0x901b('0x3a')]){_0x2063e7[_0x901b('0x3c')]=_[_0x901b('0x3b')](_0x2063e7[_0x901b('0x3c')],{'$or':_['map'](_0x2063e7[_0x901b('0x34')],function(_0x4d3785){var _0x1631d0={};_0x1631d0[_0x4d3785]={'$like':'%'+_0x58e71e['query'][_0x901b('0x3a')]+'%'};return _0x1631d0;})});}_0x2063e7=_[_0x901b('0x3b')]({},_0x2063e7,_0x58e71e[_0x901b('0x3e')]);return _0x191734['getSubjects'](_0x2063e7);}})[_0x901b('0x23')](function(_0x163368){if(_0x163368){_0x24bf8c=_0x163368[_0x901b('0x36')];if(!_0x58e71e[_0x901b('0x2f')][_0x901b('0x37')](_0x901b('0x4e'))){_0x2063e7[_0x901b('0x1d')]=qs[_0x901b('0x1d')](_0x58e71e[_0x901b('0x2f')][_0x901b('0x1d')]);_0x2063e7[_0x901b('0x1b')]=qs[_0x901b('0x1b')](_0x58e71e[_0x901b('0x2f')][_0x901b('0x1b')]);}return _0x191734['getSubjects'](_0x2063e7);}})[_0x901b('0x23')](function(_0x4ade68){if(_0x4ade68){return _0x4ade68?{'count':_0x24bf8c,'rows':_0x4ade68}:null;}})[_0x901b('0x23')](respondWithResult(_0x555418,null))[_0x901b('0x43')](handleError(_0x555418,null));};exports['getDescriptions']=function(_0x260a62,_0x90f84a,_0x45207b){var _0x1b78ed={};var _0x27266b={};var _0x6b933b;var _0x36c809;return db[_0x901b('0x3f')][_0x901b('0x4b')]({'where':{'id':_0x260a62['params']['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x90f84a,null))[_0x901b('0x23')](function(_0x53178c){if(_0x53178c){_0x6b933b=_0x53178c;_0x27266b[_0x901b('0x33')]=_[_0x901b('0x30')](db[_0x901b('0x4c')][_0x901b('0x2b')]);_0x27266b[_0x901b('0x2f')]=_[_0x901b('0x30')](_0x260a62[_0x901b('0x2f')]);_0x27266b[_0x901b('0x31')]=_[_0x901b('0x32')](_0x27266b[_0x901b('0x33')],_0x27266b[_0x901b('0x2f')]);_0x1b78ed[_0x901b('0x34')]=_[_0x901b('0x32')](_0x27266b[_0x901b('0x33')],qs['fields'](_0x260a62[_0x901b('0x2f')][_0x901b('0x35')]));_0x1b78ed[_0x901b('0x34')]=_0x1b78ed['attributes'][_0x901b('0x36')]?_0x1b78ed[_0x901b('0x34')]:_0x27266b[_0x901b('0x33')];_0x1b78ed[_0x901b('0x38')]=qs[_0x901b('0x39')](_0x260a62['query'][_0x901b('0x39')]);_0x1b78ed[_0x901b('0x3c')]=qs['filters'](_[_0x901b('0x4d')](_0x260a62['query'],_0x27266b[_0x901b('0x31')]));if(_0x260a62[_0x901b('0x2f')]['filter']){_0x1b78ed[_0x901b('0x3c')]=_[_0x901b('0x3b')](_0x1b78ed[_0x901b('0x3c')],{'$or':_[_0x901b('0x2a')](_0x1b78ed['attributes'],function(_0x53731a){var _0x430307={};_0x430307[_0x53731a]={'$like':'%'+_0x260a62[_0x901b('0x2f')][_0x901b('0x3a')]+'%'};return _0x430307;})});}_0x1b78ed=_['merge']({},_0x1b78ed,_0x260a62[_0x901b('0x3e')]);return _0x6b933b[_0x901b('0x4f')](_0x1b78ed);}})[_0x901b('0x23')](function(_0x42e052){if(_0x42e052){_0x36c809=_0x42e052['length'];if(!_0x260a62[_0x901b('0x2f')][_0x901b('0x37')]('nolimit')){_0x1b78ed['limit']=qs[_0x901b('0x1d')](_0x260a62[_0x901b('0x2f')][_0x901b('0x1d')]);_0x1b78ed[_0x901b('0x1b')]=qs[_0x901b('0x1b')](_0x260a62[_0x901b('0x2f')]['offset']);}return _0x6b933b[_0x901b('0x4f')](_0x1b78ed);}})[_0x901b('0x23')](function(_0x2b7deb){if(_0x2b7deb){return _0x2b7deb?{'count':_0x36c809,'rows':_0x2b7deb}:null;}})[_0x901b('0x23')](respondWithResult(_0x90f84a,null))[_0x901b('0x43')](handleError(_0x90f84a,null));};exports[_0x901b('0x50')]=function(_0x435a36,_0x1ad1f7,_0x54ebc3){var _0x2fbc1e={};var _0x400730={};var _0x469519;var _0x4ff8f5;return db['FreshsalesConfiguration'][_0x901b('0x4b')]({'where':{'id':_0x435a36[_0x901b('0x45')]['id']}})[_0x901b('0x23')](handleEntityNotFound(_0x1ad1f7,null))[_0x901b('0x23')](function(_0x3eba00){if(_0x3eba00){_0x469519=_0x3eba00;_0x400730[_0x901b('0x33')]=_[_0x901b('0x30')](db['FreshsalesField'][_0x901b('0x2b')]);_0x400730[_0x901b('0x2f')]=_[_0x901b('0x30')](_0x435a36['query']);_0x400730['filters']=_[_0x901b('0x32')](_0x400730['model'],_0x400730[_0x901b('0x2f')]);_0x2fbc1e['attributes']=_[_0x901b('0x32')](_0x400730['model'],qs['fields'](_0x435a36['query'][_0x901b('0x35')]));_0x2fbc1e[_0x901b('0x34')]=_0x2fbc1e[_0x901b('0x34')][_0x901b('0x36')]?_0x2fbc1e['attributes']:_0x400730['model'];_0x2fbc1e[_0x901b('0x38')]=qs[_0x901b('0x39')](_0x435a36['query'][_0x901b('0x39')]);_0x2fbc1e[_0x901b('0x3c')]=qs[_0x901b('0x31')](_[_0x901b('0x4d')](_0x435a36['query'],_0x400730['filters']));if(_0x435a36[_0x901b('0x2f')]['filter']){_0x2fbc1e[_0x901b('0x3c')]=_[_0x901b('0x3b')](_0x2fbc1e[_0x901b('0x3c')],{'$or':_[_0x901b('0x2a')](_0x2fbc1e[_0x901b('0x34')],function(_0xb83c88){var _0x2301c4={};_0x2301c4[_0xb83c88]={'$like':'%'+_0x435a36['query']['filter']+'%'};return _0x2301c4;})});}_0x2fbc1e=_[_0x901b('0x3b')]({},_0x2fbc1e,_0x435a36[_0x901b('0x3e')]);return _0x469519[_0x901b('0x50')](_0x2fbc1e);}})[_0x901b('0x23')](function(_0x578127){if(_0x578127){_0x4ff8f5=_0x578127[_0x901b('0x36')];if(!_0x435a36[_0x901b('0x2f')][_0x901b('0x37')]('nolimit')){_0x2fbc1e[_0x901b('0x1d')]=qs[_0x901b('0x1d')](_0x435a36[_0x901b('0x2f')][_0x901b('0x1d')]);_0x2fbc1e[_0x901b('0x1b')]=qs['offset'](_0x435a36[_0x901b('0x2f')]['offset']);}return _0x469519[_0x901b('0x50')](_0x2fbc1e);}})[_0x901b('0x23')](function(_0x10635a){if(_0x10635a){return _0x10635a?{'count':_0x4ff8f5,'rows':_0x10635a}:null;}})[_0x901b('0x23')](respondWithResult(_0x1ad1f7,null))[_0x901b('0x43')](handleError(_0x1ad1f7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b603691..b81df22 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 _0x6234=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x3b7895,_0xcd2a77){var _0x330518=function(_0x19c523){while(--_0x19c523){_0x3b7895['push'](_0x3b7895['shift']());}};_0x330518(++_0xcd2a77);}(_0x6234,0x187));var _0x4623=function(_0x10badd,_0x52bc4c){_0x10badd=_0x10badd-0x0;var _0x137c29=_0x6234[_0x10badd];return _0x137c29;};'use strict';var _=require(_0x4623('0x0'));var util=require(_0x4623('0x1'));var logger=require(_0x4623('0x2'))(_0x4623('0x3'));var moment=require(_0x4623('0x4'));var BPromise=require(_0x4623('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4623('0x6'));var config=require(_0x4623('0x7'));var attributes=require(_0x4623('0x8'));module[_0x4623('0x9')]=function(_0x2dbb8b,_0x41e828){return _0x2dbb8b[_0x4623('0xa')](_0x4623('0xb'),attributes,{'tableName':_0x4623('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd097=['moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x44cef4,_0x2feebb){var _0x327f4c=function(_0x3aa570){while(--_0x3aa570){_0x44cef4['push'](_0x44cef4['shift']());}};_0x327f4c(++_0x2feebb);}(_0xd097,0x141));var _0x7d09=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd097[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x7d09('0x0'));var util=require(_0x7d09('0x1'));var logger=require(_0x7d09('0x2'))(_0x7d09('0x3'));var moment=require(_0x7d09('0x4'));var BPromise=require(_0x7d09('0x5'));var rp=require(_0x7d09('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d09('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d09('0x8'));module[_0x7d09('0x9')]=function(_0x14f5bd,_0x214000){return _0x14f5bd[_0x7d09('0xa')](_0x7d09('0xb'),attributes,{'tableName':_0x7d09('0xc'),'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 e7e4e64..1e6378a 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 _0x200f=['client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x200f,0x1be));var _0xf200=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0x200f[_0x9c8b4a];return _0x198bef;};'use strict';var _=require(_0xf200('0x0'));var util=require(_0xf200('0x1'));var moment=require(_0xf200('0x2'));var BPromise=require(_0xf200('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf200('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf200('0x5'));var logger=require(_0xf200('0x6'))(_0xf200('0x7'));var config=require(_0xf200('0x8'));var jayson=require(_0xf200('0x9'));var client=jayson[_0xf200('0xa')][_0xf200('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc275be,_0xa88b0a,_0x2bc850){return new BPromise(function(_0x2d549e,_0x4f371d){return client[_0xf200('0xc')](_0xc275be,_0x2bc850)[_0xf200('0xd')](function(_0x427a78){logger[_0xf200('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xa88b0a,_0xf200('0xf'));logger[_0xf200('0x10')](_0xf200('0x11'),_0xa88b0a,_0xf200('0xf'),JSON[_0xf200('0x12')](_0x427a78));if(_0x427a78[_0xf200('0x13')]){if(_0x427a78[_0xf200('0x13')][_0xf200('0x14')]===0x1f4){logger[_0xf200('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xa88b0a,_0x427a78[_0xf200('0x13')][_0xf200('0x15')]);return _0x4f371d(_0x427a78[_0xf200('0x13')]['message']);}logger['error'](_0xf200('0x16'),_0xa88b0a,_0x427a78[_0xf200('0x13')]['message']);return _0x2d549e(_0x427a78['error'][_0xf200('0x15')]);}else{logger[_0xf200('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xa88b0a,_0xf200('0xf'));_0x2d549e(_0x427a78[_0xf200('0x17')]['message']);}})['catch'](function(_0x44282e){logger[_0xf200('0x13')](_0xf200('0x16'),_0xa88b0a,_0x44282e);_0x4f371d(_0x44282e);});});} \ No newline at end of file +var _0xe8d6=['client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x34b92e,_0x14ed8f){var _0x522d9b=function(_0xe4e231){while(--_0xe4e231){_0x34b92e['push'](_0x34b92e['shift']());}};_0x522d9b(++_0x14ed8f);}(_0xe8d6,0x123));var _0x6e8d=function(_0x1b5940,_0x430133){_0x1b5940=_0x1b5940-0x0;var _0x5c8b70=_0xe8d6[_0x1b5940];return _0x5c8b70;};'use strict';var _=require('lodash');var util=require(_0x6e8d('0x0'));var moment=require(_0x6e8d('0x1'));var BPromise=require(_0x6e8d('0x2'));var rs=require(_0x6e8d('0x3'));var fs=require('fs');var Redis=require(_0x6e8d('0x4'));var db=require(_0x6e8d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e8d('0x6'))(_0x6e8d('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e8d('0x8'));var client=jayson[_0x6e8d('0x9')][_0x6e8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ccec,_0x2ab7c3,_0x2c214d){return new BPromise(function(_0x5849bb,_0x406b73){return client['request'](_0x59ccec,_0x2c214d)[_0x6e8d('0xb')](function(_0x1f94af){logger[_0x6e8d('0xc')](_0x6e8d('0xd'),_0x2ab7c3,'request\x20sent');logger[_0x6e8d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2ab7c3,'request\x20sent',JSON[_0x6e8d('0xf')](_0x1f94af));if(_0x1f94af[_0x6e8d('0x10')]){if(_0x1f94af[_0x6e8d('0x10')][_0x6e8d('0x11')]===0x1f4){logger['error'](_0x6e8d('0xd'),_0x2ab7c3,_0x1f94af[_0x6e8d('0x10')]['message']);return _0x406b73(_0x1f94af[_0x6e8d('0x10')][_0x6e8d('0x12')]);}logger['error'](_0x6e8d('0xd'),_0x2ab7c3,_0x1f94af[_0x6e8d('0x10')][_0x6e8d('0x12')]);return _0x5849bb(_0x1f94af[_0x6e8d('0x10')][_0x6e8d('0x12')]);}else{logger['info'](_0x6e8d('0xd'),_0x2ab7c3,'request\x20sent');_0x5849bb(_0x1f94af[_0x6e8d('0x13')][_0x6e8d('0x12')]);}})['catch'](function(_0x444079){logger[_0x6e8d('0x10')](_0x6e8d('0xd'),_0x2ab7c3,_0x444079);_0x406b73(_0x444079);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fa444fb..e33404a 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 _0xc6d8=['/:id','show','post','put','update','delete','destroy','multer','path','express','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0xe0f59d,_0x36e446){var _0x31d727=function(_0x4d87ff){while(--_0x4d87ff){_0xe0f59d['push'](_0xe0f59d['shift']());}};_0x31d727(++_0x36e446);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x372cde,_0x2f9c49){_0x372cde=_0x372cde-0x0;var _0x5f044c=_0xc6d8[_0x372cde];return _0x5f044c;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var fs_extra=require(_0x8c6d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x4'));var controller=require(_0x8c6d('0x5'));router[_0x8c6d('0x6')]('/',auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x8')]);router[_0x8c6d('0x6')](_0x8c6d('0x9'),auth['isAuthenticated'](),controller[_0x8c6d('0xa')]);router[_0x8c6d('0xb')]('/',auth[_0x8c6d('0x7')](),controller['create']);router[_0x8c6d('0xc')](_0x8c6d('0x9'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xd')]);router[_0x8c6d('0xe')](_0x8c6d('0x9'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe829=['./intFreshsalesField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x476f33,_0xf63a24){var _0x1689bb=function(_0x1c4283){while(--_0x1c4283){_0x476f33['push'](_0x476f33['shift']());}};_0x1689bb(++_0xf63a24);}(_0xe829,0x1d8));var _0x9e82=function(_0xb12603,_0x142505){_0xb12603=_0xb12603-0x0;var _0x2bdc24=_0xe829[_0xb12603];return _0x2bdc24;};'use strict';var multer=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var path=require(_0x9e82('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e82('0x3')]();var fs_extra=require(_0x9e82('0x4'));var auth=require(_0x9e82('0x5'));var interaction=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var controller=require(_0x9e82('0x8'));router['get']('/',auth[_0x9e82('0x9')](),controller[_0x9e82('0xa')]);router[_0x9e82('0xb')](_0x9e82('0xc'),auth[_0x9e82('0x9')](),controller['show']);router[_0x9e82('0xd')]('/',auth['isAuthenticated'](),controller[_0x9e82('0xe')]);router[_0x9e82('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9e82('0x10')]);router[_0x9e82('0x11')](_0x9e82('0xc'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x12')]);module[_0x9e82('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5592eff..71b3085 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 _0xa71a=['keyValue','picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa71a,0xc3));var _0xaa71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa71a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xaa71('0x0')]={'type':{'type':Sequelize[_0xaa71('0x1')](_0xaa71('0x2'),_0xaa71('0x3'),_0xaa71('0x4'),_0xaa71('0x5'),_0xaa71('0x6')),'defaultValue':_0xaa71('0x2')},'content':{'type':Sequelize[_0xaa71('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaa71('0x1')](_0xaa71('0x2'),_0xaa71('0x3'),_0xaa71('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae86=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x4f972b,_0x5616f5){var _0x1fde35=function(_0x1c6df5){while(--_0x1c6df5){_0x4f972b['push'](_0x4f972b['shift']());}};_0x1fde35(++_0x5616f5);}(_0xae86,0x138));var _0x6ae8=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xae86[_0x232ec0];return _0x356705;};'use strict';var Sequelize=require(_0x6ae8('0x0'));module[_0x6ae8('0x1')]={'type':{'type':Sequelize[_0x6ae8('0x2')](_0x6ae8('0x3'),_0x6ae8('0x4'),_0x6ae8('0x5'),_0x6ae8('0x6'),'picklist'),'defaultValue':_0x6ae8('0x3')},'content':{'type':Sequelize[_0x6ae8('0x7')]},'key':{'type':Sequelize[_0x6ae8('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6ae8('0x3'),_0x6ae8('0x4'),_0x6ae8('0x5'))},'keyContent':{'type':Sequelize[_0x6ae8('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6ae8('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ae8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 41a638e..ae93410 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 _0x5bb9=['nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5bb9,0x1e7));var _0x95bb=function(_0x596931,_0x86d2bd){_0x596931=_0x596931-0x0;var _0x42ed94=_0x5bb9[_0x596931];return _0x42ed94;};'use strict';var emlformat=require(_0x95bb('0x0'));var rimraf=require(_0x95bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95bb('0x2'));var rp=require(_0x95bb('0x3'));var moment=require(_0x95bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x95bb('0x5'));var util=require(_0x95bb('0x6'));var path=require('path');var sox=require(_0x95bb('0x7'));var csv=require(_0x95bb('0x8'));var ejs=require(_0x95bb('0x9'));var fs=require('fs');var fs_extra=require(_0x95bb('0xa'));var _=require(_0x95bb('0xb'));var squel=require(_0x95bb('0xc'));var crypto=require(_0x95bb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x95bb('0x8'));var querystring=require(_0x95bb('0xe'));var Papa=require(_0x95bb('0xf'));var Redis=require('ioredis');var authService=require(_0x95bb('0x10'));var qs=require(_0x95bb('0x11'));var as=require(_0x95bb('0x12'));var hardwareService=require(_0x95bb('0x13'));var logger=require(_0x95bb('0x14'))(_0x95bb('0x15'));var utils=require(_0x95bb('0x16'));var config=require(_0x95bb('0x17'));var licenseUtil=require(_0x95bb('0x18'));var db=require(_0x95bb('0x19'))['db'];function respondWithStatusCode(_0x46162c,_0x263181){_0x263181=_0x263181||0xcc;return function(_0x5eae1b){if(_0x5eae1b){return _0x46162c[_0x95bb('0x1a')](_0x263181);}return _0x46162c[_0x95bb('0x1b')](_0x263181)[_0x95bb('0x1c')]();};}function respondWithResult(_0x36897b,_0x33e0d0){_0x33e0d0=_0x33e0d0||0xc8;return function(_0x2235b1){if(_0x2235b1){return _0x36897b['status'](_0x33e0d0)[_0x95bb('0x1d')](_0x2235b1);}};}function respondWithFilteredResult(_0x15ff5c,_0x4a83e1){return function(_0x3fa59a){if(_0x3fa59a){var _0x19bc14=typeof _0x4a83e1['offset']===_0x95bb('0x1e')&&typeof _0x4a83e1[_0x95bb('0x1f')]===_0x95bb('0x1e');var _0x492f9d=_0x3fa59a[_0x95bb('0x20')];var _0x5aae26=_0x19bc14?0x0:_0x4a83e1[_0x95bb('0x21')];var _0x45acae=_0x19bc14?_0x3fa59a[_0x95bb('0x20')]:_0x4a83e1[_0x95bb('0x21')]+_0x4a83e1['limit'];var _0x56f613;if(_0x45acae>=_0x492f9d){_0x45acae=_0x492f9d;_0x56f613=0xc8;}else{_0x56f613=0xce;}_0x15ff5c[_0x95bb('0x1b')](_0x56f613);return _0x15ff5c[_0x95bb('0x22')](_0x95bb('0x23'),_0x5aae26+'-'+_0x45acae+'/'+_0x492f9d)['json'](_0x3fa59a);}return null;};}function patchUpdates(_0x216582){return function(_0x4435db){try{jsonpatch[_0x95bb('0x24')](_0x4435db,_0x216582,!![]);}catch(_0x58696a){return BPromise[_0x95bb('0x25')](_0x58696a);}return _0x4435db[_0x95bb('0x26')]();};}function saveUpdates(_0x4b1f87,_0x25a0ad){return function(_0x1f95b6){if(_0x1f95b6){return _0x1f95b6['update'](_0x4b1f87)[_0x95bb('0x27')](function(_0x6e500b){return _0x6e500b;});}return null;};}function removeEntity(_0x419845,_0x211362){return function(_0x261520){if(_0x261520){return _0x261520[_0x95bb('0x28')]()['then'](function(){_0x419845[_0x95bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548a91,_0x30696a){return function(_0x2c51cf){if(!_0x2c51cf){_0x548a91['sendStatus'](0x194);}return _0x2c51cf;};}function handleError(_0x4781fa,_0x2ea601){_0x2ea601=_0x2ea601||0x1f4;return function(_0x5a282e){logger['error'](_0x5a282e[_0x95bb('0x29')]);if(_0x5a282e['name']){delete _0x5a282e[_0x95bb('0x2a')];}_0x4781fa[_0x95bb('0x1b')](_0x2ea601)[_0x95bb('0x2b')](_0x5a282e);};}exports[_0x95bb('0x2c')]=function(_0x179b57,_0x296d84){var _0x21b311={},_0x540f61={},_0x3f17e0={'count':0x0,'rows':[]};var _0x8bd1c7=_['map'](db[_0x95bb('0x2d')][_0x95bb('0x2e')],function(_0x245d9b){return{'name':_0x245d9b[_0x95bb('0x2f')],'type':_0x245d9b[_0x95bb('0x30')][_0x95bb('0x31')]};});_0x540f61[_0x95bb('0x32')]=_[_0x95bb('0x33')](_0x8bd1c7,_0x95bb('0x2a'));_0x540f61[_0x95bb('0x34')]=_[_0x95bb('0x35')](_0x179b57[_0x95bb('0x34')]);_0x540f61['filters']=_[_0x95bb('0x36')](_0x540f61[_0x95bb('0x32')],_0x540f61[_0x95bb('0x34')]);_0x21b311[_0x95bb('0x37')]=_[_0x95bb('0x36')](_0x540f61[_0x95bb('0x32')],qs['fields'](_0x179b57['query'][_0x95bb('0x38')]));_0x21b311[_0x95bb('0x37')]=_0x21b311[_0x95bb('0x37')][_0x95bb('0x39')]?_0x21b311[_0x95bb('0x37')]:_0x540f61[_0x95bb('0x32')];if(!_0x179b57[_0x95bb('0x34')][_0x95bb('0x3a')](_0x95bb('0x3b'))){_0x21b311[_0x95bb('0x1f')]=qs['limit'](_0x179b57[_0x95bb('0x34')][_0x95bb('0x1f')]);_0x21b311[_0x95bb('0x21')]=qs[_0x95bb('0x21')](_0x179b57['query'][_0x95bb('0x21')]);}_0x21b311[_0x95bb('0x3c')]=qs[_0x95bb('0x3d')](_0x179b57['query']['sort']);_0x21b311[_0x95bb('0x3e')]=qs[_0x95bb('0x3f')](_[_0x95bb('0x40')](_0x179b57[_0x95bb('0x34')],_0x540f61[_0x95bb('0x3f')]),_0x8bd1c7);if(_0x179b57[_0x95bb('0x34')]['filter']){_0x21b311[_0x95bb('0x3e')]=_[_0x95bb('0x41')](_0x21b311[_0x95bb('0x3e')],{'$or':_[_0x95bb('0x33')](_0x8bd1c7,function(_0x165d92){if(_0x165d92[_0x95bb('0x30')]!=='VIRTUAL'){var _0xfd01a5={};_0xfd01a5[_0x165d92[_0x95bb('0x2a')]]={'$like':'%'+_0x179b57[_0x95bb('0x34')][_0x95bb('0x42')]+'%'};return _0xfd01a5;}})});}_0x21b311=_[_0x95bb('0x41')]({},_0x21b311,_0x179b57[_0x95bb('0x43')]);var _0x1425ef={'where':_0x21b311[_0x95bb('0x3e')]};return db[_0x95bb('0x2d')]['count'](_0x1425ef)['then'](function(_0x1f809f){_0x3f17e0[_0x95bb('0x20')]=_0x1f809f;if(_0x179b57['query'][_0x95bb('0x44')]){_0x21b311[_0x95bb('0x45')]=[{'all':!![]}];}return db['FreshsalesField'][_0x95bb('0x46')](_0x21b311);})['then'](function(_0x2fa754){_0x3f17e0[_0x95bb('0x47')]=_0x2fa754;return _0x3f17e0;})[_0x95bb('0x27')](respondWithFilteredResult(_0x296d84,_0x21b311))['catch'](handleError(_0x296d84,null));};exports[_0x95bb('0x48')]=function(_0x3feeab,_0x25dc81){var _0x2f9e5c={'raw':!![],'where':{'id':_0x3feeab[_0x95bb('0x49')]['id']}},_0x959a84={};_0x959a84[_0x95bb('0x32')]=_[_0x95bb('0x35')](db['FreshsalesField'][_0x95bb('0x2e')]);_0x959a84[_0x95bb('0x34')]=_['keys'](_0x3feeab[_0x95bb('0x34')]);_0x959a84['filters']=_[_0x95bb('0x36')](_0x959a84[_0x95bb('0x32')],_0x959a84['query']);_0x2f9e5c[_0x95bb('0x37')]=_[_0x95bb('0x36')](_0x959a84['model'],qs[_0x95bb('0x38')](_0x3feeab[_0x95bb('0x34')][_0x95bb('0x38')]));_0x2f9e5c[_0x95bb('0x37')]=_0x2f9e5c[_0x95bb('0x37')][_0x95bb('0x39')]?_0x2f9e5c[_0x95bb('0x37')]:_0x959a84[_0x95bb('0x32')];if(_0x3feeab['query'][_0x95bb('0x44')]){_0x2f9e5c[_0x95bb('0x45')]=[{'all':!![]}];}_0x2f9e5c=_[_0x95bb('0x41')]({},_0x2f9e5c,_0x3feeab[_0x95bb('0x43')]);return db[_0x95bb('0x2d')][_0x95bb('0x4a')](_0x2f9e5c)[_0x95bb('0x27')](handleEntityNotFound(_0x25dc81,null))[_0x95bb('0x27')](respondWithResult(_0x25dc81,null))[_0x95bb('0x4b')](handleError(_0x25dc81,null));};exports['create']=function(_0x1aa87e,_0x28de3d){return db[_0x95bb('0x2d')][_0x95bb('0x4c')](_0x1aa87e['body'],{})['then'](respondWithResult(_0x28de3d,0xc9))[_0x95bb('0x4b')](handleError(_0x28de3d,null));};exports['update']=function(_0x10da16,_0x41ed6e){if(_0x10da16[_0x95bb('0x4d')]['id']){delete _0x10da16[_0x95bb('0x4d')]['id'];}return db[_0x95bb('0x2d')][_0x95bb('0x4a')]({'where':{'id':_0x10da16['params']['id']}})[_0x95bb('0x27')](handleEntityNotFound(_0x41ed6e,null))['then'](saveUpdates(_0x10da16['body'],null))['then'](respondWithResult(_0x41ed6e,null))['catch'](handleError(_0x41ed6e,null));};exports[_0x95bb('0x28')]=function(_0x362f1c,_0x225f44){return db[_0x95bb('0x2d')][_0x95bb('0x4a')]({'where':{'id':_0x362f1c[_0x95bb('0x49')]['id']}})[_0x95bb('0x27')](handleEntityNotFound(_0x225f44,null))[_0x95bb('0x27')](removeEntity(_0x225f44,null))[_0x95bb('0x4b')](handleError(_0x225f44,null));}; \ No newline at end of file +var _0xddcd=['moment','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','save','update','then','error','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','FreshsalesField','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','rimraf','zip-dir','request-promise'];(function(_0x488885,_0x65bf25){var _0x31df67=function(_0x4ba35f){while(--_0x4ba35f){_0x488885['push'](_0x488885['shift']());}};_0x31df67(++_0x65bf25);}(_0xddcd,0x19b));var _0xdddc=function(_0x26213f,_0x3906f2){_0x26213f=_0x26213f-0x0;var _0x3a949a=_0xddcd[_0x26213f];return _0x3a949a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdddc('0x0'));var zipdir=require(_0xdddc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdddc('0x2'));var moment=require(_0xdddc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdddc('0x4'));var path=require(_0xdddc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdddc('0x6'));var fs=require('fs');var fs_extra=require(_0xdddc('0x7'));var _=require('lodash');var squel=require(_0xdddc('0x8'));var crypto=require(_0xdddc('0x9'));var jsforce=require(_0xdddc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdddc('0xb'));var querystring=require(_0xdddc('0xc'));var Papa=require(_0xdddc('0xd'));var Redis=require('ioredis');var authService=require(_0xdddc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdddc('0xf'));var logger=require(_0xdddc('0x10'))(_0xdddc('0x11'));var utils=require('../../config/utils');var config=require(_0xdddc('0x12'));var licenseUtil=require(_0xdddc('0x13'));var db=require(_0xdddc('0x14'))['db'];function respondWithStatusCode(_0x21befa,_0x22100f){_0x22100f=_0x22100f||0xcc;return function(_0x3b0ab5){if(_0x3b0ab5){return _0x21befa[_0xdddc('0x15')](_0x22100f);}return _0x21befa[_0xdddc('0x16')](_0x22100f)['end']();};}function respondWithResult(_0x4c5a93,_0x588b76){_0x588b76=_0x588b76||0xc8;return function(_0x5bedc0){if(_0x5bedc0){return _0x4c5a93[_0xdddc('0x16')](_0x588b76)['json'](_0x5bedc0);}};}function respondWithFilteredResult(_0x55a59c,_0x2d7524){return function(_0x5c92ba){if(_0x5c92ba){var _0x44b447=typeof _0x2d7524['offset']===_0xdddc('0x17')&&typeof _0x2d7524[_0xdddc('0x18')]===_0xdddc('0x17');var _0x453ad6=_0x5c92ba['count'];var _0x5baf5b=_0x44b447?0x0:_0x2d7524[_0xdddc('0x19')];var _0x31eef8=_0x44b447?_0x5c92ba[_0xdddc('0x1a')]:_0x2d7524[_0xdddc('0x19')]+_0x2d7524[_0xdddc('0x18')];var _0x11e828;if(_0x31eef8>=_0x453ad6){_0x31eef8=_0x453ad6;_0x11e828=0xc8;}else{_0x11e828=0xce;}_0x55a59c[_0xdddc('0x16')](_0x11e828);return _0x55a59c[_0xdddc('0x1b')](_0xdddc('0x1c'),_0x5baf5b+'-'+_0x31eef8+'/'+_0x453ad6)[_0xdddc('0x1d')](_0x5c92ba);}return null;};}function patchUpdates(_0x4979e4){return function(_0x338c83){try{jsonpatch[_0xdddc('0x1e')](_0x338c83,_0x4979e4,!![]);}catch(_0xa919dc){return BPromise['reject'](_0xa919dc);}return _0x338c83[_0xdddc('0x1f')]();};}function saveUpdates(_0x2d7666,_0x27492c){return function(_0x4f0fe7){if(_0x4f0fe7){return _0x4f0fe7[_0xdddc('0x20')](_0x2d7666)[_0xdddc('0x21')](function(_0x189177){return _0x189177;});}return null;};}function removeEntity(_0x5ebd63,_0x298db1){return function(_0x1452cd){if(_0x1452cd){return _0x1452cd['destroy']()['then'](function(){_0x5ebd63[_0xdddc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa58247,_0x4a6747){return function(_0x3a4bed){if(!_0x3a4bed){_0xa58247['sendStatus'](0x194);}return _0x3a4bed;};}function handleError(_0x264905,_0x316452){_0x316452=_0x316452||0x1f4;return function(_0x4d76e8){logger[_0xdddc('0x22')](_0x4d76e8[_0xdddc('0x23')]);if(_0x4d76e8[_0xdddc('0x24')]){delete _0x4d76e8[_0xdddc('0x24')];}_0x264905[_0xdddc('0x16')](_0x316452)['send'](_0x4d76e8);};}exports[_0xdddc('0x25')]=function(_0x5d5220,_0x260dba){var _0x5c7430={},_0x2e2093={},_0x4e5637={'count':0x0,'rows':[]};var _0x20df44=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x188af6){return{'name':_0x188af6[_0xdddc('0x26')],'type':_0x188af6[_0xdddc('0x27')][_0xdddc('0x28')]};});_0x2e2093[_0xdddc('0x29')]=_[_0xdddc('0x2a')](_0x20df44,'name');_0x2e2093[_0xdddc('0x2b')]=_[_0xdddc('0x2c')](_0x5d5220[_0xdddc('0x2b')]);_0x2e2093['filters']=_[_0xdddc('0x2d')](_0x2e2093[_0xdddc('0x29')],_0x2e2093[_0xdddc('0x2b')]);_0x5c7430[_0xdddc('0x2e')]=_[_0xdddc('0x2d')](_0x2e2093['model'],qs[_0xdddc('0x2f')](_0x5d5220['query'][_0xdddc('0x2f')]));_0x5c7430['attributes']=_0x5c7430['attributes'][_0xdddc('0x30')]?_0x5c7430[_0xdddc('0x2e')]:_0x2e2093['model'];if(!_0x5d5220[_0xdddc('0x2b')][_0xdddc('0x31')]('nolimit')){_0x5c7430[_0xdddc('0x18')]=qs[_0xdddc('0x18')](_0x5d5220['query'][_0xdddc('0x18')]);_0x5c7430[_0xdddc('0x19')]=qs['offset'](_0x5d5220['query'][_0xdddc('0x19')]);}_0x5c7430[_0xdddc('0x32')]=qs[_0xdddc('0x33')](_0x5d5220['query']['sort']);_0x5c7430['where']=qs[_0xdddc('0x34')](_[_0xdddc('0x35')](_0x5d5220[_0xdddc('0x2b')],_0x2e2093[_0xdddc('0x34')]),_0x20df44);if(_0x5d5220[_0xdddc('0x2b')]['filter']){_0x5c7430[_0xdddc('0x36')]=_[_0xdddc('0x37')](_0x5c7430[_0xdddc('0x36')],{'$or':_[_0xdddc('0x2a')](_0x20df44,function(_0x40480d){if(_0x40480d[_0xdddc('0x27')]!=='VIRTUAL'){var _0x365124={};_0x365124[_0x40480d[_0xdddc('0x24')]]={'$like':'%'+_0x5d5220['query'][_0xdddc('0x38')]+'%'};return _0x365124;}})});}_0x5c7430=_[_0xdddc('0x37')]({},_0x5c7430,_0x5d5220[_0xdddc('0x39')]);var _0x410a60={'where':_0x5c7430[_0xdddc('0x36')]};return db[_0xdddc('0x3a')][_0xdddc('0x1a')](_0x410a60)[_0xdddc('0x21')](function(_0x33ad81){_0x4e5637[_0xdddc('0x1a')]=_0x33ad81;if(_0x5d5220[_0xdddc('0x2b')][_0xdddc('0x3b')]){_0x5c7430[_0xdddc('0x3c')]=[{'all':!![]}];}return db['FreshsalesField'][_0xdddc('0x3d')](_0x5c7430);})['then'](function(_0x146879){_0x4e5637[_0xdddc('0x3e')]=_0x146879;return _0x4e5637;})[_0xdddc('0x21')](respondWithFilteredResult(_0x260dba,_0x5c7430))[_0xdddc('0x3f')](handleError(_0x260dba,null));};exports['show']=function(_0x3cad90,_0x92c337){var _0x1598f7={'raw':!![],'where':{'id':_0x3cad90[_0xdddc('0x40')]['id']}},_0x5106cd={};_0x5106cd['model']=_['keys'](db[_0xdddc('0x3a')]['rawAttributes']);_0x5106cd[_0xdddc('0x2b')]=_[_0xdddc('0x2c')](_0x3cad90['query']);_0x5106cd[_0xdddc('0x34')]=_[_0xdddc('0x2d')](_0x5106cd[_0xdddc('0x29')],_0x5106cd[_0xdddc('0x2b')]);_0x1598f7['attributes']=_[_0xdddc('0x2d')](_0x5106cd[_0xdddc('0x29')],qs[_0xdddc('0x2f')](_0x3cad90[_0xdddc('0x2b')][_0xdddc('0x2f')]));_0x1598f7[_0xdddc('0x2e')]=_0x1598f7[_0xdddc('0x2e')][_0xdddc('0x30')]?_0x1598f7[_0xdddc('0x2e')]:_0x5106cd[_0xdddc('0x29')];if(_0x3cad90[_0xdddc('0x2b')]['includeAll']){_0x1598f7[_0xdddc('0x3c')]=[{'all':!![]}];}_0x1598f7=_[_0xdddc('0x37')]({},_0x1598f7,_0x3cad90[_0xdddc('0x39')]);return db[_0xdddc('0x3a')][_0xdddc('0x41')](_0x1598f7)[_0xdddc('0x21')](handleEntityNotFound(_0x92c337,null))[_0xdddc('0x21')](respondWithResult(_0x92c337,null))['catch'](handleError(_0x92c337,null));};exports[_0xdddc('0x42')]=function(_0xa0e7e4,_0xc4a22b){return db[_0xdddc('0x3a')][_0xdddc('0x42')](_0xa0e7e4[_0xdddc('0x43')],{})[_0xdddc('0x21')](respondWithResult(_0xc4a22b,0xc9))[_0xdddc('0x3f')](handleError(_0xc4a22b,null));};exports[_0xdddc('0x20')]=function(_0x9dddd5,_0xa82be8){if(_0x9dddd5['body']['id']){delete _0x9dddd5[_0xdddc('0x43')]['id'];}return db['FreshsalesField'][_0xdddc('0x41')]({'where':{'id':_0x9dddd5[_0xdddc('0x40')]['id']}})[_0xdddc('0x21')](handleEntityNotFound(_0xa82be8,null))[_0xdddc('0x21')](saveUpdates(_0x9dddd5[_0xdddc('0x43')],null))[_0xdddc('0x21')](respondWithResult(_0xa82be8,null))['catch'](handleError(_0xa82be8,null));};exports[_0xdddc('0x44')]=function(_0xda68f5,_0x11fffc){return db[_0xdddc('0x3a')][_0xdddc('0x41')]({'where':{'id':_0xda68f5['params']['id']}})[_0xdddc('0x21')](handleEntityNotFound(_0x11fffc,null))[_0xdddc('0x21')](removeEntity(_0x11fffc,null))['catch'](handleError(_0x11fffc,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 463cd63..7920de9 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 _0x3d45=['../../config/logger','api','moment','request-promise','path','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util'];(function(_0x4aa261,_0x517ce3){var _0x4ad580=function(_0x488286){while(--_0x488286){_0x4aa261['push'](_0x4aa261['shift']());}};_0x4ad580(++_0x517ce3);}(_0x3d45,0x1d2));var _0x53d4=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3d45[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x53d4('0x0'));var util=require(_0x53d4('0x1'));var logger=require(_0x53d4('0x2'))(_0x53d4('0x3'));var moment=require(_0x53d4('0x4'));var BPromise=require('bluebird');var rp=require(_0x53d4('0x5'));var fs=require('fs');var path=require(_0x53d4('0x6'));var rimraf=require('rimraf');var config=require(_0x53d4('0x7'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x4cfea8,_0x54b0a4){return _0x4cfea8[_0x53d4('0x8')](_0x53d4('0x9'),attributes,{'tableName':_0x53d4('0xa'),'paranoid':![],'indexes':[{'name':_0x53d4('0xb'),'fields':[_0x53d4('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4253=['request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','api','bluebird'];(function(_0x1d3ffb,_0x125415){var _0x437c1c=function(_0xcded78){while(--_0xcded78){_0x1d3ffb['push'](_0x1d3ffb['shift']());}};_0x437c1c(++_0x125415);}(_0x4253,0x14c));var _0x3425=function(_0x18783e,_0x11669d){_0x18783e=_0x18783e-0x0;var _0x1a7744=_0x4253[_0x18783e];return _0x1a7744;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var logger=require('../../config/logger')(_0x3425('0x2'));var moment=require('moment');var BPromise=require(_0x3425('0x3'));var rp=require(_0x3425('0x4'));var fs=require('fs');var path=require(_0x3425('0x5'));var rimraf=require(_0x3425('0x6'));var config=require(_0x3425('0x7'));var attributes=require(_0x3425('0x8'));module[_0x3425('0x9')]=function(_0x58e8f3,_0x1a5257){return _0x58e8f3['define'](_0x3425('0xa'),attributes,{'tableName':_0x3425('0xb'),'paranoid':![],'indexes':[{'name':_0x3425('0xc'),'fields':['idField',_0x3425('0xd')],'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 b395957..6a0ccb7 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 _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x433c4d,_0x22e86c){var _0x2e8b49=function(_0x3fd644){while(--_0x3fd644){_0x433c4d['push'](_0x433c4d['shift']());}};_0x2e8b49(++_0x22e86c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x469a26,_0x53d73d){_0x469a26=_0x469a26-0x0;var _0x2f3ad8=_0xc6ac[_0x469a26];return _0x2f3ad8;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x29aeff,_0x5c90c4){var _0x5a7b49=function(_0x40579e){while(--_0x40579e){_0x29aeff['push'](_0x29aeff['shift']());}};_0x5a7b49(++_0x5c90c4);}(_0x1883,0xab));var _0x3188=function(_0x2d33c7,_0x20e736){_0x2d33c7=_0x2d33c7-0x0;var _0x3f5a29=_0x1883[_0x2d33c7];return _0x3f5a29;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e5df190..f5e6a21 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x330477,_0x544f17){var _0x368cab=function(_0x302028){while(--_0x302028){_0x330477['push'](_0x330477['shift']());}};_0x368cab(++_0x544f17);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x3ca305,_0x11012b){var _0x2269b9=function(_0x5b4954){while(--_0x5b4954){_0x3ca305['push'](_0x3ca305['shift']());}};_0x2269b9(++_0x11012b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index c76b278..1ee0717 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 _0xb679=['username','newTab','integrationTab','exports','STRING'];(function(_0x2b633b,_0x31ecb4){var _0xf23aaa=function(_0x396353){while(--_0x396353){_0x2b633b['push'](_0x2b633b['shift']());}};_0xf23aaa(++_0x31ecb4);}(_0xb679,0x1e8));var _0x9b67=function(_0x256f76,_0x808ef8){_0x256f76=_0x256f76-0x0;var _0x3a2920=_0xb679[_0x256f76];return _0x3a2920;};'use strict';var Sequelize=require('sequelize');module[_0x9b67('0x0')]={'name':{'type':Sequelize[_0x9b67('0x1')]},'description':{'type':Sequelize[_0x9b67('0x1')]},'username':{'type':Sequelize[_0x9b67('0x1')],'unique':_0x9b67('0x2')},'remoteUri':{'type':Sequelize[_0x9b67('0x1')]},'password':{'type':Sequelize[_0x9b67('0x1')]},'clientId':{'type':Sequelize[_0x9b67('0x1')]},'clientSecret':{'type':Sequelize[_0x9b67('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9b67('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x9b67('0x3')),'defaultValue':_0x9b67('0x4')}}; \ No newline at end of file +var _0x9a18=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x9a18,0x187));var _0x89a1=function(_0x426679,_0x176bbe){_0x426679=_0x426679-0x0;var _0x66e635=_0x9a18[_0x426679];return _0x66e635;};'use strict';var Sequelize=require(_0x89a1('0x0'));module['exports']={'name':{'type':Sequelize[_0x89a1('0x1')]},'description':{'type':Sequelize[_0x89a1('0x1')]},'username':{'type':Sequelize[_0x89a1('0x1')],'unique':_0x89a1('0x2')},'remoteUri':{'type':Sequelize[_0x89a1('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x89a1('0x1')]},'clientSecret':{'type':Sequelize[_0x89a1('0x1')]},'securityToken':{'type':Sequelize[_0x89a1('0x1')]},'serverUrl':{'type':Sequelize[_0x89a1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x89a1('0x3')](_0x89a1('0x4'),_0x89a1('0x5')),'defaultValue':_0x89a1('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index a3b8e32..5dfd474 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 _0x8506=['query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','merge','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','findOne','SalesforceConfiguration','getConfigurations','AccountId','getSubjects','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','clientId','password','securityToken','slice','lastIndexOf','Connection','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x35728a,_0x25f64d){var _0x32351e=function(_0x35e107){while(--_0x35e107){_0x35728a['push'](_0x35728a['shift']());}};_0x32351e(++_0x25f64d);}(_0x8506,0x1d5));var _0x6850=function(_0x28d824,_0x34612a){_0x28d824=_0x28d824-0x0;var _0x286f1a=_0x8506[_0x28d824];return _0x286f1a;};'use strict';var emlformat=require(_0x6850('0x0'));var rimraf=require(_0x6850('0x1'));var zipdir=require(_0x6850('0x2'));var jsonpatch=require(_0x6850('0x3'));var rp=require(_0x6850('0x4'));var moment=require(_0x6850('0x5'));var BPromise=require(_0x6850('0x6'));var Mustache=require('mustache');var util=require(_0x6850('0x7'));var path=require(_0x6850('0x8'));var sox=require('sox');var csv=require(_0x6850('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6850('0xa'));var _=require(_0x6850('0xb'));var squel=require(_0x6850('0xc'));var crypto=require(_0x6850('0xd'));var jsforce=require(_0x6850('0xe'));var deskjs=require(_0x6850('0xf'));var toCsv=require(_0x6850('0x9'));var querystring=require(_0x6850('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6850('0x11'));var hardwareService=require(_0x6850('0x12'));var logger=require(_0x6850('0x13'))(_0x6850('0x14'));var utils=require(_0x6850('0x15'));var config=require(_0x6850('0x16'));var licenseUtil=require(_0x6850('0x17'));var db=require(_0x6850('0x18'))['db'];var integrations=require(_0x6850('0x19'));function respondWithStatusCode(_0x52f5d1,_0x17afeb){_0x17afeb=_0x17afeb||0xcc;return function(_0x1d0080){if(_0x1d0080){return _0x52f5d1[_0x6850('0x1a')](_0x17afeb);}return _0x52f5d1[_0x6850('0x1b')](_0x17afeb)[_0x6850('0x1c')]();};}function respondWithResult(_0x844aa9,_0x196d5c){_0x196d5c=_0x196d5c||0xc8;return function(_0x3627e6){if(_0x3627e6){return _0x844aa9['status'](_0x196d5c)[_0x6850('0x1d')](_0x3627e6);}};}function respondWithFilteredResult(_0x597650,_0xd24659){return function(_0x5e03c2){if(_0x5e03c2){var _0x1a2667=typeof _0xd24659['offset']===_0x6850('0x1e')&&typeof _0xd24659[_0x6850('0x1f')]===_0x6850('0x1e');var _0x1a5fe1=_0x5e03c2[_0x6850('0x20')];var _0x30600d=_0x1a2667?0x0:_0xd24659['offset'];var _0x35a67b=_0x1a2667?_0x5e03c2[_0x6850('0x20')]:_0xd24659['offset']+_0xd24659[_0x6850('0x1f')];var _0xe32bc5;if(_0x35a67b>=_0x1a5fe1){_0x35a67b=_0x1a5fe1;_0xe32bc5=0xc8;}else{_0xe32bc5=0xce;}_0x597650['status'](_0xe32bc5);return _0x597650[_0x6850('0x21')](_0x6850('0x22'),_0x30600d+'-'+_0x35a67b+'/'+_0x1a5fe1)[_0x6850('0x1d')](_0x5e03c2);}return null;};}function patchUpdates(_0x5eb4ea){return function(_0x5c20fd){try{jsonpatch['apply'](_0x5c20fd,_0x5eb4ea,!![]);}catch(_0x76222){return BPromise[_0x6850('0x23')](_0x76222);}return _0x5c20fd[_0x6850('0x24')]();};}function saveUpdates(_0x2ef188,_0x28c3b5){return function(_0x401ca3){if(_0x401ca3){return _0x401ca3[_0x6850('0x25')](_0x2ef188)['then'](function(_0x1bc538){return _0x1bc538;});}return null;};}function removeEntity(_0x266910,_0x4ce190){return function(_0x11deeb){if(_0x11deeb){return _0x11deeb[_0x6850('0x26')]()[_0x6850('0x27')](function(){_0x266910[_0x6850('0x1b')](0xcc)[_0x6850('0x1c')]();});}};}function handleEntityNotFound(_0x3b1cd9,_0x2764f9){return function(_0x1482a6){if(!_0x1482a6){_0x3b1cd9[_0x6850('0x1a')](0x194);}return _0x1482a6;};}function handleError(_0x44b6f1,_0x36e44a){_0x36e44a=_0x36e44a||0x1f4;return function(_0x177e76){logger['error'](_0x177e76[_0x6850('0x28')]);if(_0x177e76[_0x6850('0x29')]){delete _0x177e76[_0x6850('0x29')];}_0x44b6f1[_0x6850('0x1b')](_0x36e44a)['send'](_0x177e76);};}exports[_0x6850('0x2a')]=function(_0x3a413b,_0x26e604){var _0x422f07={},_0x42e758={},_0xb6020d={'count':0x0,'rows':[]};var _0x4c2a8f=_[_0x6850('0x2b')](db[_0x6850('0x2c')][_0x6850('0x2d')],function(_0x1b62bc){return{'name':_0x1b62bc[_0x6850('0x2e')],'type':_0x1b62bc[_0x6850('0x2f')][_0x6850('0x30')]};});_0x42e758[_0x6850('0x31')]=_[_0x6850('0x2b')](_0x4c2a8f,_0x6850('0x29'));_0x42e758['query']=_[_0x6850('0x32')](_0x3a413b[_0x6850('0x33')]);_0x42e758['filters']=_[_0x6850('0x34')](_0x42e758[_0x6850('0x31')],_0x42e758[_0x6850('0x33')]);_0x422f07['attributes']=_[_0x6850('0x34')](_0x42e758[_0x6850('0x31')],qs[_0x6850('0x35')](_0x3a413b[_0x6850('0x33')][_0x6850('0x35')]));_0x422f07[_0x6850('0x36')]=_0x422f07['attributes'][_0x6850('0x37')]?_0x422f07[_0x6850('0x36')]:_0x42e758[_0x6850('0x31')];if(!_0x3a413b[_0x6850('0x33')][_0x6850('0x38')](_0x6850('0x39'))){_0x422f07[_0x6850('0x1f')]=qs[_0x6850('0x1f')](_0x3a413b['query'][_0x6850('0x1f')]);_0x422f07[_0x6850('0x3a')]=qs[_0x6850('0x3a')](_0x3a413b[_0x6850('0x33')][_0x6850('0x3a')]);}_0x422f07[_0x6850('0x3b')]=qs[_0x6850('0x3c')](_0x3a413b[_0x6850('0x33')][_0x6850('0x3c')]);_0x422f07['where']=qs['filters'](_[_0x6850('0x3d')](_0x3a413b[_0x6850('0x33')],_0x42e758[_0x6850('0x3e')]),_0x4c2a8f);if(_0x3a413b['query']['filter']){_0x422f07['where']=_[_0x6850('0x3f')](_0x422f07[_0x6850('0x40')],{'$or':_['map'](_0x4c2a8f,function(_0x56fa74){if(_0x56fa74[_0x6850('0x2f')]!==_0x6850('0x41')){var _0x1b1a96={};_0x1b1a96[_0x56fa74[_0x6850('0x29')]]={'$like':'%'+_0x3a413b[_0x6850('0x33')][_0x6850('0x42')]+'%'};return _0x1b1a96;}})});}_0x422f07=_['merge']({},_0x422f07,_0x3a413b[_0x6850('0x43')]);var _0x4c9577={'where':_0x422f07[_0x6850('0x40')]};return db[_0x6850('0x2c')][_0x6850('0x20')](_0x4c9577)[_0x6850('0x27')](function(_0x4c4d52){_0xb6020d[_0x6850('0x20')]=_0x4c4d52;if(_0x3a413b[_0x6850('0x33')]['includeAll']){_0x422f07[_0x6850('0x44')]=[{'all':!![]}];}return db[_0x6850('0x2c')][_0x6850('0x45')](_0x422f07);})['then'](function(_0x380067){_0xb6020d[_0x6850('0x46')]=_0x380067;return _0xb6020d;})[_0x6850('0x27')](respondWithFilteredResult(_0x26e604,_0x422f07))[_0x6850('0x47')](handleError(_0x26e604,null));};exports[_0x6850('0x48')]=function(_0x1efa3f,_0xf49fb9){var _0x4660ba={'raw':![],'where':{'id':_0x1efa3f[_0x6850('0x49')]['id']}},_0x137722={};_0x137722[_0x6850('0x31')]=_[_0x6850('0x32')](db[_0x6850('0x2c')]['rawAttributes']);_0x137722['query']=_[_0x6850('0x32')](_0x1efa3f['query']);_0x137722[_0x6850('0x3e')]=_[_0x6850('0x34')](_0x137722['model'],_0x137722[_0x6850('0x33')]);_0x4660ba[_0x6850('0x36')]=_[_0x6850('0x34')](_0x137722[_0x6850('0x31')],qs[_0x6850('0x35')](_0x1efa3f[_0x6850('0x33')][_0x6850('0x35')]));_0x4660ba[_0x6850('0x36')]=_0x4660ba['attributes'][_0x6850('0x37')]?_0x4660ba[_0x6850('0x36')]:_0x137722[_0x6850('0x31')];if(_0x1efa3f[_0x6850('0x33')][_0x6850('0x4a')]){_0x4660ba[_0x6850('0x44')]=[{'all':!![]}];}_0x4660ba=_[_0x6850('0x3f')]({},_0x4660ba,_0x1efa3f['options']);return db[_0x6850('0x2c')][_0x6850('0x4b')](_0x4660ba)[_0x6850('0x27')](handleEntityNotFound(_0xf49fb9,null))['then'](respondWithResult(_0xf49fb9,null))[_0x6850('0x47')](handleError(_0xf49fb9,null));};exports['create']=function(_0x3b3c28,_0x16ee98){return db[_0x6850('0x2c')][_0x6850('0x4c')](_0x3b3c28[_0x6850('0x4d')],{})[_0x6850('0x27')](respondWithResult(_0x16ee98,0xc9))[_0x6850('0x47')](handleError(_0x16ee98,null));};exports['update']=function(_0x302ba3,_0x165c2d){if(_0x302ba3[_0x6850('0x4d')]['id']){delete _0x302ba3[_0x6850('0x4d')]['id'];}return db[_0x6850('0x2c')][_0x6850('0x4b')]({'where':{'id':_0x302ba3['params']['id']}})[_0x6850('0x27')](handleEntityNotFound(_0x165c2d,null))[_0x6850('0x27')](saveUpdates(_0x302ba3[_0x6850('0x4d')],null))[_0x6850('0x27')](respondWithResult(_0x165c2d,null))['catch'](handleError(_0x165c2d,null));};exports[_0x6850('0x26')]=function(_0x40d0e9,_0x25a3f0){return db[_0x6850('0x2c')]['find']({'where':{'id':_0x40d0e9['params']['id']}})['then'](handleEntityNotFound(_0x25a3f0,null))[_0x6850('0x27')](removeEntity(_0x25a3f0,null))[_0x6850('0x47')](handleError(_0x25a3f0,null));};exports['getConfigurations']=function(_0x57a948,_0x225a72,_0x5175b2){var _0x2e7713={};var _0x2a7575={};var _0x5e1dcd;var _0x452c25;return db[_0x6850('0x2c')][_0x6850('0x4e')]({'where':{'id':_0x57a948[_0x6850('0x49')]['id']}})[_0x6850('0x27')](handleEntityNotFound(_0x225a72,null))['then'](function(_0xc35895){if(_0xc35895){_0x5e1dcd=_0xc35895;_0x2a7575[_0x6850('0x31')]=_[_0x6850('0x32')](db[_0x6850('0x4f')][_0x6850('0x2d')]);_0x2a7575['query']=_['keys'](_0x57a948['query']);_0x2a7575[_0x6850('0x3e')]=_['intersection'](_0x2a7575[_0x6850('0x31')],_0x2a7575[_0x6850('0x33')]);_0x2e7713[_0x6850('0x36')]=_[_0x6850('0x34')](_0x2a7575[_0x6850('0x31')],qs[_0x6850('0x35')](_0x57a948['query'][_0x6850('0x35')]));_0x2e7713[_0x6850('0x36')]=_0x2e7713[_0x6850('0x36')]['length']?_0x2e7713[_0x6850('0x36')]:_0x2a7575[_0x6850('0x31')];_0x2e7713[_0x6850('0x3b')]=qs[_0x6850('0x3c')](_0x57a948['query'][_0x6850('0x3c')]);_0x2e7713['where']=qs[_0x6850('0x3e')](_[_0x6850('0x3d')](_0x57a948[_0x6850('0x33')],_0x2a7575[_0x6850('0x3e')]));if(_0x57a948['query']['filter']){_0x2e7713[_0x6850('0x40')]=_[_0x6850('0x3f')](_0x2e7713['where'],{'$or':_[_0x6850('0x2b')](_0x2e7713[_0x6850('0x36')],function(_0x56cddc){var _0x1b5303={};_0x1b5303[_0x56cddc]={'$like':'%'+_0x57a948[_0x6850('0x33')][_0x6850('0x42')]+'%'};return _0x1b5303;})});}_0x2e7713=_['merge']({},_0x2e7713,_0x57a948[_0x6850('0x43')]);return _0x5e1dcd['getConfigurations'](_0x2e7713);}})[_0x6850('0x27')](function(_0x3d30bd){if(_0x3d30bd){_0x452c25=_0x3d30bd['length'];if(!_0x57a948[_0x6850('0x33')][_0x6850('0x38')]('nolimit')){_0x2e7713['limit']=qs['limit'](_0x57a948[_0x6850('0x33')][_0x6850('0x1f')]);_0x2e7713[_0x6850('0x3a')]=qs[_0x6850('0x3a')](_0x57a948['query'][_0x6850('0x3a')]);}return _0x5e1dcd[_0x6850('0x50')](_0x2e7713);}})['then'](function(_0x1f3f97){if(_0x1f3f97){return _0x1f3f97?{'count':_0x452c25,'rows':_0x1f3f97}:null;}})['then'](respondWithResult(_0x225a72,null))[_0x6850('0x47')](handleError(_0x225a72,null));};exports['addConfiguration']=function(_0x3a779e,_0x118f08,_0x508129){if(_0x3a779e[_0x6850('0x4d')]['id']){delete _0x3a779e[_0x6850('0x4d')]['id'];}return db[_0x6850('0x2c')][_0x6850('0x4e')]({'where':{'id':_0x3a779e['params']['id']}})[_0x6850('0x27')](handleEntityNotFound(_0x118f08,null))['then'](function(_0x2f9338){if(_0x2f9338){_0x3a779e[_0x6850('0x4d')][_0x6850('0x51')]=_0x2f9338['id'];_0x3a779e[_0x6850('0x4d')]['Subjects']=integrations[_0x6850('0x52')](_0x3a779e['body']['channel'],_0x3a779e[_0x6850('0x4d')]['type']);_0x3a779e['body']['Descriptions']=integrations[_0x6850('0x53')](_0x3a779e[_0x6850('0x4d')][_0x6850('0x54')],_0x3a779e['body'][_0x6850('0x2f')]);return db[_0x6850('0x4f')][_0x6850('0x4c')](_0x3a779e['body'],{'include':[{'model':db[_0x6850('0x55')],'as':_0x6850('0x56')},{'model':db[_0x6850('0x55')],'as':'Descriptions'}]});}return null;})[_0x6850('0x27')](respondWithResult(_0x118f08,null))[_0x6850('0x47')](handleError(_0x118f08,null));};exports[_0x6850('0x57')]=function(_0x47cfbe,_0x189389,_0x2fd563){var _0x3edb59;var _0xdf313b='';var _0x328743=_0x6850('0x58');return db[_0x6850('0x2c')][_0x6850('0x4e')]({'where':{'id':_0x47cfbe['params']['id']},'attributes':['id','remoteUri',_0x6850('0x59'),'clientSecret','username',_0x6850('0x5a'),_0x6850('0x5b')]})[_0x6850('0x27')](handleEntityNotFound(_0x189389,null))[_0x6850('0x27')](function(_0xe21ecb){if(_0xe21ecb){_0xdf313b=_0xe21ecb['remoteUri'];var _0x193666=_0xdf313b[_0x6850('0x5c')](-0x1);if(_0x193666==='/'){_0xdf313b=_0xdf313b['substring'](0x0,_0xdf313b[_0x6850('0x5d')](_0x193666));}_0x3edb59=new jsforce[(_0x6850('0x5e'))]({'oauth2':{'loginUrl':_0xdf313b,'clientId':_0xe21ecb['clientId'],'clientSecret':_0xe21ecb[_0x6850('0x5f')]}});return _0x3edb59[_0x6850('0x60')](_0xe21ecb[_0x6850('0x61')],_0xe21ecb[_0x6850('0x5a')][_0x6850('0x62')](_0xe21ecb[_0x6850('0x5b')]));}})[_0x6850('0x27')](function(_0x23c730){if(_0x23c730){if(!_[_0x6850('0x63')](_0x47cfbe[_0x6850('0x33')][_0x6850('0x64')])){_0x328743=_0x47cfbe['query'][_0x6850('0x64')];}return _0x3edb59[_0x6850('0x65')](_0x328743)[_0x6850('0x66')]();}})[_0x6850('0x27')](function(_0x40080d){var _0x2b9269=['OwnerId',_0x6850('0x67'),_0x6850('0x68'),_0x6850('0x69'),_0x6850('0x6a'),_0x6850('0x6b')];var _0x3569c3=[_0x6850('0x6c'),'int',_0x6850('0x6d'),_0x6850('0x6e'),_0x6850('0x6f'),_0x6850('0x70'),_0x6850('0x71')];if(_0x40080d){_[_0x6850('0x72')](_0x40080d['fields'],function(_0x291858){return _0x2b9269[_0x6850('0x73')](_0x291858[_0x6850('0x29')])||!_0x3569c3['includes'](_0x291858[_0x6850('0x2f')]);});return{'count':_0x40080d[_0x6850('0x35')][_0x6850('0x37')],'rows':_['map'](_0x40080d[_0x6850('0x35')],function(_0xa1a61f){return{'id':_0xa1a61f[_0x6850('0x29')],'name':_0xa1a61f[_0x6850('0x74')],'custom':_0xa1a61f[_0x6850('0x75')],'options':_0xa1a61f[_0x6850('0x76')][_0x6850('0x37')]>0x0?_['map'](_0xa1a61f[_0x6850('0x76')],function(_0x59d158){return{'name':_0x59d158[_0x6850('0x74')],'value':_0x59d158[_0x6850('0x77')]};}):_0xa1a61f['type']==_0x6850('0x6e')?[{'name':'True','value':_0x6850('0x78')},{'name':_0x6850('0x79'),'value':_0x6850('0x7a')}]:[]};})};}})[_0x6850('0x27')](respondWithResult(_0x189389,null))['catch'](function(_0xc0c625){var _0x3e2c99=_0x47cfbe['query'][_0x6850('0x7b')]?0x1f4:_0xc0c625[_0x6850('0x7c')]||0x1f4;logger[_0x6850('0x7d')](_0x6850('0x7e'),_0x6850('0x57'),_0x3e2c99,JSON[_0x6850('0x7f')](_0xc0c625));delete _0xc0c625[_0x6850('0x29')];if(_0x3e2c99===0x191){_0x3e2c99=0x190;}_0x189389[_0x6850('0x1b')](_0x3e2c99)[_0x6850('0x80')](_0x47cfbe['query'][_0x6850('0x7b')]?{'message':_0x6850('0x81'),'statusCode':_0xc0c625[_0x6850('0x7c')]}:_0xc0c625);});}; \ No newline at end of file +var _0x62ff=['remoteUri','clientId','clientSecret','username','securityToken','lastIndexOf','Connection','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','textarea','includes','label','custom','picklistValues','value','True','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','keys','merge','find','catch','create','body','findOne','getConfigurations','addConfiguration','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x62ff,0x98));var _0xf62f=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x62ff[_0x2aa0e7];return _0x1472c0;};'use strict';var emlformat=require(_0xf62f('0x0'));var rimraf=require(_0xf62f('0x1'));var zipdir=require(_0xf62f('0x2'));var jsonpatch=require(_0xf62f('0x3'));var rp=require(_0xf62f('0x4'));var moment=require(_0xf62f('0x5'));var BPromise=require(_0xf62f('0x6'));var Mustache=require(_0xf62f('0x7'));var util=require('util');var path=require(_0xf62f('0x8'));var sox=require(_0xf62f('0x9'));var csv=require('to-csv');var ejs=require(_0xf62f('0xa'));var fs=require('fs');var fs_extra=require(_0xf62f('0xb'));var _=require(_0xf62f('0xc'));var squel=require(_0xf62f('0xd'));var crypto=require('crypto');var jsforce=require(_0xf62f('0xe'));var deskjs=require(_0xf62f('0xf'));var toCsv=require(_0xf62f('0x10'));var querystring=require(_0xf62f('0x11'));var Papa=require('papaparse');var Redis=require(_0xf62f('0x12'));var authService=require(_0xf62f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf62f('0x14'));var logger=require('../../config/logger')(_0xf62f('0x15'));var utils=require(_0xf62f('0x16'));var config=require(_0xf62f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf62f('0x18'))['db'];var integrations=require(_0xf62f('0x19'));function respondWithStatusCode(_0x73716a,_0x4a50ca){_0x4a50ca=_0x4a50ca||0xcc;return function(_0xfff976){if(_0xfff976){return _0x73716a['sendStatus'](_0x4a50ca);}return _0x73716a[_0xf62f('0x1a')](_0x4a50ca)[_0xf62f('0x1b')]();};}function respondWithResult(_0x2c9ab6,_0x37a00b){_0x37a00b=_0x37a00b||0xc8;return function(_0x4037c5){if(_0x4037c5){return _0x2c9ab6[_0xf62f('0x1a')](_0x37a00b)[_0xf62f('0x1c')](_0x4037c5);}};}function respondWithFilteredResult(_0x453c46,_0x4a7a86){return function(_0x3d00f3){if(_0x3d00f3){var _0x22b4f9=typeof _0x4a7a86[_0xf62f('0x1d')]===_0xf62f('0x1e')&&typeof _0x4a7a86[_0xf62f('0x1f')]==='undefined';var _0x47b92e=_0x3d00f3['count'];var _0x9034f6=_0x22b4f9?0x0:_0x4a7a86[_0xf62f('0x1d')];var _0x2a7a03=_0x22b4f9?_0x3d00f3[_0xf62f('0x20')]:_0x4a7a86['offset']+_0x4a7a86['limit'];var _0x1e3e35;if(_0x2a7a03>=_0x47b92e){_0x2a7a03=_0x47b92e;_0x1e3e35=0xc8;}else{_0x1e3e35=0xce;}_0x453c46[_0xf62f('0x1a')](_0x1e3e35);return _0x453c46['set'](_0xf62f('0x21'),_0x9034f6+'-'+_0x2a7a03+'/'+_0x47b92e)[_0xf62f('0x1c')](_0x3d00f3);}return null;};}function patchUpdates(_0x53dbc3){return function(_0x1ba0bf){try{jsonpatch[_0xf62f('0x22')](_0x1ba0bf,_0x53dbc3,!![]);}catch(_0x4cab70){return BPromise['reject'](_0x4cab70);}return _0x1ba0bf[_0xf62f('0x23')]();};}function saveUpdates(_0x44e3ee,_0x372b81){return function(_0x4dfb14){if(_0x4dfb14){return _0x4dfb14[_0xf62f('0x24')](_0x44e3ee)[_0xf62f('0x25')](function(_0x26d6a3){return _0x26d6a3;});}return null;};}function removeEntity(_0x81f2af,_0x1daa76){return function(_0x37152b){if(_0x37152b){return _0x37152b[_0xf62f('0x26')]()[_0xf62f('0x25')](function(){_0x81f2af[_0xf62f('0x1a')](0xcc)[_0xf62f('0x1b')]();});}};}function handleEntityNotFound(_0x131aaf,_0x4cce00){return function(_0x5b7208){if(!_0x5b7208){_0x131aaf[_0xf62f('0x27')](0x194);}return _0x5b7208;};}function handleError(_0x2dd98e,_0x5711da){_0x5711da=_0x5711da||0x1f4;return function(_0x10b16e){logger[_0xf62f('0x28')](_0x10b16e[_0xf62f('0x29')]);if(_0x10b16e[_0xf62f('0x2a')]){delete _0x10b16e['name'];}_0x2dd98e['status'](_0x5711da)[_0xf62f('0x2b')](_0x10b16e);};}exports[_0xf62f('0x2c')]=function(_0x324219,_0xbadf9d){var _0x4440c4={},_0x34fc36={},_0x256a56={'count':0x0,'rows':[]};var _0x445061=_[_0xf62f('0x2d')](db[_0xf62f('0x2e')][_0xf62f('0x2f')],function(_0x36c255){return{'name':_0x36c255[_0xf62f('0x30')],'type':_0x36c255['type']['key']};});_0x34fc36[_0xf62f('0x31')]=_['map'](_0x445061,'name');_0x34fc36[_0xf62f('0x32')]=_['keys'](_0x324219[_0xf62f('0x32')]);_0x34fc36['filters']=_[_0xf62f('0x33')](_0x34fc36['model'],_0x34fc36[_0xf62f('0x32')]);_0x4440c4['attributes']=_[_0xf62f('0x33')](_0x34fc36['model'],qs[_0xf62f('0x34')](_0x324219[_0xf62f('0x32')][_0xf62f('0x34')]));_0x4440c4[_0xf62f('0x35')]=_0x4440c4[_0xf62f('0x35')][_0xf62f('0x36')]?_0x4440c4[_0xf62f('0x35')]:_0x34fc36[_0xf62f('0x31')];if(!_0x324219[_0xf62f('0x32')][_0xf62f('0x37')](_0xf62f('0x38'))){_0x4440c4[_0xf62f('0x1f')]=qs[_0xf62f('0x1f')](_0x324219[_0xf62f('0x32')]['limit']);_0x4440c4[_0xf62f('0x1d')]=qs[_0xf62f('0x1d')](_0x324219[_0xf62f('0x32')]['offset']);}_0x4440c4[_0xf62f('0x39')]=qs[_0xf62f('0x3a')](_0x324219[_0xf62f('0x32')][_0xf62f('0x3a')]);_0x4440c4[_0xf62f('0x3b')]=qs[_0xf62f('0x3c')](_[_0xf62f('0x3d')](_0x324219[_0xf62f('0x32')],_0x34fc36[_0xf62f('0x3c')]),_0x445061);if(_0x324219['query'][_0xf62f('0x3e')]){_0x4440c4['where']=_['merge'](_0x4440c4[_0xf62f('0x3b')],{'$or':_[_0xf62f('0x2d')](_0x445061,function(_0x189bbf){if(_0x189bbf['type']!==_0xf62f('0x3f')){var _0xf5f081={};_0xf5f081[_0x189bbf['name']]={'$like':'%'+_0x324219[_0xf62f('0x32')][_0xf62f('0x3e')]+'%'};return _0xf5f081;}})});}_0x4440c4=_['merge']({},_0x4440c4,_0x324219[_0xf62f('0x40')]);var _0x5672c2={'where':_0x4440c4['where']};return db[_0xf62f('0x2e')][_0xf62f('0x20')](_0x5672c2)[_0xf62f('0x25')](function(_0x424af4){_0x256a56['count']=_0x424af4;if(_0x324219[_0xf62f('0x32')]['includeAll']){_0x4440c4[_0xf62f('0x41')]=[{'all':!![]}];}return db[_0xf62f('0x2e')][_0xf62f('0x42')](_0x4440c4);})[_0xf62f('0x25')](function(_0x366688){_0x256a56[_0xf62f('0x43')]=_0x366688;return _0x256a56;})[_0xf62f('0x25')](respondWithFilteredResult(_0xbadf9d,_0x4440c4))['catch'](handleError(_0xbadf9d,null));};exports[_0xf62f('0x44')]=function(_0x232e16,_0x315e84){var _0x2ebfae={'raw':![],'where':{'id':_0x232e16[_0xf62f('0x45')]['id']}},_0x31f1eb={};_0x31f1eb[_0xf62f('0x31')]=_[_0xf62f('0x46')](db[_0xf62f('0x2e')][_0xf62f('0x2f')]);_0x31f1eb['query']=_[_0xf62f('0x46')](_0x232e16[_0xf62f('0x32')]);_0x31f1eb['filters']=_[_0xf62f('0x33')](_0x31f1eb[_0xf62f('0x31')],_0x31f1eb[_0xf62f('0x32')]);_0x2ebfae[_0xf62f('0x35')]=_[_0xf62f('0x33')](_0x31f1eb[_0xf62f('0x31')],qs[_0xf62f('0x34')](_0x232e16['query']['fields']));_0x2ebfae['attributes']=_0x2ebfae['attributes'][_0xf62f('0x36')]?_0x2ebfae[_0xf62f('0x35')]:_0x31f1eb[_0xf62f('0x31')];if(_0x232e16['query']['includeAll']){_0x2ebfae[_0xf62f('0x41')]=[{'all':!![]}];}_0x2ebfae=_[_0xf62f('0x47')]({},_0x2ebfae,_0x232e16['options']);return db[_0xf62f('0x2e')][_0xf62f('0x48')](_0x2ebfae)['then'](handleEntityNotFound(_0x315e84,null))[_0xf62f('0x25')](respondWithResult(_0x315e84,null))[_0xf62f('0x49')](handleError(_0x315e84,null));};exports[_0xf62f('0x4a')]=function(_0x11ffff,_0x521f83){return db[_0xf62f('0x2e')][_0xf62f('0x4a')](_0x11ffff[_0xf62f('0x4b')],{})[_0xf62f('0x25')](respondWithResult(_0x521f83,0xc9))[_0xf62f('0x49')](handleError(_0x521f83,null));};exports['update']=function(_0x7a1000,_0x2987d0){if(_0x7a1000['body']['id']){delete _0x7a1000['body']['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x7a1000[_0xf62f('0x45')]['id']}})[_0xf62f('0x25')](handleEntityNotFound(_0x2987d0,null))[_0xf62f('0x25')](saveUpdates(_0x7a1000['body'],null))['then'](respondWithResult(_0x2987d0,null))[_0xf62f('0x49')](handleError(_0x2987d0,null));};exports['destroy']=function(_0x216f00,_0x562548){return db[_0xf62f('0x2e')]['find']({'where':{'id':_0x216f00['params']['id']}})[_0xf62f('0x25')](handleEntityNotFound(_0x562548,null))[_0xf62f('0x25')](removeEntity(_0x562548,null))[_0xf62f('0x49')](handleError(_0x562548,null));};exports['getConfigurations']=function(_0x33291d,_0x46ae9a,_0x20ab61){var _0x17c746={};var _0x473976={};var _0x3495cf;var _0x49925c;return db[_0xf62f('0x2e')][_0xf62f('0x4c')]({'where':{'id':_0x33291d['params']['id']}})['then'](handleEntityNotFound(_0x46ae9a,null))[_0xf62f('0x25')](function(_0x5f2424){if(_0x5f2424){_0x3495cf=_0x5f2424;_0x473976['model']=_['keys'](db['SalesforceConfiguration']['rawAttributes']);_0x473976[_0xf62f('0x32')]=_['keys'](_0x33291d[_0xf62f('0x32')]);_0x473976[_0xf62f('0x3c')]=_[_0xf62f('0x33')](_0x473976[_0xf62f('0x31')],_0x473976[_0xf62f('0x32')]);_0x17c746['attributes']=_[_0xf62f('0x33')](_0x473976[_0xf62f('0x31')],qs['fields'](_0x33291d[_0xf62f('0x32')]['fields']));_0x17c746[_0xf62f('0x35')]=_0x17c746[_0xf62f('0x35')][_0xf62f('0x36')]?_0x17c746[_0xf62f('0x35')]:_0x473976[_0xf62f('0x31')];_0x17c746[_0xf62f('0x39')]=qs[_0xf62f('0x3a')](_0x33291d['query'][_0xf62f('0x3a')]);_0x17c746[_0xf62f('0x3b')]=qs['filters'](_[_0xf62f('0x3d')](_0x33291d[_0xf62f('0x32')],_0x473976[_0xf62f('0x3c')]));if(_0x33291d['query']['filter']){_0x17c746['where']=_[_0xf62f('0x47')](_0x17c746[_0xf62f('0x3b')],{'$or':_[_0xf62f('0x2d')](_0x17c746[_0xf62f('0x35')],function(_0xa319db){var _0x23e131={};_0x23e131[_0xa319db]={'$like':'%'+_0x33291d[_0xf62f('0x32')][_0xf62f('0x3e')]+'%'};return _0x23e131;})});}_0x17c746=_[_0xf62f('0x47')]({},_0x17c746,_0x33291d[_0xf62f('0x40')]);return _0x3495cf[_0xf62f('0x4d')](_0x17c746);}})['then'](function(_0xf56eba){if(_0xf56eba){_0x49925c=_0xf56eba['length'];if(!_0x33291d[_0xf62f('0x32')][_0xf62f('0x37')](_0xf62f('0x38'))){_0x17c746[_0xf62f('0x1f')]=qs[_0xf62f('0x1f')](_0x33291d[_0xf62f('0x32')][_0xf62f('0x1f')]);_0x17c746[_0xf62f('0x1d')]=qs[_0xf62f('0x1d')](_0x33291d[_0xf62f('0x32')][_0xf62f('0x1d')]);}return _0x3495cf[_0xf62f('0x4d')](_0x17c746);}})[_0xf62f('0x25')](function(_0x21a2dc){if(_0x21a2dc){return _0x21a2dc?{'count':_0x49925c,'rows':_0x21a2dc}:null;}})[_0xf62f('0x25')](respondWithResult(_0x46ae9a,null))[_0xf62f('0x49')](handleError(_0x46ae9a,null));};exports[_0xf62f('0x4e')]=function(_0x463233,_0x595bc8,_0x2c0f47){if(_0x463233[_0xf62f('0x4b')]['id']){delete _0x463233[_0xf62f('0x4b')]['id'];}return db[_0xf62f('0x2e')]['findOne']({'where':{'id':_0x463233[_0xf62f('0x45')]['id']}})['then'](handleEntityNotFound(_0x595bc8,null))[_0xf62f('0x25')](function(_0x5c3976){if(_0x5c3976){_0x463233[_0xf62f('0x4b')]['AccountId']=_0x5c3976['id'];_0x463233[_0xf62f('0x4b')]['Subjects']=integrations[_0xf62f('0x4f')](_0x463233[_0xf62f('0x4b')][_0xf62f('0x50')],_0x463233[_0xf62f('0x4b')][_0xf62f('0x51')]);_0x463233['body'][_0xf62f('0x52')]=integrations[_0xf62f('0x53')](_0x463233['body'][_0xf62f('0x50')],_0x463233[_0xf62f('0x4b')][_0xf62f('0x51')]);return db['SalesforceConfiguration']['create'](_0x463233[_0xf62f('0x4b')],{'include':[{'model':db[_0xf62f('0x54')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xf62f('0x25')](respondWithResult(_0x595bc8,null))['catch'](handleError(_0x595bc8,null));};exports[_0xf62f('0x55')]=function(_0x10dc9a,_0x20849f,_0x3a6668){var _0x227d7c;var _0x3b2daa='';var _0x471424='Task';return db['SalesforceAccount'][_0xf62f('0x4c')]({'where':{'id':_0x10dc9a[_0xf62f('0x45')]['id']},'attributes':['id',_0xf62f('0x56'),_0xf62f('0x57'),_0xf62f('0x58'),_0xf62f('0x59'),'password',_0xf62f('0x5a')]})[_0xf62f('0x25')](handleEntityNotFound(_0x20849f,null))[_0xf62f('0x25')](function(_0x41eec9){if(_0x41eec9){_0x3b2daa=_0x41eec9['remoteUri'];var _0xe3c3fa=_0x3b2daa['slice'](-0x1);if(_0xe3c3fa==='/'){_0x3b2daa=_0x3b2daa['substring'](0x0,_0x3b2daa[_0xf62f('0x5b')](_0xe3c3fa));}_0x227d7c=new jsforce[(_0xf62f('0x5c'))]({'oauth2':{'loginUrl':_0x3b2daa,'clientId':_0x41eec9[_0xf62f('0x57')],'clientSecret':_0x41eec9[_0xf62f('0x58')]}});return _0x227d7c['login'](_0x41eec9['username'],_0x41eec9['password']['concat'](_0x41eec9[_0xf62f('0x5a')]));}})[_0xf62f('0x25')](function(_0x28de0f){if(_0x28de0f){if(!_[_0xf62f('0x5d')](_0x10dc9a[_0xf62f('0x32')][_0xf62f('0x5e')])){_0x471424=_0x10dc9a[_0xf62f('0x32')]['ticketType'];}return _0x227d7c[_0xf62f('0x5f')](_0x471424)[_0xf62f('0x60')]();}})['then'](function(_0x4276fd){var _0x5b14b7=['OwnerId',_0xf62f('0x61'),_0xf62f('0x62'),_0xf62f('0x63'),'Subject',_0xf62f('0x64')];var _0x2cbd6b=[_0xf62f('0x65'),_0xf62f('0x66'),_0xf62f('0x67'),_0xf62f('0x68'),'email',_0xf62f('0x69'),'phone'];if(_0x4276fd){_['remove'](_0x4276fd[_0xf62f('0x34')],function(_0x5747c0){return _0x5b14b7['includes'](_0x5747c0['name'])||!_0x2cbd6b[_0xf62f('0x6a')](_0x5747c0[_0xf62f('0x51')]);});return{'count':_0x4276fd['fields'][_0xf62f('0x36')],'rows':_[_0xf62f('0x2d')](_0x4276fd[_0xf62f('0x34')],function(_0x5ed26a){return{'id':_0x5ed26a[_0xf62f('0x2a')],'name':_0x5ed26a[_0xf62f('0x6b')],'custom':_0x5ed26a[_0xf62f('0x6c')],'options':_0x5ed26a[_0xf62f('0x6d')][_0xf62f('0x36')]>0x0?_[_0xf62f('0x2d')](_0x5ed26a['picklistValues'],function(_0x5effa4){return{'name':_0x5effa4[_0xf62f('0x6b')],'value':_0x5effa4[_0xf62f('0x6e')]};}):_0x5ed26a[_0xf62f('0x51')]==_0xf62f('0x68')?[{'name':_0xf62f('0x6f'),'value':_0xf62f('0x70')},{'name':_0xf62f('0x71'),'value':'false'}]:[]};})};}})[_0xf62f('0x25')](respondWithResult(_0x20849f,null))['catch'](function(_0x23530f){var _0x5ab594=_0x10dc9a[_0xf62f('0x32')]['test']?0x1f4:_0x23530f[_0xf62f('0x72')]||0x1f4;logger[_0xf62f('0x28')](_0xf62f('0x73'),_0xf62f('0x55'),_0x5ab594,JSON[_0xf62f('0x74')](_0x23530f));delete _0x23530f['name'];if(_0x5ab594===0x191){_0x5ab594=0x190;}_0x20849f[_0xf62f('0x1a')](_0x5ab594)[_0xf62f('0x2b')](_0x10dc9a['query'][_0xf62f('0x75')]?{'message':_0xf62f('0x76'),'statusCode':_0x23530f[_0xf62f('0x72')]}:_0x23530f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a75e5d9..b5802e9 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0897=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash'];(function(_0x42504e,_0x2cce79){var _0x1cabb8=function(_0x2f4e52){while(--_0x2f4e52){_0x42504e['push'](_0x42504e['shift']());}};_0x1cabb8(++_0x2cce79);}(_0x0897,0x167));var _0x7089=function(_0x4289a7,_0x5e1366){_0x4289a7=_0x4289a7-0x0;var _0x2b1813=_0x0897[_0x4289a7];return _0x2b1813;};'use strict';var _=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var logger=require(_0x7089('0x2'))(_0x7089('0x3'));var moment=require('moment');var BPromise=require(_0x7089('0x4'));var rp=require(_0x7089('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7089('0x6'));var config=require(_0x7089('0x7'));var attributes=require(_0x7089('0x8'));var integrations=require(_0x7089('0x9'));module[_0x7089('0xa')]=function(_0x1910ac,_0x37a952){return _0x1910ac['define']('SalesforceAccount',attributes,{'tableName':_0x7089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0884=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x5673c6,_0xc302ec){var _0x130bd9=function(_0x1653f5){while(--_0x1653f5){_0x5673c6['push'](_0x5673c6['shift']());}};_0x130bd9(++_0xc302ec);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var logger=require(_0x4088('0x2'))(_0x4088('0x3'));var moment=require(_0x4088('0x4'));var BPromise=require(_0x4088('0x5'));var rp=require(_0x4088('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4088('0x7'));var config=require(_0x4088('0x8'));var attributes=require(_0x4088('0x9'));var integrations=require(_0x4088('0xa'));module[_0x4088('0xb')]=function(_0x4da2f7,_0x4d68aa){return _0x4da2f7[_0x4088('0xc')]('SalesforceAccount',attributes,{'tableName':_0x4088('0xd'),'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 69c1110..11d409d 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 _0xb046=['SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','map','include','info','ShowSalesforceAccount','find','where','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','debug'];(function(_0xb28cfa,_0x4c171f){var _0x4e2b09=function(_0x1a1219){while(--_0x1a1219){_0xb28cfa['push'](_0xb28cfa['shift']());}};_0x4e2b09(++_0x4c171f);}(_0xb046,0x1a1));var _0x6b04=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0xb046[_0x242a98];return _0x580999;};'use strict';var _=require(_0x6b04('0x0'));var util=require(_0x6b04('0x1'));var moment=require(_0x6b04('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b04('0x3'));var fs=require('fs');var Redis=require(_0x6b04('0x4'));var db=require(_0x6b04('0x5'))['db'];var utils=require(_0x6b04('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6b04('0x7'));var client=jayson['client'][_0x6b04('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23f882,_0x366cf5,_0x4d6606){return new BPromise(function(_0x414a80,_0xef9069){return client[_0x6b04('0x9')](_0x23f882,_0x4d6606)[_0x6b04('0xa')](function(_0x1f7eae){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x366cf5,'request\x20sent');logger[_0x6b04('0xb')](_0x6b04('0xc'),_0x366cf5,'request\x20sent',JSON[_0x6b04('0xd')](_0x1f7eae));if(_0x1f7eae[_0x6b04('0xe')]){if(_0x1f7eae['error']['code']===0x1f4){logger[_0x6b04('0xe')](_0x6b04('0xf'),_0x366cf5,_0x1f7eae[_0x6b04('0xe')][_0x6b04('0x10')]);return _0xef9069(_0x1f7eae['error'][_0x6b04('0x10')]);}logger[_0x6b04('0xe')](_0x6b04('0xf'),_0x366cf5,_0x1f7eae['error']['message']);return _0x414a80(_0x1f7eae['error'][_0x6b04('0x10')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x366cf5,_0x6b04('0x11'));_0x414a80(_0x1f7eae[_0x6b04('0x12')][_0x6b04('0x10')]);}})[_0x6b04('0x13')](function(_0x2bacb9){logger[_0x6b04('0xe')](_0x6b04('0xf'),_0x366cf5,_0x2bacb9);_0xef9069(_0x2bacb9);});});}exports[_0x6b04('0x14')]=function(_0xccdfec){var _0x147297=this;return new Promise(function(_0x3cfba3,_0xb1525c){return db[_0x6b04('0x15')][_0x6b04('0x16')]({'raw':_0xccdfec[_0x6b04('0x17')]?_0xccdfec[_0x6b04('0x17')][_0x6b04('0x18')]===undefined?!![]:![]:!![],'where':_0xccdfec[_0x6b04('0x17')]?_0xccdfec[_0x6b04('0x17')]['where']||null:null,'attributes':_0xccdfec[_0x6b04('0x17')]?_0xccdfec[_0x6b04('0x17')][_0x6b04('0x19')]||null:null,'limit':_0xccdfec[_0x6b04('0x17')]?_0xccdfec[_0x6b04('0x17')]['limit']||null:null,'include':_0xccdfec[_0x6b04('0x17')]?_0xccdfec[_0x6b04('0x17')]['include']?_[_0x6b04('0x1a')](_0xccdfec[_0x6b04('0x17')]['include'],function(_0x1867bb){return{'model':db[_0x1867bb['model']],'as':_0x1867bb['as'],'attributes':_0x1867bb[_0x6b04('0x19')],'include':_0x1867bb[_0x6b04('0x1b')]?_[_0x6b04('0x1a')](_0x1867bb[_0x6b04('0x1b')],function(_0x2c17fc){return{'model':db[_0x2c17fc['model']],'as':_0x2c17fc['as'],'attributes':_0x2c17fc['attributes'],'include':_0x2c17fc[_0x6b04('0x1b')]?_[_0x6b04('0x1a')](_0x2c17fc['include'],function(_0x1f0307){return{'model':db[_0x1f0307['model']],'as':_0x1f0307['as'],'attributes':_0x1f0307[_0x6b04('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6b04('0xa')](function(_0x5280cd){logger[_0x6b04('0x1c')]('GetSalesforceAccount',_0xccdfec);logger[_0x6b04('0xb')](_0x6b04('0x14'),_0xccdfec,JSON[_0x6b04('0xd')](_0x5280cd));_0x3cfba3(_0x5280cd);})[_0x6b04('0x13')](function(_0x1e9aa5){logger[_0x6b04('0xe')](_0x6b04('0x14'),_0x1e9aa5[_0x6b04('0x10')],_0xccdfec);_0xb1525c(_0x147297[_0x6b04('0xe')](0x1f4,_0x1e9aa5[_0x6b04('0x10')]));});});};exports[_0x6b04('0x1d')]=function(_0x33bc19){var _0x52f848=this;return new Promise(function(_0x592f0c,_0x31a318){return db[_0x6b04('0x15')][_0x6b04('0x1e')]({'raw':_0x33bc19[_0x6b04('0x17')]?_0x33bc19[_0x6b04('0x17')][_0x6b04('0x18')]===undefined?!![]:![]:!![],'where':_0x33bc19[_0x6b04('0x17')]?_0x33bc19['options'][_0x6b04('0x1f')]||null:null,'attributes':_0x33bc19['options']?_0x33bc19[_0x6b04('0x17')][_0x6b04('0x19')]||null:null,'include':_0x33bc19[_0x6b04('0x17')]?_0x33bc19['options']['include']?_[_0x6b04('0x1a')](_0x33bc19[_0x6b04('0x17')][_0x6b04('0x1b')],function(_0x569bbe){return{'model':db[_0x569bbe[_0x6b04('0x20')]],'as':_0x569bbe['as'],'attributes':_0x569bbe[_0x6b04('0x19')],'include':_0x569bbe['include']?_[_0x6b04('0x1a')](_0x569bbe[_0x6b04('0x1b')],function(_0x451048){return{'model':db[_0x451048[_0x6b04('0x20')]],'as':_0x451048['as'],'attributes':_0x451048['attributes'],'include':_0x451048[_0x6b04('0x1b')]?_['map'](_0x451048[_0x6b04('0x1b')],function(_0xe9c1f1){return{'model':db[_0xe9c1f1[_0x6b04('0x20')]],'as':_0xe9c1f1['as'],'attributes':_0xe9c1f1[_0x6b04('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6b04('0xa')](function(_0x4cb42f){logger['info'](_0x6b04('0x1d'),_0x33bc19);logger['debug'](_0x6b04('0x1d'),_0x33bc19,JSON[_0x6b04('0xd')](_0x4cb42f));_0x592f0c(_0x4cb42f);})[_0x6b04('0x13')](function(_0x24bc2){logger[_0x6b04('0xe')](_0x6b04('0x1d'),_0x24bc2[_0x6b04('0x10')],_0x33bc19);_0x31a318(_0x52f848[_0x6b04('0xe')](0x1f4,_0x24bc2['message']));});});}; \ No newline at end of file +var _0x116a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowSalesforceAccount','lodash','util'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x116a,0x174));var _0xa116=function(_0x3eb9ef,_0x5ee454){_0x3eb9ef=_0x3eb9ef-0x0;var _0xf258e4=_0x116a[_0x3eb9ef];return _0xf258e4;};'use strict';var _=require(_0xa116('0x0'));var util=require(_0xa116('0x1'));var moment=require(_0xa116('0x2'));var BPromise=require(_0xa116('0x3'));var rs=require(_0xa116('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa116('0x5'))['db'];var utils=require(_0xa116('0x6'));var logger=require(_0xa116('0x7'))(_0xa116('0x8'));var config=require(_0xa116('0x9'));var jayson=require(_0xa116('0xa'));var client=jayson[_0xa116('0xb')][_0xa116('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf93552,_0x19dc56,_0x2c2eea){return new BPromise(function(_0xbcdb1e,_0x4bbb1c){return client['request'](_0xf93552,_0x2c2eea)['then'](function(_0x52925f){logger['info'](_0xa116('0xd'),_0x19dc56,_0xa116('0xe'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x19dc56,'request\x20sent',JSON[_0xa116('0xf')](_0x52925f));if(_0x52925f[_0xa116('0x10')]){if(_0x52925f[_0xa116('0x10')]['code']===0x1f4){logger['error'](_0xa116('0xd'),_0x19dc56,_0x52925f['error'][_0xa116('0x11')]);return _0x4bbb1c(_0x52925f['error'][_0xa116('0x11')]);}logger[_0xa116('0x10')](_0xa116('0xd'),_0x19dc56,_0x52925f[_0xa116('0x10')][_0xa116('0x11')]);return _0xbcdb1e(_0x52925f['error']['message']);}else{logger[_0xa116('0x12')](_0xa116('0xd'),_0x19dc56,_0xa116('0xe'));_0xbcdb1e(_0x52925f['result'][_0xa116('0x11')]);}})[_0xa116('0x13')](function(_0x244be1){logger[_0xa116('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x19dc56,_0x244be1);_0x4bbb1c(_0x244be1);});});}exports[_0xa116('0x14')]=function(_0x286928){var _0x44103f=this;return new Promise(function(_0x5abe46,_0x5a083e){return db[_0xa116('0x15')][_0xa116('0x16')]({'raw':_0x286928['options']?_0x286928[_0xa116('0x17')][_0xa116('0x18')]===undefined?!![]:![]:!![],'where':_0x286928['options']?_0x286928[_0xa116('0x17')][_0xa116('0x19')]||null:null,'attributes':_0x286928['options']?_0x286928[_0xa116('0x17')][_0xa116('0x1a')]||null:null,'limit':_0x286928[_0xa116('0x17')]?_0x286928[_0xa116('0x17')][_0xa116('0x1b')]||null:null,'include':_0x286928[_0xa116('0x17')]?_0x286928[_0xa116('0x17')][_0xa116('0x1c')]?_[_0xa116('0x1d')](_0x286928[_0xa116('0x17')]['include'],function(_0x323d1b){return{'model':db[_0x323d1b[_0xa116('0x1e')]],'as':_0x323d1b['as'],'attributes':_0x323d1b[_0xa116('0x1a')],'include':_0x323d1b['include']?_[_0xa116('0x1d')](_0x323d1b[_0xa116('0x1c')],function(_0x7d5689){return{'model':db[_0x7d5689[_0xa116('0x1e')]],'as':_0x7d5689['as'],'attributes':_0x7d5689[_0xa116('0x1a')],'include':_0x7d5689[_0xa116('0x1c')]?_[_0xa116('0x1d')](_0x7d5689[_0xa116('0x1c')],function(_0x302ffb){return{'model':db[_0x302ffb[_0xa116('0x1e')]],'as':_0x302ffb['as'],'attributes':_0x302ffb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa116('0x1f')](function(_0x454d33){logger[_0xa116('0x12')](_0xa116('0x14'),_0x286928);logger[_0xa116('0x20')](_0xa116('0x14'),_0x286928,JSON['stringify'](_0x454d33));_0x5abe46(_0x454d33);})[_0xa116('0x13')](function(_0x42eec9){logger[_0xa116('0x10')]('GetSalesforceAccount',_0x42eec9[_0xa116('0x11')],_0x286928);_0x5a083e(_0x44103f['error'](0x1f4,_0x42eec9['message']));});});};exports[_0xa116('0x21')]=function(_0x358676){var _0x2abd4a=this;return new Promise(function(_0x316765,_0x57a47f){return db[_0xa116('0x15')]['find']({'raw':_0x358676['options']?_0x358676[_0xa116('0x17')][_0xa116('0x18')]===undefined?!![]:![]:!![],'where':_0x358676[_0xa116('0x17')]?_0x358676[_0xa116('0x17')][_0xa116('0x19')]||null:null,'attributes':_0x358676['options']?_0x358676[_0xa116('0x17')]['attributes']||null:null,'include':_0x358676['options']?_0x358676[_0xa116('0x17')][_0xa116('0x1c')]?_[_0xa116('0x1d')](_0x358676['options']['include'],function(_0x20726e){return{'model':db[_0x20726e[_0xa116('0x1e')]],'as':_0x20726e['as'],'attributes':_0x20726e['attributes'],'include':_0x20726e[_0xa116('0x1c')]?_['map'](_0x20726e['include'],function(_0x3fa243){return{'model':db[_0x3fa243[_0xa116('0x1e')]],'as':_0x3fa243['as'],'attributes':_0x3fa243[_0xa116('0x1a')],'include':_0x3fa243['include']?_[_0xa116('0x1d')](_0x3fa243[_0xa116('0x1c')],function(_0x100771){return{'model':db[_0x100771[_0xa116('0x1e')]],'as':_0x100771['as'],'attributes':_0x100771[_0xa116('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1647e5){logger[_0xa116('0x12')](_0xa116('0x21'),_0x358676);logger[_0xa116('0x20')](_0xa116('0x21'),_0x358676,JSON[_0xa116('0xf')](_0x1647e5));_0x316765(_0x1647e5);})[_0xa116('0x13')](function(_0x293329){logger[_0xa116('0x10')]('ShowSalesforceAccount',_0x293329[_0xa116('0x11')],_0x358676);_0x57a47f(_0x2abd4a['error'](0x1f4,_0x293329[_0xa116('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index fe833f7..7a4a7d4 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 _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x1ddc5d,_0x29cef6){_0x1ddc5d=_0x1ddc5d-0x0;var _0x314baa=_0x2032[_0x1ddc5d];return _0x314baa;};'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/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdb28,0x106));var _0x8db2=function(_0x3aad2a,_0x464597){_0x3aad2a=_0x3aad2a-0x0;var _0x1bfa6f=_0xdb28[_0x3aad2a];return _0x1bfa6f;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 818da7d..5d6dce6 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 _0x4fc2=['Task','Case','contact_lead','contact','account_contact_lead','account','ENUM','nothing','lead','sequelize','exports','STRING'];(function(_0x12c4cd,_0xdebe29){var _0x18a029=function(_0x4c4272){while(--_0x4c4272){_0x12c4cd['push'](_0x12c4cd['shift']());}};_0x18a029(++_0xdebe29);}(_0x4fc2,0x111));var _0x24fc=function(_0x2e36a8,_0x4adb6e){_0x2e36a8=_0x2e36a8-0x0;var _0x74aaa2=_0x4fc2[_0x2e36a8];return _0x74aaa2;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'name':{'type':Sequelize[_0x24fc('0x2')]},'description':{'type':Sequelize[_0x24fc('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x24fc('0x3'),_0x24fc('0x4')),'defaultValue':_0x24fc('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x24fc('0x5'),_0x24fc('0x6'),'lead',_0x24fc('0x7'),_0x24fc('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x24fc('0x9')](_0x24fc('0xa'),_0x24fc('0x6'),_0x24fc('0xb'),_0x24fc('0x8')),'defaultValue':_0x24fc('0xb')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x24fc('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x24fc('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x24fc('0x2')]}}; \ No newline at end of file +var _0xd35f=['sequelize','STRING','Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','nothing'];(function(_0x1f3364,_0x80162e){var _0x2eb98f=function(_0x263037){while(--_0x263037){_0x1f3364['push'](_0x1f3364['shift']());}};_0x2eb98f(++_0x80162e);}(_0xd35f,0xd2));var _0xfd35=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xd35f[_0x21c2c8];return _0x4dd745;};'use strict';var Sequelize=require(_0xfd35('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfd35('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xfd35('0x2'),_0xfd35('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xfd35('0x4')](_0xfd35('0x5'),_0xfd35('0x6'),_0xfd35('0x7'),_0xfd35('0x8'),'account'),'defaultValue':_0xfd35('0x5')},'moduleCreate':{'type':Sequelize[_0xfd35('0x4')](_0xfd35('0x9'),_0xfd35('0x6'),_0xfd35('0x7'),'account'),'defaultValue':_0xfd35('0x7')},'leadId':{'type':Sequelize[_0xfd35('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xfd35('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ad4aa14..ce1ad9f 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 _0x6570=['rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','getFields','findOne','options','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format'];(function(_0x3aaaef,_0x17845c){var _0x287b68=function(_0x1a258d){while(--_0x1a258d){_0x3aaaef['push'](_0x3aaaef['shift']());}};_0x287b68(++_0x17845c);}(_0x6570,0x1a3));var _0x0657=function(_0x51e4fd,_0x3d0624){_0x51e4fd=_0x51e4fd-0x0;var _0x514c08=_0x6570[_0x51e4fd];return _0x514c08;};'use strict';var emlformat=require(_0x0657('0x0'));var rimraf=require(_0x0657('0x1'));var zipdir=require(_0x0657('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0657('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0657('0x4'));var util=require(_0x0657('0x5'));var path=require(_0x0657('0x6'));var sox=require(_0x0657('0x7'));var csv=require(_0x0657('0x8'));var ejs=require(_0x0657('0x9'));var fs=require('fs');var fs_extra=require(_0x0657('0xa'));var _=require(_0x0657('0xb'));var squel=require(_0x0657('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0657('0xd'));var toCsv=require(_0x0657('0x8'));var querystring=require(_0x0657('0xe'));var Papa=require(_0x0657('0xf'));var Redis=require(_0x0657('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0657('0x11'));var as=require(_0x0657('0x12'));var hardwareService=require(_0x0657('0x13'));var logger=require(_0x0657('0x14'))(_0x0657('0x15'));var utils=require(_0x0657('0x16'));var config=require(_0x0657('0x17'));var licenseUtil=require(_0x0657('0x18'));var db=require(_0x0657('0x19'))['db'];function respondWithStatusCode(_0x2cc280,_0x407d0c){_0x407d0c=_0x407d0c||0xcc;return function(_0x4b16c5){if(_0x4b16c5){return _0x2cc280[_0x0657('0x1a')](_0x407d0c);}return _0x2cc280[_0x0657('0x1b')](_0x407d0c)[_0x0657('0x1c')]();};}function respondWithResult(_0x5439bc,_0x5d87ab){_0x5d87ab=_0x5d87ab||0xc8;return function(_0x2c4dc9){if(_0x2c4dc9){return _0x5439bc[_0x0657('0x1b')](_0x5d87ab)[_0x0657('0x1d')](_0x2c4dc9);}};}function respondWithFilteredResult(_0x4157c0,_0x4d51f3){return function(_0x5c264f){if(_0x5c264f){var _0x32c71d=typeof _0x4d51f3[_0x0657('0x1e')]==='undefined'&&typeof _0x4d51f3[_0x0657('0x1f')]==='undefined';var _0x2362c9=_0x5c264f[_0x0657('0x20')];var _0x3aa2f4=_0x32c71d?0x0:_0x4d51f3[_0x0657('0x1e')];var _0x260dc1=_0x32c71d?_0x5c264f['count']:_0x4d51f3[_0x0657('0x1e')]+_0x4d51f3['limit'];var _0x1efef4;if(_0x260dc1>=_0x2362c9){_0x260dc1=_0x2362c9;_0x1efef4=0xc8;}else{_0x1efef4=0xce;}_0x4157c0['status'](_0x1efef4);return _0x4157c0[_0x0657('0x21')](_0x0657('0x22'),_0x3aa2f4+'-'+_0x260dc1+'/'+_0x2362c9)[_0x0657('0x1d')](_0x5c264f);}return null;};}function patchUpdates(_0x841fc6){return function(_0x424917){try{jsonpatch[_0x0657('0x23')](_0x424917,_0x841fc6,!![]);}catch(_0xff20d4){return BPromise[_0x0657('0x24')](_0xff20d4);}return _0x424917[_0x0657('0x25')]();};}function saveUpdates(_0x4d2dbb,_0xc74cc1){return function(_0x36e2f7){if(_0x36e2f7){return _0x36e2f7[_0x0657('0x26')](_0x4d2dbb)[_0x0657('0x27')](function(_0x17fd21){return _0x17fd21;});}return null;};}function removeEntity(_0x19218a,_0x628cb2){return function(_0x5f2c9f){if(_0x5f2c9f){return _0x5f2c9f['destroy']()[_0x0657('0x27')](function(){_0x19218a['status'](0xcc)[_0x0657('0x1c')]();});}};}function handleEntityNotFound(_0x4d0fc8,_0x4663c6){return function(_0x430769){if(!_0x430769){_0x4d0fc8[_0x0657('0x1a')](0x194);}return _0x430769;};}function handleError(_0x9f30b0,_0x58472c){_0x58472c=_0x58472c||0x1f4;return function(_0x136aa0){logger['error'](_0x136aa0[_0x0657('0x28')]);if(_0x136aa0[_0x0657('0x29')]){delete _0x136aa0['name'];}_0x9f30b0['status'](_0x58472c)[_0x0657('0x2a')](_0x136aa0);};}exports[_0x0657('0x2b')]=function(_0x53cfcc,_0x15a925){var _0x1efa17={},_0x3babeb={},_0x5e653f={'count':0x0,'rows':[]};var _0x52f1ae=_[_0x0657('0x2c')](db[_0x0657('0x2d')][_0x0657('0x2e')],function(_0x427ab6){return{'name':_0x427ab6[_0x0657('0x2f')],'type':_0x427ab6[_0x0657('0x30')][_0x0657('0x31')]};});_0x3babeb['model']=_[_0x0657('0x2c')](_0x52f1ae,_0x0657('0x29'));_0x3babeb[_0x0657('0x32')]=_[_0x0657('0x33')](_0x53cfcc[_0x0657('0x32')]);_0x3babeb[_0x0657('0x34')]=_['intersection'](_0x3babeb[_0x0657('0x35')],_0x3babeb['query']);_0x1efa17[_0x0657('0x36')]=_[_0x0657('0x37')](_0x3babeb[_0x0657('0x35')],qs['fields'](_0x53cfcc[_0x0657('0x32')][_0x0657('0x38')]));_0x1efa17[_0x0657('0x36')]=_0x1efa17[_0x0657('0x36')][_0x0657('0x39')]?_0x1efa17[_0x0657('0x36')]:_0x3babeb['model'];if(!_0x53cfcc['query'][_0x0657('0x3a')]('nolimit')){_0x1efa17['limit']=qs[_0x0657('0x1f')](_0x53cfcc['query'][_0x0657('0x1f')]);_0x1efa17['offset']=qs['offset'](_0x53cfcc['query']['offset']);}_0x1efa17[_0x0657('0x3b')]=qs[_0x0657('0x3c')](_0x53cfcc[_0x0657('0x32')][_0x0657('0x3c')]);_0x1efa17[_0x0657('0x3d')]=qs['filters'](_[_0x0657('0x3e')](_0x53cfcc[_0x0657('0x32')],_0x3babeb[_0x0657('0x34')]),_0x52f1ae);if(_0x53cfcc[_0x0657('0x32')][_0x0657('0x3f')]){_0x1efa17[_0x0657('0x3d')]=_[_0x0657('0x40')](_0x1efa17[_0x0657('0x3d')],{'$or':_['map'](_0x52f1ae,function(_0x33136d){if(_0x33136d[_0x0657('0x30')]!==_0x0657('0x41')){var _0x131a72={};_0x131a72[_0x33136d['name']]={'$like':'%'+_0x53cfcc[_0x0657('0x32')][_0x0657('0x3f')]+'%'};return _0x131a72;}})});}_0x1efa17=_['merge']({},_0x1efa17,_0x53cfcc['options']);var _0xc5fefb={'where':_0x1efa17['where']};return db[_0x0657('0x2d')][_0x0657('0x20')](_0xc5fefb)['then'](function(_0x3308f2){_0x5e653f['count']=_0x3308f2;if(_0x53cfcc['query'][_0x0657('0x42')]){_0x1efa17[_0x0657('0x43')]=[{'all':!![]}];}return db[_0x0657('0x2d')][_0x0657('0x44')](_0x1efa17);})[_0x0657('0x27')](function(_0x14c025){_0x5e653f[_0x0657('0x45')]=_0x14c025;return _0x5e653f;})[_0x0657('0x27')](respondWithFilteredResult(_0x15a925,_0x1efa17))['catch'](handleError(_0x15a925,null));};exports[_0x0657('0x46')]=function(_0x36d3d5,_0x2b0ad1){var _0x9fbcdb={'raw':![],'where':{'id':_0x36d3d5[_0x0657('0x47')]['id']}},_0x55a2bc={};_0x55a2bc['model']=_[_0x0657('0x33')](db[_0x0657('0x2d')][_0x0657('0x2e')]);_0x55a2bc[_0x0657('0x32')]=_['keys'](_0x36d3d5['query']);_0x55a2bc['filters']=_[_0x0657('0x37')](_0x55a2bc[_0x0657('0x35')],_0x55a2bc['query']);_0x9fbcdb[_0x0657('0x36')]=_[_0x0657('0x37')](_0x55a2bc['model'],qs[_0x0657('0x38')](_0x36d3d5[_0x0657('0x32')][_0x0657('0x38')]));_0x9fbcdb[_0x0657('0x36')]=_0x9fbcdb['attributes'][_0x0657('0x39')]?_0x9fbcdb['attributes']:_0x55a2bc['model'];if(_0x36d3d5[_0x0657('0x32')]['includeAll']){_0x9fbcdb[_0x0657('0x43')]=[{'all':!![]}];}_0x9fbcdb=_['merge']({},_0x9fbcdb,_0x36d3d5['options']);return db[_0x0657('0x2d')][_0x0657('0x48')](_0x9fbcdb)[_0x0657('0x27')](handleEntityNotFound(_0x2b0ad1,null))[_0x0657('0x27')](respondWithResult(_0x2b0ad1,null))['catch'](handleError(_0x2b0ad1,null));};exports[_0x0657('0x49')]=function(_0x1b3c3b,_0x92e7b8){return db[_0x0657('0x2d')][_0x0657('0x49')](_0x1b3c3b[_0x0657('0x4a')],{})[_0x0657('0x27')](respondWithResult(_0x92e7b8,0xc9))['catch'](handleError(_0x92e7b8,null));};exports[_0x0657('0x26')]=function(_0x19dc2,_0x4c8aa3){if(_0x19dc2[_0x0657('0x4a')]['id']){delete _0x19dc2[_0x0657('0x4a')]['id'];}return db[_0x0657('0x2d')][_0x0657('0x48')]({'where':{'id':_0x19dc2[_0x0657('0x47')]['id']}})[_0x0657('0x27')](handleEntityNotFound(_0x4c8aa3,null))['then'](saveUpdates(_0x19dc2[_0x0657('0x4a')],null))[_0x0657('0x27')](respondWithResult(_0x4c8aa3,null))[_0x0657('0x4b')](handleError(_0x4c8aa3,null));};exports[_0x0657('0x4c')]=function(_0x85ac77,_0x44650c){return db[_0x0657('0x2d')][_0x0657('0x48')]({'where':{'id':_0x85ac77[_0x0657('0x47')]['id']}})[_0x0657('0x27')](handleEntityNotFound(_0x44650c,null))['then'](removeEntity(_0x44650c,null))[_0x0657('0x4b')](handleError(_0x44650c,null));};exports[_0x0657('0x4d')]=function(_0x398c73,_0x593188,_0x2cde4d){var _0x54777f={};var _0x13e6b6={};var _0x105443;var _0x3be5f5;return db['SalesforceConfiguration'][_0x0657('0x4e')]({'where':{'id':_0x398c73[_0x0657('0x47')]['id']}})[_0x0657('0x27')](handleEntityNotFound(_0x593188,null))['then'](function(_0x49c023){if(_0x49c023){_0x105443=_0x49c023;_0x13e6b6['model']=_[_0x0657('0x33')](db['SalesforceField'][_0x0657('0x2e')]);_0x13e6b6[_0x0657('0x32')]=_['keys'](_0x398c73[_0x0657('0x32')]);_0x13e6b6[_0x0657('0x34')]=_['intersection'](_0x13e6b6[_0x0657('0x35')],_0x13e6b6[_0x0657('0x32')]);_0x54777f[_0x0657('0x36')]=_[_0x0657('0x37')](_0x13e6b6[_0x0657('0x35')],qs[_0x0657('0x38')](_0x398c73['query'][_0x0657('0x38')]));_0x54777f['attributes']=_0x54777f['attributes']['length']?_0x54777f[_0x0657('0x36')]:_0x13e6b6[_0x0657('0x35')];_0x54777f[_0x0657('0x3b')]=qs[_0x0657('0x3c')](_0x398c73[_0x0657('0x32')][_0x0657('0x3c')]);_0x54777f[_0x0657('0x3d')]=qs[_0x0657('0x34')](_[_0x0657('0x3e')](_0x398c73['query'],_0x13e6b6[_0x0657('0x34')]));if(_0x398c73[_0x0657('0x32')][_0x0657('0x3f')]){_0x54777f[_0x0657('0x3d')]=_[_0x0657('0x40')](_0x54777f[_0x0657('0x3d')],{'$or':_[_0x0657('0x2c')](_0x54777f['attributes'],function(_0x5d41ad){var _0x3f72ba={};_0x3f72ba[_0x5d41ad]={'$like':'%'+_0x398c73[_0x0657('0x32')][_0x0657('0x3f')]+'%'};return _0x3f72ba;})});}_0x54777f=_['merge']({},_0x54777f,_0x398c73[_0x0657('0x4f')]);return _0x105443[_0x0657('0x4d')](_0x54777f);}})[_0x0657('0x27')](function(_0x279356){if(_0x279356){_0x3be5f5=_0x279356['length'];if(!_0x398c73['query'][_0x0657('0x3a')](_0x0657('0x50'))){_0x54777f[_0x0657('0x1f')]=qs[_0x0657('0x1f')](_0x398c73['query'][_0x0657('0x1f')]);_0x54777f[_0x0657('0x1e')]=qs[_0x0657('0x1e')](_0x398c73[_0x0657('0x32')]['offset']);}return _0x105443[_0x0657('0x4d')](_0x54777f);}})[_0x0657('0x27')](function(_0x459fb4){if(_0x459fb4){return _0x459fb4?{'count':_0x3be5f5,'rows':_0x459fb4}:null;}})[_0x0657('0x27')](respondWithResult(_0x593188,null))[_0x0657('0x4b')](handleError(_0x593188,null));};exports[_0x0657('0x51')]=function(_0x351477,_0x229040,_0x3f3ba8){var _0x56f66a={};var _0x2e2304={};var _0x402ca1;var _0x1d1874;return db[_0x0657('0x2d')][_0x0657('0x4e')]({'where':{'id':_0x351477[_0x0657('0x47')]['id']}})[_0x0657('0x27')](handleEntityNotFound(_0x229040,null))[_0x0657('0x27')](function(_0x24cc3b){if(_0x24cc3b){_0x402ca1=_0x24cc3b;_0x2e2304[_0x0657('0x35')]=_[_0x0657('0x33')](db[_0x0657('0x52')][_0x0657('0x2e')]);_0x2e2304[_0x0657('0x32')]=_[_0x0657('0x33')](_0x351477[_0x0657('0x32')]);_0x2e2304[_0x0657('0x34')]=_[_0x0657('0x37')](_0x2e2304[_0x0657('0x35')],_0x2e2304[_0x0657('0x32')]);_0x56f66a[_0x0657('0x36')]=_[_0x0657('0x37')](_0x2e2304[_0x0657('0x35')],qs[_0x0657('0x38')](_0x351477[_0x0657('0x32')][_0x0657('0x38')]));_0x56f66a[_0x0657('0x36')]=_0x56f66a[_0x0657('0x36')]['length']?_0x56f66a[_0x0657('0x36')]:_0x2e2304[_0x0657('0x35')];_0x56f66a[_0x0657('0x3b')]=qs[_0x0657('0x3c')](_0x351477['query'][_0x0657('0x3c')]);_0x56f66a[_0x0657('0x3d')]=qs[_0x0657('0x34')](_[_0x0657('0x3e')](_0x351477[_0x0657('0x32')],_0x2e2304[_0x0657('0x34')]));if(_0x351477[_0x0657('0x32')][_0x0657('0x3f')]){_0x56f66a[_0x0657('0x3d')]=_[_0x0657('0x40')](_0x56f66a[_0x0657('0x3d')],{'$or':_['map'](_0x56f66a[_0x0657('0x36')],function(_0x362d95){var _0x124e34={};_0x124e34[_0x362d95]={'$like':'%'+_0x351477[_0x0657('0x32')][_0x0657('0x3f')]+'%'};return _0x124e34;})});}_0x56f66a=_[_0x0657('0x40')]({},_0x56f66a,_0x351477[_0x0657('0x4f')]);return _0x402ca1[_0x0657('0x51')](_0x56f66a);}})['then'](function(_0x5ade2a){if(_0x5ade2a){_0x1d1874=_0x5ade2a[_0x0657('0x39')];if(!_0x351477[_0x0657('0x32')][_0x0657('0x3a')]('nolimit')){_0x56f66a[_0x0657('0x1f')]=qs[_0x0657('0x1f')](_0x351477[_0x0657('0x32')][_0x0657('0x1f')]);_0x56f66a[_0x0657('0x1e')]=qs[_0x0657('0x1e')](_0x351477[_0x0657('0x32')][_0x0657('0x1e')]);}return _0x402ca1['getSubjects'](_0x56f66a);}})[_0x0657('0x27')](function(_0x403da4){if(_0x403da4){return _0x403da4?{'count':_0x1d1874,'rows':_0x403da4}:null;}})['then'](respondWithResult(_0x229040,null))[_0x0657('0x4b')](handleError(_0x229040,null));};exports['getDescriptions']=function(_0x49b4e2,_0x25ed45,_0x8fad81){var _0x263bc5={};var _0x5e57d6={};var _0xb50998;var _0x1450ab;return db['SalesforceConfiguration'][_0x0657('0x4e')]({'where':{'id':_0x49b4e2['params']['id']}})[_0x0657('0x27')](handleEntityNotFound(_0x25ed45,null))[_0x0657('0x27')](function(_0x54c70a){if(_0x54c70a){_0xb50998=_0x54c70a;_0x5e57d6[_0x0657('0x35')]=_[_0x0657('0x33')](db[_0x0657('0x52')][_0x0657('0x2e')]);_0x5e57d6['query']=_[_0x0657('0x33')](_0x49b4e2[_0x0657('0x32')]);_0x5e57d6['filters']=_[_0x0657('0x37')](_0x5e57d6[_0x0657('0x35')],_0x5e57d6[_0x0657('0x32')]);_0x263bc5[_0x0657('0x36')]=_[_0x0657('0x37')](_0x5e57d6[_0x0657('0x35')],qs[_0x0657('0x38')](_0x49b4e2[_0x0657('0x32')]['fields']));_0x263bc5['attributes']=_0x263bc5['attributes'][_0x0657('0x39')]?_0x263bc5['attributes']:_0x5e57d6[_0x0657('0x35')];_0x263bc5[_0x0657('0x3b')]=qs['sort'](_0x49b4e2[_0x0657('0x32')][_0x0657('0x3c')]);_0x263bc5[_0x0657('0x3d')]=qs[_0x0657('0x34')](_[_0x0657('0x3e')](_0x49b4e2[_0x0657('0x32')],_0x5e57d6[_0x0657('0x34')]));if(_0x49b4e2[_0x0657('0x32')][_0x0657('0x3f')]){_0x263bc5[_0x0657('0x3d')]=_[_0x0657('0x40')](_0x263bc5[_0x0657('0x3d')],{'$or':_[_0x0657('0x2c')](_0x263bc5[_0x0657('0x36')],function(_0x2d098e){var _0x2e3f63={};_0x2e3f63[_0x2d098e]={'$like':'%'+_0x49b4e2[_0x0657('0x32')][_0x0657('0x3f')]+'%'};return _0x2e3f63;})});}_0x263bc5=_[_0x0657('0x40')]({},_0x263bc5,_0x49b4e2[_0x0657('0x4f')]);return _0xb50998[_0x0657('0x53')](_0x263bc5);}})['then'](function(_0x5ea20c){if(_0x5ea20c){_0x1450ab=_0x5ea20c[_0x0657('0x39')];if(!_0x49b4e2[_0x0657('0x32')][_0x0657('0x3a')](_0x0657('0x50'))){_0x263bc5[_0x0657('0x1f')]=qs[_0x0657('0x1f')](_0x49b4e2[_0x0657('0x32')][_0x0657('0x1f')]);_0x263bc5[_0x0657('0x1e')]=qs[_0x0657('0x1e')](_0x49b4e2[_0x0657('0x32')][_0x0657('0x1e')]);}return _0xb50998['getDescriptions'](_0x263bc5);}})[_0x0657('0x27')](function(_0x10ae3e){if(_0x10ae3e){return _0x10ae3e?{'count':_0x1450ab,'rows':_0x10ae3e}:null;}})[_0x0657('0x27')](respondWithResult(_0x25ed45,null))['catch'](handleError(_0x25ed45,null));}; \ No newline at end of file +var _0xadeb=['rows','catch','params','find','create','body','update','findOne','SalesforceField','pick','getFields','length','getSubjects','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x484a09,_0x31b700){var _0x16ea35=function(_0xa39119){while(--_0xa39119){_0x484a09['push'](_0x484a09['shift']());}};_0x16ea35(++_0x31b700);}(_0xadeb,0x1bd));var _0xbade=function(_0x3b43df,_0x39dbf9){_0x3b43df=_0x3b43df-0x0;var _0x5a6a15=_0xadeb[_0x3b43df];return _0x5a6a15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbade('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbade('0x1'));var rp=require(_0xbade('0x2'));var moment=require(_0xbade('0x3'));var BPromise=require(_0xbade('0x4'));var Mustache=require('mustache');var util=require(_0xbade('0x5'));var path=require(_0xbade('0x6'));var sox=require('sox');var csv=require(_0xbade('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbade('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbade('0x7'));var querystring=require(_0xbade('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbade('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0xbade('0xb'));var hardwareService=require(_0xbade('0xc'));var logger=require(_0xbade('0xd'))(_0xbade('0xe'));var utils=require(_0xbade('0xf'));var config=require(_0xbade('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xbade('0x11'))['db'];function respondWithStatusCode(_0x5160a2,_0x39a385){_0x39a385=_0x39a385||0xcc;return function(_0x5ac786){if(_0x5ac786){return _0x5160a2[_0xbade('0x12')](_0x39a385);}return _0x5160a2['status'](_0x39a385)[_0xbade('0x13')]();};}function respondWithResult(_0x527696,_0x3a7788){_0x3a7788=_0x3a7788||0xc8;return function(_0x4f8511){if(_0x4f8511){return _0x527696['status'](_0x3a7788)[_0xbade('0x14')](_0x4f8511);}};}function respondWithFilteredResult(_0x579e9a,_0x29ff51){return function(_0x2c5bdb){if(_0x2c5bdb){var _0x1180d9=typeof _0x29ff51[_0xbade('0x15')]===_0xbade('0x16')&&typeof _0x29ff51[_0xbade('0x17')]===_0xbade('0x16');var _0x30b2a5=_0x2c5bdb[_0xbade('0x18')];var _0x473103=_0x1180d9?0x0:_0x29ff51[_0xbade('0x15')];var _0x500ec7=_0x1180d9?_0x2c5bdb['count']:_0x29ff51[_0xbade('0x15')]+_0x29ff51['limit'];var _0x271755;if(_0x500ec7>=_0x30b2a5){_0x500ec7=_0x30b2a5;_0x271755=0xc8;}else{_0x271755=0xce;}_0x579e9a[_0xbade('0x19')](_0x271755);return _0x579e9a[_0xbade('0x1a')](_0xbade('0x1b'),_0x473103+'-'+_0x500ec7+'/'+_0x30b2a5)[_0xbade('0x14')](_0x2c5bdb);}return null;};}function patchUpdates(_0x388107){return function(_0xda7150){try{jsonpatch[_0xbade('0x1c')](_0xda7150,_0x388107,!![]);}catch(_0x56440b){return BPromise['reject'](_0x56440b);}return _0xda7150['save']();};}function saveUpdates(_0x2700d7,_0x2da151){return function(_0xa60df4){if(_0xa60df4){return _0xa60df4['update'](_0x2700d7)[_0xbade('0x1d')](function(_0x489c07){return _0x489c07;});}return null;};}function removeEntity(_0x4f12dc,_0xf64603){return function(_0x139f23){if(_0x139f23){return _0x139f23[_0xbade('0x1e')]()[_0xbade('0x1d')](function(){_0x4f12dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4f39,_0x471087){return function(_0x5bc46d){if(!_0x5bc46d){_0x4f4f39[_0xbade('0x12')](0x194);}return _0x5bc46d;};}function handleError(_0x183659,_0x1f9a42){_0x1f9a42=_0x1f9a42||0x1f4;return function(_0x30604b){logger[_0xbade('0x1f')](_0x30604b['stack']);if(_0x30604b[_0xbade('0x20')]){delete _0x30604b['name'];}_0x183659[_0xbade('0x19')](_0x1f9a42)[_0xbade('0x21')](_0x30604b);};}exports[_0xbade('0x22')]=function(_0xe9d4fd,_0x4d729a){var _0x1b2eb7={},_0x52ef07={},_0x4aaa59={'count':0x0,'rows':[]};var _0x21e7ef=_[_0xbade('0x23')](db[_0xbade('0x24')][_0xbade('0x25')],function(_0x378365){return{'name':_0x378365[_0xbade('0x26')],'type':_0x378365[_0xbade('0x27')]['key']};});_0x52ef07[_0xbade('0x28')]=_[_0xbade('0x23')](_0x21e7ef,'name');_0x52ef07[_0xbade('0x29')]=_[_0xbade('0x2a')](_0xe9d4fd[_0xbade('0x29')]);_0x52ef07[_0xbade('0x2b')]=_[_0xbade('0x2c')](_0x52ef07[_0xbade('0x28')],_0x52ef07[_0xbade('0x29')]);_0x1b2eb7['attributes']=_[_0xbade('0x2c')](_0x52ef07[_0xbade('0x28')],qs[_0xbade('0x2d')](_0xe9d4fd['query']['fields']));_0x1b2eb7['attributes']=_0x1b2eb7[_0xbade('0x2e')]['length']?_0x1b2eb7[_0xbade('0x2e')]:_0x52ef07[_0xbade('0x28')];if(!_0xe9d4fd[_0xbade('0x29')][_0xbade('0x2f')](_0xbade('0x30'))){_0x1b2eb7[_0xbade('0x17')]=qs['limit'](_0xe9d4fd[_0xbade('0x29')]['limit']);_0x1b2eb7[_0xbade('0x15')]=qs[_0xbade('0x15')](_0xe9d4fd[_0xbade('0x29')][_0xbade('0x15')]);}_0x1b2eb7[_0xbade('0x31')]=qs[_0xbade('0x32')](_0xe9d4fd[_0xbade('0x29')][_0xbade('0x32')]);_0x1b2eb7[_0xbade('0x33')]=qs['filters'](_['pick'](_0xe9d4fd[_0xbade('0x29')],_0x52ef07[_0xbade('0x2b')]),_0x21e7ef);if(_0xe9d4fd['query'][_0xbade('0x34')]){_0x1b2eb7[_0xbade('0x33')]=_[_0xbade('0x35')](_0x1b2eb7['where'],{'$or':_['map'](_0x21e7ef,function(_0x257225){if(_0x257225[_0xbade('0x27')]!==_0xbade('0x36')){var _0x598e41={};_0x598e41[_0x257225[_0xbade('0x20')]]={'$like':'%'+_0xe9d4fd[_0xbade('0x29')][_0xbade('0x34')]+'%'};return _0x598e41;}})});}_0x1b2eb7=_[_0xbade('0x35')]({},_0x1b2eb7,_0xe9d4fd[_0xbade('0x37')]);var _0x7bab09={'where':_0x1b2eb7[_0xbade('0x33')]};return db['SalesforceConfiguration']['count'](_0x7bab09)[_0xbade('0x1d')](function(_0x31d07b){_0x4aaa59[_0xbade('0x18')]=_0x31d07b;if(_0xe9d4fd[_0xbade('0x29')][_0xbade('0x38')]){_0x1b2eb7[_0xbade('0x39')]=[{'all':!![]}];}return db[_0xbade('0x24')][_0xbade('0x3a')](_0x1b2eb7);})[_0xbade('0x1d')](function(_0x270d9b){_0x4aaa59[_0xbade('0x3b')]=_0x270d9b;return _0x4aaa59;})[_0xbade('0x1d')](respondWithFilteredResult(_0x4d729a,_0x1b2eb7))[_0xbade('0x3c')](handleError(_0x4d729a,null));};exports['show']=function(_0x63f1be,_0xb8d327){var _0x3f61d6={'raw':![],'where':{'id':_0x63f1be[_0xbade('0x3d')]['id']}},_0x8685f1={};_0x8685f1['model']=_[_0xbade('0x2a')](db[_0xbade('0x24')]['rawAttributes']);_0x8685f1['query']=_[_0xbade('0x2a')](_0x63f1be['query']);_0x8685f1[_0xbade('0x2b')]=_[_0xbade('0x2c')](_0x8685f1['model'],_0x8685f1[_0xbade('0x29')]);_0x3f61d6['attributes']=_['intersection'](_0x8685f1['model'],qs[_0xbade('0x2d')](_0x63f1be['query']['fields']));_0x3f61d6['attributes']=_0x3f61d6[_0xbade('0x2e')]['length']?_0x3f61d6['attributes']:_0x8685f1[_0xbade('0x28')];if(_0x63f1be['query']['includeAll']){_0x3f61d6['include']=[{'all':!![]}];}_0x3f61d6=_[_0xbade('0x35')]({},_0x3f61d6,_0x63f1be[_0xbade('0x37')]);return db[_0xbade('0x24')][_0xbade('0x3e')](_0x3f61d6)['then'](handleEntityNotFound(_0xb8d327,null))[_0xbade('0x1d')](respondWithResult(_0xb8d327,null))[_0xbade('0x3c')](handleError(_0xb8d327,null));};exports[_0xbade('0x3f')]=function(_0x79967f,_0x149eb1){return db[_0xbade('0x24')]['create'](_0x79967f[_0xbade('0x40')],{})[_0xbade('0x1d')](respondWithResult(_0x149eb1,0xc9))[_0xbade('0x3c')](handleError(_0x149eb1,null));};exports[_0xbade('0x41')]=function(_0x587c09,_0x2f9780){if(_0x587c09[_0xbade('0x40')]['id']){delete _0x587c09[_0xbade('0x40')]['id'];}return db['SalesforceConfiguration'][_0xbade('0x3e')]({'where':{'id':_0x587c09[_0xbade('0x3d')]['id']}})[_0xbade('0x1d')](handleEntityNotFound(_0x2f9780,null))['then'](saveUpdates(_0x587c09[_0xbade('0x40')],null))[_0xbade('0x1d')](respondWithResult(_0x2f9780,null))[_0xbade('0x3c')](handleError(_0x2f9780,null));};exports['destroy']=function(_0x41b462,_0xe76887){return db[_0xbade('0x24')][_0xbade('0x3e')]({'where':{'id':_0x41b462[_0xbade('0x3d')]['id']}})[_0xbade('0x1d')](handleEntityNotFound(_0xe76887,null))['then'](removeEntity(_0xe76887,null))[_0xbade('0x3c')](handleError(_0xe76887,null));};exports['getFields']=function(_0x2d0c78,_0x3cdaa1,_0x4353cc){var _0x32421d={};var _0x48f17c={};var _0x3271c7;var _0x5836c3;return db[_0xbade('0x24')][_0xbade('0x42')]({'where':{'id':_0x2d0c78[_0xbade('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3cdaa1,null))[_0xbade('0x1d')](function(_0x5b42c8){if(_0x5b42c8){_0x3271c7=_0x5b42c8;_0x48f17c['model']=_['keys'](db[_0xbade('0x43')][_0xbade('0x25')]);_0x48f17c['query']=_[_0xbade('0x2a')](_0x2d0c78[_0xbade('0x29')]);_0x48f17c[_0xbade('0x2b')]=_[_0xbade('0x2c')](_0x48f17c['model'],_0x48f17c['query']);_0x32421d[_0xbade('0x2e')]=_[_0xbade('0x2c')](_0x48f17c[_0xbade('0x28')],qs[_0xbade('0x2d')](_0x2d0c78[_0xbade('0x29')][_0xbade('0x2d')]));_0x32421d[_0xbade('0x2e')]=_0x32421d[_0xbade('0x2e')]['length']?_0x32421d[_0xbade('0x2e')]:_0x48f17c[_0xbade('0x28')];_0x32421d['order']=qs[_0xbade('0x32')](_0x2d0c78[_0xbade('0x29')][_0xbade('0x32')]);_0x32421d[_0xbade('0x33')]=qs[_0xbade('0x2b')](_[_0xbade('0x44')](_0x2d0c78['query'],_0x48f17c['filters']));if(_0x2d0c78[_0xbade('0x29')][_0xbade('0x34')]){_0x32421d[_0xbade('0x33')]=_[_0xbade('0x35')](_0x32421d['where'],{'$or':_[_0xbade('0x23')](_0x32421d[_0xbade('0x2e')],function(_0x20a9f4){var _0x1f5ea6={};_0x1f5ea6[_0x20a9f4]={'$like':'%'+_0x2d0c78[_0xbade('0x29')][_0xbade('0x34')]+'%'};return _0x1f5ea6;})});}_0x32421d=_[_0xbade('0x35')]({},_0x32421d,_0x2d0c78[_0xbade('0x37')]);return _0x3271c7[_0xbade('0x45')](_0x32421d);}})['then'](function(_0x2e3f70){if(_0x2e3f70){_0x5836c3=_0x2e3f70[_0xbade('0x46')];if(!_0x2d0c78[_0xbade('0x29')]['hasOwnProperty'](_0xbade('0x30'))){_0x32421d['limit']=qs[_0xbade('0x17')](_0x2d0c78['query'][_0xbade('0x17')]);_0x32421d[_0xbade('0x15')]=qs['offset'](_0x2d0c78[_0xbade('0x29')][_0xbade('0x15')]);}return _0x3271c7['getFields'](_0x32421d);}})[_0xbade('0x1d')](function(_0x4f8a9e){if(_0x4f8a9e){return _0x4f8a9e?{'count':_0x5836c3,'rows':_0x4f8a9e}:null;}})[_0xbade('0x1d')](respondWithResult(_0x3cdaa1,null))['catch'](handleError(_0x3cdaa1,null));};exports[_0xbade('0x47')]=function(_0x1cadb2,_0x198faf,_0x1fa04b){var _0x32c5c9={};var _0x1f8944={};var _0xe40e17;var _0x5bc610;return db[_0xbade('0x24')]['findOne']({'where':{'id':_0x1cadb2['params']['id']}})[_0xbade('0x1d')](handleEntityNotFound(_0x198faf,null))[_0xbade('0x1d')](function(_0x28bb14){if(_0x28bb14){_0xe40e17=_0x28bb14;_0x1f8944['model']=_[_0xbade('0x2a')](db[_0xbade('0x43')][_0xbade('0x25')]);_0x1f8944[_0xbade('0x29')]=_[_0xbade('0x2a')](_0x1cadb2[_0xbade('0x29')]);_0x1f8944['filters']=_[_0xbade('0x2c')](_0x1f8944['model'],_0x1f8944['query']);_0x32c5c9[_0xbade('0x2e')]=_[_0xbade('0x2c')](_0x1f8944[_0xbade('0x28')],qs[_0xbade('0x2d')](_0x1cadb2['query'][_0xbade('0x2d')]));_0x32c5c9['attributes']=_0x32c5c9[_0xbade('0x2e')][_0xbade('0x46')]?_0x32c5c9[_0xbade('0x2e')]:_0x1f8944[_0xbade('0x28')];_0x32c5c9[_0xbade('0x31')]=qs[_0xbade('0x32')](_0x1cadb2[_0xbade('0x29')][_0xbade('0x32')]);_0x32c5c9['where']=qs[_0xbade('0x2b')](_[_0xbade('0x44')](_0x1cadb2[_0xbade('0x29')],_0x1f8944[_0xbade('0x2b')]));if(_0x1cadb2[_0xbade('0x29')][_0xbade('0x34')]){_0x32c5c9[_0xbade('0x33')]=_[_0xbade('0x35')](_0x32c5c9[_0xbade('0x33')],{'$or':_[_0xbade('0x23')](_0x32c5c9['attributes'],function(_0x3e0d87){var _0x46258c={};_0x46258c[_0x3e0d87]={'$like':'%'+_0x1cadb2[_0xbade('0x29')][_0xbade('0x34')]+'%'};return _0x46258c;})});}_0x32c5c9=_[_0xbade('0x35')]({},_0x32c5c9,_0x1cadb2['options']);return _0xe40e17[_0xbade('0x47')](_0x32c5c9);}})[_0xbade('0x1d')](function(_0x5444e4){if(_0x5444e4){_0x5bc610=_0x5444e4['length'];if(!_0x1cadb2[_0xbade('0x29')][_0xbade('0x2f')](_0xbade('0x30'))){_0x32c5c9[_0xbade('0x17')]=qs['limit'](_0x1cadb2[_0xbade('0x29')]['limit']);_0x32c5c9[_0xbade('0x15')]=qs[_0xbade('0x15')](_0x1cadb2[_0xbade('0x29')][_0xbade('0x15')]);}return _0xe40e17['getSubjects'](_0x32c5c9);}})[_0xbade('0x1d')](function(_0x1eccb7){if(_0x1eccb7){return _0x1eccb7?{'count':_0x5bc610,'rows':_0x1eccb7}:null;}})['then'](respondWithResult(_0x198faf,null))[_0xbade('0x3c')](handleError(_0x198faf,null));};exports['getDescriptions']=function(_0x5b8e97,_0x3134d3,_0x26b85d){var _0x2df0c5={};var _0x47a836={};var _0x2c3559;var _0x241fec;return db[_0xbade('0x24')]['findOne']({'where':{'id':_0x5b8e97[_0xbade('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3134d3,null))[_0xbade('0x1d')](function(_0x263ff9){if(_0x263ff9){_0x2c3559=_0x263ff9;_0x47a836[_0xbade('0x28')]=_[_0xbade('0x2a')](db[_0xbade('0x43')]['rawAttributes']);_0x47a836[_0xbade('0x29')]=_['keys'](_0x5b8e97['query']);_0x47a836[_0xbade('0x2b')]=_[_0xbade('0x2c')](_0x47a836[_0xbade('0x28')],_0x47a836[_0xbade('0x29')]);_0x2df0c5['attributes']=_[_0xbade('0x2c')](_0x47a836[_0xbade('0x28')],qs['fields'](_0x5b8e97['query']['fields']));_0x2df0c5['attributes']=_0x2df0c5[_0xbade('0x2e')][_0xbade('0x46')]?_0x2df0c5[_0xbade('0x2e')]:_0x47a836[_0xbade('0x28')];_0x2df0c5[_0xbade('0x31')]=qs[_0xbade('0x32')](_0x5b8e97['query'][_0xbade('0x32')]);_0x2df0c5[_0xbade('0x33')]=qs[_0xbade('0x2b')](_['pick'](_0x5b8e97[_0xbade('0x29')],_0x47a836[_0xbade('0x2b')]));if(_0x5b8e97[_0xbade('0x29')][_0xbade('0x34')]){_0x2df0c5[_0xbade('0x33')]=_[_0xbade('0x35')](_0x2df0c5[_0xbade('0x33')],{'$or':_[_0xbade('0x23')](_0x2df0c5['attributes'],function(_0x258df2){var _0x543d47={};_0x543d47[_0x258df2]={'$like':'%'+_0x5b8e97[_0xbade('0x29')][_0xbade('0x34')]+'%'};return _0x543d47;})});}_0x2df0c5=_[_0xbade('0x35')]({},_0x2df0c5,_0x5b8e97[_0xbade('0x37')]);return _0x2c3559['getDescriptions'](_0x2df0c5);}})['then'](function(_0x40e193){if(_0x40e193){_0x241fec=_0x40e193[_0xbade('0x46')];if(!_0x5b8e97[_0xbade('0x29')][_0xbade('0x2f')](_0xbade('0x30'))){_0x2df0c5[_0xbade('0x17')]=qs[_0xbade('0x17')](_0x5b8e97['query'][_0xbade('0x17')]);_0x2df0c5[_0xbade('0x15')]=qs[_0xbade('0x15')](_0x5b8e97[_0xbade('0x29')][_0xbade('0x15')]);}return _0x2c3559['getDescriptions'](_0x2df0c5);}})[_0xbade('0x1d')](function(_0x46ad56){if(_0x46ad56){return _0x46ad56?{'count':_0x241fec,'rows':_0x46ad56}:null;}})[_0xbade('0x1d')](respondWithResult(_0x3134d3,null))[_0xbade('0x3c')](handleError(_0x3134d3,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 1278713..afcd1c5 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 _0x66c9=['exports','define','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x3d58f3,_0x49287d){var _0x2d5740=function(_0x533269){while(--_0x533269){_0x3d58f3['push'](_0x3d58f3['shift']());}};_0x2d5740(++_0x49287d);}(_0x66c9,0x7b));var _0x966c=function(_0x2abb08,_0x25501b){_0x2abb08=_0x2abb08-0x0;var _0x139041=_0x66c9[_0x2abb08];return _0x139041;};'use strict';var _=require('lodash');var util=require(_0x966c('0x0'));var logger=require(_0x966c('0x1'))(_0x966c('0x2'));var moment=require(_0x966c('0x3'));var BPromise=require(_0x966c('0x4'));var rp=require(_0x966c('0x5'));var fs=require('fs');var path=require(_0x966c('0x6'));var rimraf=require('rimraf');var config=require(_0x966c('0x7'));var attributes=require(_0x966c('0x8'));module[_0x966c('0x9')]=function(_0x30cc87,_0x36f7f0){return _0x30cc87[_0x966c('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x966c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a20=['bluebird','request-promise','path','rimraf','exports','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x5b1db2,_0x1755cb){var _0x4cd815=function(_0x2f7983){while(--_0x2f7983){_0x5b1db2['push'](_0x5b1db2['shift']());}};_0x4cd815(++_0x1755cb);}(_0x3a20,0x146));var _0x03a2=function(_0x391414,_0xfc8fce){_0x391414=_0x391414-0x0;var _0x2fcd72=_0x3a20[_0x391414];return _0x2fcd72;};'use strict';var _=require(_0x03a2('0x0'));var util=require(_0x03a2('0x1'));var logger=require(_0x03a2('0x2'))(_0x03a2('0x3'));var moment=require('moment');var BPromise=require(_0x03a2('0x4'));var rp=require(_0x03a2('0x5'));var fs=require('fs');var path=require(_0x03a2('0x6'));var rimraf=require(_0x03a2('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x03a2('0x8')]=function(_0x1f7bca,_0x126970){return _0x1f7bca['define']('SalesforceConfiguration',attributes,{'tableName':_0x03a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index c6414ea..c89662f 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 _0x8e46=['stringify','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x14d29e,_0x1b2bab){var _0x5947da=function(_0x55b5b9){while(--_0x55b5b9){_0x14d29e['push'](_0x14d29e['shift']());}};_0x5947da(++_0x1b2bab);}(_0x8e46,0xf7));var _0x68e4=function(_0x10acb2,_0x3ca870){_0x10acb2=_0x10acb2-0x0;var _0x186379=_0x8e46[_0x10acb2];return _0x186379;};'use strict';var _=require(_0x68e4('0x0'));var util=require(_0x68e4('0x1'));var moment=require(_0x68e4('0x2'));var BPromise=require(_0x68e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68e4('0x4'));var db=require(_0x68e4('0x5'))['db'];var utils=require(_0x68e4('0x6'));var logger=require(_0x68e4('0x7'))(_0x68e4('0x8'));var config=require(_0x68e4('0x9'));var jayson=require(_0x68e4('0xa'));var client=jayson[_0x68e4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5600ea,_0x45803e,_0x4d69b7){return new BPromise(function(_0x3275f5,_0x296bec){return client['request'](_0x5600ea,_0x4d69b7)[_0x68e4('0xc')](function(_0xfea257){logger['info'](_0x68e4('0xd'),_0x45803e,'request\x20sent');logger[_0x68e4('0xe')](_0x68e4('0xf'),_0x45803e,_0x68e4('0x10'),JSON[_0x68e4('0x11')](_0xfea257));if(_0xfea257[_0x68e4('0x12')]){if(_0xfea257[_0x68e4('0x12')][_0x68e4('0x13')]===0x1f4){logger[_0x68e4('0x12')](_0x68e4('0xd'),_0x45803e,_0xfea257[_0x68e4('0x12')]['message']);return _0x296bec(_0xfea257[_0x68e4('0x12')][_0x68e4('0x14')]);}logger['error'](_0x68e4('0xd'),_0x45803e,_0xfea257[_0x68e4('0x12')][_0x68e4('0x14')]);return _0x3275f5(_0xfea257[_0x68e4('0x12')][_0x68e4('0x14')]);}else{logger[_0x68e4('0x15')](_0x68e4('0xd'),_0x45803e,'request\x20sent');_0x3275f5(_0xfea257['result']['message']);}})['catch'](function(_0x1b76e7){logger[_0x68e4('0x12')](_0x68e4('0xd'),_0x45803e,_0x1b76e7);_0x296bec(_0x1b76e7);});});} \ No newline at end of file +var _0xdeb2=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x2ce49b,_0x4114e8){var _0x1107ca=function(_0x163e08){while(--_0x163e08){_0x2ce49b['push'](_0x2ce49b['shift']());}};_0x1107ca(++_0x4114e8);}(_0xdeb2,0x1e9));var _0x2deb=function(_0x35e6c5,_0x502b34){_0x35e6c5=_0x35e6c5-0x0;var _0x538f51=_0xdeb2[_0x35e6c5];return _0x538f51;};'use strict';var _=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var moment=require(_0x2deb('0x2'));var BPromise=require(_0x2deb('0x3'));var rs=require(_0x2deb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2deb('0x5'));var logger=require(_0x2deb('0x6'))(_0x2deb('0x7'));var config=require(_0x2deb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2deb('0x9')][_0x2deb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf3e9,_0x27b296,_0x48ab25){return new BPromise(function(_0x561b8f,_0x54fde8){return client[_0x2deb('0xb')](_0xbf3e9,_0x48ab25)[_0x2deb('0xc')](function(_0x4725a8){logger[_0x2deb('0xd')](_0x2deb('0xe'),_0x27b296,_0x2deb('0xf'));logger[_0x2deb('0x10')](_0x2deb('0x11'),_0x27b296,_0x2deb('0xf'),JSON[_0x2deb('0x12')](_0x4725a8));if(_0x4725a8['error']){if(_0x4725a8[_0x2deb('0x13')][_0x2deb('0x14')]===0x1f4){logger[_0x2deb('0x13')](_0x2deb('0xe'),_0x27b296,_0x4725a8[_0x2deb('0x13')][_0x2deb('0x15')]);return _0x54fde8(_0x4725a8[_0x2deb('0x13')][_0x2deb('0x15')]);}logger[_0x2deb('0x13')](_0x2deb('0xe'),_0x27b296,_0x4725a8[_0x2deb('0x13')][_0x2deb('0x15')]);return _0x561b8f(_0x4725a8[_0x2deb('0x13')][_0x2deb('0x15')]);}else{logger[_0x2deb('0xd')](_0x2deb('0xe'),_0x27b296,'request\x20sent');_0x561b8f(_0x4725a8[_0x2deb('0x16')]['message']);}})[_0x2deb('0x17')](function(_0x58a223){logger[_0x2deb('0x13')](_0x2deb('0xe'),_0x27b296,_0x58a223);_0x54fde8(_0x58a223);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 1ed0563..35e4f44 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 _0x68ff=['get','isAuthenticated','show','post','/:id','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x3522bf,_0x5407cf){var _0x1502b5=function(_0x336605){while(--_0x336605){_0x3522bf['push'](_0x3522bf['shift']());}};_0x1502b5(++_0x5407cf);}(_0x68ff,0x1c7));var _0xf68f=function(_0x55ea87,_0x3f624d){_0x55ea87=_0x55ea87-0x0;var _0x3f2472=_0x68ff[_0x55ea87];return _0x3f2472;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf68f('0x0'));var timeout=require(_0xf68f('0x1'));var express=require(_0xf68f('0x2'));var router=express[_0xf68f('0x3')]();var fs_extra=require(_0xf68f('0x4'));var auth=require(_0xf68f('0x5'));var interaction=require(_0xf68f('0x6'));var config=require(_0xf68f('0x7'));var controller=require(_0xf68f('0x8'));router[_0xf68f('0x9')]('/',auth[_0xf68f('0xa')](),controller['index']);router[_0xf68f('0x9')]('/:id',auth[_0xf68f('0xa')](),controller[_0xf68f('0xb')]);router[_0xf68f('0xc')]('/',auth[_0xf68f('0xa')](),controller['create']);router['put'](_0xf68f('0xd'),auth[_0xf68f('0xa')](),controller['update']);router[_0xf68f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf68f('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3a09=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0x3a09,0x1a3));var _0x93a0=function(_0x3c9ade,_0x33eea0){_0x3c9ade=_0x3c9ade-0x0;var _0x213be8=_0x3a09[_0x3c9ade];return _0x213be8;};'use strict';var multer=require(_0x93a0('0x0'));var util=require(_0x93a0('0x1'));var path=require('path');var timeout=require(_0x93a0('0x2'));var express=require(_0x93a0('0x3'));var router=express[_0x93a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93a0('0x5'));var interaction=require(_0x93a0('0x6'));var config=require(_0x93a0('0x7'));var controller=require(_0x93a0('0x8'));router['get']('/',auth[_0x93a0('0x9')](),controller[_0x93a0('0xa')]);router[_0x93a0('0xb')](_0x93a0('0xc'),auth[_0x93a0('0x9')](),controller[_0x93a0('0xd')]);router[_0x93a0('0xe')]('/',auth[_0x93a0('0x9')](),controller[_0x93a0('0xf')]);router[_0x93a0('0x10')](_0x93a0('0xc'),auth['isAuthenticated'](),controller[_0x93a0('0x11')]);router[_0x93a0('0x12')](_0x93a0('0xc'),auth[_0x93a0('0x9')](),controller[_0x93a0('0x13')]);module[_0x93a0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 35f8994..7c37e46 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 _0x1b96=['exports','variable','customVariable','picklist','string','ENUM','STRING','sequelize'];(function(_0x345f95,_0x39bdba){var _0x170360=function(_0xf169d3){while(--_0xf169d3){_0x345f95['push'](_0x345f95['shift']());}};_0x170360(++_0x39bdba);}(_0x1b96,0x1e7));var _0x61b9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1b96[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x61b9('0x0'));module[_0x61b9('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x61b9('0x2'),_0x61b9('0x3'),'keyValue',_0x61b9('0x4')),'defaultValue':_0x61b9('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x61b9('0x6')](_0x61b9('0x5'),_0x61b9('0x2'),_0x61b9('0x3'))},'keyContent':{'type':Sequelize[_0x61b9('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x61b9('0x7')]}}; \ No newline at end of file +var _0xb711=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x1697d6,_0x1fef79){var _0x412815=function(_0x146002){while(--_0x146002){_0x1697d6['push'](_0x1697d6['shift']());}};_0x412815(++_0x1fef79);}(_0xb711,0x1e3));var _0x1b71=function(_0x39b388,_0x282cf8){_0x39b388=_0x39b388-0x0;var _0x6f6ad2=_0xb711[_0x39b388];return _0x6f6ad2;};'use strict';var Sequelize=require(_0x1b71('0x0'));module['exports']={'type':{'type':Sequelize[_0x1b71('0x1')](_0x1b71('0x2'),_0x1b71('0x3'),_0x1b71('0x4'),'keyValue',_0x1b71('0x5')),'defaultValue':_0x1b71('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1b71('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1b71('0x3'),_0x1b71('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1b71('0x6')]},'variableName':{'type':Sequelize[_0x1b71('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 78784a2..6a289b0 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 _0xd0bb=['send','index','map','SalesforceField','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name'];(function(_0x3cbab2,_0x2ea218){var _0x3fe127=function(_0x19d29d){while(--_0x19d29d){_0x3cbab2['push'](_0x3cbab2['shift']());}};_0x3fe127(++_0x2ea218);}(_0xd0bb,0x68));var _0xbd0b=function(_0x388da2,_0x571cad){_0x388da2=_0x388da2-0x0;var _0x2b1a45=_0xd0bb[_0x388da2];return _0x2b1a45;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd0b('0x1'));var jsonpatch=require(_0xbd0b('0x2'));var rp=require('request-promise');var moment=require(_0xbd0b('0x3'));var BPromise=require(_0xbd0b('0x4'));var Mustache=require('mustache');var util=require(_0xbd0b('0x5'));var path=require(_0xbd0b('0x6'));var sox=require(_0xbd0b('0x7'));var csv=require(_0xbd0b('0x8'));var ejs=require(_0xbd0b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbd0b('0xa'));var crypto=require(_0xbd0b('0xb'));var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0xe'));var as=require(_0xbd0b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbd0b('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbd0b('0x11'));var db=require(_0xbd0b('0x12'))['db'];function respondWithStatusCode(_0x43f9a0,_0x4147f1){_0x4147f1=_0x4147f1||0xcc;return function(_0x394d53){if(_0x394d53){return _0x43f9a0['sendStatus'](_0x4147f1);}return _0x43f9a0['status'](_0x4147f1)[_0xbd0b('0x13')]();};}function respondWithResult(_0x1cbb80,_0x50d843){_0x50d843=_0x50d843||0xc8;return function(_0x2a3a27){if(_0x2a3a27){return _0x1cbb80[_0xbd0b('0x14')](_0x50d843)[_0xbd0b('0x15')](_0x2a3a27);}};}function respondWithFilteredResult(_0xeff2a4,_0x43926d){return function(_0x561b11){if(_0x561b11){var _0x3957a7=typeof _0x43926d['offset']===_0xbd0b('0x16')&&typeof _0x43926d[_0xbd0b('0x17')]===_0xbd0b('0x16');var _0x2e0bc8=_0x561b11['count'];var _0x123861=_0x3957a7?0x0:_0x43926d['offset'];var _0x349e45=_0x3957a7?_0x561b11['count']:_0x43926d[_0xbd0b('0x18')]+_0x43926d[_0xbd0b('0x17')];var _0x2db3e1;if(_0x349e45>=_0x2e0bc8){_0x349e45=_0x2e0bc8;_0x2db3e1=0xc8;}else{_0x2db3e1=0xce;}_0xeff2a4[_0xbd0b('0x14')](_0x2db3e1);return _0xeff2a4['set'](_0xbd0b('0x19'),_0x123861+'-'+_0x349e45+'/'+_0x2e0bc8)[_0xbd0b('0x15')](_0x561b11);}return null;};}function patchUpdates(_0x32152e){return function(_0x2b7718){try{jsonpatch[_0xbd0b('0x1a')](_0x2b7718,_0x32152e,!![]);}catch(_0x1e8bf6){return BPromise[_0xbd0b('0x1b')](_0x1e8bf6);}return _0x2b7718[_0xbd0b('0x1c')]();};}function saveUpdates(_0x25a514,_0x37cd6a){return function(_0x49ec2d){if(_0x49ec2d){return _0x49ec2d[_0xbd0b('0x1d')](_0x25a514)['then'](function(_0x44721e){return _0x44721e;});}return null;};}function removeEntity(_0x38fe89,_0x59c92d){return function(_0x5d76d7){if(_0x5d76d7){return _0x5d76d7[_0xbd0b('0x1e')]()[_0xbd0b('0x1f')](function(){_0x38fe89['status'](0xcc)[_0xbd0b('0x13')]();});}};}function handleEntityNotFound(_0x49a311,_0x5a1a44){return function(_0x53dc77){if(!_0x53dc77){_0x49a311[_0xbd0b('0x20')](0x194);}return _0x53dc77;};}function handleError(_0x489093,_0x2e9aac){_0x2e9aac=_0x2e9aac||0x1f4;return function(_0x49b402){logger[_0xbd0b('0x21')](_0x49b402[_0xbd0b('0x22')]);if(_0x49b402[_0xbd0b('0x23')]){delete _0x49b402['name'];}_0x489093['status'](_0x2e9aac)[_0xbd0b('0x24')](_0x49b402);};}exports[_0xbd0b('0x25')]=function(_0x5466aa,_0x55b060){var _0x266875={},_0xe09240={},_0x2d9e59={'count':0x0,'rows':[]};var _0xa59c3e=_[_0xbd0b('0x26')](db[_0xbd0b('0x27')][_0xbd0b('0x28')],function(_0x160574){return{'name':_0x160574[_0xbd0b('0x29')],'type':_0x160574[_0xbd0b('0x2a')]['key']};});_0xe09240['model']=_['map'](_0xa59c3e,'name');_0xe09240['query']=_['keys'](_0x5466aa[_0xbd0b('0x2b')]);_0xe09240['filters']=_[_0xbd0b('0x2c')](_0xe09240[_0xbd0b('0x2d')],_0xe09240[_0xbd0b('0x2b')]);_0x266875[_0xbd0b('0x2e')]=_[_0xbd0b('0x2c')](_0xe09240[_0xbd0b('0x2d')],qs[_0xbd0b('0x2f')](_0x5466aa[_0xbd0b('0x2b')][_0xbd0b('0x2f')]));_0x266875[_0xbd0b('0x2e')]=_0x266875[_0xbd0b('0x2e')][_0xbd0b('0x30')]?_0x266875['attributes']:_0xe09240['model'];if(!_0x5466aa[_0xbd0b('0x2b')]['hasOwnProperty'](_0xbd0b('0x31'))){_0x266875['limit']=qs[_0xbd0b('0x17')](_0x5466aa[_0xbd0b('0x2b')]['limit']);_0x266875[_0xbd0b('0x18')]=qs[_0xbd0b('0x18')](_0x5466aa[_0xbd0b('0x2b')]['offset']);}_0x266875[_0xbd0b('0x32')]=qs[_0xbd0b('0x33')](_0x5466aa[_0xbd0b('0x2b')][_0xbd0b('0x33')]);_0x266875[_0xbd0b('0x34')]=qs[_0xbd0b('0x35')](_[_0xbd0b('0x36')](_0x5466aa[_0xbd0b('0x2b')],_0xe09240[_0xbd0b('0x35')]),_0xa59c3e);if(_0x5466aa[_0xbd0b('0x2b')][_0xbd0b('0x37')]){_0x266875['where']=_['merge'](_0x266875['where'],{'$or':_[_0xbd0b('0x26')](_0xa59c3e,function(_0x4ffa8f){if(_0x4ffa8f['type']!==_0xbd0b('0x38')){var _0x20b64e={};_0x20b64e[_0x4ffa8f[_0xbd0b('0x23')]]={'$like':'%'+_0x5466aa[_0xbd0b('0x2b')]['filter']+'%'};return _0x20b64e;}})});}_0x266875=_[_0xbd0b('0x39')]({},_0x266875,_0x5466aa[_0xbd0b('0x3a')]);var _0xf8a060={'where':_0x266875[_0xbd0b('0x34')]};return db['SalesforceField'][_0xbd0b('0x3b')](_0xf8a060)[_0xbd0b('0x1f')](function(_0x3b00f3){_0x2d9e59[_0xbd0b('0x3b')]=_0x3b00f3;if(_0x5466aa[_0xbd0b('0x2b')][_0xbd0b('0x3c')]){_0x266875[_0xbd0b('0x3d')]=[{'all':!![]}];}return db[_0xbd0b('0x27')][_0xbd0b('0x3e')](_0x266875);})[_0xbd0b('0x1f')](function(_0x1f4003){_0x2d9e59[_0xbd0b('0x3f')]=_0x1f4003;return _0x2d9e59;})[_0xbd0b('0x1f')](respondWithFilteredResult(_0x55b060,_0x266875))['catch'](handleError(_0x55b060,null));};exports[_0xbd0b('0x40')]=function(_0x1420f0,_0xe4bfd7){var _0x218382={'raw':!![],'where':{'id':_0x1420f0[_0xbd0b('0x41')]['id']}},_0x3cfb21={};_0x3cfb21[_0xbd0b('0x2d')]=_['keys'](db[_0xbd0b('0x27')]['rawAttributes']);_0x3cfb21[_0xbd0b('0x2b')]=_['keys'](_0x1420f0[_0xbd0b('0x2b')]);_0x3cfb21[_0xbd0b('0x35')]=_[_0xbd0b('0x2c')](_0x3cfb21['model'],_0x3cfb21[_0xbd0b('0x2b')]);_0x218382['attributes']=_[_0xbd0b('0x2c')](_0x3cfb21['model'],qs['fields'](_0x1420f0[_0xbd0b('0x2b')][_0xbd0b('0x2f')]));_0x218382[_0xbd0b('0x2e')]=_0x218382[_0xbd0b('0x2e')][_0xbd0b('0x30')]?_0x218382[_0xbd0b('0x2e')]:_0x3cfb21[_0xbd0b('0x2d')];if(_0x1420f0[_0xbd0b('0x2b')][_0xbd0b('0x3c')]){_0x218382[_0xbd0b('0x3d')]=[{'all':!![]}];}_0x218382=_[_0xbd0b('0x39')]({},_0x218382,_0x1420f0[_0xbd0b('0x3a')]);return db[_0xbd0b('0x27')]['find'](_0x218382)[_0xbd0b('0x1f')](handleEntityNotFound(_0xe4bfd7,null))[_0xbd0b('0x1f')](respondWithResult(_0xe4bfd7,null))[_0xbd0b('0x42')](handleError(_0xe4bfd7,null));};exports[_0xbd0b('0x43')]=function(_0x6ebe4e,_0x3a4728){return db[_0xbd0b('0x27')][_0xbd0b('0x43')](_0x6ebe4e[_0xbd0b('0x44')],{})[_0xbd0b('0x1f')](respondWithResult(_0x3a4728,0xc9))[_0xbd0b('0x42')](handleError(_0x3a4728,null));};exports[_0xbd0b('0x1d')]=function(_0x167fb1,_0x2bd3d9){if(_0x167fb1[_0xbd0b('0x44')]['id']){delete _0x167fb1[_0xbd0b('0x44')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x167fb1[_0xbd0b('0x41')]['id']}})[_0xbd0b('0x1f')](handleEntityNotFound(_0x2bd3d9,null))[_0xbd0b('0x1f')](saveUpdates(_0x167fb1['body'],null))[_0xbd0b('0x1f')](respondWithResult(_0x2bd3d9,null))['catch'](handleError(_0x2bd3d9,null));};exports[_0xbd0b('0x1e')]=function(_0x2340b8,_0x23525f){return db['SalesforceField'][_0xbd0b('0x45')]({'where':{'id':_0x2340b8[_0xbd0b('0x41')]['id']}})[_0xbd0b('0x1f')](handleEntityNotFound(_0x23525f,null))[_0xbd0b('0x1f')](removeEntity(_0x23525f,null))[_0xbd0b('0x42')](handleError(_0x23525f,null));}; \ No newline at end of file +var _0xe5a4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','then','end','error','stack','name','send','map','SalesforceField','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','update','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0xe5a4,0x81));var _0x4e5a=function(_0x2b608e,_0x2b9d76){_0x2b608e=_0x2b608e-0x0;var _0x2aca67=_0xe5a4[_0x2b608e];return _0x2aca67;};'use strict';var emlformat=require(_0x4e5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e5a('0x2'));var BPromise=require(_0x4e5a('0x3'));var Mustache=require(_0x4e5a('0x4'));var util=require(_0x4e5a('0x5'));var path=require(_0x4e5a('0x6'));var sox=require(_0x4e5a('0x7'));var csv=require(_0x4e5a('0x8'));var ejs=require(_0x4e5a('0x9'));var fs=require('fs');var fs_extra=require(_0x4e5a('0xa'));var _=require('lodash');var squel=require(_0x4e5a('0xb'));var crypto=require(_0x4e5a('0xc'));var jsforce=require(_0x4e5a('0xd'));var deskjs=require(_0x4e5a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4e5a('0xf'));var Papa=require(_0x4e5a('0x10'));var Redis=require(_0x4e5a('0x11'));var authService=require(_0x4e5a('0x12'));var qs=require(_0x4e5a('0x13'));var as=require(_0x4e5a('0x14'));var hardwareService=require(_0x4e5a('0x15'));var logger=require(_0x4e5a('0x16'))(_0x4e5a('0x17'));var utils=require(_0x4e5a('0x18'));var config=require(_0x4e5a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e5a('0x1a'))['db'];function respondWithStatusCode(_0x567aea,_0x42ae9b){_0x42ae9b=_0x42ae9b||0xcc;return function(_0x3c980d){if(_0x3c980d){return _0x567aea[_0x4e5a('0x1b')](_0x42ae9b);}return _0x567aea[_0x4e5a('0x1c')](_0x42ae9b)['end']();};}function respondWithResult(_0x597d53,_0x551d13){_0x551d13=_0x551d13||0xc8;return function(_0x59ea40){if(_0x59ea40){return _0x597d53[_0x4e5a('0x1c')](_0x551d13)[_0x4e5a('0x1d')](_0x59ea40);}};}function respondWithFilteredResult(_0xf7be69,_0x426194){return function(_0x1cdb7a){if(_0x1cdb7a){var _0x1c16e7=typeof _0x426194['offset']===_0x4e5a('0x1e')&&typeof _0x426194[_0x4e5a('0x1f')]===_0x4e5a('0x1e');var _0x3cddd3=_0x1cdb7a[_0x4e5a('0x20')];var _0xd7db81=_0x1c16e7?0x0:_0x426194[_0x4e5a('0x21')];var _0xa637bb=_0x1c16e7?_0x1cdb7a[_0x4e5a('0x20')]:_0x426194['offset']+_0x426194[_0x4e5a('0x1f')];var _0x25fead;if(_0xa637bb>=_0x3cddd3){_0xa637bb=_0x3cddd3;_0x25fead=0xc8;}else{_0x25fead=0xce;}_0xf7be69[_0x4e5a('0x1c')](_0x25fead);return _0xf7be69['set'](_0x4e5a('0x22'),_0xd7db81+'-'+_0xa637bb+'/'+_0x3cddd3)[_0x4e5a('0x1d')](_0x1cdb7a);}return null;};}function patchUpdates(_0x115e5a){return function(_0x323e92){try{jsonpatch['apply'](_0x323e92,_0x115e5a,!![]);}catch(_0x44dfa1){return BPromise[_0x4e5a('0x23')](_0x44dfa1);}return _0x323e92['save']();};}function saveUpdates(_0x276c76,_0x1b06c5){return function(_0x26356e){if(_0x26356e){return _0x26356e['update'](_0x276c76)[_0x4e5a('0x24')](function(_0x4e4f32){return _0x4e4f32;});}return null;};}function removeEntity(_0x3389d7,_0x108711){return function(_0x174004){if(_0x174004){return _0x174004['destroy']()['then'](function(){_0x3389d7[_0x4e5a('0x1c')](0xcc)[_0x4e5a('0x25')]();});}};}function handleEntityNotFound(_0x26a8b8,_0x44b78b){return function(_0x5c4533){if(!_0x5c4533){_0x26a8b8['sendStatus'](0x194);}return _0x5c4533;};}function handleError(_0x5d82ff,_0x37ece2){_0x37ece2=_0x37ece2||0x1f4;return function(_0x58737b){logger[_0x4e5a('0x26')](_0x58737b[_0x4e5a('0x27')]);if(_0x58737b[_0x4e5a('0x28')]){delete _0x58737b[_0x4e5a('0x28')];}_0x5d82ff[_0x4e5a('0x1c')](_0x37ece2)[_0x4e5a('0x29')](_0x58737b);};}exports['index']=function(_0x28be28,_0x555f1a){var _0x291c5e={},_0x55816c={},_0x82a362={'count':0x0,'rows':[]};var _0x50e91e=_[_0x4e5a('0x2a')](db[_0x4e5a('0x2b')]['rawAttributes'],function(_0x4cd1df){return{'name':_0x4cd1df[_0x4e5a('0x2c')],'type':_0x4cd1df['type']['key']};});_0x55816c[_0x4e5a('0x2d')]=_[_0x4e5a('0x2a')](_0x50e91e,_0x4e5a('0x28'));_0x55816c[_0x4e5a('0x2e')]=_[_0x4e5a('0x2f')](_0x28be28[_0x4e5a('0x2e')]);_0x55816c[_0x4e5a('0x30')]=_[_0x4e5a('0x31')](_0x55816c['model'],_0x55816c[_0x4e5a('0x2e')]);_0x291c5e[_0x4e5a('0x32')]=_[_0x4e5a('0x31')](_0x55816c[_0x4e5a('0x2d')],qs[_0x4e5a('0x33')](_0x28be28['query']['fields']));_0x291c5e['attributes']=_0x291c5e[_0x4e5a('0x32')]['length']?_0x291c5e['attributes']:_0x55816c['model'];if(!_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x34')](_0x4e5a('0x35'))){_0x291c5e[_0x4e5a('0x1f')]=qs[_0x4e5a('0x1f')](_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x1f')]);_0x291c5e[_0x4e5a('0x21')]=qs[_0x4e5a('0x21')](_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x21')]);}_0x291c5e[_0x4e5a('0x36')]=qs['sort'](_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x37')]);_0x291c5e['where']=qs[_0x4e5a('0x30')](_[_0x4e5a('0x38')](_0x28be28[_0x4e5a('0x2e')],_0x55816c[_0x4e5a('0x30')]),_0x50e91e);if(_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x39')]){_0x291c5e[_0x4e5a('0x3a')]=_[_0x4e5a('0x3b')](_0x291c5e[_0x4e5a('0x3a')],{'$or':_[_0x4e5a('0x2a')](_0x50e91e,function(_0x5af6a6){if(_0x5af6a6['type']!==_0x4e5a('0x3c')){var _0x194725={};_0x194725[_0x5af6a6[_0x4e5a('0x28')]]={'$like':'%'+_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x39')]+'%'};return _0x194725;}})});}_0x291c5e=_['merge']({},_0x291c5e,_0x28be28['options']);var _0x2b5ad0={'where':_0x291c5e[_0x4e5a('0x3a')]};return db[_0x4e5a('0x2b')][_0x4e5a('0x20')](_0x2b5ad0)[_0x4e5a('0x24')](function(_0x123565){_0x82a362[_0x4e5a('0x20')]=_0x123565;if(_0x28be28[_0x4e5a('0x2e')][_0x4e5a('0x3d')]){_0x291c5e[_0x4e5a('0x3e')]=[{'all':!![]}];}return db[_0x4e5a('0x2b')][_0x4e5a('0x3f')](_0x291c5e);})[_0x4e5a('0x24')](function(_0x16fd7d){_0x82a362[_0x4e5a('0x40')]=_0x16fd7d;return _0x82a362;})['then'](respondWithFilteredResult(_0x555f1a,_0x291c5e))['catch'](handleError(_0x555f1a,null));};exports[_0x4e5a('0x41')]=function(_0x236884,_0x554e82){var _0x27ffa7={'raw':!![],'where':{'id':_0x236884[_0x4e5a('0x42')]['id']}},_0x261b84={};_0x261b84[_0x4e5a('0x2d')]=_[_0x4e5a('0x2f')](db[_0x4e5a('0x2b')][_0x4e5a('0x43')]);_0x261b84['query']=_[_0x4e5a('0x2f')](_0x236884[_0x4e5a('0x2e')]);_0x261b84[_0x4e5a('0x30')]=_[_0x4e5a('0x31')](_0x261b84[_0x4e5a('0x2d')],_0x261b84[_0x4e5a('0x2e')]);_0x27ffa7[_0x4e5a('0x32')]=_[_0x4e5a('0x31')](_0x261b84[_0x4e5a('0x2d')],qs[_0x4e5a('0x33')](_0x236884[_0x4e5a('0x2e')][_0x4e5a('0x33')]));_0x27ffa7[_0x4e5a('0x32')]=_0x27ffa7[_0x4e5a('0x32')]['length']?_0x27ffa7[_0x4e5a('0x32')]:_0x261b84[_0x4e5a('0x2d')];if(_0x236884[_0x4e5a('0x2e')]['includeAll']){_0x27ffa7[_0x4e5a('0x3e')]=[{'all':!![]}];}_0x27ffa7=_['merge']({},_0x27ffa7,_0x236884['options']);return db['SalesforceField'][_0x4e5a('0x44')](_0x27ffa7)[_0x4e5a('0x24')](handleEntityNotFound(_0x554e82,null))[_0x4e5a('0x24')](respondWithResult(_0x554e82,null))[_0x4e5a('0x45')](handleError(_0x554e82,null));};exports[_0x4e5a('0x46')]=function(_0x564e5b,_0x1b337){return db['SalesforceField'][_0x4e5a('0x46')](_0x564e5b['body'],{})[_0x4e5a('0x24')](respondWithResult(_0x1b337,0xc9))['catch'](handleError(_0x1b337,null));};exports[_0x4e5a('0x47')]=function(_0x551c79,_0x2a3c7e){if(_0x551c79[_0x4e5a('0x48')]['id']){delete _0x551c79['body']['id'];}return db[_0x4e5a('0x2b')][_0x4e5a('0x44')]({'where':{'id':_0x551c79[_0x4e5a('0x42')]['id']}})[_0x4e5a('0x24')](handleEntityNotFound(_0x2a3c7e,null))['then'](saveUpdates(_0x551c79[_0x4e5a('0x48')],null))[_0x4e5a('0x24')](respondWithResult(_0x2a3c7e,null))['catch'](handleError(_0x2a3c7e,null));};exports['destroy']=function(_0x42e51,_0x384643){return db[_0x4e5a('0x2b')][_0x4e5a('0x44')]({'where':{'id':_0x42e51[_0x4e5a('0x42')]['id']}})[_0x4e5a('0x24')](handleEntityNotFound(_0x384643,null))[_0x4e5a('0x24')](removeEntity(_0x384643,null))['catch'](handleError(_0x384643,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7b7171f..7a28641 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 _0xf08b=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x150a29,_0x12ad0b){var _0x32ded3=function(_0x23ee7c){while(--_0x23ee7c){_0x150a29['push'](_0x150a29['shift']());}};_0x32ded3(++_0x12ad0b);}(_0xf08b,0x1a3));var _0xbf08=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf08b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbf08('0x0'));var util=require(_0xbf08('0x1'));var logger=require(_0xbf08('0x2'))('api');var moment=require(_0xbf08('0x3'));var BPromise=require(_0xbf08('0x4'));var rp=require(_0xbf08('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf08('0x6'));var config=require(_0xbf08('0x7'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x5ce461,_0x500218){return _0x5ce461[_0xbf08('0x8')](_0xbf08('0x9'),attributes,{'tableName':_0xbf08('0xa'),'paranoid':![],'indexes':[{'name':_0xbf08('0xb'),'fields':[_0xbf08('0xc'),_0xbf08('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadcd=['rimraf','../../config/environment','exports','define','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5b4e88,_0x390d73){var _0x2a8391=function(_0x1e7b61){while(--_0x1e7b61){_0x5b4e88['push'](_0x5b4e88['shift']());}};_0x2a8391(++_0x390d73);}(_0xadcd,0x180));var _0xdadc=function(_0x113990,_0x3bf4c9){_0x113990=_0x113990-0x0;var _0x1580d4=_0xadcd[_0x113990];return _0x1580d4;};'use strict';var _=require(_0xdadc('0x0'));var util=require(_0xdadc('0x1'));var logger=require(_0xdadc('0x2'))(_0xdadc('0x3'));var moment=require('moment');var BPromise=require(_0xdadc('0x4'));var rp=require(_0xdadc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdadc('0x6'));var config=require(_0xdadc('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xdadc('0x8')]=function(_0x19bf2a,_0xbedc29){return _0x19bf2a[_0xdadc('0x9')]('SalesforceField',attributes,{'tableName':_0xdadc('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xdadc('0xb'),_0xdadc('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index df55f7b..8d0b0ea 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 _0x70fc=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x5b607e,_0x3684ef){var _0x2eaed2=function(_0x553eec){while(--_0x553eec){_0x5b607e['push'](_0x5b607e['shift']());}};_0x2eaed2(++_0x3684ef);}(_0x70fc,0x8a));var _0xc70f=function(_0x812fae,_0x119587){_0x812fae=_0x812fae-0x0;var _0x481fb3=_0x70fc[_0x812fae];return _0x481fb3;};'use strict';var _=require(_0xc70f('0x0'));var util=require(_0xc70f('0x1'));var moment=require(_0xc70f('0x2'));var BPromise=require(_0xc70f('0x3'));var rs=require(_0xc70f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc70f('0x5'))['db'];var utils=require(_0xc70f('0x6'));var logger=require(_0xc70f('0x7'))(_0xc70f('0x8'));var config=require(_0xc70f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc70f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d82d,_0x10d9bb,_0x397f39){return new BPromise(function(_0x2804f4,_0xd2df2){return client[_0xc70f('0xb')](_0x48d82d,_0x397f39)['then'](function(_0x48cb5e){logger['info'](_0xc70f('0xc'),_0x10d9bb,_0xc70f('0xd'));logger[_0xc70f('0xe')](_0xc70f('0xf'),_0x10d9bb,_0xc70f('0xd'),JSON[_0xc70f('0x10')](_0x48cb5e));if(_0x48cb5e[_0xc70f('0x11')]){if(_0x48cb5e[_0xc70f('0x11')][_0xc70f('0x12')]===0x1f4){logger[_0xc70f('0x11')](_0xc70f('0xc'),_0x10d9bb,_0x48cb5e['error'][_0xc70f('0x13')]);return _0xd2df2(_0x48cb5e[_0xc70f('0x11')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x10d9bb,_0x48cb5e[_0xc70f('0x11')][_0xc70f('0x13')]);return _0x2804f4(_0x48cb5e[_0xc70f('0x11')][_0xc70f('0x13')]);}else{logger[_0xc70f('0x14')](_0xc70f('0xc'),_0x10d9bb,_0xc70f('0xd'));_0x2804f4(_0x48cb5e[_0xc70f('0x15')][_0xc70f('0x13')]);}})[_0xc70f('0x16')](function(_0x5d2518){logger[_0xc70f('0x11')]('SalesforceField,\x20%s,\x20%s',_0x10d9bb,_0x5d2518);_0xd2df2(_0x5d2518);});});} \ No newline at end of file +var _0x559d=['request','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x559d,0x14d));var _0xd559=function(_0x4cad64,_0x13a1d1){_0x4cad64=_0x4cad64-0x0;var _0x1ebb2d=_0x559d[_0x4cad64];return _0x1ebb2d;};'use strict';var _=require(_0xd559('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd559('0x1'));var fs=require('fs');var Redis=require(_0xd559('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd559('0x3'))(_0xd559('0x4'));var config=require(_0xd559('0x5'));var jayson=require(_0xd559('0x6'));var client=jayson[_0xd559('0x7')][_0xd559('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52245e,_0x523ac1,_0x55630c){return new BPromise(function(_0x2f0678,_0x2d39c5){return client[_0xd559('0x9')](_0x52245e,_0x55630c)[_0xd559('0xa')](function(_0x499601){logger[_0xd559('0xb')]('SalesforceField,\x20%s,\x20%s',_0x523ac1,_0xd559('0xc'));logger['debug'](_0xd559('0xd'),_0x523ac1,_0xd559('0xc'),JSON['stringify'](_0x499601));if(_0x499601[_0xd559('0xe')]){if(_0x499601[_0xd559('0xe')][_0xd559('0xf')]===0x1f4){logger[_0xd559('0xe')](_0xd559('0x10'),_0x523ac1,_0x499601[_0xd559('0xe')][_0xd559('0x11')]);return _0x2d39c5(_0x499601[_0xd559('0xe')][_0xd559('0x11')]);}logger[_0xd559('0xe')](_0xd559('0x10'),_0x523ac1,_0x499601[_0xd559('0xe')]['message']);return _0x2f0678(_0x499601[_0xd559('0xe')][_0xd559('0x11')]);}else{logger[_0xd559('0xb')](_0xd559('0x10'),_0x523ac1,_0xd559('0xc'));_0x2f0678(_0x499601[_0xd559('0x12')][_0xd559('0x11')]);}})['catch'](function(_0x1aec37){logger[_0xd559('0xe')](_0xd559('0x10'),_0x523ac1,_0x1aec37);_0x2d39c5(_0x1aec37);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index caf13a0..4990b71 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 _0xe617=['../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','put','update','destroy','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe617,0x13f));var _0x7e61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe617[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x7e61('0x0'));var util=require(_0x7e61('0x1'));var path=require('path');var timeout=require(_0x7e61('0x2'));var express=require('express');var router=express[_0x7e61('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7e61('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7e61('0x5'));var controller=require(_0x7e61('0x6'));router[_0x7e61('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e61('0x7')](_0x7e61('0x8'),auth[_0x7e61('0x9')](),controller[_0x7e61('0xa')]);router[_0x7e61('0x7')](_0x7e61('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x7e61('0x7')](_0x7e61('0xc'),auth[_0x7e61('0x9')](),controller['getFields']);router[_0x7e61('0xd')]('/',auth[_0x7e61('0x9')](),controller[_0x7e61('0xe')]);router[_0x7e61('0xd')](_0x7e61('0xb'),auth[_0x7e61('0x9')](),controller['addConfiguration']);router[_0x7e61('0xf')](_0x7e61('0x8'),auth[_0x7e61('0x9')](),controller[_0x7e61('0x10')]);router['delete'](_0x7e61('0x8'),auth[_0x7e61('0x9')](),controller[_0x7e61('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe1ee=['/:id','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x7db048,_0x63bf){var _0x1d7fe0=function(_0x32fa46){while(--_0x32fa46){_0x7db048['push'](_0x7db048['shift']());}};_0x1d7fe0(++_0x63bf);}(_0xe1ee,0x158));var _0xee1e=function(_0x25a23f,_0x41d099){_0x25a23f=_0x25a23f-0x0;var _0x18643c=_0xe1ee[_0x25a23f];return _0x18643c;};'use strict';var multer=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var path=require('path');var timeout=require(_0xee1e('0x2'));var express=require(_0xee1e('0x3'));var router=express['Router']();var fs_extra=require(_0xee1e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee1e('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xee1e('0x6')]('/',auth[_0xee1e('0x7')](),controller[_0xee1e('0x8')]);router[_0xee1e('0x6')]('/:id',auth[_0xee1e('0x7')](),controller['show']);router['get']('/:id/configurations',auth[_0xee1e('0x7')](),controller[_0xee1e('0x9')]);router[_0xee1e('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0xee1e('0xa')]);router[_0xee1e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xee1e('0xb')](_0xee1e('0xc'),auth[_0xee1e('0x7')](),controller[_0xee1e('0xd')]);router[_0xee1e('0xe')]('/:id',auth[_0xee1e('0x7')](),controller[_0xee1e('0xf')]);router[_0xee1e('0x10')](_0xee1e('0x11'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 16332b6..61c8646 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 _0x82fd=['remoteUri','exports','STRING','username'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x82fd,0x1a1));var _0xd82f=function(_0x1e3b4a,_0x39a4d0){_0x1e3b4a=_0x1e3b4a-0x0;var _0x279e91=_0x82fd[_0x1e3b4a];return _0x279e91;};'use strict';var Sequelize=require('sequelize');module[_0xd82f('0x0')]={'name':{'type':Sequelize[_0xd82f('0x1')]},'description':{'type':Sequelize[_0xd82f('0x1')]},'username':{'type':Sequelize[_0xd82f('0x1')],'unique':_0xd82f('0x2')},'password':{'type':Sequelize[_0xd82f('0x1')]},'email':{'type':Sequelize[_0xd82f('0x1')]},'remoteUri':{'type':Sequelize[_0xd82f('0x1')],'unique':_0xd82f('0x3')},'serverUrl':{'type':Sequelize[_0xd82f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x042d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x2c7ee5,_0x793fd5){var _0x7e5ae2=function(_0x28a0a5){while(--_0x28a0a5){_0x2c7ee5['push'](_0x2c7ee5['shift']());}};_0x7e5ae2(++_0x793fd5);}(_0x042d,0x17c));var _0xd042=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x042d[_0x261b8a];return _0x3455e8;};'use strict';var Sequelize=require(_0xd042('0x0'));module[_0xd042('0x1')]={'name':{'type':Sequelize[_0xd042('0x2')]},'description':{'type':Sequelize[_0xd042('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd042('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd042('0x2')]},'remoteUri':{'type':Sequelize[_0xd042('0x2')],'unique':_0xd042('0x4')},'serverUrl':{'type':Sequelize[_0xd042('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ec0bf6f..897d65a 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 _0x4a2d=['company','reassignment_count','activity_due','assigned_to','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','category','username','password','email','remoteUri','serverUrl','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','false','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','type','ServicenowAccount','includeAll','include','findAll','rows','catch','params','options','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','impact','work_notes_list','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','follow_up','sys_id','contact_type','reopened_by'];(function(_0x2bb853,_0xe60868){var _0xbe9ec1=function(_0x168526){while(--_0x168526){_0x2bb853['push'](_0x2bb853['shift']());}};_0xbe9ec1(++_0xe60868);}(_0x4a2d,0x197));var _0xd4a2=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x4a2d[_0x30b0d8];return _0x459c09;};'use strict';var emlformat=require(_0xd4a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd4a2('0x1'));var jsonpatch=require(_0xd4a2('0x2'));var rp=require('request-promise');var moment=require(_0xd4a2('0x3'));var BPromise=require(_0xd4a2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd4a2('0x5'));var csv=require(_0xd4a2('0x6'));var ejs=require(_0xd4a2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4a2('0x8'));var squel=require(_0xd4a2('0x9'));var crypto=require(_0xd4a2('0xa'));var jsforce=require(_0xd4a2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd4a2('0x6'));var querystring=require(_0xd4a2('0xc'));var Papa=require(_0xd4a2('0xd'));var Redis=require(_0xd4a2('0xe'));var authService=require(_0xd4a2('0xf'));var qs=require(_0xd4a2('0x10'));var as=require(_0xd4a2('0x11'));var hardwareService=require(_0xd4a2('0x12'));var logger=require(_0xd4a2('0x13'))('api');var utils=require(_0xd4a2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd4a2('0x15'));var db=require(_0xd4a2('0x16'))['db'];var integrations=require(_0xd4a2('0x17'));function respondWithStatusCode(_0x1f0c55,_0x4bc642){_0x4bc642=_0x4bc642||0xcc;return function(_0x318922){if(_0x318922){return _0x1f0c55[_0xd4a2('0x18')](_0x4bc642);}return _0x1f0c55['status'](_0x4bc642)[_0xd4a2('0x19')]();};}function respondWithResult(_0x59902f,_0x165706){_0x165706=_0x165706||0xc8;return function(_0x53ca6f){if(_0x53ca6f){return _0x59902f[_0xd4a2('0x1a')](_0x165706)['json'](_0x53ca6f);}};}function respondWithFilteredResult(_0x3b0a3d,_0x4ed3a5){return function(_0x1f2657){if(_0x1f2657){var _0x933e6e=typeof _0x4ed3a5['offset']===_0xd4a2('0x1b')&&typeof _0x4ed3a5[_0xd4a2('0x1c')]===_0xd4a2('0x1b');var _0x46ba08=_0x1f2657[_0xd4a2('0x1d')];var _0x2f4700=_0x933e6e?0x0:_0x4ed3a5[_0xd4a2('0x1e')];var _0x13e76b=_0x933e6e?_0x1f2657[_0xd4a2('0x1d')]:_0x4ed3a5[_0xd4a2('0x1e')]+_0x4ed3a5[_0xd4a2('0x1c')];var _0x419404;if(_0x13e76b>=_0x46ba08){_0x13e76b=_0x46ba08;_0x419404=0xc8;}else{_0x419404=0xce;}_0x3b0a3d[_0xd4a2('0x1a')](_0x419404);return _0x3b0a3d[_0xd4a2('0x1f')](_0xd4a2('0x20'),_0x2f4700+'-'+_0x13e76b+'/'+_0x46ba08)[_0xd4a2('0x21')](_0x1f2657);}return null;};}function patchUpdates(_0x57fb38){return function(_0x1524c5){try{jsonpatch[_0xd4a2('0x22')](_0x1524c5,_0x57fb38,!![]);}catch(_0x4742fa){return BPromise[_0xd4a2('0x23')](_0x4742fa);}return _0x1524c5[_0xd4a2('0x24')]();};}function saveUpdates(_0x161842,_0x3cb428){return function(_0x46e4aa){if(_0x46e4aa){return _0x46e4aa[_0xd4a2('0x25')](_0x161842)[_0xd4a2('0x26')](function(_0x359edb){return _0x359edb;});}return null;};}function removeEntity(_0x31bde4,_0x5b63c5){return function(_0x135758){if(_0x135758){return _0x135758[_0xd4a2('0x27')]()[_0xd4a2('0x26')](function(){_0x31bde4[_0xd4a2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x68d9b6,_0xbb9988){return function(_0x111331){if(!_0x111331){_0x68d9b6[_0xd4a2('0x18')](0x194);}return _0x111331;};}function handleError(_0x491ad6,_0x5e93d1){_0x5e93d1=_0x5e93d1||0x1f4;return function(_0x2aa1bb){logger[_0xd4a2('0x28')](_0x2aa1bb[_0xd4a2('0x29')]);if(_0x2aa1bb[_0xd4a2('0x2a')]){delete _0x2aa1bb[_0xd4a2('0x2a')];}_0x491ad6[_0xd4a2('0x1a')](_0x5e93d1)[_0xd4a2('0x2b')](_0x2aa1bb);};}exports['index']=function(_0x89fad0,_0x1322cb){var _0x3b9680={},_0x1360ef={},_0x1386a0={'count':0x0,'rows':[]};var _0x5b6047=_[_0xd4a2('0x2c')](db['ServicenowAccount'][_0xd4a2('0x2d')],function(_0xe7e90b){return{'name':_0xe7e90b[_0xd4a2('0x2e')],'type':_0xe7e90b['type'][_0xd4a2('0x2f')]};});_0x1360ef[_0xd4a2('0x30')]=_[_0xd4a2('0x2c')](_0x5b6047,_0xd4a2('0x2a'));_0x1360ef[_0xd4a2('0x31')]=_[_0xd4a2('0x32')](_0x89fad0[_0xd4a2('0x31')]);_0x1360ef['filters']=_[_0xd4a2('0x33')](_0x1360ef[_0xd4a2('0x30')],_0x1360ef[_0xd4a2('0x31')]);_0x3b9680[_0xd4a2('0x34')]=_[_0xd4a2('0x33')](_0x1360ef['model'],qs[_0xd4a2('0x35')](_0x89fad0['query'][_0xd4a2('0x35')]));_0x3b9680['attributes']=_0x3b9680[_0xd4a2('0x34')][_0xd4a2('0x36')]?_0x3b9680[_0xd4a2('0x34')]:_0x1360ef[_0xd4a2('0x30')];if(!_0x89fad0[_0xd4a2('0x31')][_0xd4a2('0x37')](_0xd4a2('0x38'))){_0x3b9680[_0xd4a2('0x1c')]=qs['limit'](_0x89fad0[_0xd4a2('0x31')]['limit']);_0x3b9680[_0xd4a2('0x1e')]=qs[_0xd4a2('0x1e')](_0x89fad0[_0xd4a2('0x31')][_0xd4a2('0x1e')]);}_0x3b9680[_0xd4a2('0x39')]=qs[_0xd4a2('0x3a')](_0x89fad0['query'][_0xd4a2('0x3a')]);_0x3b9680['where']=qs[_0xd4a2('0x3b')](_['pick'](_0x89fad0['query'],_0x1360ef[_0xd4a2('0x3b')]),_0x5b6047);if(_0x89fad0[_0xd4a2('0x31')][_0xd4a2('0x3c')]){_0x3b9680['where']=_[_0xd4a2('0x3d')](_0x3b9680[_0xd4a2('0x3e')],{'$or':_[_0xd4a2('0x2c')](_0x5b6047,function(_0x49acb9){if(_0x49acb9[_0xd4a2('0x3f')]!=='VIRTUAL'){var _0x31e2e6={};_0x31e2e6[_0x49acb9[_0xd4a2('0x2a')]]={'$like':'%'+_0x89fad0[_0xd4a2('0x31')][_0xd4a2('0x3c')]+'%'};return _0x31e2e6;}})});}_0x3b9680=_[_0xd4a2('0x3d')]({},_0x3b9680,_0x89fad0['options']);var _0xbfa649={'where':_0x3b9680[_0xd4a2('0x3e')]};return db[_0xd4a2('0x40')][_0xd4a2('0x1d')](_0xbfa649)['then'](function(_0x857c82){_0x1386a0[_0xd4a2('0x1d')]=_0x857c82;if(_0x89fad0[_0xd4a2('0x31')][_0xd4a2('0x41')]){_0x3b9680[_0xd4a2('0x42')]=[{'all':!![]}];}return db[_0xd4a2('0x40')][_0xd4a2('0x43')](_0x3b9680);})[_0xd4a2('0x26')](function(_0x24555c){_0x1386a0[_0xd4a2('0x44')]=_0x24555c;return _0x1386a0;})['then'](respondWithFilteredResult(_0x1322cb,_0x3b9680))[_0xd4a2('0x45')](handleError(_0x1322cb,null));};exports['show']=function(_0x4588df,_0xce91ba){var _0x42631f={'raw':![],'where':{'id':_0x4588df[_0xd4a2('0x46')]['id']}},_0x1819c2={};_0x1819c2[_0xd4a2('0x30')]=_[_0xd4a2('0x32')](db['ServicenowAccount'][_0xd4a2('0x2d')]);_0x1819c2[_0xd4a2('0x31')]=_['keys'](_0x4588df[_0xd4a2('0x31')]);_0x1819c2['filters']=_['intersection'](_0x1819c2['model'],_0x1819c2[_0xd4a2('0x31')]);_0x42631f['attributes']=_[_0xd4a2('0x33')](_0x1819c2['model'],qs['fields'](_0x4588df[_0xd4a2('0x31')][_0xd4a2('0x35')]));_0x42631f[_0xd4a2('0x34')]=_0x42631f['attributes'][_0xd4a2('0x36')]?_0x42631f[_0xd4a2('0x34')]:_0x1819c2['model'];if(_0x4588df['query'][_0xd4a2('0x41')]){_0x42631f[_0xd4a2('0x42')]=[{'all':!![]}];}_0x42631f=_[_0xd4a2('0x3d')]({},_0x42631f,_0x4588df[_0xd4a2('0x47')]);return db[_0xd4a2('0x40')][_0xd4a2('0x48')](_0x42631f)[_0xd4a2('0x26')](handleEntityNotFound(_0xce91ba,null))[_0xd4a2('0x26')](respondWithResult(_0xce91ba,null))[_0xd4a2('0x45')](handleError(_0xce91ba,null));};exports[_0xd4a2('0x49')]=function(_0x1831b1,_0x3cb9d1){return db[_0xd4a2('0x40')][_0xd4a2('0x49')](_0x1831b1[_0xd4a2('0x4a')],{})[_0xd4a2('0x26')](respondWithResult(_0x3cb9d1,0xc9))[_0xd4a2('0x45')](handleError(_0x3cb9d1,null));};exports[_0xd4a2('0x25')]=function(_0x198d87,_0x56b7cf){if(_0x198d87[_0xd4a2('0x4a')]['id']){delete _0x198d87[_0xd4a2('0x4a')]['id'];}return db[_0xd4a2('0x40')][_0xd4a2('0x48')]({'where':{'id':_0x198d87[_0xd4a2('0x46')]['id']}})[_0xd4a2('0x26')](handleEntityNotFound(_0x56b7cf,null))[_0xd4a2('0x26')](saveUpdates(_0x198d87[_0xd4a2('0x4a')],null))['then'](respondWithResult(_0x56b7cf,null))[_0xd4a2('0x45')](handleError(_0x56b7cf,null));};exports[_0xd4a2('0x27')]=function(_0xc40df,_0x41a0c2){return db[_0xd4a2('0x40')][_0xd4a2('0x48')]({'where':{'id':_0xc40df['params']['id']}})[_0xd4a2('0x26')](handleEntityNotFound(_0x41a0c2,null))['then'](removeEntity(_0x41a0c2,null))[_0xd4a2('0x45')](handleError(_0x41a0c2,null));};exports[_0xd4a2('0x4b')]=function(_0x567552,_0xfef6e4,_0x278dc0){var _0x141e93={};var _0x28637f={};var _0x16e136;var _0x160b3f;return db['ServicenowAccount'][_0xd4a2('0x4c')]({'where':{'id':_0x567552[_0xd4a2('0x46')]['id']}})['then'](handleEntityNotFound(_0xfef6e4,null))['then'](function(_0x13aa1d){if(_0x13aa1d){_0x16e136=_0x13aa1d;_0x28637f[_0xd4a2('0x30')]=_[_0xd4a2('0x32')](db['ServicenowConfiguration']['rawAttributes']);_0x28637f['query']=_[_0xd4a2('0x32')](_0x567552[_0xd4a2('0x31')]);_0x28637f[_0xd4a2('0x3b')]=_['intersection'](_0x28637f['model'],_0x28637f[_0xd4a2('0x31')]);_0x141e93[_0xd4a2('0x34')]=_[_0xd4a2('0x33')](_0x28637f[_0xd4a2('0x30')],qs[_0xd4a2('0x35')](_0x567552[_0xd4a2('0x31')][_0xd4a2('0x35')]));_0x141e93[_0xd4a2('0x34')]=_0x141e93[_0xd4a2('0x34')]['length']?_0x141e93[_0xd4a2('0x34')]:_0x28637f[_0xd4a2('0x30')];_0x141e93[_0xd4a2('0x39')]=qs['sort'](_0x567552['query']['sort']);_0x141e93[_0xd4a2('0x3e')]=qs[_0xd4a2('0x3b')](_[_0xd4a2('0x4d')](_0x567552[_0xd4a2('0x31')],_0x28637f[_0xd4a2('0x3b')]));if(_0x567552[_0xd4a2('0x31')][_0xd4a2('0x3c')]){_0x141e93['where']=_[_0xd4a2('0x3d')](_0x141e93[_0xd4a2('0x3e')],{'$or':_['map'](_0x141e93[_0xd4a2('0x34')],function(_0x458a99){var _0x2e0804={};_0x2e0804[_0x458a99]={'$like':'%'+_0x567552[_0xd4a2('0x31')][_0xd4a2('0x3c')]+'%'};return _0x2e0804;})});}_0x141e93=_[_0xd4a2('0x3d')]({},_0x141e93,_0x567552['options']);return _0x16e136[_0xd4a2('0x4b')](_0x141e93);}})[_0xd4a2('0x26')](function(_0x59d8ae){if(_0x59d8ae){_0x160b3f=_0x59d8ae[_0xd4a2('0x36')];if(!_0x567552[_0xd4a2('0x31')]['hasOwnProperty'](_0xd4a2('0x38'))){_0x141e93[_0xd4a2('0x1c')]=qs[_0xd4a2('0x1c')](_0x567552[_0xd4a2('0x31')][_0xd4a2('0x1c')]);_0x141e93['offset']=qs[_0xd4a2('0x1e')](_0x567552[_0xd4a2('0x31')][_0xd4a2('0x1e')]);}return _0x16e136[_0xd4a2('0x4b')](_0x141e93);}})[_0xd4a2('0x26')](function(_0x1a1630){if(_0x1a1630){return _0x1a1630?{'count':_0x160b3f,'rows':_0x1a1630}:null;}})[_0xd4a2('0x26')](respondWithResult(_0xfef6e4,null))[_0xd4a2('0x45')](handleError(_0xfef6e4,null));};exports[_0xd4a2('0x4e')]=function(_0x2538fc,_0x521346,_0x5ad9da){if(_0x2538fc[_0xd4a2('0x4a')]['id']){delete _0x2538fc[_0xd4a2('0x4a')]['id'];}return db[_0xd4a2('0x40')][_0xd4a2('0x4c')]({'where':{'id':_0x2538fc[_0xd4a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x521346,null))[_0xd4a2('0x26')](function(_0x3698f0){if(_0x3698f0){_0x2538fc['body'][_0xd4a2('0x4f')]=_0x3698f0['id'];_0x2538fc[_0xd4a2('0x4a')]['Subjects']=integrations[_0xd4a2('0x50')](_0x2538fc[_0xd4a2('0x4a')]['channel'],_0x2538fc['body']['type']);_0x2538fc[_0xd4a2('0x4a')][_0xd4a2('0x51')]=integrations[_0xd4a2('0x52')](_0x2538fc[_0xd4a2('0x4a')][_0xd4a2('0x53')],_0x2538fc[_0xd4a2('0x4a')][_0xd4a2('0x3f')]);return db[_0xd4a2('0x54')][_0xd4a2('0x49')](_0x2538fc[_0xd4a2('0x4a')],{'include':[{'model':db[_0xd4a2('0x55')],'as':'Subjects'},{'model':db[_0xd4a2('0x55')],'as':_0xd4a2('0x51')}]});}return null;})[_0xd4a2('0x26')](respondWithResult(_0x521346,null))[_0xd4a2('0x45')](handleError(_0x521346,null));};exports[_0xd4a2('0x56')]=function(_0x46fbe6,_0xe68108,_0x3e5e6f){var _0x2bb813=[_0xd4a2('0x57'),_0xd4a2('0x58'),_0xd4a2('0x59'),_0xd4a2('0x5a'),_0xd4a2('0x5b'),'notify',_0xd4a2('0x5c'),_0xd4a2('0x5d'),'category'];var _0x4e1ef4=['parent','made_sla',_0xd4a2('0x5e'),'watch_list',_0xd4a2('0x5f'),_0xd4a2('0x60'),_0xd4a2('0x61'),_0xd4a2('0x58'),_0xd4a2('0x62'),_0xd4a2('0x63'),_0xd4a2('0x64'),_0xd4a2('0x65'),_0xd4a2('0x66'),_0xd4a2('0x67'),_0xd4a2('0x68'),_0xd4a2('0x69'),_0xd4a2('0x6a'),'sys_created_by',_0xd4a2('0x59'),'order',_0xd4a2('0x6b'),_0xd4a2('0x6c'),_0xd4a2('0x6d'),'delivery_plan',_0xd4a2('0x6e'),'active',_0xd4a2('0x6f'),'business_service',_0xd4a2('0x70'),_0xd4a2('0x71'),'rfc',_0xd4a2('0x72'),_0xd4a2('0x73'),'opened_at',_0xd4a2('0x74'),_0xd4a2('0x75'),_0xd4a2('0x76'),_0xd4a2('0x77'),_0xd4a2('0x78'),_0xd4a2('0x79'),_0xd4a2('0x7a'),_0xd4a2('0x5a'),_0xd4a2('0x7b'),_0xd4a2('0x7c'),_0xd4a2('0x5b'),_0xd4a2('0x7d'),_0xd4a2('0x7e'),_0xd4a2('0x7f'),_0xd4a2('0x80'),_0xd4a2('0x81'),_0xd4a2('0x82'),_0xd4a2('0x83'),_0xd4a2('0x84'),_0xd4a2('0x85'),'sys_class_name',_0xd4a2('0x86'),'closed_by',_0xd4a2('0x87'),'parent_incident',_0xd4a2('0x88'),_0xd4a2('0x89'),_0xd4a2('0x8a'),_0xd4a2('0x5c'),'urgency','problem_id',_0xd4a2('0x8b'),_0xd4a2('0x8c'),_0xd4a2('0x8d'),_0xd4a2('0x8e'),_0xd4a2('0x5d'),'comments','sla_due',_0xd4a2('0x8f'),_0xd4a2('0x90'),'due_date',_0xd4a2('0x91'),_0xd4a2('0x92'),_0xd4a2('0x93'),'escalation',_0xd4a2('0x94'),_0xd4a2('0x95'),'location',_0xd4a2('0x96')];var _0x2a172e='';var _0x5e198c='';var _0x45b473=[];var _0x1986ed='';var _0x5c2cd8='';var _0x40a247=[];var _0x17dee3='';var _0x1596b8='';var _0xa76c9d={};var _0x597e67='';return db[_0xd4a2('0x40')][_0xd4a2('0x4c')]({'where':{'id':_0x46fbe6[_0xd4a2('0x46')]['id']},'attributes':['id',_0xd4a2('0x97'),_0xd4a2('0x98'),_0xd4a2('0x99'),_0xd4a2('0x9a'),_0xd4a2('0x9b')]})[_0xd4a2('0x26')](handleEntityNotFound(_0xe68108,null))[_0xd4a2('0x26')](function(_0x154460){if(_0x154460){_0x597e67=_0x154460[_0xd4a2('0x9a')];var _0x454633=_0x597e67['slice'](-0x1);if(_0x454633==='/'){_0x597e67=_0x597e67[_0xd4a2('0x9c')](0x0,_0x597e67['lastIndexOf'](_0x454633));}_0x1596b8=util[_0xd4a2('0x9d')](_0xd4a2('0x9e'),_0x597e67);_0x17dee3=util['format'](_0xd4a2('0x9f'),_0x597e67);_0xa76c9d={'user':_0x154460[_0xd4a2('0x97')],'pass':_0x154460[_0xd4a2('0x98')]};var _0x48b294={'method':'GET','uri':_0x1596b8+_0xd4a2('0xa0'),'auth':_0xa76c9d,'json':!![]};return rp(_0x48b294);}})[_0xd4a2('0x26')](function(_0x502a33){if(_0x502a33[_0xd4a2('0xa1')][_0xd4a2('0x36')]>0x0){_0x2a172e=_0x502a33[_0xd4a2('0xa1')];}console[_0xd4a2('0xa2')](_0xd4a2('0xa3'),_0x2a172e);_0x40a247=[];_0x5e198c=Object[_0xd4a2('0xa4')]([],_0x2a172e);_[_0xd4a2('0xa5')](_0x5e198c,function(_0x4b25d5){return!_0x2bb813['includes'](_0x4b25d5['name']);});_0x5e198c['forEach'](function(_0x450223){var _0x2f1be0=createFieldObject(_0x17dee3,_0xa76c9d,_0x450223['internalType'],_0x450223[_0xd4a2('0x2a')],_0x450223['label'],![]);_0x40a247[_0xd4a2('0xa6')](_0x2f1be0);});return Promise[_0xd4a2('0xa7')](_0x40a247);})[_0xd4a2('0x26')](function(_0x2c2435){_0x45b473=_0x2c2435;_0x1986ed=Object[_0xd4a2('0xa4')]([],_0x2a172e);console[_0xd4a2('0xa2')](_0xd4a2('0xa8'),_0x2a172e);_[_0xd4a2('0xa5')](_0x1986ed,function(_0x3b154){return _0x4e1ef4['includes'](_0x3b154[_0xd4a2('0x2a')]);});console[_0xd4a2('0xa2')](_0xd4a2('0xa9'),_0x1986ed);_0x40a247=[];_0x1986ed[_0xd4a2('0xaa')](function(_0x5bea10){var _0x2ad0bf=createFieldObject(_0x17dee3,_0xa76c9d,_0x5bea10['internalType'],_0x5bea10[_0xd4a2('0x2a')],_0x5bea10[_0xd4a2('0xab')],!![]);_0x40a247[_0xd4a2('0xa6')](_0x2ad0bf);});return Promise['all'](_0x40a247);})['then'](function(_0x191485){_0x5c2cd8=_0x191485;var _0x249efd=_0x45b473[_0xd4a2('0xac')](_0x5c2cd8);return{'count':_0x249efd[_0xd4a2('0x36')],'rows':_0x249efd};})[_0xd4a2('0x26')](respondWithResult(_0xe68108,null))[_0xd4a2('0x45')](function(_0x46c844){console[_0xd4a2('0xa2')](_0xd4a2('0xad')+_0x46c844);var _0x3236cb=_0x46fbe6['query'][_0xd4a2('0xae')]?0x1f4:_0x46c844[_0xd4a2('0xaf')]||0x1f4;logger[_0xd4a2('0x28')](_0x46c844[_0xd4a2('0x29')]);delete _0x46c844['name'];if(_0x3236cb===0x191){_0x3236cb=0x190;}_0xe68108[_0xd4a2('0x1a')](_0x3236cb)[_0xd4a2('0x2b')](_0x46fbe6[_0xd4a2('0x31')][_0xd4a2('0xae')]?{'message':_0xd4a2('0xb0'),'statusCode':_0x46c844['statusCode']}:_0x46c844);});};function createFieldObject(_0x23e7da,_0xc0e91b,_0x40d584,_0x146f75,_0x652992,_0x54274d){return new Promise(function(_0x28c5c6,_0x3c9e29){var _0x28b4ac={'id':_0x146f75,'name':_0x652992,'custom':_0x54274d};if(_0x40d584===_0xd4a2('0xb1')){_0x28b4ac[_0xd4a2('0x47')]=[{'name':'True','value':_0xd4a2('0xb2')},{'name':_0xd4a2('0xb3'),'value':_0xd4a2('0xb4')}];_0x28c5c6(_0x28b4ac);}else{var _0x1f4c56={'method':'GET','uri':_0x23e7da+'sys_choice?sysparm_query=name=incident^element='+_0x146f75,'auth':_0xc0e91b,'json':!![]};return rp(_0x1f4c56)[_0xd4a2('0x26')](function(_0x36cf79){var _0x4be41a=[];if(_0x36cf79[_0xd4a2('0xa1')]['length']>0x0){_0x36cf79[_0xd4a2('0xa1')][_0xd4a2('0xaa')](function(_0x14e917){if(_0x14e917['inactive']==='false'){var _0x44fb78={'name':_0x14e917[_0xd4a2('0xab')],'value':_0x14e917[_0xd4a2('0xb5')]};_0x4be41a[_0xd4a2('0xa6')](_0x44fb78);}});}_0x28b4ac['options']=_0x4be41a;if(_0x28b4ac[_0xd4a2('0x47')][_0xd4a2('0x36')]>0x0){_0x28c5c6(_0x28b4ac);}else{if(_0x54274d==![]){_0x28c5c6();}else{_0x28c5c6(_0x28b4ac);}}});}});} \ No newline at end of file +var _0xb131=['notify','incident_state','severity','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','log','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','error','name','send','map','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','ServicenowAccount','includeAll','include','rows','catch','show','params','find','create','update','body','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code'];(function(_0x3aed78,_0x543bf4){var _0x589655=function(_0x5c5640){while(--_0x5c5640){_0x3aed78['push'](_0x3aed78['shift']());}};_0x589655(++_0x543bf4);}(_0xb131,0x1ee));var _0x1b13=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0xb131[_0x286bfb];return _0x52b683;};'use strict';var emlformat=require(_0x1b13('0x0'));var rimraf=require(_0x1b13('0x1'));var zipdir=require(_0x1b13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b13('0x3'));var moment=require(_0x1b13('0x4'));var BPromise=require(_0x1b13('0x5'));var Mustache=require(_0x1b13('0x6'));var util=require(_0x1b13('0x7'));var path=require(_0x1b13('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b13('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b13('0xa'));var squel=require(_0x1b13('0xb'));var crypto=require(_0x1b13('0xc'));var jsforce=require(_0x1b13('0xd'));var deskjs=require(_0x1b13('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b13('0xf'));var Papa=require(_0x1b13('0x10'));var Redis=require(_0x1b13('0x11'));var authService=require(_0x1b13('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1b13('0x13'));var hardwareService=require(_0x1b13('0x14'));var logger=require(_0x1b13('0x15'))(_0x1b13('0x16'));var utils=require(_0x1b13('0x17'));var config=require(_0x1b13('0x18'));var licenseUtil=require(_0x1b13('0x19'));var db=require(_0x1b13('0x1a'))['db'];var integrations=require(_0x1b13('0x1b'));function respondWithStatusCode(_0xafd58b,_0x1427ed){_0x1427ed=_0x1427ed||0xcc;return function(_0x4795e3){if(_0x4795e3){return _0xafd58b[_0x1b13('0x1c')](_0x1427ed);}return _0xafd58b[_0x1b13('0x1d')](_0x1427ed)['end']();};}function respondWithResult(_0x570a64,_0x45b0d8){_0x45b0d8=_0x45b0d8||0xc8;return function(_0x263fe3){if(_0x263fe3){return _0x570a64[_0x1b13('0x1d')](_0x45b0d8)[_0x1b13('0x1e')](_0x263fe3);}};}function respondWithFilteredResult(_0x11dbf4,_0x46707a){return function(_0x4e4391){if(_0x4e4391){var _0x41f877=typeof _0x46707a[_0x1b13('0x1f')]==='undefined'&&typeof _0x46707a[_0x1b13('0x20')]===_0x1b13('0x21');var _0x2aaf06=_0x4e4391['count'];var _0x3b8a2c=_0x41f877?0x0:_0x46707a[_0x1b13('0x1f')];var _0x4079af=_0x41f877?_0x4e4391[_0x1b13('0x22')]:_0x46707a['offset']+_0x46707a[_0x1b13('0x20')];var _0x5d3ae9;if(_0x4079af>=_0x2aaf06){_0x4079af=_0x2aaf06;_0x5d3ae9=0xc8;}else{_0x5d3ae9=0xce;}_0x11dbf4[_0x1b13('0x1d')](_0x5d3ae9);return _0x11dbf4[_0x1b13('0x23')](_0x1b13('0x24'),_0x3b8a2c+'-'+_0x4079af+'/'+_0x2aaf06)[_0x1b13('0x1e')](_0x4e4391);}return null;};}function patchUpdates(_0x4db508){return function(_0x3a30e6){try{jsonpatch[_0x1b13('0x25')](_0x3a30e6,_0x4db508,!![]);}catch(_0x57a8de){return BPromise[_0x1b13('0x26')](_0x57a8de);}return _0x3a30e6[_0x1b13('0x27')]();};}function saveUpdates(_0x442ab3,_0x3664de){return function(_0x24b9ba){if(_0x24b9ba){return _0x24b9ba['update'](_0x442ab3)[_0x1b13('0x28')](function(_0x309fb6){return _0x309fb6;});}return null;};}function removeEntity(_0x4b8069,_0x28aff2){return function(_0x49b991){if(_0x49b991){return _0x49b991['destroy']()[_0x1b13('0x28')](function(){_0x4b8069[_0x1b13('0x1d')](0xcc)[_0x1b13('0x29')]();});}};}function handleEntityNotFound(_0x5b8ec2,_0x53d796){return function(_0x2c2305){if(!_0x2c2305){_0x5b8ec2[_0x1b13('0x1c')](0x194);}return _0x2c2305;};}function handleError(_0x1ad21a,_0x13e42c){_0x13e42c=_0x13e42c||0x1f4;return function(_0x98b03d){logger[_0x1b13('0x2a')](_0x98b03d['stack']);if(_0x98b03d['name']){delete _0x98b03d[_0x1b13('0x2b')];}_0x1ad21a[_0x1b13('0x1d')](_0x13e42c)[_0x1b13('0x2c')](_0x98b03d);};}exports['index']=function(_0x22a48d,_0x3276b5){var _0x5522b4={},_0x576d10={},_0x2881ef={'count':0x0,'rows':[]};var _0x1f8417=_[_0x1b13('0x2d')](db['ServicenowAccount'][_0x1b13('0x2e')],function(_0x586b74){return{'name':_0x586b74['fieldName'],'type':_0x586b74[_0x1b13('0x2f')][_0x1b13('0x30')]};});_0x576d10[_0x1b13('0x31')]=_[_0x1b13('0x2d')](_0x1f8417,'name');_0x576d10['query']=_[_0x1b13('0x32')](_0x22a48d[_0x1b13('0x33')]);_0x576d10['filters']=_[_0x1b13('0x34')](_0x576d10[_0x1b13('0x31')],_0x576d10[_0x1b13('0x33')]);_0x5522b4['attributes']=_['intersection'](_0x576d10['model'],qs[_0x1b13('0x35')](_0x22a48d[_0x1b13('0x33')]['fields']));_0x5522b4[_0x1b13('0x36')]=_0x5522b4[_0x1b13('0x36')][_0x1b13('0x37')]?_0x5522b4[_0x1b13('0x36')]:_0x576d10[_0x1b13('0x31')];if(!_0x22a48d[_0x1b13('0x33')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x5522b4[_0x1b13('0x20')]=qs[_0x1b13('0x20')](_0x22a48d[_0x1b13('0x33')][_0x1b13('0x20')]);_0x5522b4['offset']=qs['offset'](_0x22a48d[_0x1b13('0x33')][_0x1b13('0x1f')]);}_0x5522b4[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x22a48d[_0x1b13('0x33')]['sort']);_0x5522b4[_0x1b13('0x3c')]=qs['filters'](_[_0x1b13('0x3d')](_0x22a48d[_0x1b13('0x33')],_0x576d10[_0x1b13('0x3e')]),_0x1f8417);if(_0x22a48d['query']['filter']){_0x5522b4[_0x1b13('0x3c')]=_['merge'](_0x5522b4[_0x1b13('0x3c')],{'$or':_[_0x1b13('0x2d')](_0x1f8417,function(_0x4d7b2b){if(_0x4d7b2b[_0x1b13('0x2f')]!==_0x1b13('0x3f')){var _0xc911e7={};_0xc911e7[_0x4d7b2b[_0x1b13('0x2b')]]={'$like':'%'+_0x22a48d['query'][_0x1b13('0x40')]+'%'};return _0xc911e7;}})});}_0x5522b4=_[_0x1b13('0x41')]({},_0x5522b4,_0x22a48d[_0x1b13('0x42')]);var _0x5b0188={'where':_0x5522b4['where']};return db[_0x1b13('0x43')][_0x1b13('0x22')](_0x5b0188)[_0x1b13('0x28')](function(_0x292494){_0x2881ef[_0x1b13('0x22')]=_0x292494;if(_0x22a48d['query'][_0x1b13('0x44')]){_0x5522b4[_0x1b13('0x45')]=[{'all':!![]}];}return db[_0x1b13('0x43')]['findAll'](_0x5522b4);})[_0x1b13('0x28')](function(_0x5b0bbc){_0x2881ef[_0x1b13('0x46')]=_0x5b0bbc;return _0x2881ef;})[_0x1b13('0x28')](respondWithFilteredResult(_0x3276b5,_0x5522b4))[_0x1b13('0x47')](handleError(_0x3276b5,null));};exports[_0x1b13('0x48')]=function(_0x3a7707,_0x4bd828){var _0x244d75={'raw':![],'where':{'id':_0x3a7707[_0x1b13('0x49')]['id']}},_0x57bc4a={};_0x57bc4a['model']=_[_0x1b13('0x32')](db[_0x1b13('0x43')][_0x1b13('0x2e')]);_0x57bc4a['query']=_[_0x1b13('0x32')](_0x3a7707[_0x1b13('0x33')]);_0x57bc4a[_0x1b13('0x3e')]=_[_0x1b13('0x34')](_0x57bc4a['model'],_0x57bc4a[_0x1b13('0x33')]);_0x244d75[_0x1b13('0x36')]=_[_0x1b13('0x34')](_0x57bc4a['model'],qs[_0x1b13('0x35')](_0x3a7707[_0x1b13('0x33')][_0x1b13('0x35')]));_0x244d75[_0x1b13('0x36')]=_0x244d75['attributes']['length']?_0x244d75['attributes']:_0x57bc4a[_0x1b13('0x31')];if(_0x3a7707[_0x1b13('0x33')][_0x1b13('0x44')]){_0x244d75['include']=[{'all':!![]}];}_0x244d75=_[_0x1b13('0x41')]({},_0x244d75,_0x3a7707[_0x1b13('0x42')]);return db[_0x1b13('0x43')][_0x1b13('0x4a')](_0x244d75)[_0x1b13('0x28')](handleEntityNotFound(_0x4bd828,null))[_0x1b13('0x28')](respondWithResult(_0x4bd828,null))[_0x1b13('0x47')](handleError(_0x4bd828,null));};exports[_0x1b13('0x4b')]=function(_0x3a7330,_0x151407){return db[_0x1b13('0x43')][_0x1b13('0x4b')](_0x3a7330['body'],{})[_0x1b13('0x28')](respondWithResult(_0x151407,0xc9))[_0x1b13('0x47')](handleError(_0x151407,null));};exports[_0x1b13('0x4c')]=function(_0x20066f,_0x314a35){if(_0x20066f['body']['id']){delete _0x20066f[_0x1b13('0x4d')]['id'];}return db[_0x1b13('0x43')]['find']({'where':{'id':_0x20066f[_0x1b13('0x49')]['id']}})[_0x1b13('0x28')](handleEntityNotFound(_0x314a35,null))[_0x1b13('0x28')](saveUpdates(_0x20066f['body'],null))[_0x1b13('0x28')](respondWithResult(_0x314a35,null))[_0x1b13('0x47')](handleError(_0x314a35,null));};exports[_0x1b13('0x4e')]=function(_0x14e3f0,_0x4a62e3){return db[_0x1b13('0x43')]['find']({'where':{'id':_0x14e3f0[_0x1b13('0x49')]['id']}})[_0x1b13('0x28')](handleEntityNotFound(_0x4a62e3,null))[_0x1b13('0x28')](removeEntity(_0x4a62e3,null))[_0x1b13('0x47')](handleError(_0x4a62e3,null));};exports[_0x1b13('0x4f')]=function(_0x1a1dbc,_0x3507a0,_0x1ca8a8){var _0x4ed3f1={};var _0x2478dd={};var _0x8e49f1;var _0x3c75d6;return db[_0x1b13('0x43')][_0x1b13('0x50')]({'where':{'id':_0x1a1dbc[_0x1b13('0x49')]['id']}})[_0x1b13('0x28')](handleEntityNotFound(_0x3507a0,null))['then'](function(_0x40eb79){if(_0x40eb79){_0x8e49f1=_0x40eb79;_0x2478dd[_0x1b13('0x31')]=_[_0x1b13('0x32')](db[_0x1b13('0x51')]['rawAttributes']);_0x2478dd[_0x1b13('0x33')]=_['keys'](_0x1a1dbc[_0x1b13('0x33')]);_0x2478dd['filters']=_['intersection'](_0x2478dd[_0x1b13('0x31')],_0x2478dd[_0x1b13('0x33')]);_0x4ed3f1[_0x1b13('0x36')]=_['intersection'](_0x2478dd[_0x1b13('0x31')],qs[_0x1b13('0x35')](_0x1a1dbc[_0x1b13('0x33')]['fields']));_0x4ed3f1[_0x1b13('0x36')]=_0x4ed3f1[_0x1b13('0x36')]['length']?_0x4ed3f1[_0x1b13('0x36')]:_0x2478dd['model'];_0x4ed3f1[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x1a1dbc[_0x1b13('0x33')][_0x1b13('0x3b')]);_0x4ed3f1[_0x1b13('0x3c')]=qs[_0x1b13('0x3e')](_[_0x1b13('0x3d')](_0x1a1dbc[_0x1b13('0x33')],_0x2478dd[_0x1b13('0x3e')]));if(_0x1a1dbc[_0x1b13('0x33')][_0x1b13('0x40')]){_0x4ed3f1['where']=_['merge'](_0x4ed3f1['where'],{'$or':_[_0x1b13('0x2d')](_0x4ed3f1[_0x1b13('0x36')],function(_0x444bba){var _0x46ff1={};_0x46ff1[_0x444bba]={'$like':'%'+_0x1a1dbc[_0x1b13('0x33')][_0x1b13('0x40')]+'%'};return _0x46ff1;})});}_0x4ed3f1=_[_0x1b13('0x41')]({},_0x4ed3f1,_0x1a1dbc['options']);return _0x8e49f1[_0x1b13('0x4f')](_0x4ed3f1);}})['then'](function(_0x4c01fa){if(_0x4c01fa){_0x3c75d6=_0x4c01fa[_0x1b13('0x37')];if(!_0x1a1dbc['query']['hasOwnProperty'](_0x1b13('0x39'))){_0x4ed3f1['limit']=qs['limit'](_0x1a1dbc['query']['limit']);_0x4ed3f1[_0x1b13('0x1f')]=qs[_0x1b13('0x1f')](_0x1a1dbc[_0x1b13('0x33')]['offset']);}return _0x8e49f1[_0x1b13('0x4f')](_0x4ed3f1);}})[_0x1b13('0x28')](function(_0x53c9ad){if(_0x53c9ad){return _0x53c9ad?{'count':_0x3c75d6,'rows':_0x53c9ad}:null;}})['then'](respondWithResult(_0x3507a0,null))['catch'](handleError(_0x3507a0,null));};exports[_0x1b13('0x52')]=function(_0x23722a,_0x143018,_0x138b44){if(_0x23722a[_0x1b13('0x4d')]['id']){delete _0x23722a[_0x1b13('0x4d')]['id'];}return db['ServicenowAccount'][_0x1b13('0x50')]({'where':{'id':_0x23722a[_0x1b13('0x49')]['id']}})['then'](handleEntityNotFound(_0x143018,null))[_0x1b13('0x28')](function(_0xcd2dbe){if(_0xcd2dbe){_0x23722a[_0x1b13('0x4d')][_0x1b13('0x53')]=_0xcd2dbe['id'];_0x23722a[_0x1b13('0x4d')][_0x1b13('0x54')]=integrations[_0x1b13('0x55')](_0x23722a[_0x1b13('0x4d')][_0x1b13('0x56')],_0x23722a[_0x1b13('0x4d')][_0x1b13('0x2f')]);_0x23722a[_0x1b13('0x4d')][_0x1b13('0x57')]=integrations[_0x1b13('0x58')](_0x23722a['body']['channel'],_0x23722a[_0x1b13('0x4d')][_0x1b13('0x2f')]);return db['ServicenowConfiguration']['create'](_0x23722a[_0x1b13('0x4d')],{'include':[{'model':db[_0x1b13('0x59')],'as':_0x1b13('0x54')},{'model':db[_0x1b13('0x59')],'as':_0x1b13('0x57')}]});}return null;})[_0x1b13('0x28')](respondWithResult(_0x143018,null))['catch'](handleError(_0x143018,null));};exports[_0x1b13('0x5a')]=function(_0x2fee8e,_0x5d0731,_0x20fecc){var _0x5e3d5b=['made_sla','hold_reason',_0x1b13('0x5b'),_0x1b13('0x5c'),_0x1b13('0x5d'),_0x1b13('0x5e'),_0x1b13('0x5f'),_0x1b13('0x60'),_0x1b13('0x61')];var _0x11cf50=['parent',_0x1b13('0x62'),_0x1b13('0x63'),_0x1b13('0x64'),_0x1b13('0x65'),_0x1b13('0x66'),'child_incidents','hold_reason',_0x1b13('0x67'),_0x1b13('0x68'),_0x1b13('0x69'),_0x1b13('0x6a'),_0x1b13('0x6b'),_0x1b13('0x6c'),_0x1b13('0x6d'),_0x1b13('0x6e'),_0x1b13('0x6f'),_0x1b13('0x70'),_0x1b13('0x5b'),'order','calendar_stc',_0x1b13('0x71'),_0x1b13('0x72'),_0x1b13('0x73'),_0x1b13('0x74'),'active',_0x1b13('0x75'),_0x1b13('0x76'),_0x1b13('0x77'),_0x1b13('0x78'),_0x1b13('0x79'),_0x1b13('0x7a'),_0x1b13('0x7b'),_0x1b13('0x7c'),_0x1b13('0x7d'),_0x1b13('0x7e'),'work_end','reopened_time',_0x1b13('0x7f'),_0x1b13('0x80'),_0x1b13('0x81'),_0x1b13('0x5c'),_0x1b13('0x82'),'short_description',_0x1b13('0x5d'),_0x1b13('0x83'),_0x1b13('0x84'),_0x1b13('0x85'),_0x1b13('0x86'),_0x1b13('0x87'),_0x1b13('0x88'),_0x1b13('0x89'),_0x1b13('0x8a'),_0x1b13('0x5e'),_0x1b13('0x8b'),_0x1b13('0x8c'),_0x1b13('0x8d'),_0x1b13('0x8e'),_0x1b13('0x8f'),_0x1b13('0x90'),_0x1b13('0x91'),_0x1b13('0x92'),_0x1b13('0x5f'),_0x1b13('0x93'),_0x1b13('0x94'),_0x1b13('0x95'),_0x1b13('0x96'),_0x1b13('0x97'),_0x1b13('0x98'),_0x1b13('0x60'),_0x1b13('0x99'),_0x1b13('0x9a'),_0x1b13('0x9b'),_0x1b13('0x9c'),_0x1b13('0x9d'),_0x1b13('0x9e'),'reopen_count',_0x1b13('0x9f'),_0x1b13('0xa0'),_0x1b13('0xa1'),_0x1b13('0xa2'),_0x1b13('0xa3'),_0x1b13('0x61')];var _0x4fd080='';var _0x3b5630='';var _0x33c00b=[];var _0x57831c='';var _0x4909f1='';var _0x39807b=[];var _0x512774='';var _0x5d0255='';var _0x370119={};var _0x533383='';return db[_0x1b13('0x43')][_0x1b13('0x50')]({'where':{'id':_0x2fee8e['params']['id']},'attributes':['id',_0x1b13('0xa4'),_0x1b13('0xa5'),_0x1b13('0xa6'),_0x1b13('0xa7'),_0x1b13('0xa8')]})[_0x1b13('0x28')](handleEntityNotFound(_0x5d0731,null))['then'](function(_0x1ba083){if(_0x1ba083){_0x533383=_0x1ba083[_0x1b13('0xa7')];var _0x20aeb7=_0x533383[_0x1b13('0xa9')](-0x1);if(_0x20aeb7==='/'){_0x533383=_0x533383['substring'](0x0,_0x533383[_0x1b13('0xaa')](_0x20aeb7));}_0x5d0255=util[_0x1b13('0xab')](_0x1b13('0xac'),_0x533383);_0x512774=util['format'](_0x1b13('0xad'),_0x533383);_0x370119={'user':_0x1ba083[_0x1b13('0xa4')],'pass':_0x1ba083[_0x1b13('0xa5')]};var _0x4936d4={'method':_0x1b13('0xae'),'uri':_0x5d0255+'incident?sysparm_display_value=all','auth':_0x370119,'json':!![]};return rp(_0x4936d4);}})[_0x1b13('0x28')](function(_0x40aa79){if(_0x40aa79[_0x1b13('0xaf')][_0x1b13('0x37')]>0x0){_0x4fd080=_0x40aa79[_0x1b13('0xaf')];}console['log'](_0x1b13('0xb0'),_0x4fd080);_0x39807b=[];_0x3b5630=Object[_0x1b13('0xb1')]([],_0x4fd080);_[_0x1b13('0xb2')](_0x3b5630,function(_0x37402a){return!_0x5e3d5b[_0x1b13('0xb3')](_0x37402a[_0x1b13('0x2b')]);});_0x3b5630[_0x1b13('0xb4')](function(_0x19c986){var _0xd64786=createFieldObject(_0x512774,_0x370119,_0x19c986[_0x1b13('0xb5')],_0x19c986[_0x1b13('0x2b')],_0x19c986[_0x1b13('0xb6')],![]);_0x39807b[_0x1b13('0xb7')](_0xd64786);});return Promise[_0x1b13('0xb8')](_0x39807b);})[_0x1b13('0x28')](function(_0x27b280){_0x33c00b=_0x27b280;_0x57831c=Object[_0x1b13('0xb1')]([],_0x4fd080);console[_0x1b13('0xb9')]('TCL:\x20_object',_0x4fd080);_[_0x1b13('0xb2')](_0x57831c,function(_0x3dcce5){return _0x11cf50[_0x1b13('0xb3')](_0x3dcce5['name']);});console[_0x1b13('0xb9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x57831c);_0x39807b=[];_0x57831c['forEach'](function(_0x2a1a5c){var _0x18ea09=createFieldObject(_0x512774,_0x370119,_0x2a1a5c['internalType'],_0x2a1a5c['name'],_0x2a1a5c[_0x1b13('0xb6')],!![]);_0x39807b[_0x1b13('0xb7')](_0x18ea09);});return Promise['all'](_0x39807b);})[_0x1b13('0x28')](function(_0x15f19d){_0x4909f1=_0x15f19d;var _0x37cadf=_0x33c00b['concat'](_0x4909f1);return{'count':_0x37cadf[_0x1b13('0x37')],'rows':_0x37cadf};})[_0x1b13('0x28')](respondWithResult(_0x5d0731,null))[_0x1b13('0x47')](function(_0x46535d){console['log'](_0x1b13('0xba')+_0x46535d);var _0x60e73b=_0x2fee8e[_0x1b13('0x33')][_0x1b13('0xbb')]?0x1f4:_0x46535d[_0x1b13('0xbc')]||0x1f4;logger[_0x1b13('0x2a')](_0x46535d['stack']);delete _0x46535d[_0x1b13('0x2b')];if(_0x60e73b===0x191){_0x60e73b=0x190;}_0x5d0731[_0x1b13('0x1d')](_0x60e73b)['send'](_0x2fee8e[_0x1b13('0x33')]['test']?{'message':_0x1b13('0xbd'),'statusCode':_0x46535d[_0x1b13('0xbc')]}:_0x46535d);});};function createFieldObject(_0x580160,_0x3559f3,_0x50ad5f,_0x4ed2ca,_0x55de8c,_0x19bbe8){return new Promise(function(_0x592b3a,_0xb4d75d){var _0x278d6a={'id':_0x4ed2ca,'name':_0x55de8c,'custom':_0x19bbe8};if(_0x50ad5f===_0x1b13('0xbe')){_0x278d6a['options']=[{'name':'True','value':_0x1b13('0xbf')},{'name':_0x1b13('0xc0'),'value':_0x1b13('0xc1')}];_0x592b3a(_0x278d6a);}else{var _0x25db54={'method':_0x1b13('0xae'),'uri':_0x580160+'sys_choice?sysparm_query=name=incident^element='+_0x4ed2ca,'auth':_0x3559f3,'json':!![]};return rp(_0x25db54)['then'](function(_0x54cac1){var _0x9ce2e3=[];if(_0x54cac1[_0x1b13('0xaf')][_0x1b13('0x37')]>0x0){_0x54cac1[_0x1b13('0xaf')][_0x1b13('0xb4')](function(_0x5bfe17){if(_0x5bfe17[_0x1b13('0xc2')]==='false'){var _0x2e1531={'name':_0x5bfe17['label'],'value':_0x5bfe17[_0x1b13('0xc3')]};_0x9ce2e3[_0x1b13('0xb7')](_0x2e1531);}});}_0x278d6a['options']=_0x9ce2e3;if(_0x278d6a[_0x1b13('0x42')]['length']>0x0){_0x592b3a(_0x278d6a);}else{if(_0x19bbe8==![]){_0x592b3a();}else{_0x592b3a(_0x278d6a);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index abee609..61933c3 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 _0xe2fe=['define','int_servicenow_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x5751f0,_0x10f1c3){var _0x2fb265=function(_0x18d943){while(--_0x18d943){_0x5751f0['push'](_0x5751f0['shift']());}};_0x2fb265(++_0x10f1c3);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('ServicenowAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x3966e3,_0x45995d){var _0x7d78c1=function(_0x4bbe41){while(--_0x4bbe41){_0x3966e3['push'](_0x3966e3['shift']());}};_0x7d78c1(++_0x45995d);}(_0xb138,0x1dd));var _0x8b13=function(_0x4e7213,_0x1642a4){_0x4e7213=_0x4e7213-0x0;var _0x2102f4=_0xb138[_0x4e7213];return _0x2102f4;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'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 f04e10a..25f8c52 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 _0x2ea0=['code','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','ShowServicenowAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error'];(function(_0x368590,_0x48ad74){var _0x5ceb60=function(_0x322b8e){while(--_0x322b8e){_0x368590['push'](_0x368590['shift']());}};_0x5ceb60(++_0x48ad74);}(_0x2ea0,0xe4));var _0x02ea=function(_0xc68650,_0x258343){_0xc68650=_0xc68650-0x0;var _0x57bd40=_0x2ea0[_0xc68650];return _0x57bd40;};'use strict';var _=require('lodash');var util=require(_0x02ea('0x0'));var moment=require('moment');var BPromise=require(_0x02ea('0x1'));var rs=require(_0x02ea('0x2'));var fs=require('fs');var Redis=require(_0x02ea('0x3'));var db=require(_0x02ea('0x4'))['db'];var utils=require(_0x02ea('0x5'));var logger=require(_0x02ea('0x6'))(_0x02ea('0x7'));var config=require(_0x02ea('0x8'));var jayson=require(_0x02ea('0x9'));var client=jayson[_0x02ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45cdbc,_0x961d3f,_0x1d56b3){return new BPromise(function(_0x41641c,_0x55c9c6){return client[_0x02ea('0xb')](_0x45cdbc,_0x1d56b3)[_0x02ea('0xc')](function(_0x151fff){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x961d3f,_0x02ea('0xd'));logger[_0x02ea('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x961d3f,_0x02ea('0xd'),JSON[_0x02ea('0xf')](_0x151fff));if(_0x151fff['error']){if(_0x151fff[_0x02ea('0x10')][_0x02ea('0x11')]===0x1f4){logger[_0x02ea('0x10')](_0x02ea('0x12'),_0x961d3f,_0x151fff[_0x02ea('0x10')]['message']);return _0x55c9c6(_0x151fff[_0x02ea('0x10')][_0x02ea('0x13')]);}logger[_0x02ea('0x10')](_0x02ea('0x12'),_0x961d3f,_0x151fff[_0x02ea('0x10')][_0x02ea('0x13')]);return _0x41641c(_0x151fff['error'][_0x02ea('0x13')]);}else{logger[_0x02ea('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x961d3f,'request\x20sent');_0x41641c(_0x151fff[_0x02ea('0x15')][_0x02ea('0x13')]);}})[_0x02ea('0x16')](function(_0x251957){logger[_0x02ea('0x10')](_0x02ea('0x12'),_0x961d3f,_0x251957);_0x55c9c6(_0x251957);});});}exports[_0x02ea('0x17')]=function(_0x47fb0e){var _0x16bbaf=this;return new Promise(function(_0x527d0b,_0x3d13a2){return db[_0x02ea('0x18')]['findAll']({'raw':_0x47fb0e[_0x02ea('0x19')]?_0x47fb0e['options'][_0x02ea('0x1a')]===undefined?!![]:![]:!![],'where':_0x47fb0e[_0x02ea('0x19')]?_0x47fb0e['options'][_0x02ea('0x1b')]||null:null,'attributes':_0x47fb0e[_0x02ea('0x19')]?_0x47fb0e['options'][_0x02ea('0x1c')]||null:null,'limit':_0x47fb0e['options']?_0x47fb0e['options'][_0x02ea('0x1d')]||null:null,'include':_0x47fb0e[_0x02ea('0x19')]?_0x47fb0e[_0x02ea('0x19')][_0x02ea('0x1e')]?_['map'](_0x47fb0e[_0x02ea('0x19')]['include'],function(_0x5f0d29){return{'model':db[_0x5f0d29[_0x02ea('0x1f')]],'as':_0x5f0d29['as'],'attributes':_0x5f0d29[_0x02ea('0x1c')],'include':_0x5f0d29[_0x02ea('0x1e')]?_[_0x02ea('0x20')](_0x5f0d29[_0x02ea('0x1e')],function(_0x53fbe1){return{'model':db[_0x53fbe1[_0x02ea('0x1f')]],'as':_0x53fbe1['as'],'attributes':_0x53fbe1[_0x02ea('0x1c')],'include':_0x53fbe1['include']?_['map'](_0x53fbe1[_0x02ea('0x1e')],function(_0x357bdd){return{'model':db[_0x357bdd['model']],'as':_0x357bdd['as'],'attributes':_0x357bdd[_0x02ea('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e9f3b){logger[_0x02ea('0x14')](_0x02ea('0x17'),_0x47fb0e);logger['debug'](_0x02ea('0x17'),_0x47fb0e,JSON[_0x02ea('0xf')](_0x2e9f3b));_0x527d0b(_0x2e9f3b);})[_0x02ea('0x16')](function(_0x1004a1){logger['error']('GetServicenowAccount',_0x1004a1[_0x02ea('0x13')],_0x47fb0e);_0x3d13a2(_0x16bbaf[_0x02ea('0x10')](0x1f4,_0x1004a1[_0x02ea('0x13')]));});});};exports[_0x02ea('0x21')]=function(_0x38bec9){var _0x5a1df8=this;return new Promise(function(_0x1e319a,_0x259408){return db[_0x02ea('0x18')][_0x02ea('0x22')]({'raw':_0x38bec9['options']?_0x38bec9[_0x02ea('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38bec9[_0x02ea('0x19')]?_0x38bec9[_0x02ea('0x19')][_0x02ea('0x1b')]||null:null,'attributes':_0x38bec9[_0x02ea('0x19')]?_0x38bec9[_0x02ea('0x19')]['attributes']||null:null,'include':_0x38bec9[_0x02ea('0x19')]?_0x38bec9[_0x02ea('0x19')][_0x02ea('0x1e')]?_[_0x02ea('0x20')](_0x38bec9['options']['include'],function(_0x4ef7d3){return{'model':db[_0x4ef7d3[_0x02ea('0x1f')]],'as':_0x4ef7d3['as'],'attributes':_0x4ef7d3[_0x02ea('0x1c')],'include':_0x4ef7d3[_0x02ea('0x1e')]?_[_0x02ea('0x20')](_0x4ef7d3['include'],function(_0x1ea2ee){return{'model':db[_0x1ea2ee[_0x02ea('0x1f')]],'as':_0x1ea2ee['as'],'attributes':_0x1ea2ee[_0x02ea('0x1c')],'include':_0x1ea2ee['include']?_[_0x02ea('0x20')](_0x1ea2ee[_0x02ea('0x1e')],function(_0xa44925){return{'model':db[_0xa44925[_0x02ea('0x1f')]],'as':_0xa44925['as'],'attributes':_0xa44925[_0x02ea('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x02ea('0xc')](function(_0x8271b1){logger[_0x02ea('0x14')](_0x02ea('0x21'),_0x38bec9);logger[_0x02ea('0xe')](_0x02ea('0x21'),_0x38bec9,JSON[_0x02ea('0xf')](_0x8271b1));_0x1e319a(_0x8271b1);})[_0x02ea('0x16')](function(_0x4df351){logger[_0x02ea('0x10')](_0x02ea('0x21'),_0x4df351[_0x02ea('0x13')],_0x38bec9);_0x259408(_0x5a1df8[_0x02ea('0x10')](0x1f4,_0x4df351[_0x02ea('0x13')]));});});}; \ No newline at end of file +var _0x55af=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ServicenowAccount','options','raw','attributes','limit','include','map','model','debug','GetServicenowAccount','ShowServicenowAccount','where','util','bluebird','ioredis'];(function(_0x1ff8fd,_0x4c1c6d){var _0x570c01=function(_0xe9ae4c){while(--_0xe9ae4c){_0x1ff8fd['push'](_0x1ff8fd['shift']());}};_0x570c01(++_0x4c1c6d);}(_0x55af,0x1ec));var _0xf55a=function(_0x1ad61a,_0x3dac22){_0x1ad61a=_0x1ad61a-0x0;var _0x30caae=_0x55af[_0x1ad61a];return _0x30caae;};'use strict';var _=require('lodash');var util=require(_0xf55a('0x0'));var moment=require('moment');var BPromise=require(_0xf55a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf55a('0x2'));var db=require(_0xf55a('0x3'))['db'];var utils=require(_0xf55a('0x4'));var logger=require(_0xf55a('0x5'))(_0xf55a('0x6'));var config=require(_0xf55a('0x7'));var jayson=require(_0xf55a('0x8'));var client=jayson[_0xf55a('0x9')][_0xf55a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x225462,_0xac5b48,_0x4c8729){return new BPromise(function(_0x459975,_0xe78727){return client[_0xf55a('0xb')](_0x225462,_0x4c8729)[_0xf55a('0xc')](function(_0x1015d4){logger[_0xf55a('0xd')](_0xf55a('0xe'),_0xac5b48,_0xf55a('0xf'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xac5b48,_0xf55a('0xf'),JSON[_0xf55a('0x10')](_0x1015d4));if(_0x1015d4[_0xf55a('0x11')]){if(_0x1015d4[_0xf55a('0x11')][_0xf55a('0x12')]===0x1f4){logger[_0xf55a('0x11')](_0xf55a('0xe'),_0xac5b48,_0x1015d4[_0xf55a('0x11')][_0xf55a('0x13')]);return _0xe78727(_0x1015d4['error'][_0xf55a('0x13')]);}logger[_0xf55a('0x11')](_0xf55a('0xe'),_0xac5b48,_0x1015d4[_0xf55a('0x11')]['message']);return _0x459975(_0x1015d4[_0xf55a('0x11')][_0xf55a('0x13')]);}else{logger['info'](_0xf55a('0xe'),_0xac5b48,_0xf55a('0xf'));_0x459975(_0x1015d4['result']['message']);}})[_0xf55a('0x14')](function(_0x216560){logger[_0xf55a('0x11')](_0xf55a('0xe'),_0xac5b48,_0x216560);_0xe78727(_0x216560);});});}exports['GetServicenowAccount']=function(_0x40060a){var _0x5a2299=this;return new Promise(function(_0x2e7883,_0x3c4328){return db[_0xf55a('0x15')]['findAll']({'raw':_0x40060a[_0xf55a('0x16')]?_0x40060a[_0xf55a('0x16')][_0xf55a('0x17')]===undefined?!![]:![]:!![],'where':_0x40060a['options']?_0x40060a[_0xf55a('0x16')]['where']||null:null,'attributes':_0x40060a['options']?_0x40060a[_0xf55a('0x16')][_0xf55a('0x18')]||null:null,'limit':_0x40060a['options']?_0x40060a['options'][_0xf55a('0x19')]||null:null,'include':_0x40060a[_0xf55a('0x16')]?_0x40060a[_0xf55a('0x16')][_0xf55a('0x1a')]?_[_0xf55a('0x1b')](_0x40060a[_0xf55a('0x16')]['include'],function(_0x1674f9){return{'model':db[_0x1674f9[_0xf55a('0x1c')]],'as':_0x1674f9['as'],'attributes':_0x1674f9['attributes'],'include':_0x1674f9[_0xf55a('0x1a')]?_['map'](_0x1674f9[_0xf55a('0x1a')],function(_0x376125){return{'model':db[_0x376125[_0xf55a('0x1c')]],'as':_0x376125['as'],'attributes':_0x376125[_0xf55a('0x18')],'include':_0x376125[_0xf55a('0x1a')]?_['map'](_0x376125[_0xf55a('0x1a')],function(_0x4038a4){return{'model':db[_0x4038a4[_0xf55a('0x1c')]],'as':_0x4038a4['as'],'attributes':_0x4038a4[_0xf55a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3617a2){logger['info']('GetServicenowAccount',_0x40060a);logger[_0xf55a('0x1d')](_0xf55a('0x1e'),_0x40060a,JSON[_0xf55a('0x10')](_0x3617a2));_0x2e7883(_0x3617a2);})[_0xf55a('0x14')](function(_0x1f51ae){logger['error'](_0xf55a('0x1e'),_0x1f51ae[_0xf55a('0x13')],_0x40060a);_0x3c4328(_0x5a2299[_0xf55a('0x11')](0x1f4,_0x1f51ae[_0xf55a('0x13')]));});});};exports[_0xf55a('0x1f')]=function(_0x1d699c){var _0x11ec45=this;return new Promise(function(_0x42cc1f,_0x4d69ff){return db['ServicenowAccount']['find']({'raw':_0x1d699c[_0xf55a('0x16')]?_0x1d699c[_0xf55a('0x16')][_0xf55a('0x17')]===undefined?!![]:![]:!![],'where':_0x1d699c[_0xf55a('0x16')]?_0x1d699c['options'][_0xf55a('0x20')]||null:null,'attributes':_0x1d699c[_0xf55a('0x16')]?_0x1d699c[_0xf55a('0x16')]['attributes']||null:null,'include':_0x1d699c[_0xf55a('0x16')]?_0x1d699c[_0xf55a('0x16')][_0xf55a('0x1a')]?_['map'](_0x1d699c[_0xf55a('0x16')][_0xf55a('0x1a')],function(_0x1b7cd7){return{'model':db[_0x1b7cd7[_0xf55a('0x1c')]],'as':_0x1b7cd7['as'],'attributes':_0x1b7cd7[_0xf55a('0x18')],'include':_0x1b7cd7[_0xf55a('0x1a')]?_[_0xf55a('0x1b')](_0x1b7cd7['include'],function(_0x1cfedc){return{'model':db[_0x1cfedc[_0xf55a('0x1c')]],'as':_0x1cfedc['as'],'attributes':_0x1cfedc['attributes'],'include':_0x1cfedc[_0xf55a('0x1a')]?_[_0xf55a('0x1b')](_0x1cfedc['include'],function(_0x1418a0){return{'model':db[_0x1418a0[_0xf55a('0x1c')]],'as':_0x1418a0['as'],'attributes':_0x1418a0[_0xf55a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf55a('0xc')](function(_0x230ee9){logger[_0xf55a('0xd')](_0xf55a('0x1f'),_0x1d699c);logger[_0xf55a('0x1d')](_0xf55a('0x1f'),_0x1d699c,JSON['stringify'](_0x230ee9));_0x42cc1f(_0x230ee9);})[_0xf55a('0x14')](function(_0x1a3fc3){logger[_0xf55a('0x11')](_0xf55a('0x1f'),_0x1a3fc3[_0xf55a('0x13')],_0x1d699c);_0x4d69ff(_0x11ec45[_0xf55a('0x11')](0x1f4,_0x1a3fc3[_0xf55a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7d966f8..cad4cd0 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 _0xc20e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc20e,0xd0));var _0xec20=function(_0x2f3f74,_0x481d2b){_0x2f3f74=_0x2f3f74-0x0;var _0x16faea=_0xc20e[_0x2f3f74];return _0x16faea;};'use strict';var multer=require('multer');var util=require(_0xec20('0x0'));var path=require(_0xec20('0x1'));var timeout=require(_0xec20('0x2'));var express=require(_0xec20('0x3'));var router=express[_0xec20('0x4')]();var fs_extra=require(_0xec20('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec20('0x6'));var config=require('../../config/environment');var controller=require(_0xec20('0x7'));router[_0xec20('0x8')]('/',auth[_0xec20('0x9')](),controller[_0xec20('0xa')]);router[_0xec20('0x8')](_0xec20('0xb'),auth[_0xec20('0x9')](),controller[_0xec20('0xc')]);router[_0xec20('0x8')]('/:id/fields',auth[_0xec20('0x9')](),controller[_0xec20('0xd')]);router[_0xec20('0x8')]('/:id/subjects',auth[_0xec20('0x9')](),controller[_0xec20('0xe')]);router[_0xec20('0x8')](_0xec20('0xf'),auth[_0xec20('0x9')](),controller[_0xec20('0x10')]);router[_0xec20('0x11')]('/',auth[_0xec20('0x9')](),controller[_0xec20('0x12')]);router[_0xec20('0x13')](_0xec20('0xb'),auth[_0xec20('0x9')](),controller[_0xec20('0x14')]);router['delete']('/:id',auth[_0xec20('0x9')](),controller[_0xec20('0x15')]);module[_0xec20('0x16')]=router; \ No newline at end of file +var _0x9924=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','update','delete','destroy'];(function(_0x20ae3b,_0x23a21c){var _0x391475=function(_0x590776){while(--_0x590776){_0x20ae3b['push'](_0x20ae3b['shift']());}};_0x391475(++_0x23a21c);}(_0x9924,0x199));var _0x4992=function(_0x30927b,_0x3360ae){_0x30927b=_0x30927b-0x0;var _0x2d6854=_0x9924[_0x30927b];return _0x2d6854;};'use strict';var multer=require(_0x4992('0x0'));var util=require(_0x4992('0x1'));var path=require(_0x4992('0x2'));var timeout=require(_0x4992('0x3'));var express=require(_0x4992('0x4'));var router=express['Router']();var fs_extra=require(_0x4992('0x5'));var auth=require(_0x4992('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4992('0x7'));var controller=require(_0x4992('0x8'));router[_0x4992('0x9')]('/',auth[_0x4992('0xa')](),controller[_0x4992('0xb')]);router[_0x4992('0x9')](_0x4992('0xc'),auth['isAuthenticated'](),controller[_0x4992('0xd')]);router['get'](_0x4992('0xe'),auth[_0x4992('0xa')](),controller[_0x4992('0xf')]);router[_0x4992('0x9')]('/:id/subjects',auth[_0x4992('0xa')](),controller['getSubjects']);router[_0x4992('0x9')](_0x4992('0x10'),auth[_0x4992('0xa')](),controller[_0x4992('0x11')]);router[_0x4992('0x12')]('/',auth['isAuthenticated'](),controller[_0x4992('0x13')]);router['put'](_0x4992('0xc'),auth[_0x4992('0xa')](),controller[_0x4992('0x14')]);router[_0x4992('0x15')](_0x4992('0xc'),auth['isAuthenticated'](),controller[_0x4992('0x16')]);module[_0x4992('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 157e4d3..f519ae4 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 _0x6586=['exports','STRING','sequelize'];(function(_0x5027cc,_0x16fbeb){var _0x15e504=function(_0x5d33ad){while(--_0x5d33ad){_0x5027cc['push'](_0x5027cc['shift']());}};_0x15e504(++_0x16fbeb);}(_0x6586,0x6e));var _0x6658=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x6586[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x6658('0x0'));module[_0x6658('0x1')]={'name':{'type':Sequelize[_0x6658('0x2')]},'description':{'type':Sequelize[_0x6658('0x2')]}}; \ No newline at end of file +var _0x8b45=['exports','STRING','sequelize'];(function(_0xc20c81,_0x57f5f7){var _0x2a43d7=function(_0x2eb539){while(--_0x2eb539){_0xc20c81['push'](_0xc20c81['shift']());}};_0x2a43d7(++_0x57f5f7);}(_0x8b45,0x71));var _0x58b4=function(_0x10c307,_0x5b91b5){_0x10c307=_0x10c307-0x0;var _0x4f66c2=_0x8b45[_0x10c307];return _0x4f66c2;};'use strict';var Sequelize=require(_0x58b4('0x0'));module[_0x58b4('0x1')]={'name':{'type':Sequelize[_0x58b4('0x2')]},'description':{'type':Sequelize[_0x58b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index bd680f7..d2c136f 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 _0xf125=['type','model','query','intersection','fields','attributes','length','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','getFields','findOne','pick','nolimit','getSubjects','getDescriptions','ServicenowField','hasOwnProperty','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','name','send','map','ServicenowConfiguration','rawAttributes','fieldName'];(function(_0x5b19ff,_0x399a87){var _0x4c1479=function(_0x3430b6){while(--_0x3430b6){_0x5b19ff['push'](_0x5b19ff['shift']());}};_0x4c1479(++_0x399a87);}(_0xf125,0xbe));var _0x5f12=function(_0x985d17,_0x263da4){_0x985d17=_0x985d17-0x0;var _0x5c3cd4=_0xf125[_0x985d17];return _0x5c3cd4;};'use strict';var emlformat=require(_0x5f12('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f12('0x1'));var moment=require(_0x5f12('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5f12('0x3'));var util=require(_0x5f12('0x4'));var path=require(_0x5f12('0x5'));var sox=require(_0x5f12('0x6'));var csv=require(_0x5f12('0x7'));var ejs=require(_0x5f12('0x8'));var fs=require('fs');var fs_extra=require(_0x5f12('0x9'));var _=require(_0x5f12('0xa'));var squel=require(_0x5f12('0xb'));var crypto=require(_0x5f12('0xc'));var jsforce=require(_0x5f12('0xd'));var deskjs=require(_0x5f12('0xe'));var toCsv=require(_0x5f12('0x7'));var querystring=require(_0x5f12('0xf'));var Papa=require(_0x5f12('0x10'));var Redis=require(_0x5f12('0x11'));var authService=require(_0x5f12('0x12'));var qs=require(_0x5f12('0x13'));var as=require(_0x5f12('0x14'));var hardwareService=require(_0x5f12('0x15'));var logger=require(_0x5f12('0x16'))(_0x5f12('0x17'));var utils=require(_0x5f12('0x18'));var config=require(_0x5f12('0x19'));var licenseUtil=require(_0x5f12('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558409,_0x1a1b2e){_0x1a1b2e=_0x1a1b2e||0xcc;return function(_0x43767f){if(_0x43767f){return _0x558409[_0x5f12('0x1b')](_0x1a1b2e);}return _0x558409['status'](_0x1a1b2e)[_0x5f12('0x1c')]();};}function respondWithResult(_0x5ec30f,_0x30d2fa){_0x30d2fa=_0x30d2fa||0xc8;return function(_0x3fac55){if(_0x3fac55){return _0x5ec30f[_0x5f12('0x1d')](_0x30d2fa)[_0x5f12('0x1e')](_0x3fac55);}};}function respondWithFilteredResult(_0x5f2a89,_0x606b22){return function(_0x5309e6){if(_0x5309e6){var _0x1a29fa=typeof _0x606b22[_0x5f12('0x1f')]===_0x5f12('0x20')&&typeof _0x606b22['limit']===_0x5f12('0x20');var _0x29df86=_0x5309e6['count'];var _0xce6d3d=_0x1a29fa?0x0:_0x606b22['offset'];var _0x11ad57=_0x1a29fa?_0x5309e6[_0x5f12('0x21')]:_0x606b22[_0x5f12('0x1f')]+_0x606b22[_0x5f12('0x22')];var _0x5e9c2a;if(_0x11ad57>=_0x29df86){_0x11ad57=_0x29df86;_0x5e9c2a=0xc8;}else{_0x5e9c2a=0xce;}_0x5f2a89[_0x5f12('0x1d')](_0x5e9c2a);return _0x5f2a89[_0x5f12('0x23')](_0x5f12('0x24'),_0xce6d3d+'-'+_0x11ad57+'/'+_0x29df86)['json'](_0x5309e6);}return null;};}function patchUpdates(_0x3b7e2e){return function(_0x408d56){try{jsonpatch['apply'](_0x408d56,_0x3b7e2e,!![]);}catch(_0x2a8c49){return BPromise[_0x5f12('0x25')](_0x2a8c49);}return _0x408d56['save']();};}function saveUpdates(_0x533a89,_0x569763){return function(_0x119062){if(_0x119062){return _0x119062[_0x5f12('0x26')](_0x533a89)['then'](function(_0x1e4116){return _0x1e4116;});}return null;};}function removeEntity(_0x2ea5ac,_0x38f754){return function(_0x48fa2d){if(_0x48fa2d){return _0x48fa2d[_0x5f12('0x27')]()[_0x5f12('0x28')](function(){_0x2ea5ac[_0x5f12('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50f0b0,_0x15aa38){return function(_0xe5213d){if(!_0xe5213d){_0x50f0b0[_0x5f12('0x1b')](0x194);}return _0xe5213d;};}function handleError(_0x2e6298,_0x6cd63a){_0x6cd63a=_0x6cd63a||0x1f4;return function(_0x1978d4){logger['error'](_0x1978d4['stack']);if(_0x1978d4[_0x5f12('0x29')]){delete _0x1978d4[_0x5f12('0x29')];}_0x2e6298[_0x5f12('0x1d')](_0x6cd63a)[_0x5f12('0x2a')](_0x1978d4);};}exports['index']=function(_0x4c9ae5,_0x37e35c){var _0x2a7e15={},_0x3516e8={},_0xdb5450={'count':0x0,'rows':[]};var _0x5ea242=_[_0x5f12('0x2b')](db[_0x5f12('0x2c')][_0x5f12('0x2d')],function(_0x2e3a71){return{'name':_0x2e3a71[_0x5f12('0x2e')],'type':_0x2e3a71[_0x5f12('0x2f')]['key']};});_0x3516e8[_0x5f12('0x30')]=_[_0x5f12('0x2b')](_0x5ea242,_0x5f12('0x29'));_0x3516e8[_0x5f12('0x31')]=_['keys'](_0x4c9ae5['query']);_0x3516e8['filters']=_[_0x5f12('0x32')](_0x3516e8[_0x5f12('0x30')],_0x3516e8[_0x5f12('0x31')]);_0x2a7e15['attributes']=_[_0x5f12('0x32')](_0x3516e8[_0x5f12('0x30')],qs['fields'](_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x33')]));_0x2a7e15[_0x5f12('0x34')]=_0x2a7e15[_0x5f12('0x34')][_0x5f12('0x35')]?_0x2a7e15[_0x5f12('0x34')]:_0x3516e8[_0x5f12('0x30')];if(!_0x4c9ae5[_0x5f12('0x31')]['hasOwnProperty']('nolimit')){_0x2a7e15['limit']=qs[_0x5f12('0x22')](_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x22')]);_0x2a7e15[_0x5f12('0x1f')]=qs[_0x5f12('0x1f')](_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x1f')]);}_0x2a7e15[_0x5f12('0x36')]=qs[_0x5f12('0x37')](_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x37')]);_0x2a7e15[_0x5f12('0x38')]=qs[_0x5f12('0x39')](_['pick'](_0x4c9ae5['query'],_0x3516e8[_0x5f12('0x39')]),_0x5ea242);if(_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x3a')]){_0x2a7e15[_0x5f12('0x38')]=_[_0x5f12('0x3b')](_0x2a7e15[_0x5f12('0x38')],{'$or':_[_0x5f12('0x2b')](_0x5ea242,function(_0x31f438){if(_0x31f438[_0x5f12('0x2f')]!=='VIRTUAL'){var _0x1085a7={};_0x1085a7[_0x31f438[_0x5f12('0x29')]]={'$like':'%'+_0x4c9ae5[_0x5f12('0x31')][_0x5f12('0x3a')]+'%'};return _0x1085a7;}})});}_0x2a7e15=_[_0x5f12('0x3b')]({},_0x2a7e15,_0x4c9ae5[_0x5f12('0x3c')]);var _0x3879fa={'where':_0x2a7e15[_0x5f12('0x38')]};return db[_0x5f12('0x2c')]['count'](_0x3879fa)[_0x5f12('0x28')](function(_0x3d5143){_0xdb5450[_0x5f12('0x21')]=_0x3d5143;if(_0x4c9ae5['query'][_0x5f12('0x3d')]){_0x2a7e15[_0x5f12('0x3e')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5f12('0x3f')](_0x2a7e15);})[_0x5f12('0x28')](function(_0x471581){_0xdb5450[_0x5f12('0x40')]=_0x471581;return _0xdb5450;})[_0x5f12('0x28')](respondWithFilteredResult(_0x37e35c,_0x2a7e15))[_0x5f12('0x41')](handleError(_0x37e35c,null));};exports['show']=function(_0x43ec9b,_0x2b5c17){var _0x4d7569={'raw':![],'where':{'id':_0x43ec9b[_0x5f12('0x42')]['id']}},_0x4a34fd={};_0x4a34fd['model']=_[_0x5f12('0x43')](db[_0x5f12('0x2c')][_0x5f12('0x2d')]);_0x4a34fd['query']=_[_0x5f12('0x43')](_0x43ec9b[_0x5f12('0x31')]);_0x4a34fd[_0x5f12('0x39')]=_['intersection'](_0x4a34fd[_0x5f12('0x30')],_0x4a34fd[_0x5f12('0x31')]);_0x4d7569[_0x5f12('0x34')]=_[_0x5f12('0x32')](_0x4a34fd[_0x5f12('0x30')],qs[_0x5f12('0x33')](_0x43ec9b[_0x5f12('0x31')]['fields']));_0x4d7569['attributes']=_0x4d7569[_0x5f12('0x34')][_0x5f12('0x35')]?_0x4d7569[_0x5f12('0x34')]:_0x4a34fd[_0x5f12('0x30')];if(_0x43ec9b[_0x5f12('0x31')][_0x5f12('0x3d')]){_0x4d7569[_0x5f12('0x3e')]=[{'all':!![]}];}_0x4d7569=_[_0x5f12('0x3b')]({},_0x4d7569,_0x43ec9b[_0x5f12('0x3c')]);return db[_0x5f12('0x2c')]['find'](_0x4d7569)[_0x5f12('0x28')](handleEntityNotFound(_0x2b5c17,null))[_0x5f12('0x28')](respondWithResult(_0x2b5c17,null))['catch'](handleError(_0x2b5c17,null));};exports[_0x5f12('0x44')]=function(_0x28a286,_0x5c5dcb){return db[_0x5f12('0x2c')][_0x5f12('0x44')](_0x28a286[_0x5f12('0x45')],{})[_0x5f12('0x28')](respondWithResult(_0x5c5dcb,0xc9))[_0x5f12('0x41')](handleError(_0x5c5dcb,null));};exports[_0x5f12('0x26')]=function(_0x50d524,_0x28927e){if(_0x50d524[_0x5f12('0x45')]['id']){delete _0x50d524['body']['id'];}return db['ServicenowConfiguration'][_0x5f12('0x46')]({'where':{'id':_0x50d524[_0x5f12('0x42')]['id']}})['then'](handleEntityNotFound(_0x28927e,null))[_0x5f12('0x28')](saveUpdates(_0x50d524[_0x5f12('0x45')],null))[_0x5f12('0x28')](respondWithResult(_0x28927e,null))[_0x5f12('0x41')](handleError(_0x28927e,null));};exports['destroy']=function(_0x51c462,_0x454e48){return db['ServicenowConfiguration'][_0x5f12('0x46')]({'where':{'id':_0x51c462[_0x5f12('0x42')]['id']}})[_0x5f12('0x28')](handleEntityNotFound(_0x454e48,null))[_0x5f12('0x28')](removeEntity(_0x454e48,null))[_0x5f12('0x41')](handleError(_0x454e48,null));};exports[_0x5f12('0x47')]=function(_0x582049,_0x1e81be,_0x414967){var _0x67ebe3={};var _0x365837={};var _0x4510a8;var _0x35be1a;return db[_0x5f12('0x2c')][_0x5f12('0x48')]({'where':{'id':_0x582049[_0x5f12('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e81be,null))[_0x5f12('0x28')](function(_0xa3a8e8){if(_0xa3a8e8){_0x4510a8=_0xa3a8e8;_0x365837[_0x5f12('0x30')]=_[_0x5f12('0x43')](db['ServicenowField'][_0x5f12('0x2d')]);_0x365837['query']=_[_0x5f12('0x43')](_0x582049[_0x5f12('0x31')]);_0x365837[_0x5f12('0x39')]=_[_0x5f12('0x32')](_0x365837[_0x5f12('0x30')],_0x365837['query']);_0x67ebe3[_0x5f12('0x34')]=_[_0x5f12('0x32')](_0x365837[_0x5f12('0x30')],qs[_0x5f12('0x33')](_0x582049[_0x5f12('0x31')]['fields']));_0x67ebe3[_0x5f12('0x34')]=_0x67ebe3['attributes'][_0x5f12('0x35')]?_0x67ebe3[_0x5f12('0x34')]:_0x365837[_0x5f12('0x30')];_0x67ebe3[_0x5f12('0x36')]=qs['sort'](_0x582049[_0x5f12('0x31')][_0x5f12('0x37')]);_0x67ebe3[_0x5f12('0x38')]=qs[_0x5f12('0x39')](_[_0x5f12('0x49')](_0x582049[_0x5f12('0x31')],_0x365837['filters']));if(_0x582049['query']['filter']){_0x67ebe3['where']=_['merge'](_0x67ebe3[_0x5f12('0x38')],{'$or':_[_0x5f12('0x2b')](_0x67ebe3['attributes'],function(_0x290b07){var _0x5029c8={};_0x5029c8[_0x290b07]={'$like':'%'+_0x582049[_0x5f12('0x31')]['filter']+'%'};return _0x5029c8;})});}_0x67ebe3=_[_0x5f12('0x3b')]({},_0x67ebe3,_0x582049[_0x5f12('0x3c')]);return _0x4510a8[_0x5f12('0x47')](_0x67ebe3);}})[_0x5f12('0x28')](function(_0x5f4104){if(_0x5f4104){_0x35be1a=_0x5f4104[_0x5f12('0x35')];if(!_0x582049['query']['hasOwnProperty'](_0x5f12('0x4a'))){_0x67ebe3['limit']=qs[_0x5f12('0x22')](_0x582049['query']['limit']);_0x67ebe3[_0x5f12('0x1f')]=qs[_0x5f12('0x1f')](_0x582049[_0x5f12('0x31')][_0x5f12('0x1f')]);}return _0x4510a8[_0x5f12('0x47')](_0x67ebe3);}})[_0x5f12('0x28')](function(_0x48112d){if(_0x48112d){return _0x48112d?{'count':_0x35be1a,'rows':_0x48112d}:null;}})[_0x5f12('0x28')](respondWithResult(_0x1e81be,null))['catch'](handleError(_0x1e81be,null));};exports[_0x5f12('0x4b')]=function(_0x1660ac,_0x4eab56,_0x4331d0){var _0xc9eef8={};var _0x159f93={};var _0x52eb25;var _0x3a18cf;return db[_0x5f12('0x2c')][_0x5f12('0x48')]({'where':{'id':_0x1660ac[_0x5f12('0x42')]['id']}})[_0x5f12('0x28')](handleEntityNotFound(_0x4eab56,null))[_0x5f12('0x28')](function(_0x463150){if(_0x463150){_0x52eb25=_0x463150;_0x159f93[_0x5f12('0x30')]=_[_0x5f12('0x43')](db['ServicenowField'][_0x5f12('0x2d')]);_0x159f93['query']=_[_0x5f12('0x43')](_0x1660ac[_0x5f12('0x31')]);_0x159f93[_0x5f12('0x39')]=_[_0x5f12('0x32')](_0x159f93[_0x5f12('0x30')],_0x159f93[_0x5f12('0x31')]);_0xc9eef8[_0x5f12('0x34')]=_[_0x5f12('0x32')](_0x159f93['model'],qs['fields'](_0x1660ac[_0x5f12('0x31')][_0x5f12('0x33')]));_0xc9eef8[_0x5f12('0x34')]=_0xc9eef8[_0x5f12('0x34')][_0x5f12('0x35')]?_0xc9eef8['attributes']:_0x159f93[_0x5f12('0x30')];_0xc9eef8['order']=qs[_0x5f12('0x37')](_0x1660ac[_0x5f12('0x31')][_0x5f12('0x37')]);_0xc9eef8[_0x5f12('0x38')]=qs[_0x5f12('0x39')](_[_0x5f12('0x49')](_0x1660ac[_0x5f12('0x31')],_0x159f93[_0x5f12('0x39')]));if(_0x1660ac[_0x5f12('0x31')][_0x5f12('0x3a')]){_0xc9eef8[_0x5f12('0x38')]=_[_0x5f12('0x3b')](_0xc9eef8['where'],{'$or':_['map'](_0xc9eef8[_0x5f12('0x34')],function(_0x221711){var _0x5759d6={};_0x5759d6[_0x221711]={'$like':'%'+_0x1660ac[_0x5f12('0x31')][_0x5f12('0x3a')]+'%'};return _0x5759d6;})});}_0xc9eef8=_[_0x5f12('0x3b')]({},_0xc9eef8,_0x1660ac[_0x5f12('0x3c')]);return _0x52eb25[_0x5f12('0x4b')](_0xc9eef8);}})[_0x5f12('0x28')](function(_0x3c7f88){if(_0x3c7f88){_0x3a18cf=_0x3c7f88[_0x5f12('0x35')];if(!_0x1660ac[_0x5f12('0x31')]['hasOwnProperty'](_0x5f12('0x4a'))){_0xc9eef8[_0x5f12('0x22')]=qs[_0x5f12('0x22')](_0x1660ac['query']['limit']);_0xc9eef8[_0x5f12('0x1f')]=qs[_0x5f12('0x1f')](_0x1660ac['query'][_0x5f12('0x1f')]);}return _0x52eb25[_0x5f12('0x4b')](_0xc9eef8);}})[_0x5f12('0x28')](function(_0x279e77){if(_0x279e77){return _0x279e77?{'count':_0x3a18cf,'rows':_0x279e77}:null;}})['then'](respondWithResult(_0x4eab56,null))[_0x5f12('0x41')](handleError(_0x4eab56,null));};exports[_0x5f12('0x4c')]=function(_0x4a3f17,_0x4b6a35,_0x31c173){var _0x58ceaa={};var _0x10930a={};var _0x1477b6;var _0xc90544;return db[_0x5f12('0x2c')][_0x5f12('0x48')]({'where':{'id':_0x4a3f17['params']['id']}})[_0x5f12('0x28')](handleEntityNotFound(_0x4b6a35,null))['then'](function(_0x3bec02){if(_0x3bec02){_0x1477b6=_0x3bec02;_0x10930a[_0x5f12('0x30')]=_[_0x5f12('0x43')](db[_0x5f12('0x4d')]['rawAttributes']);_0x10930a[_0x5f12('0x31')]=_[_0x5f12('0x43')](_0x4a3f17[_0x5f12('0x31')]);_0x10930a[_0x5f12('0x39')]=_['intersection'](_0x10930a[_0x5f12('0x30')],_0x10930a[_0x5f12('0x31')]);_0x58ceaa[_0x5f12('0x34')]=_[_0x5f12('0x32')](_0x10930a[_0x5f12('0x30')],qs[_0x5f12('0x33')](_0x4a3f17[_0x5f12('0x31')]['fields']));_0x58ceaa[_0x5f12('0x34')]=_0x58ceaa[_0x5f12('0x34')][_0x5f12('0x35')]?_0x58ceaa[_0x5f12('0x34')]:_0x10930a[_0x5f12('0x30')];_0x58ceaa[_0x5f12('0x36')]=qs['sort'](_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x37')]);_0x58ceaa[_0x5f12('0x38')]=qs[_0x5f12('0x39')](_[_0x5f12('0x49')](_0x4a3f17[_0x5f12('0x31')],_0x10930a[_0x5f12('0x39')]));if(_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x3a')]){_0x58ceaa[_0x5f12('0x38')]=_[_0x5f12('0x3b')](_0x58ceaa[_0x5f12('0x38')],{'$or':_['map'](_0x58ceaa['attributes'],function(_0x27f64c){var _0x52a34b={};_0x52a34b[_0x27f64c]={'$like':'%'+_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x3a')]+'%'};return _0x52a34b;})});}_0x58ceaa=_[_0x5f12('0x3b')]({},_0x58ceaa,_0x4a3f17['options']);return _0x1477b6[_0x5f12('0x4c')](_0x58ceaa);}})[_0x5f12('0x28')](function(_0x139f61){if(_0x139f61){_0xc90544=_0x139f61[_0x5f12('0x35')];if(!_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x4e')](_0x5f12('0x4a'))){_0x58ceaa[_0x5f12('0x22')]=qs[_0x5f12('0x22')](_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x22')]);_0x58ceaa[_0x5f12('0x1f')]=qs[_0x5f12('0x1f')](_0x4a3f17[_0x5f12('0x31')][_0x5f12('0x1f')]);}return _0x1477b6[_0x5f12('0x4c')](_0x58ceaa);}})[_0x5f12('0x28')](function(_0x5bad71){if(_0x5bad71){return _0x5bad71?{'count':_0xc90544,'rows':_0x5bad71}:null;}})['then'](respondWithResult(_0x4b6a35,null))[_0x5f12('0x41')](handleError(_0x4b6a35,null));}; \ No newline at end of file +var _0x19d9=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','filters','includeAll','create','body','getFields','ServicenowField','nolimit','getSubjects','findOne','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','error','stack','name','send','ServicenowConfiguration','rawAttributes','type','key','model','map','keys','query','intersection'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x19d9,0x67));var _0x919d=function(_0x5b9c01,_0x347656){_0x5b9c01=_0x5b9c01-0x0;var _0x2f818b=_0x19d9[_0x5b9c01];return _0x2f818b;};'use strict';var emlformat=require(_0x919d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x919d('0x1'));var rp=require(_0x919d('0x2'));var moment=require(_0x919d('0x3'));var BPromise=require(_0x919d('0x4'));var Mustache=require(_0x919d('0x5'));var util=require(_0x919d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x919d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x919d('0x8'));var _=require(_0x919d('0x9'));var squel=require(_0x919d('0xa'));var crypto=require('crypto');var jsforce=require(_0x919d('0xb'));var deskjs=require(_0x919d('0xc'));var toCsv=require(_0x919d('0x7'));var querystring=require(_0x919d('0xd'));var Papa=require(_0x919d('0xe'));var Redis=require(_0x919d('0xf'));var authService=require(_0x919d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x919d('0x11'));var hardwareService=require(_0x919d('0x12'));var logger=require(_0x919d('0x13'))(_0x919d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x919d('0x15'));var db=require(_0x919d('0x16'))['db'];function respondWithStatusCode(_0x106ae2,_0x29e7b4){_0x29e7b4=_0x29e7b4||0xcc;return function(_0x5a9ce6){if(_0x5a9ce6){return _0x106ae2[_0x919d('0x17')](_0x29e7b4);}return _0x106ae2[_0x919d('0x18')](_0x29e7b4)['end']();};}function respondWithResult(_0x481d39,_0xa20d0e){_0xa20d0e=_0xa20d0e||0xc8;return function(_0x2bf94f){if(_0x2bf94f){return _0x481d39[_0x919d('0x18')](_0xa20d0e)[_0x919d('0x19')](_0x2bf94f);}};}function respondWithFilteredResult(_0x4914d5,_0x2d82b4){return function(_0x21d43f){if(_0x21d43f){var _0x1f75dc=typeof _0x2d82b4[_0x919d('0x1a')]===_0x919d('0x1b')&&typeof _0x2d82b4[_0x919d('0x1c')]===_0x919d('0x1b');var _0x3a90f9=_0x21d43f[_0x919d('0x1d')];var _0x17c672=_0x1f75dc?0x0:_0x2d82b4['offset'];var _0x2b088c=_0x1f75dc?_0x21d43f['count']:_0x2d82b4[_0x919d('0x1a')]+_0x2d82b4[_0x919d('0x1c')];var _0x360518;if(_0x2b088c>=_0x3a90f9){_0x2b088c=_0x3a90f9;_0x360518=0xc8;}else{_0x360518=0xce;}_0x4914d5['status'](_0x360518);return _0x4914d5['set'](_0x919d('0x1e'),_0x17c672+'-'+_0x2b088c+'/'+_0x3a90f9)['json'](_0x21d43f);}return null;};}function patchUpdates(_0x39b928){return function(_0x162767){try{jsonpatch['apply'](_0x162767,_0x39b928,!![]);}catch(_0x5c587d){return BPromise[_0x919d('0x1f')](_0x5c587d);}return _0x162767['save']();};}function saveUpdates(_0x584b89,_0x97f31){return function(_0x29b7c5){if(_0x29b7c5){return _0x29b7c5[_0x919d('0x20')](_0x584b89)[_0x919d('0x21')](function(_0x50eba6){return _0x50eba6;});}return null;};}function removeEntity(_0xf6026d,_0x5acfa2){return function(_0x1c7e4a){if(_0x1c7e4a){return _0x1c7e4a[_0x919d('0x22')]()['then'](function(){_0xf6026d[_0x919d('0x18')](0xcc)[_0x919d('0x23')]();});}};}function handleEntityNotFound(_0x298493,_0x20035f){return function(_0x27b930){if(!_0x27b930){_0x298493[_0x919d('0x17')](0x194);}return _0x27b930;};}function handleError(_0x3a6849,_0x4dbcc1){_0x4dbcc1=_0x4dbcc1||0x1f4;return function(_0x2be4cd){logger[_0x919d('0x24')](_0x2be4cd[_0x919d('0x25')]);if(_0x2be4cd[_0x919d('0x26')]){delete _0x2be4cd[_0x919d('0x26')];}_0x3a6849['status'](_0x4dbcc1)[_0x919d('0x27')](_0x2be4cd);};}exports['index']=function(_0x562dd5,_0xe0b74a){var _0xfe17b7={},_0x26cac0={},_0x50c6b2={'count':0x0,'rows':[]};var _0x1b9273=_['map'](db[_0x919d('0x28')][_0x919d('0x29')],function(_0x406a32){return{'name':_0x406a32['fieldName'],'type':_0x406a32[_0x919d('0x2a')][_0x919d('0x2b')]};});_0x26cac0[_0x919d('0x2c')]=_[_0x919d('0x2d')](_0x1b9273,_0x919d('0x26'));_0x26cac0['query']=_[_0x919d('0x2e')](_0x562dd5[_0x919d('0x2f')]);_0x26cac0['filters']=_[_0x919d('0x30')](_0x26cac0[_0x919d('0x2c')],_0x26cac0[_0x919d('0x2f')]);_0xfe17b7[_0x919d('0x31')]=_['intersection'](_0x26cac0[_0x919d('0x2c')],qs[_0x919d('0x32')](_0x562dd5[_0x919d('0x2f')]['fields']));_0xfe17b7[_0x919d('0x31')]=_0xfe17b7['attributes'][_0x919d('0x33')]?_0xfe17b7[_0x919d('0x31')]:_0x26cac0['model'];if(!_0x562dd5['query'][_0x919d('0x34')]('nolimit')){_0xfe17b7[_0x919d('0x1c')]=qs[_0x919d('0x1c')](_0x562dd5[_0x919d('0x2f')][_0x919d('0x1c')]);_0xfe17b7[_0x919d('0x1a')]=qs[_0x919d('0x1a')](_0x562dd5['query'][_0x919d('0x1a')]);}_0xfe17b7[_0x919d('0x35')]=qs[_0x919d('0x36')](_0x562dd5[_0x919d('0x2f')]['sort']);_0xfe17b7['where']=qs['filters'](_[_0x919d('0x37')](_0x562dd5[_0x919d('0x2f')],_0x26cac0['filters']),_0x1b9273);if(_0x562dd5[_0x919d('0x2f')][_0x919d('0x38')]){_0xfe17b7[_0x919d('0x39')]=_[_0x919d('0x3a')](_0xfe17b7[_0x919d('0x39')],{'$or':_[_0x919d('0x2d')](_0x1b9273,function(_0x51f205){if(_0x51f205[_0x919d('0x2a')]!==_0x919d('0x3b')){var _0x1be711={};_0x1be711[_0x51f205[_0x919d('0x26')]]={'$like':'%'+_0x562dd5['query'][_0x919d('0x38')]+'%'};return _0x1be711;}})});}_0xfe17b7=_[_0x919d('0x3a')]({},_0xfe17b7,_0x562dd5[_0x919d('0x3c')]);var _0x404ae6={'where':_0xfe17b7['where']};return db[_0x919d('0x28')][_0x919d('0x1d')](_0x404ae6)[_0x919d('0x21')](function(_0x3a6e15){_0x50c6b2[_0x919d('0x1d')]=_0x3a6e15;if(_0x562dd5[_0x919d('0x2f')]['includeAll']){_0xfe17b7[_0x919d('0x3d')]=[{'all':!![]}];}return db[_0x919d('0x28')]['findAll'](_0xfe17b7);})['then'](function(_0x45dd75){_0x50c6b2[_0x919d('0x3e')]=_0x45dd75;return _0x50c6b2;})[_0x919d('0x21')](respondWithFilteredResult(_0xe0b74a,_0xfe17b7))[_0x919d('0x3f')](handleError(_0xe0b74a,null));};exports[_0x919d('0x40')]=function(_0x406e3b,_0x274f54){var _0x5f1005={'raw':![],'where':{'id':_0x406e3b[_0x919d('0x41')]['id']}},_0x3e125a={};_0x3e125a['model']=_[_0x919d('0x2e')](db[_0x919d('0x28')][_0x919d('0x29')]);_0x3e125a['query']=_[_0x919d('0x2e')](_0x406e3b['query']);_0x3e125a[_0x919d('0x42')]=_['intersection'](_0x3e125a[_0x919d('0x2c')],_0x3e125a['query']);_0x5f1005[_0x919d('0x31')]=_[_0x919d('0x30')](_0x3e125a[_0x919d('0x2c')],qs['fields'](_0x406e3b[_0x919d('0x2f')][_0x919d('0x32')]));_0x5f1005[_0x919d('0x31')]=_0x5f1005[_0x919d('0x31')][_0x919d('0x33')]?_0x5f1005[_0x919d('0x31')]:_0x3e125a[_0x919d('0x2c')];if(_0x406e3b[_0x919d('0x2f')][_0x919d('0x43')]){_0x5f1005[_0x919d('0x3d')]=[{'all':!![]}];}_0x5f1005=_[_0x919d('0x3a')]({},_0x5f1005,_0x406e3b[_0x919d('0x3c')]);return db[_0x919d('0x28')]['find'](_0x5f1005)[_0x919d('0x21')](handleEntityNotFound(_0x274f54,null))[_0x919d('0x21')](respondWithResult(_0x274f54,null))[_0x919d('0x3f')](handleError(_0x274f54,null));};exports[_0x919d('0x44')]=function(_0x5e0670,_0x5551c4){return db['ServicenowConfiguration'][_0x919d('0x44')](_0x5e0670[_0x919d('0x45')],{})[_0x919d('0x21')](respondWithResult(_0x5551c4,0xc9))[_0x919d('0x3f')](handleError(_0x5551c4,null));};exports[_0x919d('0x20')]=function(_0x3bb0d4,_0x33942b){if(_0x3bb0d4[_0x919d('0x45')]['id']){delete _0x3bb0d4[_0x919d('0x45')]['id'];}return db[_0x919d('0x28')]['find']({'where':{'id':_0x3bb0d4[_0x919d('0x41')]['id']}})[_0x919d('0x21')](handleEntityNotFound(_0x33942b,null))[_0x919d('0x21')](saveUpdates(_0x3bb0d4[_0x919d('0x45')],null))[_0x919d('0x21')](respondWithResult(_0x33942b,null))[_0x919d('0x3f')](handleError(_0x33942b,null));};exports[_0x919d('0x22')]=function(_0x44a203,_0x3a1521){return db['ServicenowConfiguration']['find']({'where':{'id':_0x44a203[_0x919d('0x41')]['id']}})[_0x919d('0x21')](handleEntityNotFound(_0x3a1521,null))['then'](removeEntity(_0x3a1521,null))['catch'](handleError(_0x3a1521,null));};exports[_0x919d('0x46')]=function(_0x2f777c,_0x658fd3,_0x197a34){var _0x54af76={};var _0x4093e3={};var _0x3efd58;var _0x1510b7;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2f777c[_0x919d('0x41')]['id']}})[_0x919d('0x21')](handleEntityNotFound(_0x658fd3,null))[_0x919d('0x21')](function(_0x2d0d76){if(_0x2d0d76){_0x3efd58=_0x2d0d76;_0x4093e3['model']=_[_0x919d('0x2e')](db[_0x919d('0x47')]['rawAttributes']);_0x4093e3[_0x919d('0x2f')]=_[_0x919d('0x2e')](_0x2f777c['query']);_0x4093e3[_0x919d('0x42')]=_[_0x919d('0x30')](_0x4093e3[_0x919d('0x2c')],_0x4093e3[_0x919d('0x2f')]);_0x54af76['attributes']=_[_0x919d('0x30')](_0x4093e3[_0x919d('0x2c')],qs[_0x919d('0x32')](_0x2f777c[_0x919d('0x2f')][_0x919d('0x32')]));_0x54af76[_0x919d('0x31')]=_0x54af76[_0x919d('0x31')][_0x919d('0x33')]?_0x54af76[_0x919d('0x31')]:_0x4093e3[_0x919d('0x2c')];_0x54af76[_0x919d('0x35')]=qs[_0x919d('0x36')](_0x2f777c['query'][_0x919d('0x36')]);_0x54af76['where']=qs[_0x919d('0x42')](_[_0x919d('0x37')](_0x2f777c['query'],_0x4093e3[_0x919d('0x42')]));if(_0x2f777c[_0x919d('0x2f')][_0x919d('0x38')]){_0x54af76[_0x919d('0x39')]=_[_0x919d('0x3a')](_0x54af76[_0x919d('0x39')],{'$or':_['map'](_0x54af76[_0x919d('0x31')],function(_0x38acda){var _0x15fc26={};_0x15fc26[_0x38acda]={'$like':'%'+_0x2f777c[_0x919d('0x2f')]['filter']+'%'};return _0x15fc26;})});}_0x54af76=_[_0x919d('0x3a')]({},_0x54af76,_0x2f777c[_0x919d('0x3c')]);return _0x3efd58[_0x919d('0x46')](_0x54af76);}})[_0x919d('0x21')](function(_0xc56bcb){if(_0xc56bcb){_0x1510b7=_0xc56bcb['length'];if(!_0x2f777c['query'][_0x919d('0x34')](_0x919d('0x48'))){_0x54af76['limit']=qs[_0x919d('0x1c')](_0x2f777c[_0x919d('0x2f')][_0x919d('0x1c')]);_0x54af76['offset']=qs[_0x919d('0x1a')](_0x2f777c[_0x919d('0x2f')][_0x919d('0x1a')]);}return _0x3efd58['getFields'](_0x54af76);}})[_0x919d('0x21')](function(_0xa0135b){if(_0xa0135b){return _0xa0135b?{'count':_0x1510b7,'rows':_0xa0135b}:null;}})[_0x919d('0x21')](respondWithResult(_0x658fd3,null))[_0x919d('0x3f')](handleError(_0x658fd3,null));};exports[_0x919d('0x49')]=function(_0x1032b2,_0x2d5f67,_0xee3214){var _0x4f08a3={};var _0x30eb9d={};var _0x818cf2;var _0x200418;return db[_0x919d('0x28')][_0x919d('0x4a')]({'where':{'id':_0x1032b2[_0x919d('0x41')]['id']}})[_0x919d('0x21')](handleEntityNotFound(_0x2d5f67,null))[_0x919d('0x21')](function(_0x4d4c6e){if(_0x4d4c6e){_0x818cf2=_0x4d4c6e;_0x30eb9d[_0x919d('0x2c')]=_[_0x919d('0x2e')](db[_0x919d('0x47')]['rawAttributes']);_0x30eb9d[_0x919d('0x2f')]=_['keys'](_0x1032b2[_0x919d('0x2f')]);_0x30eb9d['filters']=_[_0x919d('0x30')](_0x30eb9d[_0x919d('0x2c')],_0x30eb9d[_0x919d('0x2f')]);_0x4f08a3[_0x919d('0x31')]=_[_0x919d('0x30')](_0x30eb9d[_0x919d('0x2c')],qs[_0x919d('0x32')](_0x1032b2['query'][_0x919d('0x32')]));_0x4f08a3['attributes']=_0x4f08a3[_0x919d('0x31')][_0x919d('0x33')]?_0x4f08a3['attributes']:_0x30eb9d['model'];_0x4f08a3[_0x919d('0x35')]=qs[_0x919d('0x36')](_0x1032b2[_0x919d('0x2f')]['sort']);_0x4f08a3[_0x919d('0x39')]=qs[_0x919d('0x42')](_[_0x919d('0x37')](_0x1032b2[_0x919d('0x2f')],_0x30eb9d[_0x919d('0x42')]));if(_0x1032b2[_0x919d('0x2f')][_0x919d('0x38')]){_0x4f08a3[_0x919d('0x39')]=_[_0x919d('0x3a')](_0x4f08a3[_0x919d('0x39')],{'$or':_[_0x919d('0x2d')](_0x4f08a3[_0x919d('0x31')],function(_0x379290){var _0x5264fc={};_0x5264fc[_0x379290]={'$like':'%'+_0x1032b2['query'][_0x919d('0x38')]+'%'};return _0x5264fc;})});}_0x4f08a3=_[_0x919d('0x3a')]({},_0x4f08a3,_0x1032b2[_0x919d('0x3c')]);return _0x818cf2[_0x919d('0x49')](_0x4f08a3);}})[_0x919d('0x21')](function(_0x198cb2){if(_0x198cb2){_0x200418=_0x198cb2[_0x919d('0x33')];if(!_0x1032b2[_0x919d('0x2f')][_0x919d('0x34')](_0x919d('0x48'))){_0x4f08a3['limit']=qs[_0x919d('0x1c')](_0x1032b2[_0x919d('0x2f')][_0x919d('0x1c')]);_0x4f08a3[_0x919d('0x1a')]=qs['offset'](_0x1032b2[_0x919d('0x2f')]['offset']);}return _0x818cf2[_0x919d('0x49')](_0x4f08a3);}})[_0x919d('0x21')](function(_0x5b3960){if(_0x5b3960){return _0x5b3960?{'count':_0x200418,'rows':_0x5b3960}:null;}})[_0x919d('0x21')](respondWithResult(_0x2d5f67,null))[_0x919d('0x3f')](handleError(_0x2d5f67,null));};exports[_0x919d('0x4b')]=function(_0x1be812,_0x2be717,_0x1b9d97){var _0xeb7d70={};var _0x3ec7b7={};var _0x5bd0eb;var _0x153e60;return db[_0x919d('0x28')][_0x919d('0x4a')]({'where':{'id':_0x1be812[_0x919d('0x41')]['id']}})[_0x919d('0x21')](handleEntityNotFound(_0x2be717,null))['then'](function(_0x11faae){if(_0x11faae){_0x5bd0eb=_0x11faae;_0x3ec7b7[_0x919d('0x2c')]=_[_0x919d('0x2e')](db['ServicenowField'][_0x919d('0x29')]);_0x3ec7b7[_0x919d('0x2f')]=_[_0x919d('0x2e')](_0x1be812[_0x919d('0x2f')]);_0x3ec7b7[_0x919d('0x42')]=_[_0x919d('0x30')](_0x3ec7b7[_0x919d('0x2c')],_0x3ec7b7[_0x919d('0x2f')]);_0xeb7d70[_0x919d('0x31')]=_['intersection'](_0x3ec7b7['model'],qs[_0x919d('0x32')](_0x1be812['query'][_0x919d('0x32')]));_0xeb7d70[_0x919d('0x31')]=_0xeb7d70['attributes'][_0x919d('0x33')]?_0xeb7d70['attributes']:_0x3ec7b7['model'];_0xeb7d70['order']=qs[_0x919d('0x36')](_0x1be812[_0x919d('0x2f')][_0x919d('0x36')]);_0xeb7d70[_0x919d('0x39')]=qs[_0x919d('0x42')](_[_0x919d('0x37')](_0x1be812['query'],_0x3ec7b7['filters']));if(_0x1be812[_0x919d('0x2f')][_0x919d('0x38')]){_0xeb7d70[_0x919d('0x39')]=_[_0x919d('0x3a')](_0xeb7d70[_0x919d('0x39')],{'$or':_[_0x919d('0x2d')](_0xeb7d70['attributes'],function(_0x589197){var _0x1270cb={};_0x1270cb[_0x589197]={'$like':'%'+_0x1be812[_0x919d('0x2f')]['filter']+'%'};return _0x1270cb;})});}_0xeb7d70=_['merge']({},_0xeb7d70,_0x1be812[_0x919d('0x3c')]);return _0x5bd0eb[_0x919d('0x4b')](_0xeb7d70);}})[_0x919d('0x21')](function(_0x22d3d6){if(_0x22d3d6){_0x153e60=_0x22d3d6[_0x919d('0x33')];if(!_0x1be812[_0x919d('0x2f')][_0x919d('0x34')](_0x919d('0x48'))){_0xeb7d70[_0x919d('0x1c')]=qs[_0x919d('0x1c')](_0x1be812['query']['limit']);_0xeb7d70['offset']=qs[_0x919d('0x1a')](_0x1be812[_0x919d('0x2f')][_0x919d('0x1a')]);}return _0x5bd0eb[_0x919d('0x4b')](_0xeb7d70);}})['then'](function(_0x25f8b2){if(_0x25f8b2){return _0x25f8b2?{'count':_0x153e60,'rows':_0x25f8b2}:null;}})[_0x919d('0x21')](respondWithResult(_0x2be717,null))[_0x919d('0x3f')](handleError(_0x2be717,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index df261c1..eaaae62 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 _0x04fa=['path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','util','../../config/logger','api','moment','bluebird'];(function(_0x118da4,_0x2e192e){var _0x40dfbb=function(_0x43b165){while(--_0x43b165){_0x118da4['push'](_0x118da4['shift']());}};_0x40dfbb(++_0x2e192e);}(_0x04fa,0x119));var _0xa04f=function(_0x368a83,_0x4af7b3){_0x368a83=_0x368a83-0x0;var _0x42e1ca=_0x04fa[_0x368a83];return _0x42e1ca;};'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':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30d3=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','int_servicenow_configurations','../../config/logger'];(function(_0x234afc,_0xd25042){var _0x46b060=function(_0x4e8488){while(--_0x4e8488){_0x234afc['push'](_0x234afc['shift']());}};_0x46b060(++_0xd25042);}(_0x30d3,0x9f));var _0x330d=function(_0x559aa0,_0x103bdb){_0x559aa0=_0x559aa0-0x0;var _0x1b8fd3=_0x30d3[_0x559aa0];return _0x1b8fd3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x330d('0x0'))(_0x330d('0x1'));var moment=require(_0x330d('0x2'));var BPromise=require(_0x330d('0x3'));var rp=require(_0x330d('0x4'));var fs=require('fs');var path=require(_0x330d('0x5'));var rimraf=require(_0x330d('0x6'));var config=require('../../config/environment');var attributes=require(_0x330d('0x7'));module[_0x330d('0x8')]=function(_0xd8503,_0x2a330f){return _0xd8503['define']('ServicenowConfiguration',attributes,{'tableName':_0x330d('0x9'),'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 d5e6773..05ae30e 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 _0xca4a=['error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xca4a,0xa6));var _0xaca4=function(_0x4874b6,_0x274912){_0x4874b6=_0x4874b6-0x0;var _0x44e3c0=_0xca4a[_0x4874b6];return _0x44e3c0;};'use strict';var _=require(_0xaca4('0x0'));var util=require('util');var moment=require(_0xaca4('0x1'));var BPromise=require(_0xaca4('0x2'));var rs=require(_0xaca4('0x3'));var fs=require('fs');var Redis=require(_0xaca4('0x4'));var db=require(_0xaca4('0x5'))['db'];var utils=require(_0xaca4('0x6'));var logger=require(_0xaca4('0x7'))(_0xaca4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaca4('0x9')][_0xaca4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2221,_0x44e9d7,_0x80b070){return new BPromise(function(_0x2c41ef,_0x528b8e){return client['request'](_0x1b2221,_0x80b070)[_0xaca4('0xb')](function(_0x3d9441){logger['info'](_0xaca4('0xc'),_0x44e9d7,_0xaca4('0xd'));logger[_0xaca4('0xe')](_0xaca4('0xf'),_0x44e9d7,_0xaca4('0xd'),JSON[_0xaca4('0x10')](_0x3d9441));if(_0x3d9441['error']){if(_0x3d9441['error'][_0xaca4('0x11')]===0x1f4){logger[_0xaca4('0x12')](_0xaca4('0xc'),_0x44e9d7,_0x3d9441[_0xaca4('0x12')]['message']);return _0x528b8e(_0x3d9441['error'][_0xaca4('0x13')]);}logger['error'](_0xaca4('0xc'),_0x44e9d7,_0x3d9441[_0xaca4('0x12')][_0xaca4('0x13')]);return _0x2c41ef(_0x3d9441['error']['message']);}else{logger[_0xaca4('0x14')](_0xaca4('0xc'),_0x44e9d7,_0xaca4('0xd'));_0x2c41ef(_0x3d9441[_0xaca4('0x15')][_0xaca4('0x13')]);}})[_0xaca4('0x16')](function(_0xc146e8){logger[_0xaca4('0x12')](_0xaca4('0xc'),_0x44e9d7,_0xc146e8);_0x528b8e(_0xc146e8);});});} \ No newline at end of file +var _0xda91=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x369621,_0x36e5e8){var _0x3dd623=function(_0x9cd5a5){while(--_0x9cd5a5){_0x369621['push'](_0x369621['shift']());}};_0x3dd623(++_0x36e5e8);}(_0xda91,0x72));var _0x1da9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xda91[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1da9('0x0'));var util=require('util');var moment=require(_0x1da9('0x1'));var BPromise=require(_0x1da9('0x2'));var rs=require(_0x1da9('0x3'));var fs=require('fs');var Redis=require(_0x1da9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1da9('0x5'))(_0x1da9('0x6'));var config=require(_0x1da9('0x7'));var jayson=require(_0x1da9('0x8'));var client=jayson[_0x1da9('0x9')][_0x1da9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b135f,_0x54a413,_0x5053a9){return new BPromise(function(_0x213939,_0x55342e){return client[_0x1da9('0xb')](_0x1b135f,_0x5053a9)[_0x1da9('0xc')](function(_0x59b66f){logger[_0x1da9('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x54a413,'request\x20sent');logger[_0x1da9('0xe')](_0x1da9('0xf'),_0x54a413,_0x1da9('0x10'),JSON[_0x1da9('0x11')](_0x59b66f));if(_0x59b66f[_0x1da9('0x12')]){if(_0x59b66f[_0x1da9('0x12')]['code']===0x1f4){logger[_0x1da9('0x12')](_0x1da9('0x13'),_0x54a413,_0x59b66f[_0x1da9('0x12')][_0x1da9('0x14')]);return _0x55342e(_0x59b66f[_0x1da9('0x12')][_0x1da9('0x14')]);}logger[_0x1da9('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x54a413,_0x59b66f[_0x1da9('0x12')]['message']);return _0x213939(_0x59b66f['error']['message']);}else{logger['info'](_0x1da9('0x13'),_0x54a413,_0x1da9('0x10'));_0x213939(_0x59b66f[_0x1da9('0x15')][_0x1da9('0x14')]);}})[_0x1da9('0x16')](function(_0x153467){logger['error'](_0x1da9('0x13'),_0x54a413,_0x153467);_0x55342e(_0x153467);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 215451b..2efc790 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 _0x9440=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2552e2,_0x4fb60a){var _0x27922b=function(_0x3ff1cb){while(--_0x3ff1cb){_0x2552e2['push'](_0x2552e2['shift']());}};_0x27922b(++_0x4fb60a);}(_0x9440,0xfc));var _0x0944=function(_0x4c9e47,_0x5cf11a){_0x4c9e47=_0x4c9e47-0x0;var _0x576ff4=_0x9440[_0x4c9e47];return _0x576ff4;};'use strict';var multer=require(_0x0944('0x0'));var util=require(_0x0944('0x1'));var path=require(_0x0944('0x2'));var timeout=require(_0x0944('0x3'));var express=require(_0x0944('0x4'));var router=express[_0x0944('0x5')]();var fs_extra=require(_0x0944('0x6'));var auth=require(_0x0944('0x7'));var interaction=require(_0x0944('0x8'));var config=require(_0x0944('0x9'));var controller=require(_0x0944('0xa'));router['get']('/',auth[_0x0944('0xb')](),controller[_0x0944('0xc')]);router['get'](_0x0944('0xd'),auth['isAuthenticated'](),controller[_0x0944('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0944('0xf')]);router[_0x0944('0x10')](_0x0944('0xd'),auth['isAuthenticated'](),controller[_0x0944('0x11')]);router[_0x0944('0x12')](_0x0944('0xd'),auth[_0x0944('0xb')](),controller[_0x0944('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd74a=['../../components/interaction/service','get','isAuthenticated','show','create','put','/:id','update','destroy','exports','path','express','../../components/auth/service'];(function(_0x4c1ba1,_0x2095d6){var _0x53e374=function(_0x1dae16){while(--_0x1dae16){_0x4c1ba1['push'](_0x4c1ba1['shift']());}};_0x53e374(++_0x2095d6);}(_0xd74a,0xda));var _0xad74=function(_0x19560a,_0x11fd62){_0x19560a=_0x19560a-0x0;var _0x697084=_0xd74a[_0x19560a];return _0x697084;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad74('0x0'));var timeout=require('connect-timeout');var express=require(_0xad74('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xad74('0x2'));var interaction=require(_0xad74('0x3'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0xad74('0x4')]('/',auth[_0xad74('0x5')](),controller['index']);router[_0xad74('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xad74('0x6')]);router['post']('/',auth[_0xad74('0x5')](),controller[_0xad74('0x7')]);router[_0xad74('0x8')](_0xad74('0x9'),auth['isAuthenticated'](),controller[_0xad74('0xa')]);router['delete'](_0xad74('0x9'),auth[_0xad74('0x5')](),controller[_0xad74('0xb')]);module[_0xad74('0xc')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index f6f05ce..d856ab6 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 _0xc90b=['exports','variable','keyValue','picklist','string','STRING','sequelize'];(function(_0xe314d9,_0x45c16d){var _0x459520=function(_0x5b2c97){while(--_0x5b2c97){_0xe314d9['push'](_0xe314d9['shift']());}};_0x459520(++_0x45c16d);}(_0xc90b,0x1db));var _0xbc90=function(_0x4c6351,_0x3be607){_0x4c6351=_0x4c6351-0x0;var _0x401038=_0xc90b[_0x4c6351];return _0x401038;};'use strict';var Sequelize=require(_0xbc90('0x0'));module[_0xbc90('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xbc90('0x2'),'customVariable',_0xbc90('0x3'),_0xbc90('0x4')),'defaultValue':_0xbc90('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbc90('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xbc90('0x5'),_0xbc90('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xbc90('0x6')]},'idField':{'type':Sequelize[_0xbc90('0x6')]},'nameField':{'type':Sequelize[_0xbc90('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac98=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2bbcde,_0x21f1fd){var _0x20b5d9=function(_0x52f73f){while(--_0x52f73f){_0x2bbcde['push'](_0x2bbcde['shift']());}};_0x20b5d9(++_0x21f1fd);}(_0xac98,0xa5));var _0x8ac9=function(_0x11a3dd,_0x1dfddf){_0x11a3dd=_0x11a3dd-0x0;var _0x354cdc=_0xac98[_0x11a3dd];return _0x354cdc;};'use strict';var Sequelize=require(_0x8ac9('0x0'));module[_0x8ac9('0x1')]={'type':{'type':Sequelize[_0x8ac9('0x2')](_0x8ac9('0x3'),_0x8ac9('0x4'),_0x8ac9('0x5'),_0x8ac9('0x6'),'picklist'),'defaultValue':_0x8ac9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8ac9('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x8ac9('0x3'),'variable',_0x8ac9('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8ac9('0x7')]},'nameField':{'type':Sequelize[_0x8ac9('0x7')]},'customField':{'type':Sequelize[_0x8ac9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5e61f32..6b340fe 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 _0xa30b=['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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','map','ServicenowField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','keys','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xa30b,0x8b));var _0xba30=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa30b[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xba30('0x0'));var rimraf=require(_0xba30('0x1'));var zipdir=require(_0xba30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba30('0x3'));var moment=require(_0xba30('0x4'));var BPromise=require(_0xba30('0x5'));var Mustache=require(_0xba30('0x6'));var util=require(_0xba30('0x7'));var path=require(_0xba30('0x8'));var sox=require(_0xba30('0x9'));var csv=require(_0xba30('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba30('0xb'));var _=require(_0xba30('0xc'));var squel=require(_0xba30('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba30('0xe'));var toCsv=require(_0xba30('0xa'));var querystring=require(_0xba30('0xf'));var Papa=require(_0xba30('0x10'));var Redis=require(_0xba30('0x11'));var authService=require(_0xba30('0x12'));var qs=require(_0xba30('0x13'));var as=require(_0xba30('0x14'));var hardwareService=require(_0xba30('0x15'));var logger=require(_0xba30('0x16'))(_0xba30('0x17'));var utils=require('../../config/utils');var config=require(_0xba30('0x18'));var licenseUtil=require(_0xba30('0x19'));var db=require(_0xba30('0x1a'))['db'];function respondWithStatusCode(_0x43d877,_0x4df37c){_0x4df37c=_0x4df37c||0xcc;return function(_0x1e4edf){if(_0x1e4edf){return _0x43d877[_0xba30('0x1b')](_0x4df37c);}return _0x43d877[_0xba30('0x1c')](_0x4df37c)['end']();};}function respondWithResult(_0x1f8973,_0x4b4344){_0x4b4344=_0x4b4344||0xc8;return function(_0xfb292f){if(_0xfb292f){return _0x1f8973[_0xba30('0x1c')](_0x4b4344)[_0xba30('0x1d')](_0xfb292f);}};}function respondWithFilteredResult(_0x55eb87,_0x3c3aaa){return function(_0x3b214b){if(_0x3b214b){var _0x1223e4=typeof _0x3c3aaa[_0xba30('0x1e')]===_0xba30('0x1f')&&typeof _0x3c3aaa[_0xba30('0x20')]==='undefined';var _0x589a93=_0x3b214b[_0xba30('0x21')];var _0xc5dd97=_0x1223e4?0x0:_0x3c3aaa[_0xba30('0x1e')];var _0x187bfe=_0x1223e4?_0x3b214b[_0xba30('0x21')]:_0x3c3aaa[_0xba30('0x1e')]+_0x3c3aaa[_0xba30('0x20')];var _0x1e3fdc;if(_0x187bfe>=_0x589a93){_0x187bfe=_0x589a93;_0x1e3fdc=0xc8;}else{_0x1e3fdc=0xce;}_0x55eb87['status'](_0x1e3fdc);return _0x55eb87[_0xba30('0x22')](_0xba30('0x23'),_0xc5dd97+'-'+_0x187bfe+'/'+_0x589a93)[_0xba30('0x1d')](_0x3b214b);}return null;};}function patchUpdates(_0x22afcd){return function(_0x150d90){try{jsonpatch[_0xba30('0x24')](_0x150d90,_0x22afcd,!![]);}catch(_0x23ec3e){return BPromise[_0xba30('0x25')](_0x23ec3e);}return _0x150d90[_0xba30('0x26')]();};}function saveUpdates(_0x14a540,_0x1d9111){return function(_0x20b3a0){if(_0x20b3a0){return _0x20b3a0['update'](_0x14a540)['then'](function(_0x9c680f){return _0x9c680f;});}return null;};}function removeEntity(_0xc6aa80,_0x442567){return function(_0x4c2ae8){if(_0x4c2ae8){return _0x4c2ae8[_0xba30('0x27')]()[_0xba30('0x28')](function(){_0xc6aa80[_0xba30('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dbb23,_0x217dff){return function(_0x2df7b7){if(!_0x2df7b7){_0x3dbb23[_0xba30('0x1b')](0x194);}return _0x2df7b7;};}function handleError(_0x2afe42,_0x22f278){_0x22f278=_0x22f278||0x1f4;return function(_0x241ac0){logger[_0xba30('0x29')](_0x241ac0[_0xba30('0x2a')]);if(_0x241ac0['name']){delete _0x241ac0[_0xba30('0x2b')];}_0x2afe42[_0xba30('0x1c')](_0x22f278)['send'](_0x241ac0);};}exports['index']=function(_0x2f9b8a,_0x44dafb){var _0x9dcbfa={},_0x910884={},_0x3c2e77={'count':0x0,'rows':[]};var _0x32b67d=_[_0xba30('0x2c')](db[_0xba30('0x2d')][_0xba30('0x2e')],function(_0xa013f2){return{'name':_0xa013f2[_0xba30('0x2f')],'type':_0xa013f2[_0xba30('0x30')][_0xba30('0x31')]};});_0x910884['model']=_[_0xba30('0x2c')](_0x32b67d,'name');_0x910884['query']=_['keys'](_0x2f9b8a[_0xba30('0x32')]);_0x910884[_0xba30('0x33')]=_[_0xba30('0x34')](_0x910884[_0xba30('0x35')],_0x910884[_0xba30('0x32')]);_0x9dcbfa[_0xba30('0x36')]=_['intersection'](_0x910884[_0xba30('0x35')],qs['fields'](_0x2f9b8a[_0xba30('0x32')][_0xba30('0x37')]));_0x9dcbfa[_0xba30('0x36')]=_0x9dcbfa[_0xba30('0x36')][_0xba30('0x38')]?_0x9dcbfa[_0xba30('0x36')]:_0x910884[_0xba30('0x35')];if(!_0x2f9b8a[_0xba30('0x32')]['hasOwnProperty']('nolimit')){_0x9dcbfa[_0xba30('0x20')]=qs[_0xba30('0x20')](_0x2f9b8a[_0xba30('0x32')][_0xba30('0x20')]);_0x9dcbfa[_0xba30('0x1e')]=qs[_0xba30('0x1e')](_0x2f9b8a[_0xba30('0x32')][_0xba30('0x1e')]);}_0x9dcbfa[_0xba30('0x39')]=qs['sort'](_0x2f9b8a[_0xba30('0x32')][_0xba30('0x3a')]);_0x9dcbfa[_0xba30('0x3b')]=qs['filters'](_[_0xba30('0x3c')](_0x2f9b8a[_0xba30('0x32')],_0x910884[_0xba30('0x33')]),_0x32b67d);if(_0x2f9b8a[_0xba30('0x32')][_0xba30('0x3d')]){_0x9dcbfa[_0xba30('0x3b')]=_[_0xba30('0x3e')](_0x9dcbfa['where'],{'$or':_['map'](_0x32b67d,function(_0x514c72){if(_0x514c72[_0xba30('0x30')]!==_0xba30('0x3f')){var _0x49cd11={};_0x49cd11[_0x514c72[_0xba30('0x2b')]]={'$like':'%'+_0x2f9b8a[_0xba30('0x32')]['filter']+'%'};return _0x49cd11;}})});}_0x9dcbfa=_[_0xba30('0x3e')]({},_0x9dcbfa,_0x2f9b8a[_0xba30('0x40')]);var _0x7490b5={'where':_0x9dcbfa[_0xba30('0x3b')]};return db[_0xba30('0x2d')][_0xba30('0x21')](_0x7490b5)[_0xba30('0x28')](function(_0x104db3){_0x3c2e77[_0xba30('0x21')]=_0x104db3;if(_0x2f9b8a[_0xba30('0x32')][_0xba30('0x41')]){_0x9dcbfa[_0xba30('0x42')]=[{'all':!![]}];}return db[_0xba30('0x2d')][_0xba30('0x43')](_0x9dcbfa);})[_0xba30('0x28')](function(_0x5d42d9){_0x3c2e77['rows']=_0x5d42d9;return _0x3c2e77;})['then'](respondWithFilteredResult(_0x44dafb,_0x9dcbfa))['catch'](handleError(_0x44dafb,null));};exports['show']=function(_0x4a2a6b,_0x581203){var _0x1cc0fd={'raw':!![],'where':{'id':_0x4a2a6b['params']['id']}},_0x525255={};_0x525255[_0xba30('0x35')]=_[_0xba30('0x44')](db[_0xba30('0x2d')]['rawAttributes']);_0x525255[_0xba30('0x32')]=_['keys'](_0x4a2a6b[_0xba30('0x32')]);_0x525255[_0xba30('0x33')]=_[_0xba30('0x34')](_0x525255[_0xba30('0x35')],_0x525255['query']);_0x1cc0fd[_0xba30('0x36')]=_['intersection'](_0x525255[_0xba30('0x35')],qs['fields'](_0x4a2a6b[_0xba30('0x32')][_0xba30('0x37')]));_0x1cc0fd[_0xba30('0x36')]=_0x1cc0fd['attributes'][_0xba30('0x38')]?_0x1cc0fd[_0xba30('0x36')]:_0x525255['model'];if(_0x4a2a6b[_0xba30('0x32')][_0xba30('0x41')]){_0x1cc0fd[_0xba30('0x42')]=[{'all':!![]}];}_0x1cc0fd=_[_0xba30('0x3e')]({},_0x1cc0fd,_0x4a2a6b[_0xba30('0x40')]);return db[_0xba30('0x2d')][_0xba30('0x45')](_0x1cc0fd)['then'](handleEntityNotFound(_0x581203,null))[_0xba30('0x28')](respondWithResult(_0x581203,null))[_0xba30('0x46')](handleError(_0x581203,null));};exports[_0xba30('0x47')]=function(_0x288869,_0x16f6f3){return db['ServicenowField']['create'](_0x288869[_0xba30('0x48')],{})['then'](respondWithResult(_0x16f6f3,0xc9))[_0xba30('0x46')](handleError(_0x16f6f3,null));};exports[_0xba30('0x49')]=function(_0x4bbd0b,_0x4bef3b){if(_0x4bbd0b[_0xba30('0x48')]['id']){delete _0x4bbd0b[_0xba30('0x48')]['id'];}return db['ServicenowField'][_0xba30('0x45')]({'where':{'id':_0x4bbd0b[_0xba30('0x4a')]['id']}})[_0xba30('0x28')](handleEntityNotFound(_0x4bef3b,null))[_0xba30('0x28')](saveUpdates(_0x4bbd0b[_0xba30('0x48')],null))['then'](respondWithResult(_0x4bef3b,null))[_0xba30('0x46')](handleError(_0x4bef3b,null));};exports[_0xba30('0x27')]=function(_0x5a2b2c,_0x26b998){return db[_0xba30('0x2d')]['find']({'where':{'id':_0x5a2b2c[_0xba30('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26b998,null))['then'](removeEntity(_0x26b998,null))[_0xba30('0x46')](handleError(_0x26b998,null));}; \ No newline at end of file +var _0x0f26=['end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowField','count','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x393e49,_0xc90e0b){var _0x5e9db6=function(_0x304877){while(--_0x304877){_0x393e49['push'](_0x393e49['shift']());}};_0x5e9db6(++_0xc90e0b);}(_0x0f26,0x77));var _0x60f2=function(_0x1f6ace,_0x2e6774){_0x1f6ace=_0x1f6ace-0x0;var _0x53aba4=_0x0f26[_0x1f6ace];return _0x53aba4;};'use strict';var emlformat=require(_0x60f2('0x0'));var rimraf=require(_0x60f2('0x1'));var zipdir=require(_0x60f2('0x2'));var jsonpatch=require(_0x60f2('0x3'));var rp=require('request-promise');var moment=require(_0x60f2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x60f2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x60f2('0x6'));var ejs=require(_0x60f2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60f2('0x8'));var squel=require(_0x60f2('0x9'));var crypto=require(_0x60f2('0xa'));var jsforce=require(_0x60f2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x60f2('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x60f2('0xc'));var authService=require(_0x60f2('0xd'));var qs=require(_0x60f2('0xe'));var as=require(_0x60f2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60f2('0x10'))(_0x60f2('0x11'));var utils=require('../../config/utils');var config=require(_0x60f2('0x12'));var licenseUtil=require(_0x60f2('0x13'));var db=require(_0x60f2('0x14'))['db'];function respondWithStatusCode(_0xca24d3,_0x496337){_0x496337=_0x496337||0xcc;return function(_0x139f9a){if(_0x139f9a){return _0xca24d3[_0x60f2('0x15')](_0x496337);}return _0xca24d3[_0x60f2('0x16')](_0x496337)[_0x60f2('0x17')]();};}function respondWithResult(_0x236207,_0x21d165){_0x21d165=_0x21d165||0xc8;return function(_0x26147a){if(_0x26147a){return _0x236207[_0x60f2('0x16')](_0x21d165)[_0x60f2('0x18')](_0x26147a);}};}function respondWithFilteredResult(_0x2788f0,_0x59bce9){return function(_0x20a3b0){if(_0x20a3b0){var _0x326b89=typeof _0x59bce9[_0x60f2('0x19')]===_0x60f2('0x1a')&&typeof _0x59bce9[_0x60f2('0x1b')]===_0x60f2('0x1a');var _0x5845ce=_0x20a3b0['count'];var _0x5610d8=_0x326b89?0x0:_0x59bce9[_0x60f2('0x19')];var _0xb2c46e=_0x326b89?_0x20a3b0['count']:_0x59bce9[_0x60f2('0x19')]+_0x59bce9[_0x60f2('0x1b')];var _0x3fea5c;if(_0xb2c46e>=_0x5845ce){_0xb2c46e=_0x5845ce;_0x3fea5c=0xc8;}else{_0x3fea5c=0xce;}_0x2788f0[_0x60f2('0x16')](_0x3fea5c);return _0x2788f0[_0x60f2('0x1c')](_0x60f2('0x1d'),_0x5610d8+'-'+_0xb2c46e+'/'+_0x5845ce)['json'](_0x20a3b0);}return null;};}function patchUpdates(_0x8e3a5c){return function(_0x2e7734){try{jsonpatch[_0x60f2('0x1e')](_0x2e7734,_0x8e3a5c,!![]);}catch(_0x34862c){return BPromise[_0x60f2('0x1f')](_0x34862c);}return _0x2e7734[_0x60f2('0x20')]();};}function saveUpdates(_0x243c67,_0x491074){return function(_0x44aab0){if(_0x44aab0){return _0x44aab0[_0x60f2('0x21')](_0x243c67)['then'](function(_0x407f0f){return _0x407f0f;});}return null;};}function removeEntity(_0x57e63f,_0xd21652){return function(_0x1aca1d){if(_0x1aca1d){return _0x1aca1d[_0x60f2('0x22')]()[_0x60f2('0x23')](function(){_0x57e63f[_0x60f2('0x16')](0xcc)[_0x60f2('0x17')]();});}};}function handleEntityNotFound(_0x10d92a,_0x30b187){return function(_0x594a23){if(!_0x594a23){_0x10d92a[_0x60f2('0x15')](0x194);}return _0x594a23;};}function handleError(_0x119011,_0x4cbe60){_0x4cbe60=_0x4cbe60||0x1f4;return function(_0x1bc3c6){logger['error'](_0x1bc3c6[_0x60f2('0x24')]);if(_0x1bc3c6[_0x60f2('0x25')]){delete _0x1bc3c6[_0x60f2('0x25')];}_0x119011[_0x60f2('0x16')](_0x4cbe60)[_0x60f2('0x26')](_0x1bc3c6);};}exports[_0x60f2('0x27')]=function(_0x556b8d,_0x239199){var _0x5811f4={},_0x1a7d27={},_0xf3ebf={'count':0x0,'rows':[]};var _0xd27a27=_[_0x60f2('0x28')](db['ServicenowField'][_0x60f2('0x29')],function(_0x991c30){return{'name':_0x991c30[_0x60f2('0x2a')],'type':_0x991c30[_0x60f2('0x2b')][_0x60f2('0x2c')]};});_0x1a7d27[_0x60f2('0x2d')]=_['map'](_0xd27a27,_0x60f2('0x25'));_0x1a7d27['query']=_[_0x60f2('0x2e')](_0x556b8d[_0x60f2('0x2f')]);_0x1a7d27[_0x60f2('0x30')]=_[_0x60f2('0x31')](_0x1a7d27[_0x60f2('0x2d')],_0x1a7d27[_0x60f2('0x2f')]);_0x5811f4[_0x60f2('0x32')]=_[_0x60f2('0x31')](_0x1a7d27[_0x60f2('0x2d')],qs[_0x60f2('0x33')](_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x33')]));_0x5811f4[_0x60f2('0x32')]=_0x5811f4['attributes']['length']?_0x5811f4[_0x60f2('0x32')]:_0x1a7d27[_0x60f2('0x2d')];if(!_0x556b8d[_0x60f2('0x2f')]['hasOwnProperty'](_0x60f2('0x34'))){_0x5811f4['limit']=qs[_0x60f2('0x1b')](_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x1b')]);_0x5811f4[_0x60f2('0x19')]=qs[_0x60f2('0x19')](_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x19')]);}_0x5811f4[_0x60f2('0x35')]=qs['sort'](_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x36')]);_0x5811f4[_0x60f2('0x37')]=qs['filters'](_[_0x60f2('0x38')](_0x556b8d[_0x60f2('0x2f')],_0x1a7d27[_0x60f2('0x30')]),_0xd27a27);if(_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x39')]){_0x5811f4['where']=_['merge'](_0x5811f4[_0x60f2('0x37')],{'$or':_[_0x60f2('0x28')](_0xd27a27,function(_0x3e2957){if(_0x3e2957['type']!==_0x60f2('0x3a')){var _0x660617={};_0x660617[_0x3e2957[_0x60f2('0x25')]]={'$like':'%'+_0x556b8d['query'][_0x60f2('0x39')]+'%'};return _0x660617;}})});}_0x5811f4=_[_0x60f2('0x3b')]({},_0x5811f4,_0x556b8d[_0x60f2('0x3c')]);var _0x53c4c2={'where':_0x5811f4[_0x60f2('0x37')]};return db[_0x60f2('0x3d')][_0x60f2('0x3e')](_0x53c4c2)['then'](function(_0x12a51d){_0xf3ebf[_0x60f2('0x3e')]=_0x12a51d;if(_0x556b8d[_0x60f2('0x2f')][_0x60f2('0x3f')]){_0x5811f4[_0x60f2('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0x60f2('0x41')](_0x5811f4);})[_0x60f2('0x23')](function(_0xa90983){_0xf3ebf['rows']=_0xa90983;return _0xf3ebf;})['then'](respondWithFilteredResult(_0x239199,_0x5811f4))[_0x60f2('0x42')](handleError(_0x239199,null));};exports['show']=function(_0x5caf44,_0x3e5c69){var _0x53c650={'raw':!![],'where':{'id':_0x5caf44[_0x60f2('0x43')]['id']}},_0x1d272b={};_0x1d272b[_0x60f2('0x2d')]=_[_0x60f2('0x2e')](db[_0x60f2('0x3d')][_0x60f2('0x29')]);_0x1d272b[_0x60f2('0x2f')]=_[_0x60f2('0x2e')](_0x5caf44[_0x60f2('0x2f')]);_0x1d272b[_0x60f2('0x30')]=_[_0x60f2('0x31')](_0x1d272b['model'],_0x1d272b[_0x60f2('0x2f')]);_0x53c650[_0x60f2('0x32')]=_[_0x60f2('0x31')](_0x1d272b[_0x60f2('0x2d')],qs[_0x60f2('0x33')](_0x5caf44['query'][_0x60f2('0x33')]));_0x53c650[_0x60f2('0x32')]=_0x53c650[_0x60f2('0x32')]['length']?_0x53c650[_0x60f2('0x32')]:_0x1d272b[_0x60f2('0x2d')];if(_0x5caf44[_0x60f2('0x2f')][_0x60f2('0x3f')]){_0x53c650[_0x60f2('0x40')]=[{'all':!![]}];}_0x53c650=_['merge']({},_0x53c650,_0x5caf44[_0x60f2('0x3c')]);return db[_0x60f2('0x3d')][_0x60f2('0x44')](_0x53c650)['then'](handleEntityNotFound(_0x3e5c69,null))[_0x60f2('0x23')](respondWithResult(_0x3e5c69,null))[_0x60f2('0x42')](handleError(_0x3e5c69,null));};exports['create']=function(_0x33cf4c,_0x2520c7){return db[_0x60f2('0x3d')][_0x60f2('0x45')](_0x33cf4c['body'],{})[_0x60f2('0x23')](respondWithResult(_0x2520c7,0xc9))['catch'](handleError(_0x2520c7,null));};exports[_0x60f2('0x21')]=function(_0x42b8d5,_0x2362a2){if(_0x42b8d5[_0x60f2('0x46')]['id']){delete _0x42b8d5[_0x60f2('0x46')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x42b8d5['params']['id']}})['then'](handleEntityNotFound(_0x2362a2,null))[_0x60f2('0x23')](saveUpdates(_0x42b8d5[_0x60f2('0x46')],null))[_0x60f2('0x23')](respondWithResult(_0x2362a2,null))['catch'](handleError(_0x2362a2,null));};exports[_0x60f2('0x22')]=function(_0x521ade,_0x2d99db){return db[_0x60f2('0x3d')][_0x60f2('0x44')]({'where':{'id':_0x521ade[_0x60f2('0x43')]['id']}})[_0x60f2('0x23')](handleEntityNotFound(_0x2d99db,null))[_0x60f2('0x23')](removeEntity(_0x2d99db,null))[_0x60f2('0x42')](handleError(_0x2d99db,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index df67d39..3a64e9c 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 _0x54cc=['lodash','util','api','moment','request-promise','rimraf','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','FieldId'];(function(_0x519c66,_0x16d2e0){var _0x22e590=function(_0x5a5129){while(--_0x5a5129){_0x519c66['push'](_0x519c66['shift']());}};_0x22e590(++_0x16d2e0);}(_0x54cc,0x1ef));var _0xc54c=function(_0x5d987b,_0x3b4551){_0x5d987b=_0x5d987b-0x0;var _0x4c6b27=_0x54cc[_0x5d987b];return _0x4c6b27;};'use strict';var _=require(_0xc54c('0x0'));var util=require(_0xc54c('0x1'));var logger=require('../../config/logger')(_0xc54c('0x2'));var moment=require(_0xc54c('0x3'));var BPromise=require('bluebird');var rp=require(_0xc54c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc54c('0x5'));var config=require('../../config/environment');var attributes=require(_0xc54c('0x6'));module[_0xc54c('0x7')]=function(_0x1bf4ef,_0x1e795d){return _0x1bf4ef['define'](_0xc54c('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc54c('0x9'),'fields':['idField',_0xc54c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5e31=['servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x496c2e,_0x93c691){var _0x497757=function(_0x1ba821){while(--_0x1ba821){_0x496c2e['push'](_0x496c2e['shift']());}};_0x497757(++_0x93c691);}(_0x5e31,0x11f));var _0x15e3=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x5e31[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x15e3('0x0'));var util=require(_0x15e3('0x1'));var logger=require(_0x15e3('0x2'))(_0x15e3('0x3'));var moment=require(_0x15e3('0x4'));var BPromise=require(_0x15e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15e3('0x6'));var rimraf=require(_0x15e3('0x7'));var config=require(_0x15e3('0x8'));var attributes=require(_0x15e3('0x9'));module[_0x15e3('0xa')]=function(_0x2134ff,_0x59354b){return _0x2134ff[_0x15e3('0xb')](_0x15e3('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x15e3('0xd'),'fields':[_0x15e3('0xe'),'FieldId'],'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 33eed81..4c6984b 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 _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x32dd4e,_0x7ad286){var _0x41d88f=function(_0x22d028){while(--_0x22d028){_0x32dd4e['push'](_0x32dd4e['shift']());}};_0x41d88f(++_0x7ad286);}(_0x70e0,0x17b));var _0x070e=function(_0x441334,_0x439dd5){_0x441334=_0x441334-0x0;var _0x2e3101=_0x70e0[_0x441334];return _0x2e3101;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc47f8b,_0x315124){var _0x307935=function(_0x538c30){while(--_0x538c30){_0xc47f8b['push'](_0xc47f8b['shift']());}};_0x307935(++_0x315124);}(_0x70e0,0x17b));var _0x070e=function(_0x2da038,_0x3bddb5){_0x2da038=_0x2da038-0x0;var _0x5dc2c4=_0x70e0[_0x2da038];return _0x5dc2c4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ce4f1dc..833261e 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x554f27,_0x527070){var _0x5e8a7f=function(_0x1b6ca1){while(--_0x1b6ca1){_0x554f27['push'](_0x554f27['shift']());}};_0x5e8a7f(++_0x527070);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x5377b2,_0x169239){var _0x2e404a=function(_0x1a9547){while(--_0x1a9547){_0x5377b2['push'](_0x5377b2['shift']());}};_0x2e404a(++_0x169239);}(_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('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 ab69363..525df27 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(_0x192fd3,_0x4d6933){var _0x395fb0=function(_0x356622){while(--_0x356622){_0x192fd3['push'](_0x192fd3['shift']());}};_0x395fb0(++_0x4d6933);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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(_0x17fcf1,_0x29b60c){var _0x2c0681=function(_0x5d9d9a){while(--_0x5d9d9a){_0x17fcf1['push'](_0x17fcf1['shift']());}};_0x2c0681(++_0x29b60c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 1384b97..e4fc0cd 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 _0x498a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','options','count','includeAll','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','order','merge','length','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','Calls','values','module_fields','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x415346,_0x440efe){var _0x28661c=function(_0x22f09e){while(--_0x22f09e){_0x415346['push'](_0x415346['shift']());}};_0x28661c(++_0x440efe);}(_0x498a,0x1bc));var _0xa498=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x498a[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xa498('0x0'));var rimraf=require(_0xa498('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa498('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa498('0x3'));var Mustache=require(_0xa498('0x4'));var util=require(_0xa498('0x5'));var path=require(_0xa498('0x6'));var sox=require('sox');var csv=require(_0xa498('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa498('0x8'));var _=require(_0xa498('0x9'));var squel=require('squel');var crypto=require(_0xa498('0xa'));var jsforce=require(_0xa498('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa498('0x7'));var querystring=require(_0xa498('0xc'));var Papa=require(_0xa498('0xd'));var Redis=require(_0xa498('0xe'));var authService=require(_0xa498('0xf'));var qs=require(_0xa498('0x10'));var as=require(_0xa498('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa498('0x12'))(_0xa498('0x13'));var utils=require(_0xa498('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa498('0x15'));var db=require(_0xa498('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c542f,_0x4dc536){_0x4dc536=_0x4dc536||0xcc;return function(_0x4840ed){if(_0x4840ed){return _0x2c542f[_0xa498('0x17')](_0x4dc536);}return _0x2c542f[_0xa498('0x18')](_0x4dc536)['end']();};}function respondWithResult(_0x25f378,_0x53210a){_0x53210a=_0x53210a||0xc8;return function(_0x295a37){if(_0x295a37){return _0x25f378[_0xa498('0x18')](_0x53210a)[_0xa498('0x19')](_0x295a37);}};}function respondWithFilteredResult(_0x535a56,_0x2b6309){return function(_0x25e070){if(_0x25e070){var _0x1c7779=typeof _0x2b6309[_0xa498('0x1a')]===_0xa498('0x1b')&&typeof _0x2b6309['limit']===_0xa498('0x1b');var _0xd94602=_0x25e070['count'];var _0x319f54=_0x1c7779?0x0:_0x2b6309[_0xa498('0x1a')];var _0x4146c9=_0x1c7779?_0x25e070['count']:_0x2b6309[_0xa498('0x1a')]+_0x2b6309[_0xa498('0x1c')];var _0x44ab94;if(_0x4146c9>=_0xd94602){_0x4146c9=_0xd94602;_0x44ab94=0xc8;}else{_0x44ab94=0xce;}_0x535a56[_0xa498('0x18')](_0x44ab94);return _0x535a56[_0xa498('0x1d')](_0xa498('0x1e'),_0x319f54+'-'+_0x4146c9+'/'+_0xd94602)[_0xa498('0x19')](_0x25e070);}return null;};}function patchUpdates(_0xdfa223){return function(_0x219e7d){try{jsonpatch[_0xa498('0x1f')](_0x219e7d,_0xdfa223,!![]);}catch(_0x4bb94f){return BPromise['reject'](_0x4bb94f);}return _0x219e7d[_0xa498('0x20')]();};}function saveUpdates(_0x226c6f,_0x5be38c){return function(_0x33ec37){if(_0x33ec37){return _0x33ec37[_0xa498('0x21')](_0x226c6f)[_0xa498('0x22')](function(_0x1a159c){return _0x1a159c;});}return null;};}function removeEntity(_0x135ea4,_0x4b8a6e){return function(_0x3d734e){if(_0x3d734e){return _0x3d734e['destroy']()[_0xa498('0x22')](function(){_0x135ea4[_0xa498('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45bbd0,_0x1b3b41){return function(_0x44629b){if(!_0x44629b){_0x45bbd0[_0xa498('0x17')](0x194);}return _0x44629b;};}function handleError(_0xb5a355,_0x289d1c){_0x289d1c=_0x289d1c||0x1f4;return function(_0x19b027){logger['error'](_0x19b027[_0xa498('0x23')]);if(_0x19b027[_0xa498('0x24')]){delete _0x19b027['name'];}_0xb5a355['status'](_0x289d1c)[_0xa498('0x25')](_0x19b027);};}exports[_0xa498('0x26')]=function(_0x1c2022,_0x1a25c5){var _0x3f00b1={},_0x46ea81={},_0x1b38a0={'count':0x0,'rows':[]};var _0xeee628=_[_0xa498('0x27')](db[_0xa498('0x28')][_0xa498('0x29')],function(_0x2d7172){return{'name':_0x2d7172[_0xa498('0x2a')],'type':_0x2d7172[_0xa498('0x2b')]['key']};});_0x46ea81[_0xa498('0x2c')]=_[_0xa498('0x27')](_0xeee628,_0xa498('0x24'));_0x46ea81['query']=_[_0xa498('0x2d')](_0x1c2022[_0xa498('0x2e')]);_0x46ea81['filters']=_[_0xa498('0x2f')](_0x46ea81[_0xa498('0x2c')],_0x46ea81[_0xa498('0x2e')]);_0x3f00b1['attributes']=_[_0xa498('0x2f')](_0x46ea81['model'],qs[_0xa498('0x30')](_0x1c2022[_0xa498('0x2e')]['fields']));_0x3f00b1[_0xa498('0x31')]=_0x3f00b1[_0xa498('0x31')]['length']?_0x3f00b1[_0xa498('0x31')]:_0x46ea81['model'];if(!_0x1c2022[_0xa498('0x2e')][_0xa498('0x32')]('nolimit')){_0x3f00b1[_0xa498('0x1c')]=qs[_0xa498('0x1c')](_0x1c2022[_0xa498('0x2e')][_0xa498('0x1c')]);_0x3f00b1[_0xa498('0x1a')]=qs['offset'](_0x1c2022[_0xa498('0x2e')][_0xa498('0x1a')]);}_0x3f00b1['order']=qs[_0xa498('0x33')](_0x1c2022[_0xa498('0x2e')][_0xa498('0x33')]);_0x3f00b1['where']=qs[_0xa498('0x34')](_[_0xa498('0x35')](_0x1c2022[_0xa498('0x2e')],_0x46ea81['filters']),_0xeee628);if(_0x1c2022['query'][_0xa498('0x36')]){_0x3f00b1[_0xa498('0x37')]=_['merge'](_0x3f00b1[_0xa498('0x37')],{'$or':_['map'](_0xeee628,function(_0x49c3ee){if(_0x49c3ee[_0xa498('0x2b')]!==_0xa498('0x38')){var _0x24f57a={};_0x24f57a[_0x49c3ee[_0xa498('0x24')]]={'$like':'%'+_0x1c2022[_0xa498('0x2e')][_0xa498('0x36')]+'%'};return _0x24f57a;}})});}_0x3f00b1=_['merge']({},_0x3f00b1,_0x1c2022[_0xa498('0x39')]);var _0x22c7d6={'where':_0x3f00b1[_0xa498('0x37')]};return db['SugarcrmAccount'][_0xa498('0x3a')](_0x22c7d6)[_0xa498('0x22')](function(_0x16917c){_0x1b38a0['count']=_0x16917c;if(_0x1c2022['query'][_0xa498('0x3b')]){_0x3f00b1['include']=[{'all':!![]}];}return db[_0xa498('0x28')]['findAll'](_0x3f00b1);})[_0xa498('0x22')](function(_0x259b25){_0x1b38a0['rows']=_0x259b25;return _0x1b38a0;})['then'](respondWithFilteredResult(_0x1a25c5,_0x3f00b1))[_0xa498('0x3c')](handleError(_0x1a25c5,null));};exports[_0xa498('0x3d')]=function(_0x108117,_0x155f40){var _0x489cfb={'raw':![],'where':{'id':_0x108117[_0xa498('0x3e')]['id']}},_0x17bde4={};_0x17bde4[_0xa498('0x2c')]=_[_0xa498('0x2d')](db[_0xa498('0x28')]['rawAttributes']);_0x17bde4['query']=_[_0xa498('0x2d')](_0x108117[_0xa498('0x2e')]);_0x17bde4['filters']=_[_0xa498('0x2f')](_0x17bde4[_0xa498('0x2c')],_0x17bde4[_0xa498('0x2e')]);_0x489cfb[_0xa498('0x31')]=_[_0xa498('0x2f')](_0x17bde4[_0xa498('0x2c')],qs[_0xa498('0x30')](_0x108117[_0xa498('0x2e')][_0xa498('0x30')]));_0x489cfb[_0xa498('0x31')]=_0x489cfb[_0xa498('0x31')]['length']?_0x489cfb['attributes']:_0x17bde4[_0xa498('0x2c')];if(_0x108117['query'][_0xa498('0x3b')]){_0x489cfb[_0xa498('0x3f')]=[{'all':!![]}];}_0x489cfb=_['merge']({},_0x489cfb,_0x108117[_0xa498('0x39')]);return db[_0xa498('0x28')][_0xa498('0x40')](_0x489cfb)[_0xa498('0x22')](handleEntityNotFound(_0x155f40,null))[_0xa498('0x22')](respondWithResult(_0x155f40,null))[_0xa498('0x3c')](handleError(_0x155f40,null));};exports['create']=function(_0x23301e,_0x1deefb){return db['SugarcrmAccount'][_0xa498('0x41')](_0x23301e['body'],{})[_0xa498('0x22')](respondWithResult(_0x1deefb,0xc9))[_0xa498('0x3c')](handleError(_0x1deefb,null));};exports[_0xa498('0x21')]=function(_0x14f7a6,_0x4ea53e){if(_0x14f7a6['body']['id']){delete _0x14f7a6[_0xa498('0x42')]['id'];}return db[_0xa498('0x28')][_0xa498('0x40')]({'where':{'id':_0x14f7a6['params']['id']}})[_0xa498('0x22')](handleEntityNotFound(_0x4ea53e,null))['then'](saveUpdates(_0x14f7a6[_0xa498('0x42')],null))['then'](respondWithResult(_0x4ea53e,null))['catch'](handleError(_0x4ea53e,null));};exports[_0xa498('0x43')]=function(_0x567a99,_0x87dbe9){return db[_0xa498('0x28')][_0xa498('0x40')]({'where':{'id':_0x567a99[_0xa498('0x3e')]['id']}})[_0xa498('0x22')](handleEntityNotFound(_0x87dbe9,null))[_0xa498('0x22')](removeEntity(_0x87dbe9,null))['catch'](handleError(_0x87dbe9,null));};exports[_0xa498('0x44')]=function(_0x9195e6,_0x56e826,_0x315e35){var _0x55c606={};var _0x973325={};var _0x513ea5;var _0x192135;return db[_0xa498('0x28')][_0xa498('0x45')]({'where':{'id':_0x9195e6['params']['id']}})[_0xa498('0x22')](handleEntityNotFound(_0x56e826,null))[_0xa498('0x22')](function(_0x5b3959){if(_0x5b3959){_0x513ea5=_0x5b3959;_0x973325['model']=_['keys'](db[_0xa498('0x46')][_0xa498('0x29')]);_0x973325['query']=_['keys'](_0x9195e6[_0xa498('0x2e')]);_0x973325[_0xa498('0x34')]=_[_0xa498('0x2f')](_0x973325['model'],_0x973325['query']);_0x55c606['attributes']=_[_0xa498('0x2f')](_0x973325[_0xa498('0x2c')],qs[_0xa498('0x30')](_0x9195e6['query']['fields']));_0x55c606[_0xa498('0x31')]=_0x55c606['attributes']['length']?_0x55c606[_0xa498('0x31')]:_0x973325['model'];_0x55c606[_0xa498('0x47')]=qs[_0xa498('0x33')](_0x9195e6[_0xa498('0x2e')][_0xa498('0x33')]);_0x55c606[_0xa498('0x37')]=qs[_0xa498('0x34')](_[_0xa498('0x35')](_0x9195e6[_0xa498('0x2e')],_0x973325[_0xa498('0x34')]));if(_0x9195e6[_0xa498('0x2e')]['filter']){_0x55c606['where']=_['merge'](_0x55c606[_0xa498('0x37')],{'$or':_[_0xa498('0x27')](_0x55c606['attributes'],function(_0x51d934){var _0x524232={};_0x524232[_0x51d934]={'$like':'%'+_0x9195e6[_0xa498('0x2e')][_0xa498('0x36')]+'%'};return _0x524232;})});}_0x55c606=_[_0xa498('0x48')]({},_0x55c606,_0x9195e6[_0xa498('0x39')]);return _0x513ea5['getConfigurations'](_0x55c606);}})[_0xa498('0x22')](function(_0x2f2690){if(_0x2f2690){_0x192135=_0x2f2690[_0xa498('0x49')];if(!_0x9195e6[_0xa498('0x2e')]['hasOwnProperty']('nolimit')){_0x55c606[_0xa498('0x1c')]=qs['limit'](_0x9195e6['query'][_0xa498('0x1c')]);_0x55c606[_0xa498('0x1a')]=qs['offset'](_0x9195e6[_0xa498('0x2e')]['offset']);}return _0x513ea5[_0xa498('0x44')](_0x55c606);}})['then'](function(_0x45ec18){if(_0x45ec18){return _0x45ec18?{'count':_0x192135,'rows':_0x45ec18}:null;}})['then'](respondWithResult(_0x56e826,null))[_0xa498('0x3c')](handleError(_0x56e826,null));};exports[_0xa498('0x4a')]=function(_0xd2d646,_0x58b810,_0x24648c){if(_0xd2d646[_0xa498('0x42')]['id']){delete _0xd2d646[_0xa498('0x42')]['id'];}return db[_0xa498('0x28')][_0xa498('0x45')]({'where':{'id':_0xd2d646[_0xa498('0x3e')]['id']}})[_0xa498('0x22')](handleEntityNotFound(_0x58b810,null))[_0xa498('0x22')](function(_0x410d5c){if(_0x410d5c){_0xd2d646[_0xa498('0x42')][_0xa498('0x4b')]=_0x410d5c['id'];_0xd2d646[_0xa498('0x42')][_0xa498('0x4c')]=integrations[_0xa498('0x4d')](_0xd2d646[_0xa498('0x42')][_0xa498('0x4e')],_0xd2d646[_0xa498('0x42')][_0xa498('0x2b')]);_0xd2d646[_0xa498('0x42')]['Descriptions']=integrations['getDescriptions'](_0xd2d646[_0xa498('0x42')][_0xa498('0x4e')],_0xd2d646[_0xa498('0x42')][_0xa498('0x2b')]);return db['SugarcrmConfiguration'][_0xa498('0x41')](_0xd2d646[_0xa498('0x42')],{'include':[{'model':db[_0xa498('0x4f')],'as':_0xa498('0x4c')},{'model':db[_0xa498('0x4f')],'as':_0xa498('0x50')}]});}return null;})[_0xa498('0x22')](respondWithResult(_0x58b810,null))[_0xa498('0x3c')](handleError(_0x58b810,null));};exports[_0xa498('0x51')]=function(_0x54cc26,_0x3630c8,_0x4b4f79){var _0x51b5f7='';var _0x5d72d7=['id','name',_0xa498('0x52'),_0xa498('0x53'),_0xa498('0x54'),_0xa498('0x55'),_0xa498('0x56'),'duration_minutes',_0xa498('0x57'),'parent_type',_0xa498('0x58'),_0xa498('0x59')];return db[_0xa498('0x28')][_0xa498('0x45')]({'where':{'id':_0x54cc26['params']['id']},'attributes':['id',_0xa498('0x5a'),_0xa498('0x5b'),_0xa498('0x5c')]})[_0xa498('0x22')](handleEntityNotFound(_0x3630c8,null))[_0xa498('0x22')](function(_0x3768ef){if(_0x3768ef){_0x51b5f7=_0x3768ef['remoteUri'];var _0x46e2fd=_0x51b5f7[_0xa498('0x5d')](-0x1);if(_0x46e2fd==='/'){_0x51b5f7=_0x51b5f7[_0xa498('0x5e')](0x0,_0x51b5f7['lastIndexOf'](_0x46e2fd));}return rp({'method':_0xa498('0x5f'),'uri':util['format'](_0xa498('0x60'),_0x51b5f7,_0xa498('0x61')),'json':!![],'form':{'method':_0xa498('0x62'),'input_type':_0xa498('0x63'),'response_type':'JSON','rest_data':JSON[_0xa498('0x64')]({'user_auth':{'user_name':_0x3768ef[_0xa498('0x5a')],'password':_0x3768ef[_0xa498('0x5b')],'encryption':_0xa498('0x65')},'application':_0xa498('0x66')})}});}})[_0xa498('0x22')](function(_0x1f16ed){if(_0x1f16ed&&_0x1f16ed[_0xa498('0x24')]!==_0xa498('0x67')&&_0x1f16ed[_0xa498('0x24')]!==_0xa498('0x68')){return rp({'method':_0xa498('0x5f'),'uri':util[_0xa498('0x69')](_0xa498('0x60'),_0x51b5f7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xa498('0x63'),'response_type':_0xa498('0x63'),'rest_data':JSON[_0xa498('0x64')]({'session':_0x1f16ed['id'],'module_name':_0xa498('0x6a')})}})[_0xa498('0x22')](function(_0x4de991){if(_0x4de991){var _0x3d9d82=_[_0xa498('0x6b')](_0x4de991[_0xa498('0x6c')]);_['remove'](_0x3d9d82,function(_0x4a3cf1){return _0x5d72d7['includes'](_0x4a3cf1['name']);});return{'count':_0x3d9d82[_0xa498('0x49')],'rows':_[_0xa498('0x27')](_0x3d9d82,function(_0x29201c){return{'id':_0x29201c[_0xa498('0x24')],'name':_0x29201c['label'],'custom':_[_0xa498('0x6d')](_0x29201c[_0xa498('0x24')],'_c')?!![]:![],'options':_0x29201c['options']?_[_0xa498('0x27')](_[_0xa498('0x6b')](_0x29201c[_0xa498('0x39')]),function(_0x283658){return{'name':_0x283658[_0xa498('0x6e')],'value':_0x283658[_0xa498('0x24')]};}):[]};})};}})['then'](respondWithResult(_0x3630c8,null))[_0xa498('0x3c')](function(_0x262313){var _0x38a903=_0x54cc26[_0xa498('0x2e')]['test']?0x1f4:_0x262313[_0xa498('0x6f')]||0x1f4;logger[_0xa498('0x70')](_0xa498('0x71'),_0xa498('0x51'),_0x38a903,JSON[_0xa498('0x64')](_0x262313));delete _0x262313[_0xa498('0x24')];if(_0x38a903===0x191){_0x38a903=0x190;}_0x3630c8['status'](_0x38a903)[_0xa498('0x25')](_0x54cc26[_0xa498('0x2e')]['test']?{'message':_0xa498('0x72'),'statusCode':_0x262313[_0xa498('0x6f')]}:_0x262313);});}else{var _0x36880d=0x1f4;_0x3630c8[_0xa498('0x18')](_0x36880d)[_0xa498('0x25')]({'message':_0xa498('0x72'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xbfea=['include','catch','create','body','find','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','%s%s','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SugarcrmAccount','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','show','params','rawAttributes','length','includeAll'];(function(_0xd59cb1,_0x4ccb19){var _0x2b26c4=function(_0x2d4acf){while(--_0x2d4acf){_0xd59cb1['push'](_0xd59cb1['shift']());}};_0x2b26c4(++_0x4ccb19);}(_0xbfea,0x120));var _0xabfe=function(_0x921776,_0x15a879){_0x921776=_0x921776-0x0;var _0x2d0e5a=_0xbfea[_0x921776];return _0x2d0e5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabfe('0x0'));var zipdir=require(_0xabfe('0x1'));var jsonpatch=require(_0xabfe('0x2'));var rp=require(_0xabfe('0x3'));var moment=require(_0xabfe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabfe('0x5'));var path=require('path');var sox=require(_0xabfe('0x6'));var csv=require(_0xabfe('0x7'));var ejs=require(_0xabfe('0x8'));var fs=require('fs');var fs_extra=require(_0xabfe('0x9'));var _=require(_0xabfe('0xa'));var squel=require(_0xabfe('0xb'));var crypto=require(_0xabfe('0xc'));var jsforce=require(_0xabfe('0xd'));var deskjs=require(_0xabfe('0xe'));var toCsv=require('to-csv');var querystring=require(_0xabfe('0xf'));var Papa=require(_0xabfe('0x10'));var Redis=require(_0xabfe('0x11'));var authService=require(_0xabfe('0x12'));var qs=require(_0xabfe('0x13'));var as=require(_0xabfe('0x14'));var hardwareService=require(_0xabfe('0x15'));var logger=require('../../config/logger')(_0xabfe('0x16'));var utils=require(_0xabfe('0x17'));var config=require(_0xabfe('0x18'));var licenseUtil=require(_0xabfe('0x19'));var db=require(_0xabfe('0x1a'))['db'];var integrations=require(_0xabfe('0x1b'));function respondWithStatusCode(_0x584fbb,_0x55569f){_0x55569f=_0x55569f||0xcc;return function(_0xf0c811){if(_0xf0c811){return _0x584fbb[_0xabfe('0x1c')](_0x55569f);}return _0x584fbb['status'](_0x55569f)[_0xabfe('0x1d')]();};}function respondWithResult(_0xb228d7,_0x35c859){_0x35c859=_0x35c859||0xc8;return function(_0x3824e5){if(_0x3824e5){return _0xb228d7[_0xabfe('0x1e')](_0x35c859)[_0xabfe('0x1f')](_0x3824e5);}};}function respondWithFilteredResult(_0x5cc24f,_0x2f740d){return function(_0x47392e){if(_0x47392e){var _0x379451=typeof _0x2f740d[_0xabfe('0x20')]===_0xabfe('0x21')&&typeof _0x2f740d['limit']===_0xabfe('0x21');var _0x86b399=_0x47392e['count'];var _0x150d43=_0x379451?0x0:_0x2f740d[_0xabfe('0x20')];var _0x31d446=_0x379451?_0x47392e[_0xabfe('0x22')]:_0x2f740d[_0xabfe('0x20')]+_0x2f740d[_0xabfe('0x23')];var _0x453fd6;if(_0x31d446>=_0x86b399){_0x31d446=_0x86b399;_0x453fd6=0xc8;}else{_0x453fd6=0xce;}_0x5cc24f[_0xabfe('0x1e')](_0x453fd6);return _0x5cc24f['set'](_0xabfe('0x24'),_0x150d43+'-'+_0x31d446+'/'+_0x86b399)[_0xabfe('0x1f')](_0x47392e);}return null;};}function patchUpdates(_0x512596){return function(_0x3300b2){try{jsonpatch[_0xabfe('0x25')](_0x3300b2,_0x512596,!![]);}catch(_0x5408a1){return BPromise[_0xabfe('0x26')](_0x5408a1);}return _0x3300b2[_0xabfe('0x27')]();};}function saveUpdates(_0x481c74,_0x4c3a6d){return function(_0x186c07){if(_0x186c07){return _0x186c07[_0xabfe('0x28')](_0x481c74)[_0xabfe('0x29')](function(_0x1691ad){return _0x1691ad;});}return null;};}function removeEntity(_0x4cba9b,_0x3c5c66){return function(_0x57e50e){if(_0x57e50e){return _0x57e50e[_0xabfe('0x2a')]()[_0xabfe('0x29')](function(){_0x4cba9b[_0xabfe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3208f2,_0x49c4f4){return function(_0x509c99){if(!_0x509c99){_0x3208f2[_0xabfe('0x1c')](0x194);}return _0x509c99;};}function handleError(_0x24e714,_0x31aac6){_0x31aac6=_0x31aac6||0x1f4;return function(_0x2650a4){logger['error'](_0x2650a4[_0xabfe('0x2b')]);if(_0x2650a4[_0xabfe('0x2c')]){delete _0x2650a4[_0xabfe('0x2c')];}_0x24e714[_0xabfe('0x1e')](_0x31aac6)[_0xabfe('0x2d')](_0x2650a4);};}exports['index']=function(_0x57f6a1,_0x454cbe){var _0x401c45={},_0x4a3243={},_0x53a366={'count':0x0,'rows':[]};var _0x3d9c94=_[_0xabfe('0x2e')](db[_0xabfe('0x2f')]['rawAttributes'],function(_0x379c6c){return{'name':_0x379c6c[_0xabfe('0x30')],'type':_0x379c6c['type'][_0xabfe('0x31')]};});_0x4a3243[_0xabfe('0x32')]=_[_0xabfe('0x2e')](_0x3d9c94,'name');_0x4a3243[_0xabfe('0x33')]=_[_0xabfe('0x34')](_0x57f6a1[_0xabfe('0x33')]);_0x4a3243[_0xabfe('0x35')]=_[_0xabfe('0x36')](_0x4a3243[_0xabfe('0x32')],_0x4a3243[_0xabfe('0x33')]);_0x401c45['attributes']=_['intersection'](_0x4a3243[_0xabfe('0x32')],qs[_0xabfe('0x37')](_0x57f6a1['query'][_0xabfe('0x37')]));_0x401c45[_0xabfe('0x38')]=_0x401c45[_0xabfe('0x38')]['length']?_0x401c45['attributes']:_0x4a3243[_0xabfe('0x32')];if(!_0x57f6a1[_0xabfe('0x33')][_0xabfe('0x39')]('nolimit')){_0x401c45[_0xabfe('0x23')]=qs[_0xabfe('0x23')](_0x57f6a1[_0xabfe('0x33')][_0xabfe('0x23')]);_0x401c45['offset']=qs['offset'](_0x57f6a1[_0xabfe('0x33')][_0xabfe('0x20')]);}_0x401c45['order']=qs['sort'](_0x57f6a1['query']['sort']);_0x401c45[_0xabfe('0x3a')]=qs[_0xabfe('0x35')](_[_0xabfe('0x3b')](_0x57f6a1[_0xabfe('0x33')],_0x4a3243[_0xabfe('0x35')]),_0x3d9c94);if(_0x57f6a1[_0xabfe('0x33')][_0xabfe('0x3c')]){_0x401c45[_0xabfe('0x3a')]=_['merge'](_0x401c45['where'],{'$or':_[_0xabfe('0x2e')](_0x3d9c94,function(_0x183dba){if(_0x183dba[_0xabfe('0x3d')]!==_0xabfe('0x3e')){var _0x1e19ad={};_0x1e19ad[_0x183dba['name']]={'$like':'%'+_0x57f6a1['query']['filter']+'%'};return _0x1e19ad;}})});}_0x401c45=_[_0xabfe('0x3f')]({},_0x401c45,_0x57f6a1[_0xabfe('0x40')]);var _0x3851fa={'where':_0x401c45[_0xabfe('0x3a')]};return db['SugarcrmAccount'][_0xabfe('0x22')](_0x3851fa)['then'](function(_0x3d5a3f){_0x53a366['count']=_0x3d5a3f;if(_0x57f6a1[_0xabfe('0x33')]['includeAll']){_0x401c45['include']=[{'all':!![]}];}return db[_0xabfe('0x2f')][_0xabfe('0x41')](_0x401c45);})[_0xabfe('0x29')](function(_0x5ed2b9){_0x53a366[_0xabfe('0x42')]=_0x5ed2b9;return _0x53a366;})[_0xabfe('0x29')](respondWithFilteredResult(_0x454cbe,_0x401c45))['catch'](handleError(_0x454cbe,null));};exports[_0xabfe('0x43')]=function(_0x5368e4,_0x2c65a1){var _0x363845={'raw':![],'where':{'id':_0x5368e4[_0xabfe('0x44')]['id']}},_0x5e39b2={};_0x5e39b2[_0xabfe('0x32')]=_['keys'](db[_0xabfe('0x2f')][_0xabfe('0x45')]);_0x5e39b2[_0xabfe('0x33')]=_[_0xabfe('0x34')](_0x5368e4[_0xabfe('0x33')]);_0x5e39b2[_0xabfe('0x35')]=_[_0xabfe('0x36')](_0x5e39b2['model'],_0x5e39b2[_0xabfe('0x33')]);_0x363845[_0xabfe('0x38')]=_[_0xabfe('0x36')](_0x5e39b2[_0xabfe('0x32')],qs[_0xabfe('0x37')](_0x5368e4[_0xabfe('0x33')][_0xabfe('0x37')]));_0x363845[_0xabfe('0x38')]=_0x363845[_0xabfe('0x38')][_0xabfe('0x46')]?_0x363845[_0xabfe('0x38')]:_0x5e39b2[_0xabfe('0x32')];if(_0x5368e4[_0xabfe('0x33')][_0xabfe('0x47')]){_0x363845[_0xabfe('0x48')]=[{'all':!![]}];}_0x363845=_['merge']({},_0x363845,_0x5368e4[_0xabfe('0x40')]);return db[_0xabfe('0x2f')]['find'](_0x363845)[_0xabfe('0x29')](handleEntityNotFound(_0x2c65a1,null))['then'](respondWithResult(_0x2c65a1,null))[_0xabfe('0x49')](handleError(_0x2c65a1,null));};exports[_0xabfe('0x4a')]=function(_0x3b2a04,_0x207f39){return db[_0xabfe('0x2f')][_0xabfe('0x4a')](_0x3b2a04[_0xabfe('0x4b')],{})[_0xabfe('0x29')](respondWithResult(_0x207f39,0xc9))[_0xabfe('0x49')](handleError(_0x207f39,null));};exports['update']=function(_0x5d7da7,_0x537737){if(_0x5d7da7[_0xabfe('0x4b')]['id']){delete _0x5d7da7['body']['id'];}return db[_0xabfe('0x2f')][_0xabfe('0x4c')]({'where':{'id':_0x5d7da7[_0xabfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x537737,null))['then'](saveUpdates(_0x5d7da7[_0xabfe('0x4b')],null))['then'](respondWithResult(_0x537737,null))[_0xabfe('0x49')](handleError(_0x537737,null));};exports['destroy']=function(_0x28ee4f,_0x2fb2f0){return db[_0xabfe('0x2f')][_0xabfe('0x4c')]({'where':{'id':_0x28ee4f[_0xabfe('0x44')]['id']}})[_0xabfe('0x29')](handleEntityNotFound(_0x2fb2f0,null))[_0xabfe('0x29')](removeEntity(_0x2fb2f0,null))[_0xabfe('0x49')](handleError(_0x2fb2f0,null));};exports[_0xabfe('0x4d')]=function(_0x566cd5,_0x2e3d6c,_0x906655){var _0x55c50b={};var _0x409d0e={};var _0x1f697b;var _0x1502fd;return db[_0xabfe('0x2f')][_0xabfe('0x4e')]({'where':{'id':_0x566cd5[_0xabfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e3d6c,null))[_0xabfe('0x29')](function(_0xa53cd7){if(_0xa53cd7){_0x1f697b=_0xa53cd7;_0x409d0e[_0xabfe('0x32')]=_[_0xabfe('0x34')](db['SugarcrmConfiguration'][_0xabfe('0x45')]);_0x409d0e['query']=_[_0xabfe('0x34')](_0x566cd5[_0xabfe('0x33')]);_0x409d0e['filters']=_[_0xabfe('0x36')](_0x409d0e[_0xabfe('0x32')],_0x409d0e[_0xabfe('0x33')]);_0x55c50b[_0xabfe('0x38')]=_[_0xabfe('0x36')](_0x409d0e[_0xabfe('0x32')],qs[_0xabfe('0x37')](_0x566cd5[_0xabfe('0x33')][_0xabfe('0x37')]));_0x55c50b[_0xabfe('0x38')]=_0x55c50b[_0xabfe('0x38')][_0xabfe('0x46')]?_0x55c50b[_0xabfe('0x38')]:_0x409d0e['model'];_0x55c50b['order']=qs['sort'](_0x566cd5[_0xabfe('0x33')]['sort']);_0x55c50b[_0xabfe('0x3a')]=qs['filters'](_['pick'](_0x566cd5[_0xabfe('0x33')],_0x409d0e[_0xabfe('0x35')]));if(_0x566cd5['query']['filter']){_0x55c50b[_0xabfe('0x3a')]=_['merge'](_0x55c50b[_0xabfe('0x3a')],{'$or':_['map'](_0x55c50b[_0xabfe('0x38')],function(_0x44ef25){var _0x16fb8e={};_0x16fb8e[_0x44ef25]={'$like':'%'+_0x566cd5[_0xabfe('0x33')][_0xabfe('0x3c')]+'%'};return _0x16fb8e;})});}_0x55c50b=_[_0xabfe('0x3f')]({},_0x55c50b,_0x566cd5[_0xabfe('0x40')]);return _0x1f697b['getConfigurations'](_0x55c50b);}})['then'](function(_0x31dac4){if(_0x31dac4){_0x1502fd=_0x31dac4[_0xabfe('0x46')];if(!_0x566cd5[_0xabfe('0x33')]['hasOwnProperty']('nolimit')){_0x55c50b[_0xabfe('0x23')]=qs[_0xabfe('0x23')](_0x566cd5[_0xabfe('0x33')][_0xabfe('0x23')]);_0x55c50b[_0xabfe('0x20')]=qs[_0xabfe('0x20')](_0x566cd5[_0xabfe('0x33')]['offset']);}return _0x1f697b[_0xabfe('0x4d')](_0x55c50b);}})[_0xabfe('0x29')](function(_0x4bc6f8){if(_0x4bc6f8){return _0x4bc6f8?{'count':_0x1502fd,'rows':_0x4bc6f8}:null;}})[_0xabfe('0x29')](respondWithResult(_0x2e3d6c,null))['catch'](handleError(_0x2e3d6c,null));};exports[_0xabfe('0x4f')]=function(_0x5024be,_0x11ad63,_0xb84de5){if(_0x5024be[_0xabfe('0x4b')]['id']){delete _0x5024be[_0xabfe('0x4b')]['id'];}return db[_0xabfe('0x2f')][_0xabfe('0x4e')]({'where':{'id':_0x5024be[_0xabfe('0x44')]['id']}})[_0xabfe('0x29')](handleEntityNotFound(_0x11ad63,null))[_0xabfe('0x29')](function(_0x10c3ce){if(_0x10c3ce){_0x5024be['body']['AccountId']=_0x10c3ce['id'];_0x5024be['body'][_0xabfe('0x50')]=integrations[_0xabfe('0x51')](_0x5024be[_0xabfe('0x4b')]['channel'],_0x5024be[_0xabfe('0x4b')][_0xabfe('0x3d')]);_0x5024be[_0xabfe('0x4b')][_0xabfe('0x52')]=integrations[_0xabfe('0x53')](_0x5024be[_0xabfe('0x4b')][_0xabfe('0x54')],_0x5024be[_0xabfe('0x4b')][_0xabfe('0x3d')]);return db['SugarcrmConfiguration'][_0xabfe('0x4a')](_0x5024be[_0xabfe('0x4b')],{'include':[{'model':db[_0xabfe('0x55')],'as':_0xabfe('0x50')},{'model':db[_0xabfe('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x11ad63,null))[_0xabfe('0x49')](handleError(_0x11ad63,null));};exports[_0xabfe('0x56')]=function(_0x277193,_0x1c1db6,_0x40bc5e){var _0x4e2ff5='';var _0x419a14=['id','name',_0xabfe('0x57'),_0xabfe('0x58'),_0xabfe('0x59'),_0xabfe('0x5a'),_0xabfe('0x5b'),'duration_minutes',_0xabfe('0x5c'),'parent_type','parent_name',_0xabfe('0x5d')];return db[_0xabfe('0x2f')][_0xabfe('0x4e')]({'where':{'id':_0x277193[_0xabfe('0x44')]['id']},'attributes':['id',_0xabfe('0x5e'),_0xabfe('0x5f'),_0xabfe('0x60')]})[_0xabfe('0x29')](handleEntityNotFound(_0x1c1db6,null))[_0xabfe('0x29')](function(_0x44fd43){if(_0x44fd43){_0x4e2ff5=_0x44fd43[_0xabfe('0x60')];var _0x536e3e=_0x4e2ff5[_0xabfe('0x61')](-0x1);if(_0x536e3e==='/'){_0x4e2ff5=_0x4e2ff5[_0xabfe('0x62')](0x0,_0x4e2ff5[_0xabfe('0x63')](_0x536e3e));}return rp({'method':_0xabfe('0x64'),'uri':util['format']('%s%s',_0x4e2ff5,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xabfe('0x65'),'input_type':_0xabfe('0x66'),'response_type':_0xabfe('0x66'),'rest_data':JSON[_0xabfe('0x67')]({'user_auth':{'user_name':_0x44fd43[_0xabfe('0x5e')],'password':_0x44fd43[_0xabfe('0x5f')],'encryption':_0xabfe('0x68')},'application':_0xabfe('0x69')})}});}})[_0xabfe('0x29')](function(_0x2b7939){if(_0x2b7939&&_0x2b7939[_0xabfe('0x2c')]!==_0xabfe('0x6a')&&_0x2b7939[_0xabfe('0x2c')]!=='Password\x20Expired'){return rp({'method':_0xabfe('0x64'),'uri':util[_0xabfe('0x6b')](_0xabfe('0x6c'),_0x4e2ff5,_0xabfe('0x6d')),'json':!![],'form':{'method':_0xabfe('0x6e'),'input_type':'JSON','response_type':_0xabfe('0x66'),'rest_data':JSON[_0xabfe('0x67')]({'session':_0x2b7939['id'],'module_name':'Calls'})}})[_0xabfe('0x29')](function(_0x67755e){if(_0x67755e){var _0x39634b=_[_0xabfe('0x6f')](_0x67755e[_0xabfe('0x70')]);_[_0xabfe('0x71')](_0x39634b,function(_0xa0af78){return _0x419a14[_0xabfe('0x72')](_0xa0af78[_0xabfe('0x2c')]);});return{'count':_0x39634b[_0xabfe('0x46')],'rows':_['map'](_0x39634b,function(_0x21010a){return{'id':_0x21010a[_0xabfe('0x2c')],'name':_0x21010a['label'],'custom':_['endsWith'](_0x21010a[_0xabfe('0x2c')],'_c')?!![]:![],'options':_0x21010a[_0xabfe('0x40')]?_[_0xabfe('0x2e')](_[_0xabfe('0x6f')](_0x21010a[_0xabfe('0x40')]),function(_0x1dd021){return{'name':_0x1dd021[_0xabfe('0x73')],'value':_0x1dd021[_0xabfe('0x2c')]};}):[]};})};}})[_0xabfe('0x29')](respondWithResult(_0x1c1db6,null))['catch'](function(_0x3f5adb){var _0x4ba519=_0x277193[_0xabfe('0x33')][_0xabfe('0x74')]?0x1f4:_0x3f5adb[_0xabfe('0x75')]||0x1f4;logger['error'](_0xabfe('0x76'),'getFields',_0x4ba519,JSON['stringify'](_0x3f5adb));delete _0x3f5adb[_0xabfe('0x2c')];if(_0x4ba519===0x191){_0x4ba519=0x190;}_0x1c1db6['status'](_0x4ba519)[_0xabfe('0x2d')](_0x277193[_0xabfe('0x33')][_0xabfe('0x74')]?{'message':_0xabfe('0x77'),'statusCode':_0x3f5adb[_0xabfe('0x75')]}:_0x3f5adb);});}else{var _0x39d95=0x1f4;_0x1c1db6[_0xabfe('0x1e')](_0x39d95)[_0xabfe('0x2d')]({'message':_0xabfe('0x77'),'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 f509d35..3967508 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 _0x0701=['request-promise','path','rimraf','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','api','moment','bluebird'];(function(_0x3b4238,_0x1466c5){var _0x2a7272=function(_0x31e293){while(--_0x31e293){_0x3b4238['push'](_0x3b4238['shift']());}};_0x2a7272(++_0x1466c5);}(_0x0701,0x166));var _0x1070=function(_0x361eaf,_0x51063b){_0x361eaf=_0x361eaf-0x0;var _0x3ed0b5=_0x0701[_0x361eaf];return _0x3ed0b5;};'use strict';var _=require(_0x1070('0x0'));var util=require(_0x1070('0x1'));var logger=require('../../config/logger')(_0x1070('0x2'));var moment=require(_0x1070('0x3'));var BPromise=require(_0x1070('0x4'));var rp=require(_0x1070('0x5'));var fs=require('fs');var path=require(_0x1070('0x6'));var rimraf=require(_0x1070('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x1070('0x8'));module['exports']=function(_0x5c7b9f,_0x161b0e){return _0x5c7b9f[_0x1070('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x1070('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd93e=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports'];(function(_0x2384bb,_0x12f81b){var _0x3f2bac=function(_0x337ece){while(--_0x337ece){_0x2384bb['push'](_0x2384bb['shift']());}};_0x3f2bac(++_0x12f81b);}(_0xd93e,0x1d7));var _0xed93=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd93e[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xed93('0x0'));var util=require(_0xed93('0x1'));var logger=require(_0xed93('0x2'))('api');var moment=require(_0xed93('0x3'));var BPromise=require(_0xed93('0x4'));var rp=require(_0xed93('0x5'));var fs=require('fs');var path=require(_0xed93('0x6'));var rimraf=require(_0xed93('0x7'));var config=require('../../config/environment');var attributes=require(_0xed93('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xed93('0x9')]=function(_0xfd7c91,_0x462954){return _0xfd7c91[_0xed93('0xa')](_0xed93('0xb'),attributes,{'tableName':_0xed93('0xc'),'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 9d1918a..5111980 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 _0x741e=['rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','GetSugarcrmAccount','findAll','options','where','attributes','include','model','map','SugarcrmAccount','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c8374,_0x5814ab){var _0x6c87d9=function(_0x175add){while(--_0x175add){_0x2c8374['push'](_0x2c8374['shift']());}};_0x6c87d9(++_0x5814ab);}(_0x741e,0xbf));var _0xe741=function(_0x1033a2,_0x3f8789){_0x1033a2=_0x1033a2-0x0;var _0x2cdee3=_0x741e[_0x1033a2];return _0x2cdee3;};'use strict';var _=require(_0xe741('0x0'));var util=require(_0xe741('0x1'));var moment=require(_0xe741('0x2'));var BPromise=require(_0xe741('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe741('0x4'));var db=require(_0xe741('0x5'))['db'];var utils=require(_0xe741('0x6'));var logger=require('../../config/logger')(_0xe741('0x7'));var config=require(_0xe741('0x8'));var jayson=require(_0xe741('0x9'));var client=jayson[_0xe741('0xa')][_0xe741('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b1fbf,_0xb390bf,_0x5c48e4){return new BPromise(function(_0x31a771,_0x305a91){return client['request'](_0x2b1fbf,_0x5c48e4)[_0xe741('0xc')](function(_0x174db2){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xb390bf,_0xe741('0xd'));logger[_0xe741('0xe')](_0xe741('0xf'),_0xb390bf,_0xe741('0xd'),JSON[_0xe741('0x10')](_0x174db2));if(_0x174db2['error']){if(_0x174db2[_0xe741('0x11')][_0xe741('0x12')]===0x1f4){logger[_0xe741('0x11')](_0xe741('0x13'),_0xb390bf,_0x174db2[_0xe741('0x11')][_0xe741('0x14')]);return _0x305a91(_0x174db2[_0xe741('0x11')][_0xe741('0x14')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0xb390bf,_0x174db2[_0xe741('0x11')][_0xe741('0x14')]);return _0x31a771(_0x174db2[_0xe741('0x11')]['message']);}else{logger[_0xe741('0x15')](_0xe741('0x13'),_0xb390bf,_0xe741('0xd'));_0x31a771(_0x174db2['result'][_0xe741('0x14')]);}})[_0xe741('0x16')](function(_0x3055da){logger[_0xe741('0x11')](_0xe741('0x13'),_0xb390bf,_0x3055da);_0x305a91(_0x3055da);});});}exports[_0xe741('0x17')]=function(_0x5e23ab){var _0x4ecc30=this;return new Promise(function(_0x158758,_0x46608d){return db['SugarcrmAccount'][_0xe741('0x18')]({'raw':_0x5e23ab[_0xe741('0x19')]?_0x5e23ab[_0xe741('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5e23ab['options']?_0x5e23ab[_0xe741('0x19')][_0xe741('0x1a')]||null:null,'attributes':_0x5e23ab[_0xe741('0x19')]?_0x5e23ab['options'][_0xe741('0x1b')]||null:null,'limit':_0x5e23ab[_0xe741('0x19')]?_0x5e23ab[_0xe741('0x19')]['limit']||null:null,'include':_0x5e23ab[_0xe741('0x19')]?_0x5e23ab['options'][_0xe741('0x1c')]?_['map'](_0x5e23ab[_0xe741('0x19')][_0xe741('0x1c')],function(_0xaa7cc0){return{'model':db[_0xaa7cc0[_0xe741('0x1d')]],'as':_0xaa7cc0['as'],'attributes':_0xaa7cc0[_0xe741('0x1b')],'include':_0xaa7cc0[_0xe741('0x1c')]?_[_0xe741('0x1e')](_0xaa7cc0[_0xe741('0x1c')],function(_0x3c8c25){return{'model':db[_0x3c8c25['model']],'as':_0x3c8c25['as'],'attributes':_0x3c8c25[_0xe741('0x1b')],'include':_0x3c8c25[_0xe741('0x1c')]?_[_0xe741('0x1e')](_0x3c8c25[_0xe741('0x1c')],function(_0xc23949){return{'model':db[_0xc23949[_0xe741('0x1d')]],'as':_0xc23949['as'],'attributes':_0xc23949[_0xe741('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c6c9d){logger[_0xe741('0x15')]('GetSugarcrmAccount',_0x5e23ab);logger['debug']('GetSugarcrmAccount',_0x5e23ab,JSON['stringify'](_0x2c6c9d));_0x158758(_0x2c6c9d);})[_0xe741('0x16')](function(_0x49ec19){logger['error'](_0xe741('0x17'),_0x49ec19[_0xe741('0x14')],_0x5e23ab);_0x46608d(_0x4ecc30[_0xe741('0x11')](0x1f4,_0x49ec19[_0xe741('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0xeb0b49){var _0x4fef1a=this;return new Promise(function(_0x4cd026,_0x1cd1cc){return db[_0xe741('0x1f')]['find']({'raw':_0xeb0b49['options']?_0xeb0b49['options']['raw']===undefined?!![]:![]:!![],'where':_0xeb0b49[_0xe741('0x19')]?_0xeb0b49[_0xe741('0x19')][_0xe741('0x1a')]||null:null,'attributes':_0xeb0b49[_0xe741('0x19')]?_0xeb0b49[_0xe741('0x19')][_0xe741('0x1b')]||null:null,'include':_0xeb0b49['options']?_0xeb0b49['options']['include']?_[_0xe741('0x1e')](_0xeb0b49[_0xe741('0x19')][_0xe741('0x1c')],function(_0x4015d7){return{'model':db[_0x4015d7[_0xe741('0x1d')]],'as':_0x4015d7['as'],'attributes':_0x4015d7[_0xe741('0x1b')],'include':_0x4015d7[_0xe741('0x1c')]?_[_0xe741('0x1e')](_0x4015d7[_0xe741('0x1c')],function(_0x21519f){return{'model':db[_0x21519f['model']],'as':_0x21519f['as'],'attributes':_0x21519f['attributes'],'include':_0x21519f[_0xe741('0x1c')]?_['map'](_0x21519f[_0xe741('0x1c')],function(_0x26a104){return{'model':db[_0x26a104[_0xe741('0x1d')]],'as':_0x26a104['as'],'attributes':_0x26a104[_0xe741('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe741('0xc')](function(_0x271b48){logger[_0xe741('0x15')](_0xe741('0x20'),_0xeb0b49);logger[_0xe741('0xe')](_0xe741('0x20'),_0xeb0b49,JSON[_0xe741('0x10')](_0x271b48));_0x4cd026(_0x271b48);})[_0xe741('0x16')](function(_0x44a232){logger[_0xe741('0x11')](_0xe741('0x20'),_0x44a232[_0xe741('0x14')],_0xeb0b49);_0x1cd1cc(_0x4fef1a[_0xe741('0x11')](0x1f4,_0x44a232[_0xe741('0x14')]));});});}; \ No newline at end of file +var _0x1771=['SugarcrmAccount','findAll','options','attributes','limit','include','map','model','info','ShowSugarcrmAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSugarcrmAccount'];(function(_0x211f68,_0x47a58a){var _0x13604e=function(_0x23a402){while(--_0x23a402){_0x211f68['push'](_0x211f68['shift']());}};_0x13604e(++_0x47a58a);}(_0x1771,0x135));var _0x1177=function(_0x14f486,_0x37e9f0){_0x14f486=_0x14f486-0x0;var _0x3016a7=_0x1771[_0x14f486];return _0x3016a7;};'use strict';var _=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var moment=require(_0x1177('0x2'));var BPromise=require(_0x1177('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1177('0x4'));var db=require(_0x1177('0x5'))['db'];var utils=require(_0x1177('0x6'));var logger=require(_0x1177('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1177('0x8'));var client=jayson[_0x1177('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3550a5,_0x53a68a,_0x20a259){return new BPromise(function(_0x2aa9de,_0x209238){return client[_0x1177('0xa')](_0x3550a5,_0x20a259)[_0x1177('0xb')](function(_0x46c9a7){logger['info'](_0x1177('0xc'),_0x53a68a,_0x1177('0xd'));logger[_0x1177('0xe')](_0x1177('0xf'),_0x53a68a,'request\x20sent',JSON[_0x1177('0x10')](_0x46c9a7));if(_0x46c9a7[_0x1177('0x11')]){if(_0x46c9a7[_0x1177('0x11')]['code']===0x1f4){logger[_0x1177('0x11')](_0x1177('0xc'),_0x53a68a,_0x46c9a7[_0x1177('0x11')][_0x1177('0x12')]);return _0x209238(_0x46c9a7[_0x1177('0x11')][_0x1177('0x12')]);}logger['error'](_0x1177('0xc'),_0x53a68a,_0x46c9a7[_0x1177('0x11')]['message']);return _0x2aa9de(_0x46c9a7[_0x1177('0x11')]['message']);}else{logger['info'](_0x1177('0xc'),_0x53a68a,_0x1177('0xd'));_0x2aa9de(_0x46c9a7['result']['message']);}})[_0x1177('0x13')](function(_0x4f90d4){logger[_0x1177('0x11')](_0x1177('0xc'),_0x53a68a,_0x4f90d4);_0x209238(_0x4f90d4);});});}exports[_0x1177('0x14')]=function(_0x39e8c6){var _0x4506a5=this;return new Promise(function(_0x5e9cae,_0x2b7fec){return db[_0x1177('0x15')][_0x1177('0x16')]({'raw':_0x39e8c6[_0x1177('0x17')]?_0x39e8c6[_0x1177('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39e8c6['options']?_0x39e8c6[_0x1177('0x17')]['where']||null:null,'attributes':_0x39e8c6['options']?_0x39e8c6[_0x1177('0x17')][_0x1177('0x18')]||null:null,'limit':_0x39e8c6[_0x1177('0x17')]?_0x39e8c6[_0x1177('0x17')][_0x1177('0x19')]||null:null,'include':_0x39e8c6[_0x1177('0x17')]?_0x39e8c6[_0x1177('0x17')][_0x1177('0x1a')]?_[_0x1177('0x1b')](_0x39e8c6[_0x1177('0x17')]['include'],function(_0x529cba){return{'model':db[_0x529cba['model']],'as':_0x529cba['as'],'attributes':_0x529cba[_0x1177('0x18')],'include':_0x529cba['include']?_[_0x1177('0x1b')](_0x529cba[_0x1177('0x1a')],function(_0x785ede){return{'model':db[_0x785ede[_0x1177('0x1c')]],'as':_0x785ede['as'],'attributes':_0x785ede['attributes'],'include':_0x785ede[_0x1177('0x1a')]?_[_0x1177('0x1b')](_0x785ede[_0x1177('0x1a')],function(_0x1ef21e){return{'model':db[_0x1ef21e['model']],'as':_0x1ef21e['as'],'attributes':_0x1ef21e[_0x1177('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1177('0xb')](function(_0x33f2df){logger[_0x1177('0x1d')](_0x1177('0x14'),_0x39e8c6);logger[_0x1177('0xe')](_0x1177('0x14'),_0x39e8c6,JSON[_0x1177('0x10')](_0x33f2df));_0x5e9cae(_0x33f2df);})[_0x1177('0x13')](function(_0x524c30){logger[_0x1177('0x11')](_0x1177('0x14'),_0x524c30['message'],_0x39e8c6);_0x2b7fec(_0x4506a5[_0x1177('0x11')](0x1f4,_0x524c30[_0x1177('0x12')]));});});};exports[_0x1177('0x1e')]=function(_0x14b8d8){var _0xdfa4d6=this;return new Promise(function(_0x5422fd,_0x1631bf){return db[_0x1177('0x15')][_0x1177('0x1f')]({'raw':_0x14b8d8[_0x1177('0x17')]?_0x14b8d8[_0x1177('0x17')][_0x1177('0x20')]===undefined?!![]:![]:!![],'where':_0x14b8d8['options']?_0x14b8d8['options']['where']||null:null,'attributes':_0x14b8d8[_0x1177('0x17')]?_0x14b8d8[_0x1177('0x17')]['attributes']||null:null,'include':_0x14b8d8[_0x1177('0x17')]?_0x14b8d8[_0x1177('0x17')][_0x1177('0x1a')]?_['map'](_0x14b8d8['options']['include'],function(_0x3910aa){return{'model':db[_0x3910aa[_0x1177('0x1c')]],'as':_0x3910aa['as'],'attributes':_0x3910aa[_0x1177('0x18')],'include':_0x3910aa['include']?_[_0x1177('0x1b')](_0x3910aa[_0x1177('0x1a')],function(_0x9da99c){return{'model':db[_0x9da99c['model']],'as':_0x9da99c['as'],'attributes':_0x9da99c[_0x1177('0x18')],'include':_0x9da99c[_0x1177('0x1a')]?_[_0x1177('0x1b')](_0x9da99c[_0x1177('0x1a')],function(_0x35e76b){return{'model':db[_0x35e76b[_0x1177('0x1c')]],'as':_0x35e76b['as'],'attributes':_0x35e76b[_0x1177('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1177('0xb')](function(_0x718cf6){logger[_0x1177('0x1d')]('ShowSugarcrmAccount',_0x14b8d8);logger['debug']('ShowSugarcrmAccount',_0x14b8d8,JSON[_0x1177('0x10')](_0x718cf6));_0x5422fd(_0x718cf6);})[_0x1177('0x13')](function(_0x2bbd40){logger['error'](_0x1177('0x1e'),_0x2bbd40['message'],_0x14b8d8);_0x1631bf(_0xdfa4d6[_0x1177('0x11')](0x1f4,_0x2bbd40[_0x1177('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index bf61b0e..2b63254 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 _0x9c82=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','put','/:id','delete','destroy','exports','util'];(function(_0x2e80e9,_0xa4fc3d){var _0x1724c6=function(_0x3a0c3a){while(--_0x3a0c3a){_0x2e80e9['push'](_0x2e80e9['shift']());}};_0x1724c6(++_0xa4fc3d);}(_0x9c82,0x1e2));var _0x29c8=function(_0x551a75,_0x4b350c){_0x551a75=_0x551a75-0x0;var _0x123cc1=_0x9c82[_0x551a75];return _0x123cc1;};'use strict';var multer=require('multer');var util=require(_0x29c8('0x0'));var path=require(_0x29c8('0x1'));var timeout=require('connect-timeout');var express=require(_0x29c8('0x2'));var router=express['Router']();var fs_extra=require(_0x29c8('0x3'));var auth=require(_0x29c8('0x4'));var interaction=require(_0x29c8('0x5'));var config=require(_0x29c8('0x6'));var controller=require(_0x29c8('0x7'));router[_0x29c8('0x8')]('/',auth['isAuthenticated'](),controller[_0x29c8('0x9')]);router[_0x29c8('0x8')]('/:id',auth[_0x29c8('0xa')](),controller[_0x29c8('0xb')]);router[_0x29c8('0x8')](_0x29c8('0xc'),auth[_0x29c8('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x29c8('0xa')](),controller[_0x29c8('0xd')]);router['get'](_0x29c8('0xe'),auth['isAuthenticated'](),controller[_0x29c8('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x29c8('0x10')](_0x29c8('0x11'),auth[_0x29c8('0xa')](),controller['update']);router[_0x29c8('0x12')](_0x29c8('0x11'),auth[_0x29c8('0xa')](),controller[_0x29c8('0x13')]);module[_0x29c8('0x14')]=router; \ No newline at end of file +var _0x7e00=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','destroy','exports','multer','util'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x7e00,0x116));var _0x07e0=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0x7e00[_0x24b852];return _0x180ad2;};'use strict';var multer=require(_0x07e0('0x0'));var util=require(_0x07e0('0x1'));var path=require(_0x07e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x07e0('0x3'));var router=express[_0x07e0('0x4')]();var fs_extra=require(_0x07e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x07e0('0x6'));var config=require(_0x07e0('0x7'));var controller=require(_0x07e0('0x8'));router[_0x07e0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x07e0('0x9')](_0x07e0('0xa'),auth[_0x07e0('0xb')](),controller[_0x07e0('0xc')]);router[_0x07e0('0x9')]('/:id/fields',auth[_0x07e0('0xb')](),controller['getFields']);router[_0x07e0('0x9')](_0x07e0('0xd'),auth[_0x07e0('0xb')](),controller[_0x07e0('0xe')]);router['get'](_0x07e0('0xf'),auth[_0x07e0('0xb')](),controller[_0x07e0('0x10')]);router['post']('/',auth[_0x07e0('0xb')](),controller[_0x07e0('0x11')]);router['put'](_0x07e0('0xa'),auth[_0x07e0('0xb')](),controller['update']);router['delete'](_0x07e0('0xa'),auth['isAuthenticated'](),controller[_0x07e0('0x12')]);module[_0x07e0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1bc9792..7a09599 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 _0xd83a=['exports','STRING','sequelize'];(function(_0xa2f336,_0x3fd985){var _0x4205fe=function(_0x89ade1){while(--_0x89ade1){_0xa2f336['push'](_0xa2f336['shift']());}};_0x4205fe(++_0x3fd985);}(_0xd83a,0x17c));var _0xad83=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xd83a[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0xad83('0x0'));module[_0xad83('0x1')]={'name':{'type':Sequelize[_0xad83('0x2')]},'description':{'type':Sequelize[_0xad83('0x2')]}}; \ No newline at end of file +var _0xb8f3=['sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb8f3,0x129));var _0x3b8f=function(_0x48e6c9,_0x46c2fd){_0x48e6c9=_0x48e6c9-0x0;var _0xf3f800=_0xb8f3[_0x48e6c9];return _0xf3f800;};'use strict';var Sequelize=require(_0x3b8f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 24a8306..82854da 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 _0xeebc=['options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','SugarcrmField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5d3536,_0x22036a){var _0xd3386=function(_0x4a1a0d){while(--_0x4a1a0d){_0x5d3536['push'](_0x5d3536['shift']());}};_0xd3386(++_0x22036a);}(_0xeebc,0x1a2));var _0xceeb=function(_0x1d05f1,_0x3431){_0x1d05f1=_0x1d05f1-0x0;var _0x4e6284=_0xeebc[_0x1d05f1];return _0x4e6284;};'use strict';var emlformat=require(_0xceeb('0x0'));var rimraf=require(_0xceeb('0x1'));var zipdir=require(_0xceeb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceeb('0x3'));var moment=require(_0xceeb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xceeb('0x5'));var util=require(_0xceeb('0x6'));var path=require(_0xceeb('0x7'));var sox=require(_0xceeb('0x8'));var csv=require(_0xceeb('0x9'));var ejs=require(_0xceeb('0xa'));var fs=require('fs');var fs_extra=require(_0xceeb('0xb'));var _=require(_0xceeb('0xc'));var squel=require(_0xceeb('0xd'));var crypto=require(_0xceeb('0xe'));var jsforce=require(_0xceeb('0xf'));var deskjs=require(_0xceeb('0x10'));var toCsv=require(_0xceeb('0x9'));var querystring=require(_0xceeb('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xceeb('0x12'));var qs=require(_0xceeb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceeb('0x14'));var logger=require(_0xceeb('0x15'))('api');var utils=require(_0xceeb('0x16'));var config=require(_0xceeb('0x17'));var licenseUtil=require(_0xceeb('0x18'));var db=require(_0xceeb('0x19'))['db'];function respondWithStatusCode(_0x2bd4fa,_0x47270f){_0x47270f=_0x47270f||0xcc;return function(_0x505c70){if(_0x505c70){return _0x2bd4fa[_0xceeb('0x1a')](_0x47270f);}return _0x2bd4fa[_0xceeb('0x1b')](_0x47270f)[_0xceeb('0x1c')]();};}function respondWithResult(_0x1a3fc0,_0x3f7d81){_0x3f7d81=_0x3f7d81||0xc8;return function(_0x41234b){if(_0x41234b){return _0x1a3fc0['status'](_0x3f7d81)[_0xceeb('0x1d')](_0x41234b);}};}function respondWithFilteredResult(_0x12846d,_0x36e86f){return function(_0x3f0c68){if(_0x3f0c68){var _0x4f4350=typeof _0x36e86f[_0xceeb('0x1e')]===_0xceeb('0x1f')&&typeof _0x36e86f['limit']===_0xceeb('0x1f');var _0x45a760=_0x3f0c68[_0xceeb('0x20')];var _0x3d8495=_0x4f4350?0x0:_0x36e86f[_0xceeb('0x1e')];var _0x3520a5=_0x4f4350?_0x3f0c68[_0xceeb('0x20')]:_0x36e86f[_0xceeb('0x1e')]+_0x36e86f['limit'];var _0x381823;if(_0x3520a5>=_0x45a760){_0x3520a5=_0x45a760;_0x381823=0xc8;}else{_0x381823=0xce;}_0x12846d[_0xceeb('0x1b')](_0x381823);return _0x12846d[_0xceeb('0x21')](_0xceeb('0x22'),_0x3d8495+'-'+_0x3520a5+'/'+_0x45a760)[_0xceeb('0x1d')](_0x3f0c68);}return null;};}function patchUpdates(_0x56b44e){return function(_0x149b44){try{jsonpatch['apply'](_0x149b44,_0x56b44e,!![]);}catch(_0x28a3d9){return BPromise[_0xceeb('0x23')](_0x28a3d9);}return _0x149b44['save']();};}function saveUpdates(_0x3ac254,_0x3f3909){return function(_0x15c9dd){if(_0x15c9dd){return _0x15c9dd[_0xceeb('0x24')](_0x3ac254)[_0xceeb('0x25')](function(_0x2f45cb){return _0x2f45cb;});}return null;};}function removeEntity(_0x2d31d7,_0xa75c19){return function(_0x23fedf){if(_0x23fedf){return _0x23fedf[_0xceeb('0x26')]()[_0xceeb('0x25')](function(){_0x2d31d7[_0xceeb('0x1b')](0xcc)[_0xceeb('0x1c')]();});}};}function handleEntityNotFound(_0x334052,_0x206a12){return function(_0x4d7dab){if(!_0x4d7dab){_0x334052[_0xceeb('0x1a')](0x194);}return _0x4d7dab;};}function handleError(_0x49377a,_0x1ff351){_0x1ff351=_0x1ff351||0x1f4;return function(_0xe9f71){logger['error'](_0xe9f71['stack']);if(_0xe9f71[_0xceeb('0x27')]){delete _0xe9f71[_0xceeb('0x27')];}_0x49377a[_0xceeb('0x1b')](_0x1ff351)['send'](_0xe9f71);};}exports['index']=function(_0x37e3cc,_0x5da07b){var _0x39818f={},_0x18f2b0={},_0x227fdf={'count':0x0,'rows':[]};var _0x5e0ce8=_[_0xceeb('0x28')](db['SugarcrmConfiguration'][_0xceeb('0x29')],function(_0x331176){return{'name':_0x331176[_0xceeb('0x2a')],'type':_0x331176[_0xceeb('0x2b')][_0xceeb('0x2c')]};});_0x18f2b0[_0xceeb('0x2d')]=_[_0xceeb('0x28')](_0x5e0ce8,'name');_0x18f2b0['query']=_[_0xceeb('0x2e')](_0x37e3cc['query']);_0x18f2b0[_0xceeb('0x2f')]=_[_0xceeb('0x30')](_0x18f2b0[_0xceeb('0x2d')],_0x18f2b0[_0xceeb('0x31')]);_0x39818f[_0xceeb('0x32')]=_['intersection'](_0x18f2b0[_0xceeb('0x2d')],qs[_0xceeb('0x33')](_0x37e3cc[_0xceeb('0x31')][_0xceeb('0x33')]));_0x39818f['attributes']=_0x39818f[_0xceeb('0x32')][_0xceeb('0x34')]?_0x39818f['attributes']:_0x18f2b0[_0xceeb('0x2d')];if(!_0x37e3cc[_0xceeb('0x31')]['hasOwnProperty'](_0xceeb('0x35'))){_0x39818f[_0xceeb('0x36')]=qs['limit'](_0x37e3cc['query'][_0xceeb('0x36')]);_0x39818f[_0xceeb('0x1e')]=qs[_0xceeb('0x1e')](_0x37e3cc[_0xceeb('0x31')][_0xceeb('0x1e')]);}_0x39818f[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x37e3cc[_0xceeb('0x31')]['sort']);_0x39818f[_0xceeb('0x39')]=qs[_0xceeb('0x2f')](_[_0xceeb('0x3a')](_0x37e3cc['query'],_0x18f2b0[_0xceeb('0x2f')]),_0x5e0ce8);if(_0x37e3cc[_0xceeb('0x31')][_0xceeb('0x3b')]){_0x39818f[_0xceeb('0x39')]=_[_0xceeb('0x3c')](_0x39818f['where'],{'$or':_[_0xceeb('0x28')](_0x5e0ce8,function(_0x3cf4ae){if(_0x3cf4ae[_0xceeb('0x2b')]!==_0xceeb('0x3d')){var _0x4b2762={};_0x4b2762[_0x3cf4ae['name']]={'$like':'%'+_0x37e3cc[_0xceeb('0x31')]['filter']+'%'};return _0x4b2762;}})});}_0x39818f=_[_0xceeb('0x3c')]({},_0x39818f,_0x37e3cc[_0xceeb('0x3e')]);var _0x5d9b36={'where':_0x39818f[_0xceeb('0x39')]};return db[_0xceeb('0x3f')][_0xceeb('0x20')](_0x5d9b36)[_0xceeb('0x25')](function(_0x2b8926){_0x227fdf[_0xceeb('0x20')]=_0x2b8926;if(_0x37e3cc[_0xceeb('0x31')][_0xceeb('0x40')]){_0x39818f[_0xceeb('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xceeb('0x42')](_0x39818f);})['then'](function(_0x45b496){_0x227fdf[_0xceeb('0x43')]=_0x45b496;return _0x227fdf;})[_0xceeb('0x25')](respondWithFilteredResult(_0x5da07b,_0x39818f))[_0xceeb('0x44')](handleError(_0x5da07b,null));};exports[_0xceeb('0x45')]=function(_0x1b7a8c,_0x43fa56){var _0xa23628={'raw':![],'where':{'id':_0x1b7a8c[_0xceeb('0x46')]['id']}},_0x3b4fd2={};_0x3b4fd2['model']=_['keys'](db[_0xceeb('0x3f')][_0xceeb('0x29')]);_0x3b4fd2[_0xceeb('0x31')]=_[_0xceeb('0x2e')](_0x1b7a8c[_0xceeb('0x31')]);_0x3b4fd2[_0xceeb('0x2f')]=_['intersection'](_0x3b4fd2['model'],_0x3b4fd2[_0xceeb('0x31')]);_0xa23628['attributes']=_[_0xceeb('0x30')](_0x3b4fd2[_0xceeb('0x2d')],qs[_0xceeb('0x33')](_0x1b7a8c[_0xceeb('0x31')][_0xceeb('0x33')]));_0xa23628[_0xceeb('0x32')]=_0xa23628['attributes'][_0xceeb('0x34')]?_0xa23628[_0xceeb('0x32')]:_0x3b4fd2[_0xceeb('0x2d')];if(_0x1b7a8c[_0xceeb('0x31')][_0xceeb('0x40')]){_0xa23628[_0xceeb('0x41')]=[{'all':!![]}];}_0xa23628=_['merge']({},_0xa23628,_0x1b7a8c['options']);return db[_0xceeb('0x3f')][_0xceeb('0x47')](_0xa23628)[_0xceeb('0x25')](handleEntityNotFound(_0x43fa56,null))[_0xceeb('0x25')](respondWithResult(_0x43fa56,null))[_0xceeb('0x44')](handleError(_0x43fa56,null));};exports[_0xceeb('0x48')]=function(_0x4d0ed5,_0x127e04){return db[_0xceeb('0x3f')]['create'](_0x4d0ed5['body'],{})[_0xceeb('0x25')](respondWithResult(_0x127e04,0xc9))[_0xceeb('0x44')](handleError(_0x127e04,null));};exports[_0xceeb('0x24')]=function(_0x122e87,_0x1aad4f){if(_0x122e87[_0xceeb('0x49')]['id']){delete _0x122e87[_0xceeb('0x49')]['id'];}return db[_0xceeb('0x3f')][_0xceeb('0x47')]({'where':{'id':_0x122e87[_0xceeb('0x46')]['id']}})[_0xceeb('0x25')](handleEntityNotFound(_0x1aad4f,null))[_0xceeb('0x25')](saveUpdates(_0x122e87[_0xceeb('0x49')],null))[_0xceeb('0x25')](respondWithResult(_0x1aad4f,null))[_0xceeb('0x44')](handleError(_0x1aad4f,null));};exports[_0xceeb('0x26')]=function(_0x1f998c,_0x25f68d){return db[_0xceeb('0x3f')][_0xceeb('0x47')]({'where':{'id':_0x1f998c['params']['id']}})['then'](handleEntityNotFound(_0x25f68d,null))[_0xceeb('0x25')](removeEntity(_0x25f68d,null))[_0xceeb('0x44')](handleError(_0x25f68d,null));};exports[_0xceeb('0x4a')]=function(_0x3d96ff,_0x45bb47,_0x39b3fc){var _0x3bcbd6={};var _0x28b060={};var _0x357969;var _0x5d7346;return db[_0xceeb('0x3f')]['findOne']({'where':{'id':_0x3d96ff[_0xceeb('0x46')]['id']}})['then'](handleEntityNotFound(_0x45bb47,null))[_0xceeb('0x25')](function(_0x54a139){if(_0x54a139){_0x357969=_0x54a139;_0x28b060['model']=_[_0xceeb('0x2e')](db['SugarcrmField'][_0xceeb('0x29')]);_0x28b060[_0xceeb('0x31')]=_[_0xceeb('0x2e')](_0x3d96ff[_0xceeb('0x31')]);_0x28b060[_0xceeb('0x2f')]=_['intersection'](_0x28b060['model'],_0x28b060[_0xceeb('0x31')]);_0x3bcbd6[_0xceeb('0x32')]=_['intersection'](_0x28b060[_0xceeb('0x2d')],qs[_0xceeb('0x33')](_0x3d96ff['query']['fields']));_0x3bcbd6[_0xceeb('0x32')]=_0x3bcbd6[_0xceeb('0x32')][_0xceeb('0x34')]?_0x3bcbd6['attributes']:_0x28b060['model'];_0x3bcbd6[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x3d96ff[_0xceeb('0x31')]['sort']);_0x3bcbd6[_0xceeb('0x39')]=qs['filters'](_[_0xceeb('0x3a')](_0x3d96ff[_0xceeb('0x31')],_0x28b060[_0xceeb('0x2f')]));if(_0x3d96ff[_0xceeb('0x31')]['filter']){_0x3bcbd6[_0xceeb('0x39')]=_[_0xceeb('0x3c')](_0x3bcbd6[_0xceeb('0x39')],{'$or':_[_0xceeb('0x28')](_0x3bcbd6[_0xceeb('0x32')],function(_0x571af2){var _0x2edc1a={};_0x2edc1a[_0x571af2]={'$like':'%'+_0x3d96ff['query'][_0xceeb('0x3b')]+'%'};return _0x2edc1a;})});}_0x3bcbd6=_[_0xceeb('0x3c')]({},_0x3bcbd6,_0x3d96ff[_0xceeb('0x3e')]);return _0x357969['getFields'](_0x3bcbd6);}})[_0xceeb('0x25')](function(_0x4b22d0){if(_0x4b22d0){_0x5d7346=_0x4b22d0[_0xceeb('0x34')];if(!_0x3d96ff['query']['hasOwnProperty']('nolimit')){_0x3bcbd6[_0xceeb('0x36')]=qs[_0xceeb('0x36')](_0x3d96ff[_0xceeb('0x31')][_0xceeb('0x36')]);_0x3bcbd6[_0xceeb('0x1e')]=qs[_0xceeb('0x1e')](_0x3d96ff[_0xceeb('0x31')][_0xceeb('0x1e')]);}return _0x357969[_0xceeb('0x4a')](_0x3bcbd6);}})[_0xceeb('0x25')](function(_0x44ef1c){if(_0x44ef1c){return _0x44ef1c?{'count':_0x5d7346,'rows':_0x44ef1c}:null;}})['then'](respondWithResult(_0x45bb47,null))[_0xceeb('0x44')](handleError(_0x45bb47,null));};exports['getSubjects']=function(_0x44aab9,_0x4ce492,_0x3e6478){var _0x48cf88={};var _0x2dc4c8={};var _0x112e96;var _0x81367a;return db[_0xceeb('0x3f')][_0xceeb('0x4b')]({'where':{'id':_0x44aab9[_0xceeb('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ce492,null))[_0xceeb('0x25')](function(_0x1ea0af){if(_0x1ea0af){_0x112e96=_0x1ea0af;_0x2dc4c8['model']=_[_0xceeb('0x2e')](db[_0xceeb('0x4c')]['rawAttributes']);_0x2dc4c8['query']=_[_0xceeb('0x2e')](_0x44aab9[_0xceeb('0x31')]);_0x2dc4c8[_0xceeb('0x2f')]=_[_0xceeb('0x30')](_0x2dc4c8[_0xceeb('0x2d')],_0x2dc4c8['query']);_0x48cf88[_0xceeb('0x32')]=_[_0xceeb('0x30')](_0x2dc4c8[_0xceeb('0x2d')],qs[_0xceeb('0x33')](_0x44aab9[_0xceeb('0x31')][_0xceeb('0x33')]));_0x48cf88[_0xceeb('0x32')]=_0x48cf88['attributes'][_0xceeb('0x34')]?_0x48cf88[_0xceeb('0x32')]:_0x2dc4c8[_0xceeb('0x2d')];_0x48cf88[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x44aab9[_0xceeb('0x31')][_0xceeb('0x38')]);_0x48cf88[_0xceeb('0x39')]=qs[_0xceeb('0x2f')](_[_0xceeb('0x3a')](_0x44aab9[_0xceeb('0x31')],_0x2dc4c8['filters']));if(_0x44aab9[_0xceeb('0x31')][_0xceeb('0x3b')]){_0x48cf88[_0xceeb('0x39')]=_[_0xceeb('0x3c')](_0x48cf88[_0xceeb('0x39')],{'$or':_[_0xceeb('0x28')](_0x48cf88[_0xceeb('0x32')],function(_0x25b6a2){var _0x18fcc5={};_0x18fcc5[_0x25b6a2]={'$like':'%'+_0x44aab9['query'][_0xceeb('0x3b')]+'%'};return _0x18fcc5;})});}_0x48cf88=_[_0xceeb('0x3c')]({},_0x48cf88,_0x44aab9[_0xceeb('0x3e')]);return _0x112e96[_0xceeb('0x4d')](_0x48cf88);}})[_0xceeb('0x25')](function(_0x2e2ed1){if(_0x2e2ed1){_0x81367a=_0x2e2ed1['length'];if(!_0x44aab9[_0xceeb('0x31')][_0xceeb('0x4e')](_0xceeb('0x35'))){_0x48cf88['limit']=qs[_0xceeb('0x36')](_0x44aab9['query']['limit']);_0x48cf88['offset']=qs[_0xceeb('0x1e')](_0x44aab9[_0xceeb('0x31')]['offset']);}return _0x112e96[_0xceeb('0x4d')](_0x48cf88);}})[_0xceeb('0x25')](function(_0x4cbfd8){if(_0x4cbfd8){return _0x4cbfd8?{'count':_0x81367a,'rows':_0x4cbfd8}:null;}})[_0xceeb('0x25')](respondWithResult(_0x4ce492,null))['catch'](handleError(_0x4ce492,null));};exports[_0xceeb('0x4f')]=function(_0x174fa4,_0x3beb4f,_0x23df57){var _0x1b2e28={};var _0x2d7daa={};var _0x1d5012;var _0x307d04;return db[_0xceeb('0x3f')][_0xceeb('0x4b')]({'where':{'id':_0x174fa4['params']['id']}})['then'](handleEntityNotFound(_0x3beb4f,null))[_0xceeb('0x25')](function(_0x34a238){if(_0x34a238){_0x1d5012=_0x34a238;_0x2d7daa[_0xceeb('0x2d')]=_[_0xceeb('0x2e')](db[_0xceeb('0x4c')][_0xceeb('0x29')]);_0x2d7daa[_0xceeb('0x31')]=_['keys'](_0x174fa4['query']);_0x2d7daa['filters']=_['intersection'](_0x2d7daa['model'],_0x2d7daa[_0xceeb('0x31')]);_0x1b2e28[_0xceeb('0x32')]=_[_0xceeb('0x30')](_0x2d7daa['model'],qs[_0xceeb('0x33')](_0x174fa4[_0xceeb('0x31')][_0xceeb('0x33')]));_0x1b2e28['attributes']=_0x1b2e28[_0xceeb('0x32')]['length']?_0x1b2e28[_0xceeb('0x32')]:_0x2d7daa['model'];_0x1b2e28[_0xceeb('0x37')]=qs[_0xceeb('0x38')](_0x174fa4[_0xceeb('0x31')][_0xceeb('0x38')]);_0x1b2e28[_0xceeb('0x39')]=qs[_0xceeb('0x2f')](_[_0xceeb('0x3a')](_0x174fa4['query'],_0x2d7daa[_0xceeb('0x2f')]));if(_0x174fa4['query'][_0xceeb('0x3b')]){_0x1b2e28[_0xceeb('0x39')]=_[_0xceeb('0x3c')](_0x1b2e28['where'],{'$or':_[_0xceeb('0x28')](_0x1b2e28[_0xceeb('0x32')],function(_0x16011a){var _0x310491={};_0x310491[_0x16011a]={'$like':'%'+_0x174fa4[_0xceeb('0x31')][_0xceeb('0x3b')]+'%'};return _0x310491;})});}_0x1b2e28=_['merge']({},_0x1b2e28,_0x174fa4[_0xceeb('0x3e')]);return _0x1d5012[_0xceeb('0x4f')](_0x1b2e28);}})[_0xceeb('0x25')](function(_0x47f49d){if(_0x47f49d){_0x307d04=_0x47f49d[_0xceeb('0x34')];if(!_0x174fa4[_0xceeb('0x31')]['hasOwnProperty'](_0xceeb('0x35'))){_0x1b2e28[_0xceeb('0x36')]=qs[_0xceeb('0x36')](_0x174fa4[_0xceeb('0x31')][_0xceeb('0x36')]);_0x1b2e28[_0xceeb('0x1e')]=qs[_0xceeb('0x1e')](_0x174fa4[_0xceeb('0x31')]['offset']);}return _0x1d5012[_0xceeb('0x4f')](_0x1b2e28);}})['then'](function(_0x4eeb45){if(_0x4eeb45){return _0x4eeb45?{'count':_0x307d04,'rows':_0x4eeb45}:null;}})[_0xceeb('0x25')](respondWithResult(_0x3beb4f,null))[_0xceeb('0x44')](handleError(_0x3beb4f,null));}; \ No newline at end of file +var _0x5ff4=['attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','findOne','SugarcrmField','getFields','getSubjects','order','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x61e907,_0x568261){var _0x1b5faa=function(_0x3ff01f){while(--_0x3ff01f){_0x61e907['push'](_0x61e907['shift']());}};_0x1b5faa(++_0x568261);}(_0x5ff4,0x70));var _0x45ff=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5ff4[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45ff('0x0'));var zipdir=require(_0x45ff('0x1'));var jsonpatch=require(_0x45ff('0x2'));var rp=require(_0x45ff('0x3'));var moment=require('moment');var BPromise=require(_0x45ff('0x4'));var Mustache=require('mustache');var util=require(_0x45ff('0x5'));var path=require(_0x45ff('0x6'));var sox=require(_0x45ff('0x7'));var csv=require(_0x45ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45ff('0x9'));var _=require(_0x45ff('0xa'));var squel=require(_0x45ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x45ff('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x45ff('0xd'));var Papa=require(_0x45ff('0xe'));var Redis=require(_0x45ff('0xf'));var authService=require(_0x45ff('0x10'));var qs=require(_0x45ff('0x11'));var as=require(_0x45ff('0x12'));var hardwareService=require(_0x45ff('0x13'));var logger=require(_0x45ff('0x14'))(_0x45ff('0x15'));var utils=require(_0x45ff('0x16'));var config=require(_0x45ff('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xea239c,_0x54a87e){_0x54a87e=_0x54a87e||0xcc;return function(_0x220fa3){if(_0x220fa3){return _0xea239c[_0x45ff('0x18')](_0x54a87e);}return _0xea239c['status'](_0x54a87e)[_0x45ff('0x19')]();};}function respondWithResult(_0xf4f093,_0x5b11bd){_0x5b11bd=_0x5b11bd||0xc8;return function(_0x1b36d2){if(_0x1b36d2){return _0xf4f093[_0x45ff('0x1a')](_0x5b11bd)[_0x45ff('0x1b')](_0x1b36d2);}};}function respondWithFilteredResult(_0x175afa,_0x5409f3){return function(_0xd8cc78){if(_0xd8cc78){var _0x19397e=typeof _0x5409f3[_0x45ff('0x1c')]===_0x45ff('0x1d')&&typeof _0x5409f3[_0x45ff('0x1e')]===_0x45ff('0x1d');var _0x462448=_0xd8cc78[_0x45ff('0x1f')];var _0x14093b=_0x19397e?0x0:_0x5409f3['offset'];var _0x51ce75=_0x19397e?_0xd8cc78['count']:_0x5409f3[_0x45ff('0x1c')]+_0x5409f3[_0x45ff('0x1e')];var _0x5d6808;if(_0x51ce75>=_0x462448){_0x51ce75=_0x462448;_0x5d6808=0xc8;}else{_0x5d6808=0xce;}_0x175afa[_0x45ff('0x1a')](_0x5d6808);return _0x175afa[_0x45ff('0x20')](_0x45ff('0x21'),_0x14093b+'-'+_0x51ce75+'/'+_0x462448)[_0x45ff('0x1b')](_0xd8cc78);}return null;};}function patchUpdates(_0x30f71a){return function(_0x46a311){try{jsonpatch[_0x45ff('0x22')](_0x46a311,_0x30f71a,!![]);}catch(_0x56eca2){return BPromise[_0x45ff('0x23')](_0x56eca2);}return _0x46a311['save']();};}function saveUpdates(_0x33331e,_0x5cb10d){return function(_0x3e7bbd){if(_0x3e7bbd){return _0x3e7bbd[_0x45ff('0x24')](_0x33331e)[_0x45ff('0x25')](function(_0x10302b){return _0x10302b;});}return null;};}function removeEntity(_0xb8a377,_0x4a46f4){return function(_0x333258){if(_0x333258){return _0x333258['destroy']()['then'](function(){_0xb8a377[_0x45ff('0x1a')](0xcc)[_0x45ff('0x19')]();});}};}function handleEntityNotFound(_0x1b606e,_0x3b5150){return function(_0x131f7d){if(!_0x131f7d){_0x1b606e[_0x45ff('0x18')](0x194);}return _0x131f7d;};}function handleError(_0x4e4761,_0x13e6f1){_0x13e6f1=_0x13e6f1||0x1f4;return function(_0x249c74){logger[_0x45ff('0x26')](_0x249c74[_0x45ff('0x27')]);if(_0x249c74[_0x45ff('0x28')]){delete _0x249c74['name'];}_0x4e4761[_0x45ff('0x1a')](_0x13e6f1)[_0x45ff('0x29')](_0x249c74);};}exports['index']=function(_0x4ea8f8,_0xc9711e){var _0x96ceeb={},_0x57de8d={},_0x1dc2da={'count':0x0,'rows':[]};var _0x957274=_[_0x45ff('0x2a')](db['SugarcrmConfiguration'][_0x45ff('0x2b')],function(_0x4a77d9){return{'name':_0x4a77d9[_0x45ff('0x2c')],'type':_0x4a77d9[_0x45ff('0x2d')][_0x45ff('0x2e')]};});_0x57de8d[_0x45ff('0x2f')]=_[_0x45ff('0x2a')](_0x957274,_0x45ff('0x28'));_0x57de8d[_0x45ff('0x30')]=_['keys'](_0x4ea8f8['query']);_0x57de8d[_0x45ff('0x31')]=_['intersection'](_0x57de8d[_0x45ff('0x2f')],_0x57de8d[_0x45ff('0x30')]);_0x96ceeb['attributes']=_[_0x45ff('0x32')](_0x57de8d[_0x45ff('0x2f')],qs['fields'](_0x4ea8f8[_0x45ff('0x30')][_0x45ff('0x33')]));_0x96ceeb[_0x45ff('0x34')]=_0x96ceeb['attributes']['length']?_0x96ceeb['attributes']:_0x57de8d[_0x45ff('0x2f')];if(!_0x4ea8f8[_0x45ff('0x30')]['hasOwnProperty'](_0x45ff('0x35'))){_0x96ceeb['limit']=qs[_0x45ff('0x1e')](_0x4ea8f8[_0x45ff('0x30')]['limit']);_0x96ceeb[_0x45ff('0x1c')]=qs[_0x45ff('0x1c')](_0x4ea8f8['query'][_0x45ff('0x1c')]);}_0x96ceeb['order']=qs[_0x45ff('0x36')](_0x4ea8f8[_0x45ff('0x30')][_0x45ff('0x36')]);_0x96ceeb[_0x45ff('0x37')]=qs[_0x45ff('0x31')](_[_0x45ff('0x38')](_0x4ea8f8[_0x45ff('0x30')],_0x57de8d[_0x45ff('0x31')]),_0x957274);if(_0x4ea8f8['query'][_0x45ff('0x39')]){_0x96ceeb['where']=_[_0x45ff('0x3a')](_0x96ceeb[_0x45ff('0x37')],{'$or':_['map'](_0x957274,function(_0x23e2bd){if(_0x23e2bd[_0x45ff('0x2d')]!==_0x45ff('0x3b')){var _0x55891e={};_0x55891e[_0x23e2bd[_0x45ff('0x28')]]={'$like':'%'+_0x4ea8f8[_0x45ff('0x30')][_0x45ff('0x39')]+'%'};return _0x55891e;}})});}_0x96ceeb=_[_0x45ff('0x3a')]({},_0x96ceeb,_0x4ea8f8[_0x45ff('0x3c')]);var _0x10b372={'where':_0x96ceeb[_0x45ff('0x37')]};return db[_0x45ff('0x3d')]['count'](_0x10b372)[_0x45ff('0x25')](function(_0x5b3a46){_0x1dc2da[_0x45ff('0x1f')]=_0x5b3a46;if(_0x4ea8f8[_0x45ff('0x30')]['includeAll']){_0x96ceeb[_0x45ff('0x3e')]=[{'all':!![]}];}return db[_0x45ff('0x3d')][_0x45ff('0x3f')](_0x96ceeb);})[_0x45ff('0x25')](function(_0x10c99e){_0x1dc2da[_0x45ff('0x40')]=_0x10c99e;return _0x1dc2da;})[_0x45ff('0x25')](respondWithFilteredResult(_0xc9711e,_0x96ceeb))[_0x45ff('0x41')](handleError(_0xc9711e,null));};exports[_0x45ff('0x42')]=function(_0x42138c,_0x1b5517){var _0x4b0e93={'raw':![],'where':{'id':_0x42138c[_0x45ff('0x43')]['id']}},_0x46d736={};_0x46d736['model']=_[_0x45ff('0x44')](db[_0x45ff('0x3d')][_0x45ff('0x2b')]);_0x46d736[_0x45ff('0x30')]=_[_0x45ff('0x44')](_0x42138c[_0x45ff('0x30')]);_0x46d736['filters']=_[_0x45ff('0x32')](_0x46d736[_0x45ff('0x2f')],_0x46d736['query']);_0x4b0e93['attributes']=_[_0x45ff('0x32')](_0x46d736['model'],qs['fields'](_0x42138c[_0x45ff('0x30')][_0x45ff('0x33')]));_0x4b0e93['attributes']=_0x4b0e93[_0x45ff('0x34')][_0x45ff('0x45')]?_0x4b0e93[_0x45ff('0x34')]:_0x46d736[_0x45ff('0x2f')];if(_0x42138c[_0x45ff('0x30')][_0x45ff('0x46')]){_0x4b0e93[_0x45ff('0x3e')]=[{'all':!![]}];}_0x4b0e93=_['merge']({},_0x4b0e93,_0x42138c['options']);return db[_0x45ff('0x3d')][_0x45ff('0x47')](_0x4b0e93)[_0x45ff('0x25')](handleEntityNotFound(_0x1b5517,null))[_0x45ff('0x25')](respondWithResult(_0x1b5517,null))[_0x45ff('0x41')](handleError(_0x1b5517,null));};exports['create']=function(_0xa9ffb4,_0x101a05){return db[_0x45ff('0x3d')][_0x45ff('0x48')](_0xa9ffb4[_0x45ff('0x49')],{})['then'](respondWithResult(_0x101a05,0xc9))[_0x45ff('0x41')](handleError(_0x101a05,null));};exports['update']=function(_0xeff2d8,_0x23f916){if(_0xeff2d8[_0x45ff('0x49')]['id']){delete _0xeff2d8['body']['id'];}return db[_0x45ff('0x3d')][_0x45ff('0x47')]({'where':{'id':_0xeff2d8['params']['id']}})['then'](handleEntityNotFound(_0x23f916,null))[_0x45ff('0x25')](saveUpdates(_0xeff2d8[_0x45ff('0x49')],null))[_0x45ff('0x25')](respondWithResult(_0x23f916,null))['catch'](handleError(_0x23f916,null));};exports[_0x45ff('0x4a')]=function(_0x534f33,_0x5cfc68){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x534f33['params']['id']}})[_0x45ff('0x25')](handleEntityNotFound(_0x5cfc68,null))[_0x45ff('0x25')](removeEntity(_0x5cfc68,null))[_0x45ff('0x41')](handleError(_0x5cfc68,null));};exports['getFields']=function(_0xd7f5ae,_0x459e27,_0x548cec){var _0xd8b880={};var _0x48c84c={};var _0x1ad736;var _0x550947;return db[_0x45ff('0x3d')][_0x45ff('0x4b')]({'where':{'id':_0xd7f5ae['params']['id']}})[_0x45ff('0x25')](handleEntityNotFound(_0x459e27,null))[_0x45ff('0x25')](function(_0x801be4){if(_0x801be4){_0x1ad736=_0x801be4;_0x48c84c[_0x45ff('0x2f')]=_[_0x45ff('0x44')](db[_0x45ff('0x4c')][_0x45ff('0x2b')]);_0x48c84c[_0x45ff('0x30')]=_['keys'](_0xd7f5ae[_0x45ff('0x30')]);_0x48c84c[_0x45ff('0x31')]=_[_0x45ff('0x32')](_0x48c84c['model'],_0x48c84c[_0x45ff('0x30')]);_0xd8b880[_0x45ff('0x34')]=_['intersection'](_0x48c84c['model'],qs[_0x45ff('0x33')](_0xd7f5ae[_0x45ff('0x30')]['fields']));_0xd8b880[_0x45ff('0x34')]=_0xd8b880['attributes'][_0x45ff('0x45')]?_0xd8b880[_0x45ff('0x34')]:_0x48c84c[_0x45ff('0x2f')];_0xd8b880['order']=qs[_0x45ff('0x36')](_0xd7f5ae[_0x45ff('0x30')][_0x45ff('0x36')]);_0xd8b880[_0x45ff('0x37')]=qs[_0x45ff('0x31')](_['pick'](_0xd7f5ae[_0x45ff('0x30')],_0x48c84c[_0x45ff('0x31')]));if(_0xd7f5ae[_0x45ff('0x30')][_0x45ff('0x39')]){_0xd8b880[_0x45ff('0x37')]=_[_0x45ff('0x3a')](_0xd8b880[_0x45ff('0x37')],{'$or':_[_0x45ff('0x2a')](_0xd8b880[_0x45ff('0x34')],function(_0x2b84da){var _0x261158={};_0x261158[_0x2b84da]={'$like':'%'+_0xd7f5ae['query']['filter']+'%'};return _0x261158;})});}_0xd8b880=_['merge']({},_0xd8b880,_0xd7f5ae[_0x45ff('0x3c')]);return _0x1ad736[_0x45ff('0x4d')](_0xd8b880);}})[_0x45ff('0x25')](function(_0x3bf3d0){if(_0x3bf3d0){_0x550947=_0x3bf3d0[_0x45ff('0x45')];if(!_0xd7f5ae[_0x45ff('0x30')]['hasOwnProperty'](_0x45ff('0x35'))){_0xd8b880[_0x45ff('0x1e')]=qs['limit'](_0xd7f5ae[_0x45ff('0x30')]['limit']);_0xd8b880[_0x45ff('0x1c')]=qs[_0x45ff('0x1c')](_0xd7f5ae['query'][_0x45ff('0x1c')]);}return _0x1ad736[_0x45ff('0x4d')](_0xd8b880);}})['then'](function(_0x1325f7){if(_0x1325f7){return _0x1325f7?{'count':_0x550947,'rows':_0x1325f7}:null;}})[_0x45ff('0x25')](respondWithResult(_0x459e27,null))['catch'](handleError(_0x459e27,null));};exports[_0x45ff('0x4e')]=function(_0xc841d3,_0x14e024,_0x257462){var _0x42b59a={};var _0x1510cb={};var _0xe919cb;var _0x2634f2;return db[_0x45ff('0x3d')][_0x45ff('0x4b')]({'where':{'id':_0xc841d3['params']['id']}})[_0x45ff('0x25')](handleEntityNotFound(_0x14e024,null))[_0x45ff('0x25')](function(_0x55b26c){if(_0x55b26c){_0xe919cb=_0x55b26c;_0x1510cb[_0x45ff('0x2f')]=_[_0x45ff('0x44')](db[_0x45ff('0x4c')][_0x45ff('0x2b')]);_0x1510cb['query']=_[_0x45ff('0x44')](_0xc841d3['query']);_0x1510cb[_0x45ff('0x31')]=_[_0x45ff('0x32')](_0x1510cb[_0x45ff('0x2f')],_0x1510cb[_0x45ff('0x30')]);_0x42b59a[_0x45ff('0x34')]=_[_0x45ff('0x32')](_0x1510cb[_0x45ff('0x2f')],qs['fields'](_0xc841d3['query'][_0x45ff('0x33')]));_0x42b59a['attributes']=_0x42b59a[_0x45ff('0x34')][_0x45ff('0x45')]?_0x42b59a[_0x45ff('0x34')]:_0x1510cb[_0x45ff('0x2f')];_0x42b59a[_0x45ff('0x4f')]=qs['sort'](_0xc841d3[_0x45ff('0x30')][_0x45ff('0x36')]);_0x42b59a[_0x45ff('0x37')]=qs[_0x45ff('0x31')](_[_0x45ff('0x38')](_0xc841d3[_0x45ff('0x30')],_0x1510cb[_0x45ff('0x31')]));if(_0xc841d3[_0x45ff('0x30')][_0x45ff('0x39')]){_0x42b59a[_0x45ff('0x37')]=_[_0x45ff('0x3a')](_0x42b59a[_0x45ff('0x37')],{'$or':_['map'](_0x42b59a['attributes'],function(_0x24f442){var _0x1c4fd5={};_0x1c4fd5[_0x24f442]={'$like':'%'+_0xc841d3[_0x45ff('0x30')][_0x45ff('0x39')]+'%'};return _0x1c4fd5;})});}_0x42b59a=_[_0x45ff('0x3a')]({},_0x42b59a,_0xc841d3[_0x45ff('0x3c')]);return _0xe919cb[_0x45ff('0x4e')](_0x42b59a);}})[_0x45ff('0x25')](function(_0x38f45c){if(_0x38f45c){_0x2634f2=_0x38f45c[_0x45ff('0x45')];if(!_0xc841d3[_0x45ff('0x30')][_0x45ff('0x50')](_0x45ff('0x35'))){_0x42b59a['limit']=qs[_0x45ff('0x1e')](_0xc841d3[_0x45ff('0x30')][_0x45ff('0x1e')]);_0x42b59a['offset']=qs[_0x45ff('0x1c')](_0xc841d3[_0x45ff('0x30')]['offset']);}return _0xe919cb[_0x45ff('0x4e')](_0x42b59a);}})[_0x45ff('0x25')](function(_0x27a788){if(_0x27a788){return _0x27a788?{'count':_0x2634f2,'rows':_0x27a788}:null;}})[_0x45ff('0x25')](respondWithResult(_0x14e024,null))[_0x45ff('0x41')](handleError(_0x14e024,null));};exports[_0x45ff('0x51')]=function(_0x5a2264,_0x572353,_0x3caf38){var _0x1a65c5={};var _0x5b481f={};var _0x2dd84b;var _0x2f8d3c;return db[_0x45ff('0x3d')][_0x45ff('0x4b')]({'where':{'id':_0x5a2264[_0x45ff('0x43')]['id']}})[_0x45ff('0x25')](handleEntityNotFound(_0x572353,null))[_0x45ff('0x25')](function(_0x42fa62){if(_0x42fa62){_0x2dd84b=_0x42fa62;_0x5b481f[_0x45ff('0x2f')]=_[_0x45ff('0x44')](db[_0x45ff('0x4c')][_0x45ff('0x2b')]);_0x5b481f['query']=_['keys'](_0x5a2264[_0x45ff('0x30')]);_0x5b481f[_0x45ff('0x31')]=_[_0x45ff('0x32')](_0x5b481f[_0x45ff('0x2f')],_0x5b481f[_0x45ff('0x30')]);_0x1a65c5[_0x45ff('0x34')]=_[_0x45ff('0x32')](_0x5b481f['model'],qs['fields'](_0x5a2264['query'][_0x45ff('0x33')]));_0x1a65c5[_0x45ff('0x34')]=_0x1a65c5[_0x45ff('0x34')][_0x45ff('0x45')]?_0x1a65c5['attributes']:_0x5b481f[_0x45ff('0x2f')];_0x1a65c5[_0x45ff('0x4f')]=qs[_0x45ff('0x36')](_0x5a2264[_0x45ff('0x30')]['sort']);_0x1a65c5[_0x45ff('0x37')]=qs[_0x45ff('0x31')](_[_0x45ff('0x38')](_0x5a2264[_0x45ff('0x30')],_0x5b481f[_0x45ff('0x31')]));if(_0x5a2264[_0x45ff('0x30')]['filter']){_0x1a65c5[_0x45ff('0x37')]=_[_0x45ff('0x3a')](_0x1a65c5[_0x45ff('0x37')],{'$or':_[_0x45ff('0x2a')](_0x1a65c5['attributes'],function(_0x4f59bf){var _0x5e68fe={};_0x5e68fe[_0x4f59bf]={'$like':'%'+_0x5a2264[_0x45ff('0x30')][_0x45ff('0x39')]+'%'};return _0x5e68fe;})});}_0x1a65c5=_[_0x45ff('0x3a')]({},_0x1a65c5,_0x5a2264[_0x45ff('0x3c')]);return _0x2dd84b['getDescriptions'](_0x1a65c5);}})[_0x45ff('0x25')](function(_0x3d0b3d){if(_0x3d0b3d){_0x2f8d3c=_0x3d0b3d['length'];if(!_0x5a2264[_0x45ff('0x30')][_0x45ff('0x50')]('nolimit')){_0x1a65c5['limit']=qs[_0x45ff('0x1e')](_0x5a2264[_0x45ff('0x30')]['limit']);_0x1a65c5['offset']=qs['offset'](_0x5a2264['query'][_0x45ff('0x1c')]);}return _0x2dd84b[_0x45ff('0x51')](_0x1a65c5);}})[_0x45ff('0x25')](function(_0x1d8ef2){if(_0x1d8ef2){return _0x1d8ef2?{'count':_0x2f8d3c,'rows':_0x1d8ef2}:null;}})[_0x45ff('0x25')](respondWithResult(_0x572353,null))[_0x45ff('0x41')](handleError(_0x572353,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c3240c1..74e4228 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 _0xf5c0=['path','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf5c0,0xd7));var _0x0f5c=function(_0x3e85a4,_0x18c3a9){_0x3e85a4=_0x3e85a4-0x0;var _0x21e7d1=_0xf5c0[_0x3e85a4];return _0x21e7d1;};'use strict';var _=require(_0x0f5c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var BPromise=require(_0x0f5c('0x3'));var rp=require(_0x0f5c('0x4'));var fs=require('fs');var path=require(_0x0f5c('0x5'));var rimraf=require(_0x0f5c('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f5c('0x7'));module[_0x0f5c('0x8')]=function(_0xb52f13,_0x55d174){return _0xb52f13['define'](_0x0f5c('0x9'),attributes,{'tableName':_0x0f5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b2a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x22febd,_0x5adef9){var _0x4ef7e4=function(_0xbd9b8c){while(--_0xbd9b8c){_0x22febd['push'](_0x22febd['shift']());}};_0x4ef7e4(++_0x5adef9);}(_0x1b2a,0x121));var _0xa1b2=function(_0x50624f,_0x1e5318){_0x50624f=_0x50624f-0x0;var _0x19f92c=_0x1b2a[_0x50624f];return _0x19f92c;};'use strict';var _=require(_0xa1b2('0x0'));var util=require(_0xa1b2('0x1'));var logger=require(_0xa1b2('0x2'))(_0xa1b2('0x3'));var moment=require(_0xa1b2('0x4'));var BPromise=require(_0xa1b2('0x5'));var rp=require(_0xa1b2('0x6'));var fs=require('fs');var path=require(_0xa1b2('0x7'));var rimraf=require(_0xa1b2('0x8'));var config=require(_0xa1b2('0x9'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xa1b2('0xa')]=function(_0x19b8c6,_0x2d4b1a){return _0x19b8c6[_0xa1b2('0xb')](_0xa1b2('0xc'),attributes,{'tableName':_0xa1b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 6cda28a..22950e1 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 _0xba1a=['../../config/logger','client','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e1ae6,_0x5362cd){var _0x5277f3=function(_0x266e7b){while(--_0x266e7b){_0x4e1ae6['push'](_0x4e1ae6['shift']());}};_0x5277f3(++_0x5362cd);}(_0xba1a,0x65));var _0xaba1=function(_0x40a15f,_0x5ab71a){_0x40a15f=_0x40a15f-0x0;var _0x247ca0=_0xba1a[_0x40a15f];return _0x247ca0;};'use strict';var _=require(_0xaba1('0x0'));var util=require('util');var moment=require(_0xaba1('0x1'));var BPromise=require(_0xaba1('0x2'));var rs=require(_0xaba1('0x3'));var fs=require('fs');var Redis=require(_0xaba1('0x4'));var db=require(_0xaba1('0x5'))['db'];var utils=require(_0xaba1('0x6'));var logger=require(_0xaba1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaba1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae186,_0x54cc2c,_0x3ab6d9){return new BPromise(function(_0x30bf23,_0xa477e6){return client[_0xaba1('0x9')](_0x3ae186,_0x3ab6d9)['then'](function(_0x18136c){logger[_0xaba1('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x54cc2c,_0xaba1('0xb'));logger[_0xaba1('0xc')](_0xaba1('0xd'),_0x54cc2c,_0xaba1('0xb'),JSON[_0xaba1('0xe')](_0x18136c));if(_0x18136c[_0xaba1('0xf')]){if(_0x18136c[_0xaba1('0xf')]['code']===0x1f4){logger[_0xaba1('0xf')](_0xaba1('0x10'),_0x54cc2c,_0x18136c[_0xaba1('0xf')][_0xaba1('0x11')]);return _0xa477e6(_0x18136c[_0xaba1('0xf')][_0xaba1('0x11')]);}logger[_0xaba1('0xf')](_0xaba1('0x10'),_0x54cc2c,_0x18136c[_0xaba1('0xf')][_0xaba1('0x11')]);return _0x30bf23(_0x18136c['error'][_0xaba1('0x11')]);}else{logger['info'](_0xaba1('0x10'),_0x54cc2c,_0xaba1('0xb'));_0x30bf23(_0x18136c['result'][_0xaba1('0x11')]);}})['catch'](function(_0x5b3b33){logger['error'](_0xaba1('0x10'),_0x54cc2c,_0x5b3b33);_0xa477e6(_0x5b3b33);});});} \ No newline at end of file +var _0xc4c6=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4c6,0xe5));var _0x6c4c=function(_0x155ea5,_0x2822fd){_0x155ea5=_0x155ea5-0x0;var _0x2d004c=_0xc4c6[_0x155ea5];return _0x2d004c;};'use strict';var _=require(_0x6c4c('0x0'));var util=require(_0x6c4c('0x1'));var moment=require(_0x6c4c('0x2'));var BPromise=require(_0x6c4c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c4c('0x4'));var db=require(_0x6c4c('0x5'))['db'];var utils=require(_0x6c4c('0x6'));var logger=require(_0x6c4c('0x7'))(_0x6c4c('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c4c('0x9'));var client=jayson[_0x6c4c('0xa')][_0x6c4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46f140,_0x47043b,_0x5f4d8e){return new BPromise(function(_0x362b2a,_0x2c0c54){return client['request'](_0x46f140,_0x5f4d8e)[_0x6c4c('0xc')](function(_0xde2ea2){logger[_0x6c4c('0xd')](_0x6c4c('0xe'),_0x47043b,_0x6c4c('0xf'));logger[_0x6c4c('0x10')](_0x6c4c('0x11'),_0x47043b,_0x6c4c('0xf'),JSON[_0x6c4c('0x12')](_0xde2ea2));if(_0xde2ea2[_0x6c4c('0x13')]){if(_0xde2ea2[_0x6c4c('0x13')]['code']===0x1f4){logger[_0x6c4c('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x47043b,_0xde2ea2['error'][_0x6c4c('0x14')]);return _0x2c0c54(_0xde2ea2['error']['message']);}logger[_0x6c4c('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x47043b,_0xde2ea2[_0x6c4c('0x13')][_0x6c4c('0x14')]);return _0x362b2a(_0xde2ea2['error'][_0x6c4c('0x14')]);}else{logger['info'](_0x6c4c('0xe'),_0x47043b,'request\x20sent');_0x362b2a(_0xde2ea2[_0x6c4c('0x15')][_0x6c4c('0x14')]);}})[_0x6c4c('0x16')](function(_0x9b37eb){logger[_0x6c4c('0x13')](_0x6c4c('0xe'),_0x47043b,_0x9b37eb);_0x2c0c54(_0x9b37eb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f06d3d6..09fd0e2 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 _0x7ca9=['put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','/:id','show','post','create'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x7ca9,0x194));var _0x97ca=function(_0x3e8802,_0x2bd819){_0x3e8802=_0x3e8802-0x0;var _0x26d594=_0x7ca9[_0x3e8802];return _0x26d594;};'use strict';var multer=require(_0x97ca('0x0'));var util=require(_0x97ca('0x1'));var path=require(_0x97ca('0x2'));var timeout=require(_0x97ca('0x3'));var express=require(_0x97ca('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x97ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x97ca('0x6'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x97ca('0x7')](),controller['index']);router['get'](_0x97ca('0x8'),auth['isAuthenticated'](),controller[_0x97ca('0x9')]);router[_0x97ca('0xa')]('/',auth[_0x97ca('0x7')](),controller[_0x97ca('0xb')]);router[_0x97ca('0xc')](_0x97ca('0x8'),auth['isAuthenticated'](),controller[_0x97ca('0xd')]);router[_0x97ca('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x97ca('0xf')]=router; \ No newline at end of file +var _0x5b7b=['./intSugarcrmField.controller','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5b7b,0x191));var _0xb5b7=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0x5b7b[_0xbf8ec1];return _0xc84567;};'use strict';var multer=require(_0xb5b7('0x0'));var util=require(_0xb5b7('0x1'));var path=require(_0xb5b7('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5b7('0x3'));var router=express[_0xb5b7('0x4')]();var fs_extra=require(_0xb5b7('0x5'));var auth=require(_0xb5b7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb5b7('0x7'));router['get']('/',auth[_0xb5b7('0x8')](),controller[_0xb5b7('0x9')]);router['get'](_0xb5b7('0xa'),auth[_0xb5b7('0x8')](),controller['show']);router[_0xb5b7('0xb')]('/',auth[_0xb5b7('0x8')](),controller[_0xb5b7('0xc')]);router[_0xb5b7('0xd')](_0xb5b7('0xa'),auth[_0xb5b7('0x8')](),controller['update']);router[_0xb5b7('0xe')](_0xb5b7('0xa'),auth[_0xb5b7('0x8')](),controller[_0xb5b7('0xf')]);module[_0xb5b7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 4f36488..91de059 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 _0x46d7=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0xef9f7f,_0x259a17){var _0x6ca606=function(_0x1c200f){while(--_0x1c200f){_0xef9f7f['push'](_0xef9f7f['shift']());}};_0x6ca606(++_0x259a17);}(_0x46d7,0x16b));var _0x746d=function(_0x4b88d8,_0x288f14){_0x4b88d8=_0x4b88d8-0x0;var _0x161dd2=_0x46d7[_0x4b88d8];return _0x161dd2;};'use strict';var Sequelize=require(_0x746d('0x0'));module['exports']={'type':{'type':Sequelize[_0x746d('0x1')](_0x746d('0x2'),_0x746d('0x3'),_0x746d('0x4'),_0x746d('0x5'),_0x746d('0x6')),'defaultValue':_0x746d('0x2')},'content':{'type':Sequelize[_0x746d('0x7')]},'key':{'type':Sequelize[_0x746d('0x7')]},'keyType':{'type':Sequelize[_0x746d('0x1')](_0x746d('0x2'),_0x746d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x746d('0x7')]},'idField':{'type':Sequelize[_0x746d('0x7')]},'nameField':{'type':Sequelize[_0x746d('0x7')]},'customField':{'type':Sequelize[_0x746d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7c16=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3e226d,_0x3c23bd){var _0x40892c=function(_0x141162){while(--_0x141162){_0x3e226d['push'](_0x3e226d['shift']());}};_0x40892c(++_0x3c23bd);}(_0x7c16,0x1df));var _0x67c1=function(_0x3b58e2,_0x4fbf5f){_0x3b58e2=_0x3b58e2-0x0;var _0x5a6677=_0x7c16[_0x3b58e2];return _0x5a6677;};'use strict';var Sequelize=require(_0x67c1('0x0'));module[_0x67c1('0x1')]={'type':{'type':Sequelize[_0x67c1('0x2')](_0x67c1('0x3'),_0x67c1('0x4'),_0x67c1('0x5'),'keyValue',_0x67c1('0x6')),'defaultValue':_0x67c1('0x3')},'content':{'type':Sequelize[_0x67c1('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x67c1('0x2')]('string',_0x67c1('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x67c1('0x7')]},'idField':{'type':Sequelize[_0x67c1('0x7')]},'nameField':{'type':Sequelize[_0x67c1('0x7')]},'customField':{'type':Sequelize[_0x67c1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x67c1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index e072bb3..6da3847 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 _0xe6bc=['key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','rawAttributes','fields','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','SugarcrmField','type'];(function(_0x597f3d,_0x116916){var _0x4ca86e=function(_0x2bb489){while(--_0x2bb489){_0x597f3d['push'](_0x597f3d['shift']());}};_0x4ca86e(++_0x116916);}(_0xe6bc,0x1e9));var _0xce6b=function(_0x1727f8,_0x1fbd8d){_0x1727f8=_0x1727f8-0x0;var _0x29014e=_0xe6bc[_0x1727f8];return _0x29014e;};'use strict';var emlformat=require(_0xce6b('0x0'));var rimraf=require(_0xce6b('0x1'));var zipdir=require(_0xce6b('0x2'));var jsonpatch=require(_0xce6b('0x3'));var rp=require(_0xce6b('0x4'));var moment=require(_0xce6b('0x5'));var BPromise=require(_0xce6b('0x6'));var Mustache=require(_0xce6b('0x7'));var util=require(_0xce6b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xce6b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce6b('0xa'));var squel=require(_0xce6b('0xb'));var crypto=require(_0xce6b('0xc'));var jsforce=require(_0xce6b('0xd'));var deskjs=require(_0xce6b('0xe'));var toCsv=require(_0xce6b('0x9'));var querystring=require(_0xce6b('0xf'));var Papa=require(_0xce6b('0x10'));var Redis=require(_0xce6b('0x11'));var authService=require(_0xce6b('0x12'));var qs=require(_0xce6b('0x13'));var as=require(_0xce6b('0x14'));var hardwareService=require(_0xce6b('0x15'));var logger=require(_0xce6b('0x16'))(_0xce6b('0x17'));var utils=require(_0xce6b('0x18'));var config=require(_0xce6b('0x19'));var licenseUtil=require(_0xce6b('0x1a'));var db=require(_0xce6b('0x1b'))['db'];function respondWithStatusCode(_0x48794d,_0x44e56f){_0x44e56f=_0x44e56f||0xcc;return function(_0x33d068){if(_0x33d068){return _0x48794d['sendStatus'](_0x44e56f);}return _0x48794d['status'](_0x44e56f)[_0xce6b('0x1c')]();};}function respondWithResult(_0x1a7ec7,_0x1fc0b6){_0x1fc0b6=_0x1fc0b6||0xc8;return function(_0x3c36c7){if(_0x3c36c7){return _0x1a7ec7[_0xce6b('0x1d')](_0x1fc0b6)[_0xce6b('0x1e')](_0x3c36c7);}};}function respondWithFilteredResult(_0x385fcb,_0x1ab3d1){return function(_0x5b7114){if(_0x5b7114){var _0x5269f0=typeof _0x1ab3d1[_0xce6b('0x1f')]===_0xce6b('0x20')&&typeof _0x1ab3d1[_0xce6b('0x21')]===_0xce6b('0x20');var _0x3526a5=_0x5b7114[_0xce6b('0x22')];var _0x17e688=_0x5269f0?0x0:_0x1ab3d1[_0xce6b('0x1f')];var _0x5c15ef=_0x5269f0?_0x5b7114[_0xce6b('0x22')]:_0x1ab3d1[_0xce6b('0x1f')]+_0x1ab3d1['limit'];var _0x5e5142;if(_0x5c15ef>=_0x3526a5){_0x5c15ef=_0x3526a5;_0x5e5142=0xc8;}else{_0x5e5142=0xce;}_0x385fcb[_0xce6b('0x1d')](_0x5e5142);return _0x385fcb[_0xce6b('0x23')](_0xce6b('0x24'),_0x17e688+'-'+_0x5c15ef+'/'+_0x3526a5)[_0xce6b('0x1e')](_0x5b7114);}return null;};}function patchUpdates(_0x19d17f){return function(_0x1c6c42){try{jsonpatch[_0xce6b('0x25')](_0x1c6c42,_0x19d17f,!![]);}catch(_0x603b10){return BPromise['reject'](_0x603b10);}return _0x1c6c42[_0xce6b('0x26')]();};}function saveUpdates(_0x374475,_0x21bb93){return function(_0x40ac6f){if(_0x40ac6f){return _0x40ac6f[_0xce6b('0x27')](_0x374475)[_0xce6b('0x28')](function(_0x5a03f2){return _0x5a03f2;});}return null;};}function removeEntity(_0x226855,_0x26a197){return function(_0x42f90e){if(_0x42f90e){return _0x42f90e[_0xce6b('0x29')]()[_0xce6b('0x28')](function(){_0x226855['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x282167,_0x1def24){return function(_0x43008b){if(!_0x43008b){_0x282167[_0xce6b('0x2a')](0x194);}return _0x43008b;};}function handleError(_0xc4084c,_0xaf3768){_0xaf3768=_0xaf3768||0x1f4;return function(_0x39aa63){logger[_0xce6b('0x2b')](_0x39aa63[_0xce6b('0x2c')]);if(_0x39aa63[_0xce6b('0x2d')]){delete _0x39aa63['name'];}_0xc4084c[_0xce6b('0x1d')](_0xaf3768)[_0xce6b('0x2e')](_0x39aa63);};}exports['index']=function(_0x55d97a,_0x3781f7){var _0x31ed37={},_0x5c6abf={},_0x36ca65={'count':0x0,'rows':[]};var _0x35117a=_[_0xce6b('0x2f')](db[_0xce6b('0x30')]['rawAttributes'],function(_0x17ef03){return{'name':_0x17ef03['fieldName'],'type':_0x17ef03[_0xce6b('0x31')][_0xce6b('0x32')]};});_0x5c6abf['model']=_[_0xce6b('0x2f')](_0x35117a,_0xce6b('0x2d'));_0x5c6abf[_0xce6b('0x33')]=_[_0xce6b('0x34')](_0x55d97a[_0xce6b('0x33')]);_0x5c6abf[_0xce6b('0x35')]=_[_0xce6b('0x36')](_0x5c6abf[_0xce6b('0x37')],_0x5c6abf[_0xce6b('0x33')]);_0x31ed37[_0xce6b('0x38')]=_[_0xce6b('0x36')](_0x5c6abf[_0xce6b('0x37')],qs['fields'](_0x55d97a[_0xce6b('0x33')]['fields']));_0x31ed37[_0xce6b('0x38')]=_0x31ed37[_0xce6b('0x38')][_0xce6b('0x39')]?_0x31ed37[_0xce6b('0x38')]:_0x5c6abf[_0xce6b('0x37')];if(!_0x55d97a[_0xce6b('0x33')][_0xce6b('0x3a')](_0xce6b('0x3b'))){_0x31ed37[_0xce6b('0x21')]=qs[_0xce6b('0x21')](_0x55d97a[_0xce6b('0x33')][_0xce6b('0x21')]);_0x31ed37['offset']=qs[_0xce6b('0x1f')](_0x55d97a['query'][_0xce6b('0x1f')]);}_0x31ed37[_0xce6b('0x3c')]=qs[_0xce6b('0x3d')](_0x55d97a[_0xce6b('0x33')][_0xce6b('0x3d')]);_0x31ed37[_0xce6b('0x3e')]=qs[_0xce6b('0x35')](_[_0xce6b('0x3f')](_0x55d97a[_0xce6b('0x33')],_0x5c6abf[_0xce6b('0x35')]),_0x35117a);if(_0x55d97a['query']['filter']){_0x31ed37['where']=_[_0xce6b('0x40')](_0x31ed37[_0xce6b('0x3e')],{'$or':_[_0xce6b('0x2f')](_0x35117a,function(_0x364d82){if(_0x364d82['type']!=='VIRTUAL'){var _0x33bd68={};_0x33bd68[_0x364d82['name']]={'$like':'%'+_0x55d97a['query'][_0xce6b('0x41')]+'%'};return _0x33bd68;}})});}_0x31ed37=_[_0xce6b('0x40')]({},_0x31ed37,_0x55d97a[_0xce6b('0x42')]);var _0x105d21={'where':_0x31ed37[_0xce6b('0x3e')]};return db['SugarcrmField'][_0xce6b('0x22')](_0x105d21)[_0xce6b('0x28')](function(_0xa99e0e){_0x36ca65['count']=_0xa99e0e;if(_0x55d97a[_0xce6b('0x33')][_0xce6b('0x43')]){_0x31ed37[_0xce6b('0x44')]=[{'all':!![]}];}return db['SugarcrmField'][_0xce6b('0x45')](_0x31ed37);})['then'](function(_0x4437c9){_0x36ca65['rows']=_0x4437c9;return _0x36ca65;})[_0xce6b('0x28')](respondWithFilteredResult(_0x3781f7,_0x31ed37))['catch'](handleError(_0x3781f7,null));};exports['show']=function(_0x122a7a,_0x5cc114){var _0x16a244={'raw':!![],'where':{'id':_0x122a7a[_0xce6b('0x46')]['id']}},_0x59ccc5={};_0x59ccc5[_0xce6b('0x37')]=_[_0xce6b('0x34')](db[_0xce6b('0x30')][_0xce6b('0x47')]);_0x59ccc5[_0xce6b('0x33')]=_['keys'](_0x122a7a[_0xce6b('0x33')]);_0x59ccc5[_0xce6b('0x35')]=_[_0xce6b('0x36')](_0x59ccc5[_0xce6b('0x37')],_0x59ccc5[_0xce6b('0x33')]);_0x16a244[_0xce6b('0x38')]=_['intersection'](_0x59ccc5[_0xce6b('0x37')],qs[_0xce6b('0x48')](_0x122a7a[_0xce6b('0x33')][_0xce6b('0x48')]));_0x16a244[_0xce6b('0x38')]=_0x16a244[_0xce6b('0x38')]['length']?_0x16a244[_0xce6b('0x38')]:_0x59ccc5[_0xce6b('0x37')];if(_0x122a7a[_0xce6b('0x33')]['includeAll']){_0x16a244[_0xce6b('0x44')]=[{'all':!![]}];}_0x16a244=_[_0xce6b('0x40')]({},_0x16a244,_0x122a7a[_0xce6b('0x42')]);return db['SugarcrmField'][_0xce6b('0x49')](_0x16a244)[_0xce6b('0x28')](handleEntityNotFound(_0x5cc114,null))['then'](respondWithResult(_0x5cc114,null))[_0xce6b('0x4a')](handleError(_0x5cc114,null));};exports[_0xce6b('0x4b')]=function(_0xcaebdd,_0x2d9503){return db[_0xce6b('0x30')][_0xce6b('0x4b')](_0xcaebdd[_0xce6b('0x4c')],{})[_0xce6b('0x28')](respondWithResult(_0x2d9503,0xc9))['catch'](handleError(_0x2d9503,null));};exports['update']=function(_0x532741,_0x4aef5f){if(_0x532741[_0xce6b('0x4c')]['id']){delete _0x532741[_0xce6b('0x4c')]['id'];}return db[_0xce6b('0x30')]['find']({'where':{'id':_0x532741[_0xce6b('0x46')]['id']}})['then'](handleEntityNotFound(_0x4aef5f,null))[_0xce6b('0x28')](saveUpdates(_0x532741[_0xce6b('0x4c')],null))[_0xce6b('0x28')](respondWithResult(_0x4aef5f,null))[_0xce6b('0x4a')](handleError(_0x4aef5f,null));};exports['destroy']=function(_0xd52c06,_0x41cbd4){return db[_0xce6b('0x30')]['find']({'where':{'id':_0xd52c06['params']['id']}})[_0xce6b('0x28')](handleEntityNotFound(_0x41cbd4,null))[_0xce6b('0x28')](removeEntity(_0x41cbd4,null))['catch'](handleError(_0x41cbd4,null));}; \ No newline at end of file +var _0x673a=['index','map','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','status'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x673a,0x159));var _0xa673=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x673a[_0x3a0c4f];return _0x247049;};'use strict';var emlformat=require(_0xa673('0x0'));var rimraf=require(_0xa673('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa673('0x2'));var rp=require(_0xa673('0x3'));var moment=require(_0xa673('0x4'));var BPromise=require(_0xa673('0x5'));var Mustache=require(_0xa673('0x6'));var util=require(_0xa673('0x7'));var path=require('path');var sox=require(_0xa673('0x8'));var csv=require(_0xa673('0x9'));var ejs=require(_0xa673('0xa'));var fs=require('fs');var fs_extra=require(_0xa673('0xb'));var _=require('lodash');var squel=require(_0xa673('0xc'));var crypto=require(_0xa673('0xd'));var jsforce=require(_0xa673('0xe'));var deskjs=require(_0xa673('0xf'));var toCsv=require(_0xa673('0x9'));var querystring=require(_0xa673('0x10'));var Papa=require(_0xa673('0x11'));var Redis=require(_0xa673('0x12'));var authService=require(_0xa673('0x13'));var qs=require(_0xa673('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa673('0x15'));var logger=require(_0xa673('0x16'))(_0xa673('0x17'));var utils=require(_0xa673('0x18'));var config=require(_0xa673('0x19'));var licenseUtil=require(_0xa673('0x1a'));var db=require(_0xa673('0x1b'))['db'];function respondWithStatusCode(_0x44d465,_0x201054){_0x201054=_0x201054||0xcc;return function(_0x4d52cf){if(_0x4d52cf){return _0x44d465[_0xa673('0x1c')](_0x201054);}return _0x44d465['status'](_0x201054)[_0xa673('0x1d')]();};}function respondWithResult(_0x46a0ec,_0x13ebc){_0x13ebc=_0x13ebc||0xc8;return function(_0x1b69c8){if(_0x1b69c8){return _0x46a0ec['status'](_0x13ebc)[_0xa673('0x1e')](_0x1b69c8);}};}function respondWithFilteredResult(_0x5a934a,_0x1233cd){return function(_0x561417){if(_0x561417){var _0x4c01fa=typeof _0x1233cd['offset']===_0xa673('0x1f')&&typeof _0x1233cd[_0xa673('0x20')]===_0xa673('0x1f');var _0x1cc2f4=_0x561417[_0xa673('0x21')];var _0x1b4451=_0x4c01fa?0x0:_0x1233cd[_0xa673('0x22')];var _0x410ac4=_0x4c01fa?_0x561417[_0xa673('0x21')]:_0x1233cd[_0xa673('0x22')]+_0x1233cd['limit'];var _0x15ecd6;if(_0x410ac4>=_0x1cc2f4){_0x410ac4=_0x1cc2f4;_0x15ecd6=0xc8;}else{_0x15ecd6=0xce;}_0x5a934a['status'](_0x15ecd6);return _0x5a934a[_0xa673('0x23')](_0xa673('0x24'),_0x1b4451+'-'+_0x410ac4+'/'+_0x1cc2f4)[_0xa673('0x1e')](_0x561417);}return null;};}function patchUpdates(_0x555a19){return function(_0x4a8b67){try{jsonpatch[_0xa673('0x25')](_0x4a8b67,_0x555a19,!![]);}catch(_0x1963c5){return BPromise['reject'](_0x1963c5);}return _0x4a8b67[_0xa673('0x26')]();};}function saveUpdates(_0x389361,_0x49b46f){return function(_0x56b694){if(_0x56b694){return _0x56b694[_0xa673('0x27')](_0x389361)['then'](function(_0x2b5346){return _0x2b5346;});}return null;};}function removeEntity(_0x422219,_0x3fb10a){return function(_0x5e99e3){if(_0x5e99e3){return _0x5e99e3['destroy']()[_0xa673('0x28')](function(){_0x422219['status'](0xcc)[_0xa673('0x1d')]();});}};}function handleEntityNotFound(_0x1973f9,_0x27d30f){return function(_0x1e55d3){if(!_0x1e55d3){_0x1973f9[_0xa673('0x1c')](0x194);}return _0x1e55d3;};}function handleError(_0x4cd181,_0x2a6610){_0x2a6610=_0x2a6610||0x1f4;return function(_0x5101c3){logger[_0xa673('0x29')](_0x5101c3[_0xa673('0x2a')]);if(_0x5101c3[_0xa673('0x2b')]){delete _0x5101c3['name'];}_0x4cd181[_0xa673('0x2c')](_0x2a6610)['send'](_0x5101c3);};}exports[_0xa673('0x2d')]=function(_0x38ab65,_0xc02684){var _0x226c7a={},_0x412f9e={},_0x51a0b1={'count':0x0,'rows':[]};var _0x4a9795=_[_0xa673('0x2e')](db['SugarcrmField']['rawAttributes'],function(_0x4b515e){return{'name':_0x4b515e['fieldName'],'type':_0x4b515e[_0xa673('0x2f')][_0xa673('0x30')]};});_0x412f9e['model']=_[_0xa673('0x2e')](_0x4a9795,_0xa673('0x2b'));_0x412f9e[_0xa673('0x31')]=_[_0xa673('0x32')](_0x38ab65[_0xa673('0x31')]);_0x412f9e[_0xa673('0x33')]=_['intersection'](_0x412f9e['model'],_0x412f9e['query']);_0x226c7a[_0xa673('0x34')]=_[_0xa673('0x35')](_0x412f9e[_0xa673('0x36')],qs['fields'](_0x38ab65[_0xa673('0x31')][_0xa673('0x37')]));_0x226c7a[_0xa673('0x34')]=_0x226c7a[_0xa673('0x34')][_0xa673('0x38')]?_0x226c7a[_0xa673('0x34')]:_0x412f9e[_0xa673('0x36')];if(!_0x38ab65[_0xa673('0x31')][_0xa673('0x39')](_0xa673('0x3a'))){_0x226c7a[_0xa673('0x20')]=qs[_0xa673('0x20')](_0x38ab65[_0xa673('0x31')]['limit']);_0x226c7a[_0xa673('0x22')]=qs['offset'](_0x38ab65['query']['offset']);}_0x226c7a['order']=qs[_0xa673('0x3b')](_0x38ab65['query']['sort']);_0x226c7a[_0xa673('0x3c')]=qs[_0xa673('0x33')](_[_0xa673('0x3d')](_0x38ab65[_0xa673('0x31')],_0x412f9e[_0xa673('0x33')]),_0x4a9795);if(_0x38ab65[_0xa673('0x31')][_0xa673('0x3e')]){_0x226c7a['where']=_[_0xa673('0x3f')](_0x226c7a[_0xa673('0x3c')],{'$or':_[_0xa673('0x2e')](_0x4a9795,function(_0x52b134){if(_0x52b134[_0xa673('0x2f')]!==_0xa673('0x40')){var _0x3b9d1b={};_0x3b9d1b[_0x52b134[_0xa673('0x2b')]]={'$like':'%'+_0x38ab65[_0xa673('0x31')][_0xa673('0x3e')]+'%'};return _0x3b9d1b;}})});}_0x226c7a=_['merge']({},_0x226c7a,_0x38ab65[_0xa673('0x41')]);var _0x2cf08f={'where':_0x226c7a[_0xa673('0x3c')]};return db[_0xa673('0x42')][_0xa673('0x21')](_0x2cf08f)[_0xa673('0x28')](function(_0x5ee09a){_0x51a0b1[_0xa673('0x21')]=_0x5ee09a;if(_0x38ab65[_0xa673('0x31')][_0xa673('0x43')]){_0x226c7a[_0xa673('0x44')]=[{'all':!![]}];}return db['SugarcrmField'][_0xa673('0x45')](_0x226c7a);})['then'](function(_0x73fda6){_0x51a0b1[_0xa673('0x46')]=_0x73fda6;return _0x51a0b1;})[_0xa673('0x28')](respondWithFilteredResult(_0xc02684,_0x226c7a))[_0xa673('0x47')](handleError(_0xc02684,null));};exports['show']=function(_0xbe9998,_0x174ad1){var _0x20110c={'raw':!![],'where':{'id':_0xbe9998[_0xa673('0x48')]['id']}},_0x5e0a13={};_0x5e0a13[_0xa673('0x36')]=_[_0xa673('0x32')](db[_0xa673('0x42')][_0xa673('0x49')]);_0x5e0a13['query']=_['keys'](_0xbe9998[_0xa673('0x31')]);_0x5e0a13[_0xa673('0x33')]=_[_0xa673('0x35')](_0x5e0a13['model'],_0x5e0a13['query']);_0x20110c[_0xa673('0x34')]=_['intersection'](_0x5e0a13['model'],qs[_0xa673('0x37')](_0xbe9998['query'][_0xa673('0x37')]));_0x20110c['attributes']=_0x20110c[_0xa673('0x34')][_0xa673('0x38')]?_0x20110c['attributes']:_0x5e0a13['model'];if(_0xbe9998[_0xa673('0x31')][_0xa673('0x43')]){_0x20110c[_0xa673('0x44')]=[{'all':!![]}];}_0x20110c=_[_0xa673('0x3f')]({},_0x20110c,_0xbe9998[_0xa673('0x41')]);return db[_0xa673('0x42')][_0xa673('0x4a')](_0x20110c)[_0xa673('0x28')](handleEntityNotFound(_0x174ad1,null))['then'](respondWithResult(_0x174ad1,null))['catch'](handleError(_0x174ad1,null));};exports[_0xa673('0x4b')]=function(_0x1eea43,_0x682dfe){return db[_0xa673('0x42')][_0xa673('0x4b')](_0x1eea43[_0xa673('0x4c')],{})['then'](respondWithResult(_0x682dfe,0xc9))[_0xa673('0x47')](handleError(_0x682dfe,null));};exports[_0xa673('0x27')]=function(_0x9607be,_0x1ad88e){if(_0x9607be[_0xa673('0x4c')]['id']){delete _0x9607be['body']['id'];}return db[_0xa673('0x42')][_0xa673('0x4a')]({'where':{'id':_0x9607be['params']['id']}})[_0xa673('0x28')](handleEntityNotFound(_0x1ad88e,null))[_0xa673('0x28')](saveUpdates(_0x9607be['body'],null))[_0xa673('0x28')](respondWithResult(_0x1ad88e,null))['catch'](handleError(_0x1ad88e,null));};exports[_0xa673('0x4d')]=function(_0xaef497,_0x424a1e){return db[_0xa673('0x42')][_0xa673('0x4a')]({'where':{'id':_0xaef497[_0xa673('0x48')]['id']}})[_0xa673('0x28')](handleEntityNotFound(_0x424a1e,null))[_0xa673('0x28')](removeEntity(_0x424a1e,null))['catch'](handleError(_0x424a1e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cf73e3f..604c9ad 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 _0x9752=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x4404cf,_0x4f9707){var _0x5a96fa=function(_0x38d140){while(--_0x38d140){_0x4404cf['push'](_0x4404cf['shift']());}};_0x5a96fa(++_0x4f9707);}(_0x9752,0x181));var _0x2975=function(_0x5af417,_0x3874d9){_0x5af417=_0x5af417-0x0;var _0x5de422=_0x9752[_0x5af417];return _0x5de422;};'use strict';var _=require(_0x2975('0x0'));var util=require(_0x2975('0x1'));var logger=require(_0x2975('0x2'))(_0x2975('0x3'));var moment=require(_0x2975('0x4'));var BPromise=require(_0x2975('0x5'));var rp=require(_0x2975('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2975('0x7'));var config=require(_0x2975('0x8'));var attributes=require(_0x2975('0x9'));module[_0x2975('0xa')]=function(_0x408884,_0x313c3a){return _0x408884[_0x2975('0xb')]('SugarcrmField',attributes,{'tableName':_0x2975('0xc'),'paranoid':![],'indexes':[{'name':_0x2975('0xd'),'fields':[_0x2975('0xe'),_0x2975('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0158=['sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x0158,0xaa));var _0x8015=function(_0x524ee8,_0x956e94){_0x524ee8=_0x524ee8-0x0;var _0x113690=_0x0158[_0x524ee8];return _0x113690;};'use strict';var _=require(_0x8015('0x0'));var util=require(_0x8015('0x1'));var logger=require(_0x8015('0x2'))(_0x8015('0x3'));var moment=require(_0x8015('0x4'));var BPromise=require(_0x8015('0x5'));var rp=require(_0x8015('0x6'));var fs=require('fs');var path=require(_0x8015('0x7'));var rimraf=require('rimraf');var config=require(_0x8015('0x8'));var attributes=require(_0x8015('0x9'));module['exports']=function(_0x32ff5b,_0x5ab9b7){return _0x32ff5b['define'](_0x8015('0xa'),attributes,{'tableName':_0x8015('0xb'),'paranoid':![],'indexes':[{'name':_0x8015('0xc'),'fields':['idField',_0x8015('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 50c0b17..c19b556 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 _0x2d2c=['message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3a0631,_0x2d8a7e){var _0x44bdf0=function(_0x3d5b19){while(--_0x3d5b19){_0x3a0631['push'](_0x3a0631['shift']());}};_0x44bdf0(++_0x2d8a7e);}(_0x2d2c,0x168));var _0xc2d2=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x2d2c[_0x509273];return _0x38ef40;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var moment=require('moment');var BPromise=require(_0xc2d2('0x2'));var rs=require(_0xc2d2('0x3'));var fs=require('fs');var Redis=require(_0xc2d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc2d2('0x5'))(_0xc2d2('0x6'));var config=require(_0xc2d2('0x7'));var jayson=require(_0xc2d2('0x8'));var client=jayson['client'][_0xc2d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50f9e0,_0x3e8b32,_0x5eb984){return new BPromise(function(_0x2c939d,_0x2f5610){return client[_0xc2d2('0xa')](_0x50f9e0,_0x5eb984)[_0xc2d2('0xb')](function(_0x4b875e){logger['info'](_0xc2d2('0xc'),_0x3e8b32,_0xc2d2('0xd'));logger[_0xc2d2('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3e8b32,_0xc2d2('0xd'),JSON[_0xc2d2('0xf')](_0x4b875e));if(_0x4b875e[_0xc2d2('0x10')]){if(_0x4b875e[_0xc2d2('0x10')][_0xc2d2('0x11')]===0x1f4){logger[_0xc2d2('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x3e8b32,_0x4b875e[_0xc2d2('0x10')]['message']);return _0x2f5610(_0x4b875e[_0xc2d2('0x10')][_0xc2d2('0x12')]);}logger['error'](_0xc2d2('0xc'),_0x3e8b32,_0x4b875e[_0xc2d2('0x10')]['message']);return _0x2c939d(_0x4b875e[_0xc2d2('0x10')][_0xc2d2('0x12')]);}else{logger[_0xc2d2('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x3e8b32,_0xc2d2('0xd'));_0x2c939d(_0x4b875e['result'][_0xc2d2('0x12')]);}})[_0xc2d2('0x14')](function(_0x3472ab){logger[_0xc2d2('0x10')](_0xc2d2('0xc'),_0x3e8b32,_0x3472ab);_0x2f5610(_0x3472ab);});});} \ No newline at end of file +var _0x44a1=['then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xee5cf1,_0x576ae9){var _0x22b513=function(_0x7376e7){while(--_0x7376e7){_0xee5cf1['push'](_0xee5cf1['shift']());}};_0x22b513(++_0x576ae9);}(_0x44a1,0xec));var _0x144a=function(_0x2fb6be,_0x35d3cc){_0x2fb6be=_0x2fb6be-0x0;var _0x5aac38=_0x44a1[_0x2fb6be];return _0x5aac38;};'use strict';var _=require(_0x144a('0x0'));var util=require(_0x144a('0x1'));var moment=require(_0x144a('0x2'));var BPromise=require(_0x144a('0x3'));var rs=require(_0x144a('0x4'));var fs=require('fs');var Redis=require(_0x144a('0x5'));var db=require(_0x144a('0x6'))['db'];var utils=require(_0x144a('0x7'));var logger=require('../../config/logger')(_0x144a('0x8'));var config=require(_0x144a('0x9'));var jayson=require(_0x144a('0xa'));var client=jayson[_0x144a('0xb')][_0x144a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2887bf,_0x275d32,_0x39b040){return new BPromise(function(_0x4782dc,_0x4ed35b){return client[_0x144a('0xd')](_0x2887bf,_0x39b040)[_0x144a('0xe')](function(_0x2d242f){logger[_0x144a('0xf')](_0x144a('0x10'),_0x275d32,_0x144a('0x11'));logger[_0x144a('0x12')](_0x144a('0x13'),_0x275d32,_0x144a('0x11'),JSON[_0x144a('0x14')](_0x2d242f));if(_0x2d242f[_0x144a('0x15')]){if(_0x2d242f[_0x144a('0x15')][_0x144a('0x16')]===0x1f4){logger[_0x144a('0x15')]('SugarcrmField,\x20%s,\x20%s',_0x275d32,_0x2d242f[_0x144a('0x15')][_0x144a('0x17')]);return _0x4ed35b(_0x2d242f['error'][_0x144a('0x17')]);}logger[_0x144a('0x15')]('SugarcrmField,\x20%s,\x20%s',_0x275d32,_0x2d242f['error'][_0x144a('0x17')]);return _0x4782dc(_0x2d242f[_0x144a('0x15')][_0x144a('0x17')]);}else{logger[_0x144a('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x275d32,'request\x20sent');_0x4782dc(_0x2d242f['result']['message']);}})[_0x144a('0x18')](function(_0x206af8){logger[_0x144a('0x15')](_0x144a('0x10'),_0x275d32,_0x206af8);_0x4ed35b(_0x206af8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 8009b49..07a02e5 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 _0x1eaa=['connect-timeout','express','fs-extra','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','/:id','update','delete','exports','multer'];(function(_0x16dc15,_0x5188db){var _0x58da19=function(_0x12f660){while(--_0x12f660){_0x16dc15['push'](_0x16dc15['shift']());}};_0x58da19(++_0x5188db);}(_0x1eaa,0x1c7));var _0xa1ea=function(_0x52af0a,_0x2a86e3){_0x52af0a=_0x52af0a-0x0;var _0x2bfc96=_0x1eaa[_0x52af0a];return _0x2bfc96;};'use strict';var multer=require(_0xa1ea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa1ea('0x1'));var express=require(_0xa1ea('0x2'));var router=express['Router']();var fs_extra=require(_0xa1ea('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa1ea('0x4'));var controller=require(_0xa1ea('0x5'));router['get']('/',auth[_0xa1ea('0x6')](),controller[_0xa1ea('0x7')]);router[_0xa1ea('0x8')]('/:id',auth[_0xa1ea('0x6')](),controller['show']);router['get'](_0xa1ea('0x9'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0xa')]);router[_0xa1ea('0x8')](_0xa1ea('0xb'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0xc')]);router['post']('/',auth[_0xa1ea('0x6')](),controller['create']);router['post'](_0xa1ea('0x9'),auth['isAuthenticated'](),controller[_0xa1ea('0xd')]);router[_0xa1ea('0xe')](_0xa1ea('0xf'),auth[_0xa1ea('0x6')](),controller[_0xa1ea('0x10')]);router[_0xa1ea('0x11')](_0xa1ea('0xf'),auth[_0xa1ea('0x6')](),controller['destroy']);module[_0xa1ea('0x12')]=router; \ No newline at end of file +var _0xe1f0=['/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','/:id/configurations'];(function(_0x19c502,_0x1450e9){var _0x5c3b1c=function(_0x35039d){while(--_0x35039d){_0x19c502['push'](_0x19c502['shift']());}};_0x5c3b1c(++_0x1450e9);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x11da44,_0xad2700){_0x11da44=_0x11da44-0x0;var _0x468b5d=_0xe1f0[_0x11da44];return _0x468b5d;};'use strict';var multer=require('multer');var util=require(_0x0e1f('0x0'));var path=require(_0x0e1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e1f('0x2'));var router=express[_0x0e1f('0x3')]();var fs_extra=require(_0x0e1f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var controller=require(_0x0e1f('0x7'));router['get']('/',auth[_0x0e1f('0x8')](),controller['index']);router[_0x0e1f('0x9')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller['show']);router['get'](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller['getConfigurations']);router[_0x0e1f('0x9')](_0x0e1f('0xc'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xd')]);router[_0x0e1f('0xe')]('/',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xf')]);router[_0x0e1f('0xe')](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x10')]);router[_0x0e1f('0x11')]('/:id',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x12')]);router[_0x0e1f('0x13')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x14')]);module[_0x0e1f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a66bebf..b1cb3fc 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 _0x463e=['exports','STRING','sequelize'];(function(_0x230457,_0x17efa8){var _0x3118d8=function(_0x2fa43d){while(--_0x2fa43d){_0x230457['push'](_0x230457['shift']());}};_0x3118d8(++_0x17efa8);}(_0x463e,0xa4));var _0xe463=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x463e[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0xe463('0x0'));module[_0xe463('0x1')]={'name':{'type':Sequelize[_0xe463('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe463('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe463('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xe463('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe463('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe463('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc272=['STRING','HelpDesk','sequelize','exports'];(function(_0x1161d6,_0x2f9924){var _0x1e4163=function(_0x1735c8){while(--_0x1735c8){_0x1161d6['push'](_0x1161d6['shift']());}};_0x1e4163(++_0x2f9924);}(_0xc272,0xee));var _0x2c27=function(_0x708c47,_0x6eaa1f){_0x708c47=_0x708c47-0x0;var _0x52a470=_0xc272[_0x708c47];return _0x52a470;};'use strict';var Sequelize=require(_0x2c27('0x0'));module[_0x2c27('0x1')]={'name':{'type':Sequelize[_0x2c27('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2c27('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c27('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2c27('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2c27('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 424f722..a7360f8 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 _0x6dcc=['test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VtigerAccount','include','rows','catch','show','params','keys','includeAll','options','find','body','getConfigurations','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','create','VtigerField','Descriptions','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','result','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','cf_','picklist','picklistValues','log','vTiger\x20error:\x20'];(function(_0x5c2871,_0x9f21e6){var _0x4d962d=function(_0x4069dc){while(--_0x4069dc){_0x5c2871['push'](_0x5c2871['shift']());}};_0x4d962d(++_0x9f21e6);}(_0x6dcc,0xf1));var _0xc6dc=function(_0x124f8a,_0x117c26){_0x124f8a=_0x124f8a-0x0;var _0x50c557=_0x6dcc[_0x124f8a];return _0x50c557;};'use strict';var emlformat=require(_0xc6dc('0x0'));var rimraf=require(_0xc6dc('0x1'));var zipdir=require(_0xc6dc('0x2'));var jsonpatch=require(_0xc6dc('0x3'));var rp=require(_0xc6dc('0x4'));var moment=require(_0xc6dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc6dc('0x6'));var util=require(_0xc6dc('0x7'));var path=require('path');var sox=require(_0xc6dc('0x8'));var csv=require(_0xc6dc('0x9'));var ejs=require(_0xc6dc('0xa'));var fs=require('fs');var fs_extra=require(_0xc6dc('0xb'));var _=require(_0xc6dc('0xc'));var squel=require(_0xc6dc('0xd'));var crypto=require('crypto');var jsforce=require(_0xc6dc('0xe'));var deskjs=require(_0xc6dc('0xf'));var toCsv=require(_0xc6dc('0x9'));var querystring=require(_0xc6dc('0x10'));var Papa=require('papaparse');var Redis=require(_0xc6dc('0x11'));var authService=require(_0xc6dc('0x12'));var qs=require(_0xc6dc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6dc('0x14'));var logger=require(_0xc6dc('0x15'))(_0xc6dc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6dc('0x17'))['db'];var integrations=require(_0xc6dc('0x18'));function respondWithStatusCode(_0x25ee18,_0x536ce3){_0x536ce3=_0x536ce3||0xcc;return function(_0x32c586){if(_0x32c586){return _0x25ee18[_0xc6dc('0x19')](_0x536ce3);}return _0x25ee18[_0xc6dc('0x1a')](_0x536ce3)['end']();};}function respondWithResult(_0x394420,_0x3dae18){_0x3dae18=_0x3dae18||0xc8;return function(_0x9796f8){if(_0x9796f8){return _0x394420[_0xc6dc('0x1a')](_0x3dae18)[_0xc6dc('0x1b')](_0x9796f8);}};}function respondWithFilteredResult(_0x7a57fa,_0x47c3c2){return function(_0x4f3cea){if(_0x4f3cea){var _0x4baecb=typeof _0x47c3c2[_0xc6dc('0x1c')]==='undefined'&&typeof _0x47c3c2[_0xc6dc('0x1d')]==='undefined';var _0x4f170b=_0x4f3cea[_0xc6dc('0x1e')];var _0x5485ed=_0x4baecb?0x0:_0x47c3c2[_0xc6dc('0x1c')];var _0x121c46=_0x4baecb?_0x4f3cea[_0xc6dc('0x1e')]:_0x47c3c2[_0xc6dc('0x1c')]+_0x47c3c2[_0xc6dc('0x1d')];var _0x309a3c;if(_0x121c46>=_0x4f170b){_0x121c46=_0x4f170b;_0x309a3c=0xc8;}else{_0x309a3c=0xce;}_0x7a57fa[_0xc6dc('0x1a')](_0x309a3c);return _0x7a57fa[_0xc6dc('0x1f')](_0xc6dc('0x20'),_0x5485ed+'-'+_0x121c46+'/'+_0x4f170b)[_0xc6dc('0x1b')](_0x4f3cea);}return null;};}function patchUpdates(_0x9b5603){return function(_0x31ceb9){try{jsonpatch[_0xc6dc('0x21')](_0x31ceb9,_0x9b5603,!![]);}catch(_0x2fee98){return BPromise[_0xc6dc('0x22')](_0x2fee98);}return _0x31ceb9[_0xc6dc('0x23')]();};}function saveUpdates(_0x585d2c,_0x2bd887){return function(_0x54dd3a){if(_0x54dd3a){return _0x54dd3a['update'](_0x585d2c)[_0xc6dc('0x24')](function(_0x250174){return _0x250174;});}return null;};}function removeEntity(_0x44cb04,_0x5c324a){return function(_0x5da2ae){if(_0x5da2ae){return _0x5da2ae[_0xc6dc('0x25')]()[_0xc6dc('0x24')](function(){_0x44cb04[_0xc6dc('0x1a')](0xcc)[_0xc6dc('0x26')]();});}};}function handleEntityNotFound(_0x2ac4c9,_0xf20ea3){return function(_0x4a1e4e){if(!_0x4a1e4e){_0x2ac4c9[_0xc6dc('0x19')](0x194);}return _0x4a1e4e;};}function handleError(_0x47844d,_0xd935c5){_0xd935c5=_0xd935c5||0x1f4;return function(_0x172caa){logger['error'](_0x172caa[_0xc6dc('0x27')]);if(_0x172caa[_0xc6dc('0x28')]){delete _0x172caa[_0xc6dc('0x28')];}_0x47844d[_0xc6dc('0x1a')](_0xd935c5)['send'](_0x172caa);};}exports['index']=function(_0x4a03e1,_0x40766d){var _0x4089ad={},_0x2bc927={},_0x1f389f={'count':0x0,'rows':[]};var _0x3c12c2=_[_0xc6dc('0x29')](db['VtigerAccount'][_0xc6dc('0x2a')],function(_0x16611c){return{'name':_0x16611c['fieldName'],'type':_0x16611c[_0xc6dc('0x2b')][_0xc6dc('0x2c')]};});_0x2bc927[_0xc6dc('0x2d')]=_['map'](_0x3c12c2,_0xc6dc('0x28'));_0x2bc927[_0xc6dc('0x2e')]=_['keys'](_0x4a03e1[_0xc6dc('0x2e')]);_0x2bc927[_0xc6dc('0x2f')]=_[_0xc6dc('0x30')](_0x2bc927[_0xc6dc('0x2d')],_0x2bc927[_0xc6dc('0x2e')]);_0x4089ad['attributes']=_[_0xc6dc('0x30')](_0x2bc927[_0xc6dc('0x2d')],qs[_0xc6dc('0x31')](_0x4a03e1['query'][_0xc6dc('0x31')]));_0x4089ad[_0xc6dc('0x32')]=_0x4089ad[_0xc6dc('0x32')]['length']?_0x4089ad[_0xc6dc('0x32')]:_0x2bc927[_0xc6dc('0x2d')];if(!_0x4a03e1[_0xc6dc('0x2e')][_0xc6dc('0x33')](_0xc6dc('0x34'))){_0x4089ad[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x4a03e1[_0xc6dc('0x2e')][_0xc6dc('0x1d')]);_0x4089ad[_0xc6dc('0x1c')]=qs[_0xc6dc('0x1c')](_0x4a03e1[_0xc6dc('0x2e')][_0xc6dc('0x1c')]);}_0x4089ad[_0xc6dc('0x35')]=qs[_0xc6dc('0x36')](_0x4a03e1['query']['sort']);_0x4089ad[_0xc6dc('0x37')]=qs[_0xc6dc('0x2f')](_[_0xc6dc('0x38')](_0x4a03e1['query'],_0x2bc927['filters']),_0x3c12c2);if(_0x4a03e1[_0xc6dc('0x2e')][_0xc6dc('0x39')]){_0x4089ad[_0xc6dc('0x37')]=_[_0xc6dc('0x3a')](_0x4089ad['where'],{'$or':_['map'](_0x3c12c2,function(_0x40b5b3){if(_0x40b5b3[_0xc6dc('0x2b')]!=='VIRTUAL'){var _0x5e2c01={};_0x5e2c01[_0x40b5b3[_0xc6dc('0x28')]]={'$like':'%'+_0x4a03e1[_0xc6dc('0x2e')][_0xc6dc('0x39')]+'%'};return _0x5e2c01;}})});}_0x4089ad=_['merge']({},_0x4089ad,_0x4a03e1['options']);var _0x5e650d={'where':_0x4089ad[_0xc6dc('0x37')]};return db[_0xc6dc('0x3b')][_0xc6dc('0x1e')](_0x5e650d)[_0xc6dc('0x24')](function(_0xe3f4e4){_0x1f389f[_0xc6dc('0x1e')]=_0xe3f4e4;if(_0x4a03e1['query']['includeAll']){_0x4089ad[_0xc6dc('0x3c')]=[{'all':!![]}];}return db[_0xc6dc('0x3b')]['findAll'](_0x4089ad);})['then'](function(_0x453b2f){_0x1f389f[_0xc6dc('0x3d')]=_0x453b2f;return _0x1f389f;})[_0xc6dc('0x24')](respondWithFilteredResult(_0x40766d,_0x4089ad))[_0xc6dc('0x3e')](handleError(_0x40766d,null));};exports[_0xc6dc('0x3f')]=function(_0x48a1d4,_0x4edb40){var _0x5e5c61={'raw':![],'where':{'id':_0x48a1d4[_0xc6dc('0x40')]['id']}},_0x3ece34={};_0x3ece34[_0xc6dc('0x2d')]=_[_0xc6dc('0x41')](db[_0xc6dc('0x3b')][_0xc6dc('0x2a')]);_0x3ece34[_0xc6dc('0x2e')]=_[_0xc6dc('0x41')](_0x48a1d4['query']);_0x3ece34['filters']=_[_0xc6dc('0x30')](_0x3ece34['model'],_0x3ece34['query']);_0x5e5c61[_0xc6dc('0x32')]=_[_0xc6dc('0x30')](_0x3ece34[_0xc6dc('0x2d')],qs[_0xc6dc('0x31')](_0x48a1d4['query'][_0xc6dc('0x31')]));_0x5e5c61[_0xc6dc('0x32')]=_0x5e5c61[_0xc6dc('0x32')]['length']?_0x5e5c61[_0xc6dc('0x32')]:_0x3ece34[_0xc6dc('0x2d')];if(_0x48a1d4[_0xc6dc('0x2e')][_0xc6dc('0x42')]){_0x5e5c61[_0xc6dc('0x3c')]=[{'all':!![]}];}_0x5e5c61=_[_0xc6dc('0x3a')]({},_0x5e5c61,_0x48a1d4[_0xc6dc('0x43')]);return db['VtigerAccount'][_0xc6dc('0x44')](_0x5e5c61)['then'](handleEntityNotFound(_0x4edb40,null))['then'](respondWithResult(_0x4edb40,null))[_0xc6dc('0x3e')](handleError(_0x4edb40,null));};exports['create']=function(_0x3b67b0,_0x11cbf8){return db[_0xc6dc('0x3b')]['create'](_0x3b67b0['body'],{})[_0xc6dc('0x24')](respondWithResult(_0x11cbf8,0xc9))[_0xc6dc('0x3e')](handleError(_0x11cbf8,null));};exports['update']=function(_0x4035c0,_0x5265e7){if(_0x4035c0['body']['id']){delete _0x4035c0[_0xc6dc('0x45')]['id'];}return db[_0xc6dc('0x3b')][_0xc6dc('0x44')]({'where':{'id':_0x4035c0[_0xc6dc('0x40')]['id']}})['then'](handleEntityNotFound(_0x5265e7,null))[_0xc6dc('0x24')](saveUpdates(_0x4035c0[_0xc6dc('0x45')],null))[_0xc6dc('0x24')](respondWithResult(_0x5265e7,null))[_0xc6dc('0x3e')](handleError(_0x5265e7,null));};exports[_0xc6dc('0x25')]=function(_0x3a81a4,_0x35cc31){return db[_0xc6dc('0x3b')][_0xc6dc('0x44')]({'where':{'id':_0x3a81a4[_0xc6dc('0x40')]['id']}})[_0xc6dc('0x24')](handleEntityNotFound(_0x35cc31,null))[_0xc6dc('0x24')](removeEntity(_0x35cc31,null))[_0xc6dc('0x3e')](handleError(_0x35cc31,null));};exports[_0xc6dc('0x46')]=function(_0x4b8328,_0x537de2,_0x2c200c){var _0x286960={};var _0x3ffe71={};var _0x5b3fc0;var _0x26afe5;return db[_0xc6dc('0x3b')]['findOne']({'where':{'id':_0x4b8328[_0xc6dc('0x40')]['id']}})[_0xc6dc('0x24')](handleEntityNotFound(_0x537de2,null))[_0xc6dc('0x24')](function(_0x248c46){if(_0x248c46){_0x5b3fc0=_0x248c46;_0x3ffe71[_0xc6dc('0x2d')]=_[_0xc6dc('0x41')](db['VtigerConfiguration'][_0xc6dc('0x2a')]);_0x3ffe71[_0xc6dc('0x2e')]=_[_0xc6dc('0x41')](_0x4b8328[_0xc6dc('0x2e')]);_0x3ffe71['filters']=_[_0xc6dc('0x30')](_0x3ffe71[_0xc6dc('0x2d')],_0x3ffe71[_0xc6dc('0x2e')]);_0x286960[_0xc6dc('0x32')]=_['intersection'](_0x3ffe71[_0xc6dc('0x2d')],qs['fields'](_0x4b8328[_0xc6dc('0x2e')][_0xc6dc('0x31')]));_0x286960[_0xc6dc('0x32')]=_0x286960['attributes'][_0xc6dc('0x47')]?_0x286960[_0xc6dc('0x32')]:_0x3ffe71[_0xc6dc('0x2d')];_0x286960[_0xc6dc('0x35')]=qs[_0xc6dc('0x36')](_0x4b8328[_0xc6dc('0x2e')][_0xc6dc('0x36')]);_0x286960[_0xc6dc('0x37')]=qs[_0xc6dc('0x2f')](_[_0xc6dc('0x38')](_0x4b8328[_0xc6dc('0x2e')],_0x3ffe71[_0xc6dc('0x2f')]));if(_0x4b8328[_0xc6dc('0x2e')][_0xc6dc('0x39')]){_0x286960[_0xc6dc('0x37')]=_[_0xc6dc('0x3a')](_0x286960[_0xc6dc('0x37')],{'$or':_[_0xc6dc('0x29')](_0x286960['attributes'],function(_0x99cd58){var _0x558eeb={};_0x558eeb[_0x99cd58]={'$like':'%'+_0x4b8328[_0xc6dc('0x2e')]['filter']+'%'};return _0x558eeb;})});}_0x286960=_[_0xc6dc('0x3a')]({},_0x286960,_0x4b8328['options']);return _0x5b3fc0[_0xc6dc('0x46')](_0x286960);}})[_0xc6dc('0x24')](function(_0x4f9f75){if(_0x4f9f75){_0x26afe5=_0x4f9f75['length'];if(!_0x4b8328['query'][_0xc6dc('0x33')](_0xc6dc('0x34'))){_0x286960[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x4b8328[_0xc6dc('0x2e')][_0xc6dc('0x1d')]);_0x286960[_0xc6dc('0x1c')]=qs[_0xc6dc('0x1c')](_0x4b8328[_0xc6dc('0x2e')][_0xc6dc('0x1c')]);}return _0x5b3fc0[_0xc6dc('0x46')](_0x286960);}})[_0xc6dc('0x24')](function(_0x18bf9b){if(_0x18bf9b){return _0x18bf9b?{'count':_0x26afe5,'rows':_0x18bf9b}:null;}})[_0xc6dc('0x24')](respondWithResult(_0x537de2,null))[_0xc6dc('0x3e')](handleError(_0x537de2,null));};exports[_0xc6dc('0x48')]=function(_0xd7d618,_0x507687,_0x112be4){if(_0xd7d618[_0xc6dc('0x45')]['id']){delete _0xd7d618[_0xc6dc('0x45')]['id'];}return db[_0xc6dc('0x3b')][_0xc6dc('0x49')]({'where':{'id':_0xd7d618[_0xc6dc('0x40')]['id']}})['then'](handleEntityNotFound(_0x507687,null))[_0xc6dc('0x24')](function(_0x329566){if(_0x329566){_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x4a')]=_0x329566['id'];_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x4b')]=integrations[_0xc6dc('0x4c')](_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x4d')],_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x2b')]);_0xd7d618[_0xc6dc('0x45')]['Descriptions']=integrations[_0xc6dc('0x4e')](_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x4d')],_0xd7d618[_0xc6dc('0x45')][_0xc6dc('0x2b')]);return db[_0xc6dc('0x4f')][_0xc6dc('0x50')](_0xd7d618[_0xc6dc('0x45')],{'include':[{'model':db[_0xc6dc('0x51')],'as':_0xc6dc('0x4b')},{'model':db[_0xc6dc('0x51')],'as':_0xc6dc('0x52')}]});}return null;})[_0xc6dc('0x24')](respondWithResult(_0x507687,null))[_0xc6dc('0x3e')](handleError(_0x507687,null));};var md5=require('md5');exports[_0xc6dc('0x53')]=function(_0x5ae4e7,_0x2e9901,_0x18720f){var _0x2f71fe=null;var _0x4d0493=null;var _0x5d369c=null;var _0x5ac370=null;var _0x39a59d='';return db[_0xc6dc('0x3b')]['findOne']({'where':{'id':_0x5ae4e7['params']['id']},'attributes':['id','name',_0xc6dc('0x54'),_0xc6dc('0x55'),_0xc6dc('0x56'),_0xc6dc('0x57'),_0xc6dc('0x58'),_0xc6dc('0x59')]})[_0xc6dc('0x24')](handleEntityNotFound(_0x2e9901,null))[_0xc6dc('0x24')](function(_0x3e3b00){if(_0x3e3b00){_0x2f71fe=_0x3e3b00[_0xc6dc('0x54')];_0x4d0493=_0x3e3b00[_0xc6dc('0x59')];_0x5d369c=_0x3e3b00[_0xc6dc('0x56')];_0x39a59d=_0x3e3b00[_0xc6dc('0x57')];var _0x22eaa6=_0x39a59d[_0xc6dc('0x5a')](-0x1);if(_0x22eaa6==='/'){_0x39a59d=_0x39a59d[_0xc6dc('0x5b')](0x0,_0x39a59d[_0xc6dc('0x5c')](_0x22eaa6));}_0x5ac370=util['format'](_0xc6dc('0x5d'),_0x39a59d);var _0x2c96f0={'method':_0xc6dc('0x5e'),'uri':_0x5ac370,'qs':{'operation':_0xc6dc('0x5f'),'username':_0x3e3b00[_0xc6dc('0x54')]},'json':!![]};return rp(_0x2c96f0);}})[_0xc6dc('0x24')](function(_0x340b3a){if(_0x340b3a['success']){var _0x27afce={'method':'POST','uri':_0x5ac370,'form':{'operation':'login','username':_0x2f71fe,'accessKey':md5(_0x340b3a[_0xc6dc('0x60')]['token']+_0x4d0493)},'json':!![]};return rp(_0x27afce);}})[_0xc6dc('0x24')](function(_0x344702){if(_0x344702[_0xc6dc('0x61')]){var _0x22969d={'method':'GET','uri':_0x5ac370,'qs':{'operation':_0xc6dc('0x62'),'username':_0x2f71fe,'sessionName':_0x344702[_0xc6dc('0x60')][_0xc6dc('0x63')],'elementType':_0x5d369c},'json':!![]};return rp(_0x22969d);}})[_0xc6dc('0x24')](function(_0x1a0273){if(_0x1a0273['success']){var _0x478caf=[_0xc6dc('0x64'),_0xc6dc('0x65'),_0xc6dc('0x66')];_[_0xc6dc('0x67')](_0x1a0273[_0xc6dc('0x60')][_0xc6dc('0x31')],function(_0x8e0799){return _0x478caf[_0xc6dc('0x68')](_0x8e0799['type'][_0xc6dc('0x28')]);});_[_0xc6dc('0x67')](_0x1a0273[_0xc6dc('0x60')][_0xc6dc('0x31')],function(_0x1db10a){return _0x1db10a[_0xc6dc('0x69')]===_0xc6dc('0x6a');});return{'count':_0x1a0273[_0xc6dc('0x60')]['fields'][_0xc6dc('0x47')],'rows':_['map'](_0x1a0273[_0xc6dc('0x60')]['fields'],function(_0x26a049){return{'id':_0x26a049['name'],'name':_0x26a049[_0xc6dc('0x6b')],'custom':_['startsWith'](_0x26a049[_0xc6dc('0x28')],_0xc6dc('0x6c'))?!![]:![],'options':_0x26a049[_0xc6dc('0x2b')][_0xc6dc('0x28')]===_0xc6dc('0x6d')&&_0x26a049[_0xc6dc('0x2b')]['picklistValues'][_0xc6dc('0x47')]>0x0?_['map'](_0x26a049[_0xc6dc('0x2b')][_0xc6dc('0x6e')],function(_0x33a589){return{'name':_0x33a589[_0xc6dc('0x6b')],'value':_0x33a589['value']};}):[]};})};}})[_0xc6dc('0x24')](respondWithResult(_0x2e9901,null))[_0xc6dc('0x3e')](function(_0x266a4b){console[_0xc6dc('0x6f')](_0xc6dc('0x70')+_0x266a4b);var _0x375c37=_0x5ae4e7['query'][_0xc6dc('0x71')]?0x1f4:_0x266a4b['statusCode']||0x1f4;logger['error'](_0xc6dc('0x72'),_0xc6dc('0x53'),_0x375c37,JSON[_0xc6dc('0x73')](_0x266a4b));delete _0x266a4b[_0xc6dc('0x28')];if(_0x375c37===0x191){_0x375c37=0x190;}_0x2e9901['status'](_0x375c37)[_0xc6dc('0x74')](_0x5ae4e7['query'][_0xc6dc('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x266a4b[_0xc6dc('0x75')]}:_0x266a4b);});}; \ No newline at end of file +var _0x3d13=['picklistValues','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','status','json','undefined','limit','count','offset','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','VtigerAccount','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','length','create','body','find','destroy','getConfigurations','findOne','VtigerConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','result','token','autogenerated','reference','remove','editable','label','startsWith','picklist'];(function(_0x1bb2c5,_0x5a3a8f){var _0x50782b=function(_0x59ede6){while(--_0x59ede6){_0x1bb2c5['push'](_0x1bb2c5['shift']());}};_0x50782b(++_0x5a3a8f);}(_0x3d13,0x1e3));var _0x33d1=function(_0xcf669d,_0x3769ae){_0xcf669d=_0xcf669d-0x0;var _0x4cfe39=_0x3d13[_0xcf669d];return _0x4cfe39;};'use strict';var emlformat=require(_0x33d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33d1('0x1'));var jsonpatch=require(_0x33d1('0x2'));var rp=require(_0x33d1('0x3'));var moment=require('moment');var BPromise=require(_0x33d1('0x4'));var Mustache=require(_0x33d1('0x5'));var util=require(_0x33d1('0x6'));var path=require(_0x33d1('0x7'));var sox=require(_0x33d1('0x8'));var csv=require(_0x33d1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33d1('0xa'));var _=require('lodash');var squel=require(_0x33d1('0xb'));var crypto=require(_0x33d1('0xc'));var jsforce=require(_0x33d1('0xd'));var deskjs=require(_0x33d1('0xe'));var toCsv=require(_0x33d1('0x9'));var querystring=require(_0x33d1('0xf'));var Papa=require(_0x33d1('0x10'));var Redis=require(_0x33d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x33d1('0x12'));var as=require(_0x33d1('0x13'));var hardwareService=require(_0x33d1('0x14'));var logger=require(_0x33d1('0x15'))(_0x33d1('0x16'));var utils=require(_0x33d1('0x17'));var config=require(_0x33d1('0x18'));var licenseUtil=require(_0x33d1('0x19'));var db=require(_0x33d1('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2b66b3,_0x544be2){_0x544be2=_0x544be2||0xcc;return function(_0x543643){if(_0x543643){return _0x2b66b3['sendStatus'](_0x544be2);}return _0x2b66b3[_0x33d1('0x1b')](_0x544be2)['end']();};}function respondWithResult(_0x563fc3,_0x2a69a2){_0x2a69a2=_0x2a69a2||0xc8;return function(_0x3ebfae){if(_0x3ebfae){return _0x563fc3[_0x33d1('0x1b')](_0x2a69a2)[_0x33d1('0x1c')](_0x3ebfae);}};}function respondWithFilteredResult(_0x2bea72,_0x17769c){return function(_0x58d5da){if(_0x58d5da){var _0xbdfceb=typeof _0x17769c['offset']===_0x33d1('0x1d')&&typeof _0x17769c[_0x33d1('0x1e')]===_0x33d1('0x1d');var _0x3ad8e1=_0x58d5da[_0x33d1('0x1f')];var _0x45ddb2=_0xbdfceb?0x0:_0x17769c[_0x33d1('0x20')];var _0xf1d218=_0xbdfceb?_0x58d5da[_0x33d1('0x1f')]:_0x17769c[_0x33d1('0x20')]+_0x17769c['limit'];var _0x798c13;if(_0xf1d218>=_0x3ad8e1){_0xf1d218=_0x3ad8e1;_0x798c13=0xc8;}else{_0x798c13=0xce;}_0x2bea72[_0x33d1('0x1b')](_0x798c13);return _0x2bea72['set']('Content-Range',_0x45ddb2+'-'+_0xf1d218+'/'+_0x3ad8e1)[_0x33d1('0x1c')](_0x58d5da);}return null;};}function patchUpdates(_0x36ddaa){return function(_0x279d30){try{jsonpatch[_0x33d1('0x21')](_0x279d30,_0x36ddaa,!![]);}catch(_0x4d5386){return BPromise[_0x33d1('0x22')](_0x4d5386);}return _0x279d30[_0x33d1('0x23')]();};}function saveUpdates(_0x3f1eed,_0x355cc8){return function(_0x56ed2a){if(_0x56ed2a){return _0x56ed2a[_0x33d1('0x24')](_0x3f1eed)[_0x33d1('0x25')](function(_0x14c295){return _0x14c295;});}return null;};}function removeEntity(_0x1ae074,_0x2b1538){return function(_0x3afa79){if(_0x3afa79){return _0x3afa79['destroy']()[_0x33d1('0x25')](function(){_0x1ae074['status'](0xcc)[_0x33d1('0x26')]();});}};}function handleEntityNotFound(_0x2a4958,_0x1f66e4){return function(_0x588169){if(!_0x588169){_0x2a4958[_0x33d1('0x27')](0x194);}return _0x588169;};}function handleError(_0x1e4800,_0x3b5425){_0x3b5425=_0x3b5425||0x1f4;return function(_0x39ccb){logger[_0x33d1('0x28')](_0x39ccb[_0x33d1('0x29')]);if(_0x39ccb[_0x33d1('0x2a')]){delete _0x39ccb[_0x33d1('0x2a')];}_0x1e4800['status'](_0x3b5425)[_0x33d1('0x2b')](_0x39ccb);};}exports[_0x33d1('0x2c')]=function(_0x3ba845,_0x444eda){var _0x3593d9={},_0x22d14e={},_0x3ee87f={'count':0x0,'rows':[]};var _0x40d58b=_['map'](db[_0x33d1('0x2d')][_0x33d1('0x2e')],function(_0x3b0b10){return{'name':_0x3b0b10['fieldName'],'type':_0x3b0b10[_0x33d1('0x2f')][_0x33d1('0x30')]};});_0x22d14e['model']=_['map'](_0x40d58b,_0x33d1('0x2a'));_0x22d14e['query']=_['keys'](_0x3ba845[_0x33d1('0x31')]);_0x22d14e[_0x33d1('0x32')]=_['intersection'](_0x22d14e[_0x33d1('0x33')],_0x22d14e[_0x33d1('0x31')]);_0x3593d9[_0x33d1('0x34')]=_[_0x33d1('0x35')](_0x22d14e[_0x33d1('0x33')],qs[_0x33d1('0x36')](_0x3ba845[_0x33d1('0x31')][_0x33d1('0x36')]));_0x3593d9[_0x33d1('0x34')]=_0x3593d9[_0x33d1('0x34')]['length']?_0x3593d9[_0x33d1('0x34')]:_0x22d14e[_0x33d1('0x33')];if(!_0x3ba845[_0x33d1('0x31')][_0x33d1('0x37')]('nolimit')){_0x3593d9[_0x33d1('0x1e')]=qs[_0x33d1('0x1e')](_0x3ba845[_0x33d1('0x31')]['limit']);_0x3593d9[_0x33d1('0x20')]=qs[_0x33d1('0x20')](_0x3ba845[_0x33d1('0x31')][_0x33d1('0x20')]);}_0x3593d9[_0x33d1('0x38')]=qs[_0x33d1('0x39')](_0x3ba845[_0x33d1('0x31')][_0x33d1('0x39')]);_0x3593d9[_0x33d1('0x3a')]=qs['filters'](_[_0x33d1('0x3b')](_0x3ba845[_0x33d1('0x31')],_0x22d14e[_0x33d1('0x32')]),_0x40d58b);if(_0x3ba845['query'][_0x33d1('0x3c')]){_0x3593d9[_0x33d1('0x3a')]=_[_0x33d1('0x3d')](_0x3593d9['where'],{'$or':_[_0x33d1('0x3e')](_0x40d58b,function(_0x2f8d49){if(_0x2f8d49['type']!==_0x33d1('0x3f')){var _0x120226={};_0x120226[_0x2f8d49['name']]={'$like':'%'+_0x3ba845['query'][_0x33d1('0x3c')]+'%'};return _0x120226;}})});}_0x3593d9=_[_0x33d1('0x3d')]({},_0x3593d9,_0x3ba845[_0x33d1('0x40')]);var _0x46841e={'where':_0x3593d9[_0x33d1('0x3a')]};return db[_0x33d1('0x2d')][_0x33d1('0x1f')](_0x46841e)[_0x33d1('0x25')](function(_0x559e6a){_0x3ee87f['count']=_0x559e6a;if(_0x3ba845[_0x33d1('0x31')][_0x33d1('0x41')]){_0x3593d9[_0x33d1('0x42')]=[{'all':!![]}];}return db[_0x33d1('0x2d')]['findAll'](_0x3593d9);})[_0x33d1('0x25')](function(_0x235839){_0x3ee87f[_0x33d1('0x43')]=_0x235839;return _0x3ee87f;})[_0x33d1('0x25')](respondWithFilteredResult(_0x444eda,_0x3593d9))[_0x33d1('0x44')](handleError(_0x444eda,null));};exports[_0x33d1('0x45')]=function(_0x5ca1da,_0x4eb5dd){var _0x47964e={'raw':![],'where':{'id':_0x5ca1da[_0x33d1('0x46')]['id']}},_0x3d383a={};_0x3d383a[_0x33d1('0x33')]=_[_0x33d1('0x47')](db[_0x33d1('0x2d')]['rawAttributes']);_0x3d383a[_0x33d1('0x31')]=_[_0x33d1('0x47')](_0x5ca1da[_0x33d1('0x31')]);_0x3d383a[_0x33d1('0x32')]=_['intersection'](_0x3d383a[_0x33d1('0x33')],_0x3d383a['query']);_0x47964e['attributes']=_[_0x33d1('0x35')](_0x3d383a[_0x33d1('0x33')],qs[_0x33d1('0x36')](_0x5ca1da[_0x33d1('0x31')][_0x33d1('0x36')]));_0x47964e[_0x33d1('0x34')]=_0x47964e[_0x33d1('0x34')][_0x33d1('0x48')]?_0x47964e[_0x33d1('0x34')]:_0x3d383a['model'];if(_0x5ca1da['query'][_0x33d1('0x41')]){_0x47964e[_0x33d1('0x42')]=[{'all':!![]}];}_0x47964e=_['merge']({},_0x47964e,_0x5ca1da[_0x33d1('0x40')]);return db['VtigerAccount']['find'](_0x47964e)[_0x33d1('0x25')](handleEntityNotFound(_0x4eb5dd,null))[_0x33d1('0x25')](respondWithResult(_0x4eb5dd,null))[_0x33d1('0x44')](handleError(_0x4eb5dd,null));};exports[_0x33d1('0x49')]=function(_0x198ab1,_0x3816a7){return db[_0x33d1('0x2d')]['create'](_0x198ab1[_0x33d1('0x4a')],{})[_0x33d1('0x25')](respondWithResult(_0x3816a7,0xc9))[_0x33d1('0x44')](handleError(_0x3816a7,null));};exports['update']=function(_0x993930,_0x3b8a22){if(_0x993930[_0x33d1('0x4a')]['id']){delete _0x993930[_0x33d1('0x4a')]['id'];}return db[_0x33d1('0x2d')][_0x33d1('0x4b')]({'where':{'id':_0x993930[_0x33d1('0x46')]['id']}})[_0x33d1('0x25')](handleEntityNotFound(_0x3b8a22,null))[_0x33d1('0x25')](saveUpdates(_0x993930[_0x33d1('0x4a')],null))[_0x33d1('0x25')](respondWithResult(_0x3b8a22,null))[_0x33d1('0x44')](handleError(_0x3b8a22,null));};exports[_0x33d1('0x4c')]=function(_0x23b244,_0x3bce46){return db[_0x33d1('0x2d')]['find']({'where':{'id':_0x23b244[_0x33d1('0x46')]['id']}})[_0x33d1('0x25')](handleEntityNotFound(_0x3bce46,null))[_0x33d1('0x25')](removeEntity(_0x3bce46,null))['catch'](handleError(_0x3bce46,null));};exports[_0x33d1('0x4d')]=function(_0x396b05,_0x1ee1e5,_0x252e59){var _0x586278={};var _0x569d61={};var _0x133d13;var _0x4c6976;return db['VtigerAccount'][_0x33d1('0x4e')]({'where':{'id':_0x396b05[_0x33d1('0x46')]['id']}})[_0x33d1('0x25')](handleEntityNotFound(_0x1ee1e5,null))[_0x33d1('0x25')](function(_0x51c0a3){if(_0x51c0a3){_0x133d13=_0x51c0a3;_0x569d61[_0x33d1('0x33')]=_[_0x33d1('0x47')](db[_0x33d1('0x4f')]['rawAttributes']);_0x569d61['query']=_[_0x33d1('0x47')](_0x396b05[_0x33d1('0x31')]);_0x569d61[_0x33d1('0x32')]=_[_0x33d1('0x35')](_0x569d61['model'],_0x569d61['query']);_0x586278[_0x33d1('0x34')]=_[_0x33d1('0x35')](_0x569d61[_0x33d1('0x33')],qs[_0x33d1('0x36')](_0x396b05[_0x33d1('0x31')][_0x33d1('0x36')]));_0x586278[_0x33d1('0x34')]=_0x586278[_0x33d1('0x34')][_0x33d1('0x48')]?_0x586278['attributes']:_0x569d61[_0x33d1('0x33')];_0x586278[_0x33d1('0x38')]=qs[_0x33d1('0x39')](_0x396b05[_0x33d1('0x31')][_0x33d1('0x39')]);_0x586278[_0x33d1('0x3a')]=qs[_0x33d1('0x32')](_[_0x33d1('0x3b')](_0x396b05['query'],_0x569d61[_0x33d1('0x32')]));if(_0x396b05['query'][_0x33d1('0x3c')]){_0x586278[_0x33d1('0x3a')]=_['merge'](_0x586278['where'],{'$or':_[_0x33d1('0x3e')](_0x586278[_0x33d1('0x34')],function(_0xa3d2f5){var _0x131a1c={};_0x131a1c[_0xa3d2f5]={'$like':'%'+_0x396b05['query'][_0x33d1('0x3c')]+'%'};return _0x131a1c;})});}_0x586278=_['merge']({},_0x586278,_0x396b05[_0x33d1('0x40')]);return _0x133d13['getConfigurations'](_0x586278);}})[_0x33d1('0x25')](function(_0x4e8336){if(_0x4e8336){_0x4c6976=_0x4e8336[_0x33d1('0x48')];if(!_0x396b05[_0x33d1('0x31')][_0x33d1('0x37')](_0x33d1('0x50'))){_0x586278[_0x33d1('0x1e')]=qs[_0x33d1('0x1e')](_0x396b05[_0x33d1('0x31')][_0x33d1('0x1e')]);_0x586278[_0x33d1('0x20')]=qs[_0x33d1('0x20')](_0x396b05[_0x33d1('0x31')][_0x33d1('0x20')]);}return _0x133d13[_0x33d1('0x4d')](_0x586278);}})[_0x33d1('0x25')](function(_0x3d3aab){if(_0x3d3aab){return _0x3d3aab?{'count':_0x4c6976,'rows':_0x3d3aab}:null;}})[_0x33d1('0x25')](respondWithResult(_0x1ee1e5,null))[_0x33d1('0x44')](handleError(_0x1ee1e5,null));};exports['addConfiguration']=function(_0xca8784,_0x599099,_0x2c9518){if(_0xca8784['body']['id']){delete _0xca8784[_0x33d1('0x4a')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0xca8784['params']['id']}})[_0x33d1('0x25')](handleEntityNotFound(_0x599099,null))[_0x33d1('0x25')](function(_0x3ac914){if(_0x3ac914){_0xca8784[_0x33d1('0x4a')][_0x33d1('0x51')]=_0x3ac914['id'];_0xca8784['body'][_0x33d1('0x52')]=integrations[_0x33d1('0x53')](_0xca8784[_0x33d1('0x4a')][_0x33d1('0x54')],_0xca8784[_0x33d1('0x4a')][_0x33d1('0x2f')]);_0xca8784[_0x33d1('0x4a')][_0x33d1('0x55')]=integrations[_0x33d1('0x56')](_0xca8784[_0x33d1('0x4a')][_0x33d1('0x54')],_0xca8784[_0x33d1('0x4a')][_0x33d1('0x2f')]);return db[_0x33d1('0x4f')][_0x33d1('0x49')](_0xca8784['body'],{'include':[{'model':db[_0x33d1('0x57')],'as':_0x33d1('0x52')},{'model':db[_0x33d1('0x57')],'as':_0x33d1('0x55')}]});}return null;})[_0x33d1('0x25')](respondWithResult(_0x599099,null))[_0x33d1('0x44')](handleError(_0x599099,null));};var md5=require(_0x33d1('0x58'));exports[_0x33d1('0x59')]=function(_0x488be0,_0x300d3d,_0x562592){var _0x3cebf5=null;var _0x1bf9b1=null;var _0x3d24a0=null;var _0x49d3cb=null;var _0x3373d3='';return db[_0x33d1('0x2d')]['findOne']({'where':{'id':_0x488be0[_0x33d1('0x46')]['id']},'attributes':['id',_0x33d1('0x2a'),_0x33d1('0x5a'),_0x33d1('0x5b'),'moduleName','remoteUri',_0x33d1('0x5c'),'accessKey']})[_0x33d1('0x25')](handleEntityNotFound(_0x300d3d,null))[_0x33d1('0x25')](function(_0x340de7){if(_0x340de7){_0x3cebf5=_0x340de7[_0x33d1('0x5a')];_0x1bf9b1=_0x340de7[_0x33d1('0x5d')];_0x3d24a0=_0x340de7['moduleName'];_0x3373d3=_0x340de7[_0x33d1('0x5e')];var _0xfe33df=_0x3373d3[_0x33d1('0x5f')](-0x1);if(_0xfe33df==='/'){_0x3373d3=_0x3373d3['substring'](0x0,_0x3373d3[_0x33d1('0x60')](_0xfe33df));}_0x49d3cb=util[_0x33d1('0x61')](_0x33d1('0x62'),_0x3373d3);var _0x199b54={'method':'GET','uri':_0x49d3cb,'qs':{'operation':_0x33d1('0x63'),'username':_0x340de7['username']},'json':!![]};return rp(_0x199b54);}})[_0x33d1('0x25')](function(_0x5f00c3){if(_0x5f00c3[_0x33d1('0x64')]){var _0x3adfd7={'method':_0x33d1('0x65'),'uri':_0x49d3cb,'form':{'operation':_0x33d1('0x66'),'username':_0x3cebf5,'accessKey':md5(_0x5f00c3[_0x33d1('0x67')][_0x33d1('0x68')]+_0x1bf9b1)},'json':!![]};return rp(_0x3adfd7);}})[_0x33d1('0x25')](function(_0x5e64ba){if(_0x5e64ba['success']){var _0x56cf3a={'method':'GET','uri':_0x49d3cb,'qs':{'operation':'describe','username':_0x3cebf5,'sessionName':_0x5e64ba['result']['sessionName'],'elementType':_0x3d24a0},'json':!![]};return rp(_0x56cf3a);}})['then'](function(_0x29e21f){if(_0x29e21f['success']){var _0x21859d=[_0x33d1('0x69'),_0x33d1('0x6a'),'owner'];_['remove'](_0x29e21f[_0x33d1('0x67')][_0x33d1('0x36')],function(_0x5d4ebf){return _0x21859d['includes'](_0x5d4ebf['type'][_0x33d1('0x2a')]);});_[_0x33d1('0x6b')](_0x29e21f['result']['fields'],function(_0x277168){return _0x277168[_0x33d1('0x6c')]==='false';});return{'count':_0x29e21f[_0x33d1('0x67')][_0x33d1('0x36')][_0x33d1('0x48')],'rows':_[_0x33d1('0x3e')](_0x29e21f['result'][_0x33d1('0x36')],function(_0x726a9a){return{'id':_0x726a9a['name'],'name':_0x726a9a[_0x33d1('0x6d')],'custom':_[_0x33d1('0x6e')](_0x726a9a[_0x33d1('0x2a')],'cf_')?!![]:![],'options':_0x726a9a['type']['name']===_0x33d1('0x6f')&&_0x726a9a[_0x33d1('0x2f')][_0x33d1('0x70')][_0x33d1('0x48')]>0x0?_[_0x33d1('0x3e')](_0x726a9a[_0x33d1('0x2f')][_0x33d1('0x70')],function(_0x2872b0){return{'name':_0x2872b0[_0x33d1('0x6d')],'value':_0x2872b0['value']};}):[]};})};}})[_0x33d1('0x25')](respondWithResult(_0x300d3d,null))[_0x33d1('0x44')](function(_0x5e3898){console[_0x33d1('0x71')](_0x33d1('0x72')+_0x5e3898);var _0x33de3a=_0x488be0[_0x33d1('0x31')]['test']?0x1f4:_0x5e3898['statusCode']||0x1f4;logger[_0x33d1('0x28')](_0x33d1('0x73'),_0x33d1('0x59'),_0x33de3a,JSON['stringify'](_0x5e3898));delete _0x5e3898['name'];if(_0x33de3a===0x191){_0x33de3a=0x190;}_0x300d3d[_0x33d1('0x1b')](_0x33de3a)['send'](_0x488be0[_0x33d1('0x31')][_0x33d1('0x74')]?{'message':_0x33d1('0x75'),'statusCode':_0x5e3898[_0x33d1('0x76')]}:_0x5e3898);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 524283a..654cc4e 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 _0xa2df=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash'];(function(_0x3a9440,_0xd54c24){var _0x27d927=function(_0xf73f11){while(--_0xf73f11){_0x3a9440['push'](_0x3a9440['shift']());}};_0x27d927(++_0xd54c24);}(_0xa2df,0xf1));var _0xfa2d=function(_0x16a0c1,_0x2a4c32){_0x16a0c1=_0x16a0c1-0x0;var _0x1a61fa=_0xa2df[_0x16a0c1];return _0x1a61fa;};'use strict';var _=require(_0xfa2d('0x0'));var util=require(_0xfa2d('0x1'));var logger=require(_0xfa2d('0x2'))(_0xfa2d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa2d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa2d('0x5'));var config=require(_0xfa2d('0x6'));var attributes=require(_0xfa2d('0x7'));var integrations=require(_0xfa2d('0x8'));module['exports']=function(_0xca0bab,_0x18d204){return _0xca0bab[_0xfa2d('0x9')]('VtigerAccount',attributes,{'tableName':_0xfa2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4c2=['int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x1b6580,_0xac3c51){var _0x13f1a8=function(_0xd6d1ec){while(--_0xd6d1ec){_0x1b6580['push'](_0x1b6580['shift']());}};_0x13f1a8(++_0xac3c51);}(_0xf4c2,0x178));var _0x2f4c=function(_0x295d67,_0x2377f0){_0x295d67=_0x295d67-0x0;var _0x241ea3=_0xf4c2[_0x295d67];return _0x241ea3;};'use strict';var _=require(_0x2f4c('0x0'));var util=require(_0x2f4c('0x1'));var logger=require(_0x2f4c('0x2'))(_0x2f4c('0x3'));var moment=require(_0x2f4c('0x4'));var BPromise=require(_0x2f4c('0x5'));var rp=require(_0x2f4c('0x6'));var fs=require('fs');var path=require(_0x2f4c('0x7'));var rimraf=require('rimraf');var config=require(_0x2f4c('0x8'));var attributes=require(_0x2f4c('0x9'));var integrations=require(_0x2f4c('0xa'));module[_0x2f4c('0xb')]=function(_0xbf601e,_0x490b4a){return _0xbf601e[_0x2f4c('0xc')](_0x2f4c('0xd'),attributes,{'tableName':_0x2f4c('0xe'),'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 efb5ee7..cc78299 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 _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x539709,_0x2c9edd){var _0x73cc7e=function(_0x5d20ea){while(--_0x5d20ea){_0x539709['push'](_0x539709['shift']());}};_0x73cc7e(++_0x2c9edd);}(_0xda3f,0xec));var _0xfda3=function(_0x5cab53,_0x5e6df2){_0x5cab53=_0x5cab53-0x0;var _0x10650e=_0xda3f[_0x5cab53];return _0x10650e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});}; \ No newline at end of file +var _0xa5fa=['jayson/promise','client','http','request','info','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowVtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xb4b21f,_0x51d8c2){var _0x294272=function(_0x38a428){while(--_0x38a428){_0xb4b21f['push'](_0xb4b21f['shift']());}};_0x294272(++_0x51d8c2);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x120f83,_0x36ccdf){_0x120f83=_0x120f83-0x0;var _0x598172=_0xa5fa[_0x120f83];return _0x598172;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});}exports[_0xaa5f('0x16')]=function(_0x3d874f){var _0x22175f=this;return new Promise(function(_0x1019e8,_0x4f4cd5){return db[_0xaa5f('0x17')][_0xaa5f('0x18')]({'raw':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1b')]||null:null,'attributes':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1c')]||null:null,'limit':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')]['limit']||null:null,'include':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f['options'][_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x3d874f['options'][_0xaa5f('0x1d')],function(_0x1032ce){return{'model':db[_0x1032ce['model']],'as':_0x1032ce['as'],'attributes':_0x1032ce[_0xaa5f('0x1c')],'include':_0x1032ce[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x1032ce[_0xaa5f('0x1d')],function(_0x1f66c0){return{'model':db[_0x1f66c0[_0xaa5f('0x1f')]],'as':_0x1f66c0['as'],'attributes':_0x1f66c0[_0xaa5f('0x1c')],'include':_0x1f66c0[_0xaa5f('0x1d')]?_['map'](_0x1f66c0[_0xaa5f('0x1d')],function(_0x3a66e8){return{'model':db[_0x3a66e8[_0xaa5f('0x1f')]],'as':_0x3a66e8['as'],'attributes':_0x3a66e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa5f('0x20')](function(_0x269209){logger[_0xaa5f('0xc')]('GetVtigerAccount',_0x3d874f);logger[_0xaa5f('0xd')]('GetVtigerAccount',_0x3d874f,JSON['stringify'](_0x269209));_0x1019e8(_0x269209);})[_0xaa5f('0x15')](function(_0x50998f){logger[_0xaa5f('0xf')]('GetVtigerAccount',_0x50998f['message'],_0x3d874f);_0x4f4cd5(_0x22175f['error'](0x1f4,_0x50998f[_0xaa5f('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x310828){var _0xc0bb03=this;return new Promise(function(_0x555876,_0x58f608){return db[_0xaa5f('0x17')]['find']({'raw':_0x310828[_0xaa5f('0x19')]?_0x310828[_0xaa5f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x310828[_0xaa5f('0x19')]?_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1b')]||null:null,'attributes':_0x310828['options']?_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1c')]||null:null,'include':_0x310828['options']?_0x310828['options']['include']?_['map'](_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1d')],function(_0x2a6015){return{'model':db[_0x2a6015[_0xaa5f('0x1f')]],'as':_0x2a6015['as'],'attributes':_0x2a6015[_0xaa5f('0x1c')],'include':_0x2a6015[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x2a6015['include'],function(_0x1ab07f){return{'model':db[_0x1ab07f[_0xaa5f('0x1f')]],'as':_0x1ab07f['as'],'attributes':_0x1ab07f[_0xaa5f('0x1c')],'include':_0x1ab07f[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x1ab07f[_0xaa5f('0x1d')],function(_0x49442c){return{'model':db[_0x49442c[_0xaa5f('0x1f')]],'as':_0x49442c['as'],'attributes':_0x49442c[_0xaa5f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaa5f('0x20')](function(_0x2ac0f8){logger[_0xaa5f('0xc')]('ShowVtigerAccount',_0x310828);logger['debug'](_0xaa5f('0x21'),_0x310828,JSON[_0xaa5f('0xe')](_0x2ac0f8));_0x555876(_0x2ac0f8);})[_0xaa5f('0x15')](function(_0x964105){logger['error'](_0xaa5f('0x21'),_0x964105[_0xaa5f('0x12')],_0x310828);_0x58f608(_0xc0bb03[_0xaa5f('0xf')](0x1f4,_0x964105[_0xaa5f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d614545..1d156e4 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 _0xac93=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','put','exports','multer','util','path'];(function(_0x1bdda0,_0x29dedf){var _0x269a8f=function(_0x13e87e){while(--_0x13e87e){_0x1bdda0['push'](_0x1bdda0['shift']());}};_0x269a8f(++_0x29dedf);}(_0xac93,0x11b));var _0x3ac9=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xac93[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x3ac9('0x0'));var util=require(_0x3ac9('0x1'));var path=require(_0x3ac9('0x2'));var timeout=require(_0x3ac9('0x3'));var express=require(_0x3ac9('0x4'));var router=express[_0x3ac9('0x5')]();var fs_extra=require(_0x3ac9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3ac9('0x7'));var config=require(_0x3ac9('0x8'));var controller=require(_0x3ac9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ac9('0xa')]);router[_0x3ac9('0xb')](_0x3ac9('0xc'),auth[_0x3ac9('0xd')](),controller[_0x3ac9('0xe')]);router['get'](_0x3ac9('0xf'),auth[_0x3ac9('0xd')](),controller[_0x3ac9('0x10')]);router[_0x3ac9('0xb')](_0x3ac9('0x11'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x3ac9('0xb')]('/:id/descriptions',auth[_0x3ac9('0xd')](),controller[_0x3ac9('0x12')]);router[_0x3ac9('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3ac9('0x14')](_0x3ac9('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3ac9('0x15')]=router; \ No newline at end of file +var _0xb6c1=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update'];(function(_0x145283,_0x8e7d3b){var _0x3449f8=function(_0x58c436){while(--_0x58c436){_0x145283['push'](_0x145283['shift']());}};_0x3449f8(++_0x8e7d3b);}(_0xb6c1,0x76));var _0x1b6c=function(_0x272796,_0x3bba43){_0x272796=_0x272796-0x0;var _0x567727=_0xb6c1[_0x272796];return _0x567727;};'use strict';var multer=require(_0x1b6c('0x0'));var util=require(_0x1b6c('0x1'));var path=require(_0x1b6c('0x2'));var timeout=require(_0x1b6c('0x3'));var express=require('express');var router=express[_0x1b6c('0x4')]();var fs_extra=require(_0x1b6c('0x5'));var auth=require(_0x1b6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6c('0x7'));var controller=require(_0x1b6c('0x8'));router[_0x1b6c('0x9')]('/',auth[_0x1b6c('0xa')](),controller['index']);router[_0x1b6c('0x9')]('/:id',auth[_0x1b6c('0xa')](),controller[_0x1b6c('0xb')]);router[_0x1b6c('0x9')](_0x1b6c('0xc'),auth[_0x1b6c('0xa')](),controller['getFields']);router[_0x1b6c('0x9')]('/:id/subjects',auth[_0x1b6c('0xa')](),controller[_0x1b6c('0xd')]);router[_0x1b6c('0x9')](_0x1b6c('0xe'),auth[_0x1b6c('0xa')](),controller[_0x1b6c('0xf')]);router[_0x1b6c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b6c('0x11')](_0x1b6c('0x12'),auth[_0x1b6c('0xa')](),controller[_0x1b6c('0x13')]);router[_0x1b6c('0x14')](_0x1b6c('0x12'),auth['isAuthenticated'](),controller[_0x1b6c('0x15')]);module[_0x1b6c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c913b3a..d105572 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 _0x1e99=['sequelize','STRING'];(function(_0x29d932,_0x97f2a7){var _0x5cd611=function(_0x33e548){while(--_0x33e548){_0x29d932['push'](_0x29d932['shift']());}};_0x5cd611(++_0x97f2a7);}(_0x1e99,0x1e6));var _0x91e9=function(_0x445efd,_0x4b1c2e){_0x445efd=_0x445efd-0x0;var _0x531c15=_0x1e99[_0x445efd];return _0x531c15;};'use strict';var Sequelize=require(_0x91e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x91e9('0x1')]}}; \ No newline at end of file +var _0x3c11=['STRING','sequelize','exports'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3c11,0x1cf));var _0x13c1=function(_0x1d2185,_0x28c9e2){_0x1d2185=_0x1d2185-0x0;var _0x3ea87c=_0x3c11[_0x1d2185];return _0x3ea87c;};'use strict';var Sequelize=require(_0x13c1('0x0'));module[_0x13c1('0x1')]={'name':{'type':Sequelize[_0x13c1('0x2')]},'description':{'type':Sequelize[_0x13c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 84f2a78..177473a 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 _0xbe23=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','show','params','find','body','getFields','findOne','pick','getSubjects','VtigerField','nolimit','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x24025b,_0x19ffd3){var _0x438549=function(_0x278344){while(--_0x278344){_0x24025b['push'](_0x24025b['shift']());}};_0x438549(++_0x19ffd3);}(_0xbe23,0x1c2));var _0x3be2=function(_0x26bbe2,_0x392720){_0x26bbe2=_0x26bbe2-0x0;var _0x38351a=_0xbe23[_0x26bbe2];return _0x38351a;};'use strict';var emlformat=require(_0x3be2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3be2('0x1'));var rp=require(_0x3be2('0x2'));var moment=require(_0x3be2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3be2('0x4'));var util=require(_0x3be2('0x5'));var path=require(_0x3be2('0x6'));var sox=require(_0x3be2('0x7'));var csv=require(_0x3be2('0x8'));var ejs=require(_0x3be2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3be2('0xa'));var crypto=require(_0x3be2('0xb'));var jsforce=require(_0x3be2('0xc'));var deskjs=require(_0x3be2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3be2('0xe'));var Papa=require(_0x3be2('0xf'));var Redis=require(_0x3be2('0x10'));var authService=require(_0x3be2('0x11'));var qs=require(_0x3be2('0x12'));var as=require(_0x3be2('0x13'));var hardwareService=require(_0x3be2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3be2('0x15'));var licenseUtil=require(_0x3be2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x274ca5,_0x423250){_0x423250=_0x423250||0xcc;return function(_0x46346f){if(_0x46346f){return _0x274ca5['sendStatus'](_0x423250);}return _0x274ca5[_0x3be2('0x17')](_0x423250)['end']();};}function respondWithResult(_0x5da702,_0x1a0fb8){_0x1a0fb8=_0x1a0fb8||0xc8;return function(_0x176389){if(_0x176389){return _0x5da702['status'](_0x1a0fb8)[_0x3be2('0x18')](_0x176389);}};}function respondWithFilteredResult(_0x53e619,_0x44cc10){return function(_0x51577b){if(_0x51577b){var _0x8fae14=typeof _0x44cc10[_0x3be2('0x19')]===_0x3be2('0x1a')&&typeof _0x44cc10[_0x3be2('0x1b')]===_0x3be2('0x1a');var _0x33a9ef=_0x51577b[_0x3be2('0x1c')];var _0x2fe4eb=_0x8fae14?0x0:_0x44cc10[_0x3be2('0x19')];var _0x1bd891=_0x8fae14?_0x51577b[_0x3be2('0x1c')]:_0x44cc10[_0x3be2('0x19')]+_0x44cc10[_0x3be2('0x1b')];var _0x4beb76;if(_0x1bd891>=_0x33a9ef){_0x1bd891=_0x33a9ef;_0x4beb76=0xc8;}else{_0x4beb76=0xce;}_0x53e619[_0x3be2('0x17')](_0x4beb76);return _0x53e619[_0x3be2('0x1d')](_0x3be2('0x1e'),_0x2fe4eb+'-'+_0x1bd891+'/'+_0x33a9ef)[_0x3be2('0x18')](_0x51577b);}return null;};}function patchUpdates(_0x5c89af){return function(_0x1a56cb){try{jsonpatch[_0x3be2('0x1f')](_0x1a56cb,_0x5c89af,!![]);}catch(_0x3f7780){return BPromise['reject'](_0x3f7780);}return _0x1a56cb[_0x3be2('0x20')]();};}function saveUpdates(_0x3b4fc0,_0x3df5ee){return function(_0xd2c980){if(_0xd2c980){return _0xd2c980[_0x3be2('0x21')](_0x3b4fc0)['then'](function(_0x44bf46){return _0x44bf46;});}return null;};}function removeEntity(_0x952bea,_0x425084){return function(_0x3e6f86){if(_0x3e6f86){return _0x3e6f86[_0x3be2('0x22')]()[_0x3be2('0x23')](function(){_0x952bea[_0x3be2('0x17')](0xcc)[_0x3be2('0x24')]();});}};}function handleEntityNotFound(_0x554c83,_0x4ae344){return function(_0x53157b){if(!_0x53157b){_0x554c83[_0x3be2('0x25')](0x194);}return _0x53157b;};}function handleError(_0xbcc4dd,_0x1f018b){_0x1f018b=_0x1f018b||0x1f4;return function(_0xf22677){logger[_0x3be2('0x26')](_0xf22677[_0x3be2('0x27')]);if(_0xf22677[_0x3be2('0x28')]){delete _0xf22677[_0x3be2('0x28')];}_0xbcc4dd[_0x3be2('0x17')](_0x1f018b)[_0x3be2('0x29')](_0xf22677);};}exports[_0x3be2('0x2a')]=function(_0x221117,_0x10aedd){var _0x360922={},_0x517913={},_0x2cc1e6={'count':0x0,'rows':[]};var _0x53f3e7=_[_0x3be2('0x2b')](db[_0x3be2('0x2c')][_0x3be2('0x2d')],function(_0x5887f0){return{'name':_0x5887f0['fieldName'],'type':_0x5887f0[_0x3be2('0x2e')][_0x3be2('0x2f')]};});_0x517913[_0x3be2('0x30')]=_[_0x3be2('0x2b')](_0x53f3e7,_0x3be2('0x28'));_0x517913['query']=_[_0x3be2('0x31')](_0x221117[_0x3be2('0x32')]);_0x517913[_0x3be2('0x33')]=_[_0x3be2('0x34')](_0x517913[_0x3be2('0x30')],_0x517913[_0x3be2('0x32')]);_0x360922[_0x3be2('0x35')]=_[_0x3be2('0x34')](_0x517913[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x221117[_0x3be2('0x32')][_0x3be2('0x36')]));_0x360922[_0x3be2('0x35')]=_0x360922[_0x3be2('0x35')][_0x3be2('0x37')]?_0x360922[_0x3be2('0x35')]:_0x517913[_0x3be2('0x30')];if(!_0x221117[_0x3be2('0x32')][_0x3be2('0x38')]('nolimit')){_0x360922['limit']=qs[_0x3be2('0x1b')](_0x221117[_0x3be2('0x32')]['limit']);_0x360922[_0x3be2('0x19')]=qs['offset'](_0x221117['query'][_0x3be2('0x19')]);}_0x360922[_0x3be2('0x39')]=qs[_0x3be2('0x3a')](_0x221117[_0x3be2('0x32')]['sort']);_0x360922[_0x3be2('0x3b')]=qs[_0x3be2('0x33')](_['pick'](_0x221117['query'],_0x517913['filters']),_0x53f3e7);if(_0x221117[_0x3be2('0x32')][_0x3be2('0x3c')]){_0x360922[_0x3be2('0x3b')]=_[_0x3be2('0x3d')](_0x360922[_0x3be2('0x3b')],{'$or':_[_0x3be2('0x2b')](_0x53f3e7,function(_0xacde1f){if(_0xacde1f['type']!=='VIRTUAL'){var _0x42ea99={};_0x42ea99[_0xacde1f[_0x3be2('0x28')]]={'$like':'%'+_0x221117[_0x3be2('0x32')][_0x3be2('0x3c')]+'%'};return _0x42ea99;}})});}_0x360922=_[_0x3be2('0x3d')]({},_0x360922,_0x221117[_0x3be2('0x3e')]);var _0x94bbed={'where':_0x360922[_0x3be2('0x3b')]};return db[_0x3be2('0x2c')][_0x3be2('0x1c')](_0x94bbed)['then'](function(_0x3bf1bf){_0x2cc1e6[_0x3be2('0x1c')]=_0x3bf1bf;if(_0x221117['query'][_0x3be2('0x3f')]){_0x360922[_0x3be2('0x40')]=[{'all':!![]}];}return db[_0x3be2('0x2c')]['findAll'](_0x360922);})[_0x3be2('0x23')](function(_0x1ef324){_0x2cc1e6['rows']=_0x1ef324;return _0x2cc1e6;})[_0x3be2('0x23')](respondWithFilteredResult(_0x10aedd,_0x360922))[_0x3be2('0x41')](handleError(_0x10aedd,null));};exports[_0x3be2('0x42')]=function(_0x419565,_0x116207){var _0x5a2364={'raw':![],'where':{'id':_0x419565[_0x3be2('0x43')]['id']}},_0x3e472f={};_0x3e472f[_0x3be2('0x30')]=_[_0x3be2('0x31')](db[_0x3be2('0x2c')][_0x3be2('0x2d')]);_0x3e472f[_0x3be2('0x32')]=_[_0x3be2('0x31')](_0x419565[_0x3be2('0x32')]);_0x3e472f[_0x3be2('0x33')]=_['intersection'](_0x3e472f[_0x3be2('0x30')],_0x3e472f['query']);_0x5a2364[_0x3be2('0x35')]=_[_0x3be2('0x34')](_0x3e472f[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x419565[_0x3be2('0x32')][_0x3be2('0x36')]));_0x5a2364[_0x3be2('0x35')]=_0x5a2364[_0x3be2('0x35')]['length']?_0x5a2364[_0x3be2('0x35')]:_0x3e472f[_0x3be2('0x30')];if(_0x419565[_0x3be2('0x32')][_0x3be2('0x3f')]){_0x5a2364[_0x3be2('0x40')]=[{'all':!![]}];}_0x5a2364=_[_0x3be2('0x3d')]({},_0x5a2364,_0x419565['options']);return db[_0x3be2('0x2c')][_0x3be2('0x44')](_0x5a2364)[_0x3be2('0x23')](handleEntityNotFound(_0x116207,null))['then'](respondWithResult(_0x116207,null))[_0x3be2('0x41')](handleError(_0x116207,null));};exports['create']=function(_0x4f6458,_0x5c0dcf){return db[_0x3be2('0x2c')]['create'](_0x4f6458['body'],{})['then'](respondWithResult(_0x5c0dcf,0xc9))[_0x3be2('0x41')](handleError(_0x5c0dcf,null));};exports[_0x3be2('0x21')]=function(_0x175d45,_0x1b6c96){if(_0x175d45[_0x3be2('0x45')]['id']){delete _0x175d45[_0x3be2('0x45')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x175d45[_0x3be2('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b6c96,null))['then'](saveUpdates(_0x175d45[_0x3be2('0x45')],null))[_0x3be2('0x23')](respondWithResult(_0x1b6c96,null))[_0x3be2('0x41')](handleError(_0x1b6c96,null));};exports[_0x3be2('0x22')]=function(_0x35ed3d,_0x1d75a4){return db[_0x3be2('0x2c')][_0x3be2('0x44')]({'where':{'id':_0x35ed3d['params']['id']}})[_0x3be2('0x23')](handleEntityNotFound(_0x1d75a4,null))[_0x3be2('0x23')](removeEntity(_0x1d75a4,null))[_0x3be2('0x41')](handleError(_0x1d75a4,null));};exports[_0x3be2('0x46')]=function(_0x334b05,_0x184d8d,_0xe8a923){var _0x1f4591={};var _0x274f09={};var _0x112690;var _0x38b0a5;return db['VtigerConfiguration'][_0x3be2('0x47')]({'where':{'id':_0x334b05[_0x3be2('0x43')]['id']}})['then'](handleEntityNotFound(_0x184d8d,null))[_0x3be2('0x23')](function(_0x284424){if(_0x284424){_0x112690=_0x284424;_0x274f09[_0x3be2('0x30')]=_['keys'](db['VtigerField'][_0x3be2('0x2d')]);_0x274f09[_0x3be2('0x32')]=_[_0x3be2('0x31')](_0x334b05[_0x3be2('0x32')]);_0x274f09[_0x3be2('0x33')]=_[_0x3be2('0x34')](_0x274f09[_0x3be2('0x30')],_0x274f09[_0x3be2('0x32')]);_0x1f4591['attributes']=_[_0x3be2('0x34')](_0x274f09[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x334b05['query'][_0x3be2('0x36')]));_0x1f4591['attributes']=_0x1f4591['attributes'][_0x3be2('0x37')]?_0x1f4591[_0x3be2('0x35')]:_0x274f09['model'];_0x1f4591['order']=qs['sort'](_0x334b05[_0x3be2('0x32')]['sort']);_0x1f4591[_0x3be2('0x3b')]=qs[_0x3be2('0x33')](_[_0x3be2('0x48')](_0x334b05['query'],_0x274f09[_0x3be2('0x33')]));if(_0x334b05[_0x3be2('0x32')][_0x3be2('0x3c')]){_0x1f4591[_0x3be2('0x3b')]=_[_0x3be2('0x3d')](_0x1f4591['where'],{'$or':_[_0x3be2('0x2b')](_0x1f4591[_0x3be2('0x35')],function(_0x150c18){var _0x2423d9={};_0x2423d9[_0x150c18]={'$like':'%'+_0x334b05['query'][_0x3be2('0x3c')]+'%'};return _0x2423d9;})});}_0x1f4591=_[_0x3be2('0x3d')]({},_0x1f4591,_0x334b05[_0x3be2('0x3e')]);return _0x112690[_0x3be2('0x46')](_0x1f4591);}})[_0x3be2('0x23')](function(_0x497669){if(_0x497669){_0x38b0a5=_0x497669[_0x3be2('0x37')];if(!_0x334b05[_0x3be2('0x32')][_0x3be2('0x38')]('nolimit')){_0x1f4591[_0x3be2('0x1b')]=qs[_0x3be2('0x1b')](_0x334b05[_0x3be2('0x32')][_0x3be2('0x1b')]);_0x1f4591['offset']=qs[_0x3be2('0x19')](_0x334b05[_0x3be2('0x32')][_0x3be2('0x19')]);}return _0x112690[_0x3be2('0x46')](_0x1f4591);}})['then'](function(_0x5ad08c){if(_0x5ad08c){return _0x5ad08c?{'count':_0x38b0a5,'rows':_0x5ad08c}:null;}})['then'](respondWithResult(_0x184d8d,null))[_0x3be2('0x41')](handleError(_0x184d8d,null));};exports[_0x3be2('0x49')]=function(_0x223e8f,_0x256100,_0x46076a){var _0x551c7c={};var _0xb23f2={};var _0x4d94f7;var _0x3516f9;return db[_0x3be2('0x2c')][_0x3be2('0x47')]({'where':{'id':_0x223e8f[_0x3be2('0x43')]['id']}})['then'](handleEntityNotFound(_0x256100,null))['then'](function(_0x32249e){if(_0x32249e){_0x4d94f7=_0x32249e;_0xb23f2['model']=_[_0x3be2('0x31')](db[_0x3be2('0x4a')]['rawAttributes']);_0xb23f2['query']=_[_0x3be2('0x31')](_0x223e8f[_0x3be2('0x32')]);_0xb23f2[_0x3be2('0x33')]=_[_0x3be2('0x34')](_0xb23f2[_0x3be2('0x30')],_0xb23f2[_0x3be2('0x32')]);_0x551c7c[_0x3be2('0x35')]=_['intersection'](_0xb23f2[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x223e8f['query'][_0x3be2('0x36')]));_0x551c7c[_0x3be2('0x35')]=_0x551c7c[_0x3be2('0x35')][_0x3be2('0x37')]?_0x551c7c[_0x3be2('0x35')]:_0xb23f2[_0x3be2('0x30')];_0x551c7c[_0x3be2('0x39')]=qs['sort'](_0x223e8f[_0x3be2('0x32')][_0x3be2('0x3a')]);_0x551c7c[_0x3be2('0x3b')]=qs['filters'](_[_0x3be2('0x48')](_0x223e8f[_0x3be2('0x32')],_0xb23f2[_0x3be2('0x33')]));if(_0x223e8f[_0x3be2('0x32')]['filter']){_0x551c7c[_0x3be2('0x3b')]=_[_0x3be2('0x3d')](_0x551c7c[_0x3be2('0x3b')],{'$or':_[_0x3be2('0x2b')](_0x551c7c[_0x3be2('0x35')],function(_0x525879){var _0x29de6c={};_0x29de6c[_0x525879]={'$like':'%'+_0x223e8f[_0x3be2('0x32')][_0x3be2('0x3c')]+'%'};return _0x29de6c;})});}_0x551c7c=_[_0x3be2('0x3d')]({},_0x551c7c,_0x223e8f[_0x3be2('0x3e')]);return _0x4d94f7['getSubjects'](_0x551c7c);}})[_0x3be2('0x23')](function(_0x1761b5){if(_0x1761b5){_0x3516f9=_0x1761b5[_0x3be2('0x37')];if(!_0x223e8f[_0x3be2('0x32')][_0x3be2('0x38')](_0x3be2('0x4b'))){_0x551c7c[_0x3be2('0x1b')]=qs[_0x3be2('0x1b')](_0x223e8f[_0x3be2('0x32')][_0x3be2('0x1b')]);_0x551c7c['offset']=qs[_0x3be2('0x19')](_0x223e8f[_0x3be2('0x32')]['offset']);}return _0x4d94f7[_0x3be2('0x49')](_0x551c7c);}})[_0x3be2('0x23')](function(_0x37646d){if(_0x37646d){return _0x37646d?{'count':_0x3516f9,'rows':_0x37646d}:null;}})[_0x3be2('0x23')](respondWithResult(_0x256100,null))['catch'](handleError(_0x256100,null));};exports['getDescriptions']=function(_0x1635d3,_0x18e09b,_0x407f18){var _0x5cb764={};var _0x8acee4={};var _0x435cdd;var _0x8892a8;return db[_0x3be2('0x2c')]['findOne']({'where':{'id':_0x1635d3[_0x3be2('0x43')]['id']}})['then'](handleEntityNotFound(_0x18e09b,null))[_0x3be2('0x23')](function(_0x35fe34){if(_0x35fe34){_0x435cdd=_0x35fe34;_0x8acee4[_0x3be2('0x30')]=_[_0x3be2('0x31')](db[_0x3be2('0x4a')][_0x3be2('0x2d')]);_0x8acee4[_0x3be2('0x32')]=_[_0x3be2('0x31')](_0x1635d3[_0x3be2('0x32')]);_0x8acee4[_0x3be2('0x33')]=_[_0x3be2('0x34')](_0x8acee4[_0x3be2('0x30')],_0x8acee4[_0x3be2('0x32')]);_0x5cb764[_0x3be2('0x35')]=_[_0x3be2('0x34')](_0x8acee4[_0x3be2('0x30')],qs[_0x3be2('0x36')](_0x1635d3[_0x3be2('0x32')][_0x3be2('0x36')]));_0x5cb764[_0x3be2('0x35')]=_0x5cb764[_0x3be2('0x35')][_0x3be2('0x37')]?_0x5cb764[_0x3be2('0x35')]:_0x8acee4[_0x3be2('0x30')];_0x5cb764[_0x3be2('0x39')]=qs[_0x3be2('0x3a')](_0x1635d3[_0x3be2('0x32')][_0x3be2('0x3a')]);_0x5cb764[_0x3be2('0x3b')]=qs[_0x3be2('0x33')](_[_0x3be2('0x48')](_0x1635d3[_0x3be2('0x32')],_0x8acee4['filters']));if(_0x1635d3[_0x3be2('0x32')][_0x3be2('0x3c')]){_0x5cb764[_0x3be2('0x3b')]=_[_0x3be2('0x3d')](_0x5cb764[_0x3be2('0x3b')],{'$or':_[_0x3be2('0x2b')](_0x5cb764['attributes'],function(_0x2b1749){var _0x417f1c={};_0x417f1c[_0x2b1749]={'$like':'%'+_0x1635d3[_0x3be2('0x32')]['filter']+'%'};return _0x417f1c;})});}_0x5cb764=_[_0x3be2('0x3d')]({},_0x5cb764,_0x1635d3['options']);return _0x435cdd['getDescriptions'](_0x5cb764);}})[_0x3be2('0x23')](function(_0x194e0a){if(_0x194e0a){_0x8892a8=_0x194e0a[_0x3be2('0x37')];if(!_0x1635d3[_0x3be2('0x32')][_0x3be2('0x38')](_0x3be2('0x4b'))){_0x5cb764[_0x3be2('0x1b')]=qs[_0x3be2('0x1b')](_0x1635d3[_0x3be2('0x32')][_0x3be2('0x1b')]);_0x5cb764[_0x3be2('0x19')]=qs['offset'](_0x1635d3[_0x3be2('0x32')][_0x3be2('0x19')]);}return _0x435cdd[_0x3be2('0x4c')](_0x5cb764);}})[_0x3be2('0x23')](function(_0x15b579){if(_0x15b579){return _0x15b579?{'count':_0x8892a8,'rows':_0x15b579}:null;}})['then'](respondWithResult(_0x18e09b,null))[_0x3be2('0x41')](handleError(_0x18e09b,null));}; \ No newline at end of file +var _0x9d67=['error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','catch','show','params','length','find','create','body','destroy','getFields','findOne','VtigerField','pick','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then'];(function(_0x30084c,_0x336a0a){var _0x4cb774=function(_0x3b5c65){while(--_0x3b5c65){_0x30084c['push'](_0x30084c['shift']());}};_0x4cb774(++_0x336a0a);}(_0x9d67,0x78));var _0x79d6=function(_0x5e0099,_0x511765){_0x5e0099=_0x5e0099-0x0;var _0x40d19c=_0x9d67[_0x5e0099];return _0x40d19c;};'use strict';var emlformat=require(_0x79d6('0x0'));var rimraf=require(_0x79d6('0x1'));var zipdir=require(_0x79d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79d6('0x3'));var moment=require(_0x79d6('0x4'));var BPromise=require(_0x79d6('0x5'));var Mustache=require(_0x79d6('0x6'));var util=require('util');var path=require(_0x79d6('0x7'));var sox=require(_0x79d6('0x8'));var csv=require('to-csv');var ejs=require(_0x79d6('0x9'));var fs=require('fs');var fs_extra=require(_0x79d6('0xa'));var _=require('lodash');var squel=require(_0x79d6('0xb'));var crypto=require(_0x79d6('0xc'));var jsforce=require(_0x79d6('0xd'));var deskjs=require(_0x79d6('0xe'));var toCsv=require(_0x79d6('0xf'));var querystring=require(_0x79d6('0x10'));var Papa=require(_0x79d6('0x11'));var Redis=require(_0x79d6('0x12'));var authService=require(_0x79d6('0x13'));var qs=require(_0x79d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79d6('0x15'));var logger=require(_0x79d6('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x79d6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8e770f,_0x35c8ac){_0x35c8ac=_0x35c8ac||0xcc;return function(_0x1b07ff){if(_0x1b07ff){return _0x8e770f[_0x79d6('0x18')](_0x35c8ac);}return _0x8e770f[_0x79d6('0x19')](_0x35c8ac)[_0x79d6('0x1a')]();};}function respondWithResult(_0x5072ad,_0x456bda){_0x456bda=_0x456bda||0xc8;return function(_0x518928){if(_0x518928){return _0x5072ad[_0x79d6('0x19')](_0x456bda)[_0x79d6('0x1b')](_0x518928);}};}function respondWithFilteredResult(_0x26bfd1,_0x32ac89){return function(_0x171ad8){if(_0x171ad8){var _0x95bb24=typeof _0x32ac89[_0x79d6('0x1c')]==='undefined'&&typeof _0x32ac89[_0x79d6('0x1d')]===_0x79d6('0x1e');var _0xd42597=_0x171ad8['count'];var _0x5aba9d=_0x95bb24?0x0:_0x32ac89[_0x79d6('0x1c')];var _0xe719bc=_0x95bb24?_0x171ad8[_0x79d6('0x1f')]:_0x32ac89[_0x79d6('0x1c')]+_0x32ac89[_0x79d6('0x1d')];var _0x458ff0;if(_0xe719bc>=_0xd42597){_0xe719bc=_0xd42597;_0x458ff0=0xc8;}else{_0x458ff0=0xce;}_0x26bfd1[_0x79d6('0x19')](_0x458ff0);return _0x26bfd1[_0x79d6('0x20')](_0x79d6('0x21'),_0x5aba9d+'-'+_0xe719bc+'/'+_0xd42597)['json'](_0x171ad8);}return null;};}function patchUpdates(_0x5622eb){return function(_0x5800f8){try{jsonpatch[_0x79d6('0x22')](_0x5800f8,_0x5622eb,!![]);}catch(_0x3b015c){return BPromise[_0x79d6('0x23')](_0x3b015c);}return _0x5800f8['save']();};}function saveUpdates(_0x589186,_0x4654c){return function(_0x32a992){if(_0x32a992){return _0x32a992[_0x79d6('0x24')](_0x589186)[_0x79d6('0x25')](function(_0xe11c86){return _0xe11c86;});}return null;};}function removeEntity(_0x27987e,_0x45ebc6){return function(_0x31f4b6){if(_0x31f4b6){return _0x31f4b6['destroy']()[_0x79d6('0x25')](function(){_0x27987e[_0x79d6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc748,_0x2ebb4c){return function(_0x362c7b){if(!_0x362c7b){_0x3cc748['sendStatus'](0x194);}return _0x362c7b;};}function handleError(_0x40b0f2,_0x25fca1){_0x25fca1=_0x25fca1||0x1f4;return function(_0x338e16){logger[_0x79d6('0x26')](_0x338e16[_0x79d6('0x27')]);if(_0x338e16['name']){delete _0x338e16[_0x79d6('0x28')];}_0x40b0f2[_0x79d6('0x19')](_0x25fca1)[_0x79d6('0x29')](_0x338e16);};}exports['index']=function(_0x4c4b7a,_0x4de3c0){var _0x13b9bf={},_0x55af07={},_0x415e1c={'count':0x0,'rows':[]};var _0x10d585=_[_0x79d6('0x2a')](db[_0x79d6('0x2b')][_0x79d6('0x2c')],function(_0x2d92f1){return{'name':_0x2d92f1[_0x79d6('0x2d')],'type':_0x2d92f1[_0x79d6('0x2e')][_0x79d6('0x2f')]};});_0x55af07[_0x79d6('0x30')]=_['map'](_0x10d585,_0x79d6('0x28'));_0x55af07['query']=_[_0x79d6('0x31')](_0x4c4b7a['query']);_0x55af07[_0x79d6('0x32')]=_['intersection'](_0x55af07[_0x79d6('0x30')],_0x55af07[_0x79d6('0x33')]);_0x13b9bf[_0x79d6('0x34')]=_[_0x79d6('0x35')](_0x55af07[_0x79d6('0x30')],qs[_0x79d6('0x36')](_0x4c4b7a[_0x79d6('0x33')][_0x79d6('0x36')]));_0x13b9bf[_0x79d6('0x34')]=_0x13b9bf['attributes']['length']?_0x13b9bf[_0x79d6('0x34')]:_0x55af07['model'];if(!_0x4c4b7a['query'][_0x79d6('0x37')](_0x79d6('0x38'))){_0x13b9bf[_0x79d6('0x1d')]=qs['limit'](_0x4c4b7a[_0x79d6('0x33')][_0x79d6('0x1d')]);_0x13b9bf['offset']=qs['offset'](_0x4c4b7a[_0x79d6('0x33')][_0x79d6('0x1c')]);}_0x13b9bf[_0x79d6('0x39')]=qs[_0x79d6('0x3a')](_0x4c4b7a[_0x79d6('0x33')][_0x79d6('0x3a')]);_0x13b9bf[_0x79d6('0x3b')]=qs[_0x79d6('0x32')](_['pick'](_0x4c4b7a[_0x79d6('0x33')],_0x55af07[_0x79d6('0x32')]),_0x10d585);if(_0x4c4b7a[_0x79d6('0x33')]['filter']){_0x13b9bf['where']=_['merge'](_0x13b9bf[_0x79d6('0x3b')],{'$or':_[_0x79d6('0x2a')](_0x10d585,function(_0xc03f4e){if(_0xc03f4e[_0x79d6('0x2e')]!=='VIRTUAL'){var _0x3fec8d={};_0x3fec8d[_0xc03f4e[_0x79d6('0x28')]]={'$like':'%'+_0x4c4b7a[_0x79d6('0x33')]['filter']+'%'};return _0x3fec8d;}})});}_0x13b9bf=_[_0x79d6('0x3c')]({},_0x13b9bf,_0x4c4b7a[_0x79d6('0x3d')]);var _0x15765e={'where':_0x13b9bf[_0x79d6('0x3b')]};return db[_0x79d6('0x2b')][_0x79d6('0x1f')](_0x15765e)['then'](function(_0x4be267){_0x415e1c[_0x79d6('0x1f')]=_0x4be267;if(_0x4c4b7a[_0x79d6('0x33')][_0x79d6('0x3e')]){_0x13b9bf[_0x79d6('0x3f')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x13b9bf);})[_0x79d6('0x25')](function(_0x462b5c){_0x415e1c['rows']=_0x462b5c;return _0x415e1c;})[_0x79d6('0x25')](respondWithFilteredResult(_0x4de3c0,_0x13b9bf))[_0x79d6('0x40')](handleError(_0x4de3c0,null));};exports[_0x79d6('0x41')]=function(_0x49e469,_0x418e71){var _0x2ab43a={'raw':![],'where':{'id':_0x49e469[_0x79d6('0x42')]['id']}},_0x5ad156={};_0x5ad156[_0x79d6('0x30')]=_['keys'](db[_0x79d6('0x2b')][_0x79d6('0x2c')]);_0x5ad156[_0x79d6('0x33')]=_[_0x79d6('0x31')](_0x49e469['query']);_0x5ad156[_0x79d6('0x32')]=_[_0x79d6('0x35')](_0x5ad156['model'],_0x5ad156[_0x79d6('0x33')]);_0x2ab43a[_0x79d6('0x34')]=_[_0x79d6('0x35')](_0x5ad156[_0x79d6('0x30')],qs[_0x79d6('0x36')](_0x49e469['query']['fields']));_0x2ab43a[_0x79d6('0x34')]=_0x2ab43a['attributes'][_0x79d6('0x43')]?_0x2ab43a['attributes']:_0x5ad156[_0x79d6('0x30')];if(_0x49e469[_0x79d6('0x33')][_0x79d6('0x3e')]){_0x2ab43a[_0x79d6('0x3f')]=[{'all':!![]}];}_0x2ab43a=_['merge']({},_0x2ab43a,_0x49e469['options']);return db[_0x79d6('0x2b')][_0x79d6('0x44')](_0x2ab43a)['then'](handleEntityNotFound(_0x418e71,null))[_0x79d6('0x25')](respondWithResult(_0x418e71,null))[_0x79d6('0x40')](handleError(_0x418e71,null));};exports['create']=function(_0xe59984,_0x116be1){return db[_0x79d6('0x2b')][_0x79d6('0x45')](_0xe59984[_0x79d6('0x46')],{})['then'](respondWithResult(_0x116be1,0xc9))[_0x79d6('0x40')](handleError(_0x116be1,null));};exports[_0x79d6('0x24')]=function(_0xc16323,_0x3eeea6){if(_0xc16323[_0x79d6('0x46')]['id']){delete _0xc16323[_0x79d6('0x46')]['id'];}return db[_0x79d6('0x2b')][_0x79d6('0x44')]({'where':{'id':_0xc16323[_0x79d6('0x42')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x3eeea6,null))[_0x79d6('0x25')](saveUpdates(_0xc16323['body'],null))[_0x79d6('0x25')](respondWithResult(_0x3eeea6,null))['catch'](handleError(_0x3eeea6,null));};exports[_0x79d6('0x47')]=function(_0x5ad946,_0x287027){return db[_0x79d6('0x2b')]['find']({'where':{'id':_0x5ad946[_0x79d6('0x42')]['id']}})['then'](handleEntityNotFound(_0x287027,null))['then'](removeEntity(_0x287027,null))[_0x79d6('0x40')](handleError(_0x287027,null));};exports[_0x79d6('0x48')]=function(_0x4457f6,_0x3620bf,_0x5ac30f){var _0xa872f7={};var _0x2103d5={};var _0x22f477;var _0x5412d1;return db[_0x79d6('0x2b')][_0x79d6('0x49')]({'where':{'id':_0x4457f6[_0x79d6('0x42')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x3620bf,null))['then'](function(_0x5426df){if(_0x5426df){_0x22f477=_0x5426df;_0x2103d5[_0x79d6('0x30')]=_['keys'](db[_0x79d6('0x4a')]['rawAttributes']);_0x2103d5[_0x79d6('0x33')]=_[_0x79d6('0x31')](_0x4457f6[_0x79d6('0x33')]);_0x2103d5[_0x79d6('0x32')]=_[_0x79d6('0x35')](_0x2103d5['model'],_0x2103d5['query']);_0xa872f7[_0x79d6('0x34')]=_[_0x79d6('0x35')](_0x2103d5['model'],qs['fields'](_0x4457f6[_0x79d6('0x33')][_0x79d6('0x36')]));_0xa872f7['attributes']=_0xa872f7['attributes'][_0x79d6('0x43')]?_0xa872f7[_0x79d6('0x34')]:_0x2103d5[_0x79d6('0x30')];_0xa872f7[_0x79d6('0x39')]=qs[_0x79d6('0x3a')](_0x4457f6['query'][_0x79d6('0x3a')]);_0xa872f7[_0x79d6('0x3b')]=qs['filters'](_[_0x79d6('0x4b')](_0x4457f6['query'],_0x2103d5[_0x79d6('0x32')]));if(_0x4457f6[_0x79d6('0x33')][_0x79d6('0x4c')]){_0xa872f7[_0x79d6('0x3b')]=_[_0x79d6('0x3c')](_0xa872f7[_0x79d6('0x3b')],{'$or':_['map'](_0xa872f7[_0x79d6('0x34')],function(_0x3b2d88){var _0x261862={};_0x261862[_0x3b2d88]={'$like':'%'+_0x4457f6[_0x79d6('0x33')][_0x79d6('0x4c')]+'%'};return _0x261862;})});}_0xa872f7=_[_0x79d6('0x3c')]({},_0xa872f7,_0x4457f6[_0x79d6('0x3d')]);return _0x22f477['getFields'](_0xa872f7);}})[_0x79d6('0x25')](function(_0x5a1733){if(_0x5a1733){_0x5412d1=_0x5a1733[_0x79d6('0x43')];if(!_0x4457f6[_0x79d6('0x33')][_0x79d6('0x37')](_0x79d6('0x38'))){_0xa872f7[_0x79d6('0x1d')]=qs[_0x79d6('0x1d')](_0x4457f6[_0x79d6('0x33')][_0x79d6('0x1d')]);_0xa872f7[_0x79d6('0x1c')]=qs[_0x79d6('0x1c')](_0x4457f6[_0x79d6('0x33')][_0x79d6('0x1c')]);}return _0x22f477[_0x79d6('0x48')](_0xa872f7);}})[_0x79d6('0x25')](function(_0x2fcb05){if(_0x2fcb05){return _0x2fcb05?{'count':_0x5412d1,'rows':_0x2fcb05}:null;}})['then'](respondWithResult(_0x3620bf,null))[_0x79d6('0x40')](handleError(_0x3620bf,null));};exports[_0x79d6('0x4d')]=function(_0x58b7e7,_0x599027,_0x1c3532){var _0x23b675={};var _0x542495={};var _0x23436c;var _0x55c8ee;return db[_0x79d6('0x2b')][_0x79d6('0x49')]({'where':{'id':_0x58b7e7[_0x79d6('0x42')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x599027,null))[_0x79d6('0x25')](function(_0x3e9c48){if(_0x3e9c48){_0x23436c=_0x3e9c48;_0x542495[_0x79d6('0x30')]=_['keys'](db[_0x79d6('0x4a')][_0x79d6('0x2c')]);_0x542495[_0x79d6('0x33')]=_['keys'](_0x58b7e7[_0x79d6('0x33')]);_0x542495[_0x79d6('0x32')]=_[_0x79d6('0x35')](_0x542495['model'],_0x542495[_0x79d6('0x33')]);_0x23b675[_0x79d6('0x34')]=_[_0x79d6('0x35')](_0x542495[_0x79d6('0x30')],qs[_0x79d6('0x36')](_0x58b7e7[_0x79d6('0x33')]['fields']));_0x23b675[_0x79d6('0x34')]=_0x23b675[_0x79d6('0x34')][_0x79d6('0x43')]?_0x23b675[_0x79d6('0x34')]:_0x542495[_0x79d6('0x30')];_0x23b675[_0x79d6('0x39')]=qs['sort'](_0x58b7e7['query'][_0x79d6('0x3a')]);_0x23b675[_0x79d6('0x3b')]=qs['filters'](_[_0x79d6('0x4b')](_0x58b7e7[_0x79d6('0x33')],_0x542495[_0x79d6('0x32')]));if(_0x58b7e7[_0x79d6('0x33')][_0x79d6('0x4c')]){_0x23b675[_0x79d6('0x3b')]=_[_0x79d6('0x3c')](_0x23b675[_0x79d6('0x3b')],{'$or':_[_0x79d6('0x2a')](_0x23b675[_0x79d6('0x34')],function(_0xea05dd){var _0x456637={};_0x456637[_0xea05dd]={'$like':'%'+_0x58b7e7[_0x79d6('0x33')][_0x79d6('0x4c')]+'%'};return _0x456637;})});}_0x23b675=_['merge']({},_0x23b675,_0x58b7e7[_0x79d6('0x3d')]);return _0x23436c[_0x79d6('0x4d')](_0x23b675);}})[_0x79d6('0x25')](function(_0x437b63){if(_0x437b63){_0x55c8ee=_0x437b63[_0x79d6('0x43')];if(!_0x58b7e7[_0x79d6('0x33')][_0x79d6('0x37')]('nolimit')){_0x23b675[_0x79d6('0x1d')]=qs['limit'](_0x58b7e7[_0x79d6('0x33')]['limit']);_0x23b675[_0x79d6('0x1c')]=qs['offset'](_0x58b7e7[_0x79d6('0x33')][_0x79d6('0x1c')]);}return _0x23436c[_0x79d6('0x4d')](_0x23b675);}})['then'](function(_0xbd02e8){if(_0xbd02e8){return _0xbd02e8?{'count':_0x55c8ee,'rows':_0xbd02e8}:null;}})['then'](respondWithResult(_0x599027,null))['catch'](handleError(_0x599027,null));};exports[_0x79d6('0x4e')]=function(_0x42ae33,_0x584e8c,_0x595391){var _0x521747={};var _0x2c553d={};var _0x7a809f;var _0x2a228f;return db['VtigerConfiguration'][_0x79d6('0x49')]({'where':{'id':_0x42ae33[_0x79d6('0x42')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x584e8c,null))['then'](function(_0x2f6348){if(_0x2f6348){_0x7a809f=_0x2f6348;_0x2c553d[_0x79d6('0x30')]=_['keys'](db[_0x79d6('0x4a')][_0x79d6('0x2c')]);_0x2c553d[_0x79d6('0x33')]=_[_0x79d6('0x31')](_0x42ae33[_0x79d6('0x33')]);_0x2c553d[_0x79d6('0x32')]=_[_0x79d6('0x35')](_0x2c553d['model'],_0x2c553d[_0x79d6('0x33')]);_0x521747[_0x79d6('0x34')]=_[_0x79d6('0x35')](_0x2c553d[_0x79d6('0x30')],qs['fields'](_0x42ae33[_0x79d6('0x33')][_0x79d6('0x36')]));_0x521747[_0x79d6('0x34')]=_0x521747['attributes'][_0x79d6('0x43')]?_0x521747[_0x79d6('0x34')]:_0x2c553d['model'];_0x521747[_0x79d6('0x39')]=qs[_0x79d6('0x3a')](_0x42ae33['query'][_0x79d6('0x3a')]);_0x521747[_0x79d6('0x3b')]=qs[_0x79d6('0x32')](_[_0x79d6('0x4b')](_0x42ae33[_0x79d6('0x33')],_0x2c553d[_0x79d6('0x32')]));if(_0x42ae33[_0x79d6('0x33')]['filter']){_0x521747[_0x79d6('0x3b')]=_[_0x79d6('0x3c')](_0x521747[_0x79d6('0x3b')],{'$or':_[_0x79d6('0x2a')](_0x521747[_0x79d6('0x34')],function(_0x3edd4b){var _0x4d0b4f={};_0x4d0b4f[_0x3edd4b]={'$like':'%'+_0x42ae33[_0x79d6('0x33')][_0x79d6('0x4c')]+'%'};return _0x4d0b4f;})});}_0x521747=_[_0x79d6('0x3c')]({},_0x521747,_0x42ae33[_0x79d6('0x3d')]);return _0x7a809f['getDescriptions'](_0x521747);}})[_0x79d6('0x25')](function(_0x62310c){if(_0x62310c){_0x2a228f=_0x62310c['length'];if(!_0x42ae33['query'][_0x79d6('0x37')](_0x79d6('0x38'))){_0x521747[_0x79d6('0x1d')]=qs[_0x79d6('0x1d')](_0x42ae33['query'][_0x79d6('0x1d')]);_0x521747[_0x79d6('0x1c')]=qs['offset'](_0x42ae33['query'][_0x79d6('0x1c')]);}return _0x7a809f['getDescriptions'](_0x521747);}})[_0x79d6('0x25')](function(_0xf65006){if(_0xf65006){return _0xf65006?{'count':_0x2a228f,'rows':_0xf65006}:null;}})[_0x79d6('0x25')](respondWithResult(_0x584e8c,null))[_0x79d6('0x40')](handleError(_0x584e8c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 2fb6db8..c9cd6c0 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 _0x6d68=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6d68,0xba));var _0x86d6=function(_0x48f58f,_0x3a9b8c){_0x48f58f=_0x48f58f-0x0;var _0x307523=_0x6d68[_0x48f58f];return _0x307523;};'use strict';var _=require(_0x86d6('0x0'));var util=require(_0x86d6('0x1'));var logger=require(_0x86d6('0x2'))(_0x86d6('0x3'));var moment=require(_0x86d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x86d6('0x5'));var fs=require('fs');var path=require(_0x86d6('0x6'));var rimraf=require(_0x86d6('0x7'));var config=require(_0x86d6('0x8'));var attributes=require(_0x86d6('0x9'));module[_0x86d6('0xa')]=function(_0x921e42,_0x28a82d){return _0x921e42[_0x86d6('0xb')](_0x86d6('0xc'),attributes,{'tableName':_0x86d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a1b=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9a1b,0xdd));var _0xb9a1=function(_0x801f9f,_0x44fc40){_0x801f9f=_0x801f9f-0x0;var _0x3d67ef=_0x9a1b[_0x801f9f];return _0x3d67ef;};'use strict';var _=require(_0xb9a1('0x0'));var util=require(_0xb9a1('0x1'));var logger=require(_0xb9a1('0x2'))(_0xb9a1('0x3'));var moment=require(_0xb9a1('0x4'));var BPromise=require(_0xb9a1('0x5'));var rp=require(_0xb9a1('0x6'));var fs=require('fs');var path=require(_0xb9a1('0x7'));var rimraf=require(_0xb9a1('0x8'));var config=require(_0xb9a1('0x9'));var attributes=require(_0xb9a1('0xa'));module['exports']=function(_0x1b7ad7,_0x4d00c0){return _0x1b7ad7[_0xb9a1('0xb')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 5d19e4f..e9f65b0 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 _0xe93d=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe93d,0xee));var _0xde93=function(_0xe63662,_0x468306){_0xe63662=_0xe63662-0x0;var _0x3f81ae=_0xe93d[_0xe63662];return _0x3f81ae;};'use strict';var _=require(_0xde93('0x0'));var util=require(_0xde93('0x1'));var moment=require(_0xde93('0x2'));var BPromise=require(_0xde93('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde93('0x4'));var db=require(_0xde93('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde93('0x6'))(_0xde93('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xde93('0x8')][_0xde93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd7f79d,_0x4d977b,_0x1f7411){return new BPromise(function(_0x55c2,_0x5857ce){return client['request'](_0xd7f79d,_0x1f7411)[_0xde93('0xa')](function(_0x1ae5fa){logger[_0xde93('0xb')](_0xde93('0xc'),_0x4d977b,_0xde93('0xd'));logger['debug'](_0xde93('0xe'),_0x4d977b,'request\x20sent',JSON[_0xde93('0xf')](_0x1ae5fa));if(_0x1ae5fa[_0xde93('0x10')]){if(_0x1ae5fa[_0xde93('0x10')][_0xde93('0x11')]===0x1f4){logger[_0xde93('0x10')](_0xde93('0xc'),_0x4d977b,_0x1ae5fa[_0xde93('0x10')][_0xde93('0x12')]);return _0x5857ce(_0x1ae5fa[_0xde93('0x10')][_0xde93('0x12')]);}logger[_0xde93('0x10')](_0xde93('0xc'),_0x4d977b,_0x1ae5fa[_0xde93('0x10')][_0xde93('0x12')]);return _0x55c2(_0x1ae5fa[_0xde93('0x10')][_0xde93('0x12')]);}else{logger[_0xde93('0xb')](_0xde93('0xc'),_0x4d977b,_0xde93('0xd'));_0x55c2(_0x1ae5fa[_0xde93('0x13')]['message']);}})[_0xde93('0x14')](function(_0x4c1d0a){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4d977b,_0x4c1d0a);_0x5857ce(_0x4c1d0a);});});} \ No newline at end of file +var _0x6dc8=['VtigerConfiguration,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa11834,_0x289cd3){var _0x3dc976=function(_0x25b03c){while(--_0x25b03c){_0xa11834['push'](_0xa11834['shift']());}};_0x3dc976(++_0x289cd3);}(_0x6dc8,0xb2));var _0x86dc=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x6dc8[_0x134192];return _0x3cd080;};'use strict';var _=require('lodash');var util=require(_0x86dc('0x0'));var moment=require(_0x86dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x86dc('0x2'));var fs=require('fs');var Redis=require(_0x86dc('0x3'));var db=require(_0x86dc('0x4'))['db'];var utils=require(_0x86dc('0x5'));var logger=require(_0x86dc('0x6'))(_0x86dc('0x7'));var config=require(_0x86dc('0x8'));var jayson=require(_0x86dc('0x9'));var client=jayson[_0x86dc('0xa')][_0x86dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b85ab,_0x4cf119,_0x4447dd){return new BPromise(function(_0x4f4b40,_0x196265){return client[_0x86dc('0xc')](_0x3b85ab,_0x4447dd)[_0x86dc('0xd')](function(_0x46a669){logger[_0x86dc('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x4cf119,'request\x20sent');logger[_0x86dc('0xf')](_0x86dc('0x10'),_0x4cf119,_0x86dc('0x11'),JSON[_0x86dc('0x12')](_0x46a669));if(_0x46a669[_0x86dc('0x13')]){if(_0x46a669['error']['code']===0x1f4){logger[_0x86dc('0x13')](_0x86dc('0x14'),_0x4cf119,_0x46a669[_0x86dc('0x13')][_0x86dc('0x15')]);return _0x196265(_0x46a669[_0x86dc('0x13')]['message']);}logger[_0x86dc('0x13')](_0x86dc('0x14'),_0x4cf119,_0x46a669['error'][_0x86dc('0x15')]);return _0x4f4b40(_0x46a669[_0x86dc('0x13')][_0x86dc('0x15')]);}else{logger[_0x86dc('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x4cf119,_0x86dc('0x11'));_0x4f4b40(_0x46a669['result'][_0x86dc('0x15')]);}})['catch'](function(_0x1ad557){logger[_0x86dc('0x13')](_0x86dc('0x14'),_0x4cf119,_0x1ad557);_0x196265(_0x1ad557);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5aa019f..5d722ee 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 _0xba36=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path'];(function(_0x30d831,_0x54cb60){var _0x41c36e=function(_0x50d1ca){while(--_0x50d1ca){_0x30d831['push'](_0x30d831['shift']());}};_0x41c36e(++_0x54cb60);}(_0xba36,0xeb));var _0x6ba3=function(_0x23d5af,_0x16110b){_0x23d5af=_0x23d5af-0x0;var _0x225f7a=_0xba36[_0x23d5af];return _0x225f7a;};'use strict';var multer=require(_0x6ba3('0x0'));var util=require(_0x6ba3('0x1'));var path=require(_0x6ba3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ba3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6ba3('0x4'));var config=require(_0x6ba3('0x5'));var controller=require(_0x6ba3('0x6'));router[_0x6ba3('0x7')]('/',auth['isAuthenticated'](),controller[_0x6ba3('0x8')]);router['get'](_0x6ba3('0x9'),auth[_0x6ba3('0xa')](),controller[_0x6ba3('0xb')]);router['post']('/',auth[_0x6ba3('0xa')](),controller[_0x6ba3('0xc')]);router['put'](_0x6ba3('0x9'),auth[_0x6ba3('0xa')](),controller[_0x6ba3('0xd')]);router[_0x6ba3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6ba3('0xf')]);module[_0x6ba3('0x10')]=router; \ No newline at end of file +var _0x3a0b=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy'];(function(_0x463985,_0x54e80b){var _0x2a6158=function(_0x49735f){while(--_0x49735f){_0x463985['push'](_0x463985['shift']());}};_0x2a6158(++_0x54e80b);}(_0x3a0b,0x1e0));var _0xb3a0=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x3a0b[_0x516ffb];return _0x319667;};'use strict';var multer=require(_0xb3a0('0x0'));var util=require('util');var path=require(_0xb3a0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb3a0('0x2'));var router=express[_0xb3a0('0x3')]();var fs_extra=require(_0xb3a0('0x4'));var auth=require(_0xb3a0('0x5'));var interaction=require(_0xb3a0('0x6'));var config=require(_0xb3a0('0x7'));var controller=require(_0xb3a0('0x8'));router['get']('/',auth[_0xb3a0('0x9')](),controller[_0xb3a0('0xa')]);router[_0xb3a0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb3a0('0xc')]);router[_0xb3a0('0xd')]('/',auth[_0xb3a0('0x9')](),controller[_0xb3a0('0xe')]);router[_0xb3a0('0xf')]('/:id',auth[_0xb3a0('0x9')](),controller[_0xb3a0('0x10')]);router[_0xb3a0('0x11')](_0xb3a0('0x12'),auth['isAuthenticated'](),controller[_0xb3a0('0x13')]);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 2dd9303..dfa3b8e 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 _0xd74a=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x59931e,_0x2c3e0d){var _0xced878=function(_0x396de6){while(--_0x396de6){_0x59931e['push'](_0x59931e['shift']());}};_0xced878(++_0x2c3e0d);}(_0xd74a,0x1ab));var _0xad74=function(_0x399fc0,_0x795ed3){_0x399fc0=_0x399fc0-0x0;var _0x4eb155=_0xd74a[_0x399fc0];return _0x4eb155;};'use strict';var Sequelize=require(_0xad74('0x0'));module[_0xad74('0x1')]={'type':{'type':Sequelize[_0xad74('0x2')](_0xad74('0x3'),_0xad74('0x4'),_0xad74('0x5'),_0xad74('0x6'),'picklist'),'defaultValue':_0xad74('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xad74('0x7')]},'keyType':{'type':Sequelize[_0xad74('0x2')]('string','variable',_0xad74('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xad74('0x7')]},'nameField':{'type':Sequelize[_0xad74('0x7')]},'customField':{'type':Sequelize[_0xad74('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad74('0x7')]}}; \ No newline at end of file +var _0xe2a4=['string','customVariable','STRING','variable','sequelize','ENUM'];(function(_0x50af79,_0x26774e){var _0xebf22a=function(_0x4493e0){while(--_0x4493e0){_0x50af79['push'](_0x50af79['shift']());}};_0xebf22a(++_0x26774e);}(_0xe2a4,0x106));var _0x4e2a=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0xe2a4[_0x2f227c];return _0x5032bc;};'use strict';var Sequelize=require(_0x4e2a('0x0'));module['exports']={'type':{'type':Sequelize[_0x4e2a('0x1')](_0x4e2a('0x2'),'variable',_0x4e2a('0x3'),'keyValue','picklist'),'defaultValue':_0x4e2a('0x2')},'content':{'type':Sequelize[_0x4e2a('0x4')]},'key':{'type':Sequelize[_0x4e2a('0x4')]},'keyType':{'type':Sequelize[_0x4e2a('0x1')](_0x4e2a('0x2'),_0x4e2a('0x5'),_0x4e2a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4e2a('0x4')]},'nameField':{'type':Sequelize[_0x4e2a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 408e7df..6a29155 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 _0x0a97=['../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','keys','intersection','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x0a97,0xce));var _0x70a9=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x0a97[_0x30c649];return _0x3edfb9;};'use strict';var emlformat=require(_0x70a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70a9('0x1'));var jsonpatch=require(_0x70a9('0x2'));var rp=require('request-promise');var moment=require(_0x70a9('0x3'));var BPromise=require(_0x70a9('0x4'));var Mustache=require(_0x70a9('0x5'));var util=require(_0x70a9('0x6'));var path=require(_0x70a9('0x7'));var sox=require(_0x70a9('0x8'));var csv=require(_0x70a9('0x9'));var ejs=require(_0x70a9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70a9('0xb'));var squel=require(_0x70a9('0xc'));var crypto=require(_0x70a9('0xd'));var jsforce=require(_0x70a9('0xe'));var deskjs=require(_0x70a9('0xf'));var toCsv=require(_0x70a9('0x9'));var querystring=require('querystring');var Papa=require(_0x70a9('0x10'));var Redis=require(_0x70a9('0x11'));var authService=require(_0x70a9('0x12'));var qs=require(_0x70a9('0x13'));var as=require(_0x70a9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70a9('0x15'))(_0x70a9('0x16'));var utils=require('../../config/utils');var config=require(_0x70a9('0x17'));var licenseUtil=require(_0x70a9('0x18'));var db=require(_0x70a9('0x19'))['db'];function respondWithStatusCode(_0x24b9d7,_0x21e736){_0x21e736=_0x21e736||0xcc;return function(_0x30f994){if(_0x30f994){return _0x24b9d7[_0x70a9('0x1a')](_0x21e736);}return _0x24b9d7['status'](_0x21e736)[_0x70a9('0x1b')]();};}function respondWithResult(_0x11c2e6,_0x203bc9){_0x203bc9=_0x203bc9||0xc8;return function(_0x582917){if(_0x582917){return _0x11c2e6[_0x70a9('0x1c')](_0x203bc9)[_0x70a9('0x1d')](_0x582917);}};}function respondWithFilteredResult(_0x4c572c,_0x19c81b){return function(_0x7c2c60){if(_0x7c2c60){var _0x4efcd1=typeof _0x19c81b[_0x70a9('0x1e')]==='undefined'&&typeof _0x19c81b[_0x70a9('0x1f')]===_0x70a9('0x20');var _0x334a95=_0x7c2c60['count'];var _0x4c2e3f=_0x4efcd1?0x0:_0x19c81b['offset'];var _0x414cac=_0x4efcd1?_0x7c2c60[_0x70a9('0x21')]:_0x19c81b['offset']+_0x19c81b[_0x70a9('0x1f')];var _0xcf373e;if(_0x414cac>=_0x334a95){_0x414cac=_0x334a95;_0xcf373e=0xc8;}else{_0xcf373e=0xce;}_0x4c572c['status'](_0xcf373e);return _0x4c572c[_0x70a9('0x22')](_0x70a9('0x23'),_0x4c2e3f+'-'+_0x414cac+'/'+_0x334a95)[_0x70a9('0x1d')](_0x7c2c60);}return null;};}function patchUpdates(_0x7ebe2d){return function(_0x50f350){try{jsonpatch[_0x70a9('0x24')](_0x50f350,_0x7ebe2d,!![]);}catch(_0x454752){return BPromise[_0x70a9('0x25')](_0x454752);}return _0x50f350['save']();};}function saveUpdates(_0x355f94,_0x3e7e1c){return function(_0x4e9db7){if(_0x4e9db7){return _0x4e9db7[_0x70a9('0x26')](_0x355f94)[_0x70a9('0x27')](function(_0x4219ac){return _0x4219ac;});}return null;};}function removeEntity(_0x2e9f3d,_0x577076){return function(_0x1d5f69){if(_0x1d5f69){return _0x1d5f69[_0x70a9('0x28')]()['then'](function(){_0x2e9f3d['status'](0xcc)[_0x70a9('0x1b')]();});}};}function handleEntityNotFound(_0x1bb879,_0x228a65){return function(_0x17d76f){if(!_0x17d76f){_0x1bb879[_0x70a9('0x1a')](0x194);}return _0x17d76f;};}function handleError(_0x525ed5,_0x216337){_0x216337=_0x216337||0x1f4;return function(_0x2e7545){logger[_0x70a9('0x29')](_0x2e7545['stack']);if(_0x2e7545[_0x70a9('0x2a')]){delete _0x2e7545[_0x70a9('0x2a')];}_0x525ed5[_0x70a9('0x1c')](_0x216337)[_0x70a9('0x2b')](_0x2e7545);};}exports[_0x70a9('0x2c')]=function(_0x5a4276,_0x395a5b){var _0x5418e4={},_0x25d82d={},_0x3634b9={'count':0x0,'rows':[]};var _0xc30adb=_[_0x70a9('0x2d')](db[_0x70a9('0x2e')][_0x70a9('0x2f')],function(_0x271286){return{'name':_0x271286[_0x70a9('0x30')],'type':_0x271286[_0x70a9('0x31')][_0x70a9('0x32')]};});_0x25d82d[_0x70a9('0x33')]=_[_0x70a9('0x2d')](_0xc30adb,_0x70a9('0x2a'));_0x25d82d[_0x70a9('0x34')]=_['keys'](_0x5a4276[_0x70a9('0x34')]);_0x25d82d[_0x70a9('0x35')]=_['intersection'](_0x25d82d[_0x70a9('0x33')],_0x25d82d[_0x70a9('0x34')]);_0x5418e4['attributes']=_['intersection'](_0x25d82d[_0x70a9('0x33')],qs['fields'](_0x5a4276[_0x70a9('0x34')][_0x70a9('0x36')]));_0x5418e4['attributes']=_0x5418e4[_0x70a9('0x37')]['length']?_0x5418e4[_0x70a9('0x37')]:_0x25d82d[_0x70a9('0x33')];if(!_0x5a4276[_0x70a9('0x34')][_0x70a9('0x38')](_0x70a9('0x39'))){_0x5418e4[_0x70a9('0x1f')]=qs[_0x70a9('0x1f')](_0x5a4276[_0x70a9('0x34')][_0x70a9('0x1f')]);_0x5418e4['offset']=qs[_0x70a9('0x1e')](_0x5a4276[_0x70a9('0x34')][_0x70a9('0x1e')]);}_0x5418e4[_0x70a9('0x3a')]=qs['sort'](_0x5a4276[_0x70a9('0x34')][_0x70a9('0x3b')]);_0x5418e4['where']=qs[_0x70a9('0x35')](_[_0x70a9('0x3c')](_0x5a4276[_0x70a9('0x34')],_0x25d82d['filters']),_0xc30adb);if(_0x5a4276[_0x70a9('0x34')][_0x70a9('0x3d')]){_0x5418e4[_0x70a9('0x3e')]=_[_0x70a9('0x3f')](_0x5418e4[_0x70a9('0x3e')],{'$or':_[_0x70a9('0x2d')](_0xc30adb,function(_0x4d831d){if(_0x4d831d[_0x70a9('0x31')]!==_0x70a9('0x40')){var _0x11e14c={};_0x11e14c[_0x4d831d[_0x70a9('0x2a')]]={'$like':'%'+_0x5a4276[_0x70a9('0x34')][_0x70a9('0x3d')]+'%'};return _0x11e14c;}})});}_0x5418e4=_[_0x70a9('0x3f')]({},_0x5418e4,_0x5a4276[_0x70a9('0x41')]);var _0x263a58={'where':_0x5418e4[_0x70a9('0x3e')]};return db[_0x70a9('0x2e')][_0x70a9('0x21')](_0x263a58)[_0x70a9('0x27')](function(_0x52b3dc){_0x3634b9[_0x70a9('0x21')]=_0x52b3dc;if(_0x5a4276['query']['includeAll']){_0x5418e4[_0x70a9('0x42')]=[{'all':!![]}];}return db[_0x70a9('0x2e')][_0x70a9('0x43')](_0x5418e4);})[_0x70a9('0x27')](function(_0x4dd449){_0x3634b9[_0x70a9('0x44')]=_0x4dd449;return _0x3634b9;})[_0x70a9('0x27')](respondWithFilteredResult(_0x395a5b,_0x5418e4))['catch'](handleError(_0x395a5b,null));};exports['show']=function(_0x3f4de2,_0x218b8b){var _0x47d50e={'raw':!![],'where':{'id':_0x3f4de2[_0x70a9('0x45')]['id']}},_0x60771={};_0x60771[_0x70a9('0x33')]=_[_0x70a9('0x46')](db[_0x70a9('0x2e')]['rawAttributes']);_0x60771[_0x70a9('0x34')]=_[_0x70a9('0x46')](_0x3f4de2[_0x70a9('0x34')]);_0x60771[_0x70a9('0x35')]=_[_0x70a9('0x47')](_0x60771[_0x70a9('0x33')],_0x60771[_0x70a9('0x34')]);_0x47d50e[_0x70a9('0x37')]=_['intersection'](_0x60771[_0x70a9('0x33')],qs[_0x70a9('0x36')](_0x3f4de2[_0x70a9('0x34')]['fields']));_0x47d50e[_0x70a9('0x37')]=_0x47d50e['attributes']['length']?_0x47d50e[_0x70a9('0x37')]:_0x60771['model'];if(_0x3f4de2['query'][_0x70a9('0x48')]){_0x47d50e[_0x70a9('0x42')]=[{'all':!![]}];}_0x47d50e=_[_0x70a9('0x3f')]({},_0x47d50e,_0x3f4de2['options']);return db['VtigerField'][_0x70a9('0x49')](_0x47d50e)[_0x70a9('0x27')](handleEntityNotFound(_0x218b8b,null))['then'](respondWithResult(_0x218b8b,null))[_0x70a9('0x4a')](handleError(_0x218b8b,null));};exports[_0x70a9('0x4b')]=function(_0x518f76,_0x415179){return db[_0x70a9('0x2e')][_0x70a9('0x4b')](_0x518f76[_0x70a9('0x4c')],{})[_0x70a9('0x27')](respondWithResult(_0x415179,0xc9))['catch'](handleError(_0x415179,null));};exports['update']=function(_0xb8f807,_0x31990d){if(_0xb8f807[_0x70a9('0x4c')]['id']){delete _0xb8f807[_0x70a9('0x4c')]['id'];}return db[_0x70a9('0x2e')][_0x70a9('0x49')]({'where':{'id':_0xb8f807[_0x70a9('0x45')]['id']}})[_0x70a9('0x27')](handleEntityNotFound(_0x31990d,null))['then'](saveUpdates(_0xb8f807['body'],null))['then'](respondWithResult(_0x31990d,null))[_0x70a9('0x4a')](handleError(_0x31990d,null));};exports[_0x70a9('0x28')]=function(_0xbf0503,_0x4c05a3){return db[_0x70a9('0x2e')]['find']({'where':{'id':_0xbf0503[_0x70a9('0x45')]['id']}})[_0x70a9('0x27')](handleEntityNotFound(_0x4c05a3,null))[_0x70a9('0x27')](removeEntity(_0x4c05a3,null))[_0x70a9('0x4a')](handleError(_0x4c05a3,null));}; \ No newline at end of file +var _0xf699=['sort','where','filter','merge','VIRTUAL','then','include','findAll','catch','show','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0x51d653,_0x50150e){var _0x132028=function(_0x4edeaa){while(--_0x4edeaa){_0x51d653['push'](_0x51d653['shift']());}};_0x132028(++_0x50150e);}(_0xf699,0xeb));var _0x9f69=function(_0x337eb9,_0x5a03f3){_0x337eb9=_0x337eb9-0x0;var _0x76740c=_0xf699[_0x337eb9];return _0x76740c;};'use strict';var emlformat=require(_0x9f69('0x0'));var rimraf=require(_0x9f69('0x1'));var zipdir=require(_0x9f69('0x2'));var jsonpatch=require(_0x9f69('0x3'));var rp=require(_0x9f69('0x4'));var moment=require(_0x9f69('0x5'));var BPromise=require(_0x9f69('0x6'));var Mustache=require(_0x9f69('0x7'));var util=require('util');var path=require('path');var sox=require(_0x9f69('0x8'));var csv=require('to-csv');var ejs=require(_0x9f69('0x9'));var fs=require('fs');var fs_extra=require(_0x9f69('0xa'));var _=require('lodash');var squel=require(_0x9f69('0xb'));var crypto=require(_0x9f69('0xc'));var jsforce=require(_0x9f69('0xd'));var deskjs=require(_0x9f69('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9f69('0xf'));var Papa=require(_0x9f69('0x10'));var Redis=require(_0x9f69('0x11'));var authService=require(_0x9f69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9f69('0x13'));var hardwareService=require(_0x9f69('0x14'));var logger=require('../../config/logger')(_0x9f69('0x15'));var utils=require(_0x9f69('0x16'));var config=require(_0x9f69('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc8b637,_0x3aea28){_0x3aea28=_0x3aea28||0xcc;return function(_0x5aa5dd){if(_0x5aa5dd){return _0xc8b637['sendStatus'](_0x3aea28);}return _0xc8b637['status'](_0x3aea28)[_0x9f69('0x18')]();};}function respondWithResult(_0x48c9a6,_0x598ec9){_0x598ec9=_0x598ec9||0xc8;return function(_0x42f5bc){if(_0x42f5bc){return _0x48c9a6[_0x9f69('0x19')](_0x598ec9)[_0x9f69('0x1a')](_0x42f5bc);}};}function respondWithFilteredResult(_0x333702,_0x85cebe){return function(_0x388e2f){if(_0x388e2f){var _0x4b3afa=typeof _0x85cebe[_0x9f69('0x1b')]===_0x9f69('0x1c')&&typeof _0x85cebe[_0x9f69('0x1d')]===_0x9f69('0x1c');var _0x5ed870=_0x388e2f['count'];var _0x76554e=_0x4b3afa?0x0:_0x85cebe[_0x9f69('0x1b')];var _0x271dc6=_0x4b3afa?_0x388e2f['count']:_0x85cebe[_0x9f69('0x1b')]+_0x85cebe[_0x9f69('0x1d')];var _0x1e6027;if(_0x271dc6>=_0x5ed870){_0x271dc6=_0x5ed870;_0x1e6027=0xc8;}else{_0x1e6027=0xce;}_0x333702['status'](_0x1e6027);return _0x333702['set'](_0x9f69('0x1e'),_0x76554e+'-'+_0x271dc6+'/'+_0x5ed870)['json'](_0x388e2f);}return null;};}function patchUpdates(_0x54b890){return function(_0x4ba90b){try{jsonpatch['apply'](_0x4ba90b,_0x54b890,!![]);}catch(_0x36d3cd){return BPromise[_0x9f69('0x1f')](_0x36d3cd);}return _0x4ba90b[_0x9f69('0x20')]();};}function saveUpdates(_0x5c6bd9,_0x47d686){return function(_0x4dfff6){if(_0x4dfff6){return _0x4dfff6[_0x9f69('0x21')](_0x5c6bd9)['then'](function(_0x97fea0){return _0x97fea0;});}return null;};}function removeEntity(_0x27aa17,_0x23aa59){return function(_0x5a84f4){if(_0x5a84f4){return _0x5a84f4[_0x9f69('0x22')]()['then'](function(){_0x27aa17[_0x9f69('0x19')](0xcc)[_0x9f69('0x18')]();});}};}function handleEntityNotFound(_0x1196ec,_0xcdc737){return function(_0x3dd721){if(!_0x3dd721){_0x1196ec[_0x9f69('0x23')](0x194);}return _0x3dd721;};}function handleError(_0x5031d1,_0x33c3f4){_0x33c3f4=_0x33c3f4||0x1f4;return function(_0x4b49df){logger[_0x9f69('0x24')](_0x4b49df[_0x9f69('0x25')]);if(_0x4b49df[_0x9f69('0x26')]){delete _0x4b49df['name'];}_0x5031d1[_0x9f69('0x19')](_0x33c3f4)[_0x9f69('0x27')](_0x4b49df);};}exports[_0x9f69('0x28')]=function(_0x4d9b61,_0x23944b){var _0x51f039={},_0x1ed99f={},_0x3d45f6={'count':0x0,'rows':[]};var _0x3764b0=_[_0x9f69('0x29')](db[_0x9f69('0x2a')][_0x9f69('0x2b')],function(_0x57322e){return{'name':_0x57322e[_0x9f69('0x2c')],'type':_0x57322e[_0x9f69('0x2d')]['key']};});_0x1ed99f['model']=_[_0x9f69('0x29')](_0x3764b0,_0x9f69('0x26'));_0x1ed99f[_0x9f69('0x2e')]=_[_0x9f69('0x2f')](_0x4d9b61[_0x9f69('0x2e')]);_0x1ed99f[_0x9f69('0x30')]=_[_0x9f69('0x31')](_0x1ed99f['model'],_0x1ed99f[_0x9f69('0x2e')]);_0x51f039[_0x9f69('0x32')]=_['intersection'](_0x1ed99f[_0x9f69('0x33')],qs[_0x9f69('0x34')](_0x4d9b61[_0x9f69('0x2e')][_0x9f69('0x34')]));_0x51f039['attributes']=_0x51f039['attributes'][_0x9f69('0x35')]?_0x51f039[_0x9f69('0x32')]:_0x1ed99f['model'];if(!_0x4d9b61[_0x9f69('0x2e')][_0x9f69('0x36')](_0x9f69('0x37'))){_0x51f039[_0x9f69('0x1d')]=qs[_0x9f69('0x1d')](_0x4d9b61[_0x9f69('0x2e')][_0x9f69('0x1d')]);_0x51f039[_0x9f69('0x1b')]=qs[_0x9f69('0x1b')](_0x4d9b61[_0x9f69('0x2e')]['offset']);}_0x51f039[_0x9f69('0x38')]=qs[_0x9f69('0x39')](_0x4d9b61[_0x9f69('0x2e')][_0x9f69('0x39')]);_0x51f039[_0x9f69('0x3a')]=qs[_0x9f69('0x30')](_['pick'](_0x4d9b61[_0x9f69('0x2e')],_0x1ed99f[_0x9f69('0x30')]),_0x3764b0);if(_0x4d9b61['query'][_0x9f69('0x3b')]){_0x51f039[_0x9f69('0x3a')]=_[_0x9f69('0x3c')](_0x51f039[_0x9f69('0x3a')],{'$or':_[_0x9f69('0x29')](_0x3764b0,function(_0x2e6cd6){if(_0x2e6cd6['type']!==_0x9f69('0x3d')){var _0x3cedad={};_0x3cedad[_0x2e6cd6[_0x9f69('0x26')]]={'$like':'%'+_0x4d9b61[_0x9f69('0x2e')][_0x9f69('0x3b')]+'%'};return _0x3cedad;}})});}_0x51f039=_['merge']({},_0x51f039,_0x4d9b61['options']);var _0x317ae8={'where':_0x51f039['where']};return db['VtigerField']['count'](_0x317ae8)[_0x9f69('0x3e')](function(_0x15606d){_0x3d45f6['count']=_0x15606d;if(_0x4d9b61[_0x9f69('0x2e')]['includeAll']){_0x51f039[_0x9f69('0x3f')]=[{'all':!![]}];}return db[_0x9f69('0x2a')][_0x9f69('0x40')](_0x51f039);})[_0x9f69('0x3e')](function(_0xf2e7a9){_0x3d45f6['rows']=_0xf2e7a9;return _0x3d45f6;})[_0x9f69('0x3e')](respondWithFilteredResult(_0x23944b,_0x51f039))[_0x9f69('0x41')](handleError(_0x23944b,null));};exports[_0x9f69('0x42')]=function(_0x568199,_0x52941a){var _0x598700={'raw':!![],'where':{'id':_0x568199[_0x9f69('0x43')]['id']}},_0x1a063d={};_0x1a063d[_0x9f69('0x33')]=_[_0x9f69('0x2f')](db[_0x9f69('0x2a')][_0x9f69('0x2b')]);_0x1a063d['query']=_[_0x9f69('0x2f')](_0x568199[_0x9f69('0x2e')]);_0x1a063d['filters']=_[_0x9f69('0x31')](_0x1a063d['model'],_0x1a063d[_0x9f69('0x2e')]);_0x598700['attributes']=_[_0x9f69('0x31')](_0x1a063d[_0x9f69('0x33')],qs[_0x9f69('0x34')](_0x568199[_0x9f69('0x2e')]['fields']));_0x598700[_0x9f69('0x32')]=_0x598700[_0x9f69('0x32')][_0x9f69('0x35')]?_0x598700[_0x9f69('0x32')]:_0x1a063d[_0x9f69('0x33')];if(_0x568199[_0x9f69('0x2e')][_0x9f69('0x44')]){_0x598700[_0x9f69('0x3f')]=[{'all':!![]}];}_0x598700=_[_0x9f69('0x3c')]({},_0x598700,_0x568199[_0x9f69('0x45')]);return db[_0x9f69('0x2a')][_0x9f69('0x46')](_0x598700)[_0x9f69('0x3e')](handleEntityNotFound(_0x52941a,null))['then'](respondWithResult(_0x52941a,null))[_0x9f69('0x41')](handleError(_0x52941a,null));};exports[_0x9f69('0x47')]=function(_0x2e1fbc,_0x444091){return db[_0x9f69('0x2a')]['create'](_0x2e1fbc['body'],{})[_0x9f69('0x3e')](respondWithResult(_0x444091,0xc9))[_0x9f69('0x41')](handleError(_0x444091,null));};exports[_0x9f69('0x21')]=function(_0x4252bd,_0x6078d6){if(_0x4252bd['body']['id']){delete _0x4252bd['body']['id'];}return db[_0x9f69('0x2a')][_0x9f69('0x46')]({'where':{'id':_0x4252bd[_0x9f69('0x43')]['id']}})[_0x9f69('0x3e')](handleEntityNotFound(_0x6078d6,null))[_0x9f69('0x3e')](saveUpdates(_0x4252bd[_0x9f69('0x48')],null))[_0x9f69('0x3e')](respondWithResult(_0x6078d6,null))[_0x9f69('0x41')](handleError(_0x6078d6,null));};exports[_0x9f69('0x22')]=function(_0xa7b274,_0xa918da){return db[_0x9f69('0x2a')][_0x9f69('0x46')]({'where':{'id':_0xa7b274[_0x9f69('0x43')]['id']}})['then'](handleEntityNotFound(_0xa918da,null))[_0x9f69('0x3e')](removeEntity(_0xa918da,null))[_0x9f69('0x41')](handleError(_0xa918da,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e79ab50..beb38be 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 _0x1e81=['api','bluebird','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','lodash','util','../../config/logger'];(function(_0x102402,_0x4eaaf8){var _0x321b44=function(_0x198c94){while(--_0x198c94){_0x102402['push'](_0x102402['shift']());}};_0x321b44(++_0x4eaaf8);}(_0x1e81,0x128));var _0x11e8=function(_0x1884be,_0x183e81){_0x1884be=_0x1884be-0x0;var _0x52bafe=_0x1e81[_0x1884be];return _0x52bafe;};'use strict';var _=require(_0x11e8('0x0'));var util=require(_0x11e8('0x1'));var logger=require(_0x11e8('0x2'))(_0x11e8('0x3'));var moment=require('moment');var BPromise=require(_0x11e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11e8('0x5'));var config=require(_0x11e8('0x6'));var attributes=require(_0x11e8('0x7'));module[_0x11e8('0x8')]=function(_0x4a86c7,_0x3c27c9){return _0x4a86c7[_0x11e8('0x9')](_0x11e8('0xa'),attributes,{'tableName':_0x11e8('0xb'),'paranoid':![],'indexes':[{'name':_0x11e8('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf36d=['api','request-promise','path','../../config/environment','./intVtigerField.attributes','define','vtiger_unique_index','FieldId','lodash','util'];(function(_0x2271e2,_0x265850){var _0x5e905a=function(_0x321792){while(--_0x321792){_0x2271e2['push'](_0x2271e2['shift']());}};_0x5e905a(++_0x265850);}(_0xf36d,0x1c0));var _0xdf36=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xf36d[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xdf36('0x0'));var util=require(_0xdf36('0x1'));var logger=require('../../config/logger')(_0xdf36('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdf36('0x3'));var fs=require('fs');var path=require(_0xdf36('0x4'));var rimraf=require('rimraf');var config=require(_0xdf36('0x5'));var attributes=require(_0xdf36('0x6'));module['exports']=function(_0x327702,_0x4b6128){return _0x327702[_0xdf36('0x7')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xdf36('0x8'),'fields':['idField',_0xdf36('0x9')],'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 ddd484f..0f535bc 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 _0x9c43=['request','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x11595e,_0x5be975){var _0x27ac74=function(_0x99e948){while(--_0x99e948){_0x11595e['push'](_0x11595e['shift']());}};_0x27ac74(++_0x5be975);}(_0x9c43,0xa1));var _0x39c4=function(_0x22f5ea,_0x3a6a30){_0x22f5ea=_0x22f5ea-0x0;var _0xe5955=_0x9c43[_0x22f5ea];return _0xe5955;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39c4('0x0'));var BPromise=require(_0x39c4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39c4('0x2'));var db=require(_0x39c4('0x3'))['db'];var utils=require(_0x39c4('0x4'));var logger=require(_0x39c4('0x5'))(_0x39c4('0x6'));var config=require(_0x39c4('0x7'));var jayson=require(_0x39c4('0x8'));var client=jayson['client'][_0x39c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52f871,_0xa970fc,_0xdee245){return new BPromise(function(_0x1412cf,_0x59481b){return client[_0x39c4('0xa')](_0x52f871,_0xdee245)['then'](function(_0x1231c3){logger[_0x39c4('0xb')](_0x39c4('0xc'),_0xa970fc,'request\x20sent');logger[_0x39c4('0xd')](_0x39c4('0xe'),_0xa970fc,_0x39c4('0xf'),JSON[_0x39c4('0x10')](_0x1231c3));if(_0x1231c3['error']){if(_0x1231c3['error']['code']===0x1f4){logger[_0x39c4('0x11')](_0x39c4('0xc'),_0xa970fc,_0x1231c3[_0x39c4('0x11')][_0x39c4('0x12')]);return _0x59481b(_0x1231c3['error'][_0x39c4('0x12')]);}logger['error'](_0x39c4('0xc'),_0xa970fc,_0x1231c3['error'][_0x39c4('0x12')]);return _0x1412cf(_0x1231c3[_0x39c4('0x11')][_0x39c4('0x12')]);}else{logger[_0x39c4('0xb')]('VtigerField,\x20%s,\x20%s',_0xa970fc,_0x39c4('0xf'));_0x1412cf(_0x1231c3['result'][_0x39c4('0x12')]);}})['catch'](function(_0x37d35c){logger[_0x39c4('0x11')](_0x39c4('0xc'),_0xa970fc,_0x37d35c);_0x59481b(_0x37d35c);});});} \ No newline at end of file +var _0x2e03=['message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x13813a,_0x3d7985){var _0xb3d44c=function(_0x41d35c){while(--_0x41d35c){_0x13813a['push'](_0x13813a['shift']());}};_0xb3d44c(++_0x3d7985);}(_0x2e03,0xa2));var _0x32e0=function(_0x368244,_0x1a31f6){_0x368244=_0x368244-0x0;var _0x118bb6=_0x2e03[_0x368244];return _0x118bb6;};'use strict';var _=require('lodash');var util=require(_0x32e0('0x0'));var moment=require('moment');var BPromise=require(_0x32e0('0x1'));var rs=require(_0x32e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32e0('0x3'));var logger=require(_0x32e0('0x4'))(_0x32e0('0x5'));var config=require(_0x32e0('0x6'));var jayson=require(_0x32e0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13c8ff,_0x349562,_0x43b432){return new BPromise(function(_0x261fa9,_0x380c44){return client[_0x32e0('0x8')](_0x13c8ff,_0x43b432)[_0x32e0('0x9')](function(_0x496a2b){logger[_0x32e0('0xa')](_0x32e0('0xb'),_0x349562,_0x32e0('0xc'));logger[_0x32e0('0xd')](_0x32e0('0xe'),_0x349562,_0x32e0('0xc'),JSON[_0x32e0('0xf')](_0x496a2b));if(_0x496a2b[_0x32e0('0x10')]){if(_0x496a2b[_0x32e0('0x10')][_0x32e0('0x11')]===0x1f4){logger['error'](_0x32e0('0xb'),_0x349562,_0x496a2b[_0x32e0('0x10')][_0x32e0('0x12')]);return _0x380c44(_0x496a2b[_0x32e0('0x10')][_0x32e0('0x12')]);}logger[_0x32e0('0x10')]('VtigerField,\x20%s,\x20%s',_0x349562,_0x496a2b[_0x32e0('0x10')][_0x32e0('0x12')]);return _0x261fa9(_0x496a2b[_0x32e0('0x10')]['message']);}else{logger['info'](_0x32e0('0xb'),_0x349562,_0x32e0('0xc'));_0x261fa9(_0x496a2b[_0x32e0('0x13')][_0x32e0('0x12')]);}})['catch'](function(_0x4798a0){logger[_0x32e0('0x10')]('VtigerField,\x20%s,\x20%s',_0x349562,_0x4798a0);_0x380c44(_0x4798a0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c68b916..3e806a2 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 _0xdb8a=['post','addConfiguration','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0x169c28,_0x45e2ab){var _0x491e73=function(_0x306e0b){while(--_0x306e0b){_0x169c28['push'](_0x169c28['shift']());}};_0x491e73(++_0x45e2ab);}(_0xdb8a,0xfc));var _0xadb8=function(_0xf9bcc2,_0x1b0280){_0xf9bcc2=_0xf9bcc2-0x0;var _0x103005=_0xdb8a[_0xf9bcc2];return _0x103005;};'use strict';var multer=require(_0xadb8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xadb8('0x1'));var express=require('express');var router=express[_0xadb8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xadb8('0x3'));var config=require(_0xadb8('0x4'));var controller=require('./intZendeskAccount.controller');router[_0xadb8('0x5')]('/',auth['isAuthenticated'](),controller[_0xadb8('0x6')]);router[_0xadb8('0x5')](_0xadb8('0x7'),auth['isAuthenticated'](),controller[_0xadb8('0x8')]);router[_0xadb8('0x5')](_0xadb8('0x9'),auth[_0xadb8('0xa')](),controller[_0xadb8('0xb')]);router[_0xadb8('0x5')](_0xadb8('0xc'),auth[_0xadb8('0xa')](),controller[_0xadb8('0xd')]);router['post']('/',auth[_0xadb8('0xa')](),controller['create']);router[_0xadb8('0xe')](_0xadb8('0x9'),auth['isAuthenticated'](),controller[_0xadb8('0xf')]);router['put']('/:id',auth[_0xadb8('0xa')](),controller['update']);router[_0xadb8('0x10')](_0xadb8('0x7'),auth[_0xadb8('0xa')](),controller[_0xadb8('0x11')]);module[_0xadb8('0x12')]=router; \ No newline at end of file +var _0xf6ed=['destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x4503d8,_0x50a413){var _0x53babc=function(_0x3cdd8e){while(--_0x3cdd8e){_0x4503d8['push'](_0x4503d8['shift']());}};_0x53babc(++_0x50a413);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x52d513,_0x2ec5ee){_0x52d513=_0x52d513-0x0;var _0x1eda59=_0xf6ed[_0x52d513];return _0x1eda59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf6e('0x0'));var timeout=require('connect-timeout');var express=require(_0xdf6e('0x1'));var router=express[_0xdf6e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdf6e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdf6e('0x4'));var controller=require(_0xdf6e('0x5'));router[_0xdf6e('0x6')]('/',auth['isAuthenticated'](),controller[_0xdf6e('0x7')]);router[_0xdf6e('0x6')](_0xdf6e('0x8'),auth[_0xdf6e('0x9')](),controller[_0xdf6e('0xa')]);router[_0xdf6e('0x6')](_0xdf6e('0xb'),auth['isAuthenticated'](),controller[_0xdf6e('0xc')]);router[_0xdf6e('0x6')](_0xdf6e('0xd'),auth[_0xdf6e('0x9')](),controller[_0xdf6e('0xe')]);router[_0xdf6e('0xf')]('/',auth['isAuthenticated'](),controller[_0xdf6e('0x10')]);router[_0xdf6e('0xf')](_0xdf6e('0xb'),auth[_0xdf6e('0x9')](),controller[_0xdf6e('0x11')]);router[_0xdf6e('0x12')](_0xdf6e('0x8'),auth[_0xdf6e('0x9')](),controller[_0xdf6e('0x13')]);router[_0xdf6e('0x14')](_0xdf6e('0x8'),auth[_0xdf6e('0x9')](),controller[_0xdf6e('0x15')]);module[_0xdf6e('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 f7051a1..fd7fd9d 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 _0x5d0a=['password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4ec898,_0x12c615){_0x4ec898=_0x4ec898-0x0;var _0x5d06c0=_0x5d0a[_0x4ec898];return _0x5d06c0;};'use strict';var Sequelize=require(_0xa5d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xa5d0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa5d0('0x1')],'unique':_0xa5d0('0x2')},'password':{'type':Sequelize[_0xa5d0('0x1')]},'token':{'type':Sequelize[_0xa5d0('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa5d0('0x3')},'authType':{'type':Sequelize[_0xa5d0('0x4')](_0xa5d0('0x5'),_0xa5d0('0x6')),'defaultValue':_0xa5d0('0x5')},'serverUrl':{'type':Sequelize[_0xa5d0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa5d0('0x4')](_0xa5d0('0x7'),_0xa5d0('0x8')),'defaultValue':_0xa5d0('0x7')}}; \ No newline at end of file +var _0xed5c=['exports','STRING','username','remoteUri','password','token','ENUM','integrationTab','newTab','sequelize'];(function(_0x72040e,_0x590fc6){var _0x43f437=function(_0x2acc39){while(--_0x2acc39){_0x72040e['push'](_0x72040e['shift']());}};_0x43f437(++_0x590fc6);}(_0xed5c,0x81));var _0xced5=function(_0x149076,_0x25a5de){_0x149076=_0x149076-0x0;var _0x3b2b5f=_0xed5c[_0x149076];return _0x3b2b5f;};'use strict';var Sequelize=require(_0xced5('0x0'));module[_0xced5('0x1')]={'name':{'type':Sequelize[_0xced5('0x2')]},'description':{'type':Sequelize[_0xced5('0x2')]},'username':{'type':Sequelize[_0xced5('0x2')],'unique':_0xced5('0x3')},'password':{'type':Sequelize[_0xced5('0x2')]},'token':{'type':Sequelize[_0xced5('0x2')]},'remoteUri':{'type':Sequelize[_0xced5('0x2')],'unique':_0xced5('0x4')},'authType':{'type':Sequelize['ENUM'](_0xced5('0x5'),_0xced5('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xced5('0x7')](_0xced5('0x8'),_0xced5('0x9')),'defaultValue':_0xced5('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7cbf394..43f69bb 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 _0xe1e3=['assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','end','json','undefined','count','offset','status','set','apply','save','then','destroy','name','send','ZendeskAccount','type','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update','ZendeskConfiguration','length','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','findOne','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','username','base64','headers','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group'];(function(_0x37b875,_0x691aa0){var _0x46076b=function(_0x220e2e){while(--_0x220e2e){_0x37b875['push'](_0x37b875['shift']());}};_0x46076b(++_0x691aa0);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xfce44c,_0x212a0b){_0xfce44c=_0xfce44c-0x0;var _0x118059=_0xe1e3[_0xfce44c];return _0x118059;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x536129,_0x5c09a2){_0x5c09a2=_0x5c09a2||0xcc;return function(_0x14ad58){if(_0x14ad58){return _0x536129['sendStatus'](_0x5c09a2);}return _0x536129['status'](_0x5c09a2)[_0x3e1e('0x14')]();};}function respondWithResult(_0x8bd4cd,_0x78ee54){_0x78ee54=_0x78ee54||0xc8;return function(_0x50f221){if(_0x50f221){return _0x8bd4cd['status'](_0x78ee54)[_0x3e1e('0x15')](_0x50f221);}};}function respondWithFilteredResult(_0x1b62e6,_0x4dca60){return function(_0x26cb35){if(_0x26cb35){var _0x1f0af9=typeof _0x4dca60['offset']===_0x3e1e('0x16')&&typeof _0x4dca60['limit']===_0x3e1e('0x16');var _0x247daa=_0x26cb35[_0x3e1e('0x17')];var _0x39eaa7=_0x1f0af9?0x0:_0x4dca60[_0x3e1e('0x18')];var _0x1c181b=_0x1f0af9?_0x26cb35['count']:_0x4dca60['offset']+_0x4dca60['limit'];var _0x428e4e;if(_0x1c181b>=_0x247daa){_0x1c181b=_0x247daa;_0x428e4e=0xc8;}else{_0x428e4e=0xce;}_0x1b62e6[_0x3e1e('0x19')](_0x428e4e);return _0x1b62e6[_0x3e1e('0x1a')]('Content-Range',_0x39eaa7+'-'+_0x1c181b+'/'+_0x247daa)[_0x3e1e('0x15')](_0x26cb35);}return null;};}function patchUpdates(_0x530815){return function(_0x228991){try{jsonpatch[_0x3e1e('0x1b')](_0x228991,_0x530815,!![]);}catch(_0x474085){return BPromise['reject'](_0x474085);}return _0x228991[_0x3e1e('0x1c')]();};}function saveUpdates(_0x96396,_0xefa098){return function(_0x55dc62){if(_0x55dc62){return _0x55dc62['update'](_0x96396)[_0x3e1e('0x1d')](function(_0x1b5097){return _0x1b5097;});}return null;};}function removeEntity(_0x488f9f,_0x60e6bc){return function(_0x56ae51){if(_0x56ae51){return _0x56ae51[_0x3e1e('0x1e')]()[_0x3e1e('0x1d')](function(){_0x488f9f[_0x3e1e('0x19')](0xcc)[_0x3e1e('0x14')]();});}};}function handleEntityNotFound(_0x43d583,_0x21c898){return function(_0x4ee2b5){if(!_0x4ee2b5){_0x43d583['sendStatus'](0x194);}return _0x4ee2b5;};}function handleError(_0x44e419,_0x541ef1){_0x541ef1=_0x541ef1||0x1f4;return function(_0x55db8f){logger['error'](_0x55db8f['stack']);if(_0x55db8f[_0x3e1e('0x1f')]){delete _0x55db8f[_0x3e1e('0x1f')];}_0x44e419['status'](_0x541ef1)[_0x3e1e('0x20')](_0x55db8f);};}exports['index']=function(_0xdfcd93,_0x176bb4){var _0x53a6ff={},_0x43e029={},_0x210a84={'count':0x0,'rows':[]};var _0x45ed0e=_['map'](db[_0x3e1e('0x21')]['rawAttributes'],function(_0x591c36){return{'name':_0x591c36['fieldName'],'type':_0x591c36[_0x3e1e('0x22')]['key']};});_0x43e029['model']=_[_0x3e1e('0x23')](_0x45ed0e,_0x3e1e('0x1f'));_0x43e029[_0x3e1e('0x24')]=_[_0x3e1e('0x25')](_0xdfcd93[_0x3e1e('0x24')]);_0x43e029['filters']=_['intersection'](_0x43e029['model'],_0x43e029['query']);_0x53a6ff[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x43e029[_0x3e1e('0x28')],qs[_0x3e1e('0x29')](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x29')]));_0x53a6ff[_0x3e1e('0x26')]=_0x53a6ff[_0x3e1e('0x26')]['length']?_0x53a6ff[_0x3e1e('0x26')]:_0x43e029[_0x3e1e('0x28')];if(!_0xdfcd93['query'][_0x3e1e('0x2a')](_0x3e1e('0x2b'))){_0x53a6ff[_0x3e1e('0x2c')]=qs[_0x3e1e('0x2c')](_0xdfcd93['query']['limit']);_0x53a6ff[_0x3e1e('0x18')]=qs[_0x3e1e('0x18')](_0xdfcd93['query'][_0x3e1e('0x18')]);}_0x53a6ff[_0x3e1e('0x2d')]=qs['sort'](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x2e')]);_0x53a6ff[_0x3e1e('0x2f')]=qs[_0x3e1e('0x30')](_[_0x3e1e('0x31')](_0xdfcd93['query'],_0x43e029[_0x3e1e('0x30')]),_0x45ed0e);if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x32')]){_0x53a6ff[_0x3e1e('0x2f')]=_['merge'](_0x53a6ff[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x45ed0e,function(_0x111da4){if(_0x111da4[_0x3e1e('0x22')]!==_0x3e1e('0x33')){var _0x25a95b={};_0x25a95b[_0x111da4[_0x3e1e('0x1f')]]={'$like':'%'+_0xdfcd93['query'][_0x3e1e('0x32')]+'%'};return _0x25a95b;}})});}_0x53a6ff=_['merge']({},_0x53a6ff,_0xdfcd93['options']);var _0x4f598e={'where':_0x53a6ff[_0x3e1e('0x2f')]};return db[_0x3e1e('0x21')]['count'](_0x4f598e)[_0x3e1e('0x1d')](function(_0xb030eb){_0x210a84['count']=_0xb030eb;if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x53a6ff['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x3e1e('0x35')](_0x53a6ff);})['then'](function(_0x4ff868){_0x210a84[_0x3e1e('0x36')]=_0x4ff868;return _0x210a84;})[_0x3e1e('0x1d')](respondWithFilteredResult(_0x176bb4,_0x53a6ff))[_0x3e1e('0x37')](handleError(_0x176bb4,null));};exports[_0x3e1e('0x38')]=function(_0x377a06,_0x55ea1d){var _0x5b32ad={'raw':![],'where':{'id':_0x377a06[_0x3e1e('0x39')]['id']}},_0x24b2ad={};_0x24b2ad[_0x3e1e('0x28')]=_['keys'](db[_0x3e1e('0x21')][_0x3e1e('0x3a')]);_0x24b2ad[_0x3e1e('0x24')]=_['keys'](_0x377a06[_0x3e1e('0x24')]);_0x24b2ad['filters']=_['intersection'](_0x24b2ad[_0x3e1e('0x28')],_0x24b2ad[_0x3e1e('0x24')]);_0x5b32ad[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x24b2ad['model'],qs['fields'](_0x377a06['query']['fields']));_0x5b32ad[_0x3e1e('0x26')]=_0x5b32ad[_0x3e1e('0x26')]['length']?_0x5b32ad['attributes']:_0x24b2ad[_0x3e1e('0x28')];if(_0x377a06[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x5b32ad['include']=[{'all':!![]}];}_0x5b32ad=_[_0x3e1e('0x3b')]({},_0x5b32ad,_0x377a06['options']);return db[_0x3e1e('0x21')][_0x3e1e('0x3c')](_0x5b32ad)[_0x3e1e('0x1d')](handleEntityNotFound(_0x55ea1d,null))[_0x3e1e('0x1d')](respondWithResult(_0x55ea1d,null))[_0x3e1e('0x37')](handleError(_0x55ea1d,null));};exports[_0x3e1e('0x3d')]=function(_0x53d32b,_0x2f14b3){return db[_0x3e1e('0x21')]['create'](_0x53d32b[_0x3e1e('0x3e')],{})[_0x3e1e('0x1d')](respondWithResult(_0x2f14b3,0xc9))['catch'](handleError(_0x2f14b3,null));};exports[_0x3e1e('0x3f')]=function(_0x347b3f,_0x2e286f){if(_0x347b3f[_0x3e1e('0x3e')]['id']){delete _0x347b3f['body']['id'];}return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0x347b3f[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x2e286f,null))['then'](saveUpdates(_0x347b3f[_0x3e1e('0x3e')],null))[_0x3e1e('0x1d')](respondWithResult(_0x2e286f,null))[_0x3e1e('0x37')](handleError(_0x2e286f,null));};exports[_0x3e1e('0x1e')]=function(_0xe2516c,_0x1df5a8){return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0xe2516c['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1df5a8,null))['then'](removeEntity(_0x1df5a8,null))['catch'](handleError(_0x1df5a8,null));};exports['getConfigurations']=function(_0x1c4269,_0x17641c,_0x5147a2){var _0x13b076={};var _0x592733={};var _0x5b2416;var _0x3eaf76;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c4269['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x17641c,null))[_0x3e1e('0x1d')](function(_0x1334c8){if(_0x1334c8){_0x5b2416=_0x1334c8;_0x592733[_0x3e1e('0x28')]=_[_0x3e1e('0x25')](db[_0x3e1e('0x40')][_0x3e1e('0x3a')]);_0x592733['query']=_[_0x3e1e('0x25')](_0x1c4269['query']);_0x592733[_0x3e1e('0x30')]=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],_0x592733['query']);_0x13b076['attributes']=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],qs['fields'](_0x1c4269[_0x3e1e('0x24')]['fields']));_0x13b076['attributes']=_0x13b076[_0x3e1e('0x26')][_0x3e1e('0x41')]?_0x13b076['attributes']:_0x592733[_0x3e1e('0x28')];_0x13b076['order']=qs['sort'](_0x1c4269[_0x3e1e('0x24')]['sort']);_0x13b076[_0x3e1e('0x2f')]=qs['filters'](_[_0x3e1e('0x31')](_0x1c4269['query'],_0x592733[_0x3e1e('0x30')]));if(_0x1c4269[_0x3e1e('0x24')]['filter']){_0x13b076['where']=_['merge'](_0x13b076[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x13b076[_0x3e1e('0x26')],function(_0x588189){var _0x1b04ce={};_0x1b04ce[_0x588189]={'$like':'%'+_0x1c4269[_0x3e1e('0x24')][_0x3e1e('0x32')]+'%'};return _0x1b04ce;})});}_0x13b076=_['merge']({},_0x13b076,_0x1c4269['options']);return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x3b97a2){if(_0x3b97a2){_0x3eaf76=_0x3b97a2[_0x3e1e('0x41')];if(!_0x1c4269[_0x3e1e('0x24')]['hasOwnProperty'](_0x3e1e('0x2b'))){_0x13b076['limit']=qs[_0x3e1e('0x2c')](_0x1c4269[_0x3e1e('0x24')]['limit']);_0x13b076[_0x3e1e('0x18')]=qs['offset'](_0x1c4269[_0x3e1e('0x24')]['offset']);}return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x31062e){if(_0x31062e){return _0x31062e?{'count':_0x3eaf76,'rows':_0x31062e}:null;}})[_0x3e1e('0x1d')](respondWithResult(_0x17641c,null))[_0x3e1e('0x37')](handleError(_0x17641c,null));};exports['addConfiguration']=function(_0x11cab1,_0x1fbcfc,_0x4e6957){if(_0x11cab1[_0x3e1e('0x3e')]['id']){delete _0x11cab1['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x11cab1[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1fbcfc,null))[_0x3e1e('0x1d')](function(_0x4b0944){if(_0x4b0944){_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x43')]=_0x4b0944['id'];_0x11cab1[_0x3e1e('0x3e')]['Subjects']=integrations[_0x3e1e('0x44')](_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x45')],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x46')]=integrations[_0x3e1e('0x47')](_0x11cab1['body']['channel'],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);return db[_0x3e1e('0x40')][_0x3e1e('0x3d')](_0x11cab1[_0x3e1e('0x3e')],{'include':[{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x49')},{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x46')}]});}return null;})[_0x3e1e('0x1d')](respondWithResult(_0x1fbcfc,null))[_0x3e1e('0x37')](handleError(_0x1fbcfc,null));};exports[_0x3e1e('0x4a')]=function(_0x5e148e,_0x5581ee,_0x20bc4d){var _0x29ddc4='';return db[_0x3e1e('0x21')][_0x3e1e('0x4b')]({'where':{'id':_0x5e148e[_0x3e1e('0x39')]['id']},'attributes':['id','username',_0x3e1e('0x4c'),_0x3e1e('0x4d'),_0x3e1e('0x4e'),_0x3e1e('0x4f')]})[_0x3e1e('0x1d')](handleEntityNotFound(_0x5581ee,null))['then'](function(_0x8b6b28){if(_0x8b6b28){_0x29ddc4=_0x8b6b28[_0x3e1e('0x4f')];var _0xc60340=_0x29ddc4[_0x3e1e('0x50')](-0x1);if(_0xc60340==='/'){_0x29ddc4=_0x29ddc4[_0x3e1e('0x51')](0x0,_0x29ddc4[_0x3e1e('0x52')](_0xc60340));}var _0x4d0854={'method':_0x3e1e('0x53'),'uri':util[_0x3e1e('0x54')](_0x3e1e('0x55'),_0x29ddc4,_0x3e1e('0x56')),'json':!![]};switch(_0x8b6b28[_0x3e1e('0x4e')]){case _0x3e1e('0x4c'):_0x4d0854['headers']={'Authorization':util[_0x3e1e('0x54')](_0x3e1e('0x57'),new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x58'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4c')]))['toString'](_0x3e1e('0x5a')))};break;case'token':_0x4d0854[_0x3e1e('0x5b')]={'Authorization':util[_0x3e1e('0x54')]('Basic\x20%s',new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x5c'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4d')]))['toString'](_0x3e1e('0x5a')))};break;default:throw new db['Sequelize'][(_0x3e1e('0x5d'))](_0x3e1e('0x5e'));}return rp(_0x4d0854);}})[_0x3e1e('0x1d')](function(_0x632f99){if(_0x632f99){var _0x2ef476=[_0x3e1e('0x5f'),'description',_0x3e1e('0x60'),_0x3e1e('0x61')];_[_0x3e1e('0x62')](_0x632f99[_0x3e1e('0x56')],function(_0x4b4fd4){return _0x2ef476[_0x3e1e('0x63')](_0x4b4fd4[_0x3e1e('0x22')]);});return{'count':_0x632f99[_0x3e1e('0x56')][_0x3e1e('0x41')],'rows':_['map'](_0x632f99[_0x3e1e('0x56')],function(_0x41d98f){return{'id':_0x41d98f['id'],'name':_0x41d98f[_0x3e1e('0x64')]>0x7?_0x41d98f[_0x3e1e('0x65')]:_0x41d98f[_0x3e1e('0x22')],'custom':_0x41d98f[_0x3e1e('0x64')]>0x7?!![]:![],'options':_0x41d98f['system_field_options']?_0x41d98f['system_field_options']:_0x41d98f['custom_field_options']?_0x41d98f[_0x3e1e('0x66')]:[]};})};}})['then'](respondWithResult(_0x5581ee,null))[_0x3e1e('0x37')](function(_0x5f436f){var _0x32b5ef=_0x5e148e[_0x3e1e('0x24')][_0x3e1e('0x67')]?0x1f4:_0x5f436f[_0x3e1e('0x68')]||0x1f4;logger['error'](_0x3e1e('0x69'),'getFields',_0x32b5ef,JSON[_0x3e1e('0x6a')](_0x5f436f));delete _0x5f436f['name'];if(_0x32b5ef===0x191){_0x32b5ef=0x190;}_0x5581ee[_0x3e1e('0x19')](_0x32b5ef)[_0x3e1e('0x20')](_0x5e148e['query'][_0x3e1e('0x67')]?{'message':_0x3e1e('0x6b'),'statusCode':_0x5f436f[_0x3e1e('0x68')]}:_0x5f436f);});}; \ No newline at end of file +var _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x5423,0xe3));var _0x3542=function(_0x9a6004,_0x37044e){_0x9a6004=_0x9a6004-0x0;var _0x3fd463=_0x5423[_0x9a6004];return _0x3fd463;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index fa21c5b..b2879ff 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 _0x5e6e=['api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger'];(function(_0x2d836a,_0x5041d3){var _0x55ef37=function(_0x47de08){while(--_0x47de08){_0x2d836a['push'](_0x2d836a['shift']());}};_0x55ef37(++_0x5041d3);}(_0x5e6e,0xc1));var _0xe5e6=function(_0x382a9d,_0x48fec7){_0x382a9d=_0x382a9d-0x0;var _0x507389=_0x5e6e[_0x382a9d];return _0x507389;};'use strict';var _=require('lodash');var util=require(_0xe5e6('0x0'));var logger=require(_0xe5e6('0x1'))(_0xe5e6('0x2'));var moment=require(_0xe5e6('0x3'));var BPromise=require(_0xe5e6('0x4'));var rp=require(_0xe5e6('0x5'));var fs=require('fs');var path=require(_0xe5e6('0x6'));var rimraf=require(_0xe5e6('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xe5e6('0x8'));module[_0xe5e6('0x9')]=function(_0x4bef73,_0x14dbb6){return _0x4bef73[_0xe5e6('0xa')](_0xe5e6('0xb'),attributes,{'tableName':_0xe5e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3e8=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x1baa5c,_0x3f2665){var _0x2d808f=function(_0x7bb2cb){while(--_0x7bb2cb){_0x1baa5c['push'](_0x1baa5c['shift']());}};_0x2d808f(++_0x3f2665);}(_0xb3e8,0x197));var _0x8b3e=function(_0x8c0bf5,_0x2456ab){_0x8c0bf5=_0x8c0bf5-0x0;var _0x447387=_0xb3e8[_0x8c0bf5];return _0x447387;};'use strict';var _=require(_0x8b3e('0x0'));var util=require(_0x8b3e('0x1'));var logger=require(_0x8b3e('0x2'))(_0x8b3e('0x3'));var moment=require(_0x8b3e('0x4'));var BPromise=require(_0x8b3e('0x5'));var rp=require(_0x8b3e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b3e('0x7'));var attributes=require(_0x8b3e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8b3e('0x9')]=function(_0x49fc4a,_0xbe9a2a){return _0x49fc4a['define'](_0x8b3e('0xa'),attributes,{'tableName':_0x8b3e('0xb'),'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 25844e8..f18541a 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 _0x1c6e=['limit','include','model','attributes','map','GetZendeskAccount','catch','find','raw','ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','ZendeskAccount','findAll','options','where'];(function(_0x2aab90,_0x1a8c9a){var _0x3e7fe3=function(_0x2a7159){while(--_0x2a7159){_0x2aab90['push'](_0x2aab90['shift']());}};_0x3e7fe3(++_0x1a8c9a);}(_0x1c6e,0x79));var _0xe1c6=function(_0x40a77f,_0x1d5f8d){_0x40a77f=_0x40a77f-0x0;var _0x415aa1=_0x1c6e[_0x40a77f];return _0x415aa1;};'use strict';var _=require(_0xe1c6('0x0'));var util=require(_0xe1c6('0x1'));var moment=require(_0xe1c6('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1c6('0x3'));var fs=require('fs');var Redis=require(_0xe1c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1c6('0x5'));var logger=require(_0xe1c6('0x6'))(_0xe1c6('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1c6('0x8'));var client=jayson[_0xe1c6('0x9')][_0xe1c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6869a2,_0x43cd49,_0x37c384){return new BPromise(function(_0x8a4ea5,_0x4699be){return client[_0xe1c6('0xb')](_0x6869a2,_0x37c384)[_0xe1c6('0xc')](function(_0x315731){logger[_0xe1c6('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x43cd49,'request\x20sent');logger[_0xe1c6('0xe')](_0xe1c6('0xf'),_0x43cd49,'request\x20sent',JSON[_0xe1c6('0x10')](_0x315731));if(_0x315731[_0xe1c6('0x11')]){if(_0x315731[_0xe1c6('0x11')][_0xe1c6('0x12')]===0x1f4){logger[_0xe1c6('0x11')](_0xe1c6('0x13'),_0x43cd49,_0x315731[_0xe1c6('0x11')][_0xe1c6('0x14')]);return _0x4699be(_0x315731[_0xe1c6('0x11')][_0xe1c6('0x14')]);}logger[_0xe1c6('0x11')](_0xe1c6('0x13'),_0x43cd49,_0x315731['error'][_0xe1c6('0x14')]);return _0x8a4ea5(_0x315731[_0xe1c6('0x11')][_0xe1c6('0x14')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x43cd49,_0xe1c6('0x15'));_0x8a4ea5(_0x315731[_0xe1c6('0x16')][_0xe1c6('0x14')]);}})['catch'](function(_0x33486e){logger[_0xe1c6('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x43cd49,_0x33486e);_0x4699be(_0x33486e);});});}exports['GetZendeskAccount']=function(_0x31c7da){var _0x49435e=this;return new Promise(function(_0x44b955,_0x2700e0){return db[_0xe1c6('0x17')][_0xe1c6('0x18')]({'raw':_0x31c7da[_0xe1c6('0x19')]?_0x31c7da[_0xe1c6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x31c7da[_0xe1c6('0x19')]?_0x31c7da['options'][_0xe1c6('0x1a')]||null:null,'attributes':_0x31c7da[_0xe1c6('0x19')]?_0x31c7da[_0xe1c6('0x19')]['attributes']||null:null,'limit':_0x31c7da[_0xe1c6('0x19')]?_0x31c7da['options'][_0xe1c6('0x1b')]||null:null,'include':_0x31c7da[_0xe1c6('0x19')]?_0x31c7da[_0xe1c6('0x19')][_0xe1c6('0x1c')]?_['map'](_0x31c7da['options']['include'],function(_0x1bd774){return{'model':db[_0x1bd774[_0xe1c6('0x1d')]],'as':_0x1bd774['as'],'attributes':_0x1bd774[_0xe1c6('0x1e')],'include':_0x1bd774['include']?_['map'](_0x1bd774[_0xe1c6('0x1c')],function(_0xe249d0){return{'model':db[_0xe249d0[_0xe1c6('0x1d')]],'as':_0xe249d0['as'],'attributes':_0xe249d0[_0xe1c6('0x1e')],'include':_0xe249d0[_0xe1c6('0x1c')]?_[_0xe1c6('0x1f')](_0xe249d0[_0xe1c6('0x1c')],function(_0x303c87){return{'model':db[_0x303c87[_0xe1c6('0x1d')]],'as':_0x303c87['as'],'attributes':_0x303c87[_0xe1c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe1c6('0xc')](function(_0x49ede7){logger[_0xe1c6('0xd')](_0xe1c6('0x20'),_0x31c7da);logger[_0xe1c6('0xe')](_0xe1c6('0x20'),_0x31c7da,JSON[_0xe1c6('0x10')](_0x49ede7));_0x44b955(_0x49ede7);})[_0xe1c6('0x21')](function(_0x10aca3){logger['error'](_0xe1c6('0x20'),_0x10aca3[_0xe1c6('0x14')],_0x31c7da);_0x2700e0(_0x49435e['error'](0x1f4,_0x10aca3[_0xe1c6('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x29f20b){var _0x2a7345=this;return new Promise(function(_0x191f19,_0x181eae){return db[_0xe1c6('0x17')][_0xe1c6('0x22')]({'raw':_0x29f20b[_0xe1c6('0x19')]?_0x29f20b['options'][_0xe1c6('0x23')]===undefined?!![]:![]:!![],'where':_0x29f20b[_0xe1c6('0x19')]?_0x29f20b['options'][_0xe1c6('0x1a')]||null:null,'attributes':_0x29f20b[_0xe1c6('0x19')]?_0x29f20b[_0xe1c6('0x19')][_0xe1c6('0x1e')]||null:null,'include':_0x29f20b['options']?_0x29f20b['options']['include']?_[_0xe1c6('0x1f')](_0x29f20b[_0xe1c6('0x19')]['include'],function(_0x10c946){return{'model':db[_0x10c946[_0xe1c6('0x1d')]],'as':_0x10c946['as'],'attributes':_0x10c946[_0xe1c6('0x1e')],'include':_0x10c946[_0xe1c6('0x1c')]?_['map'](_0x10c946['include'],function(_0x46343d){return{'model':db[_0x46343d[_0xe1c6('0x1d')]],'as':_0x46343d['as'],'attributes':_0x46343d[_0xe1c6('0x1e')],'include':_0x46343d[_0xe1c6('0x1c')]?_[_0xe1c6('0x1f')](_0x46343d[_0xe1c6('0x1c')],function(_0x106c4c){return{'model':db[_0x106c4c[_0xe1c6('0x1d')]],'as':_0x106c4c['as'],'attributes':_0x106c4c[_0xe1c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe1c6('0xc')](function(_0x1b72a2){logger[_0xe1c6('0xd')]('ShowZendeskAccount',_0x29f20b);logger[_0xe1c6('0xe')](_0xe1c6('0x24'),_0x29f20b,JSON[_0xe1c6('0x10')](_0x1b72a2));_0x191f19(_0x1b72a2);})[_0xe1c6('0x21')](function(_0x215c94){logger['error'](_0xe1c6('0x24'),_0x215c94[_0xe1c6('0x14')],_0x29f20b);_0x181eae(_0x2a7345[_0xe1c6('0x11')](0x1f4,_0x215c94[_0xe1c6('0x14')]));});});}; \ No newline at end of file +var _0xc49f=['map','model','info','ZendeskAccount','find','ShowZendeskAccount','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetZendeskAccount','findAll','options','where','attributes','limit','include'];(function(_0x41d24b,_0x341319){var _0xa94b96=function(_0x287c04){while(--_0x287c04){_0x41d24b['push'](_0x41d24b['shift']());}};_0xa94b96(++_0x341319);}(_0xc49f,0x1c0));var _0xfc49=function(_0x34b049,_0x42ee2b){_0x34b049=_0x34b049-0x0;var _0x13fc11=_0xc49f[_0x34b049];return _0x13fc11;};'use strict';var _=require(_0xfc49('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfc49('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc49('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc49('0x3'));var logger=require(_0xfc49('0x4'))(_0xfc49('0x5'));var config=require(_0xfc49('0x6'));var jayson=require(_0xfc49('0x7'));var client=jayson[_0xfc49('0x8')][_0xfc49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x383647,_0x30686a,_0x23f704){return new BPromise(function(_0xc0da96,_0x448eb0){return client['request'](_0x383647,_0x23f704)[_0xfc49('0xa')](function(_0x4e304e){logger['info'](_0xfc49('0xb'),_0x30686a,_0xfc49('0xc'));logger[_0xfc49('0xd')](_0xfc49('0xe'),_0x30686a,'request\x20sent',JSON[_0xfc49('0xf')](_0x4e304e));if(_0x4e304e['error']){if(_0x4e304e['error'][_0xfc49('0x10')]===0x1f4){logger['error'](_0xfc49('0xb'),_0x30686a,_0x4e304e[_0xfc49('0x11')][_0xfc49('0x12')]);return _0x448eb0(_0x4e304e[_0xfc49('0x11')]['message']);}logger[_0xfc49('0x11')](_0xfc49('0xb'),_0x30686a,_0x4e304e[_0xfc49('0x11')][_0xfc49('0x12')]);return _0xc0da96(_0x4e304e[_0xfc49('0x11')][_0xfc49('0x12')]);}else{logger['info'](_0xfc49('0xb'),_0x30686a,_0xfc49('0xc'));_0xc0da96(_0x4e304e[_0xfc49('0x13')][_0xfc49('0x12')]);}})[_0xfc49('0x14')](function(_0x5cd5dc){logger['error'](_0xfc49('0xb'),_0x30686a,_0x5cd5dc);_0x448eb0(_0x5cd5dc);});});}exports[_0xfc49('0x15')]=function(_0x37f332){var _0x3836f0=this;return new Promise(function(_0x4f492b,_0x2c264d){return db['ZendeskAccount'][_0xfc49('0x16')]({'raw':_0x37f332['options']?_0x37f332[_0xfc49('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37f332['options']?_0x37f332[_0xfc49('0x17')][_0xfc49('0x18')]||null:null,'attributes':_0x37f332[_0xfc49('0x17')]?_0x37f332[_0xfc49('0x17')][_0xfc49('0x19')]||null:null,'limit':_0x37f332['options']?_0x37f332[_0xfc49('0x17')][_0xfc49('0x1a')]||null:null,'include':_0x37f332['options']?_0x37f332['options'][_0xfc49('0x1b')]?_[_0xfc49('0x1c')](_0x37f332['options'][_0xfc49('0x1b')],function(_0x4a8c15){return{'model':db[_0x4a8c15[_0xfc49('0x1d')]],'as':_0x4a8c15['as'],'attributes':_0x4a8c15[_0xfc49('0x19')],'include':_0x4a8c15[_0xfc49('0x1b')]?_[_0xfc49('0x1c')](_0x4a8c15[_0xfc49('0x1b')],function(_0x397213){return{'model':db[_0x397213[_0xfc49('0x1d')]],'as':_0x397213['as'],'attributes':_0x397213[_0xfc49('0x19')],'include':_0x397213['include']?_[_0xfc49('0x1c')](_0x397213[_0xfc49('0x1b')],function(_0x3dedbb){return{'model':db[_0x3dedbb['model']],'as':_0x3dedbb['as'],'attributes':_0x3dedbb[_0xfc49('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfc49('0xa')](function(_0x1271c7){logger[_0xfc49('0x1e')]('GetZendeskAccount',_0x37f332);logger[_0xfc49('0xd')]('GetZendeskAccount',_0x37f332,JSON[_0xfc49('0xf')](_0x1271c7));_0x4f492b(_0x1271c7);})[_0xfc49('0x14')](function(_0x184cd8){logger[_0xfc49('0x11')]('GetZendeskAccount',_0x184cd8[_0xfc49('0x12')],_0x37f332);_0x2c264d(_0x3836f0[_0xfc49('0x11')](0x1f4,_0x184cd8[_0xfc49('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x1e239d){var _0x392d10=this;return new Promise(function(_0x24a33c,_0x953081){return db[_0xfc49('0x1f')][_0xfc49('0x20')]({'raw':_0x1e239d['options']?_0x1e239d[_0xfc49('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1e239d['options']?_0x1e239d['options'][_0xfc49('0x18')]||null:null,'attributes':_0x1e239d[_0xfc49('0x17')]?_0x1e239d[_0xfc49('0x17')][_0xfc49('0x19')]||null:null,'include':_0x1e239d['options']?_0x1e239d[_0xfc49('0x17')][_0xfc49('0x1b')]?_['map'](_0x1e239d['options'][_0xfc49('0x1b')],function(_0x72a20d){return{'model':db[_0x72a20d[_0xfc49('0x1d')]],'as':_0x72a20d['as'],'attributes':_0x72a20d[_0xfc49('0x19')],'include':_0x72a20d[_0xfc49('0x1b')]?_['map'](_0x72a20d['include'],function(_0x4fe303){return{'model':db[_0x4fe303[_0xfc49('0x1d')]],'as':_0x4fe303['as'],'attributes':_0x4fe303['attributes'],'include':_0x4fe303[_0xfc49('0x1b')]?_[_0xfc49('0x1c')](_0x4fe303['include'],function(_0x2ff971){return{'model':db[_0x2ff971['model']],'as':_0x2ff971['as'],'attributes':_0x2ff971[_0xfc49('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x412c33){logger[_0xfc49('0x1e')](_0xfc49('0x21'),_0x1e239d);logger[_0xfc49('0xd')](_0xfc49('0x21'),_0x1e239d,JSON[_0xfc49('0xf')](_0x412c33));_0x24a33c(_0x412c33);})['catch'](function(_0x2b694c){logger[_0xfc49('0x11')](_0xfc49('0x21'),_0x2b694c[_0xfc49('0x12')],_0x1e239d);_0x953081(_0x392d10[_0xfc49('0x11')](0x1f4,_0x2b694c['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 270590d..3c8cee8 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x26634d,_0x4ccaf1){var _0x50dce7=function(_0x59b6f0){while(--_0x59b6f0){_0x26634d['push'](_0x26634d['shift']());}};_0x50dce7(++_0x4ccaf1);}(_0xda3f,0xec));var _0xfda3=function(_0x576ea6,_0x15681a){_0x576ea6=_0x576ea6-0x0;var _0x5117e0=_0xda3f[_0x576ea6];return _0x5117e0;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xb7e7[_0x5834bc];return _0x3e183a;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 2f168be..20fd1b2 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 _0xb2db=['sequelize','exports','STRING'];(function(_0xe74ea6,_0x461881){var _0x133ecd=function(_0x5d9796){while(--_0x5d9796){_0xe74ea6['push'](_0xe74ea6['shift']());}};_0x133ecd(++_0x461881);}(_0xb2db,0x1dd));var _0xbb2d=function(_0x46eef,_0x51ed00){_0x46eef=_0x46eef-0x0;var _0x2c494f=_0xb2db[_0x46eef];return _0x2c494f;};'use strict';var Sequelize=require(_0xbb2d('0x0'));module[_0xbb2d('0x1')]={'name':{'type':Sequelize[_0xbb2d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe4fc=['exports'];(function(_0x4ab5cd,_0x1830b1){var _0x489c58=function(_0x25937f){while(--_0x25937f){_0x4ab5cd['push'](_0x4ab5cd['shift']());}};_0x489c58(++_0x1830b1);}(_0xe4fc,0x15b));var _0xce4f=function(_0x258dfa,_0x18fd97){_0x258dfa=_0x258dfa-0x0;var _0x2b683e=_0xe4fc[_0x258dfa];return _0x2b683e;};'use strict';var Sequelize=require('sequelize');module[_0xce4f('0x0')]={'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 cb2c5f0..e1913de 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 _0xc497=['index','map','ZendeskConfiguration','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','rawAttributes','include','find','create','body','catch','params','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send'];(function(_0x2c7917,_0x41a96d){var _0x13b1d0=function(_0x486396){while(--_0x486396){_0x2c7917['push'](_0x2c7917['shift']());}};_0x13b1d0(++_0x41a96d);}(_0xc497,0xd7));var _0x7c49=function(_0x3f048b,_0x5a60ca){_0x3f048b=_0x3f048b-0x0;var _0xdab6c=_0xc497[_0x3f048b];return _0xdab6c;};'use strict';var emlformat=require(_0x7c49('0x0'));var rimraf=require(_0x7c49('0x1'));var zipdir=require(_0x7c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c49('0x3'));var moment=require(_0x7c49('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7c49('0x5'));var path=require(_0x7c49('0x6'));var sox=require(_0x7c49('0x7'));var csv=require(_0x7c49('0x8'));var ejs=require(_0x7c49('0x9'));var fs=require('fs');var fs_extra=require(_0x7c49('0xa'));var _=require(_0x7c49('0xb'));var squel=require(_0x7c49('0xc'));var crypto=require(_0x7c49('0xd'));var jsforce=require(_0x7c49('0xe'));var deskjs=require(_0x7c49('0xf'));var toCsv=require(_0x7c49('0x8'));var querystring=require(_0x7c49('0x10'));var Papa=require(_0x7c49('0x11'));var Redis=require(_0x7c49('0x12'));var authService=require(_0x7c49('0x13'));var qs=require(_0x7c49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c49('0x15'))(_0x7c49('0x16'));var utils=require(_0x7c49('0x17'));var config=require(_0x7c49('0x18'));var licenseUtil=require(_0x7c49('0x19'));var db=require(_0x7c49('0x1a'))['db'];function respondWithStatusCode(_0x507702,_0xcc7074){_0xcc7074=_0xcc7074||0xcc;return function(_0xce74f1){if(_0xce74f1){return _0x507702[_0x7c49('0x1b')](_0xcc7074);}return _0x507702['status'](_0xcc7074)['end']();};}function respondWithResult(_0x4e08bd,_0x27bbd5){_0x27bbd5=_0x27bbd5||0xc8;return function(_0x17f864){if(_0x17f864){return _0x4e08bd[_0x7c49('0x1c')](_0x27bbd5)[_0x7c49('0x1d')](_0x17f864);}};}function respondWithFilteredResult(_0x249de0,_0x32ff7c){return function(_0x1ddeba){if(_0x1ddeba){var _0x36187b=typeof _0x32ff7c['offset']==='undefined'&&typeof _0x32ff7c['limit']==='undefined';var _0x164e15=_0x1ddeba[_0x7c49('0x1e')];var _0x26a23a=_0x36187b?0x0:_0x32ff7c['offset'];var _0x505043=_0x36187b?_0x1ddeba[_0x7c49('0x1e')]:_0x32ff7c['offset']+_0x32ff7c['limit'];var _0x3f422f;if(_0x505043>=_0x164e15){_0x505043=_0x164e15;_0x3f422f=0xc8;}else{_0x3f422f=0xce;}_0x249de0[_0x7c49('0x1c')](_0x3f422f);return _0x249de0[_0x7c49('0x1f')](_0x7c49('0x20'),_0x26a23a+'-'+_0x505043+'/'+_0x164e15)[_0x7c49('0x1d')](_0x1ddeba);}return null;};}function patchUpdates(_0x32d479){return function(_0xba7151){try{jsonpatch[_0x7c49('0x21')](_0xba7151,_0x32d479,!![]);}catch(_0x451d56){return BPromise[_0x7c49('0x22')](_0x451d56);}return _0xba7151['save']();};}function saveUpdates(_0xbe35eb,_0x141a2e){return function(_0x2b29c8){if(_0x2b29c8){return _0x2b29c8[_0x7c49('0x23')](_0xbe35eb)['then'](function(_0xd50b91){return _0xd50b91;});}return null;};}function removeEntity(_0x56264b,_0x55ffa6){return function(_0x32d172){if(_0x32d172){return _0x32d172[_0x7c49('0x24')]()[_0x7c49('0x25')](function(){_0x56264b[_0x7c49('0x1c')](0xcc)[_0x7c49('0x26')]();});}};}function handleEntityNotFound(_0x4dee0d,_0x3e2aa9){return function(_0x48c4fa){if(!_0x48c4fa){_0x4dee0d['sendStatus'](0x194);}return _0x48c4fa;};}function handleError(_0x3a48bb,_0x4c07bf){_0x4c07bf=_0x4c07bf||0x1f4;return function(_0x81d978){logger[_0x7c49('0x27')](_0x81d978[_0x7c49('0x28')]);if(_0x81d978[_0x7c49('0x29')]){delete _0x81d978[_0x7c49('0x29')];}_0x3a48bb['status'](_0x4c07bf)[_0x7c49('0x2a')](_0x81d978);};}exports[_0x7c49('0x2b')]=function(_0x201849,_0xbc68a8){var _0x4d2679={},_0x464fbc={},_0xcca18f={'count':0x0,'rows':[]};var _0x1e21e1=_[_0x7c49('0x2c')](db[_0x7c49('0x2d')]['rawAttributes'],function(_0x442f65){return{'name':_0x442f65[_0x7c49('0x2e')],'type':_0x442f65[_0x7c49('0x2f')]['key']};});_0x464fbc['model']=_[_0x7c49('0x2c')](_0x1e21e1,_0x7c49('0x29'));_0x464fbc['query']=_[_0x7c49('0x30')](_0x201849[_0x7c49('0x31')]);_0x464fbc[_0x7c49('0x32')]=_[_0x7c49('0x33')](_0x464fbc['model'],_0x464fbc[_0x7c49('0x31')]);_0x4d2679[_0x7c49('0x34')]=_[_0x7c49('0x33')](_0x464fbc[_0x7c49('0x35')],qs[_0x7c49('0x36')](_0x201849[_0x7c49('0x31')][_0x7c49('0x36')]));_0x4d2679['attributes']=_0x4d2679[_0x7c49('0x34')][_0x7c49('0x37')]?_0x4d2679[_0x7c49('0x34')]:_0x464fbc['model'];if(!_0x201849[_0x7c49('0x31')][_0x7c49('0x38')](_0x7c49('0x39'))){_0x4d2679[_0x7c49('0x3a')]=qs['limit'](_0x201849[_0x7c49('0x31')][_0x7c49('0x3a')]);_0x4d2679['offset']=qs['offset'](_0x201849[_0x7c49('0x31')][_0x7c49('0x3b')]);}_0x4d2679[_0x7c49('0x3c')]=qs['sort'](_0x201849[_0x7c49('0x31')][_0x7c49('0x3d')]);_0x4d2679[_0x7c49('0x3e')]=qs['filters'](_[_0x7c49('0x3f')](_0x201849[_0x7c49('0x31')],_0x464fbc['filters']),_0x1e21e1);if(_0x201849['query']['filter']){_0x4d2679[_0x7c49('0x3e')]=_[_0x7c49('0x40')](_0x4d2679[_0x7c49('0x3e')],{'$or':_[_0x7c49('0x2c')](_0x1e21e1,function(_0x3997e3){if(_0x3997e3['type']!==_0x7c49('0x41')){var _0x383cfb={};_0x383cfb[_0x3997e3[_0x7c49('0x29')]]={'$like':'%'+_0x201849[_0x7c49('0x31')][_0x7c49('0x42')]+'%'};return _0x383cfb;}})});}_0x4d2679=_['merge']({},_0x4d2679,_0x201849[_0x7c49('0x43')]);var _0xd92f9e={'where':_0x4d2679['where']};return db[_0x7c49('0x2d')][_0x7c49('0x1e')](_0xd92f9e)['then'](function(_0x1b5b76){_0xcca18f[_0x7c49('0x1e')]=_0x1b5b76;if(_0x201849[_0x7c49('0x31')][_0x7c49('0x44')]){_0x4d2679['include']=[{'all':!![]}];}return db[_0x7c49('0x2d')]['findAll'](_0x4d2679);})[_0x7c49('0x25')](function(_0x5ac6bb){_0xcca18f['rows']=_0x5ac6bb;return _0xcca18f;})[_0x7c49('0x25')](respondWithFilteredResult(_0xbc68a8,_0x4d2679))['catch'](handleError(_0xbc68a8,null));};exports[_0x7c49('0x45')]=function(_0x2d6f66,_0x2d2edb){var _0x1c7280={'raw':![],'where':{'id':_0x2d6f66['params']['id']}},_0x97c16e={};_0x97c16e[_0x7c49('0x35')]=_['keys'](db[_0x7c49('0x2d')][_0x7c49('0x46')]);_0x97c16e[_0x7c49('0x31')]=_[_0x7c49('0x30')](_0x2d6f66[_0x7c49('0x31')]);_0x97c16e['filters']=_['intersection'](_0x97c16e[_0x7c49('0x35')],_0x97c16e[_0x7c49('0x31')]);_0x1c7280['attributes']=_[_0x7c49('0x33')](_0x97c16e[_0x7c49('0x35')],qs[_0x7c49('0x36')](_0x2d6f66['query'][_0x7c49('0x36')]));_0x1c7280[_0x7c49('0x34')]=_0x1c7280['attributes'][_0x7c49('0x37')]?_0x1c7280['attributes']:_0x97c16e[_0x7c49('0x35')];if(_0x2d6f66[_0x7c49('0x31')][_0x7c49('0x44')]){_0x1c7280[_0x7c49('0x47')]=[{'all':!![]}];}_0x1c7280=_['merge']({},_0x1c7280,_0x2d6f66[_0x7c49('0x43')]);return db[_0x7c49('0x2d')][_0x7c49('0x48')](_0x1c7280)[_0x7c49('0x25')](handleEntityNotFound(_0x2d2edb,null))['then'](respondWithResult(_0x2d2edb,null))['catch'](handleError(_0x2d2edb,null));};exports[_0x7c49('0x49')]=function(_0x3fbca5,_0x89aee8){return db[_0x7c49('0x2d')]['create'](_0x3fbca5[_0x7c49('0x4a')],{})[_0x7c49('0x25')](respondWithResult(_0x89aee8,0xc9))[_0x7c49('0x4b')](handleError(_0x89aee8,null));};exports['update']=function(_0xe62a17,_0x1e41de){if(_0xe62a17[_0x7c49('0x4a')]['id']){delete _0xe62a17['body']['id'];}return db[_0x7c49('0x2d')][_0x7c49('0x48')]({'where':{'id':_0xe62a17[_0x7c49('0x4c')]['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x1e41de,null))[_0x7c49('0x25')](saveUpdates(_0xe62a17['body'],null))['then'](respondWithResult(_0x1e41de,null))[_0x7c49('0x4b')](handleError(_0x1e41de,null));};exports[_0x7c49('0x24')]=function(_0x129f68,_0x4c020f){return db['ZendeskConfiguration'][_0x7c49('0x48')]({'where':{'id':_0x129f68[_0x7c49('0x4c')]['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x4c020f,null))[_0x7c49('0x25')](removeEntity(_0x4c020f,null))[_0x7c49('0x4b')](handleError(_0x4c020f,null));};exports[_0x7c49('0x4d')]=function(_0x38dfaa,_0x35ccc1,_0x2106cb){var _0x365a87={};var _0x4a701c={};var _0x27f264;var _0x435b84;return db[_0x7c49('0x2d')][_0x7c49('0x4e')]({'where':{'id':_0x38dfaa[_0x7c49('0x4c')]['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x35ccc1,null))[_0x7c49('0x25')](function(_0x3e811a){if(_0x3e811a){_0x27f264=_0x3e811a;_0x4a701c[_0x7c49('0x35')]=_['keys'](db['ZendeskField'][_0x7c49('0x46')]);_0x4a701c[_0x7c49('0x31')]=_[_0x7c49('0x30')](_0x38dfaa[_0x7c49('0x31')]);_0x4a701c[_0x7c49('0x32')]=_['intersection'](_0x4a701c[_0x7c49('0x35')],_0x4a701c['query']);_0x365a87['attributes']=_[_0x7c49('0x33')](_0x4a701c[_0x7c49('0x35')],qs[_0x7c49('0x36')](_0x38dfaa[_0x7c49('0x31')][_0x7c49('0x36')]));_0x365a87[_0x7c49('0x34')]=_0x365a87[_0x7c49('0x34')][_0x7c49('0x37')]?_0x365a87['attributes']:_0x4a701c[_0x7c49('0x35')];_0x365a87[_0x7c49('0x3c')]=qs[_0x7c49('0x3d')](_0x38dfaa[_0x7c49('0x31')][_0x7c49('0x3d')]);_0x365a87[_0x7c49('0x3e')]=qs['filters'](_[_0x7c49('0x3f')](_0x38dfaa['query'],_0x4a701c['filters']));if(_0x38dfaa[_0x7c49('0x31')][_0x7c49('0x42')]){_0x365a87[_0x7c49('0x3e')]=_['merge'](_0x365a87[_0x7c49('0x3e')],{'$or':_[_0x7c49('0x2c')](_0x365a87[_0x7c49('0x34')],function(_0x47d1ab){var _0x4972ab={};_0x4972ab[_0x47d1ab]={'$like':'%'+_0x38dfaa['query'][_0x7c49('0x42')]+'%'};return _0x4972ab;})});}_0x365a87=_[_0x7c49('0x40')]({},_0x365a87,_0x38dfaa[_0x7c49('0x43')]);return _0x27f264[_0x7c49('0x4d')](_0x365a87);}})['then'](function(_0x45923f){if(_0x45923f){_0x435b84=_0x45923f['length'];if(!_0x38dfaa[_0x7c49('0x31')]['hasOwnProperty'](_0x7c49('0x39'))){_0x365a87[_0x7c49('0x3a')]=qs[_0x7c49('0x3a')](_0x38dfaa[_0x7c49('0x31')][_0x7c49('0x3a')]);_0x365a87[_0x7c49('0x3b')]=qs[_0x7c49('0x3b')](_0x38dfaa[_0x7c49('0x31')][_0x7c49('0x3b')]);}return _0x27f264[_0x7c49('0x4d')](_0x365a87);}})[_0x7c49('0x25')](function(_0x45859d){if(_0x45859d){return _0x45859d?{'count':_0x435b84,'rows':_0x45859d}:null;}})[_0x7c49('0x25')](respondWithResult(_0x35ccc1,null))[_0x7c49('0x4b')](handleError(_0x35ccc1,null));};exports[_0x7c49('0x4f')]=function(_0x355546,_0x55a4c3,_0x134726){var _0x2473f2={};var _0x3bb541={};var _0x50da33;var _0x2dcf71;return db[_0x7c49('0x2d')][_0x7c49('0x4e')]({'where':{'id':_0x355546[_0x7c49('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55a4c3,null))[_0x7c49('0x25')](function(_0x543967){if(_0x543967){_0x50da33=_0x543967;_0x3bb541['model']=_[_0x7c49('0x30')](db[_0x7c49('0x50')][_0x7c49('0x46')]);_0x3bb541[_0x7c49('0x31')]=_[_0x7c49('0x30')](_0x355546[_0x7c49('0x31')]);_0x3bb541['filters']=_[_0x7c49('0x33')](_0x3bb541[_0x7c49('0x35')],_0x3bb541[_0x7c49('0x31')]);_0x2473f2[_0x7c49('0x34')]=_[_0x7c49('0x33')](_0x3bb541[_0x7c49('0x35')],qs[_0x7c49('0x36')](_0x355546[_0x7c49('0x31')][_0x7c49('0x36')]));_0x2473f2[_0x7c49('0x34')]=_0x2473f2['attributes'][_0x7c49('0x37')]?_0x2473f2[_0x7c49('0x34')]:_0x3bb541[_0x7c49('0x35')];_0x2473f2[_0x7c49('0x3c')]=qs[_0x7c49('0x3d')](_0x355546[_0x7c49('0x31')][_0x7c49('0x3d')]);_0x2473f2[_0x7c49('0x3e')]=qs[_0x7c49('0x32')](_[_0x7c49('0x3f')](_0x355546[_0x7c49('0x31')],_0x3bb541[_0x7c49('0x32')]));if(_0x355546[_0x7c49('0x31')][_0x7c49('0x42')]){_0x2473f2[_0x7c49('0x3e')]=_[_0x7c49('0x40')](_0x2473f2[_0x7c49('0x3e')],{'$or':_[_0x7c49('0x2c')](_0x2473f2['attributes'],function(_0x5e226a){var _0x6cc338={};_0x6cc338[_0x5e226a]={'$like':'%'+_0x355546[_0x7c49('0x31')][_0x7c49('0x42')]+'%'};return _0x6cc338;})});}_0x2473f2=_[_0x7c49('0x40')]({},_0x2473f2,_0x355546[_0x7c49('0x43')]);return _0x50da33[_0x7c49('0x4f')](_0x2473f2);}})[_0x7c49('0x25')](function(_0x222cb0){if(_0x222cb0){_0x2dcf71=_0x222cb0[_0x7c49('0x37')];if(!_0x355546[_0x7c49('0x31')][_0x7c49('0x38')](_0x7c49('0x39'))){_0x2473f2['limit']=qs['limit'](_0x355546[_0x7c49('0x31')]['limit']);_0x2473f2['offset']=qs[_0x7c49('0x3b')](_0x355546[_0x7c49('0x31')][_0x7c49('0x3b')]);}return _0x50da33[_0x7c49('0x4f')](_0x2473f2);}})[_0x7c49('0x25')](function(_0x4cfc85){if(_0x4cfc85){return _0x4cfc85?{'count':_0x2dcf71,'rows':_0x4cfc85}:null;}})[_0x7c49('0x25')](respondWithResult(_0x55a4c3,null))['catch'](handleError(_0x55a4c3,null));};exports['getDescriptions']=function(_0xb58c2c,_0x12a589,_0x2ca089){var _0x48a679={};var _0x59e971={};var _0x29ff74;var _0x35ed50;return db[_0x7c49('0x2d')][_0x7c49('0x4e')]({'where':{'id':_0xb58c2c[_0x7c49('0x4c')]['id']}})['then'](handleEntityNotFound(_0x12a589,null))[_0x7c49('0x25')](function(_0x2be1ac){if(_0x2be1ac){_0x29ff74=_0x2be1ac;_0x59e971[_0x7c49('0x35')]=_['keys'](db['ZendeskField'][_0x7c49('0x46')]);_0x59e971[_0x7c49('0x31')]=_[_0x7c49('0x30')](_0xb58c2c['query']);_0x59e971['filters']=_[_0x7c49('0x33')](_0x59e971[_0x7c49('0x35')],_0x59e971[_0x7c49('0x31')]);_0x48a679[_0x7c49('0x34')]=_[_0x7c49('0x33')](_0x59e971[_0x7c49('0x35')],qs[_0x7c49('0x36')](_0xb58c2c[_0x7c49('0x31')]['fields']));_0x48a679['attributes']=_0x48a679[_0x7c49('0x34')]['length']?_0x48a679[_0x7c49('0x34')]:_0x59e971['model'];_0x48a679['order']=qs[_0x7c49('0x3d')](_0xb58c2c['query'][_0x7c49('0x3d')]);_0x48a679[_0x7c49('0x3e')]=qs[_0x7c49('0x32')](_[_0x7c49('0x3f')](_0xb58c2c['query'],_0x59e971[_0x7c49('0x32')]));if(_0xb58c2c[_0x7c49('0x31')]['filter']){_0x48a679[_0x7c49('0x3e')]=_['merge'](_0x48a679[_0x7c49('0x3e')],{'$or':_[_0x7c49('0x2c')](_0x48a679[_0x7c49('0x34')],function(_0x3c37e9){var _0x2b503d={};_0x2b503d[_0x3c37e9]={'$like':'%'+_0xb58c2c[_0x7c49('0x31')]['filter']+'%'};return _0x2b503d;})});}_0x48a679=_[_0x7c49('0x40')]({},_0x48a679,_0xb58c2c[_0x7c49('0x43')]);return _0x29ff74['getDescriptions'](_0x48a679);}})[_0x7c49('0x25')](function(_0x4a9536){if(_0x4a9536){_0x35ed50=_0x4a9536[_0x7c49('0x37')];if(!_0xb58c2c[_0x7c49('0x31')][_0x7c49('0x38')]('nolimit')){_0x48a679[_0x7c49('0x3a')]=qs['limit'](_0xb58c2c[_0x7c49('0x31')]['limit']);_0x48a679[_0x7c49('0x3b')]=qs[_0x7c49('0x3b')](_0xb58c2c[_0x7c49('0x31')][_0x7c49('0x3b')]);}return _0x29ff74[_0x7c49('0x51')](_0x48a679);}})[_0x7c49('0x25')](function(_0x5d2a2a){if(_0x5d2a2a){return _0x5d2a2a?{'count':_0x35ed50,'rows':_0x5d2a2a}:null;}})[_0x7c49('0x25')](respondWithResult(_0x12a589,null))[_0x7c49('0x4b')](handleError(_0x12a589,null));};exports[_0x7c49('0x52')]=function(_0x4aa555,_0x34a286,_0x5a7ae1){var _0x2587d6={};var _0x3e328e={};var _0x4b5e04;var _0x41ad3b;return db[_0x7c49('0x2d')][_0x7c49('0x4e')]({'where':{'id':_0x4aa555[_0x7c49('0x4c')]['id']}})[_0x7c49('0x25')](handleEntityNotFound(_0x34a286,null))[_0x7c49('0x25')](function(_0x54dcd3){if(_0x54dcd3){_0x4b5e04=_0x54dcd3;_0x3e328e[_0x7c49('0x35')]=_[_0x7c49('0x30')](db[_0x7c49('0x53')]['rawAttributes']);_0x3e328e[_0x7c49('0x31')]=_[_0x7c49('0x30')](_0x4aa555[_0x7c49('0x31')]);_0x3e328e[_0x7c49('0x32')]=_[_0x7c49('0x33')](_0x3e328e[_0x7c49('0x35')],_0x3e328e[_0x7c49('0x31')]);_0x2587d6[_0x7c49('0x34')]=_[_0x7c49('0x33')](_0x3e328e['model'],qs[_0x7c49('0x36')](_0x4aa555[_0x7c49('0x31')][_0x7c49('0x36')]));_0x2587d6[_0x7c49('0x34')]=_0x2587d6[_0x7c49('0x34')][_0x7c49('0x37')]?_0x2587d6['attributes']:_0x3e328e[_0x7c49('0x35')];_0x2587d6['order']=qs['sort'](_0x4aa555['query'][_0x7c49('0x3d')]);_0x2587d6[_0x7c49('0x3e')]=qs['filters'](_['pick'](_0x4aa555[_0x7c49('0x31')],_0x3e328e[_0x7c49('0x32')]));if(_0x4aa555[_0x7c49('0x31')][_0x7c49('0x42')]){_0x2587d6['where']=_[_0x7c49('0x40')](_0x2587d6[_0x7c49('0x3e')],{'$or':_[_0x7c49('0x2c')](_0x2587d6['attributes'],function(_0x891947){var _0x43f14d={};_0x43f14d[_0x891947]={'$like':'%'+_0x4aa555[_0x7c49('0x31')][_0x7c49('0x42')]+'%'};return _0x43f14d;})});}_0x2587d6=_['merge']({},_0x2587d6,_0x4aa555['options']);return _0x4b5e04['getTags'](_0x2587d6);}})['then'](function(_0x170ced){if(_0x170ced){_0x41ad3b=_0x170ced[_0x7c49('0x37')];if(!_0x4aa555[_0x7c49('0x31')]['hasOwnProperty'](_0x7c49('0x39'))){_0x2587d6[_0x7c49('0x3a')]=qs[_0x7c49('0x3a')](_0x4aa555[_0x7c49('0x31')]['limit']);_0x2587d6[_0x7c49('0x3b')]=qs[_0x7c49('0x3b')](_0x4aa555[_0x7c49('0x31')][_0x7c49('0x3b')]);}return _0x4b5e04['getTags'](_0x2587d6);}})[_0x7c49('0x25')](function(_0x369156){if(_0x369156){return _0x369156?{'count':_0x41ad3b,'rows':_0x369156}:null;}})[_0x7c49('0x25')](respondWithResult(_0x34a286,null))['catch'](handleError(_0x34a286,null));};exports[_0x7c49('0x54')]=function(_0x4de8d7,_0x6d726b,_0x14a644){if(_0x4de8d7[_0x7c49('0x4a')]['id']){delete _0x4de8d7[_0x7c49('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x7c49('0x4e')]({'where':{'id':_0x4de8d7['params']['id']}})['then'](handleEntityNotFound(_0x6d726b,null))['then'](function(_0x33778d){if(_0x33778d){return _0x33778d['setTags'](_0x4de8d7[_0x7c49('0x4a')][_0x7c49('0x55')]||[]);}return null;})['then'](respondWithResult(_0x6d726b,null))['catch'](handleError(_0x6d726b,null));}; \ No newline at end of file +var _0x1e4d=['rows','catch','show','params','fields','length','includeAll','include','find','create','body','getFields','findOne','ZendeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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','sendStatus','status','undefined','count','offset','set','Content-Range','json','reject','then','destroy','end','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','findAll'];(function(_0x176e96,_0x6f2e74){var _0x9ea112=function(_0x1a549e){while(--_0x1a549e){_0x176e96['push'](_0x176e96['shift']());}};_0x9ea112(++_0x6f2e74);}(_0x1e4d,0x120));var _0xd1e4=function(_0x5c0c95,_0x353f56){_0x5c0c95=_0x5c0c95-0x0;var _0x48a6d1=_0x1e4d[_0x5c0c95];return _0x48a6d1;};'use strict';var emlformat=require(_0xd1e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1e4('0x1'));var jsonpatch=require(_0xd1e4('0x2'));var rp=require(_0xd1e4('0x3'));var moment=require(_0xd1e4('0x4'));var BPromise=require(_0xd1e4('0x5'));var Mustache=require('mustache');var util=require(_0xd1e4('0x6'));var path=require(_0xd1e4('0x7'));var sox=require(_0xd1e4('0x8'));var csv=require(_0xd1e4('0x9'));var ejs=require(_0xd1e4('0xa'));var fs=require('fs');var fs_extra=require(_0xd1e4('0xb'));var _=require(_0xd1e4('0xc'));var squel=require(_0xd1e4('0xd'));var crypto=require(_0xd1e4('0xe'));var jsforce=require(_0xd1e4('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd1e4('0x10'));var Papa=require(_0xd1e4('0x11'));var Redis=require('ioredis');var authService=require(_0xd1e4('0x12'));var qs=require(_0xd1e4('0x13'));var as=require(_0xd1e4('0x14'));var hardwareService=require(_0xd1e4('0x15'));var logger=require(_0xd1e4('0x16'))(_0xd1e4('0x17'));var utils=require(_0xd1e4('0x18'));var config=require(_0xd1e4('0x19'));var licenseUtil=require(_0xd1e4('0x1a'));var db=require(_0xd1e4('0x1b'))['db'];function respondWithStatusCode(_0x969963,_0x5b007a){_0x5b007a=_0x5b007a||0xcc;return function(_0x3e1e95){if(_0x3e1e95){return _0x969963[_0xd1e4('0x1c')](_0x5b007a);}return _0x969963[_0xd1e4('0x1d')](_0x5b007a)['end']();};}function respondWithResult(_0x384a1a,_0x23fbe5){_0x23fbe5=_0x23fbe5||0xc8;return function(_0xda163){if(_0xda163){return _0x384a1a[_0xd1e4('0x1d')](_0x23fbe5)['json'](_0xda163);}};}function respondWithFilteredResult(_0x4a0e51,_0x4e9eb2){return function(_0x20fcc6){if(_0x20fcc6){var _0x49f1c4=typeof _0x4e9eb2['offset']===_0xd1e4('0x1e')&&typeof _0x4e9eb2['limit']==='undefined';var _0x411c60=_0x20fcc6[_0xd1e4('0x1f')];var _0x336ca8=_0x49f1c4?0x0:_0x4e9eb2[_0xd1e4('0x20')];var _0x53af60=_0x49f1c4?_0x20fcc6[_0xd1e4('0x1f')]:_0x4e9eb2[_0xd1e4('0x20')]+_0x4e9eb2['limit'];var _0x2d714c;if(_0x53af60>=_0x411c60){_0x53af60=_0x411c60;_0x2d714c=0xc8;}else{_0x2d714c=0xce;}_0x4a0e51[_0xd1e4('0x1d')](_0x2d714c);return _0x4a0e51[_0xd1e4('0x21')](_0xd1e4('0x22'),_0x336ca8+'-'+_0x53af60+'/'+_0x411c60)[_0xd1e4('0x23')](_0x20fcc6);}return null;};}function patchUpdates(_0x3dcb13){return function(_0x561ff1){try{jsonpatch['apply'](_0x561ff1,_0x3dcb13,!![]);}catch(_0x5ec016){return BPromise[_0xd1e4('0x24')](_0x5ec016);}return _0x561ff1['save']();};}function saveUpdates(_0x1df89e,_0x5bc8b1){return function(_0x70c1f6){if(_0x70c1f6){return _0x70c1f6['update'](_0x1df89e)[_0xd1e4('0x25')](function(_0x5be19a){return _0x5be19a;});}return null;};}function removeEntity(_0x4b4315,_0x1dc58d){return function(_0x59da6c){if(_0x59da6c){return _0x59da6c[_0xd1e4('0x26')]()[_0xd1e4('0x25')](function(){_0x4b4315[_0xd1e4('0x1d')](0xcc)[_0xd1e4('0x27')]();});}};}function handleEntityNotFound(_0x6fd21f,_0x1e7c31){return function(_0x38b78a){if(!_0x38b78a){_0x6fd21f['sendStatus'](0x194);}return _0x38b78a;};}function handleError(_0x1e5ca8,_0x1f99ca){_0x1f99ca=_0x1f99ca||0x1f4;return function(_0x5c45f4){logger[_0xd1e4('0x28')](_0x5c45f4[_0xd1e4('0x29')]);if(_0x5c45f4[_0xd1e4('0x2a')]){delete _0x5c45f4['name'];}_0x1e5ca8['status'](_0x1f99ca)[_0xd1e4('0x2b')](_0x5c45f4);};}exports[_0xd1e4('0x2c')]=function(_0x46c0fe,_0x26817c){var _0x299b4b={},_0x2dc398={},_0x1081d0={'count':0x0,'rows':[]};var _0x2d1d5a=_[_0xd1e4('0x2d')](db[_0xd1e4('0x2e')][_0xd1e4('0x2f')],function(_0x58a04b){return{'name':_0x58a04b[_0xd1e4('0x30')],'type':_0x58a04b['type'][_0xd1e4('0x31')]};});_0x2dc398[_0xd1e4('0x32')]=_[_0xd1e4('0x2d')](_0x2d1d5a,_0xd1e4('0x2a'));_0x2dc398[_0xd1e4('0x33')]=_[_0xd1e4('0x34')](_0x46c0fe[_0xd1e4('0x33')]);_0x2dc398[_0xd1e4('0x35')]=_[_0xd1e4('0x36')](_0x2dc398['model'],_0x2dc398[_0xd1e4('0x33')]);_0x299b4b[_0xd1e4('0x37')]=_[_0xd1e4('0x36')](_0x2dc398[_0xd1e4('0x32')],qs['fields'](_0x46c0fe[_0xd1e4('0x33')]['fields']));_0x299b4b[_0xd1e4('0x37')]=_0x299b4b[_0xd1e4('0x37')]['length']?_0x299b4b[_0xd1e4('0x37')]:_0x2dc398[_0xd1e4('0x32')];if(!_0x46c0fe[_0xd1e4('0x33')][_0xd1e4('0x38')](_0xd1e4('0x39'))){_0x299b4b['limit']=qs[_0xd1e4('0x3a')](_0x46c0fe[_0xd1e4('0x33')]['limit']);_0x299b4b[_0xd1e4('0x20')]=qs[_0xd1e4('0x20')](_0x46c0fe[_0xd1e4('0x33')][_0xd1e4('0x20')]);}_0x299b4b[_0xd1e4('0x3b')]=qs[_0xd1e4('0x3c')](_0x46c0fe[_0xd1e4('0x33')][_0xd1e4('0x3c')]);_0x299b4b['where']=qs[_0xd1e4('0x35')](_[_0xd1e4('0x3d')](_0x46c0fe['query'],_0x2dc398['filters']),_0x2d1d5a);if(_0x46c0fe[_0xd1e4('0x33')][_0xd1e4('0x3e')]){_0x299b4b[_0xd1e4('0x3f')]=_['merge'](_0x299b4b['where'],{'$or':_['map'](_0x2d1d5a,function(_0x4891d6){if(_0x4891d6[_0xd1e4('0x40')]!==_0xd1e4('0x41')){var _0x3418a4={};_0x3418a4[_0x4891d6[_0xd1e4('0x2a')]]={'$like':'%'+_0x46c0fe['query'][_0xd1e4('0x3e')]+'%'};return _0x3418a4;}})});}_0x299b4b=_[_0xd1e4('0x42')]({},_0x299b4b,_0x46c0fe['options']);var _0x337a36={'where':_0x299b4b['where']};return db[_0xd1e4('0x2e')][_0xd1e4('0x1f')](_0x337a36)[_0xd1e4('0x25')](function(_0x5ee59c){_0x1081d0[_0xd1e4('0x1f')]=_0x5ee59c;if(_0x46c0fe[_0xd1e4('0x33')]['includeAll']){_0x299b4b['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xd1e4('0x43')](_0x299b4b);})[_0xd1e4('0x25')](function(_0x30a6ae){_0x1081d0[_0xd1e4('0x44')]=_0x30a6ae;return _0x1081d0;})[_0xd1e4('0x25')](respondWithFilteredResult(_0x26817c,_0x299b4b))[_0xd1e4('0x45')](handleError(_0x26817c,null));};exports[_0xd1e4('0x46')]=function(_0x55b217,_0x10c2cd){var _0x3fc58a={'raw':![],'where':{'id':_0x55b217[_0xd1e4('0x47')]['id']}},_0x641dde={};_0x641dde[_0xd1e4('0x32')]=_[_0xd1e4('0x34')](db[_0xd1e4('0x2e')]['rawAttributes']);_0x641dde['query']=_[_0xd1e4('0x34')](_0x55b217['query']);_0x641dde[_0xd1e4('0x35')]=_['intersection'](_0x641dde[_0xd1e4('0x32')],_0x641dde['query']);_0x3fc58a['attributes']=_[_0xd1e4('0x36')](_0x641dde[_0xd1e4('0x32')],qs['fields'](_0x55b217[_0xd1e4('0x33')][_0xd1e4('0x48')]));_0x3fc58a[_0xd1e4('0x37')]=_0x3fc58a['attributes'][_0xd1e4('0x49')]?_0x3fc58a[_0xd1e4('0x37')]:_0x641dde[_0xd1e4('0x32')];if(_0x55b217['query'][_0xd1e4('0x4a')]){_0x3fc58a[_0xd1e4('0x4b')]=[{'all':!![]}];}_0x3fc58a=_[_0xd1e4('0x42')]({},_0x3fc58a,_0x55b217['options']);return db[_0xd1e4('0x2e')][_0xd1e4('0x4c')](_0x3fc58a)['then'](handleEntityNotFound(_0x10c2cd,null))[_0xd1e4('0x25')](respondWithResult(_0x10c2cd,null))[_0xd1e4('0x45')](handleError(_0x10c2cd,null));};exports['create']=function(_0x4fac54,_0x27daee){return db[_0xd1e4('0x2e')][_0xd1e4('0x4d')](_0x4fac54[_0xd1e4('0x4e')],{})[_0xd1e4('0x25')](respondWithResult(_0x27daee,0xc9))[_0xd1e4('0x45')](handleError(_0x27daee,null));};exports['update']=function(_0x1f3c4a,_0xce9a37){if(_0x1f3c4a[_0xd1e4('0x4e')]['id']){delete _0x1f3c4a[_0xd1e4('0x4e')]['id'];}return db[_0xd1e4('0x2e')][_0xd1e4('0x4c')]({'where':{'id':_0x1f3c4a[_0xd1e4('0x47')]['id']}})[_0xd1e4('0x25')](handleEntityNotFound(_0xce9a37,null))[_0xd1e4('0x25')](saveUpdates(_0x1f3c4a['body'],null))[_0xd1e4('0x25')](respondWithResult(_0xce9a37,null))[_0xd1e4('0x45')](handleError(_0xce9a37,null));};exports['destroy']=function(_0x2f97a3,_0x46d942){return db[_0xd1e4('0x2e')][_0xd1e4('0x4c')]({'where':{'id':_0x2f97a3[_0xd1e4('0x47')]['id']}})['then'](handleEntityNotFound(_0x46d942,null))[_0xd1e4('0x25')](removeEntity(_0x46d942,null))[_0xd1e4('0x45')](handleError(_0x46d942,null));};exports[_0xd1e4('0x4f')]=function(_0x42db61,_0x2009c8,_0x25636e){var _0x4bd463={};var _0x2f0a80={};var _0x410c38;var _0x57e3f4;return db[_0xd1e4('0x2e')][_0xd1e4('0x50')]({'where':{'id':_0x42db61[_0xd1e4('0x47')]['id']}})[_0xd1e4('0x25')](handleEntityNotFound(_0x2009c8,null))[_0xd1e4('0x25')](function(_0x2ca599){if(_0x2ca599){_0x410c38=_0x2ca599;_0x2f0a80[_0xd1e4('0x32')]=_[_0xd1e4('0x34')](db[_0xd1e4('0x51')][_0xd1e4('0x2f')]);_0x2f0a80[_0xd1e4('0x33')]=_[_0xd1e4('0x34')](_0x42db61[_0xd1e4('0x33')]);_0x2f0a80[_0xd1e4('0x35')]=_[_0xd1e4('0x36')](_0x2f0a80[_0xd1e4('0x32')],_0x2f0a80[_0xd1e4('0x33')]);_0x4bd463[_0xd1e4('0x37')]=_[_0xd1e4('0x36')](_0x2f0a80[_0xd1e4('0x32')],qs[_0xd1e4('0x48')](_0x42db61['query'][_0xd1e4('0x48')]));_0x4bd463[_0xd1e4('0x37')]=_0x4bd463[_0xd1e4('0x37')][_0xd1e4('0x49')]?_0x4bd463[_0xd1e4('0x37')]:_0x2f0a80['model'];_0x4bd463[_0xd1e4('0x3b')]=qs[_0xd1e4('0x3c')](_0x42db61[_0xd1e4('0x33')][_0xd1e4('0x3c')]);_0x4bd463[_0xd1e4('0x3f')]=qs[_0xd1e4('0x35')](_[_0xd1e4('0x3d')](_0x42db61[_0xd1e4('0x33')],_0x2f0a80['filters']));if(_0x42db61['query']['filter']){_0x4bd463[_0xd1e4('0x3f')]=_[_0xd1e4('0x42')](_0x4bd463[_0xd1e4('0x3f')],{'$or':_[_0xd1e4('0x2d')](_0x4bd463[_0xd1e4('0x37')],function(_0x17f5c4){var _0x5d59a6={};_0x5d59a6[_0x17f5c4]={'$like':'%'+_0x42db61['query'][_0xd1e4('0x3e')]+'%'};return _0x5d59a6;})});}_0x4bd463=_[_0xd1e4('0x42')]({},_0x4bd463,_0x42db61[_0xd1e4('0x52')]);return _0x410c38[_0xd1e4('0x4f')](_0x4bd463);}})['then'](function(_0x21be50){if(_0x21be50){_0x57e3f4=_0x21be50[_0xd1e4('0x49')];if(!_0x42db61[_0xd1e4('0x33')][_0xd1e4('0x38')](_0xd1e4('0x39'))){_0x4bd463[_0xd1e4('0x3a')]=qs[_0xd1e4('0x3a')](_0x42db61[_0xd1e4('0x33')]['limit']);_0x4bd463[_0xd1e4('0x20')]=qs[_0xd1e4('0x20')](_0x42db61['query'][_0xd1e4('0x20')]);}return _0x410c38[_0xd1e4('0x4f')](_0x4bd463);}})['then'](function(_0x1ea566){if(_0x1ea566){return _0x1ea566?{'count':_0x57e3f4,'rows':_0x1ea566}:null;}})[_0xd1e4('0x25')](respondWithResult(_0x2009c8,null))['catch'](handleError(_0x2009c8,null));};exports[_0xd1e4('0x53')]=function(_0x245cfa,_0x271baa,_0x320cb6){var _0x4e00c1={};var _0x39759d={};var _0x2c42ec;var _0x4ad053;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x245cfa[_0xd1e4('0x47')]['id']}})[_0xd1e4('0x25')](handleEntityNotFound(_0x271baa,null))[_0xd1e4('0x25')](function(_0x381b6f){if(_0x381b6f){_0x2c42ec=_0x381b6f;_0x39759d[_0xd1e4('0x32')]=_[_0xd1e4('0x34')](db[_0xd1e4('0x51')][_0xd1e4('0x2f')]);_0x39759d['query']=_[_0xd1e4('0x34')](_0x245cfa[_0xd1e4('0x33')]);_0x39759d[_0xd1e4('0x35')]=_[_0xd1e4('0x36')](_0x39759d[_0xd1e4('0x32')],_0x39759d[_0xd1e4('0x33')]);_0x4e00c1[_0xd1e4('0x37')]=_['intersection'](_0x39759d[_0xd1e4('0x32')],qs[_0xd1e4('0x48')](_0x245cfa[_0xd1e4('0x33')][_0xd1e4('0x48')]));_0x4e00c1['attributes']=_0x4e00c1[_0xd1e4('0x37')][_0xd1e4('0x49')]?_0x4e00c1[_0xd1e4('0x37')]:_0x39759d[_0xd1e4('0x32')];_0x4e00c1[_0xd1e4('0x3b')]=qs['sort'](_0x245cfa[_0xd1e4('0x33')][_0xd1e4('0x3c')]);_0x4e00c1[_0xd1e4('0x3f')]=qs[_0xd1e4('0x35')](_['pick'](_0x245cfa[_0xd1e4('0x33')],_0x39759d[_0xd1e4('0x35')]));if(_0x245cfa[_0xd1e4('0x33')][_0xd1e4('0x3e')]){_0x4e00c1[_0xd1e4('0x3f')]=_[_0xd1e4('0x42')](_0x4e00c1[_0xd1e4('0x3f')],{'$or':_[_0xd1e4('0x2d')](_0x4e00c1['attributes'],function(_0x48feaa){var _0x462e5={};_0x462e5[_0x48feaa]={'$like':'%'+_0x245cfa[_0xd1e4('0x33')][_0xd1e4('0x3e')]+'%'};return _0x462e5;})});}_0x4e00c1=_[_0xd1e4('0x42')]({},_0x4e00c1,_0x245cfa['options']);return _0x2c42ec[_0xd1e4('0x53')](_0x4e00c1);}})[_0xd1e4('0x25')](function(_0x41006f){if(_0x41006f){_0x4ad053=_0x41006f[_0xd1e4('0x49')];if(!_0x245cfa[_0xd1e4('0x33')]['hasOwnProperty'](_0xd1e4('0x39'))){_0x4e00c1[_0xd1e4('0x3a')]=qs['limit'](_0x245cfa['query'][_0xd1e4('0x3a')]);_0x4e00c1[_0xd1e4('0x20')]=qs['offset'](_0x245cfa['query'][_0xd1e4('0x20')]);}return _0x2c42ec['getSubjects'](_0x4e00c1);}})['then'](function(_0xb33e93){if(_0xb33e93){return _0xb33e93?{'count':_0x4ad053,'rows':_0xb33e93}:null;}})[_0xd1e4('0x25')](respondWithResult(_0x271baa,null))[_0xd1e4('0x45')](handleError(_0x271baa,null));};exports[_0xd1e4('0x54')]=function(_0x5d9754,_0x2b45c1,_0x451d4a){var _0x39fa56={};var _0x37a86c={};var _0x1f1ae1;var _0x16fe40;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5d9754[_0xd1e4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b45c1,null))[_0xd1e4('0x25')](function(_0x529521){if(_0x529521){_0x1f1ae1=_0x529521;_0x37a86c['model']=_[_0xd1e4('0x34')](db[_0xd1e4('0x51')][_0xd1e4('0x2f')]);_0x37a86c[_0xd1e4('0x33')]=_['keys'](_0x5d9754[_0xd1e4('0x33')]);_0x37a86c['filters']=_[_0xd1e4('0x36')](_0x37a86c[_0xd1e4('0x32')],_0x37a86c[_0xd1e4('0x33')]);_0x39fa56[_0xd1e4('0x37')]=_['intersection'](_0x37a86c[_0xd1e4('0x32')],qs['fields'](_0x5d9754['query'][_0xd1e4('0x48')]));_0x39fa56['attributes']=_0x39fa56['attributes'][_0xd1e4('0x49')]?_0x39fa56[_0xd1e4('0x37')]:_0x37a86c[_0xd1e4('0x32')];_0x39fa56['order']=qs[_0xd1e4('0x3c')](_0x5d9754[_0xd1e4('0x33')][_0xd1e4('0x3c')]);_0x39fa56[_0xd1e4('0x3f')]=qs[_0xd1e4('0x35')](_[_0xd1e4('0x3d')](_0x5d9754[_0xd1e4('0x33')],_0x37a86c['filters']));if(_0x5d9754[_0xd1e4('0x33')][_0xd1e4('0x3e')]){_0x39fa56[_0xd1e4('0x3f')]=_[_0xd1e4('0x42')](_0x39fa56[_0xd1e4('0x3f')],{'$or':_['map'](_0x39fa56[_0xd1e4('0x37')],function(_0x43546c){var _0x385ed2={};_0x385ed2[_0x43546c]={'$like':'%'+_0x5d9754[_0xd1e4('0x33')][_0xd1e4('0x3e')]+'%'};return _0x385ed2;})});}_0x39fa56=_[_0xd1e4('0x42')]({},_0x39fa56,_0x5d9754[_0xd1e4('0x52')]);return _0x1f1ae1[_0xd1e4('0x54')](_0x39fa56);}})[_0xd1e4('0x25')](function(_0x133ab3){if(_0x133ab3){_0x16fe40=_0x133ab3['length'];if(!_0x5d9754[_0xd1e4('0x33')]['hasOwnProperty'](_0xd1e4('0x39'))){_0x39fa56[_0xd1e4('0x3a')]=qs[_0xd1e4('0x3a')](_0x5d9754['query']['limit']);_0x39fa56[_0xd1e4('0x20')]=qs[_0xd1e4('0x20')](_0x5d9754[_0xd1e4('0x33')][_0xd1e4('0x20')]);}return _0x1f1ae1[_0xd1e4('0x54')](_0x39fa56);}})[_0xd1e4('0x25')](function(_0x46cf55){if(_0x46cf55){return _0x46cf55?{'count':_0x16fe40,'rows':_0x46cf55}:null;}})[_0xd1e4('0x25')](respondWithResult(_0x2b45c1,null))[_0xd1e4('0x45')](handleError(_0x2b45c1,null));};exports[_0xd1e4('0x55')]=function(_0x17bed7,_0x59669d,_0x29614d){var _0x1cdb35={};var _0x3a7cba={};var _0x5cb11d;var _0x373b59;return db[_0xd1e4('0x2e')][_0xd1e4('0x50')]({'where':{'id':_0x17bed7['params']['id']}})['then'](handleEntityNotFound(_0x59669d,null))[_0xd1e4('0x25')](function(_0x34eea4){if(_0x34eea4){_0x5cb11d=_0x34eea4;_0x3a7cba[_0xd1e4('0x32')]=_[_0xd1e4('0x34')](db[_0xd1e4('0x56')][_0xd1e4('0x2f')]);_0x3a7cba[_0xd1e4('0x33')]=_[_0xd1e4('0x34')](_0x17bed7['query']);_0x3a7cba[_0xd1e4('0x35')]=_[_0xd1e4('0x36')](_0x3a7cba['model'],_0x3a7cba[_0xd1e4('0x33')]);_0x1cdb35[_0xd1e4('0x37')]=_[_0xd1e4('0x36')](_0x3a7cba[_0xd1e4('0x32')],qs['fields'](_0x17bed7[_0xd1e4('0x33')]['fields']));_0x1cdb35['attributes']=_0x1cdb35[_0xd1e4('0x37')][_0xd1e4('0x49')]?_0x1cdb35[_0xd1e4('0x37')]:_0x3a7cba[_0xd1e4('0x32')];_0x1cdb35['order']=qs['sort'](_0x17bed7[_0xd1e4('0x33')][_0xd1e4('0x3c')]);_0x1cdb35[_0xd1e4('0x3f')]=qs['filters'](_[_0xd1e4('0x3d')](_0x17bed7[_0xd1e4('0x33')],_0x3a7cba['filters']));if(_0x17bed7[_0xd1e4('0x33')][_0xd1e4('0x3e')]){_0x1cdb35[_0xd1e4('0x3f')]=_[_0xd1e4('0x42')](_0x1cdb35[_0xd1e4('0x3f')],{'$or':_[_0xd1e4('0x2d')](_0x1cdb35[_0xd1e4('0x37')],function(_0x25b480){var _0x20eae0={};_0x20eae0[_0x25b480]={'$like':'%'+_0x17bed7[_0xd1e4('0x33')][_0xd1e4('0x3e')]+'%'};return _0x20eae0;})});}_0x1cdb35=_[_0xd1e4('0x42')]({},_0x1cdb35,_0x17bed7[_0xd1e4('0x52')]);return _0x5cb11d[_0xd1e4('0x55')](_0x1cdb35);}})[_0xd1e4('0x25')](function(_0x487ed5){if(_0x487ed5){_0x373b59=_0x487ed5[_0xd1e4('0x49')];if(!_0x17bed7[_0xd1e4('0x33')]['hasOwnProperty']('nolimit')){_0x1cdb35['limit']=qs['limit'](_0x17bed7[_0xd1e4('0x33')][_0xd1e4('0x3a')]);_0x1cdb35[_0xd1e4('0x20')]=qs[_0xd1e4('0x20')](_0x17bed7[_0xd1e4('0x33')][_0xd1e4('0x20')]);}return _0x5cb11d[_0xd1e4('0x55')](_0x1cdb35);}})[_0xd1e4('0x25')](function(_0x10933d){if(_0x10933d){return _0x10933d?{'count':_0x373b59,'rows':_0x10933d}:null;}})[_0xd1e4('0x25')](respondWithResult(_0x59669d,null))[_0xd1e4('0x45')](handleError(_0x59669d,null));};exports[_0xd1e4('0x57')]=function(_0x3a5bdd,_0x47dbf9,_0x3e6bf1){if(_0x3a5bdd[_0xd1e4('0x4e')]['id']){delete _0x3a5bdd[_0xd1e4('0x4e')]['id'];}return db[_0xd1e4('0x2e')][_0xd1e4('0x50')]({'where':{'id':_0x3a5bdd[_0xd1e4('0x47')]['id']}})[_0xd1e4('0x25')](handleEntityNotFound(_0x47dbf9,null))[_0xd1e4('0x25')](function(_0x1beb02){if(_0x1beb02){return _0x1beb02[_0xd1e4('0x57')](_0x3a5bdd[_0xd1e4('0x4e')][_0xd1e4('0x58')]||[]);}return null;})[_0xd1e4('0x25')](respondWithResult(_0x47dbf9,null))[_0xd1e4('0x45')](handleError(_0x47dbf9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index dfb9042..47ed404 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 _0x32b6=['moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api'];(function(_0x1ed7fb,_0x1fc87b){var _0x2d4d72=function(_0x457d1a){while(--_0x457d1a){_0x1ed7fb['push'](_0x1ed7fb['shift']());}};_0x2d4d72(++_0x1fc87b);}(_0x32b6,0x1d1));var _0x632b=function(_0x36e95c,_0x56e90e){_0x36e95c=_0x36e95c-0x0;var _0x538026=_0x32b6[_0x36e95c];return _0x538026;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x8ae756,_0x47095c){var _0x5395d1=function(_0x487f75){while(--_0x487f75){_0x8ae756['push'](_0x8ae756['shift']());}};_0x5395d1(++_0x47095c);}(_0x2032,0xd9));var _0x2203=function(_0xf6ace3,_0x501a1c){_0xf6ace3=_0xf6ace3-0x0;var _0xc71875=_0x2032[_0xf6ace3];return _0xc71875;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('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 3783dee..a31b892 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 _0x1527=['catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result'];(function(_0x51a06d,_0x33605d){var _0xb65033=function(_0x12e565){while(--_0x12e565){_0x51a06d['push'](_0x51a06d['shift']());}};_0xb65033(++_0x33605d);}(_0x1527,0x13c));var _0x7152=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x1527[_0x595013];return _0x2a29e3;};'use strict';var _=require('lodash');var util=require(_0x7152('0x0'));var moment=require('moment');var BPromise=require(_0x7152('0x1'));var rs=require(_0x7152('0x2'));var fs=require('fs');var Redis=require(_0x7152('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7152('0x4'))(_0x7152('0x5'));var config=require(_0x7152('0x6'));var jayson=require(_0x7152('0x7'));var client=jayson[_0x7152('0x8')][_0x7152('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17f92f,_0x59d137,_0x21cfc3){return new BPromise(function(_0x41cbb9,_0x274324){return client[_0x7152('0xa')](_0x17f92f,_0x21cfc3)['then'](function(_0x1f3e17){logger[_0x7152('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x59d137,_0x7152('0xc'));logger[_0x7152('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x59d137,_0x7152('0xc'),JSON[_0x7152('0xe')](_0x1f3e17));if(_0x1f3e17[_0x7152('0xf')]){if(_0x1f3e17[_0x7152('0xf')][_0x7152('0x10')]===0x1f4){logger['error'](_0x7152('0x11'),_0x59d137,_0x1f3e17[_0x7152('0xf')][_0x7152('0x12')]);return _0x274324(_0x1f3e17[_0x7152('0xf')][_0x7152('0x12')]);}logger[_0x7152('0xf')](_0x7152('0x11'),_0x59d137,_0x1f3e17[_0x7152('0xf')][_0x7152('0x12')]);return _0x41cbb9(_0x1f3e17[_0x7152('0xf')][_0x7152('0x12')]);}else{logger['info'](_0x7152('0x11'),_0x59d137,_0x7152('0xc'));_0x41cbb9(_0x1f3e17[_0x7152('0x13')][_0x7152('0x12')]);}})[_0x7152('0x14')](function(_0x1874c6){logger[_0x7152('0xf')](_0x7152('0x11'),_0x59d137,_0x1874c6);_0x274324(_0x1874c6);});});} \ No newline at end of file +var _0xb97a=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb97a,0xb0));var _0xab97=function(_0x49f62f,_0x5c3835){_0x49f62f=_0x49f62f-0x0;var _0x510dc5=_0xb97a[_0x49f62f];return _0x510dc5;};'use strict';var _=require(_0xab97('0x0'));var util=require('util');var moment=require(_0xab97('0x1'));var BPromise=require(_0xab97('0x2'));var rs=require(_0xab97('0x3'));var fs=require('fs');var Redis=require(_0xab97('0x4'));var db=require(_0xab97('0x5'))['db'];var utils=require(_0xab97('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab97('0x7'));var jayson=require(_0xab97('0x8'));var client=jayson[_0xab97('0x9')][_0xab97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcf6b8b,_0x49d462,_0x4fab80){return new BPromise(function(_0x13da59,_0x4714c9){return client[_0xab97('0xb')](_0xcf6b8b,_0x4fab80)[_0xab97('0xc')](function(_0x4701c6){logger[_0xab97('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x49d462,'request\x20sent');logger['debug'](_0xab97('0xe'),_0x49d462,_0xab97('0xf'),JSON['stringify'](_0x4701c6));if(_0x4701c6[_0xab97('0x10')]){if(_0x4701c6[_0xab97('0x10')][_0xab97('0x11')]===0x1f4){logger[_0xab97('0x10')](_0xab97('0x12'),_0x49d462,_0x4701c6[_0xab97('0x10')][_0xab97('0x13')]);return _0x4714c9(_0x4701c6['error'][_0xab97('0x13')]);}logger[_0xab97('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x49d462,_0x4701c6['error'][_0xab97('0x13')]);return _0x13da59(_0x4701c6[_0xab97('0x10')]['message']);}else{logger[_0xab97('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x49d462,_0xab97('0xf'));_0x13da59(_0x4701c6[_0xab97('0x14')][_0xab97('0x13')]);}})[_0xab97('0x15')](function(_0x1c0fec){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x49d462,_0x1c0fec);_0x4714c9(_0x1c0fec);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2f3baf2..d289549 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 _0x1f3f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1f3f,0x18f));var _0xf1f3=function(_0x5b6bab,_0x3aecd4){_0x5b6bab=_0x5b6bab-0x0;var _0x26cbee=_0x1f3f[_0x5b6bab];return _0x26cbee;};'use strict';var multer=require(_0xf1f3('0x0'));var util=require(_0xf1f3('0x1'));var path=require(_0xf1f3('0x2'));var timeout=require(_0xf1f3('0x3'));var express=require('express');var router=express[_0xf1f3('0x4')]();var fs_extra=require(_0xf1f3('0x5'));var auth=require(_0xf1f3('0x6'));var interaction=require(_0xf1f3('0x7'));var config=require('../../config/environment');var controller=require(_0xf1f3('0x8'));router['get']('/',auth[_0xf1f3('0x9')](),controller[_0xf1f3('0xa')]);router[_0xf1f3('0xb')]('/:id',auth[_0xf1f3('0x9')](),controller[_0xf1f3('0xc')]);router[_0xf1f3('0xd')]('/',auth[_0xf1f3('0x9')](),controller['create']);router[_0xf1f3('0xe')](_0xf1f3('0xf'),auth['isAuthenticated'](),controller[_0xf1f3('0x10')]);router[_0xf1f3('0x11')](_0xf1f3('0xf'),auth[_0xf1f3('0x9')](),controller[_0xf1f3('0x12')]);module['exports']=router; \ No newline at end of file +var _0xeb87=['index','/:id','post','isAuthenticated','create','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x3a9635,_0x1ab817){var _0x10d08c=function(_0x222242){while(--_0x222242){_0x3a9635['push'](_0x3a9635['shift']());}};_0x10d08c(++_0x1ab817);}(_0xeb87,0x138));var _0x7eb8=function(_0x4db25f,_0xbeefa){_0x4db25f=_0x4db25f-0x0;var _0x51597b=_0xeb87[_0x4db25f];return _0x51597b;};'use strict';var multer=require(_0x7eb8('0x0'));var util=require(_0x7eb8('0x1'));var path=require('path');var timeout=require(_0x7eb8('0x2'));var express=require(_0x7eb8('0x3'));var router=express[_0x7eb8('0x4')]();var fs_extra=require(_0x7eb8('0x5'));var auth=require(_0x7eb8('0x6'));var interaction=require(_0x7eb8('0x7'));var config=require(_0x7eb8('0x8'));var controller=require(_0x7eb8('0x9'));router[_0x7eb8('0xa')]('/',auth['isAuthenticated'](),controller[_0x7eb8('0xb')]);router['get'](_0x7eb8('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7eb8('0xd')]('/',auth[_0x7eb8('0xe')](),controller[_0x7eb8('0xf')]);router[_0x7eb8('0x10')](_0x7eb8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7eb8('0x11')](_0x7eb8('0xc'),auth[_0x7eb8('0xe')](),controller[_0x7eb8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e1f4946..85fe122 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 _0x3d5f=['keyValue','picklist','string','variable','STRING','sequelize','exports','ENUM','customVariable'];(function(_0x20c621,_0x2cda3b){var _0x348551=function(_0x314cf5){while(--_0x314cf5){_0x20c621['push'](_0x20c621['shift']());}};_0x348551(++_0x2cda3b);}(_0x3d5f,0xb0));var _0xf3d5=function(_0x1aaf60,_0xc96db5){_0x1aaf60=_0x1aaf60-0x0;var _0x1d6640=_0x3d5f[_0x1aaf60];return _0x1d6640;};'use strict';var Sequelize=require(_0xf3d5('0x0'));module[_0xf3d5('0x1')]={'type':{'type':Sequelize[_0xf3d5('0x2')]('string','variable',_0xf3d5('0x3'),_0xf3d5('0x4'),_0xf3d5('0x5')),'defaultValue':_0xf3d5('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf3d5('0x2')](_0xf3d5('0x6'),_0xf3d5('0x7'),_0xf3d5('0x3'))},'keyContent':{'type':Sequelize[_0xf3d5('0x8')]},'idField':{'type':Sequelize[_0xf3d5('0x8')]},'nameField':{'type':Sequelize[_0xf3d5('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf3d5('0x8')]}}; \ No newline at end of file +var _0x6c91=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1be95b,_0x33f203){var _0x49c3a5=function(_0x3ec5ad){while(--_0x3ec5ad){_0x1be95b['push'](_0x1be95b['shift']());}};_0x49c3a5(++_0x33f203);}(_0x6c91,0x12d));var _0x16c9=function(_0x1dd66c,_0xa8924b){_0x1dd66c=_0x1dd66c-0x0;var _0xde330e=_0x6c91[_0x1dd66c];return _0xde330e;};'use strict';var Sequelize=require(_0x16c9('0x0'));module[_0x16c9('0x1')]={'type':{'type':Sequelize[_0x16c9('0x2')](_0x16c9('0x3'),_0x16c9('0x4'),_0x16c9('0x5'),_0x16c9('0x6'),_0x16c9('0x7')),'defaultValue':_0x16c9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x16c9('0x8')]},'keyType':{'type':Sequelize[_0x16c9('0x2')](_0x16c9('0x3'),'variable',_0x16c9('0x5'))},'keyContent':{'type':Sequelize[_0x16c9('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x16c9('0x8')]},'customField':{'type':Sequelize[_0x16c9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8513df0..64ca778 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 _0x2f8c=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','zip-dir','fast-json-patch','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'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x2f8c,0x117));var _0xc2f8=function(_0x4a6bb4,_0x217df6){_0x4a6bb4=_0x4a6bb4-0x0;var _0x2d3e08=_0x2f8c[_0x4a6bb4];return _0x2d3e08;};'use strict';var emlformat=require(_0xc2f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2f8('0x1'));var jsonpatch=require(_0xc2f8('0x2'));var rp=require('request-promise');var moment=require(_0xc2f8('0x3'));var BPromise=require(_0xc2f8('0x4'));var Mustache=require(_0xc2f8('0x5'));var util=require(_0xc2f8('0x6'));var path=require(_0xc2f8('0x7'));var sox=require('sox');var csv=require(_0xc2f8('0x8'));var ejs=require(_0xc2f8('0x9'));var fs=require('fs');var fs_extra=require(_0xc2f8('0xa'));var _=require('lodash');var squel=require(_0xc2f8('0xb'));var crypto=require(_0xc2f8('0xc'));var jsforce=require(_0xc2f8('0xd'));var deskjs=require(_0xc2f8('0xe'));var toCsv=require(_0xc2f8('0x8'));var querystring=require(_0xc2f8('0xf'));var Papa=require(_0xc2f8('0x10'));var Redis=require(_0xc2f8('0x11'));var authService=require(_0xc2f8('0x12'));var qs=require(_0xc2f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2f8('0x14'));var logger=require(_0xc2f8('0x15'))(_0xc2f8('0x16'));var utils=require(_0xc2f8('0x17'));var config=require(_0xc2f8('0x18'));var licenseUtil=require(_0xc2f8('0x19'));var db=require(_0xc2f8('0x1a'))['db'];function respondWithStatusCode(_0x2277d4,_0x2b835a){_0x2b835a=_0x2b835a||0xcc;return function(_0x2ec42b){if(_0x2ec42b){return _0x2277d4['sendStatus'](_0x2b835a);}return _0x2277d4[_0xc2f8('0x1b')](_0x2b835a)[_0xc2f8('0x1c')]();};}function respondWithResult(_0xba0437,_0x5eb45e){_0x5eb45e=_0x5eb45e||0xc8;return function(_0x330ee1){if(_0x330ee1){return _0xba0437[_0xc2f8('0x1b')](_0x5eb45e)[_0xc2f8('0x1d')](_0x330ee1);}};}function respondWithFilteredResult(_0xf0241d,_0x58f74b){return function(_0x22891d){if(_0x22891d){var _0x3a884a=typeof _0x58f74b[_0xc2f8('0x1e')]===_0xc2f8('0x1f')&&typeof _0x58f74b['limit']===_0xc2f8('0x1f');var _0x495a97=_0x22891d[_0xc2f8('0x20')];var _0x1f27c6=_0x3a884a?0x0:_0x58f74b[_0xc2f8('0x1e')];var _0x4026b2=_0x3a884a?_0x22891d['count']:_0x58f74b[_0xc2f8('0x1e')]+_0x58f74b[_0xc2f8('0x21')];var _0x4202eb;if(_0x4026b2>=_0x495a97){_0x4026b2=_0x495a97;_0x4202eb=0xc8;}else{_0x4202eb=0xce;}_0xf0241d[_0xc2f8('0x1b')](_0x4202eb);return _0xf0241d['set'](_0xc2f8('0x22'),_0x1f27c6+'-'+_0x4026b2+'/'+_0x495a97)['json'](_0x22891d);}return null;};}function patchUpdates(_0x1e5fdd){return function(_0x588383){try{jsonpatch[_0xc2f8('0x23')](_0x588383,_0x1e5fdd,!![]);}catch(_0x5b941b){return BPromise[_0xc2f8('0x24')](_0x5b941b);}return _0x588383['save']();};}function saveUpdates(_0x10aa9e,_0x44f483){return function(_0x2239a0){if(_0x2239a0){return _0x2239a0[_0xc2f8('0x25')](_0x10aa9e)[_0xc2f8('0x26')](function(_0x334fa0){return _0x334fa0;});}return null;};}function removeEntity(_0x301482,_0x222426){return function(_0x3e36f5){if(_0x3e36f5){return _0x3e36f5['destroy']()[_0xc2f8('0x26')](function(){_0x301482[_0xc2f8('0x1b')](0xcc)[_0xc2f8('0x1c')]();});}};}function handleEntityNotFound(_0x2adabf,_0x1757f9){return function(_0x2e6a93){if(!_0x2e6a93){_0x2adabf[_0xc2f8('0x27')](0x194);}return _0x2e6a93;};}function handleError(_0x12958d,_0x1c3e33){_0x1c3e33=_0x1c3e33||0x1f4;return function(_0x8a1e9a){logger[_0xc2f8('0x28')](_0x8a1e9a[_0xc2f8('0x29')]);if(_0x8a1e9a[_0xc2f8('0x2a')]){delete _0x8a1e9a[_0xc2f8('0x2a')];}_0x12958d['status'](_0x1c3e33)[_0xc2f8('0x2b')](_0x8a1e9a);};}exports[_0xc2f8('0x2c')]=function(_0x30e148,_0xf021e8){var _0xedb5e7={},_0x13b7dd={},_0x25dff9={'count':0x0,'rows':[]};var _0x2817fc=_[_0xc2f8('0x2d')](db[_0xc2f8('0x2e')]['rawAttributes'],function(_0x35ae20){return{'name':_0x35ae20[_0xc2f8('0x2f')],'type':_0x35ae20[_0xc2f8('0x30')]['key']};});_0x13b7dd[_0xc2f8('0x31')]=_['map'](_0x2817fc,_0xc2f8('0x2a'));_0x13b7dd[_0xc2f8('0x32')]=_[_0xc2f8('0x33')](_0x30e148['query']);_0x13b7dd[_0xc2f8('0x34')]=_[_0xc2f8('0x35')](_0x13b7dd['model'],_0x13b7dd[_0xc2f8('0x32')]);_0xedb5e7[_0xc2f8('0x36')]=_[_0xc2f8('0x35')](_0x13b7dd[_0xc2f8('0x31')],qs[_0xc2f8('0x37')](_0x30e148['query'][_0xc2f8('0x37')]));_0xedb5e7[_0xc2f8('0x36')]=_0xedb5e7[_0xc2f8('0x36')][_0xc2f8('0x38')]?_0xedb5e7[_0xc2f8('0x36')]:_0x13b7dd[_0xc2f8('0x31')];if(!_0x30e148[_0xc2f8('0x32')][_0xc2f8('0x39')]('nolimit')){_0xedb5e7[_0xc2f8('0x21')]=qs[_0xc2f8('0x21')](_0x30e148['query'][_0xc2f8('0x21')]);_0xedb5e7[_0xc2f8('0x1e')]=qs[_0xc2f8('0x1e')](_0x30e148['query'][_0xc2f8('0x1e')]);}_0xedb5e7[_0xc2f8('0x3a')]=qs['sort'](_0x30e148[_0xc2f8('0x32')][_0xc2f8('0x3b')]);_0xedb5e7['where']=qs[_0xc2f8('0x34')](_[_0xc2f8('0x3c')](_0x30e148['query'],_0x13b7dd['filters']),_0x2817fc);if(_0x30e148[_0xc2f8('0x32')][_0xc2f8('0x3d')]){_0xedb5e7[_0xc2f8('0x3e')]=_[_0xc2f8('0x3f')](_0xedb5e7[_0xc2f8('0x3e')],{'$or':_[_0xc2f8('0x2d')](_0x2817fc,function(_0x5c4864){if(_0x5c4864[_0xc2f8('0x30')]!=='VIRTUAL'){var _0x443299={};_0x443299[_0x5c4864[_0xc2f8('0x2a')]]={'$like':'%'+_0x30e148[_0xc2f8('0x32')][_0xc2f8('0x3d')]+'%'};return _0x443299;}})});}_0xedb5e7=_[_0xc2f8('0x3f')]({},_0xedb5e7,_0x30e148[_0xc2f8('0x40')]);var _0x4def7d={'where':_0xedb5e7[_0xc2f8('0x3e')]};return db[_0xc2f8('0x2e')]['count'](_0x4def7d)[_0xc2f8('0x26')](function(_0x1bbe4f){_0x25dff9[_0xc2f8('0x20')]=_0x1bbe4f;if(_0x30e148[_0xc2f8('0x32')]['includeAll']){_0xedb5e7[_0xc2f8('0x41')]=[{'all':!![]}];}return db[_0xc2f8('0x2e')][_0xc2f8('0x42')](_0xedb5e7);})['then'](function(_0x399c80){_0x25dff9[_0xc2f8('0x43')]=_0x399c80;return _0x25dff9;})[_0xc2f8('0x26')](respondWithFilteredResult(_0xf021e8,_0xedb5e7))['catch'](handleError(_0xf021e8,null));};exports[_0xc2f8('0x44')]=function(_0x100f15,_0x698d09){var _0x114bde={'raw':!![],'where':{'id':_0x100f15[_0xc2f8('0x45')]['id']}},_0x49c962={};_0x49c962[_0xc2f8('0x31')]=_['keys'](db[_0xc2f8('0x2e')][_0xc2f8('0x46')]);_0x49c962['query']=_[_0xc2f8('0x33')](_0x100f15['query']);_0x49c962[_0xc2f8('0x34')]=_[_0xc2f8('0x35')](_0x49c962[_0xc2f8('0x31')],_0x49c962[_0xc2f8('0x32')]);_0x114bde[_0xc2f8('0x36')]=_[_0xc2f8('0x35')](_0x49c962[_0xc2f8('0x31')],qs['fields'](_0x100f15[_0xc2f8('0x32')][_0xc2f8('0x37')]));_0x114bde[_0xc2f8('0x36')]=_0x114bde[_0xc2f8('0x36')]['length']?_0x114bde[_0xc2f8('0x36')]:_0x49c962[_0xc2f8('0x31')];if(_0x100f15[_0xc2f8('0x32')]['includeAll']){_0x114bde[_0xc2f8('0x41')]=[{'all':!![]}];}_0x114bde=_[_0xc2f8('0x3f')]({},_0x114bde,_0x100f15[_0xc2f8('0x40')]);return db[_0xc2f8('0x2e')][_0xc2f8('0x47')](_0x114bde)['then'](handleEntityNotFound(_0x698d09,null))[_0xc2f8('0x26')](respondWithResult(_0x698d09,null))[_0xc2f8('0x48')](handleError(_0x698d09,null));};exports['create']=function(_0x185bfb,_0x410770){return db['ZendeskField'][_0xc2f8('0x49')](_0x185bfb[_0xc2f8('0x4a')],{})['then'](respondWithResult(_0x410770,0xc9))['catch'](handleError(_0x410770,null));};exports[_0xc2f8('0x25')]=function(_0xf7cff4,_0xd45655){if(_0xf7cff4[_0xc2f8('0x4a')]['id']){delete _0xf7cff4['body']['id'];}return db[_0xc2f8('0x2e')][_0xc2f8('0x47')]({'where':{'id':_0xf7cff4['params']['id']}})[_0xc2f8('0x26')](handleEntityNotFound(_0xd45655,null))[_0xc2f8('0x26')](saveUpdates(_0xf7cff4[_0xc2f8('0x4a')],null))[_0xc2f8('0x26')](respondWithResult(_0xd45655,null))[_0xc2f8('0x48')](handleError(_0xd45655,null));};exports['destroy']=function(_0x1b398f,_0x4bcfdf){return db['ZendeskField'][_0xc2f8('0x47')]({'where':{'id':_0x1b398f[_0xc2f8('0x45')]['id']}})[_0xc2f8('0x26')](handleEntityNotFound(_0x4bcfdf,null))[_0xc2f8('0x26')](removeEntity(_0x4bcfdf,null))[_0xc2f8('0x48')](handleError(_0x4bcfdf,null));}; \ No newline at end of file +var _0xf165=['create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','send','map','ZendeskField','rawAttributes','fieldName','type','key','name','keys','filters','intersection','model','attributes','fields','query','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf165,0x11e));var _0x5f16=function(_0x392b8e,_0x3c2591){_0x392b8e=_0x392b8e-0x0;var _0x2b31b8=_0xf165[_0x392b8e];return _0x2b31b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f16('0x0'));var jsonpatch=require(_0x5f16('0x1'));var rp=require(_0x5f16('0x2'));var moment=require(_0x5f16('0x3'));var BPromise=require(_0x5f16('0x4'));var Mustache=require('mustache');var util=require(_0x5f16('0x5'));var path=require('path');var sox=require(_0x5f16('0x6'));var csv=require(_0x5f16('0x7'));var ejs=require(_0x5f16('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f16('0x9'));var squel=require(_0x5f16('0xa'));var crypto=require(_0x5f16('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5f16('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5f16('0xd'));var Papa=require(_0x5f16('0xe'));var Redis=require(_0x5f16('0xf'));var authService=require(_0x5f16('0x10'));var qs=require(_0x5f16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f16('0x12'));var logger=require(_0x5f16('0x13'))(_0x5f16('0x14'));var utils=require(_0x5f16('0x15'));var config=require(_0x5f16('0x16'));var licenseUtil=require(_0x5f16('0x17'));var db=require(_0x5f16('0x18'))['db'];function respondWithStatusCode(_0x1b6052,_0x3f2819){_0x3f2819=_0x3f2819||0xcc;return function(_0x5558e9){if(_0x5558e9){return _0x1b6052['sendStatus'](_0x3f2819);}return _0x1b6052[_0x5f16('0x19')](_0x3f2819)[_0x5f16('0x1a')]();};}function respondWithResult(_0x1dae99,_0x4e399d){_0x4e399d=_0x4e399d||0xc8;return function(_0xfce46e){if(_0xfce46e){return _0x1dae99['status'](_0x4e399d)[_0x5f16('0x1b')](_0xfce46e);}};}function respondWithFilteredResult(_0x301466,_0x2e1692){return function(_0x27a937){if(_0x27a937){var _0x3939f8=typeof _0x2e1692[_0x5f16('0x1c')]===_0x5f16('0x1d')&&typeof _0x2e1692[_0x5f16('0x1e')]==='undefined';var _0x3c466f=_0x27a937[_0x5f16('0x1f')];var _0x46d029=_0x3939f8?0x0:_0x2e1692[_0x5f16('0x1c')];var _0x1f2669=_0x3939f8?_0x27a937['count']:_0x2e1692[_0x5f16('0x1c')]+_0x2e1692[_0x5f16('0x1e')];var _0x2935f9;if(_0x1f2669>=_0x3c466f){_0x1f2669=_0x3c466f;_0x2935f9=0xc8;}else{_0x2935f9=0xce;}_0x301466[_0x5f16('0x19')](_0x2935f9);return _0x301466[_0x5f16('0x20')]('Content-Range',_0x46d029+'-'+_0x1f2669+'/'+_0x3c466f)[_0x5f16('0x1b')](_0x27a937);}return null;};}function patchUpdates(_0x2745b3){return function(_0x347905){try{jsonpatch['apply'](_0x347905,_0x2745b3,!![]);}catch(_0x9b8053){return BPromise[_0x5f16('0x21')](_0x9b8053);}return _0x347905['save']();};}function saveUpdates(_0x77efad,_0x21c04c){return function(_0x49f91a){if(_0x49f91a){return _0x49f91a[_0x5f16('0x22')](_0x77efad)[_0x5f16('0x23')](function(_0xe5a540){return _0xe5a540;});}return null;};}function removeEntity(_0x3c81b0,_0x20d2e0){return function(_0x240220){if(_0x240220){return _0x240220[_0x5f16('0x24')]()['then'](function(){_0x3c81b0[_0x5f16('0x19')](0xcc)[_0x5f16('0x1a')]();});}};}function handleEntityNotFound(_0x2dbc26,_0x50f517){return function(_0x2c866b){if(!_0x2c866b){_0x2dbc26['sendStatus'](0x194);}return _0x2c866b;};}function handleError(_0xeb0784,_0x533a46){_0x533a46=_0x533a46||0x1f4;return function(_0x565f7b){logger[_0x5f16('0x25')](_0x565f7b['stack']);if(_0x565f7b['name']){delete _0x565f7b['name'];}_0xeb0784[_0x5f16('0x19')](_0x533a46)[_0x5f16('0x26')](_0x565f7b);};}exports['index']=function(_0x5a59e1,_0x5bca79){var _0x5082a4={},_0x2e47cb={},_0x431597={'count':0x0,'rows':[]};var _0x50a88a=_[_0x5f16('0x27')](db[_0x5f16('0x28')][_0x5f16('0x29')],function(_0x25219b){return{'name':_0x25219b[_0x5f16('0x2a')],'type':_0x25219b[_0x5f16('0x2b')][_0x5f16('0x2c')]};});_0x2e47cb['model']=_['map'](_0x50a88a,_0x5f16('0x2d'));_0x2e47cb['query']=_[_0x5f16('0x2e')](_0x5a59e1['query']);_0x2e47cb[_0x5f16('0x2f')]=_[_0x5f16('0x30')](_0x2e47cb[_0x5f16('0x31')],_0x2e47cb['query']);_0x5082a4[_0x5f16('0x32')]=_['intersection'](_0x2e47cb[_0x5f16('0x31')],qs[_0x5f16('0x33')](_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x33')]));_0x5082a4[_0x5f16('0x32')]=_0x5082a4[_0x5f16('0x32')][_0x5f16('0x35')]?_0x5082a4[_0x5f16('0x32')]:_0x2e47cb[_0x5f16('0x31')];if(!_0x5a59e1[_0x5f16('0x34')]['hasOwnProperty']('nolimit')){_0x5082a4[_0x5f16('0x1e')]=qs[_0x5f16('0x1e')](_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x1e')]);_0x5082a4[_0x5f16('0x1c')]=qs[_0x5f16('0x1c')](_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x1c')]);}_0x5082a4['order']=qs[_0x5f16('0x36')](_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x36')]);_0x5082a4[_0x5f16('0x37')]=qs[_0x5f16('0x2f')](_[_0x5f16('0x38')](_0x5a59e1[_0x5f16('0x34')],_0x2e47cb[_0x5f16('0x2f')]),_0x50a88a);if(_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x39')]){_0x5082a4['where']=_[_0x5f16('0x3a')](_0x5082a4[_0x5f16('0x37')],{'$or':_[_0x5f16('0x27')](_0x50a88a,function(_0x31ec14){if(_0x31ec14['type']!==_0x5f16('0x3b')){var _0x1a9787={};_0x1a9787[_0x31ec14['name']]={'$like':'%'+_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x39')]+'%'};return _0x1a9787;}})});}_0x5082a4=_[_0x5f16('0x3a')]({},_0x5082a4,_0x5a59e1[_0x5f16('0x3c')]);var _0x5c7717={'where':_0x5082a4['where']};return db[_0x5f16('0x28')][_0x5f16('0x1f')](_0x5c7717)[_0x5f16('0x23')](function(_0x3b1491){_0x431597[_0x5f16('0x1f')]=_0x3b1491;if(_0x5a59e1[_0x5f16('0x34')][_0x5f16('0x3d')]){_0x5082a4[_0x5f16('0x3e')]=[{'all':!![]}];}return db[_0x5f16('0x28')][_0x5f16('0x3f')](_0x5082a4);})['then'](function(_0x494ffa){_0x431597[_0x5f16('0x40')]=_0x494ffa;return _0x431597;})[_0x5f16('0x23')](respondWithFilteredResult(_0x5bca79,_0x5082a4))[_0x5f16('0x41')](handleError(_0x5bca79,null));};exports[_0x5f16('0x42')]=function(_0x22b792,_0x357e2d){var _0x13f415={'raw':!![],'where':{'id':_0x22b792[_0x5f16('0x43')]['id']}},_0x22be5a={};_0x22be5a[_0x5f16('0x31')]=_[_0x5f16('0x2e')](db['ZendeskField']['rawAttributes']);_0x22be5a['query']=_[_0x5f16('0x2e')](_0x22b792[_0x5f16('0x34')]);_0x22be5a[_0x5f16('0x2f')]=_[_0x5f16('0x30')](_0x22be5a[_0x5f16('0x31')],_0x22be5a['query']);_0x13f415[_0x5f16('0x32')]=_['intersection'](_0x22be5a[_0x5f16('0x31')],qs[_0x5f16('0x33')](_0x22b792['query'][_0x5f16('0x33')]));_0x13f415[_0x5f16('0x32')]=_0x13f415[_0x5f16('0x32')][_0x5f16('0x35')]?_0x13f415['attributes']:_0x22be5a[_0x5f16('0x31')];if(_0x22b792[_0x5f16('0x34')][_0x5f16('0x3d')]){_0x13f415[_0x5f16('0x3e')]=[{'all':!![]}];}_0x13f415=_[_0x5f16('0x3a')]({},_0x13f415,_0x22b792[_0x5f16('0x3c')]);return db[_0x5f16('0x28')][_0x5f16('0x44')](_0x13f415)[_0x5f16('0x23')](handleEntityNotFound(_0x357e2d,null))[_0x5f16('0x23')](respondWithResult(_0x357e2d,null))[_0x5f16('0x41')](handleError(_0x357e2d,null));};exports['create']=function(_0x48cffa,_0x27c62a){return db[_0x5f16('0x28')][_0x5f16('0x45')](_0x48cffa[_0x5f16('0x46')],{})[_0x5f16('0x23')](respondWithResult(_0x27c62a,0xc9))[_0x5f16('0x41')](handleError(_0x27c62a,null));};exports[_0x5f16('0x22')]=function(_0x222461,_0x3887e5){if(_0x222461[_0x5f16('0x46')]['id']){delete _0x222461['body']['id'];}return db['ZendeskField'][_0x5f16('0x44')]({'where':{'id':_0x222461[_0x5f16('0x43')]['id']}})['then'](handleEntityNotFound(_0x3887e5,null))['then'](saveUpdates(_0x222461['body'],null))['then'](respondWithResult(_0x3887e5,null))[_0x5f16('0x41')](handleError(_0x3887e5,null));};exports[_0x5f16('0x24')]=function(_0x3fb059,_0x1b9b25){return db[_0x5f16('0x28')][_0x5f16('0x44')]({'where':{'id':_0x3fb059[_0x5f16('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b9b25,null))[_0x5f16('0x23')](removeEntity(_0x1b9b25,null))[_0x5f16('0x41')](handleError(_0x1b9b25,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index b59dd2e..c4a85f9 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 _0x83d8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','zendesk_unique_index','lodash','util','../../config/logger'];(function(_0x91e93c,_0x12ec5b){var _0x3e62d7=function(_0x40304e){while(--_0x40304e){_0x91e93c['push'](_0x91e93c['shift']());}};_0x3e62d7(++_0x12ec5b);}(_0x83d8,0x128));var _0x883d=function(_0x51902f,_0x75d61e){_0x51902f=_0x51902f-0x0;var _0x211ce0=_0x83d8[_0x51902f];return _0x211ce0;};'use strict';var _=require(_0x883d('0x0'));var util=require(_0x883d('0x1'));var logger=require(_0x883d('0x2'))(_0x883d('0x3'));var moment=require(_0x883d('0x4'));var BPromise=require(_0x883d('0x5'));var rp=require(_0x883d('0x6'));var fs=require('fs');var path=require(_0x883d('0x7'));var rimraf=require(_0x883d('0x8'));var config=require(_0x883d('0x9'));var attributes=require(_0x883d('0xa'));module['exports']=function(_0x231498,_0x2fc677){return _0x231498[_0x883d('0xb')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x883d('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae2=['lodash','util','../../config/logger','api','moment','path','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6ae2,0x111));var _0x26ae=function(_0x2f2377,_0x11cc21){_0x2f2377=_0x2f2377-0x0;var _0x441e6b=_0x6ae2[_0x2f2377];return _0x441e6b;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x26ae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26ae('0x6'));module['exports']=function(_0x2592ab,_0x5a9049){return _0x2592ab[_0x26ae('0x7')](_0x26ae('0x8'),attributes,{'tableName':_0x26ae('0x9'),'paranoid':![],'indexes':[{'name':_0x26ae('0xa'),'fields':[_0x26ae('0xb'),_0x26ae('0xc')],'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 df14b42..49168a9 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 _0x9a9f=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9a9f,0x9a));var _0xf9a9=function(_0x5d83c0,_0x3ee096){_0x5d83c0=_0x5d83c0-0x0;var _0x4c4364=_0x9a9f[_0x5d83c0];return _0x4c4364;};'use strict';var _=require('lodash');var util=require(_0xf9a9('0x0'));var moment=require('moment');var BPromise=require(_0xf9a9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9a9('0x2'));var db=require(_0xf9a9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9a9('0x4'))(_0xf9a9('0x5'));var config=require(_0xf9a9('0x6'));var jayson=require(_0xf9a9('0x7'));var client=jayson[_0xf9a9('0x8')][_0xf9a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22c32d,_0x1fa6ec,_0x97e794){return new BPromise(function(_0x2a180a,_0x121ce5){return client[_0xf9a9('0xa')](_0x22c32d,_0x97e794)[_0xf9a9('0xb')](function(_0x4c77ee){logger[_0xf9a9('0xc')](_0xf9a9('0xd'),_0x1fa6ec,_0xf9a9('0xe'));logger[_0xf9a9('0xf')](_0xf9a9('0x10'),_0x1fa6ec,_0xf9a9('0xe'),JSON['stringify'](_0x4c77ee));if(_0x4c77ee[_0xf9a9('0x11')]){if(_0x4c77ee[_0xf9a9('0x11')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1fa6ec,_0x4c77ee[_0xf9a9('0x11')][_0xf9a9('0x12')]);return _0x121ce5(_0x4c77ee[_0xf9a9('0x11')][_0xf9a9('0x12')]);}logger['error'](_0xf9a9('0xd'),_0x1fa6ec,_0x4c77ee[_0xf9a9('0x11')][_0xf9a9('0x12')]);return _0x2a180a(_0x4c77ee['error'][_0xf9a9('0x12')]);}else{logger[_0xf9a9('0xc')](_0xf9a9('0xd'),_0x1fa6ec,_0xf9a9('0xe'));_0x2a180a(_0x4c77ee[_0xf9a9('0x13')]['message']);}})[_0xf9a9('0x14')](function(_0x53535e){logger['error'](_0xf9a9('0xd'),_0x1fa6ec,_0x53535e);_0x121ce5(_0x53535e);});});} \ No newline at end of file +var _0x2d41=['../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5c4835,_0x1b5e0d){var _0x2a1bf9=function(_0x439544){while(--_0x439544){_0x5c4835['push'](_0x5c4835['shift']());}};_0x2a1bf9(++_0x1b5e0d);}(_0x2d41,0xa5));var _0x12d4=function(_0x58507e,_0x1fa156){_0x58507e=_0x58507e-0x0;var _0x315a1e=_0x2d41[_0x58507e];return _0x315a1e;};'use strict';var _=require(_0x12d4('0x0'));var util=require(_0x12d4('0x1'));var moment=require(_0x12d4('0x2'));var BPromise=require(_0x12d4('0x3'));var rs=require(_0x12d4('0x4'));var fs=require('fs');var Redis=require(_0x12d4('0x5'));var db=require(_0x12d4('0x6'))['db'];var utils=require(_0x12d4('0x7'));var logger=require(_0x12d4('0x8'))(_0x12d4('0x9'));var config=require(_0x12d4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x12d4('0xb')][_0x12d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52b5ac,_0x5565e0,_0x394aa8){return new BPromise(function(_0x7e32ef,_0x3533f5){return client[_0x12d4('0xd')](_0x52b5ac,_0x394aa8)[_0x12d4('0xe')](function(_0xaa28dd){logger[_0x12d4('0xf')](_0x12d4('0x10'),_0x5565e0,_0x12d4('0x11'));logger[_0x12d4('0x12')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5565e0,'request\x20sent',JSON[_0x12d4('0x13')](_0xaa28dd));if(_0xaa28dd[_0x12d4('0x14')]){if(_0xaa28dd[_0x12d4('0x14')][_0x12d4('0x15')]===0x1f4){logger[_0x12d4('0x14')](_0x12d4('0x10'),_0x5565e0,_0xaa28dd[_0x12d4('0x14')]['message']);return _0x3533f5(_0xaa28dd['error'][_0x12d4('0x16')]);}logger[_0x12d4('0x14')](_0x12d4('0x10'),_0x5565e0,_0xaa28dd[_0x12d4('0x14')]['message']);return _0x7e32ef(_0xaa28dd[_0x12d4('0x14')][_0x12d4('0x16')]);}else{logger[_0x12d4('0xf')](_0x12d4('0x10'),_0x5565e0,'request\x20sent');_0x7e32ef(_0xaa28dd[_0x12d4('0x17')]['message']);}})[_0x12d4('0x18')](function(_0x1a82f5){logger[_0x12d4('0x14')](_0x12d4('0x10'),_0x5565e0,_0x1a82f5);_0x3533f5(_0x1a82f5);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 18a4c03..b4d7352 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 _0xaacb=['/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x3d3c6f,_0xc1c0e8){var _0x482719=function(_0x4fe94f){while(--_0x4fe94f){_0x3d3c6f['push'](_0x3d3c6f['shift']());}};_0x482719(++_0xc1c0e8);}(_0xaacb,0x1b2));var _0xbaac=function(_0x5f1699,_0x13be45){_0x5f1699=_0x5f1699-0x0;var _0x62c71f=_0xaacb[_0x5f1699];return _0x62c71f;};'use strict';var multer=require(_0xbaac('0x0'));var util=require(_0xbaac('0x1'));var path=require(_0xbaac('0x2'));var timeout=require(_0xbaac('0x3'));var express=require(_0xbaac('0x4'));var router=express['Router']();var fs_extra=require(_0xbaac('0x5'));var auth=require(_0xbaac('0x6'));var interaction=require(_0xbaac('0x7'));var config=require(_0xbaac('0x8'));var controller=require(_0xbaac('0x9'));router[_0xbaac('0xa')]('/',auth[_0xbaac('0xb')](),controller[_0xbaac('0xc')]);router[_0xbaac('0xa')](_0xbaac('0xd'),auth[_0xbaac('0xb')](),controller['show']);router[_0xbaac('0xa')](_0xbaac('0xe'),auth[_0xbaac('0xb')](),controller[_0xbaac('0xf')]);router[_0xbaac('0xa')](_0xbaac('0x10'),auth[_0xbaac('0xb')](),controller[_0xbaac('0x11')]);router[_0xbaac('0x12')]('/',auth[_0xbaac('0xb')](),controller['create']);router[_0xbaac('0x12')](_0xbaac('0xe'),auth[_0xbaac('0xb')](),controller[_0xbaac('0x13')]);router[_0xbaac('0x14')](_0xbaac('0xd'),auth['isAuthenticated'](),controller[_0xbaac('0x15')]);router[_0xbaac('0x16')](_0xbaac('0xd'),auth[_0xbaac('0xb')](),controller[_0xbaac('0x17')]);module[_0xbaac('0x18')]=router; \ No newline at end of file +var _0xae5f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x2b7aea,_0x52c862){var _0x4142be=function(_0x2d52ab){while(--_0x2d52ab){_0x2b7aea['push'](_0x2b7aea['shift']());}};_0x4142be(++_0x52c862);}(_0xae5f,0x126));var _0xfae5=function(_0xb35837,_0x173dc5){_0xb35837=_0xb35837-0x0;var _0xd6aaf=_0xae5f[_0xb35837];return _0xd6aaf;};'use strict';var multer=require(_0xfae5('0x0'));var util=require(_0xfae5('0x1'));var path=require(_0xfae5('0x2'));var timeout=require(_0xfae5('0x3'));var express=require(_0xfae5('0x4'));var router=express[_0xfae5('0x5')]();var fs_extra=require(_0xfae5('0x6'));var auth=require(_0xfae5('0x7'));var interaction=require(_0xfae5('0x8'));var config=require(_0xfae5('0x9'));var controller=require(_0xfae5('0xa'));router[_0xfae5('0xb')]('/',auth['isAuthenticated'](),controller[_0xfae5('0xc')]);router[_0xfae5('0xb')]('/:id',auth[_0xfae5('0xd')](),controller[_0xfae5('0xe')]);router['get']('/:id/configurations',auth[_0xfae5('0xd')](),controller[_0xfae5('0xf')]);router[_0xfae5('0xb')](_0xfae5('0x10'),auth[_0xfae5('0xd')](),controller[_0xfae5('0x11')]);router[_0xfae5('0x12')]('/',auth[_0xfae5('0xd')](),controller['create']);router[_0xfae5('0x12')](_0xfae5('0x13'),auth['isAuthenticated'](),controller[_0xfae5('0x14')]);router[_0xfae5('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xfae5('0x16')]);router[_0xfae5('0x17')](_0xfae5('0x18'),auth['isAuthenticated'](),controller[_0xfae5('0x19')]);module[_0xfae5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e188581..bedfa9e 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 _0x668b=['exports','STRING','sequelize'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x668b,0x140));var _0xb668=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x668b[_0x3b76f7];return _0x43984e;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb668('0x2')]},'host':{'type':Sequelize[_0xb668('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb668('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xb668('0x2')]},'refreshToken':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x9a19,0x114));var _0x99a1=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x9a19[_0x506d2f];return _0x101255;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index cb0f8a7..bbf5152 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 _0x8d56=['Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','ZohoConfiguration','filter','hasOwnProperty','AccountId','Subjects','getSubjects','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'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8d56,0x12e));var _0x68d5=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x8d56[_0x2b81be];return _0x8ed4a7;};'use strict';var emlformat=require(_0x68d5('0x0'));var rimraf=require(_0x68d5('0x1'));var zipdir=require(_0x68d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68d5('0x3'));var moment=require('moment');var BPromise=require(_0x68d5('0x4'));var Mustache=require(_0x68d5('0x5'));var util=require('util');var path=require(_0x68d5('0x6'));var sox=require(_0x68d5('0x7'));var csv=require(_0x68d5('0x8'));var ejs=require(_0x68d5('0x9'));var fs=require('fs');var fs_extra=require(_0x68d5('0xa'));var _=require(_0x68d5('0xb'));var squel=require('squel');var crypto=require(_0x68d5('0xc'));var jsforce=require(_0x68d5('0xd'));var deskjs=require(_0x68d5('0xe'));var toCsv=require(_0x68d5('0x8'));var querystring=require(_0x68d5('0xf'));var Papa=require(_0x68d5('0x10'));var Redis=require(_0x68d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x68d5('0x12'));var as=require(_0x68d5('0x13'));var hardwareService=require(_0x68d5('0x14'));var logger=require(_0x68d5('0x15'))('api');var utils=require(_0x68d5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68d5('0x17'))['db'];var integrations=require(_0x68d5('0x18'));function respondWithStatusCode(_0x162ff2,_0x5d4c9e){_0x5d4c9e=_0x5d4c9e||0xcc;return function(_0x512681){if(_0x512681){return _0x162ff2[_0x68d5('0x19')](_0x5d4c9e);}return _0x162ff2[_0x68d5('0x1a')](_0x5d4c9e)[_0x68d5('0x1b')]();};}function respondWithResult(_0x464452,_0x225bc6){_0x225bc6=_0x225bc6||0xc8;return function(_0x19a298){if(_0x19a298){return _0x464452['status'](_0x225bc6)[_0x68d5('0x1c')](_0x19a298);}};}function respondWithFilteredResult(_0x396099,_0x1b76ab){return function(_0x4f6bc9){if(_0x4f6bc9){var _0x1dd211=typeof _0x1b76ab[_0x68d5('0x1d')]===_0x68d5('0x1e')&&typeof _0x1b76ab[_0x68d5('0x1f')]===_0x68d5('0x1e');var _0x6168df=_0x4f6bc9[_0x68d5('0x20')];var _0x291a5b=_0x1dd211?0x0:_0x1b76ab[_0x68d5('0x1d')];var _0x52d93f=_0x1dd211?_0x4f6bc9[_0x68d5('0x20')]:_0x1b76ab[_0x68d5('0x1d')]+_0x1b76ab[_0x68d5('0x1f')];var _0x3856d5;if(_0x52d93f>=_0x6168df){_0x52d93f=_0x6168df;_0x3856d5=0xc8;}else{_0x3856d5=0xce;}_0x396099['status'](_0x3856d5);return _0x396099[_0x68d5('0x21')]('Content-Range',_0x291a5b+'-'+_0x52d93f+'/'+_0x6168df)[_0x68d5('0x1c')](_0x4f6bc9);}return null;};}function patchUpdates(_0x4b394a){return function(_0x47c3a2){try{jsonpatch[_0x68d5('0x22')](_0x47c3a2,_0x4b394a,!![]);}catch(_0x146f00){return BPromise[_0x68d5('0x23')](_0x146f00);}return _0x47c3a2['save']();};}function saveUpdates(_0x4b3328,_0x39fa86){return function(_0x53716c){if(_0x53716c){return _0x53716c[_0x68d5('0x24')](_0x4b3328)[_0x68d5('0x25')](function(_0x3cb7cc){return _0x3cb7cc;});}return null;};}function removeEntity(_0x543d3f,_0x221f58){return function(_0x451ddc){if(_0x451ddc){return _0x451ddc[_0x68d5('0x26')]()[_0x68d5('0x25')](function(){_0x543d3f[_0x68d5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13c41a,_0x441cef){return function(_0x4c577d){if(!_0x4c577d){_0x13c41a[_0x68d5('0x19')](0x194);}return _0x4c577d;};}function handleError(_0x563f78,_0x5c5ca0){_0x5c5ca0=_0x5c5ca0||0x1f4;return function(_0x34d1be){logger[_0x68d5('0x27')](_0x34d1be[_0x68d5('0x28')]);if(_0x34d1be[_0x68d5('0x29')]){delete _0x34d1be['name'];}_0x563f78[_0x68d5('0x1a')](_0x5c5ca0)[_0x68d5('0x2a')](_0x34d1be);};}exports[_0x68d5('0x2b')]=function(_0x5479cf,_0x5a4de7){var _0x5d6649={},_0x36766d={},_0xdc19e2={'count':0x0,'rows':[]};var _0x6518dc=_[_0x68d5('0x2c')](db[_0x68d5('0x2d')][_0x68d5('0x2e')],function(_0x2f28f9){return{'name':_0x2f28f9['fieldName'],'type':_0x2f28f9[_0x68d5('0x2f')][_0x68d5('0x30')]};});_0x36766d['model']=_[_0x68d5('0x2c')](_0x6518dc,'name');_0x36766d['query']=_['keys'](_0x5479cf[_0x68d5('0x31')]);_0x36766d[_0x68d5('0x32')]=_['intersection'](_0x36766d[_0x68d5('0x33')],_0x36766d[_0x68d5('0x31')]);_0x5d6649[_0x68d5('0x34')]=_[_0x68d5('0x35')](_0x36766d[_0x68d5('0x33')],qs[_0x68d5('0x36')](_0x5479cf[_0x68d5('0x31')]['fields']));_0x5d6649[_0x68d5('0x34')]=_0x5d6649['attributes']['length']?_0x5d6649[_0x68d5('0x34')]:_0x36766d[_0x68d5('0x33')];if(!_0x5479cf[_0x68d5('0x31')]['hasOwnProperty'](_0x68d5('0x37'))){_0x5d6649[_0x68d5('0x1f')]=qs[_0x68d5('0x1f')](_0x5479cf[_0x68d5('0x31')][_0x68d5('0x1f')]);_0x5d6649[_0x68d5('0x1d')]=qs['offset'](_0x5479cf[_0x68d5('0x31')][_0x68d5('0x1d')]);}_0x5d6649[_0x68d5('0x38')]=qs[_0x68d5('0x39')](_0x5479cf[_0x68d5('0x31')][_0x68d5('0x39')]);_0x5d6649[_0x68d5('0x3a')]=qs['filters'](_[_0x68d5('0x3b')](_0x5479cf['query'],_0x36766d[_0x68d5('0x32')]),_0x6518dc);if(_0x5479cf['query']['filter']){_0x5d6649['where']=_['merge'](_0x5d6649[_0x68d5('0x3a')],{'$or':_[_0x68d5('0x2c')](_0x6518dc,function(_0x297858){if(_0x297858[_0x68d5('0x2f')]!==_0x68d5('0x3c')){var _0x10d0a6={};_0x10d0a6[_0x297858[_0x68d5('0x29')]]={'$like':'%'+_0x5479cf[_0x68d5('0x31')]['filter']+'%'};return _0x10d0a6;}})});}_0x5d6649=_[_0x68d5('0x3d')]({},_0x5d6649,_0x5479cf[_0x68d5('0x3e')]);var _0x4e151a={'where':_0x5d6649[_0x68d5('0x3a')]};return db[_0x68d5('0x2d')][_0x68d5('0x20')](_0x4e151a)[_0x68d5('0x25')](function(_0x536883){_0xdc19e2[_0x68d5('0x20')]=_0x536883;if(_0x5479cf[_0x68d5('0x31')][_0x68d5('0x3f')]){_0x5d6649[_0x68d5('0x40')]=[{'all':!![]}];}return db[_0x68d5('0x2d')][_0x68d5('0x41')](_0x5d6649);})['then'](function(_0x657667){_0xdc19e2[_0x68d5('0x42')]=_0x657667;return _0xdc19e2;})[_0x68d5('0x25')](respondWithFilteredResult(_0x5a4de7,_0x5d6649))[_0x68d5('0x43')](handleError(_0x5a4de7,null));};exports[_0x68d5('0x44')]=function(_0x35f045,_0x3d2c85){var _0x11f3c5={'raw':![],'where':{'id':_0x35f045[_0x68d5('0x45')]['id']}},_0x15e1c8={};_0x15e1c8['model']=_[_0x68d5('0x46')](db[_0x68d5('0x2d')][_0x68d5('0x2e')]);_0x15e1c8[_0x68d5('0x31')]=_[_0x68d5('0x46')](_0x35f045['query']);_0x15e1c8[_0x68d5('0x32')]=_[_0x68d5('0x35')](_0x15e1c8[_0x68d5('0x33')],_0x15e1c8[_0x68d5('0x31')]);_0x11f3c5[_0x68d5('0x34')]=_[_0x68d5('0x35')](_0x15e1c8[_0x68d5('0x33')],qs[_0x68d5('0x36')](_0x35f045['query'][_0x68d5('0x36')]));_0x11f3c5['attributes']=_0x11f3c5[_0x68d5('0x34')][_0x68d5('0x47')]?_0x11f3c5[_0x68d5('0x34')]:_0x15e1c8['model'];if(_0x35f045['query'][_0x68d5('0x3f')]){_0x11f3c5[_0x68d5('0x40')]=[{'all':!![]}];}_0x11f3c5=_[_0x68d5('0x3d')]({},_0x11f3c5,_0x35f045[_0x68d5('0x3e')]);return db[_0x68d5('0x2d')][_0x68d5('0x48')](_0x11f3c5)['then'](handleEntityNotFound(_0x3d2c85,null))[_0x68d5('0x25')](respondWithResult(_0x3d2c85,null))['catch'](handleError(_0x3d2c85,null));};exports[_0x68d5('0x49')]=function(_0x3683bd,_0x2af762){return db[_0x68d5('0x2d')][_0x68d5('0x49')](_0x3683bd[_0x68d5('0x4a')],{})[_0x68d5('0x25')](respondWithResult(_0x2af762,0xc9))[_0x68d5('0x43')](handleError(_0x2af762,null));};exports['update']=function(_0x2e92a0,_0x180af6){if(_0x2e92a0['body']['id']){delete _0x2e92a0[_0x68d5('0x4a')]['id'];}return db[_0x68d5('0x2d')]['find']({'where':{'id':_0x2e92a0['params']['id']}})[_0x68d5('0x25')](handleEntityNotFound(_0x180af6,null))[_0x68d5('0x25')](saveUpdates(_0x2e92a0[_0x68d5('0x4a')],null))['then'](respondWithResult(_0x180af6,null))[_0x68d5('0x43')](handleError(_0x180af6,null));};exports['destroy']=function(_0x282078,_0xea03ca){return db[_0x68d5('0x2d')][_0x68d5('0x48')]({'where':{'id':_0x282078[_0x68d5('0x45')]['id']}})[_0x68d5('0x25')](handleEntityNotFound(_0xea03ca,null))[_0x68d5('0x25')](removeEntity(_0xea03ca,null))['catch'](handleError(_0xea03ca,null));};exports[_0x68d5('0x4b')]=function(_0x4be766,_0x47c636,_0x1ed64a){var _0x36f239={};var _0x2899a8={};var _0xfac706;var _0x3eb2b4;return db['ZohoAccount'][_0x68d5('0x4c')]({'where':{'id':_0x4be766[_0x68d5('0x45')]['id']}})[_0x68d5('0x25')](handleEntityNotFound(_0x47c636,null))[_0x68d5('0x25')](function(_0x8f01ba){if(_0x8f01ba){_0xfac706=_0x8f01ba;_0x2899a8[_0x68d5('0x33')]=_[_0x68d5('0x46')](db[_0x68d5('0x4d')][_0x68d5('0x2e')]);_0x2899a8[_0x68d5('0x31')]=_['keys'](_0x4be766[_0x68d5('0x31')]);_0x2899a8[_0x68d5('0x32')]=_[_0x68d5('0x35')](_0x2899a8[_0x68d5('0x33')],_0x2899a8[_0x68d5('0x31')]);_0x36f239[_0x68d5('0x34')]=_[_0x68d5('0x35')](_0x2899a8[_0x68d5('0x33')],qs[_0x68d5('0x36')](_0x4be766[_0x68d5('0x31')][_0x68d5('0x36')]));_0x36f239['attributes']=_0x36f239[_0x68d5('0x34')]['length']?_0x36f239['attributes']:_0x2899a8['model'];_0x36f239[_0x68d5('0x38')]=qs[_0x68d5('0x39')](_0x4be766[_0x68d5('0x31')][_0x68d5('0x39')]);_0x36f239[_0x68d5('0x3a')]=qs[_0x68d5('0x32')](_['pick'](_0x4be766[_0x68d5('0x31')],_0x2899a8[_0x68d5('0x32')]));if(_0x4be766[_0x68d5('0x31')][_0x68d5('0x4e')]){_0x36f239[_0x68d5('0x3a')]=_['merge'](_0x36f239['where'],{'$or':_[_0x68d5('0x2c')](_0x36f239['attributes'],function(_0x1d2740){var _0x4f68b7={};_0x4f68b7[_0x1d2740]={'$like':'%'+_0x4be766[_0x68d5('0x31')][_0x68d5('0x4e')]+'%'};return _0x4f68b7;})});}_0x36f239=_['merge']({},_0x36f239,_0x4be766[_0x68d5('0x3e')]);return _0xfac706[_0x68d5('0x4b')](_0x36f239);}})[_0x68d5('0x25')](function(_0x227f18){if(_0x227f18){_0x3eb2b4=_0x227f18[_0x68d5('0x47')];if(!_0x4be766['query'][_0x68d5('0x4f')](_0x68d5('0x37'))){_0x36f239[_0x68d5('0x1f')]=qs[_0x68d5('0x1f')](_0x4be766[_0x68d5('0x31')]['limit']);_0x36f239[_0x68d5('0x1d')]=qs[_0x68d5('0x1d')](_0x4be766[_0x68d5('0x31')]['offset']);}return _0xfac706[_0x68d5('0x4b')](_0x36f239);}})['then'](function(_0x5e81a6){if(_0x5e81a6){return _0x5e81a6?{'count':_0x3eb2b4,'rows':_0x5e81a6}:null;}})[_0x68d5('0x25')](respondWithResult(_0x47c636,null))[_0x68d5('0x43')](handleError(_0x47c636,null));};exports['addConfiguration']=function(_0x2f50e6,_0xc206a6,_0x465748){if(_0x2f50e6[_0x68d5('0x4a')]['id']){delete _0x2f50e6[_0x68d5('0x4a')]['id'];}return db[_0x68d5('0x2d')][_0x68d5('0x4c')]({'where':{'id':_0x2f50e6['params']['id']}})['then'](handleEntityNotFound(_0xc206a6,null))[_0x68d5('0x25')](function(_0x238aa2){if(_0x238aa2){_0x2f50e6[_0x68d5('0x4a')][_0x68d5('0x50')]=_0x238aa2['id'];_0x2f50e6[_0x68d5('0x4a')][_0x68d5('0x51')]=integrations[_0x68d5('0x52')](_0x2f50e6[_0x68d5('0x4a')]['channel'],_0x2f50e6[_0x68d5('0x4a')][_0x68d5('0x2f')]);_0x2f50e6[_0x68d5('0x4a')][_0x68d5('0x53')]=integrations[_0x68d5('0x54')](_0x2f50e6['body'][_0x68d5('0x55')],_0x2f50e6[_0x68d5('0x4a')][_0x68d5('0x2f')]);return db['ZohoConfiguration'][_0x68d5('0x49')](_0x2f50e6[_0x68d5('0x4a')],{'include':[{'model':db[_0x68d5('0x56')],'as':_0x68d5('0x51')},{'model':db[_0x68d5('0x56')],'as':_0x68d5('0x53')}]});}return null;})[_0x68d5('0x25')](respondWithResult(_0xc206a6,null))[_0x68d5('0x43')](handleError(_0xc206a6,null));};function getAccessToken(_0x3c6ad5){return new Promise(function(_0x86b90e,_0x27ddda){var _0x4a7e7e;switch(_0x3c6ad5[_0x68d5('0x57')]){case'US':_0x4a7e7e=_0x68d5('0x58');break;case'AU':_0x4a7e7e=_0x68d5('0x59');break;case'EU':_0x4a7e7e=_0x68d5('0x5a');break;case'IN':_0x4a7e7e=_0x68d5('0x5b');break;case'CN':_0x4a7e7e=_0x68d5('0x5c');break;default:_0x4a7e7e=_0x68d5('0x5a');break;}var _0x561fbd={'method':_0x68d5('0x5d'),'uri':_0x4a7e7e+_0x68d5('0x5e'),'qs':{'refresh_token':_0x3c6ad5[_0x68d5('0x5f')],'client_id':_0x3c6ad5[_0x68d5('0x60')],'client_secret':_0x3c6ad5[_0x68d5('0x61')],'grant_type':_0x68d5('0x62')},'json':!![]};return rp(_0x561fbd)[_0x68d5('0x25')](function(_0x2476f8){if(_0x2476f8[_0x68d5('0x63')]){_0x86b90e(_0x2476f8[_0x68d5('0x63')]);}else{_0x27ddda(_0x68d5('0x64'));}})[_0x68d5('0x43')](function(_0x44316c){_0x27ddda(_0x44316c);});});}exports[_0x68d5('0x65')]=function(_0x2e0767,_0x17812c,_0x42beab){var _0x3a9d82,_0x27c0ae,_0x319b9c,_0x28350f,_0x3f235a;return db['ZohoAccount'][_0x68d5('0x4c')]({'where':{'id':_0x2e0767[_0x68d5('0x45')]['id']},'attributes':['id',_0x68d5('0x66'),_0x68d5('0x57'),'clientId',_0x68d5('0x61'),_0x68d5('0x67'),_0x68d5('0x68'),_0x68d5('0x5f')]})[_0x68d5('0x25')](handleEntityNotFound(_0x17812c,null))[_0x68d5('0x25')](function(_0x57aabc){_0x3f235a=_0x57aabc;_0x3a9d82=_0x3f235a['host'];_0x27c0ae=_0x3a9d82===_0x68d5('0x69')?'eu':_0x68d5('0x6a');_0x319b9c=_0x3f235a[_0x68d5('0x67')];var _0x47444d=_0x319b9c['slice'](-0x1);if(_0x47444d==='/'||_0x47444d==='\x5c'||_0x47444d===':'){_0x319b9c=_0x319b9c[_0x68d5('0x6b')](0x0,_0x319b9c[_0x68d5('0x6c')](_0x47444d));}if(!_0x3f235a[_0x68d5('0x5f')]){throw new Error(_0x68d5('0x6d'));}return getAccessToken(_0x3f235a);})['then'](function(_0x2971ce){if(_0x2971ce){return rp({'method':_0x68d5('0x6e'),'uri':util['format'](_0x68d5('0x6f'),_0x27c0ae),'qs':{'module':_0x68d5('0x70')},'headers':{'Authorization':_0x68d5('0x71')+_0x2971ce},'json':!![]});}})['then'](function(_0x2703af){if(_0x2703af){if(_0x2703af['response']&&_0x2703af['response'][_0x68d5('0x27')]){throw new Error(_0x2703af[_0x68d5('0x72')]['error'][_0x68d5('0x73')]);}var _0x3e7035=[];var _0x586323=[];var _0xb8bcff=[_0x68d5('0x74'),_0x68d5('0x75'),_0x68d5('0x76'),_0x68d5('0x77'),_0x68d5('0x78'),'Call_Result',_0x68d5('0x79'),_0x68d5('0x7a')];_0x586323=_['remove'](_0x2703af[_0x68d5('0x36')],function(_0x45483e){return _0xb8bcff['includes'](_0x45483e[_0x68d5('0x7b')]);});for(var _0x2fe7ea=0x0;_0x2fe7ea<_0x586323[_0x68d5('0x47')];_0x2fe7ea++){if(_0x586323[_0x2fe7ea][_0x68d5('0x7c')]===![]){_0x3e7035['push']({'id':_0x586323[_0x2fe7ea]['id'],'name':_0x586323[_0x2fe7ea]['display_label'],'custom':_0x586323[_0x2fe7ea][_0x68d5('0x7d')],'options':_0x586323[_0x2fe7ea][_0x68d5('0x7e')]===_0x68d5('0x7f')&&_0x586323[_0x2fe7ea]['pick_list_values']['length']>-0x1?_['map'](_0x586323[_0x2fe7ea][_0x68d5('0x80')],function(_0x4804d9){return{'name':_0x4804d9,'value':_0x4804d9};}):[]});}}return{'count':_0x3e7035[_0x68d5('0x47')],'rows':_0x3e7035};}else{return{'count':0x0,'rows':[]};}})[_0x68d5('0x25')](respondWithResult(_0x17812c,null))[_0x68d5('0x43')](function(_0x2d2f8b){var _0x388f48=_0x2e0767[_0x68d5('0x31')][_0x68d5('0x81')]?0x1f4:_0x2d2f8b[_0x68d5('0x82')]||0x1f4;logger['error'](_0x68d5('0x83'),_0x68d5('0x65'),_0x388f48,JSON[_0x68d5('0x84')](_0x2d2f8b));delete _0x2d2f8b[_0x68d5('0x29')];if(_0x388f48===0x191){_0x388f48=0x190;}_0x17812c[_0x68d5('0x1a')](_0x388f48)[_0x68d5('0x2a')](_0x2e0767[_0x68d5('0x31')][_0x68d5('0x81')]?{'message':_0x68d5('0x85'),'statusCode':_0x2d2f8b['statusCode']}:_0x2d2f8b);});}; \ No newline at end of file +var _0x20bf=['rows','catch','show','keys','intersection','include','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','order','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','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','clientSecret','access_token','host','serverUrl','code','zoho.eu','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','error','message','Owner','Subject','WhoId','Call_Duration','remove','includes','api_name','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll'];(function(_0xc3c970,_0x48b005){var _0x517cac=function(_0x232fa7){while(--_0x232fa7){_0xc3c970['push'](_0xc3c970['shift']());}};_0x517cac(++_0x48b005);}(_0x20bf,0xc3));var _0xf20b=function(_0x4a6fc1,_0x1a2f10){_0x4a6fc1=_0x4a6fc1-0x0;var _0x271cf6=_0x20bf[_0x4a6fc1];return _0x271cf6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf20b('0x0'));var zipdir=require(_0xf20b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf20b('0x2'));var moment=require(_0xf20b('0x3'));var BPromise=require(_0xf20b('0x4'));var Mustache=require(_0xf20b('0x5'));var util=require('util');var path=require(_0xf20b('0x6'));var sox=require(_0xf20b('0x7'));var csv=require(_0xf20b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf20b('0x9'));var _=require(_0xf20b('0xa'));var squel=require(_0xf20b('0xb'));var crypto=require(_0xf20b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf20b('0xd'));var toCsv=require(_0xf20b('0x8'));var querystring=require(_0xf20b('0xe'));var Papa=require(_0xf20b('0xf'));var Redis=require(_0xf20b('0x10'));var authService=require(_0xf20b('0x11'));var qs=require(_0xf20b('0x12'));var as=require(_0xf20b('0x13'));var hardwareService=require(_0xf20b('0x14'));var logger=require(_0xf20b('0x15'))(_0xf20b('0x16'));var utils=require(_0xf20b('0x17'));var config=require(_0xf20b('0x18'));var licenseUtil=require(_0xf20b('0x19'));var db=require(_0xf20b('0x1a'))['db'];var integrations=require(_0xf20b('0x1b'));function respondWithStatusCode(_0x322aa1,_0x56289b){_0x56289b=_0x56289b||0xcc;return function(_0x51ea34){if(_0x51ea34){return _0x322aa1[_0xf20b('0x1c')](_0x56289b);}return _0x322aa1['status'](_0x56289b)[_0xf20b('0x1d')]();};}function respondWithResult(_0x31e4fc,_0x42f0b4){_0x42f0b4=_0x42f0b4||0xc8;return function(_0x19b444){if(_0x19b444){return _0x31e4fc[_0xf20b('0x1e')](_0x42f0b4)['json'](_0x19b444);}};}function respondWithFilteredResult(_0x2403cb,_0x2e6eca){return function(_0x3a8769){if(_0x3a8769){var _0x1729c7=typeof _0x2e6eca['offset']==='undefined'&&typeof _0x2e6eca[_0xf20b('0x1f')]===_0xf20b('0x20');var _0x4a3318=_0x3a8769['count'];var _0x2baea4=_0x1729c7?0x0:_0x2e6eca[_0xf20b('0x21')];var _0x2bd696=_0x1729c7?_0x3a8769[_0xf20b('0x22')]:_0x2e6eca['offset']+_0x2e6eca[_0xf20b('0x1f')];var _0x275bb4;if(_0x2bd696>=_0x4a3318){_0x2bd696=_0x4a3318;_0x275bb4=0xc8;}else{_0x275bb4=0xce;}_0x2403cb[_0xf20b('0x1e')](_0x275bb4);return _0x2403cb[_0xf20b('0x23')](_0xf20b('0x24'),_0x2baea4+'-'+_0x2bd696+'/'+_0x4a3318)[_0xf20b('0x25')](_0x3a8769);}return null;};}function patchUpdates(_0x57e852){return function(_0xf1e04c){try{jsonpatch[_0xf20b('0x26')](_0xf1e04c,_0x57e852,!![]);}catch(_0x278d78){return BPromise[_0xf20b('0x27')](_0x278d78);}return _0xf1e04c[_0xf20b('0x28')]();};}function saveUpdates(_0x1a3035,_0x562a16){return function(_0x5c0aea){if(_0x5c0aea){return _0x5c0aea[_0xf20b('0x29')](_0x1a3035)[_0xf20b('0x2a')](function(_0x3b4a22){return _0x3b4a22;});}return null;};}function removeEntity(_0x14f4c1,_0x29f8f6){return function(_0xebbd87){if(_0xebbd87){return _0xebbd87[_0xf20b('0x2b')]()[_0xf20b('0x2a')](function(){_0x14f4c1[_0xf20b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3671a5,_0x3718af){return function(_0x3c825c){if(!_0x3c825c){_0x3671a5['sendStatus'](0x194);}return _0x3c825c;};}function handleError(_0x4741b6,_0x3e7e23){_0x3e7e23=_0x3e7e23||0x1f4;return function(_0x2073ae){logger['error'](_0x2073ae[_0xf20b('0x2c')]);if(_0x2073ae[_0xf20b('0x2d')]){delete _0x2073ae[_0xf20b('0x2d')];}_0x4741b6[_0xf20b('0x1e')](_0x3e7e23)[_0xf20b('0x2e')](_0x2073ae);};}exports['index']=function(_0x108fba,_0x473985){var _0x24eb71={},_0x48a496={},_0x29e20e={'count':0x0,'rows':[]};var _0x5731b6=_[_0xf20b('0x2f')](db[_0xf20b('0x30')][_0xf20b('0x31')],function(_0x40cc5b){return{'name':_0x40cc5b[_0xf20b('0x32')],'type':_0x40cc5b[_0xf20b('0x33')][_0xf20b('0x34')]};});_0x48a496[_0xf20b('0x35')]=_[_0xf20b('0x2f')](_0x5731b6,'name');_0x48a496[_0xf20b('0x36')]=_['keys'](_0x108fba[_0xf20b('0x36')]);_0x48a496[_0xf20b('0x37')]=_['intersection'](_0x48a496[_0xf20b('0x35')],_0x48a496['query']);_0x24eb71[_0xf20b('0x38')]=_['intersection'](_0x48a496['model'],qs[_0xf20b('0x39')](_0x108fba[_0xf20b('0x36')][_0xf20b('0x39')]));_0x24eb71[_0xf20b('0x38')]=_0x24eb71[_0xf20b('0x38')][_0xf20b('0x3a')]?_0x24eb71[_0xf20b('0x38')]:_0x48a496[_0xf20b('0x35')];if(!_0x108fba[_0xf20b('0x36')]['hasOwnProperty'](_0xf20b('0x3b'))){_0x24eb71[_0xf20b('0x1f')]=qs[_0xf20b('0x1f')](_0x108fba[_0xf20b('0x36')][_0xf20b('0x1f')]);_0x24eb71['offset']=qs[_0xf20b('0x21')](_0x108fba[_0xf20b('0x36')]['offset']);}_0x24eb71['order']=qs[_0xf20b('0x3c')](_0x108fba['query'][_0xf20b('0x3c')]);_0x24eb71['where']=qs[_0xf20b('0x37')](_[_0xf20b('0x3d')](_0x108fba[_0xf20b('0x36')],_0x48a496[_0xf20b('0x37')]),_0x5731b6);if(_0x108fba[_0xf20b('0x36')][_0xf20b('0x3e')]){_0x24eb71[_0xf20b('0x3f')]=_[_0xf20b('0x40')](_0x24eb71[_0xf20b('0x3f')],{'$or':_['map'](_0x5731b6,function(_0x3cfc20){if(_0x3cfc20[_0xf20b('0x33')]!==_0xf20b('0x41')){var _0x2bc0c9={};_0x2bc0c9[_0x3cfc20[_0xf20b('0x2d')]]={'$like':'%'+_0x108fba['query'][_0xf20b('0x3e')]+'%'};return _0x2bc0c9;}})});}_0x24eb71=_[_0xf20b('0x40')]({},_0x24eb71,_0x108fba[_0xf20b('0x42')]);var _0x5cc5ff={'where':_0x24eb71[_0xf20b('0x3f')]};return db[_0xf20b('0x30')][_0xf20b('0x22')](_0x5cc5ff)[_0xf20b('0x2a')](function(_0x3b71fa){_0x29e20e[_0xf20b('0x22')]=_0x3b71fa;if(_0x108fba['query'][_0xf20b('0x43')]){_0x24eb71['include']=[{'all':!![]}];}return db[_0xf20b('0x30')][_0xf20b('0x44')](_0x24eb71);})[_0xf20b('0x2a')](function(_0x2e9736){_0x29e20e[_0xf20b('0x45')]=_0x2e9736;return _0x29e20e;})[_0xf20b('0x2a')](respondWithFilteredResult(_0x473985,_0x24eb71))[_0xf20b('0x46')](handleError(_0x473985,null));};exports[_0xf20b('0x47')]=function(_0x41fc76,_0x58989f){var _0x5e098e={'raw':![],'where':{'id':_0x41fc76['params']['id']}},_0x296d22={};_0x296d22[_0xf20b('0x35')]=_[_0xf20b('0x48')](db[_0xf20b('0x30')]['rawAttributes']);_0x296d22['query']=_[_0xf20b('0x48')](_0x41fc76[_0xf20b('0x36')]);_0x296d22[_0xf20b('0x37')]=_[_0xf20b('0x49')](_0x296d22['model'],_0x296d22[_0xf20b('0x36')]);_0x5e098e[_0xf20b('0x38')]=_[_0xf20b('0x49')](_0x296d22[_0xf20b('0x35')],qs[_0xf20b('0x39')](_0x41fc76[_0xf20b('0x36')]['fields']));_0x5e098e[_0xf20b('0x38')]=_0x5e098e[_0xf20b('0x38')]['length']?_0x5e098e[_0xf20b('0x38')]:_0x296d22[_0xf20b('0x35')];if(_0x41fc76[_0xf20b('0x36')][_0xf20b('0x43')]){_0x5e098e[_0xf20b('0x4a')]=[{'all':!![]}];}_0x5e098e=_[_0xf20b('0x40')]({},_0x5e098e,_0x41fc76[_0xf20b('0x42')]);return db[_0xf20b('0x30')][_0xf20b('0x4b')](_0x5e098e)['then'](handleEntityNotFound(_0x58989f,null))['then'](respondWithResult(_0x58989f,null))[_0xf20b('0x46')](handleError(_0x58989f,null));};exports['create']=function(_0x6f6c2a,_0x3fea06){return db[_0xf20b('0x30')][_0xf20b('0x4c')](_0x6f6c2a[_0xf20b('0x4d')],{})[_0xf20b('0x2a')](respondWithResult(_0x3fea06,0xc9))[_0xf20b('0x46')](handleError(_0x3fea06,null));};exports[_0xf20b('0x29')]=function(_0x1bf7cd,_0x4428db){if(_0x1bf7cd['body']['id']){delete _0x1bf7cd[_0xf20b('0x4d')]['id'];}return db[_0xf20b('0x30')]['find']({'where':{'id':_0x1bf7cd[_0xf20b('0x4e')]['id']}})[_0xf20b('0x2a')](handleEntityNotFound(_0x4428db,null))[_0xf20b('0x2a')](saveUpdates(_0x1bf7cd[_0xf20b('0x4d')],null))[_0xf20b('0x2a')](respondWithResult(_0x4428db,null))[_0xf20b('0x46')](handleError(_0x4428db,null));};exports[_0xf20b('0x2b')]=function(_0x59a618,_0x3e6849){return db['ZohoAccount'][_0xf20b('0x4b')]({'where':{'id':_0x59a618['params']['id']}})[_0xf20b('0x2a')](handleEntityNotFound(_0x3e6849,null))['then'](removeEntity(_0x3e6849,null))[_0xf20b('0x46')](handleError(_0x3e6849,null));};exports[_0xf20b('0x4f')]=function(_0x2dc95b,_0x51445e,_0xd14cdd){var _0x19fbe5={};var _0x452e38={};var _0x166149;var _0x11ce0d;return db[_0xf20b('0x30')][_0xf20b('0x50')]({'where':{'id':_0x2dc95b[_0xf20b('0x4e')]['id']}})[_0xf20b('0x2a')](handleEntityNotFound(_0x51445e,null))[_0xf20b('0x2a')](function(_0x13fd0c){if(_0x13fd0c){_0x166149=_0x13fd0c;_0x452e38[_0xf20b('0x35')]=_[_0xf20b('0x48')](db[_0xf20b('0x51')][_0xf20b('0x31')]);_0x452e38[_0xf20b('0x36')]=_[_0xf20b('0x48')](_0x2dc95b['query']);_0x452e38[_0xf20b('0x37')]=_[_0xf20b('0x49')](_0x452e38[_0xf20b('0x35')],_0x452e38[_0xf20b('0x36')]);_0x19fbe5['attributes']=_[_0xf20b('0x49')](_0x452e38[_0xf20b('0x35')],qs['fields'](_0x2dc95b['query']['fields']));_0x19fbe5[_0xf20b('0x38')]=_0x19fbe5['attributes'][_0xf20b('0x3a')]?_0x19fbe5[_0xf20b('0x38')]:_0x452e38['model'];_0x19fbe5[_0xf20b('0x52')]=qs[_0xf20b('0x3c')](_0x2dc95b[_0xf20b('0x36')][_0xf20b('0x3c')]);_0x19fbe5['where']=qs[_0xf20b('0x37')](_[_0xf20b('0x3d')](_0x2dc95b[_0xf20b('0x36')],_0x452e38[_0xf20b('0x37')]));if(_0x2dc95b[_0xf20b('0x36')][_0xf20b('0x3e')]){_0x19fbe5[_0xf20b('0x3f')]=_[_0xf20b('0x40')](_0x19fbe5[_0xf20b('0x3f')],{'$or':_[_0xf20b('0x2f')](_0x19fbe5[_0xf20b('0x38')],function(_0x162130){var _0x6d1f73={};_0x6d1f73[_0x162130]={'$like':'%'+_0x2dc95b['query'][_0xf20b('0x3e')]+'%'};return _0x6d1f73;})});}_0x19fbe5=_[_0xf20b('0x40')]({},_0x19fbe5,_0x2dc95b[_0xf20b('0x42')]);return _0x166149[_0xf20b('0x4f')](_0x19fbe5);}})[_0xf20b('0x2a')](function(_0x1ead8f){if(_0x1ead8f){_0x11ce0d=_0x1ead8f[_0xf20b('0x3a')];if(!_0x2dc95b[_0xf20b('0x36')][_0xf20b('0x53')](_0xf20b('0x3b'))){_0x19fbe5['limit']=qs[_0xf20b('0x1f')](_0x2dc95b[_0xf20b('0x36')][_0xf20b('0x1f')]);_0x19fbe5[_0xf20b('0x21')]=qs[_0xf20b('0x21')](_0x2dc95b[_0xf20b('0x36')][_0xf20b('0x21')]);}return _0x166149[_0xf20b('0x4f')](_0x19fbe5);}})[_0xf20b('0x2a')](function(_0x54961a){if(_0x54961a){return _0x54961a?{'count':_0x11ce0d,'rows':_0x54961a}:null;}})[_0xf20b('0x2a')](respondWithResult(_0x51445e,null))[_0xf20b('0x46')](handleError(_0x51445e,null));};exports['addConfiguration']=function(_0x817844,_0x315ac9,_0x449dc3){if(_0x817844[_0xf20b('0x4d')]['id']){delete _0x817844[_0xf20b('0x4d')]['id'];}return db[_0xf20b('0x30')]['findOne']({'where':{'id':_0x817844[_0xf20b('0x4e')]['id']}})[_0xf20b('0x2a')](handleEntityNotFound(_0x315ac9,null))['then'](function(_0x472600){if(_0x472600){_0x817844['body'][_0xf20b('0x54')]=_0x472600['id'];_0x817844['body'][_0xf20b('0x55')]=integrations[_0xf20b('0x56')](_0x817844[_0xf20b('0x4d')][_0xf20b('0x57')],_0x817844[_0xf20b('0x4d')][_0xf20b('0x33')]);_0x817844[_0xf20b('0x4d')][_0xf20b('0x58')]=integrations['getDescriptions'](_0x817844[_0xf20b('0x4d')][_0xf20b('0x57')],_0x817844[_0xf20b('0x4d')][_0xf20b('0x33')]);return db[_0xf20b('0x51')][_0xf20b('0x4c')](_0x817844[_0xf20b('0x4d')],{'include':[{'model':db[_0xf20b('0x59')],'as':_0xf20b('0x55')},{'model':db[_0xf20b('0x59')],'as':_0xf20b('0x58')}]});}return null;})[_0xf20b('0x2a')](respondWithResult(_0x315ac9,null))[_0xf20b('0x46')](handleError(_0x315ac9,null));};function getAccessToken(_0x1d76f7){return new Promise(function(_0x2d5cd9,_0x4b14a9){var _0x2ee71a;switch(_0x1d76f7[_0xf20b('0x5a')]){case'US':_0x2ee71a=_0xf20b('0x5b');break;case'AU':_0x2ee71a=_0xf20b('0x5c');break;case'EU':_0x2ee71a=_0xf20b('0x5d');break;case'IN':_0x2ee71a=_0xf20b('0x5e');break;case'CN':_0x2ee71a=_0xf20b('0x5f');break;default:_0x2ee71a=_0xf20b('0x5d');break;}var _0x142d87={'method':_0xf20b('0x60'),'uri':_0x2ee71a+_0xf20b('0x61'),'qs':{'refresh_token':_0x1d76f7[_0xf20b('0x62')],'client_id':_0x1d76f7['clientId'],'client_secret':_0x1d76f7[_0xf20b('0x63')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x142d87)[_0xf20b('0x2a')](function(_0x16410e){if(_0x16410e[_0xf20b('0x64')]){_0x2d5cd9(_0x16410e[_0xf20b('0x64')]);}else{_0x4b14a9('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xf20b('0x46')](function(_0xb858da){_0x4b14a9(_0xb858da);});});}exports['getFields']=function(_0x1c2705,_0x26bfec,_0x53d01b){var _0x12b4c4,_0x39ee29,_0x41d855,_0x1f9fbe,_0x4d2354;return db[_0xf20b('0x30')][_0xf20b('0x50')]({'where':{'id':_0x1c2705[_0xf20b('0x4e')]['id']},'attributes':['id',_0xf20b('0x65'),_0xf20b('0x5a'),'clientId',_0xf20b('0x63'),_0xf20b('0x66'),_0xf20b('0x67'),_0xf20b('0x62')]})[_0xf20b('0x2a')](handleEntityNotFound(_0x26bfec,null))['then'](function(_0x23125c){_0x4d2354=_0x23125c;_0x12b4c4=_0x4d2354[_0xf20b('0x65')];_0x39ee29=_0x12b4c4===_0xf20b('0x68')?'eu':'com';_0x41d855=_0x4d2354[_0xf20b('0x66')];var _0x534849=_0x41d855['slice'](-0x1);if(_0x534849==='/'||_0x534849==='\x5c'||_0x534849===':'){_0x41d855=_0x41d855[_0xf20b('0x69')](0x0,_0x41d855[_0xf20b('0x6a')](_0x534849));}if(!_0x4d2354[_0xf20b('0x62')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4d2354);})[_0xf20b('0x2a')](function(_0x98694d){if(_0x98694d){return rp({'method':_0xf20b('0x6b'),'uri':util[_0xf20b('0x6c')](_0xf20b('0x6d'),_0x39ee29),'qs':{'module':_0xf20b('0x6e')},'headers':{'Authorization':_0xf20b('0x6f')+_0x98694d},'json':!![]});}})[_0xf20b('0x2a')](function(_0x512192){if(_0x512192){if(_0x512192['response']&&_0x512192['response'][_0xf20b('0x70')]){throw new Error(_0x512192['response']['error'][_0xf20b('0x71')]);}var _0xa65e49=[];var _0x2641b4=[];var _0x1aa9bf=[_0xf20b('0x72'),_0xf20b('0x73'),'Description',_0xf20b('0x74'),_0xf20b('0x75'),'Call_Result','Call_Start_Time','Call_Type'];_0x2641b4=_[_0xf20b('0x76')](_0x512192['fields'],function(_0xe1ab33){return _0x1aa9bf[_0xf20b('0x77')](_0xe1ab33[_0xf20b('0x78')]);});for(var _0xc35e4f=0x0;_0xc35e4f<_0x2641b4[_0xf20b('0x3a')];_0xc35e4f++){if(_0x2641b4[_0xc35e4f]['system_mandatory']===![]){_0xa65e49[_0xf20b('0x79')]({'id':_0x2641b4[_0xc35e4f]['id'],'name':_0x2641b4[_0xc35e4f][_0xf20b('0x7a')],'custom':_0x2641b4[_0xc35e4f][_0xf20b('0x7b')],'options':_0x2641b4[_0xc35e4f]['data_type']===_0xf20b('0x7c')&&_0x2641b4[_0xc35e4f][_0xf20b('0x7d')]['length']>-0x1?_['map'](_0x2641b4[_0xc35e4f]['pick_list_values'],function(_0x42e60f){return{'name':_0x42e60f,'value':_0x42e60f};}):[]});}}return{'count':_0xa65e49['length'],'rows':_0xa65e49};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x26bfec,null))[_0xf20b('0x46')](function(_0x43d654){var _0x5dc1bf=_0x1c2705[_0xf20b('0x36')][_0xf20b('0x7e')]?0x1f4:_0x43d654[_0xf20b('0x7f')]||0x1f4;logger[_0xf20b('0x70')](_0xf20b('0x80'),_0xf20b('0x81'),_0x5dc1bf,JSON[_0xf20b('0x82')](_0x43d654));delete _0x43d654['name'];if(_0x5dc1bf===0x191){_0x5dc1bf=0x190;}_0x26bfec[_0xf20b('0x1e')](_0x5dc1bf)['send'](_0x1c2705[_0xf20b('0x36')][_0xf20b('0x7e')]?{'message':_0xf20b('0x83'),'statusCode':_0x43d654['statusCode']}:_0x43d654);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6e79b69..c01508c 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 _0xaa92=['../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.eu','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes'];(function(_0x13ce0f,_0x354d4c){var _0x1beae8=function(_0x25a40b){while(--_0x25a40b){_0x13ce0f['push'](_0x13ce0f['shift']());}};_0x1beae8(++_0x354d4c);}(_0xaa92,0x117));var _0x2aa9=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xaa92[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x2aa9('0x0'));var util=require('util');var logger=require(_0x2aa9('0x1'))(_0x2aa9('0x2'));var moment=require('moment');var BPromise=require(_0x2aa9('0x3'));var rp=require(_0x2aa9('0x4'));var fs=require('fs');var path=require(_0x2aa9('0x5'));var rimraf=require('rimraf');var config=require(_0x2aa9('0x6'));var attributes=require(_0x2aa9('0x7'));var integrations=require(_0x2aa9('0x8'));module[_0x2aa9('0x9')]=function(_0x1500f5,_0xe63c66){return _0x1500f5[_0x2aa9('0xa')](_0x2aa9('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57fc37,_0x1c2157,_0x5551e6){if(_0x57fc37[_0x2aa9('0xc')](_0x2aa9('0xd'))||_0x57fc37[_0x2aa9('0xc')](_0x2aa9('0xe'))||_0x57fc37[_0x2aa9('0xc')](_0x2aa9('0xf'))||_0x57fc37[_0x2aa9('0xc')](_0x2aa9('0x10'))||_0x57fc37[_0x2aa9('0xc')]('code')||_0x57fc37['changed'](_0x2aa9('0x11'))){var _0x24d137,_0x10ff9d;_0x24d137=_0x57fc37[_0x2aa9('0xe')];var _0x118e6a=_0x24d137[_0x2aa9('0x12')](-0x1);if(_0x118e6a==='/'||_0x118e6a==='\x5c'||_0x118e6a===':'){_0x24d137=_0x24d137['substring'](0x0,_0x24d137[_0x2aa9('0x13')](_0x118e6a));}switch(_0x57fc37[_0x2aa9('0xd')]){case'US':_0x10ff9d=_0x2aa9('0x14');break;case'AU':_0x10ff9d=_0x2aa9('0x15');break;case'IN':_0x10ff9d=_0x2aa9('0x16');break;case'CN':_0x10ff9d='https://accounts.zoho.com.cn';break;default:_0x10ff9d='https://accounts.zoho.eu';break;}var _0x1fbeca={'method':_0x2aa9('0x17'),'uri':_0x10ff9d+'/oauth/v2/token','form':{'grant_type':_0x2aa9('0x18'),'client_id':_0x57fc37[_0x2aa9('0xf')],'client_secret':_0x57fc37[_0x2aa9('0x10')],'redirect_uri':_0x57fc37[_0x2aa9('0xe')],'code':_0x57fc37[_0x2aa9('0x19')]},'headers':{'Content-Type':_0x2aa9('0x1a')}};return rp(_0x1fbeca)[_0x2aa9('0x1b')](function(_0x1e9b77){var _0x534bb8=JSON[_0x2aa9('0x1c')](_0x1e9b77);if(_0x534bb8[_0x2aa9('0x1d')]){_0x57fc37[_0x2aa9('0x1e')]=_0x534bb8[_0x2aa9('0x1d')];logger[_0x2aa9('0x1f')](util['format'](_0x2aa9('0x20'),_0x57fc37[_0x2aa9('0x21')],_0x57fc37['id']));}else{logger[_0x2aa9('0x22')](util[_0x2aa9('0x23')](_0x2aa9('0x24'),_0x57fc37['name'],_0x57fc37['id']),util[_0x2aa9('0x25')](_0x534bb8,{'showHidden':![],'depth':null}));}return _0x5551e6(null,_0x1c2157);})[_0x2aa9('0x26')](function(_0x3e94f0){logger[_0x2aa9('0x22')](util[_0x2aa9('0x23')](_0x2aa9('0x24'),_0x57fc37[_0x2aa9('0x21')],_0x57fc37['id']),util[_0x2aa9('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5551e6(_0x3e94f0);});}else{return _0x5551e6(null,_0x1c2157);}},'beforeUpdate':function(_0x3d0bff,_0x5727f8,_0x508047){if(_0x3d0bff[_0x2aa9('0xc')]('zone')||_0x3d0bff[_0x2aa9('0xc')](_0x2aa9('0xe'))||_0x3d0bff['changed']('clientId')||_0x3d0bff['changed'](_0x2aa9('0x10'))||_0x3d0bff[_0x2aa9('0xc')](_0x2aa9('0x19'))||_0x3d0bff[_0x2aa9('0xc')]('host')){var _0x2a4318,_0x569c98;_0x2a4318=_0x3d0bff['serverUrl'];var _0x1129d6=_0x2a4318[_0x2aa9('0x12')](-0x1);if(_0x1129d6==='/'||_0x1129d6==='\x5c'||_0x1129d6===':'){_0x2a4318=_0x2a4318[_0x2aa9('0x27')](0x0,_0x2a4318[_0x2aa9('0x13')](_0x1129d6));}switch(_0x3d0bff[_0x2aa9('0xd')]){case'US':_0x569c98=_0x2aa9('0x14');break;case'AU':_0x569c98=_0x2aa9('0x15');break;case'IN':_0x569c98=_0x2aa9('0x16');break;case'CN':_0x569c98='https://accounts.zoho.com.cn';break;default:_0x569c98=_0x2aa9('0x28');break;}var _0xf4c39e={'method':_0x2aa9('0x17'),'uri':_0x569c98+'/oauth/v2/token','form':{'grant_type':_0x2aa9('0x18'),'client_id':_0x3d0bff['clientId'],'client_secret':_0x3d0bff['clientSecret'],'redirect_uri':_0x3d0bff[_0x2aa9('0xe')],'code':_0x3d0bff[_0x2aa9('0x19')]},'headers':{'Content-Type':_0x2aa9('0x1a')}};return rp(_0xf4c39e)[_0x2aa9('0x1b')](function(_0xf85cf3){var _0x2d44bf=JSON[_0x2aa9('0x1c')](_0xf85cf3);if(_0x2d44bf['refresh_token']){_0x3d0bff[_0x2aa9('0x1e')]=_0x2d44bf['refresh_token'];logger[_0x2aa9('0x1f')](util[_0x2aa9('0x23')](_0x2aa9('0x20'),_0x3d0bff[_0x2aa9('0x21')],_0x3d0bff['id']));}else{logger['error'](util[_0x2aa9('0x23')](_0x2aa9('0x24'),_0x3d0bff[_0x2aa9('0x21')],_0x3d0bff['id']),util[_0x2aa9('0x25')](_0x2d44bf,{'showHidden':![],'depth':null}));}return _0x508047(null,_0x5727f8);})[_0x2aa9('0x26')](function(_0x2b9d24){logger['error'](util['format'](_0x2aa9('0x24'),_0x3d0bff[_0x2aa9('0x21')],_0x3d0bff['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x508047(_0x2b9d24);});}else{return _0x508047(null,_0x5727f8);}}}});}; \ No newline at end of file +var _0x7b0b=['ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','application/x-www-form-urlencoded','info','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define'];(function(_0x2aca26,_0xdc73db){var _0x591592=function(_0x249708){while(--_0x249708){_0x2aca26['push'](_0x2aca26['shift']());}};_0x591592(++_0xdc73db);}(_0x7b0b,0x146));var _0xb7b0=function(_0x3a9101,_0x313a30){_0x3a9101=_0x3a9101-0x0;var _0x45b27b=_0x7b0b[_0x3a9101];return _0x45b27b;};'use strict';var _=require(_0xb7b0('0x0'));var util=require(_0xb7b0('0x1'));var logger=require(_0xb7b0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb7b0('0x3'));var rp=require(_0xb7b0('0x4'));var fs=require('fs');var path=require(_0xb7b0('0x5'));var rimraf=require(_0xb7b0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7b0('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb7b0('0x8')]=function(_0x5d2433,_0x2884cf){return _0x5d2433[_0xb7b0('0x9')](_0xb7b0('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2727f8,_0xbd0fe5,_0x17d983){if(_0x2727f8[_0xb7b0('0xb')](_0xb7b0('0xc'))||_0x2727f8['changed'](_0xb7b0('0xd'))||_0x2727f8[_0xb7b0('0xb')](_0xb7b0('0xe'))||_0x2727f8['changed'](_0xb7b0('0xf'))||_0x2727f8[_0xb7b0('0xb')]('code')||_0x2727f8['changed'](_0xb7b0('0x10'))){var _0x2165c5,_0x5d48de;_0x2165c5=_0x2727f8[_0xb7b0('0xd')];var _0x1339b2=_0x2165c5[_0xb7b0('0x11')](-0x1);if(_0x1339b2==='/'||_0x1339b2==='\x5c'||_0x1339b2===':'){_0x2165c5=_0x2165c5[_0xb7b0('0x12')](0x0,_0x2165c5[_0xb7b0('0x13')](_0x1339b2));}switch(_0x2727f8['zone']){case'US':_0x5d48de=_0xb7b0('0x14');break;case'AU':_0x5d48de=_0xb7b0('0x15');break;case'IN':_0x5d48de='https://accounts.zoho.in';break;case'CN':_0x5d48de='https://accounts.zoho.com.cn';break;default:_0x5d48de='https://accounts.zoho.eu';break;}var _0xc6cc67={'method':_0xb7b0('0x16'),'uri':_0x5d48de+_0xb7b0('0x17'),'form':{'grant_type':_0xb7b0('0x18'),'client_id':_0x2727f8[_0xb7b0('0xe')],'client_secret':_0x2727f8[_0xb7b0('0xf')],'redirect_uri':_0x2727f8[_0xb7b0('0xd')],'code':_0x2727f8[_0xb7b0('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0xc6cc67)[_0xb7b0('0x1a')](function(_0x5307ee){var _0xdecf19=JSON[_0xb7b0('0x1b')](_0x5307ee);if(_0xdecf19[_0xb7b0('0x1c')]){_0x2727f8[_0xb7b0('0x1d')]=_0xdecf19[_0xb7b0('0x1c')];logger['info'](util[_0xb7b0('0x1e')](_0xb7b0('0x1f'),_0x2727f8['name'],_0x2727f8['id']));}else{logger[_0xb7b0('0x20')](util[_0xb7b0('0x1e')](_0xb7b0('0x21'),_0x2727f8[_0xb7b0('0x22')],_0x2727f8['id']),util[_0xb7b0('0x23')](_0xdecf19,{'showHidden':![],'depth':null}));}return _0x17d983(null,_0xbd0fe5);})[_0xb7b0('0x24')](function(_0x3522c1){logger[_0xb7b0('0x20')](util[_0xb7b0('0x1e')](_0xb7b0('0x21'),_0x2727f8['name'],_0x2727f8['id']),util[_0xb7b0('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x17d983(_0x3522c1);});}else{return _0x17d983(null,_0xbd0fe5);}},'beforeUpdate':function(_0x5874b5,_0x1864d1,_0x307398){if(_0x5874b5[_0xb7b0('0xb')](_0xb7b0('0xc'))||_0x5874b5[_0xb7b0('0xb')]('serverUrl')||_0x5874b5['changed'](_0xb7b0('0xe'))||_0x5874b5[_0xb7b0('0xb')](_0xb7b0('0xf'))||_0x5874b5[_0xb7b0('0xb')](_0xb7b0('0x19'))||_0x5874b5[_0xb7b0('0xb')](_0xb7b0('0x10'))){var _0x55fb04,_0x6de98;_0x55fb04=_0x5874b5[_0xb7b0('0xd')];var _0x3c875f=_0x55fb04[_0xb7b0('0x11')](-0x1);if(_0x3c875f==='/'||_0x3c875f==='\x5c'||_0x3c875f===':'){_0x55fb04=_0x55fb04[_0xb7b0('0x12')](0x0,_0x55fb04['lastIndexOf'](_0x3c875f));}switch(_0x5874b5['zone']){case'US':_0x6de98=_0xb7b0('0x14');break;case'AU':_0x6de98=_0xb7b0('0x15');break;case'IN':_0x6de98=_0xb7b0('0x25');break;case'CN':_0x6de98=_0xb7b0('0x26');break;default:_0x6de98=_0xb7b0('0x27');break;}var _0x6ecbd2={'method':_0xb7b0('0x16'),'uri':_0x6de98+_0xb7b0('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x5874b5[_0xb7b0('0xe')],'client_secret':_0x5874b5['clientSecret'],'redirect_uri':_0x5874b5[_0xb7b0('0xd')],'code':_0x5874b5['code']},'headers':{'Content-Type':_0xb7b0('0x28')}};return rp(_0x6ecbd2)[_0xb7b0('0x1a')](function(_0x8a7be5){var _0x213c24=JSON[_0xb7b0('0x1b')](_0x8a7be5);if(_0x213c24['refresh_token']){_0x5874b5[_0xb7b0('0x1d')]=_0x213c24[_0xb7b0('0x1c')];logger[_0xb7b0('0x29')](util[_0xb7b0('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5874b5['name'],_0x5874b5['id']));}else{logger[_0xb7b0('0x20')](util[_0xb7b0('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5874b5['name'],_0x5874b5['id']),util['inspect'](_0x213c24,{'showHidden':![],'depth':null}));}return _0x307398(null,_0x1864d1);})[_0xb7b0('0x24')](function(_0x55b516){logger['error'](util[_0xb7b0('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5874b5[_0xb7b0('0x22')],_0x5874b5['id']),util[_0xb7b0('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x307398(_0x55b516);});}else{return _0x307398(null,_0x1864d1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 4610ae4..f94f9d1 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 _0x4813=['options','where','attributes','limit','include','map','model','find','raw','ShowZohoAccount','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0x4813,0xdc));var _0x3481=function(_0x5cb05e,_0x561025){_0x5cb05e=_0x5cb05e-0x0;var _0x1d8d90=_0x4813[_0x5cb05e];return _0x1d8d90;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var moment=require(_0x3481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x2'));var db=require(_0x3481('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x4'))(_0x3481('0x5'));var config=require(_0x3481('0x6'));var jayson=require(_0x3481('0x7'));var client=jayson[_0x3481('0x8')][_0x3481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369c3b,_0x54a2c8,_0x4d23ef){return new BPromise(function(_0x41592f,_0x527c3c){return client[_0x3481('0xa')](_0x369c3b,_0x4d23ef)[_0x3481('0xb')](function(_0x39b6c4){logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));logger[_0x3481('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x54a2c8,'request\x20sent',JSON[_0x3481('0x10')](_0x39b6c4));if(_0x39b6c4[_0x3481('0x11')]){if(_0x39b6c4[_0x3481('0x11')][_0x3481('0x12')]===0x1f4){logger[_0x3481('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);return _0x527c3c(_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);}logger[_0x3481('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4['error'][_0x3481('0x13')]);return _0x41592f(_0x39b6c4[_0x3481('0x11')]['message']);}else{logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));_0x41592f(_0x39b6c4[_0x3481('0x14')][_0x3481('0x13')]);}})[_0x3481('0x15')](function(_0x2a3981){logger['error'](_0x3481('0xd'),_0x54a2c8,_0x2a3981);_0x527c3c(_0x2a3981);});});}exports[_0x3481('0x16')]=function(_0x4d2ceb){var _0x46dc92=this;return new Promise(function(_0x3e6c00,_0x36fa70){return db[_0x3481('0x17')][_0x3481('0x18')]({'raw':_0x4d2ceb['options']?_0x4d2ceb[_0x3481('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4d2ceb[_0x3481('0x19')]?_0x4d2ceb['options'][_0x3481('0x1a')]||null:null,'attributes':_0x4d2ceb[_0x3481('0x19')]?_0x4d2ceb[_0x3481('0x19')][_0x3481('0x1b')]||null:null,'limit':_0x4d2ceb[_0x3481('0x19')]?_0x4d2ceb['options'][_0x3481('0x1c')]||null:null,'include':_0x4d2ceb[_0x3481('0x19')]?_0x4d2ceb[_0x3481('0x19')][_0x3481('0x1d')]?_[_0x3481('0x1e')](_0x4d2ceb['options'][_0x3481('0x1d')],function(_0x3ef2c2){return{'model':db[_0x3ef2c2['model']],'as':_0x3ef2c2['as'],'attributes':_0x3ef2c2[_0x3481('0x1b')],'include':_0x3ef2c2[_0x3481('0x1d')]?_['map'](_0x3ef2c2[_0x3481('0x1d')],function(_0x2bd432){return{'model':db[_0x2bd432[_0x3481('0x1f')]],'as':_0x2bd432['as'],'attributes':_0x2bd432[_0x3481('0x1b')],'include':_0x2bd432[_0x3481('0x1d')]?_[_0x3481('0x1e')](_0x2bd432[_0x3481('0x1d')],function(_0x4e7eca){return{'model':db[_0x4e7eca[_0x3481('0x1f')]],'as':_0x4e7eca['as'],'attributes':_0x4e7eca[_0x3481('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3481('0xb')](function(_0x1588e2){logger[_0x3481('0xc')]('GetZohoAccount',_0x4d2ceb);logger[_0x3481('0xf')](_0x3481('0x16'),_0x4d2ceb,JSON[_0x3481('0x10')](_0x1588e2));_0x3e6c00(_0x1588e2);})[_0x3481('0x15')](function(_0x12e5d6){logger[_0x3481('0x11')]('GetZohoAccount',_0x12e5d6[_0x3481('0x13')],_0x4d2ceb);_0x36fa70(_0x46dc92[_0x3481('0x11')](0x1f4,_0x12e5d6[_0x3481('0x13')]));});});};exports['ShowZohoAccount']=function(_0x5cc9e2){var _0x388105=this;return new Promise(function(_0x3053bb,_0x1ac644){return db[_0x3481('0x17')][_0x3481('0x20')]({'raw':_0x5cc9e2['options']?_0x5cc9e2[_0x3481('0x19')][_0x3481('0x21')]===undefined?!![]:![]:!![],'where':_0x5cc9e2['options']?_0x5cc9e2[_0x3481('0x19')][_0x3481('0x1a')]||null:null,'attributes':_0x5cc9e2[_0x3481('0x19')]?_0x5cc9e2['options']['attributes']||null:null,'include':_0x5cc9e2['options']?_0x5cc9e2[_0x3481('0x19')][_0x3481('0x1d')]?_[_0x3481('0x1e')](_0x5cc9e2['options']['include'],function(_0x5ca7df){return{'model':db[_0x5ca7df[_0x3481('0x1f')]],'as':_0x5ca7df['as'],'attributes':_0x5ca7df['attributes'],'include':_0x5ca7df['include']?_[_0x3481('0x1e')](_0x5ca7df[_0x3481('0x1d')],function(_0x134f42){return{'model':db[_0x134f42[_0x3481('0x1f')]],'as':_0x134f42['as'],'attributes':_0x134f42[_0x3481('0x1b')],'include':_0x134f42['include']?_['map'](_0x134f42[_0x3481('0x1d')],function(_0x17859c){return{'model':db[_0x17859c[_0x3481('0x1f')]],'as':_0x17859c['as'],'attributes':_0x17859c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b1dd4){logger[_0x3481('0xc')](_0x3481('0x22'),_0x5cc9e2);logger[_0x3481('0xf')]('ShowZohoAccount',_0x5cc9e2,JSON[_0x3481('0x10')](_0x5b1dd4));_0x3053bb(_0x5b1dd4);})['catch'](function(_0x15a562){logger[_0x3481('0x11')](_0x3481('0x22'),_0x15a562['message'],_0x5cc9e2);_0x1ac644(_0x388105[_0x3481('0x11')](0x1f4,_0x15a562['message']));});});}; \ No newline at end of file +var _0x5ea2=['client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','limit','include','attributes','model','map','find','raw','ShowZohoAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3b0e97,_0x52a018){var _0x200b84=function(_0x37da17){while(--_0x37da17){_0x3b0e97['push'](_0x3b0e97['shift']());}};_0x200b84(++_0x52a018);}(_0x5ea2,0x99));var _0x25ea=function(_0x1f810e,_0x3b4b2f){_0x1f810e=_0x1f810e-0x0;var _0x195d0d=_0x5ea2[_0x1f810e];return _0x195d0d;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25ea('0x1'));var rs=require(_0x25ea('0x2'));var fs=require('fs');var Redis=require(_0x25ea('0x3'));var db=require(_0x25ea('0x4'))['db'];var utils=require(_0x25ea('0x5'));var logger=require('../../config/logger')(_0x25ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25ea('0x7')][_0x25ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ca48f,_0x214ed8,_0x274f48){return new BPromise(function(_0x254d54,_0x1c5b5d){return client[_0x25ea('0x9')](_0x3ca48f,_0x274f48)[_0x25ea('0xa')](function(_0x52b281){logger[_0x25ea('0xb')](_0x25ea('0xc'),_0x214ed8,_0x25ea('0xd'));logger[_0x25ea('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x214ed8,_0x25ea('0xd'),JSON[_0x25ea('0xf')](_0x52b281));if(_0x52b281[_0x25ea('0x10')]){if(_0x52b281[_0x25ea('0x10')][_0x25ea('0x11')]===0x1f4){logger[_0x25ea('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x214ed8,_0x52b281['error'][_0x25ea('0x12')]);return _0x1c5b5d(_0x52b281[_0x25ea('0x10')]['message']);}logger[_0x25ea('0x10')](_0x25ea('0xc'),_0x214ed8,_0x52b281[_0x25ea('0x10')][_0x25ea('0x12')]);return _0x254d54(_0x52b281[_0x25ea('0x10')][_0x25ea('0x12')]);}else{logger['info'](_0x25ea('0xc'),_0x214ed8,_0x25ea('0xd'));_0x254d54(_0x52b281['result'][_0x25ea('0x12')]);}})[_0x25ea('0x13')](function(_0x111c5b){logger[_0x25ea('0x10')](_0x25ea('0xc'),_0x214ed8,_0x111c5b);_0x1c5b5d(_0x111c5b);});});}exports[_0x25ea('0x14')]=function(_0x586d4d){var _0x29878b=this;return new Promise(function(_0x454b8e,_0x3b327e){return db[_0x25ea('0x15')][_0x25ea('0x16')]({'raw':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')]['where']||null:null,'attributes':_0x586d4d[_0x25ea('0x17')]?_0x586d4d['options']['attributes']||null:null,'limit':_0x586d4d[_0x25ea('0x17')]?_0x586d4d['options'][_0x25ea('0x18')]||null:null,'include':_0x586d4d[_0x25ea('0x17')]?_0x586d4d[_0x25ea('0x17')][_0x25ea('0x19')]?_['map'](_0x586d4d[_0x25ea('0x17')][_0x25ea('0x19')],function(_0xf34d84){return{'model':db[_0xf34d84['model']],'as':_0xf34d84['as'],'attributes':_0xf34d84[_0x25ea('0x1a')],'include':_0xf34d84[_0x25ea('0x19')]?_['map'](_0xf34d84[_0x25ea('0x19')],function(_0x2b5351){return{'model':db[_0x2b5351[_0x25ea('0x1b')]],'as':_0x2b5351['as'],'attributes':_0x2b5351[_0x25ea('0x1a')],'include':_0x2b5351[_0x25ea('0x19')]?_[_0x25ea('0x1c')](_0x2b5351[_0x25ea('0x19')],function(_0x20c65b){return{'model':db[_0x20c65b[_0x25ea('0x1b')]],'as':_0x20c65b['as'],'attributes':_0x20c65b[_0x25ea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x25ea('0xa')](function(_0x12e061){logger[_0x25ea('0xb')](_0x25ea('0x14'),_0x586d4d);logger[_0x25ea('0xe')](_0x25ea('0x14'),_0x586d4d,JSON['stringify'](_0x12e061));_0x454b8e(_0x12e061);})['catch'](function(_0x3599c3){logger[_0x25ea('0x10')]('GetZohoAccount',_0x3599c3[_0x25ea('0x12')],_0x586d4d);_0x3b327e(_0x29878b[_0x25ea('0x10')](0x1f4,_0x3599c3[_0x25ea('0x12')]));});});};exports['ShowZohoAccount']=function(_0x54459c){var _0x9b5919=this;return new Promise(function(_0x2a71aa,_0x51e3ee){return db[_0x25ea('0x15')][_0x25ea('0x1d')]({'raw':_0x54459c['options']?_0x54459c[_0x25ea('0x17')][_0x25ea('0x1e')]===undefined?!![]:![]:!![],'where':_0x54459c[_0x25ea('0x17')]?_0x54459c[_0x25ea('0x17')]['where']||null:null,'attributes':_0x54459c[_0x25ea('0x17')]?_0x54459c['options'][_0x25ea('0x1a')]||null:null,'include':_0x54459c[_0x25ea('0x17')]?_0x54459c[_0x25ea('0x17')][_0x25ea('0x19')]?_['map'](_0x54459c['options'][_0x25ea('0x19')],function(_0x4bed9e){return{'model':db[_0x4bed9e[_0x25ea('0x1b')]],'as':_0x4bed9e['as'],'attributes':_0x4bed9e[_0x25ea('0x1a')],'include':_0x4bed9e['include']?_[_0x25ea('0x1c')](_0x4bed9e['include'],function(_0x54e37c){return{'model':db[_0x54e37c[_0x25ea('0x1b')]],'as':_0x54e37c['as'],'attributes':_0x54e37c[_0x25ea('0x1a')],'include':_0x54e37c[_0x25ea('0x19')]?_[_0x25ea('0x1c')](_0x54e37c[_0x25ea('0x19')],function(_0x22ea49){return{'model':db[_0x22ea49['model']],'as':_0x22ea49['as'],'attributes':_0x22ea49['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1da04e){logger[_0x25ea('0xb')](_0x25ea('0x1f'),_0x54459c);logger[_0x25ea('0xe')](_0x25ea('0x1f'),_0x54459c,JSON['stringify'](_0x1da04e));_0x2a71aa(_0x1da04e);})[_0x25ea('0x13')](function(_0x2ecbf8){logger[_0x25ea('0x10')](_0x25ea('0x1f'),_0x2ecbf8[_0x25ea('0x12')],_0x54459c);_0x51e3ee(_0x9b5919['error'](0x1f4,_0x2ecbf8[_0x25ea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 3166cc0..2d28075 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 _0xe1a6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id','/:id/fields','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2b4b5e,_0x1a3f66){var _0x4bda0c=function(_0x47538f){while(--_0x47538f){_0x2b4b5e['push'](_0x2b4b5e['shift']());}};_0x4bda0c(++_0x1a3f66);}(_0xe1a6,0x181));var _0x6e1a=function(_0x20cc6d,_0x4e50ac){_0x20cc6d=_0x20cc6d-0x0;var _0x4d3e4f=_0xe1a6[_0x20cc6d];return _0x4d3e4f;};'use strict';var multer=require(_0x6e1a('0x0'));var util=require(_0x6e1a('0x1'));var path=require(_0x6e1a('0x2'));var timeout=require(_0x6e1a('0x3'));var express=require(_0x6e1a('0x4'));var router=express[_0x6e1a('0x5')]();var fs_extra=require(_0x6e1a('0x6'));var auth=require(_0x6e1a('0x7'));var interaction=require(_0x6e1a('0x8'));var config=require(_0x6e1a('0x9'));var controller=require(_0x6e1a('0xa'));router['get']('/',auth[_0x6e1a('0xb')](),controller[_0x6e1a('0xc')]);router['get'](_0x6e1a('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6e1a('0xe'),auth[_0x6e1a('0xb')](),controller[_0x6e1a('0xf')]);router[_0x6e1a('0x10')](_0x6e1a('0x11'),auth[_0x6e1a('0xb')](),controller[_0x6e1a('0x12')]);router['get'](_0x6e1a('0x13'),auth[_0x6e1a('0xb')](),controller[_0x6e1a('0x14')]);router[_0x6e1a('0x15')]('/',auth['isAuthenticated'](),controller[_0x6e1a('0x16')]);router[_0x6e1a('0x17')](_0x6e1a('0xd'),auth['isAuthenticated'](),controller[_0x6e1a('0x18')]);router['delete']('/:id',auth[_0x6e1a('0xb')](),controller['destroy']);module[_0x6e1a('0x19')]=router; \ No newline at end of file +var _0x309a=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x2c1940,_0x1f6321){var _0xe88cd8=function(_0x1c8cd9){while(--_0x1c8cd9){_0x2c1940['push'](_0x2c1940['shift']());}};_0xe88cd8(++_0x1f6321);}(_0x309a,0x7f));var _0xa309=function(_0x359a33,_0x54aa3c){_0x359a33=_0x359a33-0x0;var _0x19a7c=_0x309a[_0x359a33];return _0x19a7c;};'use strict';var multer=require('multer');var util=require(_0xa309('0x0'));var path=require(_0xa309('0x1'));var timeout=require(_0xa309('0x2'));var express=require(_0xa309('0x3'));var router=express[_0xa309('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa309('0x5'));var interaction=require(_0xa309('0x6'));var config=require(_0xa309('0x7'));var controller=require(_0xa309('0x8'));router[_0xa309('0x9')]('/',auth[_0xa309('0xa')](),controller['index']);router[_0xa309('0x9')](_0xa309('0xb'),auth[_0xa309('0xa')](),controller[_0xa309('0xc')]);router[_0xa309('0x9')](_0xa309('0xd'),auth[_0xa309('0xa')](),controller[_0xa309('0xe')]);router[_0xa309('0x9')](_0xa309('0xf'),auth[_0xa309('0xa')](),controller['getSubjects']);router[_0xa309('0x9')](_0xa309('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa309('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa309('0x12')](_0xa309('0xb'),auth['isAuthenticated'](),controller[_0xa309('0x13')]);router[_0xa309('0x14')](_0xa309('0xb'),auth[_0xa309('0xa')](),controller[_0xa309('0x15')]);module[_0xa309('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index cb68d6c..659303c 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 _0xda93=['contact','nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x2788e5,_0x562bf4){var _0x7b12fd=function(_0x462a59){while(--_0x462a59){_0x2788e5['push'](_0x2788e5['shift']());}};_0x7b12fd(++_0x562bf4);}(_0xda93,0x12b));var _0x3da9=function(_0x4caca5,_0x196d31){_0x4caca5=_0x4caca5-0x0;var _0x27e4ea=_0xda93[_0x4caca5];return _0x27e4ea;};'use strict';var Sequelize=require(_0x3da9('0x0'));module[_0x3da9('0x1')]={'name':{'type':Sequelize[_0x3da9('0x2')]},'moduleCreate':{'type':Sequelize[_0x3da9('0x3')](_0x3da9('0x4'),_0x3da9('0x5'),_0x3da9('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0x3da9('0x7'),_0x3da9('0x5'),_0x3da9('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d87=['exports','STRING','ENUM','lead','contact','contact_lead','sequelize'];(function(_0x3a2014,_0xdaab88){var _0x22c80a=function(_0x22fea5){while(--_0x22fea5){_0x3a2014['push'](_0x3a2014['shift']());}};_0x22c80a(++_0xdaab88);}(_0x5d87,0x16b));var _0x75d8=function(_0x1f8450,_0x466ff8){_0x1f8450=_0x1f8450-0x0;var _0x38d1c8=_0x5d87[_0x1f8450];return _0x38d1c8;};'use strict';var Sequelize=require(_0x75d8('0x0'));module[_0x75d8('0x1')]={'name':{'type':Sequelize[_0x75d8('0x2')]},'moduleCreate':{'type':Sequelize[_0x75d8('0x3')](_0x75d8('0x4'),_0x75d8('0x5'),'nothing'),'defaultValue':_0x75d8('0x4')},'moduleSearch':{'type':Sequelize[_0x75d8('0x3')]('contact_lead',_0x75d8('0x5'),_0x75d8('0x4')),'defaultValue':_0x75d8('0x6')},'description':{'type':Sequelize[_0x75d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 71ac793..93d2d76 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 _0xce34=['getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','ZohoConfiguration','include','findAll','catch','params','keys','options','create','body','find','findOne','ZohoField'];(function(_0x3bb954,_0x5173dd){var _0x3d96a3=function(_0x16688c){while(--_0x16688c){_0x3bb954['push'](_0x3bb954['shift']());}};_0x3d96a3(++_0x5173dd);}(_0xce34,0xea));var _0x4ce3=function(_0x17f9ab,_0x4421a2){_0x17f9ab=_0x17f9ab-0x0;var _0x5e4618=_0xce34[_0x17f9ab];return _0x5e4618;};'use strict';var emlformat=require(_0x4ce3('0x0'));var rimraf=require(_0x4ce3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ce3('0x2'));var rp=require(_0x4ce3('0x3'));var moment=require(_0x4ce3('0x4'));var BPromise=require(_0x4ce3('0x5'));var Mustache=require(_0x4ce3('0x6'));var util=require(_0x4ce3('0x7'));var path=require(_0x4ce3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ce3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ce3('0xa'));var _=require(_0x4ce3('0xb'));var squel=require(_0x4ce3('0xc'));var crypto=require(_0x4ce3('0xd'));var jsforce=require(_0x4ce3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ce3('0xf'));var querystring=require(_0x4ce3('0x10'));var Papa=require(_0x4ce3('0x11'));var Redis=require(_0x4ce3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4ce3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ce3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4ce3('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4ce3('0x16'))['db'];function respondWithStatusCode(_0x7a36ab,_0x87de87){_0x87de87=_0x87de87||0xcc;return function(_0xe373b9){if(_0xe373b9){return _0x7a36ab[_0x4ce3('0x17')](_0x87de87);}return _0x7a36ab[_0x4ce3('0x18')](_0x87de87)[_0x4ce3('0x19')]();};}function respondWithResult(_0x49e0d9,_0x200a30){_0x200a30=_0x200a30||0xc8;return function(_0x35f4ca){if(_0x35f4ca){return _0x49e0d9['status'](_0x200a30)[_0x4ce3('0x1a')](_0x35f4ca);}};}function respondWithFilteredResult(_0x4c67b5,_0x142000){return function(_0x2025bb){if(_0x2025bb){var _0x3f30ef=typeof _0x142000[_0x4ce3('0x1b')]===_0x4ce3('0x1c')&&typeof _0x142000[_0x4ce3('0x1d')]==='undefined';var _0x5760c8=_0x2025bb[_0x4ce3('0x1e')];var _0x26a2c9=_0x3f30ef?0x0:_0x142000[_0x4ce3('0x1b')];var _0x3ba4f6=_0x3f30ef?_0x2025bb[_0x4ce3('0x1e')]:_0x142000[_0x4ce3('0x1b')]+_0x142000[_0x4ce3('0x1d')];var _0x10658a;if(_0x3ba4f6>=_0x5760c8){_0x3ba4f6=_0x5760c8;_0x10658a=0xc8;}else{_0x10658a=0xce;}_0x4c67b5['status'](_0x10658a);return _0x4c67b5['set']('Content-Range',_0x26a2c9+'-'+_0x3ba4f6+'/'+_0x5760c8)[_0x4ce3('0x1a')](_0x2025bb);}return null;};}function patchUpdates(_0x3f5ade){return function(_0x3cbc2b){try{jsonpatch[_0x4ce3('0x1f')](_0x3cbc2b,_0x3f5ade,!![]);}catch(_0x1d96b9){return BPromise[_0x4ce3('0x20')](_0x1d96b9);}return _0x3cbc2b[_0x4ce3('0x21')]();};}function saveUpdates(_0x148194,_0x486802){return function(_0x2b5e42){if(_0x2b5e42){return _0x2b5e42[_0x4ce3('0x22')](_0x148194)[_0x4ce3('0x23')](function(_0x3337a3){return _0x3337a3;});}return null;};}function removeEntity(_0x4228c6,_0x309fb1){return function(_0x3124c1){if(_0x3124c1){return _0x3124c1[_0x4ce3('0x24')]()[_0x4ce3('0x23')](function(){_0x4228c6['status'](0xcc)[_0x4ce3('0x19')]();});}};}function handleEntityNotFound(_0x160989,_0x3f0533){return function(_0x2664aa){if(!_0x2664aa){_0x160989[_0x4ce3('0x17')](0x194);}return _0x2664aa;};}function handleError(_0x54ad23,_0x5b759a){_0x5b759a=_0x5b759a||0x1f4;return function(_0xe85174){logger[_0x4ce3('0x25')](_0xe85174[_0x4ce3('0x26')]);if(_0xe85174['name']){delete _0xe85174[_0x4ce3('0x27')];}_0x54ad23['status'](_0x5b759a)[_0x4ce3('0x28')](_0xe85174);};}exports[_0x4ce3('0x29')]=function(_0x1ca70a,_0x58f835){var _0xd8f3c3={},_0x16ba8a={},_0x5497e2={'count':0x0,'rows':[]};var _0x3faa03=_['map'](db['ZohoConfiguration'][_0x4ce3('0x2a')],function(_0x3b71eb){return{'name':_0x3b71eb[_0x4ce3('0x2b')],'type':_0x3b71eb['type'][_0x4ce3('0x2c')]};});_0x16ba8a[_0x4ce3('0x2d')]=_[_0x4ce3('0x2e')](_0x3faa03,_0x4ce3('0x27'));_0x16ba8a['query']=_['keys'](_0x1ca70a[_0x4ce3('0x2f')]);_0x16ba8a[_0x4ce3('0x30')]=_[_0x4ce3('0x31')](_0x16ba8a[_0x4ce3('0x2d')],_0x16ba8a[_0x4ce3('0x2f')]);_0xd8f3c3[_0x4ce3('0x32')]=_[_0x4ce3('0x31')](_0x16ba8a[_0x4ce3('0x2d')],qs[_0x4ce3('0x33')](_0x1ca70a['query'][_0x4ce3('0x33')]));_0xd8f3c3['attributes']=_0xd8f3c3['attributes'][_0x4ce3('0x34')]?_0xd8f3c3[_0x4ce3('0x32')]:_0x16ba8a[_0x4ce3('0x2d')];if(!_0x1ca70a[_0x4ce3('0x2f')][_0x4ce3('0x35')](_0x4ce3('0x36'))){_0xd8f3c3['limit']=qs[_0x4ce3('0x1d')](_0x1ca70a[_0x4ce3('0x2f')]['limit']);_0xd8f3c3['offset']=qs['offset'](_0x1ca70a[_0x4ce3('0x2f')]['offset']);}_0xd8f3c3[_0x4ce3('0x37')]=qs[_0x4ce3('0x38')](_0x1ca70a[_0x4ce3('0x2f')]['sort']);_0xd8f3c3[_0x4ce3('0x39')]=qs[_0x4ce3('0x30')](_[_0x4ce3('0x3a')](_0x1ca70a['query'],_0x16ba8a[_0x4ce3('0x30')]),_0x3faa03);if(_0x1ca70a[_0x4ce3('0x2f')]['filter']){_0xd8f3c3[_0x4ce3('0x39')]=_[_0x4ce3('0x3b')](_0xd8f3c3['where'],{'$or':_[_0x4ce3('0x2e')](_0x3faa03,function(_0x4de250){if(_0x4de250[_0x4ce3('0x3c')]!=='VIRTUAL'){var _0x178948={};_0x178948[_0x4de250[_0x4ce3('0x27')]]={'$like':'%'+_0x1ca70a[_0x4ce3('0x2f')][_0x4ce3('0x3d')]+'%'};return _0x178948;}})});}_0xd8f3c3=_[_0x4ce3('0x3b')]({},_0xd8f3c3,_0x1ca70a['options']);var _0x225c49={'where':_0xd8f3c3[_0x4ce3('0x39')]};return db[_0x4ce3('0x3e')][_0x4ce3('0x1e')](_0x225c49)['then'](function(_0x419bd4){_0x5497e2['count']=_0x419bd4;if(_0x1ca70a[_0x4ce3('0x2f')]['includeAll']){_0xd8f3c3[_0x4ce3('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x4ce3('0x40')](_0xd8f3c3);})['then'](function(_0x2e348a){_0x5497e2['rows']=_0x2e348a;return _0x5497e2;})['then'](respondWithFilteredResult(_0x58f835,_0xd8f3c3))[_0x4ce3('0x41')](handleError(_0x58f835,null));};exports['show']=function(_0x5d78da,_0x39da59){var _0x4a862c={'raw':![],'where':{'id':_0x5d78da[_0x4ce3('0x42')]['id']}},_0x183be7={};_0x183be7['model']=_['keys'](db[_0x4ce3('0x3e')]['rawAttributes']);_0x183be7[_0x4ce3('0x2f')]=_[_0x4ce3('0x43')](_0x5d78da[_0x4ce3('0x2f')]);_0x183be7[_0x4ce3('0x30')]=_[_0x4ce3('0x31')](_0x183be7[_0x4ce3('0x2d')],_0x183be7['query']);_0x4a862c[_0x4ce3('0x32')]=_[_0x4ce3('0x31')](_0x183be7[_0x4ce3('0x2d')],qs[_0x4ce3('0x33')](_0x5d78da['query'][_0x4ce3('0x33')]));_0x4a862c[_0x4ce3('0x32')]=_0x4a862c['attributes']['length']?_0x4a862c[_0x4ce3('0x32')]:_0x183be7[_0x4ce3('0x2d')];if(_0x5d78da[_0x4ce3('0x2f')]['includeAll']){_0x4a862c['include']=[{'all':!![]}];}_0x4a862c=_[_0x4ce3('0x3b')]({},_0x4a862c,_0x5d78da[_0x4ce3('0x44')]);return db[_0x4ce3('0x3e')]['find'](_0x4a862c)[_0x4ce3('0x23')](handleEntityNotFound(_0x39da59,null))['then'](respondWithResult(_0x39da59,null))[_0x4ce3('0x41')](handleError(_0x39da59,null));};exports[_0x4ce3('0x45')]=function(_0x20d09a,_0xf99c4d){return db[_0x4ce3('0x3e')][_0x4ce3('0x45')](_0x20d09a[_0x4ce3('0x46')],{})[_0x4ce3('0x23')](respondWithResult(_0xf99c4d,0xc9))['catch'](handleError(_0xf99c4d,null));};exports[_0x4ce3('0x22')]=function(_0x529458,_0x114e95){if(_0x529458[_0x4ce3('0x46')]['id']){delete _0x529458[_0x4ce3('0x46')]['id'];}return db[_0x4ce3('0x3e')]['find']({'where':{'id':_0x529458[_0x4ce3('0x42')]['id']}})['then'](handleEntityNotFound(_0x114e95,null))[_0x4ce3('0x23')](saveUpdates(_0x529458[_0x4ce3('0x46')],null))[_0x4ce3('0x23')](respondWithResult(_0x114e95,null))[_0x4ce3('0x41')](handleError(_0x114e95,null));};exports['destroy']=function(_0x489724,_0x2e546b){return db['ZohoConfiguration'][_0x4ce3('0x47')]({'where':{'id':_0x489724[_0x4ce3('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e546b,null))[_0x4ce3('0x23')](removeEntity(_0x2e546b,null))[_0x4ce3('0x41')](handleError(_0x2e546b,null));};exports['getFields']=function(_0x4755f7,_0x8ab0e4,_0x539d78){var _0x517e7a={};var _0x4ba14f={};var _0x20e964;var _0x1ce0d9;return db[_0x4ce3('0x3e')][_0x4ce3('0x48')]({'where':{'id':_0x4755f7[_0x4ce3('0x42')]['id']}})[_0x4ce3('0x23')](handleEntityNotFound(_0x8ab0e4,null))[_0x4ce3('0x23')](function(_0x3449d2){if(_0x3449d2){_0x20e964=_0x3449d2;_0x4ba14f[_0x4ce3('0x2d')]=_['keys'](db[_0x4ce3('0x49')][_0x4ce3('0x2a')]);_0x4ba14f[_0x4ce3('0x2f')]=_[_0x4ce3('0x43')](_0x4755f7[_0x4ce3('0x2f')]);_0x4ba14f['filters']=_[_0x4ce3('0x31')](_0x4ba14f[_0x4ce3('0x2d')],_0x4ba14f[_0x4ce3('0x2f')]);_0x517e7a[_0x4ce3('0x32')]=_[_0x4ce3('0x31')](_0x4ba14f[_0x4ce3('0x2d')],qs[_0x4ce3('0x33')](_0x4755f7['query'][_0x4ce3('0x33')]));_0x517e7a[_0x4ce3('0x32')]=_0x517e7a[_0x4ce3('0x32')][_0x4ce3('0x34')]?_0x517e7a[_0x4ce3('0x32')]:_0x4ba14f['model'];_0x517e7a['order']=qs[_0x4ce3('0x38')](_0x4755f7['query'][_0x4ce3('0x38')]);_0x517e7a[_0x4ce3('0x39')]=qs['filters'](_[_0x4ce3('0x3a')](_0x4755f7[_0x4ce3('0x2f')],_0x4ba14f[_0x4ce3('0x30')]));if(_0x4755f7[_0x4ce3('0x2f')][_0x4ce3('0x3d')]){_0x517e7a[_0x4ce3('0x39')]=_['merge'](_0x517e7a[_0x4ce3('0x39')],{'$or':_[_0x4ce3('0x2e')](_0x517e7a['attributes'],function(_0x22fc4a){var _0x52996d={};_0x52996d[_0x22fc4a]={'$like':'%'+_0x4755f7[_0x4ce3('0x2f')]['filter']+'%'};return _0x52996d;})});}_0x517e7a=_[_0x4ce3('0x3b')]({},_0x517e7a,_0x4755f7[_0x4ce3('0x44')]);return _0x20e964[_0x4ce3('0x4a')](_0x517e7a);}})[_0x4ce3('0x23')](function(_0x437bce){if(_0x437bce){_0x1ce0d9=_0x437bce[_0x4ce3('0x34')];if(!_0x4755f7[_0x4ce3('0x2f')][_0x4ce3('0x35')](_0x4ce3('0x36'))){_0x517e7a[_0x4ce3('0x1d')]=qs['limit'](_0x4755f7[_0x4ce3('0x2f')]['limit']);_0x517e7a[_0x4ce3('0x1b')]=qs[_0x4ce3('0x1b')](_0x4755f7[_0x4ce3('0x2f')][_0x4ce3('0x1b')]);}return _0x20e964[_0x4ce3('0x4a')](_0x517e7a);}})[_0x4ce3('0x23')](function(_0x2a0aa5){if(_0x2a0aa5){return _0x2a0aa5?{'count':_0x1ce0d9,'rows':_0x2a0aa5}:null;}})[_0x4ce3('0x23')](respondWithResult(_0x8ab0e4,null))[_0x4ce3('0x41')](handleError(_0x8ab0e4,null));};exports['getSubjects']=function(_0x19537c,_0x1ba8b6,_0x557902){var _0x1b17ee={};var _0x7d7d5d={};var _0x4f3be5;var _0x3e6775;return db['ZohoConfiguration'][_0x4ce3('0x48')]({'where':{'id':_0x19537c[_0x4ce3('0x42')]['id']}})[_0x4ce3('0x23')](handleEntityNotFound(_0x1ba8b6,null))['then'](function(_0xc7559){if(_0xc7559){_0x4f3be5=_0xc7559;_0x7d7d5d[_0x4ce3('0x2d')]=_[_0x4ce3('0x43')](db[_0x4ce3('0x49')][_0x4ce3('0x2a')]);_0x7d7d5d[_0x4ce3('0x2f')]=_[_0x4ce3('0x43')](_0x19537c[_0x4ce3('0x2f')]);_0x7d7d5d[_0x4ce3('0x30')]=_[_0x4ce3('0x31')](_0x7d7d5d[_0x4ce3('0x2d')],_0x7d7d5d[_0x4ce3('0x2f')]);_0x1b17ee[_0x4ce3('0x32')]=_[_0x4ce3('0x31')](_0x7d7d5d[_0x4ce3('0x2d')],qs['fields'](_0x19537c[_0x4ce3('0x2f')]['fields']));_0x1b17ee[_0x4ce3('0x32')]=_0x1b17ee[_0x4ce3('0x32')][_0x4ce3('0x34')]?_0x1b17ee[_0x4ce3('0x32')]:_0x7d7d5d[_0x4ce3('0x2d')];_0x1b17ee['order']=qs[_0x4ce3('0x38')](_0x19537c[_0x4ce3('0x2f')]['sort']);_0x1b17ee[_0x4ce3('0x39')]=qs['filters'](_['pick'](_0x19537c[_0x4ce3('0x2f')],_0x7d7d5d['filters']));if(_0x19537c[_0x4ce3('0x2f')][_0x4ce3('0x3d')]){_0x1b17ee[_0x4ce3('0x39')]=_[_0x4ce3('0x3b')](_0x1b17ee[_0x4ce3('0x39')],{'$or':_[_0x4ce3('0x2e')](_0x1b17ee[_0x4ce3('0x32')],function(_0x44617d){var _0x16c9ac={};_0x16c9ac[_0x44617d]={'$like':'%'+_0x19537c[_0x4ce3('0x2f')][_0x4ce3('0x3d')]+'%'};return _0x16c9ac;})});}_0x1b17ee=_[_0x4ce3('0x3b')]({},_0x1b17ee,_0x19537c[_0x4ce3('0x44')]);return _0x4f3be5[_0x4ce3('0x4b')](_0x1b17ee);}})['then'](function(_0x5566ec){if(_0x5566ec){_0x3e6775=_0x5566ec[_0x4ce3('0x34')];if(!_0x19537c[_0x4ce3('0x2f')][_0x4ce3('0x35')](_0x4ce3('0x36'))){_0x1b17ee[_0x4ce3('0x1d')]=qs[_0x4ce3('0x1d')](_0x19537c[_0x4ce3('0x2f')][_0x4ce3('0x1d')]);_0x1b17ee[_0x4ce3('0x1b')]=qs['offset'](_0x19537c[_0x4ce3('0x2f')][_0x4ce3('0x1b')]);}return _0x4f3be5[_0x4ce3('0x4b')](_0x1b17ee);}})[_0x4ce3('0x23')](function(_0x57da7a){if(_0x57da7a){return _0x57da7a?{'count':_0x3e6775,'rows':_0x57da7a}:null;}})[_0x4ce3('0x23')](respondWithResult(_0x1ba8b6,null))[_0x4ce3('0x41')](handleError(_0x1ba8b6,null));};exports['getDescriptions']=function(_0x3e496b,_0x2d7565,_0xfb359a){var _0x24f771={};var _0xd0eac4={};var _0xadae82;var _0x12e4be;return db[_0x4ce3('0x3e')][_0x4ce3('0x48')]({'where':{'id':_0x3e496b[_0x4ce3('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d7565,null))['then'](function(_0xfd4c73){if(_0xfd4c73){_0xadae82=_0xfd4c73;_0xd0eac4['model']=_[_0x4ce3('0x43')](db['ZohoField'][_0x4ce3('0x2a')]);_0xd0eac4[_0x4ce3('0x2f')]=_[_0x4ce3('0x43')](_0x3e496b['query']);_0xd0eac4[_0x4ce3('0x30')]=_[_0x4ce3('0x31')](_0xd0eac4[_0x4ce3('0x2d')],_0xd0eac4[_0x4ce3('0x2f')]);_0x24f771[_0x4ce3('0x32')]=_['intersection'](_0xd0eac4[_0x4ce3('0x2d')],qs[_0x4ce3('0x33')](_0x3e496b[_0x4ce3('0x2f')][_0x4ce3('0x33')]));_0x24f771[_0x4ce3('0x32')]=_0x24f771[_0x4ce3('0x32')][_0x4ce3('0x34')]?_0x24f771[_0x4ce3('0x32')]:_0xd0eac4['model'];_0x24f771[_0x4ce3('0x37')]=qs['sort'](_0x3e496b[_0x4ce3('0x2f')][_0x4ce3('0x38')]);_0x24f771[_0x4ce3('0x39')]=qs[_0x4ce3('0x30')](_[_0x4ce3('0x3a')](_0x3e496b[_0x4ce3('0x2f')],_0xd0eac4[_0x4ce3('0x30')]));if(_0x3e496b[_0x4ce3('0x2f')][_0x4ce3('0x3d')]){_0x24f771[_0x4ce3('0x39')]=_[_0x4ce3('0x3b')](_0x24f771[_0x4ce3('0x39')],{'$or':_[_0x4ce3('0x2e')](_0x24f771[_0x4ce3('0x32')],function(_0x383690){var _0x17417f={};_0x17417f[_0x383690]={'$like':'%'+_0x3e496b['query'][_0x4ce3('0x3d')]+'%'};return _0x17417f;})});}_0x24f771=_['merge']({},_0x24f771,_0x3e496b[_0x4ce3('0x44')]);return _0xadae82[_0x4ce3('0x4c')](_0x24f771);}})[_0x4ce3('0x23')](function(_0x44f831){if(_0x44f831){_0x12e4be=_0x44f831[_0x4ce3('0x34')];if(!_0x3e496b[_0x4ce3('0x2f')]['hasOwnProperty']('nolimit')){_0x24f771['limit']=qs[_0x4ce3('0x1d')](_0x3e496b[_0x4ce3('0x2f')]['limit']);_0x24f771['offset']=qs['offset'](_0x3e496b[_0x4ce3('0x2f')]['offset']);}return _0xadae82['getDescriptions'](_0x24f771);}})[_0x4ce3('0x23')](function(_0x332b5f){if(_0x332b5f){return _0x332b5f?{'count':_0x12e4be,'rows':_0x332b5f}:null;}})[_0x4ce3('0x23')](respondWithResult(_0x2d7565,null))[_0x4ce3('0x41')](handleError(_0x2d7565,null));}; \ No newline at end of file +var _0x027a=['query','keys','intersection','attributes','fields','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','getFields','findOne','params','ZohoField','sort','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../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','json','apply','save','update','destroy','then','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map'];(function(_0x34b0d3,_0x55b139){var _0x37c298=function(_0x1678cc){while(--_0x1678cc){_0x34b0d3['push'](_0x34b0d3['shift']());}};_0x37c298(++_0x55b139);}(_0x027a,0xbc));var _0xa027=function(_0x588a2a,_0x2dd576){_0x588a2a=_0x588a2a-0x0;var _0x213584=_0x027a[_0x588a2a];return _0x213584;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa027('0x0'));var zipdir=require(_0xa027('0x1'));var jsonpatch=require(_0xa027('0x2'));var rp=require(_0xa027('0x3'));var moment=require(_0xa027('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa027('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa027('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa027('0x7'));var _=require(_0xa027('0x8'));var squel=require('squel');var crypto=require(_0xa027('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa027('0xa'));var toCsv=require(_0xa027('0x6'));var querystring=require(_0xa027('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa027('0xc'));var as=require(_0xa027('0xd'));var hardwareService=require(_0xa027('0xe'));var logger=require(_0xa027('0xf'))(_0xa027('0x10'));var utils=require(_0xa027('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa027('0x12'));var db=require(_0xa027('0x13'))['db'];function respondWithStatusCode(_0x1227d3,_0x3a8bd2){_0x3a8bd2=_0x3a8bd2||0xcc;return function(_0x45abc9){if(_0x45abc9){return _0x1227d3[_0xa027('0x14')](_0x3a8bd2);}return _0x1227d3[_0xa027('0x15')](_0x3a8bd2)[_0xa027('0x16')]();};}function respondWithResult(_0x31d112,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x17bdd0){if(_0x17bdd0){return _0x31d112[_0xa027('0x15')](_0x3e0e54)['json'](_0x17bdd0);}};}function respondWithFilteredResult(_0x1c4354,_0x1b5472){return function(_0xacb792){if(_0xacb792){var _0x7d666=typeof _0x1b5472['offset']===_0xa027('0x17')&&typeof _0x1b5472[_0xa027('0x18')]===_0xa027('0x17');var _0x7b7b8b=_0xacb792[_0xa027('0x19')];var _0x54383d=_0x7d666?0x0:_0x1b5472[_0xa027('0x1a')];var _0x1e2d89=_0x7d666?_0xacb792[_0xa027('0x19')]:_0x1b5472['offset']+_0x1b5472[_0xa027('0x18')];var _0x593b33;if(_0x1e2d89>=_0x7b7b8b){_0x1e2d89=_0x7b7b8b;_0x593b33=0xc8;}else{_0x593b33=0xce;}_0x1c4354[_0xa027('0x15')](_0x593b33);return _0x1c4354[_0xa027('0x1b')]('Content-Range',_0x54383d+'-'+_0x1e2d89+'/'+_0x7b7b8b)[_0xa027('0x1c')](_0xacb792);}return null;};}function patchUpdates(_0x2ffcd8){return function(_0x5ecfc3){try{jsonpatch[_0xa027('0x1d')](_0x5ecfc3,_0x2ffcd8,!![]);}catch(_0x475dbd){return BPromise['reject'](_0x475dbd);}return _0x5ecfc3[_0xa027('0x1e')]();};}function saveUpdates(_0xcf12da,_0x7d6c5){return function(_0x43f1dc){if(_0x43f1dc){return _0x43f1dc[_0xa027('0x1f')](_0xcf12da)['then'](function(_0xfd4396){return _0xfd4396;});}return null;};}function removeEntity(_0x549392,_0x475f2e){return function(_0x2f0434){if(_0x2f0434){return _0x2f0434[_0xa027('0x20')]()[_0xa027('0x21')](function(){_0x549392[_0xa027('0x15')](0xcc)[_0xa027('0x16')]();});}};}function handleEntityNotFound(_0x3273a3,_0x462303){return function(_0x20746d){if(!_0x20746d){_0x3273a3[_0xa027('0x14')](0x194);}return _0x20746d;};}function handleError(_0x4914d4,_0x3c28d7){_0x3c28d7=_0x3c28d7||0x1f4;return function(_0x2b47ab){logger[_0xa027('0x22')](_0x2b47ab[_0xa027('0x23')]);if(_0x2b47ab[_0xa027('0x24')]){delete _0x2b47ab[_0xa027('0x24')];}_0x4914d4[_0xa027('0x15')](_0x3c28d7)[_0xa027('0x25')](_0x2b47ab);};}exports[_0xa027('0x26')]=function(_0x59e033,_0x5ca7d5){var _0x2ca4ae={},_0x5a4c86={},_0x52b33f={'count':0x0,'rows':[]};var _0x407681=_['map'](db[_0xa027('0x27')][_0xa027('0x28')],function(_0x17477c){return{'name':_0x17477c[_0xa027('0x29')],'type':_0x17477c[_0xa027('0x2a')][_0xa027('0x2b')]};});_0x5a4c86[_0xa027('0x2c')]=_[_0xa027('0x2d')](_0x407681,_0xa027('0x24'));_0x5a4c86[_0xa027('0x2e')]=_[_0xa027('0x2f')](_0x59e033[_0xa027('0x2e')]);_0x5a4c86['filters']=_[_0xa027('0x30')](_0x5a4c86[_0xa027('0x2c')],_0x5a4c86[_0xa027('0x2e')]);_0x2ca4ae[_0xa027('0x31')]=_[_0xa027('0x30')](_0x5a4c86[_0xa027('0x2c')],qs[_0xa027('0x32')](_0x59e033[_0xa027('0x2e')][_0xa027('0x32')]));_0x2ca4ae['attributes']=_0x2ca4ae[_0xa027('0x31')]['length']?_0x2ca4ae['attributes']:_0x5a4c86[_0xa027('0x2c')];if(!_0x59e033[_0xa027('0x2e')]['hasOwnProperty'](_0xa027('0x33'))){_0x2ca4ae['limit']=qs['limit'](_0x59e033[_0xa027('0x2e')]['limit']);_0x2ca4ae[_0xa027('0x1a')]=qs['offset'](_0x59e033[_0xa027('0x2e')][_0xa027('0x1a')]);}_0x2ca4ae[_0xa027('0x34')]=qs['sort'](_0x59e033[_0xa027('0x2e')]['sort']);_0x2ca4ae['where']=qs[_0xa027('0x35')](_[_0xa027('0x36')](_0x59e033[_0xa027('0x2e')],_0x5a4c86[_0xa027('0x35')]),_0x407681);if(_0x59e033[_0xa027('0x2e')][_0xa027('0x37')]){_0x2ca4ae[_0xa027('0x38')]=_[_0xa027('0x39')](_0x2ca4ae[_0xa027('0x38')],{'$or':_[_0xa027('0x2d')](_0x407681,function(_0xc04f84){if(_0xc04f84[_0xa027('0x2a')]!==_0xa027('0x3a')){var _0x3becab={};_0x3becab[_0xc04f84['name']]={'$like':'%'+_0x59e033[_0xa027('0x2e')][_0xa027('0x37')]+'%'};return _0x3becab;}})});}_0x2ca4ae=_[_0xa027('0x39')]({},_0x2ca4ae,_0x59e033[_0xa027('0x3b')]);var _0x3bff63={'where':_0x2ca4ae[_0xa027('0x38')]};return db[_0xa027('0x27')][_0xa027('0x19')](_0x3bff63)[_0xa027('0x21')](function(_0x5b65ab){_0x52b33f[_0xa027('0x19')]=_0x5b65ab;if(_0x59e033[_0xa027('0x2e')]['includeAll']){_0x2ca4ae[_0xa027('0x3c')]=[{'all':!![]}];}return db[_0xa027('0x27')][_0xa027('0x3d')](_0x2ca4ae);})['then'](function(_0x455a70){_0x52b33f[_0xa027('0x3e')]=_0x455a70;return _0x52b33f;})[_0xa027('0x21')](respondWithFilteredResult(_0x5ca7d5,_0x2ca4ae))[_0xa027('0x3f')](handleError(_0x5ca7d5,null));};exports[_0xa027('0x40')]=function(_0x1ed4b7,_0x2634fb){var _0x21d6cc={'raw':![],'where':{'id':_0x1ed4b7['params']['id']}},_0x5b04e0={};_0x5b04e0[_0xa027('0x2c')]=_[_0xa027('0x2f')](db[_0xa027('0x27')][_0xa027('0x28')]);_0x5b04e0[_0xa027('0x2e')]=_[_0xa027('0x2f')](_0x1ed4b7[_0xa027('0x2e')]);_0x5b04e0[_0xa027('0x35')]=_['intersection'](_0x5b04e0[_0xa027('0x2c')],_0x5b04e0['query']);_0x21d6cc[_0xa027('0x31')]=_[_0xa027('0x30')](_0x5b04e0['model'],qs[_0xa027('0x32')](_0x1ed4b7[_0xa027('0x2e')][_0xa027('0x32')]));_0x21d6cc[_0xa027('0x31')]=_0x21d6cc[_0xa027('0x31')][_0xa027('0x41')]?_0x21d6cc[_0xa027('0x31')]:_0x5b04e0[_0xa027('0x2c')];if(_0x1ed4b7[_0xa027('0x2e')][_0xa027('0x42')]){_0x21d6cc['include']=[{'all':!![]}];}_0x21d6cc=_['merge']({},_0x21d6cc,_0x1ed4b7[_0xa027('0x3b')]);return db[_0xa027('0x27')][_0xa027('0x43')](_0x21d6cc)['then'](handleEntityNotFound(_0x2634fb,null))['then'](respondWithResult(_0x2634fb,null))[_0xa027('0x3f')](handleError(_0x2634fb,null));};exports['create']=function(_0x405a2d,_0x58e223){return db[_0xa027('0x27')][_0xa027('0x44')](_0x405a2d[_0xa027('0x45')],{})['then'](respondWithResult(_0x58e223,0xc9))[_0xa027('0x3f')](handleError(_0x58e223,null));};exports['update']=function(_0x37ce4d,_0x2707f0){if(_0x37ce4d[_0xa027('0x45')]['id']){delete _0x37ce4d[_0xa027('0x45')]['id'];}return db[_0xa027('0x27')][_0xa027('0x43')]({'where':{'id':_0x37ce4d['params']['id']}})[_0xa027('0x21')](handleEntityNotFound(_0x2707f0,null))[_0xa027('0x21')](saveUpdates(_0x37ce4d[_0xa027('0x45')],null))[_0xa027('0x21')](respondWithResult(_0x2707f0,null))[_0xa027('0x3f')](handleError(_0x2707f0,null));};exports[_0xa027('0x20')]=function(_0x5f06e3,_0x2cd6c2){return db[_0xa027('0x27')][_0xa027('0x43')]({'where':{'id':_0x5f06e3['params']['id']}})[_0xa027('0x21')](handleEntityNotFound(_0x2cd6c2,null))[_0xa027('0x21')](removeEntity(_0x2cd6c2,null))[_0xa027('0x3f')](handleError(_0x2cd6c2,null));};exports[_0xa027('0x46')]=function(_0x195853,_0xe80b6e,_0xad813c){var _0x5d1126={};var _0x1337f7={};var _0x1dd1ee;var _0x14c88f;return db['ZohoConfiguration'][_0xa027('0x47')]({'where':{'id':_0x195853[_0xa027('0x48')]['id']}})[_0xa027('0x21')](handleEntityNotFound(_0xe80b6e,null))[_0xa027('0x21')](function(_0x30a659){if(_0x30a659){_0x1dd1ee=_0x30a659;_0x1337f7[_0xa027('0x2c')]=_[_0xa027('0x2f')](db[_0xa027('0x49')][_0xa027('0x28')]);_0x1337f7[_0xa027('0x2e')]=_[_0xa027('0x2f')](_0x195853[_0xa027('0x2e')]);_0x1337f7[_0xa027('0x35')]=_[_0xa027('0x30')](_0x1337f7['model'],_0x1337f7[_0xa027('0x2e')]);_0x5d1126[_0xa027('0x31')]=_[_0xa027('0x30')](_0x1337f7[_0xa027('0x2c')],qs[_0xa027('0x32')](_0x195853[_0xa027('0x2e')][_0xa027('0x32')]));_0x5d1126[_0xa027('0x31')]=_0x5d1126[_0xa027('0x31')][_0xa027('0x41')]?_0x5d1126['attributes']:_0x1337f7['model'];_0x5d1126[_0xa027('0x34')]=qs[_0xa027('0x4a')](_0x195853['query'][_0xa027('0x4a')]);_0x5d1126[_0xa027('0x38')]=qs[_0xa027('0x35')](_[_0xa027('0x36')](_0x195853[_0xa027('0x2e')],_0x1337f7[_0xa027('0x35')]));if(_0x195853[_0xa027('0x2e')][_0xa027('0x37')]){_0x5d1126['where']=_['merge'](_0x5d1126[_0xa027('0x38')],{'$or':_[_0xa027('0x2d')](_0x5d1126[_0xa027('0x31')],function(_0x5bce76){var _0x4f3627={};_0x4f3627[_0x5bce76]={'$like':'%'+_0x195853[_0xa027('0x2e')][_0xa027('0x37')]+'%'};return _0x4f3627;})});}_0x5d1126=_[_0xa027('0x39')]({},_0x5d1126,_0x195853[_0xa027('0x3b')]);return _0x1dd1ee[_0xa027('0x46')](_0x5d1126);}})[_0xa027('0x21')](function(_0x5b6084){if(_0x5b6084){_0x14c88f=_0x5b6084[_0xa027('0x41')];if(!_0x195853[_0xa027('0x2e')][_0xa027('0x4b')](_0xa027('0x33'))){_0x5d1126[_0xa027('0x18')]=qs[_0xa027('0x18')](_0x195853[_0xa027('0x2e')]['limit']);_0x5d1126[_0xa027('0x1a')]=qs[_0xa027('0x1a')](_0x195853[_0xa027('0x2e')]['offset']);}return _0x1dd1ee['getFields'](_0x5d1126);}})[_0xa027('0x21')](function(_0x53682e){if(_0x53682e){return _0x53682e?{'count':_0x14c88f,'rows':_0x53682e}:null;}})[_0xa027('0x21')](respondWithResult(_0xe80b6e,null))[_0xa027('0x3f')](handleError(_0xe80b6e,null));};exports[_0xa027('0x4c')]=function(_0xca08a2,_0x7402cc,_0x305a9b){var _0x43f049={};var _0x555ea6={};var _0x548597;var _0x4a3965;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xca08a2[_0xa027('0x48')]['id']}})[_0xa027('0x21')](handleEntityNotFound(_0x7402cc,null))['then'](function(_0x7d38f){if(_0x7d38f){_0x548597=_0x7d38f;_0x555ea6[_0xa027('0x2c')]=_[_0xa027('0x2f')](db[_0xa027('0x49')][_0xa027('0x28')]);_0x555ea6['query']=_[_0xa027('0x2f')](_0xca08a2[_0xa027('0x2e')]);_0x555ea6[_0xa027('0x35')]=_[_0xa027('0x30')](_0x555ea6[_0xa027('0x2c')],_0x555ea6['query']);_0x43f049[_0xa027('0x31')]=_[_0xa027('0x30')](_0x555ea6['model'],qs['fields'](_0xca08a2['query'][_0xa027('0x32')]));_0x43f049[_0xa027('0x31')]=_0x43f049['attributes'][_0xa027('0x41')]?_0x43f049[_0xa027('0x31')]:_0x555ea6['model'];_0x43f049[_0xa027('0x34')]=qs['sort'](_0xca08a2[_0xa027('0x2e')][_0xa027('0x4a')]);_0x43f049['where']=qs[_0xa027('0x35')](_['pick'](_0xca08a2[_0xa027('0x2e')],_0x555ea6[_0xa027('0x35')]));if(_0xca08a2['query']['filter']){_0x43f049['where']=_[_0xa027('0x39')](_0x43f049['where'],{'$or':_['map'](_0x43f049['attributes'],function(_0x232c7){var _0x3b278b={};_0x3b278b[_0x232c7]={'$like':'%'+_0xca08a2[_0xa027('0x2e')][_0xa027('0x37')]+'%'};return _0x3b278b;})});}_0x43f049=_['merge']({},_0x43f049,_0xca08a2[_0xa027('0x3b')]);return _0x548597[_0xa027('0x4c')](_0x43f049);}})['then'](function(_0x8849e6){if(_0x8849e6){_0x4a3965=_0x8849e6['length'];if(!_0xca08a2['query']['hasOwnProperty'](_0xa027('0x33'))){_0x43f049[_0xa027('0x18')]=qs[_0xa027('0x18')](_0xca08a2[_0xa027('0x2e')][_0xa027('0x18')]);_0x43f049['offset']=qs[_0xa027('0x1a')](_0xca08a2[_0xa027('0x2e')][_0xa027('0x1a')]);}return _0x548597[_0xa027('0x4c')](_0x43f049);}})[_0xa027('0x21')](function(_0x239f76){if(_0x239f76){return _0x239f76?{'count':_0x4a3965,'rows':_0x239f76}:null;}})[_0xa027('0x21')](respondWithResult(_0x7402cc,null))[_0xa027('0x3f')](handleError(_0x7402cc,null));};exports[_0xa027('0x4d')]=function(_0x1df478,_0x3f5123,_0x127818){var _0x4759de={};var _0x1f8157={};var _0x45a374;var _0x44b3c1;return db[_0xa027('0x27')][_0xa027('0x47')]({'where':{'id':_0x1df478[_0xa027('0x48')]['id']}})[_0xa027('0x21')](handleEntityNotFound(_0x3f5123,null))['then'](function(_0x47f5e7){if(_0x47f5e7){_0x45a374=_0x47f5e7;_0x1f8157[_0xa027('0x2c')]=_[_0xa027('0x2f')](db[_0xa027('0x49')][_0xa027('0x28')]);_0x1f8157['query']=_[_0xa027('0x2f')](_0x1df478[_0xa027('0x2e')]);_0x1f8157['filters']=_[_0xa027('0x30')](_0x1f8157[_0xa027('0x2c')],_0x1f8157[_0xa027('0x2e')]);_0x4759de[_0xa027('0x31')]=_[_0xa027('0x30')](_0x1f8157[_0xa027('0x2c')],qs[_0xa027('0x32')](_0x1df478[_0xa027('0x2e')][_0xa027('0x32')]));_0x4759de[_0xa027('0x31')]=_0x4759de[_0xa027('0x31')][_0xa027('0x41')]?_0x4759de[_0xa027('0x31')]:_0x1f8157['model'];_0x4759de[_0xa027('0x34')]=qs['sort'](_0x1df478[_0xa027('0x2e')]['sort']);_0x4759de[_0xa027('0x38')]=qs[_0xa027('0x35')](_[_0xa027('0x36')](_0x1df478[_0xa027('0x2e')],_0x1f8157[_0xa027('0x35')]));if(_0x1df478[_0xa027('0x2e')][_0xa027('0x37')]){_0x4759de[_0xa027('0x38')]=_[_0xa027('0x39')](_0x4759de[_0xa027('0x38')],{'$or':_[_0xa027('0x2d')](_0x4759de[_0xa027('0x31')],function(_0x222714){var _0x598aec={};_0x598aec[_0x222714]={'$like':'%'+_0x1df478[_0xa027('0x2e')][_0xa027('0x37')]+'%'};return _0x598aec;})});}_0x4759de=_[_0xa027('0x39')]({},_0x4759de,_0x1df478['options']);return _0x45a374[_0xa027('0x4d')](_0x4759de);}})[_0xa027('0x21')](function(_0x54b15e){if(_0x54b15e){_0x44b3c1=_0x54b15e[_0xa027('0x41')];if(!_0x1df478['query']['hasOwnProperty'](_0xa027('0x33'))){_0x4759de[_0xa027('0x18')]=qs['limit'](_0x1df478[_0xa027('0x2e')]['limit']);_0x4759de['offset']=qs['offset'](_0x1df478[_0xa027('0x2e')][_0xa027('0x1a')]);}return _0x45a374['getDescriptions'](_0x4759de);}})['then'](function(_0x57e3d4){if(_0x57e3d4){return _0x57e3d4?{'count':_0x44b3c1,'rows':_0x57e3d4}:null;}})[_0xa027('0x21')](respondWithResult(_0x3f5123,null))[_0xa027('0x3f')](handleError(_0x3f5123,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index fed1f5b..0d29de3 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 _0xfa52=['int_zoho_configurations','lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports','define','ZohoConfiguration'];(function(_0x4b7db0,_0x4de404){var _0x57ae37=function(_0x25505c){while(--_0x25505c){_0x4b7db0['push'](_0x4b7db0['shift']());}};_0x57ae37(++_0x4de404);}(_0xfa52,0x1b9));var _0x2fa5=function(_0x3e124d,_0x32f252){_0x3e124d=_0x3e124d-0x0;var _0x4e6bab=_0xfa52[_0x3e124d];return _0x4e6bab;};'use strict';var _=require(_0x2fa5('0x0'));var util=require(_0x2fa5('0x1'));var logger=require('../../config/logger')(_0x2fa5('0x2'));var moment=require(_0x2fa5('0x3'));var BPromise=require(_0x2fa5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2fa5('0x5'));var config=require(_0x2fa5('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x2fa5('0x7')]=function(_0x1e3935,_0x49cd60){return _0x1e3935[_0x2fa5('0x8')](_0x2fa5('0x9'),attributes,{'tableName':_0x2fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7014=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x7014,0x17d));var _0x4701=function(_0x4494b6,_0x1d0ef0){_0x4494b6=_0x4494b6-0x0;var _0x4c2499=_0x7014[_0x4494b6];return _0x4c2499;};'use strict';var _=require(_0x4701('0x0'));var util=require(_0x4701('0x1'));var logger=require(_0x4701('0x2'))(_0x4701('0x3'));var moment=require(_0x4701('0x4'));var BPromise=require(_0x4701('0x5'));var rp=require(_0x4701('0x6'));var fs=require('fs');var path=require(_0x4701('0x7'));var rimraf=require(_0x4701('0x8'));var config=require('../../config/environment');var attributes=require(_0x4701('0x9'));module[_0x4701('0xa')]=function(_0x5effc9,_0xc230){return _0x5effc9[_0x4701('0xb')](_0x4701('0xc'),attributes,{'tableName':_0x4701('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 5ecc8de..585f939 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 _0x0c61=['info','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0c61,0x1be));var _0x10c6=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0x0c61[_0x4e9274];return _0x8b474c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x10c6('0x0'));var BPromise=require(_0x10c6('0x1'));var rs=require(_0x10c6('0x2'));var fs=require('fs');var Redis=require(_0x10c6('0x3'));var db=require(_0x10c6('0x4'))['db'];var utils=require(_0x10c6('0x5'));var logger=require(_0x10c6('0x6'))('rpc');var config=require(_0x10c6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x430f70,_0x218674,_0xaa976d){return new BPromise(function(_0x6f0274,_0x227f9a){return client[_0x10c6('0x8')](_0x430f70,_0xaa976d)[_0x10c6('0x9')](function(_0x3511d8){logger[_0x10c6('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x218674,_0x10c6('0xb'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x218674,'request\x20sent',JSON[_0x10c6('0xc')](_0x3511d8));if(_0x3511d8[_0x10c6('0xd')]){if(_0x3511d8[_0x10c6('0xd')][_0x10c6('0xe')]===0x1f4){logger['error'](_0x10c6('0xf'),_0x218674,_0x3511d8[_0x10c6('0xd')][_0x10c6('0x10')]);return _0x227f9a(_0x3511d8['error'][_0x10c6('0x10')]);}logger[_0x10c6('0xd')](_0x10c6('0xf'),_0x218674,_0x3511d8[_0x10c6('0xd')][_0x10c6('0x10')]);return _0x6f0274(_0x3511d8[_0x10c6('0xd')][_0x10c6('0x10')]);}else{logger[_0x10c6('0xa')](_0x10c6('0xf'),_0x218674,_0x10c6('0xb'));_0x6f0274(_0x3511d8[_0x10c6('0x11')]['message']);}})[_0x10c6('0x12')](function(_0x4fa14f){logger['error'](_0x10c6('0xf'),_0x218674,_0x4fa14f);_0x227f9a(_0x4fa14f);});});} \ No newline at end of file +var _0x3cee=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xf25b33,_0x3bf60e){var _0x10802f=function(_0x455b33){while(--_0x455b33){_0xf25b33['push'](_0xf25b33['shift']());}};_0x10802f(++_0x3bf60e);}(_0x3cee,0x18b));var _0xe3ce=function(_0x42985c,_0x3dc032){_0x42985c=_0x42985c-0x0;var _0x3cdfd3=_0x3cee[_0x42985c];return _0x3cdfd3;};'use strict';var _=require(_0xe3ce('0x0'));var util=require(_0xe3ce('0x1'));var moment=require(_0xe3ce('0x2'));var BPromise=require(_0xe3ce('0x3'));var rs=require(_0xe3ce('0x4'));var fs=require('fs');var Redis=require(_0xe3ce('0x5'));var db=require(_0xe3ce('0x6'))['db'];var utils=require(_0xe3ce('0x7'));var logger=require(_0xe3ce('0x8'))(_0xe3ce('0x9'));var config=require(_0xe3ce('0xa'));var jayson=require(_0xe3ce('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x272a3b,_0x5ce6a2,_0x1514f6){return new BPromise(function(_0x36b28e,_0x4d88ac){return client[_0xe3ce('0xc')](_0x272a3b,_0x1514f6)['then'](function(_0x5e5a0f){logger[_0xe3ce('0xd')](_0xe3ce('0xe'),_0x5ce6a2,_0xe3ce('0xf'));logger[_0xe3ce('0x10')](_0xe3ce('0x11'),_0x5ce6a2,_0xe3ce('0xf'),JSON['stringify'](_0x5e5a0f));if(_0x5e5a0f['error']){if(_0x5e5a0f[_0xe3ce('0x12')][_0xe3ce('0x13')]===0x1f4){logger[_0xe3ce('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ce6a2,_0x5e5a0f[_0xe3ce('0x12')][_0xe3ce('0x14')]);return _0x4d88ac(_0x5e5a0f[_0xe3ce('0x12')][_0xe3ce('0x14')]);}logger[_0xe3ce('0x12')](_0xe3ce('0xe'),_0x5ce6a2,_0x5e5a0f[_0xe3ce('0x12')]['message']);return _0x36b28e(_0x5e5a0f[_0xe3ce('0x12')][_0xe3ce('0x14')]);}else{logger['info'](_0xe3ce('0xe'),_0x5ce6a2,_0xe3ce('0xf'));_0x36b28e(_0x5e5a0f[_0xe3ce('0x15')][_0xe3ce('0x14')]);}})[_0xe3ce('0x16')](function(_0x1df55f){logger[_0xe3ce('0x12')](_0xe3ce('0xe'),_0x5ce6a2,_0x1df55f);_0x4d88ac(_0x1df55f);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 8c10123..3186bf0 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 _0xc09a=['exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','index','/:id','isAuthenticated','show','create','put','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc09a,0x166));var _0xac09=function(_0x5f5cca,_0x1b9e3d){_0x5f5cca=_0x5f5cca-0x0;var _0xbc60fb=_0xc09a[_0x5f5cca];return _0xbc60fb;};'use strict';var multer=require(_0xac09('0x0'));var util=require(_0xac09('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac09('0x2'));var router=express[_0xac09('0x3')]();var fs_extra=require(_0xac09('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac09('0x5'));var config=require('../../config/environment');var controller=require(_0xac09('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xac09('0x7')]);router['get'](_0xac09('0x8'),auth[_0xac09('0x9')](),controller[_0xac09('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac09('0xb')]);router[_0xac09('0xc')](_0xac09('0x8'),auth[_0xac09('0x9')](),controller[_0xac09('0xd')]);router[_0xac09('0xe')](_0xac09('0x8'),auth[_0xac09('0x9')](),controller[_0xac09('0xf')]);module[_0xac09('0x10')]=router; \ No newline at end of file +var _0x8d8c=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','create','delete','destroy'];(function(_0x23f7cb,_0x55ed6){var _0xab3f79=function(_0x1ce42d){while(--_0x1ce42d){_0x23f7cb['push'](_0x23f7cb['shift']());}};_0xab3f79(++_0x55ed6);}(_0x8d8c,0xe1));var _0xc8d8=function(_0x576297,_0xf0286a){_0x576297=_0x576297-0x0;var _0x4e8e98=_0x8d8c[_0x576297];return _0x4e8e98;};'use strict';var multer=require(_0xc8d8('0x0'));var util=require(_0xc8d8('0x1'));var path=require(_0xc8d8('0x2'));var timeout=require('connect-timeout');var express=require(_0xc8d8('0x3'));var router=express[_0xc8d8('0x4')]();var fs_extra=require(_0xc8d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc8d8('0x6'));var config=require(_0xc8d8('0x7'));var controller=require(_0xc8d8('0x8'));router[_0xc8d8('0x9')]('/',auth[_0xc8d8('0xa')](),controller['index']);router[_0xc8d8('0x9')](_0xc8d8('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc8d8('0xc')]);router['put'](_0xc8d8('0xb'),auth[_0xc8d8('0xa')](),controller['update']);router[_0xc8d8('0xd')](_0xc8d8('0xb'),auth[_0xc8d8('0xa')](),controller[_0xc8d8('0xe')]);module[_0xc8d8('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index aca997f..d94e5e6 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 _0xd209=['string','customVariable','keyValue','picklist','STRING','sequelize','ENUM'];(function(_0x25f8cb,_0x42b8dd){var _0x2c038c=function(_0x5e81d0){while(--_0x5e81d0){_0x25f8cb['push'](_0x25f8cb['shift']());}};_0x2c038c(++_0x42b8dd);}(_0xd209,0x1c5));var _0x9d20=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd209[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x9d20('0x0'));module['exports']={'type':{'type':Sequelize[_0x9d20('0x1')](_0x9d20('0x2'),'variable',_0x9d20('0x3'),_0x9d20('0x4'),_0x9d20('0x5')),'defaultValue':_0x9d20('0x2')},'content':{'type':Sequelize[_0x9d20('0x6')]},'key':{'type':Sequelize[_0x9d20('0x6')]},'keyType':{'type':Sequelize[_0x9d20('0x1')]('string','variable',_0x9d20('0x3'))},'keyContent':{'type':Sequelize[_0x9d20('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9d20('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d20('0x6')]}}; \ No newline at end of file +var _0x72eb=['variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING'];(function(_0xed5a6d,_0x3b1054){var _0x226e91=function(_0x304add){while(--_0x304add){_0xed5a6d['push'](_0xed5a6d['shift']());}};_0x226e91(++_0x3b1054);}(_0x72eb,0xfd));var _0xb72e=function(_0x914c29,_0x5e5bae){_0x914c29=_0x914c29-0x0;var _0x5a9321=_0x72eb[_0x914c29];return _0x5a9321;};'use strict';var Sequelize=require(_0xb72e('0x0'));module[_0xb72e('0x1')]={'type':{'type':Sequelize[_0xb72e('0x2')](_0xb72e('0x3'),'variable','customVariable',_0xb72e('0x4'),_0xb72e('0x5')),'defaultValue':_0xb72e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb72e('0x6')]},'keyType':{'type':Sequelize[_0xb72e('0x2')](_0xb72e('0x3'),_0xb72e('0x7'),_0xb72e('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb72e('0x6')]},'nameField':{'type':Sequelize[_0xb72e('0x6')]},'customField':{'type':Sequelize[_0xb72e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb72e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2a3478b..9551ca5 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 _0x39b3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x82dafb,_0x3b5f11){var _0x4a5d60=function(_0x1b90cc){while(--_0x1b90cc){_0x82dafb['push'](_0x82dafb['shift']());}};_0x4a5d60(++_0x3b5f11);}(_0x39b3,0x1eb));var _0x339b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x39b3[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0x339b('0x0'));var rimraf=require(_0x339b('0x1'));var zipdir=require(_0x339b('0x2'));var jsonpatch=require(_0x339b('0x3'));var rp=require('request-promise');var moment=require(_0x339b('0x4'));var BPromise=require(_0x339b('0x5'));var Mustache=require('mustache');var util=require(_0x339b('0x6'));var path=require(_0x339b('0x7'));var sox=require(_0x339b('0x8'));var csv=require(_0x339b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x339b('0xa'));var _=require(_0x339b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x339b('0xc'));var toCsv=require(_0x339b('0x9'));var querystring=require(_0x339b('0xd'));var Papa=require('papaparse');var Redis=require(_0x339b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x339b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x339b('0x10'))(_0x339b('0x11'));var utils=require(_0x339b('0x12'));var config=require(_0x339b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x339b('0x14'))['db'];function respondWithStatusCode(_0x464777,_0x245cf3){_0x245cf3=_0x245cf3||0xcc;return function(_0x3653c7){if(_0x3653c7){return _0x464777[_0x339b('0x15')](_0x245cf3);}return _0x464777[_0x339b('0x16')](_0x245cf3)[_0x339b('0x17')]();};}function respondWithResult(_0x49e318,_0x567a70){_0x567a70=_0x567a70||0xc8;return function(_0x5894fd){if(_0x5894fd){return _0x49e318[_0x339b('0x16')](_0x567a70)[_0x339b('0x18')](_0x5894fd);}};}function respondWithFilteredResult(_0x1cea58,_0x13aac4){return function(_0x259299){if(_0x259299){var _0xad8d1e=typeof _0x13aac4[_0x339b('0x19')]===_0x339b('0x1a')&&typeof _0x13aac4[_0x339b('0x1b')]===_0x339b('0x1a');var _0x119e38=_0x259299[_0x339b('0x1c')];var _0x28652a=_0xad8d1e?0x0:_0x13aac4[_0x339b('0x19')];var _0x57797c=_0xad8d1e?_0x259299[_0x339b('0x1c')]:_0x13aac4['offset']+_0x13aac4['limit'];var _0x544913;if(_0x57797c>=_0x119e38){_0x57797c=_0x119e38;_0x544913=0xc8;}else{_0x544913=0xce;}_0x1cea58[_0x339b('0x16')](_0x544913);return _0x1cea58[_0x339b('0x1d')](_0x339b('0x1e'),_0x28652a+'-'+_0x57797c+'/'+_0x119e38)[_0x339b('0x18')](_0x259299);}return null;};}function patchUpdates(_0x1456b7){return function(_0x2ef5d1){try{jsonpatch[_0x339b('0x1f')](_0x2ef5d1,_0x1456b7,!![]);}catch(_0x12d1fc){return BPromise[_0x339b('0x20')](_0x12d1fc);}return _0x2ef5d1[_0x339b('0x21')]();};}function saveUpdates(_0x3d2546,_0x427857){return function(_0x3d3bd9){if(_0x3d3bd9){return _0x3d3bd9[_0x339b('0x22')](_0x3d2546)[_0x339b('0x23')](function(_0x1e08ed){return _0x1e08ed;});}return null;};}function removeEntity(_0x1cdf61,_0x4ee72d){return function(_0x5f3dc7){if(_0x5f3dc7){return _0x5f3dc7[_0x339b('0x24')]()[_0x339b('0x23')](function(){_0x1cdf61['status'](0xcc)[_0x339b('0x17')]();});}};}function handleEntityNotFound(_0x225727,_0x3fd8b1){return function(_0x5adc59){if(!_0x5adc59){_0x225727[_0x339b('0x15')](0x194);}return _0x5adc59;};}function handleError(_0x2d061b,_0x1cc2ae){_0x1cc2ae=_0x1cc2ae||0x1f4;return function(_0x398316){logger[_0x339b('0x25')](_0x398316['stack']);if(_0x398316[_0x339b('0x26')]){delete _0x398316['name'];}_0x2d061b[_0x339b('0x16')](_0x1cc2ae)[_0x339b('0x27')](_0x398316);};}exports[_0x339b('0x28')]=function(_0x45b34f,_0x1953f7){var _0x7a72d={},_0x47cd33={},_0xe2055b={'count':0x0,'rows':[]};var _0xa6af67=_[_0x339b('0x29')](db['ZohoField'][_0x339b('0x2a')],function(_0xbbe663){return{'name':_0xbbe663['fieldName'],'type':_0xbbe663[_0x339b('0x2b')][_0x339b('0x2c')]};});_0x47cd33['model']=_[_0x339b('0x29')](_0xa6af67,_0x339b('0x26'));_0x47cd33[_0x339b('0x2d')]=_['keys'](_0x45b34f[_0x339b('0x2d')]);_0x47cd33[_0x339b('0x2e')]=_['intersection'](_0x47cd33[_0x339b('0x2f')],_0x47cd33[_0x339b('0x2d')]);_0x7a72d['attributes']=_[_0x339b('0x30')](_0x47cd33[_0x339b('0x2f')],qs[_0x339b('0x31')](_0x45b34f[_0x339b('0x2d')][_0x339b('0x31')]));_0x7a72d[_0x339b('0x32')]=_0x7a72d['attributes'][_0x339b('0x33')]?_0x7a72d[_0x339b('0x32')]:_0x47cd33['model'];if(!_0x45b34f[_0x339b('0x2d')][_0x339b('0x34')](_0x339b('0x35'))){_0x7a72d[_0x339b('0x1b')]=qs[_0x339b('0x1b')](_0x45b34f[_0x339b('0x2d')][_0x339b('0x1b')]);_0x7a72d[_0x339b('0x19')]=qs[_0x339b('0x19')](_0x45b34f['query'][_0x339b('0x19')]);}_0x7a72d[_0x339b('0x36')]=qs[_0x339b('0x37')](_0x45b34f['query']['sort']);_0x7a72d[_0x339b('0x38')]=qs['filters'](_[_0x339b('0x39')](_0x45b34f[_0x339b('0x2d')],_0x47cd33[_0x339b('0x2e')]),_0xa6af67);if(_0x45b34f['query'][_0x339b('0x3a')]){_0x7a72d[_0x339b('0x38')]=_[_0x339b('0x3b')](_0x7a72d[_0x339b('0x38')],{'$or':_['map'](_0xa6af67,function(_0x6ec791){if(_0x6ec791['type']!==_0x339b('0x3c')){var _0x189d90={};_0x189d90[_0x6ec791[_0x339b('0x26')]]={'$like':'%'+_0x45b34f[_0x339b('0x2d')]['filter']+'%'};return _0x189d90;}})});}_0x7a72d=_['merge']({},_0x7a72d,_0x45b34f[_0x339b('0x3d')]);var _0x4a715b={'where':_0x7a72d[_0x339b('0x38')]};return db[_0x339b('0x3e')][_0x339b('0x1c')](_0x4a715b)[_0x339b('0x23')](function(_0x47e694){_0xe2055b[_0x339b('0x1c')]=_0x47e694;if(_0x45b34f[_0x339b('0x2d')][_0x339b('0x3f')]){_0x7a72d['include']=[{'all':!![]}];}return db['ZohoField'][_0x339b('0x40')](_0x7a72d);})['then'](function(_0x2f95fa){_0xe2055b[_0x339b('0x41')]=_0x2f95fa;return _0xe2055b;})[_0x339b('0x23')](respondWithFilteredResult(_0x1953f7,_0x7a72d))[_0x339b('0x42')](handleError(_0x1953f7,null));};exports[_0x339b('0x43')]=function(_0x5744a2,_0x5d7785){var _0x17a0fd={'raw':!![],'where':{'id':_0x5744a2['params']['id']}},_0x46e1d9={};_0x46e1d9[_0x339b('0x2f')]=_[_0x339b('0x44')](db[_0x339b('0x3e')]['rawAttributes']);_0x46e1d9[_0x339b('0x2d')]=_['keys'](_0x5744a2[_0x339b('0x2d')]);_0x46e1d9['filters']=_[_0x339b('0x30')](_0x46e1d9[_0x339b('0x2f')],_0x46e1d9['query']);_0x17a0fd[_0x339b('0x32')]=_['intersection'](_0x46e1d9[_0x339b('0x2f')],qs[_0x339b('0x31')](_0x5744a2['query'][_0x339b('0x31')]));_0x17a0fd[_0x339b('0x32')]=_0x17a0fd['attributes'][_0x339b('0x33')]?_0x17a0fd[_0x339b('0x32')]:_0x46e1d9[_0x339b('0x2f')];if(_0x5744a2[_0x339b('0x2d')][_0x339b('0x3f')]){_0x17a0fd['include']=[{'all':!![]}];}_0x17a0fd=_[_0x339b('0x3b')]({},_0x17a0fd,_0x5744a2[_0x339b('0x3d')]);return db[_0x339b('0x3e')][_0x339b('0x45')](_0x17a0fd)[_0x339b('0x23')](handleEntityNotFound(_0x5d7785,null))['then'](respondWithResult(_0x5d7785,null))[_0x339b('0x42')](handleError(_0x5d7785,null));};exports['create']=function(_0x55cc89,_0x10f53a){return db[_0x339b('0x3e')][_0x339b('0x46')](_0x55cc89['body'],{})[_0x339b('0x23')](respondWithResult(_0x10f53a,0xc9))[_0x339b('0x42')](handleError(_0x10f53a,null));};exports['update']=function(_0x2c77bd,_0x282b17){if(_0x2c77bd[_0x339b('0x47')]['id']){delete _0x2c77bd[_0x339b('0x47')]['id'];}return db[_0x339b('0x3e')]['find']({'where':{'id':_0x2c77bd[_0x339b('0x48')]['id']}})[_0x339b('0x23')](handleEntityNotFound(_0x282b17,null))[_0x339b('0x23')](saveUpdates(_0x2c77bd[_0x339b('0x47')],null))[_0x339b('0x23')](respondWithResult(_0x282b17,null))['catch'](handleError(_0x282b17,null));};exports[_0x339b('0x24')]=function(_0x16f51d,_0x19a500){return db['ZohoField'][_0x339b('0x45')]({'where':{'id':_0x16f51d[_0x339b('0x48')]['id']}})['then'](handleEntityNotFound(_0x19a500,null))[_0x339b('0x23')](removeEntity(_0x19a500,null))[_0x339b('0x42')](handleError(_0x19a500,null));}; \ No newline at end of file +var _0xb98d=['sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoField','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0xb98d,0x19d));var _0xdb98=function(_0x51b506,_0x1b60bf){_0x51b506=_0x51b506-0x0;var _0x33c41a=_0xb98d[_0x51b506];return _0x33c41a;};'use strict';var emlformat=require(_0xdb98('0x0'));var rimraf=require(_0xdb98('0x1'));var zipdir=require(_0xdb98('0x2'));var jsonpatch=require(_0xdb98('0x3'));var rp=require(_0xdb98('0x4'));var moment=require(_0xdb98('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdb98('0x6'));var path=require(_0xdb98('0x7'));var sox=require(_0xdb98('0x8'));var csv=require(_0xdb98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb98('0xa'));var _=require('lodash');var squel=require(_0xdb98('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb98('0xc'));var deskjs=require(_0xdb98('0xd'));var toCsv=require(_0xdb98('0x9'));var querystring=require(_0xdb98('0xe'));var Papa=require(_0xdb98('0xf'));var Redis=require(_0xdb98('0x10'));var authService=require(_0xdb98('0x11'));var qs=require(_0xdb98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb98('0x13'));var logger=require(_0xdb98('0x14'))('api');var utils=require(_0xdb98('0x15'));var config=require(_0xdb98('0x16'));var licenseUtil=require(_0xdb98('0x17'));var db=require(_0xdb98('0x18'))['db'];function respondWithStatusCode(_0x36025e,_0x2df1a5){_0x2df1a5=_0x2df1a5||0xcc;return function(_0x14e683){if(_0x14e683){return _0x36025e[_0xdb98('0x19')](_0x2df1a5);}return _0x36025e[_0xdb98('0x1a')](_0x2df1a5)[_0xdb98('0x1b')]();};}function respondWithResult(_0x2c9c06,_0x153363){_0x153363=_0x153363||0xc8;return function(_0x151ceb){if(_0x151ceb){return _0x2c9c06['status'](_0x153363)['json'](_0x151ceb);}};}function respondWithFilteredResult(_0xdada5e,_0x10643f){return function(_0x2fb856){if(_0x2fb856){var _0x2ff19a=typeof _0x10643f[_0xdb98('0x1c')]===_0xdb98('0x1d')&&typeof _0x10643f[_0xdb98('0x1e')]===_0xdb98('0x1d');var _0x189a8f=_0x2fb856[_0xdb98('0x1f')];var _0x4d62fc=_0x2ff19a?0x0:_0x10643f['offset'];var _0x5b01bc=_0x2ff19a?_0x2fb856[_0xdb98('0x1f')]:_0x10643f['offset']+_0x10643f['limit'];var _0xb496ad;if(_0x5b01bc>=_0x189a8f){_0x5b01bc=_0x189a8f;_0xb496ad=0xc8;}else{_0xb496ad=0xce;}_0xdada5e[_0xdb98('0x1a')](_0xb496ad);return _0xdada5e[_0xdb98('0x20')]('Content-Range',_0x4d62fc+'-'+_0x5b01bc+'/'+_0x189a8f)['json'](_0x2fb856);}return null;};}function patchUpdates(_0x281124){return function(_0x100961){try{jsonpatch[_0xdb98('0x21')](_0x100961,_0x281124,!![]);}catch(_0x27473d){return BPromise[_0xdb98('0x22')](_0x27473d);}return _0x100961[_0xdb98('0x23')]();};}function saveUpdates(_0x2fa6fe,_0x3ab0d5){return function(_0xe031c7){if(_0xe031c7){return _0xe031c7[_0xdb98('0x24')](_0x2fa6fe)[_0xdb98('0x25')](function(_0x513809){return _0x513809;});}return null;};}function removeEntity(_0x274b49,_0x4e6890){return function(_0x39024a){if(_0x39024a){return _0x39024a[_0xdb98('0x26')]()[_0xdb98('0x25')](function(){_0x274b49[_0xdb98('0x1a')](0xcc)[_0xdb98('0x1b')]();});}};}function handleEntityNotFound(_0x57bd08,_0x38b3e1){return function(_0x57b9f2){if(!_0x57b9f2){_0x57bd08[_0xdb98('0x19')](0x194);}return _0x57b9f2;};}function handleError(_0x456652,_0x232efe){_0x232efe=_0x232efe||0x1f4;return function(_0xbda95b){logger[_0xdb98('0x27')](_0xbda95b['stack']);if(_0xbda95b[_0xdb98('0x28')]){delete _0xbda95b[_0xdb98('0x28')];}_0x456652[_0xdb98('0x1a')](_0x232efe)[_0xdb98('0x29')](_0xbda95b);};}exports[_0xdb98('0x2a')]=function(_0x463c73,_0x1ad5af){var _0x34603e={},_0xc3ca81={},_0x253675={'count':0x0,'rows':[]};var _0x49c1d3=_[_0xdb98('0x2b')](db[_0xdb98('0x2c')]['rawAttributes'],function(_0x35eb2c){return{'name':_0x35eb2c['fieldName'],'type':_0x35eb2c[_0xdb98('0x2d')][_0xdb98('0x2e')]};});_0xc3ca81[_0xdb98('0x2f')]=_[_0xdb98('0x2b')](_0x49c1d3,_0xdb98('0x28'));_0xc3ca81[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x463c73[_0xdb98('0x30')]);_0xc3ca81['filters']=_[_0xdb98('0x32')](_0xc3ca81[_0xdb98('0x2f')],_0xc3ca81['query']);_0x34603e[_0xdb98('0x33')]=_[_0xdb98('0x32')](_0xc3ca81['model'],qs[_0xdb98('0x34')](_0x463c73[_0xdb98('0x30')][_0xdb98('0x34')]));_0x34603e[_0xdb98('0x33')]=_0x34603e[_0xdb98('0x33')][_0xdb98('0x35')]?_0x34603e[_0xdb98('0x33')]:_0xc3ca81['model'];if(!_0x463c73[_0xdb98('0x30')]['hasOwnProperty'](_0xdb98('0x36'))){_0x34603e['limit']=qs[_0xdb98('0x1e')](_0x463c73[_0xdb98('0x30')]['limit']);_0x34603e[_0xdb98('0x1c')]=qs[_0xdb98('0x1c')](_0x463c73[_0xdb98('0x30')][_0xdb98('0x1c')]);}_0x34603e[_0xdb98('0x37')]=qs[_0xdb98('0x38')](_0x463c73['query']['sort']);_0x34603e[_0xdb98('0x39')]=qs['filters'](_['pick'](_0x463c73[_0xdb98('0x30')],_0xc3ca81[_0xdb98('0x3a')]),_0x49c1d3);if(_0x463c73[_0xdb98('0x30')][_0xdb98('0x3b')]){_0x34603e[_0xdb98('0x39')]=_[_0xdb98('0x3c')](_0x34603e[_0xdb98('0x39')],{'$or':_['map'](_0x49c1d3,function(_0x585d61){if(_0x585d61[_0xdb98('0x2d')]!==_0xdb98('0x3d')){var _0x3263d7={};_0x3263d7[_0x585d61[_0xdb98('0x28')]]={'$like':'%'+_0x463c73[_0xdb98('0x30')]['filter']+'%'};return _0x3263d7;}})});}_0x34603e=_[_0xdb98('0x3c')]({},_0x34603e,_0x463c73[_0xdb98('0x3e')]);var _0x2854ce={'where':_0x34603e['where']};return db[_0xdb98('0x2c')][_0xdb98('0x1f')](_0x2854ce)[_0xdb98('0x25')](function(_0x1ff8c4){_0x253675[_0xdb98('0x1f')]=_0x1ff8c4;if(_0x463c73[_0xdb98('0x30')][_0xdb98('0x3f')]){_0x34603e[_0xdb98('0x40')]=[{'all':!![]}];}return db[_0xdb98('0x2c')][_0xdb98('0x41')](_0x34603e);})['then'](function(_0x5ccee1){_0x253675[_0xdb98('0x42')]=_0x5ccee1;return _0x253675;})[_0xdb98('0x25')](respondWithFilteredResult(_0x1ad5af,_0x34603e))['catch'](handleError(_0x1ad5af,null));};exports[_0xdb98('0x43')]=function(_0x1808ca,_0x3cd1c3){var _0x507a1b={'raw':!![],'where':{'id':_0x1808ca[_0xdb98('0x44')]['id']}},_0x1e84ba={};_0x1e84ba['model']=_[_0xdb98('0x31')](db[_0xdb98('0x2c')]['rawAttributes']);_0x1e84ba[_0xdb98('0x30')]=_[_0xdb98('0x31')](_0x1808ca[_0xdb98('0x30')]);_0x1e84ba[_0xdb98('0x3a')]=_[_0xdb98('0x32')](_0x1e84ba['model'],_0x1e84ba[_0xdb98('0x30')]);_0x507a1b['attributes']=_[_0xdb98('0x32')](_0x1e84ba[_0xdb98('0x2f')],qs[_0xdb98('0x34')](_0x1808ca[_0xdb98('0x30')][_0xdb98('0x34')]));_0x507a1b['attributes']=_0x507a1b[_0xdb98('0x33')]['length']?_0x507a1b['attributes']:_0x1e84ba[_0xdb98('0x2f')];if(_0x1808ca[_0xdb98('0x30')][_0xdb98('0x3f')]){_0x507a1b[_0xdb98('0x40')]=[{'all':!![]}];}_0x507a1b=_['merge']({},_0x507a1b,_0x1808ca[_0xdb98('0x3e')]);return db[_0xdb98('0x2c')][_0xdb98('0x45')](_0x507a1b)['then'](handleEntityNotFound(_0x3cd1c3,null))[_0xdb98('0x25')](respondWithResult(_0x3cd1c3,null))[_0xdb98('0x46')](handleError(_0x3cd1c3,null));};exports[_0xdb98('0x47')]=function(_0x42157e,_0x36f9b5){return db[_0xdb98('0x2c')]['create'](_0x42157e[_0xdb98('0x48')],{})[_0xdb98('0x25')](respondWithResult(_0x36f9b5,0xc9))[_0xdb98('0x46')](handleError(_0x36f9b5,null));};exports[_0xdb98('0x24')]=function(_0x4e01dc,_0x562f85){if(_0x4e01dc[_0xdb98('0x48')]['id']){delete _0x4e01dc['body']['id'];}return db[_0xdb98('0x2c')][_0xdb98('0x45')]({'where':{'id':_0x4e01dc['params']['id']}})[_0xdb98('0x25')](handleEntityNotFound(_0x562f85,null))[_0xdb98('0x25')](saveUpdates(_0x4e01dc['body'],null))['then'](respondWithResult(_0x562f85,null))[_0xdb98('0x46')](handleError(_0x562f85,null));};exports[_0xdb98('0x26')]=function(_0x1db444,_0x4035dc){return db[_0xdb98('0x2c')]['find']({'where':{'id':_0x1db444[_0xdb98('0x44')]['id']}})['then'](handleEntityNotFound(_0x4035dc,null))[_0xdb98('0x25')](removeEntity(_0x4035dc,null))[_0xdb98('0x46')](handleError(_0x4035dc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index eb82ab4..bba6b27 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 _0x3e24=['request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x393fea,_0x14b72d){var _0x474baa=function(_0x5b2212){while(--_0x5b2212){_0x393fea['push'](_0x393fea['shift']());}};_0x474baa(++_0x14b72d);}(_0x3e24,0x167));var _0x43e2=function(_0x505b9d,_0x14bcf4){_0x505b9d=_0x505b9d-0x0;var _0x491990=_0x3e24[_0x505b9d];return _0x491990;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x43e2('0xc'),'fields':[_0x43e2('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','moment','bluebird'];(function(_0x45c428,_0x560aae){var _0x39fc6b=function(_0x21e00f){while(--_0x21e00f){_0x45c428['push'](_0x45c428['shift']());}};_0x39fc6b(++_0x560aae);}(_0x7ee1,0x8d));var _0x17ee=function(_0x25042f,_0x31ad24){_0x25042f=_0x25042f-0x0;var _0x46673b=_0x7ee1[_0x25042f];return _0x46673b;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('ZohoField',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x17ee('0xa'),_0x17ee('0xb')],'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 7dca018..5273a21 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 _0xfae9=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfae9,0x1c2));var _0x9fae=function(_0x2b7f56,_0x41bc7d){_0x2b7f56=_0x2b7f56-0x0;var _0x36896d=_0xfae9[_0x2b7f56];return _0x36896d;};'use strict';var _=require(_0x9fae('0x0'));var util=require('util');var moment=require(_0x9fae('0x1'));var BPromise=require(_0x9fae('0x2'));var rs=require(_0x9fae('0x3'));var fs=require('fs');var Redis=require(_0x9fae('0x4'));var db=require(_0x9fae('0x5'))['db'];var utils=require(_0x9fae('0x6'));var logger=require(_0x9fae('0x7'))('rpc');var config=require(_0x9fae('0x8'));var jayson=require(_0x9fae('0x9'));var client=jayson[_0x9fae('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f8b6c,_0x4755e8,_0x3cbfe9){return new BPromise(function(_0x26a660,_0xd47071){return client[_0x9fae('0xb')](_0x4f8b6c,_0x3cbfe9)['then'](function(_0x212dc9){logger[_0x9fae('0xc')](_0x9fae('0xd'),_0x4755e8,_0x9fae('0xe'));logger[_0x9fae('0xf')](_0x9fae('0x10'),_0x4755e8,_0x9fae('0xe'),JSON[_0x9fae('0x11')](_0x212dc9));if(_0x212dc9[_0x9fae('0x12')]){if(_0x212dc9[_0x9fae('0x12')][_0x9fae('0x13')]===0x1f4){logger[_0x9fae('0x12')](_0x9fae('0xd'),_0x4755e8,_0x212dc9[_0x9fae('0x12')][_0x9fae('0x14')]);return _0xd47071(_0x212dc9[_0x9fae('0x12')][_0x9fae('0x14')]);}logger['error'](_0x9fae('0xd'),_0x4755e8,_0x212dc9['error'][_0x9fae('0x14')]);return _0x26a660(_0x212dc9[_0x9fae('0x12')][_0x9fae('0x14')]);}else{logger[_0x9fae('0xc')]('ZohoField,\x20%s,\x20%s',_0x4755e8,'request\x20sent');_0x26a660(_0x212dc9['result'][_0x9fae('0x14')]);}})[_0x9fae('0x15')](function(_0x545a52){logger[_0x9fae('0x12')](_0x9fae('0xd'),_0x4755e8,_0x545a52);_0xd47071(_0x545a52);});});} \ No newline at end of file +var _0xcd4d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZohoField,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1588f9,_0x4e6e63){var _0x184795=function(_0x225a83){while(--_0x225a83){_0x1588f9['push'](_0x1588f9['shift']());}};_0x184795(++_0x4e6e63);}(_0xcd4d,0x166));var _0xdcd4=function(_0x301328,_0x120a36){_0x301328=_0x301328-0x0;var _0x14e283=_0xcd4d[_0x301328];return _0x14e283;};'use strict';var _=require(_0xdcd4('0x0'));var util=require(_0xdcd4('0x1'));var moment=require(_0xdcd4('0x2'));var BPromise=require(_0xdcd4('0x3'));var rs=require(_0xdcd4('0x4'));var fs=require('fs');var Redis=require(_0xdcd4('0x5'));var db=require(_0xdcd4('0x6'))['db'];var utils=require(_0xdcd4('0x7'));var logger=require(_0xdcd4('0x8'))(_0xdcd4('0x9'));var config=require(_0xdcd4('0xa'));var jayson=require(_0xdcd4('0xb'));var client=jayson[_0xdcd4('0xc')][_0xdcd4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x8418da,_0x49aad4,_0xd278dd){return new BPromise(function(_0x59034d,_0x2443c3){return client[_0xdcd4('0xe')](_0x8418da,_0xd278dd)['then'](function(_0x5fc761){logger[_0xdcd4('0xf')]('ZohoField,\x20%s,\x20%s',_0x49aad4,_0xdcd4('0x10'));logger[_0xdcd4('0x11')](_0xdcd4('0x12'),_0x49aad4,_0xdcd4('0x10'),JSON[_0xdcd4('0x13')](_0x5fc761));if(_0x5fc761[_0xdcd4('0x14')]){if(_0x5fc761[_0xdcd4('0x14')][_0xdcd4('0x15')]===0x1f4){logger[_0xdcd4('0x14')]('ZohoField,\x20%s,\x20%s',_0x49aad4,_0x5fc761[_0xdcd4('0x14')][_0xdcd4('0x16')]);return _0x2443c3(_0x5fc761[_0xdcd4('0x14')][_0xdcd4('0x16')]);}logger[_0xdcd4('0x14')]('ZohoField,\x20%s,\x20%s',_0x49aad4,_0x5fc761[_0xdcd4('0x14')][_0xdcd4('0x16')]);return _0x59034d(_0x5fc761['error'][_0xdcd4('0x16')]);}else{logger[_0xdcd4('0xf')]('ZohoField,\x20%s,\x20%s',_0x49aad4,_0xdcd4('0x10'));_0x59034d(_0x5fc761[_0xdcd4('0x17')]['message']);}})[_0xdcd4('0x18')](function(_0x44fcbf){logger[_0xdcd4('0x14')](_0xdcd4('0x19'),_0x49aad4,_0x44fcbf);_0x2443c3(_0x44fcbf);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 625e217..a19826f 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(_0x17b85e,_0x3e971c){var _0x403c59=function(_0x321c80){while(--_0x321c80){_0x17b85e['push'](_0x17b85e['shift']());}};_0x403c59(++_0x3e971c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xcb91[_0x519756];return _0x37047e;};'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(_0x4031e5,_0x5d9cd0){var _0x25b248=function(_0x3f0d9a){while(--_0x3f0d9a){_0x4031e5['push'](_0x4031e5['shift']());}};_0x25b248(++_0x5d9cd0);}(_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 5cf04ab..8e3edf3 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 _0x4ab7=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','STRING'];(function(_0x31ce9e,_0x88b70b){var _0x3d3b47=function(_0x20171b){while(--_0x20171b){_0x31ce9e['push'](_0x31ce9e['shift']());}};_0x3d3b47(++_0x88b70b);}(_0x4ab7,0x75));var _0x74ab=function(_0x40becb,_0x5776b2){_0x40becb=_0x40becb-0x0;var _0x2b9103=_0x4ab7[_0x40becb];return _0x2b9103;};'use strict';var Sequelize=require(_0x74ab('0x0'));module['exports']={'name':{'type':Sequelize[_0x74ab('0x1')],'allowNull':![],'unique':_0x74ab('0x2')},'version':{'type':Sequelize[_0x74ab('0x1')],'allowNull':![],'unique':_0x74ab('0x2')},'main':{'type':Sequelize[_0x74ab('0x1')],'defaultValue':_0x74ab('0x3')},'filename':{'type':Sequelize[_0x74ab('0x1')]},'path':{'type':Sequelize[_0x74ab('0x1')]},'type':{'type':Sequelize[_0x74ab('0x1')]},'size':{'type':Sequelize[_0x74ab('0x4')]},'active':{'type':Sequelize[_0x74ab('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x74ab('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x74ab('0x1')],'unique':_0x74ab('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x74ab('0x1')]},'remoteUri':{'type':Sequelize[_0x74ab('0x1')]},'link':{'type':Sequelize[_0x74ab('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x9153=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x1c4e8b,_0x241c20){var _0x45ce0e=function(_0x271eb9){while(--_0x271eb9){_0x1c4e8b['push'](_0x1c4e8b['shift']());}};_0x45ce0e(++_0x241c20);}(_0x9153,0x1a7));var _0x3915=function(_0x41e6c2,_0x2d69b3){_0x41e6c2=_0x41e6c2-0x0;var _0x4dee7a=_0x9153[_0x41e6c2];return _0x4dee7a;};'use strict';var Sequelize=require(_0x3915('0x0'));module[_0x3915('0x1')]={'name':{'type':Sequelize[_0x3915('0x2')],'allowNull':![],'unique':_0x3915('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3915('0x3')},'main':{'type':Sequelize[_0x3915('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x3915('0x2')]},'path':{'type':Sequelize[_0x3915('0x2')]},'type':{'type':Sequelize[_0x3915('0x2')]},'size':{'type':Sequelize[_0x3915('0x4')]},'active':{'type':Sequelize[_0x3915('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x3915('0x2')]},'logo':{'type':Sequelize[_0x3915('0x2')]},'state':{'type':Sequelize[_0x3915('0x2')],'unique':_0x3915('0x6')},'description':{'type':Sequelize[_0x3915('0x2')]},'title':{'type':Sequelize[_0x3915('0x2')]},'remoteUri':{'type':Sequelize[_0x3915('0x2')]},'link':{'type':Sequelize[_0x3915('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7b1549d..b73b22f 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 _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x1a37,0xb4));var _0x71a3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1a37[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file +var _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x53ec,0x192));var _0xc53e=function(_0x53e29e,_0x17c540){_0x53e29e=_0x53e29e-0x0;var _0x54c118=_0x53ec[_0x53e29e];return _0x54c118;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 2b0bd2c..23ceef4 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 _0x2781=['Integration','integrations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x2781,0x1b2));var _0x1278=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2781[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x1278('0x0'));var util=require(_0x1278('0x1'));var logger=require('../../config/logger')(_0x1278('0x2'));var moment=require(_0x1278('0x3'));var BPromise=require(_0x1278('0x4'));var rp=require(_0x1278('0x5'));var fs=require('fs');var path=require(_0x1278('0x6'));var rimraf=require(_0x1278('0x7'));var config=require(_0x1278('0x8'));var attributes=require('./integration.attributes');module[_0x1278('0x9')]=function(_0x4a6726,_0x3bfe3a){return _0x4a6726['define'](_0x1278('0xa'),attributes,{'tableName':_0x1278('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x034f=['define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x38eea0,_0x367c3b){var _0x4ed45d=function(_0x26d996){while(--_0x26d996){_0x38eea0['push'](_0x38eea0['shift']());}};_0x4ed45d(++_0x367c3b);}(_0x034f,0x65));var _0xf034=function(_0x33aeab,_0x1242b4){_0x33aeab=_0x33aeab-0x0;var _0x50cec9=_0x034f[_0x33aeab];return _0x50cec9;};'use strict';var _=require(_0xf034('0x0'));var util=require(_0xf034('0x1'));var logger=require(_0xf034('0x2'))(_0xf034('0x3'));var moment=require(_0xf034('0x4'));var BPromise=require(_0xf034('0x5'));var rp=require(_0xf034('0x6'));var fs=require('fs');var path=require(_0xf034('0x7'));var rimraf=require(_0xf034('0x8'));var config=require(_0xf034('0x9'));var attributes=require(_0xf034('0xa'));module['exports']=function(_0x355679,_0x31e88d){return _0x355679[_0xf034('0xb')](_0xf034('0xc'),attributes,{'tableName':_0xf034('0xd'),'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 e6c55aa..2aef6fa 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 _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x540314,_0x30e8a5){var _0xff9b2a=function(_0x292a71){while(--_0x292a71){_0x540314['push'](_0x540314['shift']());}};_0xff9b2a(++_0x30e8a5);}(_0xd943,0x15d));var _0x3d94=function(_0x289d4f,_0x52a0a8){_0x289d4f=_0x289d4f-0x0;var _0x107e53=_0xd943[_0x289d4f];return _0x107e53;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file +var _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x1967,0x173));var _0x7196=function(_0x2907c8,_0x3ec692){_0x2907c8=_0x2907c8-0x0;var _0x3c27e1=_0x1967[_0x2907c8];return _0x3c27e1;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 38d6c38..c9c7aef 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 _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0xd6011a,_0x2f4c68){var _0x44ca56=function(_0x20ab50){while(--_0x20ab50){_0xd6011a['push'](_0xd6011a['shift']());}};_0x44ca56(++_0x2f4c68);}(_0xef0f,0x168));var _0xfef0=function(_0x19a9a7,_0x3e5c8e){_0x19a9a7=_0x19a9a7-0x0;var _0x4e834f=_0xef0f[_0x19a9a7];return _0x4e834f;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x0295,0x1f0));var _0x5029=function(_0x189cbc,_0x18aa5a){_0x189cbc=_0x189cbc-0x0;var _0x31d0db=_0x0295[_0x189cbc];return _0x31d0db;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 5e1012a..02c49af 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 _0xa634=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x375ccf,_0x14964c){var _0x1507e8=function(_0x482e1e){while(--_0x482e1e){_0x375ccf['push'](_0x375ccf['shift']());}};_0x1507e8(++_0x14964c);}(_0xa634,0x11a));var _0x4a63=function(_0x1bde25,_0x2070d5){_0x1bde25=_0x1bde25-0x0;var _0x1ab999=_0xa634[_0x1bde25];return _0x1ab999;};'use strict';var Sequelize=require(_0x4a63('0x0'));module[_0x4a63('0x1')]={'integration':{'type':Sequelize[_0x4a63('0x2')]},'eventChannel':{'type':Sequelize[_0x4a63('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4a63('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4a63('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4a63('0x2')]},'calleridname':{'type':Sequelize[_0x4a63('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4a63('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4a63('0x3')]},'holdtime':{'type':Sequelize[_0x4a63('0x4')]},'agentcomplete':{'type':Sequelize[_0x4a63('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x4a63('0x4')]},'agentacw':{'type':Sequelize[_0x4a63('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4a63('0x4')]},'reason':{'type':Sequelize[_0x4a63('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x4a63('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4a63('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4a63('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4a63('0x2')]},'channelstate':{'type':Sequelize[_0x4a63('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4a63('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4a63('0x2')]},'connectedlinename':{'type':Sequelize[_0x4a63('0x2')]},'language':{'type':Sequelize[_0x4a63('0x2')]},'accountcode':{'type':Sequelize[_0x4a63('0x2')]},'context':{'type':Sequelize[_0x4a63('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4a63('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4a63('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4a63('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4a63('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4a63('0x2')]},'destlanguage':{'type':Sequelize[_0x4a63('0x2')]},'destaccountcode':{'type':Sequelize[_0x4a63('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4a63('0x2')]},'destpriority':{'type':Sequelize[_0x4a63('0x2')]},'destuniqueid':{'type':Sequelize[_0x4a63('0x2')]},'messageId':{'type':Sequelize[_0x4a63('0x2')]},'inReplyTo':{'type':Sequelize[_0x4a63('0x2')]},'subject':{'type':Sequelize[_0x4a63('0x2')]},'from':{'type':Sequelize[_0x4a63('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4a63('0x2')]},'attachment':{'type':Sequelize[_0x4a63('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x4a63('0x6')]},'status':{'type':Sequelize[_0x4a63('0x7')](_0x4a63('0x8'),_0x4a63('0x9'),_0x4a63('0xa'),_0x4a63('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4a63('0x2')]},'appdata':{'type':Sequelize[_0x4a63('0x2')]},'projectId':{'type':Sequelize[_0x4a63('0x4')]}}; \ No newline at end of file +var _0x6026=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x534cdd,_0x3b02b0){var _0x1bdb99=function(_0x52d3da){while(--_0x52d3da){_0x534cdd['push'](_0x534cdd['shift']());}};_0x1bdb99(++_0x3b02b0);}(_0x6026,0x141));var _0x6602=function(_0x223761,_0x48157b){_0x223761=_0x223761-0x0;var _0x1aad71=_0x6026[_0x223761];return _0x1aad71;};'use strict';var Sequelize=require('sequelize');module[_0x6602('0x0')]={'integration':{'type':Sequelize[_0x6602('0x1')]},'eventChannel':{'type':Sequelize[_0x6602('0x1')]},'exitStatus':{'type':Sequelize[_0x6602('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x6602('0x2')]},'contacts':{'type':Sequelize[_0x6602('0x1')]},'uniqueid':{'type':Sequelize[_0x6602('0x1')]},'calleridnum':{'type':Sequelize[_0x6602('0x1')]},'calleridname':{'type':Sequelize[_0x6602('0x1')]},'queue':{'type':Sequelize[_0x6602('0x1')]},'interface':{'type':Sequelize[_0x6602('0x1')]},'membername':{'type':Sequelize[_0x6602('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6602('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6602('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6602('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6602('0x3')]},'talktime':{'type':Sequelize[_0x6602('0x2')]},'agentacw':{'type':Sequelize[_0x6602('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6602('0x2')]},'reason':{'type':Sequelize[_0x6602('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x6602('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6602('0x3')]},'agentdump':{'type':Sequelize[_0x6602('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6602('0x3')]},'lastevent':{'type':Sequelize[_0x6602('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6602('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6602('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6602('0x1')]},'language':{'type':Sequelize[_0x6602('0x1')]},'accountcode':{'type':Sequelize[_0x6602('0x1')]},'context':{'type':Sequelize[_0x6602('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6602('0x1')]},'destchannel':{'type':Sequelize[_0x6602('0x1')]},'destchannelstate':{'type':Sequelize[_0x6602('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6602('0x1')]},'destcalleridname':{'type':Sequelize[_0x6602('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6602('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6602('0x1')]},'destlanguage':{'type':Sequelize[_0x6602('0x1')]},'destaccountcode':{'type':Sequelize[_0x6602('0x1')]},'destcontext':{'type':Sequelize[_0x6602('0x1')]},'destexten':{'type':Sequelize[_0x6602('0x1')]},'destpriority':{'type':Sequelize[_0x6602('0x1')]},'destuniqueid':{'type':Sequelize[_0x6602('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6602('0x1')]},'subject':{'type':Sequelize[_0x6602('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x6602('0x1')]},'cc':{'type':Sequelize[_0x6602('0x1')]},'attachment':{'type':Sequelize[_0x6602('0x5')]},'html':{'type':Sequelize[_0x6602('0x5')]},'text':{'type':Sequelize[_0x6602('0x5')]},'status':{'type':Sequelize[_0x6602('0x6')](_0x6602('0x7'),_0x6602('0x8'),'RECEIVED',_0x6602('0x9'))},'url':{'type':Sequelize[_0x6602('0x1')]},'app':{'type':Sequelize[_0x6602('0x1')]},'appdata':{'type':Sequelize[_0x6602('0x1')]},'projectId':{'type':Sequelize[_0x6602('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 36da1b6..6b812fd 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 _0x9e3c=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3b22e9,_0x354406){var _0x230314=function(_0x29ae96){while(--_0x29ae96){_0x3b22e9['push'](_0x3b22e9['shift']());}};_0x230314(++_0x354406);}(_0x9e3c,0x1a8));var _0xc9e3=function(_0x2081c1,_0x25f8d2){_0x2081c1=_0x2081c1-0x0;var _0x5a8693=_0x9e3c[_0x2081c1];return _0x5a8693;};'use strict';var emlformat=require(_0xc9e3('0x0'));var rimraf=require(_0xc9e3('0x1'));var zipdir=require(_0xc9e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9e3('0x3'));var moment=require(_0xc9e3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9e3('0x5'));var util=require(_0xc9e3('0x6'));var path=require(_0xc9e3('0x7'));var sox=require(_0xc9e3('0x8'));var csv=require(_0xc9e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9e3('0xa'));var squel=require(_0xc9e3('0xb'));var crypto=require(_0xc9e3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc9e3('0x9'));var querystring=require(_0xc9e3('0xd'));var Papa=require(_0xc9e3('0xe'));var Redis=require('ioredis');var authService=require(_0xc9e3('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9e3('0x10'));var logger=require(_0xc9e3('0x11'))(_0xc9e3('0x12'));var utils=require(_0xc9e3('0x13'));var config=require(_0xc9e3('0x14'));var licenseUtil=require(_0xc9e3('0x15'));var db=require(_0xc9e3('0x16'))['db'];function respondWithStatusCode(_0x5c8907,_0x218db0){_0x218db0=_0x218db0||0xcc;return function(_0x8b9d23){if(_0x8b9d23){return _0x5c8907[_0xc9e3('0x17')](_0x218db0);}return _0x5c8907[_0xc9e3('0x18')](_0x218db0)[_0xc9e3('0x19')]();};}function respondWithResult(_0x3b0a5e,_0x4005df){_0x4005df=_0x4005df||0xc8;return function(_0x3c2841){if(_0x3c2841){return _0x3b0a5e[_0xc9e3('0x18')](_0x4005df)[_0xc9e3('0x1a')](_0x3c2841);}};}function respondWithFilteredResult(_0x1acf44,_0xce9491){return function(_0x4763c8){if(_0x4763c8){var _0x57f1f2=typeof _0xce9491['offset']===_0xc9e3('0x1b')&&typeof _0xce9491[_0xc9e3('0x1c')]===_0xc9e3('0x1b');var _0x43b6ca=_0x4763c8['count'];var _0x5260bf=_0x57f1f2?0x0:_0xce9491['offset'];var _0x27e00c=_0x57f1f2?_0x4763c8['count']:_0xce9491[_0xc9e3('0x1d')]+_0xce9491[_0xc9e3('0x1c')];var _0x36753e;if(_0x27e00c>=_0x43b6ca){_0x27e00c=_0x43b6ca;_0x36753e=0xc8;}else{_0x36753e=0xce;}_0x1acf44[_0xc9e3('0x18')](_0x36753e);return _0x1acf44[_0xc9e3('0x1e')](_0xc9e3('0x1f'),_0x5260bf+'-'+_0x27e00c+'/'+_0x43b6ca)[_0xc9e3('0x1a')](_0x4763c8);}return null;};}function patchUpdates(_0x4f282c){return function(_0x5f1d65){try{jsonpatch[_0xc9e3('0x20')](_0x5f1d65,_0x4f282c,!![]);}catch(_0x47bfa2){return BPromise[_0xc9e3('0x21')](_0x47bfa2);}return _0x5f1d65['save']();};}function saveUpdates(_0xbab3b7,_0x2f4883){return function(_0xa3998d){if(_0xa3998d){return _0xa3998d[_0xc9e3('0x22')](_0xbab3b7)['then'](function(_0x5f4c84){return _0x5f4c84;});}return null;};}function removeEntity(_0x4a2180,_0xcdc3fa){return function(_0x5dd8bb){if(_0x5dd8bb){return _0x5dd8bb[_0xc9e3('0x23')]()[_0xc9e3('0x24')](function(){_0x4a2180['status'](0xcc)[_0xc9e3('0x19')]();});}};}function handleEntityNotFound(_0x41cc3a,_0x4d8f33){return function(_0x3b4166){if(!_0x3b4166){_0x41cc3a[_0xc9e3('0x17')](0x194);}return _0x3b4166;};}function handleError(_0x207b92,_0x4a0d39){_0x4a0d39=_0x4a0d39||0x1f4;return function(_0x267bae){logger[_0xc9e3('0x25')](_0x267bae[_0xc9e3('0x26')]);if(_0x267bae[_0xc9e3('0x27')]){delete _0x267bae[_0xc9e3('0x27')];}_0x207b92[_0xc9e3('0x18')](_0x4a0d39)[_0xc9e3('0x28')](_0x267bae);};}exports['index']=function(_0x2701a5,_0x305c8c){var _0x4de958={},_0x58cee2={},_0x3af3fa={'count':0x0,'rows':[]};var _0x5ca7b2=_[_0xc9e3('0x29')](db[_0xc9e3('0x2a')][_0xc9e3('0x2b')],function(_0x441682){return{'name':_0x441682[_0xc9e3('0x2c')],'type':_0x441682[_0xc9e3('0x2d')][_0xc9e3('0x2e')]};});_0x58cee2[_0xc9e3('0x2f')]=_['map'](_0x5ca7b2,_0xc9e3('0x27'));_0x58cee2[_0xc9e3('0x30')]=_[_0xc9e3('0x31')](_0x2701a5[_0xc9e3('0x30')]);_0x58cee2[_0xc9e3('0x32')]=_[_0xc9e3('0x33')](_0x58cee2[_0xc9e3('0x2f')],_0x58cee2['query']);_0x4de958[_0xc9e3('0x34')]=_[_0xc9e3('0x33')](_0x58cee2[_0xc9e3('0x2f')],qs[_0xc9e3('0x35')](_0x2701a5['query'][_0xc9e3('0x35')]));_0x4de958[_0xc9e3('0x34')]=_0x4de958[_0xc9e3('0x34')][_0xc9e3('0x36')]?_0x4de958[_0xc9e3('0x34')]:_0x58cee2[_0xc9e3('0x2f')];if(!_0x2701a5[_0xc9e3('0x30')][_0xc9e3('0x37')](_0xc9e3('0x38'))){_0x4de958[_0xc9e3('0x1c')]=qs['limit'](_0x2701a5[_0xc9e3('0x30')][_0xc9e3('0x1c')]);_0x4de958['offset']=qs[_0xc9e3('0x1d')](_0x2701a5['query'][_0xc9e3('0x1d')]);}_0x4de958[_0xc9e3('0x39')]=qs['sort'](_0x2701a5[_0xc9e3('0x30')][_0xc9e3('0x3a')]);_0x4de958[_0xc9e3('0x3b')]=qs['filters'](_['pick'](_0x2701a5[_0xc9e3('0x30')],_0x58cee2['filters']),_0x5ca7b2);if(_0x2701a5['query'][_0xc9e3('0x3c')]){_0x4de958[_0xc9e3('0x3b')]=_[_0xc9e3('0x3d')](_0x4de958[_0xc9e3('0x3b')],{'$or':_[_0xc9e3('0x29')](_0x5ca7b2,function(_0x4a377f){if(_0x4a377f[_0xc9e3('0x2d')]!==_0xc9e3('0x3e')){var _0x4b9877={};_0x4b9877[_0x4a377f['name']]={'$like':'%'+_0x2701a5[_0xc9e3('0x30')][_0xc9e3('0x3c')]+'%'};return _0x4b9877;}})});}_0x4de958=_[_0xc9e3('0x3d')]({},_0x4de958,_0x2701a5[_0xc9e3('0x3f')]);var _0x3171f5={'where':_0x4de958[_0xc9e3('0x3b')]};return db[_0xc9e3('0x2a')]['count'](_0x3171f5)['then'](function(_0x1f781a){_0x3af3fa['count']=_0x1f781a;if(_0x2701a5[_0xc9e3('0x30')][_0xc9e3('0x40')]){_0x4de958[_0xc9e3('0x41')]=[{'all':!![]}];}return db[_0xc9e3('0x2a')][_0xc9e3('0x42')](_0x4de958);})[_0xc9e3('0x24')](function(_0x19c13d){_0x3af3fa['rows']=_0x19c13d;return _0x3af3fa;})['then'](respondWithFilteredResult(_0x305c8c,_0x4de958))['catch'](handleError(_0x305c8c,null));};exports[_0xc9e3('0x43')]=function(_0x1aeb15,_0x22d6f6){var _0xd31171={'raw':![],'where':{'id':_0x1aeb15['params']['id']}},_0x352433={};_0x352433[_0xc9e3('0x2f')]=_[_0xc9e3('0x31')](db[_0xc9e3('0x2a')][_0xc9e3('0x2b')]);_0x352433['query']=_['keys'](_0x1aeb15['query']);_0x352433[_0xc9e3('0x32')]=_[_0xc9e3('0x33')](_0x352433[_0xc9e3('0x2f')],_0x352433[_0xc9e3('0x30')]);_0xd31171['attributes']=_[_0xc9e3('0x33')](_0x352433['model'],qs[_0xc9e3('0x35')](_0x1aeb15[_0xc9e3('0x30')]['fields']));_0xd31171['attributes']=_0xd31171[_0xc9e3('0x34')][_0xc9e3('0x36')]?_0xd31171[_0xc9e3('0x34')]:_0x352433[_0xc9e3('0x2f')];if(_0x1aeb15['query'][_0xc9e3('0x40')]){_0xd31171[_0xc9e3('0x41')]=[{'all':!![]}];}_0xd31171=_[_0xc9e3('0x3d')]({},_0xd31171,_0x1aeb15[_0xc9e3('0x3f')]);return db['IntegrationReport'][_0xc9e3('0x44')](_0xd31171)['then'](handleEntityNotFound(_0x22d6f6,null))[_0xc9e3('0x24')](respondWithResult(_0x22d6f6,null))[_0xc9e3('0x45')](handleError(_0x22d6f6,null));};exports[_0xc9e3('0x46')]=function(_0x2eac4b,_0x32632e){return db['IntegrationReport'][_0xc9e3('0x46')](_0x2eac4b[_0xc9e3('0x47')],{})[_0xc9e3('0x24')](respondWithResult(_0x32632e,0xc9))[_0xc9e3('0x45')](handleError(_0x32632e,null));};exports[_0xc9e3('0x22')]=function(_0x53ac3e,_0x1dda86){if(_0x53ac3e[_0xc9e3('0x47')]['id']){delete _0x53ac3e[_0xc9e3('0x47')]['id'];}return db['IntegrationReport'][_0xc9e3('0x44')]({'where':{'id':_0x53ac3e[_0xc9e3('0x48')]['id']}})[_0xc9e3('0x24')](handleEntityNotFound(_0x1dda86,null))['then'](saveUpdates(_0x53ac3e[_0xc9e3('0x47')],null))['then'](respondWithResult(_0x1dda86,null))[_0xc9e3('0x45')](handleError(_0x1dda86,null));};exports[_0xc9e3('0x23')]=function(_0x3ca237,_0x3a08b0){return db['IntegrationReport'][_0xc9e3('0x44')]({'where':{'id':_0x3ca237[_0xc9e3('0x48')]['id']}})[_0xc9e3('0x24')](handleEntityNotFound(_0x3a08b0,null))[_0xc9e3('0x24')](removeEntity(_0x3a08b0,null))['catch'](handleError(_0x3a08b0,null));};exports[_0xc9e3('0x49')]=function(_0x5acd96,_0x43a8bb){return db[_0xc9e3('0x2a')][_0xc9e3('0x49')]()[_0xc9e3('0x24')](respondWithResult(_0x43a8bb,null))['catch'](handleError(_0x43a8bb,null));}; \ No newline at end of file +var _0xed70=['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','set','Content-Range','update','then','destroy','status','stack','name','send','index','map','IntegrationReport','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x58d881,_0x28aeef){var _0x5e2906=function(_0x5326fb){while(--_0x5326fb){_0x58d881['push'](_0x58d881['shift']());}};_0x5e2906(++_0x28aeef);}(_0xed70,0x115));var _0x0ed7=function(_0x4a9244,_0x420095){_0x4a9244=_0x4a9244-0x0;var _0x646083=_0xed70[_0x4a9244];return _0x646083;};'use strict';var emlformat=require(_0x0ed7('0x0'));var rimraf=require(_0x0ed7('0x1'));var zipdir=require(_0x0ed7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ed7('0x4'));var path=require(_0x0ed7('0x5'));var sox=require(_0x0ed7('0x6'));var csv=require(_0x0ed7('0x7'));var ejs=require(_0x0ed7('0x8'));var fs=require('fs');var fs_extra=require(_0x0ed7('0x9'));var _=require(_0x0ed7('0xa'));var squel=require(_0x0ed7('0xb'));var crypto=require('crypto');var jsforce=require(_0x0ed7('0xc'));var deskjs=require(_0x0ed7('0xd'));var toCsv=require(_0x0ed7('0x7'));var querystring=require(_0x0ed7('0xe'));var Papa=require(_0x0ed7('0xf'));var Redis=require(_0x0ed7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ed7('0x11'));var hardwareService=require(_0x0ed7('0x12'));var logger=require(_0x0ed7('0x13'))(_0x0ed7('0x14'));var utils=require(_0x0ed7('0x15'));var config=require(_0x0ed7('0x16'));var licenseUtil=require(_0x0ed7('0x17'));var db=require(_0x0ed7('0x18'))['db'];function respondWithStatusCode(_0x32c153,_0x4530ca){_0x4530ca=_0x4530ca||0xcc;return function(_0x13f169){if(_0x13f169){return _0x32c153[_0x0ed7('0x19')](_0x4530ca);}return _0x32c153['status'](_0x4530ca)[_0x0ed7('0x1a')]();};}function respondWithResult(_0x2f8e66,_0x1dd524){_0x1dd524=_0x1dd524||0xc8;return function(_0x4e61d8){if(_0x4e61d8){return _0x2f8e66['status'](_0x1dd524)[_0x0ed7('0x1b')](_0x4e61d8);}};}function respondWithFilteredResult(_0x5d7b8f,_0x18c28f){return function(_0x4e8ec9){if(_0x4e8ec9){var _0x11ccef=typeof _0x18c28f[_0x0ed7('0x1c')]===_0x0ed7('0x1d')&&typeof _0x18c28f[_0x0ed7('0x1e')]===_0x0ed7('0x1d');var _0x18cfa5=_0x4e8ec9[_0x0ed7('0x1f')];var _0x22fd32=_0x11ccef?0x0:_0x18c28f[_0x0ed7('0x1c')];var _0x4f0c1a=_0x11ccef?_0x4e8ec9[_0x0ed7('0x1f')]:_0x18c28f['offset']+_0x18c28f[_0x0ed7('0x1e')];var _0x39c6e9;if(_0x4f0c1a>=_0x18cfa5){_0x4f0c1a=_0x18cfa5;_0x39c6e9=0xc8;}else{_0x39c6e9=0xce;}_0x5d7b8f['status'](_0x39c6e9);return _0x5d7b8f[_0x0ed7('0x20')](_0x0ed7('0x21'),_0x22fd32+'-'+_0x4f0c1a+'/'+_0x18cfa5)['json'](_0x4e8ec9);}return null;};}function patchUpdates(_0x3c2099){return function(_0x5d18df){try{jsonpatch['apply'](_0x5d18df,_0x3c2099,!![]);}catch(_0x5a2a38){return BPromise['reject'](_0x5a2a38);}return _0x5d18df['save']();};}function saveUpdates(_0x39eb24,_0x884190){return function(_0x33a7de){if(_0x33a7de){return _0x33a7de[_0x0ed7('0x22')](_0x39eb24)[_0x0ed7('0x23')](function(_0x378727){return _0x378727;});}return null;};}function removeEntity(_0x1faa0f,_0x57616e){return function(_0x58988f){if(_0x58988f){return _0x58988f[_0x0ed7('0x24')]()[_0x0ed7('0x23')](function(){_0x1faa0f[_0x0ed7('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b42e7,_0x24ce98){return function(_0x1d3ca1){if(!_0x1d3ca1){_0x4b42e7['sendStatus'](0x194);}return _0x1d3ca1;};}function handleError(_0x336731,_0x23dc2e){_0x23dc2e=_0x23dc2e||0x1f4;return function(_0xd12262){logger['error'](_0xd12262[_0x0ed7('0x26')]);if(_0xd12262[_0x0ed7('0x27')]){delete _0xd12262['name'];}_0x336731[_0x0ed7('0x25')](_0x23dc2e)[_0x0ed7('0x28')](_0xd12262);};}exports[_0x0ed7('0x29')]=function(_0x3a0593,_0x40faa4){var _0x2a1845={},_0x2c0ec2={},_0x2114ff={'count':0x0,'rows':[]};var _0x64329a=_[_0x0ed7('0x2a')](db[_0x0ed7('0x2b')][_0x0ed7('0x2c')],function(_0x2e5dc0){return{'name':_0x2e5dc0['fieldName'],'type':_0x2e5dc0[_0x0ed7('0x2d')]['key']};});_0x2c0ec2[_0x0ed7('0x2e')]=_['map'](_0x64329a,_0x0ed7('0x27'));_0x2c0ec2[_0x0ed7('0x2f')]=_['keys'](_0x3a0593['query']);_0x2c0ec2[_0x0ed7('0x30')]=_[_0x0ed7('0x31')](_0x2c0ec2['model'],_0x2c0ec2[_0x0ed7('0x2f')]);_0x2a1845[_0x0ed7('0x32')]=_[_0x0ed7('0x31')](_0x2c0ec2[_0x0ed7('0x2e')],qs[_0x0ed7('0x33')](_0x3a0593['query'][_0x0ed7('0x33')]));_0x2a1845[_0x0ed7('0x32')]=_0x2a1845['attributes'][_0x0ed7('0x34')]?_0x2a1845['attributes']:_0x2c0ec2[_0x0ed7('0x2e')];if(!_0x3a0593[_0x0ed7('0x2f')][_0x0ed7('0x35')](_0x0ed7('0x36'))){_0x2a1845['limit']=qs[_0x0ed7('0x1e')](_0x3a0593[_0x0ed7('0x2f')]['limit']);_0x2a1845[_0x0ed7('0x1c')]=qs[_0x0ed7('0x1c')](_0x3a0593[_0x0ed7('0x2f')][_0x0ed7('0x1c')]);}_0x2a1845[_0x0ed7('0x37')]=qs[_0x0ed7('0x38')](_0x3a0593[_0x0ed7('0x2f')][_0x0ed7('0x38')]);_0x2a1845[_0x0ed7('0x39')]=qs[_0x0ed7('0x30')](_[_0x0ed7('0x3a')](_0x3a0593['query'],_0x2c0ec2[_0x0ed7('0x30')]),_0x64329a);if(_0x3a0593[_0x0ed7('0x2f')][_0x0ed7('0x3b')]){_0x2a1845[_0x0ed7('0x39')]=_[_0x0ed7('0x3c')](_0x2a1845[_0x0ed7('0x39')],{'$or':_[_0x0ed7('0x2a')](_0x64329a,function(_0x506d02){if(_0x506d02[_0x0ed7('0x2d')]!=='VIRTUAL'){var _0x756c6f={};_0x756c6f[_0x506d02[_0x0ed7('0x27')]]={'$like':'%'+_0x3a0593[_0x0ed7('0x2f')][_0x0ed7('0x3b')]+'%'};return _0x756c6f;}})});}_0x2a1845=_[_0x0ed7('0x3c')]({},_0x2a1845,_0x3a0593[_0x0ed7('0x3d')]);var _0x5e6848={'where':_0x2a1845['where']};return db[_0x0ed7('0x2b')][_0x0ed7('0x1f')](_0x5e6848)[_0x0ed7('0x23')](function(_0x4f5795){_0x2114ff[_0x0ed7('0x1f')]=_0x4f5795;if(_0x3a0593[_0x0ed7('0x2f')]['includeAll']){_0x2a1845['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x0ed7('0x3e')](_0x2a1845);})['then'](function(_0x3098e4){_0x2114ff[_0x0ed7('0x3f')]=_0x3098e4;return _0x2114ff;})[_0x0ed7('0x23')](respondWithFilteredResult(_0x40faa4,_0x2a1845))['catch'](handleError(_0x40faa4,null));};exports[_0x0ed7('0x40')]=function(_0x3c355c,_0x157c8e){var _0x947ee1={'raw':![],'where':{'id':_0x3c355c[_0x0ed7('0x41')]['id']}},_0xb80c62={};_0xb80c62[_0x0ed7('0x2e')]=_[_0x0ed7('0x42')](db[_0x0ed7('0x2b')][_0x0ed7('0x2c')]);_0xb80c62['query']=_[_0x0ed7('0x42')](_0x3c355c['query']);_0xb80c62[_0x0ed7('0x30')]=_[_0x0ed7('0x31')](_0xb80c62[_0x0ed7('0x2e')],_0xb80c62['query']);_0x947ee1[_0x0ed7('0x32')]=_['intersection'](_0xb80c62['model'],qs[_0x0ed7('0x33')](_0x3c355c[_0x0ed7('0x2f')][_0x0ed7('0x33')]));_0x947ee1['attributes']=_0x947ee1[_0x0ed7('0x32')][_0x0ed7('0x34')]?_0x947ee1[_0x0ed7('0x32')]:_0xb80c62[_0x0ed7('0x2e')];if(_0x3c355c[_0x0ed7('0x2f')][_0x0ed7('0x43')]){_0x947ee1['include']=[{'all':!![]}];}_0x947ee1=_[_0x0ed7('0x3c')]({},_0x947ee1,_0x3c355c['options']);return db[_0x0ed7('0x2b')][_0x0ed7('0x44')](_0x947ee1)[_0x0ed7('0x23')](handleEntityNotFound(_0x157c8e,null))[_0x0ed7('0x23')](respondWithResult(_0x157c8e,null))[_0x0ed7('0x45')](handleError(_0x157c8e,null));};exports['create']=function(_0xf30752,_0x2d8d6e){return db[_0x0ed7('0x2b')][_0x0ed7('0x46')](_0xf30752[_0x0ed7('0x47')],{})[_0x0ed7('0x23')](respondWithResult(_0x2d8d6e,0xc9))[_0x0ed7('0x45')](handleError(_0x2d8d6e,null));};exports[_0x0ed7('0x22')]=function(_0x20b5f9,_0x10e649){if(_0x20b5f9['body']['id']){delete _0x20b5f9[_0x0ed7('0x47')]['id'];}return db[_0x0ed7('0x2b')]['find']({'where':{'id':_0x20b5f9[_0x0ed7('0x41')]['id']}})['then'](handleEntityNotFound(_0x10e649,null))['then'](saveUpdates(_0x20b5f9[_0x0ed7('0x47')],null))[_0x0ed7('0x23')](respondWithResult(_0x10e649,null))[_0x0ed7('0x45')](handleError(_0x10e649,null));};exports['destroy']=function(_0x3e9cb1,_0x15a6c9){return db[_0x0ed7('0x2b')][_0x0ed7('0x44')]({'where':{'id':_0x3e9cb1['params']['id']}})['then'](handleEntityNotFound(_0x15a6c9,null))[_0x0ed7('0x23')](removeEntity(_0x15a6c9,null))['catch'](handleError(_0x15a6c9,null));};exports[_0x0ed7('0x48')]=function(_0x3cfebb,_0x1b2417){return db[_0x0ed7('0x2b')][_0x0ed7('0x48')]()['then'](respondWithResult(_0x1b2417,null))[_0x0ed7('0x45')](handleError(_0x1b2417,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 3e1336d..8608e99 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 _0x123b=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x123b,0x1cf));var _0xb123=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x123b[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xb123('0x0'));var util=require('util');var logger=require(_0xb123('0x1'))(_0xb123('0x2'));var moment=require(_0xb123('0x3'));var BPromise=require(_0xb123('0x4'));var rp=require(_0xb123('0x5'));var fs=require('fs');var path=require(_0xb123('0x6'));var rimraf=require(_0xb123('0x7'));var config=require(_0xb123('0x8'));var attributes=require(_0xb123('0x9'));module['exports']=function(_0x28fab2,_0x1d5498){return _0x28fab2[_0xb123('0xa')](_0xb123('0xb'),attributes,{'tableName':_0xb123('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf312=['report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf312,0x189));var _0x2f31=function(_0x4e27a6,_0x5402bf){_0x4e27a6=_0x4e27a6-0x0;var _0x2b3f86=_0xf312[_0x4e27a6];return _0x2b3f86;};'use strict';var _=require(_0x2f31('0x0'));var util=require(_0x2f31('0x1'));var logger=require(_0x2f31('0x2'))(_0x2f31('0x3'));var moment=require(_0x2f31('0x4'));var BPromise=require(_0x2f31('0x5'));var rp=require(_0x2f31('0x6'));var fs=require('fs');var path=require(_0x2f31('0x7'));var rimraf=require(_0x2f31('0x8'));var config=require(_0x2f31('0x9'));var attributes=require(_0x2f31('0xa'));module[_0x2f31('0xb')]=function(_0xaabfd4,_0xe2382a){return _0xaabfd4['define'](_0x2f31('0xc'),attributes,{'tableName':_0x2f31('0xd'),'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 cfefcc8..1ab2fba 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4f4899,_0x2b06b7){_0x4f4899=_0x4f4899-0x0;var _0x4de99f=_0xc2c7[_0x4f4899];return _0x4de99f;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b2d45ee..2ffcd83 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 _0x6510=['index','get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated'];(function(_0x43d887,_0x56462c){var _0x5bbfb7=function(_0x2ed6f5){while(--_0x2ed6f5){_0x43d887['push'](_0x43d887['shift']());}};_0x5bbfb7(++_0x56462c);}(_0x6510,0x77));var _0x0651=function(_0x40823b,_0x56ccaf){_0x40823b=_0x40823b-0x0;var _0x14acf2=_0x6510[_0x40823b];return _0x14acf2;};'use strict';var multer=require(_0x0651('0x0'));var util=require(_0x0651('0x1'));var path=require(_0x0651('0x2'));var timeout=require(_0x0651('0x3'));var express=require(_0x0651('0x4'));var router=express['Router']();var fs_extra=require(_0x0651('0x5'));var auth=require(_0x0651('0x6'));var interaction=require(_0x0651('0x7'));var config=require(_0x0651('0x8'));var controller=require(_0x0651('0x9'));router['get']('/',auth[_0x0651('0xa')](),controller[_0x0651('0xb')]);router[_0x0651('0xc')](_0x0651('0xd'),auth[_0x0651('0xa')](),controller['show']);router[_0x0651('0xc')](_0x0651('0xe'),auth[_0x0651('0xa')](),controller[_0x0651('0xf')]);router[_0x0651('0x10')]('/',auth['isAuthenticated'](),controller[_0x0651('0x11')]);router[_0x0651('0x10')](_0x0651('0xe'),auth[_0x0651('0xa')](),controller[_0x0651('0x12')]);router[_0x0651('0x10')](_0x0651('0x13'),auth[_0x0651('0xa')](),controller[_0x0651('0x14')]);router[_0x0651('0x15')](_0x0651('0xd'),auth[_0x0651('0xa')](),controller[_0x0651('0x16')]);router[_0x0651('0x17')]('/:id',auth[_0x0651('0xa')](),controller[_0x0651('0x18')]);module[_0x0651('0x19')]=router; \ No newline at end of file +var _0x46cb=['../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','put','update','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42ca5d,_0x4bc7f9){var _0x5388de=function(_0x1a7765){while(--_0x1a7765){_0x42ca5d['push'](_0x42ca5d['shift']());}};_0x5388de(++_0x4bc7f9);}(_0x46cb,0xd6));var _0xb46c=function(_0x12553b,_0x5a9b35){_0x12553b=_0x12553b-0x0;var _0x86a99a=_0x46cb[_0x12553b];return _0x86a99a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb46c('0x0'));var express=require(_0xb46c('0x1'));var router=express[_0xb46c('0x2')]();var fs_extra=require(_0xb46c('0x3'));var auth=require(_0xb46c('0x4'));var interaction=require(_0xb46c('0x5'));var config=require(_0xb46c('0x6'));var controller=require(_0xb46c('0x7'));router[_0xb46c('0x8')]('/',auth[_0xb46c('0x9')](),controller[_0xb46c('0xa')]);router[_0xb46c('0x8')](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller['show']);router[_0xb46c('0x8')](_0xb46c('0xc'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xd')]);router[_0xb46c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xb46c('0xc'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xf')]);router[_0xb46c('0xe')](_0xb46c('0x10'),auth[_0xb46c('0x9')](),controller['addIntervals']);router[_0xb46c('0x11')]('/:id',auth[_0xb46c('0x9')](),controller[_0xb46c('0x12')]);router['delete'](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller[_0xb46c('0x13')]);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 6982114..9eee510 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 _0x6625=['STRING','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6625,0x149));var _0x5662=function(_0x232c2c,_0x255dfd){_0x232c2c=_0x232c2c-0x0;var _0x3e1476=_0x6625[_0x232c2c];return _0x3e1476;};'use strict';var Sequelize=require('sequelize');module[_0x5662('0x0')]={'name':{'type':Sequelize[_0x5662('0x1')]},'description':{'type':Sequelize[_0x5662('0x1')]},'interval':{'type':Sequelize[_0x5662('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xc139=['exports','STRING','sequelize'];(function(_0x392e86,_0x5b7627){var _0x54b31f=function(_0x2d5b1a){while(--_0x2d5b1a){_0x392e86['push'](_0x392e86['shift']());}};_0x54b31f(++_0x5b7627);}(_0xc139,0x10d));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c13('0x0'));module[_0x9c13('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9c13('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 95f4f8a..d84f83c 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 _0x9be2=['transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','type','model','map','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','show','params','Interval','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne','pick','sequelize'];(function(_0x2d015c,_0x31bb7e){var _0x403093=function(_0x2dc795){while(--_0x2dc795){_0x2d015c['push'](_0x2d015c['shift']());}};_0x403093(++_0x31bb7e);}(_0x9be2,0x1c0));var _0x29be=function(_0x4f535f,_0x1086c4){_0x4f535f=_0x4f535f-0x0;var _0x58db30=_0x9be2[_0x4f535f];return _0x58db30;};'use strict';var emlformat=require(_0x29be('0x0'));var rimraf=require(_0x29be('0x1'));var zipdir=require(_0x29be('0x2'));var jsonpatch=require(_0x29be('0x3'));var rp=require(_0x29be('0x4'));var moment=require(_0x29be('0x5'));var BPromise=require(_0x29be('0x6'));var Mustache=require(_0x29be('0x7'));var util=require('util');var path=require(_0x29be('0x8'));var sox=require(_0x29be('0x9'));var csv=require(_0x29be('0xa'));var ejs=require(_0x29be('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(_0x29be('0xc'));var deskjs=require(_0x29be('0xd'));var toCsv=require('to-csv');var querystring=require(_0x29be('0xe'));var Papa=require(_0x29be('0xf'));var Redis=require(_0x29be('0x10'));var authService=require(_0x29be('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x29be('0x12'));var hardwareService=require(_0x29be('0x13'));var logger=require(_0x29be('0x14'))('api');var utils=require(_0x29be('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x29be('0x16'));var db=require(_0x29be('0x17'))['db'];var extensions=require(_0x29be('0x18'));function respondWithStatusCode(_0x5d26d3,_0x1c5532){_0x1c5532=_0x1c5532||0xcc;return function(_0x3e9022){if(_0x3e9022){return _0x5d26d3['sendStatus'](_0x1c5532);}return _0x5d26d3[_0x29be('0x19')](_0x1c5532)[_0x29be('0x1a')]();};}function respondWithResult(_0x297608,_0x2af822){_0x2af822=_0x2af822||0xc8;return function(_0x3d9104){if(_0x3d9104){return _0x297608[_0x29be('0x19')](_0x2af822)[_0x29be('0x1b')](_0x3d9104);}};}function respondWithFilteredResult(_0x14e601,_0x343723){return function(_0x5c4a63){if(_0x5c4a63){var _0x3e83ae=typeof _0x343723[_0x29be('0x1c')]===_0x29be('0x1d')&&typeof _0x343723['limit']===_0x29be('0x1d');var _0x204766=_0x5c4a63[_0x29be('0x1e')];var _0x240e0d=_0x3e83ae?0x0:_0x343723['offset'];var _0x3c3b0a=_0x3e83ae?_0x5c4a63[_0x29be('0x1e')]:_0x343723[_0x29be('0x1c')]+_0x343723[_0x29be('0x1f')];var _0x43931c;if(_0x3c3b0a>=_0x204766){_0x3c3b0a=_0x204766;_0x43931c=0xc8;}else{_0x43931c=0xce;}_0x14e601[_0x29be('0x19')](_0x43931c);return _0x14e601['set']('Content-Range',_0x240e0d+'-'+_0x3c3b0a+'/'+_0x204766)[_0x29be('0x1b')](_0x5c4a63);}return null;};}function patchUpdates(_0x2ef8e6){return function(_0x35a202){try{jsonpatch[_0x29be('0x20')](_0x35a202,_0x2ef8e6,!![]);}catch(_0x46a709){return BPromise[_0x29be('0x21')](_0x46a709);}return _0x35a202[_0x29be('0x22')]();};}function saveUpdates(_0x4b2b8a,_0x5d80d5){return function(_0x321eed){if(_0x321eed){return _0x321eed[_0x29be('0x23')](_0x4b2b8a)[_0x29be('0x24')](function(_0x403179){return _0x403179;});}return null;};}function removeEntity(_0x4655f4,_0x1edbf6){return function(_0x28109b){if(_0x28109b){return _0x28109b[_0x29be('0x25')]()[_0x29be('0x24')](function(){var _0x7a8c4e=_0x28109b[_0x29be('0x26')]({'plain':!![]});var _0x46815b='Intervals';return db[_0x29be('0x27')][_0x29be('0x25')]({'where':{'type':_0x46815b,'resourceId':_0x7a8c4e['id']}})[_0x29be('0x24')](function(){return _0x28109b;});})[_0x29be('0x24')](function(){_0x4655f4[_0x29be('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b8f58,_0x374b66){return function(_0x5c6049){if(!_0x5c6049){_0x1b8f58[_0x29be('0x28')](0x194);}return _0x5c6049;};}function handleError(_0x482f65,_0x39fbc0){_0x39fbc0=_0x39fbc0||0x1f4;return function(_0x240d5e){logger[_0x29be('0x29')](_0x240d5e['stack']);if(_0x240d5e[_0x29be('0x2a')]){delete _0x240d5e[_0x29be('0x2a')];}_0x482f65['status'](_0x39fbc0)[_0x29be('0x2b')](_0x240d5e);};}exports[_0x29be('0x2c')]=function(_0x1ca1b0,_0x4c8372){var _0x129044={},_0x2c724e={},_0x4bce8f={'count':0x0,'rows':[]};var _0x39595b=_['map'](db['Interval'][_0x29be('0x2d')],function(_0x427d41){return{'name':_0x427d41[_0x29be('0x2e')],'type':_0x427d41[_0x29be('0x2f')]['key']};});_0x2c724e[_0x29be('0x30')]=_[_0x29be('0x31')](_0x39595b,'name');_0x2c724e['query']=_['keys'](_0x1ca1b0['query']);_0x2c724e[_0x29be('0x32')]=_['intersection'](_0x2c724e[_0x29be('0x30')],_0x2c724e[_0x29be('0x33')]);_0x129044[_0x29be('0x34')]=_[_0x29be('0x35')](_0x2c724e['model'],qs[_0x29be('0x36')](_0x1ca1b0[_0x29be('0x33')][_0x29be('0x36')]));_0x129044['attributes']=_0x129044[_0x29be('0x34')][_0x29be('0x37')]?_0x129044[_0x29be('0x34')]:_0x2c724e['model'];if(!_0x1ca1b0[_0x29be('0x33')][_0x29be('0x38')](_0x29be('0x39'))){_0x129044[_0x29be('0x1f')]=qs['limit'](_0x1ca1b0[_0x29be('0x33')][_0x29be('0x1f')]);_0x129044['offset']=qs[_0x29be('0x1c')](_0x1ca1b0['query'][_0x29be('0x1c')]);}_0x129044[_0x29be('0x3a')]=qs['sort'](_0x1ca1b0[_0x29be('0x33')][_0x29be('0x3b')]);_0x129044[_0x29be('0x3c')]=qs[_0x29be('0x32')](_['pick'](_0x1ca1b0[_0x29be('0x33')],_0x2c724e[_0x29be('0x32')]),_0x39595b);if(_0x1ca1b0['query']['filter']){_0x129044[_0x29be('0x3c')]=_[_0x29be('0x3d')](_0x129044[_0x29be('0x3c')],{'$or':_[_0x29be('0x31')](_0x39595b,function(_0x14a436){if(_0x14a436[_0x29be('0x2f')]!==_0x29be('0x3e')){var _0x139875={};_0x139875[_0x14a436[_0x29be('0x2a')]]={'$like':'%'+_0x1ca1b0[_0x29be('0x33')][_0x29be('0x3f')]+'%'};return _0x139875;}})});}_0x129044=_[_0x29be('0x3d')]({},_0x129044,_0x1ca1b0[_0x29be('0x40')]);var _0x1f3801={'where':_0x129044[_0x29be('0x3c')]};return db['Interval']['count'](_0x1f3801)[_0x29be('0x24')](function(_0x5e2bdb){_0x4bce8f[_0x29be('0x1e')]=_0x5e2bdb;if(_0x1ca1b0[_0x29be('0x33')][_0x29be('0x41')]){_0x129044['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x129044);})['then'](function(_0x30858c){_0x4bce8f[_0x29be('0x42')]=_0x30858c;return _0x4bce8f;})[_0x29be('0x24')](respondWithFilteredResult(_0x4c8372,_0x129044))['catch'](handleError(_0x4c8372,null));};exports[_0x29be('0x43')]=function(_0x590a66,_0x30dde5){var _0x218b28={'raw':!![],'where':{'id':_0x590a66[_0x29be('0x44')]['id']}},_0x3bf944={};_0x3bf944[_0x29be('0x30')]=_['keys'](db[_0x29be('0x45')][_0x29be('0x2d')]);_0x3bf944[_0x29be('0x33')]=_[_0x29be('0x46')](_0x590a66[_0x29be('0x33')]);_0x3bf944[_0x29be('0x32')]=_[_0x29be('0x35')](_0x3bf944[_0x29be('0x30')],_0x3bf944[_0x29be('0x33')]);_0x218b28[_0x29be('0x34')]=_[_0x29be('0x35')](_0x3bf944[_0x29be('0x30')],qs[_0x29be('0x36')](_0x590a66[_0x29be('0x33')]['fields']));_0x218b28[_0x29be('0x34')]=_0x218b28[_0x29be('0x34')]['length']?_0x218b28[_0x29be('0x34')]:_0x3bf944[_0x29be('0x30')];if(_0x590a66[_0x29be('0x33')][_0x29be('0x41')]){_0x218b28[_0x29be('0x47')]=[{'all':!![]}];}_0x218b28=_[_0x29be('0x3d')]({},_0x218b28,_0x590a66['options']);return db[_0x29be('0x45')][_0x29be('0x48')](_0x218b28)['then'](handleEntityNotFound(_0x30dde5,null))[_0x29be('0x24')](respondWithResult(_0x30dde5,null))[_0x29be('0x49')](handleError(_0x30dde5,null));};exports[_0x29be('0x4a')]=function(_0x44e889,_0x56f4ea){return db['Interval'][_0x29be('0x4a')](_0x44e889[_0x29be('0x4b')],{})['then'](function(_0x399ce1){var _0x1618ff=_0x44e889['user'][_0x29be('0x26')]({'plain':!![]});if(!_0x1618ff)throw new Error(_0x29be('0x4c'));if(_0x1618ff[_0x29be('0x4d')]===_0x29be('0x4e')){var _0x12dff2=_0x399ce1[_0x29be('0x26')]({'plain':!![]});var _0x4b6718='Intervals';return db['UserProfileSection']['find']({'where':{'name':_0x4b6718,'userProfileId':_0x1618ff['userProfileId']},'raw':!![]})[_0x29be('0x24')](function(_0x1018f5){if(_0x1018f5&&_0x1018f5[_0x29be('0x4f')]===0x0){return db[_0x29be('0x27')][_0x29be('0x4a')]({'name':_0x12dff2['name'],'resourceId':_0x12dff2['id'],'type':_0x1018f5[_0x29be('0x2a')],'sectionId':_0x1018f5['id']},{})[_0x29be('0x24')](function(){return _0x399ce1;});}else{return _0x399ce1;}})[_0x29be('0x49')](function(_0x3ef3d8){logger['error'](_0x29be('0x50'),_0x3ef3d8);throw _0x3ef3d8;});}return _0x399ce1;})[_0x29be('0x24')](respondWithResult(_0x56f4ea,0xc9))[_0x29be('0x49')](handleError(_0x56f4ea,null));};exports[_0x29be('0x23')]=function(_0x269f57,_0x57d1cd){if(_0x269f57[_0x29be('0x4b')]['id']){delete _0x269f57[_0x29be('0x4b')]['id'];}return db[_0x29be('0x45')][_0x29be('0x48')]({'where':{'id':_0x269f57[_0x29be('0x44')]['id']}})[_0x29be('0x24')](handleEntityNotFound(_0x57d1cd,null))[_0x29be('0x24')](saveUpdates(_0x269f57[_0x29be('0x4b')],null))[_0x29be('0x24')](respondWithResult(_0x57d1cd,null))[_0x29be('0x49')](handleError(_0x57d1cd,null));};exports[_0x29be('0x25')]=function(_0x52ec1b,_0x4642fb){return db[_0x29be('0x45')]['find']({'where':{'id':_0x52ec1b['params']['id']}})[_0x29be('0x24')](handleEntityNotFound(_0x4642fb,null))[_0x29be('0x24')](removeEntity(_0x4642fb,null))['catch'](handleError(_0x4642fb,null));};exports[_0x29be('0x51')]=function(_0x464275,_0x37d979,_0x1dd925){if(_0x464275[_0x29be('0x4b')]['id']){delete _0x464275[_0x29be('0x4b')]['id'];}return db['Interval']['find']({'where':{'id':_0x464275['params']['id']}})[_0x29be('0x24')](handleEntityNotFound(_0x37d979,null))[_0x29be('0x24')](function(_0x516144){if(_0x516144){_0x464275[_0x29be('0x4b')][_0x29be('0x52')]=_0x516144['id'];return db[_0x29be('0x45')][_0x29be('0x4a')](_0x464275[_0x29be('0x4b')]);}})[_0x29be('0x24')](respondWithResult(_0x37d979,null))[_0x29be('0x49')](handleError(_0x37d979,null));};exports['getIntervals']=function(_0x3c1c87,_0x566668,_0x4dd065){var _0xb4c3ec={};var _0x1af4c8={};var _0x338e72;var _0x3332eb;return db[_0x29be('0x45')][_0x29be('0x53')]({'where':{'id':_0x3c1c87['params']['id']}})[_0x29be('0x24')](handleEntityNotFound(_0x566668,null))[_0x29be('0x24')](function(_0x5a0953){if(_0x5a0953){_0x338e72=_0x5a0953;_0x1af4c8['model']=_['keys'](db[_0x29be('0x45')]['rawAttributes']);_0x1af4c8[_0x29be('0x33')]=_[_0x29be('0x46')](_0x3c1c87[_0x29be('0x33')]);_0x1af4c8[_0x29be('0x32')]=_[_0x29be('0x35')](_0x1af4c8[_0x29be('0x30')],_0x1af4c8['query']);_0xb4c3ec['attributes']=_[_0x29be('0x35')](_0x1af4c8[_0x29be('0x30')],qs[_0x29be('0x36')](_0x3c1c87[_0x29be('0x33')][_0x29be('0x36')]));_0xb4c3ec['attributes']=_0xb4c3ec[_0x29be('0x34')]['length']?_0xb4c3ec[_0x29be('0x34')]:_0x1af4c8['model'];_0xb4c3ec[_0x29be('0x3a')]=qs['sort'](_0x3c1c87['query'][_0x29be('0x3b')]);_0xb4c3ec['where']=qs[_0x29be('0x32')](_[_0x29be('0x54')](_0x3c1c87[_0x29be('0x33')],_0x1af4c8[_0x29be('0x32')]));if(_0x3c1c87[_0x29be('0x33')]['filter']){_0xb4c3ec[_0x29be('0x3c')]=_[_0x29be('0x3d')](_0xb4c3ec[_0x29be('0x3c')],{'$or':_[_0x29be('0x31')](_0xb4c3ec[_0x29be('0x34')],function(_0x1cf2c2){var _0x41e896={};_0x41e896[_0x1cf2c2]={'$like':'%'+_0x3c1c87[_0x29be('0x33')][_0x29be('0x3f')]+'%'};return _0x41e896;})});}_0xb4c3ec=_[_0x29be('0x3d')]({},_0xb4c3ec,_0x3c1c87[_0x29be('0x40')]);return _0x338e72['getIntervals'](_0xb4c3ec);}})[_0x29be('0x24')](function(_0x4d67da){if(_0x4d67da){_0x3332eb=_0x4d67da[_0x29be('0x37')];if(!_0x3c1c87[_0x29be('0x33')][_0x29be('0x38')](_0x29be('0x39'))){_0xb4c3ec[_0x29be('0x1f')]=qs[_0x29be('0x1f')](_0x3c1c87['query'][_0x29be('0x1f')]);_0xb4c3ec[_0x29be('0x1c')]=qs['offset'](_0x3c1c87['query'][_0x29be('0x1c')]);}return _0x338e72['getIntervals'](_0xb4c3ec);}})[_0x29be('0x24')](function(_0x37a882){if(_0x37a882){return _0x37a882?{'count':_0x3332eb,'rows':_0x37a882}:null;}})['then'](respondWithResult(_0x566668,null))[_0x29be('0x49')](handleError(_0x566668,null));};exports['addIntervals']=function(_0x22e612,_0x4859e9,_0x36cd01){return db['Interval'][_0x29be('0x53')]({'where':{'id':_0x22e612['params']['id']}})[_0x29be('0x24')](handleEntityNotFound(_0x4859e9,null))[_0x29be('0x24')](function(_0x297f1d){if(_0x297f1d){return db[_0x29be('0x55')][_0x29be('0x56')](function(_0x98cf6){return db[_0x29be('0x45')][_0x29be('0x25')]({'where':{'IntervalId':_0x22e612[_0x29be('0x44')]['id']},'transaction':_0x98cf6})[_0x29be('0x24')](function(_0x1f273e){var _0x1c71db=_[_0x29be('0x31')](_0x22e612[_0x29be('0x4b')],function(_0x43b362){delete _0x43b362['id'];_0x43b362[_0x29be('0x52')]=_0x22e612['params']['id'];return _0x43b362;});return db[_0x29be('0x45')][_0x29be('0x57')](_0x1c71db,{'transaction':_0x98cf6});});})[_0x29be('0x24')](function(){return db[_0x29be('0x45')][_0x29be('0x58')]({'where':{'IntervalId':_0x22e612[_0x29be('0x44')]['id']}});});}})[_0x29be('0x24')](respondWithResult(_0x4859e9,null))[_0x29be('0x49')](handleError(_0x4859e9,null));}; \ No newline at end of file +var _0xcaae=['index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','Interval','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','IntervalId','getIntervals','order','hasOwnProperty','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','offset','set','Content-Range','apply','reject','update','then','get','Intervals','UserProfileResource','error','stack','name'];(function(_0x3de5e6,_0x2b92e3){var _0x10bd22=function(_0x4fd502){while(--_0x4fd502){_0x3de5e6['push'](_0x3de5e6['shift']());}};_0x10bd22(++_0x2b92e3);}(_0xcaae,0x1ea));var _0xecaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xecaa('0x0'));var rimraf=require(_0xecaa('0x1'));var zipdir=require(_0xecaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecaa('0x3'));var moment=require(_0xecaa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xecaa('0x5'));var util=require(_0xecaa('0x6'));var path=require(_0xecaa('0x7'));var sox=require(_0xecaa('0x8'));var csv=require(_0xecaa('0x9'));var ejs=require(_0xecaa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xecaa('0xb'));var crypto=require(_0xecaa('0xc'));var jsforce=require(_0xecaa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xecaa('0x9'));var querystring=require(_0xecaa('0xe'));var Papa=require('papaparse');var Redis=require(_0xecaa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xecaa('0x10'));var as=require(_0xecaa('0x11'));var hardwareService=require(_0xecaa('0x12'));var logger=require(_0xecaa('0x13'))(_0xecaa('0x14'));var utils=require(_0xecaa('0x15'));var config=require(_0xecaa('0x16'));var licenseUtil=require(_0xecaa('0x17'));var db=require(_0xecaa('0x18'))['db'];var extensions=require(_0xecaa('0x19'));function respondWithStatusCode(_0x1965a9,_0x2b4a12){_0x2b4a12=_0x2b4a12||0xcc;return function(_0x285fab){if(_0x285fab){return _0x1965a9[_0xecaa('0x1a')](_0x2b4a12);}return _0x1965a9[_0xecaa('0x1b')](_0x2b4a12)[_0xecaa('0x1c')]();};}function respondWithResult(_0x436ecc,_0x3e03ab){_0x3e03ab=_0x3e03ab||0xc8;return function(_0x4c0771){if(_0x4c0771){return _0x436ecc[_0xecaa('0x1b')](_0x3e03ab)[_0xecaa('0x1d')](_0x4c0771);}};}function respondWithFilteredResult(_0x2c6600,_0x1756a2){return function(_0x59985e){if(_0x59985e){var _0x10d6d5=typeof _0x1756a2['offset']===_0xecaa('0x1e')&&typeof _0x1756a2['limit']===_0xecaa('0x1e');var _0x4e4115=_0x59985e['count'];var _0x44fa83=_0x10d6d5?0x0:_0x1756a2[_0xecaa('0x1f')];var _0x202dab=_0x10d6d5?_0x59985e['count']:_0x1756a2[_0xecaa('0x1f')]+_0x1756a2['limit'];var _0x21dcd5;if(_0x202dab>=_0x4e4115){_0x202dab=_0x4e4115;_0x21dcd5=0xc8;}else{_0x21dcd5=0xce;}_0x2c6600['status'](_0x21dcd5);return _0x2c6600[_0xecaa('0x20')](_0xecaa('0x21'),_0x44fa83+'-'+_0x202dab+'/'+_0x4e4115)[_0xecaa('0x1d')](_0x59985e);}return null;};}function patchUpdates(_0x3e3a77){return function(_0x164277){try{jsonpatch[_0xecaa('0x22')](_0x164277,_0x3e3a77,!![]);}catch(_0x319127){return BPromise[_0xecaa('0x23')](_0x319127);}return _0x164277['save']();};}function saveUpdates(_0x1ebd75,_0x248327){return function(_0x2ff0ab){if(_0x2ff0ab){return _0x2ff0ab[_0xecaa('0x24')](_0x1ebd75)[_0xecaa('0x25')](function(_0x4f78d4){return _0x4f78d4;});}return null;};}function removeEntity(_0x122767,_0x39f700){return function(_0x20106f){if(_0x20106f){return _0x20106f['destroy']()['then'](function(){var _0x575786=_0x20106f[_0xecaa('0x26')]({'plain':!![]});var _0x1daabe=_0xecaa('0x27');return db[_0xecaa('0x28')]['destroy']({'where':{'type':_0x1daabe,'resourceId':_0x575786['id']}})[_0xecaa('0x25')](function(){return _0x20106f;});})['then'](function(){_0x122767['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1129,_0x3e2fef){return function(_0x8e2016){if(!_0x8e2016){_0x4c1129[_0xecaa('0x1a')](0x194);}return _0x8e2016;};}function handleError(_0x4223f9,_0x4b79db){_0x4b79db=_0x4b79db||0x1f4;return function(_0x56a608){logger[_0xecaa('0x29')](_0x56a608[_0xecaa('0x2a')]);if(_0x56a608['name']){delete _0x56a608[_0xecaa('0x2b')];}_0x4223f9[_0xecaa('0x1b')](_0x4b79db)['send'](_0x56a608);};}exports[_0xecaa('0x2c')]=function(_0x19c0a5,_0xa32f9e){var _0x23eaca={},_0x1548c7={},_0x217e5d={'count':0x0,'rows':[]};var _0x5aaac5=_[_0xecaa('0x2d')](db['Interval'][_0xecaa('0x2e')],function(_0x2b0b60){return{'name':_0x2b0b60['fieldName'],'type':_0x2b0b60['type']['key']};});_0x1548c7[_0xecaa('0x2f')]=_[_0xecaa('0x2d')](_0x5aaac5,_0xecaa('0x2b'));_0x1548c7[_0xecaa('0x30')]=_[_0xecaa('0x31')](_0x19c0a5['query']);_0x1548c7[_0xecaa('0x32')]=_[_0xecaa('0x33')](_0x1548c7[_0xecaa('0x2f')],_0x1548c7[_0xecaa('0x30')]);_0x23eaca[_0xecaa('0x34')]=_[_0xecaa('0x33')](_0x1548c7[_0xecaa('0x2f')],qs[_0xecaa('0x35')](_0x19c0a5[_0xecaa('0x30')][_0xecaa('0x35')]));_0x23eaca['attributes']=_0x23eaca['attributes']['length']?_0x23eaca[_0xecaa('0x34')]:_0x1548c7[_0xecaa('0x2f')];if(!_0x19c0a5[_0xecaa('0x30')]['hasOwnProperty'](_0xecaa('0x36'))){_0x23eaca['limit']=qs[_0xecaa('0x37')](_0x19c0a5[_0xecaa('0x30')][_0xecaa('0x37')]);_0x23eaca[_0xecaa('0x1f')]=qs['offset'](_0x19c0a5['query'][_0xecaa('0x1f')]);}_0x23eaca['order']=qs[_0xecaa('0x38')](_0x19c0a5[_0xecaa('0x30')]['sort']);_0x23eaca[_0xecaa('0x39')]=qs[_0xecaa('0x32')](_[_0xecaa('0x3a')](_0x19c0a5[_0xecaa('0x30')],_0x1548c7[_0xecaa('0x32')]),_0x5aaac5);if(_0x19c0a5[_0xecaa('0x30')][_0xecaa('0x3b')]){_0x23eaca[_0xecaa('0x39')]=_[_0xecaa('0x3c')](_0x23eaca[_0xecaa('0x39')],{'$or':_['map'](_0x5aaac5,function(_0x5097af){if(_0x5097af[_0xecaa('0x3d')]!==_0xecaa('0x3e')){var _0x13644c={};_0x13644c[_0x5097af[_0xecaa('0x2b')]]={'$like':'%'+_0x19c0a5[_0xecaa('0x30')][_0xecaa('0x3b')]+'%'};return _0x13644c;}})});}_0x23eaca=_[_0xecaa('0x3c')]({},_0x23eaca,_0x19c0a5['options']);var _0x3f2194={'where':_0x23eaca['where']};return db['Interval'][_0xecaa('0x3f')](_0x3f2194)[_0xecaa('0x25')](function(_0x2a2cb6){_0x217e5d[_0xecaa('0x3f')]=_0x2a2cb6;if(_0x19c0a5['query'][_0xecaa('0x40')]){_0x23eaca[_0xecaa('0x41')]=[{'all':!![]}];}return db['Interval'][_0xecaa('0x42')](_0x23eaca);})[_0xecaa('0x25')](function(_0x5d2c85){_0x217e5d[_0xecaa('0x43')]=_0x5d2c85;return _0x217e5d;})['then'](respondWithFilteredResult(_0xa32f9e,_0x23eaca))[_0xecaa('0x44')](handleError(_0xa32f9e,null));};exports[_0xecaa('0x45')]=function(_0x4b6d90,_0x445258){var _0x5c3224={'raw':!![],'where':{'id':_0x4b6d90[_0xecaa('0x46')]['id']}},_0x1807f3={};_0x1807f3['model']=_[_0xecaa('0x31')](db[_0xecaa('0x47')]['rawAttributes']);_0x1807f3[_0xecaa('0x30')]=_[_0xecaa('0x31')](_0x4b6d90[_0xecaa('0x30')]);_0x1807f3['filters']=_[_0xecaa('0x33')](_0x1807f3[_0xecaa('0x2f')],_0x1807f3[_0xecaa('0x30')]);_0x5c3224[_0xecaa('0x34')]=_['intersection'](_0x1807f3[_0xecaa('0x2f')],qs[_0xecaa('0x35')](_0x4b6d90[_0xecaa('0x30')]['fields']));_0x5c3224[_0xecaa('0x34')]=_0x5c3224[_0xecaa('0x34')][_0xecaa('0x48')]?_0x5c3224[_0xecaa('0x34')]:_0x1807f3['model'];if(_0x4b6d90[_0xecaa('0x30')][_0xecaa('0x40')]){_0x5c3224[_0xecaa('0x41')]=[{'all':!![]}];}_0x5c3224=_['merge']({},_0x5c3224,_0x4b6d90[_0xecaa('0x49')]);return db[_0xecaa('0x47')][_0xecaa('0x4a')](_0x5c3224)[_0xecaa('0x25')](handleEntityNotFound(_0x445258,null))[_0xecaa('0x25')](respondWithResult(_0x445258,null))[_0xecaa('0x44')](handleError(_0x445258,null));};exports[_0xecaa('0x4b')]=function(_0x1acde2,_0x2235b4){return db[_0xecaa('0x47')]['create'](_0x1acde2[_0xecaa('0x4c')],{})[_0xecaa('0x25')](function(_0x58d74b){var _0x3818ca=_0x1acde2[_0xecaa('0x4d')]['get']({'plain':!![]});if(!_0x3818ca)throw new Error(_0xecaa('0x4e'));if(_0x3818ca['role']===_0xecaa('0x4d')){var _0x449874=_0x58d74b['get']({'plain':!![]});var _0x18ee97=_0xecaa('0x27');return db['UserProfileSection'][_0xecaa('0x4a')]({'where':{'name':_0x18ee97,'userProfileId':_0x3818ca[_0xecaa('0x4f')]},'raw':!![]})['then'](function(_0x1bee32){if(_0x1bee32&&_0x1bee32[_0xecaa('0x50')]===0x0){return db[_0xecaa('0x28')][_0xecaa('0x4b')]({'name':_0x449874[_0xecaa('0x2b')],'resourceId':_0x449874['id'],'type':_0x1bee32[_0xecaa('0x2b')],'sectionId':_0x1bee32['id']},{})[_0xecaa('0x25')](function(){return _0x58d74b;});}else{return _0x58d74b;}})[_0xecaa('0x44')](function(_0x107210){logger[_0xecaa('0x29')](_0xecaa('0x51'),_0x107210);throw _0x107210;});}return _0x58d74b;})['then'](respondWithResult(_0x2235b4,0xc9))['catch'](handleError(_0x2235b4,null));};exports[_0xecaa('0x24')]=function(_0x2d9de5,_0x454432){if(_0x2d9de5[_0xecaa('0x4c')]['id']){delete _0x2d9de5[_0xecaa('0x4c')]['id'];}return db[_0xecaa('0x47')]['find']({'where':{'id':_0x2d9de5[_0xecaa('0x46')]['id']}})[_0xecaa('0x25')](handleEntityNotFound(_0x454432,null))[_0xecaa('0x25')](saveUpdates(_0x2d9de5[_0xecaa('0x4c')],null))[_0xecaa('0x25')](respondWithResult(_0x454432,null))[_0xecaa('0x44')](handleError(_0x454432,null));};exports[_0xecaa('0x52')]=function(_0x585d24,_0x3cc5d9){return db['Interval'][_0xecaa('0x4a')]({'where':{'id':_0x585d24['params']['id']}})['then'](handleEntityNotFound(_0x3cc5d9,null))[_0xecaa('0x25')](removeEntity(_0x3cc5d9,null))[_0xecaa('0x44')](handleError(_0x3cc5d9,null));};exports['addInterval']=function(_0x623d42,_0x1e93e7,_0x1ebf2b){if(_0x623d42['body']['id']){delete _0x623d42['body']['id'];}return db['Interval'][_0xecaa('0x4a')]({'where':{'id':_0x623d42[_0xecaa('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e93e7,null))[_0xecaa('0x25')](function(_0x144189){if(_0x144189){_0x623d42[_0xecaa('0x4c')][_0xecaa('0x53')]=_0x144189['id'];return db[_0xecaa('0x47')][_0xecaa('0x4b')](_0x623d42[_0xecaa('0x4c')]);}})[_0xecaa('0x25')](respondWithResult(_0x1e93e7,null))[_0xecaa('0x44')](handleError(_0x1e93e7,null));};exports[_0xecaa('0x54')]=function(_0x2f66d8,_0xb3f6da,_0x109c5a){var _0x207b4e={};var _0x5199b4={};var _0x5abb10;var _0x280853;return db[_0xecaa('0x47')]['findOne']({'where':{'id':_0x2f66d8[_0xecaa('0x46')]['id']}})[_0xecaa('0x25')](handleEntityNotFound(_0xb3f6da,null))['then'](function(_0x2276a1){if(_0x2276a1){_0x5abb10=_0x2276a1;_0x5199b4[_0xecaa('0x2f')]=_[_0xecaa('0x31')](db[_0xecaa('0x47')][_0xecaa('0x2e')]);_0x5199b4[_0xecaa('0x30')]=_[_0xecaa('0x31')](_0x2f66d8['query']);_0x5199b4[_0xecaa('0x32')]=_[_0xecaa('0x33')](_0x5199b4['model'],_0x5199b4[_0xecaa('0x30')]);_0x207b4e[_0xecaa('0x34')]=_[_0xecaa('0x33')](_0x5199b4[_0xecaa('0x2f')],qs[_0xecaa('0x35')](_0x2f66d8[_0xecaa('0x30')][_0xecaa('0x35')]));_0x207b4e[_0xecaa('0x34')]=_0x207b4e[_0xecaa('0x34')][_0xecaa('0x48')]?_0x207b4e[_0xecaa('0x34')]:_0x5199b4[_0xecaa('0x2f')];_0x207b4e[_0xecaa('0x55')]=qs['sort'](_0x2f66d8[_0xecaa('0x30')]['sort']);_0x207b4e[_0xecaa('0x39')]=qs[_0xecaa('0x32')](_[_0xecaa('0x3a')](_0x2f66d8[_0xecaa('0x30')],_0x5199b4['filters']));if(_0x2f66d8[_0xecaa('0x30')][_0xecaa('0x3b')]){_0x207b4e['where']=_[_0xecaa('0x3c')](_0x207b4e['where'],{'$or':_['map'](_0x207b4e[_0xecaa('0x34')],function(_0x5116c6){var _0x5427ee={};_0x5427ee[_0x5116c6]={'$like':'%'+_0x2f66d8[_0xecaa('0x30')][_0xecaa('0x3b')]+'%'};return _0x5427ee;})});}_0x207b4e=_[_0xecaa('0x3c')]({},_0x207b4e,_0x2f66d8[_0xecaa('0x49')]);return _0x5abb10[_0xecaa('0x54')](_0x207b4e);}})[_0xecaa('0x25')](function(_0x599842){if(_0x599842){_0x280853=_0x599842[_0xecaa('0x48')];if(!_0x2f66d8[_0xecaa('0x30')][_0xecaa('0x56')](_0xecaa('0x36'))){_0x207b4e['limit']=qs['limit'](_0x2f66d8['query'][_0xecaa('0x37')]);_0x207b4e[_0xecaa('0x1f')]=qs[_0xecaa('0x1f')](_0x2f66d8['query'][_0xecaa('0x1f')]);}return _0x5abb10['getIntervals'](_0x207b4e);}})[_0xecaa('0x25')](function(_0x5360de){if(_0x5360de){return _0x5360de?{'count':_0x280853,'rows':_0x5360de}:null;}})[_0xecaa('0x25')](respondWithResult(_0xb3f6da,null))[_0xecaa('0x44')](handleError(_0xb3f6da,null));};exports['addIntervals']=function(_0x1a41f1,_0x6262f9,_0x5c31fc){return db['Interval']['findOne']({'where':{'id':_0x1a41f1[_0xecaa('0x46')]['id']}})[_0xecaa('0x25')](handleEntityNotFound(_0x6262f9,null))[_0xecaa('0x25')](function(_0x16f0fb){if(_0x16f0fb){return db[_0xecaa('0x57')][_0xecaa('0x58')](function(_0x5bf838){return db[_0xecaa('0x47')][_0xecaa('0x52')]({'where':{'IntervalId':_0x1a41f1[_0xecaa('0x46')]['id']},'transaction':_0x5bf838})[_0xecaa('0x25')](function(_0xdfa43a){var _0x1449ea=_[_0xecaa('0x2d')](_0x1a41f1['body'],function(_0xca414d){delete _0xca414d['id'];_0xca414d[_0xecaa('0x53')]=_0x1a41f1[_0xecaa('0x46')]['id'];return _0xca414d;});return db[_0xecaa('0x47')]['bulkCreate'](_0x1449ea,{'transaction':_0x5bf838});});})[_0xecaa('0x25')](function(){return db[_0xecaa('0x47')][_0xecaa('0x42')]({'where':{'IntervalId':_0x1a41f1[_0xecaa('0x46')]['id']}});});}})['then'](respondWithResult(_0x6262f9,null))[_0xecaa('0x44')](handleError(_0x6262f9,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 06eff24..9674161 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 _0x29d0=['ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','define','Interval','rewrite','interval','string','then','all','map'];(function(_0x57f921,_0x57249c){var _0x35f022=function(_0x25fc88){while(--_0x25fc88){_0x57f921['push'](_0x57f921['shift']());}};_0x35f022(++_0x57249c);}(_0x29d0,0x136));var _0x029d=function(_0x5f0dce,_0x389b49){_0x5f0dce=_0x5f0dce-0x0;var _0x5e8a26=_0x29d0[_0x5f0dce];return _0x5e8a26;};'use strict';var attributes=require(_0x029d('0x0'));var extensions=require(_0x029d('0x1'));var iftime=require(_0x029d('0x2'))[_0x029d('0x3')];module['exports']=function(_0x3c11ed){return _0x3c11ed[_0x029d('0x4')](_0x029d('0x5'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x578d1a){extensions['rewrite'](_0x3c11ed,_0x578d1a);},'afterBulkCreate':function(_0x547153,_0x4c026a,_0x14204b){_0x14204b();extensions['rewrite'](_0x3c11ed,_0x547153[0x0]);},'afterUpdate':function(_0x18ebbc){extensions[_0x029d('0x6')](_0x3c11ed,_0x18ebbc);},'afterDestroy':function(_0xd56465){extensions['rewrite'](_0x3c11ed,_0xd56465);}},'instanceMethods':{'ifTime':function(_0x377df0=undefined,_0x400e91=new Date()){if(typeof this[_0x029d('0x7')]===_0x029d('0x8')){return iftime(this[_0x029d('0x7')],_0x377df0,_0x400e91);}else{return this['getIntervals']()[_0x029d('0x9')](function(_0x5cfac5){return Promise[_0x029d('0xa')](_0x5cfac5[_0x029d('0xb')](function(_0xb8edfd){return _0xb8edfd[_0x029d('0xc')](_0x377df0,_0x400e91);}));})[_0x029d('0x9')](function(_0x1383fb){return _0x1383fb[_0x029d('0xd')](function(_0x3be391,_0x3ea2c3){return _0x3be391||_0x3ea2c3;},![]);});}}}});}; \ No newline at end of file +var _0xe094=['then','all','map','reduce','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval'];(function(_0x27c248,_0x384dff){var _0x1b2fc2=function(_0x188255){while(--_0x188255){_0x27c248['push'](_0x27c248['shift']());}};_0x1b2fc2(++_0x384dff);}(_0xe094,0x1c0));var _0x4e09=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe094[_0x4565bf];return _0x5610ba;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x4e09('0x0'))[_0x4e09('0x1')];module[_0x4e09('0x2')]=function(_0x5de06b){return _0x5de06b[_0x4e09('0x3')](_0x4e09('0x4'),attributes,{'tableName':_0x4e09('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d589b){extensions[_0x4e09('0x6')](_0x5de06b,_0x5d589b);},'afterBulkCreate':function(_0x207d89,_0x285186,_0xab0e3f){_0xab0e3f();extensions['rewrite'](_0x5de06b,_0x207d89[0x0]);},'afterUpdate':function(_0x5c72d1){extensions['rewrite'](_0x5de06b,_0x5c72d1);},'afterDestroy':function(_0x2e70b7){extensions['rewrite'](_0x5de06b,_0x2e70b7);}},'instanceMethods':{'ifTime':function(_0x40bbfd=undefined,_0x50e9ff=new Date()){if(typeof this[_0x4e09('0x7')]==='string'){return iftime(this['interval'],_0x40bbfd,_0x50e9ff);}else{return this['getIntervals']()[_0x4e09('0x8')](function(_0x2b3ffd){return Promise[_0x4e09('0x9')](_0x2b3ffd[_0x4e09('0xa')](function(_0x1ee07b){return _0x1ee07b['ifTime'](_0x40bbfd,_0x50e9ff);}));})[_0x4e09('0x8')](function(_0x50eb00){return _0x50eb00[_0x4e09('0xb')](function(_0x12715d,_0x583c06){return _0x12715d||_0x583c06;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index ff4f93c..e884e70 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 _0xd096=['find','raw','stringify','message','findAll','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','debug','Iftime','silly','resolve','reduce','IntervalIftime','lodash','util','../../utils/iftime','../../config/logger','rpc','GetInterval','Interval','options','where','include','map','attributes','model','then','info','catch','error','ShowInterval'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xd096,0x114));var _0x6d09=function(_0x5e2721,_0x22c441){_0x5e2721=_0x5e2721-0x0;var _0x3ba42c=_0xd096[_0x5e2721];return _0x3ba42c;};'use strict';var _=require(_0x6d09('0x0'));var util=require(_0x6d09('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x6d09('0x2'))['iftime'];var logger=require(_0x6d09('0x3'))(_0x6d09('0x4'));exports[_0x6d09('0x5')]=function(_0x196b90){var _0x5f01cd=this;return new Promise(function(_0x4b0b5a,_0x1d45fb){return db[_0x6d09('0x6')]['findAll']({'raw':_0x196b90[_0x6d09('0x7')]?_0x196b90[_0x6d09('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x196b90[_0x6d09('0x7')]?_0x196b90['options'][_0x6d09('0x8')]||null:null,'attributes':_0x196b90[_0x6d09('0x7')]?_0x196b90[_0x6d09('0x7')]['attributes']||null:null,'limit':_0x196b90['options']?_0x196b90['options']['limit']||null:null,'include':_0x196b90['options']?_0x196b90['options'][_0x6d09('0x9')]?_[_0x6d09('0xa')](_0x196b90[_0x6d09('0x7')]['include'],function(_0x2a59b1){return{'model':db[_0x2a59b1['model']],'as':_0x2a59b1['as'],'attributes':_0x2a59b1[_0x6d09('0xb')],'include':_0x2a59b1[_0x6d09('0x9')]?_[_0x6d09('0xa')](_0x2a59b1['include'],function(_0x1fee0d){return{'model':db[_0x1fee0d[_0x6d09('0xc')]],'as':_0x1fee0d['as'],'attributes':_0x1fee0d[_0x6d09('0xb')],'include':_0x1fee0d['include']?_['map'](_0x1fee0d['include'],function(_0xeaa78e){return{'model':db[_0xeaa78e[_0x6d09('0xc')]],'as':_0xeaa78e['as'],'attributes':_0xeaa78e[_0x6d09('0xb')]};}):[]};}):[]};}):[]:[]})[_0x6d09('0xd')](function(_0x33af21){logger[_0x6d09('0xe')](_0x6d09('0x5'),_0x196b90);logger['debug'](_0x6d09('0x5'),_0x196b90,JSON['stringify'](_0x33af21));_0x4b0b5a(_0x33af21);})[_0x6d09('0xf')](function(_0x51b7b2){logger[_0x6d09('0x10')](_0x6d09('0x5'),_0x51b7b2['message'],_0x196b90);_0x1d45fb(_0x5f01cd[_0x6d09('0x10')](0x1f4,_0x51b7b2['message']));});});};exports[_0x6d09('0x11')]=function(_0x49cb9d){var _0x3be561=this;return new Promise(function(_0x27c879,_0x3d6ba2){return db[_0x6d09('0x6')][_0x6d09('0x12')]({'raw':_0x49cb9d[_0x6d09('0x7')]?_0x49cb9d[_0x6d09('0x7')][_0x6d09('0x13')]===undefined?!![]:![]:!![],'where':_0x49cb9d[_0x6d09('0x7')]?_0x49cb9d[_0x6d09('0x7')][_0x6d09('0x8')]||null:null,'attributes':_0x49cb9d[_0x6d09('0x7')]?_0x49cb9d[_0x6d09('0x7')][_0x6d09('0xb')]||null:null,'include':_0x49cb9d['options']?_0x49cb9d[_0x6d09('0x7')]['include']?_['map'](_0x49cb9d['options'][_0x6d09('0x9')],function(_0x29e70e){return{'model':db[_0x29e70e[_0x6d09('0xc')]],'as':_0x29e70e['as'],'attributes':_0x29e70e[_0x6d09('0xb')],'include':_0x29e70e[_0x6d09('0x9')]?_[_0x6d09('0xa')](_0x29e70e[_0x6d09('0x9')],function(_0x580a37){return{'model':db[_0x580a37[_0x6d09('0xc')]],'as':_0x580a37['as'],'attributes':_0x580a37[_0x6d09('0xb')],'include':_0x580a37[_0x6d09('0x9')]?_[_0x6d09('0xa')](_0x580a37['include'],function(_0x4a89c0){return{'model':db[_0x4a89c0[_0x6d09('0xc')]],'as':_0x4a89c0['as'],'attributes':_0x4a89c0[_0x6d09('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfdb515){logger['info'](_0x6d09('0x11'),_0x49cb9d);logger['debug']('ShowInterval',_0x49cb9d,JSON[_0x6d09('0x14')](_0xfdb515));_0x27c879(_0xfdb515);})['catch'](function(_0x176d7d){logger[_0x6d09('0x10')]('ShowInterval',_0x176d7d[_0x6d09('0x15')],_0x49cb9d);_0x3d6ba2(_0x3be561['error'](0x1f4,_0x176d7d['message']));});});};function checkArrayOfIntervals(_0x3a4c79,_0x38775b){var _0x286914=[];return db['Interval'][_0x6d09('0x16')]({'where':{'id':_0x3a4c79}})[_0x6d09('0xd')](function(_0x39dde5){_0x286914=_0x39dde5;return Promise['all'](_0x286914['map'](function(_0x13ebda){return _0x13ebda[_0x6d09('0x17')](_0x38775b);}));})[_0x6d09('0xd')](function(_0x4785bc){var _0x4f51ec=_0x4785bc['reduce'](function(_0x25f38f,_0x3f0ce7){return _0x25f38f||_0x3f0ce7;},![]);logger[_0x6d09('0xe')](util[_0x6d09('0x18')](_0x6d09('0x19'),_0x286914[_0x6d09('0xa')](function(_0x1a5d4a){return _0x1a5d4a[_0x6d09('0x1a')];})[_0x6d09('0x1b')](',\x20'),_0x286914[_0x6d09('0xa')](function(_0x396bb9){return _0x396bb9['id'];})[_0x6d09('0x1b')](',\x20')));return _0x4f51ec;});}function checkSingleInterval(_0x1d9a6e,_0x4edca7){return db['Interval']['findById'](_0x1d9a6e)[_0x6d09('0xd')](function(_0x473fd4){if(_0x473fd4){logger[_0x6d09('0xe')](util['format'](_0x6d09('0x1c'),_0x473fd4[_0x6d09('0x1a')],_0x473fd4['id']));return _0x473fd4[_0x6d09('0x17')](_0x4edca7);}});}exports['IntervalIftime']=function(_0x41375a){var _0x4c5861=_0x41375a[_0x6d09('0x1d')];var _0x137f68=Array[_0x6d09('0x1e')](_0x41375a[_0x6d09('0x1f')])?_0x41375a[_0x6d09('0x1f')]:typeof _0x41375a['intervals']===_0x6d09('0x20')?[_0x41375a[_0x6d09('0x1f')]]:[];var _0x4d2cad=_0x41375a[_0x6d09('0x21')]||undefined;var _0x4ea8d0=![];if(_0x137f68['length']){logger['info'](util['format'](_0x6d09('0x22'),_0x137f68[_0x6d09('0x1b')](';\x20')));}if(_0x4d2cad){logger['info'](util[_0x6d09('0x18')](_0x6d09('0x23'),_0x4d2cad));}logger[_0x6d09('0x24')](_0x6d09('0x25'),_0x4ea8d0);logger[_0x6d09('0x26')]('IntervalIftime',_0x41375a);return Promise[_0x6d09('0x27')]()[_0x6d09('0xd')](function(){if(Array['isArray'](_0x4c5861)){return checkArrayOfIntervals(_0x4c5861,_0x4d2cad);}else if(_0x4c5861){return checkSingleInterval(_0x4c5861,_0x4d2cad);}})[_0x6d09('0xd')](function(_0x12f1dc){var _0x174a11=_0x137f68[_0x6d09('0x28')](function(_0x47a67d,_0x1ebf1e){return _0x47a67d||iftime(_0x1ebf1e,_0x4d2cad);},![]);_0x4ea8d0=_0x12f1dc||_0x174a11;return _0x4ea8d0;})['catch'](function(_0xa28c7c){logger[_0x6d09('0x10')](_0x6d09('0x29'),_0x41375a,_0xa28c7c);throw this[_0x6d09('0x10')](0x1f4,_0xa28c7c['message']);});}; \ No newline at end of file +var _0x9667=['where','attributes','limit','include','model','then','info','GetInterval','stringify','catch','error','message','ShowInterval','map','debug','findAll','all','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','intervalIds','intervals','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','util','../../mysqldb','iftime','../../config/logger','Interval','options','raw'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9667,0xef));var _0x7966=function(_0x177966,_0x49d680){_0x177966=_0x177966-0x0;var _0x550ede=_0x9667[_0x177966];return _0x550ede;};'use strict';var _=require('lodash');var util=require(_0x7966('0x0'));var db=require(_0x7966('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x7966('0x2')];var logger=require(_0x7966('0x3'))('rpc');exports['GetInterval']=function(_0x4722f6){var _0x56b5c7=this;return new Promise(function(_0x2c3bae,_0x460861){return db[_0x7966('0x4')]['findAll']({'raw':_0x4722f6[_0x7966('0x5')]?_0x4722f6[_0x7966('0x5')][_0x7966('0x6')]===undefined?!![]:![]:!![],'where':_0x4722f6['options']?_0x4722f6[_0x7966('0x5')][_0x7966('0x7')]||null:null,'attributes':_0x4722f6[_0x7966('0x5')]?_0x4722f6[_0x7966('0x5')][_0x7966('0x8')]||null:null,'limit':_0x4722f6[_0x7966('0x5')]?_0x4722f6['options'][_0x7966('0x9')]||null:null,'include':_0x4722f6[_0x7966('0x5')]?_0x4722f6[_0x7966('0x5')][_0x7966('0xa')]?_['map'](_0x4722f6[_0x7966('0x5')]['include'],function(_0x3dd894){return{'model':db[_0x3dd894[_0x7966('0xb')]],'as':_0x3dd894['as'],'attributes':_0x3dd894[_0x7966('0x8')],'include':_0x3dd894[_0x7966('0xa')]?_['map'](_0x3dd894[_0x7966('0xa')],function(_0xdaa0ca){return{'model':db[_0xdaa0ca[_0x7966('0xb')]],'as':_0xdaa0ca['as'],'attributes':_0xdaa0ca['attributes'],'include':_0xdaa0ca[_0x7966('0xa')]?_['map'](_0xdaa0ca[_0x7966('0xa')],function(_0x1b77ac){return{'model':db[_0x1b77ac['model']],'as':_0x1b77ac['as'],'attributes':_0x1b77ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x7966('0xc')](function(_0x5cba0b){logger[_0x7966('0xd')](_0x7966('0xe'),_0x4722f6);logger['debug'](_0x7966('0xe'),_0x4722f6,JSON[_0x7966('0xf')](_0x5cba0b));_0x2c3bae(_0x5cba0b);})[_0x7966('0x10')](function(_0xba6671){logger[_0x7966('0x11')](_0x7966('0xe'),_0xba6671[_0x7966('0x12')],_0x4722f6);_0x460861(_0x56b5c7['error'](0x1f4,_0xba6671[_0x7966('0x12')]));});});};exports[_0x7966('0x13')]=function(_0x553814){var _0x12ef66=this;return new Promise(function(_0x4c4681,_0x52a1b0){return db[_0x7966('0x4')]['find']({'raw':_0x553814[_0x7966('0x5')]?_0x553814[_0x7966('0x5')][_0x7966('0x6')]===undefined?!![]:![]:!![],'where':_0x553814['options']?_0x553814[_0x7966('0x5')]['where']||null:null,'attributes':_0x553814['options']?_0x553814[_0x7966('0x5')][_0x7966('0x8')]||null:null,'include':_0x553814['options']?_0x553814[_0x7966('0x5')][_0x7966('0xa')]?_[_0x7966('0x14')](_0x553814[_0x7966('0x5')][_0x7966('0xa')],function(_0x507a84){return{'model':db[_0x507a84[_0x7966('0xb')]],'as':_0x507a84['as'],'attributes':_0x507a84[_0x7966('0x8')],'include':_0x507a84['include']?_[_0x7966('0x14')](_0x507a84[_0x7966('0xa')],function(_0xe10c8b){return{'model':db[_0xe10c8b[_0x7966('0xb')]],'as':_0xe10c8b['as'],'attributes':_0xe10c8b['attributes'],'include':_0xe10c8b['include']?_[_0x7966('0x14')](_0xe10c8b['include'],function(_0x511ef4){return{'model':db[_0x511ef4['model']],'as':_0x511ef4['as'],'attributes':_0x511ef4[_0x7966('0x8')]};}):[]};}):[]};}):[]:[]})[_0x7966('0xc')](function(_0x261454){logger[_0x7966('0xd')](_0x7966('0x13'),_0x553814);logger[_0x7966('0x15')](_0x7966('0x13'),_0x553814,JSON['stringify'](_0x261454));_0x4c4681(_0x261454);})[_0x7966('0x10')](function(_0x260bbc){logger[_0x7966('0x11')](_0x7966('0x13'),_0x260bbc[_0x7966('0x12')],_0x553814);_0x52a1b0(_0x12ef66[_0x7966('0x11')](0x1f4,_0x260bbc[_0x7966('0x12')]));});});};function checkArrayOfIntervals(_0x3118ce,_0x35b563){var _0x289548=[];return db[_0x7966('0x4')][_0x7966('0x16')]({'where':{'id':_0x3118ce}})['then'](function(_0x246c0b){_0x289548=_0x246c0b;return Promise[_0x7966('0x17')](_0x289548['map'](function(_0x42fb6c){return _0x42fb6c['ifTime'](_0x35b563);}));})[_0x7966('0xc')](function(_0x316bda){var _0x94f59f=_0x316bda[_0x7966('0x18')](function(_0x3ab0a3,_0x4b8b7f){return _0x3ab0a3||_0x4b8b7f;},![]);logger[_0x7966('0xd')](util['format'](_0x7966('0x19'),_0x289548[_0x7966('0x14')](function(_0x407faf){return _0x407faf['name'];})['join'](',\x20'),_0x289548[_0x7966('0x14')](function(_0x1f03d9){return _0x1f03d9['id'];})[_0x7966('0x1a')](',\x20')));return _0x94f59f;});}function checkSingleInterval(_0x25c168,_0x151f13){return db[_0x7966('0x4')][_0x7966('0x1b')](_0x25c168)[_0x7966('0xc')](function(_0x11b6bf){if(_0x11b6bf){logger['info'](util[_0x7966('0x1c')](_0x7966('0x1d'),_0x11b6bf[_0x7966('0x1e')],_0x11b6bf['id']));return _0x11b6bf['ifTime'](_0x151f13);}});}exports[_0x7966('0x1f')]=function(_0x4805b3){var _0x5bf06d=_0x4805b3[_0x7966('0x20')];var _0x3683cd=Array['isArray'](_0x4805b3[_0x7966('0x21')])?_0x4805b3[_0x7966('0x21')]:typeof _0x4805b3[_0x7966('0x21')]==='string'?[_0x4805b3[_0x7966('0x21')]]:[];var _0x599076=_0x4805b3[_0x7966('0x22')]||undefined;var _0x51ec4b=![];if(_0x3683cd[_0x7966('0x23')]){logger['info'](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x3683cd['join'](';\x20')));}if(_0x599076){logger[_0x7966('0xd')](util[_0x7966('0x1c')](_0x7966('0x24'),_0x599076));}logger[_0x7966('0x15')](_0x7966('0x25'),_0x51ec4b);logger[_0x7966('0x26')](_0x7966('0x1f'),_0x4805b3);return Promise[_0x7966('0x27')]()[_0x7966('0xc')](function(){if(Array[_0x7966('0x28')](_0x5bf06d)){return checkArrayOfIntervals(_0x5bf06d,_0x599076);}else if(_0x5bf06d){return checkSingleInterval(_0x5bf06d,_0x599076);}})['then'](function(_0x279cd8){var _0x4e092c=_0x3683cd[_0x7966('0x18')](function(_0x2ad94a,_0x34ded1){return _0x2ad94a||iftime(_0x34ded1,_0x599076);},![]);_0x51ec4b=_0x279cd8||_0x4e092c;return _0x51ec4b;})[_0x7966('0x10')](function(_0x17c7fc){logger['error']('IntervalIftime',_0x4805b3,_0x17c7fc);throw this[_0x7966('0x11')](0x1f4,_0x17c7fc['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 1898306..e9827c6 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0xe20511,_0x5091f2){var _0x49a6a5=function(_0x274c50){while(--_0x274c50){_0xe20511['push'](_0xe20511['shift']());}};_0x49a6a5(++_0x5091f2);}(_0xadb5,0xad));var _0x5adb=function(_0x48d37d,_0x3523ec){_0x48d37d=_0x48d37d-0x0;var _0xf072d9=_0xadb5[_0x48d37d];return _0xf072d9;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2784c84..c7ee44f 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 _0x065c=['body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x217922,_0x4b9b65){var _0x5464c6=function(_0x4c85c9){while(--_0x4c85c9){_0x217922['push'](_0x217922['shift']());}};_0x5464c6(++_0x4b9b65);}(_0x065c,0x13a));var _0xc065=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x065c[_0x4709c8];return _0x478cdd;};'use strict';var BPromise=require(_0xc065('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xc065('0x1'));var USERNAME=_0xc065('0x2');var PASSWORD=_0xc065('0x3');function openIssue(_0x1eefbd,_0x52ee30){var _0x211c17={'fields':{'project':{'key':_0x1eefbd[_0xc065('0x4')]||_0xc065('0x5')},'summary':(_0x1eefbd[_0xc065('0x6')]||_0xc065('0x7'))+'\x20from\x20'+_0x1eefbd['ip'],'description':_0x1eefbd[_0xc065('0x8')]||JSON[_0xc065('0x9')](_0x1eefbd),'issuetype':{'name':_0x1eefbd[_0xc065('0xa')]||_0xc065('0xb')}}};_0x211c17[_0xc065('0xc')][_0xc065('0xd')]=_0x1eefbd[_0xc065('0xe')];_0x211c17['fields'][_0xc065('0xf')]=_0x1eefbd[_0xc065('0x10')];_0x211c17[_0xc065('0xc')]['customfield_11502']=_0x1eefbd['newToken'];_0x211c17[_0xc065('0xc')][_0xc065('0x11')]=_0x1eefbd['name'];_0x211c17[_0xc065('0xc')][_0xc065('0x12')]=_0x1eefbd[_0xc065('0x13')];_0x211c17[_0xc065('0xc')][_0xc065('0x14')]=_0x1eefbd['ip'];var _0x25e37b={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc065('0x15'),'method':_0xc065('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xc065('0x17'),'Authorization':_0xc065('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xc065('0x19')](_0xc065('0x1a'))}};var _0x2f30ab=JSON[_0xc065('0x9')](_0x211c17);var _0x366f7a=https['request'](_0x25e37b,function(_0x5bd010){_0x5bd010[_0xc065('0x1b')](_0xc065('0x1c'));var _0x314be9='';_0x5bd010['on']('data',function(_0x5cdc02){_0x314be9+=_0x5cdc02;});_0x5bd010['on'](_0xc065('0x1d'),function(){if(_0x52ee30){return _0x52ee30[_0xc065('0x1e')](_0x5bd010[_0xc065('0x1f')])[_0xc065('0x20')](JSON[_0xc065('0x21')](_0x314be9));}});});_0x366f7a['on']('error',function(_0x52b96d){if(_0x52ee30){return _0x52ee30[_0xc065('0x1e')](0x1f4)['json']({'errors':[{'message':_0xc065('0x22'),'type':_0xc065('0x23')}]});}});_0x366f7a[_0xc065('0x24')](_0x2f30ab);_0x366f7a['end']();}exports[_0xc065('0x25')]=openIssue;exports['send']=function(_0x272dc9,_0x216b56){_0x272dc9[_0xc065('0x26')]['ip']=_0x272dc9[_0xc065('0x27')][_0xc065('0x28')]||_0x272dc9[_0xc065('0x29')][_0xc065('0x2a')]||_0x272dc9[_0xc065('0x2b')][_0xc065('0x2a')]||_0x272dc9[_0xc065('0x29')][_0xc065('0x2b')][_0xc065('0x2a')];return openIssue(_0x272dc9[_0xc065('0x26')],_0x216b56);}; \ No newline at end of file +var _0x21fe=['socket','../../config/logger','api','key','MOTGUI','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','headers','remoteAddress'];(function(_0x3fd4e0,_0x1e38a4){var _0x4d53f1=function(_0x51890b){while(--_0x51890b){_0x3fd4e0['push'](_0x3fd4e0['shift']());}};_0x4d53f1(++_0x1e38a4);}(_0x21fe,0x76));var _0xe21f=function(_0x44485a,_0x23ace8){_0x44485a=_0x44485a-0x0;var _0x4763d5=_0x21fe[_0x44485a];return _0x4763d5;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xe21f('0x0'))(_0xe21f('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x1e9fd0,_0x3675a8){var _0xd78ca4={'fields':{'project':{'key':_0x1e9fd0[_0xe21f('0x2')]||_0xe21f('0x3')},'summary':(_0x1e9fd0['summary']||'Report')+'\x20from\x20'+_0x1e9fd0['ip'],'description':_0x1e9fd0['description']||JSON[_0xe21f('0x4')](_0x1e9fd0),'issuetype':{'name':_0x1e9fd0[_0xe21f('0x5')]||_0xe21f('0x6')}}};_0xd78ca4[_0xe21f('0x7')]['customfield_11500']=_0x1e9fd0[_0xe21f('0x8')];_0xd78ca4[_0xe21f('0x7')][_0xe21f('0x9')]=_0x1e9fd0[_0xe21f('0xa')];_0xd78ca4[_0xe21f('0x7')][_0xe21f('0xb')]=_0x1e9fd0[_0xe21f('0xc')];_0xd78ca4[_0xe21f('0x7')][_0xe21f('0xd')]=_0x1e9fd0['name'];_0xd78ca4[_0xe21f('0x7')][_0xe21f('0xe')]=_0x1e9fd0[_0xe21f('0xf')];_0xd78ca4[_0xe21f('0x7')][_0xe21f('0x10')]=_0x1e9fd0['ip'];var _0x560cd6={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xe21f('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xe21f('0x12'),'Authorization':_0xe21f('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0xe21f('0x14')](_0xe21f('0x15'))}};var _0x3d972f=JSON[_0xe21f('0x4')](_0xd78ca4);var _0xd9f91d=https[_0xe21f('0x16')](_0x560cd6,function(_0x151bf0){_0x151bf0[_0xe21f('0x17')](_0xe21f('0x18'));var _0x18d546='';_0x151bf0['on']('data',function(_0x12f001){_0x18d546+=_0x12f001;});_0x151bf0['on']('end',function(){if(_0x3675a8){return _0x3675a8[_0xe21f('0x19')](_0x151bf0[_0xe21f('0x1a')])[_0xe21f('0x1b')](JSON['parse'](_0x18d546));}});});_0xd9f91d['on'](_0xe21f('0x1c'),function(_0x752f5e){if(_0x3675a8){return _0x3675a8[_0xe21f('0x19')](0x1f4)[_0xe21f('0x1b')]({'errors':[{'message':_0xe21f('0x1d'),'type':_0xe21f('0x1e')}]});}});_0xd9f91d[_0xe21f('0x1f')](_0x3d972f);_0xd9f91d[_0xe21f('0x20')]();}exports[_0xe21f('0x21')]=openIssue;exports[_0xe21f('0x22')]=function(_0x2a757f,_0x507e2e){_0x2a757f[_0xe21f('0x23')]['ip']=_0x2a757f[_0xe21f('0x24')]['x-forwarded-for']||_0x2a757f['connection'][_0xe21f('0x25')]||_0x2a757f[_0xe21f('0x26')][_0xe21f('0x25')]||_0x2a757f['connection'][_0xe21f('0x26')][_0xe21f('0x25')];return openIssue(_0x2a757f[_0xe21f('0x23')],_0x507e2e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 086011e..878e503 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 _0x54ef=['/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','get'];(function(_0x479f05,_0x5ca7bf){var _0xcdda81=function(_0x50e770){while(--_0x50e770){_0x479f05['push'](_0x479f05['shift']());}};_0xcdda81(++_0x5ca7bf);}(_0x54ef,0x112));var _0xf54e=function(_0x42a5e7,_0x238209){_0x42a5e7=_0x42a5e7-0x0;var _0x24d08c=_0x54ef[_0x42a5e7];return _0x24d08c;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['show']);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router[_0xf54e('0x12')]('/:id',auth[_0xf54e('0xf')](),controller[_0xf54e('0x13')]);router[_0xf54e('0x14')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xdace=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x2e5c02,_0x2cc819){var _0xe279ad=function(_0xb2798f){while(--_0xb2798f){_0x2e5c02['push'](_0x2e5c02['shift']());}};_0xe279ad(++_0x2cc819);}(_0xdace,0xc5));var _0xedac=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0xdace[_0x14e27a];return _0x288688;};'use strict';var multer=require(_0xedac('0x0'));var util=require('util');var path=require(_0xedac('0x1'));var timeout=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express['Router']();var fs_extra=require(_0xedac('0x4'));var auth=require(_0xedac('0x5'));var interaction=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0xedac('0x8')]('/',auth[_0xedac('0x9')](),controller[_0xedac('0xa')]);router['get'](_0xedac('0xb'),auth[_0xedac('0x9')](),controller[_0xedac('0xc')]);router['get'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xedac('0xf')]);router[_0xedac('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xedac('0x11')]);router[_0xedac('0x12')]('/:id',auth[_0xedac('0x9')](),controller['destroy']);module[_0xedac('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 85a91db..ecd2641 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x3aeb79,_0x2210a9){_0x3aeb79=_0x3aeb79-0x0;var _0x1fe740=_0x7a54[_0x3aeb79];return _0x1fe740;};'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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x542420,_0x3632c1){_0x542420=_0x542420-0x0;var _0x51dbad=_0x7a54[_0x542420];return _0x51dbad;};'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 b8a8124..4f0bb9d 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 _0x31c2=['then','destroy','error','name','send','index','map','JscriptyAnswerReport','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x31c2,0x1e1));var _0x231c=function(_0x5eb236,_0x571fa5){_0x5eb236=_0x5eb236-0x0;var _0x5c7af4=_0x31c2[_0x5eb236];return _0x5c7af4;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require(_0x231c('0x1'));var zipdir=require(_0x231c('0x2'));var jsonpatch=require(_0x231c('0x3'));var rp=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var BPromise=require(_0x231c('0x6'));var Mustache=require(_0x231c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x231c('0x8'));var csv=require(_0x231c('0x9'));var ejs=require(_0x231c('0xa'));var fs=require('fs');var fs_extra=require(_0x231c('0xb'));var _=require('lodash');var squel=require(_0x231c('0xc'));var crypto=require('crypto');var jsforce=require(_0x231c('0xd'));var deskjs=require(_0x231c('0xe'));var toCsv=require(_0x231c('0x9'));var querystring=require('querystring');var Papa=require(_0x231c('0xf'));var Redis=require(_0x231c('0x10'));var authService=require(_0x231c('0x11'));var qs=require(_0x231c('0x12'));var as=require(_0x231c('0x13'));var hardwareService=require(_0x231c('0x14'));var logger=require(_0x231c('0x15'))('api');var utils=require(_0x231c('0x16'));var config=require(_0x231c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x231c('0x18'))['db'];function respondWithStatusCode(_0x43c270,_0x871ed1){_0x871ed1=_0x871ed1||0xcc;return function(_0x1aa3fe){if(_0x1aa3fe){return _0x43c270[_0x231c('0x19')](_0x871ed1);}return _0x43c270[_0x231c('0x1a')](_0x871ed1)[_0x231c('0x1b')]();};}function respondWithResult(_0x3355f6,_0xc09de5){_0xc09de5=_0xc09de5||0xc8;return function(_0x311218){if(_0x311218){return _0x3355f6[_0x231c('0x1a')](_0xc09de5)[_0x231c('0x1c')](_0x311218);}};}function respondWithFilteredResult(_0xe37de8,_0x1f7764){return function(_0x12a6ad){if(_0x12a6ad){var _0x210f2e=typeof _0x1f7764[_0x231c('0x1d')]===_0x231c('0x1e')&&typeof _0x1f7764[_0x231c('0x1f')]===_0x231c('0x1e');var _0x51b8ca=_0x12a6ad[_0x231c('0x20')];var _0x341645=_0x210f2e?0x0:_0x1f7764[_0x231c('0x1d')];var _0xadea80=_0x210f2e?_0x12a6ad[_0x231c('0x20')]:_0x1f7764[_0x231c('0x1d')]+_0x1f7764[_0x231c('0x1f')];var _0x172d50;if(_0xadea80>=_0x51b8ca){_0xadea80=_0x51b8ca;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0xe37de8[_0x231c('0x1a')](_0x172d50);return _0xe37de8[_0x231c('0x21')]('Content-Range',_0x341645+'-'+_0xadea80+'/'+_0x51b8ca)[_0x231c('0x1c')](_0x12a6ad);}return null;};}function patchUpdates(_0x5e8a53){return function(_0x872034){try{jsonpatch['apply'](_0x872034,_0x5e8a53,!![]);}catch(_0x42cca3){return BPromise[_0x231c('0x22')](_0x42cca3);}return _0x872034[_0x231c('0x23')]();};}function saveUpdates(_0x3267f9,_0x255671){return function(_0x309393){if(_0x309393){return _0x309393[_0x231c('0x24')](_0x3267f9)[_0x231c('0x25')](function(_0x54566f){return _0x54566f;});}return null;};}function removeEntity(_0x128112,_0x3336d8){return function(_0x4af49b){if(_0x4af49b){return _0x4af49b[_0x231c('0x26')]()[_0x231c('0x25')](function(){_0x128112['status'](0xcc)[_0x231c('0x1b')]();});}};}function handleEntityNotFound(_0x564939,_0x3ea0cd){return function(_0x454f70){if(!_0x454f70){_0x564939[_0x231c('0x19')](0x194);}return _0x454f70;};}function handleError(_0x2a673c,_0x449d74){_0x449d74=_0x449d74||0x1f4;return function(_0x131cfd){logger[_0x231c('0x27')](_0x131cfd['stack']);if(_0x131cfd[_0x231c('0x28')]){delete _0x131cfd[_0x231c('0x28')];}_0x2a673c['status'](_0x449d74)[_0x231c('0x29')](_0x131cfd);};}exports[_0x231c('0x2a')]=function(_0x45ced8,_0xeeddfc){var _0x271635={},_0x15a9bb={},_0x40f76e={'count':0x0,'rows':[]};var _0x4dfaa3=_[_0x231c('0x2b')](db[_0x231c('0x2c')]['rawAttributes'],function(_0x4be2e2){return{'name':_0x4be2e2['fieldName'],'type':_0x4be2e2[_0x231c('0x2d')]['key']};});_0x15a9bb[_0x231c('0x2e')]=_['map'](_0x4dfaa3,_0x231c('0x28'));_0x15a9bb[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x45ced8[_0x231c('0x2f')]);_0x15a9bb['filters']=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],_0x15a9bb[_0x231c('0x2f')]);_0x271635[_0x231c('0x32')]=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x45ced8[_0x231c('0x2f')]['fields']));_0x271635['attributes']=_0x271635[_0x231c('0x32')][_0x231c('0x34')]?_0x271635[_0x231c('0x32')]:_0x15a9bb[_0x231c('0x2e')];if(!_0x45ced8[_0x231c('0x2f')][_0x231c('0x35')]('nolimit')){_0x271635[_0x231c('0x1f')]=qs[_0x231c('0x1f')](_0x45ced8['query']['limit']);_0x271635[_0x231c('0x1d')]=qs['offset'](_0x45ced8[_0x231c('0x2f')]['offset']);}_0x271635[_0x231c('0x36')]=qs[_0x231c('0x37')](_0x45ced8['query'][_0x231c('0x37')]);_0x271635[_0x231c('0x38')]=qs[_0x231c('0x39')](_['pick'](_0x45ced8[_0x231c('0x2f')],_0x15a9bb[_0x231c('0x39')]),_0x4dfaa3);if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3a')]){_0x271635[_0x231c('0x38')]=_[_0x231c('0x3b')](_0x271635[_0x231c('0x38')],{'$or':_[_0x231c('0x2b')](_0x4dfaa3,function(_0x409b01){if(_0x409b01[_0x231c('0x2d')]!==_0x231c('0x3c')){var _0x2c8033={};_0x2c8033[_0x409b01[_0x231c('0x28')]]={'$like':'%'+_0x45ced8['query'][_0x231c('0x3a')]+'%'};return _0x2c8033;}})});}_0x271635=_[_0x231c('0x3b')]({},_0x271635,_0x45ced8[_0x231c('0x3d')]);var _0x2f763d={'where':_0x271635[_0x231c('0x38')]};return db['JscriptyAnswerReport'][_0x231c('0x20')](_0x2f763d)[_0x231c('0x25')](function(_0x229953){_0x40f76e['count']=_0x229953;if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3e')]){_0x271635[_0x231c('0x3f')]=[{'all':!![]}];}return db[_0x231c('0x2c')][_0x231c('0x40')](_0x271635);})[_0x231c('0x25')](function(_0x5d46eb){_0x40f76e[_0x231c('0x41')]=_0x5d46eb;return _0x40f76e;})[_0x231c('0x25')](respondWithFilteredResult(_0xeeddfc,_0x271635))[_0x231c('0x42')](handleError(_0xeeddfc,null));};exports[_0x231c('0x43')]=function(_0x518011,_0x33396b){var _0x523339={'raw':!![],'where':{'id':_0x518011['params']['id']}},_0x26bfd2={};_0x26bfd2[_0x231c('0x2e')]=_[_0x231c('0x30')](db[_0x231c('0x2c')][_0x231c('0x44')]);_0x26bfd2[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x518011['query']);_0x26bfd2[_0x231c('0x39')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],_0x26bfd2['query']);_0x523339[_0x231c('0x32')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x518011['query'][_0x231c('0x33')]));_0x523339['attributes']=_0x523339[_0x231c('0x32')][_0x231c('0x34')]?_0x523339[_0x231c('0x32')]:_0x26bfd2[_0x231c('0x2e')];if(_0x518011[_0x231c('0x2f')][_0x231c('0x3e')]){_0x523339[_0x231c('0x3f')]=[{'all':!![]}];}_0x523339=_[_0x231c('0x3b')]({},_0x523339,_0x518011[_0x231c('0x3d')]);return db[_0x231c('0x2c')][_0x231c('0x45')](_0x523339)[_0x231c('0x25')](handleEntityNotFound(_0x33396b,null))[_0x231c('0x25')](respondWithResult(_0x33396b,null))[_0x231c('0x42')](handleError(_0x33396b,null));};exports['create']=function(_0x18aaca,_0x293de2){return db[_0x231c('0x2c')][_0x231c('0x46')](_0x18aaca[_0x231c('0x47')],{})['then'](respondWithResult(_0x293de2,0xc9))['catch'](handleError(_0x293de2,null));};exports[_0x231c('0x24')]=function(_0x56a885,_0x419f63){if(_0x56a885[_0x231c('0x47')]['id']){delete _0x56a885[_0x231c('0x47')]['id'];}return db['JscriptyAnswerReport'][_0x231c('0x45')]({'where':{'id':_0x56a885['params']['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x419f63,null))[_0x231c('0x25')](saveUpdates(_0x56a885['body'],null))[_0x231c('0x25')](respondWithResult(_0x419f63,null))[_0x231c('0x42')](handleError(_0x419f63,null));};exports[_0x231c('0x26')]=function(_0x5d2d20,_0x49baac){return db['JscriptyAnswerReport'][_0x231c('0x45')]({'where':{'id':_0x5d2d20[_0x231c('0x48')]['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x49baac,null))['then'](removeEntity(_0x49baac,null))[_0x231c('0x42')](handleError(_0x49baac,null));};exports[_0x231c('0x49')]=function(_0x4fd60b,_0xf225d0){return db[_0x231c('0x2c')][_0x231c('0x49')]()[_0x231c('0x25')](respondWithResult(_0xf225d0,null))[_0x231c('0x42')](handleError(_0xf225d0,null));}; \ No newline at end of file +var _0xfd20=['map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x487d9b,_0x6f1c8d){var _0x3557fa=function(_0xd99d5c){while(--_0xd99d5c){_0x487d9b['push'](_0x487d9b['shift']());}};_0x3557fa(++_0x6f1c8d);}(_0xfd20,0x66));var _0x0fd2=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0xfd20[_0x581960];return _0x4ee892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['JscriptyAnswerReport']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['JscriptyAnswerReport'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 1c67aad..60c4518 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 _0xde78=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x237cb0,_0x89a59a){var _0x30ed57=function(_0x24706e){while(--_0x24706e){_0x237cb0['push'](_0x237cb0['shift']());}};_0x30ed57(++_0x89a59a);}(_0xde78,0x18e));var _0x8de7=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xde78[_0x232ec0];return _0x356705;};'use strict';var _=require(_0x8de7('0x0'));var util=require(_0x8de7('0x1'));var logger=require(_0x8de7('0x2'))(_0x8de7('0x3'));var moment=require(_0x8de7('0x4'));var BPromise=require(_0x8de7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8de7('0x6'));var rimraf=require('rimraf');var config=require(_0x8de7('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x8de7('0x8')]=function(_0x402618,_0x55b8fe){return _0x402618[_0x8de7('0x9')](_0x8de7('0xa'),attributes,{'tableName':_0x8de7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e17=['report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','JscriptyAnswerReport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1e17,0xd2));var _0x71e1=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x1e17[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x71e1('0x0'));var util=require(_0x71e1('0x1'));var logger=require(_0x71e1('0x2'))(_0x71e1('0x3'));var moment=require('moment');var BPromise=require(_0x71e1('0x4'));var rp=require(_0x71e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71e1('0x6'));var config=require(_0x71e1('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x431436,_0xbbfd9f){return _0x431436[_0x71e1('0x8')](_0x71e1('0x9'),attributes,{'tableName':_0x71e1('0xa'),'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 738f7f7..42955d1 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 _0x7127=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x7127,0xd1));var _0x7712=function(_0x278b47,_0x5116e4){_0x278b47=_0x278b47-0x0;var _0x47eb26=_0x7127[_0x278b47];return _0x47eb26;};'use strict';var _=require(_0x7712('0x0'));var util=require('util');var moment=require(_0x7712('0x1'));var BPromise=require(_0x7712('0x2'));var rs=require(_0x7712('0x3'));var fs=require('fs');var Redis=require(_0x7712('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7712('0x5'))(_0x7712('0x6'));var config=require(_0x7712('0x7'));var jayson=require(_0x7712('0x8'));var client=jayson['client'][_0x7712('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x70966,_0x260353,_0x2e371c){return new BPromise(function(_0x3ea7a9,_0x52a161){return client['request'](_0x70966,_0x2e371c)['then'](function(_0x45273d){logger[_0x7712('0xa')](_0x7712('0xb'),_0x260353,_0x7712('0xc'));logger['debug'](_0x7712('0xd'),_0x260353,_0x7712('0xc'),JSON[_0x7712('0xe')](_0x45273d));if(_0x45273d[_0x7712('0xf')]){if(_0x45273d['error']['code']===0x1f4){logger[_0x7712('0xf')](_0x7712('0xb'),_0x260353,_0x45273d[_0x7712('0xf')][_0x7712('0x10')]);return _0x52a161(_0x45273d[_0x7712('0xf')]['message']);}logger['error'](_0x7712('0xb'),_0x260353,_0x45273d[_0x7712('0xf')][_0x7712('0x10')]);return _0x3ea7a9(_0x45273d[_0x7712('0xf')][_0x7712('0x10')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x260353,'request\x20sent');_0x3ea7a9(_0x45273d[_0x7712('0x11')]['message']);}})[_0x7712('0x12')](function(_0x257238){logger[_0x7712('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x260353,_0x257238);_0x52a161(_0x257238);});});} \ No newline at end of file +var _0x8cf3=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x26edac,_0x40d5ba){var _0x502b86=function(_0x23e270){while(--_0x23e270){_0x26edac['push'](_0x26edac['shift']());}};_0x502b86(++_0x40d5ba);}(_0x8cf3,0x1bf));var _0x38cf=function(_0x1e840c,_0x4f45e2){_0x1e840c=_0x1e840c-0x0;var _0x24ed9a=_0x8cf3[_0x1e840c];return _0x24ed9a;};'use strict';var _=require(_0x38cf('0x0'));var util=require(_0x38cf('0x1'));var moment=require(_0x38cf('0x2'));var BPromise=require(_0x38cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38cf('0x5'));var logger=require(_0x38cf('0x6'))(_0x38cf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x38cf('0x8')][_0x38cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43d0a7,_0x10a8eb,_0x50c779){return new BPromise(function(_0x187394,_0x370aaf){return client[_0x38cf('0xa')](_0x43d0a7,_0x50c779)[_0x38cf('0xb')](function(_0x47daa9){logger[_0x38cf('0xc')](_0x38cf('0xd'),_0x10a8eb,_0x38cf('0xe'));logger[_0x38cf('0xf')](_0x38cf('0x10'),_0x10a8eb,_0x38cf('0xe'),JSON[_0x38cf('0x11')](_0x47daa9));if(_0x47daa9[_0x38cf('0x12')]){if(_0x47daa9['error'][_0x38cf('0x13')]===0x1f4){logger[_0x38cf('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x10a8eb,_0x47daa9[_0x38cf('0x12')]['message']);return _0x370aaf(_0x47daa9['error'][_0x38cf('0x14')]);}logger[_0x38cf('0x12')](_0x38cf('0xd'),_0x10a8eb,_0x47daa9['error'][_0x38cf('0x14')]);return _0x187394(_0x47daa9['error'][_0x38cf('0x14')]);}else{logger[_0x38cf('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x10a8eb,'request\x20sent');_0x187394(_0x47daa9[_0x38cf('0x15')][_0x38cf('0x14')]);}})[_0x38cf('0x16')](function(_0x29d224){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x10a8eb,_0x29d224);_0x370aaf(_0x29d224);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e6889a5..f6bb5d6 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 _0xb9d6=['create','/:id/clone','clone','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post'];(function(_0x396510,_0x3691a9){var _0x3c0277=function(_0x26d1ef){while(--_0x26d1ef){_0x396510['push'](_0x396510['shift']());}};_0x3c0277(++_0x3691a9);}(_0xb9d6,0x124));var _0x6b9d=function(_0x3079b9,_0x58d2f4){_0x3079b9=_0x3079b9-0x0;var _0x105101=_0xb9d6[_0x3079b9];return _0x105101;};'use strict';var multer=require(_0x6b9d('0x0'));var util=require('util');var path=require(_0x6b9d('0x1'));var timeout=require(_0x6b9d('0x2'));var express=require(_0x6b9d('0x3'));var router=express['Router']();var fs_extra=require(_0x6b9d('0x4'));var auth=require(_0x6b9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b9d('0x6'));var controller=require(_0x6b9d('0x7'));router[_0x6b9d('0x8')]('/',auth[_0x6b9d('0x9')](),controller[_0x6b9d('0xa')]);router['get'](_0x6b9d('0xb'),auth[_0x6b9d('0x9')](),controller[_0x6b9d('0xc')]);router[_0x6b9d('0x8')](_0x6b9d('0xd'),auth[_0x6b9d('0x9')](),controller[_0x6b9d('0xe')]);router[_0x6b9d('0x8')](_0x6b9d('0xf'),auth['isAuthenticated'](),controller[_0x6b9d('0x10')]);router['get'](_0x6b9d('0x11'),auth[_0x6b9d('0x9')](),timeout(_0x6b9d('0x12')),controller['getSummary']);router[_0x6b9d('0x13')]('/',auth[_0x6b9d('0x9')](),controller[_0x6b9d('0x14')]);router[_0x6b9d('0x13')](_0x6b9d('0x15'),auth[_0x6b9d('0x9')](),controller[_0x6b9d('0x16')]);router['put']('/:id',auth[_0x6b9d('0x9')](),controller[_0x6b9d('0x17')]);router[_0x6b9d('0x18')](_0x6b9d('0xb'),auth[_0x6b9d('0x9')](),controller['destroy']);module[_0x6b9d('0x19')]=router; \ No newline at end of file +var _0x82fa=['post','/:id/clone','clone','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s'];(function(_0x225872,_0x30c510){var _0x3016a2=function(_0x39ef12){while(--_0x39ef12){_0x225872['push'](_0x225872['shift']());}};_0x3016a2(++_0x30c510);}(_0x82fa,0x19e));var _0xa82f=function(_0x2677c3,_0xa3e026){_0x2677c3=_0x2677c3-0x0;var _0x49d1be=_0x82fa[_0x2677c3];return _0x49d1be;};'use strict';var multer=require('multer');var util=require(_0xa82f('0x0'));var path=require(_0xa82f('0x1'));var timeout=require(_0xa82f('0x2'));var express=require(_0xa82f('0x3'));var router=express['Router']();var fs_extra=require(_0xa82f('0x4'));var auth=require(_0xa82f('0x5'));var interaction=require(_0xa82f('0x6'));var config=require(_0xa82f('0x7'));var controller=require(_0xa82f('0x8'));router['get']('/',auth[_0xa82f('0x9')](),controller['index']);router['get']('/:id',auth[_0xa82f('0x9')](),controller[_0xa82f('0xa')]);router[_0xa82f('0xb')](_0xa82f('0xc'),auth[_0xa82f('0x9')](),controller[_0xa82f('0xd')]);router['get'](_0xa82f('0xe'),auth['isAuthenticated'](),controller[_0xa82f('0xf')]);router[_0xa82f('0xb')](_0xa82f('0x10'),auth[_0xa82f('0x9')](),timeout(_0xa82f('0x11')),controller['getSummary']);router[_0xa82f('0x12')]('/',auth[_0xa82f('0x9')](),controller['create']);router[_0xa82f('0x12')](_0xa82f('0x13'),auth[_0xa82f('0x9')](),controller[_0xa82f('0x14')]);router[_0xa82f('0x15')](_0xa82f('0x16'),auth['isAuthenticated'](),controller[_0xa82f('0x17')]);router[_0xa82f('0x18')](_0xa82f('0x16'),auth['isAuthenticated'](),controller[_0xa82f('0x19')]);module[_0xa82f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 434ad46..ec964b2 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 _0x143b=['description','BOOLEAN','lodash','util','exports','STRING','name','long','stringify','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x100d8b,_0x1f7d98){var _0x384eee=function(_0x6e1d98){while(--_0x6e1d98){_0x100d8b['push'](_0x100d8b['shift']());}};_0x384eee(++_0x1f7d98);}(_0x143b,0x11a));var _0xb143=function(_0x16b63c,_0x4e111e){_0x16b63c=_0x16b63c-0x0;var _0x522a79=_0x143b[_0x16b63c];return _0x522a79;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb143('0x0'));var util=require(_0xb143('0x1'));module[_0xb143('0x2')]={'name':{'type':Sequelize[_0xb143('0x3')],'unique':_0xb143('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb143('0x5')),'set':function(_0x2d304a){if(_['isObjectLike'](_0x2d304a)){this['setDataValue']('formData',JSON[_0xb143('0x6')](_0x2d304a));}else if(_['isString'](_0x2d304a)){this[_0xb143('0x7')](_0xb143('0x8'),_0x2d304a);}else{this[_0xb143('0x7')](_0xb143('0x8'),util[_0xb143('0x9')](_0xb143('0xa'),this[_0xb143('0xb')](_0xb143('0x4'))||'',this[_0xb143('0xb')](_0xb143('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb143('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb143('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xbd1a=['isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','exports','name','STRING','TEXT','long'];(function(_0xdc459b,_0x2aaba3){var _0x36f854=function(_0x48f3ce){while(--_0x48f3ce){_0xdc459b['push'](_0xdc459b['shift']());}};_0x36f854(++_0x2aaba3);}(_0xbd1a,0x90));var _0xabd1=function(_0x3d58cf,_0x2bf8ad){_0x3d58cf=_0x3d58cf-0x0;var _0x44956a=_0xbd1a[_0x3d58cf];return _0x44956a;};'use strict';var Sequelize=require(_0xabd1('0x0'));var _=require('lodash');var util=require('util');module[_0xabd1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xabd1('0x2')},'description':{'type':Sequelize[_0xabd1('0x3')]},'formData':{'type':Sequelize[_0xabd1('0x4')](_0xabd1('0x5')),'set':function(_0x36d272){if(_[_0xabd1('0x6')](_0x36d272)){this['setDataValue'](_0xabd1('0x7'),JSON[_0xabd1('0x8')](_0x36d272));}else if(_[_0xabd1('0x9')](_0x36d272)){this[_0xabd1('0xa')](_0xabd1('0x7'),_0x36d272);}else{this[_0xabd1('0xa')](_0xabd1('0x7'),util['format'](_0xabd1('0xb'),this[_0xabd1('0xc')]('name')||'',this[_0xabd1('0xc')](_0xabd1('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xabd1('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xabd1('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index f324f07..32437c7 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 _0x7ebf=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','offset','limit','count','status','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','name','send','JscriptyProject','type','key','model','map','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Projects','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','autoAssociation','getSessions','JscriptySessionReport','order','ProjectId','filter','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','parse','findAll','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x7ebf,0x153));var _0xf7eb=function(_0x12a530,_0x19a689){_0x12a530=_0x12a530-0x0;var _0x74d3e6=_0x7ebf[_0x12a530];return _0x74d3e6;};'use strict';var emlformat=require(_0xf7eb('0x0'));var rimraf=require(_0xf7eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7eb('0x2'));var rp=require(_0xf7eb('0x3'));var moment=require(_0xf7eb('0x4'));var BPromise=require(_0xf7eb('0x5'));var Mustache=require(_0xf7eb('0x6'));var util=require(_0xf7eb('0x7'));var path=require(_0xf7eb('0x8'));var sox=require(_0xf7eb('0x9'));var csv=require(_0xf7eb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7eb('0xb'));var _=require(_0xf7eb('0xc'));var squel=require(_0xf7eb('0xd'));var crypto=require(_0xf7eb('0xe'));var jsforce=require(_0xf7eb('0xf'));var deskjs=require(_0xf7eb('0x10'));var toCsv=require(_0xf7eb('0xa'));var querystring=require(_0xf7eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xf7eb('0x12'));var authService=require(_0xf7eb('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7eb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf7eb('0x15'));var config=require(_0xf7eb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7eb('0x17'))['db'];function respondWithStatusCode(_0x2d58fc,_0x4ad386){_0x4ad386=_0x4ad386||0xcc;return function(_0x39eefe){if(_0x39eefe){return _0x2d58fc['sendStatus'](_0x4ad386);}return _0x2d58fc['status'](_0x4ad386)[_0xf7eb('0x18')]();};}function respondWithResult(_0x1c019b,_0x51d97f){_0x51d97f=_0x51d97f||0xc8;return function(_0xd02a6a){if(_0xd02a6a){return _0x1c019b['status'](_0x51d97f)['json'](_0xd02a6a);}};}function respondWithFilteredResult(_0x91e683,_0x5390d1){return function(_0x1c2b1c){if(_0x1c2b1c){var _0x5d1f14=typeof _0x5390d1[_0xf7eb('0x19')]==='undefined'&&typeof _0x5390d1[_0xf7eb('0x1a')]==='undefined';var _0x9d325c=_0x1c2b1c['count'];var _0x4188b6=_0x5d1f14?0x0:_0x5390d1['offset'];var _0x14d501=_0x5d1f14?_0x1c2b1c[_0xf7eb('0x1b')]:_0x5390d1[_0xf7eb('0x19')]+_0x5390d1[_0xf7eb('0x1a')];var _0x20d407;if(_0x14d501>=_0x9d325c){_0x14d501=_0x9d325c;_0x20d407=0xc8;}else{_0x20d407=0xce;}_0x91e683[_0xf7eb('0x1c')](_0x20d407);return _0x91e683[_0xf7eb('0x1d')](_0xf7eb('0x1e'),_0x4188b6+'-'+_0x14d501+'/'+_0x9d325c)[_0xf7eb('0x1f')](_0x1c2b1c);}return null;};}function patchUpdates(_0x5efd0a){return function(_0x2e9e3e){try{jsonpatch[_0xf7eb('0x20')](_0x2e9e3e,_0x5efd0a,!![]);}catch(_0x2cdc5e){return BPromise[_0xf7eb('0x21')](_0x2cdc5e);}return _0x2e9e3e['save']();};}function saveUpdates(_0x2cc3c8,_0x16a003){return function(_0x30d178){if(_0x30d178){return _0x30d178[_0xf7eb('0x22')](_0x2cc3c8)[_0xf7eb('0x23')](function(_0x22d0ec){return _0x22d0ec;});}return null;};}function removeEntity(_0x5696fa,_0x288b84){return function(_0x5b0484){if(_0x5b0484){return _0x5b0484[_0xf7eb('0x24')]()[_0xf7eb('0x23')](function(){var _0x1f41b0=_0x5b0484[_0xf7eb('0x25')]({'plain':!![]});var _0x393e75='Projects';return db[_0xf7eb('0x26')][_0xf7eb('0x24')]({'where':{'type':_0x393e75,'resourceId':_0x1f41b0['id']}})[_0xf7eb('0x23')](function(){return _0x5b0484;});})[_0xf7eb('0x23')](function(){_0x5696fa[_0xf7eb('0x1c')](0xcc)[_0xf7eb('0x18')]();});}};}function handleEntityNotFound(_0x360a34,_0x4f416a){return function(_0x8370aa){if(!_0x8370aa){_0x360a34[_0xf7eb('0x27')](0x194);}return _0x8370aa;};}function handleError(_0x9d41b5,_0x33b6d1){_0x33b6d1=_0x33b6d1||0x1f4;return function(_0x3da4af){logger['error'](_0x3da4af['stack']);if(_0x3da4af['name']){delete _0x3da4af[_0xf7eb('0x28')];}_0x9d41b5[_0xf7eb('0x1c')](_0x33b6d1)[_0xf7eb('0x29')](_0x3da4af);};}exports['index']=function(_0x2b98ca,_0x443aa6){var _0x2daedc={},_0x25b40c={},_0xbea3e9={'count':0x0,'rows':[]};var _0x143d4c=_['map'](db[_0xf7eb('0x2a')]['rawAttributes'],function(_0x40a606){return{'name':_0x40a606['fieldName'],'type':_0x40a606[_0xf7eb('0x2b')][_0xf7eb('0x2c')]};});_0x25b40c[_0xf7eb('0x2d')]=_[_0xf7eb('0x2e')](_0x143d4c,_0xf7eb('0x28'));_0x25b40c['query']=_[_0xf7eb('0x2f')](_0x2b98ca['query']);_0x25b40c[_0xf7eb('0x30')]=_['intersection'](_0x25b40c[_0xf7eb('0x2d')],_0x25b40c[_0xf7eb('0x31')]);_0x2daedc[_0xf7eb('0x32')]=_['intersection'](_0x25b40c[_0xf7eb('0x2d')],qs[_0xf7eb('0x33')](_0x2b98ca[_0xf7eb('0x31')]['fields']));_0x2daedc[_0xf7eb('0x32')]=_0x2daedc[_0xf7eb('0x32')][_0xf7eb('0x34')]?_0x2daedc[_0xf7eb('0x32')]:_0x25b40c[_0xf7eb('0x2d')];if(!_0x2b98ca[_0xf7eb('0x31')][_0xf7eb('0x35')](_0xf7eb('0x36'))){_0x2daedc[_0xf7eb('0x1a')]=qs[_0xf7eb('0x1a')](_0x2b98ca[_0xf7eb('0x31')][_0xf7eb('0x1a')]);_0x2daedc[_0xf7eb('0x19')]=qs['offset'](_0x2b98ca[_0xf7eb('0x31')][_0xf7eb('0x19')]);}_0x2daedc['order']=qs[_0xf7eb('0x37')](_0x2b98ca[_0xf7eb('0x31')][_0xf7eb('0x37')]);_0x2daedc[_0xf7eb('0x38')]=qs[_0xf7eb('0x30')](_[_0xf7eb('0x39')](_0x2b98ca['query'],_0x25b40c['filters']),_0x143d4c);if(_0x2b98ca[_0xf7eb('0x31')]['filter']){_0x2daedc[_0xf7eb('0x38')]=_[_0xf7eb('0x3a')](_0x2daedc[_0xf7eb('0x38')],{'$or':_['map'](_0x143d4c,function(_0x23e03b){if(_0x23e03b['type']!==_0xf7eb('0x3b')){var _0x1099d6={};_0x1099d6[_0x23e03b[_0xf7eb('0x28')]]={'$like':'%'+_0x2b98ca[_0xf7eb('0x31')]['filter']+'%'};return _0x1099d6;}})});}_0x2daedc=_[_0xf7eb('0x3a')]({},_0x2daedc,_0x2b98ca[_0xf7eb('0x3c')]);var _0x2595e2={'where':_0x2daedc['where']};return db['JscriptyProject'][_0xf7eb('0x1b')](_0x2595e2)[_0xf7eb('0x23')](function(_0x305c75){_0xbea3e9[_0xf7eb('0x1b')]=_0x305c75;if(_0x2b98ca[_0xf7eb('0x31')][_0xf7eb('0x3d')]){_0x2daedc[_0xf7eb('0x3e')]=[{'all':!![]}];}return db[_0xf7eb('0x2a')]['findAll'](_0x2daedc);})[_0xf7eb('0x23')](function(_0x39dfba){_0xbea3e9[_0xf7eb('0x3f')]=_0x39dfba;return _0xbea3e9;})[_0xf7eb('0x23')](respondWithFilteredResult(_0x443aa6,_0x2daedc))[_0xf7eb('0x40')](handleError(_0x443aa6,null));};exports['show']=function(_0x41834c,_0x3385a8){var _0x2799d7={'raw':![],'where':{'id':_0x41834c[_0xf7eb('0x41')]['id']}},_0x4bd762={};_0x4bd762[_0xf7eb('0x2d')]=_[_0xf7eb('0x2f')](db['JscriptyProject'][_0xf7eb('0x42')]);_0x4bd762[_0xf7eb('0x31')]=_[_0xf7eb('0x2f')](_0x41834c[_0xf7eb('0x31')]);_0x4bd762[_0xf7eb('0x30')]=_[_0xf7eb('0x43')](_0x4bd762['model'],_0x4bd762[_0xf7eb('0x31')]);_0x2799d7[_0xf7eb('0x32')]=_[_0xf7eb('0x43')](_0x4bd762[_0xf7eb('0x2d')],qs[_0xf7eb('0x33')](_0x41834c[_0xf7eb('0x31')][_0xf7eb('0x33')]));_0x2799d7[_0xf7eb('0x32')]=_0x2799d7[_0xf7eb('0x32')][_0xf7eb('0x34')]?_0x2799d7['attributes']:_0x4bd762[_0xf7eb('0x2d')];if(_0x41834c['query'][_0xf7eb('0x3d')]){_0x2799d7['include']=[{'all':!![]}];}_0x2799d7=_[_0xf7eb('0x3a')]({},_0x2799d7,_0x41834c[_0xf7eb('0x3c')]);return db[_0xf7eb('0x2a')]['find'](_0x2799d7)['then'](handleEntityNotFound(_0x3385a8,null))[_0xf7eb('0x23')](respondWithResult(_0x3385a8,null))[_0xf7eb('0x40')](handleError(_0x3385a8,null));};exports[_0xf7eb('0x44')]=function(_0x344423,_0x1bb3e2){return db[_0xf7eb('0x2a')]['create'](_0x344423[_0xf7eb('0x45')],{})[_0xf7eb('0x23')](function(_0x408d66){var _0x3592fb=_0x344423['user']['get']({'plain':!![]});if(!_0x3592fb)throw new Error(_0xf7eb('0x46'));if(_0x3592fb['role']===_0xf7eb('0x47')){var _0x2a0ba8=_0x408d66['get']({'plain':!![]});var _0x4d651f=_0xf7eb('0x48');return db['UserProfileSection'][_0xf7eb('0x49')]({'where':{'name':_0x4d651f,'userProfileId':_0x3592fb[_0xf7eb('0x4a')]},'raw':!![]})[_0xf7eb('0x23')](function(_0x37406b){if(_0x37406b&&_0x37406b['autoAssociation']===0x0){return db[_0xf7eb('0x26')]['create']({'name':_0x2a0ba8[_0xf7eb('0x28')],'resourceId':_0x2a0ba8['id'],'type':_0x37406b[_0xf7eb('0x28')],'sectionId':_0x37406b['id']},{})['then'](function(){return _0x408d66;});}else{return _0x408d66;}})[_0xf7eb('0x40')](function(_0x3a83f6){logger[_0xf7eb('0x4b')](_0xf7eb('0x4c'),_0x3a83f6);throw _0x3a83f6;});}return _0x408d66;})['then'](respondWithResult(_0x1bb3e2,0xc9))['catch'](handleError(_0x1bb3e2,null));};exports[_0xf7eb('0x4d')]=function(_0x402aa9,_0x2fcbbb){var _0x440431={'where':{'id':_0x402aa9['params']['id']}},_0x461abe={};_0x461abe[_0xf7eb('0x2d')]=_[_0xf7eb('0x2f')](db[_0xf7eb('0x2a')][_0xf7eb('0x42')]);_0x440431['attributes']=_[_0xf7eb('0x43')](_0x461abe[_0xf7eb('0x2d')],qs[_0xf7eb('0x33')](_0x402aa9['query'][_0xf7eb('0x33')]));_0x440431[_0xf7eb('0x32')]=_0x440431[_0xf7eb('0x32')][_0xf7eb('0x34')]?_0x440431[_0xf7eb('0x32')]:_0x461abe[_0xf7eb('0x2d')];if(_0x402aa9[_0xf7eb('0x31')][_0xf7eb('0x3d')]){_0x440431[_0xf7eb('0x3e')]=[{'all':!![]}];}_0x440431=_['merge']({},_0x440431,_0x402aa9[_0xf7eb('0x3c')]);return db[_0xf7eb('0x2a')]['find'](_0x440431)[_0xf7eb('0x23')](handleEntityNotFound(_0x2fcbbb,null))[_0xf7eb('0x23')](function(_0x2315e8){if(_0x2315e8){var _0x4894bc=_0x2315e8[_0xf7eb('0x25')]({'plain':!![]});_0x4894bc=qs[_0xf7eb('0x4e')](_0x4894bc,['id',_0xf7eb('0x4f'),'updatedAt']);_0x402aa9[_0xf7eb('0x45')]=_[_0xf7eb('0x4e')](_0x402aa9[_0xf7eb('0x45')],['id',_0xf7eb('0x4f'),_0xf7eb('0x50')]);return db[_0xf7eb('0x2a')]['create'](_[_0xf7eb('0x3a')](_0x4894bc,_0x402aa9[_0xf7eb('0x45')]),{'include':_0x402aa9[_0xf7eb('0x31')][_0xf7eb('0x3d')]?[{'all':!![]}]:undefined})[_0xf7eb('0x23')](function(_0x410c10){var _0x54ee67=_0x402aa9[_0xf7eb('0x47')]['get']({'plain':!![]});if(!_0x54ee67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54ee67[_0xf7eb('0x51')]===_0xf7eb('0x47')){var _0xe749a7=_0x410c10[_0xf7eb('0x25')]({'plain':!![]});var _0x51126f=_0xf7eb('0x48');return db[_0xf7eb('0x52')][_0xf7eb('0x49')]({'where':{'name':_0x51126f,'userProfileId':_0x54ee67[_0xf7eb('0x4a')]},'raw':!![]})[_0xf7eb('0x23')](function(_0x1c379c){if(_0x1c379c&&_0x1c379c[_0xf7eb('0x53')]===0x0){return db[_0xf7eb('0x26')][_0xf7eb('0x44')]({'name':_0xe749a7['name'],'resourceId':_0xe749a7['id'],'type':_0x1c379c['name'],'sectionId':_0x1c379c['id']},{})[_0xf7eb('0x23')](function(){return _0x410c10;});}else{return _0x410c10;}})[_0xf7eb('0x40')](function(_0x3dc701){logger[_0xf7eb('0x4b')](_0xf7eb('0x4c'),_0x3dc701);throw _0x3dc701;});}return _0x410c10;});}})[_0xf7eb('0x23')](respondWithResult(_0x2fcbbb,0xc9))[_0xf7eb('0x40')](handleError(_0x2fcbbb,null));};exports[_0xf7eb('0x22')]=function(_0x4ba6d1,_0xc7259e){if(_0x4ba6d1[_0xf7eb('0x45')]['id']){delete _0x4ba6d1[_0xf7eb('0x45')]['id'];}return db[_0xf7eb('0x2a')][_0xf7eb('0x49')]({'where':{'id':_0x4ba6d1[_0xf7eb('0x41')]['id']}})[_0xf7eb('0x23')](handleEntityNotFound(_0xc7259e,null))[_0xf7eb('0x23')](saveUpdates(_0x4ba6d1[_0xf7eb('0x45')],null))['then'](respondWithResult(_0xc7259e,null))[_0xf7eb('0x40')](handleError(_0xc7259e,null));};exports['destroy']=function(_0x101aac,_0x2b2601){return db['JscriptyProject'][_0xf7eb('0x49')]({'where':{'id':_0x101aac[_0xf7eb('0x41')]['id']}})[_0xf7eb('0x23')](handleEntityNotFound(_0x2b2601,null))[_0xf7eb('0x23')](removeEntity(_0x2b2601,null))[_0xf7eb('0x40')](handleError(_0x2b2601,null));};exports[_0xf7eb('0x54')]=function(_0x29b2ad,_0x1d9b6b,_0x50533c){var _0x1040d7={'raw':!![],'where':{}};var _0x1a5374={};var _0x407360={'count':0x0,'rows':[]};return db[_0xf7eb('0x2a')]['findOne']({'where':{'id':_0x29b2ad[_0xf7eb('0x41')]['id']}})[_0xf7eb('0x23')](handleEntityNotFound(_0x1d9b6b,null))[_0xf7eb('0x23')](function(_0x1f4dea){if(_0x1f4dea){_0x1a5374[_0xf7eb('0x2d')]=_[_0xf7eb('0x2f')](db[_0xf7eb('0x55')][_0xf7eb('0x42')]);_0x1a5374['query']=_['keys'](_0x29b2ad[_0xf7eb('0x31')]);_0x1a5374['filters']=_[_0xf7eb('0x43')](_0x1a5374[_0xf7eb('0x2d')],_0x1a5374[_0xf7eb('0x31')]);_0x1040d7[_0xf7eb('0x32')]=_[_0xf7eb('0x43')](_0x1a5374['model'],qs[_0xf7eb('0x33')](_0x29b2ad[_0xf7eb('0x31')]['fields']));_0x1040d7[_0xf7eb('0x32')]=_0x1040d7[_0xf7eb('0x32')]['length']?_0x1040d7['attributes']:_0x1a5374[_0xf7eb('0x2d')];if(!_0x29b2ad[_0xf7eb('0x31')][_0xf7eb('0x35')](_0xf7eb('0x36'))){_0x1040d7[_0xf7eb('0x1a')]=qs[_0xf7eb('0x1a')](_0x29b2ad[_0xf7eb('0x31')][_0xf7eb('0x1a')]);_0x1040d7['offset']=qs[_0xf7eb('0x19')](_0x29b2ad[_0xf7eb('0x31')]['offset']);}_0x1040d7[_0xf7eb('0x56')]=qs[_0xf7eb('0x37')](_0x29b2ad[_0xf7eb('0x31')][_0xf7eb('0x37')]);_0x1040d7[_0xf7eb('0x38')]=qs[_0xf7eb('0x30')](_[_0xf7eb('0x39')](_0x29b2ad[_0xf7eb('0x31')],_0x1a5374['filters']));_0x1040d7['where'][_0xf7eb('0x57')]=_0x1f4dea['id'];if(_0x29b2ad[_0xf7eb('0x31')][_0xf7eb('0x58')]){_0x1040d7[_0xf7eb('0x38')]=_[_0xf7eb('0x3a')](_0x1040d7[_0xf7eb('0x38')],{'$or':_[_0xf7eb('0x2e')](_0x1040d7[_0xf7eb('0x32')],function(_0x4ded30){var _0x595515={};_0x595515[_0x4ded30]={'$like':'%'+_0x29b2ad['query'][_0xf7eb('0x58')]+'%'};return _0x595515;})});}_0x1040d7=_['merge']({},_0x1040d7,_0x29b2ad[_0xf7eb('0x3c')]);return db[_0xf7eb('0x55')][_0xf7eb('0x1b')]({'where':_0x1040d7[_0xf7eb('0x38')]})[_0xf7eb('0x23')](function(_0x290eb8){_0x407360[_0xf7eb('0x1b')]=_0x290eb8;if(_0x29b2ad[_0xf7eb('0x31')]['includeAll']){_0x1040d7['include']=[{'all':!![]}];}return db[_0xf7eb('0x55')]['findAll'](_0x1040d7);})[_0xf7eb('0x23')](function(_0x189fd7){_0x407360['rows']=_0x189fd7;return _0x407360;});}})[_0xf7eb('0x23')](respondWithFilteredResult(_0x1d9b6b,_0x1040d7))['catch'](handleError(_0x1d9b6b,null));};exports['getAnswers']=function(_0x50fa39,_0x1473d5,_0x3e957e){var _0x5d4d27={'raw':!![],'where':{}};var _0x1f2af4={};var _0x268b74={'count':0x0,'rows':[]};return db[_0xf7eb('0x2a')][_0xf7eb('0x59')]({'where':{'id':_0x50fa39[_0xf7eb('0x41')]['id']}})[_0xf7eb('0x23')](handleEntityNotFound(_0x1473d5,null))[_0xf7eb('0x23')](function(_0x420960){if(_0x420960){_0x1f2af4[_0xf7eb('0x2d')]=_[_0xf7eb('0x2f')](db['JscriptyAnswerReport'][_0xf7eb('0x42')]);_0x1f2af4[_0xf7eb('0x31')]=_['keys'](_0x50fa39['query']);_0x1f2af4[_0xf7eb('0x30')]=_['intersection'](_0x1f2af4[_0xf7eb('0x2d')],_0x1f2af4[_0xf7eb('0x31')]);_0x5d4d27['attributes']=_[_0xf7eb('0x43')](_0x1f2af4['model'],qs[_0xf7eb('0x33')](_0x50fa39[_0xf7eb('0x31')]['fields']));_0x5d4d27[_0xf7eb('0x32')]=_0x5d4d27['attributes'][_0xf7eb('0x34')]?_0x5d4d27[_0xf7eb('0x32')]:_0x1f2af4[_0xf7eb('0x2d')];if(!_0x50fa39['query']['hasOwnProperty'](_0xf7eb('0x36'))){_0x5d4d27[_0xf7eb('0x1a')]=qs[_0xf7eb('0x1a')](_0x50fa39[_0xf7eb('0x31')][_0xf7eb('0x1a')]);_0x5d4d27[_0xf7eb('0x19')]=qs[_0xf7eb('0x19')](_0x50fa39[_0xf7eb('0x31')][_0xf7eb('0x19')]);}_0x5d4d27[_0xf7eb('0x56')]=qs[_0xf7eb('0x37')](_0x50fa39[_0xf7eb('0x31')][_0xf7eb('0x37')]);_0x5d4d27[_0xf7eb('0x38')]=qs['filters'](_['pick'](_0x50fa39[_0xf7eb('0x31')],_0x1f2af4[_0xf7eb('0x30')]));_0x5d4d27[_0xf7eb('0x38')]['ProjectId']=_0x420960['id'];if(_0x50fa39['query']['filter']){_0x5d4d27[_0xf7eb('0x38')]=_[_0xf7eb('0x3a')](_0x5d4d27[_0xf7eb('0x38')],{'$or':_[_0xf7eb('0x2e')](_0x5d4d27[_0xf7eb('0x32')],function(_0x5131b0){var _0x1cd351={};_0x1cd351[_0x5131b0]={'$like':'%'+_0x50fa39[_0xf7eb('0x31')][_0xf7eb('0x58')]+'%'};return _0x1cd351;})});}_0x5d4d27=_[_0xf7eb('0x3a')]({},_0x5d4d27,_0x50fa39[_0xf7eb('0x3c')]);return db['JscriptyAnswerReport'][_0xf7eb('0x1b')]({'where':_0x5d4d27[_0xf7eb('0x38')]})[_0xf7eb('0x23')](function(_0x131d19){_0x268b74[_0xf7eb('0x1b')]=_0x131d19;if(_0x50fa39[_0xf7eb('0x31')][_0xf7eb('0x3d')]){_0x5d4d27['include']=[{'all':!![]}];}return db[_0xf7eb('0x5a')]['findAll'](_0x5d4d27);})['then'](function(_0x471a59){_0x268b74[_0xf7eb('0x3f')]=_0x471a59;return _0x268b74;});}})[_0xf7eb('0x23')](respondWithFilteredResult(_0x1473d5,_0x5d4d27))[_0xf7eb('0x40')](handleError(_0x1473d5,null));};function char(_0x5a4faf){return _0xf7eb('0x5b')===typeof _0x5a4faf?String[_0xf7eb('0x5c')][_0xf7eb('0x20')](null,arguments):_0x5a4faf;}function needsEncapsulation(_0x1a2a57){return!!_0x1a2a57&&(_0x1a2a57[_0xf7eb('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x1a2a57['toString']()[_0xf7eb('0x5e')](char(0xa))>=0x0||_0x1a2a57[_0xf7eb('0x5d')]()[_0xf7eb('0x5e')](char(0x2c))>=0x0||_0x1a2a57[_0xf7eb('0x5d')]()[_0xf7eb('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x5b8e39){var _0x59f412=char(0x22),_0x4afb3c='\x5c'+char(0x22),_0x28ca13=_0x5b8e39['toString']()[_0xf7eb('0x5f')](new RegExp(_0x59f412,'g'),_0x4afb3c);return _0x59f412+_0x28ca13+_0x59f412;}exports['getSummary']=function(_0x17e37b,_0x12361b,_0x3361ee){var _0x11bba4,_0x24e494;var _0x2eb0e8={'where':{'ProjectId':_0x17e37b[_0xf7eb('0x41')]['id']}};if(_0x17e37b[_0xf7eb('0x31')][_0xf7eb('0x60')]){_0x2eb0e8['where']['starttime']=JSON[_0xf7eb('0x61')](_0x17e37b[_0xf7eb('0x31')]['startTime']);}return db[_0xf7eb('0x55')][_0xf7eb('0x62')](_0x2eb0e8)[_0xf7eb('0x23')](handleEntityNotFound(_0x12361b,null))[_0xf7eb('0x23')](function(_0x253019){if(_0x253019){_0x11bba4=_0x253019;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xf7eb('0x2e')](_0x11bba4,'id')},'ProjectId':_0x17e37b[_0xf7eb('0x41')]['id']},'order':_0xf7eb('0x63')});}})[_0xf7eb('0x23')](handleEntityNotFound(_0x12361b,null))['then'](function(_0x11b529){if(_0x11b529){_0x24e494=_0x11b529;var _0x882dde={};for(var _0x3872bd=0x0,_0xee49a8=_0x24e494['length'];_0x3872bd<_0xee49a8;_0x3872bd++){if(!_0x882dde[_0xf7eb('0x35')](_0x24e494[_0x3872bd][_0xf7eb('0x64')])){_0x882dde[_0x24e494[_0x3872bd][_0xf7eb('0x64')]]=needsEncapsulation(_0x24e494[_0x3872bd][_0xf7eb('0x65')])?encapsulate(_0x24e494[_0x3872bd][_0xf7eb('0x65')]):_0x24e494[_0x3872bd]['question'];}}var _0x3467b6=[],_0x1cb231={};for(var _0x442ce6=0x0,_0x5e126b=_0x11bba4[_0xf7eb('0x34')];_0x442ce6<_0x5e126b;_0x442ce6++){_0x1cb231={'ProjectId':_0x17e37b['params']['id'],'SessionId':_0x11bba4[_0x442ce6]['id'],'StartTime':moment(_0x11bba4[_0x442ce6][_0xf7eb('0x66')])['format'](_0xf7eb('0x67'))};for(var _0x3f97de=0x0,_0x518cf8=_0x24e494[_0xf7eb('0x34')];_0x3f97de<_0x518cf8;_0x3f97de++){if(_0x24e494[_0x3f97de][_0xf7eb('0x68')]==_0x11bba4[_0x442ce6]['id']&&_0x882dde['hasOwnProperty'](_0x24e494[_0x3f97de][_0xf7eb('0x64')])){_0x1cb231[_0x882dde[_0x24e494[_0x3f97de][_0xf7eb('0x64')]]]=_0x24e494[_0x3f97de][_0xf7eb('0x69')];}}for(var _0x37cc26 in _0x882dde){if(!_0x1cb231[_0xf7eb('0x35')](_0x882dde[_0x37cc26])){_0x1cb231[_0x882dde[_0x37cc26]]=null;}}_0x3467b6[_0xf7eb('0x6a')](_0x1cb231);}return _0x3467b6;}})[_0xf7eb('0x23')](function(_0x14ce2a){if(!_['isEmpty'](_0x14ce2a)){var _0x4c61a3=toCsv(_0x14ce2a);var _0x39a86e=Date[_0xf7eb('0x6b')]();fs[_0xf7eb('0x6c')](util[_0xf7eb('0x6d')](_0xf7eb('0x6e'),_0x17e37b[_0xf7eb('0x41')]['id'],_0x39a86e),_0x4c61a3);_0x12361b[_0xf7eb('0x6f')](_0xf7eb('0x70'),_0xf7eb('0x71')+util['format'](_0xf7eb('0x72'),_0x17e37b[_0xf7eb('0x41')]['id'],_0x39a86e));_0x12361b['setHeader']('Content-type',_0xf7eb('0x73'));return _0x12361b[_0xf7eb('0x74')](util[_0xf7eb('0x6d')](_0xf7eb('0x6e'),_0x17e37b[_0xf7eb('0x41')]['id'],_0x39a86e));}else{return _0x12361b[_0xf7eb('0x27')](0xcc);}})[_0xf7eb('0x40')](handleError(_0x12361b,null));}; \ No newline at end of file +var _0x215d=['body','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','omit','createdAt','updatedAt','role','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','startTime','starttime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Projects','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','JscriptyProject','findAll','catch','find','create'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x215d,0x187));var _0xd215=function(_0x2feac1,_0x4eeb70){_0x2feac1=_0x2feac1-0x0;var _0x2ce852=_0x215d[_0x2feac1];return _0x2ce852;};'use strict';var emlformat=require(_0xd215('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd215('0x1'));var jsonpatch=require(_0xd215('0x2'));var rp=require(_0xd215('0x3'));var moment=require(_0xd215('0x4'));var BPromise=require(_0xd215('0x5'));var Mustache=require(_0xd215('0x6'));var util=require('util');var path=require(_0xd215('0x7'));var sox=require('sox');var csv=require(_0xd215('0x8'));var ejs=require(_0xd215('0x9'));var fs=require('fs');var fs_extra=require(_0xd215('0xa'));var _=require('lodash');var squel=require(_0xd215('0xb'));var crypto=require('crypto');var jsforce=require(_0xd215('0xc'));var deskjs=require(_0xd215('0xd'));var toCsv=require(_0xd215('0x8'));var querystring=require('querystring');var Papa=require(_0xd215('0xe'));var Redis=require(_0xd215('0xf'));var authService=require(_0xd215('0x10'));var qs=require(_0xd215('0x11'));var as=require(_0xd215('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd215('0x13'))(_0xd215('0x14'));var utils=require(_0xd215('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd215('0x16'));var db=require(_0xd215('0x17'))['db'];function respondWithStatusCode(_0x1526b8,_0x463e70){_0x463e70=_0x463e70||0xcc;return function(_0x389bb4){if(_0x389bb4){return _0x1526b8['sendStatus'](_0x463e70);}return _0x1526b8[_0xd215('0x18')](_0x463e70)[_0xd215('0x19')]();};}function respondWithResult(_0x306a45,_0x10e90f){_0x10e90f=_0x10e90f||0xc8;return function(_0x1c0e74){if(_0x1c0e74){return _0x306a45[_0xd215('0x18')](_0x10e90f)[_0xd215('0x1a')](_0x1c0e74);}};}function respondWithFilteredResult(_0x1e586a,_0x59fbdb){return function(_0x37b60e){if(_0x37b60e){var _0x302696=typeof _0x59fbdb[_0xd215('0x1b')]===_0xd215('0x1c')&&typeof _0x59fbdb[_0xd215('0x1d')]===_0xd215('0x1c');var _0x2fb885=_0x37b60e[_0xd215('0x1e')];var _0x8d43f2=_0x302696?0x0:_0x59fbdb['offset'];var _0x2a31e8=_0x302696?_0x37b60e[_0xd215('0x1e')]:_0x59fbdb[_0xd215('0x1b')]+_0x59fbdb[_0xd215('0x1d')];var _0xbccdaa;if(_0x2a31e8>=_0x2fb885){_0x2a31e8=_0x2fb885;_0xbccdaa=0xc8;}else{_0xbccdaa=0xce;}_0x1e586a[_0xd215('0x18')](_0xbccdaa);return _0x1e586a[_0xd215('0x1f')]('Content-Range',_0x8d43f2+'-'+_0x2a31e8+'/'+_0x2fb885)[_0xd215('0x1a')](_0x37b60e);}return null;};}function patchUpdates(_0x1d3afa){return function(_0x2130a3){try{jsonpatch['apply'](_0x2130a3,_0x1d3afa,!![]);}catch(_0xccab6){return BPromise[_0xd215('0x20')](_0xccab6);}return _0x2130a3[_0xd215('0x21')]();};}function saveUpdates(_0x36b85e,_0x4cc057){return function(_0x23b1fb){if(_0x23b1fb){return _0x23b1fb[_0xd215('0x22')](_0x36b85e)[_0xd215('0x23')](function(_0x31466e){return _0x31466e;});}return null;};}function removeEntity(_0x4c3768,_0x50a23f){return function(_0x5e0b42){if(_0x5e0b42){return _0x5e0b42[_0xd215('0x24')]()[_0xd215('0x23')](function(){var _0xf28d85=_0x5e0b42[_0xd215('0x25')]({'plain':!![]});var _0x527fca=_0xd215('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x527fca,'resourceId':_0xf28d85['id']}})[_0xd215('0x23')](function(){return _0x5e0b42;});})[_0xd215('0x23')](function(){_0x4c3768[_0xd215('0x18')](0xcc)[_0xd215('0x19')]();});}};}function handleEntityNotFound(_0x638b93,_0x473f7d){return function(_0x4d806c){if(!_0x4d806c){_0x638b93[_0xd215('0x27')](0x194);}return _0x4d806c;};}function handleError(_0x23828b,_0xeed23){_0xeed23=_0xeed23||0x1f4;return function(_0x3ca288){logger[_0xd215('0x28')](_0x3ca288[_0xd215('0x29')]);if(_0x3ca288[_0xd215('0x2a')]){delete _0x3ca288[_0xd215('0x2a')];}_0x23828b[_0xd215('0x18')](_0xeed23)[_0xd215('0x2b')](_0x3ca288);};}exports[_0xd215('0x2c')]=function(_0x44f799,_0x2a9c61){var _0x5bc727={},_0x507e44={},_0x252efb={'count':0x0,'rows':[]};var _0x47a371=_[_0xd215('0x2d')](db['JscriptyProject'][_0xd215('0x2e')],function(_0x1e5c58){return{'name':_0x1e5c58[_0xd215('0x2f')],'type':_0x1e5c58[_0xd215('0x30')]['key']};});_0x507e44['model']=_[_0xd215('0x2d')](_0x47a371,'name');_0x507e44[_0xd215('0x31')]=_[_0xd215('0x32')](_0x44f799['query']);_0x507e44[_0xd215('0x33')]=_[_0xd215('0x34')](_0x507e44['model'],_0x507e44['query']);_0x5bc727['attributes']=_[_0xd215('0x34')](_0x507e44[_0xd215('0x35')],qs[_0xd215('0x36')](_0x44f799[_0xd215('0x31')][_0xd215('0x36')]));_0x5bc727[_0xd215('0x37')]=_0x5bc727[_0xd215('0x37')][_0xd215('0x38')]?_0x5bc727[_0xd215('0x37')]:_0x507e44[_0xd215('0x35')];if(!_0x44f799[_0xd215('0x31')][_0xd215('0x39')](_0xd215('0x3a'))){_0x5bc727[_0xd215('0x1d')]=qs[_0xd215('0x1d')](_0x44f799[_0xd215('0x31')]['limit']);_0x5bc727['offset']=qs[_0xd215('0x1b')](_0x44f799[_0xd215('0x31')][_0xd215('0x1b')]);}_0x5bc727[_0xd215('0x3b')]=qs['sort'](_0x44f799[_0xd215('0x31')][_0xd215('0x3c')]);_0x5bc727[_0xd215('0x3d')]=qs[_0xd215('0x33')](_[_0xd215('0x3e')](_0x44f799[_0xd215('0x31')],_0x507e44['filters']),_0x47a371);if(_0x44f799[_0xd215('0x31')]['filter']){_0x5bc727[_0xd215('0x3d')]=_[_0xd215('0x3f')](_0x5bc727[_0xd215('0x3d')],{'$or':_[_0xd215('0x2d')](_0x47a371,function(_0x25b6da){if(_0x25b6da[_0xd215('0x30')]!==_0xd215('0x40')){var _0x21ec44={};_0x21ec44[_0x25b6da[_0xd215('0x2a')]]={'$like':'%'+_0x44f799['query'][_0xd215('0x41')]+'%'};return _0x21ec44;}})});}_0x5bc727=_[_0xd215('0x3f')]({},_0x5bc727,_0x44f799[_0xd215('0x42')]);var _0x3807d8={'where':_0x5bc727[_0xd215('0x3d')]};return db['JscriptyProject']['count'](_0x3807d8)[_0xd215('0x23')](function(_0x53684d){_0x252efb['count']=_0x53684d;if(_0x44f799[_0xd215('0x31')][_0xd215('0x43')]){_0x5bc727['include']=[{'all':!![]}];}return db[_0xd215('0x44')][_0xd215('0x45')](_0x5bc727);})['then'](function(_0x1b5c8c){_0x252efb['rows']=_0x1b5c8c;return _0x252efb;})[_0xd215('0x23')](respondWithFilteredResult(_0x2a9c61,_0x5bc727))[_0xd215('0x46')](handleError(_0x2a9c61,null));};exports['show']=function(_0x54154e,_0x5cbf3e){var _0x7bafff={'raw':![],'where':{'id':_0x54154e['params']['id']}},_0x4a31a0={};_0x4a31a0[_0xd215('0x35')]=_['keys'](db[_0xd215('0x44')][_0xd215('0x2e')]);_0x4a31a0['query']=_['keys'](_0x54154e[_0xd215('0x31')]);_0x4a31a0[_0xd215('0x33')]=_[_0xd215('0x34')](_0x4a31a0[_0xd215('0x35')],_0x4a31a0['query']);_0x7bafff['attributes']=_[_0xd215('0x34')](_0x4a31a0['model'],qs[_0xd215('0x36')](_0x54154e[_0xd215('0x31')][_0xd215('0x36')]));_0x7bafff[_0xd215('0x37')]=_0x7bafff[_0xd215('0x37')][_0xd215('0x38')]?_0x7bafff[_0xd215('0x37')]:_0x4a31a0[_0xd215('0x35')];if(_0x54154e['query'][_0xd215('0x43')]){_0x7bafff['include']=[{'all':!![]}];}_0x7bafff=_['merge']({},_0x7bafff,_0x54154e[_0xd215('0x42')]);return db[_0xd215('0x44')][_0xd215('0x47')](_0x7bafff)[_0xd215('0x23')](handleEntityNotFound(_0x5cbf3e,null))[_0xd215('0x23')](respondWithResult(_0x5cbf3e,null))[_0xd215('0x46')](handleError(_0x5cbf3e,null));};exports['create']=function(_0x8b3ed8,_0x5887cb){return db['JscriptyProject'][_0xd215('0x48')](_0x8b3ed8[_0xd215('0x49')],{})[_0xd215('0x23')](function(_0x7a8d0d){var _0x4bf821=_0x8b3ed8[_0xd215('0x4a')]['get']({'plain':!![]});if(!_0x4bf821)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bf821['role']===_0xd215('0x4a')){var _0x4035d3=_0x7a8d0d['get']({'plain':!![]});var _0x4b16f3='Projects';return db['UserProfileSection'][_0xd215('0x47')]({'where':{'name':_0x4b16f3,'userProfileId':_0x4bf821[_0xd215('0x4b')]},'raw':!![]})[_0xd215('0x23')](function(_0x5478c9){if(_0x5478c9&&_0x5478c9['autoAssociation']===0x0){return db[_0xd215('0x4c')][_0xd215('0x48')]({'name':_0x4035d3['name'],'resourceId':_0x4035d3['id'],'type':_0x5478c9[_0xd215('0x2a')],'sectionId':_0x5478c9['id']},{})[_0xd215('0x23')](function(){return _0x7a8d0d;});}else{return _0x7a8d0d;}})['catch'](function(_0x1a6512){logger[_0xd215('0x28')](_0xd215('0x4d'),_0x1a6512);throw _0x1a6512;});}return _0x7a8d0d;})[_0xd215('0x23')](respondWithResult(_0x5887cb,0xc9))[_0xd215('0x46')](handleError(_0x5887cb,null));};exports[_0xd215('0x4e')]=function(_0x524a02,_0x1e7a0b){var _0x4615ed={'where':{'id':_0x524a02[_0xd215('0x4f')]['id']}},_0x45fa89={};_0x45fa89[_0xd215('0x35')]=_['keys'](db[_0xd215('0x44')][_0xd215('0x2e')]);_0x4615ed[_0xd215('0x37')]=_[_0xd215('0x34')](_0x45fa89[_0xd215('0x35')],qs['fields'](_0x524a02[_0xd215('0x31')][_0xd215('0x36')]));_0x4615ed[_0xd215('0x37')]=_0x4615ed['attributes']['length']?_0x4615ed[_0xd215('0x37')]:_0x45fa89['model'];if(_0x524a02['query'][_0xd215('0x43')]){_0x4615ed[_0xd215('0x50')]=[{'all':!![]}];}_0x4615ed=_['merge']({},_0x4615ed,_0x524a02[_0xd215('0x42')]);return db[_0xd215('0x44')]['find'](_0x4615ed)[_0xd215('0x23')](handleEntityNotFound(_0x1e7a0b,null))[_0xd215('0x23')](function(_0x41fae0){if(_0x41fae0){var _0x549829=_0x41fae0[_0xd215('0x25')]({'plain':!![]});_0x549829=qs[_0xd215('0x51')](_0x549829,['id',_0xd215('0x52'),_0xd215('0x53')]);_0x524a02[_0xd215('0x49')]=_['omit'](_0x524a02[_0xd215('0x49')],['id','createdAt',_0xd215('0x53')]);return db[_0xd215('0x44')][_0xd215('0x48')](_['merge'](_0x549829,_0x524a02['body']),{'include':_0x524a02[_0xd215('0x31')][_0xd215('0x43')]?[{'all':!![]}]:undefined})[_0xd215('0x23')](function(_0x239d56){var _0x21535e=_0x524a02[_0xd215('0x4a')][_0xd215('0x25')]({'plain':!![]});if(!_0x21535e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21535e[_0xd215('0x54')]===_0xd215('0x4a')){var _0x4ab28d=_0x239d56['get']({'plain':!![]});var _0x46cddb=_0xd215('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x46cddb,'userProfileId':_0x21535e[_0xd215('0x4b')]},'raw':!![]})[_0xd215('0x23')](function(_0x47399b){if(_0x47399b&&_0x47399b[_0xd215('0x55')]===0x0){return db[_0xd215('0x4c')][_0xd215('0x48')]({'name':_0x4ab28d['name'],'resourceId':_0x4ab28d['id'],'type':_0x47399b[_0xd215('0x2a')],'sectionId':_0x47399b['id']},{})[_0xd215('0x23')](function(){return _0x239d56;});}else{return _0x239d56;}})[_0xd215('0x46')](function(_0x3daa33){logger[_0xd215('0x28')](_0xd215('0x4d'),_0x3daa33);throw _0x3daa33;});}return _0x239d56;});}})['then'](respondWithResult(_0x1e7a0b,0xc9))[_0xd215('0x46')](handleError(_0x1e7a0b,null));};exports['update']=function(_0x596eff,_0x33d14a){if(_0x596eff[_0xd215('0x49')]['id']){delete _0x596eff[_0xd215('0x49')]['id'];}return db[_0xd215('0x44')]['find']({'where':{'id':_0x596eff[_0xd215('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33d14a,null))['then'](saveUpdates(_0x596eff['body'],null))[_0xd215('0x23')](respondWithResult(_0x33d14a,null))[_0xd215('0x46')](handleError(_0x33d14a,null));};exports['destroy']=function(_0x10a762,_0x2dd477){return db['JscriptyProject'][_0xd215('0x47')]({'where':{'id':_0x10a762[_0xd215('0x4f')]['id']}})[_0xd215('0x23')](handleEntityNotFound(_0x2dd477,null))[_0xd215('0x23')](removeEntity(_0x2dd477,null))['catch'](handleError(_0x2dd477,null));};exports[_0xd215('0x56')]=function(_0x3624f0,_0x5aebe7,_0x138c09){var _0x88de67={'raw':!![],'where':{}};var _0x5e676c={};var _0x5db6e8={'count':0x0,'rows':[]};return db[_0xd215('0x44')][_0xd215('0x57')]({'where':{'id':_0x3624f0['params']['id']}})['then'](handleEntityNotFound(_0x5aebe7,null))['then'](function(_0xc4be48){if(_0xc4be48){_0x5e676c[_0xd215('0x35')]=_[_0xd215('0x32')](db[_0xd215('0x58')]['rawAttributes']);_0x5e676c[_0xd215('0x31')]=_[_0xd215('0x32')](_0x3624f0[_0xd215('0x31')]);_0x5e676c['filters']=_['intersection'](_0x5e676c['model'],_0x5e676c['query']);_0x88de67['attributes']=_[_0xd215('0x34')](_0x5e676c[_0xd215('0x35')],qs['fields'](_0x3624f0['query']['fields']));_0x88de67['attributes']=_0x88de67[_0xd215('0x37')][_0xd215('0x38')]?_0x88de67[_0xd215('0x37')]:_0x5e676c[_0xd215('0x35')];if(!_0x3624f0[_0xd215('0x31')][_0xd215('0x39')](_0xd215('0x3a'))){_0x88de67[_0xd215('0x1d')]=qs[_0xd215('0x1d')](_0x3624f0[_0xd215('0x31')][_0xd215('0x1d')]);_0x88de67['offset']=qs['offset'](_0x3624f0[_0xd215('0x31')][_0xd215('0x1b')]);}_0x88de67[_0xd215('0x3b')]=qs[_0xd215('0x3c')](_0x3624f0[_0xd215('0x31')][_0xd215('0x3c')]);_0x88de67[_0xd215('0x3d')]=qs[_0xd215('0x33')](_['pick'](_0x3624f0['query'],_0x5e676c[_0xd215('0x33')]));_0x88de67[_0xd215('0x3d')][_0xd215('0x59')]=_0xc4be48['id'];if(_0x3624f0[_0xd215('0x31')][_0xd215('0x41')]){_0x88de67['where']=_['merge'](_0x88de67[_0xd215('0x3d')],{'$or':_[_0xd215('0x2d')](_0x88de67[_0xd215('0x37')],function(_0x53702b){var _0x5015d7={};_0x5015d7[_0x53702b]={'$like':'%'+_0x3624f0[_0xd215('0x31')]['filter']+'%'};return _0x5015d7;})});}_0x88de67=_['merge']({},_0x88de67,_0x3624f0[_0xd215('0x42')]);return db[_0xd215('0x58')]['count']({'where':_0x88de67[_0xd215('0x3d')]})['then'](function(_0x582421){_0x5db6e8[_0xd215('0x1e')]=_0x582421;if(_0x3624f0[_0xd215('0x31')][_0xd215('0x43')]){_0x88de67[_0xd215('0x50')]=[{'all':!![]}];}return db[_0xd215('0x58')][_0xd215('0x45')](_0x88de67);})[_0xd215('0x23')](function(_0x1c3a21){_0x5db6e8[_0xd215('0x5a')]=_0x1c3a21;return _0x5db6e8;});}})['then'](respondWithFilteredResult(_0x5aebe7,_0x88de67))[_0xd215('0x46')](handleError(_0x5aebe7,null));};exports[_0xd215('0x5b')]=function(_0x24d37f,_0x3dd58d,_0x4fbeab){var _0x3eb492={'raw':!![],'where':{}};var _0x1c838f={};var _0x27cbf7={'count':0x0,'rows':[]};return db[_0xd215('0x44')][_0xd215('0x57')]({'where':{'id':_0x24d37f[_0xd215('0x4f')]['id']}})[_0xd215('0x23')](handleEntityNotFound(_0x3dd58d,null))[_0xd215('0x23')](function(_0x5da039){if(_0x5da039){_0x1c838f[_0xd215('0x35')]=_['keys'](db[_0xd215('0x5c')][_0xd215('0x2e')]);_0x1c838f['query']=_[_0xd215('0x32')](_0x24d37f['query']);_0x1c838f[_0xd215('0x33')]=_[_0xd215('0x34')](_0x1c838f['model'],_0x1c838f['query']);_0x3eb492[_0xd215('0x37')]=_[_0xd215('0x34')](_0x1c838f[_0xd215('0x35')],qs[_0xd215('0x36')](_0x24d37f[_0xd215('0x31')][_0xd215('0x36')]));_0x3eb492[_0xd215('0x37')]=_0x3eb492[_0xd215('0x37')][_0xd215('0x38')]?_0x3eb492[_0xd215('0x37')]:_0x1c838f[_0xd215('0x35')];if(!_0x24d37f[_0xd215('0x31')][_0xd215('0x39')](_0xd215('0x3a'))){_0x3eb492['limit']=qs[_0xd215('0x1d')](_0x24d37f['query'][_0xd215('0x1d')]);_0x3eb492['offset']=qs[_0xd215('0x1b')](_0x24d37f[_0xd215('0x31')][_0xd215('0x1b')]);}_0x3eb492[_0xd215('0x3b')]=qs[_0xd215('0x3c')](_0x24d37f[_0xd215('0x31')][_0xd215('0x3c')]);_0x3eb492[_0xd215('0x3d')]=qs[_0xd215('0x33')](_[_0xd215('0x3e')](_0x24d37f['query'],_0x1c838f[_0xd215('0x33')]));_0x3eb492[_0xd215('0x3d')][_0xd215('0x59')]=_0x5da039['id'];if(_0x24d37f[_0xd215('0x31')][_0xd215('0x41')]){_0x3eb492['where']=_['merge'](_0x3eb492[_0xd215('0x3d')],{'$or':_[_0xd215('0x2d')](_0x3eb492[_0xd215('0x37')],function(_0x57b6ff){var _0x4cd6ba={};_0x4cd6ba[_0x57b6ff]={'$like':'%'+_0x24d37f[_0xd215('0x31')]['filter']+'%'};return _0x4cd6ba;})});}_0x3eb492=_[_0xd215('0x3f')]({},_0x3eb492,_0x24d37f[_0xd215('0x42')]);return db[_0xd215('0x5c')][_0xd215('0x1e')]({'where':_0x3eb492[_0xd215('0x3d')]})[_0xd215('0x23')](function(_0xc9a79b){_0x27cbf7[_0xd215('0x1e')]=_0xc9a79b;if(_0x24d37f[_0xd215('0x31')][_0xd215('0x43')]){_0x3eb492['include']=[{'all':!![]}];}return db[_0xd215('0x5c')][_0xd215('0x45')](_0x3eb492);})[_0xd215('0x23')](function(_0x2f613c){_0x27cbf7['rows']=_0x2f613c;return _0x27cbf7;});}})[_0xd215('0x23')](respondWithFilteredResult(_0x3dd58d,_0x3eb492))['catch'](handleError(_0x3dd58d,null));};function char(_0xde75db){return _0xd215('0x5d')===typeof _0xde75db?String['fromCharCode']['apply'](null,arguments):_0xde75db;}function needsEncapsulation(_0x5a1a21){return!!_0x5a1a21&&(_0x5a1a21[_0xd215('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x5a1a21[_0xd215('0x5e')]()[_0xd215('0x5f')](char(0xa))>=0x0||_0x5a1a21['toString']()[_0xd215('0x5f')](char(0x2c))>=0x0||_0x5a1a21[_0xd215('0x5e')]()[_0xd215('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x1d3734){var _0x299007=char(0x22),_0x497e5a='\x5c'+char(0x22),_0x150a7c=_0x1d3734['toString']()[_0xd215('0x60')](new RegExp(_0x299007,'g'),_0x497e5a);return _0x299007+_0x150a7c+_0x299007;}exports['getSummary']=function(_0x104696,_0x420df1,_0x4d773f){var _0x48b7e5,_0x224f80;var _0x485526={'where':{'ProjectId':_0x104696[_0xd215('0x4f')]['id']}};if(_0x104696[_0xd215('0x31')][_0xd215('0x61')]){_0x485526['where'][_0xd215('0x62')]=JSON['parse'](_0x104696[_0xd215('0x31')][_0xd215('0x61')]);}return db[_0xd215('0x58')][_0xd215('0x45')](_0x485526)[_0xd215('0x23')](handleEntityNotFound(_0x420df1,null))['then'](function(_0x6aa4ea){if(_0x6aa4ea){_0x48b7e5=_0x6aa4ea;return db['JscriptyQuestionReport'][_0xd215('0x45')]({'where':{'SessionId':{'$in':_[_0xd215('0x2d')](_0x48b7e5,'id')},'ProjectId':_0x104696[_0xd215('0x4f')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x420df1,null))[_0xd215('0x23')](function(_0x64b707){if(_0x64b707){_0x224f80=_0x64b707;var _0x215688={};for(var _0x111653=0x0,_0x19fb6a=_0x224f80[_0xd215('0x38')];_0x111653<_0x19fb6a;_0x111653++){if(!_0x215688[_0xd215('0x39')](_0x224f80[_0x111653][_0xd215('0x63')])){_0x215688[_0x224f80[_0x111653][_0xd215('0x63')]]=needsEncapsulation(_0x224f80[_0x111653][_0xd215('0x64')])?encapsulate(_0x224f80[_0x111653][_0xd215('0x64')]):_0x224f80[_0x111653][_0xd215('0x64')];}}var _0x21a2ab=[],_0x55ef50={};for(var _0x3f2b83=0x0,_0x3cb9f3=_0x48b7e5[_0xd215('0x38')];_0x3f2b83<_0x3cb9f3;_0x3f2b83++){_0x55ef50={'ProjectId':_0x104696[_0xd215('0x4f')]['id'],'SessionId':_0x48b7e5[_0x3f2b83]['id'],'StartTime':moment(_0x48b7e5[_0x3f2b83]['starttime'])[_0xd215('0x65')](_0xd215('0x66'))};for(var _0x289740=0x0,_0x5290fe=_0x224f80[_0xd215('0x38')];_0x289740<_0x5290fe;_0x289740++){if(_0x224f80[_0x289740]['SessionId']==_0x48b7e5[_0x3f2b83]['id']&&_0x215688[_0xd215('0x39')](_0x224f80[_0x289740]['questionId'])){_0x55ef50[_0x215688[_0x224f80[_0x289740][_0xd215('0x63')]]]=_0x224f80[_0x289740][_0xd215('0x67')];}}for(var _0x433eea in _0x215688){if(!_0x55ef50[_0xd215('0x39')](_0x215688[_0x433eea])){_0x55ef50[_0x215688[_0x433eea]]=null;}}_0x21a2ab[_0xd215('0x68')](_0x55ef50);}return _0x21a2ab;}})['then'](function(_0x12c65f){if(!_[_0xd215('0x69')](_0x12c65f)){var _0x56c3ca=toCsv(_0x12c65f);var _0x480ed3=Date[_0xd215('0x6a')]();fs[_0xd215('0x6b')](util[_0xd215('0x65')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x104696['params']['id'],_0x480ed3),_0x56c3ca);_0x420df1[_0xd215('0x6c')](_0xd215('0x6d'),_0xd215('0x6e')+util[_0xd215('0x65')](_0xd215('0x6f'),_0x104696[_0xd215('0x4f')]['id'],_0x480ed3));_0x420df1['setHeader'](_0xd215('0x70'),_0xd215('0x71'));return _0x420df1[_0xd215('0x72')](util[_0xd215('0x65')](_0xd215('0x73'),_0x104696[_0xd215('0x4f')]['id'],_0x480ed3));}else{return _0x420df1['sendStatus'](0xcc);}})[_0xd215('0x46')](handleError(_0x420df1,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index d7d1023..1b6ef58 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 _0xa631=['./jscriptyProject.attributes','JscriptyProject','jscripty_projects','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0xb29bef,_0x45aff1){var _0x878163=function(_0xa270a1){while(--_0xa270a1){_0xb29bef['push'](_0xb29bef['shift']());}};_0x878163(++_0x45aff1);}(_0xa631,0xe4));var _0x1a63=function(_0x240700,_0x13e7d9){_0x240700=_0x240700-0x0;var _0x51530c=_0xa631[_0x240700];return _0x51530c;};'use strict';var _=require('lodash');var util=require(_0x1a63('0x0'));var logger=require(_0x1a63('0x1'))(_0x1a63('0x2'));var moment=require('moment');var BPromise=require(_0x1a63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a63('0x4'));var config=require(_0x1a63('0x5'));var attributes=require(_0x1a63('0x6'));module['exports']=function(_0x51ff47,_0x5a2067){return _0x51ff47['define'](_0x1a63('0x7'),attributes,{'tableName':_0x1a63('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7edb=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','./jscriptyProject.attributes','exports'];(function(_0x90875d,_0x3581f1){var _0x3ebefe=function(_0x5d4fda){while(--_0x5d4fda){_0x90875d['push'](_0x90875d['shift']());}};_0x3ebefe(++_0x3581f1);}(_0x7edb,0x158));var _0xb7ed=function(_0x3d5d60,_0x49418c){_0x3d5d60=_0x3d5d60-0x0;var _0x3b0003=_0x7edb[_0x3d5d60];return _0x3b0003;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'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 aaba4d5..0292737 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x95bf53,_0xa834d9){var _0x13adf4=function(_0x71f688){while(--_0x71f688){_0x95bf53['push'](_0x95bf53['shift']());}};_0x13adf4(++_0xa834d9);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xda3f,0xec));var _0xfda3=function(_0x4e6e8e,_0x167252){_0x4e6e8e=_0x4e6e8e-0x0;var _0x51ae3c=_0xda3f[_0x4e6e8e];return _0x51ae3c;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 4ed9874..eddba1d 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 _0x81b8=['exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81b8,0x65));var _0x881b=function(_0x380ed3,_0x2e7742){_0x380ed3=_0x380ed3-0x0;var _0x1f9aee=_0x81b8[_0x380ed3];return _0x1f9aee;};'use strict';var multer=require(_0x881b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x881b('0x1'));var express=require('express');var router=express[_0x881b('0x2')]();var fs_extra=require(_0x881b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x881b('0x4'));var config=require(_0x881b('0x5'));var controller=require(_0x881b('0x6'));router['get']('/',auth[_0x881b('0x7')](),controller[_0x881b('0x8')]);router[_0x881b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x881b('0xa')]);router[_0x881b('0x9')](_0x881b('0xb'),auth['isAuthenticated'](),controller[_0x881b('0xc')]);router[_0x881b('0xd')]('/',auth['isAuthenticated'](),controller[_0x881b('0xe')]);router[_0x881b('0xf')](_0x881b('0xb'),auth[_0x881b('0x7')](),controller[_0x881b('0x10')]);router[_0x881b('0x11')]('/:id',auth[_0x881b('0x7')](),controller[_0x881b('0x12')]);module[_0x881b('0x13')]=router; \ No newline at end of file +var _0x970e=['./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','destroy','exports','util','fs-extra','../../components/auth/service'];(function(_0x3f8f5c,_0x461c6e){var _0x51f351=function(_0x7cc97e){while(--_0x7cc97e){_0x3f8f5c['push'](_0x3f8f5c['shift']());}};_0x51f351(++_0x461c6e);}(_0x970e,0x1ad));var _0xe970=function(_0x1ad480,_0x31dc3b){_0x1ad480=_0x1ad480-0x0;var _0x41115d=_0x970e[_0x1ad480];return _0x41115d;};'use strict';var multer=require('multer');var util=require(_0xe970('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe970('0x1'));var auth=require(_0xe970('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe970('0x3'));router['get']('/',auth[_0xe970('0x4')](),controller[_0xe970('0x5')]);router[_0xe970('0x6')]('/describe',auth[_0xe970('0x4')](),controller[_0xe970('0x7')]);router[_0xe970('0x6')](_0xe970('0x8'),auth['isAuthenticated'](),controller[_0xe970('0x9')]);router[_0xe970('0xa')]('/',auth[_0xe970('0x4')](),controller[_0xe970('0xb')]);router[_0xe970('0xc')]('/:id',auth[_0xe970('0x4')](),controller[_0xe970('0xd')]);router['delete'](_0xe970('0x8'),auth[_0xe970('0x4')](),controller[_0xe970('0xe')]);module[_0xe970('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 6ce4ec4..3fd6762 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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x2f1ce6,_0x5bbd5a){_0x2f1ce6=_0x2f1ce6-0x0;var _0x495da2=_0x7a54[_0x2f1ce6];return _0x495da2;};'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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x705094,_0xe869de){_0x705094=_0x705094-0x0;var _0x4f675e=_0x7a54[_0x705094];return _0x4f675e;};'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 f362e77..1c74cbb 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 _0xd3c3=['catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','show','find','body','params','destroy'];(function(_0x5d30fd,_0x16e7ad){var _0x2fa084=function(_0x3e5f2e){while(--_0x3e5f2e){_0x5d30fd['push'](_0x5d30fd['shift']());}};_0x2fa084(++_0x16e7ad);}(_0xd3c3,0x1de));var _0x3d3c=function(_0x14ed7a,_0x31c321){_0x14ed7a=_0x14ed7a-0x0;var _0x66b0b=_0xd3c3[_0x14ed7a];return _0x66b0b;};'use strict';var emlformat=require(_0x3d3c('0x0'));var rimraf=require(_0x3d3c('0x1'));var zipdir=require(_0x3d3c('0x2'));var jsonpatch=require(_0x3d3c('0x3'));var rp=require(_0x3d3c('0x4'));var moment=require(_0x3d3c('0x5'));var BPromise=require(_0x3d3c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3d3c('0x7'));var sox=require(_0x3d3c('0x8'));var csv=require(_0x3d3c('0x9'));var ejs=require(_0x3d3c('0xa'));var fs=require('fs');var fs_extra=require(_0x3d3c('0xb'));var _=require('lodash');var squel=require(_0x3d3c('0xc'));var crypto=require('crypto');var jsforce=require(_0x3d3c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d3c('0xe'));var Papa=require(_0x3d3c('0xf'));var Redis=require(_0x3d3c('0x10'));var authService=require(_0x3d3c('0x11'));var qs=require(_0x3d3c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d3c('0x13'));var logger=require(_0x3d3c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3d3c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d3c('0x16'))['db'];function respondWithStatusCode(_0x41d6e3,_0x165f1c){_0x165f1c=_0x165f1c||0xcc;return function(_0xc00702){if(_0xc00702){return _0x41d6e3['sendStatus'](_0x165f1c);}return _0x41d6e3['status'](_0x165f1c)[_0x3d3c('0x17')]();};}function respondWithResult(_0x5b6264,_0x524d48){_0x524d48=_0x524d48||0xc8;return function(_0x37005d){if(_0x37005d){return _0x5b6264[_0x3d3c('0x18')](_0x524d48)[_0x3d3c('0x19')](_0x37005d);}};}function respondWithFilteredResult(_0x45b1a1,_0x5f3ca9){return function(_0x53c24c){if(_0x53c24c){var _0x3f4270=typeof _0x5f3ca9['offset']==='undefined'&&typeof _0x5f3ca9['limit']==='undefined';var _0x16262b=_0x53c24c['count'];var _0x4766e2=_0x3f4270?0x0:_0x5f3ca9['offset'];var _0x195f88=_0x3f4270?_0x53c24c['count']:_0x5f3ca9[_0x3d3c('0x1a')]+_0x5f3ca9[_0x3d3c('0x1b')];var _0x356509;if(_0x195f88>=_0x16262b){_0x195f88=_0x16262b;_0x356509=0xc8;}else{_0x356509=0xce;}_0x45b1a1[_0x3d3c('0x18')](_0x356509);return _0x45b1a1[_0x3d3c('0x1c')]('Content-Range',_0x4766e2+'-'+_0x195f88+'/'+_0x16262b)[_0x3d3c('0x19')](_0x53c24c);}return null;};}function patchUpdates(_0xbdb1f7){return function(_0x16d118){try{jsonpatch[_0x3d3c('0x1d')](_0x16d118,_0xbdb1f7,!![]);}catch(_0x545dfc){return BPromise[_0x3d3c('0x1e')](_0x545dfc);}return _0x16d118[_0x3d3c('0x1f')]();};}function saveUpdates(_0x22503e,_0x399f92){return function(_0xfc26ca){if(_0xfc26ca){return _0xfc26ca[_0x3d3c('0x20')](_0x22503e)[_0x3d3c('0x21')](function(_0x57cd0a){return _0x57cd0a;});}return null;};}function removeEntity(_0x299cb2,_0x396da6){return function(_0x1c3a6a){if(_0x1c3a6a){return _0x1c3a6a['destroy']()[_0x3d3c('0x21')](function(){_0x299cb2[_0x3d3c('0x18')](0xcc)[_0x3d3c('0x17')]();});}};}function handleEntityNotFound(_0x53ddb3,_0x43e428){return function(_0x38d3da){if(!_0x38d3da){_0x53ddb3[_0x3d3c('0x22')](0x194);}return _0x38d3da;};}function handleError(_0x179ffc,_0x541dc0){_0x541dc0=_0x541dc0||0x1f4;return function(_0x224caf){logger[_0x3d3c('0x23')](_0x224caf['stack']);if(_0x224caf[_0x3d3c('0x24')]){delete _0x224caf['name'];}_0x179ffc[_0x3d3c('0x18')](_0x541dc0)[_0x3d3c('0x25')](_0x224caf);};}exports[_0x3d3c('0x26')]=function(_0x1f6ee1,_0x8da72c){var _0x3febd4={},_0x1c39cc={},_0x246366={'count':0x0,'rows':[]};var _0x210eb0=_[_0x3d3c('0x27')](db[_0x3d3c('0x28')][_0x3d3c('0x29')],function(_0x13d5e6){return{'name':_0x13d5e6['fieldName'],'type':_0x13d5e6['type'][_0x3d3c('0x2a')]};});_0x1c39cc[_0x3d3c('0x2b')]=_[_0x3d3c('0x27')](_0x210eb0,_0x3d3c('0x24'));_0x1c39cc[_0x3d3c('0x2c')]=_[_0x3d3c('0x2d')](_0x1f6ee1[_0x3d3c('0x2c')]);_0x1c39cc[_0x3d3c('0x2e')]=_[_0x3d3c('0x2f')](_0x1c39cc[_0x3d3c('0x2b')],_0x1c39cc[_0x3d3c('0x2c')]);_0x3febd4[_0x3d3c('0x30')]=_[_0x3d3c('0x2f')](_0x1c39cc['model'],qs[_0x3d3c('0x31')](_0x1f6ee1[_0x3d3c('0x2c')][_0x3d3c('0x31')]));_0x3febd4[_0x3d3c('0x30')]=_0x3febd4['attributes'][_0x3d3c('0x32')]?_0x3febd4['attributes']:_0x1c39cc[_0x3d3c('0x2b')];if(!_0x1f6ee1[_0x3d3c('0x2c')][_0x3d3c('0x33')]('nolimit')){_0x3febd4['limit']=qs[_0x3d3c('0x1b')](_0x1f6ee1[_0x3d3c('0x2c')][_0x3d3c('0x1b')]);_0x3febd4[_0x3d3c('0x1a')]=qs[_0x3d3c('0x1a')](_0x1f6ee1[_0x3d3c('0x2c')]['offset']);}_0x3febd4['order']=qs[_0x3d3c('0x34')](_0x1f6ee1[_0x3d3c('0x2c')][_0x3d3c('0x34')]);_0x3febd4['where']=qs[_0x3d3c('0x2e')](_[_0x3d3c('0x35')](_0x1f6ee1[_0x3d3c('0x2c')],_0x1c39cc[_0x3d3c('0x2e')]),_0x210eb0);if(_0x1f6ee1['query']['filter']){_0x3febd4[_0x3d3c('0x36')]=_[_0x3d3c('0x37')](_0x3febd4[_0x3d3c('0x36')],{'$or':_[_0x3d3c('0x27')](_0x210eb0,function(_0x5618e8){if(_0x5618e8[_0x3d3c('0x38')]!==_0x3d3c('0x39')){var _0x877e82={};_0x877e82[_0x5618e8[_0x3d3c('0x24')]]={'$like':'%'+_0x1f6ee1[_0x3d3c('0x2c')]['filter']+'%'};return _0x877e82;}})});}_0x3febd4=_[_0x3d3c('0x37')]({},_0x3febd4,_0x1f6ee1[_0x3d3c('0x3a')]);var _0x5970da={'where':_0x3febd4['where']};return db[_0x3d3c('0x28')]['count'](_0x5970da)[_0x3d3c('0x21')](function(_0x197b89){_0x246366['count']=_0x197b89;if(_0x1f6ee1['query'][_0x3d3c('0x3b')]){_0x3febd4[_0x3d3c('0x3c')]=[{'all':!![]}];}return db[_0x3d3c('0x28')]['findAll'](_0x3febd4);})[_0x3d3c('0x21')](function(_0x57e9f1){_0x246366['rows']=_0x57e9f1;return _0x246366;})[_0x3d3c('0x21')](respondWithFilteredResult(_0x8da72c,_0x3febd4))['catch'](handleError(_0x8da72c,null));};exports[_0x3d3c('0x3d')]=function(_0x524e00,_0x50f8ce){var _0x32ff09={'raw':!![],'where':{'id':_0x524e00['params']['id']}},_0x2fba5a={};_0x2fba5a['model']=_[_0x3d3c('0x2d')](db['JscriptyQuestionReport'][_0x3d3c('0x29')]);_0x2fba5a[_0x3d3c('0x2c')]=_[_0x3d3c('0x2d')](_0x524e00[_0x3d3c('0x2c')]);_0x2fba5a['filters']=_[_0x3d3c('0x2f')](_0x2fba5a[_0x3d3c('0x2b')],_0x2fba5a[_0x3d3c('0x2c')]);_0x32ff09['attributes']=_['intersection'](_0x2fba5a[_0x3d3c('0x2b')],qs[_0x3d3c('0x31')](_0x524e00['query'][_0x3d3c('0x31')]));_0x32ff09[_0x3d3c('0x30')]=_0x32ff09[_0x3d3c('0x30')][_0x3d3c('0x32')]?_0x32ff09[_0x3d3c('0x30')]:_0x2fba5a[_0x3d3c('0x2b')];if(_0x524e00[_0x3d3c('0x2c')][_0x3d3c('0x3b')]){_0x32ff09['include']=[{'all':!![]}];}_0x32ff09=_[_0x3d3c('0x37')]({},_0x32ff09,_0x524e00['options']);return db[_0x3d3c('0x28')][_0x3d3c('0x3e')](_0x32ff09)[_0x3d3c('0x21')](handleEntityNotFound(_0x50f8ce,null))['then'](respondWithResult(_0x50f8ce,null))['catch'](handleError(_0x50f8ce,null));};exports['create']=function(_0x1b2dcd,_0x1927ca){return db[_0x3d3c('0x28')]['create'](_0x1b2dcd[_0x3d3c('0x3f')],{})[_0x3d3c('0x21')](respondWithResult(_0x1927ca,0xc9))['catch'](handleError(_0x1927ca,null));};exports[_0x3d3c('0x20')]=function(_0x2e3a7b,_0x58ae93){if(_0x2e3a7b[_0x3d3c('0x3f')]['id']){delete _0x2e3a7b[_0x3d3c('0x3f')]['id'];}return db[_0x3d3c('0x28')][_0x3d3c('0x3e')]({'where':{'id':_0x2e3a7b[_0x3d3c('0x40')]['id']}})[_0x3d3c('0x21')](handleEntityNotFound(_0x58ae93,null))[_0x3d3c('0x21')](saveUpdates(_0x2e3a7b[_0x3d3c('0x3f')],null))[_0x3d3c('0x21')](respondWithResult(_0x58ae93,null))['catch'](handleError(_0x58ae93,null));};exports[_0x3d3c('0x41')]=function(_0x17e551,_0x1c54f3){return db[_0x3d3c('0x28')][_0x3d3c('0x3e')]({'where':{'id':_0x17e551[_0x3d3c('0x40')]['id']}})[_0x3d3c('0x21')](handleEntityNotFound(_0x1c54f3,null))[_0x3d3c('0x21')](removeEntity(_0x1c54f3,null))[_0x3d3c('0x42')](handleError(_0x1c54f3,null));};exports[_0x3d3c('0x43')]=function(_0x4dd211,_0x39ce23){return db['JscriptyQuestionReport'][_0x3d3c('0x43')]()['then'](respondWithResult(_0x39ce23,null))['catch'](handleError(_0x39ce23,null));}; \ No newline at end of file +var _0xfc4f=['VIRTUAL','options','includeAll','rows','catch','params','length','include','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x10d0bb,_0x5e90ed){var _0x29d251=function(_0x5e2e7b){while(--_0x5e2e7b){_0x10d0bb['push'](_0x10d0bb['shift']());}};_0x29d251(++_0x5e90ed);}(_0xfc4f,0x192));var _0xffc4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xfc4f[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffc4('0x0'));var zipdir=require(_0xffc4('0x1'));var jsonpatch=require(_0xffc4('0x2'));var rp=require(_0xffc4('0x3'));var moment=require(_0xffc4('0x4'));var BPromise=require(_0xffc4('0x5'));var Mustache=require(_0xffc4('0x6'));var util=require('util');var path=require(_0xffc4('0x7'));var sox=require(_0xffc4('0x8'));var csv=require(_0xffc4('0x9'));var ejs=require(_0xffc4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffc4('0xb'));var squel=require(_0xffc4('0xc'));var crypto=require('crypto');var jsforce=require(_0xffc4('0xd'));var deskjs=require(_0xffc4('0xe'));var toCsv=require(_0xffc4('0x9'));var querystring=require(_0xffc4('0xf'));var Papa=require('papaparse');var Redis=require(_0xffc4('0x10'));var authService=require(_0xffc4('0x11'));var qs=require(_0xffc4('0x12'));var as=require(_0xffc4('0x13'));var hardwareService=require(_0xffc4('0x14'));var logger=require(_0xffc4('0x15'))('api');var utils=require(_0xffc4('0x16'));var config=require(_0xffc4('0x17'));var licenseUtil=require(_0xffc4('0x18'));var db=require(_0xffc4('0x19'))['db'];function respondWithStatusCode(_0x3608c5,_0x3c931e){_0x3c931e=_0x3c931e||0xcc;return function(_0xfd810f){if(_0xfd810f){return _0x3608c5['sendStatus'](_0x3c931e);}return _0x3608c5[_0xffc4('0x1a')](_0x3c931e)[_0xffc4('0x1b')]();};}function respondWithResult(_0x5155ab,_0x1920c2){_0x1920c2=_0x1920c2||0xc8;return function(_0x2f6e00){if(_0x2f6e00){return _0x5155ab['status'](_0x1920c2)[_0xffc4('0x1c')](_0x2f6e00);}};}function respondWithFilteredResult(_0x46c802,_0x4690ae){return function(_0x21a41f){if(_0x21a41f){var _0x56c731=typeof _0x4690ae[_0xffc4('0x1d')]===_0xffc4('0x1e')&&typeof _0x4690ae[_0xffc4('0x1f')]===_0xffc4('0x1e');var _0x3cdef5=_0x21a41f[_0xffc4('0x20')];var _0x9fa8ba=_0x56c731?0x0:_0x4690ae[_0xffc4('0x1d')];var _0x12ca28=_0x56c731?_0x21a41f[_0xffc4('0x20')]:_0x4690ae['offset']+_0x4690ae[_0xffc4('0x1f')];var _0x56cae8;if(_0x12ca28>=_0x3cdef5){_0x12ca28=_0x3cdef5;_0x56cae8=0xc8;}else{_0x56cae8=0xce;}_0x46c802['status'](_0x56cae8);return _0x46c802[_0xffc4('0x21')](_0xffc4('0x22'),_0x9fa8ba+'-'+_0x12ca28+'/'+_0x3cdef5)[_0xffc4('0x1c')](_0x21a41f);}return null;};}function patchUpdates(_0x5eb1c1){return function(_0x44abea){try{jsonpatch[_0xffc4('0x23')](_0x44abea,_0x5eb1c1,!![]);}catch(_0x2f6112){return BPromise[_0xffc4('0x24')](_0x2f6112);}return _0x44abea[_0xffc4('0x25')]();};}function saveUpdates(_0xf55ff3,_0x3b5ac0){return function(_0x5957f2){if(_0x5957f2){return _0x5957f2[_0xffc4('0x26')](_0xf55ff3)[_0xffc4('0x27')](function(_0x2a705e){return _0x2a705e;});}return null;};}function removeEntity(_0x3873dc,_0x59e32b){return function(_0x49a252){if(_0x49a252){return _0x49a252[_0xffc4('0x28')]()[_0xffc4('0x27')](function(){_0x3873dc['status'](0xcc)[_0xffc4('0x1b')]();});}};}function handleEntityNotFound(_0x179f87,_0x2021a9){return function(_0x4fd7d0){if(!_0x4fd7d0){_0x179f87[_0xffc4('0x29')](0x194);}return _0x4fd7d0;};}function handleError(_0x4a43a3,_0x5cc71f){_0x5cc71f=_0x5cc71f||0x1f4;return function(_0x3bf82d){logger[_0xffc4('0x2a')](_0x3bf82d['stack']);if(_0x3bf82d[_0xffc4('0x2b')]){delete _0x3bf82d[_0xffc4('0x2b')];}_0x4a43a3[_0xffc4('0x1a')](_0x5cc71f)[_0xffc4('0x2c')](_0x3bf82d);};}exports[_0xffc4('0x2d')]=function(_0x1328fe,_0x10988a){var _0x4ec220={},_0xb6f213={},_0x16a494={'count':0x0,'rows':[]};var _0x1ea417=_[_0xffc4('0x2e')](db[_0xffc4('0x2f')][_0xffc4('0x30')],function(_0x4458a3){return{'name':_0x4458a3[_0xffc4('0x31')],'type':_0x4458a3[_0xffc4('0x32')][_0xffc4('0x33')]};});_0xb6f213[_0xffc4('0x34')]=_['map'](_0x1ea417,_0xffc4('0x2b'));_0xb6f213[_0xffc4('0x35')]=_[_0xffc4('0x36')](_0x1328fe[_0xffc4('0x35')]);_0xb6f213[_0xffc4('0x37')]=_[_0xffc4('0x38')](_0xb6f213['model'],_0xb6f213[_0xffc4('0x35')]);_0x4ec220[_0xffc4('0x39')]=_[_0xffc4('0x38')](_0xb6f213[_0xffc4('0x34')],qs[_0xffc4('0x3a')](_0x1328fe[_0xffc4('0x35')]['fields']));_0x4ec220[_0xffc4('0x39')]=_0x4ec220['attributes']['length']?_0x4ec220[_0xffc4('0x39')]:_0xb6f213[_0xffc4('0x34')];if(!_0x1328fe[_0xffc4('0x35')][_0xffc4('0x3b')]('nolimit')){_0x4ec220[_0xffc4('0x1f')]=qs['limit'](_0x1328fe[_0xffc4('0x35')][_0xffc4('0x1f')]);_0x4ec220['offset']=qs['offset'](_0x1328fe[_0xffc4('0x35')][_0xffc4('0x1d')]);}_0x4ec220[_0xffc4('0x3c')]=qs[_0xffc4('0x3d')](_0x1328fe['query'][_0xffc4('0x3d')]);_0x4ec220[_0xffc4('0x3e')]=qs[_0xffc4('0x37')](_[_0xffc4('0x3f')](_0x1328fe['query'],_0xb6f213[_0xffc4('0x37')]),_0x1ea417);if(_0x1328fe[_0xffc4('0x35')][_0xffc4('0x40')]){_0x4ec220[_0xffc4('0x3e')]=_[_0xffc4('0x41')](_0x4ec220[_0xffc4('0x3e')],{'$or':_[_0xffc4('0x2e')](_0x1ea417,function(_0x1b2419){if(_0x1b2419[_0xffc4('0x32')]!==_0xffc4('0x42')){var _0x1087d8={};_0x1087d8[_0x1b2419[_0xffc4('0x2b')]]={'$like':'%'+_0x1328fe[_0xffc4('0x35')][_0xffc4('0x40')]+'%'};return _0x1087d8;}})});}_0x4ec220=_[_0xffc4('0x41')]({},_0x4ec220,_0x1328fe[_0xffc4('0x43')]);var _0x492e17={'where':_0x4ec220[_0xffc4('0x3e')]};return db[_0xffc4('0x2f')][_0xffc4('0x20')](_0x492e17)[_0xffc4('0x27')](function(_0x45d628){_0x16a494[_0xffc4('0x20')]=_0x45d628;if(_0x1328fe[_0xffc4('0x35')][_0xffc4('0x44')]){_0x4ec220['include']=[{'all':!![]}];}return db[_0xffc4('0x2f')]['findAll'](_0x4ec220);})[_0xffc4('0x27')](function(_0x14c742){_0x16a494[_0xffc4('0x45')]=_0x14c742;return _0x16a494;})[_0xffc4('0x27')](respondWithFilteredResult(_0x10988a,_0x4ec220))[_0xffc4('0x46')](handleError(_0x10988a,null));};exports['show']=function(_0x253199,_0x597b46){var _0x467833={'raw':!![],'where':{'id':_0x253199[_0xffc4('0x47')]['id']}},_0x2dd524={};_0x2dd524[_0xffc4('0x34')]=_[_0xffc4('0x36')](db[_0xffc4('0x2f')][_0xffc4('0x30')]);_0x2dd524[_0xffc4('0x35')]=_[_0xffc4('0x36')](_0x253199[_0xffc4('0x35')]);_0x2dd524['filters']=_[_0xffc4('0x38')](_0x2dd524[_0xffc4('0x34')],_0x2dd524['query']);_0x467833[_0xffc4('0x39')]=_[_0xffc4('0x38')](_0x2dd524[_0xffc4('0x34')],qs[_0xffc4('0x3a')](_0x253199[_0xffc4('0x35')][_0xffc4('0x3a')]));_0x467833[_0xffc4('0x39')]=_0x467833[_0xffc4('0x39')][_0xffc4('0x48')]?_0x467833[_0xffc4('0x39')]:_0x2dd524[_0xffc4('0x34')];if(_0x253199[_0xffc4('0x35')][_0xffc4('0x44')]){_0x467833[_0xffc4('0x49')]=[{'all':!![]}];}_0x467833=_[_0xffc4('0x41')]({},_0x467833,_0x253199['options']);return db[_0xffc4('0x2f')]['find'](_0x467833)['then'](handleEntityNotFound(_0x597b46,null))[_0xffc4('0x27')](respondWithResult(_0x597b46,null))['catch'](handleError(_0x597b46,null));};exports[_0xffc4('0x4a')]=function(_0x1a08d6,_0x4265c9){return db[_0xffc4('0x2f')]['create'](_0x1a08d6[_0xffc4('0x4b')],{})[_0xffc4('0x27')](respondWithResult(_0x4265c9,0xc9))['catch'](handleError(_0x4265c9,null));};exports[_0xffc4('0x26')]=function(_0x811c14,_0x3fd7ea){if(_0x811c14['body']['id']){delete _0x811c14[_0xffc4('0x4b')]['id'];}return db[_0xffc4('0x2f')][_0xffc4('0x4c')]({'where':{'id':_0x811c14[_0xffc4('0x47')]['id']}})[_0xffc4('0x27')](handleEntityNotFound(_0x3fd7ea,null))['then'](saveUpdates(_0x811c14[_0xffc4('0x4b')],null))[_0xffc4('0x27')](respondWithResult(_0x3fd7ea,null))[_0xffc4('0x46')](handleError(_0x3fd7ea,null));};exports['destroy']=function(_0x3b81f5,_0x11b468){return db['JscriptyQuestionReport'][_0xffc4('0x4c')]({'where':{'id':_0x3b81f5[_0xffc4('0x47')]['id']}})['then'](handleEntityNotFound(_0x11b468,null))[_0xffc4('0x27')](removeEntity(_0x11b468,null))['catch'](handleError(_0x11b468,null));};exports[_0xffc4('0x4d')]=function(_0x191529,_0x21fb7f){return db[_0xffc4('0x2f')][_0xffc4('0x4d')]()[_0xffc4('0x27')](respondWithResult(_0x21fb7f,null))['catch'](handleError(_0x21fb7f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 675b689..3f997b5 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 _0x017a=['path','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c7927,_0x41f230){var _0x20b241=function(_0x1dcae6){while(--_0x1dcae6){_0x5c7927['push'](_0x5c7927['shift']());}};_0x20b241(++_0x41f230);}(_0x017a,0x173));var _0xa017=function(_0x2bae07,_0x5f4fd1){_0x2bae07=_0x2bae07-0x0;var _0x2006df=_0x017a[_0x2bae07];return _0x2006df;};'use strict';var _=require(_0xa017('0x0'));var util=require(_0xa017('0x1'));var logger=require(_0xa017('0x2'))(_0xa017('0x3'));var moment=require(_0xa017('0x4'));var BPromise=require(_0xa017('0x5'));var rp=require(_0xa017('0x6'));var fs=require('fs');var path=require(_0xa017('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x3fb12f,_0x5c7e9c){return _0x3fb12f['define']('JscriptyQuestionReport',attributes,{'tableName':_0xa017('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x518a=['define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x12c7ec,_0xeb259f){var _0xa8d56=function(_0x1ec713){while(--_0x1ec713){_0x12c7ec['push'](_0x12c7ec['shift']());}};_0xa8d56(++_0xeb259f);}(_0x518a,0x65));var _0xa518=function(_0x483b6b,_0x197b17){_0x483b6b=_0x483b6b-0x0;var _0x26acdc=_0x518a[_0x483b6b];return _0x26acdc;};'use strict';var _=require('lodash');var util=require(_0xa518('0x0'));var logger=require(_0xa518('0x1'))(_0xa518('0x2'));var moment=require(_0xa518('0x3'));var BPromise=require(_0xa518('0x4'));var rp=require(_0xa518('0x5'));var fs=require('fs');var path=require(_0xa518('0x6'));var rimraf=require(_0xa518('0x7'));var config=require(_0xa518('0x8'));var attributes=require(_0xa518('0x9'));module[_0xa518('0xa')]=function(_0x48fe96,_0x1c23db){return _0x48fe96[_0xa518('0xb')](_0xa518('0xc'),attributes,{'tableName':_0xa518('0xd'),'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 6c1364d..19aa22a 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 _0x7d77=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x2f8b94,_0x3a7bd6){var _0x37574e=function(_0x2736e1){while(--_0x2736e1){_0x2f8b94['push'](_0x2f8b94['shift']());}};_0x37574e(++_0x3a7bd6);}(_0x7d77,0xf0));var _0x77d7=function(_0x1610a9,_0x12b812){_0x1610a9=_0x1610a9-0x0;var _0x33a66e=_0x7d77[_0x1610a9];return _0x33a66e;};'use strict';var _=require(_0x77d7('0x0'));var util=require(_0x77d7('0x1'));var moment=require(_0x77d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x77d7('0x3'));var fs=require('fs');var Redis=require(_0x77d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77d7('0x5'))(_0x77d7('0x6'));var config=require(_0x77d7('0x7'));var jayson=require(_0x77d7('0x8'));var client=jayson[_0x77d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa72a40,_0x3162b8,_0x181588){return new BPromise(function(_0x1d3c3d,_0x695cda){return client[_0x77d7('0xa')](_0xa72a40,_0x181588)[_0x77d7('0xb')](function(_0x359fd3){logger[_0x77d7('0xc')](_0x77d7('0xd'),_0x3162b8,_0x77d7('0xe'));logger[_0x77d7('0xf')](_0x77d7('0x10'),_0x3162b8,'request\x20sent',JSON[_0x77d7('0x11')](_0x359fd3));if(_0x359fd3['error']){if(_0x359fd3[_0x77d7('0x12')][_0x77d7('0x13')]===0x1f4){logger[_0x77d7('0x12')](_0x77d7('0xd'),_0x3162b8,_0x359fd3[_0x77d7('0x12')][_0x77d7('0x14')]);return _0x695cda(_0x359fd3[_0x77d7('0x12')][_0x77d7('0x14')]);}logger[_0x77d7('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3162b8,_0x359fd3[_0x77d7('0x12')][_0x77d7('0x14')]);return _0x1d3c3d(_0x359fd3['error'][_0x77d7('0x14')]);}else{logger[_0x77d7('0xc')](_0x77d7('0xd'),_0x3162b8,'request\x20sent');_0x1d3c3d(_0x359fd3[_0x77d7('0x15')][_0x77d7('0x14')]);}})['catch'](function(_0x1fed9c){logger[_0x77d7('0x12')](_0x77d7('0xd'),_0x3162b8,_0x1fed9c);_0x695cda(_0x1fed9c);});});} \ No newline at end of file +var _0xab2b=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0xab2b,0x1bf));var _0xbab2=function(_0x5b7399,_0x4371b1){_0x5b7399=_0x5b7399-0x0;var _0x2a4f8f=_0xab2b[_0x5b7399];return _0x2a4f8f;};'use strict';var _=require(_0xbab2('0x0'));var util=require(_0xbab2('0x1'));var moment=require('moment');var BPromise=require(_0xbab2('0x2'));var rs=require(_0xbab2('0x3'));var fs=require('fs');var Redis=require(_0xbab2('0x4'));var db=require(_0xbab2('0x5'))['db'];var utils=require(_0xbab2('0x6'));var logger=require(_0xbab2('0x7'))('rpc');var config=require(_0xbab2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbab2('0x9')][_0xbab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0281,_0x5d145d,_0x278676){return new BPromise(function(_0x3c39d6,_0x127368){return client['request'](_0x2d0281,_0x278676)[_0xbab2('0xb')](function(_0x5b084a){logger[_0xbab2('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5d145d,_0xbab2('0xd'));logger[_0xbab2('0xe')](_0xbab2('0xf'),_0x5d145d,_0xbab2('0xd'),JSON[_0xbab2('0x10')](_0x5b084a));if(_0x5b084a[_0xbab2('0x11')]){if(_0x5b084a[_0xbab2('0x11')][_0xbab2('0x12')]===0x1f4){logger['error'](_0xbab2('0x13'),_0x5d145d,_0x5b084a[_0xbab2('0x11')][_0xbab2('0x14')]);return _0x127368(_0x5b084a[_0xbab2('0x11')][_0xbab2('0x14')]);}logger[_0xbab2('0x11')](_0xbab2('0x13'),_0x5d145d,_0x5b084a[_0xbab2('0x11')][_0xbab2('0x14')]);return _0x3c39d6(_0x5b084a['error'][_0xbab2('0x14')]);}else{logger[_0xbab2('0xc')](_0xbab2('0x13'),_0x5d145d,_0xbab2('0xd'));_0x3c39d6(_0x5b084a[_0xbab2('0x15')][_0xbab2('0x14')]);}})[_0xbab2('0x16')](function(_0x5a8d6d){logger[_0xbab2('0x11')](_0xbab2('0x13'),_0x5d145d,_0x5a8d6d);_0x127368(_0x5a8d6d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 36d9017..5fbb3c1 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 _0x7b5e=['/:id/questions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','describe','show'];(function(_0x2bb95b,_0x3436a8){var _0x400740=function(_0x1f918a){while(--_0x1f918a){_0x2bb95b['push'](_0x2bb95b['shift']());}};_0x400740(++_0x3436a8);}(_0x7b5e,0x104));var _0xe7b5=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7b5e[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xe7b5('0x0'));var util=require(_0xe7b5('0x1'));var path=require(_0xe7b5('0x2'));var timeout=require(_0xe7b5('0x3'));var express=require('express');var router=express[_0xe7b5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe7b5('0x5'));var interaction=require(_0xe7b5('0x6'));var config=require(_0xe7b5('0x7'));var controller=require(_0xe7b5('0x8'));router['get']('/',auth[_0xe7b5('0x9')](),controller[_0xe7b5('0xa')]);router['get']('/describe',auth[_0xe7b5('0x9')](),controller[_0xe7b5('0xb')]);router['get']('/:id',auth[_0xe7b5('0x9')](),controller[_0xe7b5('0xc')]);router['get'](_0xe7b5('0xd'),auth[_0xe7b5('0x9')](),controller['getQuestions']);router[_0xe7b5('0xe')]('/',auth[_0xe7b5('0x9')](),controller['create']);router[_0xe7b5('0xf')](_0xe7b5('0x10'),auth[_0xe7b5('0x9')](),controller[_0xe7b5('0x11')]);router[_0xe7b5('0x12')](_0xe7b5('0x10'),auth[_0xe7b5('0x9')](),controller[_0xe7b5('0x13')]);module[_0xe7b5('0x14')]=router; \ No newline at end of file +var _0xc67a=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','post','create','put','update'];(function(_0x2d537b,_0x53dfee){var _0x52c50b=function(_0x2d6ad8){while(--_0x2d6ad8){_0x2d537b['push'](_0x2d537b['shift']());}};_0x52c50b(++_0x53dfee);}(_0xc67a,0x8d));var _0xac67=function(_0x46f545,_0x406238){_0x46f545=_0x46f545-0x0;var _0x491b71=_0xc67a[_0x46f545];return _0x491b71;};'use strict';var multer=require(_0xac67('0x0'));var util=require(_0xac67('0x1'));var path=require(_0xac67('0x2'));var timeout=require('connect-timeout');var express=require(_0xac67('0x3'));var router=express['Router']();var fs_extra=require(_0xac67('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac67('0x5'));var config=require(_0xac67('0x6'));var controller=require(_0xac67('0x7'));router[_0xac67('0x8')]('/',auth['isAuthenticated'](),controller[_0xac67('0x9')]);router[_0xac67('0x8')](_0xac67('0xa'),auth[_0xac67('0xb')](),controller[_0xac67('0xc')]);router[_0xac67('0x8')](_0xac67('0xd'),auth[_0xac67('0xb')](),controller[_0xac67('0xe')]);router[_0xac67('0x8')](_0xac67('0xf'),auth['isAuthenticated'](),controller['getQuestions']);router[_0xac67('0x10')]('/',auth['isAuthenticated'](),controller[_0xac67('0x11')]);router[_0xac67('0x12')](_0xac67('0xd'),auth[_0xac67('0xb')](),controller[_0xac67('0x13')]);router[_0xac67('0x14')](_0xac67('0xd'),auth[_0xac67('0xb')](),controller[_0xac67('0x15')]);module[_0xac67('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 05e17a2..835afbb 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 _0x875a=['sequelize','exports','DATE','starttime','setDataValue','format','STRING','moment'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0x875a,0xaf));var _0xa875=function(_0xcc1903,_0xc64ef1){_0xcc1903=_0xcc1903-0x0;var _0x3ec3de=_0x875a[_0xcc1903];return _0x3ec3de;};'use strict';var moment=require(_0xa875('0x0'));var Sequelize=require(_0xa875('0x1'));module[_0xa875('0x2')]={'starttime':{'type':Sequelize[_0xa875('0x3')],'set':function(_0x251ca3){this['setDataValue'](_0xa875('0x4'),_0x251ca3);this[_0xa875('0x5')]('endtime',moment()[_0xa875('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xa875('0x3')]},'membername':{'type':Sequelize[_0xa875('0x7')]},'projectname':{'type':Sequelize[_0xa875('0x7')]},'queue':{'type':Sequelize[_0xa875('0x7')]},'uniqueid':{'type':Sequelize[_0xa875('0x7')]},'calleridname':{'type':Sequelize[_0xa875('0x7')]},'calleridnum':{'type':Sequelize[_0xa875('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x63f1=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','endtime'];(function(_0x2118f6,_0x9ea794){var _0x142d51=function(_0x476ed4){while(--_0x476ed4){_0x2118f6['push'](_0x2118f6['shift']());}};_0x142d51(++_0x9ea794);}(_0x63f1,0x1da));var _0x163f=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x63f1[_0x35885a];return _0xe86249;};'use strict';var moment=require(_0x163f('0x0'));var Sequelize=require(_0x163f('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x163f('0x2')],'set':function(_0x5b25f7){this[_0x163f('0x3')](_0x163f('0x4'),_0x5b25f7);this['setDataValue'](_0x163f('0x5'),moment()[_0x163f('0x6')](_0x163f('0x7')));}},'endtime':{'type':Sequelize[_0x163f('0x2')]},'membername':{'type':Sequelize[_0x163f('0x8')]},'projectname':{'type':Sequelize[_0x163f('0x8')]},'queue':{'type':Sequelize[_0x163f('0x8')]},'uniqueid':{'type':Sequelize[_0x163f('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x163f('0x8')]},'completed':{'type':Sequelize[_0x163f('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c58cc31..d729986 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 _0xaee9=['request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','limit','undefined','offset','set','Content-Range','apply','save','destroy','then','end','error','name','send','index','JscriptySessionReport','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','options','create','body','update','find','describe','hasOwnProperty','nolimit','order','JscriptyQuestionReport','eml-format','zip-dir'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaee9,0x11e));var _0x9aee=function(_0x57febc,_0xbd9548){_0x57febc=_0x57febc-0x0;var _0x2100ba=_0xaee9[_0x57febc];return _0x2100ba;};'use strict';var emlformat=require(_0x9aee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9aee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9aee('0x2'));var moment=require(_0x9aee('0x3'));var BPromise=require(_0x9aee('0x4'));var Mustache=require('mustache');var util=require(_0x9aee('0x5'));var path=require(_0x9aee('0x6'));var sox=require('sox');var csv=require(_0x9aee('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9aee('0x8'));var squel=require(_0x9aee('0x9'));var crypto=require(_0x9aee('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9aee('0xb'));var toCsv=require(_0x9aee('0x7'));var querystring=require('querystring');var Papa=require(_0x9aee('0xc'));var Redis=require(_0x9aee('0xd'));var authService=require(_0x9aee('0xe'));var qs=require(_0x9aee('0xf'));var as=require(_0x9aee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9aee('0x11'))(_0x9aee('0x12'));var utils=require(_0x9aee('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9aee('0x14'))['db'];function respondWithStatusCode(_0x5973e5,_0x31903e){_0x31903e=_0x31903e||0xcc;return function(_0x12a220){if(_0x12a220){return _0x5973e5['sendStatus'](_0x31903e);}return _0x5973e5[_0x9aee('0x15')](_0x31903e)['end']();};}function respondWithResult(_0x39e4da,_0x4488b2){_0x4488b2=_0x4488b2||0xc8;return function(_0x15dcd5){if(_0x15dcd5){return _0x39e4da['status'](_0x4488b2)[_0x9aee('0x16')](_0x15dcd5);}};}function respondWithFilteredResult(_0x279672,_0x43554e){return function(_0x7eb68f){if(_0x7eb68f){var _0x3d2b46=typeof _0x43554e['offset']==='undefined'&&typeof _0x43554e[_0x9aee('0x17')]===_0x9aee('0x18');var _0x416c24=_0x7eb68f['count'];var _0x1f8297=_0x3d2b46?0x0:_0x43554e[_0x9aee('0x19')];var _0x575f30=_0x3d2b46?_0x7eb68f['count']:_0x43554e[_0x9aee('0x19')]+_0x43554e[_0x9aee('0x17')];var _0x200d11;if(_0x575f30>=_0x416c24){_0x575f30=_0x416c24;_0x200d11=0xc8;}else{_0x200d11=0xce;}_0x279672[_0x9aee('0x15')](_0x200d11);return _0x279672[_0x9aee('0x1a')](_0x9aee('0x1b'),_0x1f8297+'-'+_0x575f30+'/'+_0x416c24)[_0x9aee('0x16')](_0x7eb68f);}return null;};}function patchUpdates(_0x48e880){return function(_0x18127c){try{jsonpatch[_0x9aee('0x1c')](_0x18127c,_0x48e880,!![]);}catch(_0x4bfb9b){return BPromise['reject'](_0x4bfb9b);}return _0x18127c[_0x9aee('0x1d')]();};}function saveUpdates(_0x83f3fa,_0x47ac1b){return function(_0x28399b){if(_0x28399b){return _0x28399b['update'](_0x83f3fa)['then'](function(_0x53d984){return _0x53d984;});}return null;};}function removeEntity(_0x53c7fd,_0x440227){return function(_0x1d547e){if(_0x1d547e){return _0x1d547e[_0x9aee('0x1e')]()[_0x9aee('0x1f')](function(){_0x53c7fd['status'](0xcc)[_0x9aee('0x20')]();});}};}function handleEntityNotFound(_0xfced06,_0x368c5c){return function(_0x5aaacc){if(!_0x5aaacc){_0xfced06['sendStatus'](0x194);}return _0x5aaacc;};}function handleError(_0x4a851b,_0x55a00d){_0x55a00d=_0x55a00d||0x1f4;return function(_0x552a49){logger[_0x9aee('0x21')](_0x552a49['stack']);if(_0x552a49[_0x9aee('0x22')]){delete _0x552a49[_0x9aee('0x22')];}_0x4a851b['status'](_0x55a00d)[_0x9aee('0x23')](_0x552a49);};}exports[_0x9aee('0x24')]=function(_0x34b73d,_0x95742a){var _0x4998c9={},_0x373716={},_0x276306={'count':0x0,'rows':[]};var _0x3c7690=_['map'](db[_0x9aee('0x25')][_0x9aee('0x26')],function(_0x3c6283){return{'name':_0x3c6283['fieldName'],'type':_0x3c6283[_0x9aee('0x27')]['key']};});_0x373716[_0x9aee('0x28')]=_[_0x9aee('0x29')](_0x3c7690,'name');_0x373716[_0x9aee('0x2a')]=_[_0x9aee('0x2b')](_0x34b73d['query']);_0x373716[_0x9aee('0x2c')]=_[_0x9aee('0x2d')](_0x373716[_0x9aee('0x28')],_0x373716[_0x9aee('0x2a')]);_0x4998c9[_0x9aee('0x2e')]=_[_0x9aee('0x2d')](_0x373716['model'],qs[_0x9aee('0x2f')](_0x34b73d[_0x9aee('0x2a')][_0x9aee('0x2f')]));_0x4998c9[_0x9aee('0x2e')]=_0x4998c9['attributes'][_0x9aee('0x30')]?_0x4998c9['attributes']:_0x373716[_0x9aee('0x28')];if(!_0x34b73d[_0x9aee('0x2a')]['hasOwnProperty']('nolimit')){_0x4998c9[_0x9aee('0x17')]=qs[_0x9aee('0x17')](_0x34b73d['query'][_0x9aee('0x17')]);_0x4998c9[_0x9aee('0x19')]=qs[_0x9aee('0x19')](_0x34b73d[_0x9aee('0x2a')]['offset']);}_0x4998c9['order']=qs[_0x9aee('0x31')](_0x34b73d[_0x9aee('0x2a')][_0x9aee('0x31')]);_0x4998c9[_0x9aee('0x32')]=qs[_0x9aee('0x2c')](_[_0x9aee('0x33')](_0x34b73d[_0x9aee('0x2a')],_0x373716[_0x9aee('0x2c')]),_0x3c7690);if(_0x34b73d[_0x9aee('0x2a')][_0x9aee('0x34')]){_0x4998c9[_0x9aee('0x32')]=_[_0x9aee('0x35')](_0x4998c9[_0x9aee('0x32')],{'$or':_['map'](_0x3c7690,function(_0xf7f696){if(_0xf7f696[_0x9aee('0x27')]!==_0x9aee('0x36')){var _0x541090={};_0x541090[_0xf7f696[_0x9aee('0x22')]]={'$like':'%'+_0x34b73d[_0x9aee('0x2a')]['filter']+'%'};return _0x541090;}})});}_0x4998c9=_[_0x9aee('0x35')]({},_0x4998c9,_0x34b73d['options']);var _0x46500c={'where':_0x4998c9[_0x9aee('0x32')]};return db['JscriptySessionReport'][_0x9aee('0x37')](_0x46500c)[_0x9aee('0x1f')](function(_0x2c9093){_0x276306['count']=_0x2c9093;if(_0x34b73d[_0x9aee('0x2a')][_0x9aee('0x38')]){_0x4998c9[_0x9aee('0x39')]=[{'all':!![]}];}return db[_0x9aee('0x25')]['findAll'](_0x4998c9);})[_0x9aee('0x1f')](function(_0x270087){_0x276306[_0x9aee('0x3a')]=_0x270087;return _0x276306;})[_0x9aee('0x1f')](respondWithFilteredResult(_0x95742a,_0x4998c9))[_0x9aee('0x3b')](handleError(_0x95742a,null));};exports[_0x9aee('0x3c')]=function(_0x67a058,_0xf65f85){var _0x4b6d2b={'raw':!![],'where':{'id':_0x67a058[_0x9aee('0x3d')]['id']}},_0x452aab={};_0x452aab[_0x9aee('0x28')]=_['keys'](db[_0x9aee('0x25')][_0x9aee('0x26')]);_0x452aab[_0x9aee('0x2a')]=_['keys'](_0x67a058[_0x9aee('0x2a')]);_0x452aab[_0x9aee('0x2c')]=_[_0x9aee('0x2d')](_0x452aab[_0x9aee('0x28')],_0x452aab[_0x9aee('0x2a')]);_0x4b6d2b[_0x9aee('0x2e')]=_[_0x9aee('0x2d')](_0x452aab['model'],qs[_0x9aee('0x2f')](_0x67a058[_0x9aee('0x2a')][_0x9aee('0x2f')]));_0x4b6d2b[_0x9aee('0x2e')]=_0x4b6d2b[_0x9aee('0x2e')][_0x9aee('0x30')]?_0x4b6d2b[_0x9aee('0x2e')]:_0x452aab[_0x9aee('0x28')];if(_0x67a058[_0x9aee('0x2a')]['includeAll']){_0x4b6d2b['include']=[{'all':!![]}];}_0x4b6d2b=_[_0x9aee('0x35')]({},_0x4b6d2b,_0x67a058[_0x9aee('0x3e')]);return db['JscriptySessionReport']['find'](_0x4b6d2b)['then'](handleEntityNotFound(_0xf65f85,null))['then'](respondWithResult(_0xf65f85,null))[_0x9aee('0x3b')](handleError(_0xf65f85,null));};exports[_0x9aee('0x3f')]=function(_0x2acfac,_0x146d3c){return db[_0x9aee('0x25')][_0x9aee('0x3f')](_0x2acfac[_0x9aee('0x40')],{})[_0x9aee('0x1f')](respondWithResult(_0x146d3c,0xc9))[_0x9aee('0x3b')](handleError(_0x146d3c,null));};exports[_0x9aee('0x41')]=function(_0x3bc578,_0x2d4147){if(_0x3bc578['body']['id']){delete _0x3bc578[_0x9aee('0x40')]['id'];}return db[_0x9aee('0x25')][_0x9aee('0x42')]({'where':{'id':_0x3bc578['params']['id']}})[_0x9aee('0x1f')](handleEntityNotFound(_0x2d4147,null))[_0x9aee('0x1f')](saveUpdates(_0x3bc578[_0x9aee('0x40')],null))['then'](respondWithResult(_0x2d4147,null))[_0x9aee('0x3b')](handleError(_0x2d4147,null));};exports[_0x9aee('0x1e')]=function(_0x34d6ba,_0x303881){return db['JscriptySessionReport'][_0x9aee('0x42')]({'where':{'id':_0x34d6ba[_0x9aee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x303881,null))[_0x9aee('0x1f')](removeEntity(_0x303881,null))[_0x9aee('0x3b')](handleError(_0x303881,null));};exports[_0x9aee('0x43')]=function(_0x3c61a4,_0x5110e1){return db[_0x9aee('0x25')][_0x9aee('0x43')]()[_0x9aee('0x1f')](respondWithResult(_0x5110e1,null))[_0x9aee('0x3b')](handleError(_0x5110e1,null));};exports['getQuestions']=function(_0x35b860,_0x21e110,_0x627150){var _0xa2e4ed={'raw':!![],'where':{}};var _0x50581b={};var _0x4fe9f0={'count':0x0,'rows':[]};return db[_0x9aee('0x25')]['findOne']({'where':{'id':_0x35b860[_0x9aee('0x3d')]['id']}})['then'](handleEntityNotFound(_0x21e110,null))['then'](function(_0x19dc54){if(_0x19dc54){_0x50581b[_0x9aee('0x28')]=_['keys'](db['JscriptyQuestionReport'][_0x9aee('0x26')]);_0x50581b['query']=_[_0x9aee('0x2b')](_0x35b860[_0x9aee('0x2a')]);_0x50581b[_0x9aee('0x2c')]=_[_0x9aee('0x2d')](_0x50581b[_0x9aee('0x28')],_0x50581b[_0x9aee('0x2a')]);_0xa2e4ed['attributes']=_[_0x9aee('0x2d')](_0x50581b[_0x9aee('0x28')],qs[_0x9aee('0x2f')](_0x35b860[_0x9aee('0x2a')][_0x9aee('0x2f')]));_0xa2e4ed['attributes']=_0xa2e4ed[_0x9aee('0x2e')][_0x9aee('0x30')]?_0xa2e4ed[_0x9aee('0x2e')]:_0x50581b[_0x9aee('0x28')];if(!_0x35b860['query'][_0x9aee('0x44')](_0x9aee('0x45'))){_0xa2e4ed[_0x9aee('0x17')]=qs[_0x9aee('0x17')](_0x35b860[_0x9aee('0x2a')]['limit']);_0xa2e4ed[_0x9aee('0x19')]=qs['offset'](_0x35b860[_0x9aee('0x2a')][_0x9aee('0x19')]);}_0xa2e4ed[_0x9aee('0x46')]=qs[_0x9aee('0x31')](_0x35b860[_0x9aee('0x2a')][_0x9aee('0x31')]);_0xa2e4ed[_0x9aee('0x32')]=qs['filters'](_['pick'](_0x35b860[_0x9aee('0x2a')],_0x50581b[_0x9aee('0x2c')]));_0xa2e4ed[_0x9aee('0x32')]['SessionId']=_0x19dc54['id'];if(_0x35b860[_0x9aee('0x2a')]['filter']){_0xa2e4ed[_0x9aee('0x32')]=_[_0x9aee('0x35')](_0xa2e4ed[_0x9aee('0x32')],{'$or':_[_0x9aee('0x29')](_0xa2e4ed[_0x9aee('0x2e')],function(_0x161348){var _0x4b6c7a={};_0x4b6c7a[_0x161348]={'$like':'%'+_0x35b860[_0x9aee('0x2a')][_0x9aee('0x34')]+'%'};return _0x4b6c7a;})});}_0xa2e4ed=_[_0x9aee('0x35')]({},_0xa2e4ed,_0x35b860[_0x9aee('0x3e')]);return db[_0x9aee('0x47')][_0x9aee('0x37')]({'where':_0xa2e4ed[_0x9aee('0x32')]})[_0x9aee('0x1f')](function(_0x3f0eec){_0x4fe9f0[_0x9aee('0x37')]=_0x3f0eec;if(_0x35b860[_0x9aee('0x2a')][_0x9aee('0x38')]){_0xa2e4ed[_0x9aee('0x39')]=[{'all':!![]}];}return db[_0x9aee('0x47')]['findAll'](_0xa2e4ed);})[_0x9aee('0x1f')](function(_0x2d0f4f){_0x4fe9f0[_0x9aee('0x3a')]=_0x2d0f4f;return _0x4fe9f0;});}})[_0x9aee('0x1f')](respondWithFilteredResult(_0x21e110,_0xa2e4ed))[_0x9aee('0x3b')](handleError(_0x21e110,null));}; \ No newline at end of file +var _0x8361=['to-csv','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','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x102ecd,_0x1fb4c8){var _0x2ab7f0=function(_0x46517c){while(--_0x46517c){_0x102ecd['push'](_0x102ecd['shift']());}};_0x2ab7f0(++_0x1fb4c8);}(_0x8361,0x1a0));var _0x1836=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x8361[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require(_0x1836('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1836('0x1'));var jsonpatch=require(_0x1836('0x2'));var rp=require(_0x1836('0x3'));var moment=require(_0x1836('0x4'));var BPromise=require(_0x1836('0x5'));var Mustache=require(_0x1836('0x6'));var util=require(_0x1836('0x7'));var path=require(_0x1836('0x8'));var sox=require('sox');var csv=require(_0x1836('0x9'));var ejs=require(_0x1836('0xa'));var fs=require('fs');var fs_extra=require(_0x1836('0xb'));var _=require(_0x1836('0xc'));var squel=require(_0x1836('0xd'));var crypto=require('crypto');var jsforce=require(_0x1836('0xe'));var deskjs=require(_0x1836('0xf'));var toCsv=require(_0x1836('0x9'));var querystring=require(_0x1836('0x10'));var Papa=require(_0x1836('0x11'));var Redis=require(_0x1836('0x12'));var authService=require(_0x1836('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1836('0x14'));var hardwareService=require(_0x1836('0x15'));var logger=require(_0x1836('0x16'))(_0x1836('0x17'));var utils=require(_0x1836('0x18'));var config=require(_0x1836('0x19'));var licenseUtil=require(_0x1836('0x1a'));var db=require(_0x1836('0x1b'))['db'];function respondWithStatusCode(_0x3c1511,_0x18667b){_0x18667b=_0x18667b||0xcc;return function(_0x1061dd){if(_0x1061dd){return _0x3c1511[_0x1836('0x1c')](_0x18667b);}return _0x3c1511[_0x1836('0x1d')](_0x18667b)['end']();};}function respondWithResult(_0x2e3184,_0x49a9f8){_0x49a9f8=_0x49a9f8||0xc8;return function(_0x20d8bb){if(_0x20d8bb){return _0x2e3184[_0x1836('0x1d')](_0x49a9f8)['json'](_0x20d8bb);}};}function respondWithFilteredResult(_0x104131,_0x396144){return function(_0x5eec54){if(_0x5eec54){var _0x545a84=typeof _0x396144[_0x1836('0x1e')]===_0x1836('0x1f')&&typeof _0x396144[_0x1836('0x20')]===_0x1836('0x1f');var _0x1e0ab5=_0x5eec54[_0x1836('0x21')];var _0x49115c=_0x545a84?0x0:_0x396144[_0x1836('0x1e')];var _0x346f51=_0x545a84?_0x5eec54[_0x1836('0x21')]:_0x396144[_0x1836('0x1e')]+_0x396144[_0x1836('0x20')];var _0x147f5b;if(_0x346f51>=_0x1e0ab5){_0x346f51=_0x1e0ab5;_0x147f5b=0xc8;}else{_0x147f5b=0xce;}_0x104131['status'](_0x147f5b);return _0x104131[_0x1836('0x22')](_0x1836('0x23'),_0x49115c+'-'+_0x346f51+'/'+_0x1e0ab5)['json'](_0x5eec54);}return null;};}function patchUpdates(_0x807375){return function(_0x3249db){try{jsonpatch[_0x1836('0x24')](_0x3249db,_0x807375,!![]);}catch(_0x23939f){return BPromise['reject'](_0x23939f);}return _0x3249db[_0x1836('0x25')]();};}function saveUpdates(_0x1949eb,_0x1cb86c){return function(_0x5b8b0c){if(_0x5b8b0c){return _0x5b8b0c[_0x1836('0x26')](_0x1949eb)[_0x1836('0x27')](function(_0x463847){return _0x463847;});}return null;};}function removeEntity(_0x4a3fac,_0x3b8689){return function(_0x536d0f){if(_0x536d0f){return _0x536d0f[_0x1836('0x28')]()['then'](function(){_0x4a3fac[_0x1836('0x1d')](0xcc)[_0x1836('0x29')]();});}};}function handleEntityNotFound(_0xbdf535,_0x19beb4){return function(_0x48bd66){if(!_0x48bd66){_0xbdf535[_0x1836('0x1c')](0x194);}return _0x48bd66;};}function handleError(_0x378f0d,_0x38fd67){_0x38fd67=_0x38fd67||0x1f4;return function(_0x3ed7dc){logger[_0x1836('0x2a')](_0x3ed7dc[_0x1836('0x2b')]);if(_0x3ed7dc[_0x1836('0x2c')]){delete _0x3ed7dc[_0x1836('0x2c')];}_0x378f0d[_0x1836('0x1d')](_0x38fd67)['send'](_0x3ed7dc);};}exports[_0x1836('0x2d')]=function(_0x47f2d6,_0x5523be){var _0x1c1ad8={},_0x21da49={},_0x16e5d4={'count':0x0,'rows':[]};var _0x3dd587=_[_0x1836('0x2e')](db[_0x1836('0x2f')][_0x1836('0x30')],function(_0x123db7){return{'name':_0x123db7[_0x1836('0x31')],'type':_0x123db7[_0x1836('0x32')][_0x1836('0x33')]};});_0x21da49['model']=_[_0x1836('0x2e')](_0x3dd587,_0x1836('0x2c'));_0x21da49['query']=_[_0x1836('0x34')](_0x47f2d6['query']);_0x21da49[_0x1836('0x35')]=_[_0x1836('0x36')](_0x21da49[_0x1836('0x37')],_0x21da49[_0x1836('0x38')]);_0x1c1ad8[_0x1836('0x39')]=_['intersection'](_0x21da49[_0x1836('0x37')],qs[_0x1836('0x3a')](_0x47f2d6[_0x1836('0x38')][_0x1836('0x3a')]));_0x1c1ad8['attributes']=_0x1c1ad8[_0x1836('0x39')][_0x1836('0x3b')]?_0x1c1ad8['attributes']:_0x21da49[_0x1836('0x37')];if(!_0x47f2d6[_0x1836('0x38')]['hasOwnProperty'](_0x1836('0x3c'))){_0x1c1ad8[_0x1836('0x20')]=qs[_0x1836('0x20')](_0x47f2d6[_0x1836('0x38')][_0x1836('0x20')]);_0x1c1ad8[_0x1836('0x1e')]=qs['offset'](_0x47f2d6[_0x1836('0x38')]['offset']);}_0x1c1ad8[_0x1836('0x3d')]=qs[_0x1836('0x3e')](_0x47f2d6[_0x1836('0x38')][_0x1836('0x3e')]);_0x1c1ad8[_0x1836('0x3f')]=qs['filters'](_[_0x1836('0x40')](_0x47f2d6[_0x1836('0x38')],_0x21da49[_0x1836('0x35')]),_0x3dd587);if(_0x47f2d6['query']['filter']){_0x1c1ad8[_0x1836('0x3f')]=_['merge'](_0x1c1ad8[_0x1836('0x3f')],{'$or':_['map'](_0x3dd587,function(_0x39c2d0){if(_0x39c2d0[_0x1836('0x32')]!==_0x1836('0x41')){var _0x3b033a={};_0x3b033a[_0x39c2d0[_0x1836('0x2c')]]={'$like':'%'+_0x47f2d6[_0x1836('0x38')][_0x1836('0x42')]+'%'};return _0x3b033a;}})});}_0x1c1ad8=_[_0x1836('0x43')]({},_0x1c1ad8,_0x47f2d6[_0x1836('0x44')]);var _0x200883={'where':_0x1c1ad8['where']};return db[_0x1836('0x2f')][_0x1836('0x21')](_0x200883)[_0x1836('0x27')](function(_0x5ad798){_0x16e5d4[_0x1836('0x21')]=_0x5ad798;if(_0x47f2d6[_0x1836('0x38')][_0x1836('0x45')]){_0x1c1ad8[_0x1836('0x46')]=[{'all':!![]}];}return db[_0x1836('0x2f')][_0x1836('0x47')](_0x1c1ad8);})[_0x1836('0x27')](function(_0x1e29fc){_0x16e5d4[_0x1836('0x48')]=_0x1e29fc;return _0x16e5d4;})[_0x1836('0x27')](respondWithFilteredResult(_0x5523be,_0x1c1ad8))['catch'](handleError(_0x5523be,null));};exports[_0x1836('0x49')]=function(_0x46968c,_0x50f660){var _0x2c79d9={'raw':!![],'where':{'id':_0x46968c[_0x1836('0x4a')]['id']}},_0x25c655={};_0x25c655['model']=_['keys'](db[_0x1836('0x2f')][_0x1836('0x30')]);_0x25c655['query']=_[_0x1836('0x34')](_0x46968c[_0x1836('0x38')]);_0x25c655['filters']=_[_0x1836('0x36')](_0x25c655[_0x1836('0x37')],_0x25c655[_0x1836('0x38')]);_0x2c79d9[_0x1836('0x39')]=_[_0x1836('0x36')](_0x25c655['model'],qs[_0x1836('0x3a')](_0x46968c[_0x1836('0x38')][_0x1836('0x3a')]));_0x2c79d9[_0x1836('0x39')]=_0x2c79d9[_0x1836('0x39')][_0x1836('0x3b')]?_0x2c79d9[_0x1836('0x39')]:_0x25c655['model'];if(_0x46968c['query'][_0x1836('0x45')]){_0x2c79d9[_0x1836('0x46')]=[{'all':!![]}];}_0x2c79d9=_['merge']({},_0x2c79d9,_0x46968c[_0x1836('0x44')]);return db[_0x1836('0x2f')][_0x1836('0x4b')](_0x2c79d9)[_0x1836('0x27')](handleEntityNotFound(_0x50f660,null))[_0x1836('0x27')](respondWithResult(_0x50f660,null))[_0x1836('0x4c')](handleError(_0x50f660,null));};exports[_0x1836('0x4d')]=function(_0x3eb0b4,_0x8e9fa){return db[_0x1836('0x2f')][_0x1836('0x4d')](_0x3eb0b4[_0x1836('0x4e')],{})[_0x1836('0x27')](respondWithResult(_0x8e9fa,0xc9))['catch'](handleError(_0x8e9fa,null));};exports['update']=function(_0x162ebf,_0x7eaaf){if(_0x162ebf[_0x1836('0x4e')]['id']){delete _0x162ebf[_0x1836('0x4e')]['id'];}return db[_0x1836('0x2f')][_0x1836('0x4b')]({'where':{'id':_0x162ebf[_0x1836('0x4a')]['id']}})[_0x1836('0x27')](handleEntityNotFound(_0x7eaaf,null))['then'](saveUpdates(_0x162ebf['body'],null))[_0x1836('0x27')](respondWithResult(_0x7eaaf,null))[_0x1836('0x4c')](handleError(_0x7eaaf,null));};exports['destroy']=function(_0x308145,_0x135184){return db[_0x1836('0x2f')][_0x1836('0x4b')]({'where':{'id':_0x308145[_0x1836('0x4a')]['id']}})[_0x1836('0x27')](handleEntityNotFound(_0x135184,null))[_0x1836('0x27')](removeEntity(_0x135184,null))[_0x1836('0x4c')](handleError(_0x135184,null));};exports[_0x1836('0x4f')]=function(_0x257ffc,_0x5273f5){return db[_0x1836('0x2f')]['describe']()['then'](respondWithResult(_0x5273f5,null))[_0x1836('0x4c')](handleError(_0x5273f5,null));};exports[_0x1836('0x50')]=function(_0x18704e,_0x5eee54,_0xad3ea5){var _0x8c8a22={'raw':!![],'where':{}};var _0x190ee9={};var _0x4a9f6d={'count':0x0,'rows':[]};return db[_0x1836('0x2f')][_0x1836('0x51')]({'where':{'id':_0x18704e[_0x1836('0x4a')]['id']}})[_0x1836('0x27')](handleEntityNotFound(_0x5eee54,null))['then'](function(_0x1f33a9){if(_0x1f33a9){_0x190ee9[_0x1836('0x37')]=_[_0x1836('0x34')](db[_0x1836('0x52')][_0x1836('0x30')]);_0x190ee9[_0x1836('0x38')]=_['keys'](_0x18704e[_0x1836('0x38')]);_0x190ee9[_0x1836('0x35')]=_[_0x1836('0x36')](_0x190ee9[_0x1836('0x37')],_0x190ee9[_0x1836('0x38')]);_0x8c8a22['attributes']=_[_0x1836('0x36')](_0x190ee9['model'],qs[_0x1836('0x3a')](_0x18704e['query'][_0x1836('0x3a')]));_0x8c8a22['attributes']=_0x8c8a22[_0x1836('0x39')][_0x1836('0x3b')]?_0x8c8a22[_0x1836('0x39')]:_0x190ee9[_0x1836('0x37')];if(!_0x18704e['query'][_0x1836('0x53')]('nolimit')){_0x8c8a22[_0x1836('0x20')]=qs['limit'](_0x18704e['query']['limit']);_0x8c8a22[_0x1836('0x1e')]=qs[_0x1836('0x1e')](_0x18704e['query'][_0x1836('0x1e')]);}_0x8c8a22[_0x1836('0x3d')]=qs[_0x1836('0x3e')](_0x18704e[_0x1836('0x38')][_0x1836('0x3e')]);_0x8c8a22[_0x1836('0x3f')]=qs['filters'](_['pick'](_0x18704e['query'],_0x190ee9[_0x1836('0x35')]));_0x8c8a22[_0x1836('0x3f')][_0x1836('0x54')]=_0x1f33a9['id'];if(_0x18704e[_0x1836('0x38')][_0x1836('0x42')]){_0x8c8a22[_0x1836('0x3f')]=_['merge'](_0x8c8a22[_0x1836('0x3f')],{'$or':_[_0x1836('0x2e')](_0x8c8a22['attributes'],function(_0x2ee7b9){var _0x471002={};_0x471002[_0x2ee7b9]={'$like':'%'+_0x18704e['query'][_0x1836('0x42')]+'%'};return _0x471002;})});}_0x8c8a22=_['merge']({},_0x8c8a22,_0x18704e[_0x1836('0x44')]);return db[_0x1836('0x52')][_0x1836('0x21')]({'where':_0x8c8a22['where']})[_0x1836('0x27')](function(_0x2d3dbe){_0x4a9f6d['count']=_0x2d3dbe;if(_0x18704e[_0x1836('0x38')][_0x1836('0x45')]){_0x8c8a22['include']=[{'all':!![]}];}return db[_0x1836('0x52')][_0x1836('0x47')](_0x8c8a22);})[_0x1836('0x27')](function(_0x3624a6){_0x4a9f6d[_0x1836('0x48')]=_0x3624a6;return _0x4a9f6d;});}})[_0x1836('0x27')](respondWithFilteredResult(_0x5eee54,_0x8c8a22))[_0x1836('0x4c')](handleError(_0x5eee54,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1f0512b..0aa7711 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 _0xcd59=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x13f416,_0x5c8fe8){var _0x5f2fa5=function(_0x4c9d7c){while(--_0x4c9d7c){_0x13f416['push'](_0x13f416['shift']());}};_0x5f2fa5(++_0x5c8fe8);}(_0xcd59,0x14b));var _0x9cd5=function(_0x17876c,_0x17c9e3){_0x17876c=_0x17876c-0x0;var _0x26844b=_0xcd59[_0x17876c];return _0x26844b;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x2f3205,_0x3e01f9){var _0x415a2e=function(_0x8d501c){while(--_0x8d501c){_0x2f3205['push'](_0x2f3205['shift']());}};_0x415a2e(++_0x3e01f9);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index eb5bab4..fef5b31 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 _0x27a0=['message','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x584e11,_0x3d9c93){var _0x7dd3e3=function(_0x3c4b99){while(--_0x3c4b99){_0x584e11['push'](_0x584e11['shift']());}};_0x7dd3e3(++_0x3d9c93);}(_0x27a0,0xbf));var _0x027a=function(_0x4497d9,_0x993814){_0x4497d9=_0x4497d9-0x0;var _0x54ce8a=_0x27a0[_0x4497d9];return _0x54ce8a;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('JscriptySessionReport,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});} \ No newline at end of file +var _0x5c3c=['JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x223c5a,_0x4a3ac1){var _0x172111=function(_0xea8adb){while(--_0xea8adb){_0x223c5a['push'](_0x223c5a['shift']());}};_0x172111(++_0x4a3ac1);}(_0x5c3c,0x132));var _0xc5c3=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x5c3c[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e9fcb66..fa6f06e 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 _0xa4d7=['get','index','put','/:id','isAuthenticated','update','/download_log_file','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x40727e,_0x438fca){var _0x79d6d2=function(_0xcead86){while(--_0xcead86){_0x40727e['push'](_0x40727e['shift']());}};_0x79d6d2(++_0x438fca);}(_0xa4d7,0xc8));var _0x7a4d=function(_0x3f3998,_0x26cbb7){_0x3f3998=_0x3f3998-0x0;var _0x40e0c1=_0xa4d7[_0x3f3998];return _0x40e0c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7a4d('0x0'));var timeout=require(_0x7a4d('0x1'));var express=require(_0x7a4d('0x2'));var router=express['Router']();var fs_extra=require(_0x7a4d('0x3'));var auth=require(_0x7a4d('0x4'));var interaction=require(_0x7a4d('0x5'));var config=require(_0x7a4d('0x6'));var controller=require(_0x7a4d('0x7'));router[_0x7a4d('0x8')]('/',controller[_0x7a4d('0x9')]);router[_0x7a4d('0xa')](_0x7a4d('0xb'),auth[_0x7a4d('0xc')](),controller[_0x7a4d('0xd')]);router['get'](_0x7a4d('0xe'),auth[_0x7a4d('0xc')](),controller['downloadLogFile']);module[_0x7a4d('0xf')]=router; \ No newline at end of file +var _0xa024=['./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xa024,0xb5));var _0x4a02=function(_0x76d02e,_0x207a7e){_0x76d02e=_0x76d02e-0x0;var _0x10c8ac=_0xa024[_0x76d02e];return _0x10c8ac;};'use strict';var multer=require(_0x4a02('0x0'));var util=require(_0x4a02('0x1'));var path=require(_0x4a02('0x2'));var timeout=require(_0x4a02('0x3'));var express=require(_0x4a02('0x4'));var router=express[_0x4a02('0x5')]();var fs_extra=require(_0x4a02('0x6'));var auth=require(_0x4a02('0x7'));var interaction=require(_0x4a02('0x8'));var config=require('../../config/environment');var controller=require(_0x4a02('0x9'));router[_0x4a02('0xa')]('/',controller[_0x4a02('0xb')]);router[_0x4a02('0xc')](_0x4a02('0xd'),auth[_0x4a02('0xe')](),controller[_0x4a02('0xf')]);router[_0x4a02('0xa')](_0x4a02('0x10'),auth[_0x4a02('0xe')](),controller[_0x4a02('0x11')]);module[_0x4a02('0x12')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6221796..68d99da 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 _0x144a=['sequelize','TEXT','STRING','INTEGER'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x144a,0x100));var _0xa144=function(_0x2390c0,_0x56ba37){_0x2390c0=_0x2390c0-0x0;var _0x350106=_0x144a[_0x2390c0];return _0x350106;};'use strict';var Sequelize=require(_0xa144('0x0'));module['exports']={'license':{'type':Sequelize[_0xa144('0x1')]},'data1':{'type':Sequelize[_0xa144('0x2')]},'data2':{'type':Sequelize[_0xa144('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xa144('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x90d9=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x2096d1,_0x513c42){var _0x20b3dc=function(_0x1e2a29){while(--_0x1e2a29){_0x2096d1['push'](_0x2096d1['shift']());}};_0x20b3dc(++_0x513c42);}(_0x90d9,0x195));var _0x990d=function(_0x53d7f4,_0x3a7778){_0x53d7f4=_0x53d7f4-0x0;var _0x24ecb4=_0x90d9[_0x53d7f4];return _0x24ecb4;};'use strict';var Sequelize=require(_0x990d('0x0'));module[_0x990d('0x1')]={'license':{'type':Sequelize[_0x990d('0x2')]},'data1':{'type':Sequelize[_0x990d('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x990d('0x4')],'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 6f8426f..e2eb84c 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 _0xfa41=['api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','body','License','params','get','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','setHeader','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5d87b2,_0x478f62){var _0x14bcee=function(_0x57d820){while(--_0x57d820){_0x5d87b2['push'](_0x5d87b2['shift']());}};_0x14bcee(++_0x478f62);}(_0xfa41,0xb3));var _0x1fa4=function(_0x387583,_0x127b08){_0x387583=_0x387583-0x0;var _0x45d2f9=_0xfa41[_0x387583];return _0x45d2f9;};'use strict';var emlformat=require(_0x1fa4('0x0'));var rimraf=require(_0x1fa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fa4('0x2'));var rp=require('request-promise');var moment=require(_0x1fa4('0x3'));var BPromise=require(_0x1fa4('0x4'));var Mustache=require(_0x1fa4('0x5'));var util=require('util');var path=require(_0x1fa4('0x6'));var sox=require(_0x1fa4('0x7'));var csv=require(_0x1fa4('0x8'));var ejs=require(_0x1fa4('0x9'));var fs=require('fs');var fs_extra=require(_0x1fa4('0xa'));var _=require('lodash');var squel=require(_0x1fa4('0xb'));var crypto=require(_0x1fa4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1fa4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1fa4('0xe'));var Papa=require(_0x1fa4('0xf'));var Redis=require('ioredis');var authService=require(_0x1fa4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1fa4('0x11'));var hardwareService=require(_0x1fa4('0x12'));var logger=require('../../config/logger')(_0x1fa4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1fa4('0x14'));var db=require(_0x1fa4('0x15'))['db'];function respondWithStatusCode(_0x3d8cec,_0x2334bf){_0x2334bf=_0x2334bf||0xcc;return function(_0x63a23f){if(_0x63a23f){return _0x3d8cec['sendStatus'](_0x2334bf);}return _0x3d8cec[_0x1fa4('0x16')](_0x2334bf)[_0x1fa4('0x17')]();};}function respondWithResult(_0x390524,_0x443322){_0x443322=_0x443322||0xc8;return function(_0x3deb80){if(_0x3deb80){return _0x390524[_0x1fa4('0x16')](_0x443322)['json'](_0x3deb80);}};}function respondWithFilteredResult(_0x4a3fe5,_0xd537b9){return function(_0x10babe){if(_0x10babe){var _0x440f9f=typeof _0xd537b9[_0x1fa4('0x18')]===_0x1fa4('0x19')&&typeof _0xd537b9[_0x1fa4('0x1a')]===_0x1fa4('0x19');var _0x30e2fd=_0x10babe[_0x1fa4('0x1b')];var _0x319794=_0x440f9f?0x0:_0xd537b9[_0x1fa4('0x18')];var _0x33bec1=_0x440f9f?_0x10babe['count']:_0xd537b9['offset']+_0xd537b9[_0x1fa4('0x1a')];var _0x31b59c;if(_0x33bec1>=_0x30e2fd){_0x33bec1=_0x30e2fd;_0x31b59c=0xc8;}else{_0x31b59c=0xce;}_0x4a3fe5[_0x1fa4('0x16')](_0x31b59c);return _0x4a3fe5['set'](_0x1fa4('0x1c'),_0x319794+'-'+_0x33bec1+'/'+_0x30e2fd)[_0x1fa4('0x1d')](_0x10babe);}return null;};}function patchUpdates(_0x1ac156){return function(_0xbf3a35){try{jsonpatch[_0x1fa4('0x1e')](_0xbf3a35,_0x1ac156,!![]);}catch(_0x2a1fb5){return BPromise[_0x1fa4('0x1f')](_0x2a1fb5);}return _0xbf3a35[_0x1fa4('0x20')]();};}function saveUpdates(_0x19bc15,_0x188e7c){return function(_0x1f8cc2){if(_0x1f8cc2){return _0x1f8cc2[_0x1fa4('0x21')](_0x19bc15)[_0x1fa4('0x22')](function(_0x4264cc){return _0x4264cc;});}return null;};}function removeEntity(_0x482b41,_0x4e4591){return function(_0x1d3d1c){if(_0x1d3d1c){return _0x1d3d1c[_0x1fa4('0x23')]()[_0x1fa4('0x22')](function(){_0x482b41[_0x1fa4('0x16')](0xcc)[_0x1fa4('0x17')]();});}};}function handleEntityNotFound(_0x51bf62,_0x1178ed){return function(_0x1c5ce1){if(!_0x1c5ce1){_0x51bf62[_0x1fa4('0x24')](0x194);}return _0x1c5ce1;};}function handleError(_0x49f9fa,_0x3f02e7){_0x3f02e7=_0x3f02e7||0x1f4;return function(_0x427ee9){logger[_0x1fa4('0x25')](_0x427ee9[_0x1fa4('0x26')]);if(_0x427ee9['name']){delete _0x427ee9['name'];}_0x49f9fa[_0x1fa4('0x16')](_0x3f02e7)['send'](_0x427ee9);};}var utilLicense=require(_0x1fa4('0x14'));exports['index']=function(_0x360111,_0x4418b3){var _0xf8f452={'raw':!![],'where':{'id':0x1}},_0x12b848={};_0x12b848[_0x1fa4('0x27')]=_[_0x1fa4('0x28')](db['License'][_0x1fa4('0x29')]);_0x12b848[_0x1fa4('0x2a')]=_[_0x1fa4('0x28')](_0x360111[_0x1fa4('0x2a')]);_0x12b848[_0x1fa4('0x2b')]=_[_0x1fa4('0x2c')](_0x12b848[_0x1fa4('0x27')],_0x12b848[_0x1fa4('0x2a')]);_0xf8f452['attributes']=_[_0x1fa4('0x2c')](_0x12b848[_0x1fa4('0x27')],qs[_0x1fa4('0x2d')](_0x360111[_0x1fa4('0x2a')][_0x1fa4('0x2d')]));_0xf8f452[_0x1fa4('0x2e')]=_0xf8f452[_0x1fa4('0x2e')][_0x1fa4('0x2f')]?_0xf8f452[_0x1fa4('0x2e')]:_0x12b848[_0x1fa4('0x27')];_0xf8f452=_[_0x1fa4('0x30')]({},_0xf8f452,_0x360111[_0x1fa4('0x31')]);return utilLicense['getLicense'](_0xf8f452)[_0x1fa4('0x22')](respondWithResult(_0x4418b3,null))['catch'](handleError(_0x4418b3,null));};exports[_0x1fa4('0x21')]=function(_0x22d19f,_0x5f1662){if(_0x22d19f['body']['id']){delete _0x22d19f[_0x1fa4('0x32')]['id'];}return db[_0x1fa4('0x33')]['find']({'where':{'id':_0x22d19f[_0x1fa4('0x34')]['id']}})['then'](handleEntityNotFound(_0x5f1662,null))[_0x1fa4('0x22')](function(_0x277d81){var _0x24637a=_0x277d81[_0x1fa4('0x35')]({'plain':!![]});return utilLicense['checkLicense'](_0x24637a,_0x22d19f[_0x1fa4('0x32')][_0x1fa4('0x36')]);})[_0x1fa4('0x22')](function(_0x20d885){if(!_0x20d885[_0x1fa4('0x37')]){return saveUpdates(_0x22d19f[_0x1fa4('0x32')],null);}return _0x20d885;})[_0x1fa4('0x22')](respondWithResult(_0x5f1662,null))[_0x1fa4('0x38')](handleError(_0x5f1662,null));};exports[_0x1fa4('0x39')]=function(_0x244df6,_0x5003a6){var _0x3a5600=_0x1fa4('0x3a');var _0x2266cb=path[_0x1fa4('0x3b')](_0x1fa4('0x3c'),_0x1fa4('0x3d'),'xcally',_0x3a5600);_0x5003a6[_0x1fa4('0x3e')]('Content-disposition',_0x1fa4('0x3f')+_0x3a5600);_0x5003a6['set'](_0x1fa4('0x40'),_0x1fa4('0x41'));_0x5003a6['download'](_0x2266cb);}; \ No newline at end of file +var _0x378b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','keys','License','query','intersection','attributes','model','fields','length','merge','options','getLicense','catch','body','find','get','checkLicense','key','demo','downloadLogFile','join','/var','log','xcally','setHeader','text/plain','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x141437,_0x1174a8){var _0x44965c=function(_0x30b92d){while(--_0x30b92d){_0x141437['push'](_0x141437['shift']());}};_0x44965c(++_0x1174a8);}(_0x378b,0xbd));var _0xb378=function(_0x2b4835,_0x429677){_0x2b4835=_0x2b4835-0x0;var _0x39c81b=_0x378b[_0x2b4835];return _0x39c81b;};'use strict';var emlformat=require(_0xb378('0x0'));var rimraf=require(_0xb378('0x1'));var zipdir=require(_0xb378('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb378('0x3'));var moment=require(_0xb378('0x4'));var BPromise=require(_0xb378('0x5'));var Mustache=require(_0xb378('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb378('0x7'));var ejs=require(_0xb378('0x8'));var fs=require('fs');var fs_extra=require(_0xb378('0x9'));var _=require(_0xb378('0xa'));var squel=require(_0xb378('0xb'));var crypto=require(_0xb378('0xc'));var jsforce=require(_0xb378('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb378('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb378('0xe'));var authService=require(_0xb378('0xf'));var qs=require(_0xb378('0x10'));var as=require(_0xb378('0x11'));var hardwareService=require(_0xb378('0x12'));var logger=require(_0xb378('0x13'))(_0xb378('0x14'));var utils=require('../../config/utils');var config=require(_0xb378('0x15'));var licenseUtil=require(_0xb378('0x16'));var db=require(_0xb378('0x17'))['db'];function respondWithStatusCode(_0x419146,_0x4033f2){_0x4033f2=_0x4033f2||0xcc;return function(_0x51b847){if(_0x51b847){return _0x419146[_0xb378('0x18')](_0x4033f2);}return _0x419146[_0xb378('0x19')](_0x4033f2)[_0xb378('0x1a')]();};}function respondWithResult(_0x41b6b1,_0x4ec7a1){_0x4ec7a1=_0x4ec7a1||0xc8;return function(_0x5d2492){if(_0x5d2492){return _0x41b6b1[_0xb378('0x19')](_0x4ec7a1)[_0xb378('0x1b')](_0x5d2492);}};}function respondWithFilteredResult(_0x31ac9b,_0x5f3f04){return function(_0x949a91){if(_0x949a91){var _0x558b31=typeof _0x5f3f04[_0xb378('0x1c')]===_0xb378('0x1d')&&typeof _0x5f3f04[_0xb378('0x1e')]===_0xb378('0x1d');var _0x1dff41=_0x949a91[_0xb378('0x1f')];var _0x46aff0=_0x558b31?0x0:_0x5f3f04[_0xb378('0x1c')];var _0x4e7e00=_0x558b31?_0x949a91[_0xb378('0x1f')]:_0x5f3f04['offset']+_0x5f3f04[_0xb378('0x1e')];var _0x4eb660;if(_0x4e7e00>=_0x1dff41){_0x4e7e00=_0x1dff41;_0x4eb660=0xc8;}else{_0x4eb660=0xce;}_0x31ac9b[_0xb378('0x19')](_0x4eb660);return _0x31ac9b[_0xb378('0x20')]('Content-Range',_0x46aff0+'-'+_0x4e7e00+'/'+_0x1dff41)[_0xb378('0x1b')](_0x949a91);}return null;};}function patchUpdates(_0x51efc6){return function(_0xf4c6bb){try{jsonpatch[_0xb378('0x21')](_0xf4c6bb,_0x51efc6,!![]);}catch(_0x26d5e8){return BPromise[_0xb378('0x22')](_0x26d5e8);}return _0xf4c6bb[_0xb378('0x23')]();};}function saveUpdates(_0x4aaf1d,_0x106af5){return function(_0x4a2ada){if(_0x4a2ada){return _0x4a2ada[_0xb378('0x24')](_0x4aaf1d)[_0xb378('0x25')](function(_0xa6bbef){return _0xa6bbef;});}return null;};}function removeEntity(_0x3f28f7,_0x1e6b78){return function(_0xab6c5b){if(_0xab6c5b){return _0xab6c5b[_0xb378('0x26')]()['then'](function(){_0x3f28f7[_0xb378('0x19')](0xcc)[_0xb378('0x1a')]();});}};}function handleEntityNotFound(_0x144a6e,_0x4ee1de){return function(_0x5090a2){if(!_0x5090a2){_0x144a6e[_0xb378('0x18')](0x194);}return _0x5090a2;};}function handleError(_0x13e5a7,_0x332ccc){_0x332ccc=_0x332ccc||0x1f4;return function(_0x1590dd){logger[_0xb378('0x27')](_0x1590dd[_0xb378('0x28')]);if(_0x1590dd[_0xb378('0x29')]){delete _0x1590dd[_0xb378('0x29')];}_0x13e5a7['status'](_0x332ccc)[_0xb378('0x2a')](_0x1590dd);};}var utilLicense=require(_0xb378('0x16'));exports[_0xb378('0x2b')]=function(_0x5a0e6b,_0x3fe817){var _0x55dcd9={'raw':!![],'where':{'id':0x1}},_0x4a0966={};_0x4a0966['model']=_[_0xb378('0x2c')](db[_0xb378('0x2d')]['rawAttributes']);_0x4a0966[_0xb378('0x2e')]=_[_0xb378('0x2c')](_0x5a0e6b[_0xb378('0x2e')]);_0x4a0966['filters']=_[_0xb378('0x2f')](_0x4a0966['model'],_0x4a0966[_0xb378('0x2e')]);_0x55dcd9[_0xb378('0x30')]=_[_0xb378('0x2f')](_0x4a0966[_0xb378('0x31')],qs['fields'](_0x5a0e6b[_0xb378('0x2e')][_0xb378('0x32')]));_0x55dcd9['attributes']=_0x55dcd9[_0xb378('0x30')][_0xb378('0x33')]?_0x55dcd9[_0xb378('0x30')]:_0x4a0966[_0xb378('0x31')];_0x55dcd9=_[_0xb378('0x34')]({},_0x55dcd9,_0x5a0e6b[_0xb378('0x35')]);return utilLicense[_0xb378('0x36')](_0x55dcd9)[_0xb378('0x25')](respondWithResult(_0x3fe817,null))[_0xb378('0x37')](handleError(_0x3fe817,null));};exports['update']=function(_0x22d78e,_0x2ba6f3){if(_0x22d78e[_0xb378('0x38')]['id']){delete _0x22d78e[_0xb378('0x38')]['id'];}return db[_0xb378('0x2d')][_0xb378('0x39')]({'where':{'id':_0x22d78e['params']['id']}})[_0xb378('0x25')](handleEntityNotFound(_0x2ba6f3,null))['then'](function(_0x4c616d){var _0x53d6de=_0x4c616d[_0xb378('0x3a')]({'plain':!![]});return utilLicense[_0xb378('0x3b')](_0x53d6de,_0x22d78e['body'][_0xb378('0x3c')]);})[_0xb378('0x25')](function(_0x2250de){if(!_0x2250de[_0xb378('0x3d')]){return saveUpdates(_0x22d78e['body'],null);}return _0x2250de;})[_0xb378('0x25')](respondWithResult(_0x2ba6f3,null))[_0xb378('0x37')](handleError(_0x2ba6f3,null));};exports[_0xb378('0x3e')]=function(_0x48644d,_0x2c1b45){var _0x4315e8='license-info.log';var _0x147159=path[_0xb378('0x3f')](_0xb378('0x40'),_0xb378('0x41'),_0xb378('0x42'),_0x4315e8);_0x2c1b45[_0xb378('0x43')]('Content-disposition','attachment;\x20filename='+_0x4315e8);_0x2c1b45[_0xb378('0x20')]('Content-Type',_0xb378('0x44'));_0x2c1b45[_0xb378('0x45')](_0x147159);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 792f992..d928a60 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 _0xa5b6=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','license','lodash','util','../../config/logger','api'];(function(_0x472260,_0x55e796){var _0x5c890b=function(_0x533801){while(--_0x533801){_0x472260['push'](_0x472260['shift']());}};_0x5c890b(++_0x55e796);}(_0xa5b6,0x11a));var _0x6a5b=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xa5b6[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x6a5b('0x0'));var util=require(_0x6a5b('0x1'));var logger=require(_0x6a5b('0x2'))(_0x6a5b('0x3'));var moment=require(_0x6a5b('0x4'));var BPromise=require(_0x6a5b('0x5'));var rp=require(_0x6a5b('0x6'));var fs=require('fs');var path=require(_0x6a5b('0x7'));var rimraf=require('rimraf');var config=require(_0x6a5b('0x8'));var attributes=require(_0x6a5b('0x9'));module[_0x6a5b('0xa')]=function(_0x31dbed,_0x37b667){return _0x31dbed[_0x6a5b('0xb')]('License',attributes,{'tableName':_0x6a5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2e2=['exports','license','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0xa2e2,0x1ea));var _0x2a2e=function(_0x129479,_0x256c7e){_0x129479=_0x129479-0x0;var _0x3fa0ce=_0xa2e2[_0x129479];return _0x3fa0ce;};'use strict';var _=require(_0x2a2e('0x0'));var util=require(_0x2a2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2a2e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a2e('0x3'));var rimraf=require(_0x2a2e('0x4'));var config=require(_0x2a2e('0x5'));var attributes=require('./license.attributes');module[_0x2a2e('0x6')]=function(_0x72cae2,_0x1dd2ea){return _0x72cae2['define']('License',attributes,{'tableName':_0x2a2e('0x7'),'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 7855f26..0a698af 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 _0xbae5=['message','info','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xbae5,0x1a7));var _0x5bae=function(_0x5e8940,_0x164e8){_0x5e8940=_0x5e8940-0x0;var _0x5d698c=_0xbae5[_0x5e8940];return _0x5d698c;};'use strict';var _=require(_0x5bae('0x0'));var util=require(_0x5bae('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5bae('0x2'));var fs=require('fs');var Redis=require(_0x5bae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bae('0x4'));var logger=require(_0x5bae('0x5'))(_0x5bae('0x6'));var config=require(_0x5bae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bae('0x8')][_0x5bae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a09a1,_0x3ed877,_0x1f940d){return new BPromise(function(_0x2c7305,_0xbf128e){return client[_0x5bae('0xa')](_0x1a09a1,_0x1f940d)[_0x5bae('0xb')](function(_0x274bba){logger['info'](_0x5bae('0xc'),_0x3ed877,_0x5bae('0xd'));logger[_0x5bae('0xe')](_0x5bae('0xf'),_0x3ed877,_0x5bae('0xd'),JSON[_0x5bae('0x10')](_0x274bba));if(_0x274bba[_0x5bae('0x11')]){if(_0x274bba[_0x5bae('0x11')]['code']===0x1f4){logger[_0x5bae('0x11')](_0x5bae('0xc'),_0x3ed877,_0x274bba[_0x5bae('0x11')][_0x5bae('0x12')]);return _0xbf128e(_0x274bba[_0x5bae('0x11')][_0x5bae('0x12')]);}logger[_0x5bae('0x11')]('License,\x20%s,\x20%s',_0x3ed877,_0x274bba[_0x5bae('0x11')][_0x5bae('0x12')]);return _0x2c7305(_0x274bba[_0x5bae('0x11')]['message']);}else{logger[_0x5bae('0x13')](_0x5bae('0xc'),_0x3ed877,_0x5bae('0xd'));_0x2c7305(_0x274bba[_0x5bae('0x14')][_0x5bae('0x12')]);}})['catch'](function(_0x2257e7){logger[_0x5bae('0x11')]('License,\x20%s,\x20%s',_0x3ed877,_0x2257e7);_0xbf128e(_0x2257e7);});});} \ No newline at end of file +var _0x6d2e=['message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4400f7,_0x400b94){var _0x54dbd0=function(_0x2980fe){while(--_0x2980fe){_0x4400f7['push'](_0x4400f7['shift']());}};_0x54dbd0(++_0x400b94);}(_0x6d2e,0xfe));var _0xe6d2=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x6d2e[_0x5528c3];return _0x47ec1b;};'use strict';var _=require('lodash');var util=require(_0xe6d2('0x0'));var moment=require(_0xe6d2('0x1'));var BPromise=require(_0xe6d2('0x2'));var rs=require(_0xe6d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6d2('0x4'))['db'];var utils=require(_0xe6d2('0x5'));var logger=require(_0xe6d2('0x6'))(_0xe6d2('0x7'));var config=require(_0xe6d2('0x8'));var jayson=require(_0xe6d2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dac13,_0x30ff6e,_0x56389d){return new BPromise(function(_0x4894f8,_0x54b956){return client['request'](_0x4dac13,_0x56389d)[_0xe6d2('0xa')](function(_0x5becf0){logger[_0xe6d2('0xb')](_0xe6d2('0xc'),_0x30ff6e,'request\x20sent');logger['debug'](_0xe6d2('0xd'),_0x30ff6e,_0xe6d2('0xe'),JSON['stringify'](_0x5becf0));if(_0x5becf0['error']){if(_0x5becf0[_0xe6d2('0xf')]['code']===0x1f4){logger['error'](_0xe6d2('0xc'),_0x30ff6e,_0x5becf0[_0xe6d2('0xf')]['message']);return _0x54b956(_0x5becf0[_0xe6d2('0xf')][_0xe6d2('0x10')]);}logger[_0xe6d2('0xf')]('License,\x20%s,\x20%s',_0x30ff6e,_0x5becf0[_0xe6d2('0xf')][_0xe6d2('0x10')]);return _0x4894f8(_0x5becf0['error'][_0xe6d2('0x10')]);}else{logger[_0xe6d2('0xb')](_0xe6d2('0xc'),_0x30ff6e,_0xe6d2('0xe'));_0x4894f8(_0x5becf0['result'][_0xe6d2('0x10')]);}})[_0xe6d2('0x11')](function(_0x45ca16){logger[_0xe6d2('0xf')](_0xe6d2('0xc'),_0x30ff6e,_0x45ca16);_0x54b956(_0x45ca16);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index fa53806..b6bb1b6 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 _0xc896=['getApplications','verifySmtp','getAgents','post','addDisposition','/:id/canned_answers','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','/:id/users','removeAgents','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc896,0x13d));var _0x6c89=function(_0xc2ed25,_0x352103){_0xc2ed25=_0xc2ed25-0x0;var _0x2c1ea2=_0xc896[_0xc2ed25];return _0x2c1ea2;};'use strict';var multer=require(_0x6c89('0x0'));var util=require('util');var path=require(_0x6c89('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c89('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6c89('0x3'));var interaction=require(_0x6c89('0x4'));var config=require('../../config/environment');var controller=require(_0x6c89('0x5'));router['get']('/',auth[_0x6c89('0x6')](),controller['index']);router[_0x6c89('0x7')](_0x6c89('0x8'),auth['isAuthenticated'](),controller[_0x6c89('0x9')]);router[_0x6c89('0x7')](_0x6c89('0xa'),auth[_0x6c89('0x6')](),controller[_0x6c89('0xb')]);router[_0x6c89('0x7')](_0x6c89('0xc'),auth[_0x6c89('0x6')](),controller[_0x6c89('0xd')]);router[_0x6c89('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x6c89('0x7')](_0x6c89('0xe'),auth['isAuthenticated'](),controller[_0x6c89('0xf')]);router[_0x6c89('0x7')](_0x6c89('0x10'),auth['isAuthenticated'](),controller[_0x6c89('0x11')]);router[_0x6c89('0x7')]('/:id/interactions',auth[_0x6c89('0x6')](),controller['getInteractions']);router[_0x6c89('0x7')](_0x6c89('0x12'),auth['isAuthenticated'](),controller[_0x6c89('0x13')]);router['get']('/:id/messages',auth[_0x6c89('0x6')](),controller['getMessages']);router[_0x6c89('0x7')]('/:id/verify',auth[_0x6c89('0x6')](),controller[_0x6c89('0x14')]);router['get']('/:id/users',auth[_0x6c89('0x6')](),controller[_0x6c89('0x15')]);router[_0x6c89('0x16')](_0x6c89('0xc'),auth['isAuthenticated'](),controller[_0x6c89('0x17')]);router[_0x6c89('0x16')](_0x6c89('0x18'),auth[_0x6c89('0x6')](),controller['addAnswer']);router['post']('/',auth[_0x6c89('0x6')](),controller[_0x6c89('0x19')]);router[_0x6c89('0x16')](_0x6c89('0xe'),auth[_0x6c89('0x6')](),controller[_0x6c89('0x1a')]);router[_0x6c89('0x16')]('/:id/out_servers',auth[_0x6c89('0x6')](),controller[_0x6c89('0x1b')]);router['post'](_0x6c89('0x1c'),auth['isAuthenticated'](),controller[_0x6c89('0x1d')]);router[_0x6c89('0x16')]('/:id/applications',auth[_0x6c89('0x6')](),controller[_0x6c89('0x1e')]);router[_0x6c89('0x16')](_0x6c89('0x1f'),auth[_0x6c89('0x6')](),controller['send']);router[_0x6c89('0x16')]('/:id/users',auth[_0x6c89('0x6')](),controller[_0x6c89('0x20')]);router['put'](_0x6c89('0xa'),auth['isAuthenticated'](),controller[_0x6c89('0x21')]);router[_0x6c89('0x22')]('/:id/dispositions',auth[_0x6c89('0x6')](),controller[_0x6c89('0x23')]);router[_0x6c89('0x22')](_0x6c89('0x18'),auth[_0x6c89('0x6')](),controller[_0x6c89('0x24')]);router['delete'](_0x6c89('0xe'),auth['isAuthenticated'](),controller['removeImap']);router[_0x6c89('0x22')](_0x6c89('0x10'),auth[_0x6c89('0x6')](),controller[_0x6c89('0x25')]);router[_0x6c89('0x22')](_0x6c89('0xa'),auth[_0x6c89('0x6')](),controller[_0x6c89('0x26')]);router['delete'](_0x6c89('0x27'),auth[_0x6c89('0x6')](),controller[_0x6c89('0x28')]);module[_0x6c89('0x29')]=router; \ No newline at end of file +var _0x82f7=['describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','create','addInteraction','addApplications','send','update','removeDispositions','delete','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated'];(function(_0x5950f4,_0x2a1816){var _0x21f517=function(_0x2bf355){while(--_0x2bf355){_0x5950f4['push'](_0x5950f4['shift']());}};_0x21f517(++_0x2a1816);}(_0x82f7,0x198));var _0x782f=function(_0x26727d,_0x558684){_0x26727d=_0x26727d-0x0;var _0x5dcb0b=_0x82f7[_0x26727d];return _0x5dcb0b;};'use strict';var multer=require(_0x782f('0x0'));var util=require(_0x782f('0x1'));var path=require(_0x782f('0x2'));var timeout=require(_0x782f('0x3'));var express=require('express');var router=express[_0x782f('0x4')]();var fs_extra=require(_0x782f('0x5'));var auth=require(_0x782f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x782f('0x7'));var controller=require(_0x782f('0x8'));router[_0x782f('0x9')]('/',auth['isAuthenticated'](),controller[_0x782f('0xa')]);router[_0x782f('0x9')]('/describe',auth[_0x782f('0xb')](),controller[_0x782f('0xc')]);router[_0x782f('0x9')](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0xe')]);router['get'](_0x782f('0xf'),auth[_0x782f('0xb')](),controller[_0x782f('0x10')]);router[_0x782f('0x9')]('/:id/canned_answers',auth[_0x782f('0xb')](),controller[_0x782f('0x11')]);router['get'](_0x782f('0x12'),auth['isAuthenticated'](),controller[_0x782f('0x13')]);router[_0x782f('0x9')](_0x782f('0x14'),auth['isAuthenticated'](),controller[_0x782f('0x15')]);router[_0x782f('0x9')](_0x782f('0x16'),auth['isAuthenticated'](),controller[_0x782f('0x17')]);router[_0x782f('0x9')](_0x782f('0x18'),auth[_0x782f('0xb')](),controller['getApplications']);router['get']('/:id/messages',auth[_0x782f('0xb')](),controller[_0x782f('0x19')]);router['get'](_0x782f('0x1a'),auth[_0x782f('0xb')](),controller[_0x782f('0x1b')]);router[_0x782f('0x9')](_0x782f('0x1c'),auth[_0x782f('0xb')](),controller['getAgents']);router['post'](_0x782f('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x782f('0x1d')]('/:id/canned_answers',auth[_0x782f('0xb')](),controller[_0x782f('0x1e')]);router[_0x782f('0x1d')]('/',auth[_0x782f('0xb')](),controller[_0x782f('0x1f')]);router[_0x782f('0x1d')](_0x782f('0x12'),auth['isAuthenticated'](),controller['addImap']);router[_0x782f('0x1d')](_0x782f('0x14'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x782f('0x1d')](_0x782f('0x16'),auth[_0x782f('0xb')](),controller[_0x782f('0x20')]);router['post'](_0x782f('0x18'),auth[_0x782f('0xb')](),controller[_0x782f('0x21')]);router[_0x782f('0x1d')]('/:id/send',auth[_0x782f('0xb')](),controller[_0x782f('0x22')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x782f('0xd'),auth['isAuthenticated'](),controller[_0x782f('0x23')]);router['delete']('/:id/dispositions',auth[_0x782f('0xb')](),controller[_0x782f('0x24')]);router[_0x782f('0x25')]('/:id/canned_answers',auth[_0x782f('0xb')](),controller['removeAnswers']);router['delete'](_0x782f('0x12'),auth[_0x782f('0xb')](),controller[_0x782f('0x26')]);router[_0x782f('0x25')]('/:id/out_servers',auth[_0x782f('0xb')](),controller['removeSmtp']);router['delete'](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0x27')]);router[_0x782f('0x25')]('/:id/users',auth[_0x782f('0xb')](),controller[_0x782f('0x28')]);module[_0x782f('0x29')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 73965a1..145f69f 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 _0xcf06=['mandatoryDisposition','ENUM','gmail','yahoo','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0xa56b53,_0x53dbb7){var _0x19849f=function(_0x503946){while(--_0x503946){_0xa56b53['push'](_0xa56b53['shift']());}};_0x19849f(++_0x53dbb7);}(_0xcf06,0x1b6));var _0x6cf0=function(_0x3ec307,_0x255f75){_0x3ec307=_0x3ec307-0x0;var _0x383b4f=_0xcf06[_0x3ec307];return _0x383b4f;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x6cf0('0x0')]},'name':{'type':Sequelize[_0x6cf0('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x6cf0('0x2')]},'markAsUnread':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6cf0('0x0')],'allowNull':![],'defaultValue':_0x6cf0('0x3')},'fontSize':{'type':Sequelize[_0x6cf0('0x4')](0x2)[_0x6cf0('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6cf0('0x2')],'defaultValue':function(){return _0x6cf0('0x6');}},'notificationSound':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6cf0('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6cf0('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6cf0('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6cf0('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x6cf0('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xd8ea87){if(!_0xd8ea87)this[_0x6cf0('0x8')](_0x6cf0('0x9'),null);this[_0x6cf0('0x8')](_0x6cf0('0xa'),_0xd8ea87);}},'provider':{'type':Sequelize[_0x6cf0('0xb')](_0x6cf0('0xc'),'hotmail',_0x6cf0('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x6cf0('0xe')))return _0x6cf0('0xf');return this['getDataValue']('provider');},'set':function(_0x246482){if(_0x246482==='custom')_0x246482=null;return this[_0x6cf0('0x8')](_0x6cf0('0xe'),_0x246482);}}}; \ No newline at end of file +var _0xa047=['exports','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','yahoo','outlook365','getDataValue','provider','custom','sequelize'];(function(_0x5627fd,_0x520f46){var _0x1afe7b=function(_0x19fb76){while(--_0x19fb76){_0x5627fd['push'](_0x5627fd['shift']());}};_0x1afe7b(++_0x520f46);}(_0xa047,0x1ed));var _0x7a04=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xa047[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x7a04('0x0'));module[_0x7a04('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7a04('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x7a04('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7a04('0x4')},'fontSize':{'type':Sequelize[_0x7a04('0x5')](0x2)[_0x7a04('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7a04('0x3')],'defaultValue':function(){return _0x7a04('0x7');}},'notificationSound':{'type':Sequelize[_0x7a04('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7a04('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7a04('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7a04('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7a04('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a04('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x7a04('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x44dbf8){if(!_0x44dbf8)this[_0x7a04('0xa')](_0x7a04('0xb'),null);this[_0x7a04('0xa')]('mandatoryDisposition',_0x44dbf8);}},'provider':{'type':Sequelize[_0x7a04('0xc')](_0x7a04('0xd'),'hotmail',_0x7a04('0xe'),_0x7a04('0xf')),'defaultValue':null,'get':function(){if(!this[_0x7a04('0x10')](_0x7a04('0x11')))return _0x7a04('0x12');return this[_0x7a04('0x10')](_0x7a04('0x11'));},'set':function(_0x16cde1){if(_0x16cde1===_0x7a04('0x12'))_0x16cde1=null;return this['setDataValue']('provider',_0x16cde1);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4e57861..77349db 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 _0x6087=['hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','Imap','Smtp','index','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','MailServerIn','mandatoryDispositionPause','find','body','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','nolimit','sort','removeDispositions','create','getAnswers','removeAnswers','ids','key','custom','email','isNil','active','description','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','defaults','ListId','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo'];(function(_0xb0523,_0x18e5b2){var _0x232312=function(_0x2fbd0e){while(--_0x2fbd0e){_0xb0523['push'](_0xb0523['shift']());}};_0x232312(++_0x18e5b2);}(_0x6087,0x14f));var _0x7608=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6087[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require(_0x7608('0x0'));var BPromise=require(_0x7608('0x1'));var util=require('util');var path=require('path');var _=require(_0x7608('0x2'));var juice=require(_0x7608('0x3'));var Redis=require('ioredis');var qs=require(_0x7608('0x4'));var logger=require(_0x7608('0x5'))(_0x7608('0x6'));var config=require(_0x7608('0x7'));var db=require(_0x7608('0x8'))['db'];config[_0x7608('0x9')]=_['defaults'](config[_0x7608('0x9')],{'host':_0x7608('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7608('0xb'))[_0x7608('0xc')](socket);var jayson=require(_0x7608('0xd'));var client=jayson[_0x7608('0xe')][_0x7608('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x561209,_0xaedeb5,_0xd2f11e,_0x5c8343){return new BPromise(function(_0x4e0193,_0x3b88d9){var _0x191c3f=_0x5c8343||client;return _0x191c3f[_0x7608('0x10')](_0x561209,_0xd2f11e)[_0x7608('0x11')](function(_0x3952b1){logger[_0x7608('0x12')](_0x7608('0x13'),_0xaedeb5,_0x7608('0x14'));logger['debug'](_0x7608('0x15'),_0xaedeb5,_0x7608('0x14'),JSON['stringify'](_0x3952b1));if(_0x3952b1[_0x7608('0x16')]){if(_0x3952b1[_0x7608('0x16')][_0x7608('0x17')]===0x1f4){logger['error'](_0x7608('0x13'),_0xaedeb5,_0x3952b1['error'][_0x7608('0x18')]);return _0x3b88d9(_0x3952b1[_0x7608('0x16')][_0x7608('0x18')]);}logger[_0x7608('0x16')](_0x7608('0x13'),_0xaedeb5,_0x3952b1['error'][_0x7608('0x18')]);return _0x4e0193(_0x3952b1['error'][_0x7608('0x18')]);}else{logger[_0x7608('0x12')](_0x7608('0x13'),_0xaedeb5,'request\x20sent');_0x4e0193(_0x3952b1[_0x7608('0x19')][_0x7608('0x18')]);}})[_0x7608('0x1a')](function(_0x2e0c36){logger[_0x7608('0x16')](_0x7608('0x13'),_0xaedeb5,_0x2e0c36);_0x3b88d9(_0x2e0c36);});});}function respondWithStatusCode(_0x3460b2,_0x50f697){_0x50f697=_0x50f697||0xcc;return function(_0x4265c7){if(_0x4265c7){return _0x3460b2[_0x7608('0x1b')](_0x50f697);}return _0x3460b2['status'](_0x50f697)['end']();};}function respondWithResult(_0x33ff94,_0x18c2f9){_0x18c2f9=_0x18c2f9||0xc8;return function(_0x4945e2){if(_0x4945e2){return _0x33ff94[_0x7608('0x1c')](_0x18c2f9)[_0x7608('0x1d')](_0x4945e2);}};}function respondWithFilteredResult(_0x53f816,_0x171f83){return function(_0x3b8074){if(_0x3b8074){var _0x45db0f=typeof _0x171f83['offset']==='undefined'&&typeof _0x171f83[_0x7608('0x1e')]===_0x7608('0x1f');var _0x376abe=_0x3b8074['count'];var _0x461562=_0x45db0f?0x0:_0x171f83['offset'];var _0x55b240=_0x45db0f?_0x3b8074[_0x7608('0x20')]:_0x171f83[_0x7608('0x21')]+_0x171f83[_0x7608('0x1e')];var _0x367111;if(_0x55b240>=_0x376abe){_0x55b240=_0x376abe;_0x367111=0xc8;}else{_0x367111=0xce;}_0x53f816[_0x7608('0x1c')](_0x367111);return _0x53f816['set'](_0x7608('0x22'),_0x461562+'-'+_0x55b240+'/'+_0x376abe)['json'](_0x3b8074);}return null;};}function saveUpdates(_0x12668e){return function(_0x38b1c7){if(_0x38b1c7){return _0x38b1c7[_0x7608('0x23')](_0x12668e)['then'](function(_0x2e3f07){return _0x2e3f07;});}return null;};}function removeEntity(_0x4e0c52){return function(_0x2fb7a9){if(_0x2fb7a9){return _0x2fb7a9[_0x7608('0x24')]()[_0x7608('0x11')](function(){var _0x4836d8=_0x2fb7a9[_0x7608('0x25')]({'plain':!![]});var _0x211381=_0x7608('0x26');return db[_0x7608('0x27')][_0x7608('0x24')]({'where':{'type':_0x211381,'resourceId':_0x4836d8['id']}})['then'](function(){return _0x2fb7a9;});})[_0x7608('0x11')](function(){_0x4e0c52[_0x7608('0x1c')](0xcc)[_0x7608('0x28')]();});}};}function handleEntityNotFound(_0x4a3a5f){return function(_0x52351d){if(!_0x52351d){_0x4a3a5f[_0x7608('0x1b')](0x194);}return _0x52351d;};}function handleError(_0x1ac1f8,_0x3c8745){_0x3c8745=_0x3c8745||0x1f4;return function(_0x49b9cd){logger[_0x7608('0x16')](_0x49b9cd[_0x7608('0x29')]);if(_0x49b9cd[_0x7608('0x2a')]){delete _0x49b9cd[_0x7608('0x2a')];}_0x1ac1f8[_0x7608('0x1c')](_0x3c8745)[_0x7608('0x2b')](_0x49b9cd);};}function getImapHost(_0x51835a){switch(_0x51835a){case _0x7608('0x2c'):return _0x7608('0x2d');case _0x7608('0x2e'):return'imap.mail.yahoo.com';case _0x7608('0x2f'):return'imap-mail.outlook.com';case _0x7608('0x30'):return _0x7608('0x31');}throw new Error(_0x7608('0x32'),_0x51835a);}function getSmtpHost(_0x4189a1){switch(_0x4189a1){case _0x7608('0x2c'):return _0x7608('0x33');case'yahoo':return _0x7608('0x34');case _0x7608('0x2f'):return'smtp-mail.outlook.com';case _0x7608('0x30'):return _0x7608('0x35');}throw new Error(_0x7608('0x32'),_0x4189a1);}function getAuthenticationOptions(_0x2b7294,_0x216bd8){var _0x2fcc18={};var _0x332fc1={};if(_0x2b7294){_0x2fcc18['user']=_0x332fc1[_0x7608('0x36')]=_0x216bd8[_0x7608('0x37')];_0x2fcc18[_0x7608('0x38')]=_0x332fc1[_0x7608('0x39')]=_0x216bd8[_0x7608('0x38')];if(_0x216bd8[_0x7608('0x3a')]){_0x2fcc18[_0x7608('0x3a')]=_0x332fc1[_0x7608('0x3a')]=!![];_0x2fcc18[_0x7608('0x3b')]=_0x332fc1[_0x7608('0x3b')]=_0x216bd8[_0x7608('0x3b')];_0x2fcc18[_0x7608('0x38')]=_0x332fc1[_0x7608('0x39')]=null;}else{_0x2fcc18[_0x7608('0x3b')]=_0x332fc1[_0x7608('0x3b')]=null;}_0x2fcc18[_0x7608('0x3c')]=getImapHost(_0x2b7294);_0x2fcc18[_0x7608('0x3d')]=0x3e1;_0x332fc1[_0x7608('0x3c')]=getSmtpHost(_0x2b7294);_0x332fc1[_0x7608('0x3d')]=0x24b;_0x332fc1[_0x7608('0x3e')]=![];_0x2fcc18[_0x7608('0x3f')]=_0x332fc1[_0x7608('0x3f')]=null;}else{if(_0x216bd8['authentication']){_0x2fcc18['user']=_0x332fc1[_0x7608('0x36')]=_0x216bd8[_0x7608('0x37')];_0x2fcc18['password']=_0x332fc1[_0x7608('0x39')]=_0x216bd8[_0x7608('0x38')];}else{_0x2fcc18['authentication']=_0x332fc1['authentication']=![];_0x2fcc18['user']=_0x332fc1[_0x7608('0x36')]=null;_0x2fcc18[_0x7608('0x38')]=_0x332fc1[_0x7608('0x39')]=null;}_0x2fcc18['host']=_0x216bd8[_0x7608('0x40')][_0x7608('0x3c')];_0x2fcc18[_0x7608('0x3d')]=_0x216bd8[_0x7608('0x40')][_0x7608('0x3d')];_0x332fc1[_0x7608('0x3c')]=_0x216bd8[_0x7608('0x41')]['host'];_0x332fc1[_0x7608('0x3d')]=_0x216bd8[_0x7608('0x41')][_0x7608('0x3d')];}return{'Imap':_0x2fcc18,'Smtp':_0x332fc1};}exports[_0x7608('0x42')]=function(_0x39aab4,_0x11f4fb){var _0x2feb47={'include':[{'model':db['MailServerIn'],'as':_0x7608('0x40')},{'model':db[_0x7608('0x43')],'as':_0x7608('0x41')},{'model':db[_0x7608('0x44')],'as':'mandatoryDispositionPause'}]},_0x48cc4c={},_0x364396={'count':0x0,'rows':[]};var _0x1c89ad=_[_0x7608('0x45')](db[_0x7608('0x46')][_0x7608('0x47')],function(_0x5eda64){return{'name':_0x5eda64[_0x7608('0x48')],'type':_0x5eda64['type']['key']};});_0x48cc4c[_0x7608('0x49')]=_[_0x7608('0x45')](_0x1c89ad,_0x7608('0x2a'));_0x48cc4c[_0x7608('0x4a')]=_[_0x7608('0x4b')](_0x39aab4['query']);_0x48cc4c[_0x7608('0x4c')]=_[_0x7608('0x4d')](_0x48cc4c['model'],_0x48cc4c[_0x7608('0x4a')]);_0x2feb47[_0x7608('0x4e')]=_['intersection'](_0x48cc4c['model'],qs['fields'](_0x39aab4['query'][_0x7608('0x4f')]));_0x2feb47[_0x7608('0x4e')]=_0x2feb47['attributes'][_0x7608('0x50')]?_0x2feb47[_0x7608('0x4e')]:_0x48cc4c['model'];if(!_0x39aab4[_0x7608('0x4a')][_0x7608('0x51')]('nolimit')){_0x2feb47[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x39aab4[_0x7608('0x4a')][_0x7608('0x1e')]);_0x2feb47['offset']=qs[_0x7608('0x21')](_0x39aab4['query']['offset']);}_0x2feb47[_0x7608('0x52')]=qs['sort'](_0x39aab4[_0x7608('0x4a')]['sort']);_0x2feb47[_0x7608('0x53')]=qs[_0x7608('0x4c')](_[_0x7608('0x54')](_0x39aab4[_0x7608('0x4a')],_0x48cc4c[_0x7608('0x4c')]),_0x1c89ad);if(_0x39aab4['query']['filter']){_0x2feb47[_0x7608('0x53')]=_[_0x7608('0x55')](_0x2feb47[_0x7608('0x53')],{'$or':_[_0x7608('0x45')](_0x1c89ad,function(_0x1b7716){if(_0x1b7716['type']!==_0x7608('0x56')){var _0x193a3b={};_0x193a3b[_0x1b7716[_0x7608('0x2a')]]={'$like':'%'+_0x39aab4[_0x7608('0x4a')][_0x7608('0x57')]+'%'};return _0x193a3b;}})});}_0x2feb47=_[_0x7608('0x55')]({},_0x2feb47,_0x39aab4[_0x7608('0x58')]);var _0x300106={'where':_0x2feb47[_0x7608('0x53')]};return db[_0x7608('0x46')][_0x7608('0x20')](_0x300106)[_0x7608('0x11')](function(_0x265f59){_0x364396[_0x7608('0x20')]=_0x265f59;if(_0x39aab4['query'][_0x7608('0x59')]){_0x2feb47[_0x7608('0x5a')]=[{'all':!![]}];}return db[_0x7608('0x46')][_0x7608('0x5b')](_0x2feb47);})[_0x7608('0x11')](function(_0x19f6d6){_0x364396[_0x7608('0x5c')]=_0x19f6d6;return _0x364396;})[_0x7608('0x11')](respondWithFilteredResult(_0x11f4fb,_0x2feb47))[_0x7608('0x1a')](handleError(_0x11f4fb,null));};exports[_0x7608('0x5d')]=function(_0x13c86b,_0x1b7f3d){var _0x4bd87a={'raw':![],'where':{'id':_0x13c86b[_0x7608('0x5e')]['id']},'include':[{'model':db[_0x7608('0x5f')],'as':_0x7608('0x40')},{'model':db[_0x7608('0x43')],'as':'Smtp'},{'model':db[_0x7608('0x44')],'as':_0x7608('0x60')}]},_0x3c0d54={};_0x3c0d54[_0x7608('0x49')]=_[_0x7608('0x4b')](db[_0x7608('0x46')][_0x7608('0x47')]);_0x3c0d54[_0x7608('0x4a')]=_[_0x7608('0x4b')](_0x13c86b[_0x7608('0x4a')]);_0x3c0d54[_0x7608('0x4c')]=_[_0x7608('0x4d')](_0x3c0d54[_0x7608('0x49')],_0x3c0d54[_0x7608('0x4a')]);_0x4bd87a[_0x7608('0x4e')]=_[_0x7608('0x4d')](_0x3c0d54[_0x7608('0x49')],qs[_0x7608('0x4f')](_0x13c86b['query'][_0x7608('0x4f')]));_0x4bd87a[_0x7608('0x4e')]=_0x4bd87a['attributes'][_0x7608('0x50')]?_0x4bd87a[_0x7608('0x4e')]:_0x3c0d54[_0x7608('0x49')];if(_0x13c86b[_0x7608('0x4a')][_0x7608('0x59')]){_0x4bd87a[_0x7608('0x5a')]=[{'all':!![]}];}_0x4bd87a=_[_0x7608('0x55')]({},_0x4bd87a,_0x13c86b[_0x7608('0x58')]);return db[_0x7608('0x46')][_0x7608('0x61')](_0x4bd87a)[_0x7608('0x11')](handleEntityNotFound(_0x1b7f3d,null))['then'](respondWithResult(_0x1b7f3d,null))[_0x7608('0x1a')](handleError(_0x1b7f3d,null));};exports['update']=function(_0x2ac82f,_0xc3d485){if(_0x2ac82f[_0x7608('0x62')]['id']){delete _0x2ac82f[_0x7608('0x62')]['id'];}var _0x5aeadb=_0x2ac82f[_0x7608('0x62')][_0x7608('0x63')]==='custom'?null:_0x2ac82f[_0x7608('0x62')]['provider'];var _0x470731=_0x2ac82f[_0x7608('0x62')][_0x7608('0x40')]||{};var _0x37d01c=_0x2ac82f['body'][_0x7608('0x41')]||{};if(_0x5aeadb){_0x470731[_0x7608('0x3c')]=getImapHost(_0x5aeadb);_0x470731['port']=0x3e1;_0x37d01c[_0x7608('0x3c')]=getSmtpHost(_0x5aeadb);_0x37d01c[_0x7608('0x3d')]=0x24b;_0x37d01c[_0x7608('0x3e')]=![];}if(_0x37d01c[_0x7608('0x3a')]){_0x37d01c[_0x7608('0x3e')]=![];}else{_0x37d01c[_0x7608('0x3b')]=null;}if(!_0x470731[_0x7608('0x3a')])_0x470731[_0x7608('0x3b')]=null;_0x2ac82f[_0x7608('0x62')][_0x7608('0x40')]=_0x470731;_0x2ac82f[_0x7608('0x62')][_0x7608('0x41')]=_0x37d01c;return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x2ac82f[_0x7608('0x5e')]['id']},'include':[{'model':db[_0x7608('0x5f')],'as':_0x7608('0x40')},{'model':db[_0x7608('0x43')],'as':'Smtp'},{'model':db[_0x7608('0x44')],'as':'mandatoryDispositionPause'}]})[_0x7608('0x11')](handleEntityNotFound(_0xc3d485,null))[_0x7608('0x11')](function(_0x28182e){if(!_0x28182e)throw new Error(_0x7608('0x64'));if(_0x28182e['service'])delete _0x2ac82f[_0x7608('0x62')][_0x7608('0x40')];return _0x28182e;})[_0x7608('0x11')](saveUpdates(_0x2ac82f[_0x7608('0x62')],null))['then'](function(_0x1ebff0){if(!_0x2ac82f['body'][_0x7608('0x40')])return _0x1ebff0;return db[_0x7608('0x5f')][_0x7608('0x23')](_0x2ac82f[_0x7608('0x62')][_0x7608('0x40')],{'where':{'MailAccountId':_0x1ebff0['id']}})[_0x7608('0x11')](function(){return _0x1ebff0;});})[_0x7608('0x11')](function(_0x5c6d7c){if(!_0x2ac82f[_0x7608('0x62')][_0x7608('0x41')])return _0x5c6d7c;return db[_0x7608('0x43')][_0x7608('0x23')](_0x2ac82f[_0x7608('0x62')]['Smtp'],{'where':{'MailAccountId':_0x5c6d7c['id']}})[_0x7608('0x11')](function(){return _0x5c6d7c;});})[_0x7608('0x11')](respondWithResult(_0xc3d485,null))[_0x7608('0x1a')](handleError(_0xc3d485,null));};exports[_0x7608('0x65')]=function(_0x329b17,_0xdc6bea){return db['MailAccount'][_0x7608('0x65')]()[_0x7608('0x11')](respondWithResult(_0xdc6bea,null))[_0x7608('0x1a')](handleError(_0xdc6bea,null));};exports[_0x7608('0x66')]=function(_0x4b16f0,_0x4dcd37){if(_0x4b16f0[_0x7608('0x62')]['id']){delete _0x4b16f0[_0x7608('0x62')]['id'];}return db[_0x7608('0x46')]['find']({'where':{'id':_0x4b16f0['params']['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x4dcd37,null))[_0x7608('0x11')](function(_0x84303f){if(_0x84303f){_0x4b16f0['body'][_0x7608('0x67')]=_0x84303f['id'];return db[_0x7608('0x68')]['create'](_0x4b16f0[_0x7608('0x62')]);}})[_0x7608('0x11')](respondWithResult(_0x4dcd37,null))[_0x7608('0x1a')](handleError(_0x4dcd37,null));};exports[_0x7608('0x69')]=function(_0x5aa1ff,_0x5549b3){var _0x59baa2={'raw':![],'where':{}};var _0x27645d={};var _0x3696e6={'count':0x0,'rows':[]};return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x5aa1ff['params']['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x5549b3,null))[_0x7608('0x11')](function(_0x5d9043){if(_0x5d9043){_0x27645d[_0x7608('0x49')]=_[_0x7608('0x4b')](db['Disposition'][_0x7608('0x47')]);_0x27645d[_0x7608('0x4a')]=_[_0x7608('0x4b')](_0x5aa1ff['query']);_0x27645d['filters']=_['intersection'](_0x27645d[_0x7608('0x49')],_0x27645d[_0x7608('0x4a')]);_0x59baa2['attributes']=_['intersection'](_0x27645d[_0x7608('0x49')],qs[_0x7608('0x4f')](_0x5aa1ff['query'][_0x7608('0x4f')]));_0x59baa2[_0x7608('0x4e')]=_0x59baa2[_0x7608('0x4e')]['length']?_0x59baa2[_0x7608('0x4e')]:_0x27645d[_0x7608('0x49')];if(!_0x5aa1ff[_0x7608('0x4a')][_0x7608('0x51')](_0x7608('0x6b'))){_0x59baa2[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x5aa1ff[_0x7608('0x4a')][_0x7608('0x1e')]);_0x59baa2[_0x7608('0x21')]=qs[_0x7608('0x21')](_0x5aa1ff['query'][_0x7608('0x21')]);}_0x59baa2[_0x7608('0x52')]=qs[_0x7608('0x6c')](_0x5aa1ff['query'][_0x7608('0x6c')]);_0x59baa2[_0x7608('0x53')]=qs[_0x7608('0x4c')](_['pick'](_0x5aa1ff[_0x7608('0x4a')],_0x27645d[_0x7608('0x4c')]));_0x59baa2['where'][_0x7608('0x67')]=_0x5d9043['id'];if(_0x5aa1ff[_0x7608('0x4a')][_0x7608('0x57')]){_0x59baa2[_0x7608('0x53')]=_[_0x7608('0x55')](_0x59baa2[_0x7608('0x53')],{'$or':_['map'](_0x59baa2[_0x7608('0x4e')],function(_0x2c5035){var _0x15bb0c={};_0x15bb0c[_0x2c5035]={'$like':'%'+_0x5aa1ff[_0x7608('0x4a')][_0x7608('0x57')]+'%'};return _0x15bb0c;})});}_0x59baa2=_[_0x7608('0x55')]({},_0x59baa2,_0x5aa1ff[_0x7608('0x58')]);return db['Disposition'][_0x7608('0x20')]({'where':_0x59baa2['where']})[_0x7608('0x11')](function(_0x1926f3){_0x3696e6[_0x7608('0x20')]=_0x1926f3;if(_0x5aa1ff[_0x7608('0x4a')][_0x7608('0x59')]){_0x59baa2['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x59baa2);})[_0x7608('0x11')](function(_0x1d4c63){_0x3696e6[_0x7608('0x5c')]=_0x1d4c63;return _0x3696e6;});}})['then'](respondWithFilteredResult(_0x5549b3,_0x59baa2))[_0x7608('0x1a')](handleError(_0x5549b3,null));};exports[_0x7608('0x6d')]=function(_0x61897,_0x3d9369){return db['MailAccount'][_0x7608('0x61')]({'where':{'id':_0x61897[_0x7608('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3d9369,null))[_0x7608('0x11')](function(_0x45ce3d){if(_0x45ce3d){return _0x45ce3d[_0x7608('0x6d')](_0x61897['query']['ids']);}})[_0x7608('0x11')](respondWithStatusCode(_0x3d9369,null))[_0x7608('0x1a')](handleError(_0x3d9369,null));};exports['addAnswer']=function(_0x52a10f,_0x4bd7ba){if(_0x52a10f[_0x7608('0x62')]['id']){delete _0x52a10f[_0x7608('0x62')]['id'];}return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x52a10f[_0x7608('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4bd7ba,null))[_0x7608('0x11')](function(_0x227b26){if(_0x227b26){_0x52a10f[_0x7608('0x62')][_0x7608('0x67')]=_0x227b26['id'];return db['CannedAnswer'][_0x7608('0x6e')](_0x52a10f['body']);}})[_0x7608('0x11')](respondWithResult(_0x4bd7ba,null))[_0x7608('0x1a')](handleError(_0x4bd7ba,null));};exports[_0x7608('0x6f')]=function(_0x42e5cb,_0x6f53eb){var _0x2bf24f={'raw':![],'where':{}};var _0x381c0e={};var _0x4d325d={'count':0x0,'rows':[]};return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x42e5cb[_0x7608('0x5e')]['id']}})['then'](handleEntityNotFound(_0x6f53eb,null))[_0x7608('0x11')](function(_0x3620ea){if(_0x3620ea){_0x381c0e[_0x7608('0x49')]=_[_0x7608('0x4b')](db['CannedAnswer'][_0x7608('0x47')]);_0x381c0e[_0x7608('0x4a')]=_['keys'](_0x42e5cb[_0x7608('0x4a')]);_0x381c0e['filters']=_[_0x7608('0x4d')](_0x381c0e[_0x7608('0x49')],_0x381c0e['query']);_0x2bf24f['attributes']=_[_0x7608('0x4d')](_0x381c0e[_0x7608('0x49')],qs[_0x7608('0x4f')](_0x42e5cb[_0x7608('0x4a')][_0x7608('0x4f')]));_0x2bf24f[_0x7608('0x4e')]=_0x2bf24f[_0x7608('0x4e')][_0x7608('0x50')]?_0x2bf24f[_0x7608('0x4e')]:_0x381c0e[_0x7608('0x49')];if(!_0x42e5cb[_0x7608('0x4a')][_0x7608('0x51')]('nolimit')){_0x2bf24f['limit']=qs[_0x7608('0x1e')](_0x42e5cb[_0x7608('0x4a')][_0x7608('0x1e')]);_0x2bf24f[_0x7608('0x21')]=qs[_0x7608('0x21')](_0x42e5cb['query'][_0x7608('0x21')]);}_0x2bf24f[_0x7608('0x52')]=qs['sort'](_0x42e5cb[_0x7608('0x4a')]['sort']);_0x2bf24f[_0x7608('0x53')]=qs[_0x7608('0x4c')](_[_0x7608('0x54')](_0x42e5cb['query'],_0x381c0e['filters']));_0x2bf24f[_0x7608('0x53')][_0x7608('0x67')]=_0x3620ea['id'];if(_0x42e5cb['query'][_0x7608('0x57')]){_0x2bf24f[_0x7608('0x53')]=_['merge'](_0x2bf24f[_0x7608('0x53')],{'$or':_['map'](_0x2bf24f[_0x7608('0x4e')],function(_0x321208){var _0x5cc77f={};_0x5cc77f[_0x321208]={'$like':'%'+_0x42e5cb['query'][_0x7608('0x57')]+'%'};return _0x5cc77f;})});}_0x2bf24f=_[_0x7608('0x55')]({},_0x2bf24f,_0x42e5cb[_0x7608('0x58')]);return db['CannedAnswer'][_0x7608('0x20')]({'where':_0x2bf24f[_0x7608('0x53')]})['then'](function(_0x1a3348){_0x4d325d['count']=_0x1a3348;if(_0x42e5cb[_0x7608('0x4a')][_0x7608('0x59')]){_0x2bf24f[_0x7608('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7608('0x5b')](_0x2bf24f);})[_0x7608('0x11')](function(_0x5c8deb){_0x4d325d[_0x7608('0x5c')]=_0x5c8deb;return _0x4d325d;});}})[_0x7608('0x11')](respondWithFilteredResult(_0x6f53eb,_0x2bf24f))['catch'](handleError(_0x6f53eb,null));};exports[_0x7608('0x70')]=function(_0x2365f3,_0x42e0f8){return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x2365f3[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x42e0f8,null))['then'](function(_0x2f3c6c){if(_0x2f3c6c){return _0x2f3c6c[_0x7608('0x70')](_0x2365f3['query'][_0x7608('0x71')]);}})[_0x7608('0x11')](respondWithStatusCode(_0x42e0f8,null))[_0x7608('0x1a')](handleError(_0x42e0f8,null));};exports[_0x7608('0x6e')]=function(_0x2c245e,_0x937b51){var _0x455c23={'name':_0x2c245e[_0x7608('0x62')][_0x7608('0x2a')],'key':_0x2c245e['body'][_0x7608('0x72')],'provider':_0x2c245e[_0x7608('0x62')][_0x7608('0x63')]===_0x7608('0x73')?null:_0x2c245e[_0x7608('0x62')]['provider'],'email':_0x2c245e[_0x7608('0x62')][_0x7608('0x74')],'ListId':_0x2c245e[_0x7608('0x62')]['ListId'],'active':!_[_0x7608('0x75')](_0x2c245e[_0x7608('0x62')][_0x7608('0x76')])?_0x2c245e['body']['active']:!![],'description':_0x2c245e['body'][_0x7608('0x77')]||null};var _0x3adc8b=getAuthenticationOptions(_0x455c23[_0x7608('0x63')],_0x2c245e['body']);_0x455c23[_0x7608('0x40')]=_0x3adc8b[_0x7608('0x40')];_0x455c23[_0x7608('0x41')]=_0x3adc8b[_0x7608('0x41')];return db['MailAccount'][_0x7608('0x6e')](_0x455c23,{'include':[{'model':db[_0x7608('0x43')],'as':_0x7608('0x41')},{'model':db[_0x7608('0x5f')],'as':_0x7608('0x40')}]})[_0x7608('0x11')](function(_0x33638e){var _0x14f837=_0x2c245e[_0x7608('0x36')]['get']({'plain':!![]});if(!_0x14f837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14f837['role']===_0x7608('0x36')){var _0x3ff8bf=_0x33638e[_0x7608('0x25')]({'plain':!![]});return db[_0x7608('0x78')]['find']({'where':{'name':_0x7608('0x26'),'userProfileId':_0x14f837[_0x7608('0x79')]},'raw':!![]})[_0x7608('0x11')](function(_0x34f3c4){if(_0x34f3c4&&_0x34f3c4[_0x7608('0x7a')]===0x0){return db[_0x7608('0x27')]['create']({'name':_0x3ff8bf[_0x7608('0x2a')],'resourceId':_0x3ff8bf['id'],'type':_0x34f3c4[_0x7608('0x2a')],'sectionId':_0x34f3c4['id']},{})['then'](function(){return _0x33638e;});}else{return _0x33638e;}})['catch'](function(_0x2db740){logger[_0x7608('0x16')](_0x7608('0x7b'),_0x2db740);throw _0x2db740;});}return _0x33638e;})[_0x7608('0x11')](respondWithResult(_0x937b51,0xc9))[_0x7608('0x1a')](handleError(_0x937b51,null));};exports[_0x7608('0x7c')]=function(_0x56289c,_0xd9d481){return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x56289c[_0x7608('0x5e')]['id']}})['then'](handleEntityNotFound(_0xd9d481,null))[_0x7608('0x11')](function(_0x189c57){if(_0x189c57){return _0x189c57['getImap']();}return null;})[_0x7608('0x11')](respondWithResult(_0xd9d481,null))['catch'](handleError(_0xd9d481,null));};exports[_0x7608('0x7d')]=function(_0x2c778d,_0x35d1b7){if(_0x2c778d[_0x7608('0x62')]['id']){delete _0x2c778d[_0x7608('0x62')]['id'];}return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x2c778d[_0x7608('0x5e')]['id']}})['then'](handleEntityNotFound(_0x35d1b7,null))['then'](function(_0x34f4ae){if(_0x34f4ae){_0x2c778d[_0x7608('0x62')]['MailAccountId']=_0x34f4ae['id'];return db['MailServerIn'][_0x7608('0x6e')](_0x2c778d[_0x7608('0x62')]);}})[_0x7608('0x11')](respondWithResult(_0x35d1b7,null))[_0x7608('0x1a')](handleError(_0x35d1b7,null));};exports[_0x7608('0x7e')]=function(_0xbfa9b1,_0x3c87d4){return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0xbfa9b1[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x3c87d4,null))[_0x7608('0x11')](function(_0x53261a){if(_0x53261a){return _0x53261a[_0x7608('0x7f')](null);}return null;})[_0x7608('0x11')](respondWithStatusCode(_0x3c87d4,null))['catch'](handleError(_0x3c87d4,null));};exports[_0x7608('0x80')]=function(_0x21987e,_0x379c12){return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x21987e[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x379c12,null))[_0x7608('0x11')](function(_0x4a1294){if(_0x4a1294){return _0x4a1294[_0x7608('0x80')]();}return null;})['then'](respondWithResult(_0x379c12,null))['catch'](handleError(_0x379c12,null));};exports[_0x7608('0x81')]=function(_0x1005ce,_0x51da61){if(_0x1005ce[_0x7608('0x62')]['id']){delete _0x1005ce[_0x7608('0x62')]['id'];}return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x1005ce['params']['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x51da61,null))['then'](function(_0x5f35e3){if(_0x5f35e3){_0x1005ce[_0x7608('0x62')][_0x7608('0x67')]=_0x5f35e3['id'];return db[_0x7608('0x43')][_0x7608('0x6e')](_0x1005ce[_0x7608('0x62')]);}})[_0x7608('0x11')](respondWithResult(_0x51da61,null))['catch'](handleError(_0x51da61,null));};exports['removeSmtp']=function(_0x1c8e40,_0x22bf3f){return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x1c8e40[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x22bf3f,null))[_0x7608('0x11')](function(_0x559a3a){if(_0x559a3a){return _0x559a3a[_0x7608('0x82')](null);}return null;})[_0x7608('0x11')](respondWithStatusCode(_0x22bf3f,null))[_0x7608('0x1a')](handleError(_0x22bf3f,null));};exports['addInteraction']=function(_0x30a6e3,_0x335e64){return db[_0x7608('0x83')][_0x7608('0x61')]({'where':{'id':_0x30a6e3[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x335e64,null))[_0x7608('0x11')](function(_0x12c155){if(_0x12c155){return _0x12c155['addInteraction'](_0x30a6e3[_0x7608('0x62')]['ids'],_[_0x7608('0x84')](_0x30a6e3['body'],['ids','id'])||{});}})[_0x7608('0x11')](respondWithResult(_0x335e64,null))[_0x7608('0x1a')](handleError(_0x335e64,null));};exports[_0x7608('0x85')]=function(_0x28e096,_0x12bd4f){var _0x5b73c8={'raw':![],'where':{}};var _0x46fa90={};var _0x10ea1d={'count':0x0,'rows':[]};return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x28e096['params']['id']}})['then'](handleEntityNotFound(_0x12bd4f,null))[_0x7608('0x11')](function(_0x20128a){if(_0x20128a){_0x46fa90[_0x7608('0x49')]=_['keys'](db[_0x7608('0x83')][_0x7608('0x47')]);_0x46fa90[_0x7608('0x4a')]=_[_0x7608('0x4b')](_0x28e096[_0x7608('0x4a')]);_0x46fa90[_0x7608('0x4c')]=_['intersection'](_0x46fa90[_0x7608('0x49')],_0x46fa90[_0x7608('0x4a')]);_0x5b73c8['attributes']=_[_0x7608('0x4d')](_0x46fa90[_0x7608('0x49')],qs['fields'](_0x28e096[_0x7608('0x4a')][_0x7608('0x4f')]));_0x5b73c8[_0x7608('0x4e')]=_0x5b73c8['attributes'][_0x7608('0x50')]?_0x5b73c8['attributes']:_0x46fa90[_0x7608('0x49')];if(!_0x28e096[_0x7608('0x4a')][_0x7608('0x51')](_0x7608('0x6b'))){_0x5b73c8[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x28e096[_0x7608('0x4a')][_0x7608('0x1e')]);_0x5b73c8[_0x7608('0x21')]=qs['offset'](_0x28e096['query'][_0x7608('0x21')]);}_0x5b73c8[_0x7608('0x52')]=qs[_0x7608('0x6c')](_0x28e096[_0x7608('0x4a')][_0x7608('0x6c')]);_0x5b73c8[_0x7608('0x53')]=qs[_0x7608('0x4c')](_[_0x7608('0x54')](_0x28e096[_0x7608('0x4a')],_0x46fa90['filters']));_0x5b73c8['where'][_0x7608('0x67')]=_0x20128a['id'];if(_0x28e096[_0x7608('0x4a')][_0x7608('0x57')]){_0x5b73c8['where']=_[_0x7608('0x55')](_0x5b73c8[_0x7608('0x53')],{'$or':_[_0x7608('0x45')](_0x5b73c8[_0x7608('0x4e')],function(_0x137203){var _0x266869={};_0x266869[_0x137203]={'$like':'%'+_0x28e096['query'][_0x7608('0x57')]+'%'};return _0x266869;})});}_0x5b73c8=_[_0x7608('0x55')]({},_0x5b73c8,_0x28e096[_0x7608('0x58')]);return db['MailInteraction'][_0x7608('0x20')]({'where':_0x5b73c8[_0x7608('0x53')]})[_0x7608('0x11')](function(_0x2008f2){_0x10ea1d[_0x7608('0x20')]=_0x2008f2;if(_0x28e096[_0x7608('0x4a')][_0x7608('0x59')]){_0x5b73c8[_0x7608('0x5a')]=[{'model':db[_0x7608('0x86')],'as':_0x7608('0x87'),'required':![]},{'model':db[_0x7608('0x88')],'as':_0x7608('0x89'),'attributes':[_0x7608('0x2a'),_0x7608('0x8a'),_0x7608('0x8b')],'required':![]},{'model':db[_0x7608('0x8c')],'as':_0x7608('0x8d'),'attributes':['id',_0x7608('0x2a'),_0x7608('0x8e')],'where':_0x28e096[_0x7608('0x4a')][_0x7608('0x8f')]?{'id':_0x28e096[_0x7608('0x4a')][_0x7608('0x8f')]}:undefined,'required':_0x28e096['query']['tag']?!![]:![]}];}return db[_0x7608('0x83')][_0x7608('0x5b')](_0x5b73c8);})[_0x7608('0x11')](function(_0x97c6a2){_0x10ea1d[_0x7608('0x5c')]=_0x97c6a2;return _0x10ea1d;});}})['then'](respondWithFilteredResult(_0x12bd4f,_0x5b73c8))[_0x7608('0x1a')](handleError(_0x12bd4f,null));};exports[_0x7608('0x90')]=function addApplications(_0x7806b7,_0x3da184){var _0x523643=_0x7806b7[_0x7608('0x5e')]['id'];var _0x404ad1=_0x7806b7[_0x7608('0x62')];var _0x356005=0xc8;var _0x126907=null;return db[_0x7608('0x91')]['transaction']({'isolationLevel':db[_0x7608('0x91')][_0x7608('0x92')][_0x7608('0x93')]['READ_COMMITTED']},function(_0x34de49){return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x523643},'transaction':_0x34de49})[_0x7608('0x11')](function(_0x3b11e6){if(_0x3b11e6){return db[_0x7608('0x94')][_0x7608('0x24')]({'where':{'MailAccountId':_0x523643},'transaction':_0x34de49})['then'](function(){var _0x40403b=_['map'](_0x404ad1,function(_0x4fe35e){_0x4fe35e[_0x7608('0x67')]=_0x523643;return _0x4fe35e;});return db[_0x7608('0x94')]['bulkCreate'](_0x40403b,{'transaction':_0x34de49});});}else{_0x356005=0x194;_0x126907=[];}});})[_0x7608('0x11')](function(){if(_0x356005!==0x194){return db[_0x7608('0x94')][_0x7608('0x95')]({'where':{'MailAccountId':_0x523643},'order':_0x7608('0x96')})['then'](function(_0x32f098){_0x126907=_0x32f098;});}})[_0x7608('0x1a')](function(_0x1fdb9b){_0x356005=0x1f4;logger[_0x7608('0x16')](_0x1fdb9b[_0x7608('0x29')]);if(_0x1fdb9b['name']){delete _0x1fdb9b[_0x7608('0x2a')];}_0x126907=_0x1fdb9b;})['finally'](function(){if(_0x126907===null){_0x3da184[_0x7608('0x1b')](_0x356005);}else{if(_0x356005===0x1f4){_0x3da184[_0x7608('0x1c')](_0x356005)[_0x7608('0x2b')](_0x126907);}else{_0x3da184[_0x7608('0x1c')](_0x356005)['json'](_0x126907);}}});};exports[_0x7608('0x97')]=function(_0x406f20,_0x4b62a7){var _0x2111a3={};var _0x1e703a={};var _0x31e991;var _0x38afbf;return db[_0x7608('0x46')][_0x7608('0x6a')]({'where':{'id':_0x406f20[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x4b62a7,null))['then'](function(_0x1f31d7){if(_0x1f31d7){_0x31e991=_0x1f31d7;_0x1e703a[_0x7608('0x49')]=_[_0x7608('0x4b')](db[_0x7608('0x94')][_0x7608('0x47')]);_0x1e703a['query']=_[_0x7608('0x4b')](_0x406f20[_0x7608('0x4a')]);_0x1e703a['filters']=_[_0x7608('0x4d')](_0x1e703a[_0x7608('0x49')],_0x1e703a[_0x7608('0x4a')]);_0x2111a3[_0x7608('0x4e')]=_[_0x7608('0x4d')](_0x1e703a[_0x7608('0x49')],qs['fields'](_0x406f20[_0x7608('0x4a')][_0x7608('0x4f')]));_0x2111a3[_0x7608('0x4e')]=_0x2111a3[_0x7608('0x4e')]['length']?_0x2111a3[_0x7608('0x4e')]:_0x1e703a[_0x7608('0x49')];_0x2111a3[_0x7608('0x52')]=qs['sort'](_0x406f20[_0x7608('0x4a')][_0x7608('0x6c')]);_0x2111a3[_0x7608('0x53')]=qs['filters'](_['pick'](_0x406f20[_0x7608('0x4a')],_0x1e703a[_0x7608('0x4c')]));if(_0x406f20['query'][_0x7608('0x57')]){_0x2111a3[_0x7608('0x53')]=_['merge'](_0x2111a3['where'],{'$or':_[_0x7608('0x45')](_0x2111a3[_0x7608('0x4e')],function(_0x2d5f80){var _0x135e9d={};_0x135e9d[_0x2d5f80]={'$like':'%'+_0x406f20[_0x7608('0x4a')]['filter']+'%'};return _0x135e9d;})});}_0x2111a3=_[_0x7608('0x55')]({},_0x2111a3,_0x406f20[_0x7608('0x58')]);return _0x31e991[_0x7608('0x97')](_0x2111a3);}})[_0x7608('0x11')](function(_0xda327a){if(_0xda327a){_0x38afbf=_0xda327a[_0x7608('0x50')];if(!_0x406f20[_0x7608('0x4a')]['hasOwnProperty'](_0x7608('0x6b'))){_0x2111a3[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x406f20['query'][_0x7608('0x1e')]);_0x2111a3[_0x7608('0x21')]=qs[_0x7608('0x21')](_0x406f20[_0x7608('0x4a')][_0x7608('0x21')]);}return _0x31e991['getApplications'](_0x2111a3);}})[_0x7608('0x11')](function(_0x3f57b1){if(_0x3f57b1){return _0x3f57b1?{'count':_0x38afbf,'rows':_0x3f57b1}:null;}})['then'](respondWithResult(_0x4b62a7,null))[_0x7608('0x1a')](handleError(_0x4b62a7,null));};exports[_0x7608('0x98')]=function(_0x129f94,_0x16cca2){var _0x19be62={'raw':!![],'where':{}};var _0xd31e9d={};var _0x58e068={'count':0x0,'rows':[]};return db['MailAccount'][_0x7608('0x6a')]({'where':{'id':_0x129f94[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x16cca2,null))['then'](function(_0x352f48){if(_0x352f48){_0xd31e9d[_0x7608('0x49')]=_['keys'](db[_0x7608('0x99')]['rawAttributes']);_0xd31e9d[_0x7608('0x4a')]=_['keys'](_0x129f94[_0x7608('0x4a')]);_0xd31e9d['filters']=_[_0x7608('0x4d')](_0xd31e9d['model'],_0xd31e9d['query']);_0x19be62[_0x7608('0x4e')]=_[_0x7608('0x4d')](_0xd31e9d[_0x7608('0x49')],qs[_0x7608('0x4f')](_0x129f94[_0x7608('0x4a')]['fields']));_0x19be62[_0x7608('0x4e')]=_0x19be62[_0x7608('0x4e')][_0x7608('0x50')]?_0x19be62['attributes']:_0xd31e9d[_0x7608('0x49')];if(!_0x129f94['query'][_0x7608('0x51')](_0x7608('0x6b'))){_0x19be62[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x129f94['query']['limit']);_0x19be62[_0x7608('0x21')]=qs[_0x7608('0x21')](_0x129f94[_0x7608('0x4a')][_0x7608('0x21')]);}_0x19be62['order']=qs[_0x7608('0x6c')](_0x129f94[_0x7608('0x4a')][_0x7608('0x6c')]);_0x19be62[_0x7608('0x53')]=qs['filters'](_[_0x7608('0x54')](_0x129f94[_0x7608('0x4a')],_0xd31e9d[_0x7608('0x4c')]));_0x19be62[_0x7608('0x53')][_0x7608('0x67')]=_0x352f48['id'];if(_0x129f94[_0x7608('0x4a')]['filter']){_0x19be62[_0x7608('0x53')]=_[_0x7608('0x55')](_0x19be62[_0x7608('0x53')],{'$or':_[_0x7608('0x45')](_0x19be62[_0x7608('0x4e')],function(_0x367a2c){var _0x2f761e={};_0x2f761e[_0x367a2c]={'$like':'%'+_0x129f94[_0x7608('0x4a')][_0x7608('0x57')]+'%'};return _0x2f761e;})});}if(_0x129f94[_0x7608('0x4a')][_0x7608('0x9a')]){var _0x1c8c0e=_0x129f94[_0x7608('0x4a')]['$gte'][_0x7608('0x9b')](',');var _0x386dd5={};_0x386dd5[_0x1c8c0e[0x0]]={'$gte':moment(_0x1c8c0e[0x1])[_0x7608('0x9c')](_0x7608('0x9d'))};_0x19be62[_0x7608('0x53')]=_[_0x7608('0x55')](_0x19be62['where'],_0x386dd5);}_0x19be62=_[_0x7608('0x55')]({},_0x19be62,_0x129f94[_0x7608('0x58')]);return db[_0x7608('0x99')]['count']({'where':_0x19be62[_0x7608('0x53')]})[_0x7608('0x11')](function(_0xfcfbe2){_0x58e068[_0x7608('0x20')]=_0xfcfbe2;if(_0x129f94[_0x7608('0x4a')][_0x7608('0x59')]){_0x19be62[_0x7608('0x5a')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x19be62);})['then'](function(_0x21906e){if(_0x129f94[_0x7608('0x4a')][_0x7608('0x9e')]===_0x7608('0x9f')){for(var _0x29e201=0x0;_0x29e201<_0x21906e['length'];_0x29e201++){_0x21906e[_0x29e201]['body']=juice(_0x21906e[_0x29e201]['body']);}}_0x58e068['rows']=_0x21906e;return _0x58e068;});}})[_0x7608('0x11')](respondWithFilteredResult(_0x16cca2,_0x19be62))[_0x7608('0x1a')](handleError(_0x16cca2,null));};exports[_0x7608('0x2b')]=function(_0x33266f,_0x29e296){var _0x46c8fa,_0xe4df85={},_0x271660;if(_0x33266f[_0x7608('0x62')]['to']){_0x271660=_0x33266f[_0x7608('0x62')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x7608('0x61')]({'where':{'id':_0x33266f[_0x7608('0x5e')]['id']},'include':[{'model':db[_0x7608('0xa0')],'as':_0x7608('0xa1'),'include':[{'model':db[_0x7608('0x86')],'as':_0x7608('0xa2'),'where':{'email':_0x271660},'limit':0x1,'order':[['updatedAt',_0x7608('0xa3')]]}]},{'model':db[_0x7608('0x43')],'as':_0x7608('0x41'),'raw':!![],'include':[{'model':db[_0x7608('0xa4')],'as':_0x7608('0xa4'),'raw':!![]}]}]})[_0x7608('0x11')](handleEntityNotFound(_0x29e296,null))[_0x7608('0x11')](function(_0x3d4eae){if(!_0x3d4eae)return;_0x46c8fa=_0x3d4eae;if(!_0x3d4eae['Smtp'])throw new Error(_0x7608('0xa5'));if(_[_0x7608('0x75')](_0x33266f[_0x7608('0x62')]['from'])){_0x33266f[_0x7608('0x62')][_0x7608('0xa6')]=util[_0x7608('0x9c')](_0x7608('0xa7'),_0x3d4eae[_0x7608('0x2a')],_0x3d4eae[_0x7608('0x74')]||_0x3d4eae[_0x7608('0x41')]['user']);}if(_0x33266f['body'][_0x7608('0xa8')]&&_0x33266f['body'][_0x7608('0xa8')][_0x7608('0x50')]){for(var _0x4c447d=0x0;_0x4c447d<_0x33266f['body'][_0x7608('0xa8')]['length'];_0x4c447d+=0x1){_0x33266f[_0x7608('0x62')]['attachments'][_0x4c447d]={'filename':_0x33266f[_0x7608('0x62')][_0x7608('0xa8')][_0x4c447d][_0x7608('0x2a')],'path':path[_0x7608('0xa9')](config[_0x7608('0xaa')],_0x7608('0xab'),_0x33266f[_0x7608('0x62')][_0x7608('0xa8')][_0x4c447d][_0x7608('0xac')])};}}var _0x448a9d=_0x3d4eae[_0x7608('0xad')]();return respondWithRpcPromise(_0x7608('0xae'),'sendMail',{'account':_0x448a9d,'message':_0x33266f['body']});})[_0x7608('0x11')](function(_0x42de04){if(!_0x42de04)return;_0xe4df85=_0x42de04;if(!_0x46c8fa[_0x7608('0xa1')])throw new Error(_0x7608('0xaf'));if(_0x46c8fa[_0x7608('0xa1')][_0x7608('0xa2')][_0x7608('0x50')])return _0x46c8fa[_0x7608('0xa1')][_0x7608('0xa2')][0x0];return db[_0x7608('0x86')][_0x7608('0x6e')](_[_0x7608('0xb0')](_0x33266f[_0x7608('0x62')],{'firstName':_0x33266f[_0x7608('0x62')]['to'],'email':_0x33266f['body']['to'],'phone':_0x33266f['body']['to'],'ListId':_0x46c8fa[_0x7608('0xb1')]}));})[_0x7608('0x11')](function(_0x470710){if(!_0x470710)return;var _0xa6a2b3={'UserId':_0x33266f[_0x7608('0x36')]['id'],'ContactId':_0x470710['id'],'MailAccountId':_0x46c8fa['id'],'inReplyTo':_0xe4df85[_0x7608('0xb2')],'to':_0x33266f['body'][_0x7608('0xa6')],'cc':_0x33266f[_0x7608('0x62')]['cc'],'subject':_0x33266f['body']['subject'],'attach':_0x33266f[_0x7608('0x62')][_0x7608('0xb3')],'firstMsgDirection':_0x7608('0xb4'),'lastMsgAt':moment()[_0x7608('0x9c')](_0x7608('0x9d')),'lastMsgDirection':_0x7608('0xb4'),'Messages':[_[_0x7608('0x55')](_0x33266f[_0x7608('0x62')],{'messageId':_0xe4df85[_0x7608('0xb2')],'sentAt':moment()[_0x7608('0x9c')](_0x7608('0x9d')),'read':!![],'MailAccountId':_0x46c8fa['id'],'UserId':_0x33266f[_0x7608('0x36')]['id'],'ContactId':_0x470710['id']})]};if(_0x33266f[_0x7608('0x62')]['Interaction']){_0xa6a2b3=_[_0x7608('0x55')](_0xa6a2b3,_0x33266f[_0x7608('0x62')][_0x7608('0xb5')]);}return db[_0x7608('0x83')][_0x7608('0x6e')](_0xa6a2b3,{'include':[{'model':db[_0x7608('0x99')],'as':_0x7608('0xb6')}]});})[_0x7608('0x11')](respondWithResult(_0x29e296,null))[_0x7608('0x1a')](handleError(_0x29e296,null));};exports[_0x7608('0xb7')]=function(_0x245789,_0x25cd59){return db['MailAccount']['find']({'where':{'id':_0x245789[_0x7608('0x5e')]['id']},'include':[{'model':db[_0x7608('0x43')],'as':_0x7608('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x25cd59,null))[_0x7608('0x11')](function(_0x2f1319){if(!_0x2f1319['Smtp'])return;var _0x423b9e=_0x2f1319['getSmtpOptions']();return respondWithRpcPromise(_0x7608('0xb8'),_0x7608('0xb7'),{'account':_0x423b9e});})[_0x7608('0x11')](respondWithResult(_0x25cd59,null))[_0x7608('0x1a')](handleError(_0x25cd59,null));};exports[_0x7608('0x24')]=function(_0x2bf13f,_0x29f9a1){return db[_0x7608('0x46')]['find']({'where':{'id':_0x2bf13f['params']['id']}})['then'](handleEntityNotFound(_0x29f9a1,null))['then'](function(_0xf36aed){if(_0xf36aed&&_0xf36aed[_0x7608('0x3f')]){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0xf36aed;})[_0x7608('0x11')](removeEntity(_0x29f9a1,null))['catch'](handleError(_0x29f9a1,null));};exports[_0x7608('0xb9')]=function(_0x2d2c94,_0xe82d09){return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x2d2c94[_0x7608('0x5e')]['id']}})[_0x7608('0x11')](handleEntityNotFound(_0xe82d09,null))[_0x7608('0x11')](function(_0x4c8b36){if(_0x4c8b36){return _0x4c8b36[_0x7608('0xb9')](_0x2d2c94[_0x7608('0x62')][_0x7608('0x71')],_[_0x7608('0x84')](_0x2d2c94[_0x7608('0x62')],['ids','id'])||{})['spread'](function(_0x56fbd7){for(var _0xd30b39=0x0;_0xd30b39<_0x2d2c94[_0x7608('0x62')][_0x7608('0x71')][_0x7608('0x50')];_0xd30b39+=0x1){socket[_0x7608('0xba')]('userMailAccount:save',{'UserId':Number(_0x2d2c94['body'][_0x7608('0x71')][_0xd30b39]),'MailAccountId':Number(_0x2d2c94[_0x7608('0x5e')]['id'])});}return _0x56fbd7;});}})[_0x7608('0x11')](respondWithResult(_0xe82d09,null))[_0x7608('0x1a')](handleError(_0xe82d09,null));};exports['removeAgents']=function(_0x155f93,_0xe1a742){return db[_0x7608('0x46')][_0x7608('0x61')]({'where':{'id':_0x155f93['params']['id']}})[_0x7608('0x11')](handleEntityNotFound(_0xe1a742,null))[_0x7608('0x11')](function(_0xa841a){if(_0xa841a){return _0xa841a[_0x7608('0xbb')](_0x155f93[_0x7608('0x4a')][_0x7608('0x71')])[_0x7608('0x11')](function(){if(_[_0x7608('0xbc')](_0x155f93['query'][_0x7608('0x71')])){for(var _0x10851f=0x0;_0x10851f<_0x155f93[_0x7608('0x4a')][_0x7608('0x71')][_0x7608('0x50')];_0x10851f+=0x1){socket['emit'](_0x7608('0xbd'),{'UserId':Number(_0x155f93[_0x7608('0x4a')]['ids'][_0x10851f]),'MailAccountId':Number(_0x155f93[_0x7608('0x5e')]['id'])});}}else{socket[_0x7608('0xba')](_0x7608('0xbd'),{'UserId':Number(_0x155f93['query']['ids']),'MailAccountId':Number(_0x155f93[_0x7608('0x5e')]['id'])});}});}})[_0x7608('0x11')](respondWithStatusCode(_0xe1a742,null))[_0x7608('0x1a')](handleError(_0xe1a742,null));};exports[_0x7608('0xbe')]=function(_0x1d8303,_0x596986){var _0x28ad5c={};var _0x303e4e={};var _0xac3a0e;var _0x2b3339;return db['MailAccount'][_0x7608('0x6a')]({'where':{'id':_0x1d8303['params']['id']}})[_0x7608('0x11')](handleEntityNotFound(_0x596986,null))[_0x7608('0x11')](function(_0x4bd351){if(_0x4bd351){_0xac3a0e=_0x4bd351;_0x303e4e['model']=_[_0x7608('0x4b')](db[_0x7608('0x88')][_0x7608('0x47')]);_0x303e4e[_0x7608('0x4a')]=_[_0x7608('0x4b')](_0x1d8303[_0x7608('0x4a')]);_0x303e4e[_0x7608('0x4c')]=_[_0x7608('0x4d')](_0x303e4e[_0x7608('0x49')],_0x303e4e[_0x7608('0x4a')]);_0x28ad5c[_0x7608('0x4e')]=_['intersection'](_0x303e4e['model'],qs[_0x7608('0x4f')](_0x1d8303['query'][_0x7608('0x4f')]));_0x28ad5c[_0x7608('0x4e')]=_0x28ad5c[_0x7608('0x4e')][_0x7608('0x50')]?_0x28ad5c[_0x7608('0x4e')]:_0x303e4e[_0x7608('0x49')];_0x28ad5c['order']=qs[_0x7608('0x6c')](_0x1d8303[_0x7608('0x4a')]['sort']);_0x28ad5c[_0x7608('0x53')]=qs[_0x7608('0x4c')](_[_0x7608('0x54')](_0x1d8303[_0x7608('0x4a')],_0x303e4e['filters']));if(_0x1d8303[_0x7608('0x4a')][_0x7608('0x57')]){_0x28ad5c[_0x7608('0x53')]=_[_0x7608('0x55')](_0x28ad5c['where'],{'$or':_[_0x7608('0x45')](_0x28ad5c[_0x7608('0x4e')],function(_0x7320c4){var _0x273da3={};_0x273da3[_0x7320c4]={'$like':'%'+_0x1d8303[_0x7608('0x4a')]['filter']+'%'};return _0x273da3;})});}_0x28ad5c=_[_0x7608('0x55')]({},_0x28ad5c,_0x1d8303[_0x7608('0x58')]);return _0xac3a0e[_0x7608('0xbe')](_0x28ad5c);}})[_0x7608('0x11')](function(_0x4c5cff){if(_0x4c5cff){_0x2b3339=_0x4c5cff[_0x7608('0x50')];if(!_0x1d8303[_0x7608('0x4a')][_0x7608('0x51')](_0x7608('0x6b'))){_0x28ad5c[_0x7608('0x1e')]=qs[_0x7608('0x1e')](_0x1d8303[_0x7608('0x4a')][_0x7608('0x1e')]);_0x28ad5c['offset']=qs[_0x7608('0x21')](_0x1d8303[_0x7608('0x4a')][_0x7608('0x21')]);}return _0xac3a0e[_0x7608('0xbe')](_0x28ad5c);}})[_0x7608('0x11')](function(_0x46e853){if(_0x46e853){return _0x46e853?{'count':_0x2b3339,'rows':_0x46e853}:null;}})['then'](respondWithResult(_0x596986,null))[_0x7608('0x1a')](handleError(_0x596986,null));}; \ No newline at end of file +var _0x80e9=['findAndCountAll','priority','finally','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','CmList','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','basename','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','out','Interaction','verifySmtp','getSmtpOptions','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','type','key','map','query','keys','filters','model','fields','attributes','sort','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','findAll','show','params','intersection','length','include','find','body','custom','Mail\x20Account\x20not\x20found','describe','Disposition','create','findOne','hasOwnProperty','order','pick','rows','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','nolimit','removeAnswers','provider','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate'];(function(_0x4f9341,_0x27ed04){var _0x18abb6=function(_0x923d1e){while(--_0x923d1e){_0x4f9341['push'](_0x4f9341['shift']());}};_0x18abb6(++_0x27ed04);}(_0x80e9,0x1b8));var _0x980e=function(_0x22f4ac,_0x321b20){_0x22f4ac=_0x22f4ac-0x0;var _0x456c1b=_0x80e9[_0x22f4ac];return _0x456c1b;};'use strict';var moment=require('moment');var BPromise=require(_0x980e('0x0'));var util=require(_0x980e('0x1'));var path=require(_0x980e('0x2'));var _=require(_0x980e('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x980e('0x4'));var logger=require(_0x980e('0x5'))('api');var config=require('../../config/environment');var db=require(_0x980e('0x6'))['db'];config[_0x980e('0x7')]=_[_0x980e('0x8')](config['redis'],{'host':_0x980e('0x9'),'port':0x18eb});var socket=require(_0x980e('0xa'))(new Redis(config[_0x980e('0x7')]));require(_0x980e('0xb'))['register'](socket);var jayson=require(_0x980e('0xc'));var client=jayson[_0x980e('0xd')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4896e2,_0x59641f,_0x1c859f,_0x4ed424){return new BPromise(function(_0x2e893a,_0x3c0d3d){var _0x3ca1ae=_0x4ed424||client;return _0x3ca1ae['request'](_0x4896e2,_0x1c859f)[_0x980e('0xe')](function(_0xa1817d){logger[_0x980e('0xf')](_0x980e('0x10'),_0x59641f,_0x980e('0x11'));logger[_0x980e('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x59641f,_0x980e('0x11'),JSON[_0x980e('0x13')](_0xa1817d));if(_0xa1817d[_0x980e('0x14')]){if(_0xa1817d[_0x980e('0x14')][_0x980e('0x15')]===0x1f4){logger[_0x980e('0x14')]('MailAccount,\x20%s,\x20%s',_0x59641f,_0xa1817d[_0x980e('0x14')]['message']);return _0x3c0d3d(_0xa1817d[_0x980e('0x14')][_0x980e('0x16')]);}logger[_0x980e('0x14')](_0x980e('0x10'),_0x59641f,_0xa1817d[_0x980e('0x14')][_0x980e('0x16')]);return _0x2e893a(_0xa1817d[_0x980e('0x14')][_0x980e('0x16')]);}else{logger[_0x980e('0xf')](_0x980e('0x10'),_0x59641f,_0x980e('0x11'));_0x2e893a(_0xa1817d['result'][_0x980e('0x16')]);}})[_0x980e('0x17')](function(_0xa3516b){logger[_0x980e('0x14')](_0x980e('0x10'),_0x59641f,_0xa3516b);_0x3c0d3d(_0xa3516b);});});}function respondWithStatusCode(_0x56e4cd,_0x4a193f){_0x4a193f=_0x4a193f||0xcc;return function(_0x59c501){if(_0x59c501){return _0x56e4cd[_0x980e('0x18')](_0x4a193f);}return _0x56e4cd[_0x980e('0x19')](_0x4a193f)[_0x980e('0x1a')]();};}function respondWithResult(_0x4bb1e6,_0x2bb709){_0x2bb709=_0x2bb709||0xc8;return function(_0x200bd9){if(_0x200bd9){return _0x4bb1e6['status'](_0x2bb709)[_0x980e('0x1b')](_0x200bd9);}};}function respondWithFilteredResult(_0x25941a,_0x5c0b91){return function(_0x5ed026){if(_0x5ed026){var _0x94de1e=typeof _0x5c0b91[_0x980e('0x1c')]===_0x980e('0x1d')&&typeof _0x5c0b91[_0x980e('0x1e')]===_0x980e('0x1d');var _0x575acf=_0x5ed026[_0x980e('0x1f')];var _0x537b89=_0x94de1e?0x0:_0x5c0b91[_0x980e('0x1c')];var _0x39e3d7=_0x94de1e?_0x5ed026[_0x980e('0x1f')]:_0x5c0b91[_0x980e('0x1c')]+_0x5c0b91[_0x980e('0x1e')];var _0x2fada2;if(_0x39e3d7>=_0x575acf){_0x39e3d7=_0x575acf;_0x2fada2=0xc8;}else{_0x2fada2=0xce;}_0x25941a[_0x980e('0x19')](_0x2fada2);return _0x25941a[_0x980e('0x20')](_0x980e('0x21'),_0x537b89+'-'+_0x39e3d7+'/'+_0x575acf)[_0x980e('0x1b')](_0x5ed026);}return null;};}function saveUpdates(_0x4629c4){return function(_0xb671c6){if(_0xb671c6){return _0xb671c6[_0x980e('0x22')](_0x4629c4)['then'](function(_0x5342b3){return _0x5342b3;});}return null;};}function removeEntity(_0x57747d){return function(_0x37d3e9){if(_0x37d3e9){return _0x37d3e9[_0x980e('0x23')]()[_0x980e('0xe')](function(){var _0x47a6e1=_0x37d3e9[_0x980e('0x24')]({'plain':!![]});var _0x431011=_0x980e('0x25');return db[_0x980e('0x26')]['destroy']({'where':{'type':_0x431011,'resourceId':_0x47a6e1['id']}})[_0x980e('0xe')](function(){return _0x37d3e9;});})['then'](function(){_0x57747d[_0x980e('0x19')](0xcc)[_0x980e('0x1a')]();});}};}function handleEntityNotFound(_0x54fce1){return function(_0xa6a7c8){if(!_0xa6a7c8){_0x54fce1['sendStatus'](0x194);}return _0xa6a7c8;};}function handleError(_0x29b8d6,_0x8fe29b){_0x8fe29b=_0x8fe29b||0x1f4;return function(_0x581bb6){logger['error'](_0x581bb6[_0x980e('0x27')]);if(_0x581bb6[_0x980e('0x28')]){delete _0x581bb6[_0x980e('0x28')];}_0x29b8d6[_0x980e('0x19')](_0x8fe29b)[_0x980e('0x29')](_0x581bb6);};}function getImapHost(_0x3cf0ba){switch(_0x3cf0ba){case _0x980e('0x2a'):return'imap.gmail.com';case _0x980e('0x2b'):return _0x980e('0x2c');case'hotmail':return _0x980e('0x2d');case _0x980e('0x2e'):return _0x980e('0x2f');}throw new Error(_0x980e('0x30'),_0x3cf0ba);}function getSmtpHost(_0x59fefb){switch(_0x59fefb){case _0x980e('0x2a'):return _0x980e('0x31');case _0x980e('0x2b'):return _0x980e('0x32');case _0x980e('0x33'):return _0x980e('0x34');case _0x980e('0x2e'):return _0x980e('0x35');}throw new Error(_0x980e('0x30'),_0x59fefb);}function getAuthenticationOptions(_0x535bc1,_0xa6ee4f){var _0x2780f1={};var _0x291d7a={};if(_0x535bc1){_0x2780f1['user']=_0x291d7a[_0x980e('0x36')]=_0xa6ee4f[_0x980e('0x37')];_0x2780f1[_0x980e('0x38')]=_0x291d7a[_0x980e('0x39')]=_0xa6ee4f['password'];if(_0xa6ee4f[_0x980e('0x3a')]){_0x2780f1['modernAuthentication']=_0x291d7a['modernAuthentication']=!![];_0x2780f1['CloudProviderId']=_0x291d7a[_0x980e('0x3b')]=_0xa6ee4f[_0x980e('0x3b')];_0x2780f1['password']=_0x291d7a[_0x980e('0x39')]=null;}else{_0x2780f1['CloudProviderId']=_0x291d7a[_0x980e('0x3b')]=null;}_0x2780f1[_0x980e('0x3c')]=getImapHost(_0x535bc1);_0x2780f1['port']=0x3e1;_0x291d7a[_0x980e('0x3c')]=getSmtpHost(_0x535bc1);_0x291d7a[_0x980e('0x3d')]=0x24b;_0x291d7a[_0x980e('0x3e')]=![];_0x2780f1[_0x980e('0x3f')]=_0x291d7a[_0x980e('0x3f')]=null;}else{if(_0xa6ee4f[_0x980e('0x40')]){_0x2780f1[_0x980e('0x36')]=_0x291d7a['user']=_0xa6ee4f[_0x980e('0x37')];_0x2780f1[_0x980e('0x38')]=_0x291d7a['pass']=_0xa6ee4f[_0x980e('0x38')];}else{_0x2780f1[_0x980e('0x40')]=_0x291d7a[_0x980e('0x40')]=![];_0x2780f1[_0x980e('0x36')]=_0x291d7a[_0x980e('0x36')]=null;_0x2780f1['password']=_0x291d7a[_0x980e('0x39')]=null;}_0x2780f1[_0x980e('0x3c')]=_0xa6ee4f[_0x980e('0x41')][_0x980e('0x3c')];_0x2780f1['port']=_0xa6ee4f[_0x980e('0x41')][_0x980e('0x3d')];_0x291d7a['host']=_0xa6ee4f['Smtp'][_0x980e('0x3c')];_0x291d7a[_0x980e('0x3d')]=_0xa6ee4f[_0x980e('0x42')]['port'];}return{'Imap':_0x2780f1,'Smtp':_0x291d7a};}exports[_0x980e('0x43')]=function(_0x364a65,_0x5f5d3b){var _0x164527={'include':[{'model':db[_0x980e('0x44')],'as':'Imap'},{'model':db[_0x980e('0x45')],'as':'Smtp'},{'model':db[_0x980e('0x46')],'as':_0x980e('0x47')}]},_0x1798e7={},_0x5038ed={'count':0x0,'rows':[]};var _0x3376e2=_['map'](db['MailAccount'][_0x980e('0x48')],function(_0x405ecd){return{'name':_0x405ecd['fieldName'],'type':_0x405ecd[_0x980e('0x49')][_0x980e('0x4a')]};});_0x1798e7['model']=_[_0x980e('0x4b')](_0x3376e2,_0x980e('0x28'));_0x1798e7[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0x364a65[_0x980e('0x4c')]);_0x1798e7[_0x980e('0x4e')]=_['intersection'](_0x1798e7['model'],_0x1798e7['query']);_0x164527['attributes']=_['intersection'](_0x1798e7[_0x980e('0x4f')],qs['fields'](_0x364a65['query'][_0x980e('0x50')]));_0x164527[_0x980e('0x51')]=_0x164527['attributes']['length']?_0x164527[_0x980e('0x51')]:_0x1798e7[_0x980e('0x4f')];if(!_0x364a65['query']['hasOwnProperty']('nolimit')){_0x164527[_0x980e('0x1e')]=qs[_0x980e('0x1e')](_0x364a65['query']['limit']);_0x164527[_0x980e('0x1c')]=qs[_0x980e('0x1c')](_0x364a65['query'][_0x980e('0x1c')]);}_0x164527['order']=qs[_0x980e('0x52')](_0x364a65[_0x980e('0x4c')]['sort']);_0x164527['where']=qs[_0x980e('0x4e')](_['pick'](_0x364a65[_0x980e('0x4c')],_0x1798e7['filters']),_0x3376e2);if(_0x364a65[_0x980e('0x4c')][_0x980e('0x53')]){_0x164527[_0x980e('0x54')]=_[_0x980e('0x55')](_0x164527[_0x980e('0x54')],{'$or':_[_0x980e('0x4b')](_0x3376e2,function(_0x4ff815){if(_0x4ff815[_0x980e('0x49')]!==_0x980e('0x56')){var _0x28a351={};_0x28a351[_0x4ff815['name']]={'$like':'%'+_0x364a65[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0x28a351;}})});}_0x164527=_[_0x980e('0x55')]({},_0x164527,_0x364a65[_0x980e('0x57')]);var _0x26ca88={'where':_0x164527[_0x980e('0x54')]};return db[_0x980e('0x58')][_0x980e('0x1f')](_0x26ca88)[_0x980e('0xe')](function(_0x8506ce){_0x5038ed[_0x980e('0x1f')]=_0x8506ce;if(_0x364a65[_0x980e('0x4c')][_0x980e('0x59')]){_0x164527['include']=[{'all':!![]}];}return db[_0x980e('0x58')][_0x980e('0x5a')](_0x164527);})['then'](function(_0x242ec8){_0x5038ed['rows']=_0x242ec8;return _0x5038ed;})[_0x980e('0xe')](respondWithFilteredResult(_0x5f5d3b,_0x164527))[_0x980e('0x17')](handleError(_0x5f5d3b,null));};exports[_0x980e('0x5b')]=function(_0xf40560,_0x713270){var _0x3e4797={'raw':![],'where':{'id':_0xf40560[_0x980e('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x980e('0x47')}]},_0xaa7839={};_0xaa7839['model']=_[_0x980e('0x4d')](db[_0x980e('0x58')][_0x980e('0x48')]);_0xaa7839[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0xf40560['query']);_0xaa7839['filters']=_[_0x980e('0x5d')](_0xaa7839['model'],_0xaa7839[_0x980e('0x4c')]);_0x3e4797['attributes']=_['intersection'](_0xaa7839[_0x980e('0x4f')],qs['fields'](_0xf40560[_0x980e('0x4c')][_0x980e('0x50')]));_0x3e4797[_0x980e('0x51')]=_0x3e4797[_0x980e('0x51')][_0x980e('0x5e')]?_0x3e4797[_0x980e('0x51')]:_0xaa7839[_0x980e('0x4f')];if(_0xf40560[_0x980e('0x4c')]['includeAll']){_0x3e4797[_0x980e('0x5f')]=[{'all':!![]}];}_0x3e4797=_[_0x980e('0x55')]({},_0x3e4797,_0xf40560[_0x980e('0x57')]);return db[_0x980e('0x58')][_0x980e('0x60')](_0x3e4797)[_0x980e('0xe')](handleEntityNotFound(_0x713270,null))[_0x980e('0xe')](respondWithResult(_0x713270,null))[_0x980e('0x17')](handleError(_0x713270,null));};exports['update']=function(_0x3c848a,_0x1eda98){if(_0x3c848a[_0x980e('0x61')]['id']){delete _0x3c848a['body']['id'];}var _0x234301=_0x3c848a[_0x980e('0x61')]['provider']===_0x980e('0x62')?null:_0x3c848a[_0x980e('0x61')]['provider'];var _0x2e8c8c=_0x3c848a[_0x980e('0x61')][_0x980e('0x41')]||{};var _0x3fcea9=_0x3c848a['body'][_0x980e('0x42')]||{};if(_0x234301){_0x2e8c8c[_0x980e('0x3c')]=getImapHost(_0x234301);_0x2e8c8c[_0x980e('0x3d')]=0x3e1;_0x3fcea9[_0x980e('0x3c')]=getSmtpHost(_0x234301);_0x3fcea9[_0x980e('0x3d')]=0x24b;_0x3fcea9[_0x980e('0x3e')]=![];}if(_0x3fcea9[_0x980e('0x3a')]){_0x3fcea9[_0x980e('0x3e')]=![];}else{_0x3fcea9['CloudProviderId']=null;}if(!_0x2e8c8c[_0x980e('0x3a')])_0x2e8c8c[_0x980e('0x3b')]=null;_0x3c848a[_0x980e('0x61')]['Imap']=_0x2e8c8c;_0x3c848a[_0x980e('0x61')][_0x980e('0x42')]=_0x3fcea9;return db['MailAccount'][_0x980e('0x60')]({'where':{'id':_0x3c848a[_0x980e('0x5c')]['id']},'include':[{'model':db[_0x980e('0x44')],'as':_0x980e('0x41')},{'model':db[_0x980e('0x45')],'as':_0x980e('0x42')},{'model':db['Pause'],'as':_0x980e('0x47')}]})[_0x980e('0xe')](handleEntityNotFound(_0x1eda98,null))[_0x980e('0xe')](function(_0x449329){if(!_0x449329)throw new Error(_0x980e('0x63'));if(_0x449329[_0x980e('0x3f')])delete _0x3c848a['body'][_0x980e('0x41')];return _0x449329;})['then'](saveUpdates(_0x3c848a[_0x980e('0x61')],null))[_0x980e('0xe')](function(_0x1af1fe){if(!_0x3c848a['body']['Imap'])return _0x1af1fe;return db['MailServerIn'][_0x980e('0x22')](_0x3c848a['body'][_0x980e('0x41')],{'where':{'MailAccountId':_0x1af1fe['id']}})[_0x980e('0xe')](function(){return _0x1af1fe;});})[_0x980e('0xe')](function(_0x4867f7){if(!_0x3c848a[_0x980e('0x61')][_0x980e('0x42')])return _0x4867f7;return db[_0x980e('0x45')][_0x980e('0x22')](_0x3c848a[_0x980e('0x61')][_0x980e('0x42')],{'where':{'MailAccountId':_0x4867f7['id']}})['then'](function(){return _0x4867f7;});})[_0x980e('0xe')](respondWithResult(_0x1eda98,null))['catch'](handleError(_0x1eda98,null));};exports[_0x980e('0x64')]=function(_0x2318fd,_0x83353b){return db[_0x980e('0x58')][_0x980e('0x64')]()[_0x980e('0xe')](respondWithResult(_0x83353b,null))[_0x980e('0x17')](handleError(_0x83353b,null));};exports['addDisposition']=function(_0x47fa71,_0x46a194){if(_0x47fa71[_0x980e('0x61')]['id']){delete _0x47fa71[_0x980e('0x61')]['id'];}return db['MailAccount'][_0x980e('0x60')]({'where':{'id':_0x47fa71['params']['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x46a194,null))[_0x980e('0xe')](function(_0xf7c841){if(_0xf7c841){_0x47fa71[_0x980e('0x61')]['MailAccountId']=_0xf7c841['id'];return db[_0x980e('0x65')][_0x980e('0x66')](_0x47fa71[_0x980e('0x61')]);}})[_0x980e('0xe')](respondWithResult(_0x46a194,null))[_0x980e('0x17')](handleError(_0x46a194,null));};exports['getDispositions']=function(_0xf7ed72,_0x4ef50d){var _0x1b40dc={'raw':![],'where':{}};var _0x31bc7d={};var _0xfdbf70={'count':0x0,'rows':[]};return db['MailAccount'][_0x980e('0x67')]({'where':{'id':_0xf7ed72[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ef50d,null))['then'](function(_0x8183ea){if(_0x8183ea){_0x31bc7d[_0x980e('0x4f')]=_[_0x980e('0x4d')](db['Disposition'][_0x980e('0x48')]);_0x31bc7d[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0xf7ed72[_0x980e('0x4c')]);_0x31bc7d[_0x980e('0x4e')]=_[_0x980e('0x5d')](_0x31bc7d[_0x980e('0x4f')],_0x31bc7d[_0x980e('0x4c')]);_0x1b40dc[_0x980e('0x51')]=_[_0x980e('0x5d')](_0x31bc7d['model'],qs['fields'](_0xf7ed72[_0x980e('0x4c')][_0x980e('0x50')]));_0x1b40dc['attributes']=_0x1b40dc['attributes'][_0x980e('0x5e')]?_0x1b40dc[_0x980e('0x51')]:_0x31bc7d[_0x980e('0x4f')];if(!_0xf7ed72[_0x980e('0x4c')][_0x980e('0x68')]('nolimit')){_0x1b40dc[_0x980e('0x1e')]=qs[_0x980e('0x1e')](_0xf7ed72['query'][_0x980e('0x1e')]);_0x1b40dc[_0x980e('0x1c')]=qs[_0x980e('0x1c')](_0xf7ed72[_0x980e('0x4c')][_0x980e('0x1c')]);}_0x1b40dc[_0x980e('0x69')]=qs[_0x980e('0x52')](_0xf7ed72['query'][_0x980e('0x52')]);_0x1b40dc[_0x980e('0x54')]=qs[_0x980e('0x4e')](_[_0x980e('0x6a')](_0xf7ed72[_0x980e('0x4c')],_0x31bc7d[_0x980e('0x4e')]));_0x1b40dc['where']['MailAccountId']=_0x8183ea['id'];if(_0xf7ed72['query'][_0x980e('0x53')]){_0x1b40dc['where']=_[_0x980e('0x55')](_0x1b40dc[_0x980e('0x54')],{'$or':_[_0x980e('0x4b')](_0x1b40dc[_0x980e('0x51')],function(_0x5cf3a8){var _0x4dfe32={};_0x4dfe32[_0x5cf3a8]={'$like':'%'+_0xf7ed72['query'][_0x980e('0x53')]+'%'};return _0x4dfe32;})});}_0x1b40dc=_[_0x980e('0x55')]({},_0x1b40dc,_0xf7ed72['options']);return db['Disposition'][_0x980e('0x1f')]({'where':_0x1b40dc[_0x980e('0x54')]})[_0x980e('0xe')](function(_0x533627){_0xfdbf70[_0x980e('0x1f')]=_0x533627;if(_0xf7ed72[_0x980e('0x4c')][_0x980e('0x59')]){_0x1b40dc[_0x980e('0x5f')]=[{'all':!![]}];}return db[_0x980e('0x65')][_0x980e('0x5a')](_0x1b40dc);})['then'](function(_0xb5a897){_0xfdbf70[_0x980e('0x6b')]=_0xb5a897;return _0xfdbf70;});}})[_0x980e('0xe')](respondWithFilteredResult(_0x4ef50d,_0x1b40dc))[_0x980e('0x17')](handleError(_0x4ef50d,null));};exports[_0x980e('0x6c')]=function(_0x50da57,_0x10529e){return db['MailAccount'][_0x980e('0x60')]({'where':{'id':_0x50da57[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x10529e,null))[_0x980e('0xe')](function(_0x39c9b0){if(_0x39c9b0){return _0x39c9b0[_0x980e('0x6c')](_0x50da57[_0x980e('0x4c')][_0x980e('0x6d')]);}})[_0x980e('0xe')](respondWithStatusCode(_0x10529e,null))['catch'](handleError(_0x10529e,null));};exports[_0x980e('0x6e')]=function(_0x1ef09e,_0x5b7d87){if(_0x1ef09e[_0x980e('0x61')]['id']){delete _0x1ef09e[_0x980e('0x61')]['id'];}return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0x1ef09e[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5b7d87,null))[_0x980e('0xe')](function(_0x4507f7){if(_0x4507f7){_0x1ef09e[_0x980e('0x61')][_0x980e('0x6f')]=_0x4507f7['id'];return db[_0x980e('0x70')][_0x980e('0x66')](_0x1ef09e[_0x980e('0x61')]);}})[_0x980e('0xe')](respondWithResult(_0x5b7d87,null))['catch'](handleError(_0x5b7d87,null));};exports['getAnswers']=function(_0x1465e0,_0x48b367){var _0x4009b9={'raw':![],'where':{}};var _0x5c6473={};var _0x282323={'count':0x0,'rows':[]};return db[_0x980e('0x58')]['findOne']({'where':{'id':_0x1465e0[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x48b367,null))['then'](function(_0x1979d8){if(_0x1979d8){_0x5c6473[_0x980e('0x4f')]=_[_0x980e('0x4d')](db[_0x980e('0x70')][_0x980e('0x48')]);_0x5c6473[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0x1465e0[_0x980e('0x4c')]);_0x5c6473[_0x980e('0x4e')]=_[_0x980e('0x5d')](_0x5c6473[_0x980e('0x4f')],_0x5c6473[_0x980e('0x4c')]);_0x4009b9[_0x980e('0x51')]=_['intersection'](_0x5c6473['model'],qs['fields'](_0x1465e0[_0x980e('0x4c')][_0x980e('0x50')]));_0x4009b9[_0x980e('0x51')]=_0x4009b9[_0x980e('0x51')][_0x980e('0x5e')]?_0x4009b9[_0x980e('0x51')]:_0x5c6473[_0x980e('0x4f')];if(!_0x1465e0[_0x980e('0x4c')][_0x980e('0x68')](_0x980e('0x71'))){_0x4009b9['limit']=qs['limit'](_0x1465e0[_0x980e('0x4c')][_0x980e('0x1e')]);_0x4009b9['offset']=qs[_0x980e('0x1c')](_0x1465e0[_0x980e('0x4c')][_0x980e('0x1c')]);}_0x4009b9[_0x980e('0x69')]=qs['sort'](_0x1465e0[_0x980e('0x4c')][_0x980e('0x52')]);_0x4009b9[_0x980e('0x54')]=qs[_0x980e('0x4e')](_['pick'](_0x1465e0[_0x980e('0x4c')],_0x5c6473[_0x980e('0x4e')]));_0x4009b9[_0x980e('0x54')][_0x980e('0x6f')]=_0x1979d8['id'];if(_0x1465e0[_0x980e('0x4c')][_0x980e('0x53')]){_0x4009b9[_0x980e('0x54')]=_[_0x980e('0x55')](_0x4009b9[_0x980e('0x54')],{'$or':_[_0x980e('0x4b')](_0x4009b9[_0x980e('0x51')],function(_0x3313a7){var _0x160ca6={};_0x160ca6[_0x3313a7]={'$like':'%'+_0x1465e0[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0x160ca6;})});}_0x4009b9=_[_0x980e('0x55')]({},_0x4009b9,_0x1465e0[_0x980e('0x57')]);return db['CannedAnswer'][_0x980e('0x1f')]({'where':_0x4009b9[_0x980e('0x54')]})[_0x980e('0xe')](function(_0x3b0adc){_0x282323[_0x980e('0x1f')]=_0x3b0adc;if(_0x1465e0[_0x980e('0x4c')]['includeAll']){_0x4009b9['include']=[{'all':!![]}];}return db[_0x980e('0x70')][_0x980e('0x5a')](_0x4009b9);})['then'](function(_0x3c7884){_0x282323[_0x980e('0x6b')]=_0x3c7884;return _0x282323;});}})['then'](respondWithFilteredResult(_0x48b367,_0x4009b9))[_0x980e('0x17')](handleError(_0x48b367,null));};exports['removeAnswers']=function(_0x307eb5,_0x2e012b){return db['MailAccount'][_0x980e('0x60')]({'where':{'id':_0x307eb5[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e012b,null))[_0x980e('0xe')](function(_0x4b1e59){if(_0x4b1e59){return _0x4b1e59[_0x980e('0x72')](_0x307eb5['query'][_0x980e('0x6d')]);}})[_0x980e('0xe')](respondWithStatusCode(_0x2e012b,null))[_0x980e('0x17')](handleError(_0x2e012b,null));};exports['create']=function(_0x58e35a,_0x5334a3){var _0x1a9c23={'name':_0x58e35a[_0x980e('0x61')][_0x980e('0x28')],'key':_0x58e35a[_0x980e('0x61')][_0x980e('0x4a')],'provider':_0x58e35a[_0x980e('0x61')][_0x980e('0x73')]===_0x980e('0x62')?null:_0x58e35a[_0x980e('0x61')]['provider'],'email':_0x58e35a[_0x980e('0x61')][_0x980e('0x74')],'ListId':_0x58e35a[_0x980e('0x61')]['ListId'],'active':!_[_0x980e('0x75')](_0x58e35a[_0x980e('0x61')][_0x980e('0x76')])?_0x58e35a[_0x980e('0x61')][_0x980e('0x76')]:!![],'description':_0x58e35a[_0x980e('0x61')][_0x980e('0x77')]||null};var _0xae143e=getAuthenticationOptions(_0x1a9c23[_0x980e('0x73')],_0x58e35a[_0x980e('0x61')]);_0x1a9c23[_0x980e('0x41')]=_0xae143e['Imap'];_0x1a9c23[_0x980e('0x42')]=_0xae143e['Smtp'];return db[_0x980e('0x58')][_0x980e('0x66')](_0x1a9c23,{'include':[{'model':db[_0x980e('0x45')],'as':'Smtp'},{'model':db[_0x980e('0x44')],'as':_0x980e('0x41')}]})['then'](function(_0x1a57fa){var _0x5ad0c9=_0x58e35a[_0x980e('0x36')]['get']({'plain':!![]});if(!_0x5ad0c9)throw new Error(_0x980e('0x78'));if(_0x5ad0c9[_0x980e('0x79')]==='user'){var _0x55538f=_0x1a57fa[_0x980e('0x24')]({'plain':!![]});return db[_0x980e('0x7a')][_0x980e('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x5ad0c9[_0x980e('0x7b')]},'raw':!![]})['then'](function(_0x1758fa){if(_0x1758fa&&_0x1758fa[_0x980e('0x7c')]===0x0){return db[_0x980e('0x26')]['create']({'name':_0x55538f[_0x980e('0x28')],'resourceId':_0x55538f['id'],'type':_0x1758fa[_0x980e('0x28')],'sectionId':_0x1758fa['id']},{})[_0x980e('0xe')](function(){return _0x1a57fa;});}else{return _0x1a57fa;}})[_0x980e('0x17')](function(_0x49c667){logger[_0x980e('0x14')](_0x980e('0x7d'),_0x49c667);throw _0x49c667;});}return _0x1a57fa;})['then'](respondWithResult(_0x5334a3,0xc9))['catch'](handleError(_0x5334a3,null));};exports[_0x980e('0x7e')]=function(_0x1dabbc,_0x65a564){return db[_0x980e('0x58')][_0x980e('0x67')]({'where':{'id':_0x1dabbc[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x65a564,null))['then'](function(_0x18ae95){if(_0x18ae95){return _0x18ae95[_0x980e('0x7e')]();}return null;})[_0x980e('0xe')](respondWithResult(_0x65a564,null))[_0x980e('0x17')](handleError(_0x65a564,null));};exports[_0x980e('0x7f')]=function(_0x91681a,_0xea6234){if(_0x91681a[_0x980e('0x61')]['id']){delete _0x91681a['body']['id'];}return db[_0x980e('0x58')]['find']({'where':{'id':_0x91681a[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xea6234,null))['then'](function(_0x3139f8){if(_0x3139f8){_0x91681a['body'][_0x980e('0x6f')]=_0x3139f8['id'];return db[_0x980e('0x44')][_0x980e('0x66')](_0x91681a['body']);}})[_0x980e('0xe')](respondWithResult(_0xea6234,null))[_0x980e('0x17')](handleError(_0xea6234,null));};exports[_0x980e('0x80')]=function(_0x1bcd19,_0x325d7c){return db['MailAccount'][_0x980e('0x67')]({'where':{'id':_0x1bcd19[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x325d7c,null))[_0x980e('0xe')](function(_0x1bbf1b){if(_0x1bbf1b){return _0x1bbf1b['setImap'](null);}return null;})[_0x980e('0xe')](respondWithStatusCode(_0x325d7c,null))['catch'](handleError(_0x325d7c,null));};exports[_0x980e('0x81')]=function(_0x2e4cfd,_0x25ddb8){return db['MailAccount'][_0x980e('0x67')]({'where':{'id':_0x2e4cfd[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x25ddb8,null))[_0x980e('0xe')](function(_0x1730f7){if(_0x1730f7){return _0x1730f7[_0x980e('0x81')]();}return null;})[_0x980e('0xe')](respondWithResult(_0x25ddb8,null))['catch'](handleError(_0x25ddb8,null));};exports[_0x980e('0x82')]=function(_0xd8c66c,_0x10ef3b){if(_0xd8c66c['body']['id']){delete _0xd8c66c['body']['id'];}return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0xd8c66c['params']['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x10ef3b,null))['then'](function(_0x219d4a){if(_0x219d4a){_0xd8c66c[_0x980e('0x61')]['MailAccountId']=_0x219d4a['id'];return db[_0x980e('0x45')]['create'](_0xd8c66c[_0x980e('0x61')]);}})[_0x980e('0xe')](respondWithResult(_0x10ef3b,null))[_0x980e('0x17')](handleError(_0x10ef3b,null));};exports[_0x980e('0x83')]=function(_0xcf1385,_0xdaa5b8){return db['MailAccount'][_0x980e('0x67')]({'where':{'id':_0xcf1385[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0xdaa5b8,null))[_0x980e('0xe')](function(_0x583dce){if(_0x583dce){return _0x583dce['setSmtp'](null);}return null;})[_0x980e('0xe')](respondWithStatusCode(_0xdaa5b8,null))[_0x980e('0x17')](handleError(_0xdaa5b8,null));};exports[_0x980e('0x84')]=function(_0x22606a,_0x16bb4a){return db[_0x980e('0x85')]['find']({'where':{'id':_0x22606a[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x16bb4a,null))[_0x980e('0xe')](function(_0x1f0181){if(_0x1f0181){return _0x1f0181['addInteraction'](_0x22606a[_0x980e('0x61')][_0x980e('0x6d')],_[_0x980e('0x86')](_0x22606a['body'],[_0x980e('0x6d'),'id'])||{});}})[_0x980e('0xe')](respondWithResult(_0x16bb4a,null))[_0x980e('0x17')](handleError(_0x16bb4a,null));};exports['getInteractions']=function(_0x17b90d,_0x54679c){var _0x4d3a32={'raw':![],'where':{}};var _0x5a41b4={};var _0x340b25={'count':0x0,'rows':[]};return db[_0x980e('0x58')]['findOne']({'where':{'id':_0x17b90d[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x54679c,null))['then'](function(_0x24231a){if(_0x24231a){_0x5a41b4[_0x980e('0x4f')]=_[_0x980e('0x4d')](db[_0x980e('0x85')][_0x980e('0x48')]);_0x5a41b4[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0x17b90d[_0x980e('0x4c')]);_0x5a41b4[_0x980e('0x4e')]=_[_0x980e('0x5d')](_0x5a41b4[_0x980e('0x4f')],_0x5a41b4['query']);_0x4d3a32[_0x980e('0x51')]=_[_0x980e('0x5d')](_0x5a41b4[_0x980e('0x4f')],qs[_0x980e('0x50')](_0x17b90d['query'][_0x980e('0x50')]));_0x4d3a32['attributes']=_0x4d3a32[_0x980e('0x51')][_0x980e('0x5e')]?_0x4d3a32[_0x980e('0x51')]:_0x5a41b4['model'];if(!_0x17b90d[_0x980e('0x4c')][_0x980e('0x68')](_0x980e('0x71'))){_0x4d3a32[_0x980e('0x1e')]=qs['limit'](_0x17b90d[_0x980e('0x4c')]['limit']);_0x4d3a32[_0x980e('0x1c')]=qs['offset'](_0x17b90d[_0x980e('0x4c')][_0x980e('0x1c')]);}_0x4d3a32[_0x980e('0x69')]=qs[_0x980e('0x52')](_0x17b90d['query'][_0x980e('0x52')]);_0x4d3a32['where']=qs[_0x980e('0x4e')](_['pick'](_0x17b90d[_0x980e('0x4c')],_0x5a41b4[_0x980e('0x4e')]));_0x4d3a32['where'][_0x980e('0x6f')]=_0x24231a['id'];if(_0x17b90d['query'][_0x980e('0x53')]){_0x4d3a32['where']=_['merge'](_0x4d3a32['where'],{'$or':_[_0x980e('0x4b')](_0x4d3a32[_0x980e('0x51')],function(_0x1017a9){var _0x39164e={};_0x39164e[_0x1017a9]={'$like':'%'+_0x17b90d[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0x39164e;})});}_0x4d3a32=_['merge']({},_0x4d3a32,_0x17b90d[_0x980e('0x57')]);return db[_0x980e('0x85')][_0x980e('0x1f')]({'where':_0x4d3a32[_0x980e('0x54')]})[_0x980e('0xe')](function(_0x2ab4c8){_0x340b25[_0x980e('0x1f')]=_0x2ab4c8;if(_0x17b90d[_0x980e('0x4c')][_0x980e('0x59')]){_0x4d3a32[_0x980e('0x5f')]=[{'model':db['CmContact'],'as':_0x980e('0x87'),'required':![]},{'model':db[_0x980e('0x88')],'as':_0x980e('0x89'),'attributes':[_0x980e('0x28'),_0x980e('0x8a'),_0x980e('0x8b')],'required':![]},{'model':db[_0x980e('0x8c')],'as':'Tags','attributes':['id',_0x980e('0x28'),_0x980e('0x8d')],'where':_0x17b90d['query'][_0x980e('0x8e')]?{'id':_0x17b90d['query'][_0x980e('0x8e')]}:undefined,'required':_0x17b90d[_0x980e('0x4c')][_0x980e('0x8e')]?!![]:![]}];}return db[_0x980e('0x85')][_0x980e('0x5a')](_0x4d3a32);})[_0x980e('0xe')](function(_0x217b31){_0x340b25[_0x980e('0x6b')]=_0x217b31;return _0x340b25;});}})[_0x980e('0xe')](respondWithFilteredResult(_0x54679c,_0x4d3a32))[_0x980e('0x17')](handleError(_0x54679c,null));};exports[_0x980e('0x8f')]=function addApplications(_0x451a9b,_0x1cdf7f){var _0x35719b=_0x451a9b['params']['id'];var _0x389dc1=_0x451a9b['body'];var _0x3e7da0=0xc8;var _0x2f1e5f=null;return db[_0x980e('0x90')][_0x980e('0x91')]({'isolationLevel':db['sequelize'][_0x980e('0x92')][_0x980e('0x93')][_0x980e('0x94')]},function(_0x2557d1){return db[_0x980e('0x58')]['findOne']({'where':{'id':_0x35719b},'transaction':_0x2557d1})[_0x980e('0xe')](function(_0x1b2841){if(_0x1b2841){return db['MailApplication'][_0x980e('0x23')]({'where':{'MailAccountId':_0x35719b},'transaction':_0x2557d1})[_0x980e('0xe')](function(){var _0x2d0753=_[_0x980e('0x4b')](_0x389dc1,function(_0x8da8a5){_0x8da8a5[_0x980e('0x6f')]=_0x35719b;return _0x8da8a5;});return db[_0x980e('0x95')][_0x980e('0x96')](_0x2d0753,{'transaction':_0x2557d1});});}else{_0x3e7da0=0x194;_0x2f1e5f=[];}});})[_0x980e('0xe')](function(){if(_0x3e7da0!==0x194){return db[_0x980e('0x95')][_0x980e('0x97')]({'where':{'MailAccountId':_0x35719b},'order':_0x980e('0x98')})[_0x980e('0xe')](function(_0x220956){_0x2f1e5f=_0x220956;});}})['catch'](function(_0x5b5f8f){_0x3e7da0=0x1f4;logger[_0x980e('0x14')](_0x5b5f8f[_0x980e('0x27')]);if(_0x5b5f8f[_0x980e('0x28')]){delete _0x5b5f8f[_0x980e('0x28')];}_0x2f1e5f=_0x5b5f8f;})[_0x980e('0x99')](function(){if(_0x2f1e5f===null){_0x1cdf7f[_0x980e('0x18')](_0x3e7da0);}else{if(_0x3e7da0===0x1f4){_0x1cdf7f[_0x980e('0x19')](_0x3e7da0)['send'](_0x2f1e5f);}else{_0x1cdf7f[_0x980e('0x19')](_0x3e7da0)[_0x980e('0x1b')](_0x2f1e5f);}}});};exports['getApplications']=function(_0x154c84,_0x2f57da){var _0x2280e8={};var _0x155a95={};var _0x33aa36;var _0x2a86cd;return db[_0x980e('0x58')][_0x980e('0x67')]({'where':{'id':_0x154c84[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f57da,null))[_0x980e('0xe')](function(_0x4e9bfa){if(_0x4e9bfa){_0x33aa36=_0x4e9bfa;_0x155a95[_0x980e('0x4f')]=_[_0x980e('0x4d')](db[_0x980e('0x95')]['rawAttributes']);_0x155a95['query']=_[_0x980e('0x4d')](_0x154c84[_0x980e('0x4c')]);_0x155a95[_0x980e('0x4e')]=_[_0x980e('0x5d')](_0x155a95[_0x980e('0x4f')],_0x155a95[_0x980e('0x4c')]);_0x2280e8[_0x980e('0x51')]=_[_0x980e('0x5d')](_0x155a95['model'],qs[_0x980e('0x50')](_0x154c84[_0x980e('0x4c')][_0x980e('0x50')]));_0x2280e8['attributes']=_0x2280e8[_0x980e('0x51')][_0x980e('0x5e')]?_0x2280e8[_0x980e('0x51')]:_0x155a95[_0x980e('0x4f')];_0x2280e8['order']=qs[_0x980e('0x52')](_0x154c84[_0x980e('0x4c')]['sort']);_0x2280e8[_0x980e('0x54')]=qs[_0x980e('0x4e')](_[_0x980e('0x6a')](_0x154c84['query'],_0x155a95[_0x980e('0x4e')]));if(_0x154c84[_0x980e('0x4c')][_0x980e('0x53')]){_0x2280e8['where']=_[_0x980e('0x55')](_0x2280e8[_0x980e('0x54')],{'$or':_[_0x980e('0x4b')](_0x2280e8[_0x980e('0x51')],function(_0x3cdef3){var _0x31ad0b={};_0x31ad0b[_0x3cdef3]={'$like':'%'+_0x154c84[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0x31ad0b;})});}_0x2280e8=_[_0x980e('0x55')]({},_0x2280e8,_0x154c84[_0x980e('0x57')]);return _0x33aa36[_0x980e('0x9a')](_0x2280e8);}})[_0x980e('0xe')](function(_0x2d0ccd){if(_0x2d0ccd){_0x2a86cd=_0x2d0ccd['length'];if(!_0x154c84[_0x980e('0x4c')][_0x980e('0x68')](_0x980e('0x71'))){_0x2280e8[_0x980e('0x1e')]=qs[_0x980e('0x1e')](_0x154c84['query'][_0x980e('0x1e')]);_0x2280e8[_0x980e('0x1c')]=qs[_0x980e('0x1c')](_0x154c84[_0x980e('0x4c')][_0x980e('0x1c')]);}return _0x33aa36['getApplications'](_0x2280e8);}})['then'](function(_0x4b3d10){if(_0x4b3d10){return _0x4b3d10?{'count':_0x2a86cd,'rows':_0x4b3d10}:null;}})['then'](respondWithResult(_0x2f57da,null))['catch'](handleError(_0x2f57da,null));};exports[_0x980e('0x9b')]=function(_0x1a79c9,_0x26c869){var _0x5228c8={'raw':!![],'where':{}};var _0x4a5e0a={};var _0x5a5832={'count':0x0,'rows':[]};return db[_0x980e('0x58')]['findOne']({'where':{'id':_0x1a79c9[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x26c869,null))[_0x980e('0xe')](function(_0x2aa0c6){if(_0x2aa0c6){_0x4a5e0a['model']=_[_0x980e('0x4d')](db['MailMessage']['rawAttributes']);_0x4a5e0a[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0x1a79c9[_0x980e('0x4c')]);_0x4a5e0a[_0x980e('0x4e')]=_[_0x980e('0x5d')](_0x4a5e0a[_0x980e('0x4f')],_0x4a5e0a[_0x980e('0x4c')]);_0x5228c8[_0x980e('0x51')]=_['intersection'](_0x4a5e0a[_0x980e('0x4f')],qs[_0x980e('0x50')](_0x1a79c9[_0x980e('0x4c')][_0x980e('0x50')]));_0x5228c8[_0x980e('0x51')]=_0x5228c8[_0x980e('0x51')]['length']?_0x5228c8['attributes']:_0x4a5e0a[_0x980e('0x4f')];if(!_0x1a79c9[_0x980e('0x4c')]['hasOwnProperty'](_0x980e('0x71'))){_0x5228c8['limit']=qs[_0x980e('0x1e')](_0x1a79c9['query'][_0x980e('0x1e')]);_0x5228c8[_0x980e('0x1c')]=qs['offset'](_0x1a79c9[_0x980e('0x4c')][_0x980e('0x1c')]);}_0x5228c8['order']=qs[_0x980e('0x52')](_0x1a79c9[_0x980e('0x4c')][_0x980e('0x52')]);_0x5228c8['where']=qs[_0x980e('0x4e')](_[_0x980e('0x6a')](_0x1a79c9[_0x980e('0x4c')],_0x4a5e0a['filters']));_0x5228c8[_0x980e('0x54')][_0x980e('0x6f')]=_0x2aa0c6['id'];if(_0x1a79c9['query'][_0x980e('0x53')]){_0x5228c8[_0x980e('0x54')]=_[_0x980e('0x55')](_0x5228c8['where'],{'$or':_[_0x980e('0x4b')](_0x5228c8[_0x980e('0x51')],function(_0x2162f1){var _0xb1b6e4={};_0xb1b6e4[_0x2162f1]={'$like':'%'+_0x1a79c9[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0xb1b6e4;})});}if(_0x1a79c9[_0x980e('0x4c')][_0x980e('0x9c')]){var _0x519648=_0x1a79c9[_0x980e('0x4c')][_0x980e('0x9c')]['split'](',');var _0x5fdb95={};_0x5fdb95[_0x519648[0x0]]={'$gte':moment(_0x519648[0x1])[_0x980e('0x9d')](_0x980e('0x9e'))};_0x5228c8['where']=_[_0x980e('0x55')](_0x5228c8[_0x980e('0x54')],_0x5fdb95);}_0x5228c8=_[_0x980e('0x55')]({},_0x5228c8,_0x1a79c9['options']);return db[_0x980e('0x9f')][_0x980e('0x1f')]({'where':_0x5228c8[_0x980e('0x54')]})['then'](function(_0x4dde9c){_0x5a5832[_0x980e('0x1f')]=_0x4dde9c;if(_0x1a79c9[_0x980e('0x4c')]['includeAll']){_0x5228c8[_0x980e('0x5f')]=[{'all':!![]}];}return db[_0x980e('0x9f')][_0x980e('0x5a')](_0x5228c8);})[_0x980e('0xe')](function(_0x1ff0e8){if(_0x1a79c9[_0x980e('0x4c')][_0x980e('0xa0')]===_0x980e('0xa1')){for(var _0x306e63=0x0;_0x306e63<_0x1ff0e8[_0x980e('0x5e')];_0x306e63++){_0x1ff0e8[_0x306e63][_0x980e('0x61')]=juice(_0x1ff0e8[_0x306e63]['body']);}}_0x5a5832[_0x980e('0x6b')]=_0x1ff0e8;return _0x5a5832;});}})[_0x980e('0xe')](respondWithFilteredResult(_0x26c869,_0x5228c8))[_0x980e('0x17')](handleError(_0x26c869,null));};exports[_0x980e('0x29')]=function(_0x31078f,_0x244753){var _0x229429,_0x23b7e8={},_0x2bd9c7;if(_0x31078f[_0x980e('0x61')]['to']){_0x2bd9c7=_0x31078f[_0x980e('0x61')]['to'][_0x980e('0xa2')](',')[0x0];}return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0x31078f['params']['id']},'include':[{'model':db[_0x980e('0xa3')],'as':_0x980e('0xa4'),'include':[{'model':db[_0x980e('0xa5')],'as':'Contacts','where':{'email':_0x2bd9c7},'limit':0x1,'order':[[_0x980e('0xa6'),_0x980e('0xa7')]]}]},{'model':db[_0x980e('0x45')],'as':_0x980e('0x42'),'raw':!![],'include':[{'model':db[_0x980e('0xa8')],'as':'CloudProvider','raw':!![]}]}]})[_0x980e('0xe')](handleEntityNotFound(_0x244753,null))[_0x980e('0xe')](function(_0x41602d){if(!_0x41602d)return;_0x229429=_0x41602d;if(!_0x41602d[_0x980e('0x42')])throw new Error(_0x980e('0xa9'));if(_[_0x980e('0x75')](_0x31078f[_0x980e('0x61')][_0x980e('0xaa')])){_0x31078f[_0x980e('0x61')][_0x980e('0xaa')]=util['format']('%s\x20<%s>',_0x41602d[_0x980e('0x28')],_0x41602d['email']||_0x41602d[_0x980e('0x42')]['user']);}if(_0x31078f[_0x980e('0x61')][_0x980e('0xab')]&&_0x31078f[_0x980e('0x61')][_0x980e('0xab')][_0x980e('0x5e')]){for(var _0x25f148=0x0;_0x25f148<_0x31078f['body'][_0x980e('0xab')][_0x980e('0x5e')];_0x25f148+=0x1){_0x31078f[_0x980e('0x61')][_0x980e('0xab')][_0x25f148]={'filename':_0x31078f[_0x980e('0x61')][_0x980e('0xab')][_0x25f148][_0x980e('0x28')],'path':path[_0x980e('0xac')](config[_0x980e('0xad')],'server/files/attachments',_0x31078f[_0x980e('0x61')][_0x980e('0xab')][_0x25f148][_0x980e('0xae')])};}}var _0x2f686f=_0x41602d['getSmtpOptions']();return respondWithRpcPromise(_0x980e('0xaf'),_0x980e('0xb0'),{'account':_0x2f686f,'message':_0x31078f[_0x980e('0x61')]});})[_0x980e('0xe')](function(_0x4bf3bd){if(!_0x4bf3bd)return;_0x23b7e8=_0x4bf3bd;if(!_0x229429['List'])throw new Error(_0x980e('0xb1'));if(_0x229429[_0x980e('0xa4')][_0x980e('0xb2')][_0x980e('0x5e')])return _0x229429['List'][_0x980e('0xb2')][0x0];return db[_0x980e('0xa5')]['create'](_['defaults'](_0x31078f[_0x980e('0x61')],{'firstName':_0x31078f['body']['to'],'email':_0x31078f[_0x980e('0x61')]['to'],'phone':_0x31078f[_0x980e('0x61')]['to'],'ListId':_0x229429[_0x980e('0xb3')]}));})[_0x980e('0xe')](function(_0x1627c7){if(!_0x1627c7)return;var _0x2f263c={'UserId':_0x31078f['user']['id'],'ContactId':_0x1627c7['id'],'MailAccountId':_0x229429['id'],'inReplyTo':_0x23b7e8[_0x980e('0xb4')],'to':_0x31078f['body'][_0x980e('0xaa')],'cc':_0x31078f[_0x980e('0x61')]['cc'],'subject':_0x31078f[_0x980e('0x61')][_0x980e('0xb5')],'attach':_0x31078f[_0x980e('0x61')][_0x980e('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x980e('0x9d')](_0x980e('0x9e')),'lastMsgDirection':_0x980e('0xb7'),'Messages':[_[_0x980e('0x55')](_0x31078f['body'],{'messageId':_0x23b7e8[_0x980e('0xb4')],'sentAt':moment()[_0x980e('0x9d')](_0x980e('0x9e')),'read':!![],'MailAccountId':_0x229429['id'],'UserId':_0x31078f[_0x980e('0x36')]['id'],'ContactId':_0x1627c7['id']})]};if(_0x31078f[_0x980e('0x61')][_0x980e('0xb8')]){_0x2f263c=_[_0x980e('0x55')](_0x2f263c,_0x31078f[_0x980e('0x61')][_0x980e('0xb8')]);}return db[_0x980e('0x85')][_0x980e('0x66')](_0x2f263c,{'include':[{'model':db[_0x980e('0x9f')],'as':'Messages'}]});})[_0x980e('0xe')](respondWithResult(_0x244753,null))[_0x980e('0x17')](handleError(_0x244753,null));};exports[_0x980e('0xb9')]=function(_0x1870c3,_0x364d4e){return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0x1870c3[_0x980e('0x5c')]['id']},'include':[{'model':db[_0x980e('0x45')],'as':_0x980e('0x42'),'raw':!![],'include':[{'model':db[_0x980e('0xa8')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x364d4e,null))[_0x980e('0xe')](function(_0x1073d9){if(!_0x1073d9['Smtp'])return;var _0x14136b=_0x1073d9[_0x980e('0xba')]();return respondWithRpcPromise('VerifySmtp',_0x980e('0xb9'),{'account':_0x14136b});})[_0x980e('0xe')](respondWithResult(_0x364d4e,null))[_0x980e('0x17')](handleError(_0x364d4e,null));};exports[_0x980e('0x23')]=function(_0x4c015f,_0x449288){return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0x4c015f[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x449288,null))[_0x980e('0xe')](function(_0x56645d){if(_0x56645d&&_0x56645d['service']){throw new db[(_0x980e('0xbb'))][(_0x980e('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x56645d;})['then'](removeEntity(_0x449288,null))['catch'](handleError(_0x449288,null));};exports[_0x980e('0xbd')]=function(_0x3359ef,_0xd9b4fa){return db[_0x980e('0x58')]['find']({'where':{'id':_0x3359ef[_0x980e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xd9b4fa,null))['then'](function(_0x1db88d){if(_0x1db88d){return _0x1db88d[_0x980e('0xbd')](_0x3359ef[_0x980e('0x61')][_0x980e('0x6d')],_[_0x980e('0x86')](_0x3359ef['body'],[_0x980e('0x6d'),'id'])||{})[_0x980e('0xbe')](function(_0x155f9f){for(var _0x4b4a40=0x0;_0x4b4a40<_0x3359ef[_0x980e('0x61')][_0x980e('0x6d')][_0x980e('0x5e')];_0x4b4a40+=0x1){socket[_0x980e('0xbf')](_0x980e('0xc0'),{'UserId':Number(_0x3359ef['body'][_0x980e('0x6d')][_0x4b4a40]),'MailAccountId':Number(_0x3359ef[_0x980e('0x5c')]['id'])});}return _0x155f9f;});}})[_0x980e('0xe')](respondWithResult(_0xd9b4fa,null))[_0x980e('0x17')](handleError(_0xd9b4fa,null));};exports[_0x980e('0xc1')]=function(_0x5a06ac,_0x2acef5){return db[_0x980e('0x58')][_0x980e('0x60')]({'where':{'id':_0x5a06ac[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x2acef5,null))[_0x980e('0xe')](function(_0x196c3f){if(_0x196c3f){return _0x196c3f[_0x980e('0xc1')](_0x5a06ac[_0x980e('0x4c')][_0x980e('0x6d')])['then'](function(){if(_[_0x980e('0xc2')](_0x5a06ac['query'][_0x980e('0x6d')])){for(var _0x48ca2b=0x0;_0x48ca2b<_0x5a06ac[_0x980e('0x4c')][_0x980e('0x6d')][_0x980e('0x5e')];_0x48ca2b+=0x1){socket[_0x980e('0xbf')](_0x980e('0xc3'),{'UserId':Number(_0x5a06ac[_0x980e('0x4c')]['ids'][_0x48ca2b]),'MailAccountId':Number(_0x5a06ac['params']['id'])});}}else{socket[_0x980e('0xbf')](_0x980e('0xc3'),{'UserId':Number(_0x5a06ac[_0x980e('0x4c')][_0x980e('0x6d')]),'MailAccountId':Number(_0x5a06ac[_0x980e('0x5c')]['id'])});}});}})[_0x980e('0xe')](respondWithStatusCode(_0x2acef5,null))['catch'](handleError(_0x2acef5,null));};exports['getAgents']=function(_0x5b9dbb,_0x4f5618){var _0x1417f8={};var _0xb1c255={};var _0x1f0866;var _0x2cac4a;return db[_0x980e('0x58')]['findOne']({'where':{'id':_0x5b9dbb[_0x980e('0x5c')]['id']}})[_0x980e('0xe')](handleEntityNotFound(_0x4f5618,null))[_0x980e('0xe')](function(_0x512f05){if(_0x512f05){_0x1f0866=_0x512f05;_0xb1c255[_0x980e('0x4f')]=_[_0x980e('0x4d')](db['User'][_0x980e('0x48')]);_0xb1c255[_0x980e('0x4c')]=_[_0x980e('0x4d')](_0x5b9dbb[_0x980e('0x4c')]);_0xb1c255['filters']=_[_0x980e('0x5d')](_0xb1c255[_0x980e('0x4f')],_0xb1c255[_0x980e('0x4c')]);_0x1417f8[_0x980e('0x51')]=_[_0x980e('0x5d')](_0xb1c255['model'],qs[_0x980e('0x50')](_0x5b9dbb[_0x980e('0x4c')]['fields']));_0x1417f8[_0x980e('0x51')]=_0x1417f8[_0x980e('0x51')][_0x980e('0x5e')]?_0x1417f8[_0x980e('0x51')]:_0xb1c255[_0x980e('0x4f')];_0x1417f8[_0x980e('0x69')]=qs[_0x980e('0x52')](_0x5b9dbb[_0x980e('0x4c')][_0x980e('0x52')]);_0x1417f8[_0x980e('0x54')]=qs['filters'](_['pick'](_0x5b9dbb[_0x980e('0x4c')],_0xb1c255[_0x980e('0x4e')]));if(_0x5b9dbb['query'][_0x980e('0x53')]){_0x1417f8[_0x980e('0x54')]=_[_0x980e('0x55')](_0x1417f8[_0x980e('0x54')],{'$or':_[_0x980e('0x4b')](_0x1417f8[_0x980e('0x51')],function(_0x25afb8){var _0x165f34={};_0x165f34[_0x25afb8]={'$like':'%'+_0x5b9dbb[_0x980e('0x4c')][_0x980e('0x53')]+'%'};return _0x165f34;})});}_0x1417f8=_[_0x980e('0x55')]({},_0x1417f8,_0x5b9dbb[_0x980e('0x57')]);return _0x1f0866['getAgents'](_0x1417f8);}})[_0x980e('0xe')](function(_0x5aa6c6){if(_0x5aa6c6){_0x2cac4a=_0x5aa6c6[_0x980e('0x5e')];if(!_0x5b9dbb[_0x980e('0x4c')]['hasOwnProperty'](_0x980e('0x71'))){_0x1417f8[_0x980e('0x1e')]=qs[_0x980e('0x1e')](_0x5b9dbb['query']['limit']);_0x1417f8[_0x980e('0x1c')]=qs[_0x980e('0x1c')](_0x5b9dbb[_0x980e('0x4c')][_0x980e('0x1c')]);}return _0x1f0866[_0x980e('0xc4')](_0x1417f8);}})[_0x980e('0xe')](function(_0x3b7c2e){if(_0x3b7c2e){return _0x3b7c2e?{'count':_0x2cac4a,'rows':_0x3b7c2e}:null;}})[_0x980e('0xe')](respondWithResult(_0x4f5618,null))[_0x980e('0x17')](handleError(_0x4f5618,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index bf29580..8a9c613 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 _0xd69e=['events','../../mysqldb','MailAccount','save','update','hasOwnProperty','hook','exports'];(function(_0x271d27,_0x4cd644){var _0x4ee9c5=function(_0x277519){while(--_0x277519){_0x271d27['push'](_0x271d27['shift']());}};_0x4ee9c5(++_0x4cd644);}(_0xd69e,0xa0));var _0xed69=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd69e[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0xed69('0x0'));var MailAccount=require(_0xed69('0x1'))['db'][_0xed69('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed69('0x3'),'afterUpdate':_0xed69('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c00fe){return function(_0x5b941a,_0x5afae1,_0x3b30c5){MailAccountEvents['emit'](_0x5c00fe+':'+_0x5b941a['id'],_0x5b941a);MailAccountEvents['emit'](_0x5c00fe,_0x5b941a);_0x3b30c5(null);};}for(var e in events){if(events[_0xed69('0x5')](e)){var event=events[e];MailAccount[_0xed69('0x6')](e,emitEvent(event));}}module[_0xed69('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xd4f0=['emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x206b22,_0x5a9490){var _0xed286d=function(_0x537737){while(--_0x537737){_0x206b22['push'](_0x206b22['shift']());}};_0xed286d(++_0x5a9490);}(_0xd4f0,0x122));var _0x0d4f=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0xd4f0[_0x15bbf1];return _0x5c4b47;};'use strict';var EventEmitter=require(_0x0d4f('0x0'));var MailAccount=require(_0x0d4f('0x1'))['db'][_0x0d4f('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0d4f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31b7eb){return function(_0x6614ed,_0x28c83a,_0x37f16b){MailAccountEvents[_0x0d4f('0x4')](_0x31b7eb+':'+_0x6614ed['id'],_0x6614ed);MailAccountEvents[_0x0d4f('0x4')](_0x31b7eb,_0x6614ed);_0x37f16b(null);};}for(var e in events){if(events[_0x0d4f('0x5')](e)){var event=events[e];MailAccount[_0x0d4f('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cf88856..c64c8c3 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 _0x51ed=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','port','Smtp','secure','authentication'];(function(_0xb697a7,_0xa9ffca){var _0x2384ea=function(_0x5944f8){while(--_0x5944f8){_0xb697a7['push'](_0xb697a7['shift']());}};_0x2384ea(++_0xa9ffca);}(_0x51ed,0xe3));var _0xd51e=function(_0x24bfc6,_0x24399d){_0x24bfc6=_0x24bfc6-0x0;var _0x33bdb0=_0x51ed[_0x24bfc6];return _0x33bdb0;};'use strict';var attributes=require(_0xd51e('0x0'));module[_0xd51e('0x1')]=function(_0x142e59){return _0x142e59[_0xd51e('0x2')](_0xd51e('0x3'),attributes,{'tableName':_0xd51e('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3a414f=this;var _0x1b58a3={'id':_0x3a414f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3a414f[_0xd51e('0x5')]!=='custom'){_0x1b58a3['service']=_0x3a414f['provider'];}else{_0x1b58a3[_0xd51e('0x6')]=_0x3a414f['Smtp'][_0xd51e('0x6')];_0x1b58a3[_0xd51e('0x7')]=_0x3a414f[_0xd51e('0x8')]['port'];_0x1b58a3[_0xd51e('0x9')]=_0x3a414f[_0xd51e('0x8')]['secure'];}if(_0x3a414f[_0xd51e('0x8')][_0xd51e('0xa')]){if(_0x3a414f[_0xd51e('0x8')]['modernAuthentication']){if(!_0x3a414f[_0xd51e('0x8')][_0xd51e('0xb')])throw new Error(_0xd51e('0xc'));_0x1b58a3['auth']={'type':_0xd51e('0xd'),'user':_0x3a414f[_0xd51e('0x8')]['user'],'accessToken':_0x3a414f[_0xd51e('0x8')]['CloudProvider'][_0xd51e('0xe')]};}else{_0x1b58a3['auth']={'user':_0x3a414f[_0xd51e('0x8')][_0xd51e('0xf')],'pass':_0x3a414f['Smtp'][_0xd51e('0x10')]};}}return _0x1b58a3;}}});}; \ No newline at end of file +var _0x8f6c=['Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x8f6c,0xae));var _0xc8f6=function(_0x22eeed,_0xfc5d6d){_0x22eeed=_0x22eeed-0x0;var _0x279df6=_0x8f6c[_0x22eeed];return _0x279df6;};'use strict';var attributes=require(_0xc8f6('0x0'));module[_0xc8f6('0x1')]=function(_0x7681ef){return _0x7681ef[_0xc8f6('0x2')](_0xc8f6('0x3'),attributes,{'tableName':_0xc8f6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x42615e=this;var _0x2882cd={'id':_0x42615e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x42615e[_0xc8f6('0x5')]!=='custom'){_0x2882cd['service']=_0x42615e[_0xc8f6('0x5')];}else{_0x2882cd[_0xc8f6('0x6')]=_0x42615e[_0xc8f6('0x7')][_0xc8f6('0x6')];_0x2882cd[_0xc8f6('0x8')]=_0x42615e[_0xc8f6('0x7')]['port'];_0x2882cd[_0xc8f6('0x9')]=_0x42615e[_0xc8f6('0x7')][_0xc8f6('0x9')];}if(_0x42615e[_0xc8f6('0x7')][_0xc8f6('0xa')]){if(_0x42615e[_0xc8f6('0x7')][_0xc8f6('0xb')]){if(!_0x42615e['Smtp'][_0xc8f6('0xc')])throw new Error(_0xc8f6('0xd'));_0x2882cd[_0xc8f6('0xe')]={'type':_0xc8f6('0xf'),'user':_0x42615e[_0xc8f6('0x7')][_0xc8f6('0x10')],'accessToken':_0x42615e[_0xc8f6('0x7')][_0xc8f6('0xc')]['data5']};}else{_0x2882cd[_0xc8f6('0xe')]={'user':_0x42615e[_0xc8f6('0x7')][_0xc8f6('0x10')],'pass':_0x42615e[_0xc8f6('0x7')]['pass']};}}return _0x2882cd;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 9c80a0f..5d881ec 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 _0x57ca=['setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','List','omit','applications','list','orderBy','asc','push','length','close','*,*,*,*','ListId','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','interaction','get','created','originCc','bcc','Email','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','startRouting','Start','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowMailAccount','MailAccount','find'];(function(_0x42700d,_0x13dd76){var _0x20e042=function(_0x2df8b3){while(--_0x2df8b3){_0x42700d['push'](_0x42700d['shift']());}};_0x20e042(++_0x13dd76);}(_0x57ca,0x108));var _0xa57c=function(_0x24b773,_0x392c26){_0x24b773=_0x24b773-0x0;var _0x35f6c9=_0x57ca[_0x24b773];return _0x35f6c9;};'use strict';var _=require('lodash');var moment=require(_0xa57c('0x0'));var BPromise=require(_0xa57c('0x1'));var rs=require('randomstring');var Redis=require(_0xa57c('0x2'));var db=require(_0xa57c('0x3'))['db'];var logger=require(_0xa57c('0x4'))(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa57c('0x7')][_0xa57c('0x8')]({'port':0x232c});config[_0xa57c('0x9')]=_[_0xa57c('0xa')](config[_0xa57c('0x9')],{'host':_0xa57c('0xb'),'port':0x18eb});var socket=require(_0xa57c('0xc'))(new Redis(config[_0xa57c('0x9')]));require('./mailAccount.socket')[_0xa57c('0xd')](socket);function respondWithRpcPromise(_0x4b51d8,_0x46ba92,_0x932dcc){return new BPromise(function(_0x4fa5ed,_0x156bca){return client['request'](_0x4b51d8,_0x932dcc)[_0xa57c('0xe')](function(_0x44b221){logger['info'](_0xa57c('0xf'),_0x46ba92,'request\x20sent');logger[_0xa57c('0x10')](_0xa57c('0x11'),_0x46ba92,_0xa57c('0x12'),JSON[_0xa57c('0x13')](_0x44b221));if(_0x44b221[_0xa57c('0x14')]){if(_0x44b221['error'][_0xa57c('0x15')]===0x1f4){logger['error'](_0xa57c('0xf'),_0x46ba92,_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x156bca(_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);}logger[_0xa57c('0x14')](_0xa57c('0xf'),_0x46ba92,_0x44b221['error'][_0xa57c('0x16')]);return _0x4fa5ed(_0x44b221[_0xa57c('0x14')][_0xa57c('0x16')]);}else{logger['info'](_0xa57c('0xf'),_0x46ba92,'request\x20sent');_0x4fa5ed(_0x44b221[_0xa57c('0x17')][_0xa57c('0x16')]);}})[_0xa57c('0x18')](function(_0xe3d505){logger[_0xa57c('0x14')](_0xa57c('0xf'),_0x46ba92,_0xe3d505);_0x156bca(_0xe3d505);});});}exports[_0xa57c('0x19')]=function(_0x595c7a){var _0x4e4399=this;return new Promise(function(_0x8a8856,_0x4a53ab){return db['MailAccount'][_0xa57c('0x1a')]({'raw':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1c')]===undefined?!![]:![]:!![],'where':_0x595c7a['options']?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1d')]||null:null,'attributes':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1e')]||null:null,'limit':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x1f')]||null:null,'include':_0x595c7a[_0xa57c('0x1b')]?_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x595c7a[_0xa57c('0x1b')][_0xa57c('0x20')],function(_0x431bec){return{'model':db[_0x431bec['model']],'as':_0x431bec['as'],'attributes':_0x431bec[_0xa57c('0x1e')],'include':_0x431bec[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x431bec[_0xa57c('0x20')],function(_0x315ad7){return{'model':db[_0x315ad7[_0xa57c('0x22')]],'as':_0x315ad7['as'],'attributes':_0x315ad7[_0xa57c('0x1e')],'include':_0x315ad7[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x315ad7[_0xa57c('0x20')],function(_0x57ebe0){return{'model':db[_0x57ebe0[_0xa57c('0x22')]],'as':_0x57ebe0['as'],'attributes':_0x57ebe0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x257661){logger[_0xa57c('0x23')]('GetMailAccount',_0x595c7a);logger[_0xa57c('0x10')](_0xa57c('0x19'),_0x595c7a,JSON[_0xa57c('0x13')](_0x257661));_0x8a8856(_0x257661);})['catch'](function(_0xd779f1){logger['error'](_0xa57c('0x19'),_0xd779f1['message'],_0x595c7a);_0x4a53ab(_0x4e4399[_0xa57c('0x14')](0x1f4,_0xd779f1['message']));});});};exports[_0xa57c('0x24')]=function(_0x532164){var _0x9e02bb=this;return new Promise(function(_0x1d82d9,_0x43c8f3){return db[_0xa57c('0x25')][_0xa57c('0x26')]({'raw':_0x532164[_0xa57c('0x1b')]?_0x532164[_0xa57c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x532164[_0xa57c('0x1b')]?_0x532164['options'][_0xa57c('0x1d')]||null:null,'attributes':_0x532164[_0xa57c('0x1b')]?_0x532164[_0xa57c('0x1b')]['attributes']||null:null,'include':_0x532164[_0xa57c('0x1b')]?_0x532164['options'][_0xa57c('0x20')]?_['map'](_0x532164[_0xa57c('0x1b')]['include'],function(_0x433116){return{'model':db[_0x433116[_0xa57c('0x22')]],'as':_0x433116['as'],'attributes':_0x433116['attributes'],'include':_0x433116[_0xa57c('0x20')]?_['map'](_0x433116[_0xa57c('0x20')],function(_0x5c56d3){return{'model':db[_0x5c56d3[_0xa57c('0x22')]],'as':_0x5c56d3['as'],'attributes':_0x5c56d3[_0xa57c('0x1e')],'include':_0x5c56d3[_0xa57c('0x20')]?_[_0xa57c('0x21')](_0x5c56d3[_0xa57c('0x20')],function(_0x44350f){return{'model':db[_0x44350f['model']],'as':_0x44350f['as'],'attributes':_0x44350f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa57c('0xe')](function(_0x13e390){if(_0x532164[_0xa57c('0x1b')]['smtp']===!![])_0x13e390[_0xa57c('0x27')]('smtpOptions',_0x13e390[_0xa57c('0x28')]());logger[_0xa57c('0x23')]('ShowMailAccount',_0x532164);logger['debug']('ShowMailAccount',_0x532164,JSON[_0xa57c('0x13')](_0x13e390));_0x1d82d9(_0x13e390);})[_0xa57c('0x18')](function(_0x269a19){logger[_0xa57c('0x14')](_0xa57c('0x24'),_0x269a19[_0xa57c('0x16')],_0x532164);_0x43c8f3(_0x9e02bb['error'](0x1f4,_0x269a19[_0xa57c('0x16')]));});});};exports[_0xa57c('0x29')]=function(_0x5a5490){var _0x5ed42d=this;return new Promise(function(_0x5e10b,_0x203375){var _0x5af5e9={'body':_0x5a5490[_0xa57c('0x2a')],'channel':_0xa57c('0x2b')};var _0x2112b7=_[_0xa57c('0x2c')](_[_0xa57c('0x2d')](db[_0xa57c('0x2e')]['rawAttributes']),[_0xa57c('0x2f'),'updatedAt','CompanyId','ListId']);var _0x520383=![];if(_0x5a5490['body']['id']){delete _0x5a5490[_0xa57c('0x2a')]['id'];}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')]['from'])){return _0x203375(_0x5ed42d['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x2a')])||_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x2a')]===''){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa57c('0x30')](_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x31')])){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,_0xa57c('0x32')+_0x2112b7));}if(!_[_0xa57c('0x33')](_0x2112b7,_0x5a5490['body'][_0xa57c('0x31')])){return _0x203375(_0x5ed42d[_0xa57c('0x14')](0x1f4,_0xa57c('0x34')+_0x2112b7));}var _0x14e943={};_0x14e943[_0x5a5490[_0xa57c('0x2a')]['mapKey']]=_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')];return db[_0xa57c('0x25')][_0xa57c('0x26')]({'where':{'id':_0x5a5490[_0xa57c('0x36')]['id']},'include':[{'model':db[_0xa57c('0x37')],'as':'List','include':[{'model':db[_0xa57c('0x2e')],'as':_0xa57c('0x38'),'where':_0x14e943,'limit':0x1,'order':[[_0xa57c('0x39'),_0xa57c('0x3a')]]}]},{'model':db[_0xa57c('0x3b')],'as':_0xa57c('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0xa57c('0xe')](function(_0x49492f){if(_0x49492f&&_0x49492f[_0xa57c('0x3d')]){var _0xae87=_0x49492f['get']({'plain':!![]});_0x5af5e9[_0xa57c('0x36')]=_[_0xa57c('0x3e')](_0xae87,[_0xa57c('0x3c'),_0xa57c('0x3d')]);_0x5af5e9[_0xa57c('0x36')]['smtpOptions']=_0x49492f[_0xa57c('0x28')]();_0x5af5e9[_0xa57c('0x3f')]=_0xae87[_0xa57c('0x3c')];_0x5af5e9[_0xa57c('0x40')]=_0xae87[_0xa57c('0x3d')];_0x5af5e9['applications']=_[_0xa57c('0x41')](_0x5af5e9['applications'],['priority'],[_0xa57c('0x42')]);if(_0x5af5e9[_0xa57c('0x36')]&&_0x5af5e9[_0xa57c('0x36')]['autoclose']){_0x5af5e9['applications'][_0xa57c('0x43')]({'id':0x0,'priority':_0x5af5e9[_0xa57c('0x3f')][_0xa57c('0x44')]+0x1,'app':_0xa57c('0x45'),'appdata':'autoclose','interval':_0xa57c('0x46')});}if(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x3c')]){delete _0x5af5e9['account']['Applications'];}if(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x3d')]){delete _0x5af5e9['account'][_0xa57c('0x3d')];}if(_0xae87[_0xa57c('0x3d')][_0xa57c('0x38')][_0xa57c('0x44')]){return _0xae87[_0xa57c('0x3d')][_0xa57c('0x38')][0x0];}var _0x4fc413=_['defaults'](_0x5a5490['body'],{'firstName':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')],'ListId':_0xae87[_0xa57c('0x47')]});_0x4fc413[_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x31')]]=_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x35')];return db[_0xa57c('0x2e')]['create'](_0x4fc413);}else{throw new Error('List\x20not\x20found');}})[_0xa57c('0xe')](function(_0x4e18ad){_0x5af5e9[_0xa57c('0x48')]=_0x4e18ad;if(_0x4e18ad){if(!_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['messageId']){_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x49')]=rs['generate']()+'\x20'+_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x35')];}var _0x26a8e1={'ContactId':_0x4e18ad['id'],'MailAccountId':_0x5a5490['account']['id'],'inReplyTo':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x49')],'to':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['from'],'cc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'lastMsgAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xa57c('0x26')]({'where':{'closed':![],'MailAccountId':_0x5a5490[_0xa57c('0x36')]['id']},'include':[{'model':db[_0xa57c('0x4e')],'as':_0xa57c('0x4f'),'attributes':[_0xa57c('0x49')],'where':{'messageId':_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x50')]}}]})[_0xa57c('0xe')](function(_0x521acc){if(_0x521acc){return[_0x521acc,![]];}return db[_0xa57c('0x51')][_0xa57c('0x52')](_0x26a8e1)[_0xa57c('0xe')](function(_0xa78a75){return[_0xa78a75,!![]];});});}else{throw new Error(_0xa57c('0x53'));}})[_0xa57c('0x54')](function(_0x24efa0,_0x5e1103){if(_0x24efa0){_0x520383=_0x5e1103;if(!_0x5e1103){return _0x24efa0[_0xa57c('0x55')]({'inReplyTo':_0x5a5490['body'][_0xa57c('0x16')]['messageId'],'to':_0x5a5490[_0xa57c('0x2a')]['message'][_0xa57c('0x35')],'cc':_0x5a5490[_0xa57c('0x2a')]['message']['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x24efa0[_0xa57c('0x4b')]?_0x24efa0['attach']:_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'substatus':null,'substatusAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgAt':moment()[_0xa57c('0x4c')](_0xa57c('0x4d')),'lastMsgDirection':'in'});}else{return _0x24efa0;}}})[_0xa57c('0xe')](function(_0x11c13e){_0x5af5e9[_0xa57c('0x56')]=_0x11c13e[_0xa57c('0x57')]({'plain':!![]});_0x5af5e9[_0xa57c('0x56')][_0xa57c('0x58')]=_0x520383;return db[_0xa57c('0x4e')][_0xa57c('0x52')]({'body':_0x5a5490[_0xa57c('0x2a')]['body'],'MailAccountId':_0x5a5490[_0xa57c('0x36')]['id'],'MailInteractionId':_0x11c13e['id'],'direction':'in','ContactId':_0x5af5e9['contact']['id'],'messageId':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x49')],'from':_0x5a5490['body'][_0xa57c('0x16')][_0xa57c('0x35')],'to':_0x5a5490[_0xa57c('0x2a')]['message']['to'],'cc':_0x5a5490['body'][_0xa57c('0x16')]['cc'],'subject':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4a')],'attach':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x4b')],'Attachments':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['attachments'],'originTo':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['originTo'],'originCc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x59')],'bcc':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')][_0xa57c('0x5a')],'ChatWebsiteId':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['ChatWebsiteId']||null,'originChannel':_0x5a5490[_0xa57c('0x2a')][_0xa57c('0x16')]['originChannel']||_0xa57c('0x5b'),'ChatOfflineMessageId':_0x5a5490[_0xa57c('0x2a')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xa57c('0x5c')],'as':_0xa57c('0x5d')}]});})[_0xa57c('0xe')](function(_0x1604d6){_0x5af5e9[_0xa57c('0x16')]=_0x1604d6;if(_0x5af5e9['interaction'][_0xa57c('0x5e')]){return db[_0xa57c('0x5f')][_0xa57c('0x26')]({'attributes':['id','name'],'where':{'id':_0x5af5e9[_0xa57c('0x56')]['UserId']}})[_0xa57c('0xe')](function(_0x2963cb){if(_0x2963cb){_0x5af5e9[_0xa57c('0x3f')][_0xa57c('0x60')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2963cb[_0xa57c('0x61')]+','+(_0x5af5e9[_0xa57c('0x36')][_0xa57c('0x62')]||0xa),'interval':_0xa57c('0x46')});}return respondWithRpcPromise('Start',_0xa57c('0x63'),_0x5af5e9);});}return respondWithRpcPromise(_0xa57c('0x64'),_0xa57c('0x63'),_0x5af5e9);})['then'](function(_0x3da413){_0x5e10b(_0x3da413);})[_0xa57c('0x18')](function(_0x2ed4f4){_0x203375(_0x5ed42d['error'](0x1f4,_0x2ed4f4[_0xa57c('0x16')]));});});}; \ No newline at end of file +var _0x4975=['MailMessage','Messages','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','UserId','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','list','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4975,0x86));var _0x5497=function(_0x2c236f,_0x4eca6b){_0x2c236f=_0x2c236f-0x0;var _0x2f7584=_0x4975[_0x2c236f];return _0x2f7584;};'use strict';var _=require(_0x5497('0x0'));var moment=require('moment');var BPromise=require(_0x5497('0x1'));var rs=require(_0x5497('0x2'));var Redis=require(_0x5497('0x3'));var db=require(_0x5497('0x4'))['db'];var logger=require(_0x5497('0x5'))(_0x5497('0x6'));var config=require(_0x5497('0x7'));var jayson=require(_0x5497('0x8'));var client=jayson[_0x5497('0x9')][_0x5497('0xa')]({'port':0x232c});config['redis']=_[_0x5497('0xb')](config['redis'],{'host':_0x5497('0xc'),'port':0x18eb});var socket=require(_0x5497('0xd'))(new Redis(config[_0x5497('0xe')]));require('./mailAccount.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x49d94b,_0x1f63d8,_0x29c93f){return new BPromise(function(_0x2ec5a4,_0x32a8a2){return client[_0x5497('0x10')](_0x49d94b,_0x29c93f)[_0x5497('0x11')](function(_0x3e7886){logger[_0x5497('0x12')]('MailAccount,\x20%s,\x20%s',_0x1f63d8,'request\x20sent');logger['debug'](_0x5497('0x13'),_0x1f63d8,_0x5497('0x14'),JSON[_0x5497('0x15')](_0x3e7886));if(_0x3e7886[_0x5497('0x16')]){if(_0x3e7886[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x32a8a2(_0x3e7886['error'][_0x5497('0x19')]);}logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);return _0x2ec5a4(_0x3e7886[_0x5497('0x16')][_0x5497('0x19')]);}else{logger[_0x5497('0x12')](_0x5497('0x18'),_0x1f63d8,'request\x20sent');_0x2ec5a4(_0x3e7886['result'][_0x5497('0x19')]);}})[_0x5497('0x1a')](function(_0x3a47fd){logger['error'](_0x5497('0x18'),_0x1f63d8,_0x3a47fd);_0x32a8a2(_0x3a47fd);});});}exports[_0x5497('0x1b')]=function(_0x18e8a8){var _0x43da2c=this;return new Promise(function(_0x1b1b43,_0x1f6f18){return db[_0x5497('0x1c')][_0x5497('0x1d')]({'raw':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x18e8a8['options']?_0x18e8a8[_0x5497('0x1e')]['where']||null:null,'attributes':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'limit':_0x18e8a8[_0x5497('0x1e')]?_0x18e8a8[_0x5497('0x1e')][_0x5497('0x21')]||null:null,'include':_0x18e8a8['options']?_0x18e8a8['options'][_0x5497('0x22')]?_[_0x5497('0x23')](_0x18e8a8[_0x5497('0x1e')][_0x5497('0x22')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x24')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x22')]?_[_0x5497('0x23')](_0x5223b5[_0x5497('0x22')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x24')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x20')],'include':_0x34a1a5['include']?_[_0x5497('0x23')](_0x34a1a5['include'],function(_0x583d06){return{'model':db[_0x583d06['model']],'as':_0x583d06['as'],'attributes':_0x583d06[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9356){logger[_0x5497('0x12')](_0x5497('0x1b'),_0x18e8a8);logger[_0x5497('0x25')]('GetMailAccount',_0x18e8a8,JSON['stringify'](_0x5e9356));_0x1b1b43(_0x5e9356);})['catch'](function(_0x371874){logger[_0x5497('0x16')](_0x5497('0x1b'),_0x371874['message'],_0x18e8a8);_0x1f6f18(_0x43da2c['error'](0x1f4,_0x371874['message']));});});};exports[_0x5497('0x26')]=function(_0x572460){var _0x438ee4=this;return new Promise(function(_0x258c2d,_0x77c575){return db['MailAccount'][_0x5497('0x27')]({'raw':_0x572460[_0x5497('0x1e')]?_0x572460['options'][_0x5497('0x1f')]===undefined?!![]:![]:!![],'where':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['where']||null:null,'attributes':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')][_0x5497('0x20')]||null:null,'include':_0x572460[_0x5497('0x1e')]?_0x572460[_0x5497('0x1e')]['include']?_[_0x5497('0x23')](_0x572460[_0x5497('0x1e')]['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x24')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x20')],'include':_0x1ffc9b[_0x5497('0x22')]?_[_0x5497('0x23')](_0x1ffc9b[_0x5497('0x22')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x24')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes'],'include':_0x580e86[_0x5497('0x22')]?_[_0x5497('0x23')](_0x580e86[_0x5497('0x22')],function(_0x5ab18c){return{'model':db[_0x5ab18c['model']],'as':_0x5ab18c['as'],'attributes':_0x5ab18c[_0x5497('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5497('0x11')](function(_0x326d48){if(_0x572460[_0x5497('0x1e')][_0x5497('0x28')]===!![])_0x326d48[_0x5497('0x29')]('smtpOptions',_0x326d48[_0x5497('0x2a')]());logger[_0x5497('0x12')](_0x5497('0x26'),_0x572460);logger[_0x5497('0x25')](_0x5497('0x26'),_0x572460,JSON[_0x5497('0x15')](_0x326d48));_0x258c2d(_0x326d48);})[_0x5497('0x1a')](function(_0x179635){logger[_0x5497('0x16')]('ShowMailAccount',_0x179635[_0x5497('0x19')],_0x572460);_0x77c575(_0x438ee4[_0x5497('0x16')](0x1f4,_0x179635[_0x5497('0x19')]));});});};exports[_0x5497('0x2b')]=function(_0x15029d){var _0xa5ebe6=this;return new Promise(function(_0x4299be,_0x59ed13){var _0x3e5f7d={'body':_0x15029d[_0x5497('0x2c')],'channel':_0x5497('0x2d')};var _0x35993c=_[_0x5497('0x2e')](_[_0x5497('0x2f')](db[_0x5497('0x30')]['rawAttributes']),[_0x5497('0x31'),_0x5497('0x32'),_0x5497('0x33'),_0x5497('0x34')]);var _0x20e947=![];if(_0x15029d[_0x5497('0x2c')]['id']){delete _0x15029d[_0x5497('0x2c')]['id'];}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')][_0x5497('0x36')])){return _0x59ed13(_0xa5ebe6['error'](0x1f4,_0x5497('0x37')));}if(_['isNil'](_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')])||_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')]===''){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5497('0x35')](_0x15029d[_0x5497('0x2c')]['mapKey'])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35993c));}if(!_[_0x5497('0x38')](_0x35993c,_0x15029d['body'][_0x5497('0x39')])){return _0x59ed13(_0xa5ebe6[_0x5497('0x16')](0x1f4,_0x5497('0x3a')+_0x35993c));}var _0x3a852a={};_0x3a852a[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body']['from'];return db['MailAccount'][_0x5497('0x27')]({'where':{'id':_0x15029d[_0x5497('0x3b')]['id']},'include':[{'model':db[_0x5497('0x3c')],'as':_0x5497('0x3d'),'include':[{'model':db[_0x5497('0x30')],'as':_0x5497('0x3e'),'where':_0x3a852a,'limit':0x1,'order':[[_0x5497('0x32'),_0x5497('0x3f')]]}]},{'model':db[_0x5497('0x40')],'as':'Applications'},{'model':db[_0x5497('0x41')],'as':_0x5497('0x42'),'include':[{'model':db[_0x5497('0x43')],'as':'CloudProvider'}]}]})[_0x5497('0x11')](function(_0x530475){if(_0x530475&&_0x530475[_0x5497('0x3d')]){var _0x31f1ba=_0x530475[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d['account']=_[_0x5497('0x45')](_0x31f1ba,[_0x5497('0x46'),'List']);_0x3e5f7d[_0x5497('0x3b')]['smtpOptions']=_0x530475[_0x5497('0x2a')]();_0x3e5f7d['applications']=_0x31f1ba[_0x5497('0x46')];_0x3e5f7d[_0x5497('0x47')]=_0x31f1ba[_0x5497('0x3d')];_0x3e5f7d[_0x5497('0x48')]=_[_0x5497('0x49')](_0x3e5f7d[_0x5497('0x48')],[_0x5497('0x4a')],[_0x5497('0x4b')]);if(_0x3e5f7d['account']&&_0x3e5f7d[_0x5497('0x3b')]['autoclose']){_0x3e5f7d['applications'][_0x5497('0x4c')]({'id':0x0,'priority':_0x3e5f7d[_0x5497('0x48')]['length']+0x1,'app':_0x5497('0x4d'),'appdata':_0x5497('0x4e'),'interval':_0x5497('0x4f')});}if(_0x3e5f7d[_0x5497('0x3b')]['Applications']){delete _0x3e5f7d[_0x5497('0x3b')]['Applications'];}if(_0x3e5f7d['account'][_0x5497('0x3d')]){delete _0x3e5f7d[_0x5497('0x3b')][_0x5497('0x3d')];}if(_0x31f1ba['List']['Contacts'][_0x5497('0x50')]){return _0x31f1ba['List'][_0x5497('0x3e')][0x0];}var _0x530431=_[_0x5497('0xb')](_0x15029d['body'],{'firstName':_0x15029d[_0x5497('0x2c')][_0x5497('0x36')],'ListId':_0x31f1ba['ListId']});_0x530431[_0x15029d[_0x5497('0x2c')]['mapKey']]=_0x15029d['body'][_0x5497('0x36')];return db[_0x5497('0x30')]['create'](_0x530431);}else{throw new Error(_0x5497('0x51'));}})[_0x5497('0x11')](function(_0x1dbab2){_0x3e5f7d[_0x5497('0x52')]=_0x1dbab2;if(_0x1dbab2){if(!_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId']){_0x15029d[_0x5497('0x2c')]['message']['messageId']=rs['generate']()+'\x20'+_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')];}var _0x544085={'ContactId':_0x1dbab2['id'],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'inReplyTo':_0x15029d['body']['message'][_0x5497('0x53')],'to':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['attach'],'lastMsgAt':moment()[_0x5497('0x55')](_0x5497('0x56')),'lastMsgDirection':'in'};return db[_0x5497('0x57')][_0x5497('0x27')]({'where':{'closed':![],'MailAccountId':_0x15029d['account']['id']},'include':[{'model':db[_0x5497('0x58')],'as':_0x5497('0x59'),'attributes':[_0x5497('0x53')],'where':{'messageId':_0x15029d['body'][_0x5497('0x19')]['inReplyTo']}}]})['then'](function(_0x53e050){if(_0x53e050){return[_0x53e050,![]];}return db[_0x5497('0x57')][_0x5497('0x5a')](_0x544085)[_0x5497('0x11')](function(_0x4e7d4c){return[_0x4e7d4c,!![]];});});}else{throw new Error(_0x5497('0x5b'));}})[_0x5497('0x5c')](function(_0x3cfebc,_0x35e75a){if(_0x3cfebc){_0x20e947=_0x35e75a;if(!_0x35e75a){return _0x3cfebc['update']({'inReplyTo':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x53')],'to':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x36')],'cc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x54')],'attach':_0x3cfebc['attach']?_0x3cfebc[_0x5497('0x5d')]:_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5497('0x56')),'lastMsgDirection':'in'});}else{return _0x3cfebc;}}})[_0x5497('0x11')](function(_0x179bbc){_0x3e5f7d['interaction']=_0x179bbc[_0x5497('0x44')]({'plain':!![]});_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x5f')]=_0x20e947;return db[_0x5497('0x58')][_0x5497('0x5a')]({'body':_0x15029d[_0x5497('0x2c')][_0x5497('0x2c')],'MailAccountId':_0x15029d[_0x5497('0x3b')]['id'],'MailInteractionId':_0x179bbc['id'],'direction':'in','ContactId':_0x3e5f7d[_0x5497('0x52')]['id'],'messageId':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['messageId'],'from':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x36')],'to':_0x15029d['body'][_0x5497('0x19')]['to'],'cc':_0x15029d['body'][_0x5497('0x19')]['cc'],'subject':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x54')],'attach':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x5d')],'Attachments':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x60')],'originTo':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x61')],'originCc':_0x15029d[_0x5497('0x2c')]['message'][_0x5497('0x62')],'bcc':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')]['bcc'],'ChatWebsiteId':_0x15029d['body'][_0x5497('0x19')][_0x5497('0x63')]||null,'originChannel':_0x15029d[_0x5497('0x2c')][_0x5497('0x19')][_0x5497('0x64')]||_0x5497('0x65'),'ChatOfflineMessageId':_0x15029d[_0x5497('0x2c')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5497('0x66')],'as':_0x5497('0x67')}]});})['then'](function(_0x15ca59){_0x3e5f7d[_0x5497('0x19')]=_0x15ca59;if(_0x3e5f7d[_0x5497('0x5e')]['UserId']){return db[_0x5497('0x68')][_0x5497('0x27')]({'attributes':['id','name'],'where':{'id':_0x3e5f7d[_0x5497('0x5e')][_0x5497('0x69')]}})[_0x5497('0x11')](function(_0x42d745){if(_0x42d745){_0x3e5f7d[_0x5497('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5497('0x6a'),'appdata':_0x42d745[_0x5497('0x6b')]+','+(_0x3e5f7d[_0x5497('0x3b')][_0x5497('0x6c')]||0xa),'interval':_0x5497('0x4f')});}return respondWithRpcPromise('Start',_0x5497('0x6d'),_0x3e5f7d);});}return respondWithRpcPromise(_0x5497('0x6e'),_0x5497('0x6d'),_0x3e5f7d);})[_0x5497('0x11')](function(_0x521d74){_0x4299be(_0x521d74);})[_0x5497('0x1a')](function(_0x21fc4e){_0x59ed13(_0xa5ebe6['error'](0x1f4,_0x21fc4e[_0x5497('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index e5c120a..b4e17a4 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 _0xebda=['register','save','remove','update','emit','removeListener'];(function(_0x1cd8ed,_0x16aed0){var _0x259a1d=function(_0x3bcb0e){while(--_0x3bcb0e){_0x1cd8ed['push'](_0x1cd8ed['shift']());}};_0x259a1d(++_0x16aed0);}(_0xebda,0xa9));var _0xaebd=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0xebda[_0x11ca63];return _0x41f1f6;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xaebd('0x0'),_0xaebd('0x1'),_0xaebd('0x2')];function createListener(_0x291f54,_0x3e1bef){return function(_0x51e3b9){_0x3e1bef[_0xaebd('0x3')](_0x291f54,_0x51e3b9);};}function removeListener(_0x386803,_0x181179){return function(){MailAccountEvents[_0xaebd('0x4')](_0x386803,_0x181179);};}exports[_0xaebd('0x5')]=function(_0x1c3c78){for(var _0x21373f=0x0,_0x15208d=events['length'];_0x21373f<_0x15208d;_0x21373f++){var _0x14accd=events[_0x21373f];var _0x428123=createListener('mailAccount:'+_0x14accd,_0x1c3c78);MailAccountEvents['on'](_0x14accd,_0x428123);}}; \ No newline at end of file +var _0x723b=['./mailAccount.events','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x102c7d,_0x5a1a2d){var _0x16af17=function(_0x18447a){while(--_0x18447a){_0x102c7d['push'](_0x102c7d['shift']());}};_0x16af17(++_0x5a1a2d);}(_0x723b,0x120));var _0xb723=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x723b[_0x14add3];return _0x4a174f;};'use strict';var MailAccountEvents=require(_0xb723('0x0'));var events=['save',_0xb723('0x1'),_0xb723('0x2')];function createListener(_0x174476,_0x395c17){return function(_0x1c5e28){_0x395c17[_0xb723('0x3')](_0x174476,_0x1c5e28);};}function removeListener(_0x1c0b67,_0x46e339){return function(){MailAccountEvents[_0xb723('0x4')](_0x1c0b67,_0x46e339);};}exports[_0xb723('0x5')]=function(_0xbdc793){for(var _0x1c5890=0x0,_0x5b34e2=events[_0xb723('0x6')];_0x1c5890<_0x5b34e2;_0x1c5890++){var _0x1389f4=events[_0x1c5890];var _0x1aec20=createListener(_0xb723('0x7')+_0x1389f4,_0xbdc793);MailAccountEvents['on'](_0x1389f4,_0x1aec20);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3fe59ab..07d40d8 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 _0xc078=['../../config/environment','get','isAuthenticated','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2327a3,_0x3df393){var _0x30abfa=function(_0x4e5395){while(--_0x4e5395){_0x2327a3['push'](_0x2327a3['shift']());}};_0x30abfa(++_0x3df393);}(_0xc078,0x14b));var _0x8c07=function(_0x5d5cef,_0x47e75d){_0x5d5cef=_0x5d5cef-0x0;var _0x599ac3=_0xc078[_0x5d5cef];return _0x599ac3;};'use strict';var multer=require(_0x8c07('0x0'));var util=require(_0x8c07('0x1'));var path=require('path');var timeout=require(_0x8c07('0x2'));var express=require(_0x8c07('0x3'));var router=express['Router']();var fs_extra=require(_0x8c07('0x4'));var auth=require(_0x8c07('0x5'));var interaction=require(_0x8c07('0x6'));var config=require(_0x8c07('0x7'));var controller=require('./mailApplication.controller');router[_0x8c07('0x8')]('/:id',auth[_0x8c07('0x9')](),controller['show']);router[_0x8c07('0xa')]('/:id',auth[_0x8c07('0x9')](),controller['update']);router['delete']('/:id',auth[_0x8c07('0x9')](),controller[_0x8c07('0xb')]);module[_0x8c07('0xc')]=router; \ No newline at end of file +var _0xb565=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put'];(function(_0x507021,_0x3142e2){var _0x2a2c00=function(_0x55b424){while(--_0x55b424){_0x507021['push'](_0x507021['shift']());}};_0x2a2c00(++_0x3142e2);}(_0xb565,0x1d4));var _0x5b56=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xb565[_0x44216d];return _0xeca523;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b56('0x0'));var timeout=require(_0x5b56('0x1'));var express=require(_0x5b56('0x2'));var router=express[_0x5b56('0x3')]();var fs_extra=require(_0x5b56('0x4'));var auth=require(_0x5b56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b56('0x6'));var controller=require(_0x5b56('0x7'));router[_0x5b56('0x8')](_0x5b56('0x9'),auth[_0x5b56('0xa')](),controller['show']);router[_0x5b56('0xb')](_0x5b56('0x9'),auth[_0x5b56('0xa')](),controller[_0x5b56('0xc')]);router[_0x5b56('0xd')](_0x5b56('0x9'),auth['isAuthenticated'](),controller[_0x5b56('0xe')]);module[_0x5b56('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 1784cd0..78013fd 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 _0xcfc7=['TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x265ee5,_0x4c754c){var _0x2745da=function(_0x568722){while(--_0x568722){_0x265ee5['push'](_0x265ee5['shift']());}};_0x2745da(++_0x4c754c);}(_0xcfc7,0xe3));var _0x7cfc=function(_0x73dee5,_0x1c9320){_0x73dee5=_0x73dee5-0x0;var _0x23e0c8=_0xcfc7[_0x73dee5];return _0x23e0c8;};'use strict';var Sequelize=require(_0x7cfc('0x0'));module[_0x7cfc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7cfc('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7cfc('0x3')]()},'description':{'type':Sequelize[_0x7cfc('0x2')]},'interval':{'type':Sequelize[_0x7cfc('0x2')],'defaultValue':_0x7cfc('0x4')}}; \ No newline at end of file +var _0x8752=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0x8752,0x110));var _0x2875=function(_0x2802bd,_0xbcf404){_0x2802bd=_0x2802bd-0x0;var _0x5e8e68=_0x8752[_0x2802bd];return _0x5e8e68;};'use strict';var Sequelize=require(_0x2875('0x0'));module[_0x2875('0x1')]={'priority':{'type':Sequelize[_0x2875('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2875('0x3')],'allowNull':![],'defaultValue':_0x2875('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2875('0x3')]},'interval':{'type':Sequelize[_0x2875('0x3')],'defaultValue':_0x2875('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4065b8b..7de19a3 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x7123b9,_0x56dcf7){var _0x1eb7a2=function(_0x1635f8){while(--_0x1635f8){_0x7123b9['push'](_0x7123b9['shift']());}};_0x1eb7a2(++_0x56dcf7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5b7a82,_0x5a904a){_0x5b7a82=_0x5b7a82-0x0;var _0x57d755=_0xb43b[_0x5b7a82];return _0x57d755;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x2be569,_0x282492){var _0x457268=function(_0x1631de){while(--_0x1631de){_0x2be569['push'](_0x2be569['shift']());}};_0x457268(++_0x282492);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 79e6744..3d00cd3 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 _0xcadd=['moment','bluebird','path','rimraf','../../config/environment','MailApplication','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4c8d01,_0x3be15b){var _0x2824a2=function(_0x1bec34){while(--_0x1bec34){_0x4c8d01['push'](_0x4c8d01['shift']());}};_0x2824a2(++_0x3be15b);}(_0xcadd,0x11a));var _0xdcad=function(_0xba9e5e,_0x4aa239){_0xba9e5e=_0xba9e5e-0x0;var _0x4d0001=_0xcadd[_0xba9e5e];return _0x4d0001;};'use strict';var _=require(_0xdcad('0x0'));var util=require(_0xdcad('0x1'));var logger=require(_0xdcad('0x2'))(_0xdcad('0x3'));var moment=require(_0xdcad('0x4'));var BPromise=require(_0xdcad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcad('0x6'));var rimraf=require(_0xdcad('0x7'));var config=require(_0xdcad('0x8'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x44ac71,_0x54e30e){return _0x44ac71['define'](_0xdcad('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdcad('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd4db=['bluebird','request-promise','path','rimraf','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x1bd893,_0x45bf29){var _0x4e6e46=function(_0x3d0424){while(--_0x3d0424){_0x1bd893['push'](_0x1bd893['shift']());}};_0x4e6e46(++_0x45bf29);}(_0xd4db,0xc0));var _0xbd4d=function(_0x44b089,_0x5c35f0){_0x44b089=_0x44b089-0x0;var _0x20cbd2=_0xd4db[_0x44b089];return _0x20cbd2;};'use strict';var _=require('lodash');var util=require(_0xbd4d('0x0'));var logger=require(_0xbd4d('0x1'))(_0xbd4d('0x2'));var moment=require(_0xbd4d('0x3'));var BPromise=require(_0xbd4d('0x4'));var rp=require(_0xbd4d('0x5'));var fs=require('fs');var path=require(_0xbd4d('0x6'));var rimraf=require(_0xbd4d('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xbd4d('0x8')]=function(_0x115568,_0x5f1593){return _0x115568[_0xbd4d('0x9')](_0xbd4d('0xa'),attributes,{'tableName':_0xbd4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd4d('0xc'),'collate':_0xbd4d('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6dadfcd..9b9cc8e 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 _0xbb51=['error','message','result','catch','UpdateMailApplication','body','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xbb51,0x13f));var _0x1bb5=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbb51[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x1bb5('0x0'));var util=require(_0x1bb5('0x1'));var moment=require(_0x1bb5('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb5('0x3'));var fs=require('fs');var Redis=require(_0x1bb5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bb5('0x5'));var logger=require('../../config/logger')(_0x1bb5('0x6'));var config=require('../../config/environment');var jayson=require(_0x1bb5('0x7'));var client=jayson['client'][_0x1bb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e3079,_0x49dd17,_0x58413c){return new BPromise(function(_0x3f9708,_0x4d4714){return client[_0x1bb5('0x9')](_0x5e3079,_0x58413c)[_0x1bb5('0xa')](function(_0xb3cc63){logger[_0x1bb5('0xb')](_0x1bb5('0xc'),_0x49dd17,'request\x20sent');logger[_0x1bb5('0xd')](_0x1bb5('0xe'),_0x49dd17,_0x1bb5('0xf'),JSON[_0x1bb5('0x10')](_0xb3cc63));if(_0xb3cc63['error']){if(_0xb3cc63['error']['code']===0x1f4){logger[_0x1bb5('0x11')]('MailApplication,\x20%s,\x20%s',_0x49dd17,_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);return _0x4d4714(_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);}logger[_0x1bb5('0x11')](_0x1bb5('0xc'),_0x49dd17,_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);return _0x3f9708(_0xb3cc63[_0x1bb5('0x11')][_0x1bb5('0x12')]);}else{logger[_0x1bb5('0xb')](_0x1bb5('0xc'),_0x49dd17,_0x1bb5('0xf'));_0x3f9708(_0xb3cc63[_0x1bb5('0x13')][_0x1bb5('0x12')]);}})[_0x1bb5('0x14')](function(_0x58b658){logger['error'](_0x1bb5('0xc'),_0x49dd17,_0x58b658);_0x4d4714(_0x58b658);});});}exports[_0x1bb5('0x15')]=function(_0x44b55e){var _0x327def=this;return new Promise(function(_0x222f95,_0x23f3ef){return db['MailApplication']['update'](_0x44b55e[_0x1bb5('0x16')],{'raw':_0x44b55e['options']?_0x44b55e[_0x1bb5('0x17')][_0x1bb5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44b55e[_0x1bb5('0x17')]?_0x44b55e[_0x1bb5('0x17')][_0x1bb5('0x19')]||null:null,'attributes':_0x44b55e[_0x1bb5('0x17')]?_0x44b55e[_0x1bb5('0x17')][_0x1bb5('0x1a')]||null:null,'limit':_0x44b55e[_0x1bb5('0x17')]?_0x44b55e[_0x1bb5('0x17')][_0x1bb5('0x1b')]||null:null})[_0x1bb5('0xa')](function(_0x4e690a){logger[_0x1bb5('0xb')]('UpdateMailApplication',_0x44b55e);logger['debug'](_0x1bb5('0x15'),_0x44b55e,JSON[_0x1bb5('0x10')](_0x4e690a));_0x222f95(_0x4e690a);})[_0x1bb5('0x14')](function(_0xa2d0b4){logger['error'](_0x1bb5('0x15'),_0xa2d0b4[_0x1bb5('0x12')],_0x44b55e);_0x23f3ef(_0x327def[_0x1bb5('0x11')](0x1f4,_0xa2d0b4[_0x1bb5('0x12')]));});});}; \ No newline at end of file +var _0x0789=['message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5e93f9,_0x99acd3){var _0x29e222=function(_0x269154){while(--_0x269154){_0x5e93f9['push'](_0x5e93f9['shift']());}};_0x29e222(++_0x99acd3);}(_0x0789,0x124));var _0x9078=function(_0x19ce0b,_0x17f6f7){_0x19ce0b=_0x19ce0b-0x0;var _0x4b3b64=_0x0789[_0x19ce0b];return _0x4b3b64;};'use strict';var _=require(_0x9078('0x0'));var util=require(_0x9078('0x1'));var moment=require('moment');var BPromise=require(_0x9078('0x2'));var rs=require(_0x9078('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9078('0x4'))['db'];var utils=require(_0x9078('0x5'));var logger=require(_0x9078('0x6'))(_0x9078('0x7'));var config=require(_0x9078('0x8'));var jayson=require(_0x9078('0x9'));var client=jayson[_0x9078('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd4f970,_0xd04852,_0x52be03){return new BPromise(function(_0x2e1382,_0x59103c){return client[_0x9078('0xb')](_0xd4f970,_0x52be03)[_0x9078('0xc')](function(_0x5ad99f){logger['info'](_0x9078('0xd'),_0xd04852,_0x9078('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0xd04852,_0x9078('0xe'),JSON[_0x9078('0xf')](_0x5ad99f));if(_0x5ad99f['error']){if(_0x5ad99f[_0x9078('0x10')][_0x9078('0x11')]===0x1f4){logger['error'](_0x9078('0xd'),_0xd04852,_0x5ad99f[_0x9078('0x10')][_0x9078('0x12')]);return _0x59103c(_0x5ad99f[_0x9078('0x10')][_0x9078('0x12')]);}logger[_0x9078('0x10')](_0x9078('0xd'),_0xd04852,_0x5ad99f['error'][_0x9078('0x12')]);return _0x2e1382(_0x5ad99f[_0x9078('0x10')][_0x9078('0x12')]);}else{logger[_0x9078('0x13')]('MailApplication,\x20%s,\x20%s',_0xd04852,_0x9078('0xe'));_0x2e1382(_0x5ad99f[_0x9078('0x14')][_0x9078('0x12')]);}})[_0x9078('0x15')](function(_0x34881d){logger[_0x9078('0x10')](_0x9078('0xd'),_0xd04852,_0x34881d);_0x59103c(_0x34881d);});});}exports[_0x9078('0x16')]=function(_0x4161a8){var _0x4d280b=this;return new Promise(function(_0x3346a2,_0x4cdec0){return db[_0x9078('0x17')][_0x9078('0x18')](_0x4161a8[_0x9078('0x19')],{'raw':_0x4161a8[_0x9078('0x1a')]?_0x4161a8[_0x9078('0x1a')][_0x9078('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4161a8['options']?_0x4161a8[_0x9078('0x1a')]['where']||null:null,'attributes':_0x4161a8[_0x9078('0x1a')]?_0x4161a8[_0x9078('0x1a')][_0x9078('0x1c')]||null:null,'limit':_0x4161a8['options']?_0x4161a8[_0x9078('0x1a')][_0x9078('0x1d')]||null:null})[_0x9078('0xc')](function(_0x535b73){logger[_0x9078('0x13')](_0x9078('0x16'),_0x4161a8);logger[_0x9078('0x1e')](_0x9078('0x16'),_0x4161a8,JSON[_0x9078('0xf')](_0x535b73));_0x3346a2(_0x535b73);})['catch'](function(_0x1dace8){logger['error'](_0x9078('0x16'),_0x1dace8['message'],_0x4161a8);_0x4cdec0(_0x4d280b['error'](0x1f4,_0x1dace8[_0x9078('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d3ba6f0..9004c4e 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 _0x09b2=['exports','express','Router','../../components/auth/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','show','getMessages','/:id/download','create','post','/:id/messages','addMessage','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','/:id','destroy','/:id/tags'];(function(_0x50d8da,_0xe56e5b){var _0x1b55bb=function(_0x5c15eb){while(--_0x5c15eb){_0x50d8da['push'](_0x50d8da['shift']());}};_0x1b55bb(++_0xe56e5b);}(_0x09b2,0xfb));var _0x209b=function(_0x4cd22f,_0x57c3ea){_0x4cd22f=_0x4cd22f-0x0;var _0x2342d3=_0x09b2[_0x4cd22f];return _0x2342d3;};'use strict';var express=require(_0x209b('0x0'));var router=express[_0x209b('0x1')]();var auth=require(_0x209b('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x209b('0x3'));router['get']('/',auth[_0x209b('0x4')](),controller['index']);router[_0x209b('0x5')](_0x209b('0x6'),auth[_0x209b('0x4')](),controller[_0x209b('0x7')]);router['get']('/:id',auth[_0x209b('0x4')](),controller[_0x209b('0x8')]);router['get']('/:id/messages',auth[_0x209b('0x4')](),controller[_0x209b('0x9')]);router[_0x209b('0x5')](_0x209b('0xa'),auth[_0x209b('0x4')](),controller['download']);router['post']('/',auth[_0x209b('0x4')](),controller[_0x209b('0xb')]);router[_0x209b('0xc')](_0x209b('0xd'),auth[_0x209b('0x4')](),controller[_0x209b('0xe')]);router['post']('/:id/tags',auth[_0x209b('0x4')](),interaction['tracked'](_0x209b('0xf'),_0x209b('0x10')),controller[_0x209b('0x11')]);router[_0x209b('0x12')]('/:id',auth[_0x209b('0x4')](),interaction[_0x209b('0x13')](_0x209b('0xf'),_0x209b('0x14')),controller['update']);router['delete'](_0x209b('0x15'),auth[_0x209b('0x4')](),interaction[_0x209b('0x13')](_0x209b('0xf'),'mailinteraction:destroy'),controller[_0x209b('0x16')]);router['delete'](_0x209b('0x17'),auth[_0x209b('0x4')](),controller['removeTags']);module[_0x209b('0x18')]=router; \ No newline at end of file +var _0xf58c=['post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','download'];(function(_0x9ef091,_0x34a376){var _0x285868=function(_0x159430){while(--_0x159430){_0x9ef091['push'](_0x9ef091['shift']());}};_0x285868(++_0x34a376);}(_0xf58c,0x66));var _0xcf58=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xf58c[_0x2ef44b];return _0x2405b9;};'use strict';var express=require(_0xcf58('0x0'));var router=express[_0xcf58('0x1')]();var auth=require(_0xcf58('0x2'));var interaction=require(_0xcf58('0x3'));var controller=require(_0xcf58('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xcf58('0x5')]);router[_0xcf58('0x6')](_0xcf58('0x7'),auth[_0xcf58('0x8')](),controller[_0xcf58('0x9')]);router['get'](_0xcf58('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcf58('0x6')](_0xcf58('0xb'),auth[_0xcf58('0x8')](),controller[_0xcf58('0xc')]);router[_0xcf58('0x6')]('/:id/download',auth[_0xcf58('0x8')](),controller[_0xcf58('0xd')]);router[_0xcf58('0xe')]('/',auth[_0xcf58('0x8')](),controller[_0xcf58('0xf')]);router['post']('/:id/messages',auth[_0xcf58('0x8')](),controller[_0xcf58('0x10')]);router[_0xcf58('0xe')](_0xcf58('0x11'),auth[_0xcf58('0x8')](),interaction[_0xcf58('0x12')]('mail',_0xcf58('0x13')),controller[_0xcf58('0x14')]);router[_0xcf58('0x15')]('/:id',auth[_0xcf58('0x8')](),interaction[_0xcf58('0x12')]('mail',_0xcf58('0x16')),controller[_0xcf58('0x17')]);router[_0xcf58('0x18')](_0xcf58('0xa'),auth[_0xcf58('0x8')](),interaction[_0xcf58('0x12')](_0xcf58('0x19'),_0xcf58('0x1a')),controller[_0xcf58('0x1b')]);router[_0xcf58('0x18')](_0xcf58('0x11'),auth[_0xcf58('0x8')](),controller['removeTags']);module[_0xcf58('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f22ddb0..ebb602e 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 _0xabe7=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x4bb485,_0x1ca047){var _0x1cb8b5=function(_0x492ec2){while(--_0x492ec2){_0x4bb485['push'](_0x4bb485['shift']());}};_0x1cb8b5(++_0x1ca047);}(_0xabe7,0xce));var _0x7abe=function(_0x12aac3,_0x2b6837){_0x12aac3=_0x12aac3-0x0;var _0x4b048c=_0xabe7[_0x12aac3];return _0x4b048c;};'use strict';var Sequelize=require(_0x7abe('0x0'));var iconv=require(_0x7abe('0x1'));module[_0x7abe('0x2')]={'closed':{'type':Sequelize[_0x7abe('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7abe('0x4')]},'disposition':{'type':Sequelize[_0x7abe('0x5')]},'secondDisposition':{'type':Sequelize[_0x7abe('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7abe('0x5')]},'note':{'type':Sequelize[_0x7abe('0x5')]},'inReplyTo':{'type':Sequelize[_0x7abe('0x5')](0x1fe)},'to':{'type':Sequelize[_0x7abe('0x5')]},'cc':{'type':Sequelize[_0x7abe('0x6')](_0x7abe('0x7'))},'subject':{'type':Sequelize[_0x7abe('0x6')]()},'attach':{'type':Sequelize[_0x7abe('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7abe('0x4')]},'substatus':{'type':Sequelize[_0x7abe('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7abe('0x8')]('in',_0x7abe('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7abe('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7abe('0x8')]('in',_0x7abe('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7abe('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3544=['DATE','out','sequelize','exports','BOOLEAN','STRING','TEXT'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0x3544,0x121));var _0x4354=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3544[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x4354('0x0'));var iconv=require('iconv');module[_0x4354('0x1')]={'closed':{'type':Sequelize[_0x4354('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4354('0x3')]},'secondDisposition':{'type':Sequelize[_0x4354('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4354('0x3')]},'note':{'type':Sequelize[_0x4354('0x3')]},'inReplyTo':{'type':Sequelize[_0x4354('0x3')](0x1fe)},'to':{'type':Sequelize[_0x4354('0x3')]},'cc':{'type':Sequelize[_0x4354('0x4')]('long')},'subject':{'type':Sequelize[_0x4354('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4354('0x5')]},'substatus':{'type':Sequelize[_0x4354('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4354('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4354('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4354('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 241cf38..2ddeb34 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 _0xda2a=['ids','getMessages','findOne','hasOwnProperty','sort','pick','where','MailInteractionId','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','rows','setTags','omit','Tag','emit','mailInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','push','Attachment','Messages','from','bcc','get','mkdirSync','each','missing.recipient@your.company.com','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','type','writeFileSync','message%d.eml','download','unlinkSync','eml-format','zip-dir','moment','util','path','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','sendStatus','stack','name','send','MailInteraction','fieldName','key','getOptions','findAll','query','user','catch','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xda2a,0x173));var _0xada2=function(_0x4eaf20,_0x2aef3c){_0x4eaf20=_0x4eaf20-0x0;var _0x1c29b2=_0xda2a[_0x4eaf20];return _0x1c29b2;};'use strict';var emlformat=require(_0xada2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xada2('0x1'));var moment=require(_0xada2('0x2'));var BPromise=require('bluebird');var util=require(_0xada2('0x3'));var path=require(_0xada2('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xada2('0x5'));var logger=require(_0xada2('0x6'))(_0xada2('0x7'));var config=require(_0xada2('0x8'));var db=require(_0xada2('0x9'))['db'];var htmlEntities=require('html-entities');config[_0xada2('0xa')]=_[_0xada2('0xb')](config[_0xada2('0xa')],{'host':_0xada2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xada2('0xa')]));require(_0xada2('0xd'))[_0xada2('0xe')](socket);function respondWithStatusCode(_0x3d1d84,_0x2c49b0){_0x2c49b0=_0x2c49b0||0xcc;return function(_0x40bab8){if(_0x40bab8){return _0x3d1d84['sendStatus'](_0x2c49b0);}return _0x3d1d84[_0xada2('0xf')](_0x2c49b0)[_0xada2('0x10')]();};}function respondWithResult(_0x41ee21,_0x352725){_0x352725=_0x352725||0xc8;return function(_0x48f865){if(_0x48f865){return _0x41ee21[_0xada2('0xf')](_0x352725)[_0xada2('0x11')](_0x48f865);}};}function respondWithFilteredResult(_0x2a3e7b,_0x10491e){return function(_0x461ac7){if(_0x461ac7){var _0x2e950e=typeof _0x10491e[_0xada2('0x12')]===_0xada2('0x13')&&typeof _0x10491e['limit']===_0xada2('0x13');var _0x3bd4cf=_0x461ac7[_0xada2('0x14')];var _0x26e8f6=_0x2e950e?0x0:_0x10491e[_0xada2('0x12')];var _0x1c56fd=_0x2e950e?_0x461ac7[_0xada2('0x14')]:_0x10491e[_0xada2('0x12')]+_0x10491e[_0xada2('0x15')];var _0xda691e;if(_0x1c56fd>=_0x3bd4cf){_0x1c56fd=_0x3bd4cf;_0xda691e=0xc8;}else{_0xda691e=0xce;}_0x2a3e7b[_0xada2('0xf')](_0xda691e);return _0x2a3e7b['set'](_0xada2('0x16'),_0x26e8f6+'-'+_0x1c56fd+'/'+_0x3bd4cf)['json'](_0x461ac7);}return null;};}function saveUpdates(_0x435830){return function(_0x40b8a7){if(_0x40b8a7){return _0x40b8a7[_0xada2('0x17')](_0x435830)[_0xada2('0x18')](function(_0x4b2cc6){return _0x4b2cc6;});}return null;};}function removeEntity(_0xc892fc){return function(_0x9ba72c){if(_0x9ba72c){return _0x9ba72c[_0xada2('0x19')]()['then'](function(){_0xc892fc[_0xada2('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c6c0b){return function(_0x178661){if(!_0x178661){_0x5c6c0b[_0xada2('0x1a')](0x194);}return _0x178661;};}function handleError(_0xc2e0,_0x5893fc){_0x5893fc=_0x5893fc||0x1f4;return function(_0x20b19b){logger['error'](_0x20b19b[_0xada2('0x1b')]);if(_0x20b19b[_0xada2('0x1c')]){delete _0x20b19b[_0xada2('0x1c')];}_0xc2e0[_0xada2('0xf')](_0x5893fc)[_0xada2('0x1d')](_0x20b19b);};}exports['index']=function(_0x534007,_0x13ae3f){var _0x5e48bc={};var _0x478e0f=_['map'](db[_0xada2('0x1e')]['rawAttributes'],function(_0x472ced){return{'name':_0x472ced[_0xada2('0x1f')],'type':_0x472ced['type'][_0xada2('0x20')]};});_0x5e48bc=qs[_0xada2('0x21')](_0x478e0f,_0x534007);return interaction[_0xada2('0x22')]('mail',_0x534007[_0xada2('0x23')],_0x534007[_0xada2('0x24')],_0x5e48bc,_0x478e0f)[_0xada2('0x18')](respondWithFilteredResult(_0x13ae3f,_0x5e48bc))[_0xada2('0x25')](handleError(_0x13ae3f,null));};exports[_0xada2('0x26')]=function(_0xe86053,_0x52f897){var _0x541459={'raw':![],'where':{'id':_0xe86053['params']['id']}},_0x2a29b1={};_0x2a29b1[_0xada2('0x27')]=_[_0xada2('0x28')](db[_0xada2('0x1e')][_0xada2('0x29')]);_0x2a29b1[_0xada2('0x23')]=_[_0xada2('0x28')](_0xe86053[_0xada2('0x23')]);_0x2a29b1[_0xada2('0x2a')]=_[_0xada2('0x2b')](_0x2a29b1[_0xada2('0x27')],_0x2a29b1['query']);_0x541459[_0xada2('0x2c')]=_['intersection'](_0x2a29b1[_0xada2('0x27')],qs[_0xada2('0x2d')](_0xe86053['query'][_0xada2('0x2d')]));_0x541459[_0xada2('0x2c')]=_0x541459[_0xada2('0x2c')][_0xada2('0x2e')]?_0x541459[_0xada2('0x2c')]:_0x2a29b1[_0xada2('0x27')];if(_0xe86053[_0xada2('0x23')][_0xada2('0x2f')]){_0x541459[_0xada2('0x30')]=[{'all':!![]}];}_0x541459=_[_0xada2('0x31')]({},_0x541459,_0xe86053[_0xada2('0x32')]);return db['MailInteraction'][_0xada2('0x33')](_0x541459)['then'](handleEntityNotFound(_0x52f897,null))[_0xada2('0x18')](respondWithResult(_0x52f897,null))['catch'](handleError(_0x52f897,null));};exports[_0xada2('0x34')]=function(_0x391b87,_0x189de6){return db['MailInteraction']['create'](_0x391b87[_0xada2('0x35')],{})[_0xada2('0x18')](respondWithResult(_0x189de6,0xc9))[_0xada2('0x25')](handleError(_0x189de6,null));};exports[_0xada2('0x17')]=function(_0x19a691,_0x49593c){if(_0x19a691[_0xada2('0x35')]['id']){delete _0x19a691[_0xada2('0x35')]['id'];}return db[_0xada2('0x1e')][_0xada2('0x33')]({'where':{'id':_0x19a691[_0xada2('0x36')]['id']}})[_0xada2('0x18')](handleEntityNotFound(_0x49593c,null))[_0xada2('0x18')](saveUpdates(_0x19a691[_0xada2('0x35')],null))[_0xada2('0x18')](respondWithResult(_0x49593c,null))[_0xada2('0x25')](handleError(_0x49593c,null));};exports['destroy']=function(_0x3b0564,_0x69332){return db['MailInteraction'][_0xada2('0x33')]({'where':{'id':_0x3b0564[_0xada2('0x36')]['id']}})[_0xada2('0x18')](handleEntityNotFound(_0x69332,null))[_0xada2('0x18')](removeEntity(_0x69332,null))[_0xada2('0x25')](handleError(_0x69332,null));};exports[_0xada2('0x37')]=function(_0x472e02,_0x48b1c4){return db[_0xada2('0x1e')][_0xada2('0x37')]()[_0xada2('0x18')](respondWithResult(_0x48b1c4,null))[_0xada2('0x25')](handleError(_0x48b1c4,null));};exports[_0xada2('0x38')]=function(_0x208038,_0xee5a5a){return db['MailMessage'][_0xada2('0x33')]({'where':{'id':_0x208038[_0xada2('0x36')]['id']}})[_0xada2('0x18')](handleEntityNotFound(_0xee5a5a,null))[_0xada2('0x18')](function(_0x2e6af7){if(_0x2e6af7){return _0x2e6af7[_0xada2('0x38')](_0x208038[_0xada2('0x35')][_0xada2('0x39')],_['omit'](_0x208038[_0xada2('0x35')],[_0xada2('0x39'),'id'])||{});}})[_0xada2('0x18')](respondWithResult(_0xee5a5a,null))['catch'](handleError(_0xee5a5a,null));};exports[_0xada2('0x3a')]=function(_0xdb573e,_0x1a17f2){var _0x322339={'raw':![],'where':{}};var _0x5941f4={};var _0x33645f={'count':0x0,'rows':[]};return db[_0xada2('0x1e')][_0xada2('0x3b')]({'where':{'id':_0xdb573e[_0xada2('0x36')]['id']}})[_0xada2('0x18')](handleEntityNotFound(_0x1a17f2,null))['then'](function(_0x4e664c){if(_0x4e664c){_0x5941f4['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x5941f4['query']=_['keys'](_0xdb573e['query']);_0x5941f4[_0xada2('0x2a')]=_[_0xada2('0x2b')](_0x5941f4[_0xada2('0x27')],_0x5941f4[_0xada2('0x23')]);_0x322339[_0xada2('0x2c')]=_[_0xada2('0x2b')](_0x5941f4[_0xada2('0x27')],qs[_0xada2('0x2d')](_0xdb573e[_0xada2('0x23')]['fields']));_0x322339[_0xada2('0x2c')]=_0x322339[_0xada2('0x2c')][_0xada2('0x2e')]?_0x322339[_0xada2('0x2c')]:_0x5941f4[_0xada2('0x27')];if(!_0xdb573e['query'][_0xada2('0x3c')]('nolimit')){_0x322339[_0xada2('0x15')]=qs[_0xada2('0x15')](_0xdb573e['query'][_0xada2('0x15')]);_0x322339[_0xada2('0x12')]=qs[_0xada2('0x12')](_0xdb573e['query'][_0xada2('0x12')]);}_0x322339['order']=qs[_0xada2('0x3d')](_0xdb573e[_0xada2('0x23')]['sort']);_0x322339['where']=qs[_0xada2('0x2a')](_[_0xada2('0x3e')](_0xdb573e[_0xada2('0x23')],_0x5941f4[_0xada2('0x2a')]));_0x322339[_0xada2('0x3f')][_0xada2('0x40')]=_0x4e664c['id'];if(_0xdb573e[_0xada2('0x23')]['filter']){_0x322339['where']=_[_0xada2('0x31')](_0x322339[_0xada2('0x3f')],{'$or':_[_0xada2('0x41')](_0x322339[_0xada2('0x2c')],function(_0x290922){var _0x21363d={};_0x21363d[_0x290922]={'$like':'%'+_0xdb573e[_0xada2('0x23')][_0xada2('0x42')]+'%'};return _0x21363d;})});}if(_0xdb573e[_0xada2('0x23')][_0xada2('0x43')]){var _0x298bfa=_0xdb573e['query']['$gte'][_0xada2('0x44')](',');var _0x3cea63={};_0x3cea63[_0x298bfa[0x0]]={'$gte':moment(_0x298bfa[0x1])[_0xada2('0x45')](_0xada2('0x46'))};_0x322339[_0xada2('0x3f')]=_[_0xada2('0x31')](_0x322339[_0xada2('0x3f')],_0x3cea63);}_0x322339=_[_0xada2('0x31')]({},_0x322339,_0xdb573e['options']);return db[_0xada2('0x47')][_0xada2('0x14')]({'where':_0x322339[_0xada2('0x3f')]})['then'](function(_0x2615e9){_0x33645f[_0xada2('0x14')]=_0x2615e9;if(_0xdb573e[_0xada2('0x23')][_0xada2('0x2f')]){_0x322339[_0xada2('0x30')]=[{'all':!![]}];}return db[_0xada2('0x47')][_0xada2('0x22')](_0x322339);})[_0xada2('0x18')](function(_0x491cf9){if(_0xdb573e[_0xada2('0x23')]['inlineCss']==='true'){for(var _0x4ec41f=0x0;_0x4ec41f<_0x491cf9['length'];_0x4ec41f++){_0x491cf9[_0x4ec41f][_0xada2('0x35')]=juice(_0x491cf9[_0x4ec41f]['body']);}}_0x33645f[_0xada2('0x48')]=_0x491cf9;return _0x33645f;});}})[_0xada2('0x18')](respondWithFilteredResult(_0x1a17f2,_0x322339))[_0xada2('0x25')](handleError(_0x1a17f2,null));};exports['addTags']=function(_0x1ae308,_0x21df2d){return db[_0xada2('0x1e')][_0xada2('0x33')]({'where':{'id':_0x1ae308[_0xada2('0x36')]['id']}})[_0xada2('0x18')](handleEntityNotFound(_0x21df2d,null))[_0xada2('0x18')](function(_0x2a5b8a){if(_0x2a5b8a){return _0x2a5b8a[_0xada2('0x49')](_0x1ae308[_0xada2('0x35')]['ids'],_[_0xada2('0x4a')](_0x1ae308['body'],[_0xada2('0x39'),'id'])||{})['spread'](function(){return db[_0xada2('0x4b')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x1ae308[_0xada2('0x35')][_0xada2('0x39')]}});})[_0xada2('0x18')](function(_0x425e62){socket[_0xada2('0x4c')](_0xada2('0x4d'),{'id':Number(_0x1ae308[_0xada2('0x36')]['id']),'tags':_0x425e62||[]});return{'id':Number(_0x1ae308[_0xada2('0x36')]['id']),'tags':_0x425e62||[]};});}})[_0xada2('0x18')](respondWithResult(_0x21df2d,null))[_0xada2('0x25')](handleError(_0x21df2d,null));};exports[_0xada2('0x4e')]=function(_0x3707be,_0x49b74c){return db[_0xada2('0x1e')][_0xada2('0x33')]({'where':{'id':_0x3707be[_0xada2('0x36')]['id']}})['then'](handleEntityNotFound(_0x49b74c,null))['then'](function(_0x27ae46){if(_0x27ae46){return _0x27ae46[_0xada2('0x4e')](_0x3707be[_0xada2('0x23')][_0xada2('0x39')]);}})['then'](respondWithStatusCode(_0x49b74c,null))[_0xada2('0x25')](handleError(_0x49b74c,null));};exports['download']=function(_0x2bf74a,_0x3678d1){var _0x536f27=moment()[_0xada2('0x4f')]()['toString']();var _0xe67082=path['join'](config[_0xada2('0x50')],_0xada2('0x51'),_0xada2('0x52'),_0xada2('0x53'));var _0x5dabaf=path[_0xada2('0x54')](config[_0xada2('0x50')],_0xada2('0x51'),_0xada2('0x52'),_0xada2('0x55'));var _0x1df521=path['join'](_0xe67082,_0x536f27);var _0x23fefd=util['format']('transcript-%d-%s.zip',_0x2bf74a['params']['id'],_0x536f27);var _0x2fe028=path[_0xada2('0x54')](_0xe67082,_0x23fefd);var _0x51d169=[];if(_0x2bf74a[_0xada2('0x23')][_0xada2('0x55')]){_0x51d169[_0xada2('0x56')]({'model':db[_0xada2('0x57')],'as':'Attachments','raw':!![]});}var _0xb29c0c=[{'model':db[_0xada2('0x47')],'as':_0xada2('0x58'),'attributes':['id',_0xada2('0x35'),_0xada2('0x59'),'to','cc',_0xada2('0x5a'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0xada2('0x3d')]('id'),'include':_0x51d169}];return db[_0xada2('0x1e')][_0xada2('0x33')]({'where':{'id':_0x2bf74a[_0xada2('0x36')]['id']},'include':_0xb29c0c})['then'](handleEntityNotFound(_0x3678d1,null))[_0xada2('0x18')](function(_0x59060a){if(_0x59060a&&_0x59060a[_0xada2('0x58')]){var _0x179731=_0x59060a[_0xada2('0x5b')]({'plain':!![]});fs[_0xada2('0x5c')](_0x1df521);return BPromise[_0xada2('0x5d')](_0x179731['Messages'],function(_0x217d95,_0x387af8){var _0x2b0b68={'from':_0x217d95['from'],'to':_0x217d95['to']||_0xada2('0x5e'),'subject':_0x217d95[_0xada2('0x5f')],'html':htmlEntities['decode'](_0x217d95[_0xada2('0x35')]),'headers':{'Date':moment(_0x217d95[_0xada2('0x60')])['format'](_0xada2('0x61'))},'attachments':[]};if(_0x217d95['cc']){_0x2b0b68[_0xada2('0x62')]['Cc']=_0x217d95['cc'];}if(_0x217d95[_0xada2('0x5a')]){_0x2b0b68[_0xada2('0x62')][_0xada2('0x63')]=_0x217d95[_0xada2('0x5a')];}return new BPromise(function(_0x460518,_0x644907){if(_0x217d95['Attachments']){for(var _0x13b7d7=0x0;_0x13b7d7<_0x217d95['Attachments'][_0xada2('0x2e')];_0x13b7d7++){var _0x4d8ec5=_0x217d95[_0xada2('0x64')][_0x13b7d7];var _0x1785fc=path[_0xada2('0x54')](_0x5dabaf,_0x4d8ec5[_0xada2('0x65')]);if(fs['existsSync'](_0x1785fc)){_0x2b0b68[_0xada2('0x55')][_0xada2('0x56')]({'name':_0x4d8ec5[_0xada2('0x1c')],'contentType':_0x4d8ec5[_0xada2('0x66')],'data':fs['readFileSync'](_0x1785fc)});}}}emlformat['build'](_0x2b0b68,function(_0x49d091,_0xe52abe){if(_0x49d091)return _0x644907(_0x49d091);fs[_0xada2('0x67')](path[_0xada2('0x54')](_0x1df521,util[_0xada2('0x45')](_0xada2('0x68'),_0x387af8)),_0xe52abe);return _0x460518(_0xe52abe);});});})['then'](function(){return new BPromise(function(_0x42e18d,_0xaa844b){zipdir(_0x1df521,{'saveTo':_0x2fe028},function(_0x57b7ba,_0x1b15fd){if(_0x57b7ba)return _0xaa844b(_0x57b7ba);return _0x42e18d(_0x1b15fd);});})[_0xada2('0x18')](function(){return new BPromise(function(_0x306a01,_0x1889c4){rimraf(_0x1df521,function(_0x27a18e){if(_0x27a18e)_0x1889c4(_0x27a18e);return _0x306a01();});});})[_0xada2('0x18')](function(){return _0x3678d1[_0xada2('0x69')](_0x2fe028,_0x23fefd,function(_0x4be468){if(!_0x4be468)fs[_0xada2('0x6a')](_0x2fe028);});});});}else{return _0x3678d1['sendStatus'](0xc8);}})[_0xada2('0x25')](handleError(_0x3678d1,null));}; \ No newline at end of file +var _0x30b6=['rows','setTags','omit','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','server','files','root','attachments','transcript-%d-%s.zip','push','Attachment','Messages','subject','createdAt','get','mkdirSync','from','decode','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','undefined','count','offset','limit','Content-Range','json','destroy','name','index','map','MailInteraction','fieldName','type','findAll','mail','user','then','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','find','catch','create','body','describe','addMessage','MailMessage','ids','findOne','fields','length','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','true'];(function(_0xace1ac,_0x2d20a8){var _0x103c4c=function(_0x12ed69){while(--_0x12ed69){_0xace1ac['push'](_0xace1ac['shift']());}};_0x103c4c(++_0x2d20a8);}(_0x30b6,0x162));var _0x630b=function(_0xcd0ede,_0xd16617){_0xcd0ede=_0xcd0ede-0x0;var _0x421a1=_0x30b6[_0xcd0ede];return _0x421a1;};'use strict';var emlformat=require(_0x630b('0x0'));var rimraf=require(_0x630b('0x1'));var zipdir=require(_0x630b('0x2'));var moment=require(_0x630b('0x3'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x630b('0x4'));var fs=require('fs');var _=require(_0x630b('0x5'));var juice=require(_0x630b('0x6'));var Redis=require(_0x630b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x630b('0x8'));var logger=require(_0x630b('0x9'))('api');var config=require(_0x630b('0xa'));var db=require(_0x630b('0xb'))['db'];var htmlEntities=require(_0x630b('0xc'));config[_0x630b('0xd')]=_[_0x630b('0xe')](config[_0x630b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x630b('0xf'))(new Redis(config[_0x630b('0xd')]));require(_0x630b('0x10'))[_0x630b('0x11')](socket);function respondWithStatusCode(_0x569f90,_0x2809af){_0x2809af=_0x2809af||0xcc;return function(_0x7ae593){if(_0x7ae593){return _0x569f90[_0x630b('0x12')](_0x2809af);}return _0x569f90['status'](_0x2809af)['end']();};}function respondWithResult(_0x1dce45,_0x3e3b4d){_0x3e3b4d=_0x3e3b4d||0xc8;return function(_0x4a72b6){if(_0x4a72b6){return _0x1dce45[_0x630b('0x13')](_0x3e3b4d)['json'](_0x4a72b6);}};}function respondWithFilteredResult(_0x164166,_0x296735){return function(_0xaa6d05){if(_0xaa6d05){var _0x4230be=typeof _0x296735['offset']===_0x630b('0x14')&&typeof _0x296735['limit']===_0x630b('0x14');var _0x496fc3=_0xaa6d05[_0x630b('0x15')];var _0x412fd5=_0x4230be?0x0:_0x296735[_0x630b('0x16')];var _0x172012=_0x4230be?_0xaa6d05['count']:_0x296735['offset']+_0x296735[_0x630b('0x17')];var _0x41aead;if(_0x172012>=_0x496fc3){_0x172012=_0x496fc3;_0x41aead=0xc8;}else{_0x41aead=0xce;}_0x164166[_0x630b('0x13')](_0x41aead);return _0x164166['set'](_0x630b('0x18'),_0x412fd5+'-'+_0x172012+'/'+_0x496fc3)[_0x630b('0x19')](_0xaa6d05);}return null;};}function saveUpdates(_0x46f8eb){return function(_0x56d5d2){if(_0x56d5d2){return _0x56d5d2['update'](_0x46f8eb)['then'](function(_0x1fc30b){return _0x1fc30b;});}return null;};}function removeEntity(_0x5f5ccb){return function(_0xb4bac9){if(_0xb4bac9){return _0xb4bac9[_0x630b('0x1a')]()['then'](function(){_0x5f5ccb[_0x630b('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7bc3){return function(_0x4d2e9b){if(!_0x4d2e9b){_0x2d7bc3[_0x630b('0x12')](0x194);}return _0x4d2e9b;};}function handleError(_0x1a6d6d,_0x177b17){_0x177b17=_0x177b17||0x1f4;return function(_0x14afb3){logger['error'](_0x14afb3['stack']);if(_0x14afb3[_0x630b('0x1b')]){delete _0x14afb3['name'];}_0x1a6d6d[_0x630b('0x13')](_0x177b17)['send'](_0x14afb3);};}exports[_0x630b('0x1c')]=function(_0x35018b,_0x398474){var _0x1693f5={};var _0x6abfb1=_[_0x630b('0x1d')](db[_0x630b('0x1e')]['rawAttributes'],function(_0x176589){return{'name':_0x176589[_0x630b('0x1f')],'type':_0x176589[_0x630b('0x20')]['key']};});_0x1693f5=qs['getOptions'](_0x6abfb1,_0x35018b);return interaction[_0x630b('0x21')](_0x630b('0x22'),_0x35018b['query'],_0x35018b[_0x630b('0x23')],_0x1693f5,_0x6abfb1)[_0x630b('0x24')](respondWithFilteredResult(_0x398474,_0x1693f5))['catch'](handleError(_0x398474,null));};exports['show']=function(_0x461156,_0x29a288){var _0x2c101d={'raw':![],'where':{'id':_0x461156[_0x630b('0x25')]['id']}},_0x552958={};_0x552958[_0x630b('0x26')]=_[_0x630b('0x27')](db['MailInteraction'][_0x630b('0x28')]);_0x552958[_0x630b('0x29')]=_[_0x630b('0x27')](_0x461156[_0x630b('0x29')]);_0x552958[_0x630b('0x2a')]=_['intersection'](_0x552958[_0x630b('0x26')],_0x552958[_0x630b('0x29')]);_0x2c101d['attributes']=_[_0x630b('0x2b')](_0x552958[_0x630b('0x26')],qs['fields'](_0x461156['query']['fields']));_0x2c101d[_0x630b('0x2c')]=_0x2c101d['attributes']['length']?_0x2c101d[_0x630b('0x2c')]:_0x552958['model'];if(_0x461156['query']['includeAll']){_0x2c101d[_0x630b('0x2d')]=[{'all':!![]}];}_0x2c101d=_[_0x630b('0x2e')]({},_0x2c101d,_0x461156['options']);return db['MailInteraction'][_0x630b('0x2f')](_0x2c101d)[_0x630b('0x24')](handleEntityNotFound(_0x29a288,null))[_0x630b('0x24')](respondWithResult(_0x29a288,null))[_0x630b('0x30')](handleError(_0x29a288,null));};exports[_0x630b('0x31')]=function(_0x3507e6,_0x1d5c15){return db[_0x630b('0x1e')][_0x630b('0x31')](_0x3507e6[_0x630b('0x32')],{})[_0x630b('0x24')](respondWithResult(_0x1d5c15,0xc9))[_0x630b('0x30')](handleError(_0x1d5c15,null));};exports['update']=function(_0x556f0d,_0x53e00c){if(_0x556f0d[_0x630b('0x32')]['id']){delete _0x556f0d[_0x630b('0x32')]['id'];}return db[_0x630b('0x1e')][_0x630b('0x2f')]({'where':{'id':_0x556f0d[_0x630b('0x25')]['id']}})[_0x630b('0x24')](handleEntityNotFound(_0x53e00c,null))[_0x630b('0x24')](saveUpdates(_0x556f0d[_0x630b('0x32')],null))[_0x630b('0x24')](respondWithResult(_0x53e00c,null))[_0x630b('0x30')](handleError(_0x53e00c,null));};exports[_0x630b('0x1a')]=function(_0x2bbfd1,_0x534e52){return db[_0x630b('0x1e')][_0x630b('0x2f')]({'where':{'id':_0x2bbfd1[_0x630b('0x25')]['id']}})[_0x630b('0x24')](handleEntityNotFound(_0x534e52,null))[_0x630b('0x24')](removeEntity(_0x534e52,null))[_0x630b('0x30')](handleError(_0x534e52,null));};exports['describe']=function(_0x305298,_0x559a4c){return db[_0x630b('0x1e')][_0x630b('0x33')]()[_0x630b('0x24')](respondWithResult(_0x559a4c,null))[_0x630b('0x30')](handleError(_0x559a4c,null));};exports[_0x630b('0x34')]=function(_0x2b0879,_0x1fcf62){return db[_0x630b('0x35')]['find']({'where':{'id':_0x2b0879['params']['id']}})[_0x630b('0x24')](handleEntityNotFound(_0x1fcf62,null))[_0x630b('0x24')](function(_0x38b22e){if(_0x38b22e){return _0x38b22e[_0x630b('0x34')](_0x2b0879[_0x630b('0x32')][_0x630b('0x36')],_['omit'](_0x2b0879[_0x630b('0x32')],['ids','id'])||{});}})[_0x630b('0x24')](respondWithResult(_0x1fcf62,null))['catch'](handleError(_0x1fcf62,null));};exports['getMessages']=function(_0x2b10c8,_0x4a9b3e){var _0x48342d={'raw':![],'where':{}};var _0x16d520={};var _0x5da17d={'count':0x0,'rows':[]};return db['MailInteraction'][_0x630b('0x37')]({'where':{'id':_0x2b10c8[_0x630b('0x25')]['id']}})[_0x630b('0x24')](handleEntityNotFound(_0x4a9b3e,null))[_0x630b('0x24')](function(_0x5da476){if(_0x5da476){_0x16d520[_0x630b('0x26')]=_['keys'](db[_0x630b('0x35')][_0x630b('0x28')]);_0x16d520[_0x630b('0x29')]=_[_0x630b('0x27')](_0x2b10c8[_0x630b('0x29')]);_0x16d520[_0x630b('0x2a')]=_[_0x630b('0x2b')](_0x16d520[_0x630b('0x26')],_0x16d520[_0x630b('0x29')]);_0x48342d[_0x630b('0x2c')]=_[_0x630b('0x2b')](_0x16d520[_0x630b('0x26')],qs[_0x630b('0x38')](_0x2b10c8[_0x630b('0x29')][_0x630b('0x38')]));_0x48342d[_0x630b('0x2c')]=_0x48342d[_0x630b('0x2c')][_0x630b('0x39')]?_0x48342d[_0x630b('0x2c')]:_0x16d520[_0x630b('0x26')];if(!_0x2b10c8[_0x630b('0x29')]['hasOwnProperty']('nolimit')){_0x48342d['limit']=qs[_0x630b('0x17')](_0x2b10c8[_0x630b('0x29')][_0x630b('0x17')]);_0x48342d['offset']=qs[_0x630b('0x16')](_0x2b10c8[_0x630b('0x29')]['offset']);}_0x48342d['order']=qs[_0x630b('0x3a')](_0x2b10c8[_0x630b('0x29')][_0x630b('0x3a')]);_0x48342d[_0x630b('0x3b')]=qs[_0x630b('0x2a')](_[_0x630b('0x3c')](_0x2b10c8['query'],_0x16d520[_0x630b('0x2a')]));_0x48342d['where'][_0x630b('0x3d')]=_0x5da476['id'];if(_0x2b10c8[_0x630b('0x29')][_0x630b('0x3e')]){_0x48342d[_0x630b('0x3b')]=_[_0x630b('0x2e')](_0x48342d[_0x630b('0x3b')],{'$or':_[_0x630b('0x1d')](_0x48342d[_0x630b('0x2c')],function(_0x15b69e){var _0x3e963f={};_0x3e963f[_0x15b69e]={'$like':'%'+_0x2b10c8[_0x630b('0x29')][_0x630b('0x3e')]+'%'};return _0x3e963f;})});}if(_0x2b10c8[_0x630b('0x29')]['$gte']){var _0x4dcf75=_0x2b10c8[_0x630b('0x29')][_0x630b('0x3f')][_0x630b('0x40')](',');var _0x41dca8={};_0x41dca8[_0x4dcf75[0x0]]={'$gte':moment(_0x4dcf75[0x1])[_0x630b('0x41')](_0x630b('0x42'))};_0x48342d[_0x630b('0x3b')]=_[_0x630b('0x2e')](_0x48342d[_0x630b('0x3b')],_0x41dca8);}_0x48342d=_['merge']({},_0x48342d,_0x2b10c8[_0x630b('0x43')]);return db[_0x630b('0x35')]['count']({'where':_0x48342d[_0x630b('0x3b')]})['then'](function(_0x12e8d5){_0x5da17d[_0x630b('0x15')]=_0x12e8d5;if(_0x2b10c8['query']['includeAll']){_0x48342d[_0x630b('0x2d')]=[{'all':!![]}];}return db[_0x630b('0x35')][_0x630b('0x21')](_0x48342d);})[_0x630b('0x24')](function(_0x557692){if(_0x2b10c8[_0x630b('0x29')][_0x630b('0x44')]===_0x630b('0x45')){for(var _0x1c88a0=0x0;_0x1c88a0<_0x557692[_0x630b('0x39')];_0x1c88a0++){_0x557692[_0x1c88a0][_0x630b('0x32')]=juice(_0x557692[_0x1c88a0][_0x630b('0x32')]);}}_0x5da17d[_0x630b('0x46')]=_0x557692;return _0x5da17d;});}})['then'](respondWithFilteredResult(_0x4a9b3e,_0x48342d))[_0x630b('0x30')](handleError(_0x4a9b3e,null));};exports['addTags']=function(_0x1acca8,_0x26bc0c){return db[_0x630b('0x1e')][_0x630b('0x2f')]({'where':{'id':_0x1acca8[_0x630b('0x25')]['id']}})[_0x630b('0x24')](handleEntityNotFound(_0x26bc0c,null))[_0x630b('0x24')](function(_0x4e30de){if(_0x4e30de){return _0x4e30de[_0x630b('0x47')](_0x1acca8[_0x630b('0x32')][_0x630b('0x36')],_[_0x630b('0x48')](_0x1acca8[_0x630b('0x32')],[_0x630b('0x36'),'id'])||{})[_0x630b('0x49')](function(){return db['Tag'][_0x630b('0x21')]({'attributes':['id',_0x630b('0x1b'),_0x630b('0x4a')],'where':{'id':_0x1acca8['body']['ids']}});})[_0x630b('0x24')](function(_0x70d78f){socket[_0x630b('0x4b')](_0x630b('0x4c'),{'id':Number(_0x1acca8[_0x630b('0x25')]['id']),'tags':_0x70d78f||[]});return{'id':Number(_0x1acca8[_0x630b('0x25')]['id']),'tags':_0x70d78f||[]};});}})[_0x630b('0x24')](respondWithResult(_0x26bc0c,null))[_0x630b('0x30')](handleError(_0x26bc0c,null));};exports[_0x630b('0x4d')]=function(_0x11ef51,_0x5eeb56){return db['MailInteraction'][_0x630b('0x2f')]({'where':{'id':_0x11ef51[_0x630b('0x25')]['id']}})['then'](handleEntityNotFound(_0x5eeb56,null))[_0x630b('0x24')](function(_0x302d3f){if(_0x302d3f){return _0x302d3f[_0x630b('0x4d')](_0x11ef51[_0x630b('0x29')][_0x630b('0x36')]);}})['then'](respondWithStatusCode(_0x5eeb56,null))[_0x630b('0x30')](handleError(_0x5eeb56,null));};exports[_0x630b('0x4e')]=function(_0x44173,_0x5da68b){var _0x2d6fcc=moment()[_0x630b('0x4f')]()[_0x630b('0x50')]();var _0x35a714=path[_0x630b('0x51')](config['root'],_0x630b('0x52'),_0x630b('0x53'),'tmp');var _0x4e77d6=path[_0x630b('0x51')](config[_0x630b('0x54')],_0x630b('0x52'),_0x630b('0x53'),_0x630b('0x55'));var _0x14177f=path['join'](_0x35a714,_0x2d6fcc);var _0x50c29b=util['format'](_0x630b('0x56'),_0x44173[_0x630b('0x25')]['id'],_0x2d6fcc);var _0x1d64fb=path[_0x630b('0x51')](_0x35a714,_0x50c29b);var _0x4fd353=[];if(_0x44173['query']['attachments']){_0x4fd353[_0x630b('0x57')]({'model':db[_0x630b('0x58')],'as':'Attachments','raw':!![]});}var _0x422ab0=[{'model':db[_0x630b('0x35')],'as':_0x630b('0x59'),'attributes':['id',_0x630b('0x32'),'from','to','cc','bcc',_0x630b('0x5a'),_0x630b('0x5b')],'where':{'secret':![]},'order':qs[_0x630b('0x3a')]('id'),'include':_0x4fd353}];return db['MailInteraction'][_0x630b('0x2f')]({'where':{'id':_0x44173[_0x630b('0x25')]['id']},'include':_0x422ab0})[_0x630b('0x24')](handleEntityNotFound(_0x5da68b,null))[_0x630b('0x24')](function(_0x2b69c4){if(_0x2b69c4&&_0x2b69c4[_0x630b('0x59')]){var _0x4607c1=_0x2b69c4[_0x630b('0x5c')]({'plain':!![]});fs[_0x630b('0x5d')](_0x14177f);return BPromise['each'](_0x4607c1[_0x630b('0x59')],function(_0x5b6fbb,_0x4cea1a){var _0x56b3bf={'from':_0x5b6fbb[_0x630b('0x5e')],'to':_0x5b6fbb['to']||'missing.recipient@your.company.com','subject':_0x5b6fbb[_0x630b('0x5a')],'html':htmlEntities[_0x630b('0x5f')](_0x5b6fbb[_0x630b('0x32')]),'headers':{'Date':moment(_0x5b6fbb[_0x630b('0x5b')])[_0x630b('0x41')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5b6fbb['cc']){_0x56b3bf[_0x630b('0x60')]['Cc']=_0x5b6fbb['cc'];}if(_0x5b6fbb[_0x630b('0x61')]){_0x56b3bf[_0x630b('0x60')][_0x630b('0x62')]=_0x5b6fbb['bcc'];}return new BPromise(function(_0x30bde2,_0xfe1606){if(_0x5b6fbb[_0x630b('0x63')]){for(var _0x409a0b=0x0;_0x409a0b<_0x5b6fbb[_0x630b('0x63')]['length'];_0x409a0b++){var _0x5095c4=_0x5b6fbb['Attachments'][_0x409a0b];var _0x4a43d3=path['join'](_0x4e77d6,_0x5095c4[_0x630b('0x64')]);if(fs[_0x630b('0x65')](_0x4a43d3)){_0x56b3bf['attachments'][_0x630b('0x57')]({'name':_0x5095c4[_0x630b('0x1b')],'contentType':_0x5095c4[_0x630b('0x20')],'data':fs[_0x630b('0x66')](_0x4a43d3)});}}}emlformat['build'](_0x56b3bf,function(_0x3a14f3,_0x46ad90){if(_0x3a14f3)return _0xfe1606(_0x3a14f3);fs[_0x630b('0x67')](path[_0x630b('0x51')](_0x14177f,util['format'](_0x630b('0x68'),_0x4cea1a)),_0x46ad90);return _0x30bde2(_0x46ad90);});});})[_0x630b('0x24')](function(){return new BPromise(function(_0x4a8c00,_0x122262){zipdir(_0x14177f,{'saveTo':_0x1d64fb},function(_0x338b48,_0x4a2ff1){if(_0x338b48)return _0x122262(_0x338b48);return _0x4a8c00(_0x4a2ff1);});})[_0x630b('0x24')](function(){return new BPromise(function(_0x46e769,_0x420409){rimraf(_0x14177f,function(_0x1e4632){if(_0x1e4632)_0x420409(_0x1e4632);return _0x46e769();});});})[_0x630b('0x24')](function(){return _0x5da68b[_0x630b('0x4e')](_0x1d64fb,_0x50c29b,function(_0x29b4bd){if(!_0x29b4bd)fs[_0x630b('0x69')](_0x1d64fb);});});});}else{return _0x5da68b['sendStatus'](0xc8);}})[_0x630b('0x30')](handleError(_0x5da68b,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f9b3842..5684426 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 _0xff47=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','update','remove','getUsers','then','setDataValue','unreadMessages','length'];(function(_0x5af11f,_0x2f3f18){var _0x31cd5b=function(_0x226289){while(--_0x226289){_0x5af11f['push'](_0x5af11f['shift']());}};_0x31cd5b(++_0x2f3f18);}(_0xff47,0x9b));var _0x7ff4=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0xff47[_0x45c61e];return _0x19033c;};'use strict';var EventEmitter=require(_0x7ff4('0x0'));var MailInteraction=require(_0x7ff4('0x1'))['db'][_0x7ff4('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7ff4('0x3'),'afterDestroy':_0x7ff4('0x4')};function emitEvent(_0x31d88e){return function(_0x27f80d,_0x5dd767,_0x303d5c){_0x27f80d[_0x7ff4('0x5')]({'attributes':['id'],'raw':!![]})[_0x7ff4('0x6')](function(_0x5e1fb4){_0x27f80d[_0x7ff4('0x7')]('Users',_0x5e1fb4['map'](function(_0x74881a){return{'id':_0x74881a['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x27f80d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7ff4('0x6')](function(_0x860952){_0x27f80d[_0x7ff4('0x7')](_0x7ff4('0x8'),_0x860952[_0x7ff4('0x9')]);MailInteractionEvents[_0x7ff4('0xa')](_0x31d88e+':'+_0x27f80d['id'],_0x27f80d);MailInteractionEvents[_0x7ff4('0xa')](_0x31d88e,_0x27f80d);_0x303d5c(null);})[_0x7ff4('0xb')](_0x303d5c(null));};}for(var e in events){if(events[_0x7ff4('0xc')](e)){var event=events[e];MailInteraction[_0x7ff4('0xd')](e,emitEvent(event));}}module[_0x7ff4('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x9b04=['getUsers','then','setDataValue','Users','map','findAll','emit','catch','hook','events','../../mysqldb','MailInteraction','setMaxListeners','remove'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x9b04,0x1bb));var _0x49b0=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x9b04[_0x549278];return _0x1ea9a1;};'use strict';var EventEmitter=require(_0x49b0('0x0'));var MailInteraction=require(_0x49b0('0x1'))['db'][_0x49b0('0x2')];var MailMessage=require(_0x49b0('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x49b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x49b0('0x4')};function emitEvent(_0x2ddd43){return function(_0x2cf307,_0x374045,_0x4dbb49){_0x2cf307[_0x49b0('0x5')]({'attributes':['id'],'raw':!![]})[_0x49b0('0x6')](function(_0x1be025){_0x2cf307[_0x49b0('0x7')](_0x49b0('0x8'),_0x1be025[_0x49b0('0x9')](function(_0x4cc8c3){return{'id':_0x4cc8c3['id']};}));return MailMessage[_0x49b0('0xa')]({'where':{'MailInteractionId':_0x2cf307['id'],'direction':'in','read':![]},'raw':!![]});})[_0x49b0('0x6')](function(_0x3cfe22){_0x2cf307[_0x49b0('0x7')]('unreadMessages',_0x3cfe22['length']);MailInteractionEvents[_0x49b0('0xb')](_0x2ddd43+':'+_0x2cf307['id'],_0x2cf307);MailInteractionEvents[_0x49b0('0xb')](_0x2ddd43,_0x2cf307);_0x4dbb49(null);})[_0x49b0('0xc')](_0x4dbb49(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x49b0('0xd')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0673777..8523cd5 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 _0xc72e=['request-promise','path','rimraf','../../config/environment','define','MailInteraction','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','get','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird'];(function(_0x35137c,_0x5d3708){var _0x4bb02a=function(_0x3a0764){while(--_0x3a0764){_0x35137c['push'](_0x35137c['shift']());}};_0x4bb02a(++_0x5d3708);}(_0xc72e,0x1c9));var _0xec72=function(_0x36d812,_0xd32cb9){_0x36d812=_0x36d812-0x0;var _0x13410a=_0xc72e[_0x36d812];return _0x13410a;};'use strict';var _=require(_0xec72('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec72('0x1'));var BPromise=require(_0xec72('0x2'));var rp=require(_0xec72('0x3'));var fs=require('fs');var path=require(_0xec72('0x4'));var rimraf=require(_0xec72('0x5'));var config=require(_0xec72('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x31acdd,_0x36cb0d){return _0x31acdd[_0xec72('0x7')](_0xec72('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xec72('0x9'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x410c33,_0x516057,_0x387b32){if(_0x410c33[_0xec72('0xa')]){_0x410c33[_0xec72('0xb')]=moment()[_0xec72('0xc')](_0xec72('0xd'));}if(_0x410c33[_0xec72('0xe')]){_0x410c33['closedAt']=moment()[_0xec72('0xc')](_0xec72('0xd'));}_0x387b32(null,_0x516057);},'beforeUpdate':function(_0x3a1909,_0x604a9c,_0x58204f){if(_0x3a1909['changed'](_0xec72('0xa'))){_0x3a1909[_0xec72('0xb')]=_0x3a1909[_0xec72('0xa')]?moment()[_0xec72('0xc')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3a1909[_0xec72('0xf')](_0xec72('0xe'))){_0x3a1909[_0xec72('0x10')]=moment()[_0xec72('0xc')](_0xec72('0xd'));_0x3a1909[_0xec72('0xa')]=null;_0x3a1909['substatusAt']=null;}_0x58204f(null,_0x3a1909);},'afterUpdate':function(_0x11b6f7,_0x4eedeb,_0x348abf){var _0x1a665c=_0x31acdd[_0xec72('0x11')];var _0x321a59=_0x11b6f7[_0xec72('0x12')]({'plain':!![]});if(_0x321a59[_0xec72('0xe')]){return _0x1a665c[_0xec72('0x13')][_0xec72('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x321a59['id']}})['then'](function(){_0x348abf();})['catch'](function(_0x28d6c6){_0x348abf(_0x28d6c6);});}else{_0x348abf();}}},'charset':_0xec72('0x15'),'collate':_0xec72('0x16')});}; \ No newline at end of file +var _0x1e6b=['../../config/logger','api','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','substatus','closedAt','format','changed','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x1e6b,0x1af));var _0xb1e6=function(_0x10d1ab,_0x4db366){_0x10d1ab=_0x10d1ab-0x0;var _0x52be85=_0x1e6b[_0x10d1ab];return _0x52be85;};'use strict';var _=require('lodash');var util=require(_0xb1e6('0x0'));var logger=require(_0xb1e6('0x1'))(_0xb1e6('0x2'));var moment=require('moment');var BPromise=require(_0xb1e6('0x3'));var rp=require(_0xb1e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1e6('0x5'));var config=require('../../config/environment');var attributes=require(_0xb1e6('0x6'));module[_0xb1e6('0x7')]=function(_0x37f5ec,_0xf0c1e){return _0x37f5ec[_0xb1e6('0x8')](_0xb1e6('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xb1e6('0xa'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x467ae4,_0x58151f,_0x1ea463){if(_0x467ae4[_0xb1e6('0xb')]){_0x467ae4['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x467ae4['closed']){_0x467ae4[_0xb1e6('0xc')]=moment()[_0xb1e6('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ea463(null,_0x58151f);},'beforeUpdate':function(_0x4319d9,_0x863e0a,_0x42a0de){if(_0x4319d9[_0xb1e6('0xe')](_0xb1e6('0xb'))){_0x4319d9[_0xb1e6('0xf')]=_0x4319d9[_0xb1e6('0xb')]?moment()['format'](_0xb1e6('0x10')):null;}if(_0x4319d9[_0xb1e6('0xe')](_0xb1e6('0x11'))){_0x4319d9['closedAt']=moment()[_0xb1e6('0xd')](_0xb1e6('0x10'));_0x4319d9[_0xb1e6('0xb')]=null;_0x4319d9[_0xb1e6('0xf')]=null;}_0x42a0de(null,_0x4319d9);},'afterUpdate':function(_0x255ab8,_0x481507,_0x33a906){var _0x3ee231=_0x37f5ec['models'];var _0x525c7b=_0x255ab8[_0xb1e6('0x12')]({'plain':!![]});if(_0x525c7b[_0xb1e6('0x11')]){return _0x3ee231[_0xb1e6('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x525c7b['id']}})[_0xb1e6('0x14')](function(){_0x33a906();})[_0xb1e6('0x15')](function(_0x514609){_0x33a906(_0x514609);});}else{_0x33a906();}}},'charset':_0xb1e6('0x16'),'collate':_0xb1e6('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 7798fd7..e427b7b 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 _0x2b67=['http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','body','options','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc7cba9,_0x5b50ad){var _0x37517b=function(_0xee8d61){while(--_0xee8d61){_0xc7cba9['push'](_0xc7cba9['shift']());}};_0x37517b(++_0x5b50ad);}(_0x2b67,0x67));var _0x72b6=function(_0x419daa,_0x5a3cfc){_0x419daa=_0x419daa-0x0;var _0x46010f=_0x2b67[_0x419daa];return _0x46010f;};'use strict';var _=require(_0x72b6('0x0'));var util=require('util');var moment=require(_0x72b6('0x1'));var BPromise=require(_0x72b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x72b6('0x4'))(_0x72b6('0x5'));var config=require(_0x72b6('0x6'));var jayson=require(_0x72b6('0x7'));var client=jayson['client'][_0x72b6('0x8')]({'port':0x232a});config[_0x72b6('0x9')]=_[_0x72b6('0xa')](config[_0x72b6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x72b6('0xb'))(new Redis(config[_0x72b6('0x9')]));require(_0x72b6('0xc'))[_0x72b6('0xd')](socket);function respondWithRpcPromise(_0x319c13,_0x392a3a,_0x5a5253){return new BPromise(function(_0x1a7a0f,_0x5e8376){return client[_0x72b6('0xe')](_0x319c13,_0x5a5253)[_0x72b6('0xf')](function(_0x6774f2){logger[_0x72b6('0x10')]('MailInteraction,\x20%s,\x20%s',_0x392a3a,'request\x20sent');logger[_0x72b6('0x11')](_0x72b6('0x12'),_0x392a3a,_0x72b6('0x13'),JSON[_0x72b6('0x14')](_0x6774f2));if(_0x6774f2[_0x72b6('0x15')]){if(_0x6774f2[_0x72b6('0x15')]['code']===0x1f4){logger[_0x72b6('0x15')](_0x72b6('0x16'),_0x392a3a,_0x6774f2[_0x72b6('0x15')][_0x72b6('0x17')]);return _0x5e8376(_0x6774f2[_0x72b6('0x15')]['message']);}logger[_0x72b6('0x15')](_0x72b6('0x16'),_0x392a3a,_0x6774f2[_0x72b6('0x15')]['message']);return _0x1a7a0f(_0x6774f2[_0x72b6('0x15')][_0x72b6('0x17')]);}else{logger[_0x72b6('0x10')](_0x72b6('0x16'),_0x392a3a,_0x72b6('0x13'));_0x1a7a0f(_0x6774f2[_0x72b6('0x18')][_0x72b6('0x17')]);}})[_0x72b6('0x19')](function(_0x152966){logger['error'](_0x72b6('0x16'),_0x392a3a,_0x152966);_0x5e8376(_0x152966);});});}exports['UpdateMailInteraction']=function(_0x141fe2){var _0x3c8d3e=this;return new Promise(function(_0x1735cd,_0x55367f){return db[_0x72b6('0x1a')]['update'](_0x141fe2[_0x72b6('0x1b')],{'raw':_0x141fe2[_0x72b6('0x1c')]?_0x141fe2[_0x72b6('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x141fe2[_0x72b6('0x1c')]?_0x141fe2[_0x72b6('0x1c')][_0x72b6('0x1d')]||null:null,'attributes':_0x141fe2['options']?_0x141fe2['options'][_0x72b6('0x1e')]||null:null,'limit':_0x141fe2['options']?_0x141fe2[_0x72b6('0x1c')][_0x72b6('0x1f')]||null:null})[_0x72b6('0xf')](function(_0x44ee5b){logger['info'](_0x72b6('0x20'),_0x141fe2);logger[_0x72b6('0x11')]('UpdateMailInteraction',_0x141fe2,JSON[_0x72b6('0x14')](_0x44ee5b));_0x1735cd(_0x44ee5b);})[_0x72b6('0x19')](function(_0x590a97){logger['error']('UpdateMailInteraction',_0x590a97[_0x72b6('0x17')],_0x141fe2);_0x55367f(_0x3c8d3e['error'](0x1f4,_0x590a97[_0x72b6('0x17')]));});});};exports[_0x72b6('0x21')]=function(_0x58afe5){return new Promise(function(_0x22a3d3,_0x5a8cc4){return db[_0x72b6('0x1a')]['find']({'where':_0x58afe5[_0x72b6('0x1c')]?_0x58afe5['options']['where']||null:null})[_0x72b6('0xf')](function(_0x452ba9){if(_0x452ba9){return _0x452ba9['addTags'](_0x58afe5['body'][_0x72b6('0x22')],_[_0x72b6('0x23')](_0x58afe5[_0x72b6('0x1b')],[_0x72b6('0x22'),'id'])||{});}})['spread'](function(_0x7a0d5){logger[_0x72b6('0x10')](_0x72b6('0x24'),_0x58afe5);logger[_0x72b6('0x11')]('AddTags',_0x58afe5,JSON[_0x72b6('0x14')](_0x7a0d5));_0x22a3d3(_0x7a0d5);})[_0x72b6('0x19')](function(_0x57af31){logger[_0x72b6('0x15')]('AddTags',_0x57af31[_0x72b6('0x17')],_0x58afe5);_0x5a8cc4(_this[_0x72b6('0x15')](0x1f4,_0x57af31[_0x72b6('0x17')]));});});}; \ No newline at end of file +var _0x7ced=['body','options','raw','where','attributes','limit','stringify','catch','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateMailInteraction','MailInteraction','update'];(function(_0x122f93,_0x410e63){var _0xca64a1=function(_0x49dcce){while(--_0x49dcce){_0x122f93['push'](_0x122f93['shift']());}};_0xca64a1(++_0x410e63);}(_0x7ced,0x105));var _0xd7ce=function(_0x4b19e3,_0x2b63c3){_0x4b19e3=_0x4b19e3-0x0;var _0x2ce22a=_0x7ced[_0x4b19e3];return _0x2ce22a;};'use strict';var _=require(_0xd7ce('0x0'));var util=require(_0xd7ce('0x1'));var moment=require(_0xd7ce('0x2'));var BPromise=require(_0xd7ce('0x3'));var rs=require(_0xd7ce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7ce('0x5'));var logger=require(_0xd7ce('0x6'))('rpc');var config=require(_0xd7ce('0x7'));var jayson=require(_0xd7ce('0x8'));var client=jayson[_0xd7ce('0x9')]['http']({'port':0x232a});config['redis']=_[_0xd7ce('0xa')](config[_0xd7ce('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7ce('0xc'))(new Redis(config[_0xd7ce('0xb')]));require(_0xd7ce('0xd'))['register'](socket);function respondWithRpcPromise(_0x1f66d4,_0x2b5e04,_0x2a34dc){return new BPromise(function(_0x4d69c8,_0x203d64){return client['request'](_0x1f66d4,_0x2a34dc)[_0xd7ce('0xe')](function(_0x5eb9ad){logger[_0xd7ce('0xf')](_0xd7ce('0x10'),_0x2b5e04,_0xd7ce('0x11'));logger[_0xd7ce('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2b5e04,_0xd7ce('0x11'),JSON['stringify'](_0x5eb9ad));if(_0x5eb9ad[_0xd7ce('0x13')]){if(_0x5eb9ad[_0xd7ce('0x13')][_0xd7ce('0x14')]===0x1f4){logger[_0xd7ce('0x13')](_0xd7ce('0x10'),_0x2b5e04,_0x5eb9ad[_0xd7ce('0x13')]['message']);return _0x203d64(_0x5eb9ad[_0xd7ce('0x13')][_0xd7ce('0x15')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x2b5e04,_0x5eb9ad[_0xd7ce('0x13')][_0xd7ce('0x15')]);return _0x4d69c8(_0x5eb9ad[_0xd7ce('0x13')][_0xd7ce('0x15')]);}else{logger[_0xd7ce('0xf')](_0xd7ce('0x10'),_0x2b5e04,'request\x20sent');_0x4d69c8(_0x5eb9ad[_0xd7ce('0x16')][_0xd7ce('0x15')]);}})['catch'](function(_0x3f2b1f){logger[_0xd7ce('0x13')](_0xd7ce('0x10'),_0x2b5e04,_0x3f2b1f);_0x203d64(_0x3f2b1f);});});}exports[_0xd7ce('0x17')]=function(_0x29ab37){var _0x494f0c=this;return new Promise(function(_0x55ba19,_0x1eaf81){return db[_0xd7ce('0x18')][_0xd7ce('0x19')](_0x29ab37[_0xd7ce('0x1a')],{'raw':_0x29ab37[_0xd7ce('0x1b')]?_0x29ab37['options'][_0xd7ce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ab37[_0xd7ce('0x1b')]?_0x29ab37[_0xd7ce('0x1b')][_0xd7ce('0x1d')]||null:null,'attributes':_0x29ab37[_0xd7ce('0x1b')]?_0x29ab37[_0xd7ce('0x1b')][_0xd7ce('0x1e')]||null:null,'limit':_0x29ab37[_0xd7ce('0x1b')]?_0x29ab37['options'][_0xd7ce('0x1f')]||null:null})['then'](function(_0x285076){logger[_0xd7ce('0xf')](_0xd7ce('0x17'),_0x29ab37);logger[_0xd7ce('0x12')](_0xd7ce('0x17'),_0x29ab37,JSON[_0xd7ce('0x20')](_0x285076));_0x55ba19(_0x285076);})[_0xd7ce('0x21')](function(_0x429987){logger[_0xd7ce('0x13')](_0xd7ce('0x17'),_0x429987['message'],_0x29ab37);_0x1eaf81(_0x494f0c[_0xd7ce('0x13')](0x1f4,_0x429987[_0xd7ce('0x15')]));});});};exports[_0xd7ce('0x22')]=function(_0x4a6829){return new Promise(function(_0x30d9ce,_0x352ddf){return db[_0xd7ce('0x18')][_0xd7ce('0x23')]({'where':_0x4a6829[_0xd7ce('0x1b')]?_0x4a6829[_0xd7ce('0x1b')][_0xd7ce('0x1d')]||null:null})[_0xd7ce('0xe')](function(_0x4f4e2a){if(_0x4f4e2a){return _0x4f4e2a[_0xd7ce('0x24')](_0x4a6829[_0xd7ce('0x1a')][_0xd7ce('0x25')],_[_0xd7ce('0x26')](_0x4a6829[_0xd7ce('0x1a')],['ids','id'])||{});}})[_0xd7ce('0x27')](function(_0x2a3925){logger[_0xd7ce('0xf')](_0xd7ce('0x28'),_0x4a6829);logger[_0xd7ce('0x12')]('AddTags',_0x4a6829,JSON[_0xd7ce('0x20')](_0x2a3925));_0x30d9ce(_0x2a3925);})['catch'](function(_0x51d684){logger['error'](_0xd7ce('0x28'),_0x51d684[_0xd7ce('0x15')],_0x4a6829);_0x352ddf(_this[_0xd7ce('0x13')](0x1f4,_0x51d684['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 519fd25..44e4a5e 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 _0x9338=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x9338,0x1ec));var _0x8933=function(_0x215f9e,_0x438b14){_0x215f9e=_0x215f9e-0x0;var _0x217ce4=_0x9338[_0x215f9e];return _0x217ce4;};'use strict';var MailInteractionEvents=require(_0x8933('0x0'));var events=[_0x8933('0x1'),_0x8933('0x2'),_0x8933('0x3')];function createListener(_0x52d095,_0x216739){return function(_0x27938a){_0x216739[_0x8933('0x4')](_0x52d095,_0x27938a);};}function removeListener(_0x440421,_0x1ba00e){return function(){MailInteractionEvents[_0x8933('0x5')](_0x440421,_0x1ba00e);};}exports[_0x8933('0x6')]=function(_0x257b81){for(var _0x16f61d=0x0,_0x16aa7a=events[_0x8933('0x7')];_0x16f61d<_0x16aa7a;_0x16f61d++){var _0x5d1f90=events[_0x16f61d];var _0x1e9427=createListener(_0x8933('0x8')+_0x5d1f90,_0x257b81);MailInteractionEvents['on'](_0x5d1f90,_0x1e9427);}}; \ No newline at end of file +var _0x7b3d=['save','emit','mailInteraction:','./mailInteraction.events'];(function(_0x484f8b,_0x29f41c){var _0x26caed=function(_0x5d814c){while(--_0x5d814c){_0x484f8b['push'](_0x484f8b['shift']());}};_0x26caed(++_0x29f41c);}(_0x7b3d,0x7f));var _0xd7b3=function(_0x3edfdc,_0x4f1dad){_0x3edfdc=_0x3edfdc-0x0;var _0x324d30=_0x7b3d[_0x3edfdc];return _0x324d30;};'use strict';var MailInteractionEvents=require(_0xd7b3('0x0'));var events=[_0xd7b3('0x1'),'remove','update'];function createListener(_0x3ef6cd,_0x29041b){return function(_0x39ea3c){_0x29041b[_0xd7b3('0x2')](_0x3ef6cd,_0x39ea3c);};}function removeListener(_0x3b36a5,_0x1e3144){return function(){MailInteractionEvents['removeListener'](_0x3b36a5,_0x1e3144);};}exports['register']=function(_0x23280d){for(var _0x1a5d49=0x0,_0x5075eb=events['length'];_0x1a5d49<_0x5075eb;_0x1a5d49++){var _0xdf70c5=events[_0x1a5d49];var _0x2c45e5=createListener(_0xd7b3('0x3')+_0xdf70c5,_0x23280d);MailInteractionEvents['on'](_0xdf70c5,_0x2c45e5);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index fd6227e..587e944 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 _0x268c=['/:id/reject','reject','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept'];(function(_0x2255e2,_0x162a6c){var _0x15bb8e=function(_0x340882){while(--_0x340882){_0x2255e2['push'](_0x2255e2['shift']());}};_0x15bb8e(++_0x162a6c);}(_0x268c,0xb3));var _0xc268=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0x268c[_0x290694];return _0x5a0f2e;};'use strict';var multer=require(_0xc268('0x0'));var util=require('util');var path=require(_0xc268('0x1'));var timeout=require('connect-timeout');var express=require(_0xc268('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc268('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc268('0x4'));var controller=require(_0xc268('0x5'));router[_0xc268('0x6')]('/',auth[_0xc268('0x7')](),controller['index']);router['get'](_0xc268('0x8'),auth[_0xc268('0x7')](),controller['describe']);router[_0xc268('0x6')](_0xc268('0x9'),auth[_0xc268('0x7')](),controller[_0xc268('0xa')]);router[_0xc268('0x6')](_0xc268('0xb'),auth[_0xc268('0x7')](),controller[_0xc268('0xc')]);router[_0xc268('0xd')]('/',auth[_0xc268('0x7')](),interaction[_0xc268('0xe')](_0xc268('0xf'),_0xc268('0x10')),controller[_0xc268('0x11')]);router['put'](_0xc268('0x9'),auth[_0xc268('0x7')](),controller['update']);router[_0xc268('0x12')](_0xc268('0x13'),auth[_0xc268('0x7')](),controller[_0xc268('0x14')]);router[_0xc268('0x12')](_0xc268('0x15'),auth['isAuthenticated'](),controller[_0xc268('0x16')]);router['delete'](_0xc268('0x9'),auth[_0xc268('0x7')](),controller[_0xc268('0x17')]);module[_0xc268('0x18')]=router; \ No newline at end of file +var _0x2868=['mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x2868,0x191));var _0x8286=function(_0x1f0f99,_0x3da0c9){_0x1f0f99=_0x1f0f99-0x0;var _0x288275=_0x2868[_0x1f0f99];return _0x288275;};'use strict';var multer=require(_0x8286('0x0'));var util=require('util');var path=require(_0x8286('0x1'));var timeout=require(_0x8286('0x2'));var express=require('express');var router=express[_0x8286('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8286('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8286('0x5'));var controller=require(_0x8286('0x6'));router['get']('/',auth[_0x8286('0x7')](),controller[_0x8286('0x8')]);router[_0x8286('0x9')](_0x8286('0xa'),auth['isAuthenticated'](),controller[_0x8286('0xb')]);router[_0x8286('0x9')](_0x8286('0xc'),auth[_0x8286('0x7')](),controller[_0x8286('0xd')]);router[_0x8286('0x9')](_0x8286('0xe'),auth['isAuthenticated'](),controller[_0x8286('0xf')]);router[_0x8286('0x10')]('/',auth[_0x8286('0x7')](),interaction[_0x8286('0x11')](_0x8286('0x12'),_0x8286('0x13')),controller[_0x8286('0x14')]);router[_0x8286('0x15')](_0x8286('0xc'),auth['isAuthenticated'](),controller[_0x8286('0x16')]);router[_0x8286('0x15')](_0x8286('0x17'),auth[_0x8286('0x7')](),controller[_0x8286('0x18')]);router[_0x8286('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8286('0x19')]);router[_0x8286('0x1a')](_0x8286('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8286('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 541585c..eedf2d3 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 _0xb4e4=['STRING','long','DATE','INTEGER','ENUM','Email','exports','TEXT','medium','BOOLEAN','out'];(function(_0x43c08f,_0x21da61){var _0x46662b=function(_0x198acf){while(--_0x198acf){_0x43c08f['push'](_0x43c08f['shift']());}};_0x46662b(++_0x21da61);}(_0xb4e4,0x119));var _0x4b4e=function(_0x593e5d,_0x5a6a80){_0x593e5d=_0x593e5d-0x0;var _0x2ace1a=_0xb4e4[_0x593e5d];return _0x2ace1a;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x4b4e('0x0')]={'body':{'type':Sequelize[_0x4b4e('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4b4e('0x1')](_0x4b4e('0x2'))},'read':{'type':Sequelize[_0x4b4e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4b4e('0x4')),'defaultValue':_0x4b4e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4b4e('0x5')]},'to':{'type':Sequelize[_0x4b4e('0x1')](_0x4b4e('0x6'))},'cc':{'type':Sequelize[_0x4b4e('0x1')](_0x4b4e('0x6'))},'bcc':{'type':Sequelize[_0x4b4e('0x1')](_0x4b4e('0x6'))},'subject':{'type':Sequelize[_0x4b4e('0x1')]},'sentAt':{'type':Sequelize[_0x4b4e('0x7')]},'attach':{'type':Sequelize[_0x4b4e('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4b4e('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4b4e('0x7')]},'originTo':{'type':Sequelize[_0x4b4e('0x1')](_0x4b4e('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x4b4e('0x6'))},'originChannel':{'type':Sequelize[_0x4b4e('0x9')](_0x4b4e('0xa'),'Chat'),'defaultValue':_0x4b4e('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xc87b=['medium','BOOLEAN','out','STRING','long','DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','TEXT'];(function(_0x4ede04,_0x58132b){var _0x49ccfc=function(_0x51a704){while(--_0x51a704){_0x4ede04['push'](_0x4ede04['shift']());}};_0x49ccfc(++_0x58132b);}(_0xc87b,0xb2));var _0xbc87=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc87b[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0xbc87('0x0'));var _=require(_0xbc87('0x1'));module[_0xbc87('0x2')]={'body':{'type':Sequelize[_0xbc87('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbc87('0x3')](_0xbc87('0x4'))},'read':{'type':Sequelize[_0xbc87('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbc87('0x6')),'defaultValue':_0xbc87('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbc87('0x7')](0x1fe)},'from':{'type':Sequelize[_0xbc87('0x7')]},'to':{'type':Sequelize['TEXT'](_0xbc87('0x8'))},'cc':{'type':Sequelize[_0xbc87('0x3')](_0xbc87('0x8'))},'bcc':{'type':Sequelize[_0xbc87('0x3')](_0xbc87('0x8'))},'subject':{'type':Sequelize[_0xbc87('0x3')]},'sentAt':{'type':Sequelize[_0xbc87('0x9')]},'attach':{'type':Sequelize[_0xbc87('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbc87('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbc87('0x9')]},'originTo':{'type':Sequelize[_0xbc87('0x3')]('long')},'originCc':{'type':Sequelize[_0xbc87('0x3')]('long')},'originChannel':{'type':Sequelize[_0xbc87('0xb')](_0xbc87('0xc'),_0xbc87('0xd')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index f444dd3..a309992 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 _0x5243=['findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','length','attachments','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','format','UserId','agent','get','isNil','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','channel','event','rejectmessage','unix','toString','join','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','from','decode','headers','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','download','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','status','json','undefined','limit','count','offset','set','update','destroy','end','stack','name','index','map','MailMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','body','find','create','out','secret','split'];(function(_0x35f3a5,_0x4632ec){var _0x2af4b0=function(_0x36c989){while(--_0x36c989){_0x35f3a5['push'](_0x35f3a5['shift']());}};_0x2af4b0(++_0x4632ec);}(_0x5243,0x18b));var _0x3524=function(_0x3f592d,_0xcb4d93){_0x3f592d=_0x3f592d-0x0;var _0x51cbaf=_0x5243[_0x3f592d];return _0x51cbaf;};'use strict';var emlformat=require('eml-format');var moment=require(_0x3524('0x0'));var BPromise=require('bluebird');var util=require(_0x3524('0x1'));var path=require(_0x3524('0x2'));var fs=require('fs');var _=require(_0x3524('0x3'));var Redis=require(_0x3524('0x4'));var htmlToText=require(_0x3524('0x5'));var qs=require(_0x3524('0x6'));var logger=require(_0x3524('0x7'))('api');var interaction_log=require(_0x3524('0x7'))('mail-interactions');var config=require(_0x3524('0x8'));var db=require(_0x3524('0x9'))['db'];config['redis']=_['defaults'](config[_0x3524('0xa')],{'host':_0x3524('0xb'),'port':0x18eb});var socket=require(_0x3524('0xc'))(new Redis(config[_0x3524('0xa')]));var htmlEntities=require(_0x3524('0xd'));require('./mailMessage.socket')[_0x3524('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3524('0xf')]['http']({'port':0x232c});var client9003=jayson[_0x3524('0xf')][_0x3524('0x10')]({'port':0x232b});var client9002=jayson[_0x3524('0xf')][_0x3524('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x19f3da,_0x10fc09,_0x3c0660,_0x468cf8){return new BPromise(function(_0x1e1421,_0x5b3ae2){var _0x5ee1e9=_0x468cf8||client;return _0x5ee1e9['request'](_0x19f3da,_0x3c0660)[_0x3524('0x11')](function(_0x386e2c){logger[_0x3524('0x12')](_0x3524('0x13'),_0x10fc09,_0x3524('0x14'));logger[_0x3524('0x15')](_0x3524('0x16'),_0x10fc09,_0x3524('0x14'),JSON['stringify'](_0x386e2c));if(_0x386e2c[_0x3524('0x17')]){if(_0x386e2c[_0x3524('0x17')][_0x3524('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x10fc09,_0x386e2c['error'][_0x3524('0x19')]);return _0x5b3ae2(_0x386e2c[_0x3524('0x17')][_0x3524('0x19')]);}logger[_0x3524('0x17')](_0x3524('0x13'),_0x10fc09,_0x386e2c[_0x3524('0x17')][_0x3524('0x19')]);return _0x1e1421(_0x386e2c[_0x3524('0x17')]['message']);}else{logger[_0x3524('0x12')]('MailMessage,\x20%s,\x20%s',_0x10fc09,_0x3524('0x14'));_0x1e1421(_0x386e2c['result'][_0x3524('0x19')]);}})['catch'](function(_0x589450){logger[_0x3524('0x17')](_0x3524('0x13'),_0x10fc09,_0x589450);_0x5b3ae2(_0x589450);});});}function respondWithResult(_0x55db04,_0x406324){_0x406324=_0x406324||0xc8;return function(_0x4dd311){if(_0x4dd311){return _0x55db04[_0x3524('0x1a')](_0x406324)[_0x3524('0x1b')](_0x4dd311);}};}function respondWithFilteredResult(_0x16d899,_0x406c01){return function(_0xdbab85){if(_0xdbab85){var _0x4b97c8=typeof _0x406c01['offset']===_0x3524('0x1c')&&typeof _0x406c01[_0x3524('0x1d')]===_0x3524('0x1c');var _0x4044cb=_0xdbab85[_0x3524('0x1e')];var _0x127e9d=_0x4b97c8?0x0:_0x406c01[_0x3524('0x1f')];var _0x2f8dd5=_0x4b97c8?_0xdbab85[_0x3524('0x1e')]:_0x406c01[_0x3524('0x1f')]+_0x406c01['limit'];var _0x4d86be;if(_0x2f8dd5>=_0x4044cb){_0x2f8dd5=_0x4044cb;_0x4d86be=0xc8;}else{_0x4d86be=0xce;}_0x16d899['status'](_0x4d86be);return _0x16d899[_0x3524('0x20')]('Content-Range',_0x127e9d+'-'+_0x2f8dd5+'/'+_0x4044cb)[_0x3524('0x1b')](_0xdbab85);}return null;};}function saveUpdates(_0x1c5d8e){return function(_0x5c2020){if(_0x5c2020){return _0x5c2020[_0x3524('0x21')](_0x1c5d8e)[_0x3524('0x11')](function(_0x3ef8d4){return _0x3ef8d4;});}return null;};}function removeEntity(_0x1072be){return function(_0x3500c4){if(_0x3500c4){return _0x3500c4[_0x3524('0x22')]()['then'](function(){_0x1072be[_0x3524('0x1a')](0xcc)[_0x3524('0x23')]();});}};}function handleEntityNotFound(_0xc31373){return function(_0x37cea3){if(!_0x37cea3){_0xc31373['sendStatus'](0x194);}return _0x37cea3;};}function handleError(_0x119062,_0x32e5dd){_0x32e5dd=_0x32e5dd||0x1f4;return function(_0x48b3fe){logger['error'](_0x48b3fe[_0x3524('0x24')]);if(_0x48b3fe['name']){delete _0x48b3fe[_0x3524('0x25')];}_0x119062[_0x3524('0x1a')](_0x32e5dd)['send'](_0x48b3fe);};}exports[_0x3524('0x26')]=function(_0x2ddc29,_0x39b12f){var _0x35eeae={},_0x43e0f4={},_0x286220={'count':0x0,'rows':[]};var _0x3eb0b5=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')],function(_0x5e9d97){return{'name':_0x5e9d97[_0x3524('0x2a')],'type':_0x5e9d97['type']['key']};});_0x43e0f4[_0x3524('0x2b')]=_[_0x3524('0x27')](_0x3eb0b5,_0x3524('0x25'));_0x43e0f4[_0x3524('0x2c')]=_['keys'](_0x2ddc29[_0x3524('0x2c')]);_0x43e0f4[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x43e0f4['model'],_0x43e0f4[_0x3524('0x2c')]);_0x35eeae[_0x3524('0x2f')]=_[_0x3524('0x2e')](_0x43e0f4[_0x3524('0x2b')],qs['fields'](_0x2ddc29['query'][_0x3524('0x30')]));_0x35eeae['attributes']=_0x35eeae[_0x3524('0x2f')]['length']?_0x35eeae['attributes']:_0x43e0f4[_0x3524('0x2b')];if(!_0x2ddc29[_0x3524('0x2c')][_0x3524('0x31')](_0x3524('0x32'))){_0x35eeae[_0x3524('0x1d')]=qs[_0x3524('0x1d')](_0x2ddc29[_0x3524('0x2c')][_0x3524('0x1d')]);_0x35eeae['offset']=qs['offset'](_0x2ddc29[_0x3524('0x2c')][_0x3524('0x1f')]);}_0x35eeae[_0x3524('0x33')]=qs[_0x3524('0x34')](_0x2ddc29[_0x3524('0x2c')]['sort']);_0x35eeae['where']=qs[_0x3524('0x2d')](_[_0x3524('0x35')](_0x2ddc29['query'],_0x43e0f4[_0x3524('0x2d')]),_0x3eb0b5);if(_0x2ddc29[_0x3524('0x2c')][_0x3524('0x36')]){_0x35eeae['where']=_['merge'](_0x35eeae[_0x3524('0x37')],{'$or':_[_0x3524('0x27')](_0x3eb0b5,function(_0x3603de){if(_0x3603de[_0x3524('0x38')]!==_0x3524('0x39')){var _0x522dee={};_0x522dee[_0x3603de[_0x3524('0x25')]]={'$like':'%'+_0x2ddc29['query'][_0x3524('0x36')]+'%'};return _0x522dee;}})});}_0x35eeae=_['merge']({},_0x35eeae,_0x2ddc29[_0x3524('0x3a')]);var _0x58ff46={'where':_0x35eeae[_0x3524('0x37')]};return db['MailMessage'][_0x3524('0x1e')](_0x58ff46)[_0x3524('0x11')](function(_0x50f44f){_0x286220[_0x3524('0x1e')]=_0x50f44f;if(_0x2ddc29[_0x3524('0x2c')][_0x3524('0x3b')]){_0x35eeae[_0x3524('0x3c')]=[{'all':!![]}];}return db[_0x3524('0x28')][_0x3524('0x3d')](_0x35eeae);})['then'](function(_0x1930bb){_0x286220[_0x3524('0x3e')]=_0x1930bb;return _0x286220;})[_0x3524('0x11')](respondWithFilteredResult(_0x39b12f,_0x35eeae))[_0x3524('0x3f')](handleError(_0x39b12f,null));};exports[_0x3524('0x40')]=function(_0x51c809,_0x16f806){var _0x5d102d={'raw':!![],'where':{'id':_0x51c809[_0x3524('0x41')]['id']}},_0x123e98={};_0x123e98['model']=_[_0x3524('0x42')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x123e98[_0x3524('0x2c')]=_[_0x3524('0x42')](_0x51c809[_0x3524('0x2c')]);_0x123e98[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x123e98[_0x3524('0x2b')],_0x123e98[_0x3524('0x2c')]);_0x5d102d['attributes']=_[_0x3524('0x2e')](_0x123e98[_0x3524('0x2b')],qs['fields'](_0x51c809['query']['fields']));_0x5d102d['attributes']=_0x5d102d[_0x3524('0x2f')]['length']?_0x5d102d[_0x3524('0x2f')]:_0x123e98[_0x3524('0x2b')];if(_0x51c809[_0x3524('0x2c')][_0x3524('0x3b')]){_0x5d102d[_0x3524('0x3c')]=[{'all':!![]}];}_0x5d102d=_['merge']({},_0x5d102d,_0x51c809[_0x3524('0x3a')]);return db[_0x3524('0x28')]['find'](_0x5d102d)[_0x3524('0x11')](handleEntityNotFound(_0x16f806,null))['then'](respondWithResult(_0x16f806,null))[_0x3524('0x3f')](handleError(_0x16f806,null));};exports[_0x3524('0x21')]=function(_0x70dbe2,_0x3c2a74){if(_0x70dbe2['body']['id']){delete _0x70dbe2[_0x3524('0x43')]['id'];}return db['MailMessage'][_0x3524('0x44')]({'where':{'id':_0x70dbe2[_0x3524('0x41')]['id']}})[_0x3524('0x11')](handleEntityNotFound(_0x3c2a74,null))['then'](saveUpdates(_0x70dbe2[_0x3524('0x43')],null))[_0x3524('0x11')](respondWithResult(_0x3c2a74,null))[_0x3524('0x3f')](handleError(_0x3c2a74,null));};exports[_0x3524('0x22')]=function(_0x10fc91,_0x171a74){return db[_0x3524('0x28')][_0x3524('0x44')]({'where':{'id':_0x10fc91[_0x3524('0x41')]['id']}})['then'](handleEntityNotFound(_0x171a74,null))[_0x3524('0x11')](removeEntity(_0x171a74,null))[_0x3524('0x3f')](handleError(_0x171a74,null));};exports['describe']=function(_0x1d7113,_0x463c49){return db[_0x3524('0x28')]['describe']()['then'](respondWithResult(_0x463c49,null))[_0x3524('0x3f')](handleError(_0x463c49,null));};exports['create']=function(_0x4de0a1,_0x4e8c10){return db[_0x3524('0x28')][_0x3524('0x45')](_0x4de0a1['body'])[_0x3524('0x11')](function(_0x105668){if(_0x105668){if(_0x105668['direction']===_0x3524('0x46')&&!_0x105668[_0x3524('0x47')]){var _0x39e2b1,_0x15daaa,_0x4e1158;if(_0x4de0a1[_0x3524('0x43')]['to']){_0x15daaa=_0x4de0a1['body']['to'][_0x3524('0x48')](',')[0x0];}return db['MailAccount'][_0x3524('0x49')]({'where':{'id':_0x105668[_0x3524('0x4a')]},'include':[{'model':db[_0x3524('0x4b')],'as':_0x3524('0x4c'),'include':[{'model':db[_0x3524('0x4d')],'as':_0x3524('0x4e'),'where':{'email':_0x15daaa},'limit':0x1,'order':[[_0x3524('0x4f'),_0x3524('0x50')]]}]},{'model':db[_0x3524('0x51')],'as':_0x3524('0x52'),'raw':!![],'include':[{'model':db[_0x3524('0x53')],'as':_0x3524('0x53'),'raw':!![]}]}]})[_0x3524('0x11')](function(_0x5ab7a6){_0x39e2b1=_0x5ab7a6;if(!_0x39e2b1||!_0x39e2b1[_0x3524('0x52')])return;var _0x2f366a=_0x39e2b1[_0x3524('0x54')]();if(_0x4de0a1[_0x3524('0x43')]['attachments']&&_0x4de0a1[_0x3524('0x43')]['attachments'][_0x3524('0x55')]){for(var _0x478b99=0x0;_0x478b99<_0x4de0a1['body']['attachments'][_0x3524('0x55')];_0x478b99+=0x1){_0x4de0a1['body'][_0x3524('0x56')][_0x478b99]={'filename':_0x4de0a1[_0x3524('0x43')]['attachments'][_0x478b99][_0x3524('0x25')],'path':path['join'](config[_0x3524('0x57')],_0x3524('0x58'),_0x4de0a1['body'][_0x3524('0x56')][_0x478b99][_0x3524('0x59')])};}}_0x4e1158={'account':_0x2f366a,'message':_0x4de0a1[_0x3524('0x43')]};return;})[_0x3524('0x11')](function(){if(_0x39e2b1[_0x3524('0x4c')]){if(_0x39e2b1[_0x3524('0x4c')]['Contacts'][_0x3524('0x55')]){return _0x39e2b1[_0x3524('0x4c')]['Contacts'][0x0];}else{return db['CmContact'][_0x3524('0x45')](_['defaults'](_0x4de0a1[_0x3524('0x43')],{'firstName':_0x4de0a1[_0x3524('0x43')]['to'],'email':_0x4de0a1['body']['to'],'phone':_0x4de0a1[_0x3524('0x43')]['to'],'ListId':_0x39e2b1[_0x3524('0x5a')]}));}}else{throw new Error(_0x3524('0x5b'));}})['then'](function(){if(_0x4e1158){return respondWithRpcPromise(_0x3524('0x5c'),_0x3524('0x5d'),_0x4e1158,client9003)[_0x3524('0x11')](function(_0x2338f4){return _0x105668['update']({'read':!![],'messageId':_0x2338f4[_0x3524('0x5e')],'sentAt':moment()['format'](_0x3524('0x5f'))});})[_0x3524('0x3f')](function(_0x3e95a3){logger[_0x3524('0x17')]('%s',JSON[_0x3524('0x60')](_0x3e95a3));return _0x105668;});}return _0x105668;});}return _0x105668;}})['then'](respondWithResult(_0x4e8c10,0xc9))[_0x3524('0x3f')](handleError(_0x4e8c10,null));};exports[_0x3524('0x61')]=function(_0x2f2a74,_0x245027){var _0x222058={'agent':{},'channel':_0x3524('0x62')};if(_0x2f2a74[_0x3524('0x43')]['id']){delete _0x2f2a74[_0x3524('0x43')]['id'];}_0x2f2a74['body'][_0x3524('0x63')]=!![];_0x2f2a74[_0x3524('0x43')]['readAt']=moment()[_0x3524('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f2a74['body'][_0x3524('0x65')]=_0x2f2a74[_0x3524('0x43')][_0x3524('0x65')]||_0x2f2a74['user']['id'];_0x222058[_0x3524('0x66')]['id']=_0x2f2a74[_0x3524('0x43')]['UserId'];return db[_0x3524('0x28')]['find']({'where':{'id':_0x2f2a74[_0x3524('0x41')]['id'],'UserId':null}})[_0x3524('0x11')](handleEntityNotFound(_0x245027,null))[_0x3524('0x11')](saveUpdates(_0x2f2a74[_0x3524('0x43')],null))['then'](function(_0x2f2d52){if(_0x2f2d52){_0x222058['message']=_0x2f2d52[_0x3524('0x67')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2f2d52['MailInteractionId']}});}return null;})[_0x3524('0x11')](handleEntityNotFound(_0x245027,null))['then'](function(_0x416327){if(_0x416327){return _0x416327[_0x3524('0x21')]({'UserId':_0x2f2a74[_0x3524('0x43')]['UserId'],'read1stAt':_[_0x3524('0x68')](_0x416327['read1stAt'])?moment()['format'](_0x3524('0x5f')):undefined});}return null;})[_0x3524('0x11')](function(_0x394b8c){if(_0x394b8c){_0x222058['interaction']=_0x394b8c[_0x3524('0x67')]({'plain':!![]});interaction_log['info'](_0x3524('0x69'),_0x2f2a74[_0x3524('0x6a')]['id'],_0x2f2a74[_0x3524('0x6a')][_0x3524('0x25')],_0x2f2a74[_0x3524('0x6a')][_0x3524('0x6b')],_0x222058[_0x3524('0x6c')]['id'],_0x2f2a74[_0x3524('0x43')]?JSON['stringify'](_0x2f2a74[_0x3524('0x43')]):_0x3524('0x6d'));return respondWithRpcPromise(_0x3524('0x6e'),'acceptMessage',_0x222058);}return null;})[_0x3524('0x11')](function(_0x2d83a1){var _0x30fa7a=_0x3524('0x6f')+_0x2d83a1['message'][_0x3524('0x70')];return db['sequelize'][_0x3524('0x2c')](_0x30fa7a,{'type':db['Sequelize'][_0x3524('0x71')][_0x3524('0x72')],'raw':!![]})['then'](function(_0x2430de){return _0x2430de;});})['then'](function(_0x53618c){if(_0x53618c){_0x222058['message'][_0x3524('0x73')]=_0x53618c[0x0];if(!_0x2f2a74[_0x3524('0x43')]['UserId'])return;return db['User'][_0x3524('0x44')]({'where':{'id':_0x2f2a74[_0x3524('0x43')][_0x3524('0x65')],'role':_0x3524('0x66')},'attributes':['id',_0x3524('0x25'),_0x3524('0x74'),_0x3524('0x75'),_0x3524('0x76')],'raw':!![]});}return null;})[_0x3524('0x11')](function(_0x21432e){if(!_0x21432e)return null;_0x222058[_0x3524('0x19')][_0x3524('0x66')]=_0x21432e;return _0x222058;})[_0x3524('0x11')](function(_0x4a8fbe){if(_0x4a8fbe){if(_0x2f2a74['body'][_0x3524('0x77')]){_0x222058['message'][_0x3524('0x78')]=util[_0x3524('0x64')](_0x3524('0x79'),_0x2f2a74['user']['name']);_0x222058['message']['channel']=_0x222058['channel'];_0x222058['message'][_0x3524('0x7a')]=_0x222058['channel'];_0x222058['message']['event']=_0x3524('0x61');_0x222058[_0x3524('0x19')][_0x3524('0x43')]=htmlToText[_0x3524('0x7b')](_0x222058[_0x3524('0x19')][_0x3524('0x43')]);return respondWithRpcPromise(_0x3524('0x7c'),_0x3524('0x7c'),{'event':_0x3524('0x7d'),'message':_0x222058[_0x3524('0x19')]},client9002)[_0x3524('0x11')](function(){return _0x222058;});}return _0x222058;}return null;})[_0x3524('0x11')](respondWithResult(_0x245027,null))[_0x3524('0x3f')](handleError(_0x245027,null));};exports[_0x3524('0x7e')]=function(_0x34bd2a,_0x54d50f){var _0x2620e8={'agent':{},'channel':'mail'};if(_0x34bd2a[_0x3524('0x43')]['id']){delete _0x34bd2a[_0x3524('0x43')]['id'];}_0x34bd2a['body'][_0x3524('0x65')]=_0x34bd2a[_0x3524('0x43')][_0x3524('0x65')]||_0x34bd2a[_0x3524('0x6a')]['id'];_0x2620e8['agent']['id']=_0x34bd2a['body'][_0x3524('0x65')];return db[_0x3524('0x28')][_0x3524('0x44')]({'where':{'id':_0x34bd2a[_0x3524('0x41')]['id'],'UserId':null}})[_0x3524('0x11')](handleEntityNotFound(_0x54d50f,null))[_0x3524('0x11')](function(_0x4202f2){if(_0x4202f2){_0x2620e8[_0x3524('0x19')]=_0x4202f2[_0x3524('0x67')]({'plain':!![]});return db[_0x3524('0x7f')][_0x3524('0x44')]({'where':{'id':_0x4202f2[_0x3524('0x80')]}});}return null;})[_0x3524('0x11')](handleEntityNotFound(_0x54d50f,null))[_0x3524('0x11')](function(_0x2c350e){if(_0x2c350e){_0x2620e8[_0x3524('0x6c')]=_0x2c350e[_0x3524('0x67')]({'plain':!![]});interaction_log[_0x3524('0x12')](_0x3524('0x81'),_0x34bd2a[_0x3524('0x6a')]['id'],_0x34bd2a[_0x3524('0x6a')][_0x3524('0x25')],_0x34bd2a['user'][_0x3524('0x6b')],_0x2620e8[_0x3524('0x6c')]['id'],_0x34bd2a[_0x3524('0x43')]?JSON['stringify'](_0x34bd2a[_0x3524('0x43')]):_0x3524('0x6d'));return respondWithRpcPromise(_0x3524('0x82'),'rejectMessage',_0x2620e8);}return null;})[_0x3524('0x11')](function(_0x16e71d){var _0x870b95='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x16e71d[_0x3524('0x19')][_0x3524('0x70')];return db['sequelize'][_0x3524('0x2c')](_0x870b95,{'type':db['Sequelize']['QueryTypes'][_0x3524('0x72')],'raw':!![]})[_0x3524('0x11')](function(_0xa0a20e){return _0xa0a20e;});})[_0x3524('0x11')](function(_0x3358f5){if(_0x3358f5){_0x2620e8['message'][_0x3524('0x73')]=_0x3358f5[0x0];if(!_0x34bd2a[_0x3524('0x43')][_0x3524('0x65')])return;return db[_0x3524('0x83')][_0x3524('0x44')]({'where':{'id':_0x34bd2a[_0x3524('0x43')]['UserId'],'role':'agent'},'attributes':['id',_0x3524('0x25'),_0x3524('0x74'),_0x3524('0x75'),_0x3524('0x76')],'raw':!![]});}return null;})['then'](function(_0x318388){if(!_0x318388)return null;_0x2620e8[_0x3524('0x19')][_0x3524('0x66')]=_0x318388;return _0x2620e8;})[_0x3524('0x11')](function(_0x5d261f){if(_0x5d261f){_0x5d261f[_0x3524('0x19')]['interface']=util[_0x3524('0x64')](_0x3524('0x79'),_0x34bd2a[_0x3524('0x6a')]['name']);_0x5d261f[_0x3524('0x19')]['channel']=_0x2620e8[_0x3524('0x84')];_0x5d261f[_0x3524('0x19')]['motionChannel']=_0x2620e8[_0x3524('0x84')];_0x5d261f['message'][_0x3524('0x85')]=_0x3524('0x7e');_0x5d261f['message']['body']=htmlToText[_0x3524('0x7b')](_0x2620e8[_0x3524('0x19')][_0x3524('0x43')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0x3524('0x86'),'message':_0x5d261f[_0x3524('0x19')]},client9002);return _0x2620e8;}return null;})['then'](respondWithResult(_0x54d50f,null))[_0x3524('0x3f')](handleError(_0x54d50f,null));};exports['download']=function(_0x262dcb,_0x4e9011){var _0x4a59f0=moment()[_0x3524('0x87')]()[_0x3524('0x88')]();var _0x4249b7=path[_0x3524('0x89')](config[_0x3524('0x57')],_0x3524('0x8a'),_0x3524('0x8b'),_0x3524('0x8c'));var _0x536670=path[_0x3524('0x89')](config[_0x3524('0x57')],_0x3524('0x8a'),_0x3524('0x8b'),_0x3524('0x56'));var _0x307b00=util[_0x3524('0x64')](_0x3524('0x8d'),_0x4a59f0);return db[_0x3524('0x28')][_0x3524('0x44')]({'where':{'id':_0x262dcb[_0x3524('0x41')]['id']},'attributes':['id','body','from','to','cc',_0x3524('0x8e'),_0x3524('0x8f'),_0x3524('0x90')],'include':_0x262dcb['query']['attachments']?[{'model':db[_0x3524('0x91')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x4e9011,null))[_0x3524('0x11')](function(_0x31b55f){if(_0x31b55f){var _0x3eb3c7=_0x31b55f;var _0x221f37={'from':_0x3eb3c7[_0x3524('0x92')],'to':_0x3eb3c7['to'],'subject':_0x3eb3c7[_0x3524('0x8f')],'html':htmlEntities[_0x3524('0x93')](_0x3eb3c7[_0x3524('0x43')]),'headers':{'Date':moment(_0x3eb3c7[_0x3524('0x90')])[_0x3524('0x64')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x31b55f['cc']){_0x221f37[_0x3524('0x94')]['Cc']=_0x31b55f['cc'];}if(_0x31b55f[_0x3524('0x8e')]){_0x221f37[_0x3524('0x94')][_0x3524('0x95')]=_0x31b55f['bcc'];}return new BPromise(function(_0x75c0,_0x53895a){if(_0x31b55f['Attachments']){for(var _0x4f78eb=0x0;_0x4f78eb<_0x31b55f['Attachments'][_0x3524('0x55')];_0x4f78eb++){var _0x4805a1=_0x31b55f[_0x3524('0x96')][_0x4f78eb];var _0x21f25f=path[_0x3524('0x89')](_0x536670,_0x4805a1[_0x3524('0x59')]);if(fs[_0x3524('0x97')](_0x21f25f)){_0x221f37[_0x3524('0x56')][_0x3524('0x98')]({'name':_0x4805a1[_0x3524('0x25')],'contentType':_0x4805a1[_0x3524('0x38')],'data':fs[_0x3524('0x99')](_0x21f25f)});}}}emlformat['build'](_0x221f37,function(_0x39a75c,_0x19717a){if(_0x39a75c)return _0x53895a(_0x39a75c);fs[_0x3524('0x9a')](path['join'](_0x4249b7,_0x307b00),_0x19717a);return _0x75c0(_0x19717a);});});}})[_0x3524('0x11')](function(_0x3d996a){if(_0x3d996a){return _0x4e9011[_0x3524('0x9b')](path[_0x3524('0x89')](_0x4249b7,_0x307b00),_0x307b00,function(_0x3f7c10){if(!_0x3f7c10)fs['unlinkSync'](path[_0x3524('0x89')](_0x4249b7,_0x307b00));});}})['catch'](handleError(_0x4e9011,null));}; \ No newline at end of file +var _0x53cd=['tmp','message-%s.eml','bcc','subject','createdAt','Attachments','from','headers','Bcc','existsSync','push','readFileSync','build','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','findAll','rows','show','include','find','catch','body','params','describe','create','direction','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','format','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','user','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','interface','SIP/%s','channel','motionChannel','acceptmessage','reject','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','event','fromString','EventManager','rejectmessage','download','unix','toString','root','server','files'];(function(_0x1ed73a,_0x8b55df){var _0x1599d8=function(_0x4339d5){while(--_0x4339d5){_0x1ed73a['push'](_0x1ed73a['shift']());}};_0x1599d8(++_0x8b55df);}(_0x53cd,0x1db));var _0xd53c=function(_0xece131,_0x22a53d){_0xece131=_0xece131-0x0;var _0x17a28f=_0x53cd[_0xece131];return _0x17a28f;};'use strict';var emlformat=require(_0xd53c('0x0'));var moment=require(_0xd53c('0x1'));var BPromise=require(_0xd53c('0x2'));var util=require(_0xd53c('0x3'));var path=require(_0xd53c('0x4'));var fs=require('fs');var _=require(_0xd53c('0x5'));var Redis=require(_0xd53c('0x6'));var htmlToText=require('html-to-text');var qs=require(_0xd53c('0x7'));var logger=require('../../config/logger')(_0xd53c('0x8'));var interaction_log=require(_0xd53c('0x9'))(_0xd53c('0xa'));var config=require(_0xd53c('0xb'));var db=require('../../mysqldb')['db'];config[_0xd53c('0xc')]=_[_0xd53c('0xd')](config[_0xd53c('0xc')],{'host':_0xd53c('0xe'),'port':0x18eb});var socket=require(_0xd53c('0xf'))(new Redis(config[_0xd53c('0xc')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd53c('0x10')][_0xd53c('0x11')]({'port':0x232c});var client9003=jayson[_0xd53c('0x10')][_0xd53c('0x11')]({'port':0x232b});var client9002=jayson[_0xd53c('0x10')][_0xd53c('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x2554d1,_0x5a19ca,_0x50cfbe,_0x4003ce){return new BPromise(function(_0x53861c,_0x2d26f2){var _0x5e583e=_0x4003ce||client;return _0x5e583e['request'](_0x2554d1,_0x50cfbe)['then'](function(_0x1af280){logger[_0xd53c('0x12')](_0xd53c('0x13'),_0x5a19ca,_0xd53c('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x5a19ca,'request\x20sent',JSON[_0xd53c('0x15')](_0x1af280));if(_0x1af280[_0xd53c('0x16')]){if(_0x1af280[_0xd53c('0x16')][_0xd53c('0x17')]===0x1f4){logger[_0xd53c('0x16')](_0xd53c('0x13'),_0x5a19ca,_0x1af280[_0xd53c('0x16')][_0xd53c('0x18')]);return _0x2d26f2(_0x1af280[_0xd53c('0x16')][_0xd53c('0x18')]);}logger[_0xd53c('0x16')]('MailMessage,\x20%s,\x20%s',_0x5a19ca,_0x1af280[_0xd53c('0x16')][_0xd53c('0x18')]);return _0x53861c(_0x1af280[_0xd53c('0x16')][_0xd53c('0x18')]);}else{logger[_0xd53c('0x12')](_0xd53c('0x13'),_0x5a19ca,'request\x20sent');_0x53861c(_0x1af280[_0xd53c('0x19')][_0xd53c('0x18')]);}})['catch'](function(_0xfed1a){logger[_0xd53c('0x16')](_0xd53c('0x13'),_0x5a19ca,_0xfed1a);_0x2d26f2(_0xfed1a);});});}function respondWithResult(_0x4941a4,_0xecee26){_0xecee26=_0xecee26||0xc8;return function(_0x9feaf6){if(_0x9feaf6){return _0x4941a4[_0xd53c('0x1a')](_0xecee26)[_0xd53c('0x1b')](_0x9feaf6);}};}function respondWithFilteredResult(_0x130ccf,_0x1a9404){return function(_0x1bfc92){if(_0x1bfc92){var _0x188b98=typeof _0x1a9404['offset']===_0xd53c('0x1c')&&typeof _0x1a9404[_0xd53c('0x1d')]===_0xd53c('0x1c');var _0x44e940=_0x1bfc92['count'];var _0x1909cb=_0x188b98?0x0:_0x1a9404['offset'];var _0x538ec7=_0x188b98?_0x1bfc92[_0xd53c('0x1e')]:_0x1a9404['offset']+_0x1a9404[_0xd53c('0x1d')];var _0x3cfe66;if(_0x538ec7>=_0x44e940){_0x538ec7=_0x44e940;_0x3cfe66=0xc8;}else{_0x3cfe66=0xce;}_0x130ccf[_0xd53c('0x1a')](_0x3cfe66);return _0x130ccf[_0xd53c('0x1f')](_0xd53c('0x20'),_0x1909cb+'-'+_0x538ec7+'/'+_0x44e940)[_0xd53c('0x1b')](_0x1bfc92);}return null;};}function saveUpdates(_0x3dc42e){return function(_0x41832f){if(_0x41832f){return _0x41832f[_0xd53c('0x21')](_0x3dc42e)[_0xd53c('0x22')](function(_0x592278){return _0x592278;});}return null;};}function removeEntity(_0x52c8e3){return function(_0x5105ef){if(_0x5105ef){return _0x5105ef['destroy']()[_0xd53c('0x22')](function(){_0x52c8e3[_0xd53c('0x1a')](0xcc)[_0xd53c('0x23')]();});}};}function handleEntityNotFound(_0x3dde71){return function(_0x98f424){if(!_0x98f424){_0x3dde71[_0xd53c('0x24')](0x194);}return _0x98f424;};}function handleError(_0x15a697,_0x37d3f2){_0x37d3f2=_0x37d3f2||0x1f4;return function(_0x2c9240){logger[_0xd53c('0x16')](_0x2c9240[_0xd53c('0x25')]);if(_0x2c9240[_0xd53c('0x26')]){delete _0x2c9240[_0xd53c('0x26')];}_0x15a697[_0xd53c('0x1a')](_0x37d3f2)[_0xd53c('0x27')](_0x2c9240);};}exports[_0xd53c('0x28')]=function(_0x343e55,_0x48be83){var _0x1e889d={},_0x53cc9f={},_0x414c22={'count':0x0,'rows':[]};var _0x392462=_['map'](db['MailMessage'][_0xd53c('0x29')],function(_0x549a5a){return{'name':_0x549a5a[_0xd53c('0x2a')],'type':_0x549a5a[_0xd53c('0x2b')][_0xd53c('0x2c')]};});_0x53cc9f[_0xd53c('0x2d')]=_[_0xd53c('0x2e')](_0x392462,_0xd53c('0x26'));_0x53cc9f[_0xd53c('0x2f')]=_[_0xd53c('0x30')](_0x343e55[_0xd53c('0x2f')]);_0x53cc9f[_0xd53c('0x31')]=_[_0xd53c('0x32')](_0x53cc9f[_0xd53c('0x2d')],_0x53cc9f[_0xd53c('0x2f')]);_0x1e889d[_0xd53c('0x33')]=_[_0xd53c('0x32')](_0x53cc9f[_0xd53c('0x2d')],qs[_0xd53c('0x34')](_0x343e55[_0xd53c('0x2f')][_0xd53c('0x34')]));_0x1e889d['attributes']=_0x1e889d[_0xd53c('0x33')][_0xd53c('0x35')]?_0x1e889d[_0xd53c('0x33')]:_0x53cc9f[_0xd53c('0x2d')];if(!_0x343e55[_0xd53c('0x2f')][_0xd53c('0x36')](_0xd53c('0x37'))){_0x1e889d['limit']=qs['limit'](_0x343e55['query'][_0xd53c('0x1d')]);_0x1e889d[_0xd53c('0x38')]=qs[_0xd53c('0x38')](_0x343e55[_0xd53c('0x2f')][_0xd53c('0x38')]);}_0x1e889d['order']=qs['sort'](_0x343e55['query'][_0xd53c('0x39')]);_0x1e889d[_0xd53c('0x3a')]=qs['filters'](_[_0xd53c('0x3b')](_0x343e55[_0xd53c('0x2f')],_0x53cc9f[_0xd53c('0x31')]),_0x392462);if(_0x343e55[_0xd53c('0x2f')][_0xd53c('0x3c')]){_0x1e889d[_0xd53c('0x3a')]=_[_0xd53c('0x3d')](_0x1e889d[_0xd53c('0x3a')],{'$or':_[_0xd53c('0x2e')](_0x392462,function(_0x17c744){if(_0x17c744[_0xd53c('0x2b')]!==_0xd53c('0x3e')){var _0x395397={};_0x395397[_0x17c744['name']]={'$like':'%'+_0x343e55[_0xd53c('0x2f')]['filter']+'%'};return _0x395397;}})});}_0x1e889d=_['merge']({},_0x1e889d,_0x343e55[_0xd53c('0x3f')]);var _0x262780={'where':_0x1e889d[_0xd53c('0x3a')]};return db[_0xd53c('0x40')][_0xd53c('0x1e')](_0x262780)[_0xd53c('0x22')](function(_0x40f96d){_0x414c22[_0xd53c('0x1e')]=_0x40f96d;if(_0x343e55['query'][_0xd53c('0x41')]){_0x1e889d['include']=[{'all':!![]}];}return db[_0xd53c('0x40')][_0xd53c('0x42')](_0x1e889d);})['then'](function(_0x27b0c3){_0x414c22[_0xd53c('0x43')]=_0x27b0c3;return _0x414c22;})[_0xd53c('0x22')](respondWithFilteredResult(_0x48be83,_0x1e889d))['catch'](handleError(_0x48be83,null));};exports[_0xd53c('0x44')]=function(_0x2eb54e,_0x5d142e){var _0x179e9d={'raw':!![],'where':{'id':_0x2eb54e['params']['id']}},_0x47a194={};_0x47a194[_0xd53c('0x2d')]=_['keys'](db[_0xd53c('0x40')][_0xd53c('0x29')]);_0x47a194['query']=_[_0xd53c('0x30')](_0x2eb54e[_0xd53c('0x2f')]);_0x47a194[_0xd53c('0x31')]=_[_0xd53c('0x32')](_0x47a194[_0xd53c('0x2d')],_0x47a194[_0xd53c('0x2f')]);_0x179e9d['attributes']=_[_0xd53c('0x32')](_0x47a194[_0xd53c('0x2d')],qs['fields'](_0x2eb54e['query'][_0xd53c('0x34')]));_0x179e9d[_0xd53c('0x33')]=_0x179e9d[_0xd53c('0x33')][_0xd53c('0x35')]?_0x179e9d[_0xd53c('0x33')]:_0x47a194[_0xd53c('0x2d')];if(_0x2eb54e[_0xd53c('0x2f')][_0xd53c('0x41')]){_0x179e9d[_0xd53c('0x45')]=[{'all':!![]}];}_0x179e9d=_[_0xd53c('0x3d')]({},_0x179e9d,_0x2eb54e[_0xd53c('0x3f')]);return db[_0xd53c('0x40')][_0xd53c('0x46')](_0x179e9d)[_0xd53c('0x22')](handleEntityNotFound(_0x5d142e,null))['then'](respondWithResult(_0x5d142e,null))[_0xd53c('0x47')](handleError(_0x5d142e,null));};exports[_0xd53c('0x21')]=function(_0x2b5be4,_0x54fae1){if(_0x2b5be4[_0xd53c('0x48')]['id']){delete _0x2b5be4['body']['id'];}return db['MailMessage'][_0xd53c('0x46')]({'where':{'id':_0x2b5be4[_0xd53c('0x49')]['id']}})[_0xd53c('0x22')](handleEntityNotFound(_0x54fae1,null))[_0xd53c('0x22')](saveUpdates(_0x2b5be4['body'],null))['then'](respondWithResult(_0x54fae1,null))[_0xd53c('0x47')](handleError(_0x54fae1,null));};exports['destroy']=function(_0x338692,_0x31600e){return db[_0xd53c('0x40')][_0xd53c('0x46')]({'where':{'id':_0x338692['params']['id']}})['then'](handleEntityNotFound(_0x31600e,null))['then'](removeEntity(_0x31600e,null))[_0xd53c('0x47')](handleError(_0x31600e,null));};exports[_0xd53c('0x4a')]=function(_0x1639a0,_0x5119be){return db['MailMessage'][_0xd53c('0x4a')]()[_0xd53c('0x22')](respondWithResult(_0x5119be,null))[_0xd53c('0x47')](handleError(_0x5119be,null));};exports[_0xd53c('0x4b')]=function(_0x118dca,_0x2f1534){return db[_0xd53c('0x40')]['create'](_0x118dca[_0xd53c('0x48')])['then'](function(_0x5c2881){if(_0x5c2881){if(_0x5c2881[_0xd53c('0x4c')]==='out'&&!_0x5c2881['secret']){var _0x5dd4aa,_0x3ef20b,_0x3c3839;if(_0x118dca[_0xd53c('0x48')]['to']){_0x3ef20b=_0x118dca[_0xd53c('0x48')]['to'][_0xd53c('0x4d')](',')[0x0];}return db[_0xd53c('0x4e')]['findOne']({'where':{'id':_0x5c2881[_0xd53c('0x4f')]},'include':[{'model':db[_0xd53c('0x50')],'as':'List','include':[{'model':db[_0xd53c('0x51')],'as':_0xd53c('0x52'),'where':{'email':_0x3ef20b},'limit':0x1,'order':[[_0xd53c('0x53'),'DESC']]}]},{'model':db[_0xd53c('0x54')],'as':_0xd53c('0x55'),'raw':!![],'include':[{'model':db[_0xd53c('0x56')],'as':_0xd53c('0x56'),'raw':!![]}]}]})[_0xd53c('0x22')](function(_0x3cda34){_0x5dd4aa=_0x3cda34;if(!_0x5dd4aa||!_0x5dd4aa[_0xd53c('0x55')])return;var _0x5afc77=_0x5dd4aa['getSmtpOptions']();if(_0x118dca['body'][_0xd53c('0x57')]&&_0x118dca[_0xd53c('0x48')]['attachments'][_0xd53c('0x35')]){for(var _0x31339f=0x0;_0x31339f<_0x118dca[_0xd53c('0x48')][_0xd53c('0x57')]['length'];_0x31339f+=0x1){_0x118dca[_0xd53c('0x48')][_0xd53c('0x57')][_0x31339f]={'filename':_0x118dca[_0xd53c('0x48')][_0xd53c('0x57')][_0x31339f][_0xd53c('0x26')],'path':path[_0xd53c('0x58')](config['root'],_0xd53c('0x59'),_0x118dca[_0xd53c('0x48')]['attachments'][_0x31339f][_0xd53c('0x5a')])};}}_0x3c3839={'account':_0x5afc77,'message':_0x118dca[_0xd53c('0x48')]};return;})[_0xd53c('0x22')](function(){if(_0x5dd4aa[_0xd53c('0x5b')]){if(_0x5dd4aa[_0xd53c('0x5b')][_0xd53c('0x52')]['length']){return _0x5dd4aa['List']['Contacts'][0x0];}else{return db[_0xd53c('0x51')][_0xd53c('0x4b')](_[_0xd53c('0xd')](_0x118dca[_0xd53c('0x48')],{'firstName':_0x118dca['body']['to'],'email':_0x118dca['body']['to'],'phone':_0x118dca[_0xd53c('0x48')]['to'],'ListId':_0x5dd4aa[_0xd53c('0x5c')]}));}}else{throw new Error(_0xd53c('0x5d'));}})[_0xd53c('0x22')](function(){if(_0x3c3839){return respondWithRpcPromise(_0xd53c('0x5e'),_0xd53c('0x5f'),_0x3c3839,client9003)[_0xd53c('0x22')](function(_0x1931b7){return _0x5c2881[_0xd53c('0x21')]({'read':!![],'messageId':_0x1931b7['messageId'],'sentAt':moment()[_0xd53c('0x60')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd53c('0x47')](function(_0x893d1){logger[_0xd53c('0x16')]('%s',JSON[_0xd53c('0x15')](_0x893d1));return _0x5c2881;});}return _0x5c2881;});}return _0x5c2881;}})[_0xd53c('0x22')](respondWithResult(_0x2f1534,0xc9))[_0xd53c('0x47')](handleError(_0x2f1534,null));};exports[_0xd53c('0x61')]=function(_0x4d63b8,_0x2bf547){var _0x2d8d70={'agent':{},'channel':'mail'};if(_0x4d63b8[_0xd53c('0x48')]['id']){delete _0x4d63b8[_0xd53c('0x48')]['id'];}_0x4d63b8['body'][_0xd53c('0x62')]=!![];_0x4d63b8[_0xd53c('0x48')][_0xd53c('0x63')]=moment()[_0xd53c('0x60')](_0xd53c('0x64'));_0x4d63b8['body'][_0xd53c('0x65')]=_0x4d63b8['body'][_0xd53c('0x65')]||_0x4d63b8['user']['id'];_0x2d8d70[_0xd53c('0x66')]['id']=_0x4d63b8[_0xd53c('0x48')][_0xd53c('0x65')];return db['MailMessage'][_0xd53c('0x46')]({'where':{'id':_0x4d63b8[_0xd53c('0x49')]['id'],'UserId':null}})[_0xd53c('0x22')](handleEntityNotFound(_0x2bf547,null))[_0xd53c('0x22')](saveUpdates(_0x4d63b8[_0xd53c('0x48')],null))[_0xd53c('0x22')](function(_0x138d19){if(_0x138d19){_0x2d8d70[_0xd53c('0x18')]=_0x138d19[_0xd53c('0x67')]({'plain':!![]});return db[_0xd53c('0x68')]['find']({'where':{'id':_0x138d19[_0xd53c('0x69')]}});}return null;})[_0xd53c('0x22')](handleEntityNotFound(_0x2bf547,null))[_0xd53c('0x22')](function(_0x47760c){if(_0x47760c){return _0x47760c[_0xd53c('0x21')]({'UserId':_0x4d63b8[_0xd53c('0x48')]['UserId'],'read1stAt':_[_0xd53c('0x6a')](_0x47760c[_0xd53c('0x6b')])?moment()[_0xd53c('0x60')](_0xd53c('0x64')):undefined});}return null;})[_0xd53c('0x22')](function(_0x4341b5){if(_0x4341b5){_0x2d8d70[_0xd53c('0x6c')]=_0x4341b5[_0xd53c('0x67')]({'plain':!![]});interaction_log[_0xd53c('0x12')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d63b8['user']['id'],_0x4d63b8['user'][_0xd53c('0x26')],_0x4d63b8[_0xd53c('0x6d')]['role'],_0x2d8d70[_0xd53c('0x6c')]['id'],_0x4d63b8[_0xd53c('0x48')]?JSON[_0xd53c('0x15')](_0x4d63b8['body']):_0xd53c('0x6e'));return respondWithRpcPromise(_0xd53c('0x6f'),'acceptMessage',_0x2d8d70);}return null;})['then'](function(_0x11cfde){var _0x2c0fea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11cfde[_0xd53c('0x18')][_0xd53c('0x70')];return db[_0xd53c('0x71')][_0xd53c('0x2f')](_0x2c0fea,{'type':db[_0xd53c('0x72')][_0xd53c('0x73')][_0xd53c('0x74')],'raw':!![]})[_0xd53c('0x22')](function(_0x17b3b7){return _0x17b3b7;});})[_0xd53c('0x22')](function(_0x5463cc){if(_0x5463cc){_0x2d8d70[_0xd53c('0x18')]['contact']=_0x5463cc[0x0];if(!_0x4d63b8[_0xd53c('0x48')][_0xd53c('0x65')])return;return db[_0xd53c('0x75')][_0xd53c('0x46')]({'where':{'id':_0x4d63b8[_0xd53c('0x48')][_0xd53c('0x65')],'role':'agent'},'attributes':['id',_0xd53c('0x26'),'fullname',_0xd53c('0x76'),_0xd53c('0x77')],'raw':!![]});}return null;})[_0xd53c('0x22')](function(_0x3a0290){if(!_0x3a0290)return null;_0x2d8d70['message'][_0xd53c('0x66')]=_0x3a0290;return _0x2d8d70;})[_0xd53c('0x22')](function(_0x34e2db){if(_0x34e2db){if(_0x4d63b8[_0xd53c('0x48')]['manual']){_0x2d8d70[_0xd53c('0x18')][_0xd53c('0x78')]=util[_0xd53c('0x60')](_0xd53c('0x79'),_0x4d63b8[_0xd53c('0x6d')][_0xd53c('0x26')]);_0x2d8d70[_0xd53c('0x18')][_0xd53c('0x7a')]=_0x2d8d70[_0xd53c('0x7a')];_0x2d8d70['message'][_0xd53c('0x7b')]=_0x2d8d70[_0xd53c('0x7a')];_0x2d8d70[_0xd53c('0x18')]['event']=_0xd53c('0x61');_0x2d8d70[_0xd53c('0x18')][_0xd53c('0x48')]=htmlToText['fromString'](_0x2d8d70[_0xd53c('0x18')][_0xd53c('0x48')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xd53c('0x7c'),'message':_0x2d8d70['message']},client9002)[_0xd53c('0x22')](function(){return _0x2d8d70;});}return _0x2d8d70;}return null;})[_0xd53c('0x22')](respondWithResult(_0x2bf547,null))[_0xd53c('0x47')](handleError(_0x2bf547,null));};exports[_0xd53c('0x7d')]=function(_0x3b8534,_0x24ee36){var _0x40e51a={'agent':{},'channel':'mail'};if(_0x3b8534[_0xd53c('0x48')]['id']){delete _0x3b8534['body']['id'];}_0x3b8534[_0xd53c('0x48')][_0xd53c('0x65')]=_0x3b8534['body'][_0xd53c('0x65')]||_0x3b8534[_0xd53c('0x6d')]['id'];_0x40e51a['agent']['id']=_0x3b8534['body']['UserId'];return db[_0xd53c('0x40')][_0xd53c('0x46')]({'where':{'id':_0x3b8534[_0xd53c('0x49')]['id'],'UserId':null}})[_0xd53c('0x22')](handleEntityNotFound(_0x24ee36,null))['then'](function(_0x5ac733){if(_0x5ac733){_0x40e51a[_0xd53c('0x18')]=_0x5ac733[_0xd53c('0x67')]({'plain':!![]});return db['MailInteraction'][_0xd53c('0x46')]({'where':{'id':_0x5ac733[_0xd53c('0x69')]}});}return null;})[_0xd53c('0x22')](handleEntityNotFound(_0x24ee36,null))[_0xd53c('0x22')](function(_0xaab433){if(_0xaab433){_0x40e51a['interaction']=_0xaab433[_0xd53c('0x67')]({'plain':!![]});interaction_log[_0xd53c('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b8534['user']['id'],_0x3b8534[_0xd53c('0x6d')]['name'],_0x3b8534[_0xd53c('0x6d')][_0xd53c('0x7e')],_0x40e51a[_0xd53c('0x6c')]['id'],_0x3b8534[_0xd53c('0x48')]?JSON['stringify'](_0x3b8534[_0xd53c('0x48')]):'null');return respondWithRpcPromise(_0xd53c('0x7f'),_0xd53c('0x80'),_0x40e51a);}return null;})[_0xd53c('0x22')](function(_0x1b4b75){var _0x1264c2=_0xd53c('0x81')+_0x1b4b75[_0xd53c('0x18')]['ContactId'];return db[_0xd53c('0x71')][_0xd53c('0x2f')](_0x1264c2,{'type':db['Sequelize'][_0xd53c('0x73')]['SELECT'],'raw':!![]})[_0xd53c('0x22')](function(_0x1a5c32){return _0x1a5c32;});})[_0xd53c('0x22')](function(_0x1464d7){if(_0x1464d7){_0x40e51a[_0xd53c('0x18')][_0xd53c('0x82')]=_0x1464d7[0x0];if(!_0x3b8534[_0xd53c('0x48')][_0xd53c('0x65')])return;return db[_0xd53c('0x75')][_0xd53c('0x46')]({'where':{'id':_0x3b8534['body'][_0xd53c('0x65')],'role':_0xd53c('0x66')},'attributes':['id',_0xd53c('0x26'),'fullname',_0xd53c('0x76'),_0xd53c('0x77')],'raw':!![]});}return null;})[_0xd53c('0x22')](function(_0xdaf148){if(!_0xdaf148)return null;_0x40e51a[_0xd53c('0x18')][_0xd53c('0x66')]=_0xdaf148;return _0x40e51a;})[_0xd53c('0x22')](function(_0x3d7a36){if(_0x3d7a36){_0x3d7a36[_0xd53c('0x18')][_0xd53c('0x78')]=util['format'](_0xd53c('0x79'),_0x3b8534['user'][_0xd53c('0x26')]);_0x3d7a36[_0xd53c('0x18')][_0xd53c('0x7a')]=_0x40e51a[_0xd53c('0x7a')];_0x3d7a36[_0xd53c('0x18')][_0xd53c('0x7b')]=_0x40e51a[_0xd53c('0x7a')];_0x3d7a36[_0xd53c('0x18')][_0xd53c('0x83')]=_0xd53c('0x7d');_0x3d7a36[_0xd53c('0x18')]['body']=htmlToText[_0xd53c('0x84')](_0x40e51a[_0xd53c('0x18')]['body']);respondWithRpcPromise(_0xd53c('0x85'),_0xd53c('0x85'),{'event':_0xd53c('0x86'),'message':_0x3d7a36['message']},client9002);return _0x40e51a;}return null;})['then'](respondWithResult(_0x24ee36,null))[_0xd53c('0x47')](handleError(_0x24ee36,null));};exports[_0xd53c('0x87')]=function(_0xcb17c9,_0x557053){var _0xa6884d=moment()[_0xd53c('0x88')]()[_0xd53c('0x89')]();var _0xaa4fd=path[_0xd53c('0x58')](config[_0xd53c('0x8a')],_0xd53c('0x8b'),_0xd53c('0x8c'),_0xd53c('0x8d'));var _0x5d7d15=path[_0xd53c('0x58')](config[_0xd53c('0x8a')],_0xd53c('0x8b'),'files','attachments');var _0x50f499=util[_0xd53c('0x60')](_0xd53c('0x8e'),_0xa6884d);return db[_0xd53c('0x40')][_0xd53c('0x46')]({'where':{'id':_0xcb17c9[_0xd53c('0x49')]['id']},'attributes':['id',_0xd53c('0x48'),'from','to','cc',_0xd53c('0x8f'),_0xd53c('0x90'),_0xd53c('0x91')],'include':_0xcb17c9[_0xd53c('0x2f')][_0xd53c('0x57')]?[{'model':db['Attachment'],'as':_0xd53c('0x92')}]:undefined})[_0xd53c('0x22')](handleEntityNotFound(_0x557053,null))['then'](function(_0x65fb7){if(_0x65fb7){var _0x2105cb=_0x65fb7;var _0x2e27e8={'from':_0x2105cb[_0xd53c('0x93')],'to':_0x2105cb['to'],'subject':_0x2105cb[_0xd53c('0x90')],'html':htmlEntities['decode'](_0x2105cb[_0xd53c('0x48')]),'headers':{'Date':moment(_0x2105cb['createdAt'])[_0xd53c('0x60')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x65fb7['cc']){_0x2e27e8['headers']['Cc']=_0x65fb7['cc'];}if(_0x65fb7[_0xd53c('0x8f')]){_0x2e27e8[_0xd53c('0x94')][_0xd53c('0x95')]=_0x65fb7['bcc'];}return new BPromise(function(_0x9ba0f7,_0x27919a){if(_0x65fb7[_0xd53c('0x92')]){for(var _0x399da7=0x0;_0x399da7<_0x65fb7[_0xd53c('0x92')][_0xd53c('0x35')];_0x399da7++){var _0x33fe8c=_0x65fb7[_0xd53c('0x92')][_0x399da7];var _0xd70408=path[_0xd53c('0x58')](_0x5d7d15,_0x33fe8c[_0xd53c('0x5a')]);if(fs[_0xd53c('0x96')](_0xd70408)){_0x2e27e8['attachments'][_0xd53c('0x97')]({'name':_0x33fe8c[_0xd53c('0x26')],'contentType':_0x33fe8c[_0xd53c('0x2b')],'data':fs[_0xd53c('0x98')](_0xd70408)});}}}emlformat[_0xd53c('0x99')](_0x2e27e8,function(_0x83efaa,_0x3ae4ff){if(_0x83efaa)return _0x27919a(_0x83efaa);fs['writeFileSync'](path[_0xd53c('0x58')](_0xaa4fd,_0x50f499),_0x3ae4ff);return _0x9ba0f7(_0x3ae4ff);});});}})['then'](function(_0x9883ad){if(_0x9883ad){return _0x557053[_0xd53c('0x87')](path['join'](_0xaa4fd,_0x50f499),_0x50f499,function(_0x89c074){if(!_0x89c074)fs['unlinkSync'](path[_0xd53c('0x58')](_0xaa4fd,_0x50f499));});}})[_0xd53c('0x47')](handleError(_0x557053,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bf83382..e639f06 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 _0x9510=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x444d21,_0x55c70a){var _0x3442ae=function(_0x5c8440){while(--_0x5c8440){_0x444d21['push'](_0x444d21['shift']());}};_0x3442ae(++_0x55c70a);}(_0x9510,0x16d));var _0x0951=function(_0x37d0ed,_0x5efd35){_0x37d0ed=_0x37d0ed-0x0;var _0x2f4948=_0x9510[_0x37d0ed];return _0x2f4948;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x0951('0x0'))['db'][_0x0951('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0951('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0951('0x3'),'afterDestroy':_0x0951('0x4')};function emitEvent(_0x28f374){return function(_0x91938e,_0x1392bb,_0x11a890){MailMessageEvents[_0x0951('0x5')](_0x28f374+':'+_0x91938e['id'],_0x91938e);MailMessageEvents['emit'](_0x28f374,_0x91938e);_0x11a890(null);};}for(var e in events){if(events[_0x0951('0x6')](e)){var event=events[e];MailMessage[_0x0951('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x27a5=['emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x4b2ed1,_0x95a4f3){var _0x4bd591=function(_0x14a48d){while(--_0x14a48d){_0x4b2ed1['push'](_0x4b2ed1['shift']());}};_0x4bd591(++_0x95a4f3);}(_0x27a5,0x139));var _0x527a=function(_0x448318,_0x1f64bd){_0x448318=_0x448318-0x0;var _0x1d7906=_0x27a5[_0x448318];return _0x1d7906;};'use strict';var EventEmitter=require(_0x527a('0x0'));var MailMessage=require(_0x527a('0x1'))['db'][_0x527a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x527a('0x3')](0x0);var events={'afterCreate':_0x527a('0x4'),'afterUpdate':_0x527a('0x5'),'afterDestroy':_0x527a('0x6')};function emitEvent(_0xe43088){return function(_0x46e17f,_0x3d021b,_0x31b881){MailMessageEvents[_0x527a('0x7')](_0xe43088+':'+_0x46e17f['id'],_0x46e17f);MailMessageEvents[_0x527a('0x7')](_0xe43088,_0x46e17f);_0x31b881(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x527a('0x8')](e,emitEvent(event));}}module[_0x527a('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 0e4856f..591f903 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 _0x5491=['api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2c6cc1,_0x261a37){var _0x48d543=function(_0xace247){while(--_0xace247){_0x2c6cc1['push'](_0x2c6cc1['shift']());}};_0x48d543(++_0x261a37);}(_0x5491,0x1aa));var _0x1549=function(_0x2d9bc2,_0x2f7b5c){_0x2d9bc2=_0x2d9bc2-0x0;var _0x21e695=_0x5491[_0x2d9bc2];return _0x21e695;};'use strict';var _=require(_0x1549('0x0'));var util=require(_0x1549('0x1'));var logger=require(_0x1549('0x2'))(_0x1549('0x3'));var moment=require(_0x1549('0x4'));var BPromise=require(_0x1549('0x5'));var rp=require(_0x1549('0x6'));var htmlToText=require(_0x1549('0x7'));var fs=require('fs');var path=require(_0x1549('0x8'));var rimraf=require(_0x1549('0x9'));var config=require(_0x1549('0xa'));var attributes=require(_0x1549('0xb'));module['exports']=function(_0x26bc72,_0x38172d){return _0x26bc72['define']('MailMessage',attributes,{'tableName':_0x1549('0xc'),'paranoid':![],'indexes':[{'name':_0x1549('0xd'),'fields':['messageId']},{'name':_0x1549('0xe'),'fields':[_0x1549('0xf'),_0x1549('0x10')],'type':_0x1549('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3559e7,_0x20208d,_0x41fb3f){if(_0x3559e7['body']){_0x3559e7[_0x1549('0xf')]=htmlToText[_0x1549('0x12')](_0x3559e7[_0x1549('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x41fb3f(null,_0x20208d);},'afterCreate':function(_0x1a1f2e,_0x5b50d9,_0x3c2a5e){var _0x2afcad=_0x26bc72[_0x1549('0x14')];var _0x5bf769=_0x1a1f2e[_0x1549('0x15')]({'plain':!![]});if(_0x5bf769['direction'][_0x1549('0x16')]()==='in'||_0x5bf769[_0x1549('0x17')][_0x1549('0x16')]()===_0x1549('0x18')&&!_0x5bf769[_0x1549('0x19')]&&!_[_0x1549('0x1a')](_0x5bf769[_0x1549('0x1b')])){_0x2afcad['MailInteraction'][_0x1549('0x1c')]({'where':{'id':_0x5bf769['MailInteractionId']}})['then'](function(_0x2903a1){if(_0x2903a1){_0x2903a1[_0x1549('0x1d')]({'lastMsgAt':_0x5bf769[_0x1549('0x1e')],'lastMsgDirection':_0x5bf769[_0x1549('0x17')][_0x1549('0x16')]()});}})['catch'](function(_0x722f1f){console['error'](_0x722f1f);});}_0x3c2a5e();}},'charset':_0x1549('0x1f'),'collate':_0x1549('0x20')});}; \ No newline at end of file +var _0x5086=['request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','isNil','findOne','MailInteractionId','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5086,0x1a1));var _0x6508=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x5086[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x6508('0x0'));var util=require(_0x6508('0x1'));var logger=require(_0x6508('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6508('0x3'));var htmlToText=require(_0x6508('0x4'));var fs=require('fs');var path=require(_0x6508('0x5'));var rimraf=require(_0x6508('0x6'));var config=require('../../config/environment');var attributes=require(_0x6508('0x7'));module['exports']=function(_0x4dc5b2,_0x455ded){return _0x4dc5b2[_0x6508('0x8')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x6508('0x9'),'fields':['messageId']},{'name':_0x6508('0xa'),'fields':[_0x6508('0xb'),_0x6508('0xc')],'type':_0x6508('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ad171,_0x418311,_0x29b9d8){if(_0x4ad171[_0x6508('0xe')]){_0x4ad171[_0x6508('0xb')]=htmlToText[_0x6508('0xf')](_0x4ad171['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x29b9d8(null,_0x418311);},'afterCreate':function(_0x151a6a,_0x2296f9,_0x2691ac){var _0x15c220=_0x4dc5b2[_0x6508('0x10')];var _0x5df274=_0x151a6a[_0x6508('0x11')]({'plain':!![]});if(_0x5df274[_0x6508('0x12')][_0x6508('0x13')]()==='in'||_0x5df274[_0x6508('0x12')]['toLowerCase']()==='out'&&!_0x5df274[_0x6508('0x14')]&&!_[_0x6508('0x15')](_0x5df274['UserId'])){_0x15c220['MailInteraction'][_0x6508('0x16')]({'where':{'id':_0x5df274[_0x6508('0x17')]}})['then'](function(_0x20a14e){if(_0x20a14e){_0x20a14e[_0x6508('0x18')]({'lastMsgAt':_0x5df274[_0x6508('0x19')],'lastMsgDirection':_0x5df274['direction']['toLowerCase']()});}})['catch'](function(_0x238890){console[_0x6508('0x1a')](_0x238890);});}_0x2691ac();}},'charset':'utf8mb4','collate':_0x6508('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b8fb672..1a9a528 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 _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailMessage','body','options','CreateMailMessage','lodash'];(function(_0x254a35,_0x367a34){var _0x529f6b=function(_0x73d247){while(--_0x73d247){_0x254a35['push'](_0x254a35['shift']());}};_0x529f6b(++_0x367a34);}(_0x5204,0xdf));var _0x4520=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x5204[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});config[_0x4520('0xb')]=_[_0x4520('0xc')](config[_0x4520('0xb')],{'host':_0x4520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4520('0xb')]));require('./mailMessage.socket')[_0x4520('0xe')](socket);function respondWithRpcPromise(_0x37a617,_0x1a5324,_0x30ca43){return new BPromise(function(_0x4d767b,_0x297f8d){return client[_0x4520('0xf')](_0x37a617,_0x30ca43)[_0x4520('0x10')](function(_0x2a2a2f){logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));logger[_0x4520('0x14')](_0x4520('0x15'),_0x1a5324,_0x4520('0x13'),JSON[_0x4520('0x16')](_0x2a2a2f));if(_0x2a2a2f[_0x4520('0x17')]){if(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x18')]===0x1f4){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x297f8d(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x4d767b(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}else{logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));_0x4d767b(_0x2a2a2f[_0x4520('0x1a')][_0x4520('0x19')]);}})[_0x4520('0x1b')](function(_0x11eaea){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x11eaea);_0x297f8d(_0x11eaea);});});}exports['CreateMailMessage']=function(_0xc016a3){var _0x52ca8c=this;return new Promise(function(_0x5ceff6,_0x4c46c5){return db[_0x4520('0x1c')]['create'](_0xc016a3[_0x4520('0x1d')],{'raw':_0xc016a3[_0x4520('0x1e')]?_0xc016a3[_0x4520('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4520('0x10')](function(_0x4000d4){logger[_0x4520('0x11')]('CreateMailMessage',_0xc016a3);logger[_0x4520('0x14')](_0x4520('0x1f'),_0xc016a3,JSON[_0x4520('0x16')](_0x4000d4));_0x5ceff6(_0x4000d4);})[_0x4520('0x1b')](function(_0x2a8528){logger['error'](_0x4520('0x1f'),_0x2a8528[_0x4520('0x19')],_0xc016a3);_0x4c46c5(_0x52ca8c[_0x4520('0x17')](0x1f4,_0x2a8528[_0x4520('0x19')]));});});}; \ No newline at end of file +var _0xaebd=['MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailMessage.socket','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x2180be,_0x87b5ce){_0x2180be=_0x2180be-0x0;var _0x5be582=_0xaebd[_0x2180be];return _0x5be582;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});config[_0xdaeb('0xb')]=_[_0xdaeb('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaeb('0xd'))(new Redis(config[_0xdaeb('0xb')]));require(_0xdaeb('0xe'))['register'](socket);function respondWithRpcPromise(_0xbb4b72,_0x494d42,_0x3e83f3){return new BPromise(function(_0x4ba89d,_0x2218d6){return client['request'](_0xbb4b72,_0x3e83f3)[_0xdaeb('0xf')](function(_0x3f0e95){logger['info']('MailMessage,\x20%s,\x20%s',_0x494d42,_0xdaeb('0x10'));logger['debug'](_0xdaeb('0x11'),_0x494d42,_0xdaeb('0x10'),JSON[_0xdaeb('0x12')](_0x3f0e95));if(_0x3f0e95[_0xdaeb('0x13')]){if(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x14')]===0x1f4){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x2218d6(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x15')]);}logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x4ba89d(_0x3f0e95['error']['message']);}else{logger[_0xdaeb('0x16')](_0xdaeb('0x17'),_0x494d42,_0xdaeb('0x10'));_0x4ba89d(_0x3f0e95[_0xdaeb('0x18')][_0xdaeb('0x15')]);}})[_0xdaeb('0x19')](function(_0x501f77){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x501f77);_0x2218d6(_0x501f77);});});}exports[_0xdaeb('0x1a')]=function(_0x13b3f2){var _0x18bd81=this;return new Promise(function(_0x5360ce,_0x4e97e0){return db[_0xdaeb('0x1b')][_0xdaeb('0x1c')](_0x13b3f2[_0xdaeb('0x1d')],{'raw':_0x13b3f2[_0xdaeb('0x1e')]?_0x13b3f2[_0xdaeb('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c969d){logger[_0xdaeb('0x16')](_0xdaeb('0x1a'),_0x13b3f2);logger[_0xdaeb('0x1f')](_0xdaeb('0x1a'),_0x13b3f2,JSON['stringify'](_0x2c969d));_0x5360ce(_0x2c969d);})[_0xdaeb('0x19')](function(_0x4dc25f){logger[_0xdaeb('0x13')](_0xdaeb('0x1a'),_0x4dc25f[_0xdaeb('0x15')],_0x13b3f2);_0x4e97e0(_0x18bd81[_0xdaeb('0x13')](0x1f4,_0x4dc25f[_0xdaeb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index caf53c2..85143ab 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 _0xd2e2=['register','length','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2e2,0xa2));var _0x2d2e=function(_0x197fdb,_0x4a4a2d){_0x197fdb=_0x197fdb-0x0;var _0x25ab0b=_0xd2e2[_0x197fdb];return _0x25ab0b;};'use strict';var MailMessageEvents=require(_0x2d2e('0x0'));var events=[_0x2d2e('0x1'),_0x2d2e('0x2'),_0x2d2e('0x3')];function createListener(_0x304235,_0x1c2068){return function(_0x56292f){_0x1c2068[_0x2d2e('0x4')](_0x304235,_0x56292f);};}function removeListener(_0x3d9c9a,_0x2a5aea){return function(){MailMessageEvents[_0x2d2e('0x5')](_0x3d9c9a,_0x2a5aea);};}exports[_0x2d2e('0x6')]=function(_0x55cc13){for(var _0x2adde5=0x0,_0xff36e3=events[_0x2d2e('0x7')];_0x2adde5<_0xff36e3;_0x2adde5++){var _0x10b681=events[_0x2adde5];var _0x39c9d7=createListener('mailMessage:'+_0x10b681,_0x55cc13);MailMessageEvents['on'](_0x10b681,_0x39c9d7);}}; \ No newline at end of file +var _0x9860=['mailMessage:','save','remove','update','emit','register','length'];(function(_0x8c7e42,_0x1f4c04){var _0x456c99=function(_0x59b101){while(--_0x59b101){_0x8c7e42['push'](_0x8c7e42['shift']());}};_0x456c99(++_0x1f4c04);}(_0x9860,0x15f));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x0986('0x0'),_0x0986('0x1'),_0x0986('0x2')];function createListener(_0x13f55f,_0x2444f3){return function(_0x4256f5){_0x2444f3[_0x0986('0x3')](_0x13f55f,_0x4256f5);};}function removeListener(_0x23383d,_0x29b8f5){return function(){MailMessageEvents['removeListener'](_0x23383d,_0x29b8f5);};}exports[_0x0986('0x4')]=function(_0x2ac97d){for(var _0x32e6b8=0x0,_0x4e6cde=events[_0x0986('0x5')];_0x32e6b8<_0x4e6cde;_0x32e6b8++){var _0x35bdd3=events[_0x32e6b8];var _0x159301=createListener(_0x0986('0x6')+_0x35bdd3,_0x2ac97d);MailMessageEvents['on'](_0x35bdd3,_0x159301);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 2344170..dd5505b 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 _0x3314=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','destroy','removeTeams','removeAgents','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3314,0x96));var _0x4331=function(_0x3e460d,_0x12d7b4){_0x3e460d=_0x3e460d-0x0;var _0x5a1739=_0x3314[_0x3e460d];return _0x5a1739;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4331('0x0'));var timeout=require(_0x4331('0x1'));var express=require(_0x4331('0x2'));var router=express[_0x4331('0x3')]();var fs_extra=require(_0x4331('0x4'));var auth=require(_0x4331('0x5'));var interaction=require(_0x4331('0x6'));var config=require(_0x4331('0x7'));var controller=require(_0x4331('0x8'));router[_0x4331('0x9')]('/',auth[_0x4331('0xa')](),controller['index']);router[_0x4331('0x9')](_0x4331('0xb'),auth[_0x4331('0xa')](),controller[_0x4331('0xc')]);router[_0x4331('0x9')](_0x4331('0xd'),auth[_0x4331('0xa')](),controller[_0x4331('0xe')]);router[_0x4331('0x9')](_0x4331('0xf'),auth[_0x4331('0xa')](),controller[_0x4331('0x10')]);router[_0x4331('0x9')](_0x4331('0x11'),auth[_0x4331('0xa')](),controller[_0x4331('0x12')]);router[_0x4331('0x9')]('/:id/users',auth[_0x4331('0xa')](),controller[_0x4331('0x13')]);router[_0x4331('0x14')]('/',auth[_0x4331('0xa')](),controller['create']);router[_0x4331('0x14')](_0x4331('0x11'),auth['isAuthenticated'](),controller[_0x4331('0x15')]);router[_0x4331('0x14')](_0x4331('0x16'),auth['isAuthenticated'](),controller[_0x4331('0x17')]);router[_0x4331('0x18')](_0x4331('0xd'),auth[_0x4331('0xa')](),controller[_0x4331('0x19')]);router['delete']('/:id',auth[_0x4331('0xa')](),controller[_0x4331('0x1a')]);router['delete'](_0x4331('0x11'),auth[_0x4331('0xa')](),controller[_0x4331('0x1b')]);router['delete'](_0x4331('0x16'),auth[_0x4331('0xa')](),controller[_0x4331('0x1c')]);module[_0x4331('0x1d')]=router; \ No newline at end of file +var _0xc345=['index','/describe','describe','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc345,0xbe));var _0x5c34=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0xc345[_0x2a8860];return _0x2f47a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c34('0x0'));var timeout=require(_0x5c34('0x1'));var express=require(_0x5c34('0x2'));var router=express[_0x5c34('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c34('0x4'));var interaction=require(_0x5c34('0x5'));var config=require(_0x5c34('0x6'));var controller=require(_0x5c34('0x7'));router[_0x5c34('0x8')]('/',auth[_0x5c34('0x9')](),controller[_0x5c34('0xa')]);router[_0x5c34('0x8')](_0x5c34('0xb'),auth[_0x5c34('0x9')](),controller[_0x5c34('0xc')]);router[_0x5c34('0x8')]('/:id',auth[_0x5c34('0x9')](),controller['show']);router['get']('/:id/members',auth[_0x5c34('0x9')](),controller[_0x5c34('0xd')]);router[_0x5c34('0x8')]('/:id/teams',auth[_0x5c34('0x9')](),controller['getTeams']);router[_0x5c34('0x8')](_0x5c34('0xe'),auth[_0x5c34('0x9')](),controller[_0x5c34('0xf')]);router[_0x5c34('0x10')]('/',auth[_0x5c34('0x9')](),controller[_0x5c34('0x11')]);router[_0x5c34('0x10')](_0x5c34('0x12'),auth[_0x5c34('0x9')](),controller[_0x5c34('0x13')]);router['post'](_0x5c34('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5c34('0x14')](_0x5c34('0x15'),auth[_0x5c34('0x9')](),controller['update']);router[_0x5c34('0x16')]('/:id',auth[_0x5c34('0x9')](),controller[_0x5c34('0x17')]);router[_0x5c34('0x16')](_0x5c34('0x12'),auth[_0x5c34('0x9')](),controller['removeTeams']);router[_0x5c34('0x16')](_0x5c34('0xe'),auth[_0x5c34('0x9')](),controller['removeAgents']);module[_0x5c34('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 30823cd..7857a33 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 _0x15d7=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x406c4f,_0x26c52a){var _0xc3f0d5=function(_0x22255e){while(--_0x22255e){_0x406c4f['push'](_0x406c4f['shift']());}};_0xc3f0d5(++_0x26c52a);}(_0x15d7,0x1d4));var _0x715d=function(_0x2a3888,_0xcf384f){_0x2a3888=_0x2a3888-0x0;var _0x2d781e=_0x15d7[_0x2a3888];return _0x2d781e;};'use strict';var Sequelize=require(_0x715d('0x0'));module[_0x715d('0x1')]={'name':{'type':Sequelize[_0x715d('0x2')],'unique':_0x715d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x715d('0x2')]},'timeout':{'type':Sequelize[_0x715d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x715d('0x5')](_0x715d('0x6'),_0x715d('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x4038=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x1d51c5,_0x6a157d){var _0x2d3885=function(_0x5bcfab){while(--_0x5bcfab){_0x1d51c5['push'](_0x1d51c5['shift']());}};_0x2d3885(++_0x6a157d);}(_0x4038,0x6d));var _0x8403=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x4038[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x8403('0x0'));module['exports']={'name':{'type':Sequelize[_0x8403('0x1')],'unique':_0x8403('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8403('0x1')]},'timeout':{'type':Sequelize[_0x8403('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8403('0x4')](_0x8403('0x5'),_0x8403('0x6'),_0x8403('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0ef50a8..d91047d 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 _0xe827=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','MailQueueId','UserId','agent','updatedAt','createdAt','format','SIP','getTeams','Team','sort','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','emit','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','limit','count','Content-Range','apply','update','then','destroy','get','MailQueues','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','MailQueue','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x309611,_0x486d28){var _0x44229e=function(_0x593462){while(--_0x593462){_0x309611['push'](_0x309611['shift']());}};_0x44229e(++_0x486d28);}(_0xe827,0x1dd));var _0x7e82=function(_0x537594,_0x47c1d6){_0x537594=_0x537594-0x0;var _0x528304=_0xe827[_0x537594];return _0x528304;};'use strict';var emlformat=require(_0x7e82('0x0'));var rimraf=require(_0x7e82('0x1'));var zipdir=require(_0x7e82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e82('0x3'));var moment=require(_0x7e82('0x4'));var BPromise=require(_0x7e82('0x5'));var Mustache=require(_0x7e82('0x6'));var util=require(_0x7e82('0x7'));var path=require(_0x7e82('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e82('0x9'));var fs=require('fs');var fs_extra=require(_0x7e82('0xa'));var _=require(_0x7e82('0xb'));var squel=require(_0x7e82('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e82('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e82('0xe'));var querystring=require(_0x7e82('0xf'));var Papa=require(_0x7e82('0x10'));var Redis=require('ioredis');var authService=require(_0x7e82('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7e82('0x12'));var hardwareService=require(_0x7e82('0x13'));var logger=require(_0x7e82('0x14'))(_0x7e82('0x15'));var utils=require(_0x7e82('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e82('0x17'));var db=require(_0x7e82('0x18'))['db'];config['redis']=_['defaults'](config[_0x7e82('0x19')],{'host':_0x7e82('0x1a'),'port':0x18eb});var socket=require(_0x7e82('0x1b'))(new Redis(config[_0x7e82('0x19')]));require(_0x7e82('0x1c'))[_0x7e82('0x1d')](socket);function respondWithStatusCode(_0x5c815b,_0x857887){_0x857887=_0x857887||0xcc;return function(_0x44e773){if(_0x44e773){return _0x5c815b[_0x7e82('0x1e')](_0x857887);}return _0x5c815b[_0x7e82('0x1f')](_0x857887)['end']();};}function respondWithResult(_0x85305c,_0x6e70c2){_0x6e70c2=_0x6e70c2||0xc8;return function(_0x5d6b65){if(_0x5d6b65){return _0x85305c[_0x7e82('0x1f')](_0x6e70c2)[_0x7e82('0x20')](_0x5d6b65);}};}function respondWithFilteredResult(_0x702b70,_0x1feb3f){return function(_0xec7f28){if(_0xec7f28){var _0x153967=typeof _0x1feb3f[_0x7e82('0x21')]==='undefined'&&typeof _0x1feb3f[_0x7e82('0x22')]==='undefined';var _0x4cae33=_0xec7f28['count'];var _0x5d712c=_0x153967?0x0:_0x1feb3f[_0x7e82('0x21')];var _0xe94a98=_0x153967?_0xec7f28[_0x7e82('0x23')]:_0x1feb3f[_0x7e82('0x21')]+_0x1feb3f[_0x7e82('0x22')];var _0x50246a;if(_0xe94a98>=_0x4cae33){_0xe94a98=_0x4cae33;_0x50246a=0xc8;}else{_0x50246a=0xce;}_0x702b70[_0x7e82('0x1f')](_0x50246a);return _0x702b70['set'](_0x7e82('0x24'),_0x5d712c+'-'+_0xe94a98+'/'+_0x4cae33)[_0x7e82('0x20')](_0xec7f28);}return null;};}function patchUpdates(_0x5eada6){return function(_0x47b00a){try{jsonpatch[_0x7e82('0x25')](_0x47b00a,_0x5eada6,!![]);}catch(_0xa514a1){return BPromise['reject'](_0xa514a1);}return _0x47b00a['save']();};}function saveUpdates(_0x5b123b,_0x45ea89){return function(_0x4b5098){if(_0x4b5098){return _0x4b5098[_0x7e82('0x26')](_0x5b123b)[_0x7e82('0x27')](function(_0x3c5feb){return _0x3c5feb;});}return null;};}function removeEntity(_0x5cbf55,_0x3325e7){return function(_0x43d249){if(_0x43d249){return _0x43d249[_0x7e82('0x28')]()['then'](function(){var _0x9a28ae=_0x43d249[_0x7e82('0x29')]({'plain':!![]});var _0xf44ec8=_0x7e82('0x2a');return db['UserProfileResource'][_0x7e82('0x28')]({'where':{'type':_0xf44ec8,'resourceId':_0x9a28ae['id']}})[_0x7e82('0x27')](function(){return _0x43d249;});})[_0x7e82('0x27')](function(){_0x5cbf55['status'](0xcc)[_0x7e82('0x2b')]();});}};}function handleEntityNotFound(_0x58622d,_0x3d9f67){return function(_0x5795c7){if(!_0x5795c7){_0x58622d['sendStatus'](0x194);}return _0x5795c7;};}function handleError(_0x1ed263,_0x46bb32){_0x46bb32=_0x46bb32||0x1f4;return function(_0x470e55){logger[_0x7e82('0x2c')](_0x470e55[_0x7e82('0x2d')]);if(_0x470e55['name']){delete _0x470e55[_0x7e82('0x2e')];}_0x1ed263[_0x7e82('0x1f')](_0x46bb32)[_0x7e82('0x2f')](_0x470e55);};}exports[_0x7e82('0x30')]=function(_0x429355,_0x5f4de2){var _0x14fe1a={},_0x275e53={},_0x22fb35={'count':0x0,'rows':[]};var _0x522300=_[_0x7e82('0x31')](db['MailQueue'][_0x7e82('0x32')],function(_0x2d965d){return{'name':_0x2d965d[_0x7e82('0x33')],'type':_0x2d965d['type']['key']};});_0x275e53[_0x7e82('0x34')]=_['map'](_0x522300,_0x7e82('0x2e'));_0x275e53[_0x7e82('0x35')]=_['keys'](_0x429355[_0x7e82('0x35')]);_0x275e53[_0x7e82('0x36')]=_[_0x7e82('0x37')](_0x275e53[_0x7e82('0x34')],_0x275e53[_0x7e82('0x35')]);_0x14fe1a[_0x7e82('0x38')]=_[_0x7e82('0x37')](_0x275e53[_0x7e82('0x34')],qs[_0x7e82('0x39')](_0x429355[_0x7e82('0x35')]['fields']));_0x14fe1a[_0x7e82('0x38')]=_0x14fe1a['attributes'][_0x7e82('0x3a')]?_0x14fe1a[_0x7e82('0x38')]:_0x275e53[_0x7e82('0x34')];if(!_0x429355[_0x7e82('0x35')][_0x7e82('0x3b')](_0x7e82('0x3c'))){_0x14fe1a[_0x7e82('0x22')]=qs[_0x7e82('0x22')](_0x429355[_0x7e82('0x35')][_0x7e82('0x22')]);_0x14fe1a[_0x7e82('0x21')]=qs[_0x7e82('0x21')](_0x429355[_0x7e82('0x35')][_0x7e82('0x21')]);}_0x14fe1a[_0x7e82('0x3d')]=qs['sort'](_0x429355[_0x7e82('0x35')]['sort']);_0x14fe1a['where']=qs[_0x7e82('0x36')](_[_0x7e82('0x3e')](_0x429355['query'],_0x275e53[_0x7e82('0x36')]),_0x522300);if(_0x429355[_0x7e82('0x35')][_0x7e82('0x3f')]){_0x14fe1a[_0x7e82('0x40')]=_[_0x7e82('0x41')](_0x14fe1a[_0x7e82('0x40')],{'$or':_[_0x7e82('0x31')](_0x522300,function(_0x33b79c){if(_0x33b79c[_0x7e82('0x42')]!==_0x7e82('0x43')){var _0x5a96aa={};_0x5a96aa[_0x33b79c['name']]={'$like':'%'+_0x429355[_0x7e82('0x35')][_0x7e82('0x3f')]+'%'};return _0x5a96aa;}})});}_0x14fe1a=_[_0x7e82('0x41')]({},_0x14fe1a,_0x429355['options']);var _0x32b5e3={'where':_0x14fe1a[_0x7e82('0x40')]};return db[_0x7e82('0x44')][_0x7e82('0x23')](_0x32b5e3)[_0x7e82('0x27')](function(_0x9fee92){_0x22fb35[_0x7e82('0x23')]=_0x9fee92;if(_0x429355[_0x7e82('0x35')][_0x7e82('0x45')]){_0x14fe1a[_0x7e82('0x46')]=[{'all':!![]}];}return db['MailQueue'][_0x7e82('0x47')](_0x14fe1a);})[_0x7e82('0x27')](function(_0x47bf14){_0x22fb35[_0x7e82('0x48')]=_0x47bf14;return _0x22fb35;})[_0x7e82('0x27')](respondWithFilteredResult(_0x5f4de2,_0x14fe1a))['catch'](handleError(_0x5f4de2,null));};exports[_0x7e82('0x49')]=function(_0x541d13,_0x932bdd){var _0x592ffc={'raw':!![],'where':{'id':_0x541d13[_0x7e82('0x4a')]['id']}},_0x1e5ca3={};_0x1e5ca3[_0x7e82('0x34')]=_[_0x7e82('0x4b')](db[_0x7e82('0x44')][_0x7e82('0x32')]);_0x1e5ca3['query']=_['keys'](_0x541d13[_0x7e82('0x35')]);_0x1e5ca3[_0x7e82('0x36')]=_[_0x7e82('0x37')](_0x1e5ca3['model'],_0x1e5ca3[_0x7e82('0x35')]);_0x592ffc[_0x7e82('0x38')]=_['intersection'](_0x1e5ca3[_0x7e82('0x34')],qs[_0x7e82('0x39')](_0x541d13[_0x7e82('0x35')][_0x7e82('0x39')]));_0x592ffc['attributes']=_0x592ffc[_0x7e82('0x38')][_0x7e82('0x3a')]?_0x592ffc[_0x7e82('0x38')]:_0x1e5ca3[_0x7e82('0x34')];if(_0x541d13[_0x7e82('0x35')][_0x7e82('0x45')]){_0x592ffc['include']=[{'all':!![]}];}_0x592ffc=_[_0x7e82('0x41')]({},_0x592ffc,_0x541d13[_0x7e82('0x4c')]);return db[_0x7e82('0x44')][_0x7e82('0x4d')](_0x592ffc)[_0x7e82('0x27')](handleEntityNotFound(_0x932bdd,null))['then'](respondWithResult(_0x932bdd,null))[_0x7e82('0x4e')](handleError(_0x932bdd,null));};exports[_0x7e82('0x4f')]=function(_0x45695d,_0x2ef2e4){return db[_0x7e82('0x44')]['create'](_0x45695d[_0x7e82('0x50')],{})['then'](function(_0x2e9603){var _0x57e87a=_0x45695d['user']['get']({'plain':!![]});if(!_0x57e87a)throw new Error(_0x7e82('0x51'));if(_0x57e87a[_0x7e82('0x52')]===_0x7e82('0x53')){var _0x5e4a33=_0x2e9603['get']({'plain':!![]});var _0x561e0d=_0x7e82('0x2a');return db[_0x7e82('0x54')][_0x7e82('0x4d')]({'where':{'name':_0x561e0d,'userProfileId':_0x57e87a[_0x7e82('0x55')]},'raw':!![]})[_0x7e82('0x27')](function(_0x4f9d96){if(_0x4f9d96&&_0x4f9d96[_0x7e82('0x56')]===0x0){return db[_0x7e82('0x57')][_0x7e82('0x4f')]({'name':_0x5e4a33['name'],'resourceId':_0x5e4a33['id'],'type':_0x4f9d96[_0x7e82('0x2e')],'sectionId':_0x4f9d96['id']},{})[_0x7e82('0x27')](function(){return _0x2e9603;});}else{return _0x2e9603;}})['catch'](function(_0x217c78){logger['error'](_0x7e82('0x58'),_0x217c78);throw _0x217c78;});}return _0x2e9603;})[_0x7e82('0x27')](respondWithResult(_0x2ef2e4,0xc9))[_0x7e82('0x4e')](handleError(_0x2ef2e4,null));};exports[_0x7e82('0x26')]=function(_0x26af6c,_0x497044){if(_0x26af6c[_0x7e82('0x50')]['id']){delete _0x26af6c[_0x7e82('0x50')]['id'];}return db[_0x7e82('0x44')][_0x7e82('0x4d')]({'where':{'id':_0x26af6c[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x497044,null))[_0x7e82('0x27')](saveUpdates(_0x26af6c[_0x7e82('0x50')],null))['then'](respondWithResult(_0x497044,null))[_0x7e82('0x4e')](handleError(_0x497044,null));};exports[_0x7e82('0x28')]=function(_0xfe1b51,_0x124df0){return db[_0x7e82('0x44')][_0x7e82('0x4d')]({'where':{'id':_0xfe1b51[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x124df0,null))[_0x7e82('0x27')](removeEntity(_0x124df0,null))[_0x7e82('0x4e')](handleError(_0x124df0,null));};exports[_0x7e82('0x59')]=function(_0x459b45,_0x571dc9){return db[_0x7e82('0x44')][_0x7e82('0x59')]()[_0x7e82('0x27')](respondWithResult(_0x571dc9,null))[_0x7e82('0x4e')](handleError(_0x571dc9,null));};exports['getMembers']=function(_0x993e77,_0x82079f,_0x2375a1){var _0x122268={'raw':!![],'where':{}},_0x3f8602={},_0x3cd1fe;return db[_0x7e82('0x44')][_0x7e82('0x5a')]({'where':{'id':_0x993e77['params']['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x82079f,null))[_0x7e82('0x27')](function(_0x2df75e){if(_0x2df75e){_0x3cd1fe=_0x2df75e[_0x7e82('0x29')]({'plain':!![]});_0x3f8602[_0x7e82('0x34')]=_['keys'](db[_0x7e82('0x5b')][_0x7e82('0x32')]);_0x3f8602[_0x7e82('0x35')]=_[_0x7e82('0x4b')](_0x993e77[_0x7e82('0x35')]);_0x3f8602[_0x7e82('0x36')]=_[_0x7e82('0x37')](_0x3f8602[_0x7e82('0x34')],_0x3f8602[_0x7e82('0x35')]);_0x122268[_0x7e82('0x38')]=_[_0x7e82('0x37')](_0x3f8602['model'],qs[_0x7e82('0x39')](_0x993e77[_0x7e82('0x35')][_0x7e82('0x39')]));_0x122268[_0x7e82('0x38')]=_0x122268['attributes']['length']?_0x122268[_0x7e82('0x38')]:_0x3f8602['model'];if(!_0x993e77[_0x7e82('0x35')][_0x7e82('0x3b')](_0x7e82('0x3c'))){_0x122268[_0x7e82('0x22')]=qs['limit'](_0x993e77[_0x7e82('0x35')][_0x7e82('0x22')]);_0x122268[_0x7e82('0x21')]=qs[_0x7e82('0x21')](_0x993e77[_0x7e82('0x35')][_0x7e82('0x21')]);}_0x122268[_0x7e82('0x3d')]=qs['sort'](_0x993e77[_0x7e82('0x35')]['sort']);_0x122268[_0x7e82('0x40')]=qs['filters'](_[_0x7e82('0x3e')](_0x993e77[_0x7e82('0x35')],_0x3f8602[_0x7e82('0x36')]));_0x122268['where'][_0x7e82('0x5c')]=_0x2df75e['id'];if(_0x993e77[_0x7e82('0x35')][_0x7e82('0x3f')]){_0x122268['where']=_['merge'](_0x122268[_0x7e82('0x40')],{'$or':_['map'](_0x122268[_0x7e82('0x38')],function(_0x363991){var _0x597da7={};_0x597da7[_0x363991]={'$like':'%'+_0x993e77[_0x7e82('0x35')][_0x7e82('0x3f')]+'%'};return _0x597da7;})});}_0x122268=_[_0x7e82('0x41')]({},_0x122268,_0x993e77[_0x7e82('0x4c')]);return db[_0x7e82('0x5b')][_0x7e82('0x47')](_0x122268);}})[_0x7e82('0x27')](function(_0x251beb){if(_0x251beb){return db['User']['findAndCountAll']({'where':{'id':_[_0x7e82('0x31')](_0x251beb,_0x7e82('0x5d')),'role':_0x7e82('0x5e')},'attributes':['id','name','mailPause',_0x7e82('0x5f'),_0x7e82('0x60')]});}})[_0x7e82('0x27')](function(_0x55e63d){if(_0x55e63d){return{'count':_0x55e63d[_0x7e82('0x23')],'rows':_[_0x7e82('0x31')](_0x55e63d[_0x7e82('0x48')],function(_0x4c8b09){return{'membername':_0x4c8b09['name'],'UserId':_0x4c8b09['id'],'queue_name':_0x3cd1fe['name'],'MailQueueId':_0x3cd1fe['id'],'interface':util[_0x7e82('0x61')]('%s/%s',_0x7e82('0x62'),_0x4c8b09['name']),'penalty':0x0,'paused':_0x4c8b09['mailPause'],'createdAt':_0x4c8b09[_0x7e82('0x60')],'updatedAt':_0x4c8b09[_0x7e82('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x82079f,_0x122268))[_0x7e82('0x4e')](handleError(_0x82079f,null));};exports[_0x7e82('0x63')]=function(_0x16e2b3,_0x51e190,_0xf971ad){var _0x560692={};var _0x34a077={};var _0x2cde62;var _0x559638;return db[_0x7e82('0x44')][_0x7e82('0x5a')]({'where':{'id':_0x16e2b3[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x51e190,null))[_0x7e82('0x27')](function(_0x46dfda){if(_0x46dfda){_0x2cde62=_0x46dfda;_0x34a077['model']=_[_0x7e82('0x4b')](db[_0x7e82('0x64')][_0x7e82('0x32')]);_0x34a077[_0x7e82('0x35')]=_[_0x7e82('0x4b')](_0x16e2b3[_0x7e82('0x35')]);_0x34a077['filters']=_[_0x7e82('0x37')](_0x34a077[_0x7e82('0x34')],_0x34a077[_0x7e82('0x35')]);_0x560692[_0x7e82('0x38')]=_[_0x7e82('0x37')](_0x34a077[_0x7e82('0x34')],qs['fields'](_0x16e2b3[_0x7e82('0x35')][_0x7e82('0x39')]));_0x560692[_0x7e82('0x38')]=_0x560692[_0x7e82('0x38')][_0x7e82('0x3a')]?_0x560692[_0x7e82('0x38')]:_0x34a077[_0x7e82('0x34')];_0x560692[_0x7e82('0x3d')]=qs[_0x7e82('0x65')](_0x16e2b3['query'][_0x7e82('0x65')]);_0x560692['where']=qs[_0x7e82('0x36')](_[_0x7e82('0x3e')](_0x16e2b3[_0x7e82('0x35')],_0x34a077[_0x7e82('0x36')]));if(_0x16e2b3[_0x7e82('0x35')][_0x7e82('0x3f')]){_0x560692[_0x7e82('0x40')]=_[_0x7e82('0x41')](_0x560692[_0x7e82('0x40')],{'$or':_[_0x7e82('0x31')](_0x560692['attributes'],function(_0x4ee805){var _0x22da8d={};_0x22da8d[_0x4ee805]={'$like':'%'+_0x16e2b3['query'][_0x7e82('0x3f')]+'%'};return _0x22da8d;})});}_0x560692=_[_0x7e82('0x41')]({},_0x560692,_0x16e2b3[_0x7e82('0x4c')]);return _0x2cde62['getTeams'](_0x560692);}})[_0x7e82('0x27')](function(_0x3ef477){if(_0x3ef477){_0x559638=_0x3ef477[_0x7e82('0x3a')];if(!_0x16e2b3[_0x7e82('0x35')][_0x7e82('0x3b')](_0x7e82('0x3c'))){_0x560692['limit']=qs[_0x7e82('0x22')](_0x16e2b3[_0x7e82('0x35')][_0x7e82('0x22')]);_0x560692[_0x7e82('0x21')]=qs[_0x7e82('0x21')](_0x16e2b3[_0x7e82('0x35')][_0x7e82('0x21')]);}return _0x2cde62[_0x7e82('0x63')](_0x560692);}})[_0x7e82('0x27')](function(_0x268107){if(_0x268107){return _0x268107?{'count':_0x559638,'rows':_0x268107}:null;}})['then'](respondWithResult(_0x51e190,null))['catch'](handleError(_0x51e190,null));};exports['addTeams']=function(_0x5bb212,_0x5f5521,_0x3e19b2){var _0x4b4566=_0x5bb212[_0x7e82('0x50')][_0x7e82('0x66')];return db[_0x7e82('0x64')]['findAll']({'where':{'id':_0x4b4566},'attributes':['id'],'include':[{'model':db[_0x7e82('0x67')],'as':_0x7e82('0x68'),'attributes':['id',_0x7e82('0x2e'),_0x7e82('0x69'),_0x7e82('0x6a'),_0x7e82('0x6b')],'raw':!![]}]})[_0x7e82('0x27')](function(_0x524436){if(_0x524436){var _0x51f86d=_[_0x7e82('0x6c')](_0x524436,function(_0xacf3b2){var _0x24dc45=_0xacf3b2[_0x7e82('0x29')]({'plain':!![]});return _0x24dc45[_0x7e82('0x68')];});return db[_0x7e82('0x44')][_0x7e82('0x4d')]({'where':{'id':_0x5bb212[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](function(_0x24c288){return db[_0x7e82('0x6d')]['transaction'](function(_0x52a2c1){return _0x24c288['addTeams'](_0x4b4566,{'transaction':_0x52a2c1})['then'](function(){return BPromise[_0x7e82('0x6e')](_0x51f86d,function(_0x5c84a1){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x5c84a1['id'],'MailQueueId':_0x5bb212[_0x7e82('0x4a')]['id']},'transaction':_0x52a2c1});});})[_0x7e82('0x27')](function(){_0x51f86d[_0x7e82('0x6f')](function(_0xfb9718){socket['emit']('userMailQueue:save',{'UserId':_0xfb9718['id'],'MailQueueId':_0x24c288['id']});});});});});}})[_0x7e82('0x27')](respondWithStatusCode(_0x5f5521,null))[_0x7e82('0x4e')](handleError(_0x5f5521,null));};exports[_0x7e82('0x70')]=function(_0x57628c,_0x57b48e,_0x240572){return db[_0x7e82('0x64')][_0x7e82('0x47')]({'where':{'id':_0x57628c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x7e82('0x67')],'as':_0x7e82('0x68'),'attributes':['id'],'raw':!![]}]})[_0x7e82('0x27')](handleEntityNotFound(_0x57b48e,null))['then'](function(_0x3400c9){var _0x59adee=_[_0x7e82('0x31')](_0x3400c9,'id');var _0x430046=[];var _0xd7f05d=[];var _0x3451ca=squel[_0x7e82('0x71')]();_0x3451ca[_0x7e82('0x72')](_0x7e82('0x73'))['from'](_0x7e82('0x74'),'tq')[_0x7e82('0x75')](_0x7e82('0x76'),'ut',_0x7e82('0x77'))[_0x7e82('0x40')](_0x7e82('0x78'),_0x57628c[_0x7e82('0x4a')]['id']);for(var _0x1af74c=0x0;_0x1af74c<_0x3400c9[_0x7e82('0x3a')];_0x1af74c+=0x1){let _0x34c325=_0x3400c9[_0x1af74c];for(var _0xacb7ef=0x0;_0xacb7ef<_0x34c325['Agents'][_0x7e82('0x3a')];_0xacb7ef+=0x1){let _0x45efbf=_0x34c325[_0x7e82('0x68')][_0xacb7ef];var _0x46d43b=_0x3451ca[_0x7e82('0x79')]();_0x46d43b[_0x7e82('0x40')]('ut.UserId\x20=\x20?',_0x45efbf['id']);_0xd7f05d[_0x7e82('0x7a')](db[_0x7e82('0x6d')]['query'](_0x46d43b[_0x7e82('0x7b')](),{'type':db[_0x7e82('0x6d')][_0x7e82('0x7c')]['SELECT']})['then'](function(_0x3b2efd){if(_0x3b2efd['length']===0x1){return _0x45efbf['id'];}else{var _0x45522c=_[_0x7e82('0x7d')](_[_0x7e82('0x31')](_0x3b2efd,_0x7e82('0x7e')),function(_0x459025){return _[_0x7e82('0x7f')](_0x59adee,_0x459025);});if(_0x45522c){return _0x45efbf['id'];}}}));}}return BPromise[_0x7e82('0x80')](_0xd7f05d)[_0x7e82('0x27')](function(_0x331aba){_0x430046=_(_0x430046)[_0x7e82('0x81')](_0x331aba)[_0x7e82('0x82')]()[_0x7e82('0x83')]();return db[_0x7e82('0x44')][_0x7e82('0x4d')]({'where':{'id':_0x57628c[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](function(_0x27e67d){return db['sequelize']['transaction'](function(_0x52fed7){return _0x27e67d[_0x7e82('0x70')](_0x57628c[_0x7e82('0x35')][_0x7e82('0x66')],{'transaction':_0x52fed7})[_0x7e82('0x27')](function(){if(!_[_0x7e82('0x84')](_0x430046)){return _0x27e67d[_0x7e82('0x85')](_0x430046,{'transaction':_0x52fed7});}})[_0x7e82('0x27')](function(){_0x430046[_0x7e82('0x6f')](function(_0x331522){socket['emit']('userMailQueue:remove',{'UserId':_0x331522,'MailQueueId':_0x27e67d['id']});});});});});});})['then'](respondWithStatusCode(_0x57b48e,null))[_0x7e82('0x4e')](handleError(_0x57b48e,null));};exports[_0x7e82('0x86')]=function(_0x485bc1,_0x20fc86,_0x4f25f7){return db['MailQueue'][_0x7e82('0x4d')]({'where':{'id':_0x485bc1['params']['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x20fc86,null))[_0x7e82('0x27')](function(_0xb41ee1){if(_0xb41ee1){return _0xb41ee1[_0x7e82('0x86')](_0x485bc1[_0x7e82('0x50')][_0x7e82('0x66')],_[_0x7e82('0x87')](_0x485bc1[_0x7e82('0x50')],[_0x7e82('0x66'),'id'])||{})[_0x7e82('0x88')](function(_0x4ba757){for(var _0x5c4711=0x0;_0x5c4711<_0x485bc1[_0x7e82('0x50')]['ids'][_0x7e82('0x3a')];_0x5c4711+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x485bc1[_0x7e82('0x50')][_0x7e82('0x66')][_0x5c4711]),'MailQueueId':Number(_0x485bc1[_0x7e82('0x4a')]['id'])});}return _0x4ba757;});}})['then'](respondWithResult(_0x20fc86,null))['catch'](handleError(_0x20fc86,null));};exports[_0x7e82('0x85')]=function(_0x3afc12,_0x91dc33,_0x2b01d9){return db[_0x7e82('0x44')][_0x7e82('0x4d')]({'where':{'id':_0x3afc12[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x91dc33,null))[_0x7e82('0x27')](function(_0x4ac8e9){if(_0x4ac8e9){return _0x4ac8e9['removeAgents'](_0x3afc12[_0x7e82('0x35')][_0x7e82('0x66')])[_0x7e82('0x27')](function(){if(_[_0x7e82('0x89')](_0x3afc12[_0x7e82('0x35')][_0x7e82('0x66')])){for(var _0x368fbe=0x0;_0x368fbe<_0x3afc12[_0x7e82('0x35')][_0x7e82('0x66')][_0x7e82('0x3a')];_0x368fbe+=0x1){socket[_0x7e82('0x8a')](_0x7e82('0x8b'),{'UserId':Number(_0x3afc12[_0x7e82('0x35')][_0x7e82('0x66')][_0x368fbe]),'MailQueueId':Number(_0x3afc12[_0x7e82('0x4a')]['id'])});}}else{socket[_0x7e82('0x8a')]('userMailQueue:remove',{'UserId':Number(_0x3afc12[_0x7e82('0x35')][_0x7e82('0x66')]),'MailQueueId':Number(_0x3afc12[_0x7e82('0x4a')]['id'])});}});}})[_0x7e82('0x27')](respondWithStatusCode(_0x91dc33,null))[_0x7e82('0x4e')](handleError(_0x91dc33,null));};exports[_0x7e82('0x8c')]=function(_0x37df76,_0x5e517d,_0x4790f8){var _0x1401f6={};var _0x50a295={};var _0x2a32;var _0x51ca38;return db[_0x7e82('0x44')][_0x7e82('0x5a')]({'where':{'id':_0x37df76[_0x7e82('0x4a')]['id']}})[_0x7e82('0x27')](handleEntityNotFound(_0x5e517d,null))[_0x7e82('0x27')](function(_0x5ab3a0){if(_0x5ab3a0){_0x2a32=_0x5ab3a0;_0x50a295[_0x7e82('0x34')]=_[_0x7e82('0x4b')](db[_0x7e82('0x67')]['rawAttributes']);_0x50a295[_0x7e82('0x35')]=_[_0x7e82('0x4b')](_0x37df76[_0x7e82('0x35')]);_0x50a295['filters']=_[_0x7e82('0x37')](_0x50a295['model'],_0x50a295[_0x7e82('0x35')]);_0x1401f6[_0x7e82('0x38')]=_[_0x7e82('0x37')](_0x50a295[_0x7e82('0x34')],qs['fields'](_0x37df76[_0x7e82('0x35')][_0x7e82('0x39')]));_0x1401f6[_0x7e82('0x38')]=_0x1401f6[_0x7e82('0x38')][_0x7e82('0x3a')]?_0x1401f6[_0x7e82('0x38')]:_0x50a295[_0x7e82('0x34')];_0x1401f6[_0x7e82('0x3d')]=qs[_0x7e82('0x65')](_0x37df76[_0x7e82('0x35')]['sort']);_0x1401f6[_0x7e82('0x40')]=qs[_0x7e82('0x36')](_[_0x7e82('0x3e')](_0x37df76[_0x7e82('0x35')],_0x50a295[_0x7e82('0x36')]));if(_0x37df76[_0x7e82('0x35')][_0x7e82('0x3f')]){_0x1401f6[_0x7e82('0x40')]=_['merge'](_0x1401f6['where'],{'$or':_[_0x7e82('0x31')](_0x1401f6[_0x7e82('0x38')],function(_0x4d56c1){var _0x264c11={};_0x264c11[_0x4d56c1]={'$like':'%'+_0x37df76[_0x7e82('0x35')][_0x7e82('0x3f')]+'%'};return _0x264c11;})});}_0x1401f6=_[_0x7e82('0x41')]({},_0x1401f6,_0x37df76[_0x7e82('0x4c')]);return _0x2a32[_0x7e82('0x8c')](_0x1401f6);}})[_0x7e82('0x27')](function(_0x443a21){if(_0x443a21){_0x51ca38=_0x443a21[_0x7e82('0x3a')];if(!_0x37df76[_0x7e82('0x35')][_0x7e82('0x3b')](_0x7e82('0x3c'))){_0x1401f6[_0x7e82('0x22')]=qs[_0x7e82('0x22')](_0x37df76[_0x7e82('0x35')]['limit']);_0x1401f6[_0x7e82('0x21')]=qs[_0x7e82('0x21')](_0x37df76['query'][_0x7e82('0x21')]);}return _0x2a32[_0x7e82('0x8c')](_0x1401f6);}})[_0x7e82('0x27')](function(_0xf228ed){if(_0xf228ed){return _0xf228ed?{'count':_0x51ca38,'rows':_0xf228ed}:null;}})[_0x7e82('0x27')](respondWithResult(_0x5e517d,null))[_0x7e82('0x4e')](handleError(_0x5e517d,null));}; \ No newline at end of file +var _0x253c=['SIP','getTeams','Team','pick','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','compact','value','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','reject','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','MailQueue','includeAll','catch','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','findAll','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s'];(function(_0x23b57,_0x5b7329){var _0x180823=function(_0x2c9a70){while(--_0x2c9a70){_0x23b57['push'](_0x23b57['shift']());}};_0x180823(++_0x5b7329);}(_0x253c,0x13f));var _0xc253=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0x253c[_0x5b13c3];return _0x3d6780;};'use strict';var emlformat=require(_0xc253('0x0'));var rimraf=require(_0xc253('0x1'));var zipdir=require(_0xc253('0x2'));var jsonpatch=require(_0xc253('0x3'));var rp=require(_0xc253('0x4'));var moment=require(_0xc253('0x5'));var BPromise=require(_0xc253('0x6'));var Mustache=require(_0xc253('0x7'));var util=require(_0xc253('0x8'));var path=require(_0xc253('0x9'));var sox=require(_0xc253('0xa'));var csv=require('to-csv');var ejs=require(_0xc253('0xb'));var fs=require('fs');var fs_extra=require(_0xc253('0xc'));var _=require('lodash');var squel=require(_0xc253('0xd'));var crypto=require(_0xc253('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc253('0xf'));var toCsv=require(_0xc253('0x10'));var querystring=require(_0xc253('0x11'));var Papa=require(_0xc253('0x12'));var Redis=require('ioredis');var authService=require(_0xc253('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc253('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc253('0x15'))(_0xc253('0x16'));var utils=require('../../config/utils');var config=require(_0xc253('0x17'));var licenseUtil=require(_0xc253('0x18'));var db=require(_0xc253('0x19'))['db'];config[_0xc253('0x1a')]=_[_0xc253('0x1b')](config[_0xc253('0x1a')],{'host':_0xc253('0x1c'),'port':0x18eb});var socket=require(_0xc253('0x1d'))(new Redis(config[_0xc253('0x1a')]));require('./mailQueue.socket')[_0xc253('0x1e')](socket);function respondWithStatusCode(_0x5a7f24,_0x45b479){_0x45b479=_0x45b479||0xcc;return function(_0x4813e0){if(_0x4813e0){return _0x5a7f24['sendStatus'](_0x45b479);}return _0x5a7f24[_0xc253('0x1f')](_0x45b479)[_0xc253('0x20')]();};}function respondWithResult(_0x13f373,_0x6190fc){_0x6190fc=_0x6190fc||0xc8;return function(_0x4e41c0){if(_0x4e41c0){return _0x13f373['status'](_0x6190fc)[_0xc253('0x21')](_0x4e41c0);}};}function respondWithFilteredResult(_0x17370b,_0x5d9963){return function(_0x48e147){if(_0x48e147){var _0x3a4738=typeof _0x5d9963[_0xc253('0x22')]===_0xc253('0x23')&&typeof _0x5d9963[_0xc253('0x24')]===_0xc253('0x23');var _0x3a6358=_0x48e147[_0xc253('0x25')];var _0x170118=_0x3a4738?0x0:_0x5d9963[_0xc253('0x22')];var _0x3c62a1=_0x3a4738?_0x48e147[_0xc253('0x25')]:_0x5d9963[_0xc253('0x22')]+_0x5d9963[_0xc253('0x24')];var _0x36b1a7;if(_0x3c62a1>=_0x3a6358){_0x3c62a1=_0x3a6358;_0x36b1a7=0xc8;}else{_0x36b1a7=0xce;}_0x17370b[_0xc253('0x1f')](_0x36b1a7);return _0x17370b['set']('Content-Range',_0x170118+'-'+_0x3c62a1+'/'+_0x3a6358)[_0xc253('0x21')](_0x48e147);}return null;};}function patchUpdates(_0x2a2171){return function(_0x3a6245){try{jsonpatch['apply'](_0x3a6245,_0x2a2171,!![]);}catch(_0x1dc641){return BPromise[_0xc253('0x26')](_0x1dc641);}return _0x3a6245['save']();};}function saveUpdates(_0x4fa60d,_0x4a1c07){return function(_0x999afb){if(_0x999afb){return _0x999afb['update'](_0x4fa60d)[_0xc253('0x27')](function(_0x5d14a6){return _0x5d14a6;});}return null;};}function removeEntity(_0x13aaf2,_0x39e569){return function(_0x9a1071){if(_0x9a1071){return _0x9a1071[_0xc253('0x28')]()[_0xc253('0x27')](function(){var _0x35aa81=_0x9a1071[_0xc253('0x29')]({'plain':!![]});var _0x50edc5=_0xc253('0x2a');return db[_0xc253('0x2b')]['destroy']({'where':{'type':_0x50edc5,'resourceId':_0x35aa81['id']}})[_0xc253('0x27')](function(){return _0x9a1071;});})[_0xc253('0x27')](function(){_0x13aaf2['status'](0xcc)[_0xc253('0x20')]();});}};}function handleEntityNotFound(_0x2993b2,_0x418abb){return function(_0x12c4f3){if(!_0x12c4f3){_0x2993b2['sendStatus'](0x194);}return _0x12c4f3;};}function handleError(_0x2337d9,_0x291812){_0x291812=_0x291812||0x1f4;return function(_0x1bface){logger[_0xc253('0x2c')](_0x1bface[_0xc253('0x2d')]);if(_0x1bface[_0xc253('0x2e')]){delete _0x1bface[_0xc253('0x2e')];}_0x2337d9[_0xc253('0x1f')](_0x291812)[_0xc253('0x2f')](_0x1bface);};}exports[_0xc253('0x30')]=function(_0x3d0d38,_0x514552){var _0x331d2f={},_0x22a551={},_0x30d25c={'count':0x0,'rows':[]};var _0x522e6b=_[_0xc253('0x31')](db['MailQueue'][_0xc253('0x32')],function(_0x36a061){return{'name':_0x36a061['fieldName'],'type':_0x36a061[_0xc253('0x33')][_0xc253('0x34')]};});_0x22a551[_0xc253('0x35')]=_['map'](_0x522e6b,'name');_0x22a551[_0xc253('0x36')]=_[_0xc253('0x37')](_0x3d0d38['query']);_0x22a551[_0xc253('0x38')]=_[_0xc253('0x39')](_0x22a551[_0xc253('0x35')],_0x22a551[_0xc253('0x36')]);_0x331d2f[_0xc253('0x3a')]=_[_0xc253('0x39')](_0x22a551[_0xc253('0x35')],qs[_0xc253('0x3b')](_0x3d0d38[_0xc253('0x36')]['fields']));_0x331d2f[_0xc253('0x3a')]=_0x331d2f[_0xc253('0x3a')][_0xc253('0x3c')]?_0x331d2f[_0xc253('0x3a')]:_0x22a551[_0xc253('0x35')];if(!_0x3d0d38[_0xc253('0x36')][_0xc253('0x3d')]('nolimit')){_0x331d2f[_0xc253('0x24')]=qs[_0xc253('0x24')](_0x3d0d38['query'][_0xc253('0x24')]);_0x331d2f[_0xc253('0x22')]=qs['offset'](_0x3d0d38[_0xc253('0x36')][_0xc253('0x22')]);}_0x331d2f[_0xc253('0x3e')]=qs[_0xc253('0x3f')](_0x3d0d38[_0xc253('0x36')][_0xc253('0x3f')]);_0x331d2f['where']=qs['filters'](_['pick'](_0x3d0d38[_0xc253('0x36')],_0x22a551[_0xc253('0x38')]),_0x522e6b);if(_0x3d0d38[_0xc253('0x36')][_0xc253('0x40')]){_0x331d2f[_0xc253('0x41')]=_[_0xc253('0x42')](_0x331d2f[_0xc253('0x41')],{'$or':_[_0xc253('0x31')](_0x522e6b,function(_0x463d2b){if(_0x463d2b['type']!==_0xc253('0x43')){var _0x1df325={};_0x1df325[_0x463d2b[_0xc253('0x2e')]]={'$like':'%'+_0x3d0d38[_0xc253('0x36')][_0xc253('0x40')]+'%'};return _0x1df325;}})});}_0x331d2f=_[_0xc253('0x42')]({},_0x331d2f,_0x3d0d38[_0xc253('0x44')]);var _0x9f7d4f={'where':_0x331d2f[_0xc253('0x41')]};return db[_0xc253('0x45')]['count'](_0x9f7d4f)[_0xc253('0x27')](function(_0x1913a4){_0x30d25c['count']=_0x1913a4;if(_0x3d0d38['query'][_0xc253('0x46')]){_0x331d2f['include']=[{'all':!![]}];}return db[_0xc253('0x45')]['findAll'](_0x331d2f);})[_0xc253('0x27')](function(_0x48ef06){_0x30d25c['rows']=_0x48ef06;return _0x30d25c;})[_0xc253('0x27')](respondWithFilteredResult(_0x514552,_0x331d2f))[_0xc253('0x47')](handleError(_0x514552,null));};exports[_0xc253('0x48')]=function(_0xb34787,_0x29c1cd){var _0x175cea={'raw':!![],'where':{'id':_0xb34787[_0xc253('0x49')]['id']}},_0x3047d3={};_0x3047d3[_0xc253('0x35')]=_[_0xc253('0x37')](db[_0xc253('0x45')]['rawAttributes']);_0x3047d3[_0xc253('0x36')]=_[_0xc253('0x37')](_0xb34787[_0xc253('0x36')]);_0x3047d3[_0xc253('0x38')]=_[_0xc253('0x39')](_0x3047d3['model'],_0x3047d3[_0xc253('0x36')]);_0x175cea[_0xc253('0x3a')]=_[_0xc253('0x39')](_0x3047d3['model'],qs['fields'](_0xb34787[_0xc253('0x36')]['fields']));_0x175cea[_0xc253('0x3a')]=_0x175cea[_0xc253('0x3a')][_0xc253('0x3c')]?_0x175cea[_0xc253('0x3a')]:_0x3047d3['model'];if(_0xb34787[_0xc253('0x36')][_0xc253('0x46')]){_0x175cea[_0xc253('0x4a')]=[{'all':!![]}];}_0x175cea=_[_0xc253('0x42')]({},_0x175cea,_0xb34787['options']);return db[_0xc253('0x45')]['find'](_0x175cea)[_0xc253('0x27')](handleEntityNotFound(_0x29c1cd,null))[_0xc253('0x27')](respondWithResult(_0x29c1cd,null))['catch'](handleError(_0x29c1cd,null));};exports[_0xc253('0x4b')]=function(_0x52fc67,_0x174d15){return db[_0xc253('0x45')]['create'](_0x52fc67['body'],{})[_0xc253('0x27')](function(_0x4b0d41){var _0x2b5ee9=_0x52fc67['user'][_0xc253('0x29')]({'plain':!![]});if(!_0x2b5ee9)throw new Error(_0xc253('0x4c'));if(_0x2b5ee9['role']===_0xc253('0x4d')){var _0xe7e807=_0x4b0d41[_0xc253('0x29')]({'plain':!![]});var _0x5942fa=_0xc253('0x2a');return db[_0xc253('0x4e')][_0xc253('0x4f')]({'where':{'name':_0x5942fa,'userProfileId':_0x2b5ee9[_0xc253('0x50')]},'raw':!![]})[_0xc253('0x27')](function(_0x30a629){if(_0x30a629&&_0x30a629[_0xc253('0x51')]===0x0){return db[_0xc253('0x2b')][_0xc253('0x4b')]({'name':_0xe7e807[_0xc253('0x2e')],'resourceId':_0xe7e807['id'],'type':_0x30a629['name'],'sectionId':_0x30a629['id']},{})[_0xc253('0x27')](function(){return _0x4b0d41;});}else{return _0x4b0d41;}})[_0xc253('0x47')](function(_0xdaa2bd){logger[_0xc253('0x2c')](_0xc253('0x52'),_0xdaa2bd);throw _0xdaa2bd;});}return _0x4b0d41;})[_0xc253('0x27')](respondWithResult(_0x174d15,0xc9))[_0xc253('0x47')](handleError(_0x174d15,null));};exports[_0xc253('0x53')]=function(_0x308c93,_0x316800){if(_0x308c93[_0xc253('0x54')]['id']){delete _0x308c93[_0xc253('0x54')]['id'];}return db['MailQueue'][_0xc253('0x4f')]({'where':{'id':_0x308c93[_0xc253('0x49')]['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x316800,null))['then'](saveUpdates(_0x308c93[_0xc253('0x54')],null))[_0xc253('0x27')](respondWithResult(_0x316800,null))[_0xc253('0x47')](handleError(_0x316800,null));};exports[_0xc253('0x28')]=function(_0x4e852f,_0xb88fc6){return db[_0xc253('0x45')][_0xc253('0x4f')]({'where':{'id':_0x4e852f['params']['id']}})[_0xc253('0x27')](handleEntityNotFound(_0xb88fc6,null))[_0xc253('0x27')](removeEntity(_0xb88fc6,null))[_0xc253('0x47')](handleError(_0xb88fc6,null));};exports[_0xc253('0x55')]=function(_0x210de4,_0x381305){return db[_0xc253('0x45')]['describe']()[_0xc253('0x27')](respondWithResult(_0x381305,null))['catch'](handleError(_0x381305,null));};exports[_0xc253('0x56')]=function(_0x4346e0,_0x203b93,_0x1b15bc){var _0xdfff3b={'raw':!![],'where':{}},_0x2113df={},_0x5961d1;return db[_0xc253('0x45')][_0xc253('0x57')]({'where':{'id':_0x4346e0['params']['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x203b93,null))[_0xc253('0x27')](function(_0x1713d9){if(_0x1713d9){_0x5961d1=_0x1713d9[_0xc253('0x29')]({'plain':!![]});_0x2113df[_0xc253('0x35')]=_[_0xc253('0x37')](db[_0xc253('0x58')][_0xc253('0x32')]);_0x2113df[_0xc253('0x36')]=_['keys'](_0x4346e0[_0xc253('0x36')]);_0x2113df[_0xc253('0x38')]=_['intersection'](_0x2113df['model'],_0x2113df[_0xc253('0x36')]);_0xdfff3b['attributes']=_[_0xc253('0x39')](_0x2113df['model'],qs[_0xc253('0x3b')](_0x4346e0[_0xc253('0x36')]['fields']));_0xdfff3b[_0xc253('0x3a')]=_0xdfff3b[_0xc253('0x3a')]['length']?_0xdfff3b[_0xc253('0x3a')]:_0x2113df[_0xc253('0x35')];if(!_0x4346e0[_0xc253('0x36')][_0xc253('0x3d')](_0xc253('0x59'))){_0xdfff3b['limit']=qs['limit'](_0x4346e0['query'][_0xc253('0x24')]);_0xdfff3b[_0xc253('0x22')]=qs['offset'](_0x4346e0[_0xc253('0x36')][_0xc253('0x22')]);}_0xdfff3b['order']=qs[_0xc253('0x3f')](_0x4346e0[_0xc253('0x36')]['sort']);_0xdfff3b[_0xc253('0x41')]=qs[_0xc253('0x38')](_['pick'](_0x4346e0[_0xc253('0x36')],_0x2113df[_0xc253('0x38')]));_0xdfff3b[_0xc253('0x41')][_0xc253('0x5a')]=_0x1713d9['id'];if(_0x4346e0[_0xc253('0x36')][_0xc253('0x40')]){_0xdfff3b[_0xc253('0x41')]=_[_0xc253('0x42')](_0xdfff3b[_0xc253('0x41')],{'$or':_[_0xc253('0x31')](_0xdfff3b[_0xc253('0x3a')],function(_0x48517f){var _0xa4a7cb={};_0xa4a7cb[_0x48517f]={'$like':'%'+_0x4346e0[_0xc253('0x36')][_0xc253('0x40')]+'%'};return _0xa4a7cb;})});}_0xdfff3b=_[_0xc253('0x42')]({},_0xdfff3b,_0x4346e0[_0xc253('0x44')]);return db[_0xc253('0x58')][_0xc253('0x5b')](_0xdfff3b);}})['then'](function(_0x8fa8ad){if(_0x8fa8ad){return db[_0xc253('0x5c')][_0xc253('0x5d')]({'where':{'id':_[_0xc253('0x31')](_0x8fa8ad,'UserId'),'role':_0xc253('0x5e')},'attributes':['id','name',_0xc253('0x5f'),_0xc253('0x60'),_0xc253('0x61')]});}})[_0xc253('0x27')](function(_0x1fe632){if(_0x1fe632){return{'count':_0x1fe632[_0xc253('0x25')],'rows':_['map'](_0x1fe632[_0xc253('0x62')],function(_0x540c87){return{'membername':_0x540c87[_0xc253('0x2e')],'UserId':_0x540c87['id'],'queue_name':_0x5961d1[_0xc253('0x2e')],'MailQueueId':_0x5961d1['id'],'interface':util[_0xc253('0x63')](_0xc253('0x64'),_0xc253('0x65'),_0x540c87['name']),'penalty':0x0,'paused':_0x540c87['mailPause'],'createdAt':_0x540c87[_0xc253('0x61')],'updatedAt':_0x540c87[_0xc253('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc253('0x27')](respondWithFilteredResult(_0x203b93,_0xdfff3b))[_0xc253('0x47')](handleError(_0x203b93,null));};exports[_0xc253('0x66')]=function(_0x4f9e62,_0x4d1e76,_0x143166){var _0x3c386f={};var _0xced276={};var _0x320746;var _0x2972b8;return db[_0xc253('0x45')][_0xc253('0x57')]({'where':{'id':_0x4f9e62[_0xc253('0x49')]['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x4d1e76,null))[_0xc253('0x27')](function(_0x5004ac){if(_0x5004ac){_0x320746=_0x5004ac;_0xced276[_0xc253('0x35')]=_[_0xc253('0x37')](db[_0xc253('0x67')]['rawAttributes']);_0xced276[_0xc253('0x36')]=_[_0xc253('0x37')](_0x4f9e62[_0xc253('0x36')]);_0xced276[_0xc253('0x38')]=_['intersection'](_0xced276[_0xc253('0x35')],_0xced276['query']);_0x3c386f[_0xc253('0x3a')]=_[_0xc253('0x39')](_0xced276[_0xc253('0x35')],qs[_0xc253('0x3b')](_0x4f9e62[_0xc253('0x36')][_0xc253('0x3b')]));_0x3c386f['attributes']=_0x3c386f[_0xc253('0x3a')]['length']?_0x3c386f[_0xc253('0x3a')]:_0xced276[_0xc253('0x35')];_0x3c386f[_0xc253('0x3e')]=qs['sort'](_0x4f9e62[_0xc253('0x36')][_0xc253('0x3f')]);_0x3c386f[_0xc253('0x41')]=qs['filters'](_[_0xc253('0x68')](_0x4f9e62[_0xc253('0x36')],_0xced276[_0xc253('0x38')]));if(_0x4f9e62['query'][_0xc253('0x40')]){_0x3c386f[_0xc253('0x41')]=_[_0xc253('0x42')](_0x3c386f[_0xc253('0x41')],{'$or':_[_0xc253('0x31')](_0x3c386f['attributes'],function(_0x3c519f){var _0x55c6d6={};_0x55c6d6[_0x3c519f]={'$like':'%'+_0x4f9e62[_0xc253('0x36')][_0xc253('0x40')]+'%'};return _0x55c6d6;})});}_0x3c386f=_[_0xc253('0x42')]({},_0x3c386f,_0x4f9e62[_0xc253('0x44')]);return _0x320746[_0xc253('0x66')](_0x3c386f);}})[_0xc253('0x27')](function(_0x141758){if(_0x141758){_0x2972b8=_0x141758[_0xc253('0x3c')];if(!_0x4f9e62[_0xc253('0x36')]['hasOwnProperty'](_0xc253('0x59'))){_0x3c386f[_0xc253('0x24')]=qs[_0xc253('0x24')](_0x4f9e62[_0xc253('0x36')][_0xc253('0x24')]);_0x3c386f[_0xc253('0x22')]=qs[_0xc253('0x22')](_0x4f9e62[_0xc253('0x36')][_0xc253('0x22')]);}return _0x320746[_0xc253('0x66')](_0x3c386f);}})[_0xc253('0x27')](function(_0x2ae444){if(_0x2ae444){return _0x2ae444?{'count':_0x2972b8,'rows':_0x2ae444}:null;}})[_0xc253('0x27')](respondWithResult(_0x4d1e76,null))[_0xc253('0x47')](handleError(_0x4d1e76,null));};exports[_0xc253('0x69')]=function(_0x5d2467,_0x598b9b,_0xd39d45){var _0x437e36=_0x5d2467['body'][_0xc253('0x6a')];return db[_0xc253('0x67')][_0xc253('0x5b')]({'where':{'id':_0x437e36},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xc253('0x2e'),'online',_0xc253('0x6b'),_0xc253('0x6c')],'raw':!![]}]})['then'](function(_0xc4ede5){if(_0xc4ede5){var _0x4796ab=_[_0xc253('0x6d')](_0xc4ede5,function(_0x51c93f){var _0x3759a8=_0x51c93f[_0xc253('0x29')]({'plain':!![]});return _0x3759a8[_0xc253('0x6e')];});return db[_0xc253('0x45')]['find']({'where':{'id':_0x5d2467['params']['id']}})[_0xc253('0x27')](function(_0x2e6566){return db[_0xc253('0x6f')]['transaction'](function(_0x413df9){return _0x2e6566[_0xc253('0x69')](_0x437e36,{'transaction':_0x413df9})[_0xc253('0x27')](function(){return BPromise['each'](_0x4796ab,function(_0x58e2b1){return db['UserMailQueue'][_0xc253('0x70')]({'where':{'UserId':_0x58e2b1['id'],'MailQueueId':_0x5d2467[_0xc253('0x49')]['id']},'transaction':_0x413df9});});})[_0xc253('0x27')](function(){_0x4796ab[_0xc253('0x71')](function(_0x5f3151){socket['emit'](_0xc253('0x72'),{'UserId':_0x5f3151['id'],'MailQueueId':_0x2e6566['id']});});});});});}})[_0xc253('0x27')](respondWithStatusCode(_0x598b9b,null))['catch'](handleError(_0x598b9b,null));};exports[_0xc253('0x73')]=function(_0x4f37aa,_0x1284c2,_0x3ab419){return db['Team'][_0xc253('0x5b')]({'where':{'id':_0x4f37aa['query'][_0xc253('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xc253('0x5c')],'as':_0xc253('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xc253('0x27')](handleEntityNotFound(_0x1284c2,null))[_0xc253('0x27')](function(_0x4dd907){var _0x17b2bb=_[_0xc253('0x31')](_0x4dd907,'id');var _0x60ac73=[];var _0x466b69=[];var _0x1f7619=squel[_0xc253('0x74')]();_0x1f7619[_0xc253('0x75')]('tq.TeamId')[_0xc253('0x76')](_0xc253('0x77'),'tq')[_0xc253('0x78')](_0xc253('0x79'),'ut',_0xc253('0x7a'))[_0xc253('0x41')](_0xc253('0x7b'),_0x4f37aa[_0xc253('0x49')]['id']);for(var _0x3b1c3f=0x0;_0x3b1c3f<_0x4dd907[_0xc253('0x3c')];_0x3b1c3f+=0x1){let _0x19feed=_0x4dd907[_0x3b1c3f];for(var _0x5ebb27=0x0;_0x5ebb27<_0x19feed[_0xc253('0x6e')]['length'];_0x5ebb27+=0x1){let _0x212808=_0x19feed[_0xc253('0x6e')][_0x5ebb27];var _0x1fbe7f=_0x1f7619['clone']();_0x1fbe7f['where'](_0xc253('0x7c'),_0x212808['id']);_0x466b69[_0xc253('0x7d')](db['sequelize'][_0xc253('0x36')](_0x1fbe7f[_0xc253('0x7e')](),{'type':db[_0xc253('0x6f')]['QueryTypes'][_0xc253('0x7f')]})[_0xc253('0x27')](function(_0x31cad9){if(_0x31cad9[_0xc253('0x3c')]===0x1){return _0x212808['id'];}else{var _0x186ce1=_[_0xc253('0x80')](_[_0xc253('0x31')](_0x31cad9,_0xc253('0x81')),function(_0x3f310b){return _[_0xc253('0x82')](_0x17b2bb,_0x3f310b);});if(_0x186ce1){return _0x212808['id'];}}}));}}return BPromise['all'](_0x466b69)[_0xc253('0x27')](function(_0x15e90e){_0x60ac73=_(_0x60ac73)['union'](_0x15e90e)[_0xc253('0x83')]()[_0xc253('0x84')]();return db[_0xc253('0x45')][_0xc253('0x4f')]({'where':{'id':_0x4f37aa['params']['id']}})[_0xc253('0x27')](function(_0x639dcc){return db[_0xc253('0x6f')][_0xc253('0x85')](function(_0x2d4987){return _0x639dcc[_0xc253('0x73')](_0x4f37aa[_0xc253('0x36')]['ids'],{'transaction':_0x2d4987})[_0xc253('0x27')](function(){if(!_[_0xc253('0x86')](_0x60ac73)){return _0x639dcc[_0xc253('0x87')](_0x60ac73,{'transaction':_0x2d4987});}})[_0xc253('0x27')](function(){_0x60ac73[_0xc253('0x71')](function(_0x54db65){socket[_0xc253('0x88')](_0xc253('0x89'),{'UserId':_0x54db65,'MailQueueId':_0x639dcc['id']});});});});});});})[_0xc253('0x27')](respondWithStatusCode(_0x1284c2,null))[_0xc253('0x47')](handleError(_0x1284c2,null));};exports[_0xc253('0x8a')]=function(_0x46fccd,_0xe263bd,_0x384d70){return db[_0xc253('0x45')][_0xc253('0x4f')]({'where':{'id':_0x46fccd[_0xc253('0x49')]['id']}})[_0xc253('0x27')](handleEntityNotFound(_0xe263bd,null))['then'](function(_0x3d8ccd){if(_0x3d8ccd){return _0x3d8ccd[_0xc253('0x8a')](_0x46fccd[_0xc253('0x54')][_0xc253('0x6a')],_['omit'](_0x46fccd[_0xc253('0x54')],[_0xc253('0x6a'),'id'])||{})['spread'](function(_0xeb90e7){for(var _0x191cdc=0x0;_0x191cdc<_0x46fccd[_0xc253('0x54')][_0xc253('0x6a')][_0xc253('0x3c')];_0x191cdc+=0x1){socket[_0xc253('0x88')](_0xc253('0x72'),{'UserId':Number(_0x46fccd[_0xc253('0x54')]['ids'][_0x191cdc]),'MailQueueId':Number(_0x46fccd['params']['id'])});}return _0xeb90e7;});}})[_0xc253('0x27')](respondWithResult(_0xe263bd,null))[_0xc253('0x47')](handleError(_0xe263bd,null));};exports[_0xc253('0x87')]=function(_0x94b539,_0x23a2e7,_0x5364bc){return db[_0xc253('0x45')][_0xc253('0x4f')]({'where':{'id':_0x94b539[_0xc253('0x49')]['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x23a2e7,null))[_0xc253('0x27')](function(_0x2f18e9){if(_0x2f18e9){return _0x2f18e9[_0xc253('0x87')](_0x94b539['query'][_0xc253('0x6a')])[_0xc253('0x27')](function(){if(_['isArray'](_0x94b539[_0xc253('0x36')][_0xc253('0x6a')])){for(var _0x100c46=0x0;_0x100c46<_0x94b539['query'][_0xc253('0x6a')]['length'];_0x100c46+=0x1){socket['emit'](_0xc253('0x89'),{'UserId':Number(_0x94b539[_0xc253('0x36')]['ids'][_0x100c46]),'MailQueueId':Number(_0x94b539[_0xc253('0x49')]['id'])});}}else{socket[_0xc253('0x88')](_0xc253('0x89'),{'UserId':Number(_0x94b539['query'][_0xc253('0x6a')]),'MailQueueId':Number(_0x94b539[_0xc253('0x49')]['id'])});}});}})[_0xc253('0x27')](respondWithStatusCode(_0x23a2e7,null))[_0xc253('0x47')](handleError(_0x23a2e7,null));};exports[_0xc253('0x8b')]=function(_0x46ef50,_0x1143e3,_0x1e033d){var _0x14b81d={};var _0x1bc6bd={};var _0x28baf7;var _0x4fbea7;return db[_0xc253('0x45')][_0xc253('0x57')]({'where':{'id':_0x46ef50['params']['id']}})[_0xc253('0x27')](handleEntityNotFound(_0x1143e3,null))[_0xc253('0x27')](function(_0x1d4ffd){if(_0x1d4ffd){_0x28baf7=_0x1d4ffd;_0x1bc6bd[_0xc253('0x35')]=_['keys'](db[_0xc253('0x5c')][_0xc253('0x32')]);_0x1bc6bd['query']=_[_0xc253('0x37')](_0x46ef50[_0xc253('0x36')]);_0x1bc6bd['filters']=_[_0xc253('0x39')](_0x1bc6bd[_0xc253('0x35')],_0x1bc6bd[_0xc253('0x36')]);_0x14b81d[_0xc253('0x3a')]=_['intersection'](_0x1bc6bd['model'],qs['fields'](_0x46ef50[_0xc253('0x36')][_0xc253('0x3b')]));_0x14b81d[_0xc253('0x3a')]=_0x14b81d[_0xc253('0x3a')][_0xc253('0x3c')]?_0x14b81d['attributes']:_0x1bc6bd['model'];_0x14b81d['order']=qs[_0xc253('0x3f')](_0x46ef50['query'][_0xc253('0x3f')]);_0x14b81d['where']=qs[_0xc253('0x38')](_['pick'](_0x46ef50[_0xc253('0x36')],_0x1bc6bd[_0xc253('0x38')]));if(_0x46ef50[_0xc253('0x36')][_0xc253('0x40')]){_0x14b81d['where']=_[_0xc253('0x42')](_0x14b81d[_0xc253('0x41')],{'$or':_[_0xc253('0x31')](_0x14b81d[_0xc253('0x3a')],function(_0x476dc1){var _0x374cb9={};_0x374cb9[_0x476dc1]={'$like':'%'+_0x46ef50['query'][_0xc253('0x40')]+'%'};return _0x374cb9;})});}_0x14b81d=_[_0xc253('0x42')]({},_0x14b81d,_0x46ef50[_0xc253('0x44')]);return _0x28baf7['getAgents'](_0x14b81d);}})[_0xc253('0x27')](function(_0x1d0c81){if(_0x1d0c81){_0x4fbea7=_0x1d0c81[_0xc253('0x3c')];if(!_0x46ef50[_0xc253('0x36')]['hasOwnProperty'](_0xc253('0x59'))){_0x14b81d[_0xc253('0x24')]=qs[_0xc253('0x24')](_0x46ef50[_0xc253('0x36')]['limit']);_0x14b81d[_0xc253('0x22')]=qs[_0xc253('0x22')](_0x46ef50[_0xc253('0x36')][_0xc253('0x22')]);}return _0x28baf7['getAgents'](_0x14b81d);}})[_0xc253('0x27')](function(_0x5df487){if(_0x5df487){return _0x5df487?{'count':_0x4fbea7,'rows':_0x5df487}:null;}})['then'](respondWithResult(_0x1143e3,null))[_0xc253('0x47')](handleError(_0x1143e3,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 29af45b..fa7148b 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 _0x93b7=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0x93b7,0x117));var _0x793b=function(_0x5b08f3,_0x40e4ea){_0x5b08f3=_0x5b08f3-0x0;var _0x3cac3e=_0x93b7[_0x5b08f3];return _0x3cac3e;};'use strict';var EventEmitter=require(_0x793b('0x0'));var MailQueue=require(_0x793b('0x1'))['db'][_0x793b('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x793b('0x3')](0x0);var events={'afterCreate':_0x793b('0x4'),'afterUpdate':_0x793b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x484bd9){return function(_0x59107d,_0xa3c97c,_0x2685a2){MailQueueEvents['emit'](_0x484bd9+':'+_0x59107d['id'],_0x59107d);MailQueueEvents[_0x793b('0x6')](_0x484bd9,_0x59107d);_0x2685a2(null);};}for(var e in events){if(events[_0x793b('0x7')](e)){var event=events[e];MailQueue[_0x793b('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x8dd9=['remove','emit','hook','exports','events','MailQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dd9,0x1a1));var _0x98dd=function(_0x2c4841,_0x10c9fe){_0x2c4841=_0x2c4841-0x0;var _0x1a24c0=_0x8dd9[_0x2c4841];return _0x1a24c0;};'use strict';var EventEmitter=require(_0x98dd('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x98dd('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x98dd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x98dd('0x3')};function emitEvent(_0x44a6db){return function(_0x137e92,_0x50dfe9,_0x5b0a57){MailQueueEvents[_0x98dd('0x4')](_0x44a6db+':'+_0x137e92['id'],_0x137e92);MailQueueEvents[_0x98dd('0x4')](_0x44a6db,_0x137e92);_0x5b0a57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x98dd('0x5')](e,emitEvent(event));}}module[_0x98dd('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index eabd65d..cdeff78 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 _0x7a17=['path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdc356f,_0x3003d0){var _0x339eaa=function(_0xc2283e){while(--_0xc2283e){_0xdc356f['push'](_0xdc356f['shift']());}};_0x339eaa(++_0x3003d0);}(_0x7a17,0xa1));var _0x77a1=function(_0xc767d8,_0x2ac375){_0xc767d8=_0xc767d8-0x0;var _0xa70d8a=_0x7a17[_0xc767d8];return _0xa70d8a;};'use strict';var _=require(_0x77a1('0x0'));var util=require(_0x77a1('0x1'));var logger=require(_0x77a1('0x2'))(_0x77a1('0x3'));var moment=require(_0x77a1('0x4'));var BPromise=require(_0x77a1('0x5'));var rp=require(_0x77a1('0x6'));var fs=require('fs');var path=require(_0x77a1('0x7'));var rimraf=require(_0x77a1('0x8'));var config=require(_0x77a1('0x9'));var attributes=require(_0x77a1('0xa'));module['exports']=function(_0x381422,_0x4ecf92){return _0x381422[_0x77a1('0xb')](_0x77a1('0xc'),attributes,{'tableName':_0x77a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2133=['define','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x1e52b3,_0x37dd42){var _0x3b8f09=function(_0x146ceb){while(--_0x146ceb){_0x1e52b3['push'](_0x1e52b3['shift']());}};_0x3b8f09(++_0x37dd42);}(_0x2133,0x1bc));var _0x3213=function(_0x1f70e7,_0x46df32){_0x1f70e7=_0x1f70e7-0x0;var _0x14998a=_0x2133[_0x1f70e7];return _0x14998a;};'use strict';var _=require(_0x3213('0x0'));var util=require(_0x3213('0x1'));var logger=require(_0x3213('0x2'))(_0x3213('0x3'));var moment=require(_0x3213('0x4'));var BPromise=require(_0x3213('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3213('0x6'));var rimraf=require(_0x3213('0x7'));var config=require(_0x3213('0x8'));var attributes=require(_0x3213('0x9'));module[_0x3213('0xa')]=function(_0x431148,_0x5a3bf0){return _0x431148[_0x3213('0xb')]('MailQueue',attributes,{'tableName':_0x3213('0xc'),'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 0e32367..d3bbac4 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 _0xe663=['attributes','limit','map','model','include','debug','ShowMailQueue','MailQueue','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailQueue','findAll','options','where'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xe663,0x156));var _0x3e66=function(_0x3a9b07,_0x10e63e){_0x3a9b07=_0x3a9b07-0x0;var _0x1a1cd2=_0xe663[_0x3a9b07];return _0x1a1cd2;};'use strict';var _=require(_0x3e66('0x0'));var util=require('util');var moment=require(_0x3e66('0x1'));var BPromise=require(_0x3e66('0x2'));var rs=require(_0x3e66('0x3'));var fs=require('fs');var Redis=require(_0x3e66('0x4'));var db=require(_0x3e66('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e66('0x6'));var config=require(_0x3e66('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3e66('0x8')]['http']({'port':0x232a});config[_0x3e66('0x9')]=_['defaults'](config[_0x3e66('0x9')],{'host':_0x3e66('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e66('0x9')]));require(_0x3e66('0xb'))[_0x3e66('0xc')](socket);function respondWithRpcPromise(_0x533af0,_0x2fa805,_0x3003e0){return new BPromise(function(_0x35eb4d,_0x496dfd){return client[_0x3e66('0xd')](_0x533af0,_0x3003e0)[_0x3e66('0xe')](function(_0x1f13a4){logger[_0x3e66('0xf')](_0x3e66('0x10'),_0x2fa805,_0x3e66('0x11'));logger['debug'](_0x3e66('0x12'),_0x2fa805,_0x3e66('0x11'),JSON[_0x3e66('0x13')](_0x1f13a4));if(_0x1f13a4[_0x3e66('0x14')]){if(_0x1f13a4[_0x3e66('0x14')][_0x3e66('0x15')]===0x1f4){logger[_0x3e66('0x14')](_0x3e66('0x10'),_0x2fa805,_0x1f13a4[_0x3e66('0x14')][_0x3e66('0x16')]);return _0x496dfd(_0x1f13a4['error'][_0x3e66('0x16')]);}logger[_0x3e66('0x14')]('MailQueue,\x20%s,\x20%s',_0x2fa805,_0x1f13a4[_0x3e66('0x14')][_0x3e66('0x16')]);return _0x35eb4d(_0x1f13a4[_0x3e66('0x14')][_0x3e66('0x16')]);}else{logger[_0x3e66('0xf')](_0x3e66('0x10'),_0x2fa805,_0x3e66('0x11'));_0x35eb4d(_0x1f13a4[_0x3e66('0x17')][_0x3e66('0x16')]);}})['catch'](function(_0x3b2255){logger[_0x3e66('0x14')](_0x3e66('0x10'),_0x2fa805,_0x3b2255);_0x496dfd(_0x3b2255);});});}exports[_0x3e66('0x18')]=function(_0x13a90b){var _0x5db6fa=this;return new Promise(function(_0x488f3b,_0x484a77){return db['MailQueue'][_0x3e66('0x19')]({'raw':_0x13a90b[_0x3e66('0x1a')]?_0x13a90b[_0x3e66('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x13a90b[_0x3e66('0x1a')]?_0x13a90b[_0x3e66('0x1a')][_0x3e66('0x1b')]||null:null,'attributes':_0x13a90b['options']?_0x13a90b[_0x3e66('0x1a')][_0x3e66('0x1c')]||null:null,'limit':_0x13a90b['options']?_0x13a90b[_0x3e66('0x1a')][_0x3e66('0x1d')]||null:null,'include':_0x13a90b[_0x3e66('0x1a')]?_0x13a90b[_0x3e66('0x1a')]['include']?_[_0x3e66('0x1e')](_0x13a90b[_0x3e66('0x1a')]['include'],function(_0x113c4d){return{'model':db[_0x113c4d[_0x3e66('0x1f')]],'as':_0x113c4d['as'],'attributes':_0x113c4d[_0x3e66('0x1c')],'include':_0x113c4d[_0x3e66('0x20')]?_[_0x3e66('0x1e')](_0x113c4d[_0x3e66('0x20')],function(_0xae9fb6){return{'model':db[_0xae9fb6[_0x3e66('0x1f')]],'as':_0xae9fb6['as'],'attributes':_0xae9fb6[_0x3e66('0x1c')],'include':_0xae9fb6['include']?_['map'](_0xae9fb6[_0x3e66('0x20')],function(_0x3abc9b){return{'model':db[_0x3abc9b[_0x3e66('0x1f')]],'as':_0x3abc9b['as'],'attributes':_0x3abc9b[_0x3e66('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f2481){logger[_0x3e66('0xf')](_0x3e66('0x18'),_0x13a90b);logger[_0x3e66('0x21')](_0x3e66('0x18'),_0x13a90b,JSON[_0x3e66('0x13')](_0x5f2481));_0x488f3b(_0x5f2481);})['catch'](function(_0x305f2e){logger[_0x3e66('0x14')](_0x3e66('0x18'),_0x305f2e['message'],_0x13a90b);_0x484a77(_0x5db6fa[_0x3e66('0x14')](0x1f4,_0x305f2e[_0x3e66('0x16')]));});});};exports[_0x3e66('0x22')]=function(_0x4fcb1b){var _0x4b4e0d=this;return new Promise(function(_0x436ffb,_0x3b8015){return db[_0x3e66('0x23')]['find']({'raw':_0x4fcb1b['options']?_0x4fcb1b[_0x3e66('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4fcb1b[_0x3e66('0x1a')]?_0x4fcb1b['options']['where']||null:null,'attributes':_0x4fcb1b[_0x3e66('0x1a')]?_0x4fcb1b[_0x3e66('0x1a')][_0x3e66('0x1c')]||null:null,'include':_0x4fcb1b[_0x3e66('0x1a')]?_0x4fcb1b[_0x3e66('0x1a')]['include']?_[_0x3e66('0x1e')](_0x4fcb1b[_0x3e66('0x1a')][_0x3e66('0x20')],function(_0xccfe0b){return{'model':db[_0xccfe0b['model']],'as':_0xccfe0b['as'],'attributes':_0xccfe0b['attributes'],'include':_0xccfe0b[_0x3e66('0x20')]?_[_0x3e66('0x1e')](_0xccfe0b['include'],function(_0x5251b2){return{'model':db[_0x5251b2[_0x3e66('0x1f')]],'as':_0x5251b2['as'],'attributes':_0x5251b2[_0x3e66('0x1c')],'include':_0x5251b2[_0x3e66('0x20')]?_['map'](_0x5251b2[_0x3e66('0x20')],function(_0x24b5a0){return{'model':db[_0x24b5a0[_0x3e66('0x1f')]],'as':_0x24b5a0['as'],'attributes':_0x24b5a0[_0x3e66('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3e66('0xe')](function(_0x44f23f){logger[_0x3e66('0xf')](_0x3e66('0x22'),_0x4fcb1b);logger[_0x3e66('0x21')](_0x3e66('0x22'),_0x4fcb1b,JSON[_0x3e66('0x13')](_0x44f23f));_0x436ffb(_0x44f23f);})[_0x3e66('0x24')](function(_0x2d7675){logger[_0x3e66('0x14')]('ShowMailQueue',_0x2d7675[_0x3e66('0x16')],_0x4fcb1b);_0x3b8015(_0x4b4e0d[_0x3e66('0x14')](0x1f4,_0x2d7675[_0x3e66('0x16')]));});});}; \ No newline at end of file +var _0xa68b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','map','model','attributes','info','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x16692e,_0x94a612){var _0x28d7cd=function(_0x52a4ac){while(--_0x52a4ac){_0x16692e['push'](_0x16692e['shift']());}};_0x28d7cd(++_0x94a612);}(_0xa68b,0xf6));var _0xba68=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xa68b[_0x5d88c0];return _0x1b40f0;};'use strict';var _=require('lodash');var util=require(_0xba68('0x0'));var moment=require(_0xba68('0x1'));var BPromise=require(_0xba68('0x2'));var rs=require(_0xba68('0x3'));var fs=require('fs');var Redis=require(_0xba68('0x4'));var db=require(_0xba68('0x5'))['db'];var utils=require(_0xba68('0x6'));var logger=require('../../config/logger')(_0xba68('0x7'));var config=require(_0xba68('0x8'));var jayson=require(_0xba68('0x9'));var client=jayson[_0xba68('0xa')][_0xba68('0xb')]({'port':0x232a});config[_0xba68('0xc')]=_[_0xba68('0xd')](config[_0xba68('0xc')],{'host':_0xba68('0xe'),'port':0x18eb});var socket=require(_0xba68('0xf'))(new Redis(config[_0xba68('0xc')]));require(_0xba68('0x10'))[_0xba68('0x11')](socket);function respondWithRpcPromise(_0x14a2b7,_0xfbd1af,_0x11227e){return new BPromise(function(_0x5387f9,_0x3d6170){return client['request'](_0x14a2b7,_0x11227e)[_0xba68('0x12')](function(_0x4edbe7){logger['info'](_0xba68('0x13'),_0xfbd1af,_0xba68('0x14'));logger[_0xba68('0x15')](_0xba68('0x16'),_0xfbd1af,'request\x20sent',JSON[_0xba68('0x17')](_0x4edbe7));if(_0x4edbe7[_0xba68('0x18')]){if(_0x4edbe7['error'][_0xba68('0x19')]===0x1f4){logger[_0xba68('0x18')](_0xba68('0x13'),_0xfbd1af,_0x4edbe7['error']['message']);return _0x3d6170(_0x4edbe7[_0xba68('0x18')][_0xba68('0x1a')]);}logger[_0xba68('0x18')](_0xba68('0x13'),_0xfbd1af,_0x4edbe7[_0xba68('0x18')][_0xba68('0x1a')]);return _0x5387f9(_0x4edbe7[_0xba68('0x18')][_0xba68('0x1a')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0xfbd1af,_0xba68('0x14'));_0x5387f9(_0x4edbe7[_0xba68('0x1b')][_0xba68('0x1a')]);}})[_0xba68('0x1c')](function(_0x475256){logger['error'](_0xba68('0x13'),_0xfbd1af,_0x475256);_0x3d6170(_0x475256);});});}exports[_0xba68('0x1d')]=function(_0x3368ab){var _0x1c5459=this;return new Promise(function(_0x74ce44,_0x1168da){return db[_0xba68('0x1e')]['findAll']({'raw':_0x3368ab[_0xba68('0x1f')]?_0x3368ab['options'][_0xba68('0x20')]===undefined?!![]:![]:!![],'where':_0x3368ab['options']?_0x3368ab[_0xba68('0x1f')][_0xba68('0x21')]||null:null,'attributes':_0x3368ab[_0xba68('0x1f')]?_0x3368ab[_0xba68('0x1f')]['attributes']||null:null,'limit':_0x3368ab[_0xba68('0x1f')]?_0x3368ab[_0xba68('0x1f')][_0xba68('0x22')]||null:null,'include':_0x3368ab['options']?_0x3368ab[_0xba68('0x1f')][_0xba68('0x23')]?_['map'](_0x3368ab[_0xba68('0x1f')][_0xba68('0x23')],function(_0x33f688){return{'model':db[_0x33f688['model']],'as':_0x33f688['as'],'attributes':_0x33f688['attributes'],'include':_0x33f688['include']?_[_0xba68('0x24')](_0x33f688[_0xba68('0x23')],function(_0xc957e4){return{'model':db[_0xc957e4[_0xba68('0x25')]],'as':_0xc957e4['as'],'attributes':_0xc957e4[_0xba68('0x26')],'include':_0xc957e4[_0xba68('0x23')]?_[_0xba68('0x24')](_0xc957e4[_0xba68('0x23')],function(_0x4916b2){return{'model':db[_0x4916b2[_0xba68('0x25')]],'as':_0x4916b2['as'],'attributes':_0x4916b2[_0xba68('0x26')]};}):[]};}):[]};}):[]:[]})[_0xba68('0x12')](function(_0x2c60be){logger[_0xba68('0x27')](_0xba68('0x1d'),_0x3368ab);logger[_0xba68('0x15')](_0xba68('0x1d'),_0x3368ab,JSON[_0xba68('0x17')](_0x2c60be));_0x74ce44(_0x2c60be);})[_0xba68('0x1c')](function(_0x5dd522){logger[_0xba68('0x18')]('GetMailQueue',_0x5dd522[_0xba68('0x1a')],_0x3368ab);_0x1168da(_0x1c5459[_0xba68('0x18')](0x1f4,_0x5dd522[_0xba68('0x1a')]));});});};exports[_0xba68('0x28')]=function(_0x3345be){var _0x380c29=this;return new Promise(function(_0x223fd4,_0x2be214){return db[_0xba68('0x1e')][_0xba68('0x29')]({'raw':_0x3345be['options']?_0x3345be[_0xba68('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3345be[_0xba68('0x1f')]?_0x3345be[_0xba68('0x1f')][_0xba68('0x21')]||null:null,'attributes':_0x3345be[_0xba68('0x1f')]?_0x3345be[_0xba68('0x1f')][_0xba68('0x26')]||null:null,'include':_0x3345be['options']?_0x3345be[_0xba68('0x1f')][_0xba68('0x23')]?_[_0xba68('0x24')](_0x3345be[_0xba68('0x1f')][_0xba68('0x23')],function(_0x508ba4){return{'model':db[_0x508ba4[_0xba68('0x25')]],'as':_0x508ba4['as'],'attributes':_0x508ba4[_0xba68('0x26')],'include':_0x508ba4[_0xba68('0x23')]?_['map'](_0x508ba4['include'],function(_0x134ca7){return{'model':db[_0x134ca7[_0xba68('0x25')]],'as':_0x134ca7['as'],'attributes':_0x134ca7[_0xba68('0x26')],'include':_0x134ca7[_0xba68('0x23')]?_[_0xba68('0x24')](_0x134ca7[_0xba68('0x23')],function(_0x123c3f){return{'model':db[_0x123c3f[_0xba68('0x25')]],'as':_0x123c3f['as'],'attributes':_0x123c3f[_0xba68('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d34f9){logger[_0xba68('0x27')](_0xba68('0x28'),_0x3345be);logger[_0xba68('0x15')]('ShowMailQueue',_0x3345be,JSON[_0xba68('0x17')](_0x3d34f9));_0x223fd4(_0x3d34f9);})[_0xba68('0x1c')](function(_0x521bb4){logger[_0xba68('0x18')](_0xba68('0x28'),_0x521bb4[_0xba68('0x1a')],_0x3345be);_0x2be214(_0x380c29[_0xba68('0x18')](0x1f4,_0x521bb4[_0xba68('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 14b7e09..c92b8d2 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 _0xbb1e=['emit','removeListener','register','length','mailQueue:','save','remove','update'];(function(_0x50daf7,_0x56bad4){var _0x349faf=function(_0x3d989f){while(--_0x3d989f){_0x50daf7['push'](_0x50daf7['shift']());}};_0x349faf(++_0x56bad4);}(_0xbb1e,0x1bd));var _0xebb1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbb1e[_0x6131cd];return _0x47e916;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xebb1('0x0'),_0xebb1('0x1'),_0xebb1('0x2')];function createListener(_0x552044,_0xc4218b){return function(_0x3ef10f){_0xc4218b[_0xebb1('0x3')](_0x552044,_0x3ef10f);};}function removeListener(_0x414a02,_0x2d2a7d){return function(){MailQueueEvents[_0xebb1('0x4')](_0x414a02,_0x2d2a7d);};}exports[_0xebb1('0x5')]=function(_0x3e2b3d){for(var _0x213591=0x0,_0x4ecba3=events[_0xebb1('0x6')];_0x213591<_0x4ecba3;_0x213591++){var _0x14e313=events[_0x213591];var _0x5649d4=createListener(_0xebb1('0x7')+_0x14e313,_0x3e2b3d);MailQueueEvents['on'](_0x14e313,_0x5649d4);}}; \ No newline at end of file +var _0x47f5=['removeListener','register','./mailQueue.events','save','remove','emit'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x47f5,0x1be));var _0x547f=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0x47f5[_0x10a212];return _0x23c82b;};'use strict';var MailQueueEvents=require(_0x547f('0x0'));var events=[_0x547f('0x1'),_0x547f('0x2'),'update'];function createListener(_0x29c373,_0x31bea3){return function(_0x4e8825){_0x31bea3[_0x547f('0x3')](_0x29c373,_0x4e8825);};}function removeListener(_0x2e9509,_0x46548f){return function(){MailQueueEvents[_0x547f('0x4')](_0x2e9509,_0x46548f);};}exports[_0x547f('0x5')]=function(_0x5d3b26){for(var _0x50dc74=0x0,_0x39e057=events['length'];_0x50dc74<_0x39e057;_0x50dc74++){var _0x226d37=events[_0x50dc74];var _0x1e6bd1=createListener('mailQueue:'+_0x226d37,_0x5d3b26);MailQueueEvents['on'](_0x226d37,_0x1e6bd1);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0b5b5e0..c873a02 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 _0x5bb6=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','create','put','delete','destroy','exports','multer'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5bb6,0x1a1));var _0x65bb=function(_0x543fb2,_0x257272){_0x543fb2=_0x543fb2-0x0;var _0x203d6d=_0x5bb6[_0x543fb2];return _0x203d6d;};'use strict';var multer=require(_0x65bb('0x0'));var util=require(_0x65bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65bb('0x2'));var router=express[_0x65bb('0x3')]();var fs_extra=require(_0x65bb('0x4'));var auth=require(_0x65bb('0x5'));var interaction=require(_0x65bb('0x6'));var config=require(_0x65bb('0x7'));var controller=require('./mailQueueReport.controller');router[_0x65bb('0x8')]('/',auth['isAuthenticated'](),controller[_0x65bb('0x9')]);router[_0x65bb('0x8')](_0x65bb('0xa'),auth['isAuthenticated'](),controller[_0x65bb('0xb')]);router['get'](_0x65bb('0xc'),auth[_0x65bb('0xd')](),controller['show']);router['post']('/',auth[_0x65bb('0xd')](),controller[_0x65bb('0xe')]);router[_0x65bb('0xf')](_0x65bb('0xc'),auth[_0x65bb('0xd')](),controller['update']);router[_0x65bb('0x10')](_0x65bb('0xc'),auth[_0x65bb('0xd')](),controller[_0x65bb('0x11')]);module[_0x65bb('0x12')]=router; \ No newline at end of file +var _0x9708=['isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0xa7c05d,_0x312374){var _0x47b002=function(_0x44aa2f){while(--_0x44aa2f){_0xa7c05d['push'](_0xa7c05d['shift']());}};_0x47b002(++_0x312374);}(_0x9708,0xbc));var _0x8970=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x9708[_0x241424];return _0x3da798;};'use strict';var multer=require(_0x8970('0x0'));var util=require(_0x8970('0x1'));var path=require(_0x8970('0x2'));var timeout=require(_0x8970('0x3'));var express=require(_0x8970('0x4'));var router=express[_0x8970('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8970('0x6'));var interaction=require(_0x8970('0x7'));var config=require(_0x8970('0x8'));var controller=require('./mailQueueReport.controller');router[_0x8970('0x9')]('/',auth['isAuthenticated'](),controller[_0x8970('0xa')]);router[_0x8970('0x9')](_0x8970('0xb'),auth[_0x8970('0xc')](),controller['describe']);router['get'](_0x8970('0xd'),auth[_0x8970('0xc')](),controller[_0x8970('0xe')]);router[_0x8970('0xf')]('/',auth[_0x8970('0xc')](),controller[_0x8970('0x10')]);router['put'](_0x8970('0xd'),auth[_0x8970('0xc')](),controller[_0x8970('0x11')]);router['delete'](_0x8970('0xd'),auth[_0x8970('0xc')](),controller[_0x8970('0x12')]);module[_0x8970('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 a73d745..f8dfecb 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 _0x4710=['moment','STRING','DATE'];(function(_0x42b455,_0x521437){var _0x4a59aa=function(_0x132cad){while(--_0x132cad){_0x42b455['push'](_0x42b455['shift']());}};_0x4a59aa(++_0x521437);}(_0x4710,0x1ad));var _0x0471=function(_0xe962bb,_0x3af189){_0xe962bb=_0xe962bb-0x0;var _0xe01cdf=_0x4710[_0xe962bb];return _0xe01cdf;};'use strict';var moment=require(_0x0471('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0471('0x1')]},'joinAt':{'type':Sequelize[_0x0471('0x2')]},'leaveAt':{'type':Sequelize[_0x0471('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0471('0x2')]},'reason':{'type':Sequelize[_0x0471('0x1')]}}; \ No newline at end of file +var _0x7e9f=['moment','exports','STRING','DATE'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x7e9f,0x108));var _0xf7e9=function(_0x187db7,_0x820de4){_0x187db7=_0x187db7-0x0;var _0xf36b4c=_0x7e9f[_0x187db7];return _0xf36b4c;};'use strict';var moment=require(_0xf7e9('0x0'));var Sequelize=require('sequelize');module[_0xf7e9('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf7e9('0x2')]},'joinAt':{'type':Sequelize[_0xf7e9('0x3')]},'leaveAt':{'type':Sequelize[_0xf7e9('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf7e9('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 08ffeb8..e7184fb 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 _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x279641,_0x1b9f86){var _0x22d620=function(_0x196714){while(--_0x196714){_0x279641['push'](_0x279641['shift']());}};_0x22d620(++_0x1b9f86);}(_0x5b12,0xa3));var _0x25b1=function(_0x54d435,_0x148c0e){_0x54d435=_0x54d435-0x0;var _0xeb8e3e=_0x5b12[_0x54d435];return _0xeb8e3e;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['MailQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file +var _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x0598,0x92));var _0x8059=function(_0x2b64c6,_0x272925){_0x2b64c6=_0x2b64c6-0x0;var _0xe80bf9=_0x0598[_0x2b64c6];return _0xe80bf9;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['MailQueueReport']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':!![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['MailQueueReport'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 3898094..9cfd063 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 _0x4f75=['./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53a7e1,_0x5da4f1){var _0x474d4a=function(_0x5a3e7c){while(--_0x5a3e7c){_0x53a7e1['push'](_0x53a7e1['shift']());}};_0x474d4a(++_0x5da4f1);}(_0x4f75,0xbb));var _0x54f7=function(_0x58c0a2,_0x1bad20){_0x58c0a2=_0x58c0a2-0x0;var _0x309735=_0x4f75[_0x58c0a2];return _0x309735;};'use strict';var _=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var logger=require('../../config/logger')(_0x54f7('0x2'));var moment=require(_0x54f7('0x3'));var BPromise=require('bluebird');var rp=require(_0x54f7('0x4'));var fs=require('fs');var path=require(_0x54f7('0x5'));var rimraf=require(_0x54f7('0x6'));var config=require(_0x54f7('0x7'));var attributes=require(_0x54f7('0x8'));module[_0x54f7('0x9')]=function(_0x524485,_0x1854b2){return _0x524485[_0x54f7('0xa')]('MailQueueReport',attributes,{'tableName':_0x54f7('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x54f7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae9c=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x4a9b8f,_0x35ed99){var _0x547fee=function(_0x2ded20){while(--_0x2ded20){_0x4a9b8f['push'](_0x4a9b8f['shift']());}};_0x547fee(++_0x35ed99);}(_0xae9c,0xf3));var _0xcae9=function(_0x3bd7fc,_0x20e851){_0x3bd7fc=_0x3bd7fc-0x0;var _0x13d40d=_0xae9c[_0x3bd7fc];return _0x13d40d;};'use strict';var _=require(_0xcae9('0x0'));var util=require(_0xcae9('0x1'));var logger=require(_0xcae9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcae9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcae9('0x4'));var rimraf=require(_0xcae9('0x5'));var config=require(_0xcae9('0x6'));var attributes=require(_0xcae9('0x7'));module[_0xcae9('0x8')]=function(_0x1f4d83,_0x2f2cf4){return _0x1f4d83['define'](_0xcae9('0x9'),attributes,{'tableName':_0xcae9('0xa'),'paranoid':![],'indexes':[{'name':_0xcae9('0xb'),'fields':[_0xcae9('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 bbef02a..590392e 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x1c7502,_0x5d2c70){var _0x2165fa=function(_0x5a64a2){while(--_0x5a64a2){_0x1c7502['push'](_0x1c7502['shift']());}};_0x2165fa(++_0x5d2c70);}(_0xdb28,0x106));var _0x8db2=function(_0x116713,_0x56d66b){_0x116713=_0x116713-0x0;var _0x4044f2=_0xdb28[_0x116713];return _0x4044f2;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x11bdff,_0x432165){var _0x4f1ca1=function(_0x56f23e){while(--_0x56f23e){_0x11bdff['push'](_0x11bdff['shift']());}};_0x4f1ca1(++_0x432165);}(_0x5f2f,0x73));var _0xf5f2=function(_0x63bc67,_0x247645){_0x63bc67=_0x63bc67-0x0;var _0x7255e3=_0x5f2f[_0x63bc67];return _0x7255e3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 18f3e45..b8ab991 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5f2384,_0x21f5b1){var _0x59d175=function(_0x48fc21){while(--_0x48fc21){_0x5f2384['push'](_0x5f2384['shift']());}};_0x59d175(++_0x21f5b1);}(_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(_0x4d4696,_0x1ab3a2){var _0x455048=function(_0x1548d4){while(--_0x1548d4){_0x4d4696['push'](_0x4d4696['shift']());}};_0x455048(++_0x1ab3a2);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ecc675a..22efb0c 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 _0x4213=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x9c3fdd,_0x4fe1c2){var _0x5bdc69=function(_0x1819cc){while(--_0x1819cc){_0x9c3fdd['push'](_0x9c3fdd['shift']());}};_0x5bdc69(++_0x4fe1c2);}(_0x4213,0x174));var _0x3421=function(_0x16d8f4,_0x64e14){_0x16d8f4=_0x16d8f4-0x0;var _0x3cc6fb=_0x4213[_0x16d8f4];return _0x3cc6fb;};'use strict';var Sequelize=require(_0x3421('0x0'));module['exports']={'description':{'type':Sequelize[_0x3421('0x1')]},'host':{'type':Sequelize[_0x3421('0x1')]},'authentication':{'type':Sequelize[_0x3421('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3421('0x1')]},'password':{'type':Sequelize[_0x3421('0x1')]},'port':{'type':Sequelize[_0x3421('0x3')]},'tls':{'type':Sequelize[_0x3421('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x3421('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3421('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x3421('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf280=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1ce461,_0x1bd2c2){var _0x11e6c6=function(_0x42f9c1){while(--_0x42f9c1){_0x1ce461['push'](_0x1ce461['shift']());}};_0x11e6c6(++_0x1bd2c2);}(_0xf280,0xf1));var _0x0f28=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xf280[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x0f28('0x0'));module[_0x0f28('0x1')]={'description':{'type':Sequelize[_0x0f28('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0f28('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0f28('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0f28('0x4')]},'tls':{'type':Sequelize[_0x0f28('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0f28('0x2')],'defaultValue':_0x0f28('0x5')},'connTimeout':{'type':Sequelize[_0x0f28('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0f28('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0f28('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1f6b708..b265cc7 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 _0xcd26=['define','mail_servers_in','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0xcd26,0x12b));var _0x6cd2=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xcd26[_0x3ee55a];return _0x581800;};'use strict';var _=require(_0x6cd2('0x0'));var util=require('util');var logger=require(_0x6cd2('0x1'))('api');var moment=require(_0x6cd2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cd2('0x3'));var rimraf=require(_0x6cd2('0x4'));var config=require(_0x6cd2('0x5'));var attributes=require(_0x6cd2('0x6'));module['exports']=function(_0xa6c794,_0x522c59){return _0xa6c794[_0x6cd2('0x7')]('MailServerIn',attributes,{'tableName':_0x6cd2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4282=['request-promise','path','rimraf','define','MailServerIn','mail_servers_in','util','../../config/logger','api','moment'];(function(_0x5074c5,_0x3a6865){var _0x1c9e34=function(_0x4bbadf){while(--_0x4bbadf){_0x5074c5['push'](_0x5074c5['shift']());}};_0x1c9e34(++_0x3a6865);}(_0x4282,0x178));var _0x2428=function(_0x5a164c,_0x44d73a){_0x5a164c=_0x5a164c-0x0;var _0x17a713=_0x4282[_0x5a164c];return _0x17a713;};'use strict';var _=require('lodash');var util=require(_0x2428('0x0'));var logger=require(_0x2428('0x1'))(_0x2428('0x2'));var moment=require(_0x2428('0x3'));var BPromise=require('bluebird');var rp=require(_0x2428('0x4'));var fs=require('fs');var path=require(_0x2428('0x5'));var rimraf=require(_0x2428('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x38da88,_0x32cfc4){return _0x38da88[_0x2428('0x7')](_0x2428('0x8'),attributes,{'tableName':_0x2428('0x9'),'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 71f1d85..b3661fe 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 _0xe844=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailServerIn','findAll','options','where','attributes','include','map','model','GetMailServerIn'];(function(_0x4d975b,_0x243465){var _0x4619c2=function(_0x23f1d9){while(--_0x23f1d9){_0x4d975b['push'](_0x4d975b['shift']());}};_0x4619c2(++_0x243465);}(_0xe844,0xba));var _0x4e84=function(_0x51f46b,_0x5718d0){_0x51f46b=_0x51f46b-0x0;var _0x28dadf=_0xe844[_0x51f46b];return _0x28dadf;};'use strict';var _=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var moment=require(_0x4e84('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e84('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e84('0x4'));var logger=require(_0x4e84('0x5'))(_0x4e84('0x6'));var config=require(_0x4e84('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4e84('0x8')][_0x4e84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a679,_0x41d6b0,_0x41c4d4){return new BPromise(function(_0x357196,_0xf4176b){return client[_0x4e84('0xa')](_0x19a679,_0x41c4d4)[_0x4e84('0xb')](function(_0x518e6e){logger[_0x4e84('0xc')](_0x4e84('0xd'),_0x41d6b0,_0x4e84('0xe'));logger[_0x4e84('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x41d6b0,_0x4e84('0xe'),JSON[_0x4e84('0x10')](_0x518e6e));if(_0x518e6e[_0x4e84('0x11')]){if(_0x518e6e[_0x4e84('0x11')][_0x4e84('0x12')]===0x1f4){logger[_0x4e84('0x11')]('MailServerIn,\x20%s,\x20%s',_0x41d6b0,_0x518e6e[_0x4e84('0x11')][_0x4e84('0x13')]);return _0xf4176b(_0x518e6e[_0x4e84('0x11')][_0x4e84('0x13')]);}logger[_0x4e84('0x11')](_0x4e84('0xd'),_0x41d6b0,_0x518e6e[_0x4e84('0x11')][_0x4e84('0x13')]);return _0x357196(_0x518e6e[_0x4e84('0x11')]['message']);}else{logger[_0x4e84('0xc')]('MailServerIn,\x20%s,\x20%s',_0x41d6b0,_0x4e84('0xe'));_0x357196(_0x518e6e[_0x4e84('0x14')][_0x4e84('0x13')]);}})[_0x4e84('0x15')](function(_0x35e214){logger['error'](_0x4e84('0xd'),_0x41d6b0,_0x35e214);_0xf4176b(_0x35e214);});});}exports['GetMailServerIn']=function(_0x5c3e81){var _0x23d7ac=this;return new Promise(function(_0x28fae0,_0x41a0ea){return db[_0x4e84('0x16')][_0x4e84('0x17')]({'raw':_0x5c3e81[_0x4e84('0x18')]?_0x5c3e81[_0x4e84('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c3e81[_0x4e84('0x18')]?_0x5c3e81[_0x4e84('0x18')][_0x4e84('0x19')]||null:null,'attributes':_0x5c3e81[_0x4e84('0x18')]?_0x5c3e81[_0x4e84('0x18')][_0x4e84('0x1a')]||null:null,'limit':_0x5c3e81[_0x4e84('0x18')]?_0x5c3e81[_0x4e84('0x18')]['limit']||null:null,'include':_0x5c3e81['options']?_0x5c3e81[_0x4e84('0x18')][_0x4e84('0x1b')]?_[_0x4e84('0x1c')](_0x5c3e81[_0x4e84('0x18')][_0x4e84('0x1b')],function(_0xbf8c6b){return{'model':db[_0xbf8c6b[_0x4e84('0x1d')]],'as':_0xbf8c6b['as'],'attributes':_0xbf8c6b['attributes'],'include':_0xbf8c6b[_0x4e84('0x1b')]?_[_0x4e84('0x1c')](_0xbf8c6b[_0x4e84('0x1b')],function(_0xf9aab8){return{'model':db[_0xf9aab8[_0x4e84('0x1d')]],'as':_0xf9aab8['as'],'attributes':_0xf9aab8[_0x4e84('0x1a')],'include':_0xf9aab8['include']?_[_0x4e84('0x1c')](_0xf9aab8[_0x4e84('0x1b')],function(_0x25c581){return{'model':db[_0x25c581['model']],'as':_0x25c581['as'],'attributes':_0x25c581[_0x4e84('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x221ed0){logger[_0x4e84('0xc')](_0x4e84('0x1e'),_0x5c3e81);logger[_0x4e84('0xf')](_0x4e84('0x1e'),_0x5c3e81,JSON[_0x4e84('0x10')](_0x221ed0));_0x28fae0(_0x221ed0);})[_0x4e84('0x15')](function(_0x25e574){logger[_0x4e84('0x11')](_0x4e84('0x1e'),_0x25e574['message'],_0x5c3e81);_0x41a0ea(_0x23d7ac['error'](0x1f4,_0x25e574[_0x4e84('0x13')]));});});}; \ No newline at end of file +var _0x5eec=['../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','result','MailServerIn','findAll','raw','options','where','attributes','limit','map','include','model','GetMailServerIn','stringify','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x46103c,_0x3c1d5d){var _0xe9de67=function(_0xec700){while(--_0xec700){_0x46103c['push'](_0x46103c['shift']());}};_0xe9de67(++_0x3c1d5d);}(_0x5eec,0x11b));var _0xc5ee=function(_0xbce1c1,_0x35db61){_0xbce1c1=_0xbce1c1-0x0;var _0xf1342b=_0x5eec[_0xbce1c1];return _0xf1342b;};'use strict';var _=require(_0xc5ee('0x0'));var util=require('util');var moment=require(_0xc5ee('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5ee('0x3'))['db'];var utils=require(_0xc5ee('0x4'));var logger=require(_0xc5ee('0x5'))('rpc');var config=require(_0xc5ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc5ee('0x7')][_0xc5ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a877f,_0x4fec5d,_0x447d12){return new BPromise(function(_0x43c03a,_0x5add42){return client[_0xc5ee('0x9')](_0x2a877f,_0x447d12)[_0xc5ee('0xa')](function(_0x2ecff5){logger[_0xc5ee('0xb')]('MailServerIn,\x20%s,\x20%s',_0x4fec5d,_0xc5ee('0xc'));logger[_0xc5ee('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4fec5d,_0xc5ee('0xc'),JSON['stringify'](_0x2ecff5));if(_0x2ecff5[_0xc5ee('0xe')]){if(_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0xf')]===0x1f4){logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);return _0x5add42(_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);}logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x2ecff5[_0xc5ee('0xe')][_0xc5ee('0x11')]);return _0x43c03a(_0x2ecff5['error'][_0xc5ee('0x11')]);}else{logger['info'](_0xc5ee('0x10'),_0x4fec5d,_0xc5ee('0xc'));_0x43c03a(_0x2ecff5[_0xc5ee('0x12')][_0xc5ee('0x11')]);}})['catch'](function(_0x429e27){logger[_0xc5ee('0xe')](_0xc5ee('0x10'),_0x4fec5d,_0x429e27);_0x5add42(_0x429e27);});});}exports['GetMailServerIn']=function(_0x466387){var _0x363c16=this;return new Promise(function(_0x35a4f8,_0x1b244d){return db[_0xc5ee('0x13')][_0xc5ee('0x14')]({'raw':_0x466387['options']?_0x466387['options'][_0xc5ee('0x15')]===undefined?!![]:![]:!![],'where':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x17')]||null:null,'attributes':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x18')]||null:null,'limit':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')][_0xc5ee('0x19')]||null:null,'include':_0x466387[_0xc5ee('0x16')]?_0x466387[_0xc5ee('0x16')]['include']?_[_0xc5ee('0x1a')](_0x466387[_0xc5ee('0x16')][_0xc5ee('0x1b')],function(_0xa328){return{'model':db[_0xa328['model']],'as':_0xa328['as'],'attributes':_0xa328[_0xc5ee('0x18')],'include':_0xa328['include']?_[_0xc5ee('0x1a')](_0xa328[_0xc5ee('0x1b')],function(_0x59ae89){return{'model':db[_0x59ae89[_0xc5ee('0x1c')]],'as':_0x59ae89['as'],'attributes':_0x59ae89[_0xc5ee('0x18')],'include':_0x59ae89[_0xc5ee('0x1b')]?_[_0xc5ee('0x1a')](_0x59ae89[_0xc5ee('0x1b')],function(_0x1a34a4){return{'model':db[_0x1a34a4[_0xc5ee('0x1c')]],'as':_0x1a34a4['as'],'attributes':_0x1a34a4[_0xc5ee('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52ccaf){logger[_0xc5ee('0xb')](_0xc5ee('0x1d'),_0x466387);logger[_0xc5ee('0xd')]('GetMailServerIn',_0x466387,JSON[_0xc5ee('0x1e')](_0x52ccaf));_0x35a4f8(_0x52ccaf);})[_0xc5ee('0x1f')](function(_0x48c33e){logger['error'](_0xc5ee('0x1d'),_0x48c33e[_0xc5ee('0x11')],_0x466387);_0x1b244d(_0x363c16[_0xc5ee('0xe')](0x1f4,_0x48c33e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index bb1abe7..8ce0ce5 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x12a169,_0xc86de1){_0x12a169=_0x12a169-0x0;var _0x5681df=_0x7a54[_0x12a169];return _0x5681df;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x4bc49e,_0x20dd46){_0x4bc49e=_0x4bc49e-0x0;var _0x147ac6=_0x7a54[_0x4bc49e];return _0x147ac6;};'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 1d35a8d..edcbc7b 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 _0xb78e=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb78e,0x1c9));var _0xeb78=function(_0xdb8993,_0x3bd720){_0xdb8993=_0xdb8993-0x0;var _0x21853f=_0xb78e[_0xdb8993];return _0x21853f;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xeb78('0x2')]},'user':{'type':Sequelize[_0xeb78('0x2')]},'pass':{'type':Sequelize[_0xeb78('0x2')]},'port':{'type':Sequelize[_0xeb78('0x3')]},'secure':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xeb78('0x2')]},'authentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x065e=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x24b3d9,_0x16e9b9){var _0x5d22ac=function(_0x5be853){while(--_0x5be853){_0x24b3d9['push'](_0x24b3d9['shift']());}};_0x5d22ac(++_0x16e9b9);}(_0x065e,0x1a7));var _0xe065=function(_0x319ff8,_0x45ca90){_0x319ff8=_0x319ff8-0x0;var _0x11d674=_0x065e[_0x319ff8];return _0x11d674;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe065('0x1')]},'pass':{'type':Sequelize[_0xe065('0x1')]},'port':{'type':Sequelize[_0xe065('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe065('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xe065('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 dc31546..c391a79 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 _0xe399=['sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','sendStatus','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','rows','catch','params','include','find','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','path'];(function(_0x5c0b9c,_0x3718ab){var _0x439fd1=function(_0x1cedda){while(--_0x1cedda){_0x5c0b9c['push'](_0x5c0b9c['shift']());}};_0x439fd1(++_0x3718ab);}(_0xe399,0x171));var _0x9e39=function(_0x1c6e0f,_0x3a695b){_0x1c6e0f=_0x1c6e0f-0x0;var _0x374767=_0xe399[_0x1c6e0f];return _0x374767;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e39('0x0'));var zipdir=require(_0x9e39('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9e39('0x2'));var BPromise=require(_0x9e39('0x3'));var Mustache=require(_0x9e39('0x4'));var util=require('util');var path=require(_0x9e39('0x5'));var sox=require(_0x9e39('0x6'));var csv=require(_0x9e39('0x7'));var ejs=require(_0x9e39('0x8'));var fs=require('fs');var fs_extra=require(_0x9e39('0x9'));var _=require('lodash');var squel=require(_0x9e39('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e39('0xb'));var deskjs=require(_0x9e39('0xc'));var toCsv=require(_0x9e39('0x7'));var querystring=require(_0x9e39('0xd'));var Papa=require(_0x9e39('0xe'));var Redis=require(_0x9e39('0xf'));var authService=require(_0x9e39('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e39('0x11'));var logger=require(_0x9e39('0x12'))(_0x9e39('0x13'));var utils=require(_0x9e39('0x14'));var config=require(_0x9e39('0x15'));var licenseUtil=require(_0x9e39('0x16'));var db=require(_0x9e39('0x17'))['db'];function respondWithStatusCode(_0x6f148b,_0xcce22){_0xcce22=_0xcce22||0xcc;return function(_0x4238ae){if(_0x4238ae){return _0x6f148b['sendStatus'](_0xcce22);}return _0x6f148b[_0x9e39('0x18')](_0xcce22)[_0x9e39('0x19')]();};}function respondWithResult(_0x454c37,_0x23b502){_0x23b502=_0x23b502||0xc8;return function(_0x13ccd7){if(_0x13ccd7){return _0x454c37[_0x9e39('0x18')](_0x23b502)[_0x9e39('0x1a')](_0x13ccd7);}};}function respondWithFilteredResult(_0x280273,_0x3f538f){return function(_0x3a22ea){if(_0x3a22ea){var _0xf70910=typeof _0x3f538f[_0x9e39('0x1b')]===_0x9e39('0x1c')&&typeof _0x3f538f[_0x9e39('0x1d')]===_0x9e39('0x1c');var _0x2a8126=_0x3a22ea[_0x9e39('0x1e')];var _0x3ff0cd=_0xf70910?0x0:_0x3f538f[_0x9e39('0x1b')];var _0x4fc295=_0xf70910?_0x3a22ea[_0x9e39('0x1e')]:_0x3f538f[_0x9e39('0x1b')]+_0x3f538f[_0x9e39('0x1d')];var _0x1be11c;if(_0x4fc295>=_0x2a8126){_0x4fc295=_0x2a8126;_0x1be11c=0xc8;}else{_0x1be11c=0xce;}_0x280273[_0x9e39('0x18')](_0x1be11c);return _0x280273[_0x9e39('0x1f')](_0x9e39('0x20'),_0x3ff0cd+'-'+_0x4fc295+'/'+_0x2a8126)[_0x9e39('0x1a')](_0x3a22ea);}return null;};}function patchUpdates(_0x27897c){return function(_0x46c6b0){try{jsonpatch['apply'](_0x46c6b0,_0x27897c,!![]);}catch(_0x4826f5){return BPromise[_0x9e39('0x21')](_0x4826f5);}return _0x46c6b0[_0x9e39('0x22')]();};}function saveUpdates(_0x3cf1a5,_0x42edd9){return function(_0x278ddf){if(_0x278ddf){return _0x278ddf[_0x9e39('0x23')](_0x3cf1a5)['then'](function(_0x1e8491){return _0x1e8491;});}return null;};}function removeEntity(_0x445f81,_0x53e30b){return function(_0x365987){if(_0x365987){return _0x365987['destroy']()['then'](function(){_0x445f81['status'](0xcc)[_0x9e39('0x19')]();});}};}function handleEntityNotFound(_0x318dab,_0x26cee1){return function(_0x4bfe7c){if(!_0x4bfe7c){_0x318dab[_0x9e39('0x24')](0x194);}return _0x4bfe7c;};}function handleError(_0x44dfff,_0x49eb62){_0x49eb62=_0x49eb62||0x1f4;return function(_0x44a73a){logger[_0x9e39('0x25')](_0x44a73a[_0x9e39('0x26')]);if(_0x44a73a[_0x9e39('0x27')]){delete _0x44a73a[_0x9e39('0x27')];}_0x44dfff[_0x9e39('0x18')](_0x49eb62)['send'](_0x44a73a);};}exports[_0x9e39('0x28')]=function(_0x5e3439,_0x358aa2){var _0x51fbdb={},_0x3a9ab6={},_0x38553d={'count':0x0,'rows':[]};var _0x5882fe=_[_0x9e39('0x29')](db[_0x9e39('0x2a')][_0x9e39('0x2b')],function(_0x28b57a){return{'name':_0x28b57a[_0x9e39('0x2c')],'type':_0x28b57a['type'][_0x9e39('0x2d')]};});_0x3a9ab6[_0x9e39('0x2e')]=_[_0x9e39('0x29')](_0x5882fe,_0x9e39('0x27'));_0x3a9ab6[_0x9e39('0x2f')]=_[_0x9e39('0x30')](_0x5e3439['query']);_0x3a9ab6[_0x9e39('0x31')]=_[_0x9e39('0x32')](_0x3a9ab6[_0x9e39('0x2e')],_0x3a9ab6[_0x9e39('0x2f')]);_0x51fbdb['attributes']=_[_0x9e39('0x32')](_0x3a9ab6[_0x9e39('0x2e')],qs[_0x9e39('0x33')](_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x33')]));_0x51fbdb[_0x9e39('0x34')]=_0x51fbdb[_0x9e39('0x34')][_0x9e39('0x35')]?_0x51fbdb[_0x9e39('0x34')]:_0x3a9ab6[_0x9e39('0x2e')];if(!_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x36')](_0x9e39('0x37'))){_0x51fbdb[_0x9e39('0x1d')]=qs[_0x9e39('0x1d')](_0x5e3439[_0x9e39('0x2f')]['limit']);_0x51fbdb['offset']=qs[_0x9e39('0x1b')](_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x1b')]);}_0x51fbdb[_0x9e39('0x38')]=qs[_0x9e39('0x39')](_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x39')]);_0x51fbdb['where']=qs[_0x9e39('0x31')](_[_0x9e39('0x3a')](_0x5e3439[_0x9e39('0x2f')],_0x3a9ab6[_0x9e39('0x31')]),_0x5882fe);if(_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x3b')]){_0x51fbdb[_0x9e39('0x3c')]=_[_0x9e39('0x3d')](_0x51fbdb[_0x9e39('0x3c')],{'$or':_[_0x9e39('0x29')](_0x5882fe,function(_0x1ad7d3){if(_0x1ad7d3[_0x9e39('0x3e')]!==_0x9e39('0x3f')){var _0x5212c6={};_0x5212c6[_0x1ad7d3[_0x9e39('0x27')]]={'$like':'%'+_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x3b')]+'%'};return _0x5212c6;}})});}_0x51fbdb=_[_0x9e39('0x3d')]({},_0x51fbdb,_0x5e3439[_0x9e39('0x40')]);var _0x58bc51={'where':_0x51fbdb[_0x9e39('0x3c')]};return db[_0x9e39('0x2a')][_0x9e39('0x1e')](_0x58bc51)[_0x9e39('0x41')](function(_0x4b6836){_0x38553d[_0x9e39('0x1e')]=_0x4b6836;if(_0x5e3439[_0x9e39('0x2f')][_0x9e39('0x42')]){_0x51fbdb['include']=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x51fbdb);})[_0x9e39('0x41')](function(_0x526e31){_0x38553d[_0x9e39('0x43')]=_0x526e31;return _0x38553d;})['then'](respondWithFilteredResult(_0x358aa2,_0x51fbdb))[_0x9e39('0x44')](handleError(_0x358aa2,null));};exports['show']=function(_0x1291e3,_0x2129b7){var _0x228520={'raw':!![],'where':{'id':_0x1291e3[_0x9e39('0x45')]['id']}},_0x4ee1d2={};_0x4ee1d2['model']=_['keys'](db[_0x9e39('0x2a')][_0x9e39('0x2b')]);_0x4ee1d2[_0x9e39('0x2f')]=_[_0x9e39('0x30')](_0x1291e3[_0x9e39('0x2f')]);_0x4ee1d2[_0x9e39('0x31')]=_[_0x9e39('0x32')](_0x4ee1d2[_0x9e39('0x2e')],_0x4ee1d2[_0x9e39('0x2f')]);_0x228520['attributes']=_[_0x9e39('0x32')](_0x4ee1d2[_0x9e39('0x2e')],qs[_0x9e39('0x33')](_0x1291e3[_0x9e39('0x2f')][_0x9e39('0x33')]));_0x228520[_0x9e39('0x34')]=_0x228520[_0x9e39('0x34')][_0x9e39('0x35')]?_0x228520['attributes']:_0x4ee1d2[_0x9e39('0x2e')];if(_0x1291e3[_0x9e39('0x2f')][_0x9e39('0x42')]){_0x228520[_0x9e39('0x46')]=[{'all':!![]}];}_0x228520=_['merge']({},_0x228520,_0x1291e3['options']);return db[_0x9e39('0x2a')][_0x9e39('0x47')](_0x228520)[_0x9e39('0x41')](handleEntityNotFound(_0x2129b7,null))[_0x9e39('0x41')](respondWithResult(_0x2129b7,null))['catch'](handleError(_0x2129b7,null));};exports[_0x9e39('0x48')]=function(_0x26b347,_0x73ba62){return db[_0x9e39('0x2a')][_0x9e39('0x48')](_0x26b347['body'],{})['then'](respondWithResult(_0x73ba62,0xc9))[_0x9e39('0x44')](handleError(_0x73ba62,null));};exports[_0x9e39('0x23')]=function(_0x223077,_0x56f342){if(_0x223077['body']['id']){delete _0x223077['body']['id'];}return db[_0x9e39('0x2a')]['find']({'where':{'id':_0x223077[_0x9e39('0x45')]['id']}})[_0x9e39('0x41')](handleEntityNotFound(_0x56f342,null))[_0x9e39('0x41')](saveUpdates(_0x223077[_0x9e39('0x49')],null))[_0x9e39('0x41')](respondWithResult(_0x56f342,null))[_0x9e39('0x44')](handleError(_0x56f342,null));};exports[_0x9e39('0x4a')]=function(_0x1bb459,_0x24e55a){return db[_0x9e39('0x2a')]['find']({'where':{'id':_0x1bb459[_0x9e39('0x45')]['id']}})[_0x9e39('0x41')](handleEntityNotFound(_0x24e55a,null))[_0x9e39('0x41')](removeEntity(_0x24e55a,null))[_0x9e39('0x44')](handleError(_0x24e55a,null));}; \ No newline at end of file +var _0xb249=['fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','includeAll','findAll','rows','catch','params','length','include','merge','options','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb249,0x65));var _0x9b24=function(_0xba2366,_0x94ceee){_0xba2366=_0xba2366-0x0;var _0x548788=_0xb249[_0xba2366];return _0x548788;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b24('0x0'));var jsonpatch=require(_0x9b24('0x1'));var rp=require(_0x9b24('0x2'));var moment=require(_0x9b24('0x3'));var BPromise=require(_0x9b24('0x4'));var Mustache=require(_0x9b24('0x5'));var util=require(_0x9b24('0x6'));var path=require(_0x9b24('0x7'));var sox=require(_0x9b24('0x8'));var csv=require(_0x9b24('0x9'));var ejs=require(_0x9b24('0xa'));var fs=require('fs');var fs_extra=require(_0x9b24('0xb'));var _=require('lodash');var squel=require(_0x9b24('0xc'));var crypto=require(_0x9b24('0xd'));var jsforce=require(_0x9b24('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9b24('0x9'));var querystring=require(_0x9b24('0xf'));var Papa=require('papaparse');var Redis=require(_0x9b24('0x10'));var authService=require(_0x9b24('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b24('0x12'));var logger=require('../../config/logger')(_0x9b24('0x13'));var utils=require(_0x9b24('0x14'));var config=require(_0x9b24('0x15'));var licenseUtil=require(_0x9b24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f9041,_0x184654){_0x184654=_0x184654||0xcc;return function(_0x147310){if(_0x147310){return _0x3f9041[_0x9b24('0x17')](_0x184654);}return _0x3f9041[_0x9b24('0x18')](_0x184654)[_0x9b24('0x19')]();};}function respondWithResult(_0x547922,_0x50d114){_0x50d114=_0x50d114||0xc8;return function(_0x39596a){if(_0x39596a){return _0x547922['status'](_0x50d114)[_0x9b24('0x1a')](_0x39596a);}};}function respondWithFilteredResult(_0x39579e,_0x5372af){return function(_0x33993d){if(_0x33993d){var _0x41364b=typeof _0x5372af[_0x9b24('0x1b')]===_0x9b24('0x1c')&&typeof _0x5372af[_0x9b24('0x1d')]==='undefined';var _0x1a6cbb=_0x33993d[_0x9b24('0x1e')];var _0x11a702=_0x41364b?0x0:_0x5372af[_0x9b24('0x1b')];var _0x4b64e1=_0x41364b?_0x33993d[_0x9b24('0x1e')]:_0x5372af[_0x9b24('0x1b')]+_0x5372af[_0x9b24('0x1d')];var _0x2b2e88;if(_0x4b64e1>=_0x1a6cbb){_0x4b64e1=_0x1a6cbb;_0x2b2e88=0xc8;}else{_0x2b2e88=0xce;}_0x39579e[_0x9b24('0x18')](_0x2b2e88);return _0x39579e[_0x9b24('0x1f')](_0x9b24('0x20'),_0x11a702+'-'+_0x4b64e1+'/'+_0x1a6cbb)[_0x9b24('0x1a')](_0x33993d);}return null;};}function patchUpdates(_0x188400){return function(_0xf59f7b){try{jsonpatch[_0x9b24('0x21')](_0xf59f7b,_0x188400,!![]);}catch(_0x3433f7){return BPromise[_0x9b24('0x22')](_0x3433f7);}return _0xf59f7b[_0x9b24('0x23')]();};}function saveUpdates(_0x3d4309,_0x5f08bd){return function(_0x94fb14){if(_0x94fb14){return _0x94fb14[_0x9b24('0x24')](_0x3d4309)[_0x9b24('0x25')](function(_0x3a896f){return _0x3a896f;});}return null;};}function removeEntity(_0x58b778,_0xcfccf1){return function(_0x3d38b4){if(_0x3d38b4){return _0x3d38b4[_0x9b24('0x26')]()[_0x9b24('0x25')](function(){_0x58b778[_0x9b24('0x18')](0xcc)[_0x9b24('0x19')]();});}};}function handleEntityNotFound(_0x3b28ab,_0x111ab4){return function(_0x1218b9){if(!_0x1218b9){_0x3b28ab[_0x9b24('0x17')](0x194);}return _0x1218b9;};}function handleError(_0x58c2af,_0x34133f){_0x34133f=_0x34133f||0x1f4;return function(_0x4d31cd){logger[_0x9b24('0x27')](_0x4d31cd[_0x9b24('0x28')]);if(_0x4d31cd[_0x9b24('0x29')]){delete _0x4d31cd[_0x9b24('0x29')];}_0x58c2af['status'](_0x34133f)[_0x9b24('0x2a')](_0x4d31cd);};}exports[_0x9b24('0x2b')]=function(_0x6b08a7,_0x563289){var _0x488832={},_0x4f84c4={},_0x26900e={'count':0x0,'rows':[]};var _0x20071e=_[_0x9b24('0x2c')](db[_0x9b24('0x2d')][_0x9b24('0x2e')],function(_0x1eded2){return{'name':_0x1eded2[_0x9b24('0x2f')],'type':_0x1eded2[_0x9b24('0x30')][_0x9b24('0x31')]};});_0x4f84c4['model']=_['map'](_0x20071e,'name');_0x4f84c4['query']=_['keys'](_0x6b08a7[_0x9b24('0x32')]);_0x4f84c4[_0x9b24('0x33')]=_[_0x9b24('0x34')](_0x4f84c4[_0x9b24('0x35')],_0x4f84c4[_0x9b24('0x32')]);_0x488832['attributes']=_[_0x9b24('0x34')](_0x4f84c4[_0x9b24('0x35')],qs[_0x9b24('0x36')](_0x6b08a7[_0x9b24('0x32')]['fields']));_0x488832['attributes']=_0x488832[_0x9b24('0x37')]['length']?_0x488832['attributes']:_0x4f84c4[_0x9b24('0x35')];if(!_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x38')](_0x9b24('0x39'))){_0x488832[_0x9b24('0x1d')]=qs[_0x9b24('0x1d')](_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x1d')]);_0x488832['offset']=qs[_0x9b24('0x1b')](_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x1b')]);}_0x488832['order']=qs[_0x9b24('0x3a')](_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x3a')]);_0x488832[_0x9b24('0x3b')]=qs[_0x9b24('0x33')](_[_0x9b24('0x3c')](_0x6b08a7[_0x9b24('0x32')],_0x4f84c4[_0x9b24('0x33')]),_0x20071e);if(_0x6b08a7[_0x9b24('0x32')]['filter']){_0x488832[_0x9b24('0x3b')]=_['merge'](_0x488832[_0x9b24('0x3b')],{'$or':_['map'](_0x20071e,function(_0x4aef4b){if(_0x4aef4b['type']!=='VIRTUAL'){var _0x4271a2={};_0x4271a2[_0x4aef4b[_0x9b24('0x29')]]={'$like':'%'+_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x3d')]+'%'};return _0x4271a2;}})});}_0x488832=_['merge']({},_0x488832,_0x6b08a7['options']);var _0x1c53bd={'where':_0x488832[_0x9b24('0x3b')]};return db[_0x9b24('0x2d')][_0x9b24('0x1e')](_0x1c53bd)[_0x9b24('0x25')](function(_0x138ec1){_0x26900e['count']=_0x138ec1;if(_0x6b08a7[_0x9b24('0x32')][_0x9b24('0x3e')]){_0x488832['include']=[{'all':!![]}];}return db[_0x9b24('0x2d')][_0x9b24('0x3f')](_0x488832);})[_0x9b24('0x25')](function(_0xf27d50){_0x26900e[_0x9b24('0x40')]=_0xf27d50;return _0x26900e;})[_0x9b24('0x25')](respondWithFilteredResult(_0x563289,_0x488832))[_0x9b24('0x41')](handleError(_0x563289,null));};exports['show']=function(_0x156323,_0x131681){var _0x32f8b5={'raw':!![],'where':{'id':_0x156323[_0x9b24('0x42')]['id']}},_0x4bb3f9={};_0x4bb3f9['model']=_['keys'](db[_0x9b24('0x2d')][_0x9b24('0x2e')]);_0x4bb3f9['query']=_['keys'](_0x156323[_0x9b24('0x32')]);_0x4bb3f9[_0x9b24('0x33')]=_['intersection'](_0x4bb3f9[_0x9b24('0x35')],_0x4bb3f9[_0x9b24('0x32')]);_0x32f8b5[_0x9b24('0x37')]=_[_0x9b24('0x34')](_0x4bb3f9[_0x9b24('0x35')],qs[_0x9b24('0x36')](_0x156323[_0x9b24('0x32')]['fields']));_0x32f8b5[_0x9b24('0x37')]=_0x32f8b5[_0x9b24('0x37')][_0x9b24('0x43')]?_0x32f8b5['attributes']:_0x4bb3f9[_0x9b24('0x35')];if(_0x156323['query'][_0x9b24('0x3e')]){_0x32f8b5[_0x9b24('0x44')]=[{'all':!![]}];}_0x32f8b5=_[_0x9b24('0x45')]({},_0x32f8b5,_0x156323[_0x9b24('0x46')]);return db[_0x9b24('0x2d')][_0x9b24('0x47')](_0x32f8b5)[_0x9b24('0x25')](handleEntityNotFound(_0x131681,null))[_0x9b24('0x25')](respondWithResult(_0x131681,null))[_0x9b24('0x41')](handleError(_0x131681,null));};exports[_0x9b24('0x48')]=function(_0x14c6c9,_0x46ccf6){return db[_0x9b24('0x2d')][_0x9b24('0x48')](_0x14c6c9['body'],{})[_0x9b24('0x25')](respondWithResult(_0x46ccf6,0xc9))['catch'](handleError(_0x46ccf6,null));};exports['update']=function(_0x12ab22,_0x1de00a){if(_0x12ab22[_0x9b24('0x49')]['id']){delete _0x12ab22[_0x9b24('0x49')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x12ab22[_0x9b24('0x42')]['id']}})[_0x9b24('0x25')](handleEntityNotFound(_0x1de00a,null))[_0x9b24('0x25')](saveUpdates(_0x12ab22['body'],null))[_0x9b24('0x25')](respondWithResult(_0x1de00a,null))['catch'](handleError(_0x1de00a,null));};exports[_0x9b24('0x26')]=function(_0xe1de5b,_0x304aec){return db[_0x9b24('0x2d')][_0x9b24('0x47')]({'where':{'id':_0xe1de5b[_0x9b24('0x42')]['id']}})[_0x9b24('0x25')](handleEntityNotFound(_0x304aec,null))[_0x9b24('0x25')](removeEntity(_0x304aec,null))[_0x9b24('0x41')](handleError(_0x304aec,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ef582dc..d46acc5 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 _0x3c08=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util'];(function(_0x18f713,_0x379588){var _0x4d524a=function(_0x405ef4){while(--_0x405ef4){_0x18f713['push'](_0x18f713['shift']());}};_0x4d524a(++_0x379588);}(_0x3c08,0xfb));var _0x83c0=function(_0x5979ec,_0xedfce3){_0x5979ec=_0x5979ec-0x0;var _0x5efe34=_0x3c08[_0x5979ec];return _0x5efe34;};'use strict';var _=require('lodash');var util=require(_0x83c0('0x0'));var logger=require(_0x83c0('0x1'))('api');var moment=require(_0x83c0('0x2'));var BPromise=require(_0x83c0('0x3'));var rp=require(_0x83c0('0x4'));var fs=require('fs');var path=require(_0x83c0('0x5'));var rimraf=require('rimraf');var config=require(_0x83c0('0x6'));var attributes=require(_0x83c0('0x7'));module[_0x83c0('0x8')]=function(_0xa5a8a6,_0x47c8b5){return _0xa5a8a6[_0x83c0('0x9')](_0x83c0('0xa'),attributes,{'tableName':_0x83c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f19=['exports','MailServerOut','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailServerOut.attributes'];(function(_0x19b4fb,_0x2d06ee){var _0x479dfc=function(_0x9162c8){while(--_0x9162c8){_0x19b4fb['push'](_0x19b4fb['shift']());}};_0x479dfc(++_0x2d06ee);}(_0x6f19,0x106));var _0x96f1=function(_0x567e95,_0x3493d3){_0x567e95=_0x567e95-0x0;var _0x2dc4eb=_0x6f19[_0x567e95];return _0x2dc4eb;};'use strict';var _=require('lodash');var util=require(_0x96f1('0x0'));var logger=require(_0x96f1('0x1'))(_0x96f1('0x2'));var moment=require(_0x96f1('0x3'));var BPromise=require(_0x96f1('0x4'));var rp=require(_0x96f1('0x5'));var fs=require('fs');var path=require(_0x96f1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x96f1('0x7'));module[_0x96f1('0x8')]=function(_0x4871b8,_0x105e1b){return _0x4871b8['define'](_0x96f1('0x9'),attributes,{'tableName':'mail_servers_out','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 2b4e48d..b49442c 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x14f5c3,_0x1e3047){var _0x2ea070=function(_0x1c8cd4){while(--_0x1c8cd4){_0x14f5c3['push'](_0x14f5c3['shift']());}};_0x2ea070(++_0x1e3047);}(_0xadb5,0xad));var _0x5adb=function(_0x56fa90,_0x119463){_0x56fa90=_0x56fa90-0x0;var _0x32bb9d=_0xadb5[_0x56fa90];return _0x32bb9d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +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(_0x47f1be,_0x315c6f){var _0x295d91=function(_0x49febc){while(--_0x49febc){_0x47f1be['push'](_0x47f1be['shift']());}};_0x295d91(++_0x315c6f);}(_0x1261,0x144));var _0x1126=function(_0x31c6ca,_0x5b37b3){_0x31c6ca=_0x31c6ca-0x0;var _0x1b5088=_0x1261[_0x31c6ca];return _0x1b5088;};'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 042d8e6..3561985 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 _0xb9c3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','show','post','put','/:id','delete','destroy','exports','multer'];(function(_0x4c0155,_0x5b20db){var _0x1276db=function(_0x3ff813){while(--_0x3ff813){_0x4c0155['push'](_0x4c0155['shift']());}};_0x1276db(++_0x5b20db);}(_0xb9c3,0x11c));var _0x3b9c=function(_0x245f4c,_0xe6f2d5){_0x245f4c=_0x245f4c-0x0;var _0x3e4ff5=_0xb9c3[_0x245f4c];return _0x3e4ff5;};'use strict';var multer=require(_0x3b9c('0x0'));var util=require('util');var path=require(_0x3b9c('0x1'));var timeout=require(_0x3b9c('0x2'));var express=require(_0x3b9c('0x3'));var router=express[_0x3b9c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b9c('0x5'));var interaction=require(_0x3b9c('0x6'));var config=require(_0x3b9c('0x7'));var controller=require(_0x3b9c('0x8'));router[_0x3b9c('0x9')]('/',auth[_0x3b9c('0xa')](),controller['index']);router[_0x3b9c('0x9')]('/describe',auth[_0x3b9c('0xa')](),controller[_0x3b9c('0xb')]);router[_0x3b9c('0x9')]('/:id',auth[_0x3b9c('0xa')](),controller[_0x3b9c('0xc')]);router[_0x3b9c('0xd')]('/',auth[_0x3b9c('0xa')](),controller['create']);router[_0x3b9c('0xe')](_0x3b9c('0xf'),auth[_0x3b9c('0xa')](),controller['update']);router[_0x3b9c('0x10')](_0x3b9c('0xf'),auth['isAuthenticated'](),controller[_0x3b9c('0x11')]);module[_0x3b9c('0x12')]=router; \ No newline at end of file +var _0x3389=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','/:id','create','put','destroy','exports','multer','path','connect-timeout'];(function(_0x19a9a5,_0x2bf8b2){var _0x5306fe=function(_0x20f9e1){while(--_0x20f9e1){_0x19a9a5['push'](_0x19a9a5['shift']());}};_0x5306fe(++_0x2bf8b2);}(_0x3389,0x151));var _0x9338=function(_0x4cd138,_0x3e0a29){_0x4cd138=_0x4cd138-0x0;var _0x2c44ee=_0x3389[_0x4cd138];return _0x2c44ee;};'use strict';var multer=require(_0x9338('0x0'));var util=require('util');var path=require(_0x9338('0x1'));var timeout=require(_0x9338('0x2'));var express=require('express');var router=express[_0x9338('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9338('0x4'));var interaction=require(_0x9338('0x5'));var config=require(_0x9338('0x6'));var controller=require(_0x9338('0x7'));router[_0x9338('0x8')]('/',auth['isAuthenticated'](),controller[_0x9338('0x9')]);router[_0x9338('0x8')](_0x9338('0xa'),auth[_0x9338('0xb')](),controller['describe']);router[_0x9338('0x8')](_0x9338('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9338('0xd')]);router[_0x9338('0xe')](_0x9338('0xc'),auth[_0x9338('0xb')](),controller['update']);router['delete'](_0x9338('0xc'),auth[_0x9338('0xb')](),controller[_0x9338('0xf')]);module[_0x9338('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 6e33019..a220569 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 _0x90b1=['exports','STRING','sequelize'];(function(_0x9a987e,_0x58af61){var _0x3ca0e2=function(_0x4b73e4){while(--_0x4b73e4){_0x9a987e['push'](_0x9a987e['shift']());}};_0x3ca0e2(++_0x58af61);}(_0x90b1,0x1bb));var _0x190b=function(_0xc82cac,_0x87996){_0xc82cac=_0xc82cac-0x0;var _0x244b24=_0x90b1[_0xc82cac];return _0x244b24;};'use strict';var Sequelize=require(_0x190b('0x0'));module[_0x190b('0x1')]={'name':{'type':Sequelize[_0x190b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4351=['name','sequelize','exports','STRING'];(function(_0x93b579,_0x429f63){var _0xc9ae85=function(_0x4b8233){while(--_0x4b8233){_0x93b579['push'](_0x93b579['shift']());}};_0xc9ae85(++_0x429f63);}(_0x4351,0x1b5));var _0x1435=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4351[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x1435('0x0'));module[_0x1435('0x1')]={'name':{'type':Sequelize[_0x1435('0x2')],'unique':_0x1435('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1435('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b2343fe..17e63b1 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 _0x65ca=['fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','show','rawAttributes','catch','create','body','find','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailSubstatus','type','key','model','query','keys','intersection','attributes'];(function(_0x502600,_0x1ca38c){var _0x510a06=function(_0x5dc383){while(--_0x5dc383){_0x502600['push'](_0x502600['shift']());}};_0x510a06(++_0x1ca38c);}(_0x65ca,0xfd));var _0xa65c=function(_0x15d21f,_0x10997d){_0x15d21f=_0x15d21f-0x0;var _0x50b48d=_0x65ca[_0x15d21f];return _0x50b48d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa65c('0x0'));var jsonpatch=require(_0xa65c('0x1'));var rp=require(_0xa65c('0x2'));var moment=require(_0xa65c('0x3'));var BPromise=require(_0xa65c('0x4'));var Mustache=require(_0xa65c('0x5'));var util=require(_0xa65c('0x6'));var path=require(_0xa65c('0x7'));var sox=require(_0xa65c('0x8'));var csv=require(_0xa65c('0x9'));var ejs=require(_0xa65c('0xa'));var fs=require('fs');var fs_extra=require(_0xa65c('0xb'));var _=require(_0xa65c('0xc'));var squel=require(_0xa65c('0xd'));var crypto=require(_0xa65c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa65c('0xf'));var toCsv=require(_0xa65c('0x9'));var querystring=require(_0xa65c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa65c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa65c('0x12'));var as=require(_0xa65c('0x13'));var hardwareService=require(_0xa65c('0x14'));var logger=require(_0xa65c('0x15'))(_0xa65c('0x16'));var utils=require(_0xa65c('0x17'));var config=require(_0xa65c('0x18'));var licenseUtil=require(_0xa65c('0x19'));var db=require(_0xa65c('0x1a'))['db'];function respondWithStatusCode(_0x1ad0fb,_0x4a1e73){_0x4a1e73=_0x4a1e73||0xcc;return function(_0x3cbc84){if(_0x3cbc84){return _0x1ad0fb[_0xa65c('0x1b')](_0x4a1e73);}return _0x1ad0fb['status'](_0x4a1e73)[_0xa65c('0x1c')]();};}function respondWithResult(_0x77b205,_0x54eda9){_0x54eda9=_0x54eda9||0xc8;return function(_0x2925c5){if(_0x2925c5){return _0x77b205[_0xa65c('0x1d')](_0x54eda9)[_0xa65c('0x1e')](_0x2925c5);}};}function respondWithFilteredResult(_0x2498d2,_0x580441){return function(_0xa342a2){if(_0xa342a2){var _0x3860a2=typeof _0x580441[_0xa65c('0x1f')]===_0xa65c('0x20')&&typeof _0x580441['limit']==='undefined';var _0x3a8372=_0xa342a2[_0xa65c('0x21')];var _0x14cbeb=_0x3860a2?0x0:_0x580441['offset'];var _0x245356=_0x3860a2?_0xa342a2['count']:_0x580441[_0xa65c('0x1f')]+_0x580441[_0xa65c('0x22')];var _0x137b90;if(_0x245356>=_0x3a8372){_0x245356=_0x3a8372;_0x137b90=0xc8;}else{_0x137b90=0xce;}_0x2498d2[_0xa65c('0x1d')](_0x137b90);return _0x2498d2[_0xa65c('0x23')]('Content-Range',_0x14cbeb+'-'+_0x245356+'/'+_0x3a8372)[_0xa65c('0x1e')](_0xa342a2);}return null;};}function patchUpdates(_0x4e1fdc){return function(_0xdfbe0a){try{jsonpatch[_0xa65c('0x24')](_0xdfbe0a,_0x4e1fdc,!![]);}catch(_0x43fdaa){return BPromise[_0xa65c('0x25')](_0x43fdaa);}return _0xdfbe0a[_0xa65c('0x26')]();};}function saveUpdates(_0x22e716,_0x3b2810){return function(_0x1bd04d){if(_0x1bd04d){return _0x1bd04d[_0xa65c('0x27')](_0x22e716)[_0xa65c('0x28')](function(_0x424a63){return _0x424a63;});}return null;};}function removeEntity(_0x1ea1b7,_0x55618d){return function(_0x36c8d7){if(_0x36c8d7){return _0x36c8d7[_0xa65c('0x29')]()[_0xa65c('0x28')](function(){_0x1ea1b7[_0xa65c('0x1d')](0xcc)[_0xa65c('0x1c')]();});}};}function handleEntityNotFound(_0x2a56c1,_0x543511){return function(_0x3058e4){if(!_0x3058e4){_0x2a56c1[_0xa65c('0x1b')](0x194);}return _0x3058e4;};}function handleError(_0x95e40e,_0x48c0c0){_0x48c0c0=_0x48c0c0||0x1f4;return function(_0x4141b1){logger[_0xa65c('0x2a')](_0x4141b1[_0xa65c('0x2b')]);if(_0x4141b1['name']){delete _0x4141b1[_0xa65c('0x2c')];}_0x95e40e[_0xa65c('0x1d')](_0x48c0c0)[_0xa65c('0x2d')](_0x4141b1);};}exports['index']=function(_0x281c83,_0x534c96){var _0x4d781d={},_0x1b92ba={},_0x21b13f={'count':0x0,'rows':[]};var _0x4b5e65=_[_0xa65c('0x2e')](db[_0xa65c('0x2f')]['rawAttributes'],function(_0x443245){return{'name':_0x443245['fieldName'],'type':_0x443245[_0xa65c('0x30')][_0xa65c('0x31')]};});_0x1b92ba[_0xa65c('0x32')]=_['map'](_0x4b5e65,'name');_0x1b92ba[_0xa65c('0x33')]=_[_0xa65c('0x34')](_0x281c83['query']);_0x1b92ba['filters']=_[_0xa65c('0x35')](_0x1b92ba[_0xa65c('0x32')],_0x1b92ba[_0xa65c('0x33')]);_0x4d781d[_0xa65c('0x36')]=_[_0xa65c('0x35')](_0x1b92ba[_0xa65c('0x32')],qs[_0xa65c('0x37')](_0x281c83[_0xa65c('0x33')][_0xa65c('0x37')]));_0x4d781d[_0xa65c('0x36')]=_0x4d781d['attributes'][_0xa65c('0x38')]?_0x4d781d[_0xa65c('0x36')]:_0x1b92ba[_0xa65c('0x32')];if(!_0x281c83['query'][_0xa65c('0x39')](_0xa65c('0x3a'))){_0x4d781d[_0xa65c('0x22')]=qs['limit'](_0x281c83[_0xa65c('0x33')]['limit']);_0x4d781d[_0xa65c('0x1f')]=qs[_0xa65c('0x1f')](_0x281c83[_0xa65c('0x33')][_0xa65c('0x1f')]);}_0x4d781d[_0xa65c('0x3b')]=qs[_0xa65c('0x3c')](_0x281c83['query'][_0xa65c('0x3c')]);_0x4d781d['where']=qs[_0xa65c('0x3d')](_['pick'](_0x281c83[_0xa65c('0x33')],_0x1b92ba[_0xa65c('0x3d')]),_0x4b5e65);if(_0x281c83['query'][_0xa65c('0x3e')]){_0x4d781d['where']=_[_0xa65c('0x3f')](_0x4d781d[_0xa65c('0x40')],{'$or':_[_0xa65c('0x2e')](_0x4b5e65,function(_0x5db966){if(_0x5db966['type']!==_0xa65c('0x41')){var _0x579bfa={};_0x579bfa[_0x5db966['name']]={'$like':'%'+_0x281c83[_0xa65c('0x33')]['filter']+'%'};return _0x579bfa;}})});}_0x4d781d=_[_0xa65c('0x3f')]({},_0x4d781d,_0x281c83[_0xa65c('0x42')]);var _0x251ce1={'where':_0x4d781d[_0xa65c('0x40')]};return db['MailSubstatus'][_0xa65c('0x21')](_0x251ce1)[_0xa65c('0x28')](function(_0x333ed5){_0x21b13f[_0xa65c('0x21')]=_0x333ed5;if(_0x281c83[_0xa65c('0x33')][_0xa65c('0x43')]){_0x4d781d[_0xa65c('0x44')]=[{'all':!![]}];}return db[_0xa65c('0x2f')]['findAll'](_0x4d781d);})['then'](function(_0x38b4c9){_0x21b13f['rows']=_0x38b4c9;return _0x21b13f;})[_0xa65c('0x28')](respondWithFilteredResult(_0x534c96,_0x4d781d))['catch'](handleError(_0x534c96,null));};exports[_0xa65c('0x45')]=function(_0x346d1e,_0x3d28b1){var _0xf2fa38={'raw':!![],'where':{'id':_0x346d1e['params']['id']}},_0x4e5582={};_0x4e5582[_0xa65c('0x32')]=_[_0xa65c('0x34')](db[_0xa65c('0x2f')][_0xa65c('0x46')]);_0x4e5582[_0xa65c('0x33')]=_['keys'](_0x346d1e[_0xa65c('0x33')]);_0x4e5582[_0xa65c('0x3d')]=_[_0xa65c('0x35')](_0x4e5582['model'],_0x4e5582[_0xa65c('0x33')]);_0xf2fa38[_0xa65c('0x36')]=_['intersection'](_0x4e5582[_0xa65c('0x32')],qs[_0xa65c('0x37')](_0x346d1e[_0xa65c('0x33')][_0xa65c('0x37')]));_0xf2fa38[_0xa65c('0x36')]=_0xf2fa38[_0xa65c('0x36')][_0xa65c('0x38')]?_0xf2fa38[_0xa65c('0x36')]:_0x4e5582[_0xa65c('0x32')];if(_0x346d1e['query'][_0xa65c('0x43')]){_0xf2fa38[_0xa65c('0x44')]=[{'all':!![]}];}_0xf2fa38=_['merge']({},_0xf2fa38,_0x346d1e['options']);return db['MailSubstatus']['find'](_0xf2fa38)[_0xa65c('0x28')](handleEntityNotFound(_0x3d28b1,null))[_0xa65c('0x28')](respondWithResult(_0x3d28b1,null))[_0xa65c('0x47')](handleError(_0x3d28b1,null));};exports[_0xa65c('0x48')]=function(_0x1895b8,_0x54d254){return db['MailSubstatus'][_0xa65c('0x48')](_0x1895b8[_0xa65c('0x49')],{})[_0xa65c('0x28')](respondWithResult(_0x54d254,0xc9))[_0xa65c('0x47')](handleError(_0x54d254,null));};exports[_0xa65c('0x27')]=function(_0x1cad96,_0xe3b793){if(_0x1cad96[_0xa65c('0x49')]['id']){delete _0x1cad96[_0xa65c('0x49')]['id'];}return db['MailSubstatus'][_0xa65c('0x4a')]({'where':{'id':_0x1cad96[_0xa65c('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe3b793,null))[_0xa65c('0x28')](saveUpdates(_0x1cad96[_0xa65c('0x49')],null))[_0xa65c('0x28')](respondWithResult(_0xe3b793,null))[_0xa65c('0x47')](handleError(_0xe3b793,null));};exports[_0xa65c('0x29')]=function(_0x51dbc8,_0x5d6a0f){return db[_0xa65c('0x2f')]['find']({'where':{'id':_0x51dbc8[_0xa65c('0x4b')]['id']}})[_0xa65c('0x28')](handleEntityNotFound(_0x5d6a0f,null))['then'](removeEntity(_0x5d6a0f,null))[_0xa65c('0x47')](handleError(_0x5d6a0f,null));};exports[_0xa65c('0x4c')]=function(_0x5d2ac3,_0x41ba25){return db[_0xa65c('0x2f')][_0xa65c('0x4c')]()[_0xa65c('0x28')](respondWithResult(_0x41ba25,null))[_0xa65c('0x47')](handleError(_0x41ba25,null));}; \ No newline at end of file +var _0xf7de=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','model','map','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where'];(function(_0x564d01,_0x41225c){var _0x54570a=function(_0x559e7f){while(--_0x559e7f){_0x564d01['push'](_0x564d01['shift']());}};_0x54570a(++_0x41225c);}(_0xf7de,0xaa));var _0xef7d=function(_0x13963d,_0x53f512){_0x13963d=_0x13963d-0x0;var _0xe44988=_0xf7de[_0x13963d];return _0xe44988;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef7d('0x0'));var zipdir=require(_0xef7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef7d('0x2'));var moment=require('moment');var BPromise=require(_0xef7d('0x3'));var Mustache=require(_0xef7d('0x4'));var util=require(_0xef7d('0x5'));var path=require(_0xef7d('0x6'));var sox=require(_0xef7d('0x7'));var csv=require(_0xef7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef7d('0x9'));var _=require('lodash');var squel=require(_0xef7d('0xa'));var crypto=require('crypto');var jsforce=require(_0xef7d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xef7d('0xc'));var Papa=require(_0xef7d('0xd'));var Redis=require(_0xef7d('0xe'));var authService=require(_0xef7d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xef7d('0x10'));var hardwareService=require(_0xef7d('0x11'));var logger=require(_0xef7d('0x12'))(_0xef7d('0x13'));var utils=require(_0xef7d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xef7d('0x15'));var db=require(_0xef7d('0x16'))['db'];function respondWithStatusCode(_0x95262c,_0x4418be){_0x4418be=_0x4418be||0xcc;return function(_0x1a55e){if(_0x1a55e){return _0x95262c['sendStatus'](_0x4418be);}return _0x95262c[_0xef7d('0x17')](_0x4418be)[_0xef7d('0x18')]();};}function respondWithResult(_0x471a6f,_0x499b02){_0x499b02=_0x499b02||0xc8;return function(_0x1358b3){if(_0x1358b3){return _0x471a6f[_0xef7d('0x17')](_0x499b02)[_0xef7d('0x19')](_0x1358b3);}};}function respondWithFilteredResult(_0x56553a,_0x437b5a){return function(_0x6d2e5d){if(_0x6d2e5d){var _0x2fb4aa=typeof _0x437b5a[_0xef7d('0x1a')]===_0xef7d('0x1b')&&typeof _0x437b5a[_0xef7d('0x1c')]===_0xef7d('0x1b');var _0x2c2500=_0x6d2e5d[_0xef7d('0x1d')];var _0xcee1e9=_0x2fb4aa?0x0:_0x437b5a[_0xef7d('0x1a')];var _0xb59f29=_0x2fb4aa?_0x6d2e5d['count']:_0x437b5a[_0xef7d('0x1a')]+_0x437b5a[_0xef7d('0x1c')];var _0x451123;if(_0xb59f29>=_0x2c2500){_0xb59f29=_0x2c2500;_0x451123=0xc8;}else{_0x451123=0xce;}_0x56553a['status'](_0x451123);return _0x56553a[_0xef7d('0x1e')](_0xef7d('0x1f'),_0xcee1e9+'-'+_0xb59f29+'/'+_0x2c2500)[_0xef7d('0x19')](_0x6d2e5d);}return null;};}function patchUpdates(_0x18cb9b){return function(_0x20a1a8){try{jsonpatch[_0xef7d('0x20')](_0x20a1a8,_0x18cb9b,!![]);}catch(_0x45b9ea){return BPromise[_0xef7d('0x21')](_0x45b9ea);}return _0x20a1a8[_0xef7d('0x22')]();};}function saveUpdates(_0x280511,_0x4638d5){return function(_0x3219c1){if(_0x3219c1){return _0x3219c1[_0xef7d('0x23')](_0x280511)[_0xef7d('0x24')](function(_0x327152){return _0x327152;});}return null;};}function removeEntity(_0x44edf9,_0x4bc934){return function(_0xfe19b2){if(_0xfe19b2){return _0xfe19b2[_0xef7d('0x25')]()['then'](function(){_0x44edf9[_0xef7d('0x17')](0xcc)[_0xef7d('0x18')]();});}};}function handleEntityNotFound(_0x51b552,_0x266b66){return function(_0x150173){if(!_0x150173){_0x51b552[_0xef7d('0x26')](0x194);}return _0x150173;};}function handleError(_0x9763e2,_0x425608){_0x425608=_0x425608||0x1f4;return function(_0x2bfb96){logger[_0xef7d('0x27')](_0x2bfb96[_0xef7d('0x28')]);if(_0x2bfb96[_0xef7d('0x29')]){delete _0x2bfb96['name'];}_0x9763e2['status'](_0x425608)[_0xef7d('0x2a')](_0x2bfb96);};}exports[_0xef7d('0x2b')]=function(_0x28c235,_0xa3af6e){var _0x258210={},_0x2c70e9={},_0x1ea201={'count':0x0,'rows':[]};var _0x2a991d=_['map'](db[_0xef7d('0x2c')][_0xef7d('0x2d')],function(_0x5c1565){return{'name':_0x5c1565[_0xef7d('0x2e')],'type':_0x5c1565[_0xef7d('0x2f')]['key']};});_0x2c70e9[_0xef7d('0x30')]=_[_0xef7d('0x31')](_0x2a991d,_0xef7d('0x29'));_0x2c70e9['query']=_['keys'](_0x28c235['query']);_0x2c70e9[_0xef7d('0x32')]=_[_0xef7d('0x33')](_0x2c70e9['model'],_0x2c70e9['query']);_0x258210[_0xef7d('0x34')]=_['intersection'](_0x2c70e9[_0xef7d('0x30')],qs[_0xef7d('0x35')](_0x28c235['query'][_0xef7d('0x35')]));_0x258210['attributes']=_0x258210[_0xef7d('0x34')][_0xef7d('0x36')]?_0x258210[_0xef7d('0x34')]:_0x2c70e9[_0xef7d('0x30')];if(!_0x28c235[_0xef7d('0x37')][_0xef7d('0x38')](_0xef7d('0x39'))){_0x258210[_0xef7d('0x1c')]=qs[_0xef7d('0x1c')](_0x28c235[_0xef7d('0x37')][_0xef7d('0x1c')]);_0x258210[_0xef7d('0x1a')]=qs['offset'](_0x28c235[_0xef7d('0x37')][_0xef7d('0x1a')]);}_0x258210[_0xef7d('0x3a')]=qs[_0xef7d('0x3b')](_0x28c235['query']['sort']);_0x258210[_0xef7d('0x3c')]=qs[_0xef7d('0x32')](_[_0xef7d('0x3d')](_0x28c235[_0xef7d('0x37')],_0x2c70e9['filters']),_0x2a991d);if(_0x28c235[_0xef7d('0x37')][_0xef7d('0x3e')]){_0x258210[_0xef7d('0x3c')]=_[_0xef7d('0x3f')](_0x258210['where'],{'$or':_[_0xef7d('0x31')](_0x2a991d,function(_0x2ceb07){if(_0x2ceb07[_0xef7d('0x2f')]!==_0xef7d('0x40')){var _0x5ca2a1={};_0x5ca2a1[_0x2ceb07[_0xef7d('0x29')]]={'$like':'%'+_0x28c235[_0xef7d('0x37')][_0xef7d('0x3e')]+'%'};return _0x5ca2a1;}})});}_0x258210=_[_0xef7d('0x3f')]({},_0x258210,_0x28c235[_0xef7d('0x41')]);var _0x188ba0={'where':_0x258210[_0xef7d('0x3c')]};return db[_0xef7d('0x2c')][_0xef7d('0x1d')](_0x188ba0)[_0xef7d('0x24')](function(_0x359a3a){_0x1ea201[_0xef7d('0x1d')]=_0x359a3a;if(_0x28c235[_0xef7d('0x37')][_0xef7d('0x42')]){_0x258210[_0xef7d('0x43')]=[{'all':!![]}];}return db[_0xef7d('0x2c')][_0xef7d('0x44')](_0x258210);})[_0xef7d('0x24')](function(_0x43db7f){_0x1ea201[_0xef7d('0x45')]=_0x43db7f;return _0x1ea201;})[_0xef7d('0x24')](respondWithFilteredResult(_0xa3af6e,_0x258210))[_0xef7d('0x46')](handleError(_0xa3af6e,null));};exports[_0xef7d('0x47')]=function(_0x4be9cd,_0x57443a){var _0x2eb97c={'raw':!![],'where':{'id':_0x4be9cd[_0xef7d('0x48')]['id']}},_0x16aab8={};_0x16aab8[_0xef7d('0x30')]=_[_0xef7d('0x49')](db[_0xef7d('0x2c')]['rawAttributes']);_0x16aab8['query']=_[_0xef7d('0x49')](_0x4be9cd[_0xef7d('0x37')]);_0x16aab8[_0xef7d('0x32')]=_['intersection'](_0x16aab8['model'],_0x16aab8[_0xef7d('0x37')]);_0x2eb97c[_0xef7d('0x34')]=_[_0xef7d('0x33')](_0x16aab8[_0xef7d('0x30')],qs[_0xef7d('0x35')](_0x4be9cd[_0xef7d('0x37')][_0xef7d('0x35')]));_0x2eb97c['attributes']=_0x2eb97c[_0xef7d('0x34')][_0xef7d('0x36')]?_0x2eb97c[_0xef7d('0x34')]:_0x16aab8[_0xef7d('0x30')];if(_0x4be9cd[_0xef7d('0x37')][_0xef7d('0x42')]){_0x2eb97c[_0xef7d('0x43')]=[{'all':!![]}];}_0x2eb97c=_[_0xef7d('0x3f')]({},_0x2eb97c,_0x4be9cd[_0xef7d('0x41')]);return db[_0xef7d('0x2c')][_0xef7d('0x4a')](_0x2eb97c)[_0xef7d('0x24')](handleEntityNotFound(_0x57443a,null))[_0xef7d('0x24')](respondWithResult(_0x57443a,null))[_0xef7d('0x46')](handleError(_0x57443a,null));};exports[_0xef7d('0x4b')]=function(_0x47f66d,_0x199aad){return db[_0xef7d('0x2c')][_0xef7d('0x4b')](_0x47f66d['body'],{})['then'](respondWithResult(_0x199aad,0xc9))[_0xef7d('0x46')](handleError(_0x199aad,null));};exports[_0xef7d('0x23')]=function(_0x3ed8da,_0x5080d6){if(_0x3ed8da[_0xef7d('0x4c')]['id']){delete _0x3ed8da[_0xef7d('0x4c')]['id'];}return db['MailSubstatus'][_0xef7d('0x4a')]({'where':{'id':_0x3ed8da['params']['id']}})[_0xef7d('0x24')](handleEntityNotFound(_0x5080d6,null))[_0xef7d('0x24')](saveUpdates(_0x3ed8da['body'],null))[_0xef7d('0x24')](respondWithResult(_0x5080d6,null))[_0xef7d('0x46')](handleError(_0x5080d6,null));};exports[_0xef7d('0x25')]=function(_0x5e6c76,_0x215c60){return db['MailSubstatus'][_0xef7d('0x4a')]({'where':{'id':_0x5e6c76[_0xef7d('0x48')]['id']}})[_0xef7d('0x24')](handleEntityNotFound(_0x215c60,null))[_0xef7d('0x24')](removeEntity(_0x215c60,null))[_0xef7d('0x46')](handleError(_0x215c60,null));};exports['describe']=function(_0x40ab49,_0x5d07cf){return db['MailSubstatus']['describe']()[_0xef7d('0x24')](respondWithResult(_0x5d07cf,null))[_0xef7d('0x46')](handleError(_0x5d07cf,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0829249..3aeba49 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 _0xc79f=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x18b3f7,_0x409821){var _0x3ad139=function(_0x566794){while(--_0x566794){_0x18b3f7['push'](_0x18b3f7['shift']());}};_0x3ad139(++_0x409821);}(_0xc79f,0x85));var _0xfc79=function(_0x5de924,_0x59a066){_0x5de924=_0x5de924-0x0;var _0x4d755e=_0xc79f[_0x5de924];return _0x4d755e;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xfc79('0x0'))['db'][_0xfc79('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xfc79('0x2')](0x0);var events={'afterUpdate':_0xfc79('0x3')};function emitEvent(_0xca17b8){return function(_0x46ed09,_0x556e19,_0x5e8105){MailSubstatusEvents['emit'](_0xca17b8+':'+_0x46ed09['id'],_0x46ed09);MailSubstatusEvents[_0xfc79('0x4')](_0xca17b8,_0x46ed09);_0x5e8105(null);};}for(var e in events){if(events[_0xfc79('0x5')](e)){var event=events[e];MailSubstatus[_0xfc79('0x6')](e,emitEvent(event));}}module[_0xfc79('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x2ae4=['hook','exports','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty'];(function(_0x413c54,_0x1c184b){var _0x5ca0ba=function(_0x1c2ca2){while(--_0x1c2ca2){_0x413c54['push'](_0x413c54['shift']());}};_0x5ca0ba(++_0x1c184b);}(_0x2ae4,0x80));var _0x42ae=function(_0xef35ad,_0x428309){_0xef35ad=_0xef35ad-0x0;var _0x54103b=_0x2ae4[_0xef35ad];return _0x54103b;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x42ae('0x0'))['db'][_0x42ae('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x42ae('0x2')};function emitEvent(_0x469550){return function(_0x4483db,_0x37c3d7,_0x36a043){MailSubstatusEvents[_0x42ae('0x3')](_0x469550+':'+_0x4483db['id'],_0x4483db);MailSubstatusEvents['emit'](_0x469550,_0x4483db);_0x36a043(null);};}for(var e in events){if(events[_0x42ae('0x4')](e)){var event=events[e];MailSubstatus[_0x42ae('0x5')](e,emitEvent(event));}}module[_0x42ae('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 8d6057e..5b7024f 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 _0x47c5=['Condition','update','_previousDataValues','name','then','catch','exports','models','define'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x47c5,0x72));var _0x547c=function(_0x4a015f,_0x2820e3){_0x4a015f=_0x4a015f-0x0;var _0x40ce6c=_0x47c5[_0x4a015f];return _0x40ce6c;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x547c('0x0')]=function(_0x5973a1){var _0x486360=_0x5973a1[_0x547c('0x1')];return _0x5973a1[_0x547c('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2e1f46,_0x4b7a0e,_0x4f99e3){return _0x486360[_0x547c('0x3')][_0x547c('0x4')]({'value':_0x2e1f46['name']},{'where':{'field':'mailSubstatus','value':_0x2e1f46[_0x547c('0x5')][_0x547c('0x6')]}})[_0x547c('0x7')](function(){_0x4f99e3();})[_0x547c('0x8')](function(_0x4f2f5e){_0x4f99e3(_0x4f2f5e);});}}});}; \ No newline at end of file +var _0xae5e=['mailSubstatus','_previousDataValues','catch','define','mail_substatuses','update','name'];(function(_0x475e05,_0x2a1d14){var _0x51c61b=function(_0x5bc586){while(--_0x5bc586){_0x475e05['push'](_0x475e05['shift']());}};_0x51c61b(++_0x2a1d14);}(_0xae5e,0x1d1));var _0xeae5=function(_0x4852ae,_0x1c9784){_0x4852ae=_0x4852ae-0x0;var _0x458497=_0xae5e[_0x4852ae];return _0x458497;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x51dd3f){var _0x44c4f7=_0x51dd3f['models'];return _0x51dd3f[_0xeae5('0x0')]('MailSubstatus',attributes,{'tableName':_0xeae5('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3cfa6a,_0x1f7737,_0x3a91e0){return _0x44c4f7['Condition'][_0xeae5('0x2')]({'value':_0x3cfa6a[_0xeae5('0x3')]},{'where':{'field':_0xeae5('0x4'),'value':_0x3cfa6a[_0xeae5('0x5')][_0xeae5('0x3')]}})['then'](function(){_0x3a91e0();})[_0xeae5('0x6')](function(_0x51cc67){_0x3a91e0(_0x51cc67);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 50449bf..fc4dd1a 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 _0x53cc=['catch','lodash','util','moment','ioredis','../../config/logger','../../config/environment','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x53cc,0x131));var _0xc53c=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0x53cc[_0x1e5068];return _0x2230b6;};'use strict';var _=require(_0xc53c('0x0'));var util=require(_0xc53c('0x1'));var moment=require(_0xc53c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc53c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc53c('0x4'))('rpc');var config=require(_0xc53c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc53c('0x6')][_0xc53c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19bfdf,_0x1bdae7,_0x5e6367){return new BPromise(function(_0x2d737a,_0x13ed1c){return client[_0xc53c('0x8')](_0x19bfdf,_0x5e6367)['then'](function(_0x2d604e){logger[_0xc53c('0x9')](_0xc53c('0xa'),_0x1bdae7,_0xc53c('0xb'));logger[_0xc53c('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1bdae7,_0xc53c('0xb'),JSON[_0xc53c('0xd')](_0x2d604e));if(_0x2d604e[_0xc53c('0xe')]){if(_0x2d604e[_0xc53c('0xe')][_0xc53c('0xf')]===0x1f4){logger[_0xc53c('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x1bdae7,_0x2d604e[_0xc53c('0xe')][_0xc53c('0x10')]);return _0x13ed1c(_0x2d604e[_0xc53c('0xe')]['message']);}logger['error'](_0xc53c('0xa'),_0x1bdae7,_0x2d604e['error']['message']);return _0x2d737a(_0x2d604e[_0xc53c('0xe')][_0xc53c('0x10')]);}else{logger[_0xc53c('0x9')](_0xc53c('0xa'),_0x1bdae7,'request\x20sent');_0x2d737a(_0x2d604e[_0xc53c('0x11')]['message']);}})[_0xc53c('0x12')](function(_0x128de8){logger[_0xc53c('0xe')](_0xc53c('0xa'),_0x1bdae7,_0x128de8);_0x13ed1c(_0x128de8);});});} \ No newline at end of file +var _0xb44e=['request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','MailSubstatus,\x20%s,\x20%s','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb44e,0xa0));var _0xeb44=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xb44e[_0x48b5e0];return _0x4287ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xeb44('0x0'));var rs=require(_0xeb44('0x1'));var fs=require('fs');var Redis=require(_0xeb44('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb44('0x3'));var logger=require(_0xeb44('0x4'))(_0xeb44('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb44('0x6')][_0xeb44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3de189,_0x5f4d4e,_0x55b85c){return new BPromise(function(_0x1e2352,_0x4987f3){return client[_0xeb44('0x8')](_0x3de189,_0x55b85c)[_0xeb44('0x9')](function(_0x11a3ed){logger[_0xeb44('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x5f4d4e,'request\x20sent');logger[_0xeb44('0xb')](_0xeb44('0xc'),_0x5f4d4e,_0xeb44('0xd'),JSON[_0xeb44('0xe')](_0x11a3ed));if(_0x11a3ed['error']){if(_0x11a3ed['error'][_0xeb44('0xf')]===0x1f4){logger[_0xeb44('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5f4d4e,_0x11a3ed[_0xeb44('0x10')][_0xeb44('0x11')]);return _0x4987f3(_0x11a3ed['error'][_0xeb44('0x11')]);}logger[_0xeb44('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5f4d4e,_0x11a3ed[_0xeb44('0x10')][_0xeb44('0x11')]);return _0x1e2352(_0x11a3ed['error'][_0xeb44('0x11')]);}else{logger[_0xeb44('0xa')](_0xeb44('0x12'),_0x5f4d4e,_0xeb44('0xd'));_0x1e2352(_0x11a3ed[_0xeb44('0x13')][_0xeb44('0x11')]);}})[_0xeb44('0x14')](function(_0x276f8c){logger['error'](_0xeb44('0x12'),_0x5f4d4e,_0x276f8c);_0x4987f3(_0x276f8c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 843247e..8a56168 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 _0xb40e=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','/describe','isAuthenticated','/:id','post','create','put','update','destroy'];(function(_0x601e24,_0x419554){var _0x4f2279=function(_0x4d0bcc){while(--_0x4d0bcc){_0x601e24['push'](_0x601e24['shift']());}};_0x4f2279(++_0x419554);}(_0xb40e,0xd9));var _0xeb40=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xb40e[_0x22b39b];return _0x280e1d;};'use strict';var multer=require(_0xeb40('0x0'));var util=require('util');var path=require(_0xeb40('0x1'));var timeout=require(_0xeb40('0x2'));var express=require(_0xeb40('0x3'));var router=express[_0xeb40('0x4')]();var fs_extra=require(_0xeb40('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeb40('0x6'));var controller=require(_0xeb40('0x7'));router[_0xeb40('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb40('0x8')](_0xeb40('0x9'),auth[_0xeb40('0xa')](),controller['describe']);router[_0xeb40('0x8')](_0xeb40('0xb'),auth[_0xeb40('0xa')](),controller['show']);router[_0xeb40('0xc')]('/',auth['isAuthenticated'](),controller[_0xeb40('0xd')]);router[_0xeb40('0xe')]('/:id',auth[_0xeb40('0xa')](),controller[_0xeb40('0xf')]);router['delete']('/:id',auth[_0xeb40('0xa')](),controller[_0xeb40('0x10')]);module[_0xeb40('0x11')]=router; \ No newline at end of file +var _0x2b46=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','delete','multer','connect-timeout','express'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x2b46,0x84));var _0x62b4=function(_0x7b19e3,_0x1dee54){_0x7b19e3=_0x7b19e3-0x0;var _0x4f5443=_0x2b46[_0x7b19e3];return _0x4f5443;};'use strict';var multer=require(_0x62b4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x62b4('0x1'));var express=require(_0x62b4('0x2'));var router=express['Router']();var fs_extra=require(_0x62b4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x62b4('0x4'));var config=require(_0x62b4('0x5'));var controller=require('./mailTransferReport.controller');router[_0x62b4('0x6')]('/',auth[_0x62b4('0x7')](),controller[_0x62b4('0x8')]);router[_0x62b4('0x6')](_0x62b4('0x9'),auth[_0x62b4('0x7')](),controller['describe']);router[_0x62b4('0x6')](_0x62b4('0xa'),auth[_0x62b4('0x7')](),controller[_0x62b4('0xb')]);router[_0x62b4('0xc')]('/',auth['isAuthenticated'](),controller[_0x62b4('0xd')]);router['put']('/:id',auth[_0x62b4('0x7')](),controller['update']);router[_0x62b4('0xe')](_0x62b4('0xa'),auth[_0x62b4('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 6de251d..9538e13 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x5d031b,_0xb437d3){var _0x1bed25=function(_0x1db3ba){while(--_0x1db3ba){_0x5d031b['push'](_0x5d031b['shift']());}};_0x1bed25(++_0xb437d3);}(_0x4b84,0x1cc));var _0x44b8=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x4b84[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x526f1c,_0x36d79b){var _0x1aeff5=function(_0x3ae677){while(--_0x3ae677){_0x526f1c['push'](_0x526f1c['shift']());}};_0x1aeff5(++_0x36d79b);}(_0xaa88,0x137));var _0x8aa8=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xaa88[_0x233cb1];return _0x29ee7e;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6c951ad..7dcd1da 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 _0xca3b=['error','stack','name','index','map','MailTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy'];(function(_0x10387e,_0x1b737f){var _0x2b3f7c=function(_0x2ec225){while(--_0x2ec225){_0x10387e['push'](_0x10387e['shift']());}};_0x2b3f7c(++_0x1b737f);}(_0xca3b,0xbf));var _0xbca3=function(_0x47b298,_0x2dafb6){_0x47b298=_0x47b298-0x0;var _0x56429c=_0xca3b[_0x47b298];return _0x56429c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbca3('0x0'));var zipdir=require(_0xbca3('0x1'));var jsonpatch=require(_0xbca3('0x2'));var rp=require(_0xbca3('0x3'));var moment=require(_0xbca3('0x4'));var BPromise=require(_0xbca3('0x5'));var Mustache=require('mustache');var util=require(_0xbca3('0x6'));var path=require(_0xbca3('0x7'));var sox=require(_0xbca3('0x8'));var csv=require('to-csv');var ejs=require(_0xbca3('0x9'));var fs=require('fs');var fs_extra=require(_0xbca3('0xa'));var _=require(_0xbca3('0xb'));var squel=require(_0xbca3('0xc'));var crypto=require(_0xbca3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbca3('0xe'));var toCsv=require(_0xbca3('0xf'));var querystring=require(_0xbca3('0x10'));var Papa=require(_0xbca3('0x11'));var Redis=require('ioredis');var authService=require(_0xbca3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbca3('0x13'));var hardwareService=require(_0xbca3('0x14'));var logger=require(_0xbca3('0x15'))(_0xbca3('0x16'));var utils=require(_0xbca3('0x17'));var config=require(_0xbca3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbca3('0x19'))['db'];function respondWithStatusCode(_0x249bfb,_0x1906f0){_0x1906f0=_0x1906f0||0xcc;return function(_0x54c0dc){if(_0x54c0dc){return _0x249bfb[_0xbca3('0x1a')](_0x1906f0);}return _0x249bfb[_0xbca3('0x1b')](_0x1906f0)[_0xbca3('0x1c')]();};}function respondWithResult(_0x50a761,_0x59081c){_0x59081c=_0x59081c||0xc8;return function(_0x22fb4c){if(_0x22fb4c){return _0x50a761['status'](_0x59081c)[_0xbca3('0x1d')](_0x22fb4c);}};}function respondWithFilteredResult(_0x40a541,_0x569080){return function(_0x55da89){if(_0x55da89){var _0xc5aacc=typeof _0x569080[_0xbca3('0x1e')]===_0xbca3('0x1f')&&typeof _0x569080[_0xbca3('0x20')]===_0xbca3('0x1f');var _0x429b5a=_0x55da89[_0xbca3('0x21')];var _0x1ffe3e=_0xc5aacc?0x0:_0x569080[_0xbca3('0x1e')];var _0x1f6094=_0xc5aacc?_0x55da89[_0xbca3('0x21')]:_0x569080[_0xbca3('0x1e')]+_0x569080['limit'];var _0x57dc4c;if(_0x1f6094>=_0x429b5a){_0x1f6094=_0x429b5a;_0x57dc4c=0xc8;}else{_0x57dc4c=0xce;}_0x40a541[_0xbca3('0x1b')](_0x57dc4c);return _0x40a541[_0xbca3('0x22')](_0xbca3('0x23'),_0x1ffe3e+'-'+_0x1f6094+'/'+_0x429b5a)[_0xbca3('0x1d')](_0x55da89);}return null;};}function patchUpdates(_0x587e21){return function(_0xa734dc){try{jsonpatch['apply'](_0xa734dc,_0x587e21,!![]);}catch(_0x1e2341){return BPromise[_0xbca3('0x24')](_0x1e2341);}return _0xa734dc[_0xbca3('0x25')]();};}function saveUpdates(_0x505813,_0x25fd8a){return function(_0x249b04){if(_0x249b04){return _0x249b04['update'](_0x505813)[_0xbca3('0x26')](function(_0x419b11){return _0x419b11;});}return null;};}function removeEntity(_0x497b77,_0x1014ae){return function(_0x48dc88){if(_0x48dc88){return _0x48dc88[_0xbca3('0x27')]()[_0xbca3('0x26')](function(){_0x497b77[_0xbca3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1addd2,_0xa42719){return function(_0x249463){if(!_0x249463){_0x1addd2['sendStatus'](0x194);}return _0x249463;};}function handleError(_0x1dcb0d,_0x350777){_0x350777=_0x350777||0x1f4;return function(_0x2cd879){logger[_0xbca3('0x28')](_0x2cd879[_0xbca3('0x29')]);if(_0x2cd879['name']){delete _0x2cd879[_0xbca3('0x2a')];}_0x1dcb0d[_0xbca3('0x1b')](_0x350777)['send'](_0x2cd879);};}exports[_0xbca3('0x2b')]=function(_0x499604,_0x23befb){var _0x1d7e8c={},_0x21318f={},_0x5b9988={'count':0x0,'rows':[]};var _0x3e3e46=_[_0xbca3('0x2c')](db[_0xbca3('0x2d')]['rawAttributes'],function(_0x1ae0ae){return{'name':_0x1ae0ae[_0xbca3('0x2e')],'type':_0x1ae0ae[_0xbca3('0x2f')][_0xbca3('0x30')]};});_0x21318f[_0xbca3('0x31')]=_[_0xbca3('0x2c')](_0x3e3e46,_0xbca3('0x2a'));_0x21318f[_0xbca3('0x32')]=_[_0xbca3('0x33')](_0x499604[_0xbca3('0x32')]);_0x21318f['filters']=_[_0xbca3('0x34')](_0x21318f[_0xbca3('0x31')],_0x21318f[_0xbca3('0x32')]);_0x1d7e8c[_0xbca3('0x35')]=_['intersection'](_0x21318f[_0xbca3('0x31')],qs[_0xbca3('0x36')](_0x499604[_0xbca3('0x32')][_0xbca3('0x36')]));_0x1d7e8c[_0xbca3('0x35')]=_0x1d7e8c['attributes'][_0xbca3('0x37')]?_0x1d7e8c[_0xbca3('0x35')]:_0x21318f['model'];if(!_0x499604[_0xbca3('0x32')][_0xbca3('0x38')](_0xbca3('0x39'))){_0x1d7e8c[_0xbca3('0x20')]=qs[_0xbca3('0x20')](_0x499604[_0xbca3('0x32')][_0xbca3('0x20')]);_0x1d7e8c['offset']=qs['offset'](_0x499604['query'][_0xbca3('0x1e')]);}_0x1d7e8c[_0xbca3('0x3a')]=qs[_0xbca3('0x3b')](_0x499604['query'][_0xbca3('0x3b')]);_0x1d7e8c[_0xbca3('0x3c')]=qs[_0xbca3('0x3d')](_['pick'](_0x499604[_0xbca3('0x32')],_0x21318f[_0xbca3('0x3d')]),_0x3e3e46);if(_0x499604['query'][_0xbca3('0x3e')]){_0x1d7e8c['where']=_[_0xbca3('0x3f')](_0x1d7e8c[_0xbca3('0x3c')],{'$or':_['map'](_0x3e3e46,function(_0x59c4d8){if(_0x59c4d8[_0xbca3('0x2f')]!==_0xbca3('0x40')){var _0x53f90a={};_0x53f90a[_0x59c4d8[_0xbca3('0x2a')]]={'$like':'%'+_0x499604[_0xbca3('0x32')]['filter']+'%'};return _0x53f90a;}})});}_0x1d7e8c=_['merge']({},_0x1d7e8c,_0x499604[_0xbca3('0x41')]);var _0x58cacf={'where':_0x1d7e8c[_0xbca3('0x3c')]};return db[_0xbca3('0x2d')][_0xbca3('0x21')](_0x58cacf)[_0xbca3('0x26')](function(_0x53631c){_0x5b9988['count']=_0x53631c;if(_0x499604[_0xbca3('0x32')][_0xbca3('0x42')]){_0x1d7e8c[_0xbca3('0x43')]=[{'all':!![]}];}return db[_0xbca3('0x2d')][_0xbca3('0x44')](_0x1d7e8c);})['then'](function(_0x5db234){_0x5b9988[_0xbca3('0x45')]=_0x5db234;return _0x5b9988;})[_0xbca3('0x26')](respondWithFilteredResult(_0x23befb,_0x1d7e8c))[_0xbca3('0x46')](handleError(_0x23befb,null));};exports['show']=function(_0x430287,_0x843ea0){var _0x363713={'raw':!![],'where':{'id':_0x430287[_0xbca3('0x47')]['id']}},_0x1811ba={};_0x1811ba['model']=_[_0xbca3('0x33')](db[_0xbca3('0x2d')]['rawAttributes']);_0x1811ba[_0xbca3('0x32')]=_[_0xbca3('0x33')](_0x430287[_0xbca3('0x32')]);_0x1811ba['filters']=_[_0xbca3('0x34')](_0x1811ba[_0xbca3('0x31')],_0x1811ba[_0xbca3('0x32')]);_0x363713['attributes']=_['intersection'](_0x1811ba[_0xbca3('0x31')],qs[_0xbca3('0x36')](_0x430287[_0xbca3('0x32')][_0xbca3('0x36')]));_0x363713[_0xbca3('0x35')]=_0x363713['attributes'][_0xbca3('0x37')]?_0x363713[_0xbca3('0x35')]:_0x1811ba['model'];if(_0x430287[_0xbca3('0x32')][_0xbca3('0x42')]){_0x363713[_0xbca3('0x43')]=[{'all':!![]}];}_0x363713=_[_0xbca3('0x3f')]({},_0x363713,_0x430287['options']);return db[_0xbca3('0x2d')][_0xbca3('0x48')](_0x363713)[_0xbca3('0x26')](handleEntityNotFound(_0x843ea0,null))[_0xbca3('0x26')](respondWithResult(_0x843ea0,null))[_0xbca3('0x46')](handleError(_0x843ea0,null));};exports[_0xbca3('0x49')]=function(_0x5a3e59,_0x2ec598){return db[_0xbca3('0x2d')][_0xbca3('0x49')](_0x5a3e59[_0xbca3('0x4a')],{})[_0xbca3('0x26')](respondWithResult(_0x2ec598,0xc9))[_0xbca3('0x46')](handleError(_0x2ec598,null));};exports[_0xbca3('0x4b')]=function(_0x3c790b,_0x550a61){if(_0x3c790b[_0xbca3('0x4a')]['id']){delete _0x3c790b[_0xbca3('0x4a')]['id'];}return db[_0xbca3('0x2d')][_0xbca3('0x48')]({'where':{'id':_0x3c790b[_0xbca3('0x47')]['id']}})[_0xbca3('0x26')](handleEntityNotFound(_0x550a61,null))[_0xbca3('0x26')](saveUpdates(_0x3c790b[_0xbca3('0x4a')],null))[_0xbca3('0x26')](respondWithResult(_0x550a61,null))[_0xbca3('0x46')](handleError(_0x550a61,null));};exports[_0xbca3('0x27')]=function(_0x5623cb,_0x11f0f6){return db[_0xbca3('0x2d')][_0xbca3('0x48')]({'where':{'id':_0x5623cb[_0xbca3('0x47')]['id']}})[_0xbca3('0x26')](handleEntityNotFound(_0x11f0f6,null))['then'](removeEntity(_0x11f0f6,null))['catch'](handleError(_0x11f0f6,null));};exports[_0xbca3('0x4c')]=function(_0x864e29,_0x2c80fe){return db[_0xbca3('0x2d')][_0xbca3('0x4c')]()[_0xbca3('0x26')](respondWithResult(_0x2c80fe,null))[_0xbca3('0x46')](handleError(_0x2c80fe,null));}; \ No newline at end of file +var _0x38ea=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','findAll','rows','params','includeAll','include','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x582b85,_0x4501aa){var _0x5cd1ab=function(_0x30d23d){while(--_0x30d23d){_0x582b85['push'](_0x582b85['shift']());}};_0x5cd1ab(++_0x4501aa);}(_0x38ea,0x161));var _0xa38e=function(_0x1a8c12,_0x2b79e3){_0x1a8c12=_0x1a8c12-0x0;var _0x6d2a6e=_0x38ea[_0x1a8c12];return _0x6d2a6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa38e('0x0'));var zipdir=require(_0xa38e('0x1'));var jsonpatch=require(_0xa38e('0x2'));var rp=require(_0xa38e('0x3'));var moment=require('moment');var BPromise=require(_0xa38e('0x4'));var Mustache=require(_0xa38e('0x5'));var util=require(_0xa38e('0x6'));var path=require('path');var sox=require(_0xa38e('0x7'));var csv=require(_0xa38e('0x8'));var ejs=require(_0xa38e('0x9'));var fs=require('fs');var fs_extra=require(_0xa38e('0xa'));var _=require(_0xa38e('0xb'));var squel=require('squel');var crypto=require(_0xa38e('0xc'));var jsforce=require(_0xa38e('0xd'));var deskjs=require(_0xa38e('0xe'));var toCsv=require(_0xa38e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa38e('0xf'));var authService=require(_0xa38e('0x10'));var qs=require(_0xa38e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa38e('0x12'));var logger=require('../../config/logger')(_0xa38e('0x13'));var utils=require(_0xa38e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa38e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fa4bc,_0x532253){_0x532253=_0x532253||0xcc;return function(_0x2d0353){if(_0x2d0353){return _0x2fa4bc[_0xa38e('0x16')](_0x532253);}return _0x2fa4bc[_0xa38e('0x17')](_0x532253)[_0xa38e('0x18')]();};}function respondWithResult(_0x1067fd,_0x5d7f78){_0x5d7f78=_0x5d7f78||0xc8;return function(_0x5b2157){if(_0x5b2157){return _0x1067fd[_0xa38e('0x17')](_0x5d7f78)[_0xa38e('0x19')](_0x5b2157);}};}function respondWithFilteredResult(_0x3b1f9d,_0x1d4de9){return function(_0x1b2a15){if(_0x1b2a15){var _0x443d10=typeof _0x1d4de9[_0xa38e('0x1a')]===_0xa38e('0x1b')&&typeof _0x1d4de9['limit']==='undefined';var _0x184b8f=_0x1b2a15[_0xa38e('0x1c')];var _0x21a654=_0x443d10?0x0:_0x1d4de9[_0xa38e('0x1a')];var _0x17be9f=_0x443d10?_0x1b2a15[_0xa38e('0x1c')]:_0x1d4de9['offset']+_0x1d4de9[_0xa38e('0x1d')];var _0x330d43;if(_0x17be9f>=_0x184b8f){_0x17be9f=_0x184b8f;_0x330d43=0xc8;}else{_0x330d43=0xce;}_0x3b1f9d[_0xa38e('0x17')](_0x330d43);return _0x3b1f9d['set'](_0xa38e('0x1e'),_0x21a654+'-'+_0x17be9f+'/'+_0x184b8f)[_0xa38e('0x19')](_0x1b2a15);}return null;};}function patchUpdates(_0x3aa587){return function(_0x30b556){try{jsonpatch[_0xa38e('0x1f')](_0x30b556,_0x3aa587,!![]);}catch(_0x3fa4b5){return BPromise[_0xa38e('0x20')](_0x3fa4b5);}return _0x30b556[_0xa38e('0x21')]();};}function saveUpdates(_0x473696,_0x1d2e38){return function(_0x3f3a0e){if(_0x3f3a0e){return _0x3f3a0e[_0xa38e('0x22')](_0x473696)['then'](function(_0x1c765f){return _0x1c765f;});}return null;};}function removeEntity(_0x22be99,_0x2bfd4b){return function(_0x1d411a){if(_0x1d411a){return _0x1d411a[_0xa38e('0x23')]()[_0xa38e('0x24')](function(){_0x22be99['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5da796,_0xd4f80d){return function(_0x31ca39){if(!_0x31ca39){_0x5da796[_0xa38e('0x16')](0x194);}return _0x31ca39;};}function handleError(_0x1329b6,_0x225533){_0x225533=_0x225533||0x1f4;return function(_0x57191f){logger[_0xa38e('0x25')](_0x57191f['stack']);if(_0x57191f[_0xa38e('0x26')]){delete _0x57191f[_0xa38e('0x26')];}_0x1329b6[_0xa38e('0x17')](_0x225533)[_0xa38e('0x27')](_0x57191f);};}exports['index']=function(_0x23b01e,_0x199d81){var _0xc9f918={},_0x2106a1={},_0xb344c9={'count':0x0,'rows':[]};var _0x139b4d=_[_0xa38e('0x28')](db[_0xa38e('0x29')][_0xa38e('0x2a')],function(_0x3e6f3d){return{'name':_0x3e6f3d[_0xa38e('0x2b')],'type':_0x3e6f3d[_0xa38e('0x2c')][_0xa38e('0x2d')]};});_0x2106a1[_0xa38e('0x2e')]=_[_0xa38e('0x28')](_0x139b4d,_0xa38e('0x26'));_0x2106a1[_0xa38e('0x2f')]=_[_0xa38e('0x30')](_0x23b01e[_0xa38e('0x2f')]);_0x2106a1[_0xa38e('0x31')]=_[_0xa38e('0x32')](_0x2106a1['model'],_0x2106a1[_0xa38e('0x2f')]);_0xc9f918[_0xa38e('0x33')]=_[_0xa38e('0x32')](_0x2106a1[_0xa38e('0x2e')],qs[_0xa38e('0x34')](_0x23b01e[_0xa38e('0x2f')][_0xa38e('0x34')]));_0xc9f918[_0xa38e('0x33')]=_0xc9f918[_0xa38e('0x33')][_0xa38e('0x35')]?_0xc9f918[_0xa38e('0x33')]:_0x2106a1['model'];if(!_0x23b01e['query'][_0xa38e('0x36')](_0xa38e('0x37'))){_0xc9f918['limit']=qs[_0xa38e('0x1d')](_0x23b01e[_0xa38e('0x2f')][_0xa38e('0x1d')]);_0xc9f918['offset']=qs[_0xa38e('0x1a')](_0x23b01e[_0xa38e('0x2f')][_0xa38e('0x1a')]);}_0xc9f918[_0xa38e('0x38')]=qs[_0xa38e('0x39')](_0x23b01e[_0xa38e('0x2f')][_0xa38e('0x39')]);_0xc9f918[_0xa38e('0x3a')]=qs['filters'](_[_0xa38e('0x3b')](_0x23b01e['query'],_0x2106a1[_0xa38e('0x31')]),_0x139b4d);if(_0x23b01e['query'][_0xa38e('0x3c')]){_0xc9f918[_0xa38e('0x3a')]=_[_0xa38e('0x3d')](_0xc9f918[_0xa38e('0x3a')],{'$or':_[_0xa38e('0x28')](_0x139b4d,function(_0x111490){if(_0x111490[_0xa38e('0x2c')]!=='VIRTUAL'){var _0x3296dc={};_0x3296dc[_0x111490[_0xa38e('0x26')]]={'$like':'%'+_0x23b01e[_0xa38e('0x2f')][_0xa38e('0x3c')]+'%'};return _0x3296dc;}})});}_0xc9f918=_[_0xa38e('0x3d')]({},_0xc9f918,_0x23b01e['options']);var _0x29e2a9={'where':_0xc9f918[_0xa38e('0x3a')]};return db[_0xa38e('0x29')][_0xa38e('0x1c')](_0x29e2a9)[_0xa38e('0x24')](function(_0x3aac42){_0xb344c9[_0xa38e('0x1c')]=_0x3aac42;if(_0x23b01e[_0xa38e('0x2f')]['includeAll']){_0xc9f918['include']=[{'all':!![]}];}return db[_0xa38e('0x29')][_0xa38e('0x3e')](_0xc9f918);})[_0xa38e('0x24')](function(_0x243a4f){_0xb344c9[_0xa38e('0x3f')]=_0x243a4f;return _0xb344c9;})[_0xa38e('0x24')](respondWithFilteredResult(_0x199d81,_0xc9f918))['catch'](handleError(_0x199d81,null));};exports['show']=function(_0xafc5a,_0x5122f1){var _0x5850a9={'raw':!![],'where':{'id':_0xafc5a[_0xa38e('0x40')]['id']}},_0xb4350c={};_0xb4350c[_0xa38e('0x2e')]=_[_0xa38e('0x30')](db['MailTransferReport']['rawAttributes']);_0xb4350c[_0xa38e('0x2f')]=_[_0xa38e('0x30')](_0xafc5a[_0xa38e('0x2f')]);_0xb4350c['filters']=_[_0xa38e('0x32')](_0xb4350c['model'],_0xb4350c[_0xa38e('0x2f')]);_0x5850a9[_0xa38e('0x33')]=_[_0xa38e('0x32')](_0xb4350c[_0xa38e('0x2e')],qs['fields'](_0xafc5a['query']['fields']));_0x5850a9[_0xa38e('0x33')]=_0x5850a9['attributes'][_0xa38e('0x35')]?_0x5850a9[_0xa38e('0x33')]:_0xb4350c['model'];if(_0xafc5a['query'][_0xa38e('0x41')]){_0x5850a9[_0xa38e('0x42')]=[{'all':!![]}];}_0x5850a9=_[_0xa38e('0x3d')]({},_0x5850a9,_0xafc5a[_0xa38e('0x43')]);return db[_0xa38e('0x29')][_0xa38e('0x44')](_0x5850a9)['then'](handleEntityNotFound(_0x5122f1,null))[_0xa38e('0x24')](respondWithResult(_0x5122f1,null))[_0xa38e('0x45')](handleError(_0x5122f1,null));};exports[_0xa38e('0x46')]=function(_0x3136ae,_0x16a336){return db[_0xa38e('0x29')][_0xa38e('0x46')](_0x3136ae[_0xa38e('0x47')],{})[_0xa38e('0x24')](respondWithResult(_0x16a336,0xc9))[_0xa38e('0x45')](handleError(_0x16a336,null));};exports['update']=function(_0x35644a,_0x1ffbbb){if(_0x35644a[_0xa38e('0x47')]['id']){delete _0x35644a['body']['id'];}return db[_0xa38e('0x29')][_0xa38e('0x44')]({'where':{'id':_0x35644a[_0xa38e('0x40')]['id']}})[_0xa38e('0x24')](handleEntityNotFound(_0x1ffbbb,null))[_0xa38e('0x24')](saveUpdates(_0x35644a['body'],null))['then'](respondWithResult(_0x1ffbbb,null))[_0xa38e('0x45')](handleError(_0x1ffbbb,null));};exports[_0xa38e('0x23')]=function(_0x5b9d03,_0x3d111e){return db[_0xa38e('0x29')][_0xa38e('0x44')]({'where':{'id':_0x5b9d03[_0xa38e('0x40')]['id']}})[_0xa38e('0x24')](handleEntityNotFound(_0x3d111e,null))[_0xa38e('0x24')](removeEntity(_0x3d111e,null))[_0xa38e('0x45')](handleError(_0x3d111e,null));};exports[_0xa38e('0x48')]=function(_0x1e9c5e,_0x1c3d71){return db[_0xa38e('0x29')][_0xa38e('0x48')]()['then'](respondWithResult(_0x1c3d71,null))[_0xa38e('0x45')](handleError(_0x1c3d71,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index a1caa89..7dfa77b 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 _0x0aee=['uniqueid','lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer'];(function(_0x412283,_0x3f2ed1){var _0x1740eb=function(_0x4259fe){while(--_0x4259fe){_0x412283['push'](_0x412283['shift']());}};_0x1740eb(++_0x3f2ed1);}(_0x0aee,0x1a3));var _0xe0ae=function(_0x10d341,_0x57ff35){_0x10d341=_0x10d341-0x0;var _0xddc36d=_0x0aee[_0x10d341];return _0xddc36d;};'use strict';var _=require(_0xe0ae('0x0'));var util=require('util');var logger=require(_0xe0ae('0x1'))('api');var moment=require(_0xe0ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0ae('0x3'));var rimraf=require(_0xe0ae('0x4'));var config=require(_0xe0ae('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0xe0ae('0x6')]=function(_0x28eae7,_0x532ba5){return _0x28eae7[_0xe0ae('0x7')](_0xe0ae('0x8'),attributes,{'tableName':_0xe0ae('0x9'),'paranoid':![],'indexes':[{'name':_0xe0ae('0xa'),'fields':[_0xe0ae('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35aa=['api','moment','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','util','../../config/logger'];(function(_0x19269f,_0x537487){var _0x4bddda=function(_0x2b2ed4){while(--_0x2b2ed4){_0x19269f['push'](_0x19269f['shift']());}};_0x4bddda(++_0x537487);}(_0x35aa,0xbe));var _0xa35a=function(_0x525245,_0x72bcfb){_0x525245=_0x525245-0x0;var _0x2ea70a=_0x35aa[_0x525245];return _0x2ea70a;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var logger=require(_0xa35a('0x1'))(_0xa35a('0x2'));var moment=require(_0xa35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa35a('0x4'));var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module[_0xa35a('0x9')]=function(_0x449cfe,_0x10917d){return _0x449cfe['define'](_0xa35a('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xa35a('0xb'),'fields':[_0xa35a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 9a7d721..d16e393 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 _0x39f1=['client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3079cc,_0x358d48){var _0x38a0af=function(_0x47e311){while(--_0x47e311){_0x3079cc['push'](_0x3079cc['shift']());}};_0x38a0af(++_0x358d48);}(_0x39f1,0x15c));var _0x139f=function(_0xf9188a,_0x42e16a){_0xf9188a=_0xf9188a-0x0;var _0xacfac0=_0x39f1[_0xf9188a];return _0xacfac0;};'use strict';var _=require(_0x139f('0x0'));var util=require(_0x139f('0x1'));var moment=require(_0x139f('0x2'));var BPromise=require('bluebird');var rs=require(_0x139f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x139f('0x4'))['db'];var utils=require(_0x139f('0x5'));var logger=require('../../config/logger')(_0x139f('0x6'));var config=require(_0x139f('0x7'));var jayson=require(_0x139f('0x8'));var client=jayson[_0x139f('0x9')][_0x139f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527289,_0x48d9e6,_0x351aba){return new BPromise(function(_0x38c7c6,_0xb44727){return client['request'](_0x527289,_0x351aba)[_0x139f('0xb')](function(_0x861984){logger[_0x139f('0xc')](_0x139f('0xd'),_0x48d9e6,_0x139f('0xe'));logger[_0x139f('0xf')](_0x139f('0x10'),_0x48d9e6,'request\x20sent',JSON[_0x139f('0x11')](_0x861984));if(_0x861984[_0x139f('0x12')]){if(_0x861984['error']['code']===0x1f4){logger[_0x139f('0x12')](_0x139f('0xd'),_0x48d9e6,_0x861984[_0x139f('0x12')]['message']);return _0xb44727(_0x861984[_0x139f('0x12')][_0x139f('0x13')]);}logger['error'](_0x139f('0xd'),_0x48d9e6,_0x861984[_0x139f('0x12')][_0x139f('0x13')]);return _0x38c7c6(_0x861984[_0x139f('0x12')][_0x139f('0x13')]);}else{logger[_0x139f('0xc')](_0x139f('0xd'),_0x48d9e6,'request\x20sent');_0x38c7c6(_0x861984[_0x139f('0x14')]['message']);}})['catch'](function(_0xb5e828){logger['error'](_0x139f('0xd'),_0x48d9e6,_0xb5e828);_0xb44727(_0xb5e828);});});} \ No newline at end of file +var _0x97fd=['catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x2e6d90,_0x4343a3){var _0x30ce93=function(_0x1f7a4e){while(--_0x1f7a4e){_0x2e6d90['push'](_0x2e6d90['shift']());}};_0x30ce93(++_0x4343a3);}(_0x97fd,0x6a));var _0xd97f=function(_0x36de2e,_0x3b2b17){_0x36de2e=_0x36de2e-0x0;var _0x3dd4bc=_0x97fd[_0x36de2e];return _0x3dd4bc;};'use strict';var _=require(_0xd97f('0x0'));var util=require('util');var moment=require(_0xd97f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd97f('0x2'))['db'];var utils=require(_0xd97f('0x3'));var logger=require(_0xd97f('0x4'))(_0xd97f('0x5'));var config=require(_0xd97f('0x6'));var jayson=require(_0xd97f('0x7'));var client=jayson['client'][_0xd97f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46b0a9,_0x4298e7,_0x3cf38f){return new BPromise(function(_0x62b454,_0x34b3f2){return client[_0xd97f('0x9')](_0x46b0a9,_0x3cf38f)[_0xd97f('0xa')](function(_0x59265d){logger[_0xd97f('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4298e7,_0xd97f('0xc'));logger[_0xd97f('0xd')](_0xd97f('0xe'),_0x4298e7,_0xd97f('0xc'),JSON[_0xd97f('0xf')](_0x59265d));if(_0x59265d['error']){if(_0x59265d[_0xd97f('0x10')][_0xd97f('0x11')]===0x1f4){logger[_0xd97f('0x10')](_0xd97f('0x12'),_0x4298e7,_0x59265d['error'][_0xd97f('0x13')]);return _0x34b3f2(_0x59265d[_0xd97f('0x10')]['message']);}logger[_0xd97f('0x10')](_0xd97f('0x12'),_0x4298e7,_0x59265d[_0xd97f('0x10')][_0xd97f('0x13')]);return _0x62b454(_0x59265d[_0xd97f('0x10')][_0xd97f('0x13')]);}else{logger[_0xd97f('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4298e7,'request\x20sent');_0x62b454(_0x59265d['result'][_0xd97f('0x13')]);}})[_0xd97f('0x14')](function(_0xc7c075){logger['error'](_0xd97f('0x12'),_0x4298e7,_0xc7c075);_0x34b3f2(_0xc7c075);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 141b6ad..5ad068d 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 _0xbdfa=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x5776f6,_0x4de0ae){var _0x32e6bb=function(_0x99d103){while(--_0x99d103){_0x5776f6['push'](_0x5776f6['shift']());}};_0x32e6bb(++_0x4de0ae);}(_0xbdfa,0x1a6));var _0xabdf=function(_0x598e1b,_0x40724b){_0x598e1b=_0x598e1b-0x0;var _0xc9d1b3=_0xbdfa[_0x598e1b];return _0xc9d1b3;};'use strict';var multer=require(_0xabdf('0x0'));var util=require(_0xabdf('0x1'));var path=require(_0xabdf('0x2'));var timeout=require(_0xabdf('0x3'));var express=require(_0xabdf('0x4'));var router=express[_0xabdf('0x5')]();var fs_extra=require(_0xabdf('0x6'));var auth=require(_0xabdf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xabdf('0x8'));var controller=require(_0xabdf('0x9'));router[_0xabdf('0xa')]('/',auth[_0xabdf('0xb')](),controller[_0xabdf('0xc')]);router[_0xabdf('0xa')]('/describe',auth[_0xabdf('0xb')](),controller[_0xabdf('0xd')]);router[_0xabdf('0xa')](_0xabdf('0xe'),auth[_0xabdf('0xb')](),controller['show']);router['post']('/',auth[_0xabdf('0xb')](),controller['create']);router[_0xabdf('0xf')](_0xabdf('0xe'),auth['isAuthenticated'](),controller[_0xabdf('0x10')]);router[_0xabdf('0x11')](_0xabdf('0xe'),auth['isAuthenticated'](),controller[_0xabdf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6762=['/:id','post','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe'];(function(_0x1b93dc,_0x1b8555){var _0x53bbf0=function(_0x5dec4f){while(--_0x5dec4f){_0x1b93dc['push'](_0x1b93dc['shift']());}};_0x53bbf0(++_0x1b8555);}(_0x6762,0x1a8));var _0x2676=function(_0x5d8102,_0x1ba2b2){_0x5d8102=_0x5d8102-0x0;var _0x1570d6=_0x6762[_0x5d8102];return _0x1570d6;};'use strict';var multer=require('multer');var util=require(_0x2676('0x0'));var path=require(_0x2676('0x1'));var timeout=require('connect-timeout');var express=require(_0x2676('0x2'));var router=express[_0x2676('0x3')]();var fs_extra=require(_0x2676('0x4'));var auth=require(_0x2676('0x5'));var interaction=require(_0x2676('0x6'));var config=require(_0x2676('0x7'));var controller=require(_0x2676('0x8'));router['get']('/',auth[_0x2676('0x9')](),controller[_0x2676('0xa')]);router[_0x2676('0xb')](_0x2676('0xc'),auth[_0x2676('0x9')](),controller['describe']);router['get'](_0x2676('0xd'),auth[_0x2676('0x9')](),controller['show']);router[_0x2676('0xe')]('/',auth[_0x2676('0x9')](),controller['create']);router[_0x2676('0xf')](_0x2676('0xd'),auth['isAuthenticated'](),controller[_0x2676('0x10')]);router[_0x2676('0x11')](_0x2676('0xd'),auth['isAuthenticated'](),controller[_0x2676('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4871311..7b39c77 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 _0x6267=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER'];(function(_0x129a57,_0x330d03){var _0xa7147c=function(_0x4e6c1f){while(--_0x4e6c1f){_0x129a57['push'](_0x129a57['shift']());}};_0xa7147c(++_0x330d03);}(_0x6267,0xee));var _0x7626=function(_0x156437,_0x3969c8){_0x156437=_0x156437-0x0;var _0x25bdb5=_0x6267[_0x156437];return _0x25bdb5;};'use strict';var Sequelize=require(_0x7626('0x0'));var moment=require(_0x7626('0x1'));module[_0x7626('0x2')]={'channel':{'type':Sequelize[_0x7626('0x3')]},'membername':{'type':Sequelize[_0x7626('0x3')]},'interface':{'type':Sequelize[_0x7626('0x3')]},'type':{'type':Sequelize[_0x7626('0x3')],'defaultValue':_0x7626('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x7626('0x5')]},'exitAt':{'type':Sequelize[_0x7626('0x5')],'set':function(_0x483bcc){var _0x20b6e6=moment(_0x483bcc);var _0xb5f8b2=moment(this[_0x7626('0x6')](_0x7626('0x7')));var _0x5f33e9=_0x20b6e6[_0x7626('0x8')](_0xb5f8b2,_0x7626('0x9'));this[_0x7626('0xa')](_0x7626('0xb'),_0x483bcc);this[_0x7626('0xa')](_0x7626('0xc'),_0x5f33e9>=0x0?_0x5f33e9:null);}},'data1':{'type':Sequelize[_0x7626('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x7626('0xd')},'data3':{'type':Sequelize[_0x7626('0x3')],'comment':_0x7626('0xe')},'data4':{'type':Sequelize[_0x7626('0x3')],'comment':_0x7626('0xf')},'data5':{'type':Sequelize[_0x7626('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x7626('0x3')]},'internal':{'type':Sequelize[_0x7626('0x10')]},'uniqueid':{'type':Sequelize[_0x7626('0x3')]}}; \ No newline at end of file +var _0x0892=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x0892,0x164));var _0x2089=function(_0x508887,_0x66ff58){_0x508887=_0x508887-0x0;var _0x4877bb=_0x0892[_0x508887];return _0x4877bb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2089('0x0'));module[_0x2089('0x1')]={'channel':{'type':Sequelize[_0x2089('0x2')]},'membername':{'type':Sequelize[_0x2089('0x2')]},'interface':{'type':Sequelize[_0x2089('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2089('0x3'),'comment':_0x2089('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x2089('0x5')]},'exitAt':{'type':Sequelize[_0x2089('0x5')],'set':function(_0x438b92){var _0x78ea8=moment(_0x438b92);var _0x340eb4=moment(this[_0x2089('0x6')]('enterAt'));var _0x4c560d=_0x78ea8[_0x2089('0x7')](_0x340eb4,_0x2089('0x8'));this[_0x2089('0x9')](_0x2089('0xa'),_0x438b92);this[_0x2089('0x9')]('duration',_0x4c560d>=0x0?_0x4c560d:null);}},'data1':{'type':Sequelize[_0x2089('0x2')],'comment':_0x2089('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2089('0x2')],'comment':_0x2089('0xc')},'data4':{'type':Sequelize[_0x2089('0x2')],'comment':_0x2089('0xd')},'data5':{'type':Sequelize[_0x2089('0x2')],'comment':_0x2089('0xe')},'role':{'type':Sequelize[_0x2089('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2089('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index fc24f58..bc8a3af 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xedd9,0xfc));var _0x9edd=function(_0x345da2,_0x2200d0){_0x345da2=_0x345da2-0x0;var _0x2a79ba=_0xedd9[_0x345da2];return _0x2a79ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +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(_0x5a5349,_0x3a789d){var _0x5efd3c=function(_0x20ec18){while(--_0x20ec18){_0x5a5349['push'](_0x5a5349['shift']());}};_0x5efd3c(++_0x3a789d);}(_0x3e74,0x175));var _0x43e7=function(_0x18dfb2,_0x4eb102){_0x18dfb2=_0x18dfb2-0x0;var _0x2f1d7d=_0x3e74[_0x18dfb2];return _0x2f1d7d;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 892355c..ccf2267 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 _0xb302=['./memberReport.attributes','exports','define','report_member','membername_interface','membername','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f5b1e,_0x3f68fd){var _0x56ea99=function(_0x24b267){while(--_0x24b267){_0x4f5b1e['push'](_0x4f5b1e['shift']());}};_0x56ea99(++_0x3f68fd);}(_0xb302,0x12c));var _0x2b30=function(_0x4917ba,_0x9bd4e2){_0x4917ba=_0x4917ba-0x0;var _0x208beb=_0xb302[_0x4917ba];return _0x208beb;};'use strict';var _=require('lodash');var util=require(_0x2b30('0x0'));var logger=require(_0x2b30('0x1'))(_0x2b30('0x2'));var moment=require('moment');var BPromise=require(_0x2b30('0x3'));var rp=require(_0x2b30('0x4'));var fs=require('fs');var path=require(_0x2b30('0x5'));var rimraf=require(_0x2b30('0x6'));var config=require(_0x2b30('0x7'));var attributes=require(_0x2b30('0x8'));module[_0x2b30('0x9')]=function(_0x13a233,_0xb0c3a6){return _0x13a233[_0x2b30('0xa')]('MemberReport',attributes,{'tableName':_0x2b30('0xb'),'paranoid':![],'indexes':[{'name':_0x2b30('0xc'),'fields':[_0x2b30('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf008=['moment','bluebird','path','rimraf','../../config/environment','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger'];(function(_0x52a059,_0x46e42e){var _0x250df2=function(_0x9a35a1){while(--_0x9a35a1){_0x52a059['push'](_0x52a059['shift']());}};_0x250df2(++_0x46e42e);}(_0xf008,0x193));var _0x8f00=function(_0x13422a,_0x13df1f){_0x13422a=_0x13422a-0x0;var _0x3108fc=_0xf008[_0x13422a];return _0x3108fc;};'use strict';var _=require(_0x8f00('0x0'));var util=require(_0x8f00('0x1'));var logger=require(_0x8f00('0x2'))('api');var moment=require(_0x8f00('0x3'));var BPromise=require(_0x8f00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f00('0x5'));var rimraf=require(_0x8f00('0x6'));var config=require(_0x8f00('0x7'));var attributes=require('./memberReport.attributes');module[_0x8f00('0x8')]=function(_0x44bb05,_0x4d461d){return _0x44bb05[_0x8f00('0x9')](_0x8f00('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x8f00('0xb'),'fields':[_0x8f00('0xc'),_0x8f00('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 6ed9893..bc0cc65 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 _0x980e=['options','raw','where','attributes','map','include','model','CreateMemberReport','create','body','then','UpdateMemberReport','update','limit','lodash','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','request','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll'];(function(_0x16d90c,_0x59dd7d){var _0x4d3dbf=function(_0x987ebe){while(--_0x987ebe){_0x16d90c['push'](_0x16d90c['shift']());}};_0x4d3dbf(++_0x59dd7d);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe980('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe980('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe980('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe980('0x3'));var logger=require(_0xe980('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe980('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5825c1,_0xc47bdf,_0x27cc8c){return new BPromise(function(_0x3683df,_0x2d76d0){return client[_0xe980('0x6')](_0x5825c1,_0x27cc8c)['then'](function(_0xf9f019){logger[_0xe980('0x7')](_0xe980('0x8'),_0xc47bdf,'request\x20sent');logger[_0xe980('0x9')](_0xe980('0xa'),_0xc47bdf,_0xe980('0xb'),JSON[_0xe980('0xc')](_0xf9f019));if(_0xf9f019[_0xe980('0xd')]){if(_0xf9f019['error']['code']===0x1f4){logger['error'](_0xe980('0x8'),_0xc47bdf,_0xf9f019[_0xe980('0xd')]['message']);return _0x2d76d0(_0xf9f019['error'][_0xe980('0xe')]);}logger[_0xe980('0xd')](_0xe980('0x8'),_0xc47bdf,_0xf9f019[_0xe980('0xd')][_0xe980('0xe')]);return _0x3683df(_0xf9f019[_0xe980('0xd')][_0xe980('0xe')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0xc47bdf,'request\x20sent');_0x3683df(_0xf9f019[_0xe980('0xf')][_0xe980('0xe')]);}})[_0xe980('0x10')](function(_0x406418){logger[_0xe980('0xd')]('MemberReport,\x20%s,\x20%s',_0xc47bdf,_0x406418);_0x2d76d0(_0x406418);});});}exports[_0xe980('0x11')]=function(_0x1c6354){var _0x1ddb12=this;return new Promise(function(_0x538d32,_0x5aa2c1){return db[_0xe980('0x12')][_0xe980('0x13')]({'raw':_0x1c6354[_0xe980('0x14')]?_0x1c6354[_0xe980('0x14')][_0xe980('0x15')]===undefined?!![]:![]:!![],'where':_0x1c6354[_0xe980('0x14')]?_0x1c6354[_0xe980('0x14')][_0xe980('0x16')]||null:null,'attributes':_0x1c6354['options']?_0x1c6354['options'][_0xe980('0x17')]||null:null,'limit':_0x1c6354[_0xe980('0x14')]?_0x1c6354[_0xe980('0x14')]['limit']||null:null,'include':_0x1c6354[_0xe980('0x14')]?_0x1c6354[_0xe980('0x14')]['include']?_[_0xe980('0x18')](_0x1c6354[_0xe980('0x14')][_0xe980('0x19')],function(_0x4b7888){return{'model':db[_0x4b7888[_0xe980('0x1a')]],'as':_0x4b7888['as'],'attributes':_0x4b7888['attributes'],'include':_0x4b7888[_0xe980('0x19')]?_[_0xe980('0x18')](_0x4b7888[_0xe980('0x19')],function(_0x40a34e){return{'model':db[_0x40a34e['model']],'as':_0x40a34e['as'],'attributes':_0x40a34e[_0xe980('0x17')],'include':_0x40a34e[_0xe980('0x19')]?_[_0xe980('0x18')](_0x40a34e['include'],function(_0x54e755){return{'model':db[_0x54e755[_0xe980('0x1a')]],'as':_0x54e755['as'],'attributes':_0x54e755[_0xe980('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16f2fe){logger['info'](_0xe980('0x11'),_0x1c6354);logger[_0xe980('0x9')](_0xe980('0x11'),_0x1c6354,JSON[_0xe980('0xc')](_0x16f2fe));_0x538d32(_0x16f2fe);})[_0xe980('0x10')](function(_0x43a7c2){logger['error'](_0xe980('0x11'),_0x43a7c2['message'],_0x1c6354);_0x5aa2c1(_0x1ddb12[_0xe980('0xd')](0x1f4,_0x43a7c2[_0xe980('0xe')]));});});};exports[_0xe980('0x1b')]=function(_0x38ab6d){var _0x2a9ea2=this;return new Promise(function(_0x56fbf7,_0x4bf013){return db[_0xe980('0x12')][_0xe980('0x1c')](_0x38ab6d[_0xe980('0x1d')],{'raw':_0x38ab6d[_0xe980('0x14')]?_0x38ab6d[_0xe980('0x14')][_0xe980('0x15')]===undefined?!![]:![]:!![]})[_0xe980('0x1e')](function(_0x369c3a){logger[_0xe980('0x7')](_0xe980('0x1b'),_0x38ab6d);logger[_0xe980('0x9')]('CreateMemberReport',_0x38ab6d,JSON['stringify'](_0x369c3a));_0x56fbf7(_0x369c3a);})[_0xe980('0x10')](function(_0x4702e0){logger[_0xe980('0xd')]('CreateMemberReport',_0x4702e0[_0xe980('0xe')],_0x38ab6d);_0x4bf013(_0x2a9ea2[_0xe980('0xd')](0x1f4,_0x4702e0[_0xe980('0xe')]));});});};exports[_0xe980('0x1f')]=function(_0x163db9){var _0x44686a=this;return new Promise(function(_0x1811b3,_0x36ab72){return db[_0xe980('0x12')][_0xe980('0x20')](_0x163db9['body'],{'raw':_0x163db9['options']?_0x163db9[_0xe980('0x14')][_0xe980('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x163db9['options']?_0x163db9[_0xe980('0x14')]['where']||null:null,'attributes':_0x163db9[_0xe980('0x14')]?_0x163db9[_0xe980('0x14')][_0xe980('0x17')]||null:null,'limit':_0x163db9[_0xe980('0x14')]?_0x163db9[_0xe980('0x14')][_0xe980('0x21')]||null:null})['then'](function(_0x11fb5b){logger[_0xe980('0x7')](_0xe980('0x1f'),_0x163db9);logger[_0xe980('0x9')](_0xe980('0x1f'),_0x163db9,JSON['stringify'](_0x11fb5b));_0x1811b3(_0x11fb5b);})[_0xe980('0x10')](function(_0x1f35ed){logger[_0xe980('0xd')]('UpdateMemberReport',_0x1f35ed[_0xe980('0xe')],_0x163db9);_0x36ab72(_0x44686a['error'](0x1f4,_0x1f35ed[_0xe980('0xe')]));});});}; \ No newline at end of file +var _0xee3c=['where','attributes','limit','include','model','map','CreateMemberReport','create','update','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw'];(function(_0x35500b,_0x3cce83){var _0x5f33ae=function(_0x130f7d){while(--_0x130f7d){_0x35500b['push'](_0x35500b['shift']());}};_0x5f33ae(++_0x3cce83);}(_0xee3c,0x14a));var _0xcee3=function(_0x579542,_0x2f59df){_0x579542=_0x579542-0x0;var _0x423c49=_0xee3c[_0x579542];return _0x423c49;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var moment=require(_0xcee3('0x2'));var BPromise=require(_0xcee3('0x3'));var rs=require(_0xcee3('0x4'));var fs=require('fs');var Redis=require(_0xcee3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee3('0x6'))(_0xcee3('0x7'));var config=require(_0xcee3('0x8'));var jayson=require(_0xcee3('0x9'));var client=jayson[_0xcee3('0xa')][_0xcee3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8ffe,_0x97f00e,_0x22953c){return new BPromise(function(_0x364eb2,_0x4770ed){return client[_0xcee3('0xc')](_0x3b8ffe,_0x22953c)[_0xcee3('0xd')](function(_0x81de8e){logger[_0xcee3('0xe')]('MemberReport,\x20%s,\x20%s',_0x97f00e,_0xcee3('0xf'));logger[_0xcee3('0x10')](_0xcee3('0x11'),_0x97f00e,_0xcee3('0xf'),JSON[_0xcee3('0x12')](_0x81de8e));if(_0x81de8e[_0xcee3('0x13')]){if(_0x81de8e['error'][_0xcee3('0x14')]===0x1f4){logger[_0xcee3('0x13')](_0xcee3('0x15'),_0x97f00e,_0x81de8e[_0xcee3('0x13')][_0xcee3('0x16')]);return _0x4770ed(_0x81de8e['error'][_0xcee3('0x16')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x97f00e,_0x81de8e['error'][_0xcee3('0x16')]);return _0x364eb2(_0x81de8e[_0xcee3('0x13')]['message']);}else{logger['info'](_0xcee3('0x15'),_0x97f00e,'request\x20sent');_0x364eb2(_0x81de8e[_0xcee3('0x17')]['message']);}})[_0xcee3('0x18')](function(_0x952a21){logger['error'](_0xcee3('0x15'),_0x97f00e,_0x952a21);_0x4770ed(_0x952a21);});});}exports[_0xcee3('0x19')]=function(_0x40cb8b){var _0x2295c=this;return new Promise(function(_0x50bf6e,_0x164073){return db[_0xcee3('0x1a')][_0xcee3('0x1b')]({'raw':_0x40cb8b[_0xcee3('0x1c')]?_0x40cb8b['options'][_0xcee3('0x1d')]===undefined?!![]:![]:!![],'where':_0x40cb8b[_0xcee3('0x1c')]?_0x40cb8b[_0xcee3('0x1c')][_0xcee3('0x1e')]||null:null,'attributes':_0x40cb8b[_0xcee3('0x1c')]?_0x40cb8b[_0xcee3('0x1c')][_0xcee3('0x1f')]||null:null,'limit':_0x40cb8b[_0xcee3('0x1c')]?_0x40cb8b[_0xcee3('0x1c')][_0xcee3('0x20')]||null:null,'include':_0x40cb8b[_0xcee3('0x1c')]?_0x40cb8b[_0xcee3('0x1c')][_0xcee3('0x21')]?_['map'](_0x40cb8b[_0xcee3('0x1c')][_0xcee3('0x21')],function(_0x240736){return{'model':db[_0x240736[_0xcee3('0x22')]],'as':_0x240736['as'],'attributes':_0x240736[_0xcee3('0x1f')],'include':_0x240736['include']?_['map'](_0x240736[_0xcee3('0x21')],function(_0x5b92ba){return{'model':db[_0x5b92ba['model']],'as':_0x5b92ba['as'],'attributes':_0x5b92ba[_0xcee3('0x1f')],'include':_0x5b92ba['include']?_[_0xcee3('0x23')](_0x5b92ba[_0xcee3('0x21')],function(_0x19a15e){return{'model':db[_0x19a15e['model']],'as':_0x19a15e['as'],'attributes':_0x19a15e[_0xcee3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f457d){logger['info'](_0xcee3('0x19'),_0x40cb8b);logger[_0xcee3('0x10')]('GetMemberReport',_0x40cb8b,JSON[_0xcee3('0x12')](_0x4f457d));_0x50bf6e(_0x4f457d);})[_0xcee3('0x18')](function(_0x5c1a32){logger[_0xcee3('0x13')]('GetMemberReport',_0x5c1a32['message'],_0x40cb8b);_0x164073(_0x2295c[_0xcee3('0x13')](0x1f4,_0x5c1a32['message']));});});};exports[_0xcee3('0x24')]=function(_0x1da1e6){var _0x375cab=this;return new Promise(function(_0x1b9087,_0x331290){return db[_0xcee3('0x1a')][_0xcee3('0x25')](_0x1da1e6['body'],{'raw':_0x1da1e6[_0xcee3('0x1c')]?_0x1da1e6['options'][_0xcee3('0x1d')]===undefined?!![]:![]:!![]})[_0xcee3('0xd')](function(_0x272ac8){logger[_0xcee3('0xe')](_0xcee3('0x24'),_0x1da1e6);logger[_0xcee3('0x10')](_0xcee3('0x24'),_0x1da1e6,JSON[_0xcee3('0x12')](_0x272ac8));_0x1b9087(_0x272ac8);})['catch'](function(_0x220867){logger[_0xcee3('0x13')](_0xcee3('0x24'),_0x220867['message'],_0x1da1e6);_0x331290(_0x375cab[_0xcee3('0x13')](0x1f4,_0x220867[_0xcee3('0x16')]));});});};exports['UpdateMemberReport']=function(_0x35c415){var _0x509ca6=this;return new Promise(function(_0x2a4996,_0x4b5c41){return db['MemberReport'][_0xcee3('0x26')](_0x35c415['body'],{'raw':_0x35c415[_0xcee3('0x1c')]?_0x35c415[_0xcee3('0x1c')][_0xcee3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35c415[_0xcee3('0x1c')]?_0x35c415['options']['where']||null:null,'attributes':_0x35c415[_0xcee3('0x1c')]?_0x35c415[_0xcee3('0x1c')]['attributes']||null:null,'limit':_0x35c415[_0xcee3('0x1c')]?_0x35c415[_0xcee3('0x1c')]['limit']||null:null})[_0xcee3('0xd')](function(_0x20df38){logger[_0xcee3('0xe')](_0xcee3('0x27'),_0x35c415);logger[_0xcee3('0x10')](_0xcee3('0x27'),_0x35c415,JSON['stringify'](_0x20df38));_0x2a4996(_0x20df38);})[_0xcee3('0x18')](function(_0x149b93){logger[_0xcee3('0x13')](_0xcee3('0x27'),_0x149b93[_0xcee3('0x16')],_0x35c415);_0x4b5c41(_0x509ca6[_0xcee3('0x13')](0x1f4,_0x149b93[_0xcee3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 203f66e..4c32527 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 _0x2297=['./migration.controller','get','index','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2297,0x100));var _0x7229=function(_0x47dc16,_0x55227e){_0x47dc16=_0x47dc16-0x0;var _0x221481=_0x2297[_0x47dc16];return _0x221481;};'use strict';var multer=require(_0x7229('0x0'));var util=require(_0x7229('0x1'));var path=require('path');var timeout=require(_0x7229('0x2'));var express=require(_0x7229('0x3'));var router=express['Router']();var fs_extra=require(_0x7229('0x4'));var auth=require(_0x7229('0x5'));var interaction=require(_0x7229('0x6'));var config=require(_0x7229('0x7'));var controller=require(_0x7229('0x8'));router[_0x7229('0x9')]('/',controller[_0x7229('0xa')]);module[_0x7229('0xb')]=router; \ No newline at end of file +var _0x5447=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer'];(function(_0x2bd4cd,_0x282ca8){var _0x359e57=function(_0x4c063d){while(--_0x4c063d){_0x2bd4cd['push'](_0x2bd4cd['shift']());}};_0x359e57(++_0x282ca8);}(_0x5447,0xf1));var _0x7544=function(_0x54f8c4,_0x5c1528){_0x54f8c4=_0x54f8c4-0x0;var _0x16b523=_0x5447[_0x54f8c4];return _0x16b523;};'use strict';var multer=require(_0x7544('0x0'));var util=require('util');var path=require(_0x7544('0x1'));var timeout=require(_0x7544('0x2'));var express=require('express');var router=express[_0x7544('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7544('0x4'));var interaction=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var controller=require(_0x7544('0x7'));router[_0x7544('0x8')]('/',controller[_0x7544('0x9')]);module[_0x7544('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 898412b..7432fe2 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 _0x8dfe=['exports','STRING','version','sequelize'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x8dfe,0x6f));var _0xe8df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8dfe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe8df('0x0'));module[_0xe8df('0x1')]={'version':{'type':Sequelize[_0xe8df('0x2')],'unique':_0xe8df('0x3')}}; \ No newline at end of file +var _0x92a3=['STRING','sequelize','exports'];(function(_0x243d3b,_0x224936){var _0x40076a=function(_0x5c91b0){while(--_0x5c91b0){_0x243d3b['push'](_0x243d3b['shift']());}};_0x40076a(++_0x224936);}(_0x92a3,0x1a2));var _0x392a=function(_0x5a4812,_0x389986){_0x5a4812=_0x5a4812-0x0;var _0x5737cd=_0x92a3[_0x5a4812];return _0x5737cd;};'use strict';var Sequelize=require(_0x392a('0x0'));module[_0x392a('0x1')]={'version':{'type':Sequelize[_0x392a('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 5fbc389..f768800 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 _0x772c=['index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x772c,0x178));var _0xc772=function(_0x1def64,_0x1e3350){_0x1def64=_0x1def64-0x0;var _0xa23d65=_0x772c[_0x1def64];return _0xa23d65;};'use strict';var emlformat=require(_0xc772('0x0'));var rimraf=require(_0xc772('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc772('0x2'));var rp=require(_0xc772('0x3'));var moment=require('moment');var BPromise=require(_0xc772('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc772('0x5'));var csv=require(_0xc772('0x6'));var ejs=require(_0xc772('0x7'));var fs=require('fs');var fs_extra=require(_0xc772('0x8'));var _=require(_0xc772('0x9'));var squel=require(_0xc772('0xa'));var crypto=require(_0xc772('0xb'));var jsforce=require(_0xc772('0xc'));var deskjs=require(_0xc772('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc772('0xe'));var Papa=require(_0xc772('0xf'));var Redis=require(_0xc772('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc772('0x11'));var as=require(_0xc772('0x12'));var hardwareService=require(_0xc772('0x13'));var logger=require(_0xc772('0x14'))(_0xc772('0x15'));var utils=require(_0xc772('0x16'));var config=require(_0xc772('0x17'));var licenseUtil=require(_0xc772('0x18'));var db=require(_0xc772('0x19'))['db'];function respondWithStatusCode(_0xa479e2,_0x26a704){_0x26a704=_0x26a704||0xcc;return function(_0xdd8fd7){if(_0xdd8fd7){return _0xa479e2[_0xc772('0x1a')](_0x26a704);}return _0xa479e2[_0xc772('0x1b')](_0x26a704)[_0xc772('0x1c')]();};}function respondWithResult(_0x352a1f,_0x3a21b4){_0x3a21b4=_0x3a21b4||0xc8;return function(_0x3947a3){if(_0x3947a3){return _0x352a1f[_0xc772('0x1b')](_0x3a21b4)[_0xc772('0x1d')](_0x3947a3);}};}function respondWithFilteredResult(_0x330548,_0x5f58e6){return function(_0x21fc01){if(_0x21fc01){var _0x562548=typeof _0x5f58e6[_0xc772('0x1e')]===_0xc772('0x1f')&&typeof _0x5f58e6[_0xc772('0x20')]===_0xc772('0x1f');var _0x10726a=_0x21fc01[_0xc772('0x21')];var _0x4eede3=_0x562548?0x0:_0x5f58e6['offset'];var _0x62fe49=_0x562548?_0x21fc01[_0xc772('0x21')]:_0x5f58e6[_0xc772('0x1e')]+_0x5f58e6[_0xc772('0x20')];var _0x10d495;if(_0x62fe49>=_0x10726a){_0x62fe49=_0x10726a;_0x10d495=0xc8;}else{_0x10d495=0xce;}_0x330548['status'](_0x10d495);return _0x330548[_0xc772('0x22')](_0xc772('0x23'),_0x4eede3+'-'+_0x62fe49+'/'+_0x10726a)[_0xc772('0x1d')](_0x21fc01);}return null;};}function patchUpdates(_0x37ef54){return function(_0x3de671){try{jsonpatch['apply'](_0x3de671,_0x37ef54,!![]);}catch(_0xa02506){return BPromise[_0xc772('0x24')](_0xa02506);}return _0x3de671['save']();};}function saveUpdates(_0x14943b,_0xcea5e0){return function(_0x31af4c){if(_0x31af4c){return _0x31af4c[_0xc772('0x25')](_0x14943b)[_0xc772('0x26')](function(_0x302fa6){return _0x302fa6;});}return null;};}function removeEntity(_0x1afa7c,_0x1e37a0){return function(_0x267f17){if(_0x267f17){return _0x267f17[_0xc772('0x27')]()[_0xc772('0x26')](function(){_0x1afa7c['status'](0xcc)[_0xc772('0x1c')]();});}};}function handleEntityNotFound(_0x1d7a82,_0x1247e4){return function(_0x3ca4cb){if(!_0x3ca4cb){_0x1d7a82[_0xc772('0x1a')](0x194);}return _0x3ca4cb;};}function handleError(_0x503725,_0x551afc){_0x551afc=_0x551afc||0x1f4;return function(_0x3b972d){logger[_0xc772('0x28')](_0x3b972d[_0xc772('0x29')]);if(_0x3b972d[_0xc772('0x2a')]){delete _0x3b972d[_0xc772('0x2a')];}_0x503725[_0xc772('0x1b')](_0x551afc)[_0xc772('0x2b')](_0x3b972d);};}exports[_0xc772('0x2c')]=function(_0x1448ff,_0x58f65d){var _0x15ee17={},_0x1530a1={},_0x1f0601={'count':0x0,'rows':[]};var _0x1a1a5d=_[_0xc772('0x2d')](db[_0xc772('0x2e')][_0xc772('0x2f')],function(_0x2c40bf){return{'name':_0x2c40bf[_0xc772('0x30')],'type':_0x2c40bf[_0xc772('0x31')][_0xc772('0x32')]};});_0x1530a1[_0xc772('0x33')]=_['map'](_0x1a1a5d,_0xc772('0x2a'));_0x1530a1[_0xc772('0x34')]=_[_0xc772('0x35')](_0x1448ff['query']);_0x1530a1['filters']=_['intersection'](_0x1530a1[_0xc772('0x33')],_0x1530a1[_0xc772('0x34')]);_0x15ee17['attributes']=_[_0xc772('0x36')](_0x1530a1['model'],qs['fields'](_0x1448ff[_0xc772('0x34')][_0xc772('0x37')]));_0x15ee17[_0xc772('0x38')]=_0x15ee17[_0xc772('0x38')][_0xc772('0x39')]?_0x15ee17['attributes']:_0x1530a1[_0xc772('0x33')];if(!_0x1448ff['query']['hasOwnProperty'](_0xc772('0x3a'))){_0x15ee17[_0xc772('0x20')]=qs['limit'](_0x1448ff[_0xc772('0x34')]['limit']);_0x15ee17[_0xc772('0x1e')]=qs[_0xc772('0x1e')](_0x1448ff[_0xc772('0x34')][_0xc772('0x1e')]);}_0x15ee17[_0xc772('0x3b')]=qs[_0xc772('0x3c')](_0x1448ff['query']['sort']);_0x15ee17[_0xc772('0x3d')]=qs[_0xc772('0x3e')](_[_0xc772('0x3f')](_0x1448ff[_0xc772('0x34')],_0x1530a1[_0xc772('0x3e')]),_0x1a1a5d);if(_0x1448ff['query'][_0xc772('0x40')]){_0x15ee17['where']=_[_0xc772('0x41')](_0x15ee17[_0xc772('0x3d')],{'$or':_[_0xc772('0x2d')](_0x1a1a5d,function(_0x450af2){if(_0x450af2[_0xc772('0x31')]!==_0xc772('0x42')){var _0x26cfe3={};_0x26cfe3[_0x450af2[_0xc772('0x2a')]]={'$like':'%'+_0x1448ff['query']['filter']+'%'};return _0x26cfe3;}})});}_0x15ee17=_[_0xc772('0x41')]({},_0x15ee17,_0x1448ff['options']);var _0x489289={'where':_0x15ee17[_0xc772('0x3d')]};return db['Migration']['count'](_0x489289)['then'](function(_0x56d012){_0x1f0601[_0xc772('0x21')]=_0x56d012;if(_0x1448ff[_0xc772('0x34')][_0xc772('0x43')]){_0x15ee17[_0xc772('0x44')]=[{'all':!![]}];}return db[_0xc772('0x2e')][_0xc772('0x45')](_0x15ee17);})[_0xc772('0x26')](function(_0x2ecd08){_0x1f0601['rows']=_0x2ecd08;return _0x1f0601;})[_0xc772('0x26')](respondWithFilteredResult(_0x58f65d,_0x15ee17))['catch'](handleError(_0x58f65d,null));}; \ No newline at end of file +var _0xb331=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','index','map','Migration','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','where','includeAll','include','findAll','rows','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2d101a,_0x1b5ad5){var _0x53dc6e=function(_0xbc0dd7){while(--_0xbc0dd7){_0x2d101a['push'](_0x2d101a['shift']());}};_0x53dc6e(++_0x1b5ad5);}(_0xb331,0x76));var _0x1b33=function(_0x3fb94d,_0x582d4b){_0x3fb94d=_0x3fb94d-0x0;var _0x502e70=_0xb331[_0x3fb94d];return _0x502e70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b33('0x0'));var zipdir=require(_0x1b33('0x1'));var jsonpatch=require(_0x1b33('0x2'));var rp=require(_0x1b33('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b33('0x4'));var util=require(_0x1b33('0x5'));var path=require(_0x1b33('0x6'));var sox=require(_0x1b33('0x7'));var csv=require(_0x1b33('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b33('0x9'));var _=require(_0x1b33('0xa'));var squel=require(_0x1b33('0xb'));var crypto=require('crypto');var jsforce=require(_0x1b33('0xc'));var deskjs=require(_0x1b33('0xd'));var toCsv=require(_0x1b33('0x8'));var querystring=require(_0x1b33('0xe'));var Papa=require(_0x1b33('0xf'));var Redis=require('ioredis');var authService=require(_0x1b33('0x10'));var qs=require(_0x1b33('0x11'));var as=require(_0x1b33('0x12'));var hardwareService=require(_0x1b33('0x13'));var logger=require(_0x1b33('0x14'))(_0x1b33('0x15'));var utils=require(_0x1b33('0x16'));var config=require(_0x1b33('0x17'));var licenseUtil=require(_0x1b33('0x18'));var db=require(_0x1b33('0x19'))['db'];function respondWithStatusCode(_0x10d370,_0x3e19e0){_0x3e19e0=_0x3e19e0||0xcc;return function(_0x42643d){if(_0x42643d){return _0x10d370[_0x1b33('0x1a')](_0x3e19e0);}return _0x10d370['status'](_0x3e19e0)[_0x1b33('0x1b')]();};}function respondWithResult(_0xf3415c,_0x2aab21){_0x2aab21=_0x2aab21||0xc8;return function(_0x43377e){if(_0x43377e){return _0xf3415c[_0x1b33('0x1c')](_0x2aab21)['json'](_0x43377e);}};}function respondWithFilteredResult(_0x4d2d0d,_0x3b2509){return function(_0x2d967e){if(_0x2d967e){var _0xc105c2=typeof _0x3b2509['offset']===_0x1b33('0x1d')&&typeof _0x3b2509[_0x1b33('0x1e')]===_0x1b33('0x1d');var _0x225847=_0x2d967e[_0x1b33('0x1f')];var _0x3c92da=_0xc105c2?0x0:_0x3b2509[_0x1b33('0x20')];var _0x7c187=_0xc105c2?_0x2d967e[_0x1b33('0x1f')]:_0x3b2509['offset']+_0x3b2509[_0x1b33('0x1e')];var _0x2e1063;if(_0x7c187>=_0x225847){_0x7c187=_0x225847;_0x2e1063=0xc8;}else{_0x2e1063=0xce;}_0x4d2d0d[_0x1b33('0x1c')](_0x2e1063);return _0x4d2d0d[_0x1b33('0x21')](_0x1b33('0x22'),_0x3c92da+'-'+_0x7c187+'/'+_0x225847)[_0x1b33('0x23')](_0x2d967e);}return null;};}function patchUpdates(_0x57029a){return function(_0x9074f2){try{jsonpatch[_0x1b33('0x24')](_0x9074f2,_0x57029a,!![]);}catch(_0x19a2c2){return BPromise[_0x1b33('0x25')](_0x19a2c2);}return _0x9074f2[_0x1b33('0x26')]();};}function saveUpdates(_0x237ab3,_0xcb8de4){return function(_0xfd0199){if(_0xfd0199){return _0xfd0199[_0x1b33('0x27')](_0x237ab3)[_0x1b33('0x28')](function(_0x5e4cae){return _0x5e4cae;});}return null;};}function removeEntity(_0x286183,_0x3ea661){return function(_0x6a14cb){if(_0x6a14cb){return _0x6a14cb['destroy']()[_0x1b33('0x28')](function(){_0x286183['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fe751,_0x3c0a81){return function(_0x313fa1){if(!_0x313fa1){_0x9fe751['sendStatus'](0x194);}return _0x313fa1;};}function handleError(_0xb91590,_0x2e2078){_0x2e2078=_0x2e2078||0x1f4;return function(_0x315fe0){logger[_0x1b33('0x29')](_0x315fe0[_0x1b33('0x2a')]);if(_0x315fe0['name']){delete _0x315fe0['name'];}_0xb91590[_0x1b33('0x1c')](_0x2e2078)['send'](_0x315fe0);};}exports[_0x1b33('0x2b')]=function(_0x57a22c,_0x56d8e3){var _0x19b491={},_0x534541={},_0x5a22b7={'count':0x0,'rows':[]};var _0x5a137b=_[_0x1b33('0x2c')](db[_0x1b33('0x2d')][_0x1b33('0x2e')],function(_0x3308){return{'name':_0x3308[_0x1b33('0x2f')],'type':_0x3308[_0x1b33('0x30')][_0x1b33('0x31')]};});_0x534541[_0x1b33('0x32')]=_['map'](_0x5a137b,_0x1b33('0x33'));_0x534541[_0x1b33('0x34')]=_['keys'](_0x57a22c[_0x1b33('0x34')]);_0x534541[_0x1b33('0x35')]=_['intersection'](_0x534541[_0x1b33('0x32')],_0x534541['query']);_0x19b491[_0x1b33('0x36')]=_[_0x1b33('0x37')](_0x534541[_0x1b33('0x32')],qs[_0x1b33('0x38')](_0x57a22c['query'][_0x1b33('0x38')]));_0x19b491[_0x1b33('0x36')]=_0x19b491[_0x1b33('0x36')][_0x1b33('0x39')]?_0x19b491[_0x1b33('0x36')]:_0x534541[_0x1b33('0x32')];if(!_0x57a22c[_0x1b33('0x34')][_0x1b33('0x3a')]('nolimit')){_0x19b491[_0x1b33('0x1e')]=qs[_0x1b33('0x1e')](_0x57a22c['query'][_0x1b33('0x1e')]);_0x19b491[_0x1b33('0x20')]=qs[_0x1b33('0x20')](_0x57a22c[_0x1b33('0x34')][_0x1b33('0x20')]);}_0x19b491[_0x1b33('0x3b')]=qs[_0x1b33('0x3c')](_0x57a22c[_0x1b33('0x34')][_0x1b33('0x3c')]);_0x19b491['where']=qs[_0x1b33('0x35')](_[_0x1b33('0x3d')](_0x57a22c[_0x1b33('0x34')],_0x534541[_0x1b33('0x35')]),_0x5a137b);if(_0x57a22c['query']['filter']){_0x19b491['where']=_[_0x1b33('0x3e')](_0x19b491['where'],{'$or':_[_0x1b33('0x2c')](_0x5a137b,function(_0x534c06){if(_0x534c06[_0x1b33('0x30')]!==_0x1b33('0x3f')){var _0x3ac6cb={};_0x3ac6cb[_0x534c06['name']]={'$like':'%'+_0x57a22c[_0x1b33('0x34')][_0x1b33('0x40')]+'%'};return _0x3ac6cb;}})});}_0x19b491=_[_0x1b33('0x3e')]({},_0x19b491,_0x57a22c['options']);var _0xd8d084={'where':_0x19b491[_0x1b33('0x41')]};return db['Migration'][_0x1b33('0x1f')](_0xd8d084)[_0x1b33('0x28')](function(_0xa2fe40){_0x5a22b7[_0x1b33('0x1f')]=_0xa2fe40;if(_0x57a22c[_0x1b33('0x34')][_0x1b33('0x42')]){_0x19b491[_0x1b33('0x43')]=[{'all':!![]}];}return db[_0x1b33('0x2d')][_0x1b33('0x44')](_0x19b491);})[_0x1b33('0x28')](function(_0xbd7381){_0x5a22b7[_0x1b33('0x45')]=_0xbd7381;return _0x5a22b7;})[_0x1b33('0x28')](respondWithFilteredResult(_0x56d8e3,_0x19b491))['catch'](handleError(_0x56d8e3,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 63cb24b..183eca1 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 _0x29c4=['moment','bluebird','path','rimraf','./migration.attributes','exports','Migration','migrations','util','../../config/logger','api'];(function(_0x3654cc,_0x365b5c){var _0x36929e=function(_0x63493a){while(--_0x63493a){_0x3654cc['push'](_0x3654cc['shift']());}};_0x36929e(++_0x365b5c);}(_0x29c4,0x8c));var _0x429c=function(_0x1e3db2,_0xc2a71e){_0x1e3db2=_0x1e3db2-0x0;var _0x5650c7=_0x29c4[_0x1e3db2];return _0x5650c7;};'use strict';var _=require('lodash');var util=require(_0x429c('0x0'));var logger=require(_0x429c('0x1'))(_0x429c('0x2'));var moment=require(_0x429c('0x3'));var BPromise=require(_0x429c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x429c('0x5'));var rimraf=require(_0x429c('0x6'));var config=require('../../config/environment');var attributes=require(_0x429c('0x7'));module[_0x429c('0x8')]=function(_0x59b85a,_0x5bd155){return _0x59b85a['define'](_0x429c('0x9'),attributes,{'tableName':_0x429c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cfd=['path','rimraf','exports','define','migrations','lodash','util','../../config/logger','api','bluebird'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x9cfd,0x163));var _0xd9cf=function(_0x32c919,_0x3172a6){_0x32c919=_0x32c919-0x0;var _0x5cfdc4=_0x9cfd[_0x32c919];return _0x5cfdc4;};'use strict';var _=require(_0xd9cf('0x0'));var util=require(_0xd9cf('0x1'));var logger=require(_0xd9cf('0x2'))(_0xd9cf('0x3'));var moment=require('moment');var BPromise=require(_0xd9cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9cf('0x5'));var rimraf=require(_0xd9cf('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xd9cf('0x7')]=function(_0x241a8a,_0x3169b7){return _0x241a8a[_0xd9cf('0x8')]('Migration',attributes,{'tableName':_0xd9cf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index c7c3c27..38159b0 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 _0xf4eb=['Migration,\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(_0x15542f,_0x3d79d6){var _0x3f2d03=function(_0x314be6){while(--_0x314be6){_0x15542f['push'](_0x15542f['shift']());}};_0x3f2d03(++_0x3d79d6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1bc62b,_0x27c0ed){_0x1bc62b=_0x1bc62b-0x0;var _0x31782f=_0xf4eb[_0x1bc62b];return _0x31782f;};'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')]('Migration,\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')]('Migration,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xd624=['client','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2269b2,_0x505734){var _0x1e6f69=function(_0x2f4475){while(--_0x2f4475){_0x2269b2['push'](_0x2269b2['shift']());}};_0x1e6f69(++_0x505734);}(_0xd624,0x124));var _0x4d62=function(_0x1572c6,_0x4252a2){_0x1572c6=_0x1572c6-0x0;var _0x2aee5f=_0xd624[_0x1572c6];return _0x2aee5f;};'use strict';var _=require(_0x4d62('0x0'));var util=require(_0x4d62('0x1'));var moment=require('moment');var BPromise=require(_0x4d62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d62('0x3'));var logger=require(_0x4d62('0x4'))(_0x4d62('0x5'));var config=require(_0x4d62('0x6'));var jayson=require(_0x4d62('0x7'));var client=jayson[_0x4d62('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba7a1,_0x133d24,_0x3d6f78){return new BPromise(function(_0x12bf3c,_0x1377c3){return client[_0x4d62('0x9')](_0x4ba7a1,_0x3d6f78)['then'](function(_0x19e6cb){logger[_0x4d62('0xa')](_0x4d62('0xb'),_0x133d24,_0x4d62('0xc'));logger['debug'](_0x4d62('0xd'),_0x133d24,_0x4d62('0xc'),JSON[_0x4d62('0xe')](_0x19e6cb));if(_0x19e6cb[_0x4d62('0xf')]){if(_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x10')]===0x1f4){logger[_0x4d62('0xf')](_0x4d62('0xb'),_0x133d24,_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);return _0x1377c3(_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);}logger['error'](_0x4d62('0xb'),_0x133d24,_0x19e6cb[_0x4d62('0xf')][_0x4d62('0x11')]);return _0x12bf3c(_0x19e6cb['error'][_0x4d62('0x11')]);}else{logger[_0x4d62('0xa')](_0x4d62('0xb'),_0x133d24,_0x4d62('0xc'));_0x12bf3c(_0x19e6cb[_0x4d62('0x12')][_0x4d62('0x11')]);}})[_0x4d62('0x13')](function(_0x55060d){logger['error'](_0x4d62('0xb'),_0x133d24,_0x55060d);_0x1377c3(_0x55060d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index af31660..b1d6f44 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 _0xbba1=['show','post','put','update','exports','multer','connect-timeout','express','../../components/auth/service','./network.controller','index','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbba1,0x17f));var _0x1bba=function(_0x27a37d,_0x1ed06b){_0x27a37d=_0x27a37d-0x0;var _0x318e0b=_0xbba1[_0x27a37d];return _0x318e0b;};'use strict';var multer=require(_0x1bba('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1bba('0x1'));var express=require(_0x1bba('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1bba('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bba('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x1bba('0x5')]);router[_0x1bba('0x6')](_0x1bba('0x7'),auth[_0x1bba('0x8')](),controller[_0x1bba('0x9')]);router[_0x1bba('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1bba('0xb')]('/:id',auth[_0x1bba('0x8')](),controller[_0x1bba('0xc')]);router['delete'](_0x1bba('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x1bba('0xd')]=router; \ No newline at end of file +var _0xd86a=['put','/:id','update','delete','destroy','multer','util','path','Router','fs-extra','../../config/environment','./network.controller','get','isAuthenticated','show','post','create'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd86a,0xf3));var _0xad86=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xd86a[_0x41d02a];return _0x4c3983;};'use strict';var multer=require(_0xad86('0x0'));var util=require(_0xad86('0x1'));var path=require(_0xad86('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad86('0x3')]();var fs_extra=require(_0xad86('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xad86('0x5'));var controller=require(_0xad86('0x6'));router[_0xad86('0x7')]('/',auth[_0xad86('0x8')](),controller['index']);router['get']('/:id',auth[_0xad86('0x8')](),controller[_0xad86('0x9')]);router[_0xad86('0xa')]('/',auth[_0xad86('0x8')](),controller[_0xad86('0xb')]);router[_0xad86('0xc')](_0xad86('0xd'),auth['isAuthenticated'](),controller[_0xad86('0xe')]);router[_0xad86('0xf')](_0xad86('0xd'),auth[_0xad86('0x8')](),controller[_0xad86('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a1fcc8f..223f1fa 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 _0x4115=['localnet','externip','stun','turn','STRING','ENUM'];(function(_0x54e66f,_0x5498b8){var _0x1ce79f=function(_0xbe0fbc){while(--_0xbe0fbc){_0x54e66f['push'](_0x54e66f['shift']());}};_0x1ce79f(++_0x5498b8);}(_0x4115,0x1eb));var _0x5411=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x4115[_0xfa634c];return _0x73e478;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5411('0x0')](_0x5411('0x1'),_0x5411('0x2'),_0x5411('0x3'),_0x5411('0x4'))},'value':{'type':Sequelize[_0x5411('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x5411('0x5')]}}; \ No newline at end of file +var _0x3ae8=['sequelize','exports','ENUM','localnet','externip','turn','STRING'];(function(_0x5005ba,_0x423ed1){var _0x21278c=function(_0x49799b){while(--_0x49799b){_0x5005ba['push'](_0x5005ba['shift']());}};_0x21278c(++_0x423ed1);}(_0x3ae8,0x103));var _0x83ae=function(_0x5d31ee,_0x183e43){_0x5d31ee=_0x5d31ee-0x0;var _0x21c2e6=_0x3ae8[_0x5d31ee];return _0x21c2e6;};'use strict';var Sequelize=require(_0x83ae('0x0'));module[_0x83ae('0x1')]={'type':{'type':Sequelize[_0x83ae('0x2')](_0x83ae('0x3'),_0x83ae('0x4'),'stun',_0x83ae('0x5'))},'value':{'type':Sequelize[_0x83ae('0x6')]},'username':{'type':Sequelize[_0x83ae('0x6')]},'password':{'type':Sequelize[_0x83ae('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d8a37ff..21bbdc4 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 _0x7422=['ejs','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','undefined','count','offset','limit','set','Content-Range','destroy','end','sendStatus','name','send','index','map','Network','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','include','findAll','rows','show','params','keys','includeAll','options','find','create','body','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','/etc/asterisk/turn_xcally.conf','Reload','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','server/files/templates/turn_multiple.ejs','util'];(function(_0x4c838b,_0x44f70){var _0x554f83=function(_0x592a06){while(--_0x592a06){_0x4c838b['push'](_0x4c838b['shift']());}};_0x554f83(++_0x44f70);}(_0x7422,0x1a8));var _0x2742=function(_0x545b63,_0x3f89a3){_0x545b63=_0x545b63-0x0;var _0x474d06=_0x7422[_0x545b63];return _0x474d06;};'use strict';var util=require(_0x2742('0x0'));var path=require('path');var ejs=require(_0x2742('0x1'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x2742('0x2'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x2742('0x3'));var client=jayson[_0x2742('0x4')][_0x2742('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x38fe09,_0x457ad6,_0x347519,_0x5d4c9f){return new Promise(function(_0x337160,_0x5dc310){var _0xdae326=_0x5d4c9f||client;return _0xdae326[_0x2742('0x6')](_0x38fe09,_0x347519)[_0x2742('0x7')](function(_0xfdc54d){logger[_0x2742('0x8')]('Network,\x20%s,\x20%s',_0x457ad6,_0x2742('0x9'));logger[_0x2742('0xa')](_0x2742('0xb'),_0x457ad6,_0x2742('0x9'),JSON[_0x2742('0xc')](_0xfdc54d));if(_0xfdc54d[_0x2742('0xd')]){if(_0xfdc54d['error'][_0x2742('0xe')]===0x1f4){logger[_0x2742('0xd')](_0x2742('0xf'),_0x457ad6,_0xfdc54d[_0x2742('0xd')][_0x2742('0x10')]);return _0x5dc310(_0xfdc54d[_0x2742('0xd')][_0x2742('0x10')]);}logger[_0x2742('0xd')]('Network,\x20%s,\x20%s',_0x457ad6,_0xfdc54d[_0x2742('0xd')][_0x2742('0x10')]);return _0x337160(_0xfdc54d[_0x2742('0xd')]['message']);}else{logger[_0x2742('0x8')](_0x2742('0xf'),_0x457ad6,_0x2742('0x9'));_0x337160(_0xfdc54d[_0x2742('0x11')][_0x2742('0x10')]);}})[_0x2742('0x12')](function(_0x23bd52){logger[_0x2742('0xd')](_0x2742('0xf'),_0x457ad6,_0x23bd52);_0x5dc310(_0x23bd52);});});}function respondWithResult(_0xba027,_0x450148){_0x450148=_0x450148||0xc8;return function(_0xdfd602){if(_0xdfd602){return _0xba027[_0x2742('0x13')](_0x450148)['json'](_0xdfd602);}};}function respondWithFilteredResult(_0x1adf9f,_0x3eb951){return function(_0x41168d){if(_0x41168d){var _0x5d08c5=typeof _0x3eb951['offset']==='undefined'&&typeof _0x3eb951['limit']===_0x2742('0x14');var _0x42b025=_0x41168d[_0x2742('0x15')];var _0x5178e0=_0x5d08c5?0x0:_0x3eb951[_0x2742('0x16')];var _0x2c418b=_0x5d08c5?_0x41168d['count']:_0x3eb951[_0x2742('0x16')]+_0x3eb951[_0x2742('0x17')];var _0x400764;if(_0x2c418b>=_0x42b025){_0x2c418b=_0x42b025;_0x400764=0xc8;}else{_0x400764=0xce;}_0x1adf9f['status'](_0x400764);return _0x1adf9f[_0x2742('0x18')](_0x2742('0x19'),_0x5178e0+'-'+_0x2c418b+'/'+_0x42b025)['json'](_0x41168d);}return null;};}function saveUpdates(_0x3f116d){return function(_0x2a07ae){if(_0x2a07ae){return _0x2a07ae['update'](_0x3f116d)['then'](function(_0x31baff){return _0x31baff;});}return null;};}function removeEntity(_0x5b8d4a){return function(_0x20d583){if(_0x20d583){return _0x20d583[_0x2742('0x1a')]()[_0x2742('0x7')](function(){_0x5b8d4a[_0x2742('0x13')](0xcc)[_0x2742('0x1b')]();});}};}function handleEntityNotFound(_0x3087b6){return function(_0x87699f){if(!_0x87699f){_0x3087b6[_0x2742('0x1c')](0x194);}return _0x87699f;};}function handleError(_0x288f78,_0x19207e){_0x19207e=_0x19207e||0x1f4;return function(_0x296bed){logger[_0x2742('0xd')](_0x296bed['stack']);if(_0x296bed[_0x2742('0x1d')]){delete _0x296bed['name'];}_0x288f78[_0x2742('0x13')](_0x19207e)[_0x2742('0x1e')](_0x296bed);};}exports[_0x2742('0x1f')]=function(_0x56b3f1,_0x2e1548){var _0x3d0c33={},_0x3afe08={},_0xb37627={'count':0x0,'rows':[]};var _0x7cdb11=_[_0x2742('0x20')](db[_0x2742('0x21')][_0x2742('0x22')],function(_0x12b93d){return{'name':_0x12b93d[_0x2742('0x23')],'type':_0x12b93d['type'][_0x2742('0x24')]};});_0x3afe08['model']=_[_0x2742('0x20')](_0x7cdb11,_0x2742('0x1d'));_0x3afe08[_0x2742('0x25')]=_['keys'](_0x56b3f1[_0x2742('0x25')]);_0x3afe08[_0x2742('0x26')]=_[_0x2742('0x27')](_0x3afe08['model'],_0x3afe08['query']);_0x3d0c33[_0x2742('0x28')]=_[_0x2742('0x27')](_0x3afe08[_0x2742('0x29')],qs['fields'](_0x56b3f1['query'][_0x2742('0x2a')]));_0x3d0c33[_0x2742('0x28')]=_0x3d0c33[_0x2742('0x28')][_0x2742('0x2b')]?_0x3d0c33['attributes']:_0x3afe08[_0x2742('0x29')];if(!_0x56b3f1[_0x2742('0x25')][_0x2742('0x2c')](_0x2742('0x2d'))){_0x3d0c33[_0x2742('0x17')]=qs[_0x2742('0x17')](_0x56b3f1[_0x2742('0x25')][_0x2742('0x17')]);_0x3d0c33['offset']=qs[_0x2742('0x16')](_0x56b3f1['query'][_0x2742('0x16')]);}_0x3d0c33['order']=qs['sort'](_0x56b3f1['query'][_0x2742('0x2e')]);_0x3d0c33[_0x2742('0x2f')]=qs['filters'](_[_0x2742('0x30')](_0x56b3f1[_0x2742('0x25')],_0x3afe08[_0x2742('0x26')]),_0x7cdb11);if(_0x56b3f1[_0x2742('0x25')]['filter']){_0x3d0c33[_0x2742('0x2f')]=_['merge'](_0x3d0c33['where'],{'$or':_[_0x2742('0x20')](_0x7cdb11,function(_0x7e7992){if(_0x7e7992[_0x2742('0x31')]!==_0x2742('0x32')){var _0x267ab7={};_0x267ab7[_0x7e7992[_0x2742('0x1d')]]={'$like':'%'+_0x56b3f1[_0x2742('0x25')][_0x2742('0x33')]+'%'};return _0x267ab7;}})});}_0x3d0c33=_[_0x2742('0x34')]({},_0x3d0c33,_0x56b3f1['options']);var _0x411901={'where':_0x3d0c33[_0x2742('0x2f')]};return db[_0x2742('0x21')][_0x2742('0x15')](_0x411901)[_0x2742('0x7')](function(_0x203726){_0xb37627[_0x2742('0x15')]=_0x203726;if(_0x56b3f1[_0x2742('0x25')]['includeAll']){_0x3d0c33[_0x2742('0x35')]=[{'all':!![]}];}return db[_0x2742('0x21')][_0x2742('0x36')](_0x3d0c33);})['then'](function(_0x564f52){_0xb37627[_0x2742('0x37')]=_0x564f52;return _0xb37627;})[_0x2742('0x7')](respondWithFilteredResult(_0x2e1548,_0x3d0c33))[_0x2742('0x12')](handleError(_0x2e1548,null));};exports[_0x2742('0x38')]=function(_0x437583,_0x42e9ed){var _0xe7b062={'raw':!![],'where':{'id':_0x437583[_0x2742('0x39')]['id']}},_0x33d830={};_0x33d830[_0x2742('0x29')]=_[_0x2742('0x3a')](db[_0x2742('0x21')][_0x2742('0x22')]);_0x33d830[_0x2742('0x25')]=_[_0x2742('0x3a')](_0x437583['query']);_0x33d830['filters']=_[_0x2742('0x27')](_0x33d830[_0x2742('0x29')],_0x33d830[_0x2742('0x25')]);_0xe7b062[_0x2742('0x28')]=_[_0x2742('0x27')](_0x33d830[_0x2742('0x29')],qs[_0x2742('0x2a')](_0x437583[_0x2742('0x25')][_0x2742('0x2a')]));_0xe7b062[_0x2742('0x28')]=_0xe7b062[_0x2742('0x28')]['length']?_0xe7b062[_0x2742('0x28')]:_0x33d830[_0x2742('0x29')];if(_0x437583[_0x2742('0x25')][_0x2742('0x3b')]){_0xe7b062[_0x2742('0x35')]=[{'all':!![]}];}_0xe7b062=_['merge']({},_0xe7b062,_0x437583[_0x2742('0x3c')]);return db[_0x2742('0x21')][_0x2742('0x3d')](_0xe7b062)[_0x2742('0x7')](handleEntityNotFound(_0x42e9ed,null))[_0x2742('0x7')](respondWithResult(_0x42e9ed,null))[_0x2742('0x12')](handleError(_0x42e9ed,null));};exports[_0x2742('0x3e')]=function(_0x4a4628,_0x2eb03d){var _0x3ad48c;return db[_0x2742('0x21')]['create'](_0x4a4628[_0x2742('0x3f')],{'raw':!![]})['then'](function(_0x3c9b58){_0x3ad48c=_0x3c9b58;return db[_0x2742('0x21')][_0x2742('0x36')]({'where':{'type':_0x4a4628[_0x2742('0x3f')][_0x2742('0x31')]},'raw':!![]});})[_0x2742('0x7')](function(_0x3939f9){if(_0x3ad48c[_0x2742('0x31')]['toUpperCase']()==_0x2742('0x40')){var _0xdd0687=fs[_0x2742('0x41')](path[_0x2742('0x42')](config[_0x2742('0x43')],'server/files/templates/stun_multiple.ejs'),_0x2742('0x44'));var _0x33ff11=ejs[_0x2742('0x45')](_0xdd0687,{'networks':_0x3939f9||[]});fs[_0x2742('0x46')](_0x2742('0x47'),_0x33ff11);return respondWithRpcPromise('Reload',_0x2742('0x3e'),{'module':_0x2742('0x48')});}else if(_0x3ad48c[_0x2742('0x31')][_0x2742('0x49')]()==_0x2742('0x4a')){var _0x26edab=fs[_0x2742('0x41')](path[_0x2742('0x42')](config[_0x2742('0x43')],'server/files/templates/turn_multiple.ejs'),_0x2742('0x44'));var _0x2462e2=ejs[_0x2742('0x45')](_0x26edab,{'networks':_0x3939f9||[]});fs[_0x2742('0x46')](_0x2742('0x4b'),_0x2462e2);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x3e'),{'module':_0x2742('0x48')});}else{var _0x3aeea9=fs[_0x2742('0x41')](path[_0x2742('0x42')](config[_0x2742('0x43')],'server/files/templates/network.ejs'),_0x2742('0x44'));var _0x50a35f=ejs[_0x2742('0x45')](_0x3aeea9,{'networks':_0x3939f9||[]});fs[_0x2742('0x46')](util[_0x2742('0x4d')](_0x2742('0x4e'),_0x4a4628[_0x2742('0x3f')]['type'][_0x2742('0x4f')]()),_0x50a35f);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x3e'),{'module':_0x2742('0x50')});}})[_0x2742('0x7')](function(){return _0x3ad48c;})[_0x2742('0x7')](respondWithResult(_0x2eb03d,0xc9))[_0x2742('0x12')](handleError(_0x2eb03d,null));};exports[_0x2742('0x51')]=function(_0x57a93,_0xbbab0f){var _0x2871bc;return db[_0x2742('0x21')][_0x2742('0x3d')]({'where':{'id':_0x57a93[_0x2742('0x39')]['id']}})[_0x2742('0x7')](handleEntityNotFound(_0xbbab0f,null))[_0x2742('0x7')](saveUpdates(_0x57a93[_0x2742('0x3f')],null))['then'](function(_0x477e67){if(_0x477e67){_0x2871bc=_0x477e67;return db[_0x2742('0x21')][_0x2742('0x36')]({'where':{'type':_0x2871bc['type']},'raw':!![]});}return null;})[_0x2742('0x7')](function(_0x473d79){if(_0x2871bc['type'][_0x2742('0x49')]()==_0x2742('0x40')){var _0x1798e3=fs['readFileSync'](path[_0x2742('0x42')](config[_0x2742('0x43')],_0x2742('0x52')),_0x2742('0x44'));var _0x566fcc=ejs[_0x2742('0x45')](_0x1798e3,{'networks':_0x473d79||[]});fs[_0x2742('0x46')](_0x2742('0x47'),_0x566fcc);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x2871bc[_0x2742('0x31')]['toUpperCase']()=='TURN'){var _0x31af5c=fs[_0x2742('0x41')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2742('0x44'));var _0x46a087=ejs[_0x2742('0x45')](_0x31af5c,{'networks':_0x473d79||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x46a087);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x51'),{'module':_0x2742('0x48')});}else{var _0x33d45e=fs[_0x2742('0x41')](path['join'](config['root'],_0x2742('0x53')),_0x2742('0x44'));var _0x312bd1=ejs['render'](_0x33d45e,{'networks':_0x473d79||[]});fs[_0x2742('0x46')](util[_0x2742('0x4d')](_0x2742('0x4e'),_0x57a93[_0x2742('0x3f')][_0x2742('0x31')][_0x2742('0x4f')]()),_0x312bd1);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x51'),{'module':_0x2742('0x50')});}})[_0x2742('0x7')](function(_0x212239){if(_0x212239){return _0x2871bc;}return null;})[_0x2742('0x7')](respondWithResult(_0xbbab0f,null))[_0x2742('0x12')](handleError(_0xbbab0f,null));};exports[_0x2742('0x1a')]=function(_0x477bbe,_0x122bb5){var _0x2c4afa;return db['Network'][_0x2742('0x3d')]({'where':{'id':_0x477bbe[_0x2742('0x39')]['id']}})['then'](function(_0x110896){_0x2c4afa=_0x110896;return _0x110896;})[_0x2742('0x7')](handleEntityNotFound(_0x122bb5,null))[_0x2742('0x7')](removeEntity(_0x122bb5,null))['then'](function(){if(_0x2c4afa){return db['Network'][_0x2742('0x36')]({'where':{'type':_0x2c4afa['type']},'raw':!![]});}})['then'](function(_0x3b2856){if(_0x2c4afa[_0x2742('0x31')]['toUpperCase']()==_0x2742('0x40')){var _0x300567=fs[_0x2742('0x41')](path['join'](config[_0x2742('0x43')],_0x2742('0x52')),_0x2742('0x44'));var _0x5269a1=ejs[_0x2742('0x45')](_0x300567,{'networks':_0x3b2856||[]});fs[_0x2742('0x46')]('/etc/asterisk/stun_xcally.conf',_0x5269a1);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x1a'),{'module':_0x2742('0x48')});}else if(_0x2c4afa[_0x2742('0x31')][_0x2742('0x49')]()=='TURN'){var _0x7ba2c1=fs[_0x2742('0x41')](path['join'](config[_0x2742('0x43')],_0x2742('0x54')),'utf8');var _0xe5ac96=ejs[_0x2742('0x45')](_0x7ba2c1,{'networks':_0x3b2856||[]});fs['writeFileSync'](_0x2742('0x4b'),_0xe5ac96);return respondWithRpcPromise(_0x2742('0x4c'),_0x2742('0x1a'),{'module':_0x2742('0x48')});}else{var _0x302b83=fs[_0x2742('0x41')](path['join'](config['root'],_0x2742('0x53')),_0x2742('0x44'));var _0x4ac50e=ejs[_0x2742('0x45')](_0x302b83,{'networks':_0x3b2856||[]});fs[_0x2742('0x46')](util[_0x2742('0x4d')](_0x2742('0x4e'),_0x2c4afa[_0x2742('0x31')][_0x2742('0x4f')]()),_0x4ac50e);return respondWithRpcPromise(_0x2742('0x4c'),'destroy',{'module':'chan_sip.so'});}})[_0x2742('0x12')](handleError(_0x122bb5,null));}; \ No newline at end of file +var _0x5d7e=['Content-Range','update','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Network','includeAll','findAll','rows','show','params','include','find','catch','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','util','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','undefined','limit','count','set'];(function(_0x32a773,_0x57b5c7){var _0x430dcb=function(_0x209f30){while(--_0x209f30){_0x32a773['push'](_0x32a773['shift']());}};_0x430dcb(++_0x57b5c7);}(_0x5d7e,0xe4));var _0xe5d7=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x5d7e[_0x4914e2];return _0x2dcd07;};'use strict';var util=require(_0xe5d7('0x0'));var path=require('path');var ejs=require(_0xe5d7('0x1'));var fs=require('fs');var _=require(_0xe5d7('0x2'));var qs=require(_0xe5d7('0x3'));var logger=require(_0xe5d7('0x4'))('api');var config=require(_0xe5d7('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe5d7('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29a744,_0x8ebf08,_0xae9189,_0x246a38){return new Promise(function(_0x2dd414,_0x268ea6){var _0x19ab66=_0x246a38||client;return _0x19ab66['request'](_0x29a744,_0xae9189)[_0xe5d7('0x7')](function(_0x1972d6){logger[_0xe5d7('0x8')](_0xe5d7('0x9'),_0x8ebf08,_0xe5d7('0xa'));logger[_0xe5d7('0xb')](_0xe5d7('0xc'),_0x8ebf08,_0xe5d7('0xa'),JSON[_0xe5d7('0xd')](_0x1972d6));if(_0x1972d6[_0xe5d7('0xe')]){if(_0x1972d6[_0xe5d7('0xe')][_0xe5d7('0xf')]===0x1f4){logger[_0xe5d7('0xe')](_0xe5d7('0x9'),_0x8ebf08,_0x1972d6[_0xe5d7('0xe')][_0xe5d7('0x10')]);return _0x268ea6(_0x1972d6['error'][_0xe5d7('0x10')]);}logger[_0xe5d7('0xe')](_0xe5d7('0x9'),_0x8ebf08,_0x1972d6[_0xe5d7('0xe')][_0xe5d7('0x10')]);return _0x2dd414(_0x1972d6[_0xe5d7('0xe')]['message']);}else{logger[_0xe5d7('0x8')](_0xe5d7('0x9'),_0x8ebf08,_0xe5d7('0xa'));_0x2dd414(_0x1972d6[_0xe5d7('0x11')][_0xe5d7('0x10')]);}})['catch'](function(_0x2f29e0){logger[_0xe5d7('0xe')]('Network,\x20%s,\x20%s',_0x8ebf08,_0x2f29e0);_0x268ea6(_0x2f29e0);});});}function respondWithResult(_0x1de6f3,_0x4ca237){_0x4ca237=_0x4ca237||0xc8;return function(_0x318fbd){if(_0x318fbd){return _0x1de6f3[_0xe5d7('0x12')](_0x4ca237)['json'](_0x318fbd);}};}function respondWithFilteredResult(_0x181296,_0x49b0ec){return function(_0x30d228){if(_0x30d228){var _0x496543=typeof _0x49b0ec[_0xe5d7('0x13')]===_0xe5d7('0x14')&&typeof _0x49b0ec[_0xe5d7('0x15')]===_0xe5d7('0x14');var _0x3dcdd1=_0x30d228[_0xe5d7('0x16')];var _0x7128f5=_0x496543?0x0:_0x49b0ec[_0xe5d7('0x13')];var _0x306b89=_0x496543?_0x30d228[_0xe5d7('0x16')]:_0x49b0ec[_0xe5d7('0x13')]+_0x49b0ec[_0xe5d7('0x15')];var _0x33518a;if(_0x306b89>=_0x3dcdd1){_0x306b89=_0x3dcdd1;_0x33518a=0xc8;}else{_0x33518a=0xce;}_0x181296[_0xe5d7('0x12')](_0x33518a);return _0x181296[_0xe5d7('0x17')](_0xe5d7('0x18'),_0x7128f5+'-'+_0x306b89+'/'+_0x3dcdd1)['json'](_0x30d228);}return null;};}function saveUpdates(_0x138e14){return function(_0x5db70d){if(_0x5db70d){return _0x5db70d[_0xe5d7('0x19')](_0x138e14)[_0xe5d7('0x7')](function(_0x38eef1){return _0x38eef1;});}return null;};}function removeEntity(_0x3964af){return function(_0xaa742){if(_0xaa742){return _0xaa742[_0xe5d7('0x1a')]()[_0xe5d7('0x7')](function(){_0x3964af[_0xe5d7('0x12')](0xcc)[_0xe5d7('0x1b')]();});}};}function handleEntityNotFound(_0x4d4dbe){return function(_0x1c2480){if(!_0x1c2480){_0x4d4dbe[_0xe5d7('0x1c')](0x194);}return _0x1c2480;};}function handleError(_0x52b090,_0x1bd550){_0x1bd550=_0x1bd550||0x1f4;return function(_0x3c298b){logger['error'](_0x3c298b[_0xe5d7('0x1d')]);if(_0x3c298b[_0xe5d7('0x1e')]){delete _0x3c298b['name'];}_0x52b090['status'](_0x1bd550)[_0xe5d7('0x1f')](_0x3c298b);};}exports['index']=function(_0x5714d2,_0x399dad){var _0x587d8b={},_0x4982b8={},_0x84f365={'count':0x0,'rows':[]};var _0x6be357=_[_0xe5d7('0x20')](db['Network'][_0xe5d7('0x21')],function(_0x296865){return{'name':_0x296865[_0xe5d7('0x22')],'type':_0x296865[_0xe5d7('0x23')][_0xe5d7('0x24')]};});_0x4982b8['model']=_[_0xe5d7('0x20')](_0x6be357,_0xe5d7('0x1e'));_0x4982b8[_0xe5d7('0x25')]=_[_0xe5d7('0x26')](_0x5714d2[_0xe5d7('0x25')]);_0x4982b8[_0xe5d7('0x27')]=_[_0xe5d7('0x28')](_0x4982b8['model'],_0x4982b8[_0xe5d7('0x25')]);_0x587d8b[_0xe5d7('0x29')]=_[_0xe5d7('0x28')](_0x4982b8[_0xe5d7('0x2a')],qs[_0xe5d7('0x2b')](_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x2b')]));_0x587d8b['attributes']=_0x587d8b[_0xe5d7('0x29')][_0xe5d7('0x2c')]?_0x587d8b[_0xe5d7('0x29')]:_0x4982b8[_0xe5d7('0x2a')];if(!_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x2d')](_0xe5d7('0x2e'))){_0x587d8b[_0xe5d7('0x15')]=qs[_0xe5d7('0x15')](_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x15')]);_0x587d8b['offset']=qs['offset'](_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x13')]);}_0x587d8b['order']=qs[_0xe5d7('0x2f')](_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x2f')]);_0x587d8b[_0xe5d7('0x30')]=qs[_0xe5d7('0x27')](_['pick'](_0x5714d2[_0xe5d7('0x25')],_0x4982b8['filters']),_0x6be357);if(_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x31')]){_0x587d8b[_0xe5d7('0x30')]=_[_0xe5d7('0x32')](_0x587d8b['where'],{'$or':_[_0xe5d7('0x20')](_0x6be357,function(_0x5cd15a){if(_0x5cd15a[_0xe5d7('0x23')]!==_0xe5d7('0x33')){var _0x5ce19e={};_0x5ce19e[_0x5cd15a[_0xe5d7('0x1e')]]={'$like':'%'+_0x5714d2[_0xe5d7('0x25')]['filter']+'%'};return _0x5ce19e;}})});}_0x587d8b=_[_0xe5d7('0x32')]({},_0x587d8b,_0x5714d2[_0xe5d7('0x34')]);var _0x4a5d6c={'where':_0x587d8b['where']};return db[_0xe5d7('0x35')][_0xe5d7('0x16')](_0x4a5d6c)[_0xe5d7('0x7')](function(_0x52041b){_0x84f365[_0xe5d7('0x16')]=_0x52041b;if(_0x5714d2[_0xe5d7('0x25')][_0xe5d7('0x36')]){_0x587d8b['include']=[{'all':!![]}];}return db[_0xe5d7('0x35')][_0xe5d7('0x37')](_0x587d8b);})[_0xe5d7('0x7')](function(_0xbf679a){_0x84f365[_0xe5d7('0x38')]=_0xbf679a;return _0x84f365;})[_0xe5d7('0x7')](respondWithFilteredResult(_0x399dad,_0x587d8b))['catch'](handleError(_0x399dad,null));};exports[_0xe5d7('0x39')]=function(_0x1267d3,_0x4ec36c){var _0x56fa0a={'raw':!![],'where':{'id':_0x1267d3[_0xe5d7('0x3a')]['id']}},_0x2b4d2c={};_0x2b4d2c['model']=_['keys'](db[_0xe5d7('0x35')][_0xe5d7('0x21')]);_0x2b4d2c[_0xe5d7('0x25')]=_['keys'](_0x1267d3[_0xe5d7('0x25')]);_0x2b4d2c['filters']=_['intersection'](_0x2b4d2c[_0xe5d7('0x2a')],_0x2b4d2c[_0xe5d7('0x25')]);_0x56fa0a['attributes']=_['intersection'](_0x2b4d2c[_0xe5d7('0x2a')],qs[_0xe5d7('0x2b')](_0x1267d3['query']['fields']));_0x56fa0a[_0xe5d7('0x29')]=_0x56fa0a['attributes'][_0xe5d7('0x2c')]?_0x56fa0a[_0xe5d7('0x29')]:_0x2b4d2c[_0xe5d7('0x2a')];if(_0x1267d3[_0xe5d7('0x25')][_0xe5d7('0x36')]){_0x56fa0a[_0xe5d7('0x3b')]=[{'all':!![]}];}_0x56fa0a=_[_0xe5d7('0x32')]({},_0x56fa0a,_0x1267d3[_0xe5d7('0x34')]);return db[_0xe5d7('0x35')][_0xe5d7('0x3c')](_0x56fa0a)['then'](handleEntityNotFound(_0x4ec36c,null))[_0xe5d7('0x7')](respondWithResult(_0x4ec36c,null))[_0xe5d7('0x3d')](handleError(_0x4ec36c,null));};exports[_0xe5d7('0x3e')]=function(_0x497164,_0x58fcd4){var _0x3138b5;return db['Network'][_0xe5d7('0x3e')](_0x497164[_0xe5d7('0x3f')],{'raw':!![]})[_0xe5d7('0x7')](function(_0x17fb2b){_0x3138b5=_0x17fb2b;return db['Network'][_0xe5d7('0x37')]({'where':{'type':_0x497164[_0xe5d7('0x3f')][_0xe5d7('0x23')]},'raw':!![]});})[_0xe5d7('0x7')](function(_0x2e1728){if(_0x3138b5[_0xe5d7('0x23')]['toUpperCase']()==_0xe5d7('0x40')){var _0x3c8a4e=fs[_0xe5d7('0x41')](path[_0xe5d7('0x42')](config[_0xe5d7('0x43')],_0xe5d7('0x44')),_0xe5d7('0x45'));var _0x5690cf=ejs[_0xe5d7('0x46')](_0x3c8a4e,{'networks':_0x2e1728||[]});fs[_0xe5d7('0x47')](_0xe5d7('0x48'),_0x5690cf);return respondWithRpcPromise(_0xe5d7('0x49'),'create',{'module':'res_stun_monitor.so'});}else if(_0x3138b5[_0xe5d7('0x23')][_0xe5d7('0x4a')]()=='TURN'){var _0x32dc73=fs['readFileSync'](path[_0xe5d7('0x42')](config[_0xe5d7('0x43')],'server/files/templates/turn_multiple.ejs'),_0xe5d7('0x45'));var _0x4fdc00=ejs['render'](_0x32dc73,{'networks':_0x2e1728||[]});fs[_0xe5d7('0x47')](_0xe5d7('0x4b'),_0x4fdc00);return respondWithRpcPromise('Reload',_0xe5d7('0x3e'),{'module':_0xe5d7('0x4c')});}else{var _0x359374=fs['readFileSync'](path[_0xe5d7('0x42')](config['root'],_0xe5d7('0x4d')),_0xe5d7('0x45'));var _0x364071=ejs[_0xe5d7('0x46')](_0x359374,{'networks':_0x2e1728||[]});fs[_0xe5d7('0x47')](util[_0xe5d7('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x497164[_0xe5d7('0x3f')]['type'][_0xe5d7('0x4f')]()),_0x364071);return respondWithRpcPromise('Reload',_0xe5d7('0x3e'),{'module':_0xe5d7('0x50')});}})[_0xe5d7('0x7')](function(){return _0x3138b5;})['then'](respondWithResult(_0x58fcd4,0xc9))['catch'](handleError(_0x58fcd4,null));};exports[_0xe5d7('0x19')]=function(_0x2bbc5b,_0xa284ab){var _0x49e5a4;return db[_0xe5d7('0x35')][_0xe5d7('0x3c')]({'where':{'id':_0x2bbc5b[_0xe5d7('0x3a')]['id']}})[_0xe5d7('0x7')](handleEntityNotFound(_0xa284ab,null))[_0xe5d7('0x7')](saveUpdates(_0x2bbc5b['body'],null))['then'](function(_0x1b14a9){if(_0x1b14a9){_0x49e5a4=_0x1b14a9;return db[_0xe5d7('0x35')][_0xe5d7('0x37')]({'where':{'type':_0x49e5a4[_0xe5d7('0x23')]},'raw':!![]});}return null;})[_0xe5d7('0x7')](function(_0x632eef){if(_0x49e5a4[_0xe5d7('0x23')]['toUpperCase']()==_0xe5d7('0x40')){var _0x2f4971=fs['readFileSync'](path['join'](config['root'],_0xe5d7('0x44')),'utf8');var _0x58bec3=ejs[_0xe5d7('0x46')](_0x2f4971,{'networks':_0x632eef||[]});fs[_0xe5d7('0x47')]('/etc/asterisk/stun_xcally.conf',_0x58bec3);return respondWithRpcPromise(_0xe5d7('0x49'),_0xe5d7('0x19'),{'module':'res_stun_monitor.so'});}else if(_0x49e5a4[_0xe5d7('0x23')][_0xe5d7('0x4a')]()==_0xe5d7('0x51')){var _0x4b241d=fs[_0xe5d7('0x41')](path[_0xe5d7('0x42')](config[_0xe5d7('0x43')],_0xe5d7('0x52')),_0xe5d7('0x45'));var _0x58dae5=ejs[_0xe5d7('0x46')](_0x4b241d,{'networks':_0x632eef||[]});fs[_0xe5d7('0x47')](_0xe5d7('0x4b'),_0x58dae5);return respondWithRpcPromise(_0xe5d7('0x49'),_0xe5d7('0x19'),{'module':_0xe5d7('0x4c')});}else{var _0x4b6dfe=fs[_0xe5d7('0x41')](path[_0xe5d7('0x42')](config['root'],_0xe5d7('0x4d')),_0xe5d7('0x45'));var _0x26bdc3=ejs[_0xe5d7('0x46')](_0x4b6dfe,{'networks':_0x632eef||[]});fs[_0xe5d7('0x47')](util[_0xe5d7('0x4e')](_0xe5d7('0x53'),_0x2bbc5b['body'][_0xe5d7('0x23')]['toLowerCase']()),_0x26bdc3);return respondWithRpcPromise(_0xe5d7('0x49'),_0xe5d7('0x19'),{'module':_0xe5d7('0x50')});}})[_0xe5d7('0x7')](function(_0x59aa7b){if(_0x59aa7b){return _0x49e5a4;}return null;})[_0xe5d7('0x7')](respondWithResult(_0xa284ab,null))[_0xe5d7('0x3d')](handleError(_0xa284ab,null));};exports[_0xe5d7('0x1a')]=function(_0x105d63,_0x39badb){var _0x55ab48;return db['Network'][_0xe5d7('0x3c')]({'where':{'id':_0x105d63[_0xe5d7('0x3a')]['id']}})['then'](function(_0x4dfc5e){_0x55ab48=_0x4dfc5e;return _0x4dfc5e;})['then'](handleEntityNotFound(_0x39badb,null))[_0xe5d7('0x7')](removeEntity(_0x39badb,null))['then'](function(){if(_0x55ab48){return db['Network'][_0xe5d7('0x37')]({'where':{'type':_0x55ab48['type']},'raw':!![]});}})[_0xe5d7('0x7')](function(_0x1c3df2){if(_0x55ab48[_0xe5d7('0x23')][_0xe5d7('0x4a')]()==_0xe5d7('0x40')){var _0x375e86=fs['readFileSync'](path['join'](config[_0xe5d7('0x43')],_0xe5d7('0x44')),_0xe5d7('0x45'));var _0x51d604=ejs[_0xe5d7('0x46')](_0x375e86,{'networks':_0x1c3df2||[]});fs[_0xe5d7('0x47')](_0xe5d7('0x48'),_0x51d604);return respondWithRpcPromise(_0xe5d7('0x49'),_0xe5d7('0x1a'),{'module':_0xe5d7('0x4c')});}else if(_0x55ab48[_0xe5d7('0x23')][_0xe5d7('0x4a')]()=='TURN'){var _0x13564f=fs[_0xe5d7('0x41')](path[_0xe5d7('0x42')](config[_0xe5d7('0x43')],_0xe5d7('0x52')),_0xe5d7('0x45'));var _0x3272f5=ejs[_0xe5d7('0x46')](_0x13564f,{'networks':_0x1c3df2||[]});fs[_0xe5d7('0x47')](_0xe5d7('0x4b'),_0x3272f5);return respondWithRpcPromise(_0xe5d7('0x49'),_0xe5d7('0x1a'),{'module':_0xe5d7('0x4c')});}else{var _0x323654=fs[_0xe5d7('0x41')](path[_0xe5d7('0x42')](config[_0xe5d7('0x43')],_0xe5d7('0x4d')),'utf8');var _0x229244=ejs[_0xe5d7('0x46')](_0x323654,{'networks':_0x1c3df2||[]});fs['writeFileSync'](util[_0xe5d7('0x4e')](_0xe5d7('0x53'),_0x55ab48[_0xe5d7('0x23')]['toLowerCase']()),_0x229244);return respondWithRpcPromise('Reload',_0xe5d7('0x1a'),{'module':_0xe5d7('0x50')});}})[_0xe5d7('0x3d')](handleError(_0x39badb,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 617d8b5..77c87f7 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 _0x222f=['define','network','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x14bed2,_0x37394d){var _0x59321c=function(_0x169310){while(--_0x169310){_0x14bed2['push'](_0x14bed2['shift']());}};_0x59321c(++_0x37394d);}(_0x222f,0x1a4));var _0xf222=function(_0x1090f8,_0xd83a11){_0x1090f8=_0x1090f8-0x0;var _0x180524=_0x222f[_0x1090f8];return _0x180524;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf222('0x4'));var fs=require('fs');var path=require(_0xf222('0x5'));var rimraf=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var attributes=require('./network.attributes');module[_0xf222('0x8')]=function(_0x54a758,_0x112e6d){return _0x54a758[_0xf222('0x9')]('Network',attributes,{'tableName':_0xf222('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3140=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0xe94e88,_0x1c0c18){var _0x4739dc=function(_0x55c6f6){while(--_0x55c6f6){_0xe94e88['push'](_0xe94e88['shift']());}};_0x4739dc(++_0x1c0c18);}(_0x3140,0xaf));var _0x0314=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0x3140[_0x3f553b];return _0x183c4e;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0314('0x4'));var fs=require('fs');var path=require(_0x0314('0x5'));var rimraf=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var attributes=require(_0x0314('0x8'));module[_0x0314('0x9')]=function(_0x9e308d,_0xf87d26){return _0x9e308d[_0x0314('0xa')](_0x0314('0xb'),attributes,{'tableName':_0x0314('0xc'),'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 92caf64..88316e7 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x273bb8,_0x4a6e1f){_0x273bb8=_0x273bb8-0x0;var _0x501600=_0x7a54[_0x273bb8];return _0x501600;};'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 _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(_0x3f45be,_0xf30f3e){_0x3f45be=_0x3f45be-0x0;var _0x3b6e7e=_0x7a54[_0x3f45be];return _0x3b6e7e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 6bd3f49..57e74ba 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 _0xcbf8=['getApplications','/:id/interactions','/:id/users','getAgents','post','addAnswer','/:id/notify','notify','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbf8,0x1aa));var _0x8cbf=function(_0x11d1f5,_0x27e54a){_0x11d1f5=_0x11d1f5-0x0;var _0x31c493=_0xcbf8[_0x11d1f5];return _0x31c493;};'use strict';var multer=require(_0x8cbf('0x0'));var util=require('util');var path=require(_0x8cbf('0x1'));var timeout=require(_0x8cbf('0x2'));var express=require(_0x8cbf('0x3'));var router=express[_0x8cbf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8cbf('0x5'));var interaction=require(_0x8cbf('0x6'));var config=require(_0x8cbf('0x7'));var controller=require(_0x8cbf('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8cbf('0x9')]);router[_0x8cbf('0xa')]('/describe',auth[_0x8cbf('0xb')](),controller[_0x8cbf('0xc')]);router[_0x8cbf('0xa')]('/:id',auth[_0x8cbf('0xb')](),controller[_0x8cbf('0xd')]);router[_0x8cbf('0xa')](_0x8cbf('0xe'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0xf')]);router[_0x8cbf('0xa')](_0x8cbf('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x8cbf('0x11'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x12')]);router[_0x8cbf('0xa')](_0x8cbf('0x13'),auth[_0x8cbf('0xb')](),controller['getInteractions']);router['get'](_0x8cbf('0x14'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x15')]);router[_0x8cbf('0x16')]('/',auth[_0x8cbf('0xb')](),controller['create']);router[_0x8cbf('0x16')](_0x8cbf('0xe'),auth[_0x8cbf('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x17')]);router['post'](_0x8cbf('0x18'),controller[_0x8cbf('0x19')]);router['post'](_0x8cbf('0x11'),auth[_0x8cbf('0xb')](),controller['addApplications']);router[_0x8cbf('0x16')](_0x8cbf('0x14'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x1a')]);router[_0x8cbf('0x16')](_0x8cbf('0x1b'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x1c')]);router[_0x8cbf('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x8cbf('0x1e')]);router[_0x8cbf('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x8cbf('0x20')]);router[_0x8cbf('0x1f')](_0x8cbf('0xe'),auth['isAuthenticated'](),controller[_0x8cbf('0x21')]);router[_0x8cbf('0x1f')](_0x8cbf('0x10'),auth[_0x8cbf('0xb')](),controller[_0x8cbf('0x22')]);router[_0x8cbf('0x1f')](_0x8cbf('0x14'),auth['isAuthenticated'](),controller[_0x8cbf('0x23')]);module[_0x8cbf('0x24')]=router; \ No newline at end of file +var _0xd32c=['addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','put','/:id','delete','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','get','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','getInteractions','/:id/users','getAgents','post'];(function(_0x2c977c,_0x3631eb){var _0x4c001d=function(_0x5a3289){while(--_0x5a3289){_0x2c977c['push'](_0x2c977c['shift']());}};_0x4c001d(++_0x3631eb);}(_0xd32c,0x1c7));var _0xcd32=function(_0x47f07d,_0x195757){_0x47f07d=_0x47f07d-0x0;var _0x3fbb32=_0xd32c[_0x47f07d];return _0x3fbb32;};'use strict';var multer=require(_0xcd32('0x0'));var util=require(_0xcd32('0x1'));var path=require('path');var timeout=require(_0xcd32('0x2'));var express=require(_0xcd32('0x3'));var router=express[_0xcd32('0x4')]();var fs_extra=require(_0xcd32('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd32('0x6'));var config=require(_0xcd32('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcd32('0x8')]);router['get'](_0xcd32('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xcd32('0xa')]('/:id',auth[_0xcd32('0xb')](),controller[_0xcd32('0xc')]);router['get'](_0xcd32('0xd'),auth[_0xcd32('0xb')](),controller[_0xcd32('0xe')]);router[_0xcd32('0xa')](_0xcd32('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xcd32('0xa')]('/:id/applications',auth[_0xcd32('0xb')](),controller[_0xcd32('0x10')]);router[_0xcd32('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xcd32('0x11')]);router[_0xcd32('0xa')](_0xcd32('0x12'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x13')]);router[_0xcd32('0x14')]('/',auth[_0xcd32('0xb')](),controller['create']);router['post'](_0xcd32('0xd'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x15')]);router['post']('/:id/canned_answers',auth[_0xcd32('0xb')](),controller[_0xcd32('0x16')]);router['post']('/:id/notify',controller[_0xcd32('0x17')]);router[_0xcd32('0x14')](_0xcd32('0x18'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x19')]);router[_0xcd32('0x14')](_0xcd32('0x12'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x1a')]);router['post'](_0xcd32('0x1b'),auth[_0xcd32('0xb')](),controller['send']);router[_0xcd32('0x1c')](_0xcd32('0x1d'),auth[_0xcd32('0xb')](),controller['update']);router[_0xcd32('0x1e')](_0xcd32('0x1d'),auth[_0xcd32('0xb')](),controller['destroy']);router[_0xcd32('0x1e')](_0xcd32('0xd'),auth['isAuthenticated'](),controller[_0xcd32('0x1f')]);router[_0xcd32('0x1e')](_0xcd32('0xf'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x20')]);router[_0xcd32('0x1e')](_0xcd32('0x12'),auth[_0xcd32('0xb')](),controller[_0xcd32('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d8124bf..c79f7ea 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 _0x0b9d=['mandatoryDisposition','sequelize','randomstring','STRING','generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x26b560,_0x5c1806){var _0xbdabe6=function(_0x1b5154){while(--_0x1b5154){_0x26b560['push'](_0x26b560['shift']());}};_0xbdabe6(++_0x5c1806);}(_0x0b9d,0x1f0));var _0xd0b9=function(_0x293462,_0xec9688){_0x293462=_0x293462-0x0;var _0x245683=_0x0b9d[_0x293462];return _0x245683;};'use strict';var Sequelize=require(_0xd0b9('0x0'));var rs=require(_0xd0b9('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd0b9('0x2')]},'token':{'type':Sequelize[_0xd0b9('0x2')],'defaultValue':function(){return rs[_0xd0b9('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd0b9('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd0b9('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0b9('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0b9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd0b9('0x2')]},'queueTransfer':{'type':Sequelize[_0xd0b9('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0b9('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd0b9('0x4')],'defaultValue':![],'comment':_0xd0b9('0x6'),'set':function(_0x4a4597){if(!_0x4a4597)this[_0xd0b9('0x7')]('mandatoryDispositionPauseId',null);this[_0xd0b9('0x7')](_0xd0b9('0x8'),_0x4a4597);}}}; \ No newline at end of file +var _0x61f8=['STRING','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','name'];(function(_0x431e3f,_0x3b5e6a){var _0xb714a4=function(_0x19d2bc){while(--_0x19d2bc){_0x431e3f['push'](_0x431e3f['shift']());}};_0xb714a4(++_0x3b5e6a);}(_0x61f8,0x152));var _0x861f=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x61f8[_0x367336];return _0x3423a7;};'use strict';var Sequelize=require(_0x861f('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x861f('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x861f('0x2')],'defaultValue':function(){return rs[_0x861f('0x3')]();}},'replyUri':{'type':Sequelize[_0x861f('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x861f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x861f('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x861f('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x861f('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x861f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x861f('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x861f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x861f('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x861f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x861f('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x861f('0x5')],'defaultValue':![],'comment':_0x861f('0x7'),'set':function(_0x17ab4f){if(!_0x17ab4f)this[_0x861f('0x8')]('mandatoryDispositionPauseId',null);this[_0x861f('0x8')](_0x861f('0x9'),_0x17ab4f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 2507047..c603c3a 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 _0x2209=['code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','UserProfileResource','end','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','name','options','includeAll','include','findAll','rows','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','OpenchannelAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','openchannel','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','OpenchannelApplication','applications','list','priority','asc','account','Applications','Contacts','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','lastName','interaction','created','push','*,*,*,*','OpenchannelMessage','UserId','User','unshift','waitForTheAssignedAgent','startRouting','Start','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2209,0x95));var _0x9220=function(_0x236a6d,_0x137a0f){_0x236a6d=_0x236a6d-0x0;var _0x579092=_0x2209[_0x236a6d];return _0x579092;};'use strict';var emlformat=require(_0x9220('0x0'));var rimraf=require(_0x9220('0x1'));var zipdir=require(_0x9220('0x2'));var jsonpatch=require(_0x9220('0x3'));var rp=require(_0x9220('0x4'));var moment=require('moment');var BPromise=require(_0x9220('0x5'));var Mustache=require('mustache');var util=require(_0x9220('0x6'));var path=require(_0x9220('0x7'));var sox=require(_0x9220('0x8'));var csv=require(_0x9220('0x9'));var ejs=require(_0x9220('0xa'));var fs=require('fs');var fs_extra=require(_0x9220('0xb'));var _=require(_0x9220('0xc'));var squel=require(_0x9220('0xd'));var crypto=require(_0x9220('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9220('0xf'));var toCsv=require(_0x9220('0x9'));var querystring=require('querystring');var Papa=require(_0x9220('0x10'));var Redis=require(_0x9220('0x11'));var authService=require(_0x9220('0x12'));var qs=require(_0x9220('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9220('0x14'));var logger=require(_0x9220('0x15'))(_0x9220('0x16'));var utils=require(_0x9220('0x17'));var config=require(_0x9220('0x18'));var licenseUtil=require(_0x9220('0x19'));var db=require(_0x9220('0x1a'))['db'];config[_0x9220('0x1b')]=_['defaults'](config[_0x9220('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9220('0x1c'))(new Redis(config['redis']));require(_0x9220('0x1d'))['register'](socket);var jayson=require(_0x9220('0x1e'));var client=jayson[_0x9220('0x1f')][_0x9220('0x20')]({'port':0x232c});var client9002=jayson[_0x9220('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe2c1,_0x1f484b,_0x4898c5,_0x577bd8){return new BPromise(function(_0x3c3473,_0x559581){var _0x388089=_0x577bd8||client;return _0x388089[_0x9220('0x21')](_0x3fe2c1,_0x4898c5)[_0x9220('0x22')](function(_0x56e0c8){logger[_0x9220('0x23')](_0x9220('0x24'),_0x1f484b,'request\x20sent');logger[_0x9220('0x25')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1f484b,'request\x20sent',JSON[_0x9220('0x26')](_0x56e0c8));if(_0x56e0c8[_0x9220('0x27')]){if(_0x56e0c8[_0x9220('0x27')][_0x9220('0x28')]===0x1f4){logger[_0x9220('0x27')](_0x9220('0x24'),_0x1f484b,_0x56e0c8[_0x9220('0x27')][_0x9220('0x29')]);return _0x559581(_0x56e0c8[_0x9220('0x27')][_0x9220('0x29')]);}logger[_0x9220('0x27')](_0x9220('0x24'),_0x1f484b,_0x56e0c8[_0x9220('0x27')]['message']);return _0x3c3473(_0x56e0c8[_0x9220('0x27')][_0x9220('0x29')]);}else{logger[_0x9220('0x23')](_0x9220('0x24'),_0x1f484b,'request\x20sent');_0x3c3473(_0x56e0c8[_0x9220('0x2a')][_0x9220('0x29')]);}})[_0x9220('0x2b')](function(_0x284ed7){logger[_0x9220('0x27')](_0x9220('0x24'),_0x1f484b,_0x284ed7);_0x559581(_0x284ed7);});});}function respondWithStatusCode(_0x5902d2,_0x959dc0){_0x959dc0=_0x959dc0||0xcc;return function(_0x3ca360){if(_0x3ca360){return _0x5902d2[_0x9220('0x2c')](_0x959dc0);}return _0x5902d2[_0x9220('0x2d')](_0x959dc0)['end']();};}function respondWithResult(_0x5e6918,_0x330268){_0x330268=_0x330268||0xc8;return function(_0x3ee192){if(_0x3ee192){return _0x5e6918[_0x9220('0x2d')](_0x330268)['json'](_0x3ee192);}};}function respondWithFilteredResult(_0x57bcb3,_0x3ad172){return function(_0x2bf439){if(_0x2bf439){var _0x51cf57=typeof _0x3ad172[_0x9220('0x2e')]===_0x9220('0x2f')&&typeof _0x3ad172[_0x9220('0x30')]==='undefined';var _0x18bb7d=_0x2bf439[_0x9220('0x31')];var _0x1e23d1=_0x51cf57?0x0:_0x3ad172[_0x9220('0x2e')];var _0x14fee4=_0x51cf57?_0x2bf439[_0x9220('0x31')]:_0x3ad172[_0x9220('0x2e')]+_0x3ad172[_0x9220('0x30')];var _0x2a0797;if(_0x14fee4>=_0x18bb7d){_0x14fee4=_0x18bb7d;_0x2a0797=0xc8;}else{_0x2a0797=0xce;}_0x57bcb3[_0x9220('0x2d')](_0x2a0797);return _0x57bcb3['set'](_0x9220('0x32'),_0x1e23d1+'-'+_0x14fee4+'/'+_0x18bb7d)[_0x9220('0x33')](_0x2bf439);}return null;};}function patchUpdates(_0x5e4df8){return function(_0x4a400a){try{jsonpatch[_0x9220('0x34')](_0x4a400a,_0x5e4df8,!![]);}catch(_0x5dfae2){return BPromise[_0x9220('0x35')](_0x5dfae2);}return _0x4a400a[_0x9220('0x36')]();};}function saveUpdates(_0xa7f534,_0x4110c8){return function(_0x44bece){if(_0x44bece){return _0x44bece[_0x9220('0x37')](_0xa7f534)['then'](function(_0xac087b){return _0xac087b;});}return null;};}function removeEntity(_0x68702,_0xfb77d1){return function(_0x206c05){if(_0x206c05){return _0x206c05[_0x9220('0x38')]()[_0x9220('0x22')](function(){var _0x184802=_0x206c05['get']({'plain':!![]});var _0x589d05='OpenchannelAccounts';return db[_0x9220('0x39')]['destroy']({'where':{'type':_0x589d05,'resourceId':_0x184802['id']}})[_0x9220('0x22')](function(){return _0x206c05;});})[_0x9220('0x22')](function(){_0x68702[_0x9220('0x2d')](0xcc)[_0x9220('0x3a')]();});}};}function handleEntityNotFound(_0x4c7294,_0x2ffbb1){return function(_0x3caa3a){if(!_0x3caa3a){_0x4c7294[_0x9220('0x2c')](0x194);}return _0x3caa3a;};}function handleError(_0x1b8893,_0x2441d9){_0x2441d9=_0x2441d9||0x1f4;return function(_0x19b806){logger[_0x9220('0x27')](_0x19b806[_0x9220('0x3b')]);if(_0x19b806['name']){delete _0x19b806['name'];}_0x1b8893[_0x9220('0x2d')](_0x2441d9)[_0x9220('0x3c')](_0x19b806);};}exports[_0x9220('0x3d')]=function(_0x26e64b,_0x1d94fe){var _0x59bfbf={'include':[{'model':db[_0x9220('0x3e')],'as':_0x9220('0x3f')}]},_0x588b62={},_0x28064b={'count':0x0,'rows':[]};var _0x2d5390=_[_0x9220('0x40')](db[_0x9220('0x41')][_0x9220('0x42')],function(_0x3f1d9e){return{'name':_0x3f1d9e[_0x9220('0x43')],'type':_0x3f1d9e['type'][_0x9220('0x44')]};});_0x588b62[_0x9220('0x45')]=_[_0x9220('0x40')](_0x2d5390,'name');_0x588b62[_0x9220('0x46')]=_[_0x9220('0x47')](_0x26e64b[_0x9220('0x46')]);_0x588b62[_0x9220('0x48')]=_[_0x9220('0x49')](_0x588b62['model'],_0x588b62[_0x9220('0x46')]);_0x59bfbf[_0x9220('0x4a')]=_[_0x9220('0x49')](_0x588b62[_0x9220('0x45')],qs[_0x9220('0x4b')](_0x26e64b[_0x9220('0x46')][_0x9220('0x4b')]));_0x59bfbf[_0x9220('0x4a')]=_0x59bfbf['attributes'][_0x9220('0x4c')]?_0x59bfbf[_0x9220('0x4a')]:_0x588b62['model'];if(!_0x26e64b[_0x9220('0x46')][_0x9220('0x4d')](_0x9220('0x4e'))){_0x59bfbf['limit']=qs[_0x9220('0x30')](_0x26e64b['query'][_0x9220('0x30')]);_0x59bfbf[_0x9220('0x2e')]=qs[_0x9220('0x2e')](_0x26e64b[_0x9220('0x46')][_0x9220('0x2e')]);}_0x59bfbf[_0x9220('0x4f')]=qs[_0x9220('0x50')](_0x26e64b[_0x9220('0x46')][_0x9220('0x50')]);_0x59bfbf['where']=qs[_0x9220('0x48')](_[_0x9220('0x51')](_0x26e64b[_0x9220('0x46')],_0x588b62[_0x9220('0x48')]),_0x2d5390);if(_0x26e64b[_0x9220('0x46')][_0x9220('0x52')]){_0x59bfbf['where']=_[_0x9220('0x53')](_0x59bfbf[_0x9220('0x54')],{'$or':_[_0x9220('0x40')](_0x2d5390,function(_0xd31d0f){if(_0xd31d0f[_0x9220('0x55')]!==_0x9220('0x56')){var _0x1b8ca3={};_0x1b8ca3[_0xd31d0f[_0x9220('0x57')]]={'$like':'%'+_0x26e64b[_0x9220('0x46')][_0x9220('0x52')]+'%'};return _0x1b8ca3;}})});}_0x59bfbf=_[_0x9220('0x53')]({},_0x59bfbf,_0x26e64b[_0x9220('0x58')]);var _0x3ed09b={'where':_0x59bfbf[_0x9220('0x54')]};return db['OpenchannelAccount'][_0x9220('0x31')](_0x3ed09b)[_0x9220('0x22')](function(_0x50019d){_0x28064b[_0x9220('0x31')]=_0x50019d;if(_0x26e64b[_0x9220('0x46')][_0x9220('0x59')]){_0x59bfbf[_0x9220('0x5a')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x9220('0x5b')](_0x59bfbf);})['then'](function(_0x174464){_0x28064b[_0x9220('0x5c')]=_0x174464;return _0x28064b;})[_0x9220('0x22')](respondWithFilteredResult(_0x1d94fe,_0x59bfbf))[_0x9220('0x2b')](handleError(_0x1d94fe,null));};exports[_0x9220('0x5d')]=function(_0x4f03c2,_0x556fc2){var _0x1c7f43={'raw':![],'where':{'id':_0x4f03c2['params']['id']},'include':[{'model':db[_0x9220('0x3e')],'as':'mandatoryDispositionPause'}]},_0x39a832={};_0x39a832['model']=_[_0x9220('0x47')](db['OpenchannelAccount'][_0x9220('0x42')]);_0x39a832[_0x9220('0x46')]=_[_0x9220('0x47')](_0x4f03c2[_0x9220('0x46')]);_0x39a832['filters']=_[_0x9220('0x49')](_0x39a832[_0x9220('0x45')],_0x39a832['query']);_0x1c7f43[_0x9220('0x4a')]=_['intersection'](_0x39a832['model'],qs['fields'](_0x4f03c2[_0x9220('0x46')][_0x9220('0x4b')]));_0x1c7f43[_0x9220('0x4a')]=_0x1c7f43[_0x9220('0x4a')][_0x9220('0x4c')]?_0x1c7f43['attributes']:_0x39a832['model'];if(_0x4f03c2['query'][_0x9220('0x59')]){_0x1c7f43[_0x9220('0x5a')]=[{'all':!![]}];}_0x1c7f43=_[_0x9220('0x53')]({},_0x1c7f43,_0x4f03c2[_0x9220('0x58')]);return db['OpenchannelAccount'][_0x9220('0x5e')](_0x1c7f43)[_0x9220('0x22')](handleEntityNotFound(_0x556fc2,null))[_0x9220('0x22')](respondWithResult(_0x556fc2,null))[_0x9220('0x2b')](handleError(_0x556fc2,null));};exports[_0x9220('0x5f')]=function(_0x289955,_0x383164){return db['OpenchannelAccount'][_0x9220('0x5f')](_0x289955[_0x9220('0x60')],{})[_0x9220('0x22')](function(_0x1aef8f){var _0x58ee2b=_0x289955[_0x9220('0x61')][_0x9220('0x62')]({'plain':!![]});if(!_0x58ee2b)throw new Error(_0x9220('0x63'));if(_0x58ee2b[_0x9220('0x64')]===_0x9220('0x61')){var _0x133bfa=_0x1aef8f[_0x9220('0x62')]({'plain':!![]});var _0xbfac16=_0x9220('0x65');return db['UserProfileSection'][_0x9220('0x5e')]({'where':{'name':_0xbfac16,'userProfileId':_0x58ee2b['userProfileId']},'raw':!![]})[_0x9220('0x22')](function(_0x312f18){if(_0x312f18&&_0x312f18[_0x9220('0x66')]===0x0){return db[_0x9220('0x39')][_0x9220('0x5f')]({'name':_0x133bfa[_0x9220('0x57')],'resourceId':_0x133bfa['id'],'type':_0x312f18[_0x9220('0x57')],'sectionId':_0x312f18['id']},{})[_0x9220('0x22')](function(){return _0x1aef8f;});}else{return _0x1aef8f;}})[_0x9220('0x2b')](function(_0x581dfe){logger[_0x9220('0x27')](_0x9220('0x67'),_0x581dfe);throw _0x581dfe;});}return _0x1aef8f;})[_0x9220('0x22')](respondWithResult(_0x383164,0xc9))[_0x9220('0x2b')](handleError(_0x383164,null));};exports[_0x9220('0x37')]=function(_0x14bfdd,_0x52351f){if(_0x14bfdd[_0x9220('0x60')]['id']){delete _0x14bfdd[_0x9220('0x60')]['id'];}return db[_0x9220('0x41')][_0x9220('0x5e')]({'where':{'id':_0x14bfdd[_0x9220('0x68')]['id']},'include':[{'model':db[_0x9220('0x3e')],'as':_0x9220('0x3f')}]})[_0x9220('0x22')](handleEntityNotFound(_0x52351f,null))[_0x9220('0x22')](saveUpdates(_0x14bfdd['body'],null))[_0x9220('0x22')](respondWithResult(_0x52351f,null))[_0x9220('0x2b')](handleError(_0x52351f,null));};exports[_0x9220('0x38')]=function(_0x265416,_0x357c4a){return db[_0x9220('0x41')][_0x9220('0x5e')]({'where':{'id':_0x265416[_0x9220('0x68')]['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x357c4a,null))[_0x9220('0x22')](removeEntity(_0x357c4a,null))[_0x9220('0x2b')](handleError(_0x357c4a,null));};exports['describe']=function(_0x7dc900,_0x12d0a4){return db[_0x9220('0x41')]['describe']()[_0x9220('0x22')](respondWithResult(_0x12d0a4,null))[_0x9220('0x2b')](handleError(_0x12d0a4,null));};exports[_0x9220('0x69')]=function(_0x1f5b6c,_0x5d724f,_0x52149f){if(_0x1f5b6c[_0x9220('0x60')]['id']){delete _0x1f5b6c[_0x9220('0x60')]['id'];}return db['OpenchannelAccount'][_0x9220('0x5e')]({'where':{'id':_0x1f5b6c[_0x9220('0x68')]['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x5d724f,null))[_0x9220('0x22')](function(_0x47309a){if(_0x47309a){_0x1f5b6c[_0x9220('0x60')][_0x9220('0x6a')]=_0x47309a['id'];return db[_0x9220('0x6b')][_0x9220('0x5f')](_0x1f5b6c[_0x9220('0x60')]);}})[_0x9220('0x22')](respondWithResult(_0x5d724f,null))[_0x9220('0x2b')](handleError(_0x5d724f,null));};exports['getDispositions']=function(_0x481605,_0x16a9cd,_0x1ea9ba){var _0x3b984e={'raw':![],'where':{}};var _0x34d616={};var _0x5ae7de={'count':0x0,'rows':[]};return db[_0x9220('0x41')]['findOne']({'where':{'id':_0x481605[_0x9220('0x68')]['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x16a9cd,null))['then'](function(_0x1b436d){if(_0x1b436d){_0x34d616[_0x9220('0x45')]=_[_0x9220('0x47')](db[_0x9220('0x6b')]['rawAttributes']);_0x34d616[_0x9220('0x46')]=_[_0x9220('0x47')](_0x481605['query']);_0x34d616['filters']=_[_0x9220('0x49')](_0x34d616[_0x9220('0x45')],_0x34d616['query']);_0x3b984e[_0x9220('0x4a')]=_[_0x9220('0x49')](_0x34d616['model'],qs[_0x9220('0x4b')](_0x481605[_0x9220('0x46')][_0x9220('0x4b')]));_0x3b984e[_0x9220('0x4a')]=_0x3b984e['attributes']['length']?_0x3b984e[_0x9220('0x4a')]:_0x34d616[_0x9220('0x45')];if(!_0x481605[_0x9220('0x46')]['hasOwnProperty'](_0x9220('0x4e'))){_0x3b984e['limit']=qs[_0x9220('0x30')](_0x481605[_0x9220('0x46')][_0x9220('0x30')]);_0x3b984e[_0x9220('0x2e')]=qs['offset'](_0x481605['query'][_0x9220('0x2e')]);}_0x3b984e['order']=qs[_0x9220('0x50')](_0x481605[_0x9220('0x46')][_0x9220('0x50')]);_0x3b984e['where']=qs['filters'](_[_0x9220('0x51')](_0x481605[_0x9220('0x46')],_0x34d616['filters']));_0x3b984e['where']['OpenchannelAccountId']=_0x1b436d['id'];if(_0x481605[_0x9220('0x46')][_0x9220('0x52')]){_0x3b984e[_0x9220('0x54')]=_[_0x9220('0x53')](_0x3b984e[_0x9220('0x54')],{'$or':_[_0x9220('0x40')](_0x3b984e[_0x9220('0x4a')],function(_0x3ccf19){var _0x2beccf={};_0x2beccf[_0x3ccf19]={'$like':'%'+_0x481605[_0x9220('0x46')]['filter']+'%'};return _0x2beccf;})});}_0x3b984e=_[_0x9220('0x53')]({},_0x3b984e,_0x481605[_0x9220('0x58')]);return db['Disposition'][_0x9220('0x31')]({'where':_0x3b984e[_0x9220('0x54')]})[_0x9220('0x22')](function(_0x445d76){_0x5ae7de[_0x9220('0x31')]=_0x445d76;if(_0x481605[_0x9220('0x46')][_0x9220('0x59')]){_0x3b984e['include']=[{'all':!![]}];}return db[_0x9220('0x6b')][_0x9220('0x5b')](_0x3b984e);})[_0x9220('0x22')](function(_0x17c1c1){_0x5ae7de[_0x9220('0x5c')]=_0x17c1c1;return _0x5ae7de;});}})['then'](respondWithFilteredResult(_0x16a9cd,_0x3b984e))[_0x9220('0x2b')](handleError(_0x16a9cd,null));};exports[_0x9220('0x6c')]=function(_0x1dfa03,_0x242989,_0x38385f){return db[_0x9220('0x41')]['find']({'where':{'id':_0x1dfa03['params']['id']}})['then'](handleEntityNotFound(_0x242989,null))[_0x9220('0x22')](function(_0x46c880){if(_0x46c880){return _0x46c880[_0x9220('0x6c')](_0x1dfa03[_0x9220('0x46')][_0x9220('0x6d')]);}})['then'](respondWithStatusCode(_0x242989,null))[_0x9220('0x2b')](handleError(_0x242989,null));};exports[_0x9220('0x6e')]=function(_0x1a9a93,_0xc60c45,_0x519764){if(_0x1a9a93[_0x9220('0x60')]['id']){delete _0x1a9a93[_0x9220('0x60')]['id'];}return db[_0x9220('0x41')][_0x9220('0x5e')]({'where':{'id':_0x1a9a93['params']['id']}})['then'](handleEntityNotFound(_0xc60c45,null))['then'](function(_0x394f88){if(_0x394f88){_0x1a9a93[_0x9220('0x60')]['OpenchannelAccountId']=_0x394f88['id'];return db[_0x9220('0x6f')][_0x9220('0x5f')](_0x1a9a93[_0x9220('0x60')]);}})['then'](respondWithResult(_0xc60c45,null))[_0x9220('0x2b')](handleError(_0xc60c45,null));};exports['getAnswers']=function(_0x4d846c,_0x171e1c,_0x2b3ce1){var _0x4d2be3={'raw':![],'where':{}};var _0xa4dcf9={};var _0x5de4c2={'count':0x0,'rows':[]};return db[_0x9220('0x41')][_0x9220('0x70')]({'where':{'id':_0x4d846c[_0x9220('0x68')]['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x171e1c,null))[_0x9220('0x22')](function(_0x496a88){if(_0x496a88){_0xa4dcf9[_0x9220('0x45')]=_[_0x9220('0x47')](db[_0x9220('0x6f')][_0x9220('0x42')]);_0xa4dcf9[_0x9220('0x46')]=_[_0x9220('0x47')](_0x4d846c[_0x9220('0x46')]);_0xa4dcf9[_0x9220('0x48')]=_['intersection'](_0xa4dcf9[_0x9220('0x45')],_0xa4dcf9['query']);_0x4d2be3[_0x9220('0x4a')]=_['intersection'](_0xa4dcf9[_0x9220('0x45')],qs[_0x9220('0x4b')](_0x4d846c['query'][_0x9220('0x4b')]));_0x4d2be3[_0x9220('0x4a')]=_0x4d2be3[_0x9220('0x4a')][_0x9220('0x4c')]?_0x4d2be3[_0x9220('0x4a')]:_0xa4dcf9[_0x9220('0x45')];if(!_0x4d846c['query'][_0x9220('0x4d')](_0x9220('0x4e'))){_0x4d2be3[_0x9220('0x30')]=qs[_0x9220('0x30')](_0x4d846c['query']['limit']);_0x4d2be3[_0x9220('0x2e')]=qs['offset'](_0x4d846c[_0x9220('0x46')]['offset']);}_0x4d2be3[_0x9220('0x4f')]=qs[_0x9220('0x50')](_0x4d846c[_0x9220('0x46')][_0x9220('0x50')]);_0x4d2be3[_0x9220('0x54')]=qs['filters'](_[_0x9220('0x51')](_0x4d846c[_0x9220('0x46')],_0xa4dcf9[_0x9220('0x48')]));_0x4d2be3[_0x9220('0x54')][_0x9220('0x6a')]=_0x496a88['id'];if(_0x4d846c[_0x9220('0x46')]['filter']){_0x4d2be3[_0x9220('0x54')]=_[_0x9220('0x53')](_0x4d2be3[_0x9220('0x54')],{'$or':_[_0x9220('0x40')](_0x4d2be3['attributes'],function(_0x4954d5){var _0x41f1f5={};_0x41f1f5[_0x4954d5]={'$like':'%'+_0x4d846c['query']['filter']+'%'};return _0x41f1f5;})});}_0x4d2be3=_['merge']({},_0x4d2be3,_0x4d846c[_0x9220('0x58')]);return db['CannedAnswer']['count']({'where':_0x4d2be3[_0x9220('0x54')]})['then'](function(_0x28a2c2){_0x5de4c2[_0x9220('0x31')]=_0x28a2c2;if(_0x4d846c[_0x9220('0x46')][_0x9220('0x59')]){_0x4d2be3[_0x9220('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9220('0x5b')](_0x4d2be3);})[_0x9220('0x22')](function(_0x44ea75){_0x5de4c2[_0x9220('0x5c')]=_0x44ea75;return _0x5de4c2;});}})[_0x9220('0x22')](respondWithFilteredResult(_0x171e1c,_0x4d2be3))[_0x9220('0x2b')](handleError(_0x171e1c,null));};exports[_0x9220('0x71')]=function(_0x545005,_0x42e668,_0x5d4c22){return db[_0x9220('0x41')]['find']({'where':{'id':_0x545005['params']['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x42e668,null))[_0x9220('0x22')](function(_0x4e51b6){if(_0x4e51b6){return _0x4e51b6[_0x9220('0x71')](_0x545005[_0x9220('0x46')][_0x9220('0x6d')]);}})[_0x9220('0x22')](respondWithStatusCode(_0x42e668,null))[_0x9220('0x2b')](handleError(_0x42e668,null));};exports[_0x9220('0x72')]=function(_0x28d1a1,_0x2d09cb,_0x19256e){var _0x229232={'body':_0x28d1a1[_0x9220('0x60')],'channel':_0x9220('0x73')};var _0x20f33e=[];var _0x1bc460=[];var _0x18f003={};var _0x398fb2=![];return db[_0x9220('0x74')][_0x9220('0x75')]()[_0x9220('0x22')](function(_0x33713a){if(!_0x33713a){throw new db[(_0x9220('0x76'))]['ValidationError'](_0x9220('0x77'));}_0x20f33e=_[_0x9220('0x78')](_['keys'](_0x33713a),['createdAt',_0x9220('0x79')]);_0x1bc460=_[_0x9220('0x78')](_[_0x9220('0x47')](_0x33713a),[_0x9220('0x7a'),'updatedAt',_0x9220('0x7b'),_0x9220('0x7c')]);if(_0x28d1a1[_0x9220('0x60')]['id']){delete _0x28d1a1['body']['id'];}if(_['isNil'](_0x28d1a1[_0x9220('0x60')][_0x9220('0x7d')])){throw new db['Sequelize'][(_0x9220('0x7e'))](_0x9220('0x7f'));}if(_[_0x9220('0x80')](_0x28d1a1[_0x9220('0x60')]['body'])||_0x28d1a1[_0x9220('0x60')][_0x9220('0x60')]===''){throw new db['Sequelize'][(_0x9220('0x7e'))](_0x9220('0x81'));}if(_['isNil'](_0x28d1a1[_0x9220('0x60')][_0x9220('0x82')])){throw new db[(_0x9220('0x76'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1bc460);}if(!_[_0x9220('0x83')](_0x1bc460,_0x28d1a1[_0x9220('0x60')][_0x9220('0x82')])){throw new db[(_0x9220('0x76'))][(_0x9220('0x7e'))](_0x9220('0x84')+_0x1bc460);}_0x18f003[_0x28d1a1['body'][_0x9220('0x82')]]=_0x28d1a1[_0x9220('0x60')][_0x9220('0x7d')];})[_0x9220('0x22')](function(){return db[_0x9220('0x41')][_0x9220('0x5e')]({'where':{'id':_0x28d1a1[_0x9220('0x68')]['id']},'include':[{'model':db[_0x9220('0x85')],'as':_0x9220('0x86'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x18f003,'limit':0x1,'order':[[_0x9220('0x79'),'DESC']]}]},{'model':db[_0x9220('0x87')],'as':'Applications'}]});})[_0x9220('0x22')](handleEntityNotFound(_0x2d09cb,null))[_0x9220('0x22')](function(_0x425fd6){if(_0x425fd6&&_0x425fd6[_0x9220('0x86')]){_0x229232['account']=_0x425fd6;_0x229232[_0x9220('0x88')]=_0x425fd6['Applications'];_0x229232[_0x9220('0x89')]=_0x425fd6['List'];_0x229232[_0x9220('0x88')]=_['orderBy'](_0x229232[_0x9220('0x88')],[_0x9220('0x8a')],[_0x9220('0x8b')]);if(_0x229232[_0x9220('0x8c')][_0x9220('0x8d')]){delete _0x229232[_0x9220('0x8c')]['Applications'];}if(_0x229232[_0x9220('0x8c')]['List']&&_0x229232[_0x9220('0x8c')][_0x9220('0x86')][_0x9220('0x8e')][_0x9220('0x4c')]){return _0x229232[_0x9220('0x8c')][_0x9220('0x86')]['Contacts'][0x0];}var _0x59c3c1=_['defaults'](_0x28d1a1[_0x9220('0x60')],{'firstName':_0x28d1a1[_0x9220('0x60')][_0x9220('0x7d')],'ListId':_0x425fd6[_0x9220('0x7c')]});_0x59c3c1[_0x28d1a1[_0x9220('0x60')][_0x9220('0x82')]]=_0x28d1a1[_0x9220('0x60')][_0x9220('0x7d')];return db[_0x9220('0x74')][_0x9220('0x5f')](_0x59c3c1,{'fields':_0x20f33e,'raw':!![]});}})[_0x9220('0x22')](handleEntityNotFound(_0x2d09cb,null))[_0x9220('0x22')](function(_0x22a236){_0x229232['contact']=_0x22a236;if(_0x22a236){var _0x376955={'ContactId':_0x22a236['id'],'OpenchannelAccountId':_0x28d1a1['params']['id'],'from':(_0x22a236[_0x9220('0x8f')]||'')+'\x20'+(_0x22a236['lastName']||'')};var _0x50bac5={'OpenchannelAccountId':_0x28d1a1['params']['id'],'closed':![]};if(_0x28d1a1[_0x9220('0x60')][_0x9220('0x90')]){_0x50bac5[_0x9220('0x90')]=_0x28d1a1[_0x9220('0x60')][_0x9220('0x90')];return db['OpenchannelInteraction'][_0x9220('0x5e')]({'where':_0x50bac5})[_0x9220('0x22')](function(_0x4aa51e){if(_0x4aa51e){return[_0x4aa51e,![]];}_0x376955[_0x9220('0x90')]=_0x28d1a1[_0x9220('0x60')]['threadId'];_0x376955[_0x9220('0x91')]=_0x28d1a1[_0x9220('0x60')]['externalUrl'];return db[_0x9220('0x92')][_0x9220('0x5f')](_0x376955)[_0x9220('0x22')](function(_0x4a112e){return[_0x4a112e,!![]];});});}else{_0x50bac5[_0x9220('0x90')]=null;}_0x50bac5[_0x9220('0x93')]=_0x22a236['id'];return db[_0x9220('0x92')][_0x9220('0x5e')]({'where':_0x50bac5})[_0x9220('0x22')](function(_0x5ebc93){if(_0x5ebc93){return[_0x5ebc93,![]];}return db[_0x9220('0x92')][_0x9220('0x5f')](_0x376955)[_0x9220('0x22')](function(_0x4289e6){return[_0x4289e6,!![]];});});}})[_0x9220('0x94')](function(_0x45368f,_0xd6651b){if(_0x45368f){_0x398fb2=_0xd6651b;if(!_0xd6651b){var _0x48a9c2={'from':(_0x229232['contact'][_0x9220('0x8f')]||'')+'\x20'+(_0x229232[_0x9220('0x95')][_0x9220('0x96')]||'')};if(_0x28d1a1[_0x9220('0x60')]['threadId']&&_0x28d1a1[_0x9220('0x60')]['messageId']&&_0x28d1a1[_0x9220('0x60')][_0x9220('0x90')]!=_0x28d1a1[_0x9220('0x60')]['messageId']){_0x48a9c2[_0x9220('0x90')]=_0x28d1a1[_0x9220('0x60')]['messageId'];}return _0x45368f[_0x9220('0x37')](_0x48a9c2);}else{return _0x45368f;}}})['then'](function(_0x3792e0){_0x229232[_0x9220('0x97')]=_0x3792e0[_0x9220('0x62')]({'plain':!![]});_0x229232['interaction'][_0x9220('0x98')]=_0x398fb2;if(_0x229232[_0x9220('0x97')][_0x9220('0x98')]){if(_0x229232[_0x9220('0x8c')]['autoclose']){_0x229232[_0x9220('0x88')][_0x9220('0x99')]({'id':0x0,'priority':_0x229232[_0x9220('0x88')][_0x9220('0x4c')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9220('0x9a')});}}return db[_0x9220('0x9b')]['create']({'body':_0x28d1a1[_0x9220('0x60')][_0x9220('0x60')],'OpenchannelAccountId':_0x28d1a1[_0x9220('0x68')]['id'],'OpenchannelInteractionId':_0x3792e0['id'],'direction':'in','ContactId':_0x229232['contact']['id'],'AttachmentId':_0x28d1a1[_0x9220('0x60')]['AttachmentId']});})[_0x9220('0x22')](function(_0x324a64){_0x229232[_0x9220('0x29')]=_0x324a64;if(_0x229232[_0x9220('0x97')][_0x9220('0x9c')]){return db[_0x9220('0x9d')][_0x9220('0x5e')]({'attributes':['id',_0x9220('0x57')],'where':{'id':_0x229232['interaction'][_0x9220('0x9c')]}})[_0x9220('0x22')](function(_0x40eb86){if(_0x40eb86){_0x229232['applications'][_0x9220('0x9e')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40eb86['name']+','+(_0x229232[_0x9220('0x8c')][_0x9220('0x9f')]||0xa),'interval':_0x9220('0x9a')});_0x229232['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x9220('0xa0'),_0x229232);});}return respondWithRpcPromise(_0x9220('0xa1'),_0x9220('0xa0'),_0x229232);})['then'](function(_0x33c837){respondWithRpcPromise('EventManager',_0x9220('0xa2'),{'event':_0x9220('0x72'),'message':_0x33c837},client9002);return _0x33c837;})[_0x9220('0x22')](respondWithResult(_0x2d09cb,null))[_0x9220('0x2b')](handleError(_0x2d09cb,null));};exports['addApplications']=function(_0x55418f,_0x22163e){var _0x144e95=_0x55418f[_0x9220('0x68')]['id'];var _0x301469=_0x55418f[_0x9220('0x60')];var _0x43e18b=0xc8;var _0x57bf73=null;return db[_0x9220('0xa3')][_0x9220('0xa4')]({'isolationLevel':db[_0x9220('0xa3')][_0x9220('0xa5')][_0x9220('0xa6')][_0x9220('0xa7')]},function(_0x4bb55b){return db[_0x9220('0x41')][_0x9220('0x70')]({'where':{'id':_0x144e95},'transaction':_0x4bb55b})[_0x9220('0x22')](function(_0x136f2f){if(_0x136f2f){return db[_0x9220('0x87')][_0x9220('0x38')]({'where':{'OpenchannelAccountId':_0x144e95},'transaction':_0x4bb55b})[_0x9220('0x22')](function(){var _0x58076e=_[_0x9220('0x40')](_0x301469,function(_0xccdae4){_0xccdae4[_0x9220('0x6a')]=_0x144e95;return _0xccdae4;});return db[_0x9220('0x87')][_0x9220('0xa8')](_0x58076e,{'transaction':_0x4bb55b});});}else{_0x43e18b=0x194;_0x57bf73=[];}});})[_0x9220('0x22')](function(){if(_0x43e18b!==0x194){return db[_0x9220('0x87')][_0x9220('0xa9')]({'where':{'OpenchannelAccountId':_0x144e95},'order':'priority'})[_0x9220('0x22')](function(_0x451577){_0x57bf73=_0x451577;});}})[_0x9220('0x2b')](function(_0x542217){_0x43e18b=0x1f4;logger[_0x9220('0x27')](_0x542217[_0x9220('0x3b')]);if(_0x542217[_0x9220('0x57')]){delete _0x542217['name'];}_0x57bf73=_0x542217;})['finally'](function(){if(_0x57bf73===null){_0x22163e[_0x9220('0x2c')](_0x43e18b);}else{if(_0x43e18b===0x1f4){_0x22163e['status'](_0x43e18b)[_0x9220('0x3c')](_0x57bf73);}else{_0x22163e[_0x9220('0x2d')](_0x43e18b)[_0x9220('0x33')](_0x57bf73);}}});};exports[_0x9220('0xaa')]=function(_0x39f685,_0x510de6,_0x3c1ea3){var _0x2202d1={};var _0x2bb2d1={};var _0x59285d;var _0xc8792b;return db['OpenchannelAccount'][_0x9220('0x70')]({'where':{'id':_0x39f685[_0x9220('0x68')]['id']}})['then'](handleEntityNotFound(_0x510de6,null))[_0x9220('0x22')](function(_0x4e514b){if(_0x4e514b){_0x59285d=_0x4e514b;_0x2bb2d1['model']=_[_0x9220('0x47')](db[_0x9220('0x87')][_0x9220('0x42')]);_0x2bb2d1[_0x9220('0x46')]=_[_0x9220('0x47')](_0x39f685['query']);_0x2bb2d1['filters']=_[_0x9220('0x49')](_0x2bb2d1[_0x9220('0x45')],_0x2bb2d1[_0x9220('0x46')]);_0x2202d1[_0x9220('0x4a')]=_[_0x9220('0x49')](_0x2bb2d1[_0x9220('0x45')],qs['fields'](_0x39f685[_0x9220('0x46')][_0x9220('0x4b')]));_0x2202d1[_0x9220('0x4a')]=_0x2202d1[_0x9220('0x4a')][_0x9220('0x4c')]?_0x2202d1['attributes']:_0x2bb2d1['model'];_0x2202d1[_0x9220('0x4f')]=qs[_0x9220('0x50')](_0x39f685[_0x9220('0x46')]['sort']);_0x2202d1[_0x9220('0x54')]=qs[_0x9220('0x48')](_[_0x9220('0x51')](_0x39f685[_0x9220('0x46')],_0x2bb2d1['filters']));if(_0x39f685['query'][_0x9220('0x52')]){_0x2202d1[_0x9220('0x54')]=_[_0x9220('0x53')](_0x2202d1['where'],{'$or':_[_0x9220('0x40')](_0x2202d1['attributes'],function(_0x2c452b){var _0x209613={};_0x209613[_0x2c452b]={'$like':'%'+_0x39f685[_0x9220('0x46')]['filter']+'%'};return _0x209613;})});}_0x2202d1=_[_0x9220('0x53')]({},_0x2202d1,_0x39f685[_0x9220('0x58')]);return _0x59285d[_0x9220('0xaa')](_0x2202d1);}})['then'](function(_0x588478){if(_0x588478){_0xc8792b=_0x588478['length'];if(!_0x39f685[_0x9220('0x46')][_0x9220('0x4d')](_0x9220('0x4e'))){_0x2202d1['limit']=qs['limit'](_0x39f685[_0x9220('0x46')][_0x9220('0x30')]);_0x2202d1[_0x9220('0x2e')]=qs[_0x9220('0x2e')](_0x39f685[_0x9220('0x46')][_0x9220('0x2e')]);}return _0x59285d[_0x9220('0xaa')](_0x2202d1);}})['then'](function(_0x13b7c5){if(_0x13b7c5){return _0x13b7c5?{'count':_0xc8792b,'rows':_0x13b7c5}:null;}})[_0x9220('0x22')](respondWithResult(_0x510de6,null))[_0x9220('0x2b')](handleError(_0x510de6,null));};exports[_0x9220('0xab')]=function(_0x57f001,_0x256366,_0x6ec9a0){var _0x3d436f={'raw':![],'where':{}};var _0x307ddb={};var _0x90db86={'count':0x0,'rows':[]};return db[_0x9220('0x41')][_0x9220('0x70')]({'where':{'id':_0x57f001['params']['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x256366,null))[_0x9220('0x22')](function(_0x1b3d7a){if(_0x1b3d7a){_0x307ddb[_0x9220('0x45')]=_[_0x9220('0x47')](db[_0x9220('0x92')][_0x9220('0x42')]);_0x307ddb['query']=_[_0x9220('0x47')](_0x57f001[_0x9220('0x46')]);_0x307ddb[_0x9220('0x48')]=_[_0x9220('0x49')](_0x307ddb['model'],_0x307ddb['query']);_0x3d436f[_0x9220('0x4a')]=_[_0x9220('0x49')](_0x307ddb['model'],qs[_0x9220('0x4b')](_0x57f001['query']['fields']));_0x3d436f['attributes']=_0x3d436f['attributes'][_0x9220('0x4c')]?_0x3d436f[_0x9220('0x4a')]:_0x307ddb[_0x9220('0x45')];if(!_0x57f001[_0x9220('0x46')][_0x9220('0x4d')](_0x9220('0x4e'))){_0x3d436f['limit']=qs[_0x9220('0x30')](_0x57f001['query']['limit']);_0x3d436f[_0x9220('0x2e')]=qs[_0x9220('0x2e')](_0x57f001[_0x9220('0x46')][_0x9220('0x2e')]);}_0x3d436f[_0x9220('0x4f')]=qs[_0x9220('0x50')](_0x57f001[_0x9220('0x46')][_0x9220('0x50')]);_0x3d436f[_0x9220('0x54')]=qs[_0x9220('0x48')](_['pick'](_0x57f001[_0x9220('0x46')],_0x307ddb[_0x9220('0x48')]));_0x3d436f['where'][_0x9220('0x6a')]=_0x1b3d7a['id'];if(_0x57f001[_0x9220('0x46')][_0x9220('0x52')]){_0x3d436f['where']=_[_0x9220('0x53')](_0x3d436f[_0x9220('0x54')],{'$or':_[_0x9220('0x40')](_0x3d436f[_0x9220('0x4a')],function(_0xe47aff){var _0x47f3e0={};_0x47f3e0[_0xe47aff]={'$like':'%'+_0x57f001[_0x9220('0x46')][_0x9220('0x52')]+'%'};return _0x47f3e0;})});}_0x3d436f=_[_0x9220('0x53')]({},_0x3d436f,_0x57f001[_0x9220('0x58')]);return db['OpenchannelInteraction']['count']({'where':_0x3d436f[_0x9220('0x54')]})['then'](function(_0xb0f538){_0x90db86[_0x9220('0x31')]=_0xb0f538;if(_0x57f001[_0x9220('0x46')][_0x9220('0x59')]){_0x3d436f[_0x9220('0x5a')]=[{'model':db[_0x9220('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9220('0x57'),_0x9220('0xac'),_0x9220('0xad')],'required':![]},{'model':db[_0x9220('0xae')],'as':_0x9220('0xaf'),'attributes':['id',_0x9220('0x57'),_0x9220('0xb0')],'where':_0x57f001[_0x9220('0x46')][_0x9220('0xb1')]?{'id':_0x57f001[_0x9220('0x46')][_0x9220('0xb1')]}:undefined,'required':_0x57f001[_0x9220('0x46')][_0x9220('0xb1')]?!![]:![]}];}return db[_0x9220('0x92')][_0x9220('0x5b')](_0x3d436f);})['then'](function(_0x1e8f46){_0x90db86[_0x9220('0x5c')]=_0x1e8f46;return _0x90db86;});}})[_0x9220('0x22')](respondWithFilteredResult(_0x256366,_0x3d436f))[_0x9220('0x2b')](handleError(_0x256366,null));};exports[_0x9220('0xb2')]=function(_0x12e4e8,_0x2ef4fb,_0x539f72){return db['OpenchannelAccount'][_0x9220('0x5e')]({'where':{'id':_0x12e4e8['params']['id']}})['then'](handleEntityNotFound(_0x2ef4fb,null))['then'](function(_0x534b4f){if(_0x534b4f){return _0x534b4f['addAgents'](_0x12e4e8[_0x9220('0x60')][_0x9220('0x6d')],_[_0x9220('0xb3')](_0x12e4e8[_0x9220('0x60')],[_0x9220('0x6d'),'id'])||{})[_0x9220('0x94')](function(_0x38a69e){for(var _0x2c2ae4=0x0;_0x2c2ae4<_0x12e4e8['body'][_0x9220('0x6d')][_0x9220('0x4c')];_0x2c2ae4+=0x1){socket['emit'](_0x9220('0xb4'),{'UserId':Number(_0x12e4e8[_0x9220('0x60')]['ids'][_0x2c2ae4]),'OpenchannelAccountId':Number(_0x12e4e8[_0x9220('0x68')]['id'])});}return _0x38a69e;});}})[_0x9220('0x22')](respondWithResult(_0x2ef4fb,null))['catch'](handleError(_0x2ef4fb,null));};exports[_0x9220('0xb5')]=function(_0xb4c807,_0x324b03,_0x1be1fe){return db[_0x9220('0x41')][_0x9220('0x5e')]({'where':{'id':_0xb4c807[_0x9220('0x68')]['id']}})['then'](handleEntityNotFound(_0x324b03,null))['then'](function(_0x4a9257){if(_0x4a9257){return _0x4a9257[_0x9220('0xb5')](_0xb4c807['query'][_0x9220('0x6d')])[_0x9220('0x22')](function(){if(_[_0x9220('0xb6')](_0xb4c807['query'][_0x9220('0x6d')])){for(var _0x3ef1d8=0x0;_0x3ef1d8<_0xb4c807['query']['ids'][_0x9220('0x4c')];_0x3ef1d8+=0x1){socket[_0x9220('0xb7')](_0x9220('0xb8'),{'UserId':Number(_0xb4c807[_0x9220('0x46')][_0x9220('0x6d')][_0x3ef1d8]),'OpenchannelAccountId':Number(_0xb4c807[_0x9220('0x68')]['id'])});}}else{socket[_0x9220('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0xb4c807[_0x9220('0x46')][_0x9220('0x6d')]),'OpenchannelAccountId':Number(_0xb4c807[_0x9220('0x68')]['id'])});}});}})['then'](respondWithStatusCode(_0x324b03,null))['catch'](handleError(_0x324b03,null));};exports[_0x9220('0xb9')]=function(_0x22a4fd,_0xd9bed3,_0xa98dcc){var _0x489540={};var _0x4d8488={};var _0xf4b5f7;var _0x59fe7f;return db['OpenchannelAccount'][_0x9220('0x70')]({'where':{'id':_0x22a4fd['params']['id']}})['then'](handleEntityNotFound(_0xd9bed3,null))[_0x9220('0x22')](function(_0x3472be){if(_0x3472be){_0xf4b5f7=_0x3472be;_0x4d8488[_0x9220('0x45')]=_['keys'](db['User'][_0x9220('0x42')]);_0x4d8488['query']=_['keys'](_0x22a4fd[_0x9220('0x46')]);_0x4d8488[_0x9220('0x48')]=_['intersection'](_0x4d8488[_0x9220('0x45')],_0x4d8488[_0x9220('0x46')]);_0x489540['attributes']=_['intersection'](_0x4d8488['model'],qs[_0x9220('0x4b')](_0x22a4fd[_0x9220('0x46')]['fields']));_0x489540['attributes']=_0x489540[_0x9220('0x4a')][_0x9220('0x4c')]?_0x489540[_0x9220('0x4a')]:_0x4d8488[_0x9220('0x45')];_0x489540[_0x9220('0x4f')]=qs[_0x9220('0x50')](_0x22a4fd['query'][_0x9220('0x50')]);_0x489540[_0x9220('0x54')]=qs[_0x9220('0x48')](_['pick'](_0x22a4fd[_0x9220('0x46')],_0x4d8488['filters']));if(_0x22a4fd[_0x9220('0x46')][_0x9220('0x52')]){_0x489540[_0x9220('0x54')]=_[_0x9220('0x53')](_0x489540[_0x9220('0x54')],{'$or':_['map'](_0x489540['attributes'],function(_0x4effcb){var _0x5d9a21={};_0x5d9a21[_0x4effcb]={'$like':'%'+_0x22a4fd['query'][_0x9220('0x52')]+'%'};return _0x5d9a21;})});}_0x489540=_[_0x9220('0x53')]({},_0x489540,_0x22a4fd['options']);return _0xf4b5f7[_0x9220('0xb9')](_0x489540);}})[_0x9220('0x22')](function(_0x4ab762){if(_0x4ab762){_0x59fe7f=_0x4ab762['length'];if(!_0x22a4fd[_0x9220('0x46')][_0x9220('0x4d')](_0x9220('0x4e'))){_0x489540[_0x9220('0x30')]=qs[_0x9220('0x30')](_0x22a4fd[_0x9220('0x46')]['limit']);_0x489540[_0x9220('0x2e')]=qs[_0x9220('0x2e')](_0x22a4fd[_0x9220('0x46')]['offset']);}return _0xf4b5f7[_0x9220('0xb9')](_0x489540);}})[_0x9220('0x22')](function(_0x4443fc){if(_0x4443fc){return _0x4443fc?{'count':_0x59fe7f,'rows':_0x4443fc}:null;}})[_0x9220('0x22')](respondWithResult(_0xd9bed3,null))[_0x9220('0x2b')](handleError(_0xd9bed3,null));};exports[_0x9220('0x3c')]=function(_0x3fb73a,_0x3138d3,_0x5875f4){var _0x41dd13,_0x2cd0bd,_0x343e73;if(_[_0x9220('0x80')](_0x3fb73a[_0x9220('0x60')][_0x9220('0x60')])||_0x3fb73a[_0x9220('0x60')][_0x9220('0x60')]===''){throw new db['Sequelize'][(_0x9220('0x7e'))](_0x9220('0x81'));}if(_['isNil'](_0x3fb73a[_0x9220('0x60')]['to'])){}_0x41dd13=_0x3fb73a[_0x9220('0x60')]['to'];return db[_0x9220('0x41')]['findOne']({'where':{'id':_0x3fb73a[_0x9220('0x68')]['id']}})[_0x9220('0x22')](handleEntityNotFound(_0x3138d3,null))[_0x9220('0x22')](function(_0x168760){if(_0x168760){return db['OpenchannelAccount'][_0x9220('0x5e')]({'where':{'id':_0x168760['id']},'include':[{'model':db[_0x9220('0x85')],'as':_0x9220('0x86'),'include':[{'model':db[_0x9220('0x74')],'as':_0x9220('0x8e'),'where':{[_0x168760['mapKey']]:_0x41dd13},'limit':0x1,'order':[[_0x9220('0x79'),'DESC']]}]}]})[_0x9220('0x22')](handleEntityNotFound(_0x3138d3,null))[_0x9220('0x22')](function(_0x498e81){if(_0x498e81&&_0x498e81['List']){_0x2cd0bd=_0x498e81[_0x9220('0x62')]({'plain':!![]});if(_0x2cd0bd['List']&&_0x2cd0bd['List']['Contacts']['length']){return _0x2cd0bd[_0x9220('0x86')][_0x9220('0x8e')][0x0];}return db[_0x9220('0x74')][_0x9220('0x5f')](_['defaults'](_0x3fb73a[_0x9220('0x60')],{'firstName':_0x41dd13,[_0x498e81[_0x9220('0x82')]]:_0x41dd13,'phone':_0x41dd13,'ListId':_0x2cd0bd[_0x9220('0x7c')]}));}})[_0x9220('0x22')](handleEntityNotFound(_0x3138d3,null))[_0x9220('0x22')](function(_0x4dac54){if(_0x4dac54){_0x343e73=_0x4dac54;return db[_0x9220('0x92')]['find']({'where':{'ContactId':_0x343e73['id'],'closed':![],'OpenchannelAccountId':_0x2cd0bd['id']}})['then'](function(_0x11c955){if(_0x11c955){return[_0x11c955,![]];}return db['OpenchannelInteraction'][_0x9220('0x5f')]({'UserId':_0x3fb73a[_0x9220('0x61')]['id'],'ContactId':_0x343e73['id'],'OpenchannelAccountId':_0x2cd0bd['id'],'lastMsgDirection':_0x9220('0xba'),'firstMsgDirection':_0x9220('0xba'),'Messages':[_[_0x9220('0x53')](_0x3fb73a['body'],{'read':![],'body':_0x3fb73a[_0x9220('0x60')][_0x9220('0x60')],'OpenchannelAccountId':_0x2cd0bd['id'],'UserId':_0x3fb73a[_0x9220('0x61')]['id'],'ContactId':_0x343e73['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x9220('0xbb')}]})['then'](function(_0x5ec2d5){return[_0x5ec2d5,!![]];});});}})[_0x9220('0x94')](function(_0x53ccda,_0x3f2b90){if(_0x3f2b90){return _0x53ccda;}return db[_0x9220('0x9b')][_0x9220('0x5f')](_['merge'](_0x3fb73a[_0x9220('0x60')],{'read':![],'body':_0x3fb73a['body'][_0x9220('0x60')],'OpenchannelAccountId':_0x2cd0bd['id'],'OpenchannelInteractionId':_0x53ccda['id'],'UserId':_0x3fb73a[_0x9220('0x61')]['id'],'ContactId':_0x343e73['id']}))[_0x9220('0x22')](function(_0x4e2a5f){_0x53ccda['dataValues'][_0x9220('0xbb')]=[];_0x53ccda[_0x9220('0xbc')][_0x9220('0xbb')][_0x9220('0x99')](_0x4e2a5f[_0x9220('0xbc')]);return _0x53ccda;});});}})[_0x9220('0x22')](respondWithResult(_0x3138d3,null))[_0x9220('0x2b')](handleError(_0x3138d3,null));}; \ No newline at end of file +var _0xe5b3=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Pause','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','User','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','findOne','getApplications','Contact','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','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','redis','defaults','localhost','client','http','request','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model'];(function(_0x135c1e,_0x2c784b){var _0x565cca=function(_0x3bc23b){while(--_0x3bc23b){_0x135c1e['push'](_0x135c1e['shift']());}};_0x565cca(++_0x2c784b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x31129a,_0x110737){_0x31129a=_0x31129a-0x0;var _0x55ef4f=_0xe5b3[_0x31129a];return _0x55ef4f;};'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'];config[_0x3e5b('0x19')]=_[_0x3e5b('0x1a')](config[_0x3e5b('0x19')],{'host':_0x3e5b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e5b('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e5b('0x1c')][_0x3e5b('0x1d')]({'port':0x232c});var client9002=jayson[_0x3e5b('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f81a7,_0x59ddc0,_0x56a453,_0x258d6a){return new BPromise(function(_0x11b41b,_0x5e2f83){var _0x3d58a4=_0x258d6a||client;return _0x3d58a4[_0x3e5b('0x1e')](_0x1f81a7,_0x56a453)['then'](function(_0xc56a2a){logger[_0x3e5b('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x59ddc0,'request\x20sent');logger[_0x3e5b('0x20')](_0x3e5b('0x21'),_0x59ddc0,_0x3e5b('0x22'),JSON[_0x3e5b('0x23')](_0xc56a2a));if(_0xc56a2a[_0x3e5b('0x24')]){if(_0xc56a2a[_0x3e5b('0x24')][_0x3e5b('0x25')]===0x1f4){logger[_0x3e5b('0x24')](_0x3e5b('0x26'),_0x59ddc0,_0xc56a2a[_0x3e5b('0x24')][_0x3e5b('0x27')]);return _0x5e2f83(_0xc56a2a[_0x3e5b('0x24')][_0x3e5b('0x27')]);}logger[_0x3e5b('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x59ddc0,_0xc56a2a[_0x3e5b('0x24')][_0x3e5b('0x27')]);return _0x11b41b(_0xc56a2a[_0x3e5b('0x24')][_0x3e5b('0x27')]);}else{logger['info'](_0x3e5b('0x26'),_0x59ddc0,'request\x20sent');_0x11b41b(_0xc56a2a[_0x3e5b('0x28')][_0x3e5b('0x27')]);}})['catch'](function(_0x41b684){logger[_0x3e5b('0x24')](_0x3e5b('0x26'),_0x59ddc0,_0x41b684);_0x5e2f83(_0x41b684);});});}function respondWithStatusCode(_0x3c8965,_0x3bb749){_0x3bb749=_0x3bb749||0xcc;return function(_0x26c7f2){if(_0x26c7f2){return _0x3c8965[_0x3e5b('0x29')](_0x3bb749);}return _0x3c8965[_0x3e5b('0x2a')](_0x3bb749)['end']();};}function respondWithResult(_0x1c7278,_0x505f40){_0x505f40=_0x505f40||0xc8;return function(_0xb70ab4){if(_0xb70ab4){return _0x1c7278['status'](_0x505f40)[_0x3e5b('0x2b')](_0xb70ab4);}};}function respondWithFilteredResult(_0x1f6473,_0x1296ec){return function(_0x475b39){if(_0x475b39){var _0x10d2ed=typeof _0x1296ec[_0x3e5b('0x2c')]===_0x3e5b('0x2d')&&typeof _0x1296ec[_0x3e5b('0x2e')]===_0x3e5b('0x2d');var _0x112dc0=_0x475b39[_0x3e5b('0x2f')];var _0x489221=_0x10d2ed?0x0:_0x1296ec[_0x3e5b('0x2c')];var _0x1882aa=_0x10d2ed?_0x475b39[_0x3e5b('0x2f')]:_0x1296ec[_0x3e5b('0x2c')]+_0x1296ec[_0x3e5b('0x2e')];var _0x31e9f9;if(_0x1882aa>=_0x112dc0){_0x1882aa=_0x112dc0;_0x31e9f9=0xc8;}else{_0x31e9f9=0xce;}_0x1f6473[_0x3e5b('0x2a')](_0x31e9f9);return _0x1f6473['set'](_0x3e5b('0x30'),_0x489221+'-'+_0x1882aa+'/'+_0x112dc0)['json'](_0x475b39);}return null;};}function patchUpdates(_0x5b9ba3){return function(_0x32c6b0){try{jsonpatch[_0x3e5b('0x31')](_0x32c6b0,_0x5b9ba3,!![]);}catch(_0x51ea0d){return BPromise[_0x3e5b('0x32')](_0x51ea0d);}return _0x32c6b0[_0x3e5b('0x33')]();};}function saveUpdates(_0x9d01c4,_0x33e356){return function(_0x1f3162){if(_0x1f3162){return _0x1f3162[_0x3e5b('0x34')](_0x9d01c4)[_0x3e5b('0x35')](function(_0x26c9ab){return _0x26c9ab;});}return null;};}function removeEntity(_0x2450c0,_0x7917ef){return function(_0x3104e6){if(_0x3104e6){return _0x3104e6[_0x3e5b('0x36')]()['then'](function(){var _0x141b7e=_0x3104e6[_0x3e5b('0x37')]({'plain':!![]});var _0x53caa2='OpenchannelAccounts';return db[_0x3e5b('0x38')]['destroy']({'where':{'type':_0x53caa2,'resourceId':_0x141b7e['id']}})[_0x3e5b('0x35')](function(){return _0x3104e6;});})[_0x3e5b('0x35')](function(){_0x2450c0[_0x3e5b('0x2a')](0xcc)[_0x3e5b('0x39')]();});}};}function handleEntityNotFound(_0x5389e3,_0x18b07f){return function(_0x4cdcb1){if(!_0x4cdcb1){_0x5389e3[_0x3e5b('0x29')](0x194);}return _0x4cdcb1;};}function handleError(_0x5ec841,_0x47f7c8){_0x47f7c8=_0x47f7c8||0x1f4;return function(_0x48f414){logger[_0x3e5b('0x24')](_0x48f414[_0x3e5b('0x3a')]);if(_0x48f414[_0x3e5b('0x3b')]){delete _0x48f414[_0x3e5b('0x3b')];}_0x5ec841[_0x3e5b('0x2a')](_0x47f7c8)[_0x3e5b('0x3c')](_0x48f414);};}exports['index']=function(_0x5d0c59,_0x5ee6dc){var _0x565319={'include':[{'model':db['Pause'],'as':_0x3e5b('0x3d')}]},_0x5f0271={},_0x47ea59={'count':0x0,'rows':[]};var _0x349de0=_[_0x3e5b('0x3e')](db[_0x3e5b('0x3f')][_0x3e5b('0x40')],function(_0x2506a6){return{'name':_0x2506a6[_0x3e5b('0x41')],'type':_0x2506a6[_0x3e5b('0x42')][_0x3e5b('0x43')]};});_0x5f0271[_0x3e5b('0x44')]=_[_0x3e5b('0x3e')](_0x349de0,'name');_0x5f0271[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x5d0c59[_0x3e5b('0x45')]);_0x5f0271[_0x3e5b('0x47')]=_[_0x3e5b('0x48')](_0x5f0271[_0x3e5b('0x44')],_0x5f0271[_0x3e5b('0x45')]);_0x565319[_0x3e5b('0x49')]=_[_0x3e5b('0x48')](_0x5f0271[_0x3e5b('0x44')],qs[_0x3e5b('0x4a')](_0x5d0c59['query']['fields']));_0x565319['attributes']=_0x565319['attributes'][_0x3e5b('0x4b')]?_0x565319[_0x3e5b('0x49')]:_0x5f0271[_0x3e5b('0x44')];if(!_0x5d0c59[_0x3e5b('0x45')][_0x3e5b('0x4c')](_0x3e5b('0x4d'))){_0x565319[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5d0c59[_0x3e5b('0x45')][_0x3e5b('0x2e')]);_0x565319['offset']=qs[_0x3e5b('0x2c')](_0x5d0c59[_0x3e5b('0x45')][_0x3e5b('0x2c')]);}_0x565319[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x5d0c59['query']['sort']);_0x565319['where']=qs[_0x3e5b('0x47')](_[_0x3e5b('0x50')](_0x5d0c59[_0x3e5b('0x45')],_0x5f0271['filters']),_0x349de0);if(_0x5d0c59['query'][_0x3e5b('0x51')]){_0x565319[_0x3e5b('0x52')]=_[_0x3e5b('0x53')](_0x565319['where'],{'$or':_['map'](_0x349de0,function(_0x467211){if(_0x467211['type']!==_0x3e5b('0x54')){var _0x3379a1={};_0x3379a1[_0x467211[_0x3e5b('0x3b')]]={'$like':'%'+_0x5d0c59[_0x3e5b('0x45')][_0x3e5b('0x51')]+'%'};return _0x3379a1;}})});}_0x565319=_[_0x3e5b('0x53')]({},_0x565319,_0x5d0c59[_0x3e5b('0x55')]);var _0x3ea5aa={'where':_0x565319[_0x3e5b('0x52')]};return db['OpenchannelAccount'][_0x3e5b('0x2f')](_0x3ea5aa)['then'](function(_0x51fd67){_0x47ea59[_0x3e5b('0x2f')]=_0x51fd67;if(_0x5d0c59[_0x3e5b('0x45')][_0x3e5b('0x56')]){_0x565319[_0x3e5b('0x57')]=[{'all':!![]}];}return db[_0x3e5b('0x3f')][_0x3e5b('0x58')](_0x565319);})[_0x3e5b('0x35')](function(_0x2b5d3d){_0x47ea59[_0x3e5b('0x59')]=_0x2b5d3d;return _0x47ea59;})[_0x3e5b('0x35')](respondWithFilteredResult(_0x5ee6dc,_0x565319))[_0x3e5b('0x5a')](handleError(_0x5ee6dc,null));};exports[_0x3e5b('0x5b')]=function(_0x59d311,_0x6104b0){var _0x181160={'raw':![],'where':{'id':_0x59d311[_0x3e5b('0x5c')]['id']},'include':[{'model':db[_0x3e5b('0x5d')],'as':_0x3e5b('0x3d')}]},_0x2ca33b={};_0x2ca33b['model']=_[_0x3e5b('0x46')](db[_0x3e5b('0x3f')][_0x3e5b('0x40')]);_0x2ca33b[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x59d311[_0x3e5b('0x45')]);_0x2ca33b[_0x3e5b('0x47')]=_[_0x3e5b('0x48')](_0x2ca33b['model'],_0x2ca33b[_0x3e5b('0x45')]);_0x181160['attributes']=_['intersection'](_0x2ca33b[_0x3e5b('0x44')],qs['fields'](_0x59d311[_0x3e5b('0x45')][_0x3e5b('0x4a')]));_0x181160[_0x3e5b('0x49')]=_0x181160[_0x3e5b('0x49')]['length']?_0x181160['attributes']:_0x2ca33b['model'];if(_0x59d311['query'][_0x3e5b('0x56')]){_0x181160[_0x3e5b('0x57')]=[{'all':!![]}];}_0x181160=_[_0x3e5b('0x53')]({},_0x181160,_0x59d311[_0x3e5b('0x55')]);return db[_0x3e5b('0x3f')]['find'](_0x181160)['then'](handleEntityNotFound(_0x6104b0,null))[_0x3e5b('0x35')](respondWithResult(_0x6104b0,null))[_0x3e5b('0x5a')](handleError(_0x6104b0,null));};exports[_0x3e5b('0x5e')]=function(_0x325f7b,_0x3db8bd){return db['OpenchannelAccount']['create'](_0x325f7b['body'],{})['then'](function(_0x3563b0){var _0x3e3115=_0x325f7b[_0x3e5b('0x5f')][_0x3e5b('0x37')]({'plain':!![]});if(!_0x3e3115)throw new Error(_0x3e5b('0x60'));if(_0x3e3115[_0x3e5b('0x61')]===_0x3e5b('0x5f')){var _0x1da524=_0x3563b0['get']({'plain':!![]});var _0x285db6=_0x3e5b('0x62');return db[_0x3e5b('0x63')][_0x3e5b('0x64')]({'where':{'name':_0x285db6,'userProfileId':_0x3e3115[_0x3e5b('0x65')]},'raw':!![]})['then'](function(_0xd45159){if(_0xd45159&&_0xd45159['autoAssociation']===0x0){return db[_0x3e5b('0x38')][_0x3e5b('0x5e')]({'name':_0x1da524['name'],'resourceId':_0x1da524['id'],'type':_0xd45159['name'],'sectionId':_0xd45159['id']},{})['then'](function(){return _0x3563b0;});}else{return _0x3563b0;}})[_0x3e5b('0x5a')](function(_0x50f5b4){logger[_0x3e5b('0x24')](_0x3e5b('0x66'),_0x50f5b4);throw _0x50f5b4;});}return _0x3563b0;})[_0x3e5b('0x35')](respondWithResult(_0x3db8bd,0xc9))[_0x3e5b('0x5a')](handleError(_0x3db8bd,null));};exports[_0x3e5b('0x34')]=function(_0x4de129,_0x56c16b){if(_0x4de129[_0x3e5b('0x67')]['id']){delete _0x4de129[_0x3e5b('0x67')]['id'];}return db[_0x3e5b('0x3f')]['find']({'where':{'id':_0x4de129[_0x3e5b('0x5c')]['id']},'include':[{'model':db[_0x3e5b('0x5d')],'as':_0x3e5b('0x3d')}]})[_0x3e5b('0x35')](handleEntityNotFound(_0x56c16b,null))[_0x3e5b('0x35')](saveUpdates(_0x4de129[_0x3e5b('0x67')],null))[_0x3e5b('0x35')](respondWithResult(_0x56c16b,null))[_0x3e5b('0x5a')](handleError(_0x56c16b,null));};exports[_0x3e5b('0x36')]=function(_0x52e98f,_0x4eb336){return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x52e98f[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x4eb336,null))[_0x3e5b('0x35')](removeEntity(_0x4eb336,null))[_0x3e5b('0x5a')](handleError(_0x4eb336,null));};exports[_0x3e5b('0x68')]=function(_0x4d2234,_0xe5d4c5){return db[_0x3e5b('0x3f')]['describe']()[_0x3e5b('0x35')](respondWithResult(_0xe5d4c5,null))[_0x3e5b('0x5a')](handleError(_0xe5d4c5,null));};exports['addDisposition']=function(_0x52d89e,_0x4f67d1,_0x23edae){if(_0x52d89e[_0x3e5b('0x67')]['id']){delete _0x52d89e['body']['id'];}return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x52d89e['params']['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x4f67d1,null))[_0x3e5b('0x35')](function(_0x43f28f){if(_0x43f28f){_0x52d89e[_0x3e5b('0x67')][_0x3e5b('0x69')]=_0x43f28f['id'];return db[_0x3e5b('0x6a')][_0x3e5b('0x5e')](_0x52d89e[_0x3e5b('0x67')]);}})[_0x3e5b('0x35')](respondWithResult(_0x4f67d1,null))['catch'](handleError(_0x4f67d1,null));};exports[_0x3e5b('0x6b')]=function(_0x3aad97,_0x2d5685,_0x40103e){var _0x1adb46={'raw':![],'where':{}};var _0x1ec1f6={};var _0x12c93d={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3aad97[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x2d5685,null))['then'](function(_0x404621){if(_0x404621){_0x1ec1f6[_0x3e5b('0x44')]=_[_0x3e5b('0x46')](db[_0x3e5b('0x6a')][_0x3e5b('0x40')]);_0x1ec1f6[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x3aad97['query']);_0x1ec1f6[_0x3e5b('0x47')]=_[_0x3e5b('0x48')](_0x1ec1f6['model'],_0x1ec1f6['query']);_0x1adb46['attributes']=_[_0x3e5b('0x48')](_0x1ec1f6[_0x3e5b('0x44')],qs[_0x3e5b('0x4a')](_0x3aad97[_0x3e5b('0x45')][_0x3e5b('0x4a')]));_0x1adb46[_0x3e5b('0x49')]=_0x1adb46['attributes'][_0x3e5b('0x4b')]?_0x1adb46[_0x3e5b('0x49')]:_0x1ec1f6['model'];if(!_0x3aad97[_0x3e5b('0x45')]['hasOwnProperty']('nolimit')){_0x1adb46[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x3aad97['query'][_0x3e5b('0x2e')]);_0x1adb46[_0x3e5b('0x2c')]=qs['offset'](_0x3aad97[_0x3e5b('0x45')][_0x3e5b('0x2c')]);}_0x1adb46[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x3aad97[_0x3e5b('0x45')][_0x3e5b('0x4f')]);_0x1adb46['where']=qs['filters'](_[_0x3e5b('0x50')](_0x3aad97['query'],_0x1ec1f6['filters']));_0x1adb46[_0x3e5b('0x52')][_0x3e5b('0x69')]=_0x404621['id'];if(_0x3aad97[_0x3e5b('0x45')]['filter']){_0x1adb46[_0x3e5b('0x52')]=_['merge'](_0x1adb46[_0x3e5b('0x52')],{'$or':_['map'](_0x1adb46[_0x3e5b('0x49')],function(_0x923269){var _0x14941b={};_0x14941b[_0x923269]={'$like':'%'+_0x3aad97[_0x3e5b('0x45')]['filter']+'%'};return _0x14941b;})});}_0x1adb46=_[_0x3e5b('0x53')]({},_0x1adb46,_0x3aad97['options']);return db[_0x3e5b('0x6a')][_0x3e5b('0x2f')]({'where':_0x1adb46['where']})[_0x3e5b('0x35')](function(_0x3279cc){_0x12c93d[_0x3e5b('0x2f')]=_0x3279cc;if(_0x3aad97['query'][_0x3e5b('0x56')]){_0x1adb46[_0x3e5b('0x57')]=[{'all':!![]}];}return db[_0x3e5b('0x6a')]['findAll'](_0x1adb46);})[_0x3e5b('0x35')](function(_0x14610c){_0x12c93d['rows']=_0x14610c;return _0x12c93d;});}})[_0x3e5b('0x35')](respondWithFilteredResult(_0x2d5685,_0x1adb46))[_0x3e5b('0x5a')](handleError(_0x2d5685,null));};exports[_0x3e5b('0x6c')]=function(_0x5b2014,_0x3b3306,_0x30e079){return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x5b2014['params']['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x3b3306,null))['then'](function(_0xbe6415){if(_0xbe6415){return _0xbe6415['removeDispositions'](_0x5b2014[_0x3e5b('0x45')][_0x3e5b('0x6d')]);}})['then'](respondWithStatusCode(_0x3b3306,null))[_0x3e5b('0x5a')](handleError(_0x3b3306,null));};exports[_0x3e5b('0x6e')]=function(_0x56ff9d,_0x1f734a,_0x271930){if(_0x56ff9d[_0x3e5b('0x67')]['id']){delete _0x56ff9d[_0x3e5b('0x67')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x56ff9d[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x1f734a,null))[_0x3e5b('0x35')](function(_0x330a36){if(_0x330a36){_0x56ff9d[_0x3e5b('0x67')][_0x3e5b('0x69')]=_0x330a36['id'];return db['CannedAnswer']['create'](_0x56ff9d[_0x3e5b('0x67')]);}})[_0x3e5b('0x35')](respondWithResult(_0x1f734a,null))[_0x3e5b('0x5a')](handleError(_0x1f734a,null));};exports[_0x3e5b('0x6f')]=function(_0x3e0a65,_0x3f1a82,_0x27d9dc){var _0x3a0b44={'raw':![],'where':{}};var _0x4f1571={};var _0x5254be={'count':0x0,'rows':[]};return db[_0x3e5b('0x3f')]['findOne']({'where':{'id':_0x3e0a65[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x3f1a82,null))[_0x3e5b('0x35')](function(_0x27fa74){if(_0x27fa74){_0x4f1571[_0x3e5b('0x44')]=_[_0x3e5b('0x46')](db[_0x3e5b('0x70')][_0x3e5b('0x40')]);_0x4f1571[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x3e0a65[_0x3e5b('0x45')]);_0x4f1571[_0x3e5b('0x47')]=_[_0x3e5b('0x48')](_0x4f1571['model'],_0x4f1571['query']);_0x3a0b44[_0x3e5b('0x49')]=_[_0x3e5b('0x48')](_0x4f1571[_0x3e5b('0x44')],qs[_0x3e5b('0x4a')](_0x3e0a65['query'][_0x3e5b('0x4a')]));_0x3a0b44['attributes']=_0x3a0b44[_0x3e5b('0x49')]['length']?_0x3a0b44[_0x3e5b('0x49')]:_0x4f1571[_0x3e5b('0x44')];if(!_0x3e0a65[_0x3e5b('0x45')][_0x3e5b('0x4c')](_0x3e5b('0x4d'))){_0x3a0b44[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x3e0a65[_0x3e5b('0x45')][_0x3e5b('0x2e')]);_0x3a0b44['offset']=qs[_0x3e5b('0x2c')](_0x3e0a65[_0x3e5b('0x45')]['offset']);}_0x3a0b44[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x3e0a65[_0x3e5b('0x45')][_0x3e5b('0x4f')]);_0x3a0b44[_0x3e5b('0x52')]=qs[_0x3e5b('0x47')](_[_0x3e5b('0x50')](_0x3e0a65[_0x3e5b('0x45')],_0x4f1571[_0x3e5b('0x47')]));_0x3a0b44[_0x3e5b('0x52')][_0x3e5b('0x69')]=_0x27fa74['id'];if(_0x3e0a65[_0x3e5b('0x45')]['filter']){_0x3a0b44[_0x3e5b('0x52')]=_[_0x3e5b('0x53')](_0x3a0b44['where'],{'$or':_['map'](_0x3a0b44[_0x3e5b('0x49')],function(_0x47138e){var _0x3361bb={};_0x3361bb[_0x47138e]={'$like':'%'+_0x3e0a65[_0x3e5b('0x45')][_0x3e5b('0x51')]+'%'};return _0x3361bb;})});}_0x3a0b44=_['merge']({},_0x3a0b44,_0x3e0a65[_0x3e5b('0x55')]);return db[_0x3e5b('0x70')]['count']({'where':_0x3a0b44['where']})[_0x3e5b('0x35')](function(_0x1d92f0){_0x5254be['count']=_0x1d92f0;if(_0x3e0a65['query'][_0x3e5b('0x56')]){_0x3a0b44[_0x3e5b('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3e5b('0x58')](_0x3a0b44);})[_0x3e5b('0x35')](function(_0x1f7676){_0x5254be[_0x3e5b('0x59')]=_0x1f7676;return _0x5254be;});}})[_0x3e5b('0x35')](respondWithFilteredResult(_0x3f1a82,_0x3a0b44))['catch'](handleError(_0x3f1a82,null));};exports['removeAnswers']=function(_0x239c4d,_0x39dc3c,_0x253dfa){return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x239c4d[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x39dc3c,null))[_0x3e5b('0x35')](function(_0x37f34c){if(_0x37f34c){return _0x37f34c[_0x3e5b('0x71')](_0x239c4d[_0x3e5b('0x45')][_0x3e5b('0x6d')]);}})[_0x3e5b('0x35')](respondWithStatusCode(_0x39dc3c,null))[_0x3e5b('0x5a')](handleError(_0x39dc3c,null));};exports[_0x3e5b('0x72')]=function(_0x3ca1fb,_0x34edb6,_0x1d1723){var _0x1915ab={'body':_0x3ca1fb[_0x3e5b('0x67')],'channel':_0x3e5b('0x73')};var _0x349daa=[];var _0x2464f3=[];var _0x2d4a6d={};var _0x408070=![];return db['CmContact']['describe']()[_0x3e5b('0x35')](function(_0x15577d){if(!_0x15577d){throw new db[(_0x3e5b('0x74'))][(_0x3e5b('0x75'))]('no\x20available\x20attributes');}_0x349daa=_[_0x3e5b('0x76')](_['keys'](_0x15577d),[_0x3e5b('0x77'),_0x3e5b('0x78')]);_0x2464f3=_[_0x3e5b('0x76')](_[_0x3e5b('0x46')](_0x15577d),[_0x3e5b('0x77'),'updatedAt',_0x3e5b('0x79'),_0x3e5b('0x7a')]);if(_0x3ca1fb[_0x3e5b('0x67')]['id']){delete _0x3ca1fb[_0x3e5b('0x67')]['id'];}if(_[_0x3e5b('0x7b')](_0x3ca1fb[_0x3e5b('0x67')]['from'])){throw new db['Sequelize'][(_0x3e5b('0x75'))]('from\x20is\x20mandatory');}if(_[_0x3e5b('0x7b')](_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x67')])||_0x3ca1fb[_0x3e5b('0x67')]['body']===''){throw new db['Sequelize'][(_0x3e5b('0x75'))](_0x3e5b('0x7c'));}if(_[_0x3e5b('0x7b')](_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x7d')])){throw new db[(_0x3e5b('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2464f3);}if(!_[_0x3e5b('0x7e')](_0x2464f3,_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x7d')])){throw new db[(_0x3e5b('0x74'))][(_0x3e5b('0x75'))](_0x3e5b('0x7f')+_0x2464f3);}_0x2d4a6d[_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x7d')]]=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x80')];})[_0x3e5b('0x35')](function(){return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x3ca1fb[_0x3e5b('0x5c')]['id']},'include':[{'model':db[_0x3e5b('0x81')],'as':'List','include':[{'model':db[_0x3e5b('0x82')],'as':_0x3e5b('0x83'),'where':_0x2d4a6d,'limit':0x1,'order':[[_0x3e5b('0x78'),_0x3e5b('0x84')]]}]},{'model':db[_0x3e5b('0x85')],'as':_0x3e5b('0x86')}]});})[_0x3e5b('0x35')](handleEntityNotFound(_0x34edb6,null))['then'](function(_0x309326){if(_0x309326&&_0x309326[_0x3e5b('0x87')]){_0x1915ab[_0x3e5b('0x88')]=_0x309326;_0x1915ab[_0x3e5b('0x89')]=_0x309326['Applications'];_0x1915ab[_0x3e5b('0x8a')]=_0x309326[_0x3e5b('0x87')];_0x1915ab[_0x3e5b('0x89')]=_[_0x3e5b('0x8b')](_0x1915ab[_0x3e5b('0x89')],[_0x3e5b('0x8c')],[_0x3e5b('0x8d')]);if(_0x1915ab[_0x3e5b('0x88')][_0x3e5b('0x86')]){delete _0x1915ab[_0x3e5b('0x88')][_0x3e5b('0x86')];}if(_0x1915ab[_0x3e5b('0x88')]['List']&&_0x1915ab[_0x3e5b('0x88')][_0x3e5b('0x87')][_0x3e5b('0x83')][_0x3e5b('0x4b')]){return _0x1915ab[_0x3e5b('0x88')][_0x3e5b('0x87')][_0x3e5b('0x83')][0x0];}var _0x2fe546=_[_0x3e5b('0x1a')](_0x3ca1fb['body'],{'firstName':_0x3ca1fb['body'][_0x3e5b('0x80')],'ListId':_0x309326[_0x3e5b('0x7a')]});_0x2fe546[_0x3ca1fb[_0x3e5b('0x67')]['mapKey']]=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x80')];return db['CmContact'][_0x3e5b('0x5e')](_0x2fe546,{'fields':_0x349daa,'raw':!![]});}})[_0x3e5b('0x35')](handleEntityNotFound(_0x34edb6,null))[_0x3e5b('0x35')](function(_0x30cf58){_0x1915ab[_0x3e5b('0x8e')]=_0x30cf58;if(_0x30cf58){var _0x129ba4={'ContactId':_0x30cf58['id'],'OpenchannelAccountId':_0x3ca1fb[_0x3e5b('0x5c')]['id'],'from':(_0x30cf58[_0x3e5b('0x8f')]||'')+'\x20'+(_0x30cf58[_0x3e5b('0x90')]||'')};var _0x8c2eb2={'OpenchannelAccountId':_0x3ca1fb['params']['id'],'closed':![]};if(_0x3ca1fb[_0x3e5b('0x67')]['threadId']){_0x8c2eb2[_0x3e5b('0x91')]=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x91')];return db[_0x3e5b('0x92')][_0x3e5b('0x64')]({'where':_0x8c2eb2})['then'](function(_0x169db3){if(_0x169db3){return[_0x169db3,![]];}_0x129ba4[_0x3e5b('0x91')]=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x91')];_0x129ba4[_0x3e5b('0x93')]=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x93')];return db['OpenchannelInteraction'][_0x3e5b('0x5e')](_0x129ba4)[_0x3e5b('0x35')](function(_0x5027ef){return[_0x5027ef,!![]];});});}else{_0x8c2eb2[_0x3e5b('0x91')]=null;}_0x8c2eb2[_0x3e5b('0x94')]=_0x30cf58['id'];return db['OpenchannelInteraction']['find']({'where':_0x8c2eb2})['then'](function(_0x2b225b){if(_0x2b225b){return[_0x2b225b,![]];}return db[_0x3e5b('0x92')][_0x3e5b('0x5e')](_0x129ba4)['then'](function(_0x4a70a0){return[_0x4a70a0,!![]];});});}})[_0x3e5b('0x95')](function(_0x4689cb,_0x53d05f){if(_0x4689cb){_0x408070=_0x53d05f;if(!_0x53d05f){var _0x513be2={'from':(_0x1915ab[_0x3e5b('0x8e')][_0x3e5b('0x8f')]||'')+'\x20'+(_0x1915ab[_0x3e5b('0x8e')][_0x3e5b('0x90')]||'')};if(_0x3ca1fb[_0x3e5b('0x67')]['threadId']&&_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x96')]&&_0x3ca1fb[_0x3e5b('0x67')]['threadId']!=_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x96')]){_0x513be2[_0x3e5b('0x91')]=_0x3ca1fb['body']['messageId'];}return _0x4689cb[_0x3e5b('0x34')](_0x513be2);}else{return _0x4689cb;}}})[_0x3e5b('0x35')](function(_0x1d1f1c){_0x1915ab[_0x3e5b('0x97')]=_0x1d1f1c[_0x3e5b('0x37')]({'plain':!![]});_0x1915ab['interaction'][_0x3e5b('0x98')]=_0x408070;if(_0x1915ab[_0x3e5b('0x97')][_0x3e5b('0x98')]){if(_0x1915ab[_0x3e5b('0x88')][_0x3e5b('0x99')]){_0x1915ab[_0x3e5b('0x89')]['push']({'id':0x0,'priority':_0x1915ab[_0x3e5b('0x89')][_0x3e5b('0x4b')]+0x1,'app':_0x3e5b('0x9a'),'appdata':'unmanaged','interval':_0x3e5b('0x9b')});}}return db[_0x3e5b('0x9c')][_0x3e5b('0x5e')]({'body':_0x3ca1fb[_0x3e5b('0x67')][_0x3e5b('0x67')],'OpenchannelAccountId':_0x3ca1fb['params']['id'],'OpenchannelInteractionId':_0x1d1f1c['id'],'direction':'in','ContactId':_0x1915ab['contact']['id'],'AttachmentId':_0x3ca1fb['body']['AttachmentId']});})['then'](function(_0x11ce0e){_0x1915ab[_0x3e5b('0x27')]=_0x11ce0e;if(_0x1915ab[_0x3e5b('0x97')]['UserId']){return db[_0x3e5b('0x9d')]['find']({'attributes':['id','name'],'where':{'id':_0x1915ab[_0x3e5b('0x97')][_0x3e5b('0x9e')]}})['then'](function(_0x24b5d9){if(_0x24b5d9){_0x1915ab['applications'][_0x3e5b('0x9f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x24b5d9[_0x3e5b('0x3b')]+','+(_0x1915ab[_0x3e5b('0x88')][_0x3e5b('0xa0')]||0xa),'interval':_0x3e5b('0x9b')});_0x1915ab['forcedOwnership']=![];}return respondWithRpcPromise(_0x3e5b('0xa1'),_0x3e5b('0xa2'),_0x1915ab);});}return respondWithRpcPromise(_0x3e5b('0xa1'),_0x3e5b('0xa2'),_0x1915ab);})[_0x3e5b('0x35')](function(_0x59762c){respondWithRpcPromise(_0x3e5b('0xa3'),_0x3e5b('0xa3'),{'event':'notify','message':_0x59762c},client9002);return _0x59762c;})[_0x3e5b('0x35')](respondWithResult(_0x34edb6,null))['catch'](handleError(_0x34edb6,null));};exports[_0x3e5b('0xa4')]=function(_0x3436ad,_0x46409b){var _0x5a748b=_0x3436ad['params']['id'];var _0x589bc6=_0x3436ad['body'];var _0x814ed6=0xc8;var _0x3b06ea=null;return db[_0x3e5b('0xa5')][_0x3e5b('0xa6')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x3e5b('0xa7')]},function(_0x1575f3){return db[_0x3e5b('0x3f')]['findOne']({'where':{'id':_0x5a748b},'transaction':_0x1575f3})[_0x3e5b('0x35')](function(_0x230473){if(_0x230473){return db[_0x3e5b('0x85')]['destroy']({'where':{'OpenchannelAccountId':_0x5a748b},'transaction':_0x1575f3})[_0x3e5b('0x35')](function(){var _0x5f5a8b=_[_0x3e5b('0x3e')](_0x589bc6,function(_0x55dff5){_0x55dff5[_0x3e5b('0x69')]=_0x5a748b;return _0x55dff5;});return db[_0x3e5b('0x85')][_0x3e5b('0xa8')](_0x5f5a8b,{'transaction':_0x1575f3});});}else{_0x814ed6=0x194;_0x3b06ea=[];}});})[_0x3e5b('0x35')](function(){if(_0x814ed6!==0x194){return db[_0x3e5b('0x85')][_0x3e5b('0xa9')]({'where':{'OpenchannelAccountId':_0x5a748b},'order':_0x3e5b('0x8c')})['then'](function(_0x400e7e){_0x3b06ea=_0x400e7e;});}})['catch'](function(_0x259c6d){_0x814ed6=0x1f4;logger['error'](_0x259c6d[_0x3e5b('0x3a')]);if(_0x259c6d['name']){delete _0x259c6d[_0x3e5b('0x3b')];}_0x3b06ea=_0x259c6d;})[_0x3e5b('0xaa')](function(){if(_0x3b06ea===null){_0x46409b[_0x3e5b('0x29')](_0x814ed6);}else{if(_0x814ed6===0x1f4){_0x46409b[_0x3e5b('0x2a')](_0x814ed6)[_0x3e5b('0x3c')](_0x3b06ea);}else{_0x46409b[_0x3e5b('0x2a')](_0x814ed6)[_0x3e5b('0x2b')](_0x3b06ea);}}});};exports['getApplications']=function(_0x48ae5b,_0x196090,_0xbac664){var _0x21a2a6={};var _0x5c051f={};var _0x4a1cba;var _0x2bb69d;return db['OpenchannelAccount'][_0x3e5b('0xab')]({'where':{'id':_0x48ae5b[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x196090,null))[_0x3e5b('0x35')](function(_0x1f5247){if(_0x1f5247){_0x4a1cba=_0x1f5247;_0x5c051f[_0x3e5b('0x44')]=_[_0x3e5b('0x46')](db[_0x3e5b('0x85')][_0x3e5b('0x40')]);_0x5c051f['query']=_[_0x3e5b('0x46')](_0x48ae5b[_0x3e5b('0x45')]);_0x5c051f['filters']=_[_0x3e5b('0x48')](_0x5c051f[_0x3e5b('0x44')],_0x5c051f['query']);_0x21a2a6[_0x3e5b('0x49')]=_[_0x3e5b('0x48')](_0x5c051f['model'],qs[_0x3e5b('0x4a')](_0x48ae5b['query'][_0x3e5b('0x4a')]));_0x21a2a6['attributes']=_0x21a2a6[_0x3e5b('0x49')]['length']?_0x21a2a6[_0x3e5b('0x49')]:_0x5c051f[_0x3e5b('0x44')];_0x21a2a6[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x48ae5b[_0x3e5b('0x45')][_0x3e5b('0x4f')]);_0x21a2a6[_0x3e5b('0x52')]=qs['filters'](_[_0x3e5b('0x50')](_0x48ae5b[_0x3e5b('0x45')],_0x5c051f[_0x3e5b('0x47')]));if(_0x48ae5b[_0x3e5b('0x45')][_0x3e5b('0x51')]){_0x21a2a6[_0x3e5b('0x52')]=_[_0x3e5b('0x53')](_0x21a2a6[_0x3e5b('0x52')],{'$or':_[_0x3e5b('0x3e')](_0x21a2a6[_0x3e5b('0x49')],function(_0x377fa7){var _0x14cdf0={};_0x14cdf0[_0x377fa7]={'$like':'%'+_0x48ae5b[_0x3e5b('0x45')]['filter']+'%'};return _0x14cdf0;})});}_0x21a2a6=_[_0x3e5b('0x53')]({},_0x21a2a6,_0x48ae5b[_0x3e5b('0x55')]);return _0x4a1cba[_0x3e5b('0xac')](_0x21a2a6);}})[_0x3e5b('0x35')](function(_0x13c263){if(_0x13c263){_0x2bb69d=_0x13c263[_0x3e5b('0x4b')];if(!_0x48ae5b[_0x3e5b('0x45')][_0x3e5b('0x4c')](_0x3e5b('0x4d'))){_0x21a2a6[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x48ae5b['query']['limit']);_0x21a2a6['offset']=qs[_0x3e5b('0x2c')](_0x48ae5b[_0x3e5b('0x45')][_0x3e5b('0x2c')]);}return _0x4a1cba[_0x3e5b('0xac')](_0x21a2a6);}})[_0x3e5b('0x35')](function(_0x268453){if(_0x268453){return _0x268453?{'count':_0x2bb69d,'rows':_0x268453}:null;}})[_0x3e5b('0x35')](respondWithResult(_0x196090,null))[_0x3e5b('0x5a')](handleError(_0x196090,null));};exports['getInteractions']=function(_0x1b4d1b,_0x2d0419,_0x1327e4){var _0x27281e={'raw':![],'where':{}};var _0x273be1={};var _0x38da6a={'count':0x0,'rows':[]};return db[_0x3e5b('0x3f')][_0x3e5b('0xab')]({'where':{'id':_0x1b4d1b[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x2d0419,null))[_0x3e5b('0x35')](function(_0x38130d){if(_0x38130d){_0x273be1[_0x3e5b('0x44')]=_[_0x3e5b('0x46')](db['OpenchannelInteraction'][_0x3e5b('0x40')]);_0x273be1[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x1b4d1b[_0x3e5b('0x45')]);_0x273be1[_0x3e5b('0x47')]=_[_0x3e5b('0x48')](_0x273be1[_0x3e5b('0x44')],_0x273be1['query']);_0x27281e[_0x3e5b('0x49')]=_[_0x3e5b('0x48')](_0x273be1['model'],qs['fields'](_0x1b4d1b[_0x3e5b('0x45')][_0x3e5b('0x4a')]));_0x27281e[_0x3e5b('0x49')]=_0x27281e[_0x3e5b('0x49')][_0x3e5b('0x4b')]?_0x27281e['attributes']:_0x273be1[_0x3e5b('0x44')];if(!_0x1b4d1b[_0x3e5b('0x45')][_0x3e5b('0x4c')]('nolimit')){_0x27281e['limit']=qs[_0x3e5b('0x2e')](_0x1b4d1b[_0x3e5b('0x45')][_0x3e5b('0x2e')]);_0x27281e['offset']=qs[_0x3e5b('0x2c')](_0x1b4d1b[_0x3e5b('0x45')]['offset']);}_0x27281e[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x1b4d1b[_0x3e5b('0x45')][_0x3e5b('0x4f')]);_0x27281e[_0x3e5b('0x52')]=qs['filters'](_[_0x3e5b('0x50')](_0x1b4d1b[_0x3e5b('0x45')],_0x273be1[_0x3e5b('0x47')]));_0x27281e['where'][_0x3e5b('0x69')]=_0x38130d['id'];if(_0x1b4d1b[_0x3e5b('0x45')]['filter']){_0x27281e['where']=_[_0x3e5b('0x53')](_0x27281e[_0x3e5b('0x52')],{'$or':_['map'](_0x27281e[_0x3e5b('0x49')],function(_0x489282){var _0x5b07ce={};_0x5b07ce[_0x489282]={'$like':'%'+_0x1b4d1b['query'][_0x3e5b('0x51')]+'%'};return _0x5b07ce;})});}_0x27281e=_[_0x3e5b('0x53')]({},_0x27281e,_0x1b4d1b[_0x3e5b('0x55')]);return db[_0x3e5b('0x92')]['count']({'where':_0x27281e['where']})[_0x3e5b('0x35')](function(_0x2af831){_0x38da6a[_0x3e5b('0x2f')]=_0x2af831;if(_0x1b4d1b[_0x3e5b('0x45')]['includeAll']){_0x27281e[_0x3e5b('0x57')]=[{'model':db['CmContact'],'as':_0x3e5b('0xad'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x3e5b('0x3b'),'fullname',_0x3e5b('0xae')],'required':![]},{'model':db[_0x3e5b('0xaf')],'as':_0x3e5b('0xb0'),'attributes':['id','name','color'],'where':_0x1b4d1b['query']['tag']?{'id':_0x1b4d1b['query'][_0x3e5b('0xb1')]}:undefined,'required':_0x1b4d1b[_0x3e5b('0x45')][_0x3e5b('0xb1')]?!![]:![]}];}return db[_0x3e5b('0x92')]['findAll'](_0x27281e);})[_0x3e5b('0x35')](function(_0x3290d0){_0x38da6a[_0x3e5b('0x59')]=_0x3290d0;return _0x38da6a;});}})[_0x3e5b('0x35')](respondWithFilteredResult(_0x2d0419,_0x27281e))[_0x3e5b('0x5a')](handleError(_0x2d0419,null));};exports[_0x3e5b('0xb2')]=function(_0x4803f2,_0x373066,_0x329027){return db[_0x3e5b('0x3f')][_0x3e5b('0x64')]({'where':{'id':_0x4803f2[_0x3e5b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x373066,null))[_0x3e5b('0x35')](function(_0x46a7c5){if(_0x46a7c5){return _0x46a7c5['addAgents'](_0x4803f2[_0x3e5b('0x67')][_0x3e5b('0x6d')],_[_0x3e5b('0xb3')](_0x4803f2[_0x3e5b('0x67')],['ids','id'])||{})['spread'](function(_0x1f8d6f){for(var _0x255a6b=0x0;_0x255a6b<_0x4803f2[_0x3e5b('0x67')]['ids']['length'];_0x255a6b+=0x1){socket['emit'](_0x3e5b('0xb4'),{'UserId':Number(_0x4803f2[_0x3e5b('0x67')]['ids'][_0x255a6b]),'OpenchannelAccountId':Number(_0x4803f2[_0x3e5b('0x5c')]['id'])});}return _0x1f8d6f;});}})['then'](respondWithResult(_0x373066,null))[_0x3e5b('0x5a')](handleError(_0x373066,null));};exports[_0x3e5b('0xb5')]=function(_0xb323e6,_0x101ee6,_0x404d36){return db['OpenchannelAccount']['find']({'where':{'id':_0xb323e6[_0x3e5b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x101ee6,null))[_0x3e5b('0x35')](function(_0xa7a20e){if(_0xa7a20e){return _0xa7a20e[_0x3e5b('0xb5')](_0xb323e6['query'][_0x3e5b('0x6d')])[_0x3e5b('0x35')](function(){if(_['isArray'](_0xb323e6['query'][_0x3e5b('0x6d')])){for(var _0x5315d1=0x0;_0x5315d1<_0xb323e6['query'][_0x3e5b('0x6d')][_0x3e5b('0x4b')];_0x5315d1+=0x1){socket[_0x3e5b('0xb6')](_0x3e5b('0xb7'),{'UserId':Number(_0xb323e6[_0x3e5b('0x45')][_0x3e5b('0x6d')][_0x5315d1]),'OpenchannelAccountId':Number(_0xb323e6[_0x3e5b('0x5c')]['id'])});}}else{socket[_0x3e5b('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0xb323e6['query'][_0x3e5b('0x6d')]),'OpenchannelAccountId':Number(_0xb323e6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x101ee6,null))[_0x3e5b('0x5a')](handleError(_0x101ee6,null));};exports['getAgents']=function(_0x1fe234,_0x1f0764,_0x1eae47){var _0x24f71b={};var _0x17445f={};var _0x242093;var _0x1b1564;return db[_0x3e5b('0x3f')][_0x3e5b('0xab')]({'where':{'id':_0x1fe234[_0x3e5b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1f0764,null))[_0x3e5b('0x35')](function(_0x502f84){if(_0x502f84){_0x242093=_0x502f84;_0x17445f['model']=_[_0x3e5b('0x46')](db[_0x3e5b('0x9d')]['rawAttributes']);_0x17445f[_0x3e5b('0x45')]=_[_0x3e5b('0x46')](_0x1fe234[_0x3e5b('0x45')]);_0x17445f[_0x3e5b('0x47')]=_['intersection'](_0x17445f[_0x3e5b('0x44')],_0x17445f['query']);_0x24f71b[_0x3e5b('0x49')]=_[_0x3e5b('0x48')](_0x17445f[_0x3e5b('0x44')],qs[_0x3e5b('0x4a')](_0x1fe234['query'][_0x3e5b('0x4a')]));_0x24f71b[_0x3e5b('0x49')]=_0x24f71b[_0x3e5b('0x49')][_0x3e5b('0x4b')]?_0x24f71b[_0x3e5b('0x49')]:_0x17445f['model'];_0x24f71b[_0x3e5b('0x4e')]=qs[_0x3e5b('0x4f')](_0x1fe234[_0x3e5b('0x45')][_0x3e5b('0x4f')]);_0x24f71b['where']=qs['filters'](_[_0x3e5b('0x50')](_0x1fe234[_0x3e5b('0x45')],_0x17445f[_0x3e5b('0x47')]));if(_0x1fe234[_0x3e5b('0x45')]['filter']){_0x24f71b[_0x3e5b('0x52')]=_['merge'](_0x24f71b[_0x3e5b('0x52')],{'$or':_['map'](_0x24f71b[_0x3e5b('0x49')],function(_0x296385){var _0x43ac9a={};_0x43ac9a[_0x296385]={'$like':'%'+_0x1fe234[_0x3e5b('0x45')][_0x3e5b('0x51')]+'%'};return _0x43ac9a;})});}_0x24f71b=_[_0x3e5b('0x53')]({},_0x24f71b,_0x1fe234[_0x3e5b('0x55')]);return _0x242093[_0x3e5b('0xb8')](_0x24f71b);}})[_0x3e5b('0x35')](function(_0xef7c8e){if(_0xef7c8e){_0x1b1564=_0xef7c8e[_0x3e5b('0x4b')];if(!_0x1fe234[_0x3e5b('0x45')][_0x3e5b('0x4c')](_0x3e5b('0x4d'))){_0x24f71b[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x1fe234['query']['limit']);_0x24f71b['offset']=qs[_0x3e5b('0x2c')](_0x1fe234[_0x3e5b('0x45')][_0x3e5b('0x2c')]);}return _0x242093['getAgents'](_0x24f71b);}})[_0x3e5b('0x35')](function(_0x16bb54){if(_0x16bb54){return _0x16bb54?{'count':_0x1b1564,'rows':_0x16bb54}:null;}})[_0x3e5b('0x35')](respondWithResult(_0x1f0764,null))[_0x3e5b('0x5a')](handleError(_0x1f0764,null));};exports[_0x3e5b('0x3c')]=function(_0x26c3e8,_0x28b795,_0x4752b9){var _0x3c0a42,_0x464c80,_0x5cebed;if(_[_0x3e5b('0x7b')](_0x26c3e8[_0x3e5b('0x67')]['body'])||_0x26c3e8[_0x3e5b('0x67')][_0x3e5b('0x67')]===''){throw new db[(_0x3e5b('0x74'))][(_0x3e5b('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3e5b('0x7b')](_0x26c3e8['body']['to'])){}_0x3c0a42=_0x26c3e8[_0x3e5b('0x67')]['to'];return db[_0x3e5b('0x3f')]['findOne']({'where':{'id':_0x26c3e8[_0x3e5b('0x5c')]['id']}})[_0x3e5b('0x35')](handleEntityNotFound(_0x28b795,null))['then'](function(_0x5bc879){if(_0x5bc879){return db['OpenchannelAccount'][_0x3e5b('0x64')]({'where':{'id':_0x5bc879['id']},'include':[{'model':db[_0x3e5b('0x81')],'as':_0x3e5b('0x87'),'include':[{'model':db[_0x3e5b('0x82')],'as':_0x3e5b('0x83'),'where':{[_0x5bc879[_0x3e5b('0x7d')]]:_0x3c0a42},'limit':0x1,'order':[[_0x3e5b('0x78'),_0x3e5b('0x84')]]}]}]})[_0x3e5b('0x35')](handleEntityNotFound(_0x28b795,null))[_0x3e5b('0x35')](function(_0x2127ca){if(_0x2127ca&&_0x2127ca[_0x3e5b('0x87')]){_0x464c80=_0x2127ca[_0x3e5b('0x37')]({'plain':!![]});if(_0x464c80['List']&&_0x464c80[_0x3e5b('0x87')][_0x3e5b('0x83')]['length']){return _0x464c80['List']['Contacts'][0x0];}return db[_0x3e5b('0x82')]['create'](_[_0x3e5b('0x1a')](_0x26c3e8[_0x3e5b('0x67')],{'firstName':_0x3c0a42,[_0x2127ca[_0x3e5b('0x7d')]]:_0x3c0a42,'phone':_0x3c0a42,'ListId':_0x464c80[_0x3e5b('0x7a')]}));}})['then'](handleEntityNotFound(_0x28b795,null))['then'](function(_0x7b5fd5){if(_0x7b5fd5){_0x5cebed=_0x7b5fd5;return db[_0x3e5b('0x92')][_0x3e5b('0x64')]({'where':{'ContactId':_0x5cebed['id'],'closed':![],'OpenchannelAccountId':_0x464c80['id']}})[_0x3e5b('0x35')](function(_0x1cd1a4){if(_0x1cd1a4){return[_0x1cd1a4,![]];}return db[_0x3e5b('0x92')]['create']({'UserId':_0x26c3e8['user']['id'],'ContactId':_0x5cebed['id'],'OpenchannelAccountId':_0x464c80['id'],'lastMsgDirection':_0x3e5b('0xb9'),'firstMsgDirection':_0x3e5b('0xb9'),'Messages':[_['merge'](_0x26c3e8['body'],{'read':![],'body':_0x26c3e8[_0x3e5b('0x67')][_0x3e5b('0x67')],'OpenchannelAccountId':_0x464c80['id'],'UserId':_0x26c3e8[_0x3e5b('0x5f')]['id'],'ContactId':_0x5cebed['id']})]},{'include':[{'model':db[_0x3e5b('0x9c')],'as':'Messages'}]})[_0x3e5b('0x35')](function(_0x227f5d){return[_0x227f5d,!![]];});});}})[_0x3e5b('0x95')](function(_0x153d8f,_0x8f839b){if(_0x8f839b){return _0x153d8f;}return db[_0x3e5b('0x9c')][_0x3e5b('0x5e')](_[_0x3e5b('0x53')](_0x26c3e8[_0x3e5b('0x67')],{'read':![],'body':_0x26c3e8['body'][_0x3e5b('0x67')],'OpenchannelAccountId':_0x464c80['id'],'OpenchannelInteractionId':_0x153d8f['id'],'UserId':_0x26c3e8['user']['id'],'ContactId':_0x5cebed['id']}))[_0x3e5b('0x35')](function(_0xd01ac6){_0x153d8f[_0x3e5b('0xba')][_0x3e5b('0xbb')]=[];_0x153d8f[_0x3e5b('0xba')][_0x3e5b('0xbb')]['push'](_0xd01ac6['dataValues']);return _0x153d8f;});});}})[_0x3e5b('0x35')](respondWithResult(_0x28b795,null))[_0x3e5b('0x5a')](handleError(_0x28b795,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 36b2688..4fda418 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 _0x2750=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x2ef2f4,_0x2c5c26){var _0x13934b=function(_0x23319d){while(--_0x23319d){_0x2ef2f4['push'](_0x2ef2f4['shift']());}};_0x13934b(++_0x2c5c26);}(_0x2750,0x13b));var _0x0275=function(_0x148531,_0x4bd979){_0x148531=_0x148531-0x0;var _0x3ee329=_0x2750[_0x148531];return _0x3ee329;};'use strict';var EventEmitter=require(_0x0275('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x0275('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x0275('0x2')](0x0);var events={'afterCreate':_0x0275('0x3'),'afterUpdate':_0x0275('0x4'),'afterDestroy':_0x0275('0x5')};function emitEvent(_0x41ec06){return function(_0x20273d,_0x4960,_0x3d0c9c){OpenchannelAccountEvents[_0x0275('0x6')](_0x41ec06+':'+_0x20273d['id'],_0x20273d);OpenchannelAccountEvents['emit'](_0x41ec06,_0x20273d);_0x3d0c9c(null);};}for(var e in events){if(events[_0x0275('0x7')](e)){var event=events[e];OpenchannelAccount[_0x0275('0x8')](e,emitEvent(event));}}module[_0x0275('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x750a=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x568d30,_0x50fceb){var _0xabb817=function(_0x1167f3){while(--_0x1167f3){_0x568d30['push'](_0x568d30['shift']());}};_0xabb817(++_0x50fceb);}(_0x750a,0x140));var _0xa750=function(_0x39ce42,_0x433108){_0x39ce42=_0x39ce42-0x0;var _0x350573=_0x750a[_0x39ce42];return _0x350573;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xa750('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa750('0x1'),'afterUpdate':_0xa750('0x2'),'afterDestroy':_0xa750('0x3')};function emitEvent(_0x19bd5f){return function(_0x457cae,_0x43d704,_0x562911){OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f+':'+_0x457cae['id'],_0x457cae);OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f,_0x457cae);_0x562911(null);};}for(var e in events){if(events[_0xa750('0x5')](e)){var event=events[e];OpenchannelAccount[_0xa750('0x6')](e,emitEvent(event));}}module[_0xa750('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 26ff8e1..b84c076 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(_0x5c6356,_0x49e36f){var _0x4c2ffc=function(_0x259322){while(--_0x259322){_0x5c6356['push'](_0x5c6356['shift']());}};_0x4c2ffc(++_0x49e36f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x744b44,_0x11819b){var _0x5c9a9b=function(_0x320658){while(--_0x320658){_0x744b44['push'](_0x744b44['shift']());}};_0x5c9a9b(++_0x11819b);}(_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 diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index b3e3994..d113cf4 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 _0x9861=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent'];(function(_0xd03c6d,_0x1981eb){var _0x1fe144=function(_0x2a7a09){while(--_0x2a7a09){_0xd03c6d['push'](_0xd03c6d['shift']());}};_0x1fe144(++_0x1981eb);}(_0x9861,0x176));var _0x1986=function(_0x50bd0a,_0x1c915f){_0x50bd0a=_0x50bd0a-0x0;var _0x5308d6=_0x9861[_0x50bd0a];return _0x5308d6;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1986('0x1'));var rs=require(_0x1986('0x2'));var fs=require('fs');var Redis=require(_0x1986('0x3'));var db=require(_0x1986('0x4'))['db'];var utils=require(_0x1986('0x5'));var logger=require(_0x1986('0x6'))('rpc');var config=require(_0x1986('0x7'));var jayson=require(_0x1986('0x8'));var client=jayson[_0x1986('0x9')][_0x1986('0xa')]({'port':0x232a});config[_0x1986('0xb')]=_[_0x1986('0xc')](config[_0x1986('0xb')],{'host':_0x1986('0xd'),'port':0x18eb});var socket=require(_0x1986('0xe'))(new Redis(config[_0x1986('0xb')]));require('./openchannelAccount.socket')[_0x1986('0xf')](socket);function respondWithRpcPromise(_0x1578f9,_0x66f64d,_0xb0e57b){return new BPromise(function(_0x47ab59,_0x3ef718){return client[_0x1986('0x10')](_0x1578f9,_0xb0e57b)['then'](function(_0x1e337d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x66f64d,_0x1986('0x11'));logger[_0x1986('0x12')](_0x1986('0x13'),_0x66f64d,_0x1986('0x11'),JSON[_0x1986('0x14')](_0x1e337d));if(_0x1e337d[_0x1986('0x15')]){if(_0x1e337d[_0x1986('0x15')][_0x1986('0x16')]===0x1f4){logger[_0x1986('0x15')](_0x1986('0x17'),_0x66f64d,_0x1e337d['error']['message']);return _0x3ef718(_0x1e337d[_0x1986('0x15')][_0x1986('0x18')]);}logger['error'](_0x1986('0x17'),_0x66f64d,_0x1e337d[_0x1986('0x15')][_0x1986('0x18')]);return _0x47ab59(_0x1e337d[_0x1986('0x15')][_0x1986('0x18')]);}else{logger[_0x1986('0x19')](_0x1986('0x17'),_0x66f64d,_0x1986('0x11'));_0x47ab59(_0x1e337d[_0x1986('0x1a')][_0x1986('0x18')]);}})[_0x1986('0x1b')](function(_0x235524){logger[_0x1986('0x15')](_0x1986('0x17'),_0x66f64d,_0x235524);_0x3ef718(_0x235524);});});} \ No newline at end of file +var _0xeffd=['redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xeffd,0x6b));var _0xdeff=function(_0x1adbde,_0x1294f2){_0x1adbde=_0x1adbde-0x0;var _0xca8ca0=_0xeffd[_0x1adbde];return _0xca8ca0;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});config[_0xdeff('0xd')]=_[_0xdeff('0xe')](config[_0xdeff('0xd')],{'host':_0xdeff('0xf'),'port':0x18eb});var socket=require(_0xdeff('0x10'))(new Redis(config['redis']));require(_0xdeff('0x11'))[_0xdeff('0x12')](socket);function respondWithRpcPromise(_0xf6d58d,_0x51fcb7,_0x1ff265){return new BPromise(function(_0x4423e9,_0x3c1482){return client[_0xdeff('0x13')](_0xf6d58d,_0x1ff265)[_0xdeff('0x14')](function(_0x256b73){logger[_0xdeff('0x15')](_0xdeff('0x16'),_0x51fcb7,'request\x20sent');logger[_0xdeff('0x17')](_0xdeff('0x18'),_0x51fcb7,'request\x20sent',JSON[_0xdeff('0x19')](_0x256b73));if(_0x256b73['error']){if(_0x256b73['error'][_0xdeff('0x1a')]===0x1f4){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')]['message']);return _0x3c1482(_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);}logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);return _0x4423e9(_0x256b73['error']['message']);}else{logger[_0xdeff('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x51fcb7,'request\x20sent');_0x4423e9(_0x256b73[_0xdeff('0x1d')][_0xdeff('0x1c')]);}})['catch'](function(_0x2de203){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x2de203);_0x3c1482(_0x2de203);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 584b34e..3c57af8 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 _0xdeb7=['save','remove','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x5743d9,_0x506537){var _0x2bcd90=function(_0x2474bd){while(--_0x2474bd){_0x5743d9['push'](_0x5743d9['shift']());}};_0x2bcd90(++_0x506537);}(_0xdeb7,0x77));var _0x7deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb7[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelAccountEvents=require(_0x7deb('0x0'));var events=[_0x7deb('0x1'),_0x7deb('0x2'),'update'];function createListener(_0x39dc68,_0x161729){return function(_0x6c21e2){_0x161729[_0x7deb('0x3')](_0x39dc68,_0x6c21e2);};}function removeListener(_0x307ce7,_0x5b89a9){return function(){OpenchannelAccountEvents[_0x7deb('0x4')](_0x307ce7,_0x5b89a9);};}exports[_0x7deb('0x5')]=function(_0x9283e7){for(var _0x46e08e=0x0,_0x1d4de9=events[_0x7deb('0x6')];_0x46e08e<_0x1d4de9;_0x46e08e++){var _0x4e3d14=events[_0x46e08e];var _0xfa72b7=createListener(_0x7deb('0x7')+_0x4e3d14,_0x9283e7);OpenchannelAccountEvents['on'](_0x4e3d14,_0xfa72b7);}}; \ No newline at end of file +var _0xb49a=['save','remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x19b2b3,_0x1f634c){var _0x4594d0=function(_0x3c7924){while(--_0x3c7924){_0x19b2b3['push'](_0x19b2b3['shift']());}};_0x4594d0(++_0x1f634c);}(_0xb49a,0xfb));var _0xab49=function(_0x3d9e94,_0x48136c){_0x3d9e94=_0x3d9e94-0x0;var _0x45f76e=_0xb49a[_0x3d9e94];return _0x45f76e;};'use strict';var OpenchannelAccountEvents=require(_0xab49('0x0'));var events=[_0xab49('0x1'),_0xab49('0x2'),_0xab49('0x3')];function createListener(_0x8db649,_0x55d01b){return function(_0x4387a5){_0x55d01b[_0xab49('0x4')](_0x8db649,_0x4387a5);};}function removeListener(_0x5554fe,_0x543eb0){return function(){OpenchannelAccountEvents[_0xab49('0x5')](_0x5554fe,_0x543eb0);};}exports[_0xab49('0x6')]=function(_0x1cae1d){for(var _0x3703cb=0x0,_0x57ea72=events[_0xab49('0x7')];_0x3703cb<_0x57ea72;_0x3703cb++){var _0xd86a5=events[_0x3703cb];var _0x4d4d00=createListener(_0xab49('0x8')+_0xd86a5,_0x1cae1d);OpenchannelAccountEvents['on'](_0xd86a5,_0x4d4d00);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 88f787d..d97d912 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 _0x41e4=['isAuthenticated','index','show','create','/:id','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x1bbcdb,_0x32c623){var _0x397915=function(_0x5adad2){while(--_0x5adad2){_0x1bbcdb['push'](_0x1bbcdb['shift']());}};_0x397915(++_0x32c623);}(_0x41e4,0x1c1));var _0x441e=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x41e4[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x441e('0x0'));var util=require(_0x441e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x441e('0x2'));var router=express[_0x441e('0x3')]();var fs_extra=require(_0x441e('0x4'));var auth=require(_0x441e('0x5'));var interaction=require(_0x441e('0x6'));var config=require(_0x441e('0x7'));var controller=require(_0x441e('0x8'));router[_0x441e('0x9')]('/',auth[_0x441e('0xa')](),controller[_0x441e('0xb')]);router[_0x441e('0x9')]('/:id',auth[_0x441e('0xa')](),controller[_0x441e('0xc')]);router['post']('/',auth[_0x441e('0xa')](),controller[_0x441e('0xd')]);router['put'](_0x441e('0xe'),auth['isAuthenticated'](),controller[_0x441e('0xf')]);router['delete'](_0x441e('0xe'),auth[_0x441e('0xa')](),controller['destroy']);module[_0x441e('0x10')]=router; \ No newline at end of file +var _0xb3bd=['index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x11dd0f,_0xd22ae0){var _0x31ee3d=function(_0x3eee58){while(--_0x3eee58){_0x11dd0f['push'](_0x11dd0f['shift']());}};_0x31ee3d(++_0xd22ae0);}(_0xb3bd,0xda));var _0xdb3b=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xb3bd[_0x424501];return _0xb719af;};'use strict';var multer=require('multer');var util=require(_0xdb3b('0x0'));var path=require(_0xdb3b('0x1'));var timeout=require(_0xdb3b('0x2'));var express=require(_0xdb3b('0x3'));var router=express[_0xdb3b('0x4')]();var fs_extra=require(_0xdb3b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb3b('0x6'));var config=require(_0xdb3b('0x7'));var controller=require(_0xdb3b('0x8'));router['get']('/',auth[_0xdb3b('0x9')](),controller[_0xdb3b('0xa')]);router['get'](_0xdb3b('0xb'),auth['isAuthenticated'](),controller[_0xdb3b('0xc')]);router[_0xdb3b('0xd')]('/',auth[_0xdb3b('0x9')](),controller[_0xdb3b('0xe')]);router[_0xdb3b('0xf')](_0xdb3b('0xb'),auth[_0xdb3b('0x9')](),controller[_0xdb3b('0x10')]);router[_0xdb3b('0x11')](_0xdb3b('0xb'),auth['isAuthenticated'](),controller[_0xdb3b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9c0ece3..b794453 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 _0xb4b2=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x9607fa,_0x4c7ff0){var _0x339002=function(_0x18334b){while(--_0x18334b){_0x9607fa['push'](_0x9607fa['shift']());}};_0x339002(++_0x4c7ff0);}(_0xb4b2,0x9f));var _0x2b4b=function(_0x4eb988,_0x51e42b){_0x4eb988=_0x4eb988-0x0;var _0x2dbed2=_0xb4b2[_0x4eb988];return _0x2dbed2;};'use strict';var Sequelize=require(_0x2b4b('0x0'));module[_0x2b4b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2b4b('0x2')],'allowNull':![],'defaultValue':_0x2b4b('0x3')},'appdata':{'type':Sequelize[_0x2b4b('0x4')]()},'description':{'type':Sequelize[_0x2b4b('0x2')]},'interval':{'type':Sequelize[_0x2b4b('0x2')],'defaultValue':_0x2b4b('0x5')}}; \ No newline at end of file +var _0x3728=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x3728,0x11e));var _0x8372=function(_0x5aed02,_0x443076){_0x5aed02=_0x5aed02-0x0;var _0x289f8e=_0x3728[_0x5aed02];return _0x289f8e;};'use strict';var Sequelize=require(_0x8372('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8372('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8372('0x2')],'allowNull':![],'defaultValue':_0x8372('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8372('0x2')]},'interval':{'type':Sequelize[_0x8372('0x2')],'defaultValue':_0x8372('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 15d43a6..9a90b0f 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 _0xe869=['length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','OpenchannelApplication','rawAttributes','type','key','query','keys','model','attributes','intersection','fields'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xe869,0xea));var _0x9e86=function(_0x3fbdf6,_0x47945b){_0x3fbdf6=_0x3fbdf6-0x0;var _0x1d948f=_0xe869[_0x3fbdf6];return _0x1d948f;};'use strict';var emlformat=require(_0x9e86('0x0'));var rimraf=require(_0x9e86('0x1'));var zipdir=require(_0x9e86('0x2'));var jsonpatch=require(_0x9e86('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9e86('0x4'));var util=require(_0x9e86('0x5'));var path=require('path');var sox=require(_0x9e86('0x6'));var csv=require(_0x9e86('0x7'));var ejs=require(_0x9e86('0x8'));var fs=require('fs');var fs_extra=require(_0x9e86('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9e86('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9e86('0xb'));var toCsv=require(_0x9e86('0x7'));var querystring=require('querystring');var Papa=require(_0x9e86('0xc'));var Redis=require('ioredis');var authService=require(_0x9e86('0xd'));var qs=require(_0x9e86('0xe'));var as=require(_0x9e86('0xf'));var hardwareService=require(_0x9e86('0x10'));var logger=require(_0x9e86('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9e86('0x12'));var licenseUtil=require(_0x9e86('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363e4d,_0x22b19c){_0x22b19c=_0x22b19c||0xcc;return function(_0x36aa08){if(_0x36aa08){return _0x363e4d[_0x9e86('0x14')](_0x22b19c);}return _0x363e4d[_0x9e86('0x15')](_0x22b19c)[_0x9e86('0x16')]();};}function respondWithResult(_0x329caa,_0x4e2256){_0x4e2256=_0x4e2256||0xc8;return function(_0x4fa8a6){if(_0x4fa8a6){return _0x329caa[_0x9e86('0x15')](_0x4e2256)[_0x9e86('0x17')](_0x4fa8a6);}};}function respondWithFilteredResult(_0x32b17d,_0x5ecc38){return function(_0xa6168e){if(_0xa6168e){var _0x341f0e=typeof _0x5ecc38[_0x9e86('0x18')]===_0x9e86('0x19')&&typeof _0x5ecc38[_0x9e86('0x1a')]==='undefined';var _0x5e23d2=_0xa6168e[_0x9e86('0x1b')];var _0x443a02=_0x341f0e?0x0:_0x5ecc38[_0x9e86('0x18')];var _0x502e6f=_0x341f0e?_0xa6168e['count']:_0x5ecc38['offset']+_0x5ecc38[_0x9e86('0x1a')];var _0xd9e90f;if(_0x502e6f>=_0x5e23d2){_0x502e6f=_0x5e23d2;_0xd9e90f=0xc8;}else{_0xd9e90f=0xce;}_0x32b17d[_0x9e86('0x15')](_0xd9e90f);return _0x32b17d['set'](_0x9e86('0x1c'),_0x443a02+'-'+_0x502e6f+'/'+_0x5e23d2)[_0x9e86('0x17')](_0xa6168e);}return null;};}function patchUpdates(_0x3285fe){return function(_0xce7f4a){try{jsonpatch[_0x9e86('0x1d')](_0xce7f4a,_0x3285fe,!![]);}catch(_0x803591){return BPromise[_0x9e86('0x1e')](_0x803591);}return _0xce7f4a[_0x9e86('0x1f')]();};}function saveUpdates(_0xb3875e,_0x5aeca6){return function(_0x14f5c4){if(_0x14f5c4){return _0x14f5c4[_0x9e86('0x20')](_0xb3875e)['then'](function(_0x1d938c){return _0x1d938c;});}return null;};}function removeEntity(_0x58d013,_0x109b4d){return function(_0x524f64){if(_0x524f64){return _0x524f64[_0x9e86('0x21')]()[_0x9e86('0x22')](function(){_0x58d013[_0x9e86('0x15')](0xcc)[_0x9e86('0x16')]();});}};}function handleEntityNotFound(_0x32ca16,_0x4a44d3){return function(_0x5e8658){if(!_0x5e8658){_0x32ca16[_0x9e86('0x14')](0x194);}return _0x5e8658;};}function handleError(_0xd96788,_0x27f6a1){_0x27f6a1=_0x27f6a1||0x1f4;return function(_0x4727df){logger[_0x9e86('0x23')](_0x4727df[_0x9e86('0x24')]);if(_0x4727df[_0x9e86('0x25')]){delete _0x4727df[_0x9e86('0x25')];}_0xd96788[_0x9e86('0x15')](_0x27f6a1)[_0x9e86('0x26')](_0x4727df);};}exports['index']=function(_0x2b9ced,_0x4d979f){var _0x57b13={},_0x1bc737={},_0xc30c71={'count':0x0,'rows':[]};var _0x519ea8=_[_0x9e86('0x27')](db[_0x9e86('0x28')][_0x9e86('0x29')],function(_0x372c1d){return{'name':_0x372c1d['fieldName'],'type':_0x372c1d[_0x9e86('0x2a')][_0x9e86('0x2b')]};});_0x1bc737['model']=_[_0x9e86('0x27')](_0x519ea8,_0x9e86('0x25'));_0x1bc737[_0x9e86('0x2c')]=_[_0x9e86('0x2d')](_0x2b9ced[_0x9e86('0x2c')]);_0x1bc737['filters']=_['intersection'](_0x1bc737[_0x9e86('0x2e')],_0x1bc737['query']);_0x57b13[_0x9e86('0x2f')]=_[_0x9e86('0x30')](_0x1bc737[_0x9e86('0x2e')],qs[_0x9e86('0x31')](_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x31')]));_0x57b13[_0x9e86('0x2f')]=_0x57b13[_0x9e86('0x2f')][_0x9e86('0x32')]?_0x57b13[_0x9e86('0x2f')]:_0x1bc737[_0x9e86('0x2e')];if(!_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x33')](_0x9e86('0x34'))){_0x57b13[_0x9e86('0x1a')]=qs[_0x9e86('0x1a')](_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x1a')]);_0x57b13[_0x9e86('0x18')]=qs[_0x9e86('0x18')](_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x18')]);}_0x57b13[_0x9e86('0x35')]=qs[_0x9e86('0x36')](_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x36')]);_0x57b13['where']=qs['filters'](_[_0x9e86('0x37')](_0x2b9ced['query'],_0x1bc737[_0x9e86('0x38')]),_0x519ea8);if(_0x2b9ced['query'][_0x9e86('0x39')]){_0x57b13[_0x9e86('0x3a')]=_[_0x9e86('0x3b')](_0x57b13[_0x9e86('0x3a')],{'$or':_[_0x9e86('0x27')](_0x519ea8,function(_0x146c34){if(_0x146c34[_0x9e86('0x2a')]!==_0x9e86('0x3c')){var _0x4702cc={};_0x4702cc[_0x146c34[_0x9e86('0x25')]]={'$like':'%'+_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x39')]+'%'};return _0x4702cc;}})});}_0x57b13=_[_0x9e86('0x3b')]({},_0x57b13,_0x2b9ced[_0x9e86('0x3d')]);var _0x50635b={'where':_0x57b13[_0x9e86('0x3a')]};return db['OpenchannelApplication']['count'](_0x50635b)[_0x9e86('0x22')](function(_0x3be5cc){_0xc30c71[_0x9e86('0x1b')]=_0x3be5cc;if(_0x2b9ced[_0x9e86('0x2c')][_0x9e86('0x3e')]){_0x57b13['include']=[{'all':!![]}];}return db[_0x9e86('0x28')][_0x9e86('0x3f')](_0x57b13);})[_0x9e86('0x22')](function(_0x2277bd){_0xc30c71[_0x9e86('0x40')]=_0x2277bd;return _0xc30c71;})[_0x9e86('0x22')](respondWithFilteredResult(_0x4d979f,_0x57b13))[_0x9e86('0x41')](handleError(_0x4d979f,null));};exports[_0x9e86('0x42')]=function(_0x59d8fe,_0x11b7e4){var _0x189f82={'raw':!![],'where':{'id':_0x59d8fe[_0x9e86('0x43')]['id']}},_0x2aff06={};_0x2aff06[_0x9e86('0x2e')]=_[_0x9e86('0x2d')](db[_0x9e86('0x28')][_0x9e86('0x29')]);_0x2aff06[_0x9e86('0x2c')]=_[_0x9e86('0x2d')](_0x59d8fe[_0x9e86('0x2c')]);_0x2aff06[_0x9e86('0x38')]=_[_0x9e86('0x30')](_0x2aff06['model'],_0x2aff06[_0x9e86('0x2c')]);_0x189f82[_0x9e86('0x2f')]=_[_0x9e86('0x30')](_0x2aff06[_0x9e86('0x2e')],qs[_0x9e86('0x31')](_0x59d8fe[_0x9e86('0x2c')][_0x9e86('0x31')]));_0x189f82[_0x9e86('0x2f')]=_0x189f82[_0x9e86('0x2f')][_0x9e86('0x32')]?_0x189f82[_0x9e86('0x2f')]:_0x2aff06[_0x9e86('0x2e')];if(_0x59d8fe[_0x9e86('0x2c')][_0x9e86('0x3e')]){_0x189f82['include']=[{'all':!![]}];}_0x189f82=_[_0x9e86('0x3b')]({},_0x189f82,_0x59d8fe[_0x9e86('0x3d')]);return db[_0x9e86('0x28')]['find'](_0x189f82)[_0x9e86('0x22')](handleEntityNotFound(_0x11b7e4,null))[_0x9e86('0x22')](respondWithResult(_0x11b7e4,null))['catch'](handleError(_0x11b7e4,null));};exports[_0x9e86('0x44')]=function(_0x3cdb17,_0x37cb58){return db[_0x9e86('0x28')]['create'](_0x3cdb17[_0x9e86('0x45')],{})[_0x9e86('0x22')](respondWithResult(_0x37cb58,0xc9))[_0x9e86('0x41')](handleError(_0x37cb58,null));};exports[_0x9e86('0x20')]=function(_0x2cb973,_0x17abcc){if(_0x2cb973[_0x9e86('0x45')]['id']){delete _0x2cb973[_0x9e86('0x45')]['id'];}return db[_0x9e86('0x28')][_0x9e86('0x46')]({'where':{'id':_0x2cb973[_0x9e86('0x43')]['id']}})[_0x9e86('0x22')](handleEntityNotFound(_0x17abcc,null))[_0x9e86('0x22')](saveUpdates(_0x2cb973[_0x9e86('0x45')],null))['then'](respondWithResult(_0x17abcc,null))[_0x9e86('0x41')](handleError(_0x17abcc,null));};exports['destroy']=function(_0x36eae1,_0x40696f){return db[_0x9e86('0x28')][_0x9e86('0x46')]({'where':{'id':_0x36eae1['params']['id']}})[_0x9e86('0x22')](handleEntityNotFound(_0x40696f,null))[_0x9e86('0x22')](removeEntity(_0x40696f,null))['catch'](handleError(_0x40696f,null));}; \ No newline at end of file +var _0x57ad=['body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x57ad,0x178));var _0xd57a=function(_0x2379e8,_0x5dc8c0){_0x2379e8=_0x2379e8-0x0;var _0x5a8266=_0x57ad[_0x2379e8];return _0x5a8266;};'use strict';var emlformat=require(_0xd57a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd57a('0x1'));var jsonpatch=require(_0xd57a('0x2'));var rp=require(_0xd57a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd57a('0x4'));var util=require(_0xd57a('0x5'));var path=require(_0xd57a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd57a('0x7'));var fs=require('fs');var fs_extra=require(_0xd57a('0x8'));var _=require(_0xd57a('0x9'));var squel=require(_0xd57a('0xa'));var crypto=require(_0xd57a('0xb'));var jsforce=require(_0xd57a('0xc'));var deskjs=require(_0xd57a('0xd'));var toCsv=require(_0xd57a('0xe'));var querystring=require(_0xd57a('0xf'));var Papa=require(_0xd57a('0x10'));var Redis=require(_0xd57a('0x11'));var authService=require(_0xd57a('0x12'));var qs=require(_0xd57a('0x13'));var as=require(_0xd57a('0x14'));var hardwareService=require(_0xd57a('0x15'));var logger=require(_0xd57a('0x16'))(_0xd57a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd57a('0x18'))['db'];function respondWithStatusCode(_0x5b026d,_0xbc03a3){_0xbc03a3=_0xbc03a3||0xcc;return function(_0x333d74){if(_0x333d74){return _0x5b026d[_0xd57a('0x19')](_0xbc03a3);}return _0x5b026d[_0xd57a('0x1a')](_0xbc03a3)[_0xd57a('0x1b')]();};}function respondWithResult(_0x5b6938,_0x5efb0b){_0x5efb0b=_0x5efb0b||0xc8;return function(_0x38a399){if(_0x38a399){return _0x5b6938[_0xd57a('0x1a')](_0x5efb0b)[_0xd57a('0x1c')](_0x38a399);}};}function respondWithFilteredResult(_0x27c1a4,_0x16ef09){return function(_0x31ca7e){if(_0x31ca7e){var _0x2998d7=typeof _0x16ef09[_0xd57a('0x1d')]==='undefined'&&typeof _0x16ef09[_0xd57a('0x1e')]===_0xd57a('0x1f');var _0x5ea458=_0x31ca7e[_0xd57a('0x20')];var _0x551203=_0x2998d7?0x0:_0x16ef09[_0xd57a('0x1d')];var _0x4f75ea=_0x2998d7?_0x31ca7e[_0xd57a('0x20')]:_0x16ef09[_0xd57a('0x1d')]+_0x16ef09['limit'];var _0xf52805;if(_0x4f75ea>=_0x5ea458){_0x4f75ea=_0x5ea458;_0xf52805=0xc8;}else{_0xf52805=0xce;}_0x27c1a4[_0xd57a('0x1a')](_0xf52805);return _0x27c1a4['set'](_0xd57a('0x21'),_0x551203+'-'+_0x4f75ea+'/'+_0x5ea458)[_0xd57a('0x1c')](_0x31ca7e);}return null;};}function patchUpdates(_0x4c7bb6){return function(_0x22a171){try{jsonpatch[_0xd57a('0x22')](_0x22a171,_0x4c7bb6,!![]);}catch(_0x5b4ac6){return BPromise[_0xd57a('0x23')](_0x5b4ac6);}return _0x22a171['save']();};}function saveUpdates(_0x457bf2,_0x120a56){return function(_0x22b082){if(_0x22b082){return _0x22b082[_0xd57a('0x24')](_0x457bf2)['then'](function(_0x4f3791){return _0x4f3791;});}return null;};}function removeEntity(_0x52b10d,_0x56685e){return function(_0x4a4ca2){if(_0x4a4ca2){return _0x4a4ca2[_0xd57a('0x25')]()['then'](function(){_0x52b10d[_0xd57a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5033f1,_0x5ae870){return function(_0xea6149){if(!_0xea6149){_0x5033f1[_0xd57a('0x19')](0x194);}return _0xea6149;};}function handleError(_0x116c23,_0x35c017){_0x35c017=_0x35c017||0x1f4;return function(_0x5becc8){logger[_0xd57a('0x26')](_0x5becc8[_0xd57a('0x27')]);if(_0x5becc8[_0xd57a('0x28')]){delete _0x5becc8[_0xd57a('0x28')];}_0x116c23[_0xd57a('0x1a')](_0x35c017)[_0xd57a('0x29')](_0x5becc8);};}exports[_0xd57a('0x2a')]=function(_0x40043f,_0x5a868a){var _0xf63994={},_0x3df726={},_0x420d2a={'count':0x0,'rows':[]};var _0xbdc94a=_[_0xd57a('0x2b')](db[_0xd57a('0x2c')][_0xd57a('0x2d')],function(_0x5b7b08){return{'name':_0x5b7b08['fieldName'],'type':_0x5b7b08['type'][_0xd57a('0x2e')]};});_0x3df726[_0xd57a('0x2f')]=_[_0xd57a('0x2b')](_0xbdc94a,'name');_0x3df726[_0xd57a('0x30')]=_['keys'](_0x40043f[_0xd57a('0x30')]);_0x3df726[_0xd57a('0x31')]=_[_0xd57a('0x32')](_0x3df726[_0xd57a('0x2f')],_0x3df726[_0xd57a('0x30')]);_0xf63994['attributes']=_[_0xd57a('0x32')](_0x3df726['model'],qs[_0xd57a('0x33')](_0x40043f['query'][_0xd57a('0x33')]));_0xf63994[_0xd57a('0x34')]=_0xf63994['attributes'][_0xd57a('0x35')]?_0xf63994[_0xd57a('0x34')]:_0x3df726[_0xd57a('0x2f')];if(!_0x40043f['query'][_0xd57a('0x36')](_0xd57a('0x37'))){_0xf63994[_0xd57a('0x1e')]=qs[_0xd57a('0x1e')](_0x40043f[_0xd57a('0x30')][_0xd57a('0x1e')]);_0xf63994[_0xd57a('0x1d')]=qs[_0xd57a('0x1d')](_0x40043f[_0xd57a('0x30')]['offset']);}_0xf63994['order']=qs[_0xd57a('0x38')](_0x40043f[_0xd57a('0x30')][_0xd57a('0x38')]);_0xf63994[_0xd57a('0x39')]=qs[_0xd57a('0x31')](_['pick'](_0x40043f[_0xd57a('0x30')],_0x3df726[_0xd57a('0x31')]),_0xbdc94a);if(_0x40043f[_0xd57a('0x30')]['filter']){_0xf63994[_0xd57a('0x39')]=_['merge'](_0xf63994[_0xd57a('0x39')],{'$or':_[_0xd57a('0x2b')](_0xbdc94a,function(_0x226a39){if(_0x226a39[_0xd57a('0x3a')]!==_0xd57a('0x3b')){var _0x397b28={};_0x397b28[_0x226a39[_0xd57a('0x28')]]={'$like':'%'+_0x40043f[_0xd57a('0x30')][_0xd57a('0x3c')]+'%'};return _0x397b28;}})});}_0xf63994=_['merge']({},_0xf63994,_0x40043f[_0xd57a('0x3d')]);var _0x206812={'where':_0xf63994[_0xd57a('0x39')]};return db[_0xd57a('0x2c')][_0xd57a('0x20')](_0x206812)[_0xd57a('0x3e')](function(_0x4c5060){_0x420d2a[_0xd57a('0x20')]=_0x4c5060;if(_0x40043f[_0xd57a('0x30')][_0xd57a('0x3f')]){_0xf63994[_0xd57a('0x40')]=[{'all':!![]}];}return db[_0xd57a('0x2c')][_0xd57a('0x41')](_0xf63994);})['then'](function(_0x752182){_0x420d2a[_0xd57a('0x42')]=_0x752182;return _0x420d2a;})[_0xd57a('0x3e')](respondWithFilteredResult(_0x5a868a,_0xf63994))[_0xd57a('0x43')](handleError(_0x5a868a,null));};exports[_0xd57a('0x44')]=function(_0x18e898,_0x148a09){var _0x290e59={'raw':!![],'where':{'id':_0x18e898[_0xd57a('0x45')]['id']}},_0x2682ed={};_0x2682ed[_0xd57a('0x2f')]=_[_0xd57a('0x46')](db['OpenchannelApplication'][_0xd57a('0x2d')]);_0x2682ed[_0xd57a('0x30')]=_[_0xd57a('0x46')](_0x18e898[_0xd57a('0x30')]);_0x2682ed[_0xd57a('0x31')]=_[_0xd57a('0x32')](_0x2682ed[_0xd57a('0x2f')],_0x2682ed[_0xd57a('0x30')]);_0x290e59[_0xd57a('0x34')]=_[_0xd57a('0x32')](_0x2682ed[_0xd57a('0x2f')],qs['fields'](_0x18e898[_0xd57a('0x30')][_0xd57a('0x33')]));_0x290e59[_0xd57a('0x34')]=_0x290e59[_0xd57a('0x34')][_0xd57a('0x35')]?_0x290e59[_0xd57a('0x34')]:_0x2682ed[_0xd57a('0x2f')];if(_0x18e898[_0xd57a('0x30')][_0xd57a('0x3f')]){_0x290e59[_0xd57a('0x40')]=[{'all':!![]}];}_0x290e59=_[_0xd57a('0x47')]({},_0x290e59,_0x18e898[_0xd57a('0x3d')]);return db[_0xd57a('0x2c')][_0xd57a('0x48')](_0x290e59)['then'](handleEntityNotFound(_0x148a09,null))[_0xd57a('0x3e')](respondWithResult(_0x148a09,null))['catch'](handleError(_0x148a09,null));};exports['create']=function(_0x19e0ee,_0x4f730a){return db[_0xd57a('0x2c')][_0xd57a('0x49')](_0x19e0ee['body'],{})[_0xd57a('0x3e')](respondWithResult(_0x4f730a,0xc9))['catch'](handleError(_0x4f730a,null));};exports[_0xd57a('0x24')]=function(_0x1a4dc5,_0x5c9a9b){if(_0x1a4dc5[_0xd57a('0x4a')]['id']){delete _0x1a4dc5[_0xd57a('0x4a')]['id'];}return db[_0xd57a('0x2c')]['find']({'where':{'id':_0x1a4dc5[_0xd57a('0x45')]['id']}})[_0xd57a('0x3e')](handleEntityNotFound(_0x5c9a9b,null))[_0xd57a('0x3e')](saveUpdates(_0x1a4dc5[_0xd57a('0x4a')],null))[_0xd57a('0x3e')](respondWithResult(_0x5c9a9b,null))[_0xd57a('0x43')](handleError(_0x5c9a9b,null));};exports[_0xd57a('0x25')]=function(_0x116b38,_0x5402a1){return db[_0xd57a('0x2c')][_0xd57a('0x48')]({'where':{'id':_0x116b38[_0xd57a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5402a1,null))['then'](removeEntity(_0x5402a1,null))['catch'](handleError(_0x5402a1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 916c012..5c85e69 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 _0xda1b=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd05d0e,_0x222ec6){var _0xa812c=function(_0x207028){while(--_0x207028){_0xd05d0e['push'](_0xd05d0e['shift']());}};_0xa812c(++_0x222ec6);}(_0xda1b,0x93));var _0xbda1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xda1b[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xbda1('0x0'));var util=require(_0xbda1('0x1'));var logger=require(_0xbda1('0x2'))(_0xbda1('0x3'));var moment=require(_0xbda1('0x4'));var BPromise=require(_0xbda1('0x5'));var rp=require(_0xbda1('0x6'));var fs=require('fs');var path=require(_0xbda1('0x7'));var rimraf=require(_0xbda1('0x8'));var config=require(_0xbda1('0x9'));var attributes=require(_0xbda1('0xa'));module[_0xbda1('0xb')]=function(_0x5c7d29,_0x49948e){return _0x5c7d29['define']('OpenchannelApplication',attributes,{'tableName':_0xbda1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbda1('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x081e=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','request-promise'];(function(_0x4af7d9,_0x1d487e){var _0x43d960=function(_0x1803f3){while(--_0x1803f3){_0x4af7d9['push'](_0x4af7d9['shift']());}};_0x43d960(++_0x1d487e);}(_0x081e,0xfb));var _0xe081=function(_0x2034f4,_0x2567a3){_0x2034f4=_0x2034f4-0x0;var _0x12952f=_0x081e[_0x2034f4];return _0x12952f;};'use strict';var _=require(_0xe081('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe081('0x1'));var fs=require('fs');var path=require(_0xe081('0x2'));var rimraf=require(_0xe081('0x3'));var config=require(_0xe081('0x4'));var attributes=require(_0xe081('0x5'));module[_0xe081('0x6')]=function(_0x430da9,_0xe163e6){return _0x430da9['define'](_0xe081('0x7'),attributes,{'tableName':_0xe081('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe081('0x9'),'collate':_0xe081('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 48bcfda..27de8b9 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 _0xaf7e=['../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','catch','util','moment','../../mysqldb'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xaf7e,0x10b));var _0xeaf7=function(_0x44558c,_0x139792){_0x44558c=_0x44558c-0x0;var _0x15fa46=_0xaf7e[_0x44558c];return _0x15fa46;};'use strict';var _=require('lodash');var util=require(_0xeaf7('0x0'));var moment=require(_0xeaf7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaf7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf7('0x3'))(_0xeaf7('0x4'));var config=require('../../config/environment');var jayson=require(_0xeaf7('0x5'));var client=jayson['client'][_0xeaf7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x163b77,_0x2cd6c6,_0x1a6b12){return new BPromise(function(_0x3b16c7,_0x4e5f7e){return client[_0xeaf7('0x7')](_0x163b77,_0x1a6b12)[_0xeaf7('0x8')](function(_0x823340){logger[_0xeaf7('0x9')](_0xeaf7('0xa'),_0x2cd6c6,_0xeaf7('0xb'));logger[_0xeaf7('0xc')](_0xeaf7('0xd'),_0x2cd6c6,_0xeaf7('0xb'),JSON[_0xeaf7('0xe')](_0x823340));if(_0x823340[_0xeaf7('0xf')]){if(_0x823340[_0xeaf7('0xf')][_0xeaf7('0x10')]===0x1f4){logger[_0xeaf7('0xf')](_0xeaf7('0xa'),_0x2cd6c6,_0x823340['error'][_0xeaf7('0x11')]);return _0x4e5f7e(_0x823340['error'][_0xeaf7('0x11')]);}logger[_0xeaf7('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x2cd6c6,_0x823340['error'][_0xeaf7('0x11')]);return _0x3b16c7(_0x823340[_0xeaf7('0xf')][_0xeaf7('0x11')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x2cd6c6,_0xeaf7('0xb'));_0x3b16c7(_0x823340[_0xeaf7('0x12')]['message']);}})['catch'](function(_0x39306e){logger['error'](_0xeaf7('0xa'),_0x2cd6c6,_0x39306e);_0x4e5f7e(_0x39306e);});});}exports[_0xeaf7('0x13')]=function(_0x1d1634){var _0x6b77a2=this;return new Promise(function(_0x190aeb,_0x12800f){return db[_0xeaf7('0x14')]['update'](_0x1d1634[_0xeaf7('0x15')],{'raw':_0x1d1634[_0xeaf7('0x16')]?_0x1d1634[_0xeaf7('0x16')][_0xeaf7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1634[_0xeaf7('0x16')]?_0x1d1634[_0xeaf7('0x16')][_0xeaf7('0x18')]||null:null,'attributes':_0x1d1634['options']?_0x1d1634['options'][_0xeaf7('0x19')]||null:null,'limit':_0x1d1634[_0xeaf7('0x16')]?_0x1d1634[_0xeaf7('0x16')]['limit']||null:null})['then'](function(_0x220415){logger[_0xeaf7('0x9')](_0xeaf7('0x13'),_0x1d1634);logger[_0xeaf7('0xc')](_0xeaf7('0x13'),_0x1d1634,JSON[_0xeaf7('0xe')](_0x220415));_0x190aeb(_0x220415);})[_0xeaf7('0x1a')](function(_0x5b47e5){logger['error']('UpdateOpenchannelApplication',_0x5b47e5[_0xeaf7('0x11')],_0x1d1634);_0x12800f(_0x6b77a2[_0xeaf7('0xf')](0x1f4,_0x5b47e5[_0xeaf7('0x11')]));});});}; \ No newline at end of file +var _0x14e6=['catch','update','body','options','raw','attributes','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1f0f2f,_0x587f0f){var _0x22c04e=function(_0x124b91){while(--_0x124b91){_0x1f0f2f['push'](_0x1f0f2f['shift']());}};_0x22c04e(++_0x587f0f);}(_0x14e6,0x167));var _0x614e=function(_0x2e19ab,_0x4d527f){_0x2e19ab=_0x2e19ab-0x0;var _0x510981=_0x14e6[_0x2e19ab];return _0x510981;};'use strict';var _=require(_0x614e('0x0'));var util=require(_0x614e('0x1'));var moment=require(_0x614e('0x2'));var BPromise=require(_0x614e('0x3'));var rs=require(_0x614e('0x4'));var fs=require('fs');var Redis=require(_0x614e('0x5'));var db=require(_0x614e('0x6'))['db'];var utils=require(_0x614e('0x7'));var logger=require(_0x614e('0x8'))(_0x614e('0x9'));var config=require(_0x614e('0xa'));var jayson=require(_0x614e('0xb'));var client=jayson[_0x614e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212a62,_0x46a2e5,_0x49b539){return new BPromise(function(_0x44d3f3,_0x4b21cc){return client[_0x614e('0xd')](_0x212a62,_0x49b539)[_0x614e('0xe')](function(_0x270b65){logger['info'](_0x614e('0xf'),_0x46a2e5,_0x614e('0x10'));logger[_0x614e('0x11')](_0x614e('0x12'),_0x46a2e5,'request\x20sent',JSON[_0x614e('0x13')](_0x270b65));if(_0x270b65[_0x614e('0x14')]){if(_0x270b65[_0x614e('0x14')][_0x614e('0x15')]===0x1f4){logger[_0x614e('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x46a2e5,_0x270b65['error']['message']);return _0x4b21cc(_0x270b65[_0x614e('0x14')]['message']);}logger[_0x614e('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x46a2e5,_0x270b65[_0x614e('0x14')][_0x614e('0x16')]);return _0x44d3f3(_0x270b65[_0x614e('0x14')]['message']);}else{logger[_0x614e('0x17')](_0x614e('0xf'),_0x46a2e5,_0x614e('0x10'));_0x44d3f3(_0x270b65[_0x614e('0x18')][_0x614e('0x16')]);}})[_0x614e('0x19')](function(_0x7fe7a9){logger[_0x614e('0x14')](_0x614e('0xf'),_0x46a2e5,_0x7fe7a9);_0x4b21cc(_0x7fe7a9);});});}exports['UpdateOpenchannelApplication']=function(_0x306337){var _0x50720a=this;return new Promise(function(_0x719180,_0x2b0b82){return db['OpenchannelApplication'][_0x614e('0x1a')](_0x306337[_0x614e('0x1b')],{'raw':_0x306337[_0x614e('0x1c')]?_0x306337[_0x614e('0x1c')][_0x614e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306337[_0x614e('0x1c')]?_0x306337[_0x614e('0x1c')]['where']||null:null,'attributes':_0x306337[_0x614e('0x1c')]?_0x306337[_0x614e('0x1c')][_0x614e('0x1e')]||null:null,'limit':_0x306337[_0x614e('0x1c')]?_0x306337[_0x614e('0x1c')]['limit']||null:null})[_0x614e('0xe')](function(_0x4dd560){logger[_0x614e('0x17')]('UpdateOpenchannelApplication',_0x306337);logger[_0x614e('0x11')](_0x614e('0x1f'),_0x306337,JSON[_0x614e('0x13')](_0x4dd560));_0x719180(_0x4dd560);})['catch'](function(_0xbc4616){logger[_0x614e('0x14')]('UpdateOpenchannelApplication',_0xbc4616[_0x614e('0x16')],_0x306337);_0x2b0b82(_0x50720a['error'](0x1f4,_0xbc4616['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 73d5548..0780013 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 _0x0901=['show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','openchannel','addTags','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xdc6098,_0x51785f){var _0x5abe72=function(_0x23b7de){while(--_0x23b7de){_0xdc6098['push'](_0xdc6098['shift']());}};_0x5abe72(++_0x51785f);}(_0x0901,0xc2));var _0x1090=function(_0xeec675,_0x18f074){_0xeec675=_0xeec675-0x0;var _0x3e4d79=_0x0901[_0xeec675];return _0x3e4d79;};'use strict';var multer=require(_0x1090('0x0'));var util=require(_0x1090('0x1'));var path=require(_0x1090('0x2'));var timeout=require(_0x1090('0x3'));var express=require('express');var router=express[_0x1090('0x4')]();var fs_extra=require(_0x1090('0x5'));var auth=require(_0x1090('0x6'));var interaction=require(_0x1090('0x7'));var config=require(_0x1090('0x8'));var controller=require(_0x1090('0x9'));router[_0x1090('0xa')]('/',auth[_0x1090('0xb')](),controller[_0x1090('0xc')]);router['get'](_0x1090('0xd'),auth[_0x1090('0xb')](),controller[_0x1090('0xe')]);router[_0x1090('0xa')](_0x1090('0xf'),auth['isAuthenticated'](),controller[_0x1090('0x10')]);router['get'](_0x1090('0x11'),auth['isAuthenticated'](),controller[_0x1090('0x12')]);router[_0x1090('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x1090('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1090('0x13')](_0x1090('0x11'),auth['isAuthenticated'](),controller[_0x1090('0x14')]);router['post'](_0x1090('0x15'),auth[_0x1090('0xb')](),interaction[_0x1090('0x16')](_0x1090('0x17'),'openchannelinteraction:addtags'),controller[_0x1090('0x18')]);router['put'](_0x1090('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x1090('0x17'),'openchannelinteraction:update'),controller['update']);router[_0x1090('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x1090('0x16')](_0x1090('0x17'),_0x1090('0x1a')),controller[_0x1090('0x1b')]);router[_0x1090('0x19')](_0x1090('0x15'),auth['isAuthenticated'](),controller[_0x1090('0x1c')]);module[_0x1090('0x1d')]=router; \ No newline at end of file +var _0x81d6=['create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:update','update','delete','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','download'];(function(_0x319891,_0x9b28dc){var _0x8df70c=function(_0x3301f4){while(--_0x3301f4){_0x319891['push'](_0x319891['shift']());}};_0x8df70c(++_0x9b28dc);}(_0x81d6,0x180));var _0x681d=function(_0x2de337,_0x146717){_0x2de337=_0x2de337-0x0;var _0x47066d=_0x81d6[_0x2de337];return _0x47066d;};'use strict';var multer=require('multer');var util=require(_0x681d('0x0'));var path=require(_0x681d('0x1'));var timeout=require(_0x681d('0x2'));var express=require(_0x681d('0x3'));var router=express[_0x681d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x681d('0x5'));var interaction=require(_0x681d('0x6'));var config=require(_0x681d('0x7'));var controller=require(_0x681d('0x8'));router[_0x681d('0x9')]('/',auth['isAuthenticated'](),controller[_0x681d('0xa')]);router['get'](_0x681d('0xb'),auth['isAuthenticated'](),controller[_0x681d('0xc')]);router[_0x681d('0x9')](_0x681d('0xd'),auth[_0x681d('0xe')](),controller[_0x681d('0xf')]);router['get'](_0x681d('0x10'),auth[_0x681d('0xe')](),controller[_0x681d('0x11')]);router[_0x681d('0x9')]('/:id/download',auth[_0x681d('0xe')](),controller[_0x681d('0x12')]);router['post']('/',auth[_0x681d('0xe')](),controller[_0x681d('0x13')]);router[_0x681d('0x14')](_0x681d('0x10'),auth['isAuthenticated'](),controller[_0x681d('0x15')]);router['post'](_0x681d('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0x681d('0x17'),'openchannelinteraction:addtags'),controller['addTags']);router['put'](_0x681d('0xd'),auth[_0x681d('0xe')](),interaction['tracked'](_0x681d('0x17'),_0x681d('0x18')),controller[_0x681d('0x19')]);router[_0x681d('0x1a')](_0x681d('0xd'),auth[_0x681d('0xe')](),interaction[_0x681d('0x1b')](_0x681d('0x17'),'openchannelinteraction:destroy'),controller[_0x681d('0x1c')]);router['delete'](_0x681d('0x16'),auth['isAuthenticated'](),controller[_0x681d('0x1d')]);module[_0x681d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6ba3a95..0dd0936 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 _0xb43b=['ENUM','sequelize','BOOLEAN','DATE','STRING'];(function(_0x4cd5e9,_0x275506){var _0x40dac1=function(_0x521986){while(--_0x521986){_0x4cd5e9['push'](_0x4cd5e9['shift']());}};_0x40dac1(++_0x275506);}(_0xb43b,0xbf));var _0xbb43=function(_0x3f170e,_0x13d0dc){_0x3f170e=_0x3f170e-0x0;var _0x5d1d84=_0xb43b[_0x3f170e];return _0x5d1d84;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb43('0x2')]},'disposition':{'type':Sequelize[_0xbb43('0x3')]},'secondDisposition':{'type':Sequelize[_0xbb43('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbb43('0x3')]},'note':{'type':Sequelize[_0xbb43('0x3')]},'read1stAt':{'type':Sequelize[_0xbb43('0x2')]},'threadId':{'type':Sequelize[_0xbb43('0x3')]},'externalUrl':{'type':Sequelize[_0xbb43('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbb43('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbb43('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xbb43('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xc6d8=['BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x1629eb,_0x305130){var _0x230f76=function(_0x343461){while(--_0x343461){_0x1629eb['push'](_0x1629eb['shift']());}};_0x230f76(++_0x305130);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2ca515,_0x2f0654){_0x2ca515=_0x2ca515-0x0;var _0x2f7701=_0xc6d8[_0x2ca515];return _0x2f7701;};'use strict';var Sequelize=require(_0x8c6d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8c6d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8c6d('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8c6d('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x8c6d('0x2')]},'externalUrl':{'type':Sequelize[_0x8c6d('0x2')]},'lastMsgAt':{'type':Sequelize[_0x8c6d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8c6d('0x4')]('in',_0x8c6d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x8c6d('0x4')]('in',_0x8c6d('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x8c6d('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 26e0454..e479065 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 _0x45d8=['filters','attributes','fields','length','includeAll','merge','options','find','catch','create','body','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','intersection','hasOwnProperty','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Owner','get','Openchannel','Account','N.A.','format','toString','closed','closedAt','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','zip-dir','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','error','stack','name','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','openchannel','user','show','query','from','params','model','rawAttributes','keys'];(function(_0x8fd385,_0x5c79e9){var _0x4ec481=function(_0x1a8f5b){while(--_0x1a8f5b){_0x8fd385['push'](_0x8fd385['shift']());}};_0x4ec481(++_0x5c79e9);}(_0x45d8,0x159));var _0x845d=function(_0x5b9692,_0x1e4e4c){_0x5b9692=_0x5b9692-0x0;var _0x4a32f0=_0x45d8[_0x5b9692];return _0x4a32f0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x845d('0x0'));var moment=require(_0x845d('0x1'));var util=require(_0x845d('0x2'));var path=require(_0x845d('0x3'));var ejs=require(_0x845d('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x845d('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x845d('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x845d('0x7'))(_0x845d('0x8'));var config=require(_0x845d('0x9'));var db=require(_0x845d('0xa'))['db'];config[_0x845d('0xb')]=_[_0x845d('0xc')](config['redis'],{'host':_0x845d('0xd'),'port':0x18eb});var socket=require(_0x845d('0xe'))(new Redis(config[_0x845d('0xb')]));require(_0x845d('0xf'))[_0x845d('0x10')](socket);function respondWithStatusCode(_0x2e6a4d,_0x3d18a8){_0x3d18a8=_0x3d18a8||0xcc;return function(_0x3e57f4){if(_0x3e57f4){return _0x2e6a4d[_0x845d('0x11')](_0x3d18a8);}return _0x2e6a4d[_0x845d('0x12')](_0x3d18a8)[_0x845d('0x13')]();};}function respondWithResult(_0x553f4b,_0x4fc8dd){_0x4fc8dd=_0x4fc8dd||0xc8;return function(_0x26a002){if(_0x26a002){return _0x553f4b['status'](_0x4fc8dd)[_0x845d('0x14')](_0x26a002);}};}function respondWithFilteredResult(_0x22a4cd,_0x267c4c){return function(_0x581451){if(_0x581451){var _0x4a0822=typeof _0x267c4c[_0x845d('0x15')]===_0x845d('0x16')&&typeof _0x267c4c['limit']===_0x845d('0x16');var _0x369608=_0x581451[_0x845d('0x17')];var _0x4dc2fb=_0x4a0822?0x0:_0x267c4c[_0x845d('0x15')];var _0x45bba2=_0x4a0822?_0x581451[_0x845d('0x17')]:_0x267c4c[_0x845d('0x15')]+_0x267c4c[_0x845d('0x18')];var _0x5cd909;if(_0x45bba2>=_0x369608){_0x45bba2=_0x369608;_0x5cd909=0xc8;}else{_0x5cd909=0xce;}_0x22a4cd[_0x845d('0x12')](_0x5cd909);return _0x22a4cd[_0x845d('0x19')](_0x845d('0x1a'),_0x4dc2fb+'-'+_0x45bba2+'/'+_0x369608)[_0x845d('0x14')](_0x581451);}return null;};}function saveUpdates(_0x4dedda){return function(_0x459545){if(_0x459545){return _0x459545['update'](_0x4dedda)[_0x845d('0x1b')](function(_0x4f763){return _0x4f763;});}return null;};}function removeEntity(_0x2ebe88){return function(_0x24cc34){if(_0x24cc34){return _0x24cc34['destroy']()[_0x845d('0x1b')](function(){_0x2ebe88[_0x845d('0x12')](0xcc)[_0x845d('0x13')]();});}};}function handleEntityNotFound(_0xc3895b){return function(_0x1d80c6){if(!_0x1d80c6){_0xc3895b[_0x845d('0x11')](0x194);}return _0x1d80c6;};}function handleError(_0x34c528,_0x210e86){_0x210e86=_0x210e86||0x1f4;return function(_0x2d30d3){logger[_0x845d('0x1c')](_0x2d30d3[_0x845d('0x1d')]);if(_0x2d30d3[_0x845d('0x1e')]){delete _0x2d30d3[_0x845d('0x1e')];}_0x34c528[_0x845d('0x12')](_0x210e86)['send'](_0x2d30d3);};}exports[_0x845d('0x1f')]=function(_0x4d6d24,_0x56495b){var _0x4a4435={};var _0x3ed17b=_[_0x845d('0x20')](db[_0x845d('0x21')]['rawAttributes'],function(_0x8806a0){return{'name':_0x8806a0[_0x845d('0x22')],'type':_0x8806a0[_0x845d('0x23')][_0x845d('0x24')]};});_0x4a4435=qs[_0x845d('0x25')](_0x3ed17b,_0x4d6d24);return interaction[_0x845d('0x26')](_0x845d('0x27'),_0x4d6d24['query'],_0x4d6d24[_0x845d('0x28')],_0x4a4435,_0x3ed17b)['then'](respondWithFilteredResult(_0x56495b,_0x4a4435))['catch'](handleError(_0x56495b,null));};exports[_0x845d('0x29')]=function(_0x427db1,_0x1c9458){var _0x22a1c0={};if(_0x427db1['query'][_0x845d('0x23')]&&_0x427db1[_0x845d('0x2a')][_0x845d('0x23')]===_0x845d('0x2b')){_0x22a1c0[_0x845d('0x2b')]=_0x427db1[_0x845d('0x2c')]['id'];}else{_0x22a1c0['id']=_0x427db1[_0x845d('0x2c')]['id'];}var _0x2540d2={'raw':![],'where':_0x22a1c0},_0x108fa2={};_0x108fa2[_0x845d('0x2d')]=_['keys'](db[_0x845d('0x21')][_0x845d('0x2e')]);_0x108fa2[_0x845d('0x2a')]=_[_0x845d('0x2f')](_0x427db1[_0x845d('0x2a')]);_0x108fa2[_0x845d('0x30')]=_['intersection'](_0x108fa2['model'],_0x108fa2['query']);_0x2540d2[_0x845d('0x31')]=_['intersection'](_0x108fa2[_0x845d('0x2d')],qs[_0x845d('0x32')](_0x427db1['query'][_0x845d('0x32')]));_0x2540d2['attributes']=_0x2540d2[_0x845d('0x31')][_0x845d('0x33')]?_0x2540d2[_0x845d('0x31')]:_0x108fa2[_0x845d('0x2d')];if(_0x427db1['query'][_0x845d('0x34')]){_0x2540d2['include']=[{'all':!![]}];}_0x2540d2=_[_0x845d('0x35')]({},_0x2540d2,_0x427db1[_0x845d('0x36')]);return db['OpenchannelInteraction'][_0x845d('0x37')](_0x2540d2)[_0x845d('0x1b')](handleEntityNotFound(_0x1c9458,null))['then'](respondWithResult(_0x1c9458,null))[_0x845d('0x38')](handleError(_0x1c9458,null));};exports['create']=function(_0x8ea49b,_0x5215f8){return db[_0x845d('0x21')][_0x845d('0x39')](_0x8ea49b[_0x845d('0x3a')],{})['then'](respondWithResult(_0x5215f8,0xc9))[_0x845d('0x38')](handleError(_0x5215f8,null));};exports[_0x845d('0x3b')]=function(_0x50aefb,_0x3abc3c){if(_0x50aefb[_0x845d('0x3a')]['id']){delete _0x50aefb[_0x845d('0x3a')]['id'];}return db[_0x845d('0x21')][_0x845d('0x37')]({'where':{'id':_0x50aefb[_0x845d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3abc3c,null))[_0x845d('0x1b')](saveUpdates(_0x50aefb[_0x845d('0x3a')],null))['then'](respondWithResult(_0x3abc3c,null))['catch'](handleError(_0x3abc3c,null));};exports[_0x845d('0x3c')]=function(_0x1964bf,_0x32f7db){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1964bf[_0x845d('0x2c')]['id']}})[_0x845d('0x1b')](handleEntityNotFound(_0x32f7db,null))[_0x845d('0x1b')](removeEntity(_0x32f7db,null))[_0x845d('0x38')](handleError(_0x32f7db,null));};exports['describe']=function(_0x405854,_0x21f964){return db[_0x845d('0x21')][_0x845d('0x3d')]()[_0x845d('0x1b')](respondWithResult(_0x21f964,null))['catch'](handleError(_0x21f964,null));};exports[_0x845d('0x3e')]=function(_0x803cc4,_0x570fd2){return db[_0x845d('0x3f')]['find']({'where':{'id':_0x803cc4[_0x845d('0x2c')]['id']}})[_0x845d('0x1b')](handleEntityNotFound(_0x570fd2,null))[_0x845d('0x1b')](function(_0x35e8ec){if(_0x35e8ec){return _0x35e8ec[_0x845d('0x3e')](_0x803cc4['body'][_0x845d('0x40')],_[_0x845d('0x41')](_0x803cc4[_0x845d('0x3a')],[_0x845d('0x40'),'id'])||{});}})[_0x845d('0x1b')](respondWithResult(_0x570fd2,null))['catch'](handleError(_0x570fd2,null));};exports[_0x845d('0x42')]=function(_0x1cc33f,_0x6b2d88){var _0x52b84a={'raw':![],'where':{}};var _0x3d17f8={};var _0x458a37={'count':0x0,'rows':[]};return db[_0x845d('0x21')]['findOne']({'where':{'id':_0x1cc33f[_0x845d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x6b2d88,null))['then'](function(_0x5c60f3){if(_0x5c60f3){_0x3d17f8[_0x845d('0x2d')]=_[_0x845d('0x2f')](db[_0x845d('0x3f')][_0x845d('0x2e')]);_0x3d17f8[_0x845d('0x2a')]=_[_0x845d('0x2f')](_0x1cc33f[_0x845d('0x2a')]);_0x3d17f8['filters']=_[_0x845d('0x43')](_0x3d17f8[_0x845d('0x2d')],_0x3d17f8['query']);_0x52b84a[_0x845d('0x31')]=_['intersection'](_0x3d17f8[_0x845d('0x2d')],qs[_0x845d('0x32')](_0x1cc33f['query'][_0x845d('0x32')]));_0x52b84a['attributes']=_0x52b84a[_0x845d('0x31')][_0x845d('0x33')]?_0x52b84a[_0x845d('0x31')]:_0x3d17f8[_0x845d('0x2d')];if(!_0x1cc33f[_0x845d('0x2a')][_0x845d('0x44')]('nolimit')){_0x52b84a[_0x845d('0x18')]=qs[_0x845d('0x18')](_0x1cc33f[_0x845d('0x2a')][_0x845d('0x18')]);_0x52b84a[_0x845d('0x15')]=qs['offset'](_0x1cc33f[_0x845d('0x2a')][_0x845d('0x15')]);}_0x52b84a[_0x845d('0x45')]=qs['sort'](_0x1cc33f[_0x845d('0x2a')][_0x845d('0x46')]);_0x52b84a['where']=qs[_0x845d('0x30')](_[_0x845d('0x47')](_0x1cc33f[_0x845d('0x2a')],_0x3d17f8[_0x845d('0x30')]));_0x52b84a[_0x845d('0x48')][_0x845d('0x49')]=_0x5c60f3['id'];if(_0x1cc33f[_0x845d('0x2a')][_0x845d('0x4a')]){_0x52b84a[_0x845d('0x48')]=_[_0x845d('0x35')](_0x52b84a['where'],{'$or':_[_0x845d('0x20')](_0x52b84a[_0x845d('0x31')],function(_0x495035){var _0x5e81c2={};_0x5e81c2[_0x495035]={'$like':'%'+_0x1cc33f[_0x845d('0x2a')][_0x845d('0x4a')]+'%'};return _0x5e81c2;})});}if(_0x1cc33f[_0x845d('0x2a')]['$gte']){var _0x31f846=_0x1cc33f[_0x845d('0x2a')][_0x845d('0x4b')][_0x845d('0x4c')](',');var _0x194b4f={};_0x194b4f[_0x31f846[0x0]]={'$gte':moment(_0x31f846[0x1])['format'](_0x845d('0x4d'))};_0x52b84a[_0x845d('0x48')]=_[_0x845d('0x35')](_0x52b84a[_0x845d('0x48')],_0x194b4f);}_0x52b84a=_[_0x845d('0x35')]({},_0x52b84a,_0x1cc33f['options']);return db[_0x845d('0x3f')]['count']({'where':_0x52b84a['where']})[_0x845d('0x1b')](function(_0x5ddd5f){_0x458a37[_0x845d('0x17')]=_0x5ddd5f;if(_0x1cc33f[_0x845d('0x2a')]['includeAll']){_0x52b84a[_0x845d('0x4e')]=[{'all':!![]}];}return db[_0x845d('0x3f')]['findAll'](_0x52b84a);})[_0x845d('0x1b')](function(_0x302a81){_0x458a37[_0x845d('0x4f')]=_0x302a81;return _0x458a37;});}})[_0x845d('0x1b')](respondWithFilteredResult(_0x6b2d88,_0x52b84a))[_0x845d('0x38')](handleError(_0x6b2d88,null));};exports[_0x845d('0x50')]=function(_0x31e19f,_0x9e4312){return db[_0x845d('0x21')][_0x845d('0x37')]({'where':{'id':_0x31e19f['params']['id']}})[_0x845d('0x1b')](handleEntityNotFound(_0x9e4312,null))['then'](function(_0x5e5588){if(_0x5e5588){return _0x5e5588[_0x845d('0x51')](_0x31e19f[_0x845d('0x3a')][_0x845d('0x40')],_[_0x845d('0x41')](_0x31e19f[_0x845d('0x3a')],[_0x845d('0x40'),'id'])||{})[_0x845d('0x52')](function(){return db[_0x845d('0x53')]['findAll']({'attributes':['id','name',_0x845d('0x54')],'where':{'id':_0x31e19f[_0x845d('0x3a')][_0x845d('0x40')]}});})['then'](function(_0x24fd80){socket[_0x845d('0x55')](_0x845d('0x56'),{'id':Number(_0x31e19f[_0x845d('0x2c')]['id']),'tags':_0x24fd80||[]});return{'id':Number(_0x31e19f['params']['id']),'tags':_0x24fd80||[]};});}})[_0x845d('0x1b')](respondWithResult(_0x9e4312,null))[_0x845d('0x38')](handleError(_0x9e4312,null));};exports[_0x845d('0x57')]=function(_0x2da452,_0x3903b6){return db[_0x845d('0x21')]['find']({'where':{'id':_0x2da452[_0x845d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3903b6,null))['then'](function(_0x55ce87){if(_0x55ce87){return _0x55ce87[_0x845d('0x57')](_0x2da452[_0x845d('0x2a')][_0x845d('0x40')]);}})['then'](respondWithStatusCode(_0x3903b6,null))['catch'](handleError(_0x3903b6,null));};exports[_0x845d('0x58')]=function(_0x48d7f2,_0x5b21a0){var _0x5eac25=moment()[_0x845d('0x59')]()['toString']();var _0x16bc1c=path[_0x845d('0x5a')](config[_0x845d('0x5b')],'server',_0x845d('0x5c'),'tmp');var _0x1ad749=path['join'](config[_0x845d('0x5b')],_0x845d('0x5d'),'files',_0x845d('0x5e'));var _0x2da1a3=path[_0x845d('0x5a')](_0x16bc1c,_0x5eac25);var _0x478e0f=util['format'](_0x845d('0x5f'),_0x48d7f2[_0x845d('0x2c')]['id'],_0x5eac25);var _0x2c09b0=path[_0x845d('0x5a')](_0x16bc1c,_0x478e0f);var _0xd2b263=[];_0xd2b263[_0x845d('0x60')]({'model':db[_0x845d('0x61')],'as':'User','attributes':['id',_0x845d('0x62')],'raw':!![]});_0xd2b263[_0x845d('0x60')]({'model':db['CmContact'],'as':_0x845d('0x63'),'attributes':['id',_0x845d('0x64'),_0x845d('0x65')],'raw':!![]});if(_0x48d7f2[_0x845d('0x2a')][_0x845d('0x5e')]){_0xd2b263[_0x845d('0x60')]({'model':db[_0x845d('0x66')],'as':_0x845d('0x66'),'raw':!![]});}var _0x1c6e75=[{'model':db[_0x845d('0x3f')],'as':_0x845d('0x67'),'attributes':['id','body',_0x845d('0x68'),_0x845d('0x69'),_0x845d('0x6a'),'read'],'include':_0xd2b263}];_0x1c6e75[_0x845d('0x60')]({'model':db[_0x845d('0x6b')],'as':'Account','attributes':['id',_0x845d('0x1e')]});_0x1c6e75[_0x845d('0x60')]({'model':db[_0x845d('0x61')],'as':_0x845d('0x6c'),'attributes':['id',_0x845d('0x62')]});return db[_0x845d('0x21')][_0x845d('0x37')]({'where':{'id':_0x48d7f2[_0x845d('0x2c')]['id']},'include':_0x1c6e75})[_0x845d('0x1b')](handleEntityNotFound(_0x5b21a0,null))[_0x845d('0x1b')](function(_0x1edf84){if(_0x1edf84){var _0x1ca960=_0x1edf84[_0x845d('0x6d')]({'plain':!![]});fs['mkdirSync'](_0x2da1a3);var _0x404ed7={'channel':_0x845d('0x6e'),'account':_0x1ca960[_0x845d('0x6f')][_0x845d('0x1e')],'agent':_0x1ca960[_0x845d('0x6c')]?_0x1ca960[_0x845d('0x6c')]['fullname']:_0x845d('0x70'),'createdAt':moment(_0x1ca960[_0x845d('0x68')])[_0x845d('0x71')](_0x845d('0x4d'))[_0x845d('0x72')](),'closedAt':_0x1ca960[_0x845d('0x73')]?moment(_0x1ca960[_0x845d('0x74')])['format'](_0x845d('0x4d'))['toString']():'','disposition':_0x1ca960['disposition'],'visibility':_0x1ca960[_0x845d('0x75')]?_0x845d('0x76'):'Private','messages':_(_0x1ca960[_0x845d('0x67')])[_0x845d('0x4a')]({'secret':![]})['map'](function(_0x12bb47){if(_0x12bb47[_0x845d('0x66')]){var _0x33aaff=path[_0x845d('0x5a')](_0x1ad749,_0x12bb47[_0x845d('0x66')][_0x845d('0x77')]);if(fs[_0x845d('0x78')](_0x33aaff)){fs[_0x845d('0x79')](_0x33aaff)[_0x845d('0x7a')](fs[_0x845d('0x7b')](path[_0x845d('0x5a')](_0x2da1a3,_0x12bb47[_0x845d('0x66')][_0x845d('0x77')])));}}return{'date':moment(_0x12bb47['createdAt'])[_0x845d('0x71')]('YYYY-MM-DD\x20HH:mm:ss')[_0x845d('0x72')](),'sender':_0x12bb47[_0x845d('0x69')]==='out'?_0x12bb47[_0x845d('0x61')]?_0x12bb47[_0x845d('0x61')][_0x845d('0x62')]:_0x845d('0x7c'):_0x12bb47[_0x845d('0x63')][_0x845d('0x64')]+(_0x12bb47[_0x845d('0x63')][_0x845d('0x65')]?'\x20'+_0x12bb47['Contact'][_0x845d('0x65')]:''),'body':_0x12bb47[_0x845d('0x66')]?_0x12bb47[_0x845d('0x66')]['basename']:_0x12bb47['body'],'direction':_0x12bb47['direction']===_0x845d('0x7d')?'A':'C','secret':_0x12bb47[_0x845d('0x6a')],'read':_0x12bb47['read'],'attachment':_0x12bb47[_0x845d('0x66')]};})['value']()};return ejs[_0x845d('0x7e')](path[_0x845d('0x5a')](config[_0x845d('0x5b')],_0x845d('0x5d'),_0x845d('0x7f'),_0x845d('0x80')),{'interaction':_0x404ed7})[_0x845d('0x1b')](function(_0x4da8b9){var _0x59b798=path[_0x845d('0x5a')](_0x2da1a3,_0x845d('0x81')+_0x1ca960['id']+'-'+_0x5eac25+'.pdf');var _0x144130={'path':_0x59b798,'channel':_0x845d('0x6e'),'interactionId':_0x1ca960['id']};return pdf[_0x845d('0x82')](_0x4da8b9,_0x144130);})[_0x845d('0x1b')](function(){return new Promise(function(_0x5ab6af,_0x199704){zipdir(_0x2da1a3,{'saveTo':_0x2c09b0},function(_0x1c3a46,_0x38a097){if(_0x1c3a46)return _0x199704(_0x1c3a46);return _0x5ab6af(_0x38a097);});})[_0x845d('0x1b')](function(){return new Promise(function(_0x274c3e,_0x56e8e6){rimraf(_0x2da1a3,function(_0x42950e){if(_0x42950e)_0x56e8e6(_0x42950e);return _0x274c3e();});});})['then'](function(){return _0x5b21a0[_0x845d('0x58')](_0x2c09b0,_0x478e0f,function(_0x522ad6){if(_0x522ad6){logger[_0x845d('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x522ad6);}else{fs['unlinkSync'](_0x2c09b0);}});});});}else{return _0x5b21a0[_0x845d('0x11')](0xc8);}})['catch'](handleError(_0x5b21a0,null));}; \ No newline at end of file +var _0x5627=['where','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','color','emit','removeTags','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','createdAt','secret','read','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','closed','closedAt','disposition','threadId','Public','Messages','basename','createReadStream','pipe','createWriteStream','direction','out','System','firstName','views','transcript-','.pdf','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','update','then','destroy','stack','name','send','index','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','query','user','catch','show','from','params','model','keys','filters','intersection','attributes','length','includeAll','include','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','fields','hasOwnProperty','nolimit','sort'];(function(_0x929432,_0x45bc7e){var _0x3fc55e=function(_0xcc26d1){while(--_0xcc26d1){_0x929432['push'](_0x929432['shift']());}};_0x3fc55e(++_0x45bc7e);}(_0x5627,0x1ba));var _0x7562=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5627[_0x397e5f];return _0x5302b8;};'use strict';var rimraf=require(_0x7562('0x0'));var zipdir=require(_0x7562('0x1'));var moment=require(_0x7562('0x2'));var util=require('util');var path=require(_0x7562('0x3'));var ejs=require(_0x7562('0x4'));var fs=require('fs');var _=require(_0x7562('0x5'));var Redis=require(_0x7562('0x6'));var interaction=require(_0x7562('0x7'));var qs=require(_0x7562('0x8'));var pdf=require(_0x7562('0x9'));var logger=require(_0x7562('0xa'))(_0x7562('0xb'));var config=require(_0x7562('0xc'));var db=require(_0x7562('0xd'))['db'];config[_0x7562('0xe')]=_[_0x7562('0xf')](config[_0x7562('0xe')],{'host':_0x7562('0x10'),'port':0x18eb});var socket=require(_0x7562('0x11'))(new Redis(config[_0x7562('0xe')]));require(_0x7562('0x12'))[_0x7562('0x13')](socket);function respondWithStatusCode(_0x77f665,_0x99a717){_0x99a717=_0x99a717||0xcc;return function(_0x217c67){if(_0x217c67){return _0x77f665[_0x7562('0x14')](_0x99a717);}return _0x77f665['status'](_0x99a717)[_0x7562('0x15')]();};}function respondWithResult(_0x2d9244,_0xef8fe4){_0xef8fe4=_0xef8fe4||0xc8;return function(_0xe9f933){if(_0xe9f933){return _0x2d9244['status'](_0xef8fe4)['json'](_0xe9f933);}};}function respondWithFilteredResult(_0x48a946,_0x51bb39){return function(_0x541341){if(_0x541341){var _0x256aa2=typeof _0x51bb39[_0x7562('0x16')]===_0x7562('0x17')&&typeof _0x51bb39[_0x7562('0x18')]==='undefined';var _0x587537=_0x541341[_0x7562('0x19')];var _0x353547=_0x256aa2?0x0:_0x51bb39[_0x7562('0x16')];var _0x414ff5=_0x256aa2?_0x541341[_0x7562('0x19')]:_0x51bb39[_0x7562('0x16')]+_0x51bb39['limit'];var _0x218bb4;if(_0x414ff5>=_0x587537){_0x414ff5=_0x587537;_0x218bb4=0xc8;}else{_0x218bb4=0xce;}_0x48a946[_0x7562('0x1a')](_0x218bb4);return _0x48a946[_0x7562('0x1b')](_0x7562('0x1c'),_0x353547+'-'+_0x414ff5+'/'+_0x587537)[_0x7562('0x1d')](_0x541341);}return null;};}function saveUpdates(_0x399d08){return function(_0x459a3c){if(_0x459a3c){return _0x459a3c[_0x7562('0x1e')](_0x399d08)[_0x7562('0x1f')](function(_0x4ec49a){return _0x4ec49a;});}return null;};}function removeEntity(_0x1ed345){return function(_0x1c2735){if(_0x1c2735){return _0x1c2735[_0x7562('0x20')]()[_0x7562('0x1f')](function(){_0x1ed345[_0x7562('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f26f2){return function(_0x36b297){if(!_0x36b297){_0x4f26f2[_0x7562('0x14')](0x194);}return _0x36b297;};}function handleError(_0x235f78,_0x39ee6b){_0x39ee6b=_0x39ee6b||0x1f4;return function(_0xb9915e){logger['error'](_0xb9915e[_0x7562('0x21')]);if(_0xb9915e[_0x7562('0x22')]){delete _0xb9915e[_0x7562('0x22')];}_0x235f78[_0x7562('0x1a')](_0x39ee6b)[_0x7562('0x23')](_0xb9915e);};}exports[_0x7562('0x24')]=function(_0x4f86f4,_0x66ed07){var _0x3a82bf={};var _0x613635=_['map'](db[_0x7562('0x25')]['rawAttributes'],function(_0x3ff2d9){return{'name':_0x3ff2d9[_0x7562('0x26')],'type':_0x3ff2d9[_0x7562('0x27')][_0x7562('0x28')]};});_0x3a82bf=qs[_0x7562('0x29')](_0x613635,_0x4f86f4);return interaction[_0x7562('0x2a')]('openchannel',_0x4f86f4[_0x7562('0x2b')],_0x4f86f4[_0x7562('0x2c')],_0x3a82bf,_0x613635)[_0x7562('0x1f')](respondWithFilteredResult(_0x66ed07,_0x3a82bf))[_0x7562('0x2d')](handleError(_0x66ed07,null));};exports[_0x7562('0x2e')]=function(_0x51f804,_0x2b6d63){var _0x4a932f={};if(_0x51f804['query'][_0x7562('0x27')]&&_0x51f804[_0x7562('0x2b')][_0x7562('0x27')]===_0x7562('0x2f')){_0x4a932f[_0x7562('0x2f')]=_0x51f804[_0x7562('0x30')]['id'];}else{_0x4a932f['id']=_0x51f804[_0x7562('0x30')]['id'];}var _0x4fa5fe={'raw':![],'where':_0x4a932f},_0x33d2ef={};_0x33d2ef[_0x7562('0x31')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x33d2ef[_0x7562('0x2b')]=_[_0x7562('0x32')](_0x51f804[_0x7562('0x2b')]);_0x33d2ef[_0x7562('0x33')]=_[_0x7562('0x34')](_0x33d2ef['model'],_0x33d2ef['query']);_0x4fa5fe[_0x7562('0x35')]=_[_0x7562('0x34')](_0x33d2ef[_0x7562('0x31')],qs['fields'](_0x51f804[_0x7562('0x2b')]['fields']));_0x4fa5fe['attributes']=_0x4fa5fe['attributes'][_0x7562('0x36')]?_0x4fa5fe[_0x7562('0x35')]:_0x33d2ef[_0x7562('0x31')];if(_0x51f804['query'][_0x7562('0x37')]){_0x4fa5fe[_0x7562('0x38')]=[{'all':!![]}];}_0x4fa5fe=_['merge']({},_0x4fa5fe,_0x51f804[_0x7562('0x39')]);return db['OpenchannelInteraction']['find'](_0x4fa5fe)['then'](handleEntityNotFound(_0x2b6d63,null))[_0x7562('0x1f')](respondWithResult(_0x2b6d63,null))[_0x7562('0x2d')](handleError(_0x2b6d63,null));};exports[_0x7562('0x3a')]=function(_0x334a9f,_0x25cd0c){return db[_0x7562('0x25')][_0x7562('0x3a')](_0x334a9f[_0x7562('0x3b')],{})[_0x7562('0x1f')](respondWithResult(_0x25cd0c,0xc9))[_0x7562('0x2d')](handleError(_0x25cd0c,null));};exports[_0x7562('0x1e')]=function(_0x1a61e0,_0x758ef9){if(_0x1a61e0[_0x7562('0x3b')]['id']){delete _0x1a61e0[_0x7562('0x3b')]['id'];}return db['OpenchannelInteraction'][_0x7562('0x3c')]({'where':{'id':_0x1a61e0[_0x7562('0x30')]['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x758ef9,null))['then'](saveUpdates(_0x1a61e0[_0x7562('0x3b')],null))[_0x7562('0x1f')](respondWithResult(_0x758ef9,null))[_0x7562('0x2d')](handleError(_0x758ef9,null));};exports['destroy']=function(_0x502f28,_0x45cd74){return db[_0x7562('0x25')][_0x7562('0x3c')]({'where':{'id':_0x502f28[_0x7562('0x30')]['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x45cd74,null))['then'](removeEntity(_0x45cd74,null))[_0x7562('0x2d')](handleError(_0x45cd74,null));};exports[_0x7562('0x3d')]=function(_0x5f05c4,_0x1072ca){return db[_0x7562('0x25')][_0x7562('0x3d')]()[_0x7562('0x1f')](respondWithResult(_0x1072ca,null))[_0x7562('0x2d')](handleError(_0x1072ca,null));};exports[_0x7562('0x3e')]=function(_0x547137,_0x521ac5){return db[_0x7562('0x3f')]['find']({'where':{'id':_0x547137['params']['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x521ac5,null))[_0x7562('0x1f')](function(_0x47b82f){if(_0x47b82f){return _0x47b82f['addMessage'](_0x547137[_0x7562('0x3b')][_0x7562('0x40')],_[_0x7562('0x41')](_0x547137[_0x7562('0x3b')],['ids','id'])||{});}})[_0x7562('0x1f')](respondWithResult(_0x521ac5,null))[_0x7562('0x2d')](handleError(_0x521ac5,null));};exports['getMessages']=function(_0x34a1a7,_0x359a4a){var _0xdbdb81={'raw':![],'where':{}};var _0x425d20={};var _0x281be2={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x34a1a7[_0x7562('0x30')]['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x359a4a,null))[_0x7562('0x1f')](function(_0x433d1d){if(_0x433d1d){_0x425d20[_0x7562('0x31')]=_[_0x7562('0x32')](db[_0x7562('0x3f')]['rawAttributes']);_0x425d20[_0x7562('0x2b')]=_['keys'](_0x34a1a7[_0x7562('0x2b')]);_0x425d20[_0x7562('0x33')]=_[_0x7562('0x34')](_0x425d20['model'],_0x425d20['query']);_0xdbdb81['attributes']=_[_0x7562('0x34')](_0x425d20['model'],qs['fields'](_0x34a1a7[_0x7562('0x2b')][_0x7562('0x42')]));_0xdbdb81[_0x7562('0x35')]=_0xdbdb81[_0x7562('0x35')][_0x7562('0x36')]?_0xdbdb81['attributes']:_0x425d20[_0x7562('0x31')];if(!_0x34a1a7[_0x7562('0x2b')][_0x7562('0x43')](_0x7562('0x44'))){_0xdbdb81['limit']=qs[_0x7562('0x18')](_0x34a1a7[_0x7562('0x2b')][_0x7562('0x18')]);_0xdbdb81[_0x7562('0x16')]=qs['offset'](_0x34a1a7[_0x7562('0x2b')]['offset']);}_0xdbdb81['order']=qs[_0x7562('0x45')](_0x34a1a7['query'][_0x7562('0x45')]);_0xdbdb81['where']=qs['filters'](_['pick'](_0x34a1a7[_0x7562('0x2b')],_0x425d20['filters']));_0xdbdb81[_0x7562('0x46')][_0x7562('0x47')]=_0x433d1d['id'];if(_0x34a1a7[_0x7562('0x2b')][_0x7562('0x48')]){_0xdbdb81[_0x7562('0x46')]=_[_0x7562('0x49')](_0xdbdb81[_0x7562('0x46')],{'$or':_['map'](_0xdbdb81[_0x7562('0x35')],function(_0x583814){var _0xfc30c4={};_0xfc30c4[_0x583814]={'$like':'%'+_0x34a1a7[_0x7562('0x2b')][_0x7562('0x48')]+'%'};return _0xfc30c4;})});}if(_0x34a1a7[_0x7562('0x2b')][_0x7562('0x4a')]){var _0x158177=_0x34a1a7['query'][_0x7562('0x4a')][_0x7562('0x4b')](',');var _0x5add18={};_0x5add18[_0x158177[0x0]]={'$gte':moment(_0x158177[0x1])[_0x7562('0x4c')](_0x7562('0x4d'))};_0xdbdb81[_0x7562('0x46')]=_[_0x7562('0x49')](_0xdbdb81[_0x7562('0x46')],_0x5add18);}_0xdbdb81=_[_0x7562('0x49')]({},_0xdbdb81,_0x34a1a7[_0x7562('0x39')]);return db[_0x7562('0x3f')][_0x7562('0x19')]({'where':_0xdbdb81['where']})['then'](function(_0x4772c7){_0x281be2[_0x7562('0x19')]=_0x4772c7;if(_0x34a1a7[_0x7562('0x2b')][_0x7562('0x37')]){_0xdbdb81['include']=[{'all':!![]}];}return db[_0x7562('0x3f')]['findAll'](_0xdbdb81);})[_0x7562('0x1f')](function(_0x2bd0af){_0x281be2[_0x7562('0x4e')]=_0x2bd0af;return _0x281be2;});}})['then'](respondWithFilteredResult(_0x359a4a,_0xdbdb81))[_0x7562('0x2d')](handleError(_0x359a4a,null));};exports[_0x7562('0x4f')]=function(_0x294200,_0x37e65a){return db['OpenchannelInteraction'][_0x7562('0x3c')]({'where':{'id':_0x294200[_0x7562('0x30')]['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x37e65a,null))[_0x7562('0x1f')](function(_0x546bc1){if(_0x546bc1){return _0x546bc1[_0x7562('0x50')](_0x294200[_0x7562('0x3b')][_0x7562('0x40')],_[_0x7562('0x41')](_0x294200[_0x7562('0x3b')],['ids','id'])||{})[_0x7562('0x51')](function(){return db['Tag'][_0x7562('0x2a')]({'attributes':['id',_0x7562('0x22'),_0x7562('0x52')],'where':{'id':_0x294200['body'][_0x7562('0x40')]}});})[_0x7562('0x1f')](function(_0xc8c05e){socket[_0x7562('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x294200[_0x7562('0x30')]['id']),'tags':_0xc8c05e||[]});return{'id':Number(_0x294200['params']['id']),'tags':_0xc8c05e||[]};});}})[_0x7562('0x1f')](respondWithResult(_0x37e65a,null))[_0x7562('0x2d')](handleError(_0x37e65a,null));};exports[_0x7562('0x54')]=function(_0x5a41d8,_0x13ca8c){return db[_0x7562('0x25')][_0x7562('0x3c')]({'where':{'id':_0x5a41d8[_0x7562('0x30')]['id']}})[_0x7562('0x1f')](handleEntityNotFound(_0x13ca8c,null))[_0x7562('0x1f')](function(_0x2fa141){if(_0x2fa141){return _0x2fa141[_0x7562('0x54')](_0x5a41d8['query'][_0x7562('0x40')]);}})[_0x7562('0x1f')](respondWithStatusCode(_0x13ca8c,null))[_0x7562('0x2d')](handleError(_0x13ca8c,null));};exports['download']=function(_0x18b974,_0x1cde57){var _0x457e8c=moment()[_0x7562('0x55')]()[_0x7562('0x56')]();var _0x1b9c9c=path[_0x7562('0x57')](config[_0x7562('0x58')],_0x7562('0x59'),_0x7562('0x5a'),'tmp');var _0x44716b=path[_0x7562('0x57')](config[_0x7562('0x58')],_0x7562('0x59'),_0x7562('0x5a'),'attachments');var _0x4d0cbb=path[_0x7562('0x57')](_0x1b9c9c,_0x457e8c);var _0x110c32=util[_0x7562('0x4c')](_0x7562('0x5b'),_0x18b974['params']['id'],_0x457e8c);var _0x14d89a=path['join'](_0x1b9c9c,_0x110c32);var _0x4b410c=[];_0x4b410c[_0x7562('0x5c')]({'model':db[_0x7562('0x5d')],'as':_0x7562('0x5d'),'attributes':['id',_0x7562('0x5e')],'raw':!![]});_0x4b410c['push']({'model':db[_0x7562('0x5f')],'as':_0x7562('0x60'),'attributes':['id','firstName',_0x7562('0x61')],'raw':!![]});if(_0x18b974[_0x7562('0x2b')]['attachments']){_0x4b410c['push']({'model':db[_0x7562('0x62')],'as':_0x7562('0x62'),'raw':!![]});}var _0x3c29bc=[{'model':db[_0x7562('0x3f')],'as':'Messages','attributes':['id','body',_0x7562('0x63'),'direction',_0x7562('0x64'),_0x7562('0x65')],'include':_0x4b410c}];_0x3c29bc[_0x7562('0x5c')]({'model':db[_0x7562('0x66')],'as':'Account','attributes':['id','name']});_0x3c29bc[_0x7562('0x5c')]({'model':db[_0x7562('0x5d')],'as':_0x7562('0x67'),'attributes':['id',_0x7562('0x5e')]});return db[_0x7562('0x25')][_0x7562('0x3c')]({'where':{'id':_0x18b974['params']['id']},'include':_0x3c29bc})[_0x7562('0x1f')](handleEntityNotFound(_0x1cde57,null))['then'](function(_0x36511e){if(_0x36511e){var _0x29fabc=_0x36511e['get']({'plain':!![]});fs[_0x7562('0x68')](_0x4d0cbb);var _0x459d91={'channel':_0x7562('0x69'),'account':_0x29fabc[_0x7562('0x6a')][_0x7562('0x22')],'agent':_0x29fabc[_0x7562('0x67')]?_0x29fabc[_0x7562('0x67')][_0x7562('0x5e')]:_0x7562('0x6b'),'createdAt':moment(_0x29fabc['createdAt'])[_0x7562('0x4c')](_0x7562('0x4d'))[_0x7562('0x56')](),'closedAt':_0x29fabc[_0x7562('0x6c')]?moment(_0x29fabc[_0x7562('0x6d')])[_0x7562('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7562('0x56')]():'','disposition':_0x29fabc[_0x7562('0x6e')],'visibility':_0x29fabc[_0x7562('0x6f')]?_0x7562('0x70'):'Private','messages':_(_0x29fabc[_0x7562('0x71')])[_0x7562('0x48')]({'secret':![]})['map'](function(_0x21e46a){if(_0x21e46a['Attachment']){var _0x4ddc14=path[_0x7562('0x57')](_0x44716b,_0x21e46a['Attachment'][_0x7562('0x72')]);if(fs['existsSync'](_0x4ddc14)){fs[_0x7562('0x73')](_0x4ddc14)[_0x7562('0x74')](fs[_0x7562('0x75')](path[_0x7562('0x57')](_0x4d0cbb,_0x21e46a['Attachment'][_0x7562('0x72')])));}}return{'date':moment(_0x21e46a[_0x7562('0x63')])[_0x7562('0x4c')](_0x7562('0x4d'))[_0x7562('0x56')](),'sender':_0x21e46a[_0x7562('0x76')]===_0x7562('0x77')?_0x21e46a[_0x7562('0x5d')]?_0x21e46a['User'][_0x7562('0x5e')]:_0x7562('0x78'):_0x21e46a[_0x7562('0x60')][_0x7562('0x79')]+(_0x21e46a[_0x7562('0x60')][_0x7562('0x61')]?'\x20'+_0x21e46a[_0x7562('0x60')]['lastName']:''),'body':_0x21e46a[_0x7562('0x62')]?_0x21e46a[_0x7562('0x62')][_0x7562('0x72')]:_0x21e46a[_0x7562('0x3b')],'direction':_0x21e46a[_0x7562('0x76')]===_0x7562('0x77')?'A':'C','secret':_0x21e46a[_0x7562('0x64')],'read':_0x21e46a['read'],'attachment':_0x21e46a[_0x7562('0x62')]};})['value']()};return ejs['renderFile'](path[_0x7562('0x57')](config[_0x7562('0x58')],'server',_0x7562('0x7a'),'downloadInteraction.ejs'),{'interaction':_0x459d91})[_0x7562('0x1f')](function(_0x19dde4){var _0xb6c57=path[_0x7562('0x57')](_0x4d0cbb,_0x7562('0x7b')+_0x29fabc['id']+'-'+_0x457e8c+_0x7562('0x7c'));var _0x3226bc={'path':_0xb6c57,'channel':_0x7562('0x69'),'interactionId':_0x29fabc['id']};return pdf['createPdfFromHTML'](_0x19dde4,_0x3226bc);})[_0x7562('0x1f')](function(){return new Promise(function(_0x5d5b3c,_0x59cecb){zipdir(_0x4d0cbb,{'saveTo':_0x14d89a},function(_0x5f3b43,_0x316756){if(_0x5f3b43)return _0x59cecb(_0x5f3b43);return _0x5d5b3c(_0x316756);});})['then'](function(){return new Promise(function(_0x1419a1,_0x364a06){rimraf(_0x4d0cbb,function(_0x16577e){if(_0x16577e)_0x364a06(_0x16577e);return _0x1419a1();});});})[_0x7562('0x1f')](function(){return _0x1cde57[_0x7562('0x7d')](_0x14d89a,_0x110c32,function(_0x278edc){if(_0x278edc){logger['error'](_0x7562('0x7e'),_0x278edc);}else{fs[_0x7562('0x7f')](_0x14d89a);}});});});}else{return _0x1cde57['sendStatus'](0xc8);}})[_0x7562('0x2d')](handleError(_0x1cde57,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index df89d5c..54e60d0 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 _0x2830=['map','findAll','unreadMessages','emit','catch','hook','exports','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue'];(function(_0x351ca8,_0x10072d){var _0x470674=function(_0x957d8b){while(--_0x957d8b){_0x351ca8['push'](_0x351ca8['shift']());}};_0x470674(++_0x10072d);}(_0x2830,0xca));var _0x0283=function(_0x362fdc,_0x33283b){_0x362fdc=_0x362fdc-0x0;var _0x3e2aea=_0x2830[_0x362fdc];return _0x3e2aea;};'use strict';var EventEmitter=require(_0x0283('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x0283('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x0283('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0283('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0283('0x4')};function emitEvent(_0x361ab7){return function(_0x3f03dd,_0x1c8fed,_0x4433eb){_0x3f03dd[_0x0283('0x5')]({'attributes':['id'],'raw':!![]})[_0x0283('0x6')](function(_0x20bd3e){_0x3f03dd[_0x0283('0x7')]('Users',_0x20bd3e[_0x0283('0x8')](function(_0x45ce98){return{'id':_0x45ce98['id']};}));return OpenchannelMessage[_0x0283('0x9')]({'where':{'OpenchannelInteractionId':_0x3f03dd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0283('0x6')](function(_0x3db8c9){_0x3f03dd[_0x0283('0x7')](_0x0283('0xa'),_0x3db8c9['length']);OpenchannelInteractionEvents[_0x0283('0xb')](_0x361ab7+':'+_0x3f03dd['id'],_0x3f03dd);OpenchannelInteractionEvents[_0x0283('0xb')](_0x361ab7,_0x3f03dd);_0x4433eb(null);})[_0x0283('0xc')](_0x4433eb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x0283('0xd')](e,emitEvent(event));}}module[_0x0283('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4a1d=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','then','setDataValue','Users','length','emit','hook','events'];(function(_0x239393,_0x1ae5ad){var _0x1b72c2=function(_0x5e1a17){while(--_0x5e1a17){_0x239393['push'](_0x239393['shift']());}};_0x1b72c2(++_0x1ae5ad);}(_0x4a1d,0xa7));var _0xd4a1=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x4a1d[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0xd4a1('0x0'));var OpenchannelInteraction=require(_0xd4a1('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xd4a1('0x1'))['db'][_0xd4a1('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd4a1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd4a1('0x4'),'afterDestroy':_0xd4a1('0x5')};function emitEvent(_0x5ad45c){return function(_0x3b0470,_0x5800e9,_0x487abd){_0x3b0470['getUsers']({'attributes':['id'],'raw':!![]})[_0xd4a1('0x6')](function(_0x10c58b){_0x3b0470[_0xd4a1('0x7')](_0xd4a1('0x8'),_0x10c58b['map'](function(_0x2937e9){return{'id':_0x2937e9['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3b0470['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd4a1('0x6')](function(_0x2bb2eb){_0x3b0470[_0xd4a1('0x7')]('unreadMessages',_0x2bb2eb[_0xd4a1('0x9')]);OpenchannelInteractionEvents[_0xd4a1('0xa')](_0x5ad45c+':'+_0x3b0470['id'],_0x3b0470);OpenchannelInteractionEvents[_0xd4a1('0xa')](_0x5ad45c,_0x3b0470);_0x487abd(null);})['catch'](_0x487abd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xd4a1('0xb')](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 d14c809..b7be0e6 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 _0xd9bf=['OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','api','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9bf,0x1d2));var _0xfd9b=function(_0x191d6e,_0x180635){_0x191d6e=_0x191d6e-0x0;var _0x1b36a3=_0xd9bf[_0x191d6e];return _0x1b36a3;};'use strict';var _=require(_0xfd9b('0x0'));var util=require(_0xfd9b('0x1'));var logger=require('../../config/logger')(_0xfd9b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd9b('0x3'));var fs=require('fs');var path=require(_0xfd9b('0x4'));var rimraf=require(_0xfd9b('0x5'));var config=require(_0xfd9b('0x6'));var attributes=require(_0xfd9b('0x7'));module[_0xfd9b('0x8')]=function(_0x5d362c,_0x4d41d2){return _0x5d362c[_0xfd9b('0x9')](_0xfd9b('0xa'),attributes,{'tableName':_0xfd9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfd9b('0xc'),'hooks':{'beforeUpdate':function(_0x3c619f,_0xe37b8f,_0x3e3530){if(_0x3c619f[_0xfd9b('0xd')](_0xfd9b('0xe'))){_0x3c619f[_0xfd9b('0xf')]=moment()[_0xfd9b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3e3530(null,_0x3c619f);}}});}; \ No newline at end of file +var _0x1012=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','OpenchannelInteraction'];(function(_0x2518dd,_0x1a5221){var _0x495423=function(_0x593e42){while(--_0x593e42){_0x2518dd['push'](_0x2518dd['shift']());}};_0x495423(++_0x1a5221);}(_0x1012,0x1f0));var _0x2101=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x1012[_0x26b5ff];return _0x58603e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2101('0x0'))('api');var moment=require(_0x2101('0x1'));var BPromise=require(_0x2101('0x2'));var rp=require(_0x2101('0x3'));var fs=require('fs');var path=require(_0x2101('0x4'));var rimraf=require('rimraf');var config=require(_0x2101('0x5'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x1d91cd,_0x4a2188){return _0x1d91cd[_0x2101('0x6')](_0x2101('0x7'),attributes,{'tableName':_0x2101('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2101('0x9'),'collate':_0x2101('0xa'),'hooks':{'beforeUpdate':function(_0x46c6cb,_0x2c207a,_0x96acbf){if(_0x46c6cb['changed'](_0x2101('0xb'))){_0x46c6cb[_0x2101('0xc')]=moment()['format'](_0x2101('0xd'));}_0x96acbf(null,_0x46c6cb);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5e1509b..c5658f1 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 _0x6fe9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','body','options','raw','where','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x150cc4,_0x15e9f1){var _0x22a995=function(_0x114834){while(--_0x114834){_0x150cc4['push'](_0x150cc4['shift']());}};_0x22a995(++_0x15e9f1);}(_0x6fe9,0x8f));var _0x96fe=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x6fe9[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x96fe('0x0'));var util=require('util');var moment=require(_0x96fe('0x1'));var BPromise=require(_0x96fe('0x2'));var rs=require(_0x96fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96fe('0x5'))(_0x96fe('0x6'));var config=require(_0x96fe('0x7'));var jayson=require(_0x96fe('0x8'));var client=jayson[_0x96fe('0x9')][_0x96fe('0xa')]({'port':0x232a});config[_0x96fe('0xb')]=_['defaults'](config[_0x96fe('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96fe('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x191d1b,_0xcbd426,_0x4d5129){return new BPromise(function(_0x2fa053,_0x39bb0b){return client[_0x96fe('0xc')](_0x191d1b,_0x4d5129)[_0x96fe('0xd')](function(_0x586ab8){logger[_0x96fe('0xe')](_0x96fe('0xf'),_0xcbd426,_0x96fe('0x10'));logger['debug'](_0x96fe('0x11'),_0xcbd426,_0x96fe('0x10'),JSON[_0x96fe('0x12')](_0x586ab8));if(_0x586ab8['error']){if(_0x586ab8['error'][_0x96fe('0x13')]===0x1f4){logger[_0x96fe('0x14')](_0x96fe('0xf'),_0xcbd426,_0x586ab8['error']['message']);return _0x39bb0b(_0x586ab8['error']['message']);}logger[_0x96fe('0x14')](_0x96fe('0xf'),_0xcbd426,_0x586ab8[_0x96fe('0x14')][_0x96fe('0x15')]);return _0x2fa053(_0x586ab8[_0x96fe('0x14')][_0x96fe('0x15')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xcbd426,'request\x20sent');_0x2fa053(_0x586ab8[_0x96fe('0x16')]['message']);}})[_0x96fe('0x17')](function(_0x4868cd){logger[_0x96fe('0x14')](_0x96fe('0xf'),_0xcbd426,_0x4868cd);_0x39bb0b(_0x4868cd);});});}exports['UpdateOpenchannelInteraction']=function(_0x40bf32){var _0x5581df=this;return new Promise(function(_0x32fe14,_0x112a26){return db['OpenchannelInteraction']['update'](_0x40bf32[_0x96fe('0x18')],{'raw':_0x40bf32[_0x96fe('0x19')]?_0x40bf32[_0x96fe('0x19')][_0x96fe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40bf32[_0x96fe('0x19')]?_0x40bf32['options'][_0x96fe('0x1b')]||null:null,'attributes':_0x40bf32['options']?_0x40bf32[_0x96fe('0x19')]['attributes']||null:null,'limit':_0x40bf32[_0x96fe('0x19')]?_0x40bf32['options'][_0x96fe('0x1c')]||null:null})[_0x96fe('0xd')](function(_0x474e5e){logger[_0x96fe('0xe')](_0x96fe('0x1d'),_0x40bf32);logger[_0x96fe('0x1e')]('UpdateOpenchannelInteraction',_0x40bf32,JSON[_0x96fe('0x12')](_0x474e5e));_0x32fe14(_0x474e5e);})['catch'](function(_0xce5966){logger[_0x96fe('0x14')](_0x96fe('0x1d'),_0xce5966[_0x96fe('0x15')],_0x40bf32);_0x112a26(_0x5581df[_0x96fe('0x14')](0x1f4,_0xce5966['message']));});});};exports[_0x96fe('0x1f')]=function(_0x2e26f2){return new Promise(function(_0x5c45df,_0x35e439){return db['OpenchannelInteraction'][_0x96fe('0x20')]({'where':_0x2e26f2[_0x96fe('0x19')]?_0x2e26f2[_0x96fe('0x19')][_0x96fe('0x1b')]||null:null})['then'](function(_0x3022b5){if(_0x3022b5){return _0x3022b5[_0x96fe('0x21')](_0x2e26f2[_0x96fe('0x18')][_0x96fe('0x22')],_[_0x96fe('0x23')](_0x2e26f2[_0x96fe('0x18')],[_0x96fe('0x22'),'id'])||{});}})['spread'](function(_0x5a930f){logger[_0x96fe('0xe')](_0x96fe('0x24'),_0x2e26f2);logger['debug'](_0x96fe('0x24'),_0x2e26f2,JSON[_0x96fe('0x12')](_0x5a930f));_0x5c45df(_0x5a930f);})[_0x96fe('0x17')](function(_0x395da1){logger[_0x96fe('0x14')](_0x96fe('0x24'),_0x395da1[_0x96fe('0x15')],_0x2e26f2);_0x35e439(_this['error'](0x1f4,_0x395da1[_0x96fe('0x15')]));});});}; \ No newline at end of file +var _0x2a51=['http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x2a51,0xe7));var _0x12a5=function(_0x1845a0,_0x500431){_0x1845a0=_0x1845a0-0x0;var _0x2de0bc=_0x2a51[_0x1845a0];return _0x2de0bc;};'use strict';var _=require(_0x12a5('0x0'));var util=require('util');var moment=require(_0x12a5('0x1'));var BPromise=require(_0x12a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12a5('0x3'))['db'];var utils=require(_0x12a5('0x4'));var logger=require(_0x12a5('0x5'))('rpc');var config=require(_0x12a5('0x6'));var jayson=require(_0x12a5('0x7'));var client=jayson[_0x12a5('0x8')][_0x12a5('0x9')]({'port':0x232a});config[_0x12a5('0xa')]=_[_0x12a5('0xb')](config[_0x12a5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x12a5('0xc'))(new Redis(config['redis']));require(_0x12a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x158b77,_0x148066,_0x21dd25){return new BPromise(function(_0x4e6bab,_0x457ec9){return client['request'](_0x158b77,_0x21dd25)[_0x12a5('0xe')](function(_0x1b9f14){logger[_0x12a5('0xf')](_0x12a5('0x10'),_0x148066,'request\x20sent');logger[_0x12a5('0x11')](_0x12a5('0x12'),_0x148066,_0x12a5('0x13'),JSON['stringify'](_0x1b9f14));if(_0x1b9f14[_0x12a5('0x14')]){if(_0x1b9f14[_0x12a5('0x14')][_0x12a5('0x15')]===0x1f4){logger[_0x12a5('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x148066,_0x1b9f14[_0x12a5('0x14')][_0x12a5('0x16')]);return _0x457ec9(_0x1b9f14[_0x12a5('0x14')]['message']);}logger[_0x12a5('0x14')](_0x12a5('0x10'),_0x148066,_0x1b9f14['error'][_0x12a5('0x16')]);return _0x4e6bab(_0x1b9f14['error']['message']);}else{logger[_0x12a5('0xf')](_0x12a5('0x10'),_0x148066,_0x12a5('0x13'));_0x4e6bab(_0x1b9f14['result'][_0x12a5('0x16')]);}})[_0x12a5('0x17')](function(_0x626100){logger['error'](_0x12a5('0x10'),_0x148066,_0x626100);_0x457ec9(_0x626100);});});}exports[_0x12a5('0x18')]=function(_0xfef001){var _0x18179d=this;return new Promise(function(_0x1f6c0e,_0x2687e2){return db[_0x12a5('0x19')][_0x12a5('0x1a')](_0xfef001[_0x12a5('0x1b')],{'raw':_0xfef001['options']?_0xfef001[_0x12a5('0x1c')][_0x12a5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfef001[_0x12a5('0x1c')]?_0xfef001['options']['where']||null:null,'attributes':_0xfef001['options']?_0xfef001[_0x12a5('0x1c')][_0x12a5('0x1e')]||null:null,'limit':_0xfef001[_0x12a5('0x1c')]?_0xfef001[_0x12a5('0x1c')][_0x12a5('0x1f')]||null:null})[_0x12a5('0xe')](function(_0x217874){logger['info'](_0x12a5('0x18'),_0xfef001);logger[_0x12a5('0x11')]('UpdateOpenchannelInteraction',_0xfef001,JSON[_0x12a5('0x20')](_0x217874));_0x1f6c0e(_0x217874);})[_0x12a5('0x17')](function(_0xe60a41){logger[_0x12a5('0x14')](_0x12a5('0x18'),_0xe60a41[_0x12a5('0x16')],_0xfef001);_0x2687e2(_0x18179d[_0x12a5('0x14')](0x1f4,_0xe60a41[_0x12a5('0x16')]));});});};exports[_0x12a5('0x21')]=function(_0x563e04){return new Promise(function(_0x5cc9f8,_0x221cc4){return db['OpenchannelInteraction'][_0x12a5('0x22')]({'where':_0x563e04[_0x12a5('0x1c')]?_0x563e04['options']['where']||null:null})[_0x12a5('0xe')](function(_0x3ee6ad){if(_0x3ee6ad){return _0x3ee6ad[_0x12a5('0x23')](_0x563e04[_0x12a5('0x1b')][_0x12a5('0x24')],_[_0x12a5('0x25')](_0x563e04[_0x12a5('0x1b')],['ids','id'])||{});}})[_0x12a5('0x26')](function(_0x1f0ee6){logger[_0x12a5('0xf')](_0x12a5('0x27'),_0x563e04);logger[_0x12a5('0x11')]('AddTags',_0x563e04,JSON[_0x12a5('0x20')](_0x1f0ee6));_0x5cc9f8(_0x1f0ee6);})['catch'](function(_0x23dda1){logger[_0x12a5('0x14')]('AddTags',_0x23dda1['message'],_0x563e04);_0x221cc4(_this['error'](0x1f4,_0x23dda1[_0x12a5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b66f247..09f1b06 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 _0xdeed=['openchannelInteraction:','./openchannelInteraction.events','save','update','removeListener','register','length'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0xdeed,0x135));var _0xddee=function(_0xf6b76b,_0x241fa9){_0xf6b76b=_0xf6b76b-0x0;var _0x166de8=_0xdeed[_0xf6b76b];return _0x166de8;};'use strict';var OpenchannelInteractionEvents=require(_0xddee('0x0'));var events=[_0xddee('0x1'),'remove',_0xddee('0x2')];function createListener(_0x5dddeb,_0x37c963){return function(_0x22848a){_0x37c963['emit'](_0x5dddeb,_0x22848a);};}function removeListener(_0x749564,_0x5f2c72){return function(){OpenchannelInteractionEvents[_0xddee('0x3')](_0x749564,_0x5f2c72);};}exports[_0xddee('0x4')]=function(_0x32bb16){for(var _0x200cc0=0x0,_0x42c1e7=events[_0xddee('0x5')];_0x200cc0<_0x42c1e7;_0x200cc0++){var _0x20515d=events[_0x200cc0];var _0x55293f=createListener(_0xddee('0x6')+_0x20515d,_0x32bb16);OpenchannelInteractionEvents['on'](_0x20515d,_0x55293f);}}; \ No newline at end of file +var _0x9359=['emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x1718b1,_0xebfeb1){var _0x1b3f9a=function(_0x8b418d){while(--_0x8b418d){_0x1718b1['push'](_0x1718b1['shift']());}};_0x1b3f9a(++_0xebfeb1);}(_0x9359,0xcc));var _0x9935=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9359[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelInteractionEvents=require(_0x9935('0x0'));var events=[_0x9935('0x1'),_0x9935('0x2'),_0x9935('0x3')];function createListener(_0x4290e2,_0x532d98){return function(_0x4be5c7){_0x532d98[_0x9935('0x4')](_0x4290e2,_0x4be5c7);};}function removeListener(_0x5c3e75,_0x21b8e8){return function(){OpenchannelInteractionEvents[_0x9935('0x5')](_0x5c3e75,_0x21b8e8);};}exports[_0x9935('0x6')]=function(_0x51da5b){for(var _0x47f89a=0x0,_0x1b1480=events['length'];_0x47f89a<_0x1b1480;_0x47f89a++){var _0x2def27=events[_0x47f89a];var _0x2829f0=createListener(_0x9935('0x7')+_0x2def27,_0x51da5b);OpenchannelInteractionEvents['on'](_0x2def27,_0x2829f0);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 76f68db..8c1860f 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x10d8fc,_0x27a880){var _0x9f44d1=function(_0x2dcaec){while(--_0x2dcaec){_0x10d8fc['push'](_0x10d8fc['shift']());}};_0x9f44d1(++_0x27a880);}(_0xedd9,0xfc));var _0x9edd=function(_0x12be2a,_0x61e503){_0x12be2a=_0x12be2a-0x0;var _0x23841f=_0xedd9[_0x12be2a];return _0x23841f;};'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['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x15cf8c,_0x4c5653){var _0x408f33=function(_0x2d8e58){while(--_0x2d8e58){_0x15cf8c['push'](_0x15cf8c['shift']());}};_0x408f33(++_0x4c5653);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e5990,_0x41600f){_0x2e5990=_0x2e5990-0x0;var _0x18dfec=_0xedd9[_0x2e5990];return _0x18dfec;};'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['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index f7f851e..261c699 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 _0x4dd3=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x2dd554,_0x19dae3){var _0x4aba15=function(_0x469a23){while(--_0x469a23){_0x2dd554['push'](_0x2dd554['shift']());}};_0x4aba15(++_0x19dae3);}(_0x4dd3,0xf5));var _0x34dd=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x4dd3[_0xcd5a3d];return _0xd43207;};'use strict';var Sequelize=require(_0x34dd('0x0'));module[_0x34dd('0x1')]={'body':{'type':Sequelize[_0x34dd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x34dd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x34dd('0x4')),'defaultValue':_0x34dd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x34dd('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x34dd('0x2')]}}; \ No newline at end of file +var _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0x9158,0x16e));var _0x8915=function(_0x3bc19d,_0x265d2e){_0x3bc19d=_0x3bc19d-0x0;var _0x32e693=_0x9158[_0x3bc19d];return _0x32e693;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 59a4488..7855dad 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 _0xe0c5=['get','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','email','internal','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','fullname','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelMessage.socket','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','json','undefined','count','status','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','index','OpenchannelMessage','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','describe','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteractionId','isNil','interaction'];(function(_0x46dd0f,_0x23236c){var _0x56d124=function(_0x42b95f){while(--_0x42b95f){_0x46dd0f['push'](_0x46dd0f['shift']());}};_0x56d124(++_0x23236c);}(_0xe0c5,0x98));var _0x5e0c=function(_0x13b861,_0x53fc3a){_0x13b861=_0x13b861-0x0;var _0xd4f263=_0xe0c5[_0x13b861];return _0xd4f263;};'use strict';var emlformat=require(_0x5e0c('0x0'));var rimraf=require(_0x5e0c('0x1'));var zipdir=require(_0x5e0c('0x2'));var jsonpatch=require(_0x5e0c('0x3'));var rp=require(_0x5e0c('0x4'));var moment=require(_0x5e0c('0x5'));var BPromise=require(_0x5e0c('0x6'));var Mustache=require('mustache');var util=require(_0x5e0c('0x7'));var path=require('path');var sox=require(_0x5e0c('0x8'));var csv=require(_0x5e0c('0x9'));var ejs=require(_0x5e0c('0xa'));var fs=require('fs');var fs_extra=require(_0x5e0c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e0c('0xc'));var jsforce=require(_0x5e0c('0xd'));var deskjs=require(_0x5e0c('0xe'));var toCsv=require(_0x5e0c('0x9'));var querystring=require(_0x5e0c('0xf'));var Papa=require(_0x5e0c('0x10'));var Redis=require(_0x5e0c('0x11'));var authService=require(_0x5e0c('0x12'));var qs=require(_0x5e0c('0x13'));var as=require(_0x5e0c('0x14'));var hardwareService=require(_0x5e0c('0x15'));var logger=require(_0x5e0c('0x16'))('api');var utils=require(_0x5e0c('0x17'));var config=require(_0x5e0c('0x18'));var licenseUtil=require(_0x5e0c('0x19'));var db=require(_0x5e0c('0x1a'))['db'];config[_0x5e0c('0x1b')]=_[_0x5e0c('0x1c')](config[_0x5e0c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e0c('0x1b')]));require(_0x5e0c('0x1d'))['register'](socket);var jayson=require(_0x5e0c('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x5e0c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3d1aac,_0x1f1566,_0x3a0f72,_0x206d7b){return new BPromise(function(_0x370fc3,_0x55caa9){var _0x23a59a=_0x206d7b||client;return _0x23a59a[_0x5e0c('0x20')](_0x3d1aac,_0x3a0f72)[_0x5e0c('0x21')](function(_0x40f1cd){logger[_0x5e0c('0x22')](_0x5e0c('0x23'),_0x1f1566,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1f1566,_0x5e0c('0x24'),JSON[_0x5e0c('0x25')](_0x40f1cd));if(_0x40f1cd[_0x5e0c('0x26')]){if(_0x40f1cd[_0x5e0c('0x26')][_0x5e0c('0x27')]===0x1f4){logger['error'](_0x5e0c('0x23'),_0x1f1566,_0x40f1cd['error'][_0x5e0c('0x28')]);return _0x55caa9(_0x40f1cd['error'][_0x5e0c('0x28')]);}logger[_0x5e0c('0x26')](_0x5e0c('0x23'),_0x1f1566,_0x40f1cd[_0x5e0c('0x26')][_0x5e0c('0x28')]);return _0x370fc3(_0x40f1cd['error'][_0x5e0c('0x28')]);}else{logger[_0x5e0c('0x22')](_0x5e0c('0x23'),_0x1f1566,_0x5e0c('0x24'));_0x370fc3(_0x40f1cd[_0x5e0c('0x29')]['message']);}})[_0x5e0c('0x2a')](function(_0x41599b){logger[_0x5e0c('0x26')](_0x5e0c('0x23'),_0x1f1566,_0x41599b);_0x55caa9(_0x41599b);});});}function respondWithStatusCode(_0x45a588,_0x5f0d47){_0x5f0d47=_0x5f0d47||0xcc;return function(_0x4bfd90){if(_0x4bfd90){return _0x45a588['sendStatus'](_0x5f0d47);}return _0x45a588['status'](_0x5f0d47)['end']();};}function respondWithResult(_0x14b316,_0x19cead){_0x19cead=_0x19cead||0xc8;return function(_0xabe577){if(_0xabe577){return _0x14b316['status'](_0x19cead)[_0x5e0c('0x2b')](_0xabe577);}};}function respondWithFilteredResult(_0x3a5cc9,_0x2c5e27){return function(_0x3be293){if(_0x3be293){var _0x1d5611=typeof _0x2c5e27['offset']===_0x5e0c('0x2c')&&typeof _0x2c5e27['limit']===_0x5e0c('0x2c');var _0x494c0d=_0x3be293[_0x5e0c('0x2d')];var _0x401eba=_0x1d5611?0x0:_0x2c5e27['offset'];var _0x488852=_0x1d5611?_0x3be293['count']:_0x2c5e27['offset']+_0x2c5e27['limit'];var _0x27c5fc;if(_0x488852>=_0x494c0d){_0x488852=_0x494c0d;_0x27c5fc=0xc8;}else{_0x27c5fc=0xce;}_0x3a5cc9[_0x5e0c('0x2e')](_0x27c5fc);return _0x3a5cc9[_0x5e0c('0x2f')](_0x5e0c('0x30'),_0x401eba+'-'+_0x488852+'/'+_0x494c0d)[_0x5e0c('0x2b')](_0x3be293);}return null;};}function patchUpdates(_0x4ac95d){return function(_0x388b82){try{jsonpatch['apply'](_0x388b82,_0x4ac95d,!![]);}catch(_0x2a9f26){return BPromise[_0x5e0c('0x31')](_0x2a9f26);}return _0x388b82[_0x5e0c('0x32')]();};}function saveUpdates(_0xd2d67c,_0xaa1633){return function(_0x4ba796){if(_0x4ba796){return _0x4ba796[_0x5e0c('0x33')](_0xd2d67c)[_0x5e0c('0x21')](function(_0x51f0be){return _0x51f0be;});}return null;};}function removeEntity(_0x2154c3,_0x1d8050){return function(_0x2e77c3){if(_0x2e77c3){return _0x2e77c3[_0x5e0c('0x34')]()[_0x5e0c('0x21')](function(){_0x2154c3['status'](0xcc)[_0x5e0c('0x35')]();});}};}function handleEntityNotFound(_0x272699,_0xedb8e1){return function(_0x5cb2c1){if(!_0x5cb2c1){_0x272699[_0x5e0c('0x36')](0x194);}return _0x5cb2c1;};}function handleError(_0x4fa47d,_0x632035){_0x632035=_0x632035||0x1f4;return function(_0x363255){logger['error'](_0x363255[_0x5e0c('0x37')]);if(_0x363255[_0x5e0c('0x38')]){delete _0x363255[_0x5e0c('0x38')];}_0x4fa47d['status'](_0x632035)[_0x5e0c('0x39')](_0x363255);};}exports[_0x5e0c('0x3a')]=function(_0x185be1,_0x19b3fc){var _0x1a90a3={},_0x159031={},_0x186d83={'count':0x0,'rows':[]};var _0x1ef314=_['map'](db[_0x5e0c('0x3b')]['rawAttributes'],function(_0x2ae326){return{'name':_0x2ae326[_0x5e0c('0x3c')],'type':_0x2ae326['type'][_0x5e0c('0x3d')]};});_0x159031['model']=_[_0x5e0c('0x3e')](_0x1ef314,'name');_0x159031['query']=_[_0x5e0c('0x3f')](_0x185be1[_0x5e0c('0x40')]);_0x159031[_0x5e0c('0x41')]=_[_0x5e0c('0x42')](_0x159031[_0x5e0c('0x43')],_0x159031[_0x5e0c('0x40')]);_0x1a90a3[_0x5e0c('0x44')]=_['intersection'](_0x159031[_0x5e0c('0x43')],qs[_0x5e0c('0x45')](_0x185be1['query'][_0x5e0c('0x45')]));_0x1a90a3[_0x5e0c('0x44')]=_0x1a90a3['attributes'][_0x5e0c('0x46')]?_0x1a90a3[_0x5e0c('0x44')]:_0x159031['model'];if(!_0x185be1[_0x5e0c('0x40')][_0x5e0c('0x47')](_0x5e0c('0x48'))){_0x1a90a3[_0x5e0c('0x49')]=qs[_0x5e0c('0x49')](_0x185be1[_0x5e0c('0x40')][_0x5e0c('0x49')]);_0x1a90a3[_0x5e0c('0x4a')]=qs[_0x5e0c('0x4a')](_0x185be1['query']['offset']);}_0x1a90a3['order']=qs['sort'](_0x185be1['query'][_0x5e0c('0x4b')]);_0x1a90a3[_0x5e0c('0x4c')]=qs[_0x5e0c('0x41')](_[_0x5e0c('0x4d')](_0x185be1[_0x5e0c('0x40')],_0x159031[_0x5e0c('0x41')]),_0x1ef314);if(_0x185be1['query']['filter']){_0x1a90a3[_0x5e0c('0x4c')]=_[_0x5e0c('0x4e')](_0x1a90a3['where'],{'$or':_[_0x5e0c('0x3e')](_0x1ef314,function(_0x346a12){if(_0x346a12[_0x5e0c('0x4f')]!==_0x5e0c('0x50')){var _0x23e9f1={};_0x23e9f1[_0x346a12[_0x5e0c('0x38')]]={'$like':'%'+_0x185be1['query']['filter']+'%'};return _0x23e9f1;}})});}_0x1a90a3=_['merge']({},_0x1a90a3,_0x185be1[_0x5e0c('0x51')]);var _0x569ba8={'where':_0x1a90a3['where']};return db['OpenchannelMessage'][_0x5e0c('0x2d')](_0x569ba8)[_0x5e0c('0x21')](function(_0x4527bd){_0x186d83[_0x5e0c('0x2d')]=_0x4527bd;if(_0x185be1['query'][_0x5e0c('0x52')]){_0x1a90a3[_0x5e0c('0x53')]=[{'all':!![]}];}return db[_0x5e0c('0x3b')][_0x5e0c('0x54')](_0x1a90a3);})[_0x5e0c('0x21')](function(_0x8f323c){_0x186d83['rows']=_0x8f323c;return _0x186d83;})[_0x5e0c('0x21')](respondWithFilteredResult(_0x19b3fc,_0x1a90a3))[_0x5e0c('0x2a')](handleError(_0x19b3fc,null));};exports[_0x5e0c('0x55')]=function(_0x1818fa,_0xde33f6){var _0x225ae2={'raw':!![],'where':{'id':_0x1818fa[_0x5e0c('0x56')]['id']}},_0x588a59={};_0x588a59['model']=_[_0x5e0c('0x3f')](db[_0x5e0c('0x3b')]['rawAttributes']);_0x588a59['query']=_[_0x5e0c('0x3f')](_0x1818fa[_0x5e0c('0x40')]);_0x588a59[_0x5e0c('0x41')]=_[_0x5e0c('0x42')](_0x588a59[_0x5e0c('0x43')],_0x588a59['query']);_0x225ae2['attributes']=_[_0x5e0c('0x42')](_0x588a59[_0x5e0c('0x43')],qs[_0x5e0c('0x45')](_0x1818fa[_0x5e0c('0x40')][_0x5e0c('0x45')]));_0x225ae2[_0x5e0c('0x44')]=_0x225ae2[_0x5e0c('0x44')][_0x5e0c('0x46')]?_0x225ae2[_0x5e0c('0x44')]:_0x588a59[_0x5e0c('0x43')];if(_0x1818fa[_0x5e0c('0x40')]['includeAll']){_0x225ae2[_0x5e0c('0x53')]=[{'all':!![]}];}_0x225ae2=_[_0x5e0c('0x4e')]({},_0x225ae2,_0x1818fa[_0x5e0c('0x51')]);return db[_0x5e0c('0x3b')][_0x5e0c('0x57')](_0x225ae2)[_0x5e0c('0x21')](handleEntityNotFound(_0xde33f6,null))[_0x5e0c('0x21')](respondWithResult(_0xde33f6,null))[_0x5e0c('0x2a')](handleError(_0xde33f6,null));};exports[_0x5e0c('0x58')]=function(_0x8a159,_0x44d70a){return db[_0x5e0c('0x3b')][_0x5e0c('0x58')](_0x8a159[_0x5e0c('0x59')],{})[_0x5e0c('0x21')](respondWithResult(_0x44d70a,0xc9))[_0x5e0c('0x2a')](handleError(_0x44d70a,null));};exports[_0x5e0c('0x33')]=function(_0x21382d,_0xf016bb){if(_0x21382d[_0x5e0c('0x59')]['id']){delete _0x21382d[_0x5e0c('0x59')]['id'];}return db[_0x5e0c('0x3b')]['find']({'where':{'id':_0x21382d['params']['id']}})[_0x5e0c('0x21')](handleEntityNotFound(_0xf016bb,null))[_0x5e0c('0x21')](saveUpdates(_0x21382d[_0x5e0c('0x59')],null))['then'](respondWithResult(_0xf016bb,null))['catch'](handleError(_0xf016bb,null));};exports[_0x5e0c('0x34')]=function(_0x1fc492,_0x2598f4){return db[_0x5e0c('0x3b')][_0x5e0c('0x57')]({'where':{'id':_0x1fc492[_0x5e0c('0x56')]['id']}})[_0x5e0c('0x21')](handleEntityNotFound(_0x2598f4,null))[_0x5e0c('0x21')](removeEntity(_0x2598f4,null))[_0x5e0c('0x2a')](handleError(_0x2598f4,null));};exports[_0x5e0c('0x5a')]=function(_0x590bed,_0x525a75){return db[_0x5e0c('0x3b')][_0x5e0c('0x5a')]()[_0x5e0c('0x21')](respondWithResult(_0x525a75,null))[_0x5e0c('0x2a')](handleError(_0x525a75,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x5e0c('0x5b')]=function(_0x1ed388,_0x43a368,_0x4af83a){var _0x170807={'agent':{},'channel':_0x5e0c('0x5c')};if(_0x1ed388[_0x5e0c('0x59')]['id']){delete _0x1ed388[_0x5e0c('0x59')]['id'];}_0x1ed388[_0x5e0c('0x59')][_0x5e0c('0x5d')]=!![];_0x1ed388['body']['readAt']=moment()[_0x5e0c('0x5e')](_0x5e0c('0x5f'));_0x1ed388['body'][_0x5e0c('0x60')]=_0x1ed388['body'][_0x5e0c('0x60')]||_0x1ed388[_0x5e0c('0x61')]['id'];_0x170807[_0x5e0c('0x62')]['id']=_0x1ed388[_0x5e0c('0x59')][_0x5e0c('0x60')];return db[_0x5e0c('0x3b')][_0x5e0c('0x57')]({'where':{'id':_0x1ed388[_0x5e0c('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x43a368,null))['then'](saveUpdates(_0x1ed388['body'],null))[_0x5e0c('0x21')](function(_0x3e7169){if(_0x3e7169){_0x170807[_0x5e0c('0x28')]=_0x3e7169['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x5e0c('0x57')]({'where':{'id':_0x3e7169[_0x5e0c('0x63')]}});}return null;})[_0x5e0c('0x21')](handleEntityNotFound(_0x43a368,null))[_0x5e0c('0x21')](function(_0x4d88b4){if(_0x4d88b4){return _0x4d88b4[_0x5e0c('0x33')]({'UserId':_0x1ed388[_0x5e0c('0x59')][_0x5e0c('0x60')],'read1stAt':_[_0x5e0c('0x64')](_0x4d88b4['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5e0c('0x21')](function(_0x456a05){if(_0x456a05){_0x170807[_0x5e0c('0x65')]=_0x456a05[_0x5e0c('0x66')]({'plain':!![]});interaction_log[_0x5e0c('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ed388[_0x5e0c('0x61')]['id'],_0x1ed388[_0x5e0c('0x61')][_0x5e0c('0x38')],_0x1ed388[_0x5e0c('0x61')][_0x5e0c('0x67')],_0x170807[_0x5e0c('0x65')]['id'],_0x1ed388[_0x5e0c('0x59')]?JSON[_0x5e0c('0x25')](_0x1ed388[_0x5e0c('0x59')]):_0x5e0c('0x68'));return respondWithRpcPromise(_0x5e0c('0x69'),'acceptMessage',_0x170807);}return null;})[_0x5e0c('0x21')](function(_0x154823){var _0x31218e=_0x5e0c('0x6a')+_0x154823[_0x5e0c('0x28')]['ContactId'];return db[_0x5e0c('0x6b')][_0x5e0c('0x40')](_0x31218e,{'type':db['Sequelize'][_0x5e0c('0x6c')][_0x5e0c('0x6d')],'raw':!![]})[_0x5e0c('0x21')](function(_0x14173c){return _0x14173c;});})['then'](function(_0x4b9d31){if(_0x4b9d31){_0x170807['message'][_0x5e0c('0x6e')]=_0x4b9d31[0x0];if(!_0x1ed388[_0x5e0c('0x59')][_0x5e0c('0x60')])return;return db[_0x5e0c('0x6f')][_0x5e0c('0x57')]({'where':{'id':_0x1ed388[_0x5e0c('0x59')]['UserId'],'role':_0x5e0c('0x62')},'attributes':['id',_0x5e0c('0x38'),'fullname',_0x5e0c('0x70'),_0x5e0c('0x71')],'raw':!![]});}return null;})[_0x5e0c('0x21')](function(_0x2fbdd4){if(!_0x2fbdd4)return null;_0x170807[_0x5e0c('0x28')][_0x5e0c('0x62')]=_0x2fbdd4;return _0x170807;})[_0x5e0c('0x21')](function(_0x20a221){if(_0x20a221){if(_0x1ed388[_0x5e0c('0x59')]['manual']){_0x170807[_0x5e0c('0x28')]['interface']=util[_0x5e0c('0x5e')]('SIP/%s',_0x1ed388['user'][_0x5e0c('0x38')]);_0x170807['message']['channel']=_0x170807[_0x5e0c('0x72')];_0x170807[_0x5e0c('0x28')][_0x5e0c('0x73')]=_0x170807[_0x5e0c('0x72')];_0x170807[_0x5e0c('0x28')][_0x5e0c('0x74')]=_0x5e0c('0x5b');return respondWithRpcPromise(_0x5e0c('0x75'),_0x5e0c('0x75'),{'event':_0x5e0c('0x76'),'message':_0x170807[_0x5e0c('0x28')]},client9002)[_0x5e0c('0x21')](function(){return _0x170807;});}return _0x170807;}return null;})[_0x5e0c('0x21')](respondWithResult(_0x43a368,null))[_0x5e0c('0x2a')](handleError(_0x43a368,null));};var interaction_log=require(_0x5e0c('0x16'))('openchannel-interactions');exports[_0x5e0c('0x31')]=function(_0x556fbe,_0x2dd0d5,_0x3e07ab){var _0xe96c2b={'agent':{},'channel':'openchannel'};if(_0x556fbe['body']['id']){delete _0x556fbe['body']['id'];}_0x556fbe[_0x5e0c('0x59')][_0x5e0c('0x60')]=_0x556fbe[_0x5e0c('0x59')][_0x5e0c('0x60')]||_0x556fbe[_0x5e0c('0x61')]['id'];_0xe96c2b['agent']['id']=_0x556fbe[_0x5e0c('0x59')][_0x5e0c('0x60')];return db[_0x5e0c('0x3b')][_0x5e0c('0x57')]({'where':{'id':_0x556fbe[_0x5e0c('0x56')]['id'],'UserId':null}})[_0x5e0c('0x21')](handleEntityNotFound(_0x2dd0d5,null))[_0x5e0c('0x21')](function(_0x599133){if(_0x599133){_0xe96c2b[_0x5e0c('0x28')]=_0x599133['get']({'plain':!![]});return db[_0x5e0c('0x77')]['find']({'where':{'id':_0x599133[_0x5e0c('0x63')]}});}return null;})[_0x5e0c('0x21')](handleEntityNotFound(_0x2dd0d5,null))[_0x5e0c('0x21')](function(_0x163bbd){if(_0x163bbd){_0xe96c2b[_0x5e0c('0x65')]=_0x163bbd['get']({'plain':!![]});interaction_log[_0x5e0c('0x22')](_0x5e0c('0x78'),_0x556fbe[_0x5e0c('0x61')]['id'],_0x556fbe['user']['name'],_0x556fbe[_0x5e0c('0x61')][_0x5e0c('0x67')],_0xe96c2b[_0x5e0c('0x65')]['id'],_0x556fbe[_0x5e0c('0x59')]?JSON[_0x5e0c('0x25')](_0x556fbe[_0x5e0c('0x59')]):_0x5e0c('0x68'));return respondWithRpcPromise(_0x5e0c('0x79'),_0x5e0c('0x7a'),_0xe96c2b);}return null;})[_0x5e0c('0x21')](function(_0x275cd4){var _0xb417e8=_0x5e0c('0x6a')+_0x275cd4[_0x5e0c('0x28')]['ContactId'];return db['sequelize'][_0x5e0c('0x40')](_0xb417e8,{'type':db[_0x5e0c('0x7b')][_0x5e0c('0x6c')][_0x5e0c('0x6d')],'raw':!![]})[_0x5e0c('0x21')](function(_0xd4fa84){return _0xd4fa84;});})[_0x5e0c('0x21')](function(_0x554838){if(_0x554838){_0xe96c2b[_0x5e0c('0x28')][_0x5e0c('0x6e')]=_0x554838[0x0];if(!_0x556fbe[_0x5e0c('0x59')][_0x5e0c('0x60')])return;return db[_0x5e0c('0x6f')]['find']({'where':{'id':_0x556fbe[_0x5e0c('0x59')][_0x5e0c('0x60')],'role':_0x5e0c('0x62')},'attributes':['id',_0x5e0c('0x38'),_0x5e0c('0x7c'),_0x5e0c('0x70'),'internal'],'raw':!![]});}return null;})[_0x5e0c('0x21')](function(_0xb1199f){if(!_0xb1199f)return null;_0xe96c2b[_0x5e0c('0x28')][_0x5e0c('0x62')]=_0xb1199f;return _0xe96c2b;})['then'](function(_0xb9beba){if(_0xb9beba){_0xb9beba[_0x5e0c('0x28')]['interface']=util[_0x5e0c('0x5e')](_0x5e0c('0x7d'),_0x556fbe['user'][_0x5e0c('0x38')]);_0xb9beba[_0x5e0c('0x28')][_0x5e0c('0x72')]=_0xe96c2b[_0x5e0c('0x72')];_0xb9beba['message'][_0x5e0c('0x73')]=_0xe96c2b[_0x5e0c('0x72')];_0xb9beba[_0x5e0c('0x28')][_0x5e0c('0x74')]=_0x5e0c('0x31');respondWithRpcPromise(_0x5e0c('0x75'),_0x5e0c('0x75'),{'event':_0x5e0c('0x7e'),'message':_0xb9beba[_0x5e0c('0x28')]},client9002);return _0xe96c2b;}return null;})[_0x5e0c('0x21')](respondWithResult(_0x2dd0d5,null))[_0x5e0c('0x2a')](handleError(_0x2dd0d5,null));}; \ No newline at end of file +var _0x1686=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','OpenchannelMessage','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','fullname','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5b8354,_0x52af94){var _0x383ae3=function(_0x8dbecf){while(--_0x8dbecf){_0x5b8354['push'](_0x5b8354['shift']());}};_0x383ae3(++_0x52af94);}(_0x1686,0x184));var _0x6168=function(_0x36dcff,_0x31d1e5){_0x36dcff=_0x36dcff-0x0;var _0x77e657=_0x1686[_0x36dcff];return _0x77e657;};'use strict';var emlformat=require(_0x6168('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6168('0x1'));var jsonpatch=require(_0x6168('0x2'));var rp=require(_0x6168('0x3'));var moment=require(_0x6168('0x4'));var BPromise=require(_0x6168('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6168('0x6'));var sox=require(_0x6168('0x7'));var csv=require('to-csv');var ejs=require(_0x6168('0x8'));var fs=require('fs');var fs_extra=require(_0x6168('0x9'));var _=require(_0x6168('0xa'));var squel=require('squel');var crypto=require(_0x6168('0xb'));var jsforce=require(_0x6168('0xc'));var deskjs=require(_0x6168('0xd'));var toCsv=require(_0x6168('0xe'));var querystring=require(_0x6168('0xf'));var Papa=require(_0x6168('0x10'));var Redis=require('ioredis');var authService=require(_0x6168('0x11'));var qs=require(_0x6168('0x12'));var as=require(_0x6168('0x13'));var hardwareService=require(_0x6168('0x14'));var logger=require(_0x6168('0x15'))('api');var utils=require(_0x6168('0x16'));var config=require(_0x6168('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6168('0x18'))['db'];config[_0x6168('0x19')]=_[_0x6168('0x1a')](config[_0x6168('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x6168('0x1b'))(new Redis(config['redis']));require(_0x6168('0x1c'))[_0x6168('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6168('0x1e')][_0x6168('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x6168('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x182ed8,_0xcc5ab1,_0x3e75bb,_0x1249e8){return new BPromise(function(_0x4bad39,_0x1a49bc){var _0x57e47a=_0x1249e8||client;return _0x57e47a[_0x6168('0x20')](_0x182ed8,_0x3e75bb)[_0x6168('0x21')](function(_0x1ec80c){logger[_0x6168('0x22')](_0x6168('0x23'),_0xcc5ab1,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xcc5ab1,_0x6168('0x24'),JSON[_0x6168('0x25')](_0x1ec80c));if(_0x1ec80c['error']){if(_0x1ec80c[_0x6168('0x26')][_0x6168('0x27')]===0x1f4){logger[_0x6168('0x26')](_0x6168('0x23'),_0xcc5ab1,_0x1ec80c['error'][_0x6168('0x28')]);return _0x1a49bc(_0x1ec80c[_0x6168('0x26')]['message']);}logger[_0x6168('0x26')](_0x6168('0x23'),_0xcc5ab1,_0x1ec80c['error'][_0x6168('0x28')]);return _0x4bad39(_0x1ec80c['error'][_0x6168('0x28')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xcc5ab1,'request\x20sent');_0x4bad39(_0x1ec80c[_0x6168('0x29')][_0x6168('0x28')]);}})[_0x6168('0x2a')](function(_0x60c869){logger[_0x6168('0x26')](_0x6168('0x23'),_0xcc5ab1,_0x60c869);_0x1a49bc(_0x60c869);});});}function respondWithStatusCode(_0x4185f1,_0x35ec3d){_0x35ec3d=_0x35ec3d||0xcc;return function(_0x248092){if(_0x248092){return _0x4185f1[_0x6168('0x2b')](_0x35ec3d);}return _0x4185f1[_0x6168('0x2c')](_0x35ec3d)['end']();};}function respondWithResult(_0x1504bf,_0x13bb19){_0x13bb19=_0x13bb19||0xc8;return function(_0xc78903){if(_0xc78903){return _0x1504bf['status'](_0x13bb19)[_0x6168('0x2d')](_0xc78903);}};}function respondWithFilteredResult(_0x280ae0,_0x4c598f){return function(_0x216592){if(_0x216592){var _0x4fea63=typeof _0x4c598f[_0x6168('0x2e')]===_0x6168('0x2f')&&typeof _0x4c598f['limit']===_0x6168('0x2f');var _0x283742=_0x216592[_0x6168('0x30')];var _0x390810=_0x4fea63?0x0:_0x4c598f[_0x6168('0x2e')];var _0x38b4bd=_0x4fea63?_0x216592[_0x6168('0x30')]:_0x4c598f[_0x6168('0x2e')]+_0x4c598f['limit'];var _0x1a267d;if(_0x38b4bd>=_0x283742){_0x38b4bd=_0x283742;_0x1a267d=0xc8;}else{_0x1a267d=0xce;}_0x280ae0[_0x6168('0x2c')](_0x1a267d);return _0x280ae0[_0x6168('0x31')](_0x6168('0x32'),_0x390810+'-'+_0x38b4bd+'/'+_0x283742)[_0x6168('0x2d')](_0x216592);}return null;};}function patchUpdates(_0xe7c783){return function(_0x2c0e63){try{jsonpatch[_0x6168('0x33')](_0x2c0e63,_0xe7c783,!![]);}catch(_0x1fc658){return BPromise[_0x6168('0x34')](_0x1fc658);}return _0x2c0e63[_0x6168('0x35')]();};}function saveUpdates(_0x355d14,_0x45c3d5){return function(_0x379afe){if(_0x379afe){return _0x379afe[_0x6168('0x36')](_0x355d14)[_0x6168('0x21')](function(_0x1ec3f0){return _0x1ec3f0;});}return null;};}function removeEntity(_0xf2c350,_0x178520){return function(_0x5779fa){if(_0x5779fa){return _0x5779fa[_0x6168('0x37')]()[_0x6168('0x21')](function(){_0xf2c350[_0x6168('0x2c')](0xcc)[_0x6168('0x38')]();});}};}function handleEntityNotFound(_0x54761b,_0x330673){return function(_0x5cae49){if(!_0x5cae49){_0x54761b[_0x6168('0x2b')](0x194);}return _0x5cae49;};}function handleError(_0x3a123d,_0x766c81){_0x766c81=_0x766c81||0x1f4;return function(_0x24d524){logger[_0x6168('0x26')](_0x24d524[_0x6168('0x39')]);if(_0x24d524['name']){delete _0x24d524[_0x6168('0x3a')];}_0x3a123d['status'](_0x766c81)[_0x6168('0x3b')](_0x24d524);};}exports[_0x6168('0x3c')]=function(_0x4cbe4d,_0x415ff5){var _0x37edf5={},_0x22bca4={},_0x25cc61={'count':0x0,'rows':[]};var _0x511ed6=_[_0x6168('0x3d')](db['OpenchannelMessage'][_0x6168('0x3e')],function(_0x2f9712){return{'name':_0x2f9712['fieldName'],'type':_0x2f9712[_0x6168('0x3f')][_0x6168('0x40')]};});_0x22bca4[_0x6168('0x41')]=_['map'](_0x511ed6,_0x6168('0x3a'));_0x22bca4[_0x6168('0x42')]=_[_0x6168('0x43')](_0x4cbe4d[_0x6168('0x42')]);_0x22bca4[_0x6168('0x44')]=_[_0x6168('0x45')](_0x22bca4[_0x6168('0x41')],_0x22bca4[_0x6168('0x42')]);_0x37edf5[_0x6168('0x46')]=_[_0x6168('0x45')](_0x22bca4[_0x6168('0x41')],qs['fields'](_0x4cbe4d['query'][_0x6168('0x47')]));_0x37edf5[_0x6168('0x46')]=_0x37edf5['attributes'][_0x6168('0x48')]?_0x37edf5[_0x6168('0x46')]:_0x22bca4[_0x6168('0x41')];if(!_0x4cbe4d[_0x6168('0x42')][_0x6168('0x49')](_0x6168('0x4a'))){_0x37edf5[_0x6168('0x4b')]=qs[_0x6168('0x4b')](_0x4cbe4d[_0x6168('0x42')][_0x6168('0x4b')]);_0x37edf5['offset']=qs[_0x6168('0x2e')](_0x4cbe4d['query'][_0x6168('0x2e')]);}_0x37edf5[_0x6168('0x4c')]=qs['sort'](_0x4cbe4d[_0x6168('0x42')][_0x6168('0x4d')]);_0x37edf5['where']=qs[_0x6168('0x44')](_[_0x6168('0x4e')](_0x4cbe4d[_0x6168('0x42')],_0x22bca4['filters']),_0x511ed6);if(_0x4cbe4d[_0x6168('0x42')][_0x6168('0x4f')]){_0x37edf5[_0x6168('0x50')]=_[_0x6168('0x51')](_0x37edf5[_0x6168('0x50')],{'$or':_[_0x6168('0x3d')](_0x511ed6,function(_0x227de3){if(_0x227de3[_0x6168('0x3f')]!==_0x6168('0x52')){var _0x215b46={};_0x215b46[_0x227de3[_0x6168('0x3a')]]={'$like':'%'+_0x4cbe4d[_0x6168('0x42')][_0x6168('0x4f')]+'%'};return _0x215b46;}})});}_0x37edf5=_[_0x6168('0x51')]({},_0x37edf5,_0x4cbe4d['options']);var _0x4fa649={'where':_0x37edf5[_0x6168('0x50')]};return db[_0x6168('0x53')][_0x6168('0x30')](_0x4fa649)[_0x6168('0x21')](function(_0x2c7ef4){_0x25cc61[_0x6168('0x30')]=_0x2c7ef4;if(_0x4cbe4d['query'][_0x6168('0x54')]){_0x37edf5[_0x6168('0x55')]=[{'all':!![]}];}return db[_0x6168('0x53')][_0x6168('0x56')](_0x37edf5);})[_0x6168('0x21')](function(_0x3f3982){_0x25cc61[_0x6168('0x57')]=_0x3f3982;return _0x25cc61;})[_0x6168('0x21')](respondWithFilteredResult(_0x415ff5,_0x37edf5))['catch'](handleError(_0x415ff5,null));};exports[_0x6168('0x58')]=function(_0x1f67e2,_0x4a7eac){var _0x3e0d8e={'raw':!![],'where':{'id':_0x1f67e2[_0x6168('0x59')]['id']}},_0x552f78={};_0x552f78[_0x6168('0x41')]=_['keys'](db[_0x6168('0x53')][_0x6168('0x3e')]);_0x552f78['query']=_['keys'](_0x1f67e2[_0x6168('0x42')]);_0x552f78[_0x6168('0x44')]=_[_0x6168('0x45')](_0x552f78[_0x6168('0x41')],_0x552f78[_0x6168('0x42')]);_0x3e0d8e[_0x6168('0x46')]=_['intersection'](_0x552f78[_0x6168('0x41')],qs[_0x6168('0x47')](_0x1f67e2[_0x6168('0x42')][_0x6168('0x47')]));_0x3e0d8e[_0x6168('0x46')]=_0x3e0d8e[_0x6168('0x46')]['length']?_0x3e0d8e[_0x6168('0x46')]:_0x552f78['model'];if(_0x1f67e2['query'][_0x6168('0x54')]){_0x3e0d8e[_0x6168('0x55')]=[{'all':!![]}];}_0x3e0d8e=_[_0x6168('0x51')]({},_0x3e0d8e,_0x1f67e2[_0x6168('0x5a')]);return db[_0x6168('0x53')][_0x6168('0x5b')](_0x3e0d8e)[_0x6168('0x21')](handleEntityNotFound(_0x4a7eac,null))['then'](respondWithResult(_0x4a7eac,null))[_0x6168('0x2a')](handleError(_0x4a7eac,null));};exports[_0x6168('0x5c')]=function(_0x3fc8f7,_0x5b1aa6){return db[_0x6168('0x53')][_0x6168('0x5c')](_0x3fc8f7[_0x6168('0x5d')],{})[_0x6168('0x21')](respondWithResult(_0x5b1aa6,0xc9))[_0x6168('0x2a')](handleError(_0x5b1aa6,null));};exports[_0x6168('0x36')]=function(_0x158817,_0x4d7621){if(_0x158817['body']['id']){delete _0x158817['body']['id'];}return db[_0x6168('0x53')][_0x6168('0x5b')]({'where':{'id':_0x158817[_0x6168('0x59')]['id']}})[_0x6168('0x21')](handleEntityNotFound(_0x4d7621,null))[_0x6168('0x21')](saveUpdates(_0x158817[_0x6168('0x5d')],null))['then'](respondWithResult(_0x4d7621,null))[_0x6168('0x2a')](handleError(_0x4d7621,null));};exports[_0x6168('0x37')]=function(_0x31a7b7,_0x407947){return db[_0x6168('0x53')][_0x6168('0x5b')]({'where':{'id':_0x31a7b7[_0x6168('0x59')]['id']}})[_0x6168('0x21')](handleEntityNotFound(_0x407947,null))[_0x6168('0x21')](removeEntity(_0x407947,null))[_0x6168('0x2a')](handleError(_0x407947,null));};exports[_0x6168('0x5e')]=function(_0x553167,_0x342574){return db[_0x6168('0x53')]['describe']()[_0x6168('0x21')](respondWithResult(_0x342574,null))[_0x6168('0x2a')](handleError(_0x342574,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x6168('0x5f')]=function(_0x544a64,_0x5c1d7a,_0x4ff61a){var _0x1c84eb={'agent':{},'channel':_0x6168('0x60')};if(_0x544a64['body']['id']){delete _0x544a64[_0x6168('0x5d')]['id'];}_0x544a64['body'][_0x6168('0x61')]=!![];_0x544a64[_0x6168('0x5d')][_0x6168('0x62')]=moment()[_0x6168('0x63')](_0x6168('0x64'));_0x544a64['body'][_0x6168('0x65')]=_0x544a64['body'][_0x6168('0x65')]||_0x544a64[_0x6168('0x66')]['id'];_0x1c84eb[_0x6168('0x67')]['id']=_0x544a64[_0x6168('0x5d')][_0x6168('0x65')];return db[_0x6168('0x53')]['find']({'where':{'id':_0x544a64[_0x6168('0x59')]['id'],'UserId':null}})[_0x6168('0x21')](handleEntityNotFound(_0x5c1d7a,null))[_0x6168('0x21')](saveUpdates(_0x544a64[_0x6168('0x5d')],null))[_0x6168('0x21')](function(_0x12663d){if(_0x12663d){_0x1c84eb[_0x6168('0x28')]=_0x12663d[_0x6168('0x68')]({'plain':!![]});return db[_0x6168('0x69')]['find']({'where':{'id':_0x12663d[_0x6168('0x6a')]}});}return null;})[_0x6168('0x21')](handleEntityNotFound(_0x5c1d7a,null))[_0x6168('0x21')](function(_0x5259a9){if(_0x5259a9){return _0x5259a9[_0x6168('0x36')]({'UserId':_0x544a64['body'][_0x6168('0x65')],'read1stAt':_[_0x6168('0x6b')](_0x5259a9[_0x6168('0x6c')])?moment()[_0x6168('0x63')](_0x6168('0x64')):undefined});}return null;})[_0x6168('0x21')](function(_0x2fc7fe){if(_0x2fc7fe){_0x1c84eb['interaction']=_0x2fc7fe[_0x6168('0x68')]({'plain':!![]});interaction_log[_0x6168('0x22')](_0x6168('0x6d'),_0x544a64[_0x6168('0x66')]['id'],_0x544a64[_0x6168('0x66')][_0x6168('0x3a')],_0x544a64[_0x6168('0x66')][_0x6168('0x6e')],_0x1c84eb[_0x6168('0x6f')]['id'],_0x544a64[_0x6168('0x5d')]?JSON['stringify'](_0x544a64[_0x6168('0x5d')]):_0x6168('0x70'));return respondWithRpcPromise(_0x6168('0x71'),_0x6168('0x72'),_0x1c84eb);}return null;})[_0x6168('0x21')](function(_0x1e9f75){var _0x40e9ae='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e9f75[_0x6168('0x28')]['ContactId'];return db[_0x6168('0x73')][_0x6168('0x42')](_0x40e9ae,{'type':db[_0x6168('0x74')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6168('0x21')](function(_0x8e7097){return _0x8e7097;});})[_0x6168('0x21')](function(_0x23fbb){if(_0x23fbb){_0x1c84eb[_0x6168('0x28')]['contact']=_0x23fbb[0x0];if(!_0x544a64[_0x6168('0x5d')][_0x6168('0x65')])return;return db[_0x6168('0x75')][_0x6168('0x5b')]({'where':{'id':_0x544a64[_0x6168('0x5d')][_0x6168('0x65')],'role':'agent'},'attributes':['id',_0x6168('0x3a'),'fullname',_0x6168('0x76'),_0x6168('0x77')],'raw':!![]});}return null;})[_0x6168('0x21')](function(_0x143d5a){if(!_0x143d5a)return null;_0x1c84eb[_0x6168('0x28')][_0x6168('0x67')]=_0x143d5a;return _0x1c84eb;})[_0x6168('0x21')](function(_0x2724e6){if(_0x2724e6){if(_0x544a64[_0x6168('0x5d')][_0x6168('0x78')]){_0x1c84eb['message'][_0x6168('0x79')]=util['format'](_0x6168('0x7a'),_0x544a64[_0x6168('0x66')][_0x6168('0x3a')]);_0x1c84eb[_0x6168('0x28')][_0x6168('0x7b')]=_0x1c84eb[_0x6168('0x7b')];_0x1c84eb[_0x6168('0x28')][_0x6168('0x7c')]=_0x1c84eb[_0x6168('0x7b')];_0x1c84eb[_0x6168('0x28')][_0x6168('0x7d')]='accept';return respondWithRpcPromise(_0x6168('0x7e'),_0x6168('0x7e'),{'event':_0x6168('0x7f'),'message':_0x1c84eb['message']},client9002)[_0x6168('0x21')](function(){return _0x1c84eb;});}return _0x1c84eb;}return null;})[_0x6168('0x21')](respondWithResult(_0x5c1d7a,null))[_0x6168('0x2a')](handleError(_0x5c1d7a,null));};var interaction_log=require(_0x6168('0x15'))('openchannel-interactions');exports['reject']=function(_0x4826e7,_0x435ac6,_0x5be115){var _0x9387c={'agent':{},'channel':_0x6168('0x60')};if(_0x4826e7[_0x6168('0x5d')]['id']){delete _0x4826e7['body']['id'];}_0x4826e7[_0x6168('0x5d')][_0x6168('0x65')]=_0x4826e7['body'][_0x6168('0x65')]||_0x4826e7[_0x6168('0x66')]['id'];_0x9387c['agent']['id']=_0x4826e7[_0x6168('0x5d')][_0x6168('0x65')];return db[_0x6168('0x53')][_0x6168('0x5b')]({'where':{'id':_0x4826e7[_0x6168('0x59')]['id'],'UserId':null}})[_0x6168('0x21')](handleEntityNotFound(_0x435ac6,null))['then'](function(_0x3d14e8){if(_0x3d14e8){_0x9387c[_0x6168('0x28')]=_0x3d14e8[_0x6168('0x68')]({'plain':!![]});return db[_0x6168('0x69')][_0x6168('0x5b')]({'where':{'id':_0x3d14e8['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x435ac6,null))[_0x6168('0x21')](function(_0x2aa682){if(_0x2aa682){_0x9387c[_0x6168('0x6f')]=_0x2aa682[_0x6168('0x68')]({'plain':!![]});interaction_log['info'](_0x6168('0x80'),_0x4826e7[_0x6168('0x66')]['id'],_0x4826e7['user'][_0x6168('0x3a')],_0x4826e7['user']['role'],_0x9387c[_0x6168('0x6f')]['id'],_0x4826e7[_0x6168('0x5d')]?JSON[_0x6168('0x25')](_0x4826e7[_0x6168('0x5d')]):_0x6168('0x70'));return respondWithRpcPromise(_0x6168('0x81'),'rejectMessage',_0x9387c);}return null;})['then'](function(_0x1b801d){var _0x58d6d1=_0x6168('0x82')+_0x1b801d[_0x6168('0x28')]['ContactId'];return db[_0x6168('0x73')][_0x6168('0x42')](_0x58d6d1,{'type':db[_0x6168('0x74')][_0x6168('0x83')][_0x6168('0x84')],'raw':!![]})['then'](function(_0x1af90c){return _0x1af90c;});})['then'](function(_0x5f3ff7){if(_0x5f3ff7){_0x9387c['message'][_0x6168('0x85')]=_0x5f3ff7[0x0];if(!_0x4826e7[_0x6168('0x5d')]['UserId'])return;return db[_0x6168('0x75')][_0x6168('0x5b')]({'where':{'id':_0x4826e7['body']['UserId'],'role':_0x6168('0x67')},'attributes':['id',_0x6168('0x3a'),_0x6168('0x86'),_0x6168('0x76'),'internal'],'raw':!![]});}return null;})[_0x6168('0x21')](function(_0x575311){if(!_0x575311)return null;_0x9387c[_0x6168('0x28')][_0x6168('0x67')]=_0x575311;return _0x9387c;})[_0x6168('0x21')](function(_0x112f6a){if(_0x112f6a){_0x112f6a[_0x6168('0x28')][_0x6168('0x79')]=util[_0x6168('0x63')]('SIP/%s',_0x4826e7[_0x6168('0x66')][_0x6168('0x3a')]);_0x112f6a[_0x6168('0x28')]['channel']=_0x9387c[_0x6168('0x7b')];_0x112f6a['message'][_0x6168('0x7c')]=_0x9387c[_0x6168('0x7b')];_0x112f6a[_0x6168('0x28')][_0x6168('0x7d')]=_0x6168('0x34');respondWithRpcPromise(_0x6168('0x7e'),_0x6168('0x7e'),{'event':_0x6168('0x87'),'message':_0x112f6a[_0x6168('0x28')]},client9002);return _0x9387c;}return null;})[_0x6168('0x21')](respondWithResult(_0x435ac6,null))[_0x6168('0x2a')](handleError(_0x435ac6,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fefc7f2..6f74989 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 _0xcd4a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage'];(function(_0x5c59e9,_0x253541){var _0x56b0b3=function(_0xeb6ad2){while(--_0xeb6ad2){_0x5c59e9['push'](_0x5c59e9['shift']());}};_0x56b0b3(++_0x253541);}(_0xcd4a,0x165));var _0xacd4=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0xcd4a[_0x4d7a70];return _0x3aafbb;};'use strict';var EventEmitter=require(_0xacd4('0x0'));var OpenchannelMessage=require(_0xacd4('0x1'))['db'][_0xacd4('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xacd4('0x3')](0x0);var events={'afterCreate':_0xacd4('0x4'),'afterUpdate':_0xacd4('0x5'),'afterDestroy':_0xacd4('0x6')};function emitEvent(_0x11041c){return function(_0x448030,_0x218866,_0x3fafac){OpenchannelMessageEvents[_0xacd4('0x7')](_0x11041c+':'+_0x448030['id'],_0x448030);OpenchannelMessageEvents['emit'](_0x11041c,_0x448030);_0x3fafac(null);};}for(var e in events){if(events[_0xacd4('0x8')](e)){var event=events[e];OpenchannelMessage[_0xacd4('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x94c5=['events','../../mysqldb','OpenchannelMessage','emit','hasOwnProperty','hook','exports'];(function(_0x5c377c,_0x1a807c){var _0x13ba3f=function(_0x210061){while(--_0x210061){_0x5c377c['push'](_0x5c377c['shift']());}};_0x13ba3f(++_0x1a807c);}(_0x94c5,0x7e));var _0x594c=function(_0x2c83c5,_0x140bbc){_0x2c83c5=_0x2c83c5-0x0;var _0x2ab4b4=_0x94c5[_0x2c83c5];return _0x2ab4b4;};'use strict';var EventEmitter=require(_0x594c('0x0'));var OpenchannelMessage=require(_0x594c('0x1'))['db'][_0x594c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a5e60){return function(_0x2fe6e1,_0x4fca12,_0x1d4794){OpenchannelMessageEvents[_0x594c('0x3')](_0x5a5e60+':'+_0x2fe6e1['id'],_0x2fe6e1);OpenchannelMessageEvents[_0x594c('0x3')](_0x5a5e60,_0x2fe6e1);_0x1d4794(null);};}for(var e in events){if(events[_0x594c('0x4')](e)){var event=events[e];OpenchannelMessage[_0x594c('0x5')](e,emitEvent(event));}}module[_0x594c('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index d7c4533..90e7fa2 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 _0x6a5d=['./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','update','createdAt','catch','error','secret','describe','then','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','replyUri','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39129e,_0x1c80ea){var _0x559b4f=function(_0x4d4733){while(--_0x4d4733){_0x39129e['push'](_0x39129e['shift']());}};_0x559b4f(++_0x1c80ea);}(_0x6a5d,0x1e3));var _0xd6a5=function(_0x42ded6,_0x4ae70f){_0x42ded6=_0x42ded6-0x0;var _0x239075=_0x6a5d[_0x42ded6];return _0x239075;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6a5('0x0'))(_0xd6a5('0x1'));var moment=require('moment');var BPromise=require(_0xd6a5('0x2'));var rp=require(_0xd6a5('0x3'));var fs=require('fs');var path=require(_0xd6a5('0x4'));var rimraf=require(_0xd6a5('0x5'));var config=require(_0xd6a5('0x6'));var attributes=require(_0xd6a5('0x7'));module[_0xd6a5('0x8')]=function(_0x49dfdb,_0x1e175f){return _0x49dfdb['define'](_0xd6a5('0x9'),attributes,{'tableName':_0xd6a5('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd6a5('0xb')],'type':_0xd6a5('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a144a,_0x5afe5f,_0x9a2dd8){var _0x14634a=_0x49dfdb['models'];var _0x23efb5=_0x5a144a[_0xd6a5('0xd')]({'plain':!![]});if(_0x23efb5[_0xd6a5('0xe')][_0xd6a5('0xf')]()==='in'||_0x23efb5[_0xd6a5('0xe')]['toLowerCase']()===_0xd6a5('0x10')&&!_0x23efb5['secret']&&!_[_0xd6a5('0x11')](_0x23efb5[_0xd6a5('0x12')])){_0x14634a[_0xd6a5('0x13')][_0xd6a5('0x14')]({'where':{'id':_0x23efb5['OpenchannelInteractionId']}})['then'](function(_0x3bf34e){if(_0x3bf34e){_0x3bf34e[_0xd6a5('0x15')]({'lastMsgAt':_0x23efb5[_0xd6a5('0x16')],'lastMsgDirection':_0x23efb5[_0xd6a5('0xe')][_0xd6a5('0xf')]()});}})[_0xd6a5('0x17')](function(_0x2f4bf7){console[_0xd6a5('0x18')](_0x2f4bf7);});}if(_0x23efb5[_0xd6a5('0xe')]===_0xd6a5('0x10')&&!_0x23efb5[_0xd6a5('0x19')]){var _0x54ceb2;_0x14634a['CmContact'][_0xd6a5('0x1a')]()[_0xd6a5('0x1b')](function(_0x261ad2){return _0x14634a[_0xd6a5('0x1c')]['find']({'where':{'id':_0x23efb5[_0xd6a5('0x1d')]},'include':[{'model':_0x14634a[_0xd6a5('0x13')],'as':_0xd6a5('0x1e'),'where':{'id':_0x23efb5[_0xd6a5('0x1f')]},'limit':0x1,'include':[{'model':_0x14634a['CmContact'],'as':_0xd6a5('0x20'),'attributes':_['keys'](_0x261ad2)}]}]});})[_0xd6a5('0x1b')](function(_0x1ddf67){_0x54ceb2=_0x1ddf67[_0xd6a5('0xd')]({'plain':!![]});if(_0x54ceb2&&_0x54ceb2['replyUri']){logger['info'](_0xd6a5('0x21'),_0xd6a5('0x22'),util[_0xd6a5('0x23')](_0xd6a5('0x24'),_0x23efb5['id'],_0x54ceb2['replyUri']));if(_0x54ceb2[_0xd6a5('0x1e')]&&_0x54ceb2[_0xd6a5('0x1e')][_0xd6a5('0x25')]){_0x23efb5[_0xd6a5('0x26')]=_['omit'](_0x54ceb2[_0xd6a5('0x1e')][0x0],_0xd6a5('0x20'));_0x23efb5[_0xd6a5('0x20')]=_0x54ceb2[_0xd6a5('0x1e')][0x0]['Contact'];}var _0x5afe5f={'method':_0xd6a5('0x27'),'uri':encodeURI(_0x54ceb2['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5afe5f['method']){case _0xd6a5('0x28'):_0x5afe5f['qs']=_0x23efb5;break;case'POST':_0x5afe5f[_0xd6a5('0xb')]=_0x23efb5;break;}return rp(_0x5afe5f)[_0xd6a5('0x1b')](function(_0x1e12a3){logger[_0xd6a5('0x29')](_0xd6a5('0x21'),'afterCreate',util[_0xd6a5('0x23')](_0xd6a5('0x2a'),_0x23efb5['id'],_0x54ceb2[_0xd6a5('0x2b')]));if(_0x1e12a3[_0xd6a5('0xb')]['threadId']&&_0x1e12a3['body'][_0xd6a5('0x2c')]!=_0x23efb5[_0xd6a5('0x26')][_0xd6a5('0x2c')]){return _0x14634a[_0xd6a5('0x13')]['update']({'threadId':_0x1e12a3['body'][_0xd6a5('0x2c')]},{'where':{'id':_0x23efb5[_0xd6a5('0x26')]['id']}});}else{return;}})[_0xd6a5('0x1b')](function(){return _0x5a144a['update']({'read':!![]});})['catch'](function(_0x524383){logger['error'](_0xd6a5('0x21'),'afterCreate',util[_0xd6a5('0x2d')](_0x524383,{'showHidden':![],'depth':null}));_0x9a2dd8();});}else{_0x9a2dd8();}})[_0xd6a5('0x2e')](function(){_0x9a2dd8();});}else{_0x9a2dd8();}}},'charset':_0xd6a5('0x2f'),'collate':_0xd6a5('0x30')});}; \ No newline at end of file +var _0x3b51=['method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','createdAt','error','out','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','OpenchannelInteractionId','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','replyUri','length','POST'];(function(_0x22b865,_0x3a239d){var _0x5619d6=function(_0xea8efd){while(--_0xea8efd){_0x22b865['push'](_0x22b865['shift']());}};_0x5619d6(++_0x3a239d);}(_0x3b51,0x1df));var _0x13b5=function(_0x3240ad,_0x1ffaba){_0x3240ad=_0x3240ad-0x0;var _0x477ca1=_0x3b51[_0x3240ad];return _0x477ca1;};'use strict';var _=require(_0x13b5('0x0'));var util=require(_0x13b5('0x1'));var logger=require(_0x13b5('0x2'))(_0x13b5('0x3'));var moment=require('moment');var BPromise=require(_0x13b5('0x4'));var rp=require(_0x13b5('0x5'));var fs=require('fs');var path=require(_0x13b5('0x6'));var rimraf=require(_0x13b5('0x7'));var config=require(_0x13b5('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x13b5('0x9')]=function(_0x487fd6,_0x3821d6){return _0x487fd6[_0x13b5('0xa')](_0x13b5('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x13b5('0xc'),'fields':[_0x13b5('0xd')],'type':_0x13b5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b4fd8,_0x35acad,_0x8184a4){var _0x11c326=_0x487fd6['models'];var _0x5625cd=_0x4b4fd8[_0x13b5('0xf')]({'plain':!![]});if(_0x5625cd[_0x13b5('0x10')][_0x13b5('0x11')]()==='in'||_0x5625cd[_0x13b5('0x10')][_0x13b5('0x11')]()==='out'&&!_0x5625cd[_0x13b5('0x12')]&&!_[_0x13b5('0x13')](_0x5625cd[_0x13b5('0x14')])){_0x11c326['OpenchannelInteraction'][_0x13b5('0x15')]({'where':{'id':_0x5625cd['OpenchannelInteractionId']}})[_0x13b5('0x16')](function(_0x30af84){if(_0x30af84){_0x30af84['update']({'lastMsgAt':_0x5625cd[_0x13b5('0x17')],'lastMsgDirection':_0x5625cd[_0x13b5('0x10')][_0x13b5('0x11')]()});}})['catch'](function(_0x3b24f1){console[_0x13b5('0x18')](_0x3b24f1);});}if(_0x5625cd[_0x13b5('0x10')]===_0x13b5('0x19')&&!_0x5625cd[_0x13b5('0x12')]){var _0xfef47a;_0x11c326[_0x13b5('0x1a')][_0x13b5('0x1b')]()[_0x13b5('0x16')](function(_0x5809dc){return _0x11c326[_0x13b5('0x1c')]['find']({'where':{'id':_0x5625cd[_0x13b5('0x1d')]},'include':[{'model':_0x11c326[_0x13b5('0x1e')],'as':_0x13b5('0x1f'),'where':{'id':_0x5625cd[_0x13b5('0x20')]},'limit':0x1,'include':[{'model':_0x11c326[_0x13b5('0x1a')],'as':_0x13b5('0x21'),'attributes':_['keys'](_0x5809dc)}]}]});})['then'](function(_0x57aa0b){_0xfef47a=_0x57aa0b[_0x13b5('0xf')]({'plain':!![]});if(_0xfef47a&&_0xfef47a['replyUri']){logger[_0x13b5('0x22')](_0x13b5('0x23'),_0x13b5('0x24'),util[_0x13b5('0x25')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5625cd['id'],_0xfef47a[_0x13b5('0x26')]));if(_0xfef47a[_0x13b5('0x1f')]&&_0xfef47a['Interactions'][_0x13b5('0x27')]){_0x5625cd['Interaction']=_['omit'](_0xfef47a[_0x13b5('0x1f')][0x0],_0x13b5('0x21'));_0x5625cd[_0x13b5('0x21')]=_0xfef47a['Interactions'][0x0][_0x13b5('0x21')];}var _0x35acad={'method':_0x13b5('0x28'),'uri':encodeURI(_0xfef47a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x35acad[_0x13b5('0x29')]){case _0x13b5('0x2a'):_0x35acad['qs']=_0x5625cd;break;case _0x13b5('0x28'):_0x35acad[_0x13b5('0xd')]=_0x5625cd;break;}return rp(_0x35acad)[_0x13b5('0x16')](function(_0x4e2493){logger['info'](_0x13b5('0x23'),_0x13b5('0x24'),util['format'](_0x13b5('0x2b'),_0x5625cd['id'],_0xfef47a[_0x13b5('0x26')]));if(_0x4e2493[_0x13b5('0xd')][_0x13b5('0x2c')]&&_0x4e2493[_0x13b5('0xd')]['threadId']!=_0x5625cd[_0x13b5('0x2d')][_0x13b5('0x2c')]){return _0x11c326['OpenchannelInteraction'][_0x13b5('0x2e')]({'threadId':_0x4e2493[_0x13b5('0xd')]['threadId']},{'where':{'id':_0x5625cd[_0x13b5('0x2d')]['id']}});}else{return;}})[_0x13b5('0x16')](function(){return _0x4b4fd8[_0x13b5('0x2e')]({'read':!![]});})[_0x13b5('0x2f')](function(_0x528139){logger[_0x13b5('0x18')](_0x13b5('0x23'),_0x13b5('0x24'),util[_0x13b5('0x30')](_0x528139,{'showHidden':![],'depth':null}));_0x8184a4();});}else{_0x8184a4();}})[_0x13b5('0x31')](function(){_0x8184a4();});}else{_0x8184a4();}}},'charset':_0x13b5('0x32'),'collate':_0x13b5('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a9a7001..52e529f 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x378b52,_0x73d0cc){var _0x43478d=function(_0x2cb321){while(--_0x2cb321){_0x378b52['push'](_0x378b52['shift']());}};_0x43478d(++_0x73d0cc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x228c60,_0x42da14){var _0x3d44b0=function(_0x5542b){while(--_0x5542b){_0x228c60['push'](_0x228c60['shift']());}};_0x3d44b0(++_0x42da14);}(_0xadb5,0xad));var _0x5adb=function(_0x830ea5,_0x6c396e){_0x830ea5=_0x830ea5-0x0;var _0xd3a3c0=_0xadb5[_0x830ea5];return _0xd3a3c0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c48dabc..b8a1e9f 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 _0x280b=['update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x280b,0xce));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var OpenchannelMessageEvents=require(_0xb280('0x0'));var events=[_0xb280('0x1'),'remove',_0xb280('0x2')];function createListener(_0x3c4f59,_0x444d16){return function(_0x3a59e1){_0x444d16[_0xb280('0x3')](_0x3c4f59,_0x3a59e1);};}function removeListener(_0x69abb,_0x2fa322){return function(){OpenchannelMessageEvents[_0xb280('0x4')](_0x69abb,_0x2fa322);};}exports[_0xb280('0x5')]=function(_0x5d1991){for(var _0x4d1b2e=0x0,_0x43e0ee=events[_0xb280('0x6')];_0x4d1b2e<_0x43e0ee;_0x4d1b2e++){var _0x5c98b9=events[_0x4d1b2e];var _0x12433f=createListener(_0xb280('0x7')+_0x5c98b9,_0x5d1991);OpenchannelMessageEvents['on'](_0x5c98b9,_0x12433f);}}; \ No newline at end of file +var _0x44c5=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5a780a,_0x4d6e9f){var _0x364a8c=function(_0x567717){while(--_0x567717){_0x5a780a['push'](_0x5a780a['shift']());}};_0x364a8c(++_0x4d6e9f);}(_0x44c5,0x76));var _0x544c=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x44c5[_0x383356];return _0x32ee5a;};'use strict';var OpenchannelMessageEvents=require(_0x544c('0x0'));var events=[_0x544c('0x1'),_0x544c('0x2'),_0x544c('0x3')];function createListener(_0x544714,_0x1c1ae3){return function(_0x4709ca){_0x1c1ae3[_0x544c('0x4')](_0x544714,_0x4709ca);};}function removeListener(_0x2aacb3,_0x18703a){return function(){OpenchannelMessageEvents[_0x544c('0x5')](_0x2aacb3,_0x18703a);};}exports[_0x544c('0x6')]=function(_0xcfd37a){for(var _0x45d35f=0x0,_0x1dfaea=events[_0x544c('0x7')];_0x45d35f<_0x1dfaea;_0x45d35f++){var _0x3cc3d5=events[_0x45d35f];var _0xceea0a=createListener(_0x544c('0x8')+_0x3cc3d5,_0xcfd37a);OpenchannelMessageEvents['on'](_0x3cc3d5,_0xceea0a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index d2ae3ce..cdf2f4c 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 _0xb381=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','destroy','delete','removeTeams','exports','multer','path','connect-timeout','express','Router'];(function(_0x56aaa9,_0x4d3b7f){var _0x3ff89f=function(_0x2ca85e){while(--_0x2ca85e){_0x56aaa9['push'](_0x56aaa9['shift']());}};_0x3ff89f(++_0x4d3b7f);}(_0xb381,0x82));var _0x1b38=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xb381[_0x4017b0];return _0x5ed4f7;};'use strict';var multer=require(_0x1b38('0x0'));var util=require('util');var path=require(_0x1b38('0x1'));var timeout=require(_0x1b38('0x2'));var express=require(_0x1b38('0x3'));var router=express[_0x1b38('0x4')]();var fs_extra=require(_0x1b38('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1b38('0x6'));var config=require(_0x1b38('0x7'));var controller=require('./openchannelQueue.controller');router[_0x1b38('0x8')]('/',auth[_0x1b38('0x9')](),controller[_0x1b38('0xa')]);router['get']('/describe',auth[_0x1b38('0x9')](),controller[_0x1b38('0xb')]);router[_0x1b38('0x8')](_0x1b38('0xc'),auth['isAuthenticated'](),controller[_0x1b38('0xd')]);router[_0x1b38('0x8')]('/:id/members',auth[_0x1b38('0x9')](),controller[_0x1b38('0xe')]);router[_0x1b38('0x8')]('/:id/teams',auth[_0x1b38('0x9')](),controller[_0x1b38('0xf')]);router[_0x1b38('0x8')](_0x1b38('0x10'),auth['isAuthenticated'](),controller[_0x1b38('0x11')]);router[_0x1b38('0x12')]('/',auth[_0x1b38('0x9')](),controller[_0x1b38('0x13')]);router[_0x1b38('0x12')](_0x1b38('0x14'),auth[_0x1b38('0x9')](),controller[_0x1b38('0x15')]);router[_0x1b38('0x12')](_0x1b38('0x10'),auth[_0x1b38('0x9')](),controller[_0x1b38('0x16')]);router['put']('/:id',auth[_0x1b38('0x9')](),controller['update']);router['delete'](_0x1b38('0xc'),auth['isAuthenticated'](),controller[_0x1b38('0x17')]);router[_0x1b38('0x18')](_0x1b38('0x14'),auth[_0x1b38('0x9')](),controller[_0x1b38('0x19')]);router[_0x1b38('0x18')](_0x1b38('0x10'),auth[_0x1b38('0x9')](),controller['removeAgents']);module[_0x1b38('0x1a')]=router; \ No newline at end of file +var _0x8c6b=['removeAgents','multer','path','connect-timeout','../../config/environment','get','/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','/:id','update','delete','destroy','removeTeams'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0x8c6b,0x11f));var _0xb8c6=function(_0xa75595,_0x343c7a){_0xa75595=_0xa75595-0x0;var _0xc8d622=_0x8c6b[_0xa75595];return _0xc8d622;};'use strict';var multer=require(_0xb8c6('0x0'));var util=require('util');var path=require(_0xb8c6('0x1'));var timeout=require(_0xb8c6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb8c6('0x3'));var controller=require('./openchannelQueue.controller');router[_0xb8c6('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb8c6('0x4')](_0xb8c6('0x5'),auth[_0xb8c6('0x6')](),controller['describe']);router[_0xb8c6('0x4')]('/:id',auth[_0xb8c6('0x6')](),controller[_0xb8c6('0x7')]);router[_0xb8c6('0x4')](_0xb8c6('0x8'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0x9')]);router['get'](_0xb8c6('0xa'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0xb')]);router['get'](_0xb8c6('0xc'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0xd')]);router['post']('/',auth[_0xb8c6('0x6')](),controller['create']);router[_0xb8c6('0xe')](_0xb8c6('0xa'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0xf')]);router[_0xb8c6('0xe')]('/:id/users',auth[_0xb8c6('0x6')](),controller['addAgents']);router['put'](_0xb8c6('0x10'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0x11')]);router[_0xb8c6('0x12')](_0xb8c6('0x10'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0x13')]);router[_0xb8c6('0x12')](_0xb8c6('0xa'),auth['isAuthenticated'](),controller[_0xb8c6('0x14')]);router[_0xb8c6('0x12')](_0xb8c6('0xc'),auth[_0xb8c6('0x6')](),controller[_0xb8c6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 3f682a6..afb7998 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 _0x7178=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x28713c,_0x1a3059){var _0x138077=function(_0x49f45c){while(--_0x49f45c){_0x28713c['push'](_0x28713c['shift']());}};_0x138077(++_0x1a3059);}(_0x7178,0x89));var _0x8717=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7178[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8717('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8717('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8717('0x2')](_0x8717('0x3'),_0x8717('0x4'),_0x8717('0x5'))}}; \ No newline at end of file +var _0x809f=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x809f,0x197));var _0xf809=function(_0xec5fe7,_0x172973){_0xec5fe7=_0xec5fe7-0x0;var _0x3cd1a9=_0x809f[_0xec5fe7];return _0x3cd1a9;};'use strict';var Sequelize=require(_0xf809('0x0'));module[_0xf809('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf809('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf809('0x3')]},'timeout':{'type':Sequelize[_0xf809('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf809('0x5'),_0xf809('0x6'),_0xf809('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6fa5b0c..b2c5515 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 _0x367c=['order','sort','pick','User','UserId','updatedAt','createdAt','format','%s/%s','openchannelPause','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','findOrCreate','forEach','userOpenchannelQueue:save','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','options','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','length'];(function(_0xf89ad3,_0x4a4a05){var _0x324449=function(_0xe7bab5){while(--_0xe7bab5){_0xf89ad3['push'](_0xf89ad3['shift']());}};_0x324449(++_0x4a4a05);}(_0x367c,0x1c6));var _0xc367=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x367c[_0x39d544];return _0x5a5ff2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc367('0x0'));var jsonpatch=require(_0xc367('0x1'));var rp=require(_0xc367('0x2'));var moment=require(_0xc367('0x3'));var BPromise=require(_0xc367('0x4'));var Mustache=require(_0xc367('0x5'));var util=require(_0xc367('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc367('0x7'));var ejs=require(_0xc367('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc367('0x9'));var squel=require(_0xc367('0xa'));var crypto=require(_0xc367('0xb'));var jsforce=require(_0xc367('0xc'));var deskjs=require(_0xc367('0xd'));var toCsv=require(_0xc367('0x7'));var querystring=require(_0xc367('0xe'));var Papa=require(_0xc367('0xf'));var Redis=require('ioredis');var authService=require(_0xc367('0x10'));var qs=require(_0xc367('0x11'));var as=require(_0xc367('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc367('0x13'))(_0xc367('0x14'));var utils=require(_0xc367('0x15'));var config=require(_0xc367('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc367('0x17')],{'host':_0xc367('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc367('0x19'))[_0xc367('0x1a')](socket);function respondWithStatusCode(_0x4d03f2,_0x21e677){_0x21e677=_0x21e677||0xcc;return function(_0x51b9cf){if(_0x51b9cf){return _0x4d03f2[_0xc367('0x1b')](_0x21e677);}return _0x4d03f2[_0xc367('0x1c')](_0x21e677)[_0xc367('0x1d')]();};}function respondWithResult(_0x8fb4d3,_0x3eb32e){_0x3eb32e=_0x3eb32e||0xc8;return function(_0x4f97f9){if(_0x4f97f9){return _0x8fb4d3[_0xc367('0x1c')](_0x3eb32e)[_0xc367('0x1e')](_0x4f97f9);}};}function respondWithFilteredResult(_0x9f73b2,_0x464ea2){return function(_0x77d17b){if(_0x77d17b){var _0x1d9fc0=typeof _0x464ea2[_0xc367('0x1f')]==='undefined'&&typeof _0x464ea2['limit']==='undefined';var _0x4bd40a=_0x77d17b[_0xc367('0x20')];var _0x14c3f4=_0x1d9fc0?0x0:_0x464ea2[_0xc367('0x1f')];var _0x47d150=_0x1d9fc0?_0x77d17b[_0xc367('0x20')]:_0x464ea2[_0xc367('0x1f')]+_0x464ea2[_0xc367('0x21')];var _0x15cf93;if(_0x47d150>=_0x4bd40a){_0x47d150=_0x4bd40a;_0x15cf93=0xc8;}else{_0x15cf93=0xce;}_0x9f73b2[_0xc367('0x1c')](_0x15cf93);return _0x9f73b2['set'](_0xc367('0x22'),_0x14c3f4+'-'+_0x47d150+'/'+_0x4bd40a)[_0xc367('0x1e')](_0x77d17b);}return null;};}function patchUpdates(_0x182b28){return function(_0x4f98ae){try{jsonpatch[_0xc367('0x23')](_0x4f98ae,_0x182b28,!![]);}catch(_0x2d00db){return BPromise['reject'](_0x2d00db);}return _0x4f98ae[_0xc367('0x24')]();};}function saveUpdates(_0x2d79c3,_0xea97ba){return function(_0xaea0ea){if(_0xaea0ea){return _0xaea0ea[_0xc367('0x25')](_0x2d79c3)[_0xc367('0x26')](function(_0xcea4af){return _0xcea4af;});}return null;};}function removeEntity(_0x29e552,_0x4ac45c){return function(_0x59f327){if(_0x59f327){return _0x59f327[_0xc367('0x27')]()[_0xc367('0x26')](function(){var _0x6e2d4a=_0x59f327[_0xc367('0x28')]({'plain':!![]});var _0x24dace=_0xc367('0x29');return db[_0xc367('0x2a')]['destroy']({'where':{'type':_0x24dace,'resourceId':_0x6e2d4a['id']}})[_0xc367('0x26')](function(){return _0x59f327;});})['then'](function(){_0x29e552[_0xc367('0x1c')](0xcc)[_0xc367('0x1d')]();});}};}function handleEntityNotFound(_0x2dd5f3,_0x949a6d){return function(_0x2db6e6){if(!_0x2db6e6){_0x2dd5f3['sendStatus'](0x194);}return _0x2db6e6;};}function handleError(_0x11487c,_0x2a08d0){_0x2a08d0=_0x2a08d0||0x1f4;return function(_0x3eaa8f){logger[_0xc367('0x2b')](_0x3eaa8f['stack']);if(_0x3eaa8f[_0xc367('0x2c')]){delete _0x3eaa8f['name'];}_0x11487c[_0xc367('0x1c')](_0x2a08d0)[_0xc367('0x2d')](_0x3eaa8f);};}exports[_0xc367('0x2e')]=function(_0x422fef,_0x1949be){var _0x3aff83={},_0x3e33e7={},_0x1ce7d2={'count':0x0,'rows':[]};var _0x44e167=_[_0xc367('0x2f')](db[_0xc367('0x30')][_0xc367('0x31')],function(_0x589bb8){return{'name':_0x589bb8[_0xc367('0x32')],'type':_0x589bb8['type'][_0xc367('0x33')]};});_0x3e33e7['model']=_[_0xc367('0x2f')](_0x44e167,'name');_0x3e33e7[_0xc367('0x34')]=_[_0xc367('0x35')](_0x422fef['query']);_0x3e33e7[_0xc367('0x36')]=_[_0xc367('0x37')](_0x3e33e7[_0xc367('0x38')],_0x3e33e7['query']);_0x3aff83['attributes']=_[_0xc367('0x37')](_0x3e33e7['model'],qs['fields'](_0x422fef['query'][_0xc367('0x39')]));_0x3aff83[_0xc367('0x3a')]=_0x3aff83[_0xc367('0x3a')]['length']?_0x3aff83[_0xc367('0x3a')]:_0x3e33e7[_0xc367('0x38')];if(!_0x422fef[_0xc367('0x34')][_0xc367('0x3b')](_0xc367('0x3c'))){_0x3aff83['limit']=qs[_0xc367('0x21')](_0x422fef[_0xc367('0x34')]['limit']);_0x3aff83[_0xc367('0x1f')]=qs['offset'](_0x422fef[_0xc367('0x34')][_0xc367('0x1f')]);}_0x3aff83['order']=qs['sort'](_0x422fef[_0xc367('0x34')]['sort']);_0x3aff83[_0xc367('0x3d')]=qs[_0xc367('0x36')](_['pick'](_0x422fef[_0xc367('0x34')],_0x3e33e7['filters']),_0x44e167);if(_0x422fef[_0xc367('0x34')][_0xc367('0x3e')]){_0x3aff83[_0xc367('0x3d')]=_['merge'](_0x3aff83[_0xc367('0x3d')],{'$or':_[_0xc367('0x2f')](_0x44e167,function(_0x19255d){if(_0x19255d[_0xc367('0x3f')]!==_0xc367('0x40')){var _0x2cb87e={};_0x2cb87e[_0x19255d[_0xc367('0x2c')]]={'$like':'%'+_0x422fef[_0xc367('0x34')]['filter']+'%'};return _0x2cb87e;}})});}_0x3aff83=_[_0xc367('0x41')]({},_0x3aff83,_0x422fef['options']);var _0x3b4f3e={'where':_0x3aff83[_0xc367('0x3d')]};return db[_0xc367('0x30')][_0xc367('0x20')](_0x3b4f3e)[_0xc367('0x26')](function(_0x24afa5){_0x1ce7d2['count']=_0x24afa5;if(_0x422fef['query'][_0xc367('0x42')]){_0x3aff83[_0xc367('0x43')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xc367('0x44')](_0x3aff83);})['then'](function(_0x423539){_0x1ce7d2[_0xc367('0x45')]=_0x423539;return _0x1ce7d2;})[_0xc367('0x26')](respondWithFilteredResult(_0x1949be,_0x3aff83))[_0xc367('0x46')](handleError(_0x1949be,null));};exports['show']=function(_0x4e261c,_0xea63c3){var _0x507cbc={'raw':!![],'where':{'id':_0x4e261c['params']['id']}},_0x54095e={};_0x54095e[_0xc367('0x38')]=_[_0xc367('0x35')](db[_0xc367('0x30')][_0xc367('0x31')]);_0x54095e[_0xc367('0x34')]=_[_0xc367('0x35')](_0x4e261c[_0xc367('0x34')]);_0x54095e['filters']=_[_0xc367('0x37')](_0x54095e[_0xc367('0x38')],_0x54095e[_0xc367('0x34')]);_0x507cbc[_0xc367('0x3a')]=_[_0xc367('0x37')](_0x54095e[_0xc367('0x38')],qs['fields'](_0x4e261c[_0xc367('0x34')][_0xc367('0x39')]));_0x507cbc['attributes']=_0x507cbc['attributes']['length']?_0x507cbc[_0xc367('0x3a')]:_0x54095e['model'];if(_0x4e261c[_0xc367('0x34')][_0xc367('0x42')]){_0x507cbc[_0xc367('0x43')]=[{'all':!![]}];}_0x507cbc=_[_0xc367('0x41')]({},_0x507cbc,_0x4e261c['options']);return db[_0xc367('0x30')][_0xc367('0x47')](_0x507cbc)['then'](handleEntityNotFound(_0xea63c3,null))[_0xc367('0x26')](respondWithResult(_0xea63c3,null))[_0xc367('0x46')](handleError(_0xea63c3,null));};exports[_0xc367('0x48')]=function(_0x20a27c,_0x1153fd){return db[_0xc367('0x30')][_0xc367('0x48')](_0x20a27c[_0xc367('0x49')],{})[_0xc367('0x26')](function(_0x16870b){var _0x71475b=_0x20a27c[_0xc367('0x4a')]['get']({'plain':!![]});if(!_0x71475b)throw new Error(_0xc367('0x4b'));if(_0x71475b['role']===_0xc367('0x4a')){var _0x5855cf=_0x16870b[_0xc367('0x28')]({'plain':!![]});var _0x29cdf9=_0xc367('0x29');return db[_0xc367('0x4c')][_0xc367('0x47')]({'where':{'name':_0x29cdf9,'userProfileId':_0x71475b[_0xc367('0x4d')]},'raw':!![]})[_0xc367('0x26')](function(_0x1d8e7c){if(_0x1d8e7c&&_0x1d8e7c[_0xc367('0x4e')]===0x0){return db[_0xc367('0x2a')][_0xc367('0x48')]({'name':_0x5855cf[_0xc367('0x2c')],'resourceId':_0x5855cf['id'],'type':_0x1d8e7c[_0xc367('0x2c')],'sectionId':_0x1d8e7c['id']},{})[_0xc367('0x26')](function(){return _0x16870b;});}else{return _0x16870b;}})[_0xc367('0x46')](function(_0x4a1cf7){logger[_0xc367('0x2b')](_0xc367('0x4f'),_0x4a1cf7);throw _0x4a1cf7;});}return _0x16870b;})[_0xc367('0x26')](respondWithResult(_0x1153fd,0xc9))[_0xc367('0x46')](handleError(_0x1153fd,null));};exports[_0xc367('0x25')]=function(_0x2a40ae,_0x2dca64){if(_0x2a40ae[_0xc367('0x49')]['id']){delete _0x2a40ae[_0xc367('0x49')]['id'];}return db['OpenchannelQueue'][_0xc367('0x47')]({'where':{'id':_0x2a40ae[_0xc367('0x50')]['id']}})[_0xc367('0x26')](handleEntityNotFound(_0x2dca64,null))['then'](saveUpdates(_0x2a40ae[_0xc367('0x49')],null))[_0xc367('0x26')](respondWithResult(_0x2dca64,null))['catch'](handleError(_0x2dca64,null));};exports['destroy']=function(_0x3192cb,_0x535a79){return db[_0xc367('0x30')][_0xc367('0x47')]({'where':{'id':_0x3192cb[_0xc367('0x50')]['id']}})[_0xc367('0x26')](handleEntityNotFound(_0x535a79,null))[_0xc367('0x26')](removeEntity(_0x535a79,null))['catch'](handleError(_0x535a79,null));};exports[_0xc367('0x51')]=function(_0x16a92b,_0x174dec){return db[_0xc367('0x30')]['describe']()[_0xc367('0x26')](respondWithResult(_0x174dec,null))[_0xc367('0x46')](handleError(_0x174dec,null));};exports[_0xc367('0x52')]=function(_0x57f680,_0x4c7e4f,_0x171e62){var _0x14a35a={'raw':!![],'where':{}},_0xdd5e5={},_0x54c717;return db[_0xc367('0x30')][_0xc367('0x53')]({'where':{'id':_0x57f680[_0xc367('0x50')]['id']}})['then'](handleEntityNotFound(_0x4c7e4f,null))[_0xc367('0x26')](function(_0x4a6261){if(_0x4a6261){_0x54c717=_0x4a6261[_0xc367('0x28')]({'plain':!![]});_0xdd5e5[_0xc367('0x38')]=_[_0xc367('0x35')](db[_0xc367('0x54')][_0xc367('0x31')]);_0xdd5e5['query']=_[_0xc367('0x35')](_0x57f680['query']);_0xdd5e5['filters']=_['intersection'](_0xdd5e5[_0xc367('0x38')],_0xdd5e5[_0xc367('0x34')]);_0x14a35a['attributes']=_[_0xc367('0x37')](_0xdd5e5[_0xc367('0x38')],qs[_0xc367('0x39')](_0x57f680[_0xc367('0x34')][_0xc367('0x39')]));_0x14a35a[_0xc367('0x3a')]=_0x14a35a['attributes'][_0xc367('0x55')]?_0x14a35a['attributes']:_0xdd5e5[_0xc367('0x38')];if(!_0x57f680[_0xc367('0x34')][_0xc367('0x3b')]('nolimit')){_0x14a35a[_0xc367('0x21')]=qs[_0xc367('0x21')](_0x57f680[_0xc367('0x34')][_0xc367('0x21')]);_0x14a35a[_0xc367('0x1f')]=qs[_0xc367('0x1f')](_0x57f680[_0xc367('0x34')]['offset']);}_0x14a35a[_0xc367('0x56')]=qs['sort'](_0x57f680['query'][_0xc367('0x57')]);_0x14a35a['where']=qs[_0xc367('0x36')](_[_0xc367('0x58')](_0x57f680[_0xc367('0x34')],_0xdd5e5['filters']));_0x14a35a[_0xc367('0x3d')]['OpenchannelQueueId']=_0x4a6261['id'];if(_0x57f680[_0xc367('0x34')][_0xc367('0x3e')]){_0x14a35a[_0xc367('0x3d')]=_[_0xc367('0x41')](_0x14a35a[_0xc367('0x3d')],{'$or':_[_0xc367('0x2f')](_0x14a35a[_0xc367('0x3a')],function(_0x50a55b){var _0x408b44={};_0x408b44[_0x50a55b]={'$like':'%'+_0x57f680[_0xc367('0x34')]['filter']+'%'};return _0x408b44;})});}_0x14a35a=_[_0xc367('0x41')]({},_0x14a35a,_0x57f680['options']);return db[_0xc367('0x54')]['findAll'](_0x14a35a);}})[_0xc367('0x26')](function(_0x438831){if(_0x438831){return db[_0xc367('0x59')]['findAndCountAll']({'where':{'id':_[_0xc367('0x2f')](_0x438831,_0xc367('0x5a')),'role':'agent'},'attributes':['id','name','openchannelPause',_0xc367('0x5b'),_0xc367('0x5c')]});}})[_0xc367('0x26')](function(_0x46b6e1){if(_0x46b6e1){return{'count':_0x46b6e1['count'],'rows':_[_0xc367('0x2f')](_0x46b6e1[_0xc367('0x45')],function(_0x30fa76){return{'membername':_0x30fa76[_0xc367('0x2c')],'UserId':_0x30fa76['id'],'queue_name':_0x54c717[_0xc367('0x2c')],'OpenchannelQueueId':_0x54c717['id'],'interface':util[_0xc367('0x5d')](_0xc367('0x5e'),'SIP',_0x30fa76[_0xc367('0x2c')]),'penalty':0x0,'paused':_0x30fa76[_0xc367('0x5f')],'createdAt':_0x30fa76[_0xc367('0x5c')],'updatedAt':_0x30fa76[_0xc367('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc367('0x26')](respondWithFilteredResult(_0x4c7e4f,_0x14a35a))[_0xc367('0x46')](handleError(_0x4c7e4f,null));};exports['getTeams']=function(_0x54154e,_0x4eec83,_0x397fe5){var _0xecf812={};var _0x530aa5={};var _0x150aa6;var _0x30aaf2;return db[_0xc367('0x30')][_0xc367('0x53')]({'where':{'id':_0x54154e[_0xc367('0x50')]['id']}})[_0xc367('0x26')](handleEntityNotFound(_0x4eec83,null))[_0xc367('0x26')](function(_0x3c0284){if(_0x3c0284){_0x150aa6=_0x3c0284;_0x530aa5[_0xc367('0x38')]=_[_0xc367('0x35')](db[_0xc367('0x60')]['rawAttributes']);_0x530aa5[_0xc367('0x34')]=_['keys'](_0x54154e[_0xc367('0x34')]);_0x530aa5['filters']=_[_0xc367('0x37')](_0x530aa5[_0xc367('0x38')],_0x530aa5[_0xc367('0x34')]);_0xecf812[_0xc367('0x3a')]=_['intersection'](_0x530aa5[_0xc367('0x38')],qs['fields'](_0x54154e[_0xc367('0x34')]['fields']));_0xecf812[_0xc367('0x3a')]=_0xecf812[_0xc367('0x3a')]['length']?_0xecf812[_0xc367('0x3a')]:_0x530aa5[_0xc367('0x38')];_0xecf812[_0xc367('0x56')]=qs[_0xc367('0x57')](_0x54154e[_0xc367('0x34')][_0xc367('0x57')]);_0xecf812[_0xc367('0x3d')]=qs['filters'](_[_0xc367('0x58')](_0x54154e[_0xc367('0x34')],_0x530aa5[_0xc367('0x36')]));if(_0x54154e[_0xc367('0x34')][_0xc367('0x3e')]){_0xecf812[_0xc367('0x3d')]=_[_0xc367('0x41')](_0xecf812['where'],{'$or':_['map'](_0xecf812[_0xc367('0x3a')],function(_0x55832e){var _0x1337f2={};_0x1337f2[_0x55832e]={'$like':'%'+_0x54154e[_0xc367('0x34')][_0xc367('0x3e')]+'%'};return _0x1337f2;})});}_0xecf812=_[_0xc367('0x41')]({},_0xecf812,_0x54154e['options']);return _0x150aa6[_0xc367('0x61')](_0xecf812);}})['then'](function(_0x11d08c){if(_0x11d08c){_0x30aaf2=_0x11d08c['length'];if(!_0x54154e[_0xc367('0x34')]['hasOwnProperty'](_0xc367('0x3c'))){_0xecf812[_0xc367('0x21')]=qs[_0xc367('0x21')](_0x54154e[_0xc367('0x34')]['limit']);_0xecf812['offset']=qs['offset'](_0x54154e[_0xc367('0x34')]['offset']);}return _0x150aa6['getTeams'](_0xecf812);}})[_0xc367('0x26')](function(_0x33e5c3){if(_0x33e5c3){return _0x33e5c3?{'count':_0x30aaf2,'rows':_0x33e5c3}:null;}})[_0xc367('0x26')](respondWithResult(_0x4eec83,null))['catch'](handleError(_0x4eec83,null));};exports[_0xc367('0x62')]=function(_0x18ba48,_0x189d41,_0x29664b){var _0x23c50f=_0x18ba48[_0xc367('0x49')][_0xc367('0x63')];return db[_0xc367('0x60')][_0xc367('0x44')]({'where':{'id':_0x23c50f},'attributes':['id'],'include':[{'model':db[_0xc367('0x59')],'as':'Agents','attributes':['id',_0xc367('0x2c'),_0xc367('0x64'),_0xc367('0x65'),_0xc367('0x66')],'raw':!![]}]})['then'](function(_0x14be7b){if(_0x14be7b){var _0x38a5e7=_[_0xc367('0x67')](_0x14be7b,function(_0x39246e){var _0x374594=_0x39246e[_0xc367('0x28')]({'plain':!![]});return _0x374594[_0xc367('0x68')];});return db[_0xc367('0x30')][_0xc367('0x47')]({'where':{'id':_0x18ba48[_0xc367('0x50')]['id']}})[_0xc367('0x26')](function(_0x393d41){return db['sequelize']['transaction'](function(_0x5dda4b){return _0x393d41[_0xc367('0x62')](_0x23c50f,{'transaction':_0x5dda4b})[_0xc367('0x26')](function(){return BPromise['each'](_0x38a5e7,function(_0xd3f832){return db[_0xc367('0x54')][_0xc367('0x69')]({'where':{'UserId':_0xd3f832['id'],'OpenchannelQueueId':_0x18ba48[_0xc367('0x50')]['id']},'transaction':_0x5dda4b});});})[_0xc367('0x26')](function(){_0x38a5e7[_0xc367('0x6a')](function(_0xa01212){socket['emit'](_0xc367('0x6b'),{'UserId':_0xa01212['id'],'OpenchannelQueueId':_0x393d41['id']});});});});});}})[_0xc367('0x26')](respondWithStatusCode(_0x189d41,null))[_0xc367('0x46')](handleError(_0x189d41,null));};exports['removeTeams']=function(_0xfc116,_0x272abb,_0x193e97){return db['Team'][_0xc367('0x44')]({'where':{'id':_0xfc116[_0xc367('0x34')][_0xc367('0x63')]},'attributes':['id'],'include':[{'model':db[_0xc367('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc367('0x26')](handleEntityNotFound(_0x272abb,null))[_0xc367('0x26')](function(_0x9d2cf4){var _0xeae6b8=_[_0xc367('0x2f')](_0x9d2cf4,'id');var _0x3a0414=[];var _0xcb4db0=[];var _0x584e72=squel['select']();_0x584e72['field'](_0xc367('0x6c'))[_0xc367('0x6d')](_0xc367('0x6e'),'tq')['join'](_0xc367('0x6f'),'ut',_0xc367('0x70'))['where']('OpenchannelQueueId\x20=\x20?',_0xfc116['params']['id']);for(var _0x1c77d0=0x0;_0x1c77d0<_0x9d2cf4[_0xc367('0x55')];_0x1c77d0+=0x1){let _0x68f753=_0x9d2cf4[_0x1c77d0];for(var _0x25dc34=0x0;_0x25dc34<_0x68f753[_0xc367('0x68')][_0xc367('0x55')];_0x25dc34+=0x1){let _0x4787b2=_0x68f753[_0xc367('0x68')][_0x25dc34];var _0x31ebbb=_0x584e72[_0xc367('0x71')]();_0x31ebbb[_0xc367('0x3d')](_0xc367('0x72'),_0x4787b2['id']);_0xcb4db0['push'](db[_0xc367('0x73')][_0xc367('0x34')](_0x31ebbb[_0xc367('0x74')](),{'type':db[_0xc367('0x73')][_0xc367('0x75')]['SELECT']})[_0xc367('0x26')](function(_0x107606){if(_0x107606[_0xc367('0x55')]===0x1){return _0x4787b2['id'];}else{var _0x3d8523=_[_0xc367('0x76')](_[_0xc367('0x2f')](_0x107606,_0xc367('0x77')),function(_0x1e84d8){return _[_0xc367('0x78')](_0xeae6b8,_0x1e84d8);});if(_0x3d8523){return _0x4787b2['id'];}}}));}}return BPromise[_0xc367('0x79')](_0xcb4db0)[_0xc367('0x26')](function(_0x127288){_0x3a0414=_(_0x3a0414)[_0xc367('0x7a')](_0x127288)[_0xc367('0x7b')]()[_0xc367('0x7c')]();return db[_0xc367('0x30')]['find']({'where':{'id':_0xfc116[_0xc367('0x50')]['id']}})[_0xc367('0x26')](function(_0x52c310){return db['sequelize'][_0xc367('0x7d')](function(_0x5c790e){return _0x52c310['removeTeams'](_0xfc116['query']['ids'],{'transaction':_0x5c790e})[_0xc367('0x26')](function(){if(!_[_0xc367('0x7e')](_0x3a0414)){return _0x52c310[_0xc367('0x7f')](_0x3a0414,{'transaction':_0x5c790e});}})[_0xc367('0x26')](function(){_0x3a0414['forEach'](function(_0x2d7bf1){socket[_0xc367('0x80')](_0xc367('0x81'),{'UserId':_0x2d7bf1,'OpenchannelQueueId':_0x52c310['id']});});});});});});})[_0xc367('0x26')](respondWithStatusCode(_0x272abb,null))[_0xc367('0x46')](handleError(_0x272abb,null));};exports[_0xc367('0x82')]=function(_0xbbeb1b,_0x4dfee5,_0x576f10){return db[_0xc367('0x30')]['find']({'where':{'id':_0xbbeb1b[_0xc367('0x50')]['id']}})['then'](handleEntityNotFound(_0x4dfee5,null))[_0xc367('0x26')](function(_0x18dc06){if(_0x18dc06){return _0x18dc06['addAgents'](_0xbbeb1b[_0xc367('0x49')][_0xc367('0x63')],_['omit'](_0xbbeb1b[_0xc367('0x49')],[_0xc367('0x63'),'id'])||{})[_0xc367('0x83')](function(_0xda9cdb){for(var _0x1674b4=0x0;_0x1674b4<_0xbbeb1b[_0xc367('0x49')]['ids'][_0xc367('0x55')];_0x1674b4+=0x1){socket[_0xc367('0x80')](_0xc367('0x6b'),{'UserId':Number(_0xbbeb1b[_0xc367('0x49')]['ids'][_0x1674b4]),'OpenchannelQueueId':Number(_0xbbeb1b[_0xc367('0x50')]['id'])});}return _0xda9cdb;});}})[_0xc367('0x26')](respondWithResult(_0x4dfee5,null))[_0xc367('0x46')](handleError(_0x4dfee5,null));};exports['removeAgents']=function(_0x49a72b,_0x36bf46,_0x3f2171){return db[_0xc367('0x30')][_0xc367('0x47')]({'where':{'id':_0x49a72b[_0xc367('0x50')]['id']}})['then'](handleEntityNotFound(_0x36bf46,null))['then'](function(_0x4d0b66){if(_0x4d0b66){return _0x4d0b66[_0xc367('0x7f')](_0x49a72b[_0xc367('0x34')][_0xc367('0x63')])[_0xc367('0x26')](function(){if(_[_0xc367('0x84')](_0x49a72b[_0xc367('0x34')][_0xc367('0x63')])){for(var _0x5e0cf8=0x0;_0x5e0cf8<_0x49a72b['query'][_0xc367('0x63')][_0xc367('0x55')];_0x5e0cf8+=0x1){socket['emit'](_0xc367('0x81'),{'UserId':Number(_0x49a72b[_0xc367('0x34')]['ids'][_0x5e0cf8]),'OpenchannelQueueId':Number(_0x49a72b['params']['id'])});}}else{socket[_0xc367('0x80')](_0xc367('0x81'),{'UserId':Number(_0x49a72b[_0xc367('0x34')]['ids']),'OpenchannelQueueId':Number(_0x49a72b[_0xc367('0x50')]['id'])});}});}})[_0xc367('0x26')](respondWithStatusCode(_0x36bf46,null))[_0xc367('0x46')](handleError(_0x36bf46,null));};exports[_0xc367('0x85')]=function(_0x3728e7,_0x17eb25,_0x279206){var _0x2a1907={};var _0x2c7e1c={};var _0x445644;var _0x25f350;return db[_0xc367('0x30')][_0xc367('0x53')]({'where':{'id':_0x3728e7['params']['id']}})['then'](handleEntityNotFound(_0x17eb25,null))[_0xc367('0x26')](function(_0x3d86c5){if(_0x3d86c5){_0x445644=_0x3d86c5;_0x2c7e1c[_0xc367('0x38')]=_['keys'](db['User'][_0xc367('0x31')]);_0x2c7e1c['query']=_[_0xc367('0x35')](_0x3728e7['query']);_0x2c7e1c[_0xc367('0x36')]=_['intersection'](_0x2c7e1c['model'],_0x2c7e1c[_0xc367('0x34')]);_0x2a1907[_0xc367('0x3a')]=_[_0xc367('0x37')](_0x2c7e1c[_0xc367('0x38')],qs[_0xc367('0x39')](_0x3728e7[_0xc367('0x34')][_0xc367('0x39')]));_0x2a1907['attributes']=_0x2a1907['attributes'][_0xc367('0x55')]?_0x2a1907[_0xc367('0x3a')]:_0x2c7e1c[_0xc367('0x38')];_0x2a1907[_0xc367('0x56')]=qs[_0xc367('0x57')](_0x3728e7[_0xc367('0x34')][_0xc367('0x57')]);_0x2a1907[_0xc367('0x3d')]=qs[_0xc367('0x36')](_[_0xc367('0x58')](_0x3728e7[_0xc367('0x34')],_0x2c7e1c[_0xc367('0x36')]));if(_0x3728e7[_0xc367('0x34')][_0xc367('0x3e')]){_0x2a1907[_0xc367('0x3d')]=_['merge'](_0x2a1907[_0xc367('0x3d')],{'$or':_[_0xc367('0x2f')](_0x2a1907[_0xc367('0x3a')],function(_0x4cb579){var _0x4c69f7={};_0x4c69f7[_0x4cb579]={'$like':'%'+_0x3728e7[_0xc367('0x34')][_0xc367('0x3e')]+'%'};return _0x4c69f7;})});}_0x2a1907=_['merge']({},_0x2a1907,_0x3728e7[_0xc367('0x86')]);return _0x445644[_0xc367('0x85')](_0x2a1907);}})['then'](function(_0x5c8079){if(_0x5c8079){_0x25f350=_0x5c8079[_0xc367('0x55')];if(!_0x3728e7[_0xc367('0x34')][_0xc367('0x3b')](_0xc367('0x3c'))){_0x2a1907[_0xc367('0x21')]=qs['limit'](_0x3728e7['query'][_0xc367('0x21')]);_0x2a1907['offset']=qs[_0xc367('0x1f')](_0x3728e7['query'][_0xc367('0x1f')]);}return _0x445644['getAgents'](_0x2a1907);}})[_0xc367('0x26')](function(_0x5eadad){if(_0x5eadad){return _0x5eadad?{'count':_0x25f350,'rows':_0x5eadad}:null;}})[_0xc367('0x26')](respondWithResult(_0x17eb25,null))['catch'](handleError(_0x17eb25,null));}; \ No newline at end of file +var _0xb220=['eml-format','rimraf','zip-dir','fast-json-patch','moment','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/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','limit','undefined','count','offset','set','apply','reject','save','update','destroy','then','get','OpenchannelQueues','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','filter','addTeams','ids','Team','findAll','Agents','online','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','every','TeamId','includes','all','union','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents'];(function(_0x3ceb6c,_0x554602){var _0x256814=function(_0x7800cf){while(--_0x7800cf){_0x3ceb6c['push'](_0x3ceb6c['shift']());}};_0x256814(++_0x554602);}(_0xb220,0x112));var _0x0b22=function(_0x544eab,_0x59033c){_0x544eab=_0x544eab-0x0;var _0x13cd73=_0xb220[_0x544eab];return _0x13cd73;};'use strict';var emlformat=require(_0x0b22('0x0'));var rimraf=require(_0x0b22('0x1'));var zipdir=require(_0x0b22('0x2'));var jsonpatch=require(_0x0b22('0x3'));var rp=require('request-promise');var moment=require(_0x0b22('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0b22('0x5'));var util=require(_0x0b22('0x6'));var path=require(_0x0b22('0x7'));var sox=require(_0x0b22('0x8'));var csv=require(_0x0b22('0x9'));var ejs=require(_0x0b22('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b22('0xb'));var squel=require(_0x0b22('0xc'));var crypto=require(_0x0b22('0xd'));var jsforce=require(_0x0b22('0xe'));var deskjs=require(_0x0b22('0xf'));var toCsv=require(_0x0b22('0x9'));var querystring=require(_0x0b22('0x10'));var Papa=require(_0x0b22('0x11'));var Redis=require(_0x0b22('0x12'));var authService=require(_0x0b22('0x13'));var qs=require(_0x0b22('0x14'));var as=require(_0x0b22('0x15'));var hardwareService=require(_0x0b22('0x16'));var logger=require(_0x0b22('0x17'))(_0x0b22('0x18'));var utils=require(_0x0b22('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0b22('0x1a'));var db=require(_0x0b22('0x1b'))['db'];config['redis']=_['defaults'](config[_0x0b22('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b22('0x1d'))(new Redis(config[_0x0b22('0x1c')]));require('./openchannelQueue.socket')[_0x0b22('0x1e')](socket);function respondWithStatusCode(_0x20c61c,_0x23e34b){_0x23e34b=_0x23e34b||0xcc;return function(_0x46516f){if(_0x46516f){return _0x20c61c[_0x0b22('0x1f')](_0x23e34b);}return _0x20c61c['status'](_0x23e34b)['end']();};}function respondWithResult(_0x24364f,_0x1960c6){_0x1960c6=_0x1960c6||0xc8;return function(_0x3a9f9a){if(_0x3a9f9a){return _0x24364f[_0x0b22('0x20')](_0x1960c6)['json'](_0x3a9f9a);}};}function respondWithFilteredResult(_0x2baa37,_0x134cd4){return function(_0x32d90a){if(_0x32d90a){var _0xb7f0d2=typeof _0x134cd4['offset']==='undefined'&&typeof _0x134cd4[_0x0b22('0x21')]===_0x0b22('0x22');var _0x2dd727=_0x32d90a[_0x0b22('0x23')];var _0x5e77bb=_0xb7f0d2?0x0:_0x134cd4['offset'];var _0x554c10=_0xb7f0d2?_0x32d90a[_0x0b22('0x23')]:_0x134cd4[_0x0b22('0x24')]+_0x134cd4[_0x0b22('0x21')];var _0x2f87f0;if(_0x554c10>=_0x2dd727){_0x554c10=_0x2dd727;_0x2f87f0=0xc8;}else{_0x2f87f0=0xce;}_0x2baa37['status'](_0x2f87f0);return _0x2baa37[_0x0b22('0x25')]('Content-Range',_0x5e77bb+'-'+_0x554c10+'/'+_0x2dd727)['json'](_0x32d90a);}return null;};}function patchUpdates(_0x51e6f5){return function(_0x46eea3){try{jsonpatch[_0x0b22('0x26')](_0x46eea3,_0x51e6f5,!![]);}catch(_0x4390e8){return BPromise[_0x0b22('0x27')](_0x4390e8);}return _0x46eea3[_0x0b22('0x28')]();};}function saveUpdates(_0x220aef,_0x60483f){return function(_0xd7d73f){if(_0xd7d73f){return _0xd7d73f[_0x0b22('0x29')](_0x220aef)['then'](function(_0x5d5ac4){return _0x5d5ac4;});}return null;};}function removeEntity(_0x472d87,_0x3504b7){return function(_0x348aec){if(_0x348aec){return _0x348aec[_0x0b22('0x2a')]()[_0x0b22('0x2b')](function(){var _0x24d09f=_0x348aec[_0x0b22('0x2c')]({'plain':!![]});var _0x1bc104=_0x0b22('0x2d');return db['UserProfileResource'][_0x0b22('0x2a')]({'where':{'type':_0x1bc104,'resourceId':_0x24d09f['id']}})['then'](function(){return _0x348aec;});})[_0x0b22('0x2b')](function(){_0x472d87[_0x0b22('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4581a2,_0x22cad3){return function(_0x46a4cb){if(!_0x46a4cb){_0x4581a2[_0x0b22('0x1f')](0x194);}return _0x46a4cb;};}function handleError(_0x2f0b8e,_0x228026){_0x228026=_0x228026||0x1f4;return function(_0xa06142){logger['error'](_0xa06142[_0x0b22('0x2e')]);if(_0xa06142[_0x0b22('0x2f')]){delete _0xa06142[_0x0b22('0x2f')];}_0x2f0b8e['status'](_0x228026)['send'](_0xa06142);};}exports[_0x0b22('0x30')]=function(_0x4cd9f8,_0x33cd0a){var _0x5b1bf7={},_0xa35d0a={},_0x1d1c76={'count':0x0,'rows':[]};var _0x11c6b6=_[_0x0b22('0x31')](db[_0x0b22('0x32')][_0x0b22('0x33')],function(_0x1f10b0){return{'name':_0x1f10b0[_0x0b22('0x34')],'type':_0x1f10b0[_0x0b22('0x35')][_0x0b22('0x36')]};});_0xa35d0a[_0x0b22('0x37')]=_['map'](_0x11c6b6,_0x0b22('0x2f'));_0xa35d0a[_0x0b22('0x38')]=_[_0x0b22('0x39')](_0x4cd9f8['query']);_0xa35d0a[_0x0b22('0x3a')]=_[_0x0b22('0x3b')](_0xa35d0a['model'],_0xa35d0a['query']);_0x5b1bf7[_0x0b22('0x3c')]=_['intersection'](_0xa35d0a[_0x0b22('0x37')],qs[_0x0b22('0x3d')](_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x3d')]));_0x5b1bf7[_0x0b22('0x3c')]=_0x5b1bf7['attributes'][_0x0b22('0x3e')]?_0x5b1bf7[_0x0b22('0x3c')]:_0xa35d0a[_0x0b22('0x37')];if(!_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x3f')]('nolimit')){_0x5b1bf7[_0x0b22('0x21')]=qs['limit'](_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x21')]);_0x5b1bf7[_0x0b22('0x24')]=qs[_0x0b22('0x24')](_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x24')]);}_0x5b1bf7[_0x0b22('0x40')]=qs[_0x0b22('0x41')](_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x41')]);_0x5b1bf7[_0x0b22('0x42')]=qs['filters'](_[_0x0b22('0x43')](_0x4cd9f8[_0x0b22('0x38')],_0xa35d0a[_0x0b22('0x3a')]),_0x11c6b6);if(_0x4cd9f8[_0x0b22('0x38')]['filter']){_0x5b1bf7[_0x0b22('0x42')]=_[_0x0b22('0x44')](_0x5b1bf7['where'],{'$or':_[_0x0b22('0x31')](_0x11c6b6,function(_0x575a1c){if(_0x575a1c[_0x0b22('0x35')]!==_0x0b22('0x45')){var _0x538961={};_0x538961[_0x575a1c[_0x0b22('0x2f')]]={'$like':'%'+_0x4cd9f8[_0x0b22('0x38')]['filter']+'%'};return _0x538961;}})});}_0x5b1bf7=_[_0x0b22('0x44')]({},_0x5b1bf7,_0x4cd9f8[_0x0b22('0x46')]);var _0x50db34={'where':_0x5b1bf7[_0x0b22('0x42')]};return db[_0x0b22('0x32')][_0x0b22('0x23')](_0x50db34)['then'](function(_0x640073){_0x1d1c76[_0x0b22('0x23')]=_0x640073;if(_0x4cd9f8[_0x0b22('0x38')][_0x0b22('0x47')]){_0x5b1bf7[_0x0b22('0x48')]=[{'all':!![]}];}return db[_0x0b22('0x32')]['findAll'](_0x5b1bf7);})[_0x0b22('0x2b')](function(_0x2e2f32){_0x1d1c76[_0x0b22('0x49')]=_0x2e2f32;return _0x1d1c76;})[_0x0b22('0x2b')](respondWithFilteredResult(_0x33cd0a,_0x5b1bf7))[_0x0b22('0x4a')](handleError(_0x33cd0a,null));};exports['show']=function(_0x12b3bd,_0x588359){var _0x41f42e={'raw':!![],'where':{'id':_0x12b3bd[_0x0b22('0x4b')]['id']}},_0x38e200={};_0x38e200[_0x0b22('0x37')]=_[_0x0b22('0x39')](db[_0x0b22('0x32')][_0x0b22('0x33')]);_0x38e200[_0x0b22('0x38')]=_['keys'](_0x12b3bd[_0x0b22('0x38')]);_0x38e200[_0x0b22('0x3a')]=_['intersection'](_0x38e200[_0x0b22('0x37')],_0x38e200[_0x0b22('0x38')]);_0x41f42e[_0x0b22('0x3c')]=_[_0x0b22('0x3b')](_0x38e200['model'],qs['fields'](_0x12b3bd[_0x0b22('0x38')][_0x0b22('0x3d')]));_0x41f42e[_0x0b22('0x3c')]=_0x41f42e['attributes'][_0x0b22('0x3e')]?_0x41f42e[_0x0b22('0x3c')]:_0x38e200[_0x0b22('0x37')];if(_0x12b3bd[_0x0b22('0x38')][_0x0b22('0x47')]){_0x41f42e[_0x0b22('0x48')]=[{'all':!![]}];}_0x41f42e=_[_0x0b22('0x44')]({},_0x41f42e,_0x12b3bd[_0x0b22('0x46')]);return db[_0x0b22('0x32')][_0x0b22('0x4c')](_0x41f42e)[_0x0b22('0x2b')](handleEntityNotFound(_0x588359,null))[_0x0b22('0x2b')](respondWithResult(_0x588359,null))[_0x0b22('0x4a')](handleError(_0x588359,null));};exports[_0x0b22('0x4d')]=function(_0x5cf159,_0x449a72){return db[_0x0b22('0x32')][_0x0b22('0x4d')](_0x5cf159[_0x0b22('0x4e')],{})['then'](function(_0x3d4ad){var _0x13f6fe=_0x5cf159[_0x0b22('0x4f')][_0x0b22('0x2c')]({'plain':!![]});if(!_0x13f6fe)throw new Error(_0x0b22('0x50'));if(_0x13f6fe[_0x0b22('0x51')]===_0x0b22('0x4f')){var _0x5eeba1=_0x3d4ad['get']({'plain':!![]});var _0x194485='OpenchannelQueues';return db[_0x0b22('0x52')]['find']({'where':{'name':_0x194485,'userProfileId':_0x13f6fe['userProfileId']},'raw':!![]})[_0x0b22('0x2b')](function(_0x4fafff){if(_0x4fafff&&_0x4fafff[_0x0b22('0x53')]===0x0){return db['UserProfileResource'][_0x0b22('0x4d')]({'name':_0x5eeba1[_0x0b22('0x2f')],'resourceId':_0x5eeba1['id'],'type':_0x4fafff[_0x0b22('0x2f')],'sectionId':_0x4fafff['id']},{})['then'](function(){return _0x3d4ad;});}else{return _0x3d4ad;}})[_0x0b22('0x4a')](function(_0x60720a){logger[_0x0b22('0x54')](_0x0b22('0x55'),_0x60720a);throw _0x60720a;});}return _0x3d4ad;})[_0x0b22('0x2b')](respondWithResult(_0x449a72,0xc9))[_0x0b22('0x4a')](handleError(_0x449a72,null));};exports[_0x0b22('0x29')]=function(_0x48542d,_0x171725){if(_0x48542d[_0x0b22('0x4e')]['id']){delete _0x48542d[_0x0b22('0x4e')]['id'];}return db[_0x0b22('0x32')]['find']({'where':{'id':_0x48542d[_0x0b22('0x4b')]['id']}})['then'](handleEntityNotFound(_0x171725,null))['then'](saveUpdates(_0x48542d[_0x0b22('0x4e')],null))[_0x0b22('0x2b')](respondWithResult(_0x171725,null))[_0x0b22('0x4a')](handleError(_0x171725,null));};exports['destroy']=function(_0xa86586,_0x3cd19e){return db[_0x0b22('0x32')][_0x0b22('0x4c')]({'where':{'id':_0xa86586[_0x0b22('0x4b')]['id']}})[_0x0b22('0x2b')](handleEntityNotFound(_0x3cd19e,null))[_0x0b22('0x2b')](removeEntity(_0x3cd19e,null))[_0x0b22('0x4a')](handleError(_0x3cd19e,null));};exports[_0x0b22('0x56')]=function(_0xb5eaf3,_0x7f12f9){return db[_0x0b22('0x32')][_0x0b22('0x56')]()[_0x0b22('0x2b')](respondWithResult(_0x7f12f9,null))['catch'](handleError(_0x7f12f9,null));};exports[_0x0b22('0x57')]=function(_0xec49dc,_0x25b806,_0x4de917){var _0x9e610={'raw':!![],'where':{}},_0x1fca91={},_0xc68d3e;return db['OpenchannelQueue'][_0x0b22('0x58')]({'where':{'id':_0xec49dc['params']['id']}})[_0x0b22('0x2b')](handleEntityNotFound(_0x25b806,null))[_0x0b22('0x2b')](function(_0xa968da){if(_0xa968da){_0xc68d3e=_0xa968da['get']({'plain':!![]});_0x1fca91['model']=_[_0x0b22('0x39')](db[_0x0b22('0x59')]['rawAttributes']);_0x1fca91[_0x0b22('0x38')]=_[_0x0b22('0x39')](_0xec49dc[_0x0b22('0x38')]);_0x1fca91[_0x0b22('0x3a')]=_[_0x0b22('0x3b')](_0x1fca91[_0x0b22('0x37')],_0x1fca91[_0x0b22('0x38')]);_0x9e610[_0x0b22('0x3c')]=_[_0x0b22('0x3b')](_0x1fca91[_0x0b22('0x37')],qs[_0x0b22('0x3d')](_0xec49dc[_0x0b22('0x38')][_0x0b22('0x3d')]));_0x9e610[_0x0b22('0x3c')]=_0x9e610[_0x0b22('0x3c')][_0x0b22('0x3e')]?_0x9e610[_0x0b22('0x3c')]:_0x1fca91[_0x0b22('0x37')];if(!_0xec49dc['query']['hasOwnProperty'](_0x0b22('0x5a'))){_0x9e610['limit']=qs[_0x0b22('0x21')](_0xec49dc[_0x0b22('0x38')][_0x0b22('0x21')]);_0x9e610[_0x0b22('0x24')]=qs[_0x0b22('0x24')](_0xec49dc['query'][_0x0b22('0x24')]);}_0x9e610[_0x0b22('0x40')]=qs['sort'](_0xec49dc[_0x0b22('0x38')][_0x0b22('0x41')]);_0x9e610[_0x0b22('0x42')]=qs[_0x0b22('0x3a')](_['pick'](_0xec49dc[_0x0b22('0x38')],_0x1fca91['filters']));_0x9e610[_0x0b22('0x42')][_0x0b22('0x5b')]=_0xa968da['id'];if(_0xec49dc[_0x0b22('0x38')]['filter']){_0x9e610[_0x0b22('0x42')]=_[_0x0b22('0x44')](_0x9e610[_0x0b22('0x42')],{'$or':_[_0x0b22('0x31')](_0x9e610[_0x0b22('0x3c')],function(_0x5852f2){var _0x27b501={};_0x27b501[_0x5852f2]={'$like':'%'+_0xec49dc['query']['filter']+'%'};return _0x27b501;})});}_0x9e610=_[_0x0b22('0x44')]({},_0x9e610,_0xec49dc[_0x0b22('0x46')]);return db['UserOpenchannelQueue']['findAll'](_0x9e610);}})['then'](function(_0x33604f){if(_0x33604f){return db[_0x0b22('0x5c')][_0x0b22('0x5d')]({'where':{'id':_[_0x0b22('0x31')](_0x33604f,_0x0b22('0x5e')),'role':'agent'},'attributes':['id',_0x0b22('0x2f'),'openchannelPause',_0x0b22('0x5f'),_0x0b22('0x60')]});}})[_0x0b22('0x2b')](function(_0x445410){if(_0x445410){return{'count':_0x445410[_0x0b22('0x23')],'rows':_[_0x0b22('0x31')](_0x445410[_0x0b22('0x49')],function(_0x370e94){return{'membername':_0x370e94[_0x0b22('0x2f')],'UserId':_0x370e94['id'],'queue_name':_0xc68d3e['name'],'OpenchannelQueueId':_0xc68d3e['id'],'interface':util[_0x0b22('0x61')](_0x0b22('0x62'),_0x0b22('0x63'),_0x370e94[_0x0b22('0x2f')]),'penalty':0x0,'paused':_0x370e94[_0x0b22('0x64')],'createdAt':_0x370e94[_0x0b22('0x60')],'updatedAt':_0x370e94['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b22('0x2b')](respondWithFilteredResult(_0x25b806,_0x9e610))[_0x0b22('0x4a')](handleError(_0x25b806,null));};exports[_0x0b22('0x65')]=function(_0x11078e,_0x5d61fa,_0x21d810){var _0x443b04={};var _0x142092={};var _0x440136;var _0x488b15;return db[_0x0b22('0x32')][_0x0b22('0x58')]({'where':{'id':_0x11078e[_0x0b22('0x4b')]['id']}})[_0x0b22('0x2b')](handleEntityNotFound(_0x5d61fa,null))[_0x0b22('0x2b')](function(_0x5955c2){if(_0x5955c2){_0x440136=_0x5955c2;_0x142092[_0x0b22('0x37')]=_[_0x0b22('0x39')](db['Team'][_0x0b22('0x33')]);_0x142092[_0x0b22('0x38')]=_[_0x0b22('0x39')](_0x11078e[_0x0b22('0x38')]);_0x142092['filters']=_[_0x0b22('0x3b')](_0x142092[_0x0b22('0x37')],_0x142092[_0x0b22('0x38')]);_0x443b04[_0x0b22('0x3c')]=_[_0x0b22('0x3b')](_0x142092[_0x0b22('0x37')],qs['fields'](_0x11078e[_0x0b22('0x38')][_0x0b22('0x3d')]));_0x443b04['attributes']=_0x443b04['attributes'][_0x0b22('0x3e')]?_0x443b04['attributes']:_0x142092[_0x0b22('0x37')];_0x443b04['order']=qs[_0x0b22('0x41')](_0x11078e['query']['sort']);_0x443b04[_0x0b22('0x42')]=qs[_0x0b22('0x3a')](_[_0x0b22('0x43')](_0x11078e['query'],_0x142092[_0x0b22('0x3a')]));if(_0x11078e['query'][_0x0b22('0x66')]){_0x443b04[_0x0b22('0x42')]=_['merge'](_0x443b04['where'],{'$or':_[_0x0b22('0x31')](_0x443b04[_0x0b22('0x3c')],function(_0x56d0c4){var _0x35004e={};_0x35004e[_0x56d0c4]={'$like':'%'+_0x11078e[_0x0b22('0x38')][_0x0b22('0x66')]+'%'};return _0x35004e;})});}_0x443b04=_[_0x0b22('0x44')]({},_0x443b04,_0x11078e[_0x0b22('0x46')]);return _0x440136[_0x0b22('0x65')](_0x443b04);}})[_0x0b22('0x2b')](function(_0x46d251){if(_0x46d251){_0x488b15=_0x46d251[_0x0b22('0x3e')];if(!_0x11078e[_0x0b22('0x38')][_0x0b22('0x3f')]('nolimit')){_0x443b04[_0x0b22('0x21')]=qs[_0x0b22('0x21')](_0x11078e['query'][_0x0b22('0x21')]);_0x443b04[_0x0b22('0x24')]=qs[_0x0b22('0x24')](_0x11078e[_0x0b22('0x38')][_0x0b22('0x24')]);}return _0x440136['getTeams'](_0x443b04);}})[_0x0b22('0x2b')](function(_0x2e439b){if(_0x2e439b){return _0x2e439b?{'count':_0x488b15,'rows':_0x2e439b}:null;}})[_0x0b22('0x2b')](respondWithResult(_0x5d61fa,null))['catch'](handleError(_0x5d61fa,null));};exports[_0x0b22('0x67')]=function(_0x49a580,_0xf40f46,_0x4f1b99){var _0x447e6d=_0x49a580[_0x0b22('0x4e')][_0x0b22('0x68')];return db[_0x0b22('0x69')][_0x0b22('0x6a')]({'where':{'id':_0x447e6d},'attributes':['id'],'include':[{'model':db[_0x0b22('0x5c')],'as':_0x0b22('0x6b'),'attributes':['id',_0x0b22('0x2f'),_0x0b22('0x6c'),'voicePause','interface'],'raw':!![]}]})[_0x0b22('0x2b')](function(_0x40b358){if(_0x40b358){var _0x4755a2=_['flatMap'](_0x40b358,function(_0x3621cd){var _0x490abd=_0x3621cd[_0x0b22('0x2c')]({'plain':!![]});return _0x490abd[_0x0b22('0x6b')];});return db[_0x0b22('0x32')][_0x0b22('0x4c')]({'where':{'id':_0x49a580[_0x0b22('0x4b')]['id']}})['then'](function(_0x29e5ec){return db['sequelize'][_0x0b22('0x6d')](function(_0x16d7aa){return _0x29e5ec[_0x0b22('0x67')](_0x447e6d,{'transaction':_0x16d7aa})[_0x0b22('0x2b')](function(){return BPromise['each'](_0x4755a2,function(_0x2855d6){return db['UserOpenchannelQueue'][_0x0b22('0x6e')]({'where':{'UserId':_0x2855d6['id'],'OpenchannelQueueId':_0x49a580[_0x0b22('0x4b')]['id']},'transaction':_0x16d7aa});});})[_0x0b22('0x2b')](function(){_0x4755a2[_0x0b22('0x6f')](function(_0x2af4c2){socket[_0x0b22('0x70')](_0x0b22('0x71'),{'UserId':_0x2af4c2['id'],'OpenchannelQueueId':_0x29e5ec['id']});});});});});}})[_0x0b22('0x2b')](respondWithStatusCode(_0xf40f46,null))[_0x0b22('0x4a')](handleError(_0xf40f46,null));};exports['removeTeams']=function(_0x5d2514,_0x1cd14d,_0x683cae){return db[_0x0b22('0x69')][_0x0b22('0x6a')]({'where':{'id':_0x5d2514[_0x0b22('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0b22('0x5c')],'as':_0x0b22('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x0b22('0x2b')](handleEntityNotFound(_0x1cd14d,null))['then'](function(_0x505492){var _0x2b0b1c=_['map'](_0x505492,'id');var _0x4d4d50=[];var _0x7889df=[];var _0x58ef44=squel[_0x0b22('0x72')]();_0x58ef44[_0x0b22('0x73')](_0x0b22('0x74'))[_0x0b22('0x75')](_0x0b22('0x76'),'tq')['join'](_0x0b22('0x77'),'ut',_0x0b22('0x78'))[_0x0b22('0x42')](_0x0b22('0x79'),_0x5d2514['params']['id']);for(var _0x4d9d6e=0x0;_0x4d9d6e<_0x505492[_0x0b22('0x3e')];_0x4d9d6e+=0x1){let _0x5a040e=_0x505492[_0x4d9d6e];for(var _0x129f3f=0x0;_0x129f3f<_0x5a040e[_0x0b22('0x6b')][_0x0b22('0x3e')];_0x129f3f+=0x1){let _0x2ab492=_0x5a040e['Agents'][_0x129f3f];var _0x2e79d5=_0x58ef44[_0x0b22('0x7a')]();_0x2e79d5[_0x0b22('0x42')]('ut.UserId\x20=\x20?',_0x2ab492['id']);_0x7889df[_0x0b22('0x7b')](db[_0x0b22('0x7c')][_0x0b22('0x38')](_0x2e79d5['toString'](),{'type':db[_0x0b22('0x7c')]['QueryTypes']['SELECT']})[_0x0b22('0x2b')](function(_0x3ac386){if(_0x3ac386['length']===0x1){return _0x2ab492['id'];}else{var _0x28db8e=_[_0x0b22('0x7d')](_[_0x0b22('0x31')](_0x3ac386,_0x0b22('0x7e')),function(_0x321c90){return _[_0x0b22('0x7f')](_0x2b0b1c,_0x321c90);});if(_0x28db8e){return _0x2ab492['id'];}}}));}}return BPromise[_0x0b22('0x80')](_0x7889df)['then'](function(_0x1068dd){_0x4d4d50=_(_0x4d4d50)[_0x0b22('0x81')](_0x1068dd)['compact']()[_0x0b22('0x82')]();return db[_0x0b22('0x32')][_0x0b22('0x4c')]({'where':{'id':_0x5d2514[_0x0b22('0x4b')]['id']}})[_0x0b22('0x2b')](function(_0x427ae0){return db[_0x0b22('0x7c')]['transaction'](function(_0x1785a1){return _0x427ae0['removeTeams'](_0x5d2514[_0x0b22('0x38')][_0x0b22('0x68')],{'transaction':_0x1785a1})[_0x0b22('0x2b')](function(){if(!_['isEmpty'](_0x4d4d50)){return _0x427ae0[_0x0b22('0x83')](_0x4d4d50,{'transaction':_0x1785a1});}})['then'](function(){_0x4d4d50[_0x0b22('0x6f')](function(_0x585f2d){socket[_0x0b22('0x70')](_0x0b22('0x84'),{'UserId':_0x585f2d,'OpenchannelQueueId':_0x427ae0['id']});});});});});});})[_0x0b22('0x2b')](respondWithStatusCode(_0x1cd14d,null))[_0x0b22('0x4a')](handleError(_0x1cd14d,null));};exports[_0x0b22('0x85')]=function(_0x43840a,_0xb07265,_0x1fb48a){return db[_0x0b22('0x32')][_0x0b22('0x4c')]({'where':{'id':_0x43840a['params']['id']}})[_0x0b22('0x2b')](handleEntityNotFound(_0xb07265,null))['then'](function(_0x1f4ad3){if(_0x1f4ad3){return _0x1f4ad3[_0x0b22('0x85')](_0x43840a[_0x0b22('0x4e')][_0x0b22('0x68')],_[_0x0b22('0x86')](_0x43840a['body'],[_0x0b22('0x68'),'id'])||{})['spread'](function(_0x342520){for(var _0x109e85=0x0;_0x109e85<_0x43840a[_0x0b22('0x4e')][_0x0b22('0x68')]['length'];_0x109e85+=0x1){socket[_0x0b22('0x70')](_0x0b22('0x71'),{'UserId':Number(_0x43840a[_0x0b22('0x4e')]['ids'][_0x109e85]),'OpenchannelQueueId':Number(_0x43840a[_0x0b22('0x4b')]['id'])});}return _0x342520;});}})[_0x0b22('0x2b')](respondWithResult(_0xb07265,null))[_0x0b22('0x4a')](handleError(_0xb07265,null));};exports['removeAgents']=function(_0x2a7a81,_0x1784b2,_0x1bfb97){return db[_0x0b22('0x32')][_0x0b22('0x4c')]({'where':{'id':_0x2a7a81[_0x0b22('0x4b')]['id']}})[_0x0b22('0x2b')](handleEntityNotFound(_0x1784b2,null))[_0x0b22('0x2b')](function(_0x4fb8c9){if(_0x4fb8c9){return _0x4fb8c9[_0x0b22('0x83')](_0x2a7a81['query']['ids'])['then'](function(){if(_[_0x0b22('0x87')](_0x2a7a81[_0x0b22('0x38')]['ids'])){for(var _0x34d2ac=0x0;_0x34d2ac<_0x2a7a81[_0x0b22('0x38')][_0x0b22('0x68')][_0x0b22('0x3e')];_0x34d2ac+=0x1){socket[_0x0b22('0x70')](_0x0b22('0x84'),{'UserId':Number(_0x2a7a81[_0x0b22('0x38')]['ids'][_0x34d2ac]),'OpenchannelQueueId':Number(_0x2a7a81['params']['id'])});}}else{socket[_0x0b22('0x70')](_0x0b22('0x84'),{'UserId':Number(_0x2a7a81[_0x0b22('0x38')]['ids']),'OpenchannelQueueId':Number(_0x2a7a81[_0x0b22('0x4b')]['id'])});}});}})[_0x0b22('0x2b')](respondWithStatusCode(_0x1784b2,null))[_0x0b22('0x4a')](handleError(_0x1784b2,null));};exports['getAgents']=function(_0x5b5e10,_0x38581d,_0x4c1131){var _0x3ecb9c={};var _0x50112={};var _0x47d7f3;var _0x174060;return db['OpenchannelQueue'][_0x0b22('0x58')]({'where':{'id':_0x5b5e10[_0x0b22('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38581d,null))[_0x0b22('0x2b')](function(_0xf8fba1){if(_0xf8fba1){_0x47d7f3=_0xf8fba1;_0x50112[_0x0b22('0x37')]=_[_0x0b22('0x39')](db[_0x0b22('0x5c')][_0x0b22('0x33')]);_0x50112[_0x0b22('0x38')]=_['keys'](_0x5b5e10[_0x0b22('0x38')]);_0x50112[_0x0b22('0x3a')]=_['intersection'](_0x50112[_0x0b22('0x37')],_0x50112[_0x0b22('0x38')]);_0x3ecb9c[_0x0b22('0x3c')]=_['intersection'](_0x50112[_0x0b22('0x37')],qs['fields'](_0x5b5e10[_0x0b22('0x38')]['fields']));_0x3ecb9c[_0x0b22('0x3c')]=_0x3ecb9c[_0x0b22('0x3c')][_0x0b22('0x3e')]?_0x3ecb9c[_0x0b22('0x3c')]:_0x50112[_0x0b22('0x37')];_0x3ecb9c['order']=qs[_0x0b22('0x41')](_0x5b5e10[_0x0b22('0x38')][_0x0b22('0x41')]);_0x3ecb9c[_0x0b22('0x42')]=qs[_0x0b22('0x3a')](_['pick'](_0x5b5e10[_0x0b22('0x38')],_0x50112[_0x0b22('0x3a')]));if(_0x5b5e10['query'][_0x0b22('0x66')]){_0x3ecb9c[_0x0b22('0x42')]=_['merge'](_0x3ecb9c['where'],{'$or':_[_0x0b22('0x31')](_0x3ecb9c[_0x0b22('0x3c')],function(_0x5257c3){var _0x56238f={};_0x56238f[_0x5257c3]={'$like':'%'+_0x5b5e10['query'][_0x0b22('0x66')]+'%'};return _0x56238f;})});}_0x3ecb9c=_[_0x0b22('0x44')]({},_0x3ecb9c,_0x5b5e10[_0x0b22('0x46')]);return _0x47d7f3[_0x0b22('0x88')](_0x3ecb9c);}})['then'](function(_0x496204){if(_0x496204){_0x174060=_0x496204[_0x0b22('0x3e')];if(!_0x5b5e10[_0x0b22('0x38')][_0x0b22('0x3f')]('nolimit')){_0x3ecb9c[_0x0b22('0x21')]=qs['limit'](_0x5b5e10[_0x0b22('0x38')]['limit']);_0x3ecb9c[_0x0b22('0x24')]=qs[_0x0b22('0x24')](_0x5b5e10[_0x0b22('0x38')][_0x0b22('0x24')]);}return _0x47d7f3['getAgents'](_0x3ecb9c);}})['then'](function(_0x1c7c0a){if(_0x1c7c0a){return _0x1c7c0a?{'count':_0x174060,'rows':_0x1c7c0a}:null;}})[_0x0b22('0x2b')](respondWithResult(_0x38581d,null))[_0x0b22('0x4a')](handleError(_0x38581d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index d4200a9..0c85ba1 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 _0x866c=['hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1b2bd2,_0x491f68){var _0x34a271=function(_0x6036d){while(--_0x6036d){_0x1b2bd2['push'](_0x1b2bd2['shift']());}};_0x34a271(++_0x491f68);}(_0x866c,0x8e));var _0xc866=function(_0x3306d8,_0x11d42a){_0x3306d8=_0x3306d8-0x0;var _0x39e559=_0x866c[_0x3306d8];return _0x39e559;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xc866('0x0'))['db'][_0xc866('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc866('0x2')](0x0);var events={'afterCreate':_0xc866('0x3'),'afterUpdate':_0xc866('0x4'),'afterDestroy':_0xc866('0x5')};function emitEvent(_0x994006){return function(_0x22e679,_0x38dd2c,_0x5e7095){OpenchannelQueueEvents[_0xc866('0x6')](_0x994006+':'+_0x22e679['id'],_0x22e679);OpenchannelQueueEvents[_0xc866('0x6')](_0x994006,_0x22e679);_0x5e7095(null);};}for(var e in events){if(events[_0xc866('0x7')](e)){var event=events[e];OpenchannelQueue[_0xc866('0x8')](e,emitEvent(event));}}module[_0xc866('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xce27=['update','emit','hook','exports','../../mysqldb','OpenchannelQueue','save'];(function(_0x3f6a2d,_0x26c92b){var _0x220ebe=function(_0x2ce494){while(--_0x2ce494){_0x3f6a2d['push'](_0x3f6a2d['shift']());}};_0x220ebe(++_0x26c92b);}(_0xce27,0x1af));var _0x7ce2=function(_0x46c083,_0x51b3bb){_0x46c083=_0x46c083-0x0;var _0x264224=_0xce27[_0x46c083];return _0x264224;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x7ce2('0x0'))['db'][_0x7ce2('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ce2('0x2'),'afterUpdate':_0x7ce2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3d6462){return function(_0x331ed1,_0x1517ce,_0x2469cd){OpenchannelQueueEvents[_0x7ce2('0x4')](_0x3d6462+':'+_0x331ed1['id'],_0x331ed1);OpenchannelQueueEvents[_0x7ce2('0x4')](_0x3d6462,_0x331ed1);_0x2469cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x7ce2('0x5')](e,emitEvent(event));}}module[_0x7ce2('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 5fb1ddd..acad126 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 _0x121b=['define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x121b,0x87));var _0xb121=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x121b[_0x56138f];return _0x1acaf7;};'use strict';var _=require(_0xb121('0x0'));var util=require('util');var logger=require(_0xb121('0x1'))(_0xb121('0x2'));var moment=require(_0xb121('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb121('0x4'));var rimraf=require(_0xb121('0x5'));var config=require(_0xb121('0x6'));var attributes=require(_0xb121('0x7'));module[_0xb121('0x8')]=function(_0x254a67,_0x2aaaba){return _0x254a67[_0xb121('0x9')](_0xb121('0xa'),attributes,{'tableName':_0xb121('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4668=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4668,0x1ee));var _0x8466=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4668[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8466('0x0'));var util=require(_0x8466('0x1'));var logger=require(_0x8466('0x2'))(_0x8466('0x3'));var moment=require(_0x8466('0x4'));var BPromise=require(_0x8466('0x5'));var rp=require(_0x8466('0x6'));var fs=require('fs');var path=require(_0x8466('0x7'));var rimraf=require(_0x8466('0x8'));var config=require(_0x8466('0x9'));var attributes=require(_0x8466('0xa'));module[_0x8466('0xb')]=function(_0x1586f4,_0x53f242){return _0x1586f4[_0x8466('0xc')](_0x8466('0xd'),attributes,{'tableName':'openchannel_queues','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 ff6bfce..71b280d 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 _0xae09=['defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetOpenchannelQueue','options','raw','attributes','limit','include','model','map','stringify','OpenchannelQueue','find','where','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis'];(function(_0x1f2ead,_0x29b7fa){var _0x4bd59a=function(_0x14d831){while(--_0x14d831){_0x1f2ead['push'](_0x1f2ead['shift']());}};_0x4bd59a(++_0x29b7fa);}(_0xae09,0x13b));var _0x9ae0=function(_0x2ad697,_0x449d3c){_0x2ad697=_0x2ad697-0x0;var _0xb5ed98=_0xae09[_0x2ad697];return _0xb5ed98;};'use strict';var _=require(_0x9ae0('0x0'));var util=require(_0x9ae0('0x1'));var moment=require(_0x9ae0('0x2'));var BPromise=require(_0x9ae0('0x3'));var rs=require(_0x9ae0('0x4'));var fs=require('fs');var Redis=require(_0x9ae0('0x5'));var db=require(_0x9ae0('0x6'))['db'];var utils=require(_0x9ae0('0x7'));var logger=require(_0x9ae0('0x8'))(_0x9ae0('0x9'));var config=require(_0x9ae0('0xa'));var jayson=require(_0x9ae0('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x9ae0('0xc')]=_[_0x9ae0('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9ae0('0xe'))(new Redis(config['redis']));require(_0x9ae0('0xf'))[_0x9ae0('0x10')](socket);function respondWithRpcPromise(_0x1fed12,_0x232868,_0x5348fc){return new BPromise(function(_0x454904,_0x5e60d6){return client[_0x9ae0('0x11')](_0x1fed12,_0x5348fc)[_0x9ae0('0x12')](function(_0x45227f){logger[_0x9ae0('0x13')](_0x9ae0('0x14'),_0x232868,_0x9ae0('0x15'));logger[_0x9ae0('0x16')](_0x9ae0('0x17'),_0x232868,_0x9ae0('0x15'),JSON['stringify'](_0x45227f));if(_0x45227f[_0x9ae0('0x18')]){if(_0x45227f[_0x9ae0('0x18')]['code']===0x1f4){logger[_0x9ae0('0x18')](_0x9ae0('0x14'),_0x232868,_0x45227f[_0x9ae0('0x18')][_0x9ae0('0x19')]);return _0x5e60d6(_0x45227f[_0x9ae0('0x18')]['message']);}logger['error'](_0x9ae0('0x14'),_0x232868,_0x45227f[_0x9ae0('0x18')][_0x9ae0('0x19')]);return _0x454904(_0x45227f[_0x9ae0('0x18')][_0x9ae0('0x19')]);}else{logger['info'](_0x9ae0('0x14'),_0x232868,_0x9ae0('0x15'));_0x454904(_0x45227f[_0x9ae0('0x1a')][_0x9ae0('0x19')]);}})[_0x9ae0('0x1b')](function(_0x173593){logger[_0x9ae0('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x232868,_0x173593);_0x5e60d6(_0x173593);});});}exports[_0x9ae0('0x1c')]=function(_0x5d89ff){var _0x1b923e=this;return new Promise(function(_0x3eb055,_0x11b90a){return db['OpenchannelQueue']['findAll']({'raw':_0x5d89ff[_0x9ae0('0x1d')]?_0x5d89ff[_0x9ae0('0x1d')][_0x9ae0('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d89ff[_0x9ae0('0x1d')]?_0x5d89ff['options']['where']||null:null,'attributes':_0x5d89ff[_0x9ae0('0x1d')]?_0x5d89ff[_0x9ae0('0x1d')][_0x9ae0('0x1f')]||null:null,'limit':_0x5d89ff['options']?_0x5d89ff['options'][_0x9ae0('0x20')]||null:null,'include':_0x5d89ff[_0x9ae0('0x1d')]?_0x5d89ff['options'][_0x9ae0('0x21')]?_['map'](_0x5d89ff[_0x9ae0('0x1d')][_0x9ae0('0x21')],function(_0x39295c){return{'model':db[_0x39295c[_0x9ae0('0x22')]],'as':_0x39295c['as'],'attributes':_0x39295c[_0x9ae0('0x1f')],'include':_0x39295c[_0x9ae0('0x21')]?_[_0x9ae0('0x23')](_0x39295c[_0x9ae0('0x21')],function(_0x3720ae){return{'model':db[_0x3720ae[_0x9ae0('0x22')]],'as':_0x3720ae['as'],'attributes':_0x3720ae[_0x9ae0('0x1f')],'include':_0x3720ae['include']?_[_0x9ae0('0x23')](_0x3720ae[_0x9ae0('0x21')],function(_0x57c13e){return{'model':db[_0x57c13e[_0x9ae0('0x22')]],'as':_0x57c13e['as'],'attributes':_0x57c13e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x215371){logger[_0x9ae0('0x13')](_0x9ae0('0x1c'),_0x5d89ff);logger[_0x9ae0('0x16')](_0x9ae0('0x1c'),_0x5d89ff,JSON[_0x9ae0('0x24')](_0x215371));_0x3eb055(_0x215371);})[_0x9ae0('0x1b')](function(_0x49adfc){logger[_0x9ae0('0x18')](_0x9ae0('0x1c'),_0x49adfc[_0x9ae0('0x19')],_0x5d89ff);_0x11b90a(_0x1b923e[_0x9ae0('0x18')](0x1f4,_0x49adfc[_0x9ae0('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x2a2494){var _0xb73b0b=this;return new Promise(function(_0x32aed6,_0x3a7047){return db[_0x9ae0('0x25')][_0x9ae0('0x26')]({'raw':_0x2a2494[_0x9ae0('0x1d')]?_0x2a2494['options'][_0x9ae0('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a2494[_0x9ae0('0x1d')]?_0x2a2494['options'][_0x9ae0('0x27')]||null:null,'attributes':_0x2a2494[_0x9ae0('0x1d')]?_0x2a2494[_0x9ae0('0x1d')][_0x9ae0('0x1f')]||null:null,'include':_0x2a2494[_0x9ae0('0x1d')]?_0x2a2494[_0x9ae0('0x1d')][_0x9ae0('0x21')]?_[_0x9ae0('0x23')](_0x2a2494[_0x9ae0('0x1d')]['include'],function(_0x3b0e77){return{'model':db[_0x3b0e77['model']],'as':_0x3b0e77['as'],'attributes':_0x3b0e77[_0x9ae0('0x1f')],'include':_0x3b0e77[_0x9ae0('0x21')]?_[_0x9ae0('0x23')](_0x3b0e77[_0x9ae0('0x21')],function(_0x5e8226){return{'model':db[_0x5e8226[_0x9ae0('0x22')]],'as':_0x5e8226['as'],'attributes':_0x5e8226['attributes'],'include':_0x5e8226['include']?_[_0x9ae0('0x23')](_0x5e8226[_0x9ae0('0x21')],function(_0x31701e){return{'model':db[_0x31701e[_0x9ae0('0x22')]],'as':_0x31701e['as'],'attributes':_0x31701e[_0x9ae0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9ae0('0x12')](function(_0x782d93){logger[_0x9ae0('0x13')](_0x9ae0('0x28'),_0x2a2494);logger[_0x9ae0('0x16')]('ShowOpenchannelQueue',_0x2a2494,JSON[_0x9ae0('0x24')](_0x782d93));_0x32aed6(_0x782d93);})[_0x9ae0('0x1b')](function(_0x30e7d0){logger[_0x9ae0('0x18')]('ShowOpenchannelQueue',_0x30e7d0[_0x9ae0('0x19')],_0x2a2494);_0x3a7047(_0xb73b0b[_0x9ae0('0x18')](0x1f4,_0x30e7d0[_0x9ae0('0x19')]));});});}; \ No newline at end of file +var _0x8459=['then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8459,0x101));var _0x9845=function(_0x403dbf,_0x5a98ee){_0x403dbf=_0x403dbf-0x0;var _0x17765a=_0x8459[_0x403dbf];return _0x17765a;};'use strict';var _=require(_0x9845('0x0'));var util=require(_0x9845('0x1'));var moment=require('moment');var BPromise=require(_0x9845('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9845('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9845('0x4'));var logger=require(_0x9845('0x5'))(_0x9845('0x6'));var config=require('../../config/environment');var jayson=require(_0x9845('0x7'));var client=jayson[_0x9845('0x8')][_0x9845('0x9')]({'port':0x232a});config['redis']=_[_0x9845('0xa')](config[_0x9845('0xb')],{'host':_0x9845('0xc'),'port':0x18eb});var socket=require(_0x9845('0xd'))(new Redis(config[_0x9845('0xb')]));require(_0x9845('0xe'))['register'](socket);function respondWithRpcPromise(_0xae1608,_0x1e8287,_0x412bfd){return new BPromise(function(_0x1f419a,_0x49b589){return client[_0x9845('0xf')](_0xae1608,_0x412bfd)[_0x9845('0x10')](function(_0x438761){logger[_0x9845('0x11')](_0x9845('0x12'),_0x1e8287,_0x9845('0x13'));logger[_0x9845('0x14')](_0x9845('0x15'),_0x1e8287,_0x9845('0x13'),JSON[_0x9845('0x16')](_0x438761));if(_0x438761[_0x9845('0x17')]){if(_0x438761[_0x9845('0x17')][_0x9845('0x18')]===0x1f4){logger[_0x9845('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x1e8287,_0x438761[_0x9845('0x17')]['message']);return _0x49b589(_0x438761['error'][_0x9845('0x19')]);}logger[_0x9845('0x17')](_0x9845('0x12'),_0x1e8287,_0x438761['error'][_0x9845('0x19')]);return _0x1f419a(_0x438761[_0x9845('0x17')][_0x9845('0x19')]);}else{logger[_0x9845('0x11')](_0x9845('0x12'),_0x1e8287,_0x9845('0x13'));_0x1f419a(_0x438761['result'][_0x9845('0x19')]);}})[_0x9845('0x1a')](function(_0x1d802a){logger[_0x9845('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x1e8287,_0x1d802a);_0x49b589(_0x1d802a);});});}exports[_0x9845('0x1b')]=function(_0x3fc300){var _0x2847b8=this;return new Promise(function(_0x4f075c,_0x1bb53c){return db[_0x9845('0x1c')][_0x9845('0x1d')]({'raw':_0x3fc300[_0x9845('0x1e')]?_0x3fc300[_0x9845('0x1e')][_0x9845('0x1f')]===undefined?!![]:![]:!![],'where':_0x3fc300[_0x9845('0x1e')]?_0x3fc300[_0x9845('0x1e')][_0x9845('0x20')]||null:null,'attributes':_0x3fc300['options']?_0x3fc300['options'][_0x9845('0x21')]||null:null,'limit':_0x3fc300['options']?_0x3fc300['options'][_0x9845('0x22')]||null:null,'include':_0x3fc300[_0x9845('0x1e')]?_0x3fc300['options'][_0x9845('0x23')]?_[_0x9845('0x24')](_0x3fc300['options'][_0x9845('0x23')],function(_0x36376b){return{'model':db[_0x36376b[_0x9845('0x25')]],'as':_0x36376b['as'],'attributes':_0x36376b['attributes'],'include':_0x36376b[_0x9845('0x23')]?_[_0x9845('0x24')](_0x36376b[_0x9845('0x23')],function(_0x560a40){return{'model':db[_0x560a40[_0x9845('0x25')]],'as':_0x560a40['as'],'attributes':_0x560a40[_0x9845('0x21')],'include':_0x560a40[_0x9845('0x23')]?_[_0x9845('0x24')](_0x560a40[_0x9845('0x23')],function(_0x264335){return{'model':db[_0x264335['model']],'as':_0x264335['as'],'attributes':_0x264335['attributes']};}):[]};}):[]};}):[]:[]})[_0x9845('0x10')](function(_0x26939d){logger[_0x9845('0x11')](_0x9845('0x1b'),_0x3fc300);logger[_0x9845('0x14')](_0x9845('0x1b'),_0x3fc300,JSON[_0x9845('0x16')](_0x26939d));_0x4f075c(_0x26939d);})[_0x9845('0x1a')](function(_0x1418b1){logger[_0x9845('0x17')](_0x9845('0x1b'),_0x1418b1[_0x9845('0x19')],_0x3fc300);_0x1bb53c(_0x2847b8['error'](0x1f4,_0x1418b1[_0x9845('0x19')]));});});};exports[_0x9845('0x26')]=function(_0x57875c){var _0x4b11a1=this;return new Promise(function(_0x21ed83,_0x440058){return db['OpenchannelQueue']['find']({'raw':_0x57875c[_0x9845('0x1e')]?_0x57875c[_0x9845('0x1e')][_0x9845('0x1f')]===undefined?!![]:![]:!![],'where':_0x57875c[_0x9845('0x1e')]?_0x57875c[_0x9845('0x1e')]['where']||null:null,'attributes':_0x57875c[_0x9845('0x1e')]?_0x57875c[_0x9845('0x1e')][_0x9845('0x21')]||null:null,'include':_0x57875c['options']?_0x57875c[_0x9845('0x1e')][_0x9845('0x23')]?_['map'](_0x57875c[_0x9845('0x1e')][_0x9845('0x23')],function(_0x559d15){return{'model':db[_0x559d15[_0x9845('0x25')]],'as':_0x559d15['as'],'attributes':_0x559d15['attributes'],'include':_0x559d15[_0x9845('0x23')]?_[_0x9845('0x24')](_0x559d15[_0x9845('0x23')],function(_0x5f0a89){return{'model':db[_0x5f0a89['model']],'as':_0x5f0a89['as'],'attributes':_0x5f0a89[_0x9845('0x21')],'include':_0x5f0a89[_0x9845('0x23')]?_[_0x9845('0x24')](_0x5f0a89[_0x9845('0x23')],function(_0x5463a5){return{'model':db[_0x5463a5[_0x9845('0x25')]],'as':_0x5463a5['as'],'attributes':_0x5463a5[_0x9845('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c96dc){logger[_0x9845('0x11')]('ShowOpenchannelQueue',_0x57875c);logger[_0x9845('0x14')](_0x9845('0x26'),_0x57875c,JSON['stringify'](_0x5c96dc));_0x21ed83(_0x5c96dc);})[_0x9845('0x1a')](function(_0x52d7b3){logger['error'](_0x9845('0x26'),_0x52d7b3[_0x9845('0x19')],_0x57875c);_0x440058(_0x4b11a1['error'](0x1f4,_0x52d7b3[_0x9845('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f77acc8..bf76aa7 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 _0xf367=['save','remove','removeListener','register'];(function(_0x2639c5,_0x16065f){var _0x3072dc=function(_0x42c2c4){while(--_0x42c2c4){_0x2639c5['push'](_0x2639c5['shift']());}};_0x3072dc(++_0x16065f);}(_0xf367,0x98));var _0x7f36=function(_0x594b5e,_0x127e5d){_0x594b5e=_0x594b5e-0x0;var _0x4743a3=_0xf367[_0x594b5e];return _0x4743a3;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x7f36('0x0'),_0x7f36('0x1'),'update'];function createListener(_0x9a3b18,_0x25e775){return function(_0x2a42ca){_0x25e775['emit'](_0x9a3b18,_0x2a42ca);};}function removeListener(_0x290901,_0x158e73){return function(){OpenchannelQueueEvents[_0x7f36('0x2')](_0x290901,_0x158e73);};}exports[_0x7f36('0x3')]=function(_0x8be6d6){for(var _0x592b07=0x0,_0x226050=events['length'];_0x592b07<_0x226050;_0x592b07++){var _0x4a393b=events[_0x592b07];var _0x1ea9f1=createListener('openchannelQueue:'+_0x4a393b,_0x8be6d6);OpenchannelQueueEvents['on'](_0x4a393b,_0x1ea9f1);}}; \ No newline at end of file +var _0xca76=['register','./openchannelQueue.events','remove','update','emit','removeListener'];(function(_0x285e96,_0x44f7db){var _0x2e82c5=function(_0x1e2c43){while(--_0x1e2c43){_0x285e96['push'](_0x285e96['shift']());}};_0x2e82c5(++_0x44f7db);}(_0xca76,0x14b));var _0x6ca7=function(_0x2321d0,_0x2a5fa9){_0x2321d0=_0x2321d0-0x0;var _0x36050c=_0xca76[_0x2321d0];return _0x36050c;};'use strict';var OpenchannelQueueEvents=require(_0x6ca7('0x0'));var events=['save',_0x6ca7('0x1'),_0x6ca7('0x2')];function createListener(_0x329007,_0x146efe){return function(_0x2af52f){_0x146efe[_0x6ca7('0x3')](_0x329007,_0x2af52f);};}function removeListener(_0x599c1c,_0x36270f){return function(){OpenchannelQueueEvents[_0x6ca7('0x4')](_0x599c1c,_0x36270f);};}exports[_0x6ca7('0x5')]=function(_0x254795){for(var _0x4863ac=0x0,_0x48cdf5=events['length'];_0x4863ac<_0x48cdf5;_0x4863ac++){var _0x272664=events[_0x4863ac];var _0x15f3ed=createListener('openchannelQueue:'+_0x272664,_0x254795);OpenchannelQueueEvents['on'](_0x272664,_0x15f3ed);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a56beb5..8396465 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 _0xc977=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xc977,0x1e1));var _0x7c97=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0xc977[_0x7a6aed];return _0x9dbabf;};'use strict';var multer=require('multer');var util=require(_0x7c97('0x0'));var path=require(_0x7c97('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c97('0x2'));var router=express[_0x7c97('0x3')]();var fs_extra=require(_0x7c97('0x4'));var auth=require(_0x7c97('0x5'));var interaction=require(_0x7c97('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x7c97('0x7')](),controller[_0x7c97('0x8')]);router[_0x7c97('0x9')]('/describe',auth[_0x7c97('0x7')](),controller[_0x7c97('0xa')]);router['get'](_0x7c97('0xb'),auth[_0x7c97('0x7')](),controller['show']);router[_0x7c97('0xc')]('/',auth[_0x7c97('0x7')](),controller[_0x7c97('0xd')]);router['put'](_0x7c97('0xb'),auth[_0x7c97('0x7')](),controller[_0x7c97('0xe')]);router[_0x7c97('0xf')](_0x7c97('0xb'),auth[_0x7c97('0x7')](),controller[_0x7c97('0x10')]);module[_0x7c97('0x11')]=router; \ No newline at end of file +var _0x155b=['../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x155b,0xec));var _0xb155=function(_0x58de4a,_0x564dbc){_0x58de4a=_0x58de4a-0x0;var _0x178820=_0x155b[_0x58de4a];return _0x178820;};'use strict';var multer=require(_0xb155('0x0'));var util=require(_0xb155('0x1'));var path=require(_0xb155('0x2'));var timeout=require(_0xb155('0x3'));var express=require('express');var router=express[_0xb155('0x4')]();var fs_extra=require(_0xb155('0x5'));var auth=require(_0xb155('0x6'));var interaction=require(_0xb155('0x7'));var config=require('../../config/environment');var controller=require(_0xb155('0x8'));router[_0xb155('0x9')]('/',auth[_0xb155('0xa')](),controller[_0xb155('0xb')]);router[_0xb155('0x9')](_0xb155('0xc'),auth[_0xb155('0xa')](),controller['describe']);router[_0xb155('0x9')](_0xb155('0xd'),auth[_0xb155('0xa')](),controller[_0xb155('0xe')]);router[_0xb155('0xf')]('/',auth['isAuthenticated'](),controller[_0xb155('0x10')]);router[_0xb155('0x11')](_0xb155('0xd'),auth['isAuthenticated'](),controller[_0xb155('0x12')]);router[_0xb155('0x13')](_0xb155('0xd'),auth[_0xb155('0xa')](),controller[_0xb155('0x14')]);module[_0xb155('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3aacfa5..e1a9b52 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 _0x8c63=['sequelize','exports','STRING','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c63,0x77));var _0x38c6=function(_0x190767,_0x48fbb2){_0x190767=_0x190767-0x0;var _0x117c5d=_0x8c63[_0x190767];return _0x117c5d;};'use strict';var moment=require(_0x38c6('0x0'));var Sequelize=require(_0x38c6('0x1'));module[_0x38c6('0x2')]={'uniqueid':{'type':Sequelize[_0x38c6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x38c6('0x3')]}}; \ No newline at end of file +var _0x2318=['DATE','moment','sequelize','STRING'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x2318,0x149));var _0x8231=function(_0x3005f1,_0x33ebfd){_0x3005f1=_0x3005f1-0x0;var _0x14583c=_0x2318[_0x3005f1];return _0x14583c;};'use strict';var moment=require(_0x8231('0x0'));var Sequelize=require(_0x8231('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8231('0x2')]},'joinAt':{'type':Sequelize[_0x8231('0x3')]},'leaveAt':{'type':Sequelize[_0x8231('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8231('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 0bb0413..eb082c5 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 _0xaf85=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0xaf85,0x1d4));var _0x5af8=function(_0x2b9120,_0x4cba82){_0x2b9120=_0x2b9120-0x0;var _0x459db0=_0xaf85[_0x2b9120];return _0x459db0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5af8('0x0'));var zipdir=require(_0x5af8('0x1'));var jsonpatch=require(_0x5af8('0x2'));var rp=require(_0x5af8('0x3'));var moment=require(_0x5af8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5af8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5af8('0x6'));var fs=require('fs');var fs_extra=require(_0x5af8('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5af8('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x5af8('0x9'));var querystring=require('querystring');var Papa=require(_0x5af8('0xa'));var Redis=require('ioredis');var authService=require(_0x5af8('0xb'));var qs=require(_0x5af8('0xc'));var as=require(_0x5af8('0xd'));var hardwareService=require(_0x5af8('0xe'));var logger=require(_0x5af8('0xf'))(_0x5af8('0x10'));var utils=require(_0x5af8('0x11'));var config=require(_0x5af8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5af8('0x13'))['db'];function respondWithStatusCode(_0x8bd32f,_0x3800dc){_0x3800dc=_0x3800dc||0xcc;return function(_0x161a2f){if(_0x161a2f){return _0x8bd32f['sendStatus'](_0x3800dc);}return _0x8bd32f['status'](_0x3800dc)['end']();};}function respondWithResult(_0x12d7bc,_0x448860){_0x448860=_0x448860||0xc8;return function(_0x350562){if(_0x350562){return _0x12d7bc[_0x5af8('0x14')](_0x448860)[_0x5af8('0x15')](_0x350562);}};}function respondWithFilteredResult(_0x434f23,_0x2f0a13){return function(_0x2db3bf){if(_0x2db3bf){var _0x30e2e4=typeof _0x2f0a13['offset']===_0x5af8('0x16')&&typeof _0x2f0a13[_0x5af8('0x17')]===_0x5af8('0x16');var _0x39816c=_0x2db3bf[_0x5af8('0x18')];var _0x5c66c4=_0x30e2e4?0x0:_0x2f0a13['offset'];var _0x50727f=_0x30e2e4?_0x2db3bf[_0x5af8('0x18')]:_0x2f0a13[_0x5af8('0x19')]+_0x2f0a13[_0x5af8('0x17')];var _0x54c3f9;if(_0x50727f>=_0x39816c){_0x50727f=_0x39816c;_0x54c3f9=0xc8;}else{_0x54c3f9=0xce;}_0x434f23[_0x5af8('0x14')](_0x54c3f9);return _0x434f23[_0x5af8('0x1a')]('Content-Range',_0x5c66c4+'-'+_0x50727f+'/'+_0x39816c)[_0x5af8('0x15')](_0x2db3bf);}return null;};}function patchUpdates(_0x41eb66){return function(_0x5c857f){try{jsonpatch[_0x5af8('0x1b')](_0x5c857f,_0x41eb66,!![]);}catch(_0x3e4bbc){return BPromise[_0x5af8('0x1c')](_0x3e4bbc);}return _0x5c857f[_0x5af8('0x1d')]();};}function saveUpdates(_0x4afab5,_0x28de67){return function(_0x15ff1a){if(_0x15ff1a){return _0x15ff1a[_0x5af8('0x1e')](_0x4afab5)[_0x5af8('0x1f')](function(_0x3e1b21){return _0x3e1b21;});}return null;};}function removeEntity(_0x1aa7c7,_0x246ef0){return function(_0x231c6c){if(_0x231c6c){return _0x231c6c[_0x5af8('0x20')]()[_0x5af8('0x1f')](function(){_0x1aa7c7[_0x5af8('0x14')](0xcc)[_0x5af8('0x21')]();});}};}function handleEntityNotFound(_0x5651d8,_0x234b7f){return function(_0x683ac){if(!_0x683ac){_0x5651d8['sendStatus'](0x194);}return _0x683ac;};}function handleError(_0x4e9808,_0x2ded43){_0x2ded43=_0x2ded43||0x1f4;return function(_0x166d92){logger[_0x5af8('0x22')](_0x166d92[_0x5af8('0x23')]);if(_0x166d92['name']){delete _0x166d92['name'];}_0x4e9808['status'](_0x2ded43)[_0x5af8('0x24')](_0x166d92);};}exports[_0x5af8('0x25')]=function(_0x4853fb,_0x530136){var _0x3abe86={},_0x299d3d={},_0x361270={'count':0x0,'rows':[]};var _0x7337c5=_[_0x5af8('0x26')](db[_0x5af8('0x27')][_0x5af8('0x28')],function(_0x580afc){return{'name':_0x580afc[_0x5af8('0x29')],'type':_0x580afc[_0x5af8('0x2a')][_0x5af8('0x2b')]};});_0x299d3d[_0x5af8('0x2c')]=_[_0x5af8('0x26')](_0x7337c5,_0x5af8('0x2d'));_0x299d3d[_0x5af8('0x2e')]=_[_0x5af8('0x2f')](_0x4853fb['query']);_0x299d3d[_0x5af8('0x30')]=_[_0x5af8('0x31')](_0x299d3d[_0x5af8('0x2c')],_0x299d3d[_0x5af8('0x2e')]);_0x3abe86[_0x5af8('0x32')]=_[_0x5af8('0x31')](_0x299d3d[_0x5af8('0x2c')],qs[_0x5af8('0x33')](_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x33')]));_0x3abe86[_0x5af8('0x32')]=_0x3abe86[_0x5af8('0x32')]['length']?_0x3abe86[_0x5af8('0x32')]:_0x299d3d['model'];if(!_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x34')](_0x5af8('0x35'))){_0x3abe86[_0x5af8('0x17')]=qs['limit'](_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x17')]);_0x3abe86[_0x5af8('0x19')]=qs[_0x5af8('0x19')](_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x19')]);}_0x3abe86[_0x5af8('0x36')]=qs[_0x5af8('0x37')](_0x4853fb[_0x5af8('0x2e')]['sort']);_0x3abe86[_0x5af8('0x38')]=qs[_0x5af8('0x30')](_[_0x5af8('0x39')](_0x4853fb['query'],_0x299d3d[_0x5af8('0x30')]),_0x7337c5);if(_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x3a')]){_0x3abe86['where']=_[_0x5af8('0x3b')](_0x3abe86[_0x5af8('0x38')],{'$or':_['map'](_0x7337c5,function(_0x1f5965){if(_0x1f5965[_0x5af8('0x2a')]!==_0x5af8('0x3c')){var _0x504084={};_0x504084[_0x1f5965[_0x5af8('0x2d')]]={'$like':'%'+_0x4853fb[_0x5af8('0x2e')][_0x5af8('0x3a')]+'%'};return _0x504084;}})});}_0x3abe86=_['merge']({},_0x3abe86,_0x4853fb[_0x5af8('0x3d')]);var _0x2e1ba3={'where':_0x3abe86[_0x5af8('0x38')]};return db['OpenchannelQueueReport'][_0x5af8('0x18')](_0x2e1ba3)[_0x5af8('0x1f')](function(_0xe15f27){_0x361270[_0x5af8('0x18')]=_0xe15f27;if(_0x4853fb[_0x5af8('0x2e')]['includeAll']){_0x3abe86[_0x5af8('0x3e')]=[{'all':!![]}];}return db[_0x5af8('0x27')][_0x5af8('0x3f')](_0x3abe86);})['then'](function(_0x3d98c1){_0x361270[_0x5af8('0x40')]=_0x3d98c1;return _0x361270;})[_0x5af8('0x1f')](respondWithFilteredResult(_0x530136,_0x3abe86))[_0x5af8('0x41')](handleError(_0x530136,null));};exports[_0x5af8('0x42')]=function(_0x2ca89b,_0x4148fa){var _0x2ec96a={'raw':!![],'where':{'id':_0x2ca89b[_0x5af8('0x43')]['id']}},_0x3468d1={};_0x3468d1[_0x5af8('0x2c')]=_[_0x5af8('0x2f')](db[_0x5af8('0x27')][_0x5af8('0x28')]);_0x3468d1[_0x5af8('0x2e')]=_[_0x5af8('0x2f')](_0x2ca89b[_0x5af8('0x2e')]);_0x3468d1[_0x5af8('0x30')]=_[_0x5af8('0x31')](_0x3468d1[_0x5af8('0x2c')],_0x3468d1[_0x5af8('0x2e')]);_0x2ec96a[_0x5af8('0x32')]=_[_0x5af8('0x31')](_0x3468d1[_0x5af8('0x2c')],qs[_0x5af8('0x33')](_0x2ca89b[_0x5af8('0x2e')][_0x5af8('0x33')]));_0x2ec96a['attributes']=_0x2ec96a['attributes'][_0x5af8('0x44')]?_0x2ec96a['attributes']:_0x3468d1[_0x5af8('0x2c')];if(_0x2ca89b[_0x5af8('0x2e')][_0x5af8('0x45')]){_0x2ec96a['include']=[{'all':!![]}];}_0x2ec96a=_['merge']({},_0x2ec96a,_0x2ca89b[_0x5af8('0x3d')]);return db[_0x5af8('0x27')][_0x5af8('0x46')](_0x2ec96a)[_0x5af8('0x1f')](handleEntityNotFound(_0x4148fa,null))[_0x5af8('0x1f')](respondWithResult(_0x4148fa,null))[_0x5af8('0x41')](handleError(_0x4148fa,null));};exports[_0x5af8('0x47')]=function(_0x5d78b3,_0x3fa343){return db['OpenchannelQueueReport']['create'](_0x5d78b3['body'],{})['then'](respondWithResult(_0x3fa343,0xc9))[_0x5af8('0x41')](handleError(_0x3fa343,null));};exports[_0x5af8('0x1e')]=function(_0x33fe70,_0xe7c364){if(_0x33fe70['body']['id']){delete _0x33fe70[_0x5af8('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x5af8('0x46')]({'where':{'id':_0x33fe70[_0x5af8('0x43')]['id']}})[_0x5af8('0x1f')](handleEntityNotFound(_0xe7c364,null))[_0x5af8('0x1f')](saveUpdates(_0x33fe70[_0x5af8('0x48')],null))[_0x5af8('0x1f')](respondWithResult(_0xe7c364,null))[_0x5af8('0x41')](handleError(_0xe7c364,null));};exports['destroy']=function(_0x1986e6,_0x470324){return db[_0x5af8('0x27')][_0x5af8('0x46')]({'where':{'id':_0x1986e6[_0x5af8('0x43')]['id']}})[_0x5af8('0x1f')](handleEntityNotFound(_0x470324,null))['then'](removeEntity(_0x470324,null))['catch'](handleError(_0x470324,null));};exports[_0x5af8('0x49')]=function(_0x2863b4,_0x534599){return db[_0x5af8('0x27')]['describe']()['then'](respondWithResult(_0x534599,null))['catch'](handleError(_0x534599,null));}; \ No newline at end of file +var _0x36c7=['stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','reject','update','then','destroy'];(function(_0x5ebd69,_0x5c2c9f){var _0x382bfa=function(_0x295bbd){while(--_0x295bbd){_0x5ebd69['push'](_0x5ebd69['shift']());}};_0x382bfa(++_0x5c2c9f);}(_0x36c7,0x116));var _0x736c=function(_0x344a42,_0x1b52e0){_0x344a42=_0x344a42-0x0;var _0x4b71de=_0x36c7[_0x344a42];return _0x4b71de;};'use strict';var emlformat=require(_0x736c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x736c('0x1'));var rp=require(_0x736c('0x2'));var moment=require(_0x736c('0x3'));var BPromise=require(_0x736c('0x4'));var Mustache=require(_0x736c('0x5'));var util=require(_0x736c('0x6'));var path=require(_0x736c('0x7'));var sox=require(_0x736c('0x8'));var csv=require('to-csv');var ejs=require(_0x736c('0x9'));var fs=require('fs');var fs_extra=require(_0x736c('0xa'));var _=require(_0x736c('0xb'));var squel=require(_0x736c('0xc'));var crypto=require(_0x736c('0xd'));var jsforce=require(_0x736c('0xe'));var deskjs=require(_0x736c('0xf'));var toCsv=require(_0x736c('0x10'));var querystring=require(_0x736c('0x11'));var Papa=require(_0x736c('0x12'));var Redis=require(_0x736c('0x13'));var authService=require(_0x736c('0x14'));var qs=require(_0x736c('0x15'));var as=require(_0x736c('0x16'));var hardwareService=require(_0x736c('0x17'));var logger=require(_0x736c('0x18'))('api');var utils=require(_0x736c('0x19'));var config=require(_0x736c('0x1a'));var licenseUtil=require(_0x736c('0x1b'));var db=require(_0x736c('0x1c'))['db'];function respondWithStatusCode(_0xa0a35d,_0x1a8af9){_0x1a8af9=_0x1a8af9||0xcc;return function(_0x22e278){if(_0x22e278){return _0xa0a35d[_0x736c('0x1d')](_0x1a8af9);}return _0xa0a35d['status'](_0x1a8af9)[_0x736c('0x1e')]();};}function respondWithResult(_0x4b8084,_0x45347e){_0x45347e=_0x45347e||0xc8;return function(_0x206ed0){if(_0x206ed0){return _0x4b8084['status'](_0x45347e)[_0x736c('0x1f')](_0x206ed0);}};}function respondWithFilteredResult(_0x500b3a,_0x560b0b){return function(_0x547303){if(_0x547303){var _0x4e02f2=typeof _0x560b0b['offset']==='undefined'&&typeof _0x560b0b[_0x736c('0x20')]===_0x736c('0x21');var _0x5bf80b=_0x547303[_0x736c('0x22')];var _0xad0c7f=_0x4e02f2?0x0:_0x560b0b[_0x736c('0x23')];var _0x5363b5=_0x4e02f2?_0x547303['count']:_0x560b0b[_0x736c('0x23')]+_0x560b0b[_0x736c('0x20')];var _0x22be17;if(_0x5363b5>=_0x5bf80b){_0x5363b5=_0x5bf80b;_0x22be17=0xc8;}else{_0x22be17=0xce;}_0x500b3a[_0x736c('0x24')](_0x22be17);return _0x500b3a[_0x736c('0x25')]('Content-Range',_0xad0c7f+'-'+_0x5363b5+'/'+_0x5bf80b)[_0x736c('0x1f')](_0x547303);}return null;};}function patchUpdates(_0x2a6b85){return function(_0x8baff9){try{jsonpatch['apply'](_0x8baff9,_0x2a6b85,!![]);}catch(_0x2c11d8){return BPromise[_0x736c('0x26')](_0x2c11d8);}return _0x8baff9['save']();};}function saveUpdates(_0x2451a7,_0x5124b9){return function(_0x444f4c){if(_0x444f4c){return _0x444f4c[_0x736c('0x27')](_0x2451a7)[_0x736c('0x28')](function(_0x693c52){return _0x693c52;});}return null;};}function removeEntity(_0x11a4a9,_0x1c9c4f){return function(_0x1889c5){if(_0x1889c5){return _0x1889c5[_0x736c('0x29')]()[_0x736c('0x28')](function(){_0x11a4a9['status'](0xcc)[_0x736c('0x1e')]();});}};}function handleEntityNotFound(_0x46126c,_0x2a8f37){return function(_0x353b1c){if(!_0x353b1c){_0x46126c['sendStatus'](0x194);}return _0x353b1c;};}function handleError(_0x3aad52,_0x549b42){_0x549b42=_0x549b42||0x1f4;return function(_0x3f2f80){logger['error'](_0x3f2f80[_0x736c('0x2a')]);if(_0x3f2f80[_0x736c('0x2b')]){delete _0x3f2f80[_0x736c('0x2b')];}_0x3aad52['status'](_0x549b42)[_0x736c('0x2c')](_0x3f2f80);};}exports[_0x736c('0x2d')]=function(_0x4b3b60,_0x3de449){var _0x26b85c={},_0x394796={},_0x13a02b={'count':0x0,'rows':[]};var _0x1961d8=_[_0x736c('0x2e')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x2dab83){return{'name':_0x2dab83[_0x736c('0x2f')],'type':_0x2dab83[_0x736c('0x30')][_0x736c('0x31')]};});_0x394796[_0x736c('0x32')]=_[_0x736c('0x2e')](_0x1961d8,_0x736c('0x2b'));_0x394796[_0x736c('0x33')]=_[_0x736c('0x34')](_0x4b3b60[_0x736c('0x33')]);_0x394796['filters']=_[_0x736c('0x35')](_0x394796['model'],_0x394796[_0x736c('0x33')]);_0x26b85c['attributes']=_[_0x736c('0x35')](_0x394796['model'],qs[_0x736c('0x36')](_0x4b3b60[_0x736c('0x33')][_0x736c('0x36')]));_0x26b85c[_0x736c('0x37')]=_0x26b85c['attributes']['length']?_0x26b85c[_0x736c('0x37')]:_0x394796[_0x736c('0x32')];if(!_0x4b3b60[_0x736c('0x33')]['hasOwnProperty'](_0x736c('0x38'))){_0x26b85c[_0x736c('0x20')]=qs[_0x736c('0x20')](_0x4b3b60[_0x736c('0x33')]['limit']);_0x26b85c['offset']=qs[_0x736c('0x23')](_0x4b3b60['query'][_0x736c('0x23')]);}_0x26b85c[_0x736c('0x39')]=qs[_0x736c('0x3a')](_0x4b3b60['query'][_0x736c('0x3a')]);_0x26b85c['where']=qs[_0x736c('0x3b')](_[_0x736c('0x3c')](_0x4b3b60[_0x736c('0x33')],_0x394796[_0x736c('0x3b')]),_0x1961d8);if(_0x4b3b60[_0x736c('0x33')][_0x736c('0x3d')]){_0x26b85c[_0x736c('0x3e')]=_[_0x736c('0x3f')](_0x26b85c[_0x736c('0x3e')],{'$or':_[_0x736c('0x2e')](_0x1961d8,function(_0x10b109){if(_0x10b109[_0x736c('0x30')]!==_0x736c('0x40')){var _0x4ee25b={};_0x4ee25b[_0x10b109['name']]={'$like':'%'+_0x4b3b60[_0x736c('0x33')][_0x736c('0x3d')]+'%'};return _0x4ee25b;}})});}_0x26b85c=_['merge']({},_0x26b85c,_0x4b3b60[_0x736c('0x41')]);var _0x23fa46={'where':_0x26b85c[_0x736c('0x3e')]};return db[_0x736c('0x42')][_0x736c('0x22')](_0x23fa46)[_0x736c('0x28')](function(_0x63a5ea){_0x13a02b[_0x736c('0x22')]=_0x63a5ea;if(_0x4b3b60[_0x736c('0x33')][_0x736c('0x43')]){_0x26b85c['include']=[{'all':!![]}];}return db[_0x736c('0x42')][_0x736c('0x44')](_0x26b85c);})['then'](function(_0xe3b95f){_0x13a02b[_0x736c('0x45')]=_0xe3b95f;return _0x13a02b;})[_0x736c('0x28')](respondWithFilteredResult(_0x3de449,_0x26b85c))[_0x736c('0x46')](handleError(_0x3de449,null));};exports[_0x736c('0x47')]=function(_0x1ff0b6,_0x255e46){var _0x3bedf3={'raw':!![],'where':{'id':_0x1ff0b6['params']['id']}},_0x2e3b5c={};_0x2e3b5c[_0x736c('0x32')]=_['keys'](db[_0x736c('0x42')][_0x736c('0x48')]);_0x2e3b5c['query']=_[_0x736c('0x34')](_0x1ff0b6[_0x736c('0x33')]);_0x2e3b5c[_0x736c('0x3b')]=_['intersection'](_0x2e3b5c[_0x736c('0x32')],_0x2e3b5c[_0x736c('0x33')]);_0x3bedf3[_0x736c('0x37')]=_['intersection'](_0x2e3b5c[_0x736c('0x32')],qs[_0x736c('0x36')](_0x1ff0b6[_0x736c('0x33')][_0x736c('0x36')]));_0x3bedf3['attributes']=_0x3bedf3['attributes'][_0x736c('0x49')]?_0x3bedf3['attributes']:_0x2e3b5c[_0x736c('0x32')];if(_0x1ff0b6['query'][_0x736c('0x43')]){_0x3bedf3[_0x736c('0x4a')]=[{'all':!![]}];}_0x3bedf3=_[_0x736c('0x3f')]({},_0x3bedf3,_0x1ff0b6[_0x736c('0x41')]);return db[_0x736c('0x42')][_0x736c('0x4b')](_0x3bedf3)[_0x736c('0x28')](handleEntityNotFound(_0x255e46,null))['then'](respondWithResult(_0x255e46,null))[_0x736c('0x46')](handleError(_0x255e46,null));};exports['create']=function(_0x3884b9,_0x29ecfc){return db['OpenchannelQueueReport'][_0x736c('0x4c')](_0x3884b9[_0x736c('0x4d')],{})[_0x736c('0x28')](respondWithResult(_0x29ecfc,0xc9))[_0x736c('0x46')](handleError(_0x29ecfc,null));};exports[_0x736c('0x27')]=function(_0x1edcfb,_0x318696){if(_0x1edcfb[_0x736c('0x4d')]['id']){delete _0x1edcfb[_0x736c('0x4d')]['id'];}return db[_0x736c('0x42')][_0x736c('0x4b')]({'where':{'id':_0x1edcfb[_0x736c('0x4e')]['id']}})[_0x736c('0x28')](handleEntityNotFound(_0x318696,null))[_0x736c('0x28')](saveUpdates(_0x1edcfb[_0x736c('0x4d')],null))[_0x736c('0x28')](respondWithResult(_0x318696,null))[_0x736c('0x46')](handleError(_0x318696,null));};exports['destroy']=function(_0x277173,_0x1c1e95){return db[_0x736c('0x42')][_0x736c('0x4b')]({'where':{'id':_0x277173[_0x736c('0x4e')]['id']}})[_0x736c('0x28')](handleEntityNotFound(_0x1c1e95,null))[_0x736c('0x28')](removeEntity(_0x1c1e95,null))['catch'](handleError(_0x1c1e95,null));};exports[_0x736c('0x4f')]=function(_0x4aec3d,_0x3d45b1){return db[_0x736c('0x42')][_0x736c('0x4f')]()[_0x736c('0x28')](respondWithResult(_0x3d45b1,null))[_0x736c('0x46')](handleError(_0x3d45b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2f91f8b..220bf7d 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x234e24,_0x13f937){var _0x2a5c9f=function(_0x5516bd){while(--_0x5516bd){_0x234e24['push'](_0x234e24['shift']());}};_0x2a5c9f(++_0x13f937);}(_0x1261,0x144));var _0x1126=function(_0x44d28c,_0x3a197b){_0x44d28c=_0x44d28c-0x0;var _0x754673=_0x1261[_0x44d28c];return _0x754673;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x24b476,_0x20c450){var _0x4e443a=function(_0x2e335e){while(--_0x2e335e){_0x24b476['push'](_0x24b476['shift']());}};_0x4e443a(++_0x20c450);}(_0x7a54,0x106));var _0x47a5=function(_0x5ca3ca,_0x437b65){_0x5ca3ca=_0x5ca3ca-0x0;var _0x1f83fe=_0x7a54[_0x5ca3ca];return _0x1f83fe;};'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 0de5360..63f2e3c 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 _0xfff0=['../../config/environment','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','update','where','attributes','limit','info','UpdateOpenchannelQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x31329c,_0x1d5774){var _0x439162=function(_0xd565cb){while(--_0xd565cb){_0x31329c['push'](_0x31329c['shift']());}};_0x439162(++_0x1d5774);}(_0xfff0,0x139));var _0x0fff=function(_0x4c839b,_0x41612d){_0x4c839b=_0x4c839b-0x0;var _0xcc1853=_0xfff0[_0x4c839b];return _0xcc1853;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['CreateOpenchannelQueueReport']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')](_0x48f36d[_0x0fff('0x16')],{'raw':_0x48f36d['options']?_0x48f36d[_0x0fff('0x17')][_0x0fff('0x18')]===undefined?!![]:![]:!![]})[_0x0fff('0xa')](function(_0x49d211){logger['info'](_0x0fff('0x19'),_0x48f36d);logger[_0x0fff('0xd')](_0x0fff('0x19'),_0x48f36d,JSON[_0x0fff('0xf')](_0x49d211));_0x606792(_0x49d211);})['catch'](function(_0x155132){logger[_0x0fff('0x10')](_0x0fff('0x19'),_0x155132[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f[_0x0fff('0x10')](0x1f4,_0x155132[_0x0fff('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x6a116c){var _0x29f702=this;return new Promise(function(_0x37e090,_0x24cd18){return db[_0x0fff('0x14')][_0x0fff('0x1a')](_0x6a116c['body'],{'raw':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1b')]||null:null,'attributes':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1c')]||null:null,'limit':_0x6a116c[_0x0fff('0x17')]?_0x6a116c[_0x0fff('0x17')][_0x0fff('0x1d')]||null:null})['then'](function(_0x7046a3){logger[_0x0fff('0x1e')](_0x0fff('0x1f'),_0x6a116c);logger[_0x0fff('0xd')](_0x0fff('0x1f'),_0x6a116c,JSON[_0x0fff('0xf')](_0x7046a3));_0x37e090(_0x7046a3);})['catch'](function(_0x31f9a4){logger[_0x0fff('0x10')](_0x0fff('0x1f'),_0x31f9a4['message'],_0x6a116c);_0x24cd18(_0x29f702[_0x0fff('0x10')](0x1f4,_0x31f9a4[_0x0fff('0x12')]));});});}; \ No newline at end of file +var _0xb574=['error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','body','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x249bea,_0x274dd3){var _0x139915=function(_0x4f2872){while(--_0x4f2872){_0x249bea['push'](_0x249bea['shift']());}};_0x139915(++_0x274dd3);}(_0xb574,0x106));var _0x4b57=function(_0x20f083,_0x47608a){_0x20f083=_0x20f083-0x0;var _0x565887=_0xb574[_0x20f083];return _0x565887;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')](_0xfb71cc['body'],{'raw':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![]})[_0x4b57('0xb')](function(_0xef1eae){logger[_0x4b57('0xc')]('CreateOpenchannelQueueReport',_0xfb71cc);logger[_0x4b57('0xf')](_0x4b57('0x15'),_0xfb71cc,JSON[_0x4b57('0x10')](_0xef1eae));_0x1b35ff(_0xef1eae);})['catch'](function(_0x380554){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x380554[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x380554[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1a')]=function(_0x4d07c9){var _0x3e7b96=this;return new Promise(function(_0x12dedf,_0x25d190){return db[_0x4b57('0x16')]['update'](_0x4d07c9[_0x4b57('0x1b')],{'raw':_0x4d07c9['options']?_0x4d07c9[_0x4b57('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d07c9[_0x4b57('0x18')]?_0x4d07c9[_0x4b57('0x18')][_0x4b57('0x1c')]||null:null,'attributes':_0x4d07c9[_0x4b57('0x18')]?_0x4d07c9[_0x4b57('0x18')][_0x4b57('0x1d')]||null:null,'limit':_0x4d07c9['options']?_0x4d07c9['options'][_0x4b57('0x1e')]||null:null})['then'](function(_0x1ea0cb){logger[_0x4b57('0xc')](_0x4b57('0x1a'),_0x4d07c9);logger[_0x4b57('0xf')](_0x4b57('0x1a'),_0x4d07c9,JSON[_0x4b57('0x10')](_0x1ea0cb));_0x12dedf(_0x1ea0cb);})['catch'](function(_0xab365c){logger[_0x4b57('0x11')](_0x4b57('0x1a'),_0xab365c[_0x4b57('0x12')],_0x4d07c9);_0x25d190(_0x3e7b96['error'](0x1f4,_0xab365c[_0x4b57('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index bc490e2..9f4f5a6 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 _0x5213=['post','create','put','update','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x5213,0xba));var _0x3521=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x5213[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0x3521('0x0'));var util=require(_0x3521('0x1'));var path=require('path');var timeout=require(_0x3521('0x2'));var express=require(_0x3521('0x3'));var router=express[_0x3521('0x4')]();var fs_extra=require(_0x3521('0x5'));var auth=require(_0x3521('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3521('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x3521('0x8')]('/',auth[_0x3521('0x9')](),controller['index']);router[_0x3521('0x8')](_0x3521('0xa'),auth[_0x3521('0x9')](),controller['describe']);router[_0x3521('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3521('0xb')]);router[_0x3521('0xc')]('/',auth[_0x3521('0x9')](),controller[_0x3521('0xd')]);router[_0x3521('0xe')]('/:id',auth[_0x3521('0x9')](),controller[_0x3521('0xf')]);router['delete'](_0x3521('0x10'),auth[_0x3521('0x9')](),controller['destroy']);module[_0x3521('0x11')]=router; \ No newline at end of file +var _0xbb4b=['get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index'];(function(_0x2712a8,_0x3b67f9){var _0xe7cfe5=function(_0x12e369){while(--_0x12e369){_0x2712a8['push'](_0x2712a8['shift']());}};_0xe7cfe5(++_0x3b67f9);}(_0xbb4b,0x128));var _0xbbb4=function(_0x143d65,_0xaab2bf){_0x143d65=_0x143d65-0x0;var _0x3a93cf=_0xbb4b[_0x143d65];return _0x3a93cf;};'use strict';var multer=require(_0xbbb4('0x0'));var util=require(_0xbbb4('0x1'));var path=require(_0xbbb4('0x2'));var timeout=require(_0xbbb4('0x3'));var express=require(_0xbbb4('0x4'));var router=express[_0xbbb4('0x5')]();var fs_extra=require(_0xbbb4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbbb4('0x7'));var config=require(_0xbbb4('0x8'));var controller=require(_0xbbb4('0x9'));router['get']('/',auth[_0xbbb4('0xa')](),controller[_0xbbb4('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xbbb4('0xc')](_0xbbb4('0xd'),auth[_0xbbb4('0xa')](),controller[_0xbbb4('0xe')]);router[_0xbbb4('0xf')]('/',auth[_0xbbb4('0xa')](),controller[_0xbbb4('0x10')]);router[_0xbbb4('0x11')](_0xbbb4('0xd'),auth[_0xbbb4('0xa')](),controller[_0xbbb4('0x12')]);router[_0xbbb4('0x13')](_0xbbb4('0xd'),auth[_0xbbb4('0xa')](),controller[_0xbbb4('0x14')]);module[_0xbbb4('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4480a06..29ee486 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1b9fe4,_0x3eb83d){var _0x3b6919=function(_0xba39b2){while(--_0xba39b2){_0x1b9fe4['push'](_0x1b9fe4['shift']());}};_0x3b6919(++_0x3eb83d);}(_0xe706,0xa3));var _0x6e70=function(_0xb0975b,_0x93b0d6){_0xb0975b=_0xb0975b-0x0;var _0x320d30=_0xe706[_0xb0975b];return _0x320d30;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xb13e71,_0x58e88b){var _0x3854e7=function(_0x15ae1d){while(--_0x15ae1d){_0xb13e71['push'](_0xb13e71['shift']());}};_0x3854e7(++_0x58e88b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xcb91[_0x24875d];return _0x181471;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4ff88d6..3d8a287 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 _0xd449=['mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xd449,0x153));var _0x9d44=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xd449[_0x495e9f];return _0xb249d2;};'use strict';var emlformat=require(_0x9d44('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d44('0x1'));var util=require(_0x9d44('0x2'));var path=require(_0x9d44('0x3'));var sox=require(_0x9d44('0x4'));var csv=require('to-csv');var ejs=require(_0x9d44('0x5'));var fs=require('fs');var fs_extra=require(_0x9d44('0x6'));var _=require(_0x9d44('0x7'));var squel=require(_0x9d44('0x8'));var crypto=require(_0x9d44('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9d44('0xa'));var toCsv=require(_0x9d44('0xb'));var querystring=require(_0x9d44('0xc'));var Papa=require(_0x9d44('0xd'));var Redis=require(_0x9d44('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9d44('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d44('0x10'));var logger=require('../../config/logger')(_0x9d44('0x11'));var utils=require(_0x9d44('0x12'));var config=require(_0x9d44('0x13'));var licenseUtil=require(_0x9d44('0x14'));var db=require(_0x9d44('0x15'))['db'];function respondWithStatusCode(_0x344c17,_0x34cc6e){_0x34cc6e=_0x34cc6e||0xcc;return function(_0x19c3bb){if(_0x19c3bb){return _0x344c17[_0x9d44('0x16')](_0x34cc6e);}return _0x344c17['status'](_0x34cc6e)[_0x9d44('0x17')]();};}function respondWithResult(_0x295240,_0x46d567){_0x46d567=_0x46d567||0xc8;return function(_0x484555){if(_0x484555){return _0x295240[_0x9d44('0x18')](_0x46d567)[_0x9d44('0x19')](_0x484555);}};}function respondWithFilteredResult(_0x561771,_0x42d0d9){return function(_0x40e551){if(_0x40e551){var _0x5953c3=typeof _0x42d0d9[_0x9d44('0x1a')]===_0x9d44('0x1b')&&typeof _0x42d0d9[_0x9d44('0x1c')]===_0x9d44('0x1b');var _0x419430=_0x40e551[_0x9d44('0x1d')];var _0x4076bd=_0x5953c3?0x0:_0x42d0d9[_0x9d44('0x1a')];var _0x5228f1=_0x5953c3?_0x40e551['count']:_0x42d0d9[_0x9d44('0x1a')]+_0x42d0d9[_0x9d44('0x1c')];var _0x24cfb9;if(_0x5228f1>=_0x419430){_0x5228f1=_0x419430;_0x24cfb9=0xc8;}else{_0x24cfb9=0xce;}_0x561771['status'](_0x24cfb9);return _0x561771['set']('Content-Range',_0x4076bd+'-'+_0x5228f1+'/'+_0x419430)[_0x9d44('0x19')](_0x40e551);}return null;};}function patchUpdates(_0x4c6cf8){return function(_0x500012){try{jsonpatch[_0x9d44('0x1e')](_0x500012,_0x4c6cf8,!![]);}catch(_0xe2359){return BPromise[_0x9d44('0x1f')](_0xe2359);}return _0x500012['save']();};}function saveUpdates(_0x1da114,_0x4e6d03){return function(_0x3f4ee5){if(_0x3f4ee5){return _0x3f4ee5[_0x9d44('0x20')](_0x1da114)[_0x9d44('0x21')](function(_0x845975){return _0x845975;});}return null;};}function removeEntity(_0x359731,_0x48081d){return function(_0x5b24a2){if(_0x5b24a2){return _0x5b24a2['destroy']()['then'](function(){_0x359731[_0x9d44('0x18')](0xcc)[_0x9d44('0x17')]();});}};}function handleEntityNotFound(_0x4aac70,_0x4f1d81){return function(_0x13b99f){if(!_0x13b99f){_0x4aac70[_0x9d44('0x16')](0x194);}return _0x13b99f;};}function handleError(_0x2c733f,_0x2b9c71){_0x2b9c71=_0x2b9c71||0x1f4;return function(_0x566b82){logger[_0x9d44('0x22')](_0x566b82[_0x9d44('0x23')]);if(_0x566b82['name']){delete _0x566b82[_0x9d44('0x24')];}_0x2c733f[_0x9d44('0x18')](_0x2b9c71)['send'](_0x566b82);};}exports['index']=function(_0x323e70,_0x58dbf6){var _0x3bebd9={},_0x18bc3c={},_0x32ffdd={'count':0x0,'rows':[]};var _0x5170f2=_['map'](db['OpenchannelTransferReport'][_0x9d44('0x25')],function(_0x50046b){return{'name':_0x50046b['fieldName'],'type':_0x50046b['type'][_0x9d44('0x26')]};});_0x18bc3c[_0x9d44('0x27')]=_['map'](_0x5170f2,'name');_0x18bc3c[_0x9d44('0x28')]=_[_0x9d44('0x29')](_0x323e70['query']);_0x18bc3c['filters']=_[_0x9d44('0x2a')](_0x18bc3c[_0x9d44('0x27')],_0x18bc3c['query']);_0x3bebd9['attributes']=_[_0x9d44('0x2a')](_0x18bc3c[_0x9d44('0x27')],qs[_0x9d44('0x2b')](_0x323e70['query'][_0x9d44('0x2b')]));_0x3bebd9[_0x9d44('0x2c')]=_0x3bebd9[_0x9d44('0x2c')][_0x9d44('0x2d')]?_0x3bebd9[_0x9d44('0x2c')]:_0x18bc3c[_0x9d44('0x27')];if(!_0x323e70[_0x9d44('0x28')]['hasOwnProperty']('nolimit')){_0x3bebd9[_0x9d44('0x1c')]=qs[_0x9d44('0x1c')](_0x323e70[_0x9d44('0x28')][_0x9d44('0x1c')]);_0x3bebd9[_0x9d44('0x1a')]=qs[_0x9d44('0x1a')](_0x323e70[_0x9d44('0x28')][_0x9d44('0x1a')]);}_0x3bebd9['order']=qs['sort'](_0x323e70['query'][_0x9d44('0x2e')]);_0x3bebd9['where']=qs[_0x9d44('0x2f')](_[_0x9d44('0x30')](_0x323e70['query'],_0x18bc3c[_0x9d44('0x2f')]),_0x5170f2);if(_0x323e70[_0x9d44('0x28')][_0x9d44('0x31')]){_0x3bebd9[_0x9d44('0x32')]=_[_0x9d44('0x33')](_0x3bebd9[_0x9d44('0x32')],{'$or':_[_0x9d44('0x34')](_0x5170f2,function(_0x3896a1){if(_0x3896a1[_0x9d44('0x35')]!==_0x9d44('0x36')){var _0x5e76d7={};_0x5e76d7[_0x3896a1[_0x9d44('0x24')]]={'$like':'%'+_0x323e70[_0x9d44('0x28')][_0x9d44('0x31')]+'%'};return _0x5e76d7;}})});}_0x3bebd9=_[_0x9d44('0x33')]({},_0x3bebd9,_0x323e70[_0x9d44('0x37')]);var _0x23bb25={'where':_0x3bebd9['where']};return db[_0x9d44('0x38')][_0x9d44('0x1d')](_0x23bb25)['then'](function(_0x1d5292){_0x32ffdd[_0x9d44('0x1d')]=_0x1d5292;if(_0x323e70['query'][_0x9d44('0x39')]){_0x3bebd9[_0x9d44('0x3a')]=[{'all':!![]}];}return db[_0x9d44('0x38')][_0x9d44('0x3b')](_0x3bebd9);})[_0x9d44('0x21')](function(_0x36a8e3){_0x32ffdd[_0x9d44('0x3c')]=_0x36a8e3;return _0x32ffdd;})[_0x9d44('0x21')](respondWithFilteredResult(_0x58dbf6,_0x3bebd9))[_0x9d44('0x3d')](handleError(_0x58dbf6,null));};exports[_0x9d44('0x3e')]=function(_0x3b1689,_0x20d6df){var _0x32fd0e={'raw':!![],'where':{'id':_0x3b1689[_0x9d44('0x3f')]['id']}},_0x814b89={};_0x814b89[_0x9d44('0x27')]=_[_0x9d44('0x29')](db['OpenchannelTransferReport'][_0x9d44('0x25')]);_0x814b89[_0x9d44('0x28')]=_['keys'](_0x3b1689['query']);_0x814b89[_0x9d44('0x2f')]=_[_0x9d44('0x2a')](_0x814b89[_0x9d44('0x27')],_0x814b89[_0x9d44('0x28')]);_0x32fd0e[_0x9d44('0x2c')]=_['intersection'](_0x814b89[_0x9d44('0x27')],qs['fields'](_0x3b1689[_0x9d44('0x28')][_0x9d44('0x2b')]));_0x32fd0e[_0x9d44('0x2c')]=_0x32fd0e['attributes'][_0x9d44('0x2d')]?_0x32fd0e[_0x9d44('0x2c')]:_0x814b89[_0x9d44('0x27')];if(_0x3b1689[_0x9d44('0x28')][_0x9d44('0x39')]){_0x32fd0e['include']=[{'all':!![]}];}_0x32fd0e=_['merge']({},_0x32fd0e,_0x3b1689[_0x9d44('0x37')]);return db[_0x9d44('0x38')][_0x9d44('0x40')](_0x32fd0e)[_0x9d44('0x21')](handleEntityNotFound(_0x20d6df,null))[_0x9d44('0x21')](respondWithResult(_0x20d6df,null))[_0x9d44('0x3d')](handleError(_0x20d6df,null));};exports[_0x9d44('0x41')]=function(_0xd52234,_0x4cc94a){return db[_0x9d44('0x38')][_0x9d44('0x41')](_0xd52234['body'],{})['then'](respondWithResult(_0x4cc94a,0xc9))['catch'](handleError(_0x4cc94a,null));};exports[_0x9d44('0x20')]=function(_0x4c1a6c,_0x308614){if(_0x4c1a6c['body']['id']){delete _0x4c1a6c[_0x9d44('0x42')]['id'];}return db[_0x9d44('0x38')]['find']({'where':{'id':_0x4c1a6c[_0x9d44('0x3f')]['id']}})[_0x9d44('0x21')](handleEntityNotFound(_0x308614,null))[_0x9d44('0x21')](saveUpdates(_0x4c1a6c[_0x9d44('0x42')],null))[_0x9d44('0x21')](respondWithResult(_0x308614,null))['catch'](handleError(_0x308614,null));};exports['destroy']=function(_0x360332,_0x54dda7){return db['OpenchannelTransferReport'][_0x9d44('0x40')]({'where':{'id':_0x360332['params']['id']}})[_0x9d44('0x21')](handleEntityNotFound(_0x54dda7,null))[_0x9d44('0x21')](removeEntity(_0x54dda7,null))[_0x9d44('0x3d')](handleError(_0x54dda7,null));};exports['describe']=function(_0x17517c,_0x28d44c){return db['OpenchannelTransferReport'][_0x9d44('0x43')]()['then'](respondWithResult(_0x28d44c,null))[_0x9d44('0x3d')](handleError(_0x28d44c,null));}; \ No newline at end of file +var _0x6a96=['end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','OpenchannelTransferReport','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x93e36c,_0xa64edc){var _0x459537=function(_0x381644){while(--_0x381644){_0x93e36c['push'](_0x93e36c['shift']());}};_0x459537(++_0xa64edc);}(_0x6a96,0x77));var _0x66a9=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0x6a96[_0xd3348b];return _0x583cdc;};'use strict';var emlformat=require(_0x66a9('0x0'));var rimraf=require(_0x66a9('0x1'));var zipdir=require(_0x66a9('0x2'));var jsonpatch=require(_0x66a9('0x3'));var rp=require(_0x66a9('0x4'));var moment=require(_0x66a9('0x5'));var BPromise=require(_0x66a9('0x6'));var Mustache=require(_0x66a9('0x7'));var util=require(_0x66a9('0x8'));var path=require(_0x66a9('0x9'));var sox=require('sox');var csv=require(_0x66a9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66a9('0xb'));var _=require(_0x66a9('0xc'));var squel=require('squel');var crypto=require(_0x66a9('0xd'));var jsforce=require(_0x66a9('0xe'));var deskjs=require(_0x66a9('0xf'));var toCsv=require(_0x66a9('0xa'));var querystring=require('querystring');var Papa=require(_0x66a9('0x10'));var Redis=require(_0x66a9('0x11'));var authService=require(_0x66a9('0x12'));var qs=require(_0x66a9('0x13'));var as=require(_0x66a9('0x14'));var hardwareService=require(_0x66a9('0x15'));var logger=require('../../config/logger')(_0x66a9('0x16'));var utils=require(_0x66a9('0x17'));var config=require(_0x66a9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a9('0x19'))['db'];function respondWithStatusCode(_0xbbb45a,_0x44fbd9){_0x44fbd9=_0x44fbd9||0xcc;return function(_0x4a59b){if(_0x4a59b){return _0xbbb45a[_0x66a9('0x1a')](_0x44fbd9);}return _0xbbb45a['status'](_0x44fbd9)[_0x66a9('0x1b')]();};}function respondWithResult(_0x248887,_0x3fbafc){_0x3fbafc=_0x3fbafc||0xc8;return function(_0x3613d7){if(_0x3613d7){return _0x248887[_0x66a9('0x1c')](_0x3fbafc)[_0x66a9('0x1d')](_0x3613d7);}};}function respondWithFilteredResult(_0x378f71,_0xa8c2d3){return function(_0x5e71de){if(_0x5e71de){var _0x1245f6=typeof _0xa8c2d3[_0x66a9('0x1e')]==='undefined'&&typeof _0xa8c2d3[_0x66a9('0x1f')]===_0x66a9('0x20');var _0xe22b3e=_0x5e71de[_0x66a9('0x21')];var _0x400e8a=_0x1245f6?0x0:_0xa8c2d3[_0x66a9('0x1e')];var _0x107d58=_0x1245f6?_0x5e71de[_0x66a9('0x21')]:_0xa8c2d3[_0x66a9('0x1e')]+_0xa8c2d3[_0x66a9('0x1f')];var _0x450ee7;if(_0x107d58>=_0xe22b3e){_0x107d58=_0xe22b3e;_0x450ee7=0xc8;}else{_0x450ee7=0xce;}_0x378f71[_0x66a9('0x1c')](_0x450ee7);return _0x378f71['set'](_0x66a9('0x22'),_0x400e8a+'-'+_0x107d58+'/'+_0xe22b3e)[_0x66a9('0x1d')](_0x5e71de);}return null;};}function patchUpdates(_0x1ed300){return function(_0x66be74){try{jsonpatch[_0x66a9('0x23')](_0x66be74,_0x1ed300,!![]);}catch(_0x56d88f){return BPromise[_0x66a9('0x24')](_0x56d88f);}return _0x66be74[_0x66a9('0x25')]();};}function saveUpdates(_0x3d78ac,_0x2a89c3){return function(_0x243f55){if(_0x243f55){return _0x243f55['update'](_0x3d78ac)[_0x66a9('0x26')](function(_0x1d254c){return _0x1d254c;});}return null;};}function removeEntity(_0x42f312,_0x33ffb1){return function(_0x39a5cb){if(_0x39a5cb){return _0x39a5cb[_0x66a9('0x27')]()[_0x66a9('0x26')](function(){_0x42f312['status'](0xcc)[_0x66a9('0x1b')]();});}};}function handleEntityNotFound(_0x1fd929,_0x181e28){return function(_0x230771){if(!_0x230771){_0x1fd929[_0x66a9('0x1a')](0x194);}return _0x230771;};}function handleError(_0x243d19,_0x4ca3cd){_0x4ca3cd=_0x4ca3cd||0x1f4;return function(_0x115ba9){logger[_0x66a9('0x28')](_0x115ba9[_0x66a9('0x29')]);if(_0x115ba9[_0x66a9('0x2a')]){delete _0x115ba9[_0x66a9('0x2a')];}_0x243d19[_0x66a9('0x1c')](_0x4ca3cd)[_0x66a9('0x2b')](_0x115ba9);};}exports['index']=function(_0x1f6dd6,_0x153271){var _0x45125e={},_0x245387={},_0x438c6d={'count':0x0,'rows':[]};var _0x16ccba=_[_0x66a9('0x2c')](db['OpenchannelTransferReport'][_0x66a9('0x2d')],function(_0x301334){return{'name':_0x301334['fieldName'],'type':_0x301334[_0x66a9('0x2e')]['key']};});_0x245387[_0x66a9('0x2f')]=_[_0x66a9('0x2c')](_0x16ccba,_0x66a9('0x2a'));_0x245387['query']=_[_0x66a9('0x30')](_0x1f6dd6[_0x66a9('0x31')]);_0x245387[_0x66a9('0x32')]=_['intersection'](_0x245387[_0x66a9('0x2f')],_0x245387[_0x66a9('0x31')]);_0x45125e['attributes']=_[_0x66a9('0x33')](_0x245387[_0x66a9('0x2f')],qs[_0x66a9('0x34')](_0x1f6dd6['query']['fields']));_0x45125e[_0x66a9('0x35')]=_0x45125e[_0x66a9('0x35')][_0x66a9('0x36')]?_0x45125e[_0x66a9('0x35')]:_0x245387[_0x66a9('0x2f')];if(!_0x1f6dd6[_0x66a9('0x31')]['hasOwnProperty']('nolimit')){_0x45125e[_0x66a9('0x1f')]=qs['limit'](_0x1f6dd6[_0x66a9('0x31')][_0x66a9('0x1f')]);_0x45125e[_0x66a9('0x1e')]=qs[_0x66a9('0x1e')](_0x1f6dd6['query'][_0x66a9('0x1e')]);}_0x45125e[_0x66a9('0x37')]=qs[_0x66a9('0x38')](_0x1f6dd6[_0x66a9('0x31')][_0x66a9('0x38')]);_0x45125e[_0x66a9('0x39')]=qs[_0x66a9('0x32')](_[_0x66a9('0x3a')](_0x1f6dd6[_0x66a9('0x31')],_0x245387[_0x66a9('0x32')]),_0x16ccba);if(_0x1f6dd6['query'][_0x66a9('0x3b')]){_0x45125e[_0x66a9('0x39')]=_[_0x66a9('0x3c')](_0x45125e[_0x66a9('0x39')],{'$or':_[_0x66a9('0x2c')](_0x16ccba,function(_0x2ecc41){if(_0x2ecc41['type']!=='VIRTUAL'){var _0x200672={};_0x200672[_0x2ecc41[_0x66a9('0x2a')]]={'$like':'%'+_0x1f6dd6[_0x66a9('0x31')][_0x66a9('0x3b')]+'%'};return _0x200672;}})});}_0x45125e=_[_0x66a9('0x3c')]({},_0x45125e,_0x1f6dd6[_0x66a9('0x3d')]);var _0x1a0620={'where':_0x45125e[_0x66a9('0x39')]};return db[_0x66a9('0x3e')]['count'](_0x1a0620)['then'](function(_0x34f220){_0x438c6d[_0x66a9('0x21')]=_0x34f220;if(_0x1f6dd6['query'][_0x66a9('0x3f')]){_0x45125e[_0x66a9('0x40')]=[{'all':!![]}];}return db[_0x66a9('0x3e')]['findAll'](_0x45125e);})[_0x66a9('0x26')](function(_0x2b532d){_0x438c6d[_0x66a9('0x41')]=_0x2b532d;return _0x438c6d;})[_0x66a9('0x26')](respondWithFilteredResult(_0x153271,_0x45125e))['catch'](handleError(_0x153271,null));};exports[_0x66a9('0x42')]=function(_0x1d7c41,_0x5edb8d){var _0x51e603={'raw':!![],'where':{'id':_0x1d7c41[_0x66a9('0x43')]['id']}},_0x11983e={};_0x11983e[_0x66a9('0x2f')]=_['keys'](db[_0x66a9('0x3e')]['rawAttributes']);_0x11983e['query']=_[_0x66a9('0x30')](_0x1d7c41['query']);_0x11983e['filters']=_[_0x66a9('0x33')](_0x11983e[_0x66a9('0x2f')],_0x11983e[_0x66a9('0x31')]);_0x51e603['attributes']=_['intersection'](_0x11983e[_0x66a9('0x2f')],qs['fields'](_0x1d7c41[_0x66a9('0x31')][_0x66a9('0x34')]));_0x51e603[_0x66a9('0x35')]=_0x51e603['attributes'][_0x66a9('0x36')]?_0x51e603['attributes']:_0x11983e[_0x66a9('0x2f')];if(_0x1d7c41[_0x66a9('0x31')]['includeAll']){_0x51e603['include']=[{'all':!![]}];}_0x51e603=_[_0x66a9('0x3c')]({},_0x51e603,_0x1d7c41[_0x66a9('0x3d')]);return db['OpenchannelTransferReport'][_0x66a9('0x44')](_0x51e603)['then'](handleEntityNotFound(_0x5edb8d,null))[_0x66a9('0x26')](respondWithResult(_0x5edb8d,null))[_0x66a9('0x45')](handleError(_0x5edb8d,null));};exports[_0x66a9('0x46')]=function(_0x4bb221,_0x43748f){return db[_0x66a9('0x3e')][_0x66a9('0x46')](_0x4bb221[_0x66a9('0x47')],{})[_0x66a9('0x26')](respondWithResult(_0x43748f,0xc9))[_0x66a9('0x45')](handleError(_0x43748f,null));};exports['update']=function(_0x4b345a,_0x48e32f){if(_0x4b345a[_0x66a9('0x47')]['id']){delete _0x4b345a[_0x66a9('0x47')]['id'];}return db[_0x66a9('0x3e')][_0x66a9('0x44')]({'where':{'id':_0x4b345a[_0x66a9('0x43')]['id']}})[_0x66a9('0x26')](handleEntityNotFound(_0x48e32f,null))['then'](saveUpdates(_0x4b345a[_0x66a9('0x47')],null))[_0x66a9('0x26')](respondWithResult(_0x48e32f,null))[_0x66a9('0x45')](handleError(_0x48e32f,null));};exports[_0x66a9('0x27')]=function(_0xefeecb,_0x412789){return db[_0x66a9('0x3e')]['find']({'where':{'id':_0xefeecb[_0x66a9('0x43')]['id']}})['then'](handleEntityNotFound(_0x412789,null))[_0x66a9('0x26')](removeEntity(_0x412789,null))['catch'](handleError(_0x412789,null));};exports[_0x66a9('0x48')]=function(_0x441d5f,_0x46af87){return db[_0x66a9('0x3e')][_0x66a9('0x48')]()[_0x66a9('0x26')](respondWithResult(_0x46af87,null))[_0x66a9('0x45')](handleError(_0x46af87,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 32f90fb..92239dd 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 _0xdc20=['bluebird','request-promise','path','./openchannelTransferReport.attributes','exports','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x2ac0b6,_0x201908){var _0x6cde83=function(_0x4dc31f){while(--_0x4dc31f){_0x2ac0b6['push'](_0x2ac0b6['shift']());}};_0x6cde83(++_0x201908);}(_0xdc20,0x1eb));var _0x0dc2=function(_0x455f83,_0x1322c3){_0x455f83=_0x455f83-0x0;var _0xadee1d=_0xdc20[_0x455f83];return _0xadee1d;};'use strict';var _=require(_0x0dc2('0x0'));var util=require(_0x0dc2('0x1'));var logger=require(_0x0dc2('0x2'))('api');var moment=require(_0x0dc2('0x3'));var BPromise=require(_0x0dc2('0x4'));var rp=require(_0x0dc2('0x5'));var fs=require('fs');var path=require(_0x0dc2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0dc2('0x7'));module[_0x0dc2('0x8')]=function(_0x1f38bf,_0x118565){return _0x1f38bf['define']('OpenchannelTransferReport',attributes,{'tableName':_0x0dc2('0x9'),'paranoid':![],'indexes':[{'name':_0x0dc2('0xa'),'fields':[_0x0dc2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1dba=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x438862,_0xe9dbac){var _0xd89103=function(_0x2656cb){while(--_0x2656cb){_0x438862['push'](_0x438862['shift']());}};_0xd89103(++_0xe9dbac);}(_0x1dba,0x76));var _0xa1db=function(_0xb64d9c,_0xea1692){_0xb64d9c=_0xb64d9c-0x0;var _0x3dd4d0=_0x1dba[_0xb64d9c];return _0x3dd4d0;};'use strict';var _=require('lodash');var util=require(_0xa1db('0x0'));var logger=require(_0xa1db('0x1'))('api');var moment=require(_0xa1db('0x2'));var BPromise=require(_0xa1db('0x3'));var rp=require(_0xa1db('0x4'));var fs=require('fs');var path=require(_0xa1db('0x5'));var rimraf=require(_0xa1db('0x6'));var config=require('../../config/environment');var attributes=require(_0xa1db('0x7'));module[_0xa1db('0x8')]=function(_0x257018,_0x506c39){return _0x257018[_0xa1db('0x9')](_0xa1db('0xa'),attributes,{'tableName':_0xa1db('0xb'),'paranoid':![],'indexes':[{'name':_0xa1db('0xc'),'fields':[_0xa1db('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fb1b78f..567c8ad 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 _0x91c6=['request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5aaefc,_0x582a57){var _0x2eb88a=function(_0x356fe8){while(--_0x356fe8){_0x5aaefc['push'](_0x5aaefc['shift']());}};_0x2eb88a(++_0x582a57);}(_0x91c6,0xf9));var _0x691c=function(_0x5ac216,_0x16f608){_0x5ac216=_0x5ac216-0x0;var _0x5f1b75=_0x91c6[_0x5ac216];return _0x5f1b75;};'use strict';var _=require(_0x691c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x691c('0x1'));var rs=require(_0x691c('0x2'));var fs=require('fs');var Redis=require(_0x691c('0x3'));var db=require(_0x691c('0x4'))['db'];var utils=require(_0x691c('0x5'));var logger=require('../../config/logger')(_0x691c('0x6'));var config=require(_0x691c('0x7'));var jayson=require(_0x691c('0x8'));var client=jayson[_0x691c('0x9')][_0x691c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29876a,_0x5ccbe0,_0x93b7b0){return new BPromise(function(_0x40629a,_0xda904f){return client[_0x691c('0xb')](_0x29876a,_0x93b7b0)['then'](function(_0x2cfa1f){logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,'request\x20sent');logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x5ccbe0,_0x691c('0xe'),JSON[_0x691c('0xf')](_0x2cfa1f));if(_0x2cfa1f[_0x691c('0x10')]){if(_0x2cfa1f[_0x691c('0x10')]['code']===0x1f4){logger['error'](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);return _0xda904f(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')]['message']);return _0x40629a(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}else{logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,_0x691c('0xe'));_0x40629a(_0x2cfa1f[_0x691c('0x12')][_0x691c('0x11')]);}})[_0x691c('0x13')](function(_0x482351){logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x482351);_0xda904f(_0x482351);});});} \ No newline at end of file +var _0x943c=['stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x346f10,_0x4a6df4){var _0x219317=function(_0x4b7c1d){while(--_0x4b7c1d){_0x346f10['push'](_0x346f10['shift']());}};_0x219317(++_0x4a6df4);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var moment=require(_0xc943('0x2'));var BPromise=require(_0xc943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc943('0x4'))['db'];var utils=require(_0xc943('0x5'));var logger=require(_0xc943('0x6'))('rpc');var config=require(_0xc943('0x7'));var jayson=require(_0xc943('0x8'));var client=jayson[_0xc943('0x9')][_0xc943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b73ad,_0x4091fd,_0x3f718f){return new BPromise(function(_0x56e665,_0x3ec7da){return client[_0xc943('0xb')](_0x1b73ad,_0x3f718f)[_0xc943('0xc')](function(_0x455eed){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));logger[_0xc943('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4091fd,'request\x20sent',JSON[_0xc943('0xf')](_0x455eed));if(_0x455eed[_0xc943('0x10')]){if(_0x455eed[_0xc943('0x10')][_0xc943('0x11')]===0x1f4){logger[_0xc943('0x10')](_0xc943('0x12'),_0x4091fd,_0x455eed['error'][_0xc943('0x13')]);return _0x3ec7da(_0x455eed[_0xc943('0x10')]['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4091fd,_0x455eed[_0xc943('0x10')][_0xc943('0x13')]);return _0x56e665(_0x455eed['error'][_0xc943('0x13')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));_0x56e665(_0x455eed['result'][_0xc943('0x13')]);}})[_0xc943('0x14')](function(_0x1eb50a){logger[_0xc943('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4091fd,_0x1eb50a);_0x3ec7da(_0x1eb50a);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 50b59e2..6e46396 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 _0x6e9b=['index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated'];(function(_0x323c13,_0x3fe07a){var _0x581470=function(_0x46b002){while(--_0x46b002){_0x323c13['push'](_0x323c13['shift']());}};_0x581470(++_0x3fe07a);}(_0x6e9b,0xf7));var _0xb6e9=function(_0x47f86d,_0x1c8566){_0x47f86d=_0x47f86d-0x0;var _0x356602=_0x6e9b[_0x47f86d];return _0x356602;};'use strict';var multer=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var path=require(_0xb6e9('0x2'));var timeout=require(_0xb6e9('0x3'));var express=require(_0xb6e9('0x4'));var router=express[_0xb6e9('0x5')]();var fs_extra=require(_0xb6e9('0x6'));var auth=require(_0xb6e9('0x7'));var interaction=require(_0xb6e9('0x8'));var config=require(_0xb6e9('0x9'));var controller=require(_0xb6e9('0xa'));router[_0xb6e9('0xb')]('/',auth[_0xb6e9('0xc')](),controller[_0xb6e9('0xd')]);router[_0xb6e9('0xb')](_0xb6e9('0xe'),auth[_0xb6e9('0xc')](),controller[_0xb6e9('0xf')]);router['post']('/',auth[_0xb6e9('0xc')](),controller[_0xb6e9('0x10')]);router['put'](_0xb6e9('0xe'),auth['isAuthenticated'](),controller[_0xb6e9('0x11')]);router[_0xb6e9('0x12')](_0xb6e9('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xb6e9('0x13')]=router; \ No newline at end of file +var _0x0f37=['create','delete','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post'];(function(_0x4e1c6f,_0x4576db){var _0x32eb65=function(_0x17753d){while(--_0x17753d){_0x4e1c6f['push'](_0x4e1c6f['shift']());}};_0x32eb65(++_0x4576db);}(_0x0f37,0x1c4));var _0x70f3=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0x0f37[_0x14ec75];return _0x40b9e9;};'use strict';var multer=require('multer');var util=require(_0x70f3('0x0'));var path=require(_0x70f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x70f3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70f3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x70f3('0x4'));var controller=require('./pause.controller');router[_0x70f3('0x5')]('/',auth[_0x70f3('0x6')](),controller['index']);router[_0x70f3('0x5')](_0x70f3('0x7'),auth[_0x70f3('0x6')](),controller[_0x70f3('0x8')]);router[_0x70f3('0x9')]('/',auth[_0x70f3('0x6')](),controller[_0x70f3('0xa')]);router['put']('/:id',auth[_0x70f3('0x6')](),controller['update']);router[_0x70f3('0xb')](_0x70f3('0x7'),auth['isAuthenticated'](),controller[_0x70f3('0xc')]);module[_0x70f3('0xd')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 423f6aa..26da57a 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 _0x0841=['name','sequelize','exports','STRING'];(function(_0x4cf763,_0x1fb6dc){var _0x40e997=function(_0x4b6f14){while(--_0x4b6f14){_0x4cf763['push'](_0x4cf763['shift']());}};_0x40e997(++_0x1fb6dc);}(_0x0841,0x161));var _0x1084=function(_0x40c02d,_0x279a9d){_0x40c02d=_0x40c02d-0x0;var _0x2ea328=_0x0841[_0x40c02d];return _0x2ea328;};'use strict';var Sequelize=require(_0x1084('0x0'));module[_0x1084('0x1')]={'name':{'type':Sequelize[_0x1084('0x2')],'unique':_0x1084('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1084('0x2')]}}; \ No newline at end of file +var _0x03a9=['sequelize','STRING','name'];(function(_0x629f96,_0x5bd607){var _0x3ac280=function(_0x3ea0f8){while(--_0x3ea0f8){_0x629f96['push'](_0x629f96['shift']());}};_0x3ac280(++_0x5bd607);}(_0x03a9,0xbd));var _0x903a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x03a9[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x903a('0x0'));module['exports']={'name':{'type':Sequelize[_0x903a('0x1')],'unique':_0x903a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x903a('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6fec5b1..53da0fe 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 _0xce4f=['merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','user','role','Pauses','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Pause','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xce4f,0x1ca));var _0xfce4=function(_0x1923d5,_0x273023){_0x1923d5=_0x1923d5-0x0;var _0x3273e1=_0xce4f[_0x1923d5];return _0x3273e1;};'use strict';var emlformat=require(_0xfce4('0x0'));var rimraf=require(_0xfce4('0x1'));var zipdir=require(_0xfce4('0x2'));var jsonpatch=require(_0xfce4('0x3'));var rp=require('request-promise');var moment=require(_0xfce4('0x4'));var BPromise=require(_0xfce4('0x5'));var Mustache=require(_0xfce4('0x6'));var util=require(_0xfce4('0x7'));var path=require(_0xfce4('0x8'));var sox=require(_0xfce4('0x9'));var csv=require(_0xfce4('0xa'));var ejs=require(_0xfce4('0xb'));var fs=require('fs');var fs_extra=require(_0xfce4('0xc'));var _=require(_0xfce4('0xd'));var squel=require('squel');var crypto=require(_0xfce4('0xe'));var jsforce=require(_0xfce4('0xf'));var deskjs=require(_0xfce4('0x10'));var toCsv=require(_0xfce4('0xa'));var querystring=require(_0xfce4('0x11'));var Papa=require(_0xfce4('0x12'));var Redis=require('ioredis');var authService=require(_0xfce4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfce4('0x14'));var hardwareService=require(_0xfce4('0x15'));var logger=require('../../config/logger')(_0xfce4('0x16'));var utils=require(_0xfce4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfce4('0x18'));var db=require(_0xfce4('0x19'))['db'];function respondWithStatusCode(_0x4367c3,_0x22e11c){_0x22e11c=_0x22e11c||0xcc;return function(_0x27bf4c){if(_0x27bf4c){return _0x4367c3[_0xfce4('0x1a')](_0x22e11c);}return _0x4367c3['status'](_0x22e11c)[_0xfce4('0x1b')]();};}function respondWithResult(_0x580d23,_0x2cfa35){_0x2cfa35=_0x2cfa35||0xc8;return function(_0x2cda0a){if(_0x2cda0a){return _0x580d23[_0xfce4('0x1c')](_0x2cfa35)['json'](_0x2cda0a);}};}function respondWithFilteredResult(_0x1c0706,_0x5b39a1){return function(_0xeab542){if(_0xeab542){var _0x1c1905=typeof _0x5b39a1[_0xfce4('0x1d')]===_0xfce4('0x1e')&&typeof _0x5b39a1[_0xfce4('0x1f')]===_0xfce4('0x1e');var _0x2c4728=_0xeab542[_0xfce4('0x20')];var _0x5b475c=_0x1c1905?0x0:_0x5b39a1[_0xfce4('0x1d')];var _0x4380bd=_0x1c1905?_0xeab542[_0xfce4('0x20')]:_0x5b39a1[_0xfce4('0x1d')]+_0x5b39a1[_0xfce4('0x1f')];var _0x103e6d;if(_0x4380bd>=_0x2c4728){_0x4380bd=_0x2c4728;_0x103e6d=0xc8;}else{_0x103e6d=0xce;}_0x1c0706['status'](_0x103e6d);return _0x1c0706[_0xfce4('0x21')](_0xfce4('0x22'),_0x5b475c+'-'+_0x4380bd+'/'+_0x2c4728)[_0xfce4('0x23')](_0xeab542);}return null;};}function patchUpdates(_0x20aa01){return function(_0x55f6b5){try{jsonpatch[_0xfce4('0x24')](_0x55f6b5,_0x20aa01,!![]);}catch(_0x24bd03){return BPromise['reject'](_0x24bd03);}return _0x55f6b5[_0xfce4('0x25')]();};}function saveUpdates(_0xabb7a9,_0x5629a4){return function(_0x58e600){if(_0x58e600){return _0x58e600[_0xfce4('0x26')](_0xabb7a9)['then'](function(_0x4c3cf8){return _0x4c3cf8;});}return null;};}function removeEntity(_0x57f2b0,_0x53c1a5){return function(_0x23840e){if(_0x23840e){return _0x23840e['destroy']()[_0xfce4('0x27')](function(){var _0x1ba3e4=_0x23840e[_0xfce4('0x28')]({'plain':!![]});var _0x1700d2='Pauses';return db[_0xfce4('0x29')][_0xfce4('0x2a')]({'where':{'type':_0x1700d2,'resourceId':_0x1ba3e4['id']}})[_0xfce4('0x27')](function(){return _0x23840e;});})[_0xfce4('0x27')](function(){_0x57f2b0[_0xfce4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a50bc,_0x162205){return function(_0x281f95){if(!_0x281f95){_0x4a50bc['sendStatus'](0x194);}return _0x281f95;};}function handleError(_0x4d557c,_0x3a46bc){_0x3a46bc=_0x3a46bc||0x1f4;return function(_0x3e84f4){logger[_0xfce4('0x2b')](_0x3e84f4[_0xfce4('0x2c')]);if(_0x3e84f4['name']){delete _0x3e84f4[_0xfce4('0x2d')];}_0x4d557c[_0xfce4('0x1c')](_0x3a46bc)[_0xfce4('0x2e')](_0x3e84f4);};}exports[_0xfce4('0x2f')]=function(_0x1a6136,_0x475c25){var _0x2a023d={},_0x221187={},_0x2d3803={'count':0x0,'rows':[]};var _0x26edff=_['map'](db[_0xfce4('0x30')]['rawAttributes'],function(_0x1e8def){return{'name':_0x1e8def['fieldName'],'type':_0x1e8def[_0xfce4('0x31')][_0xfce4('0x32')]};});_0x221187[_0xfce4('0x33')]=_[_0xfce4('0x34')](_0x26edff,'name');_0x221187['query']=_['keys'](_0x1a6136[_0xfce4('0x35')]);_0x221187['filters']=_[_0xfce4('0x36')](_0x221187[_0xfce4('0x33')],_0x221187[_0xfce4('0x35')]);_0x2a023d['attributes']=_[_0xfce4('0x36')](_0x221187[_0xfce4('0x33')],qs[_0xfce4('0x37')](_0x1a6136[_0xfce4('0x35')][_0xfce4('0x37')]));_0x2a023d[_0xfce4('0x38')]=_0x2a023d[_0xfce4('0x38')][_0xfce4('0x39')]?_0x2a023d[_0xfce4('0x38')]:_0x221187[_0xfce4('0x33')];if(!_0x1a6136[_0xfce4('0x35')][_0xfce4('0x3a')](_0xfce4('0x3b'))){_0x2a023d[_0xfce4('0x1f')]=qs['limit'](_0x1a6136[_0xfce4('0x35')][_0xfce4('0x1f')]);_0x2a023d[_0xfce4('0x1d')]=qs['offset'](_0x1a6136['query'][_0xfce4('0x1d')]);}_0x2a023d[_0xfce4('0x3c')]=qs[_0xfce4('0x3d')](_0x1a6136[_0xfce4('0x35')][_0xfce4('0x3d')]);_0x2a023d['where']=qs[_0xfce4('0x3e')](_['pick'](_0x1a6136[_0xfce4('0x35')],_0x221187[_0xfce4('0x3e')]),_0x26edff);if(_0x1a6136[_0xfce4('0x35')][_0xfce4('0x3f')]){_0x2a023d['where']=_[_0xfce4('0x40')](_0x2a023d[_0xfce4('0x41')],{'$or':_['map'](_0x26edff,function(_0x11d8ec){if(_0x11d8ec[_0xfce4('0x31')]!==_0xfce4('0x42')){var _0x5ea715={};_0x5ea715[_0x11d8ec[_0xfce4('0x2d')]]={'$like':'%'+_0x1a6136['query']['filter']+'%'};return _0x5ea715;}})});}_0x2a023d=_[_0xfce4('0x40')]({},_0x2a023d,_0x1a6136[_0xfce4('0x43')]);var _0x45c8a4={'where':_0x2a023d[_0xfce4('0x41')]};return db['Pause']['count'](_0x45c8a4)[_0xfce4('0x27')](function(_0x35d2e9){_0x2d3803[_0xfce4('0x20')]=_0x35d2e9;if(_0x1a6136[_0xfce4('0x35')][_0xfce4('0x44')]){_0x2a023d[_0xfce4('0x45')]=[{'all':!![]}];}return db[_0xfce4('0x30')][_0xfce4('0x46')](_0x2a023d);})[_0xfce4('0x27')](function(_0x4d0348){_0x2d3803[_0xfce4('0x47')]=_0x4d0348;return _0x2d3803;})[_0xfce4('0x27')](respondWithFilteredResult(_0x475c25,_0x2a023d))[_0xfce4('0x48')](handleError(_0x475c25,null));};exports[_0xfce4('0x49')]=function(_0x1b2d03,_0xa5adce){var _0x3a188f={'raw':!![],'where':{'id':_0x1b2d03[_0xfce4('0x4a')]['id']}},_0x481be9={};_0x481be9[_0xfce4('0x33')]=_[_0xfce4('0x4b')](db[_0xfce4('0x30')][_0xfce4('0x4c')]);_0x481be9[_0xfce4('0x35')]=_[_0xfce4('0x4b')](_0x1b2d03[_0xfce4('0x35')]);_0x481be9[_0xfce4('0x3e')]=_[_0xfce4('0x36')](_0x481be9[_0xfce4('0x33')],_0x481be9[_0xfce4('0x35')]);_0x3a188f['attributes']=_[_0xfce4('0x36')](_0x481be9[_0xfce4('0x33')],qs[_0xfce4('0x37')](_0x1b2d03[_0xfce4('0x35')]['fields']));_0x3a188f[_0xfce4('0x38')]=_0x3a188f['attributes'][_0xfce4('0x39')]?_0x3a188f[_0xfce4('0x38')]:_0x481be9[_0xfce4('0x33')];if(_0x1b2d03[_0xfce4('0x35')][_0xfce4('0x44')]){_0x3a188f[_0xfce4('0x45')]=[{'all':!![]}];}_0x3a188f=_[_0xfce4('0x40')]({},_0x3a188f,_0x1b2d03[_0xfce4('0x43')]);return db[_0xfce4('0x30')]['find'](_0x3a188f)[_0xfce4('0x27')](handleEntityNotFound(_0xa5adce,null))[_0xfce4('0x27')](respondWithResult(_0xa5adce,null))['catch'](handleError(_0xa5adce,null));};exports[_0xfce4('0x4d')]=function(_0x4166cf,_0x175df4){return db[_0xfce4('0x30')][_0xfce4('0x4d')](_0x4166cf[_0xfce4('0x4e')],{})['then'](function(_0x20dff9){var _0x52d3fa=_0x4166cf[_0xfce4('0x4f')][_0xfce4('0x28')]({'plain':!![]});if(!_0x52d3fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52d3fa[_0xfce4('0x50')]===_0xfce4('0x4f')){var _0x2fb458=_0x20dff9[_0xfce4('0x28')]({'plain':!![]});var _0x448190=_0xfce4('0x51');return db[_0xfce4('0x52')][_0xfce4('0x53')]({'where':{'name':_0x448190,'userProfileId':_0x52d3fa[_0xfce4('0x54')]},'raw':!![]})[_0xfce4('0x27')](function(_0x848bf5){if(_0x848bf5&&_0x848bf5[_0xfce4('0x55')]===0x0){return db[_0xfce4('0x29')][_0xfce4('0x4d')]({'name':_0x2fb458[_0xfce4('0x2d')],'resourceId':_0x2fb458['id'],'type':_0x848bf5[_0xfce4('0x2d')],'sectionId':_0x848bf5['id']},{})[_0xfce4('0x27')](function(){return _0x20dff9;});}else{return _0x20dff9;}})[_0xfce4('0x48')](function(_0x3e6247){logger[_0xfce4('0x2b')](_0xfce4('0x56'),_0x3e6247);throw _0x3e6247;});}return _0x20dff9;})['then'](respondWithResult(_0x175df4,0xc9))[_0xfce4('0x48')](handleError(_0x175df4,null));};exports['update']=function(_0x2eabbf,_0x1dcd49){if(_0x2eabbf['body']['id']){delete _0x2eabbf[_0xfce4('0x4e')]['id'];}return db[_0xfce4('0x30')][_0xfce4('0x53')]({'where':{'id':_0x2eabbf[_0xfce4('0x4a')]['id']}})[_0xfce4('0x27')](handleEntityNotFound(_0x1dcd49,null))[_0xfce4('0x27')](saveUpdates(_0x2eabbf[_0xfce4('0x4e')],null))[_0xfce4('0x27')](respondWithResult(_0x1dcd49,null))[_0xfce4('0x48')](handleError(_0x1dcd49,null));};exports[_0xfce4('0x2a')]=function(_0x2cdc84,_0x2671b3){return db[_0xfce4('0x30')][_0xfce4('0x53')]({'where':{'id':_0x2cdc84[_0xfce4('0x4a')]['id']}})[_0xfce4('0x27')](handleEntityNotFound(_0x2671b3,null))[_0xfce4('0x27')](removeEntity(_0x2671b3,null))['catch'](handleError(_0x2671b3,null));}; \ No newline at end of file +var _0x69cb=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','UserProfileResource','stack','name','send','index','map','Pause','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','user'];(function(_0xb59e87,_0x58d1de){var _0x5c22aa=function(_0x1a8d10){while(--_0x1a8d10){_0xb59e87['push'](_0xb59e87['shift']());}};_0x5c22aa(++_0x58d1de);}(_0x69cb,0x1a6));var _0xb69c=function(_0x22ddc2,_0x53c845){_0x22ddc2=_0x22ddc2-0x0;var _0x1ec24f=_0x69cb[_0x22ddc2];return _0x1ec24f;};'use strict';var emlformat=require(_0xb69c('0x0'));var rimraf=require(_0xb69c('0x1'));var zipdir=require(_0xb69c('0x2'));var jsonpatch=require(_0xb69c('0x3'));var rp=require(_0xb69c('0x4'));var moment=require('moment');var BPromise=require(_0xb69c('0x5'));var Mustache=require(_0xb69c('0x6'));var util=require(_0xb69c('0x7'));var path=require(_0xb69c('0x8'));var sox=require(_0xb69c('0x9'));var csv=require(_0xb69c('0xa'));var ejs=require(_0xb69c('0xb'));var fs=require('fs');var fs_extra=require(_0xb69c('0xc'));var _=require(_0xb69c('0xd'));var squel=require(_0xb69c('0xe'));var crypto=require(_0xb69c('0xf'));var jsforce=require(_0xb69c('0x10'));var deskjs=require(_0xb69c('0x11'));var toCsv=require(_0xb69c('0xa'));var querystring=require('querystring');var Papa=require(_0xb69c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb69c('0x13'));var as=require(_0xb69c('0x14'));var hardwareService=require(_0xb69c('0x15'));var logger=require('../../config/logger')(_0xb69c('0x16'));var utils=require(_0xb69c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb69c('0x18'));var db=require(_0xb69c('0x19'))['db'];function respondWithStatusCode(_0x2ff271,_0x241126){_0x241126=_0x241126||0xcc;return function(_0x2e10d2){if(_0x2e10d2){return _0x2ff271[_0xb69c('0x1a')](_0x241126);}return _0x2ff271['status'](_0x241126)[_0xb69c('0x1b')]();};}function respondWithResult(_0x53c7a6,_0x14a673){_0x14a673=_0x14a673||0xc8;return function(_0x1c7edf){if(_0x1c7edf){return _0x53c7a6['status'](_0x14a673)[_0xb69c('0x1c')](_0x1c7edf);}};}function respondWithFilteredResult(_0x2e9aed,_0x3dd436){return function(_0x1dcfe9){if(_0x1dcfe9){var _0x5a5694=typeof _0x3dd436[_0xb69c('0x1d')]===_0xb69c('0x1e')&&typeof _0x3dd436[_0xb69c('0x1f')]===_0xb69c('0x1e');var _0x15c370=_0x1dcfe9[_0xb69c('0x20')];var _0xf5fef7=_0x5a5694?0x0:_0x3dd436['offset'];var _0xdf938a=_0x5a5694?_0x1dcfe9[_0xb69c('0x20')]:_0x3dd436[_0xb69c('0x1d')]+_0x3dd436['limit'];var _0x506a5b;if(_0xdf938a>=_0x15c370){_0xdf938a=_0x15c370;_0x506a5b=0xc8;}else{_0x506a5b=0xce;}_0x2e9aed[_0xb69c('0x21')](_0x506a5b);return _0x2e9aed[_0xb69c('0x22')](_0xb69c('0x23'),_0xf5fef7+'-'+_0xdf938a+'/'+_0x15c370)[_0xb69c('0x1c')](_0x1dcfe9);}return null;};}function patchUpdates(_0x2acb42){return function(_0x456d4e){try{jsonpatch[_0xb69c('0x24')](_0x456d4e,_0x2acb42,!![]);}catch(_0x38a42b){return BPromise[_0xb69c('0x25')](_0x38a42b);}return _0x456d4e[_0xb69c('0x26')]();};}function saveUpdates(_0x2ca409,_0x2bf965){return function(_0x4ede03){if(_0x4ede03){return _0x4ede03[_0xb69c('0x27')](_0x2ca409)[_0xb69c('0x28')](function(_0x1126aa){return _0x1126aa;});}return null;};}function removeEntity(_0x1c6ddd,_0x5ec9d8){return function(_0x4010a8){if(_0x4010a8){return _0x4010a8['destroy']()[_0xb69c('0x28')](function(){var _0x546b30=_0x4010a8['get']({'plain':!![]});var _0x11eb2f='Pauses';return db[_0xb69c('0x29')]['destroy']({'where':{'type':_0x11eb2f,'resourceId':_0x546b30['id']}})[_0xb69c('0x28')](function(){return _0x4010a8;});})['then'](function(){_0x1c6ddd[_0xb69c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dd6e5,_0x5bb6c3){return function(_0x3cdb4c){if(!_0x3cdb4c){_0x4dd6e5[_0xb69c('0x1a')](0x194);}return _0x3cdb4c;};}function handleError(_0x3c5e05,_0x2b6f30){_0x2b6f30=_0x2b6f30||0x1f4;return function(_0x3cbc44){logger['error'](_0x3cbc44[_0xb69c('0x2a')]);if(_0x3cbc44['name']){delete _0x3cbc44[_0xb69c('0x2b')];}_0x3c5e05[_0xb69c('0x21')](_0x2b6f30)[_0xb69c('0x2c')](_0x3cbc44);};}exports[_0xb69c('0x2d')]=function(_0x4b783b,_0x50a57c){var _0x35403a={},_0x423ad7={},_0x206f97={'count':0x0,'rows':[]};var _0x467b33=_[_0xb69c('0x2e')](db[_0xb69c('0x2f')]['rawAttributes'],function(_0x3cff72){return{'name':_0x3cff72['fieldName'],'type':_0x3cff72[_0xb69c('0x30')]['key']};});_0x423ad7[_0xb69c('0x31')]=_['map'](_0x467b33,_0xb69c('0x2b'));_0x423ad7[_0xb69c('0x32')]=_['keys'](_0x4b783b['query']);_0x423ad7['filters']=_[_0xb69c('0x33')](_0x423ad7[_0xb69c('0x31')],_0x423ad7[_0xb69c('0x32')]);_0x35403a['attributes']=_[_0xb69c('0x33')](_0x423ad7[_0xb69c('0x31')],qs[_0xb69c('0x34')](_0x4b783b[_0xb69c('0x32')]['fields']));_0x35403a[_0xb69c('0x35')]=_0x35403a[_0xb69c('0x35')][_0xb69c('0x36')]?_0x35403a[_0xb69c('0x35')]:_0x423ad7['model'];if(!_0x4b783b[_0xb69c('0x32')][_0xb69c('0x37')](_0xb69c('0x38'))){_0x35403a['limit']=qs['limit'](_0x4b783b[_0xb69c('0x32')][_0xb69c('0x1f')]);_0x35403a['offset']=qs[_0xb69c('0x1d')](_0x4b783b[_0xb69c('0x32')][_0xb69c('0x1d')]);}_0x35403a['order']=qs[_0xb69c('0x39')](_0x4b783b[_0xb69c('0x32')]['sort']);_0x35403a['where']=qs[_0xb69c('0x3a')](_[_0xb69c('0x3b')](_0x4b783b['query'],_0x423ad7[_0xb69c('0x3a')]),_0x467b33);if(_0x4b783b[_0xb69c('0x32')]['filter']){_0x35403a[_0xb69c('0x3c')]=_['merge'](_0x35403a[_0xb69c('0x3c')],{'$or':_[_0xb69c('0x2e')](_0x467b33,function(_0x4193a6){if(_0x4193a6[_0xb69c('0x30')]!==_0xb69c('0x3d')){var _0x2aa432={};_0x2aa432[_0x4193a6['name']]={'$like':'%'+_0x4b783b[_0xb69c('0x32')]['filter']+'%'};return _0x2aa432;}})});}_0x35403a=_[_0xb69c('0x3e')]({},_0x35403a,_0x4b783b[_0xb69c('0x3f')]);var _0x5246a4={'where':_0x35403a[_0xb69c('0x3c')]};return db['Pause'][_0xb69c('0x20')](_0x5246a4)[_0xb69c('0x28')](function(_0x2e1574){_0x206f97['count']=_0x2e1574;if(_0x4b783b[_0xb69c('0x32')][_0xb69c('0x40')]){_0x35403a['include']=[{'all':!![]}];}return db[_0xb69c('0x2f')][_0xb69c('0x41')](_0x35403a);})['then'](function(_0x47e218){_0x206f97[_0xb69c('0x42')]=_0x47e218;return _0x206f97;})[_0xb69c('0x28')](respondWithFilteredResult(_0x50a57c,_0x35403a))[_0xb69c('0x43')](handleError(_0x50a57c,null));};exports[_0xb69c('0x44')]=function(_0x3e54c9,_0x18715c){var _0x28eb1e={'raw':!![],'where':{'id':_0x3e54c9[_0xb69c('0x45')]['id']}},_0x2f7d37={};_0x2f7d37[_0xb69c('0x31')]=_[_0xb69c('0x46')](db['Pause'][_0xb69c('0x47')]);_0x2f7d37[_0xb69c('0x32')]=_[_0xb69c('0x46')](_0x3e54c9[_0xb69c('0x32')]);_0x2f7d37[_0xb69c('0x3a')]=_[_0xb69c('0x33')](_0x2f7d37['model'],_0x2f7d37['query']);_0x28eb1e[_0xb69c('0x35')]=_[_0xb69c('0x33')](_0x2f7d37[_0xb69c('0x31')],qs[_0xb69c('0x34')](_0x3e54c9[_0xb69c('0x32')][_0xb69c('0x34')]));_0x28eb1e['attributes']=_0x28eb1e['attributes'][_0xb69c('0x36')]?_0x28eb1e['attributes']:_0x2f7d37[_0xb69c('0x31')];if(_0x3e54c9[_0xb69c('0x32')]['includeAll']){_0x28eb1e[_0xb69c('0x48')]=[{'all':!![]}];}_0x28eb1e=_[_0xb69c('0x3e')]({},_0x28eb1e,_0x3e54c9[_0xb69c('0x3f')]);return db['Pause']['find'](_0x28eb1e)[_0xb69c('0x28')](handleEntityNotFound(_0x18715c,null))['then'](respondWithResult(_0x18715c,null))['catch'](handleError(_0x18715c,null));};exports['create']=function(_0x3d6413,_0x5de40f){return db[_0xb69c('0x2f')][_0xb69c('0x49')](_0x3d6413[_0xb69c('0x4a')],{})['then'](function(_0x51562e){var _0x584e75=_0x3d6413[_0xb69c('0x4b')][_0xb69c('0x4c')]({'plain':!![]});if(!_0x584e75)throw new Error(_0xb69c('0x4d'));if(_0x584e75['role']===_0xb69c('0x4b')){var _0x467e4a=_0x51562e[_0xb69c('0x4c')]({'plain':!![]});var _0x3aa4db='Pauses';return db[_0xb69c('0x4e')][_0xb69c('0x4f')]({'where':{'name':_0x3aa4db,'userProfileId':_0x584e75[_0xb69c('0x50')]},'raw':!![]})['then'](function(_0x5490be){if(_0x5490be&&_0x5490be[_0xb69c('0x51')]===0x0){return db[_0xb69c('0x29')]['create']({'name':_0x467e4a['name'],'resourceId':_0x467e4a['id'],'type':_0x5490be[_0xb69c('0x2b')],'sectionId':_0x5490be['id']},{})['then'](function(){return _0x51562e;});}else{return _0x51562e;}})[_0xb69c('0x43')](function(_0x50f678){logger['error'](_0xb69c('0x52'),_0x50f678);throw _0x50f678;});}return _0x51562e;})['then'](respondWithResult(_0x5de40f,0xc9))[_0xb69c('0x43')](handleError(_0x5de40f,null));};exports['update']=function(_0x4918a9,_0x1343cc){if(_0x4918a9['body']['id']){delete _0x4918a9['body']['id'];}return db[_0xb69c('0x2f')][_0xb69c('0x4f')]({'where':{'id':_0x4918a9[_0xb69c('0x45')]['id']}})[_0xb69c('0x28')](handleEntityNotFound(_0x1343cc,null))['then'](saveUpdates(_0x4918a9[_0xb69c('0x4a')],null))[_0xb69c('0x28')](respondWithResult(_0x1343cc,null))[_0xb69c('0x43')](handleError(_0x1343cc,null));};exports['destroy']=function(_0x271afc,_0x1eb24c){return db[_0xb69c('0x2f')][_0xb69c('0x4f')]({'where':{'id':_0x271afc['params']['id']}})[_0xb69c('0x28')](handleEntityNotFound(_0x1eb24c,null))['then'](removeEntity(_0x1eb24c,null))[_0xb69c('0x43')](handleError(_0x1eb24c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 86a84f2..0351615 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x513928,_0x138a13){var _0x4ad8ec=function(_0x157baa){while(--_0x157baa){_0x513928['push'](_0x513928['shift']());}};_0x4ad8ec(++_0x138a13);}(_0x5fab,0x177));var _0xb5fa=function(_0x260fb9,_0x2bc9da){_0x260fb9=_0x260fb9-0x0;var _0x5326af=_0x5fab[_0x260fb9];return _0x5326af;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x3da7d3,_0x38e008){var _0x53a572=function(_0x4a4958){while(--_0x4a4958){_0x3da7d3['push'](_0x3da7d3['shift']());}};_0x53a572(++_0x38e008);}(_0xf494,0x1c6));var _0x4f49=function(_0xcdec15,_0x393629){_0xcdec15=_0xcdec15-0x0;var _0x1c86e5=_0xf494[_0xcdec15];return _0x1c86e5;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 656d389..55fc500 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x227b62,_0x5121b){var _0x5ec873=function(_0x5095e5){while(--_0x5095e5){_0x227b62['push'](_0x227b62['shift']());}};_0x5ec873(++_0x5121b);}(_0x7a54,0x106));var _0x47a5=function(_0x223181,_0x52168d){_0x223181=_0x223181-0x0;var _0x4de9d0=_0x7a54[_0x223181];return _0x4de9d0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x535c23,_0x2fc0be){var _0x58210e=function(_0x4b322c){while(--_0x4b322c){_0x535c23['push'](_0x535c23['shift']());}};_0x58210e(++_0x2fc0be);}(_0x7a54,0x106));var _0x47a5=function(_0x678a8f,_0x92fcd9){_0x678a8f=_0x678a8f-0x0;var _0x592c89=_0x7a54[_0x678a8f];return _0x592c89;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a470e50..0e509a1 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 _0x00bb=['upload','post','put','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','originalname','replace','%s-%s%s','basename','extname','file'];(function(_0x169ea9,_0xf9fc24){var _0x1ab3e3=function(_0x2a2c45){while(--_0x2a2c45){_0x169ea9['push'](_0x169ea9['shift']());}};_0x1ab3e3(++_0xf9fc24);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),controller[_0xb00b('0xa')]);router[_0xb00b('0x8')](_0xb00b('0xb'),auth[_0xb00b('0xc')](),controller['show']);router['get'](_0xb00b('0xd'),auth[_0xb00b('0xc')](),controller[_0xb00b('0xe')]);var upload=multer({'storage':multer[_0xb00b('0xf')]({'destination':function(_0x28d3cc,_0x48e125,_0x3182db){_0x3182db(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x4ff792,_0x2d8ddf,_0x1be8aa){_0x2d8ddf[_0xb00b('0x10')]=_0x2d8ddf[_0xb00b('0x10')][_0xb00b('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1be8aa(null,util['format'](_0xb00b('0x12'),path[_0xb00b('0x13')](_0x2d8ddf['originalname'],path[_0xb00b('0x14')](_0x2d8ddf[_0xb00b('0x10')])),Date['now'](),path['extname'](_0x2d8ddf[_0xb00b('0x10')])));}})});router['post']('/',upload['single'](_0xb00b('0x15')),controller[_0xb00b('0x16')]);router[_0xb00b('0x17')](_0xb00b('0x9'),controller['webhookPost']);router[_0xb00b('0x18')]('/:id',auth[_0xb00b('0xc')](),controller['update']);router[_0xb00b('0x19')]('/:id',auth[_0xb00b('0xc')](),controller[_0xb00b('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5db8=['basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s'];(function(_0x3044b8,_0x42e041){var _0x119c04=function(_0x5a1d0f){while(--_0x5a1d0f){_0x3044b8['push'](_0x3044b8['shift']());}};_0x119c04(++_0x42e041);}(_0x5db8,0xbb));var _0x85db=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0x5db8[_0x400766];return _0x3ae58b;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),controller[_0x85db('0xb')]);router[_0x85db('0x8')](_0x85db('0xc'),auth['isAuthenticated'](),controller[_0x85db('0xd')]);router['get'](_0x85db('0xe'),auth[_0x85db('0x9')](),controller[_0x85db('0xf')]);var upload=multer({'storage':multer[_0x85db('0x10')]({'destination':function(_0x5491fa,_0x54feb2,_0x51fd42){_0x51fd42(null,path[_0x85db('0x11')](config[_0x85db('0x12')],'server/files/plugins'));},'filename':function(_0x11ac68,_0x541f2f,_0x437f7a){_0x541f2f[_0x85db('0x13')]=_0x541f2f[_0x85db('0x13')][_0x85db('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x437f7a(null,util[_0x85db('0x15')](_0x85db('0x16'),path[_0x85db('0x17')](_0x541f2f[_0x85db('0x13')],path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])),Date[_0x85db('0x19')](),path[_0x85db('0x18')](_0x541f2f[_0x85db('0x13')])));}})});router['post']('/',upload[_0x85db('0x1a')](_0x85db('0x1b')),controller[_0x85db('0x1c')]);router[_0x85db('0x1d')](_0x85db('0xa'),controller[_0x85db('0x1e')]);router[_0x85db('0x1f')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x20')]);router[_0x85db('0x21')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0x21')]);module[_0x85db('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 076fa48..0ae1fd6 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 _0x49e2=['html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','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'];(function(_0x252805,_0x1d1e8e){var _0x3e74b9=function(_0x16d7a0){while(--_0x16d7a0){_0x252805['push'](_0x252805['shift']());}};_0x3e74b9(++_0x1d1e8e);}(_0x49e2,0x10e));var _0x249e=function(_0x4a66ca,_0x9e2c8a){_0x4a66ca=_0x4a66ca-0x0;var _0x445de2=_0x49e2[_0x4a66ca];return _0x445de2;};'use strict';var Sequelize=require(_0x249e('0x0'));module[_0x249e('0x1')]={'name':{'type':Sequelize[_0x249e('0x2')]},'type':{'type':Sequelize['ENUM'](_0x249e('0x3'),_0x249e('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x249e('0x5')]},'path':{'type':Sequelize[_0x249e('0x2')],'comment':_0x249e('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x249e('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x249e('0x8'),_0x249e('0x9'),_0x249e('0xa'),_0x249e('0xb')),'defaultValue':_0x249e('0xa'),'comment':_0x249e('0xc')},'icon':{'type':Sequelize[_0x249e('0x2')]},'adminUrl':{'type':Sequelize[_0x249e('0x2')]},'agentUrl':{'type':Sequelize[_0x249e('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x249e('0x2')]}}; \ No newline at end of file +var _0x3cb2=['script','TEXT','BOOLEAN','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x3cb2,0x15b));var _0x23cb=function(_0x5aba03,_0x161ec6){_0x5aba03=_0x5aba03-0x0;var _0x24d080=_0x3cb2[_0x5aba03];return _0x24d080;};'use strict';var Sequelize=require(_0x23cb('0x0'));module[_0x23cb('0x1')]={'name':{'type':Sequelize[_0x23cb('0x2')]},'type':{'type':Sequelize[_0x23cb('0x3')](_0x23cb('0x4'),_0x23cb('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x23cb('0x6')]},'path':{'type':Sequelize[_0x23cb('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x23cb('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly','agentOnly',_0x23cb('0x8'),_0x23cb('0x9')),'defaultValue':_0x23cb('0x8'),'comment':_0x23cb('0xa')},'icon':{'type':Sequelize[_0x23cb('0x2')]},'adminUrl':{'type':Sequelize[_0x23cb('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x23cb('0x2')]},'scriptPath':{'type':Sequelize[_0x23cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 7b80464..57252c4 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 _0x8b74=['Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','attachments/**/*','finalize','Plugin\x20not\x20found','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','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./plugin.socket','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','map','Plugin','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','rawAttributes','include','find','download','params','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error'];(function(_0x327564,_0x34df71){var _0x5070cd=function(_0x254155){while(--_0x254155){_0x327564['push'](_0x327564['shift']());}};_0x5070cd(++_0x34df71);}(_0x8b74,0x1b4));var _0x48b7=function(_0x42ea58,_0x448566){_0x42ea58=_0x42ea58-0x0;var _0x1b0225=_0x8b74[_0x42ea58];return _0x1b0225;};'use strict';var emlformat=require(_0x48b7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48b7('0x1'));var rp=require(_0x48b7('0x2'));var moment=require('moment');var BPromise=require(_0x48b7('0x3'));var Mustache=require(_0x48b7('0x4'));var util=require(_0x48b7('0x5'));var path=require(_0x48b7('0x6'));var sox=require(_0x48b7('0x7'));var csv=require(_0x48b7('0x8'));var ejs=require(_0x48b7('0x9'));var fs=require('fs');var fs_extra=require(_0x48b7('0xa'));var _=require(_0x48b7('0xb'));var squel=require(_0x48b7('0xc'));var crypto=require(_0x48b7('0xd'));var jsforce=require(_0x48b7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x48b7('0x8'));var querystring=require(_0x48b7('0xf'));var Papa=require(_0x48b7('0x10'));var extract=require(_0x48b7('0x11'));var rimraf=require(_0x48b7('0x12'));var archiver=require(_0x48b7('0x13'));var Redis=require(_0x48b7('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x48b7('0x15'));var as=require(_0x48b7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x48b7('0x17'));var utils=require(_0x48b7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x48b7('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x48b7('0x1a')](config[_0x48b7('0x1b')],{'host':_0x48b7('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x48b7('0x1d'))['register'](socket);function respondWithStatusCode(_0x29e7b4,_0x43649a){_0x43649a=_0x43649a||0xcc;return function(_0x2e2ed2){if(_0x2e2ed2){return _0x29e7b4[_0x48b7('0x1e')](_0x43649a);}return _0x29e7b4['status'](_0x43649a)[_0x48b7('0x1f')]();};}function respondWithResult(_0x3c1ff9,_0x3c72b3){_0x3c72b3=_0x3c72b3||0xc8;return function(_0x190602){if(_0x190602){return _0x3c1ff9['status'](_0x3c72b3)['json'](_0x190602);}};}function respondWithFilteredResult(_0x57a256,_0x32c399){return function(_0x1ca1f5){if(_0x1ca1f5){var _0x5c73b6=typeof _0x32c399[_0x48b7('0x20')]===_0x48b7('0x21')&&typeof _0x32c399[_0x48b7('0x22')]==='undefined';var _0x3117b3=_0x1ca1f5['count'];var _0x20291d=_0x5c73b6?0x0:_0x32c399[_0x48b7('0x20')];var _0x308ff1=_0x5c73b6?_0x1ca1f5[_0x48b7('0x23')]:_0x32c399[_0x48b7('0x20')]+_0x32c399[_0x48b7('0x22')];var _0x4c9cf3;if(_0x308ff1>=_0x3117b3){_0x308ff1=_0x3117b3;_0x4c9cf3=0xc8;}else{_0x4c9cf3=0xce;}_0x57a256[_0x48b7('0x24')](_0x4c9cf3);return _0x57a256[_0x48b7('0x25')](_0x48b7('0x26'),_0x20291d+'-'+_0x308ff1+'/'+_0x3117b3)['json'](_0x1ca1f5);}return null;};}function patchUpdates(_0x529d68){return function(_0x16e1b3){try{jsonpatch[_0x48b7('0x27')](_0x16e1b3,_0x529d68,!![]);}catch(_0x5b69ce){return BPromise[_0x48b7('0x28')](_0x5b69ce);}return _0x16e1b3['save']();};}function saveUpdates(_0x9b4d39,_0x48e2f7){return function(_0x58f4fb){if(_0x58f4fb){return _0x58f4fb[_0x48b7('0x29')](_0x9b4d39)[_0x48b7('0x2a')](function(_0x35f7b0){return _0x35f7b0;});}return null;};}function removeEntity(_0x59f794,_0x3eac94){return function(_0x3148f8){if(_0x3148f8){return _0x3148f8[_0x48b7('0x2b')]()[_0x48b7('0x2a')](function(){var _0x1e219a=_0x3148f8[_0x48b7('0x2c')]({'plain':!![]});var _0x15c73f='Plugins';return db[_0x48b7('0x2d')][_0x48b7('0x2b')]({'where':{'type':_0x15c73f,'resourceId':_0x1e219a['id']}})['then'](function(){return _0x3148f8;});})[_0x48b7('0x2a')](function(){_0x59f794[_0x48b7('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c68ce,_0x59c63c){return function(_0x5bc667){if(!_0x5bc667){_0x3c68ce[_0x48b7('0x1e')](0x194);}return _0x5bc667;};}function handleError(_0x421eac,_0x5704f6){_0x5704f6=_0x5704f6||0x1f4;return function(_0x3e4b37){logger['error'](_0x3e4b37[_0x48b7('0x2e')]);if(_0x3e4b37['name']){delete _0x3e4b37[_0x48b7('0x2f')];}_0x421eac['status'](_0x5704f6)[_0x48b7('0x30')](_0x3e4b37);};}exports['index']=function(_0x51cfd8,_0x4feb08){var _0x491ea2={},_0x252b8e={},_0x535dfc={'count':0x0,'rows':[]};var _0x4989b7=_[_0x48b7('0x31')](db[_0x48b7('0x32')]['rawAttributes'],function(_0x3964b5){return{'name':_0x3964b5[_0x48b7('0x33')],'type':_0x3964b5[_0x48b7('0x34')][_0x48b7('0x35')]};});_0x252b8e[_0x48b7('0x36')]=_[_0x48b7('0x31')](_0x4989b7,'name');_0x252b8e[_0x48b7('0x37')]=_[_0x48b7('0x38')](_0x51cfd8['query']);_0x252b8e[_0x48b7('0x39')]=_[_0x48b7('0x3a')](_0x252b8e[_0x48b7('0x36')],_0x252b8e[_0x48b7('0x37')]);_0x491ea2[_0x48b7('0x3b')]=_[_0x48b7('0x3a')](_0x252b8e['model'],qs[_0x48b7('0x3c')](_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x3c')]));_0x491ea2[_0x48b7('0x3b')]=_0x491ea2[_0x48b7('0x3b')][_0x48b7('0x3d')]?_0x491ea2[_0x48b7('0x3b')]:_0x252b8e['model'];if(!_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x3e')](_0x48b7('0x3f'))){_0x491ea2['limit']=qs[_0x48b7('0x22')](_0x51cfd8[_0x48b7('0x37')]['limit']);_0x491ea2[_0x48b7('0x20')]=qs[_0x48b7('0x20')](_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x20')]);}_0x491ea2[_0x48b7('0x40')]=qs['sort'](_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x41')]);_0x491ea2[_0x48b7('0x42')]=qs[_0x48b7('0x39')](_[_0x48b7('0x43')](_0x51cfd8[_0x48b7('0x37')],_0x252b8e[_0x48b7('0x39')]),_0x4989b7);if(_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x44')]){_0x491ea2['where']=_[_0x48b7('0x45')](_0x491ea2[_0x48b7('0x42')],{'$or':_['map'](_0x4989b7,function(_0xc9bc56){if(_0xc9bc56[_0x48b7('0x34')]!==_0x48b7('0x46')){var _0x443f49={};_0x443f49[_0xc9bc56[_0x48b7('0x2f')]]={'$like':'%'+_0x51cfd8['query']['filter']+'%'};return _0x443f49;}})});}_0x491ea2=_[_0x48b7('0x45')]({},_0x491ea2,_0x51cfd8[_0x48b7('0x47')]);var _0x5c148c={'where':_0x491ea2['where']};return db[_0x48b7('0x32')][_0x48b7('0x23')](_0x5c148c)['then'](function(_0xb3d870){_0x535dfc[_0x48b7('0x23')]=_0xb3d870;if(_0x51cfd8[_0x48b7('0x37')][_0x48b7('0x48')]){_0x491ea2['include']=[{'all':!![]}];}return db[_0x48b7('0x32')][_0x48b7('0x49')](_0x491ea2);})['then'](function(_0xde96cd){_0x535dfc['rows']=_0xde96cd;return _0x535dfc;})[_0x48b7('0x2a')](respondWithFilteredResult(_0x4feb08,_0x491ea2))[_0x48b7('0x4a')](handleError(_0x4feb08,null));};exports[_0x48b7('0x4b')]=function(_0x547505,_0x54f31d){var _0x5da0a1={'raw':!![],'where':{'id':_0x547505['params']['id']}},_0x42e73e={};_0x42e73e[_0x48b7('0x36')]=_[_0x48b7('0x38')](db[_0x48b7('0x32')][_0x48b7('0x4c')]);_0x42e73e[_0x48b7('0x37')]=_['keys'](_0x547505[_0x48b7('0x37')]);_0x42e73e[_0x48b7('0x39')]=_[_0x48b7('0x3a')](_0x42e73e[_0x48b7('0x36')],_0x42e73e[_0x48b7('0x37')]);_0x5da0a1[_0x48b7('0x3b')]=_[_0x48b7('0x3a')](_0x42e73e['model'],qs[_0x48b7('0x3c')](_0x547505[_0x48b7('0x37')][_0x48b7('0x3c')]));_0x5da0a1[_0x48b7('0x3b')]=_0x5da0a1[_0x48b7('0x3b')]['length']?_0x5da0a1[_0x48b7('0x3b')]:_0x42e73e['model'];if(_0x547505[_0x48b7('0x37')][_0x48b7('0x48')]){_0x5da0a1[_0x48b7('0x4d')]=[{'all':!![]}];}_0x5da0a1=_[_0x48b7('0x45')]({},_0x5da0a1,_0x547505['options']);return db[_0x48b7('0x32')][_0x48b7('0x4e')](_0x5da0a1)[_0x48b7('0x2a')](handleEntityNotFound(_0x54f31d,null))[_0x48b7('0x2a')](respondWithResult(_0x54f31d,null))[_0x48b7('0x4a')](handleError(_0x54f31d,null));};exports[_0x48b7('0x4f')]=function(_0x5cbeb3,_0x4909fc,_0xf91631){return db['Plugin'][_0x48b7('0x4e')]({'where':{'id':_0x5cbeb3[_0x48b7('0x50')]['id']},'attributes':[_0x48b7('0x2f'),_0x48b7('0x6')],'raw':!![]})[_0x48b7('0x2a')](handleEntityNotFound(_0x4909fc,null))[_0x48b7('0x2a')](function(_0x488529){if(_0x488529){var _0x42c1bd=path[_0x48b7('0x51')](config['root'],_0x48b7('0x52'),util[_0x48b7('0x53')](_0x48b7('0x54'),path[_0x48b7('0x55')](_0x488529[_0x48b7('0x6')])));var _0x109863=fs[_0x48b7('0x56')](_0x42c1bd);var _0x4701c4=archiver(_0x48b7('0x57'),{'zlib':{'level':0x9}});_0x4701c4['on'](_0x48b7('0x58'),function(_0x1c3655){if(_0x1c3655[_0x48b7('0x59')]===_0x48b7('0x5a')){logger[_0x48b7('0x5b')](_0x1c3655);}else{throw new db['Sequelize'][(_0x48b7('0x5c'))](_0x48b7('0x5d'));}});_0x4701c4['on'](_0x48b7('0x5b'),function(_0x4b4413){throw new db['Sequelize'][(_0x48b7('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x4701c4[_0x48b7('0x5e')](_0x109863);_0x4701c4[_0x48b7('0x5f')](_0x48b7('0x60'),{'cwd':path['join'](config[_0x48b7('0x61')],_0x48b7('0x52'),path[_0x48b7('0x62')](_0x488529[_0x48b7('0x6')])),'ignore':[path['join'](path[_0x48b7('0x55')](_0x488529[_0x48b7('0x6')]),'node_modules/**/*'),path[_0x48b7('0x51')](path[_0x48b7('0x55')](_0x488529[_0x48b7('0x6')]),_0x48b7('0x63'))],'nodir':!![]})[_0x48b7('0x64')]();_0x109863['on']('close',function(){if(!fs['existsSync'](_0x42c1bd)){throw new db['Sequelize'][(_0x48b7('0x5c'))](_0x48b7('0x65'));}return _0x4909fc[_0x48b7('0x4f')](_0x42c1bd,util[_0x48b7('0x53')]('%s.zip',path['basename'](_0x488529[_0x48b7('0x6')])),function(_0x11b478){if(_0x11b478){throw new db['Sequelize'][(_0x48b7('0x5c'))](_0x48b7('0x66'));}fs[_0x48b7('0x67')](_0x42c1bd);logger[_0x48b7('0x68')](_0x48b7('0x69'));logger[_0x48b7('0x68')](_0x48b7('0x6a'));});});}return null;})[_0x48b7('0x4a')](handleError(_0x4909fc,null));};exports[_0x48b7('0x6b')]=function(_0x24a81e,_0x44a525,_0xfe1a2d){var _0x3d79dd=path[_0x48b7('0x55')](_0x24a81e[_0x48b7('0x6c')][_0x48b7('0x6d')],path[_0x48b7('0x6e')](_0x24a81e[_0x48b7('0x6c')][_0x48b7('0x6d')]));var _0x3db262=path[_0x48b7('0x51')](config[_0x48b7('0x61')],_0x48b7('0x52'),_0x24a81e[_0x48b7('0x6c')][_0x48b7('0x6d')]);var _0x4d05dd=path[_0x48b7('0x51')](config['root'],_0x48b7('0x52'),_0x3d79dd);logger['info'](_0x48b7('0x6f'),_0x3db262);logger[_0x48b7('0x68')](_0x48b7('0x70'),_0x4d05dd);try{fs[_0x48b7('0x71')](_0x3db262,parseInt(_0x48b7('0x72'),0x8));extract(_0x3db262,{'dir':_0x4d05dd},function(_0x1d9c63){if(_0x1d9c63){logger['error'](_0x1d9c63);handleError(_0x1d9c63,!![]);};var _0xbb0444=fs[_0x48b7('0x73')](_0x4d05dd);if(_0xbb0444[_0x48b7('0x3d')]>0x1){removeReferences(_0x3db262,_0x4d05dd);logger['error'](_0x48b7('0x74'));return _0xfe1a2d(new Error('Invalid\x20plugin\x20structure'));}var _0x1f30a4=fs[_0x48b7('0x75')](path['join'](_0x4d05dd,_0xbb0444[0x0]));if(_0x1f30a4[_0x48b7('0x76')]()){removeReferences(_0x3db262,_0x4d05dd);logger[_0x48b7('0x5b')](_0x48b7('0x74'));return _0xfe1a2d(new Error(_0x48b7('0x74')));}if(_0x1f30a4[_0x48b7('0x77')]()){var _0x2fa535=fs[_0x48b7('0x73')](path['join'](_0x4d05dd,_0xbb0444[0x0]));if(_0x2fa535[_0x48b7('0x3d')]===0x0){removeReferences(_0x3db262,_0x4d05dd);logger['error'](_0x48b7('0x74'));return _0xfe1a2d(new Error(_0x48b7('0x74')));}var _0x29f65b=_0x2fa535['some'](function(_0x2f48e0){return _0x2f48e0===_0x48b7('0x78');});if(!_0x29f65b){return _0xfe1a2d(new Error(_0x48b7('0x79')));}var _0x2c107e=fs['readFileSync'](path[_0x48b7('0x51')](_0x4d05dd,_0xbb0444[0x0],_0x48b7('0x78')));var _0x88dfc6=JSON[_0x48b7('0x7a')](_0x2c107e);if(_0x48b7('0x21')==typeof _0x88dfc6['name']){return _0xfe1a2d(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x48b7('0x21')==typeof _0x88dfc6[_0x48b7('0x34')]){return _0xfe1a2d(new Error(_0x48b7('0x7b')));}if(_0x48b7('0x21')==typeof _0x88dfc6['version']){return _0xfe1a2d(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x48b7('0x21')==typeof _0x88dfc6[_0x48b7('0x7c')]){return _0xfe1a2d(new Error(_0x48b7('0x7d')));}if(_0x88dfc6[_0x48b7('0x34')]===_0x48b7('0x7e')){if(_0x48b7('0x21')==typeof _0x88dfc6['parameters'][_0x48b7('0x7f')]){return _0xfe1a2d(new Error(_0x48b7('0x80')));}if(_0x48b7('0x21')==typeof _0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x7f')][_0x48b7('0x81')]&&_0x48b7('0x21')==typeof _0x88dfc6['parameters'][_0x48b7('0x7f')]['agent']){return _0xfe1a2d(new Error(_0x48b7('0x82')));}}else if(_0x88dfc6[_0x48b7('0x34')]==='script'){if(_0x48b7('0x21')==typeof _0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x83')]){return _0xfe1a2d(new Error(_0x48b7('0x84')));}if(_0x48b7('0x21')==typeof _0x88dfc6['parameters'][_0x48b7('0x85')]){return _0xfe1a2d(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xfe1a2d(new Error(_0x48b7('0x86')));}var _0x1b955e=_0x88dfc6[_0x48b7('0x2f')];var _0x42e450=_0x88dfc6[_0x48b7('0x87')];var _0x3748dc=_0x88dfc6['type'];var _0x3d5736=_0x88dfc6[_0x48b7('0x88')]?_0x88dfc6[_0x48b7('0x88')]:_0x48b7('0x89');var _0x1cc297=_0x88dfc6['icon']?_0x88dfc6[_0x48b7('0x8a')]:_0x48b7('0x8b');var _0x42a902='';var _0x292f08='';var _0x58cb8f='';var _0x36d4ce='';var _0x34f249=_0x88dfc6[_0x48b7('0x8c')];if(_0x3748dc===_0x48b7('0x7e')){if('undefined'!=typeof _0x88dfc6[_0x48b7('0x7c')]['views'][_0x48b7('0x81')]){var _0xb4beb0=_0x88dfc6['parameters'][_0x48b7('0x7f')][_0x48b7('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x48b7('0x8d')](_0xb4beb0)){_0x42a902=path[_0x48b7('0x51')]('plugins',_0x3d79dd,_0xbb0444[0x0],_0xb4beb0);}else{_0x42a902=_0xb4beb0;}}else{logger[_0x48b7('0x68')](_0x48b7('0x8e'));}if(_0x48b7('0x21')!=typeof _0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x7f')]['agent']){var _0x16c8b5=_0x88dfc6['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x48b7('0x8d')](_0x16c8b5)){_0x292f08=path[_0x48b7('0x51')](_0x48b7('0x8f'),_0x3d79dd,_0xbb0444[0x0],_0x16c8b5);}else{_0x292f08=_0x16c8b5;}}else{logger[_0x48b7('0x68')](_0x48b7('0x90'));}}else if(_0x3748dc===_0x48b7('0x91')){_0x58cb8f=_0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x83')];_0x36d4ce=_0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x85')];if(_0x48b7('0x21')!=typeof _0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x7f')]){if('undefined'!=typeof _0x88dfc6[_0x48b7('0x7c')]['views'][_0x48b7('0x81')]){var _0xb4beb0=_0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0xb4beb0)){_0x42a902=path['join'](_0x48b7('0x8f'),_0x3d79dd,_0xbb0444[0x0],_0xb4beb0);}else{_0x42a902=_0xb4beb0;}}if(_0x48b7('0x21')!=typeof _0x88dfc6[_0x48b7('0x7c')]['views'][_0x48b7('0x92')]){var _0x16c8b5=_0x88dfc6[_0x48b7('0x7c')][_0x48b7('0x7f')][_0x48b7('0x92')];if(!/^(f|ht)tps?:\/\//i['test'](_0x16c8b5)){_0x292f08=path[_0x48b7('0x51')]('plugins',_0x3d79dd,_0xbb0444[0x0],_0x16c8b5);}else{_0x292f08=_0x16c8b5;}}}}var _0x30ccab={'name':_0x1b955e,'description':_0x42e450,'path':path[_0x48b7('0x51')](_0x3d79dd,_0xbb0444[0x0]),'type':_0x3748dc,'sidebar':_0x3d5736,'icon':_0x1cc297,'adminUrl':_0x42a902,'agentUrl':_0x292f08,'scriptName':_0x58cb8f,'scriptPath':_0x36d4ce,'version':_0x34f249};removeReferences(_0x3db262,null);return db[_0x48b7('0x32')][_0x48b7('0x93')](_0x30ccab)[_0x48b7('0x2a')](function(_0xdd127){var _0x2b93fb={'role':_0x24a81e[_0x48b7('0x94')][_0x48b7('0x95')],'userProfileId':_0x24a81e[_0x48b7('0x94')][_0x48b7('0x96')]};if(!_0x2b93fb)throw new Error(_0x48b7('0x97'));if(_0x2b93fb[_0x48b7('0x95')]===_0x48b7('0x98')){var _0x2a77b2=_0xdd127[_0x48b7('0x2c')]({'plain':!![]});return db[_0x48b7('0x99')][_0x48b7('0x4e')]({'where':{'name':_0x48b7('0x9a'),'userProfileId':_0x2b93fb['userProfileId']},'raw':!![]})[_0x48b7('0x2a')](function(_0x1afce4){if(_0x1afce4&&_0x1afce4[_0x48b7('0x9b')]===0x0){return db[_0x48b7('0x2d')][_0x48b7('0x93')]({'name':_0x2a77b2['name'],'resourceId':_0x2a77b2['id'],'type':_0x1afce4[_0x48b7('0x2f')],'sectionId':_0x1afce4['id']},{})['then'](function(){return _0xdd127;});}else{return _0xdd127;}})['catch'](function(_0x494af7){logger[_0x48b7('0x5b')](_0x48b7('0x9c'),_0x494af7);throw _0x494af7;});}return _0xdd127;})[_0x48b7('0x2a')](respondWithResult(_0x44a525,null))[_0x48b7('0x4a')](handleError(_0x44a525,null));}});}catch(_0x147eff){_0x44a525[_0x48b7('0x24')](0x1f4)[_0x48b7('0x30')](_0x147eff);}};function removeReferences(_0x58b43d,_0x5ff357){try{if(_0x58b43d){fs[_0x48b7('0x67')](_0x58b43d);logger['info'](_0x48b7('0x9d'));}if(_0x5ff357){rimraf(_0x5ff357,function(){});logger['info'](_0x48b7('0x9e'));}}catch(_0x5eddb2){logger[_0x48b7('0x5b')](_0x5eddb2);}}exports['update']=function(_0x4b4013,_0x23d776,_0x717d04){return db['Plugin'][_0x48b7('0x4e')]({'where':{'id':_0x4b4013[_0x48b7('0x50')]['id']}})[_0x48b7('0x2a')](handleEntityNotFound(_0x23d776,null))[_0x48b7('0x2a')](saveUpdates(_0x4b4013[_0x48b7('0x94')],null))[_0x48b7('0x2a')](respondWithResult(_0x23d776,null))[_0x48b7('0x4a')](handleError(_0x23d776,null));};exports['delete']=function(_0x286a3b,_0x4722d6,_0xcc61a4){return db['Plugin'][_0x48b7('0x4e')]({'where':{'id':_0x286a3b['params']['id']}})['then'](function(_0x493b8c){if(_0x493b8c){return _0x493b8c['destroy']();}})[_0x48b7('0x2a')](function(_0x4fe6fc){rimraf(path[_0x48b7('0x51')](config[_0x48b7('0x61')],_0x48b7('0x52'),path[_0x48b7('0x62')](_0x4fe6fc['path'])),function(){});return _0x4fe6fc;})[_0x48b7('0x2a')](handleEntityNotFound(_0x4722d6,null))[_0x48b7('0x2a')](respondWithStatusCode(_0x4722d6,null))[_0x48b7('0x4a')](handleError(_0x4722d6,null));};exports[_0x48b7('0x9f')]=function(_0x50752e,_0x35554a,_0xae5ae0){return BPromise[_0x48b7('0xa0')]()[_0x48b7('0x2a')](function(){if(!_0x50752e[_0x48b7('0x37')][_0x48b7('0x6')]){throw new Error(_0x48b7('0xa1'));}if(!_0x50752e[_0x48b7('0x37')]['port']){throw new Error(_0x48b7('0xa2'));}var _0xabcf0e=_0x50752e['query']['hostname']?_0x50752e[_0x48b7('0x37')][_0x48b7('0xa3')]+':'+_0x50752e[_0x48b7('0x37')][_0x48b7('0xa4')]:_0x48b7('0xa5')+_0x50752e[_0x48b7('0x37')]['port'];var _0x50539c=_0x50752e[_0x48b7('0x37')][_0x48b7('0xa6')]?_0x50752e[_0x48b7('0x37')][_0x48b7('0xa6')]:!![];var _0x12e72c=_0x50752e['query'][_0x48b7('0xa7')]?_0x50752e[_0x48b7('0x37')][_0x48b7('0xa7')]:null;var _0x55d7cf={'method':_0x50752e[_0x48b7('0xa8')],'uri':util[_0x48b7('0x53')](_0x48b7('0xa9'),_0xabcf0e,_0x50752e[_0x48b7('0x37')][_0x48b7('0x6')]),'json':_0x50539c,'resolveWithFullResponse':!![],'encoding':_0x12e72c,'qs':_0x50752e[_0x48b7('0x37')]};if(_0x50752e[_0x48b7('0xaa')]){_0x55d7cf[_0x48b7('0xaa')]=_0x50752e['headers'];if(_0x55d7cf[_0x48b7('0xaa')][_0x48b7('0xab')]){delete _0x55d7cf[_0x48b7('0xaa')][_0x48b7('0xab')];}}if(_0x55d7cf['headers'][_0x48b7('0xac')]){delete _0x55d7cf[_0x48b7('0xaa')][_0x48b7('0xac')];}return rp(_0x55d7cf);})[_0x48b7('0x2a')](function(_0x22ed6c){if(_0x22ed6c){_0x35554a[_0x48b7('0x25')](_0x22ed6c['headers']);logger[_0x48b7('0x68')](_0x22ed6c[_0x48b7('0x94')]);if(_[_0x48b7('0xad')](_0x50752e[_0x48b7('0x37')][_0x48b7('0x6')],'download')&&_0x22ed6c[_0x48b7('0xae')]==0x1f4){return _0x35554a[_0x48b7('0x1e')](_0x22ed6c['statusCode']);}else{return _0x35554a['status'](_0x22ed6c[_0x48b7('0xae')])[_0x48b7('0x30')](_0x22ed6c['body']);}}else{return _0x35554a[_0x48b7('0x1e')](0xc8);}})[_0x48b7('0x4a')](handleError(_0x35554a,null));};exports[_0x48b7('0xaf')]=function(_0x499f1e,_0x1ee3a4,_0x2b0573){return BPromise[_0x48b7('0xa0')]()[_0x48b7('0x2a')](function(){if(!_0x499f1e[_0x48b7('0x37')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x499f1e['query'][_0x48b7('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2ea25e=_0x499f1e[_0x48b7('0x37')]['hostname']?_0x499f1e['query']['hostname']+':'+_0x499f1e[_0x48b7('0x37')]['port']:_0x48b7('0xa5')+_0x499f1e[_0x48b7('0x37')][_0x48b7('0xa4')];var _0xe3531c=_0x499f1e[_0x48b7('0x37')]['json']?_0x499f1e['query'][_0x48b7('0xa6')]:!![];var _0x3478d7=_0x499f1e['query']['encoding']?_0x499f1e[_0x48b7('0x37')][_0x48b7('0xa7')]:null;var _0x3ec68e={'method':_0x499f1e[_0x48b7('0xa8')],'uri':util[_0x48b7('0x53')](_0x48b7('0xa9'),_0x2ea25e,_0x499f1e[_0x48b7('0x37')][_0x48b7('0x6')]),'json':_0xe3531c,'resolveWithFullResponse':!![],'encoding':_0x3478d7,'body':_0x499f1e['body']};if(_0x499f1e[_0x48b7('0xaa')]){_0x3ec68e[_0x48b7('0xaa')]=_0x499f1e['headers'];if(_0x3ec68e['headers']['content-length']){delete _0x3ec68e['headers']['content-length'];}}if(_0x3ec68e[_0x48b7('0xaa')][_0x48b7('0xac')]){delete _0x3ec68e[_0x48b7('0xaa')][_0x48b7('0xac')];}return rp(_0x3ec68e);})[_0x48b7('0x2a')](function(_0x1c0c0b){if(_0x1c0c0b){_0x1ee3a4[_0x48b7('0x25')](_0x1c0c0b[_0x48b7('0xaa')]);logger['info'](_0x1c0c0b[_0x48b7('0x94')]);return _0x1ee3a4[_0x48b7('0x24')](_0x1c0c0b[_0x48b7('0xae')])['send'](_0x1c0c0b[_0x48b7('0x94')]);}else{return _0x1ee3a4[_0x48b7('0x1e')](0xc8);}})['catch'](handleError(_0x1ee3a4,null));}; \ No newline at end of file +var _0x7dee=['undefined','limit','Content-Range','destroy','then','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','fields','options','find','join','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','server/files/plugins','dirname','attachments/**/*','finalize','close','existsSync','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x27b473,_0x1d5e06){var _0xb6a5db=function(_0x593e15){while(--_0x593e15){_0x27b473['push'](_0x27b473['shift']());}};_0xb6a5db(++_0x1d5e06);}(_0x7dee,0x84));var _0xe7de=function(_0x205399,_0x2c7589){_0x205399=_0x205399-0x0;var _0x5bd151=_0x7dee[_0x205399];return _0x5bd151;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7de('0x0'));var zipdir=require(_0xe7de('0x1'));var jsonpatch=require(_0xe7de('0x2'));var rp=require(_0xe7de('0x3'));var moment=require(_0xe7de('0x4'));var BPromise=require(_0xe7de('0x5'));var Mustache=require(_0xe7de('0x6'));var util=require(_0xe7de('0x7'));var path=require(_0xe7de('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7de('0x9'));var fs=require('fs');var fs_extra=require(_0xe7de('0xa'));var _=require(_0xe7de('0xb'));var squel=require(_0xe7de('0xc'));var crypto=require(_0xe7de('0xd'));var jsforce=require(_0xe7de('0xe'));var deskjs=require(_0xe7de('0xf'));var toCsv=require(_0xe7de('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xe7de('0x11'));var rimraf=require(_0xe7de('0x0'));var archiver=require('archiver');var Redis=require(_0xe7de('0x12'));var authService=require(_0xe7de('0x13'));var qs=require(_0xe7de('0x14'));var as=require(_0xe7de('0x15'));var hardwareService=require(_0xe7de('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe7de('0x17'));var config=require(_0xe7de('0x18'));var licenseUtil=require(_0xe7de('0x19'));var db=require(_0xe7de('0x1a'))['db'];config[_0xe7de('0x1b')]=_[_0xe7de('0x1c')](config[_0xe7de('0x1b')],{'host':_0xe7de('0x1d'),'port':0x18eb});var socket=require(_0xe7de('0x1e'))(new Redis(config[_0xe7de('0x1b')]));require('./plugin.socket')[_0xe7de('0x1f')](socket);function respondWithStatusCode(_0x6a24,_0x8e1edf){_0x8e1edf=_0x8e1edf||0xcc;return function(_0x44b1f0){if(_0x44b1f0){return _0x6a24[_0xe7de('0x20')](_0x8e1edf);}return _0x6a24[_0xe7de('0x21')](_0x8e1edf)[_0xe7de('0x22')]();};}function respondWithResult(_0x572050,_0x2fc30d){_0x2fc30d=_0x2fc30d||0xc8;return function(_0x490760){if(_0x490760){return _0x572050[_0xe7de('0x21')](_0x2fc30d)[_0xe7de('0x23')](_0x490760);}};}function respondWithFilteredResult(_0x4cc66d,_0x38387e){return function(_0xff6f93){if(_0xff6f93){var _0x376ae6=typeof _0x38387e[_0xe7de('0x24')]===_0xe7de('0x25')&&typeof _0x38387e[_0xe7de('0x26')]===_0xe7de('0x25');var _0x1db651=_0xff6f93['count'];var _0xa7b35e=_0x376ae6?0x0:_0x38387e[_0xe7de('0x24')];var _0xb70b26=_0x376ae6?_0xff6f93['count']:_0x38387e[_0xe7de('0x24')]+_0x38387e[_0xe7de('0x26')];var _0x35d3d5;if(_0xb70b26>=_0x1db651){_0xb70b26=_0x1db651;_0x35d3d5=0xc8;}else{_0x35d3d5=0xce;}_0x4cc66d[_0xe7de('0x21')](_0x35d3d5);return _0x4cc66d['set'](_0xe7de('0x27'),_0xa7b35e+'-'+_0xb70b26+'/'+_0x1db651)[_0xe7de('0x23')](_0xff6f93);}return null;};}function patchUpdates(_0xaaae19){return function(_0x350203){try{jsonpatch['apply'](_0x350203,_0xaaae19,!![]);}catch(_0x201846){return BPromise['reject'](_0x201846);}return _0x350203['save']();};}function saveUpdates(_0x4589da,_0x3fd4b5){return function(_0x41ab19){if(_0x41ab19){return _0x41ab19['update'](_0x4589da)['then'](function(_0x23ae30){return _0x23ae30;});}return null;};}function removeEntity(_0x1db1f1,_0xba11be){return function(_0x2d2476){if(_0x2d2476){return _0x2d2476[_0xe7de('0x28')]()[_0xe7de('0x29')](function(){var _0x3177dd=_0x2d2476['get']({'plain':!![]});var _0x12c59b='Plugins';return db[_0xe7de('0x2a')][_0xe7de('0x28')]({'where':{'type':_0x12c59b,'resourceId':_0x3177dd['id']}})[_0xe7de('0x29')](function(){return _0x2d2476;});})['then'](function(){_0x1db1f1[_0xe7de('0x21')](0xcc)[_0xe7de('0x22')]();});}};}function handleEntityNotFound(_0xe251f5,_0x487b83){return function(_0x4d19a1){if(!_0x4d19a1){_0xe251f5[_0xe7de('0x20')](0x194);}return _0x4d19a1;};}function handleError(_0x2901e1,_0x2628c5){_0x2628c5=_0x2628c5||0x1f4;return function(_0x3e0525){logger[_0xe7de('0x2b')](_0x3e0525[_0xe7de('0x2c')]);if(_0x3e0525['name']){delete _0x3e0525[_0xe7de('0x2d')];}_0x2901e1[_0xe7de('0x21')](_0x2628c5)[_0xe7de('0x2e')](_0x3e0525);};}exports[_0xe7de('0x2f')]=function(_0x59e948,_0x274db0){var _0x3e1936={},_0x3045f5={},_0x1b27ec={'count':0x0,'rows':[]};var _0x163641=_[_0xe7de('0x30')](db[_0xe7de('0x31')][_0xe7de('0x32')],function(_0x4f1cb4){return{'name':_0x4f1cb4[_0xe7de('0x33')],'type':_0x4f1cb4['type'][_0xe7de('0x34')]};});_0x3045f5['model']=_[_0xe7de('0x30')](_0x163641,_0xe7de('0x2d'));_0x3045f5[_0xe7de('0x35')]=_[_0xe7de('0x36')](_0x59e948[_0xe7de('0x35')]);_0x3045f5['filters']=_['intersection'](_0x3045f5[_0xe7de('0x37')],_0x3045f5[_0xe7de('0x35')]);_0x3e1936[_0xe7de('0x38')]=_[_0xe7de('0x39')](_0x3045f5['model'],qs['fields'](_0x59e948[_0xe7de('0x35')]['fields']));_0x3e1936[_0xe7de('0x38')]=_0x3e1936[_0xe7de('0x38')][_0xe7de('0x3a')]?_0x3e1936[_0xe7de('0x38')]:_0x3045f5[_0xe7de('0x37')];if(!_0x59e948[_0xe7de('0x35')]['hasOwnProperty'](_0xe7de('0x3b'))){_0x3e1936[_0xe7de('0x26')]=qs['limit'](_0x59e948['query'][_0xe7de('0x26')]);_0x3e1936['offset']=qs[_0xe7de('0x24')](_0x59e948[_0xe7de('0x35')]['offset']);}_0x3e1936[_0xe7de('0x3c')]=qs[_0xe7de('0x3d')](_0x59e948[_0xe7de('0x35')]['sort']);_0x3e1936['where']=qs[_0xe7de('0x3e')](_[_0xe7de('0x3f')](_0x59e948[_0xe7de('0x35')],_0x3045f5[_0xe7de('0x3e')]),_0x163641);if(_0x59e948['query'][_0xe7de('0x40')]){_0x3e1936[_0xe7de('0x41')]=_[_0xe7de('0x42')](_0x3e1936['where'],{'$or':_[_0xe7de('0x30')](_0x163641,function(_0x3925c1){if(_0x3925c1[_0xe7de('0x43')]!==_0xe7de('0x44')){var _0x49c8ce={};_0x49c8ce[_0x3925c1['name']]={'$like':'%'+_0x59e948['query'][_0xe7de('0x40')]+'%'};return _0x49c8ce;}})});}_0x3e1936=_[_0xe7de('0x42')]({},_0x3e1936,_0x59e948['options']);var _0x5b5133={'where':_0x3e1936[_0xe7de('0x41')]};return db[_0xe7de('0x31')][_0xe7de('0x45')](_0x5b5133)[_0xe7de('0x29')](function(_0x4a85b0){_0x1b27ec[_0xe7de('0x45')]=_0x4a85b0;if(_0x59e948[_0xe7de('0x35')][_0xe7de('0x46')]){_0x3e1936[_0xe7de('0x47')]=[{'all':!![]}];}return db[_0xe7de('0x31')][_0xe7de('0x48')](_0x3e1936);})[_0xe7de('0x29')](function(_0x221818){_0x1b27ec[_0xe7de('0x49')]=_0x221818;return _0x1b27ec;})[_0xe7de('0x29')](respondWithFilteredResult(_0x274db0,_0x3e1936))[_0xe7de('0x4a')](handleError(_0x274db0,null));};exports[_0xe7de('0x4b')]=function(_0x3726c0,_0x47cdad){var _0x4788a4={'raw':!![],'where':{'id':_0x3726c0[_0xe7de('0x4c')]['id']}},_0x28c182={};_0x28c182['model']=_[_0xe7de('0x36')](db[_0xe7de('0x31')][_0xe7de('0x32')]);_0x28c182[_0xe7de('0x35')]=_['keys'](_0x3726c0[_0xe7de('0x35')]);_0x28c182[_0xe7de('0x3e')]=_[_0xe7de('0x39')](_0x28c182[_0xe7de('0x37')],_0x28c182[_0xe7de('0x35')]);_0x4788a4[_0xe7de('0x38')]=_['intersection'](_0x28c182['model'],qs[_0xe7de('0x4d')](_0x3726c0[_0xe7de('0x35')]['fields']));_0x4788a4[_0xe7de('0x38')]=_0x4788a4[_0xe7de('0x38')][_0xe7de('0x3a')]?_0x4788a4['attributes']:_0x28c182[_0xe7de('0x37')];if(_0x3726c0['query'][_0xe7de('0x46')]){_0x4788a4[_0xe7de('0x47')]=[{'all':!![]}];}_0x4788a4=_[_0xe7de('0x42')]({},_0x4788a4,_0x3726c0[_0xe7de('0x4e')]);return db[_0xe7de('0x31')][_0xe7de('0x4f')](_0x4788a4)[_0xe7de('0x29')](handleEntityNotFound(_0x47cdad,null))[_0xe7de('0x29')](respondWithResult(_0x47cdad,null))['catch'](handleError(_0x47cdad,null));};exports['download']=function(_0x3d0882,_0x36a6cf,_0x27fb26){return db[_0xe7de('0x31')][_0xe7de('0x4f')]({'where':{'id':_0x3d0882[_0xe7de('0x4c')]['id']},'attributes':[_0xe7de('0x2d'),_0xe7de('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x36a6cf,null))['then'](function(_0x54e8c8){if(_0x54e8c8){var _0x296d85=path[_0xe7de('0x50')](config['root'],'server/files/plugins',util[_0xe7de('0x51')](_0xe7de('0x52'),path[_0xe7de('0x53')](_0x54e8c8['path'])));var _0x4e8a9d=fs[_0xe7de('0x54')](_0x296d85);var _0x10eb1c=archiver(_0xe7de('0x55'),{'zlib':{'level':0x9}});_0x10eb1c['on']('warning',function(_0xf627cc){if(_0xf627cc[_0xe7de('0x56')]===_0xe7de('0x57')){logger['error'](_0xf627cc);}else{throw new db[(_0xe7de('0x58'))][(_0xe7de('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x10eb1c['on']('error',function(_0x13aa67){throw new db['Sequelize'][(_0xe7de('0x59'))](_0xe7de('0x5a'));});_0x10eb1c[_0xe7de('0x5b')](_0x4e8a9d);_0x10eb1c[_0xe7de('0x5c')]('**/*',{'cwd':path[_0xe7de('0x50')](config[_0xe7de('0x5d')],_0xe7de('0x5e'),path[_0xe7de('0x5f')](_0x54e8c8[_0xe7de('0x8')])),'ignore':[path[_0xe7de('0x50')](path[_0xe7de('0x53')](_0x54e8c8['path']),'node_modules/**/*'),path[_0xe7de('0x50')](path[_0xe7de('0x53')](_0x54e8c8[_0xe7de('0x8')]),_0xe7de('0x60'))],'nodir':!![]})[_0xe7de('0x61')]();_0x4e8a9d['on'](_0xe7de('0x62'),function(){if(!fs[_0xe7de('0x63')](_0x296d85)){throw new db['Sequelize'][(_0xe7de('0x59'))]('Plugin\x20not\x20found');}return _0x36a6cf[_0xe7de('0x64')](_0x296d85,util[_0xe7de('0x51')]('%s.zip',path[_0xe7de('0x53')](_0x54e8c8['path'])),function(_0x5a4d3a){if(_0x5a4d3a){throw new db[(_0xe7de('0x58'))][(_0xe7de('0x59'))](_0xe7de('0x65'));}fs[_0xe7de('0x66')](_0x296d85);logger[_0xe7de('0x67')]('Download\x20completed');logger[_0xe7de('0x67')](_0xe7de('0x68'));});});}return null;})[_0xe7de('0x4a')](handleError(_0x36a6cf,null));};exports[_0xe7de('0x69')]=function(_0x2d7448,_0x140a88,_0x29655c){var _0x4add30=path[_0xe7de('0x53')](_0x2d7448[_0xe7de('0x6a')][_0xe7de('0x6b')],path['extname'](_0x2d7448[_0xe7de('0x6a')][_0xe7de('0x6b')]));var _0x15e00b=path['join'](config['root'],_0xe7de('0x5e'),_0x2d7448['file']['filename']);var _0x2316d0=path['join'](config[_0xe7de('0x5d')],_0xe7de('0x5e'),_0x4add30);logger['info'](_0xe7de('0x6c'),_0x15e00b);logger[_0xe7de('0x67')](_0xe7de('0x6d'),_0x2316d0);try{fs[_0xe7de('0x6e')](_0x15e00b,parseInt('0777',0x8));extract(_0x15e00b,{'dir':_0x2316d0},function(_0x1b6293){if(_0x1b6293){logger[_0xe7de('0x2b')](_0x1b6293);handleError(_0x1b6293,!![]);};var _0x22c3fd=fs['readdirSync'](_0x2316d0);if(_0x22c3fd[_0xe7de('0x3a')]>0x1){removeReferences(_0x15e00b,_0x2316d0);logger[_0xe7de('0x2b')](_0xe7de('0x6f'));return _0x29655c(new Error(_0xe7de('0x6f')));}var _0x1915c9=fs['lstatSync'](path[_0xe7de('0x50')](_0x2316d0,_0x22c3fd[0x0]));if(_0x1915c9[_0xe7de('0x70')]()){removeReferences(_0x15e00b,_0x2316d0);logger[_0xe7de('0x2b')](_0xe7de('0x6f'));return _0x29655c(new Error('Invalid\x20plugin\x20structure'));}if(_0x1915c9[_0xe7de('0x71')]()){var _0x4694ea=fs[_0xe7de('0x72')](path[_0xe7de('0x50')](_0x2316d0,_0x22c3fd[0x0]));if(_0x4694ea[_0xe7de('0x3a')]===0x0){removeReferences(_0x15e00b,_0x2316d0);logger[_0xe7de('0x2b')](_0xe7de('0x6f'));return _0x29655c(new Error(_0xe7de('0x6f')));}var _0x46d313=_0x4694ea['some'](function(_0x276ea4){return _0x276ea4===_0xe7de('0x73');});if(!_0x46d313){return _0x29655c(new Error(_0xe7de('0x74')));}var _0x502dc6=fs[_0xe7de('0x75')](path['join'](_0x2316d0,_0x22c3fd[0x0],'manifest.json'));var _0xeb23d0=JSON[_0xe7de('0x76')](_0x502dc6);if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x2d')]){return _0x29655c(new Error(_0xe7de('0x77')));}if(_0xe7de('0x25')==typeof _0xeb23d0['type']){return _0x29655c(new Error(_0xe7de('0x78')));}if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x79')]){return _0x29655c(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xe7de('0x25')==typeof _0xeb23d0['parameters']){return _0x29655c(new Error(_0xe7de('0x7a')));}if(_0xeb23d0[_0xe7de('0x43')]===_0xe7de('0x7b')){if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')]){return _0x29655c(new Error(_0xe7de('0x7e')));}if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')][_0xe7de('0x7f')]&&'undefined'==typeof _0xeb23d0['parameters'][_0xe7de('0x7d')][_0xe7de('0x80')]){return _0x29655c(new Error(_0xe7de('0x81')));}}else if(_0xeb23d0['type']===_0xe7de('0x82')){if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x83')]){return _0x29655c(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xe7de('0x25')==typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x84')]){return _0x29655c(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x29655c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x36eaf1=_0xeb23d0[_0xe7de('0x2d')];var _0x235073=_0xeb23d0[_0xe7de('0x85')];var _0x27c9db=_0xeb23d0[_0xe7de('0x43')];var _0x1f9e97=_0xeb23d0['sidebar']?_0xeb23d0[_0xe7de('0x86')]:'always';var _0x4998fa=_0xeb23d0['icon']?_0xeb23d0[_0xe7de('0x87')]:_0xe7de('0x88');var _0x5d95a6='';var _0x9a2952='';var _0x568398='';var _0xecb0a1='';var _0x1a3577=_0xeb23d0[_0xe7de('0x79')];if(_0x27c9db===_0xe7de('0x7b')){if(_0xe7de('0x25')!=typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')][_0xe7de('0x7f')]){var _0x1f6e16=_0xeb23d0['parameters'][_0xe7de('0x7d')][_0xe7de('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xe7de('0x89')](_0x1f6e16)){_0x5d95a6=path['join']('plugins',_0x4add30,_0x22c3fd[0x0],_0x1f6e16);}else{_0x5d95a6=_0x1f6e16;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0xeb23d0['parameters'][_0xe7de('0x7d')][_0xe7de('0x80')]){var _0x42d7dd=_0xeb23d0['parameters'][_0xe7de('0x7d')][_0xe7de('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xe7de('0x89')](_0x42d7dd)){_0x9a2952=path['join'](_0xe7de('0x8a'),_0x4add30,_0x22c3fd[0x0],_0x42d7dd);}else{_0x9a2952=_0x42d7dd;}}else{logger[_0xe7de('0x67')](_0xe7de('0x8b'));}}else if(_0x27c9db===_0xe7de('0x82')){_0x568398=_0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x83')];_0xecb0a1=_0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x84')];if(_0xe7de('0x25')!=typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')]){if(_0xe7de('0x25')!=typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')][_0xe7de('0x7f')]){var _0x1f6e16=_0xeb23d0[_0xe7de('0x7c')]['views'][_0xe7de('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xe7de('0x89')](_0x1f6e16)){_0x5d95a6=path[_0xe7de('0x50')](_0xe7de('0x8a'),_0x4add30,_0x22c3fd[0x0],_0x1f6e16);}else{_0x5d95a6=_0x1f6e16;}}if(_0xe7de('0x25')!=typeof _0xeb23d0[_0xe7de('0x7c')][_0xe7de('0x7d')][_0xe7de('0x80')]){var _0x42d7dd=_0xeb23d0[_0xe7de('0x7c')]['views'][_0xe7de('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x42d7dd)){_0x9a2952=path[_0xe7de('0x50')](_0xe7de('0x8a'),_0x4add30,_0x22c3fd[0x0],_0x42d7dd);}else{_0x9a2952=_0x42d7dd;}}}}var _0x455ec2={'name':_0x36eaf1,'description':_0x235073,'path':path[_0xe7de('0x50')](_0x4add30,_0x22c3fd[0x0]),'type':_0x27c9db,'sidebar':_0x1f9e97,'icon':_0x4998fa,'adminUrl':_0x5d95a6,'agentUrl':_0x9a2952,'scriptName':_0x568398,'scriptPath':_0xecb0a1,'version':_0x1a3577};removeReferences(_0x15e00b,null);return db['Plugin']['create'](_0x455ec2)[_0xe7de('0x29')](function(_0x29576b){var _0x50c3fd={'role':_0x2d7448[_0xe7de('0x8c')][_0xe7de('0x8d')],'userProfileId':_0x2d7448[_0xe7de('0x8c')][_0xe7de('0x8e')]};if(!_0x50c3fd)throw new Error(_0xe7de('0x8f'));if(_0x50c3fd['role']===_0xe7de('0x90')){var _0x3ae61a=_0x29576b[_0xe7de('0x91')]({'plain':!![]});return db[_0xe7de('0x92')][_0xe7de('0x4f')]({'where':{'name':_0xe7de('0x93'),'userProfileId':_0x50c3fd['userProfileId']},'raw':!![]})[_0xe7de('0x29')](function(_0x46e477){if(_0x46e477&&_0x46e477[_0xe7de('0x94')]===0x0){return db[_0xe7de('0x2a')]['create']({'name':_0x3ae61a[_0xe7de('0x2d')],'resourceId':_0x3ae61a['id'],'type':_0x46e477['name'],'sectionId':_0x46e477['id']},{})[_0xe7de('0x29')](function(){return _0x29576b;});}else{return _0x29576b;}})[_0xe7de('0x4a')](function(_0x4cba4a){logger[_0xe7de('0x2b')](_0xe7de('0x95'),_0x4cba4a);throw _0x4cba4a;});}return _0x29576b;})['then'](respondWithResult(_0x140a88,null))[_0xe7de('0x4a')](handleError(_0x140a88,null));}});}catch(_0x463045){_0x140a88[_0xe7de('0x21')](0x1f4)['send'](_0x463045);}};function removeReferences(_0x41038c,_0x909c4b){try{if(_0x41038c){fs[_0xe7de('0x66')](_0x41038c);logger[_0xe7de('0x67')]('Zip\x20archive\x20removed');}if(_0x909c4b){rimraf(_0x909c4b,function(){});logger[_0xe7de('0x67')](_0xe7de('0x96'));}}catch(_0x3fa578){logger[_0xe7de('0x2b')](_0x3fa578);}}exports[_0xe7de('0x97')]=function(_0x2308f0,_0x1be311,_0x1eb5d7){return db[_0xe7de('0x31')]['find']({'where':{'id':_0x2308f0[_0xe7de('0x4c')]['id']}})[_0xe7de('0x29')](handleEntityNotFound(_0x1be311,null))[_0xe7de('0x29')](saveUpdates(_0x2308f0['body'],null))[_0xe7de('0x29')](respondWithResult(_0x1be311,null))[_0xe7de('0x4a')](handleError(_0x1be311,null));};exports[_0xe7de('0x98')]=function(_0x3f66e5,_0x33bf08,_0x22b583){return db[_0xe7de('0x31')][_0xe7de('0x4f')]({'where':{'id':_0x3f66e5[_0xe7de('0x4c')]['id']}})[_0xe7de('0x29')](function(_0x28cbee){if(_0x28cbee){return _0x28cbee['destroy']();}})[_0xe7de('0x29')](function(_0x195c9c){rimraf(path['join'](config[_0xe7de('0x5d')],'server/files/plugins',path[_0xe7de('0x5f')](_0x195c9c[_0xe7de('0x8')])),function(){});return _0x195c9c;})[_0xe7de('0x29')](handleEntityNotFound(_0x33bf08,null))[_0xe7de('0x29')](respondWithStatusCode(_0x33bf08,null))[_0xe7de('0x4a')](handleError(_0x33bf08,null));};exports[_0xe7de('0x99')]=function(_0x553042,_0x1faf7d,_0xccfd29){return BPromise[_0xe7de('0x9a')]()[_0xe7de('0x29')](function(){if(!_0x553042[_0xe7de('0x35')][_0xe7de('0x8')]){throw new Error(_0xe7de('0x9b'));}if(!_0x553042['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x240008=_0x553042[_0xe7de('0x35')][_0xe7de('0x9c')]?_0x553042['query']['hostname']+':'+_0x553042['query'][_0xe7de('0x9d')]:_0xe7de('0x9e')+_0x553042[_0xe7de('0x35')][_0xe7de('0x9d')];var _0x2a5053=_0x553042[_0xe7de('0x35')][_0xe7de('0x23')]?_0x553042[_0xe7de('0x35')][_0xe7de('0x23')]:!![];var _0x21994f=_0x553042['query']['encoding']?_0x553042[_0xe7de('0x35')]['encoding']:null;var _0x5dc5f3={'method':_0x553042[_0xe7de('0x9f')],'uri':util['format'](_0xe7de('0xa0'),_0x240008,_0x553042[_0xe7de('0x35')][_0xe7de('0x8')]),'json':_0x2a5053,'resolveWithFullResponse':!![],'encoding':_0x21994f,'qs':_0x553042[_0xe7de('0x35')]};if(_0x553042['headers']){_0x5dc5f3[_0xe7de('0xa1')]=_0x553042[_0xe7de('0xa1')];if(_0x5dc5f3[_0xe7de('0xa1')][_0xe7de('0xa2')]){delete _0x5dc5f3[_0xe7de('0xa1')][_0xe7de('0xa2')];}}if(_0x5dc5f3[_0xe7de('0xa1')][_0xe7de('0xa3')]){delete _0x5dc5f3[_0xe7de('0xa1')]['content-type'];}return rp(_0x5dc5f3);})[_0xe7de('0x29')](function(_0x5c5f6f){if(_0x5c5f6f){_0x1faf7d[_0xe7de('0xa4')](_0x5c5f6f['headers']);logger[_0xe7de('0x67')](_0x5c5f6f[_0xe7de('0x8c')]);if(_[_0xe7de('0xa5')](_0x553042[_0xe7de('0x35')][_0xe7de('0x8')],_0xe7de('0x64'))&&_0x5c5f6f['statusCode']==0x1f4){return _0x1faf7d[_0xe7de('0x20')](_0x5c5f6f[_0xe7de('0xa6')]);}else{return _0x1faf7d['status'](_0x5c5f6f[_0xe7de('0xa6')])[_0xe7de('0x2e')](_0x5c5f6f[_0xe7de('0x8c')]);}}else{return _0x1faf7d['sendStatus'](0xc8);}})['catch'](handleError(_0x1faf7d,null));};exports['webhookPost']=function(_0x509fcc,_0x3c20ff,_0x54de97){return BPromise[_0xe7de('0x9a')]()[_0xe7de('0x29')](function(){if(!_0x509fcc['query'][_0xe7de('0x8')]){throw new Error(_0xe7de('0x9b'));}if(!_0x509fcc[_0xe7de('0x35')][_0xe7de('0x9d')]){throw new Error(_0xe7de('0xa7'));}var _0x5949b0=_0x509fcc[_0xe7de('0x35')]['hostname']?_0x509fcc['query']['hostname']+':'+_0x509fcc[_0xe7de('0x35')]['port']:_0xe7de('0x9e')+_0x509fcc['query']['port'];var _0x5cea93=_0x509fcc[_0xe7de('0x35')][_0xe7de('0x23')]?_0x509fcc[_0xe7de('0x35')][_0xe7de('0x23')]:!![];var _0x566a63=_0x509fcc[_0xe7de('0x35')][_0xe7de('0xa8')]?_0x509fcc[_0xe7de('0x35')][_0xe7de('0xa8')]:null;var _0x2e986c={'method':_0x509fcc['method'],'uri':util['format'](_0xe7de('0xa0'),_0x5949b0,_0x509fcc[_0xe7de('0x35')][_0xe7de('0x8')]),'json':_0x5cea93,'resolveWithFullResponse':!![],'encoding':_0x566a63,'body':_0x509fcc[_0xe7de('0x8c')]};if(_0x509fcc[_0xe7de('0xa1')]){_0x2e986c[_0xe7de('0xa1')]=_0x509fcc[_0xe7de('0xa1')];if(_0x2e986c[_0xe7de('0xa1')][_0xe7de('0xa2')]){delete _0x2e986c[_0xe7de('0xa1')][_0xe7de('0xa2')];}}if(_0x2e986c[_0xe7de('0xa1')][_0xe7de('0xa3')]){delete _0x2e986c[_0xe7de('0xa1')][_0xe7de('0xa3')];}return rp(_0x2e986c);})['then'](function(_0x1ef133){if(_0x1ef133){_0x3c20ff[_0xe7de('0xa4')](_0x1ef133['headers']);logger[_0xe7de('0x67')](_0x1ef133[_0xe7de('0x8c')]);return _0x3c20ff[_0xe7de('0x21')](_0x1ef133['statusCode'])[_0xe7de('0x2e')](_0x1ef133[_0xe7de('0x8c')]);}else{return _0x3c20ff[_0xe7de('0x20')](0xc8);}})[_0xe7de('0x4a')](handleError(_0x3c20ff,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 5f3bb1e..1339d06 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 _0x7412=['setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x180e9d,_0x4d3f4b){var _0x5eb591=function(_0x2dd17c){while(--_0x2dd17c){_0x180e9d['push'](_0x180e9d['shift']());}};_0x5eb591(++_0x4d3f4b);}(_0x7412,0x161));var _0x2741=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7412[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x2741('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2741('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2741('0x2'),'afterDestroy':'remove'};function emitEvent(_0x51d3c5){return function(_0x509ce6,_0x552836,_0x521b65){PluginEvents['emit'](_0x51d3c5+':'+_0x509ce6['id'],_0x509ce6);PluginEvents[_0x2741('0x3')](_0x51d3c5,_0x509ce6);_0x521b65(null);};}for(var e in events){if(events[_0x2741('0x4')](e)){var event=events[e];Plugin[_0x2741('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7e4b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3ad3f1,_0xaae963){var _0x3365d8=function(_0x7ae7c7){while(--_0x7ae7c7){_0x3ad3f1['push'](_0x3ad3f1['shift']());}};_0x3365d8(++_0xaae963);}(_0x7e4b,0x84));var _0xb7e4=function(_0x25bab2,_0x2a53a6){_0x25bab2=_0x25bab2-0x0;var _0x2d7339=_0x7e4b[_0x25bab2];return _0x2d7339;};'use strict';var EventEmitter=require(_0xb7e4('0x0'));var Plugin=require(_0xb7e4('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xb7e4('0x2')](0x0);var events={'afterCreate':_0xb7e4('0x3'),'afterUpdate':'update','afterDestroy':_0xb7e4('0x4')};function emitEvent(_0x1d32fd){return function(_0x2fca1d,_0x32f781,_0xb51013){PluginEvents[_0xb7e4('0x5')](_0x1d32fd+':'+_0x2fca1d['id'],_0x2fca1d);PluginEvents[_0xb7e4('0x5')](_0x1d32fd,_0x2fca1d);_0xb51013(null);};}for(var e in events){if(events[_0xb7e4('0x6')](e)){var event=events[e];Plugin[_0xb7e4('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4172e06..f49990c 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 _0x7543=['api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7543,0x191));var _0x3754=function(_0x456ca0,_0x25aa28){_0x456ca0=_0x456ca0-0x0;var _0x3d200e=_0x7543[_0x456ca0];return _0x3d200e;};'use strict';var _=require(_0x3754('0x0'));var util=require('util');var logger=require(_0x3754('0x1'))(_0x3754('0x2'));var moment=require(_0x3754('0x3'));var BPromise=require(_0x3754('0x4'));var rp=require(_0x3754('0x5'));var fs=require('fs');var path=require(_0x3754('0x6'));var rimraf=require('rimraf');var config=require(_0x3754('0x7'));var attributes=require(_0x3754('0x8'));module[_0x3754('0x9')]=function(_0x41ce5,_0x2c50f6){return _0x41ce5[_0x3754('0xa')](_0x3754('0xb'),attributes,{'tableName':_0x3754('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36f3=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4c27dd,_0x4b7630){var _0x2ba55b=function(_0x194ed1){while(--_0x194ed1){_0x4c27dd['push'](_0x4c27dd['shift']());}};_0x2ba55b(++_0x4b7630);}(_0x36f3,0x19c));var _0x336f=function(_0x50c2de,_0x32fdfd){_0x50c2de=_0x50c2de-0x0;var _0x2347e0=_0x36f3[_0x50c2de];return _0x2347e0;};'use strict';var _=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var logger=require(_0x336f('0x2'))(_0x336f('0x3'));var moment=require('moment');var BPromise=require(_0x336f('0x4'));var rp=require(_0x336f('0x5'));var fs=require('fs');var path=require(_0x336f('0x6'));var rimraf=require(_0x336f('0x7'));var config=require(_0x336f('0x8'));var attributes=require(_0x336f('0x9'));module[_0x336f('0xa')]=function(_0x299e92,_0x21b8d8){return _0x299e92[_0x336f('0xb')](_0x336f('0xc'),attributes,{'tableName':_0x336f('0xd'),'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 fdc6680..c00cf5b 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 _0xff30=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40b9d0,_0x3537da){var _0x144b8d=function(_0x3071b5){while(--_0x3071b5){_0x40b9d0['push'](_0x40b9d0['shift']());}};_0x144b8d(++_0x3537da);}(_0xff30,0x104));var _0x0ff3=function(_0x3cc1e1,_0x16a00a){_0x3cc1e1=_0x3cc1e1-0x0;var _0x47260d=_0xff30[_0x3cc1e1];return _0x47260d;};'use strict';var _=require(_0x0ff3('0x0'));var util=require(_0x0ff3('0x1'));var moment=require(_0x0ff3('0x2'));var BPromise=require(_0x0ff3('0x3'));var rs=require(_0x0ff3('0x4'));var fs=require('fs');var Redis=require(_0x0ff3('0x5'));var db=require(_0x0ff3('0x6'))['db'];var utils=require(_0x0ff3('0x7'));var logger=require(_0x0ff3('0x8'))(_0x0ff3('0x9'));var config=require(_0x0ff3('0xa'));var jayson=require(_0x0ff3('0xb'));var client=jayson[_0x0ff3('0xc')][_0x0ff3('0xd')]({'port':0x232a});config[_0x0ff3('0xe')]=_[_0x0ff3('0xf')](config[_0x0ff3('0xe')],{'host':_0x0ff3('0x10'),'port':0x18eb});var socket=require(_0x0ff3('0x11'))(new Redis(config['redis']));require(_0x0ff3('0x12'))[_0x0ff3('0x13')](socket);function respondWithRpcPromise(_0xd4e409,_0x1660ba,_0x4df47e){return new BPromise(function(_0x11cdac,_0x5e77c6){return client[_0x0ff3('0x14')](_0xd4e409,_0x4df47e)[_0x0ff3('0x15')](function(_0x3fb69c){logger['info']('Plugin,\x20%s,\x20%s',_0x1660ba,_0x0ff3('0x16'));logger[_0x0ff3('0x17')](_0x0ff3('0x18'),_0x1660ba,_0x0ff3('0x16'),JSON['stringify'](_0x3fb69c));if(_0x3fb69c[_0x0ff3('0x19')]){if(_0x3fb69c[_0x0ff3('0x19')]['code']===0x1f4){logger[_0x0ff3('0x19')](_0x0ff3('0x1a'),_0x1660ba,_0x3fb69c[_0x0ff3('0x19')]['message']);return _0x5e77c6(_0x3fb69c[_0x0ff3('0x19')][_0x0ff3('0x1b')]);}logger['error'](_0x0ff3('0x1a'),_0x1660ba,_0x3fb69c['error']['message']);return _0x11cdac(_0x3fb69c[_0x0ff3('0x19')][_0x0ff3('0x1b')]);}else{logger[_0x0ff3('0x1c')]('Plugin,\x20%s,\x20%s',_0x1660ba,_0x0ff3('0x16'));_0x11cdac(_0x3fb69c[_0x0ff3('0x1d')][_0x0ff3('0x1b')]);}})[_0x0ff3('0x1e')](function(_0x3e2ce1){logger['error']('Plugin,\x20%s,\x20%s',_0x1660ba,_0x3e2ce1);_0x5e77c6(_0x3e2ce1);});});}exports[_0x0ff3('0x1f')]=function(_0x25e25c){var _0x54b582=this;return new Promise(function(_0x5c9125,_0x48ade1){return db[_0x0ff3('0x20')][_0x0ff3('0x21')](_0x25e25c[_0x0ff3('0x22')],{'raw':_0x25e25c[_0x0ff3('0x23')]?_0x25e25c[_0x0ff3('0x23')][_0x0ff3('0x24')]===undefined?!![]:![]:!![]})[_0x0ff3('0x15')](function(_0x3649a6){logger['info'](_0x0ff3('0x1f'),_0x25e25c);logger[_0x0ff3('0x17')](_0x0ff3('0x1f'),_0x25e25c,JSON[_0x0ff3('0x25')](_0x3649a6));_0x5c9125(_0x3649a6);})['catch'](function(_0x12f2bd){logger['error']('CreatePlugin',_0x12f2bd['message'],_0x25e25c);_0x48ade1(_0x54b582['error'](0x1f4,_0x12f2bd[_0x0ff3('0x1b')]));});});}; \ No newline at end of file +var _0x98d0=['register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x98d0,0x171));var _0x098d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x98d0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x098d('0x0'));var util=require('util');var moment=require(_0x098d('0x1'));var BPromise=require(_0x098d('0x2'));var rs=require(_0x098d('0x3'));var fs=require('fs');var Redis=require(_0x098d('0x4'));var db=require(_0x098d('0x5'))['db'];var utils=require(_0x098d('0x6'));var logger=require('../../config/logger')(_0x098d('0x7'));var config=require(_0x098d('0x8'));var jayson=require(_0x098d('0x9'));var client=jayson[_0x098d('0xa')][_0x098d('0xb')]({'port':0x232a});config[_0x098d('0xc')]=_[_0x098d('0xd')](config[_0x098d('0xc')],{'host':_0x098d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x098d('0xc')]));require(_0x098d('0xf'))[_0x098d('0x10')](socket);function respondWithRpcPromise(_0x2a93f9,_0xfc62fb,_0x364d6f){return new BPromise(function(_0x5b524a,_0xa8e2c7){return client[_0x098d('0x11')](_0x2a93f9,_0x364d6f)[_0x098d('0x12')](function(_0x3ab00e){logger[_0x098d('0x13')](_0x098d('0x14'),_0xfc62fb,'request\x20sent');logger[_0x098d('0x15')](_0x098d('0x16'),_0xfc62fb,_0x098d('0x17'),JSON[_0x098d('0x18')](_0x3ab00e));if(_0x3ab00e[_0x098d('0x19')]){if(_0x3ab00e[_0x098d('0x19')][_0x098d('0x1a')]===0x1f4){logger[_0x098d('0x19')](_0x098d('0x14'),_0xfc62fb,_0x3ab00e[_0x098d('0x19')][_0x098d('0x1b')]);return _0xa8e2c7(_0x3ab00e[_0x098d('0x19')][_0x098d('0x1b')]);}logger['error']('Plugin,\x20%s,\x20%s',_0xfc62fb,_0x3ab00e[_0x098d('0x19')]['message']);return _0x5b524a(_0x3ab00e['error'][_0x098d('0x1b')]);}else{logger[_0x098d('0x13')](_0x098d('0x14'),_0xfc62fb,_0x098d('0x17'));_0x5b524a(_0x3ab00e[_0x098d('0x1c')]['message']);}})[_0x098d('0x1d')](function(_0x5db83e){logger[_0x098d('0x19')](_0x098d('0x14'),_0xfc62fb,_0x5db83e);_0xa8e2c7(_0x5db83e);});});}exports[_0x098d('0x1e')]=function(_0x362a42){var _0x28fbdc=this;return new Promise(function(_0x55873b,_0xbc2145){return db['Plugin'][_0x098d('0x1f')](_0x362a42[_0x098d('0x20')],{'raw':_0x362a42[_0x098d('0x21')]?_0x362a42[_0x098d('0x21')][_0x098d('0x22')]===undefined?!![]:![]:!![]})[_0x098d('0x12')](function(_0x6432f6){logger['info'](_0x098d('0x1e'),_0x362a42);logger[_0x098d('0x15')](_0x098d('0x1e'),_0x362a42,JSON[_0x098d('0x18')](_0x6432f6));_0x55873b(_0x6432f6);})[_0x098d('0x1d')](function(_0xf65f95){logger['error'](_0x098d('0x1e'),_0xf65f95[_0x098d('0x1b')],_0x362a42);_0xbc2145(_0x28fbdc[_0x098d('0x19')](0x1f4,_0xf65f95[_0x098d('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4fd6548..27df916 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 _0x3b17=['plugin:','./plugin.events','save','remove','emit','removeListener','register'];(function(_0x3db943,_0xfdfca1){var _0x17331c=function(_0x48c16f){while(--_0x48c16f){_0x3db943['push'](_0x3db943['shift']());}};_0x17331c(++_0xfdfca1);}(_0x3b17,0x112));var _0x73b1=function(_0x21006a,_0x434da){_0x21006a=_0x21006a-0x0;var _0x2dedaa=_0x3b17[_0x21006a];return _0x2dedaa;};'use strict';var PluginEvents=require(_0x73b1('0x0'));var events=[_0x73b1('0x1'),_0x73b1('0x2'),'update'];function createListener(_0x5486a0,_0x3cf4fa){return function(_0x5d111c){_0x3cf4fa[_0x73b1('0x3')](_0x5486a0,_0x5d111c);};}function removeListener(_0x421919,_0xa9b33c){return function(){PluginEvents[_0x73b1('0x4')](_0x421919,_0xa9b33c);};}exports[_0x73b1('0x5')]=function(_0x23d65f){for(var _0x185cd4=0x0,_0x4e7daf=events['length'];_0x185cd4<_0x4e7daf;_0x185cd4++){var _0x5be427=events[_0x185cd4];var _0x336485=createListener(_0x73b1('0x6')+_0x5be427,_0x23d65f);PluginEvents['on'](_0x5be427,_0x336485);}}; \ No newline at end of file +var _0x8fce=['plugin:','./plugin.events','save','update','emit','register'];(function(_0x42f5a4,_0x2bad31){var _0x231130=function(_0x11c613){while(--_0x11c613){_0x42f5a4['push'](_0x42f5a4['shift']());}};_0x231130(++_0x2bad31);}(_0x8fce,0x1b7));var _0xe8fc=function(_0x1bb6c1,_0xfd0ef2){_0x1bb6c1=_0x1bb6c1-0x0;var _0x2bd6f0=_0x8fce[_0x1bb6c1];return _0x2bd6f0;};'use strict';var PluginEvents=require(_0xe8fc('0x0'));var events=[_0xe8fc('0x1'),'remove',_0xe8fc('0x2')];function createListener(_0x5e8689,_0xbe65d5){return function(_0x3d019d){_0xbe65d5[_0xe8fc('0x3')](_0x5e8689,_0x3d019d);};}function removeListener(_0x2bcabf,_0x88d0da){return function(){PluginEvents['removeListener'](_0x2bcabf,_0x88d0da);};}exports[_0xe8fc('0x4')]=function(_0x1d53e2){for(var _0x5be6ef=0x0,_0x3ee3a8=events['length'];_0x5be6ef<_0x3ee3a8;_0x5be6ef++){var _0xbb6922=events[_0x5be6ef];var _0xa7e1ea=createListener(_0xe8fc('0x5')+_0xbb6922,_0x1d53e2);PluginEvents['on'](_0xbb6922,_0xa7e1ea);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7b8bd40..78bb97b 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(_0x364ab2,_0x26f51f){var _0x3210f5=function(_0x50a953){while(--_0x50a953){_0x364ab2['push'](_0x364ab2['shift']());}};_0x3210f5(++_0x26f51f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2e31cc,_0x1eebdb){var _0x5426cb=function(_0x42d3d8){while(--_0x42d3d8){_0x2e31cc['push'](_0x2e31cc['shift']());}};_0x5426cb(++_0x1eebdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 ccd6383..75da821 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 _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x54ef,0x112));var _0xf54e=function(_0x44ce28,_0x4b1784){_0x44ce28=_0x44ce28-0x0;var _0x213dc0=_0x54ef[_0x44ce28];return _0x213dc0;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}}; \ No newline at end of file +var _0x34e5=['info','error','list','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','name','npm\x20install'];(function(_0x15faa5,_0xa0711){var _0x47582a=function(_0x506d3f){while(--_0x506d3f){_0x15faa5['push'](_0x15faa5['shift']());}};_0x47582a(++_0xa0711);}(_0x34e5,0x172));var _0x534e=function(_0x1f236c,_0x341509){_0x1f236c=_0x1f236c-0x0;var _0x51f3f0=_0x34e5[_0x1f236c];return _0x51f3f0;};'use strict';var _=require('lodash');var pm2=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var path=require(_0x534e('0x2'));var exec=require(_0x534e('0x3'))[_0x534e('0x4')];var BPromise=require(_0x534e('0x5'));function handleEntityNotFound(_0x50b790,_0x11a158){return function(_0x3d8287){if(!_0x3d8287){_0x50b790[_0x534e('0x6')](0x194);;}return _0x3d8287;};}function respondWithResult(_0x117f0c,_0x436a92){_0x436a92=_0x436a92||0xc8;return function(_0x2d0370){if(_0x2d0370){return _0x117f0c[_0x534e('0x7')](_0x436a92)['json'](_0x2d0370);}return null;};}function handleError(_0x24d562,_0x929597){_0x929597=_0x929597||0x1f4;return function(_0xa836bb){logger['error'](_0xa836bb['stack']);if(_0xa836bb[_0x534e('0x8')]){delete _0xa836bb['name'];}_0x24d562[_0x534e('0x7')](_0x929597)['send'](_0xa836bb);};}function execChildProcess(){return new BPromise(function(_0xb30dd6,_0x310b6d){exec(_0x534e('0x9'),function(_0x529726,_0x1b7a5a,_0x229352){logger[_0x534e('0xa')](_0x1b7a5a);logger[_0x534e('0xa')](_0x229352);if(_0x529726){logger[_0x534e('0xb')](_0x529726);return _0x310b6d(_0x529726);}return _0xb30dd6(_0x1b7a5a);});});}exports['index']=function(_0x31d764,_0x23c11c){return pm2[_0x534e('0xc')]()[_0x534e('0xd')](function(_0x359565){if(_0x359565){var _0x478027=_[_0x534e('0xe')](_0x359565,function(_0x17c068){return _0x17c068[_0x534e('0x8')]==='express'||_0x17c068[_0x534e('0x8')]===_0x534e('0xf');});return{'rows':_0x478027,'count':_0x478027['length']};}return null;})['then'](respondWithResult(_0x23c11c,null))[_0x534e('0x10')](handleError(_0x23c11c,null));};exports[_0x534e('0x11')]=function(_0x9297b6,_0x16ad40){return pm2[_0x534e('0x12')](_0x9297b6[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x16ad40,null))['then'](handleEntityNotFound(_0x16ad40,null))[_0x534e('0x10')](handleError(_0x16ad40,null));};exports[_0x534e('0x14')]=function(_0x466d74,_0x1bef0a){if(_0x466d74[_0x534e('0x15')]['name']&&_0x466d74[_0x534e('0x15')][_0x534e('0x16')]){var _0x5f9ae9=path[_0x534e('0x17')](__dirname,_0x534e('0x18'),_0x466d74[_0x534e('0x15')][_0x534e('0x16')]);var _0x85188b=process[_0x534e('0x19')]();process['chdir'](path[_0x534e('0x1a')](_0x5f9ae9));return execChildProcess()[_0x534e('0xd')](function(_0x39466c){process[_0x534e('0x1b')](_0x85188b);return pm2[_0x534e('0x1c')]({'name':_0x466d74[_0x534e('0x15')][_0x534e('0x8')],'script':_0x5f9ae9});})[_0x534e('0xd')](function(_0x53a6ef){pm2[_0x534e('0x1d')]();return _0x53a6ef[0x0];})['then'](respondWithResult(_0x1bef0a,0xc9))[_0x534e('0x10')](handleError(_0x1bef0a,null));}else{return _0x1bef0a[_0x534e('0x7')](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x1f')});}};exports[_0x534e('0x20')]=function(_0x57b216,_0x743974){if(_0x57b216[_0x534e('0x15')]['id']){delete _0x57b216['body']['id'];}var _0x4bd073={'online':_0x534e('0x21'),'stopped':'stop'};if(_0x4bd073[_0x534e('0x22')](_0x57b216[_0x534e('0x15')][_0x534e('0x7')])){return pm2[_0x4bd073[_0x57b216[_0x534e('0x15')][_0x534e('0x7')]]](_0x57b216[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x743974,0xc8))['catch'](handleError(_0x743974,null));}else{return _0x743974['status'](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x23')});}};exports[_0x534e('0x24')]=function(_0x2f1c49,_0x423502){if(_0x2f1c49[_0x534e('0x15')]['id']){delete _0x2f1c49[_0x534e('0x15')]['id'];}if(_0x2f1c49[_0x534e('0x13')]['id']){return pm2[_0x534e('0x25')](_0x2f1c49[_0x534e('0x13')]['id'])[_0x534e('0xd')](function(_0x1d6fb1){pm2['dump']();return _0x1d6fb1[0x0];})[_0x534e('0xd')](respondWithResult(_0x423502,null))[_0x534e('0x10')](handleError(_0x423502,null));}else{return _0x423502['status'](0x1f4)[_0x534e('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 980f4d7..abb934e 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 _0x1ecb=['isAuthenticated','getAgents','get','/queues','getQueues','exports','express','../../components/auth/service','./realtime.controller'];(function(_0x4a62c3,_0xf6a95d){var _0x2708c1=function(_0x58b400){while(--_0x58b400){_0x4a62c3['push'](_0x4a62c3['shift']());}};_0x2708c1(++_0xf6a95d);}(_0x1ecb,0x15c));var _0xb1ec=function(_0x2c5bdb,_0x25eec3){_0x2c5bdb=_0x2c5bdb-0x0;var _0x19e122=_0x1ecb[_0x2c5bdb];return _0x19e122;};'use strict';var express=require(_0xb1ec('0x0'));var router=express['Router']();var auth=require(_0xb1ec('0x1'));var controller=require(_0xb1ec('0x2'));router['get']('/agents',auth[_0xb1ec('0x3')](),controller[_0xb1ec('0x4')]);router[_0xb1ec('0x5')](_0xb1ec('0x6'),auth[_0xb1ec('0x3')](),controller[_0xb1ec('0x7')]);module[_0xb1ec('0x8')]=router; \ No newline at end of file +var _0x412e=['isAuthenticated','getAgents','getQueues','exports','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x242116,_0x315f38){var _0x4c80d7=function(_0x27807e){while(--_0x27807e){_0x242116['push'](_0x242116['shift']());}};_0x4c80d7(++_0x315f38);}(_0x412e,0x18c));var _0xe412=function(_0x3171f7,_0x131d3d){_0x3171f7=_0x3171f7-0x0;var _0x4b4830=_0x412e[_0x3171f7];return _0x4b4830;};'use strict';var express=require('express');var router=express[_0xe412('0x0')]();var auth=require(_0xe412('0x1'));var controller=require(_0xe412('0x2'));router[_0xe412('0x3')]('/agents',auth[_0xe412('0x4')](),controller[_0xe412('0x5')]);router[_0xe412('0x3')]('/queues',auth['isAuthenticated'](),controller[_0xe412('0x6')]);module[_0xe412('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 9041991..6f2fda5 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 _0xdda7=['resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','User','fieldName','type','role','agent','online','getOptions','raw','push','FIELD(id,','forEach','*pause','Pause','where','user','Agents','UserProfile','getResources','filterAgentAttributes','merge','getAgentStatus','includes','voice','talking','Status','sortAgentsByStatus','split','pick','getQueues','format','startCase','Queue','rawAttributes','key','outbound','dialActive','dialMethod','QueueCampaigns','Queues','assign','findAndCountAll','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','undefined','limit','offset','count','status','set','getAgents','query','globalQueueFilter','globalStatusFilter','pause'];(function(_0x2153c4,_0x9abb23){var _0x31524b=function(_0x493344){while(--_0x493344){_0x2153c4['push'](_0x2153c4['shift']());}};_0x31524b(++_0x9abb23);}(_0xdda7,0x8c));var _0x7dda=function(_0x3d4b37,_0x5a2b43){_0x3d4b37=_0x3d4b37-0x0;var _0x3afec0=_0xdda7[_0x3d4b37];return _0x3afec0;};'use strict';var _=require(_0x7dda('0x0'));var util=require(_0x7dda('0x1'));var rta=require(_0x7dda('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x7dda('0x3'));var utils=require(_0x7dda('0x4'));var db=require(_0x7dda('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x7dda('0x6')];var APIHandleError=require(_0x7dda('0x7'))[_0x7dda('0x8')];function respondWithFilteredResult(_0x58ed80,_0x4120cd){return function(_0x5b1300){if(_0x5b1300){var _0x149e62=typeof _0x4120cd['offset']===_0x7dda('0x9')&&typeof _0x4120cd[_0x7dda('0xa')]==='undefined';var _0x3f47dc=_0x5b1300['count'];var _0x2d0eb4=_0x149e62?0x0:_0x4120cd[_0x7dda('0xb')];var _0x1f5fdb=_0x149e62?_0x5b1300[_0x7dda('0xc')]:_0x4120cd['offset']+_0x4120cd[_0x7dda('0xa')];var _0xe95d96;if(_0x1f5fdb>=_0x3f47dc){_0x1f5fdb=_0x3f47dc;_0xe95d96=0xc8;}else{_0xe95d96=0xce;}_0x58ed80[_0x7dda('0xd')](_0xe95d96);return _0x58ed80[_0x7dda('0xe')]('Content-Range',_0x2d0eb4+'-'+_0x1f5fdb+'/'+_0x3f47dc)['json'](_0x5b1300);}return null;};}exports[_0x7dda('0xf')]=function(_0x404be7,_0x204a8b){var _0x1a2ce6={'count':0x0,'rows':[]};var _0x3530c5={};var _0x398bb4;var _0x4faffc=utils['getChannels']();var _0x120f87;var _0x241f2a;var _0x19382c=_0x404be7[_0x7dda('0x10')][_0x7dda('0x11')];var _0xfe8a52=_0x404be7['query'][_0x7dda('0x12')];var _0x49aeaa=_0x404be7['query']['pauseTypeFilter'];var _0x3480ad=_0xfe8a52===_0x7dda('0x13')||_0xfe8a52==='*pause'?!![]:![];var _0x9940bf=[];var _0x21a48a;var _0x4c70d9;Promise[_0x7dda('0x14')]()[_0x7dda('0x15')](function(){if(_0x404be7[_0x7dda('0x10')][_0x7dda('0x16')]){if(!utils[_0x7dda('0x17')](_0x404be7['query']['channel'])){throw new APIBadRequestError(util['format'](_0x7dda('0x18'),_0x404be7[_0x7dda('0x10')]['channel']));}_0x398bb4=_0x404be7['query']['channel'][_0x7dda('0x19')]();}if(!_0x404be7[_0x7dda('0x10')][_0x7dda('0x1a')]||!_0x404be7['query'][_0x7dda('0x1a')]['includes'](_0x7dda('0x1b'))){_0x404be7[_0x7dda('0x10')][_0x7dda('0x1a')]=rta[_0x7dda('0x1c')](_0x404be7['query'][_0x7dda('0x1a')]);return;}var _0x3395d1=rta[_0x7dda('0x1d')](_0x404be7[_0x7dda('0x10')][_0x7dda('0x1a')]);_0x404be7[_0x7dda('0x10')][_0x7dda('0x1a')]=_0x3395d1[_0x7dda('0x1e')]['join'](',');_0x21a48a=_0x3395d1[_0x7dda('0x1f')];})[_0x7dda('0x15')](function(){if(!_0x19382c){return[];}return rta[_0x7dda('0x20')](_0x19382c,_0x398bb4);})['then'](function(_0x55e982){_0x9940bf=_0x55e982;return rta['getRealtimeAgents']();})[_0x7dda('0x15')](function(_0x4340dd){_0x241f2a=_0x4340dd[_0x7dda('0x21')];if((!_0xfe8a52||_0x3480ad)&&!_0x21a48a){return _0x9940bf;}if(_0x21a48a&&!_0xfe8a52){return rta[_0x7dda('0x22')](_0x241f2a,_0x9940bf,_0x21a48a);}else{return rta['getAgentIdsByStatus'](_0x241f2a,_0x9940bf,_0xfe8a52);}})[_0x7dda('0x15')](function(_0x127211){_0x9940bf=_0x127211;var _0x398e48=![];if(_0x9940bf[_0x7dda('0x23')]===0x0){if(_0x19382c||_0xfe8a52){_0x398e48=!![];}if(_0x3480ad){_0x398e48=![];}}if(_0x398e48){return _0x1a2ce6;}var _0x33f083=_[_0x7dda('0x24')](db[_0x7dda('0x25')]['rawAttributes'],function(_0x5545c3){return{'name':_0x5545c3[_0x7dda('0x26')],'type':_0x5545c3[_0x7dda('0x27')]['key']};});_0x404be7[_0x7dda('0x10')][_0x7dda('0x28')]=_0x7dda('0x29');_0x404be7[_0x7dda('0x10')][_0x7dda('0x2a')]=!![];_0x3530c5=qs[_0x7dda('0x2b')](_0x33f083,_0x404be7);_0x3530c5[_0x7dda('0x2c')]=!![];var _0x4f066e=[];if(_0x9940bf[_0x7dda('0x23')]>0x0){_0x4f066e[_0x7dda('0x2d')]({'id':{'$in':_0x9940bf}});if(_0x21a48a&&!_0xfe8a52){_0x4c70d9=[db['sequelize']['literal'](_0x7dda('0x2e')+_0x9940bf+')')];_0x3530c5[_0x7dda('0x1f')]=_0x4c70d9;}}if(_0x3480ad){_0x4faffc[_0x7dda('0x2f')](function(_0x3a34b5){var _0x8e169=!![];if(_0xfe8a52===_0x7dda('0x30')&&_0x398bb4!==_0x3a34b5){_0x8e169=![];}_0x4f066e[_0x7dda('0x2d')]({[_0x3a34b5+_0x7dda('0x31')]:_0x8e169});});if(_0x49aeaa){_0x4f066e[_0x7dda('0x2d')]({'pauseType':_0x49aeaa});}}else if(_0xfe8a52){_0x4faffc[_0x7dda('0x2f')](function(_0x173fbd){_0x4f066e[_0x7dda('0x2d')]({[_0x173fbd+_0x7dda('0x31')]:![]});});}_0x3530c5[_0x7dda('0x32')]=_['merge'](_0x3530c5[_0x7dda('0x32')],{'$and':_0x4f066e});if(_0x404be7[_0x7dda('0x33')][_0x7dda('0x28')]===_0x7dda('0x33')){var _0x473650={'params':{'id':_0x404be7['user']['userProfileId']},'query':{'section':_0x7dda('0x34'),'role':'agent','online':!![],'raw':!![],'ids':_0x9940bf,'customSorting':_0x4c70d9}};if(_0x3480ad){_0x473650[_0x7dda('0x10')]['extraQueryConditions']=_0x4f066e;}_0x473650[_0x7dda('0x10')]=Object['assign'](_0x473650[_0x7dda('0x10')],_0x404be7[_0x7dda('0x10')]);delete _0x473650['query']['id'];return db[_0x7dda('0x35')][_0x7dda('0x36')](_0x473650);}return db[_0x7dda('0x25')]['findAndCountAll'](_0x3530c5);})['then'](function(_0x1fac72){_0x1a2ce6[_0x7dda('0xc')]=_0x1fac72[_0x7dda('0xc')];_0x120f87=_0x1fac72['rows'];return _0x120f87[_0x7dda('0x24')](function(_0x1351a7){var _0x3c677a=_['find'](_0x241f2a,['id',_0x1351a7['id']]);if(_0x3c677a){var _0x20525b=rta[_0x7dda('0x37')](_0x3c677a);_[_0x7dda('0x38')](_0x1351a7,_0x20525b);}_0x1351a7['globalStatus']=rta[_0x7dda('0x39')](_0x1351a7);if(_0x1351a7[_0x7dda('0x1b')][_0x7dda('0x3a')](_0x7dda('0x13'))){_0x4faffc['forEach'](function(_0x1c3065){if(_0x1351a7[_0x1c3065+_0x7dda('0x31')]){if(_0x1c3065===_0x7dda('0x3b')){if(_0x1351a7['voiceStatus']!==_0x7dda('0x3c')){_0x1351a7['voiceStatus']=_0x7dda('0x13');}}else{_0x1351a7[_0x1c3065+_0x7dda('0x3d')]=_0x7dda('0x13');}}});}return _0x1351a7;});})[_0x7dda('0x15')](function(_0x3b1fe4){if(!_0x21a48a||_0x4c70d9){return _0x3b1fe4;}return rta[_0x7dda('0x3e')](_0x3b1fe4,_0x21a48a);})['then'](function(_0xdd24ea){var _0x50b4a4=null;if(_0x404be7[_0x7dda('0x10')][_0x7dda('0x1e')]){var _0x1b4dc8=_0x404be7[_0x7dda('0x10')]['fields'][_0x7dda('0x3f')](',');_0x50b4a4=_0xdd24ea[_0x7dda('0x24')](function(_0x5eb581){return _[_0x7dda('0x40')](_0x5eb581,_0x1b4dc8);});}_0x1a2ce6[_0x7dda('0x21')]=_0x50b4a4||_0xdd24ea;return _0x1a2ce6;})[_0x7dda('0x15')](respondWithFilteredResult(_0x204a8b,_0x3530c5))['catch'](APIHandleError(_0x204a8b));};exports[_0x7dda('0x41')]=function(_0x210562,_0x10ace3){var _0x52810f={'count':0x0,'rows':[]};var _0x60e08a={};var _0x2a3f75;var _0x1104a4;var _0x129b78;Promise[_0x7dda('0x14')]()[_0x7dda('0x15')](function(){if(_0x210562[_0x7dda('0x10')][_0x7dda('0x16')]){if(!utils['isValidChannel'](_0x210562[_0x7dda('0x10')][_0x7dda('0x16')])){throw new APIBadRequestError(util[_0x7dda('0x42')](_0x7dda('0x18'),_0x210562[_0x7dda('0x10')][_0x7dda('0x16')]));}_0x2a3f75=_0x210562[_0x7dda('0x10')][_0x7dda('0x16')][_0x7dda('0x19')]();}var _0xcc1db0=_[_0x7dda('0x43')](_0x2a3f75)+_0x7dda('0x44');var _0x3bdd95=_[_0x7dda('0x24')](db[_0xcc1db0][_0x7dda('0x45')],function(_0x497e03){return{'name':_0x497e03[_0x7dda('0x26')],'type':_0x497e03[_0x7dda('0x27')][_0x7dda('0x46')]};});if(!_0x210562[_0x7dda('0x10')][_0x7dda('0x1e')]){var _0x4dc65f=['id','name'];if(_0x2a3f75===_0x7dda('0x3b')){_0x4dc65f[_0x7dda('0x2d')](_0x7dda('0x27'));if(_0x210562[_0x7dda('0x10')][_0x7dda('0x27')]===_0x7dda('0x47')){_0x4dc65f[_0x7dda('0x2d')]([_0x7dda('0x48'),_0x7dda('0x49')]);}}_0x210562[_0x7dda('0x10')][_0x7dda('0x1e')]=_0x4dc65f['join'](',');}_0x60e08a=qs[_0x7dda('0x2b')](_0x3bdd95,_0x210562);if(_0x210562['user'][_0x7dda('0x28')]===_0x7dda('0x33')){var _0x1db958={'params':{'id':_0x210562[_0x7dda('0x33')]['userProfileId']},'query':{'section':_0x2a3f75==='voice'&&_0x210562[_0x7dda('0x10')][_0x7dda('0x27')]===_0x7dda('0x47')?_0x7dda('0x4a'):_['startCase'](_0x2a3f75)+_0x7dda('0x4b'),'type':_0x210562[_0x7dda('0x10')]['type'],'nolimit':!![],'sort':'name','filter':_0x210562[_0x7dda('0x10')]['filter']}};_0x1db958[_0x7dda('0x10')]=Object[_0x7dda('0x4c')](_0x1db958['query'],_0x210562[_0x7dda('0x10')]);delete _0x1db958[_0x7dda('0x10')]['id'];return db[_0x7dda('0x35')][_0x7dda('0x36')](_0x1db958);}return db[_0xcc1db0][_0x7dda('0x4d')](_0x60e08a);})[_0x7dda('0x15')](function(_0xeee81e){_0x52810f[_0x7dda('0xc')]=_0xeee81e['count'];_0x1104a4=_0xeee81e['rows'];return rtq['getRealtimeQueues'](_0x210562,_0x2a3f75);})[_0x7dda('0x15')](function(_0x3b8ef3){_0x129b78=_0x3b8ef3[_0x7dda('0x21')];return rtq[_0x7dda('0x4e')](_0x1104a4,_0x129b78,_0x2a3f75,_0x210562[_0x7dda('0x10')][_0x7dda('0x27')]);})['then'](function(_0x2b06df){_0x52810f[_0x7dda('0x21')]=_0x2b06df;return _0x52810f;})[_0x7dda('0x15')](respondWithFilteredResult(_0x10ace3,_0x60e08a))[_0x7dda('0x4f')](APIHandleError(_0x10ace3));}; \ No newline at end of file +var _0x9a18=['getOptions','raw','length','push','sequelize','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','extraQueryConditions','assign','UserProfile','findAndCountAll','find','filterAgentAttributes','getAgentStatus','talking','voiceStatus','Status','sortAgentsByStatus','split','pick','catch','resolve','isValidChannel','startCase','Queue','key','name','voice','outbound','dialActive','dialMethod','filter','getRealtimeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','role','agent','online'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9a18,0x187));var _0x89a1=function(_0x447688,_0x2159f6){_0x447688=_0x447688-0x0;var _0x5ec176=_0x9a18[_0x447688];return _0x5ec176;};'use strict';var _=require(_0x89a1('0x0'));var util=require('util');var rta=require(_0x89a1('0x1'));var rtq=require(_0x89a1('0x2'));var qs=require(_0x89a1('0x3'));var utils=require(_0x89a1('0x4'));var db=require(_0x89a1('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x89a1('0x6')];var APIHandleError=require(_0x89a1('0x7'))[_0x89a1('0x8')];function respondWithFilteredResult(_0x11f396,_0x3ce160){return function(_0x216441){if(_0x216441){var _0x3ec780=typeof _0x3ce160[_0x89a1('0x9')]==='undefined'&&typeof _0x3ce160['limit']===_0x89a1('0xa');var _0x4993c1=_0x216441[_0x89a1('0xb')];var _0x541951=_0x3ec780?0x0:_0x3ce160[_0x89a1('0x9')];var _0x44ec84=_0x3ec780?_0x216441[_0x89a1('0xb')]:_0x3ce160[_0x89a1('0x9')]+_0x3ce160[_0x89a1('0xc')];var _0x2830f1;if(_0x44ec84>=_0x4993c1){_0x44ec84=_0x4993c1;_0x2830f1=0xc8;}else{_0x2830f1=0xce;}_0x11f396[_0x89a1('0xd')](_0x2830f1);return _0x11f396[_0x89a1('0xe')](_0x89a1('0xf'),_0x541951+'-'+_0x44ec84+'/'+_0x4993c1)[_0x89a1('0x10')](_0x216441);}return null;};}exports[_0x89a1('0x11')]=function(_0x50c3b9,_0x53be14){var _0x2b7711={'count':0x0,'rows':[]};var _0x247b03={};var _0x131704;var _0x16bba0=utils['getChannels']();var _0x1f9048;var _0x2bae4a;var _0x57287b=_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x13')];var _0x46b60f=_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x14')];var _0x69dbd3=_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x15')];var _0x546981=_0x46b60f===_0x89a1('0x16')||_0x46b60f===_0x89a1('0x17')?!![]:![];var _0x1dbb4a=[];var _0xa6a057;var _0x24b2bf;Promise['resolve']()[_0x89a1('0x18')](function(){if(_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x19')]){if(!utils['isValidChannel'](_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x19')])){throw new APIBadRequestError(util[_0x89a1('0x1a')](_0x89a1('0x1b'),_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x19')]));}_0x131704=_0x50c3b9['query'][_0x89a1('0x19')]['toLowerCase']();}if(!_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x1c')]||!_0x50c3b9[_0x89a1('0x12')]['sort'][_0x89a1('0x1d')](_0x89a1('0x1e'))){_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x1c')]=rta[_0x89a1('0x1f')](_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x1c')]);return;}var _0x444373=rta[_0x89a1('0x20')](_0x50c3b9['query']['sort']);_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x1c')]=_0x444373[_0x89a1('0x21')][_0x89a1('0x22')](',');_0xa6a057=_0x444373[_0x89a1('0x23')];})['then'](function(){if(!_0x57287b){return[];}return rta[_0x89a1('0x24')](_0x57287b,_0x131704);})['then'](function(_0x550333){_0x1dbb4a=_0x550333;return rta[_0x89a1('0x25')]();})[_0x89a1('0x18')](function(_0x1d346a){_0x2bae4a=_0x1d346a[_0x89a1('0x26')];if((!_0x46b60f||_0x546981)&&!_0xa6a057){return _0x1dbb4a;}if(_0xa6a057&&!_0x46b60f){return rta[_0x89a1('0x27')](_0x2bae4a,_0x1dbb4a,_0xa6a057);}else{return rta[_0x89a1('0x28')](_0x2bae4a,_0x1dbb4a,_0x46b60f);}})[_0x89a1('0x18')](function(_0x3629f9){_0x1dbb4a=_0x3629f9;var _0x5af984=![];if(_0x1dbb4a['length']===0x0){if(_0x57287b||_0x46b60f){_0x5af984=!![];}if(_0x546981){_0x5af984=![];}}if(_0x5af984){return _0x2b7711;}var _0x22e8f9=_[_0x89a1('0x29')](db[_0x89a1('0x2a')][_0x89a1('0x2b')],function(_0x2b1ece){return{'name':_0x2b1ece[_0x89a1('0x2c')],'type':_0x2b1ece[_0x89a1('0x2d')]['key']};});_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x2e')]=_0x89a1('0x2f');_0x50c3b9['query'][_0x89a1('0x30')]=!![];_0x247b03=qs[_0x89a1('0x31')](_0x22e8f9,_0x50c3b9);_0x247b03[_0x89a1('0x32')]=!![];var _0x3052d5=[];if(_0x1dbb4a[_0x89a1('0x33')]>0x0){_0x3052d5[_0x89a1('0x34')]({'id':{'$in':_0x1dbb4a}});if(_0xa6a057&&!_0x46b60f){_0x24b2bf=[db[_0x89a1('0x35')][_0x89a1('0x36')](_0x89a1('0x37')+_0x1dbb4a+')')];_0x247b03[_0x89a1('0x23')]=_0x24b2bf;}}if(_0x546981){_0x16bba0[_0x89a1('0x38')](function(_0x281fd1){var _0xdcc7d7=!![];if(_0x46b60f===_0x89a1('0x17')&&_0x131704!==_0x281fd1){_0xdcc7d7=![];}_0x3052d5[_0x89a1('0x34')]({[_0x281fd1+_0x89a1('0x39')]:_0xdcc7d7});});if(_0x69dbd3){_0x3052d5[_0x89a1('0x34')]({'pauseType':_0x69dbd3});}}else if(_0x46b60f){_0x16bba0[_0x89a1('0x38')](function(_0x4b4f5f){_0x3052d5[_0x89a1('0x34')]({[_0x4b4f5f+_0x89a1('0x39')]:![]});});}_0x247b03[_0x89a1('0x3a')]=_[_0x89a1('0x3b')](_0x247b03[_0x89a1('0x3a')],{'$and':_0x3052d5});if(_0x50c3b9[_0x89a1('0x3c')]['role']===_0x89a1('0x3c')){var _0x38cd4d={'params':{'id':_0x50c3b9['user'][_0x89a1('0x3d')]},'query':{'section':'Agents','role':_0x89a1('0x2f'),'online':!![],'raw':!![],'ids':_0x1dbb4a,'customSorting':_0x24b2bf}};if(_0x546981){_0x38cd4d[_0x89a1('0x12')][_0x89a1('0x3e')]=_0x3052d5;}_0x38cd4d[_0x89a1('0x12')]=Object[_0x89a1('0x3f')](_0x38cd4d['query'],_0x50c3b9[_0x89a1('0x12')]);delete _0x38cd4d[_0x89a1('0x12')]['id'];return db[_0x89a1('0x40')]['getResources'](_0x38cd4d);}return db[_0x89a1('0x2a')][_0x89a1('0x41')](_0x247b03);})[_0x89a1('0x18')](function(_0x3fc905){_0x2b7711[_0x89a1('0xb')]=_0x3fc905[_0x89a1('0xb')];_0x1f9048=_0x3fc905[_0x89a1('0x26')];return _0x1f9048[_0x89a1('0x29')](function(_0x565831){var _0x530a78=_[_0x89a1('0x42')](_0x2bae4a,['id',_0x565831['id']]);if(_0x530a78){var _0x40e8ad=rta[_0x89a1('0x43')](_0x530a78);_['merge'](_0x565831,_0x40e8ad);}_0x565831[_0x89a1('0x1e')]=rta[_0x89a1('0x44')](_0x565831);if(_0x565831[_0x89a1('0x1e')][_0x89a1('0x1d')]('pause')){_0x16bba0[_0x89a1('0x38')](function(_0x702874){if(_0x565831[_0x702874+_0x89a1('0x39')]){if(_0x702874==='voice'){if(_0x565831['voiceStatus']!==_0x89a1('0x45')){_0x565831[_0x89a1('0x46')]=_0x89a1('0x16');}}else{_0x565831[_0x702874+_0x89a1('0x47')]='pause';}}});}return _0x565831;});})['then'](function(_0x17669a){if(!_0xa6a057||_0x24b2bf){return _0x17669a;}return rta[_0x89a1('0x48')](_0x17669a,_0xa6a057);})[_0x89a1('0x18')](function(_0x3cad82){var _0x1c4371=null;if(_0x50c3b9[_0x89a1('0x12')]['fields']){var _0x3ba121=_0x50c3b9[_0x89a1('0x12')][_0x89a1('0x21')][_0x89a1('0x49')](',');_0x1c4371=_0x3cad82[_0x89a1('0x29')](function(_0x5f0bf8){return _[_0x89a1('0x4a')](_0x5f0bf8,_0x3ba121);});}_0x2b7711[_0x89a1('0x26')]=_0x1c4371||_0x3cad82;return _0x2b7711;})[_0x89a1('0x18')](respondWithFilteredResult(_0x53be14,_0x247b03))[_0x89a1('0x4b')](APIHandleError(_0x53be14));};exports['getQueues']=function(_0x3a344a,_0xe54eea){var _0x351422={'count':0x0,'rows':[]};var _0x560ca0={};var _0x2b2c42;var _0x14b61b;var _0x384d30;Promise[_0x89a1('0x4c')]()[_0x89a1('0x18')](function(){if(_0x3a344a['query'][_0x89a1('0x19')]){if(!utils[_0x89a1('0x4d')](_0x3a344a[_0x89a1('0x12')]['channel'])){throw new APIBadRequestError(util[_0x89a1('0x1a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3a344a[_0x89a1('0x12')]['channel']));}_0x2b2c42=_0x3a344a[_0x89a1('0x12')][_0x89a1('0x19')]['toLowerCase']();}var _0x325f7f=_[_0x89a1('0x4e')](_0x2b2c42)+_0x89a1('0x4f');var _0x2f81ce=_[_0x89a1('0x29')](db[_0x325f7f][_0x89a1('0x2b')],function(_0x410639){return{'name':_0x410639[_0x89a1('0x2c')],'type':_0x410639[_0x89a1('0x2d')][_0x89a1('0x50')]};});if(!_0x3a344a[_0x89a1('0x12')][_0x89a1('0x21')]){var _0x4c89cb=['id',_0x89a1('0x51')];if(_0x2b2c42===_0x89a1('0x52')){_0x4c89cb[_0x89a1('0x34')](_0x89a1('0x2d'));if(_0x3a344a[_0x89a1('0x12')][_0x89a1('0x2d')]===_0x89a1('0x53')){_0x4c89cb['push']([_0x89a1('0x54'),_0x89a1('0x55')]);}}_0x3a344a[_0x89a1('0x12')][_0x89a1('0x21')]=_0x4c89cb[_0x89a1('0x22')](',');}_0x560ca0=qs[_0x89a1('0x31')](_0x2f81ce,_0x3a344a);if(_0x3a344a[_0x89a1('0x3c')]['role']===_0x89a1('0x3c')){var _0x3b65f1={'params':{'id':_0x3a344a['user'][_0x89a1('0x3d')]},'query':{'section':_0x2b2c42==='voice'&&_0x3a344a[_0x89a1('0x12')][_0x89a1('0x2d')]===_0x89a1('0x53')?'QueueCampaigns':_['startCase'](_0x2b2c42)+'Queues','type':_0x3a344a['query'][_0x89a1('0x2d')],'nolimit':!![],'sort':_0x89a1('0x51'),'filter':_0x3a344a[_0x89a1('0x12')][_0x89a1('0x56')]}};_0x3b65f1[_0x89a1('0x12')]=Object[_0x89a1('0x3f')](_0x3b65f1[_0x89a1('0x12')],_0x3a344a[_0x89a1('0x12')]);delete _0x3b65f1[_0x89a1('0x12')]['id'];return db[_0x89a1('0x40')]['getResources'](_0x3b65f1);}return db[_0x325f7f][_0x89a1('0x41')](_0x560ca0);})['then'](function(_0x23b10e){_0x351422[_0x89a1('0xb')]=_0x23b10e['count'];_0x14b61b=_0x23b10e[_0x89a1('0x26')];return rtq[_0x89a1('0x57')](_0x3a344a,_0x2b2c42);})[_0x89a1('0x18')](function(_0x419f27){_0x384d30=_0x419f27[_0x89a1('0x26')];return rtq['initializeQueues'](_0x14b61b,_0x384d30,_0x2b2c42,_0x3a344a[_0x89a1('0x12')][_0x89a1('0x2d')]);})[_0x89a1('0x18')](function(_0x1bff32){_0x351422[_0x89a1('0x26')]=_0x1bff32;return _0x351422;})['then'](respondWithFilteredResult(_0xe54eea,_0x560ca0))[_0x89a1('0x4b')](APIHandleError(_0xe54eea));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ed0b94f..3931952 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1cd473,_0x426cf0){var _0x12557d=function(_0x297495){while(--_0x297495){_0x1cd473['push'](_0x1cd473['shift']());}};_0x12557d(++_0x426cf0);}(_0xedd9,0xfc));var _0x9edd=function(_0x1554b8,_0x477fee){_0x1554b8=_0x1554b8-0x0;var _0x1e717c=_0xedd9[_0x1554b8];return _0x1e717c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3493ed,_0x3a690f){var _0x7e23b1=function(_0x44116b){while(--_0x44116b){_0x3493ed['push'](_0x3493ed['shift']());}};_0x7e23b1(++_0x3a690f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xcb91[_0x31a938];return _0x1bf341;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index f68dd04..c076fdf 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 _0x7ebb=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x5f3e63,_0x4fd47c){var _0x57bc67=function(_0x3c47cd){while(--_0x3c47cd){_0x5f3e63['push'](_0x5f3e63['shift']());}};_0x57bc67(++_0x4fd47c);}(_0x7ebb,0x161));var _0xb7eb=function(_0x33643f,_0x5b32af){_0x33643f=_0x33643f-0x0;var _0x30a486=_0x7ebb[_0x33643f];return _0x30a486;};'use strict';var Sequelize=require(_0xb7eb('0x0'));module[_0xb7eb('0x1')]={'state':{'type':Sequelize[_0xb7eb('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb7eb('0x3')]},'scheduledat':{'type':Sequelize[_0xb7eb('0x4')]},'uniqueid':{'type':Sequelize[_0xb7eb('0x3')]},'starttime':{'type':Sequelize[_0xb7eb('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb7eb('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb7eb('0x3')]},'campaigntype':{'type':Sequelize[_0xb7eb('0x3')]},'membername':{'type':Sequelize[_0xb7eb('0x3')]}}; \ No newline at end of file +var _0x5a93=['DATE','INTEGER','exports','STRING'];(function(_0x425409,_0x358848){var _0x16d9e1=function(_0x3899b8){while(--_0x3899b8){_0x425409['push'](_0x425409['shift']());}};_0x16d9e1(++_0x358848);}(_0x5a93,0xf6));var _0x35a9=function(_0x2aa31e,_0x440880){_0x2aa31e=_0x2aa31e-0x0;var _0x2dc758=_0x5a93[_0x2aa31e];return _0x2dc758;};'use strict';var Sequelize=require('sequelize');module[_0x35a9('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x35a9('0x1')]},'scheduledat':{'type':Sequelize[_0x35a9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x35a9('0x2')]},'ringtime':{'type':Sequelize[_0x35a9('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x35a9('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x35a9('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0d4a384..6a264af 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 _0x2630=['../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5761d6,_0x553040){var _0x47524e=function(_0x2be1fd){while(--_0x2be1fd){_0x5761d6['push'](_0x5761d6['shift']());}};_0x47524e(++_0x553040);}(_0x2630,0xc4));var _0x0263=function(_0x40339f,_0x504a59){_0x40339f=_0x40339f-0x0;var _0x4f3235=_0x2630[_0x40339f];return _0x4f3235;};'use strict';var _=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var logger=require(_0x0263('0x2'))('api');var moment=require(_0x0263('0x3'));var BPromise=require(_0x0263('0x4'));var rp=require(_0x0263('0x5'));var fs=require('fs');var path=require(_0x0263('0x6'));var rimraf=require(_0x0263('0x7'));var config=require(_0x0263('0x8'));var attributes=require(_0x0263('0x9'));module['exports']=function(_0x1c2404,_0x27c541){return _0x1c2404['define'](_0x0263('0xa'),attributes,{'tableName':_0x0263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x086f=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1d3db9,_0x4dc58f){var _0x3d203f=function(_0x443941){while(--_0x443941){_0x1d3db9['push'](_0x1d3db9['shift']());}};_0x3d203f(++_0x4dc58f);}(_0x086f,0x162));var _0xf086=function(_0x3cba24,_0x39a32a){_0x3cba24=_0x3cba24-0x0;var _0x221cd7=_0x086f[_0x3cba24];return _0x221cd7;};'use strict';var _=require(_0xf086('0x0'));var util=require(_0xf086('0x1'));var logger=require(_0xf086('0x2'))(_0xf086('0x3'));var moment=require('moment');var BPromise=require(_0xf086('0x4'));var rp=require(_0xf086('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf086('0x6'));var config=require(_0xf086('0x7'));var attributes=require(_0xf086('0x8'));module[_0xf086('0x9')]=function(_0x27dcd3,_0x2cea50){return _0x27dcd3[_0xf086('0xa')](_0xf086('0xb'),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 f1b4802..791fe46 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 _0x3c54=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateReportAgentPreview','ReportAgentPreview','options','raw','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x3c54,0x1b5));var _0x43c5=function(_0x31a4e1,_0x37d821){_0x31a4e1=_0x31a4e1-0x0;var _0xf9b44d=_0x3c54[_0x31a4e1];return _0xf9b44d;};'use strict';var _=require(_0x43c5('0x0'));var util=require(_0x43c5('0x1'));var moment=require('moment');var BPromise=require(_0x43c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43c5('0x3'))['db'];var utils=require(_0x43c5('0x4'));var logger=require(_0x43c5('0x5'))(_0x43c5('0x6'));var config=require(_0x43c5('0x7'));var jayson=require(_0x43c5('0x8'));var client=jayson[_0x43c5('0x9')][_0x43c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a27b5,_0x489c55,_0xd0bd7d){return new BPromise(function(_0x272a75,_0x42a6e9){return client[_0x43c5('0xb')](_0x5a27b5,_0xd0bd7d)['then'](function(_0xd2a41b){logger[_0x43c5('0xc')](_0x43c5('0xd'),_0x489c55,_0x43c5('0xe'));logger[_0x43c5('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x489c55,_0x43c5('0xe'),JSON[_0x43c5('0x10')](_0xd2a41b));if(_0xd2a41b[_0x43c5('0x11')]){if(_0xd2a41b[_0x43c5('0x11')][_0x43c5('0x12')]===0x1f4){logger[_0x43c5('0x11')](_0x43c5('0xd'),_0x489c55,_0xd2a41b['error'][_0x43c5('0x13')]);return _0x42a6e9(_0xd2a41b[_0x43c5('0x11')]['message']);}logger[_0x43c5('0x11')](_0x43c5('0xd'),_0x489c55,_0xd2a41b['error'][_0x43c5('0x13')]);return _0x272a75(_0xd2a41b[_0x43c5('0x11')]['message']);}else{logger['info'](_0x43c5('0xd'),_0x489c55,'request\x20sent');_0x272a75(_0xd2a41b['result'][_0x43c5('0x13')]);}})['catch'](function(_0x3a7023){logger[_0x43c5('0x11')](_0x43c5('0xd'),_0x489c55,_0x3a7023);_0x42a6e9(_0x3a7023);});});}exports[_0x43c5('0x14')]=function(_0x762cab){var _0x49e453=this;return new Promise(function(_0x33fefe,_0x180911){return db[_0x43c5('0x15')]['create'](_0x762cab['body'],{'raw':_0x762cab[_0x43c5('0x16')]?_0x762cab['options'][_0x43c5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x302f24){logger[_0x43c5('0xc')](_0x43c5('0x14'),_0x762cab);logger[_0x43c5('0xf')](_0x43c5('0x14'),_0x762cab,JSON['stringify'](_0x302f24));_0x33fefe(_0x302f24);})[_0x43c5('0x18')](function(_0xd7edbe){logger[_0x43c5('0x11')](_0x43c5('0x14'),_0xd7edbe[_0x43c5('0x13')],_0x762cab);_0x180911(_0x49e453[_0x43c5('0x11')](0x1f4,_0xd7edbe[_0x43c5('0x13')]));});});}; \ No newline at end of file +var _0x32b0=['jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32b0,0x1e7));var _0x032b=function(_0x30896a,_0x4ffd49){_0x30896a=_0x30896a-0x0;var _0xad495f=_0x32b0[_0x30896a];return _0xad495f;};'use strict';var _=require(_0x032b('0x0'));var util=require(_0x032b('0x1'));var moment=require(_0x032b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x032b('0x3'))['db'];var utils=require(_0x032b('0x4'));var logger=require('../../config/logger')(_0x032b('0x5'));var config=require(_0x032b('0x6'));var jayson=require(_0x032b('0x7'));var client=jayson[_0x032b('0x8')][_0x032b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17958c,_0x3c1983,_0x35e888){return new BPromise(function(_0x4a6da1,_0x21b9d4){return client[_0x032b('0xa')](_0x17958c,_0x35e888)[_0x032b('0xb')](function(_0x371f07){logger[_0x032b('0xc')](_0x032b('0xd'),_0x3c1983,'request\x20sent');logger['debug'](_0x032b('0xe'),_0x3c1983,_0x032b('0xf'),JSON['stringify'](_0x371f07));if(_0x371f07[_0x032b('0x10')]){if(_0x371f07['error']['code']===0x1f4){logger[_0x032b('0x10')](_0x032b('0xd'),_0x3c1983,_0x371f07[_0x032b('0x10')][_0x032b('0x11')]);return _0x21b9d4(_0x371f07['error'][_0x032b('0x11')]);}logger[_0x032b('0x10')](_0x032b('0xd'),_0x3c1983,_0x371f07['error'][_0x032b('0x11')]);return _0x4a6da1(_0x371f07['error'][_0x032b('0x11')]);}else{logger[_0x032b('0xc')](_0x032b('0xd'),_0x3c1983,_0x032b('0xf'));_0x4a6da1(_0x371f07['result'][_0x032b('0x11')]);}})['catch'](function(_0x1d7d2d){logger['error'](_0x032b('0xd'),_0x3c1983,_0x1d7d2d);_0x21b9d4(_0x1d7d2d);});});}exports[_0x032b('0x12')]=function(_0x5ccd97){var _0xa771d3=this;return new Promise(function(_0x13b543,_0x24db9c){return db[_0x032b('0x13')][_0x032b('0x14')](_0x5ccd97[_0x032b('0x15')],{'raw':_0x5ccd97[_0x032b('0x16')]?_0x5ccd97[_0x032b('0x16')][_0x032b('0x17')]===undefined?!![]:![]:!![]})[_0x032b('0xb')](function(_0x1ba929){logger['info'](_0x032b('0x12'),_0x5ccd97);logger['debug'](_0x032b('0x12'),_0x5ccd97,JSON[_0x032b('0x18')](_0x1ba929));_0x13b543(_0x1ba929);})[_0x032b('0x19')](function(_0x4c091c){logger[_0x032b('0x10')]('CreateReportAgentPreview',_0x4c091c[_0x032b('0x11')],_0x5ccd97);_0x24db9c(_0xa771d3[_0x032b('0x10')](0x1f4,_0x4c091c[_0x032b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 89ca2e3..6611853 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 _0xa6d1=['smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','path','express','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xa6d1,0x19b));var _0x1a6d=function(_0x2f6f57,_0x4aa3b1){_0x2f6f57=_0x2f6f57-0x0;var _0xa52006=_0xa6d1[_0x2f6f57];return _0xa52006;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a6d('0x0'));var express=require(_0x1a6d('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0x1a6d('0x2'),auth['isAuthenticated'](),controller[_0x1a6d('0x3')]);router[_0x1a6d('0x4')](_0x1a6d('0x5'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x7')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x1a6d('0x4')]('/voice/queues',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x8')]);router['get'](_0x1a6d('0x9'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0xa')]);router['get']('/mail/queues',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0xb')]);router['get'](_0x1a6d('0xc'),auth[_0x1a6d('0x6')](),controller['mailAccounts']);router['get'](_0x1a6d('0xd'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0xe')]);router['get'](_0x1a6d('0xf'),auth[_0x1a6d('0x6')](),controller['smsQueues']);router['get'](_0x1a6d('0x10'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x11')]);router[_0x1a6d('0x4')](_0x1a6d('0x12'),auth['isAuthenticated'](),controller[_0x1a6d('0x13')]);router[_0x1a6d('0x4')]('/voice/queues/preview/:id',auth[_0x1a6d('0x6')](),controller['voiceQueuesPreview']);router[_0x1a6d('0x4')](_0x1a6d('0x14'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x15')]);router[_0x1a6d('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x1a6d('0x16')]);router[_0x1a6d('0x4')](_0x1a6d('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x1a6d('0x4')](_0x1a6d('0x18'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x19')]);router['get'](_0x1a6d('0x1a'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x1b')]);router['put'](_0x1a6d('0x1a'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x1c')]);router[_0x1a6d('0x4')](_0x1a6d('0x1d'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x1e')]);router[_0x1a6d('0x4')](_0x1a6d('0x1f'),auth['isAuthenticated'](),controller[_0x1a6d('0x20')]);router[_0x1a6d('0x4')](_0x1a6d('0x21'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x22')]);router[_0x1a6d('0x23')](_0x1a6d('0x24'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x25')]);router['get'](_0x1a6d('0x26'),auth['isAuthenticated'](),controller[_0x1a6d('0x27')]);router[_0x1a6d('0x4')](_0x1a6d('0x28'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x29')]);router[_0x1a6d('0x4')](_0x1a6d('0x2a'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x2b')]);router[_0x1a6d('0x4')](_0x1a6d('0x2c'),auth['isAuthenticated'](),controller[_0x1a6d('0x2d')]);router[_0x1a6d('0x4')](_0x1a6d('0x2e'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x2f')]);router[_0x1a6d('0x4')]('/mail/queues/waitinginteractions',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x30')]);router[_0x1a6d('0x4')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x1a6d('0x31'),auth[_0x1a6d('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1a6d('0x4')](_0x1a6d('0x32'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x33')]);router[_0x1a6d('0x4')](_0x1a6d('0x34'),auth[_0x1a6d('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x1a6d('0x4')]('/fax/queues/waitinginteractions',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x35')]);router[_0x1a6d('0x36')](_0x1a6d('0x37'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x38')](_0x1a6d('0x39')));router[_0x1a6d('0x4')](_0x1a6d('0x3a'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x3b')]);router[_0x1a6d('0x36')](_0x1a6d('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x1a6d('0x3d')));router[_0x1a6d('0x4')]('/chat/queues/:id',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x3e')]);router[_0x1a6d('0x36')](_0x1a6d('0x3f'),auth['isAuthenticated'](),controller[_0x1a6d('0x38')](_0x1a6d('0x40')));router[_0x1a6d('0x4')](_0x1a6d('0x41'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x42')]);router[_0x1a6d('0x36')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x1a6d('0x38')](_0x1a6d('0x43')));router[_0x1a6d('0x4')](_0x1a6d('0x44'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x45')]);router[_0x1a6d('0x36')]('/sms/queues/:id/notify',auth[_0x1a6d('0x6')](),controller['queueNotify']('sms'));router[_0x1a6d('0x36')](_0x1a6d('0x46'),auth[_0x1a6d('0x6')](),controller['queueNotify'](_0x1a6d('0x47')));router[_0x1a6d('0x4')]('/sms/queues/:id',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x48')]);router[_0x1a6d('0x4')](_0x1a6d('0x49'),auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x4a')]);router[_0x1a6d('0x36')]('/agents/:id/notify',auth[_0x1a6d('0x6')](),controller[_0x1a6d('0x4b')]);module[_0x1a6d('0x4c')]=router; \ No newline at end of file +var _0x236c=['post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0x336ba7,_0x3fb69b){var _0x43a5bb=function(_0x2ae5f7){while(--_0x2ae5f7){_0x336ba7['push'](_0x336ba7['shift']());}};_0x43a5bb(++_0x3fb69b);}(_0x236c,0x155));var _0xc236=function(_0x75c655,_0x1ca2d6){_0x75c655=_0x75c655-0x0;var _0x356d9f=_0x236c[_0x75c655];return _0x356d9f;};'use strict';var multer=require(_0xc236('0x0'));var util=require('util');var path=require(_0xc236('0x1'));var express=require(_0xc236('0x2'));var router=express[_0xc236('0x3')]();var auth=require(_0xc236('0x4'));var controller=require(_0xc236('0x5'));router['get'](_0xc236('0x6'),auth[_0xc236('0x7')](),controller[_0xc236('0x8')]);router[_0xc236('0x9')](_0xc236('0xa'),auth[_0xc236('0x7')](),controller['voiceChannelMixMonitor']);router[_0xc236('0x9')](_0xc236('0xb'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router['get'](_0xc236('0xc'),auth['isAuthenticated'](),controller[_0xc236('0xd')]);router[_0xc236('0x9')](_0xc236('0xe'),auth[_0xc236('0x7')](),controller[_0xc236('0xf')]);router['get'](_0xc236('0x10'),auth[_0xc236('0x7')](),controller['mailQueues']);router[_0xc236('0x9')](_0xc236('0x11'),auth['isAuthenticated'](),controller[_0xc236('0x12')]);router['get']('/openchannel/queues',auth[_0xc236('0x7')](),controller[_0xc236('0x13')]);router[_0xc236('0x9')](_0xc236('0x14'),auth['isAuthenticated'](),controller[_0xc236('0x15')]);router['get']('/whatsapp/queues',auth[_0xc236('0x7')](),controller[_0xc236('0x16')]);router[_0xc236('0x9')](_0xc236('0x17'),auth[_0xc236('0x7')](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0xc236('0x7')](),controller[_0xc236('0x18')]);router[_0xc236('0x9')]('/voice/queues/channels',auth[_0xc236('0x7')](),controller['voiceQueuesChannels']);router['get'](_0xc236('0x19'),auth[_0xc236('0x7')](),controller[_0xc236('0x1a')]);router[_0xc236('0x9')](_0xc236('0x1b'),auth[_0xc236('0x7')](),controller[_0xc236('0x1c')]);router[_0xc236('0x9')](_0xc236('0x1d'),auth[_0xc236('0x7')](),controller[_0xc236('0x1e')]);router['get'](_0xc236('0x1f'),auth[_0xc236('0x7')](),controller[_0xc236('0x20')]);router[_0xc236('0x21')](_0xc236('0x1f'),auth[_0xc236('0x7')](),controller[_0xc236('0x22')]);router[_0xc236('0x9')](_0xc236('0x23'),auth[_0xc236('0x7')](),controller[_0xc236('0x24')]);router['get'](_0xc236('0x25'),auth[_0xc236('0x7')](),controller[_0xc236('0x26')]);router[_0xc236('0x9')]('/agents',auth[_0xc236('0x7')](),controller['agents']);router['put'](_0xc236('0x27'),auth['isAuthenticated'](),controller[_0xc236('0x28')]);router['get'](_0xc236('0x29'),auth['isAuthenticated'](),controller[_0xc236('0x2a')]);router[_0xc236('0x9')]('/trunks',auth['isAuthenticated'](),controller[_0xc236('0x2b')]);router[_0xc236('0x9')](_0xc236('0x2c'),auth[_0xc236('0x7')](),controller['campaigns']);router['get'](_0xc236('0x2d'),auth['isAuthenticated'](),controller[_0xc236('0x2e')]);router['get'](_0xc236('0x2f'),auth[_0xc236('0x7')](),controller['chatQueuesWaitingInteractions']);router['get'](_0xc236('0x30'),auth[_0xc236('0x7')](),controller[_0xc236('0x31')]);router[_0xc236('0x9')](_0xc236('0x32'),auth[_0xc236('0x7')](),controller[_0xc236('0x33')]);router[_0xc236('0x9')](_0xc236('0x34'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0xc236('0x35'),auth[_0xc236('0x7')](),controller[_0xc236('0x36')]);router[_0xc236('0x9')](_0xc236('0x37'),auth[_0xc236('0x7')](),controller[_0xc236('0x38')]);router['get'](_0xc236('0x39'),auth[_0xc236('0x7')](),controller[_0xc236('0x3a')]);router['post'](_0xc236('0x3b'),auth[_0xc236('0x7')](),controller[_0xc236('0x3c')](_0xc236('0x3d')));router['get'](_0xc236('0x3e'),auth[_0xc236('0x7')](),controller[_0xc236('0x3f')]);router[_0xc236('0x40')](_0xc236('0x41'),auth[_0xc236('0x7')](),controller[_0xc236('0x3c')](_0xc236('0x42')));router[_0xc236('0x9')](_0xc236('0x43'),auth[_0xc236('0x7')](),controller[_0xc236('0x44')]);router[_0xc236('0x40')](_0xc236('0x45'),auth[_0xc236('0x7')](),controller[_0xc236('0x3c')](_0xc236('0x46')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xc236('0x40')]('/openchannel/queues/:id/notify',auth[_0xc236('0x7')](),controller[_0xc236('0x3c')](_0xc236('0x47')));router[_0xc236('0x9')](_0xc236('0x48'),auth[_0xc236('0x7')](),controller[_0xc236('0x49')]);router[_0xc236('0x40')](_0xc236('0x4a'),auth[_0xc236('0x7')](),controller[_0xc236('0x3c')](_0xc236('0x4b')));router[_0xc236('0x40')](_0xc236('0x4c'),auth[_0xc236('0x7')](),controller['queueNotify'](_0xc236('0x4d')));router[_0xc236('0x9')]('/sms/queues/:id',auth[_0xc236('0x7')](),controller['showSmsQueues']);router[_0xc236('0x9')]('/whatsapp/queues/:id',auth[_0xc236('0x7')](),controller[_0xc236('0x4e')]);router[_0xc236('0x40')]('/agents/:id/notify',auth[_0xc236('0x7')](),controller[_0xc236('0x4f')]);module[_0xc236('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 86907b6..67108f4 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 _0x1c8f=['agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','Start','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','status','json','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels'];(function(_0x329c6a,_0x5d8c1f){var _0x350d91=function(_0x1ce39e){while(--_0x1ce39e){_0x329c6a['push'](_0x329c6a['shift']());}};_0x350d91(++_0x5d8c1f);}(_0x1c8f,0xd8));var _0xf1c8=function(_0x9b1e7e,_0x56cc97){_0x9b1e7e=_0x9b1e7e-0x0;var _0x48856c=_0x1c8f[_0x9b1e7e];return _0x48856c;};'use strict';var BPromise=require('bluebird');var moment=require(_0xf1c8('0x0'));var _=require(_0xf1c8('0x1'));var util=require(_0xf1c8('0x2'));var db=require(_0xf1c8('0x3'))['db'];var logger=require('../../config/logger')(_0xf1c8('0x4'));var jayson=require(_0xf1c8('0x5'));var amiClient=jayson[_0xf1c8('0x6')][_0xf1c8('0x7')]({'port':0x232a});var mailClient=jayson[_0xf1c8('0x6')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xf1c8('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x39d215,_0x7f874a,_0x476364){return new BPromise(function(_0x14a9cd,_0x236316){var _0x4518aa=_0x476364?_0x476364:amiClient;return _0x4518aa[_0xf1c8('0x8')](_0x39d215,_0x7f874a)[_0xf1c8('0x9')](function(_0x19d60c){if(_0x19d60c[_0xf1c8('0xa')]){if(_0x19d60c[_0xf1c8('0xa')]['code']===0x1f4){return _0x236316(_0x19d60c[_0xf1c8('0xa')][_0xf1c8('0xb')]);}return _0x14a9cd(_0x19d60c[_0xf1c8('0xa')][_0xf1c8('0xb')]);}else{_0x14a9cd(_0x19d60c['result']);}})['catch'](function(_0x303a8f){_0x236316(_0x303a8f);});});}function respondWithResult(_0x56d601,_0xd18ded){_0xd18ded=_0xd18ded||0xc8;return function(_0x17666d){if(_0x17666d){return _0x56d601[_0xf1c8('0xc')](_0xd18ded)[_0xf1c8('0xd')](_0x17666d);}return _0x56d601['sendStatus'](0x194);};}function handleError(_0x423dbf,_0x5147fd){_0x5147fd=_0x5147fd||0x1f4;return function(_0x102b94){logger['error'](_0x102b94[_0xf1c8('0xe')]);if(_0x102b94[_0xf1c8('0xf')]){delete _0x102b94['name'];}_0x423dbf[_0xf1c8('0xc')](_0x5147fd)[_0xf1c8('0x10')](_0x102b94);};}function findById(_0x4d7ae3){return function(_0x3b8461){if(!_['isNil'](_0x4d7ae3)&&!_['isNil'](_0x3b8461)&&!_[_0xf1c8('0x11')](_0x3b8461[_0xf1c8('0x12')])){return _[_0xf1c8('0x13')](_0x3b8461[_0xf1c8('0x12')],function(_0x1a909a){return _0x1a909a['id']==_0x4d7ae3;});}return null;};}exports[_0xf1c8('0x14')]=function(_0x3b62f4,_0x45cf33){return respondWithRpcPromise(_0xf1c8('0x15'),_0x3b62f4[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x45cf33,null))[_0xf1c8('0x17')](handleError(_0x45cf33,null));};exports[_0xf1c8('0x18')]=function(_0x265cd5,_0x581f98){return respondWithRpcPromise(_0xf1c8('0x19'),_[_0xf1c8('0x1a')](_0x265cd5[_0xf1c8('0x16')],_0x265cd5[_0xf1c8('0x1b')]))[_0xf1c8('0x9')](respondWithResult(_0x581f98,null))['catch'](handleError(_0x581f98,null));};exports['voiceChannelStopMixMonitor']=function(_0x2edcd5,_0x28b6db){return respondWithRpcPromise(_0xf1c8('0x1c'),_[_0xf1c8('0x1a')](_0x2edcd5['query'],_0x2edcd5['params']))['then'](respondWithResult(_0x28b6db,null))[_0xf1c8('0x17')](handleError(_0x28b6db,null));};exports[_0xf1c8('0x1d')]=function(_0x3ba536,_0x2a75c6){return respondWithRpcPromise(_0xf1c8('0x1e'),_0x3ba536[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x2a75c6,null))['catch'](handleError(_0x2a75c6,null));};exports[_0xf1c8('0x1f')]=function(_0x74be83,_0xa445f5){return respondWithRpcPromise(_0xf1c8('0x1e'),_0x74be83[_0xf1c8('0x16')])['then'](findById(_0x74be83['params']['id']))[_0xf1c8('0x9')](respondWithResult(_0xa445f5,null))['catch'](handleError(_0xa445f5,null));};exports['updateVoiceQueue']=function(_0x46dd97,_0x59aa41){return respondWithRpcPromise(_0xf1c8('0x20'),_['merge'](_0x46dd97[_0xf1c8('0x21')],_0x46dd97[_0xf1c8('0x1b')]))[_0xf1c8('0x9')](respondWithResult(_0x59aa41,null))[_0xf1c8('0x17')](handleError(_0x59aa41,null));};exports[_0xf1c8('0x22')]=function(_0x20d358,_0x45b2a6){return respondWithRpcPromise(_0xf1c8('0x23'),_['merge'](_0x20d358[_0xf1c8('0x16')],_0x20d358['params']))[_0xf1c8('0x9')](respondWithResult(_0x45b2a6,null))[_0xf1c8('0x17')](handleError(_0x45b2a6,null));};exports['voiceQueuesChannels']=function(_0x421758,_0x48df66){return respondWithRpcPromise(_0xf1c8('0x24'),_0x421758[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x48df66,null))[_0xf1c8('0x17')](handleError(_0x48df66,null));};exports['voiceQueuesChannel']=function(_0x1a0537,_0x2db91e){return respondWithRpcPromise(_0xf1c8('0x25'),_[_0xf1c8('0x1a')](_0x1a0537['query'],_0x1a0537[_0xf1c8('0x1b')]))[_0xf1c8('0x9')](respondWithResult(_0x2db91e,null))['catch'](handleError(_0x2db91e,null));};exports[_0xf1c8('0x26')]=function(_0x3e6ff4,_0x4de89d){return respondWithRpcPromise(_0xf1c8('0x27'),_['merge'](_0x3e6ff4['query'],_0x3e6ff4[_0xf1c8('0x1b')]))[_0xf1c8('0x9')](respondWithResult(_0x4de89d,null))[_0xf1c8('0x17')](handleError(_0x4de89d,null));};exports['voiceQueuesChannelRedirect']=function(_0x26af2e,_0x23c513){return respondWithRpcPromise(_0xf1c8('0x28'),_[_0xf1c8('0x1a')](_0x26af2e['query'],_0x26af2e[_0xf1c8('0x1b')]))[_0xf1c8('0x9')](respondWithResult(_0x23c513,null))['catch'](handleError(_0x23c513,null));};exports[_0xf1c8('0x29')]=function(_0x13436c,_0x5372f2){return respondWithRpcPromise(_0xf1c8('0x2a'),_0x13436c[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x5372f2,null))['catch'](handleError(_0x5372f2,null));};exports[_0xf1c8('0x2b')]=function(_0x48f341,_0x29835b){return respondWithRpcPromise('OutboundChannels',_0x48f341['query'])[_0xf1c8('0x9')](respondWithResult(_0x29835b,null))[_0xf1c8('0x17')](handleError(_0x29835b,null));};exports[_0xf1c8('0x2c')]=function(_0x3bef84,_0x254252){var _0x1e1e2d;return respondWithRpcPromise(_0xf1c8('0x2d'),_0x3bef84[_0xf1c8('0x16')])[_0xf1c8('0x9')](function(_0x2af265){_0x1e1e2d=_0x2af265;return respondWithRpcPromise(_0xf1c8('0x2d'),_0x3bef84[_0xf1c8('0x16')],routingClient);})[_0xf1c8('0x9')](function(_0x255ac6){return _['merge']({},_0x255ac6,_0x1e1e2d);})[_0xf1c8('0x9')](respondWithResult(_0x254252,null))[_0xf1c8('0x17')](handleError(_0x254252,null));};exports[_0xf1c8('0x2e')]=function(_0xa43b4e,_0x27de0e){if(_0xa43b4e[_0xf1c8('0x21')]&&_0xa43b4e['body'][_0xf1c8('0x2f')]&&_0xa43b4e[_0xf1c8('0x30')]&&_0xa43b4e[_0xf1c8('0x30')][_0xf1c8('0xf')]){for(var _0x5b9975 in _0xa43b4e[_0xf1c8('0x21')]['interaction']){if(_0xa43b4e[_0xf1c8('0x21')][_0xf1c8('0x2f')][_0xf1c8('0x31')](_0x5b9975)){db[_0xf1c8('0x32')][_0xf1c8('0x33')]({'where':{'channel':_0x5b9975,'membername':_0xa43b4e[_0xf1c8('0x30')]['name'],'type':_0xf1c8('0x34'),'exitAt':null,'uniqueid':_0xa43b4e[_0xf1c8('0x21')][_0xf1c8('0x2f')][_0x5b9975]&&_0xa43b4e['body'][_0xf1c8('0x2f')][_0x5b9975][_0xf1c8('0x35')]?{'$notIn':_0xa43b4e['body']['interaction'][_0x5b9975]}:{'$ne':null}}})[_0xf1c8('0x9')](function(_0x2e345e){var _0x466baf=moment()[_0xf1c8('0x36')](_0xf1c8('0x37'));for(var _0x228417=0x0,_0x556433=_0x2e345e[_0xf1c8('0x35')];_0x228417<_0x556433;_0x228417+=0x1){_0x2e345e[_0x228417]['updateAttributes']({'exitAt':_0x466baf});}});for(var _0x35f105=0x0;_0x35f105<_0xa43b4e['body']['interaction'][_0x5b9975][_0xf1c8('0x35')];_0x35f105+=0x1){db[_0xf1c8('0x32')][_0xf1c8('0x38')]({'where':{'channel':_0x5b9975,'membername':_0xa43b4e['user'][_0xf1c8('0xf')],'type':'INTERACTION','uniqueid':_0xa43b4e[_0xf1c8('0x21')][_0xf1c8('0x2f')][_0x5b9975][_0x35f105],'exitAt':null},'defaults':{'channel':_0x5b9975,'membername':_0xa43b4e[_0xf1c8('0x30')]['name'],'interface':_[_0xf1c8('0x11')](_0xa43b4e[_0xf1c8('0x30')][_0xf1c8('0x39')])?util[_0xf1c8('0x36')](_0xf1c8('0x3a'),_0xa43b4e[_0xf1c8('0x30')]['name']):_0xa43b4e[_0xf1c8('0x30')][_0xf1c8('0x39')],'type':'INTERACTION','enterAt':moment()[_0xf1c8('0x36')](_0xf1c8('0x37')),'role':_0xf1c8('0x3b'),'internal':_0xa43b4e[_0xf1c8('0x30')][_0xf1c8('0x3c')],'uniqueid':_0xa43b4e[_0xf1c8('0x21')][_0xf1c8('0x2f')][_0x5b9975][_0x35f105]}});}}}}return respondWithRpcPromise(_0xf1c8('0x3d'),{'id':_0xa43b4e[_0xf1c8('0x1b')]['id'],'capacity':_0xa43b4e['body'][_0xf1c8('0x3e')]},routingClient)[_0xf1c8('0x9')](respondWithResult(_0x27de0e,null))[_0xf1c8('0x17')](handleError(_0x27de0e,null));};exports[_0xf1c8('0x3f')]=function(_0x8e33b0,_0x4b226e){return respondWithRpcPromise(_0xf1c8('0x40'),_0x8e33b0['query'])['then'](respondWithResult(_0x4b226e,null))[_0xf1c8('0x17')](handleError(_0x4b226e,null));};exports[_0xf1c8('0x41')]=function(_0x11c6f9,_0x22faca){return respondWithRpcPromise(_0xf1c8('0x42'),_0x11c6f9[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x22faca,null))[_0xf1c8('0x17')](handleError(_0x22faca,null));};exports[_0xf1c8('0x43')]=function(_0x3dccc6,_0x402ec3){return respondWithRpcPromise('Campaigns',_0x3dccc6[_0xf1c8('0x16')])[_0xf1c8('0x9')](respondWithResult(_0x402ec3,null))[_0xf1c8('0x17')](handleError(_0x402ec3,null));};exports['chatQueues']=function(_0x400de0,_0x36806f){return respondWithRpcPromise(_0xf1c8('0x44'),_0x400de0[_0xf1c8('0x16')],routingClient)['then'](respondWithResult(_0x36806f,null))[_0xf1c8('0x17')](handleError(_0x36806f,null));};exports['showChatQueues']=function(_0x41ca76,_0x3127cd){return respondWithRpcPromise(_0xf1c8('0x44'),_0x41ca76[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](findById(_0x41ca76[_0xf1c8('0x1b')]['id']))['then'](respondWithResult(_0x3127cd,null))[_0xf1c8('0x17')](handleError(_0x3127cd,null));};exports[_0xf1c8('0x45')]=function(_0xef21ee,_0x21bbf6){return respondWithRpcPromise(_0xf1c8('0x46'),_0xef21ee[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x21bbf6,null))[_0xf1c8('0x17')](handleError(_0x21bbf6,null));};exports['showMailQueues']=function(_0x4b6f27,_0x28106d){return respondWithRpcPromise(_0xf1c8('0x46'),_0x4b6f27[_0xf1c8('0x16')],routingClient)['then'](findById(_0x4b6f27[_0xf1c8('0x1b')]['id']))[_0xf1c8('0x9')](respondWithResult(_0x28106d,null))[_0xf1c8('0x17')](handleError(_0x28106d,null));};exports[_0xf1c8('0x47')]=function(_0x5c4279,_0x2994f8){return respondWithRpcPromise(_0xf1c8('0x48'),_0x5c4279[_0xf1c8('0x16')],mailClient)[_0xf1c8('0x9')](respondWithResult(_0x2994f8,null))[_0xf1c8('0x17')](handleError(_0x2994f8,null));};exports[_0xf1c8('0x49')]=function(_0x1a36d1,_0x15f68a){return respondWithRpcPromise(_0xf1c8('0x4a'),_0x1a36d1[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x15f68a,null))[_0xf1c8('0x17')](handleError(_0x15f68a,null));};exports[_0xf1c8('0x4b')]=function(_0x16fd66,_0x28c6b3){return respondWithRpcPromise('OpenchannelQueues',_0x16fd66['query'],routingClient)[_0xf1c8('0x9')](findById(_0x16fd66[_0xf1c8('0x1b')]['id']))[_0xf1c8('0x9')](respondWithResult(_0x28c6b3,null))[_0xf1c8('0x17')](handleError(_0x28c6b3,null));};exports[_0xf1c8('0x4c')]=function(_0x4c6768,_0x283022){return respondWithRpcPromise(_0xf1c8('0x4d'),_0x4c6768['query'],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x283022,null))[_0xf1c8('0x17')](handleError(_0x283022,null));};exports[_0xf1c8('0x4e')]=function(_0x489505,_0x5896a6){return respondWithRpcPromise('SmsQueues',_0x489505['query'],routingClient)[_0xf1c8('0x9')](findById(_0x489505[_0xf1c8('0x1b')]['id']))[_0xf1c8('0x9')](respondWithResult(_0x5896a6,null))['catch'](handleError(_0x5896a6,null));};exports['whatsappQueues']=function(_0x16c933,_0x54a626){return respondWithRpcPromise(_0xf1c8('0x4f'),_0x16c933['query'],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x54a626,null))[_0xf1c8('0x17')](handleError(_0x54a626,null));};exports[_0xf1c8('0x50')]=function(_0x3b26cf,_0x49c03d){return respondWithRpcPromise(_0xf1c8('0x4f'),_0x3b26cf[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](findById(_0x3b26cf[_0xf1c8('0x1b')]['id']))[_0xf1c8('0x9')](respondWithResult(_0x49c03d,null))[_0xf1c8('0x17')](handleError(_0x49c03d,null));};exports[_0xf1c8('0x51')]=function(_0x533055,_0x393e1c){return respondWithRpcPromise(_0xf1c8('0x52'),_0x533055[_0xf1c8('0x16')],routingClient)['then'](respondWithResult(_0x393e1c,null))[_0xf1c8('0x17')](handleError(_0x393e1c,null));};exports[_0xf1c8('0x53')]=function(_0x10e425,_0x13e4ee){return respondWithRpcPromise(_0xf1c8('0x52'),_0x10e425['query'],routingClient)[_0xf1c8('0x9')](findById(_0x10e425[_0xf1c8('0x1b')]['id']))[_0xf1c8('0x9')](respondWithResult(_0x13e4ee,null))['catch'](handleError(_0x13e4ee,null));};exports[_0xf1c8('0x54')]=function(_0x9ecd03,_0x553794){return respondWithRpcPromise(_0xf1c8('0x55'),_0x9ecd03['query'])[_0xf1c8('0x9')](respondWithResult(_0x553794,null))[_0xf1c8('0x17')](handleError(_0x553794,null));};exports[_0xf1c8('0x56')]=function(_0x37fbc9,_0x535ed6){return respondWithRpcPromise(_0xf1c8('0x57'),_0x37fbc9[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x535ed6,null))[_0xf1c8('0x17')](handleError(_0x535ed6,null));};exports[_0xf1c8('0x58')]=function(_0x113c94,_0x16ee42){return respondWithRpcPromise(_0xf1c8('0x59'),_0x113c94[_0xf1c8('0x16')],routingClient)['then'](respondWithResult(_0x16ee42,null))['catch'](handleError(_0x16ee42,null));};exports[_0xf1c8('0x5a')]=function(_0x23c0dc,_0x4163f7){return respondWithRpcPromise(_0xf1c8('0x5b'),_0x23c0dc['query'],routingClient)['then'](respondWithResult(_0x4163f7,null))[_0xf1c8('0x17')](handleError(_0x4163f7,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x29b236,_0x3cb82b){return respondWithRpcPromise(_0xf1c8('0x5b'),_0x29b236[_0xf1c8('0x16')],routingClient)['then'](function(_0x3da5c7){if(_0x29b236[_0xf1c8('0x16')][_0xf1c8('0x5c')]!==undefined){var _0x17c72c=_(_0x3da5c7[_0xf1c8('0x12')])[_0xf1c8('0x5d')]([_0x29b236[_0xf1c8('0x16')][_0xf1c8('0x5c')],_0x29b236[_0xf1c8('0x1b')]['id']])[_0xf1c8('0x5e')]('queue_id')[_0xf1c8('0x5f')]()[_0xf1c8('0x60')]();return _0x3da5c7[_0xf1c8('0x12')]['filter'](function(_0x412a69){return _0x17c72c[_0xf1c8('0x61')](_0x412a69[_0xf1c8('0x62')])>-0x1;});}else{return _0x3da5c7['rows'][_0xf1c8('0x5d')](function(_0x1149cf){return _0x1149cf[_0xf1c8('0x62')]===parseInt(_0x29b236['params']['id']);});}})[_0xf1c8('0x9')](respondWithResult(_0x3cb82b,null))[_0xf1c8('0x17')](handleError(_0x3cb82b,null));};exports[_0xf1c8('0x63')]=function(_0x66d99,_0x1cda64){return respondWithRpcPromise(_0xf1c8('0x64'),_0x66d99['query'],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x1cda64,null))[_0xf1c8('0x17')](handleError(_0x1cda64,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x242f6d,_0x2967ef){return respondWithRpcPromise(_0xf1c8('0x65'),_0x242f6d[_0xf1c8('0x16')],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x2967ef,null))[_0xf1c8('0x17')](handleError(_0x2967ef,null));};exports[_0xf1c8('0x66')]=function(_0x269070,_0x438b94){return respondWithRpcPromise(_0xf1c8('0x67'),_0x269070['query'],routingClient)[_0xf1c8('0x9')](respondWithResult(_0x438b94,null))[_0xf1c8('0x17')](handleError(_0x438b94,null));};exports['queueNotify']=function(_0x5e6210){return function(_0x49c3d9,_0x3e1557){var _0x26d53e,_0x57b1c2;var _0x4b94fc=_['capitalize'](_0x5e6210);var _0x10b1ed=_0x5e6210===_0xf1c8('0x68')?_0xf1c8('0x69'):_0xf1c8('0x6a');return db[_0x4b94fc+_0xf1c8('0x6b')]['findOne']({'raw':!![],'where':{'id':_0x49c3d9[_0xf1c8('0x1b')]['id']}})[_0xf1c8('0x9')](function(_0x3c4c04){if(_[_0xf1c8('0x11')](_0x3c4c04)){throw new Error(_0x4b94fc+_0xf1c8('0x6c'));}_0x26d53e=_0x3c4c04;return db[_0x4b94fc+_0xf1c8('0x6d')][_0xf1c8('0x6e')]({'where':{'id':_0x49c3d9[_0xf1c8('0x21')][_0xf1c8('0x6f')]},'include':[{'model':db[_0x4b94fc+_0xf1c8('0x70')],'as':_0xf1c8('0x70')},{'model':db[_0x4b94fc+_0x10b1ed],'as':_0xf1c8('0x6a')}]});})[_0xf1c8('0x9')](function(_0x4fc055){if(_[_0xf1c8('0x11')](_0x4fc055)){throw new Error(_0x4b94fc+_0xf1c8('0x71'));}_0x57b1c2=_0x4fc055;return _0x4fc055[_0xf1c8('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf1c8('0x9')](function(){var _0x5101a0={'uniqueid':_0x5e6210+'.'+_0x57b1c2['id']+'.'+_0x57b1c2[_0xf1c8('0x70')]['id'],'FromUserId':_0x49c3d9[_0xf1c8('0x30')]['id'],'type':_0xf1c8('0x73')};_0x5101a0[_0x4b94fc+_0xf1c8('0x74')]=_0x57b1c2['id'];_0x5101a0[_0x4b94fc+_0xf1c8('0x75')]=_0x57b1c2[_0xf1c8('0x70')]['id'];_0x5101a0[_0xf1c8('0x76')+_0x4b94fc+_0x10b1ed+'Id']=_0x57b1c2[_0xf1c8('0x6a')]['id'];_0x5101a0['To'+_0x4b94fc+_0xf1c8('0x77')]=_0x26d53e['id'];return db[_0x4b94fc+_0xf1c8('0x78')][_0xf1c8('0x79')](_0x5101a0);})[_0xf1c8('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x5e6210,'interaction':_0x57b1c2['Interaction'],'message':_0x57b1c2,'account':_0x57b1c2['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf1c8('0x73'),'appdata':_0x26d53e[_0xf1c8('0xf')]+','+(_0x57b1c2[_0xf1c8('0x6a')][_0xf1c8('0x7a')]||0x12c),'interval':_0xf1c8('0x7b')}]},routingClient);})[_0xf1c8('0x9')](respondWithResult(_0x3e1557,null))['catch'](handleError(_0x3e1557,null));};};exports[_0xf1c8('0x7c')]=function(_0x1a33e4,_0x272d20){var _0x24bfd8,_0x2561c4;if(_[_0xf1c8('0x11')](_0x1a33e4[_0xf1c8('0x21')][_0xf1c8('0x7d')])){throw new Error(_0xf1c8('0x7e'));}var _0x127f7d=_0x1a33e4[_0xf1c8('0x21')]['channel'];var _0x3f1c79=_['capitalize'](_0x127f7d);var _0x2f4573=_0x127f7d===_0xf1c8('0x68')?'Website':'Account';return db[_0xf1c8('0x7f')][_0xf1c8('0x6e')]({'raw':!![],'where':{'id':_0x1a33e4[_0xf1c8('0x1b')]['id'],'role':_0xf1c8('0x3b')}})[_0xf1c8('0x9')](function(_0x12444d){if(_[_0xf1c8('0x11')](_0x12444d)){throw new Error(_0xf1c8('0x80'));}_0x24bfd8=_0x12444d;return db[_0x3f1c79+_0xf1c8('0x6d')][_0xf1c8('0x6e')]({'where':{'id':_0x1a33e4['body']['messageId']},'include':[{'model':db[_0x3f1c79+'Interaction'],'as':'Interaction'},{'model':db[_0x3f1c79+_0x2f4573],'as':'Account'}]});})[_0xf1c8('0x9')](function(_0x4e94ff){if(_['isNil'](_0x4e94ff)){throw new Error(_0x3f1c79+'\x20Message\x20not\x20found');}_0x2561c4=_0x4e94ff;return _0x4e94ff[_0xf1c8('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf1c8('0x9')](function(){var _0x3cda04={'uniqueid':_0x127f7d+'.'+_0x2561c4['id']+'.'+_0x2561c4[_0xf1c8('0x70')]['id'],'FromUserId':_0x1a33e4[_0xf1c8('0x30')]['id'],'type':_0xf1c8('0x3b'),'ToUserId':_0x24bfd8['id']};_0x3cda04[_0x3f1c79+'MessageId']=_0x2561c4['id'];_0x3cda04[_0x3f1c79+_0xf1c8('0x75')]=_0x2561c4[_0xf1c8('0x70')]['id'];_0x3cda04[_0xf1c8('0x76')+_0x3f1c79+_0x2f4573+'Id']=_0x2561c4[_0xf1c8('0x6a')]['id'];return db[_0x3f1c79+_0xf1c8('0x78')][_0xf1c8('0x79')](_0x3cda04);})[_0xf1c8('0x9')](function(){return respondWithRpcPromise(_0xf1c8('0x81'),{'channel':_0x127f7d,'interaction':_0x2561c4[_0xf1c8('0x70')],'message':_0x2561c4,'account':_0x2561c4[_0xf1c8('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xf1c8('0x3b'),'appdata':_0x24bfd8['name']+','+(_0x2561c4[_0xf1c8('0x6a')]['agentTransferTimeout']||0x12c),'interval':_0xf1c8('0x7b')}]},routingClient);})['then'](respondWithResult(_0x272d20,null))[_0xf1c8('0x17')](handleError(_0x272d20,null));}; \ No newline at end of file +var _0x30a4=['showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','capitalize','Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','client','http','request','error','code','result','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','capacity','telephones','Trunks','campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues'];(function(_0x407844,_0x47eedc){var _0x36f5df=function(_0x31ee6d){while(--_0x31ee6d){_0x407844['push'](_0x407844['shift']());}};_0x36f5df(++_0x47eedc);}(_0x30a4,0xaf));var _0x430a=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x30a4[_0x4907de];return _0x482054;};'use strict';var BPromise=require(_0x430a('0x0'));var moment=require(_0x430a('0x1'));var _=require('lodash');var util=require(_0x430a('0x2'));var db=require(_0x430a('0x3'))['db'];var logger=require(_0x430a('0x4'))(_0x430a('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0x430a('0x6')][_0x430a('0x7')]({'port':0x232b});var routingClient=jayson[_0x430a('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0xca9fe,_0x6173ff,_0x434cf0){return new BPromise(function(_0x5654bf,_0x24bd36){var _0x5d6712=_0x434cf0?_0x434cf0:amiClient;return _0x5d6712[_0x430a('0x8')](_0xca9fe,_0x6173ff)['then'](function(_0x1ee4ad){if(_0x1ee4ad[_0x430a('0x9')]){if(_0x1ee4ad[_0x430a('0x9')][_0x430a('0xa')]===0x1f4){return _0x24bd36(_0x1ee4ad['error']['message']);}return _0x5654bf(_0x1ee4ad[_0x430a('0x9')]['message']);}else{_0x5654bf(_0x1ee4ad[_0x430a('0xb')]);}})[_0x430a('0xc')](function(_0x1a578c){_0x24bd36(_0x1a578c);});});}function respondWithResult(_0x5191f3,_0x16cc04){_0x16cc04=_0x16cc04||0xc8;return function(_0x174f47){if(_0x174f47){return _0x5191f3['status'](_0x16cc04)[_0x430a('0xd')](_0x174f47);}return _0x5191f3[_0x430a('0xe')](0x194);};}function handleError(_0x27db3b,_0x31c4e6){_0x31c4e6=_0x31c4e6||0x1f4;return function(_0x4d00d6){logger[_0x430a('0x9')](_0x4d00d6[_0x430a('0xf')]);if(_0x4d00d6[_0x430a('0x10')]){delete _0x4d00d6[_0x430a('0x10')];}_0x27db3b[_0x430a('0x11')](_0x31c4e6)[_0x430a('0x12')](_0x4d00d6);};}function findById(_0x351d14){return function(_0x2df103){if(!_[_0x430a('0x13')](_0x351d14)&&!_[_0x430a('0x13')](_0x2df103)&&!_[_0x430a('0x13')](_0x2df103[_0x430a('0x14')])){return _[_0x430a('0x15')](_0x2df103['rows'],function(_0x122148){return _0x122148['id']==_0x351d14;});}return null;};}exports[_0x430a('0x16')]=function(_0x36ed68,_0x1d7dcb){return respondWithRpcPromise(_0x430a('0x17'),_0x36ed68[_0x430a('0x18')])[_0x430a('0x19')](respondWithResult(_0x1d7dcb,null))['catch'](handleError(_0x1d7dcb,null));};exports[_0x430a('0x1a')]=function(_0x230b88,_0x417705){return respondWithRpcPromise(_0x430a('0x1b'),_[_0x430a('0x1c')](_0x230b88[_0x430a('0x18')],_0x230b88['params']))['then'](respondWithResult(_0x417705,null))[_0x430a('0xc')](handleError(_0x417705,null));};exports['voiceChannelStopMixMonitor']=function(_0x4e9827,_0x251c99){return respondWithRpcPromise(_0x430a('0x1d'),_[_0x430a('0x1c')](_0x4e9827[_0x430a('0x18')],_0x4e9827[_0x430a('0x1e')]))[_0x430a('0x19')](respondWithResult(_0x251c99,null))[_0x430a('0xc')](handleError(_0x251c99,null));};exports[_0x430a('0x1f')]=function(_0xef5394,_0x11e6d5){return respondWithRpcPromise(_0x430a('0x20'),_0xef5394[_0x430a('0x18')])['then'](respondWithResult(_0x11e6d5,null))['catch'](handleError(_0x11e6d5,null));};exports[_0x430a('0x21')]=function(_0x2e7549,_0x373cc3){return respondWithRpcPromise(_0x430a('0x20'),_0x2e7549[_0x430a('0x18')])[_0x430a('0x19')](findById(_0x2e7549[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x373cc3,null))[_0x430a('0xc')](handleError(_0x373cc3,null));};exports[_0x430a('0x22')]=function(_0x1346d6,_0x28db04){return respondWithRpcPromise(_0x430a('0x23'),_[_0x430a('0x1c')](_0x1346d6[_0x430a('0x24')],_0x1346d6[_0x430a('0x1e')]))[_0x430a('0x19')](respondWithResult(_0x28db04,null))[_0x430a('0xc')](handleError(_0x28db04,null));};exports[_0x430a('0x25')]=function(_0x32482c,_0x2d875){return respondWithRpcPromise(_0x430a('0x26'),_[_0x430a('0x1c')](_0x32482c[_0x430a('0x18')],_0x32482c[_0x430a('0x1e')]))[_0x430a('0x19')](respondWithResult(_0x2d875,null))[_0x430a('0xc')](handleError(_0x2d875,null));};exports[_0x430a('0x27')]=function(_0x20a0ff,_0x32f4a5){return respondWithRpcPromise('VoiceQueuesChannels',_0x20a0ff['query'])[_0x430a('0x19')](respondWithResult(_0x32f4a5,null))[_0x430a('0xc')](handleError(_0x32f4a5,null));};exports['voiceQueuesChannel']=function(_0xfcc0b1,_0x1b7f11){return respondWithRpcPromise(_0x430a('0x28'),_[_0x430a('0x1c')](_0xfcc0b1['query'],_0xfcc0b1['params']))['then'](respondWithResult(_0x1b7f11,null))[_0x430a('0xc')](handleError(_0x1b7f11,null));};exports[_0x430a('0x29')]=function(_0x2a7ed4,_0x34d37e){return respondWithRpcPromise(_0x430a('0x2a'),_[_0x430a('0x1c')](_0x2a7ed4[_0x430a('0x18')],_0x2a7ed4[_0x430a('0x1e')]))[_0x430a('0x19')](respondWithResult(_0x34d37e,null))['catch'](handleError(_0x34d37e,null));};exports['voiceQueuesChannelRedirect']=function(_0x57467f,_0x1f7eb2){return respondWithRpcPromise(_0x430a('0x2b'),_['merge'](_0x57467f['query'],_0x57467f[_0x430a('0x1e')]))[_0x430a('0x19')](respondWithResult(_0x1f7eb2,null))[_0x430a('0xc')](handleError(_0x1f7eb2,null));};exports[_0x430a('0x2c')]=function(_0x30d9b6,_0x384028){return respondWithRpcPromise(_0x430a('0x2d'),_0x30d9b6[_0x430a('0x18')])[_0x430a('0x19')](respondWithResult(_0x384028,null))[_0x430a('0xc')](handleError(_0x384028,null));};exports['outboundChannels']=function(_0x2f47a2,_0x4a13cb){return respondWithRpcPromise(_0x430a('0x2e'),_0x2f47a2[_0x430a('0x18')])['then'](respondWithResult(_0x4a13cb,null))[_0x430a('0xc')](handleError(_0x4a13cb,null));};exports[_0x430a('0x2f')]=function(_0x221e64,_0xe518e6){var _0x3c3b6d;return respondWithRpcPromise(_0x430a('0x30'),_0x221e64[_0x430a('0x18')])['then'](function(_0x51baf4){_0x3c3b6d=_0x51baf4;return respondWithRpcPromise(_0x430a('0x30'),_0x221e64[_0x430a('0x18')],routingClient);})[_0x430a('0x19')](function(_0x325888){return _[_0x430a('0x1c')]({},_0x325888,_0x3c3b6d);})[_0x430a('0x19')](respondWithResult(_0xe518e6,null))[_0x430a('0xc')](handleError(_0xe518e6,null));};exports[_0x430a('0x31')]=function(_0x27409a,_0x5704fb){if(_0x27409a[_0x430a('0x24')]&&_0x27409a[_0x430a('0x24')][_0x430a('0x32')]&&_0x27409a[_0x430a('0x33')]&&_0x27409a[_0x430a('0x33')][_0x430a('0x10')]){for(var _0x37fb21 in _0x27409a[_0x430a('0x24')][_0x430a('0x32')]){if(_0x27409a[_0x430a('0x24')]['interaction'][_0x430a('0x34')](_0x37fb21)){db[_0x430a('0x35')][_0x430a('0x36')]({'where':{'channel':_0x37fb21,'membername':_0x27409a[_0x430a('0x33')][_0x430a('0x10')],'type':_0x430a('0x37'),'exitAt':null,'uniqueid':_0x27409a[_0x430a('0x24')]['interaction'][_0x37fb21]&&_0x27409a['body'][_0x430a('0x32')][_0x37fb21][_0x430a('0x38')]?{'$notIn':_0x27409a[_0x430a('0x24')][_0x430a('0x32')][_0x37fb21]}:{'$ne':null}}})[_0x430a('0x19')](function(_0x437669){var _0x4075d2=moment()[_0x430a('0x39')](_0x430a('0x3a'));for(var _0xb27055=0x0,_0x22a1d7=_0x437669[_0x430a('0x38')];_0xb27055<_0x22a1d7;_0xb27055+=0x1){_0x437669[_0xb27055][_0x430a('0x3b')]({'exitAt':_0x4075d2});}});for(var _0x43b7e9=0x0;_0x43b7e9<_0x27409a[_0x430a('0x24')][_0x430a('0x32')][_0x37fb21]['length'];_0x43b7e9+=0x1){db[_0x430a('0x35')]['findOrCreate']({'where':{'channel':_0x37fb21,'membername':_0x27409a[_0x430a('0x33')]['name'],'type':_0x430a('0x37'),'uniqueid':_0x27409a[_0x430a('0x24')][_0x430a('0x32')][_0x37fb21][_0x43b7e9],'exitAt':null},'defaults':{'channel':_0x37fb21,'membername':_0x27409a[_0x430a('0x33')][_0x430a('0x10')],'interface':_[_0x430a('0x13')](_0x27409a['user'][_0x430a('0x3c')])?util['format'](_0x430a('0x3d'),_0x27409a[_0x430a('0x33')][_0x430a('0x10')]):_0x27409a[_0x430a('0x33')][_0x430a('0x3c')],'type':_0x430a('0x37'),'enterAt':moment()[_0x430a('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x430a('0x3e'),'internal':_0x27409a[_0x430a('0x33')][_0x430a('0x3f')],'uniqueid':_0x27409a[_0x430a('0x24')]['interaction'][_0x37fb21][_0x43b7e9]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x27409a[_0x430a('0x1e')]['id'],'capacity':_0x27409a['body'][_0x430a('0x40')]},routingClient)['then'](respondWithResult(_0x5704fb,null))[_0x430a('0xc')](handleError(_0x5704fb,null));};exports[_0x430a('0x41')]=function(_0x2c5055,_0x401437){return respondWithRpcPromise('Telephones',_0x2c5055[_0x430a('0x18')])['then'](respondWithResult(_0x401437,null))['catch'](handleError(_0x401437,null));};exports['trunks']=function(_0x2e579d,_0x43af63){return respondWithRpcPromise(_0x430a('0x42'),_0x2e579d['query'])['then'](respondWithResult(_0x43af63,null))['catch'](handleError(_0x43af63,null));};exports[_0x430a('0x43')]=function(_0x5a08a5,_0x530ab2){return respondWithRpcPromise('Campaigns',_0x5a08a5['query'])[_0x430a('0x19')](respondWithResult(_0x530ab2,null))[_0x430a('0xc')](handleError(_0x530ab2,null));};exports[_0x430a('0x44')]=function(_0x13534d,_0x35e675){return respondWithRpcPromise('ChatQueues',_0x13534d[_0x430a('0x18')],routingClient)[_0x430a('0x19')](respondWithResult(_0x35e675,null))[_0x430a('0xc')](handleError(_0x35e675,null));};exports[_0x430a('0x45')]=function(_0x197f22,_0x1a5aa3){return respondWithRpcPromise(_0x430a('0x46'),_0x197f22[_0x430a('0x18')],routingClient)['then'](findById(_0x197f22[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x1a5aa3,null))['catch'](handleError(_0x1a5aa3,null));};exports[_0x430a('0x47')]=function(_0x269513,_0x4beef1){return respondWithRpcPromise(_0x430a('0x48'),_0x269513[_0x430a('0x18')],routingClient)['then'](respondWithResult(_0x4beef1,null))['catch'](handleError(_0x4beef1,null));};exports[_0x430a('0x49')]=function(_0x738a09,_0x3cdd25){return respondWithRpcPromise(_0x430a('0x48'),_0x738a09[_0x430a('0x18')],routingClient)[_0x430a('0x19')](findById(_0x738a09[_0x430a('0x1e')]['id']))['then'](respondWithResult(_0x3cdd25,null))[_0x430a('0xc')](handleError(_0x3cdd25,null));};exports[_0x430a('0x4a')]=function(_0x860857,_0x397603){return respondWithRpcPromise(_0x430a('0x4b'),_0x860857[_0x430a('0x18')],mailClient)[_0x430a('0x19')](respondWithResult(_0x397603,null))[_0x430a('0xc')](handleError(_0x397603,null));};exports[_0x430a('0x4c')]=function(_0x577e47,_0x583f42){return respondWithRpcPromise('OpenchannelQueues',_0x577e47['query'],routingClient)[_0x430a('0x19')](respondWithResult(_0x583f42,null))[_0x430a('0xc')](handleError(_0x583f42,null));};exports['showOpenchannelQueues']=function(_0x3e6882,_0x535c12){return respondWithRpcPromise(_0x430a('0x4d'),_0x3e6882['query'],routingClient)[_0x430a('0x19')](findById(_0x3e6882[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x535c12,null))[_0x430a('0xc')](handleError(_0x535c12,null));};exports['smsQueues']=function(_0x29267c,_0x546110){return respondWithRpcPromise(_0x430a('0x4e'),_0x29267c[_0x430a('0x18')],routingClient)[_0x430a('0x19')](respondWithResult(_0x546110,null))[_0x430a('0xc')](handleError(_0x546110,null));};exports[_0x430a('0x4f')]=function(_0x1df4d0,_0x3b8776){return respondWithRpcPromise(_0x430a('0x4e'),_0x1df4d0[_0x430a('0x18')],routingClient)[_0x430a('0x19')](findById(_0x1df4d0[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x3b8776,null))[_0x430a('0xc')](handleError(_0x3b8776,null));};exports[_0x430a('0x50')]=function(_0x596c4b,_0x31f54f){return respondWithRpcPromise(_0x430a('0x51'),_0x596c4b[_0x430a('0x18')],routingClient)['then'](respondWithResult(_0x31f54f,null))[_0x430a('0xc')](handleError(_0x31f54f,null));};exports['showWhatsappQueues']=function(_0x26da02,_0x1e97ff){return respondWithRpcPromise(_0x430a('0x51'),_0x26da02['query'],routingClient)['then'](findById(_0x26da02[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x1e97ff,null))['catch'](handleError(_0x1e97ff,null));};exports[_0x430a('0x52')]=function(_0x17b6f0,_0x52866d){return respondWithRpcPromise(_0x430a('0x53'),_0x17b6f0[_0x430a('0x18')],routingClient)['then'](respondWithResult(_0x52866d,null))['catch'](handleError(_0x52866d,null));};exports['showFaxQueues']=function(_0x571565,_0x5da0f1){return respondWithRpcPromise('FaxQueues',_0x571565['query'],routingClient)[_0x430a('0x19')](findById(_0x571565[_0x430a('0x1e')]['id']))[_0x430a('0x19')](respondWithResult(_0x5da0f1,null))['catch'](handleError(_0x5da0f1,null));};exports[_0x430a('0x54')]=function(_0x5bf507,_0x2345c7){return respondWithRpcPromise(_0x430a('0x55'),_0x5bf507[_0x430a('0x18')])['then'](respondWithResult(_0x2345c7,null))[_0x430a('0xc')](handleError(_0x2345c7,null));};exports['chatQueuesWaitingInteractions']=function(_0x279c13,_0x49d1be){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x279c13['query'],routingClient)['then'](respondWithResult(_0x49d1be,null))['catch'](handleError(_0x49d1be,null));};exports[_0x430a('0x56')]=function(_0x3127d6,_0x529c54){return respondWithRpcPromise(_0x430a('0x57'),_0x3127d6[_0x430a('0x18')],routingClient)['then'](respondWithResult(_0x529c54,null))[_0x430a('0xc')](handleError(_0x529c54,null));};exports[_0x430a('0x58')]=function(_0x1f9273,_0x10c762){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1f9273[_0x430a('0x18')],routingClient)[_0x430a('0x19')](respondWithResult(_0x10c762,null))['catch'](handleError(_0x10c762,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55087d,_0x502e41){return respondWithRpcPromise(_0x430a('0x59'),_0x55087d['query'],routingClient)[_0x430a('0x19')](function(_0xee3987){if(_0x55087d[_0x430a('0x18')]['type']!==undefined){var _0x16d12f=_(_0xee3987[_0x430a('0x14')])[_0x430a('0x5a')]([_0x55087d[_0x430a('0x18')]['type'],_0x55087d[_0x430a('0x1e')]['id']])[_0x430a('0x5b')](_0x430a('0x5c'))['uniq']()[_0x430a('0x5d')]();return _0xee3987['rows'][_0x430a('0x5a')](function(_0x3d9564){return _0x16d12f[_0x430a('0x5e')](_0x3d9564[_0x430a('0x5c')])>-0x1;});}else{return _0xee3987[_0x430a('0x14')][_0x430a('0x5a')](function(_0x4c468b){return _0x4c468b[_0x430a('0x5c')]===parseInt(_0x55087d[_0x430a('0x1e')]['id']);});}})[_0x430a('0x19')](respondWithResult(_0x502e41,null))['catch'](handleError(_0x502e41,null));};exports[_0x430a('0x5f')]=function(_0xd02e92,_0x57e568){return respondWithRpcPromise(_0x430a('0x60'),_0xd02e92[_0x430a('0x18')],routingClient)['then'](respondWithResult(_0x57e568,null))[_0x430a('0xc')](handleError(_0x57e568,null));};exports[_0x430a('0x61')]=function(_0x34a21d,_0x553e01){return respondWithRpcPromise(_0x430a('0x62'),_0x34a21d['query'],routingClient)[_0x430a('0x19')](respondWithResult(_0x553e01,null))[_0x430a('0xc')](handleError(_0x553e01,null));};exports[_0x430a('0x63')]=function(_0x4bc346,_0x1a18d5){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4bc346[_0x430a('0x18')],routingClient)[_0x430a('0x19')](respondWithResult(_0x1a18d5,null))['catch'](handleError(_0x1a18d5,null));};exports['queueNotify']=function(_0x2d07a8){return function(_0x1e4c1f,_0x55f9eb){var _0x419352,_0x4fc563;var _0x1d3031=_['capitalize'](_0x2d07a8);var _0x2f424b=_0x2d07a8===_0x430a('0x64')?_0x430a('0x65'):_0x430a('0x66');return db[_0x1d3031+_0x430a('0x67')][_0x430a('0x68')]({'raw':!![],'where':{'id':_0x1e4c1f[_0x430a('0x1e')]['id']}})[_0x430a('0x19')](function(_0x486f08){if(_[_0x430a('0x13')](_0x486f08)){throw new Error(_0x1d3031+'\x20Queue\x20not\x20found');}_0x419352=_0x486f08;return db[_0x1d3031+_0x430a('0x69')][_0x430a('0x68')]({'where':{'id':_0x1e4c1f[_0x430a('0x24')][_0x430a('0x6a')]},'include':[{'model':db[_0x1d3031+'Interaction'],'as':_0x430a('0x6b')},{'model':db[_0x1d3031+_0x2f424b],'as':_0x430a('0x66')}]});})['then'](function(_0x25d17d){if(_[_0x430a('0x13')](_0x25d17d)){throw new Error(_0x1d3031+_0x430a('0x6c'));}_0x4fc563=_0x25d17d;return _0x25d17d[_0x430a('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x430a('0x19')](function(){var _0x158f84={'uniqueid':_0x2d07a8+'.'+_0x4fc563['id']+'.'+_0x4fc563[_0x430a('0x6b')]['id'],'FromUserId':_0x1e4c1f['user']['id'],'type':_0x430a('0x6e')};_0x158f84[_0x1d3031+'MessageId']=_0x4fc563['id'];_0x158f84[_0x1d3031+_0x430a('0x6f')]=_0x4fc563[_0x430a('0x6b')]['id'];_0x158f84[_0x430a('0x70')+_0x1d3031+_0x2f424b+'Id']=_0x4fc563['Account']['id'];_0x158f84['To'+_0x1d3031+_0x430a('0x71')]=_0x419352['id'];return db[_0x1d3031+_0x430a('0x72')][_0x430a('0x73')](_0x158f84);})[_0x430a('0x19')](function(){return respondWithRpcPromise(_0x430a('0x74'),{'channel':_0x2d07a8,'interaction':_0x4fc563[_0x430a('0x6b')],'message':_0x4fc563,'account':_0x4fc563[_0x430a('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0x430a('0x6e'),'appdata':_0x419352[_0x430a('0x10')]+','+(_0x4fc563[_0x430a('0x66')][_0x430a('0x75')]||0x12c),'interval':_0x430a('0x76')}]},routingClient);})[_0x430a('0x19')](respondWithResult(_0x55f9eb,null))[_0x430a('0xc')](handleError(_0x55f9eb,null));};};exports['agentNotify']=function(_0x2a1a06,_0xdbb39b){var _0x15f4c3,_0x9c8163;if(_[_0x430a('0x13')](_0x2a1a06[_0x430a('0x24')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4c73b7=_0x2a1a06[_0x430a('0x24')][_0x430a('0x77')];var _0x6ca475=_[_0x430a('0x78')](_0x4c73b7);var _0x2ed666=_0x4c73b7===_0x430a('0x64')?_0x430a('0x65'):'Account';return db['User'][_0x430a('0x68')]({'raw':!![],'where':{'id':_0x2a1a06['params']['id'],'role':_0x430a('0x3e')}})[_0x430a('0x19')](function(_0x1a3b0b){if(_[_0x430a('0x13')](_0x1a3b0b)){throw new Error(_0x430a('0x79'));}_0x15f4c3=_0x1a3b0b;return db[_0x6ca475+_0x430a('0x69')][_0x430a('0x68')]({'where':{'id':_0x2a1a06['body'][_0x430a('0x6a')]},'include':[{'model':db[_0x6ca475+'Interaction'],'as':_0x430a('0x6b')},{'model':db[_0x6ca475+_0x2ed666],'as':'Account'}]});})[_0x430a('0x19')](function(_0x499d81){if(_[_0x430a('0x13')](_0x499d81)){throw new Error(_0x6ca475+_0x430a('0x6c'));}_0x9c8163=_0x499d81;return _0x499d81[_0x430a('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x430a('0x19')](function(){var _0xd23444={'uniqueid':_0x4c73b7+'.'+_0x9c8163['id']+'.'+_0x9c8163['Interaction']['id'],'FromUserId':_0x2a1a06[_0x430a('0x33')]['id'],'type':_0x430a('0x3e'),'ToUserId':_0x15f4c3['id']};_0xd23444[_0x6ca475+_0x430a('0x7a')]=_0x9c8163['id'];_0xd23444[_0x6ca475+_0x430a('0x6f')]=_0x9c8163['Interaction']['id'];_0xd23444[_0x430a('0x70')+_0x6ca475+_0x2ed666+'Id']=_0x9c8163['Account']['id'];return db[_0x6ca475+_0x430a('0x72')]['create'](_0xd23444);})[_0x430a('0x19')](function(){return respondWithRpcPromise(_0x430a('0x74'),{'channel':_0x4c73b7,'interaction':_0x9c8163[_0x430a('0x6b')],'message':_0x9c8163,'account':_0x9c8163[_0x430a('0x66')],'applications':[{'id':0x0,'priority':0x1,'app':_0x430a('0x3e'),'appdata':_0x15f4c3[_0x430a('0x10')]+','+(_0x9c8163['Account'][_0x430a('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x430a('0x19')](respondWithResult(_0xdbb39b,null))['catch'](handleError(_0xdbb39b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 45442b6..cfc06f3 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 _0x158c=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/run','post','create','put','/:id','update'];(function(_0x5b47d9,_0x5a274d){var _0x4f3771=function(_0x12d586){while(--_0x12d586){_0x5b47d9['push'](_0x5b47d9['shift']());}};_0x4f3771(++_0x5a274d);}(_0x158c,0x1a0));var _0xc158=function(_0x387804,_0x161350){_0x387804=_0x387804-0x0;var _0x49a5a5=_0x158c[_0x387804];return _0x49a5a5;};'use strict';var multer=require('multer');var util=require(_0xc158('0x0'));var path=require(_0xc158('0x1'));var timeout=require(_0xc158('0x2'));var express=require('express');var router=express[_0xc158('0x3')]();var fs_extra=require(_0xc158('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc158('0x5'));var config=require(_0xc158('0x6'));var controller=require('./schedule.controller');router[_0xc158('0x7')]('/',auth[_0xc158('0x8')](),controller['index']);router[_0xc158('0x7')]('/:id',auth[_0xc158('0x8')](),controller[_0xc158('0x9')]);router['get'](_0xc158('0xa'),auth[_0xc158('0x8')](),controller['run']);router[_0xc158('0xb')]('/',auth[_0xc158('0x8')](),controller[_0xc158('0xc')]);router[_0xc158('0xd')](_0xc158('0xe'),auth['isAuthenticated'](),controller[_0xc158('0xf')]);router['delete'](_0xc158('0xe'),auth[_0xc158('0x8')](),controller[_0xc158('0x10')]);module[_0xc158('0x11')]=router; \ No newline at end of file +var _0xc2bf=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/run','run','post','create','put','update','delete','exports','connect-timeout'];(function(_0x3b7cc9,_0x18cd9b){var _0x5751ea=function(_0x141c47){while(--_0x141c47){_0x3b7cc9['push'](_0x3b7cc9['shift']());}};_0x5751ea(++_0x18cd9b);}(_0xc2bf,0x98));var _0xfc2b=function(_0x4bfc51,_0x55c417){_0x4bfc51=_0x4bfc51-0x0;var _0x3246b2=_0xc2bf[_0x4bfc51];return _0x3246b2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfc2b('0x0'));var express=require(_0xfc2b('0x1'));var router=express['Router']();var fs_extra=require(_0xfc2b('0x2'));var auth=require(_0xfc2b('0x3'));var interaction=require(_0xfc2b('0x4'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xfc2b('0x5')]('/',auth['isAuthenticated'](),controller[_0xfc2b('0x6')]);router[_0xfc2b('0x5')](_0xfc2b('0x7'),auth[_0xfc2b('0x8')](),controller['show']);router[_0xfc2b('0x5')](_0xfc2b('0x9'),auth['isAuthenticated'](),controller[_0xfc2b('0xa')]);router[_0xfc2b('0xb')]('/',auth['isAuthenticated'](),controller[_0xfc2b('0xc')]);router[_0xfc2b('0xd')](_0xfc2b('0x7'),auth[_0xfc2b('0x8')](),controller[_0xfc2b('0xe')]);router[_0xfc2b('0xf')](_0xfc2b('0x7'),auth[_0xfc2b('0x8')](),controller['destroy']);module[_0xfc2b('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 999cb04..583c257 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 _0xb51d=['custom','default','TEXT','exports','STRING','BOOLEAN','DATE','INTEGER','years','days','hours','minutes','ENUM','csv','xlsx'];(function(_0x543628,_0x17a06){var _0x1475f9=function(_0x4c399b){while(--_0x4c399b){_0x543628['push'](_0x543628['shift']());}};_0x1475f9(++_0x17a06);}(_0xb51d,0x8a));var _0xdb51=function(_0x31ae47,_0x2d1ee9){_0x31ae47=_0x31ae47-0x0;var _0x128583=_0xb51d[_0x31ae47];return _0x128583;};'use strict';var Sequelize=require('sequelize');module[_0xdb51('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xdb51('0x1')]},'active':{'type':Sequelize[_0xdb51('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdb51('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xdb51('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xdb51('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdb51('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xdb51('0x5'),'quarters','months','weeks',_0xdb51('0x6'),_0xdb51('0x7'),_0xdb51('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xdb51('0x9')](_0xdb51('0xa'),'pdf',_0xdb51('0xb')),'allowNull':![],'defaultValue':_0xdb51('0xa')},'type':{'type':Sequelize[_0xdb51('0x9')](_0xdb51('0xc'),_0xdb51('0xd')),'allowNull':![],'defaultValue':_0xdb51('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xdb51('0x1')]},'cc':{'type':Sequelize[_0xdb51('0xe')]},'bcc':{'type':Sequelize[_0xdb51('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xdb51('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa10e=['custom','default','TEXT','exports','BOOLEAN','STRING','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','xlsx'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0xa10e,0xa5));var _0xea10=function(_0x3d54b6,_0xae3e1d){_0x3d54b6=_0x3d54b6-0x0;var _0x38c6c0=_0xa10e[_0x3d54b6];return _0x38c6c0;};'use strict';var Sequelize=require('sequelize');module[_0xea10('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xea10('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xea10('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xea10('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xea10('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xea10('0x5')](_0xea10('0x6'),_0xea10('0x7'),_0xea10('0x8'),_0xea10('0x9'),_0xea10('0xa'),_0xea10('0xb'),_0xea10('0xc')),'allowNull':![],'defaultValue':_0xea10('0xa')},'output':{'type':Sequelize['ENUM'](_0xea10('0xd'),'pdf',_0xea10('0xe')),'allowNull':![],'defaultValue':_0xea10('0xd')},'type':{'type':Sequelize[_0xea10('0x5')](_0xea10('0xf'),_0xea10('0x10')),'allowNull':![],'defaultValue':_0xea10('0xf')},'sendMail':{'type':Sequelize[_0xea10('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xea10('0x2')]},'cc':{'type':Sequelize[_0xea10('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xea10('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8d4d419..2d6f409 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 _0x2b1d=['json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','Scheduler','UserProfileResource','error','name','index','Schedule','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x36c376,_0x4b488){var _0x535538=function(_0x165d7b){while(--_0x165d7b){_0x36c376['push'](_0x36c376['shift']());}};_0x535538(++_0x4b488);}(_0x2b1d,0x150));var _0xd2b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b1d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd2b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2b1('0x1'));var jsonpatch=require(_0xd2b1('0x2'));var rp=require(_0xd2b1('0x3'));var moment=require(_0xd2b1('0x4'));var BPromise=require(_0xd2b1('0x5'));var Mustache=require(_0xd2b1('0x6'));var util=require(_0xd2b1('0x7'));var path=require(_0xd2b1('0x8'));var sox=require(_0xd2b1('0x9'));var csv=require(_0xd2b1('0xa'));var ejs=require(_0xd2b1('0xb'));var fs=require('fs');var fs_extra=require(_0xd2b1('0xc'));var _=require(_0xd2b1('0xd'));var squel=require(_0xd2b1('0xe'));var crypto=require('crypto');var jsforce=require(_0xd2b1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd2b1('0x10'));var Papa=require(_0xd2b1('0x11'));var Redis=require(_0xd2b1('0x12'));var authService=require(_0xd2b1('0x13'));var qs=require(_0xd2b1('0x14'));var as=require(_0xd2b1('0x15'));var hardwareService=require(_0xd2b1('0x16'));var logger=require(_0xd2b1('0x17'))(_0xd2b1('0x18'));var utils=require(_0xd2b1('0x19'));var config=require(_0xd2b1('0x1a'));var licenseUtil=require(_0xd2b1('0x1b'));var db=require(_0xd2b1('0x1c'))['db'];function respondWithStatusCode(_0x194958,_0x4d5668){_0x4d5668=_0x4d5668||0xcc;return function(_0x1011de){if(_0x1011de){return _0x194958[_0xd2b1('0x1d')](_0x4d5668);}return _0x194958[_0xd2b1('0x1e')](_0x4d5668)[_0xd2b1('0x1f')]();};}function respondWithResult(_0x46c33f,_0x44fc86){_0x44fc86=_0x44fc86||0xc8;return function(_0x452cb0){if(_0x452cb0){return _0x46c33f[_0xd2b1('0x1e')](_0x44fc86)[_0xd2b1('0x20')](_0x452cb0);}};}function respondWithFilteredResult(_0x5ed034,_0x36b452){return function(_0x1300d4){if(_0x1300d4){var _0x560268=typeof _0x36b452['offset']===_0xd2b1('0x21')&&typeof _0x36b452[_0xd2b1('0x22')]===_0xd2b1('0x21');var _0x46e533=_0x1300d4['count'];var _0x4fbebe=_0x560268?0x0:_0x36b452[_0xd2b1('0x23')];var _0x1007e6=_0x560268?_0x1300d4[_0xd2b1('0x24')]:_0x36b452[_0xd2b1('0x23')]+_0x36b452['limit'];var _0x233fad;if(_0x1007e6>=_0x46e533){_0x1007e6=_0x46e533;_0x233fad=0xc8;}else{_0x233fad=0xce;}_0x5ed034['status'](_0x233fad);return _0x5ed034[_0xd2b1('0x25')](_0xd2b1('0x26'),_0x4fbebe+'-'+_0x1007e6+'/'+_0x46e533)[_0xd2b1('0x20')](_0x1300d4);}return null;};}function patchUpdates(_0x1ccf5e){return function(_0x1e6f27){try{jsonpatch[_0xd2b1('0x27')](_0x1e6f27,_0x1ccf5e,!![]);}catch(_0x330fb2){return BPromise[_0xd2b1('0x28')](_0x330fb2);}return _0x1e6f27[_0xd2b1('0x29')]();};}function saveUpdates(_0x48fa34,_0x273152){return function(_0x515b05){if(_0x515b05){return _0x515b05['update'](_0x48fa34)[_0xd2b1('0x2a')](function(_0x4aff17){return _0x4aff17;});}return null;};}function removeEntity(_0x31718d,_0x1b4e3e){return function(_0x3184af){if(_0x3184af){return _0x3184af[_0xd2b1('0x2b')]()['then'](function(){var _0x53f3c8=_0x3184af['get']({'plain':!![]});var _0x37d340=_0xd2b1('0x2c');return db[_0xd2b1('0x2d')][_0xd2b1('0x2b')]({'where':{'type':_0x37d340,'resourceId':_0x53f3c8['id']}})['then'](function(){return _0x3184af;});})[_0xd2b1('0x2a')](function(){_0x31718d[_0xd2b1('0x1e')](0xcc)[_0xd2b1('0x1f')]();});}};}function handleEntityNotFound(_0x1ac0ec,_0x6b7386){return function(_0xc8e2c0){if(!_0xc8e2c0){_0x1ac0ec[_0xd2b1('0x1d')](0x194);}return _0xc8e2c0;};}function handleError(_0x24b4fb,_0x54d5e1){_0x54d5e1=_0x54d5e1||0x1f4;return function(_0x5c9581){logger[_0xd2b1('0x2e')](_0x5c9581['stack']);if(_0x5c9581[_0xd2b1('0x2f')]){delete _0x5c9581[_0xd2b1('0x2f')];}_0x24b4fb[_0xd2b1('0x1e')](_0x54d5e1)['send'](_0x5c9581);};}exports[_0xd2b1('0x30')]=function(_0x3b8127,_0x59f7ab){var _0x12c26a={},_0x364110={},_0x6ff276={'count':0x0,'rows':[]};var _0x1ee976=_['map'](db[_0xd2b1('0x31')][_0xd2b1('0x32')],function(_0x5b8a87){return{'name':_0x5b8a87['fieldName'],'type':_0x5b8a87[_0xd2b1('0x33')][_0xd2b1('0x34')]};});_0x364110[_0xd2b1('0x35')]=_[_0xd2b1('0x36')](_0x1ee976,'name');_0x364110[_0xd2b1('0x37')]=_[_0xd2b1('0x38')](_0x3b8127[_0xd2b1('0x37')]);_0x364110['filters']=_[_0xd2b1('0x39')](_0x364110[_0xd2b1('0x35')],_0x364110['query']);_0x12c26a[_0xd2b1('0x3a')]=_[_0xd2b1('0x39')](_0x364110[_0xd2b1('0x35')],qs[_0xd2b1('0x3b')](_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x3b')]));_0x12c26a[_0xd2b1('0x3a')]=_0x12c26a[_0xd2b1('0x3a')][_0xd2b1('0x3c')]?_0x12c26a[_0xd2b1('0x3a')]:_0x364110['model'];if(!_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x3d')](_0xd2b1('0x3e'))){_0x12c26a['limit']=qs[_0xd2b1('0x22')](_0x3b8127[_0xd2b1('0x37')]['limit']);_0x12c26a[_0xd2b1('0x23')]=qs[_0xd2b1('0x23')](_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x23')]);}_0x12c26a[_0xd2b1('0x3f')]=qs[_0xd2b1('0x40')](_0x3b8127['query'][_0xd2b1('0x40')]);_0x12c26a[_0xd2b1('0x41')]=qs[_0xd2b1('0x42')](_[_0xd2b1('0x43')](_0x3b8127['query'],_0x364110['filters']),_0x1ee976);if(_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x44')]){_0x12c26a[_0xd2b1('0x41')]=_[_0xd2b1('0x45')](_0x12c26a[_0xd2b1('0x41')],{'$or':_[_0xd2b1('0x36')](_0x1ee976,function(_0x2f6f36){if(_0x2f6f36[_0xd2b1('0x33')]!==_0xd2b1('0x46')){var _0x14ea3c={};_0x14ea3c[_0x2f6f36['name']]={'$like':'%'+_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x44')]+'%'};return _0x14ea3c;}})});}_0x12c26a=_[_0xd2b1('0x45')]({},_0x12c26a,_0x3b8127[_0xd2b1('0x47')]);var _0x293bf2={'where':_0x12c26a[_0xd2b1('0x41')]};return db[_0xd2b1('0x31')][_0xd2b1('0x24')](_0x293bf2)[_0xd2b1('0x2a')](function(_0x403c43){_0x6ff276[_0xd2b1('0x24')]=_0x403c43;if(_0x3b8127[_0xd2b1('0x37')][_0xd2b1('0x48')]){_0x12c26a[_0xd2b1('0x49')]=[{'all':!![]}];}return db[_0xd2b1('0x31')][_0xd2b1('0x4a')](_0x12c26a);})[_0xd2b1('0x2a')](function(_0x27a935){_0x6ff276[_0xd2b1('0x4b')]=_0x27a935;return _0x6ff276;})['then'](respondWithFilteredResult(_0x59f7ab,_0x12c26a))['catch'](handleError(_0x59f7ab,null));};exports[_0xd2b1('0x4c')]=function(_0x4598e1,_0x5fc268){var _0x3a2983={'raw':![],'where':{'id':_0x4598e1['params']['id']}},_0x3a8385={};_0x3a8385[_0xd2b1('0x35')]=_[_0xd2b1('0x38')](db['Schedule'][_0xd2b1('0x32')]);_0x3a8385[_0xd2b1('0x37')]=_['keys'](_0x4598e1[_0xd2b1('0x37')]);_0x3a8385['filters']=_['intersection'](_0x3a8385[_0xd2b1('0x35')],_0x3a8385[_0xd2b1('0x37')]);_0x3a2983['attributes']=_[_0xd2b1('0x39')](_0x3a8385['model'],qs[_0xd2b1('0x3b')](_0x4598e1[_0xd2b1('0x37')][_0xd2b1('0x3b')]));_0x3a2983['attributes']=_0x3a2983[_0xd2b1('0x3a')][_0xd2b1('0x3c')]?_0x3a2983[_0xd2b1('0x3a')]:_0x3a8385['model'];if(_0x4598e1[_0xd2b1('0x37')][_0xd2b1('0x48')]){_0x3a2983[_0xd2b1('0x49')]=[{'all':!![]}];}_0x3a2983=_[_0xd2b1('0x45')]({},_0x3a2983,_0x4598e1[_0xd2b1('0x47')]);return db['Schedule'][_0xd2b1('0x4d')](_0x3a2983)[_0xd2b1('0x2a')](handleEntityNotFound(_0x5fc268,null))['then'](respondWithResult(_0x5fc268,null))[_0xd2b1('0x4e')](handleError(_0x5fc268,null));};exports[_0xd2b1('0x4f')]=function(_0x206f85,_0x20cea7){return db[_0xd2b1('0x31')]['create'](_0x206f85['body'],{})[_0xd2b1('0x2a')](function(_0x58e122){var _0x4487cf=_0x206f85[_0xd2b1('0x50')][_0xd2b1('0x51')]({'plain':!![]});if(!_0x4487cf)throw new Error(_0xd2b1('0x52'));if(_0x4487cf[_0xd2b1('0x53')]===_0xd2b1('0x50')){var _0x375ca4=_0x58e122['get']({'plain':!![]});var _0x277c0b=_0xd2b1('0x2c');return db[_0xd2b1('0x54')][_0xd2b1('0x4d')]({'where':{'name':_0x277c0b,'userProfileId':_0x4487cf['userProfileId']},'raw':!![]})[_0xd2b1('0x2a')](function(_0x29fc37){if(_0x29fc37&&_0x29fc37[_0xd2b1('0x55')]===0x0){return db[_0xd2b1('0x2d')][_0xd2b1('0x4f')]({'name':_0x375ca4['name'],'resourceId':_0x375ca4['id'],'type':_0x29fc37[_0xd2b1('0x2f')],'sectionId':_0x29fc37['id']},{})[_0xd2b1('0x2a')](function(){return _0x58e122;});}else{return _0x58e122;}})[_0xd2b1('0x4e')](function(_0x1710cb){logger['error'](_0xd2b1('0x56'),_0x1710cb);throw _0x1710cb;});}return _0x58e122;})['then'](respondWithResult(_0x20cea7,0xc9))['catch'](handleError(_0x20cea7,null));};exports[_0xd2b1('0x57')]=function(_0x524ac8,_0x1c1601){if(_0x524ac8[_0xd2b1('0x58')]['id']){delete _0x524ac8['body']['id'];}return db[_0xd2b1('0x31')][_0xd2b1('0x4d')]({'where':{'id':_0x524ac8['params']['id']}})[_0xd2b1('0x2a')](handleEntityNotFound(_0x1c1601,null))['then'](saveUpdates(_0x524ac8['body'],null))[_0xd2b1('0x2a')](respondWithResult(_0x1c1601,null))[_0xd2b1('0x4e')](handleError(_0x1c1601,null));};exports['destroy']=function(_0x486115,_0x36c0a6){return db[_0xd2b1('0x31')]['find']({'where':{'id':_0x486115['params']['id']}})[_0xd2b1('0x2a')](handleEntityNotFound(_0x36c0a6,null))[_0xd2b1('0x2a')](removeEntity(_0x36c0a6,null))[_0xd2b1('0x4e')](handleError(_0x36c0a6,null));};exports[_0xd2b1('0x59')]=function(_0x4ffaf0,_0x1f7eef,_0x3db8f5){var _0x3c47ee=require(_0xd2b1('0x5a'));return db[_0xd2b1('0x31')][_0xd2b1('0x4d')]({'where':{'id':_0x4ffaf0[_0xd2b1('0x5b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1f7eef,null))[_0xd2b1('0x2a')](function(){_0x3c47ee[_0xd2b1('0x59')](_0x4ffaf0[_0xd2b1('0x5b')]['id']);})[_0xd2b1('0x2a')](respondWithStatusCode(_0x1f7eef,null))[_0xd2b1('0x4e')](handleError(_0x1f7eef,null));}; \ No newline at end of file +var _0x67e3=['moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','Scheduler','UserProfileResource','then','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','eml-format','rimraf','zip-dir','request-promise'];(function(_0x23b6eb,_0x44b2af){var _0x5a0563=function(_0x469353){while(--_0x469353){_0x23b6eb['push'](_0x23b6eb['shift']());}};_0x5a0563(++_0x44b2af);}(_0x67e3,0x154));var _0x367e=function(_0x2ec995,_0x2f611a){_0x2ec995=_0x2ec995-0x0;var _0x2f9040=_0x67e3[_0x2ec995];return _0x2f9040;};'use strict';var emlformat=require(_0x367e('0x0'));var rimraf=require(_0x367e('0x1'));var zipdir=require(_0x367e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x367e('0x3'));var moment=require(_0x367e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x367e('0x5'));var util=require(_0x367e('0x6'));var path=require(_0x367e('0x7'));var sox=require('sox');var csv=require(_0x367e('0x8'));var ejs=require(_0x367e('0x9'));var fs=require('fs');var fs_extra=require(_0x367e('0xa'));var _=require(_0x367e('0xb'));var squel=require(_0x367e('0xc'));var crypto=require(_0x367e('0xd'));var jsforce=require(_0x367e('0xe'));var deskjs=require(_0x367e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x367e('0x10'));var Papa=require(_0x367e('0x11'));var Redis=require(_0x367e('0x12'));var authService=require(_0x367e('0x13'));var qs=require(_0x367e('0x14'));var as=require(_0x367e('0x15'));var hardwareService=require(_0x367e('0x16'));var logger=require(_0x367e('0x17'))('api');var utils=require(_0x367e('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x367e('0x19'))['db'];function respondWithStatusCode(_0x40b1db,_0x53a901){_0x53a901=_0x53a901||0xcc;return function(_0x39c985){if(_0x39c985){return _0x40b1db[_0x367e('0x1a')](_0x53a901);}return _0x40b1db[_0x367e('0x1b')](_0x53a901)[_0x367e('0x1c')]();};}function respondWithResult(_0xb6c962,_0x3bff68){_0x3bff68=_0x3bff68||0xc8;return function(_0x26198d){if(_0x26198d){return _0xb6c962[_0x367e('0x1b')](_0x3bff68)[_0x367e('0x1d')](_0x26198d);}};}function respondWithFilteredResult(_0xe38a9e,_0x380d79){return function(_0x4dd562){if(_0x4dd562){var _0x452453=typeof _0x380d79['offset']===_0x367e('0x1e')&&typeof _0x380d79[_0x367e('0x1f')]===_0x367e('0x1e');var _0x17d63d=_0x4dd562[_0x367e('0x20')];var _0x840f6d=_0x452453?0x0:_0x380d79['offset'];var _0xb2e00c=_0x452453?_0x4dd562[_0x367e('0x20')]:_0x380d79[_0x367e('0x21')]+_0x380d79[_0x367e('0x1f')];var _0x3bae7c;if(_0xb2e00c>=_0x17d63d){_0xb2e00c=_0x17d63d;_0x3bae7c=0xc8;}else{_0x3bae7c=0xce;}_0xe38a9e[_0x367e('0x1b')](_0x3bae7c);return _0xe38a9e[_0x367e('0x22')]('Content-Range',_0x840f6d+'-'+_0xb2e00c+'/'+_0x17d63d)[_0x367e('0x1d')](_0x4dd562);}return null;};}function patchUpdates(_0x337fc1){return function(_0x13ad98){try{jsonpatch[_0x367e('0x23')](_0x13ad98,_0x337fc1,!![]);}catch(_0x560fb8){return BPromise[_0x367e('0x24')](_0x560fb8);}return _0x13ad98[_0x367e('0x25')]();};}function saveUpdates(_0x3ad743,_0x40c048){return function(_0x1426ae){if(_0x1426ae){return _0x1426ae['update'](_0x3ad743)['then'](function(_0x12006b){return _0x12006b;});}return null;};}function removeEntity(_0x213b59,_0x1f1e7d){return function(_0x20a911){if(_0x20a911){return _0x20a911[_0x367e('0x26')]()['then'](function(){var _0x3f4cc3=_0x20a911[_0x367e('0x27')]({'plain':!![]});var _0x18b1fd=_0x367e('0x28');return db[_0x367e('0x29')][_0x367e('0x26')]({'where':{'type':_0x18b1fd,'resourceId':_0x3f4cc3['id']}})[_0x367e('0x2a')](function(){return _0x20a911;});})['then'](function(){_0x213b59[_0x367e('0x1b')](0xcc)[_0x367e('0x1c')]();});}};}function handleEntityNotFound(_0x23c5f5,_0xb27528){return function(_0x484a4e){if(!_0x484a4e){_0x23c5f5['sendStatus'](0x194);}return _0x484a4e;};}function handleError(_0x558edd,_0x35a0f1){_0x35a0f1=_0x35a0f1||0x1f4;return function(_0x43e8bc){logger[_0x367e('0x2b')](_0x43e8bc[_0x367e('0x2c')]);if(_0x43e8bc[_0x367e('0x2d')]){delete _0x43e8bc[_0x367e('0x2d')];}_0x558edd[_0x367e('0x1b')](_0x35a0f1)[_0x367e('0x2e')](_0x43e8bc);};}exports[_0x367e('0x2f')]=function(_0x2e27cc,_0x21ec70){var _0xea4661={},_0x181a76={},_0x4dd228={'count':0x0,'rows':[]};var _0x1fa35a=_['map'](db['Schedule'][_0x367e('0x30')],function(_0x309f74){return{'name':_0x309f74[_0x367e('0x31')],'type':_0x309f74['type']['key']};});_0x181a76[_0x367e('0x32')]=_[_0x367e('0x33')](_0x1fa35a,_0x367e('0x2d'));_0x181a76[_0x367e('0x34')]=_[_0x367e('0x35')](_0x2e27cc[_0x367e('0x34')]);_0x181a76['filters']=_[_0x367e('0x36')](_0x181a76['model'],_0x181a76[_0x367e('0x34')]);_0xea4661[_0x367e('0x37')]=_[_0x367e('0x36')](_0x181a76[_0x367e('0x32')],qs['fields'](_0x2e27cc[_0x367e('0x34')][_0x367e('0x38')]));_0xea4661[_0x367e('0x37')]=_0xea4661[_0x367e('0x37')][_0x367e('0x39')]?_0xea4661[_0x367e('0x37')]:_0x181a76[_0x367e('0x32')];if(!_0x2e27cc['query'][_0x367e('0x3a')](_0x367e('0x3b'))){_0xea4661['limit']=qs[_0x367e('0x1f')](_0x2e27cc[_0x367e('0x34')][_0x367e('0x1f')]);_0xea4661[_0x367e('0x21')]=qs[_0x367e('0x21')](_0x2e27cc[_0x367e('0x34')][_0x367e('0x21')]);}_0xea4661[_0x367e('0x3c')]=qs[_0x367e('0x3d')](_0x2e27cc[_0x367e('0x34')][_0x367e('0x3d')]);_0xea4661['where']=qs[_0x367e('0x3e')](_[_0x367e('0x3f')](_0x2e27cc[_0x367e('0x34')],_0x181a76[_0x367e('0x3e')]),_0x1fa35a);if(_0x2e27cc[_0x367e('0x34')][_0x367e('0x40')]){_0xea4661['where']=_[_0x367e('0x41')](_0xea4661[_0x367e('0x42')],{'$or':_['map'](_0x1fa35a,function(_0x32ea2e){if(_0x32ea2e[_0x367e('0x43')]!==_0x367e('0x44')){var _0x3fb04c={};_0x3fb04c[_0x32ea2e['name']]={'$like':'%'+_0x2e27cc[_0x367e('0x34')][_0x367e('0x40')]+'%'};return _0x3fb04c;}})});}_0xea4661=_[_0x367e('0x41')]({},_0xea4661,_0x2e27cc[_0x367e('0x45')]);var _0x106c6e={'where':_0xea4661['where']};return db[_0x367e('0x46')][_0x367e('0x20')](_0x106c6e)[_0x367e('0x2a')](function(_0x6d29a){_0x4dd228[_0x367e('0x20')]=_0x6d29a;if(_0x2e27cc[_0x367e('0x34')][_0x367e('0x47')]){_0xea4661[_0x367e('0x48')]=[{'all':!![]}];}return db[_0x367e('0x46')][_0x367e('0x49')](_0xea4661);})[_0x367e('0x2a')](function(_0x513bac){_0x4dd228[_0x367e('0x4a')]=_0x513bac;return _0x4dd228;})['then'](respondWithFilteredResult(_0x21ec70,_0xea4661))[_0x367e('0x4b')](handleError(_0x21ec70,null));};exports[_0x367e('0x4c')]=function(_0x1e5160,_0x2ff91a){var _0x568e92={'raw':![],'where':{'id':_0x1e5160[_0x367e('0x4d')]['id']}},_0x5316d4={};_0x5316d4[_0x367e('0x32')]=_['keys'](db[_0x367e('0x46')]['rawAttributes']);_0x5316d4[_0x367e('0x34')]=_['keys'](_0x1e5160['query']);_0x5316d4[_0x367e('0x3e')]=_[_0x367e('0x36')](_0x5316d4[_0x367e('0x32')],_0x5316d4[_0x367e('0x34')]);_0x568e92[_0x367e('0x37')]=_[_0x367e('0x36')](_0x5316d4[_0x367e('0x32')],qs[_0x367e('0x38')](_0x1e5160['query']['fields']));_0x568e92[_0x367e('0x37')]=_0x568e92[_0x367e('0x37')][_0x367e('0x39')]?_0x568e92['attributes']:_0x5316d4[_0x367e('0x32')];if(_0x1e5160[_0x367e('0x34')][_0x367e('0x47')]){_0x568e92[_0x367e('0x48')]=[{'all':!![]}];}_0x568e92=_['merge']({},_0x568e92,_0x1e5160[_0x367e('0x45')]);return db['Schedule']['find'](_0x568e92)[_0x367e('0x2a')](handleEntityNotFound(_0x2ff91a,null))[_0x367e('0x2a')](respondWithResult(_0x2ff91a,null))[_0x367e('0x4b')](handleError(_0x2ff91a,null));};exports[_0x367e('0x4e')]=function(_0x29fd30,_0x620122){return db[_0x367e('0x46')]['create'](_0x29fd30['body'],{})[_0x367e('0x2a')](function(_0x1d68b5){var _0x1567f8=_0x29fd30[_0x367e('0x4f')][_0x367e('0x27')]({'plain':!![]});if(!_0x1567f8)throw new Error(_0x367e('0x50'));if(_0x1567f8['role']===_0x367e('0x4f')){var _0x1337c2=_0x1d68b5[_0x367e('0x27')]({'plain':!![]});var _0x5f4711=_0x367e('0x28');return db['UserProfileSection'][_0x367e('0x51')]({'where':{'name':_0x5f4711,'userProfileId':_0x1567f8['userProfileId']},'raw':!![]})['then'](function(_0x22811c){if(_0x22811c&&_0x22811c['autoAssociation']===0x0){return db['UserProfileResource'][_0x367e('0x4e')]({'name':_0x1337c2[_0x367e('0x2d')],'resourceId':_0x1337c2['id'],'type':_0x22811c['name'],'sectionId':_0x22811c['id']},{})[_0x367e('0x2a')](function(){return _0x1d68b5;});}else{return _0x1d68b5;}})[_0x367e('0x4b')](function(_0x14f90f){logger[_0x367e('0x2b')](_0x367e('0x52'),_0x14f90f);throw _0x14f90f;});}return _0x1d68b5;})[_0x367e('0x2a')](respondWithResult(_0x620122,0xc9))[_0x367e('0x4b')](handleError(_0x620122,null));};exports[_0x367e('0x53')]=function(_0x4c4624,_0x21a962){if(_0x4c4624[_0x367e('0x54')]['id']){delete _0x4c4624[_0x367e('0x54')]['id'];}return db['Schedule'][_0x367e('0x51')]({'where':{'id':_0x4c4624[_0x367e('0x4d')]['id']}})[_0x367e('0x2a')](handleEntityNotFound(_0x21a962,null))[_0x367e('0x2a')](saveUpdates(_0x4c4624[_0x367e('0x54')],null))['then'](respondWithResult(_0x21a962,null))['catch'](handleError(_0x21a962,null));};exports['destroy']=function(_0x39ba1d,_0x31d331){return db[_0x367e('0x46')]['find']({'where':{'id':_0x39ba1d[_0x367e('0x4d')]['id']}})[_0x367e('0x2a')](handleEntityNotFound(_0x31d331,null))['then'](removeEntity(_0x31d331,null))[_0x367e('0x4b')](handleError(_0x31d331,null));};exports[_0x367e('0x55')]=function(_0x576a97,_0x4ae21c,_0x260992){var _0x8a0f18=require('../../config/schedule');return db[_0x367e('0x46')][_0x367e('0x51')]({'where':{'id':_0x576a97[_0x367e('0x4d')]['id']},'raw':!![]})[_0x367e('0x2a')](handleEntityNotFound(_0x4ae21c,null))[_0x367e('0x2a')](function(){_0x8a0f18[_0x367e('0x55')](_0x576a97['params']['id']);})['then'](respondWithStatusCode(_0x4ae21c,null))[_0x367e('0x4b')](handleError(_0x4ae21c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 934db54..7477f6e 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 _0x9d0c=['moment','bluebird','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api'];(function(_0x5346e2,_0x539ee8){var _0x328def=function(_0x3e93c0){while(--_0x3e93c0){_0x5346e2['push'](_0x5346e2['shift']());}};_0x328def(++_0x539ee8);}(_0x9d0c,0xc8));var _0xc9d0=function(_0x2ea087,_0x17f324){_0x2ea087=_0x2ea087-0x0;var _0x23ebac=_0x9d0c[_0x2ea087];return _0x23ebac;};'use strict';var _=require(_0xc9d0('0x0'));var util=require(_0xc9d0('0x1'));var logger=require(_0xc9d0('0x2'))(_0xc9d0('0x3'));var moment=require(_0xc9d0('0x4'));var BPromise=require(_0xc9d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc9d0('0x6'));var config=require(_0xc9d0('0x7'));var attributes=require(_0xc9d0('0x8'));module[_0xc9d0('0x9')]=function(_0x5d1245,_0x1c20e3){return _0x5d1245[_0xc9d0('0xa')](_0xc9d0('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e93=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','Schedule','tools_schedules','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e93,0x147));var _0x33e9=function(_0x45a5a3,_0x1cb57b){_0x45a5a3=_0x45a5a3-0x0;var _0x23a823=_0x3e93[_0x45a5a3];return _0x23a823;};'use strict';var _=require('lodash');var util=require(_0x33e9('0x0'));var logger=require(_0x33e9('0x1'))(_0x33e9('0x2'));var moment=require(_0x33e9('0x3'));var BPromise=require(_0x33e9('0x4'));var rp=require(_0x33e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33e9('0x6'));var config=require(_0x33e9('0x7'));var attributes=require('./schedule.attributes');module[_0x33e9('0x8')]=function(_0x17bc57,_0x47b03e){return _0x17bc57['define'](_0x33e9('0x9'),attributes,{'tableName':_0x33e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1c7ae72..52a691f 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 _0x7288=['http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7288,0x9f));var _0x8728=function(_0x466e95,_0x4d3f49){_0x466e95=_0x466e95-0x0;var _0x4742fc=_0x7288[_0x466e95];return _0x4742fc;};'use strict';var _=require(_0x8728('0x0'));var util=require('util');var moment=require(_0x8728('0x1'));var BPromise=require(_0x8728('0x2'));var rs=require(_0x8728('0x3'));var fs=require('fs');var Redis=require(_0x8728('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8728('0x5'));var config=require(_0x8728('0x6'));var jayson=require(_0x8728('0x7'));var client=jayson[_0x8728('0x8')][_0x8728('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c4df0,_0x316d67,_0x2dc0c5){return new BPromise(function(_0x2a4da7,_0x256b89){return client[_0x8728('0xa')](_0x2c4df0,_0x2dc0c5)['then'](function(_0x4a2956){logger[_0x8728('0xb')](_0x8728('0xc'),_0x316d67,_0x8728('0xd'));logger[_0x8728('0xe')](_0x8728('0xf'),_0x316d67,_0x8728('0xd'),JSON['stringify'](_0x4a2956));if(_0x4a2956['error']){if(_0x4a2956[_0x8728('0x10')][_0x8728('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x316d67,_0x4a2956[_0x8728('0x10')][_0x8728('0x12')]);return _0x256b89(_0x4a2956[_0x8728('0x10')]['message']);}logger[_0x8728('0x10')](_0x8728('0xc'),_0x316d67,_0x4a2956[_0x8728('0x10')][_0x8728('0x12')]);return _0x2a4da7(_0x4a2956[_0x8728('0x10')][_0x8728('0x12')]);}else{logger[_0x8728('0xb')]('Schedule,\x20%s,\x20%s',_0x316d67,_0x8728('0xd'));_0x2a4da7(_0x4a2956[_0x8728('0x13')]['message']);}})[_0x8728('0x14')](function(_0xf4a0dd){logger[_0x8728('0x10')](_0x8728('0xc'),_0x316d67,_0xf4a0dd);_0x256b89(_0xf4a0dd);});});} \ No newline at end of file +var _0x81ef=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2514b1,_0x2ed6b3){var _0x53bd0f=function(_0x3dd538){while(--_0x3dd538){_0x2514b1['push'](_0x2514b1['shift']());}};_0x53bd0f(++_0x2ed6b3);}(_0x81ef,0x99));var _0xf81e=function(_0x39d3c0,_0x58cb53){_0x39d3c0=_0x39d3c0-0x0;var _0x12fef1=_0x81ef[_0x39d3c0];return _0x12fef1;};'use strict';var _=require(_0xf81e('0x0'));var util=require('util');var moment=require(_0xf81e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf81e('0x2'));var fs=require('fs');var Redis=require(_0xf81e('0x3'));var db=require(_0xf81e('0x4'))['db'];var utils=require(_0xf81e('0x5'));var logger=require('../../config/logger')(_0xf81e('0x6'));var config=require(_0xf81e('0x7'));var jayson=require(_0xf81e('0x8'));var client=jayson[_0xf81e('0x9')][_0xf81e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34fc85,_0x59dc68,_0x2fe0d0){return new BPromise(function(_0xded889,_0xdb1be7){return client['request'](_0x34fc85,_0x2fe0d0)[_0xf81e('0xb')](function(_0x21f06b){logger[_0xf81e('0xc')]('Schedule,\x20%s,\x20%s',_0x59dc68,_0xf81e('0xd'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x59dc68,_0xf81e('0xd'),JSON[_0xf81e('0xe')](_0x21f06b));if(_0x21f06b['error']){if(_0x21f06b[_0xf81e('0xf')]['code']===0x1f4){logger[_0xf81e('0xf')](_0xf81e('0x10'),_0x59dc68,_0x21f06b[_0xf81e('0xf')]['message']);return _0xdb1be7(_0x21f06b[_0xf81e('0xf')][_0xf81e('0x11')]);}logger[_0xf81e('0xf')](_0xf81e('0x10'),_0x59dc68,_0x21f06b[_0xf81e('0xf')]['message']);return _0xded889(_0x21f06b[_0xf81e('0xf')]['message']);}else{logger['info'](_0xf81e('0x10'),_0x59dc68,_0xf81e('0xd'));_0xded889(_0x21f06b[_0xf81e('0x12')][_0xf81e('0x11')]);}})[_0xf81e('0x13')](function(_0x4b48b0){logger[_0xf81e('0xf')](_0xf81e('0x10'),_0x59dc68,_0x4b48b0);_0xdb1be7(_0x4b48b0);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 74f3cf4..0029fdd 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 _0xd54d=['isAuthenticated','/describe','/:id','/:id/download','create','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd54d,0xe5));var _0xdd54=function(_0x17559c,_0x485682){_0x17559c=_0x17559c-0x0;var _0x23ab66=_0xd54d[_0x17559c];return _0x23ab66;};'use strict';var multer=require(_0xdd54('0x0'));var util=require(_0xdd54('0x1'));var path=require(_0xdd54('0x2'));var timeout=require(_0xdd54('0x3'));var express=require('express');var router=express[_0xdd54('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdd54('0x5'));var config=require(_0xdd54('0x6'));var controller=require(_0xdd54('0x7'));router[_0xdd54('0x8')]('/',auth[_0xdd54('0x9')](),controller['index']);router[_0xdd54('0x8')](_0xdd54('0xa'),auth[_0xdd54('0x9')](),controller['describe']);router[_0xdd54('0x8')](_0xdd54('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdd54('0x8')](_0xdd54('0xc'),auth[_0xdd54('0x9')](),controller['download']);router['post']('/',auth[_0xdd54('0x9')](),controller[_0xdd54('0xd')]);router[_0xdd54('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xdd54('0xb'),auth[_0xdd54('0x9')](),controller[_0xdd54('0xf')]);module[_0xdd54('0x10')]=router; \ No newline at end of file +var _0x2e81=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','download','create','put','update','delete','destroy','exports'];(function(_0x1805c1,_0x3cc130){var _0x49db67=function(_0x1f1166){while(--_0x1f1166){_0x1805c1['push'](_0x1805c1['shift']());}};_0x49db67(++_0x3cc130);}(_0x2e81,0x13b));var _0x12e8=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x2e81[_0x1e5db8];return _0x219a51;};'use strict';var multer=require(_0x12e8('0x0'));var util=require(_0x12e8('0x1'));var path=require(_0x12e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x12e8('0x3'));var router=express['Router']();var fs_extra=require(_0x12e8('0x4'));var auth=require(_0x12e8('0x5'));var interaction=require(_0x12e8('0x6'));var config=require(_0x12e8('0x7'));var controller=require(_0x12e8('0x8'));router[_0x12e8('0x9')]('/',auth[_0x12e8('0xa')](),controller[_0x12e8('0xb')]);router[_0x12e8('0x9')](_0x12e8('0xc'),auth[_0x12e8('0xa')](),controller['describe']);router['get'](_0x12e8('0xd'),auth[_0x12e8('0xa')](),controller['show']);router[_0x12e8('0x9')]('/:id/download',auth[_0x12e8('0xa')](),controller[_0x12e8('0xe')]);router['post']('/',auth[_0x12e8('0xa')](),controller[_0x12e8('0xf')]);router[_0x12e8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x12e8('0x11')]);router[_0x12e8('0x12')](_0x12e8('0xd'),auth['isAuthenticated'](),controller[_0x12e8('0x13')]);module[_0x12e8('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index cfd13f2..50167bd 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 _0x7096=['closedAt','updatedAt','moment','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x7096,0x10c));var _0x6709=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x7096[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6709('0x0'));var path=require('path');var config=require(_0x6709('0x1'));module['exports']={'format':{'type':Sequelize[_0x6709('0x2')],'get':function(){return this[_0x6709('0x3')](_0x6709('0x4'))?path[_0x6709('0x5')](this[_0x6709('0x3')](_0x6709('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x6709('0x6')]},'channel':{'type':Sequelize[_0x6709('0x6')]},'value':{'type':Sequelize[_0x6709('0x6')],'set':function(_0x3e2223){var _0x11ad23=_0x3e2223[_0x6709('0x7')](/\\/g,'/');this[_0x6709('0x8')]('value',_0x11ad23);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6709('0x9')],'set':function(_0x2d8c0b){this[_0x6709('0x8')](_0x6709('0xa'),moment()[_0x6709('0xb')](_0x2d8c0b,'ms'));this[_0x6709('0x8')]('closedAt',moment());this['setDataValue'](_0x6709('0xc'),_0x2d8c0b);}},'startedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this[_0x6709('0x3')](_0x6709('0xa')))[_0x6709('0xe')](_0x6709('0xf'))[_0x6709('0x10')]();}},'closedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this['getDataValue'](_0x6709('0x11')))[_0x6709('0xe')](_0x6709('0xf'))[_0x6709('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6709('0x3')]('createdAt'))[_0x6709('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x6709('0x10')]();}},'updatedAt':{'type':Sequelize[_0x6709('0xd')],'get':function(){return moment(this[_0x6709('0x3')](_0x6709('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x2d07=['subtract','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt','toString','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','getDataValue','value','extname','STRING','setDataValue','startedAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d07,0x13a));var _0x72d0=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x2d07[_0x3a7634];return _0x23bbe9;};'use strict';var Sequelize=require(_0x72d0('0x0'));var moment=require(_0x72d0('0x1'));var path=require('path');var config=require(_0x72d0('0x2'));module[_0x72d0('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x72d0('0x4')](_0x72d0('0x5'))?path[_0x72d0('0x6')](this[_0x72d0('0x4')](_0x72d0('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x72d0('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x72d0('0x7')],'set':function(_0xdad2db){var _0x2a4100=_0xdad2db['replace'](/\\/g,'/');this['setDataValue'](_0x72d0('0x5'),_0x2a4100);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5db523){this[_0x72d0('0x8')](_0x72d0('0x9'),moment()[_0x72d0('0xa')](_0x5db523,'ms'));this[_0x72d0('0x8')]('closedAt',moment());this['setDataValue']('duration',_0x5db523);}},'startedAt':{'type':Sequelize[_0x72d0('0xb')],'get':function(){return moment(this[_0x72d0('0x4')](_0x72d0('0x9')))[_0x72d0('0xc')](_0x72d0('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0x72d0('0xb')],'get':function(){return moment(this[_0x72d0('0x4')](_0x72d0('0xe')))['format'](_0x72d0('0xd'))[_0x72d0('0xf')]();}},'createdAt':{'type':Sequelize[_0x72d0('0xb')],'get':function(){return moment(this[_0x72d0('0x4')](_0x72d0('0x10')))[_0x72d0('0xc')]('MM-DD-YYYY\x20HH:mm')[_0x72d0('0xf')]();}},'updatedAt':{'type':Sequelize[_0x72d0('0xb')],'get':function(){return moment(this[_0x72d0('0x4')](_0x72d0('0x11')))[_0x72d0('0xc')](_0x72d0('0xd'))[_0x72d0('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f70b6c3..49cdb86 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 _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x587845,_0x3115b9){_0x587845=_0x587845-0x0;var _0x1c2292=_0xd0bb[_0x587845];return _0x1c2292;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0xabce,0x103));var _0xeabc=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xabce[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 876e9e1..5d06c3e 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 _0xcd92=['../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','path'];(function(_0x37bd6e,_0x3ce9c5){var _0x499bbf=function(_0x3b1d70){while(--_0x3b1d70){_0x37bd6e['push'](_0x37bd6e['shift']());}};_0x499bbf(++_0x3ce9c5);}(_0xcd92,0x1da));var _0x2cd9=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcd92[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x2cd9('0x0'));var util=require(_0x2cd9('0x1'));var logger=require('../../config/logger')(_0x2cd9('0x2'));var moment=require(_0x2cd9('0x3'));var BPromise=require(_0x2cd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cd9('0x5'));var rimraf=require('rimraf');var config=require(_0x2cd9('0x6'));var attributes=require(_0x2cd9('0x7'));module['exports']=function(_0x42695e,_0x56f603){return _0x42695e[_0x2cd9('0x8')](_0x2cd9('0x9'),attributes,{'tableName':_0x2cd9('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x2cd9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8916=['rimraf','screen_recordings','interactionid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4a50f4,_0x20117f){var _0x4c2b5b=function(_0x4a0302){while(--_0x4a0302){_0x4a50f4['push'](_0x4a50f4['shift']());}};_0x4c2b5b(++_0x20117f);}(_0x8916,0xed));var _0x6891=function(_0x50e2f0,_0x4197f8){_0x50e2f0=_0x50e2f0-0x0;var _0x3612e1=_0x8916[_0x50e2f0];return _0x3612e1;};'use strict';var _=require(_0x6891('0x0'));var util=require(_0x6891('0x1'));var logger=require(_0x6891('0x2'))('api');var moment=require(_0x6891('0x3'));var BPromise=require('bluebird');var rp=require(_0x6891('0x4'));var fs=require('fs');var path=require(_0x6891('0x5'));var rimraf=require(_0x6891('0x6'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module['exports']=function(_0xd740ee,_0x4a6a71){return _0xd740ee['define']('ScreenRecording',attributes,{'tableName':_0x6891('0x7'),'paranoid':![],'indexes':[{'name':_0x6891('0x8'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 1f75cae..8257b85 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 _0xed11=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x472763,_0x53fc81){var _0x53d9f6=function(_0xee3318){while(--_0xee3318){_0x472763['push'](_0x472763['shift']());}};_0x53d9f6(++_0x53fc81);}(_0xed11,0x179));var _0x1ed1=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xed11[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x1ed1('0x0'));var util=require('util');var moment=require(_0x1ed1('0x1'));var BPromise=require(_0x1ed1('0x2'));var rs=require(_0x1ed1('0x3'));var fs=require('fs');var Redis=require(_0x1ed1('0x4'));var db=require(_0x1ed1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ed1('0x6'))(_0x1ed1('0x7'));var config=require(_0x1ed1('0x8'));var jayson=require(_0x1ed1('0x9'));var client=jayson[_0x1ed1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50da2d,_0x4b0524,_0x2a1aa4){return new BPromise(function(_0x41d43a,_0x487948){return client[_0x1ed1('0xb')](_0x50da2d,_0x2a1aa4)['then'](function(_0x520dd1){logger[_0x1ed1('0xc')](_0x1ed1('0xd'),_0x4b0524,_0x1ed1('0xe'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4b0524,_0x1ed1('0xe'),JSON[_0x1ed1('0xf')](_0x520dd1));if(_0x520dd1[_0x1ed1('0x10')]){if(_0x520dd1[_0x1ed1('0x10')][_0x1ed1('0x11')]===0x1f4){logger[_0x1ed1('0x10')](_0x1ed1('0xd'),_0x4b0524,_0x520dd1['error'][_0x1ed1('0x12')]);return _0x487948(_0x520dd1['error']['message']);}logger['error'](_0x1ed1('0xd'),_0x4b0524,_0x520dd1[_0x1ed1('0x10')]['message']);return _0x41d43a(_0x520dd1[_0x1ed1('0x10')]['message']);}else{logger[_0x1ed1('0xc')](_0x1ed1('0xd'),_0x4b0524,_0x1ed1('0xe'));_0x41d43a(_0x520dd1[_0x1ed1('0x13')][_0x1ed1('0x12')]);}})[_0x1ed1('0x14')](function(_0x242d3b){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4b0524,_0x242d3b);_0x487948(_0x242d3b);});});} \ No newline at end of file +var _0xbaaf=['../../config/utils','rpc','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../mysqldb'];(function(_0x128a61,_0x3b0f80){var _0x30745f=function(_0x1bf897){while(--_0x1bf897){_0x128a61['push'](_0x128a61['shift']());}};_0x30745f(++_0x3b0f80);}(_0xbaaf,0x1a0));var _0xfbaa=function(_0x27c7dc,_0x4f1714){_0x27c7dc=_0x27c7dc-0x0;var _0x4abb04=_0xbaaf[_0x27c7dc];return _0x4abb04;};'use strict';var _=require('lodash');var util=require(_0xfbaa('0x0'));var moment=require('moment');var BPromise=require(_0xfbaa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbaa('0x2'));var db=require(_0xfbaa('0x3'))['db'];var utils=require(_0xfbaa('0x4'));var logger=require('../../config/logger')(_0xfbaa('0x5'));var config=require('../../config/environment');var jayson=require(_0xfbaa('0x6'));var client=jayson[_0xfbaa('0x7')][_0xfbaa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19a7ac,_0x1c9c16,_0x4aea30){return new BPromise(function(_0x4fc8e4,_0x53361a){return client['request'](_0x19a7ac,_0x4aea30)[_0xfbaa('0x9')](function(_0x34e470){logger['info'](_0xfbaa('0xa'),_0x1c9c16,_0xfbaa('0xb'));logger[_0xfbaa('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1c9c16,'request\x20sent',JSON[_0xfbaa('0xd')](_0x34e470));if(_0x34e470[_0xfbaa('0xe')]){if(_0x34e470[_0xfbaa('0xe')][_0xfbaa('0xf')]===0x1f4){logger[_0xfbaa('0xe')](_0xfbaa('0xa'),_0x1c9c16,_0x34e470['error']['message']);return _0x53361a(_0x34e470['error'][_0xfbaa('0x10')]);}logger['error'](_0xfbaa('0xa'),_0x1c9c16,_0x34e470['error'][_0xfbaa('0x10')]);return _0x4fc8e4(_0x34e470[_0xfbaa('0xe')][_0xfbaa('0x10')]);}else{logger[_0xfbaa('0x11')](_0xfbaa('0xa'),_0x1c9c16,_0xfbaa('0xb'));_0x4fc8e4(_0x34e470[_0xfbaa('0x12')][_0xfbaa('0x10')]);}})[_0xfbaa('0x13')](function(_0x56faf6){logger[_0xfbaa('0xe')](_0xfbaa('0xa'),_0x1c9c16,_0x56faf6);_0x53361a(_0x56faf6);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 05bb419..518e18b 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 _0xe44f=['favicon','addFavicon','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','format','%s%s','logo','extname','originalname','post','single','addLogo','server/files/images/logos/','logologin','addLogoLogin','diskStorage','file'];(function(_0x1340b3,_0x3d52bb){var _0x43f7c0=function(_0x225048){while(--_0x225048){_0x1340b3['push'](_0x1340b3['shift']());}};_0x43f7c0(++_0x3d52bb);}(_0xe44f,0xe6));var _0xfe44=function(_0x4cfb78,_0x3884a7){_0x4cfb78=_0x4cfb78-0x0;var _0x1e5650=_0xe44f[_0x4cfb78];return _0x1e5650;};'use strict';var multer=require('multer');var util=require(_0xfe44('0x0'));var path=require(_0xfe44('0x1'));var timeout=require(_0xfe44('0x2'));var express=require(_0xfe44('0x3'));var router=express[_0xfe44('0x4')]();var fs_extra=require(_0xfe44('0x5'));var auth=require(_0xfe44('0x6'));var interaction=require(_0xfe44('0x7'));var config=require(_0xfe44('0x8'));var controller=require(_0xfe44('0x9'));router[_0xfe44('0xa')]('/',auth[_0xfe44('0xb')](),controller['index']);router['get']('/now',controller[_0xfe44('0xc')]);router[_0xfe44('0xa')](_0xfe44('0xd'),controller[_0xfe44('0xe')]);router['get'](_0xfe44('0xf'),controller[_0xfe44('0x10')]);router[_0xfe44('0xa')](_0xfe44('0x11'),controller[_0xfe44('0x12')]);router[_0xfe44('0xa')](_0xfe44('0x13'),controller[_0xfe44('0x14')]);router[_0xfe44('0xa')](_0xfe44('0x15'),controller[_0xfe44('0x16')]);router[_0xfe44('0xa')](_0xfe44('0x17'),controller[_0xfe44('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3dd878,_0x4ef345,_0x273c5e){_0x273c5e(null,path[_0xfe44('0x19')](config[_0xfe44('0x1a')],'server/files/images/logos/'));},'filename':function(_0x298838,_0x272b08,_0x593ad9){_0x593ad9(null,util[_0xfe44('0x1b')](_0xfe44('0x1c'),_0xfe44('0x1d'),path[_0xfe44('0x1e')](_0x272b08[_0xfe44('0x1f')])));}})});router[_0xfe44('0x20')](_0xfe44('0xf'),upload[_0xfe44('0x21')]('file'),controller[_0xfe44('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5781d8,_0x1a8103,_0x2ed145){_0x2ed145(null,path[_0xfe44('0x19')](config[_0xfe44('0x1a')],_0xfe44('0x23')));},'filename':function(_0x370f56,_0x1bf834,_0x4fda60){_0x4fda60(null,util['format'](_0xfe44('0x1c'),_0xfe44('0x24'),path[_0xfe44('0x1e')](_0x1bf834[_0xfe44('0x1f')])));}})});router['post'](_0xfe44('0x11'),upload[_0xfe44('0x21')]('file'),controller[_0xfe44('0x25')]);var upload=multer({'storage':multer[_0xfe44('0x26')]({'destination':function(_0x3e80a1,_0x10aec7,_0x1f00d0){_0x1f00d0(null,path[_0xfe44('0x19')](config[_0xfe44('0x1a')],_0xfe44('0x23')));},'filename':function(_0x2feec8,_0x2e3750,_0x28cc84){_0x28cc84(null,util[_0xfe44('0x1b')](_0xfe44('0x1c'),'preferred',path[_0xfe44('0x1e')](_0x2e3750[_0xfe44('0x1f')])));}})});router[_0xfe44('0x20')]('/:id/preferred',upload[_0xfe44('0x21')](_0xfe44('0x27')),controller['addPreferred']);var upload=multer({'storage':multer[_0xfe44('0x26')]({'destination':function(_0x349d3e,_0x3a2214,_0x3f0d75){_0x3f0d75(null,path[_0xfe44('0x19')](config[_0xfe44('0x1a')],'server/files/images/logos/'));},'filename':function(_0x5ebee1,_0x2fe12e,_0x1c5e0d){_0x1c5e0d(null,util[_0xfe44('0x1b')](_0xfe44('0x1c'),_0xfe44('0x28'),path[_0xfe44('0x1e')](_0x2fe12e[_0xfe44('0x1f')])));}})});router['post']('/:id/favicon',upload['single']('file'),controller[_0xfe44('0x29')]);router[_0xfe44('0x2a')](_0xfe44('0xd'),auth[_0xfe44('0xb')](),controller[_0xfe44('0x2b')]);module[_0xfe44('0x2c')]=router; \ No newline at end of file +var _0x40a9=['format','logologin','post','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','get','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getFavicon','diskStorage','join','root','%s%s','logo','extname','originalname','/:id/logo','single','file','addLogo','server/files/images/logos/'];(function(_0x15def3,_0x2be343){var _0x1678e9=function(_0x586896){while(--_0x586896){_0x15def3['push'](_0x15def3['shift']());}};_0x1678e9(++_0x2be343);}(_0x40a9,0x1c1));var _0x940a=function(_0x527096,_0x161556){_0x527096=_0x527096-0x0;var _0x418902=_0x40a9[_0x527096];return _0x418902;};'use strict';var multer=require(_0x940a('0x0'));var util=require('util');var path=require(_0x940a('0x1'));var timeout=require(_0x940a('0x2'));var express=require(_0x940a('0x3'));var router=express[_0x940a('0x4')]();var fs_extra=require(_0x940a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x940a('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0x940a('0x7')](),controller['index']);router[_0x940a('0x8')](_0x940a('0x9'),controller[_0x940a('0xa')]);router[_0x940a('0x8')](_0x940a('0xb'),controller[_0x940a('0xc')]);router[_0x940a('0x8')]('/:id/logo',controller[_0x940a('0xd')]);router[_0x940a('0x8')](_0x940a('0xe'),controller[_0x940a('0xf')]);router[_0x940a('0x8')](_0x940a('0x10'),controller['gdpr']);router[_0x940a('0x8')](_0x940a('0x11'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0x940a('0x12')]);var upload=multer({'storage':multer[_0x940a('0x13')]({'destination':function(_0x19897a,_0xcfd243,_0x5766c5){_0x5766c5(null,path[_0x940a('0x14')](config[_0x940a('0x15')],'server/files/images/logos/'));},'filename':function(_0x5d7456,_0x21025c,_0x302b72){_0x302b72(null,util['format'](_0x940a('0x16'),_0x940a('0x17'),path[_0x940a('0x18')](_0x21025c[_0x940a('0x19')])));}})});router['post'](_0x940a('0x1a'),upload[_0x940a('0x1b')](_0x940a('0x1c')),controller[_0x940a('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f9c34,_0x4aa7eb,_0x1c2924){_0x1c2924(null,path['join'](config[_0x940a('0x15')],_0x940a('0x1e')));},'filename':function(_0x1d19ab,_0x94c659,_0x4e3574){_0x4e3574(null,util[_0x940a('0x1f')](_0x940a('0x16'),_0x940a('0x20'),path['extname'](_0x94c659[_0x940a('0x19')])));}})});router[_0x940a('0x21')](_0x940a('0xe'),upload[_0x940a('0x1b')](_0x940a('0x1c')),controller[_0x940a('0x22')]);var upload=multer({'storage':multer[_0x940a('0x13')]({'destination':function(_0x10db8e,_0x3ca45a,_0x3ad579){_0x3ad579(null,path['join'](config[_0x940a('0x15')],'server/files/images/logos/'));},'filename':function(_0x592671,_0x36e9f1,_0x3e1e1e){_0x3e1e1e(null,util['format']('%s%s',_0x940a('0x23'),path['extname'](_0x36e9f1[_0x940a('0x19')])));}})});router[_0x940a('0x21')]('/:id/preferred',upload[_0x940a('0x1b')](_0x940a('0x1c')),controller[_0x940a('0x24')]);var upload=multer({'storage':multer[_0x940a('0x13')]({'destination':function(_0x5beb4b,_0x2e2ddd,_0x185b04){_0x185b04(null,path[_0x940a('0x14')](config[_0x940a('0x15')],_0x940a('0x1e')));},'filename':function(_0x20ae3d,_0x2e1295,_0x3f9395){_0x3f9395(null,util[_0x940a('0x1f')](_0x940a('0x16'),_0x940a('0x25'),path[_0x940a('0x18')](_0x2e1295[_0x940a('0x19')])));}})});router[_0x940a('0x21')](_0x940a('0x26'),upload['single'](_0x940a('0x1c')),controller['addFavicon']);router['put'](_0x940a('0xb'),auth[_0x940a('0x7')](),controller['update']);module[_0x940a('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5de0bc9..fd9ee74 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(_0x5d9ff6,_0x1c409d){var _0x3a168a=function(_0x929d98){while(--_0x929d98){_0x5d9ff6['push'](_0x5d9ff6['shift']());}};_0x3a168a(++_0x1c409d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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(_0x2d6d8e,_0x471797){var _0x1d5ce9=function(_0x1332ae){while(--_0x1332ae){_0x2d6d8e['push'](_0x2d6d8e['shift']());}};_0x1d5ce9(++_0x471797);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 fe26e7a..a69ddd6 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 _0xcc1b=['getLogoLogin','default_loginLogo.svg','Sequelize','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','server/files/images/logos','default_favicon.ico','getDate','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','Setting','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','show','params','rawAttributes','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','ValidationError','upperFirst','download'];(function(_0x169a6e,_0x2c88f5){var _0x1e0a6a=function(_0x4e21e8){while(--_0x4e21e8){_0x169a6e['push'](_0x169a6e['shift']());}};_0x1e0a6a(++_0x2c88f5);}(_0xcc1b,0x8c));var _0xbcc1=function(_0x31f874,_0x3d4ce0){_0x31f874=_0x31f874-0x0;var _0xa27181=_0xcc1b[_0x31f874];return _0xa27181;};'use strict';var emlformat=require(_0xbcc1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcc1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcc1('0x2'));var moment=require(_0xbcc1('0x3'));var BPromise=require(_0xbcc1('0x4'));var Mustache=require(_0xbcc1('0x5'));var util=require(_0xbcc1('0x6'));var path=require(_0xbcc1('0x7'));var sox=require(_0xbcc1('0x8'));var csv=require('to-csv');var ejs=require(_0xbcc1('0x9'));var fs=require('fs');var fs_extra=require(_0xbcc1('0xa'));var _=require(_0xbcc1('0xb'));var squel=require('squel');var crypto=require(_0xbcc1('0xc'));var jsforce=require(_0xbcc1('0xd'));var deskjs=require(_0xbcc1('0xe'));var toCsv=require(_0xbcc1('0xf'));var querystring=require(_0xbcc1('0x10'));var Papa=require(_0xbcc1('0x11'));var Redis=require(_0xbcc1('0x12'));var authService=require(_0xbcc1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcc1('0x14'))('api');var utils=require(_0xbcc1('0x15'));var config=require(_0xbcc1('0x16'));var licenseUtil=require(_0xbcc1('0x17'));var db=require(_0xbcc1('0x18'))['db'];var jayson=require(_0xbcc1('0x19'));var client=jayson[_0xbcc1('0x1a')][_0xbcc1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x35f66d,_0x379c92,_0x7cfa6,_0x521fa9){return new BPromise(function(_0x29d8ff,_0x45a372){var _0x35dda1=_0x521fa9||client;return _0x35dda1['request'](_0x35f66d,_0x7cfa6)[_0xbcc1('0x1c')](function(_0x15675b){logger[_0xbcc1('0x1d')]('Setting,\x20%s,\x20%s',_0x379c92,_0xbcc1('0x1e'));logger['debug'](_0xbcc1('0x1f'),_0x379c92,'request\x20sent',JSON[_0xbcc1('0x20')](_0x15675b));if(_0x15675b[_0xbcc1('0x21')]){if(_0x15675b[_0xbcc1('0x21')][_0xbcc1('0x22')]===0x1f4){logger[_0xbcc1('0x21')](_0xbcc1('0x23'),_0x379c92,_0x15675b[_0xbcc1('0x21')][_0xbcc1('0x24')]);return _0x45a372(_0x15675b[_0xbcc1('0x21')][_0xbcc1('0x24')]);}logger[_0xbcc1('0x21')](_0xbcc1('0x23'),_0x379c92,_0x15675b[_0xbcc1('0x21')][_0xbcc1('0x24')]);return _0x29d8ff(_0x15675b['error']['message']);}else{logger[_0xbcc1('0x1d')](_0xbcc1('0x23'),_0x379c92,_0xbcc1('0x1e'));_0x29d8ff(_0x15675b['result'][_0xbcc1('0x24')]);}})[_0xbcc1('0x25')](function(_0x19fcc5){logger[_0xbcc1('0x21')]('Setting,\x20%s,\x20%s',_0x379c92,_0x19fcc5);_0x45a372(_0x19fcc5);});});}function respondWithStatusCode(_0x2dfbe4,_0x4cb32f){_0x4cb32f=_0x4cb32f||0xcc;return function(_0x364f40){if(_0x364f40){return _0x2dfbe4[_0xbcc1('0x26')](_0x4cb32f);}return _0x2dfbe4['status'](_0x4cb32f)[_0xbcc1('0x27')]();};}function respondWithResult(_0xd51ae,_0x1086e6){_0x1086e6=_0x1086e6||0xc8;return function(_0x1ffe10){if(_0x1ffe10){return _0xd51ae[_0xbcc1('0x28')](_0x1086e6)['json'](_0x1ffe10);}};}function respondWithFilteredResult(_0x1b3888,_0x10d937){return function(_0x9393e3){if(_0x9393e3){var _0x59bbc8=typeof _0x10d937[_0xbcc1('0x29')]===_0xbcc1('0x2a')&&typeof _0x10d937[_0xbcc1('0x2b')]===_0xbcc1('0x2a');var _0x1eaea4=_0x9393e3['count'];var _0x24eed2=_0x59bbc8?0x0:_0x10d937[_0xbcc1('0x29')];var _0x307dc0=_0x59bbc8?_0x9393e3['count']:_0x10d937[_0xbcc1('0x29')]+_0x10d937[_0xbcc1('0x2b')];var _0x46060e;if(_0x307dc0>=_0x1eaea4){_0x307dc0=_0x1eaea4;_0x46060e=0xc8;}else{_0x46060e=0xce;}_0x1b3888[_0xbcc1('0x28')](_0x46060e);return _0x1b3888[_0xbcc1('0x2c')](_0xbcc1('0x2d'),_0x24eed2+'-'+_0x307dc0+'/'+_0x1eaea4)[_0xbcc1('0x2e')](_0x9393e3);}return null;};}function patchUpdates(_0x1f4f74){return function(_0x221b0b){try{jsonpatch[_0xbcc1('0x2f')](_0x221b0b,_0x1f4f74,!![]);}catch(_0x2ced3a){return BPromise['reject'](_0x2ced3a);}return _0x221b0b[_0xbcc1('0x30')]();};}function saveUpdates(_0x5e73d0,_0xe306a7){return function(_0x962b68){if(_0x962b68){return _0x962b68[_0xbcc1('0x31')](_0x5e73d0)[_0xbcc1('0x1c')](function(_0xa8ebc3){return _0xa8ebc3;});}return null;};}function removeEntity(_0xba3a8,_0x8b5fb2){return function(_0x2cb733){if(_0x2cb733){return _0x2cb733[_0xbcc1('0x32')]()['then'](function(){_0xba3a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48589b,_0x304730){return function(_0x77eee7){if(!_0x77eee7){_0x48589b[_0xbcc1('0x26')](0x194);}return _0x77eee7;};}function handleError(_0x13ed4a,_0x54fee4){_0x54fee4=_0x54fee4||0x1f4;return function(_0x5001a6){logger[_0xbcc1('0x21')](_0x5001a6[_0xbcc1('0x33')]);if(_0x5001a6[_0xbcc1('0x34')]){delete _0x5001a6[_0xbcc1('0x34')];}_0x13ed4a[_0xbcc1('0x28')](_0x54fee4)[_0xbcc1('0x35')](_0x5001a6);};}exports[_0xbcc1('0x36')]=function(_0x707fc7,_0x51a07e){var _0x32c2f8={},_0x111980={},_0x12230a={'count':0x0,'rows':[]};var _0x2dbc1c=_[_0xbcc1('0x37')](db[_0xbcc1('0x38')]['rawAttributes'],function(_0x42dccc){return{'name':_0x42dccc[_0xbcc1('0x39')],'type':_0x42dccc[_0xbcc1('0x3a')][_0xbcc1('0x3b')]};});_0x111980['model']=_[_0xbcc1('0x37')](_0x2dbc1c,_0xbcc1('0x34'));_0x111980['query']=_[_0xbcc1('0x3c')](_0x707fc7[_0xbcc1('0x3d')]);_0x111980[_0xbcc1('0x3e')]=_['intersection'](_0x111980['model'],_0x111980[_0xbcc1('0x3d')]);_0x32c2f8[_0xbcc1('0x3f')]=_[_0xbcc1('0x40')](_0x111980[_0xbcc1('0x41')],qs['fields'](_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x42')]));_0x32c2f8[_0xbcc1('0x3f')]=_0x32c2f8[_0xbcc1('0x3f')][_0xbcc1('0x43')]?_0x32c2f8[_0xbcc1('0x3f')]:_0x111980[_0xbcc1('0x41')];if(!_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x44')](_0xbcc1('0x45'))){_0x32c2f8[_0xbcc1('0x2b')]=qs[_0xbcc1('0x2b')](_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x2b')]);_0x32c2f8[_0xbcc1('0x29')]=qs[_0xbcc1('0x29')](_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x29')]);}_0x32c2f8[_0xbcc1('0x46')]=qs[_0xbcc1('0x47')](_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x47')]);_0x32c2f8[_0xbcc1('0x48')]=qs[_0xbcc1('0x3e')](_[_0xbcc1('0x49')](_0x707fc7[_0xbcc1('0x3d')],_0x111980[_0xbcc1('0x3e')]),_0x2dbc1c);if(_0x707fc7[_0xbcc1('0x3d')]['filter']){_0x32c2f8[_0xbcc1('0x48')]=_[_0xbcc1('0x4a')](_0x32c2f8[_0xbcc1('0x48')],{'$or':_[_0xbcc1('0x37')](_0x2dbc1c,function(_0x234975){if(_0x234975[_0xbcc1('0x3a')]!==_0xbcc1('0x4b')){var _0x4e3f6b={};_0x4e3f6b[_0x234975[_0xbcc1('0x34')]]={'$like':'%'+_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x4c')]+'%'};return _0x4e3f6b;}})});}_0x32c2f8=_[_0xbcc1('0x4a')]({},_0x32c2f8,_0x707fc7[_0xbcc1('0x4d')]);var _0x42f8de={'where':_0x32c2f8[_0xbcc1('0x48')]};return db[_0xbcc1('0x38')][_0xbcc1('0x4e')](_0x42f8de)[_0xbcc1('0x1c')](function(_0x55f0e2){_0x12230a['count']=_0x55f0e2;if(_0x707fc7[_0xbcc1('0x3d')][_0xbcc1('0x4f')]){_0x32c2f8[_0xbcc1('0x50')]=[{'all':!![]}];}return db[_0xbcc1('0x38')][_0xbcc1('0x51')](_0x32c2f8);})[_0xbcc1('0x1c')](function(_0xfa024b){_0x12230a['rows']=_0xfa024b;return _0x12230a;})[_0xbcc1('0x1c')](respondWithFilteredResult(_0x51a07e,_0x32c2f8))[_0xbcc1('0x25')](handleError(_0x51a07e,null));};exports[_0xbcc1('0x52')]=function(_0x57b802,_0x242a34){var _0x594199={'raw':![],'where':{'id':_0x57b802[_0xbcc1('0x53')]['id']}},_0x359da6={};_0x359da6[_0xbcc1('0x41')]=_['keys'](db[_0xbcc1('0x38')][_0xbcc1('0x54')]);_0x359da6[_0xbcc1('0x3d')]=_[_0xbcc1('0x3c')](_0x57b802[_0xbcc1('0x3d')]);_0x359da6['filters']=_['intersection'](_0x359da6[_0xbcc1('0x41')],_0x359da6['query']);_0x594199['attributes']=_[_0xbcc1('0x40')](_0x359da6[_0xbcc1('0x41')],qs[_0xbcc1('0x42')](_0x57b802[_0xbcc1('0x3d')][_0xbcc1('0x42')]));_0x594199[_0xbcc1('0x3f')]=_0x594199[_0xbcc1('0x3f')][_0xbcc1('0x43')]?_0x594199[_0xbcc1('0x3f')]:_0x359da6[_0xbcc1('0x41')];if(_0x57b802['query']['includeAll']){_0x594199['include']=[{'all':!![]}];}_0x594199=_[_0xbcc1('0x4a')]({},_0x594199,_0x57b802['options']);return db[_0xbcc1('0x38')][_0xbcc1('0x55')](_0x594199)['then'](handleEntityNotFound(_0x242a34,null))['then'](respondWithResult(_0x242a34,null))[_0xbcc1('0x25')](handleError(_0x242a34,null));};exports[_0xbcc1('0x31')]=function(_0x58322e,_0x539bb1){if(_0x58322e[_0xbcc1('0x56')]['id']){delete _0x58322e[_0xbcc1('0x56')]['id'];}return db['Setting'][_0xbcc1('0x55')]({'where':{'id':_0x58322e[_0xbcc1('0x53')]['id']}})[_0xbcc1('0x1c')](handleEntityNotFound(_0x539bb1,null))[_0xbcc1('0x1c')](saveUpdates(_0x58322e[_0xbcc1('0x56')],null))[_0xbcc1('0x1c')](respondWithResult(_0x539bb1,null))[_0xbcc1('0x25')](handleError(_0x539bb1,null));};exports['addLogo']=function(_0x16ee95,_0x266b19,_0x4b1bde){if(_0x16ee95['file']&&_0x16ee95[_0xbcc1('0x57')][_0xbcc1('0x58')]){_0x16ee95[_0xbcc1('0x56')][_0xbcc1('0x59')]=_0x16ee95[_0xbcc1('0x57')][_0xbcc1('0x58')];}return db[_0xbcc1('0x38')]['find']({'where':{'id':_0x16ee95[_0xbcc1('0x53')]['id']}})['then'](handleEntityNotFound(_0x266b19,null))[_0xbcc1('0x1c')](saveUpdates(_0x16ee95[_0xbcc1('0x56')],null))[_0xbcc1('0x1c')](respondWithResult(_0x266b19,null))[_0xbcc1('0x25')](handleError(_0x266b19,null));};exports[_0xbcc1('0x5a')]=function(_0x2b6fb1,_0x5c2eb0,_0x295daf){if(_0x2b6fb1['file']&&_0x2b6fb1['file']['filename']){_0x2b6fb1[_0xbcc1('0x56')][_0xbcc1('0x5b')]=_0x2b6fb1['file'][_0xbcc1('0x58')];}return db[_0xbcc1('0x38')][_0xbcc1('0x55')]({'where':{'id':_0x2b6fb1[_0xbcc1('0x53')]['id']}})[_0xbcc1('0x1c')](handleEntityNotFound(_0x5c2eb0,null))[_0xbcc1('0x1c')](saveUpdates(_0x2b6fb1[_0xbcc1('0x56')],null))['then'](respondWithResult(_0x5c2eb0,null))['catch'](handleError(_0x5c2eb0,null));};var utilLicense=require(_0xbcc1('0x17'));exports[_0xbcc1('0x5c')]=function(_0x159910,_0x5a6516,_0x22d46f){var _0x1ddbea='server/files/images/logos';var _0x144c01={'custom':![]};return utilLicense[_0xbcc1('0x5d')]()[_0xbcc1('0x1c')](function(_0x552d69){if(_0x552d69){_0x144c01=_0x552d69;}return db[_0xbcc1('0x38')][_0xbcc1('0x55')]({'where':{'id':_0x159910[_0xbcc1('0x53')]['id']},'attributes':[_0xbcc1('0x59'),'loginLogo',_0xbcc1('0x5e'),_0xbcc1('0x5f'),_0xbcc1('0x60'),_0xbcc1('0x61'),_0xbcc1('0x62'),_0xbcc1('0x63')],'raw':!![]});})[_0xbcc1('0x1c')](handleEntityNotFound(_0x5a6516,null))[_0xbcc1('0x1c')](function(_0x505b6c){if(_0x505b6c){var _0x45081a=_0x505b6c[_0xbcc1('0x59')]&&fs[_0xbcc1('0x64')](path[_0xbcc1('0x65')](config['root'],_0x1ddbea,_['toLower'](_0x505b6c[_0xbcc1('0x59')])))?path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x1ddbea,_[_0xbcc1('0x67')](_0x505b6c['logo'])):path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x1ddbea,_[_0xbcc1('0x67')](_0xbcc1('0x68')));var _0x27e314=_0xbcc1('0x69')+_['upperFirst'](_0xbcc1('0x59'));if(_0x505b6c[_0x27e314]||!_0x144c01[_0xbcc1('0x6a')]){_0x45081a=path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x1ddbea,_[_0xbcc1('0x67')]('default_logo.svg'));}if(!fs[_0xbcc1('0x64')](_0x45081a)){throw new db['Sequelize'][(_0xbcc1('0x6b'))](_[_0xbcc1('0x6c')](_0xbcc1('0x59'))+'\x20not\x20found');}return _0x5a6516[_0xbcc1('0x6d')](_0x45081a);}})[_0xbcc1('0x25')](handleError(_0x5a6516,null));};var utilLicense=require(_0xbcc1('0x17'));exports[_0xbcc1('0x6e')]=function(_0x518fcd,_0x28a8ee,_0xe4d162){var _0x4b960c='server/files/images/logos';var _0x394cae={'custom':![]};return utilLicense[_0xbcc1('0x5d')]()['then'](function(_0x281611){if(_0x281611){_0x394cae=_0x281611;}return db[_0xbcc1('0x38')][_0xbcc1('0x55')]({'where':{'id':_0x518fcd[_0xbcc1('0x53')]['id']},'attributes':[_0xbcc1('0x59'),_0xbcc1('0x5b'),'preferred',_0xbcc1('0x5f'),_0xbcc1('0x60'),'defaultLoginLogo',_0xbcc1('0x62'),_0xbcc1('0x63')],'raw':!![]});})[_0xbcc1('0x1c')](handleEntityNotFound(_0x28a8ee,null))[_0xbcc1('0x1c')](function(_0x5c5b98){if(_0x5c5b98){var _0x908194=_0x5c5b98[_0xbcc1('0x5b')]&&fs[_0xbcc1('0x64')](path['join'](config[_0xbcc1('0x66')],_0x4b960c,_[_0xbcc1('0x67')](_0x5c5b98[_0xbcc1('0x5b')])))?path[_0xbcc1('0x65')](config['root'],_0x4b960c,_['toLower'](_0x5c5b98[_0xbcc1('0x5b')])):path[_0xbcc1('0x65')](config['root'],_0x4b960c,_['toLower'](_0xbcc1('0x6f')));var _0x346738=_0xbcc1('0x69')+_[_0xbcc1('0x6c')](_0xbcc1('0x5b'));if(_0x5c5b98[_0x346738]||!_0x394cae[_0xbcc1('0x6a')]){_0x908194=path[_0xbcc1('0x65')](config['root'],_0x4b960c,_[_0xbcc1('0x67')](_0xbcc1('0x6f')));}if(!fs[_0xbcc1('0x64')](_0x908194)){throw new db[(_0xbcc1('0x70'))][(_0xbcc1('0x6b'))](_[_0xbcc1('0x6c')](_0xbcc1('0x5b'))+_0xbcc1('0x71'));}return _0x28a8ee['download'](_0x908194);}})[_0xbcc1('0x25')](handleError(_0x28a8ee,null));};exports[_0xbcc1('0x72')]=function(_0x4f79b5,_0x5970c2){return db[_0xbcc1('0x38')][_0xbcc1('0x55')]({'where':{'id':_0x4f79b5[_0xbcc1('0x53')]['id']},'attributes':[_0xbcc1('0x73')]})[_0xbcc1('0x1c')](respondWithResult(_0x5970c2,null))[_0xbcc1('0x25')](handleError(_0x5970c2,null));};exports[_0xbcc1('0x74')]=function(_0x17c341,_0x3978c3,_0x572767){if(_0x17c341[_0xbcc1('0x57')]&&_0x17c341[_0xbcc1('0x57')][_0xbcc1('0x58')]){_0x17c341[_0xbcc1('0x56')][_0xbcc1('0x5e')]=_0x17c341['file'][_0xbcc1('0x58')];}return db[_0xbcc1('0x38')][_0xbcc1('0x55')]({'where':{'id':_0x17c341['params']['id']}})[_0xbcc1('0x1c')](handleEntityNotFound(_0x3978c3,null))['then'](saveUpdates(_0x17c341[_0xbcc1('0x56')],null))[_0xbcc1('0x1c')](respondWithResult(_0x3978c3,null))[_0xbcc1('0x25')](handleError(_0x3978c3,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x537ac9,_0x3981cc,_0x116bba){var _0xc8f23='server/files/images/logos';var _0x3dac5e={'custom':![]};return utilLicense[_0xbcc1('0x5d')]()[_0xbcc1('0x1c')](function(_0x12c625){if(_0x12c625){_0x3dac5e=_0x12c625;}return db[_0xbcc1('0x38')]['find']({'where':{'id':_0x537ac9[_0xbcc1('0x53')]['id']},'attributes':[_0xbcc1('0x59'),_0xbcc1('0x5b'),_0xbcc1('0x5e'),_0xbcc1('0x5f'),'defaultLogo',_0xbcc1('0x61'),'defaultPreferred',_0xbcc1('0x63')],'raw':!![]});})[_0xbcc1('0x1c')](handleEntityNotFound(_0x3981cc,null))[_0xbcc1('0x1c')](function(_0x13180f){if(_0x13180f){var _0x45a145=_0x13180f[_0xbcc1('0x5e')]&&fs[_0xbcc1('0x64')](path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0xc8f23,_['toLower'](_0x13180f[_0xbcc1('0x5e')])))?path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0xc8f23,_[_0xbcc1('0x67')](_0x13180f[_0xbcc1('0x5e')])):path['join'](config[_0xbcc1('0x66')],_0xc8f23,_[_0xbcc1('0x67')](_0xbcc1('0x75')));var _0x554318=_0xbcc1('0x69')+_['upperFirst'](_0xbcc1('0x5e'));if(_0x13180f[_0x554318]||!_0x3dac5e['custom']||!_0x3dac5e[_0xbcc1('0x5e')]){_0x45a145=path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0xc8f23,_[_0xbcc1('0x67')](_0xbcc1('0x75')));}if(!fs[_0xbcc1('0x64')](_0x45a145)){throw new db[(_0xbcc1('0x70'))][(_0xbcc1('0x6b'))](_['upperFirst'](_0xbcc1('0x5e'))+_0xbcc1('0x71'));}return _0x3981cc['download'](_0x45a145);}})['catch'](handleError(_0x3981cc,null));};exports[_0xbcc1('0x76')]=function(_0x252fc1,_0xeed744,_0x584e40){if(_0x252fc1[_0xbcc1('0x57')]&&_0x252fc1[_0xbcc1('0x57')][_0xbcc1('0x58')]){_0x252fc1[_0xbcc1('0x56')][_0xbcc1('0x5f')]=_0x252fc1[_0xbcc1('0x57')]['filename'];}return db['Setting'][_0xbcc1('0x55')]({'where':{'id':_0x252fc1['params']['id']}})[_0xbcc1('0x1c')](handleEntityNotFound(_0xeed744,null))[_0xbcc1('0x1c')](saveUpdates(_0x252fc1['body'],null))[_0xbcc1('0x1c')](respondWithResult(_0xeed744,null))['catch'](handleError(_0xeed744,null));};var utilLicense=require(_0xbcc1('0x17'));exports[_0xbcc1('0x77')]=function(_0x216e20,_0x5817f6,_0x1e3a43){var _0x4b482d=_0xbcc1('0x78');var _0x1dc7c1={'custom':![]};return utilLicense[_0xbcc1('0x5d')]()[_0xbcc1('0x1c')](function(_0x48dd69){if(_0x48dd69){_0x1dc7c1=_0x48dd69;}return db['Setting'][_0xbcc1('0x55')]({'where':{'id':_0x216e20['params']['id']},'attributes':['logo','loginLogo','preferred',_0xbcc1('0x5f'),_0xbcc1('0x60'),_0xbcc1('0x61'),_0xbcc1('0x62'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5817f6,null))[_0xbcc1('0x1c')](function(_0x1e671c){if(_0x1e671c){var _0xee21ad=_0x1e671c[_0xbcc1('0x5f')]&&fs[_0xbcc1('0x64')](path['join'](config[_0xbcc1('0x66')],_0x4b482d,_[_0xbcc1('0x67')](_0x1e671c[_0xbcc1('0x5f')])))?path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x4b482d,_[_0xbcc1('0x67')](_0x1e671c[_0xbcc1('0x5f')])):path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x4b482d,_[_0xbcc1('0x67')](_0xbcc1('0x79')));var _0xa06378=_0xbcc1('0x69')+_['upperFirst'](_0xbcc1('0x5f'));if(_0x1e671c[_0xa06378]||!_0x1dc7c1[_0xbcc1('0x6a')]){_0xee21ad=path[_0xbcc1('0x65')](config[_0xbcc1('0x66')],_0x4b482d,_[_0xbcc1('0x67')](_0xbcc1('0x79')));}if(!fs[_0xbcc1('0x64')](_0xee21ad)){throw new db[(_0xbcc1('0x70'))][(_0xbcc1('0x6b'))](_['upperFirst'](_0xbcc1('0x5f'))+'\x20not\x20found');}return _0x5817f6[_0xbcc1('0x6d')](_0xee21ad);}})['catch'](handleError(_0x5817f6,null));};exports[_0xbcc1('0x7a')]=function(_0x169345,_0x54878a){var _0x1dcc91={'offset':moment()[_0xbcc1('0x7b')]()};_0x1dcc91['now']=moment()['utcOffset'](_0x1dcc91[_0xbcc1('0x29')])['format'](_0xbcc1('0x7c'));return _0x54878a[_0xbcc1('0x28')](0xc8)[_0xbcc1('0x35')](_0x1dcc91);}; \ No newline at end of file +var _0xcc19=['type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','addLogo','file','filename','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','logo','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','download','favicon','defaultFavicon','default','default_loginLogo.svg','Sequelize','securePassword','addPreferred','getPreferred','default_preferred.png','ValidationError','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','Setting','fieldName'];(function(_0x3912cb,_0x552ee6){var _0x2edbda=function(_0x47121e){while(--_0x47121e){_0x3912cb['push'](_0x3912cb['shift']());}};_0x2edbda(++_0x552ee6);}(_0xcc19,0xbd));var _0x9cc1=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0xcc19[_0x319cb9];return _0x1735fc;};'use strict';var emlformat=require(_0x9cc1('0x0'));var rimraf=require(_0x9cc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cc1('0x2'));var rp=require(_0x9cc1('0x3'));var moment=require(_0x9cc1('0x4'));var BPromise=require(_0x9cc1('0x5'));var Mustache=require(_0x9cc1('0x6'));var util=require(_0x9cc1('0x7'));var path=require(_0x9cc1('0x8'));var sox=require(_0x9cc1('0x9'));var csv=require(_0x9cc1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cc1('0xb'));var squel=require(_0x9cc1('0xc'));var crypto=require(_0x9cc1('0xd'));var jsforce=require(_0x9cc1('0xe'));var deskjs=require(_0x9cc1('0xf'));var toCsv=require(_0x9cc1('0xa'));var querystring=require('querystring');var Papa=require(_0x9cc1('0x10'));var Redis=require(_0x9cc1('0x11'));var authService=require(_0x9cc1('0x12'));var qs=require(_0x9cc1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cc1('0x14'));var logger=require(_0x9cc1('0x15'))(_0x9cc1('0x16'));var utils=require(_0x9cc1('0x17'));var config=require(_0x9cc1('0x18'));var licenseUtil=require(_0x9cc1('0x19'));var db=require(_0x9cc1('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9cc1('0x1b')][_0x9cc1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2e44dc,_0x346209,_0x2d8a5e,_0x1c678d){return new BPromise(function(_0x4401c2,_0x6dfd1e){var _0x31d490=_0x1c678d||client;return _0x31d490['request'](_0x2e44dc,_0x2d8a5e)['then'](function(_0x5576fb){logger['info'](_0x9cc1('0x1d'),_0x346209,_0x9cc1('0x1e'));logger[_0x9cc1('0x1f')](_0x9cc1('0x20'),_0x346209,'request\x20sent',JSON['stringify'](_0x5576fb));if(_0x5576fb[_0x9cc1('0x21')]){if(_0x5576fb[_0x9cc1('0x21')][_0x9cc1('0x22')]===0x1f4){logger[_0x9cc1('0x21')]('Setting,\x20%s,\x20%s',_0x346209,_0x5576fb[_0x9cc1('0x21')][_0x9cc1('0x23')]);return _0x6dfd1e(_0x5576fb[_0x9cc1('0x21')][_0x9cc1('0x23')]);}logger['error'](_0x9cc1('0x1d'),_0x346209,_0x5576fb[_0x9cc1('0x21')][_0x9cc1('0x23')]);return _0x4401c2(_0x5576fb[_0x9cc1('0x21')][_0x9cc1('0x23')]);}else{logger[_0x9cc1('0x24')](_0x9cc1('0x1d'),_0x346209,'request\x20sent');_0x4401c2(_0x5576fb[_0x9cc1('0x25')][_0x9cc1('0x23')]);}})['catch'](function(_0x554a5f){logger[_0x9cc1('0x21')](_0x9cc1('0x1d'),_0x346209,_0x554a5f);_0x6dfd1e(_0x554a5f);});});}function respondWithStatusCode(_0x5cdecb,_0x28ff10){_0x28ff10=_0x28ff10||0xcc;return function(_0x1ef313){if(_0x1ef313){return _0x5cdecb['sendStatus'](_0x28ff10);}return _0x5cdecb[_0x9cc1('0x26')](_0x28ff10)['end']();};}function respondWithResult(_0x33904b,_0x5567ef){_0x5567ef=_0x5567ef||0xc8;return function(_0x5f2774){if(_0x5f2774){return _0x33904b[_0x9cc1('0x26')](_0x5567ef)['json'](_0x5f2774);}};}function respondWithFilteredResult(_0x5e4df1,_0x209f6e){return function(_0x370c26){if(_0x370c26){var _0x2176fd=typeof _0x209f6e['offset']===_0x9cc1('0x27')&&typeof _0x209f6e[_0x9cc1('0x28')]===_0x9cc1('0x27');var _0xf78f1=_0x370c26[_0x9cc1('0x29')];var _0x55e154=_0x2176fd?0x0:_0x209f6e[_0x9cc1('0x2a')];var _0xb10083=_0x2176fd?_0x370c26['count']:_0x209f6e[_0x9cc1('0x2a')]+_0x209f6e[_0x9cc1('0x28')];var _0x34837a;if(_0xb10083>=_0xf78f1){_0xb10083=_0xf78f1;_0x34837a=0xc8;}else{_0x34837a=0xce;}_0x5e4df1[_0x9cc1('0x26')](_0x34837a);return _0x5e4df1[_0x9cc1('0x2b')](_0x9cc1('0x2c'),_0x55e154+'-'+_0xb10083+'/'+_0xf78f1)[_0x9cc1('0x2d')](_0x370c26);}return null;};}function patchUpdates(_0x86ffa9){return function(_0x314bcc){try{jsonpatch['apply'](_0x314bcc,_0x86ffa9,!![]);}catch(_0x1ec8f8){return BPromise[_0x9cc1('0x2e')](_0x1ec8f8);}return _0x314bcc[_0x9cc1('0x2f')]();};}function saveUpdates(_0x40ec07,_0x857c13){return function(_0x291c04){if(_0x291c04){return _0x291c04[_0x9cc1('0x30')](_0x40ec07)[_0x9cc1('0x31')](function(_0x2a097c){return _0x2a097c;});}return null;};}function removeEntity(_0x23615e,_0x59b562){return function(_0x269965){if(_0x269965){return _0x269965[_0x9cc1('0x32')]()[_0x9cc1('0x31')](function(){_0x23615e[_0x9cc1('0x26')](0xcc)[_0x9cc1('0x33')]();});}};}function handleEntityNotFound(_0x263849,_0x1785e7){return function(_0x38fb2d){if(!_0x38fb2d){_0x263849['sendStatus'](0x194);}return _0x38fb2d;};}function handleError(_0xb5def6,_0x381d4c){_0x381d4c=_0x381d4c||0x1f4;return function(_0x5dd598){logger[_0x9cc1('0x21')](_0x5dd598['stack']);if(_0x5dd598[_0x9cc1('0x34')]){delete _0x5dd598['name'];}_0xb5def6['status'](_0x381d4c)[_0x9cc1('0x35')](_0x5dd598);};}exports[_0x9cc1('0x36')]=function(_0x4db2cc,_0x2503d0){var _0x55980e={},_0x3fa0fc={},_0x5bb65f={'count':0x0,'rows':[]};var _0x446bfe=_['map'](db[_0x9cc1('0x37')]['rawAttributes'],function(_0x7f2a71){return{'name':_0x7f2a71[_0x9cc1('0x38')],'type':_0x7f2a71[_0x9cc1('0x39')][_0x9cc1('0x3a')]};});_0x3fa0fc['model']=_[_0x9cc1('0x3b')](_0x446bfe,'name');_0x3fa0fc[_0x9cc1('0x3c')]=_[_0x9cc1('0x3d')](_0x4db2cc[_0x9cc1('0x3c')]);_0x3fa0fc[_0x9cc1('0x3e')]=_[_0x9cc1('0x3f')](_0x3fa0fc['model'],_0x3fa0fc['query']);_0x55980e[_0x9cc1('0x40')]=_[_0x9cc1('0x3f')](_0x3fa0fc[_0x9cc1('0x41')],qs[_0x9cc1('0x42')](_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x42')]));_0x55980e[_0x9cc1('0x40')]=_0x55980e[_0x9cc1('0x40')][_0x9cc1('0x43')]?_0x55980e['attributes']:_0x3fa0fc['model'];if(!_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x44')](_0x9cc1('0x45'))){_0x55980e['limit']=qs[_0x9cc1('0x28')](_0x4db2cc['query'][_0x9cc1('0x28')]);_0x55980e[_0x9cc1('0x2a')]=qs[_0x9cc1('0x2a')](_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x2a')]);}_0x55980e['order']=qs[_0x9cc1('0x46')](_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x46')]);_0x55980e[_0x9cc1('0x47')]=qs[_0x9cc1('0x3e')](_[_0x9cc1('0x48')](_0x4db2cc[_0x9cc1('0x3c')],_0x3fa0fc[_0x9cc1('0x3e')]),_0x446bfe);if(_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x49')]){_0x55980e[_0x9cc1('0x47')]=_[_0x9cc1('0x4a')](_0x55980e[_0x9cc1('0x47')],{'$or':_[_0x9cc1('0x3b')](_0x446bfe,function(_0x53de88){if(_0x53de88[_0x9cc1('0x39')]!==_0x9cc1('0x4b')){var _0x3c4bae={};_0x3c4bae[_0x53de88[_0x9cc1('0x34')]]={'$like':'%'+_0x4db2cc[_0x9cc1('0x3c')][_0x9cc1('0x49')]+'%'};return _0x3c4bae;}})});}_0x55980e=_['merge']({},_0x55980e,_0x4db2cc['options']);var _0x17f483={'where':_0x55980e[_0x9cc1('0x47')]};return db[_0x9cc1('0x37')][_0x9cc1('0x29')](_0x17f483)['then'](function(_0x4eff2e){_0x5bb65f['count']=_0x4eff2e;if(_0x4db2cc['query']['includeAll']){_0x55980e['include']=[{'all':!![]}];}return db[_0x9cc1('0x37')][_0x9cc1('0x4c')](_0x55980e);})[_0x9cc1('0x31')](function(_0xec2ae){_0x5bb65f[_0x9cc1('0x4d')]=_0xec2ae;return _0x5bb65f;})[_0x9cc1('0x31')](respondWithFilteredResult(_0x2503d0,_0x55980e))[_0x9cc1('0x4e')](handleError(_0x2503d0,null));};exports[_0x9cc1('0x4f')]=function(_0x514359,_0x1db4bd){var _0x22759f={'raw':![],'where':{'id':_0x514359[_0x9cc1('0x50')]['id']}},_0x5bf629={};_0x5bf629[_0x9cc1('0x41')]=_[_0x9cc1('0x3d')](db[_0x9cc1('0x37')][_0x9cc1('0x51')]);_0x5bf629[_0x9cc1('0x3c')]=_['keys'](_0x514359['query']);_0x5bf629[_0x9cc1('0x3e')]=_['intersection'](_0x5bf629[_0x9cc1('0x41')],_0x5bf629[_0x9cc1('0x3c')]);_0x22759f[_0x9cc1('0x40')]=_[_0x9cc1('0x3f')](_0x5bf629[_0x9cc1('0x41')],qs[_0x9cc1('0x42')](_0x514359[_0x9cc1('0x3c')]['fields']));_0x22759f['attributes']=_0x22759f[_0x9cc1('0x40')][_0x9cc1('0x43')]?_0x22759f['attributes']:_0x5bf629[_0x9cc1('0x41')];if(_0x514359['query'][_0x9cc1('0x52')]){_0x22759f['include']=[{'all':!![]}];}_0x22759f=_['merge']({},_0x22759f,_0x514359['options']);return db[_0x9cc1('0x37')][_0x9cc1('0x53')](_0x22759f)[_0x9cc1('0x31')](handleEntityNotFound(_0x1db4bd,null))[_0x9cc1('0x31')](respondWithResult(_0x1db4bd,null))['catch'](handleError(_0x1db4bd,null));};exports[_0x9cc1('0x30')]=function(_0x1863c2,_0x20ee21){if(_0x1863c2['body']['id']){delete _0x1863c2[_0x9cc1('0x54')]['id'];}return db[_0x9cc1('0x37')][_0x9cc1('0x53')]({'where':{'id':_0x1863c2[_0x9cc1('0x50')]['id']}})[_0x9cc1('0x31')](handleEntityNotFound(_0x20ee21,null))[_0x9cc1('0x31')](saveUpdates(_0x1863c2[_0x9cc1('0x54')],null))[_0x9cc1('0x31')](respondWithResult(_0x20ee21,null))[_0x9cc1('0x4e')](handleError(_0x20ee21,null));};exports[_0x9cc1('0x55')]=function(_0x5bfa55,_0x3fd3c3,_0x3bd83a){if(_0x5bfa55[_0x9cc1('0x56')]&&_0x5bfa55[_0x9cc1('0x56')][_0x9cc1('0x57')]){_0x5bfa55['body']['logo']=_0x5bfa55[_0x9cc1('0x56')]['filename'];}return db['Setting'][_0x9cc1('0x53')]({'where':{'id':_0x5bfa55['params']['id']}})[_0x9cc1('0x31')](handleEntityNotFound(_0x3fd3c3,null))['then'](saveUpdates(_0x5bfa55[_0x9cc1('0x54')],null))['then'](respondWithResult(_0x3fd3c3,null))['catch'](handleError(_0x3fd3c3,null));};exports['addLogoLogin']=function(_0xb42162,_0x5e2a4a,_0x17a1ba){if(_0xb42162[_0x9cc1('0x56')]&&_0xb42162[_0x9cc1('0x56')][_0x9cc1('0x57')]){_0xb42162[_0x9cc1('0x54')][_0x9cc1('0x58')]=_0xb42162[_0x9cc1('0x56')][_0x9cc1('0x57')];}return db[_0x9cc1('0x37')]['find']({'where':{'id':_0xb42162[_0x9cc1('0x50')]['id']}})[_0x9cc1('0x31')](handleEntityNotFound(_0x5e2a4a,null))[_0x9cc1('0x31')](saveUpdates(_0xb42162[_0x9cc1('0x54')],null))[_0x9cc1('0x31')](respondWithResult(_0x5e2a4a,null))[_0x9cc1('0x4e')](handleError(_0x5e2a4a,null));};var utilLicense=require(_0x9cc1('0x19'));exports[_0x9cc1('0x59')]=function(_0xfe3520,_0x245fcd,_0x499eec){var _0x3b14a8=_0x9cc1('0x5a');var _0x120755={'custom':![]};return utilLicense[_0x9cc1('0x5b')]()[_0x9cc1('0x31')](function(_0x44dece){if(_0x44dece){_0x120755=_0x44dece;}return db[_0x9cc1('0x37')][_0x9cc1('0x53')]({'where':{'id':_0xfe3520['params']['id']},'attributes':['logo',_0x9cc1('0x58'),_0x9cc1('0x5c'),'favicon',_0x9cc1('0x5d'),_0x9cc1('0x5e'),_0x9cc1('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x9cc1('0x31')](handleEntityNotFound(_0x245fcd,null))[_0x9cc1('0x31')](function(_0x4c2181){if(_0x4c2181){var _0x4ed024=_0x4c2181[_0x9cc1('0x60')]&&fs[_0x9cc1('0x61')](path['join'](config[_0x9cc1('0x62')],_0x3b14a8,_[_0x9cc1('0x63')](_0x4c2181['logo'])))?path['join'](config['root'],_0x3b14a8,_[_0x9cc1('0x63')](_0x4c2181[_0x9cc1('0x60')])):path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x3b14a8,_[_0x9cc1('0x63')](_0x9cc1('0x65')));var _0x47591c='default'+_[_0x9cc1('0x66')](_0x9cc1('0x60'));if(_0x4c2181[_0x47591c]||!_0x120755[_0x9cc1('0x67')]){_0x4ed024=path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x3b14a8,_[_0x9cc1('0x63')](_0x9cc1('0x65')));}if(!fs['existsSync'](_0x4ed024)){throw new db['Sequelize']['ValidationError'](_[_0x9cc1('0x66')](_0x9cc1('0x60'))+'\x20not\x20found');}return _0x245fcd[_0x9cc1('0x68')](_0x4ed024);}})[_0x9cc1('0x4e')](handleError(_0x245fcd,null));};var utilLicense=require(_0x9cc1('0x19'));exports['getLogoLogin']=function(_0x49c064,_0x4eedab,_0x44ab68){var _0x5e518f=_0x9cc1('0x5a');var _0x366d1b={'custom':![]};return utilLicense[_0x9cc1('0x5b')]()[_0x9cc1('0x31')](function(_0xa5e3c8){if(_0xa5e3c8){_0x366d1b=_0xa5e3c8;}return db['Setting'][_0x9cc1('0x53')]({'where':{'id':_0x49c064[_0x9cc1('0x50')]['id']},'attributes':[_0x9cc1('0x60'),'loginLogo','preferred',_0x9cc1('0x69'),_0x9cc1('0x5d'),_0x9cc1('0x5e'),_0x9cc1('0x5f'),_0x9cc1('0x6a')],'raw':!![]});})[_0x9cc1('0x31')](handleEntityNotFound(_0x4eedab,null))['then'](function(_0x26b06b){if(_0x26b06b){var _0x1ec1e7=_0x26b06b['loginLogo']&&fs[_0x9cc1('0x61')](path[_0x9cc1('0x64')](config['root'],_0x5e518f,_[_0x9cc1('0x63')](_0x26b06b[_0x9cc1('0x58')])))?path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x5e518f,_['toLower'](_0x26b06b['loginLogo'])):path['join'](config['root'],_0x5e518f,_[_0x9cc1('0x63')]('default_loginLogo.svg'));var _0x462723=_0x9cc1('0x6b')+_[_0x9cc1('0x66')](_0x9cc1('0x58'));if(_0x26b06b[_0x462723]||!_0x366d1b[_0x9cc1('0x67')]){_0x1ec1e7=path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x5e518f,_['toLower'](_0x9cc1('0x6c')));}if(!fs[_0x9cc1('0x61')](_0x1ec1e7)){throw new db[(_0x9cc1('0x6d'))]['ValidationError'](_[_0x9cc1('0x66')]('loginLogo')+'\x20not\x20found');}return _0x4eedab[_0x9cc1('0x68')](_0x1ec1e7);}})[_0x9cc1('0x4e')](handleError(_0x4eedab,null));};exports['gdpr']=function(_0x21b152,_0x51ee9c){return db['Setting']['find']({'where':{'id':_0x21b152[_0x9cc1('0x50')]['id']},'attributes':[_0x9cc1('0x6e')]})[_0x9cc1('0x31')](respondWithResult(_0x51ee9c,null))[_0x9cc1('0x4e')](handleError(_0x51ee9c,null));};exports[_0x9cc1('0x6f')]=function(_0xdeb2a,_0x55b842,_0x3d89df){if(_0xdeb2a['file']&&_0xdeb2a[_0x9cc1('0x56')][_0x9cc1('0x57')]){_0xdeb2a['body'][_0x9cc1('0x5c')]=_0xdeb2a[_0x9cc1('0x56')][_0x9cc1('0x57')];}return db[_0x9cc1('0x37')][_0x9cc1('0x53')]({'where':{'id':_0xdeb2a['params']['id']}})[_0x9cc1('0x31')](handleEntityNotFound(_0x55b842,null))[_0x9cc1('0x31')](saveUpdates(_0xdeb2a['body'],null))[_0x9cc1('0x31')](respondWithResult(_0x55b842,null))[_0x9cc1('0x4e')](handleError(_0x55b842,null));};var utilLicense=require(_0x9cc1('0x19'));exports[_0x9cc1('0x70')]=function(_0x20b098,_0x4fdf21,_0x509f5d){var _0x5dabee='server/files/images/logos';var _0x156889={'custom':![]};return utilLicense[_0x9cc1('0x5b')]()['then'](function(_0x1e41e1){if(_0x1e41e1){_0x156889=_0x1e41e1;}return db[_0x9cc1('0x37')][_0x9cc1('0x53')]({'where':{'id':_0x20b098[_0x9cc1('0x50')]['id']},'attributes':[_0x9cc1('0x60'),_0x9cc1('0x58'),_0x9cc1('0x5c'),_0x9cc1('0x69'),'defaultLogo',_0x9cc1('0x5e'),_0x9cc1('0x5f'),_0x9cc1('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x4fdf21,null))[_0x9cc1('0x31')](function(_0xfa2f3){if(_0xfa2f3){var _0x4d1aed=_0xfa2f3[_0x9cc1('0x5c')]&&fs[_0x9cc1('0x61')](path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x5dabee,_[_0x9cc1('0x63')](_0xfa2f3[_0x9cc1('0x5c')])))?path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x5dabee,_[_0x9cc1('0x63')](_0xfa2f3[_0x9cc1('0x5c')])):path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x5dabee,_[_0x9cc1('0x63')]('default_preferred.png'));var _0x149084=_0x9cc1('0x6b')+_[_0x9cc1('0x66')]('preferred');if(_0xfa2f3[_0x149084]||!_0x156889['custom']||!_0x156889[_0x9cc1('0x5c')]){_0x4d1aed=path[_0x9cc1('0x64')](config['root'],_0x5dabee,_[_0x9cc1('0x63')](_0x9cc1('0x71')));}if(!fs[_0x9cc1('0x61')](_0x4d1aed)){throw new db[(_0x9cc1('0x6d'))][(_0x9cc1('0x72'))](_['upperFirst'](_0x9cc1('0x5c'))+_0x9cc1('0x73'));}return _0x4fdf21[_0x9cc1('0x68')](_0x4d1aed);}})[_0x9cc1('0x4e')](handleError(_0x4fdf21,null));};exports[_0x9cc1('0x74')]=function(_0x49a4b7,_0x813946,_0x4723cb){if(_0x49a4b7[_0x9cc1('0x56')]&&_0x49a4b7[_0x9cc1('0x56')][_0x9cc1('0x57')]){_0x49a4b7['body'][_0x9cc1('0x69')]=_0x49a4b7[_0x9cc1('0x56')]['filename'];}return db[_0x9cc1('0x37')]['find']({'where':{'id':_0x49a4b7[_0x9cc1('0x50')]['id']}})[_0x9cc1('0x31')](handleEntityNotFound(_0x813946,null))[_0x9cc1('0x31')](saveUpdates(_0x49a4b7['body'],null))[_0x9cc1('0x31')](respondWithResult(_0x813946,null))['catch'](handleError(_0x813946,null));};var utilLicense=require(_0x9cc1('0x19'));exports[_0x9cc1('0x75')]=function(_0x1faf8f,_0x1a7798,_0xfd38c2){var _0x138d25=_0x9cc1('0x5a');var _0xcc0250={'custom':![]};return utilLicense[_0x9cc1('0x5b')]()[_0x9cc1('0x31')](function(_0x88a109){if(_0x88a109){_0xcc0250=_0x88a109;}return db['Setting'][_0x9cc1('0x53')]({'where':{'id':_0x1faf8f['params']['id']},'attributes':[_0x9cc1('0x60'),_0x9cc1('0x58'),_0x9cc1('0x5c'),_0x9cc1('0x69'),_0x9cc1('0x5d'),'defaultLoginLogo',_0x9cc1('0x5f'),_0x9cc1('0x6a')],'raw':!![]});})[_0x9cc1('0x31')](handleEntityNotFound(_0x1a7798,null))['then'](function(_0x2f1c9c){if(_0x2f1c9c){var _0xe7c045=_0x2f1c9c[_0x9cc1('0x69')]&&fs[_0x9cc1('0x61')](path['join'](config[_0x9cc1('0x62')],_0x138d25,_[_0x9cc1('0x63')](_0x2f1c9c[_0x9cc1('0x69')])))?path[_0x9cc1('0x64')](config[_0x9cc1('0x62')],_0x138d25,_[_0x9cc1('0x63')](_0x2f1c9c[_0x9cc1('0x69')])):path['join'](config[_0x9cc1('0x62')],_0x138d25,_[_0x9cc1('0x63')](_0x9cc1('0x76')));var _0x2804eb=_0x9cc1('0x6b')+_[_0x9cc1('0x66')](_0x9cc1('0x69'));if(_0x2f1c9c[_0x2804eb]||!_0xcc0250['custom']){_0xe7c045=path['join'](config[_0x9cc1('0x62')],_0x138d25,_['toLower']('default_favicon.ico'));}if(!fs[_0x9cc1('0x61')](_0xe7c045)){throw new db[(_0x9cc1('0x6d'))][(_0x9cc1('0x72'))](_[_0x9cc1('0x66')](_0x9cc1('0x69'))+'\x20not\x20found');}return _0x1a7798[_0x9cc1('0x68')](_0xe7c045);}})[_0x9cc1('0x4e')](handleError(_0x1a7798,null));};exports['getDate']=function(_0x5ceaaf,_0x5477c3){var _0x33d200={'offset':moment()[_0x9cc1('0x77')]()};_0x33d200[_0x9cc1('0x78')]=moment()[_0x9cc1('0x77')](_0x33d200[_0x9cc1('0x2a')])[_0x9cc1('0x79')](_0x9cc1('0x7a'));return _0x5477c3['status'](0xc8)[_0x9cc1('0x35')](_0x33d200);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e89970a..2d136d8 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(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x008c,0x188));var _0xc008=function(_0x1819bd,_0x15e90e){_0x1819bd=_0x1819bd-0x0;var _0x5b5f76=_0x008c[_0x1819bd];return _0x5b5f76;};'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(_0x23ac30,_0x2a1d00){var _0x208fec=function(_0x23213a){while(--_0x23213a){_0x23ac30['push'](_0x23ac30['shift']());}};_0x208fec(++_0x2a1d00);}(_0x3e74,0x175));var _0x43e7=function(_0xd54d2f,_0x26932f){_0xd54d2f=_0xd54d2f-0x0;var _0x2fdd4d=_0x3e74[_0xd54d2f];return _0x2fdd4d;};'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 0bc4423..0ecfb12 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 _0x3510=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','catch','ShowSetting','Setting','find','options','attributes','include','map','model','stringify','lodash','util','bluebird'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x3510,0x1a1));var _0x0351=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3510[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x0351('0x0'));var util=require(_0x0351('0x1'));var moment=require('moment');var BPromise=require(_0x0351('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0351('0x3'));var db=require(_0x0351('0x4'))['db'];var utils=require(_0x0351('0x5'));var logger=require(_0x0351('0x6'))(_0x0351('0x7'));var config=require(_0x0351('0x8'));var jayson=require(_0x0351('0x9'));var client=jayson[_0x0351('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b54e0,_0x1880d8,_0x10dccd){return new BPromise(function(_0x3c0dfe,_0x2c718e){return client[_0x0351('0xb')](_0x5b54e0,_0x10dccd)[_0x0351('0xc')](function(_0x5519b9){logger[_0x0351('0xd')](_0x0351('0xe'),_0x1880d8,_0x0351('0xf'));logger[_0x0351('0x10')](_0x0351('0x11'),_0x1880d8,_0x0351('0xf'),JSON['stringify'](_0x5519b9));if(_0x5519b9[_0x0351('0x12')]){if(_0x5519b9[_0x0351('0x12')]['code']===0x1f4){logger[_0x0351('0x12')](_0x0351('0xe'),_0x1880d8,_0x5519b9[_0x0351('0x12')]['message']);return _0x2c718e(_0x5519b9[_0x0351('0x12')][_0x0351('0x13')]);}logger[_0x0351('0x12')](_0x0351('0xe'),_0x1880d8,_0x5519b9['error'][_0x0351('0x13')]);return _0x3c0dfe(_0x5519b9['error'][_0x0351('0x13')]);}else{logger[_0x0351('0xd')](_0x0351('0xe'),_0x1880d8,_0x0351('0xf'));_0x3c0dfe(_0x5519b9['result'][_0x0351('0x13')]);}})[_0x0351('0x14')](function(_0x15309c){logger[_0x0351('0x12')](_0x0351('0xe'),_0x1880d8,_0x15309c);_0x2c718e(_0x15309c);});});}exports[_0x0351('0x15')]=function(_0x59f06b){var _0xeac65f=this;return new Promise(function(_0xd3f132,_0x5be4d4){return db[_0x0351('0x16')][_0x0351('0x17')]({'raw':_0x59f06b[_0x0351('0x18')]?_0x59f06b[_0x0351('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x59f06b[_0x0351('0x18')]?_0x59f06b[_0x0351('0x18')]['where']||null:null,'attributes':_0x59f06b['options']?_0x59f06b[_0x0351('0x18')][_0x0351('0x19')]||null:null,'include':_0x59f06b['options']?_0x59f06b[_0x0351('0x18')][_0x0351('0x1a')]?_['map'](_0x59f06b[_0x0351('0x18')]['include'],function(_0x4252f9){return{'model':db[_0x4252f9['model']],'as':_0x4252f9['as'],'attributes':_0x4252f9[_0x0351('0x19')],'include':_0x4252f9[_0x0351('0x1a')]?_[_0x0351('0x1b')](_0x4252f9[_0x0351('0x1a')],function(_0x401a04){return{'model':db[_0x401a04['model']],'as':_0x401a04['as'],'attributes':_0x401a04[_0x0351('0x19')],'include':_0x401a04['include']?_[_0x0351('0x1b')](_0x401a04[_0x0351('0x1a')],function(_0x2c06ee){return{'model':db[_0x2c06ee[_0x0351('0x1c')]],'as':_0x2c06ee['as'],'attributes':_0x2c06ee[_0x0351('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b1cc2){logger[_0x0351('0xd')](_0x0351('0x15'),_0x59f06b);logger[_0x0351('0x10')]('ShowSetting',_0x59f06b,JSON[_0x0351('0x1d')](_0x4b1cc2));_0xd3f132(_0x4b1cc2);})[_0x0351('0x14')](function(_0x1bcc28){logger[_0x0351('0x12')](_0x0351('0x15'),_0x1bcc28[_0x0351('0x13')],_0x59f06b);_0x5be4d4(_0xeac65f[_0x0351('0x12')](0x1f4,_0x1bcc28['message']));});});}; \ No newline at end of file +var _0x7299=['info','ShowSetting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','find','options','raw','where','include','map','attributes','model','then'];(function(_0x30f260,_0x3b3b6f){var _0x53fdd7=function(_0x1ef607){while(--_0x1ef607){_0x30f260['push'](_0x30f260['shift']());}};_0x53fdd7(++_0x3b3b6f);}(_0x7299,0xbc));var _0x9729=function(_0x40787a,_0x5c79ba){_0x40787a=_0x40787a-0x0;var _0x57a63d=_0x7299[_0x40787a];return _0x57a63d;};'use strict';var _=require('lodash');var util=require(_0x9729('0x0'));var moment=require(_0x9729('0x1'));var BPromise=require(_0x9729('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9729('0x3'));var db=require(_0x9729('0x4'))['db'];var utils=require(_0x9729('0x5'));var logger=require('../../config/logger')(_0x9729('0x6'));var config=require(_0x9729('0x7'));var jayson=require(_0x9729('0x8'));var client=jayson['client'][_0x9729('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58b442,_0x41bf2e,_0x15fe87){return new BPromise(function(_0x362fe7,_0x5cbc04){return client[_0x9729('0xa')](_0x58b442,_0x15fe87)['then'](function(_0x36a94f){logger['info']('Setting,\x20%s,\x20%s',_0x41bf2e,_0x9729('0xb'));logger[_0x9729('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x41bf2e,_0x9729('0xb'),JSON[_0x9729('0xd')](_0x36a94f));if(_0x36a94f[_0x9729('0xe')]){if(_0x36a94f['error'][_0x9729('0xf')]===0x1f4){logger['error'](_0x9729('0x10'),_0x41bf2e,_0x36a94f[_0x9729('0xe')][_0x9729('0x11')]);return _0x5cbc04(_0x36a94f['error'][_0x9729('0x11')]);}logger[_0x9729('0xe')](_0x9729('0x10'),_0x41bf2e,_0x36a94f[_0x9729('0xe')][_0x9729('0x11')]);return _0x362fe7(_0x36a94f['error'][_0x9729('0x11')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x41bf2e,_0x9729('0xb'));_0x362fe7(_0x36a94f[_0x9729('0x12')][_0x9729('0x11')]);}})[_0x9729('0x13')](function(_0x570b39){logger[_0x9729('0xe')](_0x9729('0x10'),_0x41bf2e,_0x570b39);_0x5cbc04(_0x570b39);});});}exports['ShowSetting']=function(_0x1a4fb9){var _0x418a5d=this;return new Promise(function(_0x1d3c9f,_0x268d12){return db['Setting'][_0x9729('0x14')]({'raw':_0x1a4fb9[_0x9729('0x15')]?_0x1a4fb9[_0x9729('0x15')][_0x9729('0x16')]===undefined?!![]:![]:!![],'where':_0x1a4fb9['options']?_0x1a4fb9['options'][_0x9729('0x17')]||null:null,'attributes':_0x1a4fb9['options']?_0x1a4fb9[_0x9729('0x15')]['attributes']||null:null,'include':_0x1a4fb9['options']?_0x1a4fb9[_0x9729('0x15')][_0x9729('0x18')]?_[_0x9729('0x19')](_0x1a4fb9[_0x9729('0x15')][_0x9729('0x18')],function(_0x1387b3){return{'model':db[_0x1387b3['model']],'as':_0x1387b3['as'],'attributes':_0x1387b3[_0x9729('0x1a')],'include':_0x1387b3['include']?_[_0x9729('0x19')](_0x1387b3[_0x9729('0x18')],function(_0x3446e8){return{'model':db[_0x3446e8[_0x9729('0x1b')]],'as':_0x3446e8['as'],'attributes':_0x3446e8[_0x9729('0x1a')],'include':_0x3446e8[_0x9729('0x18')]?_[_0x9729('0x19')](_0x3446e8['include'],function(_0xb0a0b0){return{'model':db[_0xb0a0b0[_0x9729('0x1b')]],'as':_0xb0a0b0['as'],'attributes':_0xb0a0b0[_0x9729('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9729('0x1c')](function(_0x329c8c){logger[_0x9729('0x1d')](_0x9729('0x1e'),_0x1a4fb9);logger[_0x9729('0xc')](_0x9729('0x1e'),_0x1a4fb9,JSON[_0x9729('0xd')](_0x329c8c));_0x1d3c9f(_0x329c8c);})[_0x9729('0x13')](function(_0x25f8d9){logger[_0x9729('0xe')](_0x9729('0x1e'),_0x25f8d9['message'],_0x1a4fb9);_0x268d12(_0x418a5d[_0x9729('0xe')](0x1f4,_0x25f8d9['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 6cf67ec..469c2d3 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2cc26e,_0x443f64){var _0x1f45a1=function(_0x4e775f){while(--_0x4e775f){_0x2cc26e['push'](_0x2cc26e['shift']());}};_0x1f45a1(++_0x443f64);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x5699e4,_0x5cf33a){var _0x335ec1=function(_0x1edd14){while(--_0x1edd14){_0x5699e4['push'](_0x5699e4['shift']());}};_0x335ec1(++_0x5cf33a);}(_0x53ec,0x192));var _0xc53e=function(_0x49adfe,_0x2fd329){_0x49adfe=_0x49adfe-0x0;var _0x1d53da=_0x53ec[_0x49adfe];return _0x1d53da;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index bd4807f..672b5a4 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 _0xde1f=['twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','exports','name','STRING','generate'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0xde1f,0xa3));var _0xfde1=function(_0xf8e45b,_0x336e08){_0xf8e45b=_0xf8e45b-0x0;var _0xb38c41=_0xde1f[_0xf8e45b];return _0xb38c41;};'use strict';var Sequelize=require(_0xfde1('0x0'));var rs=require('randomstring');module[_0xfde1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfde1('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xfde1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xfde1('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xfde1('0x3')],'defaultValue':function(){return rs[_0xfde1('0x4')]();}},'phone':{'type':Sequelize[_0xfde1('0x3')]},'type':{'type':Sequelize['ENUM'](_0xfde1('0x5'),_0xfde1('0x6'),_0xfde1('0x7'),_0xfde1('0x8'),_0xfde1('0x9'),_0xfde1('0xa'),_0xfde1('0xb'),_0xfde1('0xc'),_0xfde1('0xd'),_0xfde1('0xe'))},'accountSid':{'type':Sequelize[_0xfde1('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xfde1('0xf')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfde1('0x3')]},'password':{'type':Sequelize[_0xfde1('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xfde1('0x3')]},'senderString':{'type':Sequelize[_0xfde1('0x3')]},'deliveryReport':{'type':Sequelize[_0xfde1('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xfde1('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfde1('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfde1('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfde1('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfde1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfde1('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfde1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfde1('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfde1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfde1('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfde1('0x12')],'comment':_0xfde1('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x18ec15){if(!_0x18ec15)this[_0xfde1('0x14')]('mandatoryDispositionPauseId',null);this[_0xfde1('0x14')]('mandatoryDisposition',_0x18ec15);}}}; \ No newline at end of file +var _0x6a03=['name','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x4165f0,_0xbbeb17){var _0x11e25e=function(_0xe94972){while(--_0xe94972){_0x4165f0['push'](_0x4165f0['shift']());}};_0x11e25e(++_0xbbeb17);}(_0x6a03,0x74));var _0x36a0=function(_0x210203,_0x3a2712){_0x210203=_0x210203-0x0;var _0x5396f6=_0x6a03[_0x210203];return _0x5396f6;};'use strict';var Sequelize=require(_0x36a0('0x0'));var rs=require(_0x36a0('0x1'));module[_0x36a0('0x2')]={'name':{'type':Sequelize[_0x36a0('0x3')],'unique':_0x36a0('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x36a0('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x36a0('0x3')]},'type':{'type':Sequelize[_0x36a0('0x5')](_0x36a0('0x6'),_0x36a0('0x7'),_0x36a0('0x8'),_0x36a0('0x9'),_0x36a0('0xa'),_0x36a0('0xb'),_0x36a0('0xc'),'csc',_0x36a0('0xd'),_0x36a0('0xe'))},'accountSid':{'type':Sequelize[_0x36a0('0x3')]},'authId':{'type':Sequelize[_0x36a0('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x36a0('0x3')]},'password':{'type':Sequelize[_0x36a0('0x3')]},'apiKey':{'type':Sequelize[_0x36a0('0x3')]},'applicationId':{'type':Sequelize[_0x36a0('0x3')]},'accountId':{'type':Sequelize[_0x36a0('0x3')]},'senderString':{'type':Sequelize[_0x36a0('0x3')]},'deliveryReport':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x36a0('0x10')],'defaultValue':function(){return _0x36a0('0x11');}},'notificationSound':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x36a0('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x36a0('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x36a0('0x12')],'comment':_0x36a0('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x36a0('0xf')],'defaultValue':![],'comment':_0x36a0('0x14'),'set':function(_0x5c6c8d){if(!_0x5c6c8d)this[_0x36a0('0x15')](_0x36a0('0x16'),null);this['setDataValue'](_0x36a0('0x17'),_0x5c6c8d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f94948a..06fc179 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 _0x320c=['code','message','SmsAccount,\x20%s,\x20%s','result','catch','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','destroy','get','SmsAccounts','sendStatus','stack','name','send','Pause','map','SmsAccount','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','getDispositions','Disposition','include','findAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','mobile','twilio','From','skebby','from','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','mapKey','includes','CmList','CmContact','Contacts','DESC','list','omit','SmsInteraction','spread','created','push','close','unmanaged','*,*,*,*','interaction','SmsMessage','ContactId','UserId','User','unshift','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','update','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2d12fe,_0x2f641c){var _0x392414=function(_0x581caf){while(--_0x581caf){_0x2d12fe['push'](_0x2d12fe['shift']());}};_0x392414(++_0x2f641c);}(_0x320c,0x19c));var _0xc320=function(_0x169198,_0x26227c){_0x169198=_0x169198-0x0;var _0x5cc014=_0x320c[_0x169198];return _0x5cc014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc320('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc320('0x1'));var rp=require(_0xc320('0x2'));var moment=require(_0xc320('0x3'));var BPromise=require(_0xc320('0x4'));var Mustache=require('mustache');var util=require(_0xc320('0x5'));var path=require(_0xc320('0x6'));var sox=require(_0xc320('0x7'));var csv=require(_0xc320('0x8'));var ejs=require(_0xc320('0x9'));var fs=require('fs');var fs_extra=require(_0xc320('0xa'));var _=require(_0xc320('0xb'));var squel=require(_0xc320('0xc'));var crypto=require(_0xc320('0xd'));var jsforce=require(_0xc320('0xe'));var deskjs=require(_0xc320('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc320('0x10'));var Redis=require(_0xc320('0x11'));var authService=require(_0xc320('0x12'));var qs=require(_0xc320('0x13'));var as=require(_0xc320('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc320('0x15'));var utils=require(_0xc320('0x16'));var config=require(_0xc320('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc320('0x18'))['db'];config[_0xc320('0x19')]=_[_0xc320('0x1a')](config[_0xc320('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc320('0x1b'))(new Redis(config[_0xc320('0x19')]));require(_0xc320('0x1c'))[_0xc320('0x1d')](socket);var jayson=require(_0xc320('0x1e'));var client=jayson[_0xc320('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3537c7,_0x138298,_0x3541a9,_0x39faf1){return new BPromise(function(_0x115a96,_0x5c219c){var _0x4103c8=_0x39faf1||client;return _0x4103c8[_0xc320('0x20')](_0x3537c7,_0x3541a9)[_0xc320('0x21')](function(_0x1464b2){logger[_0xc320('0x22')]('SmsAccount,\x20%s,\x20%s',_0x138298,_0xc320('0x23'));logger[_0xc320('0x24')](_0xc320('0x25'),_0x138298,_0xc320('0x23'),JSON[_0xc320('0x26')](_0x1464b2));if(_0x1464b2[_0xc320('0x27')]){if(_0x1464b2['error'][_0xc320('0x28')]===0x1f4){logger[_0xc320('0x27')]('SmsAccount,\x20%s,\x20%s',_0x138298,_0x1464b2[_0xc320('0x27')]['message']);return _0x5c219c(_0x1464b2['error']['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x138298,_0x1464b2['error']['message']);return _0x115a96(_0x1464b2['error'][_0xc320('0x29')]);}else{logger[_0xc320('0x22')](_0xc320('0x2a'),_0x138298,_0xc320('0x23'));_0x115a96(_0x1464b2[_0xc320('0x2b')][_0xc320('0x29')]);}})[_0xc320('0x2c')](function(_0x4c4e42){logger['error'](_0xc320('0x2a'),_0x138298,_0x4c4e42);_0x5c219c(_0x4c4e42);});});}function respondWithStatusCode(_0x48eb79,_0x2b7a6a){_0x2b7a6a=_0x2b7a6a||0xcc;return function(_0x38a4b9){if(_0x38a4b9){return _0x48eb79['sendStatus'](_0x2b7a6a);}return _0x48eb79[_0xc320('0x2d')](_0x2b7a6a)[_0xc320('0x2e')]();};}function respondWithResult(_0x1f0451,_0x3fcc20){_0x3fcc20=_0x3fcc20||0xc8;return function(_0x7c4948){if(_0x7c4948){return _0x1f0451[_0xc320('0x2d')](_0x3fcc20)[_0xc320('0x2f')](_0x7c4948);}};}function respondWithFilteredResult(_0xd608d,_0x114f3c){return function(_0x5d1d22){if(_0x5d1d22){var _0x42d5cf=typeof _0x114f3c['offset']===_0xc320('0x30')&&typeof _0x114f3c['limit']===_0xc320('0x30');var _0xfb6b40=_0x5d1d22[_0xc320('0x31')];var _0x4a968a=_0x42d5cf?0x0:_0x114f3c['offset'];var _0x4cfd09=_0x42d5cf?_0x5d1d22[_0xc320('0x31')]:_0x114f3c['offset']+_0x114f3c[_0xc320('0x32')];var _0x3226e0;if(_0x4cfd09>=_0xfb6b40){_0x4cfd09=_0xfb6b40;_0x3226e0=0xc8;}else{_0x3226e0=0xce;}_0xd608d[_0xc320('0x2d')](_0x3226e0);return _0xd608d[_0xc320('0x33')](_0xc320('0x34'),_0x4a968a+'-'+_0x4cfd09+'/'+_0xfb6b40)[_0xc320('0x2f')](_0x5d1d22);}return null;};}function patchUpdates(_0x2a3f12){return function(_0xb21c37){try{jsonpatch[_0xc320('0x35')](_0xb21c37,_0x2a3f12,!![]);}catch(_0x51425d){return BPromise[_0xc320('0x36')](_0x51425d);}return _0xb21c37['save']();};}function saveUpdates(_0x134707,_0x3cc55b){return function(_0x4d8ffc){if(_0x4d8ffc){return _0x4d8ffc['update'](_0x134707)[_0xc320('0x21')](function(_0x36284d){return _0x36284d;});}return null;};}function removeEntity(_0xc33cf,_0xa7779f){return function(_0x171126){if(_0x171126){return _0x171126[_0xc320('0x37')]()[_0xc320('0x21')](function(){var _0x560c48=_0x171126[_0xc320('0x38')]({'plain':!![]});var _0xbe773f=_0xc320('0x39');return db['UserProfileResource'][_0xc320('0x37')]({'where':{'type':_0xbe773f,'resourceId':_0x560c48['id']}})['then'](function(){return _0x171126;});})[_0xc320('0x21')](function(){_0xc33cf['status'](0xcc)[_0xc320('0x2e')]();});}};}function handleEntityNotFound(_0x40ba99,_0x31b55f){return function(_0x1911a0){if(!_0x1911a0){_0x40ba99[_0xc320('0x3a')](0x194);}return _0x1911a0;};}function handleError(_0x25d9e7,_0xa3e593){_0xa3e593=_0xa3e593||0x1f4;return function(_0x357afa){logger[_0xc320('0x27')](_0x357afa[_0xc320('0x3b')]);if(_0x357afa[_0xc320('0x3c')]){delete _0x357afa[_0xc320('0x3c')];}_0x25d9e7[_0xc320('0x2d')](_0xa3e593)[_0xc320('0x3d')](_0x357afa);};}exports['index']=function(_0x4e415d,_0x4f25c9){var _0x3f598d={'include':[{'model':db[_0xc320('0x3e')],'as':'mandatoryDispositionPause'}]},_0x399e12={},_0x13dda7={'count':0x0,'rows':[]};var _0x5aa9b3=_[_0xc320('0x3f')](db[_0xc320('0x40')]['rawAttributes'],function(_0x2e90a7){return{'name':_0x2e90a7[_0xc320('0x41')],'type':_0x2e90a7[_0xc320('0x42')][_0xc320('0x43')]};});_0x399e12[_0xc320('0x44')]=_['map'](_0x5aa9b3,'name');_0x399e12[_0xc320('0x45')]=_['keys'](_0x4e415d['query']);_0x399e12['filters']=_[_0xc320('0x46')](_0x399e12[_0xc320('0x44')],_0x399e12[_0xc320('0x45')]);_0x3f598d[_0xc320('0x47')]=_[_0xc320('0x46')](_0x399e12[_0xc320('0x44')],qs[_0xc320('0x48')](_0x4e415d[_0xc320('0x45')][_0xc320('0x48')]));_0x3f598d[_0xc320('0x47')]=_0x3f598d['attributes']['length']?_0x3f598d[_0xc320('0x47')]:_0x399e12['model'];if(!_0x4e415d[_0xc320('0x45')][_0xc320('0x49')](_0xc320('0x4a'))){_0x3f598d[_0xc320('0x32')]=qs['limit'](_0x4e415d[_0xc320('0x45')]['limit']);_0x3f598d['offset']=qs[_0xc320('0x4b')](_0x4e415d[_0xc320('0x45')][_0xc320('0x4b')]);}_0x3f598d[_0xc320('0x4c')]=qs[_0xc320('0x4d')](_0x4e415d['query'][_0xc320('0x4d')]);_0x3f598d[_0xc320('0x4e')]=qs[_0xc320('0x4f')](_[_0xc320('0x50')](_0x4e415d['query'],_0x399e12[_0xc320('0x4f')]),_0x5aa9b3);if(_0x4e415d[_0xc320('0x45')][_0xc320('0x51')]){_0x3f598d['where']=_[_0xc320('0x52')](_0x3f598d[_0xc320('0x4e')],{'$or':_[_0xc320('0x3f')](_0x5aa9b3,function(_0x5bc038){if(_0x5bc038[_0xc320('0x42')]!==_0xc320('0x53')){var _0x578e59={};_0x578e59[_0x5bc038[_0xc320('0x3c')]]={'$like':'%'+_0x4e415d['query'][_0xc320('0x51')]+'%'};return _0x578e59;}})});}_0x3f598d=_[_0xc320('0x52')]({},_0x3f598d,_0x4e415d[_0xc320('0x54')]);var _0x4b0f41={'where':_0x3f598d[_0xc320('0x4e')]};return db[_0xc320('0x40')][_0xc320('0x31')](_0x4b0f41)[_0xc320('0x21')](function(_0x1fabb0){_0x13dda7[_0xc320('0x31')]=_0x1fabb0;if(_0x4e415d[_0xc320('0x45')][_0xc320('0x55')]){_0x3f598d['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x3f598d);})[_0xc320('0x21')](function(_0x403c6d){_0x13dda7[_0xc320('0x56')]=_0x403c6d;return _0x13dda7;})['then'](respondWithFilteredResult(_0x4f25c9,_0x3f598d))[_0xc320('0x2c')](handleError(_0x4f25c9,null));};exports[_0xc320('0x57')]=function(_0x4414a8,_0x4d47c6){var _0x13f01c={'raw':![],'where':{'id':_0x4414a8[_0xc320('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xc320('0x59')}]},_0x497681={};_0x497681['model']=_[_0xc320('0x5a')](db[_0xc320('0x40')][_0xc320('0x5b')]);_0x497681['query']=_[_0xc320('0x5a')](_0x4414a8[_0xc320('0x45')]);_0x497681[_0xc320('0x4f')]=_[_0xc320('0x46')](_0x497681['model'],_0x497681[_0xc320('0x45')]);_0x13f01c[_0xc320('0x47')]=_[_0xc320('0x46')](_0x497681['model'],qs[_0xc320('0x48')](_0x4414a8[_0xc320('0x45')][_0xc320('0x48')]));_0x13f01c[_0xc320('0x47')]=_0x13f01c[_0xc320('0x47')][_0xc320('0x5c')]?_0x13f01c[_0xc320('0x47')]:_0x497681[_0xc320('0x44')];if(_0x4414a8['query'][_0xc320('0x55')]){_0x13f01c['include']=[{'all':!![]}];}_0x13f01c=_[_0xc320('0x52')]({},_0x13f01c,_0x4414a8['options']);return db[_0xc320('0x40')][_0xc320('0x5d')](_0x13f01c)[_0xc320('0x21')](handleEntityNotFound(_0x4d47c6,null))[_0xc320('0x21')](respondWithResult(_0x4d47c6,null))[_0xc320('0x2c')](handleError(_0x4d47c6,null));};exports[_0xc320('0x5e')]=function(_0x3bb306,_0x5d6dc1){return db[_0xc320('0x40')][_0xc320('0x5e')](_0x3bb306[_0xc320('0x5f')],{})[_0xc320('0x21')](function(_0x1ca29a){var _0x442800=_0x3bb306['user']['get']({'plain':!![]});if(!_0x442800)throw new Error(_0xc320('0x60'));if(_0x442800[_0xc320('0x61')]===_0xc320('0x62')){var _0x4d1f34=_0x1ca29a[_0xc320('0x38')]({'plain':!![]});var _0x18e16a='SmsAccounts';return db['UserProfileSection'][_0xc320('0x5d')]({'where':{'name':_0x18e16a,'userProfileId':_0x442800[_0xc320('0x63')]},'raw':!![]})[_0xc320('0x21')](function(_0x1920ff){if(_0x1920ff&&_0x1920ff['autoAssociation']===0x0){return db[_0xc320('0x64')][_0xc320('0x5e')]({'name':_0x4d1f34[_0xc320('0x3c')],'resourceId':_0x4d1f34['id'],'type':_0x1920ff[_0xc320('0x3c')],'sectionId':_0x1920ff['id']},{})[_0xc320('0x21')](function(){return _0x1ca29a;});}else{return _0x1ca29a;}})['catch'](function(_0x55cd8d){logger['error'](_0xc320('0x65'),_0x55cd8d);throw _0x55cd8d;});}return _0x1ca29a;})['then'](respondWithResult(_0x5d6dc1,0xc9))[_0xc320('0x2c')](handleError(_0x5d6dc1,null));};exports['update']=function(_0x5e918f,_0x30d09c){if(_0x5e918f['body']['id']){delete _0x5e918f[_0xc320('0x5f')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5e918f[_0xc320('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xc320('0x59')}]})[_0xc320('0x21')](handleEntityNotFound(_0x30d09c,null))[_0xc320('0x21')](saveUpdates(_0x5e918f[_0xc320('0x5f')],null))[_0xc320('0x21')](respondWithResult(_0x30d09c,null))[_0xc320('0x2c')](handleError(_0x30d09c,null));};exports[_0xc320('0x37')]=function(_0x1217d9,_0x3dc9d6){return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x1217d9[_0xc320('0x58')]['id']}})['then'](handleEntityNotFound(_0x3dc9d6,null))['then'](removeEntity(_0x3dc9d6,null))[_0xc320('0x2c')](handleError(_0x3dc9d6,null));};exports['describe']=function(_0x9e900e,_0x192cd4){return db['SmsAccount'][_0xc320('0x66')]()[_0xc320('0x21')](respondWithResult(_0x192cd4,null))['catch'](handleError(_0x192cd4,null));};exports['addDisposition']=function(_0x5bc6e9,_0x4dfe98,_0xe6aa44){if(_0x5bc6e9[_0xc320('0x5f')]['id']){delete _0x5bc6e9[_0xc320('0x5f')]['id'];}return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x5bc6e9[_0xc320('0x58')]['id']}})['then'](handleEntityNotFound(_0x4dfe98,null))['then'](function(_0x54ba87){if(_0x54ba87){_0x5bc6e9[_0xc320('0x5f')][_0xc320('0x67')]=_0x54ba87['id'];return db['Disposition']['create'](_0x5bc6e9[_0xc320('0x5f')]);}})[_0xc320('0x21')](respondWithResult(_0x4dfe98,null))[_0xc320('0x2c')](handleError(_0x4dfe98,null));};exports[_0xc320('0x68')]=function(_0x341732,_0x44c279,_0x4b64e2){var _0x749830={'raw':![],'where':{}};var _0x24667e={};var _0x38a5aa={'count':0x0,'rows':[]};return db[_0xc320('0x40')]['findOne']({'where':{'id':_0x341732[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x44c279,null))['then'](function(_0x35a3ba){if(_0x35a3ba){_0x24667e['model']=_[_0xc320('0x5a')](db['Disposition'][_0xc320('0x5b')]);_0x24667e[_0xc320('0x45')]=_[_0xc320('0x5a')](_0x341732['query']);_0x24667e[_0xc320('0x4f')]=_[_0xc320('0x46')](_0x24667e[_0xc320('0x44')],_0x24667e[_0xc320('0x45')]);_0x749830[_0xc320('0x47')]=_[_0xc320('0x46')](_0x24667e[_0xc320('0x44')],qs[_0xc320('0x48')](_0x341732[_0xc320('0x45')][_0xc320('0x48')]));_0x749830[_0xc320('0x47')]=_0x749830['attributes'][_0xc320('0x5c')]?_0x749830['attributes']:_0x24667e['model'];if(!_0x341732[_0xc320('0x45')]['hasOwnProperty']('nolimit')){_0x749830[_0xc320('0x32')]=qs[_0xc320('0x32')](_0x341732[_0xc320('0x45')][_0xc320('0x32')]);_0x749830['offset']=qs[_0xc320('0x4b')](_0x341732[_0xc320('0x45')][_0xc320('0x4b')]);}_0x749830[_0xc320('0x4c')]=qs[_0xc320('0x4d')](_0x341732[_0xc320('0x45')][_0xc320('0x4d')]);_0x749830['where']=qs[_0xc320('0x4f')](_[_0xc320('0x50')](_0x341732['query'],_0x24667e['filters']));_0x749830[_0xc320('0x4e')][_0xc320('0x67')]=_0x35a3ba['id'];if(_0x341732[_0xc320('0x45')][_0xc320('0x51')]){_0x749830['where']=_['merge'](_0x749830['where'],{'$or':_[_0xc320('0x3f')](_0x749830[_0xc320('0x47')],function(_0x9bcf3f){var _0x3625c9={};_0x3625c9[_0x9bcf3f]={'$like':'%'+_0x341732[_0xc320('0x45')][_0xc320('0x51')]+'%'};return _0x3625c9;})});}_0x749830=_[_0xc320('0x52')]({},_0x749830,_0x341732[_0xc320('0x54')]);return db[_0xc320('0x69')][_0xc320('0x31')]({'where':_0x749830[_0xc320('0x4e')]})[_0xc320('0x21')](function(_0x8dc1d8){_0x38a5aa['count']=_0x8dc1d8;if(_0x341732[_0xc320('0x45')][_0xc320('0x55')]){_0x749830[_0xc320('0x6a')]=[{'all':!![]}];}return db[_0xc320('0x69')][_0xc320('0x6b')](_0x749830);})[_0xc320('0x21')](function(_0x3296aa){_0x38a5aa[_0xc320('0x56')]=_0x3296aa;return _0x38a5aa;});}})[_0xc320('0x21')](respondWithFilteredResult(_0x44c279,_0x749830))[_0xc320('0x2c')](handleError(_0x44c279,null));};exports[_0xc320('0x6c')]=function(_0xa57218,_0x5046a6,_0x36c1cd){return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0xa57218['params']['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x5046a6,null))[_0xc320('0x21')](function(_0x5be92b){if(_0x5be92b){return _0x5be92b[_0xc320('0x6c')](_0xa57218['query'][_0xc320('0x6d')]);}})[_0xc320('0x21')](respondWithStatusCode(_0x5046a6,null))['catch'](handleError(_0x5046a6,null));};exports['addAnswer']=function(_0x528c23,_0x5c27d0,_0x64307d){if(_0x528c23[_0xc320('0x5f')]['id']){delete _0x528c23[_0xc320('0x5f')]['id'];}return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x528c23[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x5c27d0,null))[_0xc320('0x21')](function(_0x43ef34){if(_0x43ef34){_0x528c23[_0xc320('0x5f')][_0xc320('0x67')]=_0x43ef34['id'];return db[_0xc320('0x6e')][_0xc320('0x5e')](_0x528c23[_0xc320('0x5f')]);}})[_0xc320('0x21')](respondWithResult(_0x5c27d0,null))[_0xc320('0x2c')](handleError(_0x5c27d0,null));};exports[_0xc320('0x6f')]=function(_0x48400c,_0x561399,_0x41f27d){var _0x1ffa46={'raw':![],'where':{}};var _0x221010={};var _0x46ce34={'count':0x0,'rows':[]};return db[_0xc320('0x40')][_0xc320('0x70')]({'where':{'id':_0x48400c['params']['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x561399,null))[_0xc320('0x21')](function(_0x3070c5){if(_0x3070c5){_0x221010['model']=_[_0xc320('0x5a')](db[_0xc320('0x6e')]['rawAttributes']);_0x221010[_0xc320('0x45')]=_[_0xc320('0x5a')](_0x48400c[_0xc320('0x45')]);_0x221010[_0xc320('0x4f')]=_['intersection'](_0x221010[_0xc320('0x44')],_0x221010[_0xc320('0x45')]);_0x1ffa46['attributes']=_[_0xc320('0x46')](_0x221010[_0xc320('0x44')],qs[_0xc320('0x48')](_0x48400c[_0xc320('0x45')][_0xc320('0x48')]));_0x1ffa46[_0xc320('0x47')]=_0x1ffa46[_0xc320('0x47')][_0xc320('0x5c')]?_0x1ffa46[_0xc320('0x47')]:_0x221010['model'];if(!_0x48400c['query']['hasOwnProperty'](_0xc320('0x4a'))){_0x1ffa46[_0xc320('0x32')]=qs['limit'](_0x48400c['query'][_0xc320('0x32')]);_0x1ffa46[_0xc320('0x4b')]=qs[_0xc320('0x4b')](_0x48400c[_0xc320('0x45')][_0xc320('0x4b')]);}_0x1ffa46[_0xc320('0x4c')]=qs[_0xc320('0x4d')](_0x48400c[_0xc320('0x45')][_0xc320('0x4d')]);_0x1ffa46[_0xc320('0x4e')]=qs[_0xc320('0x4f')](_['pick'](_0x48400c[_0xc320('0x45')],_0x221010[_0xc320('0x4f')]));_0x1ffa46[_0xc320('0x4e')][_0xc320('0x67')]=_0x3070c5['id'];if(_0x48400c['query'][_0xc320('0x51')]){_0x1ffa46[_0xc320('0x4e')]=_[_0xc320('0x52')](_0x1ffa46[_0xc320('0x4e')],{'$or':_[_0xc320('0x3f')](_0x1ffa46[_0xc320('0x47')],function(_0xb53994){var _0xd38451={};_0xd38451[_0xb53994]={'$like':'%'+_0x48400c[_0xc320('0x45')][_0xc320('0x51')]+'%'};return _0xd38451;})});}_0x1ffa46=_[_0xc320('0x52')]({},_0x1ffa46,_0x48400c[_0xc320('0x54')]);return db['CannedAnswer'][_0xc320('0x31')]({'where':_0x1ffa46[_0xc320('0x4e')]})[_0xc320('0x21')](function(_0x14d54a){_0x46ce34[_0xc320('0x31')]=_0x14d54a;if(_0x48400c[_0xc320('0x45')][_0xc320('0x55')]){_0x1ffa46[_0xc320('0x6a')]=[{'all':!![]}];}return db[_0xc320('0x6e')][_0xc320('0x6b')](_0x1ffa46);})[_0xc320('0x21')](function(_0x54d0c2){_0x46ce34[_0xc320('0x56')]=_0x54d0c2;return _0x46ce34;});}})[_0xc320('0x21')](respondWithFilteredResult(_0x561399,_0x1ffa46))['catch'](handleError(_0x561399,null));};exports['removeAnswers']=function(_0xea436a,_0x464e0f,_0x11fa20){return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0xea436a['params']['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x464e0f,null))['then'](function(_0x5d2321){if(_0x5d2321){return _0x5d2321['removeAnswers'](_0xea436a['query'][_0xc320('0x6d')]);}})[_0xc320('0x21')](respondWithStatusCode(_0x464e0f,null))[_0xc320('0x2c')](handleError(_0x464e0f,null));};exports[_0xc320('0x71')]=function(_0x48ec35,_0x38ef63,_0x5d75f9){var _0x33c0eb={'channel':_0xc320('0x72')};var _0x559d44=[];var _0x57c7fd=[];var _0x178a6d={};return db[_0xc320('0x40')]['find']({'where':{'id':_0x48ec35['params']['id']},'include':[{'model':db[_0xc320('0x73')],'as':'Applications'}]})[_0xc320('0x21')](handleEntityNotFound(_0x38ef63,null))[_0xc320('0x21')](function(_0x47401e){_0x33c0eb[_0xc320('0x74')]=_0x47401e;_0x33c0eb[_0xc320('0x75')]=_[_0xc320('0x76')](_0x47401e[_0xc320('0x77')],[_0xc320('0x78')],[_0xc320('0x79')]);if(_0x33c0eb[_0xc320('0x74')][_0xc320('0x77')]){delete _0x33c0eb['account'][_0xc320('0x77')];}return db['CmContact'][_0xc320('0x66')]();})[_0xc320('0x21')](function(_0x10d44a){if(!_0x10d44a){throw new db[(_0xc320('0x7a'))][(_0xc320('0x7b'))]('no\x20available\x20attributes');}_0x559d44=_['difference'](_[_0xc320('0x5a')](_0x10d44a),[_0xc320('0x7c'),_0xc320('0x7d')]);_0x57c7fd=_[_0xc320('0x7e')](_['keys'](_0x10d44a),[_0xc320('0x7c'),_0xc320('0x7d'),'CompanyId',_0xc320('0x7f')]);_0x33c0eb[_0xc320('0x5f')]={'mapKey':_0xc320('0x80')};if(_0x33c0eb[_0xc320('0x74')][_0xc320('0x42')]){switch(_0x33c0eb[_0xc320('0x74')][_0xc320('0x42')]){case _0xc320('0x81'):_0x33c0eb[_0xc320('0x5f')]['from']=_0x48ec35[_0xc320('0x5f')][_0xc320('0x82')];_0x33c0eb[_0xc320('0x5f')]['body']=_0x48ec35[_0xc320('0x5f')]['Body'];_0x33c0eb['body']['messageId']=_0x48ec35[_0xc320('0x5f')]['MessageSid'];break;case _0xc320('0x83'):_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')]='+'+_0x48ec35['body'][_0xc320('0x85')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x86')];break;case _0xc320('0x87'):_0x33c0eb[_0xc320('0x5f')]['from']=_0x48ec35[_0xc320('0x5f')][_0xc320('0x84')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x29')];break;case _0xc320('0x88'):_0x33c0eb['body'][_0xc320('0x84')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x84')];_0x33c0eb['body']['body']=_0x48ec35[_0xc320('0x5f')][_0xc320('0x5f')];_0x33c0eb['body'][_0xc320('0x89')]=_0x48ec35['body'][_0xc320('0x8a')];break;case _0xc320('0x8b'):_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x82')];_0x33c0eb['body'][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x8c')];_0x33c0eb[_0xc320('0x5f')]['messageId']=_0x48ec35['body'][_0xc320('0x8d')];break;case _0xc320('0x8e'):_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')]='+'+_0x48ec35[_0xc320('0x5f')][_0xc320('0x8f')][0x0][_0xc320('0x84')];_0x33c0eb['body'][_0xc320('0x5f')]=_0x48ec35['body'][_0xc320('0x8f')][0x0][_0xc320('0x86')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x89')]=_0x48ec35['body'][_0xc320('0x8f')][0x0][_0xc320('0x89')];break;case _0xc320('0x90'):_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x91')];_0x33c0eb[_0xc320('0x5f')]['body']=_0x48ec35[_0xc320('0x5f')][_0xc320('0x92')][_0xc320('0x29')];break;case _0xc320('0x93'):_0x33c0eb[_0xc320('0x5f')]['from']=_0x48ec35[_0xc320('0x5f')]['fromNumber'];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x86')];_0x33c0eb['body'][_0xc320('0x89')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x94')];break;case _0xc320('0x95'):_0x33c0eb[_0xc320('0x5f')][_0xc320('0x89')]=_0x48ec35[_0xc320('0x5f')][0x0]['message']['id'];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')]=_0x48ec35[_0xc320('0x5f')][0x0][_0xc320('0x29')][_0xc320('0x84')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][0x0][_0xc320('0x29')][_0xc320('0x86')];break;case _0xc320('0x96'):_0x33c0eb[_0xc320('0x5f')]['from']=_0x48ec35[_0xc320('0x5f')][_0xc320('0x84')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')]=_0x48ec35[_0xc320('0x5f')][_0xc320('0x29')];_0x33c0eb[_0xc320('0x5f')][_0xc320('0x89')]=_0x48ec35[_0xc320('0x5f')]['refid'];break;}}if(_0x33c0eb['body']['id']){delete _0x33c0eb['body']['id'];}if(_[_0xc320('0x97')](_0x33c0eb['body']['from'])){throw new db[(_0xc320('0x7a'))]['ValidationError'](_0xc320('0x98'));}if(_[_0xc320('0x97')](_0x33c0eb[_0xc320('0x5f')][_0xc320('0x5f')])||_0x33c0eb['body'][_0xc320('0x5f')]===''){throw new db[(_0xc320('0x7a'))][(_0xc320('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc320('0x97')](_0x33c0eb[_0xc320('0x5f')][_0xc320('0x99')])){throw new db[(_0xc320('0x7a'))][(_0xc320('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57c7fd);}if(!_[_0xc320('0x9a')](_0x57c7fd,_0x33c0eb['body'][_0xc320('0x99')])){throw new db['Sequelize'][(_0xc320('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57c7fd);}_0x178a6d[_0x33c0eb['body']['mapKey']]=_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')];return db[_0xc320('0x9b')][_0xc320('0x5d')]({'where':{'id':_0x33c0eb['account'][_0xc320('0x7f')]},'include':[{'model':db[_0xc320('0x9c')],'as':_0xc320('0x9d'),'where':_0x178a6d,'limit':0x1,'order':[['updatedAt',_0xc320('0x9e')]]}]});})[_0xc320('0x21')](handleEntityNotFound(_0x38ef63,null))[_0xc320('0x21')](function(_0x5aeb87){if(_0x5aeb87){_0x33c0eb[_0xc320('0x9f')]=_[_0xc320('0xa0')](_0x5aeb87,['Contacts']);if(_0x5aeb87[_0xc320('0x9d')][_0xc320('0x5c')]){return _0x5aeb87[_0xc320('0x9d')][0x0];}var _0x2a6aca=_['defaults'](_0x33c0eb['body'],{'firstName':_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')],'ListId':_0x5aeb87['id']});_0x2a6aca[_0x33c0eb['body'][_0xc320('0x99')]]=_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')];return db['CmContact'][_0xc320('0x5e')](_0x2a6aca,{'fields':_0x559d44,'raw':!![]});}})[_0xc320('0x21')](handleEntityNotFound(_0x38ef63,null))[_0xc320('0x21')](function(_0x50797c){if(_0x50797c){_0x33c0eb['contact']=_0x50797c;var _0x2f46c4={'ContactId':_0x50797c['id'],'phone':_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')],'SmsAccountId':_0x48ec35[_0xc320('0x58')]['id']};var _0x1991a1={'ContactId':_0x50797c['id'],'SmsAccountId':_0x48ec35['params']['id'],'closed':![]};return db[_0xc320('0xa1')]['find']({'where':_0x1991a1})[_0xc320('0x21')](function(_0x4bd2f4){if(_0x4bd2f4){return[_0x4bd2f4,![]];}return db[_0xc320('0xa1')][_0xc320('0x5e')](_0x2f46c4)[_0xc320('0x21')](function(_0x2796cf){return[_0x2796cf,!![]];});});}})[_0xc320('0xa2')](function(_0x4694f2,_0x1ec8a5){_0x33c0eb['interaction']=_0x4694f2['get']({'plain':!![]});_0x33c0eb['interaction'][_0xc320('0xa3')]=![];if(_0x1ec8a5){if(_0x33c0eb[_0xc320('0x74')]['autoclose']){_0x33c0eb[_0xc320('0x75')][_0xc320('0xa4')]({'id':0x0,'priority':_0x33c0eb[_0xc320('0x75')][_0xc320('0x5c')]+0x1,'app':_0xc320('0xa5'),'appdata':_0xc320('0xa6'),'interval':_0xc320('0xa7')});}_0x33c0eb[_0xc320('0xa8')][_0xc320('0xa3')]=!![];}return db[_0xc320('0xa9')]['create']({'phone':_0x33c0eb[_0xc320('0x5f')][_0xc320('0x84')],'messageId':_0x33c0eb[_0xc320('0x5f')][_0xc320('0x89')],'body':_0x33c0eb[_0xc320('0x5f')]['body'],'SmsAccountId':_0x48ec35[_0xc320('0x58')]['id'],'SmsInteractionId':_0x4694f2['id'],'direction':'in','ContactId':_0x4694f2[_0xc320('0xaa')],'AttachmentId':_0x33c0eb[_0xc320('0x5f')]['AttachmentId']});})['then'](function(_0x131779){_0x33c0eb[_0xc320('0x29')]=_0x131779;if(_0x33c0eb[_0xc320('0xa8')][_0xc320('0xab')]){return db[_0xc320('0xac')][_0xc320('0x5d')]({'attributes':['id','name'],'where':{'id':_0x33c0eb[_0xc320('0xa8')]['UserId']}})[_0xc320('0x21')](function(_0xbeba6e){if(_0xbeba6e){_0x33c0eb[_0xc320('0x75')][_0xc320('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xbeba6e[_0xc320('0x3c')]+','+(_0x33c0eb[_0xc320('0x74')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc320('0xae'),_0xc320('0xaf'),_0x33c0eb);});}return respondWithRpcPromise(_0xc320('0xae'),_0xc320('0xaf'),_0x33c0eb);})['then'](function(_0x473006){if(_0x473006){var _0x550ec3=0xc8;var _0x16b8f1=_0xc320('0xb0');logger[_0xc320('0x22')](_0xc320('0x25'),_0x16b8f1,_0x550ec3,_0xc320('0xb1'));logger['debug'](_0xc320('0xb2'),_0x16b8f1,_0x550ec3,_0xc320('0xb1'),JSON['stringify'](_0x473006));if(_0x33c0eb['account'][_0xc320('0x42')]==='twilio'){return _0x38ef63[_0xc320('0x2d')](_0x550ec3)[_0xc320('0x33')]('Content-Type',_0xc320('0xb3'))['send'](_0xc320('0xb4'));}else{return _0x38ef63[_0xc320('0x2d')](_0x550ec3)[_0xc320('0x2f')](_0x473006);}}})[_0xc320('0x2c')](handleError(_0x38ef63,null));};exports[_0xc320('0xb5')]=function(_0x2b34c0,_0x47956c){var _0x49c6f4=_0x2b34c0['params']['id'];var _0x257a09=_0x2b34c0[_0xc320('0x5f')];var _0x280560=0xc8;var _0x9f9961=null;return db[_0xc320('0xb6')][_0xc320('0xb7')]({'isolationLevel':db[_0xc320('0xb6')]['Transaction'][_0xc320('0xb8')]['READ_COMMITTED']},function(_0x1d4f96){return db[_0xc320('0x40')]['findOne']({'where':{'id':_0x49c6f4},'transaction':_0x1d4f96})[_0xc320('0x21')](function(_0x5881d0){if(_0x5881d0){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x49c6f4},'transaction':_0x1d4f96})[_0xc320('0x21')](function(){var _0x46e9de=_[_0xc320('0x3f')](_0x257a09,function(_0x521f41){_0x521f41[_0xc320('0x67')]=_0x49c6f4;return _0x521f41;});return db[_0xc320('0x73')][_0xc320('0xb9')](_0x46e9de,{'transaction':_0x1d4f96});});}else{_0x280560=0x194;_0x9f9961=[];}});})[_0xc320('0x21')](function(){if(_0x280560!==0x194){return db[_0xc320('0x73')][_0xc320('0xba')]({'where':{'SmsAccountId':_0x49c6f4},'order':'priority'})['then'](function(_0x1a7c6e){_0x9f9961=_0x1a7c6e;});}})[_0xc320('0x2c')](function(_0xe78c32){_0x280560=0x1f4;logger[_0xc320('0x27')](_0xe78c32['stack']);if(_0xe78c32[_0xc320('0x3c')]){delete _0xe78c32[_0xc320('0x3c')];}_0x9f9961=_0xe78c32;})[_0xc320('0xbb')](function(){if(_0x9f9961===null){_0x47956c[_0xc320('0x3a')](_0x280560);}else{if(_0x280560===0x1f4){_0x47956c[_0xc320('0x2d')](_0x280560)[_0xc320('0x3d')](_0x9f9961);}else{_0x47956c[_0xc320('0x2d')](_0x280560)[_0xc320('0x2f')](_0x9f9961);}}});};exports['getApplications']=function(_0x4b7600,_0x2e3dbc,_0x8e8dd){var _0x4ff836={};var _0x5e7cef={};var _0x5f77f5;var _0x105518;return db[_0xc320('0x40')][_0xc320('0x70')]({'where':{'id':_0x4b7600[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x2e3dbc,null))[_0xc320('0x21')](function(_0x570a15){if(_0x570a15){_0x5f77f5=_0x570a15;_0x5e7cef[_0xc320('0x44')]=_[_0xc320('0x5a')](db[_0xc320('0x73')][_0xc320('0x5b')]);_0x5e7cef[_0xc320('0x45')]=_[_0xc320('0x5a')](_0x4b7600[_0xc320('0x45')]);_0x5e7cef[_0xc320('0x4f')]=_[_0xc320('0x46')](_0x5e7cef[_0xc320('0x44')],_0x5e7cef['query']);_0x4ff836[_0xc320('0x47')]=_['intersection'](_0x5e7cef[_0xc320('0x44')],qs[_0xc320('0x48')](_0x4b7600[_0xc320('0x45')][_0xc320('0x48')]));_0x4ff836[_0xc320('0x47')]=_0x4ff836[_0xc320('0x47')]['length']?_0x4ff836[_0xc320('0x47')]:_0x5e7cef['model'];_0x4ff836[_0xc320('0x4c')]=qs[_0xc320('0x4d')](_0x4b7600[_0xc320('0x45')][_0xc320('0x4d')]);_0x4ff836['where']=qs[_0xc320('0x4f')](_[_0xc320('0x50')](_0x4b7600[_0xc320('0x45')],_0x5e7cef[_0xc320('0x4f')]));if(_0x4b7600[_0xc320('0x45')][_0xc320('0x51')]){_0x4ff836[_0xc320('0x4e')]=_['merge'](_0x4ff836[_0xc320('0x4e')],{'$or':_['map'](_0x4ff836[_0xc320('0x47')],function(_0xa2dd6f){var _0x233404={};_0x233404[_0xa2dd6f]={'$like':'%'+_0x4b7600['query']['filter']+'%'};return _0x233404;})});}_0x4ff836=_[_0xc320('0x52')]({},_0x4ff836,_0x4b7600[_0xc320('0x54')]);return _0x5f77f5['getApplications'](_0x4ff836);}})[_0xc320('0x21')](function(_0x215b5a){if(_0x215b5a){_0x105518=_0x215b5a[_0xc320('0x5c')];if(!_0x4b7600[_0xc320('0x45')][_0xc320('0x49')]('nolimit')){_0x4ff836[_0xc320('0x32')]=qs[_0xc320('0x32')](_0x4b7600['query'][_0xc320('0x32')]);_0x4ff836[_0xc320('0x4b')]=qs[_0xc320('0x4b')](_0x4b7600[_0xc320('0x45')][_0xc320('0x4b')]);}return _0x5f77f5[_0xc320('0xbc')](_0x4ff836);}})[_0xc320('0x21')](function(_0xde144c){if(_0xde144c){return _0xde144c?{'count':_0x105518,'rows':_0xde144c}:null;}})[_0xc320('0x21')](respondWithResult(_0x2e3dbc,null))[_0xc320('0x2c')](handleError(_0x2e3dbc,null));};exports[_0xc320('0xbd')]=function(_0x45d81a,_0x16e218,_0x11f32e){var _0x1adc94={'raw':![],'where':{}};var _0x1d478b={};var _0xa944cf={'count':0x0,'rows':[]};return db[_0xc320('0x40')][_0xc320('0x70')]({'where':{'id':_0x45d81a[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x16e218,null))[_0xc320('0x21')](function(_0x5c9b3c){if(_0x5c9b3c){_0x1d478b['model']=_[_0xc320('0x5a')](db[_0xc320('0xa1')][_0xc320('0x5b')]);_0x1d478b[_0xc320('0x45')]=_['keys'](_0x45d81a[_0xc320('0x45')]);_0x1d478b[_0xc320('0x4f')]=_['intersection'](_0x1d478b[_0xc320('0x44')],_0x1d478b[_0xc320('0x45')]);_0x1adc94['attributes']=_[_0xc320('0x46')](_0x1d478b[_0xc320('0x44')],qs['fields'](_0x45d81a['query'][_0xc320('0x48')]));_0x1adc94[_0xc320('0x47')]=_0x1adc94[_0xc320('0x47')][_0xc320('0x5c')]?_0x1adc94[_0xc320('0x47')]:_0x1d478b['model'];if(!_0x45d81a[_0xc320('0x45')][_0xc320('0x49')](_0xc320('0x4a'))){_0x1adc94[_0xc320('0x32')]=qs[_0xc320('0x32')](_0x45d81a['query']['limit']);_0x1adc94[_0xc320('0x4b')]=qs[_0xc320('0x4b')](_0x45d81a[_0xc320('0x45')]['offset']);}_0x1adc94['order']=qs[_0xc320('0x4d')](_0x45d81a[_0xc320('0x45')]['sort']);_0x1adc94[_0xc320('0x4e')]=qs[_0xc320('0x4f')](_[_0xc320('0x50')](_0x45d81a[_0xc320('0x45')],_0x1d478b[_0xc320('0x4f')]));_0x1adc94[_0xc320('0x4e')][_0xc320('0x67')]=_0x5c9b3c['id'];if(_0x45d81a[_0xc320('0x45')]['filter']){_0x1adc94[_0xc320('0x4e')]=_[_0xc320('0x52')](_0x1adc94['where'],{'$or':_[_0xc320('0x3f')](_0x1adc94[_0xc320('0x47')],function(_0x54a706){var _0x2485ff={};_0x2485ff[_0x54a706]={'$like':'%'+_0x45d81a[_0xc320('0x45')]['filter']+'%'};return _0x2485ff;})});}_0x1adc94=_['merge']({},_0x1adc94,_0x45d81a[_0xc320('0x54')]);return db['SmsInteraction'][_0xc320('0x31')]({'where':_0x1adc94['where']})[_0xc320('0x21')](function(_0xef4733){_0xa944cf[_0xc320('0x31')]=_0xef4733;if(_0x45d81a[_0xc320('0x45')]['includeAll']){_0x1adc94[_0xc320('0x6a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xc320('0xbe'),'attributes':[_0xc320('0x3c'),_0xc320('0xbf'),_0xc320('0xc0')],'required':![]},{'model':db[_0xc320('0xc1')],'as':_0xc320('0xc2'),'attributes':['id','name',_0xc320('0xc3')],'where':_0x45d81a[_0xc320('0x45')][_0xc320('0xc4')]?{'id':_0x45d81a[_0xc320('0x45')][_0xc320('0xc4')]}:undefined,'required':_0x45d81a[_0xc320('0x45')][_0xc320('0xc4')]?!![]:![]}];}return db[_0xc320('0xa1')]['findAll'](_0x1adc94);})[_0xc320('0x21')](function(_0x230ccf){_0xa944cf['rows']=_0x230ccf;return _0xa944cf;});}})[_0xc320('0x21')](respondWithFilteredResult(_0x16e218,_0x1adc94))[_0xc320('0x2c')](handleError(_0x16e218,null));};exports['send']=function(_0x264fbd,_0xc62c7a,_0x419455){var _0x4b12c7,_0x412d03,_0x31b519;if(_[_0xc320('0x97')](_0x264fbd[_0xc320('0x5f')][_0xc320('0x5f')])||_0x264fbd[_0xc320('0x5f')][_0xc320('0x5f')]===''){throw new db[(_0xc320('0x7a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc320('0x97')](_0x264fbd[_0xc320('0x5f')]['to'])){throw new db[(_0xc320('0x7a'))][(_0xc320('0x7b'))](_0xc320('0xc5'));}_0x4b12c7=_0x264fbd[_0xc320('0x5f')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x264fbd[_0xc320('0x58')]['id']},'include':[{'model':db[_0xc320('0x9b')],'as':_0xc320('0xc6'),'include':[{'model':db[_0xc320('0x9c')],'as':_0xc320('0x9d'),'where':{'mobile':_0x4b12c7},'limit':0x1,'order':[[_0xc320('0x7d'),_0xc320('0x9e')]]}]}]})[_0xc320('0x21')](handleEntityNotFound(_0xc62c7a,null))[_0xc320('0x21')](function(_0x5967fe){if(_0x5967fe&&_0x5967fe['List']){_0x412d03=_0x5967fe[_0xc320('0x38')]({'plain':!![]});if(_0x412d03[_0xc320('0xc6')]&&_0x412d03[_0xc320('0xc6')][_0xc320('0x9d')][_0xc320('0x5c')]){return _0x412d03[_0xc320('0xc6')][_0xc320('0x9d')][0x0];}return db[_0xc320('0x9c')][_0xc320('0x5e')](_[_0xc320('0x1a')](_0x264fbd[_0xc320('0x5f')],{'firstName':_0x4b12c7,'mobile':_0x4b12c7,'phone':_0x4b12c7,'ListId':_0x412d03[_0xc320('0x7f')]}));}})['then'](handleEntityNotFound(_0xc62c7a,null))[_0xc320('0x21')](function(_0x1bdafe){if(_0x1bdafe){_0x31b519=_0x1bdafe;return db[_0xc320('0xa1')][_0xc320('0x5d')]({'where':{'ContactId':_0x31b519['id'],'closed':![],'SmsAccountId':_0x412d03['id']}})[_0xc320('0x21')](function(_0x554296){if(_0x554296){return[_0x554296,![]];}return db[_0xc320('0xa1')][_0xc320('0x5e')]({'UserId':_0x264fbd['user']['id'],'ContactId':_0x31b519['id'],'SmsAccountId':_0x412d03['id'],'phone':_0x4b12c7,'firstMsgDirection':_0xc320('0xc7'),'Messages':[_[_0xc320('0x52')](_0x264fbd[_0xc320('0x5f')],{'read':![],'body':_0x264fbd[_0xc320('0x5f')]['body'],'phone':_0x4b12c7,'SmsAccountId':_0x412d03['id'],'UserId':_0x264fbd['user']['id'],'ContactId':_0x31b519['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc320('0xc8')}]})[_0xc320('0x21')](function(_0x31566b){return[_0x31566b,!![]];});});}})['spread'](function(_0x47cc69,_0x58fe89){if(_0x58fe89){return _0x47cc69;}return db[_0xc320('0xa9')]['create'](_['merge'](_0x264fbd[_0xc320('0x5f')],{'read':![],'body':_0x264fbd[_0xc320('0x5f')][_0xc320('0x5f')],'phone':_0x4b12c7,'SmsAccountId':_0x412d03['id'],'SmsInteractionId':_0x47cc69['id'],'UserId':_0x264fbd[_0xc320('0x62')]['id'],'ContactId':_0x31b519['id']}))[_0xc320('0x21')](function(_0x4338ef){_0x47cc69['dataValues'][_0xc320('0xc8')]=[];_0x47cc69[_0xc320('0xc9')][_0xc320('0xc8')][_0xc320('0xa4')](_0x4338ef[_0xc320('0xc9')]);return _0x47cc69;});})[_0xc320('0x21')](respondWithResult(_0xc62c7a,null))[_0xc320('0x2c')](handleError(_0xc62c7a,null));};exports['status']=function(_0xf3298e,_0x4ce57a,_0x982ada){if(_0xf3298e[_0xc320('0x5f')]['id']){delete _0xf3298e['body']['id'];}var _0x425347,_0x2d16b1,_0xebce61;return db['SmsAccount'][_0xc320('0x5d')]({'where':{'id':_0xf3298e[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x4ce57a,null))[_0xc320('0x21')](function(_0x3a516d){if(_0x3a516d){_0xebce61=_0x3a516d;logger['debug'](_0xc320('0x25'),_0xc320('0x2d'),_0xc320('0xca'),_0x3a516d[_0xc320('0x42')],util[_0xc320('0xcb')](_0xf3298e['body'],{'showHidden':![],'depth':null}));switch(_0x3a516d['type']){case _0xc320('0x83'):if(_0xf3298e[_0xc320('0x5f')][_0xc320('0xcc')]&&_0xf3298e[_0xc320('0x5f')][_0xc320('0x2d')]){_0x2d16b1=_0xf3298e[_0xc320('0x5f')][_0xc320('0x2d')];return db['SmsMessage'][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e[_0xc320('0x5f')][_0xc320('0xcc')]}});}break;case _0xc320('0x87'):if(_0xf3298e[_0xc320('0x5f')][_0xc320('0xcd')]&&_0xf3298e[_0xc320('0x5f')]['statusInt']){_0x2d16b1=_0xf3298e[_0xc320('0x5f')][_0xc320('0xce')];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e['body'][_0xc320('0xcd')]}});}break;case _0xc320('0x88'):if(_0xf3298e[_0xc320('0x5f')][_0xc320('0x8a')]&&_0xf3298e[_0xc320('0x5f')]['status_code']){_0x2d16b1=_0xf3298e[_0xc320('0x5f')][_0xc320('0xcf')];return db['SmsMessage'][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e[_0xc320('0x5f')][_0xc320('0x8a')]}});}break;case _0xc320('0x8e'):var _0x40cff4=_0xf3298e[_0xc320('0x5f')][_0xc320('0x8f')][0x0];if(_0x40cff4[_0xc320('0x89')]&&_0x40cff4[_0xc320('0x2d')]['groupName']===_0xc320('0xd0')){_0x2d16b1=_0x40cff4[_0xc320('0x2d')][_0xc320('0xd1')];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0x40cff4[_0xc320('0x89')]}});}break;case'clickatell':if(_0xf3298e[_0xc320('0x5f')]['messageId']&&_0xf3298e[_0xc320('0x5f')][_0xc320('0x2d')]){_0x2d16b1=_0xf3298e[_0xc320('0x5f')][_0xc320('0x2d')];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e[_0xc320('0x5f')][_0xc320('0x89')]}});}break;case _0xc320('0x95'):if(_0xf3298e[_0xc320('0x5f')][0x0]['message']['id']){_0x2d16b1=_0xf3298e[_0xc320('0x5f')][0x0]['type'];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e[_0xc320('0x5f')][0x0][_0xc320('0x29')]['id']}});}break;case _0xc320('0x96'):if(_0xf3298e[_0xc320('0x5f')][_0xc320('0xd2')]&&_0xf3298e['body'][_0xc320('0x2d')]){_0x2d16b1=_0xf3298e[_0xc320('0x5f')]['status'];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0xf3298e['body']['redif']}});}break;}}})[_0xc320('0x21')](handleEntityNotFound(_0x4ce57a,null))['then'](function(_0x6cb185){if(_0x6cb185){_0x425347=_0x6cb185;switch(_0xebce61['type']){case _0xc320('0x83'):if(_0x2d16b1==='DELIVERED'){return _0x425347[_0xc320('0xd3')]({'read':!![]});}else{logger['error'](_0xc320('0x25'),_0xc320('0x2d'),_0xc320('0x83'),util[_0xc320('0xcb')](_0xf3298e[_0xc320('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xc320('0x87'):if(_0x2d16b1==='1'){return _0x425347['update']({'read':!![]});}else{logger[_0xc320('0x27')](_0xc320('0x25'),_0xc320('0x2d'),_0xc320('0x83'),util[_0xc320('0xcb')](_0xf3298e[_0xc320('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xf3298e[_0xc320('0x5f')][_0xc320('0xd4')]&&_0x2d16b1>=0xc8&&_0x2d16b1<=0xce){return _0x425347['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc320('0x2d'),_0xc320('0x88'),util['inspect'](_0xf3298e[_0xc320('0x5f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2c4677=_0xf3298e[_0xc320('0x5f')][_0xc320('0x8f')][0x0];if(_0x2c4677[_0xc320('0x2d')][_0xc320('0xd1')]===_0xc320('0xd0')){return _0x425347[_0xc320('0xd3')]({'read':!![]});}else{logger[_0xc320('0x27')](_0xc320('0x25'),_0xc320('0x2d'),'infobip',util['inspect'](_0xf3298e['body'],{'showHidden':![],'depth':null}));}break;case _0xc320('0x93'):if(_0x2d16b1=='DELIVERED_TO_GATEWAY'||_0x2d16b1==_0xc320('0xd5')){return _0x425347[_0xc320('0xd3')]({'read':!![]});}else{logger[_0xc320('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc320('0x2d'),_0xc320('0x93'),util['inspect'](_0xf3298e['body'],{'showHidden':![],'depth':null}));}break;case _0xc320('0x95'):if(_0x2d16b1==_0xc320('0xd6')){return _0x425347['update']({'read':!![]});}else{logger[_0xc320('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc320('0x2d'),_0xc320('0x95'),util['inspect'](_0xf3298e[_0xc320('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xc320('0x96'):if(_0x2d16b1===_0xc320('0xd7')||_0x2d16b1==='ACCEPTD'){return _0x425347['update']({'read':!![]});}else{logger['error'](_0xc320('0x25'),'status',_0xc320('0x96'),util['inspect'](_0xf3298e['body'],{'showHidden':![],'depth':null}));}break;}return _0x425347;}})[_0xc320('0x21')](respondWithResult(_0x4ce57a,null))[_0xc320('0x2c')](handleError(_0x4ce57a,null));};exports[_0xc320('0xd8')]=function(_0x17073e,_0x12e09d,_0x173e1f){var _0x555fa8,_0x1867a9,_0x14ecfc;return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x17073e[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x12e09d,null))['then'](function(_0x1d7e65){if(_0x1d7e65){_0x14ecfc=_0x1d7e65;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc320('0xca'),_0x1d7e65['type'],util['inspect'](_0x17073e[_0xc320('0x45')],{'showHidden':![],'depth':null}));switch(_0x1d7e65[_0xc320('0x42')]){case _0xc320('0x90'):if(_0x17073e[_0xc320('0x45')][_0xc320('0xd9')]&&_0x17073e[_0xc320('0x45')][_0xc320('0xda')]){_0x1867a9=_0x17073e[_0xc320('0x45')][_0xc320('0xda')];return db[_0xc320('0xa9')][_0xc320('0x5d')]({'where':{'messageId':_0x17073e['query'][_0xc320('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x12e09d,null))[_0xc320('0x21')](function(_0x182a12){if(_0x182a12){_0x555fa8=_0x182a12;switch(_0x14ecfc[_0xc320('0x42')]){case'csc':if(_0x1867a9==='2'||_0x1867a9==='6'){return _0x555fa8[_0xc320('0xd3')]({'read':!![]});}else{logger[_0xc320('0x27')](_0xc320('0x25'),_0xc320('0x2d'),_0xc320('0x90'),util[_0xc320('0xcb')](_0x17073e['query'],{'showHidden':![],'depth':null}));};break;}return _0x555fa8;}})[_0xc320('0x21')](respondWithResult(_0x12e09d,null))[_0xc320('0x2c')](handleError(_0x12e09d,null));};exports[_0xc320('0xdb')]=function(_0x3a6124,_0xea2a82,_0x2e4bc2){return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x3a6124['params']['id']}})[_0xc320('0x21')](handleEntityNotFound(_0xea2a82,null))[_0xc320('0x21')](function(_0xda069b){if(_0xda069b){return _0xda069b[_0xc320('0xdb')](_0x3a6124[_0xc320('0x5f')][_0xc320('0x6d')],_[_0xc320('0xa0')](_0x3a6124[_0xc320('0x5f')],['ids','id'])||{})['spread'](function(_0x2435d9){for(var _0x26e5c9=0x0;_0x26e5c9<_0x3a6124[_0xc320('0x5f')]['ids'][_0xc320('0x5c')];_0x26e5c9+=0x1){socket[_0xc320('0xdc')](_0xc320('0xdd'),{'UserId':Number(_0x3a6124['body'][_0xc320('0x6d')][_0x26e5c9]),'SmsAccountId':Number(_0x3a6124['params']['id'])});}return _0x2435d9;});}})[_0xc320('0x21')](respondWithResult(_0xea2a82,null))[_0xc320('0x2c')](handleError(_0xea2a82,null));};exports[_0xc320('0xde')]=function(_0x5b2a93,_0x43f0bb,_0x5e1f2e){return db[_0xc320('0x40')][_0xc320('0x5d')]({'where':{'id':_0x5b2a93['params']['id']}})[_0xc320('0x21')](handleEntityNotFound(_0x43f0bb,null))['then'](function(_0x52ead9){if(_0x52ead9){return _0x52ead9[_0xc320('0xde')](_0x5b2a93[_0xc320('0x45')]['ids'])['then'](function(){if(_[_0xc320('0xdf')](_0x5b2a93[_0xc320('0x45')]['ids'])){for(var _0xe96187=0x0;_0xe96187<_0x5b2a93[_0xc320('0x45')][_0xc320('0x6d')]['length'];_0xe96187+=0x1){socket[_0xc320('0xdc')](_0xc320('0xe0'),{'UserId':Number(_0x5b2a93[_0xc320('0x45')][_0xc320('0x6d')][_0xe96187]),'SmsAccountId':Number(_0x5b2a93[_0xc320('0x58')]['id'])});}}else{socket[_0xc320('0xdc')](_0xc320('0xe0'),{'UserId':Number(_0x5b2a93['query'][_0xc320('0x6d')]),'SmsAccountId':Number(_0x5b2a93[_0xc320('0x58')]['id'])});}});}})[_0xc320('0x21')](respondWithStatusCode(_0x43f0bb,null))[_0xc320('0x2c')](handleError(_0x43f0bb,null));};exports[_0xc320('0xe1')]=function(_0x5c93b1,_0xb78e32,_0xd39fb4){var _0x4dc822={};var _0x4e0638={};var _0xb5b7ea;var _0x565252;return db[_0xc320('0x40')][_0xc320('0x70')]({'where':{'id':_0x5c93b1[_0xc320('0x58')]['id']}})[_0xc320('0x21')](handleEntityNotFound(_0xb78e32,null))[_0xc320('0x21')](function(_0x31795e){if(_0x31795e){_0xb5b7ea=_0x31795e;_0x4e0638[_0xc320('0x44')]=_[_0xc320('0x5a')](db[_0xc320('0xac')][_0xc320('0x5b')]);_0x4e0638['query']=_[_0xc320('0x5a')](_0x5c93b1['query']);_0x4e0638[_0xc320('0x4f')]=_['intersection'](_0x4e0638[_0xc320('0x44')],_0x4e0638[_0xc320('0x45')]);_0x4dc822['attributes']=_[_0xc320('0x46')](_0x4e0638['model'],qs['fields'](_0x5c93b1[_0xc320('0x45')][_0xc320('0x48')]));_0x4dc822['attributes']=_0x4dc822['attributes'][_0xc320('0x5c')]?_0x4dc822['attributes']:_0x4e0638[_0xc320('0x44')];_0x4dc822[_0xc320('0x4c')]=qs[_0xc320('0x4d')](_0x5c93b1[_0xc320('0x45')][_0xc320('0x4d')]);_0x4dc822[_0xc320('0x4e')]=qs[_0xc320('0x4f')](_[_0xc320('0x50')](_0x5c93b1[_0xc320('0x45')],_0x4e0638[_0xc320('0x4f')]));if(_0x5c93b1[_0xc320('0x45')]['filter']){_0x4dc822[_0xc320('0x4e')]=_[_0xc320('0x52')](_0x4dc822[_0xc320('0x4e')],{'$or':_[_0xc320('0x3f')](_0x4dc822[_0xc320('0x47')],function(_0x420d0f){var _0x2e12ca={};_0x2e12ca[_0x420d0f]={'$like':'%'+_0x5c93b1[_0xc320('0x45')][_0xc320('0x51')]+'%'};return _0x2e12ca;})});}_0x4dc822=_[_0xc320('0x52')]({},_0x4dc822,_0x5c93b1[_0xc320('0x54')]);return _0xb5b7ea[_0xc320('0xe1')](_0x4dc822);}})['then'](function(_0x4640f1){if(_0x4640f1){_0x565252=_0x4640f1[_0xc320('0x5c')];if(!_0x5c93b1[_0xc320('0x45')]['hasOwnProperty'](_0xc320('0x4a'))){_0x4dc822['limit']=qs[_0xc320('0x32')](_0x5c93b1[_0xc320('0x45')][_0xc320('0x32')]);_0x4dc822['offset']=qs[_0xc320('0x4b')](_0x5c93b1['query'][_0xc320('0x4b')]);}return _0xb5b7ea[_0xc320('0xe1')](_0x4dc822);}})[_0xc320('0x21')](function(_0x2051fb){if(_0x2051fb){return _0x2051fb?{'count':_0x565252,'rows':_0x2051fb}:null;}})[_0xc320('0x21')](respondWithResult(_0xb78e32,null))[_0xc320('0x2c')](handleError(_0xb78e32,null));}; \ No newline at end of file +var _0x5315=['emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','localhost','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','apply','reject','save','SmsAccounts','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','length','include','find','create','user','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','text','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','DESC','omit','Contacts','defaults','contact','SmsInteraction','interaction','autoclose','push','close','unmanaged','created','ContactId','AttachmentId','UserId','User','agent','*,*,*,*','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','ACCEPTD','state','addAgents'];(function(_0x54ec48,_0x3ec05c){var _0xd44810=function(_0x4315ca){while(--_0x4315ca){_0x54ec48['push'](_0x54ec48['shift']());}};_0xd44810(++_0x3ec05c);}(_0x5315,0x1cc));var _0x5531=function(_0xc48359,_0x1f01e6){_0xc48359=_0xc48359-0x0;var _0x58e94f=_0x5315[_0xc48359];return _0x58e94f;};'use strict';var emlformat=require(_0x5531('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5531('0x1'));var jsonpatch=require(_0x5531('0x2'));var rp=require(_0x5531('0x3'));var moment=require(_0x5531('0x4'));var BPromise=require(_0x5531('0x5'));var Mustache=require(_0x5531('0x6'));var util=require(_0x5531('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5531('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5531('0x9'));var squel=require('squel');var crypto=require(_0x5531('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5531('0xb'));var querystring=require(_0x5531('0xc'));var Papa=require(_0x5531('0xd'));var Redis=require(_0x5531('0xe'));var authService=require(_0x5531('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5531('0x10'));var hardwareService=require(_0x5531('0x11'));var logger=require(_0x5531('0x12'))(_0x5531('0x13'));var utils=require(_0x5531('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5531('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5531('0x16'),'port':0x18eb});var socket=require(_0x5531('0x17'))(new Redis(config[_0x5531('0x18')]));require(_0x5531('0x19'))[_0x5531('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2c96d2,_0x1f9911,_0x3355d4,_0x3cab19){return new BPromise(function(_0x10851f,_0xb906c){var _0x4289b1=_0x3cab19||client;return _0x4289b1[_0x5531('0x1b')](_0x2c96d2,_0x3355d4)[_0x5531('0x1c')](function(_0x18847f){logger[_0x5531('0x1d')](_0x5531('0x1e'),_0x1f9911,_0x5531('0x1f'));logger[_0x5531('0x20')](_0x5531('0x21'),_0x1f9911,'request\x20sent',JSON[_0x5531('0x22')](_0x18847f));if(_0x18847f[_0x5531('0x23')]){if(_0x18847f[_0x5531('0x23')][_0x5531('0x24')]===0x1f4){logger[_0x5531('0x23')](_0x5531('0x1e'),_0x1f9911,_0x18847f[_0x5531('0x23')][_0x5531('0x25')]);return _0xb906c(_0x18847f[_0x5531('0x23')][_0x5531('0x25')]);}logger[_0x5531('0x23')](_0x5531('0x1e'),_0x1f9911,_0x18847f[_0x5531('0x23')][_0x5531('0x25')]);return _0x10851f(_0x18847f[_0x5531('0x23')][_0x5531('0x25')]);}else{logger[_0x5531('0x1d')](_0x5531('0x1e'),_0x1f9911,'request\x20sent');_0x10851f(_0x18847f[_0x5531('0x26')][_0x5531('0x25')]);}})[_0x5531('0x27')](function(_0x5e5b9e){logger[_0x5531('0x23')](_0x5531('0x1e'),_0x1f9911,_0x5e5b9e);_0xb906c(_0x5e5b9e);});});}function respondWithStatusCode(_0x2904b3,_0x4e1c40){_0x4e1c40=_0x4e1c40||0xcc;return function(_0x4f15e2){if(_0x4f15e2){return _0x2904b3['sendStatus'](_0x4e1c40);}return _0x2904b3[_0x5531('0x28')](_0x4e1c40)['end']();};}function respondWithResult(_0x3b5b1c,_0xc88648){_0xc88648=_0xc88648||0xc8;return function(_0x4e7957){if(_0x4e7957){return _0x3b5b1c[_0x5531('0x28')](_0xc88648)[_0x5531('0x29')](_0x4e7957);}};}function respondWithFilteredResult(_0x3f859f,_0x515650){return function(_0x1ed9ac){if(_0x1ed9ac){var _0x3c662c=typeof _0x515650['offset']===_0x5531('0x2a')&&typeof _0x515650[_0x5531('0x2b')]==='undefined';var _0x1ade6a=_0x1ed9ac[_0x5531('0x2c')];var _0x208f8b=_0x3c662c?0x0:_0x515650[_0x5531('0x2d')];var _0x220d44=_0x3c662c?_0x1ed9ac[_0x5531('0x2c')]:_0x515650[_0x5531('0x2d')]+_0x515650[_0x5531('0x2b')];var _0x344e9e;if(_0x220d44>=_0x1ade6a){_0x220d44=_0x1ade6a;_0x344e9e=0xc8;}else{_0x344e9e=0xce;}_0x3f859f['status'](_0x344e9e);return _0x3f859f[_0x5531('0x2e')]('Content-Range',_0x208f8b+'-'+_0x220d44+'/'+_0x1ade6a)['json'](_0x1ed9ac);}return null;};}function patchUpdates(_0x5c0588){return function(_0xb6163d){try{jsonpatch[_0x5531('0x2f')](_0xb6163d,_0x5c0588,!![]);}catch(_0x39cd30){return BPromise[_0x5531('0x30')](_0x39cd30);}return _0xb6163d[_0x5531('0x31')]();};}function saveUpdates(_0x229f6e,_0x38df9c){return function(_0xfb344e){if(_0xfb344e){return _0xfb344e['update'](_0x229f6e)[_0x5531('0x1c')](function(_0x32288c){return _0x32288c;});}return null;};}function removeEntity(_0x9f9d48,_0x8d091f){return function(_0x3c43c9){if(_0x3c43c9){return _0x3c43c9['destroy']()[_0x5531('0x1c')](function(){var _0x5ad3d7=_0x3c43c9['get']({'plain':!![]});var _0x1f995a=_0x5531('0x32');return db['UserProfileResource'][_0x5531('0x33')]({'where':{'type':_0x1f995a,'resourceId':_0x5ad3d7['id']}})[_0x5531('0x1c')](function(){return _0x3c43c9;});})['then'](function(){_0x9f9d48['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x213a8e,_0x43f4b2){return function(_0x1ca186){if(!_0x1ca186){_0x213a8e[_0x5531('0x34')](0x194);}return _0x1ca186;};}function handleError(_0x1339f0,_0x8d30f4){_0x8d30f4=_0x8d30f4||0x1f4;return function(_0x21308b){logger['error'](_0x21308b[_0x5531('0x35')]);if(_0x21308b[_0x5531('0x36')]){delete _0x21308b[_0x5531('0x36')];}_0x1339f0[_0x5531('0x28')](_0x8d30f4)[_0x5531('0x37')](_0x21308b);};}exports[_0x5531('0x38')]=function(_0x1a88b2,_0x22145a){var _0x152d43={'include':[{'model':db[_0x5531('0x39')],'as':_0x5531('0x3a')}]},_0x1bf869={},_0x1b757d={'count':0x0,'rows':[]};var _0x5111d9=_[_0x5531('0x3b')](db[_0x5531('0x3c')][_0x5531('0x3d')],function(_0x386ef3){return{'name':_0x386ef3[_0x5531('0x3e')],'type':_0x386ef3[_0x5531('0x3f')][_0x5531('0x40')]};});_0x1bf869[_0x5531('0x41')]=_[_0x5531('0x3b')](_0x5111d9,_0x5531('0x36'));_0x1bf869[_0x5531('0x42')]=_[_0x5531('0x43')](_0x1a88b2['query']);_0x1bf869[_0x5531('0x44')]=_[_0x5531('0x45')](_0x1bf869[_0x5531('0x41')],_0x1bf869[_0x5531('0x42')]);_0x152d43['attributes']=_['intersection'](_0x1bf869[_0x5531('0x41')],qs['fields'](_0x1a88b2[_0x5531('0x42')][_0x5531('0x46')]));_0x152d43[_0x5531('0x47')]=_0x152d43[_0x5531('0x47')]['length']?_0x152d43[_0x5531('0x47')]:_0x1bf869[_0x5531('0x41')];if(!_0x1a88b2['query'][_0x5531('0x48')](_0x5531('0x49'))){_0x152d43[_0x5531('0x2b')]=qs[_0x5531('0x2b')](_0x1a88b2['query'][_0x5531('0x2b')]);_0x152d43[_0x5531('0x2d')]=qs[_0x5531('0x2d')](_0x1a88b2[_0x5531('0x42')]['offset']);}_0x152d43[_0x5531('0x4a')]=qs[_0x5531('0x4b')](_0x1a88b2[_0x5531('0x42')][_0x5531('0x4b')]);_0x152d43[_0x5531('0x4c')]=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x1a88b2['query'],_0x1bf869[_0x5531('0x44')]),_0x5111d9);if(_0x1a88b2[_0x5531('0x42')][_0x5531('0x4e')]){_0x152d43[_0x5531('0x4c')]=_[_0x5531('0x4f')](_0x152d43[_0x5531('0x4c')],{'$or':_[_0x5531('0x3b')](_0x5111d9,function(_0x43e858){if(_0x43e858[_0x5531('0x3f')]!==_0x5531('0x50')){var _0x580f14={};_0x580f14[_0x43e858[_0x5531('0x36')]]={'$like':'%'+_0x1a88b2[_0x5531('0x42')][_0x5531('0x4e')]+'%'};return _0x580f14;}})});}_0x152d43=_[_0x5531('0x4f')]({},_0x152d43,_0x1a88b2[_0x5531('0x51')]);var _0x26595d={'where':_0x152d43[_0x5531('0x4c')]};return db[_0x5531('0x3c')]['count'](_0x26595d)[_0x5531('0x1c')](function(_0x4872b4){_0x1b757d['count']=_0x4872b4;if(_0x1a88b2[_0x5531('0x42')]['includeAll']){_0x152d43['include']=[{'all':!![]}];}return db[_0x5531('0x3c')][_0x5531('0x52')](_0x152d43);})[_0x5531('0x1c')](function(_0x529391){_0x1b757d[_0x5531('0x53')]=_0x529391;return _0x1b757d;})['then'](respondWithFilteredResult(_0x22145a,_0x152d43))[_0x5531('0x27')](handleError(_0x22145a,null));};exports[_0x5531('0x54')]=function(_0x27da60,_0x164835){var _0x419653={'raw':![],'where':{'id':_0x27da60['params']['id']},'include':[{'model':db[_0x5531('0x39')],'as':_0x5531('0x3a')}]},_0x42eb14={};_0x42eb14[_0x5531('0x41')]=_[_0x5531('0x43')](db[_0x5531('0x3c')][_0x5531('0x3d')]);_0x42eb14[_0x5531('0x42')]=_[_0x5531('0x43')](_0x27da60['query']);_0x42eb14[_0x5531('0x44')]=_[_0x5531('0x45')](_0x42eb14[_0x5531('0x41')],_0x42eb14[_0x5531('0x42')]);_0x419653[_0x5531('0x47')]=_[_0x5531('0x45')](_0x42eb14[_0x5531('0x41')],qs[_0x5531('0x46')](_0x27da60[_0x5531('0x42')][_0x5531('0x46')]));_0x419653[_0x5531('0x47')]=_0x419653[_0x5531('0x47')][_0x5531('0x55')]?_0x419653[_0x5531('0x47')]:_0x42eb14[_0x5531('0x41')];if(_0x27da60['query']['includeAll']){_0x419653[_0x5531('0x56')]=[{'all':!![]}];}_0x419653=_['merge']({},_0x419653,_0x27da60[_0x5531('0x51')]);return db[_0x5531('0x3c')][_0x5531('0x57')](_0x419653)[_0x5531('0x1c')](handleEntityNotFound(_0x164835,null))[_0x5531('0x1c')](respondWithResult(_0x164835,null))[_0x5531('0x27')](handleError(_0x164835,null));};exports[_0x5531('0x58')]=function(_0x2579a,_0x5c6457){return db[_0x5531('0x3c')][_0x5531('0x58')](_0x2579a['body'],{})[_0x5531('0x1c')](function(_0x11cd67){var _0x48aeba=_0x2579a[_0x5531('0x59')]['get']({'plain':!![]});if(!_0x48aeba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48aeba['role']===_0x5531('0x59')){var _0x1af4cd=_0x11cd67[_0x5531('0x5a')]({'plain':!![]});var _0x3e5be3=_0x5531('0x32');return db['UserProfileSection']['find']({'where':{'name':_0x3e5be3,'userProfileId':_0x48aeba[_0x5531('0x5b')]},'raw':!![]})['then'](function(_0x3cd838){if(_0x3cd838&&_0x3cd838[_0x5531('0x5c')]===0x0){return db[_0x5531('0x5d')][_0x5531('0x58')]({'name':_0x1af4cd['name'],'resourceId':_0x1af4cd['id'],'type':_0x3cd838[_0x5531('0x36')],'sectionId':_0x3cd838['id']},{})[_0x5531('0x1c')](function(){return _0x11cd67;});}else{return _0x11cd67;}})['catch'](function(_0x51f62e){logger[_0x5531('0x23')](_0x5531('0x5e'),_0x51f62e);throw _0x51f62e;});}return _0x11cd67;})[_0x5531('0x1c')](respondWithResult(_0x5c6457,0xc9))['catch'](handleError(_0x5c6457,null));};exports[_0x5531('0x5f')]=function(_0x241911,_0x6baa37){if(_0x241911['body']['id']){delete _0x241911[_0x5531('0x60')]['id'];}return db['SmsAccount'][_0x5531('0x57')]({'where':{'id':_0x241911[_0x5531('0x61')]['id']},'include':[{'model':db[_0x5531('0x39')],'as':_0x5531('0x3a')}]})[_0x5531('0x1c')](handleEntityNotFound(_0x6baa37,null))[_0x5531('0x1c')](saveUpdates(_0x241911['body'],null))[_0x5531('0x1c')](respondWithResult(_0x6baa37,null))[_0x5531('0x27')](handleError(_0x6baa37,null));};exports[_0x5531('0x33')]=function(_0x549632,_0x5392db){return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0x549632['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x5392db,null))['then'](removeEntity(_0x5392db,null))['catch'](handleError(_0x5392db,null));};exports[_0x5531('0x62')]=function(_0x2104da,_0x55e5ec){return db[_0x5531('0x3c')]['describe']()[_0x5531('0x1c')](respondWithResult(_0x55e5ec,null))['catch'](handleError(_0x55e5ec,null));};exports[_0x5531('0x63')]=function(_0x40c640,_0x27bc3b,_0x4f1ff5){if(_0x40c640['body']['id']){delete _0x40c640[_0x5531('0x60')]['id'];}return db['SmsAccount'][_0x5531('0x57')]({'where':{'id':_0x40c640['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x27bc3b,null))[_0x5531('0x1c')](function(_0x257d3c){if(_0x257d3c){_0x40c640[_0x5531('0x60')][_0x5531('0x64')]=_0x257d3c['id'];return db[_0x5531('0x65')]['create'](_0x40c640['body']);}})[_0x5531('0x1c')](respondWithResult(_0x27bc3b,null))[_0x5531('0x27')](handleError(_0x27bc3b,null));};exports[_0x5531('0x66')]=function(_0x132609,_0x341dba,_0x36e1a5){var _0x37f100={'raw':![],'where':{}};var _0x3a73d4={};var _0x130eb0={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x132609['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x341dba,null))[_0x5531('0x1c')](function(_0x1869bd){if(_0x1869bd){_0x3a73d4[_0x5531('0x41')]=_[_0x5531('0x43')](db[_0x5531('0x65')]['rawAttributes']);_0x3a73d4[_0x5531('0x42')]=_[_0x5531('0x43')](_0x132609[_0x5531('0x42')]);_0x3a73d4['filters']=_[_0x5531('0x45')](_0x3a73d4[_0x5531('0x41')],_0x3a73d4['query']);_0x37f100[_0x5531('0x47')]=_[_0x5531('0x45')](_0x3a73d4[_0x5531('0x41')],qs[_0x5531('0x46')](_0x132609[_0x5531('0x42')][_0x5531('0x46')]));_0x37f100['attributes']=_0x37f100[_0x5531('0x47')][_0x5531('0x55')]?_0x37f100[_0x5531('0x47')]:_0x3a73d4[_0x5531('0x41')];if(!_0x132609['query'][_0x5531('0x48')](_0x5531('0x49'))){_0x37f100['limit']=qs['limit'](_0x132609[_0x5531('0x42')][_0x5531('0x2b')]);_0x37f100[_0x5531('0x2d')]=qs[_0x5531('0x2d')](_0x132609[_0x5531('0x42')][_0x5531('0x2d')]);}_0x37f100[_0x5531('0x4a')]=qs['sort'](_0x132609[_0x5531('0x42')][_0x5531('0x4b')]);_0x37f100[_0x5531('0x4c')]=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x132609['query'],_0x3a73d4[_0x5531('0x44')]));_0x37f100[_0x5531('0x4c')][_0x5531('0x64')]=_0x1869bd['id'];if(_0x132609['query'][_0x5531('0x4e')]){_0x37f100['where']=_[_0x5531('0x4f')](_0x37f100['where'],{'$or':_[_0x5531('0x3b')](_0x37f100[_0x5531('0x47')],function(_0x5dded3){var _0x2fc9f0={};_0x2fc9f0[_0x5dded3]={'$like':'%'+_0x132609[_0x5531('0x42')][_0x5531('0x4e')]+'%'};return _0x2fc9f0;})});}_0x37f100=_['merge']({},_0x37f100,_0x132609[_0x5531('0x51')]);return db['Disposition'][_0x5531('0x2c')]({'where':_0x37f100[_0x5531('0x4c')]})['then'](function(_0x496761){_0x130eb0[_0x5531('0x2c')]=_0x496761;if(_0x132609['query'][_0x5531('0x67')]){_0x37f100['include']=[{'all':!![]}];}return db[_0x5531('0x65')][_0x5531('0x52')](_0x37f100);})[_0x5531('0x1c')](function(_0x4e4a2d){_0x130eb0[_0x5531('0x53')]=_0x4e4a2d;return _0x130eb0;});}})[_0x5531('0x1c')](respondWithFilteredResult(_0x341dba,_0x37f100))[_0x5531('0x27')](handleError(_0x341dba,null));};exports[_0x5531('0x68')]=function(_0x28c4ba,_0x49efda,_0x18e311){return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0x28c4ba[_0x5531('0x61')]['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x49efda,null))[_0x5531('0x1c')](function(_0x13319e){if(_0x13319e){return _0x13319e[_0x5531('0x68')](_0x28c4ba['query']['ids']);}})['then'](respondWithStatusCode(_0x49efda,null))['catch'](handleError(_0x49efda,null));};exports[_0x5531('0x69')]=function(_0xf85982,_0xb27797,_0x269685){if(_0xf85982[_0x5531('0x60')]['id']){delete _0xf85982[_0x5531('0x60')]['id'];}return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0xf85982[_0x5531('0x61')]['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0xb27797,null))[_0x5531('0x1c')](function(_0x476c7f){if(_0x476c7f){_0xf85982['body'][_0x5531('0x64')]=_0x476c7f['id'];return db[_0x5531('0x6a')][_0x5531('0x58')](_0xf85982[_0x5531('0x60')]);}})[_0x5531('0x1c')](respondWithResult(_0xb27797,null))['catch'](handleError(_0xb27797,null));};exports[_0x5531('0x6b')]=function(_0x29f8b5,_0x482c58,_0x20c1fa){var _0x12c416={'raw':![],'where':{}};var _0x51a3ae={};var _0x22bacb={'count':0x0,'rows':[]};return db[_0x5531('0x3c')][_0x5531('0x6c')]({'where':{'id':_0x29f8b5[_0x5531('0x61')]['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x482c58,null))['then'](function(_0x14c3e5){if(_0x14c3e5){_0x51a3ae[_0x5531('0x41')]=_[_0x5531('0x43')](db['CannedAnswer'][_0x5531('0x3d')]);_0x51a3ae[_0x5531('0x42')]=_[_0x5531('0x43')](_0x29f8b5['query']);_0x51a3ae[_0x5531('0x44')]=_['intersection'](_0x51a3ae['model'],_0x51a3ae[_0x5531('0x42')]);_0x12c416['attributes']=_[_0x5531('0x45')](_0x51a3ae['model'],qs[_0x5531('0x46')](_0x29f8b5[_0x5531('0x42')][_0x5531('0x46')]));_0x12c416[_0x5531('0x47')]=_0x12c416[_0x5531('0x47')][_0x5531('0x55')]?_0x12c416[_0x5531('0x47')]:_0x51a3ae[_0x5531('0x41')];if(!_0x29f8b5[_0x5531('0x42')][_0x5531('0x48')](_0x5531('0x49'))){_0x12c416[_0x5531('0x2b')]=qs['limit'](_0x29f8b5[_0x5531('0x42')][_0x5531('0x2b')]);_0x12c416[_0x5531('0x2d')]=qs['offset'](_0x29f8b5[_0x5531('0x42')][_0x5531('0x2d')]);}_0x12c416[_0x5531('0x4a')]=qs[_0x5531('0x4b')](_0x29f8b5[_0x5531('0x42')][_0x5531('0x4b')]);_0x12c416['where']=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x29f8b5[_0x5531('0x42')],_0x51a3ae[_0x5531('0x44')]));_0x12c416[_0x5531('0x4c')][_0x5531('0x64')]=_0x14c3e5['id'];if(_0x29f8b5[_0x5531('0x42')][_0x5531('0x4e')]){_0x12c416[_0x5531('0x4c')]=_[_0x5531('0x4f')](_0x12c416[_0x5531('0x4c')],{'$or':_[_0x5531('0x3b')](_0x12c416[_0x5531('0x47')],function(_0x35c848){var _0x55cd81={};_0x55cd81[_0x35c848]={'$like':'%'+_0x29f8b5[_0x5531('0x42')][_0x5531('0x4e')]+'%'};return _0x55cd81;})});}_0x12c416=_[_0x5531('0x4f')]({},_0x12c416,_0x29f8b5[_0x5531('0x51')]);return db[_0x5531('0x6a')][_0x5531('0x2c')]({'where':_0x12c416['where']})['then'](function(_0x4b319f){_0x22bacb[_0x5531('0x2c')]=_0x4b319f;if(_0x29f8b5[_0x5531('0x42')][_0x5531('0x67')]){_0x12c416[_0x5531('0x56')]=[{'all':!![]}];}return db[_0x5531('0x6a')][_0x5531('0x52')](_0x12c416);})[_0x5531('0x1c')](function(_0x34a690){_0x22bacb[_0x5531('0x53')]=_0x34a690;return _0x22bacb;});}})[_0x5531('0x1c')](respondWithFilteredResult(_0x482c58,_0x12c416))[_0x5531('0x27')](handleError(_0x482c58,null));};exports[_0x5531('0x6d')]=function(_0x2d97eb,_0x15722b,_0x1ad450){return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0x2d97eb['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x15722b,null))[_0x5531('0x1c')](function(_0x32ee78){if(_0x32ee78){return _0x32ee78[_0x5531('0x6d')](_0x2d97eb[_0x5531('0x42')][_0x5531('0x6e')]);}})[_0x5531('0x1c')](respondWithStatusCode(_0x15722b,null))[_0x5531('0x27')](handleError(_0x15722b,null));};exports[_0x5531('0x6f')]=function(_0x15ce34,_0x3ba3fd,_0xa163eb){var _0x3172dc={'channel':_0x5531('0x70')};var _0x5a4398=[];var _0xb5bbb1=[];var _0x59c830={};return db['SmsAccount'][_0x5531('0x57')]({'where':{'id':_0x15ce34['params']['id']},'include':[{'model':db[_0x5531('0x71')],'as':_0x5531('0x72')}]})[_0x5531('0x1c')](handleEntityNotFound(_0x3ba3fd,null))[_0x5531('0x1c')](function(_0x1da9e6){_0x3172dc[_0x5531('0x73')]=_0x1da9e6;_0x3172dc[_0x5531('0x74')]=_[_0x5531('0x75')](_0x1da9e6['Applications'],[_0x5531('0x76')],[_0x5531('0x77')]);if(_0x3172dc[_0x5531('0x73')][_0x5531('0x72')]){delete _0x3172dc[_0x5531('0x73')]['Applications'];}return db['CmContact']['describe']();})[_0x5531('0x1c')](function(_0x4bdb7a){if(!_0x4bdb7a){throw new db[(_0x5531('0x78'))][(_0x5531('0x79'))](_0x5531('0x7a'));}_0x5a4398=_[_0x5531('0x7b')](_[_0x5531('0x43')](_0x4bdb7a),[_0x5531('0x7c'),_0x5531('0x7d')]);_0xb5bbb1=_['difference'](_[_0x5531('0x43')](_0x4bdb7a),[_0x5531('0x7c'),_0x5531('0x7d'),'CompanyId',_0x5531('0x7e')]);_0x3172dc[_0x5531('0x60')]={'mapKey':'mobile'};if(_0x3172dc[_0x5531('0x73')][_0x5531('0x3f')]){switch(_0x3172dc[_0x5531('0x73')][_0x5531('0x3f')]){case _0x5531('0x7f'):_0x3172dc['body'][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x81')];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34['body'][_0x5531('0x82')];_0x3172dc[_0x5531('0x60')][_0x5531('0x83')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x84')];break;case _0x5531('0x85'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]='+'+_0x15ce34[_0x5531('0x60')][_0x5531('0x86')];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')]['text'];break;case _0x5531('0x87'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x80')];_0x3172dc['body'][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x25')];break;case _0x5531('0x88'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')]['from'];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x60')];_0x3172dc['body'][_0x5531('0x83')]=_0x15ce34['body'][_0x5531('0x89')];break;case _0x5531('0x8a'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x81')];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34['body'][_0x5531('0x8b')];_0x3172dc[_0x5531('0x60')]['messageId']=_0x15ce34[_0x5531('0x60')][_0x5531('0x8c')];break;case _0x5531('0x8d'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]='+'+_0x15ce34['body'][_0x5531('0x8e')][0x0][_0x5531('0x80')];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x8e')][0x0][_0x5531('0x8f')];_0x3172dc[_0x5531('0x60')][_0x5531('0x83')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x8e')][0x0][_0x5531('0x83')];break;case _0x5531('0x90'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x91')];_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')]['segmentedMessage']['message'];break;case _0x5531('0x92'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x93')];_0x3172dc[_0x5531('0x60')]['body']=_0x15ce34[_0x5531('0x60')][_0x5531('0x8f')];_0x3172dc[_0x5531('0x60')][_0x5531('0x83')]=_0x15ce34['body'][_0x5531('0x94')];break;case'bandwidth':_0x3172dc[_0x5531('0x60')]['messageId']=_0x15ce34[_0x5531('0x60')][0x0][_0x5531('0x25')]['id'];_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34['body'][0x0]['message'][_0x5531('0x80')];_0x3172dc[_0x5531('0x60')]['body']=_0x15ce34[_0x5531('0x60')][0x0][_0x5531('0x25')][_0x5531('0x8f')];break;case _0x5531('0x95'):_0x3172dc[_0x5531('0x60')][_0x5531('0x80')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x80')];_0x3172dc['body'][_0x5531('0x60')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x25')];_0x3172dc[_0x5531('0x60')][_0x5531('0x83')]=_0x15ce34[_0x5531('0x60')][_0x5531('0x96')];break;}}if(_0x3172dc[_0x5531('0x60')]['id']){delete _0x3172dc[_0x5531('0x60')]['id'];}if(_[_0x5531('0x97')](_0x3172dc[_0x5531('0x60')]['from'])){throw new db[(_0x5531('0x78'))][(_0x5531('0x79'))](_0x5531('0x98'));}if(_[_0x5531('0x97')](_0x3172dc[_0x5531('0x60')][_0x5531('0x60')])||_0x3172dc[_0x5531('0x60')][_0x5531('0x60')]===''){throw new db[(_0x5531('0x78'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5531('0x97')](_0x3172dc[_0x5531('0x60')][_0x5531('0x99')])){throw new db['Sequelize'][(_0x5531('0x79'))](_0x5531('0x9a')+_0xb5bbb1);}if(!_[_0x5531('0x9b')](_0xb5bbb1,_0x3172dc[_0x5531('0x60')][_0x5531('0x99')])){throw new db[(_0x5531('0x78'))][(_0x5531('0x79'))](_0x5531('0x9c')+_0xb5bbb1);}_0x59c830[_0x3172dc['body'][_0x5531('0x99')]]=_0x3172dc[_0x5531('0x60')][_0x5531('0x80')];return db['CmList']['find']({'where':{'id':_0x3172dc[_0x5531('0x73')][_0x5531('0x7e')]},'include':[{'model':db[_0x5531('0x9d')],'as':'Contacts','where':_0x59c830,'limit':0x1,'order':[[_0x5531('0x7d'),_0x5531('0x9e')]]}]});})['then'](handleEntityNotFound(_0x3ba3fd,null))[_0x5531('0x1c')](function(_0x1228a0){if(_0x1228a0){_0x3172dc['list']=_[_0x5531('0x9f')](_0x1228a0,[_0x5531('0xa0')]);if(_0x1228a0['Contacts'][_0x5531('0x55')]){return _0x1228a0[_0x5531('0xa0')][0x0];}var _0x1cdfd3=_[_0x5531('0xa1')](_0x3172dc['body'],{'firstName':_0x3172dc[_0x5531('0x60')][_0x5531('0x80')],'ListId':_0x1228a0['id']});_0x1cdfd3[_0x3172dc[_0x5531('0x60')][_0x5531('0x99')]]=_0x3172dc[_0x5531('0x60')][_0x5531('0x80')];return db[_0x5531('0x9d')][_0x5531('0x58')](_0x1cdfd3,{'fields':_0x5a4398,'raw':!![]});}})[_0x5531('0x1c')](handleEntityNotFound(_0x3ba3fd,null))['then'](function(_0xab2bef){if(_0xab2bef){_0x3172dc[_0x5531('0xa2')]=_0xab2bef;var _0x5cbe70={'ContactId':_0xab2bef['id'],'phone':_0x3172dc[_0x5531('0x60')]['from'],'SmsAccountId':_0x15ce34[_0x5531('0x61')]['id']};var _0x305e83={'ContactId':_0xab2bef['id'],'SmsAccountId':_0x15ce34[_0x5531('0x61')]['id'],'closed':![]};return db[_0x5531('0xa3')]['find']({'where':_0x305e83})[_0x5531('0x1c')](function(_0x2fec62){if(_0x2fec62){return[_0x2fec62,![]];}return db[_0x5531('0xa3')][_0x5531('0x58')](_0x5cbe70)['then'](function(_0x59b6d0){return[_0x59b6d0,!![]];});});}})['spread'](function(_0x4cd581,_0x509a37){_0x3172dc[_0x5531('0xa4')]=_0x4cd581['get']({'plain':!![]});_0x3172dc[_0x5531('0xa4')]['created']=![];if(_0x509a37){if(_0x3172dc[_0x5531('0x73')][_0x5531('0xa5')]){_0x3172dc['applications'][_0x5531('0xa6')]({'id':0x0,'priority':_0x3172dc[_0x5531('0x74')][_0x5531('0x55')]+0x1,'app':_0x5531('0xa7'),'appdata':_0x5531('0xa8'),'interval':'*,*,*,*'});}_0x3172dc['interaction'][_0x5531('0xa9')]=!![];}return db['SmsMessage'][_0x5531('0x58')]({'phone':_0x3172dc[_0x5531('0x60')]['from'],'messageId':_0x3172dc[_0x5531('0x60')][_0x5531('0x83')],'body':_0x3172dc[_0x5531('0x60')][_0x5531('0x60')],'SmsAccountId':_0x15ce34['params']['id'],'SmsInteractionId':_0x4cd581['id'],'direction':'in','ContactId':_0x4cd581[_0x5531('0xaa')],'AttachmentId':_0x3172dc[_0x5531('0x60')][_0x5531('0xab')]});})['then'](function(_0x987494){_0x3172dc[_0x5531('0x25')]=_0x987494;if(_0x3172dc[_0x5531('0xa4')][_0x5531('0xac')]){return db[_0x5531('0xad')][_0x5531('0x57')]({'attributes':['id',_0x5531('0x36')],'where':{'id':_0x3172dc['interaction'][_0x5531('0xac')]}})[_0x5531('0x1c')](function(_0x3b5105){if(_0x3b5105){_0x3172dc['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5531('0xae'),'appdata':_0x3b5105[_0x5531('0x36')]+','+(_0x3172dc[_0x5531('0x73')]['waitForTheAssignedAgent']||0xa),'interval':_0x5531('0xaf')});}return respondWithRpcPromise('Start',_0x5531('0xb0'),_0x3172dc);});}return respondWithRpcPromise(_0x5531('0xb1'),_0x5531('0xb0'),_0x3172dc);})[_0x5531('0x1c')](function(_0x26c8aa){if(_0x26c8aa){var _0x5083df=0xc8;var _0x77db6=_0x5531('0xb2');logger[_0x5531('0x1d')](_0x5531('0x21'),_0x77db6,_0x5083df,_0x5531('0xb3'));logger[_0x5531('0x20')](_0x5531('0xb4'),_0x77db6,_0x5083df,_0x5531('0xb3'),JSON[_0x5531('0x22')](_0x26c8aa));if(_0x3172dc[_0x5531('0x73')][_0x5531('0x3f')]==='twilio'){return _0x3ba3fd['status'](_0x5083df)[_0x5531('0x2e')](_0x5531('0xb5'),'text/xml')[_0x5531('0x37')](_0x5531('0xb6'));}else{return _0x3ba3fd[_0x5531('0x28')](_0x5083df)['json'](_0x26c8aa);}}})[_0x5531('0x27')](handleError(_0x3ba3fd,null));};exports['addApplications']=function(_0x2f65fa,_0x16d581){var _0x4a391e=_0x2f65fa[_0x5531('0x61')]['id'];var _0x14d433=_0x2f65fa[_0x5531('0x60')];var _0x58128c=0xc8;var _0x30ba62=null;return db[_0x5531('0xb7')][_0x5531('0xb8')]({'isolationLevel':db[_0x5531('0xb7')][_0x5531('0xb9')][_0x5531('0xba')][_0x5531('0xbb')]},function(_0x2338fd){return db[_0x5531('0x3c')][_0x5531('0x6c')]({'where':{'id':_0x4a391e},'transaction':_0x2338fd})[_0x5531('0x1c')](function(_0x51c7ee){if(_0x51c7ee){return db['SmsApplication'][_0x5531('0x33')]({'where':{'SmsAccountId':_0x4a391e},'transaction':_0x2338fd})['then'](function(){var _0x286227=_[_0x5531('0x3b')](_0x14d433,function(_0x4b04d3){_0x4b04d3[_0x5531('0x64')]=_0x4a391e;return _0x4b04d3;});return db[_0x5531('0x71')][_0x5531('0xbc')](_0x286227,{'transaction':_0x2338fd});});}else{_0x58128c=0x194;_0x30ba62=[];}});})[_0x5531('0x1c')](function(){if(_0x58128c!==0x194){return db[_0x5531('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x4a391e},'order':_0x5531('0x76')})[_0x5531('0x1c')](function(_0xcd1b24){_0x30ba62=_0xcd1b24;});}})[_0x5531('0x27')](function(_0x3766b9){_0x58128c=0x1f4;logger[_0x5531('0x23')](_0x3766b9[_0x5531('0x35')]);if(_0x3766b9[_0x5531('0x36')]){delete _0x3766b9['name'];}_0x30ba62=_0x3766b9;})['finally'](function(){if(_0x30ba62===null){_0x16d581[_0x5531('0x34')](_0x58128c);}else{if(_0x58128c===0x1f4){_0x16d581[_0x5531('0x28')](_0x58128c)[_0x5531('0x37')](_0x30ba62);}else{_0x16d581['status'](_0x58128c)['json'](_0x30ba62);}}});};exports[_0x5531('0xbd')]=function(_0x25aeec,_0x3a3b95,_0x3d3daf){var _0x3564c4={};var _0x36d12c={};var _0x1deeac;var _0xb21704;return db['SmsAccount']['findOne']({'where':{'id':_0x25aeec[_0x5531('0x61')]['id']}})['then'](handleEntityNotFound(_0x3a3b95,null))[_0x5531('0x1c')](function(_0x390d51){if(_0x390d51){_0x1deeac=_0x390d51;_0x36d12c['model']=_['keys'](db[_0x5531('0x71')][_0x5531('0x3d')]);_0x36d12c['query']=_['keys'](_0x25aeec[_0x5531('0x42')]);_0x36d12c['filters']=_[_0x5531('0x45')](_0x36d12c[_0x5531('0x41')],_0x36d12c[_0x5531('0x42')]);_0x3564c4[_0x5531('0x47')]=_[_0x5531('0x45')](_0x36d12c[_0x5531('0x41')],qs[_0x5531('0x46')](_0x25aeec[_0x5531('0x42')][_0x5531('0x46')]));_0x3564c4[_0x5531('0x47')]=_0x3564c4[_0x5531('0x47')][_0x5531('0x55')]?_0x3564c4[_0x5531('0x47')]:_0x36d12c['model'];_0x3564c4[_0x5531('0x4a')]=qs[_0x5531('0x4b')](_0x25aeec[_0x5531('0x42')][_0x5531('0x4b')]);_0x3564c4[_0x5531('0x4c')]=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x25aeec[_0x5531('0x42')],_0x36d12c['filters']));if(_0x25aeec[_0x5531('0x42')][_0x5531('0x4e')]){_0x3564c4['where']=_[_0x5531('0x4f')](_0x3564c4[_0x5531('0x4c')],{'$or':_[_0x5531('0x3b')](_0x3564c4['attributes'],function(_0x5541cf){var _0x574805={};_0x574805[_0x5541cf]={'$like':'%'+_0x25aeec['query']['filter']+'%'};return _0x574805;})});}_0x3564c4=_['merge']({},_0x3564c4,_0x25aeec[_0x5531('0x51')]);return _0x1deeac[_0x5531('0xbd')](_0x3564c4);}})[_0x5531('0x1c')](function(_0x3fb218){if(_0x3fb218){_0xb21704=_0x3fb218[_0x5531('0x55')];if(!_0x25aeec[_0x5531('0x42')][_0x5531('0x48')](_0x5531('0x49'))){_0x3564c4['limit']=qs[_0x5531('0x2b')](_0x25aeec[_0x5531('0x42')][_0x5531('0x2b')]);_0x3564c4[_0x5531('0x2d')]=qs[_0x5531('0x2d')](_0x25aeec[_0x5531('0x42')]['offset']);}return _0x1deeac[_0x5531('0xbd')](_0x3564c4);}})[_0x5531('0x1c')](function(_0x41e34f){if(_0x41e34f){return _0x41e34f?{'count':_0xb21704,'rows':_0x41e34f}:null;}})[_0x5531('0x1c')](respondWithResult(_0x3a3b95,null))['catch'](handleError(_0x3a3b95,null));};exports[_0x5531('0xbe')]=function(_0x2d2fd7,_0x374539,_0x446c4b){var _0x193249={'raw':![],'where':{}};var _0x2b47bc={};var _0x3497eb={'count':0x0,'rows':[]};return db[_0x5531('0x3c')][_0x5531('0x6c')]({'where':{'id':_0x2d2fd7[_0x5531('0x61')]['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x374539,null))[_0x5531('0x1c')](function(_0xafe3b4){if(_0xafe3b4){_0x2b47bc[_0x5531('0x41')]=_[_0x5531('0x43')](db['SmsInteraction'][_0x5531('0x3d')]);_0x2b47bc[_0x5531('0x42')]=_[_0x5531('0x43')](_0x2d2fd7[_0x5531('0x42')]);_0x2b47bc[_0x5531('0x44')]=_[_0x5531('0x45')](_0x2b47bc[_0x5531('0x41')],_0x2b47bc['query']);_0x193249[_0x5531('0x47')]=_[_0x5531('0x45')](_0x2b47bc[_0x5531('0x41')],qs[_0x5531('0x46')](_0x2d2fd7['query'][_0x5531('0x46')]));_0x193249[_0x5531('0x47')]=_0x193249[_0x5531('0x47')][_0x5531('0x55')]?_0x193249['attributes']:_0x2b47bc[_0x5531('0x41')];if(!_0x2d2fd7['query']['hasOwnProperty'](_0x5531('0x49'))){_0x193249[_0x5531('0x2b')]=qs[_0x5531('0x2b')](_0x2d2fd7[_0x5531('0x42')][_0x5531('0x2b')]);_0x193249['offset']=qs[_0x5531('0x2d')](_0x2d2fd7[_0x5531('0x42')][_0x5531('0x2d')]);}_0x193249[_0x5531('0x4a')]=qs[_0x5531('0x4b')](_0x2d2fd7[_0x5531('0x42')][_0x5531('0x4b')]);_0x193249[_0x5531('0x4c')]=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x2d2fd7[_0x5531('0x42')],_0x2b47bc[_0x5531('0x44')]));_0x193249['where'][_0x5531('0x64')]=_0xafe3b4['id'];if(_0x2d2fd7['query'][_0x5531('0x4e')]){_0x193249[_0x5531('0x4c')]=_[_0x5531('0x4f')](_0x193249['where'],{'$or':_[_0x5531('0x3b')](_0x193249[_0x5531('0x47')],function(_0x3f523e){var _0x44fca7={};_0x44fca7[_0x3f523e]={'$like':'%'+_0x2d2fd7[_0x5531('0x42')][_0x5531('0x4e')]+'%'};return _0x44fca7;})});}_0x193249=_[_0x5531('0x4f')]({},_0x193249,_0x2d2fd7[_0x5531('0x51')]);return db[_0x5531('0xa3')][_0x5531('0x2c')]({'where':_0x193249['where']})[_0x5531('0x1c')](function(_0x395334){_0x3497eb['count']=_0x395334;if(_0x2d2fd7['query'][_0x5531('0x67')]){_0x193249['include']=[{'model':db[_0x5531('0x9d')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5531('0xbf'),'attributes':['name',_0x5531('0xc0'),_0x5531('0xc1')],'required':![]},{'model':db[_0x5531('0xc2')],'as':_0x5531('0xc3'),'attributes':['id',_0x5531('0x36'),_0x5531('0xc4')],'where':_0x2d2fd7[_0x5531('0x42')][_0x5531('0xc5')]?{'id':_0x2d2fd7[_0x5531('0x42')]['tag']}:undefined,'required':_0x2d2fd7[_0x5531('0x42')][_0x5531('0xc5')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x193249);})[_0x5531('0x1c')](function(_0x59ae79){_0x3497eb[_0x5531('0x53')]=_0x59ae79;return _0x3497eb;});}})[_0x5531('0x1c')](respondWithFilteredResult(_0x374539,_0x193249))['catch'](handleError(_0x374539,null));};exports['send']=function(_0x32c611,_0x3fb74a,_0x417561){var _0x313c5f,_0x127d26,_0x4a6661;if(_[_0x5531('0x97')](_0x32c611['body'][_0x5531('0x60')])||_0x32c611[_0x5531('0x60')][_0x5531('0x60')]===''){throw new db['Sequelize'][(_0x5531('0x79'))](_0x5531('0xc6'));}if(_['isNil'](_0x32c611['body']['to'])){throw new db['Sequelize']['ValidationError'](_0x5531('0xc7'));}_0x313c5f=_0x32c611[_0x5531('0x60')]['to'];return db['SmsAccount'][_0x5531('0x57')]({'where':{'id':_0x32c611[_0x5531('0x61')]['id']},'include':[{'model':db[_0x5531('0xc8')],'as':'List','include':[{'model':db[_0x5531('0x9d')],'as':'Contacts','where':{'mobile':_0x313c5f},'limit':0x1,'order':[[_0x5531('0x7d'),_0x5531('0x9e')]]}]}]})['then'](handleEntityNotFound(_0x3fb74a,null))[_0x5531('0x1c')](function(_0x5c997d){if(_0x5c997d&&_0x5c997d[_0x5531('0xc9')]){_0x127d26=_0x5c997d[_0x5531('0x5a')]({'plain':!![]});if(_0x127d26[_0x5531('0xc9')]&&_0x127d26['List'][_0x5531('0xa0')][_0x5531('0x55')]){return _0x127d26[_0x5531('0xc9')][_0x5531('0xa0')][0x0];}return db[_0x5531('0x9d')][_0x5531('0x58')](_[_0x5531('0xa1')](_0x32c611['body'],{'firstName':_0x313c5f,'mobile':_0x313c5f,'phone':_0x313c5f,'ListId':_0x127d26[_0x5531('0x7e')]}));}})[_0x5531('0x1c')](handleEntityNotFound(_0x3fb74a,null))[_0x5531('0x1c')](function(_0x3a0c99){if(_0x3a0c99){_0x4a6661=_0x3a0c99;return db[_0x5531('0xa3')]['find']({'where':{'ContactId':_0x4a6661['id'],'closed':![],'SmsAccountId':_0x127d26['id']}})[_0x5531('0x1c')](function(_0xf9f0c1){if(_0xf9f0c1){return[_0xf9f0c1,![]];}return db[_0x5531('0xa3')]['create']({'UserId':_0x32c611[_0x5531('0x59')]['id'],'ContactId':_0x4a6661['id'],'SmsAccountId':_0x127d26['id'],'phone':_0x313c5f,'firstMsgDirection':'out','Messages':[_[_0x5531('0x4f')](_0x32c611[_0x5531('0x60')],{'read':![],'body':_0x32c611[_0x5531('0x60')][_0x5531('0x60')],'phone':_0x313c5f,'SmsAccountId':_0x127d26['id'],'UserId':_0x32c611[_0x5531('0x59')]['id'],'ContactId':_0x4a6661['id']})]},{'include':[{'model':db[_0x5531('0xca')],'as':_0x5531('0xcb')}]})[_0x5531('0x1c')](function(_0x3550bd){return[_0x3550bd,!![]];});});}})[_0x5531('0xcc')](function(_0x1d6be9,_0x157945){if(_0x157945){return _0x1d6be9;}return db[_0x5531('0xca')][_0x5531('0x58')](_[_0x5531('0x4f')](_0x32c611[_0x5531('0x60')],{'read':![],'body':_0x32c611[_0x5531('0x60')][_0x5531('0x60')],'phone':_0x313c5f,'SmsAccountId':_0x127d26['id'],'SmsInteractionId':_0x1d6be9['id'],'UserId':_0x32c611[_0x5531('0x59')]['id'],'ContactId':_0x4a6661['id']}))[_0x5531('0x1c')](function(_0x3bd077){_0x1d6be9[_0x5531('0xcd')][_0x5531('0xcb')]=[];_0x1d6be9[_0x5531('0xcd')][_0x5531('0xcb')][_0x5531('0xa6')](_0x3bd077[_0x5531('0xcd')]);return _0x1d6be9;});})[_0x5531('0x1c')](respondWithResult(_0x3fb74a,null))['catch'](handleError(_0x3fb74a,null));};exports[_0x5531('0x28')]=function(_0x27d105,_0x4536d5,_0x28a1d7){if(_0x27d105[_0x5531('0x60')]['id']){delete _0x27d105[_0x5531('0x60')]['id'];}var _0x25b145,_0x3a8e89,_0x45df59;return db['SmsAccount'][_0x5531('0x57')]({'where':{'id':_0x27d105['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x4536d5,null))[_0x5531('0x1c')](function(_0x21721a){if(_0x21721a){_0x45df59=_0x21721a;logger[_0x5531('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5531('0x28'),_0x5531('0xce'),_0x21721a['type'],util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));switch(_0x21721a[_0x5531('0x3f')]){case _0x5531('0x85'):if(_0x27d105[_0x5531('0x60')][_0x5531('0xd0')]&&_0x27d105[_0x5531('0x60')][_0x5531('0x28')]){_0x3a8e89=_0x27d105[_0x5531('0x60')][_0x5531('0x28')];return db[_0x5531('0xca')][_0x5531('0x57')]({'where':{'messageId':_0x27d105[_0x5531('0x60')][_0x5531('0xd0')]}});}break;case'connectel':if(_0x27d105[_0x5531('0x60')]['requestid']&&_0x27d105[_0x5531('0x60')][_0x5531('0xd1')]){_0x3a8e89=_0x27d105[_0x5531('0x60')][_0x5531('0xd1')];return db['SmsMessage'][_0x5531('0x57')]({'where':{'messageId':_0x27d105[_0x5531('0x60')]['requestid']}});}break;case'clicksend':if(_0x27d105[_0x5531('0x60')]['message_id']&&_0x27d105[_0x5531('0x60')][_0x5531('0xd2')]){_0x3a8e89=_0x27d105[_0x5531('0x60')][_0x5531('0xd2')];return db['SmsMessage']['find']({'where':{'messageId':_0x27d105[_0x5531('0x60')][_0x5531('0x89')]}});}break;case _0x5531('0x8d'):var _0x19a5f4=_0x27d105[_0x5531('0x60')]['results'][0x0];if(_0x19a5f4[_0x5531('0x83')]&&_0x19a5f4[_0x5531('0x28')][_0x5531('0xd3')]===_0x5531('0xd4')){_0x3a8e89=_0x19a5f4[_0x5531('0x28')][_0x5531('0xd3')];return db['SmsMessage'][_0x5531('0x57')]({'where':{'messageId':_0x19a5f4[_0x5531('0x83')]}});}break;case'clickatell':if(_0x27d105[_0x5531('0x60')][_0x5531('0x83')]&&_0x27d105[_0x5531('0x60')][_0x5531('0x28')]){_0x3a8e89=_0x27d105[_0x5531('0x60')][_0x5531('0x28')];return db[_0x5531('0xca')]['find']({'where':{'messageId':_0x27d105[_0x5531('0x60')]['messageId']}});}break;case'bandwidth':if(_0x27d105[_0x5531('0x60')][0x0][_0x5531('0x25')]['id']){_0x3a8e89=_0x27d105[_0x5531('0x60')][0x0][_0x5531('0x3f')];return db[_0x5531('0xca')][_0x5531('0x57')]({'where':{'messageId':_0x27d105['body'][0x0][_0x5531('0x25')]['id']}});}break;case _0x5531('0x95'):if(_0x27d105[_0x5531('0x60')][_0x5531('0xd5')]&&_0x27d105[_0x5531('0x60')][_0x5531('0x28')]){_0x3a8e89=_0x27d105[_0x5531('0x60')][_0x5531('0x28')];return db['SmsMessage'][_0x5531('0x57')]({'where':{'messageId':_0x27d105[_0x5531('0x60')]['redif']}});}break;}}})[_0x5531('0x1c')](handleEntityNotFound(_0x4536d5,null))['then'](function(_0x5d3c80){if(_0x5d3c80){_0x25b145=_0x5d3c80;switch(_0x45df59[_0x5531('0x3f')]){case _0x5531('0x85'):if(_0x3a8e89===_0x5531('0xd4')){return _0x25b145['update']({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),_0x5531('0x28'),'skebby',util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));}break;case _0x5531('0x87'):if(_0x3a8e89==='1'){return _0x25b145['update']({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),'status',_0x5531('0x85'),util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));}break;case _0x5531('0x88'):if(!_0x27d105[_0x5531('0x60')][_0x5531('0xd6')]&&_0x3a8e89>=0xc8&&_0x3a8e89<=0xce){return _0x25b145[_0x5531('0x5f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5531('0x28'),_0x5531('0x88'),util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));}break;case _0x5531('0x8d'):var _0x3b62c5=_0x27d105['body'][_0x5531('0x8e')][0x0];if(_0x3b62c5[_0x5531('0x28')][_0x5531('0xd3')]==='DELIVERED'){return _0x25b145[_0x5531('0x5f')]({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),_0x5531('0x28'),'infobip',util[_0x5531('0xcf')](_0x27d105['body'],{'showHidden':![],'depth':null}));}break;case _0x5531('0x92'):if(_0x3a8e89=='DELIVERED_TO_GATEWAY'||_0x3a8e89==_0x5531('0xd7')){return _0x25b145[_0x5531('0x5f')]({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),_0x5531('0x28'),'clickatell',util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));}break;case _0x5531('0xd8'):if(_0x3a8e89==_0x5531('0xd9')){return _0x25b145[_0x5531('0x5f')]({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),_0x5531('0x28'),_0x5531('0xd8'),util[_0x5531('0xcf')](_0x27d105[_0x5531('0x60')],{'showHidden':![],'depth':null}));}break;case _0x5531('0x95'):if(_0x3a8e89==='DELIVRD'||_0x3a8e89===_0x5531('0xda')){return _0x25b145[_0x5531('0x5f')]({'read':!![]});}else{logger[_0x5531('0x23')](_0x5531('0x21'),_0x5531('0x28'),_0x5531('0x95'),util[_0x5531('0xcf')](_0x27d105['body'],{'showHidden':![],'depth':null}));}break;}return _0x25b145;}})[_0x5531('0x1c')](respondWithResult(_0x4536d5,null))[_0x5531('0x27')](handleError(_0x4536d5,null));};exports['statusGet']=function(_0x362075,_0xc99fef,_0x5adf7c){var _0x1b7ba0,_0x1128eb,_0x1b87a8;return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0x362075['params']['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0xc99fef,null))[_0x5531('0x1c')](function(_0x123543){if(_0x123543){_0x1b87a8=_0x123543;logger['debug'](_0x5531('0x21'),_0x5531('0x28'),_0x5531('0xce'),_0x123543[_0x5531('0x3f')],util[_0x5531('0xcf')](_0x362075[_0x5531('0x42')],{'showHidden':![],'depth':null}));switch(_0x123543[_0x5531('0x3f')]){case _0x5531('0x90'):if(_0x362075[_0x5531('0x42')]['message-id']&&_0x362075[_0x5531('0x42')][_0x5531('0xdb')]){_0x1128eb=_0x362075[_0x5531('0x42')][_0x5531('0xdb')];return db['SmsMessage'][_0x5531('0x57')]({'where':{'messageId':_0x362075[_0x5531('0x42')]['message-id']}});}break;}}})[_0x5531('0x1c')](handleEntityNotFound(_0xc99fef,null))[_0x5531('0x1c')](function(_0x4322b4){if(_0x4322b4){_0x1b7ba0=_0x4322b4;switch(_0x1b87a8[_0x5531('0x3f')]){case'csc':if(_0x1128eb==='2'||_0x1128eb==='6'){return _0x1b7ba0[_0x5531('0x5f')]({'read':!![]});}else{logger['error'](_0x5531('0x21'),_0x5531('0x28'),_0x5531('0x90'),util['inspect'](_0x362075[_0x5531('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x1b7ba0;}})[_0x5531('0x1c')](respondWithResult(_0xc99fef,null))[_0x5531('0x27')](handleError(_0xc99fef,null));};exports['addAgents']=function(_0x1be7bc,_0x1005ca,_0x42881b){return db[_0x5531('0x3c')]['find']({'where':{'id':_0x1be7bc[_0x5531('0x61')]['id']}})['then'](handleEntityNotFound(_0x1005ca,null))['then'](function(_0xe7e18){if(_0xe7e18){return _0xe7e18[_0x5531('0xdc')](_0x1be7bc[_0x5531('0x60')]['ids'],_[_0x5531('0x9f')](_0x1be7bc[_0x5531('0x60')],[_0x5531('0x6e'),'id'])||{})[_0x5531('0xcc')](function(_0x22b1da){for(var _0x78e344=0x0;_0x78e344<_0x1be7bc[_0x5531('0x60')][_0x5531('0x6e')][_0x5531('0x55')];_0x78e344+=0x1){socket[_0x5531('0xdd')](_0x5531('0xde'),{'UserId':Number(_0x1be7bc[_0x5531('0x60')]['ids'][_0x78e344]),'SmsAccountId':Number(_0x1be7bc[_0x5531('0x61')]['id'])});}return _0x22b1da;});}})[_0x5531('0x1c')](respondWithResult(_0x1005ca,null))[_0x5531('0x27')](handleError(_0x1005ca,null));};exports[_0x5531('0xdf')]=function(_0x2201f3,_0x509880,_0x1c7d96){return db[_0x5531('0x3c')][_0x5531('0x57')]({'where':{'id':_0x2201f3[_0x5531('0x61')]['id']}})[_0x5531('0x1c')](handleEntityNotFound(_0x509880,null))['then'](function(_0x42b29f){if(_0x42b29f){return _0x42b29f['removeAgents'](_0x2201f3[_0x5531('0x42')][_0x5531('0x6e')])[_0x5531('0x1c')](function(){if(_[_0x5531('0xe0')](_0x2201f3[_0x5531('0x42')][_0x5531('0x6e')])){for(var _0xb663eb=0x0;_0xb663eb<_0x2201f3['query'][_0x5531('0x6e')]['length'];_0xb663eb+=0x1){socket[_0x5531('0xdd')](_0x5531('0xe1'),{'UserId':Number(_0x2201f3[_0x5531('0x42')]['ids'][_0xb663eb]),'SmsAccountId':Number(_0x2201f3[_0x5531('0x61')]['id'])});}}else{socket[_0x5531('0xdd')](_0x5531('0xe1'),{'UserId':Number(_0x2201f3[_0x5531('0x42')][_0x5531('0x6e')]),'SmsAccountId':Number(_0x2201f3['params']['id'])});}});}})[_0x5531('0x1c')](respondWithStatusCode(_0x509880,null))[_0x5531('0x27')](handleError(_0x509880,null));};exports[_0x5531('0xe2')]=function(_0x3cd811,_0x577c98,_0x2c279e){var _0x293bd1={};var _0xdd1f5c={};var _0x391bfd;var _0x1a0abb;return db[_0x5531('0x3c')][_0x5531('0x6c')]({'where':{'id':_0x3cd811['params']['id']}})['then'](handleEntityNotFound(_0x577c98,null))[_0x5531('0x1c')](function(_0x3d3a16){if(_0x3d3a16){_0x391bfd=_0x3d3a16;_0xdd1f5c[_0x5531('0x41')]=_[_0x5531('0x43')](db[_0x5531('0xad')][_0x5531('0x3d')]);_0xdd1f5c[_0x5531('0x42')]=_['keys'](_0x3cd811[_0x5531('0x42')]);_0xdd1f5c[_0x5531('0x44')]=_['intersection'](_0xdd1f5c[_0x5531('0x41')],_0xdd1f5c[_0x5531('0x42')]);_0x293bd1[_0x5531('0x47')]=_[_0x5531('0x45')](_0xdd1f5c['model'],qs[_0x5531('0x46')](_0x3cd811[_0x5531('0x42')][_0x5531('0x46')]));_0x293bd1[_0x5531('0x47')]=_0x293bd1[_0x5531('0x47')]['length']?_0x293bd1['attributes']:_0xdd1f5c[_0x5531('0x41')];_0x293bd1['order']=qs['sort'](_0x3cd811[_0x5531('0x42')][_0x5531('0x4b')]);_0x293bd1['where']=qs[_0x5531('0x44')](_[_0x5531('0x4d')](_0x3cd811[_0x5531('0x42')],_0xdd1f5c[_0x5531('0x44')]));if(_0x3cd811[_0x5531('0x42')]['filter']){_0x293bd1[_0x5531('0x4c')]=_[_0x5531('0x4f')](_0x293bd1['where'],{'$or':_[_0x5531('0x3b')](_0x293bd1[_0x5531('0x47')],function(_0xa830cf){var _0x54748b={};_0x54748b[_0xa830cf]={'$like':'%'+_0x3cd811['query']['filter']+'%'};return _0x54748b;})});}_0x293bd1=_['merge']({},_0x293bd1,_0x3cd811['options']);return _0x391bfd[_0x5531('0xe2')](_0x293bd1);}})[_0x5531('0x1c')](function(_0x5b2ab5){if(_0x5b2ab5){_0x1a0abb=_0x5b2ab5['length'];if(!_0x3cd811[_0x5531('0x42')][_0x5531('0x48')](_0x5531('0x49'))){_0x293bd1[_0x5531('0x2b')]=qs['limit'](_0x3cd811[_0x5531('0x42')]['limit']);_0x293bd1[_0x5531('0x2d')]=qs[_0x5531('0x2d')](_0x3cd811[_0x5531('0x42')][_0x5531('0x2d')]);}return _0x391bfd[_0x5531('0xe2')](_0x293bd1);}})[_0x5531('0x1c')](function(_0x19f464){if(_0x19f464){return _0x19f464?{'count':_0x1a0abb,'rows':_0x19f464}:null;}})['then'](respondWithResult(_0x577c98,null))[_0x5531('0x27')](handleError(_0x577c98,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 9c39476..793d0fe 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 _0x8595=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x57638e,_0x290284){var _0x36230a=function(_0x1533e7){while(--_0x1533e7){_0x57638e['push'](_0x57638e['shift']());}};_0x36230a(++_0x290284);}(_0x8595,0x173));var _0x5859=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x8595[_0x4dbaad];return _0x226c72;};'use strict';var EventEmitter=require(_0x5859('0x0'));var SmsAccount=require(_0x5859('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5859('0x2')](0x0);var events={'afterCreate':_0x5859('0x3'),'afterUpdate':_0x5859('0x4'),'afterDestroy':_0x5859('0x5')};function emitEvent(_0x77f1a4){return function(_0x23400b,_0x258531,_0x4c5a26){SmsAccountEvents[_0x5859('0x6')](_0x77f1a4+':'+_0x23400b['id'],_0x23400b);SmsAccountEvents[_0x5859('0x6')](_0x77f1a4,_0x23400b);_0x4c5a26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x5859('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x7cf5=['../../mysqldb','SmsAccount','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x5cc49e,_0x571829){var _0x5071f4=function(_0xdc5b79){while(--_0xdc5b79){_0x5cc49e['push'](_0x5cc49e['shift']());}};_0x5071f4(++_0x571829);}(_0x7cf5,0x187));var _0x57cf=function(_0x35500b,_0xc9b7a0){_0x35500b=_0x35500b-0x0;var _0x8a0f4=_0x7cf5[_0x35500b];return _0x8a0f4;};'use strict';var EventEmitter=require(_0x57cf('0x0'));var SmsAccount=require(_0x57cf('0x1'))['db'][_0x57cf('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x57cf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x57cf('0x4')};function emitEvent(_0x58baa8){return function(_0xa759d0,_0x102836,_0x3cf253){SmsAccountEvents[_0x57cf('0x5')](_0x58baa8+':'+_0xa759d0['id'],_0xa759d0);SmsAccountEvents['emit'](_0x58baa8,_0xa759d0);_0x3cf253(null);};}for(var e in events){if(events[_0x57cf('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x57cf('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 7622e8c..a3137c7 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 _0x0bc9=['moment','bluebird','request-promise','./smsAccount.attributes','define','SmsAccount','sms_accounts','../../config/logger','api'];(function(_0x59a54c,_0x4b969a){var _0x1944bf=function(_0x515bb9){while(--_0x515bb9){_0x59a54c['push'](_0x59a54c['shift']());}};_0x1944bf(++_0x4b969a);}(_0x0bc9,0x130));var _0x90bc=function(_0x3b5c95,_0x4cd12b){_0x3b5c95=_0x3b5c95-0x0;var _0x23ffb7=_0x0bc9[_0x3b5c95];return _0x23ffb7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90bc('0x0'))(_0x90bc('0x1'));var moment=require(_0x90bc('0x2'));var BPromise=require(_0x90bc('0x3'));var rp=require(_0x90bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90bc('0x5'));module['exports']=function(_0x1aa986,_0xbc563f){return _0x1aa986[_0x90bc('0x6')](_0x90bc('0x7'),attributes,{'tableName':_0x90bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56a0=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x56a0,0x12a));var _0x056a=function(_0x58d90a,_0x1a2ea6){_0x58d90a=_0x58d90a-0x0;var _0x3938a9=_0x56a0[_0x58d90a];return _0x3938a9;};'use strict';var _=require(_0x056a('0x0'));var util=require(_0x056a('0x1'));var logger=require(_0x056a('0x2'))(_0x056a('0x3'));var moment=require('moment');var BPromise=require(_0x056a('0x4'));var rp=require(_0x056a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x056a('0x6'));var config=require(_0x056a('0x7'));var attributes=require(_0x056a('0x8'));module[_0x056a('0x9')]=function(_0x27024d,_0x5724c0){return _0x27024d[_0x056a('0xa')](_0x056a('0xb'),attributes,{'tableName':_0x056a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 45b2ef9..4513129 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 _0x6ea7=['map','model','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','ShowSmsAccount','options','where','attributes','include'];(function(_0x181e12,_0x990532){var _0x40d386=function(_0xc5e616){while(--_0xc5e616){_0x181e12['push'](_0x181e12['shift']());}};_0x40d386(++_0x990532);}(_0x6ea7,0x188));var _0x76ea=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6ea7[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');var util=require(_0x76ea('0x0'));var moment=require('moment');var BPromise=require(_0x76ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76ea('0x2'));var db=require(_0x76ea('0x3'))['db'];var utils=require(_0x76ea('0x4'));var logger=require(_0x76ea('0x5'))(_0x76ea('0x6'));var config=require(_0x76ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x76ea('0x8')]['http']({'port':0x232a});config[_0x76ea('0x9')]=_['defaults'](config[_0x76ea('0x9')],{'host':_0x76ea('0xa'),'port':0x18eb});var socket=require(_0x76ea('0xb'))(new Redis(config[_0x76ea('0x9')]));require(_0x76ea('0xc'))['register'](socket);function respondWithRpcPromise(_0x85d3f4,_0x5937d1,_0x5f282b){return new BPromise(function(_0x244866,_0x2a074c){return client[_0x76ea('0xd')](_0x85d3f4,_0x5f282b)[_0x76ea('0xe')](function(_0x5b7d3a){logger[_0x76ea('0xf')](_0x76ea('0x10'),_0x5937d1,_0x76ea('0x11'));logger[_0x76ea('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5937d1,_0x76ea('0x11'),JSON[_0x76ea('0x13')](_0x5b7d3a));if(_0x5b7d3a[_0x76ea('0x14')]){if(_0x5b7d3a[_0x76ea('0x14')]['code']===0x1f4){logger[_0x76ea('0x14')](_0x76ea('0x10'),_0x5937d1,_0x5b7d3a[_0x76ea('0x14')][_0x76ea('0x15')]);return _0x2a074c(_0x5b7d3a[_0x76ea('0x14')][_0x76ea('0x15')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x5937d1,_0x5b7d3a[_0x76ea('0x14')][_0x76ea('0x15')]);return _0x244866(_0x5b7d3a[_0x76ea('0x14')][_0x76ea('0x15')]);}else{logger[_0x76ea('0xf')](_0x76ea('0x10'),_0x5937d1,_0x76ea('0x11'));_0x244866(_0x5b7d3a['result'][_0x76ea('0x15')]);}})[_0x76ea('0x16')](function(_0x183375){logger['error']('SmsAccount,\x20%s,\x20%s',_0x5937d1,_0x183375);_0x2a074c(_0x183375);});});}exports[_0x76ea('0x17')]=function(_0x2a7cb1){var _0x26ca2c=this;return new Promise(function(_0x2a8e2f,_0x107f6c){return db['SmsAccount']['find']({'raw':_0x2a7cb1['options']?_0x2a7cb1[_0x76ea('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a7cb1[_0x76ea('0x18')]?_0x2a7cb1[_0x76ea('0x18')][_0x76ea('0x19')]||null:null,'attributes':_0x2a7cb1[_0x76ea('0x18')]?_0x2a7cb1[_0x76ea('0x18')][_0x76ea('0x1a')]||null:null,'include':_0x2a7cb1[_0x76ea('0x18')]?_0x2a7cb1[_0x76ea('0x18')][_0x76ea('0x1b')]?_[_0x76ea('0x1c')](_0x2a7cb1[_0x76ea('0x18')]['include'],function(_0x246829){return{'model':db[_0x246829[_0x76ea('0x1d')]],'as':_0x246829['as'],'attributes':_0x246829[_0x76ea('0x1a')],'include':_0x246829['include']?_[_0x76ea('0x1c')](_0x246829[_0x76ea('0x1b')],function(_0x20e35a){return{'model':db[_0x20e35a[_0x76ea('0x1d')]],'as':_0x20e35a['as'],'attributes':_0x20e35a[_0x76ea('0x1a')],'include':_0x20e35a[_0x76ea('0x1b')]?_['map'](_0x20e35a[_0x76ea('0x1b')],function(_0x2b9f89){return{'model':db[_0x2b9f89[_0x76ea('0x1d')]],'as':_0x2b9f89['as'],'attributes':_0x2b9f89[_0x76ea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x76ea('0xe')](function(_0x85cd92){logger[_0x76ea('0xf')](_0x76ea('0x17'),_0x2a7cb1);logger[_0x76ea('0x12')]('ShowSmsAccount',_0x2a7cb1,JSON[_0x76ea('0x13')](_0x85cd92));_0x2a8e2f(_0x85cd92);})[_0x76ea('0x16')](function(_0x1a2821){logger['error']('ShowSmsAccount',_0x1a2821[_0x76ea('0x15')],_0x2a7cb1);_0x107f6c(_0x26ca2c[_0x76ea('0x14')](0x1f4,_0x1a2821[_0x76ea('0x15')]));});});}; \ No newline at end of file +var _0x677c=['error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53f3b7,_0x2b3e1c){var _0x417c70=function(_0x37ad59){while(--_0x37ad59){_0x53f3b7['push'](_0x53f3b7['shift']());}};_0x417c70(++_0x2b3e1c);}(_0x677c,0x81));var _0xc677=function(_0x2edd93,_0x2f40e1){_0x2edd93=_0x2edd93-0x0;var _0x51a226=_0x677c[_0x2edd93];return _0x51a226;};'use strict';var _=require(_0xc677('0x0'));var util=require('util');var moment=require(_0xc677('0x1'));var BPromise=require(_0xc677('0x2'));var rs=require(_0xc677('0x3'));var fs=require('fs');var Redis=require(_0xc677('0x4'));var db=require(_0xc677('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc677('0x6'))(_0xc677('0x7'));var config=require(_0xc677('0x8'));var jayson=require(_0xc677('0x9'));var client=jayson['client'][_0xc677('0xa')]({'port':0x232a});config[_0xc677('0xb')]=_[_0xc677('0xc')](config[_0xc677('0xb')],{'host':_0xc677('0xd'),'port':0x18eb});var socket=require(_0xc677('0xe'))(new Redis(config[_0xc677('0xb')]));require(_0xc677('0xf'))['register'](socket);function respondWithRpcPromise(_0x267e96,_0x38a355,_0x2c2633){return new BPromise(function(_0x1487a5,_0x1083ed){return client[_0xc677('0x10')](_0x267e96,_0x2c2633)['then'](function(_0x7acb1b){logger[_0xc677('0x11')](_0xc677('0x12'),_0x38a355,_0xc677('0x13'));logger[_0xc677('0x14')](_0xc677('0x15'),_0x38a355,_0xc677('0x13'),JSON[_0xc677('0x16')](_0x7acb1b));if(_0x7acb1b['error']){if(_0x7acb1b[_0xc677('0x17')][_0xc677('0x18')]===0x1f4){logger[_0xc677('0x17')](_0xc677('0x12'),_0x38a355,_0x7acb1b['error']['message']);return _0x1083ed(_0x7acb1b['error'][_0xc677('0x19')]);}logger[_0xc677('0x17')]('SmsAccount,\x20%s,\x20%s',_0x38a355,_0x7acb1b[_0xc677('0x17')]['message']);return _0x1487a5(_0x7acb1b[_0xc677('0x17')][_0xc677('0x19')]);}else{logger['info'](_0xc677('0x12'),_0x38a355,_0xc677('0x13'));_0x1487a5(_0x7acb1b['result']['message']);}})[_0xc677('0x1a')](function(_0x2b9bf6){logger[_0xc677('0x17')](_0xc677('0x12'),_0x38a355,_0x2b9bf6);_0x1083ed(_0x2b9bf6);});});}exports[_0xc677('0x1b')]=function(_0x570ebf){var _0x314399=this;return new Promise(function(_0x56cc7c,_0x2357f9){return db[_0xc677('0x1c')][_0xc677('0x1d')]({'raw':_0x570ebf[_0xc677('0x1e')]?_0x570ebf[_0xc677('0x1e')][_0xc677('0x1f')]===undefined?!![]:![]:!![],'where':_0x570ebf[_0xc677('0x1e')]?_0x570ebf[_0xc677('0x1e')][_0xc677('0x20')]||null:null,'attributes':_0x570ebf['options']?_0x570ebf[_0xc677('0x1e')][_0xc677('0x21')]||null:null,'include':_0x570ebf[_0xc677('0x1e')]?_0x570ebf[_0xc677('0x1e')][_0xc677('0x22')]?_[_0xc677('0x23')](_0x570ebf[_0xc677('0x1e')][_0xc677('0x22')],function(_0x4c47f8){return{'model':db[_0x4c47f8[_0xc677('0x24')]],'as':_0x4c47f8['as'],'attributes':_0x4c47f8[_0xc677('0x21')],'include':_0x4c47f8[_0xc677('0x22')]?_[_0xc677('0x23')](_0x4c47f8[_0xc677('0x22')],function(_0x1c439d){return{'model':db[_0x1c439d[_0xc677('0x24')]],'as':_0x1c439d['as'],'attributes':_0x1c439d[_0xc677('0x21')],'include':_0x1c439d[_0xc677('0x22')]?_[_0xc677('0x23')](_0x1c439d['include'],function(_0x1f4cf1){return{'model':db[_0x1f4cf1[_0xc677('0x24')]],'as':_0x1f4cf1['as'],'attributes':_0x1f4cf1['attributes']};}):[]};}):[]};}):[]:[]})[_0xc677('0x25')](function(_0x325f21){logger['info'](_0xc677('0x1b'),_0x570ebf);logger[_0xc677('0x14')](_0xc677('0x1b'),_0x570ebf,JSON[_0xc677('0x16')](_0x325f21));_0x56cc7c(_0x325f21);})[_0xc677('0x1a')](function(_0x33e56a){logger[_0xc677('0x17')]('ShowSmsAccount',_0x33e56a[_0xc677('0x19')],_0x570ebf);_0x2357f9(_0x314399[_0xc677('0x17')](0x1f4,_0x33e56a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 801feed..29f39c3 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var 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 8132382..55d249f 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(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5e0470,_0x50e252){var _0x62bf5f=function(_0x1c2b00){while(--_0x1c2b00){_0x5e0470['push'](_0x5e0470['shift']());}};_0x62bf5f(++_0x50e252);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 5c08c79..b7688da 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 _0x8200=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8200,0xa4));var _0x0820=function(_0x2ea242,_0x4f8602){_0x2ea242=_0x2ea242-0x0;var _0x9ec161=_0x8200[_0x2ea242];return _0x9ec161;};'use strict';var Sequelize=require(_0x0820('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0820('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0820('0x2')},'appdata':{'type':Sequelize[_0x0820('0x3')]()},'description':{'type':Sequelize[_0x0820('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0820('0x5')}}; \ No newline at end of file +var _0x3e1c=['TEXT','*,*,*,*','exports','STRING'];(function(_0x13fb02,_0x418f7e){var _0x184dcc=function(_0x5a4dfa){while(--_0x5a4dfa){_0x13fb02['push'](_0x13fb02['shift']());}};_0x184dcc(++_0x418f7e);}(_0x3e1c,0x1d6));var _0xc3e1=function(_0x39689f,_0x4b260b){_0x39689f=_0x39689f-0x0;var _0x340fc7=_0x3e1c[_0x39689f];return _0x340fc7;};'use strict';var Sequelize=require('sequelize');module[_0xc3e1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc3e1('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc3e1('0x2')]()},'description':{'type':Sequelize[_0xc3e1('0x1')]},'interval':{'type':Sequelize[_0xc3e1('0x1')],'defaultValue':_0xc3e1('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 81b4fc7..09118cb 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 _0x08e5=['type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','SmsApplication','rawAttributes'];(function(_0x41c405,_0x303d54){var _0x493f98=function(_0x2cdb57){while(--_0x2cdb57){_0x41c405['push'](_0x41c405['shift']());}};_0x493f98(++_0x303d54);}(_0x08e5,0xf2));var _0x508e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x08e5[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x508e('0x0'));var rimraf=require(_0x508e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x508e('0x2'));var rp=require('request-promise');var moment=require(_0x508e('0x3'));var BPromise=require(_0x508e('0x4'));var Mustache=require(_0x508e('0x5'));var util=require(_0x508e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x508e('0x7'));var fs=require('fs');var fs_extra=require(_0x508e('0x8'));var _=require(_0x508e('0x9'));var squel=require(_0x508e('0xa'));var crypto=require(_0x508e('0xb'));var jsforce=require(_0x508e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x508e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x508e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x508e('0xf'));var hardwareService=require(_0x508e('0x10'));var logger=require(_0x508e('0x11'))('api');var utils=require(_0x508e('0x12'));var config=require(_0x508e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x93312e,_0x2f1b33){_0x2f1b33=_0x2f1b33||0xcc;return function(_0x3e629c){if(_0x3e629c){return _0x93312e[_0x508e('0x14')](_0x2f1b33);}return _0x93312e[_0x508e('0x15')](_0x2f1b33)['end']();};}function respondWithResult(_0xae1f1e,_0x4eedfb){_0x4eedfb=_0x4eedfb||0xc8;return function(_0x503b60){if(_0x503b60){return _0xae1f1e[_0x508e('0x15')](_0x4eedfb)[_0x508e('0x16')](_0x503b60);}};}function respondWithFilteredResult(_0x2838d6,_0x29d6f7){return function(_0x199e93){if(_0x199e93){var _0xc7205e=typeof _0x29d6f7['offset']===_0x508e('0x17')&&typeof _0x29d6f7[_0x508e('0x18')]===_0x508e('0x17');var _0x2bef0b=_0x199e93[_0x508e('0x19')];var _0xa7f0e6=_0xc7205e?0x0:_0x29d6f7[_0x508e('0x1a')];var _0x53073f=_0xc7205e?_0x199e93[_0x508e('0x19')]:_0x29d6f7[_0x508e('0x1a')]+_0x29d6f7[_0x508e('0x18')];var _0x46392b;if(_0x53073f>=_0x2bef0b){_0x53073f=_0x2bef0b;_0x46392b=0xc8;}else{_0x46392b=0xce;}_0x2838d6['status'](_0x46392b);return _0x2838d6[_0x508e('0x1b')](_0x508e('0x1c'),_0xa7f0e6+'-'+_0x53073f+'/'+_0x2bef0b)[_0x508e('0x16')](_0x199e93);}return null;};}function patchUpdates(_0x20709e){return function(_0x208444){try{jsonpatch[_0x508e('0x1d')](_0x208444,_0x20709e,!![]);}catch(_0x3fa187){return BPromise[_0x508e('0x1e')](_0x3fa187);}return _0x208444[_0x508e('0x1f')]();};}function saveUpdates(_0x22a92d,_0x424147){return function(_0x201fd9){if(_0x201fd9){return _0x201fd9['update'](_0x22a92d)['then'](function(_0x237ac8){return _0x237ac8;});}return null;};}function removeEntity(_0x29b821,_0x26d969){return function(_0x554725){if(_0x554725){return _0x554725[_0x508e('0x20')]()[_0x508e('0x21')](function(){_0x29b821[_0x508e('0x15')](0xcc)[_0x508e('0x22')]();});}};}function handleEntityNotFound(_0x331822,_0x260d53){return function(_0x51ab11){if(!_0x51ab11){_0x331822[_0x508e('0x14')](0x194);}return _0x51ab11;};}function handleError(_0x3f4f20,_0x491da9){_0x491da9=_0x491da9||0x1f4;return function(_0xbd1edd){logger[_0x508e('0x23')](_0xbd1edd[_0x508e('0x24')]);if(_0xbd1edd[_0x508e('0x25')]){delete _0xbd1edd['name'];}_0x3f4f20['status'](_0x491da9)[_0x508e('0x26')](_0xbd1edd);};}exports[_0x508e('0x27')]=function(_0x435251,_0x18c9fe){var _0x376ffb={},_0x4b0eb7={},_0x4d7421={'count':0x0,'rows':[]};var _0x17142b=_['map'](db[_0x508e('0x28')][_0x508e('0x29')],function(_0x3e920d){return{'name':_0x3e920d['fieldName'],'type':_0x3e920d[_0x508e('0x2a')]['key']};});_0x4b0eb7[_0x508e('0x2b')]=_[_0x508e('0x2c')](_0x17142b,_0x508e('0x25'));_0x4b0eb7['query']=_[_0x508e('0x2d')](_0x435251[_0x508e('0x2e')]);_0x4b0eb7[_0x508e('0x2f')]=_[_0x508e('0x30')](_0x4b0eb7['model'],_0x4b0eb7[_0x508e('0x2e')]);_0x376ffb[_0x508e('0x31')]=_[_0x508e('0x30')](_0x4b0eb7[_0x508e('0x2b')],qs[_0x508e('0x32')](_0x435251[_0x508e('0x2e')][_0x508e('0x32')]));_0x376ffb[_0x508e('0x31')]=_0x376ffb[_0x508e('0x31')][_0x508e('0x33')]?_0x376ffb[_0x508e('0x31')]:_0x4b0eb7['model'];if(!_0x435251[_0x508e('0x2e')][_0x508e('0x34')](_0x508e('0x35'))){_0x376ffb[_0x508e('0x18')]=qs[_0x508e('0x18')](_0x435251[_0x508e('0x2e')][_0x508e('0x18')]);_0x376ffb[_0x508e('0x1a')]=qs[_0x508e('0x1a')](_0x435251['query'][_0x508e('0x1a')]);}_0x376ffb[_0x508e('0x36')]=qs['sort'](_0x435251[_0x508e('0x2e')][_0x508e('0x37')]);_0x376ffb['where']=qs['filters'](_[_0x508e('0x38')](_0x435251['query'],_0x4b0eb7['filters']),_0x17142b);if(_0x435251[_0x508e('0x2e')][_0x508e('0x39')]){_0x376ffb[_0x508e('0x3a')]=_[_0x508e('0x3b')](_0x376ffb['where'],{'$or':_['map'](_0x17142b,function(_0x2da027){if(_0x2da027['type']!==_0x508e('0x3c')){var _0x31aca1={};_0x31aca1[_0x2da027[_0x508e('0x25')]]={'$like':'%'+_0x435251[_0x508e('0x2e')][_0x508e('0x39')]+'%'};return _0x31aca1;}})});}_0x376ffb=_[_0x508e('0x3b')]({},_0x376ffb,_0x435251[_0x508e('0x3d')]);var _0x1e9a17={'where':_0x376ffb[_0x508e('0x3a')]};return db[_0x508e('0x28')][_0x508e('0x19')](_0x1e9a17)[_0x508e('0x21')](function(_0x1c299f){_0x4d7421['count']=_0x1c299f;if(_0x435251[_0x508e('0x2e')][_0x508e('0x3e')]){_0x376ffb[_0x508e('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0x508e('0x40')](_0x376ffb);})[_0x508e('0x21')](function(_0x15bc8f){_0x4d7421['rows']=_0x15bc8f;return _0x4d7421;})['then'](respondWithFilteredResult(_0x18c9fe,_0x376ffb))[_0x508e('0x41')](handleError(_0x18c9fe,null));};exports[_0x508e('0x42')]=function(_0xe8843c,_0x1abfb2){var _0x36f5cc={'raw':!![],'where':{'id':_0xe8843c['params']['id']}},_0x30f7d7={};_0x30f7d7[_0x508e('0x2b')]=_[_0x508e('0x2d')](db[_0x508e('0x28')][_0x508e('0x29')]);_0x30f7d7[_0x508e('0x2e')]=_[_0x508e('0x2d')](_0xe8843c['query']);_0x30f7d7[_0x508e('0x2f')]=_[_0x508e('0x30')](_0x30f7d7[_0x508e('0x2b')],_0x30f7d7[_0x508e('0x2e')]);_0x36f5cc[_0x508e('0x31')]=_[_0x508e('0x30')](_0x30f7d7['model'],qs[_0x508e('0x32')](_0xe8843c[_0x508e('0x2e')][_0x508e('0x32')]));_0x36f5cc['attributes']=_0x36f5cc[_0x508e('0x31')]['length']?_0x36f5cc[_0x508e('0x31')]:_0x30f7d7[_0x508e('0x2b')];if(_0xe8843c[_0x508e('0x2e')]['includeAll']){_0x36f5cc[_0x508e('0x3f')]=[{'all':!![]}];}_0x36f5cc=_[_0x508e('0x3b')]({},_0x36f5cc,_0xe8843c[_0x508e('0x3d')]);return db[_0x508e('0x28')][_0x508e('0x43')](_0x36f5cc)[_0x508e('0x21')](handleEntityNotFound(_0x1abfb2,null))[_0x508e('0x21')](respondWithResult(_0x1abfb2,null))[_0x508e('0x41')](handleError(_0x1abfb2,null));};exports[_0x508e('0x44')]=function(_0x6245a9,_0x2cf722){return db['SmsApplication'][_0x508e('0x44')](_0x6245a9[_0x508e('0x45')],{})[_0x508e('0x21')](respondWithResult(_0x2cf722,0xc9))[_0x508e('0x41')](handleError(_0x2cf722,null));};exports[_0x508e('0x46')]=function(_0x1b854b,_0x44209f){if(_0x1b854b[_0x508e('0x45')]['id']){delete _0x1b854b[_0x508e('0x45')]['id'];}return db[_0x508e('0x28')]['find']({'where':{'id':_0x1b854b['params']['id']}})[_0x508e('0x21')](handleEntityNotFound(_0x44209f,null))[_0x508e('0x21')](saveUpdates(_0x1b854b[_0x508e('0x45')],null))[_0x508e('0x21')](respondWithResult(_0x44209f,null))[_0x508e('0x41')](handleError(_0x44209f,null));};exports['destroy']=function(_0x295fec,_0x2a02f5){return db['SmsApplication'][_0x508e('0x43')]({'where':{'id':_0x295fec['params']['id']}})[_0x508e('0x21')](handleEntityNotFound(_0x2a02f5,null))['then'](removeEntity(_0x2a02f5,null))[_0x508e('0x41')](handleError(_0x2a02f5,null));}; \ No newline at end of file +var _0x8297=['sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8297,0x12d));var _0x7829=function(_0x43b1a8,_0x5b03a0){_0x43b1a8=_0x43b1a8-0x0;var _0x2fc797=_0x8297[_0x43b1a8];return _0x2fc797;};'use strict';var emlformat=require(_0x7829('0x0'));var rimraf=require(_0x7829('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7829('0x2'));var moment=require(_0x7829('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7829('0x4'));var util=require(_0x7829('0x5'));var path=require(_0x7829('0x6'));var sox=require(_0x7829('0x7'));var csv=require(_0x7829('0x8'));var ejs=require(_0x7829('0x9'));var fs=require('fs');var fs_extra=require(_0x7829('0xa'));var _=require('lodash');var squel=require(_0x7829('0xb'));var crypto=require(_0x7829('0xc'));var jsforce=require(_0x7829('0xd'));var deskjs=require(_0x7829('0xe'));var toCsv=require(_0x7829('0x8'));var querystring=require('querystring');var Papa=require(_0x7829('0xf'));var Redis=require(_0x7829('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7829('0x11'));var as=require(_0x7829('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7829('0x13'))('api');var utils=require(_0x7829('0x14'));var config=require(_0x7829('0x15'));var licenseUtil=require(_0x7829('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17745a,_0x27cb8c){_0x27cb8c=_0x27cb8c||0xcc;return function(_0x5dd6a7){if(_0x5dd6a7){return _0x17745a[_0x7829('0x17')](_0x27cb8c);}return _0x17745a[_0x7829('0x18')](_0x27cb8c)['end']();};}function respondWithResult(_0x596d67,_0x104e8a){_0x104e8a=_0x104e8a||0xc8;return function(_0x247400){if(_0x247400){return _0x596d67['status'](_0x104e8a)['json'](_0x247400);}};}function respondWithFilteredResult(_0x31cfb1,_0x484efd){return function(_0x54fccd){if(_0x54fccd){var _0x427b7e=typeof _0x484efd[_0x7829('0x19')]===_0x7829('0x1a')&&typeof _0x484efd[_0x7829('0x1b')]===_0x7829('0x1a');var _0x323563=_0x54fccd[_0x7829('0x1c')];var _0x510f7f=_0x427b7e?0x0:_0x484efd[_0x7829('0x19')];var _0x2d7582=_0x427b7e?_0x54fccd[_0x7829('0x1c')]:_0x484efd[_0x7829('0x19')]+_0x484efd[_0x7829('0x1b')];var _0x503507;if(_0x2d7582>=_0x323563){_0x2d7582=_0x323563;_0x503507=0xc8;}else{_0x503507=0xce;}_0x31cfb1[_0x7829('0x18')](_0x503507);return _0x31cfb1[_0x7829('0x1d')](_0x7829('0x1e'),_0x510f7f+'-'+_0x2d7582+'/'+_0x323563)['json'](_0x54fccd);}return null;};}function patchUpdates(_0x2922ad){return function(_0x53ddcb){try{jsonpatch[_0x7829('0x1f')](_0x53ddcb,_0x2922ad,!![]);}catch(_0x1a69fb){return BPromise[_0x7829('0x20')](_0x1a69fb);}return _0x53ddcb[_0x7829('0x21')]();};}function saveUpdates(_0x4ac105,_0x5b5716){return function(_0x2c6107){if(_0x2c6107){return _0x2c6107['update'](_0x4ac105)['then'](function(_0x4755e5){return _0x4755e5;});}return null;};}function removeEntity(_0x412d53,_0x2af025){return function(_0x245cfe){if(_0x245cfe){return _0x245cfe[_0x7829('0x22')]()[_0x7829('0x23')](function(){_0x412d53[_0x7829('0x18')](0xcc)[_0x7829('0x24')]();});}};}function handleEntityNotFound(_0x389be8,_0x1e9baa){return function(_0xacaf21){if(!_0xacaf21){_0x389be8[_0x7829('0x17')](0x194);}return _0xacaf21;};}function handleError(_0x5b9090,_0xfaf5a0){_0xfaf5a0=_0xfaf5a0||0x1f4;return function(_0x2e3073){logger[_0x7829('0x25')](_0x2e3073[_0x7829('0x26')]);if(_0x2e3073[_0x7829('0x27')]){delete _0x2e3073[_0x7829('0x27')];}_0x5b9090[_0x7829('0x18')](_0xfaf5a0)['send'](_0x2e3073);};}exports['index']=function(_0x41d244,_0x3f9cbf){var _0x113fa6={},_0x3b12df={},_0x265efb={'count':0x0,'rows':[]};var _0x9eed3f=_[_0x7829('0x28')](db[_0x7829('0x29')][_0x7829('0x2a')],function(_0xc3e4a7){return{'name':_0xc3e4a7[_0x7829('0x2b')],'type':_0xc3e4a7[_0x7829('0x2c')][_0x7829('0x2d')]};});_0x3b12df[_0x7829('0x2e')]=_[_0x7829('0x28')](_0x9eed3f,'name');_0x3b12df[_0x7829('0x2f')]=_[_0x7829('0x30')](_0x41d244[_0x7829('0x2f')]);_0x3b12df[_0x7829('0x31')]=_[_0x7829('0x32')](_0x3b12df['model'],_0x3b12df[_0x7829('0x2f')]);_0x113fa6['attributes']=_['intersection'](_0x3b12df['model'],qs['fields'](_0x41d244['query'][_0x7829('0x33')]));_0x113fa6['attributes']=_0x113fa6[_0x7829('0x34')][_0x7829('0x35')]?_0x113fa6[_0x7829('0x34')]:_0x3b12df['model'];if(!_0x41d244[_0x7829('0x2f')]['hasOwnProperty']('nolimit')){_0x113fa6[_0x7829('0x1b')]=qs[_0x7829('0x1b')](_0x41d244['query']['limit']);_0x113fa6[_0x7829('0x19')]=qs[_0x7829('0x19')](_0x41d244[_0x7829('0x2f')]['offset']);}_0x113fa6['order']=qs[_0x7829('0x36')](_0x41d244['query'][_0x7829('0x36')]);_0x113fa6['where']=qs[_0x7829('0x31')](_[_0x7829('0x37')](_0x41d244['query'],_0x3b12df[_0x7829('0x31')]),_0x9eed3f);if(_0x41d244[_0x7829('0x2f')][_0x7829('0x38')]){_0x113fa6[_0x7829('0x39')]=_[_0x7829('0x3a')](_0x113fa6[_0x7829('0x39')],{'$or':_[_0x7829('0x28')](_0x9eed3f,function(_0xc71b8e){if(_0xc71b8e['type']!==_0x7829('0x3b')){var _0x26466c={};_0x26466c[_0xc71b8e[_0x7829('0x27')]]={'$like':'%'+_0x41d244[_0x7829('0x2f')][_0x7829('0x38')]+'%'};return _0x26466c;}})});}_0x113fa6=_[_0x7829('0x3a')]({},_0x113fa6,_0x41d244[_0x7829('0x3c')]);var _0x3515e5={'where':_0x113fa6[_0x7829('0x39')]};return db[_0x7829('0x29')][_0x7829('0x1c')](_0x3515e5)['then'](function(_0x3127dc){_0x265efb[_0x7829('0x1c')]=_0x3127dc;if(_0x41d244[_0x7829('0x2f')][_0x7829('0x3d')]){_0x113fa6[_0x7829('0x3e')]=[{'all':!![]}];}return db[_0x7829('0x29')][_0x7829('0x3f')](_0x113fa6);})[_0x7829('0x23')](function(_0x1738b9){_0x265efb[_0x7829('0x40')]=_0x1738b9;return _0x265efb;})[_0x7829('0x23')](respondWithFilteredResult(_0x3f9cbf,_0x113fa6))[_0x7829('0x41')](handleError(_0x3f9cbf,null));};exports['show']=function(_0x2f7dd7,_0x40852c){var _0x1696a3={'raw':!![],'where':{'id':_0x2f7dd7[_0x7829('0x42')]['id']}},_0x54e7a8={};_0x54e7a8[_0x7829('0x2e')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x54e7a8[_0x7829('0x2f')]=_['keys'](_0x2f7dd7[_0x7829('0x2f')]);_0x54e7a8[_0x7829('0x31')]=_[_0x7829('0x32')](_0x54e7a8[_0x7829('0x2e')],_0x54e7a8[_0x7829('0x2f')]);_0x1696a3[_0x7829('0x34')]=_['intersection'](_0x54e7a8['model'],qs[_0x7829('0x33')](_0x2f7dd7[_0x7829('0x2f')][_0x7829('0x33')]));_0x1696a3[_0x7829('0x34')]=_0x1696a3[_0x7829('0x34')]['length']?_0x1696a3[_0x7829('0x34')]:_0x54e7a8[_0x7829('0x2e')];if(_0x2f7dd7[_0x7829('0x2f')][_0x7829('0x3d')]){_0x1696a3['include']=[{'all':!![]}];}_0x1696a3=_[_0x7829('0x3a')]({},_0x1696a3,_0x2f7dd7[_0x7829('0x3c')]);return db[_0x7829('0x29')][_0x7829('0x43')](_0x1696a3)[_0x7829('0x23')](handleEntityNotFound(_0x40852c,null))[_0x7829('0x23')](respondWithResult(_0x40852c,null))['catch'](handleError(_0x40852c,null));};exports['create']=function(_0x397ac7,_0x19580c){return db['SmsApplication'][_0x7829('0x44')](_0x397ac7[_0x7829('0x45')],{})['then'](respondWithResult(_0x19580c,0xc9))[_0x7829('0x41')](handleError(_0x19580c,null));};exports[_0x7829('0x46')]=function(_0x1e134d,_0x522a77){if(_0x1e134d[_0x7829('0x45')]['id']){delete _0x1e134d[_0x7829('0x45')]['id'];}return db['SmsApplication'][_0x7829('0x43')]({'where':{'id':_0x1e134d[_0x7829('0x42')]['id']}})[_0x7829('0x23')](handleEntityNotFound(_0x522a77,null))[_0x7829('0x23')](saveUpdates(_0x1e134d[_0x7829('0x45')],null))['then'](respondWithResult(_0x522a77,null))[_0x7829('0x41')](handleError(_0x522a77,null));};exports[_0x7829('0x22')]=function(_0x507b28,_0x44c41e){return db['SmsApplication'][_0x7829('0x43')]({'where':{'id':_0x507b28[_0x7829('0x42')]['id']}})['then'](handleEntityNotFound(_0x44c41e,null))[_0x7829('0x23')](removeEntity(_0x44c41e,null))[_0x7829('0x41')](handleError(_0x44c41e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 0add8ca..2728241 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 _0x8ad5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x8ad5,0xf1));var _0x58ad=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8ad5[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var logger=require(_0x58ad('0x2'))(_0x58ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require(_0x58ad('0x7'));var attributes=require(_0x58ad('0x8'));module[_0x58ad('0x9')]=function(_0x51d560,_0x5888f7){return _0x51d560[_0x58ad('0xa')](_0x58ad('0xb'),attributes,{'tableName':_0x58ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58ad('0xd'),'collate':_0x58ad('0xe')});}; \ No newline at end of file +var _0x1561=['bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x290e39,_0xeffad7){var _0x4ae7c2=function(_0x5a0809){while(--_0x5a0809){_0x290e39['push'](_0x290e39['shift']());}};_0x4ae7c2(++_0xeffad7);}(_0x1561,0x1b7));var _0x1156=function(_0x2c0ceb,_0x45538e){_0x2c0ceb=_0x2c0ceb-0x0;var _0x132511=_0x1561[_0x2c0ceb];return _0x132511;};'use strict';var _=require(_0x1156('0x0'));var util=require(_0x1156('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1156('0x2'));var BPromise=require(_0x1156('0x3'));var rp=require(_0x1156('0x4'));var fs=require('fs');var path=require(_0x1156('0x5'));var rimraf=require(_0x1156('0x6'));var config=require(_0x1156('0x7'));var attributes=require(_0x1156('0x8'));module['exports']=function(_0x47f6e8,_0x246731){return _0x47f6e8[_0x1156('0x9')](_0x1156('0xa'),attributes,{'tableName':_0x1156('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1156('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index b1400bb..4a2ef6f 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 _0x2deb=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});} \ No newline at end of file +var _0x0c8d=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0xdbafb5,_0x12b048){var _0x12bb49=function(_0x25db4e){while(--_0x25db4e){_0xdbafb5['push'](_0xdbafb5['shift']());}};_0x12bb49(++_0x12b048);}(_0x0c8d,0x79));var _0xd0c8=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x0c8d[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d1c1,_0x5f0027,_0x415439){return new BPromise(function(_0x34e3d5,_0x2f6200){return client[_0xd0c8('0x8')](_0x16d1c1,_0x415439)[_0xd0c8('0x9')](function(_0x5678f9){logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));logger[_0xd0c8('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5f0027,'request\x20sent',JSON[_0xd0c8('0xe')](_0x5678f9));if(_0x5678f9[_0xd0c8('0xf')]){if(_0x5678f9['error']['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5f0027,_0x5678f9['error'][_0xd0c8('0x10')]);return _0x2f6200(_0x5678f9[_0xd0c8('0xf')]['message']);}logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);return _0x34e3d5(_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);}else{logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));_0x34e3d5(_0x5678f9[_0xd0c8('0x11')][_0xd0c8('0x10')]);}})[_0xd0c8('0x12')](function(_0x58c3e0){logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x58c3e0);_0x2f6200(_0x58c3e0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 919dd95..d605113 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a282f,_0x446f46){var _0x4d1da3=function(_0x5cb0a8){while(--_0x5cb0a8){_0x5a282f['push'](_0x5a282f['shift']());}};_0x4d1da3(++_0x446f46);}(_0xe605,0x92));var _0x5e60=function(_0x20a8fe,_0x4e51b4){_0x20a8fe=_0x20a8fe-0x0;var _0x38b26a=_0xe605[_0x20a8fe];return _0x38b26a;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file +var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 376d5fb..3fc9204 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 _0xbeff=['BOOLEAN','DATE','STRING','ENUM','moment','exports'];(function(_0x8f8632,_0x253b62){var _0x133d01=function(_0x316701){while(--_0x316701){_0x8f8632['push'](_0x8f8632['shift']());}};_0x133d01(++_0x253b62);}(_0xbeff,0x8e));var _0xfbef=function(_0x188266,_0x3cf43b){_0x188266=_0x188266-0x0;var _0xf61ac9=_0xbeff[_0x188266];return _0xf61ac9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbef('0x0'));module[_0xfbef('0x1')]={'closed':{'type':Sequelize[_0xfbef('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfbef('0x3')]},'disposition':{'type':Sequelize[_0xfbef('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfbef('0x4')]},'phone':{'type':Sequelize[_0xfbef('0x4')]},'read1stAt':{'type':Sequelize[_0xfbef('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfbef('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfbef('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xfbef('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfbef('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x737d=['moment','STRING','DATE','ENUM','out','BOOLEAN','sequelize'];(function(_0x2db679,_0x43c412){var _0x256943=function(_0x2cdd7b){while(--_0x2cdd7b){_0x2db679['push'](_0x2db679['shift']());}};_0x256943(++_0x43c412);}(_0x737d,0xbc));var _0xd737=function(_0x577d28,_0x1b7734){_0x577d28=_0x577d28-0x0;var _0x33e70d=_0x737d[_0x577d28];return _0x33e70d;};'use strict';var Sequelize=require(_0xd737('0x0'));var moment=require(_0xd737('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd737('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd737('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd737('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd737('0x4')]('in',_0xd737('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd737('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd737('0x4')]('in',_0xd737('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd737('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f0f5fa9..6e54b49 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 _0xed1d=['redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','params','keys','SmsInteraction','filters','intersection','model','fields','attributes','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','length','nolimit','order','sort','where','pick','SmsInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','includeAll','rows','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','createdAt','direction','secret','Account','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','Messages','out','System','Contact','value','renderFile','root','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment'];(function(_0x1ed5d5,_0x56ed6a){var _0x2b3da5=function(_0x447749){while(--_0x447749){_0x1ed5d5['push'](_0x1ed5d5['shift']());}};_0x2b3da5(++_0x56ed6a);}(_0xed1d,0xe7));var _0xded1=function(_0x23d177,_0x528197){_0x23d177=_0x23d177-0x0;var _0x3d8332=_0xed1d[_0x23d177];return _0x3d8332;};'use strict';var rimraf=require(_0xded1('0x0'));var zipdir=require(_0xded1('0x1'));var moment=require(_0xded1('0x2'));var BPromise=require(_0xded1('0x3'));var util=require(_0xded1('0x4'));var path=require(_0xded1('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xded1('0x6'));var Redis=require(_0xded1('0x7'));var interaction=require(_0xded1('0x8'));var qs=require(_0xded1('0x9'));var pdf=require(_0xded1('0xa'));var logger=require(_0xded1('0xb'))('api');var config=require(_0xded1('0xc'));var db=require('../../mysqldb')['db'];config[_0xded1('0xd')]=_['defaults'](config[_0xded1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xded1('0xe'))(new Redis(config[_0xded1('0xd')]));require(_0xded1('0xf'))[_0xded1('0x10')](socket);function respondWithStatusCode(_0x4b86c4,_0x2900b9){_0x2900b9=_0x2900b9||0xcc;return function(_0x53c746){if(_0x53c746){return _0x4b86c4[_0xded1('0x11')](_0x2900b9);}return _0x4b86c4[_0xded1('0x12')](_0x2900b9)[_0xded1('0x13')]();};}function respondWithResult(_0x4df23b,_0x2c6602){_0x2c6602=_0x2c6602||0xc8;return function(_0x13ba09){if(_0x13ba09){return _0x4df23b[_0xded1('0x12')](_0x2c6602)[_0xded1('0x14')](_0x13ba09);}};}function respondWithFilteredResult(_0x90dc66,_0x358d22){return function(_0x45f58c){if(_0x45f58c){var _0x49edb6=typeof _0x358d22[_0xded1('0x15')]===_0xded1('0x16')&&typeof _0x358d22[_0xded1('0x17')]===_0xded1('0x16');var _0x4a9b48=_0x45f58c[_0xded1('0x18')];var _0x138fb9=_0x49edb6?0x0:_0x358d22[_0xded1('0x15')];var _0x24981b=_0x49edb6?_0x45f58c[_0xded1('0x18')]:_0x358d22[_0xded1('0x15')]+_0x358d22[_0xded1('0x17')];var _0x11090f;if(_0x24981b>=_0x4a9b48){_0x24981b=_0x4a9b48;_0x11090f=0xc8;}else{_0x11090f=0xce;}_0x90dc66[_0xded1('0x12')](_0x11090f);return _0x90dc66[_0xded1('0x19')](_0xded1('0x1a'),_0x138fb9+'-'+_0x24981b+'/'+_0x4a9b48)[_0xded1('0x14')](_0x45f58c);}return null;};}function saveUpdates(_0x4f6404){return function(_0x16aa77){if(_0x16aa77){return _0x16aa77['update'](_0x4f6404)[_0xded1('0x1b')](function(_0x87241e){return _0x87241e;});}return null;};}function removeEntity(_0x57523d){return function(_0x3d7761){if(_0x3d7761){return _0x3d7761[_0xded1('0x1c')]()[_0xded1('0x1b')](function(){_0x57523d['status'](0xcc)[_0xded1('0x13')]();});}};}function handleEntityNotFound(_0x1a933b){return function(_0x8f0ecf){if(!_0x8f0ecf){_0x1a933b['sendStatus'](0x194);}return _0x8f0ecf;};}function handleError(_0x4a97c5,_0x58c73a){_0x58c73a=_0x58c73a||0x1f4;return function(_0x5d9ca8){logger[_0xded1('0x1d')](_0x5d9ca8[_0xded1('0x1e')]);if(_0x5d9ca8['name']){delete _0x5d9ca8[_0xded1('0x1f')];}_0x4a97c5[_0xded1('0x12')](_0x58c73a)[_0xded1('0x20')](_0x5d9ca8);};}exports[_0xded1('0x21')]=function(_0x1153f0,_0x7f337){var _0x1536ab={};var _0x19e9df=_['map'](db['SmsInteraction'][_0xded1('0x22')],function(_0xa118d9){return{'name':_0xa118d9[_0xded1('0x23')],'type':_0xa118d9[_0xded1('0x24')][_0xded1('0x25')]};});_0x1536ab=qs[_0xded1('0x26')](_0x19e9df,_0x1153f0);return interaction[_0xded1('0x27')]('sms',_0x1153f0[_0xded1('0x28')],_0x1153f0[_0xded1('0x29')],_0x1536ab,_0x19e9df)[_0xded1('0x1b')](respondWithFilteredResult(_0x7f337,_0x1536ab))[_0xded1('0x2a')](handleError(_0x7f337,null));};exports[_0xded1('0x2b')]=function(_0x5969f7,_0x4ae496){var _0x486425={'raw':![],'where':{'id':_0x5969f7[_0xded1('0x2c')]['id']}},_0x5b5d09={};_0x5b5d09['model']=_[_0xded1('0x2d')](db[_0xded1('0x2e')][_0xded1('0x22')]);_0x5b5d09[_0xded1('0x28')]=_[_0xded1('0x2d')](_0x5969f7[_0xded1('0x28')]);_0x5b5d09[_0xded1('0x2f')]=_[_0xded1('0x30')](_0x5b5d09['model'],_0x5b5d09['query']);_0x486425['attributes']=_[_0xded1('0x30')](_0x5b5d09[_0xded1('0x31')],qs[_0xded1('0x32')](_0x5969f7['query'][_0xded1('0x32')]));_0x486425[_0xded1('0x33')]=_0x486425[_0xded1('0x33')]['length']?_0x486425[_0xded1('0x33')]:_0x5b5d09['model'];if(_0x5969f7[_0xded1('0x28')]['includeAll']){_0x486425[_0xded1('0x34')]=[{'all':!![]}];}_0x486425=_[_0xded1('0x35')]({},_0x486425,_0x5969f7[_0xded1('0x36')]);return db['SmsInteraction'][_0xded1('0x37')](_0x486425)[_0xded1('0x1b')](handleEntityNotFound(_0x4ae496,null))[_0xded1('0x1b')](respondWithResult(_0x4ae496,null))['catch'](handleError(_0x4ae496,null));};exports['create']=function(_0x2170df,_0xb18785){return db[_0xded1('0x2e')][_0xded1('0x38')](_0x2170df[_0xded1('0x39')],{})['then'](respondWithResult(_0xb18785,0xc9))[_0xded1('0x2a')](handleError(_0xb18785,null));};exports[_0xded1('0x3a')]=function(_0x4f5058,_0x304a51){if(_0x4f5058['body']['id']){delete _0x4f5058['body']['id'];}return db[_0xded1('0x2e')]['find']({'where':{'id':_0x4f5058[_0xded1('0x2c')]['id']}})[_0xded1('0x1b')](handleEntityNotFound(_0x304a51,null))['then'](saveUpdates(_0x4f5058[_0xded1('0x39')],null))[_0xded1('0x1b')](respondWithResult(_0x304a51,null))['catch'](handleError(_0x304a51,null));};exports[_0xded1('0x1c')]=function(_0x5d7e18,_0x204e37){return db[_0xded1('0x2e')]['find']({'where':{'id':_0x5d7e18['params']['id']}})['then'](handleEntityNotFound(_0x204e37,null))[_0xded1('0x1b')](removeEntity(_0x204e37,null))[_0xded1('0x2a')](handleError(_0x204e37,null));};exports['describe']=function(_0x5b52d2,_0x287add){return db[_0xded1('0x2e')][_0xded1('0x3b')]()['then'](respondWithResult(_0x287add,null))['catch'](handleError(_0x287add,null));};exports[_0xded1('0x3c')]=function(_0x4949dd,_0x2515c9){return db['SmsMessage'][_0xded1('0x37')]({'where':{'id':_0x4949dd[_0xded1('0x2c')]['id']}})[_0xded1('0x1b')](handleEntityNotFound(_0x2515c9,null))['then'](function(_0x5eb764){if(_0x5eb764){return _0x5eb764[_0xded1('0x3c')](_0x4949dd[_0xded1('0x39')][_0xded1('0x3d')],_[_0xded1('0x3e')](_0x4949dd[_0xded1('0x39')],[_0xded1('0x3d'),'id'])||{});}})[_0xded1('0x1b')](respondWithResult(_0x2515c9,null))[_0xded1('0x2a')](handleError(_0x2515c9,null));};exports['getMessages']=function(_0x5448b7,_0x5f1828){var _0x176bb6={'raw':![],'where':{}};var _0x21ed9f={};var _0x32ca6a={'count':0x0,'rows':[]};return db[_0xded1('0x2e')]['findOne']({'where':{'id':_0x5448b7['params']['id']}})[_0xded1('0x1b')](handleEntityNotFound(_0x5f1828,null))['then'](function(_0x5e6bac){if(_0x5e6bac){_0x21ed9f[_0xded1('0x31')]=_['keys'](db['SmsMessage'][_0xded1('0x22')]);_0x21ed9f[_0xded1('0x28')]=_[_0xded1('0x2d')](_0x5448b7[_0xded1('0x28')]);_0x21ed9f[_0xded1('0x2f')]=_[_0xded1('0x30')](_0x21ed9f[_0xded1('0x31')],_0x21ed9f[_0xded1('0x28')]);_0x176bb6[_0xded1('0x33')]=_[_0xded1('0x30')](_0x21ed9f[_0xded1('0x31')],qs[_0xded1('0x32')](_0x5448b7[_0xded1('0x28')][_0xded1('0x32')]));_0x176bb6['attributes']=_0x176bb6['attributes'][_0xded1('0x3f')]?_0x176bb6[_0xded1('0x33')]:_0x21ed9f[_0xded1('0x31')];if(!_0x5448b7[_0xded1('0x28')]['hasOwnProperty'](_0xded1('0x40'))){_0x176bb6[_0xded1('0x17')]=qs[_0xded1('0x17')](_0x5448b7[_0xded1('0x28')][_0xded1('0x17')]);_0x176bb6['offset']=qs['offset'](_0x5448b7[_0xded1('0x28')][_0xded1('0x15')]);}_0x176bb6[_0xded1('0x41')]=qs[_0xded1('0x42')](_0x5448b7[_0xded1('0x28')]['sort']);_0x176bb6[_0xded1('0x43')]=qs[_0xded1('0x2f')](_[_0xded1('0x44')](_0x5448b7[_0xded1('0x28')],_0x21ed9f[_0xded1('0x2f')]));_0x176bb6[_0xded1('0x43')][_0xded1('0x45')]=_0x5e6bac['id'];if(_0x5448b7[_0xded1('0x28')][_0xded1('0x46')]){_0x176bb6[_0xded1('0x43')]=_[_0xded1('0x35')](_0x176bb6[_0xded1('0x43')],{'$or':_[_0xded1('0x47')](_0x176bb6[_0xded1('0x33')],function(_0x548372){var _0x4b16a7={};_0x4b16a7[_0x548372]={'$like':'%'+_0x5448b7[_0xded1('0x28')][_0xded1('0x46')]+'%'};return _0x4b16a7;})});}if(_0x5448b7['query'][_0xded1('0x48')]){var _0x4b2b87=_0x5448b7['query'][_0xded1('0x48')]['split'](',');var _0x4576d6={};_0x4576d6[_0x4b2b87[0x0]]={'$gte':moment(_0x4b2b87[0x1])[_0xded1('0x49')](_0xded1('0x4a'))};_0x176bb6[_0xded1('0x43')]=_['merge'](_0x176bb6[_0xded1('0x43')],_0x4576d6);}_0x176bb6=_[_0xded1('0x35')]({},_0x176bb6,_0x5448b7['options']);return db[_0xded1('0x4b')][_0xded1('0x18')]({'where':_0x176bb6[_0xded1('0x43')]})[_0xded1('0x1b')](function(_0x4c94a2){_0x32ca6a[_0xded1('0x18')]=_0x4c94a2;if(_0x5448b7[_0xded1('0x28')][_0xded1('0x4c')]){_0x176bb6['include']=[{'all':!![]}];}return db['SmsMessage'][_0xded1('0x27')](_0x176bb6);})[_0xded1('0x1b')](function(_0x1bfc28){_0x32ca6a[_0xded1('0x4d')]=_0x1bfc28;return _0x32ca6a;});}})['then'](respondWithFilteredResult(_0x5f1828,_0x176bb6))[_0xded1('0x2a')](handleError(_0x5f1828,null));};exports[_0xded1('0x4e')]=function(_0x380e7c,_0x3ca851){return db[_0xded1('0x2e')][_0xded1('0x37')]({'where':{'id':_0x380e7c['params']['id']}})[_0xded1('0x1b')](handleEntityNotFound(_0x3ca851,null))[_0xded1('0x1b')](function(_0x4e072f){if(_0x4e072f){return _0x4e072f['setTags'](_0x380e7c[_0xded1('0x39')]['ids'],_[_0xded1('0x3e')](_0x380e7c['body'],[_0xded1('0x3d'),'id'])||{})[_0xded1('0x4f')](function(){return db[_0xded1('0x50')][_0xded1('0x27')]({'attributes':['id','name',_0xded1('0x51')],'where':{'id':_0x380e7c[_0xded1('0x39')][_0xded1('0x3d')]}});})[_0xded1('0x1b')](function(_0x45dafb){socket[_0xded1('0x52')](_0xded1('0x53'),{'id':Number(_0x380e7c['params']['id']),'tags':_0x45dafb||[]});return{'id':Number(_0x380e7c[_0xded1('0x2c')]['id']),'tags':_0x45dafb||[]};});}})[_0xded1('0x1b')](respondWithResult(_0x3ca851,null))[_0xded1('0x2a')](handleError(_0x3ca851,null));};exports[_0xded1('0x54')]=function(_0x2ea2da,_0x5cbcb6){return db[_0xded1('0x2e')]['find']({'where':{'id':_0x2ea2da[_0xded1('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5cbcb6,null))['then'](function(_0x33aeff){if(_0x33aeff){return _0x33aeff['removeTags'](_0x2ea2da[_0xded1('0x28')]['ids']);}})[_0xded1('0x1b')](respondWithStatusCode(_0x5cbcb6,null))[_0xded1('0x2a')](handleError(_0x5cbcb6,null));};exports[_0xded1('0x55')]=function(_0x826d0e,_0x221416){var _0x4871f6=moment()[_0xded1('0x56')]()[_0xded1('0x57')]();var _0x1f8fc2=path['join'](config['root'],'server',_0xded1('0x58'),_0xded1('0x59'));var _0x3e5e0c=path[_0xded1('0x5a')](_0x1f8fc2,_0x4871f6);var _0x267198=util[_0xded1('0x49')](_0xded1('0x5b'),_0x826d0e[_0xded1('0x2c')]['id'],_0x4871f6);var _0x4b4482=path[_0xded1('0x5a')](_0x1f8fc2,_0x267198);var _0xf26b10=[];_0xf26b10[_0xded1('0x5c')]({'model':db[_0xded1('0x5d')],'as':'User','attributes':['id',_0xded1('0x5e')],'raw':!![]});_0xf26b10[_0xded1('0x5c')]({'model':db[_0xded1('0x5f')],'as':'Contact','attributes':['id',_0xded1('0x60'),_0xded1('0x61')],'raw':!![]});var _0x35f794=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body',_0xded1('0x62'),_0xded1('0x63'),_0xded1('0x64'),'read'],'include':_0xf26b10}];_0x35f794['push']({'model':db['SmsAccount'],'as':_0xded1('0x65'),'attributes':['id',_0xded1('0x1f')]});_0x35f794['push']({'model':db[_0xded1('0x5d')],'as':_0xded1('0x66'),'attributes':['id','fullname']});return db[_0xded1('0x2e')][_0xded1('0x37')]({'where':{'id':_0x826d0e['params']['id']},'include':_0x35f794})[_0xded1('0x1b')](handleEntityNotFound(_0x221416,null))[_0xded1('0x1b')](function(_0x5e016a){if(_0x5e016a){var _0x18d3c9=_0x5e016a[_0xded1('0x67')]({'plain':!![]});fs[_0xded1('0x68')](_0x3e5e0c);var _0x450fbf={'channel':_0xded1('0x69'),'account':_0x18d3c9[_0xded1('0x65')][_0xded1('0x1f')],'agent':_0x18d3c9[_0xded1('0x66')]?_0x18d3c9[_0xded1('0x66')][_0xded1('0x5e')]:_0xded1('0x6a'),'createdAt':moment(_0x18d3c9[_0xded1('0x62')])[_0xded1('0x49')](_0xded1('0x4a'))[_0xded1('0x57')](),'closedAt':_0x18d3c9[_0xded1('0x6b')]?moment(_0x18d3c9[_0xded1('0x6c')])[_0xded1('0x49')](_0xded1('0x4a'))[_0xded1('0x57')]():'','disposition':_0x18d3c9['disposition'],'messages':_(_0x18d3c9[_0xded1('0x6d')])[_0xded1('0x46')]({'secret':![]})['map'](function(_0x504c1f){return{'date':moment(_0x504c1f[_0xded1('0x62')])[_0xded1('0x49')](_0xded1('0x4a'))[_0xded1('0x57')](),'sender':_0x504c1f[_0xded1('0x63')]===_0xded1('0x6e')?_0x504c1f[_0xded1('0x5d')]?_0x504c1f['User'][_0xded1('0x5e')]:_0xded1('0x6f'):_0x504c1f[_0xded1('0x70')]['firstName']+(_0x504c1f[_0xded1('0x70')]['lastName']?'\x20'+_0x504c1f[_0xded1('0x70')]['lastName']:''),'body':_0x504c1f[_0xded1('0x39')],'direction':_0x504c1f['direction']===_0xded1('0x6e')?'A':'C','secret':_0x504c1f[_0xded1('0x64')],'read':_0x504c1f['read']};})[_0xded1('0x71')]()};return ejs[_0xded1('0x72')](path[_0xded1('0x5a')](config[_0xded1('0x73')],'server',_0xded1('0x74'),'downloadInteraction.ejs'),{'interaction':_0x450fbf})['then'](function(_0x21d1fc){var _0x18489f=path[_0xded1('0x5a')](_0x3e5e0c,_0xded1('0x75')+_0x18d3c9['id']+'-'+_0x4871f6+_0xded1('0x76'));var _0xc4564e={'path':_0x18489f,'channel':_0xded1('0x69'),'interactionId':_0x18d3c9['id']};return pdf[_0xded1('0x77')](_0x21d1fc,_0xc4564e);})['then'](function(){return new BPromise(function(_0x3571b8,_0x41d335){zipdir(_0x3e5e0c,{'saveTo':_0x4b4482},function(_0xdbabba,_0x46b288){if(_0xdbabba)return _0x41d335(_0xdbabba);return _0x3571b8(_0x46b288);});})[_0xded1('0x1b')](function(){return new BPromise(function(_0x17025c,_0x39032e){rimraf(_0x3e5e0c,function(_0x128a05){if(_0x128a05)_0x39032e(_0x128a05);return _0x17025c();});});})[_0xded1('0x1b')](function(){return _0x221416['download'](_0x4b4482,_0x267198,function(_0x295005){if(_0x295005){console[_0xded1('0x78')]('err',_0x295005);}else{fs[_0xded1('0x79')](_0x4b4482);}});});});}else{return _0x221416['sendStatus'](0xc8);}})[_0xded1('0x2a')](handleError(_0x221416,null));}; \ No newline at end of file +var _0x650e=['api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','status','offset','undefined','limit','count','set','json','update','then','destroy','end','sendStatus','error','name','send','index','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','user','catch','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','files','tmp','User','push','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','fullname','get','Sms','N.A.','closed','closedAt','out','value','renderFile','server','views','downloadInteraction.ejs','createPdfFromHTML','log','err','moment','bluebird','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger'];(function(_0x4e3f45,_0x76f2a5){var _0x13e488=function(_0x2735ff){while(--_0x2735ff){_0x4e3f45['push'](_0x4e3f45['shift']());}};_0x13e488(++_0x76f2a5);}(_0x650e,0x15b));var _0xe650=function(_0x1b22bf,_0x5c8660){_0x1b22bf=_0x1b22bf-0x0;var _0x413cf5=_0x650e[_0x1b22bf];return _0x413cf5;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xe650('0x0'));var BPromise=require(_0xe650('0x1'));var util=require('util');var path=require('path');var ejs=require(_0xe650('0x2'));var fs=require('fs');var _=require(_0xe650('0x3'));var Redis=require('ioredis');var interaction=require(_0xe650('0x4'));var qs=require(_0xe650('0x5'));var pdf=require('../../components/export/pdf');var logger=require(_0xe650('0x6'))(_0xe650('0x7'));var config=require(_0xe650('0x8'));var db=require(_0xe650('0x9'))['db'];config['redis']=_[_0xe650('0xa')](config['redis'],{'host':_0xe650('0xb'),'port':0x18eb});var socket=require(_0xe650('0xc'))(new Redis(config[_0xe650('0xd')]));require(_0xe650('0xe'))[_0xe650('0xf')](socket);function respondWithStatusCode(_0x5e191f,_0x4ff227){_0x4ff227=_0x4ff227||0xcc;return function(_0x2729e0){if(_0x2729e0){return _0x5e191f['sendStatus'](_0x4ff227);}return _0x5e191f[_0xe650('0x10')](_0x4ff227)['end']();};}function respondWithResult(_0x3f9850,_0x1f54a0){_0x1f54a0=_0x1f54a0||0xc8;return function(_0x4efae0){if(_0x4efae0){return _0x3f9850[_0xe650('0x10')](_0x1f54a0)['json'](_0x4efae0);}};}function respondWithFilteredResult(_0x9c866a,_0x451670){return function(_0x4b4fbe){if(_0x4b4fbe){var _0x5bddf1=typeof _0x451670[_0xe650('0x11')]===_0xe650('0x12')&&typeof _0x451670[_0xe650('0x13')]===_0xe650('0x12');var _0x279670=_0x4b4fbe[_0xe650('0x14')];var _0x11a339=_0x5bddf1?0x0:_0x451670[_0xe650('0x11')];var _0x238f23=_0x5bddf1?_0x4b4fbe[_0xe650('0x14')]:_0x451670[_0xe650('0x11')]+_0x451670['limit'];var _0xcae4cc;if(_0x238f23>=_0x279670){_0x238f23=_0x279670;_0xcae4cc=0xc8;}else{_0xcae4cc=0xce;}_0x9c866a[_0xe650('0x10')](_0xcae4cc);return _0x9c866a[_0xe650('0x15')]('Content-Range',_0x11a339+'-'+_0x238f23+'/'+_0x279670)[_0xe650('0x16')](_0x4b4fbe);}return null;};}function saveUpdates(_0x2e7ceb){return function(_0x262725){if(_0x262725){return _0x262725[_0xe650('0x17')](_0x2e7ceb)[_0xe650('0x18')](function(_0x53a906){return _0x53a906;});}return null;};}function removeEntity(_0x357957){return function(_0x1546da){if(_0x1546da){return _0x1546da[_0xe650('0x19')]()[_0xe650('0x18')](function(){_0x357957[_0xe650('0x10')](0xcc)[_0xe650('0x1a')]();});}};}function handleEntityNotFound(_0x4244f1){return function(_0xaced3d){if(!_0xaced3d){_0x4244f1[_0xe650('0x1b')](0x194);}return _0xaced3d;};}function handleError(_0x34db,_0x3dddce){_0x3dddce=_0x3dddce||0x1f4;return function(_0x4c423c){logger[_0xe650('0x1c')](_0x4c423c['stack']);if(_0x4c423c[_0xe650('0x1d')]){delete _0x4c423c[_0xe650('0x1d')];}_0x34db[_0xe650('0x10')](_0x3dddce)[_0xe650('0x1e')](_0x4c423c);};}exports[_0xe650('0x1f')]=function(_0x3dbbfb,_0x5cf8a4){var _0x44b726={};var _0x50d170=_['map'](db[_0xe650('0x20')][_0xe650('0x21')],function(_0x40005b){return{'name':_0x40005b[_0xe650('0x22')],'type':_0x40005b[_0xe650('0x23')][_0xe650('0x24')]};});_0x44b726=qs[_0xe650('0x25')](_0x50d170,_0x3dbbfb);return interaction[_0xe650('0x26')](_0xe650('0x27'),_0x3dbbfb['query'],_0x3dbbfb[_0xe650('0x28')],_0x44b726,_0x50d170)[_0xe650('0x18')](respondWithFilteredResult(_0x5cf8a4,_0x44b726))[_0xe650('0x29')](handleError(_0x5cf8a4,null));};exports[_0xe650('0x2a')]=function(_0x30c31a,_0x3c04a5){var _0x130d84={'raw':![],'where':{'id':_0x30c31a['params']['id']}},_0x172807={};_0x172807[_0xe650('0x2b')]=_[_0xe650('0x2c')](db['SmsInteraction']['rawAttributes']);_0x172807[_0xe650('0x2d')]=_[_0xe650('0x2c')](_0x30c31a[_0xe650('0x2d')]);_0x172807[_0xe650('0x2e')]=_[_0xe650('0x2f')](_0x172807['model'],_0x172807[_0xe650('0x2d')]);_0x130d84['attributes']=_[_0xe650('0x2f')](_0x172807[_0xe650('0x2b')],qs[_0xe650('0x30')](_0x30c31a[_0xe650('0x2d')][_0xe650('0x30')]));_0x130d84['attributes']=_0x130d84[_0xe650('0x31')][_0xe650('0x32')]?_0x130d84[_0xe650('0x31')]:_0x172807[_0xe650('0x2b')];if(_0x30c31a[_0xe650('0x2d')][_0xe650('0x33')]){_0x130d84[_0xe650('0x34')]=[{'all':!![]}];}_0x130d84=_[_0xe650('0x35')]({},_0x130d84,_0x30c31a[_0xe650('0x36')]);return db[_0xe650('0x20')][_0xe650('0x37')](_0x130d84)['then'](handleEntityNotFound(_0x3c04a5,null))[_0xe650('0x18')](respondWithResult(_0x3c04a5,null))[_0xe650('0x29')](handleError(_0x3c04a5,null));};exports['create']=function(_0x5a0aab,_0x47efbe){return db[_0xe650('0x20')][_0xe650('0x38')](_0x5a0aab[_0xe650('0x39')],{})['then'](respondWithResult(_0x47efbe,0xc9))[_0xe650('0x29')](handleError(_0x47efbe,null));};exports[_0xe650('0x17')]=function(_0xb428a0,_0x1d8419){if(_0xb428a0[_0xe650('0x39')]['id']){delete _0xb428a0[_0xe650('0x39')]['id'];}return db[_0xe650('0x20')][_0xe650('0x37')]({'where':{'id':_0xb428a0[_0xe650('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1d8419,null))[_0xe650('0x18')](saveUpdates(_0xb428a0[_0xe650('0x39')],null))[_0xe650('0x18')](respondWithResult(_0x1d8419,null))[_0xe650('0x29')](handleError(_0x1d8419,null));};exports[_0xe650('0x19')]=function(_0x2cd22e,_0x5db33b){return db[_0xe650('0x20')][_0xe650('0x37')]({'where':{'id':_0x2cd22e[_0xe650('0x3a')]['id']}})[_0xe650('0x18')](handleEntityNotFound(_0x5db33b,null))[_0xe650('0x18')](removeEntity(_0x5db33b,null))[_0xe650('0x29')](handleError(_0x5db33b,null));};exports['describe']=function(_0x2bd8ef,_0x76c5d1){return db[_0xe650('0x20')][_0xe650('0x3b')]()[_0xe650('0x18')](respondWithResult(_0x76c5d1,null))[_0xe650('0x29')](handleError(_0x76c5d1,null));};exports[_0xe650('0x3c')]=function(_0x33ebb9,_0x39752b){return db['SmsMessage'][_0xe650('0x37')]({'where':{'id':_0x33ebb9[_0xe650('0x3a')]['id']}})['then'](handleEntityNotFound(_0x39752b,null))[_0xe650('0x18')](function(_0x12178d){if(_0x12178d){return _0x12178d[_0xe650('0x3c')](_0x33ebb9[_0xe650('0x39')][_0xe650('0x3d')],_[_0xe650('0x3e')](_0x33ebb9[_0xe650('0x39')],[_0xe650('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x39752b,null))[_0xe650('0x29')](handleError(_0x39752b,null));};exports[_0xe650('0x3f')]=function(_0x28970d,_0x3c99f6){var _0x5a3b6c={'raw':![],'where':{}};var _0x4811ee={};var _0x58893e={'count':0x0,'rows':[]};return db[_0xe650('0x20')][_0xe650('0x40')]({'where':{'id':_0x28970d[_0xe650('0x3a')]['id']}})[_0xe650('0x18')](handleEntityNotFound(_0x3c99f6,null))[_0xe650('0x18')](function(_0x400f21){if(_0x400f21){_0x4811ee['model']=_[_0xe650('0x2c')](db[_0xe650('0x41')][_0xe650('0x21')]);_0x4811ee['query']=_['keys'](_0x28970d[_0xe650('0x2d')]);_0x4811ee['filters']=_[_0xe650('0x2f')](_0x4811ee[_0xe650('0x2b')],_0x4811ee[_0xe650('0x2d')]);_0x5a3b6c[_0xe650('0x31')]=_[_0xe650('0x2f')](_0x4811ee[_0xe650('0x2b')],qs[_0xe650('0x30')](_0x28970d[_0xe650('0x2d')][_0xe650('0x30')]));_0x5a3b6c[_0xe650('0x31')]=_0x5a3b6c[_0xe650('0x31')][_0xe650('0x32')]?_0x5a3b6c[_0xe650('0x31')]:_0x4811ee[_0xe650('0x2b')];if(!_0x28970d[_0xe650('0x2d')][_0xe650('0x42')]('nolimit')){_0x5a3b6c[_0xe650('0x13')]=qs[_0xe650('0x13')](_0x28970d[_0xe650('0x2d')][_0xe650('0x13')]);_0x5a3b6c['offset']=qs[_0xe650('0x11')](_0x28970d[_0xe650('0x2d')][_0xe650('0x11')]);}_0x5a3b6c[_0xe650('0x43')]=qs[_0xe650('0x44')](_0x28970d[_0xe650('0x2d')][_0xe650('0x44')]);_0x5a3b6c[_0xe650('0x45')]=qs[_0xe650('0x2e')](_[_0xe650('0x46')](_0x28970d[_0xe650('0x2d')],_0x4811ee[_0xe650('0x2e')]));_0x5a3b6c['where'][_0xe650('0x47')]=_0x400f21['id'];if(_0x28970d['query'][_0xe650('0x48')]){_0x5a3b6c['where']=_[_0xe650('0x35')](_0x5a3b6c[_0xe650('0x45')],{'$or':_['map'](_0x5a3b6c[_0xe650('0x31')],function(_0x43136a){var _0x2f02a4={};_0x2f02a4[_0x43136a]={'$like':'%'+_0x28970d[_0xe650('0x2d')]['filter']+'%'};return _0x2f02a4;})});}if(_0x28970d['query'][_0xe650('0x49')]){var _0x1e1a7d=_0x28970d[_0xe650('0x2d')][_0xe650('0x49')][_0xe650('0x4a')](',');var _0x35362d={};_0x35362d[_0x1e1a7d[0x0]]={'$gte':moment(_0x1e1a7d[0x1])[_0xe650('0x4b')](_0xe650('0x4c'))};_0x5a3b6c[_0xe650('0x45')]=_[_0xe650('0x35')](_0x5a3b6c[_0xe650('0x45')],_0x35362d);}_0x5a3b6c=_[_0xe650('0x35')]({},_0x5a3b6c,_0x28970d[_0xe650('0x36')]);return db[_0xe650('0x41')][_0xe650('0x14')]({'where':_0x5a3b6c['where']})[_0xe650('0x18')](function(_0x235532){_0x58893e[_0xe650('0x14')]=_0x235532;if(_0x28970d[_0xe650('0x2d')]['includeAll']){_0x5a3b6c[_0xe650('0x34')]=[{'all':!![]}];}return db[_0xe650('0x41')]['findAll'](_0x5a3b6c);})[_0xe650('0x18')](function(_0x53929e){_0x58893e[_0xe650('0x4d')]=_0x53929e;return _0x58893e;});}})['then'](respondWithFilteredResult(_0x3c99f6,_0x5a3b6c))[_0xe650('0x29')](handleError(_0x3c99f6,null));};exports['addTags']=function(_0x353894,_0x29fccf){return db[_0xe650('0x20')][_0xe650('0x37')]({'where':{'id':_0x353894[_0xe650('0x3a')]['id']}})[_0xe650('0x18')](handleEntityNotFound(_0x29fccf,null))[_0xe650('0x18')](function(_0x258e88){if(_0x258e88){return _0x258e88[_0xe650('0x4e')](_0x353894[_0xe650('0x39')][_0xe650('0x3d')],_[_0xe650('0x3e')](_0x353894[_0xe650('0x39')],[_0xe650('0x3d'),'id'])||{})['spread'](function(){return db[_0xe650('0x4f')][_0xe650('0x26')]({'attributes':['id',_0xe650('0x1d'),_0xe650('0x50')],'where':{'id':_0x353894['body'][_0xe650('0x3d')]}});})[_0xe650('0x18')](function(_0x39fe6d){socket[_0xe650('0x51')](_0xe650('0x52'),{'id':Number(_0x353894[_0xe650('0x3a')]['id']),'tags':_0x39fe6d||[]});return{'id':Number(_0x353894[_0xe650('0x3a')]['id']),'tags':_0x39fe6d||[]};});}})[_0xe650('0x18')](respondWithResult(_0x29fccf,null))[_0xe650('0x29')](handleError(_0x29fccf,null));};exports['removeTags']=function(_0x4856c3,_0x8d1a27){return db[_0xe650('0x20')][_0xe650('0x37')]({'where':{'id':_0x4856c3[_0xe650('0x3a')]['id']}})[_0xe650('0x18')](handleEntityNotFound(_0x8d1a27,null))[_0xe650('0x18')](function(_0x1864e3){if(_0x1864e3){return _0x1864e3[_0xe650('0x53')](_0x4856c3[_0xe650('0x2d')][_0xe650('0x3d')]);}})[_0xe650('0x18')](respondWithStatusCode(_0x8d1a27,null))[_0xe650('0x29')](handleError(_0x8d1a27,null));};exports[_0xe650('0x54')]=function(_0x48deac,_0x23aa79){var _0x44f6fc=moment()['unix']()[_0xe650('0x55')]();var _0x8cd893=path[_0xe650('0x56')](config[_0xe650('0x57')],'server',_0xe650('0x58'),_0xe650('0x59'));var _0x4ad51e=path[_0xe650('0x56')](_0x8cd893,_0x44f6fc);var _0x483b13=util[_0xe650('0x4b')]('transcript-%d-%s.zip',_0x48deac[_0xe650('0x3a')]['id'],_0x44f6fc);var _0x4197e5=path['join'](_0x8cd893,_0x483b13);var _0x5bda8a=[];_0x5bda8a['push']({'model':db[_0xe650('0x5a')],'as':_0xe650('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x5bda8a[_0xe650('0x5b')]({'model':db[_0xe650('0x5c')],'as':_0xe650('0x5d'),'attributes':['id',_0xe650('0x5e'),_0xe650('0x5f')],'raw':!![]});var _0x13ffe9=[{'model':db[_0xe650('0x41')],'as':_0xe650('0x60'),'attributes':['id',_0xe650('0x39'),_0xe650('0x61'),_0xe650('0x62'),_0xe650('0x63'),_0xe650('0x64')],'include':_0x5bda8a}];_0x13ffe9[_0xe650('0x5b')]({'model':db[_0xe650('0x65')],'as':_0xe650('0x66'),'attributes':['id',_0xe650('0x1d')]});_0x13ffe9[_0xe650('0x5b')]({'model':db['User'],'as':'Owner','attributes':['id',_0xe650('0x67')]});return db[_0xe650('0x20')][_0xe650('0x37')]({'where':{'id':_0x48deac[_0xe650('0x3a')]['id']},'include':_0x13ffe9})[_0xe650('0x18')](handleEntityNotFound(_0x23aa79,null))['then'](function(_0x135135){if(_0x135135){var _0x31e8d9=_0x135135[_0xe650('0x68')]({'plain':!![]});fs['mkdirSync'](_0x4ad51e);var _0x364ae9={'channel':_0xe650('0x69'),'account':_0x31e8d9[_0xe650('0x66')][_0xe650('0x1d')],'agent':_0x31e8d9['Owner']?_0x31e8d9['Owner']['fullname']:_0xe650('0x6a'),'createdAt':moment(_0x31e8d9[_0xe650('0x61')])['format'](_0xe650('0x4c'))[_0xe650('0x55')](),'closedAt':_0x31e8d9[_0xe650('0x6b')]?moment(_0x31e8d9[_0xe650('0x6c')])[_0xe650('0x4b')](_0xe650('0x4c'))['toString']():'','disposition':_0x31e8d9['disposition'],'messages':_(_0x31e8d9['Messages'])[_0xe650('0x48')]({'secret':![]})['map'](function(_0x16b0c0){return{'date':moment(_0x16b0c0[_0xe650('0x61')])[_0xe650('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe650('0x55')](),'sender':_0x16b0c0['direction']===_0xe650('0x6d')?_0x16b0c0[_0xe650('0x5a')]?_0x16b0c0[_0xe650('0x5a')][_0xe650('0x67')]:'System':_0x16b0c0[_0xe650('0x5d')][_0xe650('0x5e')]+(_0x16b0c0['Contact'][_0xe650('0x5f')]?'\x20'+_0x16b0c0[_0xe650('0x5d')][_0xe650('0x5f')]:''),'body':_0x16b0c0[_0xe650('0x39')],'direction':_0x16b0c0['direction']===_0xe650('0x6d')?'A':'C','secret':_0x16b0c0[_0xe650('0x63')],'read':_0x16b0c0['read']};})[_0xe650('0x6e')]()};return ejs[_0xe650('0x6f')](path['join'](config[_0xe650('0x57')],_0xe650('0x70'),_0xe650('0x71'),_0xe650('0x72')),{'interaction':_0x364ae9})[_0xe650('0x18')](function(_0xd571d6){var _0x102836=path[_0xe650('0x56')](_0x4ad51e,'transcript-'+_0x31e8d9['id']+'-'+_0x44f6fc+'.pdf');var _0x546e7e={'path':_0x102836,'channel':_0xe650('0x69'),'interactionId':_0x31e8d9['id']};return pdf[_0xe650('0x73')](_0xd571d6,_0x546e7e);})['then'](function(){return new BPromise(function(_0x4b0db3,_0x1ece34){zipdir(_0x4ad51e,{'saveTo':_0x4197e5},function(_0x409c6a,_0x217aa4){if(_0x409c6a)return _0x1ece34(_0x409c6a);return _0x4b0db3(_0x217aa4);});})[_0xe650('0x18')](function(){return new BPromise(function(_0x100e97,_0x2e4fe8){rimraf(_0x4ad51e,function(_0x4f4706){if(_0x4f4706)_0x2e4fe8(_0x4f4706);return _0x100e97();});});})[_0xe650('0x18')](function(){return _0x23aa79[_0xe650('0x54')](_0x4197e5,_0x483b13,function(_0x41b630){if(_0x41b630){console[_0xe650('0x74')](_0xe650('0x75'),_0x41b630);}else{fs['unlinkSync'](_0x4197e5);}});});});}else{return _0x23aa79[_0xe650('0x1b')](0xc8);}})['catch'](handleError(_0x23aa79,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7c46174..4044e3c 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 _0x5fdc=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','map'];(function(_0x65543,_0x2cd568){var _0x41593f=function(_0x4e331d){while(--_0x4e331d){_0x65543['push'](_0x65543['shift']());}};_0x41593f(++_0x2cd568);}(_0x5fdc,0x127));var _0xc5fd=function(_0x2b13b9,_0x1723f2){_0x2b13b9=_0x2b13b9-0x0;var _0x5a82bf=_0x5fdc[_0x2b13b9];return _0x5a82bf;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var SmsInteraction=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var SmsMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5fd('0x4')](0x0);var events={'afterCreate':_0xc5fd('0x5'),'afterUpdate':_0xc5fd('0x6'),'afterDestroy':_0xc5fd('0x7')};function emitEvent(_0x1b6205){return function(_0xca27a0,_0xea5748,_0x44722b){_0xca27a0[_0xc5fd('0x8')]({'attributes':['id'],'raw':!![]})[_0xc5fd('0x9')](function(_0x5a2eb4){_0xca27a0['setDataValue']('Users',_0x5a2eb4[_0xc5fd('0xa')](function(_0x46bce3){return{'id':_0x46bce3['id']};}));return SmsMessage[_0xc5fd('0xb')]({'where':{'SmsInteractionId':_0xca27a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5fd('0x9')](function(_0x4e6d35){_0xca27a0['setDataValue'](_0xc5fd('0xc'),_0x4e6d35[_0xc5fd('0xd')]);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205+':'+_0xca27a0['id'],_0xca27a0);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205,_0xca27a0);_0x44722b(null);})[_0xc5fd('0xf')](_0x44722b(null));};}for(var e in events){if(events[_0xc5fd('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc5fd('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x98f35e,_0xe4cd71){_0x98f35e=_0x98f35e-0x0;var _0x1655aa=_0xf4f4[_0x98f35e];return _0x1655aa;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0d67e5d..83a3fc7 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 _0xccb6=['request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccb6,0x1ea));var _0x6ccb=function(_0x204e08,_0x36ca59){_0x204e08=_0x204e08-0x0;var _0x4dd55e=_0xccb6[_0x204e08];return _0x4dd55e;};'use strict';var _=require('lodash');var util=require(_0x6ccb('0x0'));var logger=require(_0x6ccb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6ccb('0x2'));var rp=require(_0x6ccb('0x3'));var fs=require('fs');var path=require(_0x6ccb('0x4'));var rimraf=require(_0x6ccb('0x5'));var config=require(_0x6ccb('0x6'));var attributes=require(_0x6ccb('0x7'));module[_0x6ccb('0x8')]=function(_0x1c5584,_0x35d35a){return _0x1c5584[_0x6ccb('0x9')](_0x6ccb('0xa'),attributes,{'tableName':_0x6ccb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25d711,_0x3f4b19,_0x8ce888){if(_0x25d711[_0x6ccb('0xc')](_0x6ccb('0xd'))){_0x25d711[_0x6ccb('0xe')]=moment()[_0x6ccb('0xf')](_0x6ccb('0x10'));}_0x8ce888(null,_0x25d711);}}});}; \ No newline at end of file +var _0x011a=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x35c65c,_0x563391){var _0x21e4fb=function(_0xecaf69){while(--_0xecaf69){_0x35c65c['push'](_0x35c65c['shift']());}};_0x21e4fb(++_0x563391);}(_0x011a,0x1c0));var _0xa011=function(_0xdc66e7,_0x13a216){_0xdc66e7=_0xdc66e7-0x0;var _0x1a46af=_0x011a[_0xdc66e7];return _0x1a46af;};'use strict';var _=require(_0xa011('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa011('0x1'));var moment=require('moment');var BPromise=require(_0xa011('0x2'));var rp=require(_0xa011('0x3'));var fs=require('fs');var path=require(_0xa011('0x4'));var rimraf=require(_0xa011('0x5'));var config=require(_0xa011('0x6'));var attributes=require(_0xa011('0x7'));module[_0xa011('0x8')]=function(_0x36547d,_0x3946ca){return _0x36547d['define'](_0xa011('0x9'),attributes,{'tableName':_0xa011('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5071fe,_0x58d844,_0x490dea){if(_0x5071fe[_0xa011('0xb')]('closed')){_0x5071fe['closedAt']=moment()[_0xa011('0xc')](_0xa011('0xd'));}_0x490dea(null,_0x5071fe);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index be9fbd2..86121ff 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 _0x13e7=['debug','stringify','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','then'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x13e7,0xf9));var _0x713e=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x13e7[_0x79b649];return _0x1af9b1;};'use strict';var _=require('lodash');var util=require(_0x713e('0x0'));var moment=require(_0x713e('0x1'));var BPromise=require(_0x713e('0x2'));var rs=require(_0x713e('0x3'));var fs=require('fs');var Redis=require(_0x713e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x713e('0x5'))(_0x713e('0x6'));var config=require(_0x713e('0x7'));var jayson=require(_0x713e('0x8'));var client=jayson[_0x713e('0x9')][_0x713e('0xa')]({'port':0x232a});config[_0x713e('0xb')]=_[_0x713e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x713e('0xb')]));require('./smsInteraction.socket')[_0x713e('0xd')](socket);function respondWithRpcPromise(_0x2af644,_0x23ea72,_0x5a210d){return new BPromise(function(_0x18857d,_0x438378){return client[_0x713e('0xe')](_0x2af644,_0x5a210d)['then'](function(_0x4487b6){logger[_0x713e('0xf')](_0x713e('0x10'),_0x23ea72,_0x713e('0x11'));logger['debug'](_0x713e('0x12'),_0x23ea72,_0x713e('0x11'),JSON['stringify'](_0x4487b6));if(_0x4487b6[_0x713e('0x13')]){if(_0x4487b6['error']['code']===0x1f4){logger['error'](_0x713e('0x10'),_0x23ea72,_0x4487b6['error'][_0x713e('0x14')]);return _0x438378(_0x4487b6['error']['message']);}logger[_0x713e('0x13')](_0x713e('0x10'),_0x23ea72,_0x4487b6[_0x713e('0x13')][_0x713e('0x14')]);return _0x18857d(_0x4487b6[_0x713e('0x13')][_0x713e('0x14')]);}else{logger['info'](_0x713e('0x10'),_0x23ea72,_0x713e('0x11'));_0x18857d(_0x4487b6['result']['message']);}})[_0x713e('0x15')](function(_0x233b74){logger[_0x713e('0x13')](_0x713e('0x10'),_0x23ea72,_0x233b74);_0x438378(_0x233b74);});});}exports[_0x713e('0x16')]=function(_0x27202b){var _0x1e81ed=this;return new Promise(function(_0x11df16,_0x3fc69a){return db[_0x713e('0x17')][_0x713e('0x18')](_0x27202b[_0x713e('0x19')],{'raw':_0x27202b[_0x713e('0x1a')]?_0x27202b[_0x713e('0x1a')][_0x713e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27202b[_0x713e('0x1a')]?_0x27202b[_0x713e('0x1a')]['where']||null:null,'attributes':_0x27202b[_0x713e('0x1a')]?_0x27202b[_0x713e('0x1a')][_0x713e('0x1c')]||null:null,'limit':_0x27202b[_0x713e('0x1a')]?_0x27202b[_0x713e('0x1a')][_0x713e('0x1d')]||null:null})[_0x713e('0x1e')](function(_0x6595f8){logger[_0x713e('0xf')](_0x713e('0x16'),_0x27202b);logger[_0x713e('0x1f')]('UpdateSmsInteraction',_0x27202b,JSON[_0x713e('0x20')](_0x6595f8));_0x11df16(_0x6595f8);})[_0x713e('0x15')](function(_0x5516c6){logger[_0x713e('0x13')](_0x713e('0x16'),_0x5516c6[_0x713e('0x14')],_0x27202b);_0x3fc69a(_0x1e81ed[_0x713e('0x13')](0x1f4,_0x5516c6['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x4b1681){return new Promise(function(_0x5a3596,_0x51de15){return db[_0x713e('0x17')][_0x713e('0x21')]({'where':_0x4b1681['options']?_0x4b1681[_0x713e('0x1a')][_0x713e('0x22')]||null:null})[_0x713e('0x1e')](function(_0x1f54a6){if(_0x1f54a6){return _0x1f54a6[_0x713e('0x23')](_0x4b1681[_0x713e('0x19')][_0x713e('0x24')],_[_0x713e('0x25')](_0x4b1681[_0x713e('0x19')],[_0x713e('0x24'),'id'])||{});}})[_0x713e('0x26')](function(_0x795d65){logger[_0x713e('0xf')]('AddTags',_0x4b1681);logger['debug'](_0x713e('0x27'),_0x4b1681,JSON[_0x713e('0x20')](_0x795d65));_0x5a3596(_0x795d65);})['catch'](function(_0x21db0e){logger[_0x713e('0x13')](_0x713e('0x27'),_0x21db0e[_0x713e('0x14')],_0x4b1681);_0x51de15(_this[_0x713e('0x13')](0x1f4,_0x21db0e[_0x713e('0x14')]));});});}; \ No newline at end of file +var _0xf90d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','raw','options','where','limit','then','AddTagsToSmsInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x44a69e,_0x1624b3){var _0x5031b6=function(_0x59d6d4){while(--_0x59d6d4){_0x44a69e['push'](_0x44a69e['shift']());}};_0x5031b6(++_0x1624b3);}(_0xf90d,0x1c6));var _0xdf90=function(_0x234d16,_0x246c5f){_0x234d16=_0x234d16-0x0;var _0x5a0b09=_0xf90d[_0x234d16];return _0x5a0b09;};'use strict';var _=require(_0xdf90('0x0'));var util=require(_0xdf90('0x1'));var moment=require('moment');var BPromise=require(_0xdf90('0x2'));var rs=require(_0xdf90('0x3'));var fs=require('fs');var Redis=require(_0xdf90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf90('0x5'));var logger=require(_0xdf90('0x6'))(_0xdf90('0x7'));var config=require(_0xdf90('0x8'));var jayson=require(_0xdf90('0x9'));var client=jayson[_0xdf90('0xa')][_0xdf90('0xb')]({'port':0x232a});config[_0xdf90('0xc')]=_[_0xdf90('0xd')](config[_0xdf90('0xc')],{'host':_0xdf90('0xe'),'port':0x18eb});var socket=require(_0xdf90('0xf'))(new Redis(config[_0xdf90('0xc')]));require('./smsInteraction.socket')[_0xdf90('0x10')](socket);function respondWithRpcPromise(_0x5d7013,_0x3055ac,_0x1ac2e8){return new BPromise(function(_0x3d432e,_0x3c1eb9){return client[_0xdf90('0x11')](_0x5d7013,_0x1ac2e8)['then'](function(_0x10c805){logger[_0xdf90('0x12')](_0xdf90('0x13'),_0x3055ac,_0xdf90('0x14'));logger[_0xdf90('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3055ac,_0xdf90('0x14'),JSON[_0xdf90('0x16')](_0x10c805));if(_0x10c805[_0xdf90('0x17')]){if(_0x10c805['error']['code']===0x1f4){logger[_0xdf90('0x17')](_0xdf90('0x13'),_0x3055ac,_0x10c805[_0xdf90('0x17')][_0xdf90('0x18')]);return _0x3c1eb9(_0x10c805[_0xdf90('0x17')][_0xdf90('0x18')]);}logger[_0xdf90('0x17')](_0xdf90('0x13'),_0x3055ac,_0x10c805[_0xdf90('0x17')][_0xdf90('0x18')]);return _0x3d432e(_0x10c805[_0xdf90('0x17')][_0xdf90('0x18')]);}else{logger['info'](_0xdf90('0x13'),_0x3055ac,_0xdf90('0x14'));_0x3d432e(_0x10c805[_0xdf90('0x19')]['message']);}})[_0xdf90('0x1a')](function(_0x30f624){logger[_0xdf90('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x3055ac,_0x30f624);_0x3c1eb9(_0x30f624);});});}exports[_0xdf90('0x1b')]=function(_0x5f5753){var _0xfd7417=this;return new Promise(function(_0x19e4a1,_0x5a8c34){return db[_0xdf90('0x1c')][_0xdf90('0x1d')](_0x5f5753[_0xdf90('0x1e')],{'raw':_0x5f5753['options']?_0x5f5753['options'][_0xdf90('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f5753['options']?_0x5f5753[_0xdf90('0x20')][_0xdf90('0x21')]||null:null,'attributes':_0x5f5753[_0xdf90('0x20')]?_0x5f5753['options']['attributes']||null:null,'limit':_0x5f5753[_0xdf90('0x20')]?_0x5f5753[_0xdf90('0x20')][_0xdf90('0x22')]||null:null})[_0xdf90('0x23')](function(_0x33f794){logger[_0xdf90('0x12')](_0xdf90('0x1b'),_0x5f5753);logger[_0xdf90('0x15')](_0xdf90('0x1b'),_0x5f5753,JSON[_0xdf90('0x16')](_0x33f794));_0x19e4a1(_0x33f794);})[_0xdf90('0x1a')](function(_0x47c15e){logger['error'](_0xdf90('0x1b'),_0x47c15e[_0xdf90('0x18')],_0x5f5753);_0x5a8c34(_0xfd7417['error'](0x1f4,_0x47c15e[_0xdf90('0x18')]));});});};exports[_0xdf90('0x24')]=function(_0x4ae2ad){return new Promise(function(_0x57792b,_0x58a09d){return db[_0xdf90('0x1c')]['find']({'where':_0x4ae2ad[_0xdf90('0x20')]?_0x4ae2ad[_0xdf90('0x20')]['where']||null:null})[_0xdf90('0x23')](function(_0x32950f){if(_0x32950f){return _0x32950f[_0xdf90('0x25')](_0x4ae2ad['body']['ids'],_[_0xdf90('0x26')](_0x4ae2ad[_0xdf90('0x1e')],[_0xdf90('0x27'),'id'])||{});}})[_0xdf90('0x28')](function(_0x30a8c4){logger[_0xdf90('0x12')](_0xdf90('0x29'),_0x4ae2ad);logger[_0xdf90('0x15')]('AddTags',_0x4ae2ad,JSON[_0xdf90('0x16')](_0x30a8c4));_0x57792b(_0x30a8c4);})[_0xdf90('0x1a')](function(_0x76f8e0){logger[_0xdf90('0x17')]('AddTags',_0x76f8e0[_0xdf90('0x18')],_0x4ae2ad);_0x58a09d(_this['error'](0x1f4,_0x76f8e0[_0xdf90('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e0b7880..f75c462 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 _0xc1c3=['./smsInteraction.events','save','update','register','smsInteraction:'];(function(_0x1d32ac,_0x16f800){var _0x2e15e4=function(_0x3e36f4){while(--_0x3e36f4){_0x1d32ac['push'](_0x1d32ac['shift']());}};_0x2e15e4(++_0x16f800);}(_0xc1c3,0x1b3));var _0x3c1c=function(_0x3dbdc7,_0x4c509a){_0x3dbdc7=_0x3dbdc7-0x0;var _0x302e40=_0xc1c3[_0x3dbdc7];return _0x302e40;};'use strict';var SmsInteractionEvents=require(_0x3c1c('0x0'));var events=[_0x3c1c('0x1'),'remove',_0x3c1c('0x2')];function createListener(_0x37a45d,_0x368646){return function(_0x1600d3){_0x368646['emit'](_0x37a45d,_0x1600d3);};}function removeListener(_0x582397,_0x2187dd){return function(){SmsInteractionEvents['removeListener'](_0x582397,_0x2187dd);};}exports[_0x3c1c('0x3')]=function(_0x2e86bc){for(var _0x27e98f=0x0,_0x3278f4=events['length'];_0x27e98f<_0x3278f4;_0x27e98f++){var _0x5c1131=events[_0x27e98f];var _0x493912=createListener(_0x3c1c('0x4')+_0x5c1131,_0x2e86bc);SmsInteractionEvents['on'](_0x5c1131,_0x493912);}}; \ No newline at end of file +var _0x101f=['smsInteraction:','save','remove','update','emit','length'];(function(_0x4e07d9,_0x15d276){var _0x508643=function(_0x145846){while(--_0x145846){_0x4e07d9['push'](_0x4e07d9['shift']());}};_0x508643(++_0x15d276);}(_0x101f,0x14b));var _0xf101=function(_0x5b4d88,_0x1ebaab){_0x5b4d88=_0x5b4d88-0x0;var _0x5de506=_0x101f[_0x5b4d88];return _0x5de506;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xf101('0x0'),_0xf101('0x1'),_0xf101('0x2')];function createListener(_0xbae084,_0x4e3f66){return function(_0x2290cd){_0x4e3f66[_0xf101('0x3')](_0xbae084,_0x2290cd);};}function removeListener(_0x5db60b,_0x2460cf){return function(){SmsInteractionEvents['removeListener'](_0x5db60b,_0x2460cf);};}exports['register']=function(_0x23fda2){for(var _0x1e5ad4=0x0,_0x199704=events[_0xf101('0x4')];_0x1e5ad4<_0x199704;_0x1e5ad4++){var _0xa83a49=events[_0x1e5ad4];var _0x3a6598=createListener(_0xf101('0x5')+_0xa83a49,_0x23fda2);SmsInteractionEvents['on'](_0xa83a49,_0x3a6598);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 207db2a..1dbdbec 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 _0x5eb3=['post','tracked','sms','smsmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x45cd2a,_0x56b7b4){var _0x3bb615=function(_0x5ce611){while(--_0x5ce611){_0x45cd2a['push'](_0x45cd2a['shift']());}};_0x3bb615(++_0x56b7b4);}(_0x5eb3,0xd0));var _0x35eb=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x5eb3[_0x2becba];return _0x90b5dd;};'use strict';var multer=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var path=require(_0x35eb('0x2'));var timeout=require(_0x35eb('0x3'));var express=require(_0x35eb('0x4'));var router=express[_0x35eb('0x5')]();var fs_extra=require(_0x35eb('0x6'));var auth=require(_0x35eb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x35eb('0x8'));var controller=require(_0x35eb('0x9'));router[_0x35eb('0xa')]('/',auth[_0x35eb('0xb')](),controller[_0x35eb('0xc')]);router[_0x35eb('0xa')](_0x35eb('0xd'),auth[_0x35eb('0xb')](),controller['describe']);router[_0x35eb('0xa')](_0x35eb('0xe'),auth[_0x35eb('0xb')](),controller[_0x35eb('0xf')]);router[_0x35eb('0x10')]('/',auth[_0x35eb('0xb')](),interaction[_0x35eb('0x11')](_0x35eb('0x12'),_0x35eb('0x13')),controller['create']);router[_0x35eb('0x10')]('/:id/status',controller['status']);router[_0x35eb('0x14')](_0x35eb('0xe'),auth[_0x35eb('0xb')](),controller[_0x35eb('0x15')]);router[_0x35eb('0x14')](_0x35eb('0x16'),auth[_0x35eb('0xb')](),controller[_0x35eb('0x17')]);router[_0x35eb('0x14')](_0x35eb('0x18'),auth[_0x35eb('0xb')](),controller[_0x35eb('0x19')]);router[_0x35eb('0x1a')](_0x35eb('0xe'),auth[_0x35eb('0xb')](),controller['destroy']);module[_0x35eb('0x1b')]=router; \ No newline at end of file +var _0xb665=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','show','post','tracked','sms','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express','Router'];(function(_0x170b20,_0x49fc52){var _0xbe0395=function(_0x410eea){while(--_0x410eea){_0x170b20['push'](_0x170b20['shift']());}};_0xbe0395(++_0x49fc52);}(_0xb665,0x128));var _0x5b66=function(_0x52849a,_0x356af7){_0x52849a=_0x52849a-0x0;var _0x244de5=_0xb665[_0x52849a];return _0x244de5;};'use strict';var multer=require('multer');var util=require(_0x5b66('0x0'));var path=require(_0x5b66('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b66('0x2'));var router=express[_0x5b66('0x3')]();var fs_extra=require(_0x5b66('0x4'));var auth=require(_0x5b66('0x5'));var interaction=require(_0x5b66('0x6'));var config=require(_0x5b66('0x7'));var controller=require(_0x5b66('0x8'));router[_0x5b66('0x9')]('/',auth[_0x5b66('0xa')](),controller['index']);router[_0x5b66('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5b66('0x9')]('/:id',auth[_0x5b66('0xa')](),controller[_0x5b66('0xb')]);router[_0x5b66('0xc')]('/',auth[_0x5b66('0xa')](),interaction[_0x5b66('0xd')](_0x5b66('0xe'),'smsmessage:create'),controller['create']);router[_0x5b66('0xc')]('/:id/status',controller[_0x5b66('0xf')]);router[_0x5b66('0x10')](_0x5b66('0x11'),auth['isAuthenticated'](),controller['update']);router['put'](_0x5b66('0x12'),auth[_0x5b66('0xa')](),controller[_0x5b66('0x13')]);router[_0x5b66('0x10')](_0x5b66('0x14'),auth[_0x5b66('0xa')](),controller[_0x5b66('0x15')]);router[_0x5b66('0x16')]('/:id',auth[_0x5b66('0xa')](),controller[_0x5b66('0x17')]);module[_0x5b66('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3a45268..c687d6d 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 _0x910c=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4e6ece,_0x522481){var _0x2e93c0=function(_0xa1d247){while(--_0xa1d247){_0x4e6ece['push'](_0x4e6ece['shift']());}};_0x2e93c0(++_0x522481);}(_0x910c,0x12d));var _0xc910=function(_0x16a637,_0x5eb627){_0x16a637=_0x16a637-0x0;var _0x25126d=_0x910c[_0x16a637];return _0x25126d;};'use strict';var Sequelize=require(_0xc910('0x0'));module[_0xc910('0x1')]={'body':{'type':Sequelize[_0xc910('0x2')](_0xc910('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc910('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc910('0x5')]('in','out'),'defaultValue':_0xc910('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc910('0x7')](0xbe)},'phone':{'type':Sequelize[_0xc910('0x7')]},'readAt':{'type':Sequelize[_0xc910('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc910('0x7')]},'providerResponse':{'type':Sequelize[_0xc910('0x2')]}}; \ No newline at end of file +var _0x00d4=['out','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x00d4,0x121));var _0x400d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x00d4[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x400d('0x0'));module['exports']={'body':{'type':Sequelize[_0x400d('0x1')](_0x400d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x400d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x400d('0x4')]('in',_0x400d('0x5')),'defaultValue':_0x400d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x400d('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x400d('0x6')]},'providerResponse':{'type':Sequelize[_0x400d('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6cde833..44aa1cf 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 _0xb7d6=['keys','rawAttributes','options','find','create','body','params','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','internal','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','plivio','infobip','results','groupName','DELIVERED','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','map','SmsMessage','fieldName','model','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show'];(function(_0x1b24c8,_0x4b6360){var _0x64de8f=function(_0x342255){while(--_0x342255){_0x1b24c8['push'](_0x1b24c8['shift']());}};_0x64de8f(++_0x4b6360);}(_0xb7d6,0xca));var _0x6b7d=function(_0x4ccc51,_0x1bffe6){_0x4ccc51=_0x4ccc51-0x0;var _0x1d7842=_0xb7d6[_0x4ccc51];return _0x1d7842;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6b7d('0x0'));var rp=require(_0x6b7d('0x1'));var moment=require(_0x6b7d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6b7d('0x3'));var util=require(_0x6b7d('0x4'));var path=require(_0x6b7d('0x5'));var sox=require(_0x6b7d('0x6'));var csv=require('to-csv');var ejs=require(_0x6b7d('0x7'));var fs=require('fs');var fs_extra=require(_0x6b7d('0x8'));var _=require(_0x6b7d('0x9'));var squel=require(_0x6b7d('0xa'));var crypto=require(_0x6b7d('0xb'));var jsforce=require(_0x6b7d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b7d('0xd'));var querystring=require(_0x6b7d('0xe'));var Papa=require(_0x6b7d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b7d('0x10'));var hardwareService=require(_0x6b7d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6b7d('0x12'));var config=require(_0x6b7d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b7d('0x14'))['db'];config[_0x6b7d('0x15')]=_['defaults'](config['redis'],{'host':_0x6b7d('0x16'),'port':0x18eb});var socket=require(_0x6b7d('0x17'))(new Redis(config[_0x6b7d('0x15')]));require(_0x6b7d('0x18'))[_0x6b7d('0x19')](socket);var jayson=require(_0x6b7d('0x1a'));var client=jayson[_0x6b7d('0x1b')][_0x6b7d('0x1c')]({'port':0x232c});var client9002=jayson[_0x6b7d('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9177,_0x556d15,_0x302737,_0x1e6725){return new BPromise(function(_0x2386c4,_0x4979bd){var _0x8d78b4=_0x1e6725||client;return _0x8d78b4[_0x6b7d('0x1d')](_0x2e9177,_0x302737)[_0x6b7d('0x1e')](function(_0x2212dd){logger[_0x6b7d('0x1f')](_0x6b7d('0x20'),_0x556d15,_0x6b7d('0x21'));logger[_0x6b7d('0x22')](_0x6b7d('0x23'),_0x556d15,_0x6b7d('0x21'),JSON[_0x6b7d('0x24')](_0x2212dd));if(_0x2212dd[_0x6b7d('0x25')]){if(_0x2212dd[_0x6b7d('0x25')][_0x6b7d('0x26')]===0x1f4){logger[_0x6b7d('0x25')](_0x6b7d('0x20'),_0x556d15,_0x2212dd['error']['message']);return _0x4979bd(_0x2212dd[_0x6b7d('0x25')]['message']);}logger[_0x6b7d('0x25')](_0x6b7d('0x20'),_0x556d15,_0x2212dd[_0x6b7d('0x25')][_0x6b7d('0x27')]);return _0x2386c4(_0x2212dd['error'][_0x6b7d('0x27')]);}else{logger[_0x6b7d('0x1f')](_0x6b7d('0x20'),_0x556d15,_0x6b7d('0x21'));_0x2386c4(_0x2212dd[_0x6b7d('0x28')][_0x6b7d('0x27')]);}})['catch'](function(_0x13d92d){logger[_0x6b7d('0x25')](_0x6b7d('0x20'),_0x556d15,_0x13d92d);_0x4979bd(_0x13d92d);});});}function respondWithStatusCode(_0x4841c9,_0x440016){_0x440016=_0x440016||0xcc;return function(_0x2701de){if(_0x2701de){return _0x4841c9[_0x6b7d('0x29')](_0x440016);}return _0x4841c9[_0x6b7d('0x2a')](_0x440016)[_0x6b7d('0x2b')]();};}function respondWithResult(_0x58250b,_0x2bb998){_0x2bb998=_0x2bb998||0xc8;return function(_0x45ade3){if(_0x45ade3){return _0x58250b[_0x6b7d('0x2a')](_0x2bb998)[_0x6b7d('0x2c')](_0x45ade3);}};}function respondWithFilteredResult(_0xae3138,_0x2058e9){return function(_0x57b65b){if(_0x57b65b){var _0xcd58b0=typeof _0x2058e9[_0x6b7d('0x2d')]===_0x6b7d('0x2e')&&typeof _0x2058e9[_0x6b7d('0x2f')]===_0x6b7d('0x2e');var _0x55d341=_0x57b65b[_0x6b7d('0x30')];var _0x5056e8=_0xcd58b0?0x0:_0x2058e9[_0x6b7d('0x2d')];var _0x38130c=_0xcd58b0?_0x57b65b['count']:_0x2058e9[_0x6b7d('0x2d')]+_0x2058e9['limit'];var _0x22f839;if(_0x38130c>=_0x55d341){_0x38130c=_0x55d341;_0x22f839=0xc8;}else{_0x22f839=0xce;}_0xae3138[_0x6b7d('0x2a')](_0x22f839);return _0xae3138[_0x6b7d('0x31')](_0x6b7d('0x32'),_0x5056e8+'-'+_0x38130c+'/'+_0x55d341)[_0x6b7d('0x2c')](_0x57b65b);}return null;};}function patchUpdates(_0x47b671){return function(_0x389982){try{jsonpatch[_0x6b7d('0x33')](_0x389982,_0x47b671,!![]);}catch(_0x893233){return BPromise[_0x6b7d('0x34')](_0x893233);}return _0x389982['save']();};}function saveUpdates(_0x344117,_0x28c2bb){return function(_0x528725){if(_0x528725){return _0x528725[_0x6b7d('0x35')](_0x344117)[_0x6b7d('0x1e')](function(_0x36fdeb){return _0x36fdeb;});}return null;};}function removeEntity(_0xe54b7e,_0x4aedaf){return function(_0x100d6c){if(_0x100d6c){return _0x100d6c[_0x6b7d('0x36')]()['then'](function(){_0xe54b7e['status'](0xcc)[_0x6b7d('0x2b')]();});}};}function handleEntityNotFound(_0x5bb6ee,_0x121ef7){return function(_0x24e303){if(!_0x24e303){_0x5bb6ee['sendStatus'](0x194);}return _0x24e303;};}function handleError(_0x337af8,_0x390146){_0x390146=_0x390146||0x1f4;return function(_0x3ae271){logger[_0x6b7d('0x25')](_0x3ae271[_0x6b7d('0x37')]);if(_0x3ae271['name']){delete _0x3ae271[_0x6b7d('0x38')];}_0x337af8[_0x6b7d('0x2a')](_0x390146)[_0x6b7d('0x39')](_0x3ae271);};}exports['index']=function(_0x461db8,_0x2bf83d){var _0x148a9f={},_0x4cefd0={},_0x3b0cce={'count':0x0,'rows':[]};var _0x1d82f7=_[_0x6b7d('0x3a')](db[_0x6b7d('0x3b')]['rawAttributes'],function(_0x10a9eb){return{'name':_0x10a9eb[_0x6b7d('0x3c')],'type':_0x10a9eb['type']['key']};});_0x4cefd0[_0x6b7d('0x3d')]=_[_0x6b7d('0x3a')](_0x1d82f7,_0x6b7d('0x38'));_0x4cefd0[_0x6b7d('0x3e')]=_['keys'](_0x461db8[_0x6b7d('0x3e')]);_0x4cefd0[_0x6b7d('0x3f')]=_[_0x6b7d('0x40')](_0x4cefd0[_0x6b7d('0x3d')],_0x4cefd0[_0x6b7d('0x3e')]);_0x148a9f['attributes']=_[_0x6b7d('0x40')](_0x4cefd0['model'],qs['fields'](_0x461db8[_0x6b7d('0x3e')][_0x6b7d('0x41')]));_0x148a9f['attributes']=_0x148a9f[_0x6b7d('0x42')][_0x6b7d('0x43')]?_0x148a9f[_0x6b7d('0x42')]:_0x4cefd0[_0x6b7d('0x3d')];if(!_0x461db8[_0x6b7d('0x3e')]['hasOwnProperty']('nolimit')){_0x148a9f[_0x6b7d('0x2f')]=qs[_0x6b7d('0x2f')](_0x461db8['query'][_0x6b7d('0x2f')]);_0x148a9f[_0x6b7d('0x2d')]=qs[_0x6b7d('0x2d')](_0x461db8[_0x6b7d('0x3e')]['offset']);}_0x148a9f[_0x6b7d('0x44')]=qs['sort'](_0x461db8['query']['sort']);_0x148a9f[_0x6b7d('0x45')]=qs[_0x6b7d('0x3f')](_[_0x6b7d('0x46')](_0x461db8[_0x6b7d('0x3e')],_0x4cefd0['filters']),_0x1d82f7);if(_0x461db8[_0x6b7d('0x3e')][_0x6b7d('0x47')]){_0x148a9f[_0x6b7d('0x45')]=_[_0x6b7d('0x48')](_0x148a9f[_0x6b7d('0x45')],{'$or':_[_0x6b7d('0x3a')](_0x1d82f7,function(_0xcf3aaf){if(_0xcf3aaf[_0x6b7d('0x49')]!=='VIRTUAL'){var _0x39e5b7={};_0x39e5b7[_0xcf3aaf[_0x6b7d('0x38')]]={'$like':'%'+_0x461db8[_0x6b7d('0x3e')][_0x6b7d('0x47')]+'%'};return _0x39e5b7;}})});}_0x148a9f=_[_0x6b7d('0x48')]({},_0x148a9f,_0x461db8['options']);var _0x144e8d={'where':_0x148a9f[_0x6b7d('0x45')]};return db[_0x6b7d('0x3b')]['count'](_0x144e8d)[_0x6b7d('0x1e')](function(_0x36ad4b){_0x3b0cce['count']=_0x36ad4b;if(_0x461db8[_0x6b7d('0x3e')][_0x6b7d('0x4a')]){_0x148a9f[_0x6b7d('0x4b')]=[{'all':!![]}];}return db[_0x6b7d('0x3b')][_0x6b7d('0x4c')](_0x148a9f);})[_0x6b7d('0x1e')](function(_0x3416d1){_0x3b0cce[_0x6b7d('0x4d')]=_0x3416d1;return _0x3b0cce;})[_0x6b7d('0x1e')](respondWithFilteredResult(_0x2bf83d,_0x148a9f))[_0x6b7d('0x4e')](handleError(_0x2bf83d,null));};exports[_0x6b7d('0x4f')]=function(_0x370e64,_0x53321d){var _0x3d451f={'raw':!![],'where':{'id':_0x370e64['params']['id']}},_0x13a711={};_0x13a711[_0x6b7d('0x3d')]=_[_0x6b7d('0x50')](db['SmsMessage'][_0x6b7d('0x51')]);_0x13a711[_0x6b7d('0x3e')]=_[_0x6b7d('0x50')](_0x370e64[_0x6b7d('0x3e')]);_0x13a711['filters']=_[_0x6b7d('0x40')](_0x13a711[_0x6b7d('0x3d')],_0x13a711[_0x6b7d('0x3e')]);_0x3d451f[_0x6b7d('0x42')]=_[_0x6b7d('0x40')](_0x13a711[_0x6b7d('0x3d')],qs[_0x6b7d('0x41')](_0x370e64['query'][_0x6b7d('0x41')]));_0x3d451f['attributes']=_0x3d451f['attributes'][_0x6b7d('0x43')]?_0x3d451f[_0x6b7d('0x42')]:_0x13a711['model'];if(_0x370e64['query'][_0x6b7d('0x4a')]){_0x3d451f[_0x6b7d('0x4b')]=[{'all':!![]}];}_0x3d451f=_['merge']({},_0x3d451f,_0x370e64[_0x6b7d('0x52')]);return db[_0x6b7d('0x3b')][_0x6b7d('0x53')](_0x3d451f)['then'](handleEntityNotFound(_0x53321d,null))['then'](respondWithResult(_0x53321d,null))[_0x6b7d('0x4e')](handleError(_0x53321d,null));};exports[_0x6b7d('0x54')]=function(_0x4bfaa8,_0x58caf8){return db[_0x6b7d('0x3b')][_0x6b7d('0x54')](_0x4bfaa8['body'],{})['then'](respondWithResult(_0x58caf8,0xc9))[_0x6b7d('0x4e')](handleError(_0x58caf8,null));};exports[_0x6b7d('0x35')]=function(_0x42c795,_0x3556b8){if(_0x42c795[_0x6b7d('0x55')]['id']){delete _0x42c795[_0x6b7d('0x55')]['id'];}return db[_0x6b7d('0x3b')][_0x6b7d('0x53')]({'where':{'id':_0x42c795[_0x6b7d('0x56')]['id']}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x3556b8,null))['then'](saveUpdates(_0x42c795[_0x6b7d('0x55')],null))[_0x6b7d('0x1e')](respondWithResult(_0x3556b8,null))['catch'](handleError(_0x3556b8,null));};exports[_0x6b7d('0x36')]=function(_0x3e99b7,_0x466b9b){return db[_0x6b7d('0x3b')][_0x6b7d('0x53')]({'where':{'id':_0x3e99b7[_0x6b7d('0x56')]['id']}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x466b9b,null))[_0x6b7d('0x1e')](removeEntity(_0x466b9b,null))['catch'](handleError(_0x466b9b,null));};exports[_0x6b7d('0x57')]=function(_0x4d8646,_0x295417){return db[_0x6b7d('0x3b')][_0x6b7d('0x57')]()[_0x6b7d('0x1e')](respondWithResult(_0x295417,null))[_0x6b7d('0x4e')](handleError(_0x295417,null));};var interaction_log=require(_0x6b7d('0x58'))(_0x6b7d('0x59'));exports[_0x6b7d('0x5a')]=function(_0x2d02c6,_0x44848a,_0xcd89f9){var _0x428415={'agent':{},'channel':_0x6b7d('0x5b')};if(_0x2d02c6['body']['id']){delete _0x2d02c6['body']['id'];}_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x5c')]=!![];_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x5d')]=moment()[_0x6b7d('0x5e')](_0x6b7d('0x5f'));_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x60')]=_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x60')]||_0x2d02c6[_0x6b7d('0x61')]['id'];_0x428415[_0x6b7d('0x62')]['id']=_0x2d02c6['body'][_0x6b7d('0x60')];return db[_0x6b7d('0x3b')][_0x6b7d('0x53')]({'where':{'id':_0x2d02c6['params']['id'],'UserId':null}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x44848a,null))[_0x6b7d('0x1e')](saveUpdates(_0x2d02c6[_0x6b7d('0x55')],null))[_0x6b7d('0x1e')](function(_0x3881b1){if(_0x3881b1){_0x428415[_0x6b7d('0x27')]=_0x3881b1[_0x6b7d('0x63')]({'plain':!![]});return db[_0x6b7d('0x64')][_0x6b7d('0x53')]({'where':{'id':_0x3881b1[_0x6b7d('0x65')]}});}return null;})[_0x6b7d('0x1e')](handleEntityNotFound(_0x44848a,null))[_0x6b7d('0x1e')](function(_0x2bb535){if(_0x2bb535){return _0x2bb535[_0x6b7d('0x35')]({'UserId':_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x60')],'read1stAt':_['isNil'](_0x2bb535[_0x6b7d('0x66')])?moment()[_0x6b7d('0x5e')](_0x6b7d('0x5f')):undefined});}return null;})[_0x6b7d('0x1e')](function(_0x14d766){if(_0x14d766){_0x428415[_0x6b7d('0x67')]=_0x14d766['get']({'plain':!![]});interaction_log[_0x6b7d('0x1f')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d02c6[_0x6b7d('0x61')]['id'],_0x2d02c6[_0x6b7d('0x61')]['name'],_0x2d02c6[_0x6b7d('0x61')]['role'],_0x428415[_0x6b7d('0x67')]['id'],_0x2d02c6[_0x6b7d('0x55')]?JSON[_0x6b7d('0x24')](_0x2d02c6[_0x6b7d('0x55')]):_0x6b7d('0x68'));return respondWithRpcPromise(_0x6b7d('0x69'),_0x6b7d('0x6a'),_0x428415);}return null;})[_0x6b7d('0x1e')](function(_0x2e1e2d){var _0x11982a=_0x6b7d('0x6b')+_0x2e1e2d[_0x6b7d('0x27')][_0x6b7d('0x6c')];return db['sequelize'][_0x6b7d('0x3e')](_0x11982a,{'type':db[_0x6b7d('0x6d')][_0x6b7d('0x6e')][_0x6b7d('0x6f')],'raw':!![]})[_0x6b7d('0x1e')](function(_0x2ad145){return _0x2ad145;});})['then'](function(_0x504770){if(_0x504770){_0x428415[_0x6b7d('0x27')][_0x6b7d('0x70')]=_0x504770[0x0];if(!_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x60')])return;return db['User'][_0x6b7d('0x53')]({'where':{'id':_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x60')],'role':_0x6b7d('0x62')},'attributes':['id','name',_0x6b7d('0x71'),_0x6b7d('0x72'),'internal'],'raw':!![]});}return null;})[_0x6b7d('0x1e')](function(_0xfb19b4){if(!_0xfb19b4)return null;_0x428415[_0x6b7d('0x27')][_0x6b7d('0x62')]=_0xfb19b4;return _0x428415;})['then'](function(_0x12c1d1){if(_0x12c1d1){if(_0x2d02c6[_0x6b7d('0x55')][_0x6b7d('0x73')]){_0x428415['message'][_0x6b7d('0x74')]=util[_0x6b7d('0x5e')]('SIP/%s',_0x2d02c6[_0x6b7d('0x61')][_0x6b7d('0x38')]);_0x428415['message'][_0x6b7d('0x75')]=_0x428415[_0x6b7d('0x75')];_0x428415['message'][_0x6b7d('0x76')]=_0x428415[_0x6b7d('0x75')];_0x428415[_0x6b7d('0x27')][_0x6b7d('0x77')]=_0x6b7d('0x5a');return respondWithRpcPromise(_0x6b7d('0x78'),_0x6b7d('0x78'),{'event':_0x6b7d('0x79'),'message':_0x428415[_0x6b7d('0x27')]},client9002)[_0x6b7d('0x1e')](function(){return _0x428415;});}return _0x428415;}return null;})[_0x6b7d('0x1e')](respondWithResult(_0x44848a,null))[_0x6b7d('0x4e')](handleError(_0x44848a,null));};var interaction_log=require(_0x6b7d('0x58'))(_0x6b7d('0x59'));exports[_0x6b7d('0x34')]=function(_0x316cfa,_0x4c214e,_0x20ad62){var _0x2a8adc={'agent':{},'channel':'sms'};if(_0x316cfa['body']['id']){delete _0x316cfa['body']['id'];}_0x316cfa[_0x6b7d('0x55')][_0x6b7d('0x60')]=_0x316cfa['body'][_0x6b7d('0x60')]||_0x316cfa[_0x6b7d('0x61')]['id'];_0x2a8adc[_0x6b7d('0x62')]['id']=_0x316cfa['body'][_0x6b7d('0x60')];return db[_0x6b7d('0x3b')][_0x6b7d('0x53')]({'where':{'id':_0x316cfa[_0x6b7d('0x56')]['id'],'UserId':null}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x4c214e,null))[_0x6b7d('0x1e')](function(_0x519ce3){if(_0x519ce3){_0x2a8adc['message']=_0x519ce3[_0x6b7d('0x63')]({'plain':!![]});return db[_0x6b7d('0x64')][_0x6b7d('0x53')]({'where':{'id':_0x519ce3[_0x6b7d('0x65')]}});}return null;})[_0x6b7d('0x1e')](handleEntityNotFound(_0x4c214e,null))['then'](function(_0x7e1962){if(_0x7e1962){_0x2a8adc[_0x6b7d('0x67')]=_0x7e1962[_0x6b7d('0x63')]({'plain':!![]});interaction_log['info'](_0x6b7d('0x7a'),_0x316cfa['user']['id'],_0x316cfa['user']['name'],_0x316cfa['user']['role'],_0x2a8adc[_0x6b7d('0x67')]['id'],_0x316cfa[_0x6b7d('0x55')]?JSON[_0x6b7d('0x24')](_0x316cfa['body']):_0x6b7d('0x68'));return respondWithRpcPromise(_0x6b7d('0x7b'),_0x6b7d('0x7c'),_0x2a8adc);}return null;})['then'](function(_0x48bf48){var _0x2223b5=_0x6b7d('0x6b')+_0x48bf48[_0x6b7d('0x27')]['ContactId'];return db['sequelize'][_0x6b7d('0x3e')](_0x2223b5,{'type':db[_0x6b7d('0x6d')][_0x6b7d('0x6e')]['SELECT'],'raw':!![]})[_0x6b7d('0x1e')](function(_0x1ed699){return _0x1ed699;});})[_0x6b7d('0x1e')](function(_0x3f1c2d){if(_0x3f1c2d){_0x2a8adc[_0x6b7d('0x27')][_0x6b7d('0x70')]=_0x3f1c2d[0x0];if(!_0x316cfa['body'][_0x6b7d('0x60')])return;return db[_0x6b7d('0x7d')]['find']({'where':{'id':_0x316cfa[_0x6b7d('0x55')][_0x6b7d('0x60')],'role':'agent'},'attributes':['id','name','fullname','email',_0x6b7d('0x7e')],'raw':!![]});}return null;})[_0x6b7d('0x1e')](function(_0x14ea7a){if(!_0x14ea7a)return null;_0x2a8adc[_0x6b7d('0x27')]['agent']=_0x14ea7a;return _0x2a8adc;})[_0x6b7d('0x1e')](function(_0xafe087){if(_0xafe087){_0xafe087[_0x6b7d('0x27')][_0x6b7d('0x74')]=util[_0x6b7d('0x5e')]('SIP/%s',_0x316cfa[_0x6b7d('0x61')]['name']);_0xafe087[_0x6b7d('0x27')][_0x6b7d('0x75')]=_0x2a8adc['channel'];_0xafe087[_0x6b7d('0x27')][_0x6b7d('0x76')]=_0x2a8adc[_0x6b7d('0x75')];_0xafe087['message']['event']=_0x6b7d('0x34');respondWithRpcPromise(_0x6b7d('0x78'),_0x6b7d('0x78'),{'event':'rejectmessage','message':_0xafe087[_0x6b7d('0x27')]},client9002);return _0x2a8adc;}return null;})[_0x6b7d('0x1e')](respondWithResult(_0x4c214e,null))['catch'](handleError(_0x4c214e,null));};exports['status']=function(_0x276cc7,_0x4ac14c,_0x5e9220){if(_0x276cc7[_0x6b7d('0x55')]['id']){delete _0x276cc7[_0x6b7d('0x55')]['id'];}var _0x3fef4c;return db['SmsMessage'][_0x6b7d('0x53')]({'where':{'id':_0x276cc7[_0x6b7d('0x56')]['id']}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x4ac14c,null))['then'](function(_0x11e1f3){if(_0x11e1f3){_0x3fef4c=_0x11e1f3;return db['SmsAccount'][_0x6b7d('0x53')]({'where':{'id':_0x11e1f3['SmsAccountId']}});}})[_0x6b7d('0x1e')](handleEntityNotFound(_0x4ac14c,null))[_0x6b7d('0x1e')](function(_0x51f809){if(_0x51f809){logger[_0x6b7d('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x6b7d('0x7f'),_0x51f809[_0x6b7d('0x49')],util[_0x6b7d('0x80')](_0x276cc7[_0x6b7d('0x55')],{'showHidden':![],'depth':null}));switch(_0x51f809[_0x6b7d('0x49')]){case _0x6b7d('0x81'):if(_0x276cc7[_0x6b7d('0x55')]['MessageSid']&&_0x276cc7[_0x6b7d('0x55')][_0x6b7d('0x82')]===_0x3fef4c[_0x6b7d('0x83')]){return _0x3fef4c['update']({'read':!![]});}else{logger['error'](_0x6b7d('0x84'),_0x6b7d('0x2a'),'twilio',util[_0x6b7d('0x80')](_0x276cc7[_0x6b7d('0x55')],{'showHidden':![],'depth':null}));}break;case _0x6b7d('0x85'):if(_0x276cc7[_0x6b7d('0x55')][_0x6b7d('0x86')]&&_0x276cc7[_0x6b7d('0x55')]['MessageUUID']===_0x3fef4c[_0x6b7d('0x83')]&&_[_0x6b7d('0x87')](['sent','delivered'],_0x276cc7[_0x6b7d('0x55')]['Status'])>=0x0){return _0x3fef4c[_0x6b7d('0x35')]({'read':!![]});}else{logger[_0x6b7d('0x25')](_0x6b7d('0x84'),_0x6b7d('0x2a'),_0x6b7d('0x88'),util[_0x6b7d('0x80')](_0x276cc7[_0x6b7d('0x55')],{'showHidden':![],'depth':null}));}break;case _0x6b7d('0x89'):var _0x411876=_0x276cc7[_0x6b7d('0x55')][_0x6b7d('0x8a')][0x0];if(_0x411876[_0x6b7d('0x2a')][_0x6b7d('0x8b')]===_0x6b7d('0x8c')){return _0x3fef4c[_0x6b7d('0x35')]({'read':!![]});}else{logger[_0x6b7d('0x25')](_0x6b7d('0x84'),_0x6b7d('0x2a'),_0x6b7d('0x89'),util[_0x6b7d('0x80')](_0x276cc7[_0x6b7d('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x3fef4c;}})['then'](respondWithResult(_0x4ac14c,null))[_0x6b7d('0x4e')](handleError(_0x4ac14c,null));}; \ No newline at end of file +var _0x0adf=['rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','messageId','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','find','create','body','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','SmsInteraction','update','UserId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','channel','motionChannel','EventManager','acceptmessage','sms-interactions','SmsInteractionId','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','email','internal','interface','SIP/%s'];(function(_0x581f8e,_0x5617cb){var _0x18aec=function(_0x4536c7){while(--_0x4536c7){_0x581f8e['push'](_0x581f8e['shift']());}};_0x18aec(++_0x5617cb);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x1163d0,_0x4680a){_0x1163d0=_0x1163d0-0x0;var _0x301bb3=_0x0adf[_0x1163d0];return _0x301bb3;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];config[_0xf0ad('0x1a')]=_[_0xf0ad('0x1b')](config['redis'],{'host':_0xf0ad('0x1c'),'port':0x18eb});var socket=require(_0xf0ad('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);var jayson=require(_0xf0ad('0x1e'));var client=jayson['client'][_0xf0ad('0x1f')]({'port':0x232c});var client9002=jayson[_0xf0ad('0x20')][_0xf0ad('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xfa829e,_0x237dd9,_0x5c23ff,_0x1ad9e0){return new BPromise(function(_0x285ab0,_0x1b00f1){var _0x1c9fac=_0x1ad9e0||client;return _0x1c9fac['request'](_0xfa829e,_0x5c23ff)['then'](function(_0x2466e8){logger[_0xf0ad('0x21')]('SmsMessage,\x20%s,\x20%s',_0x237dd9,_0xf0ad('0x22'));logger[_0xf0ad('0x23')](_0xf0ad('0x24'),_0x237dd9,_0xf0ad('0x22'),JSON['stringify'](_0x2466e8));if(_0x2466e8['error']){if(_0x2466e8[_0xf0ad('0x25')][_0xf0ad('0x26')]===0x1f4){logger[_0xf0ad('0x25')](_0xf0ad('0x27'),_0x237dd9,_0x2466e8[_0xf0ad('0x25')][_0xf0ad('0x28')]);return _0x1b00f1(_0x2466e8['error'][_0xf0ad('0x28')]);}logger[_0xf0ad('0x25')](_0xf0ad('0x27'),_0x237dd9,_0x2466e8[_0xf0ad('0x25')][_0xf0ad('0x28')]);return _0x285ab0(_0x2466e8[_0xf0ad('0x25')][_0xf0ad('0x28')]);}else{logger[_0xf0ad('0x21')](_0xf0ad('0x27'),_0x237dd9,_0xf0ad('0x22'));_0x285ab0(_0x2466e8[_0xf0ad('0x29')][_0xf0ad('0x28')]);}})[_0xf0ad('0x2a')](function(_0x456f81){logger[_0xf0ad('0x25')]('SmsMessage,\x20%s,\x20%s',_0x237dd9,_0x456f81);_0x1b00f1(_0x456f81);});});}function respondWithStatusCode(_0x234bc7,_0x1507a3){_0x1507a3=_0x1507a3||0xcc;return function(_0x248794){if(_0x248794){return _0x234bc7[_0xf0ad('0x2b')](_0x1507a3);}return _0x234bc7[_0xf0ad('0x2c')](_0x1507a3)[_0xf0ad('0x2d')]();};}function respondWithResult(_0x560417,_0x2cbe00){_0x2cbe00=_0x2cbe00||0xc8;return function(_0x19a32a){if(_0x19a32a){return _0x560417[_0xf0ad('0x2c')](_0x2cbe00)[_0xf0ad('0x2e')](_0x19a32a);}};}function respondWithFilteredResult(_0x1b6880,_0x1ac25c){return function(_0x267b7a){if(_0x267b7a){var _0x1bee71=typeof _0x1ac25c[_0xf0ad('0x2f')]===_0xf0ad('0x30')&&typeof _0x1ac25c[_0xf0ad('0x31')]==='undefined';var _0x1a1e1c=_0x267b7a['count'];var _0x83f211=_0x1bee71?0x0:_0x1ac25c['offset'];var _0x25ed0b=_0x1bee71?_0x267b7a[_0xf0ad('0x32')]:_0x1ac25c[_0xf0ad('0x2f')]+_0x1ac25c[_0xf0ad('0x31')];var _0x4103b5;if(_0x25ed0b>=_0x1a1e1c){_0x25ed0b=_0x1a1e1c;_0x4103b5=0xc8;}else{_0x4103b5=0xce;}_0x1b6880[_0xf0ad('0x2c')](_0x4103b5);return _0x1b6880[_0xf0ad('0x33')](_0xf0ad('0x34'),_0x83f211+'-'+_0x25ed0b+'/'+_0x1a1e1c)['json'](_0x267b7a);}return null;};}function patchUpdates(_0x4fd680){return function(_0x22ecf3){try{jsonpatch[_0xf0ad('0x35')](_0x22ecf3,_0x4fd680,!![]);}catch(_0xd608bf){return BPromise[_0xf0ad('0x36')](_0xd608bf);}return _0x22ecf3['save']();};}function saveUpdates(_0x42e81e,_0x49ba94){return function(_0x12ac45){if(_0x12ac45){return _0x12ac45['update'](_0x42e81e)[_0xf0ad('0x37')](function(_0x4846b1){return _0x4846b1;});}return null;};}function removeEntity(_0x3d9e48,_0x11718e){return function(_0x3ad7e4){if(_0x3ad7e4){return _0x3ad7e4[_0xf0ad('0x38')]()[_0xf0ad('0x37')](function(){_0x3d9e48[_0xf0ad('0x2c')](0xcc)[_0xf0ad('0x2d')]();});}};}function handleEntityNotFound(_0x35a941,_0x4fba1e){return function(_0xa75b9d){if(!_0xa75b9d){_0x35a941['sendStatus'](0x194);}return _0xa75b9d;};}function handleError(_0x26ec3d,_0x506a56){_0x506a56=_0x506a56||0x1f4;return function(_0x3f7e2b){logger[_0xf0ad('0x25')](_0x3f7e2b[_0xf0ad('0x39')]);if(_0x3f7e2b[_0xf0ad('0x3a')]){delete _0x3f7e2b[_0xf0ad('0x3a')];}_0x26ec3d['status'](_0x506a56)[_0xf0ad('0x3b')](_0x3f7e2b);};}exports[_0xf0ad('0x3c')]=function(_0x1d57d1,_0x313c15){var _0x18dd8e={},_0x18558f={},_0x3553b0={'count':0x0,'rows':[]};var _0x50a62b=_[_0xf0ad('0x3d')](db[_0xf0ad('0x3e')][_0xf0ad('0x3f')],function(_0x189f67){return{'name':_0x189f67[_0xf0ad('0x40')],'type':_0x189f67[_0xf0ad('0x41')][_0xf0ad('0x42')]};});_0x18558f[_0xf0ad('0x43')]=_[_0xf0ad('0x3d')](_0x50a62b,'name');_0x18558f[_0xf0ad('0x44')]=_[_0xf0ad('0x45')](_0x1d57d1[_0xf0ad('0x44')]);_0x18558f['filters']=_['intersection'](_0x18558f['model'],_0x18558f[_0xf0ad('0x44')]);_0x18dd8e[_0xf0ad('0x46')]=_[_0xf0ad('0x47')](_0x18558f[_0xf0ad('0x43')],qs[_0xf0ad('0x48')](_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x48')]));_0x18dd8e[_0xf0ad('0x46')]=_0x18dd8e[_0xf0ad('0x46')][_0xf0ad('0x49')]?_0x18dd8e[_0xf0ad('0x46')]:_0x18558f['model'];if(!_0x1d57d1['query']['hasOwnProperty'](_0xf0ad('0x4a'))){_0x18dd8e[_0xf0ad('0x31')]=qs['limit'](_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x31')]);_0x18dd8e['offset']=qs[_0xf0ad('0x2f')](_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x2f')]);}_0x18dd8e[_0xf0ad('0x4b')]=qs['sort'](_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x4c')]);_0x18dd8e[_0xf0ad('0x4d')]=qs[_0xf0ad('0x4e')](_[_0xf0ad('0x4f')](_0x1d57d1[_0xf0ad('0x44')],_0x18558f[_0xf0ad('0x4e')]),_0x50a62b);if(_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x50')]){_0x18dd8e[_0xf0ad('0x4d')]=_[_0xf0ad('0x51')](_0x18dd8e['where'],{'$or':_[_0xf0ad('0x3d')](_0x50a62b,function(_0x32d697){if(_0x32d697[_0xf0ad('0x41')]!=='VIRTUAL'){var _0x553a70={};_0x553a70[_0x32d697[_0xf0ad('0x3a')]]={'$like':'%'+_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x50')]+'%'};return _0x553a70;}})});}_0x18dd8e=_[_0xf0ad('0x51')]({},_0x18dd8e,_0x1d57d1[_0xf0ad('0x52')]);var _0x3b251b={'where':_0x18dd8e[_0xf0ad('0x4d')]};return db['SmsMessage'][_0xf0ad('0x32')](_0x3b251b)['then'](function(_0x2843a2){_0x3553b0[_0xf0ad('0x32')]=_0x2843a2;if(_0x1d57d1[_0xf0ad('0x44')][_0xf0ad('0x53')]){_0x18dd8e[_0xf0ad('0x54')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x18dd8e);})[_0xf0ad('0x37')](function(_0x3b366b){_0x3553b0[_0xf0ad('0x55')]=_0x3b366b;return _0x3553b0;})[_0xf0ad('0x37')](respondWithFilteredResult(_0x313c15,_0x18dd8e))[_0xf0ad('0x2a')](handleError(_0x313c15,null));};exports[_0xf0ad('0x56')]=function(_0x4733e0,_0x4b2df4){var _0x3c7347={'raw':!![],'where':{'id':_0x4733e0[_0xf0ad('0x57')]['id']}},_0x347627={};_0x347627[_0xf0ad('0x43')]=_[_0xf0ad('0x45')](db['SmsMessage'][_0xf0ad('0x3f')]);_0x347627[_0xf0ad('0x44')]=_[_0xf0ad('0x45')](_0x4733e0[_0xf0ad('0x44')]);_0x347627[_0xf0ad('0x4e')]=_[_0xf0ad('0x47')](_0x347627[_0xf0ad('0x43')],_0x347627['query']);_0x3c7347[_0xf0ad('0x46')]=_[_0xf0ad('0x47')](_0x347627[_0xf0ad('0x43')],qs['fields'](_0x4733e0[_0xf0ad('0x44')][_0xf0ad('0x48')]));_0x3c7347[_0xf0ad('0x46')]=_0x3c7347[_0xf0ad('0x46')][_0xf0ad('0x49')]?_0x3c7347[_0xf0ad('0x46')]:_0x347627[_0xf0ad('0x43')];if(_0x4733e0[_0xf0ad('0x44')][_0xf0ad('0x53')]){_0x3c7347[_0xf0ad('0x54')]=[{'all':!![]}];}_0x3c7347=_[_0xf0ad('0x51')]({},_0x3c7347,_0x4733e0['options']);return db['SmsMessage'][_0xf0ad('0x58')](_0x3c7347)[_0xf0ad('0x37')](handleEntityNotFound(_0x4b2df4,null))['then'](respondWithResult(_0x4b2df4,null))[_0xf0ad('0x2a')](handleError(_0x4b2df4,null));};exports[_0xf0ad('0x59')]=function(_0x57a83b,_0x4eb299){return db[_0xf0ad('0x3e')]['create'](_0x57a83b['body'],{})['then'](respondWithResult(_0x4eb299,0xc9))[_0xf0ad('0x2a')](handleError(_0x4eb299,null));};exports['update']=function(_0x56c8aa,_0x16f29d){if(_0x56c8aa[_0xf0ad('0x5a')]['id']){delete _0x56c8aa[_0xf0ad('0x5a')]['id'];}return db[_0xf0ad('0x3e')][_0xf0ad('0x58')]({'where':{'id':_0x56c8aa[_0xf0ad('0x57')]['id']}})[_0xf0ad('0x37')](handleEntityNotFound(_0x16f29d,null))['then'](saveUpdates(_0x56c8aa[_0xf0ad('0x5a')],null))['then'](respondWithResult(_0x16f29d,null))['catch'](handleError(_0x16f29d,null));};exports['destroy']=function(_0x5f05c7,_0x3a8ea9){return db[_0xf0ad('0x3e')][_0xf0ad('0x58')]({'where':{'id':_0x5f05c7[_0xf0ad('0x57')]['id']}})[_0xf0ad('0x37')](handleEntityNotFound(_0x3a8ea9,null))[_0xf0ad('0x37')](removeEntity(_0x3a8ea9,null))[_0xf0ad('0x2a')](handleError(_0x3a8ea9,null));};exports[_0xf0ad('0x5b')]=function(_0x1e9642,_0x12dbc2){return db[_0xf0ad('0x3e')]['describe']()['then'](respondWithResult(_0x12dbc2,null))[_0xf0ad('0x2a')](handleError(_0x12dbc2,null));};var interaction_log=require(_0xf0ad('0x16'))('sms-interactions');exports[_0xf0ad('0x5c')]=function(_0x17d24c,_0x550068,_0xecfee9){var _0x1d1b4e={'agent':{},'channel':_0xf0ad('0x5d')};if(_0x17d24c['body']['id']){delete _0x17d24c[_0xf0ad('0x5a')]['id'];}_0x17d24c[_0xf0ad('0x5a')][_0xf0ad('0x5e')]=!![];_0x17d24c[_0xf0ad('0x5a')][_0xf0ad('0x5f')]=moment()[_0xf0ad('0x60')](_0xf0ad('0x61'));_0x17d24c[_0xf0ad('0x5a')]['UserId']=_0x17d24c[_0xf0ad('0x5a')]['UserId']||_0x17d24c[_0xf0ad('0x62')]['id'];_0x1d1b4e[_0xf0ad('0x63')]['id']=_0x17d24c[_0xf0ad('0x5a')]['UserId'];return db[_0xf0ad('0x3e')]['find']({'where':{'id':_0x17d24c[_0xf0ad('0x57')]['id'],'UserId':null}})[_0xf0ad('0x37')](handleEntityNotFound(_0x550068,null))[_0xf0ad('0x37')](saveUpdates(_0x17d24c[_0xf0ad('0x5a')],null))[_0xf0ad('0x37')](function(_0x44ec03){if(_0x44ec03){_0x1d1b4e[_0xf0ad('0x28')]=_0x44ec03['get']({'plain':!![]});return db[_0xf0ad('0x64')][_0xf0ad('0x58')]({'where':{'id':_0x44ec03['SmsInteractionId']}});}return null;})[_0xf0ad('0x37')](handleEntityNotFound(_0x550068,null))[_0xf0ad('0x37')](function(_0x26bacf){if(_0x26bacf){return _0x26bacf[_0xf0ad('0x65')]({'UserId':_0x17d24c[_0xf0ad('0x5a')][_0xf0ad('0x66')],'read1stAt':_[_0xf0ad('0x67')](_0x26bacf[_0xf0ad('0x68')])?moment()[_0xf0ad('0x60')](_0xf0ad('0x61')):undefined});}return null;})[_0xf0ad('0x37')](function(_0x391eea){if(_0x391eea){_0x1d1b4e[_0xf0ad('0x69')]=_0x391eea['get']({'plain':!![]});interaction_log[_0xf0ad('0x21')](_0xf0ad('0x6a'),_0x17d24c[_0xf0ad('0x62')]['id'],_0x17d24c[_0xf0ad('0x62')]['name'],_0x17d24c[_0xf0ad('0x62')][_0xf0ad('0x6b')],_0x1d1b4e[_0xf0ad('0x69')]['id'],_0x17d24c['body']?JSON[_0xf0ad('0x6c')](_0x17d24c['body']):_0xf0ad('0x6d'));return respondWithRpcPromise(_0xf0ad('0x6e'),_0xf0ad('0x6f'),_0x1d1b4e);}return null;})[_0xf0ad('0x37')](function(_0x5a0f61){var _0x4302ef='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a0f61['message'][_0xf0ad('0x70')];return db[_0xf0ad('0x71')][_0xf0ad('0x44')](_0x4302ef,{'type':db[_0xf0ad('0x72')][_0xf0ad('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x1937ba){return _0x1937ba;});})[_0xf0ad('0x37')](function(_0xba7a26){if(_0xba7a26){_0x1d1b4e[_0xf0ad('0x28')][_0xf0ad('0x74')]=_0xba7a26[0x0];if(!_0x17d24c[_0xf0ad('0x5a')][_0xf0ad('0x66')])return;return db['User'][_0xf0ad('0x58')]({'where':{'id':_0x17d24c[_0xf0ad('0x5a')][_0xf0ad('0x66')],'role':_0xf0ad('0x63')},'attributes':['id',_0xf0ad('0x3a'),_0xf0ad('0x75'),'email','internal'],'raw':!![]});}return null;})[_0xf0ad('0x37')](function(_0x2bb959){if(!_0x2bb959)return null;_0x1d1b4e[_0xf0ad('0x28')][_0xf0ad('0x63')]=_0x2bb959;return _0x1d1b4e;})['then'](function(_0x2abb9c){if(_0x2abb9c){if(_0x17d24c['body']['manual']){_0x1d1b4e[_0xf0ad('0x28')]['interface']=util[_0xf0ad('0x60')]('SIP/%s',_0x17d24c['user'][_0xf0ad('0x3a')]);_0x1d1b4e[_0xf0ad('0x28')][_0xf0ad('0x76')]=_0x1d1b4e[_0xf0ad('0x76')];_0x1d1b4e['message'][_0xf0ad('0x77')]=_0x1d1b4e[_0xf0ad('0x76')];_0x1d1b4e[_0xf0ad('0x28')]['event']='accept';return respondWithRpcPromise('EventManager',_0xf0ad('0x78'),{'event':_0xf0ad('0x79'),'message':_0x1d1b4e['message']},client9002)[_0xf0ad('0x37')](function(){return _0x1d1b4e;});}return _0x1d1b4e;}return null;})[_0xf0ad('0x37')](respondWithResult(_0x550068,null))[_0xf0ad('0x2a')](handleError(_0x550068,null));};var interaction_log=require(_0xf0ad('0x16'))(_0xf0ad('0x7a'));exports[_0xf0ad('0x36')]=function(_0x3bccb8,_0x30664a,_0x3bd86a){var _0x56bda2={'agent':{},'channel':_0xf0ad('0x5d')};if(_0x3bccb8[_0xf0ad('0x5a')]['id']){delete _0x3bccb8['body']['id'];}_0x3bccb8[_0xf0ad('0x5a')][_0xf0ad('0x66')]=_0x3bccb8[_0xf0ad('0x5a')][_0xf0ad('0x66')]||_0x3bccb8[_0xf0ad('0x62')]['id'];_0x56bda2[_0xf0ad('0x63')]['id']=_0x3bccb8[_0xf0ad('0x5a')][_0xf0ad('0x66')];return db[_0xf0ad('0x3e')][_0xf0ad('0x58')]({'where':{'id':_0x3bccb8['params']['id'],'UserId':null}})[_0xf0ad('0x37')](handleEntityNotFound(_0x30664a,null))[_0xf0ad('0x37')](function(_0x3c97fe){if(_0x3c97fe){_0x56bda2[_0xf0ad('0x28')]=_0x3c97fe['get']({'plain':!![]});return db[_0xf0ad('0x64')][_0xf0ad('0x58')]({'where':{'id':_0x3c97fe[_0xf0ad('0x7b')]}});}return null;})[_0xf0ad('0x37')](handleEntityNotFound(_0x30664a,null))[_0xf0ad('0x37')](function(_0x1b4a7c){if(_0x1b4a7c){_0x56bda2[_0xf0ad('0x69')]=_0x1b4a7c[_0xf0ad('0x7c')]({'plain':!![]});interaction_log[_0xf0ad('0x21')](_0xf0ad('0x7d'),_0x3bccb8['user']['id'],_0x3bccb8[_0xf0ad('0x62')][_0xf0ad('0x3a')],_0x3bccb8['user'][_0xf0ad('0x6b')],_0x56bda2[_0xf0ad('0x69')]['id'],_0x3bccb8['body']?JSON[_0xf0ad('0x6c')](_0x3bccb8[_0xf0ad('0x5a')]):_0xf0ad('0x6d'));return respondWithRpcPromise(_0xf0ad('0x7e'),_0xf0ad('0x7f'),_0x56bda2);}return null;})[_0xf0ad('0x37')](function(_0xf547de){var _0x23d572='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf547de[_0xf0ad('0x28')][_0xf0ad('0x70')];return db['sequelize'][_0xf0ad('0x44')](_0x23d572,{'type':db[_0xf0ad('0x72')][_0xf0ad('0x73')][_0xf0ad('0x80')],'raw':!![]})[_0xf0ad('0x37')](function(_0x3c7ade){return _0x3c7ade;});})[_0xf0ad('0x37')](function(_0x57205f){if(_0x57205f){_0x56bda2[_0xf0ad('0x28')][_0xf0ad('0x74')]=_0x57205f[0x0];if(!_0x3bccb8['body'][_0xf0ad('0x66')])return;return db[_0xf0ad('0x81')][_0xf0ad('0x58')]({'where':{'id':_0x3bccb8[_0xf0ad('0x5a')][_0xf0ad('0x66')],'role':_0xf0ad('0x63')},'attributes':['id','name',_0xf0ad('0x75'),_0xf0ad('0x82'),_0xf0ad('0x83')],'raw':!![]});}return null;})[_0xf0ad('0x37')](function(_0x4a85f1){if(!_0x4a85f1)return null;_0x56bda2[_0xf0ad('0x28')][_0xf0ad('0x63')]=_0x4a85f1;return _0x56bda2;})[_0xf0ad('0x37')](function(_0x1100c5){if(_0x1100c5){_0x1100c5[_0xf0ad('0x28')][_0xf0ad('0x84')]=util[_0xf0ad('0x60')](_0xf0ad('0x85'),_0x3bccb8[_0xf0ad('0x62')][_0xf0ad('0x3a')]);_0x1100c5[_0xf0ad('0x28')][_0xf0ad('0x76')]=_0x56bda2[_0xf0ad('0x76')];_0x1100c5[_0xf0ad('0x28')][_0xf0ad('0x77')]=_0x56bda2[_0xf0ad('0x76')];_0x1100c5[_0xf0ad('0x28')]['event']=_0xf0ad('0x36');respondWithRpcPromise(_0xf0ad('0x78'),_0xf0ad('0x78'),{'event':_0xf0ad('0x86'),'message':_0x1100c5[_0xf0ad('0x28')]},client9002);return _0x56bda2;}return null;})[_0xf0ad('0x37')](respondWithResult(_0x30664a,null))[_0xf0ad('0x2a')](handleError(_0x30664a,null));};exports['status']=function(_0x5e9de4,_0x4171c4,_0x3c6317){if(_0x5e9de4[_0xf0ad('0x5a')]['id']){delete _0x5e9de4['body']['id'];}var _0x44fe53;return db['SmsMessage']['find']({'where':{'id':_0x5e9de4['params']['id']}})[_0xf0ad('0x37')](handleEntityNotFound(_0x4171c4,null))[_0xf0ad('0x37')](function(_0x4e3827){if(_0x4e3827){_0x44fe53=_0x4e3827;return db[_0xf0ad('0x87')][_0xf0ad('0x58')]({'where':{'id':_0x4e3827[_0xf0ad('0x88')]}});}})[_0xf0ad('0x37')](handleEntityNotFound(_0x4171c4,null))['then'](function(_0xf47860){if(_0xf47860){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0ad('0x2c'),_0xf0ad('0x89'),_0xf47860[_0xf0ad('0x41')],util[_0xf0ad('0x8a')](_0x5e9de4['body'],{'showHidden':![],'depth':null}));switch(_0xf47860['type']){case _0xf0ad('0x8b'):if(_0x5e9de4['body'][_0xf0ad('0x8c')]&&_0x5e9de4['body'][_0xf0ad('0x8c')]===_0x44fe53['messageId']){return _0x44fe53[_0xf0ad('0x65')]({'read':!![]});}else{logger['error'](_0xf0ad('0x8d'),_0xf0ad('0x2c'),_0xf0ad('0x8b'),util[_0xf0ad('0x8a')](_0x5e9de4[_0xf0ad('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5e9de4[_0xf0ad('0x5a')][_0xf0ad('0x8e')]&&_0x5e9de4['body'][_0xf0ad('0x8e')]===_0x44fe53[_0xf0ad('0x8f')]&&_['indexOf']([_0xf0ad('0x90'),_0xf0ad('0x91')],_0x5e9de4[_0xf0ad('0x5a')][_0xf0ad('0x92')])>=0x0){return _0x44fe53['update']({'read':!![]});}else{logger[_0xf0ad('0x25')](_0xf0ad('0x8d'),_0xf0ad('0x2c'),'plivio',util[_0xf0ad('0x8a')](_0x5e9de4['body'],{'showHidden':![],'depth':null}));}break;case _0xf0ad('0x93'):var _0x30c677=_0x5e9de4[_0xf0ad('0x5a')]['results'][0x0];if(_0x30c677[_0xf0ad('0x2c')][_0xf0ad('0x94')]===_0xf0ad('0x95')){return _0x44fe53['update']({'read':!![]});}else{logger[_0xf0ad('0x25')](_0xf0ad('0x8d'),_0xf0ad('0x2c'),'infobip',util['inspect'](_0x5e9de4['body'],{'showHidden':![],'depth':null}));}break;}return _0x44fe53;}})[_0xf0ad('0x37')](respondWithResult(_0x4171c4,null))[_0xf0ad('0x2a')](handleError(_0x4171c4,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b7cbbf7..f366ccb 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 _0xfffb=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','update'];(function(_0x255769,_0x4e635b){var _0x2cf3ff=function(_0x5e02ff){while(--_0x5e02ff){_0x255769['push'](_0x255769['shift']());}};_0x2cf3ff(++_0x4e635b);}(_0xfffb,0x10c));var _0xbfff=function(_0x50fd59,_0x27e5a6){_0x50fd59=_0x50fd59-0x0;var _0xe63c6c=_0xfffb[_0x50fd59];return _0xe63c6c;};'use strict';var EventEmitter=require(_0xbfff('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xbfff('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbfff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfff('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2df7ac){return function(_0x453142,_0x5592ab,_0x198128){SmsMessageEvents[_0xbfff('0x4')](_0x2df7ac+':'+_0x453142['id'],_0x453142);SmsMessageEvents[_0xbfff('0x4')](_0x2df7ac,_0x453142);_0x198128(null);};}for(var e in events){if(events[_0xbfff('0x5')](e)){var event=events[e];SmsMessage[_0xbfff('0x6')](e,emitEvent(event));}}module[_0xbfff('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x9911=['events','../../mysqldb','SmsMessage','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9911,0xc6));var _0x1991=function(_0x110ac0,_0x47cba0){_0x110ac0=_0x110ac0-0x0;var _0x14b67a=_0x9911[_0x110ac0];return _0x14b67a;};'use strict';var EventEmitter=require(_0x1991('0x0'));var SmsMessage=require(_0x1991('0x1'))['db'][_0x1991('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1991('0x3'),'afterUpdate':_0x1991('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f7a54){return function(_0x15129e,_0x3a8eae,_0x594c03){SmsMessageEvents['emit'](_0x3f7a54+':'+_0x15129e['id'],_0x15129e);SmsMessageEvents[_0x1991('0x5')](_0x3f7a54,_0x15129e);_0x594c03(null);};}for(var e in events){if(events[_0x1991('0x6')](e)){var event=events[e];SmsMessage[_0x1991('0x7')](e,emitEvent(event));}}module[_0x1991('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 c96c409..c671bc1 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 _0x862f=['queued_count','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','read','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','length','md5','digest','hex','signature=','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','sms_messages','messageId','body','models','get','direction','toLowerCase','out','secret','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','password','smsMethod','sender','username','&password=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','senderString','POST','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data'];(function(_0x16395d,_0x3783e7){var _0xab6399=function(_0x2e373e){while(--_0x2e373e){_0x16395d['push'](_0x16395d['shift']());}};_0xab6399(++_0x3783e7);}(_0x862f,0xaa));var _0xf862=function(_0x3a4e14,_0x22e3a2){_0x3a4e14=_0x3a4e14-0x0;var _0x5769b0=_0x862f[_0x3a4e14];return _0x5769b0;};'use strict';var _=require(_0xf862('0x0'));var util=require(_0xf862('0x1'));var logger=require(_0xf862('0x2'))(_0xf862('0x3'));var moment=require(_0xf862('0x4'));var BPromise=require(_0xf862('0x5'));var rp=require(_0xf862('0x6'));var fs=require('fs');var path=require(_0xf862('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x677e8,_0x5d7039){return _0x677e8['define']('SmsMessage',attributes,{'tableName':_0xf862('0x8'),'paranoid':![],'indexes':[{'name':_0xf862('0x9'),'fields':[_0xf862('0x9')]},{'name':'fti_sms_messages','fields':[_0xf862('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5955bb,_0x763f63,_0x528c63){var _0x5d81cc=_0x677e8[_0xf862('0xb')];var _0x2975fd=_0x5955bb[_0xf862('0xc')]({'plain':!![]});if(_0x2975fd[_0xf862('0xd')]['toLowerCase']()==='in'||_0x2975fd[_0xf862('0xd')][_0xf862('0xe')]()===_0xf862('0xf')&&!_0x2975fd[_0xf862('0x10')]&&!_['isNil'](_0x2975fd[_0xf862('0x11')])&&!_['isNil'](_0x2975fd[_0xf862('0x12')])){_0x5d81cc[_0xf862('0x13')][_0xf862('0x14')]({'where':{'id':_0x2975fd[_0xf862('0x12')]}})[_0xf862('0x15')](function(_0x38122b){if(_0x38122b){_0x38122b[_0xf862('0x16')]({'lastMsgAt':_0x2975fd[_0xf862('0x17')],'lastMsgDirection':_0x2975fd['direction']['toLowerCase']()});}})[_0xf862('0x18')](function(_0x12e46b){console[_0xf862('0x19')](_0x12e46b);});}if(_0x2975fd[_0xf862('0xd')]==='out'&&!_0x2975fd[_0xf862('0x10')]){var _0x1867bb;_0x5d81cc[_0xf862('0x1a')][_0xf862('0x1b')]({'where':{'id':_0x2975fd[_0xf862('0x1c')]},'raw':!![]})[_0xf862('0x15')](function(_0x58ec73){_0x1867bb=_0x58ec73;if(_0x1867bb&&_0x1867bb[_0xf862('0x1d')]){switch(_0x1867bb[_0xf862('0x1d')]){case'twilio':var _0x242147=require(_0xf862('0x1e'));if(_0x1867bb[_0xf862('0x1f')]&&_0x1867bb[_0xf862('0x20')]&&_0x1867bb[_0xf862('0x21')]){var _0x3cd214=new _0x242147(_0x1867bb[_0xf862('0x1f')],_0x1867bb[_0xf862('0x20')]);_0x3cd214['messages'][_0xf862('0x22')]({'body':_0x2975fd[_0xf862('0xa')],'to':_0x2975fd[_0xf862('0x21')],'from':_0x1867bb[_0xf862('0x21')],'statusCallback':_0x1867bb[_0xf862('0x23')]+'/api/sms/messages/'+_0x2975fd['id']+_0xf862('0x24')+_0x1867bb[_0xf862('0x25')]})['then'](function(_0x179564){if(_0x179564['sid']){return _0x5955bb[_0xf862('0x16')]({'messageId':_0x179564[_0xf862('0x26')]});}})['catch'](function(_0x150d1a){logger[_0xf862('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf862('0x27'),_0xf862('0x1e'),util[_0xf862('0x28')](_0x150d1a,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf862('0x2a'):var _0x4e1150='https://api.skebby.it/API/v1.0/REST/';if(_0x1867bb['username']&&_0x1867bb[_0xf862('0x2b')]){var _0x19ac63={'recipient':[_0x2975fd['phone']],'message':_0x2975fd[_0xf862('0xa')],'message_type':_0x1867bb[_0xf862('0x2c')]};if(_0x1867bb[_0xf862('0x2c')]&&_0x1867bb[_0xf862('0x2c')]!=='SI'){_0x19ac63[_0xf862('0x2d')]=_0x1867bb[_0xf862('0x21')];}var _0x38b90e={'url':_0x4e1150+'login?username='+_0x1867bb[_0xf862('0x2e')]+_0xf862('0x2f')+_0x1867bb[_0xf862('0x2b')],'method':_0xf862('0x30')};rp(_0x38b90e)[_0xf862('0x15')](function(_0x37b7e5){var _0x21c1a8=_0x37b7e5[_0xf862('0x31')](';');var _0x305c20={'user_key':_0x21c1a8[0x0],'session_key':_0x21c1a8[0x1]};_0x38b90e={'url':_0x4e1150+_0xf862('0x32'),'method':'POST','headers':{'user_key':_0x305c20[_0xf862('0x33')],'Session_key':_0x305c20[_0xf862('0x34')]},'json':!![],'body':_0x19ac63};return rp(_0x38b90e);})[_0xf862('0x15')](function(_0x4670bc){if(_0x4670bc[_0xf862('0x35')]>=0x1){var _0x18cd00={'messageId':_0x4670bc[_0xf862('0x36')]};if(_0x1867bb[_0xf862('0x2c')]!=='GP'||!_0x1867bb[_0xf862('0x37')]){_0x18cd00['read']=!![];}return _0x5955bb['update'](_0x18cd00);}else{return logger['error'](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x2a'),util[_0xf862('0x28')](_0x4670bc,{'showHidden':![],'depth':null}));}})[_0xf862('0x18')](function(_0x1506aa){return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x2a'),util[_0xf862('0x28')](_0x1506aa,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x1867bb[_0xf862('0x20')]){var _0x1c87d7={'recipient':_0x2975fd[_0xf862('0x21')],'message':_0x2975fd[_0xf862('0xa')],'sender':_0x1867bb[_0xf862('0x38')]||_0x1867bb['phone'],'authorization':_0x1867bb[_0xf862('0x20')]};var _0x763f63={'method':_0xf862('0x39'),'uri':_0xf862('0x3a'),'body':_0x1c87d7,'json':!![]};rp(_0x763f63)[_0xf862('0x15')](function(_0x52c96a){var _0x274c58={'messageId':_0x52c96a['requestid']};if(!_0x1867bb[_0xf862('0x37')]){_0x274c58['read']=!![];}return _0x5955bb['update'](_0x274c58);})[_0xf862('0x18')](function(_0x21136f){logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'connectel',util[_0xf862('0x28')](_0x21136f,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'connectel',_0xf862('0x3b'));}break;case _0xf862('0x3c'):if(_0x1867bb[_0xf862('0x2e')]&&_0x1867bb[_0xf862('0x2b')]){var _0x1c87d7={'messages':[{'source':'xCALLY\x20Motion','to':_0x2975fd[_0xf862('0x21')],'body':_0x2975fd[_0xf862('0xa')],'from':_0x1867bb[_0xf862('0x38')]||_0x1867bb[_0xf862('0x21')]}]};var _0x3151b2=util['format'](_0xf862('0x3d'),_0x1867bb[_0xf862('0x2e')],_0x1867bb[_0xf862('0x2b')]);var _0x763f63={'method':_0xf862('0x39'),'uri':_0xf862('0x3e'),'body':_0x1c87d7,'headers':{'Authorization':util[_0xf862('0x3f')](_0xf862('0x40'),new Buffer(_0x3151b2)['toString'](_0xf862('0x41')))},'json':!![]};rp(_0x763f63)['then'](function(_0x4818dc){if(_0x4818dc['http_code']>=0xc8&&_0x4818dc[_0xf862('0x42')]<=0xce){if(_0x4818dc[_0xf862('0x43')]&&_0x4818dc[_0xf862('0x43')][_0xf862('0x44')]>0x0){var _0x119492=_[_0xf862('0x45')](_0x4818dc[_0xf862('0x43')][_0xf862('0x46')]);var _0xebabc8={'messageId':_0x119492[_0xf862('0x47')]};if(!_0x1867bb[_0xf862('0x37')]){_0xebabc8['read']=!![];}return _0x5955bb[_0xf862('0x16')](_0xebabc8);}else{logger['error'](_0xf862('0x29'),'afterCreate',_0xf862('0x48'),util[_0xf862('0x28')](_0x4818dc,{'showHidden':![],'depth':null}));}}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x48'),util[_0xf862('0x28')](_0x4818dc,{'showHidden':![],'depth':null}));}})[_0xf862('0x18')](function(_0x8a40c8){logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'clickSend',util[_0xf862('0x28')](_0x8a40c8,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x48'),_0xf862('0x49'));}break;case _0xf862('0x4a'):if(_0x1867bb[_0xf862('0x4b')]&&_0x1867bb[_0xf862('0x20')]){var _0x1c87d7={'dst':_0x2975fd['phone'],'text':_0x2975fd[_0xf862('0xa')],'src':_0x1867bb[_0xf862('0x38')]||_0x1867bb[_0xf862('0x21')],'url':_0x1867bb[_0xf862('0x23')]+_0xf862('0x4c')+_0x2975fd['id']+_0xf862('0x24')+_0x1867bb['token']};var _0x3151b2=util[_0xf862('0x3f')](_0xf862('0x3d'),_0x1867bb[_0xf862('0x4b')],_0x1867bb['authToken']);var _0x763f63={'method':_0xf862('0x39'),'uri':util[_0xf862('0x3f')](_0xf862('0x4d'),_0x1867bb[_0xf862('0x4b')]),'body':_0x1c87d7,'headers':{'Authorization':util[_0xf862('0x3f')](_0xf862('0x40'),new Buffer(_0x3151b2)[_0xf862('0x4e')]('base64'))},'json':!![]};rp(_0x763f63)[_0xf862('0x15')](function(_0x5e5e36){var _0xc85f15={'messageId':_0x5e5e36[_0xf862('0x4f')][0x0]};return _0x5955bb[_0xf862('0x16')](_0xc85f15);})[_0xf862('0x18')](function(_0x571c2a){logger['error'](_0xf862('0x29'),'afterCreate','plivo',util['inspect'](_0x571c2a,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x4a'),_0xf862('0x50'));}break;case _0xf862('0x51'):if(_0x1867bb[_0xf862('0x2e')]&&_0x1867bb['password']){if(_0x1867bb['baseUrl']){var _0x51be41={'method':_0xf862('0x39'),'uri':_0x1867bb[_0xf862('0x52')]+_0xf862('0x53'),'body':{'username':_0x1867bb[_0xf862('0x2e')],'password':_0x1867bb[_0xf862('0x2b')]},'json':!![]};return rp(_0x51be41)[_0xf862('0x15')](function(_0x3adabb){var _0x4debd4={'method':_0xf862('0x39'),'uri':_0x1867bb[_0xf862('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1867bb['phone'],'destinations':[{'to':_0x2975fd[_0xf862('0x21')]}],'text':_0x2975fd[_0xf862('0xa')],'notifyUrl':_0x1867bb[_0xf862('0x23')]+_0xf862('0x4c')+_0x2975fd['id']+_0xf862('0x24')+_0x1867bb['token'],'notifyContentType':_0xf862('0x54'),'callbackData':_0x1867bb[_0xf862('0x21')]+';'+_0x2975fd[_0xf862('0xa')]}]},'headers':{'Authorization':_0xf862('0x55')+_0x3adabb['token']},'json':!![]};return rp(_0x4debd4)[_0xf862('0x15')](function(_0x29b7c6){if(_0x29b7c6[_0xf862('0x46')]){var _0x5d1b20={'messageId':_0x29b7c6['messages'][0x0][_0xf862('0x9')]};if(!_0x1867bb['deliveryReport']){_0x5d1b20[_0xf862('0x56')]=!![];}return _0x5955bb[_0xf862('0x16')](_0x5d1b20);}else{return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'infobip',util[_0xf862('0x28')](_0x29b7c6,{'showHidden':![],'depth':null}));}});})[_0xf862('0x18')](function(_0x422163){return logger['error'](_0xf862('0x29'),'afterCreate',_0xf862('0x51'),util[_0xf862('0x28')](_0x422163,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),'afterCreate',_0xf862('0x51'),_0xf862('0x57'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf862('0x27'),_0xf862('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf862('0x58'):var _0x7cb69c=require(_0xf862('0x59'));if(_0x1867bb[_0xf862('0x5a')]){var _0x3a2099={};_0x3a2099[_0xf862('0x5b')]=_0x1867bb[_0xf862('0x2e')];_0x3a2099[_0xf862('0x21')]=_0x2975fd[_0xf862('0x21')];_0x3a2099['sender']=_0x1867bb[_0xf862('0x21')];_0x3a2099[_0xf862('0x5c')]=_0x2975fd[_0xf862('0xa')];_0x3a2099[_0xf862('0x5d')]=+new Date();var _0x964005='';var _0x424e03='';var _0x3b8585=Object['keys'](_0x3a2099);_0x3b8585['sort']();for(var _0x4ec792=0x0;_0x4ec792<_0x3b8585[_0xf862('0x5e')];_0x4ec792++){if(_0x964005!=''){_0x964005+='&';}_0x964005+=_0x3b8585[_0x4ec792]+'='+encodeURIComponent(_0x3a2099[_0x3b8585[_0x4ec792]]);_0x424e03+=_0x3a2099[_0x3b8585[_0x4ec792]];}_0x424e03+=_0x1867bb[_0xf862('0x5a')];_0x424e03=_0x7cb69c['createHash'](_0xf862('0x5f'))[_0xf862('0x16')](_0x424e03)[_0xf862('0x60')](_0xf862('0x61'));if(_0x964005!==''){_0x964005+='&';}_0x964005+=_0xf862('0x62')+_0x424e03;var _0x38b90e={'method':_0xf862('0x30'),'uri':_0x1867bb[_0xf862('0x52')]+'/external/get/send.php?'+_0x964005,'json':!![]};return rp(_0x38b90e)[_0xf862('0x15')](function(_0x37d910){var _0x82144f=Object[_0xf862('0x63')](_0x37d910);if(_0x37d910[_0x82144f[0x0]][_0xf862('0x19')]&&parseInt(_0x37d910[_0x82144f[0x0]][_0xf862('0x19')])===0x0){var _0xdfa7cf={'messageId':_0x37d910[_0x82144f[0x0]][_0xf862('0x64')]};if(!_0x1867bb['deliveryReport']){_0xdfa7cf[_0xf862('0x56')]=!![];}return _0x5955bb[_0xf862('0x16')](_0xdfa7cf);}else{return logger[_0xf862('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf862('0x58'),util[_0xf862('0x28')](_0x37d910[_0xf862('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x539ec6){return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'csc',util[_0xf862('0x28')](_0x539ec6,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x58'),_0xf862('0x65'));}break;case _0xf862('0x66'):if(_0x1867bb[_0xf862('0x5a')]){var _0x2e9123={'method':_0xf862('0x39'),'uri':_0xf862('0x67'),'headers':{'Authorization':_0x1867bb[_0xf862('0x5a')]},'body':{'content':_0x2975fd[_0xf862('0xa')],'to':[_0x2975fd['phone']],'from':_0x1867bb[_0xf862('0x21')],'binary':![],'clientMessageId':_0xf862('0x68'),'charset':_0xf862('0x69')},'json':!![]};rp(_0x2e9123)[_0xf862('0x15')](function(_0x392323){if(!_0x392323['error']){var _0x6b3c76={'messageId':_0x392323[_0xf862('0x46')][0x0]['apiMessageId']};if(!_0x1867bb[_0xf862('0x37')]){_0x6b3c76['read']=!![];}return _0x5955bb['update'](_0x6b3c76);}else{return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x66'),util[_0xf862('0x28')](_0x392323[_0xf862('0x19')],{'showHidden':![],'depth':null}));}})[_0xf862('0x18')](function(_0x2c64ec){return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),_0xf862('0x66'),util[_0xf862('0x28')](_0x2c64ec,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf862('0x27'),_0xf862('0x66'),_0xf862('0x65'));}break;case _0xf862('0x6a'):if(_0x1867bb[_0xf862('0x2e')]&&_0x1867bb['password']){var _0x3151b2=util[_0xf862('0x3f')](_0xf862('0x3d'),_0x1867bb[_0xf862('0x2e')],_0x1867bb[_0xf862('0x2b')]);var _0x763f63={'method':'POST','uri':_0xf862('0x6b')+_0x1867bb[_0xf862('0x6c')]+'/messages','body':{'to':[_0x2975fd['phone']],'text':_0x2975fd[_0xf862('0xa')],'from':_0x1867bb[_0xf862('0x21')],'applicationId':_0x1867bb['applicationId']},'headers':{'Authorization':util[_0xf862('0x3f')](_0xf862('0x40'),new Buffer(_0x3151b2)[_0xf862('0x4e')](_0xf862('0x41')))},'json':!![]};rp(_0x763f63)[_0xf862('0x15')](function(_0x25cb7e){if(_0x25cb7e['id']){var _0x9c24a7={'messageId':_0x25cb7e['id']};return _0x5955bb[_0xf862('0x16')](_0x9c24a7);}else{logger['error'](_0xf862('0x29'),'afterCreate','bandwidth',util[_0xf862('0x28')](_0x25cb7e,{'showHidden':![],'depth':null}));}})[_0xf862('0x18')](function(_0x630f7e){logger[_0xf862('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0xf862('0x28')](_0x630f7e,{'showHidden':![],'depth':null}));});}else{logger[_0xf862('0x19')](_0xf862('0x29'),'afterCreate','bandwidth',_0xf862('0x49'));}break;case _0xf862('0x6d'):if(_0x1867bb[_0xf862('0x5a')]){var _0x5843ba={};var _0x38b90e={'method':_0xf862('0x39'),'uri':_0xf862('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x1867bb[_0xf862('0x5a')],'Content-Type':_0xf862('0x54')},'body':{'from':_0x1867bb[_0xf862('0x21')],'to':_0x2975fd[_0xf862('0x21')],'text':_0x2975fd[_0xf862('0xa')]},'json':!![]};return rp(_0x38b90e)['then'](function(_0x523d78){if(_0x523d78[_0xf862('0x6f')]==0xca){_0x5843ba['message']=_0x523d78;var _0x5ac4d6={'method':_0xf862('0x39'),'uri':_0xf862('0x70'),'headers':{'Authorization':_0xf862('0x71')+_0x1867bb[_0xf862('0x5a')],'Content-Type':_0xf862('0x54')},'body':{'refid':_0x5843ba[_0xf862('0x72')][_0xf862('0x73')]},'json':!![]};return rp(_0x5ac4d6)[_0xf862('0x15')](function(_0x3ea638){_0x5843ba[_0xf862('0x74')]=_0x3ea638;var _0x1e1a48={'messageId':_0x5843ba[_0xf862('0x72')]['refid'],'read':!![]};return _0x5955bb['update'](_0x1e1a48);});}else{return logger[_0xf862('0x19')](_0xf862('0x29'),_0xf862('0x27'),'intelepeer',util['inspect'](_0x523d78,{'showHidden':![],'depth':null}));}})[_0xf862('0x18')](function(_0x4d11bb){return logger[_0xf862('0x19')](_0xf862('0x29'),'afterCreate',_0xf862('0x6d'),util[_0xf862('0x28')](_0x4d11bb,{'showHidden':![],'depth':null}));});}else{return logger[_0xf862('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0xf862('0x75')](function(){_0x528c63();});}else{_0x528c63();}}},'charset':'utf8mb4','collate':_0xf862('0x76')});}; \ No newline at end of file +var _0xbf5d=['Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','accountId','/messages','applicationId','base64','Bearer\x20','code','message','refid','intelepeer','finally','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','accountSid','authToken','messages','create','phone','/api/sms/messages/','/status?token=','token','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','apiKey','login','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc'];(function(_0x2e8c3e,_0x11c48b){var _0x1c3fe2=function(_0xd43c17){while(--_0xd43c17){_0x2e8c3e['push'](_0x2e8c3e['shift']());}};_0x1c3fe2(++_0x11c48b);}(_0xbf5d,0x1f0));var _0xdbf5=function(_0x3dd5b5,_0x37b8d6){_0x3dd5b5=_0x3dd5b5-0x0;var _0xcdde1f=_0xbf5d[_0x3dd5b5];return _0xcdde1f;};'use strict';var _=require('lodash');var util=require(_0xdbf5('0x0'));var logger=require('../../config/logger')(_0xdbf5('0x1'));var moment=require('moment');var BPromise=require(_0xdbf5('0x2'));var rp=require(_0xdbf5('0x3'));var fs=require('fs');var path=require(_0xdbf5('0x4'));var rimraf=require(_0xdbf5('0x5'));var config=require(_0xdbf5('0x6'));var attributes=require(_0xdbf5('0x7'));module['exports']=function(_0x1ec402,_0x39c2d9){return _0x1ec402[_0xdbf5('0x8')](_0xdbf5('0x9'),attributes,{'tableName':_0xdbf5('0xa'),'paranoid':![],'indexes':[{'name':_0xdbf5('0xb'),'fields':['messageId']},{'name':_0xdbf5('0xc'),'fields':[_0xdbf5('0xd')],'type':_0xdbf5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b9702,_0x571277,_0xf3137){var _0x2654ee=_0x1ec402[_0xdbf5('0xf')];var _0x20ef11=_0x2b9702[_0xdbf5('0x10')]({'plain':!![]});if(_0x20ef11[_0xdbf5('0x11')]['toLowerCase']()==='in'||_0x20ef11[_0xdbf5('0x11')][_0xdbf5('0x12')]()==='out'&&!_0x20ef11['secret']&&!_['isNil'](_0x20ef11[_0xdbf5('0x13')])&&!_['isNil'](_0x20ef11[_0xdbf5('0x14')])){_0x2654ee[_0xdbf5('0x15')]['findOne']({'where':{'id':_0x20ef11[_0xdbf5('0x14')]}})[_0xdbf5('0x16')](function(_0x4b6722){if(_0x4b6722){_0x4b6722[_0xdbf5('0x17')]({'lastMsgAt':_0x20ef11[_0xdbf5('0x18')],'lastMsgDirection':_0x20ef11[_0xdbf5('0x11')]['toLowerCase']()});}})[_0xdbf5('0x19')](function(_0x33fb6f){console[_0xdbf5('0x1a')](_0x33fb6f);});}if(_0x20ef11[_0xdbf5('0x11')]==='out'&&!_0x20ef11[_0xdbf5('0x1b')]){var _0x3bd501;_0x2654ee[_0xdbf5('0x1c')][_0xdbf5('0x1d')]({'where':{'id':_0x20ef11[_0xdbf5('0x1e')]},'raw':!![]})[_0xdbf5('0x16')](function(_0x316cc9){_0x3bd501=_0x316cc9;if(_0x3bd501&&_0x3bd501['type']){switch(_0x3bd501[_0xdbf5('0x1f')]){case'twilio':var _0x37c0c1=require('twilio');if(_0x3bd501[_0xdbf5('0x20')]&&_0x3bd501[_0xdbf5('0x21')]&&_0x3bd501['phone']){var _0x6d8e35=new _0x37c0c1(_0x3bd501['accountSid'],_0x3bd501[_0xdbf5('0x21')]);_0x6d8e35[_0xdbf5('0x22')][_0xdbf5('0x23')]({'body':_0x20ef11[_0xdbf5('0xd')],'to':_0x20ef11[_0xdbf5('0x24')],'from':_0x3bd501[_0xdbf5('0x24')],'statusCallback':_0x3bd501['remote']+_0xdbf5('0x25')+_0x20ef11['id']+_0xdbf5('0x26')+_0x3bd501[_0xdbf5('0x27')]})[_0xdbf5('0x16')](function(_0x1cf196){if(_0x1cf196['sid']){return _0x2b9702[_0xdbf5('0x17')]({'messageId':_0x1cf196[_0xdbf5('0x28')]});}})[_0xdbf5('0x19')](function(_0x4cf17d){logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),_0xdbf5('0x2a'),util[_0xdbf5('0x2b')](_0x4cf17d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x2a'),_0xdbf5('0x2d'));}break;case _0xdbf5('0x2e'):var _0x400c16='https://api.skebby.it/API/v1.0/REST/';if(_0x3bd501[_0xdbf5('0x2f')]&&_0x3bd501[_0xdbf5('0x30')]){var _0x4db88f={'recipient':[_0x20ef11[_0xdbf5('0x24')]],'message':_0x20ef11['body'],'message_type':_0x3bd501['smsMethod']};if(_0x3bd501['smsMethod']&&_0x3bd501[_0xdbf5('0x31')]!=='SI'){_0x4db88f[_0xdbf5('0x32')]=_0x3bd501[_0xdbf5('0x24')];}var _0x2f2f73={'url':_0x400c16+_0xdbf5('0x33')+_0x3bd501['username']+_0xdbf5('0x34')+_0x3bd501['password'],'method':_0xdbf5('0x35')};rp(_0x2f2f73)[_0xdbf5('0x16')](function(_0x5dddcb){var _0x27aa10=_0x5dddcb['split'](';');var _0x26ad5f={'user_key':_0x27aa10[0x0],'session_key':_0x27aa10[0x1]};_0x2f2f73={'url':_0x400c16+_0xdbf5('0x36'),'method':_0xdbf5('0x37'),'headers':{'user_key':_0x26ad5f[_0xdbf5('0x38')],'Session_key':_0x26ad5f[_0xdbf5('0x39')]},'json':!![],'body':_0x4db88f};return rp(_0x2f2f73);})[_0xdbf5('0x16')](function(_0x451e3f){if(_0x451e3f[_0xdbf5('0x3a')]>=0x1){var _0x5e6b30={'messageId':_0x451e3f[_0xdbf5('0x3b')]};if(_0x3bd501[_0xdbf5('0x31')]!=='GP'||!_0x3bd501[_0xdbf5('0x3c')]){_0x5e6b30[_0xdbf5('0x3d')]=!![];}return _0x2b9702[_0xdbf5('0x17')](_0x5e6b30);}else{return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x2e'),util['inspect'](_0x451e3f,{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x5ecbc0){return logger['error'](_0xdbf5('0x2c'),_0xdbf5('0x29'),'skebby',util['inspect'](_0x5ecbc0,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x2e'),_0xdbf5('0x3e'));}break;case _0xdbf5('0x3f'):if(_0x3bd501['authToken']){var _0x35bb29={'recipient':_0x20ef11[_0xdbf5('0x24')],'message':_0x20ef11[_0xdbf5('0xd')],'sender':_0x3bd501[_0xdbf5('0x40')]||_0x3bd501[_0xdbf5('0x24')],'authorization':_0x3bd501[_0xdbf5('0x21')]};var _0x571277={'method':_0xdbf5('0x37'),'uri':_0xdbf5('0x41'),'body':_0x35bb29,'json':!![]};rp(_0x571277)[_0xdbf5('0x16')](function(_0x4b72e3){var _0x35e94b={'messageId':_0x4b72e3['requestid']};if(!_0x3bd501[_0xdbf5('0x3c')]){_0x35e94b['read']=!![];}return _0x2b9702[_0xdbf5('0x17')](_0x35e94b);})[_0xdbf5('0x19')](function(_0x2ab3dc){logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'connectel',util[_0xdbf5('0x2b')](_0x2ab3dc,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'connectel',_0xdbf5('0x42'));}break;case _0xdbf5('0x43'):if(_0x3bd501[_0xdbf5('0x2f')]&&_0x3bd501[_0xdbf5('0x30')]){var _0x35bb29={'messages':[{'source':_0xdbf5('0x44'),'to':_0x20ef11['phone'],'body':_0x20ef11[_0xdbf5('0xd')],'from':_0x3bd501['senderString']||_0x3bd501[_0xdbf5('0x24')]}]};var _0x5d41a1=util['format'](_0xdbf5('0x45'),_0x3bd501[_0xdbf5('0x2f')],_0x3bd501[_0xdbf5('0x30')]);var _0x571277={'method':_0xdbf5('0x37'),'uri':_0xdbf5('0x46'),'body':_0x35bb29,'headers':{'Authorization':util[_0xdbf5('0x47')]('Basic\x20%s',new Buffer(_0x5d41a1)[_0xdbf5('0x48')]('base64'))},'json':!![]};rp(_0x571277)['then'](function(_0x2e342d){if(_0x2e342d[_0xdbf5('0x49')]>=0xc8&&_0x2e342d[_0xdbf5('0x49')]<=0xce){if(_0x2e342d[_0xdbf5('0x4a')]&&_0x2e342d['data'][_0xdbf5('0x4b')]>0x0){var _0x10b3a4=_[_0xdbf5('0x4c')](_0x2e342d[_0xdbf5('0x4a')][_0xdbf5('0x22')]);var _0x37b977={'messageId':_0x10b3a4[_0xdbf5('0x4d')]};if(!_0x3bd501[_0xdbf5('0x3c')]){_0x37b977[_0xdbf5('0x3d')]=!![];}return _0x2b9702['update'](_0x37b977);}else{logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),_0xdbf5('0x4e'),util[_0xdbf5('0x2b')](_0x2e342d,{'showHidden':![],'depth':null}));}}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'clickSend',util[_0xdbf5('0x2b')](_0x2e342d,{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x3b462a){logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),_0xdbf5('0x4e'),util['inspect'](_0x3b462a,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x4e'),_0xdbf5('0x3e'));}break;case _0xdbf5('0x4f'):if(_0x3bd501[_0xdbf5('0x50')]&&_0x3bd501[_0xdbf5('0x21')]){var _0x35bb29={'dst':_0x20ef11['phone'],'text':_0x20ef11[_0xdbf5('0xd')],'src':_0x3bd501['senderString']||_0x3bd501['phone'],'url':_0x3bd501[_0xdbf5('0x51')]+_0xdbf5('0x25')+_0x20ef11['id']+'/status?token='+_0x3bd501['token']};var _0x5d41a1=util[_0xdbf5('0x47')](_0xdbf5('0x45'),_0x3bd501['authId'],_0x3bd501[_0xdbf5('0x21')]);var _0x571277={'method':_0xdbf5('0x37'),'uri':util['format'](_0xdbf5('0x52'),_0x3bd501['authId']),'body':_0x35bb29,'headers':{'Authorization':util[_0xdbf5('0x47')](_0xdbf5('0x53'),new Buffer(_0x5d41a1)[_0xdbf5('0x48')]('base64'))},'json':!![]};rp(_0x571277)[_0xdbf5('0x16')](function(_0x260eea){var _0x342460={'messageId':_0x260eea[_0xdbf5('0x54')][0x0]};return _0x2b9702[_0xdbf5('0x17')](_0x342460);})['catch'](function(_0x1c1741){logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdbf5('0x4f'),util[_0xdbf5('0x2b')](_0x1c1741,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x4f'),_0xdbf5('0x55'));}break;case _0xdbf5('0x56'):if(_0x3bd501['username']&&_0x3bd501['password']){if(_0x3bd501['baseUrl']){var _0x15481c={'method':_0xdbf5('0x37'),'uri':_0x3bd501[_0xdbf5('0x57')]+_0xdbf5('0x58'),'body':{'username':_0x3bd501[_0xdbf5('0x2f')],'password':_0x3bd501['password']},'json':!![]};return rp(_0x15481c)[_0xdbf5('0x16')](function(_0x403874){var _0x24088e={'method':_0xdbf5('0x37'),'uri':_0x3bd501[_0xdbf5('0x57')]+_0xdbf5('0x59'),'body':{'messages':[{'from':_0x3bd501['phone'],'destinations':[{'to':_0x20ef11[_0xdbf5('0x24')]}],'text':_0x20ef11['body'],'notifyUrl':_0x3bd501[_0xdbf5('0x51')]+_0xdbf5('0x25')+_0x20ef11['id']+_0xdbf5('0x26')+_0x3bd501[_0xdbf5('0x27')],'notifyContentType':_0xdbf5('0x5a'),'callbackData':_0x3bd501[_0xdbf5('0x24')]+';'+_0x20ef11[_0xdbf5('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x403874[_0xdbf5('0x27')]},'json':!![]};return rp(_0x24088e)[_0xdbf5('0x16')](function(_0x154d0e){if(_0x154d0e[_0xdbf5('0x22')]){var _0x2e20f2={'messageId':_0x154d0e[_0xdbf5('0x22')][0x0][_0xdbf5('0xb')]};if(!_0x3bd501[_0xdbf5('0x3c')]){_0x2e20f2[_0xdbf5('0x3d')]=!![];}return _0x2b9702[_0xdbf5('0x17')](_0x2e20f2);}else{return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x56'),util[_0xdbf5('0x2b')](_0x154d0e,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2b92e1){return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x56'),util[_0xdbf5('0x2b')](_0x2b92e1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x56'),_0xdbf5('0x5b'));}}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x56'),_0xdbf5('0x3e'));}break;case'csc':var _0xa1634d=require('crypto');if(_0x3bd501[_0xdbf5('0x5c')]){var _0x1e4c39={};_0x1e4c39[_0xdbf5('0x5d')]=_0x3bd501[_0xdbf5('0x2f')];_0x1e4c39[_0xdbf5('0x24')]=_0x20ef11['phone'];_0x1e4c39[_0xdbf5('0x32')]=_0x3bd501[_0xdbf5('0x24')];_0x1e4c39['text']=_0x20ef11[_0xdbf5('0xd')];_0x1e4c39[_0xdbf5('0x5e')]=+new Date();var _0xd976ea='';var _0x11dfc4='';var _0x43ca42=Object[_0xdbf5('0x5f')](_0x1e4c39);_0x43ca42['sort']();for(var _0x575f2d=0x0;_0x575f2d<_0x43ca42[_0xdbf5('0x60')];_0x575f2d++){if(_0xd976ea!=''){_0xd976ea+='&';}_0xd976ea+=_0x43ca42[_0x575f2d]+'='+encodeURIComponent(_0x1e4c39[_0x43ca42[_0x575f2d]]);_0x11dfc4+=_0x1e4c39[_0x43ca42[_0x575f2d]];}_0x11dfc4+=_0x3bd501['apiKey'];_0x11dfc4=_0xa1634d[_0xdbf5('0x61')](_0xdbf5('0x62'))[_0xdbf5('0x17')](_0x11dfc4)[_0xdbf5('0x63')](_0xdbf5('0x64'));if(_0xd976ea!==''){_0xd976ea+='&';}_0xd976ea+=_0xdbf5('0x65')+_0x11dfc4;var _0x2f2f73={'method':_0xdbf5('0x35'),'uri':_0x3bd501[_0xdbf5('0x57')]+_0xdbf5('0x66')+_0xd976ea,'json':!![]};return rp(_0x2f2f73)['then'](function(_0x22cd0c){var _0x67f54b=Object['keys'](_0x22cd0c);if(_0x22cd0c[_0x67f54b[0x0]]['error']&&parseInt(_0x22cd0c[_0x67f54b[0x0]]['error'])===0x0){var _0x2aec07={'messageId':_0x22cd0c[_0x67f54b[0x0]]['id_sms']};if(!_0x3bd501[_0xdbf5('0x3c')]){_0x2aec07[_0xdbf5('0x3d')]=!![];}return _0x2b9702['update'](_0x2aec07);}else{return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'csc',util[_0xdbf5('0x2b')](_0x22cd0c[_0xdbf5('0x1a')],{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x593301){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),_0xdbf5('0x67'),util['inspect'](_0x593301,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'csc',_0xdbf5('0x68'));}break;case'clickatell':if(_0x3bd501[_0xdbf5('0x5c')]){var _0x58a270={'method':_0xdbf5('0x37'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3bd501[_0xdbf5('0x5c')]},'body':{'content':_0x20ef11['body'],'to':[_0x20ef11['phone']],'from':_0x3bd501[_0xdbf5('0x24')],'binary':![],'clientMessageId':_0xdbf5('0x69'),'charset':_0xdbf5('0x6a')},'json':!![]};rp(_0x58a270)['then'](function(_0x3073e1){if(!_0x3073e1[_0xdbf5('0x1a')]){var _0x556cbd={'messageId':_0x3073e1[_0xdbf5('0x22')][0x0][_0xdbf5('0x6b')]};if(!_0x3bd501[_0xdbf5('0x3c')]){_0x556cbd['read']=!![];}return _0x2b9702[_0xdbf5('0x17')](_0x556cbd);}else{return logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),_0xdbf5('0x6c'),util[_0xdbf5('0x2b')](_0x3073e1[_0xdbf5('0x1a')],{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x31559c){return logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0xdbf5('0x2b')](_0x31559c,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),'afterCreate',_0xdbf5('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0xdbf5('0x6d'):if(_0x3bd501[_0xdbf5('0x2f')]&&_0x3bd501[_0xdbf5('0x30')]){var _0x5d41a1=util[_0xdbf5('0x47')](_0xdbf5('0x45'),_0x3bd501[_0xdbf5('0x2f')],_0x3bd501[_0xdbf5('0x30')]);var _0x571277={'method':_0xdbf5('0x37'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3bd501[_0xdbf5('0x6e')]+_0xdbf5('0x6f'),'body':{'to':[_0x20ef11[_0xdbf5('0x24')]],'text':_0x20ef11[_0xdbf5('0xd')],'from':_0x3bd501['phone'],'applicationId':_0x3bd501[_0xdbf5('0x70')]},'headers':{'Authorization':util[_0xdbf5('0x47')](_0xdbf5('0x53'),new Buffer(_0x5d41a1)['toString'](_0xdbf5('0x71')))},'json':!![]};rp(_0x571277)[_0xdbf5('0x16')](function(_0x4a47df){if(_0x4a47df['id']){var _0x3105b1={'messageId':_0x4a47df['id']};return _0x2b9702['update'](_0x3105b1);}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x6d'),util[_0xdbf5('0x2b')](_0x4a47df,{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x5e2d13){logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x6d'),util[_0xdbf5('0x2b')](_0x5e2d13,{'showHidden':![],'depth':null}));});}else{logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),'bandwidth',_0xdbf5('0x3e'));}break;case'intelepeer':if(_0x3bd501[_0xdbf5('0x5c')]){var _0x18e655={};var _0x2f2f73={'method':_0xdbf5('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xdbf5('0x72')+_0x3bd501['apiKey'],'Content-Type':_0xdbf5('0x5a')},'body':{'from':_0x3bd501[_0xdbf5('0x24')],'to':_0x20ef11[_0xdbf5('0x24')],'text':_0x20ef11['body']},'json':!![]};return rp(_0x2f2f73)['then'](function(_0x147c6b){if(_0x147c6b[_0xdbf5('0x73')]==0xca){_0x18e655['message']=_0x147c6b;var _0x40dac0={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xdbf5('0x72')+_0x3bd501[_0xdbf5('0x5c')],'Content-Type':_0xdbf5('0x5a')},'body':{'refid':_0x18e655[_0xdbf5('0x74')][_0xdbf5('0x75')]},'json':!![]};return rp(_0x40dac0)[_0xdbf5('0x16')](function(_0x389a82){_0x18e655['status']=_0x389a82;var _0x17a30e={'messageId':_0x18e655[_0xdbf5('0x74')]['refid'],'read':!![]};return _0x2b9702[_0xdbf5('0x17')](_0x17a30e);});}else{return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x76'),util[_0xdbf5('0x2b')](_0x147c6b,{'showHidden':![],'depth':null}));}})[_0xdbf5('0x19')](function(_0x1bd648){return logger[_0xdbf5('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdbf5('0x29'),'intelepeer',util[_0xdbf5('0x2b')](_0x1bd648,{'showHidden':![],'depth':null}));});}else{return logger[_0xdbf5('0x1a')](_0xdbf5('0x2c'),_0xdbf5('0x29'),_0xdbf5('0x76'),'Token\x20not\x20received');}break;}}})[_0xdbf5('0x77')](function(){_0xf3137();});}else{_0xf3137();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b093aeb..eeb6387 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 _0x7150=['request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register'];(function(_0x5b27e0,_0x40544b){var _0x70191f=function(_0x4057ba){while(--_0x4057ba){_0x5b27e0['push'](_0x5b27e0['shift']());}};_0x70191f(++_0x40544b);}(_0x7150,0x132));var _0x0715=function(_0x589b15,_0x30e428){_0x589b15=_0x589b15-0x0;var _0x38eba0=_0x7150[_0x589b15];return _0x38eba0;};'use strict';var _=require(_0x0715('0x0'));var util=require(_0x0715('0x1'));var moment=require(_0x0715('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0715('0x3'));var db=require(_0x0715('0x4'))['db'];var utils=require(_0x0715('0x5'));var logger=require('../../config/logger')(_0x0715('0x6'));var config=require(_0x0715('0x7'));var jayson=require(_0x0715('0x8'));var client=jayson[_0x0715('0x9')][_0x0715('0xa')]({'port':0x232a});config[_0x0715('0xb')]=_['defaults'](config['redis'],{'host':_0x0715('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0715('0xb')]));require('./smsMessage.socket')[_0x0715('0xd')](socket);function respondWithRpcPromise(_0x258c29,_0x1172f7,_0x56dfce){return new BPromise(function(_0x5c458f,_0x210a10){return client[_0x0715('0xe')](_0x258c29,_0x56dfce)[_0x0715('0xf')](function(_0x497624){logger[_0x0715('0x10')]('SmsMessage,\x20%s,\x20%s',_0x1172f7,_0x0715('0x11'));logger[_0x0715('0x12')](_0x0715('0x13'),_0x1172f7,'request\x20sent',JSON['stringify'](_0x497624));if(_0x497624[_0x0715('0x14')]){if(_0x497624['error'][_0x0715('0x15')]===0x1f4){logger[_0x0715('0x14')](_0x0715('0x16'),_0x1172f7,_0x497624[_0x0715('0x14')][_0x0715('0x17')]);return _0x210a10(_0x497624['error'][_0x0715('0x17')]);}logger['error'](_0x0715('0x16'),_0x1172f7,_0x497624['error'][_0x0715('0x17')]);return _0x5c458f(_0x497624[_0x0715('0x14')]['message']);}else{logger['info'](_0x0715('0x16'),_0x1172f7,'request\x20sent');_0x5c458f(_0x497624[_0x0715('0x18')][_0x0715('0x17')]);}})[_0x0715('0x19')](function(_0x1c0e73){logger[_0x0715('0x14')](_0x0715('0x16'),_0x1172f7,_0x1c0e73);_0x210a10(_0x1c0e73);});});}exports[_0x0715('0x1a')]=function(_0x3c44a6){var _0x590a2a=this;return new Promise(function(_0x4c7c1a,_0x1ef371){return db[_0x0715('0x1b')]['create'](_0x3c44a6[_0x0715('0x1c')],{'raw':_0x3c44a6[_0x0715('0x1d')]?_0x3c44a6[_0x0715('0x1d')][_0x0715('0x1e')]===undefined?!![]:![]:!![]})[_0x0715('0xf')](function(_0xe74520){logger[_0x0715('0x10')]('CreateSmsMessage',_0x3c44a6);logger[_0x0715('0x12')](_0x0715('0x1a'),_0x3c44a6,JSON[_0x0715('0x1f')](_0xe74520));_0x4c7c1a(_0xe74520);})[_0x0715('0x19')](function(_0x1a4895){logger[_0x0715('0x14')](_0x0715('0x1a'),_0x1a4895[_0x0715('0x17')],_0x3c44a6);_0x1ef371(_0x590a2a[_0x0715('0x14')](0x1f4,_0x1a4895[_0x0715('0x17')]));});});}; \ No newline at end of file +var _0x2592=['localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','body','options','raw','then','CreateSmsMessage','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis'];(function(_0x1b76a8,_0x4ec861){var _0x1c6904=function(_0x5a3670){while(--_0x5a3670){_0x1b76a8['push'](_0x1b76a8['shift']());}};_0x1c6904(++_0x4ec861);}(_0x2592,0x188));var _0x2259=function(_0x3db58d,_0x3f0c01){_0x3db58d=_0x3db58d-0x0;var _0x17158d=_0x2592[_0x3db58d];return _0x17158d;};'use strict';var _=require(_0x2259('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2259('0x1'));var rs=require(_0x2259('0x2'));var fs=require('fs');var Redis=require(_0x2259('0x3'));var db=require(_0x2259('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2259('0x5'))('rpc');var config=require(_0x2259('0x6'));var jayson=require(_0x2259('0x7'));var client=jayson[_0x2259('0x8')]['http']({'port':0x232a});config['redis']=_[_0x2259('0x9')](config[_0x2259('0xa')],{'host':_0x2259('0xb'),'port':0x18eb});var socket=require(_0x2259('0xc'))(new Redis(config[_0x2259('0xa')]));require(_0x2259('0xd'))[_0x2259('0xe')](socket);function respondWithRpcPromise(_0x3173b8,_0x574176,_0x401651){return new BPromise(function(_0x482337,_0x68bcbe){return client[_0x2259('0xf')](_0x3173b8,_0x401651)['then'](function(_0x321b34){logger[_0x2259('0x10')](_0x2259('0x11'),_0x574176,_0x2259('0x12'));logger[_0x2259('0x13')](_0x2259('0x14'),_0x574176,_0x2259('0x12'),JSON['stringify'](_0x321b34));if(_0x321b34[_0x2259('0x15')]){if(_0x321b34['error'][_0x2259('0x16')]===0x1f4){logger[_0x2259('0x15')](_0x2259('0x11'),_0x574176,_0x321b34['error']['message']);return _0x68bcbe(_0x321b34['error'][_0x2259('0x17')]);}logger[_0x2259('0x15')]('SmsMessage,\x20%s,\x20%s',_0x574176,_0x321b34[_0x2259('0x15')][_0x2259('0x17')]);return _0x482337(_0x321b34['error'][_0x2259('0x17')]);}else{logger[_0x2259('0x10')](_0x2259('0x11'),_0x574176,_0x2259('0x12'));_0x482337(_0x321b34[_0x2259('0x18')][_0x2259('0x17')]);}})[_0x2259('0x19')](function(_0x43578f){logger['error'](_0x2259('0x11'),_0x574176,_0x43578f);_0x68bcbe(_0x43578f);});});}exports['CreateSmsMessage']=function(_0x2d0a19){var _0x47766c=this;return new Promise(function(_0x3cd893,_0x1f0e24){return db['SmsMessage']['create'](_0x2d0a19[_0x2259('0x1a')],{'raw':_0x2d0a19[_0x2259('0x1b')]?_0x2d0a19[_0x2259('0x1b')][_0x2259('0x1c')]===undefined?!![]:![]:!![]})[_0x2259('0x1d')](function(_0x4aab18){logger[_0x2259('0x10')]('CreateSmsMessage',_0x2d0a19);logger['debug'](_0x2259('0x1e'),_0x2d0a19,JSON['stringify'](_0x4aab18));_0x3cd893(_0x4aab18);})[_0x2259('0x19')](function(_0x3fe684){logger['error'](_0x2259('0x1e'),_0x3fe684[_0x2259('0x17')],_0x2d0a19);_0x1f0e24(_0x47766c[_0x2259('0x15')](0x1f4,_0x3fe684[_0x2259('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 05a80fc..53135e4 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 _0x4448=['save','remove','update','emit','removeListener','register','smsMessage:','./smsMessage.events'];(function(_0x30328d,_0x545156){var _0x5e517f=function(_0x2fcda1){while(--_0x2fcda1){_0x30328d['push'](_0x30328d['shift']());}};_0x5e517f(++_0x545156);}(_0x4448,0xbf));var _0x8444=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4448[_0x2641f9];return _0x585741;};'use strict';var SmsMessageEvents=require(_0x8444('0x0'));var events=[_0x8444('0x1'),_0x8444('0x2'),_0x8444('0x3')];function createListener(_0x1bdc66,_0x297a9f){return function(_0x49015f){_0x297a9f[_0x8444('0x4')](_0x1bdc66,_0x49015f);};}function removeListener(_0xe79413,_0x374961){return function(){SmsMessageEvents[_0x8444('0x5')](_0xe79413,_0x374961);};}exports[_0x8444('0x6')]=function(_0xb7be7a){for(var _0x4fd6b3=0x0,_0x129036=events['length'];_0x4fd6b3<_0x129036;_0x4fd6b3++){var _0x238a4e=events[_0x4fd6b3];var _0x3079b8=createListener(_0x8444('0x7')+_0x238a4e,_0xb7be7a);SmsMessageEvents['on'](_0x238a4e,_0x3079b8);}}; \ No newline at end of file +var _0x15f1=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x15f1,0x126));var _0x115f=function(_0x5333a6,_0x416969){_0x5333a6=_0x5333a6-0x0;var _0x3d05ce=_0x15f1[_0x5333a6];return _0x3d05ce;};'use strict';var SmsMessageEvents=require(_0x115f('0x0'));var events=[_0x115f('0x1'),'remove',_0x115f('0x2')];function createListener(_0x11c09b,_0xb1bb06){return function(_0x1ea51c){_0xb1bb06[_0x115f('0x3')](_0x11c09b,_0x1ea51c);};}function removeListener(_0x306862,_0x1bd4f4){return function(){SmsMessageEvents[_0x115f('0x4')](_0x306862,_0x1bd4f4);};}exports[_0x115f('0x5')]=function(_0x28acc4){for(var _0x3ecca1=0x0,_0x44bbe2=events[_0x115f('0x6')];_0x3ecca1<_0x44bbe2;_0x3ecca1++){var _0x23938b=events[_0x3ecca1];var _0x506a4f=createListener(_0x115f('0x7')+_0x23938b,_0x28acc4);SmsMessageEvents['on'](_0x23938b,_0x506a4f);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b9e29bc..e1f886c 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 _0x93f9=['/:id/members','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','/:id/teams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x545554,_0x49de47){var _0x408e0c=function(_0x2680b2){while(--_0x2680b2){_0x545554['push'](_0x545554['shift']());}};_0x408e0c(++_0x49de47);}(_0x93f9,0x136));var _0x993f=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x93f9[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x993f('0x0'));var util=require(_0x993f('0x1'));var path=require(_0x993f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x993f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x993f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x993f('0x5'));var controller=require(_0x993f('0x6'));router[_0x993f('0x7')]('/',auth[_0x993f('0x8')](),controller[_0x993f('0x9')]);router[_0x993f('0x7')](_0x993f('0xa'),auth[_0x993f('0x8')](),controller[_0x993f('0xb')]);router['get'](_0x993f('0xc'),auth[_0x993f('0x8')](),controller[_0x993f('0xd')]);router[_0x993f('0x7')](_0x993f('0xe'),auth[_0x993f('0x8')](),controller[_0x993f('0xf')]);router['get']('/:id/teams',auth[_0x993f('0x8')](),controller['getTeams']);router[_0x993f('0x7')]('/:id/users',auth[_0x993f('0x8')](),controller[_0x993f('0x10')]);router[_0x993f('0x11')]('/',auth[_0x993f('0x8')](),controller[_0x993f('0x12')]);router[_0x993f('0x11')]('/:id/teams',auth[_0x993f('0x8')](),controller[_0x993f('0x13')]);router[_0x993f('0x11')](_0x993f('0x14'),auth[_0x993f('0x8')](),controller[_0x993f('0x15')]);router['put'](_0x993f('0xc'),auth[_0x993f('0x8')](),controller[_0x993f('0x16')]);router[_0x993f('0x17')](_0x993f('0xc'),auth[_0x993f('0x8')](),controller['destroy']);router[_0x993f('0x17')](_0x993f('0x18'),auth[_0x993f('0x8')](),controller['removeTeams']);router['delete'](_0x993f('0x14'),auth[_0x993f('0x8')](),controller[_0x993f('0x19')]);module[_0x993f('0x1a')]=router; \ No newline at end of file +var _0x64f0=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0x64f0,0x1a0));var _0x064f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x64f0[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x064f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x064f('0x1'));var express=require(_0x064f('0x2'));var router=express[_0x064f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x064f('0x4'));var interaction=require(_0x064f('0x5'));var config=require('../../config/environment');var controller=require(_0x064f('0x6'));router[_0x064f('0x7')]('/',auth['isAuthenticated'](),controller[_0x064f('0x8')]);router['get']('/describe',auth[_0x064f('0x9')](),controller[_0x064f('0xa')]);router[_0x064f('0x7')](_0x064f('0xb'),auth[_0x064f('0x9')](),controller[_0x064f('0xc')]);router[_0x064f('0x7')](_0x064f('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x064f('0x7')](_0x064f('0xe'),auth['isAuthenticated'](),controller[_0x064f('0xf')]);router[_0x064f('0x7')](_0x064f('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x064f('0x11')]('/',auth['isAuthenticated'](),controller[_0x064f('0x12')]);router[_0x064f('0x11')](_0x064f('0xe'),auth[_0x064f('0x9')](),controller[_0x064f('0x13')]);router[_0x064f('0x11')]('/:id/users',auth[_0x064f('0x9')](),controller[_0x064f('0x14')]);router['put'](_0x064f('0xb'),auth[_0x064f('0x9')](),controller[_0x064f('0x15')]);router[_0x064f('0x16')](_0x064f('0xb'),auth[_0x064f('0x9')](),controller[_0x064f('0x17')]);router[_0x064f('0x16')](_0x064f('0xe'),auth[_0x064f('0x9')](),controller[_0x064f('0x18')]);router[_0x064f('0x16')](_0x064f('0x10'),auth[_0x064f('0x9')](),controller[_0x064f('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 221d129..efc3e04 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 _0x3e8a=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x129a7c,_0x5c7eae){var _0x33d5cc=function(_0x24988b){while(--_0x24988b){_0x129a7c['push'](_0x129a7c['shift']());}};_0x33d5cc(++_0x5c7eae);}(_0x3e8a,0x183));var _0xa3e8=function(_0x2859ae,_0x2e7b48){_0x2859ae=_0x2859ae-0x0;var _0x18b88d=_0x3e8a[_0x2859ae];return _0x18b88d;};'use strict';var Sequelize=require(_0xa3e8('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3e8('0x1')],'unique':_0xa3e8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa3e8('0x1')]},'timeout':{'type':Sequelize[_0xa3e8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa3e8('0x4')](_0xa3e8('0x5'),_0xa3e8('0x6'),_0xa3e8('0x7'))}}; \ No newline at end of file +var _0xd6e7=['name','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x39dc28,_0xddf8d){var _0xe05836=function(_0x112b43){while(--_0x112b43){_0x39dc28['push'](_0x39dc28['shift']());}};_0xe05836(++_0xddf8d);}(_0xd6e7,0x11c));var _0x7d6e=function(_0x190e03,_0x2b861a){_0x190e03=_0x190e03-0x0;var _0x3cca82=_0xd6e7[_0x190e03];return _0x3cca82;};'use strict';var Sequelize=require(_0x7d6e('0x0'));module[_0x7d6e('0x1')]={'name':{'type':Sequelize[_0x7d6e('0x2')],'unique':_0x7d6e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d6e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d6e('0x4')]('rrmemory',_0x7d6e('0x5'),_0x7d6e('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2fc037f..af382e1 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 _0x3dda=['../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','rows','catch','create','user','role','SmsQueues','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','order','SmsQueueId','findAll','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','UserSmsQueue','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray','userSmsQueue:remove','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x26f03d,_0x4866c2){var _0x42dc9f=function(_0x110528){while(--_0x110528){_0x26f03d['push'](_0x26f03d['shift']());}};_0x42dc9f(++_0x4866c2);}(_0x3dda,0x1a7));var _0xa3dd=function(_0x36ddaa,_0x39fd6b){_0x36ddaa=_0x36ddaa-0x0;var _0x100050=_0x3dda[_0x36ddaa];return _0x100050;};'use strict';var emlformat=require(_0xa3dd('0x0'));var rimraf=require(_0xa3dd('0x1'));var zipdir=require(_0xa3dd('0x2'));var jsonpatch=require(_0xa3dd('0x3'));var rp=require(_0xa3dd('0x4'));var moment=require(_0xa3dd('0x5'));var BPromise=require(_0xa3dd('0x6'));var Mustache=require('mustache');var util=require(_0xa3dd('0x7'));var path=require(_0xa3dd('0x8'));var sox=require(_0xa3dd('0x9'));var csv=require(_0xa3dd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3dd('0xb'));var _=require(_0xa3dd('0xc'));var squel=require(_0xa3dd('0xd'));var crypto=require(_0xa3dd('0xe'));var jsforce=require(_0xa3dd('0xf'));var deskjs=require(_0xa3dd('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa3dd('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa3dd('0x12'));var qs=require(_0xa3dd('0x13'));var as=require(_0xa3dd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3dd('0x15'))(_0xa3dd('0x16'));var utils=require('../../config/utils');var config=require(_0xa3dd('0x17'));var licenseUtil=require(_0xa3dd('0x18'));var db=require('../../mysqldb')['db'];config[_0xa3dd('0x19')]=_[_0xa3dd('0x1a')](config[_0xa3dd('0x19')],{'host':_0xa3dd('0x1b'),'port':0x18eb});var socket=require(_0xa3dd('0x1c'))(new Redis(config[_0xa3dd('0x19')]));require(_0xa3dd('0x1d'))[_0xa3dd('0x1e')](socket);function respondWithStatusCode(_0x214bf3,_0x3608e3){_0x3608e3=_0x3608e3||0xcc;return function(_0x54e5e4){if(_0x54e5e4){return _0x214bf3[_0xa3dd('0x1f')](_0x3608e3);}return _0x214bf3[_0xa3dd('0x20')](_0x3608e3)[_0xa3dd('0x21')]();};}function respondWithResult(_0x3e2b6c,_0x5268c8){_0x5268c8=_0x5268c8||0xc8;return function(_0x1a700c){if(_0x1a700c){return _0x3e2b6c['status'](_0x5268c8)[_0xa3dd('0x22')](_0x1a700c);}};}function respondWithFilteredResult(_0x2c6d9c,_0xafea9f){return function(_0x48ea52){if(_0x48ea52){var _0x3733ec=typeof _0xafea9f[_0xa3dd('0x23')]===_0xa3dd('0x24')&&typeof _0xafea9f[_0xa3dd('0x25')]===_0xa3dd('0x24');var _0x4f4714=_0x48ea52[_0xa3dd('0x26')];var _0x27be5f=_0x3733ec?0x0:_0xafea9f[_0xa3dd('0x23')];var _0x48231f=_0x3733ec?_0x48ea52[_0xa3dd('0x26')]:_0xafea9f['offset']+_0xafea9f[_0xa3dd('0x25')];var _0x2136e8;if(_0x48231f>=_0x4f4714){_0x48231f=_0x4f4714;_0x2136e8=0xc8;}else{_0x2136e8=0xce;}_0x2c6d9c[_0xa3dd('0x20')](_0x2136e8);return _0x2c6d9c[_0xa3dd('0x27')](_0xa3dd('0x28'),_0x27be5f+'-'+_0x48231f+'/'+_0x4f4714)[_0xa3dd('0x22')](_0x48ea52);}return null;};}function patchUpdates(_0x5b814a){return function(_0x5ba6c9){try{jsonpatch[_0xa3dd('0x29')](_0x5ba6c9,_0x5b814a,!![]);}catch(_0xa25518){return BPromise[_0xa3dd('0x2a')](_0xa25518);}return _0x5ba6c9[_0xa3dd('0x2b')]();};}function saveUpdates(_0x585700,_0x458b24){return function(_0x5ea460){if(_0x5ea460){return _0x5ea460[_0xa3dd('0x2c')](_0x585700)[_0xa3dd('0x2d')](function(_0x308a91){return _0x308a91;});}return null;};}function removeEntity(_0x5a449b,_0x5232a1){return function(_0xb441e0){if(_0xb441e0){return _0xb441e0[_0xa3dd('0x2e')]()[_0xa3dd('0x2d')](function(){var _0xe4385=_0xb441e0[_0xa3dd('0x2f')]({'plain':!![]});var _0x2c106d='SmsQueues';return db[_0xa3dd('0x30')][_0xa3dd('0x2e')]({'where':{'type':_0x2c106d,'resourceId':_0xe4385['id']}})[_0xa3dd('0x2d')](function(){return _0xb441e0;});})['then'](function(){_0x5a449b[_0xa3dd('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17090c,_0x28bf1d){return function(_0x40db92){if(!_0x40db92){_0x17090c['sendStatus'](0x194);}return _0x40db92;};}function handleError(_0x1928a7,_0x468fd4){_0x468fd4=_0x468fd4||0x1f4;return function(_0x2d084e){logger['error'](_0x2d084e[_0xa3dd('0x31')]);if(_0x2d084e[_0xa3dd('0x32')]){delete _0x2d084e[_0xa3dd('0x32')];}_0x1928a7['status'](_0x468fd4)['send'](_0x2d084e);};}exports[_0xa3dd('0x33')]=function(_0x4dbc50,_0x23ad12){var _0x2e1e47={},_0x2c0b87={},_0x566e75={'count':0x0,'rows':[]};var _0x396637=_[_0xa3dd('0x34')](db['SmsQueue'][_0xa3dd('0x35')],function(_0x45119c){return{'name':_0x45119c['fieldName'],'type':_0x45119c[_0xa3dd('0x36')][_0xa3dd('0x37')]};});_0x2c0b87[_0xa3dd('0x38')]=_[_0xa3dd('0x34')](_0x396637,_0xa3dd('0x32'));_0x2c0b87['query']=_[_0xa3dd('0x39')](_0x4dbc50['query']);_0x2c0b87['filters']=_[_0xa3dd('0x3a')](_0x2c0b87['model'],_0x2c0b87[_0xa3dd('0x3b')]);_0x2e1e47[_0xa3dd('0x3c')]=_[_0xa3dd('0x3a')](_0x2c0b87[_0xa3dd('0x38')],qs[_0xa3dd('0x3d')](_0x4dbc50['query']['fields']));_0x2e1e47[_0xa3dd('0x3c')]=_0x2e1e47['attributes'][_0xa3dd('0x3e')]?_0x2e1e47[_0xa3dd('0x3c')]:_0x2c0b87[_0xa3dd('0x38')];if(!_0x4dbc50[_0xa3dd('0x3b')][_0xa3dd('0x3f')](_0xa3dd('0x40'))){_0x2e1e47['limit']=qs[_0xa3dd('0x25')](_0x4dbc50[_0xa3dd('0x3b')]['limit']);_0x2e1e47[_0xa3dd('0x23')]=qs['offset'](_0x4dbc50['query'][_0xa3dd('0x23')]);}_0x2e1e47['order']=qs[_0xa3dd('0x41')](_0x4dbc50[_0xa3dd('0x3b')][_0xa3dd('0x41')]);_0x2e1e47[_0xa3dd('0x42')]=qs['filters'](_['pick'](_0x4dbc50[_0xa3dd('0x3b')],_0x2c0b87[_0xa3dd('0x43')]),_0x396637);if(_0x4dbc50['query'][_0xa3dd('0x44')]){_0x2e1e47[_0xa3dd('0x42')]=_[_0xa3dd('0x45')](_0x2e1e47['where'],{'$or':_['map'](_0x396637,function(_0x28b17d){if(_0x28b17d[_0xa3dd('0x36')]!==_0xa3dd('0x46')){var _0x54798c={};_0x54798c[_0x28b17d[_0xa3dd('0x32')]]={'$like':'%'+_0x4dbc50[_0xa3dd('0x3b')][_0xa3dd('0x44')]+'%'};return _0x54798c;}})});}_0x2e1e47=_[_0xa3dd('0x45')]({},_0x2e1e47,_0x4dbc50[_0xa3dd('0x47')]);var _0x220a11={'where':_0x2e1e47[_0xa3dd('0x42')]};return db[_0xa3dd('0x48')]['count'](_0x220a11)[_0xa3dd('0x2d')](function(_0x5253cf){_0x566e75['count']=_0x5253cf;if(_0x4dbc50['query'][_0xa3dd('0x49')]){_0x2e1e47[_0xa3dd('0x4a')]=[{'all':!![]}];}return db[_0xa3dd('0x48')]['findAll'](_0x2e1e47);})['then'](function(_0x2e7544){_0x566e75[_0xa3dd('0x4b')]=_0x2e7544;return _0x566e75;})[_0xa3dd('0x2d')](respondWithFilteredResult(_0x23ad12,_0x2e1e47))[_0xa3dd('0x4c')](handleError(_0x23ad12,null));};exports['show']=function(_0x46ceac,_0x5e5a1c){var _0x1bbcda={'raw':!![],'where':{'id':_0x46ceac['params']['id']}},_0x42b2eb={};_0x42b2eb['model']=_[_0xa3dd('0x39')](db[_0xa3dd('0x48')]['rawAttributes']);_0x42b2eb[_0xa3dd('0x3b')]=_[_0xa3dd('0x39')](_0x46ceac[_0xa3dd('0x3b')]);_0x42b2eb[_0xa3dd('0x43')]=_['intersection'](_0x42b2eb[_0xa3dd('0x38')],_0x42b2eb[_0xa3dd('0x3b')]);_0x1bbcda[_0xa3dd('0x3c')]=_['intersection'](_0x42b2eb['model'],qs['fields'](_0x46ceac[_0xa3dd('0x3b')][_0xa3dd('0x3d')]));_0x1bbcda[_0xa3dd('0x3c')]=_0x1bbcda[_0xa3dd('0x3c')][_0xa3dd('0x3e')]?_0x1bbcda['attributes']:_0x42b2eb[_0xa3dd('0x38')];if(_0x46ceac[_0xa3dd('0x3b')][_0xa3dd('0x49')]){_0x1bbcda['include']=[{'all':!![]}];}_0x1bbcda=_[_0xa3dd('0x45')]({},_0x1bbcda,_0x46ceac['options']);return db[_0xa3dd('0x48')]['find'](_0x1bbcda)[_0xa3dd('0x2d')](handleEntityNotFound(_0x5e5a1c,null))[_0xa3dd('0x2d')](respondWithResult(_0x5e5a1c,null))[_0xa3dd('0x4c')](handleError(_0x5e5a1c,null));};exports['create']=function(_0x234c7e,_0x108b05){return db[_0xa3dd('0x48')][_0xa3dd('0x4d')](_0x234c7e['body'],{})[_0xa3dd('0x2d')](function(_0x2efba0){var _0x3bafc6=_0x234c7e[_0xa3dd('0x4e')][_0xa3dd('0x2f')]({'plain':!![]});if(!_0x3bafc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bafc6[_0xa3dd('0x4f')]===_0xa3dd('0x4e')){var _0x2f9c13=_0x2efba0[_0xa3dd('0x2f')]({'plain':!![]});var _0x231f58=_0xa3dd('0x50');return db[_0xa3dd('0x51')][_0xa3dd('0x52')]({'where':{'name':_0x231f58,'userProfileId':_0x3bafc6[_0xa3dd('0x53')]},'raw':!![]})['then'](function(_0x41f5b4){if(_0x41f5b4&&_0x41f5b4[_0xa3dd('0x54')]===0x0){return db['UserProfileResource'][_0xa3dd('0x4d')]({'name':_0x2f9c13[_0xa3dd('0x32')],'resourceId':_0x2f9c13['id'],'type':_0x41f5b4['name'],'sectionId':_0x41f5b4['id']},{})[_0xa3dd('0x2d')](function(){return _0x2efba0;});}else{return _0x2efba0;}})[_0xa3dd('0x4c')](function(_0x2573cd){logger[_0xa3dd('0x55')](_0xa3dd('0x56'),_0x2573cd);throw _0x2573cd;});}return _0x2efba0;})[_0xa3dd('0x2d')](respondWithResult(_0x108b05,0xc9))['catch'](handleError(_0x108b05,null));};exports['update']=function(_0x6dff7,_0x452cdf){if(_0x6dff7[_0xa3dd('0x57')]['id']){delete _0x6dff7[_0xa3dd('0x57')]['id'];}return db['SmsQueue'][_0xa3dd('0x52')]({'where':{'id':_0x6dff7[_0xa3dd('0x58')]['id']}})[_0xa3dd('0x2d')](handleEntityNotFound(_0x452cdf,null))[_0xa3dd('0x2d')](saveUpdates(_0x6dff7['body'],null))['then'](respondWithResult(_0x452cdf,null))[_0xa3dd('0x4c')](handleError(_0x452cdf,null));};exports[_0xa3dd('0x2e')]=function(_0x3a5d4f,_0x68aad0){return db[_0xa3dd('0x48')]['find']({'where':{'id':_0x3a5d4f['params']['id']}})[_0xa3dd('0x2d')](handleEntityNotFound(_0x68aad0,null))[_0xa3dd('0x2d')](removeEntity(_0x68aad0,null))[_0xa3dd('0x4c')](handleError(_0x68aad0,null));};exports[_0xa3dd('0x59')]=function(_0x5482ce,_0x204136){return db[_0xa3dd('0x48')][_0xa3dd('0x59')]()['then'](respondWithResult(_0x204136,null))[_0xa3dd('0x4c')](handleError(_0x204136,null));};exports[_0xa3dd('0x5a')]=function(_0x5928e8,_0x325aee,_0x303266){var _0x288821={'raw':!![],'where':{}},_0x3cf18f={},_0x14f015;return db[_0xa3dd('0x48')][_0xa3dd('0x5b')]({'where':{'id':_0x5928e8['params']['id']}})[_0xa3dd('0x2d')](handleEntityNotFound(_0x325aee,null))[_0xa3dd('0x2d')](function(_0x80b840){if(_0x80b840){_0x14f015=_0x80b840[_0xa3dd('0x2f')]({'plain':!![]});_0x3cf18f['model']=_[_0xa3dd('0x39')](db['UserSmsQueue'][_0xa3dd('0x35')]);_0x3cf18f[_0xa3dd('0x3b')]=_[_0xa3dd('0x39')](_0x5928e8[_0xa3dd('0x3b')]);_0x3cf18f[_0xa3dd('0x43')]=_[_0xa3dd('0x3a')](_0x3cf18f[_0xa3dd('0x38')],_0x3cf18f[_0xa3dd('0x3b')]);_0x288821[_0xa3dd('0x3c')]=_[_0xa3dd('0x3a')](_0x3cf18f['model'],qs[_0xa3dd('0x3d')](_0x5928e8[_0xa3dd('0x3b')][_0xa3dd('0x3d')]));_0x288821[_0xa3dd('0x3c')]=_0x288821[_0xa3dd('0x3c')]['length']?_0x288821[_0xa3dd('0x3c')]:_0x3cf18f[_0xa3dd('0x38')];if(!_0x5928e8['query'][_0xa3dd('0x3f')]('nolimit')){_0x288821[_0xa3dd('0x25')]=qs['limit'](_0x5928e8['query'][_0xa3dd('0x25')]);_0x288821[_0xa3dd('0x23')]=qs[_0xa3dd('0x23')](_0x5928e8[_0xa3dd('0x3b')]['offset']);}_0x288821[_0xa3dd('0x5c')]=qs[_0xa3dd('0x41')](_0x5928e8[_0xa3dd('0x3b')][_0xa3dd('0x41')]);_0x288821[_0xa3dd('0x42')]=qs[_0xa3dd('0x43')](_['pick'](_0x5928e8[_0xa3dd('0x3b')],_0x3cf18f[_0xa3dd('0x43')]));_0x288821['where'][_0xa3dd('0x5d')]=_0x80b840['id'];if(_0x5928e8[_0xa3dd('0x3b')][_0xa3dd('0x44')]){_0x288821[_0xa3dd('0x42')]=_[_0xa3dd('0x45')](_0x288821[_0xa3dd('0x42')],{'$or':_['map'](_0x288821['attributes'],function(_0x257b0f){var _0x3f66b5={};_0x3f66b5[_0x257b0f]={'$like':'%'+_0x5928e8[_0xa3dd('0x3b')][_0xa3dd('0x44')]+'%'};return _0x3f66b5;})});}_0x288821=_[_0xa3dd('0x45')]({},_0x288821,_0x5928e8[_0xa3dd('0x47')]);return db['UserSmsQueue'][_0xa3dd('0x5e')](_0x288821);}})['then'](function(_0x351960){if(_0x351960){return db['User'][_0xa3dd('0x5f')]({'where':{'id':_[_0xa3dd('0x34')](_0x351960,_0xa3dd('0x60')),'role':_0xa3dd('0x61')},'attributes':['id',_0xa3dd('0x32'),_0xa3dd('0x62'),_0xa3dd('0x63'),_0xa3dd('0x64')]});}})['then'](function(_0x3acf8b){if(_0x3acf8b){return{'count':_0x3acf8b['count'],'rows':_[_0xa3dd('0x34')](_0x3acf8b[_0xa3dd('0x4b')],function(_0x4d88f4){return{'membername':_0x4d88f4[_0xa3dd('0x32')],'UserId':_0x4d88f4['id'],'queue_name':_0x14f015[_0xa3dd('0x32')],'SmsQueueId':_0x14f015['id'],'interface':util[_0xa3dd('0x65')]('%s/%s','SIP',_0x4d88f4[_0xa3dd('0x32')]),'penalty':0x0,'paused':_0x4d88f4['smsPause'],'createdAt':_0x4d88f4[_0xa3dd('0x64')],'updatedAt':_0x4d88f4[_0xa3dd('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa3dd('0x2d')](respondWithFilteredResult(_0x325aee,_0x288821))['catch'](handleError(_0x325aee,null));};exports[_0xa3dd('0x66')]=function(_0x43acac,_0x4a5dcd,_0x239ee7){var _0x324029={};var _0xf9282e={};var _0x52b846;var _0x90dc9a;return db['SmsQueue'][_0xa3dd('0x5b')]({'where':{'id':_0x43acac[_0xa3dd('0x58')]['id']}})['then'](handleEntityNotFound(_0x4a5dcd,null))[_0xa3dd('0x2d')](function(_0x2097d5){if(_0x2097d5){_0x52b846=_0x2097d5;_0xf9282e[_0xa3dd('0x38')]=_[_0xa3dd('0x39')](db[_0xa3dd('0x67')][_0xa3dd('0x35')]);_0xf9282e[_0xa3dd('0x3b')]=_[_0xa3dd('0x39')](_0x43acac['query']);_0xf9282e['filters']=_['intersection'](_0xf9282e[_0xa3dd('0x38')],_0xf9282e[_0xa3dd('0x3b')]);_0x324029['attributes']=_[_0xa3dd('0x3a')](_0xf9282e[_0xa3dd('0x38')],qs[_0xa3dd('0x3d')](_0x43acac['query'][_0xa3dd('0x3d')]));_0x324029[_0xa3dd('0x3c')]=_0x324029[_0xa3dd('0x3c')]['length']?_0x324029[_0xa3dd('0x3c')]:_0xf9282e[_0xa3dd('0x38')];_0x324029[_0xa3dd('0x5c')]=qs[_0xa3dd('0x41')](_0x43acac[_0xa3dd('0x3b')][_0xa3dd('0x41')]);_0x324029['where']=qs[_0xa3dd('0x43')](_['pick'](_0x43acac[_0xa3dd('0x3b')],_0xf9282e[_0xa3dd('0x43')]));if(_0x43acac[_0xa3dd('0x3b')][_0xa3dd('0x44')]){_0x324029[_0xa3dd('0x42')]=_[_0xa3dd('0x45')](_0x324029[_0xa3dd('0x42')],{'$or':_['map'](_0x324029['attributes'],function(_0x42d295){var _0x21204e={};_0x21204e[_0x42d295]={'$like':'%'+_0x43acac['query'][_0xa3dd('0x44')]+'%'};return _0x21204e;})});}_0x324029=_['merge']({},_0x324029,_0x43acac[_0xa3dd('0x47')]);return _0x52b846[_0xa3dd('0x66')](_0x324029);}})[_0xa3dd('0x2d')](function(_0x2c78c2){if(_0x2c78c2){_0x90dc9a=_0x2c78c2['length'];if(!_0x43acac[_0xa3dd('0x3b')][_0xa3dd('0x3f')](_0xa3dd('0x40'))){_0x324029[_0xa3dd('0x25')]=qs[_0xa3dd('0x25')](_0x43acac[_0xa3dd('0x3b')][_0xa3dd('0x25')]);_0x324029[_0xa3dd('0x23')]=qs['offset'](_0x43acac[_0xa3dd('0x3b')][_0xa3dd('0x23')]);}return _0x52b846[_0xa3dd('0x66')](_0x324029);}})[_0xa3dd('0x2d')](function(_0x2db102){if(_0x2db102){return _0x2db102?{'count':_0x90dc9a,'rows':_0x2db102}:null;}})['then'](respondWithResult(_0x4a5dcd,null))[_0xa3dd('0x4c')](handleError(_0x4a5dcd,null));};exports[_0xa3dd('0x68')]=function(_0x558194,_0x310c39,_0x1bd64d){var _0x195a74=_0x558194['body'][_0xa3dd('0x69')];return db['Team']['findAll']({'where':{'id':_0x195a74},'attributes':['id'],'include':[{'model':db[_0xa3dd('0x6a')],'as':_0xa3dd('0x6b'),'attributes':['id',_0xa3dd('0x32'),_0xa3dd('0x6c'),_0xa3dd('0x6d'),_0xa3dd('0x6e')],'raw':!![]}]})[_0xa3dd('0x2d')](function(_0x2d909d){if(_0x2d909d){var _0x57ea8b=_[_0xa3dd('0x6f')](_0x2d909d,function(_0x1d5d86){var _0x40eeb9=_0x1d5d86[_0xa3dd('0x2f')]({'plain':!![]});return _0x40eeb9['Agents'];});return db[_0xa3dd('0x48')][_0xa3dd('0x52')]({'where':{'id':_0x558194['params']['id']}})[_0xa3dd('0x2d')](function(_0x306837){return db['sequelize'][_0xa3dd('0x70')](function(_0x946b44){return _0x306837[_0xa3dd('0x68')](_0x195a74,{'transaction':_0x946b44})[_0xa3dd('0x2d')](function(){return BPromise[_0xa3dd('0x71')](_0x57ea8b,function(_0x424e1d){return db[_0xa3dd('0x72')][_0xa3dd('0x73')]({'where':{'UserId':_0x424e1d['id'],'SmsQueueId':_0x558194['params']['id']},'transaction':_0x946b44});});})[_0xa3dd('0x2d')](function(){_0x57ea8b['forEach'](function(_0x86477f){socket[_0xa3dd('0x74')](_0xa3dd('0x75'),{'UserId':_0x86477f['id'],'SmsQueueId':_0x306837['id']});});});});});}})[_0xa3dd('0x2d')](respondWithStatusCode(_0x310c39,null))[_0xa3dd('0x4c')](handleError(_0x310c39,null));};exports[_0xa3dd('0x76')]=function(_0x50b217,_0x588a2a,_0x5e37a6){return db[_0xa3dd('0x67')][_0xa3dd('0x5e')]({'where':{'id':_0x50b217[_0xa3dd('0x3b')][_0xa3dd('0x69')]},'attributes':['id'],'include':[{'model':db[_0xa3dd('0x6a')],'as':_0xa3dd('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x588a2a,null))['then'](function(_0x16cdca){var _0x2a10c4=_['map'](_0x16cdca,'id');var _0x5758fc=[];var _0x4b4417=[];var _0xad2f7=squel[_0xa3dd('0x77')]();_0xad2f7[_0xa3dd('0x78')](_0xa3dd('0x79'))[_0xa3dd('0x7a')](_0xa3dd('0x7b'),'tq')['join'](_0xa3dd('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa3dd('0x42')](_0xa3dd('0x7d'),_0x50b217['params']['id']);for(var _0x3e1645=0x0;_0x3e1645<_0x16cdca[_0xa3dd('0x3e')];_0x3e1645+=0x1){let _0x5ee87e=_0x16cdca[_0x3e1645];for(var _0x37a112=0x0;_0x37a112<_0x5ee87e[_0xa3dd('0x6b')]['length'];_0x37a112+=0x1){let _0x29ce90=_0x5ee87e[_0xa3dd('0x6b')][_0x37a112];var _0x4a2993=_0xad2f7[_0xa3dd('0x7e')]();_0x4a2993['where'](_0xa3dd('0x7f'),_0x29ce90['id']);_0x4b4417[_0xa3dd('0x80')](db[_0xa3dd('0x81')][_0xa3dd('0x3b')](_0x4a2993[_0xa3dd('0x82')](),{'type':db[_0xa3dd('0x81')][_0xa3dd('0x83')][_0xa3dd('0x84')]})[_0xa3dd('0x2d')](function(_0x476c21){if(_0x476c21[_0xa3dd('0x3e')]===0x1){return _0x29ce90['id'];}else{var _0x2a19ac=_[_0xa3dd('0x85')](_[_0xa3dd('0x34')](_0x476c21,_0xa3dd('0x86')),function(_0x91b339){return _[_0xa3dd('0x87')](_0x2a10c4,_0x91b339);});if(_0x2a19ac){return _0x29ce90['id'];}}}));}}return BPromise[_0xa3dd('0x88')](_0x4b4417)[_0xa3dd('0x2d')](function(_0x4e45e6){_0x5758fc=_(_0x5758fc)[_0xa3dd('0x89')](_0x4e45e6)['compact']()['value']();return db[_0xa3dd('0x48')][_0xa3dd('0x52')]({'where':{'id':_0x50b217[_0xa3dd('0x58')]['id']}})[_0xa3dd('0x2d')](function(_0x7a4ca){return db[_0xa3dd('0x81')]['transaction'](function(_0x45ed8f){return _0x7a4ca[_0xa3dd('0x76')](_0x50b217[_0xa3dd('0x3b')][_0xa3dd('0x69')],{'transaction':_0x45ed8f})['then'](function(){if(!_[_0xa3dd('0x8a')](_0x5758fc)){return _0x7a4ca['removeAgents'](_0x5758fc,{'transaction':_0x45ed8f});}})[_0xa3dd('0x2d')](function(){_0x5758fc[_0xa3dd('0x8b')](function(_0x895726){socket[_0xa3dd('0x74')]('userSmsQueue:remove',{'UserId':_0x895726,'SmsQueueId':_0x7a4ca['id']});});});});});});})[_0xa3dd('0x2d')](respondWithStatusCode(_0x588a2a,null))['catch'](handleError(_0x588a2a,null));};exports['addAgents']=function(_0x4b9baf,_0x10fd80,_0x445e3b){return db['SmsQueue']['find']({'where':{'id':_0x4b9baf[_0xa3dd('0x58')]['id']}})['then'](handleEntityNotFound(_0x10fd80,null))[_0xa3dd('0x2d')](function(_0x4b142f){if(_0x4b142f){return _0x4b142f[_0xa3dd('0x8c')](_0x4b9baf[_0xa3dd('0x57')][_0xa3dd('0x69')],_[_0xa3dd('0x8d')](_0x4b9baf[_0xa3dd('0x57')],['ids','id'])||{})[_0xa3dd('0x8e')](function(_0x3cc727){for(var _0x122cab=0x0;_0x122cab<_0x4b9baf['body'][_0xa3dd('0x69')][_0xa3dd('0x3e')];_0x122cab+=0x1){socket[_0xa3dd('0x74')]('userSmsQueue:save',{'UserId':Number(_0x4b9baf[_0xa3dd('0x57')]['ids'][_0x122cab]),'SmsQueueId':Number(_0x4b9baf[_0xa3dd('0x58')]['id'])});}return _0x3cc727;});}})[_0xa3dd('0x2d')](respondWithResult(_0x10fd80,null))[_0xa3dd('0x4c')](handleError(_0x10fd80,null));};exports[_0xa3dd('0x8f')]=function(_0x6b1dbb,_0x22a557,_0x5d68b3){return db[_0xa3dd('0x48')][_0xa3dd('0x52')]({'where':{'id':_0x6b1dbb[_0xa3dd('0x58')]['id']}})['then'](handleEntityNotFound(_0x22a557,null))['then'](function(_0x3cdc8d){if(_0x3cdc8d){return _0x3cdc8d[_0xa3dd('0x8f')](_0x6b1dbb['query'][_0xa3dd('0x69')])['then'](function(){if(_[_0xa3dd('0x90')](_0x6b1dbb[_0xa3dd('0x3b')][_0xa3dd('0x69')])){for(var _0x29c63c=0x0;_0x29c63c<_0x6b1dbb['query']['ids'][_0xa3dd('0x3e')];_0x29c63c+=0x1){socket[_0xa3dd('0x74')](_0xa3dd('0x91'),{'UserId':Number(_0x6b1dbb[_0xa3dd('0x3b')][_0xa3dd('0x69')][_0x29c63c]),'SmsQueueId':Number(_0x6b1dbb[_0xa3dd('0x58')]['id'])});}}else{socket[_0xa3dd('0x74')](_0xa3dd('0x91'),{'UserId':Number(_0x6b1dbb[_0xa3dd('0x3b')][_0xa3dd('0x69')]),'SmsQueueId':Number(_0x6b1dbb[_0xa3dd('0x58')]['id'])});}});}})[_0xa3dd('0x2d')](respondWithStatusCode(_0x22a557,null))[_0xa3dd('0x4c')](handleError(_0x22a557,null));};exports[_0xa3dd('0x92')]=function(_0x4fa7b1,_0x3f6f25,_0x2e3dda){var _0x125c72={};var _0x320491={};var _0x3b87b1;var _0x318909;return db[_0xa3dd('0x48')][_0xa3dd('0x5b')]({'where':{'id':_0x4fa7b1[_0xa3dd('0x58')]['id']}})['then'](handleEntityNotFound(_0x3f6f25,null))[_0xa3dd('0x2d')](function(_0x28ee10){if(_0x28ee10){_0x3b87b1=_0x28ee10;_0x320491['model']=_[_0xa3dd('0x39')](db['User'][_0xa3dd('0x35')]);_0x320491[_0xa3dd('0x3b')]=_[_0xa3dd('0x39')](_0x4fa7b1[_0xa3dd('0x3b')]);_0x320491[_0xa3dd('0x43')]=_[_0xa3dd('0x3a')](_0x320491[_0xa3dd('0x38')],_0x320491[_0xa3dd('0x3b')]);_0x125c72['attributes']=_[_0xa3dd('0x3a')](_0x320491[_0xa3dd('0x38')],qs['fields'](_0x4fa7b1[_0xa3dd('0x3b')][_0xa3dd('0x3d')]));_0x125c72[_0xa3dd('0x3c')]=_0x125c72[_0xa3dd('0x3c')][_0xa3dd('0x3e')]?_0x125c72[_0xa3dd('0x3c')]:_0x320491['model'];_0x125c72[_0xa3dd('0x5c')]=qs[_0xa3dd('0x41')](_0x4fa7b1['query']['sort']);_0x125c72[_0xa3dd('0x42')]=qs[_0xa3dd('0x43')](_[_0xa3dd('0x93')](_0x4fa7b1[_0xa3dd('0x3b')],_0x320491[_0xa3dd('0x43')]));if(_0x4fa7b1[_0xa3dd('0x3b')][_0xa3dd('0x44')]){_0x125c72[_0xa3dd('0x42')]=_['merge'](_0x125c72[_0xa3dd('0x42')],{'$or':_['map'](_0x125c72[_0xa3dd('0x3c')],function(_0x204f7a){var _0x1fd9a9={};_0x1fd9a9[_0x204f7a]={'$like':'%'+_0x4fa7b1[_0xa3dd('0x3b')][_0xa3dd('0x44')]+'%'};return _0x1fd9a9;})});}_0x125c72=_['merge']({},_0x125c72,_0x4fa7b1['options']);return _0x3b87b1[_0xa3dd('0x92')](_0x125c72);}})['then'](function(_0x176d88){if(_0x176d88){_0x318909=_0x176d88[_0xa3dd('0x3e')];if(!_0x4fa7b1[_0xa3dd('0x3b')][_0xa3dd('0x3f')]('nolimit')){_0x125c72['limit']=qs[_0xa3dd('0x25')](_0x4fa7b1['query'][_0xa3dd('0x25')]);_0x125c72[_0xa3dd('0x23')]=qs[_0xa3dd('0x23')](_0x4fa7b1['query'][_0xa3dd('0x23')]);}return _0x3b87b1['getAgents'](_0x125c72);}})['then'](function(_0x1efb98){if(_0x1efb98){return _0x1efb98?{'count':_0x318909,'rows':_0x1efb98}:null;}})[_0xa3dd('0x2d')](respondWithResult(_0x3f6f25,null))['catch'](handleError(_0x3f6f25,null));}; \ No newline at end of file +var _0x8e2b=['userSmsQueue:save','Agents','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','get','SmsQueues','destroy','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','order','addTeams','ids','voicePause','interface','sequelize','each','findOrCreate','forEach','emit'];(function(_0x1441ca,_0x54d819){var _0x169c8d=function(_0x59b79d){while(--_0x59b79d){_0x1441ca['push'](_0x1441ca['shift']());}};_0x169c8d(++_0x54d819);}(_0x8e2b,0xb2));var _0xb8e2=function(_0x96afa0,_0x5269b9){_0x96afa0=_0x96afa0-0x0;var _0x234209=_0x8e2b[_0x96afa0];return _0x234209;};'use strict';var emlformat=require(_0xb8e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8e2('0x1'));var jsonpatch=require(_0xb8e2('0x2'));var rp=require('request-promise');var moment=require(_0xb8e2('0x3'));var BPromise=require(_0xb8e2('0x4'));var Mustache=require(_0xb8e2('0x5'));var util=require(_0xb8e2('0x6'));var path=require(_0xb8e2('0x7'));var sox=require(_0xb8e2('0x8'));var csv=require(_0xb8e2('0x9'));var ejs=require(_0xb8e2('0xa'));var fs=require('fs');var fs_extra=require(_0xb8e2('0xb'));var _=require(_0xb8e2('0xc'));var squel=require(_0xb8e2('0xd'));var crypto=require(_0xb8e2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb8e2('0xf'));var toCsv=require(_0xb8e2('0x9'));var querystring=require(_0xb8e2('0x10'));var Papa=require(_0xb8e2('0x11'));var Redis=require(_0xb8e2('0x12'));var authService=require(_0xb8e2('0x13'));var qs=require(_0xb8e2('0x14'));var as=require(_0xb8e2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8e2('0x16'))(_0xb8e2('0x17'));var utils=require('../../config/utils');var config=require(_0xb8e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8e2('0x19'))['db'];config[_0xb8e2('0x1a')]=_['defaults'](config[_0xb8e2('0x1a')],{'host':_0xb8e2('0x1b'),'port':0x18eb});var socket=require(_0xb8e2('0x1c'))(new Redis(config[_0xb8e2('0x1a')]));require(_0xb8e2('0x1d'))[_0xb8e2('0x1e')](socket);function respondWithStatusCode(_0x208479,_0x15659f){_0x15659f=_0x15659f||0xcc;return function(_0x2f1988){if(_0x2f1988){return _0x208479[_0xb8e2('0x1f')](_0x15659f);}return _0x208479[_0xb8e2('0x20')](_0x15659f)['end']();};}function respondWithResult(_0xb93f4a,_0x4e681a){_0x4e681a=_0x4e681a||0xc8;return function(_0x5b24fc){if(_0x5b24fc){return _0xb93f4a['status'](_0x4e681a)[_0xb8e2('0x21')](_0x5b24fc);}};}function respondWithFilteredResult(_0x15ffdb,_0x1745e5){return function(_0x5b7d77){if(_0x5b7d77){var _0x5b2873=typeof _0x1745e5[_0xb8e2('0x22')]===_0xb8e2('0x23')&&typeof _0x1745e5[_0xb8e2('0x24')]===_0xb8e2('0x23');var _0x1ce564=_0x5b7d77[_0xb8e2('0x25')];var _0x14f72b=_0x5b2873?0x0:_0x1745e5[_0xb8e2('0x22')];var _0x4bd575=_0x5b2873?_0x5b7d77[_0xb8e2('0x25')]:_0x1745e5[_0xb8e2('0x22')]+_0x1745e5['limit'];var _0x5502d0;if(_0x4bd575>=_0x1ce564){_0x4bd575=_0x1ce564;_0x5502d0=0xc8;}else{_0x5502d0=0xce;}_0x15ffdb[_0xb8e2('0x20')](_0x5502d0);return _0x15ffdb[_0xb8e2('0x26')]('Content-Range',_0x14f72b+'-'+_0x4bd575+'/'+_0x1ce564)['json'](_0x5b7d77);}return null;};}function patchUpdates(_0x9789c6){return function(_0x5e4a33){try{jsonpatch[_0xb8e2('0x27')](_0x5e4a33,_0x9789c6,!![]);}catch(_0x5771c0){return BPromise[_0xb8e2('0x28')](_0x5771c0);}return _0x5e4a33['save']();};}function saveUpdates(_0x1df0c5,_0x4f68b4){return function(_0xda3375){if(_0xda3375){return _0xda3375[_0xb8e2('0x29')](_0x1df0c5)[_0xb8e2('0x2a')](function(_0x16a5f3){return _0x16a5f3;});}return null;};}function removeEntity(_0x468004,_0x435667){return function(_0x3af5e0){if(_0x3af5e0){return _0x3af5e0['destroy']()[_0xb8e2('0x2a')](function(){var _0x4b7198=_0x3af5e0[_0xb8e2('0x2b')]({'plain':!![]});var _0x2728e3=_0xb8e2('0x2c');return db['UserProfileResource'][_0xb8e2('0x2d')]({'where':{'type':_0x2728e3,'resourceId':_0x4b7198['id']}})['then'](function(){return _0x3af5e0;});})['then'](function(){_0x468004[_0xb8e2('0x20')](0xcc)[_0xb8e2('0x2e')]();});}};}function handleEntityNotFound(_0x46e1aa,_0x3332b8){return function(_0x268e5c){if(!_0x268e5c){_0x46e1aa[_0xb8e2('0x1f')](0x194);}return _0x268e5c;};}function handleError(_0x144275,_0x5b77fd){_0x5b77fd=_0x5b77fd||0x1f4;return function(_0x2b0629){logger[_0xb8e2('0x2f')](_0x2b0629[_0xb8e2('0x30')]);if(_0x2b0629['name']){delete _0x2b0629[_0xb8e2('0x31')];}_0x144275[_0xb8e2('0x20')](_0x5b77fd)[_0xb8e2('0x32')](_0x2b0629);};}exports[_0xb8e2('0x33')]=function(_0x364d1e,_0x4107fe){var _0x872a1f={},_0x1c17ba={},_0x4f5e78={'count':0x0,'rows':[]};var _0x222565=_[_0xb8e2('0x34')](db[_0xb8e2('0x35')][_0xb8e2('0x36')],function(_0x56e75e){return{'name':_0x56e75e['fieldName'],'type':_0x56e75e[_0xb8e2('0x37')][_0xb8e2('0x38')]};});_0x1c17ba[_0xb8e2('0x39')]=_[_0xb8e2('0x34')](_0x222565,_0xb8e2('0x31'));_0x1c17ba[_0xb8e2('0x3a')]=_['keys'](_0x364d1e[_0xb8e2('0x3a')]);_0x1c17ba[_0xb8e2('0x3b')]=_[_0xb8e2('0x3c')](_0x1c17ba[_0xb8e2('0x39')],_0x1c17ba[_0xb8e2('0x3a')]);_0x872a1f['attributes']=_['intersection'](_0x1c17ba[_0xb8e2('0x39')],qs[_0xb8e2('0x3d')](_0x364d1e['query'][_0xb8e2('0x3d')]));_0x872a1f[_0xb8e2('0x3e')]=_0x872a1f[_0xb8e2('0x3e')][_0xb8e2('0x3f')]?_0x872a1f[_0xb8e2('0x3e')]:_0x1c17ba['model'];if(!_0x364d1e[_0xb8e2('0x3a')]['hasOwnProperty']('nolimit')){_0x872a1f[_0xb8e2('0x24')]=qs[_0xb8e2('0x24')](_0x364d1e['query'][_0xb8e2('0x24')]);_0x872a1f[_0xb8e2('0x22')]=qs[_0xb8e2('0x22')](_0x364d1e[_0xb8e2('0x3a')][_0xb8e2('0x22')]);}_0x872a1f['order']=qs[_0xb8e2('0x40')](_0x364d1e['query'][_0xb8e2('0x40')]);_0x872a1f[_0xb8e2('0x41')]=qs[_0xb8e2('0x3b')](_[_0xb8e2('0x42')](_0x364d1e['query'],_0x1c17ba['filters']),_0x222565);if(_0x364d1e[_0xb8e2('0x3a')]['filter']){_0x872a1f['where']=_[_0xb8e2('0x43')](_0x872a1f[_0xb8e2('0x41')],{'$or':_[_0xb8e2('0x34')](_0x222565,function(_0x26ea5f){if(_0x26ea5f['type']!==_0xb8e2('0x44')){var _0x2ea9c2={};_0x2ea9c2[_0x26ea5f[_0xb8e2('0x31')]]={'$like':'%'+_0x364d1e[_0xb8e2('0x3a')][_0xb8e2('0x45')]+'%'};return _0x2ea9c2;}})});}_0x872a1f=_[_0xb8e2('0x43')]({},_0x872a1f,_0x364d1e[_0xb8e2('0x46')]);var _0xf587b8={'where':_0x872a1f[_0xb8e2('0x41')]};return db[_0xb8e2('0x35')]['count'](_0xf587b8)[_0xb8e2('0x2a')](function(_0x5b2789){_0x4f5e78['count']=_0x5b2789;if(_0x364d1e[_0xb8e2('0x3a')][_0xb8e2('0x47')]){_0x872a1f[_0xb8e2('0x48')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x872a1f);})[_0xb8e2('0x2a')](function(_0x39f7a7){_0x4f5e78[_0xb8e2('0x49')]=_0x39f7a7;return _0x4f5e78;})[_0xb8e2('0x2a')](respondWithFilteredResult(_0x4107fe,_0x872a1f))[_0xb8e2('0x4a')](handleError(_0x4107fe,null));};exports[_0xb8e2('0x4b')]=function(_0x4a7924,_0x40bd3a){var _0x484964={'raw':!![],'where':{'id':_0x4a7924[_0xb8e2('0x4c')]['id']}},_0x520b73={};_0x520b73[_0xb8e2('0x39')]=_[_0xb8e2('0x4d')](db['SmsQueue'][_0xb8e2('0x36')]);_0x520b73['query']=_[_0xb8e2('0x4d')](_0x4a7924['query']);_0x520b73[_0xb8e2('0x3b')]=_['intersection'](_0x520b73[_0xb8e2('0x39')],_0x520b73[_0xb8e2('0x3a')]);_0x484964[_0xb8e2('0x3e')]=_['intersection'](_0x520b73[_0xb8e2('0x39')],qs[_0xb8e2('0x3d')](_0x4a7924['query'][_0xb8e2('0x3d')]));_0x484964['attributes']=_0x484964[_0xb8e2('0x3e')][_0xb8e2('0x3f')]?_0x484964[_0xb8e2('0x3e')]:_0x520b73['model'];if(_0x4a7924[_0xb8e2('0x3a')][_0xb8e2('0x47')]){_0x484964[_0xb8e2('0x48')]=[{'all':!![]}];}_0x484964=_['merge']({},_0x484964,_0x4a7924[_0xb8e2('0x46')]);return db[_0xb8e2('0x35')][_0xb8e2('0x4e')](_0x484964)[_0xb8e2('0x2a')](handleEntityNotFound(_0x40bd3a,null))[_0xb8e2('0x2a')](respondWithResult(_0x40bd3a,null))[_0xb8e2('0x4a')](handleError(_0x40bd3a,null));};exports['create']=function(_0x2e7a75,_0x4d136){return db[_0xb8e2('0x35')][_0xb8e2('0x4f')](_0x2e7a75[_0xb8e2('0x50')],{})[_0xb8e2('0x2a')](function(_0x54f412){var _0x24fa15=_0x2e7a75[_0xb8e2('0x51')]['get']({'plain':!![]});if(!_0x24fa15)throw new Error(_0xb8e2('0x52'));if(_0x24fa15[_0xb8e2('0x53')]==='user'){var _0x10434a=_0x54f412['get']({'plain':!![]});var _0x4a5e58=_0xb8e2('0x2c');return db[_0xb8e2('0x54')][_0xb8e2('0x4e')]({'where':{'name':_0x4a5e58,'userProfileId':_0x24fa15[_0xb8e2('0x55')]},'raw':!![]})['then'](function(_0x40f8e4){if(_0x40f8e4&&_0x40f8e4[_0xb8e2('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x10434a['name'],'resourceId':_0x10434a['id'],'type':_0x40f8e4[_0xb8e2('0x31')],'sectionId':_0x40f8e4['id']},{})[_0xb8e2('0x2a')](function(){return _0x54f412;});}else{return _0x54f412;}})[_0xb8e2('0x4a')](function(_0xf66d5){logger[_0xb8e2('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf66d5);throw _0xf66d5;});}return _0x54f412;})[_0xb8e2('0x2a')](respondWithResult(_0x4d136,0xc9))[_0xb8e2('0x4a')](handleError(_0x4d136,null));};exports['update']=function(_0x289b6a,_0x19ae3a){if(_0x289b6a[_0xb8e2('0x50')]['id']){delete _0x289b6a[_0xb8e2('0x50')]['id'];}return db['SmsQueue'][_0xb8e2('0x4e')]({'where':{'id':_0x289b6a[_0xb8e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x19ae3a,null))[_0xb8e2('0x2a')](saveUpdates(_0x289b6a[_0xb8e2('0x50')],null))['then'](respondWithResult(_0x19ae3a,null))[_0xb8e2('0x4a')](handleError(_0x19ae3a,null));};exports['destroy']=function(_0x50be41,_0x2cb087){return db[_0xb8e2('0x35')]['find']({'where':{'id':_0x50be41[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0x2cb087,null))[_0xb8e2('0x2a')](removeEntity(_0x2cb087,null))[_0xb8e2('0x4a')](handleError(_0x2cb087,null));};exports[_0xb8e2('0x57')]=function(_0x5732af,_0x3d35bd){return db[_0xb8e2('0x35')][_0xb8e2('0x57')]()[_0xb8e2('0x2a')](respondWithResult(_0x3d35bd,null))[_0xb8e2('0x4a')](handleError(_0x3d35bd,null));};exports[_0xb8e2('0x58')]=function(_0x92c8af,_0x30e9b9,_0x37c3b8){var _0x4bd89f={'raw':!![],'where':{}},_0x121c25={},_0x387a8f;return db[_0xb8e2('0x35')][_0xb8e2('0x59')]({'where':{'id':_0x92c8af[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0x30e9b9,null))[_0xb8e2('0x2a')](function(_0x50573a){if(_0x50573a){_0x387a8f=_0x50573a[_0xb8e2('0x2b')]({'plain':!![]});_0x121c25[_0xb8e2('0x39')]=_[_0xb8e2('0x4d')](db[_0xb8e2('0x5a')][_0xb8e2('0x36')]);_0x121c25[_0xb8e2('0x3a')]=_['keys'](_0x92c8af[_0xb8e2('0x3a')]);_0x121c25[_0xb8e2('0x3b')]=_['intersection'](_0x121c25[_0xb8e2('0x39')],_0x121c25[_0xb8e2('0x3a')]);_0x4bd89f[_0xb8e2('0x3e')]=_[_0xb8e2('0x3c')](_0x121c25[_0xb8e2('0x39')],qs[_0xb8e2('0x3d')](_0x92c8af[_0xb8e2('0x3a')][_0xb8e2('0x3d')]));_0x4bd89f[_0xb8e2('0x3e')]=_0x4bd89f[_0xb8e2('0x3e')]['length']?_0x4bd89f['attributes']:_0x121c25['model'];if(!_0x92c8af[_0xb8e2('0x3a')][_0xb8e2('0x5b')]('nolimit')){_0x4bd89f['limit']=qs['limit'](_0x92c8af[_0xb8e2('0x3a')]['limit']);_0x4bd89f[_0xb8e2('0x22')]=qs[_0xb8e2('0x22')](_0x92c8af['query'][_0xb8e2('0x22')]);}_0x4bd89f['order']=qs[_0xb8e2('0x40')](_0x92c8af[_0xb8e2('0x3a')][_0xb8e2('0x40')]);_0x4bd89f[_0xb8e2('0x41')]=qs['filters'](_[_0xb8e2('0x42')](_0x92c8af[_0xb8e2('0x3a')],_0x121c25[_0xb8e2('0x3b')]));_0x4bd89f['where'][_0xb8e2('0x5c')]=_0x50573a['id'];if(_0x92c8af['query'][_0xb8e2('0x45')]){_0x4bd89f['where']=_[_0xb8e2('0x43')](_0x4bd89f[_0xb8e2('0x41')],{'$or':_[_0xb8e2('0x34')](_0x4bd89f['attributes'],function(_0x7f6182){var _0x3c97bc={};_0x3c97bc[_0x7f6182]={'$like':'%'+_0x92c8af[_0xb8e2('0x3a')][_0xb8e2('0x45')]+'%'};return _0x3c97bc;})});}_0x4bd89f=_[_0xb8e2('0x43')]({},_0x4bd89f,_0x92c8af['options']);return db[_0xb8e2('0x5a')][_0xb8e2('0x5d')](_0x4bd89f);}})['then'](function(_0x533b01){if(_0x533b01){return db[_0xb8e2('0x5e')]['findAndCountAll']({'where':{'id':_[_0xb8e2('0x34')](_0x533b01,_0xb8e2('0x5f')),'role':_0xb8e2('0x60')},'attributes':['id',_0xb8e2('0x31'),_0xb8e2('0x61'),_0xb8e2('0x62'),_0xb8e2('0x63')]});}})['then'](function(_0x2cdaad){if(_0x2cdaad){return{'count':_0x2cdaad['count'],'rows':_[_0xb8e2('0x34')](_0x2cdaad[_0xb8e2('0x49')],function(_0x24b14f){return{'membername':_0x24b14f[_0xb8e2('0x31')],'UserId':_0x24b14f['id'],'queue_name':_0x387a8f[_0xb8e2('0x31')],'SmsQueueId':_0x387a8f['id'],'interface':util['format'](_0xb8e2('0x64'),_0xb8e2('0x65'),_0x24b14f[_0xb8e2('0x31')]),'penalty':0x0,'paused':_0x24b14f[_0xb8e2('0x61')],'createdAt':_0x24b14f[_0xb8e2('0x63')],'updatedAt':_0x24b14f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb8e2('0x2a')](respondWithFilteredResult(_0x30e9b9,_0x4bd89f))['catch'](handleError(_0x30e9b9,null));};exports[_0xb8e2('0x66')]=function(_0x264212,_0x15b060,_0x8184a6){var _0x3d8e00={};var _0x180569={};var _0x27af85;var _0x1b075e;return db[_0xb8e2('0x35')][_0xb8e2('0x59')]({'where':{'id':_0x264212[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0x15b060,null))[_0xb8e2('0x2a')](function(_0xd984b2){if(_0xd984b2){_0x27af85=_0xd984b2;_0x180569[_0xb8e2('0x39')]=_[_0xb8e2('0x4d')](db[_0xb8e2('0x67')]['rawAttributes']);_0x180569[_0xb8e2('0x3a')]=_[_0xb8e2('0x4d')](_0x264212[_0xb8e2('0x3a')]);_0x180569[_0xb8e2('0x3b')]=_[_0xb8e2('0x3c')](_0x180569['model'],_0x180569[_0xb8e2('0x3a')]);_0x3d8e00[_0xb8e2('0x3e')]=_[_0xb8e2('0x3c')](_0x180569[_0xb8e2('0x39')],qs['fields'](_0x264212[_0xb8e2('0x3a')][_0xb8e2('0x3d')]));_0x3d8e00[_0xb8e2('0x3e')]=_0x3d8e00[_0xb8e2('0x3e')][_0xb8e2('0x3f')]?_0x3d8e00[_0xb8e2('0x3e')]:_0x180569[_0xb8e2('0x39')];_0x3d8e00[_0xb8e2('0x68')]=qs['sort'](_0x264212[_0xb8e2('0x3a')]['sort']);_0x3d8e00['where']=qs['filters'](_[_0xb8e2('0x42')](_0x264212[_0xb8e2('0x3a')],_0x180569[_0xb8e2('0x3b')]));if(_0x264212[_0xb8e2('0x3a')][_0xb8e2('0x45')]){_0x3d8e00[_0xb8e2('0x41')]=_[_0xb8e2('0x43')](_0x3d8e00['where'],{'$or':_['map'](_0x3d8e00[_0xb8e2('0x3e')],function(_0x354585){var _0x2ec3a9={};_0x2ec3a9[_0x354585]={'$like':'%'+_0x264212[_0xb8e2('0x3a')][_0xb8e2('0x45')]+'%'};return _0x2ec3a9;})});}_0x3d8e00=_[_0xb8e2('0x43')]({},_0x3d8e00,_0x264212[_0xb8e2('0x46')]);return _0x27af85['getTeams'](_0x3d8e00);}})['then'](function(_0x146e6e){if(_0x146e6e){_0x1b075e=_0x146e6e['length'];if(!_0x264212[_0xb8e2('0x3a')][_0xb8e2('0x5b')]('nolimit')){_0x3d8e00[_0xb8e2('0x24')]=qs['limit'](_0x264212['query'][_0xb8e2('0x24')]);_0x3d8e00[_0xb8e2('0x22')]=qs[_0xb8e2('0x22')](_0x264212[_0xb8e2('0x3a')]['offset']);}return _0x27af85[_0xb8e2('0x66')](_0x3d8e00);}})['then'](function(_0xb02caf){if(_0xb02caf){return _0xb02caf?{'count':_0x1b075e,'rows':_0xb02caf}:null;}})[_0xb8e2('0x2a')](respondWithResult(_0x15b060,null))[_0xb8e2('0x4a')](handleError(_0x15b060,null));};exports[_0xb8e2('0x69')]=function(_0x4165b2,_0x2f578f,_0x26c6f5){var _0x115a97=_0x4165b2['body'][_0xb8e2('0x6a')];return db[_0xb8e2('0x67')][_0xb8e2('0x5d')]({'where':{'id':_0x115a97},'attributes':['id'],'include':[{'model':db[_0xb8e2('0x5e')],'as':'Agents','attributes':['id',_0xb8e2('0x31'),'online',_0xb8e2('0x6b'),_0xb8e2('0x6c')],'raw':!![]}]})[_0xb8e2('0x2a')](function(_0xc58f33){if(_0xc58f33){var _0x11d7bf=_['flatMap'](_0xc58f33,function(_0x30f05e){var _0x3e5fcf=_0x30f05e['get']({'plain':!![]});return _0x3e5fcf['Agents'];});return db[_0xb8e2('0x35')][_0xb8e2('0x4e')]({'where':{'id':_0x4165b2[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](function(_0x420748){return db[_0xb8e2('0x6d')]['transaction'](function(_0x3d2e22){return _0x420748['addTeams'](_0x115a97,{'transaction':_0x3d2e22})[_0xb8e2('0x2a')](function(){return BPromise[_0xb8e2('0x6e')](_0x11d7bf,function(_0x516900){return db[_0xb8e2('0x5a')][_0xb8e2('0x6f')]({'where':{'UserId':_0x516900['id'],'SmsQueueId':_0x4165b2['params']['id']},'transaction':_0x3d2e22});});})[_0xb8e2('0x2a')](function(){_0x11d7bf[_0xb8e2('0x70')](function(_0xfb75b4){socket[_0xb8e2('0x71')](_0xb8e2('0x72'),{'UserId':_0xfb75b4['id'],'SmsQueueId':_0x420748['id']});});});});});}})[_0xb8e2('0x2a')](respondWithStatusCode(_0x2f578f,null))['catch'](handleError(_0x2f578f,null));};exports['removeTeams']=function(_0x520391,_0xc5be5b,_0x421ed7){return db['Team'][_0xb8e2('0x5d')]({'where':{'id':_0x520391[_0xb8e2('0x3a')][_0xb8e2('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xb8e2('0x5e')],'as':_0xb8e2('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb8e2('0x2a')](handleEntityNotFound(_0xc5be5b,null))['then'](function(_0x22cdbe){var _0x180f50=_[_0xb8e2('0x34')](_0x22cdbe,'id');var _0x2c2532=[];var _0x3931c6=[];var _0x142724=squel[_0xb8e2('0x74')]();_0x142724[_0xb8e2('0x75')](_0xb8e2('0x76'))[_0xb8e2('0x77')](_0xb8e2('0x78'),'tq')[_0xb8e2('0x79')](_0xb8e2('0x7a'),'ut',_0xb8e2('0x7b'))['where']('SmsQueueId\x20=\x20?',_0x520391[_0xb8e2('0x4c')]['id']);for(var _0x1ef76b=0x0;_0x1ef76b<_0x22cdbe[_0xb8e2('0x3f')];_0x1ef76b+=0x1){let _0x180e34=_0x22cdbe[_0x1ef76b];for(var _0x45257b=0x0;_0x45257b<_0x180e34['Agents'][_0xb8e2('0x3f')];_0x45257b+=0x1){let _0x53ee48=_0x180e34[_0xb8e2('0x73')][_0x45257b];var _0x593358=_0x142724[_0xb8e2('0x7c')]();_0x593358['where'](_0xb8e2('0x7d'),_0x53ee48['id']);_0x3931c6[_0xb8e2('0x7e')](db[_0xb8e2('0x6d')][_0xb8e2('0x3a')](_0x593358[_0xb8e2('0x7f')](),{'type':db[_0xb8e2('0x6d')][_0xb8e2('0x80')]['SELECT']})[_0xb8e2('0x2a')](function(_0x1943d6){if(_0x1943d6[_0xb8e2('0x3f')]===0x1){return _0x53ee48['id'];}else{var _0x335b36=_[_0xb8e2('0x81')](_['map'](_0x1943d6,_0xb8e2('0x82')),function(_0x9bbe59){return _[_0xb8e2('0x83')](_0x180f50,_0x9bbe59);});if(_0x335b36){return _0x53ee48['id'];}}}));}}return BPromise[_0xb8e2('0x84')](_0x3931c6)[_0xb8e2('0x2a')](function(_0x44d780){_0x2c2532=_(_0x2c2532)[_0xb8e2('0x85')](_0x44d780)[_0xb8e2('0x86')]()[_0xb8e2('0x87')]();return db[_0xb8e2('0x35')][_0xb8e2('0x4e')]({'where':{'id':_0x520391[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](function(_0x35bd69){return db[_0xb8e2('0x6d')][_0xb8e2('0x88')](function(_0x20a655){return _0x35bd69['removeTeams'](_0x520391[_0xb8e2('0x3a')][_0xb8e2('0x6a')],{'transaction':_0x20a655})[_0xb8e2('0x2a')](function(){if(!_[_0xb8e2('0x89')](_0x2c2532)){return _0x35bd69[_0xb8e2('0x8a')](_0x2c2532,{'transaction':_0x20a655});}})['then'](function(){_0x2c2532[_0xb8e2('0x70')](function(_0x45b870){socket['emit'](_0xb8e2('0x8b'),{'UserId':_0x45b870,'SmsQueueId':_0x35bd69['id']});});});});});});})[_0xb8e2('0x2a')](respondWithStatusCode(_0xc5be5b,null))[_0xb8e2('0x4a')](handleError(_0xc5be5b,null));};exports[_0xb8e2('0x8c')]=function(_0x3d1790,_0x3a0bf2,_0xe45b82){return db['SmsQueue'][_0xb8e2('0x4e')]({'where':{'id':_0x3d1790[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0x3a0bf2,null))[_0xb8e2('0x2a')](function(_0x1c3e28){if(_0x1c3e28){return _0x1c3e28[_0xb8e2('0x8c')](_0x3d1790['body'][_0xb8e2('0x6a')],_[_0xb8e2('0x8d')](_0x3d1790['body'],[_0xb8e2('0x6a'),'id'])||{})[_0xb8e2('0x8e')](function(_0xb42ab9){for(var _0x488c91=0x0;_0x488c91<_0x3d1790[_0xb8e2('0x50')][_0xb8e2('0x6a')][_0xb8e2('0x3f')];_0x488c91+=0x1){socket['emit'](_0xb8e2('0x72'),{'UserId':Number(_0x3d1790[_0xb8e2('0x50')][_0xb8e2('0x6a')][_0x488c91]),'SmsQueueId':Number(_0x3d1790[_0xb8e2('0x4c')]['id'])});}return _0xb42ab9;});}})['then'](respondWithResult(_0x3a0bf2,null))[_0xb8e2('0x4a')](handleError(_0x3a0bf2,null));};exports[_0xb8e2('0x8a')]=function(_0x4a81f4,_0x51becf,_0x54c895){return db[_0xb8e2('0x35')]['find']({'where':{'id':_0x4a81f4['params']['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0x51becf,null))['then'](function(_0x28d6a6){if(_0x28d6a6){return _0x28d6a6[_0xb8e2('0x8a')](_0x4a81f4[_0xb8e2('0x3a')][_0xb8e2('0x6a')])['then'](function(){if(_[_0xb8e2('0x8f')](_0x4a81f4[_0xb8e2('0x3a')][_0xb8e2('0x6a')])){for(var _0x58c9ce=0x0;_0x58c9ce<_0x4a81f4[_0xb8e2('0x3a')][_0xb8e2('0x6a')][_0xb8e2('0x3f')];_0x58c9ce+=0x1){socket[_0xb8e2('0x71')](_0xb8e2('0x8b'),{'UserId':Number(_0x4a81f4[_0xb8e2('0x3a')][_0xb8e2('0x6a')][_0x58c9ce]),'SmsQueueId':Number(_0x4a81f4['params']['id'])});}}else{socket[_0xb8e2('0x71')](_0xb8e2('0x8b'),{'UserId':Number(_0x4a81f4[_0xb8e2('0x3a')][_0xb8e2('0x6a')]),'SmsQueueId':Number(_0x4a81f4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x51becf,null))[_0xb8e2('0x4a')](handleError(_0x51becf,null));};exports[_0xb8e2('0x90')]=function(_0x35746b,_0xd3cfd3,_0x591ff3){var _0x74db06={};var _0x1b355a={};var _0xf4349b;var _0x468d7c;return db[_0xb8e2('0x35')][_0xb8e2('0x59')]({'where':{'id':_0x35746b[_0xb8e2('0x4c')]['id']}})[_0xb8e2('0x2a')](handleEntityNotFound(_0xd3cfd3,null))['then'](function(_0x42cff3){if(_0x42cff3){_0xf4349b=_0x42cff3;_0x1b355a['model']=_['keys'](db['User'][_0xb8e2('0x36')]);_0x1b355a[_0xb8e2('0x3a')]=_[_0xb8e2('0x4d')](_0x35746b[_0xb8e2('0x3a')]);_0x1b355a[_0xb8e2('0x3b')]=_['intersection'](_0x1b355a['model'],_0x1b355a[_0xb8e2('0x3a')]);_0x74db06['attributes']=_[_0xb8e2('0x3c')](_0x1b355a[_0xb8e2('0x39')],qs[_0xb8e2('0x3d')](_0x35746b[_0xb8e2('0x3a')]['fields']));_0x74db06[_0xb8e2('0x3e')]=_0x74db06[_0xb8e2('0x3e')][_0xb8e2('0x3f')]?_0x74db06['attributes']:_0x1b355a[_0xb8e2('0x39')];_0x74db06[_0xb8e2('0x68')]=qs[_0xb8e2('0x40')](_0x35746b[_0xb8e2('0x3a')][_0xb8e2('0x40')]);_0x74db06[_0xb8e2('0x41')]=qs['filters'](_['pick'](_0x35746b[_0xb8e2('0x3a')],_0x1b355a[_0xb8e2('0x3b')]));if(_0x35746b['query'][_0xb8e2('0x45')]){_0x74db06[_0xb8e2('0x41')]=_[_0xb8e2('0x43')](_0x74db06['where'],{'$or':_[_0xb8e2('0x34')](_0x74db06[_0xb8e2('0x3e')],function(_0x4b0740){var _0x518860={};_0x518860[_0x4b0740]={'$like':'%'+_0x35746b[_0xb8e2('0x3a')]['filter']+'%'};return _0x518860;})});}_0x74db06=_[_0xb8e2('0x43')]({},_0x74db06,_0x35746b[_0xb8e2('0x46')]);return _0xf4349b[_0xb8e2('0x90')](_0x74db06);}})[_0xb8e2('0x2a')](function(_0x44c2f4){if(_0x44c2f4){_0x468d7c=_0x44c2f4['length'];if(!_0x35746b[_0xb8e2('0x3a')][_0xb8e2('0x5b')](_0xb8e2('0x91'))){_0x74db06[_0xb8e2('0x24')]=qs[_0xb8e2('0x24')](_0x35746b[_0xb8e2('0x3a')][_0xb8e2('0x24')]);_0x74db06[_0xb8e2('0x22')]=qs['offset'](_0x35746b['query'][_0xb8e2('0x22')]);}return _0xf4349b[_0xb8e2('0x90')](_0x74db06);}})['then'](function(_0x260683){if(_0x260683){return _0x260683?{'count':_0x468d7c,'rows':_0x260683}:null;}})['then'](respondWithResult(_0xd3cfd3,null))[_0xb8e2('0x4a')](handleError(_0xd3cfd3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e53c7c8..9913431 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 _0x2f23=['events','../../mysqldb','SmsQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x25a47f,_0x4f09ad){var _0x1a803d=function(_0x2e33b1){while(--_0x2e33b1){_0x25a47f['push'](_0x25a47f['shift']());}};_0x1a803d(++_0x4f09ad);}(_0x2f23,0x158));var _0x32f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f23[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x32f2('0x0'));var SmsQueue=require(_0x32f2('0x1'))['db'][_0x32f2('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32f2('0x3'),'afterUpdate':_0x32f2('0x4'),'afterDestroy':_0x32f2('0x5')};function emitEvent(_0x3c7e44){return function(_0x4acd85,_0x12f3af,_0x5b72f5){SmsQueueEvents[_0x32f2('0x6')](_0x3c7e44+':'+_0x4acd85['id'],_0x4acd85);SmsQueueEvents[_0x32f2('0x6')](_0x3c7e44,_0x4acd85);_0x5b72f5(null);};}for(var e in events){if(events[_0x32f2('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x1e52=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x2f4ef1,_0x1fc3e0){var _0x11aee2=function(_0x134c1f){while(--_0x134c1f){_0x2f4ef1['push'](_0x2f4ef1['shift']());}};_0x11aee2(++_0x1fc3e0);}(_0x1e52,0x130));var _0x21e5=function(_0x150322,_0x2199fb){_0x150322=_0x150322-0x0;var _0x606a08=_0x1e52[_0x150322];return _0x606a08;};'use strict';var EventEmitter=require(_0x21e5('0x0'));var SmsQueue=require(_0x21e5('0x1'))['db'][_0x21e5('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x21e5('0x3')](0x0);var events={'afterCreate':_0x21e5('0x4'),'afterUpdate':_0x21e5('0x5'),'afterDestroy':_0x21e5('0x6')};function emitEvent(_0x223c23){return function(_0x66838e,_0x3fc52e,_0x2f3138){SmsQueueEvents[_0x21e5('0x7')](_0x223c23+':'+_0x66838e['id'],_0x66838e);SmsQueueEvents[_0x21e5('0x7')](_0x223c23,_0x66838e);_0x2f3138(null);};}for(var e in events){if(events[_0x21e5('0x8')](e)){var event=events[e];SmsQueue[_0x21e5('0x9')](e,emitEvent(event));}}module[_0x21e5('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 19d4576..af98e9e 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 _0xd15e=['api','moment','rimraf','./smsQueue.attributes','exports','lodash','util','../../config/logger'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0xd15e,0x1a5));var _0xed15=function(_0x36ebed,_0x1f9000){_0x36ebed=_0x36ebed-0x0;var _0x187858=_0xd15e[_0x36ebed];return _0x187858;};'use strict';var _=require(_0xed15('0x0'));var util=require(_0xed15('0x1'));var logger=require(_0xed15('0x2'))(_0xed15('0x3'));var moment=require(_0xed15('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed15('0x5'));var config=require('../../config/environment');var attributes=require(_0xed15('0x6'));module[_0xed15('0x7')]=function(_0x1e9331,_0x4a4fe6){return _0x1e9331['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f68=['lodash','../../config/logger','moment','bluebird','request-promise','./smsQueue.attributes','sms_queues'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x4f68,0xd9));var _0x84f6=function(_0x4cc569,_0x27420d){_0x4cc569=_0x4cc569-0x0;var _0x2fc055=_0x4f68[_0x4cc569];return _0x2fc055;};'use strict';var _=require(_0x84f6('0x0'));var util=require('util');var logger=require(_0x84f6('0x1'))('api');var moment=require(_0x84f6('0x2'));var BPromise=require(_0x84f6('0x3'));var rp=require(_0x84f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84f6('0x5'));module['exports']=function(_0x379d15,_0x5c13e9){return _0x379d15['define']('SmsQueue',attributes,{'tableName':_0x84f6('0x6'),'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 6a545b7..e2150c0 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 _0x655e=['http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','findAll','options','raw','where','map','include','model','attributes','SmsQueue','find','ShowSmsQueue','util','moment','bluebird','../../config/utils','../../config/logger','rpc','client'];(function(_0x2f93a4,_0x2f8922){var _0x2c1ad8=function(_0x11d76c){while(--_0x11d76c){_0x2f93a4['push'](_0x2f93a4['shift']());}};_0x2c1ad8(++_0x2f8922);}(_0x655e,0x6b));var _0xe655=function(_0x2a9c88,_0x1c99b2){_0x2a9c88=_0x2a9c88-0x0;var _0x2292d5=_0x655e[_0x2a9c88];return _0x2292d5;};'use strict';var _=require('lodash');var util=require(_0xe655('0x0'));var moment=require(_0xe655('0x1'));var BPromise=require(_0xe655('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe655('0x3'));var logger=require(_0xe655('0x4'))(_0xe655('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe655('0x6')][_0xe655('0x7')]({'port':0x232a});config[_0xe655('0x8')]=_[_0xe655('0x9')](config[_0xe655('0x8')],{'host':_0xe655('0xa'),'port':0x18eb});var socket=require(_0xe655('0xb'))(new Redis(config[_0xe655('0x8')]));require(_0xe655('0xc'))[_0xe655('0xd')](socket);function respondWithRpcPromise(_0x31a942,_0xe23034,_0x24b52c){return new BPromise(function(_0x286c0a,_0x57eed4){return client[_0xe655('0xe')](_0x31a942,_0x24b52c)[_0xe655('0xf')](function(_0x5d7f23){logger[_0xe655('0x10')](_0xe655('0x11'),_0xe23034,_0xe655('0x12'));logger[_0xe655('0x13')](_0xe655('0x14'),_0xe23034,_0xe655('0x12'),JSON[_0xe655('0x15')](_0x5d7f23));if(_0x5d7f23[_0xe655('0x16')]){if(_0x5d7f23[_0xe655('0x16')]['code']===0x1f4){logger[_0xe655('0x16')](_0xe655('0x11'),_0xe23034,_0x5d7f23[_0xe655('0x16')][_0xe655('0x17')]);return _0x57eed4(_0x5d7f23['error'][_0xe655('0x17')]);}logger[_0xe655('0x16')](_0xe655('0x11'),_0xe23034,_0x5d7f23[_0xe655('0x16')][_0xe655('0x17')]);return _0x286c0a(_0x5d7f23[_0xe655('0x16')]['message']);}else{logger[_0xe655('0x10')](_0xe655('0x11'),_0xe23034,_0xe655('0x12'));_0x286c0a(_0x5d7f23[_0xe655('0x18')][_0xe655('0x17')]);}})[_0xe655('0x19')](function(_0x2da335){logger['error']('SmsQueue,\x20%s,\x20%s',_0xe23034,_0x2da335);_0x57eed4(_0x2da335);});});}exports[_0xe655('0x1a')]=function(_0x3efd45){var _0xcf6591=this;return new Promise(function(_0x42a7ba,_0x20885f){return db['SmsQueue'][_0xe655('0x1b')]({'raw':_0x3efd45[_0xe655('0x1c')]?_0x3efd45['options'][_0xe655('0x1d')]===undefined?!![]:![]:!![],'where':_0x3efd45[_0xe655('0x1c')]?_0x3efd45[_0xe655('0x1c')][_0xe655('0x1e')]||null:null,'attributes':_0x3efd45[_0xe655('0x1c')]?_0x3efd45[_0xe655('0x1c')]['attributes']||null:null,'limit':_0x3efd45[_0xe655('0x1c')]?_0x3efd45[_0xe655('0x1c')]['limit']||null:null,'include':_0x3efd45[_0xe655('0x1c')]?_0x3efd45[_0xe655('0x1c')]['include']?_[_0xe655('0x1f')](_0x3efd45[_0xe655('0x1c')][_0xe655('0x20')],function(_0x1fddb5){return{'model':db[_0x1fddb5[_0xe655('0x21')]],'as':_0x1fddb5['as'],'attributes':_0x1fddb5['attributes'],'include':_0x1fddb5[_0xe655('0x20')]?_['map'](_0x1fddb5[_0xe655('0x20')],function(_0x323f93){return{'model':db[_0x323f93['model']],'as':_0x323f93['as'],'attributes':_0x323f93['attributes'],'include':_0x323f93[_0xe655('0x20')]?_[_0xe655('0x1f')](_0x323f93[_0xe655('0x20')],function(_0x4fa03a){return{'model':db[_0x4fa03a[_0xe655('0x21')]],'as':_0x4fa03a['as'],'attributes':_0x4fa03a[_0xe655('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe655('0xf')](function(_0x1cc128){logger[_0xe655('0x10')](_0xe655('0x1a'),_0x3efd45);logger[_0xe655('0x13')](_0xe655('0x1a'),_0x3efd45,JSON['stringify'](_0x1cc128));_0x42a7ba(_0x1cc128);})[_0xe655('0x19')](function(_0x27c7f8){logger[_0xe655('0x16')]('GetSmsQueue',_0x27c7f8[_0xe655('0x17')],_0x3efd45);_0x20885f(_0xcf6591[_0xe655('0x16')](0x1f4,_0x27c7f8['message']));});});};exports['ShowSmsQueue']=function(_0x57c705){var _0x42dff6=this;return new Promise(function(_0x3b835c,_0x365c84){return db[_0xe655('0x23')][_0xe655('0x24')]({'raw':_0x57c705[_0xe655('0x1c')]?_0x57c705[_0xe655('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x57c705['options']?_0x57c705['options'][_0xe655('0x1e')]||null:null,'attributes':_0x57c705[_0xe655('0x1c')]?_0x57c705[_0xe655('0x1c')][_0xe655('0x22')]||null:null,'include':_0x57c705[_0xe655('0x1c')]?_0x57c705[_0xe655('0x1c')][_0xe655('0x20')]?_[_0xe655('0x1f')](_0x57c705['options'][_0xe655('0x20')],function(_0x43d6a4){return{'model':db[_0x43d6a4['model']],'as':_0x43d6a4['as'],'attributes':_0x43d6a4[_0xe655('0x22')],'include':_0x43d6a4['include']?_['map'](_0x43d6a4[_0xe655('0x20')],function(_0x1c0fac){return{'model':db[_0x1c0fac[_0xe655('0x21')]],'as':_0x1c0fac['as'],'attributes':_0x1c0fac[_0xe655('0x22')],'include':_0x1c0fac['include']?_[_0xe655('0x1f')](_0x1c0fac['include'],function(_0x41e43b){return{'model':db[_0x41e43b[_0xe655('0x21')]],'as':_0x41e43b['as'],'attributes':_0x41e43b[_0xe655('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe655('0xf')](function(_0x5299c5){logger[_0xe655('0x10')](_0xe655('0x25'),_0x57c705);logger['debug'](_0xe655('0x25'),_0x57c705,JSON[_0xe655('0x15')](_0x5299c5));_0x3b835c(_0x5299c5);})[_0xe655('0x19')](function(_0xee58fd){logger[_0xe655('0x16')]('ShowSmsQueue',_0xee58fd[_0xe655('0x17')],_0x57c705);_0x365c84(_0x42dff6[_0xe655('0x16')](0x1f4,_0xee58fd[_0xe655('0x17')]));});});}; \ No newline at end of file +var _0x2745=['ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','SmsQueue'];(function(_0x2c4829,_0x277d23){var _0x3baa52=function(_0x48c619){while(--_0x48c619){_0x2c4829['push'](_0x2c4829['shift']());}};_0x3baa52(++_0x277d23);}(_0x2745,0xa1));var _0x5274=function(_0x3eb79c,_0x56ae71){_0x3eb79c=_0x3eb79c-0x0;var _0x574418=_0x2745[_0x3eb79c];return _0x574418;};'use strict';var _=require(_0x5274('0x0'));var util=require(_0x5274('0x1'));var moment=require('moment');var BPromise=require(_0x5274('0x2'));var rs=require(_0x5274('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5274('0x4'))['db'];var utils=require(_0x5274('0x5'));var logger=require(_0x5274('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5274('0x7'));var client=jayson[_0x5274('0x8')][_0x5274('0x9')]({'port':0x232a});config['redis']=_[_0x5274('0xa')](config['redis'],{'host':_0x5274('0xb'),'port':0x18eb});var socket=require(_0x5274('0xc'))(new Redis(config[_0x5274('0xd')]));require(_0x5274('0xe'))['register'](socket);function respondWithRpcPromise(_0x572a8f,_0x4a203f,_0x365159){return new BPromise(function(_0x5cbc19,_0x5a0dc7){return client[_0x5274('0xf')](_0x572a8f,_0x365159)[_0x5274('0x10')](function(_0x124bf2){logger['info'](_0x5274('0x11'),_0x4a203f,'request\x20sent');logger[_0x5274('0x12')](_0x5274('0x13'),_0x4a203f,_0x5274('0x14'),JSON[_0x5274('0x15')](_0x124bf2));if(_0x124bf2[_0x5274('0x16')]){if(_0x124bf2[_0x5274('0x16')][_0x5274('0x17')]===0x1f4){logger[_0x5274('0x16')]('SmsQueue,\x20%s,\x20%s',_0x4a203f,_0x124bf2[_0x5274('0x16')][_0x5274('0x18')]);return _0x5a0dc7(_0x124bf2[_0x5274('0x16')][_0x5274('0x18')]);}logger['error'](_0x5274('0x11'),_0x4a203f,_0x124bf2[_0x5274('0x16')]['message']);return _0x5cbc19(_0x124bf2[_0x5274('0x16')][_0x5274('0x18')]);}else{logger[_0x5274('0x19')](_0x5274('0x11'),_0x4a203f,_0x5274('0x14'));_0x5cbc19(_0x124bf2[_0x5274('0x1a')][_0x5274('0x18')]);}})[_0x5274('0x1b')](function(_0x53cc64){logger[_0x5274('0x16')](_0x5274('0x11'),_0x4a203f,_0x53cc64);_0x5a0dc7(_0x53cc64);});});}exports['GetSmsQueue']=function(_0x49ddd6){var _0x31c6a5=this;return new Promise(function(_0x161725,_0x592f35){return db['SmsQueue'][_0x5274('0x1c')]({'raw':_0x49ddd6[_0x5274('0x1d')]?_0x49ddd6[_0x5274('0x1d')][_0x5274('0x1e')]===undefined?!![]:![]:!![],'where':_0x49ddd6[_0x5274('0x1d')]?_0x49ddd6[_0x5274('0x1d')][_0x5274('0x1f')]||null:null,'attributes':_0x49ddd6[_0x5274('0x1d')]?_0x49ddd6[_0x5274('0x1d')][_0x5274('0x20')]||null:null,'limit':_0x49ddd6['options']?_0x49ddd6['options'][_0x5274('0x21')]||null:null,'include':_0x49ddd6[_0x5274('0x1d')]?_0x49ddd6[_0x5274('0x1d')][_0x5274('0x22')]?_[_0x5274('0x23')](_0x49ddd6[_0x5274('0x1d')][_0x5274('0x22')],function(_0x2b98ec){return{'model':db[_0x2b98ec[_0x5274('0x24')]],'as':_0x2b98ec['as'],'attributes':_0x2b98ec[_0x5274('0x20')],'include':_0x2b98ec[_0x5274('0x22')]?_['map'](_0x2b98ec[_0x5274('0x22')],function(_0x44cf66){return{'model':db[_0x44cf66[_0x5274('0x24')]],'as':_0x44cf66['as'],'attributes':_0x44cf66[_0x5274('0x20')],'include':_0x44cf66[_0x5274('0x22')]?_[_0x5274('0x23')](_0x44cf66[_0x5274('0x22')],function(_0x45fc23){return{'model':db[_0x45fc23[_0x5274('0x24')]],'as':_0x45fc23['as'],'attributes':_0x45fc23[_0x5274('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5274('0x10')](function(_0x428021){logger[_0x5274('0x19')](_0x5274('0x25'),_0x49ddd6);logger['debug'](_0x5274('0x25'),_0x49ddd6,JSON[_0x5274('0x15')](_0x428021));_0x161725(_0x428021);})[_0x5274('0x1b')](function(_0x1b17c5){logger[_0x5274('0x16')](_0x5274('0x25'),_0x1b17c5[_0x5274('0x18')],_0x49ddd6);_0x592f35(_0x31c6a5[_0x5274('0x16')](0x1f4,_0x1b17c5['message']));});});};exports['ShowSmsQueue']=function(_0x1c0caa){var _0x3925ab=this;return new Promise(function(_0x21e4c0,_0x5128b3){return db[_0x5274('0x26')]['find']({'raw':_0x1c0caa[_0x5274('0x1d')]?_0x1c0caa[_0x5274('0x1d')][_0x5274('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c0caa[_0x5274('0x1d')]?_0x1c0caa[_0x5274('0x1d')][_0x5274('0x1f')]||null:null,'attributes':_0x1c0caa[_0x5274('0x1d')]?_0x1c0caa[_0x5274('0x1d')][_0x5274('0x20')]||null:null,'include':_0x1c0caa[_0x5274('0x1d')]?_0x1c0caa[_0x5274('0x1d')]['include']?_[_0x5274('0x23')](_0x1c0caa[_0x5274('0x1d')][_0x5274('0x22')],function(_0x481ab7){return{'model':db[_0x481ab7['model']],'as':_0x481ab7['as'],'attributes':_0x481ab7[_0x5274('0x20')],'include':_0x481ab7['include']?_[_0x5274('0x23')](_0x481ab7[_0x5274('0x22')],function(_0x372c25){return{'model':db[_0x372c25['model']],'as':_0x372c25['as'],'attributes':_0x372c25[_0x5274('0x20')],'include':_0x372c25[_0x5274('0x22')]?_[_0x5274('0x23')](_0x372c25['include'],function(_0x35a5fe){return{'model':db[_0x35a5fe['model']],'as':_0x35a5fe['as'],'attributes':_0x35a5fe[_0x5274('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5274('0x10')](function(_0x5f267f){logger[_0x5274('0x19')]('ShowSmsQueue',_0x1c0caa);logger[_0x5274('0x12')](_0x5274('0x27'),_0x1c0caa,JSON[_0x5274('0x15')](_0x5f267f));_0x21e4c0(_0x5f267f);})[_0x5274('0x1b')](function(_0x25128f){logger[_0x5274('0x16')]('ShowSmsQueue',_0x25128f[_0x5274('0x18')],_0x1c0caa);_0x5128b3(_0x3925ab['error'](0x1f4,_0x25128f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 1cc4239..b18c9aa 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 _0xe066=['remove','emit','register','length','smsQueue:'];(function(_0x18989,_0x3f08e0){var _0x3482e3=function(_0x203de8){while(--_0x203de8){_0x18989['push'](_0x18989['shift']());}};_0x3482e3(++_0x3f08e0);}(_0xe066,0x8c));var _0x6e06=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xe066[_0x4914e2];return _0x2dcd07;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x6e06('0x0'),'update'];function createListener(_0x140c77,_0x200965){return function(_0x3e3687){_0x200965[_0x6e06('0x1')](_0x140c77,_0x3e3687);};}function removeListener(_0xca6983,_0x2f37ab){return function(){SmsQueueEvents['removeListener'](_0xca6983,_0x2f37ab);};}exports[_0x6e06('0x2')]=function(_0x20c6e7){for(var _0x10966c=0x0,_0x30254c=events[_0x6e06('0x3')];_0x10966c<_0x30254c;_0x10966c++){var _0x499899=events[_0x10966c];var _0x513127=createListener(_0x6e06('0x4')+_0x499899,_0x20c6e7);SmsQueueEvents['on'](_0x499899,_0x513127);}}; \ No newline at end of file +var _0xaa01=['save','remove','update','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x5f5b7b,_0x99673){var _0x140ba8=function(_0x343d18){while(--_0x343d18){_0x5f5b7b['push'](_0x5f5b7b['shift']());}};_0x140ba8(++_0x99673);}(_0xaa01,0x14f));var _0x1aa0=function(_0x4c7f07,_0x4a7525){_0x4c7f07=_0x4c7f07-0x0;var _0xfaf79e=_0xaa01[_0x4c7f07];return _0xfaf79e;};'use strict';var SmsQueueEvents=require(_0x1aa0('0x0'));var events=[_0x1aa0('0x1'),_0x1aa0('0x2'),_0x1aa0('0x3')];function createListener(_0x38f893,_0xc227fb){return function(_0x3bbb51){_0xc227fb['emit'](_0x38f893,_0x3bbb51);};}function removeListener(_0x16b312,_0x17ad92){return function(){SmsQueueEvents[_0x1aa0('0x4')](_0x16b312,_0x17ad92);};}exports['register']=function(_0x3d0141){for(var _0x12ae68=0x0,_0x25af10=events[_0x1aa0('0x5')];_0x12ae68<_0x25af10;_0x12ae68++){var _0x4aa09f=events[_0x12ae68];var _0x50aa2e=createListener(_0x1aa0('0x6')+_0x4aa09f,_0x3d0141);SmsQueueEvents['on'](_0x4aa09f,_0x50aa2e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e59650d..f64ff70 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 _0x2dde=['get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2dde,0x19a));var _0xe2dd=function(_0x5d21a,_0x14582f){_0x5d21a=_0x5d21a-0x0;var _0x2edd28=_0x2dde[_0x5d21a];return _0x2edd28;};'use strict';var multer=require(_0xe2dd('0x0'));var util=require(_0xe2dd('0x1'));var path=require(_0xe2dd('0x2'));var timeout=require(_0xe2dd('0x3'));var express=require(_0xe2dd('0x4'));var router=express['Router']();var fs_extra=require(_0xe2dd('0x5'));var auth=require(_0xe2dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe2dd('0x7'));var controller=require('./smsQueueReport.controller');router[_0xe2dd('0x8')]('/',auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xa')]);router[_0xe2dd('0x8')](_0xe2dd('0xb'),auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xc')]);router[_0xe2dd('0x8')](_0xe2dd('0xd'),auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xe')]);router['post']('/',auth[_0xe2dd('0x9')](),controller['create']);router[_0xe2dd('0xf')]('/:id',auth[_0xe2dd('0x9')](),controller['update']);router[_0xe2dd('0x10')](_0xe2dd('0xd'),auth[_0xe2dd('0x9')](),controller[_0xe2dd('0x11')]);module[_0xe2dd('0x12')]=router; \ No newline at end of file +var _0x2a1d=['delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x54eb34,_0x234852){var _0x585b9a=function(_0x52e282){while(--_0x52e282){_0x54eb34['push'](_0x54eb34['shift']());}};_0x585b9a(++_0x234852);}(_0x2a1d,0x113));var _0xd2a1=function(_0x3fa8d7,_0x53e732){_0x3fa8d7=_0x3fa8d7-0x0;var _0xdd954f=_0x2a1d[_0x3fa8d7];return _0xdd954f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd2a1('0x0'));var timeout=require('connect-timeout');var express=require(_0xd2a1('0x1'));var router=express[_0xd2a1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd2a1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd2a1('0x4'));var controller=require('./smsQueueReport.controller');router[_0xd2a1('0x5')]('/',auth[_0xd2a1('0x6')](),controller[_0xd2a1('0x7')]);router[_0xd2a1('0x5')](_0xd2a1('0x8'),auth[_0xd2a1('0x6')](),controller[_0xd2a1('0x9')]);router[_0xd2a1('0x5')](_0xd2a1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd2a1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd2a1('0xc')](_0xd2a1('0xa'),auth[_0xd2a1('0x6')](),controller[_0xd2a1('0xd')]);router[_0xd2a1('0xe')]('/:id',auth[_0xd2a1('0x6')](),controller[_0xd2a1('0xf')]);module[_0xd2a1('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index bf89f7a..27ccecd 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 _0x7d3e=['DATE','moment','sequelize','exports','STRING'];(function(_0x5425ce,_0x390736){var _0x32b85c=function(_0x436f8f){while(--_0x436f8f){_0x5425ce['push'](_0x5425ce['shift']());}};_0x32b85c(++_0x390736);}(_0x7d3e,0x178));var _0xe7d3=function(_0x3cb6d8,_0x19ff85){_0x3cb6d8=_0x3cb6d8-0x0;var _0x5c7088=_0x7d3e[_0x3cb6d8];return _0x5c7088;};'use strict';var moment=require(_0xe7d3('0x0'));var Sequelize=require(_0xe7d3('0x1'));module[_0xe7d3('0x2')]={'uniqueid':{'type':Sequelize[_0xe7d3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe7d3('0x3')]},'joinAt':{'type':Sequelize[_0xe7d3('0x4')]},'leaveAt':{'type':Sequelize[_0xe7d3('0x4')]},'acceptAt':{'type':Sequelize[_0xe7d3('0x4')]},'exitAt':{'type':Sequelize[_0xe7d3('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b2e=['STRING','DATE','exports'];(function(_0x16479d,_0x105179){var _0x1b8bfc=function(_0x11cee6){while(--_0x11cee6){_0x16479d['push'](_0x16479d['shift']());}};_0x1b8bfc(++_0x105179);}(_0x4b2e,0xcb));var _0xe4b2=function(_0x1cd6b4,_0x6899b9){_0x1cd6b4=_0x1cd6b4-0x0;var _0x4960e1=_0x4b2e[_0x1cd6b4];return _0x4960e1;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe4b2('0x0')]={'uniqueid':{'type':Sequelize[_0xe4b2('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe4b2('0x1')]},'joinAt':{'type':Sequelize[_0xe4b2('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe4b2('0x2')]},'exitAt':{'type':Sequelize[_0xe4b2('0x2')]},'reason':{'type':Sequelize[_0xe4b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 8d6c019..a85f9d2 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 _0x1592=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','params','keys','find','catch','create','body','update','describe','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1592,0x150));var _0x2159=function(_0x7c10f5,_0x28a735){_0x7c10f5=_0x7c10f5-0x0;var _0x55d698=_0x1592[_0x7c10f5];return _0x55d698;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2159('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2159('0x1'));var moment=require('moment');var BPromise=require(_0x2159('0x2'));var Mustache=require('mustache');var util=require(_0x2159('0x3'));var path=require(_0x2159('0x4'));var sox=require(_0x2159('0x5'));var csv=require(_0x2159('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2159('0x7'));var _=require(_0x2159('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2159('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2159('0x6'));var querystring=require('querystring');var Papa=require(_0x2159('0xa'));var Redis=require(_0x2159('0xb'));var authService=require(_0x2159('0xc'));var qs=require(_0x2159('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2159('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x2159('0xf'));var config=require(_0x2159('0x10'));var licenseUtil=require(_0x2159('0x11'));var db=require(_0x2159('0x12'))['db'];function respondWithStatusCode(_0x1ae02d,_0x2c8482){_0x2c8482=_0x2c8482||0xcc;return function(_0x59bde4){if(_0x59bde4){return _0x1ae02d[_0x2159('0x13')](_0x2c8482);}return _0x1ae02d[_0x2159('0x14')](_0x2c8482)[_0x2159('0x15')]();};}function respondWithResult(_0x178157,_0x517831){_0x517831=_0x517831||0xc8;return function(_0x5595b6){if(_0x5595b6){return _0x178157[_0x2159('0x14')](_0x517831)[_0x2159('0x16')](_0x5595b6);}};}function respondWithFilteredResult(_0x535eff,_0x3c244d){return function(_0x460b80){if(_0x460b80){var _0x229731=typeof _0x3c244d[_0x2159('0x17')]==='undefined'&&typeof _0x3c244d[_0x2159('0x18')]===_0x2159('0x19');var _0x34cec1=_0x460b80['count'];var _0x22bf37=_0x229731?0x0:_0x3c244d['offset'];var _0x574e3=_0x229731?_0x460b80[_0x2159('0x1a')]:_0x3c244d['offset']+_0x3c244d[_0x2159('0x18')];var _0x343764;if(_0x574e3>=_0x34cec1){_0x574e3=_0x34cec1;_0x343764=0xc8;}else{_0x343764=0xce;}_0x535eff[_0x2159('0x14')](_0x343764);return _0x535eff[_0x2159('0x1b')](_0x2159('0x1c'),_0x22bf37+'-'+_0x574e3+'/'+_0x34cec1)[_0x2159('0x16')](_0x460b80);}return null;};}function patchUpdates(_0x4114cb){return function(_0x3685b0){try{jsonpatch[_0x2159('0x1d')](_0x3685b0,_0x4114cb,!![]);}catch(_0x1cc71a){return BPromise['reject'](_0x1cc71a);}return _0x3685b0[_0x2159('0x1e')]();};}function saveUpdates(_0x7dffa7,_0x3f2ec5){return function(_0x5d3193){if(_0x5d3193){return _0x5d3193['update'](_0x7dffa7)['then'](function(_0x11ea39){return _0x11ea39;});}return null;};}function removeEntity(_0x4acf15,_0xebb201){return function(_0xd9f772){if(_0xd9f772){return _0xd9f772[_0x2159('0x1f')]()[_0x2159('0x20')](function(){_0x4acf15[_0x2159('0x14')](0xcc)[_0x2159('0x15')]();});}};}function handleEntityNotFound(_0x473226,_0x4da226){return function(_0x5b61ec){if(!_0x5b61ec){_0x473226[_0x2159('0x13')](0x194);}return _0x5b61ec;};}function handleError(_0x2de475,_0x218331){_0x218331=_0x218331||0x1f4;return function(_0x4b24e7){logger[_0x2159('0x21')](_0x4b24e7[_0x2159('0x22')]);if(_0x4b24e7[_0x2159('0x23')]){delete _0x4b24e7[_0x2159('0x23')];}_0x2de475[_0x2159('0x14')](_0x218331)[_0x2159('0x24')](_0x4b24e7);};}exports[_0x2159('0x25')]=function(_0x110a3f,_0x11b948){var _0x41b790={},_0x175d3a={},_0x36d32a={'count':0x0,'rows':[]};var _0x11745f=_[_0x2159('0x26')](db[_0x2159('0x27')][_0x2159('0x28')],function(_0x487f6b){return{'name':_0x487f6b['fieldName'],'type':_0x487f6b['type']['key']};});_0x175d3a['model']=_['map'](_0x11745f,'name');_0x175d3a[_0x2159('0x29')]=_['keys'](_0x110a3f[_0x2159('0x29')]);_0x175d3a[_0x2159('0x2a')]=_['intersection'](_0x175d3a[_0x2159('0x2b')],_0x175d3a[_0x2159('0x29')]);_0x41b790[_0x2159('0x2c')]=_[_0x2159('0x2d')](_0x175d3a[_0x2159('0x2b')],qs[_0x2159('0x2e')](_0x110a3f['query'][_0x2159('0x2e')]));_0x41b790[_0x2159('0x2c')]=_0x41b790[_0x2159('0x2c')][_0x2159('0x2f')]?_0x41b790[_0x2159('0x2c')]:_0x175d3a['model'];if(!_0x110a3f[_0x2159('0x29')][_0x2159('0x30')](_0x2159('0x31'))){_0x41b790['limit']=qs[_0x2159('0x18')](_0x110a3f[_0x2159('0x29')][_0x2159('0x18')]);_0x41b790[_0x2159('0x17')]=qs[_0x2159('0x17')](_0x110a3f[_0x2159('0x29')]['offset']);}_0x41b790[_0x2159('0x32')]=qs[_0x2159('0x33')](_0x110a3f[_0x2159('0x29')][_0x2159('0x33')]);_0x41b790[_0x2159('0x34')]=qs['filters'](_[_0x2159('0x35')](_0x110a3f['query'],_0x175d3a[_0x2159('0x2a')]),_0x11745f);if(_0x110a3f[_0x2159('0x29')][_0x2159('0x36')]){_0x41b790[_0x2159('0x34')]=_[_0x2159('0x37')](_0x41b790[_0x2159('0x34')],{'$or':_[_0x2159('0x26')](_0x11745f,function(_0x1f971a){if(_0x1f971a[_0x2159('0x38')]!=='VIRTUAL'){var _0x28c588={};_0x28c588[_0x1f971a[_0x2159('0x23')]]={'$like':'%'+_0x110a3f[_0x2159('0x29')][_0x2159('0x36')]+'%'};return _0x28c588;}})});}_0x41b790=_[_0x2159('0x37')]({},_0x41b790,_0x110a3f[_0x2159('0x39')]);var _0x411ca0={'where':_0x41b790[_0x2159('0x34')]};return db[_0x2159('0x27')]['count'](_0x411ca0)[_0x2159('0x20')](function(_0x2760ec){_0x36d32a[_0x2159('0x1a')]=_0x2760ec;if(_0x110a3f[_0x2159('0x29')][_0x2159('0x3a')]){_0x41b790[_0x2159('0x3b')]=[{'all':!![]}];}return db[_0x2159('0x27')]['findAll'](_0x41b790);})[_0x2159('0x20')](function(_0x30fef0){_0x36d32a[_0x2159('0x3c')]=_0x30fef0;return _0x36d32a;})['then'](respondWithFilteredResult(_0x11b948,_0x41b790))['catch'](handleError(_0x11b948,null));};exports['show']=function(_0xf901aa,_0x1ca519){var _0x5bf24c={'raw':!![],'where':{'id':_0xf901aa[_0x2159('0x3d')]['id']}},_0x35e35a={};_0x35e35a[_0x2159('0x2b')]=_[_0x2159('0x3e')](db['SmsQueueReport'][_0x2159('0x28')]);_0x35e35a[_0x2159('0x29')]=_[_0x2159('0x3e')](_0xf901aa[_0x2159('0x29')]);_0x35e35a['filters']=_['intersection'](_0x35e35a[_0x2159('0x2b')],_0x35e35a[_0x2159('0x29')]);_0x5bf24c[_0x2159('0x2c')]=_[_0x2159('0x2d')](_0x35e35a[_0x2159('0x2b')],qs['fields'](_0xf901aa[_0x2159('0x29')][_0x2159('0x2e')]));_0x5bf24c[_0x2159('0x2c')]=_0x5bf24c[_0x2159('0x2c')][_0x2159('0x2f')]?_0x5bf24c[_0x2159('0x2c')]:_0x35e35a['model'];if(_0xf901aa['query'][_0x2159('0x3a')]){_0x5bf24c[_0x2159('0x3b')]=[{'all':!![]}];}_0x5bf24c=_['merge']({},_0x5bf24c,_0xf901aa[_0x2159('0x39')]);return db['SmsQueueReport'][_0x2159('0x3f')](_0x5bf24c)[_0x2159('0x20')](handleEntityNotFound(_0x1ca519,null))[_0x2159('0x20')](respondWithResult(_0x1ca519,null))[_0x2159('0x40')](handleError(_0x1ca519,null));};exports[_0x2159('0x41')]=function(_0x526664,_0x3e1c55){return db[_0x2159('0x27')][_0x2159('0x41')](_0x526664[_0x2159('0x42')],{})[_0x2159('0x20')](respondWithResult(_0x3e1c55,0xc9))['catch'](handleError(_0x3e1c55,null));};exports[_0x2159('0x43')]=function(_0xb184a8,_0x2039a3){if(_0xb184a8[_0x2159('0x42')]['id']){delete _0xb184a8[_0x2159('0x42')]['id'];}return db['SmsQueueReport'][_0x2159('0x3f')]({'where':{'id':_0xb184a8[_0x2159('0x3d')]['id']}})[_0x2159('0x20')](handleEntityNotFound(_0x2039a3,null))[_0x2159('0x20')](saveUpdates(_0xb184a8[_0x2159('0x42')],null))['then'](respondWithResult(_0x2039a3,null))[_0x2159('0x40')](handleError(_0x2039a3,null));};exports[_0x2159('0x1f')]=function(_0x5e7b6c,_0x581bdf){return db[_0x2159('0x27')]['find']({'where':{'id':_0x5e7b6c[_0x2159('0x3d')]['id']}})[_0x2159('0x20')](handleEntityNotFound(_0x581bdf,null))[_0x2159('0x20')](removeEntity(_0x581bdf,null))[_0x2159('0x40')](handleError(_0x581bdf,null));};exports[_0x2159('0x44')]=function(_0x57e4ef,_0x5c0bdb){return db[_0x2159('0x27')]['describe']()[_0x2159('0x20')](respondWithResult(_0x5c0bdb,null))[_0x2159('0x40')](handleError(_0x5c0bdb,null));}; \ No newline at end of file +var _0xfe53=['includeAll','include','SmsQueueReport','findAll','params','keys','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe53,0xe7));var _0x3fe5=function(_0x257bbc,_0x1101e9){_0x257bbc=_0x257bbc-0x0;var _0x13a941=_0xfe53[_0x257bbc];return _0x13a941;};'use strict';var emlformat=require(_0x3fe5('0x0'));var rimraf=require(_0x3fe5('0x1'));var zipdir=require(_0x3fe5('0x2'));var jsonpatch=require(_0x3fe5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fe5('0x4'));var Mustache=require(_0x3fe5('0x5'));var util=require(_0x3fe5('0x6'));var path=require(_0x3fe5('0x7'));var sox=require(_0x3fe5('0x8'));var csv=require('to-csv');var ejs=require(_0x3fe5('0x9'));var fs=require('fs');var fs_extra=require(_0x3fe5('0xa'));var _=require(_0x3fe5('0xb'));var squel=require(_0x3fe5('0xc'));var crypto=require(_0x3fe5('0xd'));var jsforce=require(_0x3fe5('0xe'));var deskjs=require(_0x3fe5('0xf'));var toCsv=require(_0x3fe5('0x10'));var querystring=require(_0x3fe5('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3fe5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3fe5('0x13'));var hardwareService=require(_0x3fe5('0x14'));var logger=require(_0x3fe5('0x15'))('api');var utils=require(_0x3fe5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3fe5('0x17'));var db=require(_0x3fe5('0x18'))['db'];function respondWithStatusCode(_0x1f52f3,_0x5079ee){_0x5079ee=_0x5079ee||0xcc;return function(_0x580830){if(_0x580830){return _0x1f52f3['sendStatus'](_0x5079ee);}return _0x1f52f3[_0x3fe5('0x19')](_0x5079ee)[_0x3fe5('0x1a')]();};}function respondWithResult(_0x1a8223,_0x654f09){_0x654f09=_0x654f09||0xc8;return function(_0x3b3186){if(_0x3b3186){return _0x1a8223[_0x3fe5('0x19')](_0x654f09)[_0x3fe5('0x1b')](_0x3b3186);}};}function respondWithFilteredResult(_0x5582de,_0x52166f){return function(_0x1e9210){if(_0x1e9210){var _0x2ef63c=typeof _0x52166f[_0x3fe5('0x1c')]===_0x3fe5('0x1d')&&typeof _0x52166f[_0x3fe5('0x1e')]===_0x3fe5('0x1d');var _0x83e8ce=_0x1e9210['count'];var _0x1f2bd6=_0x2ef63c?0x0:_0x52166f[_0x3fe5('0x1c')];var _0x20daca=_0x2ef63c?_0x1e9210['count']:_0x52166f[_0x3fe5('0x1c')]+_0x52166f[_0x3fe5('0x1e')];var _0x12eaef;if(_0x20daca>=_0x83e8ce){_0x20daca=_0x83e8ce;_0x12eaef=0xc8;}else{_0x12eaef=0xce;}_0x5582de[_0x3fe5('0x19')](_0x12eaef);return _0x5582de[_0x3fe5('0x1f')](_0x3fe5('0x20'),_0x1f2bd6+'-'+_0x20daca+'/'+_0x83e8ce)[_0x3fe5('0x1b')](_0x1e9210);}return null;};}function patchUpdates(_0x2631e6){return function(_0x11c735){try{jsonpatch['apply'](_0x11c735,_0x2631e6,!![]);}catch(_0x5782ec){return BPromise['reject'](_0x5782ec);}return _0x11c735['save']();};}function saveUpdates(_0x4990fd,_0x387c69){return function(_0x436e19){if(_0x436e19){return _0x436e19[_0x3fe5('0x21')](_0x4990fd)[_0x3fe5('0x22')](function(_0x267a42){return _0x267a42;});}return null;};}function removeEntity(_0x349c16,_0x4b6080){return function(_0x62dbd8){if(_0x62dbd8){return _0x62dbd8['destroy']()['then'](function(){_0x349c16[_0x3fe5('0x19')](0xcc)[_0x3fe5('0x1a')]();});}};}function handleEntityNotFound(_0x31fcb6,_0x26efa3){return function(_0x56a34a){if(!_0x56a34a){_0x31fcb6[_0x3fe5('0x23')](0x194);}return _0x56a34a;};}function handleError(_0x1ea295,_0x4d8de2){_0x4d8de2=_0x4d8de2||0x1f4;return function(_0x3ecb3a){logger['error'](_0x3ecb3a[_0x3fe5('0x24')]);if(_0x3ecb3a[_0x3fe5('0x25')]){delete _0x3ecb3a[_0x3fe5('0x25')];}_0x1ea295[_0x3fe5('0x19')](_0x4d8de2)[_0x3fe5('0x26')](_0x3ecb3a);};}exports[_0x3fe5('0x27')]=function(_0x11fb50,_0x214301){var _0x4e6d01={},_0x1e6e82={},_0xd18101={'count':0x0,'rows':[]};var _0x79b55d=_[_0x3fe5('0x28')](db['SmsQueueReport'][_0x3fe5('0x29')],function(_0x37a99a){return{'name':_0x37a99a[_0x3fe5('0x2a')],'type':_0x37a99a['type'][_0x3fe5('0x2b')]};});_0x1e6e82[_0x3fe5('0x2c')]=_[_0x3fe5('0x28')](_0x79b55d,_0x3fe5('0x25'));_0x1e6e82[_0x3fe5('0x2d')]=_['keys'](_0x11fb50[_0x3fe5('0x2d')]);_0x1e6e82[_0x3fe5('0x2e')]=_['intersection'](_0x1e6e82['model'],_0x1e6e82[_0x3fe5('0x2d')]);_0x4e6d01[_0x3fe5('0x2f')]=_[_0x3fe5('0x30')](_0x1e6e82[_0x3fe5('0x2c')],qs[_0x3fe5('0x31')](_0x11fb50['query']['fields']));_0x4e6d01['attributes']=_0x4e6d01['attributes'][_0x3fe5('0x32')]?_0x4e6d01[_0x3fe5('0x2f')]:_0x1e6e82[_0x3fe5('0x2c')];if(!_0x11fb50['query'][_0x3fe5('0x33')](_0x3fe5('0x34'))){_0x4e6d01[_0x3fe5('0x1e')]=qs['limit'](_0x11fb50[_0x3fe5('0x2d')][_0x3fe5('0x1e')]);_0x4e6d01[_0x3fe5('0x1c')]=qs[_0x3fe5('0x1c')](_0x11fb50[_0x3fe5('0x2d')]['offset']);}_0x4e6d01['order']=qs[_0x3fe5('0x35')](_0x11fb50[_0x3fe5('0x2d')][_0x3fe5('0x35')]);_0x4e6d01[_0x3fe5('0x36')]=qs['filters'](_[_0x3fe5('0x37')](_0x11fb50[_0x3fe5('0x2d')],_0x1e6e82['filters']),_0x79b55d);if(_0x11fb50[_0x3fe5('0x2d')][_0x3fe5('0x38')]){_0x4e6d01[_0x3fe5('0x36')]=_[_0x3fe5('0x39')](_0x4e6d01['where'],{'$or':_[_0x3fe5('0x28')](_0x79b55d,function(_0x48c604){if(_0x48c604['type']!==_0x3fe5('0x3a')){var _0x40ce62={};_0x40ce62[_0x48c604[_0x3fe5('0x25')]]={'$like':'%'+_0x11fb50[_0x3fe5('0x2d')][_0x3fe5('0x38')]+'%'};return _0x40ce62;}})});}_0x4e6d01=_[_0x3fe5('0x39')]({},_0x4e6d01,_0x11fb50[_0x3fe5('0x3b')]);var _0x5d2f40={'where':_0x4e6d01[_0x3fe5('0x36')]};return db['SmsQueueReport'][_0x3fe5('0x3c')](_0x5d2f40)['then'](function(_0x1b0b59){_0xd18101[_0x3fe5('0x3c')]=_0x1b0b59;if(_0x11fb50[_0x3fe5('0x2d')][_0x3fe5('0x3d')]){_0x4e6d01[_0x3fe5('0x3e')]=[{'all':!![]}];}return db[_0x3fe5('0x3f')][_0x3fe5('0x40')](_0x4e6d01);})[_0x3fe5('0x22')](function(_0x598cfb){_0xd18101['rows']=_0x598cfb;return _0xd18101;})[_0x3fe5('0x22')](respondWithFilteredResult(_0x214301,_0x4e6d01))['catch'](handleError(_0x214301,null));};exports['show']=function(_0x866a49,_0x2ed0e1){var _0x211385={'raw':!![],'where':{'id':_0x866a49[_0x3fe5('0x41')]['id']}},_0x3ea2f9={};_0x3ea2f9['model']=_['keys'](db[_0x3fe5('0x3f')][_0x3fe5('0x29')]);_0x3ea2f9[_0x3fe5('0x2d')]=_[_0x3fe5('0x42')](_0x866a49[_0x3fe5('0x2d')]);_0x3ea2f9[_0x3fe5('0x2e')]=_[_0x3fe5('0x30')](_0x3ea2f9['model'],_0x3ea2f9['query']);_0x211385[_0x3fe5('0x2f')]=_[_0x3fe5('0x30')](_0x3ea2f9[_0x3fe5('0x2c')],qs[_0x3fe5('0x31')](_0x866a49[_0x3fe5('0x2d')][_0x3fe5('0x31')]));_0x211385[_0x3fe5('0x2f')]=_0x211385[_0x3fe5('0x2f')][_0x3fe5('0x32')]?_0x211385['attributes']:_0x3ea2f9[_0x3fe5('0x2c')];if(_0x866a49[_0x3fe5('0x2d')]['includeAll']){_0x211385[_0x3fe5('0x3e')]=[{'all':!![]}];}_0x211385=_[_0x3fe5('0x39')]({},_0x211385,_0x866a49['options']);return db['SmsQueueReport'][_0x3fe5('0x43')](_0x211385)['then'](handleEntityNotFound(_0x2ed0e1,null))[_0x3fe5('0x22')](respondWithResult(_0x2ed0e1,null))[_0x3fe5('0x44')](handleError(_0x2ed0e1,null));};exports[_0x3fe5('0x45')]=function(_0x34ae4f,_0x773f89){return db[_0x3fe5('0x3f')][_0x3fe5('0x45')](_0x34ae4f[_0x3fe5('0x46')],{})['then'](respondWithResult(_0x773f89,0xc9))[_0x3fe5('0x44')](handleError(_0x773f89,null));};exports[_0x3fe5('0x21')]=function(_0xee5304,_0x279a3c){if(_0xee5304[_0x3fe5('0x46')]['id']){delete _0xee5304[_0x3fe5('0x46')]['id'];}return db['SmsQueueReport'][_0x3fe5('0x43')]({'where':{'id':_0xee5304['params']['id']}})['then'](handleEntityNotFound(_0x279a3c,null))['then'](saveUpdates(_0xee5304[_0x3fe5('0x46')],null))[_0x3fe5('0x22')](respondWithResult(_0x279a3c,null))['catch'](handleError(_0x279a3c,null));};exports[_0x3fe5('0x47')]=function(_0x59a703,_0x411fca){return db[_0x3fe5('0x3f')][_0x3fe5('0x43')]({'where':{'id':_0x59a703['params']['id']}})[_0x3fe5('0x22')](handleEntityNotFound(_0x411fca,null))[_0x3fe5('0x22')](removeEntity(_0x411fca,null))['catch'](handleError(_0x411fca,null));};exports[_0x3fe5('0x48')]=function(_0x1366fe,_0x1f900e){return db[_0x3fe5('0x3f')][_0x3fe5('0x48')]()[_0x3fe5('0x22')](respondWithResult(_0x1f900e,null))[_0x3fe5('0x44')](handleError(_0x1f900e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index dcac07f..2075f76 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2ebac0,_0x4d8e8d){var _0x564750=function(_0x394a7){while(--_0x394a7){_0x2ebac0['push'](_0x2ebac0['shift']());}};_0x564750(++_0x4d8e8d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4cb0cf,_0x5569bd){var _0x56b7d9=function(_0x2f46e1){while(--_0x2f46e1){_0x4cb0cf['push'](_0x4cb0cf['shift']());}};_0x56b7d9(++_0x5569bd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ac12f29..99c03ac 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 _0xeeb7=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','then','debug','lodash','util','moment','randomstring','ioredis'];(function(_0x25bd74,_0x35a2ce){var _0x3f1027=function(_0x5b78b4){while(--_0x5b78b4){_0x25bd74['push'](_0x25bd74['shift']());}};_0x3f1027(++_0x35a2ce);}(_0xeeb7,0xa5));var _0x7eeb=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xeeb7[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x7eeb('0x0'));var util=require(_0x7eeb('0x1'));var moment=require(_0x7eeb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7eeb('0x3'));var fs=require('fs');var Redis=require(_0x7eeb('0x4'));var db=require(_0x7eeb('0x5'))['db'];var utils=require(_0x7eeb('0x6'));var logger=require(_0x7eeb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7eeb('0x8'));var client=jayson[_0x7eeb('0x9')][_0x7eeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e198c,_0x2b4957,_0x2a3e51){return new BPromise(function(_0x4289a0,_0x37be08){return client[_0x7eeb('0xb')](_0x5e198c,_0x2a3e51)['then'](function(_0x17b721){logger['info'](_0x7eeb('0xc'),_0x2b4957,_0x7eeb('0xd'));logger['debug'](_0x7eeb('0xe'),_0x2b4957,_0x7eeb('0xd'),JSON[_0x7eeb('0xf')](_0x17b721));if(_0x17b721['error']){if(_0x17b721[_0x7eeb('0x10')][_0x7eeb('0x11')]===0x1f4){logger[_0x7eeb('0x10')](_0x7eeb('0xc'),_0x2b4957,_0x17b721[_0x7eeb('0x10')][_0x7eeb('0x12')]);return _0x37be08(_0x17b721[_0x7eeb('0x10')][_0x7eeb('0x12')]);}logger['error'](_0x7eeb('0xc'),_0x2b4957,_0x17b721[_0x7eeb('0x10')][_0x7eeb('0x12')]);return _0x4289a0(_0x17b721[_0x7eeb('0x10')][_0x7eeb('0x12')]);}else{logger[_0x7eeb('0x13')](_0x7eeb('0xc'),_0x2b4957,'request\x20sent');_0x4289a0(_0x17b721[_0x7eeb('0x14')][_0x7eeb('0x12')]);}})[_0x7eeb('0x15')](function(_0x1e899c){logger[_0x7eeb('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x2b4957,_0x1e899c);_0x37be08(_0x1e899c);});});}exports['CreateSmsQueueReport']=function(_0x4cbd57){var _0x14b851=this;return new Promise(function(_0x285953,_0x55da7d){return db[_0x7eeb('0x16')][_0x7eeb('0x17')](_0x4cbd57[_0x7eeb('0x18')],{'raw':_0x4cbd57[_0x7eeb('0x19')]?_0x4cbd57[_0x7eeb('0x19')][_0x7eeb('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x55b956){logger[_0x7eeb('0x13')](_0x7eeb('0x1b'),_0x4cbd57);logger['debug'](_0x7eeb('0x1b'),_0x4cbd57,JSON[_0x7eeb('0xf')](_0x55b956));_0x285953(_0x55b956);})[_0x7eeb('0x15')](function(_0x51e4b8){logger['error'](_0x7eeb('0x1b'),_0x51e4b8[_0x7eeb('0x12')],_0x4cbd57);_0x55da7d(_0x14b851['error'](0x1f4,_0x51e4b8[_0x7eeb('0x12')]));});});};exports[_0x7eeb('0x1c')]=function(_0x535d95){var _0x1fd6f3=this;return new Promise(function(_0x123388,_0x2e1828){return db[_0x7eeb('0x16')][_0x7eeb('0x1d')](_0x535d95[_0x7eeb('0x18')],{'raw':_0x535d95['options']?_0x535d95[_0x7eeb('0x19')][_0x7eeb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535d95[_0x7eeb('0x19')]?_0x535d95[_0x7eeb('0x19')][_0x7eeb('0x1e')]||null:null,'attributes':_0x535d95[_0x7eeb('0x19')]?_0x535d95[_0x7eeb('0x19')][_0x7eeb('0x1f')]||null:null,'limit':_0x535d95['options']?_0x535d95[_0x7eeb('0x19')]['limit']||null:null})[_0x7eeb('0x20')](function(_0x2f0d94){logger[_0x7eeb('0x13')](_0x7eeb('0x1c'),_0x535d95);logger[_0x7eeb('0x21')](_0x7eeb('0x1c'),_0x535d95,JSON[_0x7eeb('0xf')](_0x2f0d94));_0x123388(_0x2f0d94);})[_0x7eeb('0x15')](function(_0xad6f10){logger[_0x7eeb('0x10')](_0x7eeb('0x1c'),_0xad6f10[_0x7eeb('0x12')],_0x535d95);_0x2e1828(_0x1fd6f3[_0x7eeb('0x10')](0x1f4,_0xad6f10['message']));});});}; \ No newline at end of file +var _0x64ed=['attributes','limit','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','options','raw','debug','stringify','CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','update','body','where'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x64ed,0x7e));var _0xd64e=function(_0x5040e1,_0x314bd8){_0x5040e1=_0x5040e1-0x0;var _0x111b72=_0x64ed[_0x5040e1];return _0x111b72;};'use strict';var _=require(_0xd64e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd64e('0x1'));var db=require(_0xd64e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd64e('0x3'))('rpc');var config=require(_0xd64e('0x4'));var jayson=require(_0xd64e('0x5'));var client=jayson[_0xd64e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2be03f,_0x268ad9,_0x50987b){return new BPromise(function(_0x5e2715,_0x3072c2){return client[_0xd64e('0x7')](_0x2be03f,_0x50987b)[_0xd64e('0x8')](function(_0x1b2add){logger[_0xd64e('0x9')](_0xd64e('0xa'),_0x268ad9,_0xd64e('0xb'));logger['debug'](_0xd64e('0xc'),_0x268ad9,_0xd64e('0xb'),JSON['stringify'](_0x1b2add));if(_0x1b2add['error']){if(_0x1b2add[_0xd64e('0xd')][_0xd64e('0xe')]===0x1f4){logger[_0xd64e('0xd')](_0xd64e('0xa'),_0x268ad9,_0x1b2add[_0xd64e('0xd')]['message']);return _0x3072c2(_0x1b2add[_0xd64e('0xd')]['message']);}logger[_0xd64e('0xd')](_0xd64e('0xa'),_0x268ad9,_0x1b2add['error'][_0xd64e('0xf')]);return _0x5e2715(_0x1b2add[_0xd64e('0xd')][_0xd64e('0xf')]);}else{logger['info'](_0xd64e('0xa'),_0x268ad9,_0xd64e('0xb'));_0x5e2715(_0x1b2add[_0xd64e('0x10')]['message']);}})[_0xd64e('0x11')](function(_0x29ea76){logger['error'](_0xd64e('0xa'),_0x268ad9,_0x29ea76);_0x3072c2(_0x29ea76);});});}exports['CreateSmsQueueReport']=function(_0x3e4b94){var _0x4f3b87=this;return new Promise(function(_0x44c90e,_0x577682){return db['SmsQueueReport'][_0xd64e('0x12')](_0x3e4b94['body'],{'raw':_0x3e4b94[_0xd64e('0x13')]?_0x3e4b94[_0xd64e('0x13')][_0xd64e('0x14')]===undefined?!![]:![]:!![]})[_0xd64e('0x8')](function(_0x586200){logger['info']('CreateSmsQueueReport',_0x3e4b94);logger[_0xd64e('0x15')]('CreateSmsQueueReport',_0x3e4b94,JSON[_0xd64e('0x16')](_0x586200));_0x44c90e(_0x586200);})[_0xd64e('0x11')](function(_0x57c0c9){logger[_0xd64e('0xd')](_0xd64e('0x17'),_0x57c0c9[_0xd64e('0xf')],_0x3e4b94);_0x577682(_0x4f3b87[_0xd64e('0xd')](0x1f4,_0x57c0c9[_0xd64e('0xf')]));});});};exports[_0xd64e('0x18')]=function(_0x53b738){var _0x3c889f=this;return new Promise(function(_0x22f58d,_0xc7cd7){return db[_0xd64e('0x19')][_0xd64e('0x1a')](_0x53b738[_0xd64e('0x1b')],{'raw':_0x53b738['options']?_0x53b738[_0xd64e('0x13')][_0xd64e('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53b738[_0xd64e('0x13')]?_0x53b738[_0xd64e('0x13')][_0xd64e('0x1c')]||null:null,'attributes':_0x53b738[_0xd64e('0x13')]?_0x53b738[_0xd64e('0x13')][_0xd64e('0x1d')]||null:null,'limit':_0x53b738[_0xd64e('0x13')]?_0x53b738['options'][_0xd64e('0x1e')]||null:null})[_0xd64e('0x8')](function(_0x14ee61){logger[_0xd64e('0x9')]('UpdateSmsQueueReport',_0x53b738);logger[_0xd64e('0x15')](_0xd64e('0x18'),_0x53b738,JSON[_0xd64e('0x16')](_0x14ee61));_0x22f58d(_0x14ee61);})['catch'](function(_0x21e944){logger[_0xd64e('0xd')](_0xd64e('0x18'),_0x21e944[_0xd64e('0xf')],_0x53b738);_0xc7cd7(_0x3c889f['error'](0x1f4,_0x21e944['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 6a8e540..6ab0518 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 _0x0207=['../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f462e,_0x2f6207){var _0x170cde=function(_0x4cd982){while(--_0x4cd982){_0x4f462e['push'](_0x4f462e['shift']());}};_0x170cde(++_0x2f6207);}(_0x0207,0x162));var _0x7020=function(_0x12244f,_0x3738a6){_0x12244f=_0x12244f-0x0;var _0x5bc625=_0x0207[_0x12244f];return _0x5bc625;};'use strict';var multer=require('multer');var util=require(_0x7020('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7020('0x1'));var router=express[_0x7020('0x2')]();var fs_extra=require(_0x7020('0x3'));var auth=require(_0x7020('0x4'));var interaction=require(_0x7020('0x5'));var config=require(_0x7020('0x6'));var controller=require(_0x7020('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7020('0x8')]);router[_0x7020('0x9')](_0x7020('0xa'),auth[_0x7020('0xb')](),controller[_0x7020('0xc')]);router[_0x7020('0x9')](_0x7020('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7020('0xe')]('/',auth[_0x7020('0xb')](),controller[_0x7020('0xf')]);router['put'](_0x7020('0xd'),auth[_0x7020('0xb')](),controller['update']);router[_0x7020('0x10')](_0x7020('0xd'),auth[_0x7020('0xb')](),controller['destroy']);module[_0x7020('0x11')]=router; \ No newline at end of file +var _0x23f4=['exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','put','update','destroy'];(function(_0x239e3d,_0x123151){var _0x44d278=function(_0xecd472){while(--_0xecd472){_0x239e3d['push'](_0x239e3d['shift']());}};_0x44d278(++_0x123151);}(_0x23f4,0x1ee));var _0x423f=function(_0x3965d8,_0x570a57){_0x3965d8=_0x3965d8-0x0;var _0x3c168a=_0x23f4[_0x3965d8];return _0x3c168a;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0x8')](_0x423f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x423f('0x9')](),controller['create']);router[_0x423f('0xd')](_0x423f('0xc'),auth[_0x423f('0x9')](),controller[_0x423f('0xe')]);router['delete'](_0x423f('0xc'),auth[_0x423f('0x9')](),controller[_0x423f('0xf')]);module[_0x423f('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a61e9e7..eecca22 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d32e9,_0x390d44){var _0x2d9ece=function(_0xabbd89){while(--_0xabbd89){_0x4d32e9['push'](_0x4d32e9['shift']());}};_0x2d9ece(++_0x390d44);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x567921,_0x31cf9d){var _0x3c35d9=function(_0x576dc6){while(--_0x576dc6){_0x567921['push'](_0x567921['shift']());}};_0x3c35d9(++_0x31cf9d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a4d20d4..cf36f9c 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 _0xc8e4=['Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','params','keys','length','includeAll','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x43ba00,_0x265a33){var _0x335542=function(_0x389895){while(--_0x389895){_0x43ba00['push'](_0x43ba00['shift']());}};_0x335542(++_0x265a33);}(_0xc8e4,0x71));var _0x4c8e=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xc8e4[_0x448f8];return _0xa73126;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c8e('0x0'));var zipdir=require(_0x4c8e('0x1'));var jsonpatch=require(_0x4c8e('0x2'));var rp=require('request-promise');var moment=require(_0x4c8e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c8e('0x4'));var util=require(_0x4c8e('0x5'));var path=require(_0x4c8e('0x6'));var sox=require(_0x4c8e('0x7'));var csv=require(_0x4c8e('0x8'));var ejs=require(_0x4c8e('0x9'));var fs=require('fs');var fs_extra=require(_0x4c8e('0xa'));var _=require(_0x4c8e('0xb'));var squel=require(_0x4c8e('0xc'));var crypto=require(_0x4c8e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4c8e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4c8e('0xf'));var qs=require(_0x4c8e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c8e('0x11'))(_0x4c8e('0x12'));var utils=require(_0x4c8e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c8e('0x14'))['db'];function respondWithStatusCode(_0x580f92,_0x2c9257){_0x2c9257=_0x2c9257||0xcc;return function(_0x52373a){if(_0x52373a){return _0x580f92['sendStatus'](_0x2c9257);}return _0x580f92[_0x4c8e('0x15')](_0x2c9257)[_0x4c8e('0x16')]();};}function respondWithResult(_0x118b5d,_0x1a265c){_0x1a265c=_0x1a265c||0xc8;return function(_0x10fcef){if(_0x10fcef){return _0x118b5d['status'](_0x1a265c)[_0x4c8e('0x17')](_0x10fcef);}};}function respondWithFilteredResult(_0x1852e5,_0x31b63d){return function(_0x1c87b4){if(_0x1c87b4){var _0x255287=typeof _0x31b63d[_0x4c8e('0x18')]===_0x4c8e('0x19')&&typeof _0x31b63d[_0x4c8e('0x1a')]==='undefined';var _0x120f53=_0x1c87b4[_0x4c8e('0x1b')];var _0x2f9f6f=_0x255287?0x0:_0x31b63d[_0x4c8e('0x18')];var _0x45d21c=_0x255287?_0x1c87b4['count']:_0x31b63d[_0x4c8e('0x18')]+_0x31b63d[_0x4c8e('0x1a')];var _0x1f932;if(_0x45d21c>=_0x120f53){_0x45d21c=_0x120f53;_0x1f932=0xc8;}else{_0x1f932=0xce;}_0x1852e5[_0x4c8e('0x15')](_0x1f932);return _0x1852e5[_0x4c8e('0x1c')](_0x4c8e('0x1d'),_0x2f9f6f+'-'+_0x45d21c+'/'+_0x120f53)[_0x4c8e('0x17')](_0x1c87b4);}return null;};}function patchUpdates(_0x6cb38b){return function(_0x22c2c7){try{jsonpatch[_0x4c8e('0x1e')](_0x22c2c7,_0x6cb38b,!![]);}catch(_0x557aa4){return BPromise['reject'](_0x557aa4);}return _0x22c2c7[_0x4c8e('0x1f')]();};}function saveUpdates(_0x483963,_0x166aaa){return function(_0xef8515){if(_0xef8515){return _0xef8515[_0x4c8e('0x20')](_0x483963)['then'](function(_0x2ebfeb){return _0x2ebfeb;});}return null;};}function removeEntity(_0x287a39,_0x1a4863){return function(_0x2f2426){if(_0x2f2426){return _0x2f2426[_0x4c8e('0x21')]()[_0x4c8e('0x22')](function(){_0x287a39[_0x4c8e('0x15')](0xcc)[_0x4c8e('0x16')]();});}};}function handleEntityNotFound(_0x4a0818,_0x2f17a3){return function(_0x458b9e){if(!_0x458b9e){_0x4a0818['sendStatus'](0x194);}return _0x458b9e;};}function handleError(_0x118800,_0x3a7fa0){_0x3a7fa0=_0x3a7fa0||0x1f4;return function(_0x27b6a1){logger[_0x4c8e('0x23')](_0x27b6a1[_0x4c8e('0x24')]);if(_0x27b6a1[_0x4c8e('0x25')]){delete _0x27b6a1[_0x4c8e('0x25')];}_0x118800[_0x4c8e('0x15')](_0x3a7fa0)[_0x4c8e('0x26')](_0x27b6a1);};}exports[_0x4c8e('0x27')]=function(_0x21940c,_0x52ce0f){var _0x40a7f6={},_0xc41f42={},_0x805ac5={'count':0x0,'rows':[]};var _0x5b075a=_[_0x4c8e('0x28')](db[_0x4c8e('0x29')][_0x4c8e('0x2a')],function(_0x271566){return{'name':_0x271566[_0x4c8e('0x2b')],'type':_0x271566[_0x4c8e('0x2c')][_0x4c8e('0x2d')]};});_0xc41f42[_0x4c8e('0x2e')]=_['map'](_0x5b075a,_0x4c8e('0x25'));_0xc41f42[_0x4c8e('0x2f')]=_['keys'](_0x21940c[_0x4c8e('0x2f')]);_0xc41f42[_0x4c8e('0x30')]=_[_0x4c8e('0x31')](_0xc41f42[_0x4c8e('0x2e')],_0xc41f42['query']);_0x40a7f6[_0x4c8e('0x32')]=_[_0x4c8e('0x31')](_0xc41f42[_0x4c8e('0x2e')],qs[_0x4c8e('0x33')](_0x21940c[_0x4c8e('0x2f')][_0x4c8e('0x33')]));_0x40a7f6[_0x4c8e('0x32')]=_0x40a7f6['attributes']['length']?_0x40a7f6[_0x4c8e('0x32')]:_0xc41f42['model'];if(!_0x21940c[_0x4c8e('0x2f')][_0x4c8e('0x34')]('nolimit')){_0x40a7f6['limit']=qs['limit'](_0x21940c[_0x4c8e('0x2f')][_0x4c8e('0x1a')]);_0x40a7f6['offset']=qs['offset'](_0x21940c[_0x4c8e('0x2f')][_0x4c8e('0x18')]);}_0x40a7f6[_0x4c8e('0x35')]=qs['sort'](_0x21940c[_0x4c8e('0x2f')][_0x4c8e('0x36')]);_0x40a7f6[_0x4c8e('0x37')]=qs['filters'](_[_0x4c8e('0x38')](_0x21940c['query'],_0xc41f42[_0x4c8e('0x30')]),_0x5b075a);if(_0x21940c['query'][_0x4c8e('0x39')]){_0x40a7f6[_0x4c8e('0x37')]=_[_0x4c8e('0x3a')](_0x40a7f6[_0x4c8e('0x37')],{'$or':_[_0x4c8e('0x28')](_0x5b075a,function(_0xaf5f75){if(_0xaf5f75['type']!==_0x4c8e('0x3b')){var _0x2f11d3={};_0x2f11d3[_0xaf5f75[_0x4c8e('0x25')]]={'$like':'%'+_0x21940c['query'][_0x4c8e('0x39')]+'%'};return _0x2f11d3;}})});}_0x40a7f6=_['merge']({},_0x40a7f6,_0x21940c[_0x4c8e('0x3c')]);var _0x45989f={'where':_0x40a7f6[_0x4c8e('0x37')]};return db[_0x4c8e('0x29')][_0x4c8e('0x1b')](_0x45989f)['then'](function(_0x2509bb){_0x805ac5['count']=_0x2509bb;if(_0x21940c[_0x4c8e('0x2f')]['includeAll']){_0x40a7f6[_0x4c8e('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x40a7f6);})[_0x4c8e('0x22')](function(_0x1e8c27){_0x805ac5['rows']=_0x1e8c27;return _0x805ac5;})['then'](respondWithFilteredResult(_0x52ce0f,_0x40a7f6))['catch'](handleError(_0x52ce0f,null));};exports['show']=function(_0x468a1c,_0x56a060){var _0x1fea5f={'raw':!![],'where':{'id':_0x468a1c[_0x4c8e('0x3e')]['id']}},_0x22f289={};_0x22f289[_0x4c8e('0x2e')]=_[_0x4c8e('0x3f')](db[_0x4c8e('0x29')]['rawAttributes']);_0x22f289[_0x4c8e('0x2f')]=_[_0x4c8e('0x3f')](_0x468a1c[_0x4c8e('0x2f')]);_0x22f289[_0x4c8e('0x30')]=_['intersection'](_0x22f289['model'],_0x22f289[_0x4c8e('0x2f')]);_0x1fea5f['attributes']=_[_0x4c8e('0x31')](_0x22f289['model'],qs[_0x4c8e('0x33')](_0x468a1c[_0x4c8e('0x2f')][_0x4c8e('0x33')]));_0x1fea5f[_0x4c8e('0x32')]=_0x1fea5f[_0x4c8e('0x32')][_0x4c8e('0x40')]?_0x1fea5f[_0x4c8e('0x32')]:_0x22f289[_0x4c8e('0x2e')];if(_0x468a1c[_0x4c8e('0x2f')][_0x4c8e('0x41')]){_0x1fea5f[_0x4c8e('0x3d')]=[{'all':!![]}];}_0x1fea5f=_[_0x4c8e('0x3a')]({},_0x1fea5f,_0x468a1c[_0x4c8e('0x3c')]);return db[_0x4c8e('0x29')][_0x4c8e('0x42')](_0x1fea5f)[_0x4c8e('0x22')](handleEntityNotFound(_0x56a060,null))[_0x4c8e('0x22')](respondWithResult(_0x56a060,null))[_0x4c8e('0x43')](handleError(_0x56a060,null));};exports[_0x4c8e('0x44')]=function(_0x41fd4b,_0x58d285){return db[_0x4c8e('0x29')][_0x4c8e('0x44')](_0x41fd4b[_0x4c8e('0x45')],{})[_0x4c8e('0x22')](respondWithResult(_0x58d285,0xc9))['catch'](handleError(_0x58d285,null));};exports['update']=function(_0xce1073,_0x190df4){if(_0xce1073[_0x4c8e('0x45')]['id']){delete _0xce1073[_0x4c8e('0x45')]['id'];}return db['SmsTransferReport'][_0x4c8e('0x42')]({'where':{'id':_0xce1073[_0x4c8e('0x3e')]['id']}})[_0x4c8e('0x22')](handleEntityNotFound(_0x190df4,null))[_0x4c8e('0x22')](saveUpdates(_0xce1073[_0x4c8e('0x45')],null))[_0x4c8e('0x22')](respondWithResult(_0x190df4,null))[_0x4c8e('0x43')](handleError(_0x190df4,null));};exports[_0x4c8e('0x21')]=function(_0x229564,_0x351b7a){return db['SmsTransferReport'][_0x4c8e('0x42')]({'where':{'id':_0x229564[_0x4c8e('0x3e')]['id']}})[_0x4c8e('0x22')](handleEntityNotFound(_0x351b7a,null))['then'](removeEntity(_0x351b7a,null))[_0x4c8e('0x43')](handleError(_0x351b7a,null));};exports[_0x4c8e('0x46')]=function(_0x18f210,_0x259124){return db[_0x4c8e('0x29')]['describe']()[_0x4c8e('0x22')](respondWithResult(_0x259124,null))['catch'](handleError(_0x259124,null));}; \ No newline at end of file +var _0xedc0=['index','map','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','error','name','send'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xedc0,0xf5));var _0x0edc=function(_0x8f6830,_0x7c8a1e){_0x8f6830=_0x8f6830-0x0;var _0x4ce2e5=_0xedc0[_0x8f6830];return _0x4ce2e5;};'use strict';var emlformat=require(_0x0edc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0edc('0x1'));var jsonpatch=require(_0x0edc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0edc('0x3'));var Mustache=require(_0x0edc('0x4'));var util=require('util');var path=require(_0x0edc('0x5'));var sox=require(_0x0edc('0x6'));var csv=require(_0x0edc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0edc('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0edc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0edc('0xa'));var toCsv=require(_0x0edc('0x7'));var querystring=require(_0x0edc('0xb'));var Papa=require(_0x0edc('0xc'));var Redis=require(_0x0edc('0xd'));var authService=require(_0x0edc('0xe'));var qs=require(_0x0edc('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0edc('0x10'));var logger=require(_0x0edc('0x11'))(_0x0edc('0x12'));var utils=require(_0x0edc('0x13'));var config=require(_0x0edc('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0edc('0x15'))['db'];function respondWithStatusCode(_0x4f7800,_0x5d1bcd){_0x5d1bcd=_0x5d1bcd||0xcc;return function(_0x126adf){if(_0x126adf){return _0x4f7800[_0x0edc('0x16')](_0x5d1bcd);}return _0x4f7800[_0x0edc('0x17')](_0x5d1bcd)[_0x0edc('0x18')]();};}function respondWithResult(_0x471c17,_0x405663){_0x405663=_0x405663||0xc8;return function(_0x2b019d){if(_0x2b019d){return _0x471c17['status'](_0x405663)[_0x0edc('0x19')](_0x2b019d);}};}function respondWithFilteredResult(_0x178496,_0x18303e){return function(_0x32cba2){if(_0x32cba2){var _0x1acd51=typeof _0x18303e[_0x0edc('0x1a')]==='undefined'&&typeof _0x18303e[_0x0edc('0x1b')]===_0x0edc('0x1c');var _0x3df8b0=_0x32cba2[_0x0edc('0x1d')];var _0x5e254b=_0x1acd51?0x0:_0x18303e[_0x0edc('0x1a')];var _0x5b94c1=_0x1acd51?_0x32cba2['count']:_0x18303e[_0x0edc('0x1a')]+_0x18303e[_0x0edc('0x1b')];var _0x3a8411;if(_0x5b94c1>=_0x3df8b0){_0x5b94c1=_0x3df8b0;_0x3a8411=0xc8;}else{_0x3a8411=0xce;}_0x178496[_0x0edc('0x17')](_0x3a8411);return _0x178496[_0x0edc('0x1e')]('Content-Range',_0x5e254b+'-'+_0x5b94c1+'/'+_0x3df8b0)['json'](_0x32cba2);}return null;};}function patchUpdates(_0x2288eb){return function(_0x97d944){try{jsonpatch[_0x0edc('0x1f')](_0x97d944,_0x2288eb,!![]);}catch(_0x3b4a87){return BPromise[_0x0edc('0x20')](_0x3b4a87);}return _0x97d944['save']();};}function saveUpdates(_0x213e36,_0x524bf9){return function(_0x831d1f){if(_0x831d1f){return _0x831d1f[_0x0edc('0x21')](_0x213e36)['then'](function(_0x194a17){return _0x194a17;});}return null;};}function removeEntity(_0x4bbf4c,_0x408fae){return function(_0x338439){if(_0x338439){return _0x338439[_0x0edc('0x22')]()[_0x0edc('0x23')](function(){_0x4bbf4c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d6cd6,_0x43e3d4){return function(_0x632c1b){if(!_0x632c1b){_0x5d6cd6[_0x0edc('0x16')](0x194);}return _0x632c1b;};}function handleError(_0x5389f,_0x1a8956){_0x1a8956=_0x1a8956||0x1f4;return function(_0x34288d){logger[_0x0edc('0x24')](_0x34288d['stack']);if(_0x34288d[_0x0edc('0x25')]){delete _0x34288d[_0x0edc('0x25')];}_0x5389f['status'](_0x1a8956)[_0x0edc('0x26')](_0x34288d);};}exports[_0x0edc('0x27')]=function(_0x514fed,_0x1df584){var _0x43f951={},_0x29af43={},_0x505d15={'count':0x0,'rows':[]};var _0x3e444a=_[_0x0edc('0x28')](db[_0x0edc('0x29')][_0x0edc('0x2a')],function(_0x5928f2){return{'name':_0x5928f2['fieldName'],'type':_0x5928f2['type']['key']};});_0x29af43[_0x0edc('0x2b')]=_[_0x0edc('0x28')](_0x3e444a,_0x0edc('0x25'));_0x29af43['query']=_[_0x0edc('0x2c')](_0x514fed[_0x0edc('0x2d')]);_0x29af43[_0x0edc('0x2e')]=_[_0x0edc('0x2f')](_0x29af43['model'],_0x29af43[_0x0edc('0x2d')]);_0x43f951[_0x0edc('0x30')]=_['intersection'](_0x29af43[_0x0edc('0x2b')],qs['fields'](_0x514fed['query'][_0x0edc('0x31')]));_0x43f951[_0x0edc('0x30')]=_0x43f951[_0x0edc('0x30')][_0x0edc('0x32')]?_0x43f951['attributes']:_0x29af43[_0x0edc('0x2b')];if(!_0x514fed[_0x0edc('0x2d')][_0x0edc('0x33')](_0x0edc('0x34'))){_0x43f951[_0x0edc('0x1b')]=qs[_0x0edc('0x1b')](_0x514fed[_0x0edc('0x2d')]['limit']);_0x43f951[_0x0edc('0x1a')]=qs[_0x0edc('0x1a')](_0x514fed[_0x0edc('0x2d')]['offset']);}_0x43f951[_0x0edc('0x35')]=qs['sort'](_0x514fed[_0x0edc('0x2d')][_0x0edc('0x36')]);_0x43f951[_0x0edc('0x37')]=qs[_0x0edc('0x2e')](_[_0x0edc('0x38')](_0x514fed[_0x0edc('0x2d')],_0x29af43[_0x0edc('0x2e')]),_0x3e444a);if(_0x514fed[_0x0edc('0x2d')][_0x0edc('0x39')]){_0x43f951['where']=_[_0x0edc('0x3a')](_0x43f951['where'],{'$or':_[_0x0edc('0x28')](_0x3e444a,function(_0x3a747d){if(_0x3a747d[_0x0edc('0x3b')]!==_0x0edc('0x3c')){var _0x323006={};_0x323006[_0x3a747d[_0x0edc('0x25')]]={'$like':'%'+_0x514fed[_0x0edc('0x2d')][_0x0edc('0x39')]+'%'};return _0x323006;}})});}_0x43f951=_['merge']({},_0x43f951,_0x514fed[_0x0edc('0x3d')]);var _0x226146={'where':_0x43f951['where']};return db[_0x0edc('0x29')][_0x0edc('0x1d')](_0x226146)['then'](function(_0x3567c9){_0x505d15[_0x0edc('0x1d')]=_0x3567c9;if(_0x514fed[_0x0edc('0x2d')][_0x0edc('0x3e')]){_0x43f951[_0x0edc('0x3f')]=[{'all':!![]}];}return db[_0x0edc('0x29')][_0x0edc('0x40')](_0x43f951);})['then'](function(_0x57ff07){_0x505d15['rows']=_0x57ff07;return _0x505d15;})['then'](respondWithFilteredResult(_0x1df584,_0x43f951))[_0x0edc('0x41')](handleError(_0x1df584,null));};exports['show']=function(_0xd99918,_0x437f0f){var _0x10bf53={'raw':!![],'where':{'id':_0xd99918[_0x0edc('0x42')]['id']}},_0x3451f7={};_0x3451f7['model']=_['keys'](db[_0x0edc('0x29')][_0x0edc('0x2a')]);_0x3451f7['query']=_[_0x0edc('0x2c')](_0xd99918['query']);_0x3451f7['filters']=_[_0x0edc('0x2f')](_0x3451f7['model'],_0x3451f7[_0x0edc('0x2d')]);_0x10bf53[_0x0edc('0x30')]=_[_0x0edc('0x2f')](_0x3451f7['model'],qs[_0x0edc('0x31')](_0xd99918[_0x0edc('0x2d')][_0x0edc('0x31')]));_0x10bf53[_0x0edc('0x30')]=_0x10bf53[_0x0edc('0x30')][_0x0edc('0x32')]?_0x10bf53[_0x0edc('0x30')]:_0x3451f7[_0x0edc('0x2b')];if(_0xd99918[_0x0edc('0x2d')][_0x0edc('0x3e')]){_0x10bf53[_0x0edc('0x3f')]=[{'all':!![]}];}_0x10bf53=_[_0x0edc('0x3a')]({},_0x10bf53,_0xd99918[_0x0edc('0x3d')]);return db['SmsTransferReport'][_0x0edc('0x43')](_0x10bf53)['then'](handleEntityNotFound(_0x437f0f,null))[_0x0edc('0x23')](respondWithResult(_0x437f0f,null))[_0x0edc('0x41')](handleError(_0x437f0f,null));};exports['create']=function(_0x1ebb5c,_0x137ccc){return db[_0x0edc('0x29')][_0x0edc('0x44')](_0x1ebb5c[_0x0edc('0x45')],{})[_0x0edc('0x23')](respondWithResult(_0x137ccc,0xc9))[_0x0edc('0x41')](handleError(_0x137ccc,null));};exports[_0x0edc('0x21')]=function(_0x352574,_0x1d9760){if(_0x352574['body']['id']){delete _0x352574[_0x0edc('0x45')]['id'];}return db[_0x0edc('0x29')]['find']({'where':{'id':_0x352574['params']['id']}})[_0x0edc('0x23')](handleEntityNotFound(_0x1d9760,null))['then'](saveUpdates(_0x352574[_0x0edc('0x45')],null))[_0x0edc('0x23')](respondWithResult(_0x1d9760,null))[_0x0edc('0x41')](handleError(_0x1d9760,null));};exports[_0x0edc('0x22')]=function(_0x407beb,_0x40d4ca){return db[_0x0edc('0x29')]['find']({'where':{'id':_0x407beb[_0x0edc('0x42')]['id']}})['then'](handleEntityNotFound(_0x40d4ca,null))[_0x0edc('0x23')](removeEntity(_0x40d4ca,null))[_0x0edc('0x41')](handleError(_0x40d4ca,null));};exports[_0x0edc('0x46')]=function(_0x509ce5,_0xea87b3){return db[_0x0edc('0x29')]['describe']()[_0x0edc('0x23')](respondWithResult(_0xea87b3,null))[_0x0edc('0x41')](handleError(_0xea87b3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 742933e..71a5119 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 _0x1023=['uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer'];(function(_0x4f57a0,_0x1deb37){var _0xb6a273=function(_0x4cba13){while(--_0x4cba13){_0x4f57a0['push'](_0x4f57a0['shift']());}};_0xb6a273(++_0x1deb37);}(_0x1023,0xc1));var _0x3102=function(_0x4bf2ba,_0x506cd0){_0x4bf2ba=_0x4bf2ba-0x0;var _0x3ea44e=_0x1023[_0x4bf2ba];return _0x3ea44e;};'use strict';var _=require(_0x3102('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3102('0x1'));var BPromise=require(_0x3102('0x2'));var rp=require(_0x3102('0x3'));var fs=require('fs');var path=require(_0x3102('0x4'));var rimraf=require(_0x3102('0x5'));var config=require(_0x3102('0x6'));var attributes=require(_0x3102('0x7'));module[_0x3102('0x8')]=function(_0x48eaaf,_0x400766){return _0x48eaaf[_0x3102('0x9')]('SmsTransferReport',attributes,{'tableName':_0x3102('0xa'),'paranoid':![],'indexes':[{'name':_0x3102('0xb'),'fields':[_0x3102('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4c2=['lodash','util','api','moment','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xc4c2,0x155));var _0x2c4c=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xc4c2[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x2c4c('0x0'));var util=require(_0x2c4c('0x1'));var logger=require('../../config/logger')(_0x2c4c('0x2'));var moment=require(_0x2c4c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c4c('0x4'));var attributes=require(_0x2c4c('0x5'));module[_0x2c4c('0x6')]=function(_0x3a60d5,_0x12e557){return _0x3a60d5[_0x2c4c('0x7')](_0x2c4c('0x8'),attributes,{'tableName':_0x2c4c('0x9'),'paranoid':![],'indexes':[{'name':_0x2c4c('0xa'),'fields':[_0x2c4c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f5e76bd..068b339 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 _0xb91a=['jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xb91a,0xf4));var _0xab91=function(_0x21b826,_0x4c350f){_0x21b826=_0x21b826-0x0;var _0x598029=_0xb91a[_0x21b826];return _0x598029;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var moment=require(_0xab91('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab91('0x3'));var db=require(_0xab91('0x4'))['db'];var utils=require(_0xab91('0x5'));var logger=require(_0xab91('0x6'))(_0xab91('0x7'));var config=require(_0xab91('0x8'));var jayson=require(_0xab91('0x9'));var client=jayson[_0xab91('0xa')][_0xab91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34932f,_0x5dd52d,_0x1729f6){return new BPromise(function(_0x1e8d52,_0x4bc8cd){return client['request'](_0x34932f,_0x1729f6)['then'](function(_0x19e61d){logger[_0xab91('0xc')](_0xab91('0xd'),_0x5dd52d,_0xab91('0xe'));logger[_0xab91('0xf')](_0xab91('0x10'),_0x5dd52d,_0xab91('0xe'),JSON[_0xab91('0x11')](_0x19e61d));if(_0x19e61d[_0xab91('0x12')]){if(_0x19e61d[_0xab91('0x12')][_0xab91('0x13')]===0x1f4){logger[_0xab91('0x12')](_0xab91('0xd'),_0x5dd52d,_0x19e61d['error']['message']);return _0x4bc8cd(_0x19e61d[_0xab91('0x12')][_0xab91('0x14')]);}logger[_0xab91('0x12')](_0xab91('0xd'),_0x5dd52d,_0x19e61d[_0xab91('0x12')][_0xab91('0x14')]);return _0x1e8d52(_0x19e61d['error']['message']);}else{logger[_0xab91('0xc')](_0xab91('0xd'),_0x5dd52d,_0xab91('0xe'));_0x1e8d52(_0x19e61d[_0xab91('0x15')][_0xab91('0x14')]);}})[_0xab91('0x16')](function(_0x27b7d1){logger[_0xab91('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5dd52d,_0x27b7d1);_0x4bc8cd(_0x27b7d1);});});} \ No newline at end of file +var _0x0845=['SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','SmsTransferReport,\x20%s,\x20%s','debug'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x0845,0x125));var _0x5084=function(_0x3df142,_0x4309bf){_0x3df142=_0x3df142-0x0;var _0x21594e=_0x0845[_0x3df142];return _0x21594e;};'use strict';var _=require(_0x5084('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5084('0x1'));var rs=require(_0x5084('0x2'));var fs=require('fs');var Redis=require(_0x5084('0x3'));var db=require(_0x5084('0x4'))['db'];var utils=require(_0x5084('0x5'));var logger=require(_0x5084('0x6'))('rpc');var config=require(_0x5084('0x7'));var jayson=require(_0x5084('0x8'));var client=jayson[_0x5084('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3d8f,_0x5a999b,_0x212120){return new BPromise(function(_0x439176,_0x14e571){return client['request'](_0x5f3d8f,_0x212120)['then'](function(_0xbbddf0){logger[_0x5084('0xa')](_0x5084('0xb'),_0x5a999b,'request\x20sent');logger[_0x5084('0xc')](_0x5084('0xd'),_0x5a999b,_0x5084('0xe'),JSON['stringify'](_0xbbddf0));if(_0xbbddf0['error']){if(_0xbbddf0[_0x5084('0xf')][_0x5084('0x10')]===0x1f4){logger[_0x5084('0xf')](_0x5084('0xb'),_0x5a999b,_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);return _0x14e571(_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);}logger['error'](_0x5084('0xb'),_0x5a999b,_0xbbddf0[_0x5084('0xf')][_0x5084('0x11')]);return _0x439176(_0xbbddf0['error'][_0x5084('0x11')]);}else{logger[_0x5084('0xa')](_0x5084('0xb'),_0x5a999b,_0x5084('0xe'));_0x439176(_0xbbddf0['result'][_0x5084('0x11')]);}})['catch'](function(_0x326ca0){logger[_0x5084('0xf')](_0x5084('0xb'),_0x5a999b,_0x326ca0);_0x14e571(_0x326ca0);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ae37644..0577509 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 _0x457e=['format','%s-%s%s','basename','extname','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','/:id','get','/:id/download','download','join','server/files/sounds/original/','originalname','replace'];(function(_0x36c062,_0x43ad1c){var _0x1f5880=function(_0x969177){while(--_0x969177){_0x36c062['push'](_0x36c062['shift']());}};_0x1f5880(++_0x43ad1c);}(_0x457e,0x16b));var _0xe457=function(_0xdd98be,_0x4bd558){_0xdd98be=_0xdd98be-0x0;var _0x3ea23e=_0x457e[_0xdd98be];return _0x3ea23e;};'use strict';var multer=require(_0xe457('0x0'));var util=require(_0xe457('0x1'));var path=require(_0xe457('0x2'));var timeout=require(_0xe457('0x3'));var express=require(_0xe457('0x4'));var router=express[_0xe457('0x5')]();var fs_extra=require(_0xe457('0x6'));var auth=require(_0xe457('0x7'));var interaction=require(_0xe457('0x8'));var config=require(_0xe457('0x9'));var controller=require(_0xe457('0xa'));router['get']('/',auth[_0xe457('0xb')](),controller[_0xe457('0xc')]);router['get'](_0xe457('0xd'),auth[_0xe457('0xb')](),controller['show']);router[_0xe457('0xe')](_0xe457('0xf'),auth[_0xe457('0xb')](),controller[_0xe457('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x614f54,_0x16c58f,_0xce0c1d){_0xce0c1d(null,path[_0xe457('0x11')](config['root'],_0xe457('0x12')));},'filename':function(_0x2ce553,_0x5d207d,_0x581b94){_0x5d207d[_0xe457('0x13')]=_0x5d207d[_0xe457('0x13')][_0xe457('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x581b94(null,util[_0xe457('0x15')](_0xe457('0x16'),path[_0xe457('0x17')](_0x5d207d[_0xe457('0x13')],path[_0xe457('0x18')](_0x5d207d[_0xe457('0x13')])),Date['now'](),path['extname'](_0x5d207d[_0xe457('0x13')])));}})});router['post']('/',upload[_0xe457('0x19')](_0xe457('0x1a')),controller[_0xe457('0x1b')]);router[_0xe457('0x1c')](_0xe457('0xd'),auth[_0xe457('0xb')](),controller[_0xe457('0x1d')]);router[_0xe457('0x1e')](_0xe457('0xd'),auth[_0xe457('0xb')](),controller['delete']);module[_0xe457('0x1f')]=router; \ No newline at end of file +var _0x39d6=['./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','put','delete','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x222321,_0xb07f19){var _0x1e33bc=function(_0x544a5d){while(--_0x544a5d){_0x222321['push'](_0x222321['shift']());}};_0x1e33bc(++_0xb07f19);}(_0x39d6,0x1f2));var _0x639d=function(_0x148acb,_0x2694f7){_0x148acb=_0x148acb-0x0;var _0x3b9378=_0x39d6[_0x148acb];return _0x3b9378;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x639d('0x0'));var timeout=require('connect-timeout');var express=require(_0x639d('0x1'));var router=express[_0x639d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x639d('0x3'));var interaction=require(_0x639d('0x4'));var config=require(_0x639d('0x5'));var controller=require(_0x639d('0x6'));router[_0x639d('0x7')]('/',auth[_0x639d('0x8')](),controller[_0x639d('0x9')]);router[_0x639d('0x7')](_0x639d('0xa'),auth[_0x639d('0x8')](),controller[_0x639d('0xb')]);router[_0x639d('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x639d('0xc')]);var upload=multer({'storage':multer[_0x639d('0xd')]({'destination':function(_0x219379,_0x458cb6,_0x2535a2){_0x2535a2(null,path['join'](config[_0x639d('0xe')],'server/files/sounds/original/'));},'filename':function(_0x3f2e53,_0x40964d,_0x375bb0){_0x40964d[_0x639d('0xf')]=_0x40964d[_0x639d('0xf')][_0x639d('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x375bb0(null,util[_0x639d('0x11')](_0x639d('0x12'),path[_0x639d('0x13')](_0x40964d[_0x639d('0xf')],path[_0x639d('0x14')](_0x40964d['originalname'])),Date[_0x639d('0x15')](),path[_0x639d('0x14')](_0x40964d[_0x639d('0xf')])));}})});router[_0x639d('0x16')]('/',upload[_0x639d('0x17')](_0x639d('0x18')),controller['create']);router[_0x639d('0x19')]('/:id',auth[_0x639d('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x639d('0x1a')]);module[_0x639d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 53497a5..247c133 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 _0x9fb2=['STRING','name','FLOAT','INTEGER','BIGINT','exports'];(function(_0x59fc7f,_0x33a2ba){var _0x25535a=function(_0xd11ba0){while(--_0xd11ba0){_0x59fc7f['push'](_0x59fc7f['shift']());}};_0x25535a(++_0x33a2ba);}(_0x9fb2,0x1df));var _0x29fb=function(_0x1f9862,_0x1047d7){_0x1f9862=_0x1f9862-0x0;var _0x5c41b0=_0x9fb2[_0x1f9862];return _0x5c41b0;};'use strict';var Sequelize=require('sequelize');module[_0x29fb('0x0')]={'name':{'type':Sequelize[_0x29fb('0x1')],'unique':_0x29fb('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x29fb('0x1')]},'display_name':{'type':Sequelize[_0x29fb('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x29fb('0x1')]},'original_format':{'type':Sequelize[_0x29fb('0x1')]},'original_duration':{'type':Sequelize[_0x29fb('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x29fb('0x4')]},'original_bitRate':{'type':Sequelize[_0x29fb('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x29fb('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x534b=['name','STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x264387,_0x4dd80b){var _0x2c953a=function(_0x1d45f1){while(--_0x1d45f1){_0x264387['push'](_0x264387['shift']());}};_0x2c953a(++_0x4dd80b);}(_0x534b,0x161));var _0xb534=function(_0x25bd4a,_0x4cfa1){_0x25bd4a=_0x25bd4a-0x0;var _0x54ba38=_0x534b[_0x25bd4a];return _0x54ba38;};'use strict';var Sequelize=require('sequelize');module[_0xb534('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb534('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb534('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xb534('0x2')]},'original_format':{'type':Sequelize[_0xb534('0x2')]},'original_duration':{'type':Sequelize[_0xb534('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xb534('0x4')]},'original_bitRate':{'type':Sequelize[_0xb534('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xb534('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xb534('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb534('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0fcb8d3..bb548f0 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 _0x15a3=['intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','send','duration','original_sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','Sounds','sendStatus','error','stack','name','index','Sound','rawAttributes','key','model','map','keys','filters','query','attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x15a3,0x1c1));var _0x315a=function(_0x423e15,_0x12b2b2){_0x423e15=_0x423e15-0x0;var _0x184279=_0x15a3[_0x423e15];return _0x184279;};'use strict';var emlformat=require(_0x315a('0x0'));var rimraf=require(_0x315a('0x1'));var zipdir=require(_0x315a('0x2'));var jsonpatch=require(_0x315a('0x3'));var rp=require('request-promise');var moment=require(_0x315a('0x4'));var BPromise=require(_0x315a('0x5'));var Mustache=require(_0x315a('0x6'));var util=require(_0x315a('0x7'));var path=require('path');var sox=require(_0x315a('0x8'));var csv=require(_0x315a('0x9'));var ejs=require(_0x315a('0xa'));var fs=require('fs');var fs_extra=require(_0x315a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x315a('0xc'));var jsforce=require(_0x315a('0xd'));var deskjs=require(_0x315a('0xe'));var toCsv=require(_0x315a('0x9'));var querystring=require(_0x315a('0xf'));var Papa=require('papaparse');var Redis=require(_0x315a('0x10'));var authService=require(_0x315a('0x11'));var qs=require(_0x315a('0x12'));var as=require(_0x315a('0x13'));var hardwareService=require(_0x315a('0x14'));var logger=require(_0x315a('0x15'))(_0x315a('0x16'));var utils=require(_0x315a('0x17'));var config=require(_0x315a('0x18'));var licenseUtil=require(_0x315a('0x19'));var db=require(_0x315a('0x1a'))['db'];function respondWithStatusCode(_0x5dc98c,_0x50d72c){_0x50d72c=_0x50d72c||0xcc;return function(_0x177570){if(_0x177570){return _0x5dc98c['sendStatus'](_0x50d72c);}return _0x5dc98c['status'](_0x50d72c)[_0x315a('0x1b')]();};}function respondWithResult(_0x49728f,_0x4a5356){_0x4a5356=_0x4a5356||0xc8;return function(_0x1ffd6a){if(_0x1ffd6a){return _0x49728f[_0x315a('0x1c')](_0x4a5356)[_0x315a('0x1d')](_0x1ffd6a);}};}function respondWithFilteredResult(_0x4390b2,_0x186970){return function(_0xb9669c){if(_0xb9669c){var _0x652a42=typeof _0x186970['offset']===_0x315a('0x1e')&&typeof _0x186970[_0x315a('0x1f')]==='undefined';var _0x2ba43d=_0xb9669c[_0x315a('0x20')];var _0x1790f1=_0x652a42?0x0:_0x186970[_0x315a('0x21')];var _0x45b57b=_0x652a42?_0xb9669c[_0x315a('0x20')]:_0x186970['offset']+_0x186970[_0x315a('0x1f')];var _0x5be1c9;if(_0x45b57b>=_0x2ba43d){_0x45b57b=_0x2ba43d;_0x5be1c9=0xc8;}else{_0x5be1c9=0xce;}_0x4390b2[_0x315a('0x1c')](_0x5be1c9);return _0x4390b2[_0x315a('0x22')](_0x315a('0x23'),_0x1790f1+'-'+_0x45b57b+'/'+_0x2ba43d)[_0x315a('0x1d')](_0xb9669c);}return null;};}function patchUpdates(_0xee83eb){return function(_0x595a71){try{jsonpatch['apply'](_0x595a71,_0xee83eb,!![]);}catch(_0x452319){return BPromise[_0x315a('0x24')](_0x452319);}return _0x595a71[_0x315a('0x25')]();};}function saveUpdates(_0x411621,_0x2a253b){return function(_0x64b6e){if(_0x64b6e){return _0x64b6e['update'](_0x411621)[_0x315a('0x26')](function(_0x58356c){return _0x58356c;});}return null;};}function removeEntity(_0x413d4b,_0x1b82ca){return function(_0x114def){if(_0x114def){return _0x114def[_0x315a('0x27')]()['then'](function(){var _0x1dfbc7=_0x114def['get']({'plain':!![]});var _0x2e0b24=_0x315a('0x28');return db['UserProfileResource'][_0x315a('0x27')]({'where':{'type':_0x2e0b24,'resourceId':_0x1dfbc7['id']}})[_0x315a('0x26')](function(){return _0x114def;});})[_0x315a('0x26')](function(){_0x413d4b[_0x315a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfab3,_0x390de5){return function(_0x286270){if(!_0x286270){_0x1dfab3[_0x315a('0x29')](0x194);}return _0x286270;};}function handleError(_0x1ec1d0,_0x518227){_0x518227=_0x518227||0x1f4;return function(_0x5cd1dd){logger[_0x315a('0x2a')](_0x5cd1dd[_0x315a('0x2b')]);if(_0x5cd1dd[_0x315a('0x2c')]){delete _0x5cd1dd['name'];}_0x1ec1d0['status'](_0x518227)['send'](_0x5cd1dd);};}exports[_0x315a('0x2d')]=function(_0x579ec4,_0x10531c){var _0x122058={},_0x151d70={},_0x951c8e={'count':0x0,'rows':[]};var _0x3c9733=_['map'](db[_0x315a('0x2e')][_0x315a('0x2f')],function(_0x12ffa2){return{'name':_0x12ffa2['fieldName'],'type':_0x12ffa2['type'][_0x315a('0x30')]};});_0x151d70[_0x315a('0x31')]=_[_0x315a('0x32')](_0x3c9733,_0x315a('0x2c'));_0x151d70['query']=_[_0x315a('0x33')](_0x579ec4['query']);_0x151d70[_0x315a('0x34')]=_['intersection'](_0x151d70['model'],_0x151d70[_0x315a('0x35')]);_0x122058[_0x315a('0x36')]=_[_0x315a('0x37')](_0x151d70[_0x315a('0x31')],qs[_0x315a('0x38')](_0x579ec4[_0x315a('0x35')][_0x315a('0x38')]));_0x122058['attributes']=_0x122058['attributes'][_0x315a('0x39')]?_0x122058[_0x315a('0x36')]:_0x151d70[_0x315a('0x31')];if(!_0x579ec4[_0x315a('0x35')][_0x315a('0x3a')]('nolimit')){_0x122058[_0x315a('0x1f')]=qs[_0x315a('0x1f')](_0x579ec4[_0x315a('0x35')]['limit']);_0x122058[_0x315a('0x21')]=qs[_0x315a('0x21')](_0x579ec4['query'][_0x315a('0x21')]);}_0x122058[_0x315a('0x3b')]=qs[_0x315a('0x3c')](_0x579ec4[_0x315a('0x35')][_0x315a('0x3c')]);_0x122058['where']=qs[_0x315a('0x34')](_[_0x315a('0x3d')](_0x579ec4[_0x315a('0x35')],_0x151d70['filters']),_0x3c9733);if(_0x579ec4[_0x315a('0x35')]['filter']){_0x122058[_0x315a('0x3e')]=_[_0x315a('0x3f')](_0x122058[_0x315a('0x3e')],{'$or':_[_0x315a('0x32')](_0x3c9733,function(_0x2ce169){if(_0x2ce169[_0x315a('0x40')]!==_0x315a('0x41')){var _0x503a6f={};_0x503a6f[_0x2ce169[_0x315a('0x2c')]]={'$like':'%'+_0x579ec4[_0x315a('0x35')][_0x315a('0x42')]+'%'};return _0x503a6f;}})});}_0x122058=_[_0x315a('0x3f')]({},_0x122058,_0x579ec4[_0x315a('0x43')]);var _0x35d327={'where':_0x122058['where']};return db[_0x315a('0x2e')][_0x315a('0x20')](_0x35d327)[_0x315a('0x26')](function(_0x14f0ee){_0x951c8e['count']=_0x14f0ee;if(_0x579ec4[_0x315a('0x35')][_0x315a('0x44')]){_0x122058[_0x315a('0x45')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x122058);})[_0x315a('0x26')](function(_0x3120cd){_0x951c8e[_0x315a('0x46')]=_0x3120cd;return _0x951c8e;})[_0x315a('0x26')](respondWithFilteredResult(_0x10531c,_0x122058))[_0x315a('0x47')](handleError(_0x10531c,null));};exports[_0x315a('0x48')]=function(_0x45a715,_0x37f705){var _0x10cdba={'raw':!![],'where':{'id':_0x45a715[_0x315a('0x49')]['id']}},_0x321db8={};_0x321db8[_0x315a('0x31')]=_['keys'](db[_0x315a('0x2e')]['rawAttributes']);_0x321db8[_0x315a('0x35')]=_['keys'](_0x45a715[_0x315a('0x35')]);_0x321db8[_0x315a('0x34')]=_[_0x315a('0x37')](_0x321db8[_0x315a('0x31')],_0x321db8['query']);_0x10cdba['attributes']=_['intersection'](_0x321db8[_0x315a('0x31')],qs['fields'](_0x45a715[_0x315a('0x35')][_0x315a('0x38')]));_0x10cdba[_0x315a('0x36')]=_0x10cdba[_0x315a('0x36')]['length']?_0x10cdba[_0x315a('0x36')]:_0x321db8[_0x315a('0x31')];if(_0x45a715['query'][_0x315a('0x44')]){_0x10cdba[_0x315a('0x45')]=[{'all':!![]}];}_0x10cdba=_[_0x315a('0x3f')]({},_0x10cdba,_0x45a715['options']);return db[_0x315a('0x2e')][_0x315a('0x4a')](_0x10cdba)[_0x315a('0x26')](handleEntityNotFound(_0x37f705,null))[_0x315a('0x26')](respondWithResult(_0x37f705,null))[_0x315a('0x47')](handleError(_0x37f705,null));};exports[_0x315a('0x4b')]=function(_0x24e86c,_0x5951de,_0x515fee){return db[_0x315a('0x2e')][_0x315a('0x4a')]({'where':{'id':_0x24e86c[_0x315a('0x49')]['id']},'attributes':[_0x315a('0x2c'),_0x315a('0x4c'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5951de,null))[_0x315a('0x26')](function(_0x3a99db){if(_0x3a99db){if(!fs[_0x315a('0x4d')](path[_0x315a('0x4e')](config[_0x315a('0x4f')],_0x315a('0x50'),_0x3a99db[_0x315a('0x4c')]+'.'+_0x3a99db[_0x315a('0x51')]))){throw new db[(_0x315a('0x52'))][(_0x315a('0x53'))](_0x315a('0x54'));}return _0x5951de[_0x315a('0x4b')](path['join'](config[_0x315a('0x4f')],_0x315a('0x50'),util['format'](_0x315a('0x55'),_0x3a99db[_0x315a('0x4c')],_0x3a99db['converted_format'])),util[_0x315a('0x56')](_0x315a('0x55'),_0x3a99db[_0x315a('0x2c')],_0x3a99db[_0x315a('0x51')]));}return null;})[_0x315a('0x47')](handleError(_0x5951de,null));};exports[_0x315a('0x57')]=function(_0x281df3,_0x1e3e31,_0xbe3f1f){var _0x52802d={'name':path[_0x315a('0x58')](_0x281df3[_0x315a('0x59')][_0x315a('0x5a')],path[_0x315a('0x5b')](_0x281df3[_0x315a('0x59')][_0x315a('0x5a')])),'save_name':path['basename'](_0x281df3[_0x315a('0x59')]['filename'],path[_0x315a('0x5b')](_0x281df3[_0x315a('0x59')][_0x315a('0x5c')])),'original_format':path[_0x315a('0x5b')](_0x281df3[_0x315a('0x59')][_0x315a('0x5a')])[_0x315a('0x5d')](0x1),'converted_format':_0x315a('0x5e')};var _0x2683ac=path[_0x315a('0x4e')](config['root'],'server/files/sounds/original',_0x281df3[_0x315a('0x59')][_0x315a('0x5c')]);var _0x3d833a=path['join'](config[_0x315a('0x4f')],_0x315a('0x50'),util[_0x315a('0x56')]('%s.%s',path[_0x315a('0x58')](_0x281df3[_0x315a('0x59')][_0x315a('0x5c')],path['extname'](_0x281df3[_0x315a('0x59')][_0x315a('0x5c')])),_0x52802d[_0x315a('0x51')]));logger['info'](_0x315a('0x5f'),_0x2683ac);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x3d833a);try{fs[_0x315a('0x60')](_0x2683ac,parseInt(_0x315a('0x61'),0x8));var _0x37b165=sox[_0x315a('0x62')](_0x2683ac,_0x3d833a,{'sampleRate':0x1f40,'format':_0x315a('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37b165['on'](_0x315a('0x2a'),function(_0x48648e){fs[_0x315a('0x63')](_0x2683ac);_0x1e3e31[_0x315a('0x1c')](0x1f4)[_0x315a('0x64')](_0x48648e);});_0x37b165['on']('src',function(_0x1a7ab0){_0x52802d['original_duration']=isNaN(_0x1a7ab0[_0x315a('0x65')])?null:_0x1a7ab0[_0x315a('0x65')]*0x3e8;_0x52802d[_0x315a('0x66')]=isNaN(_0x1a7ab0['sampleCount'])?null:_0x1a7ab0['sampleCount'];_0x52802d[_0x315a('0x67')]=isNaN(_0x1a7ab0[_0x315a('0x68')])?null:_0x1a7ab0[_0x315a('0x68')];_0x52802d['original_bitRate']=isNaN(_0x1a7ab0[_0x315a('0x69')])?null:_0x1a7ab0[_0x315a('0x69')];_0x52802d['original_sampleRate']=isNaN(_0x1a7ab0[_0x315a('0x6a')])?null:_0x1a7ab0[_0x315a('0x6a')];});_0x37b165['on'](_0x315a('0x6b'),function(_0x1c70d4){_0x52802d[_0x315a('0x6c')]=isNaN(_0x1c70d4['duration'])?null:_0x1c70d4['duration']*0x3e8;_0x52802d['converted_sampleCount']=isNaN(_0x1c70d4['sampleCount'])?null:_0x1c70d4[_0x315a('0x6d')];_0x52802d[_0x315a('0x6e')]=isNaN(_0x1c70d4[_0x315a('0x68')])?null:_0x1c70d4['channelCount'];_0x52802d[_0x315a('0x6f')]=isNaN(_0x1c70d4[_0x315a('0x69')])?null:_0x1c70d4[_0x315a('0x69')];_0x52802d['converted_sampleRate']=isNaN(_0x1c70d4['sampleRate'])?null:_0x1c70d4['sampleRate'];});_0x37b165['on'](_0x315a('0x1b'),function(){fs[_0x315a('0x60')](_0x3d833a,parseInt(_0x315a('0x61'),0x8));return db[_0x315a('0x2e')][_0x315a('0x57')](_0x52802d)[_0x315a('0x26')](function(_0x203ee8){var _0x2a9a21={'role':_0x281df3[_0x315a('0x70')][_0x315a('0x71')],'userProfileId':_0x281df3['body'][_0x315a('0x72')]};if(!_0x2a9a21)throw new Error(_0x315a('0x73'));if(_0x2a9a21[_0x315a('0x71')]==='user'){var _0xe5131d=_0x203ee8[_0x315a('0x74')]({'plain':!![]});return db[_0x315a('0x75')][_0x315a('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x2a9a21['userProfileId']},'raw':!![]})['then'](function(_0x4a665f){if(_0x4a665f&&_0x4a665f[_0x315a('0x76')]===0x0){return db[_0x315a('0x77')][_0x315a('0x57')]({'name':_0xe5131d['name'],'resourceId':_0xe5131d['id'],'type':_0x4a665f[_0x315a('0x2c')],'sectionId':_0x4a665f['id']},{})[_0x315a('0x26')](function(){return _0x203ee8;});}else{return _0x203ee8;}})['catch'](function(_0x4837bc){logger[_0x315a('0x2a')](_0x315a('0x78'),_0x4837bc);throw _0x4837bc;});}return _0x203ee8;})['then'](respondWithResult(_0x1e3e31,null))[_0x315a('0x47')](handleError(_0x1e3e31,null));});_0x37b165[_0x315a('0x79')]();}catch(_0x42b638){_0x1e3e31[_0x315a('0x1c')](0x1f4)[_0x315a('0x64')](_0x42b638);}};exports[_0x315a('0x7a')]=function(_0x4b948d,_0x5f52ce,_0x4935aa){return db[_0x315a('0x2e')]['find']({'where':{'id':_0x4b948d[_0x315a('0x49')]['id']}})[_0x315a('0x26')](handleEntityNotFound(_0x5f52ce,null))[_0x315a('0x26')](saveUpdates(_[_0x315a('0x3d')](_0x4b948d['body'],[_0x315a('0x2c'),'description']),null))['then'](respondWithResult(_0x5f52ce,null))[_0x315a('0x47')](handleError(_0x5f52ce,null));};exports[_0x315a('0x7b')]=function(_0x49aea7,_0x20f22e,_0x3f18a5){return db[_0x315a('0x2e')]['find']({'where':{'id':_0x49aea7[_0x315a('0x49')]['id']}})[_0x315a('0x26')](function(_0x514f38){if(_0x514f38){return _0x514f38[_0x315a('0x27')]();}})[_0x315a('0x26')](function(_0x17ceb1){var _0x47de19=path[_0x315a('0x4e')](config['root'],_0x315a('0x7c'),util[_0x315a('0x56')]('%s.%s',_0x17ceb1['save_name'],_0x17ceb1[_0x315a('0x7d')]));var _0x4dc43d=path['join'](config[_0x315a('0x4f')],_0x315a('0x50'),util[_0x315a('0x56')](_0x315a('0x55'),_0x17ceb1[_0x315a('0x4c')],_0x17ceb1[_0x315a('0x51')]));fs[_0x315a('0x63')](_0x47de19);fs['unlinkSync'](_0x4dc43d);return _0x17ceb1;})[_0x315a('0x26')](function(_0x177a0c){if(_0x177a0c){return _0x20f22e['status'](0xcc)['end']();}})[_0x315a('0x26')](handleEntityNotFound(_0x20f22e,null))[_0x315a('0x47')](handleError(_0x20f22e,null));}; \ No newline at end of file +var _0x077c=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body','delete','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','Sounds','UserProfileResource','destroy','error','stack','send','index','map','Sound','type','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','%s.%s','format','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection'];(function(_0xb6ea0a,_0x483190){var _0x397ff4=function(_0x8a3ddd){while(--_0x8a3ddd){_0xb6ea0a['push'](_0xb6ea0a['shift']());}};_0x397ff4(++_0x483190);}(_0x077c,0xfd));var _0xc077=function(_0x573bc3,_0x168448){_0x573bc3=_0x573bc3-0x0;var _0x2c4b20=_0x077c[_0x573bc3];return _0x2c4b20;};'use strict';var emlformat=require(_0xc077('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc077('0x1'));var jsonpatch=require(_0xc077('0x2'));var rp=require('request-promise');var moment=require(_0xc077('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc077('0x4'));var util=require(_0xc077('0x5'));var path=require(_0xc077('0x6'));var sox=require(_0xc077('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc077('0x8'));var _=require('lodash');var squel=require(_0xc077('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc077('0xa'));var toCsv=require(_0xc077('0xb'));var querystring=require(_0xc077('0xc'));var Papa=require(_0xc077('0xd'));var Redis=require(_0xc077('0xe'));var authService=require(_0xc077('0xf'));var qs=require(_0xc077('0x10'));var as=require(_0xc077('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc077('0x12'))(_0xc077('0x13'));var utils=require(_0xc077('0x14'));var config=require(_0xc077('0x15'));var licenseUtil=require(_0xc077('0x16'));var db=require(_0xc077('0x17'))['db'];function respondWithStatusCode(_0x279ef1,_0x494d71){_0x494d71=_0x494d71||0xcc;return function(_0x2582f8){if(_0x2582f8){return _0x279ef1[_0xc077('0x18')](_0x494d71);}return _0x279ef1[_0xc077('0x19')](_0x494d71)[_0xc077('0x1a')]();};}function respondWithResult(_0x2db752,_0x4c6a3a){_0x4c6a3a=_0x4c6a3a||0xc8;return function(_0x203f1e){if(_0x203f1e){return _0x2db752[_0xc077('0x19')](_0x4c6a3a)[_0xc077('0x1b')](_0x203f1e);}};}function respondWithFilteredResult(_0x580f8f,_0x470efe){return function(_0x58bc9b){if(_0x58bc9b){var _0x5ec146=typeof _0x470efe[_0xc077('0x1c')]===_0xc077('0x1d')&&typeof _0x470efe[_0xc077('0x1e')]==='undefined';var _0x204ccb=_0x58bc9b[_0xc077('0x1f')];var _0x23f3d7=_0x5ec146?0x0:_0x470efe[_0xc077('0x1c')];var _0x3bd3b0=_0x5ec146?_0x58bc9b[_0xc077('0x1f')]:_0x470efe['offset']+_0x470efe['limit'];var _0x442dbd;if(_0x3bd3b0>=_0x204ccb){_0x3bd3b0=_0x204ccb;_0x442dbd=0xc8;}else{_0x442dbd=0xce;}_0x580f8f['status'](_0x442dbd);return _0x580f8f[_0xc077('0x20')]('Content-Range',_0x23f3d7+'-'+_0x3bd3b0+'/'+_0x204ccb)[_0xc077('0x1b')](_0x58bc9b);}return null;};}function patchUpdates(_0x355c41){return function(_0x2fc578){try{jsonpatch[_0xc077('0x21')](_0x2fc578,_0x355c41,!![]);}catch(_0x181f37){return BPromise[_0xc077('0x22')](_0x181f37);}return _0x2fc578[_0xc077('0x23')]();};}function saveUpdates(_0xe5d5ad,_0xe618bd){return function(_0x394922){if(_0x394922){return _0x394922[_0xc077('0x24')](_0xe5d5ad)[_0xc077('0x25')](function(_0xa08843){return _0xa08843;});}return null;};}function removeEntity(_0x4b38ee,_0xbd46e6){return function(_0x61ab30){if(_0x61ab30){return _0x61ab30['destroy']()[_0xc077('0x25')](function(){var _0x5c9331=_0x61ab30['get']({'plain':!![]});var _0x5820e4=_0xc077('0x26');return db[_0xc077('0x27')][_0xc077('0x28')]({'where':{'type':_0x5820e4,'resourceId':_0x5c9331['id']}})[_0xc077('0x25')](function(){return _0x61ab30;});})['then'](function(){_0x4b38ee[_0xc077('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7f12,_0x411009){return function(_0x4a9398){if(!_0x4a9398){_0x3e7f12['sendStatus'](0x194);}return _0x4a9398;};}function handleError(_0x5bc7ac,_0x15db0e){_0x15db0e=_0x15db0e||0x1f4;return function(_0x1206c1){logger[_0xc077('0x29')](_0x1206c1[_0xc077('0x2a')]);if(_0x1206c1['name']){delete _0x1206c1['name'];}_0x5bc7ac['status'](_0x15db0e)[_0xc077('0x2b')](_0x1206c1);};}exports[_0xc077('0x2c')]=function(_0xefa7da,_0x55ba87){var _0x518f64={},_0x6abfba={},_0x13c819={'count':0x0,'rows':[]};var _0x499f88=_[_0xc077('0x2d')](db[_0xc077('0x2e')]['rawAttributes'],function(_0xfd1d91){return{'name':_0xfd1d91['fieldName'],'type':_0xfd1d91[_0xc077('0x2f')]['key']};});_0x6abfba[_0xc077('0x30')]=_[_0xc077('0x2d')](_0x499f88,_0xc077('0x31'));_0x6abfba[_0xc077('0x32')]=_[_0xc077('0x33')](_0xefa7da[_0xc077('0x32')]);_0x6abfba[_0xc077('0x34')]=_['intersection'](_0x6abfba[_0xc077('0x30')],_0x6abfba[_0xc077('0x32')]);_0x518f64[_0xc077('0x35')]=_['intersection'](_0x6abfba[_0xc077('0x30')],qs[_0xc077('0x36')](_0xefa7da[_0xc077('0x32')][_0xc077('0x36')]));_0x518f64['attributes']=_0x518f64[_0xc077('0x35')][_0xc077('0x37')]?_0x518f64[_0xc077('0x35')]:_0x6abfba[_0xc077('0x30')];if(!_0xefa7da['query'][_0xc077('0x38')]('nolimit')){_0x518f64[_0xc077('0x1e')]=qs[_0xc077('0x1e')](_0xefa7da[_0xc077('0x32')][_0xc077('0x1e')]);_0x518f64[_0xc077('0x1c')]=qs['offset'](_0xefa7da[_0xc077('0x32')][_0xc077('0x1c')]);}_0x518f64[_0xc077('0x39')]=qs[_0xc077('0x3a')](_0xefa7da[_0xc077('0x32')][_0xc077('0x3a')]);_0x518f64['where']=qs[_0xc077('0x34')](_[_0xc077('0x3b')](_0xefa7da[_0xc077('0x32')],_0x6abfba[_0xc077('0x34')]),_0x499f88);if(_0xefa7da['query'][_0xc077('0x3c')]){_0x518f64['where']=_[_0xc077('0x3d')](_0x518f64[_0xc077('0x3e')],{'$or':_[_0xc077('0x2d')](_0x499f88,function(_0x443ebc){if(_0x443ebc['type']!==_0xc077('0x3f')){var _0x26151b={};_0x26151b[_0x443ebc['name']]={'$like':'%'+_0xefa7da['query'][_0xc077('0x3c')]+'%'};return _0x26151b;}})});}_0x518f64=_[_0xc077('0x3d')]({},_0x518f64,_0xefa7da['options']);var _0x1720ab={'where':_0x518f64[_0xc077('0x3e')]};return db['Sound']['count'](_0x1720ab)[_0xc077('0x25')](function(_0x1e8c9f){_0x13c819[_0xc077('0x1f')]=_0x1e8c9f;if(_0xefa7da[_0xc077('0x32')]['includeAll']){_0x518f64[_0xc077('0x40')]=[{'all':!![]}];}return db[_0xc077('0x2e')][_0xc077('0x41')](_0x518f64);})['then'](function(_0x808a9d){_0x13c819[_0xc077('0x42')]=_0x808a9d;return _0x13c819;})['then'](respondWithFilteredResult(_0x55ba87,_0x518f64))[_0xc077('0x43')](handleError(_0x55ba87,null));};exports[_0xc077('0x44')]=function(_0xf7a647,_0x468ee4){var _0x418e62={'raw':!![],'where':{'id':_0xf7a647[_0xc077('0x45')]['id']}},_0x396d79={};_0x396d79[_0xc077('0x30')]=_[_0xc077('0x33')](db[_0xc077('0x2e')][_0xc077('0x46')]);_0x396d79[_0xc077('0x32')]=_[_0xc077('0x33')](_0xf7a647[_0xc077('0x32')]);_0x396d79[_0xc077('0x34')]=_[_0xc077('0x47')](_0x396d79[_0xc077('0x30')],_0x396d79[_0xc077('0x32')]);_0x418e62[_0xc077('0x35')]=_['intersection'](_0x396d79[_0xc077('0x30')],qs[_0xc077('0x36')](_0xf7a647[_0xc077('0x32')][_0xc077('0x36')]));_0x418e62[_0xc077('0x35')]=_0x418e62[_0xc077('0x35')][_0xc077('0x37')]?_0x418e62['attributes']:_0x396d79[_0xc077('0x30')];if(_0xf7a647[_0xc077('0x32')][_0xc077('0x48')]){_0x418e62['include']=[{'all':!![]}];}_0x418e62=_[_0xc077('0x3d')]({},_0x418e62,_0xf7a647['options']);return db[_0xc077('0x2e')]['find'](_0x418e62)['then'](handleEntityNotFound(_0x468ee4,null))[_0xc077('0x25')](respondWithResult(_0x468ee4,null))[_0xc077('0x43')](handleError(_0x468ee4,null));};exports[_0xc077('0x49')]=function(_0x9dd47e,_0x3336ea,_0x24a4a2){return db[_0xc077('0x2e')][_0xc077('0x4a')]({'where':{'id':_0x9dd47e['params']['id']},'attributes':[_0xc077('0x31'),_0xc077('0x4b'),_0xc077('0x4c')],'raw':!![]})[_0xc077('0x25')](handleEntityNotFound(_0x3336ea,null))[_0xc077('0x25')](function(_0x1cb3e0){if(_0x1cb3e0){if(!fs[_0xc077('0x4d')](path[_0xc077('0x4e')](config[_0xc077('0x4f')],_0xc077('0x50'),_0x1cb3e0[_0xc077('0x4b')]+'.'+_0x1cb3e0[_0xc077('0x4c')]))){throw new db[(_0xc077('0x51'))][(_0xc077('0x52'))]('Sound\x20not\x20found');}return _0x3336ea[_0xc077('0x49')](path[_0xc077('0x4e')](config[_0xc077('0x4f')],_0xc077('0x50'),util['format'](_0xc077('0x53'),_0x1cb3e0[_0xc077('0x4b')],_0x1cb3e0[_0xc077('0x4c')])),util[_0xc077('0x54')](_0xc077('0x53'),_0x1cb3e0[_0xc077('0x31')],_0x1cb3e0[_0xc077('0x4c')]));}return null;})[_0xc077('0x43')](handleError(_0x3336ea,null));};exports[_0xc077('0x55')]=function(_0x2df2f0,_0x4852ea,_0x14b194){var _0x399261={'name':path[_0xc077('0x56')](_0x2df2f0[_0xc077('0x57')][_0xc077('0x58')],path[_0xc077('0x59')](_0x2df2f0[_0xc077('0x57')][_0xc077('0x58')])),'save_name':path[_0xc077('0x56')](_0x2df2f0['file'][_0xc077('0x5a')],path[_0xc077('0x59')](_0x2df2f0[_0xc077('0x57')][_0xc077('0x5a')])),'original_format':path['extname'](_0x2df2f0['file']['originalname'])[_0xc077('0x5b')](0x1),'converted_format':'wav'};var _0x2c964a=path[_0xc077('0x4e')](config[_0xc077('0x4f')],_0xc077('0x5c'),_0x2df2f0['file']['filename']);var _0x484da7=path[_0xc077('0x4e')](config[_0xc077('0x4f')],'server/files/sounds/converted',util[_0xc077('0x54')](_0xc077('0x53'),path[_0xc077('0x56')](_0x2df2f0[_0xc077('0x57')][_0xc077('0x5a')],path[_0xc077('0x59')](_0x2df2f0[_0xc077('0x57')][_0xc077('0x5a')])),_0x399261[_0xc077('0x4c')]));logger[_0xc077('0x5d')](_0xc077('0x5e'),_0x2c964a);logger[_0xc077('0x5d')](_0xc077('0x5f'),_0x484da7);try{fs[_0xc077('0x60')](_0x2c964a,parseInt(_0xc077('0x61'),0x8));var _0x362419=sox['transcode'](_0x2c964a,_0x484da7,{'sampleRate':0x1f40,'format':_0xc077('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x362419['on']('error',function(_0x5cf8bf){fs['unlinkSync'](_0x2c964a);_0x4852ea[_0xc077('0x19')](0x1f4)['send'](_0x5cf8bf);});_0x362419['on']('src',function(_0x2083c9){_0x399261[_0xc077('0x63')]=isNaN(_0x2083c9['duration'])?null:_0x2083c9[_0xc077('0x64')]*0x3e8;_0x399261[_0xc077('0x65')]=isNaN(_0x2083c9[_0xc077('0x66')])?null:_0x2083c9[_0xc077('0x66')];_0x399261[_0xc077('0x67')]=isNaN(_0x2083c9[_0xc077('0x68')])?null:_0x2083c9[_0xc077('0x68')];_0x399261['original_bitRate']=isNaN(_0x2083c9[_0xc077('0x69')])?null:_0x2083c9[_0xc077('0x69')];_0x399261[_0xc077('0x6a')]=isNaN(_0x2083c9['sampleRate'])?null:_0x2083c9[_0xc077('0x6b')];});_0x362419['on'](_0xc077('0x6c'),function(_0x2ea30a){_0x399261['converted_duration']=isNaN(_0x2ea30a[_0xc077('0x64')])?null:_0x2ea30a['duration']*0x3e8;_0x399261['converted_sampleCount']=isNaN(_0x2ea30a[_0xc077('0x66')])?null:_0x2ea30a['sampleCount'];_0x399261[_0xc077('0x6d')]=isNaN(_0x2ea30a['channelCount'])?null:_0x2ea30a[_0xc077('0x68')];_0x399261[_0xc077('0x6e')]=isNaN(_0x2ea30a[_0xc077('0x69')])?null:_0x2ea30a[_0xc077('0x69')];_0x399261[_0xc077('0x6f')]=isNaN(_0x2ea30a[_0xc077('0x6b')])?null:_0x2ea30a[_0xc077('0x6b')];});_0x362419['on'](_0xc077('0x1a'),function(){fs[_0xc077('0x60')](_0x484da7,parseInt('0777',0x8));return db['Sound']['create'](_0x399261)[_0xc077('0x25')](function(_0x5a2553){var _0x2beb6b={'role':_0x2df2f0['body']['role'],'userProfileId':_0x2df2f0['body']['userProfileId']};if(!_0x2beb6b)throw new Error(_0xc077('0x70'));if(_0x2beb6b[_0xc077('0x71')]==='user'){var _0x2bf8cc=_0x5a2553[_0xc077('0x72')]({'plain':!![]});return db[_0xc077('0x73')][_0xc077('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x2beb6b[_0xc077('0x74')]},'raw':!![]})[_0xc077('0x25')](function(_0x55b2ed){if(_0x55b2ed&&_0x55b2ed[_0xc077('0x75')]===0x0){return db['UserProfileResource'][_0xc077('0x55')]({'name':_0x2bf8cc[_0xc077('0x31')],'resourceId':_0x2bf8cc['id'],'type':_0x55b2ed[_0xc077('0x31')],'sectionId':_0x55b2ed['id']},{})[_0xc077('0x25')](function(){return _0x5a2553;});}else{return _0x5a2553;}})[_0xc077('0x43')](function(_0xf40057){logger['error'](_0xc077('0x76'),_0xf40057);throw _0xf40057;});}return _0x5a2553;})[_0xc077('0x25')](respondWithResult(_0x4852ea,null))[_0xc077('0x43')](handleError(_0x4852ea,null));});_0x362419[_0xc077('0x77')]();}catch(_0x1f70d6){_0x4852ea[_0xc077('0x19')](0x1f4)[_0xc077('0x2b')](_0x1f70d6);}};exports[_0xc077('0x24')]=function(_0x19547f,_0x50bc9b,_0x106985){return db['Sound']['find']({'where':{'id':_0x19547f['params']['id']}})['then'](handleEntityNotFound(_0x50bc9b,null))[_0xc077('0x25')](saveUpdates(_[_0xc077('0x3b')](_0x19547f[_0xc077('0x78')],[_0xc077('0x31'),'description']),null))[_0xc077('0x25')](respondWithResult(_0x50bc9b,null))['catch'](handleError(_0x50bc9b,null));};exports[_0xc077('0x79')]=function(_0x96e84b,_0x2261c5,_0x37f547){return db['Sound']['find']({'where':{'id':_0x96e84b[_0xc077('0x45')]['id']}})[_0xc077('0x25')](function(_0x59bb0b){if(_0x59bb0b){return _0x59bb0b['destroy']();}})[_0xc077('0x25')](function(_0x3eeeb1){var _0x3cbb57=path[_0xc077('0x4e')](config[_0xc077('0x4f')],_0xc077('0x5c'),util[_0xc077('0x54')](_0xc077('0x53'),_0x3eeeb1['save_name'],_0x3eeeb1['original_format']));var _0x3a9817=path['join'](config[_0xc077('0x4f')],_0xc077('0x50'),util['format'](_0xc077('0x53'),_0x3eeeb1[_0xc077('0x4b')],_0x3eeeb1[_0xc077('0x4c')]));fs[_0xc077('0x7a')](_0x3cbb57);fs[_0xc077('0x7a')](_0x3a9817);return _0x3eeeb1;})[_0xc077('0x25')](function(_0x4aeb17){if(_0x4aeb17){return _0x2261c5['status'](0xcc)[_0xc077('0x1a')]();}})['then'](handleEntityNotFound(_0x2261c5,null))[_0xc077('0x43')](handleError(_0x2261c5,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6f0ee34..49a8624 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 _0x6ca9=['Sound','tools_sounds','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define'];(function(_0x6d4f0e,_0x1c7d11){var _0x2ea907=function(_0x32652d){while(--_0x32652d){_0x6d4f0e['push'](_0x6d4f0e['shift']());}};_0x2ea907(++_0x1c7d11);}(_0x6ca9,0x16e));var _0x96ca=function(_0x31147e,_0x483e2f){_0x31147e=_0x31147e-0x0;var _0x27cf55=_0x6ca9[_0x31147e];return _0x27cf55;};'use strict';var _=require(_0x96ca('0x0'));var util=require(_0x96ca('0x1'));var logger=require('../../config/logger')(_0x96ca('0x2'));var moment=require(_0x96ca('0x3'));var BPromise=require(_0x96ca('0x4'));var rp=require(_0x96ca('0x5'));var fs=require('fs');var path=require(_0x96ca('0x6'));var rimraf=require('rimraf');var config=require(_0x96ca('0x7'));var attributes=require(_0x96ca('0x8'));module[_0x96ca('0x9')]=function(_0x17b9a3,_0x389cba){return _0x17b9a3[_0x96ca('0xa')](_0x96ca('0xb'),attributes,{'tableName':_0x96ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58f3=['exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','rimraf','./sound.attributes'];(function(_0x53cc8d,_0x41ad71){var _0x5e87b8=function(_0x4a9ae1){while(--_0x4a9ae1){_0x53cc8d['push'](_0x53cc8d['shift']());}};_0x5e87b8(++_0x41ad71);}(_0x58f3,0xb4));var _0x358f=function(_0x5dce5b,_0x11c9c6){_0x5dce5b=_0x5dce5b-0x0;var _0x237c3e=_0x58f3[_0x5dce5b];return _0x237c3e;};'use strict';var _=require(_0x358f('0x0'));var util=require(_0x358f('0x1'));var logger=require(_0x358f('0x2'))(_0x358f('0x3'));var moment=require('moment');var BPromise=require(_0x358f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x358f('0x5'));var config=require('../../config/environment');var attributes=require(_0x358f('0x6'));module[_0x358f('0x7')]=function(_0x23fb7,_0xc62a7){return _0x23fb7[_0x358f('0x8')](_0x358f('0x9'),attributes,{'tableName':_0x358f('0xa'),'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 37495bc..f0ec174 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 _0xf12f=['error','code','Sound,\x20%s,\x20%s','message','result','catch','Sound','find','options','where','attributes','include','map','model','then','info','ShowSound','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x38b621,_0x263776){var _0x4652d9=function(_0x2af544){while(--_0x2af544){_0x38b621['push'](_0x38b621['shift']());}};_0x4652d9(++_0x263776);}(_0xf12f,0x1f1));var _0xff12=function(_0x331c1b,_0xbe7ed5){_0x331c1b=_0x331c1b-0x0;var _0x319f7f=_0xf12f[_0x331c1b];return _0x319f7f;};'use strict';var _=require('lodash');var util=require(_0xff12('0x0'));var moment=require(_0xff12('0x1'));var BPromise=require('bluebird');var rs=require(_0xff12('0x2'));var fs=require('fs');var Redis=require(_0xff12('0x3'));var db=require(_0xff12('0x4'))['db'];var utils=require(_0xff12('0x5'));var logger=require('../../config/logger')(_0xff12('0x6'));var config=require(_0xff12('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff12('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x495eed,_0xe80015,_0x490c29){return new BPromise(function(_0x19c542,_0x9c2d80){return client[_0xff12('0x9')](_0x495eed,_0x490c29)['then'](function(_0x205fc3){logger['info']('Sound,\x20%s,\x20%s',_0xe80015,_0xff12('0xa'));logger[_0xff12('0xb')](_0xff12('0xc'),_0xe80015,_0xff12('0xa'),JSON['stringify'](_0x205fc3));if(_0x205fc3[_0xff12('0xd')]){if(_0x205fc3[_0xff12('0xd')][_0xff12('0xe')]===0x1f4){logger[_0xff12('0xd')](_0xff12('0xf'),_0xe80015,_0x205fc3['error'][_0xff12('0x10')]);return _0x9c2d80(_0x205fc3['error'][_0xff12('0x10')]);}logger['error'](_0xff12('0xf'),_0xe80015,_0x205fc3[_0xff12('0xd')]['message']);return _0x19c542(_0x205fc3[_0xff12('0xd')]['message']);}else{logger['info'](_0xff12('0xf'),_0xe80015,_0xff12('0xa'));_0x19c542(_0x205fc3[_0xff12('0x11')][_0xff12('0x10')]);}})[_0xff12('0x12')](function(_0x3ac18d){logger[_0xff12('0xd')](_0xff12('0xf'),_0xe80015,_0x3ac18d);_0x9c2d80(_0x3ac18d);});});}exports['ShowSound']=function(_0x999b98){var _0x13d0d0=this;return new Promise(function(_0x5c9324,_0x231dd9){return db[_0xff12('0x13')][_0xff12('0x14')]({'raw':_0x999b98[_0xff12('0x15')]?_0x999b98[_0xff12('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x999b98['options']?_0x999b98[_0xff12('0x15')][_0xff12('0x16')]||null:null,'attributes':_0x999b98[_0xff12('0x15')]?_0x999b98[_0xff12('0x15')][_0xff12('0x17')]||null:null,'include':_0x999b98['options']?_0x999b98[_0xff12('0x15')][_0xff12('0x18')]?_[_0xff12('0x19')](_0x999b98[_0xff12('0x15')][_0xff12('0x18')],function(_0x3b474b){return{'model':db[_0x3b474b[_0xff12('0x1a')]],'as':_0x3b474b['as'],'attributes':_0x3b474b[_0xff12('0x17')],'include':_0x3b474b[_0xff12('0x18')]?_[_0xff12('0x19')](_0x3b474b[_0xff12('0x18')],function(_0x1cc088){return{'model':db[_0x1cc088[_0xff12('0x1a')]],'as':_0x1cc088['as'],'attributes':_0x1cc088[_0xff12('0x17')],'include':_0x1cc088['include']?_[_0xff12('0x19')](_0x1cc088[_0xff12('0x18')],function(_0x288862){return{'model':db[_0x288862['model']],'as':_0x288862['as'],'attributes':_0x288862[_0xff12('0x17')]};}):[]};}):[]};}):[]:[]})[_0xff12('0x1b')](function(_0x1989da){logger[_0xff12('0x1c')](_0xff12('0x1d'),_0x999b98);logger[_0xff12('0xb')]('ShowSound',_0x999b98,JSON['stringify'](_0x1989da));_0x5c9324(_0x1989da);})[_0xff12('0x12')](function(_0x273816){logger[_0xff12('0xd')](_0xff12('0x1d'),_0x273816[_0xff12('0x10')],_0x999b98);_0x231dd9(_0x13d0d0[_0xff12('0xd')](0x1f4,_0x273816[_0xff12('0x10')]));});});}; \ No newline at end of file +var _0x1653=['map','model','then','info','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','ShowSound','Sound','options','where','attributes','include'];(function(_0x56be61,_0x51f50c){var _0x335de5=function(_0x4c5ee5){while(--_0x4c5ee5){_0x56be61['push'](_0x56be61['shift']());}};_0x335de5(++_0x51f50c);}(_0x1653,0xad));var _0x3165=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x1653[_0xc471d2];return _0x334c68;};'use strict';var _=require(_0x3165('0x0'));var util=require(_0x3165('0x1'));var moment=require(_0x3165('0x2'));var BPromise=require(_0x3165('0x3'));var rs=require(_0x3165('0x4'));var fs=require('fs');var Redis=require(_0x3165('0x5'));var db=require(_0x3165('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3165('0x7'));var config=require(_0x3165('0x8'));var jayson=require(_0x3165('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x690289,_0x566ad6,_0x20141f){return new BPromise(function(_0x57330b,_0xb9e097){return client[_0x3165('0xa')](_0x690289,_0x20141f)['then'](function(_0x115d3e){logger['info'](_0x3165('0xb'),_0x566ad6,_0x3165('0xc'));logger['debug'](_0x3165('0xd'),_0x566ad6,_0x3165('0xc'),JSON[_0x3165('0xe')](_0x115d3e));if(_0x115d3e[_0x3165('0xf')]){if(_0x115d3e[_0x3165('0xf')]['code']===0x1f4){logger['error'](_0x3165('0xb'),_0x566ad6,_0x115d3e[_0x3165('0xf')][_0x3165('0x10')]);return _0xb9e097(_0x115d3e['error'][_0x3165('0x10')]);}logger[_0x3165('0xf')](_0x3165('0xb'),_0x566ad6,_0x115d3e[_0x3165('0xf')]['message']);return _0x57330b(_0x115d3e['error'][_0x3165('0x10')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x566ad6,_0x3165('0xc'));_0x57330b(_0x115d3e['result'][_0x3165('0x10')]);}})['catch'](function(_0x41c690){logger[_0x3165('0xf')](_0x3165('0xb'),_0x566ad6,_0x41c690);_0xb9e097(_0x41c690);});});}exports[_0x3165('0x11')]=function(_0x4d6632){var _0x19150a=this;return new Promise(function(_0x4d9521,_0x3ba633){return db[_0x3165('0x12')]['find']({'raw':_0x4d6632['options']?_0x4d6632[_0x3165('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6632[_0x3165('0x13')]?_0x4d6632[_0x3165('0x13')][_0x3165('0x14')]||null:null,'attributes':_0x4d6632[_0x3165('0x13')]?_0x4d6632[_0x3165('0x13')][_0x3165('0x15')]||null:null,'include':_0x4d6632[_0x3165('0x13')]?_0x4d6632[_0x3165('0x13')][_0x3165('0x16')]?_[_0x3165('0x17')](_0x4d6632['options'][_0x3165('0x16')],function(_0x578aac){return{'model':db[_0x578aac[_0x3165('0x18')]],'as':_0x578aac['as'],'attributes':_0x578aac[_0x3165('0x15')],'include':_0x578aac[_0x3165('0x16')]?_['map'](_0x578aac[_0x3165('0x16')],function(_0x45f4c7){return{'model':db[_0x45f4c7[_0x3165('0x18')]],'as':_0x45f4c7['as'],'attributes':_0x45f4c7['attributes'],'include':_0x45f4c7[_0x3165('0x16')]?_[_0x3165('0x17')](_0x45f4c7[_0x3165('0x16')],function(_0x1cd2cd){return{'model':db[_0x1cd2cd[_0x3165('0x18')]],'as':_0x1cd2cd['as'],'attributes':_0x1cd2cd[_0x3165('0x15')]};}):[]};}):[]};}):[]:[]})[_0x3165('0x19')](function(_0x1d5fd0){logger[_0x3165('0x1a')]('ShowSound',_0x4d6632);logger[_0x3165('0x1b')]('ShowSound',_0x4d6632,JSON[_0x3165('0xe')](_0x1d5fd0));_0x4d9521(_0x1d5fd0);})['catch'](function(_0xb58a20){logger[_0x3165('0xf')](_0x3165('0x11'),_0xb58a20[_0x3165('0x10')],_0x4d6632);_0x3ba633(_0x19150a['error'](0x1f4,_0xb58a20[_0x3165('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e08c294..255ce29 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x4a7c8f,_0x48659a){var _0x524039=function(_0x599b74){while(--_0x599b74){_0x4a7c8f['push'](_0x4a7c8f['shift']());}};_0x524039(++_0x48659a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xb7e7[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +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(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0x0b0e[_0xf97eb0];return _0xea70f4;};'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 d5eb544..99ac68f 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 _0x50e9=['exports','TEXT','medium','ENUM','STRING'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x50e9,0xf5));var _0x950e=function(_0xc3be16,_0x314d9f){_0xc3be16=_0xc3be16-0x0;var _0x35d509=_0x50e9[_0xc3be16];return _0x35d509;};'use strict';var Sequelize=require('sequelize');module[_0x950e('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x950e('0x1')](_0x950e('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x950e('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x950e('0x4')]},'providerResponse':{'type':Sequelize[_0x950e('0x1')]}}; \ No newline at end of file +var _0x7d87=['STRING','TEXT','medium','ENUM','out','exports'];(function(_0x463f29,_0x315360){var _0x516d9b=function(_0x8c52c9){while(--_0x8c52c9){_0x463f29['push'](_0x463f29['shift']());}};_0x516d9b(++_0x315360);}(_0x7d87,0x1a3));var _0x77d8=function(_0x41880b,_0x1fb1e5){_0x41880b=_0x41880b-0x0;var _0x16e6ed=_0x7d87[_0x41880b];return _0x16e6ed;};'use strict';var Sequelize=require('sequelize');module[_0x77d8('0x0')]={'uniqueid':{'type':Sequelize[_0x77d8('0x1')]},'body':{'type':Sequelize[_0x77d8('0x2')](_0x77d8('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x77d8('0x4')]('in',_0x77d8('0x5')),'defaultValue':_0x77d8('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x77d8('0x1')]},'providerResponse':{'type':Sequelize[_0x77d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c641a69..82c8886 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 _0xf811=['then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','show','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save'];(function(_0x56a37f,_0x5e2048){var _0x4aa6cf=function(_0x318145){while(--_0x318145){_0x56a37f['push'](_0x56a37f['shift']());}};_0x4aa6cf(++_0x5e2048);}(_0xf811,0x6f));var _0x1f81=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf811[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require(_0x1f81('0x4'));var moment=require(_0x1f81('0x5'));var BPromise=require(_0x1f81('0x6'));var Mustache=require(_0x1f81('0x7'));var util=require(_0x1f81('0x8'));var path=require(_0x1f81('0x9'));var sox=require(_0x1f81('0xa'));var csv=require(_0x1f81('0xb'));var ejs=require(_0x1f81('0xc'));var fs=require('fs');var fs_extra=require(_0x1f81('0xd'));var _=require('lodash');var squel=require(_0x1f81('0xe'));var crypto=require(_0x1f81('0xf'));var jsforce=require(_0x1f81('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1f81('0xb'));var querystring=require(_0x1f81('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x13'));var as=require(_0x1f81('0x14'));var hardwareService=require(_0x1f81('0x15'));var logger=require(_0x1f81('0x16'))(_0x1f81('0x17'));var utils=require(_0x1f81('0x18'));var config=require(_0x1f81('0x19'));var licenseUtil=require(_0x1f81('0x1a'));var db=require(_0x1f81('0x1b'))['db'];function respondWithStatusCode(_0x111c85,_0x14851a){_0x14851a=_0x14851a||0xcc;return function(_0x1d9ef5){if(_0x1d9ef5){return _0x111c85[_0x1f81('0x1c')](_0x14851a);}return _0x111c85[_0x1f81('0x1d')](_0x14851a)[_0x1f81('0x1e')]();};}function respondWithResult(_0x247b10,_0x5a4992){_0x5a4992=_0x5a4992||0xc8;return function(_0x29941f){if(_0x29941f){return _0x247b10[_0x1f81('0x1d')](_0x5a4992)['json'](_0x29941f);}};}function respondWithFilteredResult(_0x5e1036,_0x20cea6){return function(_0x1a781d){if(_0x1a781d){var _0x5da9d1=typeof _0x20cea6[_0x1f81('0x1f')]===_0x1f81('0x20')&&typeof _0x20cea6[_0x1f81('0x21')]===_0x1f81('0x20');var _0x4bdba8=_0x1a781d['count'];var _0x13bf61=_0x5da9d1?0x0:_0x20cea6[_0x1f81('0x1f')];var _0x579638=_0x5da9d1?_0x1a781d[_0x1f81('0x22')]:_0x20cea6['offset']+_0x20cea6[_0x1f81('0x21')];var _0x1f9813;if(_0x579638>=_0x4bdba8){_0x579638=_0x4bdba8;_0x1f9813=0xc8;}else{_0x1f9813=0xce;}_0x5e1036[_0x1f81('0x1d')](_0x1f9813);return _0x5e1036['set'](_0x1f81('0x23'),_0x13bf61+'-'+_0x579638+'/'+_0x4bdba8)[_0x1f81('0x24')](_0x1a781d);}return null;};}function patchUpdates(_0x2d9b8d){return function(_0x3d35bd){try{jsonpatch[_0x1f81('0x25')](_0x3d35bd,_0x2d9b8d,!![]);}catch(_0x20e351){return BPromise['reject'](_0x20e351);}return _0x3d35bd[_0x1f81('0x26')]();};}function saveUpdates(_0x37b6ff,_0x3751d4){return function(_0x4ecfa9){if(_0x4ecfa9){return _0x4ecfa9['update'](_0x37b6ff)[_0x1f81('0x27')](function(_0x4aaf6e){return _0x4aaf6e;});}return null;};}function removeEntity(_0x13e8c5,_0x4f714a){return function(_0x59c93a){if(_0x59c93a){return _0x59c93a[_0x1f81('0x28')]()['then'](function(){_0x13e8c5[_0x1f81('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21caa5,_0xe95e9c){return function(_0x147695){if(!_0x147695){_0x21caa5[_0x1f81('0x1c')](0x194);}return _0x147695;};}function handleError(_0x19dab0,_0x3d9e7a){_0x3d9e7a=_0x3d9e7a||0x1f4;return function(_0x2ff623){logger[_0x1f81('0x29')](_0x2ff623[_0x1f81('0x2a')]);if(_0x2ff623[_0x1f81('0x2b')]){delete _0x2ff623['name'];}_0x19dab0[_0x1f81('0x1d')](_0x3d9e7a)['send'](_0x2ff623);};}exports[_0x1f81('0x2c')]=function(_0x197da5,_0x537166){var _0x3d547b={},_0x186e42={},_0x218040={'count':0x0,'rows':[]};var _0x232750=_[_0x1f81('0x2d')](db[_0x1f81('0x2e')][_0x1f81('0x2f')],function(_0x381b5c){return{'name':_0x381b5c['fieldName'],'type':_0x381b5c[_0x1f81('0x30')][_0x1f81('0x31')]};});_0x186e42[_0x1f81('0x32')]=_[_0x1f81('0x2d')](_0x232750,_0x1f81('0x2b'));_0x186e42[_0x1f81('0x33')]=_[_0x1f81('0x34')](_0x197da5[_0x1f81('0x33')]);_0x186e42[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],_0x186e42['query']);_0x3d547b[_0x1f81('0x37')]=_[_0x1f81('0x36')](_0x186e42[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x197da5['query'][_0x1f81('0x38')]));_0x3d547b[_0x1f81('0x37')]=_0x3d547b[_0x1f81('0x37')]['length']?_0x3d547b['attributes']:_0x186e42[_0x1f81('0x32')];if(!_0x197da5['query'][_0x1f81('0x39')]('nolimit')){_0x3d547b[_0x1f81('0x21')]=qs[_0x1f81('0x21')](_0x197da5[_0x1f81('0x33')][_0x1f81('0x21')]);_0x3d547b[_0x1f81('0x1f')]=qs[_0x1f81('0x1f')](_0x197da5[_0x1f81('0x33')]['offset']);}_0x3d547b[_0x1f81('0x3a')]=qs['sort'](_0x197da5[_0x1f81('0x33')][_0x1f81('0x3b')]);_0x3d547b['where']=qs[_0x1f81('0x35')](_[_0x1f81('0x3c')](_0x197da5[_0x1f81('0x33')],_0x186e42['filters']),_0x232750);if(_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]){_0x3d547b[_0x1f81('0x3e')]=_[_0x1f81('0x3f')](_0x3d547b[_0x1f81('0x3e')],{'$or':_['map'](_0x232750,function(_0x1823ee){if(_0x1823ee[_0x1f81('0x30')]!=='VIRTUAL'){var _0x5a57d1={};_0x5a57d1[_0x1823ee['name']]={'$like':'%'+_0x197da5[_0x1f81('0x33')][_0x1f81('0x3d')]+'%'};return _0x5a57d1;}})});}_0x3d547b=_['merge']({},_0x3d547b,_0x197da5['options']);var _0x4ec05c={'where':_0x3d547b[_0x1f81('0x3e')]};return db[_0x1f81('0x2e')]['count'](_0x4ec05c)[_0x1f81('0x27')](function(_0x29b54f){_0x218040[_0x1f81('0x22')]=_0x29b54f;if(_0x197da5['query'][_0x1f81('0x40')]){_0x3d547b[_0x1f81('0x41')]=[{'all':!![]}];}return db[_0x1f81('0x2e')][_0x1f81('0x42')](_0x3d547b);})[_0x1f81('0x27')](function(_0xb0d536){_0x218040['rows']=_0xb0d536;return _0x218040;})[_0x1f81('0x27')](respondWithFilteredResult(_0x537166,_0x3d547b))[_0x1f81('0x43')](handleError(_0x537166,null));};exports[_0x1f81('0x44')]=function(_0x176884,_0x5a22a4){var _0x2c9c48={'raw':!![],'where':{'id':_0x176884['params']['id']}},_0x15c1b9={};_0x15c1b9[_0x1f81('0x32')]=_['keys'](db[_0x1f81('0x2e')]['rawAttributes']);_0x15c1b9[_0x1f81('0x33')]=_['keys'](_0x176884[_0x1f81('0x33')]);_0x15c1b9[_0x1f81('0x35')]=_[_0x1f81('0x36')](_0x15c1b9['model'],_0x15c1b9[_0x1f81('0x33')]);_0x2c9c48[_0x1f81('0x37')]=_['intersection'](_0x15c1b9[_0x1f81('0x32')],qs[_0x1f81('0x38')](_0x176884[_0x1f81('0x33')][_0x1f81('0x38')]));_0x2c9c48[_0x1f81('0x37')]=_0x2c9c48[_0x1f81('0x37')][_0x1f81('0x45')]?_0x2c9c48['attributes']:_0x15c1b9[_0x1f81('0x32')];if(_0x176884[_0x1f81('0x33')]['includeAll']){_0x2c9c48[_0x1f81('0x41')]=[{'all':!![]}];}_0x2c9c48=_[_0x1f81('0x3f')]({},_0x2c9c48,_0x176884[_0x1f81('0x46')]);return db['SquareMessage'][_0x1f81('0x47')](_0x2c9c48)[_0x1f81('0x27')](handleEntityNotFound(_0x5a22a4,null))['then'](respondWithResult(_0x5a22a4,null))[_0x1f81('0x43')](handleError(_0x5a22a4,null));};exports['create']=function(_0x51bd8d,_0x19f10d){return db[_0x1f81('0x2e')][_0x1f81('0x48')](_0x51bd8d['body'],{})['then'](respondWithResult(_0x19f10d,0xc9))[_0x1f81('0x43')](handleError(_0x19f10d,null));};exports['update']=function(_0x9a7ddb,_0x388936){if(_0x9a7ddb[_0x1f81('0x49')]['id']){delete _0x9a7ddb[_0x1f81('0x49')]['id'];}return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x9a7ddb[_0x1f81('0x4a')]['id']}})[_0x1f81('0x27')](handleEntityNotFound(_0x388936,null))[_0x1f81('0x27')](saveUpdates(_0x9a7ddb[_0x1f81('0x49')],null))['then'](respondWithResult(_0x388936,null))['catch'](handleError(_0x388936,null));};exports[_0x1f81('0x28')]=function(_0x271570,_0x56beff){return db[_0x1f81('0x2e')]['find']({'where':{'id':_0x271570[_0x1f81('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56beff,null))[_0x1f81('0x27')](removeEntity(_0x56beff,null))['catch'](handleError(_0x56beff,null));}; \ No newline at end of file +var _0xeae6=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','SquareMessage','includeAll','catch','show','params','include','find','create','body','update','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeae6,0xc3));var _0x6eae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeae6[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6eae('0x0'));var rimraf=require(_0x6eae('0x1'));var zipdir=require(_0x6eae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6eae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6eae('0x4'));var util=require(_0x6eae('0x5'));var path=require(_0x6eae('0x6'));var sox=require(_0x6eae('0x7'));var csv=require(_0x6eae('0x8'));var ejs=require(_0x6eae('0x9'));var fs=require('fs');var fs_extra=require(_0x6eae('0xa'));var _=require(_0x6eae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6eae('0xc'));var deskjs=require(_0x6eae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6eae('0xe'));var Papa=require(_0x6eae('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6eae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6eae('0x11'));var utils=require(_0x6eae('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6eae('0x13'));var db=require(_0x6eae('0x14'))['db'];function respondWithStatusCode(_0x23c547,_0x2f2593){_0x2f2593=_0x2f2593||0xcc;return function(_0x118bc0){if(_0x118bc0){return _0x23c547[_0x6eae('0x15')](_0x2f2593);}return _0x23c547[_0x6eae('0x16')](_0x2f2593)['end']();};}function respondWithResult(_0x6cb496,_0xb2fff2){_0xb2fff2=_0xb2fff2||0xc8;return function(_0x147b90){if(_0x147b90){return _0x6cb496[_0x6eae('0x16')](_0xb2fff2)[_0x6eae('0x17')](_0x147b90);}};}function respondWithFilteredResult(_0x3828a4,_0x230bc9){return function(_0x350393){if(_0x350393){var _0x1157c1=typeof _0x230bc9[_0x6eae('0x18')]===_0x6eae('0x19')&&typeof _0x230bc9[_0x6eae('0x1a')]===_0x6eae('0x19');var _0x3dc65a=_0x350393[_0x6eae('0x1b')];var _0x455a62=_0x1157c1?0x0:_0x230bc9[_0x6eae('0x18')];var _0x220e49=_0x1157c1?_0x350393[_0x6eae('0x1b')]:_0x230bc9[_0x6eae('0x18')]+_0x230bc9[_0x6eae('0x1a')];var _0x3b2a44;if(_0x220e49>=_0x3dc65a){_0x220e49=_0x3dc65a;_0x3b2a44=0xc8;}else{_0x3b2a44=0xce;}_0x3828a4[_0x6eae('0x16')](_0x3b2a44);return _0x3828a4[_0x6eae('0x1c')](_0x6eae('0x1d'),_0x455a62+'-'+_0x220e49+'/'+_0x3dc65a)[_0x6eae('0x17')](_0x350393);}return null;};}function patchUpdates(_0x385c76){return function(_0x2bfe01){try{jsonpatch['apply'](_0x2bfe01,_0x385c76,!![]);}catch(_0x2ca50c){return BPromise[_0x6eae('0x1e')](_0x2ca50c);}return _0x2bfe01[_0x6eae('0x1f')]();};}function saveUpdates(_0x15991f,_0x46242a){return function(_0x1b3061){if(_0x1b3061){return _0x1b3061['update'](_0x15991f)[_0x6eae('0x20')](function(_0x3d2b0a){return _0x3d2b0a;});}return null;};}function removeEntity(_0x6492d5,_0x15adf2){return function(_0x39e6d0){if(_0x39e6d0){return _0x39e6d0[_0x6eae('0x21')]()[_0x6eae('0x20')](function(){_0x6492d5[_0x6eae('0x16')](0xcc)[_0x6eae('0x22')]();});}};}function handleEntityNotFound(_0x34b2b8,_0x52ebe4){return function(_0x15628e){if(!_0x15628e){_0x34b2b8[_0x6eae('0x15')](0x194);}return _0x15628e;};}function handleError(_0x4cc829,_0x12a641){_0x12a641=_0x12a641||0x1f4;return function(_0x48abdb){logger[_0x6eae('0x23')](_0x48abdb['stack']);if(_0x48abdb[_0x6eae('0x24')]){delete _0x48abdb[_0x6eae('0x24')];}_0x4cc829[_0x6eae('0x16')](_0x12a641)[_0x6eae('0x25')](_0x48abdb);};}exports[_0x6eae('0x26')]=function(_0x18e50b,_0x501143){var _0x4d1253={},_0x41b30e={},_0x59eaed={'count':0x0,'rows':[]};var _0x592710=_[_0x6eae('0x27')](db['SquareMessage'][_0x6eae('0x28')],function(_0x363094){return{'name':_0x363094['fieldName'],'type':_0x363094['type'][_0x6eae('0x29')]};});_0x41b30e['model']=_[_0x6eae('0x27')](_0x592710,_0x6eae('0x24'));_0x41b30e[_0x6eae('0x2a')]=_[_0x6eae('0x2b')](_0x18e50b[_0x6eae('0x2a')]);_0x41b30e[_0x6eae('0x2c')]=_[_0x6eae('0x2d')](_0x41b30e['model'],_0x41b30e[_0x6eae('0x2a')]);_0x4d1253[_0x6eae('0x2e')]=_[_0x6eae('0x2d')](_0x41b30e[_0x6eae('0x2f')],qs[_0x6eae('0x30')](_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x30')]));_0x4d1253['attributes']=_0x4d1253[_0x6eae('0x2e')][_0x6eae('0x31')]?_0x4d1253[_0x6eae('0x2e')]:_0x41b30e['model'];if(!_0x18e50b['query'][_0x6eae('0x32')](_0x6eae('0x33'))){_0x4d1253['limit']=qs[_0x6eae('0x1a')](_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x1a')]);_0x4d1253['offset']=qs[_0x6eae('0x18')](_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x18')]);}_0x4d1253['order']=qs['sort'](_0x18e50b['query']['sort']);_0x4d1253[_0x6eae('0x34')]=qs[_0x6eae('0x2c')](_[_0x6eae('0x35')](_0x18e50b[_0x6eae('0x2a')],_0x41b30e[_0x6eae('0x2c')]),_0x592710);if(_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x36')]){_0x4d1253['where']=_[_0x6eae('0x37')](_0x4d1253[_0x6eae('0x34')],{'$or':_[_0x6eae('0x27')](_0x592710,function(_0x255b2a){if(_0x255b2a[_0x6eae('0x38')]!=='VIRTUAL'){var _0x5ab417={};_0x5ab417[_0x255b2a[_0x6eae('0x24')]]={'$like':'%'+_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x36')]+'%'};return _0x5ab417;}})});}_0x4d1253=_[_0x6eae('0x37')]({},_0x4d1253,_0x18e50b[_0x6eae('0x39')]);var _0x1181a6={'where':_0x4d1253[_0x6eae('0x34')]};return db[_0x6eae('0x3a')][_0x6eae('0x1b')](_0x1181a6)[_0x6eae('0x20')](function(_0x3da6a2){_0x59eaed['count']=_0x3da6a2;if(_0x18e50b[_0x6eae('0x2a')][_0x6eae('0x3b')]){_0x4d1253['include']=[{'all':!![]}];}return db[_0x6eae('0x3a')]['findAll'](_0x4d1253);})[_0x6eae('0x20')](function(_0x2038b8){_0x59eaed['rows']=_0x2038b8;return _0x59eaed;})['then'](respondWithFilteredResult(_0x501143,_0x4d1253))[_0x6eae('0x3c')](handleError(_0x501143,null));};exports[_0x6eae('0x3d')]=function(_0x8bf7b2,_0x260328){var _0x2c2b94={'raw':!![],'where':{'id':_0x8bf7b2[_0x6eae('0x3e')]['id']}},_0x282fb9={};_0x282fb9['model']=_[_0x6eae('0x2b')](db[_0x6eae('0x3a')][_0x6eae('0x28')]);_0x282fb9[_0x6eae('0x2a')]=_[_0x6eae('0x2b')](_0x8bf7b2[_0x6eae('0x2a')]);_0x282fb9['filters']=_[_0x6eae('0x2d')](_0x282fb9['model'],_0x282fb9[_0x6eae('0x2a')]);_0x2c2b94[_0x6eae('0x2e')]=_[_0x6eae('0x2d')](_0x282fb9[_0x6eae('0x2f')],qs[_0x6eae('0x30')](_0x8bf7b2['query'][_0x6eae('0x30')]));_0x2c2b94[_0x6eae('0x2e')]=_0x2c2b94['attributes'][_0x6eae('0x31')]?_0x2c2b94['attributes']:_0x282fb9[_0x6eae('0x2f')];if(_0x8bf7b2['query']['includeAll']){_0x2c2b94[_0x6eae('0x3f')]=[{'all':!![]}];}_0x2c2b94=_[_0x6eae('0x37')]({},_0x2c2b94,_0x8bf7b2[_0x6eae('0x39')]);return db['SquareMessage'][_0x6eae('0x40')](_0x2c2b94)[_0x6eae('0x20')](handleEntityNotFound(_0x260328,null))['then'](respondWithResult(_0x260328,null))[_0x6eae('0x3c')](handleError(_0x260328,null));};exports[_0x6eae('0x41')]=function(_0x4f849d,_0x2628d1){return db[_0x6eae('0x3a')][_0x6eae('0x41')](_0x4f849d[_0x6eae('0x42')],{})['then'](respondWithResult(_0x2628d1,0xc9))[_0x6eae('0x3c')](handleError(_0x2628d1,null));};exports[_0x6eae('0x43')]=function(_0x4fd332,_0x5dcc7a){if(_0x4fd332[_0x6eae('0x42')]['id']){delete _0x4fd332[_0x6eae('0x42')]['id'];}return db[_0x6eae('0x3a')][_0x6eae('0x40')]({'where':{'id':_0x4fd332[_0x6eae('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5dcc7a,null))[_0x6eae('0x20')](saveUpdates(_0x4fd332[_0x6eae('0x42')],null))[_0x6eae('0x20')](respondWithResult(_0x5dcc7a,null))[_0x6eae('0x3c')](handleError(_0x5dcc7a,null));};exports[_0x6eae('0x21')]=function(_0x4a8d6d,_0x35d0c6){return db[_0x6eae('0x3a')][_0x6eae('0x40')]({'where':{'id':_0x4a8d6d['params']['id']}})[_0x6eae('0x20')](handleEntityNotFound(_0x35d0c6,null))['then'](removeEntity(_0x35d0c6,null))[_0x6eae('0x3c')](handleError(_0x35d0c6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a721e02..211524c 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 _0x954d=['bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x11459a,_0x4c0899){var _0x201075=function(_0x36b17c){while(--_0x36b17c){_0x11459a['push'](_0x11459a['shift']());}};_0x201075(++_0x4c0899);}(_0x954d,0xdb));var _0xd954=function(_0x29d4ac,_0x5c4e0f){_0x29d4ac=_0x29d4ac-0x0;var _0x2a99b0=_0x954d[_0x29d4ac];return _0x2a99b0;};'use strict';var _=require(_0xd954('0x0'));var util=require(_0xd954('0x1'));var logger=require(_0xd954('0x2'))(_0xd954('0x3'));var moment=require(_0xd954('0x4'));var BPromise=require(_0xd954('0x5'));var rp=require(_0xd954('0x6'));var fs=require('fs');var path=require(_0xd954('0x7'));var rimraf=require('rimraf');var config=require(_0xd954('0x8'));var attributes=require(_0xd954('0x9'));module[_0xd954('0xa')]=function(_0x22979e,_0x42c81f){return _0x22979e[_0xd954('0xb')](_0xd954('0xc'),attributes,{'tableName':_0xd954('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8903=['path','rimraf','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8903,0x74));var _0x3890=function(_0x28237e,_0x2a7f11){_0x28237e=_0x28237e-0x0;var _0x1c014b=_0x8903[_0x28237e];return _0x1c014b;};'use strict';var _=require(_0x3890('0x0'));var util=require(_0x3890('0x1'));var logger=require(_0x3890('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3890('0x3'));var rp=require(_0x3890('0x4'));var fs=require('fs');var path=require(_0x3890('0x5'));var rimraf=require(_0x3890('0x6'));var config=require('../../config/environment');var attributes=require(_0x3890('0x7'));module[_0x3890('0x8')]=function(_0x4c8689,_0x1e263e){return _0x4c8689[_0x3890('0x9')]('SquareMessage',attributes,{'tableName':_0x3890('0xa'),'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 9bf0225..c8a2fa2 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 _0xd250=['request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd250,0x1bf));var _0x0d25=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xd250[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var moment=require('moment');var BPromise=require(_0x0d25('0x2'));var rs=require(_0x0d25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d25('0x4'))['db'];var utils=require(_0x0d25('0x5'));var logger=require(_0x0d25('0x6'))(_0x0d25('0x7'));var config=require(_0x0d25('0x8'));var jayson=require(_0x0d25('0x9'));var client=jayson[_0x0d25('0xa')][_0x0d25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ada88,_0xbd5507,_0x93edb0){return new BPromise(function(_0x1f9cc6,_0x50cad7){return client[_0x0d25('0xc')](_0x1ada88,_0x93edb0)[_0x0d25('0xd')](function(_0x43648a){logger[_0x0d25('0xe')](_0x0d25('0xf'),_0xbd5507,'request\x20sent');logger[_0x0d25('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0xbd5507,_0x0d25('0x11'),JSON[_0x0d25('0x12')](_0x43648a));if(_0x43648a[_0x0d25('0x13')]){if(_0x43648a[_0x0d25('0x13')][_0x0d25('0x14')]===0x1f4){logger[_0x0d25('0x13')](_0x0d25('0xf'),_0xbd5507,_0x43648a['error'][_0x0d25('0x15')]);return _0x50cad7(_0x43648a[_0x0d25('0x13')][_0x0d25('0x15')]);}logger[_0x0d25('0x13')](_0x0d25('0xf'),_0xbd5507,_0x43648a[_0x0d25('0x13')]['message']);return _0x1f9cc6(_0x43648a[_0x0d25('0x13')]['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0xbd5507,'request\x20sent');_0x1f9cc6(_0x43648a[_0x0d25('0x16')]['message']);}})[_0x0d25('0x17')](function(_0x3ca0a0){logger['error'](_0x0d25('0xf'),_0xbd5507,_0x3ca0a0);_0x50cad7(_0x3ca0a0);});});}exports[_0x0d25('0x18')]=function(_0x5840ea){var _0x167846=this;return new Promise(function(_0x14e7a0,_0x306c1b){return db[_0x0d25('0x19')][_0x0d25('0x1a')](_0x5840ea['body'],{'raw':_0x5840ea[_0x0d25('0x1b')]?_0x5840ea[_0x0d25('0x1b')][_0x0d25('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1a2e7a){logger['info'](_0x0d25('0x18'),_0x5840ea);logger[_0x0d25('0x10')]('CreateSquareMessage',_0x5840ea,JSON[_0x0d25('0x12')](_0x1a2e7a));_0x14e7a0(_0x1a2e7a);})[_0x0d25('0x17')](function(_0x390d53){logger[_0x0d25('0x13')](_0x0d25('0x18'),_0x390d53[_0x0d25('0x15')],_0x5840ea);_0x306c1b(_0x167846[_0x0d25('0x13')](0x1f4,_0x390d53[_0x0d25('0x15')]));});});}; \ No newline at end of file +var _0x67a1=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5b7f71,_0x445980){var _0x510689=function(_0x376085){while(--_0x376085){_0x5b7f71['push'](_0x5b7f71['shift']());}};_0x510689(++_0x445980);}(_0x67a1,0x77));var _0x167a=function(_0x385f11,_0x5d2123){_0x385f11=_0x385f11-0x0;var _0x513337=_0x67a1[_0x385f11];return _0x513337;};'use strict';var _=require(_0x167a('0x0'));var util=require(_0x167a('0x1'));var moment=require(_0x167a('0x2'));var BPromise=require(_0x167a('0x3'));var rs=require(_0x167a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x167a('0x5'))(_0x167a('0x6'));var config=require(_0x167a('0x7'));var jayson=require(_0x167a('0x8'));var client=jayson['client'][_0x167a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe325c7,_0x3d6469,_0x44b5e2){return new BPromise(function(_0x335e54,_0x1fb362){return client[_0x167a('0xa')](_0xe325c7,_0x44b5e2)[_0x167a('0xb')](function(_0x54beb8){logger[_0x167a('0xc')](_0x167a('0xd'),_0x3d6469,_0x167a('0xe'));logger[_0x167a('0xf')](_0x167a('0x10'),_0x3d6469,_0x167a('0xe'),JSON[_0x167a('0x11')](_0x54beb8));if(_0x54beb8['error']){if(_0x54beb8[_0x167a('0x12')]['code']===0x1f4){logger[_0x167a('0x12')](_0x167a('0xd'),_0x3d6469,_0x54beb8['error'][_0x167a('0x13')]);return _0x1fb362(_0x54beb8[_0x167a('0x12')][_0x167a('0x13')]);}logger[_0x167a('0x12')](_0x167a('0xd'),_0x3d6469,_0x54beb8[_0x167a('0x12')][_0x167a('0x13')]);return _0x335e54(_0x54beb8[_0x167a('0x12')]['message']);}else{logger[_0x167a('0xc')](_0x167a('0xd'),_0x3d6469,_0x167a('0xe'));_0x335e54(_0x54beb8[_0x167a('0x14')][_0x167a('0x13')]);}})[_0x167a('0x15')](function(_0x498289){logger['error'](_0x167a('0xd'),_0x3d6469,_0x498289);_0x1fb362(_0x498289);});});}exports[_0x167a('0x16')]=function(_0x12a4ad){var _0x2fee11=this;return new Promise(function(_0x50fca5,_0x24be00){return db['SquareMessage'][_0x167a('0x17')](_0x12a4ad[_0x167a('0x18')],{'raw':_0x12a4ad[_0x167a('0x19')]?_0x12a4ad[_0x167a('0x19')][_0x167a('0x1a')]===undefined?!![]:![]:!![]})[_0x167a('0xb')](function(_0x42e833){logger[_0x167a('0xc')](_0x167a('0x16'),_0x12a4ad);logger[_0x167a('0xf')](_0x167a('0x16'),_0x12a4ad,JSON[_0x167a('0x11')](_0x42e833));_0x50fca5(_0x42e833);})[_0x167a('0x15')](function(_0x85d162){logger['error'](_0x167a('0x16'),_0x85d162[_0x167a('0x13')],_0x12a4ad);_0x24be00(_0x2fee11[_0x167a('0x12')](0x1f4,_0x85d162['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f38e6fc..ae82103 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 _0xf2e8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','update','multer','path','connect-timeout'];(function(_0x1544a7,_0x57a0d4){var _0x23cdc7=function(_0x3d0833){while(--_0x3d0833){_0x1544a7['push'](_0x1544a7['shift']());}};_0x23cdc7(++_0x57a0d4);}(_0xf2e8,0x140));var _0x8f2e=function(_0x279462,_0x27913e){_0x279462=_0x279462-0x0;var _0x4e4227=_0xf2e8[_0x279462];return _0x4e4227;};'use strict';var multer=require(_0x8f2e('0x0'));var util=require('util');var path=require(_0x8f2e('0x1'));var timeout=require(_0x8f2e('0x2'));var express=require('express');var router=express[_0x8f2e('0x3')]();var fs_extra=require(_0x8f2e('0x4'));var auth=require(_0x8f2e('0x5'));var interaction=require(_0x8f2e('0x6'));var config=require(_0x8f2e('0x7'));var controller=require(_0x8f2e('0x8'));router[_0x8f2e('0x9')]('/',auth[_0x8f2e('0xa')](),controller[_0x8f2e('0xb')]);router[_0x8f2e('0x9')](_0x8f2e('0xc'),auth[_0x8f2e('0xa')](),controller[_0x8f2e('0xd')]);router[_0x8f2e('0x9')](_0x8f2e('0xe'),auth[_0x8f2e('0xa')](),timeout(_0x8f2e('0xf')),controller[_0x8f2e('0x10')]);router[_0x8f2e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8f2e('0xc'),auth[_0x8f2e('0xa')](),controller[_0x8f2e('0x12')]);router['delete'](_0x8f2e('0xc'),auth[_0x8f2e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0706=['/:id','show','15s','test','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index'];(function(_0xa5e664,_0x4ddb13){var _0x25088e=function(_0x57515a){while(--_0x57515a){_0xa5e664['push'](_0xa5e664['shift']());}};_0x25088e(++_0x4ddb13);}(_0x0706,0x185));var _0x6070=function(_0x2d63e2,_0x52054d){_0x2d63e2=_0x2d63e2-0x0;var _0xf01662=_0x0706[_0x2d63e2];return _0xf01662;};'use strict';var multer=require(_0x6070('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6070('0x1'));var express=require(_0x6070('0x2'));var router=express[_0x6070('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6070('0x4'));var config=require(_0x6070('0x5'));var controller=require(_0x6070('0x6'));router[_0x6070('0x7')]('/',auth[_0x6070('0x8')](),controller[_0x6070('0x9')]);router['get'](_0x6070('0xa'),auth[_0x6070('0x8')](),controller[_0x6070('0xb')]);router[_0x6070('0x7')]('/:id/test',auth[_0x6070('0x8')](),timeout(_0x6070('0xc')),controller[_0x6070('0xd')]);router['post']('/',auth[_0x6070('0x8')](),controller['create']);router[_0x6070('0xe')](_0x6070('0xa'),auth[_0x6070('0x8')](),controller[_0x6070('0xf')]);router[_0x6070('0x10')](_0x6070('0xa'),auth[_0x6070('0x8')](),controller[_0x6070('0x11')]);module[_0x6070('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 7365e6f..c5b93af 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 _0x2be8=['sequelize','exports','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2be8,0x102));var _0x82be=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0x2be8[_0x6c59fc];return _0x17c96f;};'use strict';var Sequelize=require(_0x82be('0x0'));module[_0x82be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x82be('0x2')]},'description':{'type':Sequelize[_0x82be('0x2')]}}; \ No newline at end of file +var _0xd183=['exports','name','STRING','sequelize'];(function(_0x30957c,_0x4a6982){var _0x27ac64=function(_0x4f8096){while(--_0x4f8096){_0x30957c['push'](_0x30957c['shift']());}};_0x27ac64(++_0x4a6982);}(_0xd183,0x117));var _0x3d18=function(_0x31bfe9,_0x3938d9){_0x31bfe9=_0x31bfe9-0x0;var _0x14ef7c=_0xd183[_0x31bfe9];return _0x14ef7c;};'use strict';var Sequelize=require(_0x3d18('0x0'));module[_0x3d18('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3d18('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3d18('0x3')]},'description':{'type':Sequelize[_0x3d18('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 03a1662..7a79076 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 _0x5845=['UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','ODBC','error','name','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','keys','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x4b4277,_0x22676f){var _0x1ff405=function(_0x2fa9e2){while(--_0x2fa9e2){_0x4b4277['push'](_0x4b4277['shift']());}};_0x1ff405(++_0x22676f);}(_0x5845,0xfd));var _0x5584=function(_0x2438e6,_0x29a52b){_0x2438e6=_0x2438e6-0x0;var _0x327a8b=_0x5845[_0x2438e6];return _0x327a8b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5584('0x0'));var jsonpatch=require(_0x5584('0x1'));var rp=require(_0x5584('0x2'));var moment=require(_0x5584('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5584('0x4'));var util=require(_0x5584('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5584('0x6'));var ejs=require(_0x5584('0x7'));var fs=require('fs');var fs_extra=require(_0x5584('0x8'));var _=require('lodash');var squel=require(_0x5584('0x9'));var crypto=require(_0x5584('0xa'));var jsforce=require(_0x5584('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5584('0x6'));var querystring=require(_0x5584('0xc'));var Papa=require('papaparse');var Redis=require(_0x5584('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5584('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5584('0xf'))(_0x5584('0x10'));var utils=require('../../config/utils');var config=require(_0x5584('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d5c00,_0x294fa5){_0x294fa5=_0x294fa5||0xcc;return function(_0x3e0a83){if(_0x3e0a83){return _0x1d5c00[_0x5584('0x12')](_0x294fa5);}return _0x1d5c00[_0x5584('0x13')](_0x294fa5)[_0x5584('0x14')]();};}function respondWithResult(_0x3ef780,_0x3eca53){_0x3eca53=_0x3eca53||0xc8;return function(_0x39e6eb){if(_0x39e6eb){return _0x3ef780['status'](_0x3eca53)[_0x5584('0x15')](_0x39e6eb);}};}function respondWithFilteredResult(_0x3914f8,_0x2daf9a){return function(_0x406619){if(_0x406619){var _0x42c4db=typeof _0x2daf9a[_0x5584('0x16')]==='undefined'&&typeof _0x2daf9a['limit']===_0x5584('0x17');var _0x2ae02f=_0x406619[_0x5584('0x18')];var _0x505ce6=_0x42c4db?0x0:_0x2daf9a[_0x5584('0x16')];var _0x409956=_0x42c4db?_0x406619[_0x5584('0x18')]:_0x2daf9a['offset']+_0x2daf9a[_0x5584('0x19')];var _0x5ab066;if(_0x409956>=_0x2ae02f){_0x409956=_0x2ae02f;_0x5ab066=0xc8;}else{_0x5ab066=0xce;}_0x3914f8['status'](_0x5ab066);return _0x3914f8['set'](_0x5584('0x1a'),_0x505ce6+'-'+_0x409956+'/'+_0x2ae02f)[_0x5584('0x15')](_0x406619);}return null;};}function patchUpdates(_0x44b465){return function(_0x340926){try{jsonpatch[_0x5584('0x1b')](_0x340926,_0x44b465,!![]);}catch(_0x1aa17c){return BPromise[_0x5584('0x1c')](_0x1aa17c);}return _0x340926['save']();};}function saveUpdates(_0x4356e5,_0x3b5b48){return function(_0x3f7c7d){if(_0x3f7c7d){return _0x3f7c7d[_0x5584('0x1d')](_0x4356e5)[_0x5584('0x1e')](function(_0x24c6ef){return _0x24c6ef;});}return null;};}function removeEntity(_0x2358f8,_0x2c3f28){return function(_0x165132){if(_0x165132){return _0x165132[_0x5584('0x1f')]()['then'](function(){var _0x7a333c=_0x165132[_0x5584('0x20')]({'plain':!![]});var _0x155293=_0x5584('0x21');return db['UserProfileResource'][_0x5584('0x1f')]({'where':{'type':_0x155293,'resourceId':_0x7a333c['id']}})[_0x5584('0x1e')](function(){return _0x165132;});})[_0x5584('0x1e')](function(){_0x2358f8[_0x5584('0x13')](0xcc)[_0x5584('0x14')]();});}};}function handleEntityNotFound(_0x5efc96,_0x407089){return function(_0x35140b){if(!_0x35140b){_0x5efc96[_0x5584('0x12')](0x194);}return _0x35140b;};}function handleError(_0x44a6fa,_0x524118){_0x524118=_0x524118||0x1f4;return function(_0x39c7a8){logger[_0x5584('0x22')](_0x39c7a8['stack']);if(_0x39c7a8['name']){delete _0x39c7a8[_0x5584('0x23')];}_0x44a6fa[_0x5584('0x13')](_0x524118)['send'](_0x39c7a8);};}exports[_0x5584('0x24')]=function(_0x147c84,_0xbc5347){var _0x4b6310={},_0x2dc26c={},_0x329d1d={'count':0x0,'rows':[]};var _0x5b59a8=_[_0x5584('0x25')](db[_0x5584('0x26')][_0x5584('0x27')],function(_0x2391b6){return{'name':_0x2391b6[_0x5584('0x28')],'type':_0x2391b6['type'][_0x5584('0x29')]};});_0x2dc26c[_0x5584('0x2a')]=_[_0x5584('0x25')](_0x5b59a8,'name');_0x2dc26c[_0x5584('0x2b')]=_['keys'](_0x147c84[_0x5584('0x2b')]);_0x2dc26c[_0x5584('0x2c')]=_[_0x5584('0x2d')](_0x2dc26c[_0x5584('0x2a')],_0x2dc26c['query']);_0x4b6310[_0x5584('0x2e')]=_[_0x5584('0x2d')](_0x2dc26c[_0x5584('0x2a')],qs[_0x5584('0x2f')](_0x147c84[_0x5584('0x2b')][_0x5584('0x2f')]));_0x4b6310[_0x5584('0x2e')]=_0x4b6310[_0x5584('0x2e')][_0x5584('0x30')]?_0x4b6310['attributes']:_0x2dc26c[_0x5584('0x2a')];if(!_0x147c84[_0x5584('0x2b')][_0x5584('0x31')](_0x5584('0x32'))){_0x4b6310[_0x5584('0x19')]=qs[_0x5584('0x19')](_0x147c84['query'][_0x5584('0x19')]);_0x4b6310[_0x5584('0x16')]=qs['offset'](_0x147c84['query'][_0x5584('0x16')]);}_0x4b6310[_0x5584('0x33')]=qs[_0x5584('0x34')](_0x147c84[_0x5584('0x2b')][_0x5584('0x34')]);_0x4b6310['where']=qs[_0x5584('0x2c')](_[_0x5584('0x35')](_0x147c84[_0x5584('0x2b')],_0x2dc26c['filters']),_0x5b59a8);if(_0x147c84[_0x5584('0x2b')][_0x5584('0x36')]){_0x4b6310[_0x5584('0x37')]=_[_0x5584('0x38')](_0x4b6310[_0x5584('0x37')],{'$or':_[_0x5584('0x25')](_0x5b59a8,function(_0x448a6e){if(_0x448a6e[_0x5584('0x39')]!==_0x5584('0x3a')){var _0x167b18={};_0x167b18[_0x448a6e[_0x5584('0x23')]]={'$like':'%'+_0x147c84['query'][_0x5584('0x36')]+'%'};return _0x167b18;}})});}_0x4b6310=_[_0x5584('0x38')]({},_0x4b6310,_0x147c84['options']);var _0x42395e={'where':_0x4b6310[_0x5584('0x37')]};return db[_0x5584('0x26')]['count'](_0x42395e)['then'](function(_0x23faef){_0x329d1d[_0x5584('0x18')]=_0x23faef;if(_0x147c84['query'][_0x5584('0x3b')]){_0x4b6310['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x5584('0x3c')](_0x4b6310);})[_0x5584('0x1e')](function(_0x3da46d){_0x329d1d['rows']=_0x3da46d;return _0x329d1d;})['then'](respondWithFilteredResult(_0xbc5347,_0x4b6310))[_0x5584('0x3d')](handleError(_0xbc5347,null));};exports[_0x5584('0x3e')]=function(_0x2cdcdb,_0x98c987){var _0x1ac10c={'raw':!![],'where':{'id':_0x2cdcdb[_0x5584('0x3f')]['id']}},_0x161eaf={};_0x161eaf['model']=_[_0x5584('0x40')](db['SquareOdbc'][_0x5584('0x27')]);_0x161eaf[_0x5584('0x2b')]=_[_0x5584('0x40')](_0x2cdcdb['query']);_0x161eaf[_0x5584('0x2c')]=_['intersection'](_0x161eaf[_0x5584('0x2a')],_0x161eaf[_0x5584('0x2b')]);_0x1ac10c[_0x5584('0x2e')]=_[_0x5584('0x2d')](_0x161eaf['model'],qs[_0x5584('0x2f')](_0x2cdcdb[_0x5584('0x2b')]['fields']));_0x1ac10c[_0x5584('0x2e')]=_0x1ac10c[_0x5584('0x2e')]['length']?_0x1ac10c[_0x5584('0x2e')]:_0x161eaf[_0x5584('0x2a')];if(_0x2cdcdb[_0x5584('0x2b')][_0x5584('0x3b')]){_0x1ac10c[_0x5584('0x41')]=[{'all':!![]}];}_0x1ac10c=_[_0x5584('0x38')]({},_0x1ac10c,_0x2cdcdb[_0x5584('0x42')]);return db['SquareOdbc'][_0x5584('0x43')](_0x1ac10c)['then'](handleEntityNotFound(_0x98c987,null))[_0x5584('0x1e')](respondWithResult(_0x98c987,null))['catch'](handleError(_0x98c987,null));};exports['create']=function(_0x3cb042,_0x8ef60f){return db[_0x5584('0x26')]['create'](_0x3cb042[_0x5584('0x44')],{})[_0x5584('0x1e')](function(_0x1eb259){var _0x5b8fa5=_0x3cb042[_0x5584('0x45')][_0x5584('0x20')]({'plain':!![]});if(!_0x5b8fa5)throw new Error(_0x5584('0x46'));if(_0x5b8fa5[_0x5584('0x47')]===_0x5584('0x45')){var _0x41e7a1=_0x1eb259['get']({'plain':!![]});var _0x34b67b=_0x5584('0x21');return db[_0x5584('0x48')][_0x5584('0x43')]({'where':{'name':_0x34b67b,'userProfileId':_0x5b8fa5[_0x5584('0x49')]},'raw':!![]})[_0x5584('0x1e')](function(_0x1cbd4c){if(_0x1cbd4c&&_0x1cbd4c[_0x5584('0x4a')]===0x0){return db[_0x5584('0x4b')][_0x5584('0x4c')]({'name':_0x41e7a1[_0x5584('0x23')],'resourceId':_0x41e7a1['id'],'type':_0x1cbd4c[_0x5584('0x23')],'sectionId':_0x1cbd4c['id']},{})[_0x5584('0x1e')](function(){return _0x1eb259;});}else{return _0x1eb259;}})['catch'](function(_0x40c394){logger[_0x5584('0x22')](_0x5584('0x4d'),_0x40c394);throw _0x40c394;});}return _0x1eb259;})['then'](respondWithResult(_0x8ef60f,0xc9))[_0x5584('0x3d')](handleError(_0x8ef60f,null));};exports[_0x5584('0x1d')]=function(_0x6b5332,_0x1aa7b8){if(_0x6b5332['body']['id']){delete _0x6b5332[_0x5584('0x44')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x6b5332['params']['id']}})[_0x5584('0x1e')](handleEntityNotFound(_0x1aa7b8,null))[_0x5584('0x1e')](saveUpdates(_0x6b5332[_0x5584('0x44')],null))[_0x5584('0x1e')](respondWithResult(_0x1aa7b8,null))[_0x5584('0x3d')](handleError(_0x1aa7b8,null));};exports[_0x5584('0x1f')]=function(_0x2404ca,_0x11c094){return db[_0x5584('0x26')][_0x5584('0x43')]({'where':{'id':_0x2404ca['params']['id']}})[_0x5584('0x1e')](handleEntityNotFound(_0x11c094,null))['then'](removeEntity(_0x11c094,null))[_0x5584('0x3d')](handleError(_0x11c094,null));};exports[_0x5584('0x4e')]=function(_0x1631ab,_0x3b3e3c,_0x31222b){var _0x55bfb8;return db[_0x5584('0x26')][_0x5584('0x43')]({'where':{'id':_0x1631ab['params']['id']},'attributes':['id',_0x5584('0x4f')]})['then'](handleEntityNotFound(_0x3b3e3c,null))['then'](function(_0x57647c){if(_0x57647c){var _0x2eab58=require(_0x5584('0x50'))();_0x2eab58[_0x5584('0x51')](_0x57647c[_0x5584('0x4f')]);_0x2eab58['closeSync']();return _0x57647c;}})[_0x5584('0x1e')](respondWithResult(_0x3b3e3c,null))[_0x5584('0x3d')](handleError(_0x3b3e3c,null));}; \ No newline at end of file +var _0x05cc=['find','params','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','get','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','create','body','user','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x36a8cf,_0x18c758){var _0x3b3383=function(_0x13bc60){while(--_0x13bc60){_0x36a8cf['push'](_0x36a8cf['shift']());}};_0x3b3383(++_0x18c758);}(_0x05cc,0x1b9));var _0xc05c=function(_0x18bf17,_0x32626e){_0x18bf17=_0x18bf17-0x0;var _0x7c4e02=_0x05cc[_0x18bf17];return _0x7c4e02;};'use strict';var emlformat=require(_0xc05c('0x0'));var rimraf=require(_0xc05c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc05c('0x2'));var rp=require(_0xc05c('0x3'));var moment=require(_0xc05c('0x4'));var BPromise=require(_0xc05c('0x5'));var Mustache=require(_0xc05c('0x6'));var util=require('util');var path=require(_0xc05c('0x7'));var sox=require(_0xc05c('0x8'));var csv=require(_0xc05c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc05c('0xa'));var _=require(_0xc05c('0xb'));var squel=require('squel');var crypto=require(_0xc05c('0xc'));var jsforce=require(_0xc05c('0xd'));var deskjs=require(_0xc05c('0xe'));var toCsv=require(_0xc05c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc05c('0xf'));var authService=require(_0xc05c('0x10'));var qs=require(_0xc05c('0x11'));var as=require(_0xc05c('0x12'));var hardwareService=require(_0xc05c('0x13'));var logger=require(_0xc05c('0x14'))('api');var utils=require(_0xc05c('0x15'));var config=require(_0xc05c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc05c('0x17'))['db'];function respondWithStatusCode(_0x217167,_0x28a802){_0x28a802=_0x28a802||0xcc;return function(_0x486c2c){if(_0x486c2c){return _0x217167[_0xc05c('0x18')](_0x28a802);}return _0x217167[_0xc05c('0x19')](_0x28a802)['end']();};}function respondWithResult(_0x3f85cc,_0x4b7779){_0x4b7779=_0x4b7779||0xc8;return function(_0x48e49d){if(_0x48e49d){return _0x3f85cc[_0xc05c('0x19')](_0x4b7779)[_0xc05c('0x1a')](_0x48e49d);}};}function respondWithFilteredResult(_0x4b477b,_0x426c6f){return function(_0x2f2eeb){if(_0x2f2eeb){var _0x38e741=typeof _0x426c6f[_0xc05c('0x1b')]==='undefined'&&typeof _0x426c6f['limit']===_0xc05c('0x1c');var _0x1191cb=_0x2f2eeb[_0xc05c('0x1d')];var _0x35f559=_0x38e741?0x0:_0x426c6f[_0xc05c('0x1b')];var _0xf56bf9=_0x38e741?_0x2f2eeb[_0xc05c('0x1d')]:_0x426c6f[_0xc05c('0x1b')]+_0x426c6f[_0xc05c('0x1e')];var _0x530708;if(_0xf56bf9>=_0x1191cb){_0xf56bf9=_0x1191cb;_0x530708=0xc8;}else{_0x530708=0xce;}_0x4b477b['status'](_0x530708);return _0x4b477b[_0xc05c('0x1f')](_0xc05c('0x20'),_0x35f559+'-'+_0xf56bf9+'/'+_0x1191cb)[_0xc05c('0x1a')](_0x2f2eeb);}return null;};}function patchUpdates(_0x37e928){return function(_0x1120de){try{jsonpatch[_0xc05c('0x21')](_0x1120de,_0x37e928,!![]);}catch(_0x17f0d4){return BPromise[_0xc05c('0x22')](_0x17f0d4);}return _0x1120de['save']();};}function saveUpdates(_0x548b3a,_0x501656){return function(_0x29322b){if(_0x29322b){return _0x29322b['update'](_0x548b3a)[_0xc05c('0x23')](function(_0x5141de){return _0x5141de;});}return null;};}function removeEntity(_0x2356f6,_0x173f8b){return function(_0x362e27){if(_0x362e27){return _0x362e27['destroy']()[_0xc05c('0x23')](function(){var _0x12fe08=_0x362e27[_0xc05c('0x24')]({'plain':!![]});var _0x8fb518='ODBC';return db['UserProfileResource'][_0xc05c('0x25')]({'where':{'type':_0x8fb518,'resourceId':_0x12fe08['id']}})['then'](function(){return _0x362e27;});})[_0xc05c('0x23')](function(){_0x2356f6[_0xc05c('0x19')](0xcc)[_0xc05c('0x26')]();});}};}function handleEntityNotFound(_0xdabc0a,_0x52d552){return function(_0x1d52d9){if(!_0x1d52d9){_0xdabc0a[_0xc05c('0x18')](0x194);}return _0x1d52d9;};}function handleError(_0x2288e3,_0x2aead4){_0x2aead4=_0x2aead4||0x1f4;return function(_0x2c0b11){logger[_0xc05c('0x27')](_0x2c0b11[_0xc05c('0x28')]);if(_0x2c0b11[_0xc05c('0x29')]){delete _0x2c0b11['name'];}_0x2288e3[_0xc05c('0x19')](_0x2aead4)['send'](_0x2c0b11);};}exports[_0xc05c('0x2a')]=function(_0x104b39,_0xd0b827){var _0x1b56d6={},_0x461999={},_0x6109e7={'count':0x0,'rows':[]};var _0x3a80ab=_['map'](db['SquareOdbc'][_0xc05c('0x2b')],function(_0x5381ff){return{'name':_0x5381ff[_0xc05c('0x2c')],'type':_0x5381ff[_0xc05c('0x2d')][_0xc05c('0x2e')]};});_0x461999[_0xc05c('0x2f')]=_[_0xc05c('0x30')](_0x3a80ab,_0xc05c('0x29'));_0x461999[_0xc05c('0x31')]=_[_0xc05c('0x32')](_0x104b39['query']);_0x461999[_0xc05c('0x33')]=_[_0xc05c('0x34')](_0x461999[_0xc05c('0x2f')],_0x461999[_0xc05c('0x31')]);_0x1b56d6[_0xc05c('0x35')]=_[_0xc05c('0x34')](_0x461999[_0xc05c('0x2f')],qs[_0xc05c('0x36')](_0x104b39[_0xc05c('0x31')][_0xc05c('0x36')]));_0x1b56d6[_0xc05c('0x35')]=_0x1b56d6['attributes'][_0xc05c('0x37')]?_0x1b56d6['attributes']:_0x461999[_0xc05c('0x2f')];if(!_0x104b39[_0xc05c('0x31')]['hasOwnProperty'](_0xc05c('0x38'))){_0x1b56d6['limit']=qs[_0xc05c('0x1e')](_0x104b39[_0xc05c('0x31')][_0xc05c('0x1e')]);_0x1b56d6['offset']=qs[_0xc05c('0x1b')](_0x104b39[_0xc05c('0x31')][_0xc05c('0x1b')]);}_0x1b56d6[_0xc05c('0x39')]=qs['sort'](_0x104b39['query']['sort']);_0x1b56d6[_0xc05c('0x3a')]=qs['filters'](_[_0xc05c('0x3b')](_0x104b39[_0xc05c('0x31')],_0x461999['filters']),_0x3a80ab);if(_0x104b39[_0xc05c('0x31')][_0xc05c('0x3c')]){_0x1b56d6[_0xc05c('0x3a')]=_[_0xc05c('0x3d')](_0x1b56d6['where'],{'$or':_['map'](_0x3a80ab,function(_0x1d8870){if(_0x1d8870[_0xc05c('0x2d')]!==_0xc05c('0x3e')){var _0x19d493={};_0x19d493[_0x1d8870[_0xc05c('0x29')]]={'$like':'%'+_0x104b39[_0xc05c('0x31')][_0xc05c('0x3c')]+'%'};return _0x19d493;}})});}_0x1b56d6=_[_0xc05c('0x3d')]({},_0x1b56d6,_0x104b39[_0xc05c('0x3f')]);var _0x4c1f07={'where':_0x1b56d6[_0xc05c('0x3a')]};return db[_0xc05c('0x40')][_0xc05c('0x1d')](_0x4c1f07)['then'](function(_0x6307c7){_0x6109e7['count']=_0x6307c7;if(_0x104b39['query'][_0xc05c('0x41')]){_0x1b56d6[_0xc05c('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0xc05c('0x43')](_0x1b56d6);})[_0xc05c('0x23')](function(_0x1df5db){_0x6109e7[_0xc05c('0x44')]=_0x1df5db;return _0x6109e7;})[_0xc05c('0x23')](respondWithFilteredResult(_0xd0b827,_0x1b56d6))[_0xc05c('0x45')](handleError(_0xd0b827,null));};exports[_0xc05c('0x46')]=function(_0x12b023,_0x2cafa4){var _0x418ee3={'raw':!![],'where':{'id':_0x12b023['params']['id']}},_0x580d12={};_0x580d12[_0xc05c('0x2f')]=_['keys'](db[_0xc05c('0x40')][_0xc05c('0x2b')]);_0x580d12['query']=_[_0xc05c('0x32')](_0x12b023[_0xc05c('0x31')]);_0x580d12[_0xc05c('0x33')]=_[_0xc05c('0x34')](_0x580d12[_0xc05c('0x2f')],_0x580d12['query']);_0x418ee3[_0xc05c('0x35')]=_['intersection'](_0x580d12[_0xc05c('0x2f')],qs[_0xc05c('0x36')](_0x12b023[_0xc05c('0x31')]['fields']));_0x418ee3['attributes']=_0x418ee3[_0xc05c('0x35')][_0xc05c('0x37')]?_0x418ee3[_0xc05c('0x35')]:_0x580d12[_0xc05c('0x2f')];if(_0x12b023['query'][_0xc05c('0x41')]){_0x418ee3[_0xc05c('0x42')]=[{'all':!![]}];}_0x418ee3=_[_0xc05c('0x3d')]({},_0x418ee3,_0x12b023[_0xc05c('0x3f')]);return db[_0xc05c('0x40')]['find'](_0x418ee3)[_0xc05c('0x23')](handleEntityNotFound(_0x2cafa4,null))[_0xc05c('0x23')](respondWithResult(_0x2cafa4,null))[_0xc05c('0x45')](handleError(_0x2cafa4,null));};exports[_0xc05c('0x47')]=function(_0xfc9806,_0xad5968){return db['SquareOdbc'][_0xc05c('0x47')](_0xfc9806[_0xc05c('0x48')],{})[_0xc05c('0x23')](function(_0x572e5f){var _0x4c987b=_0xfc9806[_0xc05c('0x49')][_0xc05c('0x24')]({'plain':!![]});if(!_0x4c987b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c987b['role']===_0xc05c('0x49')){var _0x51e600=_0x572e5f[_0xc05c('0x24')]({'plain':!![]});var _0xb77aa1=_0xc05c('0x4a');return db[_0xc05c('0x4b')]['find']({'where':{'name':_0xb77aa1,'userProfileId':_0x4c987b[_0xc05c('0x4c')]},'raw':!![]})[_0xc05c('0x23')](function(_0x5b4a98){if(_0x5b4a98&&_0x5b4a98[_0xc05c('0x4d')]===0x0){return db[_0xc05c('0x4e')]['create']({'name':_0x51e600['name'],'resourceId':_0x51e600['id'],'type':_0x5b4a98[_0xc05c('0x29')],'sectionId':_0x5b4a98['id']},{})['then'](function(){return _0x572e5f;});}else{return _0x572e5f;}})['catch'](function(_0x33d816){logger[_0xc05c('0x27')](_0xc05c('0x4f'),_0x33d816);throw _0x33d816;});}return _0x572e5f;})['then'](respondWithResult(_0xad5968,0xc9))[_0xc05c('0x45')](handleError(_0xad5968,null));};exports[_0xc05c('0x50')]=function(_0x3592f7,_0x346d36){if(_0x3592f7[_0xc05c('0x48')]['id']){delete _0x3592f7[_0xc05c('0x48')]['id'];}return db[_0xc05c('0x40')][_0xc05c('0x51')]({'where':{'id':_0x3592f7['params']['id']}})[_0xc05c('0x23')](handleEntityNotFound(_0x346d36,null))[_0xc05c('0x23')](saveUpdates(_0x3592f7[_0xc05c('0x48')],null))[_0xc05c('0x23')](respondWithResult(_0x346d36,null))[_0xc05c('0x45')](handleError(_0x346d36,null));};exports[_0xc05c('0x25')]=function(_0x2b285c,_0x2926d2){return db[_0xc05c('0x40')][_0xc05c('0x51')]({'where':{'id':_0x2b285c['params']['id']}})[_0xc05c('0x23')](handleEntityNotFound(_0x2926d2,null))[_0xc05c('0x23')](removeEntity(_0x2926d2,null))[_0xc05c('0x45')](handleError(_0x2926d2,null));};exports['test']=function(_0x2dba43,_0x1d2090,_0x989360){var _0x265bc7;return db[_0xc05c('0x40')]['find']({'where':{'id':_0x2dba43[_0xc05c('0x52')]['id']},'attributes':['id',_0xc05c('0x53')]})[_0xc05c('0x23')](handleEntityNotFound(_0x1d2090,null))[_0xc05c('0x23')](function(_0x404142){if(_0x404142){var _0x4ebab5=require(_0xc05c('0x54'))();_0x4ebab5[_0xc05c('0x55')](_0x404142[_0xc05c('0x53')]);_0x4ebab5[_0xc05c('0x56')]();return _0x404142;}})[_0xc05c('0x23')](respondWithResult(_0x1d2090,null))[_0xc05c('0x45')](handleError(_0x1d2090,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 115cff7..097c25c 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 _0x8c82=['rimraf','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167bf6,_0x3f0aac){var _0x56cbf9=function(_0x34b200){while(--_0x34b200){_0x167bf6['push'](_0x167bf6['shift']());}};_0x56cbf9(++_0x3f0aac);}(_0x8c82,0xae));var _0x28c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c82[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28c8('0x0'));var util=require(_0x28c8('0x1'));var logger=require(_0x28c8('0x2'))(_0x28c8('0x3'));var moment=require(_0x28c8('0x4'));var BPromise=require(_0x28c8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x28c8('0x6'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x5185ee,_0xa6b2ce){return _0x5185ee['define'](_0x28c8('0x7'),attributes,{'tableName':_0x28c8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e17=['square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0xe1acf,_0x1fe520){var _0xcc97a=function(_0x4a5d44){while(--_0x4a5d44){_0xe1acf['push'](_0xe1acf['shift']());}};_0xcc97a(++_0x1fe520);}(_0x1e17,0x71));var _0x71e1=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x1e17[_0x44a64f];return _0x52024b;};'use strict';var _=require(_0x71e1('0x0'));var util=require(_0x71e1('0x1'));var logger=require(_0x71e1('0x2'))(_0x71e1('0x3'));var moment=require(_0x71e1('0x4'));var BPromise=require(_0x71e1('0x5'));var rp=require(_0x71e1('0x6'));var fs=require('fs');var path=require(_0x71e1('0x7'));var rimraf=require('rimraf');var config=require(_0x71e1('0x8'));var attributes=require(_0x71e1('0x9'));module[_0x71e1('0xa')]=function(_0x36c710,_0x3bacb8){return _0x36c710[_0x71e1('0xb')](_0x71e1('0xc'),attributes,{'tableName':_0x71e1('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 0d8ee4b..93d532b 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 _0x657e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','catch'];(function(_0x15b8ab,_0x26affc){var _0x2eb0b9=function(_0x2b62c2){while(--_0x2b62c2){_0x15b8ab['push'](_0x15b8ab['shift']());}};_0x2eb0b9(++_0x26affc);}(_0x657e,0x1ba));var _0xe657=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x657e[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var moment=require(_0xe657('0x2'));var BPromise=require(_0xe657('0x3'));var rs=require(_0xe657('0x4'));var fs=require('fs');var Redis=require(_0xe657('0x5'));var db=require(_0xe657('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe657('0x7'))(_0xe657('0x8'));var config=require(_0xe657('0x9'));var jayson=require(_0xe657('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x205a7f,_0x4bafbc,_0x339b73){return new BPromise(function(_0x2d08e8,_0x4e55c1){return client[_0xe657('0xb')](_0x205a7f,_0x339b73)[_0xe657('0xc')](function(_0x40f18b){logger['info'](_0xe657('0xd'),_0x4bafbc,_0xe657('0xe'));logger[_0xe657('0xf')](_0xe657('0x10'),_0x4bafbc,'request\x20sent',JSON[_0xe657('0x11')](_0x40f18b));if(_0x40f18b[_0xe657('0x12')]){if(_0x40f18b['error'][_0xe657('0x13')]===0x1f4){logger['error'](_0xe657('0xd'),_0x4bafbc,_0x40f18b[_0xe657('0x12')][_0xe657('0x14')]);return _0x4e55c1(_0x40f18b['error'][_0xe657('0x14')]);}logger[_0xe657('0x12')](_0xe657('0xd'),_0x4bafbc,_0x40f18b['error'][_0xe657('0x14')]);return _0x2d08e8(_0x40f18b[_0xe657('0x12')][_0xe657('0x14')]);}else{logger[_0xe657('0x15')](_0xe657('0xd'),_0x4bafbc,_0xe657('0xe'));_0x2d08e8(_0x40f18b[_0xe657('0x16')][_0xe657('0x14')]);}})['catch'](function(_0x5e969b){logger[_0xe657('0x12')](_0xe657('0xd'),_0x4bafbc,_0x5e969b);_0x4e55c1(_0x5e969b);});});}exports[_0xe657('0x17')]=function(_0x474a81){var _0x1f635c=this;return new Promise(function(_0x187b39,_0x2bbefa){return db[_0xe657('0x18')][_0xe657('0x19')]({'raw':_0x474a81[_0xe657('0x1a')]?_0x474a81[_0xe657('0x1a')][_0xe657('0x1b')]===undefined?!![]:![]:!![],'where':_0x474a81['options']?_0x474a81[_0xe657('0x1a')][_0xe657('0x1c')]||null:null,'attributes':_0x474a81[_0xe657('0x1a')]?_0x474a81[_0xe657('0x1a')][_0xe657('0x1d')]||null:null,'include':_0x474a81['options']?_0x474a81[_0xe657('0x1a')][_0xe657('0x1e')]?_[_0xe657('0x1f')](_0x474a81[_0xe657('0x1a')]['include'],function(_0x1f3fa8){return{'model':db[_0x1f3fa8['model']],'as':_0x1f3fa8['as'],'attributes':_0x1f3fa8[_0xe657('0x1d')],'include':_0x1f3fa8[_0xe657('0x1e')]?_[_0xe657('0x1f')](_0x1f3fa8[_0xe657('0x1e')],function(_0x4aaa63){return{'model':db[_0x4aaa63[_0xe657('0x20')]],'as':_0x4aaa63['as'],'attributes':_0x4aaa63[_0xe657('0x1d')],'include':_0x4aaa63[_0xe657('0x1e')]?_[_0xe657('0x1f')](_0x4aaa63[_0xe657('0x1e')],function(_0xb3fba){return{'model':db[_0xb3fba[_0xe657('0x20')]],'as':_0xb3fba['as'],'attributes':_0xb3fba[_0xe657('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xc')](function(_0x256f5a){logger[_0xe657('0x15')](_0xe657('0x17'),_0x474a81);logger[_0xe657('0xf')](_0xe657('0x17'),_0x474a81,JSON[_0xe657('0x11')](_0x256f5a));_0x187b39(_0x256f5a);})[_0xe657('0x21')](function(_0x2e70e8){logger[_0xe657('0x12')](_0xe657('0x17'),_0x2e70e8[_0xe657('0x14')],_0x474a81);_0x2bbefa(_0x1f635c[_0xe657('0x12')](0x1f4,_0x2e70e8[_0xe657('0x14')]));});});}; \ No newline at end of file +var _0xe5dd=['include','map','attributes','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareOdbc','options','raw'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe5dd,0xe4));var _0xde5d=function(_0x2e5ca5,_0x34c890){_0x2e5ca5=_0x2e5ca5-0x0;var _0x39f407=_0xe5dd[_0x2e5ca5];return _0x39f407;};'use strict';var _=require(_0xde5d('0x0'));var util=require('util');var moment=require(_0xde5d('0x1'));var BPromise=require(_0xde5d('0x2'));var rs=require(_0xde5d('0x3'));var fs=require('fs');var Redis=require(_0xde5d('0x4'));var db=require(_0xde5d('0x5'))['db'];var utils=require(_0xde5d('0x6'));var logger=require(_0xde5d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde5d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5366b7,_0x1597ca,_0x28a2cf){return new BPromise(function(_0x4c7d36,_0x580426){return client[_0xde5d('0x9')](_0x5366b7,_0x28a2cf)[_0xde5d('0xa')](function(_0x436b69){logger[_0xde5d('0xb')](_0xde5d('0xc'),_0x1597ca,_0xde5d('0xd'));logger[_0xde5d('0xe')](_0xde5d('0xf'),_0x1597ca,_0xde5d('0xd'),JSON[_0xde5d('0x10')](_0x436b69));if(_0x436b69[_0xde5d('0x11')]){if(_0x436b69[_0xde5d('0x11')][_0xde5d('0x12')]===0x1f4){logger[_0xde5d('0x11')](_0xde5d('0xc'),_0x1597ca,_0x436b69[_0xde5d('0x11')][_0xde5d('0x13')]);return _0x580426(_0x436b69['error'][_0xde5d('0x13')]);}logger[_0xde5d('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x1597ca,_0x436b69['error']['message']);return _0x4c7d36(_0x436b69[_0xde5d('0x11')]['message']);}else{logger[_0xde5d('0xb')](_0xde5d('0xc'),_0x1597ca,_0xde5d('0xd'));_0x4c7d36(_0x436b69['result'][_0xde5d('0x13')]);}})[_0xde5d('0x14')](function(_0x21b511){logger[_0xde5d('0x11')](_0xde5d('0xc'),_0x1597ca,_0x21b511);_0x580426(_0x21b511);});});}exports[_0xde5d('0x15')]=function(_0x46eda2){var _0x4226d1=this;return new Promise(function(_0x2b90f6,_0x7a3657){return db['SquareOdbc']['find']({'raw':_0x46eda2[_0xde5d('0x16')]?_0x46eda2[_0xde5d('0x16')][_0xde5d('0x17')]===undefined?!![]:![]:!![],'where':_0x46eda2[_0xde5d('0x16')]?_0x46eda2[_0xde5d('0x16')]['where']||null:null,'attributes':_0x46eda2[_0xde5d('0x16')]?_0x46eda2['options']['attributes']||null:null,'include':_0x46eda2[_0xde5d('0x16')]?_0x46eda2[_0xde5d('0x16')][_0xde5d('0x18')]?_[_0xde5d('0x19')](_0x46eda2[_0xde5d('0x16')][_0xde5d('0x18')],function(_0x504db0){return{'model':db[_0x504db0['model']],'as':_0x504db0['as'],'attributes':_0x504db0[_0xde5d('0x1a')],'include':_0x504db0[_0xde5d('0x18')]?_[_0xde5d('0x19')](_0x504db0[_0xde5d('0x18')],function(_0x28f4bb){return{'model':db[_0x28f4bb[_0xde5d('0x1b')]],'as':_0x28f4bb['as'],'attributes':_0x28f4bb[_0xde5d('0x1a')],'include':_0x28f4bb['include']?_['map'](_0x28f4bb['include'],function(_0x58cd72){return{'model':db[_0x58cd72[_0xde5d('0x1b')]],'as':_0x58cd72['as'],'attributes':_0x58cd72[_0xde5d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xde5d('0xa')](function(_0xbdfe3f){logger['info'](_0xde5d('0x15'),_0x46eda2);logger[_0xde5d('0xe')](_0xde5d('0x15'),_0x46eda2,JSON[_0xde5d('0x10')](_0xbdfe3f));_0x2b90f6(_0xbdfe3f);})[_0xde5d('0x14')](function(_0x286932){logger[_0xde5d('0x11')](_0xde5d('0x15'),_0x286932['message'],_0x46eda2);_0x7a3657(_0x4226d1[_0xde5d('0x11')](0x1f4,_0x286932['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index ff64d38..684ad5a 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 _0x4e80=['./squareProject.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2ab688,_0x206b54){var _0x352100=function(_0x5a0e54){while(--_0x5a0e54){_0x2ab688['push'](_0x2ab688['shift']());}};_0x352100(++_0x206b54);}(_0x4e80,0x197));var _0x04e8=function(_0x39871f,_0x42cbeb){_0x39871f=_0x39871f-0x0;var _0x1c1fd0=_0x4e80[_0x39871f];return _0x1c1fd0;};'use strict';var multer=require(_0x04e8('0x0'));var util=require(_0x04e8('0x1'));var path=require(_0x04e8('0x2'));var timeout=require(_0x04e8('0x3'));var express=require('express');var router=express[_0x04e8('0x4')]();var fs_extra=require(_0x04e8('0x5'));var auth=require(_0x04e8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04e8('0x7'));router['get']('/',auth[_0x04e8('0x8')](),controller[_0x04e8('0x9')]);router[_0x04e8('0xa')](_0x04e8('0xb'),auth[_0x04e8('0x8')](),controller['show']);router[_0x04e8('0xc')]('/',auth[_0x04e8('0x8')](),controller[_0x04e8('0xd')]);router[_0x04e8('0xe')](_0x04e8('0xb'),auth[_0x04e8('0x8')](),controller[_0x04e8('0xf')]);router[_0x04e8('0x10')]('/:id',auth[_0x04e8('0x8')](),controller['destroy']);module[_0x04e8('0x11')]=router; \ No newline at end of file +var _0x4ef6=['index','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ef6,0x15e));var _0x64ef=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0x4ef6[_0x7cb10c];return _0x11df59;};'use strict';var multer=require(_0x64ef('0x0'));var util=require(_0x64ef('0x1'));var path=require('path');var timeout=require(_0x64ef('0x2'));var express=require(_0x64ef('0x3'));var router=express[_0x64ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x64ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x64ef('0x6'));var controller=require(_0x64ef('0x7'));router[_0x64ef('0x8')]('/',auth[_0x64ef('0x9')](),controller[_0x64ef('0xa')]);router[_0x64ef('0x8')](_0x64ef('0xb'),auth['isAuthenticated'](),controller[_0x64ef('0xc')]);router[_0x64ef('0xd')]('/',auth['isAuthenticated'](),controller[_0x64ef('0xe')]);router[_0x64ef('0xf')](_0x64ef('0xb'),auth['isAuthenticated'](),controller[_0x64ef('0x10')]);router['delete'](_0x64ef('0xb'),auth[_0x64ef('0x9')](),controller[_0x64ef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 93a544f..08e4967 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 _0xfa94=['STRING','TEXT','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x56b1e3,_0x280580){var _0x28f013=function(_0x1cebff){while(--_0x1cebff){_0x56b1e3['push'](_0x56b1e3['shift']());}};_0x28f013(++_0x280580);}(_0xfa94,0xef));var _0x4fa9=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xfa94[_0x3438cf];return _0x278698;};'use strict';var Sequelize=require(_0x4fa9('0x0'));module['exports']={'name':{'type':Sequelize[_0x4fa9('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4fa9('0x1')]},'notes':{'type':Sequelize[_0x4fa9('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x4fa9('0x3')),'get':function(){if(this[_0x4fa9('0x4')](_0x4fa9('0x5'))){return this[_0x4fa9('0x4')](_0x4fa9('0x5'))[_0x4fa9('0x6')](_0x4fa9('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0x4fa9('0x3')),'get':function(){if(this[_0x4fa9('0x4')]('production')){return this['getDataValue'](_0x4fa9('0x8'))['toString'](_0x4fa9('0x7'));}}},'savedAt':{'type':Sequelize[_0x4fa9('0x9')]},'publishedAt':{'type':Sequelize[_0x4fa9('0x9')]}}; \ No newline at end of file +var _0x86f1=['BLOB','getDataValue','preproduction','utf8','long','production','toString','DATE','exports','STRING','name','TEXT'];(function(_0x259fe3,_0x86d22){var _0x136f9c=function(_0x2396cc){while(--_0x2396cc){_0x259fe3['push'](_0x259fe3['shift']());}};_0x136f9c(++_0x86d22);}(_0x86f1,0xf8));var _0x186f=function(_0x138802,_0x3b3f09){_0x138802=_0x138802-0x0;var _0x427b3d=_0x86f1[_0x138802];return _0x427b3d;};'use strict';var Sequelize=require('sequelize');module[_0x186f('0x0')]={'name':{'type':Sequelize[_0x186f('0x1')],'unique':_0x186f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x186f('0x1')]},'notes':{'type':Sequelize[_0x186f('0x3')]},'preproduction':{'type':Sequelize[_0x186f('0x4')]('long'),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x186f('0x5')](_0x186f('0x6'))['toString'](_0x186f('0x7'));}}},'production':{'type':Sequelize[_0x186f('0x4')](_0x186f('0x8')),'get':function(){if(this[_0x186f('0x5')](_0x186f('0x9'))){return this['getDataValue'](_0x186f('0x9'))[_0x186f('0xa')]('utf8');}}},'savedAt':{'type':Sequelize[_0x186f('0xb')]},'publishedAt':{'type':Sequelize[_0x186f('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 6f6580c..a8927ac 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 _0x772f=['catch','includeAll','merge','find','create','body','user','get','SquareProjects','UserProfileSection','userProfileId','agi','production','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','publish','stringify','error','name','index','rawAttributes','fieldName','key','map','keys','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','SquareProject','include','findAll','rows'];(function(_0x2ac358,_0x22d508){var _0x3ea12d=function(_0x10e8fa){while(--_0x10e8fa){_0x2ac358['push'](_0x2ac358['shift']());}};_0x3ea12d(++_0x22d508);}(_0x772f,0x89));var _0xf772=function(_0x4211bb,_0x424082){_0x4211bb=_0x4211bb-0x0;var _0x36d8e8=_0x772f[_0x4211bb];return _0x36d8e8;};'use strict';var _=require('lodash');var Redis=require(_0xf772('0x0'));var qs=require(_0xf772('0x1'));var logger=require(_0xf772('0x2'))(_0xf772('0x3'));var config=require('../../config/environment');var db=require(_0xf772('0x4'))['db'];config[_0xf772('0x5')]=_[_0xf772('0x6')](config[_0xf772('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf772('0x5')]));require('./squareProject.socket')[_0xf772('0x7')](socket);function respondWithResult(_0x37b695,_0x24aa15){_0x24aa15=_0x24aa15||0xc8;return function(_0x402ae1){if(_0x402ae1){return _0x37b695[_0xf772('0x8')](_0x24aa15)[_0xf772('0x9')](_0x402ae1);}};}function respondWithFilteredResult(_0x2fc45f,_0x406795){return function(_0x1ccd33){if(_0x1ccd33){var _0x478454=typeof _0x406795[_0xf772('0xa')]===_0xf772('0xb')&&typeof _0x406795['limit']===_0xf772('0xb');var _0x2cc4a7=_0x1ccd33[_0xf772('0xc')];var _0x7db9c4=_0x478454?0x0:_0x406795[_0xf772('0xa')];var _0x3491c5=_0x478454?_0x1ccd33[_0xf772('0xc')]:_0x406795[_0xf772('0xa')]+_0x406795[_0xf772('0xd')];var _0x4609e5;if(_0x3491c5>=_0x2cc4a7){_0x3491c5=_0x2cc4a7;_0x4609e5=0xc8;}else{_0x4609e5=0xce;}_0x2fc45f[_0xf772('0x8')](_0x4609e5);return _0x2fc45f[_0xf772('0xe')](_0xf772('0xf'),_0x7db9c4+'-'+_0x3491c5+'/'+_0x2cc4a7)[_0xf772('0x9')](_0x1ccd33);}return null;};}function saveUpdates(_0x36925f){return function(_0x4b3f5d){if(_0x4b3f5d){return _0x4b3f5d[_0xf772('0x10')](_0x36925f)[_0xf772('0x11')](function(_0x275c81){return _0x275c81;});}return null;};}function removeEntity(_0x33ded8){return function(_0x3ec376){if(_0x3ec376){return _0x3ec376['destroy']()[_0xf772('0x11')](function(){var _0x2d5327=_0x3ec376['get']({'plain':!![]});var _0x462bae='SquareProjects';return db['UserProfileResource'][_0xf772('0x12')]({'where':{'type':_0x462bae,'resourceId':_0x2d5327['id']}})[_0xf772('0x11')](function(){return _0x3ec376;});})[_0xf772('0x11')](function(){var _0x445043=new Redis(config[_0xf772('0x5')]);_0x445043[_0xf772('0x13')]('agi',JSON[_0xf772('0x14')]({'id':_0x3ec376['id'],'deleted':!![]}));})['then'](function(){_0x33ded8[_0xf772('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc831){return function(_0x3b7906){if(!_0x3b7906){_0x2dc831['sendStatus'](0x194);}return _0x3b7906;};}function handleError(_0x462003,_0x3c5383){_0x3c5383=_0x3c5383||0x1f4;return function(_0x2a1497){logger[_0xf772('0x15')](_0x2a1497['stack']);if(_0x2a1497[_0xf772('0x16')]){delete _0x2a1497[_0xf772('0x16')];}_0x462003[_0xf772('0x8')](_0x3c5383)['send'](_0x2a1497);};}exports[_0xf772('0x17')]=function(_0xad8a29,_0x538434){var _0x1cfeb5={},_0x49489f={},_0x522699={'count':0x0,'rows':[]};var _0x403ca2=_['map'](db['SquareProject'][_0xf772('0x18')],function(_0x1a794e){return{'name':_0x1a794e[_0xf772('0x19')],'type':_0x1a794e['type'][_0xf772('0x1a')]};});_0x49489f['model']=_[_0xf772('0x1b')](_0x403ca2,_0xf772('0x16'));_0x49489f['query']=_[_0xf772('0x1c')](_0xad8a29[_0xf772('0x1d')]);_0x49489f[_0xf772('0x1e')]=_['intersection'](_0x49489f['model'],_0x49489f[_0xf772('0x1d')]);_0x1cfeb5[_0xf772('0x1f')]=_[_0xf772('0x20')](_0x49489f[_0xf772('0x21')],qs['fields'](_0xad8a29['query'][_0xf772('0x22')]));_0x1cfeb5[_0xf772('0x1f')]=_0x1cfeb5[_0xf772('0x1f')][_0xf772('0x23')]?_0x1cfeb5['attributes']:_0x49489f[_0xf772('0x21')];if(!_0xad8a29[_0xf772('0x1d')]['hasOwnProperty'](_0xf772('0x24'))){_0x1cfeb5[_0xf772('0xd')]=qs[_0xf772('0xd')](_0xad8a29[_0xf772('0x1d')]['limit']);_0x1cfeb5['offset']=qs[_0xf772('0xa')](_0xad8a29[_0xf772('0x1d')][_0xf772('0xa')]);}_0x1cfeb5[_0xf772('0x25')]=qs[_0xf772('0x26')](_0xad8a29['query']['sort']);_0x1cfeb5[_0xf772('0x27')]=qs[_0xf772('0x1e')](_[_0xf772('0x28')](_0xad8a29[_0xf772('0x1d')],_0x49489f[_0xf772('0x1e')]),_0x403ca2);if(_0xad8a29['query'][_0xf772('0x29')]){_0x1cfeb5[_0xf772('0x27')]=_['merge'](_0x1cfeb5[_0xf772('0x27')],{'$or':_['map'](_0x403ca2,function(_0x342c0d){if(_0x342c0d[_0xf772('0x2a')]!==_0xf772('0x2b')){var _0x126616={};_0x126616[_0x342c0d[_0xf772('0x16')]]={'$like':'%'+_0xad8a29[_0xf772('0x1d')][_0xf772('0x29')]+'%'};return _0x126616;}})});}_0x1cfeb5=_['merge']({},_0x1cfeb5,_0xad8a29[_0xf772('0x2c')]);var _0x15c40c={'where':_0x1cfeb5[_0xf772('0x27')]};return db[_0xf772('0x2d')][_0xf772('0xc')](_0x15c40c)['then'](function(_0x3cdc76){_0x522699['count']=_0x3cdc76;if(_0xad8a29[_0xf772('0x1d')]['includeAll']){_0x1cfeb5[_0xf772('0x2e')]=[{'all':!![]}];}return db[_0xf772('0x2d')][_0xf772('0x2f')](_0x1cfeb5);})[_0xf772('0x11')](function(_0x34fa7a){_0x522699[_0xf772('0x30')]=_0x34fa7a;return _0x522699;})[_0xf772('0x11')](respondWithFilteredResult(_0x538434,_0x1cfeb5))[_0xf772('0x31')](handleError(_0x538434,null));};exports['show']=function(_0x30d783,_0x400c84){var _0x5b8af9={'raw':![],'where':{'id':_0x30d783['params']['id']}},_0x4367d8={};_0x4367d8[_0xf772('0x21')]=_['keys'](db['SquareProject'][_0xf772('0x18')]);_0x4367d8[_0xf772('0x1d')]=_[_0xf772('0x1c')](_0x30d783['query']);_0x4367d8[_0xf772('0x1e')]=_[_0xf772('0x20')](_0x4367d8[_0xf772('0x21')],_0x4367d8['query']);_0x5b8af9[_0xf772('0x1f')]=_[_0xf772('0x20')](_0x4367d8[_0xf772('0x21')],qs[_0xf772('0x22')](_0x30d783[_0xf772('0x1d')][_0xf772('0x22')]));_0x5b8af9[_0xf772('0x1f')]=_0x5b8af9[_0xf772('0x1f')][_0xf772('0x23')]?_0x5b8af9[_0xf772('0x1f')]:_0x4367d8[_0xf772('0x21')];if(_0x30d783[_0xf772('0x1d')][_0xf772('0x32')]){_0x5b8af9[_0xf772('0x2e')]=[{'all':!![]}];}_0x5b8af9=_[_0xf772('0x33')]({},_0x5b8af9,_0x30d783[_0xf772('0x2c')]);return db[_0xf772('0x2d')][_0xf772('0x34')](_0x5b8af9)['then'](handleEntityNotFound(_0x400c84,null))[_0xf772('0x11')](respondWithResult(_0x400c84,null))['catch'](handleError(_0x400c84,null));};exports[_0xf772('0x35')]=function(_0x4fe35e,_0x4d63a1){return db[_0xf772('0x2d')][_0xf772('0x35')](_0x4fe35e[_0xf772('0x36')],{})[_0xf772('0x11')](function(_0x4b64c7){var _0x5ce9e8=_0x4fe35e[_0xf772('0x37')][_0xf772('0x38')]({'plain':!![]});if(!_0x5ce9e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ce9e8['role']===_0xf772('0x37')){var _0x44f430=_0x4b64c7[_0xf772('0x38')]({'plain':!![]});var _0x590331=_0xf772('0x39');return db[_0xf772('0x3a')][_0xf772('0x34')]({'where':{'name':_0x590331,'userProfileId':_0x5ce9e8[_0xf772('0x3b')]},'raw':!![]})['then'](function(_0x2e9a46){if(_0x2e9a46&&_0x2e9a46['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x44f430[_0xf772('0x16')],'resourceId':_0x44f430['id'],'type':_0x2e9a46['name'],'sectionId':_0x2e9a46['id']},{})[_0xf772('0x11')](function(){return _0x4b64c7;});}else{return _0x4b64c7;}})[_0xf772('0x31')](function(_0x21d91e){logger[_0xf772('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21d91e);throw _0x21d91e;});}return _0x4b64c7;})[_0xf772('0x11')](respondWithResult(_0x4d63a1,0xc9))[_0xf772('0x31')](handleError(_0x4d63a1,null));};exports[_0xf772('0x10')]=function(_0x128d6c,_0x1c3556){if(_0x128d6c['body']['id']){delete _0x128d6c['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x128d6c['params']['id']}})[_0xf772('0x11')](handleEntityNotFound(_0x1c3556,null))[_0xf772('0x11')](saveUpdates(_0x128d6c[_0xf772('0x36')],null))['then'](function(_0x2aa81c){if(!_0x2aa81c)return;var _0x57d72f=_0x2aa81c[_0xf772('0x38')]({'plain':!![]});return _0x57d72f;})['then'](function(_0x59d225){var _0x588bb7=new Redis(config[_0xf772('0x5')]);_0x588bb7['publish'](_0xf772('0x3c'),JSON['stringify'](_[_0xf772('0x28')](_0x59d225,['id',_0xf772('0x16'),_0xf772('0x3d')])));return _0x59d225;})[_0xf772('0x11')](respondWithResult(_0x1c3556,null))[_0xf772('0x31')](handleError(_0x1c3556,null));};exports['destroy']=function(_0x2d7c98,_0x414281){return db['SquareProject'][_0xf772('0x34')]({'where':{'id':_0x2d7c98['params']['id']}})[_0xf772('0x11')](handleEntityNotFound(_0x414281,null))[_0xf772('0x11')](removeEntity(_0x414281,null))[_0xf772('0x31')](handleError(_0x414281,null));}; \ No newline at end of file +var _0xac8f=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','destroy','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user'];(function(_0x1bc738,_0x475ef3){var _0x167413=function(_0x199e17){while(--_0x199e17){_0x1bc738['push'](_0x1bc738['shift']());}};_0x167413(++_0x475ef3);}(_0xac8f,0x1f1));var _0xfac8=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xac8f[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0xfac8('0x0'));var Redis=require('ioredis');var qs=require(_0xfac8('0x1'));var logger=require(_0xfac8('0x2'))(_0xfac8('0x3'));var config=require(_0xfac8('0x4'));var db=require(_0xfac8('0x5'))['db'];config[_0xfac8('0x6')]=_[_0xfac8('0x7')](config[_0xfac8('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfac8('0x6')]));require(_0xfac8('0x8'))['register'](socket);function respondWithResult(_0x21c035,_0x34c2e7){_0x34c2e7=_0x34c2e7||0xc8;return function(_0x228383){if(_0x228383){return _0x21c035[_0xfac8('0x9')](_0x34c2e7)[_0xfac8('0xa')](_0x228383);}};}function respondWithFilteredResult(_0x3e3059,_0x160efc){return function(_0x3beebe){if(_0x3beebe){var _0x5a0c15=typeof _0x160efc[_0xfac8('0xb')]===_0xfac8('0xc')&&typeof _0x160efc[_0xfac8('0xd')]===_0xfac8('0xc');var _0x313614=_0x3beebe[_0xfac8('0xe')];var _0x6b38f9=_0x5a0c15?0x0:_0x160efc[_0xfac8('0xb')];var _0x2c2fab=_0x5a0c15?_0x3beebe[_0xfac8('0xe')]:_0x160efc[_0xfac8('0xb')]+_0x160efc[_0xfac8('0xd')];var _0x5aa8ee;if(_0x2c2fab>=_0x313614){_0x2c2fab=_0x313614;_0x5aa8ee=0xc8;}else{_0x5aa8ee=0xce;}_0x3e3059['status'](_0x5aa8ee);return _0x3e3059[_0xfac8('0xf')](_0xfac8('0x10'),_0x6b38f9+'-'+_0x2c2fab+'/'+_0x313614)[_0xfac8('0xa')](_0x3beebe);}return null;};}function saveUpdates(_0x1a00c6){return function(_0xf61626){if(_0xf61626){return _0xf61626[_0xfac8('0x11')](_0x1a00c6)[_0xfac8('0x12')](function(_0x435a6e){return _0x435a6e;});}return null;};}function removeEntity(_0x4f8a7f){return function(_0x2d808d){if(_0x2d808d){return _0x2d808d['destroy']()[_0xfac8('0x12')](function(){var _0x67684e=_0x2d808d[_0xfac8('0x13')]({'plain':!![]});var _0x321b44=_0xfac8('0x14');return db['UserProfileResource']['destroy']({'where':{'type':_0x321b44,'resourceId':_0x67684e['id']}})[_0xfac8('0x12')](function(){return _0x2d808d;});})[_0xfac8('0x12')](function(){var _0x6ceb96=new Redis(config['redis']);_0x6ceb96[_0xfac8('0x15')](_0xfac8('0x16'),JSON[_0xfac8('0x17')]({'id':_0x2d808d['id'],'deleted':!![]}));})[_0xfac8('0x12')](function(){_0x4f8a7f[_0xfac8('0x9')](0xcc)[_0xfac8('0x18')]();});}};}function handleEntityNotFound(_0x579e34){return function(_0x3326c4){if(!_0x3326c4){_0x579e34[_0xfac8('0x19')](0x194);}return _0x3326c4;};}function handleError(_0x3e79a0,_0x13d76c){_0x13d76c=_0x13d76c||0x1f4;return function(_0x29bc30){logger[_0xfac8('0x1a')](_0x29bc30[_0xfac8('0x1b')]);if(_0x29bc30['name']){delete _0x29bc30[_0xfac8('0x1c')];}_0x3e79a0[_0xfac8('0x9')](_0x13d76c)[_0xfac8('0x1d')](_0x29bc30);};}exports[_0xfac8('0x1e')]=function(_0x509e64,_0x45ff6c){var _0x137064={},_0x325873={},_0x2b681f={'count':0x0,'rows':[]};var _0x357fcf=_[_0xfac8('0x1f')](db[_0xfac8('0x20')][_0xfac8('0x21')],function(_0x596f98){return{'name':_0x596f98[_0xfac8('0x22')],'type':_0x596f98[_0xfac8('0x23')][_0xfac8('0x24')]};});_0x325873[_0xfac8('0x25')]=_[_0xfac8('0x1f')](_0x357fcf,'name');_0x325873[_0xfac8('0x26')]=_[_0xfac8('0x27')](_0x509e64[_0xfac8('0x26')]);_0x325873[_0xfac8('0x28')]=_[_0xfac8('0x29')](_0x325873['model'],_0x325873[_0xfac8('0x26')]);_0x137064[_0xfac8('0x2a')]=_[_0xfac8('0x29')](_0x325873[_0xfac8('0x25')],qs[_0xfac8('0x2b')](_0x509e64['query'][_0xfac8('0x2b')]));_0x137064[_0xfac8('0x2a')]=_0x137064[_0xfac8('0x2a')][_0xfac8('0x2c')]?_0x137064[_0xfac8('0x2a')]:_0x325873[_0xfac8('0x25')];if(!_0x509e64[_0xfac8('0x26')][_0xfac8('0x2d')]('nolimit')){_0x137064['limit']=qs[_0xfac8('0xd')](_0x509e64['query'][_0xfac8('0xd')]);_0x137064[_0xfac8('0xb')]=qs[_0xfac8('0xb')](_0x509e64[_0xfac8('0x26')]['offset']);}_0x137064[_0xfac8('0x2e')]=qs['sort'](_0x509e64['query']['sort']);_0x137064[_0xfac8('0x2f')]=qs['filters'](_[_0xfac8('0x30')](_0x509e64[_0xfac8('0x26')],_0x325873[_0xfac8('0x28')]),_0x357fcf);if(_0x509e64['query'][_0xfac8('0x31')]){_0x137064[_0xfac8('0x2f')]=_[_0xfac8('0x32')](_0x137064[_0xfac8('0x2f')],{'$or':_['map'](_0x357fcf,function(_0x59aff8){if(_0x59aff8[_0xfac8('0x23')]!==_0xfac8('0x33')){var _0xe68af6={};_0xe68af6[_0x59aff8[_0xfac8('0x1c')]]={'$like':'%'+_0x509e64[_0xfac8('0x26')]['filter']+'%'};return _0xe68af6;}})});}_0x137064=_[_0xfac8('0x32')]({},_0x137064,_0x509e64[_0xfac8('0x34')]);var _0x29a968={'where':_0x137064[_0xfac8('0x2f')]};return db[_0xfac8('0x20')]['count'](_0x29a968)['then'](function(_0x1f4057){_0x2b681f[_0xfac8('0xe')]=_0x1f4057;if(_0x509e64[_0xfac8('0x26')][_0xfac8('0x35')]){_0x137064[_0xfac8('0x36')]=[{'all':!![]}];}return db[_0xfac8('0x20')][_0xfac8('0x37')](_0x137064);})[_0xfac8('0x12')](function(_0x1d8ec3){_0x2b681f[_0xfac8('0x38')]=_0x1d8ec3;return _0x2b681f;})[_0xfac8('0x12')](respondWithFilteredResult(_0x45ff6c,_0x137064))[_0xfac8('0x39')](handleError(_0x45ff6c,null));};exports[_0xfac8('0x3a')]=function(_0x31db4c,_0x172142){var _0x5aa499={'raw':![],'where':{'id':_0x31db4c[_0xfac8('0x3b')]['id']}},_0x45ecaf={};_0x45ecaf[_0xfac8('0x25')]=_['keys'](db[_0xfac8('0x20')]['rawAttributes']);_0x45ecaf['query']=_[_0xfac8('0x27')](_0x31db4c[_0xfac8('0x26')]);_0x45ecaf[_0xfac8('0x28')]=_['intersection'](_0x45ecaf[_0xfac8('0x25')],_0x45ecaf[_0xfac8('0x26')]);_0x5aa499['attributes']=_[_0xfac8('0x29')](_0x45ecaf[_0xfac8('0x25')],qs[_0xfac8('0x2b')](_0x31db4c[_0xfac8('0x26')]['fields']));_0x5aa499[_0xfac8('0x2a')]=_0x5aa499[_0xfac8('0x2a')]['length']?_0x5aa499[_0xfac8('0x2a')]:_0x45ecaf['model'];if(_0x31db4c[_0xfac8('0x26')][_0xfac8('0x35')]){_0x5aa499[_0xfac8('0x36')]=[{'all':!![]}];}_0x5aa499=_[_0xfac8('0x32')]({},_0x5aa499,_0x31db4c['options']);return db['SquareProject']['find'](_0x5aa499)['then'](handleEntityNotFound(_0x172142,null))['then'](respondWithResult(_0x172142,null))[_0xfac8('0x39')](handleError(_0x172142,null));};exports[_0xfac8('0x3c')]=function(_0x4823c6,_0x5e17cf){return db[_0xfac8('0x20')][_0xfac8('0x3c')](_0x4823c6[_0xfac8('0x3d')],{})[_0xfac8('0x12')](function(_0x51e5ac){var _0x48e621=_0x4823c6[_0xfac8('0x3e')]['get']({'plain':!![]});if(!_0x48e621)throw new Error(_0xfac8('0x3f'));if(_0x48e621[_0xfac8('0x40')]===_0xfac8('0x3e')){var _0x247937=_0x51e5ac[_0xfac8('0x13')]({'plain':!![]});var _0x7c174d=_0xfac8('0x14');return db['UserProfileSection'][_0xfac8('0x41')]({'where':{'name':_0x7c174d,'userProfileId':_0x48e621['userProfileId']},'raw':!![]})[_0xfac8('0x12')](function(_0x32a018){if(_0x32a018&&_0x32a018['autoAssociation']===0x0){return db[_0xfac8('0x42')][_0xfac8('0x3c')]({'name':_0x247937[_0xfac8('0x1c')],'resourceId':_0x247937['id'],'type':_0x32a018[_0xfac8('0x1c')],'sectionId':_0x32a018['id']},{})[_0xfac8('0x12')](function(){return _0x51e5ac;});}else{return _0x51e5ac;}})[_0xfac8('0x39')](function(_0x325b59){logger[_0xfac8('0x1a')](_0xfac8('0x43'),_0x325b59);throw _0x325b59;});}return _0x51e5ac;})[_0xfac8('0x12')](respondWithResult(_0x5e17cf,0xc9))[_0xfac8('0x39')](handleError(_0x5e17cf,null));};exports['update']=function(_0x365077,_0x6e5c0f){if(_0x365077[_0xfac8('0x3d')]['id']){delete _0x365077[_0xfac8('0x3d')]['id'];}return db[_0xfac8('0x20')]['find']({'where':{'id':_0x365077[_0xfac8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x6e5c0f,null))[_0xfac8('0x12')](saveUpdates(_0x365077['body'],null))[_0xfac8('0x12')](function(_0x56ff54){if(!_0x56ff54)return;var _0x1bdcf1=_0x56ff54[_0xfac8('0x13')]({'plain':!![]});return _0x1bdcf1;})[_0xfac8('0x12')](function(_0x2efd43){var _0xad8e29=new Redis(config[_0xfac8('0x6')]);_0xad8e29[_0xfac8('0x15')](_0xfac8('0x16'),JSON[_0xfac8('0x17')](_[_0xfac8('0x30')](_0x2efd43,['id','name',_0xfac8('0x44')])));return _0x2efd43;})[_0xfac8('0x12')](respondWithResult(_0x6e5c0f,null))[_0xfac8('0x39')](handleError(_0x6e5c0f,null));};exports[_0xfac8('0x45')]=function(_0x29096e,_0x5a5b3d){return db[_0xfac8('0x20')][_0xfac8('0x41')]({'where':{'id':_0x29096e['params']['id']}})[_0xfac8('0x12')](handleEntityNotFound(_0x5a5b3d,null))[_0xfac8('0x12')](removeEntity(_0x5a5b3d,null))[_0xfac8('0x39')](handleError(_0x5a5b3d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index ce1e7ed..8f41968 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 _0xb175=['events','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xb175,0x120));var _0x5b17=function(_0x5cd41f,_0x1c7802){_0x5cd41f=_0x5cd41f-0x0;var _0x3d398f=_0xb175[_0x5cd41f];return _0x3d398f;};'use strict';var EventEmitter=require(_0x5b17('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x5b17('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5b17('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5b17('0x3')};function emitEvent(_0x7ed174){return function(_0x5502ae,_0x105008,_0x163ee4){SquareProjectEvents[_0x5b17('0x4')](_0x7ed174+':'+_0x5502ae['id'],_0x5502ae);SquareProjectEvents[_0x5b17('0x4')](_0x7ed174,_0x5502ae);_0x163ee4(null);};}for(var e in events){if(events[_0x5b17('0x5')](e)){var event=events[e];SquareProject[_0x5b17('0x6')](e,emitEvent(event));}}module[_0x5b17('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xce61=['remove','emit','hasOwnProperty','exports','../../mysqldb','SquareProject'];(function(_0x1bc694,_0x25c068){var _0x3525c3=function(_0x259a02){while(--_0x259a02){_0x1bc694['push'](_0x1bc694['shift']());}};_0x3525c3(++_0x25c068);}(_0xce61,0x148));var _0x1ce6=function(_0x86904f,_0x2d28b5){_0x86904f=_0x86904f-0x0;var _0x3ccf00=_0xce61[_0x86904f];return _0x3ccf00;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x1ce6('0x0'))['db'][_0x1ce6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1ce6('0x2')};function emitEvent(_0x418475){return function(_0x15f003,_0x34d53c,_0x2b72f9){SquareProjectEvents[_0x1ce6('0x3')](_0x418475+':'+_0x15f003['id'],_0x15f003);SquareProjectEvents[_0x1ce6('0x3')](_0x418475,_0x15f003);_0x2b72f9(null);};}for(var e in events){if(events[_0x1ce6('0x4')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x1ce6('0x5')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 42afa14..791fc70 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 _0x7316=['../../config/logger','api','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x261d9e,_0x4f0942){var _0x3f8a2c=function(_0x28aaf8){while(--_0x28aaf8){_0x261d9e['push'](_0x261d9e['shift']());}};_0x3f8a2c(++_0x4f0942);}(_0x7316,0xde));var _0x6731=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0x7316[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var logger=require(_0x6731('0x2'))(_0x6731('0x3'));var moment=require('moment');var BPromise=require(_0x6731('0x4'));var rp=require(_0x6731('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6731('0x6'));var attributes=require(_0x6731('0x7'));module[_0x6731('0x8')]=function(_0x5e2c0e,_0x6a4012){return _0x5e2c0e[_0x6731('0x9')]('SquareProject',attributes,{'tableName':_0x6731('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38816d,_0x49ec64,_0x305d50){if(_0x38816d[_0x6731('0xb')](_0x6731('0xc'))){_0x38816d[_0x6731('0xd')]=moment()[_0x6731('0xe')](_0x6731('0xf'));}if(_0x38816d[_0x6731('0xb')]('production')){_0x38816d['publishedAt']=moment()['format'](_0x6731('0xf'));}_0x305d50(null,_0x38816d);}}});}; \ No newline at end of file +var _0xe87b=['square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x35d1b4,_0x717559){var _0x273c5b=function(_0x4a7748){while(--_0x4a7748){_0x35d1b4['push'](_0x35d1b4['shift']());}};_0x273c5b(++_0x717559);}(_0xe87b,0x73));var _0xbe87=function(_0x471c6e,_0x17e77e){_0x471c6e=_0x471c6e-0x0;var _0x117bb9=_0xe87b[_0x471c6e];return _0x117bb9;};'use strict';var _=require(_0xbe87('0x0'));var util=require('util');var logger=require(_0xbe87('0x1'))(_0xbe87('0x2'));var moment=require(_0xbe87('0x3'));var BPromise=require(_0xbe87('0x4'));var rp=require(_0xbe87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe87('0x6'));var attributes=require(_0xbe87('0x7'));module[_0xbe87('0x8')]=function(_0x4a3a5d,_0x231f8c){return _0x4a3a5d[_0xbe87('0x9')](_0xbe87('0xa'),attributes,{'tableName':_0xbe87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf7bf76,_0x43ccd2,_0xb2bcc1){if(_0xf7bf76[_0xbe87('0xc')]('preproduction')){_0xf7bf76[_0xbe87('0xd')]=moment()[_0xbe87('0xe')](_0xbe87('0xf'));}if(_0xf7bf76[_0xbe87('0xc')](_0xbe87('0x10'))){_0xf7bf76[_0xbe87('0x11')]=moment()[_0xbe87('0xe')](_0xbe87('0xf'));}_0xb2bcc1(null,_0xf7bf76);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 86ebe53..e05f497 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 _0xfd94=['options','where','attributes','limit','include','model','map','then','info','GetSquareProjects','debug','catch','error','message','ShowSquareProject','find','stringify','lodash','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','SquareProject','findAll','raw'];(function(_0x4dfaa8,_0x1dd853){var _0x3e330a=function(_0x12b78d){while(--_0x12b78d){_0x4dfaa8['push'](_0x4dfaa8['shift']());}};_0x3e330a(++_0x1dd853);}(_0xfd94,0x133));var _0x4fd9=function(_0x2e0748,_0x55284){_0x2e0748=_0x2e0748-0x0;var _0x15d429=_0xfd94[_0x2e0748];return _0x15d429;};'use strict';var _=require(_0x4fd9('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x4fd9('0x1'))(_0x4fd9('0x2'));var config=require(_0x4fd9('0x3'));config['redis']=_[_0x4fd9('0x4')](config[_0x4fd9('0x5')],{'host':_0x4fd9('0x6'),'port':0x18eb});var socket=require(_0x4fd9('0x7'))(new Redis(config['redis']));require('./squareProject.socket')[_0x4fd9('0x8')](socket);exports['GetSquareProjects']=function(_0x2a4d8d){var _0x3eb3d9=this;return new Promise(function(_0x59e22f,_0x28d97e){return db[_0x4fd9('0x9')][_0x4fd9('0xa')]({'raw':_0x2a4d8d['options']?_0x2a4d8d['options'][_0x4fd9('0xb')]===undefined?!![]:![]:!![],'where':_0x2a4d8d[_0x4fd9('0xc')]?_0x2a4d8d['options'][_0x4fd9('0xd')]||null:null,'attributes':_0x2a4d8d['options']?_0x2a4d8d[_0x4fd9('0xc')][_0x4fd9('0xe')]||null:null,'limit':_0x2a4d8d[_0x4fd9('0xc')]?_0x2a4d8d[_0x4fd9('0xc')][_0x4fd9('0xf')]||null:null,'include':_0x2a4d8d[_0x4fd9('0xc')]?_0x2a4d8d[_0x4fd9('0xc')][_0x4fd9('0x10')]?_['map'](_0x2a4d8d['options'][_0x4fd9('0x10')],function(_0x3081c8){return{'model':db[_0x3081c8[_0x4fd9('0x11')]],'as':_0x3081c8['as'],'attributes':_0x3081c8[_0x4fd9('0xe')],'include':_0x3081c8['include']?_[_0x4fd9('0x12')](_0x3081c8[_0x4fd9('0x10')],function(_0x17cc79){return{'model':db[_0x17cc79[_0x4fd9('0x11')]],'as':_0x17cc79['as'],'attributes':_0x17cc79[_0x4fd9('0xe')],'include':_0x17cc79[_0x4fd9('0x10')]?_['map'](_0x17cc79[_0x4fd9('0x10')],function(_0x12131e){return{'model':db[_0x12131e[_0x4fd9('0x11')]],'as':_0x12131e['as'],'attributes':_0x12131e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fd9('0x13')](function(_0x363348){logger[_0x4fd9('0x14')](_0x4fd9('0x15'),_0x2a4d8d);logger[_0x4fd9('0x16')](_0x4fd9('0x15'),_0x2a4d8d,JSON['stringify'](_0x363348));_0x59e22f(_0x363348);})[_0x4fd9('0x17')](function(_0x519150){logger[_0x4fd9('0x18')](_0x4fd9('0x15'),_0x519150[_0x4fd9('0x19')],_0x2a4d8d);_0x28d97e(_0x3eb3d9[_0x4fd9('0x18')](0x1f4,_0x519150[_0x4fd9('0x19')]));});});};exports[_0x4fd9('0x1a')]=function(_0x50401c){var _0x4b6cdc=this;return new Promise(function(_0x430dcd,_0x232feb){return db[_0x4fd9('0x9')][_0x4fd9('0x1b')]({'raw':_0x50401c[_0x4fd9('0xc')]?_0x50401c['options'][_0x4fd9('0xb')]===undefined?!![]:![]:!![],'where':_0x50401c[_0x4fd9('0xc')]?_0x50401c[_0x4fd9('0xc')]['where']||null:null,'attributes':_0x50401c['options']?_0x50401c[_0x4fd9('0xc')][_0x4fd9('0xe')]||null:null,'include':_0x50401c[_0x4fd9('0xc')]?_0x50401c[_0x4fd9('0xc')][_0x4fd9('0x10')]?_['map'](_0x50401c[_0x4fd9('0xc')]['include'],function(_0xfe0a06){return{'model':db[_0xfe0a06[_0x4fd9('0x11')]],'as':_0xfe0a06['as'],'attributes':_0xfe0a06[_0x4fd9('0xe')],'include':_0xfe0a06['include']?_['map'](_0xfe0a06[_0x4fd9('0x10')],function(_0x7b0b67){return{'model':db[_0x7b0b67[_0x4fd9('0x11')]],'as':_0x7b0b67['as'],'attributes':_0x7b0b67[_0x4fd9('0xe')],'include':_0x7b0b67[_0x4fd9('0x10')]?_[_0x4fd9('0x12')](_0x7b0b67[_0x4fd9('0x10')],function(_0x458d67){return{'model':db[_0x458d67[_0x4fd9('0x11')]],'as':_0x458d67['as'],'attributes':_0x458d67[_0x4fd9('0xe')]};}):[]};}):[]};}):[]:[]})[_0x4fd9('0x13')](function(_0x3d7222){logger[_0x4fd9('0x14')]('ShowSquareProject',_0x50401c);logger[_0x4fd9('0x16')]('ShowSquareProject',_0x50401c,JSON[_0x4fd9('0x1c')](_0x3d7222));_0x430dcd(_0x3d7222);})[_0x4fd9('0x17')](function(_0x42e54e){logger[_0x4fd9('0x18')]('ShowSquareProject',_0x42e54e['message'],_0x50401c);_0x232feb(_0x4b6cdc['error'](0x1f4,_0x42e54e[_0x4fd9('0x19')]));});});}; \ No newline at end of file +var _0x0b91=['SquareProject','findAll','options','raw','limit','include','map','model','attributes','then','info','debug','catch','error','message','ShowSquareProject','find','where','stringify','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','GetSquareProjects'];(function(_0x5e7991,_0x58639b){var _0x41cb40=function(_0x164f53){while(--_0x164f53){_0x5e7991['push'](_0x5e7991['shift']());}};_0x41cb40(++_0x58639b);}(_0x0b91,0x1a9));var _0x10b9=function(_0x493a45,_0x5ebb5d){_0x493a45=_0x493a45-0x0;var _0x5d0ae2=_0x0b91[_0x493a45];return _0x5d0ae2;};'use strict';var _=require('lodash');var Redis=require(_0x10b9('0x0'));var db=require(_0x10b9('0x1'))['db'];var logger=require('../../config/logger')(_0x10b9('0x2'));var config=require(_0x10b9('0x3'));config[_0x10b9('0x4')]=_[_0x10b9('0x5')](config[_0x10b9('0x4')],{'host':_0x10b9('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10b9('0x4')]));require(_0x10b9('0x7'))[_0x10b9('0x8')](socket);exports[_0x10b9('0x9')]=function(_0x1191f5){var _0x3ed6f3=this;return new Promise(function(_0x89c113,_0x543bbc){return db[_0x10b9('0xa')][_0x10b9('0xb')]({'raw':_0x1191f5[_0x10b9('0xc')]?_0x1191f5['options'][_0x10b9('0xd')]===undefined?!![]:![]:!![],'where':_0x1191f5['options']?_0x1191f5[_0x10b9('0xc')]['where']||null:null,'attributes':_0x1191f5[_0x10b9('0xc')]?_0x1191f5['options']['attributes']||null:null,'limit':_0x1191f5[_0x10b9('0xc')]?_0x1191f5[_0x10b9('0xc')][_0x10b9('0xe')]||null:null,'include':_0x1191f5[_0x10b9('0xc')]?_0x1191f5[_0x10b9('0xc')][_0x10b9('0xf')]?_[_0x10b9('0x10')](_0x1191f5['options'][_0x10b9('0xf')],function(_0x5dcf22){return{'model':db[_0x5dcf22[_0x10b9('0x11')]],'as':_0x5dcf22['as'],'attributes':_0x5dcf22['attributes'],'include':_0x5dcf22[_0x10b9('0xf')]?_[_0x10b9('0x10')](_0x5dcf22[_0x10b9('0xf')],function(_0x33f298){return{'model':db[_0x33f298[_0x10b9('0x11')]],'as':_0x33f298['as'],'attributes':_0x33f298[_0x10b9('0x12')],'include':_0x33f298[_0x10b9('0xf')]?_[_0x10b9('0x10')](_0x33f298[_0x10b9('0xf')],function(_0x3144b9){return{'model':db[_0x3144b9[_0x10b9('0x11')]],'as':_0x3144b9['as'],'attributes':_0x3144b9[_0x10b9('0x12')]};}):[]};}):[]};}):[]:[]})[_0x10b9('0x13')](function(_0x47201c){logger[_0x10b9('0x14')](_0x10b9('0x9'),_0x1191f5);logger[_0x10b9('0x15')](_0x10b9('0x9'),_0x1191f5,JSON['stringify'](_0x47201c));_0x89c113(_0x47201c);})[_0x10b9('0x16')](function(_0x197cf7){logger[_0x10b9('0x17')](_0x10b9('0x9'),_0x197cf7['message'],_0x1191f5);_0x543bbc(_0x3ed6f3['error'](0x1f4,_0x197cf7[_0x10b9('0x18')]));});});};exports[_0x10b9('0x19')]=function(_0x8d9e50){var _0x358803=this;return new Promise(function(_0x568524,_0x32f99e){return db[_0x10b9('0xa')][_0x10b9('0x1a')]({'raw':_0x8d9e50[_0x10b9('0xc')]?_0x8d9e50[_0x10b9('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x8d9e50[_0x10b9('0xc')]?_0x8d9e50[_0x10b9('0xc')][_0x10b9('0x1b')]||null:null,'attributes':_0x8d9e50['options']?_0x8d9e50[_0x10b9('0xc')][_0x10b9('0x12')]||null:null,'include':_0x8d9e50[_0x10b9('0xc')]?_0x8d9e50[_0x10b9('0xc')][_0x10b9('0xf')]?_[_0x10b9('0x10')](_0x8d9e50['options'][_0x10b9('0xf')],function(_0x587667){return{'model':db[_0x587667[_0x10b9('0x11')]],'as':_0x587667['as'],'attributes':_0x587667['attributes'],'include':_0x587667[_0x10b9('0xf')]?_['map'](_0x587667[_0x10b9('0xf')],function(_0x1f4673){return{'model':db[_0x1f4673[_0x10b9('0x11')]],'as':_0x1f4673['as'],'attributes':_0x1f4673[_0x10b9('0x12')],'include':_0x1f4673[_0x10b9('0xf')]?_[_0x10b9('0x10')](_0x1f4673[_0x10b9('0xf')],function(_0x54f2ed){return{'model':db[_0x54f2ed[_0x10b9('0x11')]],'as':_0x54f2ed['as'],'attributes':_0x54f2ed[_0x10b9('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7f05d7){logger[_0x10b9('0x14')]('ShowSquareProject',_0x8d9e50);logger[_0x10b9('0x15')](_0x10b9('0x19'),_0x8d9e50,JSON[_0x10b9('0x1c')](_0x7f05d7));_0x568524(_0x7f05d7);})[_0x10b9('0x16')](function(_0x3f6e57){logger['error'](_0x10b9('0x19'),_0x3f6e57[_0x10b9('0x18')],_0x8d9e50);_0x32f99e(_0x358803[_0x10b9('0x17')](0x1f4,_0x3f6e57[_0x10b9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index eb58206..c05cdb7 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 _0x9f47=['removeListener','register','squareProject:','remove','update'];(function(_0x5209a1,_0x26c544){var _0x3ec812=function(_0x859a59){while(--_0x859a59){_0x5209a1['push'](_0x5209a1['shift']());}};_0x3ec812(++_0x26c544);}(_0x9f47,0x184));var _0x79f4=function(_0x15af16,_0x487a1a){_0x15af16=_0x15af16-0x0;var _0x1eafd1=_0x9f47[_0x15af16];return _0x1eafd1;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x79f4('0x0'),_0x79f4('0x1')];function createListener(_0x1857d9,_0x2d22ab){return function(_0xbc4dc4){_0x2d22ab['emit'](_0x1857d9,_0xbc4dc4);};}function removeListener(_0x4c3f79,_0x572906){return function(){SquareProjectEvents[_0x79f4('0x2')](_0x4c3f79,_0x572906);};}exports[_0x79f4('0x3')]=function(_0x19b60e){for(var _0x8e88d8=0x0,_0x348b7a=events['length'];_0x8e88d8<_0x348b7a;_0x8e88d8++){var _0xde5bf0=events[_0x8e88d8];var _0x13fb75=createListener(_0x79f4('0x4')+_0xde5bf0,_0x19b60e);SquareProjectEvents['on'](_0xde5bf0,_0x13fb75);}}; \ No newline at end of file +var _0x6fd9=['register','length','squareProject:','./squareProject.events','remove','emit','removeListener'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x6fd9,0x6c));var _0x96fd=function(_0x4a248b,_0x29e290){_0x4a248b=_0x4a248b-0x0;var _0x565f8c=_0x6fd9[_0x4a248b];return _0x565f8c;};'use strict';var SquareProjectEvents=require(_0x96fd('0x0'));var events=['save',_0x96fd('0x1'),'update'];function createListener(_0x49bb57,_0x2c0d7e){return function(_0x3a325d){_0x2c0d7e[_0x96fd('0x2')](_0x49bb57,_0x3a325d);};}function removeListener(_0x5ac114,_0x1ec205){return function(){SquareProjectEvents[_0x96fd('0x3')](_0x5ac114,_0x1ec205);};}exports[_0x96fd('0x4')]=function(_0x255538){for(var _0x107757=0x0,_0x32961e=events[_0x96fd('0x5')];_0x107757<_0x32961e;_0x107757++){var _0x3e94c9=events[_0x107757];var _0x3a97e5=createListener(_0x96fd('0x6')+_0x3e94c9,_0x255538);SquareProjectEvents['on'](_0x3e94c9,_0x3a97e5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 01c1898..78ffa3f 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x340cf2,_0x43ef3c){var _0x5aee2e=function(_0x44c40c){while(--_0x44c40c){_0x340cf2['push'](_0x340cf2['shift']());}};_0x5aee2e(++_0x43ef3c);}(_0x53ec,0x192));var _0xc53e=function(_0x46e3aa,_0x39d0f4){_0x46e3aa=_0x46e3aa-0x0;var _0x1558d1=_0x53ec[_0x46e3aa];return _0x1558d1;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _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(_0x591940,_0xa3f3c0){var _0x3fc57c=function(_0x31eae3){while(--_0x31eae3){_0x591940['push'](_0x591940['shift']());}};_0x3fc57c(++_0xa3f3c0);}(_0x326f,0xd1));var _0xf326=function(_0x27c97e,_0x26e6cd){_0x27c97e=_0x27c97e-0x0;var _0x2f8113=_0x326f[_0x27c97e];return _0x2f8113;};'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 1a8f0bc..6e174a9 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 _0xeda8=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xeda8,0x104));var _0x8eda=function(_0xc03f47,_0x6513dd){_0xc03f47=_0xc03f47-0x0;var _0x24f6fa=_0xeda8[_0xc03f47];return _0x24f6fa;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'context':{'type':Sequelize[_0x8eda('0x2')]},'extension':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize[_0x8eda('0x2')]},'dnid':{'type':Sequelize[_0x8eda('0x2')]},'projectName':{'type':Sequelize[_0x8eda('0x2')]},'saveName':{'type':Sequelize[_0x8eda('0x2')]},'filename':{'type':Sequelize[_0x8eda('0x2')]},'savePath':{'type':Sequelize[_0x8eda('0x2')]},'format':{'type':Sequelize[_0x8eda('0x3')],'get':function(){var _0x4e2ebb='';var _0x28b721=this[_0x8eda('0x4')](_0x8eda('0x5'));if(_0x28b721){_0x4e2ebb=_0x28b721[_0x8eda('0x6')](_0x28b721['lastIndexOf']('.'));}return _0x4e2ebb;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xabce,0x103));var _0xeabc=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xabce[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 41659dc..eb71c46 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 _0x6e16=['ValidationError','SquareRecording\x20not\x20found','extname','unlink','send','isNil','Entity\x20not\x20found','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','model','query','keys','intersection','fields','length','attributes','order','sort','where','filters','merge','type','VIRTUAL','filter','options','SquareRecording','include','rows','catch','show','includeAll','find','create','body','download','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6e16,0xbe));var _0x66e1=function(_0x4870c6,_0x14ff82){_0x4870c6=_0x4870c6-0x0;var _0x5e73e5=_0x6e16[_0x4870c6];return _0x5e73e5;};'use strict';var emlformat=require(_0x66e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66e1('0x1'));var jsonpatch=require(_0x66e1('0x2'));var rp=require(_0x66e1('0x3'));var moment=require(_0x66e1('0x4'));var BPromise=require(_0x66e1('0x5'));var Mustache=require(_0x66e1('0x6'));var util=require(_0x66e1('0x7'));var path=require(_0x66e1('0x8'));var sox=require(_0x66e1('0x9'));var csv=require(_0x66e1('0xa'));var ejs=require(_0x66e1('0xb'));var fs=require('fs');var fs_extra=require(_0x66e1('0xc'));var _=require(_0x66e1('0xd'));var squel=require(_0x66e1('0xe'));var crypto=require(_0x66e1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x66e1('0xa'));var querystring=require('querystring');var Papa=require(_0x66e1('0x10'));var Redis=require(_0x66e1('0x11'));var authService=require(_0x66e1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x66e1('0x13'));var hardwareService=require(_0x66e1('0x14'));var logger=require('../../config/logger')(_0x66e1('0x15'));var utils=require(_0x66e1('0x16'));var config=require(_0x66e1('0x17'));var licenseUtil=require(_0x66e1('0x18'));var db=require(_0x66e1('0x19'))['db'];function respondWithStatusCode(_0x1ef749,_0x40a931){_0x40a931=_0x40a931||0xcc;return function(_0x4f7606){if(_0x4f7606){return _0x1ef749[_0x66e1('0x1a')](_0x40a931);}return _0x1ef749[_0x66e1('0x1b')](_0x40a931)[_0x66e1('0x1c')]();};}function respondWithResult(_0x17fe29,_0x2c76b0){_0x2c76b0=_0x2c76b0||0xc8;return function(_0x54a17d){if(_0x54a17d){return _0x17fe29['status'](_0x2c76b0)[_0x66e1('0x1d')](_0x54a17d);}};}function respondWithFilteredResult(_0x1ea542,_0x1187d8){return function(_0x5a8584){if(_0x5a8584){var _0x2b67a4=typeof _0x1187d8[_0x66e1('0x1e')]==='undefined'&&typeof _0x1187d8[_0x66e1('0x1f')]==='undefined';var _0x1c4e85=_0x5a8584[_0x66e1('0x20')];var _0xa9bc4a=_0x2b67a4?0x0:_0x1187d8[_0x66e1('0x1e')];var _0x10cf1e=_0x2b67a4?_0x5a8584[_0x66e1('0x20')]:_0x1187d8[_0x66e1('0x1e')]+_0x1187d8[_0x66e1('0x1f')];var _0x19ce87;if(_0x10cf1e>=_0x1c4e85){_0x10cf1e=_0x1c4e85;_0x19ce87=0xc8;}else{_0x19ce87=0xce;}_0x1ea542[_0x66e1('0x1b')](_0x19ce87);return _0x1ea542['set']('Content-Range',_0xa9bc4a+'-'+_0x10cf1e+'/'+_0x1c4e85)['json'](_0x5a8584);}return null;};}function patchUpdates(_0xed5f9a){return function(_0x2df163){try{jsonpatch[_0x66e1('0x21')](_0x2df163,_0xed5f9a,!![]);}catch(_0x2e0e93){return BPromise[_0x66e1('0x22')](_0x2e0e93);}return _0x2df163[_0x66e1('0x23')]();};}function saveUpdates(_0x47da84,_0x2961fc){return function(_0x334f65){if(_0x334f65){return _0x334f65[_0x66e1('0x24')](_0x47da84)[_0x66e1('0x25')](function(_0xb2275f){return _0xb2275f;});}return null;};}function removeEntity(_0x4c435a,_0x4e9e74){return function(_0x54e8cf){if(_0x54e8cf){return _0x54e8cf[_0x66e1('0x26')]()['then'](function(){_0x4c435a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x72c388,_0x44a489){return function(_0x22ca28){if(!_0x22ca28){_0x72c388[_0x66e1('0x1a')](0x194);}return _0x22ca28;};}function handleError(_0x49f378,_0x232afa){_0x232afa=_0x232afa||0x1f4;return function(_0x50f338){logger['error'](_0x50f338[_0x66e1('0x27')]);if(_0x50f338[_0x66e1('0x28')]){delete _0x50f338[_0x66e1('0x28')];}_0x49f378[_0x66e1('0x1b')](_0x232afa)['send'](_0x50f338);};}exports[_0x66e1('0x29')]=function(_0x543623,_0x1b5b31){var _0x1b3086={},_0x2180c5={},_0x4283cb={'count':0x0,'rows':[]};var _0x2764e9=_[_0x66e1('0x2a')](db['SquareRecording'][_0x66e1('0x2b')],function(_0x183db0){return{'name':_0x183db0[_0x66e1('0x2c')],'type':_0x183db0['type']['key']};});_0x2180c5[_0x66e1('0x2d')]=_[_0x66e1('0x2a')](_0x2764e9,'name');_0x2180c5[_0x66e1('0x2e')]=_[_0x66e1('0x2f')](_0x543623[_0x66e1('0x2e')]);_0x2180c5['filters']=_['intersection'](_0x2180c5[_0x66e1('0x2d')],_0x2180c5[_0x66e1('0x2e')]);_0x1b3086['attributes']=_[_0x66e1('0x30')](_0x2180c5[_0x66e1('0x2d')],qs[_0x66e1('0x31')](_0x543623[_0x66e1('0x2e')][_0x66e1('0x31')]));_0x1b3086['attributes']=_0x1b3086['attributes'][_0x66e1('0x32')]?_0x1b3086[_0x66e1('0x33')]:_0x2180c5[_0x66e1('0x2d')];if(!_0x543623[_0x66e1('0x2e')]['hasOwnProperty']('nolimit')){_0x1b3086[_0x66e1('0x1f')]=qs['limit'](_0x543623[_0x66e1('0x2e')][_0x66e1('0x1f')]);_0x1b3086[_0x66e1('0x1e')]=qs[_0x66e1('0x1e')](_0x543623[_0x66e1('0x2e')][_0x66e1('0x1e')]);}_0x1b3086[_0x66e1('0x34')]=qs[_0x66e1('0x35')](_0x543623['query']['sort']);_0x1b3086[_0x66e1('0x36')]=qs[_0x66e1('0x37')](_['pick'](_0x543623[_0x66e1('0x2e')],_0x2180c5[_0x66e1('0x37')]),_0x2764e9);if(_0x543623['query']['filter']){_0x1b3086[_0x66e1('0x36')]=_[_0x66e1('0x38')](_0x1b3086[_0x66e1('0x36')],{'$or':_[_0x66e1('0x2a')](_0x2764e9,function(_0x466c80){if(_0x466c80[_0x66e1('0x39')]!==_0x66e1('0x3a')){var _0x514654={};_0x514654[_0x466c80[_0x66e1('0x28')]]={'$like':'%'+_0x543623[_0x66e1('0x2e')][_0x66e1('0x3b')]+'%'};return _0x514654;}})});}_0x1b3086=_[_0x66e1('0x38')]({},_0x1b3086,_0x543623[_0x66e1('0x3c')]);var _0x2a2ec7={'where':_0x1b3086['where']};return db[_0x66e1('0x3d')][_0x66e1('0x20')](_0x2a2ec7)[_0x66e1('0x25')](function(_0x4f5f25){_0x4283cb['count']=_0x4f5f25;if(_0x543623['query']['includeAll']){_0x1b3086[_0x66e1('0x3e')]=[{'all':!![]}];}return db[_0x66e1('0x3d')]['findAll'](_0x1b3086);})['then'](function(_0x25fe7f){_0x4283cb[_0x66e1('0x3f')]=_0x25fe7f;return _0x4283cb;})[_0x66e1('0x25')](respondWithFilteredResult(_0x1b5b31,_0x1b3086))[_0x66e1('0x40')](handleError(_0x1b5b31,null));};exports[_0x66e1('0x41')]=function(_0x45b438,_0x4b0f43){var _0x38de00={'raw':!![],'where':{'id':_0x45b438['params']['id']}},_0x540c07={};_0x540c07[_0x66e1('0x2d')]=_[_0x66e1('0x2f')](db['SquareRecording']['rawAttributes']);_0x540c07[_0x66e1('0x2e')]=_[_0x66e1('0x2f')](_0x45b438['query']);_0x540c07[_0x66e1('0x37')]=_[_0x66e1('0x30')](_0x540c07['model'],_0x540c07['query']);_0x38de00['attributes']=_[_0x66e1('0x30')](_0x540c07['model'],qs[_0x66e1('0x31')](_0x45b438[_0x66e1('0x2e')][_0x66e1('0x31')]));_0x38de00['attributes']=_0x38de00[_0x66e1('0x33')]['length']?_0x38de00[_0x66e1('0x33')]:_0x540c07[_0x66e1('0x2d')];if(_0x45b438['query'][_0x66e1('0x42')]){_0x38de00[_0x66e1('0x3e')]=[{'all':!![]}];}_0x38de00=_[_0x66e1('0x38')]({},_0x38de00,_0x45b438[_0x66e1('0x3c')]);return db[_0x66e1('0x3d')][_0x66e1('0x43')](_0x38de00)['then'](handleEntityNotFound(_0x4b0f43,null))[_0x66e1('0x25')](respondWithResult(_0x4b0f43,null))[_0x66e1('0x40')](handleError(_0x4b0f43,null));};exports['create']=function(_0x16155f,_0x42a9d3){return db['SquareRecording'][_0x66e1('0x44')](_0x16155f[_0x66e1('0x45')],{})['then'](respondWithResult(_0x42a9d3,0xc9))[_0x66e1('0x40')](handleError(_0x42a9d3,null));};exports[_0x66e1('0x24')]=function(_0x22a094,_0x59a6db){if(_0x22a094[_0x66e1('0x45')]['id']){delete _0x22a094[_0x66e1('0x45')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x22a094['params']['id']}})['then'](handleEntityNotFound(_0x59a6db,null))[_0x66e1('0x25')](saveUpdates(_0x22a094['body'],null))['then'](respondWithResult(_0x59a6db,null))['catch'](handleError(_0x59a6db,null));};exports[_0x66e1('0x46')]=function(_0xb12b9c,_0x59c96b,_0x8f3d6c){var _0x273377=require('../../components/encryptor');var _0x637447=![];var _0x535c07={};if(_0xb12b9c[_0x66e1('0x2e')][_0x66e1('0x39')]&&_0xb12b9c['query'][_0x66e1('0x39')]===_0x66e1('0x47')){_0x535c07['uniqueid']=_0xb12b9c[_0x66e1('0x48')]['id'];}else{_0x535c07['id']=_0xb12b9c[_0x66e1('0x48')]['id'];}return db[_0x66e1('0x3d')][_0x66e1('0x43')]({'where':_0x535c07,'attributes':['id',_0x66e1('0x49'),_0x66e1('0x4a')],'raw':!![]})[_0x66e1('0x25')](handleEntityNotFound(_0x59c96b,null))[_0x66e1('0x25')](function(_0x556adb){if(_0x556adb){var _0x47e32e=_0x556adb[_0x66e1('0x49')];var _0x482ae2=util[_0x66e1('0x4b')](_0x66e1('0x4c'),_0x47e32e);if(fs[_0x66e1('0x4d')](_0x482ae2)){_0x637447=!![];return _0x273377[_0x66e1('0x4e')](_0x482ae2,_0x47e32e,config['secrets'][_0x66e1('0x4f')])[_0x66e1('0x25')](function(){return _0x556adb;});}return _0x556adb;}})['then'](function(_0x2ec29e){if(_0x2ec29e){var _0x142169=_0x2ec29e[_0x66e1('0x49')];if(!fs['existsSync'](_0x142169)){throw new db['Sequelize'][(_0x66e1('0x50'))](_0x66e1('0x51'));}if(_0x2ec29e['filename']){return _0x59c96b[_0x66e1('0x46')](_0x142169,_0x2ec29e[_0x66e1('0x4a')]+path[_0x66e1('0x52')](_0x142169),function(){if(_0x637447){fs[_0x66e1('0x53')](_0x142169);}});}else{return _0x59c96b[_0x66e1('0x46')](_0x142169,function(_0x283289){if(_0x637447){fs[_0x66e1('0x53')](_0x142169);}});}}})[_0x66e1('0x40')](function(_0x53e1a4){if(_0x53e1a4['message']===_0x66e1('0x51')){_0x59c96b['status'](0x194)[_0x66e1('0x54')]('Not\x20found');}else{return handleError(_0x59c96b,null);}});};exports[_0x66e1('0x26')]=function(_0x4f825f,_0x4a8439){return db[_0x66e1('0x3d')][_0x66e1('0x43')]({'where':{'id':_0x4f825f[_0x66e1('0x48')]['id']}})[_0x66e1('0x25')](function(_0x2df2de){if(_[_0x66e1('0x55')](_0x2df2de)){throw new ReferenceError(_0x66e1('0x56'));}return _0x2df2de;})['then'](function(_0x599e15){var _0xd59d7a=_0x599e15[_0x66e1('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xd59d7a);if(!_[_0x66e1('0x55')](_0x599e15[_0x66e1('0x49')])&&fs['existsSync'](_0xd59d7a)){logger['info'](_0x66e1('0x57')+_0xd59d7a+_0x66e1('0x58'));fs[_0x66e1('0x59')](_0xd59d7a);}_0xd59d7a=_0xd59d7a+'.cypher';if(!_[_0x66e1('0x55')](_0x599e15[_0x66e1('0x49')])&&fs[_0x66e1('0x4d')](_0xd59d7a)){logger['info'](_0x66e1('0x57')+_0xd59d7a+_0x66e1('0x58'));fs['unlinkSync'](_0xd59d7a);}return _0x599e15;})['then'](function(_0x2e5afd){if(!_0x2e5afd)throw new InternalError();return _0x2e5afd[_0x66e1('0x26')]();})[_0x66e1('0x25')](function(){_0x4a8439['status'](0xcc)[_0x66e1('0x1c')]();})['catch'](handleError(_0x4a8439,null));}; \ No newline at end of file +var _0xfdd2=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','existsSync','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0xe65ac8,_0x2691be){var _0x202ba1=function(_0x4af6ff){while(--_0x4af6ff){_0xe65ac8['push'](_0xe65ac8['shift']());}};_0x202ba1(++_0x2691be);}(_0xfdd2,0x185));var _0x2fdd=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0xfdd2[_0x55b037];return _0x5f1053;};'use strict';var emlformat=require(_0x2fdd('0x0'));var rimraf=require(_0x2fdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2fdd('0x2'));var moment=require(_0x2fdd('0x3'));var BPromise=require(_0x2fdd('0x4'));var Mustache=require(_0x2fdd('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2fdd('0x6'));var csv=require(_0x2fdd('0x7'));var ejs=require(_0x2fdd('0x8'));var fs=require('fs');var fs_extra=require(_0x2fdd('0x9'));var _=require('lodash');var squel=require(_0x2fdd('0xa'));var crypto=require('crypto');var jsforce=require(_0x2fdd('0xb'));var deskjs=require(_0x2fdd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2fdd('0xd'));var Papa=require(_0x2fdd('0xe'));var Redis=require(_0x2fdd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2fdd('0x10'));var as=require(_0x2fdd('0x11'));var hardwareService=require(_0x2fdd('0x12'));var logger=require(_0x2fdd('0x13'))(_0x2fdd('0x14'));var utils=require(_0x2fdd('0x15'));var config=require(_0x2fdd('0x16'));var licenseUtil=require(_0x2fdd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a86be,_0x10c839){_0x10c839=_0x10c839||0xcc;return function(_0x9b2484){if(_0x9b2484){return _0x5a86be[_0x2fdd('0x18')](_0x10c839);}return _0x5a86be[_0x2fdd('0x19')](_0x10c839)[_0x2fdd('0x1a')]();};}function respondWithResult(_0x42f60f,_0xe1f7f1){_0xe1f7f1=_0xe1f7f1||0xc8;return function(_0x3057ac){if(_0x3057ac){return _0x42f60f[_0x2fdd('0x19')](_0xe1f7f1)['json'](_0x3057ac);}};}function respondWithFilteredResult(_0xda9ba1,_0x9c424){return function(_0x26d22f){if(_0x26d22f){var _0x29d333=typeof _0x9c424[_0x2fdd('0x1b')]==='undefined'&&typeof _0x9c424[_0x2fdd('0x1c')]===_0x2fdd('0x1d');var _0x5ebd5f=_0x26d22f[_0x2fdd('0x1e')];var _0x31f444=_0x29d333?0x0:_0x9c424[_0x2fdd('0x1b')];var _0x749b9=_0x29d333?_0x26d22f[_0x2fdd('0x1e')]:_0x9c424[_0x2fdd('0x1b')]+_0x9c424[_0x2fdd('0x1c')];var _0x4ca13e;if(_0x749b9>=_0x5ebd5f){_0x749b9=_0x5ebd5f;_0x4ca13e=0xc8;}else{_0x4ca13e=0xce;}_0xda9ba1[_0x2fdd('0x19')](_0x4ca13e);return _0xda9ba1[_0x2fdd('0x1f')](_0x2fdd('0x20'),_0x31f444+'-'+_0x749b9+'/'+_0x5ebd5f)[_0x2fdd('0x21')](_0x26d22f);}return null;};}function patchUpdates(_0x160185){return function(_0x5173b5){try{jsonpatch[_0x2fdd('0x22')](_0x5173b5,_0x160185,!![]);}catch(_0x1be353){return BPromise['reject'](_0x1be353);}return _0x5173b5[_0x2fdd('0x23')]();};}function saveUpdates(_0x108621,_0x51e4cf){return function(_0x3b9f95){if(_0x3b9f95){return _0x3b9f95[_0x2fdd('0x24')](_0x108621)['then'](function(_0x592f76){return _0x592f76;});}return null;};}function removeEntity(_0x3bfb56,_0x5a1cfd){return function(_0x28527e){if(_0x28527e){return _0x28527e['destroy']()[_0x2fdd('0x25')](function(){_0x3bfb56[_0x2fdd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x166d8,_0x1dbd87){return function(_0x53d298){if(!_0x53d298){_0x166d8[_0x2fdd('0x18')](0x194);}return _0x53d298;};}function handleError(_0x580649,_0x5a8b49){_0x5a8b49=_0x5a8b49||0x1f4;return function(_0x26ace7){logger[_0x2fdd('0x26')](_0x26ace7[_0x2fdd('0x27')]);if(_0x26ace7[_0x2fdd('0x28')]){delete _0x26ace7['name'];}_0x580649['status'](_0x5a8b49)['send'](_0x26ace7);};}exports[_0x2fdd('0x29')]=function(_0x3bf6f5,_0x4619eb){var _0xe34e9d={},_0x1c21fe={},_0x14a12f={'count':0x0,'rows':[]};var _0x687dca=_[_0x2fdd('0x2a')](db[_0x2fdd('0x2b')][_0x2fdd('0x2c')],function(_0x4421aa){return{'name':_0x4421aa[_0x2fdd('0x2d')],'type':_0x4421aa[_0x2fdd('0x2e')][_0x2fdd('0x2f')]};});_0x1c21fe['model']=_[_0x2fdd('0x2a')](_0x687dca,_0x2fdd('0x28'));_0x1c21fe[_0x2fdd('0x30')]=_['keys'](_0x3bf6f5[_0x2fdd('0x30')]);_0x1c21fe['filters']=_[_0x2fdd('0x31')](_0x1c21fe[_0x2fdd('0x32')],_0x1c21fe[_0x2fdd('0x30')]);_0xe34e9d['attributes']=_['intersection'](_0x1c21fe[_0x2fdd('0x32')],qs[_0x2fdd('0x33')](_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x33')]));_0xe34e9d['attributes']=_0xe34e9d[_0x2fdd('0x34')][_0x2fdd('0x35')]?_0xe34e9d[_0x2fdd('0x34')]:_0x1c21fe[_0x2fdd('0x32')];if(!_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x36')](_0x2fdd('0x37'))){_0xe34e9d[_0x2fdd('0x1c')]=qs[_0x2fdd('0x1c')](_0x3bf6f5[_0x2fdd('0x30')]['limit']);_0xe34e9d['offset']=qs[_0x2fdd('0x1b')](_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x1b')]);}_0xe34e9d[_0x2fdd('0x38')]=qs[_0x2fdd('0x39')](_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x39')]);_0xe34e9d['where']=qs[_0x2fdd('0x3a')](_[_0x2fdd('0x3b')](_0x3bf6f5[_0x2fdd('0x30')],_0x1c21fe[_0x2fdd('0x3a')]),_0x687dca);if(_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x3c')]){_0xe34e9d['where']=_['merge'](_0xe34e9d[_0x2fdd('0x3d')],{'$or':_[_0x2fdd('0x2a')](_0x687dca,function(_0x43ace3){if(_0x43ace3[_0x2fdd('0x2e')]!==_0x2fdd('0x3e')){var _0x109869={};_0x109869[_0x43ace3[_0x2fdd('0x28')]]={'$like':'%'+_0x3bf6f5[_0x2fdd('0x30')]['filter']+'%'};return _0x109869;}})});}_0xe34e9d=_[_0x2fdd('0x3f')]({},_0xe34e9d,_0x3bf6f5['options']);var _0x15a1b5={'where':_0xe34e9d[_0x2fdd('0x3d')]};return db[_0x2fdd('0x2b')]['count'](_0x15a1b5)[_0x2fdd('0x25')](function(_0x34c8e9){_0x14a12f[_0x2fdd('0x1e')]=_0x34c8e9;if(_0x3bf6f5[_0x2fdd('0x30')][_0x2fdd('0x40')]){_0xe34e9d['include']=[{'all':!![]}];}return db['SquareRecording'][_0x2fdd('0x41')](_0xe34e9d);})[_0x2fdd('0x25')](function(_0x151a98){_0x14a12f[_0x2fdd('0x42')]=_0x151a98;return _0x14a12f;})[_0x2fdd('0x25')](respondWithFilteredResult(_0x4619eb,_0xe34e9d))['catch'](handleError(_0x4619eb,null));};exports[_0x2fdd('0x43')]=function(_0x180cb7,_0x79dbcb){var _0x2ccb3f={'raw':!![],'where':{'id':_0x180cb7[_0x2fdd('0x44')]['id']}},_0x8ac789={};_0x8ac789[_0x2fdd('0x32')]=_[_0x2fdd('0x45')](db[_0x2fdd('0x2b')]['rawAttributes']);_0x8ac789[_0x2fdd('0x30')]=_[_0x2fdd('0x45')](_0x180cb7[_0x2fdd('0x30')]);_0x8ac789[_0x2fdd('0x3a')]=_[_0x2fdd('0x31')](_0x8ac789['model'],_0x8ac789[_0x2fdd('0x30')]);_0x2ccb3f[_0x2fdd('0x34')]=_[_0x2fdd('0x31')](_0x8ac789[_0x2fdd('0x32')],qs[_0x2fdd('0x33')](_0x180cb7[_0x2fdd('0x30')]['fields']));_0x2ccb3f[_0x2fdd('0x34')]=_0x2ccb3f[_0x2fdd('0x34')][_0x2fdd('0x35')]?_0x2ccb3f[_0x2fdd('0x34')]:_0x8ac789[_0x2fdd('0x32')];if(_0x180cb7[_0x2fdd('0x30')][_0x2fdd('0x40')]){_0x2ccb3f[_0x2fdd('0x46')]=[{'all':!![]}];}_0x2ccb3f=_[_0x2fdd('0x3f')]({},_0x2ccb3f,_0x180cb7[_0x2fdd('0x47')]);return db['SquareRecording'][_0x2fdd('0x48')](_0x2ccb3f)[_0x2fdd('0x25')](handleEntityNotFound(_0x79dbcb,null))[_0x2fdd('0x25')](respondWithResult(_0x79dbcb,null))[_0x2fdd('0x49')](handleError(_0x79dbcb,null));};exports[_0x2fdd('0x4a')]=function(_0x2daf89,_0x3542bb){return db[_0x2fdd('0x2b')][_0x2fdd('0x4a')](_0x2daf89[_0x2fdd('0x4b')],{})[_0x2fdd('0x25')](respondWithResult(_0x3542bb,0xc9))[_0x2fdd('0x49')](handleError(_0x3542bb,null));};exports['update']=function(_0x3dfc9a,_0x4c6a2b){if(_0x3dfc9a[_0x2fdd('0x4b')]['id']){delete _0x3dfc9a[_0x2fdd('0x4b')]['id'];}return db['SquareRecording'][_0x2fdd('0x48')]({'where':{'id':_0x3dfc9a[_0x2fdd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c6a2b,null))[_0x2fdd('0x25')](saveUpdates(_0x3dfc9a[_0x2fdd('0x4b')],null))[_0x2fdd('0x25')](respondWithResult(_0x4c6a2b,null))['catch'](handleError(_0x4c6a2b,null));};exports[_0x2fdd('0x4c')]=function(_0x6b2c74,_0x2893dd,_0x55ac10){var _0x324bd7=require(_0x2fdd('0x4d'));var _0x2115e3=![];var _0x32cce5={};if(_0x6b2c74['query'][_0x2fdd('0x2e')]&&_0x6b2c74[_0x2fdd('0x30')][_0x2fdd('0x2e')]==='uniqueid'){_0x32cce5[_0x2fdd('0x4e')]=_0x6b2c74[_0x2fdd('0x44')]['id'];}else{_0x32cce5['id']=_0x6b2c74[_0x2fdd('0x44')]['id'];}return db['SquareRecording'][_0x2fdd('0x48')]({'where':_0x32cce5,'attributes':['id',_0x2fdd('0x4f'),_0x2fdd('0x50')],'raw':!![]})[_0x2fdd('0x25')](handleEntityNotFound(_0x2893dd,null))[_0x2fdd('0x25')](function(_0x4fd33e){if(_0x4fd33e){var _0x49c307=_0x4fd33e[_0x2fdd('0x4f')];var _0x58cb01=util[_0x2fdd('0x51')](_0x2fdd('0x52'),_0x49c307);if(fs['existsSync'](_0x58cb01)){_0x2115e3=!![];return _0x324bd7['decryptFile'](_0x58cb01,_0x49c307,config[_0x2fdd('0x53')][_0x2fdd('0x54')])[_0x2fdd('0x25')](function(){return _0x4fd33e;});}return _0x4fd33e;}})[_0x2fdd('0x25')](function(_0x1348e9){if(_0x1348e9){var _0x1c8648=_0x1348e9[_0x2fdd('0x4f')];if(!fs['existsSync'](_0x1c8648)){throw new db[(_0x2fdd('0x55'))][(_0x2fdd('0x56'))](_0x2fdd('0x57'));}if(_0x1348e9[_0x2fdd('0x50')]){return _0x2893dd[_0x2fdd('0x4c')](_0x1c8648,_0x1348e9[_0x2fdd('0x50')]+path[_0x2fdd('0x58')](_0x1c8648),function(){if(_0x2115e3){fs[_0x2fdd('0x59')](_0x1c8648);}});}else{return _0x2893dd[_0x2fdd('0x4c')](_0x1c8648,function(_0x4e1af4){if(_0x2115e3){fs['unlink'](_0x1c8648);}});}}})[_0x2fdd('0x49')](function(_0x12f4d2){if(_0x12f4d2[_0x2fdd('0x5a')]===_0x2fdd('0x57')){_0x2893dd['status'](0x194)['send'](_0x2fdd('0x5b'));}else{return handleError(_0x2893dd,null);}});};exports['destroy']=function(_0x502f5f,_0x24169a){return db['SquareRecording']['find']({'where':{'id':_0x502f5f[_0x2fdd('0x44')]['id']}})[_0x2fdd('0x25')](function(_0xc199b8){if(_['isNil'](_0xc199b8)){throw new ReferenceError('Entity\x20not\x20found');}return _0xc199b8;})['then'](function(_0x1888a1){var _0x44a637=_0x1888a1[_0x2fdd('0x4f')];logger[_0x2fdd('0x5c')](_0x2fdd('0x5d'),_0x44a637);if(!_[_0x2fdd('0x5e')](_0x1888a1['savePath'])&&fs[_0x2fdd('0x5f')](_0x44a637)){logger[_0x2fdd('0x5c')](_0x2fdd('0x60')+_0x44a637+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2fdd('0x61')](_0x44a637);}_0x44a637=_0x44a637+_0x2fdd('0x62');if(!_[_0x2fdd('0x5e')](_0x1888a1[_0x2fdd('0x4f')])&&fs[_0x2fdd('0x5f')](_0x44a637)){logger[_0x2fdd('0x5c')]('File:\x20\x22'+_0x44a637+_0x2fdd('0x63'));fs['unlinkSync'](_0x44a637);}return _0x1888a1;})['then'](function(_0xe1f14f){if(!_0xe1f14f)throw new InternalError();return _0xe1f14f[_0x2fdd('0x64')]();})[_0x2fdd('0x25')](function(){_0x24169a[_0x2fdd('0x19')](0xcc)['end']();})[_0x2fdd('0x49')](handleError(_0x24169a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 47228e7..139a352 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 _0xb6a6=['moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','lodash','util'];(function(_0x3ea816,_0x5aba5c){var _0x185612=function(_0x30af05){while(--_0x30af05){_0x3ea816['push'](_0x3ea816['shift']());}};_0x185612(++_0x5aba5c);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x573fb0,_0x3c6fae){_0x573fb0=_0x573fb0-0x0;var _0x4f6f40=_0xb6a6[_0x573fb0];return _0x4f6f40;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b6a('0x2'));var BPromise=require(_0x6b6a('0x3'));var rp=require(_0x6b6a('0x4'));var fs=require('fs');var path=require(_0x6b6a('0x5'));var rimraf=require(_0x6b6a('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b6a('0x7'));module[_0x6b6a('0x8')]=function(_0xeb6021,_0x5f4e11){return _0xeb6021[_0x6b6a('0x9')](_0x6b6a('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeca8=['exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes'];(function(_0x49b297,_0x46d97f){var _0x1801e9=function(_0x202ea0){while(--_0x202ea0){_0x49b297['push'](_0x49b297['shift']());}};_0x1801e9(++_0x46d97f);}(_0xeca8,0x1f2));var _0x8eca=function(_0x3e223a,_0x5ce21f){_0x3e223a=_0x3e223a-0x0;var _0x324757=_0xeca8[_0x3e223a];return _0x324757;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var logger=require(_0x8eca('0x2'))(_0x8eca('0x3'));var moment=require(_0x8eca('0x4'));var BPromise=require(_0x8eca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eca('0x6'));var rimraf=require('rimraf');var config=require(_0x8eca('0x7'));var attributes=require(_0x8eca('0x8'));module[_0x8eca('0x9')]=function(_0x599a26,_0x46f257){return _0x599a26[_0x8eca('0xa')](_0x8eca('0xb'),attributes,{'tableName':_0x8eca('0xc'),'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 f135538..9b2178e 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 _0x1a07=['../../config/logger','../../config/environment','jayson/promise','client','http','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','info','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x46525f,_0x2e487a){var _0x1e125a=function(_0x4ee42c){while(--_0x4ee42c){_0x46525f['push'](_0x46525f['shift']());}};_0x1e125a(++_0x2e487a);}(_0x1a07,0x156));var _0x71a0=function(_0x7b59f0,_0x43505f){_0x7b59f0=_0x7b59f0-0x0;var _0x596190=_0x1a07[_0x7b59f0];return _0x596190;};'use strict';var _=require('lodash');var util=require(_0x71a0('0x0'));var moment=require(_0x71a0('0x1'));var BPromise=require(_0x71a0('0x2'));var rs=require(_0x71a0('0x3'));var fs=require('fs');var Redis=require(_0x71a0('0x4'));var db=require(_0x71a0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x71a0('0x6'))('rpc');var config=require(_0x71a0('0x7'));var jayson=require(_0x71a0('0x8'));var client=jayson[_0x71a0('0x9')][_0x71a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b774,_0x231f9b,_0xb728e5){return new BPromise(function(_0x3a6878,_0x93209f){return client['request'](_0x41b774,_0xb728e5)['then'](function(_0x14a1e6){logger['info'](_0x71a0('0xb'),_0x231f9b,'request\x20sent');logger['debug'](_0x71a0('0xc'),_0x231f9b,_0x71a0('0xd'),JSON[_0x71a0('0xe')](_0x14a1e6));if(_0x14a1e6[_0x71a0('0xf')]){if(_0x14a1e6['error'][_0x71a0('0x10')]===0x1f4){logger[_0x71a0('0xf')]('SquareRecording,\x20%s,\x20%s',_0x231f9b,_0x14a1e6[_0x71a0('0xf')][_0x71a0('0x11')]);return _0x93209f(_0x14a1e6[_0x71a0('0xf')][_0x71a0('0x11')]);}logger['error'](_0x71a0('0xb'),_0x231f9b,_0x14a1e6[_0x71a0('0xf')]['message']);return _0x3a6878(_0x14a1e6[_0x71a0('0xf')][_0x71a0('0x11')]);}else{logger['info'](_0x71a0('0xb'),_0x231f9b,_0x71a0('0xd'));_0x3a6878(_0x14a1e6[_0x71a0('0x12')]['message']);}})[_0x71a0('0x13')](function(_0x23e0ca){logger['error'](_0x71a0('0xb'),_0x231f9b,_0x23e0ca);_0x93209f(_0x23e0ca);});});}exports[_0x71a0('0x14')]=function(_0x3af7bc){var _0x42f070=this;return new Promise(function(_0x35c536,_0x2521d0){return db[_0x71a0('0x15')][_0x71a0('0x16')](_0x3af7bc[_0x71a0('0x17')],{'raw':_0x3af7bc['options']?_0x3af7bc[_0x71a0('0x18')][_0x71a0('0x19')]===undefined?!![]:![]:!![]})[_0x71a0('0x1a')](function(_0x1b00f3){logger[_0x71a0('0x1b')](_0x71a0('0x14'),_0x3af7bc);logger[_0x71a0('0x1c')](_0x71a0('0x14'),_0x3af7bc,JSON[_0x71a0('0xe')](_0x1b00f3));_0x35c536(_0x1b00f3);})['catch'](function(_0x5af1f4){logger[_0x71a0('0xf')](_0x71a0('0x14'),_0x5af1f4[_0x71a0('0x11')],_0x3af7bc);_0x2521d0(_0x42f070[_0x71a0('0xf')](0x1f4,_0x5af1f4['message']));});});}; \ No newline at end of file +var _0xc582=['code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','util','moment','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x19c52b,_0x50916e){var _0x57b031=function(_0x355394){while(--_0x355394){_0x19c52b['push'](_0x19c52b['shift']());}};_0x57b031(++_0x50916e);}(_0xc582,0x182));var _0x2c58=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xc582[_0x4c445a];return _0x2f611c;};'use strict';var _=require('lodash');var util=require(_0x2c58('0x0'));var moment=require(_0x2c58('0x1'));var BPromise=require('bluebird');var rs=require(_0x2c58('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c58('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2c58('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2c58('0x5')][_0x2c58('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x43b899,_0x2b8620,_0x4402c2){return new BPromise(function(_0x471e6c,_0x496f65){return client[_0x2c58('0x7')](_0x43b899,_0x4402c2)[_0x2c58('0x8')](function(_0x2f7439){logger[_0x2c58('0x9')](_0x2c58('0xa'),_0x2b8620,'request\x20sent');logger[_0x2c58('0xb')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2b8620,_0x2c58('0xc'),JSON['stringify'](_0x2f7439));if(_0x2f7439[_0x2c58('0xd')]){if(_0x2f7439[_0x2c58('0xd')][_0x2c58('0xe')]===0x1f4){logger[_0x2c58('0xd')](_0x2c58('0xa'),_0x2b8620,_0x2f7439[_0x2c58('0xd')]['message']);return _0x496f65(_0x2f7439[_0x2c58('0xd')][_0x2c58('0xf')]);}logger[_0x2c58('0xd')](_0x2c58('0xa'),_0x2b8620,_0x2f7439['error']['message']);return _0x471e6c(_0x2f7439[_0x2c58('0xd')][_0x2c58('0xf')]);}else{logger['info'](_0x2c58('0xa'),_0x2b8620,'request\x20sent');_0x471e6c(_0x2f7439[_0x2c58('0x10')][_0x2c58('0xf')]);}})[_0x2c58('0x11')](function(_0x451d81){logger['error'](_0x2c58('0xa'),_0x2b8620,_0x451d81);_0x496f65(_0x451d81);});});}exports[_0x2c58('0x12')]=function(_0x6b9e3e){var _0x521663=this;return new Promise(function(_0x24f8b1,_0x5b8b22){return db[_0x2c58('0x13')][_0x2c58('0x14')](_0x6b9e3e[_0x2c58('0x15')],{'raw':_0x6b9e3e['options']?_0x6b9e3e[_0x2c58('0x16')][_0x2c58('0x17')]===undefined?!![]:![]:!![]})[_0x2c58('0x8')](function(_0x41d6e6){logger['info'](_0x2c58('0x12'),_0x6b9e3e);logger['debug'](_0x2c58('0x12'),_0x6b9e3e,JSON[_0x2c58('0x18')](_0x41d6e6));_0x24f8b1(_0x41d6e6);})['catch'](function(_0x47a400){logger[_0x2c58('0xd')](_0x2c58('0x12'),_0x47a400[_0x2c58('0xf')],_0x6b9e3e);_0x5b8b22(_0x521663[_0x2c58('0xd')](0x1f4,_0x47a400[_0x2c58('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 689fefd..6396cbd 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xe9e8f9,_0xa250b8){var _0x28768e=function(_0x59087a){while(--_0x59087a){_0xe9e8f9['push'](_0xe9e8f9['shift']());}};_0x28768e(++_0xa250b8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1be64d8..f5e585e 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 _0xdb00=['DATE','exports','STRING'];(function(_0x36b9d6,_0x124767){var _0x4abf37=function(_0x1ecc2e){while(--_0x1ecc2e){_0x36b9d6['push'](_0x36b9d6['shift']());}};_0x4abf37(++_0x124767);}(_0xdb00,0x1bd));var _0x0db0=function(_0x4c3ba0,_0xdc0e0f){_0x4c3ba0=_0x4c3ba0-0x0;var _0xe09d6d=_0xdb00[_0x4c3ba0];return _0xe09d6d;};'use strict';var Sequelize=require('sequelize');module[_0x0db0('0x0')]={'network':{'type':Sequelize[_0x0db0('0x1')]},'network_script':{'type':Sequelize[_0x0db0('0x1')]},'request':{'type':Sequelize[_0x0db0('0x1')]},'channel':{'type':Sequelize[_0x0db0('0x1')]},'language':{'type':Sequelize[_0x0db0('0x1')]},'type':{'type':Sequelize[_0x0db0('0x1')]},'uniqueid':{'type':Sequelize[_0x0db0('0x1')]},'version':{'type':Sequelize[_0x0db0('0x1')]},'callerid':{'type':Sequelize[_0x0db0('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x0db0('0x1')]},'callington':{'type':Sequelize[_0x0db0('0x1')]},'callingtns':{'type':Sequelize[_0x0db0('0x1')]},'dnid':{'type':Sequelize[_0x0db0('0x1')]},'rdnis':{'type':Sequelize[_0x0db0('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0db0('0x1')]},'priority':{'type':Sequelize[_0x0db0('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0db0('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0db0('0x1')]},'joinAt':{'type':Sequelize[_0x0db0('0x2')]},'leaveAt':{'type':Sequelize[_0x0db0('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x007d=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x21f9c2,_0x2b3d2a){var _0x3da17f=function(_0x57e2b9){while(--_0x57e2b9){_0x21f9c2['push'](_0x21f9c2['shift']());}};_0x3da17f(++_0x2b3d2a);}(_0x007d,0x7e));var _0xd007=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x007d[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xd007('0x0'));module[_0xd007('0x1')]={'network':{'type':Sequelize[_0xd007('0x2')]},'network_script':{'type':Sequelize[_0xd007('0x2')]},'request':{'type':Sequelize[_0xd007('0x2')]},'channel':{'type':Sequelize[_0xd007('0x2')]},'language':{'type':Sequelize[_0xd007('0x2')]},'type':{'type':Sequelize[_0xd007('0x2')]},'uniqueid':{'type':Sequelize[_0xd007('0x2')]},'version':{'type':Sequelize[_0xd007('0x2')]},'callerid':{'type':Sequelize[_0xd007('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xd007('0x2')]},'callingani2':{'type':Sequelize[_0xd007('0x2')]},'callington':{'type':Sequelize[_0xd007('0x2')]},'callingtns':{'type':Sequelize[_0xd007('0x2')]},'dnid':{'type':Sequelize[_0xd007('0x2')]},'rdnis':{'type':Sequelize[_0xd007('0x2')]},'context':{'type':Sequelize[_0xd007('0x2')]},'extension':{'type':Sequelize[_0xd007('0x2')]},'priority':{'type':Sequelize[_0xd007('0x2')]},'enhanced':{'type':Sequelize[_0xd007('0x2')]},'accountcode':{'type':Sequelize[_0xd007('0x2')]},'threadid':{'type':Sequelize[_0xd007('0x2')]},'project_name':{'type':Sequelize[_0xd007('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd007('0x3')]},'bot':{'type':Sequelize[_0xd007('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 41ec093..a97a416 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 _0x6516=['includeAll','include','findAll','rows','params','keys','rawAttributes','fields','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','send','index','map','fieldName','type','key','name','query','filters','model','attributes','intersection','length','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport'];(function(_0x25cf99,_0x59a395){var _0xc1008f=function(_0x228bb9){while(--_0x228bb9){_0x25cf99['push'](_0x25cf99['shift']());}};_0xc1008f(++_0x59a395);}(_0x6516,0x193));var _0x6651=function(_0xbfc532,_0x352a85){_0xbfc532=_0xbfc532-0x0;var _0x446a33=_0x6516[_0xbfc532];return _0x446a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6651('0x0'));var zipdir=require(_0x6651('0x1'));var jsonpatch=require(_0x6651('0x2'));var rp=require('request-promise');var moment=require(_0x6651('0x3'));var BPromise=require(_0x6651('0x4'));var Mustache=require(_0x6651('0x5'));var util=require(_0x6651('0x6'));var path=require(_0x6651('0x7'));var sox=require(_0x6651('0x8'));var csv=require(_0x6651('0x9'));var ejs=require(_0x6651('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6651('0xb'));var squel=require(_0x6651('0xc'));var crypto=require(_0x6651('0xd'));var jsforce=require(_0x6651('0xe'));var deskjs=require(_0x6651('0xf'));var toCsv=require(_0x6651('0x9'));var querystring=require(_0x6651('0x10'));var Papa=require(_0x6651('0x11'));var Redis=require(_0x6651('0x12'));var authService=require(_0x6651('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6651('0x14'));var hardwareService=require(_0x6651('0x15'));var logger=require(_0x6651('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x6651('0x17'));var licenseUtil=require(_0x6651('0x18'));var db=require(_0x6651('0x19'))['db'];function respondWithStatusCode(_0x1c5a59,_0x11928a){_0x11928a=_0x11928a||0xcc;return function(_0x21b9ab){if(_0x21b9ab){return _0x1c5a59['sendStatus'](_0x11928a);}return _0x1c5a59['status'](_0x11928a)['end']();};}function respondWithResult(_0xd84e0b,_0x41ebb6){_0x41ebb6=_0x41ebb6||0xc8;return function(_0x51589a){if(_0x51589a){return _0xd84e0b[_0x6651('0x1a')](_0x41ebb6)[_0x6651('0x1b')](_0x51589a);}};}function respondWithFilteredResult(_0x1bc406,_0xda52a8){return function(_0x45c688){if(_0x45c688){var _0x374f2d=typeof _0xda52a8[_0x6651('0x1c')]===_0x6651('0x1d')&&typeof _0xda52a8['limit']===_0x6651('0x1d');var _0x49874f=_0x45c688['count'];var _0x243f22=_0x374f2d?0x0:_0xda52a8[_0x6651('0x1c')];var _0x2cee99=_0x374f2d?_0x45c688[_0x6651('0x1e')]:_0xda52a8['offset']+_0xda52a8[_0x6651('0x1f')];var _0x2d9892;if(_0x2cee99>=_0x49874f){_0x2cee99=_0x49874f;_0x2d9892=0xc8;}else{_0x2d9892=0xce;}_0x1bc406[_0x6651('0x1a')](_0x2d9892);return _0x1bc406['set'](_0x6651('0x20'),_0x243f22+'-'+_0x2cee99+'/'+_0x49874f)[_0x6651('0x1b')](_0x45c688);}return null;};}function patchUpdates(_0x40e081){return function(_0x559e51){try{jsonpatch[_0x6651('0x21')](_0x559e51,_0x40e081,!![]);}catch(_0x374a81){return BPromise[_0x6651('0x22')](_0x374a81);}return _0x559e51[_0x6651('0x23')]();};}function saveUpdates(_0x15c989,_0x5cef97){return function(_0x414d70){if(_0x414d70){return _0x414d70[_0x6651('0x24')](_0x15c989)[_0x6651('0x25')](function(_0x5f2b2e){return _0x5f2b2e;});}return null;};}function removeEntity(_0x5772c5,_0x409c0c){return function(_0x1d3c3b){if(_0x1d3c3b){return _0x1d3c3b[_0x6651('0x26')]()[_0x6651('0x25')](function(){_0x5772c5[_0x6651('0x1a')](0xcc)[_0x6651('0x27')]();});}};}function handleEntityNotFound(_0xe0c15f,_0x3049ce){return function(_0x571c39){if(!_0x571c39){_0xe0c15f[_0x6651('0x28')](0x194);}return _0x571c39;};}function handleError(_0x3a96b2,_0x48b3ca){_0x48b3ca=_0x48b3ca||0x1f4;return function(_0x1f889c){logger[_0x6651('0x29')](_0x1f889c[_0x6651('0x2a')]);if(_0x1f889c['name']){delete _0x1f889c['name'];}_0x3a96b2['status'](_0x48b3ca)[_0x6651('0x2b')](_0x1f889c);};}exports[_0x6651('0x2c')]=function(_0x4b58b4,_0x4dcb1a){var _0x27e428={},_0x36ceec={},_0x4294f9={'count':0x0,'rows':[]};var _0x274fce=_[_0x6651('0x2d')](db['SquareReport']['rawAttributes'],function(_0x270fac){return{'name':_0x270fac[_0x6651('0x2e')],'type':_0x270fac[_0x6651('0x2f')][_0x6651('0x30')]};});_0x36ceec['model']=_[_0x6651('0x2d')](_0x274fce,_0x6651('0x31'));_0x36ceec[_0x6651('0x32')]=_['keys'](_0x4b58b4['query']);_0x36ceec[_0x6651('0x33')]=_['intersection'](_0x36ceec[_0x6651('0x34')],_0x36ceec[_0x6651('0x32')]);_0x27e428[_0x6651('0x35')]=_[_0x6651('0x36')](_0x36ceec[_0x6651('0x34')],qs['fields'](_0x4b58b4[_0x6651('0x32')]['fields']));_0x27e428[_0x6651('0x35')]=_0x27e428[_0x6651('0x35')][_0x6651('0x37')]?_0x27e428[_0x6651('0x35')]:_0x36ceec['model'];if(!_0x4b58b4[_0x6651('0x32')]['hasOwnProperty']('nolimit')){_0x27e428[_0x6651('0x1f')]=qs['limit'](_0x4b58b4[_0x6651('0x32')][_0x6651('0x1f')]);_0x27e428[_0x6651('0x1c')]=qs[_0x6651('0x1c')](_0x4b58b4[_0x6651('0x32')][_0x6651('0x1c')]);}_0x27e428[_0x6651('0x38')]=qs[_0x6651('0x39')](_0x4b58b4[_0x6651('0x32')][_0x6651('0x39')]);_0x27e428[_0x6651('0x3a')]=qs[_0x6651('0x33')](_[_0x6651('0x3b')](_0x4b58b4['query'],_0x36ceec[_0x6651('0x33')]),_0x274fce);if(_0x4b58b4[_0x6651('0x32')][_0x6651('0x3c')]){_0x27e428['where']=_[_0x6651('0x3d')](_0x27e428[_0x6651('0x3a')],{'$or':_['map'](_0x274fce,function(_0x4e3cd8){if(_0x4e3cd8['type']!==_0x6651('0x3e')){var _0x5e209c={};_0x5e209c[_0x4e3cd8['name']]={'$like':'%'+_0x4b58b4[_0x6651('0x32')][_0x6651('0x3c')]+'%'};return _0x5e209c;}})});}_0x27e428=_[_0x6651('0x3d')]({},_0x27e428,_0x4b58b4[_0x6651('0x3f')]);var _0x50b9d0={'where':_0x27e428[_0x6651('0x3a')]};return db[_0x6651('0x40')][_0x6651('0x1e')](_0x50b9d0)[_0x6651('0x25')](function(_0x460171){_0x4294f9[_0x6651('0x1e')]=_0x460171;if(_0x4b58b4['query'][_0x6651('0x41')]){_0x27e428[_0x6651('0x42')]=[{'all':!![]}];}return db[_0x6651('0x40')][_0x6651('0x43')](_0x27e428);})[_0x6651('0x25')](function(_0x3b49e3){_0x4294f9[_0x6651('0x44')]=_0x3b49e3;return _0x4294f9;})[_0x6651('0x25')](respondWithFilteredResult(_0x4dcb1a,_0x27e428))['catch'](handleError(_0x4dcb1a,null));};exports['show']=function(_0x459604,_0x30f005){var _0x1700f1={'raw':!![],'where':{'id':_0x459604[_0x6651('0x45')]['id']}},_0x47be1e={};_0x47be1e[_0x6651('0x34')]=_[_0x6651('0x46')](db[_0x6651('0x40')][_0x6651('0x47')]);_0x47be1e['query']=_[_0x6651('0x46')](_0x459604['query']);_0x47be1e[_0x6651('0x33')]=_[_0x6651('0x36')](_0x47be1e[_0x6651('0x34')],_0x47be1e['query']);_0x1700f1[_0x6651('0x35')]=_[_0x6651('0x36')](_0x47be1e[_0x6651('0x34')],qs[_0x6651('0x48')](_0x459604[_0x6651('0x32')][_0x6651('0x48')]));_0x1700f1[_0x6651('0x35')]=_0x1700f1['attributes'][_0x6651('0x37')]?_0x1700f1[_0x6651('0x35')]:_0x47be1e['model'];if(_0x459604[_0x6651('0x32')][_0x6651('0x41')]){_0x1700f1[_0x6651('0x42')]=[{'all':!![]}];}_0x1700f1=_[_0x6651('0x3d')]({},_0x1700f1,_0x459604[_0x6651('0x3f')]);return db[_0x6651('0x40')][_0x6651('0x49')](_0x1700f1)['then'](handleEntityNotFound(_0x30f005,null))[_0x6651('0x25')](respondWithResult(_0x30f005,null))[_0x6651('0x4a')](handleError(_0x30f005,null));};exports[_0x6651('0x4b')]=function(_0x4db993,_0x554b88){return db[_0x6651('0x40')][_0x6651('0x4b')](_0x4db993[_0x6651('0x4c')],{})[_0x6651('0x25')](respondWithResult(_0x554b88,0xc9))['catch'](handleError(_0x554b88,null));};exports['update']=function(_0x5aca7f,_0x59bcfb){if(_0x5aca7f['body']['id']){delete _0x5aca7f[_0x6651('0x4c')]['id'];}return db[_0x6651('0x40')][_0x6651('0x49')]({'where':{'id':_0x5aca7f[_0x6651('0x45')]['id']}})['then'](handleEntityNotFound(_0x59bcfb,null))[_0x6651('0x25')](saveUpdates(_0x5aca7f['body'],null))[_0x6651('0x25')](respondWithResult(_0x59bcfb,null))[_0x6651('0x4a')](handleError(_0x59bcfb,null));};exports[_0x6651('0x26')]=function(_0x44a532,_0x39afb8){return db['SquareReport']['find']({'where':{'id':_0x44a532[_0x6651('0x45')]['id']}})[_0x6651('0x25')](handleEntityNotFound(_0x39afb8,null))[_0x6651('0x25')](removeEntity(_0x39afb8,null))[_0x6651('0x4a')](handleError(_0x39afb8,null));};exports['describe']=function(_0x2ccd49,_0x147618){return db[_0x6651('0x40')][_0x6651('0x4d')]()[_0x6651('0x25')](respondWithResult(_0x147618,null))[_0x6651('0x4a')](handleError(_0x147618,null));}; \ No newline at end of file +var _0xa319=['count','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4482b5,_0x15f128){var _0x37e5da=function(_0x34f351){while(--_0x34f351){_0x4482b5['push'](_0x4482b5['shift']());}};_0x37e5da(++_0x15f128);}(_0xa319,0x14a));var _0x9a31=function(_0x26a109,_0x37d29b){_0x26a109=_0x26a109-0x0;var _0x35c280=_0xa319[_0x26a109];return _0x35c280;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a31('0x0'));var zipdir=require(_0x9a31('0x1'));var jsonpatch=require(_0x9a31('0x2'));var rp=require(_0x9a31('0x3'));var moment=require(_0x9a31('0x4'));var BPromise=require(_0x9a31('0x5'));var Mustache=require(_0x9a31('0x6'));var util=require(_0x9a31('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9a31('0x8'));var ejs=require(_0x9a31('0x9'));var fs=require('fs');var fs_extra=require(_0x9a31('0xa'));var _=require('lodash');var squel=require(_0x9a31('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a31('0xc'));var toCsv=require(_0x9a31('0x8'));var querystring=require('querystring');var Papa=require(_0x9a31('0xd'));var Redis=require(_0x9a31('0xe'));var authService=require(_0x9a31('0xf'));var qs=require(_0x9a31('0x10'));var as=require(_0x9a31('0x11'));var hardwareService=require(_0x9a31('0x12'));var logger=require(_0x9a31('0x13'))(_0x9a31('0x14'));var utils=require(_0x9a31('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a31('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50027f,_0x310580){_0x310580=_0x310580||0xcc;return function(_0x416cf4){if(_0x416cf4){return _0x50027f[_0x9a31('0x17')](_0x310580);}return _0x50027f[_0x9a31('0x18')](_0x310580)[_0x9a31('0x19')]();};}function respondWithResult(_0xee8af9,_0x52efd7){_0x52efd7=_0x52efd7||0xc8;return function(_0x2c7238){if(_0x2c7238){return _0xee8af9[_0x9a31('0x18')](_0x52efd7)[_0x9a31('0x1a')](_0x2c7238);}};}function respondWithFilteredResult(_0x35d840,_0x500f69){return function(_0x45f79a){if(_0x45f79a){var _0x1187d9=typeof _0x500f69[_0x9a31('0x1b')]===_0x9a31('0x1c')&&typeof _0x500f69[_0x9a31('0x1d')]===_0x9a31('0x1c');var _0x3fb930=_0x45f79a['count'];var _0x55b62d=_0x1187d9?0x0:_0x500f69[_0x9a31('0x1b')];var _0x30d301=_0x1187d9?_0x45f79a[_0x9a31('0x1e')]:_0x500f69['offset']+_0x500f69[_0x9a31('0x1d')];var _0xd0d900;if(_0x30d301>=_0x3fb930){_0x30d301=_0x3fb930;_0xd0d900=0xc8;}else{_0xd0d900=0xce;}_0x35d840['status'](_0xd0d900);return _0x35d840[_0x9a31('0x1f')](_0x9a31('0x20'),_0x55b62d+'-'+_0x30d301+'/'+_0x3fb930)['json'](_0x45f79a);}return null;};}function patchUpdates(_0x35fd1d){return function(_0x597c8c){try{jsonpatch[_0x9a31('0x21')](_0x597c8c,_0x35fd1d,!![]);}catch(_0x39f2d2){return BPromise[_0x9a31('0x22')](_0x39f2d2);}return _0x597c8c['save']();};}function saveUpdates(_0xe8cee2,_0x3841a6){return function(_0x363f69){if(_0x363f69){return _0x363f69['update'](_0xe8cee2)['then'](function(_0x12c0c4){return _0x12c0c4;});}return null;};}function removeEntity(_0x4104ee,_0x265971){return function(_0x502318){if(_0x502318){return _0x502318[_0x9a31('0x23')]()[_0x9a31('0x24')](function(){_0x4104ee[_0x9a31('0x18')](0xcc)[_0x9a31('0x19')]();});}};}function handleEntityNotFound(_0x4737b7,_0x16845a){return function(_0x105b01){if(!_0x105b01){_0x4737b7[_0x9a31('0x17')](0x194);}return _0x105b01;};}function handleError(_0x3414df,_0x3cf5d7){_0x3cf5d7=_0x3cf5d7||0x1f4;return function(_0x149364){logger['error'](_0x149364[_0x9a31('0x25')]);if(_0x149364[_0x9a31('0x26')]){delete _0x149364[_0x9a31('0x26')];}_0x3414df[_0x9a31('0x18')](_0x3cf5d7)[_0x9a31('0x27')](_0x149364);};}exports[_0x9a31('0x28')]=function(_0x3e11c2,_0x2583a8){var _0x29caff={},_0x2f823f={},_0x3a9a6f={'count':0x0,'rows':[]};var _0x18e5bb=_[_0x9a31('0x29')](db[_0x9a31('0x2a')][_0x9a31('0x2b')],function(_0x206041){return{'name':_0x206041[_0x9a31('0x2c')],'type':_0x206041[_0x9a31('0x2d')][_0x9a31('0x2e')]};});_0x2f823f[_0x9a31('0x2f')]=_[_0x9a31('0x29')](_0x18e5bb,_0x9a31('0x26'));_0x2f823f[_0x9a31('0x30')]=_[_0x9a31('0x31')](_0x3e11c2[_0x9a31('0x30')]);_0x2f823f[_0x9a31('0x32')]=_[_0x9a31('0x33')](_0x2f823f[_0x9a31('0x2f')],_0x2f823f[_0x9a31('0x30')]);_0x29caff['attributes']=_[_0x9a31('0x33')](_0x2f823f[_0x9a31('0x2f')],qs[_0x9a31('0x34')](_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x34')]));_0x29caff[_0x9a31('0x35')]=_0x29caff[_0x9a31('0x35')][_0x9a31('0x36')]?_0x29caff[_0x9a31('0x35')]:_0x2f823f[_0x9a31('0x2f')];if(!_0x3e11c2[_0x9a31('0x30')]['hasOwnProperty']('nolimit')){_0x29caff[_0x9a31('0x1d')]=qs[_0x9a31('0x1d')](_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x1d')]);_0x29caff[_0x9a31('0x1b')]=qs['offset'](_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x1b')]);}_0x29caff[_0x9a31('0x37')]=qs[_0x9a31('0x38')](_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x38')]);_0x29caff[_0x9a31('0x39')]=qs[_0x9a31('0x32')](_[_0x9a31('0x3a')](_0x3e11c2[_0x9a31('0x30')],_0x2f823f[_0x9a31('0x32')]),_0x18e5bb);if(_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x3b')]){_0x29caff[_0x9a31('0x39')]=_[_0x9a31('0x3c')](_0x29caff[_0x9a31('0x39')],{'$or':_[_0x9a31('0x29')](_0x18e5bb,function(_0x13fce3){if(_0x13fce3[_0x9a31('0x2d')]!==_0x9a31('0x3d')){var _0x270ebc={};_0x270ebc[_0x13fce3[_0x9a31('0x26')]]={'$like':'%'+_0x3e11c2[_0x9a31('0x30')][_0x9a31('0x3b')]+'%'};return _0x270ebc;}})});}_0x29caff=_[_0x9a31('0x3c')]({},_0x29caff,_0x3e11c2[_0x9a31('0x3e')]);var _0x5925ef={'where':_0x29caff[_0x9a31('0x39')]};return db['SquareReport'][_0x9a31('0x1e')](_0x5925ef)[_0x9a31('0x24')](function(_0x32318a){_0x3a9a6f[_0x9a31('0x1e')]=_0x32318a;if(_0x3e11c2['query']['includeAll']){_0x29caff[_0x9a31('0x3f')]=[{'all':!![]}];}return db[_0x9a31('0x2a')][_0x9a31('0x40')](_0x29caff);})[_0x9a31('0x24')](function(_0xfa8190){_0x3a9a6f[_0x9a31('0x41')]=_0xfa8190;return _0x3a9a6f;})[_0x9a31('0x24')](respondWithFilteredResult(_0x2583a8,_0x29caff))[_0x9a31('0x42')](handleError(_0x2583a8,null));};exports['show']=function(_0x586385,_0x101389){var _0x3c8b19={'raw':!![],'where':{'id':_0x586385['params']['id']}},_0x23d2de={};_0x23d2de[_0x9a31('0x2f')]=_[_0x9a31('0x31')](db[_0x9a31('0x2a')][_0x9a31('0x2b')]);_0x23d2de[_0x9a31('0x30')]=_['keys'](_0x586385[_0x9a31('0x30')]);_0x23d2de[_0x9a31('0x32')]=_['intersection'](_0x23d2de[_0x9a31('0x2f')],_0x23d2de['query']);_0x3c8b19[_0x9a31('0x35')]=_[_0x9a31('0x33')](_0x23d2de['model'],qs[_0x9a31('0x34')](_0x586385[_0x9a31('0x30')]['fields']));_0x3c8b19[_0x9a31('0x35')]=_0x3c8b19['attributes'][_0x9a31('0x36')]?_0x3c8b19['attributes']:_0x23d2de['model'];if(_0x586385[_0x9a31('0x30')]['includeAll']){_0x3c8b19[_0x9a31('0x3f')]=[{'all':!![]}];}_0x3c8b19=_[_0x9a31('0x3c')]({},_0x3c8b19,_0x586385[_0x9a31('0x3e')]);return db[_0x9a31('0x2a')][_0x9a31('0x43')](_0x3c8b19)[_0x9a31('0x24')](handleEntityNotFound(_0x101389,null))[_0x9a31('0x24')](respondWithResult(_0x101389,null))[_0x9a31('0x42')](handleError(_0x101389,null));};exports['create']=function(_0x11b1e3,_0x546247){return db[_0x9a31('0x2a')][_0x9a31('0x44')](_0x11b1e3[_0x9a31('0x45')],{})[_0x9a31('0x24')](respondWithResult(_0x546247,0xc9))[_0x9a31('0x42')](handleError(_0x546247,null));};exports[_0x9a31('0x46')]=function(_0x999439,_0x5405c5){if(_0x999439[_0x9a31('0x45')]['id']){delete _0x999439[_0x9a31('0x45')]['id'];}return db[_0x9a31('0x2a')]['find']({'where':{'id':_0x999439[_0x9a31('0x47')]['id']}})[_0x9a31('0x24')](handleEntityNotFound(_0x5405c5,null))[_0x9a31('0x24')](saveUpdates(_0x999439[_0x9a31('0x45')],null))[_0x9a31('0x24')](respondWithResult(_0x5405c5,null))[_0x9a31('0x42')](handleError(_0x5405c5,null));};exports[_0x9a31('0x23')]=function(_0x4b2ef1,_0x3f5a15){return db[_0x9a31('0x2a')][_0x9a31('0x43')]({'where':{'id':_0x4b2ef1['params']['id']}})[_0x9a31('0x24')](handleEntityNotFound(_0x3f5a15,null))['then'](removeEntity(_0x3f5a15,null))['catch'](handleError(_0x3f5a15,null));};exports['describe']=function(_0x535efb,_0xc36d7e){return db[_0x9a31('0x2a')]['describe']()['then'](respondWithResult(_0xc36d7e,null))[_0x9a31('0x42')](handleError(_0xc36d7e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0a601dd..eb65f13 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 _0x2d4d=['define','SquareReport','uniqueid','project_name','leaveAt','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x70d088,_0x1de0d6){var _0x2f0c29=function(_0x3e6eab){while(--_0x3e6eab){_0x70d088['push'](_0x70d088['shift']());}};_0x2f0c29(++_0x1de0d6);}(_0x2d4d,0x75));var _0xd2d4=function(_0x2e17a1,_0x510163){_0x2e17a1=_0x2e17a1-0x0;var _0xf6ab6b=_0x2d4d[_0x2e17a1];return _0xf6ab6b;};'use strict';var _=require(_0xd2d4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2d4('0x1'));var moment=require(_0xd2d4('0x2'));var BPromise=require(_0xd2d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2d4('0x4'));var rimraf=require(_0xd2d4('0x5'));var config=require(_0xd2d4('0x6'));var attributes=require(_0xd2d4('0x7'));module[_0xd2d4('0x8')]=function(_0x51200d,_0x2deb42){return _0x51200d[_0xd2d4('0x9')](_0xd2d4('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd2d4('0xb'),_0xd2d4('0xc')]},{'name':_0xd2d4('0xd'),'fields':[_0xd2d4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaef2=['uniqueid','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname'];(function(_0x3113a8,_0x3443ef){var _0x4d0a34=function(_0x325d81){while(--_0x325d81){_0x3113a8['push'](_0x3113a8['shift']());}};_0x4d0a34(++_0x3443ef);}(_0xaef2,0x6b));var _0x2aef=function(_0xbf400c,_0x37e1e7){_0xbf400c=_0xbf400c-0x0;var _0x2ee697=_0xaef2[_0xbf400c];return _0x2ee697;};'use strict';var _=require('lodash');var util=require(_0x2aef('0x0'));var logger=require(_0x2aef('0x1'))(_0x2aef('0x2'));var moment=require(_0x2aef('0x3'));var BPromise=require(_0x2aef('0x4'));var rp=require(_0x2aef('0x5'));var fs=require('fs');var path=require(_0x2aef('0x6'));var rimraf=require('rimraf');var config=require(_0x2aef('0x7'));var attributes=require(_0x2aef('0x8'));module[_0x2aef('0x9')]=function(_0x16538a,_0x2ef55b){return _0x16538a[_0x2aef('0xa')](_0x2aef('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x2aef('0xc'),'fields':[_0x2aef('0xd'),'project_name']},{'name':_0x2aef('0xe'),'fields':[_0x2aef('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2830ad5..257e56b 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 _0x40de=['attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','create','body','options','UpdateSquareReport','SquareReport','update','where'];(function(_0x217332,_0x3c4328){var _0x141ba3=function(_0x2d7da3){while(--_0x2d7da3){_0x217332['push'](_0x217332['shift']());}};_0x141ba3(++_0x3c4328);}(_0x40de,0x157));var _0xe40d=function(_0x3e151d,_0x5b96a8){_0x3e151d=_0x3e151d-0x0;var _0x10ad6a=_0x40de[_0x3e151d];return _0x10ad6a;};'use strict';var _=require('lodash');var util=require(_0xe40d('0x0'));var moment=require(_0xe40d('0x1'));var BPromise=require(_0xe40d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe40d('0x3'));var db=require(_0xe40d('0x4'))['db'];var utils=require(_0xe40d('0x5'));var logger=require(_0xe40d('0x6'))(_0xe40d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe40d('0x8')][_0xe40d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x178114,_0x4c8a4e,_0x49e3db){return new BPromise(function(_0x42d298,_0x306734){return client[_0xe40d('0xa')](_0x178114,_0x49e3db)[_0xe40d('0xb')](function(_0x31f0e2){logger[_0xe40d('0xc')](_0xe40d('0xd'),_0x4c8a4e,_0xe40d('0xe'));logger[_0xe40d('0xf')](_0xe40d('0x10'),_0x4c8a4e,'request\x20sent',JSON[_0xe40d('0x11')](_0x31f0e2));if(_0x31f0e2[_0xe40d('0x12')]){if(_0x31f0e2[_0xe40d('0x12')]['code']===0x1f4){logger['error'](_0xe40d('0xd'),_0x4c8a4e,_0x31f0e2[_0xe40d('0x12')]['message']);return _0x306734(_0x31f0e2[_0xe40d('0x12')]['message']);}logger['error'](_0xe40d('0xd'),_0x4c8a4e,_0x31f0e2[_0xe40d('0x12')][_0xe40d('0x13')]);return _0x42d298(_0x31f0e2[_0xe40d('0x12')][_0xe40d('0x13')]);}else{logger[_0xe40d('0xc')](_0xe40d('0xd'),_0x4c8a4e,_0xe40d('0xe'));_0x42d298(_0x31f0e2['result']['message']);}})[_0xe40d('0x14')](function(_0x5ed5b8){logger['error'](_0xe40d('0xd'),_0x4c8a4e,_0x5ed5b8);_0x306734(_0x5ed5b8);});});}exports[_0xe40d('0x15')]=function(_0x3103d0){var _0x17cc0b=this;return new Promise(function(_0x5be01f,_0x28a9d0){return db['SquareReport'][_0xe40d('0x16')](_0x3103d0[_0xe40d('0x17')],{'raw':_0x3103d0[_0xe40d('0x18')]?_0x3103d0[_0xe40d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe40d('0xb')](function(_0x3f0680){logger['info'](_0xe40d('0x15'),_0x3103d0);logger[_0xe40d('0xf')](_0xe40d('0x15'),_0x3103d0,JSON[_0xe40d('0x11')](_0x3f0680));_0x5be01f(_0x3f0680);})[_0xe40d('0x14')](function(_0x1d50d7){logger[_0xe40d('0x12')](_0xe40d('0x15'),_0x1d50d7[_0xe40d('0x13')],_0x3103d0);_0x28a9d0(_0x17cc0b[_0xe40d('0x12')](0x1f4,_0x1d50d7[_0xe40d('0x13')]));});});};exports[_0xe40d('0x19')]=function(_0x527c4b){var _0x4abf93=this;return new Promise(function(_0x188e1b,_0x2243e6){return db[_0xe40d('0x1a')][_0xe40d('0x1b')](_0x527c4b[_0xe40d('0x17')],{'raw':_0x527c4b[_0xe40d('0x18')]?_0x527c4b[_0xe40d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x527c4b[_0xe40d('0x18')]?_0x527c4b['options'][_0xe40d('0x1c')]||null:null,'attributes':_0x527c4b[_0xe40d('0x18')]?_0x527c4b['options'][_0xe40d('0x1d')]||null:null,'limit':_0x527c4b[_0xe40d('0x18')]?_0x527c4b[_0xe40d('0x18')][_0xe40d('0x1e')]||null:null})[_0xe40d('0xb')](function(_0x5d7f27){logger[_0xe40d('0xc')](_0xe40d('0x19'),_0x527c4b);logger[_0xe40d('0xf')](_0xe40d('0x19'),_0x527c4b,JSON[_0xe40d('0x11')](_0x5d7f27));_0x188e1b(_0x5d7f27);})[_0xe40d('0x14')](function(_0x309030){logger['error'](_0xe40d('0x19'),_0x309030['message'],_0x527c4b);_0x2243e6(_0x4abf93[_0xe40d('0x12')](0x1f4,_0x309030['message']));});});}; \ No newline at end of file +var _0x83c2=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreateSquareReport','SquareReport','create','body','options','raw','then','catch','UpdateSquareReport','update','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','info','SquareReport,\x20%s,\x20%s'];(function(_0x19e20e,_0x38d789){var _0x4cdecd=function(_0x5d9acb){while(--_0x5d9acb){_0x19e20e['push'](_0x19e20e['shift']());}};_0x4cdecd(++_0x38d789);}(_0x83c2,0x1b7));var _0x283c=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x83c2[_0x4e6ae6];return _0x23c108;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x283c('0x0'));var BPromise=require(_0x283c('0x1'));var rs=require(_0x283c('0x2'));var fs=require('fs');var Redis=require(_0x283c('0x3'));var db=require(_0x283c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x283c('0x5'))(_0x283c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a44f2,_0x564458,_0x1a6125){return new BPromise(function(_0x5e49cc,_0x6f2f37){return client['request'](_0x4a44f2,_0x1a6125)['then'](function(_0x1f7e80){logger[_0x283c('0x7')](_0x283c('0x8'),_0x564458,'request\x20sent');logger[_0x283c('0x9')](_0x283c('0xa'),_0x564458,'request\x20sent',JSON[_0x283c('0xb')](_0x1f7e80));if(_0x1f7e80[_0x283c('0xc')]){if(_0x1f7e80[_0x283c('0xc')][_0x283c('0xd')]===0x1f4){logger[_0x283c('0xc')](_0x283c('0x8'),_0x564458,_0x1f7e80[_0x283c('0xc')][_0x283c('0xe')]);return _0x6f2f37(_0x1f7e80[_0x283c('0xc')][_0x283c('0xe')]);}logger['error'](_0x283c('0x8'),_0x564458,_0x1f7e80[_0x283c('0xc')][_0x283c('0xe')]);return _0x5e49cc(_0x1f7e80[_0x283c('0xc')][_0x283c('0xe')]);}else{logger[_0x283c('0x7')](_0x283c('0x8'),_0x564458,_0x283c('0xf'));_0x5e49cc(_0x1f7e80[_0x283c('0x10')][_0x283c('0xe')]);}})['catch'](function(_0x5d16a5){logger[_0x283c('0xc')](_0x283c('0x8'),_0x564458,_0x5d16a5);_0x6f2f37(_0x5d16a5);});});}exports[_0x283c('0x11')]=function(_0x271e8c){var _0x2f27d=this;return new Promise(function(_0x2aad22,_0x2792ba){return db[_0x283c('0x12')][_0x283c('0x13')](_0x271e8c[_0x283c('0x14')],{'raw':_0x271e8c[_0x283c('0x15')]?_0x271e8c['options'][_0x283c('0x16')]===undefined?!![]:![]:!![]})[_0x283c('0x17')](function(_0x3caf1a){logger[_0x283c('0x7')]('CreateSquareReport',_0x271e8c);logger[_0x283c('0x9')](_0x283c('0x11'),_0x271e8c,JSON[_0x283c('0xb')](_0x3caf1a));_0x2aad22(_0x3caf1a);})[_0x283c('0x18')](function(_0x367d81){logger[_0x283c('0xc')]('CreateSquareReport',_0x367d81['message'],_0x271e8c);_0x2792ba(_0x2f27d[_0x283c('0xc')](0x1f4,_0x367d81[_0x283c('0xe')]));});});};exports[_0x283c('0x19')]=function(_0x1ba722){var _0xe6fe45=this;return new Promise(function(_0x552789,_0x882034){return db[_0x283c('0x12')][_0x283c('0x1a')](_0x1ba722[_0x283c('0x14')],{'raw':_0x1ba722[_0x283c('0x15')]?_0x1ba722[_0x283c('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ba722[_0x283c('0x15')]?_0x1ba722[_0x283c('0x15')]['where']||null:null,'attributes':_0x1ba722[_0x283c('0x15')]?_0x1ba722['options']['attributes']||null:null,'limit':_0x1ba722[_0x283c('0x15')]?_0x1ba722['options'][_0x283c('0x1b')]||null:null})[_0x283c('0x17')](function(_0x34feee){logger[_0x283c('0x7')](_0x283c('0x19'),_0x1ba722);logger[_0x283c('0x9')](_0x283c('0x19'),_0x1ba722,JSON['stringify'](_0x34feee));_0x552789(_0x34feee);})['catch'](function(_0x5c3c31){logger['error']('UpdateSquareReport',_0x5c3c31[_0x283c('0xe')],_0x1ba722);_0x882034(_0xe6fe45[_0x283c('0xc')](0x1f4,_0x5c3c31[_0x283c('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0e93e8c..08c6648 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 _0xede6=['/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe'];(function(_0x2540d5,_0x4b3f3a){var _0x9af246=function(_0x46482a){while(--_0x46482a){_0x2540d5['push'](_0x2540d5['shift']());}};_0x9af246(++_0x4b3f3a);}(_0xede6,0xc5));var _0x6ede=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xede6[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x6ede('0x0'));var util=require(_0x6ede('0x1'));var path=require('path');var timeout=require(_0x6ede('0x2'));var express=require('express');var router=express[_0x6ede('0x3')]();var fs_extra=require(_0x6ede('0x4'));var auth=require(_0x6ede('0x5'));var interaction=require(_0x6ede('0x6'));var config=require(_0x6ede('0x7'));var controller=require(_0x6ede('0x8'));router['get']('/',auth[_0x6ede('0x9')](),controller[_0x6ede('0xa')]);router[_0x6ede('0xb')](_0x6ede('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6ede('0xd'),auth[_0x6ede('0x9')](),controller[_0x6ede('0xe')]);router[_0x6ede('0xf')]('/',auth[_0x6ede('0x9')](),controller[_0x6ede('0x10')]);router[_0x6ede('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6ede('0x12')]);router[_0x6ede('0x13')]('/:id',auth[_0x6ede('0x9')](),controller['destroy']);module[_0x6ede('0x14')]=router; \ No newline at end of file +var _0x5722=['show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated'];(function(_0x574a48,_0x1195e5){var _0x2c685f=function(_0x202666){while(--_0x202666){_0x574a48['push'](_0x574a48['shift']());}};_0x2c685f(++_0x1195e5);}(_0x5722,0x196));var _0x2572=function(_0x92f379,_0x2ec19a){_0x92f379=_0x92f379-0x0;var _0xcd6e7b=_0x5722[_0x92f379];return _0xcd6e7b;};'use strict';var multer=require(_0x2572('0x0'));var util=require(_0x2572('0x1'));var path=require(_0x2572('0x2'));var timeout=require(_0x2572('0x3'));var express=require(_0x2572('0x4'));var router=express[_0x2572('0x5')]();var fs_extra=require(_0x2572('0x6'));var auth=require(_0x2572('0x7'));var interaction=require(_0x2572('0x8'));var config=require(_0x2572('0x9'));var controller=require('./squareReportDetail.controller');router[_0x2572('0xa')]('/',auth['isAuthenticated'](),controller[_0x2572('0xb')]);router[_0x2572('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x2572('0xc')]);router[_0x2572('0xa')]('/:id',auth[_0x2572('0xd')](),controller[_0x2572('0xe')]);router['post']('/',auth[_0x2572('0xd')](),controller['create']);router[_0x2572('0xf')](_0x2572('0x10'),auth[_0x2572('0xd')](),controller[_0x2572('0x11')]);router['delete'](_0x2572('0x10'),auth[_0x2572('0xd')](),controller[_0x2572('0x12')]);module[_0x2572('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index a3c81b9..d1259fd 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 _0x8375=['TEXT','STRING','sequelize','exports'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x8375,0x1b6));var _0x5837=function(_0xf6625a,_0x41fb3f){_0xf6625a=_0xf6625a-0x0;var _0x33cae8=_0x8375[_0xf6625a];return _0x33cae8;};'use strict';var Sequelize=require(_0x5837('0x0'));module[_0x5837('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x5837('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5837('0x3')]}}; \ No newline at end of file +var _0x91e3=['exports','STRING'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0x91e3,0x1d2));var _0x391e=function(_0xe323e3,_0x110473){_0xe323e3=_0xe323e3-0x0;var _0x208a43=_0x91e3[_0xe323e3];return _0x208a43;};'use strict';var Sequelize=require('sequelize');module[_0x391e('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x391e('0x1')]},'application':{'type':Sequelize[_0x391e('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x391e('0x1')]},'callerid':{'type':Sequelize[_0x391e('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 7cf3ad6..bc6d0c7 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 _0xab4c=['json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range'];(function(_0x154fd2,_0x285635){var _0x1c20be=function(_0x418d06){while(--_0x418d06){_0x154fd2['push'](_0x154fd2['shift']());}};_0x1c20be(++_0x285635);}(_0xab4c,0x1dc));var _0xcab4=function(_0x2927fd,_0x216cad){_0x2927fd=_0x2927fd-0x0;var _0x3b39cc=_0xab4c[_0x2927fd];return _0x3b39cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcab4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcab4('0x1'));var rp=require(_0xcab4('0x2'));var moment=require(_0xcab4('0x3'));var BPromise=require(_0xcab4('0x4'));var Mustache=require(_0xcab4('0x5'));var util=require(_0xcab4('0x6'));var path=require(_0xcab4('0x7'));var sox=require(_0xcab4('0x8'));var csv=require('to-csv');var ejs=require(_0xcab4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcab4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcab4('0xb'));var deskjs=require(_0xcab4('0xc'));var toCsv=require(_0xcab4('0xd'));var querystring=require(_0xcab4('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcab4('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcab4('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xcab4('0x11'));var config=require(_0xcab4('0x12'));var licenseUtil=require(_0xcab4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c04ce,_0x205f6d){_0x205f6d=_0x205f6d||0xcc;return function(_0x4368f2){if(_0x4368f2){return _0x1c04ce[_0xcab4('0x14')](_0x205f6d);}return _0x1c04ce[_0xcab4('0x15')](_0x205f6d)[_0xcab4('0x16')]();};}function respondWithResult(_0x5dbbea,_0x2c1f69){_0x2c1f69=_0x2c1f69||0xc8;return function(_0x1db04d){if(_0x1db04d){return _0x5dbbea[_0xcab4('0x15')](_0x2c1f69)['json'](_0x1db04d);}};}function respondWithFilteredResult(_0x58aea2,_0x30f9d6){return function(_0x5248ea){if(_0x5248ea){var _0x57c59d=typeof _0x30f9d6[_0xcab4('0x17')]===_0xcab4('0x18')&&typeof _0x30f9d6['limit']===_0xcab4('0x18');var _0x1e0c4e=_0x5248ea[_0xcab4('0x19')];var _0x4c8f38=_0x57c59d?0x0:_0x30f9d6[_0xcab4('0x17')];var _0x383de7=_0x57c59d?_0x5248ea[_0xcab4('0x19')]:_0x30f9d6[_0xcab4('0x17')]+_0x30f9d6[_0xcab4('0x1a')];var _0x1726e1;if(_0x383de7>=_0x1e0c4e){_0x383de7=_0x1e0c4e;_0x1726e1=0xc8;}else{_0x1726e1=0xce;}_0x58aea2[_0xcab4('0x15')](_0x1726e1);return _0x58aea2['set'](_0xcab4('0x1b'),_0x4c8f38+'-'+_0x383de7+'/'+_0x1e0c4e)[_0xcab4('0x1c')](_0x5248ea);}return null;};}function patchUpdates(_0x138715){return function(_0x159d48){try{jsonpatch[_0xcab4('0x1d')](_0x159d48,_0x138715,!![]);}catch(_0x54f8a6){return BPromise[_0xcab4('0x1e')](_0x54f8a6);}return _0x159d48[_0xcab4('0x1f')]();};}function saveUpdates(_0x84a8c3,_0x381557){return function(_0xaa9c6f){if(_0xaa9c6f){return _0xaa9c6f[_0xcab4('0x20')](_0x84a8c3)[_0xcab4('0x21')](function(_0x34bb4a){return _0x34bb4a;});}return null;};}function removeEntity(_0x2070df,_0x3c184e){return function(_0x2a358a){if(_0x2a358a){return _0x2a358a[_0xcab4('0x22')]()[_0xcab4('0x21')](function(){_0x2070df[_0xcab4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x183c56,_0x6910aa){return function(_0xf2a72){if(!_0xf2a72){_0x183c56['sendStatus'](0x194);}return _0xf2a72;};}function handleError(_0x2fc924,_0x349a17){_0x349a17=_0x349a17||0x1f4;return function(_0x81671d){logger[_0xcab4('0x23')](_0x81671d[_0xcab4('0x24')]);if(_0x81671d['name']){delete _0x81671d[_0xcab4('0x25')];}_0x2fc924[_0xcab4('0x15')](_0x349a17)[_0xcab4('0x26')](_0x81671d);};}exports[_0xcab4('0x27')]=function(_0x2bb408,_0x38645a){var _0x489e58={},_0x5a6187={},_0x4bb051={'count':0x0,'rows':[]};var _0x43f8b3=_[_0xcab4('0x28')](db[_0xcab4('0x29')][_0xcab4('0x2a')],function(_0x57b335){return{'name':_0x57b335[_0xcab4('0x2b')],'type':_0x57b335[_0xcab4('0x2c')][_0xcab4('0x2d')]};});_0x5a6187[_0xcab4('0x2e')]=_[_0xcab4('0x28')](_0x43f8b3,_0xcab4('0x25'));_0x5a6187[_0xcab4('0x2f')]=_[_0xcab4('0x30')](_0x2bb408['query']);_0x5a6187['filters']=_[_0xcab4('0x31')](_0x5a6187['model'],_0x5a6187[_0xcab4('0x2f')]);_0x489e58[_0xcab4('0x32')]=_[_0xcab4('0x31')](_0x5a6187[_0xcab4('0x2e')],qs[_0xcab4('0x33')](_0x2bb408[_0xcab4('0x2f')]['fields']));_0x489e58[_0xcab4('0x32')]=_0x489e58[_0xcab4('0x32')][_0xcab4('0x34')]?_0x489e58[_0xcab4('0x32')]:_0x5a6187[_0xcab4('0x2e')];if(!_0x2bb408[_0xcab4('0x2f')][_0xcab4('0x35')](_0xcab4('0x36'))){_0x489e58[_0xcab4('0x1a')]=qs['limit'](_0x2bb408[_0xcab4('0x2f')][_0xcab4('0x1a')]);_0x489e58[_0xcab4('0x17')]=qs[_0xcab4('0x17')](_0x2bb408[_0xcab4('0x2f')]['offset']);}_0x489e58[_0xcab4('0x37')]=qs['sort'](_0x2bb408[_0xcab4('0x2f')]['sort']);_0x489e58['where']=qs[_0xcab4('0x38')](_['pick'](_0x2bb408[_0xcab4('0x2f')],_0x5a6187[_0xcab4('0x38')]),_0x43f8b3);if(_0x2bb408[_0xcab4('0x2f')][_0xcab4('0x39')]){_0x489e58[_0xcab4('0x3a')]=_[_0xcab4('0x3b')](_0x489e58['where'],{'$or':_[_0xcab4('0x28')](_0x43f8b3,function(_0x841bbe){if(_0x841bbe[_0xcab4('0x2c')]!==_0xcab4('0x3c')){var _0x252c15={};_0x252c15[_0x841bbe[_0xcab4('0x25')]]={'$like':'%'+_0x2bb408[_0xcab4('0x2f')][_0xcab4('0x39')]+'%'};return _0x252c15;}})});}_0x489e58=_['merge']({},_0x489e58,_0x2bb408[_0xcab4('0x3d')]);var _0x30cbe3={'where':_0x489e58[_0xcab4('0x3a')]};return db['SquareDetailsReport'][_0xcab4('0x19')](_0x30cbe3)[_0xcab4('0x21')](function(_0x3c851d){_0x4bb051['count']=_0x3c851d;if(_0x2bb408['query'][_0xcab4('0x3e')]){_0x489e58['include']=[{'all':!![]}];}return db[_0xcab4('0x29')][_0xcab4('0x3f')](_0x489e58);})[_0xcab4('0x21')](function(_0x398b64){_0x4bb051[_0xcab4('0x40')]=_0x398b64;return _0x4bb051;})[_0xcab4('0x21')](respondWithFilteredResult(_0x38645a,_0x489e58))['catch'](handleError(_0x38645a,null));};exports['show']=function(_0x2ee8b7,_0x2f30c9){var _0x5d382d={'raw':!![],'where':{'id':_0x2ee8b7[_0xcab4('0x41')]['id']}},_0x426234={};_0x426234[_0xcab4('0x2e')]=_[_0xcab4('0x30')](db[_0xcab4('0x29')]['rawAttributes']);_0x426234[_0xcab4('0x2f')]=_[_0xcab4('0x30')](_0x2ee8b7['query']);_0x426234['filters']=_[_0xcab4('0x31')](_0x426234[_0xcab4('0x2e')],_0x426234[_0xcab4('0x2f')]);_0x5d382d['attributes']=_['intersection'](_0x426234[_0xcab4('0x2e')],qs[_0xcab4('0x33')](_0x2ee8b7[_0xcab4('0x2f')][_0xcab4('0x33')]));_0x5d382d[_0xcab4('0x32')]=_0x5d382d[_0xcab4('0x32')][_0xcab4('0x34')]?_0x5d382d['attributes']:_0x426234[_0xcab4('0x2e')];if(_0x2ee8b7[_0xcab4('0x2f')]['includeAll']){_0x5d382d[_0xcab4('0x42')]=[{'all':!![]}];}_0x5d382d=_['merge']({},_0x5d382d,_0x2ee8b7[_0xcab4('0x3d')]);return db[_0xcab4('0x29')][_0xcab4('0x43')](_0x5d382d)[_0xcab4('0x21')](handleEntityNotFound(_0x2f30c9,null))[_0xcab4('0x21')](respondWithResult(_0x2f30c9,null))[_0xcab4('0x44')](handleError(_0x2f30c9,null));};exports[_0xcab4('0x45')]=function(_0x37430e,_0x11e55e){return db[_0xcab4('0x29')][_0xcab4('0x45')](_0x37430e[_0xcab4('0x46')],{})[_0xcab4('0x21')](respondWithResult(_0x11e55e,0xc9))['catch'](handleError(_0x11e55e,null));};exports[_0xcab4('0x20')]=function(_0x206ac1,_0x392252){if(_0x206ac1['body']['id']){delete _0x206ac1[_0xcab4('0x46')]['id'];}return db[_0xcab4('0x29')][_0xcab4('0x43')]({'where':{'id':_0x206ac1[_0xcab4('0x41')]['id']}})[_0xcab4('0x21')](handleEntityNotFound(_0x392252,null))[_0xcab4('0x21')](saveUpdates(_0x206ac1[_0xcab4('0x46')],null))[_0xcab4('0x21')](respondWithResult(_0x392252,null))[_0xcab4('0x44')](handleError(_0x392252,null));};exports['destroy']=function(_0x4d9b19,_0x48b224){return db['SquareDetailsReport'][_0xcab4('0x43')]({'where':{'id':_0x4d9b19[_0xcab4('0x41')]['id']}})[_0xcab4('0x21')](handleEntityNotFound(_0x48b224,null))[_0xcab4('0x21')](removeEntity(_0x48b224,null))[_0xcab4('0x44')](handleError(_0x48b224,null));};exports[_0xcab4('0x47')]=function(_0x4bc217,_0x3f8257){return db[_0xcab4('0x29')][_0xcab4('0x47')]()[_0xcab4('0x21')](respondWithResult(_0x3f8257,null))[_0xcab4('0x44')](handleError(_0x3f8257,null));}; \ No newline at end of file +var _0x8532=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','SquareDetailsReport','includeAll','rows','catch','params','rawAttributes','length','include','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','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'];(function(_0x57d3d9,_0x2d605b){var _0x46730c=function(_0x1e7019){while(--_0x1e7019){_0x57d3d9['push'](_0x57d3d9['shift']());}};_0x46730c(++_0x2d605b);}(_0x8532,0xc1));var _0x2853=function(_0x280d83,_0x44b1f9){_0x280d83=_0x280d83-0x0;var _0x10d72f=_0x8532[_0x280d83];return _0x10d72f;};'use strict';var emlformat=require(_0x2853('0x0'));var rimraf=require(_0x2853('0x1'));var zipdir=require(_0x2853('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2853('0x3'));var moment=require('moment');var BPromise=require(_0x2853('0x4'));var Mustache=require(_0x2853('0x5'));var util=require(_0x2853('0x6'));var path=require(_0x2853('0x7'));var sox=require(_0x2853('0x8'));var csv=require(_0x2853('0x9'));var ejs=require(_0x2853('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2853('0xb'));var squel=require('squel');var crypto=require(_0x2853('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2853('0xd'));var Papa=require('papaparse');var Redis=require(_0x2853('0xe'));var authService=require(_0x2853('0xf'));var qs=require(_0x2853('0x10'));var as=require(_0x2853('0x11'));var hardwareService=require(_0x2853('0x12'));var logger=require(_0x2853('0x13'))(_0x2853('0x14'));var utils=require(_0x2853('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2853('0x16'));var db=require(_0x2853('0x17'))['db'];function respondWithStatusCode(_0x5e7f2d,_0x1c1e50){_0x1c1e50=_0x1c1e50||0xcc;return function(_0x264aaf){if(_0x264aaf){return _0x5e7f2d[_0x2853('0x18')](_0x1c1e50);}return _0x5e7f2d[_0x2853('0x19')](_0x1c1e50)[_0x2853('0x1a')]();};}function respondWithResult(_0x1cd9bf,_0x3fd2f1){_0x3fd2f1=_0x3fd2f1||0xc8;return function(_0x2dc6cd){if(_0x2dc6cd){return _0x1cd9bf[_0x2853('0x19')](_0x3fd2f1)[_0x2853('0x1b')](_0x2dc6cd);}};}function respondWithFilteredResult(_0x2c0376,_0x422249){return function(_0xbd7324){if(_0xbd7324){var _0x50823b=typeof _0x422249[_0x2853('0x1c')]===_0x2853('0x1d')&&typeof _0x422249[_0x2853('0x1e')]===_0x2853('0x1d');var _0x3c6d3e=_0xbd7324[_0x2853('0x1f')];var _0x5329cd=_0x50823b?0x0:_0x422249[_0x2853('0x1c')];var _0x17ab34=_0x50823b?_0xbd7324[_0x2853('0x1f')]:_0x422249[_0x2853('0x1c')]+_0x422249[_0x2853('0x1e')];var _0x42adad;if(_0x17ab34>=_0x3c6d3e){_0x17ab34=_0x3c6d3e;_0x42adad=0xc8;}else{_0x42adad=0xce;}_0x2c0376['status'](_0x42adad);return _0x2c0376['set'](_0x2853('0x20'),_0x5329cd+'-'+_0x17ab34+'/'+_0x3c6d3e)[_0x2853('0x1b')](_0xbd7324);}return null;};}function patchUpdates(_0x476c51){return function(_0x4f4546){try{jsonpatch[_0x2853('0x21')](_0x4f4546,_0x476c51,!![]);}catch(_0x163ea4){return BPromise[_0x2853('0x22')](_0x163ea4);}return _0x4f4546[_0x2853('0x23')]();};}function saveUpdates(_0x17c7b0,_0x15d734){return function(_0xf1273e){if(_0xf1273e){return _0xf1273e['update'](_0x17c7b0)[_0x2853('0x24')](function(_0x417387){return _0x417387;});}return null;};}function removeEntity(_0x296e7c,_0x56b5ca){return function(_0x17caf6){if(_0x17caf6){return _0x17caf6['destroy']()['then'](function(){_0x296e7c[_0x2853('0x19')](0xcc)[_0x2853('0x1a')]();});}};}function handleEntityNotFound(_0x46499b,_0x3df19f){return function(_0x1ac095){if(!_0x1ac095){_0x46499b[_0x2853('0x18')](0x194);}return _0x1ac095;};}function handleError(_0x234236,_0x275481){_0x275481=_0x275481||0x1f4;return function(_0x9845d4){logger[_0x2853('0x25')](_0x9845d4[_0x2853('0x26')]);if(_0x9845d4[_0x2853('0x27')]){delete _0x9845d4[_0x2853('0x27')];}_0x234236['status'](_0x275481)[_0x2853('0x28')](_0x9845d4);};}exports[_0x2853('0x29')]=function(_0x59e00a,_0x38ef2f){var _0xbe8c06={},_0x4b53d5={},_0x3209d5={'count':0x0,'rows':[]};var _0x57d004=_[_0x2853('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x1e6eb7){return{'name':_0x1e6eb7['fieldName'],'type':_0x1e6eb7[_0x2853('0x2b')][_0x2853('0x2c')]};});_0x4b53d5['model']=_[_0x2853('0x2a')](_0x57d004,_0x2853('0x27'));_0x4b53d5['query']=_['keys'](_0x59e00a[_0x2853('0x2d')]);_0x4b53d5['filters']=_[_0x2853('0x2e')](_0x4b53d5[_0x2853('0x2f')],_0x4b53d5[_0x2853('0x2d')]);_0xbe8c06[_0x2853('0x30')]=_[_0x2853('0x2e')](_0x4b53d5[_0x2853('0x2f')],qs[_0x2853('0x31')](_0x59e00a['query'][_0x2853('0x31')]));_0xbe8c06[_0x2853('0x30')]=_0xbe8c06['attributes']['length']?_0xbe8c06[_0x2853('0x30')]:_0x4b53d5[_0x2853('0x2f')];if(!_0x59e00a[_0x2853('0x2d')][_0x2853('0x32')](_0x2853('0x33'))){_0xbe8c06[_0x2853('0x1e')]=qs['limit'](_0x59e00a[_0x2853('0x2d')]['limit']);_0xbe8c06['offset']=qs['offset'](_0x59e00a[_0x2853('0x2d')][_0x2853('0x1c')]);}_0xbe8c06['order']=qs[_0x2853('0x34')](_0x59e00a['query'][_0x2853('0x34')]);_0xbe8c06[_0x2853('0x35')]=qs[_0x2853('0x36')](_['pick'](_0x59e00a[_0x2853('0x2d')],_0x4b53d5['filters']),_0x57d004);if(_0x59e00a[_0x2853('0x2d')]['filter']){_0xbe8c06[_0x2853('0x35')]=_[_0x2853('0x37')](_0xbe8c06[_0x2853('0x35')],{'$or':_[_0x2853('0x2a')](_0x57d004,function(_0x4fdc1f){if(_0x4fdc1f[_0x2853('0x2b')]!==_0x2853('0x38')){var _0x5ed42c={};_0x5ed42c[_0x4fdc1f['name']]={'$like':'%'+_0x59e00a[_0x2853('0x2d')][_0x2853('0x39')]+'%'};return _0x5ed42c;}})});}_0xbe8c06=_[_0x2853('0x37')]({},_0xbe8c06,_0x59e00a[_0x2853('0x3a')]);var _0x733b19={'where':_0xbe8c06[_0x2853('0x35')]};return db[_0x2853('0x3b')][_0x2853('0x1f')](_0x733b19)[_0x2853('0x24')](function(_0x2673ed){_0x3209d5[_0x2853('0x1f')]=_0x2673ed;if(_0x59e00a[_0x2853('0x2d')][_0x2853('0x3c')]){_0xbe8c06['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0xbe8c06);})[_0x2853('0x24')](function(_0x5b7b5c){_0x3209d5[_0x2853('0x3d')]=_0x5b7b5c;return _0x3209d5;})[_0x2853('0x24')](respondWithFilteredResult(_0x38ef2f,_0xbe8c06))[_0x2853('0x3e')](handleError(_0x38ef2f,null));};exports['show']=function(_0x1eaf9b,_0x12066c){var _0x7c934e={'raw':!![],'where':{'id':_0x1eaf9b[_0x2853('0x3f')]['id']}},_0x18b3d4={};_0x18b3d4['model']=_['keys'](db[_0x2853('0x3b')][_0x2853('0x40')]);_0x18b3d4['query']=_['keys'](_0x1eaf9b['query']);_0x18b3d4[_0x2853('0x36')]=_[_0x2853('0x2e')](_0x18b3d4[_0x2853('0x2f')],_0x18b3d4[_0x2853('0x2d')]);_0x7c934e[_0x2853('0x30')]=_['intersection'](_0x18b3d4['model'],qs['fields'](_0x1eaf9b['query']['fields']));_0x7c934e[_0x2853('0x30')]=_0x7c934e[_0x2853('0x30')][_0x2853('0x41')]?_0x7c934e[_0x2853('0x30')]:_0x18b3d4[_0x2853('0x2f')];if(_0x1eaf9b[_0x2853('0x2d')][_0x2853('0x3c')]){_0x7c934e[_0x2853('0x42')]=[{'all':!![]}];}_0x7c934e=_['merge']({},_0x7c934e,_0x1eaf9b[_0x2853('0x3a')]);return db[_0x2853('0x3b')][_0x2853('0x43')](_0x7c934e)['then'](handleEntityNotFound(_0x12066c,null))[_0x2853('0x24')](respondWithResult(_0x12066c,null))[_0x2853('0x3e')](handleError(_0x12066c,null));};exports[_0x2853('0x44')]=function(_0x34b09a,_0x2ca2a1){return db[_0x2853('0x3b')][_0x2853('0x44')](_0x34b09a[_0x2853('0x45')],{})[_0x2853('0x24')](respondWithResult(_0x2ca2a1,0xc9))[_0x2853('0x3e')](handleError(_0x2ca2a1,null));};exports[_0x2853('0x46')]=function(_0x19f72c,_0x47fdeb){if(_0x19f72c[_0x2853('0x45')]['id']){delete _0x19f72c[_0x2853('0x45')]['id'];}return db['SquareDetailsReport'][_0x2853('0x43')]({'where':{'id':_0x19f72c[_0x2853('0x3f')]['id']}})[_0x2853('0x24')](handleEntityNotFound(_0x47fdeb,null))[_0x2853('0x24')](saveUpdates(_0x19f72c[_0x2853('0x45')],null))[_0x2853('0x24')](respondWithResult(_0x47fdeb,null))[_0x2853('0x3e')](handleError(_0x47fdeb,null));};exports[_0x2853('0x47')]=function(_0x2b2f98,_0x5d540d){return db[_0x2853('0x3b')][_0x2853('0x43')]({'where':{'id':_0x2b2f98['params']['id']}})[_0x2853('0x24')](handleEntityNotFound(_0x5d540d,null))[_0x2853('0x24')](removeEntity(_0x5d540d,null))[_0x2853('0x3e')](handleError(_0x5d540d,null));};exports[_0x2853('0x48')]=function(_0x1775c8,_0x14fe79){return db[_0x2853('0x3b')]['describe']()[_0x2853('0x24')](respondWithResult(_0x14fe79,null))['catch'](handleError(_0x14fe79,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6eb09a9..4e50562 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 _0xaf75=['SquareDetailsReport','report_square_details','lodash','util','api','bluebird','request-promise','path','./squareReportDetail.attributes','exports','define'];(function(_0x5e2ac7,_0x45265d){var _0x4fb946=function(_0x388b38){while(--_0x388b38){_0x5e2ac7['push'](_0x5e2ac7['shift']());}};_0x4fb946(++_0x45265d);}(_0xaf75,0xe9));var _0x5af7=function(_0x8535b9,_0x6d1665){_0x8535b9=_0x8535b9-0x0;var _0x3e0d00=_0xaf75[_0x8535b9];return _0x3e0d00;};'use strict';var _=require(_0x5af7('0x0'));var util=require(_0x5af7('0x1'));var logger=require('../../config/logger')(_0x5af7('0x2'));var moment=require('moment');var BPromise=require(_0x5af7('0x3'));var rp=require(_0x5af7('0x4'));var fs=require('fs');var path=require(_0x5af7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5af7('0x6'));module[_0x5af7('0x7')]=function(_0x47024d,_0x84c40f){return _0x47024d[_0x5af7('0x8')](_0x5af7('0x9'),attributes,{'tableName':_0x5af7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7533=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x103b6c,_0x1b4505){var _0x9864df=function(_0x58ebe6){while(--_0x58ebe6){_0x103b6c['push'](_0x103b6c['shift']());}};_0x9864df(++_0x1b4505);}(_0x7533,0x1f1));var _0x3753=function(_0x16094e,_0x48d018){_0x16094e=_0x16094e-0x0;var _0x3d9bc5=_0x7533[_0x16094e];return _0x3d9bc5;};'use strict';var _=require(_0x3753('0x0'));var util=require(_0x3753('0x1'));var logger=require(_0x3753('0x2'))(_0x3753('0x3'));var moment=require(_0x3753('0x4'));var BPromise=require('bluebird');var rp=require(_0x3753('0x5'));var fs=require('fs');var path=require(_0x3753('0x6'));var rimraf=require(_0x3753('0x7'));var config=require(_0x3753('0x8'));var attributes=require(_0x3753('0x9'));module[_0x3753('0xa')]=function(_0x3d3170,_0x4a33cb){return _0x3d3170['define']('SquareDetailsReport',attributes,{'tableName':_0x3753('0xb'),'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 dcd59ac..fc660e2 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 _0xf4f4=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x318d39,_0x3d52aa){var _0x509ed7=function(_0x1c8372){while(--_0x1c8372){_0x318d39['push'](_0x318d39['shift']());}};_0x509ed7(++_0x3d52aa);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3a62d3,_0x4fd275){_0x3a62d3=_0x3a62d3-0x0;var _0x138eae=_0xf4f4[_0x3a62d3];return _0x138eae;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}exports[_0x4f4f('0x15')]=function(_0x1245c4){var _0x60ce2=this;return new Promise(function(_0x929a0b,_0x2f9397){return db[_0x4f4f('0x16')][_0x4f4f('0x17')](_0x1245c4['body'],{'raw':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x19')]===undefined?!![]:![]:!![]})[_0x4f4f('0xb')](function(_0x302a79){logger[_0x4f4f('0xc')](_0x4f4f('0x15'),_0x1245c4);logger[_0x4f4f('0xf')](_0x4f4f('0x15'),_0x1245c4,JSON[_0x4f4f('0x1a')](_0x302a79));_0x929a0b(_0x302a79);})[_0x4f4f('0x14')](function(_0x17832f){logger[_0x4f4f('0x11')](_0x4f4f('0x15'),_0x17832f['message'],_0x1245c4);_0x2f9397(_0x60ce2['error'](0x1f4,_0x17832f['message']));});});}; \ No newline at end of file +var _0x4227=['body','options','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x3cd269,_0x228e0f){var _0x55e04b=function(_0xfb1fe2){while(--_0xfb1fe2){_0x3cd269['push'](_0x3cd269['shift']());}};_0x55e04b(++_0x228e0f);}(_0x4227,0x89));var _0x7422=function(_0xc37c04,_0x2d9eb8){_0xc37c04=_0xc37c04-0x0;var _0x24395c=_0x4227[_0xc37c04];return _0x24395c;};'use strict';var _=require(_0x7422('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7422('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7422('0x2'));var db=require(_0x7422('0x3'))['db'];var utils=require(_0x7422('0x4'));var logger=require('../../config/logger')(_0x7422('0x5'));var config=require(_0x7422('0x6'));var jayson=require(_0x7422('0x7'));var client=jayson[_0x7422('0x8')][_0x7422('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b3432,_0xe99299,_0x45ca1a){return new BPromise(function(_0x12965e,_0x599d78){return client[_0x7422('0xa')](_0x2b3432,_0x45ca1a)[_0x7422('0xb')](function(_0x25de34){logger['info'](_0x7422('0xc'),_0xe99299,'request\x20sent');logger[_0x7422('0xd')](_0x7422('0xe'),_0xe99299,_0x7422('0xf'),JSON[_0x7422('0x10')](_0x25de34));if(_0x25de34[_0x7422('0x11')]){if(_0x25de34['error'][_0x7422('0x12')]===0x1f4){logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x25de34[_0x7422('0x11')][_0x7422('0x13')]);return _0x599d78(_0x25de34['error'][_0x7422('0x13')]);}logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x25de34['error'][_0x7422('0x13')]);return _0x12965e(_0x25de34['error'][_0x7422('0x13')]);}else{logger[_0x7422('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x7422('0xf'));_0x12965e(_0x25de34[_0x7422('0x15')][_0x7422('0x13')]);}})[_0x7422('0x16')](function(_0x2946ca){logger[_0x7422('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0xe99299,_0x2946ca);_0x599d78(_0x2946ca);});});}exports[_0x7422('0x17')]=function(_0xa7ff41){var _0x493f59=this;return new Promise(function(_0x30656d,_0x57b8bf){return db[_0x7422('0x18')]['create'](_0xa7ff41[_0x7422('0x19')],{'raw':_0xa7ff41[_0x7422('0x1a')]?_0xa7ff41[_0x7422('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7422('0xb')](function(_0xacaad1){logger[_0x7422('0x14')](_0x7422('0x17'),_0xa7ff41);logger['debug']('CreateSquareDetailsReport',_0xa7ff41,JSON[_0x7422('0x10')](_0xacaad1));_0x30656d(_0xacaad1);})[_0x7422('0x16')](function(_0x20c1e3){logger[_0x7422('0x11')](_0x7422('0x17'),_0x20c1e3[_0x7422('0x13')],_0xa7ff41);_0x57b8bf(_0x493f59[_0x7422('0x11')](0x1f4,_0x20c1e3['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 29ccd7f..11e55c8 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 _0x7f72=['Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x7f72,0x108));var _0x27f7=function(_0x4c6c9f,_0x25c8a9){_0x4c6c9f=_0x4c6c9f-0x0;var _0x31e332=_0x7f72[_0x4c6c9f];return _0x31e332;};'use strict';var express=require('express');var router=express[_0x27f7('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x27f7('0x1'));router[_0x27f7('0x2')]('/',auth['isAuthenticated'](),controller[_0x27f7('0x3')]);router['get'](_0x27f7('0x4'),auth[_0x27f7('0x5')](),controller[_0x27f7('0x6')]);module[_0x27f7('0x7')]=router; \ No newline at end of file +var _0xbc49=['express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','exports'];(function(_0xd7b9bb,_0x21e262){var _0x4930bc=function(_0x5dd040){while(--_0x5dd040){_0xd7b9bb['push'](_0xd7b9bb['shift']());}};_0x4930bc(++_0x21e262);}(_0xbc49,0xc0));var _0x9bc4=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0xbc49[_0x1d5ba8];return _0x1022a2;};'use strict';var express=require(_0x9bc4('0x0'));var router=express[_0x9bc4('0x1')]();var auth=require(_0x9bc4('0x2'));var controller=require('./system.controller');router[_0x9bc4('0x3')]('/',auth[_0x9bc4('0x4')](),controller[_0x9bc4('0x5')]);router[_0x9bc4('0x3')](_0x9bc4('0x6'),auth[_0x9bc4('0x4')](),controller['killProcess']);module[_0x9bc4('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0dcea34..a41dc16 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 _0x33cd=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec'];(function(_0x15d1fc,_0x105861){var _0x4c8629=function(_0x122092){while(--_0x122092){_0x15d1fc['push'](_0x15d1fc['shift']());}};_0x4c8629(++_0x105861);}(_0x33cd,0xba));var _0xd33c=function(_0x52ea16,_0x4dc11b){_0x52ea16=_0x52ea16-0x0;var _0x4b21f0=_0x33cd[_0x52ea16];return _0x4b21f0;};'use strict';var info=require(_0xd33c('0x0'));var exec=require(_0xd33c('0x1'))[_0xd33c('0x2')];var logger=require('../../config/logger')(_0xd33c('0x3'));var util=require(_0xd33c('0x4'));var BPromise=require(_0xd33c('0x5'));var _=require(_0xd33c('0x6'));function handleError(_0x4185fd,_0xe6637d,_0x3ef94c){_0xe6637d=_0xe6637d||0x1f4;return function(_0x2abdb9){logger[_0xd33c('0x7')](_0xd33c('0x8'),_0x3ef94c,_0xe6637d,util[_0xd33c('0x9')](_0x2abdb9,{'showHidden':![],'depth':null}));delete _0x2abdb9[_0xd33c('0xa')];_0x4185fd[_0xd33c('0xb')](_0xe6637d)[_0xd33c('0xc')](_0x2abdb9);};}exports[_0xd33c('0xd')]=function(_0x245735,_0x48ac78){return info['getAllData']()[_0xd33c('0xe')](function(_0x334961){return _0x48ac78['status'](0xc8)[_0xd33c('0xf')](_0x334961);})[_0xd33c('0x10')](function(_0xa63728){return _0x48ac78['status'](0x1f4)[_0xd33c('0xf')](_0xa63728);});};exports[_0xd33c('0x11')]=function(_0xd291ac,_0x450054){var _0x77a463=['components/import/cm'];return new BPromise(function(_0x5ad47b,_0x124f2b){return exec(util['format'](_0xd33c('0x12'),_0xd291ac[_0xd33c('0x13')][_0xd33c('0x14')]),function(_0x5bdf59,_0x30f0d3,_0x63f15f){if(_0x5bdf59){return _0x124f2b(_0x5bdf59);}return _0x5ad47b(_0x30f0d3);});})['then'](function(_0x41d670){var _0x5c54d4=![];var _0x4bf9fc=_0x41d670[_0xd33c('0x15')](/\n/);for(var _0x93dc2d=0x0,_0x3b647a=_0x77a463['length'];_0x93dc2d<_0x3b647a,_0x5c54d4===![];_0x93dc2d+=0x1){if(_0x41d670[_0xd33c('0x16')](_0x77a463[_0x93dc2d])>=0x0){_0x5c54d4=!![];}}if(!_0x5c54d4){throw new Error(util[_0xd33c('0x17')](_0xd33c('0x18'),_0xd291ac['params'][_0xd33c('0x14')]));}process[_0xd33c('0x19')](_0xd291ac[_0xd33c('0x13')][_0xd33c('0x14')],'SIGINT');return _0x450054[_0xd33c('0xb')](0xc8)[_0xd33c('0xf')]({'message':util[_0xd33c('0x17')](_0xd33c('0x1a'),_0xd291ac[_0xd33c('0x13')]['pid'])});})[_0xd33c('0x10')](handleError(_0x450054,null,_0xd33c('0x11')));}; \ No newline at end of file +var _0xf15b=['status','send','getAllData','json','catch','killProcess','components/import/cm','format','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf15b,0xb7));var _0xbf15=function(_0x1ba015,_0x5ddaf6){_0x1ba015=_0x1ba015-0x0;var _0x51af8a=_0xf15b[_0x1ba015];return _0x51af8a;};'use strict';var info=require(_0xbf15('0x0'));var exec=require('child_process')['exec'];var logger=require(_0xbf15('0x1'))(_0xbf15('0x2'));var util=require(_0xbf15('0x3'));var BPromise=require(_0xbf15('0x4'));var _=require(_0xbf15('0x5'));function handleError(_0x5ee456,_0x53a8df,_0x1d577f){_0x53a8df=_0x53a8df||0x1f4;return function(_0x4af781){logger['error'](_0xbf15('0x6'),_0x1d577f,_0x53a8df,util[_0xbf15('0x7')](_0x4af781,{'showHidden':![],'depth':null}));delete _0x4af781[_0xbf15('0x8')];_0x5ee456[_0xbf15('0x9')](_0x53a8df)[_0xbf15('0xa')](_0x4af781);};}exports['index']=function(_0xd004ff,_0x3c9ea9){return info[_0xbf15('0xb')]()['then'](function(_0xbf2c1c){return _0x3c9ea9[_0xbf15('0x9')](0xc8)[_0xbf15('0xc')](_0xbf2c1c);})[_0xbf15('0xd')](function(_0x583e82){return _0x3c9ea9[_0xbf15('0x9')](0x1f4)[_0xbf15('0xc')](_0x583e82);});};exports[_0xbf15('0xe')]=function(_0x166e86,_0xadbcf){var _0x5541e3=[_0xbf15('0xf')];return new BPromise(function(_0x117df3,_0x930c3){return exec(util[_0xbf15('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x166e86[_0xbf15('0x11')][_0xbf15('0x12')]),function(_0xe068e6,_0xcb1618,_0x48e388){if(_0xe068e6){return _0x930c3(_0xe068e6);}return _0x117df3(_0xcb1618);});})[_0xbf15('0x13')](function(_0x39a20e){var _0x454d29=![];var _0xe5ca1=_0x39a20e['split'](/\n/);for(var _0x550b29=0x0,_0x27cf34=_0x5541e3[_0xbf15('0x14')];_0x550b29<_0x27cf34,_0x454d29===![];_0x550b29+=0x1){if(_0x39a20e[_0xbf15('0x15')](_0x5541e3[_0x550b29])>=0x0){_0x454d29=!![];}}if(!_0x454d29){throw new Error(util[_0xbf15('0x10')](_0xbf15('0x16'),_0x166e86[_0xbf15('0x11')]['pid']));}process['kill'](_0x166e86['params'][_0xbf15('0x12')],'SIGINT');return _0xadbcf[_0xbf15('0x9')](0xc8)[_0xbf15('0xc')]({'message':util[_0xbf15('0x10')](_0xbf15('0x17'),_0x166e86[_0xbf15('0x11')][_0xbf15('0x12')])});})['catch'](handleError(_0xadbcf,null,_0xbf15('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c077010..3ef018b 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 _0x28df=['index','get','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x28df,0x1ee));var _0xf28d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x28df[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xf28d('0x0'));var util=require(_0xf28d('0x1'));var path=require(_0xf28d('0x2'));var timeout=require(_0xf28d('0x3'));var express=require(_0xf28d('0x4'));var router=express[_0xf28d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf28d('0x6'));var interaction=require(_0xf28d('0x7'));var config=require('../../config/environment');var controller=require(_0xf28d('0x8'));router['get']('/',auth[_0xf28d('0x9')](),controller[_0xf28d('0xa')]);router[_0xf28d('0xb')](_0xf28d('0xc'),auth[_0xf28d('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf28d('0xd')]);router[_0xf28d('0xe')](_0xf28d('0xc'),auth[_0xf28d('0x9')](),controller['update']);router[_0xf28d('0xf')](_0xf28d('0xc'),auth['isAuthenticated'](),controller[_0xf28d('0x10')]);module[_0xf28d('0x11')]=router; \ No newline at end of file +var _0x9137=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x334619,_0x4d049e){var _0x174dea=function(_0x574705){while(--_0x574705){_0x334619['push'](_0x334619['shift']());}};_0x174dea(++_0x4d049e);}(_0x9137,0x7b));var _0x7913=function(_0x3e6898,_0x25681e){_0x3e6898=_0x3e6898-0x0;var _0x419360=_0x9137[_0x3e6898];return _0x419360;};'use strict';var multer=require(_0x7913('0x0'));var util=require(_0x7913('0x1'));var path=require(_0x7913('0x2'));var timeout=require(_0x7913('0x3'));var express=require('express');var router=express[_0x7913('0x4')]();var fs_extra=require(_0x7913('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7913('0x6'));var config=require(_0x7913('0x7'));var controller=require('./tag.controller');router[_0x7913('0x8')]('/',auth[_0x7913('0x9')](),controller[_0x7913('0xa')]);router[_0x7913('0x8')](_0x7913('0xb'),auth[_0x7913('0x9')](),controller['show']);router[_0x7913('0xc')]('/',auth[_0x7913('0x9')](),controller[_0x7913('0xd')]);router['put'](_0x7913('0xb'),auth[_0x7913('0x9')](),controller[_0x7913('0xe')]);router['delete'](_0x7913('0xb'),auth['isAuthenticated'](),controller[_0x7913('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 106c60c..b62d39d 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 _0x5454=['name'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x5454,0x15b));var _0x4545=function(_0x5b5986,_0x3a30ab){_0x5b5986=_0x5b5986-0x0;var _0x4b9a81=_0x5454[_0x5b5986];return _0x4b9a81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4545('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x93ed=['STRING','name','sequelize','exports'];(function(_0x45226b,_0x5cab97){var _0x38d5e2=function(_0x33cc05){while(--_0x33cc05){_0x45226b['push'](_0x45226b['shift']());}};_0x38d5e2(++_0x5cab97);}(_0x93ed,0xfe));var _0xd93e=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0x93ed[_0x2deac4];return _0x1c0bda;};'use strict';var Sequelize=require(_0xd93e('0x0'));module[_0xd93e('0x1')]={'name':{'type':Sequelize[_0xd93e('0x2')],'unique':_0xd93e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd93e('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xd93e('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4166aad..b8abfec 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 _0x1b73=['map','Tag','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index'];(function(_0x2952a8,_0x6b167b){var _0x43bbe8=function(_0x35d597){while(--_0x35d597){_0x2952a8['push'](_0x2952a8['shift']());}};_0x43bbe8(++_0x6b167b);}(_0x1b73,0x1d5));var _0x31b7=function(_0x54d2d5,_0x3a2aca){_0x54d2d5=_0x54d2d5-0x0;var _0xe378d1=_0x1b73[_0x54d2d5];return _0xe378d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){var _0x35a51f=_0x3b0eff[_0x31b7('0x28')]({'plain':!![]});var _0x2c993b='Tags';return db[_0x31b7('0x29')]['destroy']({'where':{'type':_0x2c993b,'resourceId':_0x35a51f['id']}})[_0x31b7('0x27')](function(){return _0x3b0eff;});})[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0xffacb,_0x128865){return function(_0x21ab03){if(!_0x21ab03){_0xffacb[_0x31b7('0x1a')](0x194);}return _0x21ab03;};}function handleError(_0x4e58e5,_0x47ef33){_0x47ef33=_0x47ef33||0x1f4;return function(_0x503549){logger[_0x31b7('0x2a')](_0x503549[_0x31b7('0x2b')]);if(_0x503549[_0x31b7('0x2c')]){delete _0x503549['name'];}_0x4e58e5[_0x31b7('0x1b')](_0x47ef33)[_0x31b7('0x2d')](_0x503549);};}exports[_0x31b7('0x2e')]=function(_0x277273,_0x58a87e){var _0x5b0ed2={},_0x34c62a={},_0x4b5cf9={'count':0x0,'rows':[]};var _0x574dfe=_[_0x31b7('0x2f')](db[_0x31b7('0x30')][_0x31b7('0x31')],function(_0x35f83c){return{'name':_0x35f83c['fieldName'],'type':_0x35f83c['type'][_0x31b7('0x32')]};});_0x34c62a[_0x31b7('0x33')]=_[_0x31b7('0x2f')](_0x574dfe,_0x31b7('0x2c'));_0x34c62a[_0x31b7('0x34')]=_['keys'](_0x277273['query']);_0x34c62a[_0x31b7('0x35')]=_[_0x31b7('0x36')](_0x34c62a['model'],_0x34c62a[_0x31b7('0x34')]);_0x5b0ed2[_0x31b7('0x37')]=_['intersection'](_0x34c62a[_0x31b7('0x33')],qs[_0x31b7('0x38')](_0x277273[_0x31b7('0x34')][_0x31b7('0x38')]));_0x5b0ed2[_0x31b7('0x37')]=_0x5b0ed2[_0x31b7('0x37')][_0x31b7('0x39')]?_0x5b0ed2[_0x31b7('0x37')]:_0x34c62a[_0x31b7('0x33')];if(!_0x277273[_0x31b7('0x34')][_0x31b7('0x3a')](_0x31b7('0x3b'))){_0x5b0ed2[_0x31b7('0x1e')]=qs['limit'](_0x277273['query'][_0x31b7('0x1e')]);_0x5b0ed2[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x277273[_0x31b7('0x34')][_0x31b7('0x20')]);}_0x5b0ed2[_0x31b7('0x3c')]=qs[_0x31b7('0x3d')](_0x277273[_0x31b7('0x34')][_0x31b7('0x3d')]);_0x5b0ed2[_0x31b7('0x3e')]=qs['filters'](_[_0x31b7('0x3f')](_0x277273[_0x31b7('0x34')],_0x34c62a[_0x31b7('0x35')]),_0x574dfe);if(_0x277273[_0x31b7('0x34')]['filter']){_0x5b0ed2[_0x31b7('0x3e')]=_[_0x31b7('0x40')](_0x5b0ed2['where'],{'$or':_[_0x31b7('0x2f')](_0x574dfe,function(_0x5724fa){if(_0x5724fa['type']!==_0x31b7('0x41')){var _0x10e82c={};_0x10e82c[_0x5724fa[_0x31b7('0x2c')]]={'$like':'%'+_0x277273[_0x31b7('0x34')][_0x31b7('0x42')]+'%'};return _0x10e82c;}})});}_0x5b0ed2=_['merge']({},_0x5b0ed2,_0x277273[_0x31b7('0x43')]);var _0x5d01ee={'where':_0x5b0ed2['where']};return db['Tag'][_0x31b7('0x1f')](_0x5d01ee)[_0x31b7('0x27')](function(_0x1527b3){_0x4b5cf9[_0x31b7('0x1f')]=_0x1527b3;if(_0x277273[_0x31b7('0x34')]['includeAll']){_0x5b0ed2[_0x31b7('0x44')]=[{'all':!![]}];}return db['Tag'][_0x31b7('0x45')](_0x5b0ed2);})[_0x31b7('0x27')](function(_0x41c92e){_0x4b5cf9[_0x31b7('0x46')]=_0x41c92e;return _0x4b5cf9;})['then'](respondWithFilteredResult(_0x58a87e,_0x5b0ed2))[_0x31b7('0x47')](handleError(_0x58a87e,null));};exports[_0x31b7('0x48')]=function(_0x1046fb,_0x4b3d24){var _0x31fd89={'raw':!![],'where':{'id':_0x1046fb[_0x31b7('0x49')]['id']}},_0x51918d={};_0x51918d[_0x31b7('0x33')]=_['keys'](db[_0x31b7('0x30')][_0x31b7('0x31')]);_0x51918d[_0x31b7('0x34')]=_[_0x31b7('0x4a')](_0x1046fb['query']);_0x51918d[_0x31b7('0x35')]=_['intersection'](_0x51918d['model'],_0x51918d[_0x31b7('0x34')]);_0x31fd89[_0x31b7('0x37')]=_[_0x31b7('0x36')](_0x51918d[_0x31b7('0x33')],qs['fields'](_0x1046fb[_0x31b7('0x34')][_0x31b7('0x38')]));_0x31fd89['attributes']=_0x31fd89[_0x31b7('0x37')][_0x31b7('0x39')]?_0x31fd89[_0x31b7('0x37')]:_0x51918d['model'];if(_0x1046fb[_0x31b7('0x34')][_0x31b7('0x4b')]){_0x31fd89[_0x31b7('0x44')]=[{'all':!![]}];}_0x31fd89=_[_0x31b7('0x40')]({},_0x31fd89,_0x1046fb[_0x31b7('0x43')]);return db[_0x31b7('0x30')][_0x31b7('0x4c')](_0x31fd89)[_0x31b7('0x27')](handleEntityNotFound(_0x4b3d24,null))['then'](respondWithResult(_0x4b3d24,null))[_0x31b7('0x47')](handleError(_0x4b3d24,null));};exports['create']=function(_0x5a72ee,_0x22cc77){return db[_0x31b7('0x30')][_0x31b7('0x4d')](_0x5a72ee[_0x31b7('0x4e')],{})['then'](function(_0x322798){var _0x18556b=_0x5a72ee[_0x31b7('0x4f')]['get']({'plain':!![]});if(!_0x18556b)throw new Error(_0x31b7('0x50'));if(_0x18556b[_0x31b7('0x51')]===_0x31b7('0x4f')){var _0x3b5868=_0x322798[_0x31b7('0x28')]({'plain':!![]});var _0x309077=_0x31b7('0x52');return db[_0x31b7('0x53')]['find']({'where':{'name':_0x309077,'userProfileId':_0x18556b['userProfileId']},'raw':!![]})[_0x31b7('0x27')](function(_0x1d55e6){if(_0x1d55e6&&_0x1d55e6[_0x31b7('0x54')]===0x0){return db[_0x31b7('0x29')]['create']({'name':_0x3b5868['name'],'resourceId':_0x3b5868['id'],'type':_0x1d55e6[_0x31b7('0x2c')],'sectionId':_0x1d55e6['id']},{})[_0x31b7('0x27')](function(){return _0x322798;});}else{return _0x322798;}})[_0x31b7('0x47')](function(_0x5ea605){logger[_0x31b7('0x2a')](_0x31b7('0x55'),_0x5ea605);throw _0x5ea605;});}return _0x322798;})[_0x31b7('0x27')](respondWithResult(_0x22cc77,0xc9))[_0x31b7('0x47')](handleError(_0x22cc77,null));};exports['update']=function(_0x535a3c,_0x43c1ee){if(_0x535a3c[_0x31b7('0x4e')]['id']){delete _0x535a3c[_0x31b7('0x4e')]['id'];}return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x535a3c[_0x31b7('0x49')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x43c1ee,null))[_0x31b7('0x27')](saveUpdates(_0x535a3c[_0x31b7('0x4e')],null))[_0x31b7('0x27')](respondWithResult(_0x43c1ee,null))['catch'](handleError(_0x43c1ee,null));};exports['destroy']=function(_0x4bd00d,_0x954c){return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x4bd00d['params']['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x954c,null))[_0x31b7('0x27')](removeEntity(_0x954c,null))[_0x31b7('0x47')](handleError(_0x954c,null));}; \ No newline at end of file +var _0x9c5e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x10a432,_0x2df09d){var _0x319783=function(_0x4d32bd){while(--_0x4d32bd){_0x10a432['push'](_0x10a432['shift']());}};_0x319783(++_0x2df09d);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x477d49,_0x225e2d){_0x477d49=_0x477d49-0x0;var _0x275eef=_0x9c5e[_0x477d49];return _0x275eef;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){var _0x1cd9c4=_0x245161[_0xe9c5('0x28')]({'plain':!![]});var _0x5a3caa='Tags';return db[_0xe9c5('0x29')][_0xe9c5('0x27')]({'where':{'type':_0x5a3caa,'resourceId':_0x1cd9c4['id']}})[_0xe9c5('0x26')](function(){return _0x245161;});})[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x2a')]();});}};}function handleEntityNotFound(_0x493108,_0x2c3fcb){return function(_0x480187){if(!_0x480187){_0x493108[_0xe9c5('0x19')](0x194);}return _0x480187;};}function handleError(_0x50256b,_0x4fa0c2){_0x4fa0c2=_0x4fa0c2||0x1f4;return function(_0x2112a6){logger['error'](_0x2112a6[_0xe9c5('0x2b')]);if(_0x2112a6[_0xe9c5('0x2c')]){delete _0x2112a6[_0xe9c5('0x2c')];}_0x50256b[_0xe9c5('0x1a')](_0x4fa0c2)[_0xe9c5('0x2d')](_0x2112a6);};}exports['index']=function(_0xe3464c,_0x4fcabd){var _0x46d3e6={},_0x5088a6={},_0x348fee={'count':0x0,'rows':[]};var _0x32e267=_[_0xe9c5('0x2e')](db[_0xe9c5('0x2f')][_0xe9c5('0x30')],function(_0x4e6043){return{'name':_0x4e6043[_0xe9c5('0x31')],'type':_0x4e6043[_0xe9c5('0x32')][_0xe9c5('0x33')]};});_0x5088a6[_0xe9c5('0x34')]=_[_0xe9c5('0x2e')](_0x32e267,'name');_0x5088a6['query']=_[_0xe9c5('0x35')](_0xe3464c[_0xe9c5('0x36')]);_0x5088a6[_0xe9c5('0x37')]=_[_0xe9c5('0x38')](_0x5088a6[_0xe9c5('0x34')],_0x5088a6[_0xe9c5('0x36')]);_0x46d3e6[_0xe9c5('0x39')]=_[_0xe9c5('0x38')](_0x5088a6['model'],qs[_0xe9c5('0x3a')](_0xe3464c[_0xe9c5('0x36')]['fields']));_0x46d3e6[_0xe9c5('0x39')]=_0x46d3e6['attributes'][_0xe9c5('0x3b')]?_0x46d3e6[_0xe9c5('0x39')]:_0x5088a6[_0xe9c5('0x34')];if(!_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x3c')](_0xe9c5('0x3d'))){_0x46d3e6[_0xe9c5('0x1d')]=qs[_0xe9c5('0x1d')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x1d')]);_0x46d3e6[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x1f')]);}_0x46d3e6[_0xe9c5('0x3e')]=qs[_0xe9c5('0x3f')](_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x3f')]);_0x46d3e6[_0xe9c5('0x40')]=qs['filters'](_[_0xe9c5('0x41')](_0xe3464c[_0xe9c5('0x36')],_0x5088a6[_0xe9c5('0x37')]),_0x32e267);if(_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x42')]){_0x46d3e6[_0xe9c5('0x40')]=_['merge'](_0x46d3e6[_0xe9c5('0x40')],{'$or':_[_0xe9c5('0x2e')](_0x32e267,function(_0x3a8be8){if(_0x3a8be8['type']!==_0xe9c5('0x43')){var _0x1bf7c5={};_0x1bf7c5[_0x3a8be8[_0xe9c5('0x2c')]]={'$like':'%'+_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x42')]+'%'};return _0x1bf7c5;}})});}_0x46d3e6=_[_0xe9c5('0x44')]({},_0x46d3e6,_0xe3464c[_0xe9c5('0x45')]);var _0x1fdf92={'where':_0x46d3e6[_0xe9c5('0x40')]};return db[_0xe9c5('0x2f')][_0xe9c5('0x1e')](_0x1fdf92)['then'](function(_0x51dd18){_0x348fee[_0xe9c5('0x1e')]=_0x51dd18;if(_0xe3464c[_0xe9c5('0x36')][_0xe9c5('0x46')]){_0x46d3e6[_0xe9c5('0x47')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x46d3e6);})[_0xe9c5('0x26')](function(_0x144e85){_0x348fee['rows']=_0x144e85;return _0x348fee;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x4fcabd,_0x46d3e6))['catch'](handleError(_0x4fcabd,null));};exports['show']=function(_0x5c395d,_0x3c7e42){var _0x232ab0={'raw':!![],'where':{'id':_0x5c395d[_0xe9c5('0x48')]['id']}},_0x1d081a={};_0x1d081a['model']=_[_0xe9c5('0x35')](db[_0xe9c5('0x2f')][_0xe9c5('0x30')]);_0x1d081a[_0xe9c5('0x36')]=_[_0xe9c5('0x35')](_0x5c395d[_0xe9c5('0x36')]);_0x1d081a[_0xe9c5('0x37')]=_[_0xe9c5('0x38')](_0x1d081a['model'],_0x1d081a[_0xe9c5('0x36')]);_0x232ab0[_0xe9c5('0x39')]=_[_0xe9c5('0x38')](_0x1d081a[_0xe9c5('0x34')],qs[_0xe9c5('0x3a')](_0x5c395d[_0xe9c5('0x36')]['fields']));_0x232ab0['attributes']=_0x232ab0['attributes']['length']?_0x232ab0[_0xe9c5('0x39')]:_0x1d081a[_0xe9c5('0x34')];if(_0x5c395d[_0xe9c5('0x36')]['includeAll']){_0x232ab0[_0xe9c5('0x47')]=[{'all':!![]}];}_0x232ab0=_[_0xe9c5('0x44')]({},_0x232ab0,_0x5c395d[_0xe9c5('0x45')]);return db[_0xe9c5('0x2f')][_0xe9c5('0x49')](_0x232ab0)[_0xe9c5('0x26')](handleEntityNotFound(_0x3c7e42,null))['then'](respondWithResult(_0x3c7e42,null))[_0xe9c5('0x4a')](handleError(_0x3c7e42,null));};exports[_0xe9c5('0x4b')]=function(_0x1da6a3,_0x249940){return db['Tag'][_0xe9c5('0x4b')](_0x1da6a3[_0xe9c5('0x4c')],{})[_0xe9c5('0x26')](function(_0x2d68be){var _0x38396f=_0x1da6a3[_0xe9c5('0x4d')]['get']({'plain':!![]});if(!_0x38396f)throw new Error(_0xe9c5('0x4e'));if(_0x38396f[_0xe9c5('0x4f')]===_0xe9c5('0x4d')){var _0x9d0154=_0x2d68be['get']({'plain':!![]});var _0x375f60=_0xe9c5('0x50');return db[_0xe9c5('0x51')][_0xe9c5('0x49')]({'where':{'name':_0x375f60,'userProfileId':_0x38396f[_0xe9c5('0x52')]},'raw':!![]})[_0xe9c5('0x26')](function(_0x581f8f){if(_0x581f8f&&_0x581f8f['autoAssociation']===0x0){return db[_0xe9c5('0x29')][_0xe9c5('0x4b')]({'name':_0x9d0154[_0xe9c5('0x2c')],'resourceId':_0x9d0154['id'],'type':_0x581f8f[_0xe9c5('0x2c')],'sectionId':_0x581f8f['id']},{})[_0xe9c5('0x26')](function(){return _0x2d68be;});}else{return _0x2d68be;}})[_0xe9c5('0x4a')](function(_0x2a9260){logger[_0xe9c5('0x53')](_0xe9c5('0x54'),_0x2a9260);throw _0x2a9260;});}return _0x2d68be;})[_0xe9c5('0x26')](respondWithResult(_0x249940,0xc9))[_0xe9c5('0x4a')](handleError(_0x249940,null));};exports[_0xe9c5('0x25')]=function(_0x2086fd,_0x3cd72b){if(_0x2086fd[_0xe9c5('0x4c')]['id']){delete _0x2086fd[_0xe9c5('0x4c')]['id'];}return db['Tag']['find']({'where':{'id':_0x2086fd['params']['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x3cd72b,null))[_0xe9c5('0x26')](saveUpdates(_0x2086fd[_0xe9c5('0x4c')],null))['then'](respondWithResult(_0x3cd72b,null))[_0xe9c5('0x4a')](handleError(_0x3cd72b,null));};exports['destroy']=function(_0x227370,_0xbac8ef){return db[_0xe9c5('0x2f')][_0xe9c5('0x49')]({'where':{'id':_0x227370[_0xe9c5('0x48')]['id']}})['then'](handleEntityNotFound(_0xbac8ef,null))[_0xe9c5('0x26')](removeEntity(_0xbac8ef,null))[_0xe9c5('0x4a')](handleError(_0xbac8ef,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 60d96a6..95d6d65 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 _0x1d60=['bluebird','request-promise','path','rimraf','./tag.attributes','Tag','tools_tags','api','moment'];(function(_0x1a20ec,_0x27626c){var _0x3a2ec1=function(_0xb45d54){while(--_0xb45d54){_0x1a20ec['push'](_0x1a20ec['shift']());}};_0x3a2ec1(++_0x27626c);}(_0x1d60,0xe8));var _0x01d6=function(_0x558739,_0x477b65){_0x558739=_0x558739-0x0;var _0x1ef7bc=_0x1d60[_0x558739];return _0x1ef7bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x01d6('0x0'));var moment=require(_0x01d6('0x1'));var BPromise=require(_0x01d6('0x2'));var rp=require(_0x01d6('0x3'));var fs=require('fs');var path=require(_0x01d6('0x4'));var rimraf=require(_0x01d6('0x5'));var config=require('../../config/environment');var attributes=require(_0x01d6('0x6'));module['exports']=function(_0x1cee6b,_0xd09b99){return _0x1cee6b['define'](_0x01d6('0x7'),attributes,{'tableName':_0x01d6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cc3=['request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','api','bluebird'];(function(_0x43d396,_0x350864){var _0x46a959=function(_0x522dcf){while(--_0x522dcf){_0x43d396['push'](_0x43d396['shift']());}};_0x46a959(++_0x350864);}(_0x0cc3,0x195));var _0x30cc=function(_0x156000,_0x105867){_0x156000=_0x156000-0x0;var _0x2ece08=_0x0cc3[_0x156000];return _0x2ece08;};'use strict';var _=require(_0x30cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30cc('0x1'));var moment=require('moment');var BPromise=require(_0x30cc('0x2'));var rp=require(_0x30cc('0x3'));var fs=require('fs');var path=require(_0x30cc('0x4'));var rimraf=require(_0x30cc('0x5'));var config=require(_0x30cc('0x6'));var attributes=require(_0x30cc('0x7'));module[_0x30cc('0x8')]=function(_0x56b7b6,_0x255ccf){return _0x56b7b6[_0x30cc('0x9')](_0x30cc('0xa'),attributes,{'tableName':_0x30cc('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 41345d9..7a7e382 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 _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x39a279,_0x3b70e8){var _0x58447a=function(_0x4e6693){while(--_0x4e6693){_0x39a279['push'](_0x39a279['shift']());}};_0x58447a(++_0x3b70e8);}(_0x68fc,0xa5));var _0xc68f=function(_0x3e9919,_0x50d268){_0x3e9919=_0x3e9919-0x0;var _0x3eeb0c=_0x68fc[_0x3e9919];return _0x3eeb0c;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file +var _0x9099=['../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x69a748,_0x7e2ee1){var _0x116db0=function(_0x67e3ab){while(--_0x67e3ab){_0x69a748['push'](_0x69a748['shift']());}};_0x116db0(++_0x7e2ee1);}(_0x9099,0x1ac));var _0x9909=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x9099[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var moment=require(_0x9909('0x1'));var BPromise=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var fs=require('fs');var Redis=require(_0x9909('0x4'));var db=require(_0x9909('0x5'))['db'];var utils=require(_0x9909('0x6'));var logger=require(_0x9909('0x7'))(_0x9909('0x8'));var config=require(_0x9909('0x9'));var jayson=require(_0x9909('0xa'));var client=jayson[_0x9909('0xb')][_0x9909('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b7391,_0x3dc2dd,_0x54011f){return new BPromise(function(_0x6d755a,_0x5dcd39){return client['request'](_0x3b7391,_0x54011f)['then'](function(_0x5023b7){logger[_0x9909('0xd')]('Tag,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));logger[_0x9909('0xf')](_0x9909('0x10'),_0x3dc2dd,'request\x20sent',JSON[_0x9909('0x11')](_0x5023b7));if(_0x5023b7['error']){if(_0x5023b7[_0x9909('0x12')][_0x9909('0x13')]===0x1f4){logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x5dcd39(_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);}logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x6d755a(_0x5023b7[_0x9909('0x12')]['message']);}else{logger[_0x9909('0xd')]('Tag,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));_0x6d755a(_0x5023b7['result'][_0x9909('0x15')]);}})[_0x9909('0x16')](function(_0x245f0d){logger['error'](_0x9909('0x14'),_0x3dc2dd,_0x245f0d);_0x5dcd39(_0x245f0d);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 021e96d..f722078 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 f79570d..38352db 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xb7e7[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xc4697c,_0x5dbb75){var _0x380944=function(_0x5680ba){while(--_0x5680ba){_0xc4697c['push'](_0xc4697c['shift']());}};_0x380944(++_0x5dbb75);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 51262a9..0cd54a8 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 _0x3a93=['include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','QueryTypes','SELECT','UserId','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','Sequelize','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','end','send','getQueues','channel','isValidChannel','ValidationError','capitalize','Queue','order','Queues','findOne','Unknown\x20channel','add','toLowerCase','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','format','all','UserVoicePrefix','spread','Queue:remove','UserVoiceQueueRt','removeAgents','getAgents','filter','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','name','index','map','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','options','Team'];(function(_0x2bb3c2,_0x58aa3a){var _0x269cdd=function(_0x59dd99){while(--_0x59dd99){_0x2bb3c2['push'](_0x2bb3c2['shift']());}};_0x269cdd(++_0x58aa3a);}(_0x3a93,0x185));var _0x33a9=function(_0x2c64f3,_0x1fbf4d){_0x2c64f3=_0x2c64f3-0x0;var _0x292ee6=_0x3a93[_0x2c64f3];return _0x292ee6;};'use strict';var emlformat=require(_0x33a9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33a9('0x1'));var rp=require(_0x33a9('0x2'));var moment=require('moment');var BPromise=require(_0x33a9('0x3'));var Mustache=require(_0x33a9('0x4'));var util=require('util');var path=require(_0x33a9('0x5'));var sox=require(_0x33a9('0x6'));var csv=require('to-csv');var ejs=require(_0x33a9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x33a9('0x8'));var crypto=require(_0x33a9('0x9'));var jsforce=require(_0x33a9('0xa'));var deskjs=require(_0x33a9('0xb'));var toCsv=require(_0x33a9('0xc'));var querystring=require('querystring');var Papa=require(_0x33a9('0xd'));var Redis=require(_0x33a9('0xe'));var authService=require(_0x33a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x33a9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33a9('0x11'))(_0x33a9('0x12'));var utils=require('../../config/utils');var config=require(_0x33a9('0x13'));var licenseUtil=require(_0x33a9('0x14'));var db=require('../../mysqldb')['db'];config[_0x33a9('0x15')]=_['defaults'](config['redis'],{'host':_0x33a9('0x16'),'port':0x18eb});var socket=require(_0x33a9('0x17'))(new Redis(config[_0x33a9('0x15')]));require('./team.socket')[_0x33a9('0x18')](socket);function respondWithStatusCode(_0x3b7c98,_0x4d3f32){_0x4d3f32=_0x4d3f32||0xcc;return function(_0x26aca7){if(_0x26aca7){return _0x3b7c98[_0x33a9('0x19')](_0x4d3f32);}return _0x3b7c98[_0x33a9('0x1a')](_0x4d3f32)['end']();};}function respondWithResult(_0x826df4,_0x5a741d){_0x5a741d=_0x5a741d||0xc8;return function(_0xfc10c5){if(_0xfc10c5){return _0x826df4[_0x33a9('0x1a')](_0x5a741d)['json'](_0xfc10c5);}};}function respondWithFilteredResult(_0x5010dc,_0x40fb52){return function(_0x981e1a){if(_0x981e1a){var _0x5e5841=typeof _0x40fb52[_0x33a9('0x1b')]===_0x33a9('0x1c')&&typeof _0x40fb52[_0x33a9('0x1d')]==='undefined';var _0x1ea018=_0x981e1a[_0x33a9('0x1e')];var _0x11666d=_0x5e5841?0x0:_0x40fb52[_0x33a9('0x1b')];var _0x442a20=_0x5e5841?_0x981e1a['count']:_0x40fb52[_0x33a9('0x1b')]+_0x40fb52['limit'];var _0x71ca86;if(_0x442a20>=_0x1ea018){_0x442a20=_0x1ea018;_0x71ca86=0xc8;}else{_0x71ca86=0xce;}_0x5010dc[_0x33a9('0x1a')](_0x71ca86);return _0x5010dc[_0x33a9('0x1f')](_0x33a9('0x20'),_0x11666d+'-'+_0x442a20+'/'+_0x1ea018)[_0x33a9('0x21')](_0x981e1a);}return null;};}function patchUpdates(_0x42ff0f){return function(_0x48edeb){try{jsonpatch[_0x33a9('0x22')](_0x48edeb,_0x42ff0f,!![]);}catch(_0x286887){return BPromise['reject'](_0x286887);}return _0x48edeb[_0x33a9('0x23')]();};}function saveUpdates(_0x28769b,_0x156a0c){return function(_0x42f9e5){if(_0x42f9e5){return _0x42f9e5['update'](_0x28769b)[_0x33a9('0x24')](function(_0x219fea){return _0x219fea;});}return null;};}function handleEntityNotFound(_0x5ecfbf,_0x34a80e){return function(_0x500be9){if(!_0x500be9){_0x5ecfbf[_0x33a9('0x19')](0x194);}return _0x500be9;};}function handleError(_0x4b8c8f,_0x4c333a){_0x4c333a=_0x4c333a||0x1f4;return function(_0x48a7a3){logger[_0x33a9('0x25')](_0x48a7a3['stack']);if(_0x48a7a3[_0x33a9('0x26')]){delete _0x48a7a3[_0x33a9('0x26')];}_0x4b8c8f[_0x33a9('0x1a')](_0x4c333a)['send'](_0x48a7a3);};}exports[_0x33a9('0x27')]=function(_0x1f79fe,_0x33153f){var _0x970aba={},_0x91f6b7={},_0x44c50b={'count':0x0,'rows':[]};var _0x27a7ef=_[_0x33a9('0x28')](db['Team'][_0x33a9('0x29')],function(_0x3a7dac){return{'name':_0x3a7dac[_0x33a9('0x2a')],'type':_0x3a7dac['type']['key']};});_0x91f6b7['model']=_['map'](_0x27a7ef,_0x33a9('0x26'));_0x91f6b7[_0x33a9('0x2b')]=_[_0x33a9('0x2c')](_0x1f79fe[_0x33a9('0x2b')]);_0x91f6b7['filters']=_[_0x33a9('0x2d')](_0x91f6b7[_0x33a9('0x2e')],_0x91f6b7[_0x33a9('0x2b')]);_0x970aba[_0x33a9('0x2f')]=_[_0x33a9('0x2d')](_0x91f6b7[_0x33a9('0x2e')],qs['fields'](_0x1f79fe[_0x33a9('0x2b')][_0x33a9('0x30')]));_0x970aba[_0x33a9('0x2f')]=_0x970aba[_0x33a9('0x2f')][_0x33a9('0x31')]?_0x970aba[_0x33a9('0x2f')]:_0x91f6b7[_0x33a9('0x2e')];if(!_0x1f79fe[_0x33a9('0x2b')][_0x33a9('0x32')](_0x33a9('0x33'))){_0x970aba[_0x33a9('0x1d')]=qs[_0x33a9('0x1d')](_0x1f79fe[_0x33a9('0x2b')][_0x33a9('0x1d')]);_0x970aba['offset']=qs[_0x33a9('0x1b')](_0x1f79fe[_0x33a9('0x2b')][_0x33a9('0x1b')]);}_0x970aba['order']=qs[_0x33a9('0x34')](_0x1f79fe[_0x33a9('0x2b')][_0x33a9('0x34')]);_0x970aba[_0x33a9('0x35')]=qs[_0x33a9('0x36')](_[_0x33a9('0x37')](_0x1f79fe['query'],_0x91f6b7[_0x33a9('0x36')]),_0x27a7ef);if(_0x1f79fe[_0x33a9('0x2b')]['filter']){_0x970aba[_0x33a9('0x35')]=_[_0x33a9('0x38')](_0x970aba[_0x33a9('0x35')],{'$or':_[_0x33a9('0x28')](_0x27a7ef,function(_0x5a4e31){if(_0x5a4e31[_0x33a9('0x39')]!==_0x33a9('0x3a')){var _0x5b8838={};_0x5b8838[_0x5a4e31['name']]={'$like':'%'+_0x1f79fe[_0x33a9('0x2b')]['filter']+'%'};return _0x5b8838;}})});}_0x970aba=_[_0x33a9('0x38')]({},_0x970aba,_0x1f79fe[_0x33a9('0x3b')]);var _0x301636={'where':_0x970aba[_0x33a9('0x35')]};return db[_0x33a9('0x3c')][_0x33a9('0x1e')](_0x301636)[_0x33a9('0x24')](function(_0x282e28){_0x44c50b[_0x33a9('0x1e')]=_0x282e28;if(_0x1f79fe['query']['includeAll']){_0x970aba[_0x33a9('0x3d')]=[{'all':!![]}];}return db[_0x33a9('0x3c')][_0x33a9('0x3e')](_0x970aba);})['then'](function(_0x2406d8){_0x44c50b[_0x33a9('0x3f')]=_0x2406d8;return _0x44c50b;})[_0x33a9('0x24')](respondWithFilteredResult(_0x33153f,_0x970aba))[_0x33a9('0x40')](handleError(_0x33153f,null));};exports['show']=function(_0x5d0ae1,_0x26e6c5){var _0x59c1a6={'raw':![],'where':{'id':_0x5d0ae1[_0x33a9('0x41')]['id']}},_0x163cd6={};_0x163cd6[_0x33a9('0x2e')]=_[_0x33a9('0x2c')](db[_0x33a9('0x3c')][_0x33a9('0x29')]);_0x163cd6[_0x33a9('0x2b')]=_[_0x33a9('0x2c')](_0x5d0ae1[_0x33a9('0x2b')]);_0x163cd6[_0x33a9('0x36')]=_[_0x33a9('0x2d')](_0x163cd6['model'],_0x163cd6[_0x33a9('0x2b')]);_0x59c1a6[_0x33a9('0x2f')]=_[_0x33a9('0x2d')](_0x163cd6[_0x33a9('0x2e')],qs[_0x33a9('0x30')](_0x5d0ae1['query']['fields']));_0x59c1a6[_0x33a9('0x2f')]=_0x59c1a6[_0x33a9('0x2f')][_0x33a9('0x31')]?_0x59c1a6[_0x33a9('0x2f')]:_0x163cd6[_0x33a9('0x2e')];if(_0x5d0ae1['query'][_0x33a9('0x42')]){_0x59c1a6['include']=[{'all':!![]}];}_0x59c1a6=_[_0x33a9('0x38')]({},_0x59c1a6,_0x5d0ae1[_0x33a9('0x3b')]);return db[_0x33a9('0x3c')][_0x33a9('0x43')](_0x59c1a6)['then'](handleEntityNotFound(_0x26e6c5,null))[_0x33a9('0x24')](respondWithResult(_0x26e6c5,null))['catch'](handleError(_0x26e6c5,null));};exports[_0x33a9('0x44')]=function(_0x30b4c3,_0x314af6){return db[_0x33a9('0x3c')]['create'](_0x30b4c3[_0x33a9('0x45')],{})[_0x33a9('0x24')](function(_0x515be7){var _0x300a11=_0x30b4c3[_0x33a9('0x46')][_0x33a9('0x47')]({'plain':!![]});if(!_0x300a11)throw new Error(_0x33a9('0x48'));if(_0x300a11['role']===_0x33a9('0x46')){var _0x268620=_0x515be7[_0x33a9('0x47')]({'plain':!![]});var _0x17c93e=_0x33a9('0x49');return db['UserProfileSection'][_0x33a9('0x43')]({'where':{'name':_0x17c93e,'userProfileId':_0x300a11[_0x33a9('0x4a')]},'raw':!![]})[_0x33a9('0x24')](function(_0x4fa776){if(_0x4fa776&&_0x4fa776[_0x33a9('0x4b')]===0x0){return db[_0x33a9('0x4c')][_0x33a9('0x44')]({'name':_0x268620['name'],'resourceId':_0x268620['id'],'type':_0x4fa776[_0x33a9('0x26')],'sectionId':_0x4fa776['id']},{})['then'](function(){return _0x515be7;});}else{return _0x515be7;}})[_0x33a9('0x40')](function(_0xaff01f){logger[_0x33a9('0x25')](_0x33a9('0x4d'),_0xaff01f);throw _0xaff01f;});}return _0x515be7;})[_0x33a9('0x24')](respondWithResult(_0x314af6,0xc9))['catch'](handleError(_0x314af6,null));};exports[_0x33a9('0x4e')]=function(_0x50937e,_0x5eccc4){if(_0x50937e[_0x33a9('0x45')]['id']){delete _0x50937e[_0x33a9('0x45')]['id'];}return db[_0x33a9('0x3c')]['find']({'where':{'id':_0x50937e['params']['id']}})[_0x33a9('0x24')](handleEntityNotFound(_0x5eccc4,null))[_0x33a9('0x24')](saveUpdates(_0x50937e['body'],null))[_0x33a9('0x24')](respondWithResult(_0x5eccc4,null))[_0x33a9('0x40')](handleError(_0x5eccc4,null));};exports[_0x33a9('0x4f')]=function(_0xb10a89,_0x19f7e1){var _0x58abe4=_0xb10a89[_0x33a9('0x41')]['id'];var _0x4be6a4=[];return db[_0x33a9('0x50')][_0x33a9('0x51')](function(_0x4059e6){var _0x257608='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x58abe4;return db['sequelize'][_0x33a9('0x2b')](_0x257608,{'type':db['Sequelize'][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6})['then'](function(_0x2142a0){_0x4be6a4=_['map'](_0x2142a0,function(_0x2229a3){return Number(_0x2229a3[_0x33a9('0x54')]);});})['then'](function(){var _0x5c9ac9='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58abe4;return db['sequelize'][_0x33a9('0x2b')](_0x5c9ac9,{'type':db['Sequelize'][_0x33a9('0x52')]['SELECT'],'raw':!![],'transaction':_0x4059e6});})[_0x33a9('0x24')](function(_0x34bc1e){var _0x53c7a7=_[_0x33a9('0x28')](_0x34bc1e,function(_0x1494af){return Number(_0x1494af['VoiceQueueId']);});return db[_0x33a9('0x55')][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'VoiceQueueId':{'$in':_0x53c7a7}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){var _0x42df7c=_0x33a9('0x56')+_0x58abe4;return db[_0x33a9('0x50')][_0x33a9('0x2b')](_0x42df7c,{'type':db['Sequelize'][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})['then'](function(_0x10d33b){var _0x3070a5=_[_0x33a9('0x28')](_0x10d33b,function(_0x245d53){return Number(_0x245d53[_0x33a9('0x57')]);});return db[_0x33a9('0x58')][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'MailQueueId':{'$in':_0x3070a5}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){var _0x171238=_0x33a9('0x59')+_0x58abe4;return db[_0x33a9('0x50')][_0x33a9('0x2b')](_0x171238,{'type':db[_0x33a9('0x5a')][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})[_0x33a9('0x24')](function(_0x5658b9){var _0x432755=_[_0x33a9('0x28')](_0x5658b9,function(_0x322525){return Number(_0x322525[_0x33a9('0x5b')]);});return db[_0x33a9('0x5c')][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'SmsQueueId':{'$in':_0x432755}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){var _0x1e6c6f=_0x33a9('0x5d')+_0x58abe4;return db[_0x33a9('0x50')]['query'](_0x1e6c6f,{'type':db[_0x33a9('0x5a')][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})[_0x33a9('0x24')](function(_0x4024d0){var _0x34d990=_[_0x33a9('0x28')](_0x4024d0,function(_0x3cd2a7){return Number(_0x3cd2a7['ChatQueueId']);});return db[_0x33a9('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x4be6a4},'ChatQueueId':{'$in':_0x34d990}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){var _0x368d5e=_0x33a9('0x5f')+_0x58abe4;return db[_0x33a9('0x50')][_0x33a9('0x2b')](_0x368d5e,{'type':db[_0x33a9('0x5a')][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})['then'](function(_0x5effd8){var _0x3bdc80=_[_0x33a9('0x28')](_0x5effd8,function(_0xedc83a){return Number(_0xedc83a[_0x33a9('0x60')]);});return db[_0x33a9('0x61')][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'FaxQueueId':{'$in':_0x3bdc80}},'transaction':_0x4059e6});})['then'](function(){var _0x104953=_0x33a9('0x62')+_0x58abe4;return db[_0x33a9('0x50')][_0x33a9('0x2b')](_0x104953,{'type':db['Sequelize'][_0x33a9('0x52')][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})['then'](function(_0x323860){var _0x577714=_[_0x33a9('0x28')](_0x323860,function(_0x5026b1){return Number(_0x5026b1[_0x33a9('0x63')]);});return db[_0x33a9('0x64')][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'OpenchannelQueueId':{'$in':_0x577714}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){var _0x473c89=_0x33a9('0x65')+_0x58abe4;return db[_0x33a9('0x50')][_0x33a9('0x2b')](_0x473c89,{'type':db['Sequelize']['QueryTypes'][_0x33a9('0x53')],'raw':!![],'transaction':_0x4059e6});})['then'](function(_0x48b18f){var _0x2d7afe=_[_0x33a9('0x28')](_0x48b18f,function(_0x1ab740){return Number(_0x1ab740[_0x33a9('0x66')]);});return db['UserWhatsappQueue'][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'WhatsappQueueId':{'$in':_0x2d7afe}},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){return db[_0x33a9('0x67')]['find']({'where':{'TeamId':_0x58abe4}});})[_0x33a9('0x24')](function(_0x239a3f){if(_0x239a3f===null){return;}return db['UserVoicePrefix'][_0x33a9('0x4f')]({'where':{'UserId':{'$in':_0x4be6a4},'VoicePrefixId':_0x239a3f[_0x33a9('0x68')]},'transaction':_0x4059e6});})[_0x33a9('0x24')](function(){return db[_0x33a9('0x3c')]['destroy']({'where':{'id':_0x58abe4},'cascade':!![],'transaction':_0x4059e6});})['then'](function(_0x165d47){if(_0x165d47===0x0){_0x19f7e1[_0x33a9('0x19')](0x194);}else{return db[_0x33a9('0x4c')][_0x33a9('0x4f')]({'where':{'type':_0x33a9('0x49'),'resourceId':_0x58abe4},'cascade':!![],'transaction':_0x4059e6})['then'](function(){_0x19f7e1[_0x33a9('0x1a')](0xcc)[_0x33a9('0x69')]();});}})['catch'](function(_0x4019d4){_0x19f7e1[_0x33a9('0x1a')](0x1f4)[_0x33a9('0x6a')](_0x4019d4);});});};exports[_0x33a9('0x6b')]=function(_0x5d3765,_0x5d4d8b,_0x22b214){return db[_0x33a9('0x3c')]['findOne']({'where':{'id':_0x5d3765[_0x33a9('0x41')]['id']}})[_0x33a9('0x24')](handleEntityNotFound(_0x5d4d8b,null))[_0x33a9('0x24')](function(_0x5ab4f7){if(!_0x5d3765[_0x33a9('0x2b')][_0x33a9('0x6c')]||!utils[_0x33a9('0x6d')](_0x5d3765['query'][_0x33a9('0x6c')])){throw new db[(_0x33a9('0x5a'))][(_0x33a9('0x6e'))]('Unknown\x20channel');}var _0x1d64c7={};var _0x39ae09={};_0x39ae09[_0x33a9('0x2e')]=_[_0x33a9('0x2c')](db[_[_0x33a9('0x6f')](_0x5d3765['query'][_0x33a9('0x6c')]['toLowerCase']())+_0x33a9('0x70')][_0x33a9('0x29')]);_0x39ae09[_0x33a9('0x2b')]=_['keys'](_0x5d3765[_0x33a9('0x2b')]);_0x39ae09[_0x33a9('0x36')]=_[_0x33a9('0x2d')](_0x39ae09['model'],_0x39ae09[_0x33a9('0x2b')]);_0x1d64c7[_0x33a9('0x2f')]=_[_0x33a9('0x2d')](_0x39ae09[_0x33a9('0x2e')],qs[_0x33a9('0x30')](_0x5d3765[_0x33a9('0x2b')]['fields']));_0x1d64c7[_0x33a9('0x2f')]=_0x1d64c7['attributes'][_0x33a9('0x31')]?_0x1d64c7[_0x33a9('0x2f')]:_0x39ae09[_0x33a9('0x2e')];_0x1d64c7[_0x33a9('0x1d')]=qs['limit'](_0x5d3765[_0x33a9('0x2b')]['limit']);_0x1d64c7['offset']=qs['offset'](_0x5d3765[_0x33a9('0x2b')][_0x33a9('0x1b')]);_0x1d64c7[_0x33a9('0x71')]=qs['sort'](_0x5d3765[_0x33a9('0x2b')][_0x33a9('0x34')]);_0x1d64c7[_0x33a9('0x35')]=qs[_0x33a9('0x36')](_[_0x33a9('0x37')](_0x5d3765[_0x33a9('0x2b')],_0x39ae09[_0x33a9('0x36')]));_0x1d64c7=_[_0x33a9('0x38')]({},_0x1d64c7,_0x5d3765[_0x33a9('0x3b')]);return _0x5ab4f7[_0x33a9('0x47')+_['capitalize'](_0x5d3765[_0x33a9('0x2b')][_0x33a9('0x6c')]['toLowerCase']())+_0x33a9('0x72')](_0x1d64c7);})['then'](respondWithResult(_0x5d4d8b,null))['catch'](handleError(_0x5d4d8b,null));};exports['addQueues']=function(_0x191383,_0x554899,_0x528a03){return db[_0x33a9('0x3c')][_0x33a9('0x73')]({'where':{'id':_0x191383[_0x33a9('0x41')]['id']}})[_0x33a9('0x24')](function(_0x2e8867){if(_0x2e8867){if(!_0x191383[_0x33a9('0x45')][_0x33a9('0x6c')]||!utils[_0x33a9('0x6d')](_0x191383[_0x33a9('0x45')][_0x33a9('0x6c')])){throw new db[(_0x33a9('0x5a'))][(_0x33a9('0x6e'))](_0x33a9('0x74'));}return _0x2e8867[_0x33a9('0x75')+_[_0x33a9('0x6f')](_0x191383[_0x33a9('0x45')][_0x33a9('0x6c')][_0x33a9('0x76')]())+'Queues'](_0x191383['body'][_0x33a9('0x77')]);}return null;})['then'](handleEntityNotFound(_0x554899,null))[_0x33a9('0x24')](respondWithStatusCode(_0x554899,null))[_0x33a9('0x40')](handleError(_0x554899,null));};exports[_0x33a9('0x78')]=function(_0x1fd5f2,_0x147260,_0x422d03){return db[_0x33a9('0x3c')][_0x33a9('0x73')]({'where':{'id':_0x1fd5f2['params']['id']}})['then'](function(_0x3f058e){if(_0x3f058e){if(!_0x1fd5f2[_0x33a9('0x2b')]['channel']||!utils[_0x33a9('0x6d')](_0x1fd5f2[_0x33a9('0x2b')][_0x33a9('0x6c')])){throw new db['Sequelize'][(_0x33a9('0x6e'))](_0x33a9('0x74'));}return _0x3f058e[_0x33a9('0x79')+_[_0x33a9('0x6f')](_0x1fd5f2[_0x33a9('0x2b')][_0x33a9('0x6c')]['toLowerCase']())+'Queues'](_0x1fd5f2[_0x33a9('0x2b')][_0x33a9('0x77')]);}return null;})[_0x33a9('0x24')](handleEntityNotFound(_0x147260,null))[_0x33a9('0x24')](respondWithStatusCode(_0x147260,null))[_0x33a9('0x40')](handleError(_0x147260,null));};exports['addAgents']=function(_0x216d82,_0x31cad3){var _0x10d9ee=_[_0x33a9('0x7a')](_0x216d82[_0x33a9('0x45')]['ids'])?_0x216d82[_0x33a9('0x45')]['ids']:[_0x216d82[_0x33a9('0x45')][_0x33a9('0x77')]];var _0x346e8d=_0x216d82['params']['id'];return db[_0x33a9('0x3c')][_0x33a9('0x43')]({'where':{'id':_0x346e8d}})[_0x33a9('0x24')](handleEntityNotFound(_0x31cad3,null))[_0x33a9('0x24')](function(_0x1709de){if(_0x1709de){var _0x283f13=[_0x33a9('0x7b'),_0x33a9('0x7c'),_0x33a9('0x7d'),_0x33a9('0x7e'),_0x33a9('0x7f'),_0x33a9('0x80'),_0x33a9('0x81')];return db[_0x33a9('0x50')][_0x33a9('0x51')](function(_0x598490){var _0x43a85e=_['map'](_0x283f13,function(_0x1f252d){var _0x44dabf={'attributes':['id',_0x33a9('0x26')]};if(_0x1f252d===_0x33a9('0x7b')){_0x44dabf[_0x33a9('0x82')]={'attributes':[_0x33a9('0x83')]};}return _0x1709de[_0x33a9('0x47')+_0x1f252d+_0x33a9('0x72')](_0x44dabf)[_0x33a9('0x24')](function(_0x1b1b56){var _0x5f149c=_['map'](_0x1b1b56,function(_0x1e79a6){var _0x4b56ac=_[_0x33a9('0x28')](_0x10d9ee,function(_0x283d05){var _0x4f7e04={'where':{'UserId':_0x283d05,[_0x1f252d+_0x33a9('0x84')]:_0x1e79a6['id']},'transaction':_0x598490};if(_0x1f252d===_0x33a9('0x7b')){_0x4f7e04['defaults']={'penalty':_0x1e79a6[_0x33a9('0x85')][_0x33a9('0x83')]};}return db['User'+_0x1f252d+_0x33a9('0x70')][_0x33a9('0x86')](_0x4f7e04)[_0x33a9('0x24')](function(){socket[_0x33a9('0x87')]('user'+_0x1f252d+_0x33a9('0x88'),{'UserId':_0x283d05,[_0x1f252d+_0x33a9('0x84')]:_0x1e79a6['id']});if(_0x1f252d!==_0x33a9('0x7b')){return;}return db['User'][_0x33a9('0x3e')]({'where':{'id':_0x10d9ee,'online':0x1},'attributes':['id',_0x33a9('0x26'),_0x33a9('0x89'),_0x33a9('0x8a'),_0x33a9('0x8b')],'raw':!![]})[_0x33a9('0x24')](function(_0x3adcd5){var _0x372d7=_['map'](_0x3adcd5,function(_0x493951){return db['UserVoiceQueueRt'][_0x33a9('0x8c')]({'membername':_0x493951[_0x33a9('0x26')],'UserId':_0x493951['id'],'queue_name':_0x1e79a6[_0x33a9('0x26')],'VoiceQueueId':_0x1e79a6['id'],'interface':_['isNil'](_0x493951[_0x33a9('0x8b')])?util[_0x33a9('0x8d')]('SIP/%s',_0x493951['name']):_0x493951[_0x33a9('0x8b')],'paused':_0x493951[_0x33a9('0x8a')]||![],'penalty':_0x1e79a6[_0x33a9('0x85')][_0x33a9('0x83')]},{'transaction':_0x598490});});return Promise[_0x33a9('0x8e')](_0x372d7);});});});return Promise[_0x33a9('0x8e')](_0x4b56ac);});return Promise[_0x33a9('0x8e')](_0x5f149c);})[_0x33a9('0x24')](function(){return db[_0x33a9('0x67')][_0x33a9('0x73')]({'where':{'teamId':_0x346e8d}})[_0x33a9('0x24')](function(_0x2bc7d5){if(_0x2bc7d5){var _0x1e08cd=_[_0x33a9('0x28')](_0x10d9ee,function(_0x21b442){db[_0x33a9('0x8f')][_0x33a9('0x8c')]({'UserId':_0x21b442,'VoicePrefixId':_0x2bc7d5[_0x33a9('0x68')]});});return Promise[_0x33a9('0x8e')](_0x1e08cd);}});});});return Promise['all'](_0x43a85e)[_0x33a9('0x24')](function(){return _0x1709de['addAgents'](_0x10d9ee,{'transaction':_0x598490})[_0x33a9('0x90')](function(_0x140456){return _0x140456;});});});}})['then'](respondWithResult(_0x31cad3,null))[_0x33a9('0x40')](handleError(_0x31cad3,null));};exports['removeAgents']=function(_0x1223b5,_0x4af69a){var _0x3576f1=_['isArray'](_0x1223b5[_0x33a9('0x2b')][_0x33a9('0x77')])?_0x1223b5[_0x33a9('0x2b')]['ids']:[_0x1223b5[_0x33a9('0x2b')][_0x33a9('0x77')]];var _0x1d8e93=_0x1223b5[_0x33a9('0x41')]['id'];return db[_0x33a9('0x3c')][_0x33a9('0x43')]({'where':{'id':_0x1d8e93}})[_0x33a9('0x24')](handleEntityNotFound(_0x4af69a,null))[_0x33a9('0x24')](function(_0x82e63c){if(_0x82e63c){var _0x8d6410=[_0x33a9('0x7b'),_0x33a9('0x7c'),'Mail',_0x33a9('0x7e'),_0x33a9('0x7f'),_0x33a9('0x80'),_0x33a9('0x81')];return db[_0x33a9('0x50')][_0x33a9('0x51')](function(_0x44ae2a){var _0x3aa6c1=_[_0x33a9('0x28')](_0x8d6410,function(_0x35a1d2){var _0x334b78={'attributes':['id',_0x33a9('0x26')]};return _0x82e63c[_0x33a9('0x47')+_0x35a1d2+'Queues'](_0x334b78)[_0x33a9('0x24')](function(_0x2389d8){var _0x1638ec=_[_0x33a9('0x28')](_0x2389d8,function(_0x1770b8){return _0x1770b8['removeAgents'](_0x3576f1,{'transaction':_0x44ae2a})['then'](function(){var _0x11484e=_[_0x33a9('0x28')](_0x3576f1,function(_0x57e917){socket['emit'](_0x33a9('0x46')+_0x35a1d2+_0x33a9('0x91'),{'UserId':Number(_0x57e917),[_0x35a1d2+'QueueId']:_0x1770b8['id']});if(_0x35a1d2!==_0x33a9('0x7b')){return;}return db[_0x33a9('0x92')][_0x33a9('0x4f')]({'where':{'VoiceQueueId':_0x1770b8['id'],'UserId':_0x57e917},'transaction':_0x44ae2a});});return Promise[_0x33a9('0x8e')](_0x11484e);});});return Promise[_0x33a9('0x8e')](_0x1638ec);});});return Promise[_0x33a9('0x8e')](_0x3aa6c1)['then'](function(){return _0x82e63c[_0x33a9('0x93')](_0x3576f1,{'transaction':_0x44ae2a});})['then'](function(){return db[_0x33a9('0x67')]['findOne']({'where':{'teamId':_0x1d8e93}})[_0x33a9('0x24')](function(_0x1770a2){if(_0x1770a2){var _0x2cfb34=_[_0x33a9('0x28')](_0x3576f1,function(_0x560ee4){db[_0x33a9('0x8f')][_0x33a9('0x4f')]({'where':{'UserId':_0x560ee4,'VoicePrefixId':_0x1770a2[_0x33a9('0x68')]}});});return Promise['all'](_0x2cfb34);}});});});}})[_0x33a9('0x24')](respondWithStatusCode(_0x4af69a,null))[_0x33a9('0x40')](handleError(_0x4af69a,null));};exports[_0x33a9('0x94')]=function(_0x5852e8,_0x2c7e12,_0x1d346b){var _0x5bb7a6={};var _0x4c7773={};var _0x57fed7;var _0x5476d0;return db[_0x33a9('0x3c')][_0x33a9('0x73')]({'where':{'id':_0x5852e8['params']['id']}})[_0x33a9('0x24')](handleEntityNotFound(_0x2c7e12,null))[_0x33a9('0x24')](function(_0x1af233){if(_0x1af233){_0x57fed7=_0x1af233;_0x4c7773[_0x33a9('0x2e')]=_[_0x33a9('0x2c')](db['User'][_0x33a9('0x29')]);_0x4c7773[_0x33a9('0x2b')]=_['keys'](_0x5852e8[_0x33a9('0x2b')]);_0x4c7773['filters']=_['intersection'](_0x4c7773[_0x33a9('0x2e')],_0x4c7773[_0x33a9('0x2b')]);_0x5bb7a6['attributes']=_[_0x33a9('0x2d')](_0x4c7773[_0x33a9('0x2e')],qs[_0x33a9('0x30')](_0x5852e8[_0x33a9('0x2b')][_0x33a9('0x30')]));_0x5bb7a6[_0x33a9('0x2f')]=_0x5bb7a6[_0x33a9('0x2f')][_0x33a9('0x31')]?_0x5bb7a6[_0x33a9('0x2f')]:_0x4c7773[_0x33a9('0x2e')];_0x5bb7a6['order']=qs[_0x33a9('0x34')](_0x5852e8['query'][_0x33a9('0x34')]);_0x5bb7a6[_0x33a9('0x35')]=qs[_0x33a9('0x36')](_[_0x33a9('0x37')](_0x5852e8[_0x33a9('0x2b')],_0x4c7773[_0x33a9('0x36')]));if(_0x5852e8[_0x33a9('0x2b')][_0x33a9('0x95')]){_0x5bb7a6[_0x33a9('0x35')]=_[_0x33a9('0x38')](_0x5bb7a6['where'],{'$or':_[_0x33a9('0x28')](_0x5bb7a6[_0x33a9('0x2f')],function(_0x273fab){var _0x2354b4={};_0x2354b4[_0x273fab]={'$like':'%'+_0x5852e8['query'][_0x33a9('0x95')]+'%'};return _0x2354b4;})});}_0x5bb7a6=_[_0x33a9('0x38')]({},_0x5bb7a6,_0x5852e8['options']);return _0x57fed7[_0x33a9('0x94')](_0x5bb7a6);}})['then'](function(_0x3690cd){if(_0x3690cd){_0x5476d0=_0x3690cd[_0x33a9('0x31')];if(!_0x5852e8['query'][_0x33a9('0x32')](_0x33a9('0x33'))){_0x5bb7a6[_0x33a9('0x1d')]=qs[_0x33a9('0x1d')](_0x5852e8['query'][_0x33a9('0x1d')]);_0x5bb7a6[_0x33a9('0x1b')]=qs['offset'](_0x5852e8[_0x33a9('0x2b')][_0x33a9('0x1b')]);}return _0x57fed7[_0x33a9('0x94')](_0x5bb7a6);}})[_0x33a9('0x24')](function(_0x3df012){if(_0x3df012){return _0x3df012?{'count':_0x5476d0,'rows':_0x3df012}:null;}})[_0x33a9('0x24')](respondWithResult(_0x2c7e12,null))[_0x33a9('0x40')](handleError(_0x2c7e12,null));}; \ No newline at end of file +var _0x5e79=['undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','Team','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','UserProfileResource','update','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','isValidChannel','add','Queues','ids','removeQueues','ValidationError','isArray','Voice','Chat','Mail','Sms','Openchannel','transaction','through','penalty','QueueId','findOrCreate','emit','Queue:save','findAll','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','TeamVoiceQueue','all','upsert','addAgents','spread','removeAgents','Fax','Whatsapp','Queue:remove','getAgents','rawAttributes','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','status','end','json','offset'];(function(_0x3ac34b,_0x278b53){var _0x3a02a7=function(_0x1e4d27){while(--_0x1e4d27){_0x3ac34b['push'](_0x3ac34b['shift']());}};_0x3a02a7(++_0x278b53);}(_0x5e79,0x7d));var _0x95e7=function(_0x1b8853,_0x3ac7f9){_0x1b8853=_0x1b8853-0x0;var _0x3dc96e=_0x5e79[_0x1b8853];return _0x3dc96e;};'use strict';var emlformat=require(_0x95e7('0x0'));var rimraf=require(_0x95e7('0x1'));var zipdir=require(_0x95e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95e7('0x3'));var moment=require(_0x95e7('0x4'));var BPromise=require(_0x95e7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x95e7('0x6'));var sox=require('sox');var csv=require(_0x95e7('0x7'));var ejs=require(_0x95e7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x95e7('0x9'));var crypto=require(_0x95e7('0xa'));var jsforce=require(_0x95e7('0xb'));var deskjs=require(_0x95e7('0xc'));var toCsv=require(_0x95e7('0x7'));var querystring=require(_0x95e7('0xd'));var Papa=require('papaparse');var Redis=require(_0x95e7('0xe'));var authService=require(_0x95e7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x95e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x95e7('0x11'));var utils=require('../../config/utils');var config=require(_0x95e7('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x95e7('0x13')](config['redis'],{'host':_0x95e7('0x14'),'port':0x18eb});var socket=require(_0x95e7('0x15'))(new Redis(config[_0x95e7('0x16')]));require('./team.socket')[_0x95e7('0x17')](socket);function respondWithStatusCode(_0x1032e6,_0x3f001f){_0x3f001f=_0x3f001f||0xcc;return function(_0x33594f){if(_0x33594f){return _0x1032e6['sendStatus'](_0x3f001f);}return _0x1032e6[_0x95e7('0x18')](_0x3f001f)[_0x95e7('0x19')]();};}function respondWithResult(_0x232626,_0x4003e2){_0x4003e2=_0x4003e2||0xc8;return function(_0x4cf441){if(_0x4cf441){return _0x232626[_0x95e7('0x18')](_0x4003e2)[_0x95e7('0x1a')](_0x4cf441);}};}function respondWithFilteredResult(_0x49a716,_0x1fc939){return function(_0x239af6){if(_0x239af6){var _0x481a57=typeof _0x1fc939[_0x95e7('0x1b')]===_0x95e7('0x1c')&&typeof _0x1fc939['limit']===_0x95e7('0x1c');var _0x2d6432=_0x239af6['count'];var _0x55fafe=_0x481a57?0x0:_0x1fc939[_0x95e7('0x1b')];var _0x24dc68=_0x481a57?_0x239af6[_0x95e7('0x1d')]:_0x1fc939[_0x95e7('0x1b')]+_0x1fc939[_0x95e7('0x1e')];var _0x116088;if(_0x24dc68>=_0x2d6432){_0x24dc68=_0x2d6432;_0x116088=0xc8;}else{_0x116088=0xce;}_0x49a716[_0x95e7('0x18')](_0x116088);return _0x49a716[_0x95e7('0x1f')](_0x95e7('0x20'),_0x55fafe+'-'+_0x24dc68+'/'+_0x2d6432)['json'](_0x239af6);}return null;};}function patchUpdates(_0xe97c5e){return function(_0x3c5bd6){try{jsonpatch[_0x95e7('0x21')](_0x3c5bd6,_0xe97c5e,!![]);}catch(_0x590bea){return BPromise[_0x95e7('0x22')](_0x590bea);}return _0x3c5bd6[_0x95e7('0x23')]();};}function saveUpdates(_0x153d19,_0x32500e){return function(_0x1b517a){if(_0x1b517a){return _0x1b517a['update'](_0x153d19)[_0x95e7('0x24')](function(_0x5965f5){return _0x5965f5;});}return null;};}function handleEntityNotFound(_0x9dc308,_0x14f6b2){return function(_0x45fad6){if(!_0x45fad6){_0x9dc308['sendStatus'](0x194);}return _0x45fad6;};}function handleError(_0x559be2,_0x1d62cd){_0x1d62cd=_0x1d62cd||0x1f4;return function(_0x1006b2){logger[_0x95e7('0x25')](_0x1006b2[_0x95e7('0x26')]);if(_0x1006b2[_0x95e7('0x27')]){delete _0x1006b2[_0x95e7('0x27')];}_0x559be2[_0x95e7('0x18')](_0x1d62cd)[_0x95e7('0x28')](_0x1006b2);};}exports['index']=function(_0x3b7325,_0xe0e0a){var _0x13fa96={},_0x21b5c0={},_0x47d82b={'count':0x0,'rows':[]};var _0x2e4a2c=_[_0x95e7('0x29')](db[_0x95e7('0x2a')]['rawAttributes'],function(_0x21d03a){return{'name':_0x21d03a[_0x95e7('0x2b')],'type':_0x21d03a[_0x95e7('0x2c')]['key']};});_0x21b5c0[_0x95e7('0x2d')]=_[_0x95e7('0x29')](_0x2e4a2c,_0x95e7('0x27'));_0x21b5c0['query']=_[_0x95e7('0x2e')](_0x3b7325[_0x95e7('0x2f')]);_0x21b5c0[_0x95e7('0x30')]=_[_0x95e7('0x31')](_0x21b5c0[_0x95e7('0x2d')],_0x21b5c0['query']);_0x13fa96[_0x95e7('0x32')]=_[_0x95e7('0x31')](_0x21b5c0['model'],qs[_0x95e7('0x33')](_0x3b7325[_0x95e7('0x2f')]['fields']));_0x13fa96[_0x95e7('0x32')]=_0x13fa96[_0x95e7('0x32')][_0x95e7('0x34')]?_0x13fa96['attributes']:_0x21b5c0[_0x95e7('0x2d')];if(!_0x3b7325['query'][_0x95e7('0x35')]('nolimit')){_0x13fa96[_0x95e7('0x1e')]=qs[_0x95e7('0x1e')](_0x3b7325[_0x95e7('0x2f')][_0x95e7('0x1e')]);_0x13fa96[_0x95e7('0x1b')]=qs[_0x95e7('0x1b')](_0x3b7325[_0x95e7('0x2f')][_0x95e7('0x1b')]);}_0x13fa96[_0x95e7('0x36')]=qs[_0x95e7('0x37')](_0x3b7325[_0x95e7('0x2f')][_0x95e7('0x37')]);_0x13fa96[_0x95e7('0x38')]=qs['filters'](_[_0x95e7('0x39')](_0x3b7325[_0x95e7('0x2f')],_0x21b5c0['filters']),_0x2e4a2c);if(_0x3b7325[_0x95e7('0x2f')][_0x95e7('0x3a')]){_0x13fa96['where']=_['merge'](_0x13fa96[_0x95e7('0x38')],{'$or':_[_0x95e7('0x29')](_0x2e4a2c,function(_0x39d402){if(_0x39d402[_0x95e7('0x2c')]!==_0x95e7('0x3b')){var _0x590b40={};_0x590b40[_0x39d402[_0x95e7('0x27')]]={'$like':'%'+_0x3b7325[_0x95e7('0x2f')][_0x95e7('0x3a')]+'%'};return _0x590b40;}})});}_0x13fa96=_[_0x95e7('0x3c')]({},_0x13fa96,_0x3b7325[_0x95e7('0x3d')]);var _0xaf624a={'where':_0x13fa96['where']};return db[_0x95e7('0x2a')]['count'](_0xaf624a)[_0x95e7('0x24')](function(_0x37996d){_0x47d82b[_0x95e7('0x1d')]=_0x37996d;if(_0x3b7325['query'][_0x95e7('0x3e')]){_0x13fa96[_0x95e7('0x3f')]=[{'all':!![]}];}return db[_0x95e7('0x2a')]['findAll'](_0x13fa96);})[_0x95e7('0x24')](function(_0x1478df){_0x47d82b[_0x95e7('0x40')]=_0x1478df;return _0x47d82b;})[_0x95e7('0x24')](respondWithFilteredResult(_0xe0e0a,_0x13fa96))[_0x95e7('0x41')](handleError(_0xe0e0a,null));};exports[_0x95e7('0x42')]=function(_0x3875d4,_0x552a18){var _0x2b8a36={'raw':![],'where':{'id':_0x3875d4[_0x95e7('0x43')]['id']}},_0x2024d9={};_0x2024d9[_0x95e7('0x2d')]=_[_0x95e7('0x2e')](db['Team']['rawAttributes']);_0x2024d9[_0x95e7('0x2f')]=_[_0x95e7('0x2e')](_0x3875d4[_0x95e7('0x2f')]);_0x2024d9[_0x95e7('0x30')]=_[_0x95e7('0x31')](_0x2024d9[_0x95e7('0x2d')],_0x2024d9[_0x95e7('0x2f')]);_0x2b8a36[_0x95e7('0x32')]=_[_0x95e7('0x31')](_0x2024d9[_0x95e7('0x2d')],qs[_0x95e7('0x33')](_0x3875d4['query'][_0x95e7('0x33')]));_0x2b8a36['attributes']=_0x2b8a36['attributes'][_0x95e7('0x34')]?_0x2b8a36[_0x95e7('0x32')]:_0x2024d9[_0x95e7('0x2d')];if(_0x3875d4[_0x95e7('0x2f')][_0x95e7('0x3e')]){_0x2b8a36[_0x95e7('0x3f')]=[{'all':!![]}];}_0x2b8a36=_[_0x95e7('0x3c')]({},_0x2b8a36,_0x3875d4[_0x95e7('0x3d')]);return db[_0x95e7('0x2a')][_0x95e7('0x44')](_0x2b8a36)[_0x95e7('0x24')](handleEntityNotFound(_0x552a18,null))[_0x95e7('0x24')](respondWithResult(_0x552a18,null))[_0x95e7('0x41')](handleError(_0x552a18,null));};exports['create']=function(_0x5435f0,_0x312635){return db[_0x95e7('0x2a')][_0x95e7('0x45')](_0x5435f0[_0x95e7('0x46')],{})[_0x95e7('0x24')](function(_0x1a4b65){var _0xfc3020=_0x5435f0[_0x95e7('0x47')][_0x95e7('0x48')]({'plain':!![]});if(!_0xfc3020)throw new Error(_0x95e7('0x49'));if(_0xfc3020['role']===_0x95e7('0x47')){var _0x1beb44=_0x1a4b65[_0x95e7('0x48')]({'plain':!![]});var _0x393819=_0x95e7('0x4a');return db[_0x95e7('0x4b')][_0x95e7('0x44')]({'where':{'name':_0x393819,'userProfileId':_0xfc3020[_0x95e7('0x4c')]},'raw':!![]})['then'](function(_0x1dec6c){if(_0x1dec6c&&_0x1dec6c['autoAssociation']===0x0){return db[_0x95e7('0x4d')][_0x95e7('0x45')]({'name':_0x1beb44['name'],'resourceId':_0x1beb44['id'],'type':_0x1dec6c[_0x95e7('0x27')],'sectionId':_0x1dec6c['id']},{})[_0x95e7('0x24')](function(){return _0x1a4b65;});}else{return _0x1a4b65;}})[_0x95e7('0x41')](function(_0x5e529b){logger[_0x95e7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e529b);throw _0x5e529b;});}return _0x1a4b65;})[_0x95e7('0x24')](respondWithResult(_0x312635,0xc9))[_0x95e7('0x41')](handleError(_0x312635,null));};exports[_0x95e7('0x4e')]=function(_0x2ed28c,_0x2a5ed9){if(_0x2ed28c[_0x95e7('0x46')]['id']){delete _0x2ed28c[_0x95e7('0x46')]['id'];}return db[_0x95e7('0x2a')][_0x95e7('0x44')]({'where':{'id':_0x2ed28c[_0x95e7('0x43')]['id']}})[_0x95e7('0x24')](handleEntityNotFound(_0x2a5ed9,null))[_0x95e7('0x24')](saveUpdates(_0x2ed28c[_0x95e7('0x46')],null))[_0x95e7('0x24')](respondWithResult(_0x2a5ed9,null))[_0x95e7('0x41')](handleError(_0x2a5ed9,null));};exports[_0x95e7('0x4f')]=function(_0x212154,_0x55b9fb){var _0x1ab508=_0x212154['params']['id'];var _0x27ce0b=[];return db[_0x95e7('0x50')]['transaction'](function(_0x20beea){var _0x4b0fda='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x4b0fda,{'type':db[_0x95e7('0x51')][_0x95e7('0x52')][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea})[_0x95e7('0x24')](function(_0x2db858){_0x27ce0b=_['map'](_0x2db858,function(_0x30ab49){return Number(_0x30ab49[_0x95e7('0x54')]);});})[_0x95e7('0x24')](function(){var _0x2db51e='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1ab508;return db[_0x95e7('0x50')]['query'](_0x2db51e,{'type':db['Sequelize'][_0x95e7('0x52')][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0xa0b280){var _0x3f51d7=_[_0x95e7('0x29')](_0xa0b280,function(_0x2f17c7){return Number(_0x2f17c7[_0x95e7('0x55')]);});return db[_0x95e7('0x56')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'VoiceQueueId':{'$in':_0x3f51d7}},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){var _0x2bf6c5=_0x95e7('0x57')+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x2bf6c5,{'type':db[_0x95e7('0x51')][_0x95e7('0x52')]['SELECT'],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0x338002){var _0x34522c=_[_0x95e7('0x29')](_0x338002,function(_0x1f3249){return Number(_0x1f3249[_0x95e7('0x58')]);});return db[_0x95e7('0x59')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'MailQueueId':{'$in':_0x34522c}},'transaction':_0x20beea});})['then'](function(){var _0x4c3b2d='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x4c3b2d,{'type':db[_0x95e7('0x51')]['QueryTypes'][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})['then'](function(_0x1f3cf5){var _0x53e60b=_['map'](_0x1f3cf5,function(_0x460145){return Number(_0x460145[_0x95e7('0x5a')]);});return db[_0x95e7('0x5b')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'SmsQueueId':{'$in':_0x53e60b}},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){var _0x2ec1cc=_0x95e7('0x5c')+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x2ec1cc,{'type':db[_0x95e7('0x51')][_0x95e7('0x52')][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0x54bcf8){var _0x5b31b6=_[_0x95e7('0x29')](_0x54bcf8,function(_0x4441ff){return Number(_0x4441ff[_0x95e7('0x5d')]);});return db[_0x95e7('0x5e')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'ChatQueueId':{'$in':_0x5b31b6}},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){var _0x40218a=_0x95e7('0x5f')+_0x1ab508;return db['sequelize'][_0x95e7('0x2f')](_0x40218a,{'type':db[_0x95e7('0x51')][_0x95e7('0x52')][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0x211e7c){var _0x4e41a8=_[_0x95e7('0x29')](_0x211e7c,function(_0x1aa2e9){return Number(_0x1aa2e9['FaxQueueId']);});return db[_0x95e7('0x60')]['destroy']({'where':{'UserId':{'$in':_0x27ce0b},'FaxQueueId':{'$in':_0x4e41a8}},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){var _0x2e621c=_0x95e7('0x61')+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x2e621c,{'type':db[_0x95e7('0x51')]['QueryTypes'][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0x28f7f8){var _0x3d4579=_[_0x95e7('0x29')](_0x28f7f8,function(_0x40897d){return Number(_0x40897d[_0x95e7('0x62')]);});return db[_0x95e7('0x63')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'OpenchannelQueueId':{'$in':_0x3d4579}},'transaction':_0x20beea});})['then'](function(){var _0x2e4921=_0x95e7('0x64')+_0x1ab508;return db[_0x95e7('0x50')][_0x95e7('0x2f')](_0x2e4921,{'type':db[_0x95e7('0x51')][_0x95e7('0x52')][_0x95e7('0x53')],'raw':!![],'transaction':_0x20beea});})[_0x95e7('0x24')](function(_0x45d0c4){var _0x366ed1=_[_0x95e7('0x29')](_0x45d0c4,function(_0x499d27){return Number(_0x499d27[_0x95e7('0x65')]);});return db[_0x95e7('0x66')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'WhatsappQueueId':{'$in':_0x366ed1}},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){return db[_0x95e7('0x67')][_0x95e7('0x44')]({'where':{'TeamId':_0x1ab508}});})[_0x95e7('0x24')](function(_0x5090aa){if(_0x5090aa===null){return;}return db[_0x95e7('0x68')][_0x95e7('0x4f')]({'where':{'UserId':{'$in':_0x27ce0b},'VoicePrefixId':_0x5090aa[_0x95e7('0x69')]},'transaction':_0x20beea});})[_0x95e7('0x24')](function(){return db['Team'][_0x95e7('0x4f')]({'where':{'id':_0x1ab508},'cascade':!![],'transaction':_0x20beea});})['then'](function(_0x4e195a){if(_0x4e195a===0x0){_0x55b9fb[_0x95e7('0x6a')](0x194);}else{return db[_0x95e7('0x4d')][_0x95e7('0x4f')]({'where':{'type':_0x95e7('0x4a'),'resourceId':_0x1ab508},'cascade':!![],'transaction':_0x20beea})['then'](function(){_0x55b9fb['status'](0xcc)['end']();});}})['catch'](function(_0x381a86){_0x55b9fb['status'](0x1f4)[_0x95e7('0x28')](_0x381a86);});});};exports[_0x95e7('0x6b')]=function(_0x3368cb,_0x300747,_0x437317){return db['Team'][_0x95e7('0x6c')]({'where':{'id':_0x3368cb[_0x95e7('0x43')]['id']}})[_0x95e7('0x24')](handleEntityNotFound(_0x300747,null))[_0x95e7('0x24')](function(_0x1f2cf3){if(!_0x3368cb[_0x95e7('0x2f')][_0x95e7('0x6d')]||!utils['isValidChannel'](_0x3368cb[_0x95e7('0x2f')][_0x95e7('0x6d')])){throw new db[(_0x95e7('0x51'))]['ValidationError'](_0x95e7('0x6e'));}var _0x4ba021={};var _0x247ff4={};_0x247ff4[_0x95e7('0x2d')]=_[_0x95e7('0x2e')](db[_[_0x95e7('0x6f')](_0x3368cb['query'][_0x95e7('0x6d')][_0x95e7('0x70')]())+_0x95e7('0x71')]['rawAttributes']);_0x247ff4['query']=_[_0x95e7('0x2e')](_0x3368cb[_0x95e7('0x2f')]);_0x247ff4[_0x95e7('0x30')]=_[_0x95e7('0x31')](_0x247ff4[_0x95e7('0x2d')],_0x247ff4[_0x95e7('0x2f')]);_0x4ba021[_0x95e7('0x32')]=_[_0x95e7('0x31')](_0x247ff4['model'],qs[_0x95e7('0x33')](_0x3368cb[_0x95e7('0x2f')][_0x95e7('0x33')]));_0x4ba021[_0x95e7('0x32')]=_0x4ba021[_0x95e7('0x32')][_0x95e7('0x34')]?_0x4ba021[_0x95e7('0x32')]:_0x247ff4[_0x95e7('0x2d')];_0x4ba021[_0x95e7('0x1e')]=qs[_0x95e7('0x1e')](_0x3368cb[_0x95e7('0x2f')][_0x95e7('0x1e')]);_0x4ba021['offset']=qs[_0x95e7('0x1b')](_0x3368cb[_0x95e7('0x2f')][_0x95e7('0x1b')]);_0x4ba021[_0x95e7('0x36')]=qs['sort'](_0x3368cb['query']['sort']);_0x4ba021['where']=qs[_0x95e7('0x30')](_['pick'](_0x3368cb[_0x95e7('0x2f')],_0x247ff4[_0x95e7('0x30')]));_0x4ba021=_[_0x95e7('0x3c')]({},_0x4ba021,_0x3368cb['options']);return _0x1f2cf3[_0x95e7('0x48')+_['capitalize'](_0x3368cb['query'][_0x95e7('0x6d')][_0x95e7('0x70')]())+'Queues'](_0x4ba021);})[_0x95e7('0x24')](respondWithResult(_0x300747,null))[_0x95e7('0x41')](handleError(_0x300747,null));};exports[_0x95e7('0x72')]=function(_0x49507b,_0x2edd04,_0x303e9c){return db['Team'][_0x95e7('0x6c')]({'where':{'id':_0x49507b[_0x95e7('0x43')]['id']}})[_0x95e7('0x24')](function(_0x5b0d61){if(_0x5b0d61){if(!_0x49507b['body'][_0x95e7('0x6d')]||!utils[_0x95e7('0x73')](_0x49507b[_0x95e7('0x46')][_0x95e7('0x6d')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x5b0d61[_0x95e7('0x74')+_['capitalize'](_0x49507b[_0x95e7('0x46')]['channel'][_0x95e7('0x70')]())+_0x95e7('0x75')](_0x49507b[_0x95e7('0x46')][_0x95e7('0x76')]);}return null;})['then'](handleEntityNotFound(_0x2edd04,null))[_0x95e7('0x24')](respondWithStatusCode(_0x2edd04,null))['catch'](handleError(_0x2edd04,null));};exports[_0x95e7('0x77')]=function(_0x48a47c,_0x48b3f6,_0x390278){return db[_0x95e7('0x2a')][_0x95e7('0x6c')]({'where':{'id':_0x48a47c[_0x95e7('0x43')]['id']}})['then'](function(_0x2a21a9){if(_0x2a21a9){if(!_0x48a47c[_0x95e7('0x2f')][_0x95e7('0x6d')]||!utils[_0x95e7('0x73')](_0x48a47c[_0x95e7('0x2f')][_0x95e7('0x6d')])){throw new db[(_0x95e7('0x51'))][(_0x95e7('0x78'))](_0x95e7('0x6e'));}return _0x2a21a9['remove'+_[_0x95e7('0x6f')](_0x48a47c[_0x95e7('0x2f')]['channel'][_0x95e7('0x70')]())+_0x95e7('0x75')](_0x48a47c[_0x95e7('0x2f')]['ids']);}return null;})['then'](handleEntityNotFound(_0x48b3f6,null))[_0x95e7('0x24')](respondWithStatusCode(_0x48b3f6,null))['catch'](handleError(_0x48b3f6,null));};exports['addAgents']=function(_0x30dcc8,_0x48248f){var _0x5affb8=_[_0x95e7('0x79')](_0x30dcc8['body'][_0x95e7('0x76')])?_0x30dcc8[_0x95e7('0x46')][_0x95e7('0x76')]:[_0x30dcc8[_0x95e7('0x46')][_0x95e7('0x76')]];var _0x4efc09=_0x30dcc8['params']['id'];return db[_0x95e7('0x2a')][_0x95e7('0x44')]({'where':{'id':_0x4efc09}})[_0x95e7('0x24')](handleEntityNotFound(_0x48248f,null))['then'](function(_0x3398c4){if(_0x3398c4){var _0x46beda=[_0x95e7('0x7a'),_0x95e7('0x7b'),_0x95e7('0x7c'),_0x95e7('0x7d'),'Fax',_0x95e7('0x7e'),'Whatsapp'];return db['sequelize'][_0x95e7('0x7f')](function(_0x43df15){var _0x3bd8e3=_[_0x95e7('0x29')](_0x46beda,function(_0x293bdf){var _0x5af324={'attributes':['id',_0x95e7('0x27')]};if(_0x293bdf===_0x95e7('0x7a')){_0x5af324[_0x95e7('0x80')]={'attributes':[_0x95e7('0x81')]};}return _0x3398c4[_0x95e7('0x48')+_0x293bdf+_0x95e7('0x75')](_0x5af324)[_0x95e7('0x24')](function(_0x28790c){var _0x26f11f=_[_0x95e7('0x29')](_0x28790c,function(_0x4a8ddb){var _0x5b8675=_[_0x95e7('0x29')](_0x5affb8,function(_0xd97d37){var _0x6a8631={'where':{'UserId':_0xd97d37,[_0x293bdf+_0x95e7('0x82')]:_0x4a8ddb['id']},'transaction':_0x43df15};if(_0x293bdf===_0x95e7('0x7a')){_0x6a8631[_0x95e7('0x13')]={'penalty':_0x4a8ddb['TeamVoiceQueue'][_0x95e7('0x81')]};}return db['User'+_0x293bdf+'Queue'][_0x95e7('0x83')](_0x6a8631)['then'](function(){socket[_0x95e7('0x84')](_0x95e7('0x47')+_0x293bdf+_0x95e7('0x85'),{'UserId':_0xd97d37,[_0x293bdf+_0x95e7('0x82')]:_0x4a8ddb['id']});if(_0x293bdf!==_0x95e7('0x7a')){return;}return db['User'][_0x95e7('0x86')]({'where':{'id':_0x5affb8,'online':0x1},'attributes':['id',_0x95e7('0x27'),'online',_0x95e7('0x87'),_0x95e7('0x88')],'raw':!![]})['then'](function(_0x3ef848){var _0x47e7b2=_['map'](_0x3ef848,function(_0x26f0ff){return db[_0x95e7('0x89')]['upsert']({'membername':_0x26f0ff[_0x95e7('0x27')],'UserId':_0x26f0ff['id'],'queue_name':_0x4a8ddb[_0x95e7('0x27')],'VoiceQueueId':_0x4a8ddb['id'],'interface':_[_0x95e7('0x8a')](_0x26f0ff[_0x95e7('0x88')])?util[_0x95e7('0x8b')](_0x95e7('0x8c'),_0x26f0ff[_0x95e7('0x27')]):_0x26f0ff['interface'],'paused':_0x26f0ff[_0x95e7('0x87')]||![],'penalty':_0x4a8ddb[_0x95e7('0x8d')][_0x95e7('0x81')]},{'transaction':_0x43df15});});return Promise[_0x95e7('0x8e')](_0x47e7b2);});});});return Promise[_0x95e7('0x8e')](_0x5b8675);});return Promise[_0x95e7('0x8e')](_0x26f11f);})['then'](function(){return db[_0x95e7('0x67')][_0x95e7('0x6c')]({'where':{'teamId':_0x4efc09}})[_0x95e7('0x24')](function(_0x57c2f0){if(_0x57c2f0){var _0xb4e0d=_[_0x95e7('0x29')](_0x5affb8,function(_0xc230a0){db[_0x95e7('0x68')][_0x95e7('0x8f')]({'UserId':_0xc230a0,'VoicePrefixId':_0x57c2f0[_0x95e7('0x69')]});});return Promise[_0x95e7('0x8e')](_0xb4e0d);}});});});return Promise[_0x95e7('0x8e')](_0x3bd8e3)[_0x95e7('0x24')](function(){return _0x3398c4[_0x95e7('0x90')](_0x5affb8,{'transaction':_0x43df15})[_0x95e7('0x91')](function(_0x108b59){return _0x108b59;});});});}})[_0x95e7('0x24')](respondWithResult(_0x48248f,null))['catch'](handleError(_0x48248f,null));};exports[_0x95e7('0x92')]=function(_0x3ac629,_0x55423e){var _0x3b4dea=_['isArray'](_0x3ac629[_0x95e7('0x2f')][_0x95e7('0x76')])?_0x3ac629[_0x95e7('0x2f')]['ids']:[_0x3ac629[_0x95e7('0x2f')]['ids']];var _0x432ba4=_0x3ac629['params']['id'];return db[_0x95e7('0x2a')][_0x95e7('0x44')]({'where':{'id':_0x432ba4}})[_0x95e7('0x24')](handleEntityNotFound(_0x55423e,null))['then'](function(_0x4c9144){if(_0x4c9144){var _0x31aac5=[_0x95e7('0x7a'),_0x95e7('0x7b'),_0x95e7('0x7c'),'Sms',_0x95e7('0x93'),_0x95e7('0x7e'),_0x95e7('0x94')];return db['sequelize'][_0x95e7('0x7f')](function(_0x728492){var _0x41415f=_[_0x95e7('0x29')](_0x31aac5,function(_0x503acb){var _0x9e1088={'attributes':['id',_0x95e7('0x27')]};return _0x4c9144[_0x95e7('0x48')+_0x503acb+_0x95e7('0x75')](_0x9e1088)['then'](function(_0xddffee){var _0x1e241c=_[_0x95e7('0x29')](_0xddffee,function(_0x80e957){return _0x80e957['removeAgents'](_0x3b4dea,{'transaction':_0x728492})[_0x95e7('0x24')](function(){var _0x5d72aa=_['map'](_0x3b4dea,function(_0x371cf6){socket[_0x95e7('0x84')]('user'+_0x503acb+_0x95e7('0x95'),{'UserId':Number(_0x371cf6),[_0x503acb+_0x95e7('0x82')]:_0x80e957['id']});if(_0x503acb!=='Voice'){return;}return db[_0x95e7('0x89')]['destroy']({'where':{'VoiceQueueId':_0x80e957['id'],'UserId':_0x371cf6},'transaction':_0x728492});});return Promise['all'](_0x5d72aa);});});return Promise[_0x95e7('0x8e')](_0x1e241c);});});return Promise[_0x95e7('0x8e')](_0x41415f)[_0x95e7('0x24')](function(){return _0x4c9144[_0x95e7('0x92')](_0x3b4dea,{'transaction':_0x728492});})['then'](function(){return db['TeamVoicePrefix'][_0x95e7('0x6c')]({'where':{'teamId':_0x432ba4}})[_0x95e7('0x24')](function(_0xbfce13){if(_0xbfce13){var _0x27556b=_[_0x95e7('0x29')](_0x3b4dea,function(_0x23a077){db[_0x95e7('0x68')]['destroy']({'where':{'UserId':_0x23a077,'VoicePrefixId':_0xbfce13[_0x95e7('0x69')]}});});return Promise[_0x95e7('0x8e')](_0x27556b);}});});});}})[_0x95e7('0x24')](respondWithStatusCode(_0x55423e,null))[_0x95e7('0x41')](handleError(_0x55423e,null));};exports[_0x95e7('0x96')]=function(_0x5ac37f,_0x227a24,_0x4f1296){var _0x152419={};var _0x56315a={};var _0xc7c6ac;var _0x5dcda9;return db[_0x95e7('0x2a')]['findOne']({'where':{'id':_0x5ac37f['params']['id']}})[_0x95e7('0x24')](handleEntityNotFound(_0x227a24,null))[_0x95e7('0x24')](function(_0x2cb55a){if(_0x2cb55a){_0xc7c6ac=_0x2cb55a;_0x56315a[_0x95e7('0x2d')]=_[_0x95e7('0x2e')](db['User'][_0x95e7('0x97')]);_0x56315a['query']=_[_0x95e7('0x2e')](_0x5ac37f[_0x95e7('0x2f')]);_0x56315a[_0x95e7('0x30')]=_[_0x95e7('0x31')](_0x56315a[_0x95e7('0x2d')],_0x56315a[_0x95e7('0x2f')]);_0x152419[_0x95e7('0x32')]=_['intersection'](_0x56315a[_0x95e7('0x2d')],qs[_0x95e7('0x33')](_0x5ac37f['query'][_0x95e7('0x33')]));_0x152419[_0x95e7('0x32')]=_0x152419[_0x95e7('0x32')][_0x95e7('0x34')]?_0x152419['attributes']:_0x56315a[_0x95e7('0x2d')];_0x152419[_0x95e7('0x36')]=qs['sort'](_0x5ac37f['query'][_0x95e7('0x37')]);_0x152419[_0x95e7('0x38')]=qs['filters'](_[_0x95e7('0x39')](_0x5ac37f[_0x95e7('0x2f')],_0x56315a[_0x95e7('0x30')]));if(_0x5ac37f['query'][_0x95e7('0x3a')]){_0x152419[_0x95e7('0x38')]=_[_0x95e7('0x3c')](_0x152419['where'],{'$or':_[_0x95e7('0x29')](_0x152419['attributes'],function(_0x128fac){var _0x5297aa={};_0x5297aa[_0x128fac]={'$like':'%'+_0x5ac37f['query'][_0x95e7('0x3a')]+'%'};return _0x5297aa;})});}_0x152419=_['merge']({},_0x152419,_0x5ac37f[_0x95e7('0x3d')]);return _0xc7c6ac[_0x95e7('0x96')](_0x152419);}})[_0x95e7('0x24')](function(_0x4cfc0b){if(_0x4cfc0b){_0x5dcda9=_0x4cfc0b[_0x95e7('0x34')];if(!_0x5ac37f[_0x95e7('0x2f')][_0x95e7('0x35')](_0x95e7('0x98'))){_0x152419[_0x95e7('0x1e')]=qs['limit'](_0x5ac37f[_0x95e7('0x2f')][_0x95e7('0x1e')]);_0x152419['offset']=qs['offset'](_0x5ac37f[_0x95e7('0x2f')][_0x95e7('0x1b')]);}return _0xc7c6ac[_0x95e7('0x96')](_0x152419);}})['then'](function(_0x17a4d1){if(_0x17a4d1){return _0x17a4d1?{'count':_0x5dcda9,'rows':_0x17a4d1}:null;}})[_0x95e7('0x24')](respondWithResult(_0x227a24,null))[_0x95e7('0x41')](handleError(_0x227a24,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 19c02b9..251ff50 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 _0xfbaf=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','hook'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xfbaf,0x139));var _0xffba=function(_0x59453d,_0x2c217e){_0x59453d=_0x59453d-0x0;var _0x1beeca=_0xfbaf[_0x59453d];return _0x1beeca;};'use strict';var EventEmitter=require(_0xffba('0x0'));var Team=require(_0xffba('0x1'))['db'][_0xffba('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xffba('0x3')](0x0);var events={'afterCreate':_0xffba('0x4'),'afterUpdate':_0xffba('0x5'),'afterDestroy':'remove'};function emitEvent(_0x10d0e9){return function(_0x15d414,_0x4d0e5d,_0x14566c){TeamEvents['emit'](_0x10d0e9+':'+_0x15d414['id'],_0x15d414);TeamEvents['emit'](_0x10d0e9,_0x15d414);_0x14566c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xffba('0x6')](e,emitEvent(event));}}module[_0xffba('0x7')]=TeamEvents; \ No newline at end of file +var _0x6f2b=['save','update','emit','exports','events','Team','setMaxListeners'];(function(_0x351e7c,_0x19beb6){var _0x196f6b=function(_0xa28a4){while(--_0xa28a4){_0x351e7c['push'](_0x351e7c['shift']());}};_0x196f6b(++_0x19beb6);}(_0x6f2b,0x18c));var _0xb6f2=function(_0x8dcc08,_0x48e9c1){_0x8dcc08=_0x8dcc08-0x0;var _0x3ecb6f=_0x6f2b[_0x8dcc08];return _0x3ecb6f;};'use strict';var EventEmitter=require(_0xb6f2('0x0'));var Team=require('../../mysqldb')['db'][_0xb6f2('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xb6f2('0x2')](0x0);var events={'afterCreate':_0xb6f2('0x3'),'afterUpdate':_0xb6f2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f3851){return function(_0x28105c,_0x1e538e,_0x3d6972){TeamEvents[_0xb6f2('0x5')](_0x1f3851+':'+_0x28105c['id'],_0x28105c);TeamEvents[_0xb6f2('0x5')](_0x1f3851,_0x28105c);_0x3d6972(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xb6f2('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 e5cc304..0f6142e 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 _0x3f1a=['get','Queues','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','then','lodash','./team.attributes'];(function(_0x1b1b94,_0x1573f3){var _0x4ffc4a=function(_0x31f2e1){while(--_0x31f2e1){_0x1b1b94['push'](_0x1b1b94['shift']());}};_0x4ffc4a(++_0x1573f3);}(_0x3f1a,0x1ca));var _0xa3f1=function(_0x4e9b59,_0x43fdb4){_0x4e9b59=_0x4e9b59-0x0;var _0x361fd4=_0x3f1a[_0x4e9b59];return _0x361fd4;};'use strict';var _=require(_0xa3f1('0x0'));var attributes=require(_0xa3f1('0x1'));function getQueuesByChannel(_0x5410af,_0x317716){var _0x4be7ac=_0xa3f1('0x2')+_0x317716+_0xa3f1('0x3');return _0x5410af[_0x4be7ac]()['then'](function(_0x1b0122){return _[_0xa3f1('0x4')](_0x1b0122,function(_0x4e6140){_0x4e6140[_0xa3f1('0x5')](_0xa3f1('0x6'),_0x317716);return _0x4e6140;});})[_0xa3f1('0x7')](function(_0x5e14d7){throw _0x5e14d7;});}module[_0xa3f1('0x8')]=function(_0x195ddc){return _0x195ddc[_0xa3f1('0x9')](_0xa3f1('0xa'),attributes,{'tableName':_0xa3f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x51149e=this;var _0x5a6a12=[_0xa3f1('0xc'),'Fax',_0xa3f1('0xd'),_0xa3f1('0xe'),_0xa3f1('0xf'),_0xa3f1('0x10'),_0xa3f1('0x11')];return Promise[_0xa3f1('0x12')]()[_0xa3f1('0x13')](function(){var _0x4e59ac=_[_0xa3f1('0x4')](_0x5a6a12,function(_0x39d32c){return getQueuesByChannel(_0x51149e,_0x39d32c);});return Promise['all'](_0x4e59ac);})['catch'](function(_0xb6affc){throw _0xb6affc;});}}});}; \ No newline at end of file +var _0x4fc3=['all','./team.attributes','get','Queues','then','setDataValue','channel','catch','exports','define','teams','Chat','Fax','Mail','Openchannel','Sms','Voice'];(function(_0xb7b21,_0x1a174c){var _0x3eafe4=function(_0x33f723){while(--_0x33f723){_0xb7b21['push'](_0xb7b21['shift']());}};_0x3eafe4(++_0x1a174c);}(_0x4fc3,0xbc));var _0x34fc=function(_0x5cc071,_0x1e45d7){_0x5cc071=_0x5cc071-0x0;var _0x3107c0=_0x4fc3[_0x5cc071];return _0x3107c0;};'use strict';var _=require('lodash');var attributes=require(_0x34fc('0x0'));function getQueuesByChannel(_0x39e7c9,_0x3dd478){var _0x332133=_0x34fc('0x1')+_0x3dd478+_0x34fc('0x2');return _0x39e7c9[_0x332133]()[_0x34fc('0x3')](function(_0x4b37e1){return _['map'](_0x4b37e1,function(_0x371ffc){_0x371ffc[_0x34fc('0x4')](_0x34fc('0x5'),_0x3dd478);return _0x371ffc;});})[_0x34fc('0x6')](function(_0x3c78a6){throw _0x3c78a6;});}module[_0x34fc('0x7')]=function(_0x578f40){return _0x578f40[_0x34fc('0x8')]('Team',attributes,{'tableName':_0x34fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x137dd8=this;var _0x276996=[_0x34fc('0xa'),_0x34fc('0xb'),_0x34fc('0xc'),_0x34fc('0xd'),_0x34fc('0xe'),_0x34fc('0xf'),'Whatsapp'];return Promise['resolve']()['then'](function(){var _0xa922e8=_['map'](_0x276996,function(_0x1b646c){return getQueuesByChannel(_0x137dd8,_0x1b646c);});return Promise[_0x34fc('0x10')](_0xa922e8);})[_0x34fc('0x6')](function(_0x270cb7){throw _0x270cb7;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index c308d06..51652ae 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 _0x6cc1=['error','code','message','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1bed04,_0x30aca3){var _0x7abb95=function(_0x139e5d){while(--_0x139e5d){_0x1bed04['push'](_0x1bed04['shift']());}};_0x7abb95(++_0x30aca3);}(_0x6cc1,0x13e));var _0x16cc=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x6cc1[_0x555b2f];return _0x81c0a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x16cc('0x0'));var fs=require('fs');var Redis=require(_0x16cc('0x1'));var db=require(_0x16cc('0x2'))['db'];var utils=require(_0x16cc('0x3'));var logger=require('../../config/logger')(_0x16cc('0x4'));var config=require(_0x16cc('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x16cc('0x6')]({'port':0x232a});config[_0x16cc('0x7')]=_[_0x16cc('0x8')](config[_0x16cc('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x16cc('0x9'))(new Redis(config['redis']));require('./team.socket')[_0x16cc('0xa')](socket);function respondWithRpcPromise(_0x29f598,_0x51a902,_0x421a4b){return new BPromise(function(_0x1deea0,_0x3d4534){return client[_0x16cc('0xb')](_0x29f598,_0x421a4b)[_0x16cc('0xc')](function(_0x23b858){logger[_0x16cc('0xd')](_0x16cc('0xe'),_0x51a902,_0x16cc('0xf'));logger[_0x16cc('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x51a902,_0x16cc('0xf'),JSON[_0x16cc('0x11')](_0x23b858));if(_0x23b858[_0x16cc('0x12')]){if(_0x23b858[_0x16cc('0x12')][_0x16cc('0x13')]===0x1f4){logger[_0x16cc('0x12')](_0x16cc('0xe'),_0x51a902,_0x23b858[_0x16cc('0x12')][_0x16cc('0x14')]);return _0x3d4534(_0x23b858[_0x16cc('0x12')][_0x16cc('0x14')]);}logger[_0x16cc('0x12')]('Team,\x20%s,\x20%s',_0x51a902,_0x23b858[_0x16cc('0x12')][_0x16cc('0x14')]);return _0x1deea0(_0x23b858[_0x16cc('0x12')][_0x16cc('0x14')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x51a902,'request\x20sent');_0x1deea0(_0x23b858['result'][_0x16cc('0x14')]);}})['catch'](function(_0x24c3a8){logger['error'](_0x16cc('0xe'),_0x51a902,_0x24c3a8);_0x3d4534(_0x24c3a8);});});} \ No newline at end of file +var _0x1bd4=['./team.socket','register','request','then','request\x20sent','stringify','error','code','message','Team,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1059f4,_0x4fe41d){var _0xd42321=function(_0x2cef54){while(--_0x2cef54){_0x1059f4['push'](_0x1059f4['shift']());}};_0xd42321(++_0x4fe41d);}(_0x1bd4,0x192));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41bd('0x0'));var util=require(_0x41bd('0x1'));var moment=require(_0x41bd('0x2'));var BPromise=require(_0x41bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x41bd('0x5'))(_0x41bd('0x6'));var config=require(_0x41bd('0x7'));var jayson=require(_0x41bd('0x8'));var client=jayson[_0x41bd('0x9')]['http']({'port':0x232a});config[_0x41bd('0xa')]=_[_0x41bd('0xb')](config[_0x41bd('0xa')],{'host':_0x41bd('0xc'),'port':0x18eb});var socket=require(_0x41bd('0xd'))(new Redis(config[_0x41bd('0xa')]));require(_0x41bd('0xe'))[_0x41bd('0xf')](socket);function respondWithRpcPromise(_0x4b0f58,_0x25f01e,_0x10e646){return new BPromise(function(_0x3d8cde,_0x3eac64){return client[_0x41bd('0x10')](_0x4b0f58,_0x10e646)[_0x41bd('0x11')](function(_0x1b00ae){logger['info']('Team,\x20%s,\x20%s',_0x25f01e,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x25f01e,_0x41bd('0x12'),JSON[_0x41bd('0x13')](_0x1b00ae));if(_0x1b00ae[_0x41bd('0x14')]){if(_0x1b00ae[_0x41bd('0x14')][_0x41bd('0x15')]===0x1f4){logger[_0x41bd('0x14')]('Team,\x20%s,\x20%s',_0x25f01e,_0x1b00ae[_0x41bd('0x14')][_0x41bd('0x16')]);return _0x3eac64(_0x1b00ae['error'][_0x41bd('0x16')]);}logger[_0x41bd('0x14')](_0x41bd('0x17'),_0x25f01e,_0x1b00ae['error'][_0x41bd('0x16')]);return _0x3d8cde(_0x1b00ae[_0x41bd('0x14')][_0x41bd('0x16')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x25f01e,_0x41bd('0x12'));_0x3d8cde(_0x1b00ae[_0x41bd('0x18')][_0x41bd('0x16')]);}})[_0x41bd('0x19')](function(_0x36106d){logger[_0x41bd('0x14')](_0x41bd('0x17'),_0x25f01e,_0x36106d);_0x3eac64(_0x36106d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f922f65..7da24d2 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 _0x0901=['register','length','./team.events','save','remove','emit','removeListener'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x0901,0x1f3));var _0x1090=function(_0x4d0f2d,_0x25149c){_0x4d0f2d=_0x4d0f2d-0x0;var _0x5e8eb6=_0x0901[_0x4d0f2d];return _0x5e8eb6;};'use strict';var TeamEvents=require(_0x1090('0x0'));var events=[_0x1090('0x1'),_0x1090('0x2'),'update'];function createListener(_0x2a1620,_0x452a33){return function(_0x27e17f){_0x452a33[_0x1090('0x3')](_0x2a1620,_0x27e17f);};}function removeListener(_0x219b9f,_0x5909dd){return function(){TeamEvents[_0x1090('0x4')](_0x219b9f,_0x5909dd);};}exports[_0x1090('0x5')]=function(_0x3f6a8f){for(var _0x2eb74a=0x0,_0xf8ce=events[_0x1090('0x6')];_0x2eb74a<_0xf8ce;_0x2eb74a++){var _0x2887cd=events[_0x2eb74a];var _0x441902=createListener('team:'+_0x2887cd,_0x3f6a8f);TeamEvents['on'](_0x2887cd,_0x441902);}}; \ No newline at end of file +var _0xab23=['emit','removeListener','team:','./team.events','save','remove','update'];(function(_0x5adb18,_0x222326){var _0x420c98=function(_0x146b7b){while(--_0x146b7b){_0x5adb18['push'](_0x5adb18['shift']());}};_0x420c98(++_0x222326);}(_0xab23,0x1bc));var _0x3ab2=function(_0x2fb821,_0x5ea30e){_0x2fb821=_0x2fb821-0x0;var _0x2d44ad=_0xab23[_0x2fb821];return _0x2d44ad;};'use strict';var TeamEvents=require(_0x3ab2('0x0'));var events=[_0x3ab2('0x1'),_0x3ab2('0x2'),_0x3ab2('0x3')];function createListener(_0x5c7e78,_0x31105e){return function(_0x5b5f11){_0x31105e[_0x3ab2('0x4')](_0x5c7e78,_0x5b5f11);};}function removeListener(_0x2d17cc,_0x379eb5){return function(){TeamEvents[_0x3ab2('0x5')](_0x2d17cc,_0x379eb5);};}exports['register']=function(_0x5222ba){for(var _0x3445f2=0x0,_0x4e8d92=events['length'];_0x3445f2<_0x4e8d92;_0x3445f2++){var _0x36eee5=events[_0x3445f2];var _0x46d253=createListener(_0x3ab2('0x6')+_0x36eee5,_0x5222ba);TeamEvents['on'](_0x36eee5,_0x46d253);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 757d591..349eff4 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 _0x90c7=['sequelize','exports','INTEGER'];(function(_0x4c15f0,_0x2c6daa){var _0x2f5754=function(_0x292eb2){while(--_0x292eb2){_0x4c15f0['push'](_0x4c15f0['shift']());}};_0x2f5754(++_0x2c6daa);}(_0x90c7,0x9c));var _0x790c=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x90c7[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x790c('0x0'));module[_0x790c('0x1')]={'TeamId':{'type':Sequelize[_0x790c('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x790c('0x2')]}}; \ No newline at end of file +var _0xa1b9=['INTEGER','sequelize'];(function(_0x218cca,_0x2e2b49){var _0x468276=function(_0x1b400b){while(--_0x1b400b){_0x218cca['push'](_0x218cca['shift']());}};_0x468276(++_0x2e2b49);}(_0xa1b9,0x71));var _0x9a1b=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa1b9[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x9a1b('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x9a1b('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x9a1b('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 0f981c5..52abfea 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 _0x115a=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix'];(function(_0x353cba,_0x48c7f4){var _0x41d128=function(_0x42451e){while(--_0x42451e){_0x353cba['push'](_0x353cba['shift']());}};_0x41d128(++_0x48c7f4);}(_0x115a,0x91));var _0xa115=function(_0x2adfd7,_0x249077){_0x2adfd7=_0x2adfd7-0x0;var _0x4bbe21=_0x115a[_0x2adfd7];return _0x4bbe21;};'use strict';var _=require(_0xa115('0x0'));var util=require(_0xa115('0x1'));var logger=require(_0xa115('0x2'))(_0xa115('0x3'));var moment=require(_0xa115('0x4'));var BPromise=require('bluebird');var rp=require(_0xa115('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa115('0x6'));var config=require(_0xa115('0x7'));var attributes=require(_0xa115('0x8'));module[_0xa115('0x9')]=function(_0x1ab6f9,_0x234bed){return _0x1ab6f9['define'](_0xa115('0xa'),attributes,{'tableName':_0xa115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c32=['../../config/logger','moment','path','rimraf','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9c32,0x15d));var _0x29c3=function(_0x1ef42e,_0x2b4a07){_0x1ef42e=_0x1ef42e-0x0;var _0x1b9020=_0x9c32[_0x1ef42e];return _0x1b9020;};'use strict';var _=require(_0x29c3('0x0'));var util=require(_0x29c3('0x1'));var logger=require(_0x29c3('0x2'))('api');var moment=require(_0x29c3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x29c3('0x4'));var rimraf=require(_0x29c3('0x5'));var config=require('../../config/environment');var attributes=require(_0x29c3('0x6'));module['exports']=function(_0xd8ab32,_0x597fa9){return _0xd8ab32['define'](_0x29c3('0x7'),attributes,{'tableName':_0x29c3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a3f69b9..777d103 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x37d201,_0x5b93ad){var _0x1a9e65=function(_0x596a56){while(--_0x596a56){_0x37d201['push'](_0x37d201['shift']());}};_0x1a9e65(++_0x5b93ad);}(_0xe706,0xa3));var _0x6e70=function(_0x39c8f2,_0x23df6c){_0x39c8f2=_0x39c8f2-0x0;var _0x445526=_0xe706[_0x39c8f2];return _0x445526;};'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(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 5a63351..1b8ca57 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 _0xb38e=['exports','INTEGER','sequelize'];(function(_0x206820,_0x42b3e2){var _0x4b2d64=function(_0x4033f0){while(--_0x4033f0){_0x206820['push'](_0x206820['shift']());}};_0x4b2d64(++_0x42b3e2);}(_0xb38e,0xa7));var _0xeb38=function(_0x1096d9,_0x26b488){_0x1096d9=_0x1096d9-0x0;var _0x43eeb2=_0xb38e[_0x1096d9];return _0x43eeb2;};'use strict';var Sequelize=require(_0xeb38('0x0'));module[_0xeb38('0x1')]={'penalty':{'type':Sequelize[_0xeb38('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e0f=['INTEGER'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x6e0f,0x8b));var _0xf6e0=function(_0x1cabe3,_0x28f649){_0x1cabe3=_0x1cabe3-0x0;var _0x318683=_0x6e0f[_0x1cabe3];return _0x318683;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xf6e0('0x0')],'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 f9746c3..1f49767 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 _0x25b0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x43655a,_0x5a5c3d){var _0x70e252=function(_0x51b3b6){while(--_0x51b3b6){_0x43655a['push'](_0x43655a['shift']());}};_0x70e252(++_0x5a5c3d);}(_0x25b0,0x140));var _0x025b=function(_0x1e0846,_0x4aea1b){_0x1e0846=_0x1e0846-0x0;var _0x57e5d7=_0x25b0[_0x1e0846];return _0x57e5d7;};'use strict';var _=require(_0x025b('0x0'));var util=require(_0x025b('0x1'));var logger=require(_0x025b('0x2'))(_0x025b('0x3'));var moment=require(_0x025b('0x4'));var BPromise=require(_0x025b('0x5'));var rp=require(_0x025b('0x6'));var fs=require('fs');var path=require(_0x025b('0x7'));var rimraf=require(_0x025b('0x8'));var config=require(_0x025b('0x9'));var attributes=require('./teamVoiceQueue.attributes');module[_0x025b('0xa')]=function(_0x41b88b,_0x41d8a4){return _0x41b88b['define'](_0x025b('0xb'),attributes,{'tableName':_0x025b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38c3=['api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x54ea23,_0xd3caaa){var _0x1442f4=function(_0x24b43f){while(--_0x24b43f){_0x54ea23['push'](_0x54ea23['shift']());}};_0x1442f4(++_0xd3caaa);}(_0x38c3,0x13d));var _0x338c=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x38c3[_0x560448];return _0x550276;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var logger=require('../../config/logger')(_0x338c('0x2'));var moment=require(_0x338c('0x3'));var BPromise=require(_0x338c('0x4'));var rp=require(_0x338c('0x5'));var fs=require('fs');var path=require(_0x338c('0x6'));var rimraf=require(_0x338c('0x7'));var config=require('../../config/environment');var attributes=require(_0x338c('0x8'));module['exports']=function(_0x41c16d,_0x28eeb3){return _0x41c16d['define'](_0x338c('0x9'),attributes,{'tableName':_0x338c('0xa'),'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 097bab3..5822076 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 _0xb845=['then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x379ab2,_0x4741ef){var _0x35c925=function(_0x4aac28){while(--_0x4aac28){_0x379ab2['push'](_0x379ab2['shift']());}};_0x35c925(++_0x4741ef);}(_0xb845,0x18b));var _0x5b84=function(_0x5e624d,_0x1e8e8e){_0x5e624d=_0x5e624d-0x0;var _0x6296f6=_0xb845[_0x5e624d];return _0x6296f6;};'use strict';var _=require('lodash');var util=require(_0x5b84('0x0'));var moment=require(_0x5b84('0x1'));var BPromise=require(_0x5b84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b84('0x3'));var db=require(_0x5b84('0x4'))['db'];var utils=require(_0x5b84('0x5'));var logger=require(_0x5b84('0x6'))(_0x5b84('0x7'));var config=require(_0x5b84('0x8'));var jayson=require(_0x5b84('0x9'));var client=jayson[_0x5b84('0xa')][_0x5b84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4247a3,_0x15ad52,_0x39ef33){return new BPromise(function(_0x2d97a8,_0x2e3929){return client[_0x5b84('0xc')](_0x4247a3,_0x39ef33)[_0x5b84('0xd')](function(_0x1e8b88){logger[_0x5b84('0xe')](_0x5b84('0xf'),_0x15ad52,_0x5b84('0x10'));logger[_0x5b84('0x11')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x15ad52,_0x5b84('0x10'),JSON[_0x5b84('0x12')](_0x1e8b88));if(_0x1e8b88[_0x5b84('0x13')]){if(_0x1e8b88['error'][_0x5b84('0x14')]===0x1f4){logger[_0x5b84('0x13')](_0x5b84('0xf'),_0x15ad52,_0x1e8b88[_0x5b84('0x13')][_0x5b84('0x15')]);return _0x2e3929(_0x1e8b88[_0x5b84('0x13')][_0x5b84('0x15')]);}logger[_0x5b84('0x13')](_0x5b84('0xf'),_0x15ad52,_0x1e8b88['error']['message']);return _0x2d97a8(_0x1e8b88[_0x5b84('0x13')][_0x5b84('0x15')]);}else{logger[_0x5b84('0xe')](_0x5b84('0xf'),_0x15ad52,_0x5b84('0x10'));_0x2d97a8(_0x1e8b88[_0x5b84('0x16')][_0x5b84('0x15')]);}})[_0x5b84('0x17')](function(_0x9e5b30){logger[_0x5b84('0x13')](_0x5b84('0xf'),_0x15ad52,_0x9e5b30);_0x2e3929(_0x9e5b30);});});} \ No newline at end of file +var _0x2318=['client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e6a5f,_0x4a9617){var _0x2e2300=function(_0x23564e){while(--_0x23564e){_0x3e6a5f['push'](_0x3e6a5f['shift']());}};_0x2e2300(++_0x4a9617);}(_0x2318,0x115));var _0x8231=function(_0x186166,_0x466d35){_0x186166=_0x186166-0x0;var _0xf4b948=_0x2318[_0x186166];return _0xf4b948;};'use strict';var _=require('lodash');var util=require(_0x8231('0x0'));var moment=require(_0x8231('0x1'));var BPromise=require(_0x8231('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8231('0x3'));var db=require(_0x8231('0x4'))['db'];var utils=require(_0x8231('0x5'));var logger=require(_0x8231('0x6'))(_0x8231('0x7'));var config=require(_0x8231('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8231('0x9')][_0x8231('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50bc74,_0x5e6571,_0xd3e13f){return new BPromise(function(_0x436c0b,_0x4dd613){return client[_0x8231('0xb')](_0x50bc74,_0xd3e13f)[_0x8231('0xc')](function(_0x4a6746){logger[_0x8231('0xd')](_0x8231('0xe'),_0x5e6571,_0x8231('0xf'));logger[_0x8231('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5e6571,_0x8231('0xf'),JSON[_0x8231('0x11')](_0x4a6746));if(_0x4a6746[_0x8231('0x12')]){if(_0x4a6746[_0x8231('0x12')]['code']===0x1f4){logger[_0x8231('0x12')](_0x8231('0xe'),_0x5e6571,_0x4a6746[_0x8231('0x12')][_0x8231('0x13')]);return _0x4dd613(_0x4a6746[_0x8231('0x12')]['message']);}logger[_0x8231('0x12')](_0x8231('0xe'),_0x5e6571,_0x4a6746[_0x8231('0x12')]['message']);return _0x436c0b(_0x4a6746[_0x8231('0x12')][_0x8231('0x13')]);}else{logger[_0x8231('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5e6571,_0x8231('0xf'));_0x436c0b(_0x4a6746[_0x8231('0x14')]['message']);}})[_0x8231('0x15')](function(_0x2cf898){logger[_0x8231('0x12')](_0x8231('0xe'),_0x5e6571,_0x2cf898);_0x4dd613(_0x2cf898);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d6f3f62..ad46172 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 _0x6132=['update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','./template.controller','isAuthenticated','index','get','show','create','/:id'];(function(_0x443689,_0x331504){var _0x2a6a9b=function(_0x263160){while(--_0x263160){_0x443689['push'](_0x443689['shift']());}};_0x2a6a9b(++_0x331504);}(_0x6132,0xf3));var _0x2613=function(_0x134e4c,_0x4a0bfc){_0x134e4c=_0x134e4c-0x0;var _0x3a536a=_0x6132[_0x134e4c];return _0x3a536a;};'use strict';var multer=require('multer');var util=require(_0x2613('0x0'));var path=require('path');var timeout=require(_0x2613('0x1'));var express=require(_0x2613('0x2'));var router=express[_0x2613('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2613('0x4'));var config=require('../../config/environment');var controller=require(_0x2613('0x5'));router['get']('/',auth[_0x2613('0x6')](),controller[_0x2613('0x7')]);router[_0x2613('0x8')]('/:id',auth[_0x2613('0x6')](),controller[_0x2613('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2613('0xa')]);router['put'](_0x2613('0xb'),auth[_0x2613('0x6')](),controller[_0x2613('0xc')]);router[_0x2613('0xd')](_0x2613('0xb'),auth[_0x2613('0x6')](),controller['destroy']);module[_0x2613('0xe')]=router; \ No newline at end of file +var _0x4efb=['../../components/interaction/service','./template.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x4efb,0xfa));var _0xb4ef=function(_0x2f57ce,_0x264bf5){_0x2f57ce=_0x2f57ce-0x0;var _0x53ab87=_0x4efb[_0x2f57ce];return _0x53ab87;};'use strict';var multer=require('multer');var util=require(_0xb4ef('0x0'));var path=require(_0xb4ef('0x1'));var timeout=require(_0xb4ef('0x2'));var express=require('express');var router=express[_0xb4ef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb4ef('0x4'));var interaction=require(_0xb4ef('0x5'));var config=require('../../config/environment');var controller=require(_0xb4ef('0x6'));router['get']('/',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x8')]);router[_0xb4ef('0x9')](_0xb4ef('0xa'),auth[_0xb4ef('0x7')](),controller['show']);router[_0xb4ef('0xb')]('/',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0xc')]);router[_0xb4ef('0xd')](_0xb4ef('0xa'),auth[_0xb4ef('0x7')](),controller['update']);router[_0xb4ef('0xe')]('/:id',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0xf')]);module[_0xb4ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0728c20..7872b0d 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 _0xd0de=['exports','STRING'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xd0de,0x126));var _0xed0d=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xd0de[_0x25662e];return _0x59b7bc;};'use strict';var Sequelize=require('sequelize');module[_0xed0d('0x0')]={'name':{'type':Sequelize[_0xed0d('0x1')]},'description':{'type':Sequelize[_0xed0d('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf48c=['STRING','TEXT','exports'];(function(_0x19dda8,_0x596881){var _0x2667ed=function(_0xb5daee){while(--_0xb5daee){_0x19dda8['push'](_0x19dda8['shift']());}};_0x2667ed(++_0x596881);}(_0xf48c,0x1a0));var _0xcf48=function(_0xf4715c,_0x5e793f){_0xf4715c=_0xf4715c-0x0;var _0x86413d=_0xf48c[_0xf4715c];return _0x86413d;};'use strict';var Sequelize=require('sequelize');module[_0xcf48('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcf48('0x1')]},'html':{'type':Sequelize[_0xcf48('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ef1362a..9bdfb4e 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 _0xe6dd=['get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','Templates','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Template','include','findAll','rows','show','includeAll','catch','create','body','user','role'];(function(_0x2cbc93,_0x728161){var _0x303598=function(_0x4903d9){while(--_0x4903d9){_0x2cbc93['push'](_0x2cbc93['shift']());}};_0x303598(++_0x728161);}(_0xe6dd,0xac));var _0xde6d=function(_0x10effd,_0x351a05){_0x10effd=_0x10effd-0x0;var _0x151f44=_0xe6dd[_0x10effd];return _0x151f44;};'use strict';var emlformat=require(_0xde6d('0x0'));var rimraf=require(_0xde6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde6d('0x2'));var moment=require(_0xde6d('0x3'));var BPromise=require(_0xde6d('0x4'));var Mustache=require(_0xde6d('0x5'));var util=require(_0xde6d('0x6'));var path=require(_0xde6d('0x7'));var sox=require(_0xde6d('0x8'));var csv=require('to-csv');var ejs=require(_0xde6d('0x9'));var fs=require('fs');var fs_extra=require(_0xde6d('0xa'));var _=require('lodash');var squel=require(_0xde6d('0xb'));var crypto=require(_0xde6d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xde6d('0xd'));var toCsv=require(_0xde6d('0xe'));var querystring=require(_0xde6d('0xf'));var Papa=require(_0xde6d('0x10'));var Redis=require(_0xde6d('0x11'));var authService=require(_0xde6d('0x12'));var qs=require(_0xde6d('0x13'));var as=require(_0xde6d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde6d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xde6d('0x16'));var licenseUtil=require(_0xde6d('0x17'));var db=require(_0xde6d('0x18'))['db'];function respondWithStatusCode(_0x42a493,_0x53db4f){_0x53db4f=_0x53db4f||0xcc;return function(_0x325314){if(_0x325314){return _0x42a493[_0xde6d('0x19')](_0x53db4f);}return _0x42a493['status'](_0x53db4f)[_0xde6d('0x1a')]();};}function respondWithResult(_0x1b146f,_0x1ab778){_0x1ab778=_0x1ab778||0xc8;return function(_0x55d74e){if(_0x55d74e){return _0x1b146f[_0xde6d('0x1b')](_0x1ab778)[_0xde6d('0x1c')](_0x55d74e);}};}function respondWithFilteredResult(_0x4b2432,_0x1c91f7){return function(_0x8bbf1b){if(_0x8bbf1b){var _0x108c67=typeof _0x1c91f7['offset']==='undefined'&&typeof _0x1c91f7[_0xde6d('0x1d')]==='undefined';var _0x11db16=_0x8bbf1b[_0xde6d('0x1e')];var _0x51d54d=_0x108c67?0x0:_0x1c91f7[_0xde6d('0x1f')];var _0x4b14ab=_0x108c67?_0x8bbf1b[_0xde6d('0x1e')]:_0x1c91f7['offset']+_0x1c91f7['limit'];var _0x319c2c;if(_0x4b14ab>=_0x11db16){_0x4b14ab=_0x11db16;_0x319c2c=0xc8;}else{_0x319c2c=0xce;}_0x4b2432[_0xde6d('0x1b')](_0x319c2c);return _0x4b2432[_0xde6d('0x20')]('Content-Range',_0x51d54d+'-'+_0x4b14ab+'/'+_0x11db16)[_0xde6d('0x1c')](_0x8bbf1b);}return null;};}function patchUpdates(_0x429c57){return function(_0x24dab7){try{jsonpatch[_0xde6d('0x21')](_0x24dab7,_0x429c57,!![]);}catch(_0x2b066a){return BPromise[_0xde6d('0x22')](_0x2b066a);}return _0x24dab7[_0xde6d('0x23')]();};}function saveUpdates(_0x45b79b,_0x310525){return function(_0x1fe79e){if(_0x1fe79e){return _0x1fe79e[_0xde6d('0x24')](_0x45b79b)[_0xde6d('0x25')](function(_0x486447){return _0x486447;});}return null;};}function removeEntity(_0x19f28b,_0xec748e){return function(_0x265c88){if(_0x265c88){return _0x265c88[_0xde6d('0x26')]()[_0xde6d('0x25')](function(){var _0x392c59=_0x265c88['get']({'plain':!![]});var _0x441e5d=_0xde6d('0x27');return db[_0xde6d('0x28')]['destroy']({'where':{'type':_0x441e5d,'resourceId':_0x392c59['id']}})[_0xde6d('0x25')](function(){return _0x265c88;});})[_0xde6d('0x25')](function(){_0x19f28b[_0xde6d('0x1b')](0xcc)[_0xde6d('0x1a')]();});}};}function handleEntityNotFound(_0x1a67ff,_0x13f09f){return function(_0x2309a9){if(!_0x2309a9){_0x1a67ff[_0xde6d('0x19')](0x194);}return _0x2309a9;};}function handleError(_0x137139,_0xfe8849){_0xfe8849=_0xfe8849||0x1f4;return function(_0x51fbef){logger[_0xde6d('0x29')](_0x51fbef[_0xde6d('0x2a')]);if(_0x51fbef['name']){delete _0x51fbef[_0xde6d('0x2b')];}_0x137139[_0xde6d('0x1b')](_0xfe8849)['send'](_0x51fbef);};}exports['index']=function(_0x4a7f06,_0x1aef26){var _0x5147b5={},_0x4e33fd={},_0x28b622={'count':0x0,'rows':[]};var _0x10396d=_[_0xde6d('0x2c')](db['Template'][_0xde6d('0x2d')],function(_0x44cd1b){return{'name':_0x44cd1b[_0xde6d('0x2e')],'type':_0x44cd1b[_0xde6d('0x2f')]['key']};});_0x4e33fd[_0xde6d('0x30')]=_['map'](_0x10396d,_0xde6d('0x2b'));_0x4e33fd[_0xde6d('0x31')]=_[_0xde6d('0x32')](_0x4a7f06[_0xde6d('0x31')]);_0x4e33fd[_0xde6d('0x33')]=_[_0xde6d('0x34')](_0x4e33fd[_0xde6d('0x30')],_0x4e33fd['query']);_0x5147b5[_0xde6d('0x35')]=_[_0xde6d('0x34')](_0x4e33fd[_0xde6d('0x30')],qs[_0xde6d('0x36')](_0x4a7f06[_0xde6d('0x31')][_0xde6d('0x36')]));_0x5147b5[_0xde6d('0x35')]=_0x5147b5[_0xde6d('0x35')][_0xde6d('0x37')]?_0x5147b5[_0xde6d('0x35')]:_0x4e33fd[_0xde6d('0x30')];if(!_0x4a7f06[_0xde6d('0x31')][_0xde6d('0x38')](_0xde6d('0x39'))){_0x5147b5['limit']=qs[_0xde6d('0x1d')](_0x4a7f06['query'][_0xde6d('0x1d')]);_0x5147b5['offset']=qs['offset'](_0x4a7f06[_0xde6d('0x31')][_0xde6d('0x1f')]);}_0x5147b5[_0xde6d('0x3a')]=qs[_0xde6d('0x3b')](_0x4a7f06['query']['sort']);_0x5147b5[_0xde6d('0x3c')]=qs[_0xde6d('0x33')](_[_0xde6d('0x3d')](_0x4a7f06[_0xde6d('0x31')],_0x4e33fd['filters']),_0x10396d);if(_0x4a7f06[_0xde6d('0x31')]['filter']){_0x5147b5['where']=_['merge'](_0x5147b5[_0xde6d('0x3c')],{'$or':_[_0xde6d('0x2c')](_0x10396d,function(_0x421680){if(_0x421680[_0xde6d('0x2f')]!==_0xde6d('0x3e')){var _0x1b881f={};_0x1b881f[_0x421680[_0xde6d('0x2b')]]={'$like':'%'+_0x4a7f06['query'][_0xde6d('0x3f')]+'%'};return _0x1b881f;}})});}_0x5147b5=_[_0xde6d('0x40')]({},_0x5147b5,_0x4a7f06[_0xde6d('0x41')]);var _0x474bb1={'where':_0x5147b5['where']};return db[_0xde6d('0x42')][_0xde6d('0x1e')](_0x474bb1)[_0xde6d('0x25')](function(_0x11305e){_0x28b622[_0xde6d('0x1e')]=_0x11305e;if(_0x4a7f06['query']['includeAll']){_0x5147b5[_0xde6d('0x43')]=[{'all':!![]}];}return db[_0xde6d('0x42')][_0xde6d('0x44')](_0x5147b5);})[_0xde6d('0x25')](function(_0x16f0de){_0x28b622[_0xde6d('0x45')]=_0x16f0de;return _0x28b622;})['then'](respondWithFilteredResult(_0x1aef26,_0x5147b5))['catch'](handleError(_0x1aef26,null));};exports[_0xde6d('0x46')]=function(_0x2dc321,_0x3992c1){var _0x3f362f={'raw':!![],'where':{'id':_0x2dc321['params']['id']}},_0x28e1b2={};_0x28e1b2[_0xde6d('0x30')]=_['keys'](db[_0xde6d('0x42')][_0xde6d('0x2d')]);_0x28e1b2['query']=_['keys'](_0x2dc321[_0xde6d('0x31')]);_0x28e1b2[_0xde6d('0x33')]=_[_0xde6d('0x34')](_0x28e1b2['model'],_0x28e1b2[_0xde6d('0x31')]);_0x3f362f['attributes']=_['intersection'](_0x28e1b2[_0xde6d('0x30')],qs[_0xde6d('0x36')](_0x2dc321['query'][_0xde6d('0x36')]));_0x3f362f[_0xde6d('0x35')]=_0x3f362f['attributes'][_0xde6d('0x37')]?_0x3f362f[_0xde6d('0x35')]:_0x28e1b2[_0xde6d('0x30')];if(_0x2dc321['query'][_0xde6d('0x47')]){_0x3f362f[_0xde6d('0x43')]=[{'all':!![]}];}_0x3f362f=_[_0xde6d('0x40')]({},_0x3f362f,_0x2dc321[_0xde6d('0x41')]);return db[_0xde6d('0x42')]['find'](_0x3f362f)[_0xde6d('0x25')](handleEntityNotFound(_0x3992c1,null))['then'](respondWithResult(_0x3992c1,null))[_0xde6d('0x48')](handleError(_0x3992c1,null));};exports[_0xde6d('0x49')]=function(_0x374bc8,_0x2661cb){return db[_0xde6d('0x42')][_0xde6d('0x49')](_0x374bc8[_0xde6d('0x4a')],{})['then'](function(_0x16f3f9){var _0x55203d=_0x374bc8[_0xde6d('0x4b')]['get']({'plain':!![]});if(!_0x55203d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55203d[_0xde6d('0x4c')]===_0xde6d('0x4b')){var _0xe6f3a7=_0x16f3f9[_0xde6d('0x4d')]({'plain':!![]});var _0x29f0b9='Templates';return db['UserProfileSection'][_0xde6d('0x4e')]({'where':{'name':_0x29f0b9,'userProfileId':_0x55203d[_0xde6d('0x4f')]},'raw':!![]})[_0xde6d('0x25')](function(_0x54c522){if(_0x54c522&&_0x54c522[_0xde6d('0x50')]===0x0){return db[_0xde6d('0x28')][_0xde6d('0x49')]({'name':_0xe6f3a7['name'],'resourceId':_0xe6f3a7['id'],'type':_0x54c522[_0xde6d('0x2b')],'sectionId':_0x54c522['id']},{})[_0xde6d('0x25')](function(){return _0x16f3f9;});}else{return _0x16f3f9;}})[_0xde6d('0x48')](function(_0x59b502){logger['error'](_0xde6d('0x51'),_0x59b502);throw _0x59b502;});}return _0x16f3f9;})[_0xde6d('0x25')](respondWithResult(_0x2661cb,0xc9))[_0xde6d('0x48')](handleError(_0x2661cb,null));};exports[_0xde6d('0x24')]=function(_0x26383c,_0x3b39ca){if(_0x26383c['body']['id']){delete _0x26383c[_0xde6d('0x4a')]['id'];}return db['Template'][_0xde6d('0x4e')]({'where':{'id':_0x26383c[_0xde6d('0x52')]['id']}})[_0xde6d('0x25')](handleEntityNotFound(_0x3b39ca,null))[_0xde6d('0x25')](saveUpdates(_0x26383c[_0xde6d('0x4a')],null))[_0xde6d('0x25')](respondWithResult(_0x3b39ca,null))['catch'](handleError(_0x3b39ca,null));};exports[_0xde6d('0x26')]=function(_0x1a252e,_0x3114b0){return db[_0xde6d('0x42')][_0xde6d('0x4e')]({'where':{'id':_0x1a252e[_0xde6d('0x52')]['id']}})[_0xde6d('0x25')](handleEntityNotFound(_0x3114b0,null))['then'](removeEntity(_0x3114b0,null))['catch'](handleError(_0x3114b0,null));}; \ No newline at end of file +var _0x0513=['includeAll','include','findAll','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','find','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x38694b,_0x4eccd0){var _0x1db6ea=function(_0x46e248){while(--_0x46e248){_0x38694b['push'](_0x38694b['shift']());}};_0x1db6ea(++_0x4eccd0);}(_0x0513,0x1a1));var _0x3051=function(_0x2c115f,_0x2c7039){_0x2c115f=_0x2c115f-0x0;var _0x4b25ea=_0x0513[_0x2c115f];return _0x4b25ea;};'use strict';var emlformat=require(_0x3051('0x0'));var rimraf=require(_0x3051('0x1'));var zipdir=require(_0x3051('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3051('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3051('0x4'));var path=require(_0x3051('0x5'));var sox=require(_0x3051('0x6'));var csv=require(_0x3051('0x7'));var ejs=require(_0x3051('0x8'));var fs=require('fs');var fs_extra=require(_0x3051('0x9'));var _=require(_0x3051('0xa'));var squel=require(_0x3051('0xb'));var crypto=require(_0x3051('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3051('0xd'));var toCsv=require(_0x3051('0x7'));var querystring=require(_0x3051('0xe'));var Papa=require(_0x3051('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3051('0x10'));var as=require(_0x3051('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3051('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3051('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7229be,_0x45d787){_0x45d787=_0x45d787||0xcc;return function(_0x63e4ac){if(_0x63e4ac){return _0x7229be['sendStatus'](_0x45d787);}return _0x7229be[_0x3051('0x14')](_0x45d787)[_0x3051('0x15')]();};}function respondWithResult(_0x53aeb8,_0x4011f6){_0x4011f6=_0x4011f6||0xc8;return function(_0x27b325){if(_0x27b325){return _0x53aeb8['status'](_0x4011f6)['json'](_0x27b325);}};}function respondWithFilteredResult(_0x581062,_0x1f61e8){return function(_0x23e472){if(_0x23e472){var _0x2325e6=typeof _0x1f61e8[_0x3051('0x16')]===_0x3051('0x17')&&typeof _0x1f61e8[_0x3051('0x18')]===_0x3051('0x17');var _0x5de487=_0x23e472[_0x3051('0x19')];var _0x12b5b3=_0x2325e6?0x0:_0x1f61e8[_0x3051('0x16')];var _0x4ab2ab=_0x2325e6?_0x23e472['count']:_0x1f61e8['offset']+_0x1f61e8[_0x3051('0x18')];var _0x1b87c5;if(_0x4ab2ab>=_0x5de487){_0x4ab2ab=_0x5de487;_0x1b87c5=0xc8;}else{_0x1b87c5=0xce;}_0x581062[_0x3051('0x14')](_0x1b87c5);return _0x581062[_0x3051('0x1a')](_0x3051('0x1b'),_0x12b5b3+'-'+_0x4ab2ab+'/'+_0x5de487)[_0x3051('0x1c')](_0x23e472);}return null;};}function patchUpdates(_0x2b15df){return function(_0x2ff382){try{jsonpatch[_0x3051('0x1d')](_0x2ff382,_0x2b15df,!![]);}catch(_0x5a1ff5){return BPromise[_0x3051('0x1e')](_0x5a1ff5);}return _0x2ff382[_0x3051('0x1f')]();};}function saveUpdates(_0x366d1e,_0x3839ca){return function(_0x45b87d){if(_0x45b87d){return _0x45b87d[_0x3051('0x20')](_0x366d1e)[_0x3051('0x21')](function(_0x5807dc){return _0x5807dc;});}return null;};}function removeEntity(_0x1eaf77,_0x328d02){return function(_0x41d11c){if(_0x41d11c){return _0x41d11c[_0x3051('0x22')]()[_0x3051('0x21')](function(){var _0x3a4a83=_0x41d11c[_0x3051('0x23')]({'plain':!![]});var _0x3233e5='Templates';return db[_0x3051('0x24')][_0x3051('0x22')]({'where':{'type':_0x3233e5,'resourceId':_0x3a4a83['id']}})[_0x3051('0x21')](function(){return _0x41d11c;});})[_0x3051('0x21')](function(){_0x1eaf77[_0x3051('0x14')](0xcc)[_0x3051('0x15')]();});}};}function handleEntityNotFound(_0x26a805,_0x30b149){return function(_0x2793b6){if(!_0x2793b6){_0x26a805['sendStatus'](0x194);}return _0x2793b6;};}function handleError(_0x2c8f4e,_0x450bed){_0x450bed=_0x450bed||0x1f4;return function(_0x534993){logger[_0x3051('0x25')](_0x534993[_0x3051('0x26')]);if(_0x534993[_0x3051('0x27')]){delete _0x534993[_0x3051('0x27')];}_0x2c8f4e[_0x3051('0x14')](_0x450bed)[_0x3051('0x28')](_0x534993);};}exports[_0x3051('0x29')]=function(_0x563c5c,_0xb98cb2){var _0xbcd130={},_0x358ec9={},_0x342443={'count':0x0,'rows':[]};var _0x5ca381=_[_0x3051('0x2a')](db[_0x3051('0x2b')][_0x3051('0x2c')],function(_0x1a1643){return{'name':_0x1a1643[_0x3051('0x2d')],'type':_0x1a1643[_0x3051('0x2e')]['key']};});_0x358ec9[_0x3051('0x2f')]=_[_0x3051('0x2a')](_0x5ca381,_0x3051('0x27'));_0x358ec9[_0x3051('0x30')]=_['keys'](_0x563c5c[_0x3051('0x30')]);_0x358ec9[_0x3051('0x31')]=_[_0x3051('0x32')](_0x358ec9[_0x3051('0x2f')],_0x358ec9['query']);_0xbcd130[_0x3051('0x33')]=_['intersection'](_0x358ec9[_0x3051('0x2f')],qs[_0x3051('0x34')](_0x563c5c[_0x3051('0x30')][_0x3051('0x34')]));_0xbcd130['attributes']=_0xbcd130[_0x3051('0x33')][_0x3051('0x35')]?_0xbcd130[_0x3051('0x33')]:_0x358ec9[_0x3051('0x2f')];if(!_0x563c5c[_0x3051('0x30')]['hasOwnProperty'](_0x3051('0x36'))){_0xbcd130[_0x3051('0x18')]=qs[_0x3051('0x18')](_0x563c5c[_0x3051('0x30')][_0x3051('0x18')]);_0xbcd130[_0x3051('0x16')]=qs[_0x3051('0x16')](_0x563c5c[_0x3051('0x30')][_0x3051('0x16')]);}_0xbcd130[_0x3051('0x37')]=qs[_0x3051('0x38')](_0x563c5c['query'][_0x3051('0x38')]);_0xbcd130[_0x3051('0x39')]=qs[_0x3051('0x31')](_[_0x3051('0x3a')](_0x563c5c[_0x3051('0x30')],_0x358ec9[_0x3051('0x31')]),_0x5ca381);if(_0x563c5c[_0x3051('0x30')][_0x3051('0x3b')]){_0xbcd130[_0x3051('0x39')]=_[_0x3051('0x3c')](_0xbcd130[_0x3051('0x39')],{'$or':_['map'](_0x5ca381,function(_0x1a15ff){if(_0x1a15ff[_0x3051('0x2e')]!==_0x3051('0x3d')){var _0x2656d1={};_0x2656d1[_0x1a15ff[_0x3051('0x27')]]={'$like':'%'+_0x563c5c['query'][_0x3051('0x3b')]+'%'};return _0x2656d1;}})});}_0xbcd130=_[_0x3051('0x3c')]({},_0xbcd130,_0x563c5c[_0x3051('0x3e')]);var _0x22ccfb={'where':_0xbcd130[_0x3051('0x39')]};return db[_0x3051('0x2b')][_0x3051('0x19')](_0x22ccfb)[_0x3051('0x21')](function(_0x367519){_0x342443[_0x3051('0x19')]=_0x367519;if(_0x563c5c['query'][_0x3051('0x3f')]){_0xbcd130[_0x3051('0x40')]=[{'all':!![]}];}return db[_0x3051('0x2b')][_0x3051('0x41')](_0xbcd130);})[_0x3051('0x21')](function(_0x585a2e){_0x342443['rows']=_0x585a2e;return _0x342443;})[_0x3051('0x21')](respondWithFilteredResult(_0xb98cb2,_0xbcd130))[_0x3051('0x42')](handleError(_0xb98cb2,null));};exports[_0x3051('0x43')]=function(_0x2184d9,_0x3fc83e){var _0x33b31c={'raw':!![],'where':{'id':_0x2184d9[_0x3051('0x44')]['id']}},_0x3e406c={};_0x3e406c[_0x3051('0x2f')]=_[_0x3051('0x45')](db[_0x3051('0x2b')][_0x3051('0x2c')]);_0x3e406c['query']=_[_0x3051('0x45')](_0x2184d9[_0x3051('0x30')]);_0x3e406c[_0x3051('0x31')]=_['intersection'](_0x3e406c[_0x3051('0x2f')],_0x3e406c[_0x3051('0x30')]);_0x33b31c[_0x3051('0x33')]=_['intersection'](_0x3e406c[_0x3051('0x2f')],qs[_0x3051('0x34')](_0x2184d9[_0x3051('0x30')][_0x3051('0x34')]));_0x33b31c[_0x3051('0x33')]=_0x33b31c[_0x3051('0x33')][_0x3051('0x35')]?_0x33b31c['attributes']:_0x3e406c[_0x3051('0x2f')];if(_0x2184d9[_0x3051('0x30')][_0x3051('0x3f')]){_0x33b31c[_0x3051('0x40')]=[{'all':!![]}];}_0x33b31c=_[_0x3051('0x3c')]({},_0x33b31c,_0x2184d9[_0x3051('0x3e')]);return db['Template']['find'](_0x33b31c)['then'](handleEntityNotFound(_0x3fc83e,null))[_0x3051('0x21')](respondWithResult(_0x3fc83e,null))['catch'](handleError(_0x3fc83e,null));};exports[_0x3051('0x46')]=function(_0x243719,_0xf5134){return db['Template'][_0x3051('0x46')](_0x243719['body'],{})[_0x3051('0x21')](function(_0x51ec3c){var _0x846ab=_0x243719[_0x3051('0x47')][_0x3051('0x23')]({'plain':!![]});if(!_0x846ab)throw new Error(_0x3051('0x48'));if(_0x846ab[_0x3051('0x49')]==='user'){var _0x453018=_0x51ec3c[_0x3051('0x23')]({'plain':!![]});var _0x56bd14=_0x3051('0x4a');return db[_0x3051('0x4b')][_0x3051('0x4c')]({'where':{'name':_0x56bd14,'userProfileId':_0x846ab[_0x3051('0x4d')]},'raw':!![]})[_0x3051('0x21')](function(_0x2a309c){if(_0x2a309c&&_0x2a309c[_0x3051('0x4e')]===0x0){return db[_0x3051('0x24')][_0x3051('0x46')]({'name':_0x453018['name'],'resourceId':_0x453018['id'],'type':_0x2a309c[_0x3051('0x27')],'sectionId':_0x2a309c['id']},{})['then'](function(){return _0x51ec3c;});}else{return _0x51ec3c;}})['catch'](function(_0x2fe717){logger[_0x3051('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fe717);throw _0x2fe717;});}return _0x51ec3c;})[_0x3051('0x21')](respondWithResult(_0xf5134,0xc9))['catch'](handleError(_0xf5134,null));};exports['update']=function(_0x4586a4,_0xb059e7){if(_0x4586a4[_0x3051('0x4f')]['id']){delete _0x4586a4['body']['id'];}return db[_0x3051('0x2b')][_0x3051('0x4c')]({'where':{'id':_0x4586a4[_0x3051('0x44')]['id']}})[_0x3051('0x21')](handleEntityNotFound(_0xb059e7,null))['then'](saveUpdates(_0x4586a4['body'],null))[_0x3051('0x21')](respondWithResult(_0xb059e7,null))[_0x3051('0x42')](handleError(_0xb059e7,null));};exports[_0x3051('0x22')]=function(_0x2342eb,_0x38706b){return db[_0x3051('0x2b')][_0x3051('0x4c')]({'where':{'id':_0x2342eb[_0x3051('0x44')]['id']}})[_0x3051('0x21')](handleEntityNotFound(_0x38706b,null))[_0x3051('0x21')](removeEntity(_0x38706b,null))[_0x3051('0x42')](handleError(_0x38706b,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 52c6d2a..0968849 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 _0xcb05=['exports','tools_templates','lodash','util','moment','request-promise','path','./template.attributes'];(function(_0x1835d4,_0x52e3f9){var _0x1b6a4c=function(_0xeddd42){while(--_0xeddd42){_0x1835d4['push'](_0x1835d4['shift']());}};_0x1b6a4c(++_0x52e3f9);}(_0xcb05,0x12a));var _0x5cb0=function(_0x4a9307,_0x25b8c0){_0x4a9307=_0x4a9307-0x0;var _0x74abd1=_0xcb05[_0x4a9307];return _0x74abd1;};'use strict';var _=require(_0x5cb0('0x0'));var util=require(_0x5cb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5cb0('0x2'));var BPromise=require('bluebird');var rp=require(_0x5cb0('0x3'));var fs=require('fs');var path=require(_0x5cb0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5cb0('0x5'));module[_0x5cb0('0x6')]=function(_0x575e82,_0x22687a){return _0x575e82['define']('Template',attributes,{'tableName':_0x5cb0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3cb=['exports','define','Template','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xcc97d8,_0x32f990){var _0x1a7efc=function(_0x5b91bd){while(--_0x5b91bd){_0xcc97d8['push'](_0xcc97d8['shift']());}};_0x1a7efc(++_0x32f990);}(_0xe3cb,0x12c));var _0xbe3c=function(_0x1530a4,_0x5abb24){_0x1530a4=_0x1530a4-0x0;var _0x53cda2=_0xe3cb[_0x1530a4];return _0x53cda2;};'use strict';var _=require(_0xbe3c('0x0'));var util=require('util');var logger=require(_0xbe3c('0x1'))(_0xbe3c('0x2'));var moment=require(_0xbe3c('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe3c('0x4'));var fs=require('fs');var path=require(_0xbe3c('0x5'));var rimraf=require(_0xbe3c('0x6'));var config=require(_0xbe3c('0x7'));var attributes=require('./template.attributes');module[_0xbe3c('0x8')]=function(_0x2a1219,_0x13586e){return _0x2a1219[_0xbe3c('0x9')](_0xbe3c('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 2dcf197..3e21877 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 _0xc0b7=['where','include','model','attributes','map','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw'];(function(_0x5b4972,_0x464200){var _0x6df520=function(_0x377edc){while(--_0x377edc){_0x5b4972['push'](_0x5b4972['shift']());}};_0x6df520(++_0x464200);}(_0xc0b7,0x170));var _0x7c0b=function(_0x340776,_0x6a8225){_0x340776=_0x340776-0x0;var _0x4b705b=_0xc0b7[_0x340776];return _0x4b705b;};'use strict';var _=require('lodash');var util=require(_0x7c0b('0x0'));var moment=require('moment');var BPromise=require(_0x7c0b('0x1'));var rs=require(_0x7c0b('0x2'));var fs=require('fs');var Redis=require(_0x7c0b('0x3'));var db=require(_0x7c0b('0x4'))['db'];var utils=require(_0x7c0b('0x5'));var logger=require(_0x7c0b('0x6'))(_0x7c0b('0x7'));var config=require(_0x7c0b('0x8'));var jayson=require(_0x7c0b('0x9'));var client=jayson[_0x7c0b('0xa')][_0x7c0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b2261,_0x1f575b,_0xe29d1d){return new BPromise(function(_0x596861,_0x3bc773){return client[_0x7c0b('0xc')](_0x1b2261,_0xe29d1d)[_0x7c0b('0xd')](function(_0x19c3cb){logger[_0x7c0b('0xe')]('Template,\x20%s,\x20%s',_0x1f575b,'request\x20sent');logger[_0x7c0b('0xf')](_0x7c0b('0x10'),_0x1f575b,_0x7c0b('0x11'),JSON[_0x7c0b('0x12')](_0x19c3cb));if(_0x19c3cb[_0x7c0b('0x13')]){if(_0x19c3cb[_0x7c0b('0x13')]['code']===0x1f4){logger[_0x7c0b('0x13')](_0x7c0b('0x14'),_0x1f575b,_0x19c3cb[_0x7c0b('0x13')][_0x7c0b('0x15')]);return _0x3bc773(_0x19c3cb[_0x7c0b('0x13')]['message']);}logger[_0x7c0b('0x13')](_0x7c0b('0x14'),_0x1f575b,_0x19c3cb['error'][_0x7c0b('0x15')]);return _0x596861(_0x19c3cb[_0x7c0b('0x13')][_0x7c0b('0x15')]);}else{logger[_0x7c0b('0xe')]('Template,\x20%s,\x20%s',_0x1f575b,_0x7c0b('0x11'));_0x596861(_0x19c3cb[_0x7c0b('0x16')][_0x7c0b('0x15')]);}})[_0x7c0b('0x17')](function(_0x4e5a58){logger['error'](_0x7c0b('0x14'),_0x1f575b,_0x4e5a58);_0x3bc773(_0x4e5a58);});});}exports[_0x7c0b('0x18')]=function(_0x2ae534){var _0x752fe3=this;return new Promise(function(_0x4babeb,_0x119aa1){return db['Template'][_0x7c0b('0x19')]({'raw':_0x2ae534[_0x7c0b('0x1a')]?_0x2ae534[_0x7c0b('0x1a')][_0x7c0b('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ae534[_0x7c0b('0x1a')]?_0x2ae534[_0x7c0b('0x1a')][_0x7c0b('0x1c')]||null:null,'attributes':_0x2ae534[_0x7c0b('0x1a')]?_0x2ae534['options']['attributes']||null:null,'limit':_0x2ae534[_0x7c0b('0x1a')]?_0x2ae534['options']['limit']||null:null,'include':_0x2ae534['options']?_0x2ae534[_0x7c0b('0x1a')][_0x7c0b('0x1d')]?_['map'](_0x2ae534[_0x7c0b('0x1a')][_0x7c0b('0x1d')],function(_0x101488){return{'model':db[_0x101488[_0x7c0b('0x1e')]],'as':_0x101488['as'],'attributes':_0x101488[_0x7c0b('0x1f')],'include':_0x101488[_0x7c0b('0x1d')]?_[_0x7c0b('0x20')](_0x101488[_0x7c0b('0x1d')],function(_0x3b3ecb){return{'model':db[_0x3b3ecb[_0x7c0b('0x1e')]],'as':_0x3b3ecb['as'],'attributes':_0x3b3ecb[_0x7c0b('0x1f')],'include':_0x3b3ecb['include']?_[_0x7c0b('0x20')](_0x3b3ecb[_0x7c0b('0x1d')],function(_0x507716){return{'model':db[_0x507716['model']],'as':_0x507716['as'],'attributes':_0x507716[_0x7c0b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c0b('0xd')](function(_0x146f0c){logger[_0x7c0b('0xe')](_0x7c0b('0x18'),_0x2ae534);logger[_0x7c0b('0xf')]('GetTemplate',_0x2ae534,JSON[_0x7c0b('0x12')](_0x146f0c));_0x4babeb(_0x146f0c);})['catch'](function(_0x454666){logger['error'](_0x7c0b('0x18'),_0x454666[_0x7c0b('0x15')],_0x2ae534);_0x119aa1(_0x752fe3[_0x7c0b('0x13')](0x1f4,_0x454666[_0x7c0b('0x15')]));});});}; \ No newline at end of file +var _0x9e0d=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template','options','raw','where','attributes','map','include','model','GetTemplate','lodash'];(function(_0x34b0d3,_0x55b139){var _0x37c298=function(_0x1678cc){while(--_0x1678cc){_0x34b0d3['push'](_0x34b0d3['shift']());}};_0x37c298(++_0x55b139);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x5294e5,_0x125187){_0x5294e5=_0x5294e5-0x0;var _0x1c4f8a=_0x9e0d[_0x5294e5];return _0x1c4f8a;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});}exports['GetTemplate']=function(_0x209c04){var _0x56421e=this;return new Promise(function(_0x483b74,_0x2fcad6){return db[_0xd9e0('0x16')]['findAll']({'raw':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x18')]===undefined?!![]:![]:!![],'where':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x19')]||null:null,'attributes':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x1a')]||null:null,'limit':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['limit']||null:null,'include':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['include']?_[_0xd9e0('0x1b')](_0x209c04[_0xd9e0('0x17')]['include'],function(_0x357bd9){return{'model':db[_0x357bd9['model']],'as':_0x357bd9['as'],'attributes':_0x357bd9[_0xd9e0('0x1a')],'include':_0x357bd9[_0xd9e0('0x1c')]?_['map'](_0x357bd9[_0xd9e0('0x1c')],function(_0x53cf67){return{'model':db[_0x53cf67['model']],'as':_0x53cf67['as'],'attributes':_0x53cf67['attributes'],'include':_0x53cf67[_0xd9e0('0x1c')]?_[_0xd9e0('0x1b')](_0x53cf67[_0xd9e0('0x1c')],function(_0x1c36df){return{'model':db[_0x1c36df[_0xd9e0('0x1d')]],'as':_0x1c36df['as'],'attributes':_0x1c36df[_0xd9e0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9e0('0xb')](function(_0x5d56ba){logger[_0xd9e0('0xc')](_0xd9e0('0x1e'),_0x209c04);logger[_0xd9e0('0xf')](_0xd9e0('0x1e'),_0x209c04,JSON[_0xd9e0('0x11')](_0x5d56ba));_0x483b74(_0x5d56ba);})['catch'](function(_0x4b4f7d){logger['error'](_0xd9e0('0x1e'),_0x4b4f7d[_0xd9e0('0x14')],_0x209c04);_0x2fcad6(_0x56421e['error'](0x1f4,_0x4b4f7d[_0xd9e0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d2451a1..cfc0d46 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 _0x8fae=['getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','addAction','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions'];(function(_0x4332c8,_0x5b4b88){var _0x3e18ec=function(_0x28844a){while(--_0x28844a){_0x4332c8['push'](_0x4332c8['shift']());}};_0x3e18ec(++_0x5b4b88);}(_0x8fae,0x10d));var _0xe8fa=function(_0x1ddafd,_0x394f73){_0x1ddafd=_0x1ddafd-0x0;var _0x3b3b31=_0x8fae[_0x1ddafd];return _0x3b3b31;};'use strict';var multer=require(_0xe8fa('0x0'));var util=require(_0xe8fa('0x1'));var path=require(_0xe8fa('0x2'));var timeout=require(_0xe8fa('0x3'));var express=require(_0xe8fa('0x4'));var router=express[_0xe8fa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe8fa('0x6'));var interaction=require(_0xe8fa('0x7'));var config=require(_0xe8fa('0x8'));var controller=require(_0xe8fa('0x9'));router[_0xe8fa('0xa')]('/',auth[_0xe8fa('0xb')](),controller['index']);router[_0xe8fa('0xa')](_0xe8fa('0xc'),auth[_0xe8fa('0xb')](),controller[_0xe8fa('0xd')]);router[_0xe8fa('0xa')](_0xe8fa('0xe'),auth[_0xe8fa('0xb')](),controller[_0xe8fa('0xf')]);router[_0xe8fa('0xa')]('/:id/any_conditions',auth[_0xe8fa('0xb')](),controller[_0xe8fa('0x10')]);router[_0xe8fa('0xa')]('/:id/actions',auth[_0xe8fa('0xb')](),controller[_0xe8fa('0x11')]);router[_0xe8fa('0x12')]('/',auth[_0xe8fa('0xb')](),controller['create']);router[_0xe8fa('0x12')](_0xe8fa('0xe'),auth[_0xe8fa('0xb')](),controller[_0xe8fa('0x13')]);router[_0xe8fa('0x12')](_0xe8fa('0x14'),auth['isAuthenticated'](),controller[_0xe8fa('0x15')]);router[_0xe8fa('0x12')](_0xe8fa('0x16'),auth[_0xe8fa('0xb')](),controller[_0xe8fa('0x17')]);router['put']('/:id',auth[_0xe8fa('0xb')](),controller['update']);router[_0xe8fa('0x18')](_0xe8fa('0xc'),auth[_0xe8fa('0xb')](),controller['destroy']);module[_0xe8fa('0x19')]=router; \ No newline at end of file +var _0x012b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','put','update','delete','exports','path','express','Router','fs-extra'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x012b,0x11c));var _0xb012=function(_0x508e2f,_0x40e62d){_0x508e2f=_0x508e2f-0x0;var _0xe91a30=_0x012b[_0x508e2f];return _0xe91a30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb012('0x0'));var timeout=require('connect-timeout');var express=require(_0xb012('0x1'));var router=express[_0xb012('0x2')]();var fs_extra=require(_0xb012('0x3'));var auth=require(_0xb012('0x4'));var interaction=require(_0xb012('0x5'));var config=require(_0xb012('0x6'));var controller=require(_0xb012('0x7'));router[_0xb012('0x8')]('/',auth['isAuthenticated'](),controller[_0xb012('0x9')]);router['get'](_0xb012('0xa'),auth[_0xb012('0xb')](),controller[_0xb012('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router[_0xb012('0x8')](_0xb012('0xd'),auth[_0xb012('0xb')](),controller['getAnyConditions']);router[_0xb012('0x8')](_0xb012('0xe'),auth[_0xb012('0xb')](),controller[_0xb012('0xf')]);router[_0xb012('0x10')]('/',auth[_0xb012('0xb')](),controller[_0xb012('0x11')]);router[_0xb012('0x10')]('/:id/all_conditions',auth[_0xb012('0xb')](),controller[_0xb012('0x12')]);router[_0xb012('0x10')](_0xb012('0xd'),auth[_0xb012('0xb')](),controller[_0xb012('0x13')]);router[_0xb012('0x10')]('/:id/actions',auth[_0xb012('0xb')](),controller['addAction']);router[_0xb012('0x14')](_0xb012('0xa'),auth[_0xb012('0xb')](),controller[_0xb012('0x15')]);router[_0xb012('0x16')](_0xb012('0xa'),auth[_0xb012('0xb')](),controller['destroy']);module[_0xb012('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e89a731..a09ae71 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 _0xd7fd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x10799b,_0x18b7bd){var _0x128f90=function(_0x2475d4){while(--_0x2475d4){_0x10799b['push'](_0x10799b['shift']());}};_0x128f90(++_0x18b7bd);}(_0xd7fd,0x19f));var _0xdd7f=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0xd7fd[_0x1ce236];return _0x241819;};'use strict';var Sequelize=require(_0xdd7f('0x0'));module[_0xdd7f('0x1')]={'name':{'type':Sequelize[_0xdd7f('0x2')]},'channel':{'type':Sequelize[_0xdd7f('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xdd7f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbd72=['BOOLEAN','sequelize','exports','STRING'];(function(_0x303743,_0x51b9ad){var _0x1422f2=function(_0x1211b0){while(--_0x1211b0){_0x303743['push'](_0x303743['shift']());}};_0x1422f2(++_0x51b9ad);}(_0xbd72,0x119));var _0x2bd7=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xbd72[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x2bd7('0x0'));module[_0x2bd7('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2bd7('0x2')]},'description':{'type':Sequelize[_0x2bd7('0x2')]},'status':{'type':Sequelize[_0x2bd7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4e46abf..25e3ac8 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 _0xaec1=['UserProfileResource','stack','name','send','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','order','sort','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Triggers'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaec1,0x15d));var _0x1aec=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xaec1[_0x243217];return _0x478029;};'use strict';var emlformat=require(_0x1aec('0x0'));var rimraf=require(_0x1aec('0x1'));var zipdir=require(_0x1aec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1aec('0x3'));var moment=require(_0x1aec('0x4'));var BPromise=require(_0x1aec('0x5'));var Mustache=require(_0x1aec('0x6'));var util=require(_0x1aec('0x7'));var path=require(_0x1aec('0x8'));var sox=require(_0x1aec('0x9'));var csv=require(_0x1aec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aec('0xb'));var _=require('lodash');var squel=require(_0x1aec('0xc'));var crypto=require(_0x1aec('0xd'));var jsforce=require(_0x1aec('0xe'));var deskjs=require(_0x1aec('0xf'));var toCsv=require(_0x1aec('0xa'));var querystring=require(_0x1aec('0x10'));var Papa=require(_0x1aec('0x11'));var Redis=require(_0x1aec('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1aec('0x13'));var as=require(_0x1aec('0x14'));var hardwareService=require(_0x1aec('0x15'));var logger=require('../../config/logger')(_0x1aec('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1aec('0x17'));var db=require(_0x1aec('0x18'))['db'];function respondWithStatusCode(_0x347392,_0x3e984e){_0x3e984e=_0x3e984e||0xcc;return function(_0x3dcc94){if(_0x3dcc94){return _0x347392[_0x1aec('0x19')](_0x3e984e);}return _0x347392[_0x1aec('0x1a')](_0x3e984e)[_0x1aec('0x1b')]();};}function respondWithResult(_0x3085da,_0x26c15a){_0x26c15a=_0x26c15a||0xc8;return function(_0xaa0877){if(_0xaa0877){return _0x3085da['status'](_0x26c15a)['json'](_0xaa0877);}};}function respondWithFilteredResult(_0x252bed,_0x5712c3){return function(_0x52b547){if(_0x52b547){var _0x317354=typeof _0x5712c3[_0x1aec('0x1c')]===_0x1aec('0x1d')&&typeof _0x5712c3['limit']===_0x1aec('0x1d');var _0x5b2844=_0x52b547[_0x1aec('0x1e')];var _0x267371=_0x317354?0x0:_0x5712c3[_0x1aec('0x1c')];var _0x12cdf1=_0x317354?_0x52b547[_0x1aec('0x1e')]:_0x5712c3[_0x1aec('0x1c')]+_0x5712c3[_0x1aec('0x1f')];var _0x2c9b92;if(_0x12cdf1>=_0x5b2844){_0x12cdf1=_0x5b2844;_0x2c9b92=0xc8;}else{_0x2c9b92=0xce;}_0x252bed['status'](_0x2c9b92);return _0x252bed[_0x1aec('0x20')](_0x1aec('0x21'),_0x267371+'-'+_0x12cdf1+'/'+_0x5b2844)[_0x1aec('0x22')](_0x52b547);}return null;};}function patchUpdates(_0x5db09f){return function(_0x32472a){try{jsonpatch[_0x1aec('0x23')](_0x32472a,_0x5db09f,!![]);}catch(_0x3972bc){return BPromise[_0x1aec('0x24')](_0x3972bc);}return _0x32472a[_0x1aec('0x25')]();};}function saveUpdates(_0x3d054b,_0x59c245){return function(_0x67a281){if(_0x67a281){return _0x67a281[_0x1aec('0x26')](_0x3d054b)['then'](function(_0x25f0f7){return _0x25f0f7;});}return null;};}function removeEntity(_0xbbd1ab,_0xae7d67){return function(_0x57fff5){if(_0x57fff5){return _0x57fff5[_0x1aec('0x27')]()[_0x1aec('0x28')](function(){var _0x5764e5=_0x57fff5[_0x1aec('0x29')]({'plain':!![]});var _0x31c7ac=_0x1aec('0x2a');return db[_0x1aec('0x2b')][_0x1aec('0x27')]({'where':{'type':_0x31c7ac,'resourceId':_0x5764e5['id']}})[_0x1aec('0x28')](function(){return _0x57fff5;});})[_0x1aec('0x28')](function(){_0xbbd1ab[_0x1aec('0x1a')](0xcc)[_0x1aec('0x1b')]();});}};}function handleEntityNotFound(_0x4ee27d,_0xa8de80){return function(_0x4bcedf){if(!_0x4bcedf){_0x4ee27d[_0x1aec('0x19')](0x194);}return _0x4bcedf;};}function handleError(_0x433115,_0x4d7321){_0x4d7321=_0x4d7321||0x1f4;return function(_0x2507fc){logger['error'](_0x2507fc[_0x1aec('0x2c')]);if(_0x2507fc[_0x1aec('0x2d')]){delete _0x2507fc[_0x1aec('0x2d')];}_0x433115[_0x1aec('0x1a')](_0x4d7321)[_0x1aec('0x2e')](_0x2507fc);};}exports['index']=function(_0x26695e,_0x21aaa){var _0x2b8f94={},_0x2137eb={},_0x58d09e={'count':0x0,'rows':[]};var _0x4ead3e=_[_0x1aec('0x2f')](db[_0x1aec('0x30')][_0x1aec('0x31')],function(_0x25b30a){return{'name':_0x25b30a[_0x1aec('0x32')],'type':_0x25b30a[_0x1aec('0x33')][_0x1aec('0x34')]};});_0x2137eb[_0x1aec('0x35')]=_[_0x1aec('0x2f')](_0x4ead3e,'name');_0x2137eb['query']=_[_0x1aec('0x36')](_0x26695e[_0x1aec('0x37')]);_0x2137eb['filters']=_[_0x1aec('0x38')](_0x2137eb[_0x1aec('0x35')],_0x2137eb[_0x1aec('0x37')]);_0x2b8f94[_0x1aec('0x39')]=_[_0x1aec('0x38')](_0x2137eb['model'],qs[_0x1aec('0x3a')](_0x26695e[_0x1aec('0x37')]['fields']));_0x2b8f94[_0x1aec('0x39')]=_0x2b8f94[_0x1aec('0x39')][_0x1aec('0x3b')]?_0x2b8f94['attributes']:_0x2137eb[_0x1aec('0x35')];if(!_0x26695e[_0x1aec('0x37')][_0x1aec('0x3c')](_0x1aec('0x3d'))){_0x2b8f94[_0x1aec('0x1f')]=qs['limit'](_0x26695e[_0x1aec('0x37')]['limit']);_0x2b8f94[_0x1aec('0x1c')]=qs[_0x1aec('0x1c')](_0x26695e[_0x1aec('0x37')][_0x1aec('0x1c')]);}_0x2b8f94['order']=qs['sort'](_0x26695e[_0x1aec('0x37')]['sort']);_0x2b8f94[_0x1aec('0x3e')]=qs['filters'](_['pick'](_0x26695e[_0x1aec('0x37')],_0x2137eb[_0x1aec('0x3f')]),_0x4ead3e);if(_0x26695e['query'][_0x1aec('0x40')]){_0x2b8f94[_0x1aec('0x3e')]=_[_0x1aec('0x41')](_0x2b8f94[_0x1aec('0x3e')],{'$or':_['map'](_0x4ead3e,function(_0x414fd2){if(_0x414fd2[_0x1aec('0x33')]!==_0x1aec('0x42')){var _0x4ee1b5={};_0x4ee1b5[_0x414fd2[_0x1aec('0x2d')]]={'$like':'%'+_0x26695e['query']['filter']+'%'};return _0x4ee1b5;}})});}_0x2b8f94=_['merge']({},_0x2b8f94,_0x26695e[_0x1aec('0x43')]);var _0x44378e={'where':_0x2b8f94['where']};return db[_0x1aec('0x30')]['count'](_0x44378e)['then'](function(_0x189a10){_0x58d09e[_0x1aec('0x1e')]=_0x189a10;if(_0x26695e[_0x1aec('0x37')][_0x1aec('0x44')]){_0x2b8f94[_0x1aec('0x45')]=[{'all':!![]}];}return db[_0x1aec('0x30')]['findAll'](_0x2b8f94);})[_0x1aec('0x28')](function(_0x49c642){_0x58d09e['rows']=_0x49c642;return _0x58d09e;})[_0x1aec('0x28')](respondWithFilteredResult(_0x21aaa,_0x2b8f94))[_0x1aec('0x46')](handleError(_0x21aaa,null));};exports[_0x1aec('0x47')]=function(_0x4f1c11,_0x5c95b6){var _0x54400f={'raw':![],'where':{'id':_0x4f1c11[_0x1aec('0x48')]['id']}},_0x160946={};_0x160946[_0x1aec('0x35')]=_[_0x1aec('0x36')](db[_0x1aec('0x30')][_0x1aec('0x31')]);_0x160946[_0x1aec('0x37')]=_[_0x1aec('0x36')](_0x4f1c11['query']);_0x160946[_0x1aec('0x3f')]=_[_0x1aec('0x38')](_0x160946['model'],_0x160946['query']);_0x54400f[_0x1aec('0x39')]=_[_0x1aec('0x38')](_0x160946[_0x1aec('0x35')],qs[_0x1aec('0x3a')](_0x4f1c11['query'][_0x1aec('0x3a')]));_0x54400f['attributes']=_0x54400f[_0x1aec('0x39')][_0x1aec('0x3b')]?_0x54400f[_0x1aec('0x39')]:_0x160946[_0x1aec('0x35')];if(_0x4f1c11[_0x1aec('0x37')][_0x1aec('0x44')]){_0x54400f[_0x1aec('0x45')]=[{'all':!![]}];}_0x54400f=_[_0x1aec('0x41')]({},_0x54400f,_0x4f1c11['options']);return db[_0x1aec('0x30')][_0x1aec('0x49')](_0x54400f)['then'](handleEntityNotFound(_0x5c95b6,null))[_0x1aec('0x28')](respondWithResult(_0x5c95b6,null))[_0x1aec('0x46')](handleError(_0x5c95b6,null));};exports[_0x1aec('0x4a')]=function(_0x517d0f,_0x3ff88d){return db[_0x1aec('0x30')]['create'](_0x517d0f[_0x1aec('0x4b')],{})[_0x1aec('0x28')](function(_0x2d0dfd){var _0x50b3dd=_0x517d0f[_0x1aec('0x4c')][_0x1aec('0x29')]({'plain':!![]});if(!_0x50b3dd)throw new Error(_0x1aec('0x4d'));if(_0x50b3dd[_0x1aec('0x4e')]===_0x1aec('0x4c')){var _0x11ee8b=_0x2d0dfd['get']({'plain':!![]});var _0x2fdaad=_0x1aec('0x2a');return db[_0x1aec('0x4f')]['find']({'where':{'name':_0x2fdaad,'userProfileId':_0x50b3dd[_0x1aec('0x50')]},'raw':!![]})['then'](function(_0x3d42da){if(_0x3d42da&&_0x3d42da[_0x1aec('0x51')]===0x0){return db[_0x1aec('0x2b')][_0x1aec('0x4a')]({'name':_0x11ee8b[_0x1aec('0x2d')],'resourceId':_0x11ee8b['id'],'type':_0x3d42da[_0x1aec('0x2d')],'sectionId':_0x3d42da['id']},{})[_0x1aec('0x28')](function(){return _0x2d0dfd;});}else{return _0x2d0dfd;}})[_0x1aec('0x46')](function(_0x217df6){logger[_0x1aec('0x52')](_0x1aec('0x53'),_0x217df6);throw _0x217df6;});}return _0x2d0dfd;})['then'](respondWithResult(_0x3ff88d,0xc9))[_0x1aec('0x46')](handleError(_0x3ff88d,null));};exports[_0x1aec('0x26')]=function(_0x334a73,_0x282d26){if(_0x334a73['body']['id']){delete _0x334a73[_0x1aec('0x4b')]['id'];}return db[_0x1aec('0x30')]['find']({'where':{'id':_0x334a73[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x282d26,null))[_0x1aec('0x28')](saveUpdates(_0x334a73[_0x1aec('0x4b')],null))[_0x1aec('0x28')](respondWithResult(_0x282d26,null))[_0x1aec('0x46')](handleError(_0x282d26,null));};exports[_0x1aec('0x27')]=function(_0x5780cc,_0x2cf865){return db[_0x1aec('0x30')]['find']({'where':{'id':_0x5780cc[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x2cf865,null))[_0x1aec('0x28')](removeEntity(_0x2cf865,null))[_0x1aec('0x46')](handleError(_0x2cf865,null));};exports[_0x1aec('0x54')]=function(_0x12f31a,_0x19c064,_0x2375d2){if(_0x12f31a['body']['id']){delete _0x12f31a[_0x1aec('0x4b')]['id'];}return db[_0x1aec('0x30')][_0x1aec('0x49')]({'where':{'id':_0x12f31a[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x19c064,null))[_0x1aec('0x28')](function(_0x5c688e){if(_0x5c688e){_0x12f31a[_0x1aec('0x4b')][_0x1aec('0x55')]=_0x5c688e['id'];return db[_0x1aec('0x56')][_0x1aec('0x4a')](_0x12f31a[_0x1aec('0x4b')]);}})['then'](respondWithResult(_0x19c064,null))[_0x1aec('0x46')](handleError(_0x19c064,null));};exports['addAnyCondition']=function(_0x214bcb,_0x1287ed,_0x574b40){if(_0x214bcb[_0x1aec('0x4b')]['id']){delete _0x214bcb['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x214bcb['params']['id']}})['then'](handleEntityNotFound(_0x1287ed,null))['then'](function(_0x1b5b81){if(_0x1b5b81){_0x214bcb[_0x1aec('0x4b')][_0x1aec('0x57')]=_0x1b5b81['id'];return db[_0x1aec('0x56')]['create'](_0x214bcb[_0x1aec('0x4b')]);}})['then'](respondWithResult(_0x1287ed,null))[_0x1aec('0x46')](handleError(_0x1287ed,null));};exports[_0x1aec('0x58')]=function(_0x2eaf17,_0x4d5103,_0xd5db00){var _0x2e1468={};var _0x4fd113={};var _0x41e552;var _0x3d897a;return db[_0x1aec('0x30')][_0x1aec('0x59')]({'where':{'id':_0x2eaf17[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x4d5103,null))[_0x1aec('0x28')](function(_0x5eb5ed){if(_0x5eb5ed){_0x41e552=_0x5eb5ed;_0x4fd113[_0x1aec('0x35')]=_[_0x1aec('0x36')](db[_0x1aec('0x56')][_0x1aec('0x31')]);_0x4fd113['query']=_[_0x1aec('0x36')](_0x2eaf17[_0x1aec('0x37')]);_0x4fd113[_0x1aec('0x3f')]=_[_0x1aec('0x38')](_0x4fd113[_0x1aec('0x35')],_0x4fd113['query']);_0x2e1468[_0x1aec('0x39')]=_[_0x1aec('0x38')](_0x4fd113[_0x1aec('0x35')],qs[_0x1aec('0x3a')](_0x2eaf17['query'][_0x1aec('0x3a')]));_0x2e1468[_0x1aec('0x39')]=_0x2e1468[_0x1aec('0x39')][_0x1aec('0x3b')]?_0x2e1468[_0x1aec('0x39')]:_0x4fd113['model'];_0x2e1468[_0x1aec('0x5a')]=qs[_0x1aec('0x5b')](_0x2eaf17[_0x1aec('0x37')][_0x1aec('0x5b')]);_0x2e1468[_0x1aec('0x3e')]=qs[_0x1aec('0x3f')](_[_0x1aec('0x5c')](_0x2eaf17[_0x1aec('0x37')],_0x4fd113[_0x1aec('0x3f')]));if(_0x2eaf17['query'][_0x1aec('0x40')]){_0x2e1468[_0x1aec('0x3e')]=_[_0x1aec('0x41')](_0x2e1468['where'],{'$or':_[_0x1aec('0x2f')](_0x2e1468[_0x1aec('0x39')],function(_0x2906fe){var _0x466395={};_0x466395[_0x2906fe]={'$like':'%'+_0x2eaf17[_0x1aec('0x37')]['filter']+'%'};return _0x466395;})});}_0x2e1468=_['merge']({},_0x2e1468,_0x2eaf17[_0x1aec('0x43')]);return _0x41e552['getAllConditions'](_0x2e1468);}})['then'](function(_0xeaeaba){if(_0xeaeaba){_0x3d897a=_0xeaeaba[_0x1aec('0x3b')];if(!_0x2eaf17[_0x1aec('0x37')][_0x1aec('0x3c')](_0x1aec('0x3d'))){_0x2e1468[_0x1aec('0x1f')]=qs[_0x1aec('0x1f')](_0x2eaf17[_0x1aec('0x37')][_0x1aec('0x1f')]);_0x2e1468[_0x1aec('0x1c')]=qs[_0x1aec('0x1c')](_0x2eaf17[_0x1aec('0x37')][_0x1aec('0x1c')]);}return _0x41e552[_0x1aec('0x58')](_0x2e1468);}})[_0x1aec('0x28')](function(_0x3d8de5){if(_0x3d8de5){return _0x3d8de5?{'count':_0x3d897a,'rows':_0x3d8de5}:null;}})[_0x1aec('0x28')](respondWithResult(_0x4d5103,null))[_0x1aec('0x46')](handleError(_0x4d5103,null));};exports['getAnyConditions']=function(_0x50e952,_0x14811a,_0x62b428){var _0x120a71={};var _0xbbc8ea={};var _0x210276;var _0x5333e3;return db[_0x1aec('0x30')]['findOne']({'where':{'id':_0x50e952[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x14811a,null))[_0x1aec('0x28')](function(_0x4fd17a){if(_0x4fd17a){_0x210276=_0x4fd17a;_0xbbc8ea[_0x1aec('0x35')]=_[_0x1aec('0x36')](db['Condition']['rawAttributes']);_0xbbc8ea[_0x1aec('0x37')]=_[_0x1aec('0x36')](_0x50e952[_0x1aec('0x37')]);_0xbbc8ea[_0x1aec('0x3f')]=_[_0x1aec('0x38')](_0xbbc8ea[_0x1aec('0x35')],_0xbbc8ea['query']);_0x120a71[_0x1aec('0x39')]=_[_0x1aec('0x38')](_0xbbc8ea['model'],qs[_0x1aec('0x3a')](_0x50e952['query'][_0x1aec('0x3a')]));_0x120a71[_0x1aec('0x39')]=_0x120a71[_0x1aec('0x39')][_0x1aec('0x3b')]?_0x120a71[_0x1aec('0x39')]:_0xbbc8ea[_0x1aec('0x35')];_0x120a71[_0x1aec('0x5a')]=qs[_0x1aec('0x5b')](_0x50e952['query'][_0x1aec('0x5b')]);_0x120a71['where']=qs[_0x1aec('0x3f')](_['pick'](_0x50e952[_0x1aec('0x37')],_0xbbc8ea[_0x1aec('0x3f')]));if(_0x50e952[_0x1aec('0x37')][_0x1aec('0x40')]){_0x120a71[_0x1aec('0x3e')]=_['merge'](_0x120a71[_0x1aec('0x3e')],{'$or':_[_0x1aec('0x2f')](_0x120a71[_0x1aec('0x39')],function(_0x501f84){var _0x206b64={};_0x206b64[_0x501f84]={'$like':'%'+_0x50e952[_0x1aec('0x37')]['filter']+'%'};return _0x206b64;})});}_0x120a71=_[_0x1aec('0x41')]({},_0x120a71,_0x50e952[_0x1aec('0x43')]);return _0x210276[_0x1aec('0x5d')](_0x120a71);}})[_0x1aec('0x28')](function(_0x39b75f){if(_0x39b75f){_0x5333e3=_0x39b75f['length'];if(!_0x50e952[_0x1aec('0x37')][_0x1aec('0x3c')](_0x1aec('0x3d'))){_0x120a71['limit']=qs[_0x1aec('0x1f')](_0x50e952[_0x1aec('0x37')][_0x1aec('0x1f')]);_0x120a71[_0x1aec('0x1c')]=qs[_0x1aec('0x1c')](_0x50e952[_0x1aec('0x37')][_0x1aec('0x1c')]);}return _0x210276[_0x1aec('0x5d')](_0x120a71);}})['then'](function(_0x476f36){if(_0x476f36){return _0x476f36?{'count':_0x5333e3,'rows':_0x476f36}:null;}})[_0x1aec('0x28')](respondWithResult(_0x14811a,null))[_0x1aec('0x46')](handleError(_0x14811a,null));};exports[_0x1aec('0x5e')]=function(_0x43a479,_0x441bde,_0x4a726b){if(_0x43a479[_0x1aec('0x4b')]['id']){delete _0x43a479['body']['id'];}return db['Trigger'][_0x1aec('0x49')]({'where':{'id':_0x43a479[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x441bde,null))[_0x1aec('0x28')](function(_0x23f0c8){if(_0x23f0c8){_0x43a479[_0x1aec('0x4b')][_0x1aec('0x5f')]=_0x23f0c8['id'];return db[_0x1aec('0x60')][_0x1aec('0x4a')](_0x43a479[_0x1aec('0x4b')]);}})['then'](respondWithResult(_0x441bde,null))[_0x1aec('0x46')](handleError(_0x441bde,null));};exports[_0x1aec('0x61')]=function(_0x139c84,_0x2a3bcd,_0x77b949){var _0x4fc2fe={};var _0xb7ed4f={};var _0x5ed0f2;var _0x2f6aeb;return db['Trigger']['findOne']({'where':{'id':_0x139c84[_0x1aec('0x48')]['id']}})[_0x1aec('0x28')](handleEntityNotFound(_0x2a3bcd,null))[_0x1aec('0x28')](function(_0x4e9fa4){if(_0x4e9fa4){_0x5ed0f2=_0x4e9fa4;_0xb7ed4f['model']=_[_0x1aec('0x36')](db[_0x1aec('0x60')][_0x1aec('0x31')]);_0xb7ed4f['query']=_['keys'](_0x139c84['query']);_0xb7ed4f[_0x1aec('0x3f')]=_[_0x1aec('0x38')](_0xb7ed4f[_0x1aec('0x35')],_0xb7ed4f[_0x1aec('0x37')]);_0x4fc2fe[_0x1aec('0x39')]=_[_0x1aec('0x38')](_0xb7ed4f[_0x1aec('0x35')],qs[_0x1aec('0x3a')](_0x139c84[_0x1aec('0x37')][_0x1aec('0x3a')]));_0x4fc2fe[_0x1aec('0x39')]=_0x4fc2fe[_0x1aec('0x39')]['length']?_0x4fc2fe[_0x1aec('0x39')]:_0xb7ed4f[_0x1aec('0x35')];_0x4fc2fe[_0x1aec('0x5a')]=qs['sort'](_0x139c84['query'][_0x1aec('0x5b')]);_0x4fc2fe[_0x1aec('0x3e')]=qs[_0x1aec('0x3f')](_[_0x1aec('0x5c')](_0x139c84[_0x1aec('0x37')],_0xb7ed4f['filters']));if(_0x139c84[_0x1aec('0x37')][_0x1aec('0x40')]){_0x4fc2fe[_0x1aec('0x3e')]=_[_0x1aec('0x41')](_0x4fc2fe[_0x1aec('0x3e')],{'$or':_[_0x1aec('0x2f')](_0x4fc2fe[_0x1aec('0x39')],function(_0x5be96b){var _0x31736c={};_0x31736c[_0x5be96b]={'$like':'%'+_0x139c84[_0x1aec('0x37')][_0x1aec('0x40')]+'%'};return _0x31736c;})});}_0x4fc2fe=_[_0x1aec('0x41')]({},_0x4fc2fe,_0x139c84[_0x1aec('0x43')]);return _0x5ed0f2[_0x1aec('0x61')](_0x4fc2fe);}})[_0x1aec('0x28')](function(_0x2220d0){if(_0x2220d0){_0x2f6aeb=_0x2220d0[_0x1aec('0x3b')];if(!_0x139c84['query'][_0x1aec('0x3c')](_0x1aec('0x3d'))){_0x4fc2fe[_0x1aec('0x1f')]=qs[_0x1aec('0x1f')](_0x139c84[_0x1aec('0x37')][_0x1aec('0x1f')]);_0x4fc2fe[_0x1aec('0x1c')]=qs['offset'](_0x139c84['query'][_0x1aec('0x1c')]);}return _0x5ed0f2['getActions'](_0x4fc2fe);}})['then'](function(_0x15b0e2){if(_0x15b0e2){return _0x15b0e2?{'count':_0x2f6aeb,'rows':_0x15b0e2}:null;}})['then'](respondWithResult(_0x2a3bcd,null))['catch'](handleError(_0x2a3bcd,null));}; \ No newline at end of file +var _0x3fec=['stack','name','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','findAll','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','error'];(function(_0x3459ed,_0x1bee20){var _0x4519a3=function(_0x792b8d){while(--_0x792b8d){_0x3459ed['push'](_0x3459ed['shift']());}};_0x4519a3(++_0x1bee20);}(_0x3fec,0x1ad));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc3fe('0x0'));var rimraf=require(_0xc3fe('0x1'));var zipdir=require(_0xc3fe('0x2'));var jsonpatch=require(_0xc3fe('0x3'));var rp=require(_0xc3fe('0x4'));var moment=require('moment');var BPromise=require(_0xc3fe('0x5'));var Mustache=require(_0xc3fe('0x6'));var util=require(_0xc3fe('0x7'));var path=require(_0xc3fe('0x8'));var sox=require(_0xc3fe('0x9'));var csv=require(_0xc3fe('0xa'));var ejs=require(_0xc3fe('0xb'));var fs=require('fs');var fs_extra=require(_0xc3fe('0xc'));var _=require(_0xc3fe('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc3fe('0xe'));var deskjs=require(_0xc3fe('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc3fe('0x10'));var Papa=require(_0xc3fe('0x11'));var Redis=require(_0xc3fe('0x12'));var authService=require(_0xc3fe('0x13'));var qs=require(_0xc3fe('0x14'));var as=require(_0xc3fe('0x15'));var hardwareService=require(_0xc3fe('0x16'));var logger=require(_0xc3fe('0x17'))(_0xc3fe('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc3fe('0x19'));var db=require(_0xc3fe('0x1a'))['db'];function respondWithStatusCode(_0x3f1cc0,_0x1728b9){_0x1728b9=_0x1728b9||0xcc;return function(_0x208ef1){if(_0x208ef1){return _0x3f1cc0[_0xc3fe('0x1b')](_0x1728b9);}return _0x3f1cc0[_0xc3fe('0x1c')](_0x1728b9)[_0xc3fe('0x1d')]();};}function respondWithResult(_0x6efafa,_0x3ac6f8){_0x3ac6f8=_0x3ac6f8||0xc8;return function(_0x402ddc){if(_0x402ddc){return _0x6efafa[_0xc3fe('0x1c')](_0x3ac6f8)[_0xc3fe('0x1e')](_0x402ddc);}};}function respondWithFilteredResult(_0x49bbf6,_0x2e6367){return function(_0x43a2c1){if(_0x43a2c1){var _0x25cc3e=typeof _0x2e6367[_0xc3fe('0x1f')]===_0xc3fe('0x20')&&typeof _0x2e6367['limit']==='undefined';var _0x1de3d8=_0x43a2c1[_0xc3fe('0x21')];var _0x7faf8=_0x25cc3e?0x0:_0x2e6367[_0xc3fe('0x1f')];var _0x995015=_0x25cc3e?_0x43a2c1[_0xc3fe('0x21')]:_0x2e6367[_0xc3fe('0x1f')]+_0x2e6367[_0xc3fe('0x22')];var _0xa8120a;if(_0x995015>=_0x1de3d8){_0x995015=_0x1de3d8;_0xa8120a=0xc8;}else{_0xa8120a=0xce;}_0x49bbf6[_0xc3fe('0x1c')](_0xa8120a);return _0x49bbf6[_0xc3fe('0x23')](_0xc3fe('0x24'),_0x7faf8+'-'+_0x995015+'/'+_0x1de3d8)[_0xc3fe('0x1e')](_0x43a2c1);}return null;};}function patchUpdates(_0x30427f){return function(_0x539bf8){try{jsonpatch[_0xc3fe('0x25')](_0x539bf8,_0x30427f,!![]);}catch(_0x432cf3){return BPromise[_0xc3fe('0x26')](_0x432cf3);}return _0x539bf8[_0xc3fe('0x27')]();};}function saveUpdates(_0x5ee3d0,_0x1f4beb){return function(_0x6cf344){if(_0x6cf344){return _0x6cf344[_0xc3fe('0x28')](_0x5ee3d0)[_0xc3fe('0x29')](function(_0x5b9380){return _0x5b9380;});}return null;};}function removeEntity(_0x5c24b2,_0xd56dd9){return function(_0x8ee5c6){if(_0x8ee5c6){return _0x8ee5c6[_0xc3fe('0x2a')]()[_0xc3fe('0x29')](function(){var _0x230b2b=_0x8ee5c6['get']({'plain':!![]});var _0x1d7666=_0xc3fe('0x2b');return db[_0xc3fe('0x2c')][_0xc3fe('0x2a')]({'where':{'type':_0x1d7666,'resourceId':_0x230b2b['id']}})['then'](function(){return _0x8ee5c6;});})['then'](function(){_0x5c24b2['status'](0xcc)[_0xc3fe('0x1d')]();});}};}function handleEntityNotFound(_0x34f61b,_0x31deb1){return function(_0x2704d7){if(!_0x2704d7){_0x34f61b[_0xc3fe('0x1b')](0x194);}return _0x2704d7;};}function handleError(_0x3e5a0f,_0x3bee16){_0x3bee16=_0x3bee16||0x1f4;return function(_0x4adffc){logger[_0xc3fe('0x2d')](_0x4adffc[_0xc3fe('0x2e')]);if(_0x4adffc[_0xc3fe('0x2f')]){delete _0x4adffc[_0xc3fe('0x2f')];}_0x3e5a0f[_0xc3fe('0x1c')](_0x3bee16)['send'](_0x4adffc);};}exports['index']=function(_0x1d230c,_0x2ae78b){var _0x225e29={},_0x5419e7={},_0x1ca2d7={'count':0x0,'rows':[]};var _0x5c6c75=_[_0xc3fe('0x30')](db[_0xc3fe('0x31')][_0xc3fe('0x32')],function(_0x2bfd14){return{'name':_0x2bfd14[_0xc3fe('0x33')],'type':_0x2bfd14[_0xc3fe('0x34')]['key']};});_0x5419e7[_0xc3fe('0x35')]=_['map'](_0x5c6c75,_0xc3fe('0x2f'));_0x5419e7[_0xc3fe('0x36')]=_[_0xc3fe('0x37')](_0x1d230c[_0xc3fe('0x36')]);_0x5419e7[_0xc3fe('0x38')]=_[_0xc3fe('0x39')](_0x5419e7[_0xc3fe('0x35')],_0x5419e7[_0xc3fe('0x36')]);_0x225e29[_0xc3fe('0x3a')]=_[_0xc3fe('0x39')](_0x5419e7[_0xc3fe('0x35')],qs[_0xc3fe('0x3b')](_0x1d230c[_0xc3fe('0x36')][_0xc3fe('0x3b')]));_0x225e29[_0xc3fe('0x3a')]=_0x225e29['attributes'][_0xc3fe('0x3c')]?_0x225e29['attributes']:_0x5419e7['model'];if(!_0x1d230c[_0xc3fe('0x36')][_0xc3fe('0x3d')]('nolimit')){_0x225e29['limit']=qs['limit'](_0x1d230c['query']['limit']);_0x225e29[_0xc3fe('0x1f')]=qs[_0xc3fe('0x1f')](_0x1d230c['query'][_0xc3fe('0x1f')]);}_0x225e29['order']=qs[_0xc3fe('0x3e')](_0x1d230c['query'][_0xc3fe('0x3e')]);_0x225e29['where']=qs[_0xc3fe('0x38')](_[_0xc3fe('0x3f')](_0x1d230c[_0xc3fe('0x36')],_0x5419e7['filters']),_0x5c6c75);if(_0x1d230c[_0xc3fe('0x36')][_0xc3fe('0x40')]){_0x225e29[_0xc3fe('0x41')]=_[_0xc3fe('0x42')](_0x225e29['where'],{'$or':_[_0xc3fe('0x30')](_0x5c6c75,function(_0x9c4ed1){if(_0x9c4ed1[_0xc3fe('0x34')]!=='VIRTUAL'){var _0x261dcd={};_0x261dcd[_0x9c4ed1[_0xc3fe('0x2f')]]={'$like':'%'+_0x1d230c['query'][_0xc3fe('0x40')]+'%'};return _0x261dcd;}})});}_0x225e29=_[_0xc3fe('0x42')]({},_0x225e29,_0x1d230c['options']);var _0x14a8bb={'where':_0x225e29[_0xc3fe('0x41')]};return db[_0xc3fe('0x31')][_0xc3fe('0x21')](_0x14a8bb)[_0xc3fe('0x29')](function(_0x4edbf6){_0x1ca2d7[_0xc3fe('0x21')]=_0x4edbf6;if(_0x1d230c[_0xc3fe('0x36')][_0xc3fe('0x43')]){_0x225e29[_0xc3fe('0x44')]=[{'all':!![]}];}return db[_0xc3fe('0x31')][_0xc3fe('0x45')](_0x225e29);})['then'](function(_0x23ec8e){_0x1ca2d7['rows']=_0x23ec8e;return _0x1ca2d7;})[_0xc3fe('0x29')](respondWithFilteredResult(_0x2ae78b,_0x225e29))[_0xc3fe('0x46')](handleError(_0x2ae78b,null));};exports['show']=function(_0x1d59e1,_0x85469f){var _0x2b6213={'raw':![],'where':{'id':_0x1d59e1[_0xc3fe('0x47')]['id']}},_0x1bf0c9={};_0x1bf0c9[_0xc3fe('0x35')]=_['keys'](db[_0xc3fe('0x31')][_0xc3fe('0x32')]);_0x1bf0c9[_0xc3fe('0x36')]=_[_0xc3fe('0x37')](_0x1d59e1['query']);_0x1bf0c9[_0xc3fe('0x38')]=_[_0xc3fe('0x39')](_0x1bf0c9[_0xc3fe('0x35')],_0x1bf0c9['query']);_0x2b6213[_0xc3fe('0x3a')]=_[_0xc3fe('0x39')](_0x1bf0c9[_0xc3fe('0x35')],qs['fields'](_0x1d59e1[_0xc3fe('0x36')][_0xc3fe('0x3b')]));_0x2b6213[_0xc3fe('0x3a')]=_0x2b6213['attributes'][_0xc3fe('0x3c')]?_0x2b6213[_0xc3fe('0x3a')]:_0x1bf0c9['model'];if(_0x1d59e1[_0xc3fe('0x36')][_0xc3fe('0x43')]){_0x2b6213['include']=[{'all':!![]}];}_0x2b6213=_['merge']({},_0x2b6213,_0x1d59e1[_0xc3fe('0x48')]);return db[_0xc3fe('0x31')][_0xc3fe('0x49')](_0x2b6213)[_0xc3fe('0x29')](handleEntityNotFound(_0x85469f,null))['then'](respondWithResult(_0x85469f,null))[_0xc3fe('0x46')](handleError(_0x85469f,null));};exports[_0xc3fe('0x4a')]=function(_0x2a0a6b,_0x20f46b){return db[_0xc3fe('0x31')][_0xc3fe('0x4a')](_0x2a0a6b[_0xc3fe('0x4b')],{})[_0xc3fe('0x29')](function(_0x3057d1){var _0x301775=_0x2a0a6b[_0xc3fe('0x4c')][_0xc3fe('0x4d')]({'plain':!![]});if(!_0x301775)throw new Error(_0xc3fe('0x4e'));if(_0x301775[_0xc3fe('0x4f')]===_0xc3fe('0x4c')){var _0x5b2d73=_0x3057d1['get']({'plain':!![]});var _0x309455=_0xc3fe('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x309455,'userProfileId':_0x301775[_0xc3fe('0x50')]},'raw':!![]})[_0xc3fe('0x29')](function(_0x241766){if(_0x241766&&_0x241766[_0xc3fe('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b2d73['name'],'resourceId':_0x5b2d73['id'],'type':_0x241766[_0xc3fe('0x2f')],'sectionId':_0x241766['id']},{})[_0xc3fe('0x29')](function(){return _0x3057d1;});}else{return _0x3057d1;}})[_0xc3fe('0x46')](function(_0x24b7d2){logger[_0xc3fe('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b7d2);throw _0x24b7d2;});}return _0x3057d1;})[_0xc3fe('0x29')](respondWithResult(_0x20f46b,0xc9))[_0xc3fe('0x46')](handleError(_0x20f46b,null));};exports[_0xc3fe('0x28')]=function(_0x242585,_0x6acaf2){if(_0x242585[_0xc3fe('0x4b')]['id']){delete _0x242585[_0xc3fe('0x4b')]['id'];}return db[_0xc3fe('0x31')]['find']({'where':{'id':_0x242585['params']['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x6acaf2,null))[_0xc3fe('0x29')](saveUpdates(_0x242585['body'],null))[_0xc3fe('0x29')](respondWithResult(_0x6acaf2,null))['catch'](handleError(_0x6acaf2,null));};exports['destroy']=function(_0x40eb26,_0x3b4acd){return db[_0xc3fe('0x31')][_0xc3fe('0x49')]({'where':{'id':_0x40eb26[_0xc3fe('0x47')]['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x3b4acd,null))[_0xc3fe('0x29')](removeEntity(_0x3b4acd,null))[_0xc3fe('0x46')](handleError(_0x3b4acd,null));};exports[_0xc3fe('0x52')]=function(_0x53358c,_0x578496,_0x4d2e61){if(_0x53358c[_0xc3fe('0x4b')]['id']){delete _0x53358c[_0xc3fe('0x4b')]['id'];}return db[_0xc3fe('0x31')][_0xc3fe('0x49')]({'where':{'id':_0x53358c['params']['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x578496,null))[_0xc3fe('0x29')](function(_0x339840){if(_0x339840){_0x53358c['body'][_0xc3fe('0x53')]=_0x339840['id'];return db[_0xc3fe('0x54')][_0xc3fe('0x4a')](_0x53358c[_0xc3fe('0x4b')]);}})[_0xc3fe('0x29')](respondWithResult(_0x578496,null))[_0xc3fe('0x46')](handleError(_0x578496,null));};exports['addAnyCondition']=function(_0x38392,_0x127b78,_0x4493de){if(_0x38392[_0xc3fe('0x4b')]['id']){delete _0x38392[_0xc3fe('0x4b')]['id'];}return db['Trigger'][_0xc3fe('0x49')]({'where':{'id':_0x38392[_0xc3fe('0x47')]['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x127b78,null))[_0xc3fe('0x29')](function(_0x1e07ad){if(_0x1e07ad){_0x38392[_0xc3fe('0x4b')][_0xc3fe('0x55')]=_0x1e07ad['id'];return db[_0xc3fe('0x54')][_0xc3fe('0x4a')](_0x38392[_0xc3fe('0x4b')]);}})['then'](respondWithResult(_0x127b78,null))[_0xc3fe('0x46')](handleError(_0x127b78,null));};exports[_0xc3fe('0x56')]=function(_0xfdc728,_0x5537a4,_0x4bf886){var _0x141753={};var _0x3dc451={};var _0x143ded;var _0x3e3c8a;return db[_0xc3fe('0x31')][_0xc3fe('0x57')]({'where':{'id':_0xfdc728['params']['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x5537a4,null))[_0xc3fe('0x29')](function(_0x34e5b5){if(_0x34e5b5){_0x143ded=_0x34e5b5;_0x3dc451[_0xc3fe('0x35')]=_[_0xc3fe('0x37')](db[_0xc3fe('0x54')][_0xc3fe('0x32')]);_0x3dc451['query']=_[_0xc3fe('0x37')](_0xfdc728[_0xc3fe('0x36')]);_0x3dc451[_0xc3fe('0x38')]=_[_0xc3fe('0x39')](_0x3dc451[_0xc3fe('0x35')],_0x3dc451[_0xc3fe('0x36')]);_0x141753[_0xc3fe('0x3a')]=_[_0xc3fe('0x39')](_0x3dc451[_0xc3fe('0x35')],qs[_0xc3fe('0x3b')](_0xfdc728['query'][_0xc3fe('0x3b')]));_0x141753[_0xc3fe('0x3a')]=_0x141753[_0xc3fe('0x3a')]['length']?_0x141753[_0xc3fe('0x3a')]:_0x3dc451['model'];_0x141753[_0xc3fe('0x58')]=qs[_0xc3fe('0x3e')](_0xfdc728['query'][_0xc3fe('0x3e')]);_0x141753[_0xc3fe('0x41')]=qs['filters'](_[_0xc3fe('0x3f')](_0xfdc728['query'],_0x3dc451[_0xc3fe('0x38')]));if(_0xfdc728[_0xc3fe('0x36')][_0xc3fe('0x40')]){_0x141753[_0xc3fe('0x41')]=_[_0xc3fe('0x42')](_0x141753['where'],{'$or':_[_0xc3fe('0x30')](_0x141753[_0xc3fe('0x3a')],function(_0xa6cc8d){var _0x312afd={};_0x312afd[_0xa6cc8d]={'$like':'%'+_0xfdc728['query']['filter']+'%'};return _0x312afd;})});}_0x141753=_[_0xc3fe('0x42')]({},_0x141753,_0xfdc728[_0xc3fe('0x48')]);return _0x143ded[_0xc3fe('0x56')](_0x141753);}})[_0xc3fe('0x29')](function(_0x210d4f){if(_0x210d4f){_0x3e3c8a=_0x210d4f[_0xc3fe('0x3c')];if(!_0xfdc728[_0xc3fe('0x36')][_0xc3fe('0x3d')](_0xc3fe('0x59'))){_0x141753['limit']=qs['limit'](_0xfdc728[_0xc3fe('0x36')][_0xc3fe('0x22')]);_0x141753[_0xc3fe('0x1f')]=qs[_0xc3fe('0x1f')](_0xfdc728[_0xc3fe('0x36')][_0xc3fe('0x1f')]);}return _0x143ded[_0xc3fe('0x56')](_0x141753);}})['then'](function(_0x4afec9){if(_0x4afec9){return _0x4afec9?{'count':_0x3e3c8a,'rows':_0x4afec9}:null;}})[_0xc3fe('0x29')](respondWithResult(_0x5537a4,null))[_0xc3fe('0x46')](handleError(_0x5537a4,null));};exports[_0xc3fe('0x5a')]=function(_0x4a76fd,_0x183857,_0x4ee504){var _0x3b9057={};var _0x24ff5e={};var _0x3dc2e9;var _0x4de77f;return db[_0xc3fe('0x31')]['findOne']({'where':{'id':_0x4a76fd['params']['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x183857,null))[_0xc3fe('0x29')](function(_0x8acd21){if(_0x8acd21){_0x3dc2e9=_0x8acd21;_0x24ff5e[_0xc3fe('0x35')]=_[_0xc3fe('0x37')](db[_0xc3fe('0x54')][_0xc3fe('0x32')]);_0x24ff5e[_0xc3fe('0x36')]=_[_0xc3fe('0x37')](_0x4a76fd['query']);_0x24ff5e[_0xc3fe('0x38')]=_[_0xc3fe('0x39')](_0x24ff5e['model'],_0x24ff5e[_0xc3fe('0x36')]);_0x3b9057[_0xc3fe('0x3a')]=_[_0xc3fe('0x39')](_0x24ff5e[_0xc3fe('0x35')],qs[_0xc3fe('0x3b')](_0x4a76fd[_0xc3fe('0x36')][_0xc3fe('0x3b')]));_0x3b9057[_0xc3fe('0x3a')]=_0x3b9057[_0xc3fe('0x3a')][_0xc3fe('0x3c')]?_0x3b9057[_0xc3fe('0x3a')]:_0x24ff5e[_0xc3fe('0x35')];_0x3b9057[_0xc3fe('0x58')]=qs[_0xc3fe('0x3e')](_0x4a76fd['query'][_0xc3fe('0x3e')]);_0x3b9057[_0xc3fe('0x41')]=qs['filters'](_['pick'](_0x4a76fd['query'],_0x24ff5e['filters']));if(_0x4a76fd[_0xc3fe('0x36')][_0xc3fe('0x40')]){_0x3b9057['where']=_[_0xc3fe('0x42')](_0x3b9057[_0xc3fe('0x41')],{'$or':_[_0xc3fe('0x30')](_0x3b9057[_0xc3fe('0x3a')],function(_0x59e3cb){var _0x8cd222={};_0x8cd222[_0x59e3cb]={'$like':'%'+_0x4a76fd[_0xc3fe('0x36')][_0xc3fe('0x40')]+'%'};return _0x8cd222;})});}_0x3b9057=_['merge']({},_0x3b9057,_0x4a76fd[_0xc3fe('0x48')]);return _0x3dc2e9[_0xc3fe('0x5a')](_0x3b9057);}})[_0xc3fe('0x29')](function(_0x4b941a){if(_0x4b941a){_0x4de77f=_0x4b941a[_0xc3fe('0x3c')];if(!_0x4a76fd[_0xc3fe('0x36')]['hasOwnProperty']('nolimit')){_0x3b9057[_0xc3fe('0x22')]=qs[_0xc3fe('0x22')](_0x4a76fd['query'][_0xc3fe('0x22')]);_0x3b9057[_0xc3fe('0x1f')]=qs[_0xc3fe('0x1f')](_0x4a76fd[_0xc3fe('0x36')][_0xc3fe('0x1f')]);}return _0x3dc2e9['getAnyConditions'](_0x3b9057);}})[_0xc3fe('0x29')](function(_0x2183b8){if(_0x2183b8){return _0x2183b8?{'count':_0x4de77f,'rows':_0x2183b8}:null;}})[_0xc3fe('0x29')](respondWithResult(_0x183857,null))[_0xc3fe('0x46')](handleError(_0x183857,null));};exports[_0xc3fe('0x5b')]=function(_0x47d0cf,_0x51094f,_0x491ced){if(_0x47d0cf['body']['id']){delete _0x47d0cf[_0xc3fe('0x4b')]['id'];}return db['Trigger']['find']({'where':{'id':_0x47d0cf[_0xc3fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x51094f,null))[_0xc3fe('0x29')](function(_0x1b5d44){if(_0x1b5d44){_0x47d0cf[_0xc3fe('0x4b')][_0xc3fe('0x5c')]=_0x1b5d44['id'];return db['Action']['create'](_0x47d0cf[_0xc3fe('0x4b')]);}})['then'](respondWithResult(_0x51094f,null))[_0xc3fe('0x46')](handleError(_0x51094f,null));};exports[_0xc3fe('0x5d')]=function(_0x506c1e,_0x346bb2,_0x37a5da){var _0x28dc8b={};var _0x264735={};var _0x282369;var _0x1bda1c;return db['Trigger'][_0xc3fe('0x57')]({'where':{'id':_0x506c1e[_0xc3fe('0x47')]['id']}})[_0xc3fe('0x29')](handleEntityNotFound(_0x346bb2,null))[_0xc3fe('0x29')](function(_0xa25246){if(_0xa25246){_0x282369=_0xa25246;_0x264735[_0xc3fe('0x35')]=_[_0xc3fe('0x37')](db[_0xc3fe('0x5e')]['rawAttributes']);_0x264735['query']=_[_0xc3fe('0x37')](_0x506c1e[_0xc3fe('0x36')]);_0x264735['filters']=_[_0xc3fe('0x39')](_0x264735[_0xc3fe('0x35')],_0x264735['query']);_0x28dc8b[_0xc3fe('0x3a')]=_[_0xc3fe('0x39')](_0x264735['model'],qs[_0xc3fe('0x3b')](_0x506c1e[_0xc3fe('0x36')][_0xc3fe('0x3b')]));_0x28dc8b['attributes']=_0x28dc8b['attributes'][_0xc3fe('0x3c')]?_0x28dc8b[_0xc3fe('0x3a')]:_0x264735['model'];_0x28dc8b[_0xc3fe('0x58')]=qs['sort'](_0x506c1e[_0xc3fe('0x36')][_0xc3fe('0x3e')]);_0x28dc8b['where']=qs[_0xc3fe('0x38')](_[_0xc3fe('0x3f')](_0x506c1e['query'],_0x264735[_0xc3fe('0x38')]));if(_0x506c1e[_0xc3fe('0x36')][_0xc3fe('0x40')]){_0x28dc8b[_0xc3fe('0x41')]=_[_0xc3fe('0x42')](_0x28dc8b[_0xc3fe('0x41')],{'$or':_[_0xc3fe('0x30')](_0x28dc8b['attributes'],function(_0x229bad){var _0x4e234e={};_0x4e234e[_0x229bad]={'$like':'%'+_0x506c1e[_0xc3fe('0x36')]['filter']+'%'};return _0x4e234e;})});}_0x28dc8b=_[_0xc3fe('0x42')]({},_0x28dc8b,_0x506c1e[_0xc3fe('0x48')]);return _0x282369[_0xc3fe('0x5d')](_0x28dc8b);}})['then'](function(_0x5a90d8){if(_0x5a90d8){_0x1bda1c=_0x5a90d8[_0xc3fe('0x3c')];if(!_0x506c1e['query'][_0xc3fe('0x3d')]('nolimit')){_0x28dc8b[_0xc3fe('0x22')]=qs[_0xc3fe('0x22')](_0x506c1e['query'][_0xc3fe('0x22')]);_0x28dc8b[_0xc3fe('0x1f')]=qs[_0xc3fe('0x1f')](_0x506c1e[_0xc3fe('0x36')][_0xc3fe('0x1f')]);}return _0x282369[_0xc3fe('0x5d')](_0x28dc8b);}})[_0xc3fe('0x29')](function(_0x65af31){if(_0x65af31){return _0x65af31?{'count':_0x1bda1c,'rows':_0x65af31}:null;}})[_0xc3fe('0x29')](respondWithResult(_0x346bb2,null))[_0xc3fe('0x46')](handleError(_0x346bb2,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0af1bb1..0078e3d 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 _0x27c9=['Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0xe8728a,_0x32188a){var _0x5cc0e3=function(_0x407282){while(--_0x407282){_0xe8728a['push'](_0xe8728a['shift']());}};_0x5cc0e3(++_0x32188a);}(_0x27c9,0x1af));var _0x927c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x27c9[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var logger=require(_0x927c('0x2'))(_0x927c('0x3'));var moment=require('moment');var BPromise=require(_0x927c('0x4'));var rp=require(_0x927c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var attributes=require(_0x927c('0x8'));module[_0x927c('0x9')]=function(_0x338730,_0x5b09de){return _0x338730[_0x927c('0xa')](_0x927c('0xb'),attributes,{'tableName':_0x927c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde50=['../../config/logger','api','moment','bluebird','path','../../config/environment','define','Trigger'];(function(_0x13d8d4,_0x4294a8){var _0x32bbb5=function(_0x52a438){while(--_0x52a438){_0x13d8d4['push'](_0x13d8d4['shift']());}};_0x32bbb5(++_0x4294a8);}(_0xde50,0x140));var _0x0de5=function(_0x3e866e,_0x3f7fe8){_0x3e866e=_0x3e866e-0x0;var _0x31852b=_0xde50[_0x3e866e];return _0x31852b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0de5('0x0'))(_0x0de5('0x1'));var moment=require(_0x0de5('0x2'));var BPromise=require(_0x0de5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0de5('0x4'));var rimraf=require('rimraf');var config=require(_0x0de5('0x5'));var attributes=require('./trigger.attributes');module['exports']=function(_0x5f05a1,_0x444955){return _0x5f05a1[_0x0de5('0x6')](_0x0de5('0x7'),attributes,{'tableName':'tools_triggers','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 08a568b..39864c8 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 _0x1714=['map','attributes','model','GetTrigger','catch','ShowTrigger','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trigger','findAll','options','raw','where','limit','include'];(function(_0x2762ce,_0x4505a0){var _0x444b75=function(_0xad562a){while(--_0xad562a){_0x2762ce['push'](_0x2762ce['shift']());}};_0x444b75(++_0x4505a0);}(_0x1714,0x1c6));var _0x4171=function(_0x31fe44,_0x524eab){_0x31fe44=_0x31fe44-0x0;var _0x19f8b9=_0x1714[_0x31fe44];return _0x19f8b9;};'use strict';var _=require(_0x4171('0x0'));var util=require(_0x4171('0x1'));var moment=require(_0x4171('0x2'));var BPromise=require('bluebird');var rs=require(_0x4171('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4171('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4171('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4171('0x6')][_0x4171('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d5ba7,_0x116c7e,_0x391949){return new BPromise(function(_0x2e6fff,_0x56992d){return client[_0x4171('0x8')](_0x5d5ba7,_0x391949)[_0x4171('0x9')](function(_0x8e4775){logger[_0x4171('0xa')](_0x4171('0xb'),_0x116c7e,_0x4171('0xc'));logger[_0x4171('0xd')](_0x4171('0xe'),_0x116c7e,'request\x20sent',JSON[_0x4171('0xf')](_0x8e4775));if(_0x8e4775[_0x4171('0x10')]){if(_0x8e4775[_0x4171('0x10')][_0x4171('0x11')]===0x1f4){logger[_0x4171('0x10')](_0x4171('0xb'),_0x116c7e,_0x8e4775[_0x4171('0x10')][_0x4171('0x12')]);return _0x56992d(_0x8e4775[_0x4171('0x10')]['message']);}logger[_0x4171('0x10')](_0x4171('0xb'),_0x116c7e,_0x8e4775[_0x4171('0x10')][_0x4171('0x12')]);return _0x2e6fff(_0x8e4775[_0x4171('0x10')][_0x4171('0x12')]);}else{logger[_0x4171('0xa')](_0x4171('0xb'),_0x116c7e,_0x4171('0xc'));_0x2e6fff(_0x8e4775['result'][_0x4171('0x12')]);}})['catch'](function(_0xac989a){logger['error'](_0x4171('0xb'),_0x116c7e,_0xac989a);_0x56992d(_0xac989a);});});}exports['GetTrigger']=function(_0x3a3ffa){var _0x419c7c=this;return new Promise(function(_0x14a3ce,_0x38fcf5){return db[_0x4171('0x13')][_0x4171('0x14')]({'raw':_0x3a3ffa['options']?_0x3a3ffa[_0x4171('0x15')][_0x4171('0x16')]===undefined?!![]:![]:!![],'where':_0x3a3ffa[_0x4171('0x15')]?_0x3a3ffa[_0x4171('0x15')][_0x4171('0x17')]||null:null,'attributes':_0x3a3ffa[_0x4171('0x15')]?_0x3a3ffa[_0x4171('0x15')]['attributes']||null:null,'limit':_0x3a3ffa[_0x4171('0x15')]?_0x3a3ffa[_0x4171('0x15')][_0x4171('0x18')]||null:null,'include':_0x3a3ffa['options']?_0x3a3ffa[_0x4171('0x15')][_0x4171('0x19')]?_[_0x4171('0x1a')](_0x3a3ffa[_0x4171('0x15')][_0x4171('0x19')],function(_0x29d474){return{'model':db[_0x29d474['model']],'as':_0x29d474['as'],'attributes':_0x29d474[_0x4171('0x1b')],'include':_0x29d474[_0x4171('0x19')]?_[_0x4171('0x1a')](_0x29d474[_0x4171('0x19')],function(_0x48927c){return{'model':db[_0x48927c[_0x4171('0x1c')]],'as':_0x48927c['as'],'attributes':_0x48927c[_0x4171('0x1b')],'include':_0x48927c[_0x4171('0x19')]?_[_0x4171('0x1a')](_0x48927c[_0x4171('0x19')],function(_0x46aadc){return{'model':db[_0x46aadc[_0x4171('0x1c')]],'as':_0x46aadc['as'],'attributes':_0x46aadc['attributes']};}):[]};}):[]};}):[]:[]})[_0x4171('0x9')](function(_0x20d3c0){logger['info'](_0x4171('0x1d'),_0x3a3ffa);logger['debug'](_0x4171('0x1d'),_0x3a3ffa,JSON[_0x4171('0xf')](_0x20d3c0));_0x14a3ce(_0x20d3c0);})[_0x4171('0x1e')](function(_0x5b66d7){logger[_0x4171('0x10')](_0x4171('0x1d'),_0x5b66d7[_0x4171('0x12')],_0x3a3ffa);_0x38fcf5(_0x419c7c['error'](0x1f4,_0x5b66d7[_0x4171('0x12')]));});});};exports[_0x4171('0x1f')]=function(_0x595b59){var _0xe8c09c=this;return new Promise(function(_0x4b313b,_0x4b2bad){return db['Trigger']['find']({'raw':_0x595b59[_0x4171('0x15')]?_0x595b59[_0x4171('0x15')][_0x4171('0x16')]===undefined?!![]:![]:!![],'where':_0x595b59[_0x4171('0x15')]?_0x595b59[_0x4171('0x15')]['where']||null:null,'attributes':_0x595b59['options']?_0x595b59[_0x4171('0x15')][_0x4171('0x1b')]||null:null,'include':_0x595b59[_0x4171('0x15')]?_0x595b59['options'][_0x4171('0x19')]?_[_0x4171('0x1a')](_0x595b59[_0x4171('0x15')]['include'],function(_0x4bf627){return{'model':db[_0x4bf627[_0x4171('0x1c')]],'as':_0x4bf627['as'],'attributes':_0x4bf627[_0x4171('0x1b')],'include':_0x4bf627[_0x4171('0x19')]?_[_0x4171('0x1a')](_0x4bf627['include'],function(_0x1a3d1c){return{'model':db[_0x1a3d1c[_0x4171('0x1c')]],'as':_0x1a3d1c['as'],'attributes':_0x1a3d1c[_0x4171('0x1b')],'include':_0x1a3d1c[_0x4171('0x19')]?_[_0x4171('0x1a')](_0x1a3d1c['include'],function(_0x45df91){return{'model':db[_0x45df91[_0x4171('0x1c')]],'as':_0x45df91['as'],'attributes':_0x45df91[_0x4171('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cf1cb){logger[_0x4171('0xa')]('ShowTrigger',_0x595b59);logger['debug'](_0x4171('0x1f'),_0x595b59,JSON[_0x4171('0xf')](_0x1cf1cb));_0x4b313b(_0x1cf1cb);})['catch'](function(_0x536da6){logger['error']('ShowTrigger',_0x536da6[_0x4171('0x12')],_0x595b59);_0x4b2bad(_0xe8c09c[_0x4171('0x10')](0x1f4,_0x536da6[_0x4171('0x12')]));});});}; \ No newline at end of file +var _0xbf6c=['http','request','then','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','raw','limit','include','model','map','attributes','info','debug','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x29fdee,_0x1fe1ad){var _0x48b624=function(_0x2e645a){while(--_0x2e645a){_0x29fdee['push'](_0x29fdee['shift']());}};_0x48b624(++_0x1fe1ad);}(_0xbf6c,0x1c9));var _0xcbf6=function(_0x542fbb,_0x3988a1){_0x542fbb=_0x542fbb-0x0;var _0x185cac=_0xbf6c[_0x542fbb];return _0x185cac;};'use strict';var _=require(_0xcbf6('0x0'));var util=require(_0xcbf6('0x1'));var moment=require(_0xcbf6('0x2'));var BPromise=require(_0xcbf6('0x3'));var rs=require(_0xcbf6('0x4'));var fs=require('fs');var Redis=require(_0xcbf6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbf6('0x6'))(_0xcbf6('0x7'));var config=require(_0xcbf6('0x8'));var jayson=require(_0xcbf6('0x9'));var client=jayson[_0xcbf6('0xa')][_0xcbf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5417d5,_0x45dff5,_0x3fca17){return new BPromise(function(_0x4f69cb,_0x51e74f){return client[_0xcbf6('0xc')](_0x5417d5,_0x3fca17)[_0xcbf6('0xd')](function(_0x2ee461){logger['info'](_0xcbf6('0xe'),_0x45dff5,'request\x20sent');logger['debug'](_0xcbf6('0xf'),_0x45dff5,_0xcbf6('0x10'),JSON[_0xcbf6('0x11')](_0x2ee461));if(_0x2ee461[_0xcbf6('0x12')]){if(_0x2ee461[_0xcbf6('0x12')][_0xcbf6('0x13')]===0x1f4){logger[_0xcbf6('0x12')](_0xcbf6('0xe'),_0x45dff5,_0x2ee461[_0xcbf6('0x12')][_0xcbf6('0x14')]);return _0x51e74f(_0x2ee461[_0xcbf6('0x12')]['message']);}logger[_0xcbf6('0x12')]('Trigger,\x20%s,\x20%s',_0x45dff5,_0x2ee461['error'][_0xcbf6('0x14')]);return _0x4f69cb(_0x2ee461[_0xcbf6('0x12')][_0xcbf6('0x14')]);}else{logger['info'](_0xcbf6('0xe'),_0x45dff5,_0xcbf6('0x10'));_0x4f69cb(_0x2ee461[_0xcbf6('0x15')][_0xcbf6('0x14')]);}})[_0xcbf6('0x16')](function(_0x34842d){logger['error'](_0xcbf6('0xe'),_0x45dff5,_0x34842d);_0x51e74f(_0x34842d);});});}exports[_0xcbf6('0x17')]=function(_0x31c35a){var _0x5060b0=this;return new Promise(function(_0x19ce6d,_0x5946f5){return db[_0xcbf6('0x18')]['findAll']({'raw':_0x31c35a[_0xcbf6('0x19')]?_0x31c35a[_0xcbf6('0x19')][_0xcbf6('0x1a')]===undefined?!![]:![]:!![],'where':_0x31c35a[_0xcbf6('0x19')]?_0x31c35a[_0xcbf6('0x19')]['where']||null:null,'attributes':_0x31c35a['options']?_0x31c35a[_0xcbf6('0x19')]['attributes']||null:null,'limit':_0x31c35a['options']?_0x31c35a['options'][_0xcbf6('0x1b')]||null:null,'include':_0x31c35a[_0xcbf6('0x19')]?_0x31c35a[_0xcbf6('0x19')][_0xcbf6('0x1c')]?_['map'](_0x31c35a[_0xcbf6('0x19')][_0xcbf6('0x1c')],function(_0xb39c8){return{'model':db[_0xb39c8[_0xcbf6('0x1d')]],'as':_0xb39c8['as'],'attributes':_0xb39c8['attributes'],'include':_0xb39c8[_0xcbf6('0x1c')]?_[_0xcbf6('0x1e')](_0xb39c8[_0xcbf6('0x1c')],function(_0x3331ec){return{'model':db[_0x3331ec['model']],'as':_0x3331ec['as'],'attributes':_0x3331ec[_0xcbf6('0x1f')],'include':_0x3331ec[_0xcbf6('0x1c')]?_[_0xcbf6('0x1e')](_0x3331ec[_0xcbf6('0x1c')],function(_0x3e49bc){return{'model':db[_0x3e49bc[_0xcbf6('0x1d')]],'as':_0x3e49bc['as'],'attributes':_0x3e49bc['attributes']};}):[]};}):[]};}):[]:[]})[_0xcbf6('0xd')](function(_0xc754d8){logger[_0xcbf6('0x20')](_0xcbf6('0x17'),_0x31c35a);logger[_0xcbf6('0x21')](_0xcbf6('0x17'),_0x31c35a,JSON[_0xcbf6('0x11')](_0xc754d8));_0x19ce6d(_0xc754d8);})[_0xcbf6('0x16')](function(_0x4ae7f1){logger[_0xcbf6('0x12')]('GetTrigger',_0x4ae7f1[_0xcbf6('0x14')],_0x31c35a);_0x5946f5(_0x5060b0['error'](0x1f4,_0x4ae7f1[_0xcbf6('0x14')]));});});};exports['ShowTrigger']=function(_0x153955){var _0x1b86d3=this;return new Promise(function(_0x3ca93c,_0xf69a6e){return db['Trigger'][_0xcbf6('0x22')]({'raw':_0x153955[_0xcbf6('0x19')]?_0x153955[_0xcbf6('0x19')][_0xcbf6('0x1a')]===undefined?!![]:![]:!![],'where':_0x153955[_0xcbf6('0x19')]?_0x153955[_0xcbf6('0x19')]['where']||null:null,'attributes':_0x153955[_0xcbf6('0x19')]?_0x153955[_0xcbf6('0x19')][_0xcbf6('0x1f')]||null:null,'include':_0x153955['options']?_0x153955[_0xcbf6('0x19')][_0xcbf6('0x1c')]?_[_0xcbf6('0x1e')](_0x153955['options'][_0xcbf6('0x1c')],function(_0x1cdfcf){return{'model':db[_0x1cdfcf[_0xcbf6('0x1d')]],'as':_0x1cdfcf['as'],'attributes':_0x1cdfcf['attributes'],'include':_0x1cdfcf['include']?_['map'](_0x1cdfcf['include'],function(_0x425eeb){return{'model':db[_0x425eeb[_0xcbf6('0x1d')]],'as':_0x425eeb['as'],'attributes':_0x425eeb[_0xcbf6('0x1f')],'include':_0x425eeb[_0xcbf6('0x1c')]?_[_0xcbf6('0x1e')](_0x425eeb['include'],function(_0x45a324){return{'model':db[_0x45a324[_0xcbf6('0x1d')]],'as':_0x45a324['as'],'attributes':_0x45a324[_0xcbf6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e9aa8){logger[_0xcbf6('0x20')](_0xcbf6('0x23'),_0x153955);logger['debug'](_0xcbf6('0x23'),_0x153955,JSON[_0xcbf6('0x11')](_0x4e9aa8));_0x3ca93c(_0x4e9aa8);})['catch'](function(_0x2454eb){logger[_0xcbf6('0x12')](_0xcbf6('0x23'),_0x2454eb[_0xcbf6('0x14')],_0x153955);_0xf69a6e(_0x1b86d3['error'](0x1f4,_0x2454eb[_0xcbf6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 806717a..4138d73 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 _0xb480=['../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','get','/:id','show','post','/:id/clone','clone','create','put','delete','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x141e0e,_0x280369){var _0x254337=function(_0xe6646e){while(--_0xe6646e){_0x141e0e['push'](_0x141e0e['shift']());}};_0x254337(++_0x280369);}(_0xb480,0xb8));var _0x0b48=function(_0x183e01,_0x230542){_0x183e01=_0x183e01-0x0;var _0x268046=_0xb480[_0x183e01];return _0x268046;};'use strict';var multer=require(_0x0b48('0x0'));var util=require(_0x0b48('0x1'));var path=require(_0x0b48('0x2'));var timeout=require(_0x0b48('0x3'));var express=require(_0x0b48('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0b48('0x5'));var interaction=require(_0x0b48('0x6'));var config=require(_0x0b48('0x7'));var controller=require(_0x0b48('0x8'));router['get']('/',auth[_0x0b48('0x9')](),controller['index']);router[_0x0b48('0xa')](_0x0b48('0xb'),auth[_0x0b48('0x9')](),controller[_0x0b48('0xc')]);router[_0x0b48('0xd')](_0x0b48('0xe'),auth['isAuthenticated'](),controller[_0x0b48('0xf')]);router[_0x0b48('0xd')]('/',auth['isAuthenticated'](),controller[_0x0b48('0x10')]);router[_0x0b48('0x11')]('/:id',auth[_0x0b48('0x9')](),controller['update']);router[_0x0b48('0x12')](_0x0b48('0xb'),auth[_0x0b48('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc72b=['/:id/clone','clone','post','put','/:id','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show'];(function(_0x3c937a,_0x39cd13){var _0x2c50fb=function(_0x463be3){while(--_0x463be3){_0x3c937a['push'](_0x3c937a['shift']());}};_0x2c50fb(++_0x39cd13);}(_0xc72b,0x124));var _0xbc72=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0xc72b[_0x1d1219];return _0x5b5b89;};'use strict';var multer=require(_0xbc72('0x0'));var util=require(_0xbc72('0x1'));var path=require(_0xbc72('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc72('0x3'));var router=express['Router']();var fs_extra=require(_0xbc72('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc72('0x5'));var config=require(_0xbc72('0x6'));var controller=require(_0xbc72('0x7'));router[_0xbc72('0x8')]('/',auth['isAuthenticated'](),controller[_0xbc72('0x9')]);router[_0xbc72('0x8')]('/:id',auth[_0xbc72('0xa')](),controller[_0xbc72('0xb')]);router['post'](_0xbc72('0xc'),auth[_0xbc72('0xa')](),controller[_0xbc72('0xd')]);router[_0xbc72('0xe')]('/',auth[_0xbc72('0xa')](),controller['create']);router[_0xbc72('0xf')](_0xbc72('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xbc72('0x11')](_0xbc72('0x10'),auth[_0xbc72('0xa')](),controller['destroy']);module[_0xbc72('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 4332977..4157bdf 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 _0xf908=['ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','split','rfc2833','shortinfo','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','\x22\x22\x20<>','always','INTEGER','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','nonat','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x158fa5,_0x6df3f4){var _0x598e82=function(_0x325c3f){while(--_0x325c3f){_0x158fa5['push'](_0x158fa5['shift']());}};_0x598e82(++_0x6df3f4);}(_0xf908,0x11b));var _0x8f90=function(_0x5d5655,_0x2abb1c){_0x5d5655=_0x5d5655-0x0;var _0x32e2bc=_0xf908[_0x5d5655];return _0x32e2bc;};'use strict';var Sequelize=require(_0x8f90('0x0'));module[_0x8f90('0x1')]={'name':{'type':Sequelize[_0x8f90('0x2')],'allowNull':![],'unique':_0x8f90('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x5'),_0x8f90('0x6'),_0x8f90('0x7')),'allowNull':![],'defaultValue':_0x8f90('0x5')},'context':{'type':Sequelize[_0x8f90('0x2')],'allowNull':![],'defaultValue':_0x8f90('0x8')},'callingpres':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x9'),_0x8f90('0xa'),_0x8f90('0xb'),_0x8f90('0xc'),_0x8f90('0xd'),_0x8f90('0xe'),_0x8f90('0xf'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x8f90('0x2')]},'md5secret':{'type':Sequelize[_0x8f90('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'udp','set':function(_0x43401e){this[_0x8f90('0x10')](_0x8f90('0x11'),_0x43401e?_0x43401e[_0x8f90('0x12')](','):null);},'get':function(){return this[_0x8f90('0x13')](_0x8f90('0x11'))?this['getDataValue']('transport')[_0x8f90('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x15'),'info',_0x8f90('0x16'),'inband','auto'),'defaultValue':_0x8f90('0x15')},'directmedia':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no','nonat','update',_0x8f90('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x8f90('0x2')]},'nat':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':_0x8f90('0x19'),'set':function(_0x293344){this[_0x8f90('0x10')](_0x8f90('0x1a'),_0x293344?_0x293344[_0x8f90('0x12')](','):null);},'get':function(){return this[_0x8f90('0x13')](_0x8f90('0x1a'))?this[_0x8f90('0x13')](_0x8f90('0x1a'))[_0x8f90('0x14')](','):null;},'comment':_0x8f90('0x1b')},'callgroup':{'type':Sequelize[_0x8f90('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8f90('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x8f90('0x2')]},'language':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8f90('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x8f90('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x319905){this[_0x8f90('0x10')]('allow',_0x319905?_0x319905['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8f90('0x13')](_0x8f90('0x1c'))?this[_0x8f90('0x13')](_0x8f90('0x1c'))[_0x8f90('0x14')](';'):null;},'comment':_0x8f90('0x1d')},'autoframing':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no')},'insecure':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'port,invite','set':function(_0xd79877){this['setDataValue'](_0x8f90('0x1e'),_0xd79877?_0xd79877[_0x8f90('0x12')](','):null);},'get':function(){return this[_0x8f90('0x13')]('insecure')?this[_0x8f90('0x13')]('insecure')[_0x8f90('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no',_0x8f90('0x1f'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x8f90('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':_0x8f90('0x20')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x8f90('0x4')]('yes','no'),'defaultValue':_0x8f90('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x8f90('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x8f90('0x2')]},'template':{'type':Sequelize[_0x8f90('0x2')]},'videosupport':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no',_0x8f90('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8f90('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x23'),_0x8f90('0x24'),_0x8f90('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x26'),_0x8f90('0x27')),'defaultValue':_0x8f90('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x8f90('0x2')]},'fromdomain':{'type':Sequelize[_0x8f90('0x2')]},'fromuser':{'type':Sequelize[_0x8f90('0x2')]},'port':{'type':Sequelize[_0x8f90('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no'),'defaultValue':_0x8f90('0x17')},'keepalive':{'type':Sequelize[_0x8f90('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x8f90('0x2')]},'defaultuser':{'type':Sequelize[_0x8f90('0x2')]},'rtptimeout':{'type':Sequelize[_0x8f90('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8f90('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8f90('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x8f90('0x4')]('yes','no',_0x8f90('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8f90('0x2')]},'callbackextension':{'type':Sequelize[_0x8f90('0x2')]},'timert1':{'type':Sequelize[_0x8f90('0x22')](0xb)},'timerb':{'type':Sequelize[_0x8f90('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8f90('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x8f90('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x8f90('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x8f90('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x8f90('0x22')](0xb)},'encryption':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'force_avp':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'icesupport':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no','fingerprint',_0x8f90('0x29'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x8f90('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x8f90('0x2')]},'dtlscipher':{'type':Sequelize[_0x8f90('0x2')]},'dtlscafile':{'type':Sequelize[_0x8f90('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x2a'),_0x8f90('0x2b'),_0x8f90('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8f90('0x2')]},'usereqphone':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8f90('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x8f90('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x8f90('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no')},'vmexten':{'type':Sequelize[_0x8f90('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x8f90('0x2')]},'parkinglot':{'type':Sequelize[_0x8f90('0x2')]},'description':{'type':Sequelize[_0x8f90('0x2')]},'host':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x8f90('0x4')](_0x8f90('0x17'),'no',_0x8f90('0x2d'),_0x8f90('0x2e'),_0x8f90('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8f90('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8f90('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xf3be=['user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','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','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','fingerprint','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf3be,0x17a));var _0xef3b=function(_0x3b3b5b,_0x2f60a2){_0x3b3b5b=_0x3b3b5b-0x0;var _0x1bda3e=_0xf3be[_0x3b3b5b];return _0x1bda3e;};'use strict';var Sequelize=require(_0xef3b('0x0'));module[_0xef3b('0x1')]={'name':{'type':Sequelize[_0xef3b('0x2')],'allowNull':![],'unique':_0xef3b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x5'),_0xef3b('0x6'),_0xef3b('0x7')),'allowNull':![],'defaultValue':_0xef3b('0x5')},'context':{'type':Sequelize[_0xef3b('0x2')],'allowNull':![],'defaultValue':_0xef3b('0x8')},'callingpres':{'type':Sequelize[_0xef3b('0x4')]('ALLOWED_NOT_SCREENED',_0xef3b('0x9'),'ALLOWED_FAILED_SCREEN',_0xef3b('0xa'),_0xef3b('0xb'),_0xef3b('0xc'),_0xef3b('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xef3b('0x2')]},'secret':{'type':Sequelize[_0xef3b('0x2')]},'md5secret':{'type':Sequelize[_0xef3b('0x2')]},'remotesecret':{'type':Sequelize[_0xef3b('0x2')]},'transport':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':'udp','set':function(_0x426479){this[_0xef3b('0xe')](_0xef3b('0xf'),_0x426479?_0x426479[_0xef3b('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xef3b('0xf'))?this[_0xef3b('0x11')](_0xef3b('0xf'))[_0xef3b('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xef3b('0x13'),_0xef3b('0x14'),_0xef3b('0x15'),_0xef3b('0x16'),_0xef3b('0x17')),'defaultValue':_0xef3b('0x13')},'directmedia':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no',_0xef3b('0x19'),_0xef3b('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x2c5521){this['setDataValue']('nat',_0x2c5521?_0x2c5521[_0xef3b('0x10')](','):null);},'get':function(){return this[_0xef3b('0x11')](_0xef3b('0x1b'))?this[_0xef3b('0x11')](_0xef3b('0x1b'))[_0xef3b('0x12')](','):null;},'comment':_0xef3b('0x1c')},'callgroup':{'type':Sequelize[_0xef3b('0x2')]},'namedcallgroup':{'type':Sequelize[_0xef3b('0x2')]},'pickupgroup':{'type':Sequelize[_0xef3b('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':_0xef3b('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef3b('0x1e'),'set':function(_0x14183f){this[_0xef3b('0xe')](_0xef3b('0x1f'),_0x14183f?_0x14183f['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xef3b('0x11')]('allow')?this[_0xef3b('0x11')](_0xef3b('0x1f'))['split'](';'):null;},'comment':_0xef3b('0x20')},'autoframing':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'insecure':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':_0xef3b('0x21'),'set':function(_0x585abd){this[_0xef3b('0xe')]('insecure',_0x585abd?_0x585abd[_0xef3b('0x10')](','):null);},'get':function(){return this[_0xef3b('0x11')](_0xef3b('0x22'))?this[_0xef3b('0x11')](_0xef3b('0x22'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no',_0xef3b('0x23'))},'promiscredir':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xef3b('0x2')]},'callerid':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':_0xef3b('0x24')},'amaflags':{'type':Sequelize[_0xef3b('0x2')]},'callcounter':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xef3b('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xef3b('0x2')]},'template':{'type':Sequelize[_0xef3b('0x2')]},'videosupport':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no',_0xef3b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xef3b('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xef3b('0x2')]},'session_timers':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x27'),_0xef3b('0x28'),_0xef3b('0x29'))},'session_expires':{'type':Sequelize[_0xef3b('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xef3b('0x2a'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xef3b('0x2')]},'regexten':{'type':Sequelize[_0xef3b('0x2')]},'fromdomain':{'type':Sequelize[_0xef3b('0x2')]},'fromuser':{'type':Sequelize[_0xef3b('0x2')]},'port':{'type':Sequelize[_0xef3b('0x25')](0x5)},'qualify':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no'),'defaultValue':_0xef3b('0x18')},'keepalive':{'type':Sequelize[_0xef3b('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xef3b('0x2')]},'defaultuser':{'type':Sequelize[_0xef3b('0x2')]},'rtptimeout':{'type':Sequelize[_0xef3b('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xef3b('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xef3b('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xef3b('0x2')]},'callbackextension':{'type':Sequelize[_0xef3b('0x2')]},'timert1':{'type':Sequelize[_0xef3b('0x25')](0xb)},'timerb':{'type':Sequelize[_0xef3b('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xef3b('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xef3b('0x2')]},'contactdeny':{'type':Sequelize[_0xef3b('0x2')]},'contactacl':{'type':Sequelize[_0xef3b('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xef3b('0x2')]},'maxforwards':{'type':Sequelize[_0xef3b('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'force_avp':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'icesupport':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no',_0xef3b('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xef3b('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xef3b('0x2')]},'dtlscipher':{'type':Sequelize[_0xef3b('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xef3b('0x2')]},'dtlssetup':{'type':Sequelize[_0xef3b('0x4')]('active',_0xef3b('0x2c'),_0xef3b('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xef3b('0x2')]},'usereqphone':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xef3b('0x2')]},'call_limit':{'type':Sequelize[_0xef3b('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xef3b('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xef3b('0x18'),'no')},'vmexten':{'type':Sequelize[_0xef3b('0x2')]},'mohinterpret':{'type':Sequelize[_0xef3b('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xef3b('0x2')]},'description':{'type':Sequelize[_0xef3b('0x2')]},'host':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':_0xef3b('0x2e')},'canreinvite':{'type':Sequelize[_0xef3b('0x4')](_0xef3b('0x18'),'no',_0xef3b('0x19'),_0xef3b('0x1a'),_0xef3b('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xef3b('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 23010e5..207d54c 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 _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x514b5c,_0x59d456){var _0x134dbd=function(_0x4149ee){while(--_0x4149ee){_0x514b5c['push'](_0x514b5c['shift']());}};_0x134dbd(++_0x59d456);}(_0x55ca,0x126));var _0xa55c=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0x55ca[_0x1c2aeb];return _0x783379;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,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(_0x4ec3ab,_0x50a5de){var _0x229613=function(_0x5c2daa){while(--_0x5c2daa){_0x4ec3ab['push'](_0x4ec3ab['shift']());}};_0x229613(++_0x50a5de);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5343b2,_0x3489ab){_0x5343b2=_0x5343b2-0x0;var _0x113bd3=_0xe5b3[_0x5343b2];return _0x113bd3;};'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 f5a6bc7..13a5040 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 _0x0103=['exports','define','Trunk','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x0103,0x16b));var _0x3010=function(_0x2bc7bc,_0x827ea){_0x2bc7bc=_0x2bc7bc-0x0;var _0xbae862=_0x0103[_0x2bc7bc];return _0xbae862;};'use strict';var _=require(_0x3010('0x0'));var util=require('util');var logger=require(_0x3010('0x1'))(_0x3010('0x2'));var moment=require(_0x3010('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3010('0x4'));var rimraf=require(_0x3010('0x5'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x3010('0x6')]=function(_0x5e8b1b,_0x53e65d){return _0x5e8b1b[_0x3010('0x7')](_0x3010('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb92=['path','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xfb92,0x158));var _0x2fb9=function(_0x2d84f2,_0x5a13ab){_0x2d84f2=_0x2d84f2-0x0;var _0x44f4cf=_0xfb92[_0x2d84f2];return _0x44f4cf;};'use strict';var _=require(_0x2fb9('0x0'));var util=require(_0x2fb9('0x1'));var logger=require(_0x2fb9('0x2'))(_0x2fb9('0x3'));var moment=require(_0x2fb9('0x4'));var BPromise=require(_0x2fb9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fb9('0x6'));var rimraf=require('rimraf');var config=require(_0x2fb9('0x7'));var attributes=require('./trunk.attributes');module[_0x2fb9('0x8')]=function(_0x4f7b8c,_0x37d401){return _0x4f7b8c[_0x2fb9('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 354d6b7..c9e02c1 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 _0xb52f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','model','include','map','GetTrunk','debug','ShowTrunk','find','lodash','util','moment'];(function(_0x48948a,_0x3c105e){var _0x5d2709=function(_0x4f0d3b){while(--_0x4f0d3b){_0x48948a['push'](_0x48948a['shift']());}};_0x5d2709(++_0x3c105e);}(_0xb52f,0x12f));var _0xfb52=function(_0x3dbcd4,_0xcb4b50){_0x3dbcd4=_0x3dbcd4-0x0;var _0xf7e5f8=_0xb52f[_0x3dbcd4];return _0xf7e5f8;};'use strict';var _=require(_0xfb52('0x0'));var util=require(_0xfb52('0x1'));var moment=require(_0xfb52('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb52('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb52('0x4'))['db'];var utils=require(_0xfb52('0x5'));var logger=require(_0xfb52('0x6'))('rpc');var config=require(_0xfb52('0x7'));var jayson=require(_0xfb52('0x8'));var client=jayson[_0xfb52('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fa0c,_0x42b6e7,_0x29889f){return new BPromise(function(_0x5a9b64,_0x12e315){return client[_0xfb52('0xa')](_0x31fa0c,_0x29889f)[_0xfb52('0xb')](function(_0x52dadb){logger[_0xfb52('0xc')](_0xfb52('0xd'),_0x42b6e7,_0xfb52('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x42b6e7,_0xfb52('0xe'),JSON[_0xfb52('0xf')](_0x52dadb));if(_0x52dadb[_0xfb52('0x10')]){if(_0x52dadb['error'][_0xfb52('0x11')]===0x1f4){logger[_0xfb52('0x10')](_0xfb52('0xd'),_0x42b6e7,_0x52dadb[_0xfb52('0x10')]['message']);return _0x12e315(_0x52dadb['error'][_0xfb52('0x12')]);}logger[_0xfb52('0x10')](_0xfb52('0xd'),_0x42b6e7,_0x52dadb[_0xfb52('0x10')][_0xfb52('0x12')]);return _0x5a9b64(_0x52dadb['error'][_0xfb52('0x12')]);}else{logger[_0xfb52('0xc')]('Trunk,\x20%s,\x20%s',_0x42b6e7,_0xfb52('0xe'));_0x5a9b64(_0x52dadb[_0xfb52('0x13')][_0xfb52('0x12')]);}})[_0xfb52('0x14')](function(_0x24ed56){logger[_0xfb52('0x10')](_0xfb52('0xd'),_0x42b6e7,_0x24ed56);_0x12e315(_0x24ed56);});});}exports['GetTrunk']=function(_0x2c978e){var _0x198b40=this;return new Promise(function(_0x125729,_0x3bc42f){return db[_0xfb52('0x15')][_0xfb52('0x16')]({'raw':_0x2c978e[_0xfb52('0x17')]?_0x2c978e[_0xfb52('0x17')][_0xfb52('0x18')]===undefined?!![]:![]:!![],'where':_0x2c978e['options']?_0x2c978e[_0xfb52('0x17')][_0xfb52('0x19')]||null:null,'attributes':_0x2c978e[_0xfb52('0x17')]?_0x2c978e[_0xfb52('0x17')][_0xfb52('0x1a')]||null:null,'limit':_0x2c978e['options']?_0x2c978e[_0xfb52('0x17')]['limit']||null:null,'include':_0x2c978e[_0xfb52('0x17')]?_0x2c978e['options']['include']?_['map'](_0x2c978e[_0xfb52('0x17')]['include'],function(_0x55bdc1){return{'model':db[_0x55bdc1[_0xfb52('0x1b')]],'as':_0x55bdc1['as'],'attributes':_0x55bdc1[_0xfb52('0x1a')],'include':_0x55bdc1[_0xfb52('0x1c')]?_[_0xfb52('0x1d')](_0x55bdc1[_0xfb52('0x1c')],function(_0x2481d0){return{'model':db[_0x2481d0[_0xfb52('0x1b')]],'as':_0x2481d0['as'],'attributes':_0x2481d0[_0xfb52('0x1a')],'include':_0x2481d0['include']?_['map'](_0x2481d0[_0xfb52('0x1c')],function(_0x27db84){return{'model':db[_0x27db84['model']],'as':_0x27db84['as'],'attributes':_0x27db84['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b5be6){logger[_0xfb52('0xc')](_0xfb52('0x1e'),_0x2c978e);logger[_0xfb52('0x1f')]('GetTrunk',_0x2c978e,JSON[_0xfb52('0xf')](_0x3b5be6));_0x125729(_0x3b5be6);})['catch'](function(_0x478b36){logger[_0xfb52('0x10')](_0xfb52('0x1e'),_0x478b36[_0xfb52('0x12')],_0x2c978e);_0x3bc42f(_0x198b40['error'](0x1f4,_0x478b36['message']));});});};exports[_0xfb52('0x20')]=function(_0x574a04){var _0x77fbfb=this;return new Promise(function(_0x2aeace,_0xef3b9c){return db[_0xfb52('0x15')][_0xfb52('0x21')]({'raw':_0x574a04[_0xfb52('0x17')]?_0x574a04[_0xfb52('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x574a04[_0xfb52('0x17')]?_0x574a04['options']['where']||null:null,'attributes':_0x574a04['options']?_0x574a04[_0xfb52('0x17')]['attributes']||null:null,'include':_0x574a04[_0xfb52('0x17')]?_0x574a04[_0xfb52('0x17')][_0xfb52('0x1c')]?_['map'](_0x574a04[_0xfb52('0x17')]['include'],function(_0x3db936){return{'model':db[_0x3db936['model']],'as':_0x3db936['as'],'attributes':_0x3db936[_0xfb52('0x1a')],'include':_0x3db936['include']?_[_0xfb52('0x1d')](_0x3db936['include'],function(_0x1a06c4){return{'model':db[_0x1a06c4['model']],'as':_0x1a06c4['as'],'attributes':_0x1a06c4['attributes'],'include':_0x1a06c4['include']?_[_0xfb52('0x1d')](_0x1a06c4[_0xfb52('0x1c')],function(_0x150eca){return{'model':db[_0x150eca['model']],'as':_0x150eca['as'],'attributes':_0x150eca[_0xfb52('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfb52('0xb')](function(_0xa67d0b){logger['info']('ShowTrunk',_0x574a04);logger[_0xfb52('0x1f')](_0xfb52('0x20'),_0x574a04,JSON['stringify'](_0xa67d0b));_0x2aeace(_0xa67d0b);})['catch'](function(_0xe6c3a9){logger['error'](_0xfb52('0x20'),_0xe6c3a9['message'],_0x574a04);_0xef3b9c(_0x77fbfb[_0xfb52('0x10')](0x1f4,_0xe6c3a9[_0xfb52('0x12')]));});});}; \ No newline at end of file +var _0x7e50=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','model','map','GetTrunk','stringify','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb3bc51,_0x69c477){var _0x2846ef=function(_0x381d67){while(--_0x381d67){_0xb3bc51['push'](_0xb3bc51['shift']());}};_0x2846ef(++_0x69c477);}(_0x7e50,0x162));var _0x07e5=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x7e50[_0x296809];return _0x18c0d3;};'use strict';var _=require(_0x07e5('0x0'));var util=require(_0x07e5('0x1'));var moment=require(_0x07e5('0x2'));var BPromise=require(_0x07e5('0x3'));var rs=require(_0x07e5('0x4'));var fs=require('fs');var Redis=require(_0x07e5('0x5'));var db=require(_0x07e5('0x6'))['db'];var utils=require(_0x07e5('0x7'));var logger=require(_0x07e5('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x07e5('0x9'));var client=jayson[_0x07e5('0xa')][_0x07e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2437db,_0x1c5a3d,_0x48a84e){return new BPromise(function(_0x1fe2b2,_0x20313f){return client[_0x07e5('0xc')](_0x2437db,_0x48a84e)['then'](function(_0x3dfed6){logger[_0x07e5('0xd')](_0x07e5('0xe'),_0x1c5a3d,_0x07e5('0xf'));logger[_0x07e5('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1c5a3d,_0x07e5('0xf'),JSON['stringify'](_0x3dfed6));if(_0x3dfed6['error']){if(_0x3dfed6[_0x07e5('0x11')][_0x07e5('0x12')]===0x1f4){logger['error'](_0x07e5('0xe'),_0x1c5a3d,_0x3dfed6['error'][_0x07e5('0x13')]);return _0x20313f(_0x3dfed6['error'][_0x07e5('0x13')]);}logger[_0x07e5('0x11')](_0x07e5('0xe'),_0x1c5a3d,_0x3dfed6['error'][_0x07e5('0x13')]);return _0x1fe2b2(_0x3dfed6['error'][_0x07e5('0x13')]);}else{logger[_0x07e5('0xd')](_0x07e5('0xe'),_0x1c5a3d,_0x07e5('0xf'));_0x1fe2b2(_0x3dfed6[_0x07e5('0x14')][_0x07e5('0x13')]);}})[_0x07e5('0x15')](function(_0x542b73){logger['error'](_0x07e5('0xe'),_0x1c5a3d,_0x542b73);_0x20313f(_0x542b73);});});}exports['GetTrunk']=function(_0x445568){var _0x220025=this;return new Promise(function(_0x3032d6,_0x35a548){return db[_0x07e5('0x16')][_0x07e5('0x17')]({'raw':_0x445568[_0x07e5('0x18')]?_0x445568[_0x07e5('0x18')][_0x07e5('0x19')]===undefined?!![]:![]:!![],'where':_0x445568[_0x07e5('0x18')]?_0x445568[_0x07e5('0x18')][_0x07e5('0x1a')]||null:null,'attributes':_0x445568[_0x07e5('0x18')]?_0x445568[_0x07e5('0x18')][_0x07e5('0x1b')]||null:null,'limit':_0x445568['options']?_0x445568[_0x07e5('0x18')][_0x07e5('0x1c')]||null:null,'include':_0x445568[_0x07e5('0x18')]?_0x445568[_0x07e5('0x18')][_0x07e5('0x1d')]?_['map'](_0x445568[_0x07e5('0x18')]['include'],function(_0x409769){return{'model':db[_0x409769['model']],'as':_0x409769['as'],'attributes':_0x409769[_0x07e5('0x1b')],'include':_0x409769['include']?_['map'](_0x409769['include'],function(_0x51bebf){return{'model':db[_0x51bebf[_0x07e5('0x1e')]],'as':_0x51bebf['as'],'attributes':_0x51bebf[_0x07e5('0x1b')],'include':_0x51bebf[_0x07e5('0x1d')]?_[_0x07e5('0x1f')](_0x51bebf[_0x07e5('0x1d')],function(_0x20dff1){return{'model':db[_0x20dff1[_0x07e5('0x1e')]],'as':_0x20dff1['as'],'attributes':_0x20dff1[_0x07e5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477402){logger[_0x07e5('0xd')](_0x07e5('0x20'),_0x445568);logger[_0x07e5('0x10')]('GetTrunk',_0x445568,JSON[_0x07e5('0x21')](_0x477402));_0x3032d6(_0x477402);})['catch'](function(_0x1a576f){logger[_0x07e5('0x11')]('GetTrunk',_0x1a576f[_0x07e5('0x13')],_0x445568);_0x35a548(_0x220025[_0x07e5('0x11')](0x1f4,_0x1a576f[_0x07e5('0x13')]));});});};exports[_0x07e5('0x22')]=function(_0x46931c){var _0x4430d0=this;return new Promise(function(_0x28d363,_0x1ae64f){return db[_0x07e5('0x16')][_0x07e5('0x23')]({'raw':_0x46931c[_0x07e5('0x18')]?_0x46931c[_0x07e5('0x18')][_0x07e5('0x19')]===undefined?!![]:![]:!![],'where':_0x46931c[_0x07e5('0x18')]?_0x46931c[_0x07e5('0x18')]['where']||null:null,'attributes':_0x46931c[_0x07e5('0x18')]?_0x46931c[_0x07e5('0x18')][_0x07e5('0x1b')]||null:null,'include':_0x46931c[_0x07e5('0x18')]?_0x46931c[_0x07e5('0x18')][_0x07e5('0x1d')]?_[_0x07e5('0x1f')](_0x46931c[_0x07e5('0x18')][_0x07e5('0x1d')],function(_0x4ed328){return{'model':db[_0x4ed328[_0x07e5('0x1e')]],'as':_0x4ed328['as'],'attributes':_0x4ed328['attributes'],'include':_0x4ed328[_0x07e5('0x1d')]?_[_0x07e5('0x1f')](_0x4ed328[_0x07e5('0x1d')],function(_0x52c3a7){return{'model':db[_0x52c3a7[_0x07e5('0x1e')]],'as':_0x52c3a7['as'],'attributes':_0x52c3a7[_0x07e5('0x1b')],'include':_0x52c3a7[_0x07e5('0x1d')]?_[_0x07e5('0x1f')](_0x52c3a7['include'],function(_0x47228a){return{'model':db[_0x47228a[_0x07e5('0x1e')]],'as':_0x47228a['as'],'attributes':_0x47228a[_0x07e5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f1ebb){logger[_0x07e5('0xd')](_0x07e5('0x22'),_0x46931c);logger['debug'](_0x07e5('0x22'),_0x46931c,JSON['stringify'](_0x3f1ebb));_0x28d363(_0x3f1ebb);})[_0x07e5('0x15')](function(_0x583056){logger[_0x07e5('0x11')](_0x07e5('0x22'),_0x583056['message'],_0x46931c);_0x1ae64f(_0x4430d0[_0x07e5('0x11')](0x1f4,_0x583056[_0x07e5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b6a6c13..a1a5051 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 _0xbf4b=['./user-setting.controller','put','/:id','update','exports','express','Router','../../components/auth/service'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0xbf4b,0x85));var _0xbbf4=function(_0x54a14f,_0x59c124){_0x54a14f=_0x54a14f-0x0;var _0x47d334=_0xbf4b[_0x54a14f];return _0x47d334;};'use strict';var express=require(_0xbbf4('0x0'));var router=express[_0xbbf4('0x1')]();var auth=require(_0xbbf4('0x2'));var controller=require(_0xbbf4('0x3'));router[_0xbbf4('0x4')](_0xbbf4('0x5'),auth['isAuthenticated'](),controller[_0xbbf4('0x6')]);module[_0xbbf4('0x7')]=router; \ No newline at end of file +var _0x368c=['isAuthenticated','update','exports','express','./user-setting.controller'];(function(_0x167ac7,_0x2b9f0b){var _0x4fb0c6=function(_0x2d3185){while(--_0x2d3185){_0x167ac7['push'](_0x167ac7['shift']());}};_0x4fb0c6(++_0x2b9f0b);}(_0x368c,0xe9));var _0xc368=function(_0x5427bd,_0x2c5540){_0x5427bd=_0x5427bd-0x0;var _0x498286=_0x368c[_0x5427bd];return _0x498286;};'use strict';var express=require(_0xc368('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xc368('0x1'));router['put']('/:id',auth[_0xc368('0x2')](),controller[_0xc368('0x3')]);module[_0xc368('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 a49a0db..2e48ce5 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 _0x32f6=['BOOLEAN','TEXT','INTEGER','UserId','sequelize','warning','info','exports','ENUM'];(function(_0x2504c3,_0x2da3b8){var _0x5cf716=function(_0x54d1f7){while(--_0x54d1f7){_0x2504c3['push'](_0x2504c3['shift']());}};_0x5cf716(++_0x2da3b8);}(_0x32f6,0xdc));var _0x632f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x32f6[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x632f('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x632f('0x1'),_0x632f('0x2'),'debug'];module[_0x632f('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x632f('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x632f('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x632f('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x632f('0x7')],'unique':_0x632f('0x8')}}; \ No newline at end of file +var _0x326d=['warning','info','debug','exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','sequelize'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x326d,0x133));var _0xd326=function(_0x1affb7,_0x27a732){_0x1affb7=_0x1affb7-0x0;var _0x1632aa=_0x326d[_0x1affb7];return _0x1632aa;};'use strict';var Sequelize=require(_0xd326('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0xd326('0x1'),_0xd326('0x2'),_0xd326('0x3')];module[_0xd326('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd326('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd326('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd326('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd326('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd326('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd326('0xa')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index bbce2f8..e5e18d3 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 _0x6f7f=['status','json','then','sendStatus','error','stack','send','update','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','body','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','defaults','localhost'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x6f7f,0x177));var _0xf6f7=function(_0x18605a,_0x1d03db){_0x18605a=_0x18605a-0x0;var _0x448933=_0x6f7f[_0x18605a];return _0x448933;};'use strict';var _=require('lodash');var Redis=require(_0xf6f7('0x0'));var logger=require(_0xf6f7('0x1'))(_0xf6f7('0x2'));var config=require(_0xf6f7('0x3'));var db=require(_0xf6f7('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf6f7('0x5')]));require('./user-setting.socket')[_0xf6f7('0x6')](socket);config[_0xf6f7('0x5')]=_[_0xf6f7('0x7')](config['redis'],{'host':_0xf6f7('0x8'),'port':0x18eb});function respondWithResult(_0x543eb3,_0x33a2b2){_0x33a2b2=_0x33a2b2||0xc8;return function(_0x3c641f){if(_0x3c641f){return _0x543eb3[_0xf6f7('0x9')](_0x33a2b2)[_0xf6f7('0xa')](_0x3c641f);}};}function saveUpdates(_0x2bf166){return function(_0x1cfa51){if(_0x1cfa51){return _0x1cfa51['update'](_0x2bf166)[_0xf6f7('0xb')](function(_0x5299eb){return _0x5299eb;});}return null;};}function handleEntityNotFound(_0x4de365){return function(_0x518b87){if(!_0x518b87){_0x4de365[_0xf6f7('0xc')](0x194);}return _0x518b87;};}function handleError(_0x43082f,_0x32e3dd){_0x32e3dd=_0x32e3dd||0x1f4;return function(_0x491b5d){logger[_0xf6f7('0xd')](_0x491b5d[_0xf6f7('0xe')]);if(_0x491b5d['name']){delete _0x491b5d['name'];}_0x43082f[_0xf6f7('0x9')](_0x32e3dd)[_0xf6f7('0xf')](_0x491b5d);};}exports[_0xf6f7('0x10')]=function(_0x4fe21e,_0x5f2aee){if(_0x4fe21e['user'][_0xf6f7('0x11')]!=='admin')throw new Error(_0xf6f7('0x12'));if(isNaN(Number(_0x4fe21e['params']['id'])))throw new Error(_0xf6f7('0x13'));return db[_0xf6f7('0x14')][_0xf6f7('0x15')]({'where':{'id':_0x4fe21e[_0xf6f7('0x16')]['id']}})[_0xf6f7('0xb')](handleEntityNotFound(_0x5f2aee,null))['then'](saveUpdates(_0x4fe21e[_0xf6f7('0x17')],null))[_0xf6f7('0xb')](respondWithResult(_0x5f2aee,null))['catch'](handleError(_0x5f2aee,null));}; \ No newline at end of file +var _0xeedf=['lodash','ioredis','../../config/logger','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','json','then','error','name','status','send','update','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch'];(function(_0x59d951,_0x39f322){var _0x57f095=function(_0x2af8ab){while(--_0x2af8ab){_0x59d951['push'](_0x59d951['shift']());}};_0x57f095(++_0x39f322);}(_0xeedf,0x12c));var _0xfeed=function(_0x1be41f,_0x2e0059){_0x1be41f=_0x1be41f-0x0;var _0x562a98=_0xeedf[_0x1be41f];return _0x562a98;};'use strict';var _=require(_0xfeed('0x0'));var Redis=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var config=require(_0xfeed('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xfeed('0x4'))(new Redis(config[_0xfeed('0x5')]));require(_0xfeed('0x6'))[_0xfeed('0x7')](socket);config['redis']=_[_0xfeed('0x8')](config[_0xfeed('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x19f2de,_0x52286c){_0x52286c=_0x52286c||0xc8;return function(_0x22fd66){if(_0x22fd66){return _0x19f2de['status'](_0x52286c)[_0xfeed('0x9')](_0x22fd66);}};}function saveUpdates(_0x55a598){return function(_0x527ea1){if(_0x527ea1){return _0x527ea1['update'](_0x55a598)[_0xfeed('0xa')](function(_0x2e818d){return _0x2e818d;});}return null;};}function handleEntityNotFound(_0x4222af){return function(_0x467270){if(!_0x467270){_0x4222af['sendStatus'](0x194);}return _0x467270;};}function handleError(_0x1e39c8,_0x3c0be5){_0x3c0be5=_0x3c0be5||0x1f4;return function(_0x3531da){logger[_0xfeed('0xb')](_0x3531da['stack']);if(_0x3531da['name']){delete _0x3531da[_0xfeed('0xc')];}_0x1e39c8[_0xfeed('0xd')](_0x3c0be5)[_0xfeed('0xe')](_0x3531da);};}exports[_0xfeed('0xf')]=function(_0x23b516,_0x36a842){if(_0x23b516['user'][_0xfeed('0x10')]!==_0xfeed('0x11'))throw new Error(_0xfeed('0x12'));if(isNaN(Number(_0x23b516[_0xfeed('0x13')]['id'])))throw new Error(_0xfeed('0x14'));return db[_0xfeed('0x15')][_0xfeed('0x16')]({'where':{'id':_0x23b516[_0xfeed('0x13')]['id']}})[_0xfeed('0xa')](handleEntityNotFound(_0x36a842,null))[_0xfeed('0xa')](saveUpdates(_0x23b516[_0xfeed('0x17')],null))[_0xfeed('0xa')](respondWithResult(_0x36a842,null))[_0xfeed('0x18')](handleError(_0x36a842,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 09e6f04..ff88908 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 _0x6be0=['hasOwnProperty','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x1e386f,_0x20c81b){var _0x9c11ae=function(_0x3ee833){while(--_0x3ee833){_0x1e386f['push'](_0x1e386f['shift']());}};_0x9c11ae(++_0x20c81b);}(_0x6be0,0x1a5));var _0x06be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0x06be('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x06be('0x1')](0x0);var events={'afterCreate':_0x06be('0x2'),'afterUpdate':_0x06be('0x3'),'afterDestroy':_0x06be('0x4')};function emitEvent(_0x5ce542){return function(_0x36d5d7,_0x3a8dee,_0x49a217){UserSettingEvents[_0x06be('0x5')](_0x5ce542+':'+_0x36d5d7['id'],_0x36d5d7);UserSettingEvents[_0x06be('0x5')](_0x5ce542,_0x36d5d7);_0x49a217(null);};}for(var e in events){if(events[_0x06be('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xc2c7=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x18eda2,_0x152940){var _0x4c2e4b=function(_0x251c85){while(--_0x251c85){_0x18eda2['push'](_0x18eda2['shift']());}};_0x4c2e4b(++_0x152940);}(_0xc2c7,0x11d));var _0x7c2c=function(_0x32ddf8,_0x5d47cb){_0x32ddf8=_0x32ddf8-0x0;var _0x311058=_0xc2c7[_0x32ddf8];return _0x311058;};'use strict';var EventEmitter=require(_0x7c2c('0x0'));var UserSetting=require(_0x7c2c('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x7c2c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c2c('0x3'),'afterDestroy':_0x7c2c('0x4')};function emitEvent(_0x442619){return function(_0x431d4f,_0xd2714b,_0x463d7b){UserSettingEvents[_0x7c2c('0x5')](_0x442619+':'+_0x431d4f['id'],_0x431d4f);UserSettingEvents[_0x7c2c('0x5')](_0x442619,_0x431d4f);_0x463d7b(null);};}for(var e in events){if(events[_0x7c2c('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 009325b..729ee6f 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 _0x26f9=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x26f9,0x16f));var _0x926f=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x26f9[_0x24487f];return _0x456456;};'use strict';var attributes=require(_0x926f('0x0'));module[_0x926f('0x1')]=function(_0x4fdca2){return _0x4fdca2[_0x926f('0x2')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x649213){if(!_0x649213[_0x926f('0x3')])_0x649213['clientSideLoggingEnabledSince']=null;else if(_0x649213[_0x926f('0x4')]===null)_0x649213[_0x926f('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x8b29=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0x19004f,_0x580802){var _0x300fe4=function(_0x17bf5b){while(--_0x17bf5b){_0x19004f['push'](_0x19004f['shift']());}};_0x300fe4(++_0x580802);}(_0x8b29,0xbe));var _0x98b2=function(_0x43b149,_0x9632dd){_0x43b149=_0x43b149-0x0;var _0xfabe68=_0x8b29[_0x43b149];return _0xfabe68;};'use strict';var attributes=require(_0x98b2('0x0'));module['exports']=function(_0xc35914){return _0xc35914[_0x98b2('0x1')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2363fe){if(!_0x2363fe[_0x98b2('0x2')])_0x2363fe['clientSideLoggingEnabledSince']=null;else if(_0x2363fe[_0x98b2('0x3')]===null)_0x2363fe['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 8c43e5a..5ef7168 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 _0xc8fd=['length','user-setting:','./user-setting.events','save','remove','update','user-setting:update','user-setting:update:user-','UserId'];(function(_0xbbaccc,_0x18980b){var _0x4af10b=function(_0x12e356){while(--_0x12e356){_0xbbaccc['push'](_0xbbaccc['shift']());}};_0x4af10b(++_0x18980b);}(_0xc8fd,0xa4));var _0xdc8f=function(_0x1f787a,_0x230b1d){_0x1f787a=_0x1f787a-0x0;var _0x3e0c07=_0xc8fd[_0x1f787a];return _0x3e0c07;};'use strict';var UserSettingEvents=require(_0xdc8f('0x0'));var events=[_0xdc8f('0x1'),_0xdc8f('0x2'),_0xdc8f('0x3')];function createListener(_0x3023f7,_0x2e090b){return function(_0x3aae6f){_0x2e090b['emit'](_0x3023f7,_0x3aae6f);if(_0x3023f7===_0xdc8f('0x4')){_0x2e090b['emit'](_0xdc8f('0x5')+_0x3aae6f[_0xdc8f('0x6')],_0x3aae6f);}};}exports['register']=function(_0xaa4f01){for(var _0x55dcac=0x0,_0x31367c=events[_0xdc8f('0x7')];_0x55dcac<_0x31367c;_0x55dcac++){var _0x52f317=events[_0x55dcac];var _0x4a6f32=createListener(_0xdc8f('0x8')+_0x52f317,_0xaa4f01);UserSettingEvents['on'](_0x52f317,_0x4a6f32);}}; \ No newline at end of file +var _0xeadd=['remove','update','emit','UserId','register','length','user-setting:','./user-setting.events','save'];(function(_0x1dd98c,_0xd43b37){var _0x36bb7a=function(_0x4f2e4e){while(--_0x4f2e4e){_0x1dd98c['push'](_0x1dd98c['shift']());}};_0x36bb7a(++_0xd43b37);}(_0xeadd,0x103));var _0xdead=function(_0x31816f,_0x3eeb95){_0x31816f=_0x31816f-0x0;var _0x5e355b=_0xeadd[_0x31816f];return _0x5e355b;};'use strict';var UserSettingEvents=require(_0xdead('0x0'));var events=[_0xdead('0x1'),_0xdead('0x2'),_0xdead('0x3')];function createListener(_0xf6d468,_0x5a8de1){return function(_0x27344a){_0x5a8de1['emit'](_0xf6d468,_0x27344a);if(_0xf6d468==='user-setting:update'){_0x5a8de1[_0xdead('0x4')]('user-setting:update:user-'+_0x27344a[_0xdead('0x5')],_0x27344a);}};}exports[_0xdead('0x6')]=function(_0x49a2e8){for(var _0x49e481=0x0,_0x120d5e=events[_0xdead('0x7')];_0x49e481<_0x120d5e;_0x49e481++){var _0x503854=events[_0x49e481];var _0x370e90=createListener(_0xdead('0x8')+_0x503854,_0x49a2e8);UserSettingEvents['on'](_0x503854,_0x370e90);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bfd76a3..cf24702 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 _0x945a=['addContacts','create','/create_many','addQueues','diskStorage','root','server/files/images/','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','update','changePassword','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post'];(function(_0x3fa5ea,_0x2739ab){var _0x5b3a53=function(_0x5757a7){while(--_0x5757a7){_0x3fa5ea['push'](_0x3fa5ea['shift']());}};_0x5b3a53(++_0x2739ab);}(_0x945a,0x1d2));var _0xa945=function(_0x189fc9,_0x2fd1d6){_0x189fc9=_0x189fc9-0x0;var _0xb611=_0x945a[_0x189fc9];return _0xb611;};'use strict';var multer=require('multer');var util=require(_0xa945('0x0'));var path=require(_0xa945('0x1'));var timeout=require(_0xa945('0x2'));var express=require('express');var router=express[_0xa945('0x3')]();var fs_extra=require(_0xa945('0x4'));var auth=require(_0xa945('0x5'));var interaction=require(_0xa945('0x6'));var config=require('../../config/environment');var controller=require(_0xa945('0x7'));router[_0xa945('0x8')]('/',auth[_0xa945('0x9')](),controller[_0xa945('0xa')]);router[_0xa945('0x8')](_0xa945('0xb'),auth['isAuthenticated'](),controller[_0xa945('0xc')]);router['get'](_0xa945('0xd'),auth[_0xa945('0x9')](),controller['whoami']);router[_0xa945('0x8')](_0xa945('0xe'),auth[_0xa945('0x9')](),controller[_0xa945('0xf')]);router[_0xa945('0x8')](_0xa945('0x10'),auth[_0xa945('0x9')](),controller['show']);router[_0xa945('0x8')](_0xa945('0x11'),controller[_0xa945('0x12')]);router[_0xa945('0x8')](_0xa945('0x13'),auth[_0xa945('0x9')](),controller['getOpenTabs']);router['get'](_0xa945('0x14'),auth[_0xa945('0x9')](),controller[_0xa945('0x15')]);router['get'](_0xa945('0x16'),auth['isAuthenticated'](),controller[_0xa945('0x17')]);router['get'](_0xa945('0x18'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router['get'](_0xa945('0x19'),auth['isAuthenticated'](),controller[_0xa945('0x1a')]);router[_0xa945('0x8')](_0xa945('0x1b'),auth['isAuthenticated'](),controller[_0xa945('0x1c')]);router['get']('/:id/screen_recordings',auth[_0xa945('0x9')](),controller['getScreenRecordings']);router['get'](_0xa945('0x1d'),auth[_0xa945('0x9')](),controller[_0xa945('0x1e')]);router['get'](_0xa945('0x1f'),auth['isAuthenticated'](),controller[_0xa945('0x20')]);router[_0xa945('0x8')](_0xa945('0x21'),auth[_0xa945('0x9')](),controller[_0xa945('0x22')]);router[_0xa945('0x8')](_0xa945('0x23'),auth[_0xa945('0x9')](),controller[_0xa945('0x24')]);router[_0xa945('0x8')]('/:id/fax/interactions',auth[_0xa945('0x9')](),controller[_0xa945('0x25')]);router[_0xa945('0x8')](_0xa945('0x26'),auth[_0xa945('0x9')](),controller[_0xa945('0x27')]);router[_0xa945('0x8')](_0xa945('0x28'),auth[_0xa945('0x9')](),controller['getTeams']);router[_0xa945('0x8')](_0xa945('0x29'),auth[_0xa945('0x9')](),controller[_0xa945('0x2a')]);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0xa945('0x2b')]);router[_0xa945('0x8')](_0xa945('0x2c'),auth[_0xa945('0x9')](),controller['getVoicePrefixes']);router[_0xa945('0x8')](_0xa945('0x2d'),auth[_0xa945('0x9')](),controller[_0xa945('0x2e')]);router[_0xa945('0x8')](_0xa945('0x2f'),auth[_0xa945('0x9')](),controller['getMailAccounts']);router[_0xa945('0x8')](_0xa945('0x30'),auth['isAuthenticated'](),controller[_0xa945('0x31')]);router[_0xa945('0x8')](_0xa945('0x32'),auth[_0xa945('0x9')](),controller[_0xa945('0x33')]);router['get'](_0xa945('0x34'),auth[_0xa945('0x9')](),controller[_0xa945('0x35')]);router['get'](_0xa945('0x36'),auth[_0xa945('0x9')](),controller[_0xa945('0x37')]);router[_0xa945('0x8')]('/:id/scheduled_calls',auth[_0xa945('0x9')](),controller[_0xa945('0x38')]);router[_0xa945('0x8')](_0xa945('0x39'),auth['isAuthenticated'](),controller['getApiKey']);router[_0xa945('0x3a')](_0xa945('0x14'),auth['isAuthenticated'](),controller[_0xa945('0x3b')]);router['post']('/',auth[_0xa945('0x9')](),controller[_0xa945('0x3c')]);router['post'](_0xa945('0x3d'),auth[_0xa945('0x9')](),controller['bulkCreate']);router[_0xa945('0x3a')](_0xa945('0x16'),auth[_0xa945('0x9')](),controller[_0xa945('0x3e')]);var upload=multer({'storage':multer[_0xa945('0x3f')]({'destination':function(_0x48d979,_0x572ee8,_0x40a0f8){_0x40a0f8(null,path['join'](config[_0xa945('0x40')],_0xa945('0x41')));},'filename':function(_0x1d7cb9,_0x5af3c9,_0x214253){_0x214253(null,util['format'](_0xa945('0x42'),Date[_0xa945('0x43')](),_0x5af3c9[_0xa945('0x44')]));}})});router[_0xa945('0x3a')](_0xa945('0x11'),upload['single'](_0xa945('0x45')),controller[_0xa945('0x46')]);router[_0xa945('0x3a')](_0xa945('0x47'),auth[_0xa945('0x9')](),controller[_0xa945('0x48')]);router[_0xa945('0x3a')]('/:id/logout',auth[_0xa945('0x9')](),controller['logout']);router['post']('/:id/pause',auth[_0xa945('0x9')](),controller['pause']);router[_0xa945('0x3a')](_0xa945('0x49'),auth[_0xa945('0x9')](),controller[_0xa945('0x4a')]);router['post'](_0xa945('0x28'),auth['isAuthenticated'](),controller[_0xa945('0x4b')]);router['post'](_0xa945('0x4c'),auth[_0xa945('0x9')](),controller['addChatInteractions']);router[_0xa945('0x3a')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xa945('0x4d')]);router[_0xa945('0x3a')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0xa945('0x3a')]('/:id/sms_interactions',auth[_0xa945('0x9')](),controller[_0xa945('0x4e')]);router[_0xa945('0x3a')](_0xa945('0x4f'),auth[_0xa945('0x9')](),controller[_0xa945('0x50')]);router[_0xa945('0x3a')](_0xa945('0x51'),auth[_0xa945('0x9')](),controller[_0xa945('0x52')]);router['post'](_0xa945('0x2d'),auth[_0xa945('0x9')](),controller['addFaxAccounts']);router['post'](_0xa945('0x2f'),auth['isAuthenticated'](),controller[_0xa945('0x53')]);router['post']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xa945('0x54')]);router['post'](_0xa945('0x32'),auth[_0xa945('0x9')](),controller[_0xa945('0x55')]);router[_0xa945('0x3a')](_0xa945('0x34'),auth[_0xa945('0x9')](),controller[_0xa945('0x56')]);router['post'](_0xa945('0x36'),auth[_0xa945('0x9')](),controller[_0xa945('0x57')]);router[_0xa945('0x3a')](_0xa945('0x39'),auth['isAuthenticated'](),controller['createApiKey']);router[_0xa945('0x58')](_0xa945('0x10'),auth[_0xa945('0x9')](),controller[_0xa945('0x59')]);router[_0xa945('0x58')]('/:id/password',auth['isAuthenticated'](),controller[_0xa945('0x5a')]);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0xa945('0x5b')]);router[_0xa945('0x5c')](_0xa945('0x28'),auth[_0xa945('0x9')](),controller['removeTeams']);router[_0xa945('0x5c')]('/:id',auth['isAuthenticated'](),controller[_0xa945('0x5d')]);router[_0xa945('0x5c')](_0xa945('0x4c'),auth[_0xa945('0x9')](),controller[_0xa945('0x5e')]);router[_0xa945('0x5c')]('/:id/mail_interactions',auth[_0xa945('0x9')](),controller[_0xa945('0x5f')]);router[_0xa945('0x5c')]('/:id/fax_interactions',auth[_0xa945('0x9')](),controller['removeFaxInteractions']);router[_0xa945('0x5c')](_0xa945('0x60'),auth['isAuthenticated'](),controller[_0xa945('0x61')]);router[_0xa945('0x5c')]('/:id/openchannel_interactions',auth[_0xa945('0x9')](),controller[_0xa945('0x62')]);router[_0xa945('0x5c')](_0xa945('0x51'),auth[_0xa945('0x9')](),controller['removeWhatsappInteractions']);router[_0xa945('0x5c')]('/:id/fax_accounts',auth[_0xa945('0x9')](),controller[_0xa945('0x63')]);router[_0xa945('0x5c')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xa945('0x64')]);router[_0xa945('0x5c')](_0xa945('0x30'),auth['isAuthenticated'](),controller[_0xa945('0x65')]);router['delete'](_0xa945('0x32'),auth[_0xa945('0x9')](),controller[_0xa945('0x66')]);router[_0xa945('0x5c')](_0xa945('0x34'),auth[_0xa945('0x9')](),controller['removeChatWebsites']);router[_0xa945('0x5c')](_0xa945('0x36'),auth[_0xa945('0x9')](),controller['removeWhatsappAccounts']);router[_0xa945('0x5c')](_0xa945('0x39'),auth[_0xa945('0x9')](),controller[_0xa945('0x67')]);module[_0xa945('0x68')]=router; \ No newline at end of file +var _0xe3c8=['update','put','removeQueues','delete','destroy','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','root','server/files/images/','format','now','originalname','/:id/avatar','single','file','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey'];(function(_0x4afee2,_0x5780cf){var _0x5de67c=function(_0xe9586d){while(--_0xe9586d){_0x4afee2['push'](_0x4afee2['shift']());}};_0x5de67c(++_0x5780cf);}(_0xe3c8,0x145));var _0x8e3c=function(_0x56df9f,_0xb97e4){_0x56df9f=_0x56df9f-0x0;var _0x2f3819=_0xe3c8[_0x56df9f];return _0x2f3819;};'use strict';var multer=require(_0x8e3c('0x0'));var util=require(_0x8e3c('0x1'));var path=require(_0x8e3c('0x2'));var timeout=require(_0x8e3c('0x3'));var express=require(_0x8e3c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e3c('0x6'));var controller=require(_0x8e3c('0x7'));router[_0x8e3c('0x8')]('/',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xa')]);router['get'](_0x8e3c('0xb'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xc')]);router[_0x8e3c('0x8')](_0x8e3c('0xd'),auth['isAuthenticated'](),controller['whoami']);router[_0x8e3c('0x8')](_0x8e3c('0xe'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0xf')]);router[_0x8e3c('0x8')](_0x8e3c('0x10'),auth[_0x8e3c('0x9')](),controller['show']);router[_0x8e3c('0x8')]('/:id/avatar',controller[_0x8e3c('0x11')]);router[_0x8e3c('0x8')]('/:id/open_tabs',auth[_0x8e3c('0x9')](),controller['getOpenTabs']);router['get'](_0x8e3c('0x12'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x13')]);router['get'](_0x8e3c('0x14'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x15')]);router[_0x8e3c('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x8e3c('0x16')]);router['get'](_0x8e3c('0x17'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x18')]);router[_0x8e3c('0x8')]('/:id/recordings',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x19')]);router[_0x8e3c('0x8')](_0x8e3c('0x1a'),auth['isAuthenticated'](),controller[_0x8e3c('0x1b')]);router[_0x8e3c('0x8')]('/:id/chat/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x1c')]);router[_0x8e3c('0x8')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8e3c('0x1d')]);router[_0x8e3c('0x8')]('/:id/mail/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x1e')]);router[_0x8e3c('0x8')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x8e3c('0x1f')]);router[_0x8e3c('0x8')](_0x8e3c('0x20'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x8e3c('0x8')]('/:id/whatsapp/interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x21')]);router[_0x8e3c('0x8')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x23')]);router['get'](_0x8e3c('0x24'),auth['isAuthenticated'](),controller['getLists']);router[_0x8e3c('0x8')](_0x8e3c('0x25'),auth[_0x8e3c('0x9')](),controller['getAgents']);router[_0x8e3c('0x8')](_0x8e3c('0x26'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x27')]);router['get'](_0x8e3c('0x28'),auth[_0x8e3c('0x9')](),controller['getFaxAccounts']);router[_0x8e3c('0x8')](_0x8e3c('0x29'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2a')]);router[_0x8e3c('0x8')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2c')]);router[_0x8e3c('0x8')](_0x8e3c('0x2d'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x2e')]);router[_0x8e3c('0x8')](_0x8e3c('0x2f'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x30')]);router[_0x8e3c('0x8')]('/:id/whatsapp_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x31')]);router[_0x8e3c('0x8')]('/:id/scheduled_calls',auth[_0x8e3c('0x9')](),controller['getScheduledCalls']);router[_0x8e3c('0x8')](_0x8e3c('0x32'),auth['isAuthenticated'](),controller[_0x8e3c('0x33')]);router[_0x8e3c('0x34')](_0x8e3c('0x12'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x35')]);router[_0x8e3c('0x34')]('/',auth[_0x8e3c('0x9')](),controller['create']);router[_0x8e3c('0x34')](_0x8e3c('0x36'),auth['isAuthenticated'](),controller[_0x8e3c('0x37')]);router[_0x8e3c('0x34')](_0x8e3c('0x14'),auth[_0x8e3c('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56b0a7,_0x51fd9e,_0x45c01c){_0x45c01c(null,path['join'](config[_0x8e3c('0x38')],_0x8e3c('0x39')));},'filename':function(_0xa7d8c6,_0x428a81,_0x2c5dbd){_0x2c5dbd(null,util[_0x8e3c('0x3a')]('%s-%s',Date[_0x8e3c('0x3b')](),_0x428a81[_0x8e3c('0x3c')]));}})});router[_0x8e3c('0x34')](_0x8e3c('0x3d'),upload[_0x8e3c('0x3e')](_0x8e3c('0x3f')),controller['addAvatar']);router[_0x8e3c('0x34')]('/:id/login',auth[_0x8e3c('0x9')](),controller['login']);router[_0x8e3c('0x34')](_0x8e3c('0x40'),auth['isAuthenticated'](),controller[_0x8e3c('0x41')]);router[_0x8e3c('0x34')]('/:id/pause',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x42')]);router[_0x8e3c('0x34')](_0x8e3c('0x43'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x44')]);router[_0x8e3c('0x34')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller['addTeams']);router[_0x8e3c('0x34')](_0x8e3c('0x45'),auth['isAuthenticated'](),controller[_0x8e3c('0x46')]);router[_0x8e3c('0x34')](_0x8e3c('0x47'),auth['isAuthenticated'](),controller[_0x8e3c('0x48')]);router[_0x8e3c('0x34')](_0x8e3c('0x49'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4a')]);router['post'](_0x8e3c('0x4b'),auth['isAuthenticated'](),controller[_0x8e3c('0x4c')]);router['post'](_0x8e3c('0x4d'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4e')]);router[_0x8e3c('0x34')]('/:id/whatsapp_interactions',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x4f')]);router[_0x8e3c('0x34')]('/:id/fax_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x50')]);router[_0x8e3c('0x34')](_0x8e3c('0x29'),auth[_0x8e3c('0x9')](),controller['addMailAccounts']);router[_0x8e3c('0x34')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x51')]);router[_0x8e3c('0x34')](_0x8e3c('0x2d'),auth['isAuthenticated'](),controller[_0x8e3c('0x52')]);router[_0x8e3c('0x34')]('/:id/chat_websites',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x53')]);router[_0x8e3c('0x34')](_0x8e3c('0x54'),auth['isAuthenticated'](),controller[_0x8e3c('0x55')]);router['post'](_0x8e3c('0x32'),auth['isAuthenticated'](),controller[_0x8e3c('0x56')]);router['put'](_0x8e3c('0x10'),auth['isAuthenticated'](),controller[_0x8e3c('0x57')]);router[_0x8e3c('0x58')]('/:id/password',auth[_0x8e3c('0x9')](),controller['changePassword']);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0x8e3c('0x59')]);router[_0x8e3c('0x5a')](_0x8e3c('0x22'),auth[_0x8e3c('0x9')](),controller['removeTeams']);router[_0x8e3c('0x5a')](_0x8e3c('0x10'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5b')]);router[_0x8e3c('0x5a')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x47'),auth[_0x8e3c('0x9')](),controller['removeMailInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x49'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5c')]);router[_0x8e3c('0x5a')](_0x8e3c('0x4b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5d')]);router['delete'](_0x8e3c('0x4d'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x8e3c('0x5a')](_0x8e3c('0x5e'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x5f')]);router['delete'](_0x8e3c('0x28'),auth[_0x8e3c('0x9')](),controller['removeFaxAccounts']);router[_0x8e3c('0x5a')](_0x8e3c('0x29'),auth['isAuthenticated'](),controller[_0x8e3c('0x60')]);router[_0x8e3c('0x5a')](_0x8e3c('0x2b'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x61')]);router['delete']('/:id/sms_accounts',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x62')]);router[_0x8e3c('0x5a')]('/:id/chat_websites',auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x63')]);router[_0x8e3c('0x5a')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x8e3c('0x64')]);router[_0x8e3c('0x5a')](_0x8e3c('0x32'),auth[_0x8e3c('0x9')](),controller[_0x8e3c('0x65')]);module[_0x8e3c('0x66')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 6a99196..78a45f4 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 _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x110726,_0x91c0e1){var _0x5c820b=function(_0x4389f4){while(--_0x4389f4){_0x110726['push'](_0x110726['shift']());}};_0x5c820b(++_0x91c0e1);}(_0x70e0,0x17b));var _0x070e=function(_0x17ada2,_0x1bb167){_0x17ada2=_0x17ada2-0x0;var _0x1fc146=_0x70e0[_0x17ada2];return _0x1fc146;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 5de2983..9d89bf0 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 _0x0b0e=['toString','OpenTabs','moment','path','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','register','localhost','sendStatus','status','end','json','undefined','limit','offset','set','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','Agents','Telephones','ignore','value','includes','find','name','then','stack','send','rawAttributes','map','fieldName','type','filter','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','getOptions','where','User','count','include','query','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','catch','show','params','includeAll','true','all','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','106','107','108','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','telephone','UserProfileSection','isEmpty','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','add','capitalize','toLowerCase','penalty','QueueId','Queue:save','VoiceQueue','voice','format','voicePause','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','Queues','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','concat','findOne','Tag','color','tag','getQueues','model','keys','Queue','filters','order','sort','merge','options','Unknown\x20role','nolimit','getVoiceQueuesRt','intersection','fields','pick','hasOwnProperty','getGroups','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','openchannelPause','smsPause','whatsappPause','lastPauseAt','getTeams','User\x20with\x20id\x20%s\x20not\x20found','addTeams','Team','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','getLists','CmList','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$any','firstName','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','whoami','getUserSetting','getPresence','unknown','ringing','teams','queues','inbound','flatten','lower','col','asc','desc','substring','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','select','ui.','field','ui.createdAt','user_has_','ui.UserId\x20=\x20?'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45d80c,_0x35c0ff){_0x45d80c=_0x45d80c-0x0;var _0x449a98=_0x0b0e[_0x45d80c];return _0x449a98;};'use strict';var moment=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe0b0('0x2'));var Redis=require(_0xe0b0('0x3'));var authService=require(_0xe0b0('0x4'));var contacts=require(_0xe0b0('0x5'));var qs=require(_0xe0b0('0x6'));var rta=require(_0xe0b0('0x7'));var logger=require(_0xe0b0('0x8'))(_0xe0b0('0x9'));var utils=require(_0xe0b0('0xa'));var config=require(_0xe0b0('0xb'));var licenseUtil=require(_0xe0b0('0xc'));var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APINotFoundError=require(_0xe0b0('0xd'))[_0xe0b0('0xe')];var APIHandleError=require(_0xe0b0('0xd'))[_0xe0b0('0xf')];var db=require('../../mysqldb')['db'];var socket=require(_0xe0b0('0x10'))(new Redis(config[_0xe0b0('0x11')]));require('./user.socket')[_0xe0b0('0x12')](socket);config[_0xe0b0('0x11')]=_['defaults'](config[_0xe0b0('0x11')],{'host':_0xe0b0('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x39b1c2,_0x585615){_0x585615=_0x585615||0xcc;return function(_0x3068c0){if(_0x3068c0){return _0x39b1c2[_0xe0b0('0x14')](_0x585615);}return _0x39b1c2[_0xe0b0('0x15')](_0x585615)[_0xe0b0('0x16')]();};}function respondWithResult(_0x34fed4,_0x4d2bf7){_0x4d2bf7=_0x4d2bf7||0xc8;return function(_0x3782be){if(_0x3782be){return _0x34fed4[_0xe0b0('0x15')](_0x4d2bf7)[_0xe0b0('0x17')](_0x3782be);}};}function respondWithFilteredResult(_0x24babd,_0x177c24){return function(_0x55d884){if(_0x55d884){var _0x41a7e2=typeof _0x177c24['offset']===_0xe0b0('0x18')&&typeof _0x177c24[_0xe0b0('0x19')]==='undefined';var _0x11fdca=_0x55d884['count'];var _0x2d6fb6=_0x41a7e2?0x0:_0x177c24[_0xe0b0('0x1a')];var _0x56bcc7=_0x41a7e2?_0x55d884['count']:_0x177c24[_0xe0b0('0x1a')]+_0x177c24['limit'];var _0x4df8da;if(_0x56bcc7>=_0x11fdca){_0x56bcc7=_0x11fdca;_0x4df8da=0xc8;}else{_0x4df8da=0xce;}_0x24babd['status'](_0x4df8da);return _0x24babd[_0xe0b0('0x1b')]('Content-Range',_0x2d6fb6+'-'+_0x56bcc7+'/'+_0x11fdca)['json'](_0x55d884);}return null;};}function saveUpdates(_0x10cde1){return function(_0x59dff5){if(_0x59dff5){return _0x59dff5[_0xe0b0('0x1c')](_0x10cde1)['then'](function(_0x2c84cc){if(_0x2c84cc[_0xe0b0('0x1d')]===_0xe0b0('0x1e')){socket[_0xe0b0('0x1f')](_0xe0b0('0x20')+_0x2c84cc['id'],_0x2c84cc);}return _0x2c84cc;});}return null;};}function removeEntity(_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x21')]()['then'](function(){var _0x12b260=_0x4cae54[_0xe0b0('0x22')]({'plain':!![]});if(_0x12b260['role']===_0xe0b0('0x23'))return;var _0x503883=[{'name':_0xe0b0('0x24'),'value':'user','ignore':!![]},{'name':_0xe0b0('0x25'),'value':'agent','ignore':![]},{'name':_0xe0b0('0x26'),'value':'telephone','ignore':![]}];var _0x4700cc=_(_0x503883)['filter'](_0xe0b0('0x27'))['map'](_0xe0b0('0x28'))[_0xe0b0('0x28')]();if(_[_0xe0b0('0x29')](_0x4700cc,_0x12b260[_0xe0b0('0x1d')])){return;}var _0x3ec2=_[_0xe0b0('0x2a')](_0x503883,['value',_0x12b260[_0xe0b0('0x1d')]])[_0xe0b0('0x2b')];return db['UserProfileResource'][_0xe0b0('0x21')]({'where':{'type':_0x3ec2,'resourceId':_0x12b260['id']}})[_0xe0b0('0x2c')](function(){return _0x4cae54;});})[_0xe0b0('0x2c')](function(){_0x58b804[_0xe0b0('0x15')](0xcc)[_0xe0b0('0x16')]();});}};}function handleEntityNotFound(_0x254cad){return function(_0x136bd4){if(!_0x136bd4){_0x254cad['sendStatus'](0x194);}return _0x136bd4;};}function handleError(_0x1854b8,_0x3c0109){_0x3c0109=_0x3c0109||0x1f4;return function(_0x48a9b5){logger['error'](_0x48a9b5[_0xe0b0('0x2d')]);if(_0x48a9b5[_0xe0b0('0x2b')]){delete _0x48a9b5[_0xe0b0('0x2b')];}_0x1854b8[_0xe0b0('0x15')](_0x3c0109)[_0xe0b0('0x2e')](_0x48a9b5);};}function getUserAttributes(){return _(db['User'][_0xe0b0('0x2f')])[_0xe0b0('0x30')](function(_0x7867c4){return{'name':_0x7867c4[_0xe0b0('0x31')],'type':_0x7867c4[_0xe0b0('0x32')]['key']};})[_0xe0b0('0x33')](function(_0x208945){return![_0xe0b0('0x34'),_0xe0b0('0x35'),_0xe0b0('0x36'),_0xe0b0('0x37'),_0xe0b0('0x38'),_0xe0b0('0x39')][_0xe0b0('0x29')](_0x208945[_0xe0b0('0x2b')]);})[_0xe0b0('0x28')]();}exports[_0xe0b0('0x3a')]=function(_0x1d35bc,_0x2a1c44){var _0xca25d={},_0x4cf80c={'count':0x0,'rows':[]};var _0x121608=getUserAttributes();_0xca25d=qs[_0xe0b0('0x3b')](_0x121608,_0x1d35bc);var _0xace58a={'where':_0xca25d[_0xe0b0('0x3c')]};return db[_0xe0b0('0x3d')][_0xe0b0('0x3e')](_0xace58a)[_0xe0b0('0x2c')](function(_0x533fc7){_0x4cf80c['count']=_0x533fc7;if(_0x1d35bc['query']['includeAll']){_0xca25d[_0xe0b0('0x3f')]=[{'all':!![]}];}if(_0x1d35bc[_0xe0b0('0x40')][_0xe0b0('0x41')]==='true'){_0xca25d[_0xe0b0('0x3f')]=[{'model':db[_0xe0b0('0x42')],'as':_0xe0b0('0x41')}];}if(!_[_0xe0b0('0x29')](_0xca25d['attributes'],'id')){_0xca25d[_0xe0b0('0x43')][_0xe0b0('0x44')]('id');}return db[_0xe0b0('0x3d')][_0xe0b0('0x45')](_0xca25d);})[_0xe0b0('0x2c')](function(_0x1205db){_0x4cf80c[_0xe0b0('0x46')]=_0x1205db;if(_0x1d35bc[_0xe0b0('0x40')][_0xe0b0('0x47')]==='true'){var _0x3e349b=[];for(var _0x54f646=0x0;_0x54f646<_0x4cf80c[_0xe0b0('0x46')][_0xe0b0('0x48')];_0x54f646++){_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x49'),_0x4cf80c['rows'][_0x54f646][_0xe0b0('0x4a')]));_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4b'),_0x4cf80c[_0xe0b0('0x46')][_0x54f646][_0xe0b0('0x4a')]));_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4c'),_0x4cf80c[_0xe0b0('0x46')][_0x54f646]['dataValues']));_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4d'),_0x4cf80c['rows'][_0x54f646]['dataValues']));_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4e'),_0x4cf80c['rows'][_0x54f646][_0xe0b0('0x4a')]));_0x3e349b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4f'),_0x4cf80c[_0xe0b0('0x46')][_0x54f646][_0xe0b0('0x4a')]));}return Promise['all'](_0x3e349b)['then'](function(){return _0x4cf80c;});}else{return _0x4cf80c;}})['then'](respondWithFilteredResult(_0x2a1c44,_0xca25d))[_0xe0b0('0x50')](handleError(_0x2a1c44,null));};exports[_0xe0b0('0x51')]=function(_0x5c2f3b,_0x9f7459){var _0x1d897f=getUserAttributes();_0x5c2f3b[_0xe0b0('0x40')]['id']=_0x5c2f3b[_0xe0b0('0x52')]['id'];var _0x16ccca=qs['getOptions'](_0x1d897f,_0x5c2f3b);if(_0x5c2f3b['query'][_0xe0b0('0x53')]){_0x16ccca[_0xe0b0('0x3f')]=[{'all':!![]}];}if(_0x5c2f3b[_0xe0b0('0x40')][_0xe0b0('0x41')]===_0xe0b0('0x54')){_0x16ccca['include']=[{'model':db[_0xe0b0('0x42')],'as':_0xe0b0('0x41')}];}_0x16ccca=_['merge']({},_0x16ccca,_0x5c2f3b['options']);if(!_['includes'](_0x16ccca[_0xe0b0('0x43')],'id')){_0x16ccca[_0xe0b0('0x43')][_0xe0b0('0x44')]('id');}return db[_0xe0b0('0x3d')]['find'](_0x16ccca)[_0xe0b0('0x2c')](handleEntityNotFound(_0x9f7459,null))[_0xe0b0('0x2c')](function(_0x483f12){var _0x58b69c=[];values=_0x483f12;if(_0x5c2f3b[_0xe0b0('0x40')][_0xe0b0('0x47')]==='true'){_0x58b69c[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x49'),_0x483f12['dataValues']));_0x58b69c['push'](get_open_tabs(_0xe0b0('0x4b'),_0x483f12['dataValues']));_0x58b69c[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4e'),_0x483f12[_0xe0b0('0x4a')]));_0x58b69c[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4f'),_0x483f12[_0xe0b0('0x4a')]));_0x58b69c['push'](get_open_tabs('fax',_0x483f12[_0xe0b0('0x4a')]));_0x58b69c['push'](get_open_tabs('mail',_0x483f12[_0xe0b0('0x4a')]));return Promise[_0xe0b0('0x55')](_0x58b69c);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x9f7459,null))[_0xe0b0('0x50')](handleError(_0x9f7459,null));};exports[_0xe0b0('0x1c')]=function(_0x17b09f,_0x4365d1){if(_0x17b09f[_0xe0b0('0x56')]['id']){delete _0x17b09f[_0xe0b0('0x56')]['id'];}delete _0x17b09f[_0xe0b0('0x56')]['role'];return db[_0xe0b0('0x3d')]['find']({'where':{'id':_0x17b09f[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x4365d1,null))['then'](saveUpdates(_0x17b09f[_0xe0b0('0x56')],null))[_0xe0b0('0x2c')](respondWithResult(_0x4365d1,null))[_0xe0b0('0x50')](handleError(_0x4365d1,null));};exports[_0xe0b0('0x57')]=function(_0x3d8013,_0x2a588d){return db[_0xe0b0('0x3d')][_0xe0b0('0x57')]()[_0xe0b0('0x2c')](respondWithResult(_0x2a588d,null))['catch'](handleError(_0x2a588d,null));};exports[_0xe0b0('0x58')]=function(_0x57ccc9,_0x2b5553){return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x57ccc9[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x2b5553,null))[_0xe0b0('0x2c')](function(_0x5ba329){if(_0x5ba329){return _0x5ba329[_0xe0b0('0x58')](_0x57ccc9[_0xe0b0('0x56')][_0xe0b0('0x59')],_[_0xe0b0('0x5a')](_0x57ccc9[_0xe0b0('0x56')],[_0xe0b0('0x59'),'id'])||{});}})[_0xe0b0('0x2c')](respondWithResult(_0x2b5553,null))[_0xe0b0('0x50')](handleError(_0x2b5553,null));};function validateUser(_0x85824c){return new Promise(function(_0xf331df,_0x1eb5d6){if(_0x85824c[_0xe0b0('0x5b')])return _0xf331df(_0x85824c);return db[_0xe0b0('0x5c')][_0xe0b0('0x5d')](0x1)[_0xe0b0('0x2c')](function(_0x34c642){if(_0x34c642[_0xe0b0('0x5e')])authService[_0xe0b0('0x5f')](_0x85824c['password']);db[_0xe0b0('0x3d')][_0xe0b0('0x60')](_0xe0b0('0x5b'))[_0xe0b0('0x2c')](function(_0x3916ab){if(_[_0xe0b0('0x61')](_0x3916ab)){_0x85824c[_0xe0b0('0x5b')]=_0x34c642['min_internal']||0x1;return;}if(_['isNil'](_0x34c642[_0xe0b0('0x62')])||_0x34c642[_0xe0b0('0x62')]===_0x3916ab){_0x85824c[_0xe0b0('0x5b')]=_0x3916ab+0x1;return;}if(_0x34c642['min_internal']>_0x3916ab){_0x85824c[_0xe0b0('0x5b')]=_0x34c642[_0xe0b0('0x62')];return;}return db[_0xe0b0('0x63')][_0xe0b0('0x40')](_0xe0b0('0x64'),{'type':db['sequelize'][_0xe0b0('0x65')][_0xe0b0('0x66')]})[_0xe0b0('0x2c')](function(_0x54b5d6){if(_0x54b5d6&&_0x54b5d6[_0xe0b0('0x48')]){for(var _0x30b3ae=0x0,_0x5aa850=_0x54b5d6[_0xe0b0('0x48')];_0x30b3ae<_0x5aa850&&_['isNil'](_0x85824c['internal']);_0x30b3ae++){if(_0x34c642[_0xe0b0('0x62')]<=_0x54b5d6[_0x30b3ae]['from']){_0x85824c['internal']=_0x54b5d6[_0x30b3ae][_0xe0b0('0x67')];}else if(_0x34c642[_0xe0b0('0x62')]>_0x54b5d6[_0x30b3ae][_0xe0b0('0x67')]&&_0x34c642[_0xe0b0('0x62')]<=_0x54b5d6[_0x30b3ae]['to']){_0x85824c['internal']=_0x34c642[_0xe0b0('0x62')];}}}if(_[_0xe0b0('0x61')](_0x85824c[_0xe0b0('0x5b')])){_0x85824c[_0xe0b0('0x5b')]=_0x3916ab+0x1;}return _0xf331df(_0x85824c);});});})[_0xe0b0('0x50')](function(_0xce497c){_0x1eb5d6(_0xce497c);});});}function updateUser(_0xc5e88c){return new Promise(function(_0x224f1e,_0x514df5){try{if(_0xc5e88c['voicemail']){_0xc5e88c[_0xe0b0('0x68')]=_0xc5e88c[_0xe0b0('0x5b')];_0xc5e88c[_0xe0b0('0x69')]={'mailbox':_0xc5e88c['internal'],'password':_0xc5e88c['password'],'fullname':_0xc5e88c[_0xe0b0('0x6a')],'email':_0xc5e88c[_0xe0b0('0x6b')]};}if(_0xc5e88c['role']==='agent'){if(!_0xc5e88c[_0xe0b0('0x6c')])_0xc5e88c[_0xe0b0('0x6c')]=[_0xe0b0('0x6d'),_0xe0b0('0x6e'),_0xe0b0('0x6f'),_0xe0b0('0x70'),_0xe0b0('0x71'),_0xe0b0('0x72'),'105',_0xe0b0('0x73'),_0xe0b0('0x74'),_0xe0b0('0x75'),'109','100','111','114','115'];}_0x224f1e(_0xc5e88c);}catch(_0x567c06){_0x514df5(_0x567c06);}});}exports[_0xe0b0('0x76')]=function(_0x51b492,_0x52f820){if(_0x51b492[_0xe0b0('0x77')][_0xe0b0('0x1d')]===_0xe0b0('0x1e'))throw new Error(_0xe0b0('0x78'));if(_0x51b492[_0xe0b0('0x56')][_0xe0b0('0x1d')]===_0xe0b0('0x77')&&_0x51b492[_0xe0b0('0x77')]['role']!==_0xe0b0('0x23')){throw new Error(_0xe0b0('0x79'));}if(_0x51b492[_0xe0b0('0x56')][_0xe0b0('0x1d')]===_0xe0b0('0x23')&&_0x51b492[_0xe0b0('0x77')][_0xe0b0('0x1d')]!=='admin'){throw new Error(_0xe0b0('0x7a'));}return licenseUtil['checkUserLimits']([_0x51b492[_0xe0b0('0x56')]])[_0xe0b0('0x2c')](function(){return validateUser(_0x51b492[_0xe0b0('0x56')]);})[_0xe0b0('0x2c')](function(_0x4a78f8){return updateUser(_0x4a78f8)[_0xe0b0('0x2c')](function(_0x429ac3){if(_0x429ac3['role']==='admin'){_0x429ac3[_0xe0b0('0x7b')]=_0x51b492[_0xe0b0('0x77')][_0xe0b0('0x7b')];delete _0x429ac3[_0xe0b0('0x7c')];}return _0x429ac3;});})[_0xe0b0('0x2c')](function(_0x31dd21){return db[_0xe0b0('0x3d')][_0xe0b0('0x76')](_0x31dd21,{'include':[{'model':db[_0xe0b0('0x69')],'as':_0xe0b0('0x69')}]});})['then'](function(_0x4c512b){if(_0x51b492[_0xe0b0('0x56')]['role']==='user')return _0x4c512b;if(_0x51b492['user']['role']!==_0xe0b0('0x77'))return _0x4c512b;return db['UserProfileSection'][_0xe0b0('0x2a')]({'where':{'name':_0x4c512b[_0xe0b0('0x1d')]===_0xe0b0('0x1e')?_0xe0b0('0x25'):'Telephones','userProfileId':_0x51b492[_0xe0b0('0x77')][_0xe0b0('0x7c')]},'raw':!![]})['then'](function(_0x320d29){if(!_0x320d29||_0x320d29[_0xe0b0('0x7d')]!=0x0)return _0x4c512b;return db[_0xe0b0('0x7e')][_0xe0b0('0x76')]({'name':_0x4c512b[_0xe0b0('0x2b')],'resourceId':_0x4c512b['id'],'type':_0x320d29['name'],'sectionId':_0x320d29['id']},{})['then'](function(){return _0x4c512b;});})['catch'](function(_0x545694){logger['error'](_0xe0b0('0x7f'),_0x545694);throw _0x545694;});})['then'](respondWithResult(_0x52f820,0xc9))[_0xe0b0('0x50')](handleError(_0x52f820,null));};exports['bulkCreate']=function(_0x2e7899,_0x5c85d6){var _0x92da26=_0x2e7899[_0xe0b0('0x56')];var _0x199929=[];if(_0x2e7899[_0xe0b0('0x77')]['role']==='agent')throw new Error('Unauthorized');if(_['some'](_0x92da26,[_0xe0b0('0x1d'),_0xe0b0('0x77')])&&_0x2e7899[_0xe0b0('0x77')][_0xe0b0('0x1d')]!==_0xe0b0('0x23')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xe0b0('0x80')](_0x92da26,[_0xe0b0('0x1d'),_0xe0b0('0x23')])&&_0x2e7899[_0xe0b0('0x77')][_0xe0b0('0x1d')]!==_0xe0b0('0x23')){throw new Error(_0xe0b0('0x81'));}return licenseUtil[_0xe0b0('0x82')](_0x92da26)[_0xe0b0('0x2c')](function(){return validateUser(_0x92da26[0x0]);})['then'](function(){for(var _0x589c47=0x1;_0x589c47<_0x92da26[_0xe0b0('0x48')];_0x589c47++){var _0x1f15e4=_0x92da26[_0x589c47-0x1]['internal'];if(!_0x92da26[_0x589c47][_0xe0b0('0x5b')])_0x92da26[_0x589c47][_0xe0b0('0x5b')]=_0x1f15e4+0x1;_0x199929[_0xe0b0('0x44')](validateUser(_0x92da26[_0x589c47]));}return Promise[_0xe0b0('0x55')](_0x199929);})[_0xe0b0('0x2c')](function(){_0x199929=[];for(var _0x2cd7ab=0x0;_0x2cd7ab<_0x92da26[_0xe0b0('0x48')];_0x2cd7ab++){_0x199929[_0xe0b0('0x44')](updateUser(_0x92da26[_0x2cd7ab]));}return Promise['all'](_0x199929);})['then'](function(){_0x199929=_0x92da26['map'](function(_0xc19743){return db[_0xe0b0('0x3d')]['create'](_0xc19743,{'include':[{'model':db[_0xe0b0('0x69')],'as':_0xe0b0('0x69')}]})[_0xe0b0('0x2c')](function(_0x328832){_0xc19743['id']=_0x328832['id'];return _0xc19743;});});return Promise['all'](_0x199929);})['then'](function(_0x4e1fb1){if(_0x2e7899[_0xe0b0('0x56')][_0xe0b0('0x1d')]==='user')return _0x4e1fb1;if(_0x2e7899[_0xe0b0('0x77')][_0xe0b0('0x1d')]!=='user')return _0x4e1fb1;var _0x576482=_[_0xe0b0('0x80')](_0x4e1fb1,function(_0x554181){return _0x554181[_0xe0b0('0x1d')]==='agent'||_0x554181[_0xe0b0('0x1d')]===_0xe0b0('0x83');});if(!_0x576482)return _0x4e1fb1;return db[_0xe0b0('0x84')][_0xe0b0('0x45')]({'where':{'name':{'$or':[_0xe0b0('0x25'),_0xe0b0('0x26')]},'userProfileId':_0x2e7899[_0xe0b0('0x77')][_0xe0b0('0x7c')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x48497e){if(_[_0xe0b0('0x85')](_0x48497e)||!_[_0xe0b0('0x80')](_0x48497e,[_0xe0b0('0x7d'),0x0]))return _0x4e1fb1;_0x199929=[];var _0x4e19f4=_(_0x48497e)[_0xe0b0('0x30')](function(_0x4ad24f){if(_0x4ad24f[_0xe0b0('0x7d')]===0x1)return;return _0x4ad24f[_0xe0b0('0x2b')]==='Agents'?_0xe0b0('0x1e'):'telephone';})['compact']()[_0xe0b0('0x28')]();for(var _0x54b57a=0x0;_0x54b57a<_0x4e1fb1['length'];_0x54b57a++){if(!_[_0xe0b0('0x29')](_0x4e19f4,_0x4e1fb1[_0x54b57a][_0xe0b0('0x1d')]))return;var _0x238979=_0x4e1fb1[_0x54b57a][_0xe0b0('0x1d')]===_0xe0b0('0x1e')?_0xe0b0('0x25'):'Telephones';_0x199929[_0xe0b0('0x44')](db[_0xe0b0('0x7e')][_0xe0b0('0x76')]({'name':_0x4e1fb1[_0x54b57a]['name'],'resourceId':_0x4e1fb1[_0x54b57a]['id'],'type':_0x238979,'sectionId':_[_0xe0b0('0x2a')](_0x48497e,[_0xe0b0('0x2b'),_0x238979])['id']},{}));}return Promise['all'](_0x199929);});})['then'](respondWithResult(_0x5c85d6,0xc9))[_0xe0b0('0x50')](handleError(_0x5c85d6,null));};exports['changePassword']=function(_0x46ab89,_0xadc32){if(_0x46ab89[_0xe0b0('0x56')]['id']){delete _0x46ab89[_0xe0b0('0x56')]['id'];}return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x46ab89[_0xe0b0('0x52')]['id']}})['then'](function(_0x355edf){if(!_0x355edf)return null;if(_0x355edf['id']===_0x46ab89[_0xe0b0('0x77')]['id']){if(!_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x86')]||!_0x46ab89[_0xe0b0('0x56')]['newPassword']){throw new db['Sequelize'][(_0xe0b0('0x87'))](_0xe0b0('0x88'));}if(!_0x355edf[_0xe0b0('0x89')](_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x86')])){throw new db[(_0xe0b0('0x8a'))][(_0xe0b0('0x87'))](_0xe0b0('0x8b'));}if(_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x86')]===_0x46ab89['body'][_0xe0b0('0x8c')]){throw new db[(_0xe0b0('0x8a'))][(_0xe0b0('0x87'))](_0xe0b0('0x8d'));}}else if(_0x46ab89['user'][_0xe0b0('0x1d')]===_0xe0b0('0x23')){if(!_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')]){throw new db[(_0xe0b0('0x8a'))]['ValidationError'](_0xe0b0('0x8e'));}}else if(_0x46ab89['user'][_0xe0b0('0x1d')]===_0xe0b0('0x77')){if(!_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')]){throw new db[(_0xe0b0('0x8a'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x355edf[_0xe0b0('0x1d')]!=='agent'){throw new db[(_0xe0b0('0x8a'))]['ValidationError'](_0xe0b0('0x78'));}}else{throw new db[(_0xe0b0('0x8a'))][(_0xe0b0('0x87'))](_0xe0b0('0x78'));}return _0x355edf;})[_0xe0b0('0x2c')](handleEntityNotFound(_0xadc32,null))[_0xe0b0('0x2c')](function(_0x43ff30){return db['Setting']['findOne']({'attributes':['id',_0xe0b0('0x5e'),_0xe0b0('0x8f'),_0xe0b0('0x90')]})[_0xe0b0('0x2c')](function(_0xd83992){if(_0xd83992[_0xe0b0('0x5e')])authService[_0xe0b0('0x5f')](_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')]);if(!_0xd83992[_0xe0b0('0x8f')]||!_0x43ff30['previousPasswords'])return _0x43ff30;authService['validatePasswordHistory'](_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')],_0x43ff30[_0xe0b0('0x36')],_0xd83992[_0xe0b0('0x90')]);return _0x43ff30;})[_0xe0b0('0x2c')](saveUpdates({'password':_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')],'passwordResetAt':_0x46ab89['user']['id']==_0x46ab89['params']['id']?moment():null,'previousPasswords':authService[_0xe0b0('0x91')](_0x46ab89[_0xe0b0('0x56')][_0xe0b0('0x8c')],_0x43ff30[_0xe0b0('0x36')])},null));})[_0xe0b0('0x2c')](respondWithResult(_0xadc32,null))[_0xe0b0('0x50')](handleError(_0xadc32,null));};exports[_0xe0b0('0x92')]=function(_0x26948c,_0x6ef3b2){var _0x1d1430=_0x26948c['body'][_0xe0b0('0x93')];return db[_0xe0b0('0x3d')]['find']({'where':{'id':_0x26948c[_0xe0b0('0x52')]['id']},'attributes':['id',_0xe0b0('0x2b'),_0xe0b0('0x1d'),_0xe0b0('0x94'),_0xe0b0('0x95'),'voicePause',_0xe0b0('0x96')]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x6ef3b2,null))[_0xe0b0('0x2c')](function(_0x333697){if(_0x333697){if(!utils[_0xe0b0('0x97')](_0x1d1430)){throw new db['Sequelize'][(_0xe0b0('0x87'))]('Unknown\x20channel');}return _0x333697[_0xe0b0('0x98')+_[_0xe0b0('0x99')](_0x1d1430[_0xe0b0('0x9a')]())+'Queues'](_0x26948c['body'][_0xe0b0('0x59')],{'penalty':_0x26948c[_0xe0b0('0x56')][_0xe0b0('0x9b')]||0x0})['spread'](function(_0x4d372a){for(var _0x5da5eb=0x0;_0x5da5eb<_0x26948c['body']['ids']['length'];_0x5da5eb+=0x1){var _0x3474ab={'UserId':Number(_0x26948c[_0xe0b0('0x52')]['id'])};_0x3474ab[_['capitalize'](_0x1d1430[_0xe0b0('0x9a')]())+_0xe0b0('0x9c')]=Number(_0x26948c[_0xe0b0('0x56')][_0xe0b0('0x59')][_0x5da5eb]);socket[_0xe0b0('0x1f')]('user'+_['capitalize'](_0x1d1430[_0xe0b0('0x9a')]())+_0xe0b0('0x9d'),_0x3474ab);}return _0x4d372a;})[_0xe0b0('0x2c')](function(){if(_0x1d1430==='voice'){return db[_0xe0b0('0x9e')][_0xe0b0('0x45')]({'where':{'id':_0x26948c[_0xe0b0('0x56')][_0xe0b0('0x59')]||[]},'raw':!![],'attributes':['id',_0xe0b0('0x2b')]});}})[_0xe0b0('0x2c')](function(_0x51b616){var _0x581848=_0x333697['get']({'plain':!![]});var _0x1ce027=[];if(_0x1d1430===_0xe0b0('0x9f')&&_0x581848[_0xe0b0('0x1d')]===_0xe0b0('0x1e')&&_0x581848[_0xe0b0('0x94')]){for(let _0x37f8ba=0x0;_0x37f8ba<_0x51b616[_0xe0b0('0x48')];_0x37f8ba+=0x1){_0x1ce027[_0xe0b0('0x44')]({'membername':_0x581848['name'],'UserId':_0x581848['id'],'queue_name':_0x51b616[_0x37f8ba]['name'],'VoiceQueueId':_0x51b616[_0x37f8ba]['id'],'interface':_[_0xe0b0('0x61')](_0x581848[_0xe0b0('0x96')])?util[_0xe0b0('0xa0')]('SIP/%s',_0x581848[_0xe0b0('0x2b')]):_0x581848[_0xe0b0('0x96')],'paused':_0x581848[_0xe0b0('0xa1')]||![],'penalty':_0x26948c['body'][_0xe0b0('0x9b')]||0x0});}return Promise['all'](_0x1ce027[_0xe0b0('0x30')](function(_0x4e34b5){return db[_0xe0b0('0xa2')][_0xe0b0('0xa3')](_0x4e34b5);}));}return _0x333697;});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x6ef3b2,null))[_0xe0b0('0x50')](handleError(_0x6ef3b2,null));};exports[_0xe0b0('0xa4')]=function(_0x55beb2,_0x287af5){var _0xb71713,_0x47eba2;return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x55beb2[_0xe0b0('0x52')]['id']},'attributes':['id','name',_0xe0b0('0x1d')]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x287af5,null))[_0xe0b0('0x2c')](function(_0x566a6e){if(_0x566a6e){_0xb71713=_0x566a6e;if(!_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')]||!utils[_0xe0b0('0x97')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')])){throw new db[(_0xe0b0('0x8a'))]['ValidationError'](_0xe0b0('0xa5'));}return _0x566a6e[_0xe0b0('0xa6')+_[_0xe0b0('0x99')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')][_0xe0b0('0x9a')]())+_0xe0b0('0xa7')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x59')]);}})[_0xe0b0('0x2c')](function(_0xde3bca){if(_['isArray'](_0x55beb2[_0xe0b0('0x40')]['ids'])){for(var _0x56c497=0x0;_0x56c497<_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x59')]['length'];_0x56c497+=0x1){_0x47eba2={'UserId':Number(_0x55beb2[_0xe0b0('0x52')]['id'])};_0x47eba2[_[_0xe0b0('0x99')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')][_0xe0b0('0x9a')]())+_0xe0b0('0x9c')]=Number(_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x59')][_0x56c497]);socket[_0xe0b0('0x1f')]('user'+_[_0xe0b0('0x99')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')][_0xe0b0('0x9a')]())+'Queue:remove',_0x47eba2);}}else{_0x47eba2={'UserId':Number(_0x55beb2['params']['id'])};_0x47eba2[_[_0xe0b0('0x99')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')][_0xe0b0('0x9a')]())+_0xe0b0('0x9c')]=Number(_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x59')]);socket[_0xe0b0('0x1f')](_0xe0b0('0x77')+_[_0xe0b0('0x99')](_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')][_0xe0b0('0x9a')]())+_0xe0b0('0xa8'),_0x47eba2);}return _0xde3bca;})[_0xe0b0('0x2c')](function(){if(_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x93')]===_0xe0b0('0x9f')){return db[_0xe0b0('0xa2')]['destroy']({'where':{'UserId':_0x55beb2[_0xe0b0('0x52')]['id'],'VoiceQueueId':_0x55beb2[_0xe0b0('0x40')][_0xe0b0('0x59')]},'individualHooks':!![]})['then'](function(){return _0xb71713;});}return _0xb71713;})[_0xe0b0('0x2c')](respondWithStatusCode(_0x287af5,null))[_0xe0b0('0x50')](handleError(_0x287af5,null));};exports[_0xe0b0('0xa9')]=function(_0x35a4c1,_0x1f9062){_0x35a4c1[_0xe0b0('0x56')][_0xe0b0('0xaa')]=_0x35a4c1['file'][_0xe0b0('0xab')];return db['User'][_0xe0b0('0x2a')]({'where':{'id':_0x35a4c1['params']['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x1f9062,null))[_0xe0b0('0x2c')](saveUpdates(_0x35a4c1['body'],null))[_0xe0b0('0x2c')](respondWithResult(_0x1f9062,null))['catch'](handleError(_0x1f9062,null));};exports[_0xe0b0('0xac')]=function(_0x3f147f,_0x576ae1){var _0x2dbf2e=path[_0xe0b0('0xad')](config[_0xe0b0('0xae')],_0xe0b0('0xaf'));return db[_0xe0b0('0x3d')]['find']({'where':{'id':_0x3f147f[_0xe0b0('0x52')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x576ae1,null))[_0xe0b0('0x2c')](function(_0x1bada0){if(_0x1bada0){if(_[_0xe0b0('0x61')](_0x1bada0['userpic'])){return _0x576ae1['download'](_0x2dbf2e);}else{if(!fs[_0xe0b0('0xb0')](path[_0xe0b0('0xad')](config['root'],_0xe0b0('0xb1'),_0x1bada0[_0xe0b0('0xaa')]))){return _0x576ae1[_0xe0b0('0xb2')](_0x2dbf2e);}return _0x576ae1[_0xe0b0('0xb2')](path[_0xe0b0('0xad')](config[_0xe0b0('0xae')],_0xe0b0('0xb1'),_0x1bada0[_0xe0b0('0xaa')]));}}})[_0xe0b0('0x50')](handleError(_0x576ae1,null));};exports['getOpenTabs']=function(_0x569400,_0x339338){return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x569400[_0xe0b0('0x52')]['id']},'attributes':['id']})[_0xe0b0('0x2c')](handleEntityNotFound(_0x339338,null))[_0xe0b0('0x2c')](function(_0x54f90a){var _0x1aa40b=[];values=_0x54f90a[_0xe0b0('0x4a')];_0x1aa40b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x49'),_0x54f90a[_0xe0b0('0x4a')]));_0x1aa40b['push'](get_open_tabs(_0xe0b0('0x4b'),_0x54f90a[_0xe0b0('0x4a')]));_0x1aa40b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4e'),_0x54f90a[_0xe0b0('0x4a')]));_0x1aa40b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4f'),_0x54f90a[_0xe0b0('0x4a')]));_0x1aa40b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4c'),_0x54f90a['dataValues']));_0x1aa40b[_0xe0b0('0x44')](get_open_tabs(_0xe0b0('0x4d'),_0x54f90a['dataValues']));return Promise[_0xe0b0('0x55')](_0x1aa40b);})['then'](function(_0x1a8821){if(_0x1a8821){var _0x227c56=_['map'](values[_0xe0b0('0xb3')],function(_0x1fcb1b){return{'channel':_0xe0b0('0xb4'),'id':_0x1fcb1b['id'],'createdAt':_0x1fcb1b[_0xe0b0('0xb5')]};});var _0x173ecd=_[_0xe0b0('0x30')](values[_0xe0b0('0xb6')],function(_0x498fa4){return{'channel':'FAX','id':_0x498fa4['id'],'createdAt':_0x498fa4[_0xe0b0('0xb5')]};});var _0x60e00c=_[_0xe0b0('0x30')](values['OpenchannelOpenTabs'],function(_0x6b66e1){return{'channel':_0xe0b0('0xb7'),'id':_0x6b66e1['id'],'createdAt':_0x6b66e1[_0xe0b0('0xb5')]};});var _0x3c0c1b=_[_0xe0b0('0x30')](values[_0xe0b0('0xb8')],function(_0x16cc85){return{'channel':_0xe0b0('0xb9'),'id':_0x16cc85['id'],'createdAt':_0x16cc85[_0xe0b0('0xb5')]};});var _0x3e71a7=_['map'](values['SmsOpenTabs'],function(_0x29d244){return{'channel':_0xe0b0('0xba'),'id':_0x29d244['id'],'createdAt':_0x29d244[_0xe0b0('0xb5')]};});var _0x3c93c6=_[_0xe0b0('0x30')](values[_0xe0b0('0xbb')],function(_0x1c9d1a){return{'channel':'WHATSAPP','id':_0x1c9d1a['id'],'createdAt':_0x1c9d1a[_0xe0b0('0xb5')]};});var _0x2e7fe2=_[_0xe0b0('0xbc')](_0x227c56,_0x173ecd,_0x60e00c,_0x3c0c1b,_0x3e71a7,_0x3c93c6);var _0x5c1375={'count':_0x2e7fe2[_0xe0b0('0x48')],'rows':_0x2e7fe2};return _0x5c1375;}else return null;})[_0xe0b0('0x2c')](respondWithResult(_0x339338,null))['catch'](handleError(_0x339338,null));};exports['getContacts']=function(_0x3b3473,_0x4e7d66){var _0x7eef44={};return db['User'][_0xe0b0('0xbd')]({'where':{'id':_0x3b3473[_0xe0b0('0x52')]['id']}})['then'](function(_0x139ac6){if(!_0x139ac6){throw new APINotFoundError(util[_0xe0b0('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3b3473[_0xe0b0('0x52')]['id']));}return contacts['describe']();})[_0xe0b0('0x2c')](function(_0xae5270){_0x3b3473[_0xe0b0('0x40')][_0xe0b0('0x3d')]=_0x3b3473[_0xe0b0('0x52')]['id'];_0x7eef44=qs[_0xe0b0('0x3b')](_0xae5270,_0x3b3473);if(_0x3b3473[_0xe0b0('0x40')]['hasOwnProperty'](_0xe0b0('0x53'))){_0x7eef44[_0xe0b0('0x3f')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xe0b0('0xbe')],'as':'Tags','attributes':['id',_0xe0b0('0x2b'),_0xe0b0('0xbf')],'where':_0x3b3473[_0xe0b0('0x40')][_0xe0b0('0xc0')]?{'id':_0x3b3473[_0xe0b0('0x40')][_0xe0b0('0xc0')]}:undefined,'required':_0x3b3473[_0xe0b0('0x40')][_0xe0b0('0xc0')]?!![]:![]}];}return contacts[_0xe0b0('0x45')](_0x3b3473[_0xe0b0('0x40')],_0x3b3473[_0xe0b0('0x77')],_0x7eef44,_0xae5270);})[_0xe0b0('0x2c')](respondWithFilteredResult(_0x4e7d66,_0x7eef44))[_0xe0b0('0x50')](APIHandleError(_0x4e7d66));};exports[_0xe0b0('0xc1')]=function(_0x54917d,_0x180b6c){var _0x110402;var _0x2cd15d={};var _0x3e82b4;return db[_0xe0b0('0x3d')]['findOne']({'where':{'id':_0x54917d[_0xe0b0('0x52')]['id']},'attributes':['id',_0xe0b0('0x2b'),_0xe0b0('0x1d')]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x180b6c,null))[_0xe0b0('0x2c')](function(_0x36ff35){if(!utils['isValidChannel'](_0x54917d[_0xe0b0('0x40')]['channel'])){throw new db[(_0xe0b0('0x8a'))][(_0xe0b0('0x87'))](_0xe0b0('0xa5'));}_0x110402=_0x36ff35;var _0x2db075={};_0x2db075[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_['capitalize'](_0x54917d[_0xe0b0('0x40')][_0xe0b0('0x93')])+_0xe0b0('0xc4')][_0xe0b0('0x2f')]);_0x2db075[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x54917d[_0xe0b0('0x40')]);_0x2db075[_0xe0b0('0xc5')]=_['intersection'](_0x2db075['model'],_0x2db075[_0xe0b0('0x40')]);_0x2cd15d['attributes']=_['intersection'](_0x2db075['model'],qs['fields'](_0x54917d[_0xe0b0('0x40')]['fields']));_0x2cd15d['attributes']=_0x2cd15d[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x2cd15d[_0xe0b0('0x43')]:_0x2db075[_0xe0b0('0xc2')];_0x2cd15d[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x54917d[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x2cd15d[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_['pick'](_0x54917d['query'],_0x2db075[_0xe0b0('0xc5')]));if(_0x54917d[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x2cd15d['where']=_['merge'](_0x2cd15d[_0xe0b0('0x3c')],{'$or':_['map'](_0x2cd15d[_0xe0b0('0x43')],function(_0x10ca7a){var _0x59cd8e={};_0x59cd8e[_0x10ca7a]={'$like':'%'+_0x54917d[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x59cd8e;})});}_0x2cd15d=_[_0xe0b0('0xc8')]({},_0x2cd15d,_0x54917d[_0xe0b0('0xc9')]);switch(_0x110402[_0xe0b0('0x1d')]){case _0xe0b0('0x23'):return db[_[_0xe0b0('0x99')](_0x54917d['query'][_0xe0b0('0x93')])+_0xe0b0('0xc4')][_0xe0b0('0x45')](_0x2cd15d);case _0xe0b0('0x77'):case _0xe0b0('0x1e'):return _0x110402['get'+_['capitalize'](_0x54917d[_0xe0b0('0x40')]['channel'])+'Queues'](_0x2cd15d);default:throw new db[(_0xe0b0('0x8a'))]['ValidationError'](_0xe0b0('0xca'));}})[_0xe0b0('0x2c')](function(_0x330ed5){_0x3e82b4=_0x330ed5[_0xe0b0('0x48')];if(!_0x54917d['query']['hasOwnProperty'](_0xe0b0('0xcb'))){_0x2cd15d[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x54917d[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x2cd15d[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x54917d[_0xe0b0('0x40')]['offset']);}switch(_0x110402[_0xe0b0('0x1d')]){case _0xe0b0('0x23'):return db[_[_0xe0b0('0x99')](_0x54917d['query'][_0xe0b0('0x93')])+_0xe0b0('0xc4')][_0xe0b0('0x45')](_0x2cd15d);case _0xe0b0('0x77'):case _0xe0b0('0x1e'):return _0x110402[_0xe0b0('0x22')+_['capitalize'](_0x54917d[_0xe0b0('0x40')][_0xe0b0('0x93')])+_0xe0b0('0xa7')](_0x2cd15d);}})['then'](function(_0x3ee5cb){return{'count':_0x3e82b4,'rows':_0x3ee5cb};})[_0xe0b0('0x2c')](respondWithResult(_0x180b6c,null))[_0xe0b0('0x50')](handleError(_0x180b6c,null));};exports[_0xe0b0('0xcc')]=function(_0x544e70,_0x321fd8){var _0x3b412d={};var _0x431337={};var _0x37cc0f;var _0x120857;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x544e70[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x321fd8,null))[_0xe0b0('0x2c')](function(_0x52f778){if(_0x52f778){_0x37cc0f=_0x52f778;_0x431337['model']=_[_0xe0b0('0xc3')](db[_0xe0b0('0xa2')][_0xe0b0('0x2f')]);_0x431337['query']=_[_0xe0b0('0xc3')](_0x544e70['query']);_0x431337[_0xe0b0('0xc5')]=_['intersection'](_0x431337['model'],_0x431337['query']);_0x3b412d[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x431337['model'],qs[_0xe0b0('0xce')](_0x544e70['query']['fields']));_0x3b412d[_0xe0b0('0x43')]=_0x3b412d['attributes'][_0xe0b0('0x48')]?_0x3b412d[_0xe0b0('0x43')]:_0x431337[_0xe0b0('0xc2')];_0x3b412d[_0xe0b0('0xc6')]=qs['sort'](_0x544e70[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x3b412d[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x544e70['query'],_0x431337[_0xe0b0('0xc5')]));if(_0x544e70[_0xe0b0('0x40')]['filter']){_0x3b412d[_0xe0b0('0x3c')]=_['merge'](_0x3b412d[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x3b412d[_0xe0b0('0x43')],function(_0x42ab7f){var _0x2cc882={};_0x2cc882[_0x42ab7f]={'$like':'%'+_0x544e70[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x2cc882;})});}_0x3b412d=_['merge']({},_0x3b412d,_0x544e70['options']);return _0x37cc0f[_0xe0b0('0xcc')](_0x3b412d);}})['then'](function(_0x38dd79){if(_0x38dd79){_0x120857=_0x38dd79[_0xe0b0('0x48')];if(!_0x544e70[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x3b412d[_0xe0b0('0x19')]=qs['limit'](_0x544e70['query'][_0xe0b0('0x19')]);_0x3b412d[_0xe0b0('0x1a')]=qs['offset'](_0x544e70[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x37cc0f['getVoiceQueuesRt'](_0x3b412d);}})[_0xe0b0('0x2c')](function(_0xa2ecf3){if(_0xa2ecf3){return _0xa2ecf3?{'count':_0x120857,'rows':_0xa2ecf3}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x321fd8,null))['catch'](handleError(_0x321fd8,null));};exports[_0xe0b0('0xd1')]=function(_0x455232,_0x13662d){var _0x24d9ee={};var _0x57e90f={};var _0x344939;var _0x4bc1f5;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x455232[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x13662d,null))[_0xe0b0('0x2c')](function(_0x36ee8c){if(_0x36ee8c){_0x344939=_0x36ee8c;_0x57e90f[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db['ChatGroup'][_0xe0b0('0x2f')]);_0x57e90f[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x455232[_0xe0b0('0x40')]);_0x57e90f[_0xe0b0('0xc5')]=_[_0xe0b0('0xcd')](_0x57e90f['model'],_0x57e90f['query']);_0x24d9ee['attributes']=_[_0xe0b0('0xcd')](_0x57e90f['model'],qs[_0xe0b0('0xce')](_0x455232['query']['fields']));_0x24d9ee[_0xe0b0('0x43')]=_0x24d9ee[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x24d9ee[_0xe0b0('0x43')]:_0x57e90f[_0xe0b0('0xc2')];_0x24d9ee[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x455232['query'][_0xe0b0('0xc7')]);_0x24d9ee[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x455232[_0xe0b0('0x40')],_0x57e90f[_0xe0b0('0xc5')]));if(_0x455232['query']['filter']){_0x24d9ee[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x24d9ee[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x24d9ee[_0xe0b0('0x43')],function(_0x466e7e){var _0x354163={};_0x354163[_0x466e7e]={'$like':'%'+_0x455232['query']['filter']+'%'};return _0x354163;})});}_0x24d9ee=_[_0xe0b0('0xc8')]({},_0x24d9ee,_0x455232[_0xe0b0('0xc9')]);return _0x344939[_0xe0b0('0xd1')](_0x24d9ee);}})['then'](function(_0x484132){if(_0x484132){_0x4bc1f5=_0x484132[_0xe0b0('0x48')];if(!_0x455232[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x24d9ee[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x455232[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x24d9ee[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x455232['query'][_0xe0b0('0x1a')]);}return _0x344939['getGroups'](_0x24d9ee);}})[_0xe0b0('0x2c')](function(_0x4d7048){if(_0x4d7048){return _0x4d7048?{'count':_0x4bc1f5,'rows':_0x4d7048}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x13662d,null))[_0xe0b0('0x50')](handleError(_0x13662d,null));};exports['getRecordings']=function(_0x236966,_0x41fd0e){var _0x17e7d4={'raw':!![],'where':{}};var _0x526e09={};var _0x172318={'count':0x0,'rows':[]};return db[_0xe0b0('0x3d')]['findOne']({'where':{'id':_0x236966[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x41fd0e,null))['then'](function(_0x5998ee){if(_0x5998ee){_0x526e09[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db['VoiceRecording']['rawAttributes']);_0x526e09[_0xe0b0('0x40')]=_['keys'](_0x236966[_0xe0b0('0x40')]);_0x526e09[_0xe0b0('0xc5')]=_[_0xe0b0('0xcd')](_0x526e09[_0xe0b0('0xc2')],_0x526e09[_0xe0b0('0x40')]);_0x17e7d4[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x526e09['model'],qs[_0xe0b0('0xce')](_0x236966['query']['fields']));_0x17e7d4['attributes']=_0x17e7d4[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x17e7d4[_0xe0b0('0x43')]:_0x526e09[_0xe0b0('0xc2')];if(!_0x236966[_0xe0b0('0x40')]['hasOwnProperty']('nolimit')){_0x17e7d4['limit']=qs['limit'](_0x236966[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x17e7d4[_0xe0b0('0x1a')]=qs['offset'](_0x236966[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}_0x17e7d4[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x236966[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x17e7d4[_0xe0b0('0x3c')]=qs['filters'](_[_0xe0b0('0xcf')](_0x236966[_0xe0b0('0x40')],_0x526e09[_0xe0b0('0xc5')]));_0x17e7d4[_0xe0b0('0x3c')]['UserId']=_0x5998ee['id'];if(_0x236966[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x17e7d4[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x17e7d4['where'],{'$or':_['map'](_0x17e7d4[_0xe0b0('0x43')],function(_0x3791d1){var _0x26bd6c={};_0x26bd6c[_0x3791d1]={'$like':'%'+_0x236966[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x26bd6c;})});}_0x17e7d4=_[_0xe0b0('0xc8')]({},_0x17e7d4,_0x236966['options']);return db[_0xe0b0('0xd2')][_0xe0b0('0x3e')]({'where':_0x17e7d4[_0xe0b0('0x3c')]})[_0xe0b0('0x2c')](function(_0x37507f){_0x172318['count']=_0x37507f;if(_0x236966[_0xe0b0('0x40')][_0xe0b0('0x53')]){_0x17e7d4['include']=[{'all':!![]}];}return db[_0xe0b0('0xd2')]['findAll'](_0x17e7d4);})['then'](function(_0x2c9cb8){_0x172318['rows']=_0x2c9cb8;return _0x172318;});}})['then'](respondWithFilteredResult(_0x41fd0e,_0x17e7d4))['catch'](handleError(_0x41fd0e,null));};exports[_0xe0b0('0xd3')]=function(_0x2bb82e,_0x573ca9){var _0x46d5ee={'raw':!![],'where':{}};var _0x593c19={};var _0x3977ab={'count':0x0,'rows':[]};return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x2bb82e[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x573ca9,null))['then'](function(_0x4d201f){if(_0x4d201f){_0x593c19[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db['ScreenRecording']['rawAttributes']);_0x593c19[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x2bb82e[_0xe0b0('0x40')]);_0x593c19[_0xe0b0('0xc5')]=_['intersection'](_0x593c19['model'],_0x593c19[_0xe0b0('0x40')]);_0x46d5ee[_0xe0b0('0x43')]=_['intersection'](_0x593c19[_0xe0b0('0xc2')],qs[_0xe0b0('0xce')](_0x2bb82e['query']['fields']));_0x46d5ee['attributes']=_0x46d5ee[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x46d5ee['attributes']:_0x593c19[_0xe0b0('0xc2')];if(!_0x2bb82e[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x46d5ee['limit']=qs[_0xe0b0('0x19')](_0x2bb82e[_0xe0b0('0x40')]['limit']);_0x46d5ee['offset']=qs['offset'](_0x2bb82e[_0xe0b0('0x40')]['offset']);}_0x46d5ee[_0xe0b0('0xc6')]=qs['sort'](_0x2bb82e['query'][_0xe0b0('0xc7')]);_0x46d5ee[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x2bb82e['query'],_0x593c19['filters']));_0x46d5ee['where']['UserId']=_0x4d201f['id'];if(_0x2bb82e[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x46d5ee[_0xe0b0('0x3c')]=_['merge'](_0x46d5ee[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x46d5ee['attributes'],function(_0x398c2b){var _0x323879={};_0x323879[_0x398c2b]={'$like':'%'+_0x2bb82e[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x323879;})});}_0x46d5ee=_['merge']({},_0x46d5ee,_0x2bb82e[_0xe0b0('0xc9')]);return db[_0xe0b0('0xd4')][_0xe0b0('0x3e')]({'where':_0x46d5ee['where']})[_0xe0b0('0x2c')](function(_0xd725d0){_0x3977ab[_0xe0b0('0x3e')]=_0xd725d0;if(_0x2bb82e[_0xe0b0('0x40')]['includeAll']){_0x46d5ee[_0xe0b0('0x3f')]=[{'all':!![]}];}return db[_0xe0b0('0xd4')][_0xe0b0('0x45')](_0x46d5ee);})[_0xe0b0('0x2c')](function(_0x3323c2){_0x3977ab['rows']=_0x3323c2;return _0x3977ab;});}})[_0xe0b0('0x2c')](respondWithFilteredResult(_0x573ca9,_0x46d5ee))[_0xe0b0('0x50')](handleError(_0x573ca9,null));};exports['getChatInteractions']=function(_0xb263f6,_0x77aaed){var _0x1cd51c={};var _0x221d6f={};var _0x1ffc75;var _0x3a39d7;return db['User'][_0xe0b0('0xbd')]({'where':{'id':_0xb263f6[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x77aaed,null))[_0xe0b0('0x2c')](function(_0x2cb8a3){if(_0x2cb8a3){_0x1ffc75=_0x2cb8a3;_0x221d6f[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_0xe0b0('0xd5')][_0xe0b0('0x2f')]);_0x221d6f[_0xe0b0('0x40')]=_['keys'](_0xb263f6[_0xe0b0('0x40')]);_0x221d6f['filters']=_[_0xe0b0('0xcd')](_0x221d6f['model'],_0x221d6f['query']);_0x1cd51c[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x221d6f['model'],qs['fields'](_0xb263f6[_0xe0b0('0x40')][_0xe0b0('0xce')]));_0x1cd51c['attributes']=_0x1cd51c['attributes'][_0xe0b0('0x48')]?_0x1cd51c[_0xe0b0('0x43')]:_0x221d6f['model'];_0x1cd51c[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0xb263f6[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x1cd51c['where']=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0xb263f6[_0xe0b0('0x40')],_0x221d6f[_0xe0b0('0xc5')]));if(_0xb263f6[_0xe0b0('0x40')]['filter']){_0x1cd51c[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x1cd51c[_0xe0b0('0x3c')],{'$or':_['map'](_0x1cd51c[_0xe0b0('0x43')],function(_0x3d6640){var _0x5c651a={};_0x5c651a[_0x3d6640]={'$like':'%'+_0xb263f6['query'][_0xe0b0('0x33')]+'%'};return _0x5c651a;})});}_0x1cd51c=_[_0xe0b0('0xc8')]({},_0x1cd51c,_0xb263f6[_0xe0b0('0xc9')]);return _0x1ffc75[_0xe0b0('0xd6')](_0x1cd51c);}})[_0xe0b0('0x2c')](function(_0x19366f){if(_0x19366f){_0x3a39d7=_0x19366f[_0xe0b0('0x48')];if(!_0xb263f6['query']['hasOwnProperty']('nolimit')){_0x1cd51c['limit']=qs[_0xe0b0('0x19')](_0xb263f6[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x1cd51c['offset']=qs[_0xe0b0('0x1a')](_0xb263f6[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x1ffc75[_0xe0b0('0xd6')](_0x1cd51c);}})[_0xe0b0('0x2c')](function(_0xc335f5){if(_0xc335f5){return _0xc335f5?{'count':_0x3a39d7,'rows':_0xc335f5}:null;}})['then'](respondWithResult(_0x77aaed,null))['catch'](handleError(_0x77aaed,null));};exports[_0xe0b0('0xd7')]=function(_0x2db4ba,_0x12dab1){var _0x1130fc={};var _0x30a869={};var _0x55e2ba;var _0x1e4f9d;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x2db4ba[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x12dab1,null))[_0xe0b0('0x2c')](function(_0x3c78ea){if(_0x3c78ea){_0x55e2ba=_0x3c78ea;_0x30a869[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_0xe0b0('0xd8')]['rawAttributes']);_0x30a869['query']=_['keys'](_0x2db4ba[_0xe0b0('0x40')]);_0x30a869[_0xe0b0('0xc5')]=_[_0xe0b0('0xcd')](_0x30a869[_0xe0b0('0xc2')],_0x30a869[_0xe0b0('0x40')]);_0x1130fc[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x30a869['model'],qs[_0xe0b0('0xce')](_0x2db4ba[_0xe0b0('0x40')][_0xe0b0('0xce')]));_0x1130fc['attributes']=_0x1130fc[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x1130fc['attributes']:_0x30a869[_0xe0b0('0xc2')];_0x1130fc[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x2db4ba[_0xe0b0('0x40')]['sort']);_0x1130fc['where']=qs[_0xe0b0('0xc5')](_['pick'](_0x2db4ba[_0xe0b0('0x40')],_0x30a869['filters']));if(_0x2db4ba[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x1130fc[_0xe0b0('0x3c')]=_['merge'](_0x1130fc[_0xe0b0('0x3c')],{'$or':_['map'](_0x1130fc[_0xe0b0('0x43')],function(_0x8a34d4){var _0x57726f={};_0x57726f[_0x8a34d4]={'$like':'%'+_0x2db4ba[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x57726f;})});}_0x1130fc=_[_0xe0b0('0xc8')]({},_0x1130fc,_0x2db4ba[_0xe0b0('0xc9')]);return _0x55e2ba['getOpenchannelInteractions'](_0x1130fc);}})[_0xe0b0('0x2c')](function(_0x2203d9){if(_0x2203d9){_0x1e4f9d=_0x2203d9[_0xe0b0('0x48')];if(!_0x2db4ba['query'][_0xe0b0('0xd0')]('nolimit')){_0x1130fc[_0xe0b0('0x19')]=qs['limit'](_0x2db4ba[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x1130fc[_0xe0b0('0x1a')]=qs['offset'](_0x2db4ba[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x55e2ba[_0xe0b0('0xd7')](_0x1130fc);}})[_0xe0b0('0x2c')](function(_0x24cbf5){if(_0x24cbf5){return _0x24cbf5?{'count':_0x1e4f9d,'rows':_0x24cbf5}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x12dab1,null))[_0xe0b0('0x50')](handleError(_0x12dab1,null));};exports['getMailInteractions']=function(_0x31063b,_0x5edda2){var _0x3665a1={'raw':!![],'where':{}};var _0x4ddf0b={};var _0x3cde6e={'count':0x0,'rows':[]};return db[_0xe0b0('0x3d')]['findOne']({'where':{'id':_0x31063b['params']['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x5edda2,null))[_0xe0b0('0x2c')](function(_0x4427a3){if(_0x4427a3){_0x4ddf0b[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_0xe0b0('0xd9')]['rawAttributes']);_0x4ddf0b[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x31063b['query']);_0x4ddf0b[_0xe0b0('0xc5')]=_[_0xe0b0('0xcd')](_0x4ddf0b[_0xe0b0('0xc2')],_0x4ddf0b[_0xe0b0('0x40')]);_0x3665a1[_0xe0b0('0x43')]=_['intersection'](_0x4ddf0b[_0xe0b0('0xc2')],qs['fields'](_0x31063b[_0xe0b0('0x40')][_0xe0b0('0xce')]));_0x3665a1[_0xe0b0('0x43')]=_0x3665a1[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x3665a1['attributes']:_0x4ddf0b[_0xe0b0('0xc2')];if(!_0x31063b[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x3665a1[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x31063b[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x3665a1['offset']=qs['offset'](_0x31063b['query'][_0xe0b0('0x1a')]);}_0x3665a1[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x31063b['query'][_0xe0b0('0xc7')]);_0x3665a1['where']=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x31063b[_0xe0b0('0x40')],_0x4ddf0b[_0xe0b0('0xc5')]));_0x3665a1[_0xe0b0('0x3c')][_0xe0b0('0xda')]=_0x4427a3['id'];if(_0x31063b['query'][_0xe0b0('0x33')]){_0x3665a1[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x3665a1['where'],{'$or':_[_0xe0b0('0x30')](_0x3665a1[_0xe0b0('0x43')],function(_0x509fc1){var _0x23e9f3={};_0x23e9f3[_0x509fc1]={'$like':'%'+_0x31063b['query'][_0xe0b0('0x33')]+'%'};return _0x23e9f3;})});}_0x3665a1=_[_0xe0b0('0xc8')]({},_0x3665a1,_0x31063b[_0xe0b0('0xc9')]);return db[_0xe0b0('0xd9')][_0xe0b0('0x3e')]({'where':_0x3665a1[_0xe0b0('0x3c')]})[_0xe0b0('0x2c')](function(_0x4478a8){_0x3cde6e[_0xe0b0('0x3e')]=_0x4478a8;if(_0x31063b[_0xe0b0('0x40')][_0xe0b0('0x53')]){_0x3665a1[_0xe0b0('0x3f')]=[{'all':!![]}];}return db[_0xe0b0('0xd9')][_0xe0b0('0x45')](_0x3665a1);})['then'](function(_0x4441b8){_0x3cde6e[_0xe0b0('0x46')]=_0x4441b8;return _0x3cde6e;});}})[_0xe0b0('0x2c')](respondWithFilteredResult(_0x5edda2,_0x3665a1))[_0xe0b0('0x50')](handleError(_0x5edda2,null));};exports[_0xe0b0('0xdb')]=function(_0x24a1d1,_0x143bd6){var _0x22a081={};var _0x26eb8d={};var _0x1a0be9;var _0xf62cd4;return db[_0xe0b0('0x3d')]['findOne']({'where':{'id':_0x24a1d1[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x143bd6,null))['then'](function(_0xd60c40){if(_0xd60c40){_0x1a0be9=_0xd60c40;_0x26eb8d[_0xe0b0('0xc2')]=_['keys'](db[_0xe0b0('0xdc')][_0xe0b0('0x2f')]);_0x26eb8d['query']=_[_0xe0b0('0xc3')](_0x24a1d1[_0xe0b0('0x40')]);_0x26eb8d[_0xe0b0('0xc5')]=_[_0xe0b0('0xcd')](_0x26eb8d[_0xe0b0('0xc2')],_0x26eb8d['query']);_0x22a081[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x26eb8d[_0xe0b0('0xc2')],qs['fields'](_0x24a1d1[_0xe0b0('0x40')][_0xe0b0('0xce')]));_0x22a081[_0xe0b0('0x43')]=_0x22a081[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x22a081[_0xe0b0('0x43')]:_0x26eb8d[_0xe0b0('0xc2')];_0x22a081[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x24a1d1[_0xe0b0('0x40')]['sort']);_0x22a081['where']=qs[_0xe0b0('0xc5')](_['pick'](_0x24a1d1[_0xe0b0('0x40')],_0x26eb8d['filters']));if(_0x24a1d1[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x22a081[_0xe0b0('0x3c')]=_['merge'](_0x22a081['where'],{'$or':_['map'](_0x22a081[_0xe0b0('0x43')],function(_0x256a0d){var _0x4bbba6={};_0x4bbba6[_0x256a0d]={'$like':'%'+_0x24a1d1[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x4bbba6;})});}_0x22a081=_[_0xe0b0('0xc8')]({},_0x22a081,_0x24a1d1[_0xe0b0('0xc9')]);return _0x1a0be9[_0xe0b0('0xdb')](_0x22a081);}})[_0xe0b0('0x2c')](function(_0x1c7d34){if(_0x1c7d34){_0xf62cd4=_0x1c7d34[_0xe0b0('0x48')];if(!_0x24a1d1[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x22a081[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x24a1d1['query'][_0xe0b0('0x19')]);_0x22a081[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x24a1d1[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x1a0be9[_0xe0b0('0xdb')](_0x22a081);}})[_0xe0b0('0x2c')](function(_0x42a30c){if(_0x42a30c){return _0x42a30c?{'count':_0xf62cd4,'rows':_0x42a30c}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x143bd6,null))[_0xe0b0('0x50')](handleError(_0x143bd6,null));};exports[_0xe0b0('0xdd')]=function(_0xc5ca9f,_0x3bd079){var _0x26af73={};var _0x51353e={};var _0x3d326d;var _0x12fec1;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0xc5ca9f[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x3bd079,null))[_0xe0b0('0x2c')](function(_0x1e2f09){if(_0x1e2f09){_0x3d326d=_0x1e2f09;_0x51353e['model']=_[_0xe0b0('0xc3')](db['FaxInteraction'][_0xe0b0('0x2f')]);_0x51353e['query']=_[_0xe0b0('0xc3')](_0xc5ca9f[_0xe0b0('0x40')]);_0x51353e['filters']=_[_0xe0b0('0xcd')](_0x51353e[_0xe0b0('0xc2')],_0x51353e['query']);_0x26af73[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x51353e[_0xe0b0('0xc2')],qs['fields'](_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0xce')]));_0x26af73[_0xe0b0('0x43')]=_0x26af73[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x26af73[_0xe0b0('0x43')]:_0x51353e['model'];_0x26af73[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x26af73[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0xc5ca9f[_0xe0b0('0x40')],_0x51353e['filters']));if(_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x26af73[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x26af73[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x26af73[_0xe0b0('0x43')],function(_0x330a3e){var _0x5426c2={};_0x5426c2[_0x330a3e]={'$like':'%'+_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x5426c2;})});}_0x26af73=_['merge']({},_0x26af73,_0xc5ca9f[_0xe0b0('0xc9')]);return _0x3d326d[_0xe0b0('0xdd')](_0x26af73);}})[_0xe0b0('0x2c')](function(_0x404b24){if(_0x404b24){_0x12fec1=_0x404b24[_0xe0b0('0x48')];if(!_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x26af73[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0xc5ca9f[_0xe0b0('0x40')]['limit']);_0x26af73[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0xc5ca9f[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x3d326d[_0xe0b0('0xdd')](_0x26af73);}})['then'](function(_0xe9fc2a){if(_0xe9fc2a){return _0xe9fc2a?{'count':_0x12fec1,'rows':_0xe9fc2a}:null;}})['then'](respondWithResult(_0x3bd079,null))['catch'](handleError(_0x3bd079,null));};exports[_0xe0b0('0xde')]=function(_0x19ff51,_0x1dce49){var _0x1fa6b4={};var _0x2f3111={};var _0x233632;var _0x5d4476;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x19ff51[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x1dce49,null))[_0xe0b0('0x2c')](function(_0x46d27a){if(_0x46d27a){_0x233632=_0x46d27a;_0x2f3111[_0xe0b0('0xc2')]=_['keys'](db[_0xe0b0('0xdf')][_0xe0b0('0x2f')]);_0x2f3111[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x19ff51['query']);_0x2f3111['filters']=_[_0xe0b0('0xcd')](_0x2f3111['model'],_0x2f3111[_0xe0b0('0x40')]);_0x1fa6b4['attributes']=_[_0xe0b0('0xcd')](_0x2f3111[_0xe0b0('0xc2')],qs[_0xe0b0('0xce')](_0x19ff51['query']['fields']));_0x1fa6b4[_0xe0b0('0x43')]=_0x1fa6b4[_0xe0b0('0x43')][_0xe0b0('0x48')]?_0x1fa6b4['attributes']:_0x2f3111[_0xe0b0('0xc2')];_0x1fa6b4[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x1fa6b4[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x19ff51[_0xe0b0('0x40')],_0x2f3111['filters']));if(_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x1fa6b4[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x1fa6b4[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x1fa6b4[_0xe0b0('0x43')],function(_0x336584){var _0x18c97a={};_0x18c97a[_0x336584]={'$like':'%'+_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x18c97a;})});}_0x1fa6b4=_['merge']({},_0x1fa6b4,_0x19ff51['options']);return _0x233632['getWhatsappInteractions'](_0x1fa6b4);}})['then'](function(_0x416595){if(_0x416595){_0x5d4476=_0x416595[_0xe0b0('0x48')];if(!_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x1fa6b4[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x1fa6b4['offset']=qs['offset'](_0x19ff51[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x233632['getWhatsappInteractions'](_0x1fa6b4);}})[_0xe0b0('0x2c')](function(_0x2dcd5d){if(_0x2dcd5d){return _0x2dcd5d?{'count':_0x5d4476,'rows':_0x2dcd5d}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x1dce49,null))[_0xe0b0('0x50')](handleError(_0x1dce49,null));};exports['login']=function(_0x1612e9,_0x4b1841,_0x1e91f6){var _0x89b41;var _0xbbe2fa;var _0x10a4cd;var _0xef9058=!_[_0xe0b0('0x61')](_0x1612e9[_0xe0b0('0x52')]['id'])?_0x1612e9[_0xe0b0('0x52')]['id']:!_[_0xe0b0('0x61')](_0x1612e9['user']['id'])?_0x1612e9['user']['id']:null;return db[_0xe0b0('0x3d')]['find']({'where':{'id':_0xef9058,'role':{'$or':[_0xe0b0('0x23'),_0xe0b0('0x77'),_0xe0b0('0x1e')]}},'attributes':['id',_0xe0b0('0x2b'),_0xe0b0('0xe0'),_0xe0b0('0xe1'),_0xe0b0('0x1d'),_0xe0b0('0x5b'),_0xe0b0('0x95')]})[_0xe0b0('0x2c')](function(_0x497b12){if(_0x497b12){if(_0x497b12[_0xe0b0('0x1d')]==='agent'){_0x89b41=_0x497b12;if(_0x1612e9[_0xe0b0('0x56')]['interface']){_0x10a4cd=util[_0xe0b0('0xa0')](_0xe0b0('0xe2'),_0x89b41[_0x1612e9[_0xe0b0('0x56')][_0xe0b0('0x96')]]);}else if(_0x1612e9[_0xe0b0('0x56')][_0xe0b0('0xe3')]){_0x10a4cd=util[_0xe0b0('0xa0')](_0xe0b0('0xe4'),_0x1612e9[_0xe0b0('0x56')][_0xe0b0('0xe3')]);}else{_0x10a4cd=util['format']('SIP/%s',_0x89b41[_0xe0b0('0x2b')]);}socket['to'](util[_0xe0b0('0xa0')](_0xe0b0('0xe5'),_0x89b41[_0xe0b0('0x2b')]))[_0xe0b0('0x1f')](_0xe0b0('0xe6'),{'user':{'id':_0x89b41['id'],'name':_0x89b41[_0xe0b0('0x2b')]},'ip':_0x1612e9[_0xe0b0('0xe7')][_0xe0b0('0xe8')]||_0x1612e9[_0xe0b0('0xe9')][_0xe0b0('0xea')]||_0x1612e9['socket']['remoteAddress']||_0x1612e9[_0xe0b0('0xe9')][_0xe0b0('0xeb')][_0xe0b0('0xea')]});return db[_0xe0b0('0xa2')][_0xe0b0('0x21')]({'where':{'membername':_0x89b41['name']},'individualHooks':!![]});}}else{throw new db[(_0xe0b0('0x8a'))]['ValidationError'](_0xe0b0('0xec'));}})['then'](function(){if(_0x89b41){return _0x89b41[_0xe0b0('0xed')]({'raw':!![]});}})[_0xe0b0('0x2c')](function(_0x3100b8){if(_0x89b41){if(_0x3100b8){_0xbbe2fa=_0x3100b8;if(_0xbbe2fa[_0xe0b0('0x48')]){var _0x4704b5=_0xbbe2fa[_0xe0b0('0x30')](function(_0x232eb2){var _0x54255f={'membername':_0x89b41['name'],'UserId':_0x89b41['id'],'queue_name':_0x232eb2['name'],'VoiceQueueId':_0x232eb2['id'],'interface':_0x10a4cd,'paused':_0x89b41['loginInPause']||![],'penalty':_0x232eb2[_0xe0b0('0xee')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x54255f);});return Promise['all'](_0x4704b5);}}}})[_0xe0b0('0x2c')](function(){if(_0x89b41){return db[_0xe0b0('0xef')][_0xe0b0('0x45')]({'where':{'membername':_0x89b41[_0xe0b0('0x2b')],'exitAt':null}});}})[_0xe0b0('0x2c')](function(_0x4c96d9){if(_0x89b41){var _0x598b2f=[];_0x4c96d9[_0xe0b0('0xf0')](function(_0x106b14){_0x598b2f[_0xe0b0('0x44')](_0x106b14[_0xe0b0('0x1c')]({'exitAt':moment()[_0xe0b0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x598b2f);}})[_0xe0b0('0x2c')](function(){if(_0x89b41){var _0x281105=[];var _0x3f5399=[];var _0x59e5ec=utils['getChannels']();var _0x1ce78e={'membername':_0x89b41[_0xe0b0('0x2b')],'interface':_0x10a4cd,'enterAt':moment()[_0xe0b0('0xa0')](_0xe0b0('0xf1')),'role':_0x89b41[_0xe0b0('0x1d')],'internal':_0x89b41[_0xe0b0('0x5b')]};_0x59e5ec[_0xe0b0('0xf0')](function(_0x2711e1){_0x281105['push'](_['merge']({'channel':_0x2711e1,'type':_0xe0b0('0xf2'),'data1':_0x1612e9[_0xe0b0('0x56')][_0xe0b0('0xf3')],'data2':_0x10a4cd},_0x1ce78e));if(_0x89b41[_0xe0b0('0x95')]){_0x3f5399[_0xe0b0('0x44')](_[_0xe0b0('0xc8')]({'channel':_0x2711e1,'type':_0xe0b0('0xf4'),'data1':_0xe0b0('0xf5')},_0x1ce78e));}});return db['MemberReport'][_0xe0b0('0xf6')](_0x281105['concat'](_0x3f5399),{'individualHooks':!![]});}})[_0xe0b0('0x2c')](function(){if(_0x89b41){return _0x89b41[_0xe0b0('0x1c')]({'online':!![],'lastLoginAt':moment()[_0xe0b0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x89b41[_0xe0b0('0x95')]||![],'mailPause':_0x89b41[_0xe0b0('0x95')]||![],'chatPause':_0x89b41[_0xe0b0('0x95')]||![],'faxPause':_0x89b41[_0xe0b0('0x95')]||![],'smsPause':_0x89b41[_0xe0b0('0x95')]||![],'openchannelPause':_0x89b41[_0xe0b0('0x95')]||![],'whatsappPause':_0x89b41[_0xe0b0('0x95')]||![],'pauseType':_0x89b41[_0xe0b0('0x95')]?'LOGININPAUSE':null,'interface':_0x10a4cd,'lastPauseAt':moment()[_0xe0b0('0xa0')](_0xe0b0('0xf1'))});}})[_0xe0b0('0x2c')](function(_0x4683c9){if(_0x1612e9['isMiddleware']){return _0x1e91f6();}else{return Promise[_0xe0b0('0xf7')](_0x4683c9)['then'](respondWithResult(_0x4b1841,null));}})[_0xe0b0('0x50')](handleError(_0x4b1841,null));};exports[_0xe0b0('0xf8')]=function(_0x1c8bd7,_0x3ebf47){var _0x4026c6;return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x1c8bd7[_0xe0b0('0x52')]['id'],'role':_0xe0b0('0x1e')},'attributes':['id',_0xe0b0('0x2b'),'role']})[_0xe0b0('0x2c')](handleEntityNotFound(_0x3ebf47,null))[_0xe0b0('0x2c')](function(_0x6824){if(_0x6824){_0x4026c6=_0x6824;return db[_0xe0b0('0xa2')][_0xe0b0('0x21')]({'where':{'membername':_0x4026c6[_0xe0b0('0x2b')]},'individualHooks':!![]});}})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0xef')]['findAll']({'where':{'membername':_0x4026c6[_0xe0b0('0x2b')],'exitAt':null}});})['then'](function(_0x947c33){var _0x22c112=[];_0x947c33[_0xe0b0('0xf0')](function(_0x57acef){_0x22c112['push'](_0x57acef[_0xe0b0('0x1c')]({'exitAt':moment()[_0xe0b0('0xa0')](_0xe0b0('0xf1'))}));});return Promise['all'](_0x22c112);})[_0xe0b0('0x2c')](function(){return _0x4026c6[_0xe0b0('0x1c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe0b0('0x2c')](respondWithResult(_0x3ebf47,null))[_0xe0b0('0x50')](handleError(_0x3ebf47,null));};exports[_0xe0b0('0xf9')]=function(_0x4e0028,_0x456cd0){var _0x27c178;return db[_0xe0b0('0xa2')][_0xe0b0('0x1c')]({'paused':0x1},{'where':{'UserId':_0x4e0028[_0xe0b0('0x52')]['id']},'individualHooks':!![]})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x4e0028[_0xe0b0('0x52')]['id'],'role':_0xe0b0('0x1e')},'attributes':['id','name',_0xe0b0('0x1d'),'internal',_0xe0b0('0x96'),_0xe0b0('0x94')]});})[_0xe0b0('0x2c')](handleEntityNotFound(_0x456cd0,null))[_0xe0b0('0x2c')](function(_0x1eddf1){if(_0x1eddf1){_0x27c178=_0x1eddf1;return db[_0xe0b0('0xef')][_0xe0b0('0x45')]({'where':{'membername':_0x27c178[_0xe0b0('0x2b')],'type':_0xe0b0('0xf4'),'exitAt':null}});}})[_0xe0b0('0x2c')](function(_0x21de83){if(_0x21de83['length']){var _0x30b32d=moment()['format'](_0xe0b0('0xf1'));for(var _0x284952=0x0,_0x10bac6=_0x21de83[_0xe0b0('0x48')];_0x284952<_0x10bac6;_0x284952++){_0x21de83[_0x284952][_0xe0b0('0xfa')]({'exitAt':_0x30b32d});}}})['then'](function(){var _0x48cd62=[];var _0x2c5077=utils[_0xe0b0('0xfb')]();_0x2c5077[_0xe0b0('0xf0')](function(_0x362977){_0x48cd62[_0xe0b0('0x44')]({'channel':_0x362977,'membername':_0x27c178[_0xe0b0('0x2b')],'interface':_[_0xe0b0('0x61')](_0x27c178['interface'])?util[_0xe0b0('0xa0')](_0xe0b0('0xe4'),_0x27c178[_0xe0b0('0x2b')]):_0x27c178['interface'],'type':'PAUSE','enterAt':moment()[_0xe0b0('0xa0')](_0xe0b0('0xf1')),'data1':_0x4e0028[_0xe0b0('0x56')][_0xe0b0('0x32')]||_0xe0b0('0xfc'),'role':_0x27c178['role'],'internal':_0x27c178[_0xe0b0('0x5b')]});});return db[_0xe0b0('0xef')][_0xe0b0('0xf6')](_0x48cd62,{'individualHooks':!![]});})[_0xe0b0('0x2c')](function(){return _0x27c178['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4e0028[_0xe0b0('0x56')][_0xe0b0('0x32')]||_0xe0b0('0xfc'),'lastPauseAt':moment()[_0xe0b0('0xa0')](_0xe0b0('0xf1'))});})[_0xe0b0('0x2c')](respondWithResult(_0x456cd0,null))['catch'](handleError(_0x456cd0,null));};exports[_0xe0b0('0xfd')]=function(_0x1ceb5d,_0x754b0b){if(_0x1ceb5d[_0xe0b0('0x56')][_0xe0b0('0x93')]&&!utils[_0xe0b0('0x97')](_0x1ceb5d[_0xe0b0('0x56')][_0xe0b0('0x93')])){throw new APIBadRequestError(util['format'](_0xe0b0('0xfe'),_0x1ceb5d['body'][_0xe0b0('0x93')]));}return db[_0xe0b0('0x3d')][_0xe0b0('0x2a')]({'where':{'id':_0x1ceb5d[_0xe0b0('0x52')]['id']},'attributes':['id',_0xe0b0('0x2b'),_0xe0b0('0x1d'),_0xe0b0('0x5b'),_0xe0b0('0x96'),_0xe0b0('0x94'),_0xe0b0('0xa1'),'mailPause','chatPause','faxPause',_0xe0b0('0xff'),_0xe0b0('0x100'),_0xe0b0('0x101'),'pauseType',_0xe0b0('0x102')]})[_0xe0b0('0x2c')](function(_0x1cd267){if(!_0x1cd267){throw new APINotFoundError(util[_0xe0b0('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1ceb5d[_0xe0b0('0x52')]['id']));}return _0x1cd267[_0xe0b0('0xfd')](_0x1ceb5d['body']['channel']);})['then'](respondWithResult(_0x754b0b,null))[_0xe0b0('0x50')](APIHandleError(_0x754b0b));};exports['getTeams']=function(_0x259212,_0x33917c){var _0x5f2513={};var _0x2d4c36={};var _0x55dc4e;var _0x58aa6e;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x259212[_0xe0b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x33917c,null))[_0xe0b0('0x2c')](function(_0x49b4f8){if(_0x49b4f8){_0x55dc4e=_0x49b4f8;_0x2d4c36[_0xe0b0('0xc2')]=_['keys'](db['Team']['rawAttributes']);_0x2d4c36[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x259212[_0xe0b0('0x40')]);_0x2d4c36[_0xe0b0('0xc5')]=_['intersection'](_0x2d4c36[_0xe0b0('0xc2')],_0x2d4c36['query']);_0x5f2513['attributes']=_[_0xe0b0('0xcd')](_0x2d4c36[_0xe0b0('0xc2')],qs[_0xe0b0('0xce')](_0x259212[_0xe0b0('0x40')]['fields']));_0x5f2513[_0xe0b0('0x43')]=_0x5f2513[_0xe0b0('0x43')]['length']?_0x5f2513[_0xe0b0('0x43')]:_0x2d4c36[_0xe0b0('0xc2')];_0x5f2513[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x259212[_0xe0b0('0x40')]['sort']);_0x5f2513[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x259212['query'],_0x2d4c36[_0xe0b0('0xc5')]));if(_0x259212['query'][_0xe0b0('0x33')]){_0x5f2513[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x5f2513[_0xe0b0('0x3c')],{'$or':_['map'](_0x5f2513[_0xe0b0('0x43')],function(_0x2045c6){var _0x473c4c={};_0x473c4c[_0x2045c6]={'$like':'%'+_0x259212['query'][_0xe0b0('0x33')]+'%'};return _0x473c4c;})});}_0x5f2513=_[_0xe0b0('0xc8')]({},_0x5f2513,_0x259212[_0xe0b0('0xc9')]);return _0x55dc4e['getTeams'](_0x5f2513);}})[_0xe0b0('0x2c')](function(_0x1a2b9b){if(_0x1a2b9b){_0x58aa6e=_0x1a2b9b['length'];if(!_0x259212[_0xe0b0('0x40')][_0xe0b0('0xd0')](_0xe0b0('0xcb'))){_0x5f2513[_0xe0b0('0x19')]=qs[_0xe0b0('0x19')](_0x259212[_0xe0b0('0x40')][_0xe0b0('0x19')]);_0x5f2513[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x259212[_0xe0b0('0x40')][_0xe0b0('0x1a')]);}return _0x55dc4e[_0xe0b0('0x103')](_0x5f2513);}})[_0xe0b0('0x2c')](function(_0x47b018){if(_0x47b018){return _0x47b018?{'count':_0x58aa6e,'rows':_0x47b018}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0x33917c,null))[_0xe0b0('0x50')](handleError(_0x33917c,null));};exports['addTeams']=function(_0x2b90e6,_0x27a9de){var _0xcb2809=_0x2b90e6[_0xe0b0('0x52')]['id'];var _0xe8341c=_0x2b90e6[_0xe0b0('0x56')]?_0x2b90e6['body']['ids']:null;var _0x36e6b1=[];return Promise[_0xe0b0('0xf7')]()[_0xe0b0('0x2c')](function(){if(!_0xe8341c)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0xe0b0('0xbd')]({'where':{'id':_0xcb2809}});})[_0xe0b0('0x2c')](function(_0x4eae41){if(!_0x4eae41)throw new APINotFoundError(util[_0xe0b0('0xa0')](_0xe0b0('0x104'),_0x2b90e6[_0xe0b0('0x52')]['id']));return db[_0xe0b0('0x63')]['transaction'](function(_0x2d9ced){return _0x4eae41[_0xe0b0('0x105')](_0xe8341c,{'transaction':_0x2d9ced})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x106')][_0xe0b0('0x45')]({'where':{'id':{'$in':_0xe8341c}}});})[_0xe0b0('0x2c')](function(_0x328345){var _0x548dc4=_[_0xe0b0('0x30')](_0x328345,function(_0x2e48fe){return _0x2e48fe['getAssociatedQueues']();});return Promise[_0xe0b0('0x55')](_0x548dc4);})[_0xe0b0('0x2c')](function(_0x4e8d20){_0x36e6b1=_['flattenDeep'](_0x4e8d20);var _0xb1cf0a=_[_0xe0b0('0x30')](_0x36e6b1,function(_0xad427a){return _0xad427a[_0xe0b0('0x107')](_0x4eae41['id'],{'transaction':_0x2d9ced});});return Promise[_0xe0b0('0x55')](_0xb1cf0a);})['then'](function(){if(!_0x4eae41['online'])return;var _0x411462=_[_0xe0b0('0x33')](_0x36e6b1,function(_0xb3df4d){return _0xb3df4d['getDataValue']('channel')===_0xe0b0('0x108');});var _0x1bb9aa=_[_0xe0b0('0x30')](_0x411462,function(_0x5160d2){return db[_0xe0b0('0xa2')][_0xe0b0('0xa3')]({'membername':_0x4eae41[_0xe0b0('0x2b')],'UserId':_0x4eae41['id'],'queue_name':_0x5160d2['name'],'VoiceQueueId':_0x5160d2['id'],'interface':_[_0xe0b0('0x61')](_0x4eae41[_0xe0b0('0x96')])?util[_0xe0b0('0xa0')]('SIP/%s',_0x4eae41[_0xe0b0('0x2b')]):_0x4eae41[_0xe0b0('0x96')],'paused':_0x4eae41[_0xe0b0('0xa1')]||![],'penalty':_0x4eae41[_0xe0b0('0x9b')]},{'transaction':_0x2d9ced});});return Promise[_0xe0b0('0x55')](_0x1bb9aa);})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x109')]['findAll']({'where':{'teamId':{'$in':_0xe8341c}}});})[_0xe0b0('0x2c')](function(_0x112ef5){var _0x311264=_[_0xe0b0('0x30')](_0x112ef5,function(_0x241657){return db[_0xe0b0('0x10a')][_0xe0b0('0x76')]({'UserId':_0x4eae41['id'],'VoicePrefixId':_0x241657[_0xe0b0('0x10b')]},{'transaction':_0x2d9ced});});return Promise[_0xe0b0('0x55')](_0x311264);});});})['then'](function(){for(var _0x43abda=0x0;_0x43abda<_0x36e6b1[_0xe0b0('0x48')];_0x43abda++){var _0x5b1e45=_0x36e6b1[_0x43abda][_0xe0b0('0x10c')](_0xe0b0('0x93'));var _0x43ea74=_0x5b1e45+_0xe0b0('0x9c');socket[_0xe0b0('0x1f')]('user'+_0x5b1e45+'Queue:save',{'UserId':_0xcb2809,['queueField']:_0x36e6b1[_0x43abda]['id']});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x27a9de,null))[_0xe0b0('0x50')](APIHandleError(_0x27a9de));};exports[_0xe0b0('0x10d')]=function(_0x2ad0dd,_0x38f830){var _0xa9ac3d=_0x2ad0dd[_0xe0b0('0x52')]['id'];var _0x236a7b=null;if(_0x2ad0dd['query']['ids']){_0x236a7b=_[_0xe0b0('0x10e')](_0x2ad0dd[_0xe0b0('0x40')]['ids'])?_0x2ad0dd['query'][_0xe0b0('0x59')]:[_0x2ad0dd[_0xe0b0('0x40')][_0xe0b0('0x59')]];}var _0xe202fe=[];return Promise[_0xe0b0('0xf7')]()[_0xe0b0('0x2c')](function(){if(!_0x236a7b)throw new APIBadRequestError(_0xe0b0('0x10f'));})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x3d')]['findOne']({'where':{'id':_0xa9ac3d}});})[_0xe0b0('0x2c')](function(_0x4518fc){if(!_0x4518fc)throw new APINotFoundError(util[_0xe0b0('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2ad0dd[_0xe0b0('0x52')]['id']));return db['sequelize']['transaction'](function(_0x3ce1dc){return _0x4518fc[_0xe0b0('0x10d')](_0x236a7b,{'transaction':_0x3ce1dc})[_0xe0b0('0x2c')](function(){return db['Team'][_0xe0b0('0x45')]({'where':{'id':{'$in':_0x236a7b}}});})[_0xe0b0('0x2c')](function(_0x5cb2c2){var _0x2f5995=_[_0xe0b0('0x30')](_0x5cb2c2,function(_0x5bcf77){return _0x5bcf77[_0xe0b0('0x110')]();});return Promise[_0xe0b0('0x55')](_0x2f5995);})['then'](function(_0x51dc17){_0xe202fe=_['flattenDeep'](_0x51dc17);var _0x394f5a=_[_0xe0b0('0x30')](_0xe202fe,function(_0x3ee08){return _0x3ee08[_0xe0b0('0x111')](_0x4518fc['id'],{'transaction':_0x3ce1dc});});return Promise['all'](_0x394f5a);})[_0xe0b0('0x2c')](function(){if(!_0x4518fc['online'])return;var _0x33564e=_['filter'](_0xe202fe,function(_0x8db237){return _0x8db237['getDataValue'](_0xe0b0('0x93'))===_0xe0b0('0x108');});var _0x5e3dd4=_[_0xe0b0('0x30')](_0x33564e,function(_0x2841b9){return db[_0xe0b0('0xa2')][_0xe0b0('0x21')]({'where':{'VoiceQueueId':_0x2841b9['id'],'UserId':_0x4518fc['id']},'transaction':_0x3ce1dc});});return Promise[_0xe0b0('0x55')](_0x5e3dd4);})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x109')][_0xe0b0('0x45')]({'where':{'teamId':{'$in':_0x236a7b}}});})[_0xe0b0('0x2c')](function(_0x523f2e){var _0x2e66c2=_['map'](_0x523f2e,function(_0x52cc60){return db[_0xe0b0('0x10a')]['destroy']({'where':{'UserId':_0x4518fc['id'],'VoicePrefixId':_0x52cc60[_0xe0b0('0x10b')]}},{'transaction':_0x3ce1dc});});return Promise[_0xe0b0('0x55')](_0x2e66c2);});});})['then'](function(){for(var _0x1c60a9=0x0;_0x1c60a9<_0xe202fe[_0xe0b0('0x48')];_0x1c60a9++){var _0x4cb0b3=_0xe202fe[_0x1c60a9]['getDataValue'](_0xe0b0('0x93'));var _0x1aedc3=_0x4cb0b3+'QueueId';socket['emit'](_0xe0b0('0x77')+_0x4cb0b3+_0xe0b0('0xa8'),{'UserId':_0xa9ac3d,['queueField']:_0xe202fe[_0x1c60a9]['id']});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x38f830,null))[_0xe0b0('0x50')](APIHandleError(_0x38f830));};exports[_0xe0b0('0x112')]=function(_0x50a191,_0xb326d8){var _0x2d88d6={};var _0x571a9d={};var _0x2f6d05;var _0x110cba;return db['User'][_0xe0b0('0xbd')]({'where':{'id':_0x50a191[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xb326d8,null))[_0xe0b0('0x2c')](function(_0xe3a6c2){if(_0xe3a6c2){_0x2f6d05=_0xe3a6c2;_0x571a9d[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_0xe0b0('0x113')][_0xe0b0('0x2f')]);_0x571a9d[_0xe0b0('0x40')]=_['keys'](_0x50a191[_0xe0b0('0x40')]);_0x571a9d[_0xe0b0('0xc5')]=_['intersection'](_0x571a9d[_0xe0b0('0xc2')],_0x571a9d[_0xe0b0('0x40')]);_0x2d88d6['attributes']=_[_0xe0b0('0xcd')](_0x571a9d['model'],qs[_0xe0b0('0xce')](_0x50a191['query'][_0xe0b0('0xce')]));_0x2d88d6[_0xe0b0('0x43')]=_0x2d88d6['attributes'][_0xe0b0('0x48')]?_0x2d88d6['attributes']:_0x571a9d['model'];_0x2d88d6['order']=qs[_0xe0b0('0xc7')](_0x50a191[_0xe0b0('0x40')]['sort']);_0x2d88d6[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_['pick'](_0x50a191[_0xe0b0('0x40')],_0x571a9d[_0xe0b0('0xc5')]));if(_0x50a191[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x2d88d6[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x2d88d6[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x30')](_0x2d88d6[_0xe0b0('0x43')],function(_0x25312e){var _0x5ba957={};_0x5ba957[_0x25312e]={'$like':'%'+_0x50a191['query'][_0xe0b0('0x33')]+'%'};return _0x5ba957;})});}_0x2d88d6=_[_0xe0b0('0xc8')]({},_0x2d88d6,_0x50a191['options']);return _0x2f6d05[_0xe0b0('0x112')](_0x2d88d6);}})[_0xe0b0('0x2c')](function(_0x552a72){if(_0x552a72){_0x110cba=_0x552a72[_0xe0b0('0x48')];if(!_0x50a191[_0xe0b0('0x40')]['hasOwnProperty']('nolimit')){_0x2d88d6[_0xe0b0('0x19')]=qs['limit'](_0x50a191['query'][_0xe0b0('0x19')]);_0x2d88d6[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x50a191[_0xe0b0('0x40')]['offset']);}return _0x2f6d05[_0xe0b0('0x112')](_0x2d88d6);}})[_0xe0b0('0x2c')](function(_0x30fabb){if(_0x30fabb){return _0x30fabb?{'count':_0x110cba,'rows':_0x30fabb}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0xb326d8,null))[_0xe0b0('0x50')](handleError(_0xb326d8,null));};exports[_0xe0b0('0x114')]=function(_0x3c6837,_0x8cd9c6){var _0x5a59f0={};var _0x2bece6={};var _0x5aee35;return db[_0xe0b0('0x3d')][_0xe0b0('0xbd')]({'where':{'id':_0x3c6837[_0xe0b0('0x52')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x8cd9c6,null))['then'](function(_0x467f2b){if(_0x467f2b){_0x5aee35=_0x467f2b;_0x2bece6[_0xe0b0('0xc2')]=_[_0xe0b0('0xc3')](db[_0xe0b0('0x3d')][_0xe0b0('0x2f')]);_0x2bece6[_0xe0b0('0x40')]=_[_0xe0b0('0xc3')](_0x3c6837[_0xe0b0('0x40')]);_0x2bece6['filters']=_[_0xe0b0('0xcd')](_0x2bece6[_0xe0b0('0xc2')],_0x2bece6[_0xe0b0('0x40')]);_0x5a59f0[_0xe0b0('0x43')]=_[_0xe0b0('0xcd')](_0x2bece6[_0xe0b0('0xc2')],qs[_0xe0b0('0xce')](_0x3c6837[_0xe0b0('0x40')]['fields']));_0x5a59f0[_0xe0b0('0x43')]=_0x5a59f0['attributes'][_0xe0b0('0x48')]?_0x5a59f0['attributes']:_0x2bece6[_0xe0b0('0xc2')];_0x5a59f0[_0xe0b0('0xc6')]=qs[_0xe0b0('0xc7')](_0x3c6837[_0xe0b0('0x40')][_0xe0b0('0xc7')]);_0x5a59f0[_0xe0b0('0x3c')]=qs[_0xe0b0('0xc5')](_[_0xe0b0('0xcf')](_0x3c6837[_0xe0b0('0x40')],_0x2bece6[_0xe0b0('0xc5')]));if(_0x3c6837[_0xe0b0('0x40')][_0xe0b0('0x33')]){_0x5a59f0[_0xe0b0('0x3c')]=_[_0xe0b0('0xc8')](_0x5a59f0['where'],{'$or':_[_0xe0b0('0x30')](_0x5a59f0[_0xe0b0('0x43')],function(_0x4440ad){var _0x25e069={};_0x25e069[_0x4440ad]={'$like':'%'+_0x3c6837[_0xe0b0('0x40')][_0xe0b0('0x33')]+'%'};return _0x25e069;})});}_0x5a59f0[_0xe0b0('0xc2')]=db[_0xe0b0('0x3d')];_0x5a59f0['as']=_0xe0b0('0x25');_0x5a59f0=_[_0xe0b0('0xc8')]({},_0x5a59f0,_0x3c6837[_0xe0b0('0xc9')]);return _0x5aee35[_0xe0b0('0xed')]({'include':[_0x5a59f0]});}})[_0xe0b0('0x2c')](function(_0x125a88){if(_0x125a88){var _0x11821a={},_0x174fde=[];for(var _0x72983b=0x0;_0x72983b<_0x125a88['length'];_0x72983b+=0x1){for(var _0x5998d4=0x0,_0x166f07;_0x5998d4<_0x125a88[_0x72983b][_0xe0b0('0x25')][_0xe0b0('0x48')];_0x5998d4+=0x1){_0x166f07=_0x125a88[_0x72983b][_0xe0b0('0x25')][_0x5998d4][_0xe0b0('0x22')]({'plain':!![]});_0x11821a[_0x166f07['id']]=_0x166f07;}}_0x11821a=_['values'](_0x11821a);for(var _0x21f63e=qs[_0xe0b0('0x1a')](_0x3c6837[_0xe0b0('0x40')]['offset']);_0x21f63e<_0x11821a[_0xe0b0('0x48')]&&_0x174fde[_0xe0b0('0x48')]=_0x24da1b){_0x21db8c=_0x24da1b;_0x51d60d=0xc8;}else{_0x51d60d=0xce;}_0x227355['status'](_0x51d60d);return _0x227355[_0x8db2('0x1b')](_0x8db2('0x1c'),_0x2b3f73+'-'+_0x21db8c+'/'+_0x24da1b)[_0x8db2('0x16')](_0x2f177a);}return null;};}function saveUpdates(_0x1b64e4){return function(_0x58562e){if(_0x58562e){return _0x58562e[_0x8db2('0x1d')](_0x1b64e4)[_0x8db2('0x1e')](function(_0x260940){if(_0x260940[_0x8db2('0x1f')]===_0x8db2('0x20')){socket['emit'](_0x8db2('0x21')+_0x260940['id'],_0x260940);}return _0x260940;});}return null;};}function removeEntity(_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x22')]()[_0x8db2('0x1e')](function(){var _0x21704c=_0x18f69c[_0x8db2('0x23')]({'plain':!![]});if(_0x21704c['role']===_0x8db2('0x24'))return;var _0x4f6516=[{'name':'Users','value':'user','ignore':!![]},{'name':'Agents','value':_0x8db2('0x20'),'ignore':![]},{'name':_0x8db2('0x25'),'value':_0x8db2('0x26'),'ignore':![]}];var _0x2baed0=_(_0x4f6516)[_0x8db2('0x27')](_0x8db2('0x28'))['map'](_0x8db2('0x29'))[_0x8db2('0x29')]();if(_[_0x8db2('0x2a')](_0x2baed0,_0x21704c[_0x8db2('0x1f')])){return;}var _0x483aee=_[_0x8db2('0x2b')](_0x4f6516,[_0x8db2('0x29'),_0x21704c[_0x8db2('0x1f')]])[_0x8db2('0x2c')];return db[_0x8db2('0x2d')][_0x8db2('0x22')]({'where':{'type':_0x483aee,'resourceId':_0x21704c['id']}})[_0x8db2('0x1e')](function(){return _0x18f69c;});})[_0x8db2('0x1e')](function(){_0x3e30e6[_0x8db2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4718ec){return function(_0x50b28d){if(!_0x50b28d){_0x4718ec['sendStatus'](0x194);}return _0x50b28d;};}function handleError(_0x302188,_0x25ed2c){_0x25ed2c=_0x25ed2c||0x1f4;return function(_0xcc8a66){logger['error'](_0xcc8a66[_0x8db2('0x2e')]);if(_0xcc8a66['name']){delete _0xcc8a66[_0x8db2('0x2c')];}_0x302188[_0x8db2('0x15')](_0x25ed2c)[_0x8db2('0x2f')](_0xcc8a66);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0x8db2('0x30')](function(_0x1a460b){return{'name':_0x1a460b['fieldName'],'type':_0x1a460b['type'][_0x8db2('0x31')]};})[_0x8db2('0x27')](function(_0xc884a){return![_0x8db2('0x32'),_0x8db2('0x33'),_0x8db2('0x34'),_0x8db2('0x35'),_0x8db2('0x36'),_0x8db2('0x37')][_0x8db2('0x2a')](_0xc884a['name']);})[_0x8db2('0x29')]();}exports[_0x8db2('0x38')]=function(_0x5d2a5b,_0x41594c){var _0x3ca80b={},_0x5962e6={'count':0x0,'rows':[]};var _0x4bf222=getUserAttributes();_0x3ca80b=qs[_0x8db2('0x39')](_0x4bf222,_0x5d2a5b);var _0x4a45dd={'where':_0x3ca80b[_0x8db2('0x3a')]};return db[_0x8db2('0x3b')][_0x8db2('0x19')](_0x4a45dd)[_0x8db2('0x1e')](function(_0x5cc419){_0x5962e6[_0x8db2('0x19')]=_0x5cc419;if(_0x5d2a5b['query'][_0x8db2('0x3c')]){_0x3ca80b[_0x8db2('0x3d')]=[{'all':!![]}];}if(_0x5d2a5b[_0x8db2('0x3e')][_0x8db2('0x3f')]==='true'){_0x3ca80b['include']=[{'model':db[_0x8db2('0x40')],'as':_0x8db2('0x3f')}];}if(!_['includes'](_0x3ca80b[_0x8db2('0x41')],'id')){_0x3ca80b[_0x8db2('0x41')][_0x8db2('0x42')]('id');}return db['User'][_0x8db2('0x43')](_0x3ca80b);})[_0x8db2('0x1e')](function(_0x953349){_0x5962e6[_0x8db2('0x44')]=_0x953349;if(_0x5d2a5b[_0x8db2('0x3e')][_0x8db2('0x45')]===_0x8db2('0x46')){var _0x1575ea=[];for(var _0x3793a4=0x0;_0x3793a4<_0x5962e6[_0x8db2('0x44')][_0x8db2('0x47')];_0x3793a4++){_0x1575ea[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x48'),_0x5962e6['rows'][_0x3793a4][_0x8db2('0x49')]));_0x1575ea[_0x8db2('0x42')](get_open_tabs('sms',_0x5962e6['rows'][_0x3793a4][_0x8db2('0x49')]));_0x1575ea['push'](get_open_tabs(_0x8db2('0x4a'),_0x5962e6[_0x8db2('0x44')][_0x3793a4][_0x8db2('0x49')]));_0x1575ea[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4b'),_0x5962e6[_0x8db2('0x44')][_0x3793a4][_0x8db2('0x49')]));_0x1575ea['push'](get_open_tabs(_0x8db2('0x4c'),_0x5962e6[_0x8db2('0x44')][_0x3793a4][_0x8db2('0x49')]));_0x1575ea[_0x8db2('0x42')](get_open_tabs('whatsapp',_0x5962e6[_0x8db2('0x44')][_0x3793a4][_0x8db2('0x49')]));}return Promise[_0x8db2('0x4d')](_0x1575ea)[_0x8db2('0x1e')](function(){return _0x5962e6;});}else{return _0x5962e6;}})['then'](respondWithFilteredResult(_0x41594c,_0x3ca80b))[_0x8db2('0x4e')](handleError(_0x41594c,null));};exports['show']=function(_0x19bd06,_0x116b69){var _0x4c8812=getUserAttributes();_0x19bd06['query']['id']=_0x19bd06['params']['id'];var _0x1ec3d0=qs['getOptions'](_0x4c8812,_0x19bd06);if(_0x19bd06[_0x8db2('0x3e')][_0x8db2('0x3c')]){_0x1ec3d0[_0x8db2('0x3d')]=[{'all':!![]}];}if(_0x19bd06[_0x8db2('0x3e')][_0x8db2('0x3f')]===_0x8db2('0x46')){_0x1ec3d0[_0x8db2('0x3d')]=[{'model':db[_0x8db2('0x40')],'as':_0x8db2('0x3f')}];}_0x1ec3d0=_[_0x8db2('0x4f')]({},_0x1ec3d0,_0x19bd06[_0x8db2('0x50')]);if(!_[_0x8db2('0x2a')](_0x1ec3d0['attributes'],'id')){_0x1ec3d0[_0x8db2('0x41')][_0x8db2('0x42')]('id');}return db[_0x8db2('0x3b')][_0x8db2('0x2b')](_0x1ec3d0)['then'](handleEntityNotFound(_0x116b69,null))['then'](function(_0x11c224){var _0x2e46d4=[];values=_0x11c224;if(_0x19bd06[_0x8db2('0x3e')]['openTabs']==='true'){_0x2e46d4['push'](get_open_tabs(_0x8db2('0x48'),_0x11c224[_0x8db2('0x49')]));_0x2e46d4[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x51'),_0x11c224[_0x8db2('0x49')]));_0x2e46d4[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4c'),_0x11c224['dataValues']));_0x2e46d4['push'](get_open_tabs(_0x8db2('0x52'),_0x11c224[_0x8db2('0x49')]));_0x2e46d4[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4a'),_0x11c224[_0x8db2('0x49')]));_0x2e46d4[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4b'),_0x11c224[_0x8db2('0x49')]));return Promise[_0x8db2('0x4d')](_0x2e46d4);}else{return values;}})[_0x8db2('0x1e')](function(){return values;})[_0x8db2('0x1e')](respondWithResult(_0x116b69,null))[_0x8db2('0x4e')](handleError(_0x116b69,null));};exports[_0x8db2('0x1d')]=function(_0x2d518a,_0x47696e){if(_0x2d518a['body']['id']){delete _0x2d518a[_0x8db2('0x53')]['id'];}delete _0x2d518a[_0x8db2('0x53')]['role'];return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x2d518a[_0x8db2('0x54')]['id']}})['then'](handleEntityNotFound(_0x47696e,null))[_0x8db2('0x1e')](saveUpdates(_0x2d518a[_0x8db2('0x53')],null))[_0x8db2('0x1e')](respondWithResult(_0x47696e,null))[_0x8db2('0x4e')](handleError(_0x47696e,null));};exports[_0x8db2('0x55')]=function(_0x50fab4,_0x467505){return db[_0x8db2('0x3b')][_0x8db2('0x55')]()['then'](respondWithResult(_0x467505,null))[_0x8db2('0x4e')](handleError(_0x467505,null));};exports[_0x8db2('0x56')]=function(_0x33dddd,_0x7b0de8){return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x33dddd[_0x8db2('0x54')]['id']}})['then'](handleEntityNotFound(_0x7b0de8,null))[_0x8db2('0x1e')](function(_0x4033c0){if(_0x4033c0){return _0x4033c0['addContacts'](_0x33dddd[_0x8db2('0x53')][_0x8db2('0x57')],_['omit'](_0x33dddd[_0x8db2('0x53')],[_0x8db2('0x57'),'id'])||{});}})[_0x8db2('0x1e')](respondWithResult(_0x7b0de8,null))[_0x8db2('0x4e')](handleError(_0x7b0de8,null));};function validateUser(_0x42b941){return new Promise(function(_0x3c7d8c,_0x10f267){if(_0x42b941[_0x8db2('0x58')])return _0x3c7d8c(_0x42b941);return db[_0x8db2('0x59')][_0x8db2('0x5a')](0x1)[_0x8db2('0x1e')](function(_0x447a47){if(_0x447a47[_0x8db2('0x5b')])authService[_0x8db2('0x5c')](_0x42b941[_0x8db2('0x32')]);db[_0x8db2('0x3b')]['max'](_0x8db2('0x58'))[_0x8db2('0x1e')](function(_0x44118a){if(_[_0x8db2('0x5d')](_0x44118a)){_0x42b941[_0x8db2('0x58')]=_0x447a47['min_internal']||0x1;return;}if(_[_0x8db2('0x5d')](_0x447a47[_0x8db2('0x5e')])||_0x447a47[_0x8db2('0x5e')]===_0x44118a){_0x42b941[_0x8db2('0x58')]=_0x44118a+0x1;return;}if(_0x447a47[_0x8db2('0x5e')]>_0x44118a){_0x42b941[_0x8db2('0x58')]=_0x447a47[_0x8db2('0x5e')];return;}return db[_0x8db2('0x5f')][_0x8db2('0x3e')](_0x8db2('0x60'),{'type':db[_0x8db2('0x5f')][_0x8db2('0x61')][_0x8db2('0x62')]})[_0x8db2('0x1e')](function(_0xed9d36){if(_0xed9d36&&_0xed9d36[_0x8db2('0x47')]){for(var _0x1d7862=0x0,_0xefb12=_0xed9d36['length'];_0x1d7862<_0xefb12&&_[_0x8db2('0x5d')](_0x42b941['internal']);_0x1d7862++){if(_0x447a47[_0x8db2('0x5e')]<=_0xed9d36[_0x1d7862]['from']){_0x42b941[_0x8db2('0x58')]=_0xed9d36[_0x1d7862][_0x8db2('0x63')];}else if(_0x447a47[_0x8db2('0x5e')]>_0xed9d36[_0x1d7862][_0x8db2('0x63')]&&_0x447a47[_0x8db2('0x5e')]<=_0xed9d36[_0x1d7862]['to']){_0x42b941['internal']=_0x447a47['min_internal'];}}}if(_[_0x8db2('0x5d')](_0x42b941[_0x8db2('0x58')])){_0x42b941[_0x8db2('0x58')]=_0x44118a+0x1;}return _0x3c7d8c(_0x42b941);});});})[_0x8db2('0x4e')](function(_0x20b49c){_0x10f267(_0x20b49c);});});}function updateUser(_0x1f28d2){return new Promise(function(_0x3e3de3,_0x79eabc){try{if(_0x1f28d2['voicemail']){_0x1f28d2[_0x8db2('0x64')]=_0x1f28d2[_0x8db2('0x58')];_0x1f28d2[_0x8db2('0x65')]={'mailbox':_0x1f28d2[_0x8db2('0x58')],'password':_0x1f28d2[_0x8db2('0x32')],'fullname':_0x1f28d2[_0x8db2('0x66')],'email':_0x1f28d2[_0x8db2('0x67')]};}if(_0x1f28d2[_0x8db2('0x1f')]==='agent'){if(!_0x1f28d2['permissions'])_0x1f28d2[_0x8db2('0x68')]=[_0x8db2('0x69'),_0x8db2('0x6a'),_0x8db2('0x6b'),_0x8db2('0x6c'),'110','104',_0x8db2('0x6d'),_0x8db2('0x6e'),'107',_0x8db2('0x6f'),_0x8db2('0x70'),_0x8db2('0x71'),'111',_0x8db2('0x72'),_0x8db2('0x73')];}_0x3e3de3(_0x1f28d2);}catch(_0x2cf731){_0x79eabc(_0x2cf731);}});}exports['create']=function(_0x3ff023,_0x12049d){if(_0x3ff023[_0x8db2('0x74')][_0x8db2('0x1f')]===_0x8db2('0x20'))throw new Error('Unauthorized');if(_0x3ff023[_0x8db2('0x53')][_0x8db2('0x1f')]===_0x8db2('0x74')&&_0x3ff023['user']['role']!==_0x8db2('0x24')){throw new Error(_0x8db2('0x75'));}if(_0x3ff023['body'][_0x8db2('0x1f')]===_0x8db2('0x24')&&_0x3ff023[_0x8db2('0x74')][_0x8db2('0x1f')]!==_0x8db2('0x24')){throw new Error(_0x8db2('0x76'));}return licenseUtil[_0x8db2('0x77')]([_0x3ff023[_0x8db2('0x53')]])[_0x8db2('0x1e')](function(){return validateUser(_0x3ff023[_0x8db2('0x53')]);})[_0x8db2('0x1e')](function(_0x3e1478){return updateUser(_0x3e1478)[_0x8db2('0x1e')](function(_0x5f2aa6){if(_0x5f2aa6[_0x8db2('0x1f')]==='admin'){_0x5f2aa6[_0x8db2('0x78')]=_0x3ff023[_0x8db2('0x74')]['settingsEnabled'];delete _0x5f2aa6[_0x8db2('0x79')];}return _0x5f2aa6;});})[_0x8db2('0x1e')](function(_0x5cdf53){return db[_0x8db2('0x3b')][_0x8db2('0x7a')](_0x5cdf53,{'include':[{'model':db[_0x8db2('0x65')],'as':_0x8db2('0x65')}]});})[_0x8db2('0x1e')](function(_0x31a095){if(_0x3ff023[_0x8db2('0x53')][_0x8db2('0x1f')]===_0x8db2('0x74'))return _0x31a095;if(_0x3ff023['user']['role']!==_0x8db2('0x74'))return _0x31a095;return db['UserProfileSection'][_0x8db2('0x2b')]({'where':{'name':_0x31a095[_0x8db2('0x1f')]===_0x8db2('0x20')?'Agents':_0x8db2('0x25'),'userProfileId':_0x3ff023[_0x8db2('0x74')][_0x8db2('0x79')]},'raw':!![]})['then'](function(_0x3ae18c){if(!_0x3ae18c||_0x3ae18c[_0x8db2('0x7b')]!=0x0)return _0x31a095;return db[_0x8db2('0x2d')][_0x8db2('0x7a')]({'name':_0x31a095['name'],'resourceId':_0x31a095['id'],'type':_0x3ae18c[_0x8db2('0x2c')],'sectionId':_0x3ae18c['id']},{})[_0x8db2('0x1e')](function(){return _0x31a095;});})[_0x8db2('0x4e')](function(_0x1edb1a){logger[_0x8db2('0x7c')](_0x8db2('0x7d'),_0x1edb1a);throw _0x1edb1a;});})[_0x8db2('0x1e')](respondWithResult(_0x12049d,0xc9))[_0x8db2('0x4e')](handleError(_0x12049d,null));};exports[_0x8db2('0x7e')]=function(_0x3cec24,_0x3ad3c7){var _0x4d1a55=_0x3cec24[_0x8db2('0x53')];var _0x39f32c=[];if(_0x3cec24[_0x8db2('0x74')]['role']==='agent')throw new Error('Unauthorized');if(_[_0x8db2('0x7f')](_0x4d1a55,[_0x8db2('0x1f'),_0x8db2('0x74')])&&_0x3cec24[_0x8db2('0x74')][_0x8db2('0x1f')]!==_0x8db2('0x24')){throw new Error(_0x8db2('0x75'));}if(_[_0x8db2('0x7f')](_0x4d1a55,[_0x8db2('0x1f'),_0x8db2('0x24')])&&_0x3cec24[_0x8db2('0x74')]['role']!==_0x8db2('0x24')){throw new Error(_0x8db2('0x80'));}return licenseUtil[_0x8db2('0x77')](_0x4d1a55)[_0x8db2('0x1e')](function(){return validateUser(_0x4d1a55[0x0]);})['then'](function(){for(var _0x4bd03d=0x1;_0x4bd03d<_0x4d1a55[_0x8db2('0x47')];_0x4bd03d++){var _0x3c3f3e=_0x4d1a55[_0x4bd03d-0x1]['internal'];if(!_0x4d1a55[_0x4bd03d][_0x8db2('0x58')])_0x4d1a55[_0x4bd03d][_0x8db2('0x58')]=_0x3c3f3e+0x1;_0x39f32c[_0x8db2('0x42')](validateUser(_0x4d1a55[_0x4bd03d]));}return Promise['all'](_0x39f32c);})['then'](function(){_0x39f32c=[];for(var _0x5324c6=0x0;_0x5324c6<_0x4d1a55[_0x8db2('0x47')];_0x5324c6++){_0x39f32c[_0x8db2('0x42')](updateUser(_0x4d1a55[_0x5324c6]));}return Promise[_0x8db2('0x4d')](_0x39f32c);})[_0x8db2('0x1e')](function(){_0x39f32c=_0x4d1a55[_0x8db2('0x30')](function(_0x4e8aac){return db[_0x8db2('0x3b')]['create'](_0x4e8aac,{'include':[{'model':db[_0x8db2('0x65')],'as':_0x8db2('0x65')}]})[_0x8db2('0x1e')](function(_0x18d1eb){_0x4e8aac['id']=_0x18d1eb['id'];return _0x4e8aac;});});return Promise[_0x8db2('0x4d')](_0x39f32c);})['then'](function(_0x4e0834){if(_0x3cec24[_0x8db2('0x53')]['role']===_0x8db2('0x74'))return _0x4e0834;if(_0x3cec24[_0x8db2('0x74')][_0x8db2('0x1f')]!==_0x8db2('0x74'))return _0x4e0834;var _0x2b7224=_[_0x8db2('0x7f')](_0x4e0834,function(_0x5cd088){return _0x5cd088[_0x8db2('0x1f')]===_0x8db2('0x20')||_0x5cd088[_0x8db2('0x1f')]==='telephone';});if(!_0x2b7224)return _0x4e0834;return db[_0x8db2('0x81')][_0x8db2('0x43')]({'where':{'name':{'$or':['Agents',_0x8db2('0x25')]},'userProfileId':_0x3cec24[_0x8db2('0x74')][_0x8db2('0x79')]},'raw':!![]})[_0x8db2('0x1e')](function(_0x105aa6){if(_[_0x8db2('0x82')](_0x105aa6)||!_[_0x8db2('0x7f')](_0x105aa6,[_0x8db2('0x7b'),0x0]))return _0x4e0834;_0x39f32c=[];var _0x412120=_(_0x105aa6)['map'](function(_0x44c0cc){if(_0x44c0cc[_0x8db2('0x7b')]===0x1)return;return _0x44c0cc[_0x8db2('0x2c')]===_0x8db2('0x83')?_0x8db2('0x20'):_0x8db2('0x26');})[_0x8db2('0x84')]()[_0x8db2('0x29')]();for(var _0x1aabc5=0x0;_0x1aabc5<_0x4e0834[_0x8db2('0x47')];_0x1aabc5++){if(!_['includes'](_0x412120,_0x4e0834[_0x1aabc5][_0x8db2('0x1f')]))return;var _0x7e4bf=_0x4e0834[_0x1aabc5][_0x8db2('0x1f')]===_0x8db2('0x20')?'Agents':_0x8db2('0x25');_0x39f32c[_0x8db2('0x42')](db[_0x8db2('0x2d')]['create']({'name':_0x4e0834[_0x1aabc5]['name'],'resourceId':_0x4e0834[_0x1aabc5]['id'],'type':_0x7e4bf,'sectionId':_[_0x8db2('0x2b')](_0x105aa6,[_0x8db2('0x2c'),_0x7e4bf])['id']},{}));}return Promise[_0x8db2('0x4d')](_0x39f32c);});})[_0x8db2('0x1e')](respondWithResult(_0x3ad3c7,0xc9))['catch'](handleError(_0x3ad3c7,null));};exports[_0x8db2('0x85')]=function(_0x3a0e7e,_0x27ae31){if(_0x3a0e7e[_0x8db2('0x53')]['id']){delete _0x3a0e7e['body']['id'];}return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x3a0e7e[_0x8db2('0x54')]['id']}})['then'](function(_0x5742c5){if(!_0x5742c5)return null;if(_0x5742c5['id']===_0x3a0e7e['user']['id']){if(!_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x86')]||!_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x87')]){throw new db['Sequelize']['ValidationError'](_0x8db2('0x88'));}if(!_0x5742c5[_0x8db2('0x89')](_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x86')])){throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))]('Wrong\x20credentials');}if(_0x3a0e7e[_0x8db2('0x53')]['oldPassword']===_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x87')]){throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))](_0x8db2('0x8c'));}}else if(_0x3a0e7e['user'][_0x8db2('0x1f')]===_0x8db2('0x24')){if(!_0x3a0e7e['body'][_0x8db2('0x87')]){throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))](_0x8db2('0x8d'));}}else if(_0x3a0e7e['user'][_0x8db2('0x1f')]==='user'){if(!_0x3a0e7e['body'][_0x8db2('0x87')]){throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))](_0x8db2('0x8d'));}if(_0x5742c5[_0x8db2('0x1f')]!==_0x8db2('0x20')){throw new db[(_0x8db2('0x8a'))]['ValidationError'](_0x8db2('0x8e'));}}else{throw new db['Sequelize']['ValidationError'](_0x8db2('0x8e'));}return _0x5742c5;})['then'](handleEntityNotFound(_0x27ae31,null))['then'](function(_0x733211){return db[_0x8db2('0x59')][_0x8db2('0x8f')]({'attributes':['id','securePassword',_0x8db2('0x90'),_0x8db2('0x91')]})[_0x8db2('0x1e')](function(_0x555ed0){if(_0x555ed0[_0x8db2('0x5b')])authService[_0x8db2('0x5c')](_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x87')]);if(!_0x555ed0[_0x8db2('0x90')]||!_0x733211[_0x8db2('0x34')])return _0x733211;authService[_0x8db2('0x92')](_0x3a0e7e[_0x8db2('0x53')]['newPassword'],_0x733211[_0x8db2('0x34')],_0x555ed0[_0x8db2('0x91')]);return _0x733211;})[_0x8db2('0x1e')](saveUpdates({'password':_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x87')],'passwordResetAt':_0x3a0e7e[_0x8db2('0x74')]['id']==_0x3a0e7e[_0x8db2('0x54')]['id']?moment():null,'previousPasswords':authService[_0x8db2('0x93')](_0x3a0e7e[_0x8db2('0x53')][_0x8db2('0x87')],_0x733211[_0x8db2('0x34')])},null));})['then'](respondWithResult(_0x27ae31,null))[_0x8db2('0x4e')](handleError(_0x27ae31,null));};exports[_0x8db2('0x94')]=function(_0x3c65f1,_0x58063b){var _0x4459e8=_0x3c65f1[_0x8db2('0x53')][_0x8db2('0x95')];return db['User']['find']({'where':{'id':_0x3c65f1[_0x8db2('0x54')]['id']},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0x1f'),_0x8db2('0x96'),_0x8db2('0x97'),_0x8db2('0x98'),_0x8db2('0x99')]})[_0x8db2('0x1e')](handleEntityNotFound(_0x58063b,null))[_0x8db2('0x1e')](function(_0x4574e3){if(_0x4574e3){if(!utils['isValidChannel'](_0x4459e8)){throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))]('Unknown\x20channel');}return _0x4574e3[_0x8db2('0x9a')+_[_0x8db2('0x9b')](_0x4459e8[_0x8db2('0x9c')]())+_0x8db2('0x9d')](_0x3c65f1[_0x8db2('0x53')][_0x8db2('0x57')],{'penalty':_0x3c65f1[_0x8db2('0x53')][_0x8db2('0x9e')]||0x0})[_0x8db2('0x9f')](function(_0x255288){for(var _0x33bb3c=0x0;_0x33bb3c<_0x3c65f1['body'][_0x8db2('0x57')][_0x8db2('0x47')];_0x33bb3c+=0x1){var _0x29328c={'UserId':Number(_0x3c65f1[_0x8db2('0x54')]['id'])};_0x29328c[_[_0x8db2('0x9b')](_0x4459e8[_0x8db2('0x9c')]())+'QueueId']=Number(_0x3c65f1[_0x8db2('0x53')][_0x8db2('0x57')][_0x33bb3c]);socket[_0x8db2('0xa0')](_0x8db2('0x74')+_[_0x8db2('0x9b')](_0x4459e8[_0x8db2('0x9c')]())+_0x8db2('0xa1'),_0x29328c);}return _0x255288;})[_0x8db2('0x1e')](function(){if(_0x4459e8===_0x8db2('0xa2')){return db[_0x8db2('0xa3')][_0x8db2('0x43')]({'where':{'id':_0x3c65f1['body']['ids']||[]},'raw':!![],'attributes':['id',_0x8db2('0x2c')]});}})['then'](function(_0xceebe4){var _0xccdab2=_0x4574e3[_0x8db2('0x23')]({'plain':!![]});var _0x4b136a=[];if(_0x4459e8===_0x8db2('0xa2')&&_0xccdab2[_0x8db2('0x1f')]===_0x8db2('0x20')&&_0xccdab2[_0x8db2('0x96')]){for(let _0x54a021=0x0;_0x54a021<_0xceebe4[_0x8db2('0x47')];_0x54a021+=0x1){_0x4b136a[_0x8db2('0x42')]({'membername':_0xccdab2[_0x8db2('0x2c')],'UserId':_0xccdab2['id'],'queue_name':_0xceebe4[_0x54a021]['name'],'VoiceQueueId':_0xceebe4[_0x54a021]['id'],'interface':_[_0x8db2('0x5d')](_0xccdab2[_0x8db2('0x99')])?util[_0x8db2('0xa4')]('SIP/%s',_0xccdab2[_0x8db2('0x2c')]):_0xccdab2[_0x8db2('0x99')],'paused':_0xccdab2[_0x8db2('0x98')]||![],'penalty':_0x3c65f1['body'][_0x8db2('0x9e')]||0x0});}return Promise[_0x8db2('0x4d')](_0x4b136a['map'](function(_0x348e8b){return db[_0x8db2('0xa5')]['upsert'](_0x348e8b);}));}return _0x4574e3;});}})[_0x8db2('0x1e')](respondWithStatusCode(_0x58063b,null))[_0x8db2('0x4e')](handleError(_0x58063b,null));};exports[_0x8db2('0xa6')]=function(_0x547af5,_0x5eb6ba){var _0x2e7a7a,_0x538a7c;return db['User'][_0x8db2('0x2b')]({'where':{'id':_0x547af5[_0x8db2('0x54')]['id']},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0x1f')]})[_0x8db2('0x1e')](handleEntityNotFound(_0x5eb6ba,null))[_0x8db2('0x1e')](function(_0x54d389){if(_0x54d389){_0x2e7a7a=_0x54d389;if(!_0x547af5['query'][_0x8db2('0x95')]||!utils[_0x8db2('0xa7')](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x95')])){throw new db['Sequelize'][(_0x8db2('0x8b'))]('Unknown\x20channel');}return _0x54d389[_0x8db2('0xa8')+_['capitalize'](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x95')][_0x8db2('0x9c')]())+_0x8db2('0x9d')](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x57')]);}})['then'](function(_0x545134){if(_[_0x8db2('0xa9')](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x57')])){for(var _0x4e5c31=0x0;_0x4e5c31<_0x547af5['query'][_0x8db2('0x57')][_0x8db2('0x47')];_0x4e5c31+=0x1){_0x538a7c={'UserId':Number(_0x547af5[_0x8db2('0x54')]['id'])};_0x538a7c[_['capitalize'](_0x547af5['query'][_0x8db2('0x95')][_0x8db2('0x9c')]())+'QueueId']=Number(_0x547af5[_0x8db2('0x3e')][_0x8db2('0x57')][_0x4e5c31]);socket[_0x8db2('0xa0')](_0x8db2('0x74')+_[_0x8db2('0x9b')](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x95')][_0x8db2('0x9c')]())+_0x8db2('0xaa'),_0x538a7c);}}else{_0x538a7c={'UserId':Number(_0x547af5['params']['id'])};_0x538a7c[_['capitalize'](_0x547af5['query'][_0x8db2('0x95')][_0x8db2('0x9c')]())+_0x8db2('0xab')]=Number(_0x547af5[_0x8db2('0x3e')][_0x8db2('0x57')]);socket['emit'](_0x8db2('0x74')+_['capitalize'](_0x547af5[_0x8db2('0x3e')][_0x8db2('0x95')][_0x8db2('0x9c')]())+_0x8db2('0xaa'),_0x538a7c);}return _0x545134;})['then'](function(){if(_0x547af5[_0x8db2('0x3e')]['channel']===_0x8db2('0xa2')){return db[_0x8db2('0xa5')]['destroy']({'where':{'UserId':_0x547af5['params']['id'],'VoiceQueueId':_0x547af5['query'][_0x8db2('0x57')]},'individualHooks':!![]})[_0x8db2('0x1e')](function(){return _0x2e7a7a;});}return _0x2e7a7a;})[_0x8db2('0x1e')](respondWithStatusCode(_0x5eb6ba,null))[_0x8db2('0x4e')](handleError(_0x5eb6ba,null));};exports['addAvatar']=function(_0x42e46a,_0x150b8e){_0x42e46a[_0x8db2('0x53')][_0x8db2('0xac')]=_0x42e46a[_0x8db2('0xad')]['filename'];return db['User'][_0x8db2('0x2b')]({'where':{'id':_0x42e46a[_0x8db2('0x54')]['id']}})['then'](handleEntityNotFound(_0x150b8e,null))[_0x8db2('0x1e')](saveUpdates(_0x42e46a[_0x8db2('0x53')],null))[_0x8db2('0x1e')](respondWithResult(_0x150b8e,null))['catch'](handleError(_0x150b8e,null));};exports[_0x8db2('0xae')]=function(_0x13921b,_0x3e5354){var _0x1a3aac=path[_0x8db2('0xaf')](config[_0x8db2('0xb0')],_0x8db2('0xb1'));return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x13921b[_0x8db2('0x54')]['id']},'attributes':['id',_0x8db2('0xac')],'raw':!![]})[_0x8db2('0x1e')](handleEntityNotFound(_0x3e5354,null))['then'](function(_0x2258d4){if(_0x2258d4){if(_[_0x8db2('0x5d')](_0x2258d4['userpic'])){return _0x3e5354[_0x8db2('0xb2')](_0x1a3aac);}else{if(!fs[_0x8db2('0xb3')](path[_0x8db2('0xaf')](config[_0x8db2('0xb0')],_0x8db2('0xb4'),_0x2258d4[_0x8db2('0xac')]))){return _0x3e5354[_0x8db2('0xb2')](_0x1a3aac);}return _0x3e5354[_0x8db2('0xb2')](path[_0x8db2('0xaf')](config[_0x8db2('0xb0')],_0x8db2('0xb4'),_0x2258d4[_0x8db2('0xac')]));}}})['catch'](handleError(_0x3e5354,null));};exports['getOpenTabs']=function(_0x10e2ee,_0x35354b){return db['User'][_0x8db2('0x2b')]({'where':{'id':_0x10e2ee['params']['id']},'attributes':['id']})[_0x8db2('0x1e')](handleEntityNotFound(_0x35354b,null))[_0x8db2('0x1e')](function(_0x43a323){var _0x2a9cee=[];values=_0x43a323[_0x8db2('0x49')];_0x2a9cee[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x48'),_0x43a323[_0x8db2('0x49')]));_0x2a9cee['push'](get_open_tabs(_0x8db2('0x51'),_0x43a323[_0x8db2('0x49')]));_0x2a9cee[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4c'),_0x43a323['dataValues']));_0x2a9cee[_0x8db2('0x42')](get_open_tabs('whatsapp',_0x43a323[_0x8db2('0x49')]));_0x2a9cee['push'](get_open_tabs(_0x8db2('0x4a'),_0x43a323[_0x8db2('0x49')]));_0x2a9cee[_0x8db2('0x42')](get_open_tabs(_0x8db2('0x4b'),_0x43a323['dataValues']));return Promise[_0x8db2('0x4d')](_0x2a9cee);})[_0x8db2('0x1e')](function(_0x441d4e){if(_0x441d4e){var _0x34876a=_[_0x8db2('0x30')](values[_0x8db2('0xb5')],function(_0x33cfcd){return{'channel':_0x8db2('0xb6'),'id':_0x33cfcd['id'],'createdAt':_0x33cfcd[_0x8db2('0xb7')]};});var _0x5cda91=_['map'](values['FaxOpenTabs'],function(_0x4d4423){return{'channel':_0x8db2('0xb8'),'id':_0x4d4423['id'],'createdAt':_0x4d4423[_0x8db2('0xb7')]};});var _0x42611f=_[_0x8db2('0x30')](values[_0x8db2('0xb9')],function(_0x208b96){return{'channel':_0x8db2('0xba'),'id':_0x208b96['id'],'createdAt':_0x208b96[_0x8db2('0xb7')]};});var _0x4bb49c=_[_0x8db2('0x30')](values[_0x8db2('0xbb')],function(_0x1069d5){return{'channel':_0x8db2('0xbc'),'id':_0x1069d5['id'],'createdAt':_0x1069d5[_0x8db2('0xb7')]};});var _0x34d221=_['map'](values[_0x8db2('0xbd')],function(_0x348c7c){return{'channel':'SMS','id':_0x348c7c['id'],'createdAt':_0x348c7c[_0x8db2('0xb7')]};});var _0x458f18=_['map'](values[_0x8db2('0xbe')],function(_0x48eab1){return{'channel':_0x8db2('0xbf'),'id':_0x48eab1['id'],'createdAt':_0x48eab1[_0x8db2('0xb7')]};});var _0x201d01=_[_0x8db2('0xc0')](_0x34876a,_0x5cda91,_0x42611f,_0x4bb49c,_0x34d221,_0x458f18);var _0x7919b2={'count':_0x201d01[_0x8db2('0x47')],'rows':_0x201d01};return _0x7919b2;}else return null;})[_0x8db2('0x1e')](respondWithResult(_0x35354b,null))['catch'](handleError(_0x35354b,null));};exports['getContacts']=function(_0x67ceb9,_0x5cece6){var _0x32ca4d={};return db['User'][_0x8db2('0x8f')]({'where':{'id':_0x67ceb9['params']['id']}})[_0x8db2('0x1e')](function(_0x2b4b80){if(!_0x2b4b80){throw new APINotFoundError(util[_0x8db2('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x67ceb9[_0x8db2('0x54')]['id']));}return contacts[_0x8db2('0x55')]();})[_0x8db2('0x1e')](function(_0x1ccf93){_0x67ceb9['query'][_0x8db2('0x3b')]=_0x67ceb9[_0x8db2('0x54')]['id'];_0x32ca4d=qs[_0x8db2('0x39')](_0x1ccf93,_0x67ceb9);if(_0x67ceb9[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0x3c'))){_0x32ca4d['include']=[{'model':db[_0x8db2('0xc2')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x8db2('0xc3'),'attributes':['id',_0x8db2('0x2c'),_0x8db2('0xc4')],'where':_0x67ceb9[_0x8db2('0x3e')][_0x8db2('0xc5')]?{'id':_0x67ceb9[_0x8db2('0x3e')][_0x8db2('0xc5')]}:undefined,'required':_0x67ceb9[_0x8db2('0x3e')][_0x8db2('0xc5')]?!![]:![]}];}return contacts['findAll'](_0x67ceb9['query'],_0x67ceb9[_0x8db2('0x74')],_0x32ca4d,_0x1ccf93);})[_0x8db2('0x1e')](respondWithFilteredResult(_0x5cece6,_0x32ca4d))['catch'](APIHandleError(_0x5cece6));};exports[_0x8db2('0xc6')]=function(_0x15bfd9,_0x24ea44){var _0x4ba87d;var _0x412b96={};var _0x58c92e;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x15bfd9[_0x8db2('0x54')]['id']},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0x1f')]})[_0x8db2('0x1e')](handleEntityNotFound(_0x24ea44,null))[_0x8db2('0x1e')](function(_0x237377){if(!utils[_0x8db2('0xa7')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x95')])){throw new db[(_0x8db2('0x8a'))]['ValidationError'](_0x8db2('0xc7'));}_0x4ba87d=_0x237377;var _0x2454bf={};_0x2454bf[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_[_0x8db2('0x9b')](_0x15bfd9['query']['channel'])+_0x8db2('0xca')][_0x8db2('0xcb')]);_0x2454bf[_0x8db2('0x3e')]=_['keys'](_0x15bfd9['query']);_0x2454bf[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x2454bf['model'],_0x2454bf[_0x8db2('0x3e')]);_0x412b96['attributes']=_[_0x8db2('0xcd')](_0x2454bf[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x412b96[_0x8db2('0x41')]=_0x412b96[_0x8db2('0x41')][_0x8db2('0x47')]?_0x412b96[_0x8db2('0x41')]:_0x2454bf[_0x8db2('0xc8')];_0x412b96[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x412b96[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x15bfd9['query'],_0x2454bf[_0x8db2('0xcc')]));if(_0x15bfd9['query'][_0x8db2('0x27')]){_0x412b96[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x412b96[_0x8db2('0x3a')],{'$or':_['map'](_0x412b96[_0x8db2('0x41')],function(_0x390cfe){var _0x1c1581={};_0x1c1581[_0x390cfe]={'$like':'%'+_0x15bfd9['query'][_0x8db2('0x27')]+'%'};return _0x1c1581;})});}_0x412b96=_[_0x8db2('0x4f')]({},_0x412b96,_0x15bfd9['options']);switch(_0x4ba87d[_0x8db2('0x1f')]){case'admin':return db[_[_0x8db2('0x9b')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x95')])+_0x8db2('0xca')][_0x8db2('0x43')](_0x412b96);case _0x8db2('0x74'):case _0x8db2('0x20'):return _0x4ba87d[_0x8db2('0x23')+_[_0x8db2('0x9b')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x95')])+_0x8db2('0x9d')](_0x412b96);default:throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))]('Unknown\x20role');}})[_0x8db2('0x1e')](function(_0x46f1e5){_0x58c92e=_0x46f1e5[_0x8db2('0x47')];if(!_0x15bfd9[_0x8db2('0x3e')]['hasOwnProperty'](_0x8db2('0xd2'))){_0x412b96[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x15bfd9['query'][_0x8db2('0x1a')]);_0x412b96[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x17')]);}switch(_0x4ba87d[_0x8db2('0x1f')]){case _0x8db2('0x24'):return db[_[_0x8db2('0x9b')](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x95')])+_0x8db2('0xca')]['findAll'](_0x412b96);case _0x8db2('0x74'):case _0x8db2('0x20'):return _0x4ba87d[_0x8db2('0x23')+_['capitalize'](_0x15bfd9[_0x8db2('0x3e')][_0x8db2('0x95')])+_0x8db2('0x9d')](_0x412b96);}})['then'](function(_0x2640fe){return{'count':_0x58c92e,'rows':_0x2640fe};})[_0x8db2('0x1e')](respondWithResult(_0x24ea44,null))[_0x8db2('0x4e')](handleError(_0x24ea44,null));};exports[_0x8db2('0xd3')]=function(_0x1717f2,_0x3dcc0c){var _0x1a709d={};var _0x9a07e6={};var _0x5b40e8;var _0x23d162;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x1717f2['params']['id']}})['then'](handleEntityNotFound(_0x3dcc0c,null))[_0x8db2('0x1e')](function(_0x22d9e9){if(_0x22d9e9){_0x5b40e8=_0x22d9e9;_0x9a07e6[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_0x8db2('0xa5')][_0x8db2('0xcb')]);_0x9a07e6[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x1717f2['query']);_0x9a07e6[_0x8db2('0xcc')]=_['intersection'](_0x9a07e6[_0x8db2('0xc8')],_0x9a07e6[_0x8db2('0x3e')]);_0x1a709d['attributes']=_[_0x8db2('0xcd')](_0x9a07e6[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x1717f2['query']['fields']));_0x1a709d[_0x8db2('0x41')]=_0x1a709d['attributes'][_0x8db2('0x47')]?_0x1a709d[_0x8db2('0x41')]:_0x9a07e6['model'];_0x1a709d[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x1717f2['query'][_0x8db2('0xd0')]);_0x1a709d[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x1717f2[_0x8db2('0x3e')],_0x9a07e6[_0x8db2('0xcc')]));if(_0x1717f2['query'][_0x8db2('0x27')]){_0x1a709d['where']=_[_0x8db2('0x4f')](_0x1a709d[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x1a709d[_0x8db2('0x41')],function(_0x36bd52){var _0x162f4c={};_0x162f4c[_0x36bd52]={'$like':'%'+_0x1717f2[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x162f4c;})});}_0x1a709d=_[_0x8db2('0x4f')]({},_0x1a709d,_0x1717f2['options']);return _0x5b40e8['getVoiceQueuesRt'](_0x1a709d);}})[_0x8db2('0x1e')](function(_0x10d68c){if(_0x10d68c){_0x23d162=_0x10d68c['length'];if(!_0x1717f2[_0x8db2('0x3e')]['hasOwnProperty'](_0x8db2('0xd2'))){_0x1a709d[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x1717f2[_0x8db2('0x3e')][_0x8db2('0x1a')]);_0x1a709d[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x1717f2['query'][_0x8db2('0x17')]);}return _0x5b40e8[_0x8db2('0xd3')](_0x1a709d);}})[_0x8db2('0x1e')](function(_0x300f2b){if(_0x300f2b){return _0x300f2b?{'count':_0x23d162,'rows':_0x300f2b}:null;}})[_0x8db2('0x1e')](respondWithResult(_0x3dcc0c,null))[_0x8db2('0x4e')](handleError(_0x3dcc0c,null));};exports['getGroups']=function(_0x344120,_0x117916){var _0x1b2a34={};var _0x10a222={};var _0x466b31;var _0x22b78f;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x344120['params']['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x117916,null))['then'](function(_0x44d094){if(_0x44d094){_0x466b31=_0x44d094;_0x10a222[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db['ChatGroup'][_0x8db2('0xcb')]);_0x10a222['query']=_['keys'](_0x344120['query']);_0x10a222[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x10a222[_0x8db2('0xc8')],_0x10a222[_0x8db2('0x3e')]);_0x1b2a34['attributes']=_[_0x8db2('0xcd')](_0x10a222['model'],qs[_0x8db2('0xce')](_0x344120['query']['fields']));_0x1b2a34[_0x8db2('0x41')]=_0x1b2a34[_0x8db2('0x41')][_0x8db2('0x47')]?_0x1b2a34[_0x8db2('0x41')]:_0x10a222[_0x8db2('0xc8')];_0x1b2a34['order']=qs[_0x8db2('0xd0')](_0x344120['query'][_0x8db2('0xd0')]);_0x1b2a34['where']=qs['filters'](_['pick'](_0x344120['query'],_0x10a222[_0x8db2('0xcc')]));if(_0x344120[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x1b2a34[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x1b2a34[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x1b2a34['attributes'],function(_0x649ce1){var _0x1fd3a9={};_0x1fd3a9[_0x649ce1]={'$like':'%'+_0x344120[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x1fd3a9;})});}_0x1b2a34=_[_0x8db2('0x4f')]({},_0x1b2a34,_0x344120[_0x8db2('0x50')]);return _0x466b31['getGroups'](_0x1b2a34);}})['then'](function(_0x355db9){if(_0x355db9){_0x22b78f=_0x355db9[_0x8db2('0x47')];if(!_0x344120['query']['hasOwnProperty'](_0x8db2('0xd2'))){_0x1b2a34[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x344120['query'][_0x8db2('0x1a')]);_0x1b2a34['offset']=qs[_0x8db2('0x17')](_0x344120['query']['offset']);}return _0x466b31[_0x8db2('0xd4')](_0x1b2a34);}})['then'](function(_0x311a54){if(_0x311a54){return _0x311a54?{'count':_0x22b78f,'rows':_0x311a54}:null;}})['then'](respondWithResult(_0x117916,null))[_0x8db2('0x4e')](handleError(_0x117916,null));};exports[_0x8db2('0xd5')]=function(_0x3a6842,_0x468ca3){var _0x21ea34={'raw':!![],'where':{}};var _0x2e60a8={};var _0x5c747f={'count':0x0,'rows':[]};return db[_0x8db2('0x3b')]['findOne']({'where':{'id':_0x3a6842[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x468ca3,null))['then'](function(_0x5a836f){if(_0x5a836f){_0x2e60a8[_0x8db2('0xc8')]=_['keys'](db[_0x8db2('0xd6')]['rawAttributes']);_0x2e60a8[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x3a6842[_0x8db2('0x3e')]);_0x2e60a8[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x2e60a8[_0x8db2('0xc8')],_0x2e60a8[_0x8db2('0x3e')]);_0x21ea34[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x2e60a8[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x3a6842['query'][_0x8db2('0xce')]));_0x21ea34[_0x8db2('0x41')]=_0x21ea34[_0x8db2('0x41')]['length']?_0x21ea34[_0x8db2('0x41')]:_0x2e60a8[_0x8db2('0xc8')];if(!_0x3a6842[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x21ea34['limit']=qs[_0x8db2('0x1a')](_0x3a6842[_0x8db2('0x3e')]['limit']);_0x21ea34[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x3a6842[_0x8db2('0x3e')][_0x8db2('0x17')]);}_0x21ea34[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x3a6842[_0x8db2('0x3e')]['sort']);_0x21ea34[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x3a6842['query'],_0x2e60a8[_0x8db2('0xcc')]));_0x21ea34['where'][_0x8db2('0xd7')]=_0x5a836f['id'];if(_0x3a6842[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x21ea34[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x21ea34[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x21ea34[_0x8db2('0x41')],function(_0x393768){var _0x52bf8a={};_0x52bf8a[_0x393768]={'$like':'%'+_0x3a6842[_0x8db2('0x3e')]['filter']+'%'};return _0x52bf8a;})});}_0x21ea34=_[_0x8db2('0x4f')]({},_0x21ea34,_0x3a6842[_0x8db2('0x50')]);return db[_0x8db2('0xd6')][_0x8db2('0x19')]({'where':_0x21ea34[_0x8db2('0x3a')]})[_0x8db2('0x1e')](function(_0x15b558){_0x5c747f[_0x8db2('0x19')]=_0x15b558;if(_0x3a6842[_0x8db2('0x3e')]['includeAll']){_0x21ea34[_0x8db2('0x3d')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8db2('0x43')](_0x21ea34);})[_0x8db2('0x1e')](function(_0x10183a){_0x5c747f[_0x8db2('0x44')]=_0x10183a;return _0x5c747f;});}})[_0x8db2('0x1e')](respondWithFilteredResult(_0x468ca3,_0x21ea34))[_0x8db2('0x4e')](handleError(_0x468ca3,null));};exports[_0x8db2('0xd8')]=function(_0x2219a1,_0x3fecef){var _0x35cf19={'raw':!![],'where':{}};var _0x588b2f={};var _0x1899f6={'count':0x0,'rows':[]};return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x2219a1[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x3fecef,null))[_0x8db2('0x1e')](function(_0x152fd6){if(_0x152fd6){_0x588b2f['model']=_[_0x8db2('0xc9')](db[_0x8db2('0xd9')][_0x8db2('0xcb')]);_0x588b2f[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x2219a1[_0x8db2('0x3e')]);_0x588b2f[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x588b2f[_0x8db2('0xc8')],_0x588b2f[_0x8db2('0x3e')]);_0x35cf19[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x588b2f[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x2219a1['query']['fields']));_0x35cf19[_0x8db2('0x41')]=_0x35cf19[_0x8db2('0x41')][_0x8db2('0x47')]?_0x35cf19[_0x8db2('0x41')]:_0x588b2f[_0x8db2('0xc8')];if(!_0x2219a1[_0x8db2('0x3e')][_0x8db2('0xc1')]('nolimit')){_0x35cf19[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x2219a1['query'][_0x8db2('0x1a')]);_0x35cf19[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x2219a1[_0x8db2('0x3e')][_0x8db2('0x17')]);}_0x35cf19[_0x8db2('0xcf')]=qs['sort'](_0x2219a1[_0x8db2('0x3e')]['sort']);_0x35cf19['where']=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x2219a1[_0x8db2('0x3e')],_0x588b2f[_0x8db2('0xcc')]));_0x35cf19[_0x8db2('0x3a')][_0x8db2('0xd7')]=_0x152fd6['id'];if(_0x2219a1[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x35cf19[_0x8db2('0x3a')]=_['merge'](_0x35cf19[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x35cf19[_0x8db2('0x41')],function(_0x307921){var _0x4fc94a={};_0x4fc94a[_0x307921]={'$like':'%'+_0x2219a1[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x4fc94a;})});}_0x35cf19=_[_0x8db2('0x4f')]({},_0x35cf19,_0x2219a1[_0x8db2('0x50')]);return db[_0x8db2('0xd9')]['count']({'where':_0x35cf19[_0x8db2('0x3a')]})[_0x8db2('0x1e')](function(_0x17075f){_0x1899f6['count']=_0x17075f;if(_0x2219a1['query'][_0x8db2('0x3c')]){_0x35cf19[_0x8db2('0x3d')]=[{'all':!![]}];}return db[_0x8db2('0xd9')][_0x8db2('0x43')](_0x35cf19);})['then'](function(_0x2c897d){_0x1899f6[_0x8db2('0x44')]=_0x2c897d;return _0x1899f6;});}})[_0x8db2('0x1e')](respondWithFilteredResult(_0x3fecef,_0x35cf19))[_0x8db2('0x4e')](handleError(_0x3fecef,null));};exports['getChatInteractions']=function(_0x5c82fb,_0x192fd1){var _0x3b898b={};var _0x8fbe40={};var _0x54cbb0;var _0x449052;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x5c82fb['params']['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x192fd1,null))[_0x8db2('0x1e')](function(_0x20919c){if(_0x20919c){_0x54cbb0=_0x20919c;_0x8fbe40[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_0x8db2('0xda')][_0x8db2('0xcb')]);_0x8fbe40[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x5c82fb[_0x8db2('0x3e')]);_0x8fbe40[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x8fbe40[_0x8db2('0xc8')],_0x8fbe40[_0x8db2('0x3e')]);_0x3b898b[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x8fbe40[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x5c82fb[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x3b898b[_0x8db2('0x41')]=_0x3b898b[_0x8db2('0x41')][_0x8db2('0x47')]?_0x3b898b[_0x8db2('0x41')]:_0x8fbe40[_0x8db2('0xc8')];_0x3b898b['order']=qs[_0x8db2('0xd0')](_0x5c82fb[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x3b898b[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_['pick'](_0x5c82fb[_0x8db2('0x3e')],_0x8fbe40['filters']));if(_0x5c82fb['query']['filter']){_0x3b898b[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x3b898b[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x3b898b[_0x8db2('0x41')],function(_0x47dce2){var _0x2f1087={};_0x2f1087[_0x47dce2]={'$like':'%'+_0x5c82fb['query']['filter']+'%'};return _0x2f1087;})});}_0x3b898b=_[_0x8db2('0x4f')]({},_0x3b898b,_0x5c82fb[_0x8db2('0x50')]);return _0x54cbb0['getChatInteractions'](_0x3b898b);}})[_0x8db2('0x1e')](function(_0x3832f3){if(_0x3832f3){_0x449052=_0x3832f3[_0x8db2('0x47')];if(!_0x5c82fb['query'][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x3b898b[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x5c82fb['query'][_0x8db2('0x1a')]);_0x3b898b[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x5c82fb['query'][_0x8db2('0x17')]);}return _0x54cbb0['getChatInteractions'](_0x3b898b);}})['then'](function(_0x4b8c64){if(_0x4b8c64){return _0x4b8c64?{'count':_0x449052,'rows':_0x4b8c64}:null;}})[_0x8db2('0x1e')](respondWithResult(_0x192fd1,null))['catch'](handleError(_0x192fd1,null));};exports['getOpenchannelInteractions']=function(_0x30301c,_0x588b06){var _0x156be9={};var _0x281dc4={};var _0x491d58;var _0x114239;return db['User']['findOne']({'where':{'id':_0x30301c['params']['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x588b06,null))[_0x8db2('0x1e')](function(_0x3b976b){if(_0x3b976b){_0x491d58=_0x3b976b;_0x281dc4[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_0x8db2('0xdb')]['rawAttributes']);_0x281dc4[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x30301c[_0x8db2('0x3e')]);_0x281dc4['filters']=_[_0x8db2('0xcd')](_0x281dc4[_0x8db2('0xc8')],_0x281dc4[_0x8db2('0x3e')]);_0x156be9[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x281dc4[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x30301c[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x156be9['attributes']=_0x156be9[_0x8db2('0x41')][_0x8db2('0x47')]?_0x156be9[_0x8db2('0x41')]:_0x281dc4[_0x8db2('0xc8')];_0x156be9[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x30301c['query']['sort']);_0x156be9[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x30301c[_0x8db2('0x3e')],_0x281dc4[_0x8db2('0xcc')]));if(_0x30301c['query'][_0x8db2('0x27')]){_0x156be9['where']=_['merge'](_0x156be9['where'],{'$or':_['map'](_0x156be9['attributes'],function(_0x1d6f04){var _0x2ef6ba={};_0x2ef6ba[_0x1d6f04]={'$like':'%'+_0x30301c[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x2ef6ba;})});}_0x156be9=_['merge']({},_0x156be9,_0x30301c[_0x8db2('0x50')]);return _0x491d58[_0x8db2('0xdc')](_0x156be9);}})['then'](function(_0x131964){if(_0x131964){_0x114239=_0x131964[_0x8db2('0x47')];if(!_0x30301c[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x156be9['limit']=qs['limit'](_0x30301c['query'][_0x8db2('0x1a')]);_0x156be9[_0x8db2('0x17')]=qs['offset'](_0x30301c['query']['offset']);}return _0x491d58[_0x8db2('0xdc')](_0x156be9);}})[_0x8db2('0x1e')](function(_0x59035c){if(_0x59035c){return _0x59035c?{'count':_0x114239,'rows':_0x59035c}:null;}})['then'](respondWithResult(_0x588b06,null))[_0x8db2('0x4e')](handleError(_0x588b06,null));};exports[_0x8db2('0xdd')]=function(_0x296b5f,_0x4f9527){var _0x3b7c68={'raw':!![],'where':{}};var _0xf9e596={};var _0x290924={'count':0x0,'rows':[]};return db['User'][_0x8db2('0x8f')]({'where':{'id':_0x296b5f[_0x8db2('0x54')]['id']}})['then'](handleEntityNotFound(_0x4f9527,null))[_0x8db2('0x1e')](function(_0x56342e){if(_0x56342e){_0xf9e596[_0x8db2('0xc8')]=_['keys'](db[_0x8db2('0xde')][_0x8db2('0xcb')]);_0xf9e596[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x296b5f[_0x8db2('0x3e')]);_0xf9e596[_0x8db2('0xcc')]=_['intersection'](_0xf9e596['model'],_0xf9e596[_0x8db2('0x3e')]);_0x3b7c68[_0x8db2('0x41')]=_['intersection'](_0xf9e596['model'],qs[_0x8db2('0xce')](_0x296b5f['query'][_0x8db2('0xce')]));_0x3b7c68[_0x8db2('0x41')]=_0x3b7c68['attributes'][_0x8db2('0x47')]?_0x3b7c68['attributes']:_0xf9e596[_0x8db2('0xc8')];if(!_0x296b5f[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x3b7c68[_0x8db2('0x1a')]=qs['limit'](_0x296b5f[_0x8db2('0x3e')]['limit']);_0x3b7c68[_0x8db2('0x17')]=qs['offset'](_0x296b5f[_0x8db2('0x3e')][_0x8db2('0x17')]);}_0x3b7c68[_0x8db2('0xcf')]=qs['sort'](_0x296b5f[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x3b7c68[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x296b5f[_0x8db2('0x3e')],_0xf9e596[_0x8db2('0xcc')]));_0x3b7c68[_0x8db2('0x3a')]['UserId']=_0x56342e['id'];if(_0x296b5f[_0x8db2('0x3e')]['filter']){_0x3b7c68[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x3b7c68[_0x8db2('0x3a')],{'$or':_['map'](_0x3b7c68[_0x8db2('0x41')],function(_0x22a89f){var _0x43730e={};_0x43730e[_0x22a89f]={'$like':'%'+_0x296b5f[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x43730e;})});}_0x3b7c68=_['merge']({},_0x3b7c68,_0x296b5f[_0x8db2('0x50')]);return db['MailInteraction'][_0x8db2('0x19')]({'where':_0x3b7c68[_0x8db2('0x3a')]})[_0x8db2('0x1e')](function(_0x7e3154){_0x290924['count']=_0x7e3154;if(_0x296b5f['query'][_0x8db2('0x3c')]){_0x3b7c68[_0x8db2('0x3d')]=[{'all':!![]}];}return db[_0x8db2('0xde')][_0x8db2('0x43')](_0x3b7c68);})[_0x8db2('0x1e')](function(_0x77f525){_0x290924['rows']=_0x77f525;return _0x290924;});}})[_0x8db2('0x1e')](respondWithFilteredResult(_0x4f9527,_0x3b7c68))[_0x8db2('0x4e')](handleError(_0x4f9527,null));};exports[_0x8db2('0xdf')]=function(_0x4b9ca1,_0x2321fe){var _0x1c208a={};var _0xebfa55={};var _0x1d5ade;var _0xa312fb;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x4b9ca1['params']['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x2321fe,null))[_0x8db2('0x1e')](function(_0x3e9989){if(_0x3e9989){_0x1d5ade=_0x3e9989;_0xebfa55[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db['SmsInteraction'][_0x8db2('0xcb')]);_0xebfa55[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x4b9ca1[_0x8db2('0x3e')]);_0xebfa55[_0x8db2('0xcc')]=_['intersection'](_0xebfa55[_0x8db2('0xc8')],_0xebfa55[_0x8db2('0x3e')]);_0x1c208a[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0xebfa55[_0x8db2('0xc8')],qs['fields'](_0x4b9ca1['query'][_0x8db2('0xce')]));_0x1c208a[_0x8db2('0x41')]=_0x1c208a[_0x8db2('0x41')][_0x8db2('0x47')]?_0x1c208a[_0x8db2('0x41')]:_0xebfa55[_0x8db2('0xc8')];_0x1c208a['order']=qs['sort'](_0x4b9ca1[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x1c208a['where']=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x4b9ca1[_0x8db2('0x3e')],_0xebfa55['filters']));if(_0x4b9ca1[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x1c208a[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x1c208a[_0x8db2('0x3a')],{'$or':_['map'](_0x1c208a[_0x8db2('0x41')],function(_0x1203cc){var _0x4c7b8a={};_0x4c7b8a[_0x1203cc]={'$like':'%'+_0x4b9ca1[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x4c7b8a;})});}_0x1c208a=_[_0x8db2('0x4f')]({},_0x1c208a,_0x4b9ca1[_0x8db2('0x50')]);return _0x1d5ade[_0x8db2('0xdf')](_0x1c208a);}})[_0x8db2('0x1e')](function(_0x496b32){if(_0x496b32){_0xa312fb=_0x496b32['length'];if(!_0x4b9ca1[_0x8db2('0x3e')][_0x8db2('0xc1')]('nolimit')){_0x1c208a[_0x8db2('0x1a')]=qs['limit'](_0x4b9ca1['query']['limit']);_0x1c208a[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x4b9ca1['query']['offset']);}return _0x1d5ade[_0x8db2('0xdf')](_0x1c208a);}})[_0x8db2('0x1e')](function(_0x3c9af5){if(_0x3c9af5){return _0x3c9af5?{'count':_0xa312fb,'rows':_0x3c9af5}:null;}})['then'](respondWithResult(_0x2321fe,null))['catch'](handleError(_0x2321fe,null));};exports[_0x8db2('0xe0')]=function(_0x536327,_0x3d0634){var _0x4acf41={};var _0x2af573={};var _0x45dff5;var _0x5a459d;return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x536327[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x3d0634,null))[_0x8db2('0x1e')](function(_0x19acba){if(_0x19acba){_0x45dff5=_0x19acba;_0x2af573[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_0x8db2('0xe1')][_0x8db2('0xcb')]);_0x2af573[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0x536327['query']);_0x2af573[_0x8db2('0xcc')]=_['intersection'](_0x2af573[_0x8db2('0xc8')],_0x2af573[_0x8db2('0x3e')]);_0x4acf41['attributes']=_['intersection'](_0x2af573[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x536327[_0x8db2('0x3e')]['fields']));_0x4acf41['attributes']=_0x4acf41[_0x8db2('0x41')][_0x8db2('0x47')]?_0x4acf41[_0x8db2('0x41')]:_0x2af573[_0x8db2('0xc8')];_0x4acf41[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x536327['query'][_0x8db2('0xd0')]);_0x4acf41[_0x8db2('0x3a')]=qs['filters'](_['pick'](_0x536327[_0x8db2('0x3e')],_0x2af573['filters']));if(_0x536327[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x4acf41[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x4acf41[_0x8db2('0x3a')],{'$or':_['map'](_0x4acf41[_0x8db2('0x41')],function(_0x4926dd){var _0x473f38={};_0x473f38[_0x4926dd]={'$like':'%'+_0x536327[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x473f38;})});}_0x4acf41=_[_0x8db2('0x4f')]({},_0x4acf41,_0x536327[_0x8db2('0x50')]);return _0x45dff5[_0x8db2('0xe0')](_0x4acf41);}})[_0x8db2('0x1e')](function(_0xd170f2){if(_0xd170f2){_0x5a459d=_0xd170f2[_0x8db2('0x47')];if(!_0x536327[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x4acf41[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0x536327[_0x8db2('0x3e')][_0x8db2('0x1a')]);_0x4acf41[_0x8db2('0x17')]=qs[_0x8db2('0x17')](_0x536327['query'][_0x8db2('0x17')]);}return _0x45dff5['getFaxInteractions'](_0x4acf41);}})['then'](function(_0x388373){if(_0x388373){return _0x388373?{'count':_0x5a459d,'rows':_0x388373}:null;}})[_0x8db2('0x1e')](respondWithResult(_0x3d0634,null))[_0x8db2('0x4e')](handleError(_0x3d0634,null));};exports['getWhatsappInteractions']=function(_0xd2f129,_0x38d4db){var _0x30a243={};var _0x2012fe={};var _0x1847ef;var _0x49e712;return db[_0x8db2('0x3b')]['findOne']({'where':{'id':_0xd2f129[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x38d4db,null))[_0x8db2('0x1e')](function(_0x4a9e28){if(_0x4a9e28){_0x1847ef=_0x4a9e28;_0x2012fe[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db['WhatsappInteraction'][_0x8db2('0xcb')]);_0x2012fe[_0x8db2('0x3e')]=_['keys'](_0xd2f129['query']);_0x2012fe[_0x8db2('0xcc')]=_[_0x8db2('0xcd')](_0x2012fe[_0x8db2('0xc8')],_0x2012fe[_0x8db2('0x3e')]);_0x30a243[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x2012fe[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0xd2f129['query'][_0x8db2('0xce')]));_0x30a243[_0x8db2('0x41')]=_0x30a243['attributes']['length']?_0x30a243['attributes']:_0x2012fe['model'];_0x30a243[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0xd2f129[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x30a243['where']=qs['filters'](_[_0x8db2('0xd1')](_0xd2f129[_0x8db2('0x3e')],_0x2012fe['filters']));if(_0xd2f129[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x30a243['where']=_['merge'](_0x30a243[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x30a243[_0x8db2('0x41')],function(_0x58a24e){var _0x3119ed={};_0x3119ed[_0x58a24e]={'$like':'%'+_0xd2f129[_0x8db2('0x3e')]['filter']+'%'};return _0x3119ed;})});}_0x30a243=_['merge']({},_0x30a243,_0xd2f129[_0x8db2('0x50')]);return _0x1847ef[_0x8db2('0xe2')](_0x30a243);}})[_0x8db2('0x1e')](function(_0x3d0d1d){if(_0x3d0d1d){_0x49e712=_0x3d0d1d['length'];if(!_0xd2f129[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x30a243[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0xd2f129[_0x8db2('0x3e')]['limit']);_0x30a243['offset']=qs[_0x8db2('0x17')](_0xd2f129[_0x8db2('0x3e')]['offset']);}return _0x1847ef[_0x8db2('0xe2')](_0x30a243);}})[_0x8db2('0x1e')](function(_0x4eb155){if(_0x4eb155){return _0x4eb155?{'count':_0x49e712,'rows':_0x4eb155}:null;}})[_0x8db2('0x1e')](respondWithResult(_0x38d4db,null))[_0x8db2('0x4e')](handleError(_0x38d4db,null));};exports[_0x8db2('0xe3')]=function(_0x47b7e1,_0xdb1fe2,_0x353c57){var _0x109d88;var _0xbbfb85;var _0x3aefb9;var _0x47b3ea=!_[_0x8db2('0x5d')](_0x47b7e1[_0x8db2('0x54')]['id'])?_0x47b7e1[_0x8db2('0x54')]['id']:!_[_0x8db2('0x5d')](_0x47b7e1[_0x8db2('0x74')]['id'])?_0x47b7e1[_0x8db2('0x74')]['id']:null;return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x47b3ea,'role':{'$or':[_0x8db2('0x24'),'user',_0x8db2('0x20')]}},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0xe4'),_0x8db2('0xe5'),_0x8db2('0x1f'),_0x8db2('0x58'),_0x8db2('0x97')]})['then'](function(_0x203e0b){if(_0x203e0b){if(_0x203e0b[_0x8db2('0x1f')]==='agent'){_0x109d88=_0x203e0b;if(_0x47b7e1[_0x8db2('0x53')][_0x8db2('0x99')]){_0x3aefb9=util[_0x8db2('0xa4')](_0x8db2('0xe6'),_0x109d88[_0x47b7e1['body'][_0x8db2('0x99')]]);}else if(_0x47b7e1[_0x8db2('0x53')][_0x8db2('0xe7')]){_0x3aefb9=util[_0x8db2('0xa4')](_0x8db2('0xe8'),_0x47b7e1['body'][_0x8db2('0xe7')]);}else{_0x3aefb9=util['format'](_0x8db2('0xe8'),_0x109d88[_0x8db2('0x2c')]);}socket['to'](util[_0x8db2('0xa4')](_0x8db2('0xe9'),_0x109d88[_0x8db2('0x2c')]))[_0x8db2('0xa0')](_0x8db2('0xea'),{'user':{'id':_0x109d88['id'],'name':_0x109d88[_0x8db2('0x2c')]},'ip':_0x47b7e1[_0x8db2('0xeb')]['x-forwarded-for']||_0x47b7e1[_0x8db2('0xec')][_0x8db2('0xed')]||_0x47b7e1[_0x8db2('0xee')]['remoteAddress']||_0x47b7e1['connection'][_0x8db2('0xee')][_0x8db2('0xed')]});return db[_0x8db2('0xa5')][_0x8db2('0x22')]({'where':{'membername':_0x109d88[_0x8db2('0x2c')]},'individualHooks':!![]});}}else{throw new db[(_0x8db2('0x8a'))][(_0x8db2('0x8b'))](_0x8db2('0xef'));}})[_0x8db2('0x1e')](function(){if(_0x109d88){return _0x109d88[_0x8db2('0xf0')]({'raw':!![]});}})[_0x8db2('0x1e')](function(_0x372cfe){if(_0x109d88){if(_0x372cfe){_0xbbfb85=_0x372cfe;if(_0xbbfb85[_0x8db2('0x47')]){var _0x40e91c=_0xbbfb85[_0x8db2('0x30')](function(_0xc37922){var _0x409b35={'membername':_0x109d88[_0x8db2('0x2c')],'UserId':_0x109d88['id'],'queue_name':_0xc37922[_0x8db2('0x2c')],'VoiceQueueId':_0xc37922['id'],'interface':_0x3aefb9,'paused':_0x109d88[_0x8db2('0x97')]||![],'penalty':_0xc37922[_0x8db2('0xf1')]||0x0};return db[_0x8db2('0xa5')]['upsert'](_0x409b35);});return Promise['all'](_0x40e91c);}}}})[_0x8db2('0x1e')](function(){if(_0x109d88){return db[_0x8db2('0xf2')][_0x8db2('0x43')]({'where':{'membername':_0x109d88[_0x8db2('0x2c')],'exitAt':null}});}})[_0x8db2('0x1e')](function(_0x3d55fc){if(_0x109d88){var _0x4fb703=[];_0x3d55fc[_0x8db2('0xf3')](function(_0x4a75fc){_0x4fb703['push'](_0x4a75fc['update']({'exitAt':moment()[_0x8db2('0xa4')](_0x8db2('0xf4'))}));});return Promise[_0x8db2('0x4d')](_0x4fb703);}})['then'](function(){if(_0x109d88){var _0x253bcf=[];var _0x17c4f0=[];var _0x533f48=utils[_0x8db2('0xf5')]();var _0x30ad42={'membername':_0x109d88['name'],'interface':_0x3aefb9,'enterAt':moment()[_0x8db2('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x109d88[_0x8db2('0x1f')],'internal':_0x109d88['internal']};_0x533f48[_0x8db2('0xf3')](function(_0x262227){_0x253bcf[_0x8db2('0x42')](_[_0x8db2('0x4f')]({'channel':_0x262227,'type':_0x8db2('0xf6'),'data1':_0x47b7e1[_0x8db2('0x53')]['device'],'data2':_0x3aefb9},_0x30ad42));if(_0x109d88[_0x8db2('0x97')]){_0x17c4f0[_0x8db2('0x42')](_[_0x8db2('0x4f')]({'channel':_0x262227,'type':_0x8db2('0xf7'),'data1':'LOGININPAUSE'},_0x30ad42));}});return db[_0x8db2('0xf2')][_0x8db2('0x7e')](_0x253bcf[_0x8db2('0xc0')](_0x17c4f0),{'individualHooks':!![]});}})[_0x8db2('0x1e')](function(){if(_0x109d88){return _0x109d88[_0x8db2('0x1d')]({'online':!![],'lastLoginAt':moment()[_0x8db2('0xa4')](_0x8db2('0xf4')),'voicePause':_0x109d88[_0x8db2('0x97')]||![],'mailPause':_0x109d88[_0x8db2('0x97')]||![],'chatPause':_0x109d88['loginInPause']||![],'faxPause':_0x109d88[_0x8db2('0x97')]||![],'smsPause':_0x109d88[_0x8db2('0x97')]||![],'openchannelPause':_0x109d88[_0x8db2('0x97')]||![],'whatsappPause':_0x109d88[_0x8db2('0x97')]||![],'pauseType':_0x109d88['loginInPause']?_0x8db2('0xf8'):null,'interface':_0x3aefb9,'lastPauseAt':moment()[_0x8db2('0xa4')](_0x8db2('0xf4'))});}})[_0x8db2('0x1e')](function(_0x23130e){if(_0x47b7e1['isMiddleware']){return _0x353c57();}else{return Promise[_0x8db2('0xf9')](_0x23130e)[_0x8db2('0x1e')](respondWithResult(_0xdb1fe2,null));}})[_0x8db2('0x4e')](handleError(_0xdb1fe2,null));};exports[_0x8db2('0xfa')]=function(_0x1cdf5b,_0x199ebe){var _0x3e5b55;return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x1cdf5b['params']['id'],'role':_0x8db2('0x20')},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0x1f')]})[_0x8db2('0x1e')](handleEntityNotFound(_0x199ebe,null))[_0x8db2('0x1e')](function(_0x357f9a){if(_0x357f9a){_0x3e5b55=_0x357f9a;return db[_0x8db2('0xa5')][_0x8db2('0x22')]({'where':{'membername':_0x3e5b55[_0x8db2('0x2c')]},'individualHooks':!![]});}})[_0x8db2('0x1e')](function(){return db[_0x8db2('0xf2')][_0x8db2('0x43')]({'where':{'membername':_0x3e5b55[_0x8db2('0x2c')],'exitAt':null}});})[_0x8db2('0x1e')](function(_0x368f6c){var _0x395bc7=[];_0x368f6c[_0x8db2('0xf3')](function(_0x21a0e2){_0x395bc7[_0x8db2('0x42')](_0x21a0e2[_0x8db2('0x1d')]({'exitAt':moment()[_0x8db2('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x8db2('0x4d')](_0x395bc7);})[_0x8db2('0x1e')](function(){return _0x3e5b55[_0x8db2('0x1d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8db2('0x1e')](respondWithResult(_0x199ebe,null))[_0x8db2('0x4e')](handleError(_0x199ebe,null));};exports[_0x8db2('0xfb')]=function(_0xf1f7c6,_0x411734){var _0x40f18d;return db[_0x8db2('0xa5')]['update']({'paused':0x1},{'where':{'UserId':_0xf1f7c6[_0x8db2('0x54')]['id']},'individualHooks':!![]})[_0x8db2('0x1e')](function(){return db['User'][_0x8db2('0x2b')]({'where':{'id':_0xf1f7c6[_0x8db2('0x54')]['id'],'role':'agent'},'attributes':['id','name',_0x8db2('0x1f'),_0x8db2('0x58'),_0x8db2('0x99'),_0x8db2('0x96')]});})[_0x8db2('0x1e')](handleEntityNotFound(_0x411734,null))[_0x8db2('0x1e')](function(_0x5bab9c){if(_0x5bab9c){_0x40f18d=_0x5bab9c;return db['MemberReport'][_0x8db2('0x43')]({'where':{'membername':_0x40f18d[_0x8db2('0x2c')],'type':_0x8db2('0xf7'),'exitAt':null}});}})[_0x8db2('0x1e')](function(_0xdb5aaf){if(_0xdb5aaf[_0x8db2('0x47')]){var _0x38f483=moment()[_0x8db2('0xa4')](_0x8db2('0xf4'));for(var _0x134647=0x0,_0x2822ec=_0xdb5aaf['length'];_0x134647<_0x2822ec;_0x134647++){_0xdb5aaf[_0x134647][_0x8db2('0xfc')]({'exitAt':_0x38f483});}}})[_0x8db2('0x1e')](function(){var _0x55e0b9=[];var _0x11584f=utils[_0x8db2('0xf5')]();_0x11584f['forEach'](function(_0x48bce3){_0x55e0b9[_0x8db2('0x42')]({'channel':_0x48bce3,'membername':_0x40f18d[_0x8db2('0x2c')],'interface':_[_0x8db2('0x5d')](_0x40f18d[_0x8db2('0x99')])?util[_0x8db2('0xa4')](_0x8db2('0xe8'),_0x40f18d['name']):_0x40f18d[_0x8db2('0x99')],'type':_0x8db2('0xf7'),'enterAt':moment()[_0x8db2('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xf1f7c6[_0x8db2('0x53')][_0x8db2('0xfd')]||_0x8db2('0xfe'),'role':_0x40f18d['role'],'internal':_0x40f18d[_0x8db2('0x58')]});});return db['MemberReport'][_0x8db2('0x7e')](_0x55e0b9,{'individualHooks':!![]});})[_0x8db2('0x1e')](function(){return _0x40f18d[_0x8db2('0x1d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xf1f7c6[_0x8db2('0x53')][_0x8db2('0xfd')]||_0x8db2('0xfe'),'lastPauseAt':moment()[_0x8db2('0xa4')](_0x8db2('0xf4'))});})[_0x8db2('0x1e')](respondWithResult(_0x411734,null))[_0x8db2('0x4e')](handleError(_0x411734,null));};exports['unpause']=function(_0x1a4f83,_0x5aad57){if(_0x1a4f83['body'][_0x8db2('0x95')]&&!utils[_0x8db2('0xa7')](_0x1a4f83['body'][_0x8db2('0x95')])){throw new APIBadRequestError(util[_0x8db2('0xa4')](_0x8db2('0xff'),_0x1a4f83[_0x8db2('0x53')][_0x8db2('0x95')]));}return db[_0x8db2('0x3b')][_0x8db2('0x2b')]({'where':{'id':_0x1a4f83['params']['id']},'attributes':['id',_0x8db2('0x2c'),_0x8db2('0x1f'),'internal',_0x8db2('0x99'),'online',_0x8db2('0x98'),_0x8db2('0x100'),_0x8db2('0x101'),_0x8db2('0x102'),_0x8db2('0x103'),_0x8db2('0x104'),_0x8db2('0x105'),_0x8db2('0x106'),'lastPauseAt']})['then'](function(_0x4245c2){if(!_0x4245c2){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x1a4f83[_0x8db2('0x54')]['id']));}return _0x4245c2['unpause'](_0x1a4f83[_0x8db2('0x53')][_0x8db2('0x95')]);})[_0x8db2('0x1e')](respondWithResult(_0x5aad57,null))[_0x8db2('0x4e')](APIHandleError(_0x5aad57));};exports[_0x8db2('0x107')]=function(_0xc2662e,_0x5695f6){var _0x7ba990={};var _0x9d77c4={};var _0x439e54;var _0x23e5a0;return db['User'][_0x8db2('0x8f')]({'where':{'id':_0xc2662e[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x5695f6,null))[_0x8db2('0x1e')](function(_0x260674){if(_0x260674){_0x439e54=_0x260674;_0x9d77c4['model']=_[_0x8db2('0xc9')](db[_0x8db2('0x108')][_0x8db2('0xcb')]);_0x9d77c4[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0xc2662e[_0x8db2('0x3e')]);_0x9d77c4['filters']=_[_0x8db2('0xcd')](_0x9d77c4['model'],_0x9d77c4[_0x8db2('0x3e')]);_0x7ba990[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x9d77c4[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0xc2662e[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x7ba990[_0x8db2('0x41')]=_0x7ba990[_0x8db2('0x41')][_0x8db2('0x47')]?_0x7ba990[_0x8db2('0x41')]:_0x9d77c4['model'];_0x7ba990[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0xc2662e[_0x8db2('0x3e')][_0x8db2('0xd0')]);_0x7ba990[_0x8db2('0x3a')]=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0xc2662e[_0x8db2('0x3e')],_0x9d77c4['filters']));if(_0xc2662e[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x7ba990[_0x8db2('0x3a')]=_['merge'](_0x7ba990['where'],{'$or':_['map'](_0x7ba990[_0x8db2('0x41')],function(_0x4e2151){var _0x1a66c8={};_0x1a66c8[_0x4e2151]={'$like':'%'+_0xc2662e[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x1a66c8;})});}_0x7ba990=_[_0x8db2('0x4f')]({},_0x7ba990,_0xc2662e[_0x8db2('0x50')]);return _0x439e54['getTeams'](_0x7ba990);}})['then'](function(_0x90ffdf){if(_0x90ffdf){_0x23e5a0=_0x90ffdf[_0x8db2('0x47')];if(!_0xc2662e[_0x8db2('0x3e')][_0x8db2('0xc1')](_0x8db2('0xd2'))){_0x7ba990[_0x8db2('0x1a')]=qs[_0x8db2('0x1a')](_0xc2662e[_0x8db2('0x3e')][_0x8db2('0x1a')]);_0x7ba990['offset']=qs[_0x8db2('0x17')](_0xc2662e[_0x8db2('0x3e')][_0x8db2('0x17')]);}return _0x439e54[_0x8db2('0x107')](_0x7ba990);}})[_0x8db2('0x1e')](function(_0x4c63b7){if(_0x4c63b7){return _0x4c63b7?{'count':_0x23e5a0,'rows':_0x4c63b7}:null;}})['then'](respondWithResult(_0x5695f6,null))[_0x8db2('0x4e')](handleError(_0x5695f6,null));};exports[_0x8db2('0x109')]=function(_0x17aa30,_0x24ce04){var _0x31edcc=_0x17aa30[_0x8db2('0x54')]['id'];var _0x23769d=_0x17aa30['body']?_0x17aa30[_0x8db2('0x53')][_0x8db2('0x57')]:null;var _0x159a21=[];return Promise[_0x8db2('0xf9')]()[_0x8db2('0x1e')](function(){if(!_0x23769d)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x8db2('0x1e')](function(){return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x31edcc}});})[_0x8db2('0x1e')](function(_0x11bc22){if(!_0x11bc22)throw new APINotFoundError(util['format'](_0x8db2('0x10a'),_0x17aa30['params']['id']));return db[_0x8db2('0x5f')][_0x8db2('0x10b')](function(_0x3f6d59){return _0x11bc22[_0x8db2('0x109')](_0x23769d,{'transaction':_0x3f6d59})['then'](function(){return db[_0x8db2('0x108')]['findAll']({'where':{'id':{'$in':_0x23769d}}});})[_0x8db2('0x1e')](function(_0x1ceba2){var _0x4c3a5e=_[_0x8db2('0x30')](_0x1ceba2,function(_0x5e9218){return _0x5e9218[_0x8db2('0x10c')]();});return Promise[_0x8db2('0x4d')](_0x4c3a5e);})['then'](function(_0x206e34){_0x159a21=_[_0x8db2('0x10d')](_0x206e34);var _0x5b7172=_['map'](_0x159a21,function(_0x4684c3){return _0x4684c3[_0x8db2('0x10e')](_0x11bc22['id'],{'transaction':_0x3f6d59});});return Promise[_0x8db2('0x4d')](_0x5b7172);})[_0x8db2('0x1e')](function(){if(!_0x11bc22[_0x8db2('0x96')])return;var _0x4d7d66=_[_0x8db2('0x27')](_0x159a21,function(_0xe293f5){return _0xe293f5[_0x8db2('0x10f')](_0x8db2('0x95'))===_0x8db2('0x110');});var _0x53eb1a=_[_0x8db2('0x30')](_0x4d7d66,function(_0xf1386e){return db[_0x8db2('0xa5')][_0x8db2('0x111')]({'membername':_0x11bc22['name'],'UserId':_0x11bc22['id'],'queue_name':_0xf1386e[_0x8db2('0x2c')],'VoiceQueueId':_0xf1386e['id'],'interface':_['isNil'](_0x11bc22[_0x8db2('0x99')])?util[_0x8db2('0xa4')](_0x8db2('0xe8'),_0x11bc22[_0x8db2('0x2c')]):_0x11bc22[_0x8db2('0x99')],'paused':_0x11bc22[_0x8db2('0x98')]||![],'penalty':_0x11bc22[_0x8db2('0x9e')]},{'transaction':_0x3f6d59});});return Promise['all'](_0x53eb1a);})[_0x8db2('0x1e')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x23769d}}});})[_0x8db2('0x1e')](function(_0x2b61b3){var _0x3dcc34=_['map'](_0x2b61b3,function(_0x1b275e){return db[_0x8db2('0x112')][_0x8db2('0x7a')]({'UserId':_0x11bc22['id'],'VoicePrefixId':_0x1b275e[_0x8db2('0x113')]},{'transaction':_0x3f6d59});});return Promise[_0x8db2('0x4d')](_0x3dcc34);});});})[_0x8db2('0x1e')](function(){for(var _0x424a34=0x0;_0x424a34<_0x159a21[_0x8db2('0x47')];_0x424a34++){var _0x47fc72=_0x159a21[_0x424a34][_0x8db2('0x10f')](_0x8db2('0x95'));var _0x378e32=_0x47fc72+_0x8db2('0xab');socket[_0x8db2('0xa0')](_0x8db2('0x74')+_0x47fc72+_0x8db2('0xa1'),{'UserId':_0x31edcc,['queueField']:_0x159a21[_0x424a34]['id']});}})[_0x8db2('0x1e')](respondWithStatusCode(_0x24ce04,null))['catch'](APIHandleError(_0x24ce04));};exports[_0x8db2('0x114')]=function(_0x12d22e,_0xe1eb00){var _0x15cb12=_0x12d22e[_0x8db2('0x54')]['id'];var _0x301856=null;if(_0x12d22e[_0x8db2('0x3e')][_0x8db2('0x57')]){_0x301856=_[_0x8db2('0xa9')](_0x12d22e[_0x8db2('0x3e')]['ids'])?_0x12d22e[_0x8db2('0x3e')][_0x8db2('0x57')]:[_0x12d22e[_0x8db2('0x3e')]['ids']];}var _0x2b6122=[];return Promise[_0x8db2('0xf9')]()[_0x8db2('0x1e')](function(){if(!_0x301856)throw new APIBadRequestError(_0x8db2('0x115'));})[_0x8db2('0x1e')](function(){return db[_0x8db2('0x3b')][_0x8db2('0x8f')]({'where':{'id':_0x15cb12}});})['then'](function(_0x5b6836){if(!_0x5b6836)throw new APINotFoundError(util[_0x8db2('0xa4')](_0x8db2('0x10a'),_0x12d22e['params']['id']));return db[_0x8db2('0x5f')]['transaction'](function(_0x21aa3b){return _0x5b6836[_0x8db2('0x114')](_0x301856,{'transaction':_0x21aa3b})[_0x8db2('0x1e')](function(){return db[_0x8db2('0x108')][_0x8db2('0x43')]({'where':{'id':{'$in':_0x301856}}});})[_0x8db2('0x1e')](function(_0x5405eb){var _0x373a0e=_[_0x8db2('0x30')](_0x5405eb,function(_0x1f0439){return _0x1f0439['getAssociatedQueues']();});return Promise['all'](_0x373a0e);})['then'](function(_0x4320e8){_0x2b6122=_[_0x8db2('0x10d')](_0x4320e8);var _0x479e76=_[_0x8db2('0x30')](_0x2b6122,function(_0x1d4950){return _0x1d4950[_0x8db2('0x116')](_0x5b6836['id'],{'transaction':_0x21aa3b});});return Promise[_0x8db2('0x4d')](_0x479e76);})[_0x8db2('0x1e')](function(){if(!_0x5b6836[_0x8db2('0x96')])return;var _0x2346a3=_[_0x8db2('0x27')](_0x2b6122,function(_0x419a6b){return _0x419a6b[_0x8db2('0x10f')]('channel')===_0x8db2('0x110');});var _0x3a5240=_[_0x8db2('0x30')](_0x2346a3,function(_0x265e40){return db[_0x8db2('0xa5')][_0x8db2('0x22')]({'where':{'VoiceQueueId':_0x265e40['id'],'UserId':_0x5b6836['id']},'transaction':_0x21aa3b});});return Promise[_0x8db2('0x4d')](_0x3a5240);})[_0x8db2('0x1e')](function(){return db['TeamVoicePrefix'][_0x8db2('0x43')]({'where':{'teamId':{'$in':_0x301856}}});})[_0x8db2('0x1e')](function(_0x460aa5){var _0x4807ee=_[_0x8db2('0x30')](_0x460aa5,function(_0x4c4bda){return db[_0x8db2('0x112')]['destroy']({'where':{'UserId':_0x5b6836['id'],'VoicePrefixId':_0x4c4bda['VoicePrefixId']}},{'transaction':_0x21aa3b});});return Promise[_0x8db2('0x4d')](_0x4807ee);});});})[_0x8db2('0x1e')](function(){for(var _0x159638=0x0;_0x159638<_0x2b6122[_0x8db2('0x47')];_0x159638++){var _0x35bc75=_0x2b6122[_0x159638][_0x8db2('0x10f')]('channel');var _0x3d5905=_0x35bc75+_0x8db2('0xab');socket[_0x8db2('0xa0')](_0x8db2('0x74')+_0x35bc75+_0x8db2('0xaa'),{'UserId':_0x15cb12,['queueField']:_0x2b6122[_0x159638]['id']});}})[_0x8db2('0x1e')](respondWithStatusCode(_0xe1eb00,null))[_0x8db2('0x4e')](APIHandleError(_0xe1eb00));};exports[_0x8db2('0x117')]=function(_0xeb5c21,_0x40dd0e){var _0x5f4b12={};var _0x2785a2={};var _0x143238;var _0x37ef27;return db[_0x8db2('0x3b')]['findOne']({'where':{'id':_0xeb5c21[_0x8db2('0x54')]['id']}})['then'](handleEntityNotFound(_0x40dd0e,null))[_0x8db2('0x1e')](function(_0x43db63){if(_0x43db63){_0x143238=_0x43db63;_0x2785a2[_0x8db2('0xc8')]=_[_0x8db2('0xc9')](db[_0x8db2('0xc2')][_0x8db2('0xcb')]);_0x2785a2[_0x8db2('0x3e')]=_[_0x8db2('0xc9')](_0xeb5c21[_0x8db2('0x3e')]);_0x2785a2['filters']=_['intersection'](_0x2785a2[_0x8db2('0xc8')],_0x2785a2['query']);_0x5f4b12['attributes']=_[_0x8db2('0xcd')](_0x2785a2[_0x8db2('0xc8')],qs['fields'](_0xeb5c21[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x5f4b12[_0x8db2('0x41')]=_0x5f4b12[_0x8db2('0x41')][_0x8db2('0x47')]?_0x5f4b12[_0x8db2('0x41')]:_0x2785a2[_0x8db2('0xc8')];_0x5f4b12[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0xeb5c21['query'][_0x8db2('0xd0')]);_0x5f4b12['where']=qs[_0x8db2('0xcc')](_['pick'](_0xeb5c21['query'],_0x2785a2[_0x8db2('0xcc')]));if(_0xeb5c21[_0x8db2('0x3e')][_0x8db2('0x27')]){_0x5f4b12['where']=_[_0x8db2('0x4f')](_0x5f4b12[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x5f4b12[_0x8db2('0x41')],function(_0x400c0d){var _0x470255={};_0x470255[_0x400c0d]={'$like':'%'+_0xeb5c21['query'][_0x8db2('0x27')]+'%'};return _0x470255;})});}_0x5f4b12=_['merge']({},_0x5f4b12,_0xeb5c21['options']);return _0x143238[_0x8db2('0x117')](_0x5f4b12);}})[_0x8db2('0x1e')](function(_0x4a35b6){if(_0x4a35b6){_0x37ef27=_0x4a35b6[_0x8db2('0x47')];if(!_0xeb5c21[_0x8db2('0x3e')]['hasOwnProperty'](_0x8db2('0xd2'))){_0x5f4b12['limit']=qs[_0x8db2('0x1a')](_0xeb5c21[_0x8db2('0x3e')][_0x8db2('0x1a')]);_0x5f4b12['offset']=qs['offset'](_0xeb5c21[_0x8db2('0x3e')][_0x8db2('0x17')]);}return _0x143238['getLists'](_0x5f4b12);}})[_0x8db2('0x1e')](function(_0x9f1429){if(_0x9f1429){return _0x9f1429?{'count':_0x37ef27,'rows':_0x9f1429}:null;}})[_0x8db2('0x1e')](respondWithResult(_0x40dd0e,null))['catch'](handleError(_0x40dd0e,null));};exports['getAgents']=function(_0x4de007,_0x3f37cf){var _0x4812ec={};var _0x439cd0={};var _0x4c7633;return db['User'][_0x8db2('0x8f')]({'where':{'id':_0x4de007[_0x8db2('0x54')]['id']}})[_0x8db2('0x1e')](handleEntityNotFound(_0x3f37cf,null))['then'](function(_0x8ccdaa){if(_0x8ccdaa){_0x4c7633=_0x8ccdaa;_0x439cd0['model']=_['keys'](db['User']['rawAttributes']);_0x439cd0['query']=_[_0x8db2('0xc9')](_0x4de007['query']);_0x439cd0['filters']=_[_0x8db2('0xcd')](_0x439cd0[_0x8db2('0xc8')],_0x439cd0[_0x8db2('0x3e')]);_0x4812ec[_0x8db2('0x41')]=_[_0x8db2('0xcd')](_0x439cd0[_0x8db2('0xc8')],qs[_0x8db2('0xce')](_0x4de007[_0x8db2('0x3e')][_0x8db2('0xce')]));_0x4812ec[_0x8db2('0x41')]=_0x4812ec[_0x8db2('0x41')][_0x8db2('0x47')]?_0x4812ec[_0x8db2('0x41')]:_0x439cd0[_0x8db2('0xc8')];_0x4812ec[_0x8db2('0xcf')]=qs[_0x8db2('0xd0')](_0x4de007[_0x8db2('0x3e')]['sort']);_0x4812ec['where']=qs[_0x8db2('0xcc')](_[_0x8db2('0xd1')](_0x4de007[_0x8db2('0x3e')],_0x439cd0[_0x8db2('0xcc')]));if(_0x4de007['query'][_0x8db2('0x27')]){_0x4812ec[_0x8db2('0x3a')]=_[_0x8db2('0x4f')](_0x4812ec[_0x8db2('0x3a')],{'$or':_[_0x8db2('0x30')](_0x4812ec[_0x8db2('0x41')],function(_0x464f57){var _0x5b1e74={};_0x5b1e74[_0x464f57]={'$like':'%'+_0x4de007[_0x8db2('0x3e')][_0x8db2('0x27')]+'%'};return _0x5b1e74;})});}_0x4812ec[_0x8db2('0xc8')]=db[_0x8db2('0x3b')];_0x4812ec['as']=_0x8db2('0x83');_0x4812ec=_['merge']({},_0x4812ec,_0x4de007[_0x8db2('0x50')]);return _0x4c7633[_0x8db2('0xf0')]({'include':[_0x4812ec]});}})[_0x8db2('0x1e')](function(_0x49562f){if(_0x49562f){var _0x23312d={},_0x4e12d0=[];for(var _0x469145=0x0;_0x469145<_0x49562f['length'];_0x469145+=0x1){for(var _0xcc0b37=0x0,_0x238efd;_0xcc0b37<_0x49562f[_0x469145]['Agents'][_0x8db2('0x47')];_0xcc0b37+=0x1){_0x238efd=_0x49562f[_0x469145]['Agents'][_0xcc0b37][_0x8db2('0x23')]({'plain':!![]});_0x23312d[_0x238efd['id']]=_0x238efd;}}_0x23312d=_[_0x8db2('0x118')](_0x23312d);for(var _0x3dbc50=qs['offset'](_0x4de007['query'][_0x8db2('0x17')]);_0x3dbc50<_0x23312d[_0x8db2('0x47')]&&_0x4e12d0[_0x8db2('0x47')]=_0x42b66b[_0x5871('0x4e')]){throw new Error(_0x5871('0x4f'));}})[_0x5871('0x21')](function(){if(_0x112a59){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x112a59['name']},'individualHooks':!![]});}})['then'](function(){if(_0x112a59){return _0x112a59[_0x5871('0x50')]({'raw':!![]});}})[_0x5871('0x21')](function(_0x3edd38){if(_0x112a59){if(_0x3edd38){var _0x5b9e6b=[];_0x223bcf=_0x3edd38;if(_0x223bcf[_0x5871('0x29')]){for(var _0x1d2530=0x0;_0x1d2530<_0x223bcf[_0x5871('0x29')];_0x1d2530++){_0x5b9e6b['push'](db[_0x5871('0x24')][_0x5871('0x51')]({'membername':_0x112a59[_0x5871('0x27')],'UserId':_0x112a59['id'],'queue_name':_0x223bcf[_0x1d2530]['name'],'VoiceQueueId':_0x223bcf[_0x1d2530]['id'],'interface':_0x1a76b1,'paused':_0x112a59[_0x5871('0x49')]||![],'penalty':_0x223bcf[_0x1d2530]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x5871('0x44')](_0x5b9e6b);}}}})[_0x5871('0x21')](function(){if(_0x112a59){return db[_0x5871('0x26')][_0x5871('0xf')]({'where':{'membername':_0x112a59[_0x5871('0x27')],'exitAt':null}});}})[_0x5871('0x21')](function(_0xadfcf){if(_0x112a59){if(_0xadfcf&&_0xadfcf['length']){var _0x2a7c67=[];_0xadfcf['forEach'](function(_0x54ac31){_0x2a7c67[_0x5871('0x2e')](_0x54ac31[_0x5871('0x25')]({'exitAt':moment()[_0x5871('0x2a')](_0x5871('0x2b'))}));});return BPromise['all'](_0x2a7c67);}}})['then'](function(){if(_0x112a59){var _0x30d4ab=[];var _0x59e6e7=[];var _0x2e5bae=utils[_0x5871('0x52')]();var _0x1bd266={'membername':_0x112a59[_0x5871('0x27')],'interface':_0x1a76b1,'enterAt':moment()[_0x5871('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x112a59[_0x5871('0x32')],'internal':_0x112a59['internal']};_0x2e5bae[_0x5871('0x2d')](function(_0xa2dc72){_0x30d4ab[_0x5871('0x2e')](_[_0x5871('0x53')]({'channel':_0xa2dc72,'type':_0x5871('0x54'),'data1':_0x5871('0x55'),'data2':_0x1a76b1},_0x1bd266));if(_0x112a59['loginInPause']){_0x59e6e7[_0x5871('0x2e')](_[_0x5871('0x53')]({'channel':_0xa2dc72,'type':_0x5871('0x28'),'data1':_0x5871('0x56')},_0x1bd266));}});return db['MemberReport'][_0x5871('0x57')](_0x30d4ab[_0x5871('0x58')](_0x59e6e7),{'individualHooks':!![]});}})[_0x5871('0x21')](function(){if(_0x112a59){return _0x112a59['update']({'online':!![],'lastLoginAt':moment()[_0x5871('0x2a')](_0x5871('0x2b')),'voicePause':_0x112a59[_0x5871('0x49')]||![],'mailPause':_0x112a59[_0x5871('0x49')]||![],'chatPause':_0x112a59['loginInPause']||![],'faxPause':_0x112a59[_0x5871('0x49')]||![],'smsPause':_0x112a59[_0x5871('0x49')]||![],'openchannelPause':_0x112a59['loginInPause']||![],'pauseType':_0x112a59['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x5871('0x2b')),'interface':_0x1a76b1});}})[_0x5871('0x21')](function(_0x1e2006){_0x2f9ab2(_0x1e2006);})[_0x5871('0x1a')](function(_0x1187b3){_0x171485(_0x40d999['error'](0x1f4,_0x1187b3[_0x5871('0x1c')]));});});}; \ No newline at end of file +var _0x5011=['whatsappPause','pauseType','unpause','LogoutUser','destroy','LoginUser','mobile','count','../../config/license/util','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','concat','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','GetUser','findAll','options','where','attributes','limit','include','model','map','then','info','debug','catch','error','message','ShowUser','User','find','raw','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','updateAttributes','getChannels','forEach','push','isNil','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','bulkCreate','type','UnpauseUser','resolve','channel','findOne','online','chatPause','openchannelPause','smsPause'];(function(_0x42aa62,_0x21218b){var _0x19effd=function(_0x56c72c){while(--_0x56c72c){_0x42aa62['push'](_0x42aa62['shift']());}};_0x19effd(++_0x21218b);}(_0x5011,0xb6));var _0x1501=function(_0x1e5d40,_0x193c71){_0x1e5d40=_0x1e5d40-0x0;var _0x12d39b=_0x5011[_0x1e5d40];return _0x12d39b;};'use strict';var _=require(_0x1501('0x0'));var util=require(_0x1501('0x1'));var moment=require('moment');var BPromise=require(_0x1501('0x2'));var Redis=require(_0x1501('0x3'));var db=require(_0x1501('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1501('0x5'));var config=require(_0x1501('0x6'));config[_0x1501('0x7')]=_[_0x1501('0x8')](config[_0x1501('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x1501('0x9'))(new Redis(config['redis']));require('./user.socket')[_0x1501('0xa')](socket);exports[_0x1501('0xb')]=function(_0x456760){var _0x36bd71=this;return new Promise(function(_0x48e7e0,_0x3d494b){return db['User'][_0x1501('0xc')]({'raw':_0x456760[_0x1501('0xd')]?_0x456760[_0x1501('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x456760[_0x1501('0xd')]?_0x456760[_0x1501('0xd')][_0x1501('0xe')]||null:null,'attributes':_0x456760[_0x1501('0xd')]?_0x456760['options'][_0x1501('0xf')]||null:null,'limit':_0x456760['options']?_0x456760['options'][_0x1501('0x10')]||null:null,'include':_0x456760['options']?_0x456760[_0x1501('0xd')]['include']?_['map'](_0x456760[_0x1501('0xd')][_0x1501('0x11')],function(_0x1fc160){return{'model':db[_0x1fc160[_0x1501('0x12')]],'as':_0x1fc160['as'],'attributes':_0x1fc160[_0x1501('0xf')],'include':_0x1fc160[_0x1501('0x11')]?_[_0x1501('0x13')](_0x1fc160[_0x1501('0x11')],function(_0x13c2d3){return{'model':db[_0x13c2d3[_0x1501('0x12')]],'as':_0x13c2d3['as'],'attributes':_0x13c2d3[_0x1501('0xf')],'include':_0x13c2d3[_0x1501('0x11')]?_[_0x1501('0x13')](_0x13c2d3[_0x1501('0x11')],function(_0x344b98){return{'model':db[_0x344b98[_0x1501('0x12')]],'as':_0x344b98['as'],'attributes':_0x344b98[_0x1501('0xf')]};}):[]};}):[]};}):[]:[]})[_0x1501('0x14')](function(_0x1857b){logger[_0x1501('0x15')]('GetUser',_0x456760);logger[_0x1501('0x16')](_0x1501('0xb'),_0x456760,JSON['stringify'](_0x1857b));_0x48e7e0(_0x1857b);})[_0x1501('0x17')](function(_0x35aad7){logger[_0x1501('0x18')](_0x1501('0xb'),_0x35aad7[_0x1501('0x19')],_0x456760);_0x3d494b(_0x36bd71[_0x1501('0x18')](0x1f4,_0x35aad7[_0x1501('0x19')]));});});};exports[_0x1501('0x1a')]=function(_0x9c9668){var _0x1a17b6=this;return new Promise(function(_0x132e98,_0x5b99f9){return db[_0x1501('0x1b')][_0x1501('0x1c')]({'raw':_0x9c9668[_0x1501('0xd')]?_0x9c9668['options'][_0x1501('0x1d')]===undefined?!![]:![]:!![],'where':_0x9c9668[_0x1501('0xd')]?_0x9c9668[_0x1501('0xd')][_0x1501('0xe')]||null:null,'attributes':_0x9c9668[_0x1501('0xd')]?_0x9c9668[_0x1501('0xd')][_0x1501('0xf')]||null:null,'include':_0x9c9668[_0x1501('0xd')]?_0x9c9668[_0x1501('0xd')]['include']?_[_0x1501('0x13')](_0x9c9668[_0x1501('0xd')][_0x1501('0x11')],function(_0x405c81){return{'model':db[_0x405c81[_0x1501('0x12')]],'as':_0x405c81['as'],'attributes':_0x405c81[_0x1501('0xf')],'include':_0x405c81[_0x1501('0x11')]?_[_0x1501('0x13')](_0x405c81[_0x1501('0x11')],function(_0x4321cf){return{'model':db[_0x4321cf[_0x1501('0x12')]],'as':_0x4321cf['as'],'attributes':_0x4321cf['attributes'],'include':_0x4321cf[_0x1501('0x11')]?_['map'](_0x4321cf[_0x1501('0x11')],function(_0x12aca6){return{'model':db[_0x12aca6[_0x1501('0x12')]],'as':_0x12aca6['as'],'attributes':_0x12aca6[_0x1501('0xf')]};}):[]};}):[]};}):[]:[]})[_0x1501('0x14')](function(_0x4d1882){logger[_0x1501('0x15')](_0x1501('0x1a'),_0x9c9668);logger['debug'](_0x1501('0x1a'),_0x9c9668,JSON['stringify'](_0x4d1882));_0x132e98(_0x4d1882);})[_0x1501('0x17')](function(_0x3e1fc7){logger[_0x1501('0x18')](_0x1501('0x1a'),_0x3e1fc7[_0x1501('0x19')],_0x9c9668);_0x5b99f9(_0x1a17b6[_0x1501('0x18')](0x1f4,_0x3e1fc7[_0x1501('0x19')]));});});};exports[_0x1501('0x1e')]=function(_0x3b746f){var _0x36f607;return db[_0x1501('0x1b')][_0x1501('0x1c')]({'where':_0x3b746f[_0x1501('0xd')]['where']||{},'attributes':['id',_0x1501('0x1f'),_0x1501('0x20'),_0x1501('0x21'),_0x1501('0x22')]})[_0x1501('0x14')](function(_0x1736b9){if(!_0x1736b9){throw new Error(util[_0x1501('0x23')](_0x1501('0x24'),_0x3b746f[_0x1501('0x25')]['id']));}_0x36f607=_0x1736b9;return db[_0x1501('0x26')][_0x1501('0x27')]({'paused':0x1},{'where':{'UserId':_0x36f607['id']},'individualHooks':!![]});})[_0x1501('0x14')](function(){return db[_0x1501('0x28')][_0x1501('0xc')]({'where':{'membername':_0x36f607[_0x1501('0x1f')],'type':_0x1501('0x29'),'exitAt':null}});})[_0x1501('0x14')](function(_0x331ef9){if(_0x331ef9&&_0x331ef9[_0x1501('0x2a')]){var _0x5bcd94=moment()[_0x1501('0x23')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1d3908=0x0,_0x221cb3=_0x331ef9[_0x1501('0x2a')];_0x1d3908<_0x221cb3;_0x1d3908++){_0x331ef9[_0x1d3908][_0x1501('0x2b')]({'exitAt':_0x5bcd94});}}})[_0x1501('0x14')](function(){var _0x4fbed5=[];var _0x17a3e6=utils[_0x1501('0x2c')]();_0x17a3e6[_0x1501('0x2d')](function(_0x5e564a){_0x4fbed5[_0x1501('0x2e')]({'channel':_0x5e564a,'membername':_0x36f607[_0x1501('0x1f')],'interface':_[_0x1501('0x2f')](_0x36f607[_0x1501('0x22')])?util['format']('SIP/%s',_0x36f607[_0x1501('0x1f')]):_0x36f607['interface'],'type':_0x1501('0x29'),'enterAt':moment()['format'](_0x1501('0x30')),'data1':_0x3b746f[_0x1501('0x31')]['type']||_0x1501('0x32'),'role':_0x36f607[_0x1501('0x20')],'internal':_0x36f607[_0x1501('0x21')],'uniqueid':_0x3b746f[_0x1501('0x31')]['uniqueid']||null});});return db['MemberReport'][_0x1501('0x33')](_0x4fbed5,{'individualHooks':!![]});})[_0x1501('0x14')](function(){return _0x36f607[_0x1501('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3b746f['body'][_0x1501('0x34')]||_0x1501('0x32'),'lastPauseAt':moment()[_0x1501('0x23')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x4e42a8){throw _0x4e42a8;});};exports[_0x1501('0x35')]=function(_0x1442a7){return Promise[_0x1501('0x36')]()[_0x1501('0x14')](function(){if(_0x1442a7[_0x1501('0x31')]['channel']&&!utils['isValidChannel'](_0x1442a7[_0x1501('0x31')][_0x1501('0x37')])){throw new Error(util[_0x1501('0x23')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1442a7[_0x1501('0x31')][_0x1501('0x37')]));}return db[_0x1501('0x1b')][_0x1501('0x38')]({'where':_0x1442a7['options'][_0x1501('0xe')]||{},'attributes':['id',_0x1501('0x1f'),_0x1501('0x20'),_0x1501('0x21'),_0x1501('0x22'),_0x1501('0x39'),'voicePause','mailPause',_0x1501('0x3a'),'faxPause',_0x1501('0x3b'),_0x1501('0x3c'),_0x1501('0x3d'),_0x1501('0x3e'),'lastPauseAt']});})['then'](function(_0x206f42){if(!_0x206f42){throw new Error(util[_0x1501('0x23')](_0x1501('0x24'),_0x1442a7[_0x1501('0x25')]['id']));}return _0x206f42[_0x1501('0x3f')](_0x1442a7[_0x1501('0x31')][_0x1501('0x37')],'system');})[_0x1501('0x17')](function(_0x4aab8b){throw _0x4aab8b;});};exports[_0x1501('0x40')]=function(_0x32ea40){var _0x2d54d3=this;return new Promise(function(_0x55e94c,_0x42dbae){var _0x8c63ba;return db[_0x1501('0x1b')][_0x1501('0x38')]({'where':_0x32ea40[_0x1501('0xd')][_0x1501('0xe')]||{},'attributes':['id',_0x1501('0x1f')]})[_0x1501('0x14')](function(_0x3a6705){if(_0x3a6705){_0x8c63ba=_0x3a6705;return db[_0x1501('0x26')][_0x1501('0x41')]({'where':{'membername':_0x8c63ba[_0x1501('0x1f')]},'individualHooks':!![]});}})['then'](function(){if(_0x8c63ba){return db[_0x1501('0x28')][_0x1501('0xc')]({'where':{'membername':_0x8c63ba[_0x1501('0x1f')],'exitAt':null}});}})[_0x1501('0x14')](function(_0x23f771){if(_0x8c63ba){if(_0x23f771&&_0x23f771[_0x1501('0x2a')]){var _0x4f061f=[];_0x23f771[_0x1501('0x2d')](function(_0x1d7320){_0x4f061f['push'](_0x1d7320[_0x1501('0x27')]({'exitAt':moment()[_0x1501('0x23')](_0x1501('0x30'))}));});return BPromise['all'](_0x4f061f);}}})['then'](function(){if(_0x8c63ba){return _0x8c63ba['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x1501('0x14')](function(_0x1dfc1d){_0x55e94c(_0x1dfc1d);})[_0x1501('0x17')](function(_0x567348){_0x42dbae(_0x2d54d3[_0x1501('0x18')](0x1f4,_0x567348[_0x1501('0x19')]));});});};exports[_0x1501('0x42')]=function(_0x382c60){var _0x2582d5=this;return new Promise(function(_0x4cbf37,_0x3b90bd){var _0x1cf58d;var _0x2e47b5;var _0xbd1327;var _0x54de9e;return db[_0x1501('0x1b')][_0x1501('0x38')]({'where':_0x382c60[_0x1501('0xd')][_0x1501('0xe')]||{},'attributes':['id',_0x1501('0x1f'),_0x1501('0x20'),_0x1501('0x43'),'phone',_0x1501('0x21'),'loginInPause','interface']})[_0x1501('0x14')](function(_0x526ea7){if(_0x526ea7){_0x1cf58d=_0x526ea7;_0x54de9e=_0x382c60['body'][_0x1501('0x22')]?_0x382c60['body'][_0x1501('0x22')]:util[_0x1501('0x23')]('SIP/%s',_0x1cf58d[_0x1501('0x1f')]);return db[_0x1501('0x1b')][_0x1501('0x44')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1cf58d['id']}}});}})[_0x1501('0x14')](function(_0x4982e6){if(_0x4982e6){_0xbd1327=_0x4982e6;return require(_0x1501('0x45'))['getLicense']();}})[_0x1501('0x14')](function(_0x345b2f){if(_0x345b2f&&_0x345b2f[_0x1501('0x46')]&&_0xbd1327>=_0x345b2f[_0x1501('0x46')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x1501('0x14')](function(){if(_0x1cf58d){return db[_0x1501('0x26')]['destroy']({'where':{'membername':_0x1cf58d[_0x1501('0x1f')]},'individualHooks':!![]});}})['then'](function(){if(_0x1cf58d){return _0x1cf58d[_0x1501('0x47')]({'raw':!![]});}})[_0x1501('0x14')](function(_0x210e7e){if(_0x1cf58d){if(_0x210e7e){var _0x221085=[];_0x2e47b5=_0x210e7e;if(_0x2e47b5[_0x1501('0x2a')]){for(var _0x2fe2f0=0x0;_0x2fe2f0<_0x2e47b5[_0x1501('0x2a')];_0x2fe2f0++){_0x221085[_0x1501('0x2e')](db['UserVoiceQueueRt'][_0x1501('0x48')]({'membername':_0x1cf58d[_0x1501('0x1f')],'UserId':_0x1cf58d['id'],'queue_name':_0x2e47b5[_0x2fe2f0][_0x1501('0x1f')],'VoiceQueueId':_0x2e47b5[_0x2fe2f0]['id'],'interface':_0x54de9e,'paused':_0x1cf58d['loginInPause']||![],'penalty':_0x2e47b5[_0x2fe2f0][_0x1501('0x49')]||0x0}));}return BPromise[_0x1501('0x4a')](_0x221085);}}}})['then'](function(){if(_0x1cf58d){return db['MemberReport'][_0x1501('0xc')]({'where':{'membername':_0x1cf58d['name'],'exitAt':null}});}})[_0x1501('0x14')](function(_0x4e493c){if(_0x1cf58d){if(_0x4e493c&&_0x4e493c[_0x1501('0x2a')]){var _0x4fa897=[];_0x4e493c[_0x1501('0x2d')](function(_0x452806){_0x4fa897[_0x1501('0x2e')](_0x452806['update']({'exitAt':moment()[_0x1501('0x23')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x1501('0x4a')](_0x4fa897);}}})[_0x1501('0x14')](function(){if(_0x1cf58d){var _0x599593=[];var _0x536385=[];var _0x259924=utils[_0x1501('0x2c')]();var _0x19eb46={'membername':_0x1cf58d['name'],'interface':_0x54de9e,'enterAt':moment()[_0x1501('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1cf58d['role'],'internal':_0x1cf58d[_0x1501('0x21')]};_0x259924[_0x1501('0x2d')](function(_0x3555c7){_0x599593[_0x1501('0x2e')](_[_0x1501('0x4b')]({'channel':_0x3555c7,'type':_0x1501('0x4c'),'data1':_0x1501('0x4d'),'data2':_0x54de9e},_0x19eb46));if(_0x1cf58d[_0x1501('0x4e')]){_0x536385['push'](_['merge']({'channel':_0x3555c7,'type':_0x1501('0x29'),'data1':_0x1501('0x4f')},_0x19eb46));}});return db[_0x1501('0x28')][_0x1501('0x33')](_0x599593[_0x1501('0x50')](_0x536385),{'individualHooks':!![]});}})['then'](function(){if(_0x1cf58d){return _0x1cf58d[_0x1501('0x27')]({'online':!![],'lastLoginAt':moment()[_0x1501('0x23')](_0x1501('0x30')),'voicePause':_0x1cf58d[_0x1501('0x4e')]||![],'mailPause':_0x1cf58d[_0x1501('0x4e')]||![],'chatPause':_0x1cf58d[_0x1501('0x4e')]||![],'faxPause':_0x1cf58d[_0x1501('0x4e')]||![],'smsPause':_0x1cf58d[_0x1501('0x4e')]||![],'openchannelPause':_0x1cf58d['loginInPause']||![],'pauseType':_0x1cf58d['loginInPause']?_0x1501('0x4f'):null,'lastPauseAt':moment()['format'](_0x1501('0x30')),'interface':_0x54de9e});}})[_0x1501('0x14')](function(_0x129aad){_0x4cbf37(_0x129aad);})[_0x1501('0x17')](function(_0x168ddc){_0x3b90bd(_0x2582d5[_0x1501('0x18')](0x1f4,_0x168ddc[_0x1501('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6f26f89..9ccc168 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 _0xc8d2=['./user.events','remove','update','emit','removeListener','register','length'];(function(_0x4e7012,_0x5d5f73){var _0xcd56d5=function(_0x330847){while(--_0x330847){_0x4e7012['push'](_0x4e7012['shift']());}};_0xcd56d5(++_0x5d5f73);}(_0xc8d2,0x1b9));var _0x2c8d=function(_0x2fe128,_0x3f0f41){_0x2fe128=_0x2fe128-0x0;var _0x4e392c=_0xc8d2[_0x2fe128];return _0x4e392c;};'use strict';var UserEvents=require(_0x2c8d('0x0'));var events=['save',_0x2c8d('0x1'),_0x2c8d('0x2')];function createListener(_0x3efe8c,_0x50db53){return function(_0x4e5d12){_0x50db53[_0x2c8d('0x3')](_0x3efe8c,_0x4e5d12);};}function removeListener(_0x4069a9,_0x2907ec){return function(){UserEvents[_0x2c8d('0x4')](_0x4069a9,_0x2907ec);};}exports[_0x2c8d('0x5')]=function(_0x3ff49f){for(var _0x5048a1=0x0,_0x4880cd=events[_0x2c8d('0x6')];_0x5048a1<_0x4880cd;_0x5048a1++){var _0x13bcd7=events[_0x5048a1];var _0x44a9dd=createListener('user:'+_0x13bcd7,_0x3ff49f);UserEvents['on'](_0x13bcd7,_0x44a9dd);}}; \ No newline at end of file +var _0x10a2=['user:','./user.events','update','emit','removeListener','register','length'];(function(_0x4f97ba,_0x5a1ff8){var _0xe3cc8=function(_0x416275){while(--_0x416275){_0x4f97ba['push'](_0x4f97ba['shift']());}};_0xe3cc8(++_0x5a1ff8);}(_0x10a2,0x1eb));var _0x210a=function(_0x27d4df,_0x2b0ef9){_0x27d4df=_0x27d4df-0x0;var _0x2a0ee7=_0x10a2[_0x27d4df];return _0x2a0ee7;};'use strict';var UserEvents=require(_0x210a('0x0'));var events=['save','remove',_0x210a('0x1')];function createListener(_0x5eb8ac,_0xd7cab8){return function(_0x4b83be){_0xd7cab8[_0x210a('0x2')](_0x5eb8ac,_0x4b83be);};}function removeListener(_0x20463e,_0x2dd7cb){return function(){UserEvents[_0x210a('0x3')](_0x20463e,_0x2dd7cb);};}exports[_0x210a('0x4')]=function(_0x15dfd9){for(var _0x57788a=0x0,_0x39977e=events[_0x210a('0x5')];_0x57788a<_0x39977e;_0x57788a++){var _0x5f869b=events[_0x57788a];var _0x38447f=createListener(_0x210a('0x6')+_0x5f869b,_0x15dfd9);UserEvents['on'](_0x5f869b,_0x38447f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1ad512c..faecf40 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4f2530,_0x5c0bb5){var _0x4a9e71=function(_0x52c15d){while(--_0x52c15d){_0x4f2530['push'](_0x4f2530['shift']());}};_0x4a9e71(++_0x5c0bb5);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x26394d,_0x547eea){var _0x5c7861=function(_0x252805){while(--_0x252805){_0x26394d['push'](_0x26394d['shift']());}};_0x5c7861(++_0x547eea);}(_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 d02dcad..bb89c57 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 _0xf23c=['INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf23c,0x113));var _0xcf23=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xf23c[_0x34e752];return _0x7c6347;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xcf23('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb205=['sequelize','INTEGER'];(function(_0x4b3358,_0x126389){var _0x58af89=function(_0x475598){while(--_0x475598){_0x4b3358['push'](_0x4b3358['shift']());}};_0x58af89(++_0x126389);}(_0xb205,0x156));var _0x5b20=function(_0x2852f1,_0x3c5930){_0x2852f1=_0x2852f1-0x0;var _0x4e5e9c=_0xb205[_0x2852f1];return _0x4e5e9c;};'use strict';var Sequelize=require(_0x5b20('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5b20('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 31820c6..81dc606 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 _0xc548=['user_has_chat_queues','lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define','UserChatQueue'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc548,0xd3));var _0x8c54=function(_0x239555,_0x59f04e){_0x239555=_0x239555-0x0;var _0x224fe3=_0xc548[_0x239555];return _0x224fe3;};'use strict';var _=require(_0x8c54('0x0'));var util=require('util');var logger=require(_0x8c54('0x1'))(_0x8c54('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c54('0x3'));var rimraf=require(_0x8c54('0x4'));var config=require(_0x8c54('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x8c54('0x6')]=function(_0x4f5831,_0x53e5d0){return _0x4f5831[_0x8c54('0x7')](_0x8c54('0x8'),attributes,{'tableName':_0x8c54('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d8=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0xa0408a,_0x55e4e9){var _0x3c3e3a=function(_0x2dab20){while(--_0x2dab20){_0xa0408a['push'](_0xa0408a['shift']());}};_0x3c3e3a(++_0x55e4e9);}(_0xd3d8,0xe7));var _0x8d3d=function(_0xdb627f,_0x364a0c){_0xdb627f=_0xdb627f-0x0;var _0x2233a8=_0xd3d8[_0xdb627f];return _0x2233a8;};'use strict';var _=require(_0x8d3d('0x0'));var util=require('util');var logger=require(_0x8d3d('0x1'))(_0x8d3d('0x2'));var moment=require('moment');var BPromise=require(_0x8d3d('0x3'));var rp=require(_0x8d3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d3d('0x5'));var config=require(_0x8d3d('0x6'));var attributes=require(_0x8d3d('0x7'));module[_0x8d3d('0x8')]=function(_0x44b5c6,_0xec5eef){return _0x44b5c6[_0x8d3d('0x9')](_0x8d3d('0xa'),attributes,{'tableName':_0x8d3d('0xb'),'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 2147c64..b1a051e 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 _0x9160=['error','code','message','UserChatQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x9160,0x13a));var _0x0916=function(_0x101d96,_0x171640){_0x101d96=_0x101d96-0x0;var _0x36152f=_0x9160[_0x101d96];return _0x36152f;};'use strict';var _=require(_0x0916('0x0'));var util=require(_0x0916('0x1'));var moment=require('moment');var BPromise=require(_0x0916('0x2'));var rs=require(_0x0916('0x3'));var fs=require('fs');var Redis=require(_0x0916('0x4'));var db=require(_0x0916('0x5'))['db'];var utils=require(_0x0916('0x6'));var logger=require(_0x0916('0x7'))(_0x0916('0x8'));var config=require(_0x0916('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0916('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ba9c4,_0x5ac28e,_0x1886f2){return new BPromise(function(_0x465426,_0x4122e6){return client[_0x0916('0xb')](_0x3ba9c4,_0x1886f2)[_0x0916('0xc')](function(_0x5c52a4){logger[_0x0916('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x5ac28e,_0x0916('0xe'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5ac28e,'request\x20sent',JSON[_0x0916('0xf')](_0x5c52a4));if(_0x5c52a4[_0x0916('0x10')]){if(_0x5c52a4['error'][_0x0916('0x11')]===0x1f4){logger[_0x0916('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x5ac28e,_0x5c52a4[_0x0916('0x10')][_0x0916('0x12')]);return _0x4122e6(_0x5c52a4[_0x0916('0x10')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5ac28e,_0x5c52a4[_0x0916('0x10')]['message']);return _0x465426(_0x5c52a4[_0x0916('0x10')][_0x0916('0x12')]);}else{logger['info'](_0x0916('0x13'),_0x5ac28e,'request\x20sent');_0x465426(_0x5c52a4[_0x0916('0x14')][_0x0916('0x12')]);}})[_0x0916('0x15')](function(_0x22bb64){logger['error'](_0x0916('0x13'),_0x5ac28e,_0x22bb64);_0x4122e6(_0x22bb64);});});} \ No newline at end of file +var _0x50d4=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x46d690,_0x1efe11){var _0xe82dd=function(_0x1e1aa3){while(--_0x1e1aa3){_0x46d690['push'](_0x46d690['shift']());}};_0xe82dd(++_0x1efe11);}(_0x50d4,0x103));var _0x450d=function(_0x43c3ee,_0x56c8b5){_0x43c3ee=_0x43c3ee-0x0;var _0x54e6b9=_0x50d4[_0x43c3ee];return _0x54e6b9;};'use strict';var _=require('lodash');var util=require(_0x450d('0x0'));var moment=require(_0x450d('0x1'));var BPromise=require(_0x450d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x450d('0x3'))['db'];var utils=require(_0x450d('0x4'));var logger=require(_0x450d('0x5'))(_0x450d('0x6'));var config=require(_0x450d('0x7'));var jayson=require(_0x450d('0x8'));var client=jayson[_0x450d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5401fc,_0x269b6f,_0x1d3323){return new BPromise(function(_0x1476a7,_0x10479c){return client['request'](_0x5401fc,_0x1d3323)['then'](function(_0x4c22a0){logger[_0x450d('0xa')](_0x450d('0xb'),_0x269b6f,_0x450d('0xc'));logger[_0x450d('0xd')](_0x450d('0xe'),_0x269b6f,_0x450d('0xc'),JSON[_0x450d('0xf')](_0x4c22a0));if(_0x4c22a0[_0x450d('0x10')]){if(_0x4c22a0[_0x450d('0x10')][_0x450d('0x11')]===0x1f4){logger[_0x450d('0x10')](_0x450d('0xb'),_0x269b6f,_0x4c22a0[_0x450d('0x10')][_0x450d('0x12')]);return _0x10479c(_0x4c22a0[_0x450d('0x10')][_0x450d('0x12')]);}logger[_0x450d('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x269b6f,_0x4c22a0['error'][_0x450d('0x12')]);return _0x1476a7(_0x4c22a0[_0x450d('0x10')][_0x450d('0x12')]);}else{logger['info'](_0x450d('0xb'),_0x269b6f,_0x450d('0xc'));_0x1476a7(_0x4c22a0[_0x450d('0x13')][_0x450d('0x12')]);}})['catch'](function(_0x3e0fa1){logger[_0x450d('0x10')](_0x450d('0xb'),_0x269b6f,_0x3e0fa1);_0x10479c(_0x3e0fa1);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 1a0aed5..bf875c2 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x459847,_0x3d79f4){var _0x3720fe=function(_0x213c83){while(--_0x213c83){_0x459847['push'](_0x459847['shift']());}};_0x3720fe(++_0x3d79f4);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xb7bd46,_0x941298){var _0x2abe45=function(_0x2bdecc){while(--_0x2bdecc){_0xb7bd46['push'](_0xb7bd46['shift']());}};_0x2abe45(++_0x941298);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 0419bcf..93f4720 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 _0x86c7=['INTEGER','STRING','sequelize'];(function(_0x21f728,_0xac2780){var _0x46e97=function(_0x5a88b3){while(--_0x5a88b3){_0x21f728['push'](_0x21f728['shift']());}};_0x46e97(++_0xac2780);}(_0x86c7,0x1b5));var _0x786c=function(_0x3a94c6,_0x2c0c70){_0x3a94c6=_0x3a94c6-0x0;var _0x48d0f9=_0x86c7[_0x3a94c6];return _0x48d0f9;};'use strict';var Sequelize=require(_0x786c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x786c('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x786c('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x786c('0x2')]}}; \ No newline at end of file +var _0xaffc=['STRING','exports','INTEGER'];(function(_0x11667c,_0x416f93){var _0x4e8a41=function(_0x2049cb){while(--_0x2049cb){_0x11667c['push'](_0x11667c['shift']());}};_0x4e8a41(++_0x416f93);}(_0xaffc,0x1c0));var _0xcaff=function(_0x110830,_0x355f69){_0x110830=_0x110830-0x0;var _0x5d47a8=_0xaffc[_0x110830];return _0x5d47a8;};'use strict';var Sequelize=require('sequelize');module[_0xcaff('0x0')]={'penalty':{'type':Sequelize[_0xcaff('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcaff('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcaff('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index ad219d6..218b05f 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 _0x02f0=['../../config/environment','exports','define','UserFaxQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x263218,_0x5ebfe4){var _0xa18d1e=function(_0x3a4e04){while(--_0x3a4e04){_0x263218['push'](_0x263218['shift']());}};_0xa18d1e(++_0x5ebfe4);}(_0x02f0,0x178));var _0x002f=function(_0x1ab3ad,_0x786fbb){_0x1ab3ad=_0x1ab3ad-0x0;var _0xf6058d=_0x02f0[_0x1ab3ad];return _0xf6058d;};'use strict';var _=require('lodash');var util=require(_0x002f('0x0'));var logger=require(_0x002f('0x1'))(_0x002f('0x2'));var moment=require(_0x002f('0x3'));var BPromise=require(_0x002f('0x4'));var rp=require(_0x002f('0x5'));var fs=require('fs');var path=require(_0x002f('0x6'));var rimraf=require(_0x002f('0x7'));var config=require(_0x002f('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x002f('0x9')]=function(_0x13f662,_0x519409){return _0x13f662[_0x002f('0xa')](_0x002f('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x549f=['bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x549f,0x75));var _0xf549=function(_0x1c6da6,_0x28999){_0x1c6da6=_0x1c6da6-0x0;var _0x414042=_0x549f[_0x1c6da6];return _0x414042;};'use strict';var _=require(_0xf549('0x0'));var util=require('util');var logger=require(_0xf549('0x1'))('api');var moment=require(_0xf549('0x2'));var BPromise=require(_0xf549('0x3'));var rp=require(_0xf549('0x4'));var fs=require('fs');var path=require(_0xf549('0x5'));var rimraf=require(_0xf549('0x6'));var config=require(_0xf549('0x7'));var attributes=require(_0xf549('0x8'));module['exports']=function(_0x54cfac,_0x12bc3d){return _0x54cfac[_0xf549('0x9')](_0xf549('0xa'),attributes,{'tableName':_0xf549('0xb'),'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 cbeb5da..dca61b2 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 _0x3140=['result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x234f2a,_0x38b51a){var _0x18fc03=function(_0x397e0c){while(--_0x397e0c){_0x234f2a['push'](_0x234f2a['shift']());}};_0x18fc03(++_0x38b51a);}(_0x3140,0xa2));var _0x0314=function(_0x5ec924,_0x1fde7b){_0x5ec924=_0x5ec924-0x0;var _0xbb930e=_0x3140[_0x5ec924];return _0xbb930e;};'use strict';var _=require('lodash');var util=require(_0x0314('0x0'));var moment=require('moment');var BPromise=require(_0x0314('0x1'));var rs=require(_0x0314('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x3'))['db'];var utils=require(_0x0314('0x4'));var logger=require(_0x0314('0x5'))(_0x0314('0x6'));var config=require(_0x0314('0x7'));var jayson=require(_0x0314('0x8'));var client=jayson['client'][_0x0314('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64c3b,_0x114727,_0x34434d){return new BPromise(function(_0x55b7c1,_0x398d9d){return client[_0x0314('0xa')](_0x64c3b,_0x34434d)[_0x0314('0xb')](function(_0x45b441){logger[_0x0314('0xc')](_0x0314('0xd'),_0x114727,_0x0314('0xe'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x114727,_0x0314('0xe'),JSON[_0x0314('0xf')](_0x45b441));if(_0x45b441[_0x0314('0x10')]){if(_0x45b441[_0x0314('0x10')]['code']===0x1f4){logger[_0x0314('0x10')](_0x0314('0xd'),_0x114727,_0x45b441['error']['message']);return _0x398d9d(_0x45b441[_0x0314('0x10')][_0x0314('0x11')]);}logger[_0x0314('0x10')](_0x0314('0xd'),_0x114727,_0x45b441[_0x0314('0x10')][_0x0314('0x11')]);return _0x55b7c1(_0x45b441[_0x0314('0x10')]['message']);}else{logger[_0x0314('0xc')](_0x0314('0xd'),_0x114727,'request\x20sent');_0x55b7c1(_0x45b441[_0x0314('0x12')][_0x0314('0x11')]);}})[_0x0314('0x13')](function(_0x420b84){logger[_0x0314('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x114727,_0x420b84);_0x398d9d(_0x420b84);});});} \ No newline at end of file +var _0x23e7=['jayson/promise','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2ce08c,_0x58ce90){var _0x3db6bd=function(_0x24c3a5){while(--_0x24c3a5){_0x2ce08c['push'](_0x2ce08c['shift']());}};_0x3db6bd(++_0x58ce90);}(_0x23e7,0xc9));var _0x723e=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x23e7[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x723e('0x0'));var util=require('util');var moment=require(_0x723e('0x1'));var BPromise=require(_0x723e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x723e('0x3'));var db=require(_0x723e('0x4'))['db'];var utils=require(_0x723e('0x5'));var logger=require(_0x723e('0x6'))(_0x723e('0x7'));var config=require(_0x723e('0x8'));var jayson=require(_0x723e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeca727,_0x3065f2,_0x329056){return new BPromise(function(_0xc3453,_0x67c0ea){return client['request'](_0xeca727,_0x329056)['then'](function(_0x2548fb){logger[_0x723e('0xa')](_0x723e('0xb'),_0x3065f2,'request\x20sent');logger[_0x723e('0xc')](_0x723e('0xd'),_0x3065f2,_0x723e('0xe'),JSON[_0x723e('0xf')](_0x2548fb));if(_0x2548fb[_0x723e('0x10')]){if(_0x2548fb['error'][_0x723e('0x11')]===0x1f4){logger[_0x723e('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3065f2,_0x2548fb[_0x723e('0x10')][_0x723e('0x12')]);return _0x67c0ea(_0x2548fb[_0x723e('0x10')][_0x723e('0x12')]);}logger[_0x723e('0x10')](_0x723e('0xb'),_0x3065f2,_0x2548fb[_0x723e('0x10')]['message']);return _0xc3453(_0x2548fb[_0x723e('0x10')][_0x723e('0x12')]);}else{logger[_0x723e('0xa')](_0x723e('0xb'),_0x3065f2,'request\x20sent');_0xc3453(_0x2548fb[_0x723e('0x13')]['message']);}})[_0x723e('0x14')](function(_0x552a58){logger['error'](_0x723e('0xb'),_0x3065f2,_0x552a58);_0x67c0ea(_0x552a58);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 537e347..af5c6a0 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3e65f2,_0x193caa){var _0x40ea1b=function(_0x54a358){while(--_0x54a358){_0x3e65f2['push'](_0x3e65f2['shift']());}};_0x40ea1b(++_0x193caa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0xcb91[_0x11e03f];return _0x5666fe;};'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 _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(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 973e6e4..6ca54aa 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 _0xfc64=['sequelize','exports','INTEGER'];(function(_0x3773f3,_0x5517e1){var _0x4ec750=function(_0x4ed0b9){while(--_0x4ed0b9){_0x3773f3['push'](_0x3773f3['shift']());}};_0x4ec750(++_0x5517e1);}(_0xfc64,0x1a4));var _0x4fc6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc64[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x4fc6('0x0'));module[_0x4fc6('0x1')]={'penalty':{'type':Sequelize[_0x4fc6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2ce4=['sequelize','exports','INTEGER'];(function(_0x15fb37,_0x58af28){var _0x566f3f=function(_0x32d5b5){while(--_0x32d5b5){_0x15fb37['push'](_0x15fb37['shift']());}};_0x566f3f(++_0x58af28);}(_0x2ce4,0x141));var _0x42ce=function(_0x3c1d4b,_0x39c5f5){_0x3c1d4b=_0x3c1d4b-0x0;var _0x4d6030=_0x2ce4[_0x3c1d4b];return _0x4d6030;};'use strict';var Sequelize=require(_0x42ce('0x0'));module[_0x42ce('0x1')]={'penalty':{'type':Sequelize[_0x42ce('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 6cf520c..e52f03f 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 _0x1c19=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x2cbbca,_0x94204a){var _0x420394=function(_0x5a40ea){while(--_0x5a40ea){_0x2cbbca['push'](_0x2cbbca['shift']());}};_0x420394(++_0x94204a);}(_0x1c19,0x90));var _0x91c1=function(_0x5f5059,_0x469cd8){_0x5f5059=_0x5f5059-0x0;var _0x2245e3=_0x1c19[_0x5f5059];return _0x2245e3;};'use strict';var _=require(_0x91c1('0x0'));var util=require(_0x91c1('0x1'));var logger=require(_0x91c1('0x2'))(_0x91c1('0x3'));var moment=require(_0x91c1('0x4'));var BPromise=require('bluebird');var rp=require(_0x91c1('0x5'));var fs=require('fs');var path=require(_0x91c1('0x6'));var rimraf=require(_0x91c1('0x7'));var config=require(_0x91c1('0x8'));var attributes=require(_0x91c1('0x9'));module[_0x91c1('0xa')]=function(_0x1b066d,_0xbb602f){return _0x1b066d[_0x91c1('0xb')](_0x91c1('0xc'),attributes,{'tableName':_0x91c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb55=['rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xdb55,0xca));var _0x5db5=function(_0x3e41aa,_0x3b5f7e){_0x3e41aa=_0x3e41aa-0x0;var _0x28ab00=_0xdb55[_0x3e41aa];return _0x28ab00;};'use strict';var _=require(_0x5db5('0x0'));var util=require(_0x5db5('0x1'));var logger=require(_0x5db5('0x2'))(_0x5db5('0x3'));var moment=require(_0x5db5('0x4'));var BPromise=require(_0x5db5('0x5'));var rp=require(_0x5db5('0x6'));var fs=require('fs');var path=require(_0x5db5('0x7'));var rimraf=require(_0x5db5('0x8'));var config=require(_0x5db5('0x9'));var attributes=require(_0x5db5('0xa'));module[_0x5db5('0xb')]=function(_0x3b56dc,_0x3726c5){return _0x3b56dc[_0x5db5('0xc')](_0x5db5('0xd'),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 2d508ba..1f9a6b9 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x008c,0x188));var _0xc008=function(_0x3ef892,_0x38fb64){_0x3ef892=_0x3ef892-0x0;var _0x19f2c0=_0x008c[_0x3ef892];return _0x19f2c0;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x36ea47,_0x11d85d){var _0x39a09f=function(_0x56558a){while(--_0x56558a){_0x36ea47['push'](_0x36ea47['shift']());}};_0x39a09f(++_0x11d85d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index da873bf..c3047c8 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 _0xb368=['./userNotification.controller','isAuthenticated','sendUserNotification','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x8703f7,_0x20120d){var _0x355abb=function(_0x3b8636){while(--_0x3b8636){_0x8703f7['push'](_0x8703f7['shift']());}};_0x355abb(++_0x20120d);}(_0xb368,0xfd));var _0x8b36=function(_0x3f0b35,_0x1c5567){_0x3f0b35=_0x3f0b35-0x0;var _0xf41f7d=_0xb368[_0x3f0b35];return _0xf41f7d;};'use strict';var multer=require(_0x8b36('0x0'));var util=require('util');var path=require(_0x8b36('0x1'));var timeout=require(_0x8b36('0x2'));var express=require('express');var router=express[_0x8b36('0x3')]();var fs_extra=require(_0x8b36('0x4'));var auth=require(_0x8b36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b36('0x6'));var controller=require(_0x8b36('0x7'));router['post']('/',auth[_0x8b36('0x8')](),controller[_0x8b36('0x9')]);module['exports']=router; \ No newline at end of file +var _0x5372=['express','Router','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','util'];(function(_0x1baa6f,_0x5550a9){var _0xfd67be=function(_0x300f78){while(--_0x300f78){_0x1baa6f['push'](_0x1baa6f['shift']());}};_0xfd67be(++_0x5550a9);}(_0x5372,0x194));var _0x2537=function(_0x3a38a8,_0x553136){_0x3a38a8=_0x3a38a8-0x0;var _0x4d0bc0=_0x5372[_0x3a38a8];return _0x4d0bc0;};'use strict';var multer=require('multer');var util=require(_0x2537('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2537('0x1'));var router=express[_0x2537('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2537('0x3'));var config=require(_0x2537('0x4'));var controller=require(_0x2537('0x5'));router[_0x2537('0x6')]('/',auth['isAuthenticated'](),controller[_0x2537('0x7')]);module[_0x2537('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 064f6ce..876c237 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 _0xd781=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x4e30bf,_0x5473ce){var _0x913fd4=function(_0xf5ea40){while(--_0xf5ea40){_0x4e30bf['push'](_0x4e30bf['shift']());}};_0x913fd4(++_0x5473ce);}(_0xd781,0x197));var _0x1d78=function(_0x53486a,_0x23bad3){_0x53486a=_0x53486a-0x0;var _0xe62a6f=_0xd781[_0x53486a];return _0xe62a6f;};'use strict';var Sequelize=require(_0x1d78('0x0'));module[_0x1d78('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x1d78('0x2')]},'recipientsId':{'type':Sequelize[_0x1d78('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x1d78('0x4')]}}; \ No newline at end of file +var _0x1291=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x1291,0x12f));var _0x1129=function(_0x381d2d,_0xe008e5){_0x381d2d=_0x381d2d-0x0;var _0x173414=_0x1291[_0x381d2d];return _0x173414;};'use strict';var Sequelize=require(_0x1129('0x0'));module[_0x1129('0x1')]={'body':{'type':Sequelize[_0x1129('0x2')]},'senderName':{'type':Sequelize[_0x1129('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x1129('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 47dcb92..e3be949 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 _0xff00=['name','send','hasOwnProperty','text','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','queue','replace','push','all','getAgents','map','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x5d8e11,_0x1b2574){var _0x25fa53=function(_0x5376ce){while(--_0x5376ce){_0x5d8e11['push'](_0x5d8e11['shift']());}};_0x25fa53(++_0x1b2574);}(_0xff00,0x1e9));var _0x0ff0=function(_0xfcea47,_0x2ac49b){_0xfcea47=_0xfcea47-0x0;var _0x3aed27=_0xff00[_0xfcea47];return _0x3aed27;};'use strict';var emlformat=require(_0x0ff0('0x0'));var rimraf=require(_0x0ff0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ff0('0x2'));var moment=require(_0x0ff0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0ff0('0x4'));var util=require(_0x0ff0('0x5'));var path=require(_0x0ff0('0x6'));var sox=require('sox');var csv=require(_0x0ff0('0x7'));var ejs=require(_0x0ff0('0x8'));var fs=require('fs');var fs_extra=require(_0x0ff0('0x9'));var _=require(_0x0ff0('0xa'));var squel=require(_0x0ff0('0xb'));var crypto=require(_0x0ff0('0xc'));var jsforce=require(_0x0ff0('0xd'));var deskjs=require(_0x0ff0('0xe'));var toCsv=require(_0x0ff0('0x7'));var querystring=require(_0x0ff0('0xf'));var Papa=require(_0x0ff0('0x10'));var Redis=require(_0x0ff0('0x11'));var authService=require(_0x0ff0('0x12'));var qs=require(_0x0ff0('0x13'));var as=require(_0x0ff0('0x14'));var hardwareService=require(_0x0ff0('0x15'));var logger=require(_0x0ff0('0x16'))(_0x0ff0('0x17'));var utils=require(_0x0ff0('0x18'));var config=require(_0x0ff0('0x19'));var licenseUtil=require(_0x0ff0('0x1a'));var db=require(_0x0ff0('0x1b'))['db'];config[_0x0ff0('0x1c')]=_['defaults'](config['redis'],{'host':_0x0ff0('0x1d'),'port':0x18eb});var socket=require(_0x0ff0('0x1e'))(new Redis(config[_0x0ff0('0x1c')]));require(_0x0ff0('0x1f'))[_0x0ff0('0x20')](socket);function respondWithStatusCode(_0x3871b8,_0x17f994){_0x17f994=_0x17f994||0xcc;return function(_0x287682){if(_0x287682){return _0x3871b8[_0x0ff0('0x21')](_0x17f994);}return _0x3871b8[_0x0ff0('0x22')](_0x17f994)[_0x0ff0('0x23')]();};}function respondWithResult(_0x3d7d08,_0x18cd08){_0x18cd08=_0x18cd08||0xc8;return function(_0x3ca8b5){if(_0x3ca8b5){return _0x3d7d08[_0x0ff0('0x22')](_0x18cd08)[_0x0ff0('0x24')](_0x3ca8b5);}};}function respondWithFilteredResult(_0x53d4fe,_0x597826){return function(_0x286ede){if(_0x286ede){var _0x1be196=typeof _0x597826[_0x0ff0('0x25')]===_0x0ff0('0x26')&&typeof _0x597826[_0x0ff0('0x27')]===_0x0ff0('0x26');var _0x10ae2a=_0x286ede[_0x0ff0('0x28')];var _0x247fad=_0x1be196?0x0:_0x597826[_0x0ff0('0x25')];var _0x1730b9=_0x1be196?_0x286ede[_0x0ff0('0x28')]:_0x597826['offset']+_0x597826[_0x0ff0('0x27')];var _0x57a5ce;if(_0x1730b9>=_0x10ae2a){_0x1730b9=_0x10ae2a;_0x57a5ce=0xc8;}else{_0x57a5ce=0xce;}_0x53d4fe[_0x0ff0('0x22')](_0x57a5ce);return _0x53d4fe[_0x0ff0('0x29')](_0x0ff0('0x2a'),_0x247fad+'-'+_0x1730b9+'/'+_0x10ae2a)[_0x0ff0('0x24')](_0x286ede);}return null;};}function patchUpdates(_0x2b70b6){return function(_0x2c9eed){try{jsonpatch[_0x0ff0('0x2b')](_0x2c9eed,_0x2b70b6,!![]);}catch(_0x52ac82){return BPromise[_0x0ff0('0x2c')](_0x52ac82);}return _0x2c9eed[_0x0ff0('0x2d')]();};}function saveUpdates(_0x4223a3,_0x284b10){return function(_0x206b33){if(_0x206b33){return _0x206b33[_0x0ff0('0x2e')](_0x4223a3)[_0x0ff0('0x2f')](function(_0xbe7cc9){return _0xbe7cc9;});}return null;};}function removeEntity(_0x18536b,_0x29a932){return function(_0x19d512){if(_0x19d512){return _0x19d512[_0x0ff0('0x30')]()[_0x0ff0('0x2f')](function(){_0x18536b[_0x0ff0('0x22')](0xcc)[_0x0ff0('0x23')]();});}};}function handleEntityNotFound(_0x30fca1,_0x1379ce){return function(_0x4d4900){if(!_0x4d4900){_0x30fca1[_0x0ff0('0x21')](0x194);}return _0x4d4900;};}function handleError(_0x2d4f2e,_0x56898d){_0x56898d=_0x56898d||0x1f4;return function(_0x20bd6d){logger[_0x0ff0('0x31')](_0x20bd6d[_0x0ff0('0x32')]);if(_0x20bd6d[_0x0ff0('0x33')]){delete _0x20bd6d[_0x0ff0('0x33')];}_0x2d4f2e['status'](_0x56898d)[_0x0ff0('0x34')](_0x20bd6d);};}exports['sendUserNotification']=function(_0x4b4358,_0x3ff7fd,_0x463c6a){if(!_0x4b4358['body'][_0x0ff0('0x35')](_0x0ff0('0x36'))&&!_0x4b4358[_0x0ff0('0x37')]['hasOwnProperty'](_0x0ff0('0x38'))){throw new db[(_0x0ff0('0x39'))]['ValidationError'](_0x0ff0('0x3a'));}else{if(_0x4b4358['body'][_0x0ff0('0x35')]('TemplateId')&&!_0x4b4358['body']['hasOwnProperty'](_0x0ff0('0x3b'))){throw new db[(_0x0ff0('0x39'))][(_0x0ff0('0x3c'))](_0x0ff0('0x3d'));}if(!_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x35')]('recipients')){throw new db[(_0x0ff0('0x39'))][(_0x0ff0('0x3c'))](_0x0ff0('0x3e'));}else{try{var _0x570c8a=JSON[_0x0ff0('0x3f')](_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x40')]);}catch(_0x5aeb64){logger[_0x0ff0('0x31')](_0x5aeb64);throw new db[(_0x0ff0('0x39'))][(_0x0ff0('0x3c'))](_0x0ff0('0x41'));}var _0x29c73e=[_0x0ff0('0x42'),_0x0ff0('0x43'),_0x0ff0('0x44'),_0x0ff0('0x45'),'smsqueue',_0x0ff0('0x46'),_0x0ff0('0x47'),_0x0ff0('0x48'),_0x0ff0('0x49')];if(_['some'](_0x570c8a,function(_0x1e1edf){return!_[_0x0ff0('0x4a')](_0x29c73e,_0x1e1edf[_0x0ff0('0x4b')][_0x0ff0('0x4c')]());})){throw new db[(_0x0ff0('0x39'))][(_0x0ff0('0x3c'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x58b597={};_0x58b597[_0x0ff0('0x4d')]=_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x35')](_0x0ff0('0x4d'))?_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x4d')]:_0x4b4358[_0x0ff0('0x49')]['fullname'];_0x58b597[_0x0ff0('0x4e')]=_[_0x0ff0('0x4f')](_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x4e')])?null:_0x4b4358[_0x0ff0('0x37')][_0x0ff0('0x4e')];_0x58b597[_0x0ff0('0x50')]=_0x4b4358['body'][_0x0ff0('0x50')]||![];_0x58b597[_0x0ff0('0x51')]=_0x4b4358[_0x0ff0('0x49')]['id'];return getContent(_0x4b4358[_0x0ff0('0x37')])[_0x0ff0('0x2f')](function(_0x511623){_0x58b597[_0x0ff0('0x37')]=_0x511623;return getRecipients(_0x570c8a);})[_0x0ff0('0x2f')](function(_0x54de55){_0x58b597[_0x0ff0('0x52')]=_[_0x0ff0('0x53')](_0x54de55)[_0x0ff0('0x54')](',');return db[_0x0ff0('0x55')]['transaction'](function(_0xf9760c){return db[_0x0ff0('0x56')][_0x0ff0('0x57')](_0x58b597,{'raw':!![],'transaction':_0xf9760c})[_0x0ff0('0x2f')](function(_0xef0c16){var _0x3a12af={'sender':_0x58b597[_0x0ff0('0x4d')],'description':_0x58b597['recipientsDescription'],'content':_0x58b597[_0x0ff0('0x37')],'beep':_0x58b597[_0x0ff0('0x50')]};_0x54de55[_0x0ff0('0x58')](function(_0x2b0ddf){_0x3a12af[_0x0ff0('0x59')]=_0x2b0ddf;socket[_0x0ff0('0x5a')](_0x0ff0('0x5b'),_0x3a12af);});return _0xef0c16;});});})['then'](respondWithResult(_0x3ff7fd,0xc9))['catch'](handleError(_0x3ff7fd,null));};function getContent(_0x40c3e7){return new BPromise(function(_0x5cdbb9,_0x249181){if(_0x40c3e7[_0x0ff0('0x36')]){_0x5cdbb9(_0x40c3e7[_0x0ff0('0x36')]);return;}return db[_0x0ff0('0x5c')][_0x0ff0('0x5d')]({'attributes':[_0x0ff0('0x5e')],'where':{'id':_0x40c3e7[_0x0ff0('0x38')]},'raw':!![]})[_0x0ff0('0x2f')](function(_0x47df22){if(!_0x47df22)throw new db['Sequelize']['ValidationError'](_0x0ff0('0x5f'));var _0x388af7=Mustache[_0x0ff0('0x60')](_0x47df22[_0x0ff0('0x5e')],_0x40c3e7[_0x0ff0('0x3b')]);_0x5cdbb9(_0x388af7);})[_0x0ff0('0x61')](function(_0x1c8d7f){_0x249181(_0x1c8d7f);});});}function getRecipients(_0x4aff4e){return new BPromise(function(_0x447666,_0x67f020){var _0x104fc0=[];var _0x4b4327=[];_0x4aff4e[_0x0ff0('0x58')](function(_0x4605c9){var _0x252694=_[_0x0ff0('0x62')](_0x4605c9[_0x0ff0('0x4b')][_0x0ff0('0x4c')]());if(_0x252694===_0x0ff0('0x63')){_0x104fc0=_[_0x0ff0('0x64')](_0x104fc0,_0x4605c9[_0x0ff0('0x65')]);}else{if(_[_0x0ff0('0x4a')](_0x252694,_0x0ff0('0x66')))_0x252694=_0x252694[_0x0ff0('0x67')]('queue','Queue');_0x4605c9[_0x0ff0('0x65')]['forEach'](function(_0x4fcd63){_0x4b4327[_0x0ff0('0x68')](getAgents(_0x252694,_0x4fcd63));});}});return BPromise[_0x0ff0('0x69')](_0x4b4327)[_0x0ff0('0x2f')](function(_0x2d03c8){_0x104fc0=_['union'](_0x104fc0,_['flatten'](_0x2d03c8));_0x447666(_0x104fc0);})[_0x0ff0('0x61')](function(_0x5d377c){_0x67f020(_0x5d377c);});});}function getAgents(_0x22cf44,_0x3fd952){return new BPromise(function(_0x2d9fc5,_0x1c3caa){return db[_0x22cf44][_0x0ff0('0x5d')]({'where':{'id':_0x3fd952}})[_0x0ff0('0x2f')](function(_0x1f4ad7){return _0x1f4ad7[_0x0ff0('0x6a')]({'attributes':['id'],'raw':!![]})[_0x0ff0('0x2f')](function(_0x2846c2){var _0xc3c7c9=_[_0x0ff0('0x6b')](_0x2846c2,'id');_0x2d9fc5(_0xc3c7c9);});})['catch'](function(_0x25458c){_0x1c3caa(_0x25458c);});});} \ No newline at end of file +var _0xf877=['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','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','user','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','userNotification:send','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','catch','startCase','User','union','ids','queue','replace','Queue','push','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body'];(function(_0x31b2d3,_0x2a787){var _0x583cfc=function(_0x12a86d){while(--_0x12a86d){_0x31b2d3['push'](_0x31b2d3['shift']());}};_0x583cfc(++_0x2a787);}(_0xf877,0x1c4));var _0x7f87=function(_0x15e7e1,_0x5ce009){_0x15e7e1=_0x15e7e1-0x0;var _0x46602b=_0xf877[_0x15e7e1];return _0x46602b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f87('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f87('0x1'));var rp=require(_0x7f87('0x2'));var moment=require(_0x7f87('0x3'));var BPromise=require(_0x7f87('0x4'));var Mustache=require(_0x7f87('0x5'));var util=require(_0x7f87('0x6'));var path=require(_0x7f87('0x7'));var sox=require(_0x7f87('0x8'));var csv=require(_0x7f87('0x9'));var ejs=require(_0x7f87('0xa'));var fs=require('fs');var fs_extra=require(_0x7f87('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f87('0xc'));var jsforce=require(_0x7f87('0xd'));var deskjs=require(_0x7f87('0xe'));var toCsv=require(_0x7f87('0x9'));var querystring=require(_0x7f87('0xf'));var Papa=require(_0x7f87('0x10'));var Redis=require(_0x7f87('0x11'));var authService=require(_0x7f87('0x12'));var qs=require(_0x7f87('0x13'));var as=require(_0x7f87('0x14'));var hardwareService=require(_0x7f87('0x15'));var logger=require(_0x7f87('0x16'))(_0x7f87('0x17'));var utils=require('../../config/utils');var config=require(_0x7f87('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x7f87('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f87('0x1a'))(new Redis(config[_0x7f87('0x19')]));require('./userNotification.socket')[_0x7f87('0x1b')](socket);function respondWithStatusCode(_0x4c84c3,_0x17d203){_0x17d203=_0x17d203||0xcc;return function(_0x106941){if(_0x106941){return _0x4c84c3[_0x7f87('0x1c')](_0x17d203);}return _0x4c84c3[_0x7f87('0x1d')](_0x17d203)['end']();};}function respondWithResult(_0x302816,_0x16383d){_0x16383d=_0x16383d||0xc8;return function(_0x140308){if(_0x140308){return _0x302816[_0x7f87('0x1d')](_0x16383d)[_0x7f87('0x1e')](_0x140308);}};}function respondWithFilteredResult(_0x3aa176,_0x37646d){return function(_0x32fbd3){if(_0x32fbd3){var _0x28f335=typeof _0x37646d['offset']===_0x7f87('0x1f')&&typeof _0x37646d['limit']===_0x7f87('0x1f');var _0x3f02cf=_0x32fbd3[_0x7f87('0x20')];var _0x56ba20=_0x28f335?0x0:_0x37646d['offset'];var _0x2b3a68=_0x28f335?_0x32fbd3[_0x7f87('0x20')]:_0x37646d[_0x7f87('0x21')]+_0x37646d[_0x7f87('0x22')];var _0x559e1d;if(_0x2b3a68>=_0x3f02cf){_0x2b3a68=_0x3f02cf;_0x559e1d=0xc8;}else{_0x559e1d=0xce;}_0x3aa176[_0x7f87('0x1d')](_0x559e1d);return _0x3aa176[_0x7f87('0x23')](_0x7f87('0x24'),_0x56ba20+'-'+_0x2b3a68+'/'+_0x3f02cf)[_0x7f87('0x1e')](_0x32fbd3);}return null;};}function patchUpdates(_0x297921){return function(_0x2a30f0){try{jsonpatch['apply'](_0x2a30f0,_0x297921,!![]);}catch(_0x413943){return BPromise[_0x7f87('0x25')](_0x413943);}return _0x2a30f0[_0x7f87('0x26')]();};}function saveUpdates(_0x321f69,_0x20c42a){return function(_0x15ef33){if(_0x15ef33){return _0x15ef33[_0x7f87('0x27')](_0x321f69)[_0x7f87('0x28')](function(_0x7f3911){return _0x7f3911;});}return null;};}function removeEntity(_0x282bab,_0x48a669){return function(_0x28748f){if(_0x28748f){return _0x28748f[_0x7f87('0x29')]()[_0x7f87('0x28')](function(){_0x282bab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3666,_0x29c37e){return function(_0x53db5b){if(!_0x53db5b){_0x2f3666['sendStatus'](0x194);}return _0x53db5b;};}function handleError(_0x435184,_0x578604){_0x578604=_0x578604||0x1f4;return function(_0x3157b9){logger[_0x7f87('0x2a')](_0x3157b9[_0x7f87('0x2b')]);if(_0x3157b9[_0x7f87('0x2c')]){delete _0x3157b9['name'];}_0x435184[_0x7f87('0x1d')](_0x578604)[_0x7f87('0x2d')](_0x3157b9);};}exports[_0x7f87('0x2e')]=function(_0xfcd5b3,_0x2650e9,_0x14a7c9){if(!_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x30')]('text')&&!_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x30')](_0x7f87('0x31'))){throw new db[(_0x7f87('0x32'))][(_0x7f87('0x33'))](_0x7f87('0x34'));}else{if(_0xfcd5b3['body']['hasOwnProperty']('TemplateId')&&!_0xfcd5b3['body']['hasOwnProperty'](_0x7f87('0x35'))){throw new db['Sequelize'][(_0x7f87('0x33'))](_0x7f87('0x36'));}if(!_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x30')](_0x7f87('0x37'))){throw new db[(_0x7f87('0x32'))][(_0x7f87('0x33'))](_0x7f87('0x38'));}else{try{var _0x1b20e7=JSON[_0x7f87('0x39')](_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x37')]);}catch(_0x1719bb){logger[_0x7f87('0x2a')](_0x1719bb);throw new db[(_0x7f87('0x32'))]['ValidationError'](_0x7f87('0x3a'));}var _0x5ab355=[_0x7f87('0x3b'),_0x7f87('0x3c'),_0x7f87('0x3d'),_0x7f87('0x3e'),_0x7f87('0x3f'),_0x7f87('0x40'),_0x7f87('0x41'),_0x7f87('0x42'),'user'];if(_[_0x7f87('0x43')](_0x1b20e7,function(_0x3124b6){return!_[_0x7f87('0x44')](_0x5ab355,_0x3124b6[_0x7f87('0x45')][_0x7f87('0x46')]());})){throw new db[(_0x7f87('0x32'))][(_0x7f87('0x33'))](_0x7f87('0x47'));}}}var _0x1b6405={};_0x1b6405[_0x7f87('0x48')]=_0xfcd5b3[_0x7f87('0x2f')]['hasOwnProperty'](_0x7f87('0x48'))?_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x48')]:_0xfcd5b3['user'][_0x7f87('0x49')];_0x1b6405[_0x7f87('0x4a')]=_['isEmpty'](_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x4a')])?null:_0xfcd5b3[_0x7f87('0x2f')][_0x7f87('0x4a')];_0x1b6405[_0x7f87('0x4b')]=_0xfcd5b3['body']['beep']||![];_0x1b6405[_0x7f87('0x4c')]=_0xfcd5b3[_0x7f87('0x4d')]['id'];return getContent(_0xfcd5b3['body'])[_0x7f87('0x28')](function(_0x45e062){_0x1b6405[_0x7f87('0x2f')]=_0x45e062;return getRecipients(_0x1b20e7);})['then'](function(_0x2392a8){_0x1b6405[_0x7f87('0x4e')]=_[_0x7f87('0x4f')](_0x2392a8)[_0x7f87('0x50')](',');return db[_0x7f87('0x51')][_0x7f87('0x52')](function(_0x366914){return db[_0x7f87('0x53')]['create'](_0x1b6405,{'raw':!![],'transaction':_0x366914})['then'](function(_0x3cf9b3){var _0x49bd9a={'sender':_0x1b6405[_0x7f87('0x48')],'description':_0x1b6405[_0x7f87('0x4a')],'content':_0x1b6405[_0x7f87('0x2f')],'beep':_0x1b6405[_0x7f87('0x4b')]};_0x2392a8[_0x7f87('0x54')](function(_0x305188){_0x49bd9a['recipient']=_0x305188;socket['emit'](_0x7f87('0x55'),_0x49bd9a);});return _0x3cf9b3;});});})[_0x7f87('0x28')](respondWithResult(_0x2650e9,0xc9))['catch'](handleError(_0x2650e9,null));};function getContent(_0x27df1f){return new BPromise(function(_0x1a0144,_0x1fbbc7){if(_0x27df1f[_0x7f87('0x56')]){_0x1a0144(_0x27df1f[_0x7f87('0x56')]);return;}return db[_0x7f87('0x57')][_0x7f87('0x58')]({'attributes':['html'],'where':{'id':_0x27df1f['TemplateId']},'raw':!![]})[_0x7f87('0x28')](function(_0x45bdad){if(!_0x45bdad)throw new db[(_0x7f87('0x32'))][(_0x7f87('0x33'))](_0x7f87('0x59'));var _0x5c3a74=Mustache['render'](_0x45bdad[_0x7f87('0x5a')],_0x27df1f[_0x7f87('0x35')]);_0x1a0144(_0x5c3a74);})[_0x7f87('0x5b')](function(_0x4203ab){_0x1fbbc7(_0x4203ab);});});}function getRecipients(_0x1fa3d9){return new BPromise(function(_0x590805,_0x3fef79){var _0x35375a=[];var _0x5d2cf2=[];_0x1fa3d9['forEach'](function(_0x140bc9){var _0x4779b4=_[_0x7f87('0x5c')](_0x140bc9['model'][_0x7f87('0x46')]());if(_0x4779b4===_0x7f87('0x5d')){_0x35375a=_[_0x7f87('0x5e')](_0x35375a,_0x140bc9[_0x7f87('0x5f')]);}else{if(_[_0x7f87('0x44')](_0x4779b4,_0x7f87('0x60')))_0x4779b4=_0x4779b4[_0x7f87('0x61')]('queue',_0x7f87('0x62'));_0x140bc9[_0x7f87('0x5f')][_0x7f87('0x54')](function(_0x2b80e6){_0x5d2cf2[_0x7f87('0x63')](getAgents(_0x4779b4,_0x2b80e6));});}});return BPromise['all'](_0x5d2cf2)[_0x7f87('0x28')](function(_0x328610){_0x35375a=_[_0x7f87('0x5e')](_0x35375a,_['flatten'](_0x328610));_0x590805(_0x35375a);})[_0x7f87('0x5b')](function(_0x5397ca){_0x3fef79(_0x5397ca);});});}function getAgents(_0x5d571a,_0x151129){return new BPromise(function(_0x3635ac,_0x49cd2b){return db[_0x5d571a]['findOne']({'where':{'id':_0x151129}})[_0x7f87('0x28')](function(_0x4fe3f7){return _0x4fe3f7['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x4fba12){var _0x3489d7=_['map'](_0x4fba12,'id');_0x3635ac(_0x3489d7);});})[_0x7f87('0x5b')](function(_0x43e2df){_0x49cd2b(_0x43e2df);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 405f958..287fed6 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 _0xc835=['emit','hook','exports','events','UserNotification','setMaxListeners','save','update','remove'];(function(_0x19d65c,_0x2aab37){var _0x33a78b=function(_0x57701b){while(--_0x57701b){_0x19d65c['push'](_0x19d65c['shift']());}};_0x33a78b(++_0x2aab37);}(_0xc835,0x1b3));var _0x5c83=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xc835[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require(_0x5c83('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x5c83('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5c83('0x2')](0x0);var events={'afterCreate':_0x5c83('0x3'),'afterUpdate':_0x5c83('0x4'),'afterDestroy':_0x5c83('0x5')};function emitEvent(_0x5d3066){return function(_0xd9940a,_0x22f5ea,_0x393644){UserNotificationEvents[_0x5c83('0x6')](_0x5d3066+':'+_0xd9940a['id'],_0xd9940a);UserNotificationEvents[_0x5c83('0x6')](_0x5d3066,_0xd9940a);_0x393644(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x5c83('0x7')](e,emitEvent(event));}}module[_0x5c83('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xc11e=['UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xc11e,0xd0));var _0xec11=function(_0x49e1c5,_0x1f4a4f){_0x49e1c5=_0x49e1c5-0x0;var _0x576240=_0xc11e[_0x49e1c5];return _0x576240;};'use strict';var EventEmitter=require(_0xec11('0x0'));var UserNotification=require(_0xec11('0x1'))['db'][_0xec11('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xec11('0x3')](0x0);var events={'afterCreate':_0xec11('0x4'),'afterUpdate':_0xec11('0x5'),'afterDestroy':_0xec11('0x6')};function emitEvent(_0x1f6d8d){return function(_0xbc5dd6,_0x4dff9e,_0x8158ec){UserNotificationEvents[_0xec11('0x7')](_0x1f6d8d+':'+_0xbc5dd6['id'],_0xbc5dd6);UserNotificationEvents[_0xec11('0x7')](_0x1f6d8d,_0xbc5dd6);_0x8158ec(null);};}for(var e in events){if(events[_0xec11('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xec11('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 7224ec8..5999d4a 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 _0xabf1=['../../config/logger','moment','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabf1,0x96));var _0x1abf=function(_0x482ad9,_0x455b47){_0x482ad9=_0x482ad9-0x0;var _0x5f4250=_0xabf1[_0x482ad9];return _0x5f4250;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1abf('0x0'))('api');var moment=require(_0x1abf('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1abf('0x2'));var rimraf=require(_0x1abf('0x3'));var config=require(_0x1abf('0x4'));var attributes=require(_0x1abf('0x5'));module[_0x1abf('0x6')]=function(_0x4b6057,_0x5814ad){return _0x4b6057[_0x1abf('0x7')](_0x1abf('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1abf('0x9')});}; \ No newline at end of file +var _0xa06e=['define','UserNotification','userNotifications','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x571c1f,_0x4ff1fe){var _0x368d16=function(_0x4296b1){while(--_0x4296b1){_0x571c1f['push'](_0x571c1f['shift']());}};_0x368d16(++_0x4ff1fe);}(_0xa06e,0x199));var _0xea06=function(_0x3799cd,_0x131494){_0x3799cd=_0x3799cd-0x0;var _0x3410d3=_0xa06e[_0x3799cd];return _0x3410d3;};'use strict';var _=require(_0xea06('0x0'));var util=require(_0xea06('0x1'));var logger=require('../../config/logger')(_0xea06('0x2'));var moment=require(_0xea06('0x3'));var BPromise=require(_0xea06('0x4'));var rp=require(_0xea06('0x5'));var fs=require('fs');var path=require(_0xea06('0x6'));var rimraf=require(_0xea06('0x7'));var config=require(_0xea06('0x8'));var attributes=require(_0xea06('0x9'));module[_0xea06('0xa')]=function(_0x1da8c2,_0xe3de0f){return _0x1da8c2[_0xea06('0xb')](_0xea06('0xc'),attributes,{'tableName':_0xea06('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea06('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 493236d..15d3634 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 _0x422b=['defaults','socket.io-emitter','./userNotification.socket','register','then','info','debug','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x422b,0x10a));var _0xb422=function(_0x598dc6,_0x4b0de6){_0x598dc6=_0x598dc6-0x0;var _0x3aee53=_0x422b[_0x598dc6];return _0x3aee53;};'use strict';var _=require(_0xb422('0x0'));var util=require(_0xb422('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb422('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb422('0x3'));var logger=require(_0xb422('0x4'))('rpc');var config=require(_0xb422('0x5'));var jayson=require(_0xb422('0x6'));var client=jayson[_0xb422('0x7')][_0xb422('0x8')]({'port':0x232a});config[_0xb422('0x9')]=_[_0xb422('0xa')](config[_0xb422('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb422('0xb'))(new Redis(config['redis']));require(_0xb422('0xc'))[_0xb422('0xd')](socket);function respondWithRpcPromise(_0x43bb3b,_0x1cf3a2,_0x5dabcd){return new BPromise(function(_0x2bf669,_0xfea190){return client['request'](_0x43bb3b,_0x5dabcd)[_0xb422('0xe')](function(_0x4869f5){logger[_0xb422('0xf')]('UserNotification,\x20%s,\x20%s',_0x1cf3a2,'request\x20sent');logger[_0xb422('0x10')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1cf3a2,_0xb422('0x11'),JSON[_0xb422('0x12')](_0x4869f5));if(_0x4869f5[_0xb422('0x13')]){if(_0x4869f5['error'][_0xb422('0x14')]===0x1f4){logger[_0xb422('0x13')](_0xb422('0x15'),_0x1cf3a2,_0x4869f5[_0xb422('0x13')][_0xb422('0x16')]);return _0xfea190(_0x4869f5[_0xb422('0x13')]['message']);}logger['error'](_0xb422('0x15'),_0x1cf3a2,_0x4869f5[_0xb422('0x13')][_0xb422('0x16')]);return _0x2bf669(_0x4869f5[_0xb422('0x13')][_0xb422('0x16')]);}else{logger['info'](_0xb422('0x15'),_0x1cf3a2,_0xb422('0x11'));_0x2bf669(_0x4869f5['result'][_0xb422('0x16')]);}})['catch'](function(_0x4e8ec8){logger[_0xb422('0x13')](_0xb422('0x15'),_0x1cf3a2,_0x4e8ec8);_0xfea190(_0x4e8ec8);});});} \ No newline at end of file +var _0x0b2b=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x0b2b,0x1e5));var _0xb0b2=function(_0x5c4045,_0x324b0d){_0x5c4045=_0x5c4045-0x0;var _0x3fd576=_0x0b2b[_0x5c4045];return _0x3fd576;};'use strict';var _=require(_0xb0b2('0x0'));var util=require(_0xb0b2('0x1'));var moment=require(_0xb0b2('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0b2('0x3'));var fs=require('fs');var Redis=require(_0xb0b2('0x4'));var db=require(_0xb0b2('0x5'))['db'];var utils=require(_0xb0b2('0x6'));var logger=require('../../config/logger')(_0xb0b2('0x7'));var config=require(_0xb0b2('0x8'));var jayson=require(_0xb0b2('0x9'));var client=jayson[_0xb0b2('0xa')][_0xb0b2('0xb')]({'port':0x232a});config[_0xb0b2('0xc')]=_[_0xb0b2('0xd')](config[_0xb0b2('0xc')],{'host':_0xb0b2('0xe'),'port':0x18eb});var socket=require(_0xb0b2('0xf'))(new Redis(config['redis']));require(_0xb0b2('0x10'))[_0xb0b2('0x11')](socket);function respondWithRpcPromise(_0x3a628a,_0x292dcf,_0x50cb2d){return new BPromise(function(_0x1a51bb,_0x4ef2c0){return client['request'](_0x3a628a,_0x50cb2d)[_0xb0b2('0x12')](function(_0x45144e){logger['info'](_0xb0b2('0x13'),_0x292dcf,_0xb0b2('0x14'));logger[_0xb0b2('0x15')](_0xb0b2('0x16'),_0x292dcf,_0xb0b2('0x14'),JSON[_0xb0b2('0x17')](_0x45144e));if(_0x45144e[_0xb0b2('0x18')]){if(_0x45144e[_0xb0b2('0x18')][_0xb0b2('0x19')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x292dcf,_0x45144e[_0xb0b2('0x18')][_0xb0b2('0x1a')]);return _0x4ef2c0(_0x45144e[_0xb0b2('0x18')][_0xb0b2('0x1a')]);}logger[_0xb0b2('0x18')](_0xb0b2('0x13'),_0x292dcf,_0x45144e[_0xb0b2('0x18')][_0xb0b2('0x1a')]);return _0x1a51bb(_0x45144e[_0xb0b2('0x18')][_0xb0b2('0x1a')]);}else{logger[_0xb0b2('0x1b')](_0xb0b2('0x13'),_0x292dcf,_0xb0b2('0x14'));_0x1a51bb(_0x45144e[_0xb0b2('0x1c')][_0xb0b2('0x1a')]);}})[_0xb0b2('0x1d')](function(_0x7ee2dc){logger[_0xb0b2('0x18')]('UserNotification,\x20%s,\x20%s',_0x292dcf,_0x7ee2dc);_0x4ef2c0(_0x7ee2dc);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 2d345e4..40572fb 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 _0x25a8=['remove','update','emit','removeListener','userNotification:','./userNotification.events','save'];(function(_0x325787,_0x30dc93){var _0x12da80=function(_0x427281){while(--_0x427281){_0x325787['push'](_0x325787['shift']());}};_0x12da80(++_0x30dc93);}(_0x25a8,0xfa));var _0x825a=function(_0x3541be,_0x105f79){_0x3541be=_0x3541be-0x0;var _0x468899=_0x25a8[_0x3541be];return _0x468899;};'use strict';var UserNotificationEvents=require(_0x825a('0x0'));var events=[_0x825a('0x1'),_0x825a('0x2'),_0x825a('0x3')];function createListener(_0x5964f4,_0x381fa7){return function(_0x261501){_0x381fa7[_0x825a('0x4')](_0x5964f4,_0x261501);};}function removeListener(_0x21de08,_0x352a1f){return function(){UserNotificationEvents[_0x825a('0x5')](_0x21de08,_0x352a1f);};}exports['register']=function(_0x10cbb6){for(var _0x30ccc6=0x0,_0x2e0a61=events['length'];_0x30ccc6<_0x2e0a61;_0x30ccc6++){var _0x54c350=events[_0x30ccc6];var _0x5451ed=createListener(_0x825a('0x6')+_0x54c350,_0x10cbb6);UserNotificationEvents['on'](_0x54c350,_0x5451ed);}}; \ No newline at end of file +var _0xb0d0=['save','remove','update','emit','removeListener','length','userNotification:'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0xb0d0,0x1a4));var _0x0b0d=function(_0x37db3b,_0x1c0123){_0x37db3b=_0x37db3b-0x0;var _0xee4146=_0xb0d0[_0x37db3b];return _0xee4146;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x0b0d('0x0'),_0x0b0d('0x1'),_0x0b0d('0x2')];function createListener(_0x33e62e,_0x502e5c){return function(_0x24af43){_0x502e5c[_0x0b0d('0x3')](_0x33e62e,_0x24af43);};}function removeListener(_0x4e83d4,_0xb967b5){return function(){UserNotificationEvents[_0x0b0d('0x4')](_0x4e83d4,_0xb967b5);};}exports['register']=function(_0x24f9f4){for(var _0x288232=0x0,_0x550647=events[_0x0b0d('0x5')];_0x288232<_0x550647;_0x288232++){var _0x56aa33=events[_0x288232];var _0x5e95f3=createListener(_0x0b0d('0x6')+_0x56aa33,_0x24f9f4);UserNotificationEvents['on'](_0x56aa33,_0x5e95f3);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b3a4af9..16d28f4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54bc08,_0x21b25d){var _0x15e2d1=function(_0xe30a8){while(--_0xe30a8){_0x54bc08['push'](_0x54bc08['shift']());}};_0x15e2d1(++_0x21b25d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xcb91[_0x2caaef];return _0xd011f8;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x12b449,_0x2b8a36){var _0x4e3784=function(_0xf2848c){while(--_0xf2848c){_0x12b449['push'](_0x12b449['shift']());}};_0x4e3784(++_0x2b8a36);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 3b4ff3f..9006424 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 _0x91d9=['exports'];(function(_0x3d8e85,_0x5a6a1b){var _0x52f85d=function(_0x5d2cb3){while(--_0x5d2cb3){_0x3d8e85['push'](_0x3d8e85['shift']());}};_0x52f85d(++_0x5a6a1b);}(_0x91d9,0x1ec));var _0x991d=function(_0x378118,_0x5b594d){_0x378118=_0x378118-0x0;var _0xc79a8c=_0x91d9[_0x378118];return _0xc79a8c;};'use strict';var Sequelize=require('sequelize');module[_0x991d('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 7065599..9496a1d 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 _0xa983=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xa983,0x1ad));var _0x3a98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa983[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a98('0x0'));var util=require('util');var logger=require(_0x3a98('0x1'))(_0x3a98('0x2'));var moment=require(_0x3a98('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a98('0x5'));var config=require(_0x3a98('0x6'));var attributes=require(_0x3a98('0x7'));module['exports']=function(_0x2d03a5,_0xa04bae){return _0x2d03a5[_0x3a98('0x8')](_0x3a98('0x9'),attributes,{'tableName':_0x3a98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb2=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','api','moment','bluebird','request-promise'];(function(_0x355c36,_0xed399a){var _0x37a5e5=function(_0x3ea78f){while(--_0x3ea78f){_0x355c36['push'](_0x355c36['shift']());}};_0x37a5e5(++_0xed399a);}(_0xadb2,0xf8));var _0x2adb=function(_0x1536b4,_0x19fe2f){_0x1536b4=_0x1536b4-0x0;var _0x46edd4=_0xadb2[_0x1536b4];return _0x46edd4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2adb('0x0'));var moment=require(_0x2adb('0x1'));var BPromise=require(_0x2adb('0x2'));var rp=require(_0x2adb('0x3'));var fs=require('fs');var path=require(_0x2adb('0x4'));var rimraf=require(_0x2adb('0x5'));var config=require(_0x2adb('0x6'));var attributes=require(_0x2adb('0x7'));module[_0x2adb('0x8')]=function(_0x31b912,_0x26c422){return _0x31b912[_0x2adb('0x9')](_0x2adb('0xa'),attributes,{'tableName':_0x2adb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index b8c0899..4660861 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 _0x7ea0=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7ea0,0x198));var _0x07ea=function(_0x20c387,_0x552ee9){_0x20c387=_0x20c387-0x0;var _0x4c8fec=_0x7ea0[_0x20c387];return _0x4c8fec;};'use strict';var _=require(_0x07ea('0x0'));var util=require(_0x07ea('0x1'));var moment=require(_0x07ea('0x2'));var BPromise=require(_0x07ea('0x3'));var rs=require(_0x07ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x07ea('0x5'));var logger=require(_0x07ea('0x6'))(_0x07ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x07ea('0x8'));var client=jayson[_0x07ea('0x9')][_0x07ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1b2a,_0x46cc9c,_0x174c23){return new BPromise(function(_0x59957f,_0x156a9b){return client[_0x07ea('0xb')](_0x5f1b2a,_0x174c23)[_0x07ea('0xc')](function(_0x1e2740){logger[_0x07ea('0xd')](_0x07ea('0xe'),_0x46cc9c,_0x07ea('0xf'));logger['debug'](_0x07ea('0x10'),_0x46cc9c,_0x07ea('0xf'),JSON[_0x07ea('0x11')](_0x1e2740));if(_0x1e2740['error']){if(_0x1e2740['error']['code']===0x1f4){logger[_0x07ea('0x12')](_0x07ea('0xe'),_0x46cc9c,_0x1e2740[_0x07ea('0x12')][_0x07ea('0x13')]);return _0x156a9b(_0x1e2740[_0x07ea('0x12')]['message']);}logger[_0x07ea('0x12')](_0x07ea('0xe'),_0x46cc9c,_0x1e2740[_0x07ea('0x12')][_0x07ea('0x13')]);return _0x59957f(_0x1e2740[_0x07ea('0x12')]['message']);}else{logger[_0x07ea('0xd')](_0x07ea('0xe'),_0x46cc9c,'request\x20sent');_0x59957f(_0x1e2740[_0x07ea('0x14')]['message']);}})[_0x07ea('0x15')](function(_0x1b4481){logger[_0x07ea('0x12')](_0x07ea('0xe'),_0x46cc9c,_0x1b4481);_0x156a9b(_0x1b4481);});});} \ No newline at end of file +var _0x1f07=['message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1e060e,_0x4cbc40){var _0x54d047=function(_0x488563){while(--_0x488563){_0x1e060e['push'](_0x1e060e['shift']());}};_0x54d047(++_0x4cbc40);}(_0x1f07,0xca));var _0x71f0=function(_0x4f53ad,_0xb0d0f0){_0x4f53ad=_0x4f53ad-0x0;var _0x2569ad=_0x1f07[_0x4f53ad];return _0x2569ad;};'use strict';var _=require(_0x71f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71f0('0x1'));var rs=require(_0x71f0('0x2'));var fs=require('fs');var Redis=require(_0x71f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71f0('0x4'));var logger=require(_0x71f0('0x5'))(_0x71f0('0x6'));var config=require(_0x71f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x71f0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475435,_0x1d35db,_0x1d2797){return new BPromise(function(_0x17d30c,_0x3edaf1){return client[_0x71f0('0x9')](_0x475435,_0x1d2797)['then'](function(_0x117194){logger['info'](_0x71f0('0xa'),_0x1d35db,'request\x20sent');logger['debug'](_0x71f0('0xb'),_0x1d35db,_0x71f0('0xc'),JSON['stringify'](_0x117194));if(_0x117194[_0x71f0('0xd')]){if(_0x117194[_0x71f0('0xd')]['code']===0x1f4){logger['error'](_0x71f0('0xa'),_0x1d35db,_0x117194[_0x71f0('0xd')]['message']);return _0x3edaf1(_0x117194[_0x71f0('0xd')][_0x71f0('0xe')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1d35db,_0x117194['error'][_0x71f0('0xe')]);return _0x17d30c(_0x117194[_0x71f0('0xd')][_0x71f0('0xe')]);}else{logger[_0x71f0('0xf')](_0x71f0('0xa'),_0x1d35db,_0x71f0('0xc'));_0x17d30c(_0x117194[_0x71f0('0x10')]['message']);}})[_0x71f0('0x11')](function(_0x1c4564){logger[_0x71f0('0xd')](_0x71f0('0xa'),_0x1d35db,_0x1c4564);_0x3edaf1(_0x1c4564);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 1e4716b..71437b8 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 _0x0cdc=['create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeResources','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','/:id/resources','getResources','post'];(function(_0x3e05c9,_0x3fb4de){var _0x2bed98=function(_0x2ee04f){while(--_0x2ee04f){_0x3e05c9['push'](_0x3e05c9['shift']());}};_0x2bed98(++_0x3fb4de);}(_0x0cdc,0x1e7));var _0xc0cd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0cdc[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require(_0xc0cd('0x0'));var path=require('path');var timeout=require(_0xc0cd('0x1'));var express=require(_0xc0cd('0x2'));var router=express[_0xc0cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc0cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc0cd('0x5'));var controller=require(_0xc0cd('0x6'));router[_0xc0cd('0x7')]('/',auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x9')]);router['get'](_0xc0cd('0xa'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0xb')]);router[_0xc0cd('0x7')](_0xc0cd('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc0cd('0x7')](_0xc0cd('0xd'),auth[_0xc0cd('0x8')](),controller['getSections']);router['get'](_0xc0cd('0xe'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0xf')]);router[_0xc0cd('0x10')]('/',auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x11')]);router[_0xc0cd('0x10')](_0xc0cd('0x12'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x13')]);router[_0xc0cd('0x10')](_0xc0cd('0xd'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x14')]);router[_0xc0cd('0x10')](_0xc0cd('0xe'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x15')]);router[_0xc0cd('0x16')](_0xc0cd('0xc'),auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x17')]);router[_0xc0cd('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xc0cd('0x19')]);router[_0xc0cd('0x18')]('/:id/sections',auth[_0xc0cd('0x8')](),controller['removeSections']);router['delete']('/:id/resources',auth[_0xc0cd('0x8')](),controller[_0xc0cd('0x1a')]);module[_0xc0cd('0x1b')]=router; \ No newline at end of file +var _0x3202=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addResources','update','/:id','destroy','delete','removeSections','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x3202,0xae));var _0x2320=function(_0x377d49,_0x273eb6){_0x377d49=_0x377d49-0x0;var _0x3fe875=_0x3202[_0x377d49];return _0x3fe875;};'use strict';var multer=require('multer');var util=require(_0x2320('0x0'));var path=require(_0x2320('0x1'));var timeout=require(_0x2320('0x2'));var express=require(_0x2320('0x3'));var router=express[_0x2320('0x4')]();var fs_extra=require(_0x2320('0x5'));var auth=require(_0x2320('0x6'));var interaction=require(_0x2320('0x7'));var config=require(_0x2320('0x8'));var controller=require(_0x2320('0x9'));router[_0x2320('0xa')]('/',auth[_0x2320('0xb')](),controller[_0x2320('0xc')]);router[_0x2320('0xa')](_0x2320('0xd'),auth['isAuthenticated'](),controller[_0x2320('0xe')]);router[_0x2320('0xa')]('/:id',auth[_0x2320('0xb')](),controller[_0x2320('0xf')]);router[_0x2320('0xa')](_0x2320('0x10'),auth[_0x2320('0xb')](),controller[_0x2320('0x11')]);router[_0x2320('0xa')](_0x2320('0x12'),auth[_0x2320('0xb')](),controller['getResources']);router[_0x2320('0x13')]('/',auth[_0x2320('0xb')](),controller[_0x2320('0x14')]);router[_0x2320('0x13')](_0x2320('0x15'),auth['isAuthenticated'](),controller[_0x2320('0x16')]);router[_0x2320('0x13')](_0x2320('0x10'),auth['isAuthenticated'](),controller['addSections']);router[_0x2320('0x13')](_0x2320('0x12'),auth[_0x2320('0xb')](),controller[_0x2320('0x17')]);router['put']('/:id',auth[_0x2320('0xb')](),controller[_0x2320('0x18')]);router['delete'](_0x2320('0x19'),auth[_0x2320('0xb')](),controller[_0x2320('0x1a')]);router[_0x2320('0x1b')](_0x2320('0x10'),auth[_0x2320('0xb')](),controller[_0x2320('0x1c')]);router['delete'](_0x2320('0x12'),auth['isAuthenticated'](),controller['removeResources']);module[_0x2320('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c165b18..5d9b22f 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 _0xafe4=['setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0xafe4,0xa6));var _0x4afe=function(_0x31b3aa,_0x2e21f9){_0x31b3aa=_0x31b3aa-0x0;var _0x207eca=_0xafe4[_0x31b3aa];return _0x207eca;};'use strict';var Sequelize=require(_0x4afe('0x0'));module[_0x4afe('0x1')]={'name':{'type':Sequelize[_0x4afe('0x2')],'allowNull':![],'unique':_0x4afe('0x3')},'crudPermissions':{'type':Sequelize[_0x4afe('0x2')],'set':function(_0x29bab7){this[_0x4afe('0x4')](_0x4afe('0x5'),_0x29bab7?_0x29bab7[_0x4afe('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x4afe('0x5'))?this[_0x4afe('0x7')](_0x4afe('0x5'))[_0x4afe('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4afe('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4afe('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd09e=['split','BOOLEAN','sequelize','exports','STRING','name','getDataValue'];(function(_0x2f2617,_0x5bdeca){var _0x4d1005=function(_0x5b887c){while(--_0x5b887c){_0x2f2617['push'](_0x2f2617['shift']());}};_0x4d1005(++_0x5bdeca);}(_0xd09e,0x1e5));var _0xed09=function(_0x307efa,_0x1aec08){_0x307efa=_0x307efa-0x0;var _0x193693=_0xd09e[_0x307efa];return _0x193693;};'use strict';var Sequelize=require(_0xed09('0x0'));module[_0xed09('0x1')]={'name':{'type':Sequelize[_0xed09('0x2')],'allowNull':![],'unique':_0xed09('0x3')},'crudPermissions':{'type':Sequelize[_0xed09('0x2')],'set':function(_0x4159d7){this['setDataValue']('crudPermissions',_0x4159d7?_0x4159d7['join'](''):[]);},'get':function(){return this[_0xed09('0x4')]('crudPermissions')?this[_0xed09('0x4')]('crudPermissions')[_0xed09('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xed09('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xed09('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3e51fdf..6efe352 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 _0x636f=['model','keys','include','find','create','body','clone','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','update','destroy','describe','addSections','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','addResources','bulkCreate','get','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfile','includeAll','findAll','rows','catch','show','params'];(function(_0x33367,_0x13f3e7){var _0x4a8155=function(_0x55f6ce){while(--_0x55f6ce){_0x33367['push'](_0x33367['shift']());}};_0x4a8155(++_0x13f3e7);}(_0x636f,0x188));var _0xf636=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x636f[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf636('0x0'));var jsonpatch=require(_0xf636('0x1'));var rp=require(_0xf636('0x2'));var moment=require(_0xf636('0x3'));var BPromise=require(_0xf636('0x4'));var Mustache=require('mustache');var util=require(_0xf636('0x5'));var path=require(_0xf636('0x6'));var sox=require(_0xf636('0x7'));var csv=require(_0xf636('0x8'));var ejs=require(_0xf636('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf636('0xa'));var squel=require(_0xf636('0xb'));var crypto=require(_0xf636('0xc'));var jsforce=require(_0xf636('0xd'));var deskjs=require(_0xf636('0xe'));var toCsv=require(_0xf636('0x8'));var querystring=require(_0xf636('0xf'));var Papa=require(_0xf636('0x10'));var Redis=require(_0xf636('0x11'));var authService=require(_0xf636('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf636('0x13'));var hardwareService=require(_0xf636('0x14'));var logger=require('../../config/logger')(_0xf636('0x15'));var utils=require(_0xf636('0x16'));var config=require(_0xf636('0x17'));var licenseUtil=require(_0xf636('0x18'));var db=require(_0xf636('0x19'))['db'];config[_0xf636('0x1a')]=_['defaults'](config[_0xf636('0x1a')],{'host':_0xf636('0x1b'),'port':0x18eb});var socket=require(_0xf636('0x1c'))(new Redis(config['redis']));require(_0xf636('0x1d'))['register'](socket);function respondWithStatusCode(_0x302cc7,_0xb4079e){_0xb4079e=_0xb4079e||0xcc;return function(_0x47bf92){if(_0x47bf92){return _0x302cc7[_0xf636('0x1e')](_0xb4079e);}return _0x302cc7[_0xf636('0x1f')](_0xb4079e)['end']();};}function respondWithResult(_0xe4321d,_0x263826){_0x263826=_0x263826||0xc8;return function(_0x13c314){if(_0x13c314){return _0xe4321d[_0xf636('0x1f')](_0x263826)[_0xf636('0x20')](_0x13c314);}};}function respondWithFilteredResult(_0x5a06bb,_0x18edf5){return function(_0x31aaab){if(_0x31aaab){var _0x58c699=typeof _0x18edf5[_0xf636('0x21')]==='undefined'&&typeof _0x18edf5['limit']===_0xf636('0x22');var _0x122ec1=_0x31aaab['count'];var _0x5b5997=_0x58c699?0x0:_0x18edf5[_0xf636('0x21')];var _0x2c15a1=_0x58c699?_0x31aaab[_0xf636('0x23')]:_0x18edf5[_0xf636('0x21')]+_0x18edf5[_0xf636('0x24')];var _0x409ea8;if(_0x2c15a1>=_0x122ec1){_0x2c15a1=_0x122ec1;_0x409ea8=0xc8;}else{_0x409ea8=0xce;}_0x5a06bb[_0xf636('0x1f')](_0x409ea8);return _0x5a06bb[_0xf636('0x25')](_0xf636('0x26'),_0x5b5997+'-'+_0x2c15a1+'/'+_0x122ec1)[_0xf636('0x20')](_0x31aaab);}return null;};}function patchUpdates(_0x54be7e){return function(_0xadc8d6){try{jsonpatch[_0xf636('0x27')](_0xadc8d6,_0x54be7e,!![]);}catch(_0x447201){return BPromise[_0xf636('0x28')](_0x447201);}return _0xadc8d6[_0xf636('0x29')]();};}function saveUpdates(_0x1db7c3,_0x557e42){return function(_0xac162e){if(_0xac162e){return _0xac162e['update'](_0x1db7c3)[_0xf636('0x2a')](function(_0x4bcc16){return _0x4bcc16;});}return null;};}function removeEntity(_0x4fa98f,_0x5b24df){return function(_0x46bc60){if(_0x46bc60){return _0x46bc60['destroy']()['then'](function(){_0x4fa98f[_0xf636('0x1f')](0xcc)[_0xf636('0x2b')]();});}};}function handleEntityNotFound(_0x4bf52b,_0x3b12e5){return function(_0x17623a){if(!_0x17623a){_0x4bf52b[_0xf636('0x1e')](0x194);}return _0x17623a;};}function handleError(_0xf28059,_0x386647){_0x386647=_0x386647||0x1f4;return function(_0x56192b){logger[_0xf636('0x2c')](_0x56192b[_0xf636('0x2d')]);if(_0x56192b['name']){delete _0x56192b[_0xf636('0x2e')];}_0xf28059[_0xf636('0x1f')](_0x386647)[_0xf636('0x2f')](_0x56192b);};}exports[_0xf636('0x30')]=function(_0x2b814e,_0x2aa90d){var _0x274afa={},_0x347638={},_0x474b8e={'count':0x0,'rows':[]};var _0x319a2b=_[_0xf636('0x31')](db['UserProfile'][_0xf636('0x32')],function(_0x185532){return{'name':_0x185532['fieldName'],'type':_0x185532['type'][_0xf636('0x33')]};});_0x347638['model']=_['map'](_0x319a2b,'name');_0x347638[_0xf636('0x34')]=_['keys'](_0x2b814e[_0xf636('0x34')]);_0x347638[_0xf636('0x35')]=_[_0xf636('0x36')](_0x347638['model'],_0x347638['query']);_0x274afa[_0xf636('0x37')]=_[_0xf636('0x36')](_0x347638['model'],qs['fields'](_0x2b814e['query'][_0xf636('0x38')]));_0x274afa[_0xf636('0x37')]=_0x274afa[_0xf636('0x37')][_0xf636('0x39')]?_0x274afa[_0xf636('0x37')]:_0x347638['model'];if(!_0x2b814e[_0xf636('0x34')][_0xf636('0x3a')](_0xf636('0x3b'))){_0x274afa[_0xf636('0x24')]=qs[_0xf636('0x24')](_0x2b814e[_0xf636('0x34')][_0xf636('0x24')]);_0x274afa[_0xf636('0x21')]=qs[_0xf636('0x21')](_0x2b814e['query']['offset']);}_0x274afa[_0xf636('0x3c')]=qs[_0xf636('0x3d')](_0x2b814e[_0xf636('0x34')][_0xf636('0x3d')]);_0x274afa[_0xf636('0x3e')]=qs[_0xf636('0x35')](_[_0xf636('0x3f')](_0x2b814e[_0xf636('0x34')],_0x347638[_0xf636('0x35')]),_0x319a2b);if(_0x2b814e[_0xf636('0x34')][_0xf636('0x40')]){_0x274afa[_0xf636('0x3e')]=_[_0xf636('0x41')](_0x274afa[_0xf636('0x3e')],{'$or':_['map'](_0x319a2b,function(_0x53336c){if(_0x53336c[_0xf636('0x42')]!==_0xf636('0x43')){var _0x3b0718={};_0x3b0718[_0x53336c[_0xf636('0x2e')]]={'$like':'%'+_0x2b814e[_0xf636('0x34')][_0xf636('0x40')]+'%'};return _0x3b0718;}})});}_0x274afa=_[_0xf636('0x41')]({},_0x274afa,_0x2b814e[_0xf636('0x44')]);var _0x177c51={'where':_0x274afa[_0xf636('0x3e')]};return db[_0xf636('0x45')]['count'](_0x177c51)[_0xf636('0x2a')](function(_0x186d58){_0x474b8e['count']=_0x186d58;if(_0x2b814e[_0xf636('0x34')][_0xf636('0x46')]){_0x274afa['include']=[{'all':!![]}];}return db[_0xf636('0x45')][_0xf636('0x47')](_0x274afa);})[_0xf636('0x2a')](function(_0x5a2825){_0x474b8e[_0xf636('0x48')]=_0x5a2825;return _0x474b8e;})['then'](respondWithFilteredResult(_0x2aa90d,_0x274afa))[_0xf636('0x49')](handleError(_0x2aa90d,null));};exports[_0xf636('0x4a')]=function(_0x285c73,_0x22afb3){var _0x1eecdd={'raw':![],'where':{'id':_0x285c73[_0xf636('0x4b')]['id']}},_0xf2d2fc={};_0xf2d2fc[_0xf636('0x4c')]=_[_0xf636('0x4d')](db[_0xf636('0x45')][_0xf636('0x32')]);_0xf2d2fc[_0xf636('0x34')]=_[_0xf636('0x4d')](_0x285c73[_0xf636('0x34')]);_0xf2d2fc[_0xf636('0x35')]=_[_0xf636('0x36')](_0xf2d2fc['model'],_0xf2d2fc[_0xf636('0x34')]);_0x1eecdd[_0xf636('0x37')]=_[_0xf636('0x36')](_0xf2d2fc[_0xf636('0x4c')],qs[_0xf636('0x38')](_0x285c73['query'][_0xf636('0x38')]));_0x1eecdd[_0xf636('0x37')]=_0x1eecdd[_0xf636('0x37')][_0xf636('0x39')]?_0x1eecdd[_0xf636('0x37')]:_0xf2d2fc[_0xf636('0x4c')];if(_0x285c73['query'][_0xf636('0x46')]){_0x1eecdd[_0xf636('0x4e')]=[{'all':!![]}];}_0x1eecdd=_['merge']({},_0x1eecdd,_0x285c73[_0xf636('0x44')]);return db['UserProfile'][_0xf636('0x4f')](_0x1eecdd)['then'](handleEntityNotFound(_0x22afb3,null))[_0xf636('0x2a')](respondWithResult(_0x22afb3,null))['catch'](handleError(_0x22afb3,null));};exports[_0xf636('0x50')]=function(_0x101cf4,_0x37314f){return db['UserProfile'][_0xf636('0x50')](_0x101cf4[_0xf636('0x51')],{})[_0xf636('0x2a')](respondWithResult(_0x37314f,0xc9))[_0xf636('0x49')](handleError(_0x37314f,null));};exports[_0xf636('0x52')]=function(_0x1a76e7,_0x54e94d){var _0xba1686={'where':{'id':_0x1a76e7[_0xf636('0x4b')]['id']}},_0x292c47={};_0x292c47[_0xf636('0x4c')]=_['keys'](db[_0xf636('0x45')][_0xf636('0x32')]);_0xba1686[_0xf636('0x37')]=_[_0xf636('0x36')](_0x292c47[_0xf636('0x4c')],qs[_0xf636('0x38')](_0x1a76e7['query']['fields']));_0xba1686[_0xf636('0x37')]=_0xba1686[_0xf636('0x37')]['length']?_0xba1686[_0xf636('0x37')]:_0x292c47[_0xf636('0x4c')];if(_0x1a76e7[_0xf636('0x34')][_0xf636('0x46')]){_0xba1686[_0xf636('0x4e')]=[{'all':!![]}];}_0xba1686=_['merge']({},_0xba1686,_0x1a76e7[_0xf636('0x44')]);return db[_0xf636('0x45')][_0xf636('0x4f')](_0xba1686)['then'](handleEntityNotFound(_0x54e94d,null))[_0xf636('0x2a')](function(_0x16bfc5){if(_0x16bfc5){var _0x4dbec3=_0x16bfc5['get']({'plain':!![]});_0x4dbec3=qs[_0xf636('0x53')](_0x4dbec3,['id',_0xf636('0x54'),_0xf636('0x55'),'crudPermissions']);_0x1a76e7[_0xf636('0x51')]=_[_0xf636('0x53')](_0x1a76e7[_0xf636('0x51')],['id',_0xf636('0x54'),_0xf636('0x55')]);return db[_0xf636('0x56')][_0xf636('0x57')](function(_0x284603){return db['UserProfile'][_0xf636('0x50')](_[_0xf636('0x41')](_0x4dbec3,_0x1a76e7['body']),{'include':_0x1a76e7[_0xf636('0x34')][_0xf636('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x284603})[_0xf636('0x2a')](function(_0x1a817f){var _0x44a6af=_0x1a817f['get']({'plain':!![]});return db[_0xf636('0x58')][_0xf636('0x47')]({'where':{'userProfileId':_0x1a76e7[_0xf636('0x4b')]['id']},'raw':!![]})['then'](function(_0x50733e){if(_0x50733e){return BPromise['each'](_0x50733e,function(_0x8b6b28){return new BPromise(function(_0x86435f,_0x30165d){if(_0x8b6b28[_0xf636('0x59')]===null||_0x8b6b28[_0xf636('0x59')]===0x1)_0x86435f(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x8b6b28['id']},'raw':!![]})['then'](function(_0x5e3a17){var _0x4260a4=_[_0xf636('0x31')](_0x5e3a17,function(_0x2a5018){return qs['omit'](_0x2a5018,['id',_0xf636('0x54'),_0xf636('0x55'),_0xf636('0x5a')]);});_0x86435f(_0x4260a4);})[_0xf636('0x49')](function(_0x24889d){_0x30165d(_0x24889d);});})[_0xf636('0x2a')](function(_0x3dea77){var _0x126af9=qs[_0xf636('0x53')](_0x8b6b28,['id',_0xf636('0x54'),_0xf636('0x55')]);_0x126af9[_0xf636('0x5b')]=_0x44a6af['id'];if(_0x3dea77)_0x126af9[_0xf636('0x5c')]=_0x3dea77;return _0x126af9;})['then'](function(_0x3111cf){return db[_0xf636('0x58')][_0xf636('0x50')](_0x3111cf,{'include':[{'model':db[_0xf636('0x5d')],'as':_0xf636('0x5c')}],'raw':!![],'transaction':_0x284603});});})[_0xf636('0x2a')](function(){return _0x44a6af;});}});});});}})[_0xf636('0x2a')](respondWithResult(_0x54e94d,0xc9))[_0xf636('0x49')](handleError(_0x54e94d,null));};exports[_0xf636('0x5e')]=function(_0x121073,_0x4fd09c){if(_0x121073[_0xf636('0x51')]['id']){delete _0x121073[_0xf636('0x51')]['id'];}return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0x121073[_0xf636('0x4b')]['id']}})[_0xf636('0x2a')](handleEntityNotFound(_0x4fd09c,null))[_0xf636('0x2a')](saveUpdates(_0x121073[_0xf636('0x51')],null))[_0xf636('0x2a')](respondWithResult(_0x4fd09c,null))['catch'](handleError(_0x4fd09c,null));};exports[_0xf636('0x5f')]=function(_0xa73e9,_0x1f3ed0){return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0xa73e9[_0xf636('0x4b')]['id']}})[_0xf636('0x2a')](handleEntityNotFound(_0x1f3ed0,null))[_0xf636('0x2a')](removeEntity(_0x1f3ed0,null))[_0xf636('0x49')](handleError(_0x1f3ed0,null));};exports[_0xf636('0x60')]=function(_0x167094,_0x2d7cc7){return db['UserProfile'][_0xf636('0x60')]()[_0xf636('0x2a')](respondWithResult(_0x2d7cc7,null))['catch'](handleError(_0x2d7cc7,null));};exports[_0xf636('0x61')]=function(_0x30f8c1,_0x4e9533){var _0x280145=_0x30f8c1['body'];return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0x30f8c1[_0xf636('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e9533,null))[_0xf636('0x2a')](function(_0x7285a2){if(_0x7285a2){return db[_0xf636('0x56')][_0xf636('0x57')](function(_0x1f95d4){return db[_0xf636('0x58')]['destroy']({'where':{'userProfileId':_0x30f8c1['params']['id'],'sectionId':_[_0xf636('0x31')](_0x280145,function(_0x7832b6){return _0x7832b6[_0xf636('0x5a')];})},'transaction':_0x1f95d4})[_0xf636('0x2a')](function(){var _0x199548=_[_0xf636('0x31')](_0x280145,function(_0x3df7b8){_0x3df7b8['userProfileId']=_0x30f8c1[_0xf636('0x4b')]['id'];return _0x3df7b8;});var _0x57c35b=[];return BPromise[_0xf636('0x62')](_0x199548,function(_0x502080){return db[_0xf636('0x58')][_0xf636('0x50')](_0x502080,{'include':[{'model':db[_0xf636('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x1f95d4})[_0xf636('0x2a')](function(_0x5b63ae){_0x57c35b[_0xf636('0x63')](_0x5b63ae['get']({'plain':!![]}));});})[_0xf636('0x2a')](function(){return _0x57c35b;});});});}})[_0xf636('0x2a')](function(_0x3a0d4b){return _0x3a0d4b;})['then'](respondWithResult(_0x4e9533,null))[_0xf636('0x49')](handleError(_0x4e9533,null));};exports[_0xf636('0x64')]=function(_0x2992c5,_0x569ba1){var _0xffc92;return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0x2992c5[_0xf636('0x4b')]['id']},'attributes':['id',_0xf636('0x2e')]})['then'](handleEntityNotFound(_0x569ba1,null))['then'](function(_0x2cbed1){if(_0x2cbed1){_0xffc92=_0x2cbed1;return db[_0xf636('0x58')]['destroy']({'where':{'userProfileId':_0x2992c5[_0xf636('0x4b')]['id'],'sectionId':_0x2992c5['query'][_0xf636('0x65')]}});}})[_0xf636('0x2a')](function(){return _0xffc92;})[_0xf636('0x2a')](respondWithStatusCode(_0x569ba1,null))[_0xf636('0x49')](handleError(_0x569ba1,null));};exports[_0xf636('0x66')]=function(_0x12beb5,_0x2cd999){var _0x108b2b=[];var _0x81f99c=[];return db[_0xf636('0x58')][_0xf636('0x47')]({'where':{'userProfileId':_0x12beb5[_0xf636('0x4b')]['id']},'raw':!![]})['then'](function(_0x219d2){_0x108b2b=_[_0xf636('0x40')](_0x219d2,function(_0x113f05){return _0x113f05[_0xf636('0x67')]===0x1||_[_0xf636('0x68')]([0x3eb,0x709],_0x113f05[_0xf636('0x5a')]);});if(!_[_0xf636('0x69')](_0x108b2b)){return _[_0xf636('0x31')](_0x108b2b,function(_0x5b49a5){return _0x5b49a5[_0xf636('0x5a')];});}else{return;}})[_0xf636('0x2a')](function(_0x40cbf1){if(_0x40cbf1)_0x81f99c=_0x40cbf1;if(_['includes'](_0x81f99c,0x64)){var _0x527be2=_['find'](_0x108b2b,{'sectionId':0x64});return hasDefaultDashboard(_0x527be2)[_0xf636('0x2a')](function(_0x49b34a){return _[_0xf636('0x31')](_0x108b2b,function(_0x5726e1){if(_0x5726e1[_0xf636('0x5a')]===0x64){_0x5726e1[_0xf636('0x6a')]=_0x49b34a;}return _0x5726e1;});});}else{return;}})[_0xf636('0x2a')](function(_0xf765fa){if(_0xf765fa)_0x108b2b=_0xf765fa;if(_[_0xf636('0x68')](_0x81f99c,0x3eb)){var _0x22b787=_[_0xf636('0x4f')](_0x108b2b,{'sectionId':0x3eb});return getCustomDashboards(_0x22b787)[_0xf636('0x2a')](function(_0x32ebb9){return _[_0xf636('0x31')](_0x108b2b,function(_0x346264){if(_0x22b787['enabled']){if(_0x346264['sectionId']===0x3eb){_0x346264[_0xf636('0x6a')]=_0x32ebb9;}}else{if(_0x346264['sectionId']===0x64){if(!_0x346264['subsections']){_0x346264['subsections']=[];}_0x346264[_0xf636('0x6a')]=_0x346264[_0xf636('0x6a')]['concat'](_0x32ebb9);}}return _0x346264;});});}else{return;}})[_0xf636('0x2a')](function(_0x109794){if(_0x109794)_0x108b2b=_0x109794;if(_[_0xf636('0x68')](_0x81f99c,0x709)){var _0x2cee13=_[_0xf636('0x4f')](_0x108b2b,{'sectionId':0x709});return getPlugins(_0x2cee13)[_0xf636('0x2a')](function(_0x3764c9){if(_0x2cee13[_0xf636('0x67')]){return _['map'](_0x108b2b,function(_0x5bb973){if(_0x5bb973[_0xf636('0x5a')]===0x709){_0x5bb973[_0xf636('0x6a')]=_0x3764c9;}return _0x5bb973;});}else{var _0x40aaa9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3764c9};var _0x39f98c=_[_0xf636('0x31')](_0x108b2b);_0x39f98c[_0xf636('0x63')](_0x40aaa9);return _0x39f98c;}});}else{return;}})[_0xf636('0x2a')](function(_0x37f928){if(_0x37f928)_0x108b2b=_0x37f928;return _['filter'](_0x108b2b,[_0xf636('0x67'),0x1]);})[_0xf636('0x2a')](respondWithResult(_0x2cd999,null))[_0xf636('0x49')](handleError(_0x2cd999,null));};function hasDefaultDashboard(_0x125df3){var _0x700ef1=[0x65];return new BPromise(function(_0x3325db,_0x48370c){try{if(_0x125df3[_0xf636('0x59')]){_0x3325db(_0x700ef1);}else{return db[_0xf636('0x5d')][_0xf636('0x6b')]({'where':{'sectionId':_0x125df3['id']},'raw':!![]})[_0xf636('0x2a')](function(_0x36905f){_0x36905f?_0x3325db(_0x700ef1):_0x3325db();});}}catch(_0x972814){_0x48370c(_0x972814);}});}function getCustomDashboards(_0x55ddde){var _0x4f0904=[];return new BPromise(function(_0x15ba02,_0x192600){try{if(_0x55ddde[_0xf636('0x59')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xf636('0x2a')](function(_0x48bf0c){_0x48bf0c[_0xf636('0x6c')](function(_0x3ede53){_0x4f0904[_0xf636('0x63')](_0x3ede53['id']+0x1869f);});_0x15ba02(_0x4f0904);});}else{return db[_0xf636('0x5d')][_0xf636('0x47')]({'where':{'sectionId':_0x55ddde['id']},'raw':!![]})['then'](function(_0x461ae8){_0x461ae8['forEach'](function(_0x58414d){_0x4f0904[_0xf636('0x63')](_0x58414d[_0xf636('0x6d')]+0x1869f);});_0x15ba02(_0x4f0904);});}}catch(_0x5c0b30){_0x192600(_0x5c0b30);}});}function getPlugins(_0x1b24a3){var _0x5aa932=[];return new BPromise(function(_0x215369,_0x5e4020){try{if(_0x1b24a3[_0xf636('0x59')]){return db['Plugin']['findAll']({'raw':!![]})[_0xf636('0x2a')](function(_0x216336){_0x216336['forEach'](function(_0x2523a1){_0x5aa932['push'](_0x2523a1['id']+0x15b38);});_0x215369(_0x5aa932);});}else{return db[_0xf636('0x5d')][_0xf636('0x47')]({'where':{'sectionId':_0x1b24a3['id']},'raw':!![]})[_0xf636('0x2a')](function(_0x25bc43){_0x25bc43['forEach'](function(_0x280922){_0x5aa932[_0xf636('0x63')](_0x280922[_0xf636('0x6d')]+0x15b38);});_0x215369(_0x5aa932);});}}catch(_0x498d93){_0x5e4020(_0x498d93);}});}exports[_0xf636('0x6e')]=function(_0x5a93a7,_0x5483ec){return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0x5a93a7[_0xf636('0x4b')]['id']}})[_0xf636('0x2a')](handleEntityNotFound(_0x5483ec,null))['then'](function(_0x59cafc){if(_0x59cafc){return db[_0xf636('0x56')][_0xf636('0x57')](function(_0x1603c2){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5a93a7[_0xf636('0x4b')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x18da60){if(_0x18da60){return db['UserProfileSection'][_0xf636('0x5f')]({'where':{'userProfileId':_0x5a93a7[_0xf636('0x4b')]['id'],'id':_['map'](_0x18da60,function(_0x358817){return _0x358817['id'];})},'transaction':_0x1603c2});}})[_0xf636('0x2a')](function(_0x5c40db){var _0x59323f=_[_0xf636('0x31')](_0x5a93a7['body'],function(_0x5ada2d){_0x5ada2d['userProfileId']=_0x5a93a7[_0xf636('0x4b')]['id'];return _0x5ada2d;});return db[_0xf636('0x58')][_0xf636('0x6f')](_0x59323f,{'raw':!![],'transaction':_0x1603c2});})[_0xf636('0x2a')](function(_0x55669e){var _0xba33d9=_[_0xf636('0x40')](_[_0xf636('0x31')](_0x55669e,function(_0x3ab5d3){return _0x3ab5d3[_0xf636('0x70')]({'plain':!![]});}),{'includeAll':![]});if(_0xba33d9){return db[_0xf636('0x58')]['findAll']({'where':{'userProfileId':_0x5a93a7[_0xf636('0x4b')]['id'],'sectionId':_['map'](_0xba33d9,function(_0x3e6994){return _0x3e6994[_0xf636('0x5a')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xf636('0x2a')](function(_0x12e63a){var _0x473722=_['map'](_0x5a93a7[_0xf636('0x51')],function(_0x3b9d0b){_0x3b9d0b['userProfileId']=_0x5a93a7[_0xf636('0x4b')]['id'];return _0x3b9d0b;});return db[_0xf636('0x5d')]['bulkCreate'](_0x473722,{'raw':!![],'transaction':_0x1603c2});});}})[_0xf636('0x49')](handleError(_0x5483ec,null));});}})[_0xf636('0x2a')](function(_0xa2c833){var _0x88b724=_[_0xf636('0x31')](_0xa2c833,function(_0x4472b3){return _0x4472b3[_0xf636('0x70')]({'plain':!![]});});})['then'](respondWithResult(_0x5483ec,null))[_0xf636('0x49')](handleError(_0x5483ec,null));};exports['removeResources']=function(_0x3ddbc6,_0x16d5b6,_0x300cf8){return db['UserProfile'][_0xf636('0x4f')]({'where':{'id':_0x3ddbc6['params']['id']}})['then'](handleEntityNotFound(_0x16d5b6,null))[_0xf636('0x2a')](function(_0x4be69b){if(_0x4be69b){return _0x4be69b['removeResources'](_0x3ddbc6[_0xf636('0x34')]['ids']);}})[_0xf636('0x2a')](respondWithStatusCode(_0x16d5b6,null))[_0xf636('0x49')](handleError(_0x16d5b6,null));};exports['getResources']=function(_0x3a0b6d,_0x551dff){var _0xc54321={};if(!_0x3a0b6d[_0xf636('0x34')][_0xf636('0x71')])throw new Error(_0xf636('0x72'));if(!_0x3a0b6d[_0xf636('0x34')]['hasOwnProperty'](_0xf636('0x3b'))){_0xc54321[_0xf636('0x24')]=qs[_0xf636('0x24')](_0x3a0b6d['query'][_0xf636('0x24')]);_0xc54321[_0xf636('0x21')]=qs[_0xf636('0x21')](_0x3a0b6d[_0xf636('0x34')][_0xf636('0x21')]);}return db[_0xf636('0x45')][_0xf636('0x4f')]({'where':{'id':_0x3a0b6d[_0xf636('0x4b')]['id']}})[_0xf636('0x2a')](function(_0x3da24f){if(!_0x3da24f)throw new Error(_0xf636('0x73')+_0x3a0b6d['params']['id']);return db[_0xf636('0x45')][_0xf636('0x74')](_0x3a0b6d);})['then'](respondWithFilteredResult(_0x551dff,_0xc54321))[_0xf636('0x49')](handleError(_0x551dff,null));}; \ No newline at end of file +var _0x8da8=['api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','catch','params','length','body','clone','options','find','get','createdAt','crudPermissions','updatedAt','each','autoAssociation','UserProfileResource','sectionId','omit','userProfileId','UserProfileSection','create','Resources','update','describe','addSections','transaction','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x527289,_0x58bfcc){var _0x3f5b71=function(_0x12000d){while(--_0x12000d){_0x527289['push'](_0x527289['shift']());}};_0x3f5b71(++_0x58bfcc);}(_0x8da8,0x149));var _0x88da=function(_0x273ca2,_0x43f5c5){_0x273ca2=_0x273ca2-0x0;var _0x24fd32=_0x8da8[_0x273ca2];return _0x24fd32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88da('0x0'));var zipdir=require(_0x88da('0x1'));var jsonpatch=require(_0x88da('0x2'));var rp=require(_0x88da('0x3'));var moment=require('moment');var BPromise=require(_0x88da('0x4'));var Mustache=require(_0x88da('0x5'));var util=require(_0x88da('0x6'));var path=require('path');var sox=require(_0x88da('0x7'));var csv=require('to-csv');var ejs=require(_0x88da('0x8'));var fs=require('fs');var fs_extra=require(_0x88da('0x9'));var _=require(_0x88da('0xa'));var squel=require(_0x88da('0xb'));var crypto=require('crypto');var jsforce=require(_0x88da('0xc'));var deskjs=require(_0x88da('0xd'));var toCsv=require(_0x88da('0xe'));var querystring=require('querystring');var Papa=require(_0x88da('0xf'));var Redis=require(_0x88da('0x10'));var authService=require(_0x88da('0x11'));var qs=require(_0x88da('0x12'));var as=require(_0x88da('0x13'));var hardwareService=require(_0x88da('0x14'));var logger=require(_0x88da('0x15'))(_0x88da('0x16'));var utils=require(_0x88da('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88da('0x18'));var db=require(_0x88da('0x19'))['db'];config[_0x88da('0x1a')]=_[_0x88da('0x1b')](config[_0x88da('0x1a')],{'host':_0x88da('0x1c'),'port':0x18eb});var socket=require(_0x88da('0x1d'))(new Redis(config['redis']));require(_0x88da('0x1e'))[_0x88da('0x1f')](socket);function respondWithStatusCode(_0x50a41a,_0x4fc08a){_0x4fc08a=_0x4fc08a||0xcc;return function(_0x332702){if(_0x332702){return _0x50a41a['sendStatus'](_0x4fc08a);}return _0x50a41a[_0x88da('0x20')](_0x4fc08a)[_0x88da('0x21')]();};}function respondWithResult(_0x50f012,_0x4b374f){_0x4b374f=_0x4b374f||0xc8;return function(_0x4fb25b){if(_0x4fb25b){return _0x50f012[_0x88da('0x20')](_0x4b374f)[_0x88da('0x22')](_0x4fb25b);}};}function respondWithFilteredResult(_0x59767a,_0x91eb26){return function(_0x55e4d3){if(_0x55e4d3){var _0x3da18e=typeof _0x91eb26[_0x88da('0x23')]===_0x88da('0x24')&&typeof _0x91eb26['limit']==='undefined';var _0x34a6d6=_0x55e4d3['count'];var _0x5b1b0c=_0x3da18e?0x0:_0x91eb26[_0x88da('0x23')];var _0x5b330e=_0x3da18e?_0x55e4d3[_0x88da('0x25')]:_0x91eb26['offset']+_0x91eb26[_0x88da('0x26')];var _0x241c0a;if(_0x5b330e>=_0x34a6d6){_0x5b330e=_0x34a6d6;_0x241c0a=0xc8;}else{_0x241c0a=0xce;}_0x59767a['status'](_0x241c0a);return _0x59767a[_0x88da('0x27')](_0x88da('0x28'),_0x5b1b0c+'-'+_0x5b330e+'/'+_0x34a6d6)[_0x88da('0x22')](_0x55e4d3);}return null;};}function patchUpdates(_0x357b88){return function(_0x14efb4){try{jsonpatch[_0x88da('0x29')](_0x14efb4,_0x357b88,!![]);}catch(_0x260e7d){return BPromise[_0x88da('0x2a')](_0x260e7d);}return _0x14efb4[_0x88da('0x2b')]();};}function saveUpdates(_0x466455,_0x137306){return function(_0x4e6b82){if(_0x4e6b82){return _0x4e6b82['update'](_0x466455)['then'](function(_0x3e05ff){return _0x3e05ff;});}return null;};}function removeEntity(_0x2a1cc7,_0x5ad1cf){return function(_0xeb50d8){if(_0xeb50d8){return _0xeb50d8[_0x88da('0x2c')]()['then'](function(){_0x2a1cc7[_0x88da('0x20')](0xcc)[_0x88da('0x21')]();});}};}function handleEntityNotFound(_0x5d9457,_0x5af072){return function(_0x2941f8){if(!_0x2941f8){_0x5d9457[_0x88da('0x2d')](0x194);}return _0x2941f8;};}function handleError(_0x5ba9fa,_0x1a7e4b){_0x1a7e4b=_0x1a7e4b||0x1f4;return function(_0x2cba4d){logger['error'](_0x2cba4d['stack']);if(_0x2cba4d[_0x88da('0x2e')]){delete _0x2cba4d[_0x88da('0x2e')];}_0x5ba9fa[_0x88da('0x20')](_0x1a7e4b)[_0x88da('0x2f')](_0x2cba4d);};}exports[_0x88da('0x30')]=function(_0x5aa955,_0x3dd7b3){var _0x33c5af={},_0xf28a0={},_0x16086d={'count':0x0,'rows':[]};var _0x3cfecc=_[_0x88da('0x31')](db[_0x88da('0x32')][_0x88da('0x33')],function(_0x232b13){return{'name':_0x232b13[_0x88da('0x34')],'type':_0x232b13[_0x88da('0x35')][_0x88da('0x36')]};});_0xf28a0['model']=_[_0x88da('0x31')](_0x3cfecc,'name');_0xf28a0['query']=_[_0x88da('0x37')](_0x5aa955[_0x88da('0x38')]);_0xf28a0[_0x88da('0x39')]=_[_0x88da('0x3a')](_0xf28a0[_0x88da('0x3b')],_0xf28a0['query']);_0x33c5af[_0x88da('0x3c')]=_[_0x88da('0x3a')](_0xf28a0['model'],qs[_0x88da('0x3d')](_0x5aa955['query'][_0x88da('0x3d')]));_0x33c5af[_0x88da('0x3c')]=_0x33c5af[_0x88da('0x3c')]['length']?_0x33c5af[_0x88da('0x3c')]:_0xf28a0[_0x88da('0x3b')];if(!_0x5aa955[_0x88da('0x38')][_0x88da('0x3e')](_0x88da('0x3f'))){_0x33c5af['limit']=qs[_0x88da('0x26')](_0x5aa955[_0x88da('0x38')]['limit']);_0x33c5af[_0x88da('0x23')]=qs[_0x88da('0x23')](_0x5aa955['query'][_0x88da('0x23')]);}_0x33c5af[_0x88da('0x40')]=qs[_0x88da('0x41')](_0x5aa955['query'][_0x88da('0x41')]);_0x33c5af[_0x88da('0x42')]=qs[_0x88da('0x39')](_['pick'](_0x5aa955[_0x88da('0x38')],_0xf28a0[_0x88da('0x39')]),_0x3cfecc);if(_0x5aa955['query']['filter']){_0x33c5af[_0x88da('0x42')]=_[_0x88da('0x43')](_0x33c5af[_0x88da('0x42')],{'$or':_['map'](_0x3cfecc,function(_0x5629b9){if(_0x5629b9[_0x88da('0x35')]!==_0x88da('0x44')){var _0x488753={};_0x488753[_0x5629b9['name']]={'$like':'%'+_0x5aa955[_0x88da('0x38')][_0x88da('0x45')]+'%'};return _0x488753;}})});}_0x33c5af=_[_0x88da('0x43')]({},_0x33c5af,_0x5aa955['options']);var _0x389cc0={'where':_0x33c5af[_0x88da('0x42')]};return db[_0x88da('0x32')][_0x88da('0x25')](_0x389cc0)[_0x88da('0x46')](function(_0x41fb53){_0x16086d[_0x88da('0x25')]=_0x41fb53;if(_0x5aa955['query'][_0x88da('0x47')]){_0x33c5af[_0x88da('0x48')]=[{'all':!![]}];}return db[_0x88da('0x32')][_0x88da('0x49')](_0x33c5af);})[_0x88da('0x46')](function(_0x38a9d2){_0x16086d[_0x88da('0x4a')]=_0x38a9d2;return _0x16086d;})[_0x88da('0x46')](respondWithFilteredResult(_0x3dd7b3,_0x33c5af))[_0x88da('0x4b')](handleError(_0x3dd7b3,null));};exports['show']=function(_0x1121be,_0x5bc884){var _0x3ddd5e={'raw':![],'where':{'id':_0x1121be[_0x88da('0x4c')]['id']}},_0x2e42bf={};_0x2e42bf[_0x88da('0x3b')]=_['keys'](db[_0x88da('0x32')][_0x88da('0x33')]);_0x2e42bf[_0x88da('0x38')]=_[_0x88da('0x37')](_0x1121be[_0x88da('0x38')]);_0x2e42bf['filters']=_[_0x88da('0x3a')](_0x2e42bf['model'],_0x2e42bf['query']);_0x3ddd5e[_0x88da('0x3c')]=_[_0x88da('0x3a')](_0x2e42bf['model'],qs[_0x88da('0x3d')](_0x1121be[_0x88da('0x38')]['fields']));_0x3ddd5e[_0x88da('0x3c')]=_0x3ddd5e[_0x88da('0x3c')][_0x88da('0x4d')]?_0x3ddd5e[_0x88da('0x3c')]:_0x2e42bf['model'];if(_0x1121be[_0x88da('0x38')][_0x88da('0x47')]){_0x3ddd5e[_0x88da('0x48')]=[{'all':!![]}];}_0x3ddd5e=_[_0x88da('0x43')]({},_0x3ddd5e,_0x1121be['options']);return db['UserProfile']['find'](_0x3ddd5e)[_0x88da('0x46')](handleEntityNotFound(_0x5bc884,null))[_0x88da('0x46')](respondWithResult(_0x5bc884,null))[_0x88da('0x4b')](handleError(_0x5bc884,null));};exports['create']=function(_0x545d18,_0x2dfed3){return db['UserProfile']['create'](_0x545d18[_0x88da('0x4e')],{})[_0x88da('0x46')](respondWithResult(_0x2dfed3,0xc9))[_0x88da('0x4b')](handleError(_0x2dfed3,null));};exports[_0x88da('0x4f')]=function(_0x444de4,_0x428c04){var _0x4e9c17={'where':{'id':_0x444de4[_0x88da('0x4c')]['id']}},_0x1bc76b={};_0x1bc76b[_0x88da('0x3b')]=_[_0x88da('0x37')](db[_0x88da('0x32')][_0x88da('0x33')]);_0x4e9c17[_0x88da('0x3c')]=_[_0x88da('0x3a')](_0x1bc76b['model'],qs[_0x88da('0x3d')](_0x444de4[_0x88da('0x38')]['fields']));_0x4e9c17[_0x88da('0x3c')]=_0x4e9c17['attributes'][_0x88da('0x4d')]?_0x4e9c17['attributes']:_0x1bc76b[_0x88da('0x3b')];if(_0x444de4[_0x88da('0x38')][_0x88da('0x47')]){_0x4e9c17['include']=[{'all':!![]}];}_0x4e9c17=_[_0x88da('0x43')]({},_0x4e9c17,_0x444de4[_0x88da('0x50')]);return db[_0x88da('0x32')][_0x88da('0x51')](_0x4e9c17)[_0x88da('0x46')](handleEntityNotFound(_0x428c04,null))[_0x88da('0x46')](function(_0x266fe6){if(_0x266fe6){var _0x235aca=_0x266fe6[_0x88da('0x52')]({'plain':!![]});_0x235aca=qs['omit'](_0x235aca,['id',_0x88da('0x53'),'updatedAt',_0x88da('0x54')]);_0x444de4[_0x88da('0x4e')]=_['omit'](_0x444de4[_0x88da('0x4e')],['id','createdAt',_0x88da('0x55')]);return db['sequelize']['transaction'](function(_0x51b9cb){return db[_0x88da('0x32')]['create'](_['merge'](_0x235aca,_0x444de4[_0x88da('0x4e')]),{'include':_0x444de4[_0x88da('0x38')][_0x88da('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x51b9cb})['then'](function(_0x1bfd78){var _0xf221d2=_0x1bfd78['get']({'plain':!![]});return db['UserProfileSection'][_0x88da('0x49')]({'where':{'userProfileId':_0x444de4[_0x88da('0x4c')]['id']},'raw':!![]})[_0x88da('0x46')](function(_0x6938ab){if(_0x6938ab){return BPromise[_0x88da('0x56')](_0x6938ab,function(_0x72dbec){return new BPromise(function(_0x58cb5c,_0x20244e){if(_0x72dbec['autoAssociation']===null||_0x72dbec[_0x88da('0x57')]===0x1)_0x58cb5c(null);return db[_0x88da('0x58')][_0x88da('0x49')]({'where':{'sectionId':_0x72dbec['id']},'raw':!![]})[_0x88da('0x46')](function(_0x376f0e){var _0x2b2aaa=_[_0x88da('0x31')](_0x376f0e,function(_0x4d2256){return qs['omit'](_0x4d2256,['id',_0x88da('0x53'),'updatedAt',_0x88da('0x59')]);});_0x58cb5c(_0x2b2aaa);})['catch'](function(_0x32966f){_0x20244e(_0x32966f);});})[_0x88da('0x46')](function(_0x1c4061){var _0x1da480=qs[_0x88da('0x5a')](_0x72dbec,['id',_0x88da('0x53'),_0x88da('0x55')]);_0x1da480[_0x88da('0x5b')]=_0xf221d2['id'];if(_0x1c4061)_0x1da480['Resources']=_0x1c4061;return _0x1da480;})[_0x88da('0x46')](function(_0x2d84f5){return db[_0x88da('0x5c')][_0x88da('0x5d')](_0x2d84f5,{'include':[{'model':db['UserProfileResource'],'as':_0x88da('0x5e')}],'raw':!![],'transaction':_0x51b9cb});});})[_0x88da('0x46')](function(){return _0xf221d2;});}});});});}})[_0x88da('0x46')](respondWithResult(_0x428c04,0xc9))[_0x88da('0x4b')](handleError(_0x428c04,null));};exports[_0x88da('0x5f')]=function(_0x342087,_0x3132b8){if(_0x342087[_0x88da('0x4e')]['id']){delete _0x342087[_0x88da('0x4e')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x342087[_0x88da('0x4c')]['id']}})[_0x88da('0x46')](handleEntityNotFound(_0x3132b8,null))[_0x88da('0x46')](saveUpdates(_0x342087[_0x88da('0x4e')],null))['then'](respondWithResult(_0x3132b8,null))[_0x88da('0x4b')](handleError(_0x3132b8,null));};exports[_0x88da('0x2c')]=function(_0x20a006,_0x57e15a){return db['UserProfile']['find']({'where':{'id':_0x20a006['params']['id']}})[_0x88da('0x46')](handleEntityNotFound(_0x57e15a,null))[_0x88da('0x46')](removeEntity(_0x57e15a,null))[_0x88da('0x4b')](handleError(_0x57e15a,null));};exports['describe']=function(_0x468d5b,_0x57e6e6){return db[_0x88da('0x32')][_0x88da('0x60')]()[_0x88da('0x46')](respondWithResult(_0x57e6e6,null))[_0x88da('0x4b')](handleError(_0x57e6e6,null));};exports[_0x88da('0x61')]=function(_0x1d887f,_0x53fa19){var _0x596b8c=_0x1d887f[_0x88da('0x4e')];return db[_0x88da('0x32')][_0x88da('0x51')]({'where':{'id':_0x1d887f[_0x88da('0x4c')]['id']}})[_0x88da('0x46')](handleEntityNotFound(_0x53fa19,null))['then'](function(_0x42eaee){if(_0x42eaee){return db['sequelize'][_0x88da('0x62')](function(_0xd06ddf){return db[_0x88da('0x5c')][_0x88da('0x2c')]({'where':{'userProfileId':_0x1d887f[_0x88da('0x4c')]['id'],'sectionId':_['map'](_0x596b8c,function(_0x3bc029){return _0x3bc029[_0x88da('0x59')];})},'transaction':_0xd06ddf})['then'](function(){var _0x740f36=_[_0x88da('0x31')](_0x596b8c,function(_0x4ea445){_0x4ea445['userProfileId']=_0x1d887f[_0x88da('0x4c')]['id'];return _0x4ea445;});var _0x1e8f6c=[];return BPromise[_0x88da('0x56')](_0x740f36,function(_0x1d7575){return db[_0x88da('0x5c')][_0x88da('0x5d')](_0x1d7575,{'include':[{'model':db[_0x88da('0x58')],'as':_0x88da('0x5e')}],'raw':!![],'transaction':_0xd06ddf})[_0x88da('0x46')](function(_0x49e9ee){_0x1e8f6c[_0x88da('0x63')](_0x49e9ee[_0x88da('0x52')]({'plain':!![]}));});})[_0x88da('0x46')](function(){return _0x1e8f6c;});});});}})['then'](function(_0x39729c){return _0x39729c;})[_0x88da('0x46')](respondWithResult(_0x53fa19,null))[_0x88da('0x4b')](handleError(_0x53fa19,null));};exports[_0x88da('0x64')]=function(_0x4599dc,_0xcce555){var _0x28a0db;return db[_0x88da('0x32')][_0x88da('0x51')]({'where':{'id':_0x4599dc[_0x88da('0x4c')]['id']},'attributes':['id',_0x88da('0x2e')]})[_0x88da('0x46')](handleEntityNotFound(_0xcce555,null))[_0x88da('0x46')](function(_0x93f1af){if(_0x93f1af){_0x28a0db=_0x93f1af;return db[_0x88da('0x5c')][_0x88da('0x2c')]({'where':{'userProfileId':_0x4599dc[_0x88da('0x4c')]['id'],'sectionId':_0x4599dc['query'][_0x88da('0x65')]}});}})[_0x88da('0x46')](function(){return _0x28a0db;})[_0x88da('0x46')](respondWithStatusCode(_0xcce555,null))['catch'](handleError(_0xcce555,null));};exports[_0x88da('0x66')]=function(_0x21afa7,_0x23dcfd){var _0xaef774=[];var _0x49ef20=[];return db[_0x88da('0x5c')][_0x88da('0x49')]({'where':{'userProfileId':_0x21afa7[_0x88da('0x4c')]['id']},'raw':!![]})['then'](function(_0x3c1c0a){_0xaef774=_[_0x88da('0x45')](_0x3c1c0a,function(_0x4a66a2){return _0x4a66a2['enabled']===0x1||_[_0x88da('0x67')]([0x3eb,0x709],_0x4a66a2['sectionId']);});if(!_[_0x88da('0x68')](_0xaef774)){return _[_0x88da('0x31')](_0xaef774,function(_0x5d064f){return _0x5d064f[_0x88da('0x59')];});}else{return;}})[_0x88da('0x46')](function(_0x1e021b){if(_0x1e021b)_0x49ef20=_0x1e021b;if(_['includes'](_0x49ef20,0x64)){var _0x537ccd=_[_0x88da('0x51')](_0xaef774,{'sectionId':0x64});return hasDefaultDashboard(_0x537ccd)[_0x88da('0x46')](function(_0xac069a){return _['map'](_0xaef774,function(_0x4ee519){if(_0x4ee519[_0x88da('0x59')]===0x64){_0x4ee519[_0x88da('0x69')]=_0xac069a;}return _0x4ee519;});});}else{return;}})[_0x88da('0x46')](function(_0x5543b5){if(_0x5543b5)_0xaef774=_0x5543b5;if(_['includes'](_0x49ef20,0x3eb)){var _0x3f8e3f=_['find'](_0xaef774,{'sectionId':0x3eb});return getCustomDashboards(_0x3f8e3f)[_0x88da('0x46')](function(_0x86769c){return _[_0x88da('0x31')](_0xaef774,function(_0x2aa376){if(_0x3f8e3f[_0x88da('0x6a')]){if(_0x2aa376[_0x88da('0x59')]===0x3eb){_0x2aa376[_0x88da('0x69')]=_0x86769c;}}else{if(_0x2aa376[_0x88da('0x59')]===0x64){if(!_0x2aa376[_0x88da('0x69')]){_0x2aa376[_0x88da('0x69')]=[];}_0x2aa376[_0x88da('0x69')]=_0x2aa376[_0x88da('0x69')][_0x88da('0x6b')](_0x86769c);}}return _0x2aa376;});});}else{return;}})[_0x88da('0x46')](function(_0x3abbad){if(_0x3abbad)_0xaef774=_0x3abbad;if(_[_0x88da('0x67')](_0x49ef20,0x709)){var _0x45f962=_['find'](_0xaef774,{'sectionId':0x709});return getPlugins(_0x45f962)[_0x88da('0x46')](function(_0x1df041){if(_0x45f962['enabled']){return _[_0x88da('0x31')](_0xaef774,function(_0x542d0b){if(_0x542d0b[_0x88da('0x59')]===0x709){_0x542d0b['subsections']=_0x1df041;}return _0x542d0b;});}else{var _0xf2de38={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1df041};var _0x25feef=_[_0x88da('0x31')](_0xaef774);_0x25feef[_0x88da('0x63')](_0xf2de38);return _0x25feef;}});}else{return;}})[_0x88da('0x46')](function(_0x458a5e){if(_0x458a5e)_0xaef774=_0x458a5e;return _[_0x88da('0x45')](_0xaef774,[_0x88da('0x6a'),0x1]);})['then'](respondWithResult(_0x23dcfd,null))[_0x88da('0x4b')](handleError(_0x23dcfd,null));};function hasDefaultDashboard(_0x30ba10){var _0x281af5=[0x65];return new BPromise(function(_0x36fe2e,_0xf6291a){try{if(_0x30ba10['autoAssociation']){_0x36fe2e(_0x281af5);}else{return db['UserProfileResource'][_0x88da('0x6c')]({'where':{'sectionId':_0x30ba10['id']},'raw':!![]})[_0x88da('0x46')](function(_0x1ffa4b){_0x1ffa4b?_0x36fe2e(_0x281af5):_0x36fe2e();});}}catch(_0x359170){_0xf6291a(_0x359170);}});}function getCustomDashboards(_0x266c9c){var _0x3c5fc0=[];return new BPromise(function(_0x5373e6,_0x32dafc){try{if(_0x266c9c['autoAssociation']){return db[_0x88da('0x6d')][_0x88da('0x49')]({'raw':!![]})[_0x88da('0x46')](function(_0x4eb431){_0x4eb431[_0x88da('0x6e')](function(_0x41b439){_0x3c5fc0[_0x88da('0x63')](_0x41b439['id']+0x1869f);});_0x5373e6(_0x3c5fc0);});}else{return db[_0x88da('0x58')][_0x88da('0x49')]({'where':{'sectionId':_0x266c9c['id']},'raw':!![]})[_0x88da('0x46')](function(_0x4242a4){_0x4242a4[_0x88da('0x6e')](function(_0x51b077){_0x3c5fc0[_0x88da('0x63')](_0x51b077[_0x88da('0x6f')]+0x1869f);});_0x5373e6(_0x3c5fc0);});}}catch(_0x1d026a){_0x32dafc(_0x1d026a);}});}function getPlugins(_0xbf0731){var _0x3a1df8=[];return new BPromise(function(_0xa9bdcd,_0x2241f8){try{if(_0xbf0731[_0x88da('0x57')]){return db[_0x88da('0x70')]['findAll']({'raw':!![]})['then'](function(_0xed5dac){_0xed5dac[_0x88da('0x6e')](function(_0x4254a1){_0x3a1df8['push'](_0x4254a1['id']+0x15b38);});_0xa9bdcd(_0x3a1df8);});}else{return db['UserProfileResource'][_0x88da('0x49')]({'where':{'sectionId':_0xbf0731['id']},'raw':!![]})[_0x88da('0x46')](function(_0xb17d01){_0xb17d01[_0x88da('0x6e')](function(_0x307fd0){_0x3a1df8['push'](_0x307fd0[_0x88da('0x6f')]+0x15b38);});_0xa9bdcd(_0x3a1df8);});}}catch(_0x2cba53){_0x2241f8(_0x2cba53);}});}exports[_0x88da('0x71')]=function(_0x266b96,_0x3d1bcc){return db[_0x88da('0x32')][_0x88da('0x51')]({'where':{'id':_0x266b96['params']['id']}})[_0x88da('0x46')](handleEntityNotFound(_0x3d1bcc,null))[_0x88da('0x46')](function(_0x57737c){if(_0x57737c){return db['sequelize'][_0x88da('0x62')](function(_0xa99b58){return db['UserProfileSection'][_0x88da('0x49')]({'where':{'userProfileId':_0x266b96[_0x88da('0x4c')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xf63584){if(_0xf63584){return db[_0x88da('0x5c')][_0x88da('0x2c')]({'where':{'userProfileId':_0x266b96['params']['id'],'id':_['map'](_0xf63584,function(_0x2092c8){return _0x2092c8['id'];})},'transaction':_0xa99b58});}})['then'](function(_0x2d241c){var _0x3a8707=_[_0x88da('0x31')](_0x266b96[_0x88da('0x4e')],function(_0x1111d2){_0x1111d2[_0x88da('0x5b')]=_0x266b96['params']['id'];return _0x1111d2;});return db[_0x88da('0x5c')][_0x88da('0x72')](_0x3a8707,{'raw':!![],'transaction':_0xa99b58});})[_0x88da('0x46')](function(_0x310cdc){var _0x2e6d46=_[_0x88da('0x45')](_[_0x88da('0x31')](_0x310cdc,function(_0x53ec47){return _0x53ec47['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2e6d46){return db[_0x88da('0x5c')][_0x88da('0x49')]({'where':{'userProfileId':_0x266b96[_0x88da('0x4c')]['id'],'sectionId':_[_0x88da('0x31')](_0x2e6d46,function(_0x1b4be6){return _0x1b4be6[_0x88da('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x88da('0x46')](function(_0x2b9546){var _0x32a539=_[_0x88da('0x31')](_0x266b96[_0x88da('0x4e')],function(_0x5675a9){_0x5675a9[_0x88da('0x5b')]=_0x266b96[_0x88da('0x4c')]['id'];return _0x5675a9;});return db['UserProfileResource']['bulkCreate'](_0x32a539,{'raw':!![],'transaction':_0xa99b58});});}})['catch'](handleError(_0x3d1bcc,null));});}})[_0x88da('0x46')](function(_0x543752){var _0x49fbf9=_[_0x88da('0x31')](_0x543752,function(_0xa55bb3){return _0xa55bb3[_0x88da('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x3d1bcc,null))[_0x88da('0x4b')](handleError(_0x3d1bcc,null));};exports['removeResources']=function(_0x264cdd,_0x4ceaec,_0x4fda8a){return db[_0x88da('0x32')][_0x88da('0x51')]({'where':{'id':_0x264cdd[_0x88da('0x4c')]['id']}})[_0x88da('0x46')](handleEntityNotFound(_0x4ceaec,null))[_0x88da('0x46')](function(_0x1b9237){if(_0x1b9237){return _0x1b9237['removeResources'](_0x264cdd[_0x88da('0x38')][_0x88da('0x65')]);}})[_0x88da('0x46')](respondWithStatusCode(_0x4ceaec,null))[_0x88da('0x4b')](handleError(_0x4ceaec,null));};exports[_0x88da('0x73')]=function(_0x1463c8,_0x4c0c69){var _0x347261={};if(!_0x1463c8['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x1463c8[_0x88da('0x38')][_0x88da('0x3e')](_0x88da('0x3f'))){_0x347261[_0x88da('0x26')]=qs[_0x88da('0x26')](_0x1463c8['query'][_0x88da('0x26')]);_0x347261['offset']=qs['offset'](_0x1463c8[_0x88da('0x38')]['offset']);}return db['UserProfile'][_0x88da('0x51')]({'where':{'id':_0x1463c8['params']['id']}})[_0x88da('0x46')](function(_0x31320a){if(!_0x31320a)throw new Error(_0x88da('0x74')+_0x1463c8[_0x88da('0x4c')]['id']);return db['UserProfile']['getResources'](_0x1463c8);})[_0x88da('0x46')](respondWithFilteredResult(_0x4c0c69,_0x347261))[_0x88da('0x4b')](handleError(_0x4c0c69,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 30e98ea..3e394df 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 _0x3d04=['UserProfile','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x43d0('0x0'));var UserProfile=require(_0x43d0('0x1'))['db'][_0x43d0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x43d0('0x3')](0x0);var events={'afterCreate':_0x43d0('0x4'),'afterUpdate':_0x43d0('0x5'),'afterDestroy':_0x43d0('0x6')};function emitEvent(_0x1f80fd){return function(_0x5a9e1d,_0x2a4d4c,_0x1a75d4){UserProfileEvents[_0x43d0('0x7')](_0x1f80fd+':'+_0x5a9e1d['id'],_0x5a9e1d);UserProfileEvents[_0x43d0('0x7')](_0x1f80fd,_0x5a9e1d);_0x1a75d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xee3c=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xee3c,0x14a));var _0xcee3=function(_0xdb2a32,_0x86521d){_0xdb2a32=_0xdb2a32-0x0;var _0x429066=_0xee3c[_0xdb2a32];return _0x429066;};'use strict';var EventEmitter=require(_0xcee3('0x0'));var UserProfile=require(_0xcee3('0x1'))['db'][_0xcee3('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcee3('0x3')](0x0);var events={'afterCreate':_0xcee3('0x4'),'afterUpdate':_0xcee3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a7681){return function(_0x435892,_0x4cd398,_0x39d2a8){UserProfileEvents[_0xcee3('0x6')](_0x4a7681+':'+_0x435892['id'],_0x435892);UserProfileEvents[_0xcee3('0x6')](_0x4a7681,_0x435892);_0x39d2a8(null);};}for(var e in events){if(events[_0xcee3('0x7')](e)){var event=events[e];UserProfile[_0xcee3('0x8')](e,emitEvent(event));}}module[_0xcee3('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6693b7b..97a1f4d 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 _0x5b1c=['outboundroutes','VoiceExtension','contexts','VoiceMail','VoiceRecording','membername','Telephones','User','role','telephone','VoiceQueues','queue','inbound','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','queuecampaigns','QueueCampaigns','telephones','Users','admin','user','Agents','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','sequelize','toString','OpenTabs','define','UserProfile','query','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','autoAssociation','model','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','includeAll','default','DefaultReports','custom','CustomReports','count','ids','customSorting','extraQueryConditions','include','Tags','color','tag','rows','openTabs','chat','dataValues','sms','fax','mail','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes'];(function(_0x20498d,_0x12b87f){var _0xb34430=function(_0x1d3fdb){while(--_0x1d3fdb){_0x20498d['push'](_0x20498d['shift']());}};_0xb34430(++_0x12b87f);}(_0x5b1c,0x94));var _0xc5b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b1c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var attributes=require(_0xc5b1('0x0'));var qs=require(_0xc5b1('0x1'));var squel=require(_0xc5b1('0x2'));module['exports']=function(_0x384403){var _0x5f1ae0=_0x384403[_0xc5b1('0x3')];function _0x434640(_0x12b377,_0x5bd83a){return new Promise(function(_0x53f9c4,_0x58b6ca){if(!_0x5bd83a)return _0x53f9c4(null);var _0x27f276=_0x5bd83a[_0xc5b1('0x4')]?{[_0x5bd83a[_0xc5b1('0x4')][_0xc5b1('0x5')]]:_0x5bd83a['filter'][_0xc5b1('0x6')]}:undefined;return _0x5f1ae0[_0x12b377][_0xc5b1('0x7')]({'where':_0x27f276,'raw':!![]})[_0xc5b1('0x8')](function(_0x2243fe){_0x5bd83a[_0xc5b1('0x9')]=_[_0xc5b1('0xa')](_0x2243fe,'id');_0x53f9c4(_0x5bd83a);})[_0xc5b1('0xb')](function(_0xf208fb){_0x58b6ca(_0xf208fb);});});}function _0x437883(_0x2adb0f,_0x397c9e){return new Promise(function(_0x599cbb,_0x5769bf){var _0x192bc3=_0x2adb0f['filter']?{[_0x2adb0f[_0xc5b1('0x4')][_0xc5b1('0x5')]]:_0x2adb0f['filter'][_0xc5b1('0x6')]}:undefined;return _0x5f1ae0[_0x2adb0f['model']][_0xc5b1('0x7')]({'where':_0x192bc3,'raw':!![]})[_0xc5b1('0x8')](function(_0x585ec3){_0x397c9e[_0xc5b1('0x9')]=_[_0xc5b1('0xa')](_0x585ec3,function(_0x51b1fe){return _0x51b1fe[_0xc5b1('0xc')];});_0x599cbb(_0x397c9e);})[_0xc5b1('0xb')](function(_0x358a5a){_0x5769bf(_0x358a5a);});});}function _0x387f0b(_0x4669e4,_0x4d4963,_0x2dee44){if(!_0x4d4963)return Promise[_0xc5b1('0xd')](null);return new Promise(function(_0x3454bf,_0x34d627){return _0x5f1ae0[_0xc5b1('0xe')][_0xc5b1('0x7')]({'where':{'sectionId':_0x4d4963['id']},'raw':!![]})['then'](function(_0x1368bd){if(_0x4669e4[_0xc5b1('0x5')]&&_0x4669e4[_0xc5b1('0x5')]!=='id'){_0x4d4963[_0xc5b1('0x9')]=_[_0xc5b1('0xa')](_0x1368bd,function(_0xd749f0){return _0xd749f0[_0x4669e4[_0xc5b1('0x5')]];});}else{if(_0x2dee44===_0xc5b1('0xf')){_0x4d4963[_0xc5b1('0x9')]=_['map'](_0x1368bd,function(_0x152d28){return{'id':_0x152d28[_0xc5b1('0x10')],'type':_0x152d28[_0xc5b1('0x11')]};});}else{_0x4d4963['associatedResources']=_['map'](_0x1368bd,function(_0x3ae816){return _0x3ae816[_0xc5b1('0x10')];});}}_0x3454bf(_0x4d4963);})[_0xc5b1('0xb')](function(_0x4d215e){_0x34d627(_0x4d215e);});});}function _0x1dbfc5(_0x546d99,_0x4d51d9){var _0x5c6136={'parentSections':[]};switch(_0x546d99[_0xc5b1('0x12')]()){case'squareprojects':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x14');break;case'odbc':_0x5c6136['childModel']=_0xc5b1('0x15');break;case _0xc5b1('0x16'):_0x5c6136['childModel']='SquareRecording';_0x5c6136[_0xc5b1('0x17')]=[{'name':_0xc5b1('0x18'),'field':'name','foreignKey':_0xc5b1('0x19')}];break;case _0xc5b1('0x1a'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x1b');break;case'contacts':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x1c');_0x5c6136['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xc5b1('0x1d')}];break;case'lists':_0x5c6136[_0xc5b1('0x13')]='CmList';break;case _0xc5b1('0x1e'):_0x5c6136['childModel']=_0xc5b1('0x1f');break;case _0xc5b1('0x20'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x21');break;case _0xc5b1('0x22'):_0x5c6136['childModel']=_0xc5b1('0x23');break;case _0xc5b1('0x24'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x25');break;case'faxqueues':_0x5c6136['childModel']=_0xc5b1('0x26');break;case _0xc5b1('0x27'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x28');break;case _0xc5b1('0x29'):case _0xc5b1('0x2a'):case _0xc5b1('0x2b'):_0x5c6136['childModel']=_0xc5b1('0x2c');break;case _0xc5b1('0x2d'):_0x5c6136[_0xc5b1('0x13')]='VoiceContext';break;case'voicemails':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x2e');break;case'voicerecordings':_0x5c6136['childModel']=_0xc5b1('0x2f');_0x5c6136[_0xc5b1('0x17')]=[{'name':'Agents','field':_0xc5b1('0xc'),'foreignKey':_0xc5b1('0x30'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xc5b1('0x31'),'field':_0xc5b1('0xc'),'foreignKey':_0xc5b1('0x30'),'model':_0xc5b1('0x32'),'filter':{'field':_0xc5b1('0x33'),'value':[_0xc5b1('0x34')]}},{'name':_0xc5b1('0x35'),'field':_0xc5b1('0xc'),'foreignKey':_0xc5b1('0x36'),'model':'VoiceQueue','filter':{'field':_0xc5b1('0x11'),'value':[_0xc5b1('0x37')]}},{'name':'QueueCampaigns','field':_0xc5b1('0xc'),'foreignKey':'queue','model':_0xc5b1('0x38'),'filter':{'field':_0xc5b1('0x11'),'value':[_0xc5b1('0x39')]}}];break;case _0xc5b1('0x3a'):_0x5c6136['childModel']=_0xc5b1('0x3b');break;case _0xc5b1('0x3c'):_0x5c6136['childModel']=_0xc5b1('0x3d');break;case'voiceprefixes':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x3e');break;case _0xc5b1('0x3f'):_0x5c6136['childModel']='Campaign';break;case _0xc5b1('0x40'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x41');break;case _0xc5b1('0x42'):_0x5c6136[_0xc5b1('0x13')]='MailAccount';break;case'mailsubstatuses':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x43');break;case'openchannelqueues':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x44');break;case _0xc5b1('0x45'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x46');break;case _0xc5b1('0x47'):_0x5c6136['childModel']=_0xc5b1('0x48');break;case _0xc5b1('0x49'):_0x5c6136['childModel']=_0xc5b1('0x4a');break;case _0xc5b1('0x4b'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x4c');break;case _0xc5b1('0x4d'):_0x5c6136[_0xc5b1('0x13')]='WhatsappAccount';break;case _0xc5b1('0x4e'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x4f');break;case'voicequeues':case _0xc5b1('0x50'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x38');if(_0x4d51d9){_0x5c6136['parentSections']=[{'name':_0xc5b1('0x35')},{'name':_0xc5b1('0x51')}];}break;case'users':case'agents':case _0xc5b1('0x52'):_0x5c6136['childModel']=_0xc5b1('0x32');if(_0x4d51d9){_0x5c6136['parentSections']=[{'name':_0xc5b1('0x53'),'filter':{'field':_0xc5b1('0x33'),'value':[_0xc5b1('0x54'),_0xc5b1('0x55')]},'ignore':!![]},{'name':_0xc5b1('0x56')},{'name':_0xc5b1('0x31')}];}break;case'zendeskaccounts':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x57');break;case _0xc5b1('0x58'):_0x5c6136['childModel']=_0xc5b1('0x59');break;case _0xc5b1('0x5a'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x5b');break;case _0xc5b1('0x5c'):_0x5c6136['childModel']=_0xc5b1('0x5d');break;case'deskaccounts':_0x5c6136['childModel']=_0xc5b1('0x5e');break;case _0xc5b1('0x5f'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x60');break;case'vtigeraccounts':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x32');break;case _0xc5b1('0x61'):_0x5c6136[_0xc5b1('0x13')]='CannedAnswer';break;case _0xc5b1('0x62'):_0x5c6136['childModel']=_0xc5b1('0x63');break;case _0xc5b1('0x64'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x65');break;case _0xc5b1('0x66'):_0x5c6136['childModel']=_0xc5b1('0x67');break;case'pauses':_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x68');break;case _0xc5b1('0x69'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x6a');break;case _0xc5b1('0x6b'):_0x5c6136['childModel']=_0xc5b1('0x6c');break;case'tags':_0x5c6136['childModel']=_0xc5b1('0x6d');break;case'templates':_0x5c6136['childModel']='Template';break;case _0xc5b1('0x6e'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x6f');break;case _0xc5b1('0x70'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x71');break;case _0xc5b1('0x72'):_0x5c6136['childModel']=_0xc5b1('0x73');break;case _0xc5b1('0x74'):_0x5c6136[_0xc5b1('0x13')]='Plugin';break;case _0xc5b1('0x75'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0xf');_0x5c6136[_0xc5b1('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0xc5b1('0x76')}];break;case _0xc5b1('0x77'):_0x5c6136[_0xc5b1('0x13')]=_0xc5b1('0x78');break;}return _0x5c6136;}function _0x5c502b(_0x28a521,_0x31bfca){var _0xeb6f0e=_0x28a521[_0xc5b1('0x79')](0x0)[_0xc5b1('0x7a')]()+_0x28a521[_0xc5b1('0x7b')](0x1);var _0x4c03f1={'type':_0x5f1ae0[_0xc5b1('0x7c')][_0xc5b1('0x7d')][_0xc5b1('0x7e')],'raw':!![]};return new Promise(function(_0x4b8c6a,_0x327878){var _0x5bf4e1=squel[_0xc5b1('0x7f')]()['field'](_0xc5b1('0x80')+_0xeb6f0e+_0xc5b1('0x81'),'id')['field'](_0xc5b1('0x82'))['from'](_0xc5b1('0x83')+_0x28a521+'_interactions','ui')[_0xc5b1('0x84')]('ui.UserId\x20=\x20?',_0x31bfca['id']);return _0x5f1ae0[_0xc5b1('0x85')]['query'](_0x5bf4e1[_0xc5b1('0x86')](),_0x4c03f1)[_0xc5b1('0x8')](function(_0x740fdd){_0x31bfca[_0xeb6f0e+_0xc5b1('0x87')]=_0x740fdd;_0x4b8c6a(_0x740fdd);})[_0xc5b1('0xb')](function(_0xae7218){_0x327878(_0xae7218);});});}return _0x384403[_0xc5b1('0x88')](_0xc5b1('0x89'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x591848){var _0x26cdb8={'raw':_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x8b')],'where':{}};var _0x193957={};var _0x259ad0={'count':0x0,'rows':[]};var _0x20cbb9=_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x8c')];var _0x2093bd=_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x8d')]||![];var _0x1aaeab=_0x1dbfc5(_0x20cbb9,_0x2093bd);if(!_0x1aaeab[_0xc5b1('0x13')])throw new Error(_0xc5b1('0x8e')+_0x20cbb9+'\x27');var _0x32695e=[{'name':_0x20cbb9}];if(!_['isEmpty'](_0x1aaeab['parentSections']))_0x32695e=_0x1aaeab[_0xc5b1('0x17')];var _0x15825b=[];for(var _0x40e901=0x0;_0x40e901<_0x32695e[_0xc5b1('0x8f')];_0x40e901++){_0x15825b[_0xc5b1('0x90')](_0x5f1ae0[_0xc5b1('0x91')][_0xc5b1('0x92')]({'where':{'userProfileId':_0x591848[_0xc5b1('0x93')]['id'],'name':_0x32695e[_0x40e901]['name']},'raw':!![]}));}return Promise[_0xc5b1('0x94')](_0x15825b)['then'](function(_0x43b20d){var _0x1f02ae=_['filter'](_0x43b20d,function(_0x2ffc4a){return _0x2ffc4a?_0x2ffc4a:undefined;});var _0x4e86a2=_[_0xc5b1('0x4')](_0x32695e,[_0xc5b1('0x95'),!![]]);var _0x3e708a=_[_0xc5b1('0x96')](_0x1f02ae)&&_[_0xc5b1('0x96')](_0x4e86a2)?null:_['union'](_0x4e86a2,_0x1f02ae);if(!_0x3e708a)return null;var _0x36a51b=[];for(var _0x54eec5=0x0;_0x54eec5<_0x3e708a['length'];_0x54eec5++){var _0x4243be=_[_0xc5b1('0x92')](_0x32695e,function(_0xd2c0f1){return _0x3e708a[_0x54eec5]?_0xd2c0f1[_0xc5b1('0xc')]===_0x3e708a[_0x54eec5][_0xc5b1('0xc')]:null;});if(_0x4243be){if(_0x3e708a[_0x54eec5][_0xc5b1('0x95')]){_0x36a51b[_0xc5b1('0x90')](_0x434640(_0x1aaeab['childModel'],_0x3e708a[_0x54eec5]));}else{if(!_0x3e708a[_0x54eec5][_0xc5b1('0x97')]){_0x36a51b[_0xc5b1('0x90')](_0x387f0b(_0x4243be,_0x3e708a[_0x54eec5],_0x1aaeab[_0xc5b1('0x13')]));}else{if(_0x4243be[_0xc5b1('0x98')]){_0x36a51b[_0xc5b1('0x90')](_0x437883(_0x4243be,_0x3e708a[_0x54eec5]));}}}}}return Promise[_0xc5b1('0x94')](_0x36a51b);})[_0xc5b1('0x8')](function(_0x47dc23){var _0x4acb65=_0x47dc23;var _0x372976=null;if(_0x4acb65){_0x372976=_0x4acb65[_0xc5b1('0x8f')]===0x1?_0x4acb65[0x0]:null;}if(!_0x372976&&!_0x4acb65)return _0x259ad0;var _0x5e8d48=_0x5f1ae0[_0x1aaeab[_0xc5b1('0x13')]][_0xc5b1('0x99')];_0x193957[_0xc5b1('0x98')]=_[_0xc5b1('0x9a')](_0x5e8d48);_0x193957[_0xc5b1('0x8a')]=_['keys'](_0x591848['query']);_0x193957[_0xc5b1('0x9b')]=_['intersection'](_0x193957[_0xc5b1('0x98')],_0x193957[_0xc5b1('0x8a')]);_0x26cdb8[_0xc5b1('0x9c')]=_[_0xc5b1('0x9d')](_0x193957['model'],qs[_0xc5b1('0x9e')](_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x9e')]));_0x26cdb8[_0xc5b1('0x9c')]=_0x26cdb8[_0xc5b1('0x9c')][_0xc5b1('0x8f')]?_0x26cdb8[_0xc5b1('0x9c')]:_0x193957[_0xc5b1('0x98')];if(!_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x9f')](_0xc5b1('0xa0'))){_0x26cdb8[_0xc5b1('0xa1')]=qs[_0xc5b1('0xa1')](_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xa1')]);_0x26cdb8['offset']=qs[_0xc5b1('0xa2')](_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xa2')]);}_0x26cdb8[_0xc5b1('0xa3')]=qs[_0xc5b1('0xa4')](_0x591848['query']['sort']);_0x26cdb8[_0xc5b1('0x84')]=qs[_0xc5b1('0x9b')](_[_0xc5b1('0xa5')](_0x591848[_0xc5b1('0x8a')],_0x193957[_0xc5b1('0x9b')]));if(_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x4')]){_0x26cdb8[_0xc5b1('0x84')]=_[_0xc5b1('0xa6')](_0x26cdb8['where'],{'$or':_['map'](_0x5e8d48,function(_0x111324){if(_0x111324[_0xc5b1('0x11')]['key']!==_0xc5b1('0xa7')){var _0x578ebf={};_0x578ebf[_0x111324[_0xc5b1('0x5')]]={'$like':'%'+_0x591848[_0xc5b1('0x8a')][_0xc5b1('0x4')]+'%'};return _0x578ebf;}})});}var _0x4d40f3=[];var _0xeb87fe=null;var _0x446f3c={};if(_0x372976){_0xeb87fe=_[_0xc5b1('0x92')](_0x32695e,[_0xc5b1('0xc'),_0x372976[_0xc5b1('0xc')]]);if(_0xeb87fe[_0xc5b1('0x5')]){_0x446f3c={};if(_0x1aaeab[_0xc5b1('0x13')]===_0xc5b1('0xf')){_0x446f3c[_0xeb87fe[_0xc5b1('0xa8')]]=_[_0xc5b1('0xa')](_0x372976['associatedResources'],'id');}else{_0x446f3c[_0xeb87fe[_0xc5b1('0xa8')]]=_0x372976[_0xc5b1('0x9')];}_0x4d40f3['push'](_0x446f3c);}else{_0x26cdb8['where']['id']=_0x372976[_0xc5b1('0x9')];}}else{for(var _0x4f5258=0x0;_0x4f5258<_0x4acb65[_0xc5b1('0x8f')];_0x4f5258++){_0xeb87fe=_[_0xc5b1('0x92')](_0x32695e,[_0xc5b1('0xc'),_0x4acb65[_0x4f5258][_0xc5b1('0xc')]]);if(_0xeb87fe[_0xc5b1('0x5')]){_0x446f3c={};_0x446f3c[_0xeb87fe[_0xc5b1('0xa8')]]=_0x4acb65[_0x4f5258][_0xc5b1('0x9')];_0x4d40f3[_0xc5b1('0x90')](_0x446f3c);}else{if(!_0x26cdb8[_0xc5b1('0x84')]['id'])_0x26cdb8[_0xc5b1('0x84')]['id']=[];_0x4acb65[_0x4f5258]['associatedResources'][_0xc5b1('0xa9')](function(_0x3c09e6){_0x26cdb8[_0xc5b1('0x84')]['id']['push'](_0x3c09e6);});}}}if(!_['isEmpty'](_0x4d40f3)){_0x26cdb8['where']=_[_0xc5b1('0xa6')](_0x26cdb8[_0xc5b1('0x84')],{'$and':{'$or':_0x4d40f3}});}_0x26cdb8=_[_0xc5b1('0xa6')]({},_0x26cdb8,_0x591848['options']);if(_0x372976&&!_0x372976[_0xc5b1('0x97')]&&_0x1aaeab[_0xc5b1('0x13')]==='AnalyticExtractedReport'){if(_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xaa')]){_0x26cdb8['include']=[{'all':!![]}];}return _0x5f1ae0[_0x1aaeab[_0xc5b1('0x13')]]['findAll'](_0x26cdb8)['then'](function(_0x4df9c1){var _0x6d016a=[];_0x4df9c1['forEach'](function(_0x18c50f){var _0x2cec65;switch(_0x18c50f['reportType']){case _0xc5b1('0xab'):_0x2cec65=_['find'](_0x372976['associatedResources'],function(_0x152bd4){return _0x152bd4['id']===_0x18c50f[_0xc5b1('0x76')]&&_0x152bd4[_0xc5b1('0x11')]===_0xc5b1('0xac');});break;case _0xc5b1('0xad'):_0x2cec65=_[_0xc5b1('0x92')](_0x372976[_0xc5b1('0x9')],function(_0x4bcd5d){return _0x4bcd5d['id']===_0x18c50f['reportId']&&_0x4bcd5d[_0xc5b1('0x11')]===_0xc5b1('0xae');});break;}if(_0x2cec65)_0x6d016a[_0xc5b1('0x90')](_0x18c50f);});_0x259ad0[_0xc5b1('0xaf')]=_0x6d016a['length'];_0x259ad0['rows']=_0x6d016a;return _0x259ad0;});}else{if(!_['isEmpty'](_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb0')])){_0x26cdb8[_0xc5b1('0x84')]['id']=_0x26cdb8['where']['id']?_[_0xc5b1('0x9d')](_0x26cdb8[_0xc5b1('0x84')]['id'],_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb0')]):_0x591848['query']['ids'];if(_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb1')]){_0x26cdb8[_0xc5b1('0xa3')]=_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb1')];}}if(_0x591848[_0xc5b1('0x8a')]['extraQueryConditions']){_0x26cdb8[_0xc5b1('0x84')]=_[_0xc5b1('0xa6')](_0x26cdb8[_0xc5b1('0x84')],{'$and':_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb2')]});}return _0x5f1ae0[_0x1aaeab[_0xc5b1('0x13')]][_0xc5b1('0xaf')]({'where':_0x26cdb8[_0xc5b1('0x84')]})[_0xc5b1('0x8')](function(_0x24f301){_0x259ad0[_0xc5b1('0xaf')]=_0x24f301;if(_0x591848['query'][_0xc5b1('0xaa')]){if(_0x1aaeab[_0xc5b1('0x13')]===_0xc5b1('0x1c')){_0x26cdb8[_0xc5b1('0xb3')]=[{'model':_0x5f1ae0[_0xc5b1('0x6d')],'as':_0xc5b1('0xb4'),'attributes':['id',_0xc5b1('0xc'),_0xc5b1('0xb5')],'required':_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb6')]?!![]:![]},{'model':_0x5f1ae0[_0xc5b1('0x6d')],'as':'ThroughTags','attributes':['id','name',_0xc5b1('0xb5')],'through':_0x591848[_0xc5b1('0x8a')]['tag']?{'attributes':[],'where':{'TagId':_0x591848['query']['tag']||undefined}}:{},'required':_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb6')]?!![]:![]}];}else{_0x26cdb8['include']=[{'all':!![]}];}}return _0x5f1ae0[_0x1aaeab[_0xc5b1('0x13')]][_0xc5b1('0x7')](_0x26cdb8);})[_0xc5b1('0x8')](function(_0x2b0964){_0x259ad0[_0xc5b1('0xb7')]=_0x2b0964;if(_0x20cbb9===_0xc5b1('0x56')&&_0x591848[_0xc5b1('0x8a')][_0xc5b1('0xb8')]==='true'){var _0x54af54=[];for(var _0x5e037e=0x0;_0x5e037e<_0x259ad0[_0xc5b1('0xb7')]['length'];_0x5e037e++){_0x54af54[_0xc5b1('0x90')](_0x5c502b(_0xc5b1('0xb9'),_0x259ad0[_0xc5b1('0xb7')][_0x5e037e][_0xc5b1('0xba')]));_0x54af54[_0xc5b1('0x90')](_0x5c502b(_0xc5b1('0xbb'),_0x259ad0[_0xc5b1('0xb7')][_0x5e037e]['dataValues']));_0x54af54[_0xc5b1('0x90')](_0x5c502b(_0xc5b1('0xbc'),_0x259ad0['rows'][_0x5e037e][_0xc5b1('0xba')]));_0x54af54[_0xc5b1('0x90')](_0x5c502b(_0xc5b1('0xbd'),_0x259ad0[_0xc5b1('0xb7')][_0x5e037e][_0xc5b1('0xba')]));_0x54af54[_0xc5b1('0x90')](_0x5c502b('openchannel',_0x259ad0[_0xc5b1('0xb7')][_0x5e037e]['dataValues']));_0x54af54[_0xc5b1('0x90')](_0x5c502b(_0xc5b1('0xbe'),_0x259ad0['rows'][_0x5e037e][_0xc5b1('0xba')]));}return Promise[_0xc5b1('0x94')](_0x54af54)[_0xc5b1('0x8')](function(){return _0x259ad0;});}return _0x259ad0;});}});}}});}; \ No newline at end of file +var _0xa5e4=['MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','role','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','Template','triggers','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','isEmpty','length','UserProfileSection','all','union','find','push','model','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','where','pick','merge','VIRTUAL','foreignKey','forEach','autoAssociation','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','order','extraQueryConditions','Tag','Tags','tag','ThroughTags','color','openTabs','true','chat','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','value','then','map','catch','field','associatedResources','name','UserProfileResource','findAll','resourceId','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','childModel','SquareRecording','projectName','JscriptyProject','CmContact','parentSections','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','outboundroutes','voicerecordings','Agents','User','Telephones','membername','telephone','VoiceQueues','VoiceQueue','type','inbound','queue','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailaccounts','MailAccount'];(function(_0x3a4581,_0xc58ca9){var _0x1bc4f3=function(_0x2ea4c4){while(--_0x2ea4c4){_0x3a4581['push'](_0x3a4581['shift']());}};_0x1bc4f3(++_0xc58ca9);}(_0xa5e4,0x1e1));var _0x4a5e=function(_0x1d64f9,_0x2bdb41){_0x1d64f9=_0x1d64f9-0x0;var _0x536355=_0xa5e4[_0x1d64f9];return _0x536355;};'use strict';var _=require(_0x4a5e('0x0'));var attributes=require(_0x4a5e('0x1'));var qs=require(_0x4a5e('0x2'));var squel=require(_0x4a5e('0x3'));module[_0x4a5e('0x4')]=function(_0x4e472a){var _0x1d9504=_0x4e472a['models'];function _0x70287a(_0x20d771,_0xdc3275){return new Promise(function(_0x559936,_0x3cb7c4){if(!_0xdc3275)return _0x559936(null);var _0x4935fa=_0xdc3275[_0x4a5e('0x5')]?{[_0xdc3275[_0x4a5e('0x5')]['field']]:_0xdc3275[_0x4a5e('0x5')][_0x4a5e('0x6')]}:undefined;return _0x1d9504[_0x20d771]['findAll']({'where':_0x4935fa,'raw':!![]})[_0x4a5e('0x7')](function(_0x525442){_0xdc3275['associatedResources']=_[_0x4a5e('0x8')](_0x525442,'id');_0x559936(_0xdc3275);})[_0x4a5e('0x9')](function(_0x17d016){_0x3cb7c4(_0x17d016);});});}function _0x4b0de1(_0x40ebd0,_0x564d79){return new Promise(function(_0x4dfbf9,_0x10d1ad){var _0x48b4db=_0x40ebd0['filter']?{[_0x40ebd0['filter'][_0x4a5e('0xa')]]:_0x40ebd0[_0x4a5e('0x5')][_0x4a5e('0x6')]}:undefined;return _0x1d9504[_0x40ebd0['model']]['findAll']({'where':_0x48b4db,'raw':!![]})[_0x4a5e('0x7')](function(_0x21a8a8){_0x564d79[_0x4a5e('0xb')]=_[_0x4a5e('0x8')](_0x21a8a8,function(_0x17dd28){return _0x17dd28[_0x4a5e('0xc')];});_0x4dfbf9(_0x564d79);})[_0x4a5e('0x9')](function(_0x264d60){_0x10d1ad(_0x264d60);});});}function _0x31bf43(_0x4ad7ed,_0x29c2de,_0x23e04f){if(!_0x29c2de)return Promise['resolve'](null);return new Promise(function(_0x39fb00,_0x4a5b8a){return _0x1d9504[_0x4a5e('0xd')][_0x4a5e('0xe')]({'where':{'sectionId':_0x29c2de['id']},'raw':!![]})[_0x4a5e('0x7')](function(_0x420ef0){if(_0x4ad7ed[_0x4a5e('0xa')]&&_0x4ad7ed[_0x4a5e('0xa')]!=='id'){_0x29c2de[_0x4a5e('0xb')]=_[_0x4a5e('0x8')](_0x420ef0,function(_0x30782a){return _0x30782a[_0x4ad7ed[_0x4a5e('0xa')]];});}else{if(_0x23e04f==='AnalyticExtractedReport'){_0x29c2de[_0x4a5e('0xb')]=_[_0x4a5e('0x8')](_0x420ef0,function(_0x3de112){return{'id':_0x3de112[_0x4a5e('0xf')],'type':_0x3de112['type']};});}else{_0x29c2de[_0x4a5e('0xb')]=_['map'](_0x420ef0,function(_0x22a080){return _0x22a080['resourceId'];});}}_0x39fb00(_0x29c2de);})[_0x4a5e('0x9')](function(_0x1e4ef0){_0x4a5b8a(_0x1e4ef0);});});}function _0x3791a4(_0x3ee885,_0x2451f8){var _0x2a6c65={'parentSections':[]};switch(_0x3ee885[_0x4a5e('0x10')]()){case _0x4a5e('0x11'):_0x2a6c65['childModel']=_0x4a5e('0x12');break;case'odbc':_0x2a6c65['childModel']=_0x4a5e('0x13');break;case _0x4a5e('0x14'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x16');_0x2a6c65['parentSections']=[{'name':'SquareProjects','field':_0x4a5e('0xc'),'foreignKey':_0x4a5e('0x17')}];break;case'projects':_0x2a6c65['childModel']=_0x4a5e('0x18');break;case'contacts':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x19');_0x2a6c65[_0x4a5e('0x1a')]=[{'name':_0x4a5e('0x1b'),'field':'id','foreignKey':_0x4a5e('0x1c')}];break;case'lists':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x1d');break;case _0x4a5e('0x1e'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x1f');break;case _0x4a5e('0x20'):_0x2a6c65['childModel']=_0x4a5e('0x21');break;case _0x4a5e('0x22'):_0x2a6c65['childModel']='ChatQueue';break;case _0x4a5e('0x23'):_0x2a6c65['childModel']=_0x4a5e('0x24');break;case _0x4a5e('0x25'):_0x2a6c65[_0x4a5e('0x15')]='FaxQueue';break;case _0x4a5e('0x26'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x27');break;case'inboundroutes':case'internalroutes':case _0x4a5e('0x28'):_0x2a6c65[_0x4a5e('0x15')]='VoiceExtension';break;case'contexts':_0x2a6c65[_0x4a5e('0x15')]='VoiceContext';break;case'voicemails':_0x2a6c65[_0x4a5e('0x15')]='VoiceMail';break;case _0x4a5e('0x29'):_0x2a6c65[_0x4a5e('0x15')]='VoiceRecording';_0x2a6c65[_0x4a5e('0x1a')]=[{'name':_0x4a5e('0x2a'),'field':'name','foreignKey':'membername','model':_0x4a5e('0x2b'),'filter':{'field':'role','value':['agent']}},{'name':_0x4a5e('0x2c'),'field':_0x4a5e('0xc'),'foreignKey':_0x4a5e('0x2d'),'model':_0x4a5e('0x2b'),'filter':{'field':'role','value':[_0x4a5e('0x2e')]}},{'name':_0x4a5e('0x2f'),'field':_0x4a5e('0xc'),'foreignKey':'queue','model':_0x4a5e('0x30'),'filter':{'field':_0x4a5e('0x31'),'value':[_0x4a5e('0x32')]}},{'name':'QueueCampaigns','field':_0x4a5e('0xc'),'foreignKey':_0x4a5e('0x33'),'model':'VoiceQueue','filter':{'field':_0x4a5e('0x31'),'value':['outbound']}}];break;case'musiconholds':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x34');break;case'chanspies':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x35');break;case _0x4a5e('0x36'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x37');break;case'ivrcampaigns':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x38');break;case'mailqueues':_0x2a6c65[_0x4a5e('0x15')]='MailQueue';break;case _0x4a5e('0x39'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x3a');break;case'mailsubstatuses':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x3b');break;case _0x4a5e('0x3c'):_0x2a6c65[_0x4a5e('0x15')]='OpenchannelQueue';break;case _0x4a5e('0x3d'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x3e');break;case _0x4a5e('0x3f'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x40');break;case'smsaccounts':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x41');break;case _0x4a5e('0x42'):_0x2a6c65['childModel']=_0x4a5e('0x43');break;case _0x4a5e('0x44'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x45');break;case _0x4a5e('0x46'):_0x2a6c65[_0x4a5e('0x15')]='Team';break;case _0x4a5e('0x47'):case _0x4a5e('0x48'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x30');if(_0x2451f8){_0x2a6c65[_0x4a5e('0x1a')]=[{'name':_0x4a5e('0x2f')},{'name':'QueueCampaigns'}];}break;case _0x4a5e('0x49'):case _0x4a5e('0x4a'):case _0x4a5e('0x4b'):_0x2a6c65['childModel']='User';if(_0x2451f8){_0x2a6c65[_0x4a5e('0x1a')]=[{'name':_0x4a5e('0x4c'),'filter':{'field':_0x4a5e('0x4d'),'value':['admin',_0x4a5e('0x4e')]},'ignore':!![]},{'name':_0x4a5e('0x2a')},{'name':_0x4a5e('0x2c')}];}break;case _0x4a5e('0x4f'):_0x2a6c65[_0x4a5e('0x15')]='ZendeskAccount';break;case'salesforceaccounts':_0x2a6c65['childModel']=_0x4a5e('0x50');break;case _0x4a5e('0x51'):_0x2a6c65['childModel']=_0x4a5e('0x52');break;case _0x4a5e('0x53'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x54');break;case _0x4a5e('0x55'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x56');break;case'zohoaccounts':_0x2a6c65['childModel']=_0x4a5e('0x57');break;case _0x4a5e('0x58'):_0x2a6c65[_0x4a5e('0x15')]='User';break;case'cannedanswers':_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x59');break;case _0x4a5e('0x5a'):_0x2a6c65['childModel']=_0x4a5e('0x5b');break;case _0x4a5e('0x5c'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x5d');break;case _0x4a5e('0x5e'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x5f');break;case _0x4a5e('0x60'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x61');break;case _0x4a5e('0x62'):_0x2a6c65['childModel']=_0x4a5e('0x63');break;case _0x4a5e('0x64'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x65');break;case'tags':_0x2a6c65[_0x4a5e('0x15')]='Tag';break;case _0x4a5e('0x66'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x67');break;case _0x4a5e('0x68'):_0x2a6c65[_0x4a5e('0x15')]='Trigger';break;case'trunks':_0x2a6c65[_0x4a5e('0x15')]='Trunk';break;case _0x4a5e('0x69'):_0x2a6c65['childModel']='Variable';break;case _0x4a5e('0x6a'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x6b');break;case _0x4a5e('0x6c'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x6d');_0x2a6c65[_0x4a5e('0x1a')]=[{'name':_0x4a5e('0x6e'),'field':'id','foreignKey':_0x4a5e('0x6f')}];break;case _0x4a5e('0x70'):_0x2a6c65[_0x4a5e('0x15')]=_0x4a5e('0x71');break;}return _0x2a6c65;}function _0x18aa1f(_0x49d82f,_0x41582d){var _0x341eac=_0x49d82f[_0x4a5e('0x72')](0x0)[_0x4a5e('0x73')]()+_0x49d82f['slice'](0x1);var _0x3b105c={'type':_0x1d9504[_0x4a5e('0x74')]['QueryTypes'][_0x4a5e('0x75')],'raw':!![]};return new Promise(function(_0x37f70b,_0x5e130e){var _0x513d33=squel[_0x4a5e('0x76')]()[_0x4a5e('0xa')](_0x4a5e('0x77')+_0x341eac+_0x4a5e('0x78'),'id')[_0x4a5e('0xa')]('ui.createdAt')[_0x4a5e('0x79')](_0x4a5e('0x7a')+_0x49d82f+_0x4a5e('0x7b'),'ui')['where']('ui.UserId\x20=\x20?',_0x41582d['id']);return _0x1d9504[_0x4a5e('0x7c')][_0x4a5e('0x7d')](_0x513d33[_0x4a5e('0x7e')](),_0x3b105c)[_0x4a5e('0x7')](function(_0x32bc91){_0x41582d[_0x341eac+_0x4a5e('0x7f')]=_0x32bc91;_0x37f70b(_0x32bc91);})[_0x4a5e('0x9')](function(_0x4dc083){_0x5e130e(_0x4dc083);});});}return _0x4e472a[_0x4a5e('0x80')](_0x4a5e('0x81'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b12f1){var _0x20f4e6={'raw':_0x3b12f1[_0x4a5e('0x7d')]['raw'],'where':{}};var _0x4da240={};var _0x3ee8be={'count':0x0,'rows':[]};var _0x107698=_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x82')];var _0x469809=_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x83')]||![];var _0x5f4627=_0x3791a4(_0x107698,_0x469809);if(!_0x5f4627[_0x4a5e('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x107698+'\x27');var _0x14476a=[{'name':_0x107698}];if(!_[_0x4a5e('0x84')](_0x5f4627[_0x4a5e('0x1a')]))_0x14476a=_0x5f4627[_0x4a5e('0x1a')];var _0x591b34=[];for(var _0x26e5af=0x0;_0x26e5af<_0x14476a[_0x4a5e('0x85')];_0x26e5af++){_0x591b34['push'](_0x1d9504[_0x4a5e('0x86')]['find']({'where':{'userProfileId':_0x3b12f1['params']['id'],'name':_0x14476a[_0x26e5af][_0x4a5e('0xc')]},'raw':!![]}));}return Promise[_0x4a5e('0x87')](_0x591b34)[_0x4a5e('0x7')](function(_0x49dc14){var _0x26b101=_[_0x4a5e('0x5')](_0x49dc14,function(_0x311ebd){return _0x311ebd?_0x311ebd:undefined;});var _0x3f4add=_['filter'](_0x14476a,['ignore',!![]]);var _0x5e9fc9=_[_0x4a5e('0x84')](_0x26b101)&&_[_0x4a5e('0x84')](_0x3f4add)?null:_[_0x4a5e('0x88')](_0x3f4add,_0x26b101);if(!_0x5e9fc9)return null;var _0xdbf33c=[];for(var _0x4549c0=0x0;_0x4549c0<_0x5e9fc9[_0x4a5e('0x85')];_0x4549c0++){var _0x36f3a5=_[_0x4a5e('0x89')](_0x14476a,function(_0x5ba817){return _0x5e9fc9[_0x4549c0]?_0x5ba817[_0x4a5e('0xc')]===_0x5e9fc9[_0x4549c0][_0x4a5e('0xc')]:null;});if(_0x36f3a5){if(_0x5e9fc9[_0x4549c0]['ignore']){_0xdbf33c[_0x4a5e('0x8a')](_0x70287a(_0x5f4627[_0x4a5e('0x15')],_0x5e9fc9[_0x4549c0]));}else{if(!_0x5e9fc9[_0x4549c0]['autoAssociation']){_0xdbf33c[_0x4a5e('0x8a')](_0x31bf43(_0x36f3a5,_0x5e9fc9[_0x4549c0],_0x5f4627[_0x4a5e('0x15')]));}else{if(_0x36f3a5[_0x4a5e('0x8b')]){_0xdbf33c['push'](_0x4b0de1(_0x36f3a5,_0x5e9fc9[_0x4549c0]));}}}}}return Promise['all'](_0xdbf33c);})[_0x4a5e('0x7')](function(_0x3ab546){var _0x2ebb4e=_0x3ab546;var _0x236799=null;if(_0x2ebb4e){_0x236799=_0x2ebb4e[_0x4a5e('0x85')]===0x1?_0x2ebb4e[0x0]:null;}if(!_0x236799&&!_0x2ebb4e)return _0x3ee8be;var _0x69d5ea=_0x1d9504[_0x5f4627['childModel']][_0x4a5e('0x8c')];_0x4da240['model']=_[_0x4a5e('0x8d')](_0x69d5ea);_0x4da240[_0x4a5e('0x7d')]=_[_0x4a5e('0x8d')](_0x3b12f1['query']);_0x4da240[_0x4a5e('0x8e')]=_[_0x4a5e('0x8f')](_0x4da240[_0x4a5e('0x8b')],_0x4da240[_0x4a5e('0x7d')]);_0x20f4e6[_0x4a5e('0x90')]=_[_0x4a5e('0x8f')](_0x4da240[_0x4a5e('0x8b')],qs[_0x4a5e('0x91')](_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x91')]));_0x20f4e6[_0x4a5e('0x90')]=_0x20f4e6['attributes'][_0x4a5e('0x85')]?_0x20f4e6[_0x4a5e('0x90')]:_0x4da240[_0x4a5e('0x8b')];if(!_0x3b12f1['query']['hasOwnProperty'](_0x4a5e('0x92'))){_0x20f4e6[_0x4a5e('0x93')]=qs[_0x4a5e('0x93')](_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x93')]);_0x20f4e6[_0x4a5e('0x94')]=qs['offset'](_0x3b12f1['query'][_0x4a5e('0x94')]);}_0x20f4e6['order']=qs[_0x4a5e('0x95')](_0x3b12f1['query'][_0x4a5e('0x95')]);_0x20f4e6[_0x4a5e('0x96')]=qs[_0x4a5e('0x8e')](_[_0x4a5e('0x97')](_0x3b12f1[_0x4a5e('0x7d')],_0x4da240[_0x4a5e('0x8e')]));if(_0x3b12f1[_0x4a5e('0x7d')]['filter']){_0x20f4e6[_0x4a5e('0x96')]=_[_0x4a5e('0x98')](_0x20f4e6[_0x4a5e('0x96')],{'$or':_[_0x4a5e('0x8')](_0x69d5ea,function(_0x6d1bd9){if(_0x6d1bd9[_0x4a5e('0x31')]['key']!==_0x4a5e('0x99')){var _0x37176e={};_0x37176e[_0x6d1bd9[_0x4a5e('0xa')]]={'$like':'%'+_0x3b12f1['query'][_0x4a5e('0x5')]+'%'};return _0x37176e;}})});}var _0x2b36de=[];var _0x3690c8=null;var _0x48f0bf={};if(_0x236799){_0x3690c8=_[_0x4a5e('0x89')](_0x14476a,[_0x4a5e('0xc'),_0x236799[_0x4a5e('0xc')]]);if(_0x3690c8['field']){_0x48f0bf={};if(_0x5f4627[_0x4a5e('0x15')]===_0x4a5e('0x6d')){_0x48f0bf[_0x3690c8[_0x4a5e('0x9a')]]=_['map'](_0x236799[_0x4a5e('0xb')],'id');}else{_0x48f0bf[_0x3690c8[_0x4a5e('0x9a')]]=_0x236799['associatedResources'];}_0x2b36de['push'](_0x48f0bf);}else{_0x20f4e6['where']['id']=_0x236799['associatedResources'];}}else{for(var _0x1484c5=0x0;_0x1484c5<_0x2ebb4e[_0x4a5e('0x85')];_0x1484c5++){_0x3690c8=_['find'](_0x14476a,['name',_0x2ebb4e[_0x1484c5][_0x4a5e('0xc')]]);if(_0x3690c8[_0x4a5e('0xa')]){_0x48f0bf={};_0x48f0bf[_0x3690c8[_0x4a5e('0x9a')]]=_0x2ebb4e[_0x1484c5][_0x4a5e('0xb')];_0x2b36de[_0x4a5e('0x8a')](_0x48f0bf);}else{if(!_0x20f4e6[_0x4a5e('0x96')]['id'])_0x20f4e6['where']['id']=[];_0x2ebb4e[_0x1484c5]['associatedResources'][_0x4a5e('0x9b')](function(_0x168fbc){_0x20f4e6[_0x4a5e('0x96')]['id'][_0x4a5e('0x8a')](_0x168fbc);});}}}if(!_[_0x4a5e('0x84')](_0x2b36de)){_0x20f4e6['where']=_[_0x4a5e('0x98')](_0x20f4e6[_0x4a5e('0x96')],{'$and':{'$or':_0x2b36de}});}_0x20f4e6=_[_0x4a5e('0x98')]({},_0x20f4e6,_0x3b12f1['options']);if(_0x236799&&!_0x236799[_0x4a5e('0x9c')]&&_0x5f4627['childModel']===_0x4a5e('0x6d')){if(_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x9d')]){_0x20f4e6[_0x4a5e('0x9e')]=[{'all':!![]}];}return _0x1d9504[_0x5f4627['childModel']]['findAll'](_0x20f4e6)[_0x4a5e('0x7')](function(_0xd5c3c){var _0x30a69d=[];_0xd5c3c[_0x4a5e('0x9b')](function(_0x5a765b){var _0x21a7b0;switch(_0x5a765b[_0x4a5e('0x9f')]){case _0x4a5e('0xa0'):_0x21a7b0=_['find'](_0x236799[_0x4a5e('0xb')],function(_0x65634d){return _0x65634d['id']===_0x5a765b['reportId']&&_0x65634d['type']==='DefaultReports';});break;case _0x4a5e('0xa1'):_0x21a7b0=_[_0x4a5e('0x89')](_0x236799[_0x4a5e('0xb')],function(_0x581363){return _0x581363['id']===_0x5a765b[_0x4a5e('0x6f')]&&_0x581363[_0x4a5e('0x31')]===_0x4a5e('0xa2');});break;}if(_0x21a7b0)_0x30a69d['push'](_0x5a765b);});_0x3ee8be[_0x4a5e('0xa3')]=_0x30a69d[_0x4a5e('0x85')];_0x3ee8be[_0x4a5e('0xa4')]=_0x30a69d;return _0x3ee8be;});}else{if(!_[_0x4a5e('0x84')](_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xa5')])){_0x20f4e6[_0x4a5e('0x96')]['id']=_0x20f4e6[_0x4a5e('0x96')]['id']?_['intersection'](_0x20f4e6[_0x4a5e('0x96')]['id'],_0x3b12f1[_0x4a5e('0x7d')]['ids']):_0x3b12f1[_0x4a5e('0x7d')]['ids'];if(_0x3b12f1[_0x4a5e('0x7d')]['customSorting']){_0x20f4e6[_0x4a5e('0xa6')]=_0x3b12f1[_0x4a5e('0x7d')]['customSorting'];}}if(_0x3b12f1[_0x4a5e('0x7d')]['extraQueryConditions']){_0x20f4e6[_0x4a5e('0x96')]=_[_0x4a5e('0x98')](_0x20f4e6[_0x4a5e('0x96')],{'$and':_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xa7')]});}return _0x1d9504[_0x5f4627[_0x4a5e('0x15')]]['count']({'where':_0x20f4e6['where']})[_0x4a5e('0x7')](function(_0x43ad82){_0x3ee8be['count']=_0x43ad82;if(_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0x9d')]){if(_0x5f4627[_0x4a5e('0x15')]==='CmContact'){_0x20f4e6[_0x4a5e('0x9e')]=[{'model':_0x1d9504[_0x4a5e('0xa8')],'as':_0x4a5e('0xa9'),'attributes':['id',_0x4a5e('0xc'),'color'],'required':_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xaa')]?!![]:![]},{'model':_0x1d9504[_0x4a5e('0xa8')],'as':_0x4a5e('0xab'),'attributes':['id',_0x4a5e('0xc'),_0x4a5e('0xac')],'through':_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xaa')]?{'attributes':[],'where':{'TagId':_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xaa')]||undefined}}:{},'required':_0x3b12f1[_0x4a5e('0x7d')]['tag']?!![]:![]}];}else{_0x20f4e6[_0x4a5e('0x9e')]=[{'all':!![]}];}}return _0x1d9504[_0x5f4627[_0x4a5e('0x15')]]['findAll'](_0x20f4e6);})[_0x4a5e('0x7')](function(_0x2e365f){_0x3ee8be[_0x4a5e('0xa4')]=_0x2e365f;if(_0x107698===_0x4a5e('0x2a')&&_0x3b12f1[_0x4a5e('0x7d')][_0x4a5e('0xad')]===_0x4a5e('0xae')){var _0x134419=[];for(var _0x12576e=0x0;_0x12576e<_0x3ee8be[_0x4a5e('0xa4')][_0x4a5e('0x85')];_0x12576e++){_0x134419[_0x4a5e('0x8a')](_0x18aa1f(_0x4a5e('0xaf'),_0x3ee8be[_0x4a5e('0xa4')][_0x12576e][_0x4a5e('0xb0')]));_0x134419['push'](_0x18aa1f(_0x4a5e('0xb1'),_0x3ee8be['rows'][_0x12576e][_0x4a5e('0xb0')]));_0x134419[_0x4a5e('0x8a')](_0x18aa1f('fax',_0x3ee8be[_0x4a5e('0xa4')][_0x12576e][_0x4a5e('0xb0')]));_0x134419[_0x4a5e('0x8a')](_0x18aa1f(_0x4a5e('0xb2'),_0x3ee8be[_0x4a5e('0xa4')][_0x12576e][_0x4a5e('0xb0')]));_0x134419[_0x4a5e('0x8a')](_0x18aa1f('openchannel',_0x3ee8be[_0x4a5e('0xa4')][_0x12576e][_0x4a5e('0xb0')]));_0x134419[_0x4a5e('0x8a')](_0x18aa1f(_0x4a5e('0xb3'),_0x3ee8be[_0x4a5e('0xa4')][_0x12576e]['dataValues']));}return Promise[_0x4a5e('0x87')](_0x134419)[_0x4a5e('0x7')](function(){return _0x3ee8be;});}return _0x3ee8be;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 5daa108..77b1813 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 _0x89fb=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x461eaa,_0x5b9604){var _0x3f2756=function(_0xddf81a){while(--_0xddf81a){_0x461eaa['push'](_0x461eaa['shift']());}};_0x3f2756(++_0x5b9604);}(_0x89fb,0x14b));var _0xb89f=function(_0x59cd19,_0x20d95a){_0x59cd19=_0x59cd19-0x0;var _0x20c5d8=_0x89fb[_0x59cd19];return _0x20c5d8;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var moment=require(_0xb89f('0x1'));var BPromise=require(_0xb89f('0x2'));var rs=require(_0xb89f('0x3'));var fs=require('fs');var Redis=require(_0xb89f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb89f('0x5'));var logger=require(_0xb89f('0x6'))(_0xb89f('0x7'));var config=require(_0xb89f('0x8'));var jayson=require(_0xb89f('0x9'));var client=jayson['client'][_0xb89f('0xa')]({'port':0x232a});config['redis']=_[_0xb89f('0xb')](config['redis'],{'host':_0xb89f('0xc'),'port':0x18eb});var socket=require(_0xb89f('0xd'))(new Redis(config[_0xb89f('0xe')]));require('./userProfile.socket')[_0xb89f('0xf')](socket);function respondWithRpcPromise(_0x2f1a11,_0x2f0c38,_0x7361c0){return new BPromise(function(_0x36bbe0,_0x50bad7){return client['request'](_0x2f1a11,_0x7361c0)[_0xb89f('0x10')](function(_0x36b3f8){logger[_0xb89f('0x11')](_0xb89f('0x12'),_0x2f0c38,_0xb89f('0x13'));logger['debug'](_0xb89f('0x14'),_0x2f0c38,_0xb89f('0x13'),JSON[_0xb89f('0x15')](_0x36b3f8));if(_0x36b3f8[_0xb89f('0x16')]){if(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x17')]===0x1f4){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);return _0x50bad7(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}logger[_0xb89f('0x16')](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8['error'][_0xb89f('0x18')]);return _0x36bbe0(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}else{logger[_0xb89f('0x11')]('UserProfile,\x20%s,\x20%s',_0x2f0c38,'request\x20sent');_0x36bbe0(_0x36b3f8[_0xb89f('0x19')][_0xb89f('0x18')]);}})[_0xb89f('0x1a')](function(_0x4baa9f){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x4baa9f);_0x50bad7(_0x4baa9f);});});} \ No newline at end of file +var _0xdb8b=['http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','UserProfile,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x569c00,_0x448d58){var _0xee6faa=function(_0x351535){while(--_0x351535){_0x569c00['push'](_0x569c00['shift']());}};_0xee6faa(++_0x448d58);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x3cd7ea,_0x199085){_0x3cd7ea=_0x3cd7ea-0x0;var _0x5aa8d5=_0xdb8b[_0x3cd7ea];return _0x5aa8d5;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var moment=require(_0xbdb8('0x1'));var BPromise=require(_0xbdb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb8('0x4'))(_0xbdb8('0x5'));var config=require(_0xbdb8('0x6'));var jayson=require(_0xbdb8('0x7'));var client=jayson['client'][_0xbdb8('0x8')]({'port':0x232a});config['redis']=_[_0xbdb8('0x9')](config[_0xbdb8('0xa')],{'host':_0xbdb8('0xb'),'port':0x18eb});var socket=require(_0xbdb8('0xc'))(new Redis(config[_0xbdb8('0xa')]));require(_0xbdb8('0xd'))['register'](socket);function respondWithRpcPromise(_0x3339c2,_0x176a31,_0x3cc8d1){return new BPromise(function(_0x682657,_0x2fba54){return client[_0xbdb8('0xe')](_0x3339c2,_0x3cc8d1)[_0xbdb8('0xf')](function(_0x55f17e){logger['info'](_0xbdb8('0x10'),_0x176a31,'request\x20sent');logger[_0xbdb8('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x176a31,_0xbdb8('0x12'),JSON['stringify'](_0x55f17e));if(_0x55f17e[_0xbdb8('0x13')]){if(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x14')]===0x1f4){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x2fba54(_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);}logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x55f17e[_0xbdb8('0x13')][_0xbdb8('0x15')]);return _0x682657(_0x55f17e['error'][_0xbdb8('0x15')]);}else{logger[_0xbdb8('0x16')](_0xbdb8('0x10'),_0x176a31,'request\x20sent');_0x682657(_0x55f17e['result'][_0xbdb8('0x15')]);}})['catch'](function(_0x37177b){logger[_0xbdb8('0x13')](_0xbdb8('0x10'),_0x176a31,_0x37177b);_0x2fba54(_0x37177b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1cb5f71..65a04c7 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 _0xc556=['emit','register','length','userProfile:','./userProfile.events','save','update'];(function(_0x351841,_0x332352){var _0x7a89f6=function(_0x2a53ce){while(--_0x2a53ce){_0x351841['push'](_0x351841['shift']());}};_0x7a89f6(++_0x332352);}(_0xc556,0x1cb));var _0x6c55=function(_0x53d1ba,_0x935486){_0x53d1ba=_0x53d1ba-0x0;var _0x1a8621=_0xc556[_0x53d1ba];return _0x1a8621;};'use strict';var UserProfileEvents=require(_0x6c55('0x0'));var events=[_0x6c55('0x1'),'remove',_0x6c55('0x2')];function createListener(_0x4e11fb,_0x17b641){return function(_0x565d05){_0x17b641[_0x6c55('0x3')](_0x4e11fb,_0x565d05);};}function removeListener(_0x1e431f,_0x1626bc){return function(){UserProfileEvents['removeListener'](_0x1e431f,_0x1626bc);};}exports[_0x6c55('0x4')]=function(_0x2bf361){for(var _0x950c89=0x0,_0x25db99=events[_0x6c55('0x5')];_0x950c89<_0x25db99;_0x950c89++){var _0x56cce0=events[_0x950c89];var _0x51077f=createListener(_0x6c55('0x6')+_0x56cce0,_0x2bf361);UserProfileEvents['on'](_0x56cce0,_0x51077f);}}; \ No newline at end of file +var _0x3f5e=['removeListener','register','length','./userProfile.events','remove','update','emit'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x3f5e,0x192));var _0xe3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5e[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xe3f5('0x0'));var events=['save',_0xe3f5('0x1'),_0xe3f5('0x2')];function createListener(_0x5717f6,_0x130b7e){return function(_0x5c14fb){_0x130b7e[_0xe3f5('0x3')](_0x5717f6,_0x5c14fb);};}function removeListener(_0x4fdafd,_0x5aa83d){return function(){UserProfileEvents[_0xe3f5('0x4')](_0x4fdafd,_0x5aa83d);};}exports[_0xe3f5('0x5')]=function(_0x2ad4fa){for(var _0x10a6f3=0x0,_0x1f1e2e=events[_0xe3f5('0x6')];_0x10a6f3<_0x1f1e2e;_0x10a6f3++){var _0x4e22b1=events[_0x10a6f3];var _0x7856ad=createListener('userProfile:'+_0x4e22b1,_0x2ad4fa);UserProfileEvents['on'](_0x4e22b1,_0x7856ad);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 863c661..d3ec915 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 _0xdbeb=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','show','post','create','/:id','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x5d0211,_0x53a7ed){var _0x157779=function(_0x2a8518){while(--_0x2a8518){_0x5d0211['push'](_0x5d0211['shift']());}};_0x157779(++_0x53a7ed);}(_0xdbeb,0x1b0));var _0xbdbe=function(_0x4cb08e,_0x54a28d){_0x4cb08e=_0x4cb08e-0x0;var _0x44174c=_0xdbeb[_0x4cb08e];return _0x44174c;};'use strict';var multer=require(_0xbdbe('0x0'));var util=require(_0xbdbe('0x1'));var path=require(_0xbdbe('0x2'));var timeout=require(_0xbdbe('0x3'));var express=require(_0xbdbe('0x4'));var router=express[_0xbdbe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbdbe('0x6'));var interaction=require(_0xbdbe('0x7'));var config=require(_0xbdbe('0x8'));var controller=require(_0xbdbe('0x9'));router[_0xbdbe('0xa')]('/',auth[_0xbdbe('0xb')](),controller[_0xbdbe('0xc')]);router[_0xbdbe('0xa')]('/describe',auth[_0xbdbe('0xb')](),controller['describe']);router[_0xbdbe('0xa')]('/:id',auth[_0xbdbe('0xb')](),controller[_0xbdbe('0xd')]);router[_0xbdbe('0xe')]('/',auth[_0xbdbe('0xb')](),controller[_0xbdbe('0xf')]);router['put'](_0xbdbe('0x10'),auth[_0xbdbe('0xb')](),controller[_0xbdbe('0x11')]);router['delete'](_0xbdbe('0x10'),auth[_0xbdbe('0xb')](),controller[_0xbdbe('0x12')]);module['exports']=router; \ No newline at end of file +var _0x43c6=['/:id','show','post','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x43c6,0x7d));var _0x643c=function(_0x52e1d6,_0x16679e){_0x52e1d6=_0x52e1d6-0x0;var _0x27d47b=_0x43c6[_0x52e1d6];return _0x27d47b;};'use strict';var multer=require(_0x643c('0x0'));var util=require(_0x643c('0x1'));var path=require(_0x643c('0x2'));var timeout=require(_0x643c('0x3'));var express=require(_0x643c('0x4'));var router=express[_0x643c('0x5')]();var fs_extra=require(_0x643c('0x6'));var auth=require(_0x643c('0x7'));var interaction=require(_0x643c('0x8'));var config=require(_0x643c('0x9'));var controller=require(_0x643c('0xa'));router[_0x643c('0xb')]('/',auth['isAuthenticated'](),controller[_0x643c('0xc')]);router[_0x643c('0xb')](_0x643c('0xd'),auth[_0x643c('0xe')](),controller['describe']);router['get'](_0x643c('0xf'),auth[_0x643c('0xe')](),controller[_0x643c('0x10')]);router[_0x643c('0x11')]('/',auth[_0x643c('0xe')](),controller[_0x643c('0x12')]);router[_0x643c('0x13')](_0x643c('0xf'),auth[_0x643c('0xe')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9649d71..2e90b35 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 _0x8b79=['INTEGER','exports'];(function(_0x471a85,_0x239e8d){var _0x5f2039=function(_0x378952){while(--_0x378952){_0x471a85['push'](_0x471a85['shift']());}};_0x5f2039(++_0x239e8d);}(_0x8b79,0x95));var _0x98b7=function(_0x31c03d,_0x379239){_0x31c03d=_0x31c03d-0x0;var _0x4ae391=_0x8b79[_0x31c03d];return _0x4ae391;};'use strict';var Sequelize=require('sequelize');module[_0x98b7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x98b7('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xee52=['STRING','INTEGER','sequelize','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xee52,0xaa));var _0x2ee5=function(_0x3a4c1a,_0x340628){_0x3a4c1a=_0x3a4c1a-0x0;var _0x508e55=_0xee52[_0x3a4c1a];return _0x508e55;};'use strict';var Sequelize=require(_0x2ee5('0x0'));module[_0x2ee5('0x1')]={'name':{'type':Sequelize[_0x2ee5('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2ee5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2ee5('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 5eba80f..523495e 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 _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file +var _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','UserProfileResource','rawAttributes','type','key','model','query'];(function(_0x5ed6d3,_0x5451f1){var _0x46eda2=function(_0xce0905){while(--_0xce0905){_0x5ed6d3['push'](_0x5ed6d3['shift']());}};_0x46eda2(++_0x5451f1);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x447a06,_0x346c19){_0x447a06=_0x447a06-0x0;var _0x5238e8=_0xc1c6[_0x447a06];return _0x5238e8;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['UserProfileResource']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['UserProfileResource'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['UserProfileResource']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['UserProfileResource'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6183709..8ac5d37 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 _0xd25a=['./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4da6c4,_0x2f2213){var _0x48feaa=function(_0x4b42af){while(--_0x4b42af){_0x4da6c4['push'](_0x4da6c4['shift']());}};_0x48feaa(++_0x2f2213);}(_0xd25a,0x198));var _0xad25=function(_0x20b7d5,_0x4e3e84){_0x20b7d5=_0x20b7d5-0x0;var _0x5327d2=_0xd25a[_0x20b7d5];return _0x5327d2;};'use strict';var _=require(_0xad25('0x0'));var util=require(_0xad25('0x1'));var logger=require(_0xad25('0x2'))(_0xad25('0x3'));var moment=require(_0xad25('0x4'));var BPromise=require(_0xad25('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad25('0x6'));var rimraf=require('rimraf');var config=require(_0xad25('0x7'));var attributes=require(_0xad25('0x8'));module[_0xad25('0x9')]=function(_0x3ea7b3,_0x53736c){return _0x3ea7b3[_0xad25('0xa')](_0xad25('0xb'),attributes,{'tableName':_0xad25('0xc'),'paranoid':![],'indexes':[{'name':_0xad25('0xd'),'fields':[_0xad25('0xe'),_0xad25('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcf1=['util','../../config/logger','api','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','sectionId','lodash'];(function(_0x4c2bdc,_0x5915d7){var _0x5a3222=function(_0x2262dd){while(--_0x2262dd){_0x4c2bdc['push'](_0x4c2bdc['shift']());}};_0x5a3222(++_0x5915d7);}(_0xdcf1,0x1e0));var _0x1dcf=function(_0xdcb582,_0x2fb7ed){_0xdcb582=_0xdcb582-0x0;var _0x82ffba=_0xdcf1[_0xdcb582];return _0x82ffba;};'use strict';var _=require(_0x1dcf('0x0'));var util=require(_0x1dcf('0x1'));var logger=require(_0x1dcf('0x2'))(_0x1dcf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1dcf('0x4'));var rimraf=require(_0x1dcf('0x5'));var config=require(_0x1dcf('0x6'));var attributes=require(_0x1dcf('0x7'));module[_0x1dcf('0x8')]=function(_0x2ab46a,_0x217514){return _0x2ab46a['define'](_0x1dcf('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x1dcf('0xa'),'fields':[_0x1dcf('0xb'),_0x1dcf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5554285..033888e 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 _0xc4a8=['result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','http','then','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info'];(function(_0xba4dd9,_0x4df0b1){var _0x5aaa3c=function(_0x2dd35c){while(--_0x2dd35c){_0xba4dd9['push'](_0xba4dd9['shift']());}};_0x5aaa3c(++_0x4df0b1);}(_0xc4a8,0x1ee));var _0x8c4a=function(_0x57ca66,_0x5ecbab){_0x57ca66=_0x57ca66-0x0;var _0x1ee28e=_0xc4a8[_0x57ca66];return _0x1ee28e;};'use strict';var _=require(_0x8c4a('0x0'));var util=require(_0x8c4a('0x1'));var moment=require(_0x8c4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c4a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c4a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8c4a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x107b72,_0x166d17,_0x3b3318){return new BPromise(function(_0x17d38a,_0x302cd5){return client['request'](_0x107b72,_0x3b3318)[_0x8c4a('0x7')](function(_0x29cf5d){logger['info'](_0x8c4a('0x8'),_0x166d17,'request\x20sent');logger[_0x8c4a('0x9')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x166d17,_0x8c4a('0xa'),JSON[_0x8c4a('0xb')](_0x29cf5d));if(_0x29cf5d[_0x8c4a('0xc')]){if(_0x29cf5d[_0x8c4a('0xc')][_0x8c4a('0xd')]===0x1f4){logger[_0x8c4a('0xc')](_0x8c4a('0x8'),_0x166d17,_0x29cf5d[_0x8c4a('0xc')][_0x8c4a('0xe')]);return _0x302cd5(_0x29cf5d['error'][_0x8c4a('0xe')]);}logger[_0x8c4a('0xc')](_0x8c4a('0x8'),_0x166d17,_0x29cf5d[_0x8c4a('0xc')][_0x8c4a('0xe')]);return _0x17d38a(_0x29cf5d[_0x8c4a('0xc')][_0x8c4a('0xe')]);}else{logger[_0x8c4a('0xf')](_0x8c4a('0x8'),_0x166d17,_0x8c4a('0xa'));_0x17d38a(_0x29cf5d[_0x8c4a('0x10')][_0x8c4a('0xe')]);}})['catch'](function(_0x39dec0){logger[_0x8c4a('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x166d17,_0x39dec0);_0x302cd5(_0x39dec0);});});} \ No newline at end of file +var _0xc342=['message','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3887ae,_0x4800bc){var _0x283b52=function(_0x29dc00){while(--_0x29dc00){_0x3887ae['push'](_0x3887ae['shift']());}};_0x283b52(++_0x4800bc);}(_0xc342,0x106));var _0x2c34=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0xc342[_0x317497];return _0x3445b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2c34('0x0'));var BPromise=require(_0x2c34('0x1'));var rs=require(_0x2c34('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c34('0x3'));var logger=require(_0x2c34('0x4'))(_0x2c34('0x5'));var config=require(_0x2c34('0x6'));var jayson=require(_0x2c34('0x7'));var client=jayson[_0x2c34('0x8')][_0x2c34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6137b7,_0x4bec4a,_0x181579){return new BPromise(function(_0x28e9d8,_0x558fcc){return client[_0x2c34('0xa')](_0x6137b7,_0x181579)['then'](function(_0x54ec61){logger[_0x2c34('0xb')](_0x2c34('0xc'),_0x4bec4a,'request\x20sent');logger[_0x2c34('0xd')](_0x2c34('0xe'),_0x4bec4a,_0x2c34('0xf'),JSON['stringify'](_0x54ec61));if(_0x54ec61[_0x2c34('0x10')]){if(_0x54ec61[_0x2c34('0x10')][_0x2c34('0x11')]===0x1f4){logger[_0x2c34('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4bec4a,_0x54ec61[_0x2c34('0x10')][_0x2c34('0x12')]);return _0x558fcc(_0x54ec61['error'][_0x2c34('0x12')]);}logger[_0x2c34('0x10')](_0x2c34('0xc'),_0x4bec4a,_0x54ec61[_0x2c34('0x10')][_0x2c34('0x12')]);return _0x28e9d8(_0x54ec61['error']['message']);}else{logger[_0x2c34('0xb')](_0x2c34('0xc'),_0x4bec4a,_0x2c34('0xf'));_0x28e9d8(_0x54ec61['result'][_0x2c34('0x12')]);}})[_0x2c34('0x13')](function(_0x98a82f){logger[_0x2c34('0x10')](_0x2c34('0xc'),_0x4bec4a,_0x98a82f);_0x558fcc(_0x98a82f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a9a7668..36bab13 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 _0x0696=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x475738,_0x12c850){var _0x18878c=function(_0x53bef7){while(--_0x53bef7){_0x475738['push'](_0x475738['shift']());}};_0x18878c(++_0x12c850);}(_0x0696,0xf7));var _0x6069=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x0696[_0x16771d];return _0x386f11;};'use strict';var multer=require(_0x6069('0x0'));var util=require(_0x6069('0x1'));var path=require('path');var timeout=require(_0x6069('0x2'));var express=require(_0x6069('0x3'));var router=express[_0x6069('0x4')]();var fs_extra=require(_0x6069('0x5'));var auth=require(_0x6069('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6069('0x7'));var controller=require(_0x6069('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6069('0x9')](_0x6069('0xa'),auth[_0x6069('0xb')](),controller[_0x6069('0xc')]);router[_0x6069('0x9')](_0x6069('0xd'),auth[_0x6069('0xb')](),controller[_0x6069('0xe')]);router[_0x6069('0xf')]('/',auth[_0x6069('0xb')](),controller[_0x6069('0x10')]);router[_0x6069('0x11')](_0x6069('0xd'),auth[_0x6069('0xb')](),controller[_0x6069('0x12')]);router[_0x6069('0x13')](_0x6069('0xd'),auth[_0x6069('0xb')](),controller[_0x6069('0x14')]);module[_0x6069('0x15')]=router; \ No newline at end of file +var _0xf74a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x24e5c5,_0x516f9c){var _0x59e298=function(_0x1b324b){while(--_0x1b324b){_0x24e5c5['push'](_0x24e5c5['shift']());}};_0x59e298(++_0x516f9c);}(_0xf74a,0x1da));var _0xaf74=function(_0x5b677c,_0x15162c){_0x5b677c=_0x5b677c-0x0;var _0x213917=_0xf74a[_0x5b677c];return _0x213917;};'use strict';var multer=require(_0xaf74('0x0'));var util=require(_0xaf74('0x1'));var path=require(_0xaf74('0x2'));var timeout=require(_0xaf74('0x3'));var express=require('express');var router=express[_0xaf74('0x4')]();var fs_extra=require(_0xaf74('0x5'));var auth=require(_0xaf74('0x6'));var interaction=require(_0xaf74('0x7'));var config=require(_0xaf74('0x8'));var controller=require('./userProfileSection.controller');router[_0xaf74('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf74('0xa')]);router[_0xaf74('0x9')](_0xaf74('0xb'),auth[_0xaf74('0xc')](),controller[_0xaf74('0xd')]);router[_0xaf74('0x9')]('/:id',auth[_0xaf74('0xc')](),controller['show']);router['post']('/',auth[_0xaf74('0xc')](),controller[_0xaf74('0xe')]);router[_0xaf74('0xf')](_0xaf74('0x10'),auth[_0xaf74('0xc')](),controller[_0xaf74('0x11')]);router[_0xaf74('0x12')](_0xaf74('0x10'),auth[_0xaf74('0xc')](),controller[_0xaf74('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7750a90..4747d25 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 _0xbc9d=['sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x2616de,_0x56dab8){var _0x19f21a=function(_0x328ecc){while(--_0x328ecc){_0x2616de['push'](_0x2616de['shift']());}};_0x19f21a(++_0x56dab8);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x2ee9ae,_0xb116d8){_0x2ee9ae=_0x2ee9ae-0x0;var _0x298948=_0xbc9d[_0x2ee9ae];return _0x298948;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'name':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xdbc9('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdbc9('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2aba48){this[_0xdbc9('0x4')](_0xdbc9('0x5'),_0x2aba48?_0x2aba48[_0xdbc9('0x6')](''):[]);},'get':function(){return this[_0xdbc9('0x7')](_0xdbc9('0x5'))?this[_0xdbc9('0x7')]('crudPermissions')[_0xdbc9('0x8')](''):[];}}}; \ No newline at end of file +var _0x0565=['exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','sequelize'];(function(_0x6ac80d,_0x16756a){var _0xe61ea3=function(_0x506d0c){while(--_0x506d0c){_0x6ac80d['push'](_0x6ac80d['shift']());}};_0xe61ea3(++_0x16756a);}(_0x0565,0xf2));var _0x5056=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0565[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x5056('0x0'));module[_0x5056('0x1')]={'name':{'type':Sequelize[_0x5056('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x5056('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5056('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5056('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5056('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5056('0x2')],'set':function(_0x3657a8){this[_0x5056('0x5')]('crudPermissions',_0x3657a8?_0x3657a8[_0x5056('0x6')](''):[]);},'get':function(){return this[_0x5056('0x7')](_0x5056('0x8'))?this[_0x5056('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c9d929b..4699487 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 _0x6150=['find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','UserProfileSection','rawAttributes','type','key','model','keys','filters','query','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','intersection'];(function(_0x5b7638,_0x54e3f1){var _0x357db8=function(_0x65868e){while(--_0x65868e){_0x5b7638['push'](_0x5b7638['shift']());}};_0x357db8(++_0x54e3f1);}(_0x6150,0x98));var _0x0615=function(_0x5bff10,_0x1ed8c6){_0x5bff10=_0x5bff10-0x0;var _0x4f95c4=_0x6150[_0x5bff10];return _0x4f95c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0615('0x0'));var zipdir=require(_0x0615('0x1'));var jsonpatch=require(_0x0615('0x2'));var rp=require(_0x0615('0x3'));var moment=require(_0x0615('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0615('0x5'));var util=require(_0x0615('0x6'));var path=require(_0x0615('0x7'));var sox=require('sox');var csv=require(_0x0615('0x8'));var ejs=require(_0x0615('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0615('0xa'));var squel=require(_0x0615('0xb'));var crypto=require('crypto');var jsforce=require(_0x0615('0xc'));var deskjs=require(_0x0615('0xd'));var toCsv=require(_0x0615('0x8'));var querystring=require(_0x0615('0xe'));var Papa=require(_0x0615('0xf'));var Redis=require(_0x0615('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0615('0x11'));var as=require(_0x0615('0x12'));var hardwareService=require(_0x0615('0x13'));var logger=require(_0x0615('0x14'))('api');var utils=require(_0x0615('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0615('0x16'));var db=require(_0x0615('0x17'))['db'];function respondWithStatusCode(_0x22cc03,_0x3a129b){_0x3a129b=_0x3a129b||0xcc;return function(_0x5b0b62){if(_0x5b0b62){return _0x22cc03[_0x0615('0x18')](_0x3a129b);}return _0x22cc03[_0x0615('0x19')](_0x3a129b)['end']();};}function respondWithResult(_0x58fa2a,_0x2641fc){_0x2641fc=_0x2641fc||0xc8;return function(_0x503035){if(_0x503035){return _0x58fa2a[_0x0615('0x19')](_0x2641fc)[_0x0615('0x1a')](_0x503035);}};}function respondWithFilteredResult(_0x288b96,_0x18ec4b){return function(_0x3c88cb){if(_0x3c88cb){var _0x56b6cf=typeof _0x18ec4b[_0x0615('0x1b')]==='undefined'&&typeof _0x18ec4b[_0x0615('0x1c')]===_0x0615('0x1d');var _0x1ed258=_0x3c88cb[_0x0615('0x1e')];var _0x43228b=_0x56b6cf?0x0:_0x18ec4b[_0x0615('0x1b')];var _0x1250f1=_0x56b6cf?_0x3c88cb[_0x0615('0x1e')]:_0x18ec4b[_0x0615('0x1b')]+_0x18ec4b[_0x0615('0x1c')];var _0x396872;if(_0x1250f1>=_0x1ed258){_0x1250f1=_0x1ed258;_0x396872=0xc8;}else{_0x396872=0xce;}_0x288b96[_0x0615('0x19')](_0x396872);return _0x288b96[_0x0615('0x1f')](_0x0615('0x20'),_0x43228b+'-'+_0x1250f1+'/'+_0x1ed258)[_0x0615('0x1a')](_0x3c88cb);}return null;};}function patchUpdates(_0x183643){return function(_0x14cb88){try{jsonpatch[_0x0615('0x21')](_0x14cb88,_0x183643,!![]);}catch(_0x37b9fe){return BPromise['reject'](_0x37b9fe);}return _0x14cb88[_0x0615('0x22')]();};}function saveUpdates(_0x439747,_0x5888cd){return function(_0xe22127){if(_0xe22127){return _0xe22127[_0x0615('0x23')](_0x439747)[_0x0615('0x24')](function(_0x7ae893){return _0x7ae893;});}return null;};}function removeEntity(_0x4e1a1c,_0x5defe4){return function(_0x5003ac){if(_0x5003ac){return _0x5003ac[_0x0615('0x25')]()[_0x0615('0x24')](function(){_0x4e1a1c[_0x0615('0x19')](0xcc)[_0x0615('0x26')]();});}};}function handleEntityNotFound(_0x584fab,_0x430200){return function(_0x29fde7){if(!_0x29fde7){_0x584fab[_0x0615('0x18')](0x194);}return _0x29fde7;};}function handleError(_0x7ed3c7,_0x325570){_0x325570=_0x325570||0x1f4;return function(_0x3481c5){logger[_0x0615('0x27')](_0x3481c5[_0x0615('0x28')]);if(_0x3481c5[_0x0615('0x29')]){delete _0x3481c5['name'];}_0x7ed3c7['status'](_0x325570)[_0x0615('0x2a')](_0x3481c5);};}exports['index']=function(_0x283b2d,_0x153ab5){var _0x1cfe10={},_0x5b61ee={},_0x2afd82={'count':0x0,'rows':[]};var _0xe4aabc=_[_0x0615('0x2b')](db[_0x0615('0x2c')][_0x0615('0x2d')],function(_0x1b44b7){return{'name':_0x1b44b7['fieldName'],'type':_0x1b44b7[_0x0615('0x2e')][_0x0615('0x2f')]};});_0x5b61ee[_0x0615('0x30')]=_[_0x0615('0x2b')](_0xe4aabc,_0x0615('0x29'));_0x5b61ee['query']=_[_0x0615('0x31')](_0x283b2d['query']);_0x5b61ee[_0x0615('0x32')]=_['intersection'](_0x5b61ee[_0x0615('0x30')],_0x5b61ee[_0x0615('0x33')]);_0x1cfe10[_0x0615('0x34')]=_['intersection'](_0x5b61ee[_0x0615('0x30')],qs[_0x0615('0x35')](_0x283b2d[_0x0615('0x33')][_0x0615('0x35')]));_0x1cfe10[_0x0615('0x34')]=_0x1cfe10[_0x0615('0x34')][_0x0615('0x36')]?_0x1cfe10[_0x0615('0x34')]:_0x5b61ee[_0x0615('0x30')];if(!_0x283b2d[_0x0615('0x33')]['hasOwnProperty'](_0x0615('0x37'))){_0x1cfe10[_0x0615('0x1c')]=qs['limit'](_0x283b2d[_0x0615('0x33')][_0x0615('0x1c')]);_0x1cfe10[_0x0615('0x1b')]=qs[_0x0615('0x1b')](_0x283b2d[_0x0615('0x33')]['offset']);}_0x1cfe10[_0x0615('0x38')]=qs[_0x0615('0x39')](_0x283b2d[_0x0615('0x33')][_0x0615('0x39')]);_0x1cfe10[_0x0615('0x3a')]=qs[_0x0615('0x32')](_['pick'](_0x283b2d[_0x0615('0x33')],_0x5b61ee[_0x0615('0x32')]),_0xe4aabc);if(_0x283b2d[_0x0615('0x33')]['filter']){_0x1cfe10['where']=_['merge'](_0x1cfe10[_0x0615('0x3a')],{'$or':_[_0x0615('0x2b')](_0xe4aabc,function(_0x1741a9){if(_0x1741a9[_0x0615('0x2e')]!==_0x0615('0x3b')){var _0x3fac8a={};_0x3fac8a[_0x1741a9[_0x0615('0x29')]]={'$like':'%'+_0x283b2d[_0x0615('0x33')][_0x0615('0x3c')]+'%'};return _0x3fac8a;}})});}_0x1cfe10=_[_0x0615('0x3d')]({},_0x1cfe10,_0x283b2d[_0x0615('0x3e')]);var _0x20b3f6={'where':_0x1cfe10[_0x0615('0x3a')]};return db[_0x0615('0x2c')][_0x0615('0x1e')](_0x20b3f6)[_0x0615('0x24')](function(_0x353373){_0x2afd82[_0x0615('0x1e')]=_0x353373;if(_0x283b2d['query'][_0x0615('0x3f')]){_0x1cfe10[_0x0615('0x40')]=[{'all':!![]}];}return db[_0x0615('0x2c')]['findAll'](_0x1cfe10);})[_0x0615('0x24')](function(_0x4b03d9){_0x2afd82[_0x0615('0x41')]=_0x4b03d9;return _0x2afd82;})[_0x0615('0x24')](respondWithFilteredResult(_0x153ab5,_0x1cfe10))[_0x0615('0x42')](handleError(_0x153ab5,null));};exports[_0x0615('0x43')]=function(_0x153b1d,_0x375661){var _0x1182b3={'raw':![],'where':{'id':_0x153b1d[_0x0615('0x44')]['id']}},_0x20277f={};_0x20277f[_0x0615('0x30')]=_[_0x0615('0x31')](db['UserProfileSection']['rawAttributes']);_0x20277f['query']=_[_0x0615('0x31')](_0x153b1d[_0x0615('0x33')]);_0x20277f[_0x0615('0x32')]=_[_0x0615('0x45')](_0x20277f[_0x0615('0x30')],_0x20277f[_0x0615('0x33')]);_0x1182b3['attributes']=_['intersection'](_0x20277f[_0x0615('0x30')],qs['fields'](_0x153b1d[_0x0615('0x33')][_0x0615('0x35')]));_0x1182b3['attributes']=_0x1182b3[_0x0615('0x34')][_0x0615('0x36')]?_0x1182b3[_0x0615('0x34')]:_0x20277f[_0x0615('0x30')];if(_0x153b1d[_0x0615('0x33')]['includeAll']){_0x1182b3['include']=[{'all':!![]}];}_0x1182b3=_[_0x0615('0x3d')]({},_0x1182b3,_0x153b1d[_0x0615('0x3e')]);return db[_0x0615('0x2c')][_0x0615('0x46')](_0x1182b3)[_0x0615('0x24')](handleEntityNotFound(_0x375661,null))['then'](respondWithResult(_0x375661,null))['catch'](handleError(_0x375661,null));};exports[_0x0615('0x47')]=function(_0x2621e1,_0x42efed){return db[_0x0615('0x2c')][_0x0615('0x47')](_0x2621e1[_0x0615('0x48')],{})['then'](respondWithResult(_0x42efed,0xc9))[_0x0615('0x42')](handleError(_0x42efed,null));};exports[_0x0615('0x23')]=function(_0x31c02d,_0x1e1c42){if(_0x31c02d[_0x0615('0x48')]['id']){delete _0x31c02d[_0x0615('0x48')]['id'];}return db[_0x0615('0x2c')]['find']({'where':{'id':_0x31c02d[_0x0615('0x44')]['id']}})[_0x0615('0x24')](handleEntityNotFound(_0x1e1c42,null))[_0x0615('0x24')](saveUpdates(_0x31c02d[_0x0615('0x48')],null))[_0x0615('0x24')](respondWithResult(_0x1e1c42,null))[_0x0615('0x42')](handleError(_0x1e1c42,null));};exports['destroy']=function(_0x2626ff,_0x462c92){return db[_0x0615('0x2c')]['find']({'where':{'id':_0x2626ff[_0x0615('0x44')]['id']}})[_0x0615('0x24')](handleEntityNotFound(_0x462c92,null))['then'](removeEntity(_0x462c92,null))[_0x0615('0x42')](handleError(_0x462c92,null));};exports['describe']=function(_0x533bf3,_0x1cf808){return db[_0x0615('0x2c')][_0x0615('0x49')]()[_0x0615('0x24')](respondWithResult(_0x1cf808,null))[_0x0615('0x42')](handleError(_0x1cf808,null));}; \ No newline at end of file +var _0x26f7=['count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','UserProfileSection','rows','catch','show','find','create','body','update','params','describe','eml-format','fast-json-patch','moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x4baac3,_0x481c9a){var _0x4fb4bc=function(_0x27d865){while(--_0x27d865){_0x4baac3['push'](_0x4baac3['shift']());}};_0x4fb4bc(++_0x481c9a);}(_0x26f7,0xf3));var _0x726f=function(_0x20f0c0,_0x1ffd04){_0x20f0c0=_0x20f0c0-0x0;var _0x3b504a=_0x26f7[_0x20f0c0];return _0x3b504a;};'use strict';var emlformat=require(_0x726f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x726f('0x1'));var rp=require('request-promise');var moment=require(_0x726f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x726f('0x3'));var util=require('util');var path=require('path');var sox=require(_0x726f('0x4'));var csv=require(_0x726f('0x5'));var ejs=require(_0x726f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x726f('0x7'));var crypto=require(_0x726f('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x726f('0x9'));var toCsv=require(_0x726f('0x5'));var querystring=require(_0x726f('0xa'));var Papa=require('papaparse');var Redis=require(_0x726f('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x726f('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x726f('0xd'))(_0x726f('0xe'));var utils=require(_0x726f('0xf'));var config=require(_0x726f('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x726f('0x11'))['db'];function respondWithStatusCode(_0x67d1ed,_0x5a35c9){_0x5a35c9=_0x5a35c9||0xcc;return function(_0xbfd7b){if(_0xbfd7b){return _0x67d1ed[_0x726f('0x12')](_0x5a35c9);}return _0x67d1ed['status'](_0x5a35c9)[_0x726f('0x13')]();};}function respondWithResult(_0x445199,_0x4d99de){_0x4d99de=_0x4d99de||0xc8;return function(_0x4fbe92){if(_0x4fbe92){return _0x445199[_0x726f('0x14')](_0x4d99de)[_0x726f('0x15')](_0x4fbe92);}};}function respondWithFilteredResult(_0x3caea9,_0x5d162d){return function(_0x340780){if(_0x340780){var _0x322429=typeof _0x5d162d[_0x726f('0x16')]===_0x726f('0x17')&&typeof _0x5d162d[_0x726f('0x18')]===_0x726f('0x17');var _0x2b2702=_0x340780[_0x726f('0x19')];var _0x3e6782=_0x322429?0x0:_0x5d162d[_0x726f('0x16')];var _0x50b86b=_0x322429?_0x340780[_0x726f('0x19')]:_0x5d162d['offset']+_0x5d162d[_0x726f('0x18')];var _0x59cd6b;if(_0x50b86b>=_0x2b2702){_0x50b86b=_0x2b2702;_0x59cd6b=0xc8;}else{_0x59cd6b=0xce;}_0x3caea9[_0x726f('0x14')](_0x59cd6b);return _0x3caea9[_0x726f('0x1a')](_0x726f('0x1b'),_0x3e6782+'-'+_0x50b86b+'/'+_0x2b2702)['json'](_0x340780);}return null;};}function patchUpdates(_0x4856af){return function(_0x4e8050){try{jsonpatch[_0x726f('0x1c')](_0x4e8050,_0x4856af,!![]);}catch(_0x4fbe05){return BPromise[_0x726f('0x1d')](_0x4fbe05);}return _0x4e8050['save']();};}function saveUpdates(_0x2d1b8e,_0xaae242){return function(_0x353527){if(_0x353527){return _0x353527['update'](_0x2d1b8e)[_0x726f('0x1e')](function(_0x4cf400){return _0x4cf400;});}return null;};}function removeEntity(_0x5ab185,_0x145f03){return function(_0x32f87e){if(_0x32f87e){return _0x32f87e[_0x726f('0x1f')]()[_0x726f('0x1e')](function(){_0x5ab185[_0x726f('0x14')](0xcc)[_0x726f('0x13')]();});}};}function handleEntityNotFound(_0x7b1576,_0x45e1ac){return function(_0x528733){if(!_0x528733){_0x7b1576[_0x726f('0x12')](0x194);}return _0x528733;};}function handleError(_0xc4734d,_0x212118){_0x212118=_0x212118||0x1f4;return function(_0x5c6eb6){logger[_0x726f('0x20')](_0x5c6eb6['stack']);if(_0x5c6eb6[_0x726f('0x21')]){delete _0x5c6eb6[_0x726f('0x21')];}_0xc4734d[_0x726f('0x14')](_0x212118)[_0x726f('0x22')](_0x5c6eb6);};}exports['index']=function(_0xb4ce41,_0x26a1f4){var _0x168914={},_0x206b66={},_0x51e97c={'count':0x0,'rows':[]};var _0x11d9c1=_[_0x726f('0x23')](db['UserProfileSection'][_0x726f('0x24')],function(_0x240963){return{'name':_0x240963[_0x726f('0x25')],'type':_0x240963[_0x726f('0x26')][_0x726f('0x27')]};});_0x206b66['model']=_[_0x726f('0x23')](_0x11d9c1,_0x726f('0x21'));_0x206b66['query']=_[_0x726f('0x28')](_0xb4ce41[_0x726f('0x29')]);_0x206b66[_0x726f('0x2a')]=_[_0x726f('0x2b')](_0x206b66[_0x726f('0x2c')],_0x206b66[_0x726f('0x29')]);_0x168914['attributes']=_['intersection'](_0x206b66['model'],qs[_0x726f('0x2d')](_0xb4ce41[_0x726f('0x29')][_0x726f('0x2d')]));_0x168914[_0x726f('0x2e')]=_0x168914[_0x726f('0x2e')][_0x726f('0x2f')]?_0x168914[_0x726f('0x2e')]:_0x206b66[_0x726f('0x2c')];if(!_0xb4ce41[_0x726f('0x29')]['hasOwnProperty']('nolimit')){_0x168914[_0x726f('0x18')]=qs[_0x726f('0x18')](_0xb4ce41['query'][_0x726f('0x18')]);_0x168914[_0x726f('0x16')]=qs['offset'](_0xb4ce41[_0x726f('0x29')][_0x726f('0x16')]);}_0x168914[_0x726f('0x30')]=qs[_0x726f('0x31')](_0xb4ce41[_0x726f('0x29')]['sort']);_0x168914[_0x726f('0x32')]=qs[_0x726f('0x2a')](_[_0x726f('0x33')](_0xb4ce41[_0x726f('0x29')],_0x206b66[_0x726f('0x2a')]),_0x11d9c1);if(_0xb4ce41[_0x726f('0x29')][_0x726f('0x34')]){_0x168914['where']=_['merge'](_0x168914[_0x726f('0x32')],{'$or':_[_0x726f('0x23')](_0x11d9c1,function(_0x3a824e){if(_0x3a824e[_0x726f('0x26')]!=='VIRTUAL'){var _0x756aae={};_0x756aae[_0x3a824e[_0x726f('0x21')]]={'$like':'%'+_0xb4ce41[_0x726f('0x29')][_0x726f('0x34')]+'%'};return _0x756aae;}})});}_0x168914=_[_0x726f('0x35')]({},_0x168914,_0xb4ce41[_0x726f('0x36')]);var _0x33d65d={'where':_0x168914[_0x726f('0x32')]};return db['UserProfileSection']['count'](_0x33d65d)[_0x726f('0x1e')](function(_0x4b2d5f){_0x51e97c[_0x726f('0x19')]=_0x4b2d5f;if(_0xb4ce41[_0x726f('0x29')][_0x726f('0x37')]){_0x168914[_0x726f('0x38')]=[{'all':!![]}];}return db[_0x726f('0x39')]['findAll'](_0x168914);})['then'](function(_0x2a5d48){_0x51e97c[_0x726f('0x3a')]=_0x2a5d48;return _0x51e97c;})[_0x726f('0x1e')](respondWithFilteredResult(_0x26a1f4,_0x168914))[_0x726f('0x3b')](handleError(_0x26a1f4,null));};exports[_0x726f('0x3c')]=function(_0x90ff30,_0x563d9c){var _0x149ab0={'raw':![],'where':{'id':_0x90ff30['params']['id']}},_0x444729={};_0x444729[_0x726f('0x2c')]=_['keys'](db[_0x726f('0x39')]['rawAttributes']);_0x444729['query']=_[_0x726f('0x28')](_0x90ff30['query']);_0x444729[_0x726f('0x2a')]=_['intersection'](_0x444729['model'],_0x444729['query']);_0x149ab0[_0x726f('0x2e')]=_['intersection'](_0x444729[_0x726f('0x2c')],qs[_0x726f('0x2d')](_0x90ff30['query']['fields']));_0x149ab0[_0x726f('0x2e')]=_0x149ab0[_0x726f('0x2e')][_0x726f('0x2f')]?_0x149ab0[_0x726f('0x2e')]:_0x444729[_0x726f('0x2c')];if(_0x90ff30['query'][_0x726f('0x37')]){_0x149ab0['include']=[{'all':!![]}];}_0x149ab0=_['merge']({},_0x149ab0,_0x90ff30[_0x726f('0x36')]);return db[_0x726f('0x39')][_0x726f('0x3d')](_0x149ab0)['then'](handleEntityNotFound(_0x563d9c,null))['then'](respondWithResult(_0x563d9c,null))['catch'](handleError(_0x563d9c,null));};exports[_0x726f('0x3e')]=function(_0x1199a9,_0x32f95f){return db['UserProfileSection'][_0x726f('0x3e')](_0x1199a9[_0x726f('0x3f')],{})[_0x726f('0x1e')](respondWithResult(_0x32f95f,0xc9))['catch'](handleError(_0x32f95f,null));};exports[_0x726f('0x40')]=function(_0x512e13,_0xda9db6){if(_0x512e13[_0x726f('0x3f')]['id']){delete _0x512e13[_0x726f('0x3f')]['id'];}return db['UserProfileSection'][_0x726f('0x3d')]({'where':{'id':_0x512e13[_0x726f('0x41')]['id']}})[_0x726f('0x1e')](handleEntityNotFound(_0xda9db6,null))[_0x726f('0x1e')](saveUpdates(_0x512e13[_0x726f('0x3f')],null))[_0x726f('0x1e')](respondWithResult(_0xda9db6,null))[_0x726f('0x3b')](handleError(_0xda9db6,null));};exports[_0x726f('0x1f')]=function(_0x531afa,_0x4bbb4b){return db['UserProfileSection'][_0x726f('0x3d')]({'where':{'id':_0x531afa[_0x726f('0x41')]['id']}})[_0x726f('0x1e')](handleEntityNotFound(_0x4bbb4b,null))[_0x726f('0x1e')](removeEntity(_0x4bbb4b,null))[_0x726f('0x3b')](handleError(_0x4bbb4b,null));};exports[_0x726f('0x42')]=function(_0x3b3bb4,_0x41c3fc){return db[_0x726f('0x39')][_0x726f('0x42')]()[_0x726f('0x1e')](respondWithResult(_0x41c3fc,null))[_0x726f('0x3b')](handleError(_0x41c3fc,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3bbbd31..dc75b98 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 _0x9ccb=['api','moment','bluebird','rimraf','../../config/environment','exports','define','user_profile_has_sections','compositeIndex','util','../../config/logger'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x9ccb,0x1c1));var _0xb9cc=function(_0x203cf5,_0x8421e0){_0x203cf5=_0x203cf5-0x0;var _0x17a51d=_0x9ccb[_0x203cf5];return _0x17a51d;};'use strict';var _=require('lodash');var util=require(_0xb9cc('0x0'));var logger=require(_0xb9cc('0x1'))(_0xb9cc('0x2'));var moment=require(_0xb9cc('0x3'));var BPromise=require(_0xb9cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9cc('0x5'));var config=require(_0xb9cc('0x6'));var attributes=require('./userProfileSection.attributes');module[_0xb9cc('0x7')]=function(_0xa283d0,_0x17368d){return _0xa283d0[_0xb9cc('0x8')]('UserProfileSection',attributes,{'tableName':_0xb9cc('0x9'),'paranoid':![],'indexes':[{'name':_0xb9cc('0xa'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b68=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4cfaca,_0x477428){var _0x33d40f=function(_0x52d342){while(--_0x52d342){_0x4cfaca['push'](_0x4cfaca['shift']());}};_0x33d40f(++_0x477428);}(_0x3b68,0x87));var _0x83b6=function(_0x906246,_0x506fc4){_0x906246=_0x906246-0x0;var _0x599937=_0x3b68[_0x906246];return _0x599937;};'use strict';var _=require(_0x83b6('0x0'));var util=require('util');var logger=require(_0x83b6('0x1'))(_0x83b6('0x2'));var moment=require(_0x83b6('0x3'));var BPromise=require(_0x83b6('0x4'));var rp=require(_0x83b6('0x5'));var fs=require('fs');var path=require(_0x83b6('0x6'));var rimraf=require(_0x83b6('0x7'));var config=require(_0x83b6('0x8'));var attributes=require('./userProfileSection.attributes');module[_0x83b6('0x9')]=function(_0xc3b601,_0x2bcbd0){return _0xc3b601[_0x83b6('0xa')](_0x83b6('0xb'),attributes,{'tableName':_0x83b6('0xc'),'paranoid':![],'indexes':[{'name':_0x83b6('0xd'),'fields':[_0x83b6('0xe'),_0x83b6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e4a6397..3ca34c3 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 _0x022e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x47bb47,_0x5104be){var _0x25683c=function(_0x186354){while(--_0x186354){_0x47bb47['push'](_0x47bb47['shift']());}};_0x25683c(++_0x5104be);}(_0x022e,0xc4));var _0xe022=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x022e[_0x454018];return _0x24697d;};'use strict';var _=require(_0xe022('0x0'));var util=require('util');var moment=require(_0xe022('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe022('0x2'))['db'];var utils=require(_0xe022('0x3'));var logger=require('../../config/logger')(_0xe022('0x4'));var config=require(_0xe022('0x5'));var jayson=require(_0xe022('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24513d,_0x56bcb5,_0x52c7ec){return new BPromise(function(_0x39d424,_0xce6f15){return client[_0xe022('0x7')](_0x24513d,_0x52c7ec)[_0xe022('0x8')](function(_0x38f264){logger[_0xe022('0x9')](_0xe022('0xa'),_0x56bcb5,_0xe022('0xb'));logger[_0xe022('0xc')](_0xe022('0xd'),_0x56bcb5,_0xe022('0xb'),JSON[_0xe022('0xe')](_0x38f264));if(_0x38f264[_0xe022('0xf')]){if(_0x38f264[_0xe022('0xf')]['code']===0x1f4){logger[_0xe022('0xf')](_0xe022('0xa'),_0x56bcb5,_0x38f264['error']['message']);return _0xce6f15(_0x38f264['error'][_0xe022('0x10')]);}logger[_0xe022('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x56bcb5,_0x38f264[_0xe022('0xf')]['message']);return _0x39d424(_0x38f264['error'][_0xe022('0x10')]);}else{logger[_0xe022('0x9')](_0xe022('0xa'),_0x56bcb5,'request\x20sent');_0x39d424(_0x38f264['result']['message']);}})[_0xe022('0x11')](function(_0x3444d3){logger[_0xe022('0xf')](_0xe022('0xa'),_0x56bcb5,_0x3444d3);_0xce6f15(_0x3444d3);});});} \ No newline at end of file +var _0xad71=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2ffdb5,_0x4197e3){var _0x5ddb3c=function(_0xa8d778){while(--_0xa8d778){_0x2ffdb5['push'](_0x2ffdb5['shift']());}};_0x5ddb3c(++_0x4197e3);}(_0xad71,0x126));var _0x1ad7=function(_0x1c12fb,_0x2fb737){_0x1c12fb=_0x1c12fb-0x0;var _0x5caa59=_0xad71[_0x1c12fb];return _0x5caa59;};'use strict';var _=require(_0x1ad7('0x0'));var util=require('util');var moment=require(_0x1ad7('0x1'));var BPromise=require(_0x1ad7('0x2'));var rs=require(_0x1ad7('0x3'));var fs=require('fs');var Redis=require(_0x1ad7('0x4'));var db=require(_0x1ad7('0x5'))['db'];var utils=require(_0x1ad7('0x6'));var logger=require('../../config/logger')(_0x1ad7('0x7'));var config=require(_0x1ad7('0x8'));var jayson=require(_0x1ad7('0x9'));var client=jayson[_0x1ad7('0xa')][_0x1ad7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf6e89b,_0x4736d0,_0x4e7c39){return new BPromise(function(_0xe417e1,_0x23d1b){return client['request'](_0xf6e89b,_0x4e7c39)[_0x1ad7('0xc')](function(_0x527d24){logger['info'](_0x1ad7('0xd'),_0x4736d0,_0x1ad7('0xe'));logger[_0x1ad7('0xf')](_0x1ad7('0x10'),_0x4736d0,'request\x20sent',JSON[_0x1ad7('0x11')](_0x527d24));if(_0x527d24[_0x1ad7('0x12')]){if(_0x527d24[_0x1ad7('0x12')][_0x1ad7('0x13')]===0x1f4){logger[_0x1ad7('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x4736d0,_0x527d24[_0x1ad7('0x12')][_0x1ad7('0x14')]);return _0x23d1b(_0x527d24['error'][_0x1ad7('0x14')]);}logger[_0x1ad7('0x12')](_0x1ad7('0xd'),_0x4736d0,_0x527d24['error']['message']);return _0xe417e1(_0x527d24['error'][_0x1ad7('0x14')]);}else{logger[_0x1ad7('0x15')]('UserProfileSection,\x20%s,\x20%s',_0x4736d0,_0x1ad7('0xe'));_0xe417e1(_0x527d24['result']['message']);}})[_0x1ad7('0x16')](function(_0x16f608){logger[_0x1ad7('0x12')](_0x1ad7('0xd'),_0x4736d0,_0x16f608);_0x23d1b(_0x16f608);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0114045..f08bcf3 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3f3d76,_0x4a11a2){var _0x41157b=function(_0x30d632){while(--_0x30d632){_0x3f3d76['push'](_0x3f3d76['shift']());}};_0x41157b(++_0x4a11a2);}(_0x70e0,0x17b));var _0x070e=function(_0x1614af,_0x17e559){_0x1614af=_0x1614af-0x0;var _0x115ea4=_0x70e0[_0x1614af];return _0x115ea4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f8782,_0x4a4544){var _0x197c77=function(_0x10c84f){while(--_0x10c84f){_0x2f8782['push'](_0x2f8782['shift']());}};_0x197c77(++_0x4a4544);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 5a3db47..93ceca8 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 _0xb866=['exports','INTEGER'];(function(_0x396b2c,_0x2bd717){var _0x5c10a1=function(_0xe62d11){while(--_0xe62d11){_0x396b2c['push'](_0x396b2c['shift']());}};_0x5c10a1(++_0x2bd717);}(_0xb866,0x68));var _0x6b86=function(_0x251bfb,_0x5ee2c7){_0x251bfb=_0x251bfb-0x0;var _0x655a1c=_0xb866[_0x251bfb];return _0x655a1c;};'use strict';var Sequelize=require('sequelize');module[_0x6b86('0x0')]={'penalty':{'type':Sequelize[_0x6b86('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd31=['INTEGER','sequelize'];(function(_0x4a4bc6,_0xd33196){var _0x4efc14=function(_0x4ddde3){while(--_0x4ddde3){_0x4a4bc6['push'](_0x4a4bc6['shift']());}};_0x4efc14(++_0xd33196);}(_0xcd31,0x93));var _0x1cd3=function(_0x4c4047,_0x176cc1){_0x4c4047=_0x4c4047-0x0;var _0x2cb22c=_0xcd31[_0x4c4047];return _0x2cb22c;};'use strict';var Sequelize=require(_0x1cd3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1cd3('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 4f53291..3b019df 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 _0x583c=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','lodash'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x583c,0x12b));var _0xc583=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x583c[_0x43aee5];return _0x76d1d0;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));module['exports']=function(_0xd3a750,_0x365ed6){return _0xd3a750[_0xc583('0x8')](_0xc583('0x9'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues'];(function(_0x158506,_0x413c48){var _0x18a4ad=function(_0x236e52){while(--_0x236e52){_0x158506['push'](_0x158506['shift']());}};_0x18a4ad(++_0x413c48);}(_0x1261,0x144));var _0x1126=function(_0x26dda0,_0x5b58ab){_0x26dda0=_0x26dda0-0x0;var _0x41089c=_0x1261[_0x26dda0];return _0x41089c;};'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')]('UserSmsQueue',attributes,{'tableName':_0x1126('0xb'),'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 1946284..3407e10 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 _0xaf0f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2875d4,_0x38082b){var _0x3cacd6=function(_0x3f11c4){while(--_0x3f11c4){_0x2875d4['push'](_0x2875d4['shift']());}};_0x3cacd6(++_0x38082b);}(_0xaf0f,0x133));var _0xfaf0=function(_0x22de2f,_0x375f63){_0x22de2f=_0x22de2f-0x0;var _0x529000=_0xaf0f[_0x22de2f];return _0x529000;};'use strict';var _=require(_0xfaf0('0x0'));var util=require(_0xfaf0('0x1'));var moment=require(_0xfaf0('0x2'));var BPromise=require(_0xfaf0('0x3'));var rs=require(_0xfaf0('0x4'));var fs=require('fs');var Redis=require(_0xfaf0('0x5'));var db=require(_0xfaf0('0x6'))['db'];var utils=require(_0xfaf0('0x7'));var logger=require(_0xfaf0('0x8'))('rpc');var config=require(_0xfaf0('0x9'));var jayson=require(_0xfaf0('0xa'));var client=jayson['client'][_0xfaf0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a44b9,_0x22cfb0,_0x3f7406){return new BPromise(function(_0x198322,_0x248e2e){return client[_0xfaf0('0xc')](_0x3a44b9,_0x3f7406)[_0xfaf0('0xd')](function(_0x417601){logger[_0xfaf0('0xe')](_0xfaf0('0xf'),_0x22cfb0,'request\x20sent');logger[_0xfaf0('0x10')](_0xfaf0('0x11'),_0x22cfb0,_0xfaf0('0x12'),JSON[_0xfaf0('0x13')](_0x417601));if(_0x417601['error']){if(_0x417601[_0xfaf0('0x14')]['code']===0x1f4){logger[_0xfaf0('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x22cfb0,_0x417601[_0xfaf0('0x14')][_0xfaf0('0x15')]);return _0x248e2e(_0x417601[_0xfaf0('0x14')][_0xfaf0('0x15')]);}logger[_0xfaf0('0x14')](_0xfaf0('0xf'),_0x22cfb0,_0x417601['error']['message']);return _0x198322(_0x417601[_0xfaf0('0x14')][_0xfaf0('0x15')]);}else{logger[_0xfaf0('0xe')](_0xfaf0('0xf'),_0x22cfb0,_0xfaf0('0x12'));_0x198322(_0x417601[_0xfaf0('0x16')][_0xfaf0('0x15')]);}})[_0xfaf0('0x17')](function(_0x36fa5e){logger['error'](_0xfaf0('0xf'),_0x22cfb0,_0x36fa5e);_0x248e2e(_0x36fa5e);});});} \ No newline at end of file +var _0x3b2f=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x3b2f,0x1db));var _0xf3b2=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x3b2f[_0x31c19c];return _0x1a87f7;};'use strict';var _=require(_0xf3b2('0x0'));var util=require(_0xf3b2('0x1'));var moment=require(_0xf3b2('0x2'));var BPromise=require(_0xf3b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3b2('0x4'));var db=require(_0xf3b2('0x5'))['db'];var utils=require(_0xf3b2('0x6'));var logger=require('../../config/logger')(_0xf3b2('0x7'));var config=require(_0xf3b2('0x8'));var jayson=require(_0xf3b2('0x9'));var client=jayson[_0xf3b2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31022e,_0x1ab5b4,_0x586f34){return new BPromise(function(_0x57d521,_0x8e4840){return client[_0xf3b2('0xb')](_0x31022e,_0x586f34)[_0xf3b2('0xc')](function(_0x341a9c){logger[_0xf3b2('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x1ab5b4,_0xf3b2('0xe'));logger[_0xf3b2('0xf')](_0xf3b2('0x10'),_0x1ab5b4,_0xf3b2('0xe'),JSON[_0xf3b2('0x11')](_0x341a9c));if(_0x341a9c[_0xf3b2('0x12')]){if(_0x341a9c['error'][_0xf3b2('0x13')]===0x1f4){logger[_0xf3b2('0x12')](_0xf3b2('0x14'),_0x1ab5b4,_0x341a9c['error'][_0xf3b2('0x15')]);return _0x8e4840(_0x341a9c[_0xf3b2('0x12')][_0xf3b2('0x15')]);}logger[_0xf3b2('0x12')](_0xf3b2('0x14'),_0x1ab5b4,_0x341a9c['error'][_0xf3b2('0x15')]);return _0x57d521(_0x341a9c[_0xf3b2('0x12')]['message']);}else{logger['info'](_0xf3b2('0x14'),_0x1ab5b4,_0xf3b2('0xe'));_0x57d521(_0x341a9c['result'][_0xf3b2('0x15')]);}})[_0xf3b2('0x16')](function(_0x17bad5){logger[_0xf3b2('0x12')](_0xf3b2('0x14'),_0x1ab5b4,_0x17bad5);_0x8e4840(_0x17bad5);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 3444bed..fdfcee2 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf1ad=['INTEGER'];(function(_0x408c9a,_0x41ffa9){var _0x374156=function(_0x1a6465){while(--_0x1a6465){_0x408c9a['push'](_0x408c9a['shift']());}};_0x374156(++_0x41ffa9);}(_0xf1ad,0xe1));var _0xdf1a=function(_0x25e180,_0xa8068f){_0x25e180=_0x25e180-0x0;var _0x31f9c4=_0xf1ad[_0x25e180];return _0x31f9c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xdf1a('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xdf1a('0x0')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 2e9d900..fd2d714 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(_0x506fa0,_0x273f1c){var _0x3af14c=function(_0x46cb99){while(--_0x46cb99){_0x506fa0['push'](_0x506fa0['shift']());}};_0x3af14c(++_0x273f1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0xf2f513,_0x17df54){var _0x33f84b=function(_0x1f4005){while(--_0x1f4005){_0xf2f513['push'](_0xf2f513['shift']());}};_0x33f84b(++_0x17df54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 966bd46..3c4945e 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x96f32a,_0x492cb9){var _0x1d7276=function(_0xaebbaf){while(--_0xaebbaf){_0x96f32a['push'](_0x96f32a['shift']());}};_0x1d7276(++_0x492cb9);}(_0x70e0,0x17b));var _0x070e=function(_0x1796dd,_0x360918){_0x1796dd=_0x1796dd-0x0;var _0x2d9ec3=_0x70e0[_0x1796dd];return _0x2d9ec3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4305a6,_0x1295e){var _0x11eaa7=function(_0x2d5874){while(--_0x2d5874){_0x4305a6['push'](_0x4305a6['shift']());}};_0x11eaa7(++_0x1295e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0xcb91[_0x5c5c52];return _0x4229ff;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f6b0f83..c091251 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 _0xd527=['sequelize','exports','INTEGER'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0xd527,0x87));var _0x7d52=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0xd527[_0x2166a3];return _0x260035;};'use strict';var Sequelize=require(_0x7d52('0x0'));module[_0x7d52('0x1')]={'penalty':{'type':Sequelize[_0x7d52('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6131=['sequelize'];(function(_0x1c5bbd,_0x352974){var _0x398e08=function(_0x2f7e68){while(--_0x2f7e68){_0x1c5bbd['push'](_0x1c5bbd['shift']());}};_0x398e08(++_0x352974);}(_0x6131,0xe0));var _0x1613=function(_0x17a713,_0x1225bb){_0x17a713=_0x17a713-0x0;var _0x71e9e8=_0x6131[_0x17a713];return _0x71e9e8;};'use strict';var Sequelize=require(_0x1613('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 46b0e5a..3e59b1a 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 _0x985d=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x985d,0x1d3));var _0xd985=function(_0x5d0c01,_0x4db032){_0x5d0c01=_0x5d0c01-0x0;var _0x47afee=_0x985d[_0x5d0c01];return _0x47afee;};'use strict';var _=require(_0xd985('0x0'));var util=require(_0xd985('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd985('0x2'));var BPromise=require(_0xd985('0x3'));var rp=require(_0xd985('0x4'));var fs=require('fs');var path=require(_0xd985('0x5'));var rimraf=require(_0xd985('0x6'));var config=require(_0xd985('0x7'));var attributes=require(_0xd985('0x8'));module[_0xd985('0x9')]=function(_0x4ec186,_0x54f32b){return _0x4ec186['define'](_0xd985('0xa'),attributes,{'tableName':_0xd985('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x613e=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0xfc1213,_0x454296){var _0xc46aaa=function(_0xb0c11e){while(--_0xb0c11e){_0xfc1213['push'](_0xfc1213['shift']());}};_0xc46aaa(++_0x454296);}(_0x613e,0x1c7));var _0xe613=function(_0x393843,_0x28aee0){_0x393843=_0x393843-0x0;var _0x516db3=_0x613e[_0x393843];return _0x516db3;};'use strict';var _=require(_0xe613('0x0'));var util=require(_0xe613('0x1'));var logger=require(_0xe613('0x2'))('api');var moment=require(_0xe613('0x3'));var BPromise=require(_0xe613('0x4'));var rp=require(_0xe613('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe613('0x6'));var config=require(_0xe613('0x7'));var attributes=require(_0xe613('0x8'));module[_0xe613('0x9')]=function(_0x39f98f,_0x5da23c){return _0x39f98f[_0xe613('0xa')](_0xe613('0xb'),attributes,{'tableName':_0xe613('0xc'),'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 1d26b23..367aa52 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 _0x8420=['request','then','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x5cbcec,_0x16f654){var _0x32cfe2=function(_0x36855d){while(--_0x36855d){_0x5cbcec['push'](_0x5cbcec['shift']());}};_0x32cfe2(++_0x16f654);}(_0x8420,0xd2));var _0x0842=function(_0x51a76e,_0x1e090d){_0x51a76e=_0x51a76e-0x0;var _0x55f8d6=_0x8420[_0x51a76e];return _0x55f8d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0842('0x0'));var BPromise=require(_0x0842('0x1'));var rs=require(_0x0842('0x2'));var fs=require('fs');var Redis=require(_0x0842('0x3'));var db=require(_0x0842('0x4'))['db'];var utils=require(_0x0842('0x5'));var logger=require('../../config/logger')(_0x0842('0x6'));var config=require('../../config/environment');var jayson=require(_0x0842('0x7'));var client=jayson[_0x0842('0x8')][_0x0842('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27b0ff,_0x35efb2,_0x5bb57c){return new BPromise(function(_0x15c445,_0xd1a358){return client[_0x0842('0xa')](_0x27b0ff,_0x5bb57c)[_0x0842('0xb')](function(_0x571c21){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x35efb2,_0x0842('0xc'));logger[_0x0842('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x35efb2,'request\x20sent',JSON[_0x0842('0xe')](_0x571c21));if(_0x571c21[_0x0842('0xf')]){if(_0x571c21[_0x0842('0xf')][_0x0842('0x10')]===0x1f4){logger[_0x0842('0xf')](_0x0842('0x11'),_0x35efb2,_0x571c21['error'][_0x0842('0x12')]);return _0xd1a358(_0x571c21['error'][_0x0842('0x12')]);}logger[_0x0842('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x35efb2,_0x571c21[_0x0842('0xf')][_0x0842('0x12')]);return _0x15c445(_0x571c21[_0x0842('0xf')][_0x0842('0x12')]);}else{logger[_0x0842('0x13')](_0x0842('0x11'),_0x35efb2,_0x0842('0xc'));_0x15c445(_0x571c21[_0x0842('0x14')][_0x0842('0x12')]);}})[_0x0842('0x15')](function(_0x3c1a2f){logger['error'](_0x0842('0x11'),_0x35efb2,_0x3c1a2f);_0xd1a358(_0x3c1a2f);});});} \ No newline at end of file +var _0x2560=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x2560,0x10b));var _0x0256=function(_0x29e601,_0x230e00){_0x29e601=_0x29e601-0x0;var _0x2d4926=_0x2560[_0x29e601];return _0x2d4926;};'use strict';var _=require('lodash');var util=require(_0x0256('0x0'));var moment=require(_0x0256('0x1'));var BPromise=require(_0x0256('0x2'));var rs=require(_0x0256('0x3'));var fs=require('fs');var Redis=require(_0x0256('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0256('0x5'));var logger=require(_0x0256('0x6'))(_0x0256('0x7'));var config=require(_0x0256('0x8'));var jayson=require(_0x0256('0x9'));var client=jayson[_0x0256('0xa')][_0x0256('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fc695,_0x1c3e99,_0x5f4ad8){return new BPromise(function(_0x5d9cb9,_0x5eab22){return client['request'](_0x1fc695,_0x5f4ad8)['then'](function(_0x555108){logger[_0x0256('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x1c3e99,_0x0256('0xd'));logger['debug'](_0x0256('0xe'),_0x1c3e99,_0x0256('0xd'),JSON[_0x0256('0xf')](_0x555108));if(_0x555108['error']){if(_0x555108[_0x0256('0x10')][_0x0256('0x11')]===0x1f4){logger[_0x0256('0x10')](_0x0256('0x12'),_0x1c3e99,_0x555108[_0x0256('0x10')]['message']);return _0x5eab22(_0x555108[_0x0256('0x10')][_0x0256('0x13')]);}logger[_0x0256('0x10')](_0x0256('0x12'),_0x1c3e99,_0x555108['error']['message']);return _0x5d9cb9(_0x555108[_0x0256('0x10')][_0x0256('0x13')]);}else{logger[_0x0256('0xc')](_0x0256('0x12'),_0x1c3e99,_0x0256('0xd'));_0x5d9cb9(_0x555108[_0x0256('0x14')][_0x0256('0x13')]);}})[_0x0256('0x15')](function(_0x4e54ee){logger[_0x0256('0x10')](_0x0256('0x12'),_0x1c3e99,_0x4e54ee);_0x5eab22(_0x4e54ee);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c34455e..ffb4610 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x20287c,_0x10fc62){var _0x245a35=function(_0x22dfa6){while(--_0x22dfa6){_0x20287c['push'](_0x20287c['shift']());}};_0x245a35(++_0x10fc62);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xcb91[_0x1acc2d];return _0xabfa6d;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e4a09,_0xe4eac8){var _0x17a756=function(_0x23b5ef){while(--_0x23b5ef){_0x4e4a09['push'](_0x4e4a09['shift']());}};_0x17a756(++_0xe4eac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 ee43d0c..2d0fbac 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 _0x4316=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x4316,0x1ee));var _0x6431=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4316[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6431('0x0'));module[_0x6431('0x1')]={'uniqueid':{'type':Sequelize[_0x6431('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6431('0x3')},'membername':{'type':Sequelize[_0x6431('0x4')],'allowNull':![],'comment':_0x6431('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6431('0x4')],'allowNull':![],'unique':_0x6431('0x5'),'comment':_0x6431('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6431('0x5'),'comment':_0x6431('0x3')},'penalty':{'type':Sequelize[_0x6431('0x2')](0xb),'defaultValue':0x0,'comment':_0x6431('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x6431('0x3')}}; \ No newline at end of file +var _0x5862=['STRING','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x292d0b,_0x235dc2){var _0x3c5fed=function(_0x52b129){while(--_0x52b129){_0x292d0b['push'](_0x292d0b['shift']());}};_0x3c5fed(++_0x235dc2);}(_0x5862,0xd8));var _0x2586=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x5862[_0x5f1617];return _0x3af5da;};'use strict';var Sequelize=require(_0x2586('0x0'));module[_0x2586('0x1')]={'uniqueid':{'type':Sequelize[_0x2586('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2586('0x3')},'membername':{'type':Sequelize[_0x2586('0x4')],'allowNull':![],'comment':_0x2586('0x3')},'UserId':{'type':Sequelize[_0x2586('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x2586('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x2586('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x2586('0x3')},'penalty':{'type':Sequelize[_0x2586('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x2586('0x2')](0xb),'defaultValue':0x0,'comment':_0x2586('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8a5d8c2..631085e 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 _0x845d=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x845d,0x67));var _0xd845=function(_0x4ff823,_0x3cb962){_0x4ff823=_0x4ff823-0x0;var _0x44248d=_0x845d[_0x4ff823];return _0x44248d;};'use strict';var EventEmitter=require(_0xd845('0x0'));var UserVoiceQueueRt=require(_0xd845('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd845('0x2'),'afterDestroy':_0xd845('0x3')};function emitEvent(_0x2acb0e){return function(_0x48c4f1,_0x43b2ae,_0x465409){UserVoiceQueueRtEvents[_0xd845('0x4')](_0x2acb0e+':'+_0x48c4f1['id'],_0x48c4f1);UserVoiceQueueRtEvents['emit'](_0x2acb0e,_0x48c4f1);_0x465409(null);};}for(var e in events){if(events[_0xd845('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xd845('0x6')](e,emitEvent(event));}}module[_0xd845('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x47c3=['hook','exports','events','../../mysqldb','update','remove','emit','hasOwnProperty'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x47c3,0x7a));var _0x347c=function(_0x21a05a,_0x2d7f05){_0x21a05a=_0x21a05a-0x0;var _0x445a1d=_0x47c3[_0x21a05a];return _0x445a1d;};'use strict';var EventEmitter=require(_0x347c('0x0'));var UserVoiceQueueRt=require(_0x347c('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x347c('0x2'),'afterDestroy':_0x347c('0x3')};function emitEvent(_0x45e7c8){return function(_0x48470d,_0x49d702,_0x55b66b){UserVoiceQueueRtEvents[_0x347c('0x4')](_0x45e7c8+':'+_0x48470d['id'],_0x48470d);UserVoiceQueueRtEvents[_0x347c('0x4')](_0x45e7c8,_0x48470d);_0x55b66b(null);};}for(var e in events){if(events[_0x347c('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x347c('0x6')](e,emitEvent(event));}}module[_0x347c('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 63082e8..906d997 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 _0x3b97=['rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f0bed,_0x4911f1){var _0x31fa87=function(_0x1de2fc){while(--_0x1de2fc){_0x2f0bed['push'](_0x2f0bed['shift']());}};_0x31fa87(++_0x4911f1);}(_0x3b97,0x14b));var _0x73b9=function(_0x49b013,_0x5373a4){_0x49b013=_0x49b013-0x0;var _0x541919=_0x3b97[_0x49b013];return _0x541919;};'use strict';var _=require(_0x73b9('0x0'));var util=require(_0x73b9('0x1'));var logger=require(_0x73b9('0x2'))(_0x73b9('0x3'));var moment=require(_0x73b9('0x4'));var BPromise=require(_0x73b9('0x5'));var rp=require(_0x73b9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73b9('0x7'));var config=require('../../config/environment');var attributes=require(_0x73b9('0x8'));module[_0x73b9('0x9')]=function(_0x544ca3,_0x296704){return _0x544ca3[_0x73b9('0xa')](_0x73b9('0xb'),attributes,{'tableName':_0x73b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72cd=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','path'];(function(_0x2a9f34,_0x40186f){var _0x5587c0=function(_0x51a9a0){while(--_0x51a9a0){_0x2a9f34['push'](_0x2a9f34['shift']());}};_0x5587c0(++_0x40186f);}(_0x72cd,0x123));var _0xd72c=function(_0xb58388,_0x4958d7){_0xb58388=_0xb58388-0x0;var _0x4bf933=_0x72cd[_0xb58388];return _0x4bf933;};'use strict';var _=require(_0xd72c('0x0'));var util=require(_0xd72c('0x1'));var logger=require(_0xd72c('0x2'))(_0xd72c('0x3'));var moment=require(_0xd72c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd72c('0x5'));var rimraf=require(_0xd72c('0x6'));var config=require(_0xd72c('0x7'));var attributes=require(_0xd72c('0x8'));module['exports']=function(_0x20286f,_0x571c8b){return _0x20286f[_0xd72c('0x9')](_0xd72c('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','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 262a0b9..82cbcb1 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 _0x6f48=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','register','request','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6f48,0xad));var _0x86f4=function(_0x28d3ad,_0x3fe4f9){_0x28d3ad=_0x28d3ad-0x0;var _0x15d280=_0x6f48[_0x28d3ad];return _0x15d280;};'use strict';var _=require(_0x86f4('0x0'));var util=require('util');var moment=require(_0x86f4('0x1'));var BPromise=require(_0x86f4('0x2'));var rs=require(_0x86f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86f4('0x4'))['db'];var utils=require(_0x86f4('0x5'));var logger=require(_0x86f4('0x6'))(_0x86f4('0x7'));var config=require(_0x86f4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x86f4('0x9')]['http']({'port':0x232a});config['redis']=_[_0x86f4('0xa')](config[_0x86f4('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86f4('0xb')]));require('./userVoiceQueueRt.socket')[_0x86f4('0xc')](socket);function respondWithRpcPromise(_0x4bf9ed,_0x29ea9f,_0x471bbe){return new BPromise(function(_0x31a2e0,_0x33adc1){return client[_0x86f4('0xd')](_0x4bf9ed,_0x471bbe)['then'](function(_0x90e4bc){logger['info'](_0x86f4('0xe'),_0x29ea9f,'request\x20sent');logger[_0x86f4('0xf')](_0x86f4('0x10'),_0x29ea9f,_0x86f4('0x11'),JSON[_0x86f4('0x12')](_0x90e4bc));if(_0x90e4bc[_0x86f4('0x13')]){if(_0x90e4bc[_0x86f4('0x13')][_0x86f4('0x14')]===0x1f4){logger[_0x86f4('0x13')](_0x86f4('0xe'),_0x29ea9f,_0x90e4bc['error']['message']);return _0x33adc1(_0x90e4bc['error'][_0x86f4('0x15')]);}logger[_0x86f4('0x13')](_0x86f4('0xe'),_0x29ea9f,_0x90e4bc[_0x86f4('0x13')][_0x86f4('0x15')]);return _0x31a2e0(_0x90e4bc[_0x86f4('0x13')]['message']);}else{logger[_0x86f4('0x16')](_0x86f4('0xe'),_0x29ea9f,'request\x20sent');_0x31a2e0(_0x90e4bc['result'][_0x86f4('0x15')]);}})[_0x86f4('0x17')](function(_0x47836d){logger[_0x86f4('0x13')](_0x86f4('0xe'),_0x29ea9f,_0x47836d);_0x33adc1(_0x47836d);});});}exports[_0x86f4('0x18')]=function(_0x381e42){var _0x117d1a=this;return new Promise(function(_0xeb6a79,_0xa4b473){return db[_0x86f4('0x19')]['findAll']({'raw':_0x381e42[_0x86f4('0x1a')]?_0x381e42[_0x86f4('0x1a')][_0x86f4('0x1b')]===undefined?!![]:![]:!![],'where':_0x381e42[_0x86f4('0x1a')]?_0x381e42[_0x86f4('0x1a')][_0x86f4('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x86f4('0x1d'),db[_0x86f4('0x1e')]['fn']('IF',db[_0x86f4('0x1e')][_0x86f4('0x1f')](_0x86f4('0x20')))),_0x86f4('0x21')]]})[_0x86f4('0x22')](function(_0x5c3827){logger['info'](_0x86f4('0x18'),_0x381e42);logger[_0x86f4('0xf')](_0x86f4('0x18'),_0x381e42,JSON[_0x86f4('0x12')](_0x5c3827));_0xeb6a79(_0x5c3827);})['catch'](function(_0x500fda){logger[_0x86f4('0x13')](_0x86f4('0x18'),_0x500fda[_0x86f4('0x15')],_0x381e42);_0xa4b473(_0x117d1a[_0x86f4('0x13')](0x1f4,_0x500fda[_0x86f4('0x15')]));});});}; \ No newline at end of file +var _0x7a8f=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','stringify','GetVoiceQueueRtPauses','lodash','util'];(function(_0x14353a,_0x3467f7){var _0x1ba318=function(_0x3d01a6){while(--_0x3d01a6){_0x14353a['push'](_0x14353a['shift']());}};_0x1ba318(++_0x3467f7);}(_0x7a8f,0x67));var _0xf7a8=function(_0x1dc46b,_0x566550){_0x1dc46b=_0x1dc46b-0x0;var _0x5ce7ad=_0x7a8f[_0x1dc46b];return _0x5ce7ad;};'use strict';var _=require(_0xf7a8('0x0'));var util=require(_0xf7a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7a8('0x2'));var fs=require('fs');var Redis=require(_0xf7a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf7a8('0x4'))(_0xf7a8('0x5'));var config=require(_0xf7a8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf7a8('0x7')][_0xf7a8('0x8')]({'port':0x232a});config[_0xf7a8('0x9')]=_[_0xf7a8('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf7a8('0xb'))(new Redis(config[_0xf7a8('0x9')]));require(_0xf7a8('0xc'))[_0xf7a8('0xd')](socket);function respondWithRpcPromise(_0x2d19a0,_0xe616c6,_0x209fa9){return new BPromise(function(_0x4dff10,_0x2fd405){return client[_0xf7a8('0xe')](_0x2d19a0,_0x209fa9)[_0xf7a8('0xf')](function(_0x300f4e){logger[_0xf7a8('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xe616c6,_0xf7a8('0x11'));logger[_0xf7a8('0x12')](_0xf7a8('0x13'),_0xe616c6,'request\x20sent',JSON['stringify'](_0x300f4e));if(_0x300f4e['error']){if(_0x300f4e[_0xf7a8('0x14')][_0xf7a8('0x15')]===0x1f4){logger[_0xf7a8('0x14')](_0xf7a8('0x16'),_0xe616c6,_0x300f4e[_0xf7a8('0x14')][_0xf7a8('0x17')]);return _0x2fd405(_0x300f4e[_0xf7a8('0x14')][_0xf7a8('0x17')]);}logger['error'](_0xf7a8('0x16'),_0xe616c6,_0x300f4e['error'][_0xf7a8('0x17')]);return _0x4dff10(_0x300f4e[_0xf7a8('0x14')][_0xf7a8('0x17')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0xe616c6,_0xf7a8('0x11'));_0x4dff10(_0x300f4e[_0xf7a8('0x18')][_0xf7a8('0x17')]);}})[_0xf7a8('0x19')](function(_0x384fde){logger[_0xf7a8('0x14')](_0xf7a8('0x16'),_0xe616c6,_0x384fde);_0x2fd405(_0x384fde);});});}exports['GetVoiceQueueRtPauses']=function(_0x106661){var _0x64bc4b=this;return new Promise(function(_0x2f8f2b,_0x58cacf){return db['UserVoiceQueueRt'][_0xf7a8('0x1a')]({'raw':_0x106661[_0xf7a8('0x1b')]?_0x106661[_0xf7a8('0x1b')][_0xf7a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x106661['options']?_0x106661[_0xf7a8('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xf7a8('0x1d'),db[_0xf7a8('0x1e')]['fn']('IF',db[_0xf7a8('0x1e')][_0xf7a8('0x1f')](_0xf7a8('0x20')))),'outboundQueuePauses']]})[_0xf7a8('0xf')](function(_0x459d5f){logger[_0xf7a8('0x10')]('GetVoiceQueueRtPauses',_0x106661);logger[_0xf7a8('0x12')]('GetVoiceQueueRtPauses',_0x106661,JSON[_0xf7a8('0x21')](_0x459d5f));_0x2f8f2b(_0x459d5f);})[_0xf7a8('0x19')](function(_0x3ccdf2){logger[_0xf7a8('0x14')](_0xf7a8('0x22'),_0x3ccdf2['message'],_0x106661);_0x58cacf(_0x64bc4b[_0xf7a8('0x14')](0x1f4,_0x3ccdf2['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 0e61d18..748e7df 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 _0xd0c9=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','emit','length'];(function(_0xf67e36,_0x4e5d47){var _0x2df5aa=function(_0x9a10f7){while(--_0x9a10f7){_0xf67e36['push'](_0xf67e36['shift']());}};_0x2df5aa(++_0x4e5d47);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xd0c9[_0x29d915];return _0x160f86;};'use strict';var UserVoiceQueueRtEvents=require(_0x9d0c('0x0'));var events=[_0x9d0c('0x1'),'remove','update'];function createListener(_0x5d3eb1,_0x154c38){return function(_0x2eff0e){_0x154c38[_0x9d0c('0x2')](_0x5d3eb1,_0x2eff0e);};}function removeListener(_0x5922f1,_0x3b4b50){return function(){UserVoiceQueueRtEvents['removeListener'](_0x5922f1,_0x3b4b50);};}exports['register']=function(_0x6749){for(var _0x5bcaf9=0x0,_0x3eec5f=events[_0x9d0c('0x3')];_0x5bcaf9<_0x3eec5f;_0x5bcaf9++){var _0x308d9e=events[_0x5bcaf9];var _0x413a70=createListener(_0x9d0c('0x4')+_0x308d9e,_0x6749);UserVoiceQueueRtEvents['on'](_0x308d9e,_0x413a70);}}; \ No newline at end of file +var _0x812d=['update','emit','removeListener','register','length','userVoiceQueueRt:','save','remove'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x812d,0x6e));var _0xd812=function(_0x3b543c,_0x3c618c){_0x3b543c=_0x3b543c-0x0;var _0x1d5243=_0x812d[_0x3b543c];return _0x1d5243;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xd812('0x0'),_0xd812('0x1'),_0xd812('0x2')];function createListener(_0x200a29,_0x510c9d){return function(_0x263692){_0x510c9d[_0xd812('0x3')](_0x200a29,_0x263692);};}function removeListener(_0x2fba72,_0x47efde){return function(){UserVoiceQueueRtEvents[_0xd812('0x4')](_0x2fba72,_0x47efde);};}exports[_0xd812('0x5')]=function(_0x3aa86b){for(var _0x4c946f=0x0,_0x4ce265=events[_0xd812('0x6')];_0x4c946f<_0x4ce265;_0x4c946f++){var _0x41ed78=events[_0x4c946f];var _0x56a715=createListener(_0xd812('0x7')+_0x41ed78,_0x3aa86b);UserVoiceQueueRtEvents['on'](_0x41ed78,_0x56a715);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 34d6149..d52d17e 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x488e3d,_0x4f7e2a){var _0x3ee2b2=function(_0x5b6b37){while(--_0x5b6b37){_0x488e3d['push'](_0x488e3d['shift']());}};_0x3ee2b2(++_0x4f7e2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3d8dd8,_0x4dee79){var _0x1955ad=function(_0x3e493b){while(--_0x3e493b){_0x3d8dd8['push'](_0x3d8dd8['shift']());}};_0x1955ad(++_0x4dee79);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index bd14ac8..4a23ec4 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 _0x991e=['INTEGER'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x991e,0x6f));var _0xe991=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x991e[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xe991('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70f2=['exports'];(function(_0x3c4f91,_0x2376ae){var _0x2a8ff9=function(_0x39ab23){while(--_0x39ab23){_0x3c4f91['push'](_0x3c4f91['shift']());}};_0x2a8ff9(++_0x2376ae);}(_0x70f2,0xb1));var _0x270f=function(_0x3705b4,_0x2303b0){_0x3705b4=_0x3705b4-0x0;var _0x12b39c=_0x70f2[_0x3705b4];return _0x12b39c;};'use strict';var Sequelize=require('sequelize');module[_0x270f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 58bd680..2e1768a 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 _0x3b1d=['./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','api','request-promise','path','rimraf','../../config/environment'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x3b1d,0x1e9));var _0xd3b1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x3b1d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd3b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd3b1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3b1('0x2'));var fs=require('fs');var path=require(_0xd3b1('0x3'));var rimraf=require(_0xd3b1('0x4'));var config=require(_0xd3b1('0x5'));var attributes=require(_0xd3b1('0x6'));module[_0xd3b1('0x7')]=function(_0x300b1c,_0x5eadfd){return _0x300b1c[_0xd3b1('0x8')](_0xd3b1('0x9'),attributes,{'tableName':_0xd3b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1b8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xa1b8,0x15d));var _0x8a1b=function(_0x5b684b,_0x552cff){_0x5b684b=_0x5b684b-0x0;var _0x4add44=_0xa1b8[_0x5b684b];return _0x4add44;};'use strict';var _=require(_0x8a1b('0x0'));var util=require(_0x8a1b('0x1'));var logger=require(_0x8a1b('0x2'))(_0x8a1b('0x3'));var moment=require(_0x8a1b('0x4'));var BPromise=require(_0x8a1b('0x5'));var rp=require(_0x8a1b('0x6'));var fs=require('fs');var path=require(_0x8a1b('0x7'));var rimraf=require(_0x8a1b('0x8'));var config=require(_0x8a1b('0x9'));var attributes=require(_0x8a1b('0xa'));module[_0x8a1b('0xb')]=function(_0x1ea717,_0x4c3324){return _0x1ea717[_0x8a1b('0xc')](_0x8a1b('0xd'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 120f314..0467d7b 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 _0x2fad=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0x2fad,0x1e2));var _0xd2fa=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x2fad[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0xd2fa('0x0'));var util=require('util');var moment=require(_0xd2fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2fa('0x2'));var fs=require('fs');var Redis=require(_0xd2fa('0x3'));var db=require(_0xd2fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2fa('0x5'))(_0xd2fa('0x6'));var config=require('../../config/environment');var jayson=require(_0xd2fa('0x7'));var client=jayson['client'][_0xd2fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a1007,_0x3d4709,_0x27ae60){return new BPromise(function(_0x418aa3,_0x38e3e7){return client[_0xd2fa('0x9')](_0x1a1007,_0x27ae60)[_0xd2fa('0xa')](function(_0x2e69e9){logger['info'](_0xd2fa('0xb'),_0x3d4709,'request\x20sent');logger[_0xd2fa('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3d4709,_0xd2fa('0xd'),JSON[_0xd2fa('0xe')](_0x2e69e9));if(_0x2e69e9[_0xd2fa('0xf')]){if(_0x2e69e9['error']['code']===0x1f4){logger[_0xd2fa('0xf')](_0xd2fa('0xb'),_0x3d4709,_0x2e69e9[_0xd2fa('0xf')][_0xd2fa('0x10')]);return _0x38e3e7(_0x2e69e9[_0xd2fa('0xf')][_0xd2fa('0x10')]);}logger['error'](_0xd2fa('0xb'),_0x3d4709,_0x2e69e9[_0xd2fa('0xf')][_0xd2fa('0x10')]);return _0x418aa3(_0x2e69e9[_0xd2fa('0xf')][_0xd2fa('0x10')]);}else{logger[_0xd2fa('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3d4709,'request\x20sent');_0x418aa3(_0x2e69e9[_0xd2fa('0x12')][_0xd2fa('0x10')]);}})[_0xd2fa('0x13')](function(_0x37955e){logger[_0xd2fa('0xf')](_0xd2fa('0xb'),_0x3d4709,_0x37955e);_0x38e3e7(_0x37955e);});});} \ No newline at end of file +var _0x9f5d=['then','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x9f5d,0x1e8));var _0xd9f5=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9f5d[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xd9f5('0x0'));var util=require(_0xd9f5('0x1'));var moment=require(_0xd9f5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9f5('0x3'));var db=require(_0xd9f5('0x4'))['db'];var utils=require(_0xd9f5('0x5'));var logger=require(_0xd9f5('0x6'))(_0xd9f5('0x7'));var config=require(_0xd9f5('0x8'));var jayson=require(_0xd9f5('0x9'));var client=jayson[_0xd9f5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4097ca,_0x10ebdf,_0x293b29){return new BPromise(function(_0x28e950,_0x43a811){return client[_0xd9f5('0xb')](_0x4097ca,_0x293b29)[_0xd9f5('0xc')](function(_0x1b8661){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x10ebdf,_0xd9f5('0xd'));logger['debug'](_0xd9f5('0xe'),_0x10ebdf,_0xd9f5('0xd'),JSON['stringify'](_0x1b8661));if(_0x1b8661[_0xd9f5('0xf')]){if(_0x1b8661[_0xd9f5('0xf')]['code']===0x1f4){logger[_0xd9f5('0xf')](_0xd9f5('0x10'),_0x10ebdf,_0x1b8661[_0xd9f5('0xf')][_0xd9f5('0x11')]);return _0x43a811(_0x1b8661[_0xd9f5('0xf')][_0xd9f5('0x11')]);}logger[_0xd9f5('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x10ebdf,_0x1b8661[_0xd9f5('0xf')][_0xd9f5('0x11')]);return _0x28e950(_0x1b8661['error'][_0xd9f5('0x11')]);}else{logger['info'](_0xd9f5('0x10'),_0x10ebdf,_0xd9f5('0xd'));_0x28e950(_0x1b8661[_0xd9f5('0x12')][_0xd9f5('0x11')]);}})[_0xd9f5('0x13')](function(_0x323e67){logger[_0xd9f5('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x10ebdf,_0x323e67);_0x43a811(_0x323e67);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e930c0c..4c89a25 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 _0xb0d9=['express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x5a937f,_0x3d3a6e){_0x5a937f=_0x5a937f-0x0;var _0xc1dcc8=_0xb0d9[_0x5a937f];return _0xc1dcc8;};'use strict';var multer=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var path=require(_0x9b0d('0x2'));var timeout=require(_0x9b0d('0x3'));var express=require(_0x9b0d('0x4'));var router=express[_0x9b0d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b0d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x9b0d('0x7')]('/',auth[_0x9b0d('0x8')](),controller[_0x9b0d('0x9')]);router[_0x9b0d('0x7')](_0x9b0d('0xa'),auth[_0x9b0d('0x8')](),controller[_0x9b0d('0xb')]);router[_0x9b0d('0xc')]('/',auth[_0x9b0d('0x8')](),controller['create']);router['put'](_0x9b0d('0xa'),auth[_0x9b0d('0x8')](),controller['update']);router[_0x9b0d('0xd')](_0x9b0d('0xa'),auth['isAuthenticated'](),controller[_0x9b0d('0xe')]);module[_0x9b0d('0xf')]=router; \ No newline at end of file +var _0xe06f=['../../config/environment','./variable.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0xe06f,0x65));var _0xfe06=function(_0x4245b3,_0x43dfe3){_0x4245b3=_0x4245b3-0x0;var _0x465ba6=_0xe06f[_0x4245b3];return _0x465ba6;};'use strict';var multer=require(_0xfe06('0x0'));var util=require(_0xfe06('0x1'));var path=require('path');var timeout=require(_0xfe06('0x2'));var express=require('express');var router=express[_0xfe06('0x3')]();var fs_extra=require(_0xfe06('0x4'));var auth=require(_0xfe06('0x5'));var interaction=require(_0xfe06('0x6'));var config=require(_0xfe06('0x7'));var controller=require(_0xfe06('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfe06('0x9')](_0xfe06('0xa'),auth[_0xfe06('0xb')](),controller[_0xfe06('0xc')]);router[_0xfe06('0xd')]('/',auth[_0xfe06('0xb')](),controller['create']);router[_0xfe06('0xe')](_0xfe06('0xa'),auth[_0xfe06('0xb')](),controller[_0xfe06('0xf')]);router['delete'](_0xfe06('0xa'),auth[_0xfe06('0xb')](),controller[_0xfe06('0x10')]);module[_0xfe06('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 606e283..425fc1c 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 _0x56c0=['name','sequelize','exports','STRING'];(function(_0x3aa96a,_0x2aa5c3){var _0x1d0edd=function(_0x4d3f5e){while(--_0x4d3f5e){_0x3aa96a['push'](_0x3aa96a['shift']());}};_0x1d0edd(++_0x2aa5c3);}(_0x56c0,0x14d));var _0x056c=function(_0x14d522,_0x44c77f){_0x14d522=_0x14d522-0x0;var _0x48d9c6=_0x56c0[_0x14d522];return _0x48d9c6;};'use strict';var Sequelize=require(_0x056c('0x0'));module[_0x056c('0x1')]={'name':{'type':Sequelize[_0x056c('0x2')],'unique':_0x056c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x441d=['exports','name','STRING','sequelize'];(function(_0x226605,_0x577884){var _0x5c1839=function(_0x386bb1){while(--_0x386bb1){_0x226605['push'](_0x226605['shift']());}};_0x5c1839(++_0x577884);}(_0x441d,0x13f));var _0xd441=function(_0x4bc6a5,_0x4c9d40){_0x4bc6a5=_0x4bc6a5-0x0;var _0x9b913c=_0x441d[_0x4bc6a5];return _0x9b913c;};'use strict';var Sequelize=require(_0xd441('0x0'));module[_0xd441('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd441('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd441('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7f4c260..f563b04 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 _0xa925=['path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','update','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x29b438,_0x3fb6d9){var _0x43fd69=function(_0xe0191){while(--_0xe0191){_0x29b438['push'](_0x29b438['shift']());}};_0x43fd69(++_0x3fb6d9);}(_0xa925,0x97));var _0x5a92=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa925[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5a92('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a92('0x1'));var moment=require(_0x5a92('0x2'));var BPromise=require(_0x5a92('0x3'));var Mustache=require(_0x5a92('0x4'));var util=require('util');var path=require(_0x5a92('0x5'));var sox=require(_0x5a92('0x6'));var csv=require(_0x5a92('0x7'));var ejs=require(_0x5a92('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a92('0x9'));var squel=require(_0x5a92('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a92('0xb'));var toCsv=require(_0x5a92('0x7'));var querystring=require(_0x5a92('0xc'));var Papa=require(_0x5a92('0xd'));var Redis=require(_0x5a92('0xe'));var authService=require(_0x5a92('0xf'));var qs=require(_0x5a92('0x10'));var as=require(_0x5a92('0x11'));var hardwareService=require(_0x5a92('0x12'));var logger=require(_0x5a92('0x13'))(_0x5a92('0x14'));var utils=require(_0x5a92('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d3e59,_0x5efd25){_0x5efd25=_0x5efd25||0xcc;return function(_0x1bcf36){if(_0x1bcf36){return _0x2d3e59[_0x5a92('0x16')](_0x5efd25);}return _0x2d3e59[_0x5a92('0x17')](_0x5efd25)[_0x5a92('0x18')]();};}function respondWithResult(_0x4eeec4,_0x20382d){_0x20382d=_0x20382d||0xc8;return function(_0x6bf615){if(_0x6bf615){return _0x4eeec4[_0x5a92('0x17')](_0x20382d)[_0x5a92('0x19')](_0x6bf615);}};}function respondWithFilteredResult(_0x15bbd0,_0x21566f){return function(_0x58adb9){if(_0x58adb9){var _0x197b91=typeof _0x21566f[_0x5a92('0x1a')]===_0x5a92('0x1b')&&typeof _0x21566f[_0x5a92('0x1c')]===_0x5a92('0x1b');var _0x3ea16a=_0x58adb9[_0x5a92('0x1d')];var _0x161236=_0x197b91?0x0:_0x21566f[_0x5a92('0x1a')];var _0x6d17ce=_0x197b91?_0x58adb9[_0x5a92('0x1d')]:_0x21566f[_0x5a92('0x1a')]+_0x21566f[_0x5a92('0x1c')];var _0x20b237;if(_0x6d17ce>=_0x3ea16a){_0x6d17ce=_0x3ea16a;_0x20b237=0xc8;}else{_0x20b237=0xce;}_0x15bbd0[_0x5a92('0x17')](_0x20b237);return _0x15bbd0['set'](_0x5a92('0x1e'),_0x161236+'-'+_0x6d17ce+'/'+_0x3ea16a)[_0x5a92('0x19')](_0x58adb9);}return null;};}function patchUpdates(_0x1f1794){return function(_0x4f91f5){try{jsonpatch[_0x5a92('0x1f')](_0x4f91f5,_0x1f1794,!![]);}catch(_0x1489d6){return BPromise['reject'](_0x1489d6);}return _0x4f91f5[_0x5a92('0x20')]();};}function saveUpdates(_0x228978,_0x3eec8e){return function(_0x3abf0c){if(_0x3abf0c){return _0x3abf0c['update'](_0x228978)[_0x5a92('0x21')](function(_0x17fab8){return _0x17fab8;});}return null;};}function removeEntity(_0x123837,_0x135d41){return function(_0x3c7d05){if(_0x3c7d05){return _0x3c7d05[_0x5a92('0x22')]()[_0x5a92('0x21')](function(){var _0xdde57f=_0x3c7d05[_0x5a92('0x23')]({'plain':!![]});var _0x2e6aff=_0x5a92('0x24');return db[_0x5a92('0x25')][_0x5a92('0x22')]({'where':{'type':_0x2e6aff,'resourceId':_0xdde57f['id']}})[_0x5a92('0x21')](function(){return _0x3c7d05;});})[_0x5a92('0x21')](function(){_0x123837[_0x5a92('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf79cbb,_0x1f357f){return function(_0x1f6e9a){if(!_0x1f6e9a){_0xf79cbb[_0x5a92('0x16')](0x194);}return _0x1f6e9a;};}function handleError(_0x2825f8,_0x27213e){_0x27213e=_0x27213e||0x1f4;return function(_0x336119){logger[_0x5a92('0x26')](_0x336119[_0x5a92('0x27')]);if(_0x336119['name']){delete _0x336119[_0x5a92('0x28')];}_0x2825f8[_0x5a92('0x17')](_0x27213e)[_0x5a92('0x29')](_0x336119);};}exports[_0x5a92('0x2a')]=function(_0x3c8c02,_0x48156e){var _0x18a1d2={},_0x30172a={},_0x507845={'count':0x0,'rows':[]};var _0x4fd03c=_[_0x5a92('0x2b')](db[_0x5a92('0x2c')][_0x5a92('0x2d')],function(_0x378c30){return{'name':_0x378c30[_0x5a92('0x2e')],'type':_0x378c30[_0x5a92('0x2f')]['key']};});_0x30172a[_0x5a92('0x30')]=_['map'](_0x4fd03c,_0x5a92('0x28'));_0x30172a[_0x5a92('0x31')]=_[_0x5a92('0x32')](_0x3c8c02[_0x5a92('0x31')]);_0x30172a[_0x5a92('0x33')]=_[_0x5a92('0x34')](_0x30172a[_0x5a92('0x30')],_0x30172a[_0x5a92('0x31')]);_0x18a1d2['attributes']=_[_0x5a92('0x34')](_0x30172a[_0x5a92('0x30')],qs[_0x5a92('0x35')](_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x35')]));_0x18a1d2[_0x5a92('0x36')]=_0x18a1d2[_0x5a92('0x36')][_0x5a92('0x37')]?_0x18a1d2[_0x5a92('0x36')]:_0x30172a[_0x5a92('0x30')];if(!_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x38')](_0x5a92('0x39'))){_0x18a1d2[_0x5a92('0x1c')]=qs['limit'](_0x3c8c02[_0x5a92('0x31')]['limit']);_0x18a1d2[_0x5a92('0x1a')]=qs['offset'](_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x1a')]);}_0x18a1d2['order']=qs[_0x5a92('0x3a')](_0x3c8c02[_0x5a92('0x31')]['sort']);_0x18a1d2[_0x5a92('0x3b')]=qs[_0x5a92('0x33')](_['pick'](_0x3c8c02[_0x5a92('0x31')],_0x30172a['filters']),_0x4fd03c);if(_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x3c')]){_0x18a1d2[_0x5a92('0x3b')]=_[_0x5a92('0x3d')](_0x18a1d2[_0x5a92('0x3b')],{'$or':_[_0x5a92('0x2b')](_0x4fd03c,function(_0x56a541){if(_0x56a541[_0x5a92('0x2f')]!==_0x5a92('0x3e')){var _0x2261ba={};_0x2261ba[_0x56a541[_0x5a92('0x28')]]={'$like':'%'+_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x3c')]+'%'};return _0x2261ba;}})});}_0x18a1d2=_[_0x5a92('0x3d')]({},_0x18a1d2,_0x3c8c02[_0x5a92('0x3f')]);var _0x38d351={'where':_0x18a1d2[_0x5a92('0x3b')]};return db['Variable'][_0x5a92('0x1d')](_0x38d351)['then'](function(_0xe4e6ab){_0x507845[_0x5a92('0x1d')]=_0xe4e6ab;if(_0x3c8c02[_0x5a92('0x31')][_0x5a92('0x40')]){_0x18a1d2['include']=[{'all':!![]}];}return db[_0x5a92('0x2c')][_0x5a92('0x41')](_0x18a1d2);})[_0x5a92('0x21')](function(_0xbd5631){_0x507845[_0x5a92('0x42')]=_0xbd5631;return _0x507845;})[_0x5a92('0x21')](respondWithFilteredResult(_0x48156e,_0x18a1d2))[_0x5a92('0x43')](handleError(_0x48156e,null));};exports[_0x5a92('0x44')]=function(_0x4cd6e4,_0x36392a){var _0x5d57d4={'raw':!![],'where':{'id':_0x4cd6e4[_0x5a92('0x45')]['id']}},_0x36176f={};_0x36176f[_0x5a92('0x30')]=_[_0x5a92('0x32')](db[_0x5a92('0x2c')][_0x5a92('0x2d')]);_0x36176f['query']=_['keys'](_0x4cd6e4[_0x5a92('0x31')]);_0x36176f[_0x5a92('0x33')]=_[_0x5a92('0x34')](_0x36176f[_0x5a92('0x30')],_0x36176f[_0x5a92('0x31')]);_0x5d57d4[_0x5a92('0x36')]=_[_0x5a92('0x34')](_0x36176f[_0x5a92('0x30')],qs['fields'](_0x4cd6e4[_0x5a92('0x31')]['fields']));_0x5d57d4[_0x5a92('0x36')]=_0x5d57d4['attributes'][_0x5a92('0x37')]?_0x5d57d4[_0x5a92('0x36')]:_0x36176f[_0x5a92('0x30')];if(_0x4cd6e4[_0x5a92('0x31')]['includeAll']){_0x5d57d4[_0x5a92('0x46')]=[{'all':!![]}];}_0x5d57d4=_[_0x5a92('0x3d')]({},_0x5d57d4,_0x4cd6e4[_0x5a92('0x3f')]);return db[_0x5a92('0x2c')][_0x5a92('0x47')](_0x5d57d4)['then'](handleEntityNotFound(_0x36392a,null))[_0x5a92('0x21')](respondWithResult(_0x36392a,null))['catch'](handleError(_0x36392a,null));};exports[_0x5a92('0x48')]=function(_0x3969fd,_0x9e504b){return db[_0x5a92('0x2c')]['create'](_0x3969fd[_0x5a92('0x49')],{})[_0x5a92('0x21')](function(_0x10d6e5){var _0x29edc8=_0x3969fd[_0x5a92('0x4a')]['get']({'plain':!![]});if(!_0x29edc8)throw new Error(_0x5a92('0x4b'));if(_0x29edc8['role']==='user'){var _0x4e042e=_0x10d6e5['get']({'plain':!![]});var _0x3c6cf7=_0x5a92('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x3c6cf7,'userProfileId':_0x29edc8['userProfileId']},'raw':!![]})['then'](function(_0x4323e7){if(_0x4323e7&&_0x4323e7[_0x5a92('0x4c')]===0x0){return db['UserProfileResource'][_0x5a92('0x48')]({'name':_0x4e042e['name'],'resourceId':_0x4e042e['id'],'type':_0x4323e7['name'],'sectionId':_0x4323e7['id']},{})[_0x5a92('0x21')](function(){return _0x10d6e5;});}else{return _0x10d6e5;}})[_0x5a92('0x43')](function(_0x37425b){logger[_0x5a92('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37425b);throw _0x37425b;});}return _0x10d6e5;})['then'](respondWithResult(_0x9e504b,0xc9))[_0x5a92('0x43')](handleError(_0x9e504b,null));};exports[_0x5a92('0x4d')]=function(_0x2a17dd,_0x4c4dfe){if(_0x2a17dd[_0x5a92('0x49')]['id']){delete _0x2a17dd['body']['id'];}return db[_0x5a92('0x2c')][_0x5a92('0x47')]({'where':{'id':_0x2a17dd[_0x5a92('0x45')]['id']}})[_0x5a92('0x21')](handleEntityNotFound(_0x4c4dfe,null))[_0x5a92('0x21')](saveUpdates(_0x2a17dd[_0x5a92('0x49')],null))[_0x5a92('0x21')](respondWithResult(_0x4c4dfe,null))[_0x5a92('0x43')](handleError(_0x4c4dfe,null));};exports[_0x5a92('0x22')]=function(_0x39f78f,_0x4ec3d1){return db['Variable'][_0x5a92('0x47')]({'where':{'id':_0x39f78f[_0x5a92('0x45')]['id']}})[_0x5a92('0x21')](handleEntityNotFound(_0x4ec3d1,null))[_0x5a92('0x21')](removeEntity(_0x4ec3d1,null))[_0x5a92('0x43')](handleError(_0x4ec3d1,null));}; \ No newline at end of file +var _0x48ca=['reject','save','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','error','name','send','index','Variable','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','count','limit','set','Content-Range','apply'];(function(_0x43f03d,_0x8ee2f5){var _0x55b131=function(_0x3ad594){while(--_0x3ad594){_0x43f03d['push'](_0x43f03d['shift']());}};_0x55b131(++_0x8ee2f5);}(_0x48ca,0x83));var _0xa48c=function(_0x28b31b,_0xe233ae){_0x28b31b=_0x28b31b-0x0;var _0x38911d=_0x48ca[_0x28b31b];return _0x38911d;};'use strict';var emlformat=require(_0xa48c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa48c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa48c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa48c('0x3'));var util=require(_0xa48c('0x4'));var path=require(_0xa48c('0x5'));var sox=require(_0xa48c('0x6'));var csv=require(_0xa48c('0x7'));var ejs=require(_0xa48c('0x8'));var fs=require('fs');var fs_extra=require(_0xa48c('0x9'));var _=require(_0xa48c('0xa'));var squel=require(_0xa48c('0xb'));var crypto=require(_0xa48c('0xc'));var jsforce=require(_0xa48c('0xd'));var deskjs=require(_0xa48c('0xe'));var toCsv=require(_0xa48c('0x7'));var querystring=require(_0xa48c('0xf'));var Papa=require(_0xa48c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa48c('0x11'));var as=require(_0xa48c('0x12'));var hardwareService=require(_0xa48c('0x13'));var logger=require(_0xa48c('0x14'))(_0xa48c('0x15'));var utils=require(_0xa48c('0x16'));var config=require(_0xa48c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa48c('0x18'))['db'];function respondWithStatusCode(_0x4687f2,_0x285167){_0x285167=_0x285167||0xcc;return function(_0x455a5e){if(_0x455a5e){return _0x4687f2['sendStatus'](_0x285167);}return _0x4687f2[_0xa48c('0x19')](_0x285167)['end']();};}function respondWithResult(_0x127219,_0x8953f5){_0x8953f5=_0x8953f5||0xc8;return function(_0x1d4568){if(_0x1d4568){return _0x127219['status'](_0x8953f5)[_0xa48c('0x1a')](_0x1d4568);}};}function respondWithFilteredResult(_0x589379,_0x1d5157){return function(_0x4986d0){if(_0x4986d0){var _0x3f974b=typeof _0x1d5157[_0xa48c('0x1b')]==='undefined'&&typeof _0x1d5157['limit']==='undefined';var _0x274cdc=_0x4986d0['count'];var _0x4bde38=_0x3f974b?0x0:_0x1d5157[_0xa48c('0x1b')];var _0x254e87=_0x3f974b?_0x4986d0[_0xa48c('0x1c')]:_0x1d5157[_0xa48c('0x1b')]+_0x1d5157[_0xa48c('0x1d')];var _0x47f527;if(_0x254e87>=_0x274cdc){_0x254e87=_0x274cdc;_0x47f527=0xc8;}else{_0x47f527=0xce;}_0x589379[_0xa48c('0x19')](_0x47f527);return _0x589379[_0xa48c('0x1e')](_0xa48c('0x1f'),_0x4bde38+'-'+_0x254e87+'/'+_0x274cdc)['json'](_0x4986d0);}return null;};}function patchUpdates(_0x57f68c){return function(_0x58d193){try{jsonpatch[_0xa48c('0x20')](_0x58d193,_0x57f68c,!![]);}catch(_0x51856a){return BPromise[_0xa48c('0x21')](_0x51856a);}return _0x58d193[_0xa48c('0x22')]();};}function saveUpdates(_0x35c4d5,_0x9bb6c){return function(_0x4604c3){if(_0x4604c3){return _0x4604c3[_0xa48c('0x23')](_0x35c4d5)[_0xa48c('0x24')](function(_0xe6593c){return _0xe6593c;});}return null;};}function removeEntity(_0x24b765,_0x272f0e){return function(_0x2fe059){if(_0x2fe059){return _0x2fe059[_0xa48c('0x25')]()['then'](function(){var _0x465ed4=_0x2fe059[_0xa48c('0x26')]({'plain':!![]});var _0x2528c5=_0xa48c('0x27');return db[_0xa48c('0x28')]['destroy']({'where':{'type':_0x2528c5,'resourceId':_0x465ed4['id']}})[_0xa48c('0x24')](function(){return _0x2fe059;});})[_0xa48c('0x24')](function(){_0x24b765[_0xa48c('0x19')](0xcc)[_0xa48c('0x29')]();});}};}function handleEntityNotFound(_0x259304,_0xe367bc){return function(_0x59e6cc){if(!_0x59e6cc){_0x259304[_0xa48c('0x2a')](0x194);}return _0x59e6cc;};}function handleError(_0xf24663,_0x18a0ba){_0x18a0ba=_0x18a0ba||0x1f4;return function(_0x20c7db){logger[_0xa48c('0x2b')](_0x20c7db['stack']);if(_0x20c7db[_0xa48c('0x2c')]){delete _0x20c7db['name'];}_0xf24663[_0xa48c('0x19')](_0x18a0ba)[_0xa48c('0x2d')](_0x20c7db);};}exports[_0xa48c('0x2e')]=function(_0x35f1bf,_0x31c89f){var _0x214525={},_0x17dbaa={},_0x387883={'count':0x0,'rows':[]};var _0x1f36f2=_['map'](db[_0xa48c('0x2f')]['rawAttributes'],function(_0x2c14d2){return{'name':_0x2c14d2[_0xa48c('0x30')],'type':_0x2c14d2['type']['key']};});_0x17dbaa[_0xa48c('0x31')]=_['map'](_0x1f36f2,_0xa48c('0x2c'));_0x17dbaa[_0xa48c('0x32')]=_['keys'](_0x35f1bf['query']);_0x17dbaa[_0xa48c('0x33')]=_[_0xa48c('0x34')](_0x17dbaa[_0xa48c('0x31')],_0x17dbaa[_0xa48c('0x32')]);_0x214525[_0xa48c('0x35')]=_[_0xa48c('0x34')](_0x17dbaa[_0xa48c('0x31')],qs['fields'](_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x36')]));_0x214525[_0xa48c('0x35')]=_0x214525[_0xa48c('0x35')][_0xa48c('0x37')]?_0x214525[_0xa48c('0x35')]:_0x17dbaa[_0xa48c('0x31')];if(!_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x38')](_0xa48c('0x39'))){_0x214525['limit']=qs[_0xa48c('0x1d')](_0x35f1bf['query'][_0xa48c('0x1d')]);_0x214525[_0xa48c('0x1b')]=qs[_0xa48c('0x1b')](_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x1b')]);}_0x214525['order']=qs['sort'](_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x3a')]);_0x214525[_0xa48c('0x3b')]=qs[_0xa48c('0x33')](_[_0xa48c('0x3c')](_0x35f1bf[_0xa48c('0x32')],_0x17dbaa[_0xa48c('0x33')]),_0x1f36f2);if(_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x3d')]){_0x214525[_0xa48c('0x3b')]=_['merge'](_0x214525['where'],{'$or':_[_0xa48c('0x3e')](_0x1f36f2,function(_0x135896){if(_0x135896[_0xa48c('0x3f')]!=='VIRTUAL'){var _0x1064e5={};_0x1064e5[_0x135896[_0xa48c('0x2c')]]={'$like':'%'+_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x3d')]+'%'};return _0x1064e5;}})});}_0x214525=_['merge']({},_0x214525,_0x35f1bf[_0xa48c('0x40')]);var _0x5045e6={'where':_0x214525['where']};return db[_0xa48c('0x2f')]['count'](_0x5045e6)['then'](function(_0x302581){_0x387883[_0xa48c('0x1c')]=_0x302581;if(_0x35f1bf[_0xa48c('0x32')][_0xa48c('0x41')]){_0x214525[_0xa48c('0x42')]=[{'all':!![]}];}return db[_0xa48c('0x2f')][_0xa48c('0x43')](_0x214525);})[_0xa48c('0x24')](function(_0x69c034){_0x387883[_0xa48c('0x44')]=_0x69c034;return _0x387883;})['then'](respondWithFilteredResult(_0x31c89f,_0x214525))[_0xa48c('0x45')](handleError(_0x31c89f,null));};exports['show']=function(_0x2fe86f,_0x46c8e7){var _0x2e52b0={'raw':!![],'where':{'id':_0x2fe86f[_0xa48c('0x46')]['id']}},_0x532fd8={};_0x532fd8[_0xa48c('0x31')]=_[_0xa48c('0x47')](db[_0xa48c('0x2f')][_0xa48c('0x48')]);_0x532fd8[_0xa48c('0x32')]=_[_0xa48c('0x47')](_0x2fe86f[_0xa48c('0x32')]);_0x532fd8['filters']=_['intersection'](_0x532fd8[_0xa48c('0x31')],_0x532fd8[_0xa48c('0x32')]);_0x2e52b0['attributes']=_[_0xa48c('0x34')](_0x532fd8[_0xa48c('0x31')],qs[_0xa48c('0x36')](_0x2fe86f[_0xa48c('0x32')][_0xa48c('0x36')]));_0x2e52b0[_0xa48c('0x35')]=_0x2e52b0[_0xa48c('0x35')][_0xa48c('0x37')]?_0x2e52b0[_0xa48c('0x35')]:_0x532fd8['model'];if(_0x2fe86f[_0xa48c('0x32')]['includeAll']){_0x2e52b0[_0xa48c('0x42')]=[{'all':!![]}];}_0x2e52b0=_['merge']({},_0x2e52b0,_0x2fe86f[_0xa48c('0x40')]);return db['Variable'][_0xa48c('0x49')](_0x2e52b0)[_0xa48c('0x24')](handleEntityNotFound(_0x46c8e7,null))[_0xa48c('0x24')](respondWithResult(_0x46c8e7,null))[_0xa48c('0x45')](handleError(_0x46c8e7,null));};exports['create']=function(_0x4ccbe2,_0x286add){return db['Variable'][_0xa48c('0x4a')](_0x4ccbe2['body'],{})[_0xa48c('0x24')](function(_0x566a6b){var _0x108d24=_0x4ccbe2[_0xa48c('0x4b')][_0xa48c('0x26')]({'plain':!![]});if(!_0x108d24)throw new Error(_0xa48c('0x4c'));if(_0x108d24[_0xa48c('0x4d')]===_0xa48c('0x4b')){var _0x33f4c7=_0x566a6b['get']({'plain':!![]});var _0xa74eaf=_0xa48c('0x27');return db[_0xa48c('0x4e')][_0xa48c('0x49')]({'where':{'name':_0xa74eaf,'userProfileId':_0x108d24[_0xa48c('0x4f')]},'raw':!![]})[_0xa48c('0x24')](function(_0x45548d){if(_0x45548d&&_0x45548d[_0xa48c('0x50')]===0x0){return db[_0xa48c('0x28')][_0xa48c('0x4a')]({'name':_0x33f4c7[_0xa48c('0x2c')],'resourceId':_0x33f4c7['id'],'type':_0x45548d['name'],'sectionId':_0x45548d['id']},{})['then'](function(){return _0x566a6b;});}else{return _0x566a6b;}})['catch'](function(_0x5e399c){logger[_0xa48c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e399c);throw _0x5e399c;});}return _0x566a6b;})[_0xa48c('0x24')](respondWithResult(_0x286add,0xc9))['catch'](handleError(_0x286add,null));};exports[_0xa48c('0x23')]=function(_0x5d785b,_0x864707){if(_0x5d785b['body']['id']){delete _0x5d785b[_0xa48c('0x51')]['id'];}return db[_0xa48c('0x2f')][_0xa48c('0x49')]({'where':{'id':_0x5d785b[_0xa48c('0x46')]['id']}})[_0xa48c('0x24')](handleEntityNotFound(_0x864707,null))[_0xa48c('0x24')](saveUpdates(_0x5d785b[_0xa48c('0x51')],null))['then'](respondWithResult(_0x864707,null))[_0xa48c('0x45')](handleError(_0x864707,null));};exports[_0xa48c('0x25')]=function(_0x3060cc,_0x16bed9){return db[_0xa48c('0x2f')][_0xa48c('0x49')]({'where':{'id':_0x3060cc[_0xa48c('0x46')]['id']}})[_0xa48c('0x24')](handleEntityNotFound(_0x16bed9,null))[_0xa48c('0x24')](removeEntity(_0x16bed9,null))[_0xa48c('0x45')](handleError(_0x16bed9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index fcc3d0d..8508704 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 _0xe90e=['rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','api','moment','request-promise'];(function(_0xca3611,_0x226d46){var _0x4445a4=function(_0x10655b){while(--_0x10655b){_0xca3611['push'](_0xca3611['shift']());}};_0x4445a4(++_0x226d46);}(_0xe90e,0x10e));var _0xee90=function(_0x423419,_0x4ec1db){_0x423419=_0x423419-0x0;var _0x190477=_0xe90e[_0x423419];return _0x190477;};'use strict';var _=require(_0xee90('0x0'));var util=require(_0xee90('0x1'));var logger=require('../../config/logger')(_0xee90('0x2'));var moment=require(_0xee90('0x3'));var BPromise=require('bluebird');var rp=require(_0xee90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee90('0x5'));var config=require(_0xee90('0x6'));var attributes=require(_0xee90('0x7'));module[_0xee90('0x8')]=function(_0x2e86dc,_0x917caa){return _0x2e86dc[_0xee90('0x9')](_0xee90('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07ce=['bluebird','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','api','moment'];(function(_0x8b1a5e,_0x2744eb){var _0x1146b1=function(_0x5a9f50){while(--_0x5a9f50){_0x8b1a5e['push'](_0x8b1a5e['shift']());}};_0x1146b1(++_0x2744eb);}(_0x07ce,0x193));var _0xe07c=function(_0x137356,_0x45feac){_0x137356=_0x137356-0x0;var _0x530ef4=_0x07ce[_0x137356];return _0x530ef4;};'use strict';var _=require(_0xe07c('0x0'));var util=require(_0xe07c('0x1'));var logger=require('../../config/logger')(_0xe07c('0x2'));var moment=require(_0xe07c('0x3'));var BPromise=require(_0xe07c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe07c('0x5'));var config=require(_0xe07c('0x6'));var attributes=require(_0xe07c('0x7'));module[_0xe07c('0x8')]=function(_0x47bcf0,_0x59f679){return _0x47bcf0['define'](_0xe07c('0x9'),attributes,{'tableName':_0xe07c('0xa'),'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 1cd2447..6ec5d23 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x2daca8,_0x1def67){var _0x17d635=function(_0x4235d2){while(--_0x4235d2){_0x2daca8['push'](_0x2daca8['shift']());}};_0x17d635(++_0x1def67);}(_0xf494,0x1c6));var _0x4f49=function(_0x4c4e45,_0x4ba716){_0x4c4e45=_0x4c4e45-0x0;var _0x3e520e=_0xf494[_0x4c4e45];return _0x3e520e;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x34379b,_0x2b55da){var _0x4c80c5=function(_0x44ac5d){while(--_0x44ac5d){_0x34379b['push'](_0x34379b['shift']());}};_0x4c80c5(++_0x2b55da);}(_0xf494,0x1c6));var _0x4f49=function(_0x24c5e9,_0x13b505){_0x24c5e9=_0x24c5e9-0x0;var _0x22c495=_0xf494[_0x24c5e9];return _0x22c495;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index bdc46b3..4752739 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 _0xda7b=['../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/pull','pull','/restart','restart','/migrations','migrations','express'];(function(_0x11859a,_0x6cea88){var _0x4ca0f3=function(_0x1fd0ea){while(--_0x1fd0ea){_0x11859a['push'](_0x11859a['shift']());}};_0x4ca0f3(++_0x6cea88);}(_0xda7b,0x16b));var _0xbda7=function(_0x3ca560,_0x7c4365){_0x3ca560=_0x3ca560-0x0;var _0x4a04b5=_0xda7b[_0x3ca560];return _0x4a04b5;};'use strict';var express=require(_0xbda7('0x0'));var router=express['Router']();var auth=require(_0xbda7('0x1'));var controller=require(_0xbda7('0x2'));router[_0xbda7('0x3')]('/',controller[_0xbda7('0x4')]);router[_0xbda7('0x3')]('/fetch',auth[_0xbda7('0x5')](),auth[_0xbda7('0x6')](),controller[_0xbda7('0x7')]);router[_0xbda7('0x3')]('/reset',auth[_0xbda7('0x5')](),auth[_0xbda7('0x6')](),controller['reset']);router[_0xbda7('0x3')](_0xbda7('0x8'),auth[_0xbda7('0x5')](),auth[_0xbda7('0x6')](),controller[_0xbda7('0x9')]);router[_0xbda7('0x3')](_0xbda7('0xa'),auth[_0xbda7('0x5')](),controller[_0xbda7('0xb')]);router['get'](_0xbda7('0xc'),controller[_0xbda7('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7036=['canUpdate','fetch','isAuthenticated','pull','migrations','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x7036,0x19c));var _0x6703=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0x7036[_0x23bc85];return _0x177dfd;};'use strict';var express=require('express');var router=express[_0x6703('0x0')]();var auth=require(_0x6703('0x1'));var controller=require(_0x6703('0x2'));router[_0x6703('0x3')]('/',controller[_0x6703('0x4')]);router[_0x6703('0x3')](_0x6703('0x5'),auth['isAuthenticated'](),auth[_0x6703('0x6')](),controller[_0x6703('0x7')]);router['get']('/reset',auth[_0x6703('0x8')](),auth[_0x6703('0x6')](),controller['reset']);router[_0x6703('0x3')]('/pull',auth[_0x6703('0x8')](),auth['canUpdate'](),controller[_0x6703('0x9')]);router[_0x6703('0x3')]('/restart',auth[_0x6703('0x8')](),controller['restart']);router[_0x6703('0x3')]('/migrations',controller[_0x6703('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f1d8a27..b2adf7e 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 _0x7a08=['error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','root','server','length','replace','.js','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','exports','query','latest','fetch','2.0.0','status','origin','master','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard'];(function(_0x2083fe,_0x12799f){var _0x33d6cd=function(_0x347c21){while(--_0x347c21){_0x2083fe['push'](_0x2083fe['shift']());}};_0x33d6cd(++_0x12799f);}(_0x7a08,0x132));var _0x87a0=function(_0x28e5ef,_0x4e406f){_0x28e5ef=_0x28e5ef-0x0;var _0x128683=_0x7a08[_0x28e5ef];return _0x128683;};'use strict';var Umzug=require(_0x87a0('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x87a0('0x1'));var pkginfo=require(_0x87a0('0x2'))(module,_0x87a0('0x3'));var compareVersions=require(_0x87a0('0x4'));var exec=require(_0x87a0('0x5'))[_0x87a0('0x6')];var db=require(_0x87a0('0x7'))['db'];var config=require(_0x87a0('0x8'));var pm2=require(_0x87a0('0x9'));var logger=require(_0x87a0('0xa'))('update');var git=require(_0x87a0('0xb'))(config['root']);exports[_0x87a0('0xc')]=function(_0x4055f3,_0x13a82d){var _0x48df78={'current':module[_0x87a0('0xd')][_0x87a0('0x3')],'phonebar':0x2};if(_0x4055f3[_0x87a0('0xe')]&&_0x4055f3[_0x87a0('0xe')][_0x87a0('0xf')]){return git[_0x87a0('0x10')]()['tags'](function(_0x283f42,_0x25ced1){_0x48df78[_0x87a0('0xf')]=(_0x283f42?module['exports'][_0x87a0('0x3')]:_0x25ced1[_0x87a0('0xf')])||_0x87a0('0x11');return _0x13a82d['status'](0xc8)['json'](_0x48df78);});}else{return _0x13a82d[_0x87a0('0x12')](0xc8)['json'](_0x48df78);}};exports[_0x87a0('0x10')]=function(_0x5f1cf2,_0x38fdb6){return git[_0x87a0('0x10')]([_0x87a0('0x13'),_0x87a0('0x14')],function(_0x2ba2f2){if(_0x2ba2f2){logger['error'](_0x2ba2f2);return _0x38fdb6[_0x87a0('0x12')](0x1f4)[_0x87a0('0x15')](_0x2ba2f2);}logger[_0x87a0('0x16')](_0x87a0('0x17'));return _0x38fdb6[_0x87a0('0x12')](0xc8)['json']({'output':_0x87a0('0x18')});});};exports[_0x87a0('0x19')]=function(_0x113fd4,_0x3f8e19){return git[_0x87a0('0x19')]([_0x87a0('0x1a'),_0x87a0('0x1b')],function(_0x3c56af){if(_0x3c56af){logger['error'](_0x3c56af);return _0x3f8e19['status'](0x1f4)[_0x87a0('0x15')](_0x3c56af);}logger[_0x87a0('0x16')](_0x87a0('0x1c'));return _0x3f8e19[_0x87a0('0x12')](0xc8)['json']({'output':_0x87a0('0x1d')});});};exports['pull']=function(_0x1dd2f7,_0x53178f){exec('npm\x20install\x20--production',function(_0x4cea7e,_0x4bec2c,_0x30d97b){logger[_0x87a0('0x16')](_0x4bec2c);logger[_0x87a0('0x16')](_0x30d97b);if(_0x4cea7e){logger[_0x87a0('0x1e')](_0x4cea7e);return _0x53178f['status'](0x1f4)[_0x87a0('0x15')](_0x4cea7e);}return _0x53178f[_0x87a0('0x12')](0xc8)['json']({'output':_0x4bec2c});});};exports[_0x87a0('0x1f')]=function(_0x2d68fc,_0x2780e9){return pm2[_0x87a0('0x1f')](_0x87a0('0x20'))[_0x87a0('0x21')](function(_0x191fc8){logger[_0x87a0('0x16')](_0x87a0('0x22'),_0x191fc8);return _0x2780e9[_0x87a0('0x12')](0xc8)[_0x87a0('0x15')]({'output':_0x87a0('0x23')});})['catch'](function(_0x32457b){logger[_0x87a0('0x1e')](_0x32457b);return _0x2780e9[_0x87a0('0x12')](0x1f4)[_0x87a0('0x15')](_0x32457b);});};exports['migrations']=function(_0x4e32d0,_0x83b0c7){var _0x551087=fs[_0x87a0('0x24')](path[_0x87a0('0x25')](config[_0x87a0('0x26')],_0x87a0('0x27'),'migrations'));var _0x39a926=[];for(var _0x54381a=0x0;_0x54381a<_0x551087[_0x87a0('0x28')];_0x54381a++){var _0x4db233=_0x551087[_0x54381a][_0x87a0('0x29')](_0x87a0('0x2a'),'');if(compareVersions(module['exports'][_0x87a0('0x3')],_0x4db233)===-0x1){_0x39a926[_0x87a0('0x2b')](_0x4db233);}}if(_0x39a926[_0x87a0('0x28')]){var _0x56c689=_0x39a926['sort'](compareVersions);var _0x15ee93=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x87a0('0x2c')],'modelName':_0x87a0('0x2c'),'columnName':_0x87a0('0x3')},'migrations':{'params':[db[_0x87a0('0x2d')][_0x87a0('0x2e')](),db[_0x87a0('0x2d')][_0x87a0('0x2f')],function(){throw new Error(_0x87a0('0x30'));}],'path':path['join'](config['root'],_0x87a0('0x27'),_0x87a0('0x31')),'pattern':/\.js$/}});_0x15ee93['up']({'migrations':_[_0x87a0('0x32')](_0x56c689,function(_0x207e16){return _0x207e16+'.js';})})[_0x87a0('0x21')](function(){return _0x83b0c7[_0x87a0('0x12')](0xc8)[_0x87a0('0x15')]({'output':_0x87a0('0x33')+module[_0x87a0('0xd')]['version']+_0x87a0('0x34')+_[_0x87a0('0x35')](_0x56c689),'migrations':_[_0x87a0('0x25')](_0x56c689)});})['catch'](function(_0x5f1817){if(_0x5f1817 instanceof db[_0x87a0('0x2d')][_0x87a0('0x36')]){return _0x83b0c7[_0x87a0('0x12')](0xc8)[_0x87a0('0x15')]({'output':_0x87a0('0x37')});}else{return _0x83b0c7[_0x87a0('0x12')](0x1f4)['json'](_0x5f1817);}});}else{return _0x83b0c7[_0x87a0('0x12')](0xc8)[_0x87a0('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x6d18=['../../config/environment','../../config/logger','update','simple-git','index','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb'];(function(_0x2bce98,_0x33626c){var _0x20c47d=function(_0x4b1d91){while(--_0x4b1d91){_0x2bce98['push'](_0x2bce98['shift']());}};_0x20c47d(++_0x33626c);}(_0x6d18,0xd8));var _0x86d1=function(_0x3f966c,_0x5e2b3b){_0x3f966c=_0x3f966c-0x0;var _0x26e5df=_0x6d18[_0x3f966c];return _0x26e5df;};'use strict';var Umzug=require(_0x86d1('0x0'));var path=require(_0x86d1('0x1'));var fs=require('fs');var _=require(_0x86d1('0x2'));var pkginfo=require(_0x86d1('0x3'))(module,_0x86d1('0x4'));var compareVersions=require(_0x86d1('0x5'));var exec=require(_0x86d1('0x6'))['exec'];var db=require(_0x86d1('0x7'))['db'];var config=require(_0x86d1('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x86d1('0x9'))(_0x86d1('0xa'));var git=require(_0x86d1('0xb'))(config['root']);exports[_0x86d1('0xc')]=function(_0x5eab85,_0x33d9c1){var _0x47faaa={'current':module['exports']['version'],'phonebar':0x2};if(_0x5eab85[_0x86d1('0xd')]&&_0x5eab85[_0x86d1('0xd')][_0x86d1('0xe')]){return git[_0x86d1('0xf')]()[_0x86d1('0x10')](function(_0x41b9a3,_0xd0b424){_0x47faaa[_0x86d1('0xe')]=(_0x41b9a3?module[_0x86d1('0x11')][_0x86d1('0x4')]:_0xd0b424['latest'])||_0x86d1('0x12');return _0x33d9c1[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')](_0x47faaa);});}else{return _0x33d9c1[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')](_0x47faaa);}};exports[_0x86d1('0xf')]=function(_0x24db91,_0x9d34af){return git['fetch']([_0x86d1('0x15'),_0x86d1('0x16')],function(_0x48328f){if(_0x48328f){logger[_0x86d1('0x17')](_0x48328f);return _0x9d34af[_0x86d1('0x13')](0x1f4)[_0x86d1('0x14')](_0x48328f);}logger[_0x86d1('0x18')](_0x86d1('0x19'));return _0x9d34af[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')]({'output':_0x86d1('0x1a')});});};exports[_0x86d1('0x1b')]=function(_0x4e8706,_0x3c42ab){return git[_0x86d1('0x1b')]([_0x86d1('0x1c'),_0x86d1('0x1d')],function(_0x10b9ce){if(_0x10b9ce){logger[_0x86d1('0x17')](_0x10b9ce);return _0x3c42ab[_0x86d1('0x13')](0x1f4)['json'](_0x10b9ce);}logger[_0x86d1('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3c42ab[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')]({'output':_0x86d1('0x1e')});});};exports[_0x86d1('0x1f')]=function(_0x9a1e11,_0x3fa86a){exec(_0x86d1('0x20'),function(_0xef3811,_0x282d91,_0x1b3c81){logger[_0x86d1('0x18')](_0x282d91);logger[_0x86d1('0x18')](_0x1b3c81);if(_0xef3811){logger[_0x86d1('0x17')](_0xef3811);return _0x3fa86a['status'](0x1f4)[_0x86d1('0x14')](_0xef3811);}return _0x3fa86a[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')]({'output':_0x282d91});});};exports['restart']=function(_0x4e0c40,_0x3b38fb){return pm2['restart'](_0x86d1('0x21'))[_0x86d1('0x22')](function(_0x37052f){logger['info'](_0x86d1('0x23'),_0x37052f);return _0x3b38fb[_0x86d1('0x13')](0xc8)['json']({'output':_0x86d1('0x24')});})[_0x86d1('0x25')](function(_0x22ca83){logger['error'](_0x22ca83);return _0x3b38fb[_0x86d1('0x13')](0x1f4)[_0x86d1('0x14')](_0x22ca83);});};exports[_0x86d1('0x26')]=function(_0x6f8ec1,_0x43f6f4){var _0x437959=fs[_0x86d1('0x27')](path['join'](config[_0x86d1('0x28')],_0x86d1('0x29'),'migrations'));var _0x20f40a=[];for(var _0x5ae1b4=0x0;_0x5ae1b4<_0x437959[_0x86d1('0x2a')];_0x5ae1b4++){var _0x6d1d80=_0x437959[_0x5ae1b4][_0x86d1('0x2b')](_0x86d1('0x2c'),'');if(compareVersions(module[_0x86d1('0x11')][_0x86d1('0x4')],_0x6d1d80)===-0x1){_0x20f40a[_0x86d1('0x2d')](_0x6d1d80);}}if(_0x20f40a[_0x86d1('0x2a')]){var _0x32da07=_0x20f40a[_0x86d1('0x2e')](compareVersions);var _0x458036=new Umzug({'storage':_0x86d1('0x2f'),'storageOptions':{'model':db[_0x86d1('0x30')],'modelName':_0x86d1('0x30'),'columnName':_0x86d1('0x4')},'migrations':{'params':[db[_0x86d1('0x2f')][_0x86d1('0x31')](),db['sequelize']['constructor'],function(){throw new Error(_0x86d1('0x32'));}],'path':path[_0x86d1('0x33')](config[_0x86d1('0x28')],_0x86d1('0x29'),_0x86d1('0x26')),'pattern':/\.js$/}});_0x458036['up']({'migrations':_['map'](_0x32da07,function(_0x525f16){return _0x525f16+_0x86d1('0x2c');})})[_0x86d1('0x22')](function(){return _0x43f6f4[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')]({'output':_0x86d1('0x34')+module['exports'][_0x86d1('0x4')]+_0x86d1('0x35')+_[_0x86d1('0x36')](_0x32da07),'migrations':_[_0x86d1('0x33')](_0x32da07)});})[_0x86d1('0x25')](function(_0x3c307a){if(_0x3c307a instanceof db[_0x86d1('0x2f')]['UniqueConstraintError']){return _0x43f6f4['status'](0xc8)[_0x86d1('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x43f6f4[_0x86d1('0x13')](0x1f4)[_0x86d1('0x14')](_0x3c307a);}});}else{return _0x43f6f4[_0x86d1('0x13')](0xc8)[_0x86d1('0x14')]({'output':_0x86d1('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index be30a03..e31153d 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 _0xc82d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','exports','multer','path','express'];(function(_0x2ed076,_0x36a886){var _0x21552f=function(_0x24cd28){while(--_0x24cd28){_0x2ed076['push'](_0x2ed076['shift']());}};_0x21552f(++_0x36a886);}(_0xc82d,0x82));var _0xdc82=function(_0x3cb52a,_0x5a586d){_0x3cb52a=_0x3cb52a-0x0;var _0x4e6bab=_0xc82d[_0x3cb52a];return _0x4e6bab;};'use strict';var multer=require(_0xdc82('0x0'));var util=require('util');var path=require(_0xdc82('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc82('0x2'));var router=express[_0xdc82('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc82('0x4'));var interaction=require(_0xdc82('0x5'));var config=require(_0xdc82('0x6'));var controller=require(_0xdc82('0x7'));router[_0xdc82('0x8')]('/',auth[_0xdc82('0x9')](),controller['index']);router[_0xdc82('0x8')](_0xdc82('0xa'),auth['isAuthenticated'](),controller[_0xdc82('0xb')]);router[_0xdc82('0x8')](_0xdc82('0xc'),auth[_0xdc82('0x9')](),controller[_0xdc82('0xd')]);router['post']('/',auth[_0xdc82('0x9')](),controller[_0xdc82('0xe')]);router[_0xdc82('0xf')](_0xdc82('0xc'),auth[_0xdc82('0x9')](),controller[_0xdc82('0x10')]);router[_0xdc82('0x11')](_0xdc82('0xc'),auth[_0xdc82('0x9')](),controller['destroy']);module[_0xdc82('0x12')]=router; \ No newline at end of file +var _0xdcf4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra'];(function(_0x40e949,_0x1b7035){var _0x2d93f3=function(_0x43a0e3){while(--_0x43a0e3){_0x40e949['push'](_0x40e949['shift']());}};_0x2d93f3(++_0x1b7035);}(_0xdcf4,0x175));var _0x4dcf=function(_0x1139fb,_0x19cbe2){_0x1139fb=_0x1139fb-0x0;var _0x5f2ded=_0xdcf4[_0x1139fb];return _0x5f2ded;};'use strict';var multer=require(_0x4dcf('0x0'));var util=require(_0x4dcf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4dcf('0x2'));var router=express[_0x4dcf('0x3')]();var fs_extra=require(_0x4dcf('0x4'));var auth=require(_0x4dcf('0x5'));var interaction=require(_0x4dcf('0x6'));var config=require(_0x4dcf('0x7'));var controller=require(_0x4dcf('0x8'));router['get']('/',auth[_0x4dcf('0x9')](),controller[_0x4dcf('0xa')]);router[_0x4dcf('0xb')](_0x4dcf('0xc'),auth[_0x4dcf('0x9')](),controller[_0x4dcf('0xd')]);router[_0x4dcf('0xb')]('/:id',auth[_0x4dcf('0x9')](),controller[_0x4dcf('0xe')]);router[_0x4dcf('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4dcf('0x10')](_0x4dcf('0x11'),auth[_0x4dcf('0x9')](),controller[_0x4dcf('0x12')]);router[_0x4dcf('0x13')](_0x4dcf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x4dcf('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b01c850..c9f9eaf 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 _0x1a85=['FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x14c295,_0x3e64fe){var _0x5b1fb6=function(_0x5e5221){while(--_0x5e5221){_0x14c295['push'](_0x14c295['shift']());}};_0x5b1fb6(++_0x3e64fe);}(_0x1a85,0x178));var _0x51a8=function(_0x2ecbfd,_0x5bacbc){_0x2ecbfd=_0x2ecbfd-0x0;var _0x2c65a2=_0x1a85[_0x2ecbfd];return _0x2c65a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x51a8('0x0')]},'uniqueid':{'type':Sequelize[_0x51a8('0x0')]},'calleridnum':{'type':Sequelize[_0x51a8('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x51a8('0x0')]},'membername':{'type':Sequelize[_0x51a8('0x0')]},'agentcalledAt':{'type':Sequelize[_0x51a8('0x1')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x51a8('0x1')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x51a8('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x51a8('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x51a8('0x0')]},'lastevent':{'type':Sequelize[_0x51a8('0x0')]},'channel':{'type':Sequelize[_0x51a8('0x0')]},'channelstate':{'type':Sequelize[_0x51a8('0x3')]},'channelstatedesc':{'type':Sequelize[_0x51a8('0x0')]},'connectedlinenum':{'type':Sequelize[_0x51a8('0x0')]},'connectedlinename':{'type':Sequelize[_0x51a8('0x0')]},'language':{'type':Sequelize[_0x51a8('0x0')]},'accountcode':{'type':Sequelize[_0x51a8('0x0')]},'context':{'type':Sequelize[_0x51a8('0x0')]},'exten':{'type':Sequelize[_0x51a8('0x0')]},'priority':{'type':Sequelize[_0x51a8('0x0')]},'destchannel':{'type':Sequelize[_0x51a8('0x0')]},'destchannelstate':{'type':Sequelize[_0x51a8('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x51a8('0x0')]},'destcalleridnum':{'type':Sequelize[_0x51a8('0x0')]},'destcalleridname':{'type':Sequelize[_0x51a8('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x51a8('0x0')]},'destlanguage':{'type':Sequelize[_0x51a8('0x0')]},'destaccountcode':{'type':Sequelize[_0x51a8('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x51a8('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x51a8('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x51a8('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x51a8('0x0')]},'transfer':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x51a8('0x0')],'comment':_0x51a8('0x4')},'transferexten':{'type':Sequelize[_0x51a8('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x51a8('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x065e=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x065e,0x1a7));var _0xe065=function(_0x5ce363,_0x44ee1b){_0x5ce363=_0x5ce363-0x0;var _0x160171=_0x065e[_0x5ce363];return _0x160171;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe065('0x1')]},'calleridname':{'type':Sequelize[_0xe065('0x1')]},'queue':{'type':Sequelize[_0xe065('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe065('0x2')]},'agentconnectAt':{'type':Sequelize[_0xe065('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xe065('0x2')]},'agentdumpAt':{'type':Sequelize[_0xe065('0x2')]},'holdtime':{'type':Sequelize[_0xe065('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe065('0x3')]},'agentacw':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe065('0x3')]},'reason':{'type':Sequelize[_0xe065('0x1')]},'lastevent':{'type':Sequelize[_0xe065('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe065('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe065('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe065('0x1')]},'connectedlinename':{'type':Sequelize[_0xe065('0x1')]},'language':{'type':Sequelize[_0xe065('0x1')]},'accountcode':{'type':Sequelize[_0xe065('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe065('0x1')]},'destchannel':{'type':Sequelize[_0xe065('0x1')]},'destchannelstate':{'type':Sequelize[_0xe065('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe065('0x1')]},'destcalleridname':{'type':Sequelize[_0xe065('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe065('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe065('0x1')]},'destlanguage':{'type':Sequelize[_0xe065('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe065('0x1')]},'destexten':{'type':Sequelize[_0xe065('0x1')]},'destpriority':{'type':Sequelize[_0xe065('0x1')]},'destuniqueid':{'type':Sequelize[_0xe065('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe065('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xe065('0x1')]},'transfer':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xe065('0x5')},'transferexten':{'type':Sequelize[_0xe065('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe065('0x3')],'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 0bbeba7..eaec3c1 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(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 d91ef7a..282483f 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 _0xb2ac=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','lodash','util'];(function(_0x1ad852,_0x5c43b5){var _0xf38eae=function(_0x13020a){while(--_0x13020a){_0x1ad852['push'](_0x1ad852['shift']());}};_0xf38eae(++_0x5c43b5);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x18c658,_0x4b97e2){_0x18c658=_0x18c658-0x0;var _0x4cf8a1=_0xb2ac[_0x18c658];return _0x4cf8a1;};'use strict';var _=require(_0xcb2a('0x0'));var util=require(_0xcb2a('0x1'));var logger=require(_0xcb2a('0x2'))(_0xcb2a('0x3'));var moment=require(_0xcb2a('0x4'));var BPromise=require(_0xcb2a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb2a('0x6'));var rimraf=require(_0xcb2a('0x7'));var config=require(_0xcb2a('0x8'));var attributes=require(_0xcb2a('0x9'));module[_0xcb2a('0xa')]=function(_0x1fe0b6,_0x4e4df3){return _0x1fe0b6[_0xcb2a('0xb')](_0xcb2a('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc18a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xc18a,0x1cf));var _0xac18=function(_0x1f76f2,_0xf20812){_0x1f76f2=_0x1f76f2-0x0;var _0x26cb60=_0xc18a[_0x1f76f2];return _0x26cb60;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'paranoid':![],'indexes':[{'fields':[_0xac18('0xe'),_0xac18('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 84b245a..d11b2f0 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 _0xb620=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','create','body','options','raw','CreateVoiceAgentReport','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','limit','then'];(function(_0x3286bb,_0x5cd3cf){var _0x55b0fb=function(_0x78f24e){while(--_0x78f24e){_0x3286bb['push'](_0x3286bb['shift']());}};_0x55b0fb(++_0x5cd3cf);}(_0xb620,0x1f0));var _0x0b62=function(_0x5e044c,_0x57b5d7){_0x5e044c=_0x5e044c-0x0;var _0x540ed1=_0xb620[_0x5e044c];return _0x540ed1;};'use strict';var _=require(_0x0b62('0x0'));var util=require('util');var moment=require(_0x0b62('0x1'));var BPromise=require(_0x0b62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b62('0x3'));var db=require(_0x0b62('0x4'))['db'];var utils=require(_0x0b62('0x5'));var logger=require(_0x0b62('0x6'))(_0x0b62('0x7'));var config=require('../../config/environment');var jayson=require(_0x0b62('0x8'));var client=jayson[_0x0b62('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7ce39c,_0x3716bb,_0x4d58aa){return new BPromise(function(_0x4ba1a9,_0xc7196a){return client[_0x0b62('0xa')](_0x7ce39c,_0x4d58aa)['then'](function(_0x3a6f36){logger['info'](_0x0b62('0xb'),_0x3716bb,_0x0b62('0xc'));logger[_0x0b62('0xd')](_0x0b62('0xe'),_0x3716bb,_0x0b62('0xc'),JSON['stringify'](_0x3a6f36));if(_0x3a6f36[_0x0b62('0xf')]){if(_0x3a6f36[_0x0b62('0xf')][_0x0b62('0x10')]===0x1f4){logger[_0x0b62('0xf')](_0x0b62('0xb'),_0x3716bb,_0x3a6f36[_0x0b62('0xf')]['message']);return _0xc7196a(_0x3a6f36[_0x0b62('0xf')][_0x0b62('0x11')]);}logger[_0x0b62('0xf')](_0x0b62('0xb'),_0x3716bb,_0x3a6f36[_0x0b62('0xf')][_0x0b62('0x11')]);return _0x4ba1a9(_0x3a6f36[_0x0b62('0xf')][_0x0b62('0x11')]);}else{logger[_0x0b62('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x3716bb,'request\x20sent');_0x4ba1a9(_0x3a6f36['result'][_0x0b62('0x11')]);}})[_0x0b62('0x13')](function(_0x9b3b41){logger[_0x0b62('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x3716bb,_0x9b3b41);_0xc7196a(_0x9b3b41);});});}exports['CreateVoiceAgentReport']=function(_0x55053c){var _0x5bef91=this;return new Promise(function(_0x3f178c,_0x1679bc){return db['VoiceAgentReport'][_0x0b62('0x14')](_0x55053c[_0x0b62('0x15')],{'raw':_0x55053c[_0x0b62('0x16')]?_0x55053c[_0x0b62('0x16')][_0x0b62('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x382be4){logger[_0x0b62('0x12')]('CreateVoiceAgentReport',_0x55053c);logger[_0x0b62('0xd')](_0x0b62('0x18'),_0x55053c,JSON[_0x0b62('0x19')](_0x382be4));_0x3f178c(_0x382be4);})[_0x0b62('0x13')](function(_0x3adde1){logger[_0x0b62('0xf')](_0x0b62('0x18'),_0x3adde1[_0x0b62('0x11')],_0x55053c);_0x1679bc(_0x5bef91[_0x0b62('0xf')](0x1f4,_0x3adde1[_0x0b62('0x11')]));});});};exports[_0x0b62('0x1a')]=function(_0x35c4f4){var _0x322531=this;return new Promise(function(_0x20cce6,_0x581767){return db[_0x0b62('0x1b')][_0x0b62('0x1c')](_0x35c4f4[_0x0b62('0x15')],{'raw':_0x35c4f4[_0x0b62('0x16')]?_0x35c4f4[_0x0b62('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35c4f4[_0x0b62('0x16')]?_0x35c4f4[_0x0b62('0x16')]['where']||null:null,'attributes':_0x35c4f4[_0x0b62('0x16')]?_0x35c4f4[_0x0b62('0x16')]['attributes']||null:null,'limit':_0x35c4f4['options']?_0x35c4f4[_0x0b62('0x16')][_0x0b62('0x1d')]||null:null})[_0x0b62('0x1e')](function(_0x577130){logger['info']('UpdateVoiceAgentReport',_0x35c4f4);logger[_0x0b62('0xd')](_0x0b62('0x1a'),_0x35c4f4,JSON[_0x0b62('0x19')](_0x577130));_0x20cce6(_0x577130);})['catch'](function(_0x1118f9){logger[_0x0b62('0xf')](_0x0b62('0x1a'),_0x1118f9[_0x0b62('0x11')],_0x35c4f4);_0x581767(_0x322531['error'](0x1f4,_0x1118f9[_0x0b62('0x11')]));});});}; \ No newline at end of file +var _0xf289=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','debug','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x18210a,_0x3d6074){var _0x42897f=function(_0x1527d6){while(--_0x1527d6){_0x18210a['push'](_0x18210a['shift']());}};_0x42897f(++_0x3d6074);}(_0xf289,0x1f1));var _0x9f28=function(_0x1189dd,_0x55a423){_0x1189dd=_0x1189dd-0x0;var _0x105381=_0xf289[_0x1189dd];return _0x105381;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var moment=require('moment');var BPromise=require(_0x9f28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f28('0x3'));var db=require(_0x9f28('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f28('0x5'))(_0x9f28('0x6'));var config=require(_0x9f28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f28('0x8')][_0x9f28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39c89e,_0x2f6a3f,_0x23ebd2){return new BPromise(function(_0x461171,_0x388e05){return client[_0x9f28('0xa')](_0x39c89e,_0x23ebd2)[_0x9f28('0xb')](function(_0xf0321b){logger[_0x9f28('0xc')](_0x9f28('0xd'),_0x2f6a3f,_0x9f28('0xe'));logger['debug'](_0x9f28('0xf'),_0x2f6a3f,'request\x20sent',JSON[_0x9f28('0x10')](_0xf0321b));if(_0xf0321b[_0x9f28('0x11')]){if(_0xf0321b[_0x9f28('0x11')][_0x9f28('0x12')]===0x1f4){logger[_0x9f28('0x11')](_0x9f28('0xd'),_0x2f6a3f,_0xf0321b[_0x9f28('0x11')]['message']);return _0x388e05(_0xf0321b[_0x9f28('0x11')][_0x9f28('0x13')]);}logger[_0x9f28('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x2f6a3f,_0xf0321b['error']['message']);return _0x461171(_0xf0321b[_0x9f28('0x11')][_0x9f28('0x13')]);}else{logger[_0x9f28('0xc')](_0x9f28('0xd'),_0x2f6a3f,'request\x20sent');_0x461171(_0xf0321b[_0x9f28('0x14')][_0x9f28('0x13')]);}})[_0x9f28('0x15')](function(_0x57f958){logger['error'](_0x9f28('0xd'),_0x2f6a3f,_0x57f958);_0x388e05(_0x57f958);});});}exports[_0x9f28('0x16')]=function(_0x30b0d6){var _0x2bd85d=this;return new Promise(function(_0xff979b,_0x1b6295){return db[_0x9f28('0x17')][_0x9f28('0x18')](_0x30b0d6['body'],{'raw':_0x30b0d6[_0x9f28('0x19')]?_0x30b0d6[_0x9f28('0x19')][_0x9f28('0x1a')]===undefined?!![]:![]:!![]})[_0x9f28('0xb')](function(_0x21c39e){logger[_0x9f28('0xc')](_0x9f28('0x16'),_0x30b0d6);logger[_0x9f28('0x1b')](_0x9f28('0x16'),_0x30b0d6,JSON[_0x9f28('0x10')](_0x21c39e));_0xff979b(_0x21c39e);})[_0x9f28('0x15')](function(_0x2a4f90){logger[_0x9f28('0x11')](_0x9f28('0x16'),_0x2a4f90[_0x9f28('0x13')],_0x30b0d6);_0x1b6295(_0x2bd85d['error'](0x1f4,_0x2a4f90[_0x9f28('0x13')]));});});};exports[_0x9f28('0x1c')]=function(_0xcde37b){var _0x1c9b91=this;return new Promise(function(_0xe75567,_0x3b4cdf){return db[_0x9f28('0x17')][_0x9f28('0x1d')](_0xcde37b[_0x9f28('0x1e')],{'raw':_0xcde37b['options']?_0xcde37b[_0x9f28('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcde37b[_0x9f28('0x19')]?_0xcde37b[_0x9f28('0x19')][_0x9f28('0x1f')]||null:null,'attributes':_0xcde37b['options']?_0xcde37b['options'][_0x9f28('0x20')]||null:null,'limit':_0xcde37b['options']?_0xcde37b['options'][_0x9f28('0x21')]||null:null})[_0x9f28('0xb')](function(_0x14c99a){logger['info'](_0x9f28('0x1c'),_0xcde37b);logger[_0x9f28('0x1b')](_0x9f28('0x1c'),_0xcde37b,JSON[_0x9f28('0x10')](_0x14c99a));_0xe75567(_0x14c99a);})[_0x9f28('0x15')](function(_0xf099c7){logger[_0x9f28('0x11')](_0x9f28('0x1c'),_0xf099c7['message'],_0xcde37b);_0x3b4cdf(_0x1c9b91[_0x9f28('0x11')](0x1f4,_0xf099c7[_0x9f28('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 834aeca..c956f0c 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 _0xac9d=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xac9d,0x14d));var _0xdac9=function(_0x1c55f1,_0x3669ca){_0x1c55f1=_0x1c55f1-0x0;var _0x44dd27=_0xac9d[_0x1c55f1];return _0x44dd27;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./voiceCallReport.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),auth[_0xdac9('0xa')](),controller['describe']);router[_0xdac9('0x9')]('/:id',auth[_0xdac9('0xa')](),controller[_0xdac9('0xd')]);router[_0xdac9('0xe')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x12')]);router['delete'](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller['destroy']);module[_0xdac9('0x13')]=router; \ No newline at end of file +var _0xa630=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe'];(function(_0x3f8178,_0x4f24f3){var _0x49a6b6=function(_0x169bb7){while(--_0x169bb7){_0x3f8178['push'](_0x3f8178['shift']());}};_0x49a6b6(++_0x4f24f3);}(_0xa630,0xbe));var _0x0a63=function(_0x113f85,_0x52d8f2){_0x113f85=_0x113f85-0x0;var _0x41e94a=_0xa630[_0x113f85];return _0x41e94a;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')]('/',auth[_0x0a63('0x8')](),controller['index']);router[_0x0a63('0x7')](_0x0a63('0x9'),auth[_0x0a63('0x8')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x7')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')]('/',auth[_0x0a63('0x8')](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0xb'),auth[_0x0a63('0x8')](),controller[_0x0a63('0x10')]);router[_0x0a63('0x11')](_0x0a63('0xb'),auth['isAuthenticated'](),controller[_0x0a63('0x12')]);module[_0x0a63('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index d976328..6bfb91f 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 _0x865c=['internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x40d801,_0x16f27a){var _0x17ebf7=function(_0x147aef){while(--_0x147aef){_0x40d801['push'](_0x40d801['shift']());}};_0x17ebf7(++_0x16f27a);}(_0x865c,0x158));var _0xc865=function(_0x57ace5,_0x4205a6){_0x57ace5=_0x57ace5-0x0;var _0x5ce79c=_0x865c[_0x57ace5];return _0x5ce79c;};'use strict';var Sequelize=require(_0xc865('0x0'));module[_0xc865('0x1')]={'uniqueid':{'type':Sequelize[_0xc865('0x2')]},'type':{'type':Sequelize[_0xc865('0x3')]('inbound',_0xc865('0x4'),_0xc865('0x5'),_0xc865('0x6'),_0xc865('0x7'),_0xc865('0x8'))},'tag':{'type':Sequelize[_0xc865('0x2')]},'accountcode':{'type':Sequelize[_0xc865('0x2')]},'source':{'type':Sequelize[_0xc865('0x2')]},'destination':{'type':Sequelize[_0xc865('0x2')]},'destinationcontext':{'type':Sequelize[_0xc865('0x2')]},'callerid':{'type':Sequelize[_0xc865('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xc865('0x2')]},'lastapplication':{'type':Sequelize[_0xc865('0x2')]},'lastdata':{'type':Sequelize[_0xc865('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc865('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc865('0xa')]},'duration':{'type':Sequelize[_0xc865('0xb')]},'billableseconds':{'type':Sequelize[_0xc865('0xb')]},'mohtime':{'type':Sequelize[_0xc865('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc865('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xc865('0x2')]},'userDisposition':{'type':Sequelize[_0xc865('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xc865('0x2')]},'note':{'type':Sequelize[_0xc865('0x2')]},'prefix':{'type':Sequelize[_0xc865('0x2')]},'routeid':{'type':Sequelize[_0xc865('0xb')]},'sipcallid':{'type':Sequelize[_0xc865('0x2')]}}; \ No newline at end of file +var _0x4f81=['outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','STRING','inbound','internal'];(function(_0x3246a6,_0x2a685a){var _0x1df64d=function(_0x4868ad){while(--_0x4868ad){_0x3246a6['push'](_0x3246a6['shift']());}};_0x1df64d(++_0x2a685a);}(_0x4f81,0x1e3));var _0x14f8=function(_0x3e25ad,_0x14b0cd){_0x3e25ad=_0x3e25ad-0x0;var _0x4e88b1=_0x4f81[_0x3e25ad];return _0x4e88b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x14f8('0x0')]},'type':{'type':Sequelize['ENUM'](_0x14f8('0x1'),_0x14f8('0x2'),_0x14f8('0x3'),_0x14f8('0x4'),_0x14f8('0x5'),_0x14f8('0x6'))},'tag':{'type':Sequelize[_0x14f8('0x0')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x14f8('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x14f8('0x0')]},'callerid':{'type':Sequelize[_0x14f8('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x14f8('0x0')]},'lastapplication':{'type':Sequelize[_0x14f8('0x0')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x14f8('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x14f8('0x7')]},'duration':{'type':Sequelize[_0x14f8('0x8')]},'billableseconds':{'type':Sequelize[_0x14f8('0x8')]},'mohtime':{'type':Sequelize[_0x14f8('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x14f8('0x0')]},'amaflags':{'type':Sequelize[_0x14f8('0x0')]},'userfield':{'type':Sequelize[_0x14f8('0x0')]},'userDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x14f8('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x14f8('0x0')]},'note':{'type':Sequelize[_0x14f8('0x0')]},'prefix':{'type':Sequelize[_0x14f8('0x0')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x14f8('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index d5d8ccd..1c55409 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x3e78a9,_0x9c1c9a){var _0x5253d4=function(_0x366894){while(--_0x366894){_0x3e78a9['push'](_0x3e78a9['shift']());}};_0x5253d4(++_0x9c1c9a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x0b0e[_0x622035];return _0x326cf2;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d4502,_0x32f0a7){_0x1d4502=_0x1d4502-0x0;var _0x2f49a2=_0x5f2f[_0x1d4502];return _0x2f49a2;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c279d2a..e930f68 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 _0xda1c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xda1c,0x68));var _0xcda1=function(_0x403cbe,_0x265c23){_0x403cbe=_0x403cbe-0x0;var _0x2ff85d=_0xda1c[_0x403cbe];return _0x2ff85d;};'use strict';var _=require(_0xcda1('0x0'));var util=require(_0xcda1('0x1'));var logger=require(_0xcda1('0x2'))(_0xcda1('0x3'));var moment=require(_0xcda1('0x4'));var BPromise=require(_0xcda1('0x5'));var rp=require(_0xcda1('0x6'));var fs=require('fs');var path=require(_0xcda1('0x7'));var rimraf=require(_0xcda1('0x8'));var config=require(_0xcda1('0x9'));var attributes=require(_0xcda1('0xa'));module['exports']=function(_0x153e20,_0x38d063){return _0x153e20[_0xcda1('0xb')](_0xcda1('0xc'),attributes,{'tableName':_0xcda1('0xd'),'paranoid':![],'indexes':[{'fields':[_0xcda1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa739=['uniqueid','util','api','moment','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xa739,0x1e1));var _0x9a73=function(_0x25cf71,_0x2a4af6){_0x25cf71=_0x25cf71-0x0;var _0x289558=_0xa739[_0x25cf71];return _0x289558;};'use strict';var _=require('lodash');var util=require(_0x9a73('0x0'));var logger=require('../../config/logger')(_0x9a73('0x1'));var moment=require(_0x9a73('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a73('0x3'));var fs=require('fs');var path=require(_0x9a73('0x4'));var rimraf=require(_0x9a73('0x5'));var config=require('../../config/environment');var attributes=require(_0x9a73('0x6'));module[_0x9a73('0x7')]=function(_0xcb4e9e,_0x65115e){return _0xcb4e9e[_0x9a73('0x8')](_0x9a73('0x9'),attributes,{'tableName':_0x9a73('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9a73('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 1662b45..51cc548 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 _0xb6fb=['catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','debug','CreateVoiceCallReport','create','body','raw','update','UpdateVoiceCallReport','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','info','result'];(function(_0x5218c5,_0x4dfffd){var _0x743037=function(_0x57aa1a){while(--_0x57aa1a){_0x5218c5['push'](_0x5218c5['shift']());}};_0x743037(++_0x4dfffd);}(_0xb6fb,0x184));var _0xbb6f=function(_0x6fe0a5,_0x5098b0){_0x6fe0a5=_0x6fe0a5-0x0;var _0x434b17=_0xb6fb[_0x6fe0a5];return _0x434b17;};'use strict';var _=require('lodash');var util=require(_0xbb6f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbb6f('0x1'));var fs=require('fs');var Redis=require(_0xbb6f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb6f('0x3'));var logger=require(_0xbb6f('0x4'))(_0xbb6f('0x5'));var config=require(_0xbb6f('0x6'));var jayson=require(_0xbb6f('0x7'));var client=jayson[_0xbb6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26151e,_0x1f4dd0,_0x3c20d9){return new BPromise(function(_0x55a980,_0x3f2c84){return client[_0xbb6f('0x9')](_0x26151e,_0x3c20d9)[_0xbb6f('0xa')](function(_0x6cf6a3){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x1f4dd0,_0xbb6f('0xb'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1f4dd0,_0xbb6f('0xb'),JSON[_0xbb6f('0xc')](_0x6cf6a3));if(_0x6cf6a3[_0xbb6f('0xd')]){if(_0x6cf6a3[_0xbb6f('0xd')][_0xbb6f('0xe')]===0x1f4){logger[_0xbb6f('0xd')](_0xbb6f('0xf'),_0x1f4dd0,_0x6cf6a3[_0xbb6f('0xd')][_0xbb6f('0x10')]);return _0x3f2c84(_0x6cf6a3[_0xbb6f('0xd')][_0xbb6f('0x10')]);}logger[_0xbb6f('0xd')](_0xbb6f('0xf'),_0x1f4dd0,_0x6cf6a3[_0xbb6f('0xd')][_0xbb6f('0x10')]);return _0x55a980(_0x6cf6a3[_0xbb6f('0xd')][_0xbb6f('0x10')]);}else{logger[_0xbb6f('0x11')](_0xbb6f('0xf'),_0x1f4dd0,_0xbb6f('0xb'));_0x55a980(_0x6cf6a3[_0xbb6f('0x12')][_0xbb6f('0x10')]);}})[_0xbb6f('0x13')](function(_0x1c058f){logger[_0xbb6f('0xd')](_0xbb6f('0xf'),_0x1f4dd0,_0x1c058f);_0x3f2c84(_0x1c058f);});});}exports[_0xbb6f('0x14')]=function(_0xb38140){var _0x135f5b=this;return new Promise(function(_0x10b86d,_0x1a8449){return db[_0xbb6f('0x15')][_0xbb6f('0x16')]({'raw':_0xb38140[_0xbb6f('0x17')]?_0xb38140['options']['raw']===undefined?!![]:![]:!![],'where':_0xb38140['options']?_0xb38140[_0xbb6f('0x17')][_0xbb6f('0x18')]||null:null,'attributes':_0xb38140[_0xbb6f('0x17')]?_0xb38140[_0xbb6f('0x17')][_0xbb6f('0x19')]||null:null,'limit':_0xb38140[_0xbb6f('0x17')]?_0xb38140[_0xbb6f('0x17')][_0xbb6f('0x1a')]||null:null,'include':_0xb38140[_0xbb6f('0x17')]?_0xb38140[_0xbb6f('0x17')][_0xbb6f('0x1b')]?_[_0xbb6f('0x1c')](_0xb38140[_0xbb6f('0x17')]['include'],function(_0x2a472d){return{'model':db[_0x2a472d['model']],'as':_0x2a472d['as'],'attributes':_0x2a472d[_0xbb6f('0x19')],'include':_0x2a472d['include']?_['map'](_0x2a472d['include'],function(_0x5d3fb8){return{'model':db[_0x5d3fb8[_0xbb6f('0x1d')]],'as':_0x5d3fb8['as'],'attributes':_0x5d3fb8[_0xbb6f('0x19')],'include':_0x5d3fb8[_0xbb6f('0x1b')]?_[_0xbb6f('0x1c')](_0x5d3fb8[_0xbb6f('0x1b')],function(_0x27bed4){return{'model':db[_0x27bed4['model']],'as':_0x27bed4['as'],'attributes':_0x27bed4[_0xbb6f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbb6f('0xa')](function(_0x1a96d1){logger[_0xbb6f('0x11')]('GetVoiceCallReport',_0xb38140);logger[_0xbb6f('0x1e')](_0xbb6f('0x14'),_0xb38140,JSON[_0xbb6f('0xc')](_0x1a96d1));_0x10b86d(_0x1a96d1);})[_0xbb6f('0x13')](function(_0x2f9129){logger[_0xbb6f('0xd')]('GetVoiceCallReport',_0x2f9129[_0xbb6f('0x10')],_0xb38140);_0x1a8449(_0x135f5b[_0xbb6f('0xd')](0x1f4,_0x2f9129[_0xbb6f('0x10')]));});});};exports[_0xbb6f('0x1f')]=function(_0x1ad68e){var _0xde4fea=this;return new Promise(function(_0x1ab53a,_0x2ff176){return db[_0xbb6f('0x15')][_0xbb6f('0x20')](_0x1ad68e[_0xbb6f('0x21')],{'raw':_0x1ad68e['options']?_0x1ad68e[_0xbb6f('0x17')][_0xbb6f('0x22')]===undefined?!![]:![]:!![]})[_0xbb6f('0xa')](function(_0x412609){logger[_0xbb6f('0x11')](_0xbb6f('0x1f'),_0x1ad68e);logger[_0xbb6f('0x1e')](_0xbb6f('0x1f'),_0x1ad68e,JSON[_0xbb6f('0xc')](_0x412609));_0x1ab53a(_0x412609);})[_0xbb6f('0x13')](function(_0x5134d1){logger['error'](_0xbb6f('0x1f'),_0x5134d1[_0xbb6f('0x10')],_0x1ad68e);_0x2ff176(_0xde4fea['error'](0x1f4,_0x5134d1[_0xbb6f('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x4fe404){var _0x27f0ae=this;return new Promise(function(_0x35a66c,_0xaa16c1){return db[_0xbb6f('0x15')][_0xbb6f('0x23')](_0x4fe404[_0xbb6f('0x21')],{'raw':_0x4fe404[_0xbb6f('0x17')]?_0x4fe404[_0xbb6f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe404[_0xbb6f('0x17')]?_0x4fe404[_0xbb6f('0x17')][_0xbb6f('0x18')]||null:null,'attributes':_0x4fe404[_0xbb6f('0x17')]?_0x4fe404[_0xbb6f('0x17')][_0xbb6f('0x19')]||null:null,'limit':_0x4fe404[_0xbb6f('0x17')]?_0x4fe404[_0xbb6f('0x17')]['limit']||null:null})['then'](function(_0x2c6980){logger['info'](_0xbb6f('0x24'),_0x4fe404);logger['debug'](_0xbb6f('0x24'),_0x4fe404,JSON[_0xbb6f('0xc')](_0x2c6980));_0x35a66c(_0x2c6980);})['catch'](function(_0x2cadbd){logger['error']('UpdateVoiceCallReport',_0x2cadbd['message'],_0x4fe404);_0xaa16c1(_0x27f0ae[_0xbb6f('0xd')](0x1f4,_0x2cadbd[_0xbb6f('0x10')]));});});}; \ No newline at end of file +var _0x1ba5=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','map','include','model','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','where','util','moment'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x1ba5,0x11e));var _0x51ba=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x1ba5[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require(_0x51ba('0x0'));var moment=require(_0x51ba('0x1'));var BPromise=require(_0x51ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51ba('0x3'))['db'];var utils=require(_0x51ba('0x4'));var logger=require(_0x51ba('0x5'))(_0x51ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x51ba('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50e145,_0x1c0662,_0x41de78){return new BPromise(function(_0x4b72c2,_0x25891f){return client[_0x51ba('0x8')](_0x50e145,_0x41de78)[_0x51ba('0x9')](function(_0x527642){logger[_0x51ba('0xa')](_0x51ba('0xb'),_0x1c0662,_0x51ba('0xc'));logger[_0x51ba('0xd')](_0x51ba('0xe'),_0x1c0662,'request\x20sent',JSON[_0x51ba('0xf')](_0x527642));if(_0x527642[_0x51ba('0x10')]){if(_0x527642[_0x51ba('0x10')][_0x51ba('0x11')]===0x1f4){logger[_0x51ba('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x1c0662,_0x527642['error'][_0x51ba('0x12')]);return _0x25891f(_0x527642[_0x51ba('0x10')][_0x51ba('0x12')]);}logger[_0x51ba('0x10')](_0x51ba('0xb'),_0x1c0662,_0x527642[_0x51ba('0x10')][_0x51ba('0x12')]);return _0x4b72c2(_0x527642[_0x51ba('0x10')]['message']);}else{logger[_0x51ba('0xa')](_0x51ba('0xb'),_0x1c0662,_0x51ba('0xc'));_0x4b72c2(_0x527642[_0x51ba('0x13')][_0x51ba('0x12')]);}})[_0x51ba('0x14')](function(_0x1714a2){logger[_0x51ba('0x10')](_0x51ba('0xb'),_0x1c0662,_0x1714a2);_0x25891f(_0x1714a2);});});}exports[_0x51ba('0x15')]=function(_0x5dc072){var _0x18c71a=this;return new Promise(function(_0x5ea59b,_0x389545){return db[_0x51ba('0x16')][_0x51ba('0x17')]({'raw':_0x5dc072['options']?_0x5dc072[_0x51ba('0x18')][_0x51ba('0x19')]===undefined?!![]:![]:!![],'where':_0x5dc072['options']?_0x5dc072['options']['where']||null:null,'attributes':_0x5dc072[_0x51ba('0x18')]?_0x5dc072[_0x51ba('0x18')][_0x51ba('0x1a')]||null:null,'limit':_0x5dc072[_0x51ba('0x18')]?_0x5dc072[_0x51ba('0x18')][_0x51ba('0x1b')]||null:null,'include':_0x5dc072[_0x51ba('0x18')]?_0x5dc072[_0x51ba('0x18')]['include']?_[_0x51ba('0x1c')](_0x5dc072[_0x51ba('0x18')][_0x51ba('0x1d')],function(_0x2dfa69){return{'model':db[_0x2dfa69[_0x51ba('0x1e')]],'as':_0x2dfa69['as'],'attributes':_0x2dfa69[_0x51ba('0x1a')],'include':_0x2dfa69[_0x51ba('0x1d')]?_[_0x51ba('0x1c')](_0x2dfa69[_0x51ba('0x1d')],function(_0x266e32){return{'model':db[_0x266e32[_0x51ba('0x1e')]],'as':_0x266e32['as'],'attributes':_0x266e32[_0x51ba('0x1a')],'include':_0x266e32['include']?_[_0x51ba('0x1c')](_0x266e32['include'],function(_0x21b45e){return{'model':db[_0x21b45e[_0x51ba('0x1e')]],'as':_0x21b45e['as'],'attributes':_0x21b45e[_0x51ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x51ba('0x9')](function(_0x30c17f){logger[_0x51ba('0xa')](_0x51ba('0x15'),_0x5dc072);logger[_0x51ba('0xd')](_0x51ba('0x15'),_0x5dc072,JSON[_0x51ba('0xf')](_0x30c17f));_0x5ea59b(_0x30c17f);})['catch'](function(_0x5eab7a){logger['error'](_0x51ba('0x15'),_0x5eab7a[_0x51ba('0x12')],_0x5dc072);_0x389545(_0x18c71a['error'](0x1f4,_0x5eab7a[_0x51ba('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x9eb0c3){var _0xc7a18=this;return new Promise(function(_0x206734,_0x3e243c){return db[_0x51ba('0x16')]['create'](_0x9eb0c3[_0x51ba('0x1f')],{'raw':_0x9eb0c3[_0x51ba('0x18')]?_0x9eb0c3[_0x51ba('0x18')][_0x51ba('0x19')]===undefined?!![]:![]:!![]})[_0x51ba('0x9')](function(_0x52eacb){logger['info']('CreateVoiceCallReport',_0x9eb0c3);logger[_0x51ba('0xd')](_0x51ba('0x20'),_0x9eb0c3,JSON['stringify'](_0x52eacb));_0x206734(_0x52eacb);})['catch'](function(_0x49ba1f){logger[_0x51ba('0x10')](_0x51ba('0x20'),_0x49ba1f['message'],_0x9eb0c3);_0x3e243c(_0xc7a18['error'](0x1f4,_0x49ba1f[_0x51ba('0x12')]));});});};exports[_0x51ba('0x21')]=function(_0xbdda95){var _0x55d5aa=this;return new Promise(function(_0x18703f,_0x50c878){return db[_0x51ba('0x16')][_0x51ba('0x22')](_0xbdda95['body'],{'raw':_0xbdda95[_0x51ba('0x18')]?_0xbdda95[_0x51ba('0x18')][_0x51ba('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbdda95['options']?_0xbdda95[_0x51ba('0x18')][_0x51ba('0x23')]||null:null,'attributes':_0xbdda95['options']?_0xbdda95['options'][_0x51ba('0x1a')]||null:null,'limit':_0xbdda95['options']?_0xbdda95['options'][_0x51ba('0x1b')]||null:null})[_0x51ba('0x9')](function(_0x15ed45){logger[_0x51ba('0xa')](_0x51ba('0x21'),_0xbdda95);logger[_0x51ba('0xd')](_0x51ba('0x21'),_0xbdda95,JSON['stringify'](_0x15ed45));_0x18703f(_0x15ed45);})[_0x51ba('0x14')](function(_0x10b2d4){logger[_0x51ba('0x10')](_0x51ba('0x21'),_0x10b2d4[_0x51ba('0x12')],_0xbdda95);_0x50c878(_0x55d5aa[_0x51ba('0x10')](0x1f4,_0x10b2d4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3b170c6..ddfc14c 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 _0x108f=['delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x5a5c63,_0x103cb2){var _0x236cbb=function(_0x1bed8d){while(--_0x1bed8d){_0x5a5c63['push'](_0x5a5c63['shift']());}};_0x236cbb(++_0x103cb2);}(_0x108f,0xbe));var _0xf108=function(_0x61af52,_0x7a7270){_0x61af52=_0x61af52-0x0;var _0xc944a6=_0x108f[_0x61af52];return _0xc944a6;};'use strict';var multer=require(_0xf108('0x0'));var util=require(_0xf108('0x1'));var path=require(_0xf108('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf108('0x3')]();var fs_extra=require(_0xf108('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf108('0x5'));var config=require('../../config/environment');var controller=require(_0xf108('0x6'));router[_0xf108('0x7')]('/',auth[_0xf108('0x8')](),controller[_0xf108('0x9')]);router['get'](_0xf108('0xa'),auth[_0xf108('0x8')](),controller[_0xf108('0xb')]);router[_0xf108('0xc')]('/',auth[_0xf108('0x8')](),controller['create']);router[_0xf108('0xd')](_0xf108('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf108('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf108('0xf')]);module[_0xf108('0x10')]=router; \ No newline at end of file +var _0x9a8a=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy','multer','util'];(function(_0x2d4138,_0x36acdd){var _0x2f928e=function(_0x1d2a21){while(--_0x1d2a21){_0x2d4138['push'](_0x2d4138['shift']());}};_0x2f928e(++_0x36acdd);}(_0x9a8a,0x1d2));var _0xa9a8=function(_0x4040fb,_0x4d98e1){_0x4040fb=_0x4040fb-0x0;var _0x9ae414=_0x9a8a[_0x4040fb];return _0x9ae414;};'use strict';var multer=require(_0xa9a8('0x0'));var util=require(_0xa9a8('0x1'));var path=require(_0xa9a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa9a8('0x3'));var router=express[_0xa9a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa9a8('0x5'));var interaction=require(_0xa9a8('0x6'));var config=require(_0xa9a8('0x7'));var controller=require(_0xa9a8('0x8'));router['get']('/',auth[_0xa9a8('0x9')](),controller['index']);router[_0xa9a8('0xa')](_0xa9a8('0xb'),auth[_0xa9a8('0x9')](),controller[_0xa9a8('0xc')]);router[_0xa9a8('0xd')]('/',auth[_0xa9a8('0x9')](),controller[_0xa9a8('0xe')]);router[_0xa9a8('0xf')]('/:id',auth[_0xa9a8('0x9')](),controller[_0xa9a8('0x10')]);router['delete']('/:id',auth[_0xa9a8('0x9')](),controller[_0xa9a8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3e4a7c7..551d0f1 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 _0xbb5c=['getDataValue','BOOLEAN','sequelize','STRING','setDataValue','join','options'];(function(_0x2a27d2,_0x1194e5){var _0x18f683=function(_0x553e0d){while(--_0x553e0d){_0x2a27d2['push'](_0x2a27d2['shift']());}};_0x18f683(++_0x1194e5);}(_0xbb5c,0xd4));var _0xcbb5=function(_0x1bdb0c,_0x18a492){_0x1bdb0c=_0x1bdb0c-0x0;var _0x3de4ee=_0xbb5c[_0x1bdb0c];return _0x3de4ee;};'use strict';var Sequelize=require(_0xcbb5('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbb5('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x21bd5e){this[_0xcbb5('0x2')]('options',_0x21bd5e?_0x21bd5e[_0xcbb5('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xcbb5('0x4'))?this[_0xcbb5('0x5')](_0xcbb5('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xcbb5('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xcbb5('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xcbb5('0x1')]},'description':{'type':Sequelize[_0xcbb5('0x1')]}}; \ No newline at end of file +var _0x7f56=['sequelize','exports','STRING','name','setDataValue','join','getDataValue','split','BOOLEAN'];(function(_0x2cc85c,_0x53bbb5){var _0x4f3649=function(_0xaa389c){while(--_0xaa389c){_0x2cc85c['push'](_0x2cc85c['shift']());}};_0x4f3649(++_0x53bbb5);}(_0x7f56,0x156));var _0x67f5=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x7f56[_0x2df1f2];return _0x38652b;};'use strict';var Sequelize=require(_0x67f5('0x0'));module[_0x67f5('0x1')]={'name':{'type':Sequelize[_0x67f5('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x67f5('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1cfbee){this[_0x67f5('0x4')]('options',_0x1cfbee?_0x1cfbee[_0x67f5('0x5')](''):[]);},'get':function(){return this[_0x67f5('0x6')]('options')?this[_0x67f5('0x6')]('options')[_0x67f5('0x7')](''):[];}},'auth':{'type':Sequelize[_0x67f5('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x67f5('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x67f5('0x2')]},'description':{'type':Sequelize[_0x67f5('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9667abc..1469cd2 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 _0x8ce3=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4ddfc9,_0x23f05f){_0x4ddfc9=_0x4ddfc9-0x0;var _0x47da83=_0x8ce3[_0x4ddfc9];return _0x47da83;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];function respondWithStatusCode(_0x42e234,_0x3ef662){_0x3ef662=_0x3ef662||0xcc;return function(_0x28b554){if(_0x28b554){return _0x42e234[_0x38ce('0x1b')](_0x3ef662);}return _0x42e234[_0x38ce('0x1c')](_0x3ef662)[_0x38ce('0x1d')]();};}function respondWithResult(_0x56a09f,_0x48ba7c){_0x48ba7c=_0x48ba7c||0xc8;return function(_0x3c4d7f){if(_0x3c4d7f){return _0x56a09f[_0x38ce('0x1c')](_0x48ba7c)[_0x38ce('0x1e')](_0x3c4d7f);}};}function respondWithFilteredResult(_0x55be6a,_0x2f3b99){return function(_0x54fcd3){if(_0x54fcd3){var _0x2771ec=typeof _0x2f3b99[_0x38ce('0x1f')]==='undefined'&&typeof _0x2f3b99[_0x38ce('0x20')]===_0x38ce('0x21');var _0x1dfaba=_0x54fcd3['count'];var _0xe4099a=_0x2771ec?0x0:_0x2f3b99[_0x38ce('0x1f')];var _0x3df527=_0x2771ec?_0x54fcd3[_0x38ce('0x22')]:_0x2f3b99[_0x38ce('0x1f')]+_0x2f3b99[_0x38ce('0x20')];var _0x2d4218;if(_0x3df527>=_0x1dfaba){_0x3df527=_0x1dfaba;_0x2d4218=0xc8;}else{_0x2d4218=0xce;}_0x55be6a['status'](_0x2d4218);return _0x55be6a[_0x38ce('0x23')](_0x38ce('0x24'),_0xe4099a+'-'+_0x3df527+'/'+_0x1dfaba)[_0x38ce('0x1e')](_0x54fcd3);}return null;};}function patchUpdates(_0x303391){return function(_0x30b060){try{jsonpatch[_0x38ce('0x25')](_0x30b060,_0x303391,!![]);}catch(_0x323490){return BPromise[_0x38ce('0x26')](_0x323490);}return _0x30b060[_0x38ce('0x27')]();};}function saveUpdates(_0x3cf50b,_0x1aace7){return function(_0x580cf3){if(_0x580cf3){return _0x580cf3[_0x38ce('0x28')](_0x3cf50b)[_0x38ce('0x29')](function(_0xe40e9c){return _0xe40e9c;});}return null;};}function removeEntity(_0xcf5d9e,_0x4a56b0){return function(_0x2c85e6){if(_0x2c85e6){return _0x2c85e6[_0x38ce('0x2a')]()['then'](function(){var _0xe0af00=_0x2c85e6[_0x38ce('0x2b')]({'plain':!![]});var _0x43b479='ChanSpies';return db['UserProfileResource'][_0x38ce('0x2a')]({'where':{'type':_0x43b479,'resourceId':_0xe0af00['id']}})[_0x38ce('0x29')](function(){return _0x2c85e6;});})[_0x38ce('0x29')](function(){_0xcf5d9e[_0x38ce('0x1c')](0xcc)[_0x38ce('0x1d')]();});}};}function handleEntityNotFound(_0x2a59fe,_0x13e2fc){return function(_0xce1f64){if(!_0xce1f64){_0x2a59fe[_0x38ce('0x1b')](0x194);}return _0xce1f64;};}function handleError(_0x4649be,_0xfc590a){_0xfc590a=_0xfc590a||0x1f4;return function(_0x381703){logger['error'](_0x381703[_0x38ce('0x2c')]);if(_0x381703[_0x38ce('0x2d')]){delete _0x381703['name'];}_0x4649be[_0x38ce('0x1c')](_0xfc590a)[_0x38ce('0x2e')](_0x381703);};}exports['index']=function(_0xd96d33,_0x282ee4){var _0x568d94={},_0x28d775={},_0x53f2c9={'count':0x0,'rows':[]};var _0x1aa8fb=_[_0x38ce('0x2f')](db[_0x38ce('0x30')][_0x38ce('0x31')],function(_0x444b93){return{'name':_0x444b93[_0x38ce('0x32')],'type':_0x444b93[_0x38ce('0x33')][_0x38ce('0x34')]};});_0x28d775['model']=_['map'](_0x1aa8fb,_0x38ce('0x2d'));_0x28d775[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xd96d33[_0x38ce('0x35')]);_0x28d775[_0x38ce('0x37')]=_['intersection'](_0x28d775[_0x38ce('0x38')],_0x28d775[_0x38ce('0x35')]);_0x568d94[_0x38ce('0x39')]=_[_0x38ce('0x3a')](_0x28d775[_0x38ce('0x38')],qs[_0x38ce('0x3b')](_0xd96d33[_0x38ce('0x35')]['fields']));_0x568d94[_0x38ce('0x39')]=_0x568d94[_0x38ce('0x39')]['length']?_0x568d94[_0x38ce('0x39')]:_0x28d775[_0x38ce('0x38')];if(!_0xd96d33[_0x38ce('0x35')][_0x38ce('0x3c')](_0x38ce('0x3d'))){_0x568d94[_0x38ce('0x20')]=qs[_0x38ce('0x20')](_0xd96d33[_0x38ce('0x35')]['limit']);_0x568d94[_0x38ce('0x1f')]=qs[_0x38ce('0x1f')](_0xd96d33[_0x38ce('0x35')][_0x38ce('0x1f')]);}_0x568d94['order']=qs[_0x38ce('0x3e')](_0xd96d33['query'][_0x38ce('0x3e')]);_0x568d94[_0x38ce('0x3f')]=qs[_0x38ce('0x37')](_[_0x38ce('0x40')](_0xd96d33[_0x38ce('0x35')],_0x28d775[_0x38ce('0x37')]),_0x1aa8fb);if(_0xd96d33['query'][_0x38ce('0x41')]){_0x568d94['where']=_[_0x38ce('0x42')](_0x568d94[_0x38ce('0x3f')],{'$or':_[_0x38ce('0x2f')](_0x1aa8fb,function(_0x37b738){if(_0x37b738[_0x38ce('0x33')]!==_0x38ce('0x43')){var _0x5209ee={};_0x5209ee[_0x37b738[_0x38ce('0x2d')]]={'$like':'%'+_0xd96d33[_0x38ce('0x35')][_0x38ce('0x41')]+'%'};return _0x5209ee;}})});}_0x568d94=_[_0x38ce('0x42')]({},_0x568d94,_0xd96d33[_0x38ce('0x44')]);var _0x467d3e={'where':_0x568d94['where']};return db['VoiceChanSpy'][_0x38ce('0x22')](_0x467d3e)[_0x38ce('0x29')](function(_0x174c86){_0x53f2c9[_0x38ce('0x22')]=_0x174c86;if(_0xd96d33[_0x38ce('0x35')][_0x38ce('0x45')]){_0x568d94[_0x38ce('0x46')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x38ce('0x47')](_0x568d94);})[_0x38ce('0x29')](function(_0x5a689b){_0x53f2c9[_0x38ce('0x48')]=_0x5a689b;return _0x53f2c9;})[_0x38ce('0x29')](respondWithFilteredResult(_0x282ee4,_0x568d94))[_0x38ce('0x49')](handleError(_0x282ee4,null));};exports['show']=function(_0xaf99ce,_0xd95bc8){var _0x33f6a6={'raw':![],'where':{'id':_0xaf99ce[_0x38ce('0x4a')]['id']}},_0x981068={};_0x981068[_0x38ce('0x38')]=_['keys'](db[_0x38ce('0x30')][_0x38ce('0x31')]);_0x981068[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xaf99ce[_0x38ce('0x35')]);_0x981068[_0x38ce('0x37')]=_['intersection'](_0x981068[_0x38ce('0x38')],_0x981068[_0x38ce('0x35')]);_0x33f6a6['attributes']=_['intersection'](_0x981068['model'],qs[_0x38ce('0x3b')](_0xaf99ce[_0x38ce('0x35')]['fields']));_0x33f6a6['attributes']=_0x33f6a6[_0x38ce('0x39')]['length']?_0x33f6a6[_0x38ce('0x39')]:_0x981068['model'];if(_0xaf99ce[_0x38ce('0x35')][_0x38ce('0x45')]){_0x33f6a6['include']=[{'all':!![]}];}_0x33f6a6=_[_0x38ce('0x42')]({},_0x33f6a6,_0xaf99ce[_0x38ce('0x44')]);return db['VoiceChanSpy'][_0x38ce('0x4b')](_0x33f6a6)[_0x38ce('0x29')](handleEntityNotFound(_0xd95bc8,null))[_0x38ce('0x29')](respondWithResult(_0xd95bc8,null))[_0x38ce('0x49')](handleError(_0xd95bc8,null));};exports[_0x38ce('0x4c')]=function(_0x25a299,_0x58cc6f){return db[_0x38ce('0x30')][_0x38ce('0x4c')](_0x25a299['body'],{})[_0x38ce('0x29')](function(_0x316eec){var _0x429517=_0x25a299[_0x38ce('0x4d')][_0x38ce('0x2b')]({'plain':!![]});if(!_0x429517)throw new Error(_0x38ce('0x4e'));if(_0x429517[_0x38ce('0x4f')]==='user'){var _0x3e1522=_0x316eec[_0x38ce('0x2b')]({'plain':!![]});var _0x3f88df=_0x38ce('0x50');return db[_0x38ce('0x51')][_0x38ce('0x4b')]({'where':{'name':_0x3f88df,'userProfileId':_0x429517['userProfileId']},'raw':!![]})['then'](function(_0xc2c9d3){if(_0xc2c9d3&&_0xc2c9d3[_0x38ce('0x52')]===0x0){return db[_0x38ce('0x53')][_0x38ce('0x4c')]({'name':_0x3e1522[_0x38ce('0x2d')],'resourceId':_0x3e1522['id'],'type':_0xc2c9d3[_0x38ce('0x2d')],'sectionId':_0xc2c9d3['id']},{})['then'](function(){return _0x316eec;});}else{return _0x316eec;}})['catch'](function(_0x199c5b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x199c5b);throw _0x199c5b;});}return _0x316eec;})[_0x38ce('0x29')](respondWithResult(_0x58cc6f,0xc9))[_0x38ce('0x49')](handleError(_0x58cc6f,null));};exports[_0x38ce('0x28')]=function(_0xbe5626,_0xd031c0){if(_0xbe5626['body']['id']){delete _0xbe5626[_0x38ce('0x54')]['id'];}return db[_0x38ce('0x30')][_0x38ce('0x4b')]({'where':{'id':_0xbe5626[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0xd031c0,null))[_0x38ce('0x29')](saveUpdates(_0xbe5626[_0x38ce('0x54')],null))[_0x38ce('0x29')](respondWithResult(_0xd031c0,null))[_0x38ce('0x49')](handleError(_0xd031c0,null));};exports[_0x38ce('0x2a')]=function(_0x2db125,_0x56d63e){return db['VoiceChanSpy'][_0x38ce('0x4b')]({'where':{'id':_0x2db125[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0x56d63e,null))[_0x38ce('0x29')](removeEntity(_0x56d63e,null))['catch'](handleError(_0x56d63e,null));}; \ No newline at end of file +var _0x80c7=['end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','includeAll','findAll','catch','show','intersection','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x146bf6,_0x4ba843){var _0x2489fe=function(_0x7e07e2){while(--_0x7e07e2){_0x146bf6['push'](_0x146bf6['shift']());}};_0x2489fe(++_0x4ba843);}(_0x80c7,0x8d));var _0x780c=function(_0x11dfcc,_0x21a509){_0x11dfcc=_0x11dfcc-0x0;var _0x9264d6=_0x80c7[_0x11dfcc];return _0x9264d6;};'use strict';var emlformat=require(_0x780c('0x0'));var rimraf=require(_0x780c('0x1'));var zipdir=require(_0x780c('0x2'));var jsonpatch=require(_0x780c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x780c('0x4'));var Mustache=require('mustache');var util=require(_0x780c('0x5'));var path=require(_0x780c('0x6'));var sox=require(_0x780c('0x7'));var csv=require(_0x780c('0x8'));var ejs=require(_0x780c('0x9'));var fs=require('fs');var fs_extra=require(_0x780c('0xa'));var _=require(_0x780c('0xb'));var squel=require(_0x780c('0xc'));var crypto=require(_0x780c('0xd'));var jsforce=require(_0x780c('0xe'));var deskjs=require(_0x780c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x780c('0x10'));var Papa=require(_0x780c('0x11'));var Redis=require('ioredis');var authService=require(_0x780c('0x12'));var qs=require(_0x780c('0x13'));var as=require(_0x780c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x780c('0x15'))(_0x780c('0x16'));var utils=require(_0x780c('0x17'));var config=require(_0x780c('0x18'));var licenseUtil=require(_0x780c('0x19'));var db=require(_0x780c('0x1a'))['db'];function respondWithStatusCode(_0x2b09af,_0x5a5986){_0x5a5986=_0x5a5986||0xcc;return function(_0x3aaa99){if(_0x3aaa99){return _0x2b09af[_0x780c('0x1b')](_0x5a5986);}return _0x2b09af[_0x780c('0x1c')](_0x5a5986)[_0x780c('0x1d')]();};}function respondWithResult(_0x5576e9,_0x4ea5df){_0x4ea5df=_0x4ea5df||0xc8;return function(_0x244934){if(_0x244934){return _0x5576e9[_0x780c('0x1c')](_0x4ea5df)['json'](_0x244934);}};}function respondWithFilteredResult(_0x5b74fb,_0x2c8c23){return function(_0xccd8c){if(_0xccd8c){var _0x21b69b=typeof _0x2c8c23[_0x780c('0x1e')]===_0x780c('0x1f')&&typeof _0x2c8c23[_0x780c('0x20')]==='undefined';var _0x45258b=_0xccd8c[_0x780c('0x21')];var _0x2127e2=_0x21b69b?0x0:_0x2c8c23[_0x780c('0x1e')];var _0x48e6fe=_0x21b69b?_0xccd8c[_0x780c('0x21')]:_0x2c8c23[_0x780c('0x1e')]+_0x2c8c23[_0x780c('0x20')];var _0x3d5269;if(_0x48e6fe>=_0x45258b){_0x48e6fe=_0x45258b;_0x3d5269=0xc8;}else{_0x3d5269=0xce;}_0x5b74fb['status'](_0x3d5269);return _0x5b74fb[_0x780c('0x22')](_0x780c('0x23'),_0x2127e2+'-'+_0x48e6fe+'/'+_0x45258b)['json'](_0xccd8c);}return null;};}function patchUpdates(_0x4f665d){return function(_0x5cccd3){try{jsonpatch[_0x780c('0x24')](_0x5cccd3,_0x4f665d,!![]);}catch(_0xe4e284){return BPromise[_0x780c('0x25')](_0xe4e284);}return _0x5cccd3[_0x780c('0x26')]();};}function saveUpdates(_0x444905,_0x21e720){return function(_0x2c66c5){if(_0x2c66c5){return _0x2c66c5[_0x780c('0x27')](_0x444905)[_0x780c('0x28')](function(_0x21b68a){return _0x21b68a;});}return null;};}function removeEntity(_0x1d0c8a,_0x55fc81){return function(_0x226f7b){if(_0x226f7b){return _0x226f7b[_0x780c('0x29')]()[_0x780c('0x28')](function(){var _0x54d835=_0x226f7b[_0x780c('0x2a')]({'plain':!![]});var _0x121199=_0x780c('0x2b');return db[_0x780c('0x2c')][_0x780c('0x29')]({'where':{'type':_0x121199,'resourceId':_0x54d835['id']}})[_0x780c('0x28')](function(){return _0x226f7b;});})['then'](function(){_0x1d0c8a[_0x780c('0x1c')](0xcc)[_0x780c('0x1d')]();});}};}function handleEntityNotFound(_0x207dc8,_0x56ca81){return function(_0x2d9702){if(!_0x2d9702){_0x207dc8[_0x780c('0x1b')](0x194);}return _0x2d9702;};}function handleError(_0x3be361,_0x436fca){_0x436fca=_0x436fca||0x1f4;return function(_0x26708b){logger[_0x780c('0x2d')](_0x26708b[_0x780c('0x2e')]);if(_0x26708b[_0x780c('0x2f')]){delete _0x26708b[_0x780c('0x2f')];}_0x3be361[_0x780c('0x1c')](_0x436fca)[_0x780c('0x30')](_0x26708b);};}exports[_0x780c('0x31')]=function(_0x1bed68,_0x1216b4){var _0x583b15={},_0x3893ca={},_0x3687a1={'count':0x0,'rows':[]};var _0x41ddec=_[_0x780c('0x32')](db[_0x780c('0x33')][_0x780c('0x34')],function(_0x5ebdae){return{'name':_0x5ebdae[_0x780c('0x35')],'type':_0x5ebdae[_0x780c('0x36')][_0x780c('0x37')]};});_0x3893ca[_0x780c('0x38')]=_['map'](_0x41ddec,'name');_0x3893ca[_0x780c('0x39')]=_[_0x780c('0x3a')](_0x1bed68['query']);_0x3893ca['filters']=_['intersection'](_0x3893ca[_0x780c('0x38')],_0x3893ca[_0x780c('0x39')]);_0x583b15[_0x780c('0x3b')]=_['intersection'](_0x3893ca[_0x780c('0x38')],qs['fields'](_0x1bed68['query'][_0x780c('0x3c')]));_0x583b15[_0x780c('0x3b')]=_0x583b15[_0x780c('0x3b')][_0x780c('0x3d')]?_0x583b15[_0x780c('0x3b')]:_0x3893ca[_0x780c('0x38')];if(!_0x1bed68['query'][_0x780c('0x3e')](_0x780c('0x3f'))){_0x583b15['limit']=qs['limit'](_0x1bed68[_0x780c('0x39')][_0x780c('0x20')]);_0x583b15[_0x780c('0x1e')]=qs[_0x780c('0x1e')](_0x1bed68[_0x780c('0x39')][_0x780c('0x1e')]);}_0x583b15[_0x780c('0x40')]=qs[_0x780c('0x41')](_0x1bed68[_0x780c('0x39')][_0x780c('0x41')]);_0x583b15['where']=qs[_0x780c('0x42')](_[_0x780c('0x43')](_0x1bed68['query'],_0x3893ca[_0x780c('0x42')]),_0x41ddec);if(_0x1bed68[_0x780c('0x39')]['filter']){_0x583b15[_0x780c('0x44')]=_['merge'](_0x583b15[_0x780c('0x44')],{'$or':_[_0x780c('0x32')](_0x41ddec,function(_0x1cb136){if(_0x1cb136['type']!=='VIRTUAL'){var _0x2a341d={};_0x2a341d[_0x1cb136[_0x780c('0x2f')]]={'$like':'%'+_0x1bed68[_0x780c('0x39')][_0x780c('0x45')]+'%'};return _0x2a341d;}})});}_0x583b15=_[_0x780c('0x46')]({},_0x583b15,_0x1bed68[_0x780c('0x47')]);var _0x35631a={'where':_0x583b15[_0x780c('0x44')]};return db['VoiceChanSpy'][_0x780c('0x21')](_0x35631a)[_0x780c('0x28')](function(_0x5db660){_0x3687a1[_0x780c('0x21')]=_0x5db660;if(_0x1bed68[_0x780c('0x39')][_0x780c('0x48')]){_0x583b15['include']=[{'all':!![]}];}return db[_0x780c('0x33')][_0x780c('0x49')](_0x583b15);})[_0x780c('0x28')](function(_0x4be864){_0x3687a1['rows']=_0x4be864;return _0x3687a1;})[_0x780c('0x28')](respondWithFilteredResult(_0x1216b4,_0x583b15))[_0x780c('0x4a')](handleError(_0x1216b4,null));};exports[_0x780c('0x4b')]=function(_0x466989,_0x342845){var _0xf92f31={'raw':![],'where':{'id':_0x466989['params']['id']}},_0x3a00c8={};_0x3a00c8['model']=_[_0x780c('0x3a')](db[_0x780c('0x33')][_0x780c('0x34')]);_0x3a00c8[_0x780c('0x39')]=_[_0x780c('0x3a')](_0x466989[_0x780c('0x39')]);_0x3a00c8[_0x780c('0x42')]=_[_0x780c('0x4c')](_0x3a00c8['model'],_0x3a00c8[_0x780c('0x39')]);_0xf92f31[_0x780c('0x3b')]=_[_0x780c('0x4c')](_0x3a00c8['model'],qs['fields'](_0x466989[_0x780c('0x39')][_0x780c('0x3c')]));_0xf92f31[_0x780c('0x3b')]=_0xf92f31[_0x780c('0x3b')][_0x780c('0x3d')]?_0xf92f31['attributes']:_0x3a00c8[_0x780c('0x38')];if(_0x466989[_0x780c('0x39')]['includeAll']){_0xf92f31['include']=[{'all':!![]}];}_0xf92f31=_[_0x780c('0x46')]({},_0xf92f31,_0x466989['options']);return db['VoiceChanSpy']['find'](_0xf92f31)[_0x780c('0x28')](handleEntityNotFound(_0x342845,null))['then'](respondWithResult(_0x342845,null))[_0x780c('0x4a')](handleError(_0x342845,null));};exports['create']=function(_0x2deec6,_0x4eda4f){return db[_0x780c('0x33')][_0x780c('0x4d')](_0x2deec6[_0x780c('0x4e')],{})[_0x780c('0x28')](function(_0x16348a){var _0x44c883=_0x2deec6[_0x780c('0x4f')][_0x780c('0x2a')]({'plain':!![]});if(!_0x44c883)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44c883[_0x780c('0x50')]===_0x780c('0x4f')){var _0x3bae2d=_0x16348a['get']({'plain':!![]});var _0xfb1e87=_0x780c('0x2b');return db['UserProfileSection'][_0x780c('0x51')]({'where':{'name':_0xfb1e87,'userProfileId':_0x44c883[_0x780c('0x52')]},'raw':!![]})[_0x780c('0x28')](function(_0x5de93e){if(_0x5de93e&&_0x5de93e[_0x780c('0x53')]===0x0){return db['UserProfileResource'][_0x780c('0x4d')]({'name':_0x3bae2d[_0x780c('0x2f')],'resourceId':_0x3bae2d['id'],'type':_0x5de93e[_0x780c('0x2f')],'sectionId':_0x5de93e['id']},{})['then'](function(){return _0x16348a;});}else{return _0x16348a;}})['catch'](function(_0x56131f){logger[_0x780c('0x2d')](_0x780c('0x54'),_0x56131f);throw _0x56131f;});}return _0x16348a;})[_0x780c('0x28')](respondWithResult(_0x4eda4f,0xc9))['catch'](handleError(_0x4eda4f,null));};exports['update']=function(_0x5d8088,_0x50ea62){if(_0x5d8088[_0x780c('0x4e')]['id']){delete _0x5d8088[_0x780c('0x4e')]['id'];}return db[_0x780c('0x33')][_0x780c('0x51')]({'where':{'id':_0x5d8088['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x50ea62,null))['then'](saveUpdates(_0x5d8088[_0x780c('0x4e')],null))[_0x780c('0x28')](respondWithResult(_0x50ea62,null))['catch'](handleError(_0x50ea62,null));};exports[_0x780c('0x29')]=function(_0x4d83b4,_0x28c876){return db['VoiceChanSpy'][_0x780c('0x51')]({'where':{'id':_0x4d83b4['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x28c876,null))[_0x780c('0x28')](removeEntity(_0x28c876,null))[_0x780c('0x4a')](handleError(_0x28c876,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 35dfd80..f7c2b4d 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 _0xf294=['record','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','agent','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','then','catch','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy'];(function(_0x49ebed,_0x2ed245){var _0x247194=function(_0x5384b9){while(--_0x5384b9){_0x49ebed['push'](_0x49ebed['shift']());}};_0x247194(++_0x2ed245);}(_0xf294,0xfb));var _0x4f29=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xf294[_0x2ac4af];return _0x3a36df;};'use strict';var _=require(_0x4f29('0x0'));var util=require(_0x4f29('0x1'));var BPromise=require(_0x4f29('0x2'));var attributes=require(_0x4f29('0x3'));var getUserApplications=function(_0x30cd98,_0x3970eb,_0x40d338){var _0x12a954=0x1;var _0x4158c1=[];var _0x51003c={'context':_0x3970eb[_0x4f29('0x4')]||_0x4f29('0x5'),'exten':util['format'](_0x4f29('0x6'),_0x30cd98[_0x4f29('0x7')],_0x40d338),'type':_0x4f29('0x8'),'isApp':![],'ChanSpyId':_0x30cd98['id'],'UserId':_0x3970eb['id']};_0x4158c1[_0x4f29('0x9')](_[_0x4f29('0xa')]({'app':_0x4f29('0xb'),'appdata':util[_0x4f29('0xc')](_0x4f29('0xd'),_0x4f29('0xe')),'priority':_0x12a954++},_0x51003c));if(_0x30cd98[_0x4f29('0xf')]){_0x4158c1[_0x4f29('0x9')](_[_0x4f29('0xa')]({'app':_0x4f29('0x10'),'appdata':util[_0x4f29('0xc')](_0x4f29('0x11'),_0x30cd98['recordingFormat']),'priority':_0x12a954++},_0x51003c));}if(_0x30cd98[_0x4f29('0x12')]){_0x4158c1['push'](_[_0x4f29('0xa')]({'app':'Authenticate','appdata':_0x30cd98[_0x4f29('0x13')],'priority':_0x12a954++},_0x51003c));}_0x4158c1[_0x4f29('0x9')](_[_0x4f29('0xa')]({'app':_0x4f29('0x14'),'appdata':util['format']('SIP/%s,%s',_0x3970eb[_0x4f29('0x15')],_0x30cd98['options']?_0x30cd98[_0x4f29('0x16')][_0x4f29('0x17')](''):''),'priority':_0x12a954++},_0x51003c));if(_0x30cd98['record']){_0x4158c1['push'](_[_0x4f29('0xa')]({'app':_0x4f29('0x18'),'priority':_0x12a954++},_0x51003c));}return _0x4158c1;};var getChanSpyApplications=function(_0x36959d,_0x2bb0d6){var _0x104ea0=[];for(var _0x1731e4=0x0,_0x111d17=0x1;_0x1731e4<_0x2bb0d6[_0x4f29('0x19')];_0x1731e4++,_0x111d17=0x1){_0x104ea0=_0x104ea0[_0x4f29('0x1a')](getUserApplications(_0x36959d,_0x2bb0d6[_0x1731e4],_0x2bb0d6[_0x1731e4][_0x4f29('0x1b')]));if(_0x2bb0d6[_0x1731e4]['internal']!=_0x2bb0d6[_0x1731e4][_0x4f29('0x15')]){_0x104ea0=_0x104ea0[_0x4f29('0x1a')](getUserApplications(_0x36959d,_0x2bb0d6[_0x1731e4],_0x2bb0d6[_0x1731e4][_0x4f29('0x15')]));}}return _0x104ea0;};var getChanSpyPromise=function(_0x4e6d06,_0xc3cdf){return new BPromise(function(_0x2abe58,_0x573009){return _0x4e6d06['User']['findAll']({'attributes':['id',_0x4f29('0x15'),_0x4f29('0x1b')],'where':{'role':_0x4f29('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x336437){if(_0x336437){return _0x2abe58(getChanSpyApplications(_0xc3cdf,_0x336437));}return _0x2abe58([]);})['catch'](function(_0x2126ad){_0x573009(_0x2126ad);});});};module['exports']=function(_0x421a72,_0x23710f){var _0x3e100f=_0x421a72[_0x4f29('0x1d')];return _0x421a72[_0x4f29('0x1e')](_0x4f29('0x1f'),attributes,{'tableName':_0x4f29('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xea7bc4,_0x202786,_0x1e23b1){return getChanSpyPromise(_0x3e100f,_0xea7bc4)['then'](function(_0xa68414){if(_0xa68414&&_0xa68414[_0x4f29('0x19')]){return _0x3e100f[_0x4f29('0x21')]['bulkCreate'](_0xa68414);}})[_0x4f29('0x22')](function(){_0x1e23b1();})[_0x4f29('0x23')](function(_0x597fdb){_0x1e23b1(_0x597fdb);});},'afterUpdate':function(_0x3ca54e,_0x2001ae,_0x362df4){return _0x3e100f[_0x4f29('0x21')][_0x4f29('0x24')]({'where':{'ChanSpyId':_0x3ca54e['id']}})[_0x4f29('0x22')](function(){return getChanSpyPromise(_0x3e100f,_0x3ca54e);})[_0x4f29('0x22')](function(_0x1bb14d){if(_0x1bb14d&&_0x1bb14d[_0x4f29('0x19')]){return _0x3e100f[_0x4f29('0x21')][_0x4f29('0x25')](_0x1bb14d);}})['then'](function(){_0x362df4();})['catch'](function(_0x931c0c){_0x362df4(_0x931c0c);});},'afterDestroy':function(_0x2f0314,_0x325351,_0x1077a9){return _0x3e100f['VoiceExtension'][_0x4f29('0x24')]({'where':{'ChanSpyId':_0x2f0314['id']}})['then'](function(){_0x1077a9();})[_0x4f29('0x23')](function(_0x177204){_0x1077a9(_0x177204);});}}});}; \ No newline at end of file +var _0x3dde=['format','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','length','internal','concat','User','agent','catch','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','Set'];(function(_0x2bce18,_0x37f1ca){var _0x1f2fa5=function(_0x279c94){while(--_0x279c94){_0x2bce18['push'](_0x2bce18['shift']());}};_0x1f2fa5(++_0x37f1ca);}(_0x3dde,0x1a6));var _0xe3dd=function(_0x19b980,_0x40c574){_0x19b980=_0x19b980-0x0;var _0x320fd8=_0x3dde[_0x19b980];return _0x320fd8;};'use strict';var _=require('lodash');var util=require(_0xe3dd('0x0'));var BPromise=require(_0xe3dd('0x1'));var attributes=require(_0xe3dd('0x2'));var getUserApplications=function(_0x467458,_0x549cbf,_0x1f40bc){var _0xbb329c=0x1;var _0x1858c1=[];var _0x4a2a26={'context':_0x549cbf[_0xe3dd('0x3')]||_0xe3dd('0x4'),'exten':util['format'](_0xe3dd('0x5'),_0x467458[_0xe3dd('0x6')],_0x1f40bc),'type':_0xe3dd('0x7'),'isApp':![],'ChanSpyId':_0x467458['id'],'UserId':_0x549cbf['id']};_0x1858c1[_0xe3dd('0x8')](_['merge']({'app':_0xe3dd('0x9'),'appdata':util[_0xe3dd('0xa')](_0xe3dd('0xb'),'chanspy'),'priority':_0xbb329c++},_0x4a2a26));if(_0x467458[_0xe3dd('0xc')]){_0x1858c1['push'](_[_0xe3dd('0xd')]({'app':_0xe3dd('0xe'),'appdata':util[_0xe3dd('0xa')](_0xe3dd('0xf'),_0x467458['recordingFormat']),'priority':_0xbb329c++},_0x4a2a26));}if(_0x467458[_0xe3dd('0x10')]){_0x1858c1[_0xe3dd('0x8')](_[_0xe3dd('0xd')]({'app':_0xe3dd('0x11'),'appdata':_0x467458['password'],'priority':_0xbb329c++},_0x4a2a26));}_0x1858c1[_0xe3dd('0x8')](_[_0xe3dd('0xd')]({'app':_0xe3dd('0x12'),'appdata':util[_0xe3dd('0xa')](_0xe3dd('0x13'),_0x549cbf[_0xe3dd('0x14')],_0x467458[_0xe3dd('0x15')]?_0x467458[_0xe3dd('0x15')][_0xe3dd('0x16')](''):''),'priority':_0xbb329c++},_0x4a2a26));if(_0x467458['record']){_0x1858c1[_0xe3dd('0x8')](_[_0xe3dd('0xd')]({'app':'StopMixMonitor','priority':_0xbb329c++},_0x4a2a26));}return _0x1858c1;};var getChanSpyApplications=function(_0x34329b,_0x205eb3){var _0x4319b4=[];for(var _0x4c06a3=0x0,_0x422dcc=0x1;_0x4c06a3<_0x205eb3[_0xe3dd('0x17')];_0x4c06a3++,_0x422dcc=0x1){_0x4319b4=_0x4319b4['concat'](getUserApplications(_0x34329b,_0x205eb3[_0x4c06a3],_0x205eb3[_0x4c06a3]['internal']));if(_0x205eb3[_0x4c06a3][_0xe3dd('0x18')]!=_0x205eb3[_0x4c06a3]['name']){_0x4319b4=_0x4319b4[_0xe3dd('0x19')](getUserApplications(_0x34329b,_0x205eb3[_0x4c06a3],_0x205eb3[_0x4c06a3][_0xe3dd('0x14')]));}}return _0x4319b4;};var getChanSpyPromise=function(_0x289255,_0x2ba2d8){return new BPromise(function(_0x430c33,_0x353f90){return _0x289255[_0xe3dd('0x1a')]['findAll']({'attributes':['id',_0xe3dd('0x14'),'internal'],'where':{'role':_0xe3dd('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x569e6a){if(_0x569e6a){return _0x430c33(getChanSpyApplications(_0x2ba2d8,_0x569e6a));}return _0x430c33([]);})[_0xe3dd('0x1c')](function(_0x17e9ca){_0x353f90(_0x17e9ca);});});};module['exports']=function(_0x1a61e6,_0x2fbb5b){var _0x272803=_0x1a61e6['models'];return _0x1a61e6[_0xe3dd('0x1d')](_0xe3dd('0x1e'),attributes,{'tableName':_0xe3dd('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49d602,_0x5893b2,_0xc8d221){return getChanSpyPromise(_0x272803,_0x49d602)[_0xe3dd('0x20')](function(_0x67f6ff){if(_0x67f6ff&&_0x67f6ff['length']){return _0x272803[_0xe3dd('0x21')][_0xe3dd('0x22')](_0x67f6ff);}})[_0xe3dd('0x20')](function(){_0xc8d221();})[_0xe3dd('0x1c')](function(_0x5e8c95){_0xc8d221(_0x5e8c95);});},'afterUpdate':function(_0x48bf79,_0x2f7bf5,_0x25729e){return _0x272803[_0xe3dd('0x21')][_0xe3dd('0x23')]({'where':{'ChanSpyId':_0x48bf79['id']}})[_0xe3dd('0x20')](function(){return getChanSpyPromise(_0x272803,_0x48bf79);})[_0xe3dd('0x20')](function(_0x57072e){if(_0x57072e&&_0x57072e['length']){return _0x272803[_0xe3dd('0x21')][_0xe3dd('0x22')](_0x57072e);}})[_0xe3dd('0x20')](function(){_0x25729e();})[_0xe3dd('0x1c')](function(_0x2b6ed9){_0x25729e(_0x2b6ed9);});},'afterDestroy':function(_0x1a7b00,_0x57848c,_0x274675){return _0x272803[_0xe3dd('0x21')]['destroy']({'where':{'ChanSpyId':_0x1a7b00['id']}})[_0xe3dd('0x20')](function(){_0x274675();})[_0xe3dd('0x1c')](function(_0x52bfb3){_0x274675(_0x52bfb3);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index fd0a3e1..fa15fc3 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4fed19,_0x504801){var _0x414e49=function(_0x46a7fc){while(--_0x46a7fc){_0x4fed19['push'](_0x4fed19['shift']());}};_0x414e49(++_0x504801);}(_0xb43b,0x1b2));var _0xbb43=function(_0x428b81,_0x1befd5){_0x428b81=_0x428b81-0x0;var _0x50d2e4=_0xb43b[_0x428b81];return _0x50d2e4;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('VoiceChanSpy,\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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0xaa88,0x137));var _0x8aa8=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xaa88[_0x258fb0];return _0x4d1afe;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ce4d51c..afcbf82 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 _0x29b1=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated'];(function(_0x630cbf,_0x21b21e){var _0x55890f=function(_0x362311){while(--_0x362311){_0x630cbf['push'](_0x630cbf['shift']());}};_0x55890f(++_0x21b21e);}(_0x29b1,0x128));var _0x129b=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x29b1[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x129b('0x0'));var util=require('util');var path=require(_0x129b('0x1'));var timeout=require(_0x129b('0x2'));var express=require(_0x129b('0x3'));var router=express[_0x129b('0x4')]();var fs_extra=require(_0x129b('0x5'));var auth=require(_0x129b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x129b('0x7')](_0x129b('0x8'),auth[_0x129b('0x9')](),controller[_0x129b('0xa')]);router[_0x129b('0xb')]('/',auth[_0x129b('0x9')](),controller[_0x129b('0xc')]);router[_0x129b('0xd')]('/:id',auth[_0x129b('0x9')](),controller[_0x129b('0xe')]);router[_0x129b('0xf')](_0x129b('0x8'),auth[_0x129b('0x9')](),controller[_0x129b('0x10')]);module[_0x129b('0x11')]=router; \ No newline at end of file +var _0xf9a2=['./voiceContext.controller','index','get','isAuthenticated','show','post','/:id','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5df38d,_0x782c86){var _0x169cf7=function(_0x2dc5d9){while(--_0x2dc5d9){_0x5df38d['push'](_0x5df38d['shift']());}};_0x169cf7(++_0x782c86);}(_0xf9a2,0x159));var _0x2f9a=function(_0x112cd4,_0x6d3433){_0x112cd4=_0x112cd4-0x0;var _0x5703c6=_0xf9a2[_0x112cd4];return _0x5703c6;};'use strict';var multer=require('multer');var util=require(_0x2f9a('0x0'));var path=require('path');var timeout=require(_0x2f9a('0x1'));var express=require('express');var router=express[_0x2f9a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2f9a('0x3'));var interaction=require(_0x2f9a('0x4'));var config=require('../../config/environment');var controller=require(_0x2f9a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2f9a('0x6')]);router[_0x2f9a('0x7')]('/:id',auth[_0x2f9a('0x8')](),controller[_0x2f9a('0x9')]);router[_0x2f9a('0xa')]('/',auth[_0x2f9a('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2f9a('0xb'),auth[_0x2f9a('0x8')](),controller[_0x2f9a('0xc')]);module[_0x2f9a('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 42c6dc7..286afd7 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 _0x6f5f=['exports','name','STRING','BOOLEAN'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x6f5f,0x13c));var _0xf6f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf6f5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6f5('0x1')},'description':{'type':Sequelize[_0xf6f5('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf6f5('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4a41=['STRING','exports'];(function(_0x23afe8,_0x3e60db){var _0xe7852f=function(_0x458a55){while(--_0x458a55){_0x23afe8['push'](_0x23afe8['shift']());}};_0xe7852f(++_0x3e60db);}(_0x4a41,0x143));var _0x14a4=function(_0x152999,_0x1dd83b){_0x152999=_0x152999-0x0;var _0x32ef67=_0x4a41[_0x152999];return _0x32ef67;};'use strict';var Sequelize=require('sequelize');module[_0x14a4('0x0')]={'name':{'type':Sequelize[_0x14a4('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x14a4('0x1')],'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 6ffcc79..d2ea16c 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 _0x23dc=['autoAssociation','params','render','utf8','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','get','Contexts','UserProfileResource','end','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3838c4,_0x319035){var _0x83098c=function(_0x3d7dc9){while(--_0x3d7dc9){_0x3838c4['push'](_0x3838c4['shift']());}};_0x83098c(++_0x319035);}(_0x23dc,0x1a8));var _0xc23d=function(_0x414060,_0x5c9adc){_0x414060=_0x414060-0x0;var _0x1e9e93=_0x23dc[_0x414060];return _0x1e9e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc23d('0x0'));var zipdir=require(_0xc23d('0x1'));var jsonpatch=require(_0xc23d('0x2'));var rp=require(_0xc23d('0x3'));var moment=require('moment');var BPromise=require(_0xc23d('0x4'));var Mustache=require(_0xc23d('0x5'));var util=require(_0xc23d('0x6'));var path=require('path');var sox=require(_0xc23d('0x7'));var csv=require(_0xc23d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc23d('0x9'));var _=require(_0xc23d('0xa'));var squel=require(_0xc23d('0xb'));var crypto=require(_0xc23d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc23d('0xd'));var toCsv=require(_0xc23d('0x8'));var querystring=require(_0xc23d('0xe'));var Papa=require(_0xc23d('0xf'));var Redis=require(_0xc23d('0x10'));var authService=require(_0xc23d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc23d('0x12'));var hardwareService=require(_0xc23d('0x13'));var logger=require(_0xc23d('0x14'))(_0xc23d('0x15'));var utils=require(_0xc23d('0x16'));var config=require(_0xc23d('0x17'));var licenseUtil=require(_0xc23d('0x18'));var db=require(_0xc23d('0x19'))['db'];var jayson=require(_0xc23d('0x1a'));var client=jayson[_0xc23d('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8825a3,_0x308277,_0x2ec4ce,_0x566047){return new BPromise(function(_0x2df205,_0x2d3fbb){var _0x50d1c5=_0x566047||client;return _0x50d1c5['request'](_0x8825a3,_0x2ec4ce)[_0xc23d('0x1c')](function(_0x3dfe70){logger[_0xc23d('0x1d')](_0xc23d('0x1e'),_0x308277,_0xc23d('0x1f'));logger[_0xc23d('0x20')](_0xc23d('0x21'),_0x308277,'request\x20sent',JSON[_0xc23d('0x22')](_0x3dfe70));if(_0x3dfe70['error']){if(_0x3dfe70[_0xc23d('0x23')]['code']===0x1f4){logger[_0xc23d('0x23')](_0xc23d('0x1e'),_0x308277,_0x3dfe70[_0xc23d('0x23')][_0xc23d('0x24')]);return _0x2d3fbb(_0x3dfe70[_0xc23d('0x23')]['message']);}logger[_0xc23d('0x23')](_0xc23d('0x1e'),_0x308277,_0x3dfe70[_0xc23d('0x23')]['message']);return _0x2df205(_0x3dfe70[_0xc23d('0x23')][_0xc23d('0x24')]);}else{logger[_0xc23d('0x1d')](_0xc23d('0x1e'),_0x308277,_0xc23d('0x1f'));_0x2df205(_0x3dfe70['result'][_0xc23d('0x24')]);}})[_0xc23d('0x25')](function(_0xceb6bb){logger[_0xc23d('0x23')]('VoiceContext,\x20%s,\x20%s',_0x308277,_0xceb6bb);_0x2d3fbb(_0xceb6bb);});});}function respondWithStatusCode(_0x151a5f,_0x35d3a3){_0x35d3a3=_0x35d3a3||0xcc;return function(_0x5c7f44){if(_0x5c7f44){return _0x151a5f[_0xc23d('0x26')](_0x35d3a3);}return _0x151a5f[_0xc23d('0x27')](_0x35d3a3)['end']();};}function respondWithResult(_0x529c4c,_0x1b8da4){_0x1b8da4=_0x1b8da4||0xc8;return function(_0x51224a){if(_0x51224a){return _0x529c4c['status'](_0x1b8da4)['json'](_0x51224a);}};}function respondWithFilteredResult(_0x4e65e0,_0x4b30ce){return function(_0x322e14){if(_0x322e14){var _0xf2f711=typeof _0x4b30ce['offset']===_0xc23d('0x28')&&typeof _0x4b30ce[_0xc23d('0x29')]===_0xc23d('0x28');var _0x22cb53=_0x322e14[_0xc23d('0x2a')];var _0x35e3ea=_0xf2f711?0x0:_0x4b30ce[_0xc23d('0x2b')];var _0x15e6a0=_0xf2f711?_0x322e14[_0xc23d('0x2a')]:_0x4b30ce[_0xc23d('0x2b')]+_0x4b30ce[_0xc23d('0x29')];var _0x285108;if(_0x15e6a0>=_0x22cb53){_0x15e6a0=_0x22cb53;_0x285108=0xc8;}else{_0x285108=0xce;}_0x4e65e0[_0xc23d('0x27')](_0x285108);return _0x4e65e0[_0xc23d('0x2c')](_0xc23d('0x2d'),_0x35e3ea+'-'+_0x15e6a0+'/'+_0x22cb53)[_0xc23d('0x2e')](_0x322e14);}return null;};}function patchUpdates(_0x231b3d){return function(_0x2ec4dc){try{jsonpatch['apply'](_0x2ec4dc,_0x231b3d,!![]);}catch(_0x4e0f29){return BPromise[_0xc23d('0x2f')](_0x4e0f29);}return _0x2ec4dc[_0xc23d('0x30')]();};}function saveUpdates(_0x3c9ca6,_0x1d3801){return function(_0x92c786){if(_0x92c786){return _0x92c786[_0xc23d('0x31')](_0x3c9ca6)[_0xc23d('0x1c')](function(_0x4ae6ef){return _0x4ae6ef;});}return null;};}function removeEntity(_0x30afd4,_0x345f12){return function(_0x2ff0fc){if(_0x2ff0fc){return _0x2ff0fc[_0xc23d('0x32')]()[_0xc23d('0x1c')](function(){var _0xbb1b=_0x2ff0fc[_0xc23d('0x33')]({'plain':!![]});var _0x367f95=_0xc23d('0x34');return db[_0xc23d('0x35')][_0xc23d('0x32')]({'where':{'type':_0x367f95,'resourceId':_0xbb1b['id']}})[_0xc23d('0x1c')](function(){return _0x2ff0fc;});})[_0xc23d('0x1c')](function(){_0x30afd4[_0xc23d('0x27')](0xcc)[_0xc23d('0x36')]();});}};}function handleEntityNotFound(_0x503364,_0x322163){return function(_0x1a527f){if(!_0x1a527f){_0x503364[_0xc23d('0x26')](0x194);}return _0x1a527f;};}function handleError(_0x1c1474,_0x501243){_0x501243=_0x501243||0x1f4;return function(_0x468bc6){logger[_0xc23d('0x23')](_0x468bc6['stack']);if(_0x468bc6[_0xc23d('0x37')]){delete _0x468bc6[_0xc23d('0x37')];}_0x1c1474[_0xc23d('0x27')](_0x501243)[_0xc23d('0x38')](_0x468bc6);};}exports[_0xc23d('0x39')]=function(_0x59f4c3,_0x38f3cd){var _0x28077={},_0x3ec27e={},_0x179647={'count':0x0,'rows':[]};var _0x4e9697=_[_0xc23d('0x3a')](db[_0xc23d('0x3b')]['rawAttributes'],function(_0x223cdd){return{'name':_0x223cdd[_0xc23d('0x3c')],'type':_0x223cdd[_0xc23d('0x3d')][_0xc23d('0x3e')]};});_0x3ec27e[_0xc23d('0x3f')]=_[_0xc23d('0x3a')](_0x4e9697,_0xc23d('0x37'));_0x3ec27e[_0xc23d('0x40')]=_[_0xc23d('0x41')](_0x59f4c3[_0xc23d('0x40')]);_0x3ec27e['filters']=_['intersection'](_0x3ec27e[_0xc23d('0x3f')],_0x3ec27e[_0xc23d('0x40')]);_0x28077['attributes']=_['intersection'](_0x3ec27e[_0xc23d('0x3f')],qs[_0xc23d('0x42')](_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x42')]));_0x28077[_0xc23d('0x43')]=_0x28077[_0xc23d('0x43')][_0xc23d('0x44')]?_0x28077['attributes']:_0x3ec27e['model'];if(!_0x59f4c3['query'][_0xc23d('0x45')](_0xc23d('0x46'))){_0x28077['limit']=qs['limit'](_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x29')]);_0x28077['offset']=qs[_0xc23d('0x2b')](_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x2b')]);}_0x28077[_0xc23d('0x47')]=qs[_0xc23d('0x48')](_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x48')]);_0x28077['where']=qs['filters'](_[_0xc23d('0x49')](_0x59f4c3[_0xc23d('0x40')],_0x3ec27e[_0xc23d('0x4a')]),_0x4e9697);if(_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x4b')]){_0x28077[_0xc23d('0x4c')]=_[_0xc23d('0x4d')](_0x28077[_0xc23d('0x4c')],{'$or':_['map'](_0x4e9697,function(_0xcf4035){if(_0xcf4035[_0xc23d('0x3d')]!==_0xc23d('0x4e')){var _0x45086d={};_0x45086d[_0xcf4035[_0xc23d('0x37')]]={'$like':'%'+_0x59f4c3['query'][_0xc23d('0x4b')]+'%'};return _0x45086d;}})});}_0x28077=_[_0xc23d('0x4d')]({},_0x28077,_0x59f4c3[_0xc23d('0x4f')]);var _0x10f802={'where':_0x28077[_0xc23d('0x4c')]};return db['VoiceContext'][_0xc23d('0x2a')](_0x10f802)[_0xc23d('0x1c')](function(_0x51aca6){_0x179647[_0xc23d('0x2a')]=_0x51aca6;if(_0x59f4c3[_0xc23d('0x40')][_0xc23d('0x50')]){_0x28077['include']=[{'all':!![]}];}return db['VoiceContext'][_0xc23d('0x51')](_0x28077);})[_0xc23d('0x1c')](function(_0x3eabaa){_0x179647[_0xc23d('0x52')]=_0x3eabaa;return _0x179647;})['then'](respondWithFilteredResult(_0x38f3cd,_0x28077))['catch'](handleError(_0x38f3cd,null));};exports[_0xc23d('0x53')]=function(_0x45f224,_0x51e303){var _0x278281={'raw':![],'where':{'id':_0x45f224['params']['id']}},_0x85a8ec={};_0x85a8ec[_0xc23d('0x3f')]=_['keys'](db[_0xc23d('0x3b')][_0xc23d('0x54')]);_0x85a8ec[_0xc23d('0x40')]=_[_0xc23d('0x41')](_0x45f224[_0xc23d('0x40')]);_0x85a8ec[_0xc23d('0x4a')]=_['intersection'](_0x85a8ec[_0xc23d('0x3f')],_0x85a8ec['query']);_0x278281[_0xc23d('0x43')]=_['intersection'](_0x85a8ec['model'],qs[_0xc23d('0x42')](_0x45f224[_0xc23d('0x40')][_0xc23d('0x42')]));_0x278281[_0xc23d('0x43')]=_0x278281['attributes'][_0xc23d('0x44')]?_0x278281[_0xc23d('0x43')]:_0x85a8ec[_0xc23d('0x3f')];if(_0x45f224[_0xc23d('0x40')][_0xc23d('0x50')]){_0x278281['include']=[{'all':!![]}];}_0x278281=_[_0xc23d('0x4d')]({},_0x278281,_0x45f224[_0xc23d('0x4f')]);return db[_0xc23d('0x3b')][_0xc23d('0x55')](_0x278281)['then'](handleEntityNotFound(_0x51e303,null))[_0xc23d('0x1c')](respondWithResult(_0x51e303,null))['catch'](handleError(_0x51e303,null));};exports[_0xc23d('0x56')]=function(_0x38eb2e,_0x543083,_0x2d1607){var _0x5a32f1;return db[_0xc23d('0x3b')][_0xc23d('0x56')](_0x38eb2e[_0xc23d('0x57')],{'raw':!![]})['then'](function(_0xe4cd2d){_0x5a32f1=_0xe4cd2d;return db[_0xc23d('0x3b')]['findAll']({'raw':!![]});})[_0xc23d('0x1c')](function(_0x464fce){var _0x4f1b64=fs[_0xc23d('0x58')](path[_0xc23d('0x59')](config[_0xc23d('0x5a')],_0xc23d('0x5b')),'utf8');var _0x1385e5=ejs['render'](_0x4f1b64,{'contexts':_0x464fce||[]});fs[_0xc23d('0x5c')](_0xc23d('0x5d'),_0x1385e5);})[_0xc23d('0x1c')](function(){return respondWithRpcPromise(_0xc23d('0x5e'),_0xc23d('0x56'),{'module':_0xc23d('0x5f')});})[_0xc23d('0x1c')](function(){var _0x48ad9a=_0x38eb2e[_0xc23d('0x60')]['get']({'plain':!![]});if(!_0x48ad9a)throw new Error(_0xc23d('0x61'));if(_0x48ad9a[_0xc23d('0x62')]===_0xc23d('0x60')){var _0x1075c6=_0x5a32f1[_0xc23d('0x33')]({'plain':!![]});return db[_0xc23d('0x63')]['find']({'where':{'name':_0xc23d('0x34'),'userProfileId':_0x48ad9a[_0xc23d('0x64')]},'raw':!![]})[_0xc23d('0x1c')](function(_0x5a09b1){if(_0x5a09b1&&_0x5a09b1[_0xc23d('0x65')]===0x0){return db[_0xc23d('0x35')][_0xc23d('0x56')]({'name':_0x1075c6[_0xc23d('0x37')],'resourceId':_0x1075c6['id'],'type':_0x5a09b1[_0xc23d('0x37')],'sectionId':_0x5a09b1['id']},{})['then'](function(){return _0x5a32f1;});}else{return _0x5a32f1;}})['catch'](function(_0x5854c1){logger[_0xc23d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5854c1);throw _0x5854c1;});}return _0x5a32f1;})[_0xc23d('0x1c')](respondWithResult(_0x543083,0xc9))[_0xc23d('0x25')](handleError(_0x543083,null));};exports[_0xc23d('0x31')]=function(_0x99a298,_0x5dbc9b,_0x2a29a2){var _0x483628;return db[_0xc23d('0x3b')][_0xc23d('0x55')]({'where':{'id':_0x99a298[_0xc23d('0x66')]['id']}})[_0xc23d('0x1c')](handleEntityNotFound(_0x5dbc9b,null))['then'](saveUpdates(_0x99a298['body'],null))[_0xc23d('0x1c')](function(_0x1da8f2){if(_0x1da8f2){_0x483628=_0x1da8f2;return db['VoiceContext'][_0xc23d('0x51')]({'raw':!![]});}})[_0xc23d('0x1c')](function(_0x24d82c){var _0x44e73e=fs['readFileSync'](path[_0xc23d('0x59')](config[_0xc23d('0x5a')],_0xc23d('0x5b')),'utf8');var _0x4d1d03=ejs[_0xc23d('0x67')](_0x44e73e,{'contexts':_0x24d82c||[]});fs[_0xc23d('0x5c')](_0xc23d('0x5d'),_0x4d1d03);})[_0xc23d('0x1c')](function(){return respondWithRpcPromise('Reload',_0xc23d('0x31'),{'module':_0xc23d('0x5f')});})[_0xc23d('0x1c')](function(){return _0x483628;})[_0xc23d('0x1c')](respondWithResult(_0x5dbc9b,null))['catch'](handleError(_0x5dbc9b,null));};exports['destroy']=function(_0x554390,_0x572a77,_0x1de147){var _0x2096b3;return db[_0xc23d('0x3b')][_0xc23d('0x55')]({'where':{'id':_0x554390[_0xc23d('0x66')]['id']}})[_0xc23d('0x1c')](handleEntityNotFound(_0x572a77,null))[_0xc23d('0x1c')](removeEntity(_0x572a77,null))['then'](function(){return db[_0xc23d('0x3b')][_0xc23d('0x51')]({'raw':!![]});})[_0xc23d('0x1c')](function(_0x5223c0){var _0x10c301=fs[_0xc23d('0x58')](path[_0xc23d('0x59')](config['root'],_0xc23d('0x5b')),_0xc23d('0x68'));var _0x2a7b2b=ejs[_0xc23d('0x67')](_0x10c301,{'contexts':_0x5223c0});fs[_0xc23d('0x5c')](_0xc23d('0x5d'),_0x2a7b2b);return respondWithRpcPromise(_0xc23d('0x5e'),_0xc23d('0x32'),{'module':_0xc23d('0x5f')});})[_0xc23d('0x25')](handleError(_0x572a77,null));}; \ No newline at end of file +var _0xb4b1=['render','writeFileSync','Reload','chan_sip.so','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findAll','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','show','params','keys','includeAll','find','create','readFileSync','join','root','utf8'];(function(_0xb9622e,_0x91225d){var _0x12969e=function(_0x5e8b52){while(--_0x5e8b52){_0xb9622e['push'](_0xb9622e['shift']());}};_0x12969e(++_0x91225d);}(_0xb4b1,0xe3));var _0x1b4b=function(_0x1bae55,_0x3b0a89){_0x1bae55=_0x1bae55-0x0;var _0x170e40=_0xb4b1[_0x1bae55];return _0x170e40;};'use strict';var emlformat=require(_0x1b4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b4b('0x1'));var jsonpatch=require(_0x1b4b('0x2'));var rp=require(_0x1b4b('0x3'));var moment=require('moment');var BPromise=require(_0x1b4b('0x4'));var Mustache=require(_0x1b4b('0x5'));var util=require(_0x1b4b('0x6'));var path=require(_0x1b4b('0x7'));var sox=require(_0x1b4b('0x8'));var csv=require(_0x1b4b('0x9'));var ejs=require(_0x1b4b('0xa'));var fs=require('fs');var fs_extra=require(_0x1b4b('0xb'));var _=require('lodash');var squel=require(_0x1b4b('0xc'));var crypto=require(_0x1b4b('0xd'));var jsforce=require(_0x1b4b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1b4b('0x9'));var querystring=require(_0x1b4b('0xf'));var Papa=require('papaparse');var Redis=require(_0x1b4b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b4b('0x11'));var as=require(_0x1b4b('0x12'));var hardwareService=require(_0x1b4b('0x13'));var logger=require(_0x1b4b('0x14'))(_0x1b4b('0x15'));var utils=require(_0x1b4b('0x16'));var config=require(_0x1b4b('0x17'));var licenseUtil=require(_0x1b4b('0x18'));var db=require(_0x1b4b('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1b4b('0x1a')][_0x1b4b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2bed5e,_0x3b93df,_0x580860,_0x38a49d){return new BPromise(function(_0x58dff6,_0x739dba){var _0x4e3f53=_0x38a49d||client;return _0x4e3f53[_0x1b4b('0x1c')](_0x2bed5e,_0x580860)[_0x1b4b('0x1d')](function(_0x1f2668){logger['info'](_0x1b4b('0x1e'),_0x3b93df,_0x1b4b('0x1f'));logger[_0x1b4b('0x20')](_0x1b4b('0x21'),_0x3b93df,_0x1b4b('0x1f'),JSON[_0x1b4b('0x22')](_0x1f2668));if(_0x1f2668[_0x1b4b('0x23')]){if(_0x1f2668[_0x1b4b('0x23')][_0x1b4b('0x24')]===0x1f4){logger['error'](_0x1b4b('0x1e'),_0x3b93df,_0x1f2668[_0x1b4b('0x23')][_0x1b4b('0x25')]);return _0x739dba(_0x1f2668[_0x1b4b('0x23')][_0x1b4b('0x25')]);}logger[_0x1b4b('0x23')]('VoiceContext,\x20%s,\x20%s',_0x3b93df,_0x1f2668[_0x1b4b('0x23')][_0x1b4b('0x25')]);return _0x58dff6(_0x1f2668[_0x1b4b('0x23')]['message']);}else{logger[_0x1b4b('0x26')](_0x1b4b('0x1e'),_0x3b93df,_0x1b4b('0x1f'));_0x58dff6(_0x1f2668['result'][_0x1b4b('0x25')]);}})[_0x1b4b('0x27')](function(_0x3cc771){logger[_0x1b4b('0x23')](_0x1b4b('0x1e'),_0x3b93df,_0x3cc771);_0x739dba(_0x3cc771);});});}function respondWithStatusCode(_0x505178,_0x5d9934){_0x5d9934=_0x5d9934||0xcc;return function(_0x2eb93b){if(_0x2eb93b){return _0x505178[_0x1b4b('0x28')](_0x5d9934);}return _0x505178[_0x1b4b('0x29')](_0x5d9934)[_0x1b4b('0x2a')]();};}function respondWithResult(_0x480d62,_0x262d23){_0x262d23=_0x262d23||0xc8;return function(_0x27d823){if(_0x27d823){return _0x480d62['status'](_0x262d23)[_0x1b4b('0x2b')](_0x27d823);}};}function respondWithFilteredResult(_0x3e61b3,_0x2c31fb){return function(_0x540bd8){if(_0x540bd8){var _0x4609bf=typeof _0x2c31fb[_0x1b4b('0x2c')]==='undefined'&&typeof _0x2c31fb[_0x1b4b('0x2d')]===_0x1b4b('0x2e');var _0x47f483=_0x540bd8[_0x1b4b('0x2f')];var _0x1be601=_0x4609bf?0x0:_0x2c31fb[_0x1b4b('0x2c')];var _0x2e5d72=_0x4609bf?_0x540bd8[_0x1b4b('0x2f')]:_0x2c31fb['offset']+_0x2c31fb[_0x1b4b('0x2d')];var _0x2b6ee9;if(_0x2e5d72>=_0x47f483){_0x2e5d72=_0x47f483;_0x2b6ee9=0xc8;}else{_0x2b6ee9=0xce;}_0x3e61b3[_0x1b4b('0x29')](_0x2b6ee9);return _0x3e61b3[_0x1b4b('0x30')](_0x1b4b('0x31'),_0x1be601+'-'+_0x2e5d72+'/'+_0x47f483)['json'](_0x540bd8);}return null;};}function patchUpdates(_0xf9ae3a){return function(_0x49236e){try{jsonpatch[_0x1b4b('0x32')](_0x49236e,_0xf9ae3a,!![]);}catch(_0x27a56b){return BPromise[_0x1b4b('0x33')](_0x27a56b);}return _0x49236e[_0x1b4b('0x34')]();};}function saveUpdates(_0xa8db5b,_0xd029ce){return function(_0x4c5c1e){if(_0x4c5c1e){return _0x4c5c1e[_0x1b4b('0x35')](_0xa8db5b)[_0x1b4b('0x1d')](function(_0x18d0e7){return _0x18d0e7;});}return null;};}function removeEntity(_0x19fe08,_0x130c52){return function(_0x314c0e){if(_0x314c0e){return _0x314c0e[_0x1b4b('0x36')]()[_0x1b4b('0x1d')](function(){var _0x49af15=_0x314c0e[_0x1b4b('0x37')]({'plain':!![]});var _0x1d2e87=_0x1b4b('0x38');return db[_0x1b4b('0x39')][_0x1b4b('0x36')]({'where':{'type':_0x1d2e87,'resourceId':_0x49af15['id']}})[_0x1b4b('0x1d')](function(){return _0x314c0e;});})[_0x1b4b('0x1d')](function(){_0x19fe08[_0x1b4b('0x29')](0xcc)[_0x1b4b('0x2a')]();});}};}function handleEntityNotFound(_0x27bf52,_0x371e94){return function(_0x20a9f5){if(!_0x20a9f5){_0x27bf52['sendStatus'](0x194);}return _0x20a9f5;};}function handleError(_0x4e50d3,_0x3b28d3){_0x3b28d3=_0x3b28d3||0x1f4;return function(_0x2f0afa){logger['error'](_0x2f0afa['stack']);if(_0x2f0afa[_0x1b4b('0x3a')]){delete _0x2f0afa[_0x1b4b('0x3a')];}_0x4e50d3[_0x1b4b('0x29')](_0x3b28d3)['send'](_0x2f0afa);};}exports[_0x1b4b('0x3b')]=function(_0xe3ccd7,_0x2b4723){var _0x4d4105={},_0x3750ba={},_0x58d181={'count':0x0,'rows':[]};var _0x30c7cc=_[_0x1b4b('0x3c')](db[_0x1b4b('0x3d')][_0x1b4b('0x3e')],function(_0x5811b5){return{'name':_0x5811b5[_0x1b4b('0x3f')],'type':_0x5811b5[_0x1b4b('0x40')][_0x1b4b('0x41')]};});_0x3750ba[_0x1b4b('0x42')]=_[_0x1b4b('0x3c')](_0x30c7cc,_0x1b4b('0x3a'));_0x3750ba[_0x1b4b('0x43')]=_['keys'](_0xe3ccd7[_0x1b4b('0x43')]);_0x3750ba[_0x1b4b('0x44')]=_[_0x1b4b('0x45')](_0x3750ba['model'],_0x3750ba[_0x1b4b('0x43')]);_0x4d4105[_0x1b4b('0x46')]=_[_0x1b4b('0x45')](_0x3750ba[_0x1b4b('0x42')],qs[_0x1b4b('0x47')](_0xe3ccd7[_0x1b4b('0x43')]['fields']));_0x4d4105[_0x1b4b('0x46')]=_0x4d4105[_0x1b4b('0x46')][_0x1b4b('0x48')]?_0x4d4105[_0x1b4b('0x46')]:_0x3750ba[_0x1b4b('0x42')];if(!_0xe3ccd7[_0x1b4b('0x43')][_0x1b4b('0x49')](_0x1b4b('0x4a'))){_0x4d4105[_0x1b4b('0x2d')]=qs[_0x1b4b('0x2d')](_0xe3ccd7[_0x1b4b('0x43')][_0x1b4b('0x2d')]);_0x4d4105['offset']=qs[_0x1b4b('0x2c')](_0xe3ccd7['query'][_0x1b4b('0x2c')]);}_0x4d4105[_0x1b4b('0x4b')]=qs[_0x1b4b('0x4c')](_0xe3ccd7[_0x1b4b('0x43')][_0x1b4b('0x4c')]);_0x4d4105[_0x1b4b('0x4d')]=qs[_0x1b4b('0x44')](_['pick'](_0xe3ccd7['query'],_0x3750ba['filters']),_0x30c7cc);if(_0xe3ccd7[_0x1b4b('0x43')]['filter']){_0x4d4105['where']=_[_0x1b4b('0x4e')](_0x4d4105['where'],{'$or':_['map'](_0x30c7cc,function(_0x39d821){if(_0x39d821[_0x1b4b('0x40')]!==_0x1b4b('0x4f')){var _0x3d8b0f={};_0x3d8b0f[_0x39d821[_0x1b4b('0x3a')]]={'$like':'%'+_0xe3ccd7[_0x1b4b('0x43')][_0x1b4b('0x50')]+'%'};return _0x3d8b0f;}})});}_0x4d4105=_['merge']({},_0x4d4105,_0xe3ccd7[_0x1b4b('0x51')]);var _0x8d2dd8={'where':_0x4d4105[_0x1b4b('0x4d')]};return db[_0x1b4b('0x3d')][_0x1b4b('0x2f')](_0x8d2dd8)['then'](function(_0x125f0a){_0x58d181[_0x1b4b('0x2f')]=_0x125f0a;if(_0xe3ccd7[_0x1b4b('0x43')]['includeAll']){_0x4d4105[_0x1b4b('0x52')]=[{'all':!![]}];}return db[_0x1b4b('0x3d')]['findAll'](_0x4d4105);})['then'](function(_0x288539){_0x58d181[_0x1b4b('0x53')]=_0x288539;return _0x58d181;})[_0x1b4b('0x1d')](respondWithFilteredResult(_0x2b4723,_0x4d4105))['catch'](handleError(_0x2b4723,null));};exports[_0x1b4b('0x54')]=function(_0x4a7975,_0x1bb6b4){var _0x5980b4={'raw':![],'where':{'id':_0x4a7975[_0x1b4b('0x55')]['id']}},_0x541817={};_0x541817[_0x1b4b('0x42')]=_[_0x1b4b('0x56')](db[_0x1b4b('0x3d')][_0x1b4b('0x3e')]);_0x541817[_0x1b4b('0x43')]=_['keys'](_0x4a7975[_0x1b4b('0x43')]);_0x541817[_0x1b4b('0x44')]=_[_0x1b4b('0x45')](_0x541817[_0x1b4b('0x42')],_0x541817[_0x1b4b('0x43')]);_0x5980b4[_0x1b4b('0x46')]=_[_0x1b4b('0x45')](_0x541817[_0x1b4b('0x42')],qs[_0x1b4b('0x47')](_0x4a7975['query']['fields']));_0x5980b4['attributes']=_0x5980b4[_0x1b4b('0x46')]['length']?_0x5980b4[_0x1b4b('0x46')]:_0x541817[_0x1b4b('0x42')];if(_0x4a7975['query'][_0x1b4b('0x57')]){_0x5980b4[_0x1b4b('0x52')]=[{'all':!![]}];}_0x5980b4=_[_0x1b4b('0x4e')]({},_0x5980b4,_0x4a7975[_0x1b4b('0x51')]);return db[_0x1b4b('0x3d')][_0x1b4b('0x58')](_0x5980b4)[_0x1b4b('0x1d')](handleEntityNotFound(_0x1bb6b4,null))[_0x1b4b('0x1d')](respondWithResult(_0x1bb6b4,null))[_0x1b4b('0x27')](handleError(_0x1bb6b4,null));};exports[_0x1b4b('0x59')]=function(_0x1c3079,_0x5595eb,_0x174e97){var _0x48717e;return db[_0x1b4b('0x3d')][_0x1b4b('0x59')](_0x1c3079['body'],{'raw':!![]})['then'](function(_0x5b9bca){_0x48717e=_0x5b9bca;return db[_0x1b4b('0x3d')]['findAll']({'raw':!![]});})[_0x1b4b('0x1d')](function(_0x4fa199){var _0x38f2d3=fs[_0x1b4b('0x5a')](path[_0x1b4b('0x5b')](config[_0x1b4b('0x5c')],'server/files/templates/context.ejs'),_0x1b4b('0x5d'));var _0x1bd5e5=ejs[_0x1b4b('0x5e')](_0x38f2d3,{'contexts':_0x4fa199||[]});fs[_0x1b4b('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1bd5e5);})[_0x1b4b('0x1d')](function(){return respondWithRpcPromise(_0x1b4b('0x60'),_0x1b4b('0x59'),{'module':_0x1b4b('0x61')});})[_0x1b4b('0x1d')](function(){var _0x4bc215=_0x1c3079[_0x1b4b('0x62')]['get']({'plain':!![]});if(!_0x4bc215)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bc215[_0x1b4b('0x63')]==='user'){var _0x48a645=_0x48717e[_0x1b4b('0x37')]({'plain':!![]});return db['UserProfileSection'][_0x1b4b('0x58')]({'where':{'name':_0x1b4b('0x38'),'userProfileId':_0x4bc215[_0x1b4b('0x64')]},'raw':!![]})[_0x1b4b('0x1d')](function(_0x249e09){if(_0x249e09&&_0x249e09[_0x1b4b('0x65')]===0x0){return db[_0x1b4b('0x39')][_0x1b4b('0x59')]({'name':_0x48a645[_0x1b4b('0x3a')],'resourceId':_0x48a645['id'],'type':_0x249e09[_0x1b4b('0x3a')],'sectionId':_0x249e09['id']},{})['then'](function(){return _0x48717e;});}else{return _0x48717e;}})[_0x1b4b('0x27')](function(_0x238702){logger[_0x1b4b('0x23')](_0x1b4b('0x66'),_0x238702);throw _0x238702;});}return _0x48717e;})[_0x1b4b('0x1d')](respondWithResult(_0x5595eb,0xc9))[_0x1b4b('0x27')](handleError(_0x5595eb,null));};exports[_0x1b4b('0x35')]=function(_0x59d955,_0x1cdabd,_0x192ab7){var _0x342d93;return db['VoiceContext']['find']({'where':{'id':_0x59d955[_0x1b4b('0x55')]['id']}})[_0x1b4b('0x1d')](handleEntityNotFound(_0x1cdabd,null))[_0x1b4b('0x1d')](saveUpdates(_0x59d955[_0x1b4b('0x67')],null))[_0x1b4b('0x1d')](function(_0x31eb7f){if(_0x31eb7f){_0x342d93=_0x31eb7f;return db[_0x1b4b('0x3d')][_0x1b4b('0x68')]({'raw':!![]});}})['then'](function(_0x571846){var _0x1c4b81=fs[_0x1b4b('0x5a')](path[_0x1b4b('0x5b')](config[_0x1b4b('0x5c')],_0x1b4b('0x69')),'utf8');var _0x5002dc=ejs['render'](_0x1c4b81,{'contexts':_0x571846||[]});fs[_0x1b4b('0x5f')](_0x1b4b('0x6a'),_0x5002dc);})[_0x1b4b('0x1d')](function(){return respondWithRpcPromise(_0x1b4b('0x60'),'update',{'module':'chan_sip.so'});})[_0x1b4b('0x1d')](function(){return _0x342d93;})[_0x1b4b('0x1d')](respondWithResult(_0x1cdabd,null))[_0x1b4b('0x27')](handleError(_0x1cdabd,null));};exports['destroy']=function(_0x307478,_0x2c252e,_0x3d7964){var _0xcb5e1d;return db['VoiceContext']['find']({'where':{'id':_0x307478[_0x1b4b('0x55')]['id']}})[_0x1b4b('0x1d')](handleEntityNotFound(_0x2c252e,null))[_0x1b4b('0x1d')](removeEntity(_0x2c252e,null))[_0x1b4b('0x1d')](function(){return db[_0x1b4b('0x3d')][_0x1b4b('0x68')]({'raw':!![]});})[_0x1b4b('0x1d')](function(_0x298a12){var _0x19db81=fs[_0x1b4b('0x5a')](path[_0x1b4b('0x5b')](config[_0x1b4b('0x5c')],_0x1b4b('0x69')),_0x1b4b('0x5d'));var _0x51926a=ejs[_0x1b4b('0x5e')](_0x19db81,{'contexts':_0x298a12});fs[_0x1b4b('0x5f')](_0x1b4b('0x6a'),_0x51926a);return respondWithRpcPromise('Reload',_0x1b4b('0x36'),{'module':_0x1b4b('0x61')});})[_0x1b4b('0x27')](handleError(_0x2c252e,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 5e2e918..36b15b0 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 _0x0ed8=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0ed8,0x11a));var _0x80ed=function(_0x2b05be,_0x592434){_0x2b05be=_0x2b05be-0x0;var _0x18eaf8=_0x0ed8[_0x2b05be];return _0x18eaf8;};'use strict';var _=require('lodash');var util=require(_0x80ed('0x0'));var logger=require(_0x80ed('0x1'))(_0x80ed('0x2'));var moment=require('moment');var BPromise=require(_0x80ed('0x3'));var rp=require(_0x80ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80ed('0x5'));var config=require(_0x80ed('0x6'));var attributes=require(_0x80ed('0x7'));module[_0x80ed('0x8')]=function(_0x3dfa85,_0x156e1a){return _0x3dfa85[_0x80ed('0x9')](_0x80ed('0xa'),attributes,{'tableName':_0x80ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5ea=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts'];(function(_0x19f757,_0x34a47b){var _0x59c375=function(_0x371f37){while(--_0x371f37){_0x19f757['push'](_0x19f757['shift']());}};_0x59c375(++_0x34a47b);}(_0xb5ea,0x168));var _0xab5e=function(_0x2086ff,_0x4aa103){_0x2086ff=_0x2086ff-0x0;var _0x269305=_0xb5ea[_0x2086ff];return _0x269305;};'use strict';var _=require(_0xab5e('0x0'));var util=require(_0xab5e('0x1'));var logger=require(_0xab5e('0x2'))(_0xab5e('0x3'));var moment=require(_0xab5e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab5e('0x5'));var rimraf=require(_0xab5e('0x6'));var config=require(_0xab5e('0x7'));var attributes=require(_0xab5e('0x8'));module[_0xab5e('0x9')]=function(_0x5d53d3,_0xa9fb7f){return _0x5d53d3[_0xab5e('0xa')]('VoiceContext',attributes,{'tableName':_0xab5e('0xb'),'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 60945b5..ebda252 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 _0x4c71=['jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xbaec71,_0x70c1c9){var _0x938a3b=function(_0x5b358a){while(--_0x5b358a){_0xbaec71['push'](_0xbaec71['shift']());}};_0x938a3b(++_0x70c1c9);}(_0x4c71,0x12b));var _0x14c7=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x4c71[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var moment=require('moment');var BPromise=require(_0x14c7('0x2'));var rs=require(_0x14c7('0x3'));var fs=require('fs');var Redis=require(_0x14c7('0x4'));var db=require(_0x14c7('0x5'))['db'];var utils=require(_0x14c7('0x6'));var logger=require('../../config/logger')(_0x14c7('0x7'));var config=require(_0x14c7('0x8'));var jayson=require(_0x14c7('0x9'));var client=jayson[_0x14c7('0xa')][_0x14c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x493824,_0x3f1868,_0x38b0fb){return new BPromise(function(_0x33ffc6,_0x1ab9f0){return client[_0x14c7('0xc')](_0x493824,_0x38b0fb)['then'](function(_0x350ef8){logger['info'](_0x14c7('0xd'),_0x3f1868,_0x14c7('0xe'));logger['debug'](_0x14c7('0xf'),_0x3f1868,_0x14c7('0xe'),JSON[_0x14c7('0x10')](_0x350ef8));if(_0x350ef8[_0x14c7('0x11')]){if(_0x350ef8[_0x14c7('0x11')][_0x14c7('0x12')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3f1868,_0x350ef8[_0x14c7('0x11')][_0x14c7('0x13')]);return _0x1ab9f0(_0x350ef8[_0x14c7('0x11')][_0x14c7('0x13')]);}logger[_0x14c7('0x11')](_0x14c7('0xd'),_0x3f1868,_0x350ef8['error']['message']);return _0x33ffc6(_0x350ef8[_0x14c7('0x11')][_0x14c7('0x13')]);}else{logger['info'](_0x14c7('0xd'),_0x3f1868,_0x14c7('0xe'));_0x33ffc6(_0x350ef8[_0x14c7('0x14')][_0x14c7('0x13')]);}})[_0x14c7('0x15')](function(_0x2c8c03){logger[_0x14c7('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3f1868,_0x2c8c03);_0x1ab9f0(_0x2c8c03);});});} \ No newline at end of file +var _0x9e38=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x9e38,0x155));var _0x89e3=function(_0x37dbbb,_0x1909de){_0x37dbbb=_0x37dbbb-0x0;var _0x10068f=_0x9e38[_0x37dbbb];return _0x10068f;};'use strict';var _=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var moment=require(_0x89e3('0x2'));var BPromise=require(_0x89e3('0x3'));var rs=require(_0x89e3('0x4'));var fs=require('fs');var Redis=require(_0x89e3('0x5'));var db=require(_0x89e3('0x6'))['db'];var utils=require(_0x89e3('0x7'));var logger=require(_0x89e3('0x8'))(_0x89e3('0x9'));var config=require(_0x89e3('0xa'));var jayson=require(_0x89e3('0xb'));var client=jayson[_0x89e3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e2a8e,_0xcad35d,_0xe526ab){return new BPromise(function(_0x2476e4,_0x3ebc0b){return client[_0x89e3('0xd')](_0x3e2a8e,_0xe526ab)[_0x89e3('0xe')](function(_0x18d0a6){logger[_0x89e3('0xf')](_0x89e3('0x10'),_0xcad35d,'request\x20sent');logger[_0x89e3('0x11')](_0x89e3('0x12'),_0xcad35d,_0x89e3('0x13'),JSON[_0x89e3('0x14')](_0x18d0a6));if(_0x18d0a6['error']){if(_0x18d0a6[_0x89e3('0x15')][_0x89e3('0x16')]===0x1f4){logger[_0x89e3('0x15')]('VoiceContext,\x20%s,\x20%s',_0xcad35d,_0x18d0a6[_0x89e3('0x15')]['message']);return _0x3ebc0b(_0x18d0a6[_0x89e3('0x15')][_0x89e3('0x17')]);}logger[_0x89e3('0x15')](_0x89e3('0x10'),_0xcad35d,_0x18d0a6[_0x89e3('0x15')][_0x89e3('0x17')]);return _0x2476e4(_0x18d0a6[_0x89e3('0x15')][_0x89e3('0x17')]);}else{logger[_0x89e3('0xf')](_0x89e3('0x10'),_0xcad35d,_0x89e3('0x13'));_0x2476e4(_0x18d0a6[_0x89e3('0x18')][_0x89e3('0x17')]);}})[_0x89e3('0x19')](function(_0x3d8792){logger['error'](_0x89e3('0x10'),_0xcad35d,_0x3d8792);_0x3ebc0b(_0x3d8792);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f3c4e55..5f59aa3 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 _0x6f7f=['delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6f7f,0x177));var _0xf6f7=function(_0x7dea9a,_0x37c617){_0x7dea9a=_0x7dea9a-0x0;var _0x5b4c86=_0x6f7f[_0x7dea9a];return _0x5b4c86;};'use strict';var multer=require('multer');var util=require(_0xf6f7('0x0'));var path=require(_0xf6f7('0x1'));var timeout=require(_0xf6f7('0x2'));var express=require(_0xf6f7('0x3'));var router=express[_0xf6f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf6f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6f7('0x6'));var controller=require(_0xf6f7('0x7'));router[_0xf6f7('0x8')]('/',auth['isAuthenticated'](),controller[_0xf6f7('0x9')]);router['get'](_0xf6f7('0xa'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xc')]);router[_0xf6f7('0x8')](_0xf6f7('0xd'),auth[_0xf6f7('0xb')](),controller['show']);router[_0xf6f7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf6f7('0xd'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xf')]);router[_0xf6f7('0x10')](_0xf6f7('0xd'),auth[_0xf6f7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaac5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x85f059,_0x27d70e){var _0x3520f7=function(_0x5b7c68){while(--_0x5b7c68){_0x85f059['push'](_0x85f059['shift']());}};_0x3520f7(++_0x27d70e);}(_0xaac5,0x1b5));var _0x5aac=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xaac5[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0x5aac('0x0'));var path=require(_0x5aac('0x1'));var timeout=require(_0x5aac('0x2'));var express=require(_0x5aac('0x3'));var router=express[_0x5aac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5aac('0x5'));var interaction=require(_0x5aac('0x6'));var config=require(_0x5aac('0x7'));var controller=require(_0x5aac('0x8'));router[_0x5aac('0x9')]('/',auth[_0x5aac('0xa')](),controller[_0x5aac('0xb')]);router[_0x5aac('0x9')]('/describe',auth[_0x5aac('0xa')](),controller[_0x5aac('0xc')]);router[_0x5aac('0x9')](_0x5aac('0xd'),auth[_0x5aac('0xa')](),controller[_0x5aac('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5aac('0xf')]);router['put'](_0x5aac('0xd'),auth[_0x5aac('0xa')](),controller[_0x5aac('0x10')]);router[_0x5aac('0x11')](_0x5aac('0xd'),auth[_0x5aac('0xa')](),controller[_0x5aac('0x12')]);module[_0x5aac('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 033b6d8..85ac49c 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 _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x31a419,_0x435cf5){var _0x37606=function(_0x40c1de){while(--_0x40c1de){_0x31a419['push'](_0x31a419['shift']());}};_0x37606(++_0x435cf5);}(_0xa41a,0x6b));var _0xaa41=function(_0x407a4f,_0x233743){_0x407a4f=_0x407a4f-0x0;var _0x3c5fbc=_0xa41a[_0x407a4f];return _0x3c5fbc;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x14b780,_0x1996a6){var _0x27c200=function(_0xccf91){while(--_0xccf91){_0x14b780['push'](_0x14b780['shift']());}};_0x27c200(++_0x1996a6);}(_0x6aa7,0x178));var _0x76aa=function(_0xdc3b6,_0x329352){_0xdc3b6=_0xdc3b6-0x0;var _0x4b1be8=_0x6aa7[_0xdc3b6];return _0x4b1be8;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'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 223f67f..fd3b301 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 _0xb50f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','fieldName'];(function(_0x5b0bf2,_0x3e73f4){var _0x122cdf=function(_0x390c97){while(--_0x390c97){_0x5b0bf2['push'](_0x5b0bf2['shift']());}};_0x122cdf(++_0x3e73f4);}(_0xb50f,0x6b));var _0xfb50=function(_0x25d4e5,_0x30b67f){_0x25d4e5=_0x25d4e5-0x0;var _0x44d116=_0xb50f[_0x25d4e5];return _0x44d116;};'use strict';var emlformat=require(_0xfb50('0x0'));var rimraf=require(_0xfb50('0x1'));var zipdir=require(_0xfb50('0x2'));var jsonpatch=require(_0xfb50('0x3'));var rp=require(_0xfb50('0x4'));var moment=require(_0xfb50('0x5'));var BPromise=require(_0xfb50('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb50('0x7'));var sox=require(_0xfb50('0x8'));var csv=require('to-csv');var ejs=require(_0xfb50('0x9'));var fs=require('fs');var fs_extra=require(_0xfb50('0xa'));var _=require(_0xfb50('0xb'));var squel=require(_0xfb50('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb50('0xd'));var deskjs=require(_0xfb50('0xe'));var toCsv=require(_0xfb50('0xf'));var querystring=require(_0xfb50('0x10'));var Papa=require('papaparse');var Redis=require(_0xfb50('0x11'));var authService=require(_0xfb50('0x12'));var qs=require(_0xfb50('0x13'));var as=require(_0xfb50('0x14'));var hardwareService=require(_0xfb50('0x15'));var logger=require('../../config/logger')(_0xfb50('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfb50('0x17'));var db=require(_0xfb50('0x18'))['db'];function respondWithStatusCode(_0x27e3ef,_0x470991){_0x470991=_0x470991||0xcc;return function(_0x264ca6){if(_0x264ca6){return _0x27e3ef['sendStatus'](_0x470991);}return _0x27e3ef[_0xfb50('0x19')](_0x470991)[_0xfb50('0x1a')]();};}function respondWithResult(_0x577dbc,_0x11b831){_0x11b831=_0x11b831||0xc8;return function(_0x5cfe35){if(_0x5cfe35){return _0x577dbc[_0xfb50('0x19')](_0x11b831)[_0xfb50('0x1b')](_0x5cfe35);}};}function respondWithFilteredResult(_0x39ffba,_0x14050d){return function(_0x1c6e10){if(_0x1c6e10){var _0xcee10=typeof _0x14050d['offset']===_0xfb50('0x1c')&&typeof _0x14050d[_0xfb50('0x1d')]===_0xfb50('0x1c');var _0x525dbc=_0x1c6e10[_0xfb50('0x1e')];var _0x10b4e4=_0xcee10?0x0:_0x14050d[_0xfb50('0x1f')];var _0x194836=_0xcee10?_0x1c6e10[_0xfb50('0x1e')]:_0x14050d['offset']+_0x14050d[_0xfb50('0x1d')];var _0x37ed46;if(_0x194836>=_0x525dbc){_0x194836=_0x525dbc;_0x37ed46=0xc8;}else{_0x37ed46=0xce;}_0x39ffba['status'](_0x37ed46);return _0x39ffba[_0xfb50('0x20')](_0xfb50('0x21'),_0x10b4e4+'-'+_0x194836+'/'+_0x525dbc)[_0xfb50('0x1b')](_0x1c6e10);}return null;};}function patchUpdates(_0x5f3e3a){return function(_0x1477cb){try{jsonpatch[_0xfb50('0x22')](_0x1477cb,_0x5f3e3a,!![]);}catch(_0x562a40){return BPromise[_0xfb50('0x23')](_0x562a40);}return _0x1477cb[_0xfb50('0x24')]();};}function saveUpdates(_0x150863,_0x5e1505){return function(_0x167d80){if(_0x167d80){return _0x167d80[_0xfb50('0x25')](_0x150863)['then'](function(_0x2017b5){return _0x2017b5;});}return null;};}function removeEntity(_0x12ff91,_0x277918){return function(_0x196dcc){if(_0x196dcc){return _0x196dcc[_0xfb50('0x26')]()[_0xfb50('0x27')](function(){_0x12ff91[_0xfb50('0x19')](0xcc)[_0xfb50('0x1a')]();});}};}function handleEntityNotFound(_0x190615,_0x5930e4){return function(_0x1c4a10){if(!_0x1c4a10){_0x190615[_0xfb50('0x28')](0x194);}return _0x1c4a10;};}function handleError(_0x406072,_0x57b3a5){_0x57b3a5=_0x57b3a5||0x1f4;return function(_0x316aa3){logger[_0xfb50('0x29')](_0x316aa3[_0xfb50('0x2a')]);if(_0x316aa3[_0xfb50('0x2b')]){delete _0x316aa3['name'];}_0x406072['status'](_0x57b3a5)[_0xfb50('0x2c')](_0x316aa3);};}exports['index']=function(_0x8ad835,_0x5ab935){var _0x2586fd={},_0x2ef00b={},_0x501c8f={'count':0x0,'rows':[]};var _0x5ea60e=_[_0xfb50('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x1b57f5){return{'name':_0x1b57f5[_0xfb50('0x2e')],'type':_0x1b57f5[_0xfb50('0x2f')][_0xfb50('0x30')]};});_0x2ef00b[_0xfb50('0x31')]=_[_0xfb50('0x2d')](_0x5ea60e,_0xfb50('0x2b'));_0x2ef00b[_0xfb50('0x32')]=_[_0xfb50('0x33')](_0x8ad835['query']);_0x2ef00b[_0xfb50('0x34')]=_[_0xfb50('0x35')](_0x2ef00b[_0xfb50('0x31')],_0x2ef00b[_0xfb50('0x32')]);_0x2586fd[_0xfb50('0x36')]=_[_0xfb50('0x35')](_0x2ef00b[_0xfb50('0x31')],qs[_0xfb50('0x37')](_0x8ad835[_0xfb50('0x32')][_0xfb50('0x37')]));_0x2586fd[_0xfb50('0x36')]=_0x2586fd[_0xfb50('0x36')][_0xfb50('0x38')]?_0x2586fd[_0xfb50('0x36')]:_0x2ef00b['model'];if(!_0x8ad835[_0xfb50('0x32')]['hasOwnProperty'](_0xfb50('0x39'))){_0x2586fd['limit']=qs['limit'](_0x8ad835['query'][_0xfb50('0x1d')]);_0x2586fd['offset']=qs[_0xfb50('0x1f')](_0x8ad835[_0xfb50('0x32')]['offset']);}_0x2586fd['order']=qs[_0xfb50('0x3a')](_0x8ad835[_0xfb50('0x32')][_0xfb50('0x3a')]);_0x2586fd[_0xfb50('0x3b')]=qs[_0xfb50('0x34')](_[_0xfb50('0x3c')](_0x8ad835['query'],_0x2ef00b[_0xfb50('0x34')]),_0x5ea60e);if(_0x8ad835[_0xfb50('0x32')][_0xfb50('0x3d')]){_0x2586fd[_0xfb50('0x3b')]=_[_0xfb50('0x3e')](_0x2586fd[_0xfb50('0x3b')],{'$or':_[_0xfb50('0x2d')](_0x5ea60e,function(_0x39ef61){if(_0x39ef61[_0xfb50('0x2f')]!==_0xfb50('0x3f')){var _0x67d959={};_0x67d959[_0x39ef61[_0xfb50('0x2b')]]={'$like':'%'+_0x8ad835['query'][_0xfb50('0x3d')]+'%'};return _0x67d959;}})});}_0x2586fd=_[_0xfb50('0x3e')]({},_0x2586fd,_0x8ad835['options']);var _0x803b02={'where':_0x2586fd[_0xfb50('0x3b')]};return db[_0xfb50('0x40')][_0xfb50('0x1e')](_0x803b02)[_0xfb50('0x27')](function(_0x111a3e){_0x501c8f[_0xfb50('0x1e')]=_0x111a3e;if(_0x8ad835[_0xfb50('0x32')][_0xfb50('0x41')]){_0x2586fd[_0xfb50('0x42')]=[{'all':!![]}];}return db[_0xfb50('0x40')]['findAll'](_0x2586fd);})[_0xfb50('0x27')](function(_0x4a693d){_0x501c8f[_0xfb50('0x43')]=_0x4a693d;return _0x501c8f;})['then'](respondWithFilteredResult(_0x5ab935,_0x2586fd))[_0xfb50('0x44')](handleError(_0x5ab935,null));};exports[_0xfb50('0x45')]=function(_0x300714,_0x1c688e){var _0x9cd9ca={'raw':!![],'where':{'id':_0x300714[_0xfb50('0x46')]['id']}},_0x59f202={};_0x59f202[_0xfb50('0x31')]=_['keys'](db['VoiceDialReport'][_0xfb50('0x47')]);_0x59f202[_0xfb50('0x32')]=_['keys'](_0x300714['query']);_0x59f202[_0xfb50('0x34')]=_[_0xfb50('0x35')](_0x59f202[_0xfb50('0x31')],_0x59f202[_0xfb50('0x32')]);_0x9cd9ca[_0xfb50('0x36')]=_[_0xfb50('0x35')](_0x59f202[_0xfb50('0x31')],qs[_0xfb50('0x37')](_0x300714[_0xfb50('0x32')][_0xfb50('0x37')]));_0x9cd9ca['attributes']=_0x9cd9ca[_0xfb50('0x36')][_0xfb50('0x38')]?_0x9cd9ca[_0xfb50('0x36')]:_0x59f202[_0xfb50('0x31')];if(_0x300714[_0xfb50('0x32')][_0xfb50('0x41')]){_0x9cd9ca[_0xfb50('0x42')]=[{'all':!![]}];}_0x9cd9ca=_[_0xfb50('0x3e')]({},_0x9cd9ca,_0x300714[_0xfb50('0x48')]);return db['VoiceDialReport'][_0xfb50('0x49')](_0x9cd9ca)[_0xfb50('0x27')](handleEntityNotFound(_0x1c688e,null))[_0xfb50('0x27')](respondWithResult(_0x1c688e,null))[_0xfb50('0x44')](handleError(_0x1c688e,null));};exports['create']=function(_0x386dec,_0x409875){return db[_0xfb50('0x40')][_0xfb50('0x4a')](_0x386dec[_0xfb50('0x4b')],{})[_0xfb50('0x27')](respondWithResult(_0x409875,0xc9))[_0xfb50('0x44')](handleError(_0x409875,null));};exports[_0xfb50('0x25')]=function(_0x370258,_0x5a9247){if(_0x370258[_0xfb50('0x4b')]['id']){delete _0x370258['body']['id'];}return db[_0xfb50('0x40')][_0xfb50('0x49')]({'where':{'id':_0x370258[_0xfb50('0x46')]['id']}})[_0xfb50('0x27')](handleEntityNotFound(_0x5a9247,null))['then'](saveUpdates(_0x370258[_0xfb50('0x4b')],null))[_0xfb50('0x27')](respondWithResult(_0x5a9247,null))[_0xfb50('0x44')](handleError(_0x5a9247,null));};exports['destroy']=function(_0x5c1a78,_0x2af956){return db[_0xfb50('0x40')][_0xfb50('0x49')]({'where':{'id':_0x5c1a78['params']['id']}})['then'](handleEntityNotFound(_0x2af956,null))[_0xfb50('0x27')](removeEntity(_0x2af956,null))['catch'](handleError(_0x2af956,null));};exports[_0xfb50('0x4c')]=function(_0x57e3c1,_0x473356){return db[_0xfb50('0x40')][_0xfb50('0x4c')]()['then'](respondWithResult(_0x473356,null))[_0xfb50('0x44')](handleError(_0x473356,null));}; \ No newline at end of file +var _0x57f5=['key','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','model','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','save','then','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type'];(function(_0x326427,_0x2c0f30){var _0x343782=function(_0x42be3e){while(--_0x42be3e){_0x326427['push'](_0x326427['shift']());}};_0x343782(++_0x2c0f30);}(_0x57f5,0x187));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x557f('0x0'));var rimraf=require(_0x557f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x557f('0x2'));var moment=require(_0x557f('0x3'));var BPromise=require(_0x557f('0x4'));var Mustache=require(_0x557f('0x5'));var util=require(_0x557f('0x6'));var path=require(_0x557f('0x7'));var sox=require(_0x557f('0x8'));var csv=require(_0x557f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x557f('0xa'));var _=require(_0x557f('0xb'));var squel=require('squel');var crypto=require(_0x557f('0xc'));var jsforce=require(_0x557f('0xd'));var deskjs=require(_0x557f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x557f('0xf'));var Papa=require(_0x557f('0x10'));var Redis=require('ioredis');var authService=require(_0x557f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x557f('0x12'));var hardwareService=require(_0x557f('0x13'));var logger=require(_0x557f('0x14'))(_0x557f('0x15'));var utils=require(_0x557f('0x16'));var config=require(_0x557f('0x17'));var licenseUtil=require(_0x557f('0x18'));var db=require(_0x557f('0x19'))['db'];function respondWithStatusCode(_0x394e3a,_0x293a33){_0x293a33=_0x293a33||0xcc;return function(_0x54987f){if(_0x54987f){return _0x394e3a[_0x557f('0x1a')](_0x293a33);}return _0x394e3a['status'](_0x293a33)[_0x557f('0x1b')]();};}function respondWithResult(_0x190f02,_0x2dac64){_0x2dac64=_0x2dac64||0xc8;return function(_0x463067){if(_0x463067){return _0x190f02['status'](_0x2dac64)[_0x557f('0x1c')](_0x463067);}};}function respondWithFilteredResult(_0x93c97a,_0x49eccf){return function(_0x29ff6f){if(_0x29ff6f){var _0x34ce7a=typeof _0x49eccf['offset']==='undefined'&&typeof _0x49eccf[_0x557f('0x1d')]===_0x557f('0x1e');var _0x28c9ef=_0x29ff6f[_0x557f('0x1f')];var _0x4698b4=_0x34ce7a?0x0:_0x49eccf[_0x557f('0x20')];var _0x44aa91=_0x34ce7a?_0x29ff6f['count']:_0x49eccf['offset']+_0x49eccf[_0x557f('0x1d')];var _0xdf8bc9;if(_0x44aa91>=_0x28c9ef){_0x44aa91=_0x28c9ef;_0xdf8bc9=0xc8;}else{_0xdf8bc9=0xce;}_0x93c97a[_0x557f('0x21')](_0xdf8bc9);return _0x93c97a[_0x557f('0x22')](_0x557f('0x23'),_0x4698b4+'-'+_0x44aa91+'/'+_0x28c9ef)[_0x557f('0x1c')](_0x29ff6f);}return null;};}function patchUpdates(_0x18b3b5){return function(_0x4d58b0){try{jsonpatch['apply'](_0x4d58b0,_0x18b3b5,!![]);}catch(_0x3d01f7){return BPromise['reject'](_0x3d01f7);}return _0x4d58b0[_0x557f('0x24')]();};}function saveUpdates(_0x2cfb70,_0x1d5850){return function(_0x5e75d9){if(_0x5e75d9){return _0x5e75d9['update'](_0x2cfb70)[_0x557f('0x25')](function(_0x5b8a67){return _0x5b8a67;});}return null;};}function removeEntity(_0x9699ce,_0x610bad){return function(_0x3101ad){if(_0x3101ad){return _0x3101ad['destroy']()[_0x557f('0x25')](function(){_0x9699ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x309b4a,_0x48d2c5){return function(_0x27d3fc){if(!_0x27d3fc){_0x309b4a[_0x557f('0x1a')](0x194);}return _0x27d3fc;};}function handleError(_0xcbf307,_0x2966c8){_0x2966c8=_0x2966c8||0x1f4;return function(_0x5e66bb){logger[_0x557f('0x26')](_0x5e66bb['stack']);if(_0x5e66bb['name']){delete _0x5e66bb[_0x557f('0x27')];}_0xcbf307['status'](_0x2966c8)[_0x557f('0x28')](_0x5e66bb);};}exports[_0x557f('0x29')]=function(_0x5deed8,_0x487fa1){var _0x1c6129={},_0x278f97={},_0x1f869f={'count':0x0,'rows':[]};var _0x11cd33=_[_0x557f('0x2a')](db[_0x557f('0x2b')][_0x557f('0x2c')],function(_0x1a1a3f){return{'name':_0x1a1a3f[_0x557f('0x2d')],'type':_0x1a1a3f[_0x557f('0x2e')][_0x557f('0x2f')]};});_0x278f97['model']=_[_0x557f('0x2a')](_0x11cd33,'name');_0x278f97[_0x557f('0x30')]=_[_0x557f('0x31')](_0x5deed8[_0x557f('0x30')]);_0x278f97[_0x557f('0x32')]=_[_0x557f('0x33')](_0x278f97['model'],_0x278f97[_0x557f('0x30')]);_0x1c6129[_0x557f('0x34')]=_[_0x557f('0x33')](_0x278f97['model'],qs['fields'](_0x5deed8[_0x557f('0x30')][_0x557f('0x35')]));_0x1c6129[_0x557f('0x34')]=_0x1c6129[_0x557f('0x34')][_0x557f('0x36')]?_0x1c6129[_0x557f('0x34')]:_0x278f97['model'];if(!_0x5deed8[_0x557f('0x30')]['hasOwnProperty'](_0x557f('0x37'))){_0x1c6129[_0x557f('0x1d')]=qs['limit'](_0x5deed8['query'][_0x557f('0x1d')]);_0x1c6129[_0x557f('0x20')]=qs['offset'](_0x5deed8[_0x557f('0x30')][_0x557f('0x20')]);}_0x1c6129['order']=qs[_0x557f('0x38')](_0x5deed8[_0x557f('0x30')][_0x557f('0x38')]);_0x1c6129[_0x557f('0x39')]=qs[_0x557f('0x32')](_['pick'](_0x5deed8[_0x557f('0x30')],_0x278f97['filters']),_0x11cd33);if(_0x5deed8[_0x557f('0x30')][_0x557f('0x3a')]){_0x1c6129[_0x557f('0x39')]=_[_0x557f('0x3b')](_0x1c6129['where'],{'$or':_[_0x557f('0x2a')](_0x11cd33,function(_0x3814b5){if(_0x3814b5[_0x557f('0x2e')]!=='VIRTUAL'){var _0x3defc4={};_0x3defc4[_0x3814b5[_0x557f('0x27')]]={'$like':'%'+_0x5deed8['query']['filter']+'%'};return _0x3defc4;}})});}_0x1c6129=_['merge']({},_0x1c6129,_0x5deed8[_0x557f('0x3c')]);var _0x2d75f0={'where':_0x1c6129[_0x557f('0x39')]};return db['VoiceDialReport']['count'](_0x2d75f0)[_0x557f('0x25')](function(_0x941235){_0x1f869f[_0x557f('0x1f')]=_0x941235;if(_0x5deed8[_0x557f('0x30')][_0x557f('0x3d')]){_0x1c6129[_0x557f('0x3e')]=[{'all':!![]}];}return db[_0x557f('0x2b')]['findAll'](_0x1c6129);})[_0x557f('0x25')](function(_0x175171){_0x1f869f[_0x557f('0x3f')]=_0x175171;return _0x1f869f;})[_0x557f('0x25')](respondWithFilteredResult(_0x487fa1,_0x1c6129))[_0x557f('0x40')](handleError(_0x487fa1,null));};exports[_0x557f('0x41')]=function(_0x1b33a5,_0x2c7bc0){var _0x193e82={'raw':!![],'where':{'id':_0x1b33a5[_0x557f('0x42')]['id']}},_0x5021d6={};_0x5021d6[_0x557f('0x43')]=_[_0x557f('0x31')](db[_0x557f('0x2b')][_0x557f('0x2c')]);_0x5021d6[_0x557f('0x30')]=_[_0x557f('0x31')](_0x1b33a5[_0x557f('0x30')]);_0x5021d6[_0x557f('0x32')]=_[_0x557f('0x33')](_0x5021d6['model'],_0x5021d6['query']);_0x193e82[_0x557f('0x34')]=_[_0x557f('0x33')](_0x5021d6[_0x557f('0x43')],qs[_0x557f('0x35')](_0x1b33a5['query'][_0x557f('0x35')]));_0x193e82['attributes']=_0x193e82[_0x557f('0x34')]['length']?_0x193e82[_0x557f('0x34')]:_0x5021d6[_0x557f('0x43')];if(_0x1b33a5[_0x557f('0x30')][_0x557f('0x3d')]){_0x193e82[_0x557f('0x3e')]=[{'all':!![]}];}_0x193e82=_[_0x557f('0x3b')]({},_0x193e82,_0x1b33a5[_0x557f('0x3c')]);return db[_0x557f('0x2b')][_0x557f('0x44')](_0x193e82)[_0x557f('0x25')](handleEntityNotFound(_0x2c7bc0,null))['then'](respondWithResult(_0x2c7bc0,null))['catch'](handleError(_0x2c7bc0,null));};exports[_0x557f('0x45')]=function(_0xdefe83,_0x583a2c){return db[_0x557f('0x2b')]['create'](_0xdefe83[_0x557f('0x46')],{})[_0x557f('0x25')](respondWithResult(_0x583a2c,0xc9))[_0x557f('0x40')](handleError(_0x583a2c,null));};exports['update']=function(_0x314a60,_0x53ebc7){if(_0x314a60[_0x557f('0x46')]['id']){delete _0x314a60[_0x557f('0x46')]['id'];}return db[_0x557f('0x2b')][_0x557f('0x44')]({'where':{'id':_0x314a60[_0x557f('0x42')]['id']}})[_0x557f('0x25')](handleEntityNotFound(_0x53ebc7,null))[_0x557f('0x25')](saveUpdates(_0x314a60[_0x557f('0x46')],null))[_0x557f('0x25')](respondWithResult(_0x53ebc7,null))[_0x557f('0x40')](handleError(_0x53ebc7,null));};exports[_0x557f('0x47')]=function(_0x205bc8,_0x3bceec){return db['VoiceDialReport'][_0x557f('0x44')]({'where':{'id':_0x205bc8['params']['id']}})[_0x557f('0x25')](handleEntityNotFound(_0x3bceec,null))[_0x557f('0x25')](removeEntity(_0x3bceec,null))[_0x557f('0x40')](handleError(_0x3bceec,null));};exports['describe']=function(_0x2e2f46,_0x280bd2){return db[_0x557f('0x2b')][_0x557f('0x48')]()['then'](respondWithResult(_0x280bd2,null))[_0x557f('0x40')](handleError(_0x280bd2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b332a2e..90926e6 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 _0x75f3=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','util'];(function(_0x535956,_0x411673){var _0x5b21ab=function(_0x428d54){while(--_0x428d54){_0x535956['push'](_0x535956['shift']());}};_0x5b21ab(++_0x411673);}(_0x75f3,0xc5));var _0x375f=function(_0x4d5f1e,_0x48e569){_0x4d5f1e=_0x4d5f1e-0x0;var _0x4fa718=_0x75f3[_0x4d5f1e];return _0x4fa718;};'use strict';var _=require('lodash');var util=require(_0x375f('0x0'));var logger=require(_0x375f('0x1'))('api');var moment=require(_0x375f('0x2'));var BPromise=require('bluebird');var rp=require(_0x375f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x375f('0x4'));var config=require(_0x375f('0x5'));var attributes=require(_0x375f('0x6'));module[_0x375f('0x7')]=function(_0x1f5933,_0x5b84e6){return _0x1f5933[_0x375f('0x8')]('VoiceDialReport',attributes,{'tableName':_0x375f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x375f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a6c=['util','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','uniqueid','lodash'];(function(_0x366381,_0x4de065){var _0x2ad4ca=function(_0x2f7569){while(--_0x2f7569){_0x366381['push'](_0x366381['shift']());}};_0x2ad4ca(++_0x4de065);}(_0x6a6c,0x199));var _0xc6a6=function(_0x4742d8,_0x3444fa){_0x4742d8=_0x4742d8-0x0;var _0x636a03=_0x6a6c[_0x4742d8];return _0x636a03;};'use strict';var _=require(_0xc6a6('0x0'));var util=require(_0xc6a6('0x1'));var logger=require('../../config/logger')(_0xc6a6('0x2'));var moment=require('moment');var BPromise=require(_0xc6a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6a6('0x4'));var rimraf=require(_0xc6a6('0x5'));var config=require(_0xc6a6('0x6'));var attributes=require(_0xc6a6('0x7'));module[_0xc6a6('0x8')]=function(_0x539ec0,_0xb00b28){return _0x539ec0['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc6a6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2783760..6f61603 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 _0xc6df=['VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceDialReport','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','attributes','limit','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x635e28,_0x4eecc1){var _0x5bb9dc=function(_0x4e4486){while(--_0x4e4486){_0x635e28['push'](_0x635e28['shift']());}};_0x5bb9dc(++_0x4eecc1);}(_0xc6df,0x16a));var _0xfc6d=function(_0xf17724,_0x35a8c9){_0xf17724=_0xf17724-0x0;var _0xc66974=_0xc6df[_0xf17724];return _0xc66974;};'use strict';var _=require(_0xfc6d('0x0'));var util=require(_0xfc6d('0x1'));var moment=require('moment');var BPromise=require(_0xfc6d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc6d('0x4'))(_0xfc6d('0x5'));var config=require('../../config/environment');var jayson=require(_0xfc6d('0x6'));var client=jayson[_0xfc6d('0x7')][_0xfc6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e4c2f,_0x49677d,_0x4e7ac5){return new BPromise(function(_0x15d60b,_0x4f8138){return client[_0xfc6d('0x9')](_0x2e4c2f,_0x4e7ac5)[_0xfc6d('0xa')](function(_0xbfcbf6){logger[_0xfc6d('0xb')](_0xfc6d('0xc'),_0x49677d,_0xfc6d('0xd'));logger[_0xfc6d('0xe')](_0xfc6d('0xf'),_0x49677d,_0xfc6d('0xd'),JSON[_0xfc6d('0x10')](_0xbfcbf6));if(_0xbfcbf6[_0xfc6d('0x11')]){if(_0xbfcbf6[_0xfc6d('0x11')][_0xfc6d('0x12')]===0x1f4){logger[_0xfc6d('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x49677d,_0xbfcbf6['error'][_0xfc6d('0x13')]);return _0x4f8138(_0xbfcbf6[_0xfc6d('0x11')][_0xfc6d('0x13')]);}logger[_0xfc6d('0x11')](_0xfc6d('0xc'),_0x49677d,_0xbfcbf6[_0xfc6d('0x11')]['message']);return _0x15d60b(_0xbfcbf6[_0xfc6d('0x11')][_0xfc6d('0x13')]);}else{logger[_0xfc6d('0xb')](_0xfc6d('0xc'),_0x49677d,_0xfc6d('0xd'));_0x15d60b(_0xbfcbf6['result']['message']);}})[_0xfc6d('0x14')](function(_0x26badf){logger[_0xfc6d('0x11')](_0xfc6d('0xc'),_0x49677d,_0x26badf);_0x4f8138(_0x26badf);});});}exports['CreateVoiceDialReport']=function(_0x455dc4){var _0x3dc6f8=this;return new Promise(function(_0x5cb73d,_0x1b1e1b){return db[_0xfc6d('0x15')]['create'](_0x455dc4['body'],{'raw':_0x455dc4[_0xfc6d('0x16')]?_0x455dc4[_0xfc6d('0x16')][_0xfc6d('0x17')]===undefined?!![]:![]:!![]})[_0xfc6d('0xa')](function(_0x2298db){logger[_0xfc6d('0xb')](_0xfc6d('0x18'),_0x455dc4);logger['debug'](_0xfc6d('0x18'),_0x455dc4,JSON['stringify'](_0x2298db));_0x5cb73d(_0x2298db);})[_0xfc6d('0x14')](function(_0x3ef90f){logger['error'](_0xfc6d('0x18'),_0x3ef90f[_0xfc6d('0x13')],_0x455dc4);_0x1b1e1b(_0x3dc6f8[_0xfc6d('0x11')](0x1f4,_0x3ef90f[_0xfc6d('0x13')]));});});};exports[_0xfc6d('0x19')]=function(_0x10e0e7){var _0x1bf590=this;return new Promise(function(_0x2612f7,_0x45a51f){return db['VoiceDialReport'][_0xfc6d('0x1a')](_0x10e0e7['body'],{'raw':_0x10e0e7[_0xfc6d('0x16')]?_0x10e0e7[_0xfc6d('0x16')][_0xfc6d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10e0e7['options']?_0x10e0e7[_0xfc6d('0x16')]['where']||null:null,'attributes':_0x10e0e7[_0xfc6d('0x16')]?_0x10e0e7[_0xfc6d('0x16')][_0xfc6d('0x1b')]||null:null,'limit':_0x10e0e7[_0xfc6d('0x16')]?_0x10e0e7[_0xfc6d('0x16')][_0xfc6d('0x1c')]||null:null})[_0xfc6d('0xa')](function(_0x157b34){logger[_0xfc6d('0xb')]('UpdateVoiceDialReport',_0x10e0e7);logger[_0xfc6d('0xe')](_0xfc6d('0x19'),_0x10e0e7,JSON[_0xfc6d('0x10')](_0x157b34));_0x2612f7(_0x157b34);})['catch'](function(_0x37b6c0){logger[_0xfc6d('0x11')]('UpdateVoiceDialReport',_0x37b6c0[_0xfc6d('0x13')],_0x10e0e7);_0x45a51f(_0x1bf590[_0xfc6d('0x11')](0x1f4,_0x37b6c0['message']));});});}; \ No newline at end of file +var _0x2217=['error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','create','body','raw','then','VoiceDialReport','options','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x437ccb,_0x50a121){var _0x5400c5=function(_0x40c0a7){while(--_0x40c0a7){_0x437ccb['push'](_0x437ccb['shift']());}};_0x5400c5(++_0x50a121);}(_0x2217,0x165));var _0x7221=function(_0x26e3b0,_0x42f177){_0x26e3b0=_0x26e3b0-0x0;var _0x5928be=_0x2217[_0x26e3b0];return _0x5928be;};'use strict';var _=require(_0x7221('0x0'));var util=require(_0x7221('0x1'));var moment=require(_0x7221('0x2'));var BPromise=require(_0x7221('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7221('0x4'));var db=require(_0x7221('0x5'))['db'];var utils=require(_0x7221('0x6'));var logger=require(_0x7221('0x7'))(_0x7221('0x8'));var config=require(_0x7221('0x9'));var jayson=require(_0x7221('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32fa9c,_0x355ab1,_0x1a60f0){return new BPromise(function(_0x3e74c3,_0x4f8a68){return client[_0x7221('0xb')](_0x32fa9c,_0x1a60f0)['then'](function(_0x19efc){logger[_0x7221('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x355ab1,_0x7221('0xd'));logger[_0x7221('0xe')](_0x7221('0xf'),_0x355ab1,_0x7221('0xd'),JSON[_0x7221('0x10')](_0x19efc));if(_0x19efc[_0x7221('0x11')]){if(_0x19efc[_0x7221('0x11')][_0x7221('0x12')]===0x1f4){logger['error'](_0x7221('0x13'),_0x355ab1,_0x19efc[_0x7221('0x11')]['message']);return _0x4f8a68(_0x19efc[_0x7221('0x11')][_0x7221('0x14')]);}logger[_0x7221('0x11')](_0x7221('0x13'),_0x355ab1,_0x19efc[_0x7221('0x11')][_0x7221('0x14')]);return _0x3e74c3(_0x19efc[_0x7221('0x11')]['message']);}else{logger[_0x7221('0xc')](_0x7221('0x13'),_0x355ab1,_0x7221('0xd'));_0x3e74c3(_0x19efc[_0x7221('0x15')][_0x7221('0x14')]);}})[_0x7221('0x16')](function(_0x18b0f5){logger[_0x7221('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x355ab1,_0x18b0f5);_0x4f8a68(_0x18b0f5);});});}exports[_0x7221('0x17')]=function(_0x3d4011){var _0x409417=this;return new Promise(function(_0x152d85,_0x2b28f6){return db['VoiceDialReport'][_0x7221('0x18')](_0x3d4011[_0x7221('0x19')],{'raw':_0x3d4011['options']?_0x3d4011['options'][_0x7221('0x1a')]===undefined?!![]:![]:!![]})[_0x7221('0x1b')](function(_0x542d5f){logger[_0x7221('0xc')](_0x7221('0x17'),_0x3d4011);logger['debug'](_0x7221('0x17'),_0x3d4011,JSON[_0x7221('0x10')](_0x542d5f));_0x152d85(_0x542d5f);})['catch'](function(_0x37f004){logger['error'](_0x7221('0x17'),_0x37f004[_0x7221('0x14')],_0x3d4011);_0x2b28f6(_0x409417['error'](0x1f4,_0x37f004[_0x7221('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x2ba1bc){var _0x2e5bfe=this;return new Promise(function(_0x2d66b9,_0x5eb3e3){return db[_0x7221('0x1c')]['update'](_0x2ba1bc[_0x7221('0x19')],{'raw':_0x2ba1bc['options']?_0x2ba1bc['options'][_0x7221('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba1bc[_0x7221('0x1d')]?_0x2ba1bc[_0x7221('0x1d')][_0x7221('0x1e')]||null:null,'attributes':_0x2ba1bc[_0x7221('0x1d')]?_0x2ba1bc['options'][_0x7221('0x1f')]||null:null,'limit':_0x2ba1bc[_0x7221('0x1d')]?_0x2ba1bc['options'][_0x7221('0x20')]||null:null})[_0x7221('0x1b')](function(_0x2242ae){logger['info'](_0x7221('0x21'),_0x2ba1bc);logger[_0x7221('0xe')](_0x7221('0x21'),_0x2ba1bc,JSON['stringify'](_0x2242ae));_0x2d66b9(_0x2242ae);})['catch'](function(_0x5e6610){logger[_0x7221('0x11')](_0x7221('0x21'),_0x5e6610['message'],_0x2ba1bc);_0x5eb3e3(_0x2e5bfe[_0x7221('0x11')](0x1f4,_0x5e6610[_0x7221('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ac11219..c3382c0 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 _0xfeb0=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','addApplications','put','update','delete','destroy','util','path'];(function(_0x555630,_0x113d54){var _0x4aae78=function(_0x2df193){while(--_0x2df193){_0x555630['push'](_0x555630['shift']());}};_0x4aae78(++_0x113d54);}(_0xfeb0,0xe8));var _0x0feb=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0xfeb0[_0x5bdd93];return _0x2caf5e;};'use strict';var multer=require('multer');var util=require(_0x0feb('0x0'));var path=require(_0x0feb('0x1'));var timeout=require(_0x0feb('0x2'));var express=require(_0x0feb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0feb('0x4'));var interaction=require(_0x0feb('0x5'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x0feb('0x6')]('/',auth[_0x0feb('0x7')](),controller[_0x0feb('0x8')]);router['get'](_0x0feb('0x9'),auth[_0x0feb('0x7')](),controller[_0x0feb('0xa')]);router[_0x0feb('0xb')]('/',auth['isAuthenticated'](),controller[_0x0feb('0xc')]);router[_0x0feb('0xb')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0feb('0xd')]);router[_0x0feb('0xe')]('/:id',auth[_0x0feb('0x7')](),controller[_0x0feb('0xf')]);router[_0x0feb('0x10')](_0x0feb('0x9'),auth[_0x0feb('0x7')](),controller[_0x0feb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8242=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x17983f,_0x9af9ac){var _0x2e4bd0=function(_0xbb3859){while(--_0xbb3859){_0x17983f['push'](_0x17983f['shift']());}};_0x2e4bd0(++_0x9af9ac);}(_0x8242,0x10b));var _0x2824=function(_0x33bbf7,_0x4e8d3c){_0x33bbf7=_0x33bbf7-0x0;var _0x512156=_0x8242[_0x33bbf7];return _0x512156;};'use strict';var multer=require(_0x2824('0x0'));var util=require(_0x2824('0x1'));var path=require(_0x2824('0x2'));var timeout=require('connect-timeout');var express=require(_0x2824('0x3'));var router=express['Router']();var fs_extra=require(_0x2824('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2824('0x5'));var controller=require(_0x2824('0x6'));router[_0x2824('0x7')]('/',auth[_0x2824('0x8')](),controller[_0x2824('0x9')]);router[_0x2824('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2824('0xa')]);router[_0x2824('0xb')]('/',auth[_0x2824('0x8')](),controller[_0x2824('0xc')]);router[_0x2824('0xb')](_0x2824('0xd'),auth['isAuthenticated'](),controller['addApplications']);router[_0x2824('0xe')]('/:id',auth[_0x2824('0x8')](),controller['update']);router[_0x2824('0xf')]('/:id',auth[_0x2824('0x8')](),controller[_0x2824('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d6cecc6..ae5b4eb 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 _0x0534=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','compositeIndex','STRING','inbound','internal','system','any'];(function(_0x1ffd80,_0x2f0dd2){var _0x1fba12=function(_0x470a83){while(--_0x470a83){_0x1ffd80['push'](_0x1ffd80['shift']());}};_0x1fba12(++_0x2f0dd2);}(_0x0534,0x17f));var _0x4053=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x0534[_0x49052b];return _0x48c045;};'use strict';var Sequelize=require('sequelize');module[_0x4053('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4053('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4053('0x2')],'allowNull':![],'unique':_0x4053('0x1')},'priority':{'type':Sequelize[_0x4053('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4053('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4053('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x4053('0x3'),'outbound',_0x4053('0x4'),'inbound-fax','outbound-fax',_0x4053('0x5'),_0x4053('0x6')),'allowNull':![]},'description':{'type':Sequelize[_0x4053('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4053('0x7')},'IntervalId':{'type':Sequelize[_0x4053('0x8')]},'isApp':{'type':Sequelize[_0x4053('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x4053('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4053('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4053('0x8')]},'recordingFormat':{'type':Sequelize[_0x4053('0x2')],'defaultValue':_0x4053('0xa')},'answer':{'type':Sequelize[_0x4053('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4053('0xb')],'get':function(_0x12bfda){return this[_0x4053('0xc')]('exten');}},'alias':{'type':Sequelize[_0x4053('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xcd62=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xcd62,0x11f));var _0x2cd6=function(_0x266a59,_0x297b01){_0x266a59=_0x266a59-0x0;var _0x3be406=_0xcd62[_0x266a59];return _0x3be406;};'use strict';var Sequelize=require(_0x2cd6('0x0'));module[_0x2cd6('0x1')]={'context':{'type':Sequelize[_0x2cd6('0x2')],'allowNull':![],'unique':_0x2cd6('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2cd6('0x2')],'allowNull':![],'unique':_0x2cd6('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x2cd6('0x3')},'tag':{'type':Sequelize[_0x2cd6('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2cd6('0x2')],'allowNull':![],'defaultValue':_0x2cd6('0x4')},'appdata':{'type':Sequelize[_0x2cd6('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2cd6('0x5')](_0x2cd6('0x6'),_0x2cd6('0x7'),_0x2cd6('0x8'),_0x2cd6('0x9'),_0x2cd6('0xa'),_0x2cd6('0xb'),_0x2cd6('0xc')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2cd6('0xd')},'IntervalId':{'type':Sequelize[_0x2cd6('0xe')]},'isApp':{'type':Sequelize[_0x2cd6('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2cd6('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x2cd6('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x2cd6('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x2cd6('0x10')],'get':function(_0x2822f4){return this[_0x2cd6('0x11')](_0x2cd6('0x12'));}},'alias':{'type':Sequelize[_0x2cd6('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 14e9150..45c726b 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 _0x644f=['VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','json','offset','limit','undefined','count','status','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne'];(function(_0x426afe,_0x1564ac){var _0x4dd648=function(_0x57224d){while(--_0x57224d){_0x426afe['push'](_0x426afe['shift']());}};_0x4dd648(++_0x1564ac);}(_0x644f,0xc2));var _0xf644=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x644f[_0x44454f];return _0x475150;};'use strict';var _=require(_0xf644('0x0'));var Redis=require(_0xf644('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf644('0x2'));var config=require(_0xf644('0x3'));var db=require(_0xf644('0x4'))['db'];config[_0xf644('0x5')]=_[_0xf644('0x6')](config[_0xf644('0x5')],{'host':_0xf644('0x7'),'port':0x18eb});var socket=require(_0xf644('0x8'))(new Redis(config[_0xf644('0x5')]));require(_0xf644('0x9'))[_0xf644('0xa')](socket);function respondWithStatusCode(_0x454018,_0x50362e){_0x50362e=_0x50362e||0xcc;return function(_0x2c2868){if(_0x2c2868){return _0x454018[_0xf644('0xb')](_0x50362e);}return _0x454018['status'](_0x50362e)[_0xf644('0xc')]();};}function respondWithResult(_0x5746ae,_0x4efb6b){_0x4efb6b=_0x4efb6b||0xc8;return function(_0x390284){if(_0x390284){return _0x5746ae['status'](_0x4efb6b)[_0xf644('0xd')](_0x390284);}};}function respondWithFilteredResult(_0x865312,_0x4d0b61){return function(_0x466361){if(_0x466361){var _0x27c7c5=typeof _0x4d0b61[_0xf644('0xe')]==='undefined'&&typeof _0x4d0b61[_0xf644('0xf')]===_0xf644('0x10');var _0x516f19=_0x466361[_0xf644('0x11')];var _0xaa5d1c=_0x27c7c5?0x0:_0x4d0b61['offset'];var _0x400906=_0x27c7c5?_0x466361[_0xf644('0x11')]:_0x4d0b61[_0xf644('0xe')]+_0x4d0b61[_0xf644('0xf')];var _0x5180f0;if(_0x400906>=_0x516f19){_0x400906=_0x516f19;_0x5180f0=0xc8;}else{_0x5180f0=0xce;}_0x865312[_0xf644('0x12')](_0x5180f0);return _0x865312[_0xf644('0x13')]('Content-Range',_0xaa5d1c+'-'+_0x400906+'/'+_0x516f19)['json'](_0x466361);}return null;};}function removeEntity(_0x4c197b){return function(_0x4e2af5){if(_0x4e2af5){return _0x4e2af5[_0xf644('0x14')]()[_0xf644('0x15')](function(){var _0x34dec2=_0x4e2af5[_0xf644('0x16')]({'plain':!![]});var _0x5f38f9=[{'name':_0xf644('0x17'),'value':_0xf644('0x18'),'ignore':![]},{'name':_0xf644('0x19'),'value':_0xf644('0x1a'),'ignore':![]},{'name':_0xf644('0x1b'),'value':'internal','ignore':![]}];var _0x4beeb0=_(_0x5f38f9)[_0xf644('0x1c')](_0xf644('0x1d'))[_0xf644('0x1e')](_0xf644('0x1f'))[_0xf644('0x1f')]();if(_[_0xf644('0x20')](_0x4beeb0,_0x34dec2[_0xf644('0x21')])){return;}var _0x20c0fb=_['find'](_0x5f38f9,[_0xf644('0x1f'),_0x34dec2[_0xf644('0x21')]])[_0xf644('0x22')];return db[_0xf644('0x23')]['destroy']({'where':{'type':_0x20c0fb,'resourceId':_0x34dec2['id']}})[_0xf644('0x15')](function(){return _0x4e2af5;});})[_0xf644('0x15')](function(){_0x4c197b[_0xf644('0x12')](0xcc)[_0xf644('0xc')]();});}};}function handleEntityNotFound(_0xc2a8fc){return function(_0x3173c1){if(!_0x3173c1){_0xc2a8fc[_0xf644('0xb')](0x194);}return _0x3173c1;};}function handleError(_0x4cb86c,_0x4b6369){_0x4b6369=_0x4b6369||0x1f4;return function(_0x22febe){logger[_0xf644('0x24')](_0x22febe[_0xf644('0x25')]);if(_0x22febe[_0xf644('0x22')]){delete _0x22febe[_0xf644('0x22')];}_0x4cb86c[_0xf644('0x12')](_0x4b6369)[_0xf644('0x26')](_0x22febe);};}exports[_0xf644('0x27')]=function(_0x5b39e0,_0x32e8d8){var _0x3705a0={},_0x54f81b={},_0x5acb2a={'count':0x0,'rows':[]};var _0x21fbc8=_[_0xf644('0x1e')](db[_0xf644('0x28')][_0xf644('0x29')],function(_0x2bcb20){return{'name':_0x2bcb20[_0xf644('0x2a')],'type':_0x2bcb20[_0xf644('0x21')]['key']};});_0x54f81b[_0xf644('0x2b')]=_[_0xf644('0x1e')](_0x21fbc8,'name');_0x54f81b['query']=_[_0xf644('0x2c')](_0x5b39e0[_0xf644('0x2d')]);_0x54f81b[_0xf644('0x2e')]=_[_0xf644('0x2f')](_0x54f81b[_0xf644('0x2b')],_0x54f81b[_0xf644('0x2d')]);_0x3705a0[_0xf644('0x30')]=_[_0xf644('0x2f')](_0x54f81b[_0xf644('0x2b')],qs[_0xf644('0x31')](_0x5b39e0['query']['fields']));_0x3705a0[_0xf644('0x30')]=_0x3705a0[_0xf644('0x30')][_0xf644('0x32')]?_0x3705a0[_0xf644('0x30')]:_0x54f81b[_0xf644('0x2b')];if(!_0x5b39e0[_0xf644('0x2d')][_0xf644('0x33')]('nolimit')){_0x3705a0[_0xf644('0xf')]=qs['limit'](_0x5b39e0['query'][_0xf644('0xf')]);_0x3705a0[_0xf644('0xe')]=qs[_0xf644('0xe')](_0x5b39e0['query']['offset']);}_0x3705a0[_0xf644('0x34')]=qs[_0xf644('0x35')](_0x5b39e0[_0xf644('0x2d')]['sort']);_0x3705a0[_0xf644('0x36')]=qs[_0xf644('0x2e')](_['pick'](_0x5b39e0[_0xf644('0x2d')],_0x54f81b[_0xf644('0x2e')]),_0x21fbc8);if(_0x5b39e0[_0xf644('0x2d')][_0xf644('0x1c')]){_0x3705a0[_0xf644('0x36')]=_[_0xf644('0x37')](_0x3705a0['where'],{'$or':_[_0xf644('0x1e')](_0x21fbc8,function(_0x4e51fd){if(_0x4e51fd[_0xf644('0x21')]!==_0xf644('0x38')){var _0x1d81a9={};_0x1d81a9[_0x4e51fd[_0xf644('0x22')]]={'$like':'%'+_0x5b39e0[_0xf644('0x2d')][_0xf644('0x1c')]+'%'};return _0x1d81a9;}})});}_0x3705a0=_['merge']({},_0x3705a0,_0x5b39e0[_0xf644('0x39')]);var _0x2b8781={'where':_0x3705a0[_0xf644('0x36')]};return db['VoiceExtension']['count'](_0x2b8781)[_0xf644('0x15')](function(_0x26bdea){_0x5acb2a[_0xf644('0x11')]=_0x26bdea;if(_0x5b39e0[_0xf644('0x2d')]['includeAll']){_0x3705a0[_0xf644('0x3a')]=[{'all':!![]}];}return db['VoiceExtension'][_0xf644('0x3b')](_0x3705a0);})['then'](function(_0x2d9f52){_0x5acb2a[_0xf644('0x3c')]=_0x2d9f52;return _0x5acb2a;})[_0xf644('0x15')](respondWithFilteredResult(_0x32e8d8,_0x3705a0))[_0xf644('0x3d')](handleError(_0x32e8d8,null));};exports['show']=function(_0xf0d5d,_0x266bf4){var _0x565e83={'raw':![],'where':{'id':_0xf0d5d[_0xf644('0x3e')]['id']}},_0x29b511={};_0x29b511['model']=_[_0xf644('0x2c')](db['VoiceExtension'][_0xf644('0x29')]);_0x29b511[_0xf644('0x2d')]=_[_0xf644('0x2c')](_0xf0d5d[_0xf644('0x2d')]);_0x29b511[_0xf644('0x2e')]=_['intersection'](_0x29b511[_0xf644('0x2b')],_0x29b511[_0xf644('0x2d')]);_0x565e83[_0xf644('0x30')]=_[_0xf644('0x2f')](_0x29b511[_0xf644('0x2b')],qs['fields'](_0xf0d5d[_0xf644('0x2d')][_0xf644('0x31')]));_0x565e83[_0xf644('0x30')]=_0x565e83['attributes'][_0xf644('0x32')]?_0x565e83[_0xf644('0x30')]:_0x29b511[_0xf644('0x2b')];if(_0xf0d5d[_0xf644('0x2d')]['includeAll']){_0x565e83['include']=[{'all':!![]}];}_0x565e83=_[_0xf644('0x37')]({},_0x565e83,_0xf0d5d[_0xf644('0x39')]);return db[_0xf644('0x28')][_0xf644('0x3f')](_0x565e83)['then'](handleEntityNotFound(_0x266bf4,null))['then'](respondWithResult(_0x266bf4,null))[_0xf644('0x3d')](handleError(_0x266bf4,null));};exports[_0xf644('0x14')]=function(_0x8966d6,_0x4c9838){return db[_0xf644('0x28')][_0xf644('0x3f')]({'where':{'id':_0x8966d6[_0xf644('0x3e')]['id']}})[_0xf644('0x15')](handleEntityNotFound(_0x4c9838,null))[_0xf644('0x15')](removeEntity(_0x4c9838,null))[_0xf644('0x3d')](handleError(_0x4c9838,null));};exports[_0xf644('0x40')]=function(_0x2f04c3,_0x101c35){if(_0x2f04c3['body'][_0xf644('0x21')]===_0xf644('0x1a')&&!_[_0xf644('0x41')](_0x2f04c3[_0xf644('0x42')][_0xf644('0x43')],'_')){_0x2f04c3[_0xf644('0x42')][_0xf644('0x43')]='_'['concat'](_0x2f04c3[_0xf644('0x42')][_0xf644('0x43')]);}return db['VoiceExtension']['create'](_0x2f04c3['body'],{'raw':![]})[_0xf644('0x15')](function(_0x49780d){var _0x3f1a46=_0x2f04c3[_0xf644('0x44')]['get']({'plain':!![]});if(!_0x3f1a46)throw new Error(_0xf644('0x45'));if(_0x3f1a46[_0xf644('0x46')]===_0xf644('0x44')){var _0x23c8b6=_0x49780d[_0xf644('0x16')]({'plain':!![]});var _0x46fdc1=[{'name':_0xf644('0x17'),'value':_0xf644('0x18')},{'name':'OutboundRoutes','value':_0xf644('0x1a')},{'name':_0xf644('0x1b'),'value':_0xf644('0x47')}];var _0x53701d=_[_0xf644('0x3f')](_0x46fdc1,[_0xf644('0x1f'),_0x23c8b6[_0xf644('0x21')]])['name'];return db[_0xf644('0x48')]['find']({'where':{'name':_0x53701d,'userProfileId':_0x3f1a46[_0xf644('0x49')]},'raw':!![]})['then'](function(_0x1a4c0c){if(_0x1a4c0c&&_0x1a4c0c[_0xf644('0x4a')]===0x0){return db['UserProfileResource'][_0xf644('0x40')]({'name':_0x23c8b6[_0xf644('0x22')],'resourceId':_0x23c8b6['id'],'type':_0x1a4c0c[_0xf644('0x22')],'sectionId':_0x1a4c0c['id']},{})[_0xf644('0x15')](function(){return _0x49780d;});}else{return _0x49780d;}})[_0xf644('0x3d')](function(_0x4f1d21){logger['error'](_0xf644('0x4b'),_0x4f1d21);throw _0x4f1d21;});}return _0x49780d;})[_0xf644('0x15')](respondWithResult(_0x101c35,0xc9))[_0xf644('0x3d')](handleError(_0x101c35,null));};exports[_0xf644('0x4c')]=function(_0x10b663,_0x4763c7){if(_0x10b663[_0xf644('0x42')]['id']){delete _0x10b663[_0xf644('0x42')]['id'];}return db[_0xf644('0x28')][_0xf644('0x3f')]({'where':{'id':_0x10b663[_0xf644('0x3e')]['id']}})[_0xf644('0x15')](handleEntityNotFound(_0x4763c7,null))[_0xf644('0x15')](function(_0x135e73){if(_0x135e73){return db['VoiceExtension'][_0xf644('0x4c')](_[_0xf644('0x4d')](_0x10b663[_0xf644('0x42')],[_0xf644('0x43'),_0xf644('0x4e'),_0xf644('0x4f'),_0xf644('0x50'),_0xf644('0x51'),_0xf644('0x52'),'alias']),{'where':{'context':_0x135e73[_0xf644('0x4e')],'exten':_0x135e73[_0xf644('0x43')]},'individualHooks':!![]})[_0xf644('0x15')](function(_0x5d5b29){return _0x5d5b29;});}return null;})[_0xf644('0x15')](respondWithStatusCode(_0x4763c7,null))[_0xf644('0x3d')](handleError(_0x4763c7,null));};exports['addApplications']=function(_0x4efff5,_0x24f425){var _0x479e14=_0x4efff5[_0xf644('0x3e')]['id'];var _0x131fb4=_0x4efff5[_0xf644('0x42')];var _0x52e4cd=0xc8;var _0x1ae9c9=null;return db[_0xf644('0x53')][_0xf644('0x54')]({'isolationLevel':db['sequelize'][_0xf644('0x55')][_0xf644('0x56')]['READ_COMMITTED']},function(_0x1e5906){return db['VoiceExtension'][_0xf644('0x57')]({'where':{'id':_0x479e14},'transaction':_0x1e5906})['then'](function(_0x1f13b9){if(_0x1f13b9){return db['VoiceExtension'][_0xf644('0x14')]({'where':{'VoiceExtensionId':_0x479e14},'transaction':_0x1e5906})[_0xf644('0x15')](function(){var _0x27c13d=_[_0xf644('0x1e')](_0x131fb4,function(_0x31e76a){_0x31e76a[_0xf644('0x58')]=_0x479e14;_0x31e76a[_0xf644('0x59')]=!![];return _0x31e76a;});return _0x1f13b9[_0xf644('0x5a')](_0x27c13d);})[_0xf644('0x15')](function(_0x5df96b){return db[_0xf644('0x28')]['bulkCreate'](_0x5df96b,{'transaction':_0x1e5906});});}else{_0x52e4cd=0x194;_0x1ae9c9=[];}});})[_0xf644('0x15')](function(){if(_0x52e4cd!==0x194){return db[_0xf644('0x28')][_0xf644('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x479e14},'order':_0xf644('0x5c')})['then'](function(_0x46e57b){_0x1ae9c9=_0x46e57b;});}})[_0xf644('0x3d')](function(_0x2eac5e){_0x52e4cd=0x1f4;logger[_0xf644('0x24')](_0x2eac5e[_0xf644('0x25')]);if(_0x2eac5e[_0xf644('0x22')]){delete _0x2eac5e[_0xf644('0x22')];}_0x1ae9c9=_0x2eac5e;})[_0xf644('0x5d')](function(){if(_0x1ae9c9===null){_0x24f425['sendStatus'](_0x52e4cd);}else{if(_0x52e4cd===0x1f4){_0x24f425[_0xf644('0x12')](_0x52e4cd)[_0xf644('0x26')](_0x1ae9c9);}else{_0x24f425[_0xf644('0x12')](_0x52e4cd)[_0xf644('0xd')](_0x1ae9c9);}}});}; \ No newline at end of file +var _0xb436=['hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','include','findAll','rows','catch','params','keys','includeAll','create','body','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','json','offset','limit','count','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','value','includes','type','find','UserProfileResource','stack','name','VoiceExtension','rawAttributes','fieldName','map','query','intersection','model','fields','attributes','length'];(function(_0x454656,_0xc10e62){var _0x15e7ef=function(_0x4cd2a8){while(--_0x4cd2a8){_0x454656['push'](_0x454656['shift']());}};_0x15e7ef(++_0xc10e62);}(_0xb436,0x8c));var _0x6b43=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xb436[_0x3eb713];return _0x1d7128;};'use strict';var _=require(_0x6b43('0x0'));var Redis=require(_0x6b43('0x1'));var qs=require(_0x6b43('0x2'));var logger=require(_0x6b43('0x3'))(_0x6b43('0x4'));var config=require(_0x6b43('0x5'));var db=require(_0x6b43('0x6'))['db'];config[_0x6b43('0x7')]=_[_0x6b43('0x8')](config[_0x6b43('0x7')],{'host':_0x6b43('0x9'),'port':0x18eb});var socket=require(_0x6b43('0xa'))(new Redis(config[_0x6b43('0x7')]));require(_0x6b43('0xb'))['register'](socket);function respondWithStatusCode(_0x2649ec,_0x37bcbd){_0x37bcbd=_0x37bcbd||0xcc;return function(_0x166c64){if(_0x166c64){return _0x2649ec[_0x6b43('0xc')](_0x37bcbd);}return _0x2649ec['status'](_0x37bcbd)[_0x6b43('0xd')]();};}function respondWithResult(_0x3210e6,_0xb5738a){_0xb5738a=_0xb5738a||0xc8;return function(_0x57e105){if(_0x57e105){return _0x3210e6[_0x6b43('0xe')](_0xb5738a)[_0x6b43('0xf')](_0x57e105);}};}function respondWithFilteredResult(_0x56c8d9,_0x571e84){return function(_0x926f97){if(_0x926f97){var _0x26be80=typeof _0x571e84[_0x6b43('0x10')]==='undefined'&&typeof _0x571e84[_0x6b43('0x11')]==='undefined';var _0x5c8142=_0x926f97['count'];var _0x570dc7=_0x26be80?0x0:_0x571e84['offset'];var _0x32c35c=_0x26be80?_0x926f97[_0x6b43('0x12')]:_0x571e84[_0x6b43('0x10')]+_0x571e84[_0x6b43('0x11')];var _0x467eaf;if(_0x32c35c>=_0x5c8142){_0x32c35c=_0x5c8142;_0x467eaf=0xc8;}else{_0x467eaf=0xce;}_0x56c8d9[_0x6b43('0xe')](_0x467eaf);return _0x56c8d9['set'](_0x6b43('0x13'),_0x570dc7+'-'+_0x32c35c+'/'+_0x5c8142)[_0x6b43('0xf')](_0x926f97);}return null;};}function removeEntity(_0x47f96e){return function(_0x2b7c2a){if(_0x2b7c2a){return _0x2b7c2a[_0x6b43('0x14')]()[_0x6b43('0x15')](function(){var _0x1cf7d9=_0x2b7c2a['get']({'plain':!![]});var _0xb93c3b=[{'name':_0x6b43('0x16'),'value':_0x6b43('0x17'),'ignore':![]},{'name':_0x6b43('0x18'),'value':_0x6b43('0x19'),'ignore':![]},{'name':_0x6b43('0x1a'),'value':_0x6b43('0x1b'),'ignore':![]}];var _0x5767cf=_(_0xb93c3b)[_0x6b43('0x1c')]('ignore')['map'](_0x6b43('0x1d'))['value']();if(_[_0x6b43('0x1e')](_0x5767cf,_0x1cf7d9[_0x6b43('0x1f')])){return;}var _0x58db1a=_[_0x6b43('0x20')](_0xb93c3b,[_0x6b43('0x1d'),_0x1cf7d9[_0x6b43('0x1f')]])['name'];return db[_0x6b43('0x21')][_0x6b43('0x14')]({'where':{'type':_0x58db1a,'resourceId':_0x1cf7d9['id']}})[_0x6b43('0x15')](function(){return _0x2b7c2a;});})['then'](function(){_0x47f96e[_0x6b43('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21df9d){return function(_0x27588e){if(!_0x27588e){_0x21df9d[_0x6b43('0xc')](0x194);}return _0x27588e;};}function handleError(_0x1865bc,_0x9b3d4a){_0x9b3d4a=_0x9b3d4a||0x1f4;return function(_0x5bf25f){logger['error'](_0x5bf25f[_0x6b43('0x22')]);if(_0x5bf25f[_0x6b43('0x23')]){delete _0x5bf25f[_0x6b43('0x23')];}_0x1865bc[_0x6b43('0xe')](_0x9b3d4a)['send'](_0x5bf25f);};}exports['index']=function(_0x469f7d,_0x1673a6){var _0x61d437={},_0x45fe05={},_0x366ec5={'count':0x0,'rows':[]};var _0x119aa4=_['map'](db[_0x6b43('0x24')][_0x6b43('0x25')],function(_0x7a1f60){return{'name':_0x7a1f60[_0x6b43('0x26')],'type':_0x7a1f60['type']['key']};});_0x45fe05['model']=_[_0x6b43('0x27')](_0x119aa4,_0x6b43('0x23'));_0x45fe05[_0x6b43('0x28')]=_['keys'](_0x469f7d[_0x6b43('0x28')]);_0x45fe05['filters']=_[_0x6b43('0x29')](_0x45fe05[_0x6b43('0x2a')],_0x45fe05['query']);_0x61d437['attributes']=_['intersection'](_0x45fe05[_0x6b43('0x2a')],qs[_0x6b43('0x2b')](_0x469f7d[_0x6b43('0x28')][_0x6b43('0x2b')]));_0x61d437[_0x6b43('0x2c')]=_0x61d437[_0x6b43('0x2c')][_0x6b43('0x2d')]?_0x61d437[_0x6b43('0x2c')]:_0x45fe05[_0x6b43('0x2a')];if(!_0x469f7d['query'][_0x6b43('0x2e')](_0x6b43('0x2f'))){_0x61d437['limit']=qs[_0x6b43('0x11')](_0x469f7d[_0x6b43('0x28')]['limit']);_0x61d437['offset']=qs[_0x6b43('0x10')](_0x469f7d[_0x6b43('0x28')][_0x6b43('0x10')]);}_0x61d437[_0x6b43('0x30')]=qs[_0x6b43('0x31')](_0x469f7d[_0x6b43('0x28')][_0x6b43('0x31')]);_0x61d437['where']=qs[_0x6b43('0x32')](_[_0x6b43('0x33')](_0x469f7d[_0x6b43('0x28')],_0x45fe05[_0x6b43('0x32')]),_0x119aa4);if(_0x469f7d[_0x6b43('0x28')][_0x6b43('0x1c')]){_0x61d437[_0x6b43('0x34')]=_[_0x6b43('0x35')](_0x61d437[_0x6b43('0x34')],{'$or':_[_0x6b43('0x27')](_0x119aa4,function(_0x24128e){if(_0x24128e['type']!=='VIRTUAL'){var _0x5767f7={};_0x5767f7[_0x24128e[_0x6b43('0x23')]]={'$like':'%'+_0x469f7d[_0x6b43('0x28')][_0x6b43('0x1c')]+'%'};return _0x5767f7;}})});}_0x61d437=_[_0x6b43('0x35')]({},_0x61d437,_0x469f7d['options']);var _0x3f115b={'where':_0x61d437[_0x6b43('0x34')]};return db[_0x6b43('0x24')]['count'](_0x3f115b)[_0x6b43('0x15')](function(_0x378ea9){_0x366ec5[_0x6b43('0x12')]=_0x378ea9;if(_0x469f7d[_0x6b43('0x28')]['includeAll']){_0x61d437[_0x6b43('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0x6b43('0x37')](_0x61d437);})[_0x6b43('0x15')](function(_0x1542a9){_0x366ec5[_0x6b43('0x38')]=_0x1542a9;return _0x366ec5;})['then'](respondWithFilteredResult(_0x1673a6,_0x61d437))[_0x6b43('0x39')](handleError(_0x1673a6,null));};exports['show']=function(_0x469d2a,_0x15e180){var _0x5834cd={'raw':![],'where':{'id':_0x469d2a[_0x6b43('0x3a')]['id']}},_0x2e0c0f={};_0x2e0c0f[_0x6b43('0x2a')]=_[_0x6b43('0x3b')](db[_0x6b43('0x24')][_0x6b43('0x25')]);_0x2e0c0f[_0x6b43('0x28')]=_['keys'](_0x469d2a['query']);_0x2e0c0f['filters']=_[_0x6b43('0x29')](_0x2e0c0f['model'],_0x2e0c0f[_0x6b43('0x28')]);_0x5834cd[_0x6b43('0x2c')]=_[_0x6b43('0x29')](_0x2e0c0f['model'],qs[_0x6b43('0x2b')](_0x469d2a[_0x6b43('0x28')][_0x6b43('0x2b')]));_0x5834cd[_0x6b43('0x2c')]=_0x5834cd[_0x6b43('0x2c')]['length']?_0x5834cd[_0x6b43('0x2c')]:_0x2e0c0f[_0x6b43('0x2a')];if(_0x469d2a[_0x6b43('0x28')][_0x6b43('0x3c')]){_0x5834cd[_0x6b43('0x36')]=[{'all':!![]}];}_0x5834cd=_[_0x6b43('0x35')]({},_0x5834cd,_0x469d2a['options']);return db[_0x6b43('0x24')][_0x6b43('0x20')](_0x5834cd)[_0x6b43('0x15')](handleEntityNotFound(_0x15e180,null))[_0x6b43('0x15')](respondWithResult(_0x15e180,null))['catch'](handleError(_0x15e180,null));};exports[_0x6b43('0x14')]=function(_0x3aa4ee,_0x578577){return db[_0x6b43('0x24')][_0x6b43('0x20')]({'where':{'id':_0x3aa4ee[_0x6b43('0x3a')]['id']}})['then'](handleEntityNotFound(_0x578577,null))['then'](removeEntity(_0x578577,null))[_0x6b43('0x39')](handleError(_0x578577,null));};exports[_0x6b43('0x3d')]=function(_0x1cb097,_0x32f9b4){if(_0x1cb097[_0x6b43('0x3e')]['type']===_0x6b43('0x19')&&!_[_0x6b43('0x3f')](_0x1cb097['body']['exten'],'_')){_0x1cb097[_0x6b43('0x3e')][_0x6b43('0x40')]='_'[_0x6b43('0x41')](_0x1cb097['body'][_0x6b43('0x40')]);}return db['VoiceExtension']['create'](_0x1cb097[_0x6b43('0x3e')],{'raw':![]})[_0x6b43('0x15')](function(_0x2a0f29){var _0x3111d6=_0x1cb097[_0x6b43('0x42')][_0x6b43('0x43')]({'plain':!![]});if(!_0x3111d6)throw new Error(_0x6b43('0x44'));if(_0x3111d6[_0x6b43('0x45')]===_0x6b43('0x42')){var _0x15f6cc=_0x2a0f29[_0x6b43('0x43')]({'plain':!![]});var _0x21e667=[{'name':'InboundRoutes','value':_0x6b43('0x17')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x6b43('0x1a'),'value':'internal'}];var _0x1f7023=_['find'](_0x21e667,[_0x6b43('0x1d'),_0x15f6cc[_0x6b43('0x1f')]])['name'];return db['UserProfileSection'][_0x6b43('0x20')]({'where':{'name':_0x1f7023,'userProfileId':_0x3111d6[_0x6b43('0x46')]},'raw':!![]})[_0x6b43('0x15')](function(_0x15c2cd){if(_0x15c2cd&&_0x15c2cd[_0x6b43('0x47')]===0x0){return db[_0x6b43('0x21')][_0x6b43('0x3d')]({'name':_0x15f6cc[_0x6b43('0x23')],'resourceId':_0x15f6cc['id'],'type':_0x15c2cd[_0x6b43('0x23')],'sectionId':_0x15c2cd['id']},{})[_0x6b43('0x15')](function(){return _0x2a0f29;});}else{return _0x2a0f29;}})['catch'](function(_0xa7d3e8){logger[_0x6b43('0x48')](_0x6b43('0x49'),_0xa7d3e8);throw _0xa7d3e8;});}return _0x2a0f29;})[_0x6b43('0x15')](respondWithResult(_0x32f9b4,0xc9))['catch'](handleError(_0x32f9b4,null));};exports[_0x6b43('0x4a')]=function(_0x504cd8,_0x29ffa4){if(_0x504cd8[_0x6b43('0x3e')]['id']){delete _0x504cd8['body']['id'];}return db[_0x6b43('0x24')][_0x6b43('0x20')]({'where':{'id':_0x504cd8[_0x6b43('0x3a')]['id']}})[_0x6b43('0x15')](handleEntityNotFound(_0x29ffa4,null))[_0x6b43('0x15')](function(_0x3bd50f){if(_0x3bd50f){return db[_0x6b43('0x24')][_0x6b43('0x4a')](_['pick'](_0x504cd8[_0x6b43('0x3e')],[_0x6b43('0x40'),_0x6b43('0x4b'),_0x6b43('0x4c'),_0x6b43('0x4d'),_0x6b43('0x4e'),_0x6b43('0x4f'),_0x6b43('0x50')]),{'where':{'context':_0x3bd50f[_0x6b43('0x4b')],'exten':_0x3bd50f[_0x6b43('0x40')]},'individualHooks':!![]})[_0x6b43('0x15')](function(_0x11c185){return _0x11c185;});}return null;})[_0x6b43('0x15')](respondWithStatusCode(_0x29ffa4,null))[_0x6b43('0x39')](handleError(_0x29ffa4,null));};exports[_0x6b43('0x51')]=function(_0x564846,_0x267d63){var _0x332ec2=_0x564846['params']['id'];var _0x87f783=_0x564846['body'];var _0x5023dc=0xc8;var _0x37d9aa=null;return db[_0x6b43('0x52')]['transaction']({'isolationLevel':db[_0x6b43('0x52')][_0x6b43('0x53')][_0x6b43('0x54')]['READ_COMMITTED']},function(_0x3603b4){return db[_0x6b43('0x24')]['findOne']({'where':{'id':_0x332ec2},'transaction':_0x3603b4})[_0x6b43('0x15')](function(_0x1bcb14){if(_0x1bcb14){return db[_0x6b43('0x24')][_0x6b43('0x14')]({'where':{'VoiceExtensionId':_0x332ec2},'transaction':_0x3603b4})[_0x6b43('0x15')](function(){var _0x1ca638=_[_0x6b43('0x27')](_0x87f783,function(_0x7f9c7c){_0x7f9c7c[_0x6b43('0x55')]=_0x332ec2;_0x7f9c7c[_0x6b43('0x56')]=!![];return _0x7f9c7c;});return _0x1bcb14[_0x6b43('0x57')](_0x1ca638);})[_0x6b43('0x15')](function(_0x2d55a0){return db[_0x6b43('0x24')][_0x6b43('0x58')](_0x2d55a0,{'transaction':_0x3603b4});});}else{_0x5023dc=0x194;_0x37d9aa=[];}});})[_0x6b43('0x15')](function(){if(_0x5023dc!==0x194){return db['VoiceExtension'][_0x6b43('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x332ec2},'order':_0x6b43('0x5a')})['then'](function(_0x120b5e){_0x37d9aa=_0x120b5e;});}})[_0x6b43('0x39')](function(_0x322271){_0x5023dc=0x1f4;logger[_0x6b43('0x48')](_0x322271['stack']);if(_0x322271['name']){delete _0x322271['name'];}_0x37d9aa=_0x322271;})[_0x6b43('0x5b')](function(){if(_0x37d9aa===null){_0x267d63[_0x6b43('0xc')](_0x5023dc);}else{if(_0x5023dc===0x1f4){_0x267d63[_0x6b43('0xe')](_0x5023dc)[_0x6b43('0x5c')](_0x37d9aa);}else{_0x267d63[_0x6b43('0xe')](_0x5023dc)[_0x6b43('0xf')](_0x37d9aa);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 743cc8f..bf9db0a 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 _0x4c2b=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x532122,_0x10fb92){var _0x3bdb9c=function(_0x4c9c29){while(--_0x4c9c29){_0x532122['push'](_0x532122['shift']());}};_0x3bdb9c(++_0x10fb92);}(_0x4c2b,0xca));var _0xb4c2=function(_0x520bcc,_0x54aa59){_0x520bcc=_0x520bcc-0x0;var _0x55e792=_0x4c2b[_0x520bcc];return _0x55e792;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xb4c2('0x0'))['db'][_0xb4c2('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb4c2('0x2')](0x0);var events={'afterCreate':_0xb4c2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f62a7){return function(_0x13bdb3,_0xeb6d57,_0x1c3a08){VoiceExtensionEvents[_0xb4c2('0x4')](_0x1f62a7+':'+_0x13bdb3['id'],_0x13bdb3);VoiceExtensionEvents[_0xb4c2('0x4')](_0x1f62a7,_0x13bdb3);_0x1c3a08(null);};}for(var e in events){if(events[_0xb4c2('0x5')](e)){var event=events[e];VoiceExtension[_0xb4c2('0x6')](e,emitEvent(event));}}module[_0xb4c2('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0740=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0740,0xea));var _0x0074=function(_0x56b800,_0x103dff){_0x56b800=_0x56b800-0x0;var _0x43f071=_0x0740[_0x56b800];return _0x43f071;};'use strict';var EventEmitter=require(_0x0074('0x0'));var VoiceExtension=require(_0x0074('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0074('0x2')](0x0);var events={'afterCreate':_0x0074('0x3'),'afterUpdate':_0x0074('0x4'),'afterDestroy':_0x0074('0x5')};function emitEvent(_0x39892e){return function(_0x23486c,_0xc919e,_0x5e523e){VoiceExtensionEvents[_0x0074('0x6')](_0x39892e+':'+_0x23486c['id'],_0x23486c);VoiceExtensionEvents[_0x0074('0x6')](_0x39892e,_0x23486c);_0x5e523e(null);};}for(var e in events){if(events[_0x0074('0x7')](e)){var event=events[e];VoiceExtension[_0x0074('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f3da8f5..68dfefb 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 _0x02cc=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','toLowerCase','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','alias','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN:','${EXTEN}'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x02cc,0x8f));var _0xc02c=function(_0x3b4127,_0x209478){_0x3b4127=_0x3b4127-0x0;var _0x2db373=_0x02cc[_0x3b4127];return _0x2db373;};'use strict';var _=require(_0xc02c('0x0'));var attributes=require(_0xc02c('0x1'));module[_0xc02c('0x2')]=function(_0x41a93b){var _0x45bd54=_0x41a93b[_0xc02c('0x3')];function _0x408647(_0x288493){var _0x234a12=0x2;var _0x37126b=[{'type':_0x288493[_0xc02c('0x4')],'app':_0xc02c('0x5'),'appdata':_0xc02c('0x6')+_0x288493[_0xc02c('0x4')],'context':_0x288493['context'],'exten':_0x288493['exten'],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']},{'type':_0x288493[_0xc02c('0x4')],'app':_0x288493[_0xc02c('0x7')]?'Set':'NoOp','appdata':_0x288493[_0xc02c('0x7')]?_0xc02c('0x8')+_0x288493[_0xc02c('0x7')]:_0xc02c('0x9'),'context':_0x288493[_0xc02c('0xa')],'exten':_0x288493[_0xc02c('0xb')],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']}];if(_0x288493[_0xc02c('0x4')]===_0xc02c('0xc')){_0x37126b[_0xc02c('0xd')]({'type':_0xc02c('0xc'),'app':_0xc02c('0x5'),'appdata':_0xc02c('0xe')+_0x288493['id'],'context':_0x288493[_0xc02c('0xa')],'exten':_0x288493['exten'],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']});}_0x37126b['push']({'type':_0x288493[_0xc02c('0x4')],'app':_0xc02c('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x288493[_0xc02c('0xa')],'exten':_0x288493[_0xc02c('0xb')],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']},{'type':_0x288493[_0xc02c('0x4')],'app':_0xc02c('0x5'),'appdata':_0xc02c('0xf'),'context':_0x288493['context'],'exten':_0x288493['exten'],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']},{'type':_0x288493[_0xc02c('0x4')],'app':'Set','appdata':_0xc02c('0x10'),'context':_0x288493[_0xc02c('0xa')],'exten':_0x288493[_0xc02c('0xb')],'priority':_0x234a12++,'VoiceExtensionId':_0x288493['id']});return _0x37126b;}function _0x5441c8(_0x24deec){var _0x1095cc=0x2;var _0x122ada=[{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':_0xc02c('0x12'),'context':_0x24deec['context'],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0x24deec[_0xc02c('0x7')]?_0xc02c('0x5'):_0xc02c('0x13'),'appdata':_0x24deec[_0xc02c('0x7')]?_0xc02c('0x8')+_0x24deec['alias']:'No\x20alias\x20set','context':_0x24deec['context'],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':'CDR(destination)='+(_0x24deec[_0xc02c('0x14')]?_0xc02c('0x15')+_0x24deec[_0xc02c('0x14')]+'}':_0xc02c('0x16')),'context':_0x24deec['context'],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':'outbound','app':_0xc02c('0x5'),'appdata':_0xc02c('0xe')+_0x24deec['id'],'context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':'outbound','app':_0xc02c('0x17'),'appdata':_0xc02c('0x18')+(_0x1095cc+0x2)+'):Goto('+(_0x1095cc+0x1)+')','context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':_0x24deec[_0xc02c('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x24deec[_0xc02c('0x14')]+'}':_0xc02c('0x19'),'context':_0x24deec['context'],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':_0xc02c('0x1a'),'context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':'outbound','app':_0xc02c('0x5'),'appdata':_0xc02c('0x1b')+_0x24deec['id'],'context':_0x24deec['context'],'exten':_0x24deec['exten'],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']}];if(_0x24deec[_0xc02c('0x1c')](_0xc02c('0x1d'))&&_0x24deec[_0xc02c('0x1d')]!==_0xc02c('0x1e')){_0x122ada[_0xc02c('0xd')]({'type':_0xc02c('0x11'),'app':_0xc02c('0x5'),'appdata':_0xc02c('0x1f'),'context':_0x24deec[_0xc02c('0xa')],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']},{'type':'outbound','app':_0xc02c('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x24deec['recordingFormat']||_0xc02c('0x20'),'context':_0x24deec['context'],'exten':_0x24deec[_0xc02c('0xb')],'priority':_0x1095cc++,'VoiceExtensionId':_0x24deec['id']});}return _0x122ada;}function _0x5dd0a8(_0x1d2484,_0x25f20b){var _0x368b09=[{'name':_0xc02c('0x21'),'param':0x0},{'name':_0xc02c('0x22'),'param':0x1},{'name':_0xc02c('0x23'),'param':0x2},{'name':_0xc02c('0x24'),'param':0x3}];var _0xa4d604={};var _0x2bb505=_0x25f20b['split'](',');var _0x4b8b17=[];for(var _0x5682f1=0x0;_0x5682f1<_0x368b09[_0xc02c('0x25')];_0x5682f1++){switch(_0x368b09[_0x5682f1][_0xc02c('0x26')]){case _0xc02c('0x21'):_0xa4d604['trunk']=_0x2bb505[_0x368b09[_0x5682f1][_0xc02c('0x27')]][_0xc02c('0x28')]('/')[0x1];_0xa4d604[_0xc02c('0x29')]=_0x2bb505[_0x368b09[_0x5682f1][_0xc02c('0x27')]][_0xc02c('0x28')]('/')[0x2];_0xa4d604[_0xc02c('0x2a')]=_0xa4d604['phone']?_0xa4d604[_0xc02c('0x29')][_0xc02c('0x28')]('$')[0x0]:undefined;_0xa4d604['phone']=_0x1d2484[_0xc02c('0x14')]?(_0xa4d604[_0xc02c('0x2a')]||'')+_0xc02c('0x15')+_0x1d2484[_0xc02c('0x14')]+'}':(_0xa4d604['prefix']||'')+_0xc02c('0x16');_0x4b8b17[_0x368b09[_0x5682f1][_0xc02c('0x27')]]=[_0xc02c('0x2b'),_0xa4d604['trunk'],_0xa4d604['phone']]['join']('/');break;case _0xc02c('0x23'):_0xa4d604['options']=_0x2bb505[_0x368b09[_0x5682f1]['param']];if(_0x1d2484[_0xc02c('0x1d')]!==_0xc02c('0x1e')){if(_0xa4d604[_0xc02c('0x23')][_0xc02c('0x2c')](_0xc02c('0x2d'))<0x0){_0xa4d604['options']+=_0xc02c('0x2d');}}else{_0xa4d604['options']=_0xa4d604[_0xc02c('0x23')][_0xc02c('0x2e')](_0xc02c('0x2d'),'');}_0x4b8b17[_0x368b09[_0x5682f1][_0xc02c('0x27')]]=_0xa4d604[_0xc02c('0x23')];break;default:_0x4b8b17[_0x368b09[_0x5682f1][_0xc02c('0x27')]]=_0x2bb505[_0x368b09[_0x5682f1][_0xc02c('0x27')]];}}return _0x4b8b17[_0xc02c('0x2f')](',');}function _0xf0a458(_0x46b59b,_0x2251b7,_0x11e79f){return new Promise(function(_0x590884,_0x231029){var _0x373b8d=[];if(_['isEmpty'](_0x2251b7))return _0x590884(_0x373b8d);_0x45bd54[_0xc02c('0x30')][_0xc02c('0x31')]({'attributes':['id',_0xc02c('0x32'),'IntervalId'],'raw':!![]})[_0xc02c('0x33')](function(_0x2914d3){for(var _0x3b575b=0x0,_0x415dd5=0x0;_0x3b575b<_0x2251b7[_0xc02c('0x25')];_0x3b575b++,_0x415dd5=0x0){var _0x4b3a04=_0x2251b7[_0x3b575b];var _0x3a326a=[];var _0x19d4e6=[];delete _0x4b3a04['id'];if(_0x4b3a04[_0xc02c('0x32')]!==_0xc02c('0x34')){_0x4b3a04['intervals']=[_0x4b3a04[_0xc02c('0x32')]];}else{_0x4b3a04[_0xc02c('0x35')]=_0x4b3a04[_0xc02c('0x36')]?_[_0xc02c('0x37')](_[_0xc02c('0x38')](_0x2914d3,{'IntervalId':_0x4b3a04[_0xc02c('0x36')]}),'interval'):[];}_0x4b3a04[_0xc02c('0xa')]=_0x46b59b[_0xc02c('0xa')];_0x4b3a04['exten']=_0x46b59b[_0xc02c('0xb')];if(_0x4b3a04['type'])_0x4b3a04[_0xc02c('0x4')]=_0x4b3a04[_0xc02c('0x4')]['toLowerCase']();if(_0x46b59b[_0xc02c('0x4')]===_0xc02c('0x11')){if(_0x4b3a04[_0xc02c('0x1c')]('tag')&&_0x4b3a04[_0xc02c('0x39')]&&_0x4b3a04['tag']!=='--'){_0x3a326a['push']({'type':_0x4b3a04[_0xc02c('0x4')]['toLowerCase'](),'app':'Set','appdata':'CDR(tag)='+_0x4b3a04['tag'],'context':_0x46b59b[_0xc02c('0xa')],'exten':_0x46b59b['exten'],'priority':_0x4b3a04['intervals'][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});}_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04[_0xc02c('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xc02c('0x3a')+(_0x4b3a04[_0xc02c('0x3b')]?_0xc02c('0x3c')+_0x4b3a04[_0xc02c('0x3b')]+')':_0xc02c('0x3d')),'context':_0x46b59b['context'],'exten':_0x46b59b[_0xc02c('0xb')],'priority':_0x4b3a04[_0xc02c('0x35')][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});}else{if(_0x4b3a04[_0xc02c('0x1c')]('answer')){if([_0xc02c('0x3e'),_0xc02c('0x3f')][_0xc02c('0x40')](_0x4b3a04[_0xc02c('0x41')]['toLowerCase']())&&_0x4b3a04[_0xc02c('0x42')]!=='custom'){if(_0x4b3a04[_0xc02c('0x43')]){_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04[_0xc02c('0x4')]['toLowerCase'](),'app':_0xc02c('0x17'),'appdata':_0xc02c('0x44'),'context':_0x46b59b['context'],'exten':_0x46b59b[_0xc02c('0xb')],'priority':_0x4b3a04['intervals'][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04['type'][_0xc02c('0x45')](),'app':_0xc02c('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x46b59b[_0xc02c('0xa')],'exten':_0x46b59b[_0xc02c('0xb')],'priority':_0x4b3a04['intervals'][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});}else{_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04[_0xc02c('0x4')][_0xc02c('0x45')](),'app':_0xc02c('0x17'),'appdata':_0xc02c('0x46'),'context':_0x46b59b['context'],'exten':_0x46b59b['exten'],'priority':_0x4b3a04['intervals']['length']+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04[_0xc02c('0x4')][_0xc02c('0x45')](),'app':_0xc02c('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x46b59b['context'],'exten':_0x46b59b[_0xc02c('0xb')],'priority':_0x4b3a04[_0xc02c('0x35')][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});}}}}for(var _0x5195c3=0x0;_0x5195c3<_0x4b3a04['intervals']['length'];_0x5195c3++){var _0x3049a5=_0x11e79f+_0x4b3a04[_0xc02c('0x35')]['length'];var _0x1c86ee=_0x5195c3===_0x4b3a04['intervals'][_0xc02c('0x25')]-0x1?_0x11e79f+_0x3a326a['length']+_0x19d4e6[_0xc02c('0x25')]+0x2:_0x11e79f+_0x5195c3+0x1;_0x3a326a[_0xc02c('0x47')](_0x5195c3,0x0,{'type':_0x46b59b['type'],'app':_0xc02c('0x48'),'appdata':_0x4b3a04[_0xc02c('0x35')][_0x5195c3]+'?'+_0x46b59b[_0xc02c('0xa')]+_0xc02c('0x49')+_0x3049a5+':'+_0x46b59b[_0xc02c('0xa')]+_0xc02c('0x49')+_0x1c86ee,'exten':_0x46b59b[_0xc02c('0xb')],'context':_0x46b59b[_0xc02c('0xa')],'priority':_0x11e79f+_0x5195c3,'VoiceExtensionId':_0x46b59b['id']});}if(_0x4b3a04['appType']==='outboundDial'){_0x4b3a04[_0xc02c('0x4a')]=_0x5dd0a8(_0x46b59b,_0x4b3a04[_0xc02c('0x4a')]);}if(_0x4b3a04[_0xc02c('0x42')]==='agi'){_0x3a326a[_0xc02c('0xd')]({'type':_0x4b3a04[_0xc02c('0x4')]['toLowerCase'](),'app':_0xc02c('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x46b59b['context'],'exten':_0x46b59b[_0xc02c('0xb')],'priority':_0x4b3a04[_0xc02c('0x35')][_0xc02c('0x25')]+_0x11e79f+_0x415dd5++,'VoiceExtensionId':_0x46b59b['id']});}_0x4b3a04[_0xc02c('0x4b')]=_0x3a326a['length']?_[_0xc02c('0x4c')](_0x3a326a)['priority']+0x1:_0x11e79f;_0x373b8d=_['concat'](_0x373b8d,_0x3a326a,[_0x4b3a04],_0x19d4e6);_0x11e79f=_[_0xc02c('0x4c')](_0x373b8d)[_0xc02c('0x4b')]+0x1;}return _0x590884(_0x373b8d);})[_0xc02c('0x4d')](function(_0x2dd381){_0x231029(_0x2dd381);});});}return _0x41a93b[_0xc02c('0x4e')](_0xc02c('0x4f'),attributes,{'tableName':_0xc02c('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x25515a){var _0x19d1d2=this[_0xc02c('0x51')]({'plain':!![]});var _0x32f13b=_0x19d1d2[_0xc02c('0x4')]===_0xc02c('0x11')?_0x5441c8(_0x19d1d2):_0x408647(_0x19d1d2);return _0xf0a458(_0x19d1d2,_0x25515a,_['last'](_0x32f13b)[_0xc02c('0x4b')]+0x1)['then'](function(_0x56cf77){var _0x196841=_[_0xc02c('0x52')](_0x32f13b,_0x56cf77);_0x196841['push']({'type':_0x19d1d2[_0xc02c('0x4')],'app':'Hangup','exten':_0x19d1d2[_0xc02c('0xb')],'context':_0x19d1d2[_0xc02c('0xa')],'priority':_[_0xc02c('0x4c')](_0x196841)['priority']+0x1,'VoiceExtensionId':_0x19d1d2['id']});return _0x196841;});}}});}; \ No newline at end of file +var _0xf128=['priority','last','concat','catch','define','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','phone','param','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf128,0x109));var _0x8f12=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xf128[_0x18d631];return _0x50d708;};'use strict';var _=require(_0x8f12('0x0'));var attributes=require(_0x8f12('0x1'));module[_0x8f12('0x2')]=function(_0x3084e8){var _0x7edfc3=_0x3084e8[_0x8f12('0x3')];function _0x306478(_0xe5af89){var _0x4d7d2d=0x2;var _0x3b63c5=[{'type':_0xe5af89[_0x8f12('0x4')],'app':_0x8f12('0x5'),'appdata':_0x8f12('0x6')+_0xe5af89['type'],'context':_0xe5af89[_0x8f12('0x7')],'exten':_0xe5af89[_0x8f12('0x8')],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']},{'type':_0xe5af89[_0x8f12('0x4')],'app':_0xe5af89['alias']?_0x8f12('0x5'):_0x8f12('0x9'),'appdata':_0xe5af89[_0x8f12('0xa')]?_0x8f12('0xb')+_0xe5af89['alias']:_0x8f12('0xc'),'context':_0xe5af89['context'],'exten':_0xe5af89['exten'],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']}];if(_0xe5af89[_0x8f12('0x4')]===_0x8f12('0xd')){_0x3b63c5['push']({'type':_0x8f12('0xd'),'app':'Set','appdata':'CDR(routeid)='+_0xe5af89['id'],'context':_0xe5af89[_0x8f12('0x7')],'exten':_0xe5af89['exten'],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']});}_0x3b63c5[_0x8f12('0xe')]({'type':_0xe5af89[_0x8f12('0x4')],'app':_0x8f12('0x5'),'appdata':_0x8f12('0xf'),'context':_0xe5af89[_0x8f12('0x7')],'exten':_0xe5af89[_0x8f12('0x8')],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']},{'type':_0xe5af89[_0x8f12('0x4')],'app':'Set','appdata':_0x8f12('0x10'),'context':_0xe5af89[_0x8f12('0x7')],'exten':_0xe5af89[_0x8f12('0x8')],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']},{'type':_0xe5af89[_0x8f12('0x4')],'app':_0x8f12('0x5'),'appdata':_0x8f12('0x11'),'context':_0xe5af89[_0x8f12('0x7')],'exten':_0xe5af89['exten'],'priority':_0x4d7d2d++,'VoiceExtensionId':_0xe5af89['id']});return _0x3b63c5;}function _0x52bf35(_0x2ccf14){var _0x22d38a=0x2;var _0xaac5a4=[{'type':'outbound','app':'Set','appdata':_0x8f12('0x12'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':_0x2ccf14[_0x8f12('0xa')]?_0x8f12('0x5'):_0x8f12('0x9'),'appdata':_0x2ccf14[_0x8f12('0xa')]?_0x8f12('0xb')+_0x2ccf14['alias']:_0x8f12('0xc'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x14')+(_0x2ccf14[_0x8f12('0x15')]?_0x8f12('0x16')+_0x2ccf14[_0x8f12('0x15')]+'}':_0x8f12('0x17')),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x18')+_0x2ccf14['id'],'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':_0x8f12('0x19'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x22d38a+0x2)+'):Goto('+(_0x22d38a+0x1)+')','context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':'Set','appdata':_0x2ccf14['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x2ccf14[_0x8f12('0x15')]+'}':_0x8f12('0x1a'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':'outbound','app':'Set','appdata':_0x8f12('0xf'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':'Set','appdata':_0x8f12('0x10'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x11'),'context':_0x2ccf14['context'],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':'Set','appdata':_0x8f12('0x1b')+_0x2ccf14['id'],'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']}];if(_0x2ccf14[_0x8f12('0x1c')](_0x8f12('0x1d'))&&_0x2ccf14['recordingFormat']!==_0x8f12('0x1e')){_0xaac5a4[_0x8f12('0xe')]({'type':_0x8f12('0x13'),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x1f'),'context':_0x2ccf14[_0x8f12('0x7')],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']},{'type':_0x8f12('0x13'),'app':'Set','appdata':_0x8f12('0x20')+_0x2ccf14[_0x8f12('0x1d')]||_0x8f12('0x21'),'context':_0x2ccf14['context'],'exten':_0x2ccf14[_0x8f12('0x8')],'priority':_0x22d38a++,'VoiceExtensionId':_0x2ccf14['id']});}return _0xaac5a4;}function _0x4071fd(_0x376d4d,_0x25c6bc){var _0x2644a8=[{'name':_0x8f12('0x22'),'param':0x0},{'name':_0x8f12('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0x8f12('0x24'),'param':0x3}];var _0x3cf68a={};var _0x192872=_0x25c6bc[_0x8f12('0x25')](',');var _0x2aab20=[];for(var _0x6e49ec=0x0;_0x6e49ec<_0x2644a8[_0x8f12('0x26')];_0x6e49ec++){switch(_0x2644a8[_0x6e49ec]['name']){case _0x8f12('0x22'):_0x3cf68a[_0x8f12('0x22')]=_0x192872[_0x2644a8[_0x6e49ec]['param']][_0x8f12('0x25')]('/')[0x1];_0x3cf68a[_0x8f12('0x27')]=_0x192872[_0x2644a8[_0x6e49ec][_0x8f12('0x28')]][_0x8f12('0x25')]('/')[0x2];_0x3cf68a[_0x8f12('0x29')]=_0x3cf68a['phone']?_0x3cf68a[_0x8f12('0x27')]['split']('$')[0x0]:undefined;_0x3cf68a['phone']=_0x376d4d['cutdigits']?(_0x3cf68a[_0x8f12('0x29')]||'')+_0x8f12('0x16')+_0x376d4d[_0x8f12('0x15')]+'}':(_0x3cf68a[_0x8f12('0x29')]||'')+'${EXTEN}';_0x2aab20[_0x2644a8[_0x6e49ec]['param']]=['SIP',_0x3cf68a['trunk'],_0x3cf68a[_0x8f12('0x27')]][_0x8f12('0x2a')]('/');break;case'options':_0x3cf68a[_0x8f12('0x2b')]=_0x192872[_0x2644a8[_0x6e49ec]['param']];if(_0x376d4d['recordingFormat']!==_0x8f12('0x1e')){if(_0x3cf68a['options'][_0x8f12('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x3cf68a[_0x8f12('0x2b')]+=_0x8f12('0x2d');}}else{_0x3cf68a[_0x8f12('0x2b')]=_0x3cf68a[_0x8f12('0x2b')][_0x8f12('0x2e')](_0x8f12('0x2d'),'');}_0x2aab20[_0x2644a8[_0x6e49ec][_0x8f12('0x28')]]=_0x3cf68a['options'];break;default:_0x2aab20[_0x2644a8[_0x6e49ec][_0x8f12('0x28')]]=_0x192872[_0x2644a8[_0x6e49ec][_0x8f12('0x28')]];}}return _0x2aab20[_0x8f12('0x2a')](',');}function _0x5f0b66(_0x4df5d3,_0x2af650,_0x2e093c){return new Promise(function(_0x5d6f6e,_0x9ae512){var _0x33b200=[];if(_[_0x8f12('0x2f')](_0x2af650))return _0x5d6f6e(_0x33b200);_0x7edfc3[_0x8f12('0x30')][_0x8f12('0x31')]({'attributes':['id',_0x8f12('0x32'),_0x8f12('0x33')],'raw':!![]})[_0x8f12('0x34')](function(_0x547f5a){for(var _0x4ac607=0x0,_0x32174b=0x0;_0x4ac607<_0x2af650[_0x8f12('0x26')];_0x4ac607++,_0x32174b=0x0){var _0x253352=_0x2af650[_0x4ac607];var _0x57b97b=[];var _0x438e3b=[];delete _0x253352['id'];if(_0x253352[_0x8f12('0x32')]!==_0x8f12('0x35')){_0x253352[_0x8f12('0x36')]=[_0x253352[_0x8f12('0x32')]];}else{_0x253352[_0x8f12('0x36')]=_0x253352[_0x8f12('0x33')]?_[_0x8f12('0x37')](_[_0x8f12('0x38')](_0x547f5a,{'IntervalId':_0x253352[_0x8f12('0x33')]}),_0x8f12('0x32')):[];}_0x253352[_0x8f12('0x7')]=_0x4df5d3[_0x8f12('0x7')];_0x253352[_0x8f12('0x8')]=_0x4df5d3[_0x8f12('0x8')];if(_0x253352[_0x8f12('0x4')])_0x253352[_0x8f12('0x4')]=_0x253352[_0x8f12('0x4')][_0x8f12('0x39')]();if(_0x4df5d3['type']===_0x8f12('0x13')){if(_0x253352['hasOwnProperty'](_0x8f12('0x3a'))&&_0x253352[_0x8f12('0x3a')]&&_0x253352[_0x8f12('0x3a')]!=='--'){_0x57b97b[_0x8f12('0xe')]({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x3b')+_0x253352[_0x8f12('0x3a')],'context':_0x4df5d3[_0x8f12('0x7')],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352[_0x8f12('0x36')][_0x8f12('0x26')]+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});}_0x57b97b[_0x8f12('0xe')]({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':_0x8f12('0x19'),'appdata':_0x8f12('0x3c')+(_0x253352[_0x8f12('0x3d')]?_0x8f12('0x3e')+_0x253352[_0x8f12('0x3d')]+')':_0x8f12('0x3f')),'context':_0x4df5d3[_0x8f12('0x7')],'exten':_0x4df5d3['exten'],'priority':_0x253352['intervals'][_0x8f12('0x26')]+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});}else{if(_0x253352[_0x8f12('0x1c')](_0x8f12('0x40'))){if([_0x8f12('0x41'),'playback'][_0x8f12('0x42')](_0x253352[_0x8f12('0x43')][_0x8f12('0x39')]())&&_0x253352[_0x8f12('0x44')]!==_0x8f12('0x45')){if(_0x253352['answer']){_0x57b97b['push']({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':_0x8f12('0x19'),'appdata':_0x8f12('0x46'),'context':_0x4df5d3[_0x8f12('0x7')],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352['intervals']['length']+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});_0x57b97b[_0x8f12('0xe')]({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':_0x8f12('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4df5d3['context'],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352[_0x8f12('0x36')][_0x8f12('0x26')]+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});}else{_0x57b97b[_0x8f12('0xe')]({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':'ExecIf','appdata':_0x8f12('0x47'),'context':_0x4df5d3['context'],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352[_0x8f12('0x36')]['length']+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});_0x57b97b['push']({'type':_0x253352[_0x8f12('0x4')][_0x8f12('0x39')](),'app':'Set','appdata':_0x8f12('0x48'),'context':_0x4df5d3[_0x8f12('0x7')],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352[_0x8f12('0x36')][_0x8f12('0x26')]+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});}}}}for(var _0x4facd6=0x0;_0x4facd6<_0x253352[_0x8f12('0x36')]['length'];_0x4facd6++){var _0x22bb61=_0x2e093c+_0x253352[_0x8f12('0x36')][_0x8f12('0x26')];var _0x59a509=_0x4facd6===_0x253352[_0x8f12('0x36')][_0x8f12('0x26')]-0x1?_0x2e093c+_0x57b97b[_0x8f12('0x26')]+_0x438e3b['length']+0x2:_0x2e093c+_0x4facd6+0x1;_0x57b97b[_0x8f12('0x49')](_0x4facd6,0x0,{'type':_0x4df5d3['type'],'app':'GotoIfTime','appdata':_0x253352['intervals'][_0x4facd6]+'?'+_0x4df5d3[_0x8f12('0x7')]+_0x8f12('0x4a')+_0x22bb61+':'+_0x4df5d3[_0x8f12('0x7')]+_0x8f12('0x4a')+_0x59a509,'exten':_0x4df5d3[_0x8f12('0x8')],'context':_0x4df5d3[_0x8f12('0x7')],'priority':_0x2e093c+_0x4facd6,'VoiceExtensionId':_0x4df5d3['id']});}if(_0x253352[_0x8f12('0x44')]===_0x8f12('0x4b')){_0x253352[_0x8f12('0x4c')]=_0x4071fd(_0x4df5d3,_0x253352[_0x8f12('0x4c')]);}if(_0x253352[_0x8f12('0x44')]===_0x8f12('0x4d')){_0x57b97b[_0x8f12('0xe')]({'type':_0x253352[_0x8f12('0x4')]['toLowerCase'](),'app':_0x8f12('0x5'),'appdata':_0x8f12('0x4e'),'context':_0x4df5d3['context'],'exten':_0x4df5d3[_0x8f12('0x8')],'priority':_0x253352['intervals'][_0x8f12('0x26')]+_0x2e093c+_0x32174b++,'VoiceExtensionId':_0x4df5d3['id']});}_0x253352[_0x8f12('0x4f')]=_0x57b97b[_0x8f12('0x26')]?_[_0x8f12('0x50')](_0x57b97b)[_0x8f12('0x4f')]+0x1:_0x2e093c;_0x33b200=_[_0x8f12('0x51')](_0x33b200,_0x57b97b,[_0x253352],_0x438e3b);_0x2e093c=_[_0x8f12('0x50')](_0x33b200)[_0x8f12('0x4f')]+0x1;}return _0x5d6f6e(_0x33b200);})[_0x8f12('0x52')](function(_0x1d3325){_0x9ae512(_0x1d3325);});});}return _0x3084e8[_0x8f12('0x53')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x35947c){var _0x4d6de1=this[_0x8f12('0x54')]({'plain':!![]});var _0x312a3f=_0x4d6de1[_0x8f12('0x4')]===_0x8f12('0x13')?_0x52bf35(_0x4d6de1):_0x306478(_0x4d6de1);return _0x5f0b66(_0x4d6de1,_0x35947c,_[_0x8f12('0x50')](_0x312a3f)[_0x8f12('0x4f')]+0x1)[_0x8f12('0x34')](function(_0x5e6bc9){var _0x456d7f=_[_0x8f12('0x51')](_0x312a3f,_0x5e6bc9);_0x456d7f['push']({'type':_0x4d6de1[_0x8f12('0x4')],'app':_0x8f12('0x55'),'exten':_0x4d6de1[_0x8f12('0x8')],'context':_0x4d6de1['context'],'priority':_[_0x8f12('0x50')](_0x456d7f)['priority']+0x1,'VoiceExtensionId':_0x4d6de1['id']});return _0x456d7f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 4b79a86..d400aae 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 _0x8411=['result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','model','include','map','debug','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x294b68,_0x3f0093){var _0x4b104b=function(_0x2037eb){while(--_0x2037eb){_0x294b68['push'](_0x294b68['shift']());}};_0x4b104b(++_0x3f0093);}(_0x8411,0x118));var _0x1841=function(_0x149003,_0x290851){_0x149003=_0x149003-0x0;var _0x4d572e=_0x8411[_0x149003];return _0x4d572e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1841('0x0'));var BPromise=require(_0x1841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1841('0x2'))['db'];var utils=require(_0x1841('0x3'));var logger=require(_0x1841('0x4'))(_0x1841('0x5'));var config=require(_0x1841('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1841('0x7')]['http']({'port':0x232a});config[_0x1841('0x8')]=_[_0x1841('0x9')](config[_0x1841('0x8')],{'host':_0x1841('0xa'),'port':0x18eb});var socket=require(_0x1841('0xb'))(new Redis(config[_0x1841('0x8')]));require(_0x1841('0xc'))[_0x1841('0xd')](socket);function respondWithRpcPromise(_0x1d967f,_0x4218ae,_0x108644){return new BPromise(function(_0x1ae8b8,_0x1a3293){return client[_0x1841('0xe')](_0x1d967f,_0x108644)[_0x1841('0xf')](function(_0xf4b1b2){logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));logger['debug'](_0x1841('0x13'),_0x4218ae,_0x1841('0x12'),JSON[_0x1841('0x14')](_0xf4b1b2));if(_0xf4b1b2['error']){if(_0xf4b1b2['error'][_0x1841('0x15')]===0x1f4){logger[_0x1841('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4218ae,_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);return _0x1a3293(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0xf4b1b2['error'][_0x1841('0x17')]);return _0x1ae8b8(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}else{logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));_0x1ae8b8(_0xf4b1b2[_0x1841('0x18')][_0x1841('0x17')]);}})[_0x1841('0x19')](function(_0x41c7ef){logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0x41c7ef);_0x1a3293(_0x41c7ef);});});}exports[_0x1841('0x1a')]=function(_0x8f6094){var _0x55f8ed=this;return new Promise(function(_0x31fbdc,_0x234fb4){return db[_0x1841('0x1b')][_0x1841('0x1c')]({'raw':_0x8f6094['options']?_0x8f6094[_0x1841('0x1d')][_0x1841('0x1e')]===undefined?!![]:![]:!![],'where':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x1f')]||null:null,'attributes':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x20')]||null:null,'limit':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x21')]||null:null,'include':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')]['include']?_['map'](_0x8f6094[_0x1841('0x1d')]['include'],function(_0x1e7491){return{'model':db[_0x1e7491[_0x1841('0x22')]],'as':_0x1e7491['as'],'attributes':_0x1e7491[_0x1841('0x20')],'include':_0x1e7491[_0x1841('0x23')]?_[_0x1841('0x24')](_0x1e7491[_0x1841('0x23')],function(_0x3b2683){return{'model':db[_0x3b2683[_0x1841('0x22')]],'as':_0x3b2683['as'],'attributes':_0x3b2683[_0x1841('0x20')],'include':_0x3b2683[_0x1841('0x23')]?_['map'](_0x3b2683['include'],function(_0x2e9f75){return{'model':db[_0x2e9f75[_0x1841('0x22')]],'as':_0x2e9f75['as'],'attributes':_0x2e9f75['attributes']};}):[]};}):[]};}):[]:[]})[_0x1841('0xf')](function(_0x302824){logger[_0x1841('0x10')](_0x1841('0x1a'),_0x8f6094);logger[_0x1841('0x25')](_0x1841('0x1a'),_0x8f6094,JSON['stringify'](_0x302824));_0x31fbdc(_0x302824);})[_0x1841('0x19')](function(_0x3c952c){logger[_0x1841('0x16')](_0x1841('0x1a'),_0x3c952c[_0x1841('0x17')],_0x8f6094);_0x234fb4(_0x55f8ed[_0x1841('0x16')](0x1f4,_0x3c952c['message']));});});}; \ No newline at end of file +var _0xbd51=['include','model','map','then','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit'];(function(_0x17c920,_0x35c3aa){var _0x3c4c41=function(_0x3608ab){while(--_0x3608ab){_0x17c920['push'](_0x17c920['shift']());}};_0x3c4c41(++_0x35c3aa);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3a9f12,_0x5ea4f7){_0x3a9f12=_0x3a9f12-0x0;var _0x9b44b4=_0xbd51[_0x3a9f12];return _0x9b44b4;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});config[_0x1bd5('0x8')]=_[_0x1bd5('0x9')](config[_0x1bd5('0x8')],{'host':_0x1bd5('0xa'),'port':0x18eb});var socket=require(_0x1bd5('0xb'))(new Redis(config['redis']));require(_0x1bd5('0xc'))['register'](socket);function respondWithRpcPromise(_0x2bd975,_0x28df8e,_0x3b868a){return new BPromise(function(_0x1fbc68,_0x2344e1){return client[_0x1bd5('0xd')](_0x2bd975,_0x3b868a)['then'](function(_0x456ef8){logger['info'](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));logger[_0x1bd5('0x10')](_0x1bd5('0x11'),_0x28df8e,_0x1bd5('0xf'),JSON[_0x1bd5('0x12')](_0x456ef8));if(_0x456ef8[_0x1bd5('0x13')]){if(_0x456ef8['error']['code']===0x1f4){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x2344e1(_0x456ef8['error']['message']);}logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x1fbc68(_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));_0x1fbc68(_0x456ef8['result']['message']);}})[_0x1bd5('0x16')](function(_0x260827){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x260827);_0x2344e1(_0x260827);});});}exports[_0x1bd5('0x17')]=function(_0x2ff39a){var _0x3fbb39=this;return new Promise(function(_0x2a746d,_0x456051){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1d')]||null:null,'limit':_0x2ff39a['options']?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1e')]||null:null,'include':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1f')]?_['map'](_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1f')],function(_0x3dba4f){return{'model':db[_0x3dba4f[_0x1bd5('0x20')]],'as':_0x3dba4f['as'],'attributes':_0x3dba4f['attributes'],'include':_0x3dba4f[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3dba4f[_0x1bd5('0x1f')],function(_0x3b1090){return{'model':db[_0x3b1090['model']],'as':_0x3b1090['as'],'attributes':_0x3b1090[_0x1bd5('0x1d')],'include':_0x3b1090[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3b1090[_0x1bd5('0x1f')],function(_0xe54b9f){return{'model':db[_0xe54b9f[_0x1bd5('0x20')]],'as':_0xe54b9f['as'],'attributes':_0xe54b9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x1bd5('0x22')](function(_0x472b22){logger[_0x1bd5('0x15')]('GetVoiceExtension',_0x2ff39a);logger[_0x1bd5('0x10')](_0x1bd5('0x17'),_0x2ff39a,JSON[_0x1bd5('0x12')](_0x472b22));_0x2a746d(_0x472b22);})[_0x1bd5('0x16')](function(_0x1f4456){logger[_0x1bd5('0x13')]('GetVoiceExtension',_0x1f4456['message'],_0x2ff39a);_0x456051(_0x3fbb39[_0x1bd5('0x13')](0x1f4,_0x1f4456[_0x1bd5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c36c239..9632807 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x569b47,_0x2ce366){var _0x85f649=function(_0x3bcc42){while(--_0x3bcc42){_0x569b47['push'](_0x569b47['shift']());}};_0x85f649(++_0x2ce366);}(_0xabce,0x103));var _0xeabc=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xabce[_0xc6be3a];return _0x56a310;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x5e570b,_0x452f59){var _0x484c10=function(_0x4d396b){while(--_0x4d396b){_0x5e570b['push'](_0x5e570b['shift']());}};_0x484c10(++_0x452f59);}(_0x1261,0x144));var _0x1126=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0x1261[_0x21ccfc];return _0x279454;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 6d42d01..521a28d 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x11f25c,_0x3c14d0){var _0x5adf2f=function(_0x4d6859){while(--_0x4d6859){_0x11f25c['push'](_0x11f25c['shift']());}};_0x5adf2f(++_0x3c14d0);}(_0x4bd3,0x174));var _0x34bd=function(_0x53b5bd,_0x368fc1){_0x53b5bd=_0x53b5bd-0x0;var _0x381779=_0x4bd3[_0x53b5bd];return _0x381779;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router; \ No newline at end of file +var _0x66fa=['isAuthenticated','index','get','/:id','post','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf04b83,_0x399c28){var _0x3d15eb=function(_0x3b554d){while(--_0x3b554d){_0xf04b83['push'](_0xf04b83['shift']());}};_0x3d15eb(++_0x399c28);}(_0x66fa,0x117));var _0xa66f=function(_0x11ab43,_0x25deea){_0x11ab43=_0x11ab43-0x0;var _0x8aa23d=_0x66fa[_0x11ab43];return _0x8aa23d;};'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('./voiceMail.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/messages',auth[_0xa66f('0x9')](),controller['getMessages']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xe')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 782ac7a..2969485 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 _0xeb94=['yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','trim','ENUM'];(function(_0x4561e5,_0x5a347c){var _0x5156c1=function(_0x42f147){while(--_0x42f147){_0x4561e5['push'](_0x4561e5['shift']());}};_0x5156c1(++_0x5a347c);}(_0xeb94,0x1d9));var _0x4eb9=function(_0x5ded96,_0x35805c){_0x5ded96=_0x5ded96-0x0;var _0x3cd145=_0xeb94[_0x5ded96];return _0x3cd145;};'use strict';var Sequelize=require(_0x4eb9('0x0'));module[_0x4eb9('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4eb9('0x2')],'defaultValue':'from-voicemail','unique':_0x4eb9('0x3')},'mailbox':{'type':Sequelize[_0x4eb9('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4eb9('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4eb9('0x2')]},'email':{'type':Sequelize[_0x4eb9('0x2')],'validate':{'isEmail':!![]},'set':function(_0x17e749){this[_0x4eb9('0x4')]('email',typeof _0x17e749==='string'&&_0x17e749[_0x4eb9('0x5')]()?_0x17e749[_0x4eb9('0x5')]():null);}},'pager':{'type':Sequelize[_0x4eb9('0x2')]},'tz':{'type':Sequelize[_0x4eb9('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':_0x4eb9('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4eb9('0x6')]('yes','no'),'defaultValue':_0x4eb9('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x4eb9('0x2')]},'review':{'type':Sequelize['ENUM'](_0x4eb9('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4eb9('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4eb9('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4eb9('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4eb9('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x4eb9('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4eb9('0x6')](_0x4eb9('0x7'),'no'),'defaultValue':_0x4eb9('0x7'),'allowNull':![]},'stamp':{'type':_0x4eb9('0x9')},'emailsubject':{'type':Sequelize[_0x4eb9('0x2')]},'emailbody':{'type':Sequelize[_0x4eb9('0x2')]},'maxsecs':{'type':Sequelize[_0x4eb9('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4eb9('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4eb9('0xb')],'get':function(){return this[_0x4eb9('0xc')](_0x4eb9('0xd'))+'\x20-\x20'+this[_0x4eb9('0xc')](_0x4eb9('0xe'));}}}; \ No newline at end of file +var _0xc1a1=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','sequelize'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xc1a1,0x6b));var _0x1c1a=function(_0x3a5052,_0x25ad8f){_0x3a5052=_0x3a5052-0x0;var _0x539562=_0xc1a1[_0x3a5052];return _0x539562;};'use strict';var Sequelize=require(_0x1c1a('0x0'));module[_0x1c1a('0x1')]={'customer_id':{'type':Sequelize[_0x1c1a('0x2')]},'context':{'type':Sequelize[_0x1c1a('0x2')],'defaultValue':_0x1c1a('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x1c1a('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x1c1a('0x2')]},'email':{'type':Sequelize[_0x1c1a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3dcaa3){this[_0x1c1a('0x5')](_0x1c1a('0x6'),typeof _0x3dcaa3===_0x1c1a('0x7')&&_0x3dcaa3[_0x1c1a('0x8')]()?_0x3dcaa3[_0x1c1a('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x1c1a('0x2')],'defaultValue':_0x1c1a('0x9')},'attach':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':_0x1c1a('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':_0x1c1a('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1c1a('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1c1a('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':_0x1c1a('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x1c1a('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1c1a('0xa')](_0x1c1a('0xb'),'no'),'defaultValue':_0x1c1a('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x1c1a('0x2')]},'emailbody':{'type':Sequelize[_0x1c1a('0x2')]},'maxsecs':{'type':Sequelize[_0x1c1a('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1c1a('0xe')],'get':function(){return this['getDataValue'](_0x1c1a('0xf'))+_0x1c1a('0x10')+this['getDataValue'](_0x1c1a('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index e33bd28..99b9766 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 _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x59aafe,_0x3f6ef9){var _0x3823e9=function(_0x5a79a7){while(--_0x5a79a7){_0x59aafe['push'](_0x59aafe['shift']());}};_0x3823e9(++_0x3f6ef9);}(_0x16d2,0x123));var _0x216d=function(_0x17e713,_0x23e2b1){_0x17e713=_0x17e713-0x0;var _0x5abc46=_0x16d2[_0x17e713];return _0x5abc46;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file +var _0x4ded=['findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','order','sort','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include'];(function(_0x1e4f89,_0x93f80d){var _0x4daf71=function(_0x29c53c){while(--_0x29c53c){_0x1e4f89['push'](_0x1e4f89['shift']());}};_0x4daf71(++_0x93f80d);}(_0x4ded,0x116));var _0xd4de=function(_0x2befe4,_0x206c63){_0x2befe4=_0x2befe4-0x0;var _0x22c248=_0x4ded[_0x2befe4];return _0x22c248;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['VoiceMail'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['VoiceMail'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':!![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));};exports[_0xd4de('0x50')]=function(_0x4bb7df,_0x5496f7,_0x4b55cc){return db[_0xd4de('0x2d')][_0xd4de('0x51')]({'where':{'id':_0x4bb7df[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x5496f7,null))['then'](function(_0x35ba6f){var _0x146eaa;var _0x2e0d76={},_0x17047a={};_0x17047a['model']=_[_0xd4de('0x46')](db[_0xd4de('0x52')][_0xd4de('0x2e')]);_0x17047a[_0xd4de('0x31')]=_['keys'](_0x4bb7df['query']);_0x17047a['filters']=_[_0xd4de('0x33')](_0x17047a[_0xd4de('0x34')],_0x17047a[_0xd4de('0x31')]);_0x2e0d76['attributes']=_[_0xd4de('0x33')](_0x17047a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x4bb7df['query'][_0xd4de('0x36')]));_0x2e0d76['attributes']=_0x2e0d76[_0xd4de('0x35')][_0xd4de('0x37')]?_0x2e0d76[_0xd4de('0x35')]:_0x17047a[_0xd4de('0x34')];if(!_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x2e0d76[_0xd4de('0x1c')]=qs['limit'](_0x4bb7df[_0xd4de('0x31')]['limit']);_0x2e0d76[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x4bb7df['query'][_0xd4de('0x1f')]);}_0x2e0d76[_0xd4de('0x53')]=qs[_0xd4de('0x54')](_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x54')]);_0x2e0d76[_0xd4de('0x3a')]=qs[_0xd4de('0x32')](_[_0xd4de('0x3b')](_0x4bb7df[_0xd4de('0x31')],_0x17047a[_0xd4de('0x32')]));if(_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x3d')]){_0x2e0d76[_0xd4de('0x3a')]=_['merge'](_0x2e0d76[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x2e0d76[_0xd4de('0x35')],function(_0x331f08){var _0x25628e={};_0x25628e[_0x331f08]={'$like':'%'+_0x4bb7df[_0xd4de('0x31')][_0xd4de('0x3d')]+'%'};return _0x25628e;})});}_0x2e0d76[_0xd4de('0x3a')]=_['merge'](_0x2e0d76[_0xd4de('0x3a')],{'mailboxuser':_0x35ba6f['mailbox']});_0x2e0d76=_['merge']({},_0x2e0d76,_0x4bb7df['options']);return db[_0xd4de('0x52')][_0xd4de('0x55')](_0x2e0d76)['then'](respondWithFilteredResult(_0x5496f7,_0x2e0d76));})['catch'](handleError(_0x5496f7,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c147582..b21032e 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 _0x2f3b=['voice_voicemail','mailbox_context','mailbox','util','api','moment','path','rimraf','../../config/environment','define','VoiceMail'];(function(_0x4250e8,_0x368832){var _0x15f3d3=function(_0x35f35){while(--_0x35f35){_0x4250e8['push'](_0x4250e8['shift']());}};_0x15f3d3(++_0x368832);}(_0x2f3b,0x14d));var _0xb2f3=function(_0x2b3b84,_0x51b058){_0x2b3b84=_0x2b3b84-0x0;var _0x3cdcb5=_0x2f3b[_0x2b3b84];return _0x3cdcb5;};'use strict';var _=require('lodash');var util=require(_0xb2f3('0x0'));var logger=require('../../config/logger')(_0xb2f3('0x1'));var moment=require(_0xb2f3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2f3('0x3'));var rimraf=require(_0xb2f3('0x4'));var config=require(_0xb2f3('0x5'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x42ea21,_0x511185){return _0x42ea21[_0xb2f3('0x6')](_0xb2f3('0x7'),attributes,{'tableName':_0xb2f3('0x8'),'paranoid':![],'indexes':[{'name':_0xb2f3('0x9'),'fields':[_0xb2f3('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x15c5=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','mailbox_context','mailbox','context','lodash','util','api'];(function(_0x4cb3d5,_0x2eafc2){var _0x26c3f2=function(_0x46931f){while(--_0x46931f){_0x4cb3d5['push'](_0x4cb3d5['shift']());}};_0x26c3f2(++_0x2eafc2);}(_0x15c5,0x1e7));var _0x515c=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x15c5[_0x531e48];return _0x202971;};'use strict';var _=require(_0x515c('0x0'));var util=require(_0x515c('0x1'));var logger=require('../../config/logger')(_0x515c('0x2'));var moment=require('moment');var BPromise=require(_0x515c('0x3'));var rp=require(_0x515c('0x4'));var fs=require('fs');var path=require(_0x515c('0x5'));var rimraf=require(_0x515c('0x6'));var config=require(_0x515c('0x7'));var attributes=require(_0x515c('0x8'));module[_0x515c('0x9')]=function(_0x192ffb,_0x7364d2){return _0x192ffb[_0x515c('0xa')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x515c('0xb'),'fields':[_0x515c('0xc'),_0x515c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 23eda42..fdc91c4 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 _0x6455=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56cb3c,_0x2b9fc8){var _0x332d05=function(_0xcfc2b6){while(--_0xcfc2b6){_0x56cb3c['push'](_0x56cb3c['shift']());}};_0x332d05(++_0x2b9fc8);}(_0x6455,0x192));var _0x5645=function(_0x126ae1,_0x1f3ec6){_0x126ae1=_0x126ae1-0x0;var _0x1c63ca=_0x6455[_0x126ae1];return _0x1c63ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5645('0x0'));var BPromise=require(_0x5645('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5645('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5645('0x3'));var config=require(_0x5645('0x4'));var jayson=require(_0x5645('0x5'));var client=jayson[_0x5645('0x6')][_0x5645('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1fafd3,_0x433fdc,_0x5cefdf){return new BPromise(function(_0x1f5cf3,_0x1bbe25){return client['request'](_0x1fafd3,_0x5cefdf)['then'](function(_0x423e48){logger[_0x5645('0x8')](_0x5645('0x9'),_0x433fdc,_0x5645('0xa'));logger[_0x5645('0xb')](_0x5645('0xc'),_0x433fdc,_0x5645('0xa'),JSON[_0x5645('0xd')](_0x423e48));if(_0x423e48[_0x5645('0xe')]){if(_0x423e48[_0x5645('0xe')][_0x5645('0xf')]===0x1f4){logger[_0x5645('0xe')](_0x5645('0x9'),_0x433fdc,_0x423e48[_0x5645('0xe')][_0x5645('0x10')]);return _0x1bbe25(_0x423e48[_0x5645('0xe')][_0x5645('0x10')]);}logger[_0x5645('0xe')](_0x5645('0x9'),_0x433fdc,_0x423e48[_0x5645('0xe')][_0x5645('0x10')]);return _0x1f5cf3(_0x423e48[_0x5645('0xe')][_0x5645('0x10')]);}else{logger[_0x5645('0x8')]('VoiceMail,\x20%s,\x20%s',_0x433fdc,_0x5645('0xa'));_0x1f5cf3(_0x423e48['result'][_0x5645('0x10')]);}})[_0x5645('0x11')](function(_0x453325){logger[_0x5645('0xe')]('VoiceMail,\x20%s,\x20%s',_0x433fdc,_0x453325);_0x1bbe25(_0x453325);});});} \ No newline at end of file +var _0x3e12=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x417f3b,_0x145f05){var _0x22d5b6=function(_0x219073){while(--_0x219073){_0x417f3b['push'](_0x417f3b['shift']());}};_0x22d5b6(++_0x145f05);}(_0x3e12,0x101));var _0x23e1=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x3e12[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x23e1('0x0'));var util=require(_0x23e1('0x1'));var moment=require(_0x23e1('0x2'));var BPromise=require(_0x23e1('0x3'));var rs=require(_0x23e1('0x4'));var fs=require('fs');var Redis=require(_0x23e1('0x5'));var db=require(_0x23e1('0x6'))['db'];var utils=require(_0x23e1('0x7'));var logger=require(_0x23e1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23e1('0x9'));var client=jayson[_0x23e1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3523fd,_0x1c99b0,_0x4488e1){return new BPromise(function(_0x1e17f5,_0x26e448){return client[_0x23e1('0xb')](_0x3523fd,_0x4488e1)[_0x23e1('0xc')](function(_0x34622d){logger[_0x23e1('0xd')](_0x23e1('0xe'),_0x1c99b0,'request\x20sent');logger['debug'](_0x23e1('0xf'),_0x1c99b0,_0x23e1('0x10'),JSON[_0x23e1('0x11')](_0x34622d));if(_0x34622d[_0x23e1('0x12')]){if(_0x34622d[_0x23e1('0x12')][_0x23e1('0x13')]===0x1f4){logger[_0x23e1('0x12')]('VoiceMail,\x20%s,\x20%s',_0x1c99b0,_0x34622d['error'][_0x23e1('0x14')]);return _0x26e448(_0x34622d[_0x23e1('0x12')][_0x23e1('0x14')]);}logger[_0x23e1('0x12')](_0x23e1('0xe'),_0x1c99b0,_0x34622d[_0x23e1('0x12')][_0x23e1('0x14')]);return _0x1e17f5(_0x34622d[_0x23e1('0x12')][_0x23e1('0x14')]);}else{logger['info'](_0x23e1('0xe'),_0x1c99b0,_0x23e1('0x10'));_0x1e17f5(_0x34622d['result']['message']);}})['catch'](function(_0x4170d6){logger[_0x23e1('0x12')](_0x23e1('0xe'),_0x1c99b0,_0x4170d6);_0x26e448(_0x4170d6);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ee4c7ff..42d0fb5 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 _0x12d8=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x12d8,0xb8));var _0x812d=function(_0x23622a,_0x2f0273){_0x23622a=_0x23622a-0x0;var _0x23a8f8=_0x12d8[_0x23622a];return _0x23a8f8;};'use strict';var multer=require(_0x812d('0x0'));var util=require(_0x812d('0x1'));var path=require(_0x812d('0x2'));var timeout=require(_0x812d('0x3'));var express=require(_0x812d('0x4'));var router=express[_0x812d('0x5')]();var fs_extra=require(_0x812d('0x6'));var auth=require(_0x812d('0x7'));var interaction=require(_0x812d('0x8'));var config=require(_0x812d('0x9'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x812d('0xa')](),controller[_0x812d('0xb')]);router[_0x812d('0xc')](_0x812d('0xd'),auth['isAuthenticated'](),controller[_0x812d('0xe')]);router[_0x812d('0xc')]('/:id/download',auth[_0x812d('0xa')](),controller['download']);router[_0x812d('0xf')]('/',auth['isAuthenticated'](),controller[_0x812d('0x10')]);router[_0x812d('0x11')](_0x812d('0xd'),auth['isAuthenticated'](),controller[_0x812d('0x12')]);router[_0x812d('0x13')](_0x812d('0xd'),auth[_0x812d('0xa')](),controller[_0x812d('0x14')]);module[_0x812d('0x15')]=router; \ No newline at end of file +var _0x30e0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x30e0,0x137));var _0x030e=function(_0x3b29cf,_0x171bc9){_0x3b29cf=_0x3b29cf-0x0;var _0x1dc73b=_0x30e0[_0x3b29cf];return _0x1dc73b;};'use strict';var multer=require(_0x030e('0x0'));var util=require(_0x030e('0x1'));var path=require('path');var timeout=require(_0x030e('0x2'));var express=require(_0x030e('0x3'));var router=express[_0x030e('0x4')]();var fs_extra=require(_0x030e('0x5'));var auth=require(_0x030e('0x6'));var interaction=require(_0x030e('0x7'));var config=require(_0x030e('0x8'));var controller=require(_0x030e('0x9'));router[_0x030e('0xa')]('/',auth[_0x030e('0xb')](),controller[_0x030e('0xc')]);router[_0x030e('0xa')](_0x030e('0xd'),auth[_0x030e('0xb')](),controller[_0x030e('0xe')]);router['get']('/:id/download',auth[_0x030e('0xb')](),controller[_0x030e('0xf')]);router['post']('/',auth[_0x030e('0xb')](),controller[_0x030e('0x10')]);router[_0x030e('0x11')]('/:id',auth[_0x030e('0xb')](),controller[_0x030e('0x12')]);router['delete'](_0x030e('0xd'),auth[_0x030e('0xb')](),controller[_0x030e('0x13')]);module[_0x030e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4204fb2..721505e 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 _0xfa4f=['long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0x30f58c,_0x205b7c){var _0x56af13=function(_0x4053d3){while(--_0x4053d3){_0x30f58c['push'](_0x30f58c['shift']());}};_0x56af13(++_0x205b7c);}(_0xfa4f,0xc9));var _0xffa4=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xfa4f[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xffa4('0x0'));module[_0xffa4('0x1')]={'name':{'type':Sequelize[_0xffa4('0x2')],'get':function(_0x29f001){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xffa4('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xffa4('0x5')](_0xffa4('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xffa4('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xffa4('0x7')](_0xffa4('0x8'))}}; \ No newline at end of file +var _0xf322=['STRING','BLOB','long','literal','sequelize','exports','VIRTUAL'];(function(_0x51e452,_0x1cd9dc){var _0x284f36=function(_0x3e8b83){while(--_0x3e8b83){_0x51e452['push'](_0x51e452['shift']());}};_0x284f36(++_0x1cd9dc);}(_0xf322,0x12a));var _0x2f32=function(_0x48ad49,_0x3170e4){_0x48ad49=_0x48ad49-0x0;var _0x3bf765=_0xf322[_0x48ad49];return _0x3bf765;};'use strict';var Sequelize=require(_0x2f32('0x0'));module[_0x2f32('0x1')]={'name':{'type':Sequelize[_0x2f32('0x2')],'get':function(_0x187c32){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x2f32('0x4')](_0x2f32('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2f32('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x2f32('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c7d9ba6..17b57f8 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 _0xe6e4=['create','update','body','find','params','catch','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','VoiceMailMessage','type','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','show'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0xe6e4,0x15d));var _0x4e6e=function(_0x32de8c,_0x2bfb6d){_0x32de8c=_0x32de8c-0x0;var _0x3f8c0d=_0xe6e4[_0x32de8c];return _0x3f8c0d;};'use strict';var emlformat=require(_0x4e6e('0x0'));var rimraf=require(_0x4e6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e6e('0x2'));var BPromise=require(_0x4e6e('0x3'));var Mustache=require(_0x4e6e('0x4'));var util=require(_0x4e6e('0x5'));var path=require(_0x4e6e('0x6'));var sox=require(_0x4e6e('0x7'));var csv=require(_0x4e6e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e6e('0x9'));var _=require('lodash');var squel=require(_0x4e6e('0xa'));var crypto=require(_0x4e6e('0xb'));var jsforce=require(_0x4e6e('0xc'));var deskjs=require(_0x4e6e('0xd'));var toCsv=require(_0x4e6e('0x8'));var querystring=require('querystring');var Papa=require(_0x4e6e('0xe'));var Redis=require('ioredis');var authService=require(_0x4e6e('0xf'));var qs=require(_0x4e6e('0x10'));var as=require(_0x4e6e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e6e('0x12'));var utils=require(_0x4e6e('0x13'));var config=require(_0x4e6e('0x14'));var licenseUtil=require(_0x4e6e('0x15'));var db=require(_0x4e6e('0x16'))['db'];function respondWithStatusCode(_0x47040f,_0x25f542){_0x25f542=_0x25f542||0xcc;return function(_0x22f7ac){if(_0x22f7ac){return _0x47040f[_0x4e6e('0x17')](_0x25f542);}return _0x47040f[_0x4e6e('0x18')](_0x25f542)[_0x4e6e('0x19')]();};}function respondWithResult(_0x2dbe55,_0x486407){_0x486407=_0x486407||0xc8;return function(_0x3562d5){if(_0x3562d5){return _0x2dbe55['status'](_0x486407)[_0x4e6e('0x1a')](_0x3562d5);}};}function respondWithFilteredResult(_0x2bf378,_0x1a5371){return function(_0x46a906){if(_0x46a906){var _0x2f19f2=typeof _0x1a5371[_0x4e6e('0x1b')]===_0x4e6e('0x1c')&&typeof _0x1a5371['limit']===_0x4e6e('0x1c');var _0x2185a2=_0x46a906[_0x4e6e('0x1d')];var _0x2893b3=_0x2f19f2?0x0:_0x1a5371[_0x4e6e('0x1b')];var _0x1ad60e=_0x2f19f2?_0x46a906[_0x4e6e('0x1d')]:_0x1a5371[_0x4e6e('0x1b')]+_0x1a5371['limit'];var _0x4fb406;if(_0x1ad60e>=_0x2185a2){_0x1ad60e=_0x2185a2;_0x4fb406=0xc8;}else{_0x4fb406=0xce;}_0x2bf378[_0x4e6e('0x18')](_0x4fb406);return _0x2bf378['set'](_0x4e6e('0x1e'),_0x2893b3+'-'+_0x1ad60e+'/'+_0x2185a2)[_0x4e6e('0x1a')](_0x46a906);}return null;};}function patchUpdates(_0x391af6){return function(_0x3735ea){try{jsonpatch[_0x4e6e('0x1f')](_0x3735ea,_0x391af6,!![]);}catch(_0x77a853){return BPromise[_0x4e6e('0x20')](_0x77a853);}return _0x3735ea[_0x4e6e('0x21')]();};}function saveUpdates(_0x56903c,_0x325181){return function(_0x56be04){if(_0x56be04){return _0x56be04['update'](_0x56903c)['then'](function(_0x542c89){return _0x542c89;});}return null;};}function removeEntity(_0x50d553,_0x40208d){return function(_0x526658){if(_0x526658){return _0x526658[_0x4e6e('0x22')]()[_0x4e6e('0x23')](function(){_0x50d553['status'](0xcc)[_0x4e6e('0x19')]();});}};}function handleEntityNotFound(_0x135ea1,_0x57d786){return function(_0x446f2a){if(!_0x446f2a){_0x135ea1[_0x4e6e('0x17')](0x194);}return _0x446f2a;};}function handleError(_0x5f08ad,_0xa51df3){_0xa51df3=_0xa51df3||0x1f4;return function(_0xcc490c){logger[_0x4e6e('0x24')](_0xcc490c[_0x4e6e('0x25')]);if(_0xcc490c[_0x4e6e('0x26')]){delete _0xcc490c[_0x4e6e('0x26')];}_0x5f08ad['status'](_0xa51df3)[_0x4e6e('0x27')](_0xcc490c);};}exports[_0x4e6e('0x28')]=function(_0x25dedb,_0x3a6f54){var _0x455932={},_0x2b5cbd={},_0x511284={'count':0x0,'rows':[]};var _0x1a2a65=_['map'](db[_0x4e6e('0x29')]['rawAttributes'],function(_0x359a35){return{'name':_0x359a35['fieldName'],'type':_0x359a35[_0x4e6e('0x2a')]['key']};});_0x2b5cbd[_0x4e6e('0x2b')]=_[_0x4e6e('0x2c')](_['map'](_0x1a2a65,_0x4e6e('0x26')),['name']);_0x2b5cbd['query']=_[_0x4e6e('0x2d')](_0x25dedb[_0x4e6e('0x2e')]);_0x2b5cbd[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x2b5cbd[_0x4e6e('0x2b')],_0x2b5cbd[_0x4e6e('0x2e')]);_0x455932[_0x4e6e('0x31')]=_[_0x4e6e('0x30')](_0x2b5cbd[_0x4e6e('0x2b')],qs[_0x4e6e('0x32')](_0x25dedb[_0x4e6e('0x2e')]['fields']));_0x455932[_0x4e6e('0x31')]=_0x455932[_0x4e6e('0x31')][_0x4e6e('0x33')]?_0x455932[_0x4e6e('0x31')]:_0x2b5cbd[_0x4e6e('0x2b')];if(!_0x25dedb[_0x4e6e('0x2e')][_0x4e6e('0x34')](_0x4e6e('0x35'))){_0x455932[_0x4e6e('0x36')]=qs[_0x4e6e('0x36')](_0x25dedb[_0x4e6e('0x2e')]['limit']);_0x455932['offset']=qs[_0x4e6e('0x1b')](_0x25dedb[_0x4e6e('0x2e')][_0x4e6e('0x1b')]);}_0x455932[_0x4e6e('0x37')]=qs[_0x4e6e('0x38')](_0x25dedb[_0x4e6e('0x2e')][_0x4e6e('0x38')]);_0x455932[_0x4e6e('0x39')]=qs['filters'](_['pick'](_0x25dedb[_0x4e6e('0x2e')],_0x2b5cbd[_0x4e6e('0x2f')]),_0x1a2a65);if(_0x25dedb[_0x4e6e('0x2e')][_0x4e6e('0x3a')]){_0x455932['where']=_['merge'](_0x455932[_0x4e6e('0x39')],{'$or':_[_0x4e6e('0x3b')](_0x1a2a65,function(_0x56ea30){if(_0x56ea30['type']!==_0x4e6e('0x3c')){var _0x453d3b={};_0x453d3b[_0x56ea30[_0x4e6e('0x26')]]={'$like':'%'+_0x25dedb[_0x4e6e('0x2e')]['filter']+'%'};return _0x453d3b;}})});}_0x455932=_[_0x4e6e('0x3d')]({},_0x455932,_0x25dedb[_0x4e6e('0x3e')]);var _0xf03f82={'where':_0x455932['where']};return db[_0x4e6e('0x29')][_0x4e6e('0x1d')](_0xf03f82)[_0x4e6e('0x23')](function(_0x26b657){_0x511284[_0x4e6e('0x1d')]=_0x26b657;if(_0x25dedb['query'][_0x4e6e('0x3f')]){_0x455932[_0x4e6e('0x40')]=[{'all':!![]}];}return db[_0x4e6e('0x29')]['findAll'](_0x455932);})[_0x4e6e('0x23')](function(_0x26ebc3){_0x511284['rows']=_0x26ebc3;return _0x511284;})[_0x4e6e('0x23')](respondWithFilteredResult(_0x3a6f54,_0x455932))['catch'](handleError(_0x3a6f54,null));};exports[_0x4e6e('0x41')]=function(_0x707d25,_0x44ce0a){var _0x20e1c3={'raw':!![],'where':{'id':_0x707d25['params']['id']}},_0xc79b94={};_0xc79b94[_0x4e6e('0x2b')]=_[_0x4e6e('0x2d')](db[_0x4e6e('0x29')]['rawAttributes']);_0xc79b94[_0x4e6e('0x2e')]=_[_0x4e6e('0x2d')](_0x707d25[_0x4e6e('0x2e')]);_0xc79b94['filters']=_[_0x4e6e('0x30')](_0xc79b94['model'],_0xc79b94[_0x4e6e('0x2e')]);_0x20e1c3[_0x4e6e('0x31')]=_[_0x4e6e('0x30')](_0xc79b94['model'],qs[_0x4e6e('0x32')](_0x707d25['query'][_0x4e6e('0x32')]));_0x20e1c3[_0x4e6e('0x31')]=_0x20e1c3[_0x4e6e('0x31')][_0x4e6e('0x33')]?_0x20e1c3[_0x4e6e('0x31')]:_0xc79b94[_0x4e6e('0x2b')];if(_0x707d25[_0x4e6e('0x2e')]['includeAll']){_0x20e1c3[_0x4e6e('0x40')]=[{'all':!![]}];}_0x20e1c3=_[_0x4e6e('0x3d')]({},_0x20e1c3,_0x707d25[_0x4e6e('0x3e')]);return db[_0x4e6e('0x29')]['find'](_0x20e1c3)[_0x4e6e('0x23')](handleEntityNotFound(_0x44ce0a,null))[_0x4e6e('0x23')](respondWithResult(_0x44ce0a,null))['catch'](handleError(_0x44ce0a,null));};exports[_0x4e6e('0x42')]=function(_0x55c6c9,_0x4375a5){return db[_0x4e6e('0x29')]['create'](_0x55c6c9['body'],{})[_0x4e6e('0x23')](respondWithResult(_0x4375a5,0xc9))['catch'](handleError(_0x4375a5,null));};exports[_0x4e6e('0x43')]=function(_0x69f583,_0x3b3169){if(_0x69f583[_0x4e6e('0x44')]['id']){delete _0x69f583[_0x4e6e('0x44')]['id'];}return db['VoiceMailMessage'][_0x4e6e('0x45')]({'where':{'id':_0x69f583[_0x4e6e('0x46')]['id']}})[_0x4e6e('0x23')](handleEntityNotFound(_0x3b3169,null))[_0x4e6e('0x23')](saveUpdates(_0x69f583[_0x4e6e('0x44')],null))['then'](respondWithResult(_0x3b3169,null))[_0x4e6e('0x47')](handleError(_0x3b3169,null));};exports[_0x4e6e('0x22')]=function(_0x177f0c,_0x5097c2){return db['VoiceMailMessage'][_0x4e6e('0x45')]({'where':{'id':_0x177f0c[_0x4e6e('0x46')]['id']}})[_0x4e6e('0x23')](handleEntityNotFound(_0x5097c2,null))[_0x4e6e('0x23')](removeEntity(_0x5097c2,null))['catch'](handleError(_0x5097c2,null));};exports[_0x4e6e('0x48')]=function(_0x3e8d17,_0x198d79,_0x415017){return db[_0x4e6e('0x29')]['find']({'where':{'id':_0x3e8d17[_0x4e6e('0x46')]['id']},'attributes':['id',_0x4e6e('0x49'),_0x4e6e('0x4a')]})['then'](handleEntityNotFound(_0x198d79,null))[_0x4e6e('0x23')](function(_0x37004e){if(_0x37004e){if(!_0x37004e[_0x4e6e('0x49')]){throw new db[(_0x4e6e('0x4b'))][(_0x4e6e('0x4c'))](_0x4e6e('0x4d'));}var _0xe4e702={'Content-Type':_0x4e6e('0x4e'),'Content-Disposition':_0x4e6e('0x4f')};if(_0x37004e[_0x4e6e('0x4a')]){_0xe4e702[_0x4e6e('0x50')]='attachment;\x20filename=\x22'+_0x37004e['msg_id']+_0x4e6e('0x51');}_0x198d79[_0x4e6e('0x52')](_0xe4e702);return _0x198d79[_0x4e6e('0x27')](new Buffer(_0x37004e[_0x4e6e('0x49')]));}})[_0x4e6e('0x47')](handleError(_0x198d79,null));}; \ No newline at end of file +var _0x2497=['update','then','error','stack','name','send','map','VoiceMailMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','destroy','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x21970f,_0x29bcc7){var _0x4902a5=function(_0x8245f3){while(--_0x8245f3){_0x21970f['push'](_0x21970f['shift']());}};_0x4902a5(++_0x29bcc7);}(_0x2497,0x137));var _0x7249=function(_0x44e969,_0x23f992){_0x44e969=_0x44e969-0x0;var _0x209589=_0x2497[_0x44e969];return _0x209589;};'use strict';var emlformat=require(_0x7249('0x0'));var rimraf=require(_0x7249('0x1'));var zipdir=require(_0x7249('0x2'));var jsonpatch=require(_0x7249('0x3'));var rp=require(_0x7249('0x4'));var moment=require('moment');var BPromise=require(_0x7249('0x5'));var Mustache=require(_0x7249('0x6'));var util=require(_0x7249('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7249('0x8'));var ejs=require(_0x7249('0x9'));var fs=require('fs');var fs_extra=require(_0x7249('0xa'));var _=require(_0x7249('0xb'));var squel=require(_0x7249('0xc'));var crypto=require(_0x7249('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7249('0xe'));var toCsv=require(_0x7249('0x8'));var querystring=require('querystring');var Papa=require(_0x7249('0xf'));var Redis=require(_0x7249('0x10'));var authService=require(_0x7249('0x11'));var qs=require(_0x7249('0x12'));var as=require(_0x7249('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7249('0x14'))(_0x7249('0x15'));var utils=require(_0x7249('0x16'));var config=require(_0x7249('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ce2a1,_0x42d645){_0x42d645=_0x42d645||0xcc;return function(_0x48b437){if(_0x48b437){return _0x2ce2a1[_0x7249('0x18')](_0x42d645);}return _0x2ce2a1[_0x7249('0x19')](_0x42d645)[_0x7249('0x1a')]();};}function respondWithResult(_0x2b87cf,_0x376d03){_0x376d03=_0x376d03||0xc8;return function(_0x175263){if(_0x175263){return _0x2b87cf[_0x7249('0x19')](_0x376d03)[_0x7249('0x1b')](_0x175263);}};}function respondWithFilteredResult(_0x39b083,_0x39ab55){return function(_0x6cb42b){if(_0x6cb42b){var _0xd23384=typeof _0x39ab55[_0x7249('0x1c')]==='undefined'&&typeof _0x39ab55[_0x7249('0x1d')]===_0x7249('0x1e');var _0x21bb30=_0x6cb42b[_0x7249('0x1f')];var _0x320d58=_0xd23384?0x0:_0x39ab55[_0x7249('0x1c')];var _0x64517c=_0xd23384?_0x6cb42b[_0x7249('0x1f')]:_0x39ab55[_0x7249('0x1c')]+_0x39ab55[_0x7249('0x1d')];var _0x405e61;if(_0x64517c>=_0x21bb30){_0x64517c=_0x21bb30;_0x405e61=0xc8;}else{_0x405e61=0xce;}_0x39b083[_0x7249('0x19')](_0x405e61);return _0x39b083[_0x7249('0x20')](_0x7249('0x21'),_0x320d58+'-'+_0x64517c+'/'+_0x21bb30)[_0x7249('0x1b')](_0x6cb42b);}return null;};}function patchUpdates(_0x562dc8){return function(_0x3a0d3d){try{jsonpatch[_0x7249('0x22')](_0x3a0d3d,_0x562dc8,!![]);}catch(_0x26b108){return BPromise[_0x7249('0x23')](_0x26b108);}return _0x3a0d3d[_0x7249('0x24')]();};}function saveUpdates(_0x1ce262,_0x3e5496){return function(_0x2cabb2){if(_0x2cabb2){return _0x2cabb2[_0x7249('0x25')](_0x1ce262)[_0x7249('0x26')](function(_0x1c2f18){return _0x1c2f18;});}return null;};}function removeEntity(_0x16b1ec,_0x280fee){return function(_0x14327b){if(_0x14327b){return _0x14327b['destroy']()['then'](function(){_0x16b1ec[_0x7249('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x131677,_0x56a23e){return function(_0x2bc537){if(!_0x2bc537){_0x131677[_0x7249('0x18')](0x194);}return _0x2bc537;};}function handleError(_0x35dbf0,_0x1b7ad9){_0x1b7ad9=_0x1b7ad9||0x1f4;return function(_0x52420c){logger[_0x7249('0x27')](_0x52420c[_0x7249('0x28')]);if(_0x52420c[_0x7249('0x29')]){delete _0x52420c[_0x7249('0x29')];}_0x35dbf0[_0x7249('0x19')](_0x1b7ad9)[_0x7249('0x2a')](_0x52420c);};}exports['index']=function(_0x33b4b5,_0x5f2ba1){var _0x1cddc1={},_0x845de3={},_0x491733={'count':0x0,'rows':[]};var _0x50a17e=_[_0x7249('0x2b')](db[_0x7249('0x2c')]['rawAttributes'],function(_0x37d6d6){return{'name':_0x37d6d6[_0x7249('0x2d')],'type':_0x37d6d6[_0x7249('0x2e')][_0x7249('0x2f')]};});_0x845de3[_0x7249('0x30')]=_['differenceBy'](_[_0x7249('0x2b')](_0x50a17e,_0x7249('0x29')),[_0x7249('0x29')]);_0x845de3[_0x7249('0x31')]=_['keys'](_0x33b4b5[_0x7249('0x31')]);_0x845de3[_0x7249('0x32')]=_[_0x7249('0x33')](_0x845de3[_0x7249('0x30')],_0x845de3[_0x7249('0x31')]);_0x1cddc1[_0x7249('0x34')]=_[_0x7249('0x33')](_0x845de3[_0x7249('0x30')],qs[_0x7249('0x35')](_0x33b4b5['query'][_0x7249('0x35')]));_0x1cddc1[_0x7249('0x34')]=_0x1cddc1['attributes'][_0x7249('0x36')]?_0x1cddc1[_0x7249('0x34')]:_0x845de3[_0x7249('0x30')];if(!_0x33b4b5[_0x7249('0x31')][_0x7249('0x37')](_0x7249('0x38'))){_0x1cddc1[_0x7249('0x1d')]=qs[_0x7249('0x1d')](_0x33b4b5[_0x7249('0x31')][_0x7249('0x1d')]);_0x1cddc1[_0x7249('0x1c')]=qs[_0x7249('0x1c')](_0x33b4b5[_0x7249('0x31')]['offset']);}_0x1cddc1[_0x7249('0x39')]=qs['sort'](_0x33b4b5[_0x7249('0x31')][_0x7249('0x3a')]);_0x1cddc1['where']=qs[_0x7249('0x32')](_[_0x7249('0x3b')](_0x33b4b5[_0x7249('0x31')],_0x845de3[_0x7249('0x32')]),_0x50a17e);if(_0x33b4b5['query'][_0x7249('0x3c')]){_0x1cddc1[_0x7249('0x3d')]=_[_0x7249('0x3e')](_0x1cddc1[_0x7249('0x3d')],{'$or':_['map'](_0x50a17e,function(_0x41f1b4){if(_0x41f1b4[_0x7249('0x2e')]!==_0x7249('0x3f')){var _0x1e9dee={};_0x1e9dee[_0x41f1b4[_0x7249('0x29')]]={'$like':'%'+_0x33b4b5[_0x7249('0x31')][_0x7249('0x3c')]+'%'};return _0x1e9dee;}})});}_0x1cddc1=_[_0x7249('0x3e')]({},_0x1cddc1,_0x33b4b5[_0x7249('0x40')]);var _0x262cec={'where':_0x1cddc1[_0x7249('0x3d')]};return db[_0x7249('0x2c')]['count'](_0x262cec)['then'](function(_0x4216e0){_0x491733[_0x7249('0x1f')]=_0x4216e0;if(_0x33b4b5[_0x7249('0x31')][_0x7249('0x41')]){_0x1cddc1['include']=[{'all':!![]}];}return db[_0x7249('0x2c')][_0x7249('0x42')](_0x1cddc1);})[_0x7249('0x26')](function(_0x4b7402){_0x491733[_0x7249('0x43')]=_0x4b7402;return _0x491733;})['then'](respondWithFilteredResult(_0x5f2ba1,_0x1cddc1))[_0x7249('0x44')](handleError(_0x5f2ba1,null));};exports[_0x7249('0x45')]=function(_0xa2976,_0x25349c){var _0x928946={'raw':!![],'where':{'id':_0xa2976[_0x7249('0x46')]['id']}},_0x459591={};_0x459591[_0x7249('0x30')]=_[_0x7249('0x47')](db[_0x7249('0x2c')][_0x7249('0x48')]);_0x459591[_0x7249('0x31')]=_[_0x7249('0x47')](_0xa2976[_0x7249('0x31')]);_0x459591[_0x7249('0x32')]=_[_0x7249('0x33')](_0x459591[_0x7249('0x30')],_0x459591['query']);_0x928946[_0x7249('0x34')]=_['intersection'](_0x459591['model'],qs[_0x7249('0x35')](_0xa2976[_0x7249('0x31')][_0x7249('0x35')]));_0x928946[_0x7249('0x34')]=_0x928946[_0x7249('0x34')][_0x7249('0x36')]?_0x928946[_0x7249('0x34')]:_0x459591[_0x7249('0x30')];if(_0xa2976[_0x7249('0x31')]['includeAll']){_0x928946[_0x7249('0x49')]=[{'all':!![]}];}_0x928946=_[_0x7249('0x3e')]({},_0x928946,_0xa2976[_0x7249('0x40')]);return db[_0x7249('0x2c')][_0x7249('0x4a')](_0x928946)[_0x7249('0x26')](handleEntityNotFound(_0x25349c,null))[_0x7249('0x26')](respondWithResult(_0x25349c,null))[_0x7249('0x44')](handleError(_0x25349c,null));};exports['create']=function(_0x1f29ff,_0x103574){return db['VoiceMailMessage'][_0x7249('0x4b')](_0x1f29ff[_0x7249('0x4c')],{})[_0x7249('0x26')](respondWithResult(_0x103574,0xc9))[_0x7249('0x44')](handleError(_0x103574,null));};exports[_0x7249('0x25')]=function(_0x4c8196,_0x5bc40d){if(_0x4c8196[_0x7249('0x4c')]['id']){delete _0x4c8196[_0x7249('0x4c')]['id'];}return db[_0x7249('0x2c')][_0x7249('0x4a')]({'where':{'id':_0x4c8196[_0x7249('0x46')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x5bc40d,null))[_0x7249('0x26')](saveUpdates(_0x4c8196[_0x7249('0x4c')],null))[_0x7249('0x26')](respondWithResult(_0x5bc40d,null))[_0x7249('0x44')](handleError(_0x5bc40d,null));};exports[_0x7249('0x4d')]=function(_0x37d6af,_0x15086e){return db['VoiceMailMessage'][_0x7249('0x4a')]({'where':{'id':_0x37d6af[_0x7249('0x46')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x15086e,null))['then'](removeEntity(_0x15086e,null))[_0x7249('0x44')](handleError(_0x15086e,null));};exports[_0x7249('0x4e')]=function(_0x54d10b,_0x454d7d,_0x426e23){return db[_0x7249('0x2c')][_0x7249('0x4a')]({'where':{'id':_0x54d10b[_0x7249('0x46')]['id']},'attributes':['id',_0x7249('0x4f'),_0x7249('0x50')]})[_0x7249('0x26')](handleEntityNotFound(_0x454d7d,null))['then'](function(_0x2e919a){if(_0x2e919a){if(!_0x2e919a[_0x7249('0x4f')]){throw new db['Sequelize'][(_0x7249('0x51'))](_0x7249('0x52'));}var _0x455aef={'Content-Type':_0x7249('0x53'),'Content-Disposition':'attachment'};if(_0x2e919a[_0x7249('0x50')]){_0x455aef[_0x7249('0x54')]=_0x7249('0x55')+_0x2e919a['msg_id']+_0x7249('0x56');}_0x454d7d[_0x7249('0x20')](_0x455aef);return _0x454d7d['send'](new Buffer(_0x2e919a[_0x7249('0x4f')]));}})[_0x7249('0x44')](handleError(_0x454d7d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 8a822c3..f5f7917 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 _0x125a=['./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0xc8023,_0xd1912){var _0x448b50=function(_0x4b8a6f){while(--_0x4b8a6f){_0xc8023['push'](_0xc8023['shift']());}};_0x448b50(++_0xd1912);}(_0x125a,0x1c6));var _0xa125=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0x125a[_0x4604ad];return _0x3ed8ef;};'use strict';var _=require(_0xa125('0x0'));var util=require('util');var logger=require(_0xa125('0x1'))(_0xa125('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa125('0x3'));var fs=require('fs');var path=require(_0xa125('0x4'));var rimraf=require(_0xa125('0x5'));var config=require('../../config/environment');var attributes=require(_0xa125('0x6'));module[_0xa125('0x7')]=function(_0x1996b4,_0xf5d9de){return _0x1996b4['define']('VoiceMailMessage',attributes,{'tableName':_0xa125('0x8'),'paranoid':![],'indexes':[{'name':_0xa125('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x20ae=['dir','api','moment','bluebird','request-promise','path','rimraf','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0x20ae,0xdd));var _0xe20a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x20ae[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe20a('0x0'));var moment=require(_0xe20a('0x1'));var BPromise=require(_0xe20a('0x2'));var rp=require(_0xe20a('0x3'));var fs=require('fs');var path=require(_0xe20a('0x4'));var rimraf=require(_0xe20a('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xe20a('0x6')]=function(_0x1455e8,_0xd6ecf1){return _0x1455e8['define'](_0xe20a('0x7'),attributes,{'tableName':_0xe20a('0x8'),'paranoid':![],'indexes':[{'name':_0xe20a('0x9'),'fields':[_0xe20a('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 668935d..f57d617 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 _0xe397=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','error','message','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2367df,_0x73e77d){var _0x3d39c0=function(_0x433394){while(--_0x433394){_0x2367df['push'](_0x2367df['shift']());}};_0x3d39c0(++_0x73e77d);}(_0xe397,0x9d));var _0x7e39=function(_0x492e2e,_0x5ce525){_0x492e2e=_0x492e2e-0x0;var _0x5344ec=_0xe397[_0x492e2e];return _0x5344ec;};'use strict';var _=require('lodash');var util=require(_0x7e39('0x0'));var moment=require(_0x7e39('0x1'));var BPromise=require(_0x7e39('0x2'));var rs=require(_0x7e39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e39('0x4'));var logger=require(_0x7e39('0x5'))(_0x7e39('0x6'));var config=require(_0x7e39('0x7'));var jayson=require(_0x7e39('0x8'));var client=jayson[_0x7e39('0x9')][_0x7e39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27796b,_0x51f56c,_0x3fe5de){return new BPromise(function(_0x241c9a,_0x30818e){return client[_0x7e39('0xb')](_0x27796b,_0x3fe5de)[_0x7e39('0xc')](function(_0x398a63){logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x51f56c,_0x7e39('0xf'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x51f56c,_0x7e39('0xf'),JSON['stringify'](_0x398a63));if(_0x398a63[_0x7e39('0x10')]){if(_0x398a63[_0x7e39('0x10')]['code']===0x1f4){logger[_0x7e39('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x51f56c,_0x398a63[_0x7e39('0x10')][_0x7e39('0x11')]);return _0x30818e(_0x398a63['error'][_0x7e39('0x11')]);}logger[_0x7e39('0x10')](_0x7e39('0xe'),_0x51f56c,_0x398a63[_0x7e39('0x10')][_0x7e39('0x11')]);return _0x241c9a(_0x398a63[_0x7e39('0x10')][_0x7e39('0x11')]);}else{logger['info'](_0x7e39('0xe'),_0x51f56c,'request\x20sent');_0x241c9a(_0x398a63['result']['message']);}})['catch'](function(_0x113698){logger['error'](_0x7e39('0xe'),_0x51f56c,_0x113698);_0x30818e(_0x113698);});});} \ No newline at end of file +var _0x0644=['../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0644,0xe8));var _0x4064=function(_0x2c0498,_0x1e80a8){_0x2c0498=_0x2c0498-0x0;var _0xc026b9=_0x0644[_0x2c0498];return _0xc026b9;};'use strict';var _=require(_0x4064('0x0'));var util=require(_0x4064('0x1'));var moment=require(_0x4064('0x2'));var BPromise=require(_0x4064('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4064('0x4'));var db=require(_0x4064('0x5'))['db'];var utils=require(_0x4064('0x6'));var logger=require('../../config/logger')(_0x4064('0x7'));var config=require(_0x4064('0x8'));var jayson=require(_0x4064('0x9'));var client=jayson[_0x4064('0xa')][_0x4064('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f85e,_0x3cbd13,_0x526310){return new BPromise(function(_0x414466,_0x15943f){return client[_0x4064('0xc')](_0x29f85e,_0x526310)['then'](function(_0x12e444){logger[_0x4064('0xd')](_0x4064('0xe'),_0x3cbd13,_0x4064('0xf'));logger[_0x4064('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3cbd13,_0x4064('0xf'),JSON['stringify'](_0x12e444));if(_0x12e444[_0x4064('0x11')]){if(_0x12e444['error']['code']===0x1f4){logger[_0x4064('0x11')](_0x4064('0xe'),_0x3cbd13,_0x12e444[_0x4064('0x11')][_0x4064('0x12')]);return _0x15943f(_0x12e444['error']['message']);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3cbd13,_0x12e444[_0x4064('0x11')]['message']);return _0x414466(_0x12e444[_0x4064('0x11')][_0x4064('0x12')]);}else{logger['info'](_0x4064('0xe'),_0x3cbd13,_0x4064('0xf'));_0x414466(_0x12e444['result'][_0x4064('0x12')]);}})[_0x4064('0x13')](function(_0xfd173c){logger[_0x4064('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x3cbd13,_0xfd173c);_0x15943f(_0xfd173c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 22c4de8..96fa41b 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 _0x4732=['getSounds','post','create','addSound','/:id','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','index','isAuthenticated','show','/:id/sounds'];(function(_0x33cebd,_0x1967c1){var _0x333961=function(_0x1ec107){while(--_0x1ec107){_0x33cebd['push'](_0x33cebd['shift']());}};_0x333961(++_0x1967c1);}(_0x4732,0xd9));var _0x2473=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x4732[_0x17c483];return _0x112bdb;};'use strict';var multer=require('multer');var util=require(_0x2473('0x0'));var path=require('path');var timeout=require(_0x2473('0x1'));var express=require(_0x2473('0x2'));var router=express[_0x2473('0x3')]();var fs_extra=require(_0x2473('0x4'));var auth=require(_0x2473('0x5'));var interaction=require(_0x2473('0x6'));var config=require('../../config/environment');var controller=require(_0x2473('0x7'));router[_0x2473('0x8')]('/',auth['isAuthenticated'](),controller[_0x2473('0x9')]);router['get']('/:id',auth[_0x2473('0xa')](),controller[_0x2473('0xb')]);router['get'](_0x2473('0xc'),auth['isAuthenticated'](),controller[_0x2473('0xd')]);router[_0x2473('0xe')]('/',auth[_0x2473('0xa')](),controller[_0x2473('0xf')]);router[_0x2473('0xe')](_0x2473('0xc'),auth['isAuthenticated'](),controller[_0x2473('0x10')]);router['put'](_0x2473('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x2473('0x12')]('/:id',auth[_0x2473('0xa')](),controller[_0x2473('0x13')]);router[_0x2473('0x12')](_0x2473('0x14'),auth[_0x2473('0xa')](),controller[_0x2473('0x15')]);module[_0x2473('0x16')]=router; \ No newline at end of file +var _0xdba9=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/sounds','getSounds','post','addSound','put','destroy','delete','removeSound','multer'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0xdba9,0x77));var _0x9dba=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0xdba9[_0x60df74];return _0x5ee872;};'use strict';var multer=require(_0x9dba('0x0'));var util=require(_0x9dba('0x1'));var path=require('path');var timeout=require(_0x9dba('0x2'));var express=require(_0x9dba('0x3'));var router=express[_0x9dba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9dba('0x5'));var interaction=require(_0x9dba('0x6'));var config=require(_0x9dba('0x7'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x9dba('0x8')](),controller['index']);router[_0x9dba('0x9')](_0x9dba('0xa'),auth[_0x9dba('0x8')](),controller[_0x9dba('0xb')]);router[_0x9dba('0x9')](_0x9dba('0xc'),auth[_0x9dba('0x8')](),controller[_0x9dba('0xd')]);router[_0x9dba('0xe')]('/',auth[_0x9dba('0x8')](),controller['create']);router[_0x9dba('0xe')](_0x9dba('0xc'),auth[_0x9dba('0x8')](),controller[_0x9dba('0xf')]);router[_0x9dba('0x10')]('/:id',auth[_0x9dba('0x8')](),controller['update']);router['delete'](_0x9dba('0xa'),auth[_0x9dba('0x8')](),controller[_0x9dba('0x11')]);router[_0x9dba('0x12')]('/:id/sounds/:id2',auth[_0x9dba('0x8')](),controller[_0x9dba('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a95aef0..fd415ca 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 _0xaee8=['exports','STRING','name','custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x3a162f,_0x99b73b){var _0x5dbc1c=function(_0x1d01d9){while(--_0x1d01d9){_0x3a162f['push'](_0x3a162f['shift']());}};_0x5dbc1c(++_0x99b73b);}(_0xaee8,0xa7));var _0x8aee=function(_0xb141ab,_0x56f27f){_0xb141ab=_0xb141ab-0x0;var _0x539171=_0xaee8[_0xb141ab];return _0x539171;};'use strict';var Sequelize=require(_0x8aee('0x0'));module[_0x8aee('0x1')]={'name':{'type':Sequelize[_0x8aee('0x2')],'allowNull':![],'unique':_0x8aee('0x3')},'mode':{'type':Sequelize['ENUM'](_0x8aee('0x4'),_0x8aee('0x5'),_0x8aee('0x6'),_0x8aee('0x7'),_0x8aee('0x8'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x8aee('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8aee('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8aee('0x2')],'allowNull':!![],'defaultValue':_0x8aee('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x8aee('0xa')},'defaultEntry':{'type':Sequelize[_0x8aee('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b57=['files','mp3nb','mp3','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b57,0x7d));var _0x74b5=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x4b57[_0x4503df];return _0x3f1b2b;};'use strict';var Sequelize=require(_0x74b5('0x0'));module[_0x74b5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x74b5('0x2')]('custom',_0x74b5('0x3'),_0x74b5('0x4'),'quietmp3nb','quietmp3',_0x74b5('0x5')),'allowNull':!![],'defaultValue':_0x74b5('0x3')},'directory':{'type':Sequelize[_0x74b5('0x6')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x74b5('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x74b5('0x6')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x74b5('0x7')],'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 89a82de..b8781ab 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 _0xaf67=['util','path','sox','ejs','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/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','save','update','destroy','get','then','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','rows','show','params','keys','intersection','options','find','body','create','sequelize','mode','files','directory','join','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','Sequelize','ValidationError','findOne','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','server/files/moh','symlinkSync','message','removeSound','Sound','getSounds','filter','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0xbec883,_0x16e596){var _0x11305e=function(_0x4c9500){while(--_0x4c9500){_0xbec883['push'](_0xbec883['shift']());}};_0x11305e(++_0x16e596);}(_0xaf67,0x150));var _0x7af6=function(_0x49ae9d,_0x11e31e){_0x49ae9d=_0x49ae9d-0x0;var _0x3a75c3=_0xaf67[_0x49ae9d];return _0x3a75c3;};'use strict';var emlformat=require(_0x7af6('0x0'));var rimraf=require(_0x7af6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7af6('0x2'));var rp=require(_0x7af6('0x3'));var moment=require('moment');var BPromise=require(_0x7af6('0x4'));var Mustache=require(_0x7af6('0x5'));var util=require(_0x7af6('0x6'));var path=require(_0x7af6('0x7'));var sox=require(_0x7af6('0x8'));var csv=require('to-csv');var ejs=require(_0x7af6('0x9'));var fs=require('fs');var fs_extra=require(_0x7af6('0xa'));var _=require(_0x7af6('0xb'));var squel=require(_0x7af6('0xc'));var crypto=require(_0x7af6('0xd'));var jsforce=require(_0x7af6('0xe'));var deskjs=require(_0x7af6('0xf'));var toCsv=require(_0x7af6('0x10'));var querystring=require(_0x7af6('0x11'));var Papa=require('papaparse');var Redis=require(_0x7af6('0x12'));var authService=require(_0x7af6('0x13'));var qs=require(_0x7af6('0x14'));var as=require(_0x7af6('0x15'));var hardwareService=require(_0x7af6('0x16'));var logger=require(_0x7af6('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7af6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7af6('0x19'))['db'];function respondWithStatusCode(_0x29df3f,_0xb617ae){_0xb617ae=_0xb617ae||0xcc;return function(_0x426c89){if(_0x426c89){return _0x29df3f[_0x7af6('0x1a')](_0xb617ae);}return _0x29df3f[_0x7af6('0x1b')](_0xb617ae)[_0x7af6('0x1c')]();};}function respondWithResult(_0x2c49e7,_0x503fa4){_0x503fa4=_0x503fa4||0xc8;return function(_0x5b3ea0){if(_0x5b3ea0){return _0x2c49e7['status'](_0x503fa4)['json'](_0x5b3ea0);}};}function respondWithFilteredResult(_0x1acb0d,_0x2b23e8){return function(_0x3d9f02){if(_0x3d9f02){var _0x20b272=typeof _0x2b23e8['offset']===_0x7af6('0x1d')&&typeof _0x2b23e8['limit']===_0x7af6('0x1d');var _0x16b90a=_0x3d9f02[_0x7af6('0x1e')];var _0x369d6b=_0x20b272?0x0:_0x2b23e8[_0x7af6('0x1f')];var _0x2fc904=_0x20b272?_0x3d9f02[_0x7af6('0x1e')]:_0x2b23e8[_0x7af6('0x1f')]+_0x2b23e8['limit'];var _0x8779df;if(_0x2fc904>=_0x16b90a){_0x2fc904=_0x16b90a;_0x8779df=0xc8;}else{_0x8779df=0xce;}_0x1acb0d[_0x7af6('0x1b')](_0x8779df);return _0x1acb0d[_0x7af6('0x20')](_0x7af6('0x21'),_0x369d6b+'-'+_0x2fc904+'/'+_0x16b90a)[_0x7af6('0x22')](_0x3d9f02);}return null;};}function patchUpdates(_0x5e6c72){return function(_0x291c16){try{jsonpatch[_0x7af6('0x23')](_0x291c16,_0x5e6c72,!![]);}catch(_0x327541){return BPromise['reject'](_0x327541);}return _0x291c16[_0x7af6('0x24')]();};}function saveUpdates(_0x58503d,_0x26b582){return function(_0x985bec){if(_0x985bec){return _0x985bec[_0x7af6('0x25')](_0x58503d)['then'](function(_0xf6f4d8){return _0xf6f4d8;});}return null;};}function removeEntity(_0x1d3927,_0x5d9464){return function(_0x3d7d6f){if(_0x3d7d6f){return _0x3d7d6f[_0x7af6('0x26')]()['then'](function(){var _0x589f87=_0x3d7d6f[_0x7af6('0x27')]({'plain':!![]});var _0x54b53f='MusicOnHolds';return db['UserProfileResource'][_0x7af6('0x26')]({'where':{'type':_0x54b53f,'resourceId':_0x589f87['id']}})[_0x7af6('0x28')](function(){return _0x3d7d6f;});})[_0x7af6('0x28')](function(){_0x1d3927[_0x7af6('0x1b')](0xcc)[_0x7af6('0x1c')]();});}};}function handleEntityNotFound(_0x3ba6ee,_0x2af951){return function(_0x12a863){if(!_0x12a863){_0x3ba6ee[_0x7af6('0x1a')](0x194);}return _0x12a863;};}function handleError(_0xf6e67c,_0x5116bd){_0x5116bd=_0x5116bd||0x1f4;return function(_0x85e2d4){logger[_0x7af6('0x29')](_0x85e2d4[_0x7af6('0x2a')]);if(_0x85e2d4[_0x7af6('0x2b')]){delete _0x85e2d4['name'];}_0xf6e67c[_0x7af6('0x1b')](_0x5116bd)['send'](_0x85e2d4);};}exports[_0x7af6('0x2c')]=function(_0x259432,_0x5c25b2){var _0x318b45={},_0x201501={},_0x2017ec={'count':0x0,'rows':[]};var _0x2ce2bf=_[_0x7af6('0x2d')](db[_0x7af6('0x2e')][_0x7af6('0x2f')],function(_0x52b2b2){return{'name':_0x52b2b2[_0x7af6('0x30')],'type':_0x52b2b2[_0x7af6('0x31')]['key']};});_0x201501[_0x7af6('0x32')]=_['map'](_0x2ce2bf,_0x7af6('0x2b'));_0x201501[_0x7af6('0x33')]=_['keys'](_0x259432[_0x7af6('0x33')]);_0x201501['filters']=_['intersection'](_0x201501[_0x7af6('0x32')],_0x201501[_0x7af6('0x33')]);_0x318b45[_0x7af6('0x34')]=_['intersection'](_0x201501[_0x7af6('0x32')],qs[_0x7af6('0x35')](_0x259432[_0x7af6('0x33')][_0x7af6('0x35')]));_0x318b45['attributes']=_0x318b45[_0x7af6('0x34')][_0x7af6('0x36')]?_0x318b45[_0x7af6('0x34')]:_0x201501[_0x7af6('0x32')];if(!_0x259432['query'][_0x7af6('0x37')](_0x7af6('0x38'))){_0x318b45['limit']=qs[_0x7af6('0x39')](_0x259432[_0x7af6('0x33')][_0x7af6('0x39')]);_0x318b45[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x259432['query'][_0x7af6('0x1f')]);}_0x318b45[_0x7af6('0x3a')]=qs[_0x7af6('0x3b')](_0x259432['query']['sort']);delete _0x259432[_0x7af6('0x33')]['sort'];_0x318b45[_0x7af6('0x3c')]=qs[_0x7af6('0x3d')](_[_0x7af6('0x3e')](_0x259432[_0x7af6('0x33')],_0x201501[_0x7af6('0x3d')]),_0x2ce2bf);if(_0x259432[_0x7af6('0x33')]['filter']){_0x318b45[_0x7af6('0x3c')]=_[_0x7af6('0x3f')](_0x318b45[_0x7af6('0x3c')],{'$or':_[_0x7af6('0x2d')](_0x2ce2bf,function(_0x131d4c){if(_0x131d4c[_0x7af6('0x31')]!==_0x7af6('0x40')){var _0x51f448={};_0x51f448[_0x131d4c[_0x7af6('0x2b')]]={'$like':'%'+_0x259432[_0x7af6('0x33')]['filter']+'%'};return _0x51f448;}})});}_0x318b45=_['merge']({},_0x318b45,_0x259432['options']);var _0x5cd108={'where':_0x318b45['where']};return db['VoiceMusicOnHold'][_0x7af6('0x1e')](_0x5cd108)[_0x7af6('0x28')](function(_0x2fa3e5){_0x2017ec['count']=_0x2fa3e5;if(_0x259432['query'][_0x7af6('0x41')]){_0x318b45[_0x7af6('0x42')]=[{'all':!![]}];}return db[_0x7af6('0x2e')]['findAll'](_0x318b45);})[_0x7af6('0x28')](function(_0xf1e46c){_0x2017ec[_0x7af6('0x43')]=_0xf1e46c;return _0x2017ec;})['then'](respondWithFilteredResult(_0x5c25b2,_0x318b45))['catch'](handleError(_0x5c25b2,null));};exports[_0x7af6('0x44')]=function(_0x46653d,_0x5daed8){var _0x54132a={'raw':![],'where':{'id':_0x46653d[_0x7af6('0x45')]['id']}},_0x35075c={};_0x35075c[_0x7af6('0x32')]=_[_0x7af6('0x46')](db['VoiceMusicOnHold'][_0x7af6('0x2f')]);_0x35075c[_0x7af6('0x33')]=_[_0x7af6('0x46')](_0x46653d[_0x7af6('0x33')]);_0x35075c[_0x7af6('0x3d')]=_[_0x7af6('0x47')](_0x35075c['model'],_0x35075c[_0x7af6('0x33')]);_0x54132a[_0x7af6('0x34')]=_[_0x7af6('0x47')](_0x35075c[_0x7af6('0x32')],qs[_0x7af6('0x35')](_0x46653d[_0x7af6('0x33')][_0x7af6('0x35')]));_0x54132a[_0x7af6('0x34')]=_0x54132a[_0x7af6('0x34')][_0x7af6('0x36')]?_0x54132a[_0x7af6('0x34')]:_0x35075c[_0x7af6('0x32')];if(_0x46653d[_0x7af6('0x33')]['includeAll']){_0x54132a[_0x7af6('0x42')]=[{'all':!![]}];}_0x54132a=_[_0x7af6('0x3f')]({},_0x54132a,_0x46653d[_0x7af6('0x48')]);return db[_0x7af6('0x2e')][_0x7af6('0x49')](_0x54132a)['then'](handleEntityNotFound(_0x5daed8,null))[_0x7af6('0x28')](respondWithResult(_0x5daed8,null))['catch'](handleError(_0x5daed8,null));};exports['update']=function(_0x2f629d,_0x5f46e5){if(_0x2f629d['body']['id']){delete _0x2f629d[_0x7af6('0x4a')]['id'];}return db[_0x7af6('0x2e')]['find']({'where':{'id':_0x2f629d[_0x7af6('0x45')]['id']}})[_0x7af6('0x28')](handleEntityNotFound(_0x5f46e5,null))[_0x7af6('0x28')](saveUpdates(_0x2f629d[_0x7af6('0x4a')],null))[_0x7af6('0x28')](respondWithResult(_0x5f46e5,null))['catch'](handleError(_0x5f46e5,null));};exports[_0x7af6('0x4b')]=function(_0x4b0e53,_0x28f1cb,_0x1d4241){return db[_0x7af6('0x4c')]['transaction'](function(_0x5a678f){if(_0x4b0e53[_0x7af6('0x4a')][_0x7af6('0x4d')]===_0x7af6('0x4e')){_0x4b0e53[_0x7af6('0x4a')][_0x7af6('0x4f')]=path[_0x7af6('0x50')](config['root'],'server/files/moh',_0x4b0e53[_0x7af6('0x4a')]['name']);}return db[_0x7af6('0x2e')]['create'](_0x4b0e53['body'],{'transaction':_0x5a678f})[_0x7af6('0x28')](function(_0x3c089d){if(_0x4b0e53[_0x7af6('0x4a')][_0x7af6('0x4d')]===_0x7af6('0x4e')){fs['mkdirSync'](_0x3c089d['directory'],parseInt(_0x7af6('0x51'),0x8));}var _0x5d5e0b=_0x4b0e53[_0x7af6('0x52')]['get']({'plain':!![]});if(!_0x5d5e0b)throw new Error(_0x7af6('0x53'));if(_0x5d5e0b[_0x7af6('0x54')]===_0x7af6('0x52')){var _0x3aedb1=_0x3c089d[_0x7af6('0x27')]({'plain':!![]});return db[_0x7af6('0x55')]['find']({'where':{'name':_0x7af6('0x56'),'userProfileId':_0x5d5e0b[_0x7af6('0x57')]},'raw':!![]})['then'](function(_0x21ef11){if(_0x21ef11&&_0x21ef11[_0x7af6('0x58')]===0x0){return db[_0x7af6('0x59')][_0x7af6('0x4b')]({'name':_0x3aedb1[_0x7af6('0x2b')],'resourceId':_0x3aedb1['id'],'type':_0x21ef11[_0x7af6('0x2b')],'sectionId':_0x21ef11['id']},{})[_0x7af6('0x28')](function(){return _0x3c089d;});}else{return _0x3c089d;}})[_0x7af6('0x5a')](function(_0x4f4d31){logger['error'](_0x7af6('0x5b'),_0x4f4d31);});}return _0x3c089d;});})['then'](respondWithResult(_0x28f1cb,0xc9))['catch'](handleError(_0x28f1cb,null));};exports[_0x7af6('0x26')]=function(_0x5a5886,_0x4b18e6,_0x1f3069){var _0x56d7dd;return db[_0x7af6('0x2e')]['find']({'where':{'id':_0x5a5886[_0x7af6('0x45')]['id']}})[_0x7af6('0x28')](function(_0x5975da){if(_0x5975da){return db['sequelize'][_0x7af6('0x5c')](function(_0x911ee3){return _0x5975da['destroy']({'transaction':_0x911ee3,'raw':!![]})[_0x7af6('0x28')](function(_0x585f23){if(_0x585f23[_0x7af6('0x4f')]){fs[_0x7af6('0x5d')](_0x585f23[_0x7af6('0x4f')])['forEach'](function(_0x2930e8){fs[_0x7af6('0x5e')](path[_0x7af6('0x50')](_0x585f23['directory'],_0x2930e8));});fs['rmdirSync'](_0x585f23['directory']);}return _0x585f23;});})[_0x7af6('0x5a')](function(_0xe49262){throw new db[(_0x7af6('0x5f'))][(_0x7af6('0x60'))](_0xe49262['message']);});}})[_0x7af6('0x28')](handleEntityNotFound(_0x4b18e6,null))[_0x7af6('0x28')](removeEntity(_0x4b18e6,null))[_0x7af6('0x5a')](handleError(_0x4b18e6,null));};exports['addSound']=function(_0x34a32d,_0x2d6f36,_0x3a8bad){return db[_0x7af6('0x4c')][_0x7af6('0x5c')](function(_0x381ed6){var _0x5b222d;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x34a32d[_0x7af6('0x45')]['id']}})[_0x7af6('0x28')](function(_0x213a84){if(_0x213a84){_0x5b222d=_0x213a84;return _0x213a84['addSound'](_0x34a32d[_0x7af6('0x4a')]['id'],{'transaction':_0x381ed6});}})[_0x7af6('0x28')](function(_0x155848){if(_0x155848){return db['Sound'][_0x7af6('0x61')]({'where':{'id':_0x34a32d[_0x7af6('0x4a')]['id']},'attributes':['id','name','save_name',_0x7af6('0x62'),_0x7af6('0x63')],'raw':!![]});}})[_0x7af6('0x28')](function(_0x56b9e7){if(_0x56b9e7){var _0x46545a=path['join'](config[_0x7af6('0x64')],_0x7af6('0x65'),util[_0x7af6('0x66')](_0x7af6('0x67'),path[_0x7af6('0x68')](_0x56b9e7[_0x7af6('0x69')],path[_0x7af6('0x6a')](_0x56b9e7[_0x7af6('0x69')])),_0x56b9e7[_0x7af6('0x62')]));var _0x5ae264=path[_0x7af6('0x50')](config['root'],_0x7af6('0x6b'),_0x5b222d[_0x7af6('0x2b')],util[_0x7af6('0x66')]('%s.%s',_0x56b9e7[_0x7af6('0x2b')],_0x56b9e7[_0x7af6('0x62')]));fs[_0x7af6('0x6c')](_0x46545a,_0x5ae264);return _0x56b9e7;}})['catch'](function(_0x589548){throw new db['Sequelize'][(_0x7af6('0x60'))](_0x589548[_0x7af6('0x6d')]);});})['then'](handleEntityNotFound(_0x2d6f36,null))['then'](respondWithResult(_0x2d6f36,0xc9))[_0x7af6('0x5a')](handleError(_0x2d6f36,null));};exports[_0x7af6('0x6e')]=function(_0x1fc8c5,_0x763129,_0x3e00e8){return db[_0x7af6('0x4c')][_0x7af6('0x5c')](function(_0x1fc2e7){var _0x2dbc6d;return db[_0x7af6('0x2e')][_0x7af6('0x61')]({'where':{'id':_0x1fc8c5[_0x7af6('0x45')]['id']}})[_0x7af6('0x28')](handleEntityNotFound(_0x763129,null))[_0x7af6('0x28')](function(_0x246f0f){if(_0x246f0f){_0x2dbc6d=_0x246f0f;return _0x246f0f[_0x7af6('0x6e')](_0x1fc8c5[_0x7af6('0x45')]['id2']);}})[_0x7af6('0x28')](function(_0x30bd74){if(_0x30bd74){return db[_0x7af6('0x6f')][_0x7af6('0x61')]({'where':{'id':_0x1fc8c5['params']['id2']},'attributes':['id',_0x7af6('0x2b'),'save_name',_0x7af6('0x62'),_0x7af6('0x63')],'raw':!![]});}})[_0x7af6('0x28')](function(_0x191105){if(_0x191105){fs[_0x7af6('0x5e')](path[_0x7af6('0x50')](_0x2dbc6d[_0x7af6('0x4f')],util[_0x7af6('0x66')](_0x7af6('0x67'),_0x191105[_0x7af6('0x2b')],_0x191105['converted_format'])));return _0x191105;}})[_0x7af6('0x5a')](function(_0x3500a5){throw new db[(_0x7af6('0x5f'))][(_0x7af6('0x60'))](_0x3500a5[_0x7af6('0x6d')]);});})[_0x7af6('0x28')](handleEntityNotFound(_0x763129,null))[_0x7af6('0x28')](respondWithStatusCode(_0x763129,0xcc))['catch'](handleError(_0x763129,null));};exports[_0x7af6('0x70')]=function(_0x36d581,_0x1ae3a7,_0x2dfe56){var _0x491959={};var _0x172097={};var _0x33ee5f;var _0xe2c010;return db[_0x7af6('0x2e')]['findOne']({'where':{'id':_0x36d581['params']['id']}})['then'](handleEntityNotFound(_0x1ae3a7,null))['then'](function(_0x28e372){if(_0x28e372){_0x33ee5f=_0x28e372;_0x172097[_0x7af6('0x32')]=_[_0x7af6('0x46')](db[_0x7af6('0x6f')][_0x7af6('0x2f')]);_0x172097[_0x7af6('0x33')]=_[_0x7af6('0x46')](_0x36d581[_0x7af6('0x33')]);_0x172097['filters']=_[_0x7af6('0x47')](_0x172097[_0x7af6('0x32')],_0x172097[_0x7af6('0x33')]);_0x491959[_0x7af6('0x34')]=_[_0x7af6('0x47')](_0x172097[_0x7af6('0x32')],qs[_0x7af6('0x35')](_0x36d581[_0x7af6('0x33')][_0x7af6('0x35')]));_0x491959[_0x7af6('0x34')]=_0x491959[_0x7af6('0x34')]['length']?_0x491959[_0x7af6('0x34')]:_0x172097[_0x7af6('0x32')];_0x491959[_0x7af6('0x3a')]=qs[_0x7af6('0x3b')](_0x36d581['query'][_0x7af6('0x3b')]);_0x491959[_0x7af6('0x3c')]=qs[_0x7af6('0x3d')](_[_0x7af6('0x3e')](_0x36d581['query'],_0x172097[_0x7af6('0x3d')]));if(_0x36d581[_0x7af6('0x33')][_0x7af6('0x71')]){_0x491959[_0x7af6('0x3c')]=_[_0x7af6('0x3f')](_0x491959[_0x7af6('0x3c')],{'$or':_[_0x7af6('0x2d')](_0x491959[_0x7af6('0x34')],function(_0x3278e9){var _0x257b32={};_0x257b32[_0x3278e9]={'$like':'%'+_0x36d581['query'][_0x7af6('0x71')]+'%'};return _0x257b32;})});}_0x491959=_[_0x7af6('0x3f')]({},_0x491959,_0x36d581[_0x7af6('0x48')]);return _0x33ee5f[_0x7af6('0x70')](_0x491959);}})['then'](function(_0x338ea0){if(_0x338ea0){_0xe2c010=_0x338ea0[_0x7af6('0x36')];if(!_0x36d581[_0x7af6('0x33')][_0x7af6('0x37')](_0x7af6('0x38'))){_0x491959[_0x7af6('0x39')]=qs[_0x7af6('0x39')](_0x36d581[_0x7af6('0x33')][_0x7af6('0x39')]);_0x491959[_0x7af6('0x1f')]=qs[_0x7af6('0x1f')](_0x36d581[_0x7af6('0x33')]['offset']);}return _0x33ee5f['getSounds'](_0x491959);}})[_0x7af6('0x28')](function(_0x3a40f1){if(_0x3a40f1){return _0x3a40f1?{'count':_0xe2c010,'rows':_0x3a40f1}:null;}})[_0x7af6('0x28')](respondWithResult(_0x1ae3a7,null))[_0x7af6('0x5a')](handleError(_0x1ae3a7,null));}; \ No newline at end of file +var _0x7322=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','body','sequelize','directory','join','server/files/moh','create','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','transaction','Sound','save_name','converted_format','root','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','Sequelize','findOne','createdAt','getSounds','eml-format','fast-json-patch','bluebird','mustache','path','to-csv','fs-extra','lodash','squel'];(function(_0x1248d2,_0x3d758f){var _0x102412=function(_0x47e4b8){while(--_0x47e4b8){_0x1248d2['push'](_0x1248d2['shift']());}};_0x102412(++_0x3d758f);}(_0x7322,0xd5));var _0x2732=function(_0x1165ff,_0x375a85){_0x1165ff=_0x1165ff-0x0;var _0x169b79=_0x7322[_0x1165ff];return _0x169b79;};'use strict';var emlformat=require(_0x2732('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2732('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2732('0x2'));var Mustache=require(_0x2732('0x3'));var util=require('util');var path=require(_0x2732('0x4'));var sox=require('sox');var csv=require(_0x2732('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2732('0x6'));var _=require(_0x2732('0x7'));var squel=require(_0x2732('0x8'));var crypto=require('crypto');var jsforce=require(_0x2732('0x9'));var deskjs=require(_0x2732('0xa'));var toCsv=require(_0x2732('0x5'));var querystring=require('querystring');var Papa=require(_0x2732('0xb'));var Redis=require(_0x2732('0xc'));var authService=require(_0x2732('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2732('0xe'));var hardwareService=require(_0x2732('0xf'));var logger=require(_0x2732('0x10'))('api');var utils=require(_0x2732('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2732('0x12'));var db=require(_0x2732('0x13'))['db'];function respondWithStatusCode(_0x9145c0,_0x17c5e1){_0x17c5e1=_0x17c5e1||0xcc;return function(_0x43b389){if(_0x43b389){return _0x9145c0[_0x2732('0x14')](_0x17c5e1);}return _0x9145c0[_0x2732('0x15')](_0x17c5e1)[_0x2732('0x16')]();};}function respondWithResult(_0x1fb209,_0x5c0da9){_0x5c0da9=_0x5c0da9||0xc8;return function(_0x2065ed){if(_0x2065ed){return _0x1fb209[_0x2732('0x15')](_0x5c0da9)['json'](_0x2065ed);}};}function respondWithFilteredResult(_0x5c9053,_0x139f22){return function(_0x48d409){if(_0x48d409){var _0x593f00=typeof _0x139f22[_0x2732('0x17')]===_0x2732('0x18')&&typeof _0x139f22['limit']===_0x2732('0x18');var _0x1f13a9=_0x48d409[_0x2732('0x19')];var _0xb444cf=_0x593f00?0x0:_0x139f22[_0x2732('0x17')];var _0x3d19fb=_0x593f00?_0x48d409[_0x2732('0x19')]:_0x139f22['offset']+_0x139f22[_0x2732('0x1a')];var _0x2dc0bf;if(_0x3d19fb>=_0x1f13a9){_0x3d19fb=_0x1f13a9;_0x2dc0bf=0xc8;}else{_0x2dc0bf=0xce;}_0x5c9053[_0x2732('0x15')](_0x2dc0bf);return _0x5c9053[_0x2732('0x1b')](_0x2732('0x1c'),_0xb444cf+'-'+_0x3d19fb+'/'+_0x1f13a9)['json'](_0x48d409);}return null;};}function patchUpdates(_0x324d5b){return function(_0xe728df){try{jsonpatch[_0x2732('0x1d')](_0xe728df,_0x324d5b,!![]);}catch(_0x2cf8c0){return BPromise[_0x2732('0x1e')](_0x2cf8c0);}return _0xe728df[_0x2732('0x1f')]();};}function saveUpdates(_0x56d933,_0x137fd8){return function(_0x40a22a){if(_0x40a22a){return _0x40a22a[_0x2732('0x20')](_0x56d933)[_0x2732('0x21')](function(_0x4ce162){return _0x4ce162;});}return null;};}function removeEntity(_0x1a74c7,_0x1ba30d){return function(_0x5eb79f){if(_0x5eb79f){return _0x5eb79f[_0x2732('0x22')]()[_0x2732('0x21')](function(){var _0x2ebb17=_0x5eb79f[_0x2732('0x23')]({'plain':!![]});var _0x25c6a1=_0x2732('0x24');return db[_0x2732('0x25')][_0x2732('0x22')]({'where':{'type':_0x25c6a1,'resourceId':_0x2ebb17['id']}})[_0x2732('0x21')](function(){return _0x5eb79f;});})['then'](function(){_0x1a74c7[_0x2732('0x15')](0xcc)[_0x2732('0x16')]();});}};}function handleEntityNotFound(_0x54faa9,_0x2af946){return function(_0x3e327b){if(!_0x3e327b){_0x54faa9[_0x2732('0x14')](0x194);}return _0x3e327b;};}function handleError(_0x38855e,_0x503500){_0x503500=_0x503500||0x1f4;return function(_0x4cc45f){logger[_0x2732('0x26')](_0x4cc45f[_0x2732('0x27')]);if(_0x4cc45f[_0x2732('0x28')]){delete _0x4cc45f[_0x2732('0x28')];}_0x38855e[_0x2732('0x15')](_0x503500)[_0x2732('0x29')](_0x4cc45f);};}exports[_0x2732('0x2a')]=function(_0x45d904,_0x2bf4ba){var _0x378457={},_0x4c28fd={},_0x4729a6={'count':0x0,'rows':[]};var _0x935640=_[_0x2732('0x2b')](db[_0x2732('0x2c')][_0x2732('0x2d')],function(_0x470524){return{'name':_0x470524[_0x2732('0x2e')],'type':_0x470524['type'][_0x2732('0x2f')]};});_0x4c28fd[_0x2732('0x30')]=_[_0x2732('0x2b')](_0x935640,_0x2732('0x28'));_0x4c28fd[_0x2732('0x31')]=_['keys'](_0x45d904[_0x2732('0x31')]);_0x4c28fd[_0x2732('0x32')]=_['intersection'](_0x4c28fd[_0x2732('0x30')],_0x4c28fd[_0x2732('0x31')]);_0x378457[_0x2732('0x33')]=_[_0x2732('0x34')](_0x4c28fd[_0x2732('0x30')],qs[_0x2732('0x35')](_0x45d904[_0x2732('0x31')][_0x2732('0x35')]));_0x378457[_0x2732('0x33')]=_0x378457[_0x2732('0x33')][_0x2732('0x36')]?_0x378457[_0x2732('0x33')]:_0x4c28fd[_0x2732('0x30')];if(!_0x45d904[_0x2732('0x31')]['hasOwnProperty'](_0x2732('0x37'))){_0x378457[_0x2732('0x1a')]=qs[_0x2732('0x1a')](_0x45d904[_0x2732('0x31')][_0x2732('0x1a')]);_0x378457[_0x2732('0x17')]=qs[_0x2732('0x17')](_0x45d904[_0x2732('0x31')][_0x2732('0x17')]);}_0x378457[_0x2732('0x38')]=qs[_0x2732('0x39')](_0x45d904[_0x2732('0x31')][_0x2732('0x39')]);delete _0x45d904[_0x2732('0x31')]['sort'];_0x378457['where']=qs[_0x2732('0x32')](_[_0x2732('0x3a')](_0x45d904[_0x2732('0x31')],_0x4c28fd[_0x2732('0x32')]),_0x935640);if(_0x45d904['query'][_0x2732('0x3b')]){_0x378457[_0x2732('0x3c')]=_[_0x2732('0x3d')](_0x378457['where'],{'$or':_['map'](_0x935640,function(_0x21e96c){if(_0x21e96c[_0x2732('0x3e')]!==_0x2732('0x3f')){var _0x49fdb1={};_0x49fdb1[_0x21e96c[_0x2732('0x28')]]={'$like':'%'+_0x45d904[_0x2732('0x31')]['filter']+'%'};return _0x49fdb1;}})});}_0x378457=_['merge']({},_0x378457,_0x45d904[_0x2732('0x40')]);var _0x5d7cd4={'where':_0x378457[_0x2732('0x3c')]};return db[_0x2732('0x2c')][_0x2732('0x19')](_0x5d7cd4)[_0x2732('0x21')](function(_0x188f12){_0x4729a6[_0x2732('0x19')]=_0x188f12;if(_0x45d904[_0x2732('0x31')][_0x2732('0x41')]){_0x378457[_0x2732('0x42')]=[{'all':!![]}];}return db[_0x2732('0x2c')][_0x2732('0x43')](_0x378457);})[_0x2732('0x21')](function(_0x5b0083){_0x4729a6[_0x2732('0x44')]=_0x5b0083;return _0x4729a6;})[_0x2732('0x21')](respondWithFilteredResult(_0x2bf4ba,_0x378457))[_0x2732('0x45')](handleError(_0x2bf4ba,null));};exports[_0x2732('0x46')]=function(_0xb34fca,_0x1ac0f4){var _0x2a2cfb={'raw':![],'where':{'id':_0xb34fca['params']['id']}},_0x66b090={};_0x66b090[_0x2732('0x30')]=_[_0x2732('0x47')](db[_0x2732('0x2c')][_0x2732('0x2d')]);_0x66b090[_0x2732('0x31')]=_[_0x2732('0x47')](_0xb34fca[_0x2732('0x31')]);_0x66b090[_0x2732('0x32')]=_[_0x2732('0x34')](_0x66b090[_0x2732('0x30')],_0x66b090[_0x2732('0x31')]);_0x2a2cfb['attributes']=_[_0x2732('0x34')](_0x66b090[_0x2732('0x30')],qs[_0x2732('0x35')](_0xb34fca[_0x2732('0x31')][_0x2732('0x35')]));_0x2a2cfb[_0x2732('0x33')]=_0x2a2cfb[_0x2732('0x33')][_0x2732('0x36')]?_0x2a2cfb['attributes']:_0x66b090[_0x2732('0x30')];if(_0xb34fca[_0x2732('0x31')]['includeAll']){_0x2a2cfb['include']=[{'all':!![]}];}_0x2a2cfb=_[_0x2732('0x3d')]({},_0x2a2cfb,_0xb34fca[_0x2732('0x40')]);return db[_0x2732('0x2c')][_0x2732('0x48')](_0x2a2cfb)[_0x2732('0x21')](handleEntityNotFound(_0x1ac0f4,null))[_0x2732('0x21')](respondWithResult(_0x1ac0f4,null))[_0x2732('0x45')](handleError(_0x1ac0f4,null));};exports[_0x2732('0x20')]=function(_0x2cdfc2,_0x227d63){if(_0x2cdfc2[_0x2732('0x49')]['id']){delete _0x2cdfc2['body']['id'];}return db[_0x2732('0x2c')][_0x2732('0x48')]({'where':{'id':_0x2cdfc2['params']['id']}})[_0x2732('0x21')](handleEntityNotFound(_0x227d63,null))[_0x2732('0x21')](saveUpdates(_0x2cdfc2[_0x2732('0x49')],null))[_0x2732('0x21')](respondWithResult(_0x227d63,null))[_0x2732('0x45')](handleError(_0x227d63,null));};exports['create']=function(_0x341f2c,_0x43f66,_0x11682a){return db[_0x2732('0x4a')]['transaction'](function(_0xf81e5d){if(_0x341f2c[_0x2732('0x49')]['mode']==='files'){_0x341f2c[_0x2732('0x49')][_0x2732('0x4b')]=path[_0x2732('0x4c')](config['root'],_0x2732('0x4d'),_0x341f2c[_0x2732('0x49')]['name']);}return db[_0x2732('0x2c')][_0x2732('0x4e')](_0x341f2c[_0x2732('0x49')],{'transaction':_0xf81e5d})[_0x2732('0x21')](function(_0x14596a){if(_0x341f2c[_0x2732('0x49')][_0x2732('0x4f')]==='files'){fs[_0x2732('0x50')](_0x14596a[_0x2732('0x4b')],parseInt(_0x2732('0x51'),0x8));}var _0x16d52a=_0x341f2c[_0x2732('0x52')][_0x2732('0x23')]({'plain':!![]});if(!_0x16d52a)throw new Error(_0x2732('0x53'));if(_0x16d52a[_0x2732('0x54')]===_0x2732('0x52')){var _0x2d8e68=_0x14596a[_0x2732('0x23')]({'plain':!![]});return db['UserProfileSection'][_0x2732('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x16d52a[_0x2732('0x55')]},'raw':!![]})[_0x2732('0x21')](function(_0x221681){if(_0x221681&&_0x221681[_0x2732('0x56')]===0x0){return db[_0x2732('0x25')]['create']({'name':_0x2d8e68[_0x2732('0x28')],'resourceId':_0x2d8e68['id'],'type':_0x221681['name'],'sectionId':_0x221681['id']},{})[_0x2732('0x21')](function(){return _0x14596a;});}else{return _0x14596a;}})['catch'](function(_0x1dfd04){logger[_0x2732('0x26')](_0x2732('0x57'),_0x1dfd04);});}return _0x14596a;});})[_0x2732('0x21')](respondWithResult(_0x43f66,0xc9))[_0x2732('0x45')](handleError(_0x43f66,null));};exports['destroy']=function(_0x4fcdfa,_0x2f709a,_0x1e310b){var _0x58d39e;return db[_0x2732('0x2c')][_0x2732('0x48')]({'where':{'id':_0x4fcdfa[_0x2732('0x58')]['id']}})[_0x2732('0x21')](function(_0x295724){if(_0x295724){return db['sequelize']['transaction'](function(_0x152377){return _0x295724[_0x2732('0x22')]({'transaction':_0x152377,'raw':!![]})['then'](function(_0x556053){if(_0x556053[_0x2732('0x4b')]){fs[_0x2732('0x59')](_0x556053[_0x2732('0x4b')])[_0x2732('0x5a')](function(_0x205464){fs[_0x2732('0x5b')](path[_0x2732('0x4c')](_0x556053['directory'],_0x205464));});fs[_0x2732('0x5c')](_0x556053[_0x2732('0x4b')]);}return _0x556053;});})['catch'](function(_0x26098b){throw new db['Sequelize'][(_0x2732('0x5d'))](_0x26098b[_0x2732('0x5e')]);});}})['then'](handleEntityNotFound(_0x2f709a,null))[_0x2732('0x21')](removeEntity(_0x2f709a,null))[_0x2732('0x45')](handleError(_0x2f709a,null));};exports[_0x2732('0x5f')]=function(_0x24b55e,_0x3c012d,_0x2ea945){return db[_0x2732('0x4a')][_0x2732('0x60')](function(_0x404093){var _0x2f9612;return db[_0x2732('0x2c')][_0x2732('0x48')]({'where':{'id':_0x24b55e['params']['id']}})[_0x2732('0x21')](function(_0x2f08bb){if(_0x2f08bb){_0x2f9612=_0x2f08bb;return _0x2f08bb[_0x2732('0x5f')](_0x24b55e['body']['id'],{'transaction':_0x404093});}})['then'](function(_0x36c9f5){if(_0x36c9f5){return db[_0x2732('0x61')]['findOne']({'where':{'id':_0x24b55e[_0x2732('0x49')]['id']},'attributes':['id',_0x2732('0x28'),_0x2732('0x62'),_0x2732('0x63'),'createdAt'],'raw':!![]});}})[_0x2732('0x21')](function(_0x152858){if(_0x152858){var _0x4df4fb=path[_0x2732('0x4c')](config[_0x2732('0x64')],_0x2732('0x65'),util[_0x2732('0x66')]('%s.%s',path[_0x2732('0x67')](_0x152858['save_name'],path[_0x2732('0x68')](_0x152858[_0x2732('0x62')])),_0x152858[_0x2732('0x63')]));var _0x17cc5a=path[_0x2732('0x4c')](config[_0x2732('0x64')],_0x2732('0x4d'),_0x2f9612['name'],util[_0x2732('0x66')](_0x2732('0x69'),_0x152858['name'],_0x152858['converted_format']));fs[_0x2732('0x6a')](_0x4df4fb,_0x17cc5a);return _0x152858;}})[_0x2732('0x45')](function(_0x3a9e32){throw new db[(_0x2732('0x6b'))][(_0x2732('0x5d'))](_0x3a9e32[_0x2732('0x5e')]);});})['then'](handleEntityNotFound(_0x3c012d,null))[_0x2732('0x21')](respondWithResult(_0x3c012d,0xc9))['catch'](handleError(_0x3c012d,null));};exports['removeSound']=function(_0x446c9d,_0x367887,_0x418f57){return db[_0x2732('0x4a')][_0x2732('0x60')](function(_0x21a100){var _0x16c562;return db[_0x2732('0x2c')]['findOne']({'where':{'id':_0x446c9d[_0x2732('0x58')]['id']}})[_0x2732('0x21')](handleEntityNotFound(_0x367887,null))[_0x2732('0x21')](function(_0x2a14d1){if(_0x2a14d1){_0x16c562=_0x2a14d1;return _0x2a14d1['removeSound'](_0x446c9d['params']['id2']);}})[_0x2732('0x21')](function(_0x2c737f){if(_0x2c737f){return db['Sound'][_0x2732('0x6c')]({'where':{'id':_0x446c9d[_0x2732('0x58')]['id2']},'attributes':['id','name','save_name',_0x2732('0x63'),_0x2732('0x6d')],'raw':!![]});}})['then'](function(_0x1111bf){if(_0x1111bf){fs['unlinkSync'](path[_0x2732('0x4c')](_0x16c562[_0x2732('0x4b')],util[_0x2732('0x66')](_0x2732('0x69'),_0x1111bf['name'],_0x1111bf[_0x2732('0x63')])));return _0x1111bf;}})[_0x2732('0x45')](function(_0x2af461){throw new db[(_0x2732('0x6b'))][(_0x2732('0x5d'))](_0x2af461[_0x2732('0x5e')]);});})['then'](handleEntityNotFound(_0x367887,null))[_0x2732('0x21')](respondWithStatusCode(_0x367887,0xcc))[_0x2732('0x45')](handleError(_0x367887,null));};exports[_0x2732('0x6e')]=function(_0x426dde,_0x3b2b88,_0x124ba3){var _0x2a3594={};var _0x297172={};var _0x242c95;var _0x3982e3;return db['VoiceMusicOnHold'][_0x2732('0x6c')]({'where':{'id':_0x426dde['params']['id']}})['then'](handleEntityNotFound(_0x3b2b88,null))[_0x2732('0x21')](function(_0x1d0ab4){if(_0x1d0ab4){_0x242c95=_0x1d0ab4;_0x297172[_0x2732('0x30')]=_['keys'](db[_0x2732('0x61')][_0x2732('0x2d')]);_0x297172['query']=_[_0x2732('0x47')](_0x426dde[_0x2732('0x31')]);_0x297172[_0x2732('0x32')]=_['intersection'](_0x297172[_0x2732('0x30')],_0x297172[_0x2732('0x31')]);_0x2a3594[_0x2732('0x33')]=_[_0x2732('0x34')](_0x297172['model'],qs[_0x2732('0x35')](_0x426dde[_0x2732('0x31')][_0x2732('0x35')]));_0x2a3594[_0x2732('0x33')]=_0x2a3594['attributes'][_0x2732('0x36')]?_0x2a3594['attributes']:_0x297172['model'];_0x2a3594[_0x2732('0x38')]=qs['sort'](_0x426dde[_0x2732('0x31')][_0x2732('0x39')]);_0x2a3594[_0x2732('0x3c')]=qs[_0x2732('0x32')](_[_0x2732('0x3a')](_0x426dde[_0x2732('0x31')],_0x297172[_0x2732('0x32')]));if(_0x426dde['query'][_0x2732('0x3b')]){_0x2a3594[_0x2732('0x3c')]=_['merge'](_0x2a3594[_0x2732('0x3c')],{'$or':_['map'](_0x2a3594['attributes'],function(_0x15bf64){var _0x353bd8={};_0x353bd8[_0x15bf64]={'$like':'%'+_0x426dde[_0x2732('0x31')][_0x2732('0x3b')]+'%'};return _0x353bd8;})});}_0x2a3594=_[_0x2732('0x3d')]({},_0x2a3594,_0x426dde[_0x2732('0x40')]);return _0x242c95['getSounds'](_0x2a3594);}})[_0x2732('0x21')](function(_0x5d9774){if(_0x5d9774){_0x3982e3=_0x5d9774[_0x2732('0x36')];if(!_0x426dde['query']['hasOwnProperty'](_0x2732('0x37'))){_0x2a3594[_0x2732('0x1a')]=qs['limit'](_0x426dde[_0x2732('0x31')][_0x2732('0x1a')]);_0x2a3594['offset']=qs[_0x2732('0x17')](_0x426dde[_0x2732('0x31')]['offset']);}return _0x242c95[_0x2732('0x6e')](_0x2a3594);}})[_0x2732('0x21')](function(_0x2592ec){if(_0x2592ec){return _0x2592ec?{'count':_0x3982e3,'rows':_0x2592ec}:null;}})[_0x2732('0x21')](respondWithResult(_0x3b2b88,null))[_0x2732('0x45')](handleError(_0x3b2b88,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 7271d33..9e8c07b 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 _0xd604=['lodash','api','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x2fde8b,_0x3b0bb9){var _0x4c9ed0=function(_0x4e6e6f){while(--_0x4e6e6f){_0x2fde8b['push'](_0x2fde8b['shift']());}};_0x4c9ed0(++_0x3b0bb9);}(_0xd604,0x10e));var _0x4d60=function(_0x1748c3,_0x24acc8){_0x1748c3=_0x1748c3-0x0;var _0x4e479f=_0xd604[_0x1748c3];return _0x4e479f;};'use strict';var _=require(_0x4d60('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d60('0x1'));var moment=require('moment');var BPromise=require(_0x4d60('0x2'));var rp=require(_0x4d60('0x3'));var fs=require('fs');var path=require(_0x4d60('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4d60('0x5'));module[_0x4d60('0x6')]=function(_0x19ae2a,_0x5657b3){return _0x19ae2a[_0x4d60('0x7')](_0x4d60('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad35=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','request-promise','path','rimraf'];(function(_0x4c3334,_0xfb3603){var _0x166db4=function(_0x1189f0){while(--_0x1189f0){_0x4c3334['push'](_0x4c3334['shift']());}};_0x166db4(++_0xfb3603);}(_0xad35,0x1c2));var _0x5ad3=function(_0x15ade9,_0xffd140){_0x15ade9=_0x15ade9-0x0;var _0x5d1b72=_0xad35[_0x15ade9];return _0x5d1b72;};'use strict';var _=require(_0x5ad3('0x0'));var util=require(_0x5ad3('0x1'));var logger=require('../../config/logger')(_0x5ad3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ad3('0x3'));var fs=require('fs');var path=require(_0x5ad3('0x4'));var rimraf=require(_0x5ad3('0x5'));var config=require(_0x5ad3('0x6'));var attributes=require(_0x5ad3('0x7'));module[_0x5ad3('0x8')]=function(_0x51f324,_0x14863e){return _0x51f324[_0x5ad3('0x9')](_0x5ad3('0xa'),attributes,{'tableName':_0x5ad3('0xb'),'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 9e6b3ee..e509b45 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x38181c,_0x35e031){var _0x4725c9=function(_0x13f2cd){while(--_0x13f2cd){_0x38181c['push'](_0x38181c['shift']());}};_0x4725c9(++_0x35e031);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +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(_0x444d72,_0x56b24b){var _0x1847e2=function(_0x825628){while(--_0x825628){_0x444d72['push'](_0x444d72['shift']());}};_0x1847e2(++_0x56b24b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f2231,_0x1e49a4){_0x1f2231=_0x1f2231-0x0;var _0x1c88d2=_0xedd9[_0x1f2231];return _0x1c88d2;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a124d7c..bc89f3b 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 _0x061c=['delete','destroy','/:id/users','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update'];(function(_0x34a1a6,_0xf3e880){var _0x5adef7=function(_0x488eb9){while(--_0x488eb9){_0x34a1a6['push'](_0x34a1a6['shift']());}};_0x5adef7(++_0xf3e880);}(_0x061c,0xc0));var _0xc061=function(_0x452041,_0xb2179e){_0x452041=_0x452041-0x0;var _0x13fe27=_0x061c[_0x452041];return _0x13fe27;};'use strict';var multer=require(_0xc061('0x0'));var util=require(_0xc061('0x1'));var path=require(_0xc061('0x2'));var timeout=require(_0xc061('0x3'));var express=require(_0xc061('0x4'));var router=express[_0xc061('0x5')]();var fs_extra=require(_0xc061('0x6'));var auth=require(_0xc061('0x7'));var interaction=require(_0xc061('0x8'));var config=require('../../config/environment');var controller=require(_0xc061('0x9'));router['get']('/',auth[_0xc061('0xa')](),controller[_0xc061('0xb')]);router[_0xc061('0xc')](_0xc061('0xd'),auth[_0xc061('0xa')](),controller[_0xc061('0xe')]);router[_0xc061('0xc')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller['show']);router['get']('/:id/users',auth[_0xc061('0xa')](),controller[_0xc061('0x10')]);router[_0xc061('0xc')](_0xc061('0x11'),auth['isAuthenticated'](),controller[_0xc061('0x12')]);router[_0xc061('0x13')]('/',auth[_0xc061('0xa')](),controller[_0xc061('0x14')]);router['post']('/:id/users',auth[_0xc061('0xa')](),controller[_0xc061('0x15')]);router[_0xc061('0x13')](_0xc061('0x11'),auth[_0xc061('0xa')](),controller[_0xc061('0x16')]);router[_0xc061('0x17')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller[_0xc061('0x18')]);router[_0xc061('0x19')](_0xc061('0xf'),auth[_0xc061('0xa')](),controller[_0xc061('0x1a')]);router['delete'](_0xc061('0x1b'),auth[_0xc061('0xa')](),controller[_0xc061('0x1c')]);router[_0xc061('0x19')](_0xc061('0x11'),auth[_0xc061('0xa')](),controller[_0xc061('0x1d')]);module[_0xc061('0x1e')]=router; \ No newline at end of file +var _0x8758=['addTeams','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','getAgents','/:id/teams','getTeams','create','post','/:id/users','addAgents'];(function(_0x49d379,_0x2f60b9){var _0x38521c=function(_0x4a40e1){while(--_0x4a40e1){_0x49d379['push'](_0x49d379['shift']());}};_0x38521c(++_0x2f60b9);}(_0x8758,0x1b8));var _0x8875=function(_0xbe8a8f,_0x2660f0){_0xbe8a8f=_0xbe8a8f-0x0;var _0x269693=_0x8758[_0xbe8a8f];return _0x269693;};'use strict';var multer=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var path=require('path');var timeout=require(_0x8875('0x2'));var express=require(_0x8875('0x3'));var router=express[_0x8875('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8875('0x5'));var interaction=require(_0x8875('0x6'));var config=require(_0x8875('0x7'));var controller=require(_0x8875('0x8'));router[_0x8875('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8875('0x9')]('/describe',auth[_0x8875('0xa')](),controller[_0x8875('0xb')]);router['get'](_0x8875('0xc'),auth[_0x8875('0xa')](),controller['show']);router[_0x8875('0x9')]('/:id/users',auth[_0x8875('0xa')](),controller[_0x8875('0xd')]);router[_0x8875('0x9')](_0x8875('0xe'),auth['isAuthenticated'](),controller[_0x8875('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8875('0x10')]);router[_0x8875('0x11')](_0x8875('0x12'),auth[_0x8875('0xa')](),controller[_0x8875('0x13')]);router['post'](_0x8875('0xe'),auth['isAuthenticated'](),controller[_0x8875('0x14')]);router['put'](_0x8875('0xc'),auth[_0x8875('0xa')](),controller['update']);router[_0x8875('0x15')](_0x8875('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x8875('0x15')](_0x8875('0x12'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x8875('0x15')]('/:id/teams',auth[_0x8875('0xa')](),controller['removeTeams']);module[_0x8875('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c534ce3..3e6b2bf 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 _0x6c84=['exports','name','VIRTUAL','STRING','INTEGER'];(function(_0xcfc09d,_0x4e4b24){var _0x7263b=function(_0x172870){while(--_0x172870){_0xcfc09d['push'](_0xcfc09d['shift']());}};_0x7263b(++_0x4e4b24);}(_0x6c84,0x1ea));var _0x46c8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x6c84[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require('sequelize');module[_0x46c8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x46c8('0x1')},'prefix':{'type':Sequelize[_0x46c8('0x2')],'get':function(_0x197318){return'system-'+this['getDataValue'](_0x46c8('0x1'))+'-';}},'description':{'type':Sequelize[_0x46c8('0x3')]},'callerIdAll':{'type':Sequelize[_0x46c8('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0x46c8('0x4')]}}; \ No newline at end of file +var _0x68da=['name','INTEGER','exports','STRING','VIRTUAL','system-'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x68da,0xda));var _0xa68d=function(_0x386306,_0x1363c9){_0x386306=_0x386306-0x0;var _0xcb23d=_0x68da[_0x386306];return _0xcb23d;};'use strict';var Sequelize=require('sequelize');module[_0xa68d('0x0')]={'name':{'type':Sequelize[_0xa68d('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xa68d('0x2')],'get':function(_0x173d53){return _0xa68d('0x3')+this['getDataValue'](_0xa68d('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xa68d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xa68d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index bdcfc0b..d0cc4be 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 _0x14a0=['mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','describe','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','create','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','charAt','system-','transaction','addAgents','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','pick','getTeams','addTeams','findAll','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','Team','select','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5dfc44,_0x26b907){var _0x634467=function(_0x3883e0){while(--_0x3883e0){_0x5dfc44['push'](_0x5dfc44['shift']());}};_0x634467(++_0x26b907);}(_0x14a0,0x8e));var _0x014a=function(_0x4fec53,_0x2b4c25){_0x4fec53=_0x4fec53-0x0;var _0x5d7124=_0x14a0[_0x4fec53];return _0x5d7124;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];config[_0x014a('0x14')]=_[_0x014a('0x15')](config[_0x014a('0x14')],{'host':_0x014a('0x16'),'port':0x18eb});var socket=require(_0x014a('0x17'))(new Redis(config[_0x014a('0x14')]));require(_0x014a('0x18'))[_0x014a('0x19')](socket);function respondWithStatusCode(_0x3c54c8,_0x4fe87c){_0x4fe87c=_0x4fe87c||0xcc;return function(_0x130d13){if(_0x130d13){return _0x3c54c8[_0x014a('0x1a')](_0x4fe87c);}return _0x3c54c8['status'](_0x4fe87c)[_0x014a('0x1b')]();};}function respondWithResult(_0x128c46,_0x59a4ea){_0x59a4ea=_0x59a4ea||0xc8;return function(_0x16e6fc){if(_0x16e6fc){return _0x128c46[_0x014a('0x1c')](_0x59a4ea)[_0x014a('0x1d')](_0x16e6fc);}};}function respondWithFilteredResult(_0x12da95,_0x2c26ac){return function(_0x12d339){if(_0x12d339){var _0x61ec9f=typeof _0x2c26ac[_0x014a('0x1e')]===_0x014a('0x1f')&&typeof _0x2c26ac[_0x014a('0x20')]===_0x014a('0x1f');var _0x89e132=_0x12d339[_0x014a('0x21')];var _0x34e5c3=_0x61ec9f?0x0:_0x2c26ac['offset'];var _0x359903=_0x61ec9f?_0x12d339[_0x014a('0x21')]:_0x2c26ac[_0x014a('0x1e')]+_0x2c26ac[_0x014a('0x20')];var _0xc9a563;if(_0x359903>=_0x89e132){_0x359903=_0x89e132;_0xc9a563=0xc8;}else{_0xc9a563=0xce;}_0x12da95[_0x014a('0x1c')](_0xc9a563);return _0x12da95[_0x014a('0x22')](_0x014a('0x23'),_0x34e5c3+'-'+_0x359903+'/'+_0x89e132)[_0x014a('0x1d')](_0x12d339);}return null;};}function patchUpdates(_0x486e66){return function(_0x3679ed){try{jsonpatch['apply'](_0x3679ed,_0x486e66,!![]);}catch(_0x1a1318){return BPromise[_0x014a('0x24')](_0x1a1318);}return _0x3679ed[_0x014a('0x25')]();};}function saveUpdates(_0x36d52b,_0x2b3c10){return function(_0x113b12){if(_0x113b12){return _0x113b12[_0x014a('0x26')](_0x36d52b)[_0x014a('0x27')](function(_0x165a42){return _0x165a42;});}return null;};}function removeEntity(_0x4c2627,_0x3b4b92){return function(_0x5358e9){if(_0x5358e9){return _0x5358e9[_0x014a('0x28')]()[_0x014a('0x27')](function(){var _0x4f1c44=_0x5358e9['get']({'plain':!![]});var _0x9a901f=_0x014a('0x29');return db[_0x014a('0x2a')]['destroy']({'where':{'type':_0x9a901f,'resourceId':_0x4f1c44['id']}})[_0x014a('0x27')](function(){return _0x5358e9;});})[_0x014a('0x27')](function(){_0x4c2627['status'](0xcc)[_0x014a('0x1b')]();});}};}function handleEntityNotFound(_0x2560a6,_0x496040){return function(_0x4f9c1c){if(!_0x4f9c1c){_0x2560a6[_0x014a('0x1a')](0x194);}return _0x4f9c1c;};}function handleError(_0x3e5a0a,_0xe70dfa){_0xe70dfa=_0xe70dfa||0x1f4;return function(_0x29fce5){logger['error'](_0x29fce5[_0x014a('0x2b')]);if(_0x29fce5[_0x014a('0x2c')]){delete _0x29fce5[_0x014a('0x2c')];}_0x3e5a0a[_0x014a('0x1c')](_0xe70dfa)[_0x014a('0x2d')](_0x29fce5);};}exports[_0x014a('0x2e')]=function(_0x354f4c,_0x1dae8e){var _0xc802d5={},_0x3c8755={},_0x9dfb11={'count':0x0,'rows':[]};var _0x4ed54e=_[_0x014a('0x2f')](db[_0x014a('0x30')][_0x014a('0x31')],function(_0x457883){return{'name':_0x457883[_0x014a('0x32')],'type':_0x457883[_0x014a('0x33')][_0x014a('0x34')]};});_0x3c8755['model']=_[_0x014a('0x2f')](_0x4ed54e,_0x014a('0x2c'));_0x3c8755['query']=_[_0x014a('0x35')](_0x354f4c[_0x014a('0x36')]);_0x3c8755[_0x014a('0x37')]=_[_0x014a('0x38')](_0x3c8755[_0x014a('0x39')],_0x3c8755[_0x014a('0x36')]);_0xc802d5[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x3c8755['model'],qs[_0x014a('0x3b')](_0x354f4c[_0x014a('0x36')][_0x014a('0x3b')]));_0xc802d5[_0x014a('0x3a')]=_0xc802d5['attributes'][_0x014a('0x3c')]?_0xc802d5[_0x014a('0x3a')]:_0x3c8755[_0x014a('0x39')];if(!_0x354f4c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xc802d5[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x354f4c[_0x014a('0x36')]['limit']);_0xc802d5[_0x014a('0x1e')]=qs['offset'](_0x354f4c[_0x014a('0x36')][_0x014a('0x1e')]);}_0xc802d5[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x354f4c[_0x014a('0x36')]['sort']);_0xc802d5[_0x014a('0x41')]=qs[_0x014a('0x37')](_['pick'](_0x354f4c[_0x014a('0x36')],_0x3c8755[_0x014a('0x37')]),_0x4ed54e);if(_0x354f4c[_0x014a('0x36')][_0x014a('0x42')]){_0xc802d5[_0x014a('0x41')]=_[_0x014a('0x43')](_0xc802d5[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x4ed54e,function(_0x2beddc){if(_0x2beddc['type']!==_0x014a('0x44')){var _0x3baf40={};_0x3baf40[_0x2beddc[_0x014a('0x2c')]]={'$like':'%'+_0x354f4c[_0x014a('0x36')]['filter']+'%'};return _0x3baf40;}})});}_0xc802d5=_[_0x014a('0x43')]({},_0xc802d5,_0x354f4c[_0x014a('0x45')]);var _0x4cd132={'where':_0xc802d5[_0x014a('0x41')]};return db[_0x014a('0x30')][_0x014a('0x21')](_0x4cd132)['then'](function(_0x361866){_0x9dfb11[_0x014a('0x21')]=_0x361866;if(_0x354f4c['query'][_0x014a('0x46')]){_0xc802d5[_0x014a('0x47')]=[{'all':!![]}];}return db[_0x014a('0x30')]['findAll'](_0xc802d5);})[_0x014a('0x27')](function(_0x50a8f0){_0x9dfb11['rows']=_0x50a8f0;return _0x9dfb11;})[_0x014a('0x27')](respondWithFilteredResult(_0x1dae8e,_0xc802d5))[_0x014a('0x48')](handleError(_0x1dae8e,null));};exports['show']=function(_0x1557ad,_0x11c0d5){var _0xa4b68e={'raw':![],'where':{'id':_0x1557ad[_0x014a('0x49')]['id']}},_0x15c5dc={};_0x15c5dc[_0x014a('0x39')]=_['keys'](db[_0x014a('0x30')][_0x014a('0x31')]);_0x15c5dc[_0x014a('0x36')]=_['keys'](_0x1557ad['query']);_0x15c5dc[_0x014a('0x37')]=_['intersection'](_0x15c5dc['model'],_0x15c5dc[_0x014a('0x36')]);_0xa4b68e['attributes']=_[_0x014a('0x38')](_0x15c5dc[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x1557ad['query'][_0x014a('0x3b')]));_0xa4b68e[_0x014a('0x3a')]=_0xa4b68e[_0x014a('0x3a')][_0x014a('0x3c')]?_0xa4b68e[_0x014a('0x3a')]:_0x15c5dc[_0x014a('0x39')];if(_0x1557ad['query'][_0x014a('0x46')]){_0xa4b68e[_0x014a('0x47')]=[{'all':!![]}];}_0xa4b68e=_['merge']({},_0xa4b68e,_0x1557ad[_0x014a('0x45')]);return db[_0x014a('0x30')][_0x014a('0x4a')](_0xa4b68e)[_0x014a('0x27')](handleEntityNotFound(_0x11c0d5,null))[_0x014a('0x27')](respondWithResult(_0x11c0d5,null))[_0x014a('0x48')](handleError(_0x11c0d5,null));};exports[_0x014a('0x28')]=function(_0x21680f,_0x4aa72b){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x21680f[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x4aa72b,null))[_0x014a('0x27')](removeEntity(_0x4aa72b,null))['catch'](handleError(_0x4aa72b,null));};exports[_0x014a('0x4b')]=function(_0x5bee56,_0x2da804){return db[_0x014a('0x30')][_0x014a('0x4b')]()[_0x014a('0x27')](respondWithResult(_0x2da804,null))[_0x014a('0x48')](handleError(_0x2da804,null));};exports['create']=function(_0x51e1de,_0x4bb0b2){var _0x58905d;return db[_0x014a('0x4c')]['transaction'](function(_0x1fe253){return db['VoicePrefix']['create'](_0x51e1de[_0x014a('0x4d')],{'transaction':_0x1fe253})['then'](function(_0x1c640b){_0x58905d=_0x1c640b[_0x014a('0x4e')]({'plain':!![]});return db[_0x014a('0x4f')][_0x014a('0x4a')]({'where':{'id':_0x58905d[_0x014a('0x50')]},'raw':!![]})[_0x014a('0x27')](function(_0x35a421){return createVoicePrefixExtensions(_0x58905d,_0x35a421,_0x1fe253);});});})[_0x014a('0x27')](function(){var _0x133fcd=_0x51e1de[_0x014a('0x51')]['get']({'plain':!![]});if(!_0x133fcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133fcd[_0x014a('0x52')]===_0x014a('0x51')){var _0x237345=_0x58905d;return db['UserProfileSection']['find']({'where':{'name':_0x014a('0x29'),'userProfileId':_0x133fcd['userProfileId']},'raw':!![]})[_0x014a('0x27')](function(_0x3f6177){if(_0x3f6177&&_0x3f6177[_0x014a('0x53')]===0x0){return db[_0x014a('0x2a')]['create']({'name':_0x237345[_0x014a('0x2c')],'resourceId':_0x237345['id'],'type':_0x3f6177[_0x014a('0x2c')],'sectionId':_0x3f6177['id']},{})[_0x014a('0x27')](function(){return _0x58905d;});}else{return _0x58905d;}})['catch'](function(_0xbaeb5f){logger['error'](_0x014a('0x54'),_0xbaeb5f);throw _0xbaeb5f;});}return _0x58905d;})[_0x014a('0x27')](respondWithResult(_0x4bb0b2,null))[_0x014a('0x48')](handleError(_0x4bb0b2,null));};function Extension(_0x24d433,_0xd0334a,_0x1a308b,_0x4e9260){this[_0x014a('0x55')]=_0x014a('0x56');this[_0x014a('0x57')]=_0x24d433;this['app']=_0x1a308b;this[_0x014a('0x33')]=_0x014a('0x58');this[_0x014a('0x59')]=_0x014a('0x5a');this[_0x014a('0x5b')]=_0xd0334a;this['appdata']=_0x4e9260;}function createVoicePrefixExtensions(_0x8ac9cd,_0x46168d,_0x63c341){return new BPromise(function(_0x37a7b8,_0x3ca7e6){var _0x37b4a5=new Extension(formatPrefixName(_0x8ac9cd[_0x014a('0x5c')]),0x1,_0x014a('0x5d'),_0x014a('0x5e'));_0x37b4a5[_0x014a('0x5f')]=_0x8ac9cd['id'];return db[_0x014a('0x4f')][_0x014a('0x60')](_0x37b4a5,{'transaction':_0x63c341})['then'](function(_0x2ac66a){var _0x5ac216=_0x2ac66a['get']({'plain':!![]});var _0x5c9c47=_['map'](addVoicePrefixExtensions(_0x8ac9cd,_0x46168d),function(_0x5a38b4){_0x5a38b4[_0x014a('0x50')]=_0x5ac216['id'];_0x5a38b4[_0x014a('0x5f')]=_0x8ac9cd['id'];return _0x5a38b4;});return db[_0x014a('0x4f')]['bulkCreate'](_0x5c9c47,{'transaction':_0x63c341})[_0x014a('0x27')](function(_0x2a5007){if(!_0x2a5007){return _0x3ca7e6(_0x014a('0x61'));}else{return _0x37a7b8(_0x2a5007);}})[_0x014a('0x48')](function(_0x4dd210){return _0x3ca7e6(_0x4dd210);});});;});};function addVoicePrefixExtensions(_0x5edf80,_0xd3ab26){var _0x39154c=[];var _0x411948=formatPrefixName(_0x5edf80[_0x014a('0x5c')]);_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x2,_0x014a('0x63'),_0x014a('0x64')+_0x5edf80[_0x014a('0x2c')]));if(_0x5edf80[_0x014a('0x65')]){_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,_0x014a('0x63'),'PREFIX-CALLERIDALL='+_0x5edf80[_0x014a('0x65')]));}else{_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x3,'NoOp',_0x014a('0x66')));}_0x39154c[_0x014a('0x62')](new Extension(_0x411948,0x4,'goto',_0xd3ab26[_0x014a('0x55')]+','+'${EXTEN:'+(0x8+_0x5edf80[_0x014a('0x2c')][_0x014a('0x3c')])+'}'+','+0x1));return _0x39154c;}function formatPrefixName(_0xcdcbbb){var _0x456d69='_';for(var _0x37b8f=0x0;_0x37b8f<_0xcdcbbb['length'];_0x37b8f++){if(_0xcdcbbb[_0x014a('0x67')](_0x37b8f)=='-'){_0x456d69+=_0xcdcbbb[_0x014a('0x67')](_0x37b8f);}else{_0x456d69+='['+_0xcdcbbb[_0x014a('0x67')](_0x37b8f)+']';}}_0x456d69+='.';return _0x456d69;}exports[_0x014a('0x26')]=function(_0xbad5ef,_0x52e79e,_0x20cddc){var _0x188e65=_0xbad5ef[_0x014a('0x4d')];_0x188e65['prefix']=_0x014a('0x68')+_0x188e65['name']+'-';return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x267026){return db[_0x014a('0x30')][_0x014a('0x26')](_0x188e65,{'where':{'id':_0x188e65['id']},'transaction':_0x267026})[_0x014a('0x27')](function(){return db[_0x014a('0x4f')]['destroy']({'where':{'VoicePrefixId':_0x188e65['id']},'transaction':_0x267026})['then'](function(){return db[_0x014a('0x4f')]['find']({'where':{'id':_0x188e65[_0x014a('0x50')]},'raw':!![]})['then'](function(_0x1dcfc6){return createVoicePrefixExtensions(_0x188e65,_0x1dcfc6,_0x267026);});});});})[_0x014a('0x27')](function(){return db['VoicePrefix']['findById'](_0x188e65['id']);})[_0x014a('0x27')](respondWithResult(_0x52e79e,null))[_0x014a('0x48')](handleError(_0x52e79e,null));};exports['addAgents']=function(_0x882fc9,_0x42e4e9,_0x5635fc){return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x882fc9[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x42e4e9,null))[_0x014a('0x27')](function(_0x37ea2d){if(_0x37ea2d){return _0x37ea2d[_0x014a('0x6a')](_0x882fc9['body'][_0x014a('0x6b')],_['omit'](_0x882fc9['body'],[_0x014a('0x6b'),'id'])||{})[_0x014a('0x6c')](function(_0x523859){for(var _0x27e363=0x0;_0x27e363<_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x014a('0x3c')];_0x27e363+=0x1){socket[_0x014a('0x6d')]('userVoicePrefix:save',{'UserId':Number(_0x882fc9[_0x014a('0x4d')][_0x014a('0x6b')][_0x27e363]),'VoicePrefixId':Number(_0x882fc9[_0x014a('0x49')]['id'])});}return _0x523859;});}})[_0x014a('0x27')](respondWithResult(_0x42e4e9,null))['catch'](handleError(_0x42e4e9,null));};exports[_0x014a('0x6e')]=function(_0x4c568c,_0x469bb0,_0x3807c4){return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x4c568c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x469bb0,null))['then'](function(_0x389bfb){if(_0x389bfb){return _0x389bfb[_0x014a('0x6e')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])[_0x014a('0x27')](function(){if(_[_0x014a('0x6f')](_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')])){for(var _0x55cfe7=0x0;_0x55cfe7<_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x014a('0x3c')];_0x55cfe7+=0x1){socket['emit'](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')][_0x014a('0x6b')][_0x55cfe7]),'VoicePrefixId':Number(_0x4c568c[_0x014a('0x49')]['id'])});}}else{socket[_0x014a('0x6d')](_0x014a('0x70'),{'UserId':Number(_0x4c568c[_0x014a('0x36')]['ids']),'VoicePrefixId':Number(_0x4c568c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x469bb0,null))['catch'](handleError(_0x469bb0,null));};exports[_0x014a('0x71')]=function(_0x32683c,_0x1810a8,_0x3804e1){var _0xe1b5ed={};var _0x7cd599={};var _0x1ba571;var _0x4e5d25;return db[_0x014a('0x30')][_0x014a('0x72')]({'where':{'id':_0x32683c[_0x014a('0x49')]['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x1810a8,null))['then'](function(_0x55d5f1){if(_0x55d5f1){_0x1ba571=_0x55d5f1;_0x7cd599[_0x014a('0x39')]=_[_0x014a('0x35')](db['User']['rawAttributes']);_0x7cd599[_0x014a('0x36')]=_['keys'](_0x32683c['query']);_0x7cd599[_0x014a('0x37')]=_[_0x014a('0x38')](_0x7cd599['model'],_0x7cd599[_0x014a('0x36')]);_0xe1b5ed[_0x014a('0x3a')]=_[_0x014a('0x38')](_0x7cd599[_0x014a('0x39')],qs[_0x014a('0x3b')](_0x32683c[_0x014a('0x36')][_0x014a('0x3b')]));_0xe1b5ed[_0x014a('0x3a')]=_0xe1b5ed['attributes']['length']?_0xe1b5ed[_0x014a('0x3a')]:_0x7cd599['model'];_0xe1b5ed['order']=qs['sort'](_0x32683c[_0x014a('0x36')][_0x014a('0x40')]);_0xe1b5ed[_0x014a('0x41')]=qs['filters'](_[_0x014a('0x73')](_0x32683c[_0x014a('0x36')],_0x7cd599[_0x014a('0x37')]));if(_0x32683c[_0x014a('0x36')]['filter']){_0xe1b5ed[_0x014a('0x41')]=_[_0x014a('0x43')](_0xe1b5ed[_0x014a('0x41')],{'$or':_['map'](_0xe1b5ed[_0x014a('0x3a')],function(_0x52a3a8){var _0x59871d={};_0x59871d[_0x52a3a8]={'$like':'%'+_0x32683c[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x59871d;})});}_0xe1b5ed=_[_0x014a('0x43')]({},_0xe1b5ed,_0x32683c['options']);return _0x1ba571[_0x014a('0x71')](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x53c335){if(_0x53c335){_0x4e5d25=_0x53c335[_0x014a('0x3c')];if(!_0x32683c[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0xe1b5ed[_0x014a('0x20')]=qs[_0x014a('0x20')](_0x32683c[_0x014a('0x36')][_0x014a('0x20')]);_0xe1b5ed['offset']=qs[_0x014a('0x1e')](_0x32683c[_0x014a('0x36')]['offset']);}return _0x1ba571['getAgents'](_0xe1b5ed);}})[_0x014a('0x27')](function(_0x45a093){if(_0x45a093){return _0x45a093?{'count':_0x4e5d25,'rows':_0x45a093}:null;}})['then'](respondWithResult(_0x1810a8,null))[_0x014a('0x48')](handleError(_0x1810a8,null));};exports[_0x014a('0x74')]=function(_0x216b27,_0x5ddb47,_0x3a0012){var _0x2c320f={};var _0x5dedaf={};var _0x5baf80;var _0x105786;return db['VoicePrefix'][_0x014a('0x72')]({'where':{'id':_0x216b27['params']['id']}})[_0x014a('0x27')](handleEntityNotFound(_0x5ddb47,null))[_0x014a('0x27')](function(_0xda07b5){if(_0xda07b5){_0x5baf80=_0xda07b5;_0x5dedaf[_0x014a('0x39')]=_[_0x014a('0x35')](db['Team'][_0x014a('0x31')]);_0x5dedaf[_0x014a('0x36')]=_[_0x014a('0x35')](_0x216b27[_0x014a('0x36')]);_0x5dedaf[_0x014a('0x37')]=_[_0x014a('0x38')](_0x5dedaf[_0x014a('0x39')],_0x5dedaf[_0x014a('0x36')]);_0x2c320f['attributes']=_[_0x014a('0x38')](_0x5dedaf['model'],qs[_0x014a('0x3b')](_0x216b27['query']['fields']));_0x2c320f['attributes']=_0x2c320f['attributes'][_0x014a('0x3c')]?_0x2c320f[_0x014a('0x3a')]:_0x5dedaf[_0x014a('0x39')];_0x2c320f[_0x014a('0x3f')]=qs[_0x014a('0x40')](_0x216b27[_0x014a('0x36')][_0x014a('0x40')]);_0x2c320f[_0x014a('0x41')]=qs['filters'](_['pick'](_0x216b27[_0x014a('0x36')],_0x5dedaf[_0x014a('0x37')]));if(_0x216b27[_0x014a('0x36')][_0x014a('0x42')]){_0x2c320f[_0x014a('0x41')]=_[_0x014a('0x43')](_0x2c320f[_0x014a('0x41')],{'$or':_[_0x014a('0x2f')](_0x2c320f['attributes'],function(_0x27431c){var _0x3cfcc7={};_0x3cfcc7[_0x27431c]={'$like':'%'+_0x216b27[_0x014a('0x36')][_0x014a('0x42')]+'%'};return _0x3cfcc7;})});}_0x2c320f=_[_0x014a('0x43')]({},_0x2c320f,_0x216b27['options']);return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x2b9496){if(_0x2b9496){_0x105786=_0x2b9496[_0x014a('0x3c')];if(!_0x216b27[_0x014a('0x36')][_0x014a('0x3d')](_0x014a('0x3e'))){_0x2c320f['limit']=qs[_0x014a('0x20')](_0x216b27['query']['limit']);_0x2c320f[_0x014a('0x1e')]=qs[_0x014a('0x1e')](_0x216b27['query'][_0x014a('0x1e')]);}return _0x5baf80[_0x014a('0x74')](_0x2c320f);}})[_0x014a('0x27')](function(_0x5e116d){if(_0x5e116d){return _0x5e116d?{'count':_0x105786,'rows':_0x5e116d}:null;}})[_0x014a('0x27')](respondWithResult(_0x5ddb47,null))[_0x014a('0x48')](handleError(_0x5ddb47,null));};exports[_0x014a('0x75')]=function(_0x336bcf,_0x2f7969,_0x263212){var _0x13c2b2=_0x336bcf[_0x014a('0x4d')][_0x014a('0x6b')];var _0x58341b;return db['Team'][_0x014a('0x76')]({'where':{'id':_0x13c2b2},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id','name',_0x014a('0x79'),_0x014a('0x7a'),_0x014a('0x7b')],'raw':!![]}]})[_0x014a('0x27')](function(_0x49997){if(_0x49997){_0x58341b=_0x49997;var _0x2888a0=_['flatMap'](_0x49997,function(_0x1c8cba){var _0x3ab005=_0x1c8cba[_0x014a('0x4e')]({'plain':!![]});return _0x3ab005[_0x014a('0x78')];});return db['VoicePrefix'][_0x014a('0x4a')]({'where':{'id':_0x336bcf[_0x014a('0x49')]['id']}})[_0x014a('0x27')](function(_0x30999a){return db[_0x014a('0x4c')]['transaction'](function(_0xcf0aee){return _0x30999a['addTeams'](_0x13c2b2,{'transaction':_0xcf0aee})['then'](function(){return BPromise[_0x014a('0x7c')](_0x58341b,function(_0x369fbd){return db[_0x014a('0x7d')][_0x014a('0x7e')]({'TeamId':_0x369fbd['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},{'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){return BPromise[_0x014a('0x7c')](_0x2888a0,function(_0x3a9352){return db[_0x014a('0x7f')][_0x014a('0x80')]({'where':{'UserId':_0x3a9352['id'],'VoicePrefixId':_0x336bcf[_0x014a('0x49')]['id']},'transaction':_0xcf0aee});});})[_0x014a('0x27')](function(){_0x2888a0[_0x014a('0x81')](function(_0x175c12){socket[_0x014a('0x6d')](_0x014a('0x82'),{'UserId':_0x175c12['id'],'VoicePrefixId':_0x30999a['id']});});});});});}})['then'](respondWithStatusCode(_0x2f7969,null))[_0x014a('0x48')](handleError(_0x2f7969,null));};exports[_0x014a('0x83')]=function(_0x3c03ac,_0x4ab9d6,_0x4495c1){return db[_0x014a('0x84')][_0x014a('0x76')]({'where':{'id':_0x3c03ac[_0x014a('0x36')][_0x014a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x014a('0x77')],'as':_0x014a('0x78'),'attributes':['id'],'raw':!![]}]})[_0x014a('0x27')](handleEntityNotFound(_0x4ab9d6,null))[_0x014a('0x27')](function(_0x480639){var _0x346734=_[_0x014a('0x2f')](_0x480639,'id');var _0x1b1e6a=[];var _0x11aab3=[];var _0x4f91f1=squel[_0x014a('0x85')]();_0x4f91f1['field']('tq.TeamId')[_0x014a('0x86')]('team_has_voice_prefixes','tq')[_0x014a('0x87')](_0x014a('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x014a('0x41')]('VoicePrefixId\x20=\x20?',_0x3c03ac[_0x014a('0x49')]['id']);for(var _0x8cc35d=0x0;_0x8cc35d<_0x480639['length'];_0x8cc35d+=0x1){let _0x183bf6=_0x480639[_0x8cc35d];for(var _0x1b1c4e=0x0;_0x1b1c4e<_0x183bf6['Agents'][_0x014a('0x3c')];_0x1b1c4e+=0x1){let _0x3f5c3e=_0x183bf6[_0x014a('0x78')][_0x1b1c4e];var _0x383c07=_0x4f91f1[_0x014a('0x89')]();_0x383c07[_0x014a('0x41')](_0x014a('0x8a'),_0x3f5c3e['id']);_0x11aab3[_0x014a('0x62')](db[_0x014a('0x4c')][_0x014a('0x36')](_0x383c07[_0x014a('0x8b')](),{'type':db[_0x014a('0x4c')]['QueryTypes'][_0x014a('0x8c')]})[_0x014a('0x27')](function(_0x3d8d34){if(_0x3d8d34[_0x014a('0x3c')]===0x1){return _0x3f5c3e['id'];}else{var _0x3cf20e=_[_0x014a('0x8d')](_[_0x014a('0x2f')](_0x3d8d34,_0x014a('0x8e')),function(_0x5a7fd0){return _[_0x014a('0x8f')](_0x346734,_0x5a7fd0);});if(_0x3cf20e){return _0x3f5c3e['id'];}}}));}}return BPromise[_0x014a('0x90')](_0x11aab3)[_0x014a('0x27')](function(_0x29d217){_0x1b1e6a=_(_0x1b1e6a)[_0x014a('0x91')](_0x29d217)[_0x014a('0x92')]()['value']();return db[_0x014a('0x30')][_0x014a('0x4a')]({'where':{'id':_0x3c03ac[_0x014a('0x49')]['id']}})['then'](function(_0x4e6844){return db[_0x014a('0x4c')][_0x014a('0x69')](function(_0x262513){return _0x4e6844[_0x014a('0x83')](_0x3c03ac[_0x014a('0x36')]['ids'],{'transaction':_0x262513})[_0x014a('0x27')](function(){if(!_[_0x014a('0x93')](_0x1b1e6a)){return _0x4e6844[_0x014a('0x6e')](_0x1b1e6a,{'transaction':_0x262513});}})[_0x014a('0x27')](function(){_0x1b1e6a[_0x014a('0x81')](function(_0x87c7e5){socket['emit'](_0x014a('0x70'),{'UserId':_0x87c7e5,'VoicePrefixId':_0x4e6844['id']});});});});});});})['then'](respondWithStatusCode(_0x4ab9d6,null))[_0x014a('0x48')](handleError(_0x4ab9d6,null));}; \ No newline at end of file +var _0xfcbb=['apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','query','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','transaction','VoiceExtension','role','user','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','sequelize','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','sort','getTeams','Team','addTeams','User','Agents','online','upsert','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x3c9564,_0x4f5320){var _0x426751=function(_0x4c040b){while(--_0x4c040b){_0x3c9564['push'](_0x3c9564['shift']());}};_0x426751(++_0x4f5320);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x24f8d0,_0x33064a){_0x24f8d0=_0x24f8d0-0x0;var _0x5a1a19=_0xfcbb[_0x24f8d0];return _0x5a1a19;};'use strict';var emlformat=require(_0xbfcb('0x0'));var rimraf=require(_0xbfcb('0x1'));var zipdir=require(_0xbfcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfcb('0x3'));var BPromise=require(_0xbfcb('0x4'));var Mustache=require(_0xbfcb('0x5'));var util=require(_0xbfcb('0x6'));var path=require(_0xbfcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfcb('0x8'));var fs=require('fs');var fs_extra=require(_0xbfcb('0x9'));var _=require(_0xbfcb('0xa'));var squel=require(_0xbfcb('0xb'));var crypto=require(_0xbfcb('0xc'));var jsforce=require(_0xbfcb('0xd'));var deskjs=require(_0xbfcb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfcb('0xf'));var Papa=require(_0xbfcb('0x10'));var Redis=require(_0xbfcb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfcb('0x12'));var as=require(_0xbfcb('0x13'));var hardwareService=require(_0xbfcb('0x14'));var logger=require(_0xbfcb('0x15'))(_0xbfcb('0x16'));var utils=require(_0xbfcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbfcb('0x18'));var db=require(_0xbfcb('0x19'))['db'];config[_0xbfcb('0x1a')]=_[_0xbfcb('0x1b')](config['redis'],{'host':_0xbfcb('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfcb('0x1a')]));require(_0xbfcb('0x1d'))[_0xbfcb('0x1e')](socket);function respondWithStatusCode(_0x1047c4,_0x2074d4){_0x2074d4=_0x2074d4||0xcc;return function(_0xe47707){if(_0xe47707){return _0x1047c4[_0xbfcb('0x1f')](_0x2074d4);}return _0x1047c4[_0xbfcb('0x20')](_0x2074d4)[_0xbfcb('0x21')]();};}function respondWithResult(_0x339347,_0x2c4a85){_0x2c4a85=_0x2c4a85||0xc8;return function(_0x3f847f){if(_0x3f847f){return _0x339347[_0xbfcb('0x20')](_0x2c4a85)[_0xbfcb('0x22')](_0x3f847f);}};}function respondWithFilteredResult(_0x318d07,_0x1a4d75){return function(_0xba1d6){if(_0xba1d6){var _0x38689e=typeof _0x1a4d75[_0xbfcb('0x23')]===_0xbfcb('0x24')&&typeof _0x1a4d75[_0xbfcb('0x25')]===_0xbfcb('0x24');var _0x53c9e0=_0xba1d6[_0xbfcb('0x26')];var _0x37263b=_0x38689e?0x0:_0x1a4d75['offset'];var _0xa3c089=_0x38689e?_0xba1d6[_0xbfcb('0x26')]:_0x1a4d75['offset']+_0x1a4d75['limit'];var _0x4199c5;if(_0xa3c089>=_0x53c9e0){_0xa3c089=_0x53c9e0;_0x4199c5=0xc8;}else{_0x4199c5=0xce;}_0x318d07[_0xbfcb('0x20')](_0x4199c5);return _0x318d07[_0xbfcb('0x27')](_0xbfcb('0x28'),_0x37263b+'-'+_0xa3c089+'/'+_0x53c9e0)[_0xbfcb('0x22')](_0xba1d6);}return null;};}function patchUpdates(_0x56c158){return function(_0x365d6c){try{jsonpatch[_0xbfcb('0x29')](_0x365d6c,_0x56c158,!![]);}catch(_0x2d9288){return BPromise[_0xbfcb('0x2a')](_0x2d9288);}return _0x365d6c[_0xbfcb('0x2b')]();};}function saveUpdates(_0x19616c,_0x69c8e9){return function(_0x14e43c){if(_0x14e43c){return _0x14e43c[_0xbfcb('0x2c')](_0x19616c)[_0xbfcb('0x2d')](function(_0x1ca8c3){return _0x1ca8c3;});}return null;};}function removeEntity(_0xf6dbb7,_0x3ef71c){return function(_0x121a90){if(_0x121a90){return _0x121a90[_0xbfcb('0x2e')]()[_0xbfcb('0x2d')](function(){var _0x5cd703=_0x121a90[_0xbfcb('0x2f')]({'plain':!![]});var _0x2881f8='VoicePrefixes';return db[_0xbfcb('0x30')][_0xbfcb('0x2e')]({'where':{'type':_0x2881f8,'resourceId':_0x5cd703['id']}})[_0xbfcb('0x2d')](function(){return _0x121a90;});})[_0xbfcb('0x2d')](function(){_0xf6dbb7[_0xbfcb('0x20')](0xcc)[_0xbfcb('0x21')]();});}};}function handleEntityNotFound(_0x4069a7,_0x1a5db2){return function(_0x434764){if(!_0x434764){_0x4069a7[_0xbfcb('0x1f')](0x194);}return _0x434764;};}function handleError(_0x59719b,_0x17cd0e){_0x17cd0e=_0x17cd0e||0x1f4;return function(_0x3aa3cd){logger[_0xbfcb('0x31')](_0x3aa3cd[_0xbfcb('0x32')]);if(_0x3aa3cd[_0xbfcb('0x33')]){delete _0x3aa3cd[_0xbfcb('0x33')];}_0x59719b[_0xbfcb('0x20')](_0x17cd0e)[_0xbfcb('0x34')](_0x3aa3cd);};}exports[_0xbfcb('0x35')]=function(_0x5be764,_0x297f72){var _0xaa6ae6={},_0x625c4b={},_0x1cc3ad={'count':0x0,'rows':[]};var _0x5d02f7=_['map'](db[_0xbfcb('0x36')][_0xbfcb('0x37')],function(_0x1d523d){return{'name':_0x1d523d[_0xbfcb('0x38')],'type':_0x1d523d[_0xbfcb('0x39')][_0xbfcb('0x3a')]};});_0x625c4b[_0xbfcb('0x3b')]=_['map'](_0x5d02f7,'name');_0x625c4b['query']=_[_0xbfcb('0x3c')](_0x5be764['query']);_0x625c4b[_0xbfcb('0x3d')]=_[_0xbfcb('0x3e')](_0x625c4b['model'],_0x625c4b['query']);_0xaa6ae6[_0xbfcb('0x3f')]=_[_0xbfcb('0x3e')](_0x625c4b[_0xbfcb('0x3b')],qs[_0xbfcb('0x40')](_0x5be764['query'][_0xbfcb('0x40')]));_0xaa6ae6[_0xbfcb('0x3f')]=_0xaa6ae6['attributes']['length']?_0xaa6ae6[_0xbfcb('0x3f')]:_0x625c4b['model'];if(!_0x5be764['query'][_0xbfcb('0x41')](_0xbfcb('0x42'))){_0xaa6ae6[_0xbfcb('0x25')]=qs[_0xbfcb('0x25')](_0x5be764['query'][_0xbfcb('0x25')]);_0xaa6ae6[_0xbfcb('0x23')]=qs[_0xbfcb('0x23')](_0x5be764[_0xbfcb('0x43')][_0xbfcb('0x23')]);}_0xaa6ae6[_0xbfcb('0x44')]=qs['sort'](_0x5be764[_0xbfcb('0x43')]['sort']);_0xaa6ae6[_0xbfcb('0x45')]=qs['filters'](_[_0xbfcb('0x46')](_0x5be764[_0xbfcb('0x43')],_0x625c4b[_0xbfcb('0x3d')]),_0x5d02f7);if(_0x5be764[_0xbfcb('0x43')][_0xbfcb('0x47')]){_0xaa6ae6[_0xbfcb('0x45')]=_[_0xbfcb('0x48')](_0xaa6ae6[_0xbfcb('0x45')],{'$or':_[_0xbfcb('0x49')](_0x5d02f7,function(_0x91e12b){if(_0x91e12b['type']!==_0xbfcb('0x4a')){var _0x1d6ddd={};_0x1d6ddd[_0x91e12b['name']]={'$like':'%'+_0x5be764[_0xbfcb('0x43')][_0xbfcb('0x47')]+'%'};return _0x1d6ddd;}})});}_0xaa6ae6=_[_0xbfcb('0x48')]({},_0xaa6ae6,_0x5be764[_0xbfcb('0x4b')]);var _0x1f04b5={'where':_0xaa6ae6[_0xbfcb('0x45')]};return db['VoicePrefix'][_0xbfcb('0x26')](_0x1f04b5)[_0xbfcb('0x2d')](function(_0x10ea4f){_0x1cc3ad['count']=_0x10ea4f;if(_0x5be764[_0xbfcb('0x43')][_0xbfcb('0x4c')]){_0xaa6ae6[_0xbfcb('0x4d')]=[{'all':!![]}];}return db['VoicePrefix'][_0xbfcb('0x4e')](_0xaa6ae6);})[_0xbfcb('0x2d')](function(_0x58337d){_0x1cc3ad['rows']=_0x58337d;return _0x1cc3ad;})[_0xbfcb('0x2d')](respondWithFilteredResult(_0x297f72,_0xaa6ae6))[_0xbfcb('0x4f')](handleError(_0x297f72,null));};exports['show']=function(_0x3e9186,_0x31fd3f){var _0x58cfa2={'raw':![],'where':{'id':_0x3e9186[_0xbfcb('0x50')]['id']}},_0x3a9dfe={};_0x3a9dfe[_0xbfcb('0x3b')]=_[_0xbfcb('0x3c')](db[_0xbfcb('0x36')][_0xbfcb('0x37')]);_0x3a9dfe[_0xbfcb('0x43')]=_[_0xbfcb('0x3c')](_0x3e9186[_0xbfcb('0x43')]);_0x3a9dfe[_0xbfcb('0x3d')]=_[_0xbfcb('0x3e')](_0x3a9dfe[_0xbfcb('0x3b')],_0x3a9dfe['query']);_0x58cfa2[_0xbfcb('0x3f')]=_[_0xbfcb('0x3e')](_0x3a9dfe[_0xbfcb('0x3b')],qs['fields'](_0x3e9186[_0xbfcb('0x43')]['fields']));_0x58cfa2['attributes']=_0x58cfa2[_0xbfcb('0x3f')][_0xbfcb('0x51')]?_0x58cfa2[_0xbfcb('0x3f')]:_0x3a9dfe['model'];if(_0x3e9186[_0xbfcb('0x43')]['includeAll']){_0x58cfa2['include']=[{'all':!![]}];}_0x58cfa2=_[_0xbfcb('0x48')]({},_0x58cfa2,_0x3e9186['options']);return db[_0xbfcb('0x36')][_0xbfcb('0x52')](_0x58cfa2)['then'](handleEntityNotFound(_0x31fd3f,null))[_0xbfcb('0x2d')](respondWithResult(_0x31fd3f,null))['catch'](handleError(_0x31fd3f,null));};exports[_0xbfcb('0x2e')]=function(_0x4f348b,_0x61b146){return db['VoicePrefix'][_0xbfcb('0x52')]({'where':{'id':_0x4f348b[_0xbfcb('0x50')]['id']}})['then'](handleEntityNotFound(_0x61b146,null))[_0xbfcb('0x2d')](removeEntity(_0x61b146,null))['catch'](handleError(_0x61b146,null));};exports['describe']=function(_0x3b8683,_0x43e3e3){return db[_0xbfcb('0x36')]['describe']()['then'](respondWithResult(_0x43e3e3,null))[_0xbfcb('0x4f')](handleError(_0x43e3e3,null));};exports[_0xbfcb('0x53')]=function(_0x294e9e,_0x3d502e){var _0x3fb5ad;return db['sequelize'][_0xbfcb('0x54')](function(_0x37a7e8){return db[_0xbfcb('0x36')][_0xbfcb('0x53')](_0x294e9e['body'],{'transaction':_0x37a7e8})['then'](function(_0xbcb336){_0x3fb5ad=_0xbcb336['get']({'plain':!![]});return db[_0xbfcb('0x55')]['find']({'where':{'id':_0x3fb5ad['VoiceExtensionId']},'raw':!![]})[_0xbfcb('0x2d')](function(_0x4de1af){return createVoicePrefixExtensions(_0x3fb5ad,_0x4de1af,_0x37a7e8);});});})['then'](function(){var _0x27058a=_0x294e9e['user'][_0xbfcb('0x2f')]({'plain':!![]});if(!_0x27058a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27058a[_0xbfcb('0x56')]===_0xbfcb('0x57')){var _0x593f4e=_0x3fb5ad;return db[_0xbfcb('0x58')][_0xbfcb('0x52')]({'where':{'name':_0xbfcb('0x59'),'userProfileId':_0x27058a['userProfileId']},'raw':!![]})[_0xbfcb('0x2d')](function(_0xc44640){if(_0xc44640&&_0xc44640[_0xbfcb('0x5a')]===0x0){return db[_0xbfcb('0x30')][_0xbfcb('0x53')]({'name':_0x593f4e[_0xbfcb('0x33')],'resourceId':_0x593f4e['id'],'type':_0xc44640[_0xbfcb('0x33')],'sectionId':_0xc44640['id']},{})['then'](function(){return _0x3fb5ad;});}else{return _0x3fb5ad;}})[_0xbfcb('0x4f')](function(_0x5743ad){logger[_0xbfcb('0x31')](_0xbfcb('0x5b'),_0x5743ad);throw _0x5743ad;});}return _0x3fb5ad;})[_0xbfcb('0x2d')](respondWithResult(_0x3d502e,null))[_0xbfcb('0x4f')](handleError(_0x3d502e,null));};function Extension(_0x5eaf39,_0x558da0,_0x3a0945,_0x48c7b4){this[_0xbfcb('0x5c')]=_0xbfcb('0x5d');this[_0xbfcb('0x5e')]=_0x5eaf39;this[_0xbfcb('0x5f')]=_0x3a0945;this[_0xbfcb('0x39')]=_0xbfcb('0x60');this['description']=_0xbfcb('0x61');this[_0xbfcb('0x62')]=_0x558da0;this[_0xbfcb('0x63')]=_0x48c7b4;}function createVoicePrefixExtensions(_0x36d13c,_0x1b0618,_0x1b5ec2){return new BPromise(function(_0x417030,_0x5d847c){var _0x538200=new Extension(formatPrefixName(_0x36d13c['prefix']),0x1,_0xbfcb('0x64'),_0xbfcb('0x65'));_0x538200[_0xbfcb('0x66')]=_0x36d13c['id'];return db['VoiceExtension'][_0xbfcb('0x53')](_0x538200,{'transaction':_0x1b5ec2})[_0xbfcb('0x2d')](function(_0x4e549){var _0x51ddd4=_0x4e549['get']({'plain':!![]});var _0x48c75e=_[_0xbfcb('0x49')](addVoicePrefixExtensions(_0x36d13c,_0x1b0618),function(_0x156f61){_0x156f61[_0xbfcb('0x67')]=_0x51ddd4['id'];_0x156f61[_0xbfcb('0x66')]=_0x36d13c['id'];return _0x156f61;});return db['VoiceExtension'][_0xbfcb('0x68')](_0x48c75e,{'transaction':_0x1b5ec2})[_0xbfcb('0x2d')](function(_0x39a3cf){if(!_0x39a3cf){return _0x5d847c('Extensions\x20creation\x20failed');}else{return _0x417030(_0x39a3cf);}})['catch'](function(_0x107b1b){return _0x5d847c(_0x107b1b);});});;});};function addVoicePrefixExtensions(_0x2f6065,_0x5e011a){var _0x4842d5=[];var _0x4866ef=formatPrefixName(_0x2f6065['prefix']);_0x4842d5[_0xbfcb('0x69')](new Extension(_0x4866ef,0x2,_0xbfcb('0x6a'),_0xbfcb('0x6b')+_0x2f6065[_0xbfcb('0x33')]));if(_0x2f6065[_0xbfcb('0x6c')]){_0x4842d5[_0xbfcb('0x69')](new Extension(_0x4866ef,0x3,_0xbfcb('0x6a'),_0xbfcb('0x6d')+_0x2f6065['callerIdAll']));}else{_0x4842d5[_0xbfcb('0x69')](new Extension(_0x4866ef,0x3,_0xbfcb('0x64'),_0xbfcb('0x6e')));}_0x4842d5[_0xbfcb('0x69')](new Extension(_0x4866ef,0x4,_0xbfcb('0x6f'),_0x5e011a[_0xbfcb('0x5c')]+','+_0xbfcb('0x70')+(0x8+_0x2f6065[_0xbfcb('0x33')]['length'])+'}'+','+0x1));return _0x4842d5;}function formatPrefixName(_0xe35368){var _0x49a08f='_';for(var _0x14a28d=0x0;_0x14a28d<_0xe35368[_0xbfcb('0x51')];_0x14a28d++){if(_0xe35368[_0xbfcb('0x71')](_0x14a28d)=='-'){_0x49a08f+=_0xe35368[_0xbfcb('0x71')](_0x14a28d);}else{_0x49a08f+='['+_0xe35368[_0xbfcb('0x71')](_0x14a28d)+']';}}_0x49a08f+='.';return _0x49a08f;}exports['update']=function(_0x6ea9ac,_0xdfd1cd,_0xe7fc76){var _0x1bca83=_0x6ea9ac[_0xbfcb('0x72')];_0x1bca83['prefix']=_0xbfcb('0x73')+_0x1bca83[_0xbfcb('0x33')]+'-';return db[_0xbfcb('0x74')][_0xbfcb('0x54')](function(_0x51d6a5){return db['VoicePrefix'][_0xbfcb('0x2c')](_0x1bca83,{'where':{'id':_0x1bca83['id']},'transaction':_0x51d6a5})[_0xbfcb('0x2d')](function(){return db[_0xbfcb('0x55')][_0xbfcb('0x2e')]({'where':{'VoicePrefixId':_0x1bca83['id']},'transaction':_0x51d6a5})[_0xbfcb('0x2d')](function(){return db[_0xbfcb('0x55')][_0xbfcb('0x52')]({'where':{'id':_0x1bca83[_0xbfcb('0x67')]},'raw':!![]})[_0xbfcb('0x2d')](function(_0x3f7811){return createVoicePrefixExtensions(_0x1bca83,_0x3f7811,_0x51d6a5);});});});})[_0xbfcb('0x2d')](function(){return db[_0xbfcb('0x36')][_0xbfcb('0x75')](_0x1bca83['id']);})[_0xbfcb('0x2d')](respondWithResult(_0xdfd1cd,null))['catch'](handleError(_0xdfd1cd,null));};exports[_0xbfcb('0x76')]=function(_0x4d62ff,_0x378f22,_0x17ce1b){return db['VoicePrefix'][_0xbfcb('0x52')]({'where':{'id':_0x4d62ff[_0xbfcb('0x50')]['id']}})[_0xbfcb('0x2d')](handleEntityNotFound(_0x378f22,null))[_0xbfcb('0x2d')](function(_0x58a9a4){if(_0x58a9a4){return _0x58a9a4[_0xbfcb('0x76')](_0x4d62ff['body'][_0xbfcb('0x77')],_[_0xbfcb('0x78')](_0x4d62ff['body'],['ids','id'])||{})[_0xbfcb('0x79')](function(_0x31355a){for(var _0x233da5=0x0;_0x233da5<_0x4d62ff[_0xbfcb('0x72')][_0xbfcb('0x77')]['length'];_0x233da5+=0x1){socket['emit'](_0xbfcb('0x7a'),{'UserId':Number(_0x4d62ff['body']['ids'][_0x233da5]),'VoicePrefixId':Number(_0x4d62ff[_0xbfcb('0x50')]['id'])});}return _0x31355a;});}})[_0xbfcb('0x2d')](respondWithResult(_0x378f22,null))['catch'](handleError(_0x378f22,null));};exports[_0xbfcb('0x7b')]=function(_0x195293,_0x568fa8,_0xbacdd4){return db[_0xbfcb('0x36')][_0xbfcb('0x52')]({'where':{'id':_0x195293[_0xbfcb('0x50')]['id']}})['then'](handleEntityNotFound(_0x568fa8,null))[_0xbfcb('0x2d')](function(_0x2546b1){if(_0x2546b1){return _0x2546b1[_0xbfcb('0x7b')](_0x195293[_0xbfcb('0x43')][_0xbfcb('0x77')])[_0xbfcb('0x2d')](function(){if(_['isArray'](_0x195293[_0xbfcb('0x43')][_0xbfcb('0x77')])){for(var _0x3d677a=0x0;_0x3d677a<_0x195293[_0xbfcb('0x43')][_0xbfcb('0x77')][_0xbfcb('0x51')];_0x3d677a+=0x1){socket[_0xbfcb('0x7c')](_0xbfcb('0x7d'),{'UserId':Number(_0x195293[_0xbfcb('0x43')][_0xbfcb('0x77')][_0x3d677a]),'VoicePrefixId':Number(_0x195293[_0xbfcb('0x50')]['id'])});}}else{socket[_0xbfcb('0x7c')]('userVoicePrefix:remove',{'UserId':Number(_0x195293['query'][_0xbfcb('0x77')]),'VoicePrefixId':Number(_0x195293[_0xbfcb('0x50')]['id'])});}});}})[_0xbfcb('0x2d')](respondWithStatusCode(_0x568fa8,null))[_0xbfcb('0x4f')](handleError(_0x568fa8,null));};exports[_0xbfcb('0x7e')]=function(_0x280260,_0x2ff3a5,_0x10da13){var _0x52b816={};var _0x258969={};var _0x20e222;var _0x2b2773;return db[_0xbfcb('0x36')][_0xbfcb('0x7f')]({'where':{'id':_0x280260['params']['id']}})[_0xbfcb('0x2d')](handleEntityNotFound(_0x2ff3a5,null))['then'](function(_0x1799c){if(_0x1799c){_0x20e222=_0x1799c;_0x258969[_0xbfcb('0x3b')]=_['keys'](db['User'][_0xbfcb('0x37')]);_0x258969[_0xbfcb('0x43')]=_[_0xbfcb('0x3c')](_0x280260[_0xbfcb('0x43')]);_0x258969[_0xbfcb('0x3d')]=_[_0xbfcb('0x3e')](_0x258969['model'],_0x258969[_0xbfcb('0x43')]);_0x52b816[_0xbfcb('0x3f')]=_[_0xbfcb('0x3e')](_0x258969[_0xbfcb('0x3b')],qs[_0xbfcb('0x40')](_0x280260[_0xbfcb('0x43')][_0xbfcb('0x40')]));_0x52b816[_0xbfcb('0x3f')]=_0x52b816['attributes'][_0xbfcb('0x51')]?_0x52b816[_0xbfcb('0x3f')]:_0x258969['model'];_0x52b816['order']=qs[_0xbfcb('0x80')](_0x280260['query']['sort']);_0x52b816[_0xbfcb('0x45')]=qs['filters'](_[_0xbfcb('0x46')](_0x280260[_0xbfcb('0x43')],_0x258969[_0xbfcb('0x3d')]));if(_0x280260['query'][_0xbfcb('0x47')]){_0x52b816[_0xbfcb('0x45')]=_[_0xbfcb('0x48')](_0x52b816['where'],{'$or':_['map'](_0x52b816[_0xbfcb('0x3f')],function(_0x306ea6){var _0x28987c={};_0x28987c[_0x306ea6]={'$like':'%'+_0x280260['query'][_0xbfcb('0x47')]+'%'};return _0x28987c;})});}_0x52b816=_['merge']({},_0x52b816,_0x280260[_0xbfcb('0x4b')]);return _0x20e222[_0xbfcb('0x7e')](_0x52b816);}})['then'](function(_0x1f0e28){if(_0x1f0e28){_0x2b2773=_0x1f0e28[_0xbfcb('0x51')];if(!_0x280260[_0xbfcb('0x43')]['hasOwnProperty'](_0xbfcb('0x42'))){_0x52b816['limit']=qs[_0xbfcb('0x25')](_0x280260[_0xbfcb('0x43')][_0xbfcb('0x25')]);_0x52b816[_0xbfcb('0x23')]=qs[_0xbfcb('0x23')](_0x280260['query'][_0xbfcb('0x23')]);}return _0x20e222[_0xbfcb('0x7e')](_0x52b816);}})['then'](function(_0x2cb2af){if(_0x2cb2af){return _0x2cb2af?{'count':_0x2b2773,'rows':_0x2cb2af}:null;}})['then'](respondWithResult(_0x2ff3a5,null))['catch'](handleError(_0x2ff3a5,null));};exports[_0xbfcb('0x81')]=function(_0x139aa8,_0x5bba0b,_0x2ac498){var _0xdd9f4b={};var _0x32f648={};var _0x70319a;var _0x2c2a15;return db['VoicePrefix'][_0xbfcb('0x7f')]({'where':{'id':_0x139aa8[_0xbfcb('0x50')]['id']}})[_0xbfcb('0x2d')](handleEntityNotFound(_0x5bba0b,null))[_0xbfcb('0x2d')](function(_0xdf378a){if(_0xdf378a){_0x70319a=_0xdf378a;_0x32f648[_0xbfcb('0x3b')]=_[_0xbfcb('0x3c')](db[_0xbfcb('0x82')][_0xbfcb('0x37')]);_0x32f648[_0xbfcb('0x43')]=_[_0xbfcb('0x3c')](_0x139aa8[_0xbfcb('0x43')]);_0x32f648[_0xbfcb('0x3d')]=_['intersection'](_0x32f648[_0xbfcb('0x3b')],_0x32f648[_0xbfcb('0x43')]);_0xdd9f4b[_0xbfcb('0x3f')]=_[_0xbfcb('0x3e')](_0x32f648[_0xbfcb('0x3b')],qs[_0xbfcb('0x40')](_0x139aa8[_0xbfcb('0x43')][_0xbfcb('0x40')]));_0xdd9f4b[_0xbfcb('0x3f')]=_0xdd9f4b['attributes']['length']?_0xdd9f4b[_0xbfcb('0x3f')]:_0x32f648['model'];_0xdd9f4b[_0xbfcb('0x44')]=qs['sort'](_0x139aa8['query'][_0xbfcb('0x80')]);_0xdd9f4b['where']=qs[_0xbfcb('0x3d')](_['pick'](_0x139aa8[_0xbfcb('0x43')],_0x32f648[_0xbfcb('0x3d')]));if(_0x139aa8['query'][_0xbfcb('0x47')]){_0xdd9f4b[_0xbfcb('0x45')]=_[_0xbfcb('0x48')](_0xdd9f4b[_0xbfcb('0x45')],{'$or':_[_0xbfcb('0x49')](_0xdd9f4b[_0xbfcb('0x3f')],function(_0x29f3bd){var _0x2684ce={};_0x2684ce[_0x29f3bd]={'$like':'%'+_0x139aa8[_0xbfcb('0x43')][_0xbfcb('0x47')]+'%'};return _0x2684ce;})});}_0xdd9f4b=_[_0xbfcb('0x48')]({},_0xdd9f4b,_0x139aa8[_0xbfcb('0x4b')]);return _0x70319a[_0xbfcb('0x81')](_0xdd9f4b);}})[_0xbfcb('0x2d')](function(_0x3e8955){if(_0x3e8955){_0x2c2a15=_0x3e8955[_0xbfcb('0x51')];if(!_0x139aa8[_0xbfcb('0x43')][_0xbfcb('0x41')]('nolimit')){_0xdd9f4b[_0xbfcb('0x25')]=qs['limit'](_0x139aa8[_0xbfcb('0x43')][_0xbfcb('0x25')]);_0xdd9f4b['offset']=qs[_0xbfcb('0x23')](_0x139aa8[_0xbfcb('0x43')][_0xbfcb('0x23')]);}return _0x70319a[_0xbfcb('0x81')](_0xdd9f4b);}})['then'](function(_0x3c47a3){if(_0x3c47a3){return _0x3c47a3?{'count':_0x2c2a15,'rows':_0x3c47a3}:null;}})[_0xbfcb('0x2d')](respondWithResult(_0x5bba0b,null))['catch'](handleError(_0x5bba0b,null));};exports[_0xbfcb('0x83')]=function(_0x46a30d,_0x3e13bb,_0x478047){var _0x57da52=_0x46a30d[_0xbfcb('0x72')]['ids'];var _0x9e7a65;return db[_0xbfcb('0x82')]['findAll']({'where':{'id':_0x57da52},'attributes':['id'],'include':[{'model':db[_0xbfcb('0x84')],'as':_0xbfcb('0x85'),'attributes':['id','name',_0xbfcb('0x86'),'voicePause','interface'],'raw':!![]}]})[_0xbfcb('0x2d')](function(_0x1624a6){if(_0x1624a6){_0x9e7a65=_0x1624a6;var _0x2033bd=_['flatMap'](_0x1624a6,function(_0x33b758){var _0x27f186=_0x33b758[_0xbfcb('0x2f')]({'plain':!![]});return _0x27f186[_0xbfcb('0x85')];});return db['VoicePrefix']['find']({'where':{'id':_0x46a30d[_0xbfcb('0x50')]['id']}})['then'](function(_0x3d52e6){return db[_0xbfcb('0x74')][_0xbfcb('0x54')](function(_0x216f7c){return _0x3d52e6['addTeams'](_0x57da52,{'transaction':_0x216f7c})[_0xbfcb('0x2d')](function(){return BPromise['each'](_0x9e7a65,function(_0x3222ab){return db['TeamVoicePrefix'][_0xbfcb('0x87')]({'TeamId':_0x3222ab['id'],'VoicePrefixId':_0x46a30d['params']['id']},{'transaction':_0x216f7c});});})[_0xbfcb('0x2d')](function(){return BPromise['each'](_0x2033bd,function(_0x509038){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x509038['id'],'VoicePrefixId':_0x46a30d[_0xbfcb('0x50')]['id']},'transaction':_0x216f7c});});})[_0xbfcb('0x2d')](function(){_0x2033bd['forEach'](function(_0x29db83){socket[_0xbfcb('0x7c')](_0xbfcb('0x7a'),{'UserId':_0x29db83['id'],'VoicePrefixId':_0x3d52e6['id']});});});});});}})[_0xbfcb('0x2d')](respondWithStatusCode(_0x3e13bb,null))[_0xbfcb('0x4f')](handleError(_0x3e13bb,null));};exports[_0xbfcb('0x88')]=function(_0x27fde4,_0x454abf,_0x3541c4){return db[_0xbfcb('0x82')][_0xbfcb('0x4e')]({'where':{'id':_0x27fde4[_0xbfcb('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbfcb('0x84')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbfcb('0x2d')](handleEntityNotFound(_0x454abf,null))[_0xbfcb('0x2d')](function(_0x3be2c6){var _0x5a28c2=_[_0xbfcb('0x49')](_0x3be2c6,'id');var _0x39a479=[];var _0x5b2222=[];var _0x4db416=squel['select']();_0x4db416['field'](_0xbfcb('0x89'))['from'](_0xbfcb('0x8a'),'tq')[_0xbfcb('0x8b')](_0xbfcb('0x8c'),'ut',_0xbfcb('0x8d'))[_0xbfcb('0x45')](_0xbfcb('0x8e'),_0x27fde4[_0xbfcb('0x50')]['id']);for(var _0x295f8d=0x0;_0x295f8d<_0x3be2c6[_0xbfcb('0x51')];_0x295f8d+=0x1){let _0x372520=_0x3be2c6[_0x295f8d];for(var _0x5739ee=0x0;_0x5739ee<_0x372520[_0xbfcb('0x85')][_0xbfcb('0x51')];_0x5739ee+=0x1){let _0x515253=_0x372520[_0xbfcb('0x85')][_0x5739ee];var _0x36c0f3=_0x4db416[_0xbfcb('0x8f')]();_0x36c0f3[_0xbfcb('0x45')](_0xbfcb('0x90'),_0x515253['id']);_0x5b2222['push'](db[_0xbfcb('0x74')][_0xbfcb('0x43')](_0x36c0f3[_0xbfcb('0x91')](),{'type':db[_0xbfcb('0x74')]['QueryTypes'][_0xbfcb('0x92')]})[_0xbfcb('0x2d')](function(_0x48aaf8){if(_0x48aaf8[_0xbfcb('0x51')]===0x1){return _0x515253['id'];}else{var _0xa0c250=_[_0xbfcb('0x93')](_['map'](_0x48aaf8,_0xbfcb('0x94')),function(_0x12ce37){return _[_0xbfcb('0x95')](_0x5a28c2,_0x12ce37);});if(_0xa0c250){return _0x515253['id'];}}}));}}return BPromise[_0xbfcb('0x96')](_0x5b2222)[_0xbfcb('0x2d')](function(_0x44cb6d){_0x39a479=_(_0x39a479)[_0xbfcb('0x97')](_0x44cb6d)[_0xbfcb('0x98')]()[_0xbfcb('0x99')]();return db[_0xbfcb('0x36')][_0xbfcb('0x52')]({'where':{'id':_0x27fde4[_0xbfcb('0x50')]['id']}})[_0xbfcb('0x2d')](function(_0xe9ee44){return db[_0xbfcb('0x74')]['transaction'](function(_0x233e0a){return _0xe9ee44[_0xbfcb('0x88')](_0x27fde4[_0xbfcb('0x43')][_0xbfcb('0x77')],{'transaction':_0x233e0a})['then'](function(){if(!_[_0xbfcb('0x9a')](_0x39a479)){return _0xe9ee44[_0xbfcb('0x7b')](_0x39a479,{'transaction':_0x233e0a});}})[_0xbfcb('0x2d')](function(){_0x39a479['forEach'](function(_0x3df797){socket['emit'](_0xbfcb('0x7d'),{'UserId':_0x3df797,'VoicePrefixId':_0xe9ee44['id']});});});});});});})[_0xbfcb('0x2d')](respondWithStatusCode(_0x454abf,null))[_0xbfcb('0x4f')](handleError(_0x454abf,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6dfb96d..a4f7568 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 _0x8c0b=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit'];(function(_0x24f282,_0x1175a0){var _0x430114=function(_0x3b413b){while(--_0x3b413b){_0x24f282['push'](_0x24f282['shift']());}};_0x430114(++_0x1175a0);}(_0x8c0b,0x71));var _0xb8c0=function(_0x2cad60,_0xf15b1){_0x2cad60=_0x2cad60-0x0;var _0x51940a=_0x8c0b[_0x2cad60];return _0x51940a;};'use strict';var EventEmitter=require(_0xb8c0('0x0'));var VoicePrefix=require(_0xb8c0('0x1'))['db'][_0xb8c0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb8c0('0x3')](0x0);var events={'afterCreate':_0xb8c0('0x4'),'afterUpdate':_0xb8c0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3fb26d){return function(_0xcfa4e7,_0x48cd2e,_0x17ff8e){VoicePrefixEvents[_0xb8c0('0x6')](_0x3fb26d+':'+_0xcfa4e7['id'],_0xcfa4e7);VoicePrefixEvents['emit'](_0x3fb26d,_0xcfa4e7);_0x17ff8e(null);};}for(var e in events){if(events[_0xb8c0('0x7')](e)){var event=events[e];VoicePrefix[_0xb8c0('0x8')](e,emitEvent(event));}}module[_0xb8c0('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x9b2b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','save','update'];(function(_0x32c1f4,_0x24691b){var _0x364364=function(_0xaf39d5){while(--_0xaf39d5){_0x32c1f4['push'](_0x32c1f4['shift']());}};_0x364364(++_0x24691b);}(_0x9b2b,0x140));var _0xb9b2=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x9b2b[_0x7abd7];return _0x3a2577;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xb9b2('0x0'))['db'][_0xb9b2('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9b2('0x2'),'afterUpdate':_0xb9b2('0x3'),'afterDestroy':_0xb9b2('0x4')};function emitEvent(_0x113b6f){return function(_0x2c9ca1,_0x13fa93,_0x2c90f2){VoicePrefixEvents[_0xb9b2('0x5')](_0x113b6f+':'+_0x2c9ca1['id'],_0x2c9ca1);VoicePrefixEvents[_0xb9b2('0x5')](_0x113b6f,_0x2c9ca1);_0x2c90f2(null);};}for(var e in events){if(events[_0xb9b2('0x6')](e)){var event=events[e];VoicePrefix[_0xb9b2('0x7')](e,emitEvent(event));}}module[_0xb9b2('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b19066a..951c613 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 _0x22e9=['VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports','define'];(function(_0x3fcfe5,_0x3d0e4b){var _0x5141f6=function(_0x1ccfcd){while(--_0x1ccfcd){_0x3fcfe5['push'](_0x3fcfe5['shift']());}};_0x5141f6(++_0x3d0e4b);}(_0x22e9,0x1be));var _0x922e=function(_0x22a524,_0x32c0d0){_0x22a524=_0x22a524-0x0;var _0x2ebb53=_0x22e9[_0x22a524];return _0x2ebb53;};'use strict';var _=require('lodash');var util=require(_0x922e('0x0'));var logger=require(_0x922e('0x1'))(_0x922e('0x2'));var moment=require(_0x922e('0x3'));var BPromise=require(_0x922e('0x4'));var rp=require(_0x922e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x922e('0x6'));var config=require('../../config/environment');var attributes=require(_0x922e('0x7'));module[_0x922e('0x8')]=function(_0x4fc0d6,_0x1c1dbe){return _0x4fc0d6[_0x922e('0x9')](_0x922e('0xa'),attributes,{'tableName':_0x922e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8085=['VoicePrefix','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','define'];(function(_0x128f2d,_0x5a9ebd){var _0x4bc968=function(_0x5dca49){while(--_0x5dca49){_0x128f2d['push'](_0x128f2d['shift']());}};_0x4bc968(++_0x5a9ebd);}(_0x8085,0x1ae));var _0x5808=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x8085[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require(_0x5808('0x0'));var logger=require(_0x5808('0x1'))(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var rp=require(_0x5808('0x5'));var fs=require('fs');var path=require(_0x5808('0x6'));var rimraf=require('rimraf');var config=require(_0x5808('0x7'));var attributes=require(_0x5808('0x8'));module['exports']=function(_0x5e918d,_0x468bca){return _0x5e918d[_0x5808('0x9')](_0x5808('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 7f84f57..9a638c2 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 _0x96f2=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x3e16d0,_0x51cea5){var _0x776b9b=function(_0x58a23b){while(--_0x58a23b){_0x3e16d0['push'](_0x3e16d0['shift']());}};_0x776b9b(++_0x51cea5);}(_0x96f2,0xb0));var _0x296f=function(_0x12f4fb,_0x12eb0f){_0x12f4fb=_0x12f4fb-0x0;var _0x3db066=_0x96f2[_0x12f4fb];return _0x3db066;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x296f('0x9')]=_[_0x296f('0xa')](config[_0x296f('0x9')],{'host':_0x296f('0xb'),'port':0x18eb});var socket=require(_0x296f('0xc'))(new Redis(config[_0x296f('0x9')]));require(_0x296f('0xd'))[_0x296f('0xe')](socket);function respondWithRpcPromise(_0x2f81ac,_0x3729ab,_0x593fd9){return new BPromise(function(_0xea97f0,_0x1a2a02){return client[_0x296f('0xf')](_0x2f81ac,_0x593fd9)['then'](function(_0x2e2307){logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3729ab,'request\x20sent',JSON[_0x296f('0x13')](_0x2e2307));if(_0x2e2307[_0x296f('0x14')]){if(_0x2e2307[_0x296f('0x14')][_0x296f('0x15')]===0x1f4){logger['error'](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0x1a2a02(_0x2e2307[_0x296f('0x14')][_0x296f('0x16')]);}logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0xea97f0(_0x2e2307[_0x296f('0x14')]['message']);}else{logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));_0xea97f0(_0x2e2307['result'][_0x296f('0x16')]);}})[_0x296f('0x17')](function(_0x57f19d){logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x57f19d);_0x1a2a02(_0x57f19d);});});} \ No newline at end of file +var _0x66da=['message','info','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x100818,_0x50115c){var _0xeadf0e=function(_0x542623){while(--_0x542623){_0x100818['push'](_0x100818['shift']());}};_0xeadf0e(++_0x50115c);}(_0x66da,0x16f));var _0xa66d=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x66da[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0xa66d('0x0'));var util=require(_0xa66d('0x1'));var moment=require(_0xa66d('0x2'));var BPromise=require(_0xa66d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa66d('0x4'));var logger=require(_0xa66d('0x5'))(_0xa66d('0x6'));var config=require(_0xa66d('0x7'));var jayson=require(_0xa66d('0x8'));var client=jayson['client'][_0xa66d('0x9')]({'port':0x232a});config[_0xa66d('0xa')]=_[_0xa66d('0xb')](config[_0xa66d('0xa')],{'host':_0xa66d('0xc'),'port':0x18eb});var socket=require(_0xa66d('0xd'))(new Redis(config[_0xa66d('0xa')]));require(_0xa66d('0xe'))[_0xa66d('0xf')](socket);function respondWithRpcPromise(_0x9becae,_0x22b38f,_0x1e65b0){return new BPromise(function(_0x4c0dde,_0x92016b){return client[_0xa66d('0x10')](_0x9becae,_0x1e65b0)['then'](function(_0x4906cd){logger['info'](_0xa66d('0x11'),_0x22b38f,'request\x20sent');logger[_0xa66d('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x22b38f,_0xa66d('0x13'),JSON[_0xa66d('0x14')](_0x4906cd));if(_0x4906cd['error']){if(_0x4906cd[_0xa66d('0x15')][_0xa66d('0x16')]===0x1f4){logger['error'](_0xa66d('0x11'),_0x22b38f,_0x4906cd['error'][_0xa66d('0x17')]);return _0x92016b(_0x4906cd['error'][_0xa66d('0x17')]);}logger[_0xa66d('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x22b38f,_0x4906cd[_0xa66d('0x15')][_0xa66d('0x17')]);return _0x4c0dde(_0x4906cd[_0xa66d('0x15')][_0xa66d('0x17')]);}else{logger[_0xa66d('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x22b38f,_0xa66d('0x13'));_0x4c0dde(_0x4906cd['result'][_0xa66d('0x17')]);}})[_0xa66d('0x19')](function(_0x55db3b){logger[_0xa66d('0x15')](_0xa66d('0x11'),_0x22b38f,_0x55db3b);_0x92016b(_0x55db3b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e33a177..433f710 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 _0xc125=['register','save','update','emit','removeListener'];(function(_0x18eade,_0x13cbb4){var _0x46faf7=function(_0x381450){while(--_0x381450){_0x18eade['push'](_0x18eade['shift']());}};_0x46faf7(++_0x13cbb4);}(_0xc125,0x150));var _0x5c12=function(_0x43fc16,_0x598935){_0x43fc16=_0x43fc16-0x0;var _0x47a48e=_0xc125[_0x43fc16];return _0x47a48e;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x5c12('0x0'),'remove',_0x5c12('0x1')];function createListener(_0x44b9de,_0x2b4f53){return function(_0x2423dc){_0x2b4f53[_0x5c12('0x2')](_0x44b9de,_0x2423dc);};}function removeListener(_0x46f293,_0x31bd53){return function(){VoicePrefixEvents[_0x5c12('0x3')](_0x46f293,_0x31bd53);};}exports[_0x5c12('0x4')]=function(_0x3f1c8b){for(var _0x1a1608=0x0,_0x11ace0=events['length'];_0x1a1608<_0x11ace0;_0x1a1608++){var _0x1d0635=events[_0x1a1608];var _0x4465e3=createListener('voicePrefix:'+_0x1d0635,_0x3f1c8b);VoicePrefixEvents['on'](_0x1d0635,_0x4465e3);}}; \ No newline at end of file +var _0x8369=['voicePrefix:','./voicePrefix.events','save','remove','update','removeListener','register'];(function(_0x3c8371,_0x4f235f){var _0xfb301f=function(_0x12495c){while(--_0x12495c){_0x3c8371['push'](_0x3c8371['shift']());}};_0xfb301f(++_0x4f235f);}(_0x8369,0x10b));var _0x9836=function(_0x4862ea,_0x225bc9){_0x4862ea=_0x4862ea-0x0;var _0x2fb8e6=_0x8369[_0x4862ea];return _0x2fb8e6;};'use strict';var VoicePrefixEvents=require(_0x9836('0x0'));var events=[_0x9836('0x1'),_0x9836('0x2'),_0x9836('0x3')];function createListener(_0xdd679b,_0x1fe0f3){return function(_0x420408){_0x1fe0f3['emit'](_0xdd679b,_0x420408);};}function removeListener(_0x2bd111,_0x5f08f9){return function(){VoicePrefixEvents[_0x9836('0x4')](_0x2bd111,_0x5f08f9);};}exports[_0x9836('0x5')]=function(_0x4e937c){for(var _0x33ac6d=0x0,_0x2e4979=events['length'];_0x33ac6d<_0x2e4979;_0x33ac6d++){var _0x37214e=events[_0x33ac6d];var _0x3007ed=createListener(_0x9836('0x6')+_0x37214e,_0x4e937c);VoicePrefixEvents['on'](_0x37214e,_0x3007ed);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 29ce6b6..648a67b 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(_0x57a2a6,_0x3d21b2){var _0x74724a=function(_0x5918cc){while(--_0x5918cc){_0x57a2a6['push'](_0x57a2a6['shift']());}};_0x74724a(++_0x3d21b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x428018,_0x2e3229){_0x428018=_0x428018-0x0;var _0x49fefa=_0xb10b[_0x428018];return _0x49fefa;};'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(_0x256d13,_0x3e942f){var _0x43db62=function(_0x5d0e41){while(--_0x5d0e41){_0x256d13['push'](_0x256d13['shift']());}};_0x43db62(++_0x3e942f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 92c0ca6..ddf5553 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 _0xbcc4=['Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','random','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xbcc4,0x78));var _0x4bcc=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xbcc4[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x4bcc('0x0'));module[_0x4bcc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x3'),_0x4bcc('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':_0x4bcc('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x4bcc('0x2')]('rr',_0x4bcc('0x7'),_0x4bcc('0x8'),'fewestcalls',_0x4bcc('0x9'),'rrmemory','linear',_0x4bcc('0xa'),_0x4bcc('0xb')),'allowNull':![],'defaultValue':_0x4bcc('0x7'),'set':function(_0x267cc6){this[_0x4bcc('0xc')](_0x4bcc('0xd'),_0x267cc6?_0x267cc6:_0x4bcc('0xe'));},'get':function(){var _0xe4335c=this[_0x4bcc('0xf')](_0x4bcc('0x10'));var _0x11692d=this[_0x4bcc('0xf')](_0x4bcc('0x11'));var _0x456250=this['getDataValue'](_0x4bcc('0xd'));if(_0xe4335c==='outbound'){if(_0x11692d===_0x4bcc('0x12')){return null;}if(_0x11692d===_0x4bcc('0x13')&&![_0x4bcc('0xe'),_0x4bcc('0x14')][_0x4bcc('0x15')](_0x456250)){this[_0x4bcc('0xc')](_0x4bcc('0xd'),_0x4bcc('0xe'));}}return _0x456250;}},'servicelevel':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4bcc('0x16')](0xb)},'timeout':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4bcc('0x5')]},'weight':{'type':Sequelize[_0x4bcc('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no',_0x4bcc('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4bcc('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4bcc('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4bcc('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4bcc('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':_0x4bcc('0x17')},'announce_holdtime':{'type':Sequelize[_0x4bcc('0x2')]('yes','no',_0x4bcc('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x4bcc('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4bcc('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4bcc('0x5')]},'queue_youarenext':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4bcc('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x4bcc('0x5')]},'queue_quantity2':{'type':Sequelize[_0x4bcc('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x4bcc('0x5')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1506e6){this[_0x4bcc('0xc')](_0x4bcc('0x1a'),_0x1506e6?_0x1506e6[_0x4bcc('0x1b')](','):[]);},'get':function(){return this[_0x4bcc('0xf')](_0x4bcc('0x1a'))?this[_0x4bcc('0xf')](_0x4bcc('0x1a'))[_0x4bcc('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x4bcc('0x17'),'set':function(_0x2f702c){this['setDataValue'](_0x4bcc('0x1d'),_0x2f702c?_0x2f702c['join'](','):undefined);},'get':function(){return this[_0x4bcc('0xf')](_0x4bcc('0x1d'))?this[_0x4bcc('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x59dbc2){this[_0x4bcc('0xc')]('leavewhenempty',_0x59dbc2?_0x59dbc2[_0x4bcc('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x4bcc('0xf')](_0x4bcc('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4bcc('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':0x0,'set':function(_0x2151c2){this['setDataValue'](_0x4bcc('0x20'),_0x2151c2);if(_0x2151c2){if(this[_0x4bcc('0xf')](_0x4bcc('0x21'))<0x2){this[_0x4bcc('0xc')](_0x4bcc('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4bcc('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':0x0,'comment':_0x4bcc('0x22')},'dialMethod':{'type':Sequelize[_0x4bcc('0x2')]('preview',_0x4bcc('0x23'),'power',_0x4bcc('0x24'),_0x4bcc('0x13')),'defaultValue':_0x4bcc('0x23'),'comment':_0x4bcc('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x4bcc('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x4bcc('0x16')](0x4)[_0x4bcc('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4bcc('0x27')},'dialPowerLevel':{'type':Sequelize[_0x4bcc('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x29'),_0x4bcc('0x2a')),'defaultValue':_0x4bcc('0x2a'),'comment':_0x4bcc('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4bcc('0x28')](0x2)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4bcc('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4bcc('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4bcc('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x2f')},'dialQueueProject':{'type':Sequelize[_0x4bcc('0x5')],'comment':_0x4bcc('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'comment':_0x4bcc('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4bcc('0x36')},'dialTimezone':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':_0x4bcc('0x37')},'dialPrefix':{'type':Sequelize[_0x4bcc('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x4bcc('0x38'),_0x4bcc('0x39'),_0x4bcc('0x3a')),'defaultValue':_0x4bcc('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4bcc('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x4bcc('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4bcc('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4bcc('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4bcc('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4bcc('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4bcc('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4bcc('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4bcc('0x16')](0x9)[_0x4bcc('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4bcc('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4bcc('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4bcc('0x2')](_0x4bcc('0x43'),_0x4bcc('0x44')),'defaultValue':_0x4bcc('0x43')},'dialQueueProject2':{'type':Sequelize[_0x4bcc('0x5')],'comment':_0x4bcc('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4bcc('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x4b')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4bcc('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4bcc('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4bcc('0x16')](0x5)[_0x4bcc('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4bcc('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4bcc('0x16')],'allowNull':!![],'comment':_0x4bcc('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':![],'comment':_0x4bcc('0x51'),'set':function(_0x527343){if(!_0x527343)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x527343);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4bcc('0x16')](0x3)[_0x4bcc('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4bcc('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xe628=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','inbound','STRING','default','leastrecent','fewestcalls','linear','wrandom','rrordered','ringall','strategy','rrmemory','getDataValue','type','dialMethod','outbound','booked','roundrobin','INTEGER','yes','once','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x389c37,_0x39a393){var _0x924e1e=function(_0x36de03){while(--_0x36de03){_0x389c37['push'](_0x389c37['shift']());}};_0x924e1e(++_0x39a393);}(_0xe628,0x10e));var _0x8e62=function(_0x1fa36d,_0x5abae3){_0x1fa36d=_0x1fa36d-0x0;var _0x8f75b1=_0xe628[_0x1fa36d];return _0x8f75b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x1'),'outbound'),'allowNull':![],'defaultValue':_0x8e62('0x1')},'musiconhold':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':_0x8e62('0x3')},'announce':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x8e62('0x4'),_0x8e62('0x5'),'random','rrmemory',_0x8e62('0x6'),_0x8e62('0x7'),_0x8e62('0x8')),'allowNull':![],'defaultValue':_0x8e62('0x9'),'set':function(_0x25f0aa){this['setDataValue'](_0x8e62('0xa'),_0x25f0aa?_0x25f0aa:_0x8e62('0xb'));},'get':function(){var _0x3840b7=this[_0x8e62('0xc')](_0x8e62('0xd'));var _0x28326a=this[_0x8e62('0xc')](_0x8e62('0xe'));var _0x3ad772=this[_0x8e62('0xc')](_0x8e62('0xa'));if(_0x3840b7===_0x8e62('0xf')){if(_0x28326a==='preview'){return null;}if(_0x28326a===_0x8e62('0x10')&&!['rrmemory',_0x8e62('0x11')]['includes'](_0x3ad772)){this['setDataValue'](_0x8e62('0xa'),_0x8e62('0xb'));}}return _0x3ad772;}},'servicelevel':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8e62('0x2')]},'weight':{'type':Sequelize[_0x8e62('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8e62('0x13'),'no'),'defaultValue':_0x8e62('0x13')},'autopause':{'type':Sequelize[_0x8e62('0x0')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x8e62('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x8e62('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8e62('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8e62('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x8e62('0x13'),'no'),'defaultValue':_0x8e62('0x13')},'announce_holdtime':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no',_0x8e62('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x8e62('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8e62('0x0')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8e62('0x2')]},'queue_youarenext':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8e62('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8e62('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x8e62('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x8e62('0x2')]},'queue_less_than':{'type':Sequelize[_0x8e62('0x2')]},'periodic_announce':{'type':Sequelize[_0x8e62('0x15')],'set':function(_0x350e0a){this['setDataValue'](_0x8e62('0x16'),_0x350e0a?_0x350e0a[_0x8e62('0x17')](','):[]);},'get':function(){return this[_0x8e62('0xc')](_0x8e62('0x16'))?this[_0x8e62('0xc')](_0x8e62('0x16'))[_0x8e62('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':_0x8e62('0x13'),'set':function(_0x2f7b1e){this[_0x8e62('0x19')](_0x8e62('0x1a'),_0x2f7b1e?_0x2f7b1e[_0x8e62('0x17')](','):undefined);},'get':function(){return this[_0x8e62('0xc')](_0x8e62('0x1a'))?this[_0x8e62('0xc')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':'no','set':function(_0x4317f0){this[_0x8e62('0x19')]('leavewhenempty',_0x4317f0?_0x4317f0[_0x8e62('0x17')](','):undefined);},'get':function(){return this['getDataValue'](_0x8e62('0x1b'))?this['getDataValue'](_0x8e62('0x1b'))[_0x8e62('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8e62('0x0')](_0x8e62('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8e62('0x2')]},'description':{'type':Sequelize[_0x8e62('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x605d84){this[_0x8e62('0x19')](_0x8e62('0x1c'),_0x605d84);if(_0x605d84){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8e62('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':0x0,'comment':_0x8e62('0x1e')},'dialMethod':{'type':Sequelize['ENUM'](_0x8e62('0x1f'),_0x8e62('0x20'),'power','predictive','booked'),'defaultValue':'progressive','comment':_0x8e62('0x21')},'dialLimitChannel':{'type':Sequelize[_0x8e62('0x12')](0x4)[_0x8e62('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8e62('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x8e62('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8e62('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x8e62('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8e62('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x8e62('0x26'),_0x8e62('0x27')),'defaultValue':_0x8e62('0x27'),'comment':_0x8e62('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8e62('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8e62('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8e62('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':_0x8e62('0x2b'),'comment':_0x8e62('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x8e62('0x2')],'comment':_0x8e62('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8e62('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8e62('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8e62('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8e62('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8e62('0x33')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8e62('0x2')],'defaultValue':_0x8e62('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8e62('0x0')]('always',_0x8e62('0x35'),_0x8e62('0x36')),'defaultValue':_0x8e62('0x37')},'dialAMDActive':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':0x0,'comment':_0x8e62('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8e62('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8e62('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8e62('0x3b')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8e62('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8e62('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8e62('0x12')](0x9)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8e62('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8e62('0x12')](0x5)[_0x8e62('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8e62('0x12')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8e62('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x8e62('0x12')](0x5)[_0x8e62('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8e62('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':0x0,'comment':_0x8e62('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8e62('0x0')]('DESC',_0x8e62('0x42')),'defaultValue':_0x8e62('0x43')},'dialQueueProject2':{'type':Sequelize[_0x8e62('0x2')],'comment':_0x8e62('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8e62('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8e62('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8e62('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8e62('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8e62('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8e62('0x12')](0x5)[_0x8e62('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8e62('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8e62('0x12')],'allowNull':!![],'comment':_0x8e62('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':![],'comment':_0x8e62('0x4d'),'set':function(_0x3e975b){if(!_0x3e975b)this[_0x8e62('0x19')](_0x8e62('0x4e'),null);this[_0x8e62('0x19')](_0x8e62('0x4f'),_0x3e975b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8e62('0x12')](0x3)[_0x8e62('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x8e62('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8e62('0x12')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8e62('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6a7746b..aef95d4 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 _0xc9c3=['map','value','includes','find','type','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','query','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','VoiceQueue','findAll','rows','catch','show','params','keys','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','QueueCampaigns','outbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','addTeams','TeamVoiceQueue','upsert','UserVoiceQueue','each','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','transaction','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','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','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','inbound','filter','ignore'];(function(_0x3d61e8,_0x569143){var _0x1b34bb=function(_0x664390){while(--_0x664390){_0x3d61e8['push'](_0x3d61e8['shift']());}};_0x1b34bb(++_0x569143);}(_0xc9c3,0x96));var _0x3c9c=function(_0x5dc01f,_0x4a2ce3){_0x5dc01f=_0x5dc01f-0x0;var _0x1167cc=_0xc9c3[_0x5dc01f];return _0x1167cc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];config[_0x3c9c('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c9c('0x19'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x22c495,_0x59d169){_0x59d169=_0x59d169||0xcc;return function(_0x3f1881){if(_0x3f1881){return _0x22c495[_0x3c9c('0x1a')](_0x59d169);}return _0x22c495[_0x3c9c('0x1b')](_0x59d169)[_0x3c9c('0x1c')]();};}function respondWithResult(_0x4a43d2,_0x265cc2){_0x265cc2=_0x265cc2||0xc8;return function(_0x490383){if(_0x490383){return _0x4a43d2['status'](_0x265cc2)['json'](_0x490383);}};}function respondWithFilteredResult(_0x3200a3,_0x32d94a){return function(_0x216fd8){if(_0x216fd8){var _0x3eee19=typeof _0x32d94a[_0x3c9c('0x1d')]===_0x3c9c('0x1e')&&typeof _0x32d94a[_0x3c9c('0x1f')]==='undefined';var _0x15a90a=_0x216fd8['count'];var _0x461711=_0x3eee19?0x0:_0x32d94a['offset'];var _0x164fde=_0x3eee19?_0x216fd8[_0x3c9c('0x20')]:_0x32d94a['offset']+_0x32d94a[_0x3c9c('0x1f')];var _0x29e4ac;if(_0x164fde>=_0x15a90a){_0x164fde=_0x15a90a;_0x29e4ac=0xc8;}else{_0x29e4ac=0xce;}_0x3200a3[_0x3c9c('0x1b')](_0x29e4ac);return _0x3200a3['set'](_0x3c9c('0x21'),_0x461711+'-'+_0x164fde+'/'+_0x15a90a)[_0x3c9c('0x22')](_0x216fd8);}return null;};}function patchUpdates(_0x2d5ffc){return function(_0x937abf){try{jsonpatch[_0x3c9c('0x23')](_0x937abf,_0x2d5ffc,!![]);}catch(_0x3bc5c4){return BPromise[_0x3c9c('0x24')](_0x3bc5c4);}return _0x937abf[_0x3c9c('0x25')]();};}function saveUpdates(_0x509bf7,_0x6ed08a){return function(_0x4d58b9){if(_0x4d58b9){return _0x4d58b9[_0x3c9c('0x26')](_0x509bf7)[_0x3c9c('0x27')](function(_0x4ca078){return _0x4ca078;});}return null;};}function removeEntity(_0x527bb9,_0x379880){return function(_0x1e8589){if(_0x1e8589){return _0x1e8589[_0x3c9c('0x28')]()[_0x3c9c('0x27')](function(){var _0x4c283d=_0x1e8589[_0x3c9c('0x29')]({'plain':!![]});var _0x65b831=[{'name':'VoiceQueues','value':_0x3c9c('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x3aeb60=_(_0x65b831)[_0x3c9c('0x2b')](_0x3c9c('0x2c'))[_0x3c9c('0x2d')](_0x3c9c('0x2e'))['value']();if(_[_0x3c9c('0x2f')](_0x3aeb60,_0x4c283d['type'])){return;}var _0x18b434=_[_0x3c9c('0x30')](_0x65b831,[_0x3c9c('0x2e'),_0x4c283d[_0x3c9c('0x31')]])['name'];return db[_0x3c9c('0x32')][_0x3c9c('0x28')]({'where':{'type':_0x18b434,'resourceId':_0x4c283d['id']}})[_0x3c9c('0x27')](function(){return _0x1e8589;});})[_0x3c9c('0x27')](function(){_0x527bb9[_0x3c9c('0x1b')](0xcc)[_0x3c9c('0x1c')]();});}};}function handleEntityNotFound(_0x314403,_0x317209){return function(_0x4d9c55){if(!_0x4d9c55){_0x314403[_0x3c9c('0x1a')](0x194);}return _0x4d9c55;};}function handleError(_0x1b36a8,_0x1b5226){_0x1b5226=_0x1b5226||0x1f4;return function(_0x38ca2e){logger[_0x3c9c('0x33')](_0x38ca2e[_0x3c9c('0x34')]);if(_0x38ca2e[_0x3c9c('0x35')]){delete _0x38ca2e[_0x3c9c('0x35')];}_0x1b36a8[_0x3c9c('0x1b')](_0x1b5226)[_0x3c9c('0x36')](_0x38ca2e);};}exports[_0x3c9c('0x37')]=function(_0xb86ddc,_0x394a50){var _0x1662ac={},_0x5f4f64={},_0xa1d0f={'count':0x0,'rows':[]};var _0x34266f=_[_0x3c9c('0x2d')](db['VoiceQueue'][_0x3c9c('0x38')],function(_0x7a3545){return{'name':_0x7a3545[_0x3c9c('0x39')],'type':_0x7a3545[_0x3c9c('0x31')]['key']};});_0x5f4f64['model']=_[_0x3c9c('0x2d')](_0x34266f,_0x3c9c('0x35'));_0x5f4f64[_0x3c9c('0x3a')]=_['keys'](_0xb86ddc['query']);_0x5f4f64[_0x3c9c('0x3b')]=_['intersection'](_0x5f4f64['model'],_0x5f4f64[_0x3c9c('0x3a')]);_0x1662ac[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x5f4f64['model'],qs[_0x3c9c('0x3e')](_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x1662ac['attributes']=_0x1662ac['attributes']['length']?_0x1662ac[_0x3c9c('0x3c')]:_0x5f4f64[_0x3c9c('0x3f')];if(!_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x1662ac[_0x3c9c('0x1f')]=qs['limit'](_0xb86ddc['query'][_0x3c9c('0x1f')]);_0x1662ac[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0xb86ddc['query'][_0x3c9c('0x1d')]);}_0x1662ac[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0xb86ddc['query']['sort']);_0x1662ac[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0xb86ddc['query'],_0x5f4f64[_0x3c9c('0x3b')]),_0x34266f);if(_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x1662ac[_0x3c9c('0x44')]=_['merge'](_0x1662ac[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x34266f,function(_0x55496a){if(_0x55496a['type']!==_0x3c9c('0x46')){var _0xe92b80={};_0xe92b80[_0x55496a['name']]={'$like':'%'+_0xb86ddc[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0xe92b80;}})});}_0x1662ac=_[_0x3c9c('0x47')]({},_0x1662ac,_0xb86ddc[_0x3c9c('0x48')]);var _0x40b45c={'where':_0x1662ac[_0x3c9c('0x44')]};return db['VoiceQueue'][_0x3c9c('0x20')](_0x40b45c)[_0x3c9c('0x27')](function(_0xae0088){_0xa1d0f[_0x3c9c('0x20')]=_0xae0088;if(_0xb86ddc[_0x3c9c('0x3a')]['includeAll']){_0x1662ac['include']=[{'all':!![]}];}return db[_0x3c9c('0x49')][_0x3c9c('0x4a')](_0x1662ac);})[_0x3c9c('0x27')](function(_0x25285d){_0xa1d0f[_0x3c9c('0x4b')]=_0x25285d;return _0xa1d0f;})['then'](respondWithFilteredResult(_0x394a50,_0x1662ac))[_0x3c9c('0x4c')](handleError(_0x394a50,null));};exports[_0x3c9c('0x4d')]=function(_0x27a013,_0x222ffa){var _0xcd7ebc={'raw':![],'where':{'id':_0x27a013[_0x3c9c('0x4e')]['id']}},_0x58f6b7={};_0x58f6b7[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x49')][_0x3c9c('0x38')]);_0x58f6b7[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x27a013['query']);_0x58f6b7[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x58f6b7[_0x3c9c('0x3f')],_0x58f6b7[_0x3c9c('0x3a')]);_0xcd7ebc[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x58f6b7['model'],qs[_0x3c9c('0x3e')](_0x27a013[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0xcd7ebc[_0x3c9c('0x3c')]=_0xcd7ebc[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0xcd7ebc[_0x3c9c('0x3c')]:_0x58f6b7[_0x3c9c('0x3f')];if(_0x27a013[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0xcd7ebc[_0x3c9c('0x52')]=[{'all':!![]}];}_0xcd7ebc=_[_0x3c9c('0x47')]({},_0xcd7ebc,_0x27a013[_0x3c9c('0x48')]);return db[_0x3c9c('0x49')][_0x3c9c('0x30')](_0xcd7ebc)[_0x3c9c('0x27')](handleEntityNotFound(_0x222ffa,null))['then'](respondWithResult(_0x222ffa,null))['catch'](handleError(_0x222ffa,null));};exports['create']=function(_0xff4ef7,_0x3d9301){return db[_0x3c9c('0x49')][_0x3c9c('0x53')](_0xff4ef7['body'],{})[_0x3c9c('0x27')](function(_0x5b98da){var _0x4a4be4=_0xff4ef7[_0x3c9c('0x54')][_0x3c9c('0x29')]({'plain':!![]});if(!_0x4a4be4)throw new Error(_0x3c9c('0x55'));if(_0x4a4be4[_0x3c9c('0x56')]===_0x3c9c('0x54')){var _0x1f961b=_0x5b98da[_0x3c9c('0x29')]({'plain':!![]});var _0x149f42=[{'name':_0x3c9c('0x57'),'value':'inbound'},{'name':_0x3c9c('0x58'),'value':_0x3c9c('0x59')}];var _0x437ff5=_[_0x3c9c('0x30')](_0x149f42,[_0x3c9c('0x2e'),_0x1f961b[_0x3c9c('0x31')]])[_0x3c9c('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x437ff5,'userProfileId':_0x4a4be4[_0x3c9c('0x5a')]},'raw':!![]})[_0x3c9c('0x27')](function(_0x3f6347){if(_0x3f6347&&_0x3f6347[_0x3c9c('0x5b')]===0x0){return db[_0x3c9c('0x32')][_0x3c9c('0x53')]({'name':_0x1f961b[_0x3c9c('0x35')],'resourceId':_0x1f961b['id'],'type':_0x3f6347[_0x3c9c('0x35')],'sectionId':_0x3f6347['id']},{})[_0x3c9c('0x27')](function(){return _0x5b98da;});}else{return _0x5b98da;}})[_0x3c9c('0x4c')](function(_0x13ae81){logger[_0x3c9c('0x33')](_0x3c9c('0x5c'),_0x13ae81);throw _0x13ae81;});}return _0x5b98da;})[_0x3c9c('0x27')](respondWithResult(_0x3d9301,0xc9))['catch'](handleError(_0x3d9301,null));};exports[_0x3c9c('0x5d')]=function(_0x4306fe,_0x1b6f0a){var _0x1573f2={'where':{'id':_0x4306fe['params']['id']}},_0x16fbcf={};_0x16fbcf[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db['VoiceQueue']['rawAttributes']);_0x1573f2[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x16fbcf['model'],qs[_0x3c9c('0x3e')](_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x1573f2[_0x3c9c('0x3c')]=_0x1573f2[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x1573f2[_0x3c9c('0x3c')]:_0x16fbcf[_0x3c9c('0x3f')];if(_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x1573f2[_0x3c9c('0x52')]=[{'all':!![]}];}_0x1573f2=_['merge']({},_0x1573f2,_0x4306fe[_0x3c9c('0x48')]);return db['VoiceQueue']['find'](_0x1573f2)[_0x3c9c('0x27')](handleEntityNotFound(_0x1b6f0a,null))[_0x3c9c('0x27')](function(_0x1a1485){if(_0x1a1485){var _0x4695a7=_0x1a1485[_0x3c9c('0x29')]({'plain':!![]});_0x4695a7=qs[_0x3c9c('0x5e')](_0x4695a7,['id',_0x3c9c('0x5f'),'updatedAt']);_0x4306fe[_0x3c9c('0x60')]=_[_0x3c9c('0x5e')](_0x4306fe[_0x3c9c('0x60')],['id',_0x3c9c('0x5f'),_0x3c9c('0x61')]);return db['VoiceQueue']['create'](_[_0x3c9c('0x47')](_0x4695a7,_0x4306fe[_0x3c9c('0x60')]),{'include':_0x4306fe[_0x3c9c('0x3a')][_0x3c9c('0x51')]?[{'all':!![]}]:undefined})[_0x3c9c('0x27')](function(_0x990934){var _0x332503=_0x4306fe[_0x3c9c('0x54')][_0x3c9c('0x29')]({'plain':!![]});if(!_0x332503)throw new Error(_0x3c9c('0x55'));if(_0x332503[_0x3c9c('0x56')]===_0x3c9c('0x54')){var _0x4311c0=_0x990934[_0x3c9c('0x29')]({'plain':!![]});var _0xd46ccf=[{'name':_0x3c9c('0x57'),'value':_0x3c9c('0x2a')},{'name':'QueueCampaigns','value':_0x3c9c('0x59')}];var _0x56a197=_['find'](_0xd46ccf,[_0x3c9c('0x2e'),_0x4311c0[_0x3c9c('0x31')]])[_0x3c9c('0x35')];return db['UserProfileSection'][_0x3c9c('0x30')]({'where':{'name':_0x56a197,'userProfileId':_0x332503[_0x3c9c('0x5a')]},'raw':!![]})['then'](function(_0x23cb34){if(_0x23cb34&&_0x23cb34[_0x3c9c('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x4311c0['name'],'resourceId':_0x4311c0['id'],'type':_0x23cb34[_0x3c9c('0x35')],'sectionId':_0x23cb34['id']},{})[_0x3c9c('0x27')](function(){return _0x990934;});}else{return _0x990934;}})[_0x3c9c('0x4c')](function(_0x3d94da){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d94da);throw _0x3d94da;});}return _0x990934;});}})[_0x3c9c('0x27')](respondWithResult(_0x1b6f0a,0xc9))[_0x3c9c('0x4c')](handleError(_0x1b6f0a,null));};exports[_0x3c9c('0x26')]=function(_0x94bc44,_0x4342a9){if(_0x94bc44[_0x3c9c('0x60')]['id']){delete _0x94bc44[_0x3c9c('0x60')]['id'];}return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x94bc44['params']['id']}})['then'](handleEntityNotFound(_0x4342a9,null))[_0x3c9c('0x27')](saveUpdates(_0x94bc44['body'],null))['then'](respondWithResult(_0x4342a9,null))['catch'](handleError(_0x4342a9,null));};exports[_0x3c9c('0x28')]=function(_0x1159c0,_0x5c4237){return db['VoiceQueue'][_0x3c9c('0x30')]({'where':{'id':_0x1159c0['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x5c4237,null))['then'](removeEntity(_0x5c4237,null))[_0x3c9c('0x4c')](handleError(_0x5c4237,null));};exports[_0x3c9c('0x62')]=function(_0x2cbb5f,_0x587598,_0x4c0093){var _0x27c3f9={'raw':![],'where':{}};var _0x5ca292={};var _0x1d2c9d={'count':0x0,'rows':[]};return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x2cbb5f[_0x3c9c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x587598,null))[_0x3c9c('0x27')](function(_0xbeaf58){if(_0xbeaf58){_0x5ca292['model']=_[_0x3c9c('0x4f')](db[_0x3c9c('0x64')]['rawAttributes']);_0x5ca292[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x2cbb5f['query']);_0x5ca292[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x5ca292[_0x3c9c('0x3f')],_0x5ca292['query']);_0x27c3f9['attributes']=_[_0x3c9c('0x3d')](_0x5ca292[_0x3c9c('0x3f')],qs['fields'](_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x27c3f9[_0x3c9c('0x3c')]=_0x27c3f9['attributes'][_0x3c9c('0x50')]?_0x27c3f9[_0x3c9c('0x3c')]:_0x5ca292['model'];if(!_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x27c3f9[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x27c3f9[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x2cbb5f[_0x3c9c('0x3a')]['offset']);}_0x27c3f9[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x2cbb5f['query'][_0x3c9c('0x43')]);_0x27c3f9[_0x3c9c('0x44')]=qs['filters'](_[_0x3c9c('0x45')](_0x2cbb5f[_0x3c9c('0x3a')],_0x5ca292[_0x3c9c('0x3b')]));_0x27c3f9[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0xbeaf58['id'];if(_0x2cbb5f['query'][_0x3c9c('0x2b')]){_0x27c3f9[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x27c3f9[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x27c3f9[_0x3c9c('0x3c')],function(_0x3ef3d1){var _0x2de80a={};_0x2de80a[_0x3ef3d1]={'$like':'%'+_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x2de80a;})});}_0x27c3f9=_[_0x3c9c('0x47')]({},_0x27c3f9,_0x2cbb5f[_0x3c9c('0x48')]);return db[_0x3c9c('0x64')]['count']({'where':_0x27c3f9[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x508903){_0x1d2c9d[_0x3c9c('0x20')]=_0x508903;if(_0x2cbb5f[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x27c3f9['include']=[{'all':!![]}];}return db[_0x3c9c('0x64')][_0x3c9c('0x4a')](_0x27c3f9);})[_0x3c9c('0x27')](function(_0x285ebc){_0x1d2c9d[_0x3c9c('0x4b')]=_0x285ebc;return _0x1d2c9d;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x587598,_0x27c3f9))['catch'](handleError(_0x587598,null));};exports[_0x3c9c('0x66')]=function(_0x4ca0b7,_0x2265e8,_0x48a57f){var _0x4950c3={'raw':!![],'where':{}};var _0x263270={};var _0x5391a7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x4ca0b7[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x2265e8,null))[_0x3c9c('0x27')](function(_0x2f4e79){if(_0x2f4e79){_0x263270[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x67')][_0x3c9c('0x38')]);_0x263270[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x4ca0b7['query']);_0x263270['filters']=_[_0x3c9c('0x3d')](_0x263270['model'],_0x263270['query']);_0x4950c3[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x263270[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x4ca0b7[_0x3c9c('0x3a')]['fields']));_0x4950c3[_0x3c9c('0x3c')]=_0x4950c3[_0x3c9c('0x3c')]['length']?_0x4950c3['attributes']:_0x263270[_0x3c9c('0x3f')];if(!_0x4ca0b7['query'][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x4950c3[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x4950c3[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}_0x4950c3['order']=qs[_0x3c9c('0x43')](_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x4950c3[_0x3c9c('0x44')]=qs['filters'](_[_0x3c9c('0x45')](_0x4ca0b7['query'],_0x263270[_0x3c9c('0x3b')]));_0x4950c3[_0x3c9c('0x44')]['VoiceQueueId']=_0x2f4e79['id'];if(_0x4ca0b7[_0x3c9c('0x3a')]['filter']){_0x4950c3['where']=_[_0x3c9c('0x47')](_0x4950c3[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x4950c3[_0x3c9c('0x3c')],function(_0x17e5ce){var _0x5c96ad={};_0x5c96ad[_0x17e5ce]={'$like':'%'+_0x4ca0b7[_0x3c9c('0x3a')]['filter']+'%'};return _0x5c96ad;})});}_0x4950c3=_[_0x3c9c('0x47')]({},_0x4950c3,_0x4ca0b7['options']);return db[_0x3c9c('0x67')][_0x3c9c('0x20')]({'where':_0x4950c3[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x126e3d){_0x5391a7[_0x3c9c('0x20')]=_0x126e3d;if(_0x4ca0b7[_0x3c9c('0x3a')][_0x3c9c('0x51')]){_0x4950c3['include']=[{'all':!![]}];}return db[_0x3c9c('0x67')][_0x3c9c('0x4a')](_0x4950c3);})[_0x3c9c('0x27')](function(_0x5614df){_0x5391a7[_0x3c9c('0x4b')]=_0x5614df;return _0x5391a7;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x2265e8,_0x4950c3))[_0x3c9c('0x4c')](handleError(_0x2265e8,null));};exports[_0x3c9c('0x68')]=function(_0x107f4f,_0xdfe4f7,_0x58e1e8){var _0x10b6b9={'raw':!![],'where':{}};var _0x2ba1f1={};var _0x2e158c={'count':0x0,'rows':[]};return db[_0x3c9c('0x49')]['findOne']({'where':{'id':_0x107f4f[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0xdfe4f7,null))[_0x3c9c('0x27')](function(_0x517fa2){if(_0x517fa2){_0x2ba1f1['model']=_[_0x3c9c('0x4f')](db[_0x3c9c('0x69')][_0x3c9c('0x38')]);_0x2ba1f1[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x107f4f[_0x3c9c('0x3a')]);_0x2ba1f1[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x2ba1f1[_0x3c9c('0x3f')],_0x2ba1f1[_0x3c9c('0x3a')]);_0x10b6b9[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x2ba1f1['model'],qs['fields'](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x10b6b9[_0x3c9c('0x3c')]=_0x10b6b9[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x10b6b9[_0x3c9c('0x3c')]:_0x2ba1f1[_0x3c9c('0x3f')];if(!_0x107f4f['query']['hasOwnProperty'](_0x3c9c('0x41'))){_0x10b6b9['limit']=qs[_0x3c9c('0x1f')](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x10b6b9[_0x3c9c('0x1d')]=qs['offset'](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}_0x10b6b9[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x107f4f[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x10b6b9['where']=qs['filters'](_[_0x3c9c('0x45')](_0x107f4f[_0x3c9c('0x3a')],_0x2ba1f1[_0x3c9c('0x3b')]));_0x10b6b9[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0x517fa2['id'];if(_0x107f4f[_0x3c9c('0x3a')]['filter']){_0x10b6b9[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x10b6b9[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x10b6b9['attributes'],function(_0x73dcda){var _0x5460ca={};_0x5460ca[_0x73dcda]={'$like':'%'+_0x107f4f['query'][_0x3c9c('0x2b')]+'%'};return _0x5460ca;})});}_0x10b6b9=_['merge']({},_0x10b6b9,_0x107f4f[_0x3c9c('0x48')]);return db[_0x3c9c('0x69')]['count']({'where':_0x10b6b9[_0x3c9c('0x44')]})[_0x3c9c('0x27')](function(_0x189663){_0x2e158c[_0x3c9c('0x20')]=_0x189663;if(_0x107f4f[_0x3c9c('0x3a')]['includeAll']){_0x10b6b9['include']=[{'all':!![]}];}return db[_0x3c9c('0x69')][_0x3c9c('0x4a')](_0x10b6b9);})[_0x3c9c('0x27')](function(_0xf86c09){_0x2e158c[_0x3c9c('0x4b')]=_0xf86c09;return _0x2e158c;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0xdfe4f7,_0x10b6b9))[_0x3c9c('0x4c')](handleError(_0xdfe4f7,null));};exports[_0x3c9c('0x6a')]=function(_0x12f53,_0x1352fa,_0x441c95){var _0x258dd7={'raw':!![],'where':{}};var _0x4b6a24={};var _0x2e9535={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x12f53['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x1352fa,null))[_0x3c9c('0x27')](function(_0x2c5246){if(_0x2c5246){_0x4b6a24[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6b')]['rawAttributes']);_0x4b6a24[_0x3c9c('0x3a')]=_['keys'](_0x12f53[_0x3c9c('0x3a')]);_0x4b6a24['filters']=_[_0x3c9c('0x3d')](_0x4b6a24[_0x3c9c('0x3f')],_0x4b6a24[_0x3c9c('0x3a')]);_0x258dd7['attributes']=_['intersection'](_0x4b6a24['model'],qs[_0x3c9c('0x3e')](_0x12f53['query']['fields']));_0x258dd7['attributes']=_0x258dd7[_0x3c9c('0x3c')]['length']?_0x258dd7['attributes']:_0x4b6a24['model'];if(!_0x12f53[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x258dd7[_0x3c9c('0x1f')]=qs[_0x3c9c('0x1f')](_0x12f53['query'][_0x3c9c('0x1f')]);_0x258dd7['offset']=qs[_0x3c9c('0x1d')](_0x12f53[_0x3c9c('0x3a')]['offset']);}_0x258dd7[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x12f53['query'][_0x3c9c('0x43')]);_0x258dd7[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x12f53[_0x3c9c('0x3a')],_0x4b6a24[_0x3c9c('0x3b')]));_0x258dd7[_0x3c9c('0x44')][_0x3c9c('0x65')]=_0x2c5246['id'];if(_0x12f53[_0x3c9c('0x3a')]['filter']){_0x258dd7[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x258dd7[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x258dd7[_0x3c9c('0x3c')],function(_0x5559d7){var _0x5973d9={};_0x5973d9[_0x5559d7]={'$like':'%'+_0x12f53[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x5973d9;})});}_0x258dd7=_[_0x3c9c('0x47')]({},_0x258dd7,_0x12f53[_0x3c9c('0x48')]);return db[_0x3c9c('0x6b')]['count']({'where':_0x258dd7[_0x3c9c('0x44')]})['then'](function(_0x45811b){_0x2e9535['count']=_0x45811b;if(_0x12f53[_0x3c9c('0x3a')]['includeAll']){_0x258dd7['include']=[{'all':!![]}];}return db[_0x3c9c('0x6b')][_0x3c9c('0x4a')](_0x258dd7);})[_0x3c9c('0x27')](function(_0x50ea44){_0x2e9535[_0x3c9c('0x4b')]=_0x50ea44;return _0x2e9535;});}})[_0x3c9c('0x27')](respondWithFilteredResult(_0x1352fa,_0x258dd7))[_0x3c9c('0x4c')](handleError(_0x1352fa,null));};exports[_0x3c9c('0x6c')]=function(_0x4b9eb2,_0xc6b2cf,_0x5cc313){var _0x42c9f3={};var _0x47ee15={};var _0x50d273;var _0x2aabae;return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x4b9eb2['params']['id']}})['then'](handleEntityNotFound(_0xc6b2cf,null))['then'](function(_0x3e00ce){if(_0x3e00ce){_0x50d273=_0x3e00ce;_0x47ee15[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6d')]['rawAttributes']);_0x47ee15[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x4b9eb2['query']);_0x47ee15['filters']=_[_0x3c9c('0x3d')](_0x47ee15['model'],_0x47ee15[_0x3c9c('0x3a')]);_0x42c9f3[_0x3c9c('0x3c')]=_['intersection'](_0x47ee15[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x4b9eb2[_0x3c9c('0x3a')]['fields']));_0x42c9f3['attributes']=_0x42c9f3[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x42c9f3['attributes']:_0x47ee15[_0x3c9c('0x3f')];_0x42c9f3['order']=qs['sort'](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x42c9f3['where']=qs['filters'](_[_0x3c9c('0x45')](_0x4b9eb2[_0x3c9c('0x3a')],_0x47ee15[_0x3c9c('0x3b')]));if(_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x42c9f3[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x42c9f3[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x42c9f3['attributes'],function(_0x46602e){var _0x1b3d08={};_0x1b3d08[_0x46602e]={'$like':'%'+_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x1b3d08;})});}_0x42c9f3=_[_0x3c9c('0x47')]({},_0x42c9f3,_0x4b9eb2['options']);return _0x50d273[_0x3c9c('0x6c')](_0x42c9f3);}})[_0x3c9c('0x27')](function(_0x1498f2){if(_0x1498f2){_0x2aabae=_0x1498f2[_0x3c9c('0x50')];if(!_0x4b9eb2['query']['hasOwnProperty'](_0x3c9c('0x41'))){_0x42c9f3[_0x3c9c('0x1f')]=qs['limit'](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x42c9f3[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x4b9eb2[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}return _0x50d273[_0x3c9c('0x6c')](_0x42c9f3);}})[_0x3c9c('0x27')](function(_0x3c98b5){if(_0x3c98b5){return _0x3c98b5?{'count':_0x2aabae,'rows':_0x3c98b5}:null;}})[_0x3c9c('0x27')](respondWithResult(_0xc6b2cf,null))[_0x3c9c('0x4c')](handleError(_0xc6b2cf,null));};exports['addTeams']=function(_0x5abab5,_0x140449,_0x2ab056){var _0x56eb48=_0x5abab5[_0x3c9c('0x60')][_0x3c9c('0x6e')];var _0x31c02b=_['map'](_0x56eb48,'id');return db['Team'][_0x3c9c('0x4a')]({'where':{'id':_0x31c02b},'attributes':['id'],'include':[{'model':db[_0x3c9c('0x6f')],'as':_0x3c9c('0x70'),'attributes':['id',_0x3c9c('0x35'),_0x3c9c('0x71'),_0x3c9c('0x72'),_0x3c9c('0x73')],'raw':!![]}]})['then'](function(_0x5f21c1){if(_0x5f21c1){var _0x32b5b2=_[_0x3c9c('0x74')](_0x5f21c1,function(_0x29a73d){var _0x8bfdea=_0x29a73d['get']({'plain':!![]});_0x8bfdea['Agents'][_0x3c9c('0x75')](function(_0x5c7233){_0x5c7233[_0x3c9c('0x76')]=_[_0x3c9c('0x30')](_0x56eb48,{'id':_0x8bfdea['id']})[_0x3c9c('0x76')];});return _0x8bfdea[_0x3c9c('0x70')];});return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x5abab5[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(_0x575a0e){return db[_0x3c9c('0x77')]['transaction'](function(_0x19484b){return _0x575a0e[_0x3c9c('0x78')](_0x31c02b,{'transaction':_0x19484b})[_0x3c9c('0x27')](function(){return BPromise['each'](_0x56eb48,function(_0x328a43){return db[_0x3c9c('0x79')][_0x3c9c('0x7a')]({'TeamId':_0x328a43['id'],'VoiceQueueId':_0x5abab5[_0x3c9c('0x4e')]['id'],'penalty':_0x328a43[_0x3c9c('0x76')]},{'transaction':_0x19484b});});})['then'](function(){return BPromise['each'](_0x32b5b2,function(_0xc5ed4){return db[_0x3c9c('0x7b')]['findOrCreate']({'where':{'UserId':_0xc5ed4['id'],'VoiceQueueId':_0x5abab5[_0x3c9c('0x4e')]['id']},'defaults':{'penalty':_0xc5ed4[_0x3c9c('0x76')]},'transaction':_0x19484b});});})[_0x3c9c('0x27')](function(){return BPromise[_0x3c9c('0x7c')](_['filter'](_0x32b5b2,{'online':!![]}),function(_0x52c484){return db[_0x3c9c('0x7d')]['upsert']({'membername':_0x52c484[_0x3c9c('0x35')],'UserId':_0x52c484['id'],'queue_name':_0x575a0e[_0x3c9c('0x35')],'VoiceQueueId':_0x575a0e['id'],'interface':_[_0x3c9c('0x7e')](_0x52c484[_0x3c9c('0x73')])?util[_0x3c9c('0x7f')](_0x3c9c('0x80'),_0x52c484[_0x3c9c('0x35')]):_0x52c484[_0x3c9c('0x73')],'paused':_0x52c484[_0x3c9c('0x72')]||![],'penalty':_0x52c484[_0x3c9c('0x76')]},{'transaction':_0x19484b});});})[_0x3c9c('0x27')](function(){_0x32b5b2['forEach'](function(_0x1efa7f){socket[_0x3c9c('0x81')](_0x3c9c('0x82'),{'UserId':_0x1efa7f['id'],'VoiceQueueId':_0x575a0e['id']});});});});});}})['then'](respondWithStatusCode(_0x140449,null))[_0x3c9c('0x4c')](handleError(_0x140449,null));};exports[_0x3c9c('0x83')]=function(_0x172dd9,_0x104299,_0x5341fe){return db[_0x3c9c('0x6d')][_0x3c9c('0x4a')]({'where':{'id':_0x172dd9[_0x3c9c('0x3a')][_0x3c9c('0x84')]},'attributes':['id'],'include':[{'model':db[_0x3c9c('0x6f')],'as':_0x3c9c('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x104299,null))[_0x3c9c('0x27')](function(_0x2471ce){var _0x25e1e7=_['map'](_0x2471ce,'id');var _0x4a1d36=[];var _0x52086d=[];var _0x7d182c=squel[_0x3c9c('0x85')]();_0x7d182c[_0x3c9c('0x86')](_0x3c9c('0x87'))[_0x3c9c('0x88')](_0x3c9c('0x89'),'tq')['join'](_0x3c9c('0x8a'),'ut',_0x3c9c('0x8b'))['where'](_0x3c9c('0x8c'),_0x172dd9[_0x3c9c('0x4e')]['id']);for(var _0x592f68=0x0;_0x592f68<_0x2471ce[_0x3c9c('0x50')];_0x592f68+=0x1){let _0x2e1c83=_0x2471ce[_0x592f68];for(var _0x2cbcd7=0x0;_0x2cbcd7<_0x2e1c83[_0x3c9c('0x70')][_0x3c9c('0x50')];_0x2cbcd7+=0x1){let _0x23c89e=_0x2e1c83[_0x3c9c('0x70')][_0x2cbcd7];var _0x17be35=_0x7d182c[_0x3c9c('0x5d')]();_0x17be35[_0x3c9c('0x44')](_0x3c9c('0x8d'),_0x23c89e['id']);_0x52086d[_0x3c9c('0x8e')](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x17be35[_0x3c9c('0x8f')](),{'type':db[_0x3c9c('0x77')]['QueryTypes']['SELECT']})[_0x3c9c('0x27')](function(_0x1f8f97){if(_0x1f8f97[_0x3c9c('0x50')]===0x1){return _0x23c89e['id'];}else{var _0x3ccfcf=_[_0x3c9c('0x90')](_[_0x3c9c('0x2d')](_0x1f8f97,_0x3c9c('0x91')),function(_0x161f4e){return _[_0x3c9c('0x2f')](_0x25e1e7,_0x161f4e);});if(_0x3ccfcf){return _0x23c89e['id'];}}}));}}return BPromise[_0x3c9c('0x92')](_0x52086d)[_0x3c9c('0x27')](function(_0x288c1c){_0x4a1d36=_(_0x4a1d36)['union'](_0x288c1c)['compact']()['value']();return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x172dd9[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(_0x5e5d3e){return db[_0x3c9c('0x77')][_0x3c9c('0x93')](function(_0x569d4a){return _0x5e5d3e['removeTeams'](_0x172dd9['query'][_0x3c9c('0x84')],{'transaction':_0x569d4a})[_0x3c9c('0x27')](function(){if(!_['isEmpty'](_0x4a1d36)){return _0x5e5d3e[_0x3c9c('0x94')](_0x4a1d36,{'transaction':_0x569d4a})[_0x3c9c('0x27')](function(){return db[_0x3c9c('0x7d')][_0x3c9c('0x28')]({'where':{'VoiceQueueId':_0x172dd9[_0x3c9c('0x4e')]['id'],'UserId':_0x4a1d36},'transaction':_0x569d4a});});}})[_0x3c9c('0x27')](function(){_0x4a1d36[_0x3c9c('0x75')](function(_0x1b4a1a){socket['emit'](_0x3c9c('0x95'),{'UserId':_0x1b4a1a,'VoiceQueueId':_0x5e5d3e['id']});});});});});});})[_0x3c9c('0x27')](respondWithStatusCode(_0x104299,null))['catch'](handleError(_0x104299,null));};exports[_0x3c9c('0x96')]=function(_0x2a5517,_0x3573d5,_0x5d5578){var _0x17d65a,_0x1cf94d;return db['VoiceQueue']['find']({'where':{'id':_0x2a5517[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x3573d5,null))[_0x3c9c('0x27')](function(_0x294f08){if(_0x294f08){_0x1cf94d=_0x294f08;return _0x294f08[_0x3c9c('0x96')](_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')],_['omit'](_0x2a5517[_0x3c9c('0x60')],[_0x3c9c('0x84'),'id'])||{})[_0x3c9c('0x97')](function(_0x184d45){for(var _0x36c8bb=0x0;_0x36c8bb<_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')][_0x3c9c('0x50')];_0x36c8bb+=0x1){socket[_0x3c9c('0x81')](_0x3c9c('0x82'),{'UserId':Number(_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')][_0x36c8bb]),'VoiceQueueId':Number(_0x2a5517[_0x3c9c('0x4e')]['id'])});}return _0x184d45;});}})[_0x3c9c('0x27')](function(_0x4e1681){_0x17d65a=_0x4e1681||[];if(_0x1cf94d){return db['User']['findAll']({'where':{'id':_0x2a5517[_0x3c9c('0x60')][_0x3c9c('0x84')]},'attributes':['id',_0x3c9c('0x35'),_0x3c9c('0x71'),'voicePause',_0x3c9c('0x73')],'raw':!![]});}})[_0x3c9c('0x27')](function(_0x67c740){if(!_['isEmpty'](_0x67c740)){var _0x3a3397=[];for(var _0x5ab1ed=0x0;_0x5ab1ed<_0x67c740['length'];_0x5ab1ed++){if(_0x67c740[_0x5ab1ed]['online']){_0x3a3397[_0x3c9c('0x8e')](db[_0x3c9c('0x7d')][_0x3c9c('0x7a')]({'membername':_0x67c740[_0x5ab1ed]['name'],'UserId':_0x67c740[_0x5ab1ed]['id'],'queue_name':_0x1cf94d[_0x3c9c('0x35')],'VoiceQueueId':_0x1cf94d['id'],'interface':_['isNil'](_0x67c740[_0x5ab1ed][_0x3c9c('0x73')])?util[_0x3c9c('0x7f')](_0x3c9c('0x80'),_0x67c740[_0x5ab1ed]['name']):_0x67c740[_0x5ab1ed][_0x3c9c('0x73')],'paused':_0x67c740[_0x5ab1ed]['voicePause']||![],'penalty':_0x2a5517['body']['penalty']||0x0}));}}return BPromise[_0x3c9c('0x92')](_0x3a3397);}})[_0x3c9c('0x27')](function(){return _0x17d65a;})['then'](respondWithResult(_0x3573d5,null))['catch'](handleError(_0x3573d5,null));};exports['removeAgents']=function(_0x24ab12,_0x56acd6,_0x1240f2){return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x24ab12[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x56acd6,null))[_0x3c9c('0x27')](function(_0x5ed78a){if(_0x5ed78a){return _0x5ed78a['removeAgents'](_0x24ab12['query']['ids'])['then'](function(){if(_[_0x3c9c('0x98')](_0x24ab12[_0x3c9c('0x3a')]['ids'])){for(var _0x42838a=0x0;_0x42838a<_0x24ab12[_0x3c9c('0x3a')][_0x3c9c('0x84')][_0x3c9c('0x50')];_0x42838a+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x24ab12['query'][_0x3c9c('0x84')][_0x42838a]),'VoiceQueueId':Number(_0x24ab12[_0x3c9c('0x4e')]['id'])});}}else{socket['emit'](_0x3c9c('0x95'),{'UserId':Number(_0x24ab12['query'][_0x3c9c('0x84')]),'VoiceQueueId':Number(_0x24ab12[_0x3c9c('0x4e')]['id'])});}});}})['then'](function(_0x15239c){return db[_0x3c9c('0x7d')][_0x3c9c('0x28')]({'where':{'VoiceQueueId':_0x24ab12[_0x3c9c('0x4e')]['id'],'UserId':_0x24ab12[_0x3c9c('0x3a')][_0x3c9c('0x84')]}})['then'](function(){return _0x15239c;});})['then'](respondWithStatusCode(_0x56acd6,null))['catch'](handleError(_0x56acd6,null));};exports[_0x3c9c('0x99')]=function(_0xcdc42b,_0x3b6090,_0x5d852a){var _0x6bf4c6={};var _0x59c6c8={};var _0x28f510;var _0x33b65c;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0xcdc42b[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x3b6090,null))[_0x3c9c('0x27')](function(_0x58b3c8){if(_0x58b3c8){_0x28f510=_0x58b3c8;_0x59c6c8[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x6f')][_0x3c9c('0x38')]);_0x59c6c8[_0x3c9c('0x3a')]=_['keys'](_0xcdc42b[_0x3c9c('0x3a')]);_0x59c6c8['filters']=_[_0x3c9c('0x3d')](_0x59c6c8[_0x3c9c('0x3f')],_0x59c6c8['query']);_0x6bf4c6['attributes']=_['intersection'](_0x59c6c8[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0xcdc42b['query'][_0x3c9c('0x3e')]));_0x6bf4c6[_0x3c9c('0x3c')]=_0x6bf4c6['attributes'][_0x3c9c('0x50')]?_0x6bf4c6[_0x3c9c('0x3c')]:_0x59c6c8[_0x3c9c('0x3f')];_0x6bf4c6[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0xcdc42b[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x6bf4c6[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0xcdc42b[_0x3c9c('0x3a')],_0x59c6c8['filters']));if(_0xcdc42b['query']['filter']){_0x6bf4c6[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x6bf4c6[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x6bf4c6[_0x3c9c('0x3c')],function(_0x4f1a9a){var _0x38d941={};_0x38d941[_0x4f1a9a]={'$like':'%'+_0xcdc42b['query'][_0x3c9c('0x2b')]+'%'};return _0x38d941;})});}_0x6bf4c6=_['merge']({},_0x6bf4c6,_0xcdc42b[_0x3c9c('0x48')]);return _0x28f510[_0x3c9c('0x99')](_0x6bf4c6);}})[_0x3c9c('0x27')](function(_0x2adcb2){if(_0x2adcb2){_0x33b65c=_0x2adcb2[_0x3c9c('0x50')];if(!_0xcdc42b[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x6bf4c6['limit']=qs[_0x3c9c('0x1f')](_0xcdc42b[_0x3c9c('0x3a')]['limit']);_0x6bf4c6[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0xcdc42b['query'][_0x3c9c('0x1d')]);}return _0x28f510[_0x3c9c('0x99')](_0x6bf4c6);}})[_0x3c9c('0x27')](function(_0x3b8781){if(_0x3b8781){return _0x3b8781?{'count':_0x33b65c,'rows':_0x3b8781}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x3b6090,null))[_0x3c9c('0x4c')](handleError(_0x3b6090,null));};exports[_0x3c9c('0x9a')]=function(_0x2b6495,_0x21b27b,_0x3fcec9){var _0x13b386={};var _0x13de89={};var _0x52828e;var _0x247a4d;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x2b6495['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x21b27b,null))[_0x3c9c('0x27')](function(_0x236c5e){if(_0x236c5e){_0x52828e=_0x236c5e;_0x13de89[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x7d')][_0x3c9c('0x38')]);_0x13de89[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x2b6495[_0x3c9c('0x3a')]);_0x13de89[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0x13de89['model'],_0x13de89[_0x3c9c('0x3a')]);_0x13b386['attributes']=_['intersection'](_0x13de89['model'],qs['fields'](_0x2b6495[_0x3c9c('0x3a')]['fields']));_0x13b386[_0x3c9c('0x3c')]=_0x13b386[_0x3c9c('0x3c')]['length']?_0x13b386[_0x3c9c('0x3c')]:_0x13de89[_0x3c9c('0x3f')];_0x13b386['order']=qs[_0x3c9c('0x43')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x13b386[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x2b6495['query'],_0x13de89[_0x3c9c('0x3b')]));if(_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x13b386['where']=_[_0x3c9c('0x47')](_0x13b386[_0x3c9c('0x44')],{'$or':_[_0x3c9c('0x2d')](_0x13b386[_0x3c9c('0x3c')],function(_0x24a412){var _0x264827={};_0x264827[_0x24a412]={'$like':'%'+_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x264827;})});}_0x13b386=_[_0x3c9c('0x47')]({},_0x13b386,_0x2b6495[_0x3c9c('0x48')]);return _0x52828e['getMembers'](_0x13b386);}})[_0x3c9c('0x27')](function(_0x38d305){if(_0x38d305){_0x247a4d=_0x38d305[_0x3c9c('0x50')];if(!_0x2b6495[_0x3c9c('0x3a')]['hasOwnProperty'](_0x3c9c('0x41'))){_0x13b386['limit']=qs[_0x3c9c('0x1f')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x13b386[_0x3c9c('0x1d')]=qs[_0x3c9c('0x1d')](_0x2b6495[_0x3c9c('0x3a')][_0x3c9c('0x1d')]);}return _0x52828e[_0x3c9c('0x9a')](_0x13b386);}})[_0x3c9c('0x27')](function(_0x4dbb61){return _0x4dbb61?{'count':_0x247a4d,'rows':_0x4dbb61}:null;})[_0x3c9c('0x27')](respondWithResult(_0x21b27b,null))[_0x3c9c('0x4c')](handleError(_0x21b27b,null));};exports[_0x3c9c('0x9b')]=function(_0x45cd5d,_0x52e16d,_0x1c2779){var _0x5670f0={};var _0xbbcc4f={};var _0x4debfb;var _0x32ae5a;return db['VoiceQueue'][_0x3c9c('0x63')]({'where':{'id':_0x45cd5d[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x52e16d,null))[_0x3c9c('0x27')](function(_0x38dfab){if(_0x38dfab){_0x4debfb=_0x38dfab;_0xbbcc4f[_0x3c9c('0x3f')]=_['keys'](db[_0x3c9c('0x9c')][_0x3c9c('0x38')]);_0xbbcc4f[_0x3c9c('0x3a')]=_['keys'](_0x45cd5d[_0x3c9c('0x3a')]);_0xbbcc4f[_0x3c9c('0x3b')]=_[_0x3c9c('0x3d')](_0xbbcc4f['model'],_0xbbcc4f[_0x3c9c('0x3a')]);_0x5670f0[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0xbbcc4f[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x5670f0['attributes']=_0x5670f0['attributes'][_0x3c9c('0x50')]?_0x5670f0[_0x3c9c('0x3c')]:_0xbbcc4f[_0x3c9c('0x3f')];_0x5670f0[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x43')]);_0x5670f0['where']=qs[_0x3c9c('0x3b')](_['pick'](_0x45cd5d[_0x3c9c('0x3a')],_0xbbcc4f[_0x3c9c('0x3b')]));if(_0x45cd5d[_0x3c9c('0x3a')][_0x3c9c('0x2b')]){_0x5670f0[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x5670f0['where'],{'$or':_[_0x3c9c('0x2d')](_0x5670f0['attributes'],function(_0x5dfc52){var _0x2d0c01={};_0x2d0c01[_0x5dfc52]={'$like':'%'+_0x45cd5d[_0x3c9c('0x3a')]['filter']+'%'};return _0x2d0c01;})});}_0x5670f0=_[_0x3c9c('0x47')]({},_0x5670f0,_0x45cd5d[_0x3c9c('0x48')]);return _0x4debfb[_0x3c9c('0x9b')](_0x5670f0);}})[_0x3c9c('0x27')](function(_0x4d79b1){if(_0x4d79b1){_0x32ae5a=_0x4d79b1[_0x3c9c('0x50')];if(!_0x45cd5d['query'][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x5670f0[_0x3c9c('0x1f')]=qs['limit'](_0x45cd5d[_0x3c9c('0x3a')]['limit']);_0x5670f0[_0x3c9c('0x1d')]=qs['offset'](_0x45cd5d[_0x3c9c('0x3a')]['offset']);}return _0x4debfb[_0x3c9c('0x9b')](_0x5670f0);}})[_0x3c9c('0x27')](function(_0xb893de){if(_0xb893de){return _0xb893de?{'count':_0x32ae5a,'rows':_0xb893de}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x52e16d,null))[_0x3c9c('0x4c')](handleError(_0x52e16d,null));};exports[_0x3c9c('0x9d')]=function(_0x1cbf6c,_0x1815dc,_0x110f4c){var _0x2702ac=moment()[_0x3c9c('0x7f')](_0x3c9c('0x9e'));var _0x48b0ea,_0x4d3420;return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x1cbf6c[_0x3c9c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1815dc,null))[_0x3c9c('0x27')](function(_0x2e02ce){if(_0x2e02ce){_0x4d3420=_0x2e02ce;return _0x2e02ce[_0x3c9c('0x9d')](_0x1cbf6c[_0x3c9c('0x60')][_0x3c9c('0x84')],_['omit'](_0x1cbf6c[_0x3c9c('0x60')],[_0x3c9c('0x84'),'id'])||{});}return null;})['spread'](function(_0x2b152d){var _0x4ab3bb;_0x48b0ea=_0x2b152d||[];var _0x32d1d3=[];if(_0x2b152d){for(var _0x2f5596=0x0;_0x2f5596<_0x2b152d[_0x3c9c('0x50')];_0x2f5596+=0x1){var _0x1af3ad=_0x2b152d[_0x2f5596]['get']({'plain':!![]});_0x4d3420['dialCheckDuplicateType']=_0x1cbf6c['body'][_0x3c9c('0x9f')]?_0x1cbf6c['body']['dialCheckDuplicateType']:_0x4d3420['dialCheckDuplicateType'];switch(_0x4d3420[_0x3c9c('0x9f')]){case _0x3c9c('0xa0'):_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))['fromQuery']([_0x3c9c('0xa4'),_0x3c9c('0xa5'),_0x3c9c('0xa6'),_0x3c9c('0xa7'),_0x3c9c('0x65'),'createdAt',_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xa4'),_0x3c9c('0xa4'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0xa5'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))[_0x3c9c('0x86')](_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x1cbf6c['params']['id'][_0x3c9c('0x8f')](),_0x3c9c('0x65'))['field']('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x61'))[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')]('deletedAt\x20IS\x20NULL')[_0x3c9c('0x44')]('ListId\x20=\x20?',_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')]())[_0x3c9c('0x44')](_0x3c9c('0xaa'))['where'](_0x3c9c('0xab'),squel['select']()[_0x3c9c('0x86')](_0x3c9c('0xac'))[_0x3c9c('0x88')](_0x3c9c('0xad'))[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString']()))[_0x3c9c('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xae'))[_0x3c9c('0x88')]('cm_hopper')[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString']())))[_0x3c9c('0x8f')]();break;case'onlyIfOpen':_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),_0x3c9c('0xa5'),'ContactId',_0x3c9c('0xa7'),'VoiceQueueId',_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')]('phone',_0x3c9c('0xa4'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0xa5'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))['field'](_0x1af3ad[_0x3c9c('0xa8')]['toString'](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x1cbf6c[_0x3c9c('0x4e')]['id']['toString'](),_0x3c9c('0x65'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x61'))[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')](_0x3c9c('0xb0'))[_0x3c9c('0x44')](_0x3c9c('0xb1'),_0x1af3ad['CmListId'][_0x3c9c('0x8f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3c9c('0x44')](_0x3c9c('0xab'),squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xae'))[_0x3c9c('0x88')](_0x3c9c('0xa3'))[_0x3c9c('0x44')](_0x3c9c('0x8c'),_0x1cbf6c[_0x3c9c('0x4e')]['id'][_0x3c9c('0x8f')]())))[_0x3c9c('0x8f')]();break;default:_0x4ab3bb=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xa3'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),_0x3c9c('0xa5'),_0x3c9c('0xa6'),_0x3c9c('0xa7'),_0x3c9c('0x65'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()[_0x3c9c('0x86')](_0x3c9c('0xa4'),_0x3c9c('0xa4'))['field']('\x27'+_0x2702ac+'\x27','scheduledAt')[_0x3c9c('0x86')]('id','ContactId')['field'](_0x1af3ad[_0x3c9c('0xa8')]['toString'](),'ListId')[_0x3c9c('0x86')](_0x1cbf6c[_0x3c9c('0x4e')]['id'][_0x3c9c('0x8f')](),_0x3c9c('0x65'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27','updatedAt')[_0x3c9c('0x88')](_0x3c9c('0xa9'))[_0x3c9c('0x44')](_0x3c9c('0xb0'))[_0x3c9c('0x44')](_0x3c9c('0xb1'),_0x1af3ad[_0x3c9c('0xa8')][_0x3c9c('0x8f')]())['where'](_0x3c9c('0xaa')))[_0x3c9c('0x8f')]();}_0x32d1d3['push'](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x4ab3bb));}return BPromise[_0x3c9c('0x92')](_0x32d1d3);}})[_0x3c9c('0x27')](function(){var _0x9a85c0=[];var _0x10ff69=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xb2'))[_0x3c9c('0xaf')]([_0x3c9c('0xb3'),_0x3c9c('0xa4'),_0x3c9c('0xb4'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel[_0x3c9c('0x85')]()['field'](_0x3c9c('0xb5'))[_0x3c9c('0x86')](_0x3c9c('0xb6'))['field'](_0x3c9c('0xb7'))['field']('\x27'+_0x2702ac+'\x27',_0x3c9c('0x5f'))[_0x3c9c('0x86')]('\x27'+_0x2702ac+'\x27','updatedAt')['from'](_0x3c9c('0xb8'),'ci')[_0x3c9c('0xb9')](_0x3c9c('0xa3'),'h',_0x3c9c('0xba'))[_0x3c9c('0x44')](_0x3c9c('0xbb'),_0x2702ac)[_0x3c9c('0x44')]('ci.ItemClass=?',_0x3c9c('0xbc')))[_0x3c9c('0x8f')]();_0x9a85c0['push'](db[_0x3c9c('0x77')][_0x3c9c('0x3a')](_0x10ff69));return BPromise['all'](_0x9a85c0);})['then'](function(){return _0x48b0ea;})['then'](respondWithResult(_0x1815dc,null))[_0x3c9c('0x4c')](handleError(_0x1815dc,null));};exports[_0x3c9c('0xbd')]=function(_0x25b8e1,_0x1bfe77,_0x48183e){return db['VoiceQueue'][_0x3c9c('0x30')]({'where':{'id':_0x25b8e1[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x1bfe77,null))['then'](function(_0x1dc4bd){if(_0x1dc4bd){return _0x1dc4bd['removeLists'](_0x25b8e1['query'][_0x3c9c('0x84')]);}})[_0x3c9c('0x27')](function(_0xecbeb4){if(_0xecbeb4){return db[_0x3c9c('0x64')]['destroy']({'where':{'ListId':_0x25b8e1[_0x3c9c('0x3a')][_0x3c9c('0x84')],'VoiceQueueId':_0x25b8e1[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](function(){return _0xecbeb4;});}})[_0x3c9c('0x27')](respondWithStatusCode(_0x1bfe77,null))[_0x3c9c('0x4c')](handleError(_0x1bfe77,null));};exports[_0x3c9c('0xbe')]=function(_0x218d51,_0x99501f,_0x2b49c0){var _0x2f52a8={};var _0x4ea6b9={};var _0x1fad28;var _0x3175c4;return db[_0x3c9c('0x49')][_0x3c9c('0x63')]({'where':{'id':_0x218d51[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x99501f,null))[_0x3c9c('0x27')](function(_0x161d53){if(_0x161d53){_0x1fad28=_0x161d53;_0x4ea6b9[_0x3c9c('0x3f')]=_[_0x3c9c('0x4f')](db[_0x3c9c('0x9c')][_0x3c9c('0x38')]);_0x4ea6b9[_0x3c9c('0x3a')]=_[_0x3c9c('0x4f')](_0x218d51[_0x3c9c('0x3a')]);_0x4ea6b9['filters']=_[_0x3c9c('0x3d')](_0x4ea6b9[_0x3c9c('0x3f')],_0x4ea6b9[_0x3c9c('0x3a')]);_0x2f52a8[_0x3c9c('0x3c')]=_[_0x3c9c('0x3d')](_0x4ea6b9[_0x3c9c('0x3f')],qs[_0x3c9c('0x3e')](_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x3e')]));_0x2f52a8[_0x3c9c('0x3c')]=_0x2f52a8[_0x3c9c('0x3c')][_0x3c9c('0x50')]?_0x2f52a8[_0x3c9c('0x3c')]:_0x4ea6b9[_0x3c9c('0x3f')];_0x2f52a8[_0x3c9c('0x42')]=qs[_0x3c9c('0x43')](_0x218d51['query'][_0x3c9c('0x43')]);_0x2f52a8[_0x3c9c('0x44')]=qs[_0x3c9c('0x3b')](_[_0x3c9c('0x45')](_0x218d51[_0x3c9c('0x3a')],_0x4ea6b9[_0x3c9c('0x3b')]));if(_0x218d51['query'][_0x3c9c('0x2b')]){_0x2f52a8[_0x3c9c('0x44')]=_[_0x3c9c('0x47')](_0x2f52a8[_0x3c9c('0x44')],{'$or':_['map'](_0x2f52a8[_0x3c9c('0x3c')],function(_0x589a5b){var _0x377010={};_0x377010[_0x589a5b]={'$like':'%'+_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x2b')]+'%'};return _0x377010;})});}_0x2f52a8=_['merge']({},_0x2f52a8,_0x218d51[_0x3c9c('0x48')]);return _0x1fad28['getBlackLists'](_0x2f52a8);}})['then'](function(_0x4e727d){if(_0x4e727d){_0x3175c4=_0x4e727d[_0x3c9c('0x50')];if(!_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x40')](_0x3c9c('0x41'))){_0x2f52a8[_0x3c9c('0x1f')]=qs['limit'](_0x218d51[_0x3c9c('0x3a')][_0x3c9c('0x1f')]);_0x2f52a8[_0x3c9c('0x1d')]=qs['offset'](_0x218d51[_0x3c9c('0x3a')]['offset']);}return _0x1fad28[_0x3c9c('0xbe')](_0x2f52a8);}})[_0x3c9c('0x27')](function(_0x585794){if(_0x585794){return _0x585794?{'count':_0x3175c4,'rows':_0x585794}:null;}})[_0x3c9c('0x27')](respondWithResult(_0x99501f,null))[_0x3c9c('0x4c')](handleError(_0x99501f,null));};exports[_0x3c9c('0xbf')]=function(_0x998d43,_0x62e103,_0x2de18b){var _0x10d2c2,_0x4e5c3c;return db[_0x3c9c('0x49')][_0x3c9c('0x30')]({'where':{'id':_0x998d43['params']['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0x62e103,null))[_0x3c9c('0x27')](function(_0x481933){if(_0x481933){_0x4e5c3c=_0x481933;return _0x481933['addBlackLists'](_0x998d43[_0x3c9c('0x60')][_0x3c9c('0x84')],_[_0x3c9c('0x5e')](_0x998d43[_0x3c9c('0x60')],['ids','id'])||{});}return null;})[_0x3c9c('0x97')](function(_0x1cf0e9){var _0x4da5a9;_0x10d2c2=_0x1cf0e9||[];var _0x52123d=[];if(_0x1cf0e9){for(var _0x295147=0x0;_0x295147<_0x1cf0e9[_0x3c9c('0x50')];_0x295147+=0x1){var _0x6ef991=_0x1cf0e9[_0x295147][_0x3c9c('0x29')]({'plain':!![]});_0x4da5a9=squel[_0x3c9c('0xa1')]()[_0x3c9c('0xa2')](_0x3c9c('0xc0'))[_0x3c9c('0xaf')]([_0x3c9c('0xa4'),'ContactId',_0x3c9c('0xa7'),_0x3c9c('0x65'),_0x3c9c('0x5f'),_0x3c9c('0x61')],squel['select']()['field'](_0x3c9c('0xa4'),_0x3c9c('0xa4'))[_0x3c9c('0x86')]('id',_0x3c9c('0xa6'))[_0x3c9c('0x86')](_0x6ef991[_0x3c9c('0xa8')][_0x3c9c('0x8f')](),_0x3c9c('0xa7'))[_0x3c9c('0x86')](_0x998d43[_0x3c9c('0x4e')]['id']['toString'](),_0x3c9c('0x65'))[_0x3c9c('0x86')](_0x3c9c('0xc1'),'createdAt')[_0x3c9c('0x86')](_0x3c9c('0xc1'),_0x3c9c('0x61'))[_0x3c9c('0x88')]('cm_contacts')[_0x3c9c('0x44')](_0x3c9c('0xb0'))['where'](_0x3c9c('0xb1'),_0x6ef991[_0x3c9c('0xa8')]['toString']())[_0x3c9c('0x44')](_0x3c9c('0xaa')))[_0x3c9c('0x8f')]();_0x52123d['push'](db['sequelize'][_0x3c9c('0x3a')](_0x4da5a9));}return BPromise[_0x3c9c('0x92')](_0x52123d);}})[_0x3c9c('0x27')](function(){return _0x10d2c2;})['then'](respondWithResult(_0x62e103,null))[_0x3c9c('0x4c')](handleError(_0x62e103,null));};exports[_0x3c9c('0xc2')]=function(_0x1fbed7,_0xea27c,_0x16066f){return db[_0x3c9c('0x49')]['find']({'where':{'id':_0x1fbed7[_0x3c9c('0x4e')]['id']}})[_0x3c9c('0x27')](handleEntityNotFound(_0xea27c,null))['then'](function(_0xe84648){if(_0xe84648){return _0xe84648['removeBlackLists'](_0x1fbed7['query'][_0x3c9c('0x84')]);}})[_0x3c9c('0x27')](function(_0xfc7a4c){if(_0xfc7a4c){return db[_0x3c9c('0x6b')][_0x3c9c('0x28')]({'where':{'ListId':_0x1fbed7[_0x3c9c('0x3a')][_0x3c9c('0x84')],'VoiceQueueId':_0x1fbed7[_0x3c9c('0x4e')]['id']}})['then'](function(){return _0xfc7a4c;});}})[_0x3c9c('0x27')](respondWithStatusCode(_0xea27c,null))[_0x3c9c('0x4c')](handleError(_0xea27c,null));}; \ No newline at end of file +var _0x3d4b=['removeAgents','addAgents','spread','isEmpty','UserVoiceQueueRt','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','update','then','get','VoiceQueues','outbound','filter','value','includes','type','find','UserProfileResource','destroy','error','stack','name','send','VoiceQueue','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','QueueCampaigns','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','findOrCreate','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','all','union','compact'];(function(_0x564e4d,_0x27e656){var _0x3e145f=function(_0x67d02e){while(--_0x67d02e){_0x564e4d['push'](_0x564e4d['shift']());}};_0x3e145f(++_0x27e656);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x2f726d,_0x4c486c){_0x2f726d=_0x2f726d-0x0;var _0x38e7fe=_0x3d4b[_0x2f726d];return _0x38e7fe;};'use strict';var emlformat=require(_0xb3d4('0x0'));var rimraf=require(_0xb3d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3d4('0x2'));var rp=require(_0xb3d4('0x3'));var moment=require(_0xb3d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb3d4('0x5'));var util=require(_0xb3d4('0x6'));var path=require(_0xb3d4('0x7'));var sox=require(_0xb3d4('0x8'));var csv=require(_0xb3d4('0x9'));var ejs=require(_0xb3d4('0xa'));var fs=require('fs');var fs_extra=require(_0xb3d4('0xb'));var _=require(_0xb3d4('0xc'));var squel=require(_0xb3d4('0xd'));var crypto=require(_0xb3d4('0xe'));var jsforce=require(_0xb3d4('0xf'));var deskjs=require(_0xb3d4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb3d4('0x11'));var Redis=require(_0xb3d4('0x12'));var authService=require(_0xb3d4('0x13'));var qs=require(_0xb3d4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3d4('0x15'));var logger=require(_0xb3d4('0x16'))(_0xb3d4('0x17'));var utils=require(_0xb3d4('0x18'));var config=require(_0xb3d4('0x19'));var licenseUtil=require(_0xb3d4('0x1a'));var db=require(_0xb3d4('0x1b'))['db'];config[_0xb3d4('0x1c')]=_[_0xb3d4('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb3d4('0x1e'))(new Redis(config[_0xb3d4('0x1c')]));require(_0xb3d4('0x1f'))['register'](socket);function respondWithStatusCode(_0x30bc93,_0x445ee2){_0x445ee2=_0x445ee2||0xcc;return function(_0x4f2c22){if(_0x4f2c22){return _0x30bc93[_0xb3d4('0x20')](_0x445ee2);}return _0x30bc93[_0xb3d4('0x21')](_0x445ee2)['end']();};}function respondWithResult(_0x2d0dd4,_0x485f59){_0x485f59=_0x485f59||0xc8;return function(_0x4ddf7f){if(_0x4ddf7f){return _0x2d0dd4[_0xb3d4('0x21')](_0x485f59)['json'](_0x4ddf7f);}};}function respondWithFilteredResult(_0x9fd9df,_0x34b032){return function(_0x1676a5){if(_0x1676a5){var _0x270298=typeof _0x34b032[_0xb3d4('0x22')]==='undefined'&&typeof _0x34b032[_0xb3d4('0x23')]===_0xb3d4('0x24');var _0x373041=_0x1676a5[_0xb3d4('0x25')];var _0x1f4823=_0x270298?0x0:_0x34b032[_0xb3d4('0x22')];var _0x5706e8=_0x270298?_0x1676a5['count']:_0x34b032[_0xb3d4('0x22')]+_0x34b032[_0xb3d4('0x23')];var _0x56117d;if(_0x5706e8>=_0x373041){_0x5706e8=_0x373041;_0x56117d=0xc8;}else{_0x56117d=0xce;}_0x9fd9df['status'](_0x56117d);return _0x9fd9df['set'](_0xb3d4('0x26'),_0x1f4823+'-'+_0x5706e8+'/'+_0x373041)[_0xb3d4('0x27')](_0x1676a5);}return null;};}function patchUpdates(_0x7b8413){return function(_0x17e6e0){try{jsonpatch['apply'](_0x17e6e0,_0x7b8413,!![]);}catch(_0x4b10fa){return BPromise[_0xb3d4('0x28')](_0x4b10fa);}return _0x17e6e0['save']();};}function saveUpdates(_0x1abfd4,_0x5f2ae4){return function(_0x51acd4){if(_0x51acd4){return _0x51acd4[_0xb3d4('0x29')](_0x1abfd4)[_0xb3d4('0x2a')](function(_0x1fdbf6){return _0x1fdbf6;});}return null;};}function removeEntity(_0x49c125,_0x249636){return function(_0x5009d3){if(_0x5009d3){return _0x5009d3['destroy']()[_0xb3d4('0x2a')](function(){var _0x5482a4=_0x5009d3[_0xb3d4('0x2b')]({'plain':!![]});var _0x3db429=[{'name':_0xb3d4('0x2c'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0xb3d4('0x2d'),'ignore':![]}];var _0xfba9e2=_(_0x3db429)[_0xb3d4('0x2e')]('ignore')['map']('value')[_0xb3d4('0x2f')]();if(_[_0xb3d4('0x30')](_0xfba9e2,_0x5482a4[_0xb3d4('0x31')])){return;}var _0x48bf8c=_[_0xb3d4('0x32')](_0x3db429,[_0xb3d4('0x2f'),_0x5482a4[_0xb3d4('0x31')]])['name'];return db[_0xb3d4('0x33')][_0xb3d4('0x34')]({'where':{'type':_0x48bf8c,'resourceId':_0x5482a4['id']}})['then'](function(){return _0x5009d3;});})[_0xb3d4('0x2a')](function(){_0x49c125['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e60fc,_0x28eede){return function(_0x2cd469){if(!_0x2cd469){_0x3e60fc[_0xb3d4('0x20')](0x194);}return _0x2cd469;};}function handleError(_0x34fc98,_0x429bfa){_0x429bfa=_0x429bfa||0x1f4;return function(_0x2c1006){logger[_0xb3d4('0x35')](_0x2c1006[_0xb3d4('0x36')]);if(_0x2c1006['name']){delete _0x2c1006[_0xb3d4('0x37')];}_0x34fc98[_0xb3d4('0x21')](_0x429bfa)[_0xb3d4('0x38')](_0x2c1006);};}exports['index']=function(_0x3c4e45,_0x4aa62e){var _0x520b3a={},_0x56da7d={},_0x45c8ab={'count':0x0,'rows':[]};var _0x359084=_['map'](db[_0xb3d4('0x39')]['rawAttributes'],function(_0x21458b){return{'name':_0x21458b[_0xb3d4('0x3a')],'type':_0x21458b['type'][_0xb3d4('0x3b')]};});_0x56da7d[_0xb3d4('0x3c')]=_[_0xb3d4('0x3d')](_0x359084,_0xb3d4('0x37'));_0x56da7d['query']=_[_0xb3d4('0x3e')](_0x3c4e45[_0xb3d4('0x3f')]);_0x56da7d[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x56da7d[_0xb3d4('0x3c')],_0x56da7d[_0xb3d4('0x3f')]);_0x520b3a[_0xb3d4('0x42')]=_['intersection'](_0x56da7d['model'],qs[_0xb3d4('0x43')](_0x3c4e45['query'][_0xb3d4('0x43')]));_0x520b3a[_0xb3d4('0x42')]=_0x520b3a['attributes'][_0xb3d4('0x44')]?_0x520b3a[_0xb3d4('0x42')]:_0x56da7d['model'];if(!_0x3c4e45[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x520b3a['limit']=qs[_0xb3d4('0x23')](_0x3c4e45[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x520b3a['offset']=qs[_0xb3d4('0x22')](_0x3c4e45['query'][_0xb3d4('0x22')]);}_0x520b3a[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x3c4e45[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x520b3a['where']=qs[_0xb3d4('0x40')](_[_0xb3d4('0x49')](_0x3c4e45[_0xb3d4('0x3f')],_0x56da7d['filters']),_0x359084);if(_0x3c4e45['query'][_0xb3d4('0x2e')]){_0x520b3a[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x520b3a[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x359084,function(_0x1087ab){if(_0x1087ab['type']!==_0xb3d4('0x4c')){var _0x5b475f={};_0x5b475f[_0x1087ab[_0xb3d4('0x37')]]={'$like':'%'+_0x3c4e45[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x5b475f;}})});}_0x520b3a=_[_0xb3d4('0x4b')]({},_0x520b3a,_0x3c4e45[_0xb3d4('0x4d')]);var _0xb81e85={'where':_0x520b3a[_0xb3d4('0x4a')]};return db[_0xb3d4('0x39')][_0xb3d4('0x25')](_0xb81e85)[_0xb3d4('0x2a')](function(_0x17159f){_0x45c8ab[_0xb3d4('0x25')]=_0x17159f;if(_0x3c4e45[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0x520b3a[_0xb3d4('0x4f')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x520b3a);})['then'](function(_0x269fe0){_0x45c8ab[_0xb3d4('0x50')]=_0x269fe0;return _0x45c8ab;})[_0xb3d4('0x2a')](respondWithFilteredResult(_0x4aa62e,_0x520b3a))['catch'](handleError(_0x4aa62e,null));};exports[_0xb3d4('0x51')]=function(_0x38c4a7,_0x5b4429){var _0x431f19={'raw':![],'where':{'id':_0x38c4a7[_0xb3d4('0x52')]['id']}},_0x53a3d9={};_0x53a3d9[_0xb3d4('0x3c')]=_['keys'](db[_0xb3d4('0x39')][_0xb3d4('0x53')]);_0x53a3d9[_0xb3d4('0x3f')]=_['keys'](_0x38c4a7[_0xb3d4('0x3f')]);_0x53a3d9[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x53a3d9[_0xb3d4('0x3c')],_0x53a3d9[_0xb3d4('0x3f')]);_0x431f19[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x53a3d9[_0xb3d4('0x3c')],qs[_0xb3d4('0x43')](_0x38c4a7['query']['fields']));_0x431f19['attributes']=_0x431f19[_0xb3d4('0x42')][_0xb3d4('0x44')]?_0x431f19['attributes']:_0x53a3d9['model'];if(_0x38c4a7[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0x431f19['include']=[{'all':!![]}];}_0x431f19=_['merge']({},_0x431f19,_0x38c4a7[_0xb3d4('0x4d')]);return db[_0xb3d4('0x39')]['find'](_0x431f19)['then'](handleEntityNotFound(_0x5b4429,null))['then'](respondWithResult(_0x5b4429,null))[_0xb3d4('0x54')](handleError(_0x5b4429,null));};exports[_0xb3d4('0x55')]=function(_0x52274e,_0x129c8c){return db[_0xb3d4('0x39')]['create'](_0x52274e[_0xb3d4('0x56')],{})[_0xb3d4('0x2a')](function(_0x2bffc4){var _0xe8d837=_0x52274e[_0xb3d4('0x57')][_0xb3d4('0x2b')]({'plain':!![]});if(!_0xe8d837)throw new Error(_0xb3d4('0x58'));if(_0xe8d837['role']===_0xb3d4('0x57')){var _0x502a02=_0x2bffc4['get']({'plain':!![]});var _0x16d1bb=[{'name':'VoiceQueues','value':_0xb3d4('0x59')},{'name':_0xb3d4('0x5a'),'value':_0xb3d4('0x2d')}];var _0x3398e1=_[_0xb3d4('0x32')](_0x16d1bb,['value',_0x502a02[_0xb3d4('0x31')]])[_0xb3d4('0x37')];return db[_0xb3d4('0x5b')][_0xb3d4('0x32')]({'where':{'name':_0x3398e1,'userProfileId':_0xe8d837['userProfileId']},'raw':!![]})[_0xb3d4('0x2a')](function(_0x1ce044){if(_0x1ce044&&_0x1ce044[_0xb3d4('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x502a02[_0xb3d4('0x37')],'resourceId':_0x502a02['id'],'type':_0x1ce044['name'],'sectionId':_0x1ce044['id']},{})[_0xb3d4('0x2a')](function(){return _0x2bffc4;});}else{return _0x2bffc4;}})[_0xb3d4('0x54')](function(_0x3739c4){logger[_0xb3d4('0x35')](_0xb3d4('0x5d'),_0x3739c4);throw _0x3739c4;});}return _0x2bffc4;})[_0xb3d4('0x2a')](respondWithResult(_0x129c8c,0xc9))[_0xb3d4('0x54')](handleError(_0x129c8c,null));};exports['clone']=function(_0x35d257,_0x1c3f2b){var _0x40d1df={'where':{'id':_0x35d257['params']['id']}},_0x226985={};_0x226985['model']=_['keys'](db[_0xb3d4('0x39')][_0xb3d4('0x53')]);_0x40d1df[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x226985[_0xb3d4('0x3c')],qs[_0xb3d4('0x43')](_0x35d257[_0xb3d4('0x3f')][_0xb3d4('0x43')]));_0x40d1df[_0xb3d4('0x42')]=_0x40d1df[_0xb3d4('0x42')]['length']?_0x40d1df[_0xb3d4('0x42')]:_0x226985[_0xb3d4('0x3c')];if(_0x35d257[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0x40d1df['include']=[{'all':!![]}];}_0x40d1df=_[_0xb3d4('0x4b')]({},_0x40d1df,_0x35d257[_0xb3d4('0x4d')]);return db[_0xb3d4('0x39')][_0xb3d4('0x32')](_0x40d1df)[_0xb3d4('0x2a')](handleEntityNotFound(_0x1c3f2b,null))[_0xb3d4('0x2a')](function(_0x2fc983){if(_0x2fc983){var _0x29c62a=_0x2fc983['get']({'plain':!![]});_0x29c62a=qs[_0xb3d4('0x5e')](_0x29c62a,['id',_0xb3d4('0x5f'),'updatedAt']);_0x35d257[_0xb3d4('0x56')]=_[_0xb3d4('0x5e')](_0x35d257['body'],['id',_0xb3d4('0x5f'),_0xb3d4('0x60')]);return db[_0xb3d4('0x39')]['create'](_[_0xb3d4('0x4b')](_0x29c62a,_0x35d257['body']),{'include':_0x35d257['query'][_0xb3d4('0x4e')]?[{'all':!![]}]:undefined})[_0xb3d4('0x2a')](function(_0x548f46){var _0x841663=_0x35d257[_0xb3d4('0x57')][_0xb3d4('0x2b')]({'plain':!![]});if(!_0x841663)throw new Error(_0xb3d4('0x58'));if(_0x841663['role']===_0xb3d4('0x57')){var _0x4e01cc=_0x548f46[_0xb3d4('0x2b')]({'plain':!![]});var _0x5a892c=[{'name':_0xb3d4('0x2c'),'value':_0xb3d4('0x59')},{'name':_0xb3d4('0x5a'),'value':_0xb3d4('0x2d')}];var _0x40db16=_[_0xb3d4('0x32')](_0x5a892c,[_0xb3d4('0x2f'),_0x4e01cc[_0xb3d4('0x31')]])[_0xb3d4('0x37')];return db[_0xb3d4('0x5b')][_0xb3d4('0x32')]({'where':{'name':_0x40db16,'userProfileId':_0x841663[_0xb3d4('0x61')]},'raw':!![]})[_0xb3d4('0x2a')](function(_0x361622){if(_0x361622&&_0x361622[_0xb3d4('0x5c')]===0x0){return db[_0xb3d4('0x33')]['create']({'name':_0x4e01cc[_0xb3d4('0x37')],'resourceId':_0x4e01cc['id'],'type':_0x361622[_0xb3d4('0x37')],'sectionId':_0x361622['id']},{})['then'](function(){return _0x548f46;});}else{return _0x548f46;}})['catch'](function(_0x29876f){logger[_0xb3d4('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29876f);throw _0x29876f;});}return _0x548f46;});}})[_0xb3d4('0x2a')](respondWithResult(_0x1c3f2b,0xc9))[_0xb3d4('0x54')](handleError(_0x1c3f2b,null));};exports['update']=function(_0x586b3a,_0xb5c35c){if(_0x586b3a[_0xb3d4('0x56')]['id']){delete _0x586b3a[_0xb3d4('0x56')]['id'];}return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x586b3a['params']['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0xb5c35c,null))[_0xb3d4('0x2a')](saveUpdates(_0x586b3a[_0xb3d4('0x56')],null))[_0xb3d4('0x2a')](respondWithResult(_0xb5c35c,null))[_0xb3d4('0x54')](handleError(_0xb5c35c,null));};exports[_0xb3d4('0x34')]=function(_0xbd03be,_0x4ac080){return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0xbd03be['params']['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x4ac080,null))[_0xb3d4('0x2a')](removeEntity(_0x4ac080,null))['catch'](handleError(_0x4ac080,null));};exports[_0xb3d4('0x62')]=function(_0x3e858b,_0x445aa4,_0x29baff){var _0x463a9c={'raw':![],'where':{}};var _0x41eb33={};var _0x4a576d={'count':0x0,'rows':[]};return db[_0xb3d4('0x39')][_0xb3d4('0x63')]({'where':{'id':_0x3e858b[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x445aa4,null))[_0xb3d4('0x2a')](function(_0x6ef01e){if(_0x6ef01e){_0x41eb33[_0xb3d4('0x3c')]=_['keys'](db[_0xb3d4('0x64')][_0xb3d4('0x53')]);_0x41eb33[_0xb3d4('0x3f')]=_['keys'](_0x3e858b['query']);_0x41eb33['filters']=_[_0xb3d4('0x41')](_0x41eb33[_0xb3d4('0x3c')],_0x41eb33[_0xb3d4('0x3f')]);_0x463a9c[_0xb3d4('0x42')]=_['intersection'](_0x41eb33[_0xb3d4('0x3c')],qs['fields'](_0x3e858b['query'][_0xb3d4('0x43')]));_0x463a9c[_0xb3d4('0x42')]=_0x463a9c['attributes'][_0xb3d4('0x44')]?_0x463a9c['attributes']:_0x41eb33['model'];if(!_0x3e858b[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x463a9c['limit']=qs[_0xb3d4('0x23')](_0x3e858b[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x463a9c['offset']=qs[_0xb3d4('0x22')](_0x3e858b[_0xb3d4('0x3f')]['offset']);}_0x463a9c[_0xb3d4('0x47')]=qs['sort'](_0x3e858b[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x463a9c[_0xb3d4('0x4a')]=qs['filters'](_['pick'](_0x3e858b[_0xb3d4('0x3f')],_0x41eb33[_0xb3d4('0x40')]));_0x463a9c[_0xb3d4('0x4a')][_0xb3d4('0x65')]=_0x6ef01e['id'];if(_0x3e858b[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x463a9c['where']=_['merge'](_0x463a9c[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x463a9c[_0xb3d4('0x42')],function(_0xcaa005){var _0x2afc4a={};_0x2afc4a[_0xcaa005]={'$like':'%'+_0x3e858b['query']['filter']+'%'};return _0x2afc4a;})});}_0x463a9c=_[_0xb3d4('0x4b')]({},_0x463a9c,_0x3e858b['options']);return db[_0xb3d4('0x64')]['count']({'where':_0x463a9c[_0xb3d4('0x4a')]})[_0xb3d4('0x2a')](function(_0x8e495e){_0x4a576d[_0xb3d4('0x25')]=_0x8e495e;if(_0x3e858b[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0x463a9c['include']=[{'all':!![]}];}return db['CmHopper'][_0xb3d4('0x66')](_0x463a9c);})[_0xb3d4('0x2a')](function(_0xc7cd9){_0x4a576d[_0xb3d4('0x50')]=_0xc7cd9;return _0x4a576d;});}})[_0xb3d4('0x2a')](respondWithFilteredResult(_0x445aa4,_0x463a9c))[_0xb3d4('0x54')](handleError(_0x445aa4,null));};exports[_0xb3d4('0x67')]=function(_0x3feaba,_0x42cc55,_0x5719f8){var _0x40a82e={'raw':!![],'where':{}};var _0x3c90af={};var _0xcd813a={'count':0x0,'rows':[]};return db[_0xb3d4('0x39')][_0xb3d4('0x63')]({'where':{'id':_0x3feaba['params']['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x42cc55,null))[_0xb3d4('0x2a')](function(_0x21c8ef){if(_0x21c8ef){_0x3c90af[_0xb3d4('0x3c')]=_['keys'](db[_0xb3d4('0x68')][_0xb3d4('0x53')]);_0x3c90af[_0xb3d4('0x3f')]=_[_0xb3d4('0x3e')](_0x3feaba[_0xb3d4('0x3f')]);_0x3c90af['filters']=_[_0xb3d4('0x41')](_0x3c90af['model'],_0x3c90af[_0xb3d4('0x3f')]);_0x40a82e['attributes']=_[_0xb3d4('0x41')](_0x3c90af[_0xb3d4('0x3c')],qs[_0xb3d4('0x43')](_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x43')]));_0x40a82e[_0xb3d4('0x42')]=_0x40a82e['attributes'][_0xb3d4('0x44')]?_0x40a82e[_0xb3d4('0x42')]:_0x3c90af[_0xb3d4('0x3c')];if(!_0x3feaba[_0xb3d4('0x3f')]['hasOwnProperty'](_0xb3d4('0x46'))){_0x40a82e[_0xb3d4('0x23')]=qs[_0xb3d4('0x23')](_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x40a82e[_0xb3d4('0x22')]=qs['offset'](_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x22')]);}_0x40a82e[_0xb3d4('0x47')]=qs['sort'](_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x40a82e['where']=qs[_0xb3d4('0x40')](_['pick'](_0x3feaba[_0xb3d4('0x3f')],_0x3c90af[_0xb3d4('0x40')]));_0x40a82e[_0xb3d4('0x4a')]['VoiceQueueId']=_0x21c8ef['id'];if(_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x40a82e[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x40a82e[_0xb3d4('0x4a')],{'$or':_['map'](_0x40a82e[_0xb3d4('0x42')],function(_0x47fde9){var _0x166486={};_0x166486[_0x47fde9]={'$like':'%'+_0x3feaba['query']['filter']+'%'};return _0x166486;})});}_0x40a82e=_[_0xb3d4('0x4b')]({},_0x40a82e,_0x3feaba['options']);return db['CmHopperHistory'][_0xb3d4('0x25')]({'where':_0x40a82e[_0xb3d4('0x4a')]})[_0xb3d4('0x2a')](function(_0x4361b3){_0xcd813a['count']=_0x4361b3;if(_0x3feaba[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0x40a82e['include']=[{'all':!![]}];}return db[_0xb3d4('0x68')][_0xb3d4('0x66')](_0x40a82e);})[_0xb3d4('0x2a')](function(_0x4253f8){_0xcd813a['rows']=_0x4253f8;return _0xcd813a;});}})[_0xb3d4('0x2a')](respondWithFilteredResult(_0x42cc55,_0x40a82e))[_0xb3d4('0x54')](handleError(_0x42cc55,null));};exports[_0xb3d4('0x69')]=function(_0x3b140f,_0x1cb052,_0x587616){var _0xdcfafc={'raw':!![],'where':{}};var _0x28b329={};var _0x546acd={'count':0x0,'rows':[]};return db[_0xb3d4('0x39')]['findOne']({'where':{'id':_0x3b140f[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x1cb052,null))['then'](function(_0x804c55){if(_0x804c55){_0x28b329['model']=_[_0xb3d4('0x3e')](db[_0xb3d4('0x6a')]['rawAttributes']);_0x28b329['query']=_['keys'](_0x3b140f[_0xb3d4('0x3f')]);_0x28b329[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x28b329[_0xb3d4('0x3c')],_0x28b329[_0xb3d4('0x3f')]);_0xdcfafc[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x28b329[_0xb3d4('0x3c')],qs['fields'](_0x3b140f['query'][_0xb3d4('0x43')]));_0xdcfafc[_0xb3d4('0x42')]=_0xdcfafc['attributes'][_0xb3d4('0x44')]?_0xdcfafc[_0xb3d4('0x42')]:_0x28b329[_0xb3d4('0x3c')];if(!_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0xdcfafc[_0xb3d4('0x23')]=qs[_0xb3d4('0x23')](_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0xdcfafc[_0xb3d4('0x22')]=qs['offset'](_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x22')]);}_0xdcfafc[_0xb3d4('0x47')]=qs['sort'](_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0xdcfafc[_0xb3d4('0x4a')]=qs[_0xb3d4('0x40')](_[_0xb3d4('0x49')](_0x3b140f[_0xb3d4('0x3f')],_0x28b329['filters']));_0xdcfafc[_0xb3d4('0x4a')][_0xb3d4('0x65')]=_0x804c55['id'];if(_0x3b140f[_0xb3d4('0x3f')]['filter']){_0xdcfafc[_0xb3d4('0x4a')]=_['merge'](_0xdcfafc[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0xdcfafc['attributes'],function(_0x3d7250){var _0x2de44e={};_0x2de44e[_0x3d7250]={'$like':'%'+_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x2de44e;})});}_0xdcfafc=_[_0xb3d4('0x4b')]({},_0xdcfafc,_0x3b140f[_0xb3d4('0x4d')]);return db[_0xb3d4('0x6a')][_0xb3d4('0x25')]({'where':_0xdcfafc[_0xb3d4('0x4a')]})[_0xb3d4('0x2a')](function(_0x365a77){_0x546acd[_0xb3d4('0x25')]=_0x365a77;if(_0x3b140f[_0xb3d4('0x3f')][_0xb3d4('0x4e')]){_0xdcfafc[_0xb3d4('0x4f')]=[{'all':!![]}];}return db[_0xb3d4('0x6a')]['findAll'](_0xdcfafc);})['then'](function(_0x5becb7){_0x546acd['rows']=_0x5becb7;return _0x546acd;});}})[_0xb3d4('0x2a')](respondWithFilteredResult(_0x1cb052,_0xdcfafc))[_0xb3d4('0x54')](handleError(_0x1cb052,null));};exports[_0xb3d4('0x6b')]=function(_0x2b6e24,_0x365a71,_0x5cc442){var _0x1be8ec={'raw':!![],'where':{}};var _0x4f97b4={};var _0x49539e={'count':0x0,'rows':[]};return db[_0xb3d4('0x39')][_0xb3d4('0x63')]({'where':{'id':_0x2b6e24['params']['id']}})['then'](handleEntityNotFound(_0x365a71,null))['then'](function(_0x246988){if(_0x246988){_0x4f97b4['model']=_[_0xb3d4('0x3e')](db[_0xb3d4('0x6c')]['rawAttributes']);_0x4f97b4[_0xb3d4('0x3f')]=_[_0xb3d4('0x3e')](_0x2b6e24[_0xb3d4('0x3f')]);_0x4f97b4[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x4f97b4['model'],_0x4f97b4[_0xb3d4('0x3f')]);_0x1be8ec[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x4f97b4[_0xb3d4('0x3c')],qs['fields'](_0x2b6e24[_0xb3d4('0x3f')][_0xb3d4('0x43')]));_0x1be8ec['attributes']=_0x1be8ec[_0xb3d4('0x42')]['length']?_0x1be8ec[_0xb3d4('0x42')]:_0x4f97b4[_0xb3d4('0x3c')];if(!_0x2b6e24[_0xb3d4('0x3f')][_0xb3d4('0x45')]('nolimit')){_0x1be8ec[_0xb3d4('0x23')]=qs[_0xb3d4('0x23')](_0x2b6e24[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x1be8ec[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x2b6e24['query'][_0xb3d4('0x22')]);}_0x1be8ec[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x2b6e24['query'][_0xb3d4('0x48')]);_0x1be8ec[_0xb3d4('0x4a')]=qs['filters'](_[_0xb3d4('0x49')](_0x2b6e24[_0xb3d4('0x3f')],_0x4f97b4['filters']));_0x1be8ec[_0xb3d4('0x4a')][_0xb3d4('0x65')]=_0x246988['id'];if(_0x2b6e24[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x1be8ec[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x1be8ec[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x1be8ec[_0xb3d4('0x42')],function(_0x276f87){var _0x13148d={};_0x13148d[_0x276f87]={'$like':'%'+_0x2b6e24[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x13148d;})});}_0x1be8ec=_[_0xb3d4('0x4b')]({},_0x1be8ec,_0x2b6e24[_0xb3d4('0x4d')]);return db[_0xb3d4('0x6c')]['count']({'where':_0x1be8ec['where']})[_0xb3d4('0x2a')](function(_0x32cc17){_0x49539e[_0xb3d4('0x25')]=_0x32cc17;if(_0x2b6e24['query']['includeAll']){_0x1be8ec[_0xb3d4('0x4f')]=[{'all':!![]}];}return db[_0xb3d4('0x6c')]['findAll'](_0x1be8ec);})[_0xb3d4('0x2a')](function(_0x8a1913){_0x49539e[_0xb3d4('0x50')]=_0x8a1913;return _0x49539e;});}})[_0xb3d4('0x2a')](respondWithFilteredResult(_0x365a71,_0x1be8ec))[_0xb3d4('0x54')](handleError(_0x365a71,null));};exports[_0xb3d4('0x6d')]=function(_0x4621c4,_0x42c721,_0x123440){var _0x86f16a={};var _0x1ba34a={};var _0x39484b;var _0x10caff;return db[_0xb3d4('0x39')]['findOne']({'where':{'id':_0x4621c4[_0xb3d4('0x52')]['id']}})['then'](handleEntityNotFound(_0x42c721,null))[_0xb3d4('0x2a')](function(_0x5c465b){if(_0x5c465b){_0x39484b=_0x5c465b;_0x1ba34a[_0xb3d4('0x3c')]=_[_0xb3d4('0x3e')](db[_0xb3d4('0x6e')]['rawAttributes']);_0x1ba34a[_0xb3d4('0x3f')]=_[_0xb3d4('0x3e')](_0x4621c4[_0xb3d4('0x3f')]);_0x1ba34a[_0xb3d4('0x40')]=_['intersection'](_0x1ba34a[_0xb3d4('0x3c')],_0x1ba34a['query']);_0x86f16a[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x1ba34a[_0xb3d4('0x3c')],qs[_0xb3d4('0x43')](_0x4621c4['query'][_0xb3d4('0x43')]));_0x86f16a[_0xb3d4('0x42')]=_0x86f16a[_0xb3d4('0x42')][_0xb3d4('0x44')]?_0x86f16a['attributes']:_0x1ba34a['model'];_0x86f16a[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x4621c4[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x86f16a[_0xb3d4('0x4a')]=qs['filters'](_[_0xb3d4('0x49')](_0x4621c4[_0xb3d4('0x3f')],_0x1ba34a[_0xb3d4('0x40')]));if(_0x4621c4['query']['filter']){_0x86f16a[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x86f16a[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x86f16a[_0xb3d4('0x42')],function(_0x1cbf16){var _0x5db342={};_0x5db342[_0x1cbf16]={'$like':'%'+_0x4621c4[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x5db342;})});}_0x86f16a=_[_0xb3d4('0x4b')]({},_0x86f16a,_0x4621c4['options']);return _0x39484b[_0xb3d4('0x6d')](_0x86f16a);}})[_0xb3d4('0x2a')](function(_0x473b24){if(_0x473b24){_0x10caff=_0x473b24['length'];if(!_0x4621c4[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x86f16a['limit']=qs[_0xb3d4('0x23')](_0x4621c4[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x86f16a[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x4621c4[_0xb3d4('0x3f')]['offset']);}return _0x39484b['getTeams'](_0x86f16a);}})[_0xb3d4('0x2a')](function(_0x2187e5){if(_0x2187e5){return _0x2187e5?{'count':_0x10caff,'rows':_0x2187e5}:null;}})[_0xb3d4('0x2a')](respondWithResult(_0x42c721,null))[_0xb3d4('0x54')](handleError(_0x42c721,null));};exports['addTeams']=function(_0x16ec78,_0x55abd3,_0x3e5772){var _0x9bae93=_0x16ec78['body'][_0xb3d4('0x6f')];var _0xc10034=_['map'](_0x9bae93,'id');return db['Team'][_0xb3d4('0x66')]({'where':{'id':_0xc10034},'attributes':['id'],'include':[{'model':db[_0xb3d4('0x70')],'as':_0xb3d4('0x71'),'attributes':['id',_0xb3d4('0x37'),_0xb3d4('0x72'),_0xb3d4('0x73'),_0xb3d4('0x74')],'raw':!![]}]})['then'](function(_0x1e4db7){if(_0x1e4db7){var _0x4f95d1=_[_0xb3d4('0x75')](_0x1e4db7,function(_0xc9b1b){var _0xf1d9f4=_0xc9b1b['get']({'plain':!![]});_0xf1d9f4[_0xb3d4('0x71')][_0xb3d4('0x76')](function(_0x1b62ee){_0x1b62ee[_0xb3d4('0x77')]=_[_0xb3d4('0x32')](_0x9bae93,{'id':_0xf1d9f4['id']})[_0xb3d4('0x77')];});return _0xf1d9f4[_0xb3d4('0x71')];});return db[_0xb3d4('0x39')]['find']({'where':{'id':_0x16ec78['params']['id']}})[_0xb3d4('0x2a')](function(_0xfba353){return db[_0xb3d4('0x78')][_0xb3d4('0x79')](function(_0x5128f8){return _0xfba353[_0xb3d4('0x7a')](_0xc10034,{'transaction':_0x5128f8})['then'](function(){return BPromise[_0xb3d4('0x7b')](_0x9bae93,function(_0x1b2889){return db[_0xb3d4('0x7c')][_0xb3d4('0x7d')]({'TeamId':_0x1b2889['id'],'VoiceQueueId':_0x16ec78['params']['id'],'penalty':_0x1b2889[_0xb3d4('0x77')]},{'transaction':_0x5128f8});});})['then'](function(){return BPromise['each'](_0x4f95d1,function(_0x2651c7){return db['UserVoiceQueue'][_0xb3d4('0x7e')]({'where':{'UserId':_0x2651c7['id'],'VoiceQueueId':_0x16ec78[_0xb3d4('0x52')]['id']},'defaults':{'penalty':_0x2651c7[_0xb3d4('0x77')]},'transaction':_0x5128f8});});})['then'](function(){return BPromise[_0xb3d4('0x7b')](_[_0xb3d4('0x2e')](_0x4f95d1,{'online':!![]}),function(_0x4aff28){return db['UserVoiceQueueRt']['upsert']({'membername':_0x4aff28[_0xb3d4('0x37')],'UserId':_0x4aff28['id'],'queue_name':_0xfba353[_0xb3d4('0x37')],'VoiceQueueId':_0xfba353['id'],'interface':_[_0xb3d4('0x7f')](_0x4aff28[_0xb3d4('0x74')])?util[_0xb3d4('0x80')](_0xb3d4('0x81'),_0x4aff28[_0xb3d4('0x37')]):_0x4aff28['interface'],'paused':_0x4aff28[_0xb3d4('0x73')]||![],'penalty':_0x4aff28[_0xb3d4('0x77')]},{'transaction':_0x5128f8});});})[_0xb3d4('0x2a')](function(){_0x4f95d1['forEach'](function(_0x385c96){socket[_0xb3d4('0x82')](_0xb3d4('0x83'),{'UserId':_0x385c96['id'],'VoiceQueueId':_0xfba353['id']});});});});});}})['then'](respondWithStatusCode(_0x55abd3,null))['catch'](handleError(_0x55abd3,null));};exports[_0xb3d4('0x84')]=function(_0x5a8cd4,_0x2300b7,_0xc4e8c9){return db[_0xb3d4('0x6e')]['findAll']({'where':{'id':_0x5a8cd4[_0xb3d4('0x3f')][_0xb3d4('0x85')]},'attributes':['id'],'include':[{'model':db[_0xb3d4('0x70')],'as':_0xb3d4('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2300b7,null))[_0xb3d4('0x2a')](function(_0x3497ab){var _0xf34e77=_[_0xb3d4('0x3d')](_0x3497ab,'id');var _0x457ac6=[];var _0x1e12af=[];var _0x53b9aa=squel['select']();_0x53b9aa[_0xb3d4('0x86')](_0xb3d4('0x87'))[_0xb3d4('0x88')](_0xb3d4('0x89'),'tq')[_0xb3d4('0x8a')](_0xb3d4('0x8b'),'ut',_0xb3d4('0x8c'))[_0xb3d4('0x4a')](_0xb3d4('0x8d'),_0x5a8cd4[_0xb3d4('0x52')]['id']);for(var _0x367a75=0x0;_0x367a75<_0x3497ab[_0xb3d4('0x44')];_0x367a75+=0x1){let _0x553063=_0x3497ab[_0x367a75];for(var _0x23aadc=0x0;_0x23aadc<_0x553063['Agents'][_0xb3d4('0x44')];_0x23aadc+=0x1){let _0x4b7c6b=_0x553063[_0xb3d4('0x71')][_0x23aadc];var _0x7a2b74=_0x53b9aa[_0xb3d4('0x8e')]();_0x7a2b74[_0xb3d4('0x4a')]('ut.UserId\x20=\x20?',_0x4b7c6b['id']);_0x1e12af[_0xb3d4('0x8f')](db[_0xb3d4('0x78')][_0xb3d4('0x3f')](_0x7a2b74[_0xb3d4('0x90')](),{'type':db['sequelize'][_0xb3d4('0x91')][_0xb3d4('0x92')]})[_0xb3d4('0x2a')](function(_0x139e87){if(_0x139e87[_0xb3d4('0x44')]===0x1){return _0x4b7c6b['id'];}else{var _0x7165f2=_['every'](_[_0xb3d4('0x3d')](_0x139e87,_0xb3d4('0x93')),function(_0x22332b){return _[_0xb3d4('0x30')](_0xf34e77,_0x22332b);});if(_0x7165f2){return _0x4b7c6b['id'];}}}));}}return BPromise[_0xb3d4('0x94')](_0x1e12af)[_0xb3d4('0x2a')](function(_0x814832){_0x457ac6=_(_0x457ac6)[_0xb3d4('0x95')](_0x814832)[_0xb3d4('0x96')]()[_0xb3d4('0x2f')]();return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x5a8cd4['params']['id']}})[_0xb3d4('0x2a')](function(_0x4a823b){return db[_0xb3d4('0x78')][_0xb3d4('0x79')](function(_0x52f8f9){return _0x4a823b[_0xb3d4('0x84')](_0x5a8cd4[_0xb3d4('0x3f')][_0xb3d4('0x85')],{'transaction':_0x52f8f9})[_0xb3d4('0x2a')](function(){if(!_['isEmpty'](_0x457ac6)){return _0x4a823b[_0xb3d4('0x97')](_0x457ac6,{'transaction':_0x52f8f9})['then'](function(){return db['UserVoiceQueueRt'][_0xb3d4('0x34')]({'where':{'VoiceQueueId':_0x5a8cd4[_0xb3d4('0x52')]['id'],'UserId':_0x457ac6},'transaction':_0x52f8f9});});}})[_0xb3d4('0x2a')](function(){_0x457ac6[_0xb3d4('0x76')](function(_0x2c5433){socket['emit']('userVoiceQueue:remove',{'UserId':_0x2c5433,'VoiceQueueId':_0x4a823b['id']});});});});});});})[_0xb3d4('0x2a')](respondWithStatusCode(_0x2300b7,null))['catch'](handleError(_0x2300b7,null));};exports[_0xb3d4('0x98')]=function(_0x1405ec,_0x1d4f15,_0x69d5a8){var _0x39eae2,_0x392851;return db[_0xb3d4('0x39')]['find']({'where':{'id':_0x1405ec[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x1d4f15,null))[_0xb3d4('0x2a')](function(_0x1b35d7){if(_0x1b35d7){_0x392851=_0x1b35d7;return _0x1b35d7[_0xb3d4('0x98')](_0x1405ec[_0xb3d4('0x56')]['ids'],_[_0xb3d4('0x5e')](_0x1405ec[_0xb3d4('0x56')],['ids','id'])||{})[_0xb3d4('0x99')](function(_0x53248c){for(var _0x1838cc=0x0;_0x1838cc<_0x1405ec[_0xb3d4('0x56')][_0xb3d4('0x85')]['length'];_0x1838cc+=0x1){socket[_0xb3d4('0x82')](_0xb3d4('0x83'),{'UserId':Number(_0x1405ec[_0xb3d4('0x56')]['ids'][_0x1838cc]),'VoiceQueueId':Number(_0x1405ec['params']['id'])});}return _0x53248c;});}})[_0xb3d4('0x2a')](function(_0x3b89e5){_0x39eae2=_0x3b89e5||[];if(_0x392851){return db[_0xb3d4('0x70')][_0xb3d4('0x66')]({'where':{'id':_0x1405ec[_0xb3d4('0x56')][_0xb3d4('0x85')]},'attributes':['id',_0xb3d4('0x37'),_0xb3d4('0x72'),'voicePause',_0xb3d4('0x74')],'raw':!![]});}})[_0xb3d4('0x2a')](function(_0x720971){if(!_[_0xb3d4('0x9a')](_0x720971)){var _0xb5d432=[];for(var _0x5bce5c=0x0;_0x5bce5c<_0x720971['length'];_0x5bce5c++){if(_0x720971[_0x5bce5c][_0xb3d4('0x72')]){_0xb5d432[_0xb3d4('0x8f')](db[_0xb3d4('0x9b')][_0xb3d4('0x7d')]({'membername':_0x720971[_0x5bce5c][_0xb3d4('0x37')],'UserId':_0x720971[_0x5bce5c]['id'],'queue_name':_0x392851[_0xb3d4('0x37')],'VoiceQueueId':_0x392851['id'],'interface':_[_0xb3d4('0x7f')](_0x720971[_0x5bce5c]['interface'])?util[_0xb3d4('0x80')](_0xb3d4('0x81'),_0x720971[_0x5bce5c][_0xb3d4('0x37')]):_0x720971[_0x5bce5c][_0xb3d4('0x74')],'paused':_0x720971[_0x5bce5c][_0xb3d4('0x73')]||![],'penalty':_0x1405ec[_0xb3d4('0x56')][_0xb3d4('0x77')]||0x0}));}}return BPromise['all'](_0xb5d432);}})[_0xb3d4('0x2a')](function(){return _0x39eae2;})['then'](respondWithResult(_0x1d4f15,null))[_0xb3d4('0x54')](handleError(_0x1d4f15,null));};exports[_0xb3d4('0x97')]=function(_0x590b7a,_0x5bb7d2,_0x54167e){return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x590b7a[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x5bb7d2,null))[_0xb3d4('0x2a')](function(_0x164914){if(_0x164914){return _0x164914['removeAgents'](_0x590b7a[_0xb3d4('0x3f')][_0xb3d4('0x85')])['then'](function(){if(_[_0xb3d4('0x9c')](_0x590b7a[_0xb3d4('0x3f')][_0xb3d4('0x85')])){for(var _0x8d5f52=0x0;_0x8d5f52<_0x590b7a['query']['ids'][_0xb3d4('0x44')];_0x8d5f52+=0x1){socket[_0xb3d4('0x82')](_0xb3d4('0x9d'),{'UserId':Number(_0x590b7a[_0xb3d4('0x3f')][_0xb3d4('0x85')][_0x8d5f52]),'VoiceQueueId':Number(_0x590b7a['params']['id'])});}}else{socket[_0xb3d4('0x82')](_0xb3d4('0x9d'),{'UserId':Number(_0x590b7a[_0xb3d4('0x3f')][_0xb3d4('0x85')]),'VoiceQueueId':Number(_0x590b7a['params']['id'])});}});}})['then'](function(_0x325bec){return db['UserVoiceQueueRt'][_0xb3d4('0x34')]({'where':{'VoiceQueueId':_0x590b7a[_0xb3d4('0x52')]['id'],'UserId':_0x590b7a['query'][_0xb3d4('0x85')]}})[_0xb3d4('0x2a')](function(){return _0x325bec;});})['then'](respondWithStatusCode(_0x5bb7d2,null))[_0xb3d4('0x54')](handleError(_0x5bb7d2,null));};exports[_0xb3d4('0x9e')]=function(_0x541146,_0x23d7dc,_0x1a5ebb){var _0x19cea5={};var _0x2b0e7a={};var _0x23a331;var _0x4156ee;return db[_0xb3d4('0x39')][_0xb3d4('0x63')]({'where':{'id':_0x541146['params']['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x23d7dc,null))['then'](function(_0x58b594){if(_0x58b594){_0x23a331=_0x58b594;_0x2b0e7a['model']=_[_0xb3d4('0x3e')](db[_0xb3d4('0x70')][_0xb3d4('0x53')]);_0x2b0e7a['query']=_[_0xb3d4('0x3e')](_0x541146[_0xb3d4('0x3f')]);_0x2b0e7a[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x2b0e7a[_0xb3d4('0x3c')],_0x2b0e7a[_0xb3d4('0x3f')]);_0x19cea5[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x2b0e7a['model'],qs[_0xb3d4('0x43')](_0x541146[_0xb3d4('0x3f')][_0xb3d4('0x43')]));_0x19cea5[_0xb3d4('0x42')]=_0x19cea5[_0xb3d4('0x42')]['length']?_0x19cea5[_0xb3d4('0x42')]:_0x2b0e7a['model'];_0x19cea5[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x541146[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x19cea5['where']=qs[_0xb3d4('0x40')](_['pick'](_0x541146[_0xb3d4('0x3f')],_0x2b0e7a[_0xb3d4('0x40')]));if(_0x541146[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x19cea5['where']=_[_0xb3d4('0x4b')](_0x19cea5[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x19cea5[_0xb3d4('0x42')],function(_0x4edebb){var _0x8570ec={};_0x8570ec[_0x4edebb]={'$like':'%'+_0x541146[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x8570ec;})});}_0x19cea5=_['merge']({},_0x19cea5,_0x541146['options']);return _0x23a331[_0xb3d4('0x9e')](_0x19cea5);}})['then'](function(_0x117dce){if(_0x117dce){_0x4156ee=_0x117dce['length'];if(!_0x541146['query'][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x19cea5[_0xb3d4('0x23')]=qs['limit'](_0x541146[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x19cea5[_0xb3d4('0x22')]=qs['offset'](_0x541146['query'][_0xb3d4('0x22')]);}return _0x23a331[_0xb3d4('0x9e')](_0x19cea5);}})[_0xb3d4('0x2a')](function(_0x1063bb){if(_0x1063bb){return _0x1063bb?{'count':_0x4156ee,'rows':_0x1063bb}:null;}})[_0xb3d4('0x2a')](respondWithResult(_0x23d7dc,null))[_0xb3d4('0x54')](handleError(_0x23d7dc,null));};exports[_0xb3d4('0x9f')]=function(_0x102ccc,_0x5c7f64,_0x11872){var _0x160390={};var _0x1b03df={};var _0x28b21b;var _0x4eed8a;return db['VoiceQueue'][_0xb3d4('0x63')]({'where':{'id':_0x102ccc[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x5c7f64,null))['then'](function(_0x411b1c){if(_0x411b1c){_0x28b21b=_0x411b1c;_0x1b03df[_0xb3d4('0x3c')]=_[_0xb3d4('0x3e')](db[_0xb3d4('0x9b')]['rawAttributes']);_0x1b03df[_0xb3d4('0x3f')]=_[_0xb3d4('0x3e')](_0x102ccc['query']);_0x1b03df[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x1b03df['model'],_0x1b03df[_0xb3d4('0x3f')]);_0x160390[_0xb3d4('0x42')]=_['intersection'](_0x1b03df['model'],qs[_0xb3d4('0x43')](_0x102ccc[_0xb3d4('0x3f')]['fields']));_0x160390[_0xb3d4('0x42')]=_0x160390[_0xb3d4('0x42')][_0xb3d4('0x44')]?_0x160390[_0xb3d4('0x42')]:_0x1b03df[_0xb3d4('0x3c')];_0x160390[_0xb3d4('0x47')]=qs['sort'](_0x102ccc['query'][_0xb3d4('0x48')]);_0x160390[_0xb3d4('0x4a')]=qs[_0xb3d4('0x40')](_[_0xb3d4('0x49')](_0x102ccc['query'],_0x1b03df[_0xb3d4('0x40')]));if(_0x102ccc[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x160390[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x160390[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x160390[_0xb3d4('0x42')],function(_0x2f6797){var _0x5b26f8={};_0x5b26f8[_0x2f6797]={'$like':'%'+_0x102ccc[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x5b26f8;})});}_0x160390=_[_0xb3d4('0x4b')]({},_0x160390,_0x102ccc['options']);return _0x28b21b[_0xb3d4('0x9f')](_0x160390);}})[_0xb3d4('0x2a')](function(_0x183f1e){if(_0x183f1e){_0x4eed8a=_0x183f1e[_0xb3d4('0x44')];if(!_0x102ccc[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x160390['limit']=qs[_0xb3d4('0x23')](_0x102ccc['query']['limit']);_0x160390[_0xb3d4('0x22')]=qs['offset'](_0x102ccc[_0xb3d4('0x3f')][_0xb3d4('0x22')]);}return _0x28b21b['getMembers'](_0x160390);}})['then'](function(_0x520540){return _0x520540?{'count':_0x4eed8a,'rows':_0x520540}:null;})[_0xb3d4('0x2a')](respondWithResult(_0x5c7f64,null))[_0xb3d4('0x54')](handleError(_0x5c7f64,null));};exports[_0xb3d4('0xa0')]=function(_0x5b8128,_0x40395c,_0x459515){var _0x1d6711={};var _0x28bfae={};var _0x249809;var _0x328aa9;return db[_0xb3d4('0x39')][_0xb3d4('0x63')]({'where':{'id':_0x5b8128[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x40395c,null))[_0xb3d4('0x2a')](function(_0x57451e){if(_0x57451e){_0x249809=_0x57451e;_0x28bfae[_0xb3d4('0x3c')]=_[_0xb3d4('0x3e')](db['CmList'][_0xb3d4('0x53')]);_0x28bfae['query']=_[_0xb3d4('0x3e')](_0x5b8128[_0xb3d4('0x3f')]);_0x28bfae[_0xb3d4('0x40')]=_[_0xb3d4('0x41')](_0x28bfae[_0xb3d4('0x3c')],_0x28bfae['query']);_0x1d6711[_0xb3d4('0x42')]=_[_0xb3d4('0x41')](_0x28bfae[_0xb3d4('0x3c')],qs[_0xb3d4('0x43')](_0x5b8128[_0xb3d4('0x3f')][_0xb3d4('0x43')]));_0x1d6711[_0xb3d4('0x42')]=_0x1d6711[_0xb3d4('0x42')][_0xb3d4('0x44')]?_0x1d6711[_0xb3d4('0x42')]:_0x28bfae[_0xb3d4('0x3c')];_0x1d6711[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x5b8128['query']['sort']);_0x1d6711[_0xb3d4('0x4a')]=qs[_0xb3d4('0x40')](_[_0xb3d4('0x49')](_0x5b8128[_0xb3d4('0x3f')],_0x28bfae[_0xb3d4('0x40')]));if(_0x5b8128[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x1d6711[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x1d6711[_0xb3d4('0x4a')],{'$or':_[_0xb3d4('0x3d')](_0x1d6711['attributes'],function(_0x51dbac){var _0x116363={};_0x116363[_0x51dbac]={'$like':'%'+_0x5b8128[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x116363;})});}_0x1d6711=_[_0xb3d4('0x4b')]({},_0x1d6711,_0x5b8128[_0xb3d4('0x4d')]);return _0x249809[_0xb3d4('0xa0')](_0x1d6711);}})['then'](function(_0x4cb909){if(_0x4cb909){_0x328aa9=_0x4cb909[_0xb3d4('0x44')];if(!_0x5b8128['query'][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x1d6711[_0xb3d4('0x23')]=qs[_0xb3d4('0x23')](_0x5b8128['query'][_0xb3d4('0x23')]);_0x1d6711[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x5b8128['query'][_0xb3d4('0x22')]);}return _0x249809['getLists'](_0x1d6711);}})['then'](function(_0x571c73){if(_0x571c73){return _0x571c73?{'count':_0x328aa9,'rows':_0x571c73}:null;}})['then'](respondWithResult(_0x40395c,null))['catch'](handleError(_0x40395c,null));};exports['addLists']=function(_0x379457,_0x249390,_0x85715f){var _0x3f5593=moment()[_0xb3d4('0x80')](_0xb3d4('0xa1'));var _0x6c83de,_0x20ffe5;return db['VoiceQueue'][_0xb3d4('0x32')]({'where':{'id':_0x379457[_0xb3d4('0x52')]['id']}})['then'](handleEntityNotFound(_0x249390,null))[_0xb3d4('0x2a')](function(_0x1464a4){if(_0x1464a4){_0x20ffe5=_0x1464a4;return _0x1464a4[_0xb3d4('0xa2')](_0x379457[_0xb3d4('0x56')][_0xb3d4('0x85')],_['omit'](_0x379457[_0xb3d4('0x56')],[_0xb3d4('0x85'),'id'])||{});}return null;})[_0xb3d4('0x99')](function(_0x53a673){var _0x48d014;_0x6c83de=_0x53a673||[];var _0x25da1d=[];if(_0x53a673){for(var _0x83ac6b=0x0;_0x83ac6b<_0x53a673[_0xb3d4('0x44')];_0x83ac6b+=0x1){var _0x48ec71=_0x53a673[_0x83ac6b][_0xb3d4('0x2b')]({'plain':!![]});_0x20ffe5[_0xb3d4('0xa3')]=_0x379457[_0xb3d4('0x56')]['dialCheckDuplicateType']?_0x379457[_0xb3d4('0x56')][_0xb3d4('0xa3')]:_0x20ffe5[_0xb3d4('0xa3')];switch(_0x20ffe5[_0xb3d4('0xa3')]){case'always':_0x48d014=squel[_0xb3d4('0xa4')]()[_0xb3d4('0xa5')](_0xb3d4('0xa6'))[_0xb3d4('0xa7')]([_0xb3d4('0xa8'),_0xb3d4('0xa9'),_0xb3d4('0xaa'),_0xb3d4('0xab'),_0xb3d4('0x65'),_0xb3d4('0x5f'),_0xb3d4('0x60')],squel[_0xb3d4('0xac')]()['field'](_0xb3d4('0xa8'),'phone')[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0xa9'))[_0xb3d4('0x86')]('id',_0xb3d4('0xaa'))[_0xb3d4('0x86')](_0x48ec71[_0xb3d4('0xad')][_0xb3d4('0x90')](),_0xb3d4('0xab'))['field'](_0x379457['params']['id'][_0xb3d4('0x90')](),_0xb3d4('0x65'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x5f'))['field']('\x27'+_0x3f5593+'\x27',_0xb3d4('0x60'))[_0xb3d4('0x88')]('cm_contacts')['where'](_0xb3d4('0xae'))[_0xb3d4('0x4a')](_0xb3d4('0xaf'),_0x48ec71[_0xb3d4('0xad')][_0xb3d4('0x90')]())[_0xb3d4('0x4a')](_0xb3d4('0xb0'))[_0xb3d4('0x4a')](_0xb3d4('0xb1'),squel[_0xb3d4('0xac')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xb3d4('0x88')](_0xb3d4('0xb2'))[_0xb3d4('0x4a')](_0xb3d4('0x8d'),_0x379457[_0xb3d4('0x52')]['id']['toString']()))[_0xb3d4('0x4a')](_0xb3d4('0xb1'),squel['select']()[_0xb3d4('0x86')](_0xb3d4('0xb3'))[_0xb3d4('0x88')](_0xb3d4('0xa6'))[_0xb3d4('0x4a')]('VoiceQueueId\x20=\x20?',_0x379457[_0xb3d4('0x52')]['id'][_0xb3d4('0x90')]())))[_0xb3d4('0x90')]();break;case _0xb3d4('0xb4'):_0x48d014=squel[_0xb3d4('0xa4')]()[_0xb3d4('0xa5')]('cm_hopper')[_0xb3d4('0xa7')]([_0xb3d4('0xa8'),'scheduledAt',_0xb3d4('0xaa'),_0xb3d4('0xab'),_0xb3d4('0x65'),_0xb3d4('0x5f'),_0xb3d4('0x60')],squel[_0xb3d4('0xac')]()[_0xb3d4('0x86')](_0xb3d4('0xa8'),'phone')[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0xa9'))[_0xb3d4('0x86')]('id',_0xb3d4('0xaa'))[_0xb3d4('0x86')](_0x48ec71['CmListId'][_0xb3d4('0x90')](),_0xb3d4('0xab'))[_0xb3d4('0x86')](_0x379457[_0xb3d4('0x52')]['id']['toString'](),_0xb3d4('0x65'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x5f'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x60'))[_0xb3d4('0x88')](_0xb3d4('0xb5'))[_0xb3d4('0x4a')](_0xb3d4('0xae'))[_0xb3d4('0x4a')](_0xb3d4('0xaf'),_0x48ec71['CmListId'][_0xb3d4('0x90')]())[_0xb3d4('0x4a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb3d4('0xb1'),squel[_0xb3d4('0xac')]()[_0xb3d4('0x86')](_0xb3d4('0xb3'))[_0xb3d4('0x88')](_0xb3d4('0xa6'))[_0xb3d4('0x4a')](_0xb3d4('0x8d'),_0x379457[_0xb3d4('0x52')]['id'][_0xb3d4('0x90')]())))[_0xb3d4('0x90')]();break;default:_0x48d014=squel['insert']()[_0xb3d4('0xa5')](_0xb3d4('0xa6'))[_0xb3d4('0xa7')]([_0xb3d4('0xa8'),_0xb3d4('0xa9'),_0xb3d4('0xaa'),_0xb3d4('0xab'),'VoiceQueueId',_0xb3d4('0x5f'),_0xb3d4('0x60')],squel[_0xb3d4('0xac')]()['field'](_0xb3d4('0xa8'),_0xb3d4('0xa8'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27','scheduledAt')[_0xb3d4('0x86')]('id',_0xb3d4('0xaa'))[_0xb3d4('0x86')](_0x48ec71[_0xb3d4('0xad')]['toString'](),_0xb3d4('0xab'))[_0xb3d4('0x86')](_0x379457[_0xb3d4('0x52')]['id']['toString'](),_0xb3d4('0x65'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x5f'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x60'))['from']('cm_contacts')[_0xb3d4('0x4a')](_0xb3d4('0xae'))[_0xb3d4('0x4a')](_0xb3d4('0xaf'),_0x48ec71[_0xb3d4('0xad')][_0xb3d4('0x90')]())[_0xb3d4('0x4a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x25da1d[_0xb3d4('0x8f')](db['sequelize'][_0xb3d4('0x3f')](_0x48d014));}return BPromise['all'](_0x25da1d);}})['then'](function(){var _0x30a21b=[];var _0x234a9b=squel[_0xb3d4('0xa4')]()[_0xb3d4('0xa5')](_0xb3d4('0xb6'))[_0xb3d4('0xa7')]([_0xb3d4('0xb7'),_0xb3d4('0xa8'),_0xb3d4('0xb8'),'createdAt',_0xb3d4('0x60')],squel[_0xb3d4('0xac')]()[_0xb3d4('0x86')](_0xb3d4('0xb9'))[_0xb3d4('0x86')](_0xb3d4('0xba'))['field'](_0xb3d4('0xbb'))[_0xb3d4('0x86')]('\x27'+_0x3f5593+'\x27',_0xb3d4('0x5f'))['field']('\x27'+_0x3f5593+'\x27','updatedAt')[_0xb3d4('0x88')](_0xb3d4('0xbc'),'ci')['join'](_0xb3d4('0xa6'),'h',_0xb3d4('0xbd'))['where'](_0xb3d4('0xbe'),_0x3f5593)[_0xb3d4('0x4a')]('ci.ItemClass=?','PHONE'))[_0xb3d4('0x90')]();_0x30a21b['push'](db['sequelize']['query'](_0x234a9b));return BPromise[_0xb3d4('0x94')](_0x30a21b);})[_0xb3d4('0x2a')](function(){return _0x6c83de;})[_0xb3d4('0x2a')](respondWithResult(_0x249390,null))[_0xb3d4('0x54')](handleError(_0x249390,null));};exports[_0xb3d4('0xbf')]=function(_0x4e2872,_0x33800d,_0x5c6a4b){return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x4e2872['params']['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x33800d,null))[_0xb3d4('0x2a')](function(_0x4e6983){if(_0x4e6983){return _0x4e6983['removeLists'](_0x4e2872[_0xb3d4('0x3f')][_0xb3d4('0x85')]);}})[_0xb3d4('0x2a')](function(_0x23f39a){if(_0x23f39a){return db['CmHopper'][_0xb3d4('0x34')]({'where':{'ListId':_0x4e2872['query'][_0xb3d4('0x85')],'VoiceQueueId':_0x4e2872['params']['id']}})['then'](function(){return _0x23f39a;});}})['then'](respondWithStatusCode(_0x33800d,null))[_0xb3d4('0x54')](handleError(_0x33800d,null));};exports['getBlackLists']=function(_0x529138,_0x4d07eb,_0x13e50c){var _0x23dbf2={};var _0x4cf2df={};var _0x13d8e9;var _0x4dbea6;return db['VoiceQueue'][_0xb3d4('0x63')]({'where':{'id':_0x529138[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x4d07eb,null))[_0xb3d4('0x2a')](function(_0x319c21){if(_0x319c21){_0x13d8e9=_0x319c21;_0x4cf2df[_0xb3d4('0x3c')]=_['keys'](db['CmList'][_0xb3d4('0x53')]);_0x4cf2df[_0xb3d4('0x3f')]=_[_0xb3d4('0x3e')](_0x529138[_0xb3d4('0x3f')]);_0x4cf2df[_0xb3d4('0x40')]=_['intersection'](_0x4cf2df[_0xb3d4('0x3c')],_0x4cf2df[_0xb3d4('0x3f')]);_0x23dbf2[_0xb3d4('0x42')]=_['intersection'](_0x4cf2df['model'],qs['fields'](_0x529138['query'][_0xb3d4('0x43')]));_0x23dbf2[_0xb3d4('0x42')]=_0x23dbf2[_0xb3d4('0x42')][_0xb3d4('0x44')]?_0x23dbf2['attributes']:_0x4cf2df[_0xb3d4('0x3c')];_0x23dbf2[_0xb3d4('0x47')]=qs[_0xb3d4('0x48')](_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x48')]);_0x23dbf2[_0xb3d4('0x4a')]=qs[_0xb3d4('0x40')](_['pick'](_0x529138[_0xb3d4('0x3f')],_0x4cf2df[_0xb3d4('0x40')]));if(_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x2e')]){_0x23dbf2[_0xb3d4('0x4a')]=_[_0xb3d4('0x4b')](_0x23dbf2[_0xb3d4('0x4a')],{'$or':_['map'](_0x23dbf2['attributes'],function(_0x313a53){var _0x121577={};_0x121577[_0x313a53]={'$like':'%'+_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x2e')]+'%'};return _0x121577;})});}_0x23dbf2=_['merge']({},_0x23dbf2,_0x529138[_0xb3d4('0x4d')]);return _0x13d8e9[_0xb3d4('0xc0')](_0x23dbf2);}})[_0xb3d4('0x2a')](function(_0x529c32){if(_0x529c32){_0x4dbea6=_0x529c32[_0xb3d4('0x44')];if(!_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x45')](_0xb3d4('0x46'))){_0x23dbf2[_0xb3d4('0x23')]=qs['limit'](_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x23')]);_0x23dbf2['offset']=qs[_0xb3d4('0x22')](_0x529138[_0xb3d4('0x3f')][_0xb3d4('0x22')]);}return _0x13d8e9[_0xb3d4('0xc0')](_0x23dbf2);}})[_0xb3d4('0x2a')](function(_0x160239){if(_0x160239){return _0x160239?{'count':_0x4dbea6,'rows':_0x160239}:null;}})[_0xb3d4('0x2a')](respondWithResult(_0x4d07eb,null))[_0xb3d4('0x54')](handleError(_0x4d07eb,null));};exports[_0xb3d4('0xc1')]=function(_0x5d4972,_0x21f45f,_0x653a83){var _0x2d98b0,_0x2dd52a;return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x5d4972[_0xb3d4('0x52')]['id']}})['then'](handleEntityNotFound(_0x21f45f,null))[_0xb3d4('0x2a')](function(_0x38be37){if(_0x38be37){_0x2dd52a=_0x38be37;return _0x38be37[_0xb3d4('0xc1')](_0x5d4972[_0xb3d4('0x56')][_0xb3d4('0x85')],_[_0xb3d4('0x5e')](_0x5d4972['body'],['ids','id'])||{});}return null;})['spread'](function(_0x2908f5){var _0x51031e;_0x2d98b0=_0x2908f5||[];var _0x5dde9a=[];if(_0x2908f5){for(var _0x23815d=0x0;_0x23815d<_0x2908f5[_0xb3d4('0x44')];_0x23815d+=0x1){var _0x408a4b=_0x2908f5[_0x23815d][_0xb3d4('0x2b')]({'plain':!![]});_0x51031e=squel[_0xb3d4('0xa4')]()[_0xb3d4('0xa5')](_0xb3d4('0xc2'))['fromQuery'](['phone',_0xb3d4('0xaa'),_0xb3d4('0xab'),_0xb3d4('0x65'),_0xb3d4('0x5f'),_0xb3d4('0x60')],squel[_0xb3d4('0xac')]()['field'](_0xb3d4('0xa8'),_0xb3d4('0xa8'))[_0xb3d4('0x86')]('id',_0xb3d4('0xaa'))[_0xb3d4('0x86')](_0x408a4b[_0xb3d4('0xad')][_0xb3d4('0x90')](),'ListId')[_0xb3d4('0x86')](_0x5d4972[_0xb3d4('0x52')]['id'][_0xb3d4('0x90')](),_0xb3d4('0x65'))['field'](_0xb3d4('0xc3'),_0xb3d4('0x5f'))[_0xb3d4('0x86')](_0xb3d4('0xc3'),_0xb3d4('0x60'))['from'](_0xb3d4('0xb5'))['where'](_0xb3d4('0xae'))[_0xb3d4('0x4a')](_0xb3d4('0xaf'),_0x408a4b['CmListId'][_0xb3d4('0x90')]())[_0xb3d4('0x4a')]('phone\x20IS\x20NOT\x20NULL'))[_0xb3d4('0x90')]();_0x5dde9a['push'](db['sequelize']['query'](_0x51031e));}return BPromise[_0xb3d4('0x94')](_0x5dde9a);}})[_0xb3d4('0x2a')](function(){return _0x2d98b0;})[_0xb3d4('0x2a')](respondWithResult(_0x21f45f,null))['catch'](handleError(_0x21f45f,null));};exports['removeBlackLists']=function(_0x27176c,_0x2b0bc8,_0x83083c){return db[_0xb3d4('0x39')][_0xb3d4('0x32')]({'where':{'id':_0x27176c[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](handleEntityNotFound(_0x2b0bc8,null))['then'](function(_0x49b9ae){if(_0x49b9ae){return _0x49b9ae[_0xb3d4('0xc4')](_0x27176c['query'][_0xb3d4('0x85')]);}})['then'](function(_0x41a2f7){if(_0x41a2f7){return db['CmHopperBlack'][_0xb3d4('0x34')]({'where':{'ListId':_0x27176c['query'][_0xb3d4('0x85')],'VoiceQueueId':_0x27176c[_0xb3d4('0x52')]['id']}})[_0xb3d4('0x2a')](function(){return _0x41a2f7;});}})[_0xb3d4('0x2a')](respondWithStatusCode(_0x2b0bc8,null))[_0xb3d4('0x54')](handleError(_0x2b0bc8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b4e3cf9..af12dc2 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 _0xad71=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x209fd3,_0x1064cc){var _0x20f0f5=function(_0x4f38ca){while(--_0x4f38ca){_0x209fd3['push'](_0x209fd3['shift']());}};_0x20f0f5(++_0x1064cc);}(_0xad71,0x6a));var _0x1ad7=function(_0x495d23,_0x595c81){_0x495d23=_0x495d23-0x0;var _0x336a7e=_0xad71[_0x495d23];return _0x336a7e;};'use strict';var EventEmitter=require(_0x1ad7('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1ad7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ad7('0x2'),'afterDestroy':_0x1ad7('0x3')};function emitEvent(_0x5140d5){return function(_0x2812a7,_0x12bbc1,_0x2f04eb){VoiceQueueEvents['emit'](_0x5140d5+':'+_0x2812a7['id'],_0x2812a7);VoiceQueueEvents[_0x1ad7('0x4')](_0x5140d5,_0x2812a7);_0x2f04eb(null);};}for(var e in events){if(events[_0x1ad7('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x1ad7('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x1c93=['hook','exports','events','VoiceQueue','update','remove','hasOwnProperty'];(function(_0x34ef6d,_0x2e13f8){var _0x2b21ff=function(_0x58d51e){while(--_0x58d51e){_0x34ef6d['push'](_0x34ef6d['shift']());}};_0x2b21ff(++_0x2e13f8);}(_0x1c93,0x95));var _0x31c9=function(_0x916773,_0x52adca){_0x916773=_0x916773-0x0;var _0x43f3d6=_0x1c93[_0x916773];return _0x43f3d6;};'use strict';var EventEmitter=require(_0x31c9('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x31c9('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x31c9('0x2'),'afterDestroy':_0x31c9('0x3')};function emitEvent(_0x3fe794){return function(_0x3d53a4,_0x3b30e0,_0x24ab55){VoiceQueueEvents['emit'](_0x3fe794+':'+_0x3d53a4['id'],_0x3d53a4);VoiceQueueEvents['emit'](_0x3fe794,_0x3d53a4);_0x24ab55(null);};}for(var e in events){if(events[_0x31c9('0x4')](e)){var event=events[e];VoiceQueue[_0x31c9('0x5')](e,emitEvent(event));}}module[_0x31c9('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index ca84a30..cdcbbf1 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x506bb9,_0x917b8a){var _0x1a4849=function(_0x34f6e9){while(--_0x34f6e9){_0x506bb9['push'](_0x506bb9['shift']());}};_0x1a4849(++_0x917b8a);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x2e14bf,_0x3af516){var _0x1f7d7b=function(_0x1a8a6e){while(--_0x1a8a6e){_0x2e14bf['push'](_0x2e14bf['shift']());}};_0x1f7d7b(++_0x3af516);}(_0x3e74,0x175));var _0x43e7=function(_0x2a8e5b,_0x377ba6){_0x2a8e5b=_0x2a8e5b-0x0;var _0xaa3a0b=_0x3e74[_0x2a8e5b];return _0xaa3a0b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 00da790..083071d 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 _0xbf0d=['then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','model','include','catch','ShowVoiceQueue'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xbf0d,0x198));var _0xdbf0=function(_0x397fee,_0xa60cd){_0x397fee=_0x397fee-0x0;var _0x580b06=_0xbf0d[_0x397fee];return _0x580b06;};'use strict';var _=require(_0xdbf0('0x0'));var util=require(_0xdbf0('0x1'));var moment=require('moment');var BPromise=require(_0xdbf0('0x2'));var rs=require(_0xdbf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbf0('0x4'))['db'];var utils=require(_0xdbf0('0x5'));var logger=require(_0xdbf0('0x6'))(_0xdbf0('0x7'));var config=require('../../config/environment');var jayson=require(_0xdbf0('0x8'));var client=jayson[_0xdbf0('0x9')]['http']({'port':0x232a});config[_0xdbf0('0xa')]=_['defaults'](config[_0xdbf0('0xa')],{'host':_0xdbf0('0xb'),'port':0x18eb});var socket=require(_0xdbf0('0xc'))(new Redis(config['redis']));require(_0xdbf0('0xd'))[_0xdbf0('0xe')](socket);function respondWithRpcPromise(_0x198612,_0x175691,_0x191167){return new BPromise(function(_0xa0aabe,_0x53be9f){return client['request'](_0x198612,_0x191167)['then'](function(_0x232bcf){logger[_0xdbf0('0xf')](_0xdbf0('0x10'),_0x175691,_0xdbf0('0x11'));logger[_0xdbf0('0x12')](_0xdbf0('0x13'),_0x175691,_0xdbf0('0x11'),JSON[_0xdbf0('0x14')](_0x232bcf));if(_0x232bcf[_0xdbf0('0x15')]){if(_0x232bcf[_0xdbf0('0x15')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x175691,_0x232bcf[_0xdbf0('0x15')][_0xdbf0('0x16')]);return _0x53be9f(_0x232bcf[_0xdbf0('0x15')][_0xdbf0('0x16')]);}logger[_0xdbf0('0x15')](_0xdbf0('0x10'),_0x175691,_0x232bcf[_0xdbf0('0x15')]['message']);return _0xa0aabe(_0x232bcf[_0xdbf0('0x15')]['message']);}else{logger['info'](_0xdbf0('0x10'),_0x175691,'request\x20sent');_0xa0aabe(_0x232bcf['result']['message']);}})['catch'](function(_0x5810cf){logger['error'](_0xdbf0('0x10'),_0x175691,_0x5810cf);_0x53be9f(_0x5810cf);});});}exports[_0xdbf0('0x17')]=function(_0x2c85ef){var _0x332832=this;return new Promise(function(_0x242556,_0x3bafd3){return db[_0xdbf0('0x18')][_0xdbf0('0x19')]({'raw':_0x2c85ef[_0xdbf0('0x1a')]?_0x2c85ef[_0xdbf0('0x1a')][_0xdbf0('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c85ef[_0xdbf0('0x1a')]?_0x2c85ef['options'][_0xdbf0('0x1c')]||null:null,'attributes':_0x2c85ef[_0xdbf0('0x1a')]?_0x2c85ef['options'][_0xdbf0('0x1d')]||null:null,'limit':_0x2c85ef[_0xdbf0('0x1a')]?_0x2c85ef[_0xdbf0('0x1a')][_0xdbf0('0x1e')]||null:null,'include':_0x2c85ef[_0xdbf0('0x1a')]?_0x2c85ef[_0xdbf0('0x1a')]['include']?_[_0xdbf0('0x1f')](_0x2c85ef[_0xdbf0('0x1a')]['include'],function(_0x41341a){return{'model':db[_0x41341a[_0xdbf0('0x20')]],'as':_0x41341a['as'],'attributes':_0x41341a['attributes'],'include':_0x41341a[_0xdbf0('0x21')]?_[_0xdbf0('0x1f')](_0x41341a['include'],function(_0x2f4c94){return{'model':db[_0x2f4c94['model']],'as':_0x2f4c94['as'],'attributes':_0x2f4c94['attributes'],'include':_0x2f4c94[_0xdbf0('0x21')]?_[_0xdbf0('0x1f')](_0x2f4c94[_0xdbf0('0x21')],function(_0x1f0c00){return{'model':db[_0x1f0c00[_0xdbf0('0x20')]],'as':_0x1f0c00['as'],'attributes':_0x1f0c00['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56dac3){logger[_0xdbf0('0xf')](_0xdbf0('0x17'),_0x2c85ef);logger[_0xdbf0('0x12')](_0xdbf0('0x17'),_0x2c85ef,JSON[_0xdbf0('0x14')](_0x56dac3));_0x242556(_0x56dac3);})[_0xdbf0('0x22')](function(_0x1f362a){logger[_0xdbf0('0x15')](_0xdbf0('0x17'),_0x1f362a[_0xdbf0('0x16')],_0x2c85ef);_0x3bafd3(_0x332832[_0xdbf0('0x15')](0x1f4,_0x1f362a[_0xdbf0('0x16')]));});});};exports[_0xdbf0('0x23')]=function(_0x2fa6f4){var _0xfc912e=this;return new Promise(function(_0x2210e3,_0x14fd1d){return db['VoiceQueue']['find']({'raw':_0x2fa6f4['options']?_0x2fa6f4[_0xdbf0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2fa6f4[_0xdbf0('0x1a')]?_0x2fa6f4[_0xdbf0('0x1a')][_0xdbf0('0x1c')]||null:null,'attributes':_0x2fa6f4[_0xdbf0('0x1a')]?_0x2fa6f4[_0xdbf0('0x1a')]['attributes']||null:null,'include':_0x2fa6f4['options']?_0x2fa6f4['options'][_0xdbf0('0x21')]?_[_0xdbf0('0x1f')](_0x2fa6f4[_0xdbf0('0x1a')][_0xdbf0('0x21')],function(_0x50a74f){return{'model':db[_0x50a74f['model']],'as':_0x50a74f['as'],'attributes':_0x50a74f[_0xdbf0('0x1d')],'include':_0x50a74f['include']?_[_0xdbf0('0x1f')](_0x50a74f[_0xdbf0('0x21')],function(_0x56a6e3){return{'model':db[_0x56a6e3['model']],'as':_0x56a6e3['as'],'attributes':_0x56a6e3[_0xdbf0('0x1d')],'include':_0x56a6e3['include']?_[_0xdbf0('0x1f')](_0x56a6e3[_0xdbf0('0x21')],function(_0xac0500){return{'model':db[_0xac0500['model']],'as':_0xac0500['as'],'attributes':_0xac0500['attributes']};}):[]};}):[]};}):[]:[]})[_0xdbf0('0x24')](function(_0x52f1ae){logger[_0xdbf0('0xf')](_0xdbf0('0x23'),_0x2fa6f4);logger[_0xdbf0('0x12')](_0xdbf0('0x23'),_0x2fa6f4,JSON[_0xdbf0('0x14')](_0x52f1ae));_0x2210e3(_0x52f1ae);})[_0xdbf0('0x22')](function(_0x518dc3){logger[_0xdbf0('0x15')](_0xdbf0('0x23'),_0x518dc3[_0xdbf0('0x16')],_0x2fa6f4);_0x14fd1d(_0xfc912e[_0xdbf0('0x15')](0x1f4,_0x518dc3[_0xdbf0('0x16')]));});});}; \ No newline at end of file +var _0xca33=['request\x20sent','error','code','message','result','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','stringify','catch','ShowVoiceQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca33,0xa9));var _0x3ca3=function(_0x2ef1b9,_0x451ab5){_0x2ef1b9=_0x2ef1b9-0x0;var _0x2c439c=_0xca33[_0x2ef1b9];return _0x2c439c;};'use strict';var _=require(_0x3ca3('0x0'));var util=require(_0x3ca3('0x1'));var moment=require('moment');var BPromise=require(_0x3ca3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ca3('0x3'));var db=require(_0x3ca3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ca3('0x5'));var config=require(_0x3ca3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3ca3('0x7')]['http']({'port':0x232a});config['redis']=_[_0x3ca3('0x8')](config[_0x3ca3('0x9')],{'host':_0x3ca3('0xa'),'port':0x18eb});var socket=require(_0x3ca3('0xb'))(new Redis(config[_0x3ca3('0x9')]));require(_0x3ca3('0xc'))['register'](socket);function respondWithRpcPromise(_0x14f697,_0x47fd38,_0x283c41){return new BPromise(function(_0x2b970d,_0x4c78ed){return client[_0x3ca3('0xd')](_0x14f697,_0x283c41)[_0x3ca3('0xe')](function(_0x2ab7aa){logger['info'](_0x3ca3('0xf'),_0x47fd38,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x47fd38,_0x3ca3('0x10'),JSON['stringify'](_0x2ab7aa));if(_0x2ab7aa['error']){if(_0x2ab7aa[_0x3ca3('0x11')][_0x3ca3('0x12')]===0x1f4){logger[_0x3ca3('0x11')](_0x3ca3('0xf'),_0x47fd38,_0x2ab7aa[_0x3ca3('0x11')][_0x3ca3('0x13')]);return _0x4c78ed(_0x2ab7aa['error'][_0x3ca3('0x13')]);}logger[_0x3ca3('0x11')](_0x3ca3('0xf'),_0x47fd38,_0x2ab7aa[_0x3ca3('0x11')]['message']);return _0x2b970d(_0x2ab7aa[_0x3ca3('0x11')][_0x3ca3('0x13')]);}else{logger['info'](_0x3ca3('0xf'),_0x47fd38,_0x3ca3('0x10'));_0x2b970d(_0x2ab7aa[_0x3ca3('0x14')][_0x3ca3('0x13')]);}})['catch'](function(_0x103c9c){logger[_0x3ca3('0x11')](_0x3ca3('0xf'),_0x47fd38,_0x103c9c);_0x4c78ed(_0x103c9c);});});}exports[_0x3ca3('0x15')]=function(_0x1fda9f){var _0x5c6ea6=this;return new Promise(function(_0x36261a,_0x4db96b){return db['VoiceQueue'][_0x3ca3('0x16')]({'raw':_0x1fda9f[_0x3ca3('0x17')]?_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x18')]===undefined?!![]:![]:!![],'where':_0x1fda9f[_0x3ca3('0x17')]?_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x19')]||null:null,'attributes':_0x1fda9f['options']?_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x1a')]||null:null,'limit':_0x1fda9f[_0x3ca3('0x17')]?_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x1b')]||null:null,'include':_0x1fda9f['options']?_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x1c')]?_[_0x3ca3('0x1d')](_0x1fda9f[_0x3ca3('0x17')][_0x3ca3('0x1c')],function(_0x3c07a5){return{'model':db[_0x3c07a5[_0x3ca3('0x1e')]],'as':_0x3c07a5['as'],'attributes':_0x3c07a5[_0x3ca3('0x1a')],'include':_0x3c07a5[_0x3ca3('0x1c')]?_[_0x3ca3('0x1d')](_0x3c07a5[_0x3ca3('0x1c')],function(_0xcd2c48){return{'model':db[_0xcd2c48['model']],'as':_0xcd2c48['as'],'attributes':_0xcd2c48[_0x3ca3('0x1a')],'include':_0xcd2c48['include']?_[_0x3ca3('0x1d')](_0xcd2c48[_0x3ca3('0x1c')],function(_0x37c4f3){return{'model':db[_0x37c4f3[_0x3ca3('0x1e')]],'as':_0x37c4f3['as'],'attributes':_0x37c4f3[_0x3ca3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56dd1d){logger[_0x3ca3('0x1f')](_0x3ca3('0x15'),_0x1fda9f);logger[_0x3ca3('0x20')](_0x3ca3('0x15'),_0x1fda9f,JSON[_0x3ca3('0x21')](_0x56dd1d));_0x36261a(_0x56dd1d);})[_0x3ca3('0x22')](function(_0x3567f7){logger[_0x3ca3('0x11')](_0x3ca3('0x15'),_0x3567f7[_0x3ca3('0x13')],_0x1fda9f);_0x4db96b(_0x5c6ea6[_0x3ca3('0x11')](0x1f4,_0x3567f7[_0x3ca3('0x13')]));});});};exports[_0x3ca3('0x23')]=function(_0x49821f){var _0x1fb934=this;return new Promise(function(_0x26f2f6,_0x32a15e){return db['VoiceQueue'][_0x3ca3('0x24')]({'raw':_0x49821f['options']?_0x49821f['options'][_0x3ca3('0x18')]===undefined?!![]:![]:!![],'where':_0x49821f[_0x3ca3('0x17')]?_0x49821f[_0x3ca3('0x17')]['where']||null:null,'attributes':_0x49821f[_0x3ca3('0x17')]?_0x49821f[_0x3ca3('0x17')][_0x3ca3('0x1a')]||null:null,'include':_0x49821f['options']?_0x49821f[_0x3ca3('0x17')][_0x3ca3('0x1c')]?_[_0x3ca3('0x1d')](_0x49821f[_0x3ca3('0x17')][_0x3ca3('0x1c')],function(_0x1bd2f3){return{'model':db[_0x1bd2f3[_0x3ca3('0x1e')]],'as':_0x1bd2f3['as'],'attributes':_0x1bd2f3['attributes'],'include':_0x1bd2f3[_0x3ca3('0x1c')]?_[_0x3ca3('0x1d')](_0x1bd2f3[_0x3ca3('0x1c')],function(_0x233448){return{'model':db[_0x233448['model']],'as':_0x233448['as'],'attributes':_0x233448[_0x3ca3('0x1a')],'include':_0x233448[_0x3ca3('0x1c')]?_['map'](_0x233448['include'],function(_0x51cd61){return{'model':db[_0x51cd61['model']],'as':_0x51cd61['as'],'attributes':_0x51cd61[_0x3ca3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3ca3('0xe')](function(_0x525539){logger['info'](_0x3ca3('0x23'),_0x49821f);logger[_0x3ca3('0x20')](_0x3ca3('0x23'),_0x49821f,JSON[_0x3ca3('0x21')](_0x525539));_0x26f2f6(_0x525539);})[_0x3ca3('0x22')](function(_0x4bc62d){logger['error']('ShowVoiceQueue',_0x4bc62d[_0x3ca3('0x13')],_0x49821f);_0x32a15e(_0x1fb934['error'](0x1f4,_0x4bc62d[_0x3ca3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 26c5421..a813bcc 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 _0xc640=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x437c6f,_0x295fff){var _0x55b370=function(_0x213c80){while(--_0x213c80){_0x437c6f['push'](_0x437c6f['shift']());}};_0x55b370(++_0x295fff);}(_0xc640,0xa6));var _0x0c64=function(_0xd20564,_0x3d724c){_0xd20564=_0xd20564-0x0;var _0x2b8f4a=_0xc640[_0xd20564];return _0x2b8f4a;};'use strict';var VoiceQueueEvents=require(_0x0c64('0x0'));var events=[_0x0c64('0x1'),_0x0c64('0x2'),_0x0c64('0x3')];function createListener(_0x33b975,_0x301992){return function(_0x57de3b){_0x301992[_0x0c64('0x4')](_0x33b975,_0x57de3b);};}function removeListener(_0x4ccdf4,_0x46650e){return function(){VoiceQueueEvents[_0x0c64('0x5')](_0x4ccdf4,_0x46650e);};}exports[_0x0c64('0x6')]=function(_0x1cc84a){for(var _0x1024c9=0x0,_0x182783=events[_0x0c64('0x7')];_0x1024c9<_0x182783;_0x1024c9++){var _0x3f0819=events[_0x1024c9];var _0x2a5d54=createListener(_0x0c64('0x8')+_0x3f0819,_0x1cc84a);VoiceQueueEvents['on'](_0x3f0819,_0x2a5d54);}}; \ No newline at end of file +var _0x0835=['length','./voiceQueue.events','save','remove','update','removeListener','register'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x0835,0xf6));var _0x5083=function(_0x461570,_0x560b1d){_0x461570=_0x461570-0x0;var _0x5f3837=_0x0835[_0x461570];return _0x5f3837;};'use strict';var VoiceQueueEvents=require(_0x5083('0x0'));var events=[_0x5083('0x1'),_0x5083('0x2'),_0x5083('0x3')];function createListener(_0x75623,_0x176636){return function(_0x367269){_0x176636['emit'](_0x75623,_0x367269);};}function removeListener(_0x1aed81,_0xaecba0){return function(){VoiceQueueEvents[_0x5083('0x4')](_0x1aed81,_0xaecba0);};}exports[_0x5083('0x5')]=function(_0x33fcc5){for(var _0x4ec04c=0x0,_0x4ee0ae=events[_0x5083('0x6')];_0x4ec04c<_0x4ee0ae;_0x4ec04c++){var _0x249feb=events[_0x4ec04c];var _0x4a6759=createListener('voiceQueue:'+_0x249feb,_0x33fcc5);VoiceQueueEvents['on'](_0x249feb,_0x4a6759);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 5705af1..7f44eca 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 _0xba4f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba4f,0xfc));var _0xfba4=function(_0x1e6843,_0x5dd969){_0x1e6843=_0x1e6843-0x0;var _0x1171f7=_0xba4f[_0x1e6843];return _0x1171f7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfba4('0x0'));var router=express[_0xfba4('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfba4('0x2'));var interaction=require(_0xfba4('0x3'));var config=require(_0xfba4('0x4'));var controller=require('./voiceQueueReport.controller');router[_0xfba4('0x5')]('/',auth[_0xfba4('0x6')](),controller[_0xfba4('0x7')]);router[_0xfba4('0x5')](_0xfba4('0x8'),auth[_0xfba4('0x6')](),controller[_0xfba4('0x9')]);router[_0xfba4('0x5')](_0xfba4('0xa'),auth[_0xfba4('0x6')](),controller[_0xfba4('0xb')]);router[_0xfba4('0x5')](_0xfba4('0xc'),auth[_0xfba4('0x6')](),controller['show']);router[_0xfba4('0xd')]('/',auth[_0xfba4('0x6')](),controller[_0xfba4('0xe')]);router[_0xfba4('0xf')](_0xfba4('0xc'),auth[_0xfba4('0x6')](),controller[_0xfba4('0x10')]);router['delete'](_0xfba4('0xc'),auth[_0xfba4('0x6')](),controller[_0xfba4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x424b=['post','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id'];(function(_0x51b1a9,_0xc3c265){var _0xb0dac5=function(_0x3aab5f){while(--_0x3aab5f){_0x51b1a9['push'](_0x51b1a9['shift']());}};_0xb0dac5(++_0xc3c265);}(_0x424b,0x8a));var _0xb424=function(_0xedd5a2,_0x331e9a){_0xedd5a2=_0xedd5a2-0x0;var _0x260bbb=_0x424b[_0xedd5a2];return _0x260bbb;};'use strict';var multer=require('multer');var util=require(_0xb424('0x0'));var path=require(_0xb424('0x1'));var timeout=require(_0xb424('0x2'));var express=require(_0xb424('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb424('0x4'));var interaction=require(_0xb424('0x5'));var config=require(_0xb424('0x6'));var controller=require('./voiceQueueReport.controller');router[_0xb424('0x7')]('/',auth[_0xb424('0x8')](),controller[_0xb424('0x9')]);router[_0xb424('0x7')](_0xb424('0xa'),auth[_0xb424('0x8')](),controller[_0xb424('0xb')]);router['get']('/index',auth[_0xb424('0x8')](),controller[_0xb424('0xc')]);router[_0xb424('0x7')](_0xb424('0xd'),auth[_0xb424('0x8')](),controller['show']);router[_0xb424('0xe')]('/',auth[_0xb424('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb424('0xf')]);router[_0xb424('0x10')](_0xb424('0xd'),auth[_0xb424('0x8')](),controller[_0xb424('0x11')]);module[_0xb424('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 3c21e75..0ccf38b 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 _0xf38a=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','format','diff','seconds','setDataValue','INTEGER'];(function(_0x3fa1e1,_0x4e39f0){var _0x1cc2ad=function(_0x3f6d4d){while(--_0x3f6d4d){_0x3fa1e1['push'](_0x3fa1e1['shift']());}};_0x1cc2ad(++_0x4e39f0);}(_0xf38a,0x13b));var _0xaf38=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xf38a[_0x4b4d43];return _0x5706ba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaf38('0x0'));module[_0xaf38('0x1')]={'type':{'type':Sequelize[_0xaf38('0x2')]},'uniqueid':{'type':Sequelize[_0xaf38('0x2')]},'calleridnum':{'type':Sequelize[_0xaf38('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xaf38('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xaf38('0x3')],'set':function(_0x29816a){var _0x37cf9a=moment(_0x29816a);var _0x42c99a=moment(this['getDataValue'](_0xaf38('0x4')))[_0xaf38('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5b0486=_0x37cf9a[_0xaf38('0x6')](_0x42c99a,_0xaf38('0x7'));this[_0xaf38('0x8')]('queuecallerleaveAt',_0x29816a);this[_0xaf38('0x8')]('holdtime',_0x5b0486||null);}},'position':{'type':Sequelize[_0xaf38('0x9')]},'count':{'type':Sequelize[_0xaf38('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xaf38('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xaf38('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xaf38('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaf38('0x3')]},'queuecallerexit':{'type':Sequelize[_0xaf38('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaf38('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xaf38('0x2')],'comment':_0xaf38('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xaf38('0x2')]},'accountcode':{'type':Sequelize[_0xaf38('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xaf38('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xaf38('0x9')]},'mohtime':{'type':Sequelize[_0xaf38('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xaf38('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaf38('0x2')]},'transfer':{'type':Sequelize[_0xaf38('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf38('0x2')],'comment':_0xaf38('0xc')},'transferexten':{'type':Sequelize[_0xaf38('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaf38('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xaf38('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xaf38('0x2')]}}; \ No newline at end of file +var _0x8785=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','queuecallerjoinAt','format'];(function(_0x18bff0,_0x9f85ff){var _0x38ce40=function(_0x43bb14){while(--_0x43bb14){_0x18bff0['push'](_0x18bff0['shift']());}};_0x38ce40(++_0x9f85ff);}(_0x8785,0x162));var _0x5878=function(_0x654979,_0x11fe6e){_0x654979=_0x654979-0x0;var _0x51136b=_0x8785[_0x654979];return _0x51136b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5878('0x0'));module[_0x5878('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5878('0x2')]},'calleridnum':{'type':Sequelize[_0x5878('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x5878('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x4160a4){var _0xf92f56=moment(_0x4160a4);var _0x3358d2=moment(this['getDataValue'](_0x5878('0x4')))[_0x5878('0x5')](_0x5878('0x6'));var _0x33438b=_0xf92f56[_0x5878('0x7')](_0x3358d2,_0x5878('0x8'));this['setDataValue'](_0x5878('0x9'),_0x4160a4);this[_0x5878('0xa')](_0x5878('0xb'),_0x33438b||null);}},'position':{'type':Sequelize[_0x5878('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x5878('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5878('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5878('0x3')]},'queuecallerexit':{'type':Sequelize[_0x5878('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5878('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x5878('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x5878('0xc')]},'channel':{'type':Sequelize[_0x5878('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5878('0x2')]},'connectedlinename':{'type':Sequelize[_0x5878('0x2')]},'accountcode':{'type':Sequelize[_0x5878('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5878('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x5878('0xc')]},'mohtime':{'type':Sequelize[_0x5878('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5878('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x5878('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5878('0x2')],'comment':_0x5878('0xe')},'transferexten':{'type':Sequelize[_0x5878('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5878('0x2')]},'secondDisposition':{'type':Sequelize[_0x5878('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x5878('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index b8fbc27..11ac2f4 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 _0xdbd7=['VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','describe','getVoiceQueuesReport','pick','findAll','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','save','update','then','destroy','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge'];(function(_0x48a7cf,_0x45deb2){var _0x102849=function(_0x1b413d){while(--_0x1b413d){_0x48a7cf['push'](_0x48a7cf['shift']());}};_0x102849(++_0x45deb2);}(_0xdbd7,0x191));var _0x7dbd=function(_0x224721,_0x45b988){_0x224721=_0x224721-0x0;var _0x145358=_0xdbd7[_0x224721];return _0x145358;};'use strict';var emlformat=require(_0x7dbd('0x0'));var rimraf=require(_0x7dbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dbd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7dbd('0x3'));var Mustache=require(_0x7dbd('0x4'));var util=require(_0x7dbd('0x5'));var path=require('path');var sox=require(_0x7dbd('0x6'));var csv=require(_0x7dbd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7dbd('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dbd('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x7dbd('0x7'));var querystring=require(_0x7dbd('0xa'));var Papa=require(_0x7dbd('0xb'));var Redis=require(_0x7dbd('0xc'));var authService=require(_0x7dbd('0xd'));var qs=require(_0x7dbd('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dbd('0xf'));var logger=require(_0x7dbd('0x10'))(_0x7dbd('0x11'));var utils=require('../../config/utils');var config=require(_0x7dbd('0x12'));var licenseUtil=require(_0x7dbd('0x13'));var db=require(_0x7dbd('0x14'))['db'];config[_0x7dbd('0x15')]=_[_0x7dbd('0x16')](config[_0x7dbd('0x15')],{'host':_0x7dbd('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7dbd('0x18'))[_0x7dbd('0x19')](socket);function respondWithStatusCode(_0x2a96ed,_0x92c532){_0x92c532=_0x92c532||0xcc;return function(_0x1d5e88){if(_0x1d5e88){return _0x2a96ed[_0x7dbd('0x1a')](_0x92c532);}return _0x2a96ed['status'](_0x92c532)[_0x7dbd('0x1b')]();};}function respondWithResult(_0x316abf,_0xcd9c0d){_0xcd9c0d=_0xcd9c0d||0xc8;return function(_0x119f12){if(_0x119f12){return _0x316abf[_0x7dbd('0x1c')](_0xcd9c0d)['json'](_0x119f12);}};}function respondWithFilteredResult(_0x7f0445,_0x1ea3c7){return function(_0x11caf7){if(_0x11caf7){var _0x438c97=typeof _0x1ea3c7['offset']===_0x7dbd('0x1d')&&typeof _0x1ea3c7[_0x7dbd('0x1e')]==='undefined';var _0x52ede7=_0x11caf7[_0x7dbd('0x1f')];var _0x146639=_0x438c97?0x0:_0x1ea3c7[_0x7dbd('0x20')];var _0x3988a2=_0x438c97?_0x11caf7[_0x7dbd('0x1f')]:_0x1ea3c7[_0x7dbd('0x20')]+_0x1ea3c7[_0x7dbd('0x1e')];var _0x69bf5e;if(_0x3988a2>=_0x52ede7){_0x3988a2=_0x52ede7;_0x69bf5e=0xc8;}else{_0x69bf5e=0xce;}_0x7f0445[_0x7dbd('0x1c')](_0x69bf5e);return _0x7f0445[_0x7dbd('0x21')]('Content-Range',_0x146639+'-'+_0x3988a2+'/'+_0x52ede7)['json'](_0x11caf7);}return null;};}function patchUpdates(_0x5bf803){return function(_0x309d62){try{jsonpatch['apply'](_0x309d62,_0x5bf803,!![]);}catch(_0x550ea0){return BPromise['reject'](_0x550ea0);}return _0x309d62[_0x7dbd('0x22')]();};}function saveUpdates(_0x3f8fbd,_0x358f77){return function(_0x15f45a){if(_0x15f45a){return _0x15f45a[_0x7dbd('0x23')](_0x3f8fbd)[_0x7dbd('0x24')](function(_0x52a285){return _0x52a285;});}return null;};}function removeEntity(_0x4f36dc,_0x1ad44a){return function(_0x3bc9bd){if(_0x3bc9bd){return _0x3bc9bd[_0x7dbd('0x25')]()['then'](function(){_0x4f36dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39c4b3,_0x20ae8e){return function(_0x457e1f){if(!_0x457e1f){_0x39c4b3[_0x7dbd('0x1a')](0x194);}return _0x457e1f;};}function handleError(_0x19783d,_0x5192e7){_0x5192e7=_0x5192e7||0x1f4;return function(_0x33dd91){logger[_0x7dbd('0x26')](_0x33dd91['stack']);if(_0x33dd91[_0x7dbd('0x27')]){delete _0x33dd91[_0x7dbd('0x27')];}_0x19783d['status'](_0x5192e7)[_0x7dbd('0x28')](_0x33dd91);};}exports['index']=function(_0x2967b9,_0x1f6739){var _0x577d3a={},_0x586232={},_0x51c825={'count':0x0,'rows':[]};var _0x4e401e=_[_0x7dbd('0x29')](db[_0x7dbd('0x2a')][_0x7dbd('0x2b')],function(_0x495901){return{'name':_0x495901[_0x7dbd('0x2c')],'type':_0x495901[_0x7dbd('0x2d')][_0x7dbd('0x2e')]};});_0x586232['model']=_[_0x7dbd('0x29')](_0x4e401e,_0x7dbd('0x27'));_0x586232[_0x7dbd('0x2f')]=_['keys'](_0x2967b9[_0x7dbd('0x2f')]);_0x586232[_0x7dbd('0x30')]=_[_0x7dbd('0x31')](_0x586232[_0x7dbd('0x32')],_0x586232[_0x7dbd('0x2f')]);_0x577d3a[_0x7dbd('0x33')]=_[_0x7dbd('0x31')](_0x586232['model'],qs[_0x7dbd('0x34')](_0x2967b9[_0x7dbd('0x2f')][_0x7dbd('0x34')]));_0x577d3a[_0x7dbd('0x33')]=_0x577d3a[_0x7dbd('0x33')][_0x7dbd('0x35')]?_0x577d3a[_0x7dbd('0x33')]:_0x586232[_0x7dbd('0x32')];if(!_0x2967b9[_0x7dbd('0x2f')][_0x7dbd('0x36')](_0x7dbd('0x37'))){_0x577d3a[_0x7dbd('0x1e')]=qs[_0x7dbd('0x1e')](_0x2967b9[_0x7dbd('0x2f')][_0x7dbd('0x1e')]);_0x577d3a['offset']=qs['offset'](_0x2967b9['query'][_0x7dbd('0x20')]);}_0x577d3a[_0x7dbd('0x38')]=qs[_0x7dbd('0x39')](_0x2967b9['query']['sort']);_0x577d3a['where']=qs[_0x7dbd('0x30')](_['pick'](_0x2967b9['query'],_0x586232[_0x7dbd('0x30')]),_0x4e401e);if(_0x2967b9[_0x7dbd('0x2f')][_0x7dbd('0x3a')]){_0x577d3a[_0x7dbd('0x3b')]=_[_0x7dbd('0x3c')](_0x577d3a[_0x7dbd('0x3b')],{'$or':_[_0x7dbd('0x29')](_0x4e401e,function(_0x11184d){if(_0x11184d[_0x7dbd('0x2d')]!==_0x7dbd('0x3d')){var _0x313d38={};_0x313d38[_0x11184d[_0x7dbd('0x27')]]={'$like':'%'+_0x2967b9[_0x7dbd('0x2f')][_0x7dbd('0x3a')]+'%'};return _0x313d38;}})});}_0x577d3a=_[_0x7dbd('0x3c')]({},_0x577d3a,_0x2967b9[_0x7dbd('0x3e')]);var _0x1b4120={'where':_0x577d3a[_0x7dbd('0x3b')]};return db[_0x7dbd('0x2a')][_0x7dbd('0x1f')](_0x1b4120)['then'](function(_0x1e43b6){_0x51c825[_0x7dbd('0x1f')]=_0x1e43b6;if(_0x2967b9['query'][_0x7dbd('0x3f')]){_0x577d3a[_0x7dbd('0x40')]=[{'all':!![]}];}return db[_0x7dbd('0x2a')]['findAll'](_0x577d3a);})['then'](function(_0x47c8b8){_0x51c825[_0x7dbd('0x41')]=_0x47c8b8;return _0x51c825;})['then'](respondWithFilteredResult(_0x1f6739,_0x577d3a))['catch'](handleError(_0x1f6739,null));};exports[_0x7dbd('0x42')]=function(_0x5bf832,_0x56dd5c){var _0x424a0a={'raw':![],'where':{'id':_0x5bf832[_0x7dbd('0x43')]['id']}},_0xa989b6={};_0xa989b6[_0x7dbd('0x32')]=_[_0x7dbd('0x44')](db['VoiceQueueReport'][_0x7dbd('0x2b')]);_0xa989b6[_0x7dbd('0x2f')]=_['keys'](_0x5bf832[_0x7dbd('0x2f')]);_0xa989b6['filters']=_['intersection'](_0xa989b6[_0x7dbd('0x32')],_0xa989b6['query']);_0x424a0a[_0x7dbd('0x33')]=_[_0x7dbd('0x31')](_0xa989b6[_0x7dbd('0x32')],qs['fields'](_0x5bf832['query'][_0x7dbd('0x34')]));_0x424a0a['attributes']=_0x424a0a[_0x7dbd('0x33')][_0x7dbd('0x35')]?_0x424a0a['attributes']:_0xa989b6[_0x7dbd('0x32')];if(_0x5bf832['query'][_0x7dbd('0x3f')]){_0x424a0a['include']=[{'all':!![]}];}_0x424a0a=_[_0x7dbd('0x3c')]({},_0x424a0a,_0x5bf832[_0x7dbd('0x3e')]);return db[_0x7dbd('0x2a')][_0x7dbd('0x45')](_0x424a0a)['then'](handleEntityNotFound(_0x56dd5c,null))[_0x7dbd('0x24')](respondWithResult(_0x56dd5c,null))[_0x7dbd('0x46')](handleError(_0x56dd5c,null));};exports[_0x7dbd('0x47')]=function(_0x13a6c1,_0x37f604){return db[_0x7dbd('0x2a')][_0x7dbd('0x47')](_0x13a6c1['body'],{})[_0x7dbd('0x24')](respondWithResult(_0x37f604,0xc9))[_0x7dbd('0x46')](handleError(_0x37f604,null));};exports[_0x7dbd('0x23')]=function(_0x42c4ae,_0xc64a5a){if(_0x42c4ae[_0x7dbd('0x48')]['id']){delete _0x42c4ae[_0x7dbd('0x48')]['id'];}return db[_0x7dbd('0x2a')]['find']({'where':{'id':_0x42c4ae[_0x7dbd('0x43')]['id']}})[_0x7dbd('0x24')](handleEntityNotFound(_0xc64a5a,null))[_0x7dbd('0x24')](saveUpdates(_0x42c4ae['body'],null))['then'](respondWithResult(_0xc64a5a,null))['catch'](handleError(_0xc64a5a,null));};exports[_0x7dbd('0x25')]=function(_0x20406f,_0x131755){return db[_0x7dbd('0x2a')]['find']({'where':{'id':_0x20406f[_0x7dbd('0x43')]['id']}})[_0x7dbd('0x24')](handleEntityNotFound(_0x131755,null))[_0x7dbd('0x24')](removeEntity(_0x131755,null))[_0x7dbd('0x46')](handleError(_0x131755,null));};exports[_0x7dbd('0x49')]=function(_0x2554f7,_0x194f12){return db[_0x7dbd('0x2a')][_0x7dbd('0x49')]()[_0x7dbd('0x24')](respondWithResult(_0x194f12,null))[_0x7dbd('0x46')](handleError(_0x194f12,null));};exports[_0x7dbd('0x4a')]=function(_0x5f1e37,_0x1a855a){var _0x4ea8ed={},_0xc5b6c0={},_0x2a7e1a={'count':0x0,'rows':[]};_0xc5b6c0[_0x7dbd('0x32')]=_[_0x7dbd('0x44')](db['VoiceQueueReport'][_0x7dbd('0x2b')]);_0xc5b6c0[_0x7dbd('0x2f')]=_[_0x7dbd('0x44')](_0x5f1e37[_0x7dbd('0x2f')]);_0xc5b6c0[_0x7dbd('0x30')]=_[_0x7dbd('0x31')](_0xc5b6c0[_0x7dbd('0x32')],_0xc5b6c0['query']);_0x4ea8ed['attributes']=_[_0x7dbd('0x31')](_0xc5b6c0[_0x7dbd('0x32')],qs[_0x7dbd('0x34')](_0x5f1e37[_0x7dbd('0x2f')][_0x7dbd('0x34')]));_0x4ea8ed['attributes']=_0x4ea8ed['attributes'][_0x7dbd('0x35')]?_0x4ea8ed[_0x7dbd('0x33')]:_0xc5b6c0[_0x7dbd('0x32')];if(!_0x5f1e37[_0x7dbd('0x2f')][_0x7dbd('0x36')](_0x7dbd('0x37'))){_0x4ea8ed['limit']=qs['limit'](_0x5f1e37['query'][_0x7dbd('0x1e')]);_0x4ea8ed[_0x7dbd('0x20')]=qs[_0x7dbd('0x20')](_0x5f1e37[_0x7dbd('0x2f')][_0x7dbd('0x20')]);}_0x4ea8ed['order']=qs['sort'](_0x5f1e37['query'][_0x7dbd('0x39')]);_0x4ea8ed[_0x7dbd('0x3b')]=qs[_0x7dbd('0x30')](_[_0x7dbd('0x4b')](_0x5f1e37[_0x7dbd('0x2f')],_0xc5b6c0['filters']));if(_0x5f1e37[_0x7dbd('0x2f')]['filter']){_0x4ea8ed[_0x7dbd('0x3b')]=_[_0x7dbd('0x3c')](_0x4ea8ed[_0x7dbd('0x3b')],{'$or':_['map'](_0x4ea8ed['attributes'],function(_0x2dd6b2){var _0x562b2c={};_0x562b2c[_0x2dd6b2]={'$like':'%'+_0x5f1e37[_0x7dbd('0x2f')][_0x7dbd('0x3a')]+'%'};return _0x562b2c;})});}_0x4ea8ed=_[_0x7dbd('0x3c')]({},_0x4ea8ed,_0x5f1e37['options']);var _0x12a054={'where':_0x4ea8ed['where']};return db['VoiceQueueReport'][_0x7dbd('0x1f')](_0x12a054)[_0x7dbd('0x24')](function(_0x5b5ca9){_0x2a7e1a[_0x7dbd('0x1f')]=_0x5b5ca9;if(_0x5f1e37['query']['includeAll']){_0x4ea8ed[_0x7dbd('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7dbd('0x4c')](_0x4ea8ed);})['then'](function(_0x3b252e){_0x2a7e1a[_0x7dbd('0x41')]=_0x3b252e;return _0x2a7e1a;})[_0x7dbd('0x24')](respondWithFilteredResult(_0x1a855a,_0x4ea8ed,_0x7dbd('0x4a')))['catch'](handleError(_0x1a855a,null,_0x7dbd('0x4a')));}; \ No newline at end of file +var _0x5b04=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x14df26,_0x31c2eb){var _0x58834e=function(_0x35b21d){while(--_0x35b21d){_0x14df26['push'](_0x14df26['shift']());}};_0x58834e(++_0x31c2eb);}(_0x5b04,0x68));var _0x45b0=function(_0x3765a3,_0x4e5c6d){_0x3765a3=_0x3765a3-0x0;var _0x221278=_0x5b04[_0x3765a3];return _0x221278;};'use strict';var emlformat=require(_0x45b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45b0('0x1'));var jsonpatch=require(_0x45b0('0x2'));var rp=require('request-promise');var moment=require(_0x45b0('0x3'));var BPromise=require(_0x45b0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x45b0('0x5'));var csv=require(_0x45b0('0x6'));var ejs=require(_0x45b0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x45b0('0x8'));var crypto=require(_0x45b0('0x9'));var jsforce=require(_0x45b0('0xa'));var deskjs=require(_0x45b0('0xb'));var toCsv=require(_0x45b0('0x6'));var querystring=require('querystring');var Papa=require(_0x45b0('0xc'));var Redis=require('ioredis');var authService=require(_0x45b0('0xd'));var qs=require(_0x45b0('0xe'));var as=require(_0x45b0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x45b0('0x10'));var utils=require(_0x45b0('0x11'));var config=require(_0x45b0('0x12'));var licenseUtil=require(_0x45b0('0x13'));var db=require(_0x45b0('0x14'))['db'];config[_0x45b0('0x15')]=_[_0x45b0('0x16')](config[_0x45b0('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x45b0('0x17'))(new Redis(config[_0x45b0('0x15')]));require(_0x45b0('0x18'))['register'](socket);function respondWithStatusCode(_0x5ae6ab,_0x229d8a){_0x229d8a=_0x229d8a||0xcc;return function(_0x23828a){if(_0x23828a){return _0x5ae6ab[_0x45b0('0x19')](_0x229d8a);}return _0x5ae6ab[_0x45b0('0x1a')](_0x229d8a)['end']();};}function respondWithResult(_0xc2ab8b,_0x59ef90){_0x59ef90=_0x59ef90||0xc8;return function(_0xdda6df){if(_0xdda6df){return _0xc2ab8b[_0x45b0('0x1a')](_0x59ef90)[_0x45b0('0x1b')](_0xdda6df);}};}function respondWithFilteredResult(_0x4d7f43,_0x3f5db1){return function(_0x27fdf8){if(_0x27fdf8){var _0x2f47bb=typeof _0x3f5db1['offset']===_0x45b0('0x1c')&&typeof _0x3f5db1[_0x45b0('0x1d')]===_0x45b0('0x1c');var _0x579bd8=_0x27fdf8['count'];var _0x1ed4f4=_0x2f47bb?0x0:_0x3f5db1[_0x45b0('0x1e')];var _0x226512=_0x2f47bb?_0x27fdf8[_0x45b0('0x1f')]:_0x3f5db1[_0x45b0('0x1e')]+_0x3f5db1[_0x45b0('0x1d')];var _0x1cb046;if(_0x226512>=_0x579bd8){_0x226512=_0x579bd8;_0x1cb046=0xc8;}else{_0x1cb046=0xce;}_0x4d7f43[_0x45b0('0x1a')](_0x1cb046);return _0x4d7f43[_0x45b0('0x20')]('Content-Range',_0x1ed4f4+'-'+_0x226512+'/'+_0x579bd8)[_0x45b0('0x1b')](_0x27fdf8);}return null;};}function patchUpdates(_0x3a39d7){return function(_0x5a2378){try{jsonpatch[_0x45b0('0x21')](_0x5a2378,_0x3a39d7,!![]);}catch(_0x45be48){return BPromise[_0x45b0('0x22')](_0x45be48);}return _0x5a2378[_0x45b0('0x23')]();};}function saveUpdates(_0x394211,_0x1eb59f){return function(_0xa21ac){if(_0xa21ac){return _0xa21ac[_0x45b0('0x24')](_0x394211)[_0x45b0('0x25')](function(_0x1919e5){return _0x1919e5;});}return null;};}function removeEntity(_0x47672c,_0x403374){return function(_0x2c7d60){if(_0x2c7d60){return _0x2c7d60[_0x45b0('0x26')]()[_0x45b0('0x25')](function(){_0x47672c[_0x45b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1742c1,_0x30111a){return function(_0x30c51d){if(!_0x30c51d){_0x1742c1[_0x45b0('0x19')](0x194);}return _0x30c51d;};}function handleError(_0x3f3add,_0x49d0dd){_0x49d0dd=_0x49d0dd||0x1f4;return function(_0x277416){logger[_0x45b0('0x27')](_0x277416[_0x45b0('0x28')]);if(_0x277416[_0x45b0('0x29')]){delete _0x277416[_0x45b0('0x29')];}_0x3f3add[_0x45b0('0x1a')](_0x49d0dd)['send'](_0x277416);};}exports[_0x45b0('0x2a')]=function(_0xf2e2ba,_0x24e387){var _0x415dd8={},_0x15c304={},_0x4e7a4a={'count':0x0,'rows':[]};var _0x15a5a5=_[_0x45b0('0x2b')](db['VoiceQueueReport'][_0x45b0('0x2c')],function(_0xfb3f5a){return{'name':_0xfb3f5a[_0x45b0('0x2d')],'type':_0xfb3f5a[_0x45b0('0x2e')][_0x45b0('0x2f')]};});_0x15c304[_0x45b0('0x30')]=_['map'](_0x15a5a5,'name');_0x15c304[_0x45b0('0x31')]=_[_0x45b0('0x32')](_0xf2e2ba[_0x45b0('0x31')]);_0x15c304['filters']=_[_0x45b0('0x33')](_0x15c304['model'],_0x15c304[_0x45b0('0x31')]);_0x415dd8[_0x45b0('0x34')]=_[_0x45b0('0x33')](_0x15c304['model'],qs[_0x45b0('0x35')](_0xf2e2ba[_0x45b0('0x31')][_0x45b0('0x35')]));_0x415dd8[_0x45b0('0x34')]=_0x415dd8[_0x45b0('0x34')][_0x45b0('0x36')]?_0x415dd8['attributes']:_0x15c304[_0x45b0('0x30')];if(!_0xf2e2ba[_0x45b0('0x31')][_0x45b0('0x37')](_0x45b0('0x38'))){_0x415dd8['limit']=qs['limit'](_0xf2e2ba['query'][_0x45b0('0x1d')]);_0x415dd8[_0x45b0('0x1e')]=qs[_0x45b0('0x1e')](_0xf2e2ba[_0x45b0('0x31')][_0x45b0('0x1e')]);}_0x415dd8[_0x45b0('0x39')]=qs[_0x45b0('0x3a')](_0xf2e2ba['query'][_0x45b0('0x3a')]);_0x415dd8[_0x45b0('0x3b')]=qs[_0x45b0('0x3c')](_[_0x45b0('0x3d')](_0xf2e2ba[_0x45b0('0x31')],_0x15c304[_0x45b0('0x3c')]),_0x15a5a5);if(_0xf2e2ba[_0x45b0('0x31')][_0x45b0('0x3e')]){_0x415dd8[_0x45b0('0x3b')]=_[_0x45b0('0x3f')](_0x415dd8[_0x45b0('0x3b')],{'$or':_[_0x45b0('0x2b')](_0x15a5a5,function(_0x58eb89){if(_0x58eb89[_0x45b0('0x2e')]!=='VIRTUAL'){var _0x4fefa8={};_0x4fefa8[_0x58eb89[_0x45b0('0x29')]]={'$like':'%'+_0xf2e2ba[_0x45b0('0x31')]['filter']+'%'};return _0x4fefa8;}})});}_0x415dd8=_[_0x45b0('0x3f')]({},_0x415dd8,_0xf2e2ba[_0x45b0('0x40')]);var _0x2fa935={'where':_0x415dd8[_0x45b0('0x3b')]};return db['VoiceQueueReport'][_0x45b0('0x1f')](_0x2fa935)[_0x45b0('0x25')](function(_0x8d1b8a){_0x4e7a4a[_0x45b0('0x1f')]=_0x8d1b8a;if(_0xf2e2ba[_0x45b0('0x31')][_0x45b0('0x41')]){_0x415dd8[_0x45b0('0x42')]=[{'all':!![]}];}return db[_0x45b0('0x43')]['findAll'](_0x415dd8);})[_0x45b0('0x25')](function(_0xcf6ef6){_0x4e7a4a[_0x45b0('0x44')]=_0xcf6ef6;return _0x4e7a4a;})[_0x45b0('0x25')](respondWithFilteredResult(_0x24e387,_0x415dd8))[_0x45b0('0x45')](handleError(_0x24e387,null));};exports[_0x45b0('0x46')]=function(_0x43998e,_0x135c9a){var _0x3bdf81={'raw':![],'where':{'id':_0x43998e[_0x45b0('0x47')]['id']}},_0xbfda7={};_0xbfda7[_0x45b0('0x30')]=_[_0x45b0('0x32')](db['VoiceQueueReport'][_0x45b0('0x2c')]);_0xbfda7[_0x45b0('0x31')]=_['keys'](_0x43998e[_0x45b0('0x31')]);_0xbfda7[_0x45b0('0x3c')]=_[_0x45b0('0x33')](_0xbfda7[_0x45b0('0x30')],_0xbfda7[_0x45b0('0x31')]);_0x3bdf81[_0x45b0('0x34')]=_[_0x45b0('0x33')](_0xbfda7['model'],qs[_0x45b0('0x35')](_0x43998e['query']['fields']));_0x3bdf81[_0x45b0('0x34')]=_0x3bdf81[_0x45b0('0x34')]['length']?_0x3bdf81[_0x45b0('0x34')]:_0xbfda7[_0x45b0('0x30')];if(_0x43998e[_0x45b0('0x31')][_0x45b0('0x41')]){_0x3bdf81[_0x45b0('0x42')]=[{'all':!![]}];}_0x3bdf81=_['merge']({},_0x3bdf81,_0x43998e[_0x45b0('0x40')]);return db[_0x45b0('0x43')][_0x45b0('0x48')](_0x3bdf81)[_0x45b0('0x25')](handleEntityNotFound(_0x135c9a,null))[_0x45b0('0x25')](respondWithResult(_0x135c9a,null))[_0x45b0('0x45')](handleError(_0x135c9a,null));};exports['create']=function(_0x15445a,_0x576b80){return db[_0x45b0('0x43')][_0x45b0('0x49')](_0x15445a['body'],{})[_0x45b0('0x25')](respondWithResult(_0x576b80,0xc9))['catch'](handleError(_0x576b80,null));};exports['update']=function(_0x4e0d0a,_0x210c7b){if(_0x4e0d0a[_0x45b0('0x4a')]['id']){delete _0x4e0d0a[_0x45b0('0x4a')]['id'];}return db['VoiceQueueReport'][_0x45b0('0x48')]({'where':{'id':_0x4e0d0a[_0x45b0('0x47')]['id']}})[_0x45b0('0x25')](handleEntityNotFound(_0x210c7b,null))[_0x45b0('0x25')](saveUpdates(_0x4e0d0a[_0x45b0('0x4a')],null))[_0x45b0('0x25')](respondWithResult(_0x210c7b,null))[_0x45b0('0x45')](handleError(_0x210c7b,null));};exports[_0x45b0('0x26')]=function(_0x356d3e,_0xa6da43){return db[_0x45b0('0x43')][_0x45b0('0x48')]({'where':{'id':_0x356d3e[_0x45b0('0x47')]['id']}})[_0x45b0('0x25')](handleEntityNotFound(_0xa6da43,null))[_0x45b0('0x25')](removeEntity(_0xa6da43,null))[_0x45b0('0x45')](handleError(_0xa6da43,null));};exports[_0x45b0('0x4b')]=function(_0x1a6c37,_0x28be1e){return db['VoiceQueueReport'][_0x45b0('0x4b')]()[_0x45b0('0x25')](respondWithResult(_0x28be1e,null))['catch'](handleError(_0x28be1e,null));};exports[_0x45b0('0x4c')]=function(_0xfbf259,_0x57db57){var _0x56756d={},_0x3c7393={},_0x238c1d={'count':0x0,'rows':[]};_0x3c7393[_0x45b0('0x30')]=_[_0x45b0('0x32')](db[_0x45b0('0x43')]['rawAttributes']);_0x3c7393[_0x45b0('0x31')]=_[_0x45b0('0x32')](_0xfbf259[_0x45b0('0x31')]);_0x3c7393[_0x45b0('0x3c')]=_[_0x45b0('0x33')](_0x3c7393[_0x45b0('0x30')],_0x3c7393[_0x45b0('0x31')]);_0x56756d[_0x45b0('0x34')]=_[_0x45b0('0x33')](_0x3c7393[_0x45b0('0x30')],qs[_0x45b0('0x35')](_0xfbf259[_0x45b0('0x31')][_0x45b0('0x35')]));_0x56756d[_0x45b0('0x34')]=_0x56756d[_0x45b0('0x34')][_0x45b0('0x36')]?_0x56756d[_0x45b0('0x34')]:_0x3c7393[_0x45b0('0x30')];if(!_0xfbf259[_0x45b0('0x31')][_0x45b0('0x37')](_0x45b0('0x38'))){_0x56756d[_0x45b0('0x1d')]=qs[_0x45b0('0x1d')](_0xfbf259[_0x45b0('0x31')][_0x45b0('0x1d')]);_0x56756d[_0x45b0('0x1e')]=qs['offset'](_0xfbf259[_0x45b0('0x31')][_0x45b0('0x1e')]);}_0x56756d[_0x45b0('0x39')]=qs[_0x45b0('0x3a')](_0xfbf259[_0x45b0('0x31')]['sort']);_0x56756d[_0x45b0('0x3b')]=qs[_0x45b0('0x3c')](_[_0x45b0('0x3d')](_0xfbf259[_0x45b0('0x31')],_0x3c7393[_0x45b0('0x3c')]));if(_0xfbf259[_0x45b0('0x31')][_0x45b0('0x3e')]){_0x56756d[_0x45b0('0x3b')]=_[_0x45b0('0x3f')](_0x56756d[_0x45b0('0x3b')],{'$or':_['map'](_0x56756d[_0x45b0('0x34')],function(_0xd069aa){var _0x43620a={};_0x43620a[_0xd069aa]={'$like':'%'+_0xfbf259[_0x45b0('0x31')][_0x45b0('0x3e')]+'%'};return _0x43620a;})});}_0x56756d=_[_0x45b0('0x3f')]({},_0x56756d,_0xfbf259['options']);var _0x4e88ab={'where':_0x56756d[_0x45b0('0x3b')]};return db[_0x45b0('0x43')][_0x45b0('0x1f')](_0x4e88ab)[_0x45b0('0x25')](function(_0x8f2559){_0x238c1d[_0x45b0('0x1f')]=_0x8f2559;if(_0xfbf259[_0x45b0('0x31')][_0x45b0('0x41')]){_0x56756d['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x45b0('0x4d')](_0x56756d);})[_0x45b0('0x25')](function(_0x502fd7){_0x238c1d['rows']=_0x502fd7;return _0x238c1d;})[_0x45b0('0x25')](respondWithFilteredResult(_0x57db57,_0x56756d,_0x45b0('0x4c')))[_0x45b0('0x45')](handleError(_0x57db57,null,_0x45b0('0x4c')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 84b4b7b..a729b9b 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 _0x8ada=['update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0x8ada,0xd3));var _0xa8ad=function(_0x7d1b89,_0x58faa5){_0x7d1b89=_0x7d1b89-0x0;var _0x435a5b=_0x8ada[_0x7d1b89];return _0x435a5b;};'use strict';var EventEmitter=require(_0xa8ad('0x0'));var VoiceQueueReport=require(_0xa8ad('0x1'))['db'][_0xa8ad('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa8ad('0x3')](0x0);var events={'afterCreate':_0xa8ad('0x4'),'afterUpdate':_0xa8ad('0x5'),'afterDestroy':_0xa8ad('0x6')};function emitEvent(_0x1dc146){return function(_0x5bef6c,_0x480808,_0x3a23bf){VoiceQueueReportEvents[_0xa8ad('0x7')](_0x1dc146+':'+_0x5bef6c['id'],_0x5bef6c);VoiceQueueReportEvents[_0xa8ad('0x7')](_0x1dc146,_0x5bef6c);_0x3a23bf(null);};}for(var e in events){if(events[_0xa8ad('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x15a3=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x17208d,_0x5b7218){var _0x27cb96=function(_0x215f6b){while(--_0x215f6b){_0x17208d['push'](_0x17208d['shift']());}};_0x27cb96(++_0x5b7218);}(_0x15a3,0x18e));var _0x315a=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0x15a3[_0x565faf];return _0x42292f;};'use strict';var EventEmitter=require(_0x315a('0x0'));var VoiceQueueReport=require(_0x315a('0x1'))['db'][_0x315a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x315a('0x3')](0x0);var events={'afterCreate':_0x315a('0x4'),'afterUpdate':_0x315a('0x5'),'afterDestroy':_0x315a('0x6')};function emitEvent(_0x14aa24){return function(_0x71b73a,_0x1658ef,_0x473cc3){VoiceQueueReportEvents[_0x315a('0x7')](_0x14aa24+':'+_0x71b73a['id'],_0x71b73a);VoiceQueueReportEvents['emit'](_0x14aa24,_0x71b73a);_0x473cc3(null);};}for(var e in events){if(events[_0x315a('0x8')](e)){var event=events[e];VoiceQueueReport[_0x315a('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 51b0248..b2cb0f3 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 _0x1487=['../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1487,0x1ba));var _0x7148=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x1487[_0x43de22];return _0x4b15ee;};'use strict';var _=require(_0x7148('0x0'));var util=require(_0x7148('0x1'));var logger=require(_0x7148('0x2'))(_0x7148('0x3'));var moment=require('moment');var BPromise=require(_0x7148('0x4'));var rp=require(_0x7148('0x5'));var fs=require('fs');var path=require(_0x7148('0x6'));var rimraf=require(_0x7148('0x7'));var config=require(_0x7148('0x8'));var attributes=require(_0x7148('0x9'));module[_0x7148('0xa')]=function(_0x49fd88,_0x261f1a){return _0x49fd88[_0x7148('0xb')]('VoiceQueueReport',attributes,{'tableName':_0x7148('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7148('0xd')]},{'fields':[_0x7148('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53f7=['exports','define','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x53f7,0xc6));var _0x753f=function(_0x377ddf,_0x102e9a){_0x377ddf=_0x377ddf-0x0;var _0x5b8465=_0x53f7[_0x377ddf];return _0x5b8465;};'use strict';var _=require(_0x753f('0x0'));var util=require('util');var logger=require(_0x753f('0x1'))(_0x753f('0x2'));var moment=require(_0x753f('0x3'));var BPromise=require(_0x753f('0x4'));var rp=require(_0x753f('0x5'));var fs=require('fs');var path=require(_0x753f('0x6'));var rimraf=require(_0x753f('0x7'));var config=require(_0x753f('0x8'));var attributes=require(_0x753f('0x9'));module[_0x753f('0xa')]=function(_0x46f375,_0x4d6a6d){return _0x46f375[_0x753f('0xb')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x753f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index b31f146..742f4e7 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 _0x0ee0=['model','then','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','findAll','options','raw','limit','include','map','attributes'];(function(_0x368a4a,_0x3efa5b){var _0x10118e=function(_0x587f38){while(--_0x587f38){_0x368a4a['push'](_0x368a4a['shift']());}};_0x10118e(++_0x3efa5b);}(_0x0ee0,0x1d8));var _0x00ee=function(_0x1a6d7b,_0x2e73e8){_0x1a6d7b=_0x1a6d7b-0x0;var _0x3acd24=_0x0ee0[_0x1a6d7b];return _0x3acd24;};'use strict';var _=require(_0x00ee('0x0'));var util=require(_0x00ee('0x1'));var moment=require(_0x00ee('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ee('0x3'));var fs=require('fs');var Redis=require(_0x00ee('0x4'));var db=require(_0x00ee('0x5'))['db'];var utils=require(_0x00ee('0x6'));var logger=require(_0x00ee('0x7'))('rpc');var config=require(_0x00ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x00ee('0x9')]['http']({'port':0x232a});config['redis']=_[_0x00ee('0xa')](config[_0x00ee('0xb')],{'host':_0x00ee('0xc'),'port':0x18eb});var socket=require(_0x00ee('0xd'))(new Redis(config[_0x00ee('0xb')]));require(_0x00ee('0xe'))[_0x00ee('0xf')](socket);function respondWithRpcPromise(_0x476126,_0x1aa7ca,_0x14b4cc){return new BPromise(function(_0x3afd17,_0x5387a6){return client['request'](_0x476126,_0x14b4cc)['then'](function(_0x29367b){logger['info'](_0x00ee('0x10'),_0x1aa7ca,_0x00ee('0x11'));logger[_0x00ee('0x12')](_0x00ee('0x13'),_0x1aa7ca,_0x00ee('0x11'),JSON['stringify'](_0x29367b));if(_0x29367b[_0x00ee('0x14')]){if(_0x29367b[_0x00ee('0x14')]['code']===0x1f4){logger[_0x00ee('0x14')](_0x00ee('0x10'),_0x1aa7ca,_0x29367b[_0x00ee('0x14')]['message']);return _0x5387a6(_0x29367b[_0x00ee('0x14')][_0x00ee('0x15')]);}logger[_0x00ee('0x14')](_0x00ee('0x10'),_0x1aa7ca,_0x29367b[_0x00ee('0x14')]['message']);return _0x3afd17(_0x29367b[_0x00ee('0x14')][_0x00ee('0x15')]);}else{logger[_0x00ee('0x16')](_0x00ee('0x10'),_0x1aa7ca,_0x00ee('0x11'));_0x3afd17(_0x29367b[_0x00ee('0x17')]['message']);}})[_0x00ee('0x18')](function(_0x418092){logger[_0x00ee('0x14')](_0x00ee('0x10'),_0x1aa7ca,_0x418092);_0x5387a6(_0x418092);});});}exports['GetVoiceQueueReport']=function(_0x5031e7){var _0x3911e2=this;return new Promise(function(_0x49deb9,_0x1e689d){return db['VoiceQueueReport'][_0x00ee('0x19')]({'raw':_0x5031e7[_0x00ee('0x1a')]?_0x5031e7['options'][_0x00ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x5031e7[_0x00ee('0x1a')]?_0x5031e7['options']['where']||null:null,'attributes':_0x5031e7[_0x00ee('0x1a')]?_0x5031e7[_0x00ee('0x1a')]['attributes']||null:null,'limit':_0x5031e7[_0x00ee('0x1a')]?_0x5031e7[_0x00ee('0x1a')][_0x00ee('0x1c')]||null:null,'include':_0x5031e7['options']?_0x5031e7[_0x00ee('0x1a')][_0x00ee('0x1d')]?_[_0x00ee('0x1e')](_0x5031e7[_0x00ee('0x1a')][_0x00ee('0x1d')],function(_0x26285e){return{'model':db[_0x26285e['model']],'as':_0x26285e['as'],'attributes':_0x26285e[_0x00ee('0x1f')],'include':_0x26285e[_0x00ee('0x1d')]?_[_0x00ee('0x1e')](_0x26285e['include'],function(_0x55145){return{'model':db[_0x55145[_0x00ee('0x20')]],'as':_0x55145['as'],'attributes':_0x55145['attributes'],'include':_0x55145[_0x00ee('0x1d')]?_[_0x00ee('0x1e')](_0x55145[_0x00ee('0x1d')],function(_0x28b929){return{'model':db[_0x28b929['model']],'as':_0x28b929['as'],'attributes':_0x28b929[_0x00ee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x00ee('0x21')](function(_0x35b881){logger['info']('GetVoiceQueueReport',_0x5031e7);logger[_0x00ee('0x12')](_0x00ee('0x22'),_0x5031e7,JSON['stringify'](_0x35b881));_0x49deb9(_0x35b881);})[_0x00ee('0x18')](function(_0x11e699){logger['error']('GetVoiceQueueReport',_0x11e699[_0x00ee('0x15')],_0x5031e7);_0x1e689d(_0x3911e2['error'](0x1f4,_0x11e699[_0x00ee('0x15')]));});});};exports[_0x00ee('0x23')]=function(_0x20f4e8){var _0x425621=this;return new Promise(function(_0xa8362f,_0x129cdc){return db[_0x00ee('0x24')][_0x00ee('0x25')](_0x20f4e8[_0x00ee('0x26')],{'raw':_0x20f4e8[_0x00ee('0x1a')]?_0x20f4e8[_0x00ee('0x1a')][_0x00ee('0x1b')]===undefined?!![]:![]:!![]})[_0x00ee('0x21')](function(_0xd96ab2){logger[_0x00ee('0x16')](_0x00ee('0x23'),_0x20f4e8);logger[_0x00ee('0x12')](_0x00ee('0x23'),_0x20f4e8,JSON['stringify'](_0xd96ab2));_0xa8362f(_0xd96ab2);})['catch'](function(_0x2158aa){logger['error'](_0x00ee('0x23'),_0x2158aa[_0x00ee('0x15')],_0x20f4e8);_0x129cdc(_0x425621['error'](0x1f4,_0x2158aa[_0x00ee('0x15')]));});});};exports[_0x00ee('0x27')]=function(_0x2832da){var _0xc8610=this;return new Promise(function(_0x2199b5,_0x29388e){return db[_0x00ee('0x24')][_0x00ee('0x28')](_0x2832da[_0x00ee('0x26')],{'raw':_0x2832da[_0x00ee('0x1a')]?_0x2832da[_0x00ee('0x1a')][_0x00ee('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2832da[_0x00ee('0x1a')]?_0x2832da[_0x00ee('0x1a')]['where']||null:null,'attributes':_0x2832da[_0x00ee('0x1a')]?_0x2832da[_0x00ee('0x1a')][_0x00ee('0x1f')]||null:null,'limit':_0x2832da[_0x00ee('0x1a')]?_0x2832da[_0x00ee('0x1a')][_0x00ee('0x1c')]||null:null})[_0x00ee('0x21')](function(_0x10f8b3){logger[_0x00ee('0x16')](_0x00ee('0x27'),_0x2832da);logger['debug']('UpdateVoiceQueueReport',_0x2832da,JSON[_0x00ee('0x29')](_0x10f8b3));_0x2199b5(_0x10f8b3);})[_0x00ee('0x18')](function(_0x130ee9){logger[_0x00ee('0x14')](_0x00ee('0x27'),_0x130ee9[_0x00ee('0x15')],_0x2832da);_0x29388e(_0xc8610['error'](0x1f4,_0x130ee9['message']));});});}; \ No newline at end of file +var _0x8719=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','catch','CreateVoiceQueueReport','stringify','UpdateVoiceQueueReport','update','body','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults'];(function(_0x5296d1,_0x2fcdea){var _0x205cd1=function(_0x53fff0){while(--_0x53fff0){_0x5296d1['push'](_0x5296d1['shift']());}};_0x205cd1(++_0x2fcdea);}(_0x8719,0xf7));var _0x9871=function(_0x437ce0,_0x4c2d48){_0x437ce0=_0x437ce0-0x0;var _0x1b20b3=_0x8719[_0x437ce0];return _0x1b20b3;};'use strict';var _=require(_0x9871('0x0'));var util=require(_0x9871('0x1'));var moment=require(_0x9871('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9871('0x3'));var db=require(_0x9871('0x4'))['db'];var utils=require(_0x9871('0x5'));var logger=require('../../config/logger')(_0x9871('0x6'));var config=require('../../config/environment');var jayson=require(_0x9871('0x7'));var client=jayson[_0x9871('0x8')][_0x9871('0x9')]({'port':0x232a});config['redis']=_[_0x9871('0xa')](config[_0x9871('0xb')],{'host':_0x9871('0xc'),'port':0x18eb});var socket=require(_0x9871('0xd'))(new Redis(config[_0x9871('0xb')]));require(_0x9871('0xe'))['register'](socket);function respondWithRpcPromise(_0x2b8a19,_0x2be7e6,_0x704067){return new BPromise(function(_0x47a9cc,_0x3eed9b){return client[_0x9871('0xf')](_0x2b8a19,_0x704067)[_0x9871('0x10')](function(_0x598921){logger[_0x9871('0x11')](_0x9871('0x12'),_0x2be7e6,_0x9871('0x13'));logger[_0x9871('0x14')](_0x9871('0x15'),_0x2be7e6,_0x9871('0x13'),JSON['stringify'](_0x598921));if(_0x598921[_0x9871('0x16')]){if(_0x598921[_0x9871('0x16')][_0x9871('0x17')]===0x1f4){logger[_0x9871('0x16')](_0x9871('0x12'),_0x2be7e6,_0x598921[_0x9871('0x16')]['message']);return _0x3eed9b(_0x598921[_0x9871('0x16')][_0x9871('0x18')]);}logger['error'](_0x9871('0x12'),_0x2be7e6,_0x598921[_0x9871('0x16')][_0x9871('0x18')]);return _0x47a9cc(_0x598921[_0x9871('0x16')][_0x9871('0x18')]);}else{logger[_0x9871('0x11')](_0x9871('0x12'),_0x2be7e6,_0x9871('0x13'));_0x47a9cc(_0x598921[_0x9871('0x19')][_0x9871('0x18')]);}})['catch'](function(_0x2a30ad){logger[_0x9871('0x16')](_0x9871('0x12'),_0x2be7e6,_0x2a30ad);_0x3eed9b(_0x2a30ad);});});}exports[_0x9871('0x1a')]=function(_0x39da5d){var _0x163422=this;return new Promise(function(_0x4ba496,_0x1dfd62){return db[_0x9871('0x1b')][_0x9871('0x1c')]({'raw':_0x39da5d[_0x9871('0x1d')]?_0x39da5d[_0x9871('0x1d')][_0x9871('0x1e')]===undefined?!![]:![]:!![],'where':_0x39da5d[_0x9871('0x1d')]?_0x39da5d[_0x9871('0x1d')][_0x9871('0x1f')]||null:null,'attributes':_0x39da5d[_0x9871('0x1d')]?_0x39da5d[_0x9871('0x1d')]['attributes']||null:null,'limit':_0x39da5d[_0x9871('0x1d')]?_0x39da5d['options'][_0x9871('0x20')]||null:null,'include':_0x39da5d[_0x9871('0x1d')]?_0x39da5d[_0x9871('0x1d')][_0x9871('0x21')]?_[_0x9871('0x22')](_0x39da5d[_0x9871('0x1d')][_0x9871('0x21')],function(_0x1cb0ae){return{'model':db[_0x1cb0ae[_0x9871('0x23')]],'as':_0x1cb0ae['as'],'attributes':_0x1cb0ae['attributes'],'include':_0x1cb0ae[_0x9871('0x21')]?_[_0x9871('0x22')](_0x1cb0ae[_0x9871('0x21')],function(_0x553909){return{'model':db[_0x553909[_0x9871('0x23')]],'as':_0x553909['as'],'attributes':_0x553909[_0x9871('0x24')],'include':_0x553909[_0x9871('0x21')]?_[_0x9871('0x22')](_0x553909[_0x9871('0x21')],function(_0x4cbd37){return{'model':db[_0x4cbd37[_0x9871('0x23')]],'as':_0x4cbd37['as'],'attributes':_0x4cbd37['attributes']};}):[]};}):[]};}):[]:[]})[_0x9871('0x10')](function(_0x5348e6){logger[_0x9871('0x11')](_0x9871('0x1a'),_0x39da5d);logger[_0x9871('0x14')](_0x9871('0x1a'),_0x39da5d,JSON['stringify'](_0x5348e6));_0x4ba496(_0x5348e6);})[_0x9871('0x25')](function(_0x406991){logger['error']('GetVoiceQueueReport',_0x406991[_0x9871('0x18')],_0x39da5d);_0x1dfd62(_0x163422[_0x9871('0x16')](0x1f4,_0x406991[_0x9871('0x18')]));});});};exports[_0x9871('0x26')]=function(_0x5bfb51){var _0xd14ade=this;return new Promise(function(_0x9e4402,_0x5116a5){return db['VoiceQueueReport']['create'](_0x5bfb51['body'],{'raw':_0x5bfb51[_0x9871('0x1d')]?_0x5bfb51[_0x9871('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x9871('0x10')](function(_0x1d46a1){logger[_0x9871('0x11')](_0x9871('0x26'),_0x5bfb51);logger[_0x9871('0x14')](_0x9871('0x26'),_0x5bfb51,JSON[_0x9871('0x27')](_0x1d46a1));_0x9e4402(_0x1d46a1);})[_0x9871('0x25')](function(_0x2189ed){logger[_0x9871('0x16')](_0x9871('0x26'),_0x2189ed[_0x9871('0x18')],_0x5bfb51);_0x5116a5(_0xd14ade[_0x9871('0x16')](0x1f4,_0x2189ed[_0x9871('0x18')]));});});};exports[_0x9871('0x28')]=function(_0x273dc0){var _0x465d96=this;return new Promise(function(_0x34b1c1,_0x232338){return db['VoiceQueueReport'][_0x9871('0x29')](_0x273dc0[_0x9871('0x2a')],{'raw':_0x273dc0[_0x9871('0x1d')]?_0x273dc0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x273dc0[_0x9871('0x1d')]?_0x273dc0['options'][_0x9871('0x1f')]||null:null,'attributes':_0x273dc0[_0x9871('0x1d')]?_0x273dc0['options'][_0x9871('0x24')]||null:null,'limit':_0x273dc0[_0x9871('0x1d')]?_0x273dc0[_0x9871('0x1d')][_0x9871('0x20')]||null:null})[_0x9871('0x10')](function(_0x191d71){logger[_0x9871('0x11')](_0x9871('0x28'),_0x273dc0);logger[_0x9871('0x14')](_0x9871('0x28'),_0x273dc0,JSON[_0x9871('0x27')](_0x191d71));_0x34b1c1(_0x191d71);})[_0x9871('0x25')](function(_0x20997e){logger['error'](_0x9871('0x28'),_0x20997e[_0x9871('0x18')],_0x273dc0);_0x232338(_0x465d96[_0x9871('0x16')](0x1f4,_0x20997e[_0x9871('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index bfbcb93..bbdf5cd 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 _0x2a8d=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x4b0a5b,_0x12c2ec){var _0x1fd4c2=function(_0x204a50){while(--_0x204a50){_0x4b0a5b['push'](_0x4b0a5b['shift']());}};_0x1fd4c2(++_0x12c2ec);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x7bdda5,_0x3358f5){_0x7bdda5=_0x7bdda5-0x0;var _0x45be29=_0x2a8d[_0x7bdda5];return _0x45be29;};'use strict';var VoiceQueueReportEvents=require(_0xd2a8('0x0'));var events=[_0xd2a8('0x1'),_0xd2a8('0x2'),_0xd2a8('0x3')];function createListener(_0x43fecc,_0xdbcc52){return function(_0x6494bf){_0xdbcc52[_0xd2a8('0x4')](_0x43fecc,_0x6494bf);};}function removeListener(_0x5919ea,_0x4dbe3c){return function(){VoiceQueueReportEvents[_0xd2a8('0x5')](_0x5919ea,_0x4dbe3c);};}exports[_0xd2a8('0x6')]=function(_0x8984dd){for(var _0x153d2c=0x0,_0x39996b=events[_0xd2a8('0x7')];_0x153d2c<_0x39996b;_0x153d2c++){var _0xa57f65=events[_0x153d2c];var _0x18e038=createListener('voiceQueueReport:'+_0xa57f65,_0x8984dd);VoiceQueueReportEvents['on'](_0xa57f65,_0x18e038);}}; \ No newline at end of file +var _0xe799=['length','voiceQueueReport:','./voiceQueueReport.events','remove','emit','register'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xe799,0x170));var _0x9e79=function(_0x1d590f,_0x1ff8d5){_0x1d590f=_0x1d590f-0x0;var _0x1851c6=_0xe799[_0x1d590f];return _0x1851c6;};'use strict';var VoiceQueueReportEvents=require(_0x9e79('0x0'));var events=['save',_0x9e79('0x1'),'update'];function createListener(_0x42f653,_0x34b481){return function(_0x528d88){_0x34b481[_0x9e79('0x2')](_0x42f653,_0x528d88);};}function removeListener(_0x3f0a4f,_0x809ffd){return function(){VoiceQueueReportEvents['removeListener'](_0x3f0a4f,_0x809ffd);};}exports[_0x9e79('0x3')]=function(_0x4e7bb3){for(var _0x3239df=0x0,_0x7f49fe=events[_0x9e79('0x4')];_0x3239df<_0x7f49fe;_0x3239df++){var _0x4a35c5=events[_0x3239df];var _0x29bb3d=createListener(_0x9e79('0x5')+_0x4a35c5,_0x4e7bb3);VoiceQueueReportEvents['on'](_0x4a35c5,_0x29bb3d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 555400e..d7c7972 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 _0xe16b=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post','create','delete','destroy'];(function(_0x1bb710,_0x4f3f98){var _0x3da7a9=function(_0x197e2a){while(--_0x197e2a){_0x1bb710['push'](_0x1bb710['shift']());}};_0x3da7a9(++_0x4f3f98);}(_0xe16b,0x155));var _0xbe16=function(_0x54a176,_0x3e3905){_0x54a176=_0x54a176-0x0;var _0x5a16da=_0xe16b[_0x54a176];return _0x5a16da;};'use strict';var multer=require('multer');var util=require(_0xbe16('0x0'));var path=require(_0xbe16('0x1'));var timeout=require(_0xbe16('0x2'));var express=require(_0xbe16('0x3'));var router=express[_0xbe16('0x4')]();var fs_extra=require(_0xbe16('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe16('0x6'));var config=require(_0xbe16('0x7'));var controller=require(_0xbe16('0x8'));router[_0xbe16('0x9')]('/',auth[_0xbe16('0xa')](),controller['index']);router[_0xbe16('0x9')](_0xbe16('0xb'),auth[_0xbe16('0xa')](),controller['show']);router[_0xbe16('0xc')]('/',auth[_0xbe16('0xa')](),controller[_0xbe16('0xd')]);router['put'](_0xbe16('0xb'),auth[_0xbe16('0xa')](),controller['update']);router[_0xbe16('0xe')]('/:id',auth[_0xbe16('0xa')](),controller[_0xbe16('0xf')]);module[_0xbe16('0x10')]=router; \ No newline at end of file +var _0x0f44=['./voiceQueuesLog.controller','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46bb0e,_0x3b2570){var _0x54504a=function(_0x50205a){while(--_0x50205a){_0x46bb0e['push'](_0x46bb0e['shift']());}};_0x54504a(++_0x3b2570);}(_0x0f44,0x7d));var _0x40f4=function(_0x128f18,_0xd7ba38){_0x128f18=_0x128f18-0x0;var _0x28d6fb=_0x0f44[_0x128f18];return _0x28d6fb;};'use strict';var multer=require(_0x40f4('0x0'));var util=require(_0x40f4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x40f4('0x2'));var router=express[_0x40f4('0x3')]();var fs_extra=require(_0x40f4('0x4'));var auth=require(_0x40f4('0x5'));var interaction=require(_0x40f4('0x6'));var config=require(_0x40f4('0x7'));var controller=require(_0x40f4('0x8'));router['get']('/',auth[_0x40f4('0x9')](),controller['index']);router['get']('/:id',auth[_0x40f4('0x9')](),controller[_0x40f4('0xa')]);router[_0x40f4('0xb')]('/',auth['isAuthenticated'](),controller[_0x40f4('0xc')]);router[_0x40f4('0xd')](_0x40f4('0xe'),auth['isAuthenticated'](),controller[_0x40f4('0xf')]);router[_0x40f4('0x10')]('/:id',auth[_0x40f4('0x9')](),controller[_0x40f4('0x11')]);module[_0x40f4('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 f521740..dd9d337 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 _0x6403=['moment','exports','STRING','DATE','literal','sequelize'];(function(_0x3e24e6,_0x39d29f){var _0x17cce5=function(_0x299b32){while(--_0x299b32){_0x3e24e6['push'](_0x3e24e6['shift']());}};_0x17cce5(++_0x39d29f);}(_0x6403,0xe9));var _0x3640=function(_0x3ed004,_0x4f7735){_0x3ed004=_0x3ed004-0x0;var _0x75a28e=_0x6403[_0x3ed004];return _0x75a28e;};'use strict';var Sequelize=require(_0x3640('0x0'));var moment=require(_0x3640('0x1'));module[_0x3640('0x2')]={'time':{'type':Sequelize[_0x3640('0x3')]},'callid':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3640('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3640('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x3640('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x8940=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8940,0xd6));var _0x0894=function(_0x32e52d,_0x107e11){_0x32e52d=_0x32e52d-0x0;var _0x2c8297=_0x8940[_0x32e52d];return _0x2c8297;};'use strict';var Sequelize=require(_0x0894('0x0'));var moment=require(_0x0894('0x1'));module['exports']={'time':{'type':Sequelize[_0x0894('0x2')]},'callid':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0894('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0894('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x0894('0x4')](_0x0894('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index b7b6157..6aee394 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 _0x513b=['then','destroy','sendStatus','error','stack','name','map','VoiceQueuesLog','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x513b,0xbc));var _0xb513=function(_0x224f39,_0x25e1ba){_0x224f39=_0x224f39-0x0;var _0x58eabe=_0x513b[_0x224f39];return _0x58eabe;};'use strict';var emlformat=require(_0xb513('0x0'));var rimraf=require(_0xb513('0x1'));var zipdir=require(_0xb513('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb513('0x3'));var moment=require(_0xb513('0x4'));var BPromise=require(_0xb513('0x5'));var Mustache=require(_0xb513('0x6'));var util=require(_0xb513('0x7'));var path=require(_0xb513('0x8'));var sox=require('sox');var csv=require(_0xb513('0x9'));var ejs=require(_0xb513('0xa'));var fs=require('fs');var fs_extra=require(_0xb513('0xb'));var _=require(_0xb513('0xc'));var squel=require(_0xb513('0xd'));var crypto=require(_0xb513('0xe'));var jsforce=require(_0xb513('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb513('0x9'));var querystring=require(_0xb513('0x10'));var Papa=require(_0xb513('0x11'));var Redis=require(_0xb513('0x12'));var authService=require(_0xb513('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb513('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb513('0x15'))(_0xb513('0x16'));var utils=require(_0xb513('0x17'));var config=require(_0xb513('0x18'));var licenseUtil=require(_0xb513('0x19'));var db=require(_0xb513('0x1a'))['db'];function respondWithStatusCode(_0x60d3f6,_0xcbaa08){_0xcbaa08=_0xcbaa08||0xcc;return function(_0x4ef378){if(_0x4ef378){return _0x60d3f6['sendStatus'](_0xcbaa08);}return _0x60d3f6['status'](_0xcbaa08)[_0xb513('0x1b')]();};}function respondWithResult(_0x263203,_0x3022b4){_0x3022b4=_0x3022b4||0xc8;return function(_0xd5dc14){if(_0xd5dc14){return _0x263203[_0xb513('0x1c')](_0x3022b4)[_0xb513('0x1d')](_0xd5dc14);}};}function respondWithFilteredResult(_0x5f52f2,_0x4c367d){return function(_0x318d18){if(_0x318d18){var _0x4040f2=typeof _0x4c367d[_0xb513('0x1e')]===_0xb513('0x1f')&&typeof _0x4c367d['limit']===_0xb513('0x1f');var _0x5d0ca3=_0x318d18['count'];var _0x44eb67=_0x4040f2?0x0:_0x4c367d[_0xb513('0x1e')];var _0x575404=_0x4040f2?_0x318d18[_0xb513('0x20')]:_0x4c367d['offset']+_0x4c367d[_0xb513('0x21')];var _0x27c9e6;if(_0x575404>=_0x5d0ca3){_0x575404=_0x5d0ca3;_0x27c9e6=0xc8;}else{_0x27c9e6=0xce;}_0x5f52f2['status'](_0x27c9e6);return _0x5f52f2[_0xb513('0x22')](_0xb513('0x23'),_0x44eb67+'-'+_0x575404+'/'+_0x5d0ca3)[_0xb513('0x1d')](_0x318d18);}return null;};}function patchUpdates(_0x1ff11f){return function(_0x56b590){try{jsonpatch[_0xb513('0x24')](_0x56b590,_0x1ff11f,!![]);}catch(_0x20ddab){return BPromise[_0xb513('0x25')](_0x20ddab);}return _0x56b590[_0xb513('0x26')]();};}function saveUpdates(_0x11b765,_0x3c54ea){return function(_0x42f5f7){if(_0x42f5f7){return _0x42f5f7[_0xb513('0x27')](_0x11b765)[_0xb513('0x28')](function(_0x4db8d7){return _0x4db8d7;});}return null;};}function removeEntity(_0x43a5ee,_0x3a93cf){return function(_0x3a27be){if(_0x3a27be){return _0x3a27be[_0xb513('0x29')]()[_0xb513('0x28')](function(){_0x43a5ee['status'](0xcc)[_0xb513('0x1b')]();});}};}function handleEntityNotFound(_0xfdab0f,_0x4b3e6d){return function(_0x4fbcf0){if(!_0x4fbcf0){_0xfdab0f[_0xb513('0x2a')](0x194);}return _0x4fbcf0;};}function handleError(_0x4b9cc2,_0x2f0d56){_0x2f0d56=_0x2f0d56||0x1f4;return function(_0x468642){logger[_0xb513('0x2b')](_0x468642[_0xb513('0x2c')]);if(_0x468642['name']){delete _0x468642[_0xb513('0x2d')];}_0x4b9cc2[_0xb513('0x1c')](_0x2f0d56)['send'](_0x468642);};}exports['index']=function(_0x3768de,_0x44d655){var _0x18a90e={},_0x392d8a={},_0xcb0ea1={'count':0x0,'rows':[]};var _0x5a51da=_[_0xb513('0x2e')](db[_0xb513('0x2f')]['rawAttributes'],function(_0x156516){return{'name':_0x156516[_0xb513('0x30')],'type':_0x156516[_0xb513('0x31')]['key']};});_0x392d8a[_0xb513('0x32')]=_[_0xb513('0x2e')](_0x5a51da,_0xb513('0x2d'));_0x392d8a[_0xb513('0x33')]=_[_0xb513('0x34')](_0x3768de[_0xb513('0x33')]);_0x392d8a[_0xb513('0x35')]=_['intersection'](_0x392d8a[_0xb513('0x32')],_0x392d8a[_0xb513('0x33')]);_0x18a90e[_0xb513('0x36')]=_[_0xb513('0x37')](_0x392d8a[_0xb513('0x32')],qs[_0xb513('0x38')](_0x3768de[_0xb513('0x33')][_0xb513('0x38')]));_0x18a90e[_0xb513('0x36')]=_0x18a90e[_0xb513('0x36')]['length']?_0x18a90e['attributes']:_0x392d8a[_0xb513('0x32')];if(!_0x3768de[_0xb513('0x33')][_0xb513('0x39')]('nolimit')){_0x18a90e[_0xb513('0x21')]=qs[_0xb513('0x21')](_0x3768de[_0xb513('0x33')][_0xb513('0x21')]);_0x18a90e[_0xb513('0x1e')]=qs['offset'](_0x3768de['query'][_0xb513('0x1e')]);}_0x18a90e[_0xb513('0x3a')]=qs['sort'](_0x3768de[_0xb513('0x33')]['sort']);_0x18a90e['where']=qs[_0xb513('0x35')](_[_0xb513('0x3b')](_0x3768de[_0xb513('0x33')],_0x392d8a[_0xb513('0x35')]),_0x5a51da);if(_0x3768de[_0xb513('0x33')][_0xb513('0x3c')]){_0x18a90e['where']=_[_0xb513('0x3d')](_0x18a90e[_0xb513('0x3e')],{'$or':_[_0xb513('0x2e')](_0x5a51da,function(_0x5b0c4d){if(_0x5b0c4d[_0xb513('0x31')]!==_0xb513('0x3f')){var _0x4ccf69={};_0x4ccf69[_0x5b0c4d['name']]={'$like':'%'+_0x3768de[_0xb513('0x33')][_0xb513('0x3c')]+'%'};return _0x4ccf69;}})});}_0x18a90e=_['merge']({},_0x18a90e,_0x3768de[_0xb513('0x40')]);var _0x3d97e0={'where':_0x18a90e[_0xb513('0x3e')]};return db[_0xb513('0x2f')][_0xb513('0x20')](_0x3d97e0)[_0xb513('0x28')](function(_0x422e15){_0xcb0ea1[_0xb513('0x20')]=_0x422e15;if(_0x3768de[_0xb513('0x33')][_0xb513('0x41')]){_0x18a90e[_0xb513('0x42')]=[{'all':!![]}];}return db[_0xb513('0x2f')][_0xb513('0x43')](_0x18a90e);})[_0xb513('0x28')](function(_0x5113c8){_0xcb0ea1[_0xb513('0x44')]=_0x5113c8;return _0xcb0ea1;})[_0xb513('0x28')](respondWithFilteredResult(_0x44d655,_0x18a90e))[_0xb513('0x45')](handleError(_0x44d655,null));};exports[_0xb513('0x46')]=function(_0x5361f4,_0x1081c4){var _0x14bdb4={'raw':!![],'where':{'id':_0x5361f4[_0xb513('0x47')]['id']}},_0x229f60={};_0x229f60[_0xb513('0x32')]=_[_0xb513('0x34')](db[_0xb513('0x2f')]['rawAttributes']);_0x229f60[_0xb513('0x33')]=_[_0xb513('0x34')](_0x5361f4[_0xb513('0x33')]);_0x229f60[_0xb513('0x35')]=_[_0xb513('0x37')](_0x229f60[_0xb513('0x32')],_0x229f60[_0xb513('0x33')]);_0x14bdb4[_0xb513('0x36')]=_[_0xb513('0x37')](_0x229f60['model'],qs[_0xb513('0x38')](_0x5361f4[_0xb513('0x33')][_0xb513('0x38')]));_0x14bdb4[_0xb513('0x36')]=_0x14bdb4[_0xb513('0x36')][_0xb513('0x48')]?_0x14bdb4[_0xb513('0x36')]:_0x229f60[_0xb513('0x32')];if(_0x5361f4[_0xb513('0x33')][_0xb513('0x41')]){_0x14bdb4[_0xb513('0x42')]=[{'all':!![]}];}_0x14bdb4=_[_0xb513('0x3d')]({},_0x14bdb4,_0x5361f4[_0xb513('0x40')]);return db['VoiceQueuesLog'][_0xb513('0x49')](_0x14bdb4)[_0xb513('0x28')](handleEntityNotFound(_0x1081c4,null))[_0xb513('0x28')](respondWithResult(_0x1081c4,null))[_0xb513('0x45')](handleError(_0x1081c4,null));};exports[_0xb513('0x4a')]=function(_0x4b7bb0,_0xcd3b4e){return db[_0xb513('0x2f')]['create'](_0x4b7bb0[_0xb513('0x4b')],{})[_0xb513('0x28')](respondWithResult(_0xcd3b4e,0xc9))[_0xb513('0x45')](handleError(_0xcd3b4e,null));};exports[_0xb513('0x27')]=function(_0x2e8501,_0x5e7991){if(_0x2e8501[_0xb513('0x4b')]['id']){delete _0x2e8501[_0xb513('0x4b')]['id'];}return db[_0xb513('0x2f')][_0xb513('0x49')]({'where':{'id':_0x2e8501[_0xb513('0x47')]['id']}})[_0xb513('0x28')](handleEntityNotFound(_0x5e7991,null))['then'](saveUpdates(_0x2e8501['body'],null))[_0xb513('0x28')](respondWithResult(_0x5e7991,null))[_0xb513('0x45')](handleError(_0x5e7991,null));};exports[_0xb513('0x29')]=function(_0x17757b,_0x415187){return db[_0xb513('0x2f')]['find']({'where':{'id':_0x17757b[_0xb513('0x47')]['id']}})['then'](handleEntityNotFound(_0x415187,null))['then'](removeEntity(_0x415187,null))[_0xb513('0x45')](handleError(_0x415187,null));}; \ No newline at end of file +var _0xa519=['attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x57aa9d,_0x40382c){var _0x43fd79=function(_0x4cfd97){while(--_0x4cfd97){_0x57aa9d['push'](_0x57aa9d['shift']());}};_0x43fd79(++_0x40382c);}(_0xa519,0x65));var _0x9a51=function(_0x7ea12c,_0x147e17){_0x7ea12c=_0x7ea12c-0x0;var _0x1ca036=_0xa519[_0x7ea12c];return _0x1ca036;};'use strict';var emlformat=require(_0x9a51('0x0'));var rimraf=require(_0x9a51('0x1'));var zipdir=require(_0x9a51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a51('0x3'));var moment=require(_0x9a51('0x4'));var BPromise=require(_0x9a51('0x5'));var Mustache=require(_0x9a51('0x6'));var util=require(_0x9a51('0x7'));var path=require(_0x9a51('0x8'));var sox=require(_0x9a51('0x9'));var csv=require(_0x9a51('0xa'));var ejs=require(_0x9a51('0xb'));var fs=require('fs');var fs_extra=require(_0x9a51('0xc'));var _=require(_0x9a51('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a51('0xe'));var toCsv=require(_0x9a51('0xa'));var querystring=require(_0x9a51('0xf'));var Papa=require(_0x9a51('0x10'));var Redis=require(_0x9a51('0x11'));var authService=require(_0x9a51('0x12'));var qs=require(_0x9a51('0x13'));var as=require(_0x9a51('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a51('0x15'))(_0x9a51('0x16'));var utils=require(_0x9a51('0x17'));var config=require(_0x9a51('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a51('0x19'))['db'];function respondWithStatusCode(_0x46860c,_0x416a39){_0x416a39=_0x416a39||0xcc;return function(_0x1400b5){if(_0x1400b5){return _0x46860c[_0x9a51('0x1a')](_0x416a39);}return _0x46860c[_0x9a51('0x1b')](_0x416a39)['end']();};}function respondWithResult(_0x4e179c,_0x4e5220){_0x4e5220=_0x4e5220||0xc8;return function(_0x2b2c14){if(_0x2b2c14){return _0x4e179c['status'](_0x4e5220)[_0x9a51('0x1c')](_0x2b2c14);}};}function respondWithFilteredResult(_0x5dc359,_0x2557ab){return function(_0x514392){if(_0x514392){var _0x318437=typeof _0x2557ab[_0x9a51('0x1d')]==='undefined'&&typeof _0x2557ab['limit']===_0x9a51('0x1e');var _0x496250=_0x514392[_0x9a51('0x1f')];var _0x4dc271=_0x318437?0x0:_0x2557ab[_0x9a51('0x1d')];var _0x3d8e85=_0x318437?_0x514392[_0x9a51('0x1f')]:_0x2557ab['offset']+_0x2557ab[_0x9a51('0x20')];var _0x447b60;if(_0x3d8e85>=_0x496250){_0x3d8e85=_0x496250;_0x447b60=0xc8;}else{_0x447b60=0xce;}_0x5dc359[_0x9a51('0x1b')](_0x447b60);return _0x5dc359[_0x9a51('0x21')](_0x9a51('0x22'),_0x4dc271+'-'+_0x3d8e85+'/'+_0x496250)[_0x9a51('0x1c')](_0x514392);}return null;};}function patchUpdates(_0x569e72){return function(_0x3b2ae5){try{jsonpatch[_0x9a51('0x23')](_0x3b2ae5,_0x569e72,!![]);}catch(_0x3e4144){return BPromise[_0x9a51('0x24')](_0x3e4144);}return _0x3b2ae5[_0x9a51('0x25')]();};}function saveUpdates(_0x36af8e,_0x1ed9b1){return function(_0x527034){if(_0x527034){return _0x527034[_0x9a51('0x26')](_0x36af8e)['then'](function(_0x376325){return _0x376325;});}return null;};}function removeEntity(_0x23d883,_0x3b5583){return function(_0x307e97){if(_0x307e97){return _0x307e97['destroy']()[_0x9a51('0x27')](function(){_0x23d883[_0x9a51('0x1b')](0xcc)[_0x9a51('0x28')]();});}};}function handleEntityNotFound(_0x3aa33c,_0x1dfa0f){return function(_0x1f25b5){if(!_0x1f25b5){_0x3aa33c['sendStatus'](0x194);}return _0x1f25b5;};}function handleError(_0x59e576,_0xb75b7){_0xb75b7=_0xb75b7||0x1f4;return function(_0x44e7a6){logger[_0x9a51('0x29')](_0x44e7a6[_0x9a51('0x2a')]);if(_0x44e7a6[_0x9a51('0x2b')]){delete _0x44e7a6[_0x9a51('0x2b')];}_0x59e576['status'](_0xb75b7)['send'](_0x44e7a6);};}exports[_0x9a51('0x2c')]=function(_0x40ab9f,_0x3fca81){var _0x357493={},_0x2694ee={},_0x52cfe2={'count':0x0,'rows':[]};var _0xc8261e=_['map'](db[_0x9a51('0x2d')][_0x9a51('0x2e')],function(_0x4a740e){return{'name':_0x4a740e[_0x9a51('0x2f')],'type':_0x4a740e[_0x9a51('0x30')][_0x9a51('0x31')]};});_0x2694ee[_0x9a51('0x32')]=_['map'](_0xc8261e,'name');_0x2694ee[_0x9a51('0x33')]=_[_0x9a51('0x34')](_0x40ab9f[_0x9a51('0x33')]);_0x2694ee[_0x9a51('0x35')]=_[_0x9a51('0x36')](_0x2694ee[_0x9a51('0x32')],_0x2694ee['query']);_0x357493[_0x9a51('0x37')]=_[_0x9a51('0x36')](_0x2694ee[_0x9a51('0x32')],qs[_0x9a51('0x38')](_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x38')]));_0x357493['attributes']=_0x357493[_0x9a51('0x37')][_0x9a51('0x39')]?_0x357493[_0x9a51('0x37')]:_0x2694ee[_0x9a51('0x32')];if(!_0x40ab9f[_0x9a51('0x33')]['hasOwnProperty'](_0x9a51('0x3a'))){_0x357493['limit']=qs[_0x9a51('0x20')](_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x20')]);_0x357493[_0x9a51('0x1d')]=qs[_0x9a51('0x1d')](_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x1d')]);}_0x357493[_0x9a51('0x3b')]=qs[_0x9a51('0x3c')](_0x40ab9f[_0x9a51('0x33')]['sort']);_0x357493['where']=qs[_0x9a51('0x35')](_[_0x9a51('0x3d')](_0x40ab9f[_0x9a51('0x33')],_0x2694ee[_0x9a51('0x35')]),_0xc8261e);if(_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x3e')]){_0x357493[_0x9a51('0x3f')]=_[_0x9a51('0x40')](_0x357493[_0x9a51('0x3f')],{'$or':_['map'](_0xc8261e,function(_0x2159c2){if(_0x2159c2['type']!==_0x9a51('0x41')){var _0x287b34={};_0x287b34[_0x2159c2[_0x9a51('0x2b')]]={'$like':'%'+_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x3e')]+'%'};return _0x287b34;}})});}_0x357493=_[_0x9a51('0x40')]({},_0x357493,_0x40ab9f[_0x9a51('0x42')]);var _0x2198bf={'where':_0x357493['where']};return db[_0x9a51('0x2d')][_0x9a51('0x1f')](_0x2198bf)[_0x9a51('0x27')](function(_0xdd1ecf){_0x52cfe2['count']=_0xdd1ecf;if(_0x40ab9f[_0x9a51('0x33')][_0x9a51('0x43')]){_0x357493[_0x9a51('0x44')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x9a51('0x45')](_0x357493);})['then'](function(_0x105e4c){_0x52cfe2[_0x9a51('0x46')]=_0x105e4c;return _0x52cfe2;})[_0x9a51('0x27')](respondWithFilteredResult(_0x3fca81,_0x357493))[_0x9a51('0x47')](handleError(_0x3fca81,null));};exports[_0x9a51('0x48')]=function(_0x29ac78,_0x24e5c5){var _0x2a6a0d={'raw':!![],'where':{'id':_0x29ac78[_0x9a51('0x49')]['id']}},_0x2df890={};_0x2df890['model']=_[_0x9a51('0x34')](db[_0x9a51('0x2d')][_0x9a51('0x2e')]);_0x2df890[_0x9a51('0x33')]=_[_0x9a51('0x34')](_0x29ac78['query']);_0x2df890[_0x9a51('0x35')]=_[_0x9a51('0x36')](_0x2df890[_0x9a51('0x32')],_0x2df890[_0x9a51('0x33')]);_0x2a6a0d[_0x9a51('0x37')]=_[_0x9a51('0x36')](_0x2df890['model'],qs['fields'](_0x29ac78[_0x9a51('0x33')][_0x9a51('0x38')]));_0x2a6a0d[_0x9a51('0x37')]=_0x2a6a0d[_0x9a51('0x37')][_0x9a51('0x39')]?_0x2a6a0d[_0x9a51('0x37')]:_0x2df890[_0x9a51('0x32')];if(_0x29ac78[_0x9a51('0x33')]['includeAll']){_0x2a6a0d['include']=[{'all':!![]}];}_0x2a6a0d=_[_0x9a51('0x40')]({},_0x2a6a0d,_0x29ac78[_0x9a51('0x42')]);return db['VoiceQueuesLog'][_0x9a51('0x4a')](_0x2a6a0d)[_0x9a51('0x27')](handleEntityNotFound(_0x24e5c5,null))[_0x9a51('0x27')](respondWithResult(_0x24e5c5,null))['catch'](handleError(_0x24e5c5,null));};exports['create']=function(_0x26c0a7,_0x4a28e3){return db['VoiceQueuesLog'][_0x9a51('0x4b')](_0x26c0a7[_0x9a51('0x4c')],{})[_0x9a51('0x27')](respondWithResult(_0x4a28e3,0xc9))[_0x9a51('0x47')](handleError(_0x4a28e3,null));};exports[_0x9a51('0x26')]=function(_0x4d9341,_0x360556){if(_0x4d9341['body']['id']){delete _0x4d9341[_0x9a51('0x4c')]['id'];}return db[_0x9a51('0x2d')][_0x9a51('0x4a')]({'where':{'id':_0x4d9341['params']['id']}})[_0x9a51('0x27')](handleEntityNotFound(_0x360556,null))['then'](saveUpdates(_0x4d9341[_0x9a51('0x4c')],null))['then'](respondWithResult(_0x360556,null))[_0x9a51('0x47')](handleError(_0x360556,null));};exports[_0x9a51('0x4d')]=function(_0x5d0ff0,_0x2bb4d1){return db['VoiceQueuesLog'][_0x9a51('0x4a')]({'where':{'id':_0x5d0ff0[_0x9a51('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bb4d1,null))[_0x9a51('0x27')](removeEntity(_0x2bb4d1,null))[_0x9a51('0x47')](handleError(_0x2bb4d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index f24b52c..a2c57f9 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 _0xd3d1=['event','dtm','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0xd3d1,0x172));var _0x1d3d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd3d1[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var rp=require(_0x1d3d('0x4'));var fs=require('fs');var path=require(_0x1d3d('0x5'));var rimraf=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var attributes=require(_0x1d3d('0x8'));module[_0x1d3d('0x9')]=function(_0x1cbe06,_0x449475){return _0x1cbe06[_0x1d3d('0xa')](_0x1d3d('0xb'),attributes,{'tableName':_0x1d3d('0xc'),'paranoid':![],'indexes':[{'name':_0x1d3d('0xd'),'fields':[_0x1d3d('0xe'),_0x1d3d('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5636=['define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x239039,_0x3bd412){var _0xb5fb6c=function(_0x39750f){while(--_0x39750f){_0x239039['push'](_0x239039['shift']());}};_0xb5fb6c(++_0x3bd412);}(_0x5636,0x102));var _0x6563=function(_0x599df6,_0x12bdf2){_0x599df6=_0x599df6-0x0;var _0x1c8393=_0x5636[_0x599df6];return _0x1c8393;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6563('0x2'));var rp=require(_0x6563('0x3'));var fs=require('fs');var path=require(_0x6563('0x4'));var rimraf=require('rimraf');var config=require(_0x6563('0x5'));var attributes=require(_0x6563('0x6'));module[_0x6563('0x7')]=function(_0x39792f,_0x29f687){return _0x39792f[_0x6563('0x8')](_0x6563('0x9'),attributes,{'tableName':_0x6563('0xa'),'paranoid':![],'indexes':[{'name':_0x6563('0xb'),'fields':[_0x6563('0xc'),_0x6563('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 999366a..4f76324 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 _0x3c0d=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x4287b0,_0x5e551c){var _0x1e6a1e=function(_0x1b2735){while(--_0x1b2735){_0x4287b0['push'](_0x4287b0['shift']());}};_0x1e6a1e(++_0x5e551c);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x1e131e,_0x1561a2){_0x1e131e=_0x1e131e-0x0;var _0x2e8392=_0x3c0d[_0x1e131e];return _0x2e8392;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd3c0('0x0'));var rs=require(_0xd3c0('0x1'));var fs=require('fs');var Redis=require(_0xd3c0('0x2'));var db=require(_0xd3c0('0x3'))['db'];var utils=require(_0xd3c0('0x4'));var logger=require(_0xd3c0('0x5'))(_0xd3c0('0x6'));var config=require(_0xd3c0('0x7'));var jayson=require(_0xd3c0('0x8'));var client=jayson['client'][_0xd3c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47fa5f,_0x6308e2,_0x10f804){return new BPromise(function(_0x2c37b8,_0x2d11d5){return client[_0xd3c0('0xa')](_0x47fa5f,_0x10f804)[_0xd3c0('0xb')](function(_0x2be3c0){logger[_0xd3c0('0xc')](_0xd3c0('0xd'),_0x6308e2,_0xd3c0('0xe'));logger['debug'](_0xd3c0('0xf'),_0x6308e2,_0xd3c0('0xe'),JSON['stringify'](_0x2be3c0));if(_0x2be3c0['error']){if(_0x2be3c0[_0xd3c0('0x10')][_0xd3c0('0x11')]===0x1f4){logger[_0xd3c0('0x10')](_0xd3c0('0xd'),_0x6308e2,_0x2be3c0['error'][_0xd3c0('0x12')]);return _0x2d11d5(_0x2be3c0[_0xd3c0('0x10')][_0xd3c0('0x12')]);}logger['error'](_0xd3c0('0xd'),_0x6308e2,_0x2be3c0[_0xd3c0('0x10')][_0xd3c0('0x12')]);return _0x2c37b8(_0x2be3c0[_0xd3c0('0x10')][_0xd3c0('0x12')]);}else{logger[_0xd3c0('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x6308e2,'request\x20sent');_0x2c37b8(_0x2be3c0[_0xd3c0('0x13')][_0xd3c0('0x12')]);}})['catch'](function(_0x3e9b6b){logger[_0xd3c0('0x10')](_0xd3c0('0xd'),_0x6308e2,_0x3e9b6b);_0x2d11d5(_0x3e9b6b);});});} \ No newline at end of file +var _0xf6e8=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x569baa,_0x278c26){var _0x1588b5=function(_0x4dc3dd){while(--_0x4dc3dd){_0x569baa['push'](_0x569baa['shift']());}};_0x1588b5(++_0x278c26);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x286cae,_0x5c1460){_0x286cae=_0x286cae-0x0;var _0x504c10=_0xf6e8[_0x286cae];return _0x504c10;};'use strict';var _=require('lodash');var util=require(_0x8f6e('0x0'));var moment=require(_0x8f6e('0x1'));var BPromise=require(_0x8f6e('0x2'));var rs=require(_0x8f6e('0x3'));var fs=require('fs');var Redis=require(_0x8f6e('0x4'));var db=require(_0x8f6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f6e('0x6'))('rpc');var config=require(_0x8f6e('0x7'));var jayson=require(_0x8f6e('0x8'));var client=jayson['client'][_0x8f6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233158,_0xd26126,_0x71b52c){return new BPromise(function(_0x423ed4,_0x105076){return client[_0x8f6e('0xa')](_0x233158,_0x71b52c)[_0x8f6e('0xb')](function(_0x364ade){logger[_0x8f6e('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'));logger[_0x8f6e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'),JSON[_0x8f6e('0xf')](_0x364ade));if(_0x364ade[_0x8f6e('0x10')]){if(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x11')]===0x1f4){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);return _0x105076(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);}logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade['error'][_0x8f6e('0x13')]);return _0x423ed4(_0x364ade[_0x8f6e('0x10')]['message']);}else{logger[_0x8f6e('0xc')](_0x8f6e('0x12'),_0xd26126,_0x8f6e('0xd'));_0x423ed4(_0x364ade['result']['message']);}})['catch'](function(_0x201991){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x201991);_0x105076(_0x201991);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index e392294..c28fc9e 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 _0x9f17=['/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put','update','delete'];(function(_0x3a245e,_0x45d365){var _0x417388=function(_0x30a692){while(--_0x30a692){_0x3a245e['push'](_0x3a245e['shift']());}};_0x417388(++_0x45d365);}(_0x9f17,0xf5));var _0x79f1=function(_0x5d5765,_0x20987f){_0x5d5765=_0x5d5765-0x0;var _0x3b9df4=_0x9f17[_0x5d5765];return _0x3b9df4;};'use strict';var multer=require('multer');var util=require(_0x79f1('0x0'));var path=require(_0x79f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x79f1('0x2'));var router=express[_0x79f1('0x3')]();var fs_extra=require(_0x79f1('0x4'));var auth=require(_0x79f1('0x5'));var interaction=require(_0x79f1('0x6'));var config=require(_0x79f1('0x7'));var controller=require(_0x79f1('0x8'));router[_0x79f1('0x9')]('/',auth[_0x79f1('0xa')](),controller[_0x79f1('0xb')]);router[_0x79f1('0x9')](_0x79f1('0xc'),auth['isAuthenticated'](),controller[_0x79f1('0xd')]);router[_0x79f1('0x9')]('/:id',auth[_0x79f1('0xa')](),controller[_0x79f1('0xe')]);router[_0x79f1('0x9')](_0x79f1('0xf'),auth[_0x79f1('0xa')](),controller[_0x79f1('0x10')]);router[_0x79f1('0x9')]('/:id/downloads',controller[_0x79f1('0x11')]);router['get'](_0x79f1('0x12'),auth[_0x79f1('0xa')](),controller[_0x79f1('0x13')]);router['post']('/',auth[_0x79f1('0xa')](),controller[_0x79f1('0x14')]);router['post'](_0x79f1('0x12'),auth['isAuthenticated'](),controller[_0x79f1('0x15')]);router[_0x79f1('0x16')]('/:id',auth[_0x79f1('0xa')](),controller[_0x79f1('0x17')]);router[_0x79f1('0x18')](_0x79f1('0x19'),auth[_0x79f1('0xa')](),controller['destroy']);module[_0x79f1('0x1a')]=router; \ No newline at end of file +var _0x222f=['downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download','download','/:id/downloads'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x222f,0x1a0));var _0xf222=function(_0x17a750,_0x8b9552){_0x17a750=_0x17a750-0x0;var _0x307b72=_0x222f[_0x17a750];return _0x307b72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf222('0x0'));var timeout=require(_0xf222('0x1'));var express=require('express');var router=express[_0xf222('0x2')]();var fs_extra=require(_0xf222('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf222('0x4'));var config=require(_0xf222('0x5'));var controller=require(_0xf222('0x6'));router['get']('/',auth[_0xf222('0x7')](),controller[_0xf222('0x8')]);router[_0xf222('0x9')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x9')]('/:id',auth[_0xf222('0x7')](),controller[_0xf222('0xc')]);router[_0xf222('0x9')](_0xf222('0xd'),auth[_0xf222('0x7')](),controller[_0xf222('0xe')]);router['get'](_0xf222('0xf'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0xf222('0x10')]);router[_0xf222('0x11')]('/',auth[_0xf222('0x7')](),controller[_0xf222('0x12')]);router[_0xf222('0x11')](_0xf222('0x13'),auth[_0xf222('0x7')](),controller[_0xf222('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf222('0x15')]);router['delete']('/:id',auth[_0xf222('0x7')](),controller[_0xf222('0x16')]);module[_0xf222('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f9f1642..3491ff0 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(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 9595eaa..d4c55cc 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 _0x9ecd=['update','then','destroy','error','stack','name','send','index','map','rawAttributes','model','differenceBy','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','VoiceRecording','includeAll','include','rows','catch','params','intersection','find','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','format','recording','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','sentiment','sentimentRegion','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x2e9324,_0x5518c7){var _0x26311b=function(_0x11f57e){while(--_0x11f57e){_0x2e9324['push'](_0x2e9324['shift']());}};_0x26311b(++_0x5518c7);}(_0x9ecd,0x6c));var _0xd9ec=function(_0x50e101,_0x5457f8){_0x50e101=_0x50e101-0x0;var _0x10b88f=_0x9ecd[_0x50e101];return _0x10b88f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ec('0x0'));var rp=require(_0xd9ec('0x1'));var moment=require(_0xd9ec('0x2'));var BPromise=require(_0xd9ec('0x3'));var Mustache=require('mustache');var util=require(_0xd9ec('0x4'));var path=require(_0xd9ec('0x5'));var sox=require(_0xd9ec('0x6'));var csv=require(_0xd9ec('0x7'));var ejs=require(_0xd9ec('0x8'));var fs=require('fs');var fs_extra=require(_0xd9ec('0x9'));var _=require(_0xd9ec('0xa'));var squel=require(_0xd9ec('0xb'));var crypto=require(_0xd9ec('0xc'));var jsforce=require(_0xd9ec('0xd'));var deskjs=require(_0xd9ec('0xe'));var toCsv=require(_0xd9ec('0x7'));var querystring=require('querystring');var Papa=require(_0xd9ec('0xf'));var AWS=require(_0xd9ec('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xd9ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd9ec('0x12'));var as=require(_0xd9ec('0x13'));var hardwareService=require(_0xd9ec('0x14'));var logger=require('../../config/logger')(_0xd9ec('0x15'));var utils=require(_0xd9ec('0x16'));var config=require(_0xd9ec('0x17'));var licenseUtil=require(_0xd9ec('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fb178,_0x1dba5d){_0x1dba5d=_0x1dba5d||0xcc;return function(_0x10cbf9){if(_0x10cbf9){return _0x3fb178['sendStatus'](_0x1dba5d);}return _0x3fb178[_0xd9ec('0x19')](_0x1dba5d)[_0xd9ec('0x1a')]();};}function respondWithResult(_0x1ba2f7,_0x516eef){_0x516eef=_0x516eef||0xc8;return function(_0x1b0994){if(_0x1b0994){return _0x1ba2f7['status'](_0x516eef)['json'](_0x1b0994);}};}function respondWithFilteredResult(_0x488996,_0x4ecd99){return function(_0x48271a){if(_0x48271a){var _0x8ea1f6=typeof _0x4ecd99[_0xd9ec('0x1b')]===_0xd9ec('0x1c')&&typeof _0x4ecd99[_0xd9ec('0x1d')]==='undefined';var _0x3158b7=_0x48271a[_0xd9ec('0x1e')];var _0x5a5c1c=_0x8ea1f6?0x0:_0x4ecd99[_0xd9ec('0x1b')];var _0x575459=_0x8ea1f6?_0x48271a[_0xd9ec('0x1e')]:_0x4ecd99[_0xd9ec('0x1b')]+_0x4ecd99['limit'];var _0x48025c;if(_0x575459>=_0x3158b7){_0x575459=_0x3158b7;_0x48025c=0xc8;}else{_0x48025c=0xce;}_0x488996[_0xd9ec('0x19')](_0x48025c);return _0x488996[_0xd9ec('0x1f')](_0xd9ec('0x20'),_0x5a5c1c+'-'+_0x575459+'/'+_0x3158b7)[_0xd9ec('0x21')](_0x48271a);}return null;};}function patchUpdates(_0x343367){return function(_0x43f39e){try{jsonpatch[_0xd9ec('0x22')](_0x43f39e,_0x343367,!![]);}catch(_0x120bdc){return BPromise[_0xd9ec('0x23')](_0x120bdc);}return _0x43f39e[_0xd9ec('0x24')]();};}function saveUpdates(_0x3dbcc0,_0xa16891){return function(_0x25dc6b){if(_0x25dc6b){return _0x25dc6b[_0xd9ec('0x25')](_0x3dbcc0)[_0xd9ec('0x26')](function(_0x405660){return _0x405660;});}return null;};}function removeEntity(_0x1d31f5,_0xda0910){return function(_0x34dec3){if(_0x34dec3){return _0x34dec3[_0xd9ec('0x27')]()[_0xd9ec('0x26')](function(){_0x1d31f5['status'](0xcc)[_0xd9ec('0x1a')]();});}};}function handleEntityNotFound(_0x1b4907,_0x5be303){return function(_0x5d716b){if(!_0x5d716b){_0x1b4907['sendStatus'](0x194);}return _0x5d716b;};}function handleError(_0x54ce1d,_0x1d45a5){_0x1d45a5=_0x1d45a5||0x1f4;return function(_0xf4d3e6){logger[_0xd9ec('0x28')](_0xf4d3e6[_0xd9ec('0x29')]);if(_0xf4d3e6['name']){delete _0xf4d3e6[_0xd9ec('0x2a')];}_0x54ce1d['status'](_0x1d45a5)[_0xd9ec('0x2b')](_0xf4d3e6);};}exports[_0xd9ec('0x2c')]=function(_0x18d524,_0x294e65){var _0xde0268={},_0x1a45e2={},_0x42dc05={'count':0x0,'rows':[]};var _0x3f0145=_[_0xd9ec('0x2d')](db['VoiceRecording'][_0xd9ec('0x2e')],function(_0x1308ff){return{'name':_0x1308ff['fieldName'],'type':_0x1308ff['type']['key']};});_0x1a45e2[_0xd9ec('0x2f')]=_[_0xd9ec('0x30')](_[_0xd9ec('0x2d')](_0x3f0145,_0xd9ec('0x2a')),['format']);_0x1a45e2['query']=_[_0xd9ec('0x31')](_0x18d524[_0xd9ec('0x32')]);_0x1a45e2[_0xd9ec('0x33')]=_['intersection'](_0x1a45e2[_0xd9ec('0x2f')],_0x1a45e2[_0xd9ec('0x32')]);_0xde0268[_0xd9ec('0x34')]=_['intersection'](_0x1a45e2['model'],qs['fields'](_0x18d524[_0xd9ec('0x32')][_0xd9ec('0x35')]));_0xde0268[_0xd9ec('0x34')]=_0xde0268['attributes'][_0xd9ec('0x36')]?_0xde0268[_0xd9ec('0x34')]:_0x1a45e2[_0xd9ec('0x2f')];if(!_0x18d524[_0xd9ec('0x32')][_0xd9ec('0x37')](_0xd9ec('0x38'))){_0xde0268[_0xd9ec('0x1d')]=qs[_0xd9ec('0x1d')](_0x18d524[_0xd9ec('0x32')][_0xd9ec('0x1d')]);_0xde0268[_0xd9ec('0x1b')]=qs[_0xd9ec('0x1b')](_0x18d524['query'][_0xd9ec('0x1b')]);}_0xde0268['order']=qs[_0xd9ec('0x39')](_0x18d524['query'][_0xd9ec('0x39')]);_0xde0268[_0xd9ec('0x3a')]=qs[_0xd9ec('0x33')](_['pick'](_0x18d524[_0xd9ec('0x32')],_0x1a45e2[_0xd9ec('0x33')]),_0x3f0145);if(_0x18d524['query']['filter']){_0xde0268[_0xd9ec('0x3a')]=_[_0xd9ec('0x3b')](_0xde0268[_0xd9ec('0x3a')],{'$or':_[_0xd9ec('0x2d')](_0x3f0145,function(_0x52ebb1){if(_0x52ebb1[_0xd9ec('0x3c')]!==_0xd9ec('0x3d')){var _0x1bd870={};_0x1bd870[_0x52ebb1[_0xd9ec('0x2a')]]={'$like':'%'+_0x18d524[_0xd9ec('0x32')][_0xd9ec('0x3e')]+'%'};return _0x1bd870;}})});}_0xde0268=_[_0xd9ec('0x3b')]({},_0xde0268,_0x18d524[_0xd9ec('0x3f')]);var _0x46c631={'where':_0xde0268[_0xd9ec('0x3a')]};return db[_0xd9ec('0x40')][_0xd9ec('0x1e')](_0x46c631)['then'](function(_0x3e9bea){_0x42dc05[_0xd9ec('0x1e')]=_0x3e9bea;if(_0x18d524[_0xd9ec('0x32')][_0xd9ec('0x41')]){_0xde0268[_0xd9ec('0x42')]=[{'all':!![]}];}return db[_0xd9ec('0x40')]['findAll'](_0xde0268);})['then'](function(_0x517577){_0x42dc05[_0xd9ec('0x43')]=_0x517577;return _0x42dc05;})['then'](respondWithFilteredResult(_0x294e65,_0xde0268))[_0xd9ec('0x44')](handleError(_0x294e65,null));};exports['show']=function(_0xed309a,_0xe0944f){var _0x4f2c00={'raw':![],'where':{'id':_0xed309a[_0xd9ec('0x45')]['id']}},_0xcff448={};_0xcff448['model']=_['keys'](db['VoiceRecording']['rawAttributes']);_0xcff448['query']=_['keys'](_0xed309a['query']);_0xcff448[_0xd9ec('0x33')]=_[_0xd9ec('0x46')](_0xcff448[_0xd9ec('0x2f')],_0xcff448[_0xd9ec('0x32')]);_0x4f2c00[_0xd9ec('0x34')]=_[_0xd9ec('0x46')](_0xcff448['model'],qs['fields'](_0xed309a['query'][_0xd9ec('0x35')]));_0x4f2c00['attributes']=_0x4f2c00[_0xd9ec('0x34')][_0xd9ec('0x36')]?_0x4f2c00[_0xd9ec('0x34')]:_0xcff448[_0xd9ec('0x2f')];if(_0xed309a[_0xd9ec('0x32')][_0xd9ec('0x41')]){_0x4f2c00[_0xd9ec('0x42')]=[{'all':!![]}];}_0x4f2c00=_[_0xd9ec('0x3b')]({},_0x4f2c00,_0xed309a[_0xd9ec('0x3f')]);return db[_0xd9ec('0x40')][_0xd9ec('0x47')](_0x4f2c00)['then'](handleEntityNotFound(_0xe0944f,null))[_0xd9ec('0x26')](respondWithResult(_0xe0944f,null))[_0xd9ec('0x44')](handleError(_0xe0944f,null));};exports[_0xd9ec('0x48')]=function(_0x157888,_0x2b5143){return db[_0xd9ec('0x40')][_0xd9ec('0x48')](_0x157888[_0xd9ec('0x49')],{})[_0xd9ec('0x26')](respondWithResult(_0x2b5143,0xc9))[_0xd9ec('0x44')](handleError(_0x2b5143,null));};exports[_0xd9ec('0x25')]=function(_0x19f86f,_0x2128be){if(_0x19f86f[_0xd9ec('0x49')]['id']){delete _0x19f86f[_0xd9ec('0x49')]['id'];}return db[_0xd9ec('0x40')]['find']({'where':{'id':_0x19f86f[_0xd9ec('0x45')]['id']}})[_0xd9ec('0x26')](handleEntityNotFound(_0x2128be,null))['then'](saveUpdates(_0x19f86f[_0xd9ec('0x49')],null))[_0xd9ec('0x26')](respondWithResult(_0x2128be,null))['catch'](handleError(_0x2128be,null));};exports[_0xd9ec('0x4a')]=function(_0x4c3b00,_0x1c0607){return db[_0xd9ec('0x40')][_0xd9ec('0x4a')]()[_0xd9ec('0x26')](respondWithResult(_0x1c0607,null))[_0xd9ec('0x44')](handleError(_0x1c0607,null));};exports[_0xd9ec('0x4b')]=function(_0x39a518,_0x5804d8,_0x3b92ac){var _0x2ffff2=require('../../components/encryptor');var _0xb30bec=![];var _0x12a875={};if(_0x39a518[_0xd9ec('0x32')][_0xd9ec('0x3c')]&&_0x39a518[_0xd9ec('0x32')][_0xd9ec('0x3c')]===_0xd9ec('0x4c')){_0x12a875[_0xd9ec('0x4c')]=_0x39a518[_0xd9ec('0x45')]['id'];}else{_0x12a875['id']=_0x39a518[_0xd9ec('0x45')]['id'];}return db[_0xd9ec('0x40')][_0xd9ec('0x47')]({'where':_0x12a875,'attributes':['id',_0xd9ec('0x4d')],'raw':!![]})[_0xd9ec('0x26')](handleEntityNotFound(_0x5804d8,null))[_0xd9ec('0x26')](function(_0x3abf55){if(_0x3abf55){var _0x50171b=_0x3abf55['value'];var _0x4631f1=util['format'](_0xd9ec('0x4e'),_0x50171b);if(fs['existsSync'](_0x4631f1)){_0xb30bec=!![];return _0x2ffff2[_0xd9ec('0x4f')](_0x4631f1,_0x50171b,config[_0xd9ec('0x50')]['recording'])[_0xd9ec('0x26')](function(){return _0x3abf55;});}return _0x3abf55;}})['then'](function(_0x3754ff){if(_0x3754ff){var _0x5192ff=_0x3754ff[_0xd9ec('0x4d')];if(!fs[_0xd9ec('0x51')](_0x5192ff)){throw new db[(_0xd9ec('0x52'))][(_0xd9ec('0x53'))](_0xd9ec('0x54'));}if(_0x3754ff['filename']){return _0x5804d8['download'](_0x5192ff,_0x3754ff[_0xd9ec('0x55')]+path[_0xd9ec('0x56')](_0x5192ff),function(){if(_0xb30bec){fs[_0xd9ec('0x57')](_0x5192ff);}});}else{return _0x5804d8[_0xd9ec('0x4b')](_0x5192ff,function(_0x14703b){if(_0xb30bec){fs[_0xd9ec('0x57')](_0x5192ff);}});}}})['catch'](function(_0x53ab11){if(_0x53ab11['message']===_0xd9ec('0x54')){_0x5804d8[_0xd9ec('0x19')](0x194)[_0xd9ec('0x2b')]('Not\x20found');}else{return handleError(_0x5804d8,null);}});};exports[_0xd9ec('0x58')]=function(_0xa8bfeb,_0x259820,_0x5aee0c){var _0x542185=require(_0xd9ec('0x59'));var _0x439fa9=![];var _0x1ef425={'$and':[db[_0xd9ec('0x5a')]['where'](db[_0xd9ec('0x5a')]['fn'](_0xd9ec('0x5b'),db['sequelize'][_0xd9ec('0x5c')](_0xd9ec('0x4c'))),_0xa8bfeb['query'][_0xd9ec('0x5d')])]};if(_0xa8bfeb[_0xd9ec('0x32')][_0xd9ec('0x3c')]&&_0xa8bfeb['query'][_0xd9ec('0x3c')]===_0xd9ec('0x4c')){_0x1ef425[_0xd9ec('0x5e')][_0xd9ec('0x5f')]({'uniqueid':_0xa8bfeb[_0xd9ec('0x45')]['id']});}else{_0x1ef425[_0xd9ec('0x5e')][_0xd9ec('0x5f')]({'id':_0xa8bfeb['params']['id']});}return db[_0xd9ec('0x40')][_0xd9ec('0x47')]({'where':_0x1ef425,'attributes':['id',_0xd9ec('0x4d')],'raw':!![]})[_0xd9ec('0x26')](handleEntityNotFound(_0x259820,null))[_0xd9ec('0x26')](function(_0x3ca7b3){if(_0x3ca7b3){var _0x35b3a5=util[_0xd9ec('0x60')](_0xd9ec('0x4e'),_0x3ca7b3[_0xd9ec('0x4d')]);if(fs['existsSync'](_0x35b3a5)){_0x439fa9=!![];return _0x542185[_0xd9ec('0x4f')](_0x35b3a5,_0x3ca7b3[_0xd9ec('0x4d')],config[_0xd9ec('0x50')][_0xd9ec('0x61')])[_0xd9ec('0x26')](function(){return _0x3ca7b3;});}return _0x3ca7b3;}})[_0xd9ec('0x26')](function(_0x4166df){if(_0x4166df){if(!fs[_0xd9ec('0x51')](_0x4166df[_0xd9ec('0x4d')])){throw new db[(_0xd9ec('0x52'))][(_0xd9ec('0x53'))](_0xd9ec('0x54'));}if(_0x4166df[_0xd9ec('0x55')]){return _0x259820[_0xd9ec('0x4b')](_0x4166df[_0xd9ec('0x4d')],_0x4166df[_0xd9ec('0x55')]+path[_0xd9ec('0x56')](_0x4166df['value']),function(){if(_0x439fa9){fs[_0xd9ec('0x57')](_0x4166df['value']);}});}else{return _0x259820['download'](_0x4166df['value'],function(_0x270dae){if(_0x439fa9){fs[_0xd9ec('0x57')](_0x4166df['value']);}});}}})[_0xd9ec('0x44')](handleError(_0x259820,null));};exports[_0xd9ec('0x27')]=function(_0x8409bf,_0x4e3da4){return db[_0xd9ec('0x40')][_0xd9ec('0x47')]({'where':{'id':_0x8409bf['params']['id']}})[_0xd9ec('0x26')](function(_0x137cee){if(_[_0xd9ec('0x62')](_0x137cee)){throw new ReferenceError(_0xd9ec('0x63'));}return _0x137cee;})[_0xd9ec('0x26')](function(_0x1727f3){var _0x11754f=_0x1727f3['value'];logger[_0xd9ec('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x11754f);if(!_['isNil'](_0x1727f3['value'])&&fs['existsSync'](_0x11754f)){logger['info'](_0xd9ec('0x65')+_0x11754f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x11754f);}_0x11754f=_0x11754f+_0xd9ec('0x66');if(!_[_0xd9ec('0x62')](_0x1727f3['value'])&&fs[_0xd9ec('0x51')](_0x11754f)){logger['info'](_0xd9ec('0x65')+_0x11754f+_0xd9ec('0x67'));fs[_0xd9ec('0x68')](_0x11754f);}return _0x1727f3;})[_0xd9ec('0x26')](function(_0x31b790){if(!_0x31b790)throw new InternalError();return _0x31b790[_0xd9ec('0x27')]();})[_0xd9ec('0x26')](function(){_0x4e3da4['status'](0xcc)[_0xd9ec('0x1a')]();})[_0xd9ec('0x44')](handleError(_0x4e3da4,null));};function getBucketslist(_0x9f7ba0,_0x4fa878,_0x44051d){return new Promise(function(_0xeaa69e,_0x2d6080){var _0x23edc2=new AWS['S3']({'accessKeyId':_0x4fa878,'secretAccessKey':_0x9f7ba0,'region':_0x44051d});_0x23edc2[_0xd9ec('0x69')]({},function(_0x310325,_0x2e4068){if(_0x310325){return _0x2d6080(_0x310325);}else{return _0xeaa69e(_0x2e4068);}});});}function createBucket(_0x185909,_0x35661a,_0x590a7a,_0x51c3f4){return new Promise(function(_0x4be0e5,_0x38740e){var _0x2223bd=new AWS['S3']({'accessKeyId':_0x35661a,'secretAccessKey':_0x185909,'region':_0x590a7a});_0x2223bd[_0xd9ec('0x6a')]({'Bucket':_0x51c3f4},function(_0x1564c8,_0xa54016){if(_0x1564c8){return _0x38740e(_0x1564c8);}else{return _0x4be0e5(_0xa54016);}});});}function uploadFile(_0x1088ab,_0xa0ae21,_0x4db2dc,_0x27ac8e,_0x146a0c,_0xbfbcb4){return new Promise(function(_0x22f75f,_0x5856c0){var _0x707011=new AWS['S3']({'accessKeyId':_0xa0ae21,'secretAccessKey':_0x1088ab,'region':_0x4db2dc});_0x707011['upload']({'Bucket':_0x27ac8e,'Key':_0x146a0c,'Body':_0xbfbcb4},function(_0x5b8e9a,_0xebdf57){if(_0x5b8e9a){return _0x5856c0(_0x5b8e9a);}else{return _0x22f75f(_0xebdf57);}});});}function startTranscribe(_0x5193ce,_0x56f9b9,_0x26b612,_0x19cf0a,_0x4c4d37,_0x17a1ef){return new Promise(function(_0x2eaa1e,_0x11c5aa){var _0x16d26a=new AWS['TranscribeService']({'accessKeyId':_0x56f9b9,'secretAccessKey':_0x5193ce,'region':_0x26b612});_0x16d26a[_0xd9ec('0x6b')]({'TranscriptionJobName':_0x19cf0a,'LanguageCode':_0x4c4d37,'Media':{'MediaFileUri':_0x17a1ef}},function(_0x5bd0cd,_0x316c1c){if(_0x5bd0cd){return _0x11c5aa(_0x5bd0cd);}else{return _0x2eaa1e(_0x316c1c);}});});}function transcribe(_0x32cd6a,_0x12da2b,_0x57744d,_0x50c1e7,_0x59ec80,_0x12e6be,_0x45d01c){return new Promise(function(_0x508e0e,_0x4f6da0){var _0x48083e={};logger['info'](util[_0xd9ec('0x60')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x32cd6a,_0x59ec80));return uploadFile(_0x12da2b,_0x57744d,_0x50c1e7,_0x59ec80,path['basename'](_0x12e6be),fs[_0xd9ec('0x6c')](_0x12e6be))[_0xd9ec('0x26')](function(_0x1c761e){logger[_0xd9ec('0x64')](util[_0xd9ec('0x60')](_0xd9ec('0x6d'),_0x32cd6a,_0x59ec80,_0x1c761e[_0xd9ec('0x6e')]));_0x48083e[_0xd9ec('0x6f')]=_0x1c761e[_0xd9ec('0x70')];_0x48083e[_0xd9ec('0x71')]=_0x1c761e[_0xd9ec('0x6e')];logger[_0xd9ec('0x64')](util[_0xd9ec('0x60')](_0xd9ec('0x72'),_0x32cd6a));return startTranscribe(_0x12da2b,_0x57744d,_0x50c1e7,uuidv4(),_0x45d01c,_0x1c761e['Location']);})[_0xd9ec('0x26')](function(_0x4a5711){logger['info'](util['format'](_0xd9ec('0x73'),_0x32cd6a,_0x4a5711[_0xd9ec('0x74')]['TranscriptionJobName']));_0x48083e[_0xd9ec('0x75')]=_0x4a5711[_0xd9ec('0x74')][_0xd9ec('0x76')];_0x48083e[_0xd9ec('0x77')]=_0x4a5711[_0xd9ec('0x74')]['TranscriptionJobStatus'];return _0x508e0e(_0x48083e);})['catch'](function(_0x24dbbc){return _0x4f6da0(_0x24dbbc);});});}exports[_0xd9ec('0x78')]=function(_0x34abbf,_0x196deb,_0x7a1457){var _0x2f7cfa;var _0x2f11b6;var _0xcdcbd3;var _0x16cf6b=require(_0xd9ec('0x59'));return db[_0xd9ec('0x40')][_0xd9ec('0x79')]({'where':{'id':_0x34abbf[_0xd9ec('0x45')]['id']}})['then'](function(_0x7939e6){if(_0x7939e6){var _0xd2e119=util[_0xd9ec('0x60')](_0xd9ec('0x4e'),_0x7939e6[_0xd9ec('0x4d')]);if(fs[_0xd9ec('0x51')](_0xd2e119)){cypher=!![];return _0x16cf6b['decryptFile'](_0xd2e119,_0x7939e6[_0xd9ec('0x4d')],config[_0xd9ec('0x50')][_0xd9ec('0x61')])['then'](function(){return _0x7939e6;});}return _0x7939e6;}})['then'](function(_0x2d1bb1){if(!_0x2d1bb1){throw new db[(_0xd9ec('0x52'))][(_0xd9ec('0x53'))](_0xd9ec('0x7a'));}_0x2f11b6=_0x2d1bb1;return db[_0xd9ec('0x7b')][_0xd9ec('0x79')]({'where':{'id':0x1}});})[_0xd9ec('0x26')](handleEntityNotFound(_0x196deb,null))[_0xd9ec('0x26')](function(_0x1a90f6){if(_0x1a90f6){_0x2f7cfa=_0x1a90f6;if(!_0x2f7cfa[_0xd9ec('0x7c')]||!_0x2f7cfa[_0xd9ec('0x7d')]||!_0x2f7cfa['transcribeRegion']||!_0x2f7cfa[_0xd9ec('0x7e')]||!_0x2f7cfa['bucket']){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0x34abbf[_0xd9ec('0x49')]['runSentiment']&&(!_0x2f7cfa[_0xd9ec('0x7f')]||!_0x2f7cfa['sentimentAccountId']||!_0x2f7cfa[_0xd9ec('0x80')]||!_0x2f7cfa[_0xd9ec('0x7e')]||!_0x2f7cfa['bucket'])){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xd9ec('0x79')]({'where':{'id':_0x2f7cfa['transcribeAccountId']}});}})[_0xd9ec('0x26')](function(_0x58ca5a){if(!_0x58ca5a){throw new db['Sequelize']['ValidationError'](_0xd9ec('0x81'));}if(!_0x58ca5a['data1']||!_0x58ca5a[_0xd9ec('0x82')]){throw new db[(_0xd9ec('0x52'))][(_0xd9ec('0x53'))](_0xd9ec('0x83'));}_0xcdcbd3=_0x58ca5a;return getBucketslist(_0xcdcbd3['data1'],_0xcdcbd3['data2'],_0x2f7cfa[_0xd9ec('0x84')]);})['then'](function(_0x34ad21){if(_0x34ad21&&_0x34ad21['Buckets']){var _0x5129e4=_[_0xd9ec('0x47')](_0x34ad21[_0xd9ec('0x85')],function(_0x25dd98){return _0x25dd98[_0xd9ec('0x86')]===_0x2f7cfa[_0xd9ec('0x6f')];});if(!_0x5129e4){logger[_0xd9ec('0x64')](util[_0xd9ec('0x60')](_0xd9ec('0x87'),_0x34abbf[_0xd9ec('0x45')]['id'],_0x2f7cfa[_0xd9ec('0x6f')]));return createBucket(_0xcdcbd3[_0xd9ec('0x88')],_0xcdcbd3[_0xd9ec('0x82')],_0x2f7cfa['transcribeRegion'],_0x2f7cfa['bucket']);}logger[_0xd9ec('0x64')](util[_0xd9ec('0x60')](_0xd9ec('0x89'),_0x34abbf[_0xd9ec('0x45')]['id'],_0x2f7cfa[_0xd9ec('0x6f')]));return;}})[_0xd9ec('0x26')](function(_0x182ef2){if(_0x2f11b6[_0xd9ec('0x77')]===_0xd9ec('0x8a')){return transcribe(_0x34abbf[_0xd9ec('0x45')]['id'],_0xcdcbd3['data1'],_0xcdcbd3[_0xd9ec('0x82')],_0x2f7cfa[_0xd9ec('0x84')],_0x2f7cfa[_0xd9ec('0x6f')],_0x2f11b6[_0xd9ec('0x4d')],_0x2f7cfa[_0xd9ec('0x7e')]);}else{logger[_0xd9ec('0x64')](util[_0xd9ec('0x60')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x34abbf[_0xd9ec('0x45')]['id']));return{'transcribeStatus':_0xd9ec('0x8b')};}})[_0xd9ec('0x26')](function(_0x5b3e21){if(_0x5b3e21){_0x5b3e21['tempSentiment']=_0x34abbf[_0xd9ec('0x49')]['runSentiment'];return _0x2f11b6['updateAttributes'](_0x5b3e21);}})[_0xd9ec('0x26')](respondWithResult(_0x196deb,null))[_0xd9ec('0x44')](handleError(_0x196deb,null));};function writeFile(_0x49079c,_0x45d810){return new Promise(function(_0x3b91c9,_0x415a43){fs[_0xd9ec('0x8c')](_0x45d810,_0x49079c,function(_0x5baecf,_0x375645){if(_0x5baecf){return _0x415a43(_0x5baecf);}else{return _0x3b91c9(_0x375645);}});});}exports[_0xd9ec('0x8d')]=function(_0xc1b71b,_0x34344b,_0x427ebe){return db[_0xd9ec('0x40')][_0xd9ec('0x79')]({'where':{'id':_0xc1b71b['params']['id']}})[_0xd9ec('0x26')](handleEntityNotFound(_0x34344b))['then'](function(_0x166759){if(_0x166759&&_0x166759[_0xd9ec('0x8e')]){var _0x4c9725=_0x166759[_0xd9ec('0x8e')];var _0x2b10ad=config['root']+_0xd9ec('0x8f')+_0x166759['id']+_0xd9ec('0x90');if(fs['existsSync'](_0x2b10ad)){return _0x2b10ad;}return writeFile(_0x4c9725,_0x2b10ad)['then'](function(){return _0x2b10ad;});}else{throw new db[(_0xd9ec('0x52'))][(_0xd9ec('0x53'))]('Transcript\x20not\x20available');}})[_0xd9ec('0x26')](function(_0x1f288c){return _0x34344b[_0xd9ec('0x4b')](_0x1f288c);})['catch'](handleError(_0x34344b));}; \ No newline at end of file +var _0xdd21=['VoiceRecording\x20not\x20found','filename','extname','Not\x20found','downloads','sequelize','MD5','token','$and','push','%s.cypher','Sequelize','unlink','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','bucket','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','then','name','send','map','VoiceRecording','fieldName','key','differenceBy','query','filters','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','intersection','find','create','update','body','describe','download','../../components/encryptor','uniqueid','params','value','format','existsSync','decryptFile','secrets','recording','ValidationError'];(function(_0x38a72d,_0x30b8ec){var _0x3ceae4=function(_0x1de219){while(--_0x1de219){_0x38a72d['push'](_0x38a72d['shift']());}};_0x3ceae4(++_0x30b8ec);}(_0xdd21,0x175));var _0x1dd2=function(_0x34733b,_0x3eebcc){_0x34733b=_0x34733b-0x0;var _0x111b33=_0xdd21[_0x34733b];return _0x111b33;};'use strict';var emlformat=require(_0x1dd2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1dd2('0x1'));var rp=require(_0x1dd2('0x2'));var moment=require('moment');var BPromise=require(_0x1dd2('0x3'));var Mustache=require(_0x1dd2('0x4'));var util=require('util');var path=require(_0x1dd2('0x5'));var sox=require(_0x1dd2('0x6'));var csv=require(_0x1dd2('0x7'));var ejs=require(_0x1dd2('0x8'));var fs=require('fs');var fs_extra=require(_0x1dd2('0x9'));var _=require(_0x1dd2('0xa'));var squel=require(_0x1dd2('0xb'));var crypto=require(_0x1dd2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1dd2('0xd'));var toCsv=require(_0x1dd2('0x7'));var querystring=require(_0x1dd2('0xe'));var Papa=require(_0x1dd2('0xf'));var AWS=require(_0x1dd2('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0x1dd2('0x11'));var authService=require(_0x1dd2('0x12'));var qs=require(_0x1dd2('0x13'));var as=require(_0x1dd2('0x14'));var hardwareService=require(_0x1dd2('0x15'));var logger=require(_0x1dd2('0x16'))(_0x1dd2('0x17'));var utils=require(_0x1dd2('0x18'));var config=require(_0x1dd2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1dd2('0x1a'))['db'];function respondWithStatusCode(_0x42b903,_0x2fefdf){_0x2fefdf=_0x2fefdf||0xcc;return function(_0x1d4fcf){if(_0x1d4fcf){return _0x42b903[_0x1dd2('0x1b')](_0x2fefdf);}return _0x42b903[_0x1dd2('0x1c')](_0x2fefdf)[_0x1dd2('0x1d')]();};}function respondWithResult(_0xcbb8e8,_0x1e3a1a){_0x1e3a1a=_0x1e3a1a||0xc8;return function(_0x4a4d01){if(_0x4a4d01){return _0xcbb8e8[_0x1dd2('0x1c')](_0x1e3a1a)[_0x1dd2('0x1e')](_0x4a4d01);}};}function respondWithFilteredResult(_0x525222,_0x3ba148){return function(_0x436efb){if(_0x436efb){var _0x32591e=typeof _0x3ba148['offset']===_0x1dd2('0x1f')&&typeof _0x3ba148[_0x1dd2('0x20')]===_0x1dd2('0x1f');var _0x56c2e0=_0x436efb[_0x1dd2('0x21')];var _0x56ebcd=_0x32591e?0x0:_0x3ba148['offset'];var _0x3d94b8=_0x32591e?_0x436efb[_0x1dd2('0x21')]:_0x3ba148[_0x1dd2('0x22')]+_0x3ba148[_0x1dd2('0x20')];var _0x518011;if(_0x3d94b8>=_0x56c2e0){_0x3d94b8=_0x56c2e0;_0x518011=0xc8;}else{_0x518011=0xce;}_0x525222['status'](_0x518011);return _0x525222['set'](_0x1dd2('0x23'),_0x56ebcd+'-'+_0x3d94b8+'/'+_0x56c2e0)[_0x1dd2('0x1e')](_0x436efb);}return null;};}function patchUpdates(_0x246bb1){return function(_0x5c379e){try{jsonpatch[_0x1dd2('0x24')](_0x5c379e,_0x246bb1,!![]);}catch(_0x49cb77){return BPromise['reject'](_0x49cb77);}return _0x5c379e[_0x1dd2('0x25')]();};}function saveUpdates(_0x300f19,_0x7345b3){return function(_0x19cc43){if(_0x19cc43){return _0x19cc43['update'](_0x300f19)['then'](function(_0x44eed9){return _0x44eed9;});}return null;};}function removeEntity(_0x2b7e74,_0x44d229){return function(_0x24146f){if(_0x24146f){return _0x24146f['destroy']()[_0x1dd2('0x26')](function(){_0x2b7e74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1385f7,_0x3c78ae){return function(_0x1d145a){if(!_0x1d145a){_0x1385f7[_0x1dd2('0x1b')](0x194);}return _0x1d145a;};}function handleError(_0x300f9d,_0x394f67){_0x394f67=_0x394f67||0x1f4;return function(_0x59e837){logger['error'](_0x59e837['stack']);if(_0x59e837[_0x1dd2('0x27')]){delete _0x59e837['name'];}_0x300f9d[_0x1dd2('0x1c')](_0x394f67)[_0x1dd2('0x28')](_0x59e837);};}exports['index']=function(_0x439924,_0x2a29f1){var _0x5adb0d={},_0x53de25={},_0x463462={'count':0x0,'rows':[]};var _0x334212=_[_0x1dd2('0x29')](db[_0x1dd2('0x2a')]['rawAttributes'],function(_0x392484){return{'name':_0x392484[_0x1dd2('0x2b')],'type':_0x392484['type'][_0x1dd2('0x2c')]};});_0x53de25['model']=_[_0x1dd2('0x2d')](_[_0x1dd2('0x29')](_0x334212,_0x1dd2('0x27')),['format']);_0x53de25[_0x1dd2('0x2e')]=_['keys'](_0x439924[_0x1dd2('0x2e')]);_0x53de25[_0x1dd2('0x2f')]=_['intersection'](_0x53de25['model'],_0x53de25['query']);_0x5adb0d[_0x1dd2('0x30')]=_['intersection'](_0x53de25['model'],qs[_0x1dd2('0x31')](_0x439924[_0x1dd2('0x2e')]['fields']));_0x5adb0d[_0x1dd2('0x30')]=_0x5adb0d[_0x1dd2('0x30')][_0x1dd2('0x32')]?_0x5adb0d[_0x1dd2('0x30')]:_0x53de25[_0x1dd2('0x33')];if(!_0x439924['query']['hasOwnProperty'](_0x1dd2('0x34'))){_0x5adb0d[_0x1dd2('0x20')]=qs[_0x1dd2('0x20')](_0x439924[_0x1dd2('0x2e')][_0x1dd2('0x20')]);_0x5adb0d[_0x1dd2('0x22')]=qs['offset'](_0x439924[_0x1dd2('0x2e')][_0x1dd2('0x22')]);}_0x5adb0d[_0x1dd2('0x35')]=qs[_0x1dd2('0x36')](_0x439924['query']['sort']);_0x5adb0d[_0x1dd2('0x37')]=qs[_0x1dd2('0x2f')](_[_0x1dd2('0x38')](_0x439924['query'],_0x53de25[_0x1dd2('0x2f')]),_0x334212);if(_0x439924['query'][_0x1dd2('0x39')]){_0x5adb0d[_0x1dd2('0x37')]=_[_0x1dd2('0x3a')](_0x5adb0d[_0x1dd2('0x37')],{'$or':_[_0x1dd2('0x29')](_0x334212,function(_0x4ae2ae){if(_0x4ae2ae[_0x1dd2('0x3b')]!==_0x1dd2('0x3c')){var _0x1b4cd4={};_0x1b4cd4[_0x4ae2ae[_0x1dd2('0x27')]]={'$like':'%'+_0x439924[_0x1dd2('0x2e')][_0x1dd2('0x39')]+'%'};return _0x1b4cd4;}})});}_0x5adb0d=_['merge']({},_0x5adb0d,_0x439924['options']);var _0x5d3c97={'where':_0x5adb0d['where']};return db[_0x1dd2('0x2a')][_0x1dd2('0x21')](_0x5d3c97)[_0x1dd2('0x26')](function(_0x48e7da){_0x463462['count']=_0x48e7da;if(_0x439924[_0x1dd2('0x2e')][_0x1dd2('0x3d')]){_0x5adb0d[_0x1dd2('0x3e')]=[{'all':!![]}];}return db[_0x1dd2('0x2a')][_0x1dd2('0x3f')](_0x5adb0d);})[_0x1dd2('0x26')](function(_0x4d1950){_0x463462[_0x1dd2('0x40')]=_0x4d1950;return _0x463462;})[_0x1dd2('0x26')](respondWithFilteredResult(_0x2a29f1,_0x5adb0d))[_0x1dd2('0x41')](handleError(_0x2a29f1,null));};exports[_0x1dd2('0x42')]=function(_0x27b691,_0xeabab4){var _0xc25c78={'raw':![],'where':{'id':_0x27b691['params']['id']}},_0x34cf2d={};_0x34cf2d[_0x1dd2('0x33')]=_[_0x1dd2('0x43')](db[_0x1dd2('0x2a')][_0x1dd2('0x44')]);_0x34cf2d[_0x1dd2('0x2e')]=_[_0x1dd2('0x43')](_0x27b691[_0x1dd2('0x2e')]);_0x34cf2d[_0x1dd2('0x2f')]=_[_0x1dd2('0x45')](_0x34cf2d[_0x1dd2('0x33')],_0x34cf2d[_0x1dd2('0x2e')]);_0xc25c78[_0x1dd2('0x30')]=_[_0x1dd2('0x45')](_0x34cf2d[_0x1dd2('0x33')],qs[_0x1dd2('0x31')](_0x27b691['query'][_0x1dd2('0x31')]));_0xc25c78[_0x1dd2('0x30')]=_0xc25c78[_0x1dd2('0x30')][_0x1dd2('0x32')]?_0xc25c78['attributes']:_0x34cf2d[_0x1dd2('0x33')];if(_0x27b691['query'][_0x1dd2('0x3d')]){_0xc25c78[_0x1dd2('0x3e')]=[{'all':!![]}];}_0xc25c78=_[_0x1dd2('0x3a')]({},_0xc25c78,_0x27b691['options']);return db[_0x1dd2('0x2a')][_0x1dd2('0x46')](_0xc25c78)[_0x1dd2('0x26')](handleEntityNotFound(_0xeabab4,null))['then'](respondWithResult(_0xeabab4,null))[_0x1dd2('0x41')](handleError(_0xeabab4,null));};exports['create']=function(_0xb8b16b,_0x20bb05){return db['VoiceRecording'][_0x1dd2('0x47')](_0xb8b16b['body'],{})[_0x1dd2('0x26')](respondWithResult(_0x20bb05,0xc9))['catch'](handleError(_0x20bb05,null));};exports[_0x1dd2('0x48')]=function(_0x31e264,_0x39a372){if(_0x31e264[_0x1dd2('0x49')]['id']){delete _0x31e264[_0x1dd2('0x49')]['id'];}return db[_0x1dd2('0x2a')][_0x1dd2('0x46')]({'where':{'id':_0x31e264['params']['id']}})[_0x1dd2('0x26')](handleEntityNotFound(_0x39a372,null))[_0x1dd2('0x26')](saveUpdates(_0x31e264['body'],null))[_0x1dd2('0x26')](respondWithResult(_0x39a372,null))['catch'](handleError(_0x39a372,null));};exports[_0x1dd2('0x4a')]=function(_0x30541d,_0x1345f5){return db[_0x1dd2('0x2a')]['describe']()[_0x1dd2('0x26')](respondWithResult(_0x1345f5,null))[_0x1dd2('0x41')](handleError(_0x1345f5,null));};exports[_0x1dd2('0x4b')]=function(_0x445d22,_0x74aec8,_0x42bfbf){var _0x1d78a2=require(_0x1dd2('0x4c'));var _0x4eeb04=![];var _0x577bdd={};if(_0x445d22[_0x1dd2('0x2e')][_0x1dd2('0x3b')]&&_0x445d22[_0x1dd2('0x2e')]['type']===_0x1dd2('0x4d')){_0x577bdd['uniqueid']=_0x445d22[_0x1dd2('0x4e')]['id'];}else{_0x577bdd['id']=_0x445d22[_0x1dd2('0x4e')]['id'];}return db[_0x1dd2('0x2a')]['find']({'where':_0x577bdd,'attributes':['id','value'],'raw':!![]})[_0x1dd2('0x26')](handleEntityNotFound(_0x74aec8,null))[_0x1dd2('0x26')](function(_0x45d9c3){if(_0x45d9c3){var _0x49a8eb=_0x45d9c3[_0x1dd2('0x4f')];var _0x5478c6=util[_0x1dd2('0x50')]('%s.cypher',_0x49a8eb);if(fs[_0x1dd2('0x51')](_0x5478c6)){_0x4eeb04=!![];return _0x1d78a2[_0x1dd2('0x52')](_0x5478c6,_0x49a8eb,config[_0x1dd2('0x53')][_0x1dd2('0x54')])[_0x1dd2('0x26')](function(){return _0x45d9c3;});}return _0x45d9c3;}})['then'](function(_0x27ab36){if(_0x27ab36){var _0x324cf2=_0x27ab36[_0x1dd2('0x4f')];if(!fs[_0x1dd2('0x51')](_0x324cf2)){throw new db['Sequelize'][(_0x1dd2('0x55'))](_0x1dd2('0x56'));}if(_0x27ab36[_0x1dd2('0x57')]){return _0x74aec8['download'](_0x324cf2,_0x27ab36[_0x1dd2('0x57')]+path[_0x1dd2('0x58')](_0x324cf2),function(){if(_0x4eeb04){fs['unlink'](_0x324cf2);}});}else{return _0x74aec8['download'](_0x324cf2,function(_0x11a8a1){if(_0x4eeb04){fs['unlink'](_0x324cf2);}});}}})[_0x1dd2('0x41')](function(_0x3382e3){if(_0x3382e3['message']===_0x1dd2('0x56')){_0x74aec8[_0x1dd2('0x1c')](0x194)[_0x1dd2('0x28')](_0x1dd2('0x59'));}else{return handleError(_0x74aec8,null);}});};exports[_0x1dd2('0x5a')]=function(_0x2e69e0,_0x1a682d,_0x44e24f){var _0x56144e=require(_0x1dd2('0x4c'));var _0x2b4a63=![];var _0x524ce6={'$and':[db[_0x1dd2('0x5b')][_0x1dd2('0x37')](db[_0x1dd2('0x5b')]['fn'](_0x1dd2('0x5c'),db[_0x1dd2('0x5b')]['col'](_0x1dd2('0x4d'))),_0x2e69e0[_0x1dd2('0x2e')][_0x1dd2('0x5d')])]};if(_0x2e69e0[_0x1dd2('0x2e')][_0x1dd2('0x3b')]&&_0x2e69e0['query']['type']==='uniqueid'){_0x524ce6[_0x1dd2('0x5e')][_0x1dd2('0x5f')]({'uniqueid':_0x2e69e0[_0x1dd2('0x4e')]['id']});}else{_0x524ce6['$and'][_0x1dd2('0x5f')]({'id':_0x2e69e0[_0x1dd2('0x4e')]['id']});}return db['VoiceRecording']['find']({'where':_0x524ce6,'attributes':['id',_0x1dd2('0x4f')],'raw':!![]})[_0x1dd2('0x26')](handleEntityNotFound(_0x1a682d,null))[_0x1dd2('0x26')](function(_0x357c36){if(_0x357c36){var _0x4e8f4d=util[_0x1dd2('0x50')](_0x1dd2('0x60'),_0x357c36[_0x1dd2('0x4f')]);if(fs[_0x1dd2('0x51')](_0x4e8f4d)){_0x2b4a63=!![];return _0x56144e[_0x1dd2('0x52')](_0x4e8f4d,_0x357c36['value'],config['secrets']['recording'])['then'](function(){return _0x357c36;});}return _0x357c36;}})[_0x1dd2('0x26')](function(_0x309e93){if(_0x309e93){if(!fs[_0x1dd2('0x51')](_0x309e93[_0x1dd2('0x4f')])){throw new db[(_0x1dd2('0x61'))][(_0x1dd2('0x55'))](_0x1dd2('0x56'));}if(_0x309e93[_0x1dd2('0x57')]){return _0x1a682d['download'](_0x309e93['value'],_0x309e93['filename']+path[_0x1dd2('0x58')](_0x309e93['value']),function(){if(_0x2b4a63){fs[_0x1dd2('0x62')](_0x309e93[_0x1dd2('0x4f')]);}});}else{return _0x1a682d[_0x1dd2('0x4b')](_0x309e93[_0x1dd2('0x4f')],function(_0x31fb81){if(_0x2b4a63){fs[_0x1dd2('0x62')](_0x309e93[_0x1dd2('0x4f')]);}});}}})['catch'](handleError(_0x1a682d,null));};exports['destroy']=function(_0x554795,_0x118033){return db[_0x1dd2('0x2a')]['find']({'where':{'id':_0x554795[_0x1dd2('0x4e')]['id']}})[_0x1dd2('0x26')](function(_0x6e4c78){if(_[_0x1dd2('0x63')](_0x6e4c78)){throw new ReferenceError('Entity\x20not\x20found');}return _0x6e4c78;})[_0x1dd2('0x26')](function(_0x1d99fe){var _0xaeee63=_0x1d99fe['value'];logger[_0x1dd2('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0xaeee63);if(!_[_0x1dd2('0x63')](_0x1d99fe['value'])&&fs['existsSync'](_0xaeee63)){logger[_0x1dd2('0x64')]('File:\x20\x22'+_0xaeee63+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xaeee63);}_0xaeee63=_0xaeee63+'.cypher';if(!_[_0x1dd2('0x63')](_0x1d99fe['value'])&&fs['existsSync'](_0xaeee63)){logger[_0x1dd2('0x64')](_0x1dd2('0x65')+_0xaeee63+_0x1dd2('0x66'));fs['unlinkSync'](_0xaeee63);}return _0x1d99fe;})[_0x1dd2('0x26')](function(_0x17598c){if(!_0x17598c)throw new InternalError();return _0x17598c[_0x1dd2('0x67')]();})[_0x1dd2('0x26')](function(){_0x118033['status'](0xcc)[_0x1dd2('0x1d')]();})[_0x1dd2('0x41')](handleError(_0x118033,null));};function getBucketslist(_0x421b7c,_0x110194,_0x3d1716){return new Promise(function(_0x1635e1,_0xa8502b){var _0x17bb61=new AWS['S3']({'accessKeyId':_0x110194,'secretAccessKey':_0x421b7c,'region':_0x3d1716});_0x17bb61['listBuckets']({},function(_0x244350,_0x484e32){if(_0x244350){return _0xa8502b(_0x244350);}else{return _0x1635e1(_0x484e32);}});});}function createBucket(_0x842492,_0xe9cf56,_0x169f5c,_0x2bf439){return new Promise(function(_0x10ad3d,_0x468b3d){var _0x346e57=new AWS['S3']({'accessKeyId':_0xe9cf56,'secretAccessKey':_0x842492,'region':_0x169f5c});_0x346e57[_0x1dd2('0x68')]({'Bucket':_0x2bf439},function(_0x152325,_0x1d7c15){if(_0x152325){return _0x468b3d(_0x152325);}else{return _0x10ad3d(_0x1d7c15);}});});}function uploadFile(_0x264036,_0x2cc253,_0x2b0626,_0x4d80e6,_0x4a79d4,_0x27a6c8){return new Promise(function(_0x50af9f,_0x2f6222){var _0x22ee83=new AWS['S3']({'accessKeyId':_0x2cc253,'secretAccessKey':_0x264036,'region':_0x2b0626});_0x22ee83['upload']({'Bucket':_0x4d80e6,'Key':_0x4a79d4,'Body':_0x27a6c8},function(_0x31e492,_0x24e999){if(_0x31e492){return _0x2f6222(_0x31e492);}else{return _0x50af9f(_0x24e999);}});});}function startTranscribe(_0x1b4693,_0x31d5a7,_0x29a4c6,_0x4fe8c7,_0x4fbb80,_0x2d69e7){return new Promise(function(_0x23bcc5,_0x4b3417){var _0x147eaa=new AWS['TranscribeService']({'accessKeyId':_0x31d5a7,'secretAccessKey':_0x1b4693,'region':_0x29a4c6});_0x147eaa[_0x1dd2('0x69')]({'TranscriptionJobName':_0x4fe8c7,'LanguageCode':_0x4fbb80,'Media':{'MediaFileUri':_0x2d69e7}},function(_0x341739,_0x37859c){if(_0x341739){return _0x4b3417(_0x341739);}else{return _0x23bcc5(_0x37859c);}});});}function transcribe(_0x3837e0,_0x5c4098,_0x4f9849,_0x3ef30d,_0x2498c2,_0xda1049,_0x4f54a5){return new Promise(function(_0x15fc57,_0x31cd87){var _0x12c3d3={};logger[_0x1dd2('0x64')](util['format'](_0x1dd2('0x6a'),_0x3837e0,_0x2498c2));return uploadFile(_0x5c4098,_0x4f9849,_0x3ef30d,_0x2498c2,path[_0x1dd2('0x6b')](_0xda1049),fs[_0x1dd2('0x6c')](_0xda1049))[_0x1dd2('0x26')](function(_0x9e01d1){logger[_0x1dd2('0x64')](util[_0x1dd2('0x50')](_0x1dd2('0x6d'),_0x3837e0,_0x2498c2,_0x9e01d1[_0x1dd2('0x6e')]));_0x12c3d3['bucket']=_0x9e01d1[_0x1dd2('0x6f')];_0x12c3d3[_0x1dd2('0x70')]=_0x9e01d1[_0x1dd2('0x6e')];logger['info'](util[_0x1dd2('0x50')](_0x1dd2('0x71'),_0x3837e0));return startTranscribe(_0x5c4098,_0x4f9849,_0x3ef30d,uuidv4(),_0x4f54a5,_0x9e01d1[_0x1dd2('0x6e')]);})['then'](function(_0x14f429){logger[_0x1dd2('0x64')](util[_0x1dd2('0x50')](_0x1dd2('0x72'),_0x3837e0,_0x14f429['TranscriptionJob'][_0x1dd2('0x73')]));_0x12c3d3[_0x1dd2('0x74')]=_0x14f429[_0x1dd2('0x75')][_0x1dd2('0x73')];_0x12c3d3[_0x1dd2('0x76')]=_0x14f429[_0x1dd2('0x75')][_0x1dd2('0x77')];return _0x15fc57(_0x12c3d3);})['catch'](function(_0x1b66d6){return _0x31cd87(_0x1b66d6);});});}exports[_0x1dd2('0x78')]=function(_0x60e5aa,_0x10355b,_0x2cfefa){var _0x1cd7e9;var _0x39e4f7;var _0x53e61b;var _0x184649=require(_0x1dd2('0x4c'));return db[_0x1dd2('0x2a')][_0x1dd2('0x79')]({'where':{'id':_0x60e5aa[_0x1dd2('0x4e')]['id']}})[_0x1dd2('0x26')](function(_0x35f008){if(_0x35f008){var _0xa4a293=util[_0x1dd2('0x50')]('%s.cypher',_0x35f008[_0x1dd2('0x4f')]);if(fs['existsSync'](_0xa4a293)){cypher=!![];return _0x184649[_0x1dd2('0x52')](_0xa4a293,_0x35f008[_0x1dd2('0x4f')],config[_0x1dd2('0x53')][_0x1dd2('0x54')])[_0x1dd2('0x26')](function(){return _0x35f008;});}return _0x35f008;}})[_0x1dd2('0x26')](function(_0x5841e9){if(!_0x5841e9){throw new db[(_0x1dd2('0x61'))][(_0x1dd2('0x55'))](_0x1dd2('0x7a'));}_0x39e4f7=_0x5841e9;return db[_0x1dd2('0x7b')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x10355b,null))[_0x1dd2('0x26')](function(_0x2fe1c5){if(_0x2fe1c5){_0x1cd7e9=_0x2fe1c5;if(!_0x1cd7e9[_0x1dd2('0x7c')]||!_0x1cd7e9[_0x1dd2('0x7d')]||!_0x1cd7e9['transcribeRegion']||!_0x1cd7e9[_0x1dd2('0x7e')]||!_0x1cd7e9[_0x1dd2('0x7f')]){throw new db['Sequelize']['ValidationError'](_0x1dd2('0x80'));}if(_0x60e5aa[_0x1dd2('0x49')]['runSentiment']&&(!_0x1cd7e9['sentiment']||!_0x1cd7e9[_0x1dd2('0x81')]||!_0x1cd7e9[_0x1dd2('0x82')]||!_0x1cd7e9[_0x1dd2('0x7e')]||!_0x1cd7e9['bucket'])){throw new db[(_0x1dd2('0x61'))]['ValidationError'](_0x1dd2('0x83'));}return db[_0x1dd2('0x84')][_0x1dd2('0x79')]({'where':{'id':_0x1cd7e9[_0x1dd2('0x7d')]}});}})[_0x1dd2('0x26')](function(_0x2cf082){if(!_0x2cf082){throw new db[(_0x1dd2('0x61'))]['ValidationError'](_0x1dd2('0x85'));}if(!_0x2cf082['data1']||!_0x2cf082['data2']){throw new db[(_0x1dd2('0x61'))][(_0x1dd2('0x55'))](_0x1dd2('0x86'));}_0x53e61b=_0x2cf082;return getBucketslist(_0x53e61b['data1'],_0x53e61b[_0x1dd2('0x87')],_0x1cd7e9[_0x1dd2('0x88')]);})[_0x1dd2('0x26')](function(_0x4f7ce6){if(_0x4f7ce6&&_0x4f7ce6['Buckets']){var _0x289362=_[_0x1dd2('0x46')](_0x4f7ce6[_0x1dd2('0x89')],function(_0x1b209b){return _0x1b209b['Name']===_0x1cd7e9[_0x1dd2('0x7f')];});if(!_0x289362){logger[_0x1dd2('0x64')](util[_0x1dd2('0x50')](_0x1dd2('0x8a'),_0x60e5aa[_0x1dd2('0x4e')]['id'],_0x1cd7e9['bucket']));return createBucket(_0x53e61b[_0x1dd2('0x8b')],_0x53e61b[_0x1dd2('0x87')],_0x1cd7e9[_0x1dd2('0x88')],_0x1cd7e9['bucket']);}logger['info'](util[_0x1dd2('0x50')](_0x1dd2('0x8c'),_0x60e5aa[_0x1dd2('0x4e')]['id'],_0x1cd7e9[_0x1dd2('0x7f')]));return;}})[_0x1dd2('0x26')](function(_0x41baeb){if(_0x39e4f7[_0x1dd2('0x76')]===_0x1dd2('0x8d')){return transcribe(_0x60e5aa[_0x1dd2('0x4e')]['id'],_0x53e61b['data1'],_0x53e61b[_0x1dd2('0x87')],_0x1cd7e9[_0x1dd2('0x88')],_0x1cd7e9[_0x1dd2('0x7f')],_0x39e4f7[_0x1dd2('0x4f')],_0x1cd7e9[_0x1dd2('0x7e')]);}else{logger[_0x1dd2('0x64')](util[_0x1dd2('0x50')](_0x1dd2('0x8e'),_0x60e5aa[_0x1dd2('0x4e')]['id']));return{'transcribeStatus':_0x1dd2('0x8f')};}})['then'](function(_0x1bfbed){if(_0x1bfbed){_0x1bfbed[_0x1dd2('0x90')]=_0x60e5aa[_0x1dd2('0x49')][_0x1dd2('0x91')];return _0x39e4f7['updateAttributes'](_0x1bfbed);}})[_0x1dd2('0x26')](respondWithResult(_0x10355b,null))[_0x1dd2('0x41')](handleError(_0x10355b,null));};function writeFile(_0x576bab,_0x39d2f3){return new Promise(function(_0x538708,_0x3a027f){fs[_0x1dd2('0x92')](_0x39d2f3,_0x576bab,function(_0x2c43c9,_0x45f5b3){if(_0x2c43c9){return _0x3a027f(_0x2c43c9);}else{return _0x538708(_0x45f5b3);}});});}exports[_0x1dd2('0x93')]=function(_0xbf90a9,_0x18d9a,_0x209e53){return db[_0x1dd2('0x2a')][_0x1dd2('0x79')]({'where':{'id':_0xbf90a9[_0x1dd2('0x4e')]['id']}})[_0x1dd2('0x26')](handleEntityNotFound(_0x18d9a))['then'](function(_0x4d9846){if(_0x4d9846&&_0x4d9846['fileText']){var _0x5be9d6=_0x4d9846[_0x1dd2('0x94')];var _0x2ebc5e=config[_0x1dd2('0x95')]+_0x1dd2('0x96')+_0x4d9846['id']+_0x1dd2('0x97');if(fs[_0x1dd2('0x51')](_0x2ebc5e)){return _0x2ebc5e;}return writeFile(_0x5be9d6,_0x2ebc5e)[_0x1dd2('0x26')](function(){return _0x2ebc5e;});}else{throw new db[(_0x1dd2('0x61'))][(_0x1dd2('0x55'))](_0x1dd2('0x98'));}})[_0x1dd2('0x26')](function(_0x259670){return _0x18d9a[_0x1dd2('0x4b')](_0x259670);})['catch'](handleError(_0x18d9a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d6155c0..6b81d06 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 _0xb903=['exports','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0xbd7fee,_0x207cf4){var _0x14ede4=function(_0x523d85){while(--_0x523d85){_0xbd7fee['push'](_0xbd7fee['shift']());}};_0x14ede4(++_0x207cf4);}(_0xb903,0x185));var _0x3b90=function(_0x306214,_0x5fa257){_0x306214=_0x306214-0x0;var _0x52a595=_0xb903[_0x306214];return _0x52a595;};'use strict';var attributes=require(_0x3b90('0x0'));module[_0x3b90('0x1')]=function(_0x9b74ca,_0x3d81e8){return _0x9b74ca['define'](_0x3b90('0x2'),attributes,{'tableName':_0x3b90('0x3'),'paranoid':![],'indexes':[{'name':_0x3b90('0x4'),'fields':[_0x3b90('0x4')]},{'name':_0x3b90('0x5'),'fields':[_0x3b90('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2b3=['transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3929dd,_0x409601){var _0xd8df35=function(_0x2568a3){while(--_0x2568a3){_0x3929dd['push'](_0x3929dd['shift']());}};_0xd8df35(++_0x409601);}(_0xb2b3,0x71));var _0x3b2b=function(_0x77cc7c,_0x146725){_0x77cc7c=_0x77cc7c-0x0;var _0x16c031=_0xb2b3[_0x77cc7c];return _0x16c031;};'use strict';var attributes=require(_0x3b2b('0x0'));module[_0x3b2b('0x1')]=function(_0xcf49e8,_0x209d15){return _0xcf49e8[_0x3b2b('0x2')](_0x3b2b('0x3'),attributes,{'tableName':_0x3b2b('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3b2b('0x5')]},{'name':_0x3b2b('0x6'),'fields':[_0x3b2b('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6d17542..a4553f1 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 _0x955f=['randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit','debug','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x3e96a8,_0x36075d){var _0x27b103=function(_0x429de8){while(--_0x429de8){_0x3e96a8['push'](_0x3e96a8['shift']());}};_0x27b103(++_0x36075d);}(_0x955f,0x1eb));var _0xf955=function(_0x53c715,_0x132f01){_0x53c715=_0x53c715-0x0;var _0x310233=_0x955f[_0x53c715];return _0x310233;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['UpdateVoiceRecording']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['VoiceRecording'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x19')]||null:null,'attributes':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb['options'][_0xf955('0x1a')]||null:null,'limit':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x1b')]||null:null})[_0xf955('0xb')](function(_0xa4ebb4){logger[_0xf955('0xc')]('UpdateVoiceRecording',_0x5ac6cb);logger[_0xf955('0x1c')](_0xf955('0x1d'),_0x5ac6cb,JSON[_0xf955('0x10')](_0xa4ebb4));_0xe6de5c(_0xa4ebb4);})[_0xf955('0x14')](function(_0x17dec2){logger[_0xf955('0x11')](_0xf955('0x1d'),_0x17dec2['message'],_0x5ac6cb);_0x3c49c0(_0x1e20d1[_0xf955('0x11')](0x1f4,_0x17dec2[_0xf955('0x12')]));});});};exports[_0xf955('0x1e')]=function(_0x406632){var _0x2dcd55=this;return new Promise(function(_0x13a86d,_0x3796f7){var _0x51f3ab=require(_0xf955('0x1f'));var _0x145098;return db[_0xf955('0x20')][_0xf955('0x21')]({'attributes':['id',_0xf955('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf955('0xb')](function(_0x4d4af0){_0x145098=_0x4d4af0;return db[_0xf955('0x23')][_0xf955('0x24')](_0x406632['body']);})[_0xf955('0xb')](function(_0x2c8df1){if(_0x145098[_0xf955('0x22')]&&fs[_0xf955('0x25')](_0x2c8df1['value'])){var _0x3a951c=util['format'](_0xf955('0x26'),_0x2c8df1[_0xf955('0x27')]);return _0x51f3ab[_0xf955('0x28')](_0x2c8df1[_0xf955('0x27')],_0x3a951c,config[_0xf955('0x29')][_0xf955('0x2a')])[_0xf955('0xb')](function(){fs[_0xf955('0x2b')](_0x2c8df1['value']);logger[_0xf955('0xc')](_0xf955('0x2c'));return _0x2c8df1;});}return _0x2c8df1;})[_0xf955('0xb')](function(_0x2046c8){logger['info'](_0xf955('0x1e'),_0x406632);logger[_0xf955('0x1c')](_0xf955('0x1e'),_0x406632,JSON[_0xf955('0x10')](_0x2046c8));_0x13a86d(_0x2046c8);})[_0xf955('0x14')](function(_0x4eb2c3){logger['error']('CreateVoiceRecording',_0x4eb2c3[_0xf955('0x12')],_0x406632);_0x3796f7(_0x2dcd55[_0xf955('0x11')](0x1f4,_0x4eb2c3[_0xf955('0x12')]));});});}; \ No newline at end of file +var _0xe5af=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','where','limit','debug','../../components/encryptor','Setting','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe5af,0x9c));var _0xfe5a=function(_0x36240e,_0x11c6bd){_0x36240e=_0x36240e-0x0;var _0x3d0d10=_0xe5af[_0x36240e];return _0x3d0d10;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});}exports[_0xfe5a('0x12')]=function(_0x5bf597){var _0x20620b=this;return new Promise(function(_0x456707,_0x54d5fb){return db[_0xfe5a('0x13')][_0xfe5a('0x14')](_0x5bf597[_0xfe5a('0x15')],{'raw':_0x5bf597['options']?_0x5bf597['options'][_0xfe5a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')][_0xfe5a('0x18')]||null:null,'attributes':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597[_0xfe5a('0x17')]['attributes']||null:null,'limit':_0x5bf597[_0xfe5a('0x17')]?_0x5bf597['options'][_0xfe5a('0x19')]||null:null})[_0xfe5a('0x8')](function(_0x1fbde5){logger['info']('UpdateVoiceRecording',_0x5bf597);logger[_0xfe5a('0x1a')](_0xfe5a('0x12'),_0x5bf597,JSON['stringify'](_0x1fbde5));_0x456707(_0x1fbde5);})[_0xfe5a('0x11')](function(_0x26f744){logger['error'](_0xfe5a('0x12'),_0x26f744[_0xfe5a('0xe')],_0x5bf597);_0x54d5fb(_0x20620b[_0xfe5a('0xd')](0x1f4,_0x26f744[_0xfe5a('0xe')]));});});};exports['CreateVoiceRecording']=function(_0x42136e){var _0x2f5d04=this;return new Promise(function(_0x24481f,_0x1cd531){var _0x36bf20=require(_0xfe5a('0x1b'));var _0xdbf1e0;return db[_0xfe5a('0x1c')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xfe5a('0x8')](function(_0x485f9d){_0xdbf1e0=_0x485f9d;return db[_0xfe5a('0x13')][_0xfe5a('0x1d')](_0x42136e[_0xfe5a('0x15')]);})['then'](function(_0x48a061){if(_0xdbf1e0['callRecordingEncryption']&&fs[_0xfe5a('0x1e')](_0x48a061['value'])){var _0x51d1f4=util['format'](_0xfe5a('0x1f'),_0x48a061[_0xfe5a('0x20')]);return _0x36bf20[_0xfe5a('0x21')](_0x48a061[_0xfe5a('0x20')],_0x51d1f4,config[_0xfe5a('0x22')][_0xfe5a('0x23')])[_0xfe5a('0x8')](function(){fs[_0xfe5a('0x24')](_0x48a061[_0xfe5a('0x20')]);logger[_0xfe5a('0xf')](_0xfe5a('0x25'));return _0x48a061;});}return _0x48a061;})['then'](function(_0x1f0c86){logger[_0xfe5a('0xf')]('CreateVoiceRecording',_0x42136e);logger[_0xfe5a('0x1a')](_0xfe5a('0x26'),_0x42136e,JSON[_0xfe5a('0xc')](_0x1f0c86));_0x24481f(_0x1f0c86);})[_0xfe5a('0x11')](function(_0xe5a992){logger['error']('CreateVoiceRecording',_0xe5a992[_0xfe5a('0xe')],_0x42136e);_0x1cd531(_0x2f5d04['error'](0x1f4,_0xe5a992[_0xfe5a('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e9c6ed9..c702ce2 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 _0x6005=['exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','get','describe','/:id','show','create','put','delete','destroy'];(function(_0x967628,_0x5b99fe){var _0x47fff6=function(_0xc26b9a){while(--_0xc26b9a){_0x967628['push'](_0x967628['shift']());}};_0x47fff6(++_0x5b99fe);}(_0x6005,0x1e7));var _0x5600=function(_0x5d95ef,_0x2e491d){_0x5d95ef=_0x5d95ef-0x0;var _0x2ed59=_0x6005[_0x5d95ef];return _0x2ed59;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5600('0x0'));var express=require(_0x5600('0x1'));var router=express[_0x5600('0x2')]();var fs_extra=require(_0x5600('0x3'));var auth=require(_0x5600('0x4'));var interaction=require(_0x5600('0x5'));var config=require(_0x5600('0x6'));var controller=require(_0x5600('0x7'));router['get']('/',auth[_0x5600('0x8')](),controller['index']);router[_0x5600('0x9')]('/describe',auth[_0x5600('0x8')](),controller[_0x5600('0xa')]);router[_0x5600('0x9')](_0x5600('0xb'),auth[_0x5600('0x8')](),controller[_0x5600('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5600('0xd')]);router[_0x5600('0xe')](_0x5600('0xb'),auth[_0x5600('0x8')](),controller['update']);router[_0x5600('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5600('0x10')]);module[_0x5600('0x11')]=router; \ No newline at end of file +var _0x5d93=['create','put','update','delete','path','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x51fe51,_0x50bb7a){var _0x37142b=function(_0x1b592f){while(--_0x1b592f){_0x51fe51['push'](_0x51fe51['shift']());}};_0x37142b(++_0x50bb7a);}(_0x5d93,0xe1));var _0x35d9=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x5d93[_0x36ed48];return _0x51c63a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x35d9('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x35d9('0x1')]();var fs_extra=require(_0x35d9('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x35d9('0x3'));var config=require(_0x35d9('0x4'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x35d9('0x5')](),controller[_0x35d9('0x6')]);router[_0x35d9('0x7')](_0x35d9('0x8'),auth[_0x35d9('0x5')](),controller[_0x35d9('0x9')]);router[_0x35d9('0x7')](_0x35d9('0xa'),auth[_0x35d9('0x5')](),controller[_0x35d9('0xb')]);router[_0x35d9('0xc')]('/',auth[_0x35d9('0x5')](),controller[_0x35d9('0xd')]);router[_0x35d9('0xe')](_0x35d9('0xa'),auth['isAuthenticated'](),controller[_0x35d9('0xf')]);router[_0x35d9('0x10')]('/:id',auth[_0x35d9('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 2567a83..59e005b 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 _0x587a=['moment','exports','ENUM','STRING','Yes','sequelize'];(function(_0x47e996,_0x9870fd){var _0x350469=function(_0x15e6ef){while(--_0x15e6ef){_0x47e996['push'](_0x47e996['shift']());}};_0x350469(++_0x9870fd);}(_0x587a,0x18b));var _0xa587=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x587a[_0xf04c6d];return _0x4a804e;};'use strict';var Sequelize=require(_0xa587('0x0'));var moment=require(_0xa587('0x1'));module[_0xa587('0x2')]={'type':{'type':Sequelize[_0xa587('0x3')]('blind','attended')},'result':{'type':Sequelize[_0xa587('0x4')]},'transfererchannel':{'type':Sequelize[_0xa587('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xa587('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa587('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa587('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xa587('0x4')]},'transferercontext':{'type':Sequelize[_0xa587('0x4')]},'transfererexten':{'type':Sequelize[_0xa587('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa587('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xa587('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa587('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa587('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xa587('0x4')]},'transfereecontext':{'type':Sequelize[_0xa587('0x4')]},'transfereeexten':{'type':Sequelize[_0xa587('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xa587('0x4')]},'isexternal':{'type':Sequelize[_0xa587('0x3')](_0xa587('0x5'),'No')},'context':{'type':Sequelize[_0xa587('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeedb=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeedb,0x1a6));var _0xbeed=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xeedb[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xbeed('0x0'));var moment=require(_0xbeed('0x1'));module[_0xbeed('0x2')]={'type':{'type':Sequelize[_0xbeed('0x3')](_0xbeed('0x4'),'attended')},'result':{'type':Sequelize[_0xbeed('0x5')]},'transfererchannel':{'type':Sequelize[_0xbeed('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xbeed('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xbeed('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xbeed('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xbeed('0x5')]},'transferercontext':{'type':Sequelize[_0xbeed('0x5')]},'transfererexten':{'type':Sequelize[_0xbeed('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xbeed('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xbeed('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xbeed('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xbeed('0x5')]},'transfereecontext':{'type':Sequelize[_0xbeed('0x5')]},'transfereeexten':{'type':Sequelize[_0xbeed('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xbeed('0x5')]},'isexternal':{'type':Sequelize[_0xbeed('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xbeed('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 1e9a4b8..9555926 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 _0x3e03=['VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../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','count','set','apply','reject','save','update','then','destroy','name','index'];(function(_0x2105c6,_0x4ac2fa){var _0x12ba5b=function(_0xff4ebd){while(--_0xff4ebd){_0x2105c6['push'](_0x2105c6['shift']());}};_0x12ba5b(++_0x4ac2fa);}(_0x3e03,0x152));var _0x33e0=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0x3e03[_0x4b9978];return _0x42f0e5;};'use strict';var emlformat=require(_0x33e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33e0('0x1'));var jsonpatch=require(_0x33e0('0x2'));var rp=require(_0x33e0('0x3'));var moment=require(_0x33e0('0x4'));var BPromise=require(_0x33e0('0x5'));var Mustache=require(_0x33e0('0x6'));var util=require(_0x33e0('0x7'));var path=require(_0x33e0('0x8'));var sox=require('sox');var csv=require(_0x33e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33e0('0xa'));var _=require(_0x33e0('0xb'));var squel=require(_0x33e0('0xc'));var crypto=require('crypto');var jsforce=require(_0x33e0('0xd'));var deskjs=require(_0x33e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x33e0('0xf'));var Papa=require('papaparse');var Redis=require(_0x33e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33e0('0x11'));var as=require(_0x33e0('0x12'));var hardwareService=require(_0x33e0('0x13'));var logger=require(_0x33e0('0x14'))(_0x33e0('0x15'));var utils=require(_0x33e0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x33e0('0x17'));var db=require(_0x33e0('0x18'))['db'];function respondWithStatusCode(_0x5bdecb,_0x577fba){_0x577fba=_0x577fba||0xcc;return function(_0x4459ab){if(_0x4459ab){return _0x5bdecb[_0x33e0('0x19')](_0x577fba);}return _0x5bdecb[_0x33e0('0x1a')](_0x577fba)[_0x33e0('0x1b')]();};}function respondWithResult(_0x171acd,_0x204989){_0x204989=_0x204989||0xc8;return function(_0x5951ef){if(_0x5951ef){return _0x171acd[_0x33e0('0x1a')](_0x204989)[_0x33e0('0x1c')](_0x5951ef);}};}function respondWithFilteredResult(_0x3bfebc,_0xfd844c){return function(_0x49df48){if(_0x49df48){var _0x2343fe=typeof _0xfd844c[_0x33e0('0x1d')]===_0x33e0('0x1e')&&typeof _0xfd844c[_0x33e0('0x1f')]==='undefined';var _0x43efd7=_0x49df48['count'];var _0x1e022b=_0x2343fe?0x0:_0xfd844c[_0x33e0('0x1d')];var _0x1ee363=_0x2343fe?_0x49df48[_0x33e0('0x20')]:_0xfd844c['offset']+_0xfd844c[_0x33e0('0x1f')];var _0x352b47;if(_0x1ee363>=_0x43efd7){_0x1ee363=_0x43efd7;_0x352b47=0xc8;}else{_0x352b47=0xce;}_0x3bfebc[_0x33e0('0x1a')](_0x352b47);return _0x3bfebc[_0x33e0('0x21')]('Content-Range',_0x1e022b+'-'+_0x1ee363+'/'+_0x43efd7)['json'](_0x49df48);}return null;};}function patchUpdates(_0x2b8f5f){return function(_0x46606d){try{jsonpatch[_0x33e0('0x22')](_0x46606d,_0x2b8f5f,!![]);}catch(_0x23324c){return BPromise[_0x33e0('0x23')](_0x23324c);}return _0x46606d[_0x33e0('0x24')]();};}function saveUpdates(_0x345918,_0x3ec106){return function(_0x3f7af8){if(_0x3f7af8){return _0x3f7af8[_0x33e0('0x25')](_0x345918)[_0x33e0('0x26')](function(_0x460d84){return _0x460d84;});}return null;};}function removeEntity(_0x17cfcc,_0x5cc852){return function(_0x5536a4){if(_0x5536a4){return _0x5536a4[_0x33e0('0x27')]()[_0x33e0('0x26')](function(){_0x17cfcc[_0x33e0('0x1a')](0xcc)[_0x33e0('0x1b')]();});}};}function handleEntityNotFound(_0x3d1add,_0x3afd71){return function(_0x28e9ae){if(!_0x28e9ae){_0x3d1add[_0x33e0('0x19')](0x194);}return _0x28e9ae;};}function handleError(_0x2de5b3,_0x26222f){_0x26222f=_0x26222f||0x1f4;return function(_0x34f24a){logger['error'](_0x34f24a['stack']);if(_0x34f24a[_0x33e0('0x28')]){delete _0x34f24a[_0x33e0('0x28')];}_0x2de5b3['status'](_0x26222f)['send'](_0x34f24a);};}exports[_0x33e0('0x29')]=function(_0x5cdd45,_0x70df92){var _0xfd81fa={},_0x45e712={},_0x53dd29={'count':0x0,'rows':[]};var _0x4ec2b1=_['map'](db[_0x33e0('0x2a')][_0x33e0('0x2b')],function(_0x22eb18){return{'name':_0x22eb18[_0x33e0('0x2c')],'type':_0x22eb18[_0x33e0('0x2d')][_0x33e0('0x2e')]};});_0x45e712[_0x33e0('0x2f')]=_[_0x33e0('0x30')](_0x4ec2b1,'name');_0x45e712[_0x33e0('0x31')]=_[_0x33e0('0x32')](_0x5cdd45[_0x33e0('0x31')]);_0x45e712['filters']=_[_0x33e0('0x33')](_0x45e712[_0x33e0('0x2f')],_0x45e712[_0x33e0('0x31')]);_0xfd81fa[_0x33e0('0x34')]=_[_0x33e0('0x33')](_0x45e712[_0x33e0('0x2f')],qs[_0x33e0('0x35')](_0x5cdd45['query'][_0x33e0('0x35')]));_0xfd81fa[_0x33e0('0x34')]=_0xfd81fa[_0x33e0('0x34')][_0x33e0('0x36')]?_0xfd81fa[_0x33e0('0x34')]:_0x45e712[_0x33e0('0x2f')];if(!_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x37')](_0x33e0('0x38'))){_0xfd81fa[_0x33e0('0x1f')]=qs[_0x33e0('0x1f')](_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x1f')]);_0xfd81fa[_0x33e0('0x1d')]=qs[_0x33e0('0x1d')](_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x1d')]);}_0xfd81fa[_0x33e0('0x39')]=qs[_0x33e0('0x3a')](_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x3a')]);_0xfd81fa['where']=qs[_0x33e0('0x3b')](_[_0x33e0('0x3c')](_0x5cdd45['query'],_0x45e712[_0x33e0('0x3b')]),_0x4ec2b1);if(_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x3d')]){_0xfd81fa[_0x33e0('0x3e')]=_[_0x33e0('0x3f')](_0xfd81fa[_0x33e0('0x3e')],{'$or':_['map'](_0x4ec2b1,function(_0x545591){if(_0x545591[_0x33e0('0x2d')]!==_0x33e0('0x40')){var _0x435539={};_0x435539[_0x545591[_0x33e0('0x28')]]={'$like':'%'+_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x3d')]+'%'};return _0x435539;}})});}_0xfd81fa=_['merge']({},_0xfd81fa,_0x5cdd45[_0x33e0('0x41')]);var _0x516770={'where':_0xfd81fa[_0x33e0('0x3e')]};return db[_0x33e0('0x2a')]['count'](_0x516770)[_0x33e0('0x26')](function(_0x49dcd1){_0x53dd29['count']=_0x49dcd1;if(_0x5cdd45[_0x33e0('0x31')][_0x33e0('0x42')]){_0xfd81fa[_0x33e0('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0xfd81fa);})[_0x33e0('0x26')](function(_0x3e67b1){_0x53dd29[_0x33e0('0x44')]=_0x3e67b1;return _0x53dd29;})['then'](respondWithFilteredResult(_0x70df92,_0xfd81fa))[_0x33e0('0x45')](handleError(_0x70df92,null));};exports[_0x33e0('0x46')]=function(_0x578274,_0x95bf10){var _0x354298={'raw':!![],'where':{'id':_0x578274[_0x33e0('0x47')]['id']}},_0x4448b3={};_0x4448b3[_0x33e0('0x2f')]=_[_0x33e0('0x32')](db[_0x33e0('0x2a')][_0x33e0('0x2b')]);_0x4448b3[_0x33e0('0x31')]=_['keys'](_0x578274[_0x33e0('0x31')]);_0x4448b3[_0x33e0('0x3b')]=_['intersection'](_0x4448b3[_0x33e0('0x2f')],_0x4448b3[_0x33e0('0x31')]);_0x354298[_0x33e0('0x34')]=_[_0x33e0('0x33')](_0x4448b3[_0x33e0('0x2f')],qs[_0x33e0('0x35')](_0x578274[_0x33e0('0x31')][_0x33e0('0x35')]));_0x354298[_0x33e0('0x34')]=_0x354298['attributes'][_0x33e0('0x36')]?_0x354298['attributes']:_0x4448b3['model'];if(_0x578274[_0x33e0('0x31')][_0x33e0('0x42')]){_0x354298[_0x33e0('0x43')]=[{'all':!![]}];}_0x354298=_[_0x33e0('0x3f')]({},_0x354298,_0x578274[_0x33e0('0x41')]);return db[_0x33e0('0x2a')][_0x33e0('0x48')](_0x354298)['then'](handleEntityNotFound(_0x95bf10,null))[_0x33e0('0x26')](respondWithResult(_0x95bf10,null))[_0x33e0('0x45')](handleError(_0x95bf10,null));};exports[_0x33e0('0x49')]=function(_0x30fe55,_0x54950e){return db[_0x33e0('0x2a')][_0x33e0('0x49')](_0x30fe55['body'],{})[_0x33e0('0x26')](respondWithResult(_0x54950e,0xc9))['catch'](handleError(_0x54950e,null));};exports[_0x33e0('0x25')]=function(_0x86ae90,_0x5d786d){if(_0x86ae90[_0x33e0('0x4a')]['id']){delete _0x86ae90[_0x33e0('0x4a')]['id'];}return db[_0x33e0('0x2a')][_0x33e0('0x48')]({'where':{'id':_0x86ae90['params']['id']}})[_0x33e0('0x26')](handleEntityNotFound(_0x5d786d,null))[_0x33e0('0x26')](saveUpdates(_0x86ae90[_0x33e0('0x4a')],null))['then'](respondWithResult(_0x5d786d,null))['catch'](handleError(_0x5d786d,null));};exports[_0x33e0('0x27')]=function(_0x3dc1e5,_0x23f3b5){return db[_0x33e0('0x2a')]['find']({'where':{'id':_0x3dc1e5[_0x33e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x23f3b5,null))[_0x33e0('0x26')](removeEntity(_0x23f3b5,null))[_0x33e0('0x45')](handleError(_0x23f3b5,null));};exports[_0x33e0('0x4b')]=function(_0x40f616,_0x395887){return db[_0x33e0('0x2a')][_0x33e0('0x4b')]()[_0x33e0('0x26')](respondWithResult(_0x395887,null))[_0x33e0('0x45')](handleError(_0x395887,null));}; \ No newline at end of file +var _0x9ad2=['filter','options','include','VoiceTransferReport','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','merge','where','VIRTUAL'];(function(_0x514f48,_0x35ca34){var _0x49d7ad=function(_0x2a3ca8){while(--_0x2a3ca8){_0x514f48['push'](_0x514f48['shift']());}};_0x49d7ad(++_0x35ca34);}(_0x9ad2,0x135));var _0x29ad=function(_0x1657ac,_0x29cbfc){_0x1657ac=_0x1657ac-0x0;var _0x44c980=_0x9ad2[_0x1657ac];return _0x44c980;};'use strict';var emlformat=require(_0x29ad('0x0'));var rimraf=require(_0x29ad('0x1'));var zipdir=require(_0x29ad('0x2'));var jsonpatch=require(_0x29ad('0x3'));var rp=require('request-promise');var moment=require(_0x29ad('0x4'));var BPromise=require(_0x29ad('0x5'));var Mustache=require('mustache');var util=require(_0x29ad('0x6'));var path=require(_0x29ad('0x7'));var sox=require(_0x29ad('0x8'));var csv=require(_0x29ad('0x9'));var ejs=require(_0x29ad('0xa'));var fs=require('fs');var fs_extra=require(_0x29ad('0xb'));var _=require(_0x29ad('0xc'));var squel=require(_0x29ad('0xd'));var crypto=require(_0x29ad('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x29ad('0xf'));var toCsv=require(_0x29ad('0x9'));var querystring=require(_0x29ad('0x10'));var Papa=require(_0x29ad('0x11'));var Redis=require(_0x29ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x29ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29ad('0x14'));var logger=require(_0x29ad('0x15'))(_0x29ad('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x29ad('0x17'));var db=require(_0x29ad('0x18'))['db'];function respondWithStatusCode(_0x3d14ed,_0x1c2e74){_0x1c2e74=_0x1c2e74||0xcc;return function(_0x2954c3){if(_0x2954c3){return _0x3d14ed['sendStatus'](_0x1c2e74);}return _0x3d14ed[_0x29ad('0x19')](_0x1c2e74)[_0x29ad('0x1a')]();};}function respondWithResult(_0x122a6c,_0x2a75f3){_0x2a75f3=_0x2a75f3||0xc8;return function(_0x48360e){if(_0x48360e){return _0x122a6c[_0x29ad('0x19')](_0x2a75f3)[_0x29ad('0x1b')](_0x48360e);}};}function respondWithFilteredResult(_0x2b962a,_0x54d87a){return function(_0x597361){if(_0x597361){var _0x669090=typeof _0x54d87a[_0x29ad('0x1c')]==='undefined'&&typeof _0x54d87a[_0x29ad('0x1d')]===_0x29ad('0x1e');var _0x406550=_0x597361[_0x29ad('0x1f')];var _0x2aa2e9=_0x669090?0x0:_0x54d87a['offset'];var _0x4ca88b=_0x669090?_0x597361[_0x29ad('0x1f')]:_0x54d87a['offset']+_0x54d87a[_0x29ad('0x1d')];var _0x53c61c;if(_0x4ca88b>=_0x406550){_0x4ca88b=_0x406550;_0x53c61c=0xc8;}else{_0x53c61c=0xce;}_0x2b962a[_0x29ad('0x19')](_0x53c61c);return _0x2b962a['set'](_0x29ad('0x20'),_0x2aa2e9+'-'+_0x4ca88b+'/'+_0x406550)[_0x29ad('0x1b')](_0x597361);}return null;};}function patchUpdates(_0x3b354f){return function(_0x36bd28){try{jsonpatch[_0x29ad('0x21')](_0x36bd28,_0x3b354f,!![]);}catch(_0x11fecc){return BPromise[_0x29ad('0x22')](_0x11fecc);}return _0x36bd28[_0x29ad('0x23')]();};}function saveUpdates(_0x424d08,_0x253b42){return function(_0xf696b1){if(_0xf696b1){return _0xf696b1[_0x29ad('0x24')](_0x424d08)['then'](function(_0x3ab747){return _0x3ab747;});}return null;};}function removeEntity(_0x40da3f,_0x2e4358){return function(_0x5b8610){if(_0x5b8610){return _0x5b8610[_0x29ad('0x25')]()[_0x29ad('0x26')](function(){_0x40da3f[_0x29ad('0x19')](0xcc)[_0x29ad('0x1a')]();});}};}function handleEntityNotFound(_0x12b892,_0x26921f){return function(_0xd1a246){if(!_0xd1a246){_0x12b892['sendStatus'](0x194);}return _0xd1a246;};}function handleError(_0x27b3df,_0x194a6b){_0x194a6b=_0x194a6b||0x1f4;return function(_0x430e6e){logger['error'](_0x430e6e['stack']);if(_0x430e6e['name']){delete _0x430e6e[_0x29ad('0x27')];}_0x27b3df[_0x29ad('0x19')](_0x194a6b)[_0x29ad('0x28')](_0x430e6e);};}exports[_0x29ad('0x29')]=function(_0x1fb4ca,_0x17d237){var _0x211936={},_0x3e2554={},_0x51e7fd={'count':0x0,'rows':[]};var _0x37cde2=_[_0x29ad('0x2a')](db['VoiceTransferReport'][_0x29ad('0x2b')],function(_0x587d4d){return{'name':_0x587d4d[_0x29ad('0x2c')],'type':_0x587d4d[_0x29ad('0x2d')][_0x29ad('0x2e')]};});_0x3e2554['model']=_[_0x29ad('0x2a')](_0x37cde2,_0x29ad('0x27'));_0x3e2554[_0x29ad('0x2f')]=_[_0x29ad('0x30')](_0x1fb4ca[_0x29ad('0x2f')]);_0x3e2554[_0x29ad('0x31')]=_[_0x29ad('0x32')](_0x3e2554['model'],_0x3e2554[_0x29ad('0x2f')]);_0x211936[_0x29ad('0x33')]=_[_0x29ad('0x32')](_0x3e2554[_0x29ad('0x34')],qs['fields'](_0x1fb4ca[_0x29ad('0x2f')][_0x29ad('0x35')]));_0x211936['attributes']=_0x211936[_0x29ad('0x33')][_0x29ad('0x36')]?_0x211936[_0x29ad('0x33')]:_0x3e2554[_0x29ad('0x34')];if(!_0x1fb4ca[_0x29ad('0x2f')]['hasOwnProperty'](_0x29ad('0x37'))){_0x211936[_0x29ad('0x1d')]=qs[_0x29ad('0x1d')](_0x1fb4ca[_0x29ad('0x2f')][_0x29ad('0x1d')]);_0x211936[_0x29ad('0x1c')]=qs['offset'](_0x1fb4ca[_0x29ad('0x2f')][_0x29ad('0x1c')]);}_0x211936[_0x29ad('0x38')]=qs[_0x29ad('0x39')](_0x1fb4ca[_0x29ad('0x2f')][_0x29ad('0x39')]);_0x211936['where']=qs[_0x29ad('0x31')](_['pick'](_0x1fb4ca[_0x29ad('0x2f')],_0x3e2554[_0x29ad('0x31')]),_0x37cde2);if(_0x1fb4ca[_0x29ad('0x2f')]['filter']){_0x211936['where']=_[_0x29ad('0x3a')](_0x211936[_0x29ad('0x3b')],{'$or':_['map'](_0x37cde2,function(_0x4652b0){if(_0x4652b0['type']!==_0x29ad('0x3c')){var _0x5de64f={};_0x5de64f[_0x4652b0[_0x29ad('0x27')]]={'$like':'%'+_0x1fb4ca['query'][_0x29ad('0x3d')]+'%'};return _0x5de64f;}})});}_0x211936=_['merge']({},_0x211936,_0x1fb4ca[_0x29ad('0x3e')]);var _0xbca903={'where':_0x211936[_0x29ad('0x3b')]};return db['VoiceTransferReport'][_0x29ad('0x1f')](_0xbca903)[_0x29ad('0x26')](function(_0x3aec7f){_0x51e7fd[_0x29ad('0x1f')]=_0x3aec7f;if(_0x1fb4ca[_0x29ad('0x2f')]['includeAll']){_0x211936[_0x29ad('0x3f')]=[{'all':!![]}];}return db[_0x29ad('0x40')][_0x29ad('0x41')](_0x211936);})[_0x29ad('0x26')](function(_0x235f2d){_0x51e7fd['rows']=_0x235f2d;return _0x51e7fd;})[_0x29ad('0x26')](respondWithFilteredResult(_0x17d237,_0x211936))[_0x29ad('0x42')](handleError(_0x17d237,null));};exports[_0x29ad('0x43')]=function(_0x1691b4,_0x3db1fe){var _0x1d8b7b={'raw':!![],'where':{'id':_0x1691b4[_0x29ad('0x44')]['id']}},_0x308f61={};_0x308f61[_0x29ad('0x34')]=_[_0x29ad('0x30')](db[_0x29ad('0x40')][_0x29ad('0x2b')]);_0x308f61[_0x29ad('0x2f')]=_[_0x29ad('0x30')](_0x1691b4['query']);_0x308f61[_0x29ad('0x31')]=_[_0x29ad('0x32')](_0x308f61[_0x29ad('0x34')],_0x308f61[_0x29ad('0x2f')]);_0x1d8b7b[_0x29ad('0x33')]=_[_0x29ad('0x32')](_0x308f61[_0x29ad('0x34')],qs[_0x29ad('0x35')](_0x1691b4['query'][_0x29ad('0x35')]));_0x1d8b7b[_0x29ad('0x33')]=_0x1d8b7b[_0x29ad('0x33')]['length']?_0x1d8b7b[_0x29ad('0x33')]:_0x308f61[_0x29ad('0x34')];if(_0x1691b4[_0x29ad('0x2f')][_0x29ad('0x45')]){_0x1d8b7b[_0x29ad('0x3f')]=[{'all':!![]}];}_0x1d8b7b=_[_0x29ad('0x3a')]({},_0x1d8b7b,_0x1691b4[_0x29ad('0x3e')]);return db['VoiceTransferReport'][_0x29ad('0x46')](_0x1d8b7b)[_0x29ad('0x26')](handleEntityNotFound(_0x3db1fe,null))['then'](respondWithResult(_0x3db1fe,null))[_0x29ad('0x42')](handleError(_0x3db1fe,null));};exports[_0x29ad('0x47')]=function(_0x1f9eea,_0x292c9a){return db[_0x29ad('0x40')][_0x29ad('0x47')](_0x1f9eea['body'],{})[_0x29ad('0x26')](respondWithResult(_0x292c9a,0xc9))[_0x29ad('0x42')](handleError(_0x292c9a,null));};exports['update']=function(_0x4d5cce,_0xe025d6){if(_0x4d5cce[_0x29ad('0x48')]['id']){delete _0x4d5cce[_0x29ad('0x48')]['id'];}return db[_0x29ad('0x40')]['find']({'where':{'id':_0x4d5cce[_0x29ad('0x44')]['id']}})[_0x29ad('0x26')](handleEntityNotFound(_0xe025d6,null))[_0x29ad('0x26')](saveUpdates(_0x4d5cce[_0x29ad('0x48')],null))[_0x29ad('0x26')](respondWithResult(_0xe025d6,null))[_0x29ad('0x42')](handleError(_0xe025d6,null));};exports[_0x29ad('0x25')]=function(_0x350850,_0x3c7098){return db[_0x29ad('0x40')][_0x29ad('0x46')]({'where':{'id':_0x350850['params']['id']}})[_0x29ad('0x26')](handleEntityNotFound(_0x3c7098,null))[_0x29ad('0x26')](removeEntity(_0x3c7098,null))['catch'](handleError(_0x3c7098,null));};exports[_0x29ad('0x49')]=function(_0x3c0ac8,_0x5208cc){return db[_0x29ad('0x40')]['describe']()[_0x29ad('0x26')](respondWithResult(_0x5208cc,null))[_0x29ad('0x42')](handleError(_0x5208cc,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8b6f26b..2ff136b 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 _0xa845=['report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x4e3214,_0x4fc991){var _0x4711ba=function(_0x1a45c5){while(--_0x1a45c5){_0x4e3214['push'](_0x4e3214['shift']());}};_0x4711ba(++_0x4fc991);}(_0xa845,0xe1));var _0x5a84=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0xa845[_0x3a4318];return _0x36d746;};'use strict';var _=require(_0x5a84('0x0'));var util=require(_0x5a84('0x1'));var logger=require(_0x5a84('0x2'))(_0x5a84('0x3'));var moment=require(_0x5a84('0x4'));var BPromise=require(_0x5a84('0x5'));var rp=require(_0x5a84('0x6'));var fs=require('fs');var path=require(_0x5a84('0x7'));var rimraf=require(_0x5a84('0x8'));var config=require(_0x5a84('0x9'));var attributes=require(_0x5a84('0xa'));module[_0x5a84('0xb')]=function(_0x374814,_0x2b7784){return _0x374814[_0x5a84('0xc')]('VoiceTransferReport',attributes,{'tableName':_0x5a84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x718c=['VoiceTransferReport','lodash','util','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x718c,0x10f));var _0xc718=function(_0x111f3a,_0x3faf60){_0x111f3a=_0x111f3a-0x0;var _0x5472c3=_0x718c[_0x111f3a];return _0x5472c3;};'use strict';var _=require(_0xc718('0x0'));var util=require(_0xc718('0x1'));var logger=require('../../config/logger')(_0xc718('0x2'));var moment=require(_0xc718('0x3'));var BPromise=require('bluebird');var rp=require(_0xc718('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc718('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0xc718('0x6')]=function(_0x362432,_0x1a2ea8){return _0x362432[_0xc718('0x7')](_0xc718('0x8'),attributes,{'tableName':'report_call_transfer','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 df012ff..c72f2e4 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 _0x26df=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x204f21,_0x581c4c){var _0x121352=function(_0x406f93){while(--_0x406f93){_0x204f21['push'](_0x204f21['shift']());}};_0x121352(++_0x581c4c);}(_0x26df,0x1ac));var _0xf26d=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x26df[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf26d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf26d('0x1'));var db=require(_0xf26d('0x2'))['db'];var utils=require(_0xf26d('0x3'));var logger=require(_0xf26d('0x4'))(_0xf26d('0x5'));var config=require(_0xf26d('0x6'));var jayson=require(_0xf26d('0x7'));var client=jayson[_0xf26d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59c8b7,_0x49cb66,_0x517a8a){return new BPromise(function(_0x4d31d2,_0x1d607a){return client[_0xf26d('0x9')](_0x59c8b7,_0x517a8a)[_0xf26d('0xa')](function(_0x5accb6){logger[_0xf26d('0xb')](_0xf26d('0xc'),_0x49cb66,_0xf26d('0xd'));logger[_0xf26d('0xe')](_0xf26d('0xf'),_0x49cb66,_0xf26d('0xd'),JSON['stringify'](_0x5accb6));if(_0x5accb6['error']){if(_0x5accb6[_0xf26d('0x10')][_0xf26d('0x11')]===0x1f4){logger[_0xf26d('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x49cb66,_0x5accb6[_0xf26d('0x10')]['message']);return _0x1d607a(_0x5accb6[_0xf26d('0x10')][_0xf26d('0x12')]);}logger['error'](_0xf26d('0xc'),_0x49cb66,_0x5accb6['error']['message']);return _0x4d31d2(_0x5accb6[_0xf26d('0x10')]['message']);}else{logger[_0xf26d('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x49cb66,_0xf26d('0xd'));_0x4d31d2(_0x5accb6[_0xf26d('0x13')]['message']);}})[_0xf26d('0x14')](function(_0x4dda06){logger['error'](_0xf26d('0xc'),_0x49cb66,_0x4dda06);_0x1d607a(_0x4dda06);});});}exports[_0xf26d('0x15')]=function(_0x20a68f){var _0x4540f4=this;return new Promise(function(_0x59bb14,_0x5134be){return db[_0xf26d('0x16')][_0xf26d('0x17')](_0x20a68f[_0xf26d('0x18')],{'raw':_0x20a68f[_0xf26d('0x19')]?_0x20a68f['options'][_0xf26d('0x1a')]===undefined?!![]:![]:!![]})[_0xf26d('0xa')](function(_0x36c0f0){logger[_0xf26d('0xb')](_0xf26d('0x15'),_0x20a68f);logger[_0xf26d('0xe')](_0xf26d('0x15'),_0x20a68f,JSON['stringify'](_0x36c0f0));_0x59bb14(_0x36c0f0);})[_0xf26d('0x14')](function(_0x43c54f){logger[_0xf26d('0x10')](_0xf26d('0x15'),_0x43c54f[_0xf26d('0x12')],_0x20a68f);_0x5134be(_0x4540f4[_0xf26d('0x10')](0x1f4,_0x43c54f['message']));});});}; \ No newline at end of file +var _0x4073=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0x4073,0x9f));var _0x3407=function(_0x1c863f,_0x4247fd){_0x1c863f=_0x1c863f-0x0;var _0x5b8ceb=_0x4073[_0x1c863f];return _0x5b8ceb;};'use strict';var _=require(_0x3407('0x0'));var util=require(_0x3407('0x1'));var moment=require(_0x3407('0x2'));var BPromise=require(_0x3407('0x3'));var rs=require(_0x3407('0x4'));var fs=require('fs');var Redis=require(_0x3407('0x5'));var db=require(_0x3407('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3407('0x7'))('rpc');var config=require(_0x3407('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3407('0x9')][_0x3407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7d00,_0x5e21ba,_0x590fc7){return new BPromise(function(_0x48813a,_0x3adb2f){return client[_0x3407('0xb')](_0x3f7d00,_0x590fc7)[_0x3407('0xc')](function(_0x6f125d){logger[_0x3407('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5e21ba,_0x3407('0xe'));logger['debug'](_0x3407('0xf'),_0x5e21ba,_0x3407('0xe'),JSON['stringify'](_0x6f125d));if(_0x6f125d['error']){if(_0x6f125d[_0x3407('0x10')][_0x3407('0x11')]===0x1f4){logger['error'](_0x3407('0x12'),_0x5e21ba,_0x6f125d[_0x3407('0x10')]['message']);return _0x3adb2f(_0x6f125d[_0x3407('0x10')][_0x3407('0x13')]);}logger[_0x3407('0x10')](_0x3407('0x12'),_0x5e21ba,_0x6f125d[_0x3407('0x10')][_0x3407('0x13')]);return _0x48813a(_0x6f125d[_0x3407('0x10')][_0x3407('0x13')]);}else{logger[_0x3407('0xd')](_0x3407('0x12'),_0x5e21ba,_0x3407('0xe'));_0x48813a(_0x6f125d[_0x3407('0x14')][_0x3407('0x13')]);}})[_0x3407('0x15')](function(_0x10e1fd){logger[_0x3407('0x10')](_0x3407('0x12'),_0x5e21ba,_0x10e1fd);_0x3adb2f(_0x10e1fd);});});}exports[_0x3407('0x16')]=function(_0x11e067){var _0x424396=this;return new Promise(function(_0x588393,_0xc1a8e0){return db['VoiceTransferReport'][_0x3407('0x17')](_0x11e067[_0x3407('0x18')],{'raw':_0x11e067['options']?_0x11e067[_0x3407('0x19')][_0x3407('0x1a')]===undefined?!![]:![]:!![]})[_0x3407('0xc')](function(_0x483d20){logger[_0x3407('0xd')](_0x3407('0x16'),_0x11e067);logger[_0x3407('0x1b')](_0x3407('0x16'),_0x11e067,JSON[_0x3407('0x1c')](_0x483d20));_0x588393(_0x483d20);})[_0x3407('0x15')](function(_0x5e8315){logger[_0x3407('0x10')](_0x3407('0x16'),_0x5e8315['message'],_0x11e067);_0xc1a8e0(_0x424396[_0x3407('0x10')](0x1f4,_0x5e8315['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index bc23a39..5ab477b 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 _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x3225bc,_0x2af10a){var _0x5dfc85=function(_0x370e96){while(--_0x370e96){_0x3225bc['push'](_0x3225bc['shift']());}};_0x5dfc85(++_0x2af10a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xb4e6[_0x28d18d];return _0x470640;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x195b0e,_0x5173dc){var _0x30782=function(_0x3081de){while(--_0x3081de){_0x195b0e['push'](_0x195b0e['shift']());}};_0x30782(++_0x5173dc);}(_0x5b02,0xe9));var _0x25b0=function(_0x4b70fe,_0x286d3e){_0x4b70fe=_0x4b70fe-0x0;var _0x32fbe9=_0x5b02[_0x4b70fe];return _0x32fbe9;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index fb51b4d..a580900 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 _0x39cb=['transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','catch','User','agent','VoiceChannels','all','rows','UserId','sessionId','length','\x20not\x20found!','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','validate','json','webbar:hangup','hangup\x20executed!','answer\x20fired:','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xb39c('0x0'));var db=require(_0xb39c('0x1'))['db'];var config=require('../../config/environment');var util=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xb39c('0x4')][_0xb39c('0x5')]({'port':0x232a});var logger=require(_0xb39c('0x6'))(_0xb39c('0x7'));var Redis=require(_0xb39c('0x8'));config['redis']=_[_0xb39c('0x9')](config[_0xb39c('0xa')],{'host':_0xb39c('0xb'),'port':0x18eb});var io=require(_0xb39c('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],_0xb39c('0xe')]},'callNumber':{'type':_0xb39c('0xf'),'required':[!![],_0xb39c('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb39c('0xe')]},'sessionId':{'type':_0xb39c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],_0xb39c('0xe')]},'sessionId':{'type':_0xb39c('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],_0xb39c('0xe')]},'sessionId':{'type':_0xb39c('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xb39c('0xf'),'required':[!![],_0xb39c('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb39c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],_0xb39c('0xe')]},'sessionId':{'type':_0xb39c('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],_0xb39c('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xb39c('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x316c9b,_0x3223f6,_0x10989d){logger[_0xb39c('0x12')](_0x316c9b,_0x3223f6,JSON[_0xb39c('0x13')](_0x10989d));io['to'](_0x316c9b)[_0xb39c('0x14')](_0x3223f6,_0x10989d);}function handleError(_0x1a2f48){return function(_0x4e02cf){console[_0xb39c('0x15')](_0xb39c('0x16'),_0x4e02cf,_0x4e02cf instanceof RangeError);logger['error'](_0x4e02cf[_0xb39c('0x17')]);if(_0x4e02cf instanceof RangeError){if(_0x4e02cf[_0xb39c('0x18')]){delete _0x4e02cf[_0xb39c('0x18')];}_0x1a2f48[_0xb39c('0x19')](0x194)['send'](_0x4e02cf);}else{if(_0x4e02cf[_0xb39c('0x18')]){delete _0x4e02cf[_0xb39c('0x18')];}_0x1a2f48['status'](0x1f4)[_0xb39c('0x1a')](_0x4e02cf);}};}function checkError(){return function(_0x363e52){if(!_0x363e52){throw new RangeError(_0xb39c('0x1b'));}return _0x363e52;};}function respondWithRpcPromise(_0x4ebfca,_0x539d27){return new BPromise(function(_0x2789fd,_0x1a5b9d){var _0x3c8dfd=amiClient;return _0x3c8dfd['request'](_0x4ebfca,_0x539d27)[_0xb39c('0x1c')](function(_0x438207){if(_0x438207[_0xb39c('0x1d')]){if(_0x438207[_0xb39c('0x1d')][_0xb39c('0x1e')]===0x1f4){return _0x1a5b9d(_0x438207['error'][_0xb39c('0x1f')]);}return _0x2789fd(_0x438207[_0xb39c('0x1d')]['message']);}else{_0x2789fd(_0x438207[_0xb39c('0x20')]);}})[_0xb39c('0x21')](function(_0x39116b){_0x1a5b9d(_0x39116b);});});}function getAgent(_0x12be70){return db[_0xb39c('0x22')]['findOne']({'where':{'id':_0x12be70,'role':_0xb39c('0x23')}})[_0xb39c('0x1c')](checkError());}function getAgentCheckSession(_0x132769,_0x4c06fa){return new BPromise(function(_0x41fff2,_0x337532){var _0x52eb5e=respondWithRpcPromise(_0xb39c('0x24'));var _0x4b4458=getAgent(_0x132769);Promise[_0xb39c('0x25')]([_0x52eb5e,_0x4b4458])['then'](function(_0x714d20){var _0x45fed4=_0x714d20[0x0];var _0x59172f=_0x714d20[0x1];var _0x2bc742=_['filter'](_0x45fed4[_0xb39c('0x26')],function(_0x2d2743){return _0x2d2743[_0xb39c('0x27')]==_0x59172f['id']&&_0x2d2743[_0xb39c('0x28')]==_0x4c06fa;});if(_0x2bc742[_0xb39c('0x29')]==0x1){_0x41fff2(_0x59172f);}else{_0x337532(new RangeError('sessionId\x20'+_0x4c06fa+_0xb39c('0x2a')));}});});}exports['originate']=function(_0x351d60,_0x48a888){logger[_0xb39c('0x12')](_0xb39c('0x2b'),_0x351d60[_0xb39c('0x2c')]);var _0x11ad56=originateValidation['validate'](_0x351d60['body']);if(_0x11ad56[_0xb39c('0x29')]>0x0){return _0x48a888[_0xb39c('0x19')](0x190)['json'](_0x11ad56);}var _0x1d7f2a=_0x351d60[_0xb39c('0x2c')][_0xb39c('0x2d')];var _0x1b15e7=_0x351d60[_0xb39c('0x2c')][_0xb39c('0x2e')];var _0x41cdd1=_0x351d60[_0xb39c('0x2c')][_0xb39c('0x2f')];var _0x24e9e8=_0x351d60[_0xb39c('0x2c')][_0xb39c('0x30')];return getAgent(_0x1d7f2a)[_0xb39c('0x1c')](function(_0x2f6b5a){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x2f6b5a[_0xb39c('0x18')]);emit(util[_0xb39c('0x32')](_0xb39c('0x33'),_0x2f6b5a['name']),_0xb39c('0x34'),{'callNumber':_0x1b15e7,'callerId':_0x41cdd1,'callbackUrl':_0x24e9e8});return _0x48a888[_0xb39c('0x19')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x48a888));};exports[_0xb39c('0x35')]=function(_0x33e468,_0xe6bc2e){logger['info'](_0xb39c('0x36'),_0x33e468[_0xb39c('0x2c')]);var _0x44afba=hangupValidation[_0xb39c('0x37')](_0x33e468[_0xb39c('0x2c')]);if(_0x44afba['length']>0x0){return _0xe6bc2e[_0xb39c('0x19')](0x190)[_0xb39c('0x38')](_0x44afba);}var _0x51b489=_0x33e468[_0xb39c('0x2c')]['userId'];var _0x1ee418=_0x33e468[_0xb39c('0x2c')][_0xb39c('0x28')];return getAgent(_0x51b489)['then'](function(_0x406fc6){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x406fc6[_0xb39c('0x18')]);emit(util[_0xb39c('0x32')](_0xb39c('0x33'),_0x406fc6[_0xb39c('0x18')]),_0xb39c('0x39'),{'sessionId':_0x1ee418});return _0xe6bc2e[_0xb39c('0x19')](0xc8)[_0xb39c('0x38')]({'error':![],'message':_0xb39c('0x3a')});})[_0xb39c('0x21')](handleError(_0xe6bc2e));};exports['answer']=function(_0x38e8ba,_0xbeb7b3){logger[_0xb39c('0x12')](_0xb39c('0x3b'),_0x38e8ba[_0xb39c('0x2c')]);var _0x390cd7=answerValidation[_0xb39c('0x37')](_0x38e8ba[_0xb39c('0x2c')]);if(_0x390cd7[_0xb39c('0x29')]>0x0){return _0xbeb7b3['status'](0x190)['json'](_0x390cd7);}var _0x2f88c9=_0x38e8ba[_0xb39c('0x2c')]['userId'];var _0x4bc2be=_0x38e8ba[_0xb39c('0x2c')]['sessionId'];return getAgent(_0x2f88c9)[_0xb39c('0x1c')](function(_0x3e0071){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x3e0071[_0xb39c('0x18')]);emit(util['format'](_0xb39c('0x33'),_0x3e0071[_0xb39c('0x18')]),'webbar:answer',{'sessionId':_0x4bc2be});return _0xbeb7b3['status'](0xc8)[_0xb39c('0x38')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0xbeb7b3));};exports[_0xb39c('0x3c')]=function(_0x2ff5ac,_0x4497a7){logger[_0xb39c('0x12')](_0xb39c('0x3d'),_0x2ff5ac[_0xb39c('0x2c')]);var _0x25ca4e=holdValidation[_0xb39c('0x37')](_0x2ff5ac[_0xb39c('0x2c')]);if(_0x25ca4e[_0xb39c('0x29')]>0x0){return _0x4497a7['status'](0x190)[_0xb39c('0x38')](_0x25ca4e);}var _0x7e9750=_0x2ff5ac[_0xb39c('0x2c')][_0xb39c('0x2d')];var _0x40e1dc=_0x2ff5ac[_0xb39c('0x2c')][_0xb39c('0x28')];return getAgent(_0x7e9750)[_0xb39c('0x1c')](function(_0x38bc36){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x38bc36[_0xb39c('0x18')]);emit(util[_0xb39c('0x32')](_0xb39c('0x33'),_0x38bc36[_0xb39c('0x18')]),_0xb39c('0x3e'),{'sessionId':_0x40e1dc});return _0x4497a7['status'](0xc8)[_0xb39c('0x38')]({'error':![],'message':_0xb39c('0x3f')});})[_0xb39c('0x21')](handleError(_0x4497a7));};exports[_0xb39c('0x40')]=function(_0xa50077,_0x18db8f){logger[_0xb39c('0x12')](_0xb39c('0x41'),_0xa50077['body']);var _0x4886ab=unholdValidation[_0xb39c('0x37')](_0xa50077[_0xb39c('0x2c')]);if(_0x4886ab['length']>0x0){return _0x18db8f['status'](0x190)[_0xb39c('0x38')](_0x4886ab);}var _0x1d1abf=_0xa50077['body'][_0xb39c('0x2d')];var _0x55b6b1=_0xa50077['body'][_0xb39c('0x28')];return getAgent(_0x1d1abf)['then'](function(_0x2c5434){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x2c5434[_0xb39c('0x18')]);emit(util[_0xb39c('0x32')](_0xb39c('0x33'),_0x2c5434['name']),_0xb39c('0x42'),{'sessionId':_0x55b6b1});return _0x18db8f[_0xb39c('0x19')](0xc8)[_0xb39c('0x38')]({'error':![],'message':_0xb39c('0x43')});})[_0xb39c('0x21')](handleError(_0x18db8f));};exports['calls']=function(_0x285313,_0x4ab58e){logger[_0xb39c('0x12')](_0xb39c('0x44'),_0x4ab58e[_0xb39c('0x2c')]);var _0x9e4e89=callsValidation[_0xb39c('0x37')](_0x285313[_0xb39c('0x2c')]);if(_0x9e4e89[_0xb39c('0x29')]>0x0){return _0x4ab58e[_0xb39c('0x19')](0x190)[_0xb39c('0x38')](_0x9e4e89);}var _0x3c17d1=_0x285313[_0xb39c('0x2c')][_0xb39c('0x2d')];var _0x2620ee=respondWithRpcPromise(_0xb39c('0x24'));var _0xe31742=getAgent(_0x3c17d1);return Promise[_0xb39c('0x25')]([_0x2620ee,_0xe31742])[_0xb39c('0x1c')](function(_0x3a617e){var _0x18431c=_0x3a617e[0x0];var _0x49f118=_0x3a617e[0x1];var _0x57f2f4=_[_0xb39c('0x45')](_0x18431c[_0xb39c('0x26')],function(_0x52daf6){return _0x52daf6[_0xb39c('0x27')]==_0x49f118['id'];});return _0x4ab58e[_0xb39c('0x19')](0xc8)['json']({'count':_0x57f2f4[_0xb39c('0x29')],'rows':_0x57f2f4});})[_0xb39c('0x21')](handleError(_0x4ab58e));};exports[_0xb39c('0x46')]=function(_0x19647a,_0x453a21){logger[_0xb39c('0x12')]('conference\x20fired:',_0x19647a[_0xb39c('0x2c')]);var _0x384f4f=conferenceValidation[_0xb39c('0x37')](_0x19647a[_0xb39c('0x2c')]);if(_0x384f4f[_0xb39c('0x29')]>0x0){return _0x453a21[_0xb39c('0x19')](0x190)[_0xb39c('0x38')](_0x384f4f);}var _0x47dcda=_0x19647a[_0xb39c('0x2c')][_0xb39c('0x2d')];return getAgent(_0x47dcda)[_0xb39c('0x1c')](function(_0x17b0c4){logger[_0xb39c('0x12')]('entityFound:',_0x17b0c4['name']);emit(util[_0xb39c('0x32')](_0xb39c('0x33'),_0x17b0c4[_0xb39c('0x18')]),'webbar:conference');return _0x453a21[_0xb39c('0x19')](0xc8)['json']({'error':![],'message':_0xb39c('0x47')});})['catch'](handleError(_0x453a21));};exports[_0xb39c('0x48')]=function(_0x82b625,_0x6aa1ee){logger['info'](_0xb39c('0x49'),_0x82b625[_0xb39c('0x2c')]);var _0x14b448=transferValidation[_0xb39c('0x37')](_0x82b625[_0xb39c('0x2c')]);if(_0x14b448[_0xb39c('0x29')]>0x0){return _0x6aa1ee[_0xb39c('0x19')](0x190)[_0xb39c('0x38')](_0x14b448);}var _0x14dce7=_0x82b625[_0xb39c('0x2c')][_0xb39c('0x2d')];var _0x227152=_0x82b625[_0xb39c('0x2c')][_0xb39c('0x28')];var _0x1b2138=_0x82b625[_0xb39c('0x2c')][_0xb39c('0x4a')];return getAgent(_0x14dce7)['then'](function(_0x2d936f){logger[_0xb39c('0x12')](_0xb39c('0x31'),_0x2d936f['name']);emit(util[_0xb39c('0x32')]('user:%s',_0x2d936f['name']),_0xb39c('0x4b'),{'sessionId':_0x227152,'transferNumber':_0x1b2138});return _0x6aa1ee[_0xb39c('0x19')](0xc8)[_0xb39c('0x38')]({'error':![],'message':_0xb39c('0x4c')});})[_0xb39c('0x21')](handleError(_0x6aa1ee));}; \ No newline at end of file +var _0xb43b=['ioredis','redis','validate','number','userId\x20is\x20required','string','info','stringify','emit','log','error','name','status','send','NotFound','request','then','code','message','result','User','VoiceChannels','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:','format','json','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','user:%s','answer\x20executed!','hold','hold\x20fired:','webbar:hold','calls','calls\x20fired:','all','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi'];(function(_0xa93cfb,_0x57dd06){var _0xd68cf5=function(_0x25c81d){while(--_0x25c81d){_0xa93cfb['push'](_0xa93cfb['shift']());}};_0xd68cf5(++_0x57dd06);}(_0xb43b,0xbf));var _0xbb43=function(_0x351395,_0x476f7d){_0x351395=_0x351395-0x0;var _0x6abb9e=_0xb43b[_0x351395];return _0x6abb9e;};'use strict';var path=require(_0xbb43('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xbb43('0x1'))['db'];var config=require(_0xbb43('0x2'));var util=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var jayson=require(_0xbb43('0x5'));var amiClient=jayson[_0xbb43('0x6')][_0xbb43('0x7')]({'port':0x232a});var logger=require(_0xbb43('0x8'))(_0xbb43('0x9'));var Redis=require(_0xbb43('0xa'));config[_0xbb43('0xb')]=_['defaults'](config[_0xbb43('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb43('0xb')]));var Schema=require(_0xbb43('0xc'));var originateValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'callNumber':{'type':_0xbb43('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xbb43('0xf')},'callbackUrl':{'type':_0xbb43('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbb43('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbb43('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':_0xbb43('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]}});function emit(_0x15182b,_0x10c91b,_0x3be44b){logger[_0xbb43('0x10')](_0x15182b,_0x10c91b,JSON[_0xbb43('0x11')](_0x3be44b));io['to'](_0x15182b)[_0xbb43('0x12')](_0x10c91b,_0x3be44b);}function handleError(_0x20b839){return function(_0x4c223b){console[_0xbb43('0x13')]('handleError:',_0x4c223b,_0x4c223b instanceof RangeError);logger[_0xbb43('0x14')](_0x4c223b['stack']);if(_0x4c223b instanceof RangeError){if(_0x4c223b[_0xbb43('0x15')]){delete _0x4c223b[_0xbb43('0x15')];}_0x20b839[_0xbb43('0x16')](0x194)[_0xbb43('0x17')](_0x4c223b);}else{if(_0x4c223b['name']){delete _0x4c223b[_0xbb43('0x15')];}_0x20b839[_0xbb43('0x16')](0x1f4)[_0xbb43('0x17')](_0x4c223b);}};}function checkError(){return function(_0x6f34d6){if(!_0x6f34d6){throw new RangeError(_0xbb43('0x18'));}return _0x6f34d6;};}function respondWithRpcPromise(_0x57fc97,_0xee1084){return new BPromise(function(_0x1e83cd,_0x3409d0){var _0x3cb6d1=amiClient;return _0x3cb6d1[_0xbb43('0x19')](_0x57fc97,_0xee1084)[_0xbb43('0x1a')](function(_0x36992f){if(_0x36992f[_0xbb43('0x14')]){if(_0x36992f['error'][_0xbb43('0x1b')]===0x1f4){return _0x3409d0(_0x36992f[_0xbb43('0x14')]['message']);}return _0x1e83cd(_0x36992f[_0xbb43('0x14')][_0xbb43('0x1c')]);}else{_0x1e83cd(_0x36992f[_0xbb43('0x1d')]);}})['catch'](function(_0x4ea4c5){_0x3409d0(_0x4ea4c5);});});}function getAgent(_0x20f223){return db[_0xbb43('0x1e')]['findOne']({'where':{'id':_0x20f223,'role':'agent'}})[_0xbb43('0x1a')](checkError());}function getAgentCheckSession(_0xb9fe3b,_0x268fb5){return new BPromise(function(_0x4bb859,_0x27bb65){var _0x426cec=respondWithRpcPromise(_0xbb43('0x1f'));var _0x1a6e2b=getAgent(_0xb9fe3b);Promise['all']([_0x426cec,_0x1a6e2b])[_0xbb43('0x1a')](function(_0x170e7a){var _0x821beb=_0x170e7a[0x0];var _0x293d66=_0x170e7a[0x1];var _0x34b679=_[_0xbb43('0x20')](_0x821beb[_0xbb43('0x21')],function(_0x48986d){return _0x48986d[_0xbb43('0x22')]==_0x293d66['id']&&_0x48986d[_0xbb43('0x23')]==_0x268fb5;});if(_0x34b679[_0xbb43('0x24')]==0x1){_0x4bb859(_0x293d66);}else{_0x27bb65(new RangeError('sessionId\x20'+_0x268fb5+_0xbb43('0x25')));}});});}exports[_0xbb43('0x26')]=function(_0x9384d8,_0x168374){logger[_0xbb43('0x10')](_0xbb43('0x27'),_0x9384d8[_0xbb43('0x28')]);var _0xa86300=originateValidation[_0xbb43('0xc')](_0x9384d8['body']);if(_0xa86300['length']>0x0){return _0x168374['status'](0x190)['json'](_0xa86300);}var _0x352249=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x29')];var _0xe5d75b=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x2a')];var _0x3c8758=_0x9384d8[_0xbb43('0x28')]['callerId'];var _0x1cf664=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x2b')];return getAgent(_0x352249)[_0xbb43('0x1a')](function(_0x4c65d0){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x4c65d0[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')]('user:%s',_0x4c65d0[_0xbb43('0x15')]),'webbar:originate',{'callNumber':_0xe5d75b,'callerId':_0x3c8758,'callbackUrl':_0x1cf664});return _0x168374[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x2f')});})[_0xbb43('0x30')](handleError(_0x168374));};exports[_0xbb43('0x31')]=function(_0x1c1f8b,_0x316ab1){logger[_0xbb43('0x10')](_0xbb43('0x32'),_0x1c1f8b[_0xbb43('0x28')]);var _0xfeaa38=hangupValidation[_0xbb43('0xc')](_0x1c1f8b['body']);if(_0xfeaa38[_0xbb43('0x24')]>0x0){return _0x316ab1[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0xfeaa38);}var _0x2db230=_0x1c1f8b[_0xbb43('0x28')][_0xbb43('0x29')];var _0x21e03d=_0x1c1f8b[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0x2db230)[_0xbb43('0x1a')](function(_0x1fe204){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1fe204[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')]('user:%s',_0x1fe204[_0xbb43('0x15')]),_0xbb43('0x33'),{'sessionId':_0x21e03d});return _0x316ab1[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x34')});})[_0xbb43('0x30')](handleError(_0x316ab1));};exports['answer']=function(_0x13e9f7,_0x448c6f){logger['info']('answer\x20fired:',_0x13e9f7[_0xbb43('0x28')]);var _0x1eb63f=answerValidation[_0xbb43('0xc')](_0x13e9f7[_0xbb43('0x28')]);if(_0x1eb63f[_0xbb43('0x24')]>0x0){return _0x448c6f['status'](0x190)['json'](_0x1eb63f);}var _0x2ea37b=_0x13e9f7[_0xbb43('0x28')][_0xbb43('0x29')];var _0x2d1256=_0x13e9f7[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0x2ea37b)[_0xbb43('0x1a')](function(_0x1d8993){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1d8993['name']);emit(util['format'](_0xbb43('0x35'),_0x1d8993[_0xbb43('0x15')]),'webbar:answer',{'sessionId':_0x2d1256});return _0x448c6f[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x36')});})[_0xbb43('0x30')](handleError(_0x448c6f));};exports[_0xbb43('0x37')]=function(_0x1fcb16,_0x3976f1){logger['info'](_0xbb43('0x38'),_0x1fcb16[_0xbb43('0x28')]);var _0x5970cc=holdValidation[_0xbb43('0xc')](_0x1fcb16[_0xbb43('0x28')]);if(_0x5970cc['length']>0x0){return _0x3976f1[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x5970cc);}var _0xd1f32b=_0x1fcb16[_0xbb43('0x28')][_0xbb43('0x29')];var _0x43a840=_0x1fcb16[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0xd1f32b)[_0xbb43('0x1a')](function(_0x2f044f){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x2f044f['name']);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x2f044f[_0xbb43('0x15')]),_0xbb43('0x39'),{'sessionId':_0x43a840});return _0x3976f1['status'](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'hold\x20executed!'});})[_0xbb43('0x30')](handleError(_0x3976f1));};exports['unhold']=function(_0x21f78b,_0x322a77){logger[_0xbb43('0x10')]('unhold\x20fired:',_0x21f78b[_0xbb43('0x28')]);var _0x218da6=unholdValidation[_0xbb43('0xc')](_0x21f78b['body']);if(_0x218da6[_0xbb43('0x24')]>0x0){return _0x322a77[_0xbb43('0x16')](0x190)['json'](_0x218da6);}var _0x42029c=_0x21f78b['body'][_0xbb43('0x29')];var _0x476116=_0x21f78b['body'][_0xbb43('0x23')];return getAgent(_0x42029c)[_0xbb43('0x1a')](function(_0x349390){logger['info'](_0xbb43('0x2c'),_0x349390['name']);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x349390[_0xbb43('0x15')]),'webbar:unhold',{'sessionId':_0x476116});return _0x322a77[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x322a77));};exports[_0xbb43('0x3a')]=function(_0x9e3707,_0x5b7b39){logger['info'](_0xbb43('0x3b'),_0x5b7b39['body']);var _0x30908e=callsValidation[_0xbb43('0xc')](_0x9e3707[_0xbb43('0x28')]);if(_0x30908e['length']>0x0){return _0x5b7b39['status'](0x190)['json'](_0x30908e);}var _0x55cb63=_0x9e3707['body'][_0xbb43('0x29')];var _0x31d265=respondWithRpcPromise(_0xbb43('0x1f'));var _0x4024bb=getAgent(_0x55cb63);return Promise[_0xbb43('0x3c')]([_0x31d265,_0x4024bb])['then'](function(_0x19e8b7){var _0x529455=_0x19e8b7[0x0];var _0x6e7c04=_0x19e8b7[0x1];var _0x4b5e4b=_[_0xbb43('0x20')](_0x529455[_0xbb43('0x21')],function(_0x132b98){return _0x132b98[_0xbb43('0x22')]==_0x6e7c04['id'];});return _0x5b7b39['status'](0xc8)[_0xbb43('0x2e')]({'count':_0x4b5e4b['length'],'rows':_0x4b5e4b});})[_0xbb43('0x30')](handleError(_0x5b7b39));};exports[_0xbb43('0x3d')]=function(_0x512619,_0x1b69ab){logger[_0xbb43('0x10')]('conference\x20fired:',_0x512619[_0xbb43('0x28')]);var _0x13e1e3=conferenceValidation[_0xbb43('0xc')](_0x512619[_0xbb43('0x28')]);if(_0x13e1e3[_0xbb43('0x24')]>0x0){return _0x1b69ab[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x13e1e3);}var _0x161556=_0x512619['body'][_0xbb43('0x29')];return getAgent(_0x161556)['then'](function(_0x36a69b){logger[_0xbb43('0x10')]('entityFound:',_0x36a69b[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x36a69b[_0xbb43('0x15')]),_0xbb43('0x3e'));return _0x1b69ab[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x3f')});})['catch'](handleError(_0x1b69ab));};exports[_0xbb43('0x40')]=function(_0x21260c,_0x12f96c){logger[_0xbb43('0x10')]('transfer\x20fired:',_0x21260c[_0xbb43('0x28')]);var _0x5d73a5=transferValidation[_0xbb43('0xc')](_0x21260c['body']);if(_0x5d73a5[_0xbb43('0x24')]>0x0){return _0x12f96c[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x5d73a5);}var _0x265d2d=_0x21260c[_0xbb43('0x28')][_0xbb43('0x29')];var _0x349699=_0x21260c[_0xbb43('0x28')][_0xbb43('0x23')];var _0x32483f=_0x21260c['body'][_0xbb43('0x41')];return getAgent(_0x265d2d)['then'](function(_0x1b9280){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1b9280[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x1b9280[_0xbb43('0x15')]),_0xbb43('0x42'),{'sessionId':_0x349699,'transferNumber':_0x32483f});return _0x12f96c['status'](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x12f96c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9cc0209..9efb89f 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 _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file +var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0xe71ba,_0x3da2a2){var _0x304874=function(_0x2307d3){while(--_0x2307d3){_0xe71ba['push'](_0xe71ba['shift']());}};_0x304874(++_0x3da2a2);}(_0xda2d,0x102));var _0xdda2=function(_0x554f28,_0x55b71f){_0x554f28=_0x554f28-0x0;var _0x137a2f=_0xda2d[_0x554f28];return _0x137a2f;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b79ec5a..b6b1649 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 _0x187c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x28a5b7,_0x3bd080){var _0x13889e=function(_0x1075b8){while(--_0x1075b8){_0x28a5b7['push'](_0x28a5b7['shift']());}};_0x13889e(++_0x3bd080);}(_0x187c,0x9f));var _0xc187=function(_0x2051d9,_0x21e860){_0x2051d9=_0x2051d9-0x0;var _0x4b6826=_0x187c[_0x2051d9];return _0x4b6826;};'use strict';var Sequelize=require(_0xc187('0x0'));var rs=require(_0xc187('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc187('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc187('0x3')],'defaultValue':function(){return rs[_0xc187('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xc187('0x5'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc187('0x6');}},'notificationSound':{'type':Sequelize[_0xc187('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc187('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc187('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc187('0x8')],'comment':_0xc187('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc187('0x7')],'defaultValue':![],'comment':_0xc187('0xa'),'set':function(_0x3b8836){if(!_0x3b8836){this['setDataValue'](_0xc187('0xb'),null);}this[_0xc187('0xc')](_0xc187('0xd'),_0x3b8836);}},'description':{'type':Sequelize[_0xc187('0x3')]}}; \ No newline at end of file +var _0x13ee=['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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','ENUM','twilio'];(function(_0x4ee635,_0x18d6af){var _0x571444=function(_0xedd141){while(--_0xedd141){_0x4ee635['push'](_0x4ee635['shift']());}};_0x571444(++_0x18d6af);}(_0x13ee,0x117));var _0xe13e=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x13ee[_0x56fb33];return _0x435ee4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe13e('0x0'));module[_0xe13e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe13e('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe13e('0x3')]},'type':{'type':Sequelize[_0xe13e('0x4')](_0xe13e('0x5'),_0xe13e('0x6'))},'accountSid':{'type':Sequelize[_0xe13e('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe13e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe13e('0x7')],'defaultValue':function(){return _0xe13e('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe13e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe13e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe13e('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe13e('0xa')],'comment':_0xe13e('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xe13e('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x593fd9){if(!_0x593fd9){this[_0xe13e('0xc')](_0xe13e('0xd'),null);}this['setDataValue'](_0xe13e('0xe'),_0x593fd9);}},'description':{'type':Sequelize[_0xe13e('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 7b0230e..746b234 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 _0xf50a=['Pause','WhatsappAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','sort','options','removeDispositions','ids','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','map','getAgents','sequelize','Transaction','WhatsappApplication','bulkCreate','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','mobile','From','Body','messageId','MessageSid','from','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','ListId','DESC','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','limit','offset','set','Content-Range','json','apply','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf50a,0x14f));var _0xaf50=function(_0xa1b5fb,_0x41a2bd){_0xa1b5fb=_0xa1b5fb-0x0;var _0x123597=_0xf50a[_0xa1b5fb];return _0x123597;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf50('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf50('0x1'));var moment=require(_0xaf50('0x2'));var BPromise=require(_0xaf50('0x3'));var Mustache=require('mustache');var util=require(_0xaf50('0x4'));var path=require(_0xaf50('0x5'));var sox=require(_0xaf50('0x6'));var csv=require(_0xaf50('0x7'));var ejs=require(_0xaf50('0x8'));var fs=require('fs');var fs_extra=require(_0xaf50('0x9'));var _=require('lodash');var squel=require(_0xaf50('0xa'));var crypto=require(_0xaf50('0xb'));var jsforce=require(_0xaf50('0xc'));var deskjs=require(_0xaf50('0xd'));var toCsv=require(_0xaf50('0x7'));var querystring=require(_0xaf50('0xe'));var Papa=require(_0xaf50('0xf'));var Redis=require(_0xaf50('0x10'));var authService=require(_0xaf50('0x11'));var qs=require(_0xaf50('0x12'));var as=require(_0xaf50('0x13'));var hardwareService=require(_0xaf50('0x14'));var logger=require(_0xaf50('0x15'))(_0xaf50('0x16'));var utils=require(_0xaf50('0x17'));var config=require(_0xaf50('0x18'));var licenseUtil=require(_0xaf50('0x19'));var db=require('../../mysqldb')['db'];config[_0xaf50('0x1a')]=_[_0xaf50('0x1b')](config[_0xaf50('0x1a')],{'host':_0xaf50('0x1c'),'port':0x18eb});var socket=require(_0xaf50('0x1d'))(new Redis(config[_0xaf50('0x1a')]));require(_0xaf50('0x1e'))[_0xaf50('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1acc2a,_0x3e0b72,_0x255462,_0x39687e){return new BPromise(function(_0x5890b6,_0x51e818){var _0x1912b5=_0x39687e||client;return _0x1912b5[_0xaf50('0x20')](_0x1acc2a,_0x255462)[_0xaf50('0x21')](function(_0x40678f){logger[_0xaf50('0x22')](_0xaf50('0x23'),_0x3e0b72,_0xaf50('0x24'));logger[_0xaf50('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3e0b72,_0xaf50('0x24'),JSON[_0xaf50('0x26')](_0x40678f));if(_0x40678f[_0xaf50('0x27')]){if(_0x40678f[_0xaf50('0x27')][_0xaf50('0x28')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3e0b72,_0x40678f['error'][_0xaf50('0x29')]);return _0x51e818(_0x40678f[_0xaf50('0x27')][_0xaf50('0x29')]);}logger[_0xaf50('0x27')](_0xaf50('0x23'),_0x3e0b72,_0x40678f['error'][_0xaf50('0x29')]);return _0x5890b6(_0x40678f[_0xaf50('0x27')][_0xaf50('0x29')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x3e0b72,'request\x20sent');_0x5890b6(_0x40678f[_0xaf50('0x2a')][_0xaf50('0x29')]);}})['catch'](function(_0x47b202){logger[_0xaf50('0x27')](_0xaf50('0x23'),_0x3e0b72,_0x47b202);_0x51e818(_0x47b202);});});}function respondWithStatusCode(_0x130ea6,_0x427221){_0x427221=_0x427221||0xcc;return function(_0x4886d2){if(_0x4886d2){return _0x130ea6[_0xaf50('0x2b')](_0x427221);}return _0x130ea6['status'](_0x427221)[_0xaf50('0x2c')]();};}function respondWithResult(_0x17953f,_0xb0166d){_0xb0166d=_0xb0166d||0xc8;return function(_0x2fdbce){if(_0x2fdbce){return _0x17953f[_0xaf50('0x2d')](_0xb0166d)['json'](_0x2fdbce);}};}function respondWithFilteredResult(_0x2a2d5b,_0x4d4f7a){return function(_0x50fd7c){if(_0x50fd7c){var _0x430e05=typeof _0x4d4f7a['offset']==='undefined'&&typeof _0x4d4f7a[_0xaf50('0x2e')]==='undefined';var _0x12f738=_0x50fd7c['count'];var _0x162431=_0x430e05?0x0:_0x4d4f7a[_0xaf50('0x2f')];var _0x5bf454=_0x430e05?_0x50fd7c['count']:_0x4d4f7a[_0xaf50('0x2f')]+_0x4d4f7a['limit'];var _0x279422;if(_0x5bf454>=_0x12f738){_0x5bf454=_0x12f738;_0x279422=0xc8;}else{_0x279422=0xce;}_0x2a2d5b[_0xaf50('0x2d')](_0x279422);return _0x2a2d5b[_0xaf50('0x30')](_0xaf50('0x31'),_0x162431+'-'+_0x5bf454+'/'+_0x12f738)[_0xaf50('0x32')](_0x50fd7c);}return null;};}function patchUpdates(_0x2e7e8a){return function(_0x158732){try{jsonpatch[_0xaf50('0x33')](_0x158732,_0x2e7e8a,!![]);}catch(_0x4aba40){return BPromise['reject'](_0x4aba40);}return _0x158732[_0xaf50('0x34')]();};}function saveUpdates(_0x3ef2a6,_0x1cf041){return function(_0x51eeeb){if(_0x51eeeb){return _0x51eeeb[_0xaf50('0x35')](_0x3ef2a6)[_0xaf50('0x21')](function(_0x5d2c37){return _0x5d2c37;});}return null;};}function removeEntity(_0xbc47fa,_0xcd6e22){return function(_0x4bafff){if(_0x4bafff){return _0x4bafff[_0xaf50('0x36')]()['then'](function(){var _0x237d55=_0x4bafff[_0xaf50('0x37')]({'plain':!![]});var _0x2bd7f8=_0xaf50('0x38');return db[_0xaf50('0x39')][_0xaf50('0x36')]({'where':{'type':_0x2bd7f8,'resourceId':_0x237d55['id']}})[_0xaf50('0x21')](function(){return _0x4bafff;});})['then'](function(){_0xbc47fa[_0xaf50('0x2d')](0xcc)[_0xaf50('0x2c')]();});}};}function handleEntityNotFound(_0x243c7e,_0x123ab3){return function(_0x393b44){if(!_0x393b44){_0x243c7e[_0xaf50('0x2b')](0x194);}return _0x393b44;};}function handleError(_0x2051e7,_0x58af2a){_0x58af2a=_0x58af2a||0x1f4;return function(_0x3fb119){logger[_0xaf50('0x27')](_0x3fb119[_0xaf50('0x3a')]);if(_0x3fb119['name']){delete _0x3fb119[_0xaf50('0x3b')];}_0x2051e7[_0xaf50('0x2d')](_0x58af2a)['send'](_0x3fb119);};}exports[_0xaf50('0x3c')]=function(_0x68fcbc,_0x58498a){var _0x2287f9={'include':[{'model':db[_0xaf50('0x3d')],'as':'mandatoryDispositionPause'}]},_0xf6d331={},_0x304e31={'count':0x0,'rows':[]};var _0x347a72=_['map'](db[_0xaf50('0x3e')]['rawAttributes'],function(_0x1039fc){return{'name':_0x1039fc[_0xaf50('0x3f')],'type':_0x1039fc[_0xaf50('0x40')][_0xaf50('0x41')]};});_0xf6d331[_0xaf50('0x42')]=_['map'](_0x347a72,_0xaf50('0x3b'));_0xf6d331[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x68fcbc[_0xaf50('0x43')]);_0xf6d331[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0xf6d331[_0xaf50('0x42')],_0xf6d331[_0xaf50('0x43')]);_0x2287f9[_0xaf50('0x47')]=_[_0xaf50('0x46')](_0xf6d331[_0xaf50('0x42')],qs[_0xaf50('0x48')](_0x68fcbc['query'][_0xaf50('0x48')]));_0x2287f9[_0xaf50('0x47')]=_0x2287f9['attributes'][_0xaf50('0x49')]?_0x2287f9['attributes']:_0xf6d331['model'];if(!_0x68fcbc[_0xaf50('0x43')][_0xaf50('0x4a')](_0xaf50('0x4b'))){_0x2287f9[_0xaf50('0x2e')]=qs[_0xaf50('0x2e')](_0x68fcbc[_0xaf50('0x43')][_0xaf50('0x2e')]);_0x2287f9[_0xaf50('0x2f')]=qs['offset'](_0x68fcbc[_0xaf50('0x43')][_0xaf50('0x2f')]);}_0x2287f9[_0xaf50('0x4c')]=qs['sort'](_0x68fcbc[_0xaf50('0x43')]['sort']);_0x2287f9['where']=qs[_0xaf50('0x45')](_[_0xaf50('0x4d')](_0x68fcbc[_0xaf50('0x43')],_0xf6d331[_0xaf50('0x45')]),_0x347a72);if(_0x68fcbc['query'][_0xaf50('0x4e')]){_0x2287f9[_0xaf50('0x4f')]=_[_0xaf50('0x50')](_0x2287f9[_0xaf50('0x4f')],{'$or':_['map'](_0x347a72,function(_0x5018a7){if(_0x5018a7[_0xaf50('0x40')]!=='VIRTUAL'){var _0x2eb6ca={};_0x2eb6ca[_0x5018a7[_0xaf50('0x3b')]]={'$like':'%'+_0x68fcbc['query'][_0xaf50('0x4e')]+'%'};return _0x2eb6ca;}})});}_0x2287f9=_[_0xaf50('0x50')]({},_0x2287f9,_0x68fcbc['options']);var _0x233d68={'where':_0x2287f9['where']};return db[_0xaf50('0x3e')][_0xaf50('0x51')](_0x233d68)[_0xaf50('0x21')](function(_0x52f26b){_0x304e31[_0xaf50('0x51')]=_0x52f26b;if(_0x68fcbc[_0xaf50('0x43')][_0xaf50('0x52')]){_0x2287f9[_0xaf50('0x53')]=[{'all':!![]}];}return db[_0xaf50('0x3e')][_0xaf50('0x54')](_0x2287f9);})[_0xaf50('0x21')](function(_0xc0a06a){_0x304e31[_0xaf50('0x55')]=_0xc0a06a;return _0x304e31;})['then'](respondWithFilteredResult(_0x58498a,_0x2287f9))[_0xaf50('0x56')](handleError(_0x58498a,null));};exports[_0xaf50('0x57')]=function(_0x456fc5,_0x42d309){var _0x5442c6={'raw':![],'where':{'id':_0x456fc5[_0xaf50('0x58')]['id']},'include':[{'model':db[_0xaf50('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3ad600={};_0x3ad600[_0xaf50('0x42')]=_[_0xaf50('0x44')](db['WhatsappAccount']['rawAttributes']);_0x3ad600[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x456fc5['query']);_0x3ad600[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0x3ad600['model'],_0x3ad600[_0xaf50('0x43')]);_0x5442c6[_0xaf50('0x47')]=_[_0xaf50('0x46')](_0x3ad600[_0xaf50('0x42')],qs['fields'](_0x456fc5[_0xaf50('0x43')][_0xaf50('0x48')]));_0x5442c6[_0xaf50('0x47')]=_0x5442c6[_0xaf50('0x47')][_0xaf50('0x49')]?_0x5442c6['attributes']:_0x3ad600[_0xaf50('0x42')];if(_0x456fc5[_0xaf50('0x43')][_0xaf50('0x52')]){_0x5442c6[_0xaf50('0x53')]=[{'all':!![]}];}_0x5442c6=_[_0xaf50('0x50')]({},_0x5442c6,_0x456fc5['options']);return db['WhatsappAccount'][_0xaf50('0x59')](_0x5442c6)['then'](handleEntityNotFound(_0x42d309,null))['then'](respondWithResult(_0x42d309,null))[_0xaf50('0x56')](handleError(_0x42d309,null));};exports[_0xaf50('0x5a')]=function(_0x7d7ed,_0x3a8f6){return db[_0xaf50('0x3e')][_0xaf50('0x5a')](_0x7d7ed[_0xaf50('0x5b')],{})[_0xaf50('0x21')](function(_0x37826b){var _0xce3886=_0x7d7ed['user'][_0xaf50('0x37')]({'plain':!![]});if(!_0xce3886)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xce3886[_0xaf50('0x5c')]===_0xaf50('0x5d')){var _0x3b6517=_0x37826b[_0xaf50('0x37')]({'plain':!![]});var _0x46334d=_0xaf50('0x38');return db[_0xaf50('0x5e')][_0xaf50('0x59')]({'where':{'name':_0x46334d,'userProfileId':_0xce3886[_0xaf50('0x5f')]},'raw':!![]})['then'](function(_0x10d5cc){if(_0x10d5cc&&_0x10d5cc[_0xaf50('0x60')]===0x0){return db['UserProfileResource'][_0xaf50('0x5a')]({'name':_0x3b6517[_0xaf50('0x3b')],'resourceId':_0x3b6517['id'],'type':_0x10d5cc[_0xaf50('0x3b')],'sectionId':_0x10d5cc['id']},{})[_0xaf50('0x21')](function(){return _0x37826b;});}else{return _0x37826b;}})['catch'](function(_0x19b700){logger['error'](_0xaf50('0x61'),_0x19b700);throw _0x19b700;});}return _0x37826b;})[_0xaf50('0x21')](respondWithResult(_0x3a8f6,0xc9))[_0xaf50('0x56')](handleError(_0x3a8f6,null));};exports['update']=function(_0xade003,_0x38209f){if(_0xade003[_0xaf50('0x5b')]['id']){delete _0xade003['body']['id'];}return db[_0xaf50('0x3e')][_0xaf50('0x59')]({'where':{'id':_0xade003[_0xaf50('0x58')]['id']},'include':[{'model':db[_0xaf50('0x3d')],'as':_0xaf50('0x62')}]})['then'](handleEntityNotFound(_0x38209f,null))['then'](saveUpdates(_0xade003[_0xaf50('0x5b')],null))['then'](respondWithResult(_0x38209f,null))[_0xaf50('0x56')](handleError(_0x38209f,null));};exports[_0xaf50('0x36')]=function(_0x5bfc61,_0x12a978){return db[_0xaf50('0x3e')][_0xaf50('0x59')]({'where':{'id':_0x5bfc61[_0xaf50('0x58')]['id']}})[_0xaf50('0x21')](handleEntityNotFound(_0x12a978,null))[_0xaf50('0x21')](removeEntity(_0x12a978,null))[_0xaf50('0x56')](handleError(_0x12a978,null));};exports[_0xaf50('0x63')]=function(_0x46755f,_0x5f5b0d){return db[_0xaf50('0x3e')][_0xaf50('0x63')]()[_0xaf50('0x21')](respondWithResult(_0x5f5b0d,null))[_0xaf50('0x56')](handleError(_0x5f5b0d,null));};exports[_0xaf50('0x64')]=function(_0x572530,_0x323a99,_0xcccfa9){if(_0x572530[_0xaf50('0x5b')]['id']){delete _0x572530[_0xaf50('0x5b')]['id'];}return db[_0xaf50('0x3e')]['find']({'where':{'id':_0x572530[_0xaf50('0x58')]['id']}})['then'](handleEntityNotFound(_0x323a99,null))['then'](function(_0x2f1028){if(_0x2f1028){_0x572530[_0xaf50('0x5b')][_0xaf50('0x65')]=_0x2f1028['id'];return db[_0xaf50('0x66')][_0xaf50('0x5a')](_0x572530[_0xaf50('0x5b')]);}})[_0xaf50('0x21')](respondWithResult(_0x323a99,null))[_0xaf50('0x56')](handleError(_0x323a99,null));};exports[_0xaf50('0x67')]=function(_0x4eb69a,_0xcfd3c9,_0x2de6ea){var _0x5a755d={'raw':![],'where':{}};var _0x521709={};var _0x55afdf={'count':0x0,'rows':[]};return db[_0xaf50('0x3e')][_0xaf50('0x68')]({'where':{'id':_0x4eb69a[_0xaf50('0x58')]['id']}})['then'](handleEntityNotFound(_0xcfd3c9,null))[_0xaf50('0x21')](function(_0x5def33){if(_0x5def33){_0x521709[_0xaf50('0x42')]=_[_0xaf50('0x44')](db['Disposition']['rawAttributes']);_0x521709[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x4eb69a[_0xaf50('0x43')]);_0x521709[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0x521709[_0xaf50('0x42')],_0x521709[_0xaf50('0x43')]);_0x5a755d[_0xaf50('0x47')]=_[_0xaf50('0x46')](_0x521709['model'],qs['fields'](_0x4eb69a[_0xaf50('0x43')][_0xaf50('0x48')]));_0x5a755d[_0xaf50('0x47')]=_0x5a755d[_0xaf50('0x47')]['length']?_0x5a755d[_0xaf50('0x47')]:_0x521709[_0xaf50('0x42')];if(!_0x4eb69a[_0xaf50('0x43')]['hasOwnProperty'](_0xaf50('0x4b'))){_0x5a755d[_0xaf50('0x2e')]=qs[_0xaf50('0x2e')](_0x4eb69a[_0xaf50('0x43')]['limit']);_0x5a755d[_0xaf50('0x2f')]=qs[_0xaf50('0x2f')](_0x4eb69a[_0xaf50('0x43')][_0xaf50('0x2f')]);}_0x5a755d[_0xaf50('0x4c')]=qs[_0xaf50('0x69')](_0x4eb69a[_0xaf50('0x43')][_0xaf50('0x69')]);_0x5a755d[_0xaf50('0x4f')]=qs[_0xaf50('0x45')](_[_0xaf50('0x4d')](_0x4eb69a[_0xaf50('0x43')],_0x521709[_0xaf50('0x45')]));_0x5a755d[_0xaf50('0x4f')]['WhatsappAccountId']=_0x5def33['id'];if(_0x4eb69a[_0xaf50('0x43')][_0xaf50('0x4e')]){_0x5a755d[_0xaf50('0x4f')]=_[_0xaf50('0x50')](_0x5a755d['where'],{'$or':_['map'](_0x5a755d[_0xaf50('0x47')],function(_0x49578e){var _0x3183f1={};_0x3183f1[_0x49578e]={'$like':'%'+_0x4eb69a[_0xaf50('0x43')]['filter']+'%'};return _0x3183f1;})});}_0x5a755d=_[_0xaf50('0x50')]({},_0x5a755d,_0x4eb69a[_0xaf50('0x6a')]);return db['Disposition']['count']({'where':_0x5a755d[_0xaf50('0x4f')]})[_0xaf50('0x21')](function(_0x27b43a){_0x55afdf[_0xaf50('0x51')]=_0x27b43a;if(_0x4eb69a[_0xaf50('0x43')]['includeAll']){_0x5a755d['include']=[{'all':!![]}];}return db['Disposition'][_0xaf50('0x54')](_0x5a755d);})[_0xaf50('0x21')](function(_0x30ebc4){_0x55afdf['rows']=_0x30ebc4;return _0x55afdf;});}})[_0xaf50('0x21')](respondWithFilteredResult(_0xcfd3c9,_0x5a755d))['catch'](handleError(_0xcfd3c9,null));};exports['removeDispositions']=function(_0x1c8aa9,_0x3fcaa7,_0x49e212){return db[_0xaf50('0x3e')][_0xaf50('0x59')]({'where':{'id':_0x1c8aa9[_0xaf50('0x58')]['id']}})[_0xaf50('0x21')](handleEntityNotFound(_0x3fcaa7,null))[_0xaf50('0x21')](function(_0x57d551){if(_0x57d551){return _0x57d551[_0xaf50('0x6b')](_0x1c8aa9[_0xaf50('0x43')][_0xaf50('0x6c')]);}})[_0xaf50('0x21')](respondWithStatusCode(_0x3fcaa7,null))[_0xaf50('0x56')](handleError(_0x3fcaa7,null));};exports['addAnswer']=function(_0x2c433a,_0x324b9c,_0x20df45){if(_0x2c433a[_0xaf50('0x5b')]['id']){delete _0x2c433a[_0xaf50('0x5b')]['id'];}return db[_0xaf50('0x3e')]['find']({'where':{'id':_0x2c433a[_0xaf50('0x58')]['id']}})['then'](handleEntityNotFound(_0x324b9c,null))['then'](function(_0x152b5b){if(_0x152b5b){_0x2c433a[_0xaf50('0x5b')]['WhatsappAccountId']=_0x152b5b['id'];return db[_0xaf50('0x6d')][_0xaf50('0x5a')](_0x2c433a[_0xaf50('0x5b')]);}})[_0xaf50('0x21')](respondWithResult(_0x324b9c,null))[_0xaf50('0x56')](handleError(_0x324b9c,null));};exports[_0xaf50('0x6e')]=function(_0x2d07c2,_0x5c4d81,_0x33a786){var _0x17df88={'raw':![],'where':{}};var _0x12411c={};var _0x43f297={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x2d07c2[_0xaf50('0x58')]['id']}})[_0xaf50('0x21')](handleEntityNotFound(_0x5c4d81,null))[_0xaf50('0x21')](function(_0x3e4968){if(_0x3e4968){_0x12411c[_0xaf50('0x42')]=_[_0xaf50('0x44')](db[_0xaf50('0x6d')][_0xaf50('0x6f')]);_0x12411c[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x2d07c2[_0xaf50('0x43')]);_0x12411c[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0x12411c[_0xaf50('0x42')],_0x12411c[_0xaf50('0x43')]);_0x17df88[_0xaf50('0x47')]=_['intersection'](_0x12411c['model'],qs['fields'](_0x2d07c2[_0xaf50('0x43')][_0xaf50('0x48')]));_0x17df88[_0xaf50('0x47')]=_0x17df88['attributes'][_0xaf50('0x49')]?_0x17df88['attributes']:_0x12411c['model'];if(!_0x2d07c2['query'][_0xaf50('0x4a')](_0xaf50('0x4b'))){_0x17df88[_0xaf50('0x2e')]=qs['limit'](_0x2d07c2[_0xaf50('0x43')][_0xaf50('0x2e')]);_0x17df88[_0xaf50('0x2f')]=qs[_0xaf50('0x2f')](_0x2d07c2[_0xaf50('0x43')][_0xaf50('0x2f')]);}_0x17df88[_0xaf50('0x4c')]=qs[_0xaf50('0x69')](_0x2d07c2[_0xaf50('0x43')]['sort']);_0x17df88[_0xaf50('0x4f')]=qs[_0xaf50('0x45')](_[_0xaf50('0x4d')](_0x2d07c2[_0xaf50('0x43')],_0x12411c[_0xaf50('0x45')]));_0x17df88[_0xaf50('0x4f')][_0xaf50('0x65')]=_0x3e4968['id'];if(_0x2d07c2[_0xaf50('0x43')][_0xaf50('0x4e')]){_0x17df88[_0xaf50('0x4f')]=_[_0xaf50('0x50')](_0x17df88['where'],{'$or':_['map'](_0x17df88[_0xaf50('0x47')],function(_0x31496f){var _0x3ff1aa={};_0x3ff1aa[_0x31496f]={'$like':'%'+_0x2d07c2[_0xaf50('0x43')][_0xaf50('0x4e')]+'%'};return _0x3ff1aa;})});}_0x17df88=_[_0xaf50('0x50')]({},_0x17df88,_0x2d07c2[_0xaf50('0x6a')]);return db['CannedAnswer'][_0xaf50('0x51')]({'where':_0x17df88['where']})[_0xaf50('0x21')](function(_0x55b306){_0x43f297['count']=_0x55b306;if(_0x2d07c2[_0xaf50('0x43')]['includeAll']){_0x17df88['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xaf50('0x54')](_0x17df88);})['then'](function(_0x4733ae){_0x43f297[_0xaf50('0x55')]=_0x4733ae;return _0x43f297;});}})['then'](respondWithFilteredResult(_0x5c4d81,_0x17df88))[_0xaf50('0x56')](handleError(_0x5c4d81,null));};exports[_0xaf50('0x70')]=function(_0x5bbcc3,_0x1096d2,_0x4fe722){return db[_0xaf50('0x3e')][_0xaf50('0x59')]({'where':{'id':_0x5bbcc3['params']['id']}})[_0xaf50('0x21')](handleEntityNotFound(_0x1096d2,null))[_0xaf50('0x21')](function(_0x412513){if(_0x412513){return _0x412513[_0xaf50('0x70')](_0x5bbcc3['query']['ids']);}})[_0xaf50('0x21')](respondWithStatusCode(_0x1096d2,null))[_0xaf50('0x56')](handleError(_0x1096d2,null));};exports[_0xaf50('0x71')]=function(_0x332d0e,_0x4998be,_0xcbe6b9){return db[_0xaf50('0x3e')]['find']({'where':{'id':_0x332d0e['params']['id']}})['then'](handleEntityNotFound(_0x4998be,null))[_0xaf50('0x21')](function(_0x4660a5){if(_0x4660a5){return _0x4660a5[_0xaf50('0x71')](_0x332d0e[_0xaf50('0x5b')][_0xaf50('0x6c')],_['omit'](_0x332d0e[_0xaf50('0x5b')],[_0xaf50('0x6c'),'id'])||{})[_0xaf50('0x72')](function(_0x1e9a46){for(var _0x2d825d=0x0;_0x2d825d<_0x332d0e[_0xaf50('0x5b')][_0xaf50('0x6c')][_0xaf50('0x49')];_0x2d825d+=0x1){socket[_0xaf50('0x73')](_0xaf50('0x74'),{'UserId':Number(_0x332d0e[_0xaf50('0x5b')]['ids'][_0x2d825d]),'WhatsappAccountId':Number(_0x332d0e[_0xaf50('0x58')]['id'])});}return _0x1e9a46;});}})['then'](respondWithResult(_0x4998be,null))['catch'](handleError(_0x4998be,null));};exports[_0xaf50('0x75')]=function(_0x304d30,_0x483f2b,_0x20251f){return db['WhatsappAccount'][_0xaf50('0x59')]({'where':{'id':_0x304d30[_0xaf50('0x58')]['id']}})[_0xaf50('0x21')](handleEntityNotFound(_0x483f2b,null))['then'](function(_0x1b7906){if(_0x1b7906){return _0x1b7906[_0xaf50('0x75')](_0x304d30[_0xaf50('0x43')][_0xaf50('0x6c')])[_0xaf50('0x21')](function(){if(_['isArray'](_0x304d30[_0xaf50('0x43')][_0xaf50('0x6c')])){for(var _0x1ab127=0x0;_0x1ab127<_0x304d30[_0xaf50('0x43')]['ids'][_0xaf50('0x49')];_0x1ab127+=0x1){socket[_0xaf50('0x73')](_0xaf50('0x76'),{'UserId':Number(_0x304d30[_0xaf50('0x43')][_0xaf50('0x6c')][_0x1ab127]),'WhatsappAccountId':Number(_0x304d30[_0xaf50('0x58')]['id'])});}}else{socket[_0xaf50('0x73')](_0xaf50('0x76'),{'UserId':Number(_0x304d30[_0xaf50('0x43')][_0xaf50('0x6c')]),'WhatsappAccountId':Number(_0x304d30[_0xaf50('0x58')]['id'])});}});}})[_0xaf50('0x21')](respondWithStatusCode(_0x483f2b,null))[_0xaf50('0x56')](handleError(_0x483f2b,null));};exports['getAgents']=function(_0x57efac,_0x5c6706,_0x3b95da){var _0x4c396e={};var _0x335e4b={};var _0x4cb278;var _0x3362f7;return db[_0xaf50('0x3e')][_0xaf50('0x68')]({'where':{'id':_0x57efac['params']['id']}})['then'](handleEntityNotFound(_0x5c6706,null))['then'](function(_0x27b14d){if(_0x27b14d){_0x4cb278=_0x27b14d;_0x335e4b['model']=_['keys'](db[_0xaf50('0x77')]['rawAttributes']);_0x335e4b[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x57efac[_0xaf50('0x43')]);_0x335e4b[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0x335e4b['model'],_0x335e4b[_0xaf50('0x43')]);_0x4c396e['attributes']=_[_0xaf50('0x46')](_0x335e4b[_0xaf50('0x42')],qs['fields'](_0x57efac[_0xaf50('0x43')]['fields']));_0x4c396e[_0xaf50('0x47')]=_0x4c396e['attributes'][_0xaf50('0x49')]?_0x4c396e[_0xaf50('0x47')]:_0x335e4b[_0xaf50('0x42')];_0x4c396e[_0xaf50('0x4c')]=qs['sort'](_0x57efac[_0xaf50('0x43')][_0xaf50('0x69')]);_0x4c396e[_0xaf50('0x4f')]=qs[_0xaf50('0x45')](_[_0xaf50('0x4d')](_0x57efac['query'],_0x335e4b[_0xaf50('0x45')]));if(_0x57efac[_0xaf50('0x43')]['filter']){_0x4c396e['where']=_[_0xaf50('0x50')](_0x4c396e[_0xaf50('0x4f')],{'$or':_[_0xaf50('0x78')](_0x4c396e[_0xaf50('0x47')],function(_0x473613){var _0x49b55c={};_0x49b55c[_0x473613]={'$like':'%'+_0x57efac[_0xaf50('0x43')][_0xaf50('0x4e')]+'%'};return _0x49b55c;})});}_0x4c396e=_[_0xaf50('0x50')]({},_0x4c396e,_0x57efac[_0xaf50('0x6a')]);return _0x4cb278[_0xaf50('0x79')](_0x4c396e);}})['then'](function(_0x2ac4c6){if(_0x2ac4c6){_0x3362f7=_0x2ac4c6[_0xaf50('0x49')];if(!_0x57efac[_0xaf50('0x43')][_0xaf50('0x4a')](_0xaf50('0x4b'))){_0x4c396e[_0xaf50('0x2e')]=qs[_0xaf50('0x2e')](_0x57efac[_0xaf50('0x43')][_0xaf50('0x2e')]);_0x4c396e[_0xaf50('0x2f')]=qs[_0xaf50('0x2f')](_0x57efac[_0xaf50('0x43')][_0xaf50('0x2f')]);}return _0x4cb278[_0xaf50('0x79')](_0x4c396e);}})['then'](function(_0x204263){if(_0x204263){return _0x204263?{'count':_0x3362f7,'rows':_0x204263}:null;}})[_0xaf50('0x21')](respondWithResult(_0x5c6706,null))['catch'](handleError(_0x5c6706,null));};exports['addApplications']=function(_0x4c910f,_0x59a19b){var _0x567f9=_0x4c910f['params']['id'];var _0x48a184=_0x4c910f[_0xaf50('0x5b')];var _0x1e6c57=0xc8;var _0x22b2c3=null;return db[_0xaf50('0x7a')]['transaction']({'isolationLevel':db[_0xaf50('0x7a')][_0xaf50('0x7b')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x379dae){return db[_0xaf50('0x3e')][_0xaf50('0x68')]({'where':{'id':_0x567f9},'transaction':_0x379dae})[_0xaf50('0x21')](function(_0x1e215f){if(_0x1e215f){return db[_0xaf50('0x7c')][_0xaf50('0x36')]({'where':{'WhatsappAccountId':_0x567f9},'transaction':_0x379dae})[_0xaf50('0x21')](function(){var _0x2d5d82=_['map'](_0x48a184,function(_0xc744ab){_0xc744ab[_0xaf50('0x65')]=_0x567f9;return _0xc744ab;});return db[_0xaf50('0x7c')][_0xaf50('0x7d')](_0x2d5d82,{'transaction':_0x379dae});});}else{_0x1e6c57=0x194;_0x22b2c3=[];}});})['then'](function(){if(_0x1e6c57!==0x194){return db[_0xaf50('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x567f9},'order':_0xaf50('0x7e')})[_0xaf50('0x21')](function(_0x246dbe){_0x22b2c3=_0x246dbe;});}})['catch'](function(_0x13e615){_0x1e6c57=0x1f4;logger['error'](_0x13e615[_0xaf50('0x3a')]);if(_0x13e615[_0xaf50('0x3b')]){delete _0x13e615[_0xaf50('0x3b')];}_0x22b2c3=_0x13e615;})[_0xaf50('0x7f')](function(){if(_0x22b2c3===null){_0x59a19b['sendStatus'](_0x1e6c57);}else{if(_0x1e6c57===0x1f4){_0x59a19b[_0xaf50('0x2d')](_0x1e6c57)[_0xaf50('0x80')](_0x22b2c3);}else{_0x59a19b['status'](_0x1e6c57)[_0xaf50('0x32')](_0x22b2c3);}}});};exports[_0xaf50('0x81')]=function(_0x366689,_0x20083f,_0x556d45){var _0x284ee1={};var _0x470a0d={};var _0x3a5b27;var _0x71c481;return db[_0xaf50('0x3e')][_0xaf50('0x68')]({'where':{'id':_0x366689[_0xaf50('0x58')]['id']}})['then'](handleEntityNotFound(_0x20083f,null))['then'](function(_0x2b5234){if(_0x2b5234){_0x3a5b27=_0x2b5234;_0x470a0d[_0xaf50('0x42')]=_[_0xaf50('0x44')](db[_0xaf50('0x7c')][_0xaf50('0x6f')]);_0x470a0d[_0xaf50('0x43')]=_[_0xaf50('0x44')](_0x366689[_0xaf50('0x43')]);_0x470a0d[_0xaf50('0x45')]=_[_0xaf50('0x46')](_0x470a0d[_0xaf50('0x42')],_0x470a0d['query']);_0x284ee1[_0xaf50('0x47')]=_[_0xaf50('0x46')](_0x470a0d[_0xaf50('0x42')],qs['fields'](_0x366689['query'][_0xaf50('0x48')]));_0x284ee1['attributes']=_0x284ee1[_0xaf50('0x47')][_0xaf50('0x49')]?_0x284ee1[_0xaf50('0x47')]:_0x470a0d[_0xaf50('0x42')];_0x284ee1[_0xaf50('0x4c')]=qs['sort'](_0x366689['query'][_0xaf50('0x69')]);_0x284ee1[_0xaf50('0x4f')]=qs[_0xaf50('0x45')](_[_0xaf50('0x4d')](_0x366689[_0xaf50('0x43')],_0x470a0d['filters']));if(_0x366689[_0xaf50('0x43')][_0xaf50('0x4e')]){_0x284ee1[_0xaf50('0x4f')]=_[_0xaf50('0x50')](_0x284ee1[_0xaf50('0x4f')],{'$or':_[_0xaf50('0x78')](_0x284ee1[_0xaf50('0x47')],function(_0x3fb1f9){var _0x426e19={};_0x426e19[_0x3fb1f9]={'$like':'%'+_0x366689['query'][_0xaf50('0x4e')]+'%'};return _0x426e19;})});}_0x284ee1=_[_0xaf50('0x50')]({},_0x284ee1,_0x366689[_0xaf50('0x6a')]);return _0x3a5b27[_0xaf50('0x81')](_0x284ee1);}})[_0xaf50('0x21')](function(_0x307740){if(_0x307740){_0x71c481=_0x307740['length'];if(!_0x366689[_0xaf50('0x43')][_0xaf50('0x4a')](_0xaf50('0x4b'))){_0x284ee1['limit']=qs[_0xaf50('0x2e')](_0x366689['query'][_0xaf50('0x2e')]);_0x284ee1[_0xaf50('0x2f')]=qs['offset'](_0x366689['query']['offset']);}return _0x3a5b27[_0xaf50('0x81')](_0x284ee1);}})[_0xaf50('0x21')](function(_0x3f312d){if(_0x3f312d){return _0x3f312d?{'count':_0x71c481,'rows':_0x3f312d}:null;}})[_0xaf50('0x21')](respondWithResult(_0x20083f,null))['catch'](handleError(_0x20083f,null));};exports[_0xaf50('0x82')]=function(_0x2ccc2f,_0x39a9c3,_0x5676bb){var _0x5599d6={'channel':_0xaf50('0x83')};var _0x270f3c=[];var _0x34822b=[];var _0x459f2a={};return db[_0xaf50('0x3e')][_0xaf50('0x59')]({'where':{'id':_0x2ccc2f[_0xaf50('0x58')]['id']},'include':[{'model':db[_0xaf50('0x7c')],'as':_0xaf50('0x84')}]})[_0xaf50('0x21')](handleEntityNotFound(_0x39a9c3,null))['then'](function(_0x21a95e){_0x5599d6['account']=_0x21a95e;if(_0x5599d6[_0xaf50('0x85')]&&_0x5599d6[_0xaf50('0x85')][_0xaf50('0x40')]===_0xaf50('0x86')&&_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x87')]){if(_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x87')][_0xaf50('0x49')]===0x0)return;if(_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x87')][0x0][_0xaf50('0x88')]!==_0xaf50('0x89'))return;return db[_0xaf50('0x8a')][_0xaf50('0x35')]({'read':!![],'readAt':_0x2ccc2f['body'][_0xaf50('0x87')][0x0][_0xaf50('0x8b')]},{'where':{'messageId':_0x2ccc2f['body'][_0xaf50('0x87')][0x0][_0xaf50('0x8c')]},'individualHooks':!![]})[_0xaf50('0x21')](function(_0x3e7f85){return _0x39a9c3['status'](0xc8)[_0xaf50('0x32')](_0x3e7f85);});}_0x5599d6[_0xaf50('0x8d')]=_[_0xaf50('0x8e')](_0x21a95e['Applications'],[_0xaf50('0x7e')],[_0xaf50('0x8f')]);if(_0x5599d6['account'][_0xaf50('0x84')]){delete _0x5599d6[_0xaf50('0x85')][_0xaf50('0x84')];}return db[_0xaf50('0x90')]['describe']()['then'](function(_0x3bc338){if(!_0x3bc338){throw new db[(_0xaf50('0x91'))]['ValidationError'](_0xaf50('0x92'));}_0x270f3c=_['difference'](_['keys'](_0x3bc338),['createdAt',_0xaf50('0x93')]);_0x34822b=_[_0xaf50('0x94')](_[_0xaf50('0x44')](_0x3bc338),[_0xaf50('0x95'),_0xaf50('0x93'),_0xaf50('0x96'),'ListId']);_0x5599d6['body']={'mapKey':_0xaf50('0x97')};if(_0x5599d6['account']&&_0x5599d6[_0xaf50('0x85')][_0xaf50('0x40')]==='twilio'){_0x5599d6[_0xaf50('0x5b')]['from']=_0x2ccc2f['body'][_0xaf50('0x98')]['replace']('whatsapp:','');_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x5b')]=_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x99')];_0x5599d6['body'][_0xaf50('0x9a')]=_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x9b')];}if(_0x5599d6[_0xaf50('0x85')]&&_0x5599d6[_0xaf50('0x85')]['type']===_0xaf50('0x86')){_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x9c')]=_0x2ccc2f['body'][_0xaf50('0x9d')][0x0][_0xaf50('0x9c')];_0x5599d6[_0xaf50('0x5b')]['body']=_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x9d')][0x0][_0xaf50('0x29')][_0xaf50('0x5b')];_0x5599d6[_0xaf50('0x5b')]['messageId']=_0x2ccc2f[_0xaf50('0x5b')][_0xaf50('0x9d')][0x0][_0xaf50('0x8c')];}if(_0x5599d6[_0xaf50('0x5b')]['id']){delete _0x5599d6['body']['id'];}if(_[_0xaf50('0x9e')](_0x5599d6[_0xaf50('0x5b')]['from'])){throw new db['Sequelize'][(_0xaf50('0x9f'))](_0xaf50('0xa0'));}if(_[_0xaf50('0x9e')](_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x5b')])||_0x5599d6['body'][_0xaf50('0x5b')]===''){throw new db[(_0xaf50('0x91'))][(_0xaf50('0x9f'))](_0xaf50('0xa1'));}if(_[_0xaf50('0x9e')](_0x5599d6['body']['mapKey'])){throw new db['Sequelize'][(_0xaf50('0x9f'))](_0xaf50('0xa2')+_0x34822b);}if(!_[_0xaf50('0xa3')](_0x34822b,_0x5599d6['body'][_0xaf50('0xa4')])){throw new db[(_0xaf50('0x91'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34822b);}_0x459f2a[_0x5599d6[_0xaf50('0x5b')]['mapKey']]=_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x9c')];return db[_0xaf50('0xa5')][_0xaf50('0x59')]({'where':{'id':_0x5599d6[_0xaf50('0x85')][_0xaf50('0xa6')]},'include':[{'model':db[_0xaf50('0x90')],'as':'Contacts','where':_0x459f2a,'limit':0x1,'order':[[_0xaf50('0x93'),_0xaf50('0xa7')]]}]});})[_0xaf50('0x21')](handleEntityNotFound(_0x39a9c3,null))[_0xaf50('0x21')](function(_0x345abe){if(_0x345abe){_0x5599d6[_0xaf50('0xa8')]=_[_0xaf50('0xa9')](_0x345abe,[_0xaf50('0xaa')]);if(_0x345abe[_0xaf50('0xaa')]['length']){return _0x345abe[_0xaf50('0xaa')][0x0];}var _0x15b2ff=_[_0xaf50('0x1b')](_0x5599d6[_0xaf50('0x5b')],{'firstName':_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x9c')],'ListId':_0x345abe['id']});_0x15b2ff[_0x5599d6['body'][_0xaf50('0xa4')]]=_0x5599d6['body'][_0xaf50('0x9c')];return db[_0xaf50('0x90')][_0xaf50('0x5a')](_0x15b2ff,{'fields':_0x270f3c,'raw':!![]});}})['then'](handleEntityNotFound(_0x39a9c3,null))['then'](function(_0x3c40ff){if(_0x3c40ff){_0x5599d6[_0xaf50('0xab')]=_0x3c40ff;var _0x56eac0={'ContactId':_0x3c40ff['id'],'phone':_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x9c')],'WhatsappAccountId':_0x2ccc2f[_0xaf50('0x58')]['id']};var _0x2ff667={'ContactId':_0x3c40ff['id'],'WhatsappAccountId':_0x2ccc2f[_0xaf50('0x58')]['id'],'closed':![]};return db[_0xaf50('0xac')][_0xaf50('0x59')]({'where':_0x2ff667})[_0xaf50('0x21')](function(_0x286dd1){if(_0x286dd1){return[_0x286dd1,![]];}return db[_0xaf50('0xac')][_0xaf50('0x5a')](_0x56eac0)[_0xaf50('0x21')](function(_0x412b9f){return[_0x412b9f,!![]];});});}})[_0xaf50('0x72')](function(_0x530bc5,_0x6bd320){_0x5599d6['interaction']=_0x530bc5[_0xaf50('0x37')]({'plain':!![]});_0x5599d6[_0xaf50('0xad')][_0xaf50('0xae')]=![];if(_0x6bd320){if(_0x5599d6[_0xaf50('0x85')][_0xaf50('0xaf')]){_0x5599d6[_0xaf50('0x8d')]['push']({'id':0x0,'priority':_0x5599d6[_0xaf50('0x8d')]['length']+0x1,'app':'close','appdata':_0xaf50('0xb0'),'interval':'*,*,*,*'});}_0x5599d6[_0xaf50('0xad')]['created']=!![];}return db[_0xaf50('0x8a')][_0xaf50('0x5a')]({'phone':_0x5599d6['body']['from'],'messageId':_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x9a')],'body':_0x5599d6[_0xaf50('0x5b')][_0xaf50('0x5b')],'WhatsappAccountId':_0x2ccc2f[_0xaf50('0x58')]['id'],'WhatsappInteractionId':_0x530bc5['id'],'direction':'in','ContactId':_0x530bc5[_0xaf50('0xb1')],'AttachmentId':_0x5599d6[_0xaf50('0x5b')][_0xaf50('0xb2')]});})[_0xaf50('0x21')](function(_0x279603){_0x5599d6[_0xaf50('0x29')]=_0x279603;if(_0x5599d6[_0xaf50('0xad')][_0xaf50('0xb3')]){return db['User'][_0xaf50('0x59')]({'attributes':['id','name'],'where':{'id':_0x5599d6[_0xaf50('0xad')][_0xaf50('0xb3')]}})[_0xaf50('0x21')](function(_0x488787){if(_0x488787){_0x5599d6[_0xaf50('0x8d')][_0xaf50('0xb4')]({'id':0x0,'priority':0x0,'app':_0xaf50('0xb5'),'appdata':_0x488787[_0xaf50('0x3b')]+','+(_0x5599d6[_0xaf50('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0xaf50('0xb6')});}return respondWithRpcPromise(_0xaf50('0xb7'),_0xaf50('0xb8'),_0x5599d6);});}return respondWithRpcPromise(_0xaf50('0xb7'),_0xaf50('0xb8'),_0x5599d6);})[_0xaf50('0x21')](function(_0x1cf915){if(_0x1cf915){var _0x4fe99c=0xc8;var _0x119c82=_0xaf50('0xb9');logger[_0xaf50('0x22')](_0xaf50('0xba'),_0x119c82,_0x4fe99c,_0xaf50('0xbb'));logger[_0xaf50('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x119c82,_0x4fe99c,_0xaf50('0xbb'),JSON[_0xaf50('0x26')](_0x1cf915));if(_0x5599d6[_0xaf50('0x85')][_0xaf50('0x40')]===_0xaf50('0xbc')){return _0x39a9c3[_0xaf50('0x2d')](_0x4fe99c)[_0xaf50('0x30')](_0xaf50('0xbd'),_0xaf50('0xbe'))[_0xaf50('0x80')](_0xaf50('0xbf'));}else{return _0x39a9c3['status'](_0x4fe99c)['json'](_0x1cf915);}}});})[_0xaf50('0x56')](handleError(_0x39a9c3,null));};exports[_0xaf50('0x80')]=function(_0x58e0a6,_0x449ebe,_0x545a31){var _0x41fb5c,_0x597e16,_0x12dee3;if(_[_0xaf50('0x9e')](_0x58e0a6[_0xaf50('0x5b')][_0xaf50('0x5b')])||_0x58e0a6['body'][_0xaf50('0x5b')]===''){throw new db['Sequelize'][(_0xaf50('0x9f'))](_0xaf50('0xa1'));}if(_['isNil'](_0x58e0a6['body']['to'])){throw new db[(_0xaf50('0x91'))]['ValidationError'](_0xaf50('0xc0'));}_0x41fb5c=_0x58e0a6[_0xaf50('0x5b')]['to'];return db['WhatsappAccount'][_0xaf50('0x59')]({'where':{'id':_0x58e0a6['params']['id']},'include':[{'model':db['CmList'],'as':_0xaf50('0xc1'),'include':[{'model':db['CmContact'],'as':_0xaf50('0xaa'),'where':{'mobile':_0x41fb5c},'limit':0x1,'order':[[_0xaf50('0x93'),_0xaf50('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x449ebe,null))[_0xaf50('0x21')](function(_0x1b3c0a){if(_0x1b3c0a&&_0x1b3c0a[_0xaf50('0xc1')]){_0x597e16=_0x1b3c0a[_0xaf50('0x37')]({'plain':!![]});if(_0x597e16[_0xaf50('0xc1')]&&_0x597e16[_0xaf50('0xc1')][_0xaf50('0xaa')][_0xaf50('0x49')]){return _0x597e16[_0xaf50('0xc1')][_0xaf50('0xaa')][0x0];}return db[_0xaf50('0x90')]['create'](_[_0xaf50('0x1b')](_0x58e0a6[_0xaf50('0x5b')],{'firstName':_0x41fb5c,'mobile':_0x41fb5c,'phone':_0x41fb5c,'ListId':_0x597e16[_0xaf50('0xa6')]}));}})['then'](handleEntityNotFound(_0x449ebe,null))['then'](function(_0x1350a9){if(_0x1350a9){_0x12dee3=_0x1350a9;return db[_0xaf50('0xac')][_0xaf50('0x59')]({'where':{'ContactId':_0x12dee3['id'],'closed':![],'WhatsappAccountId':_0x597e16['id']}})[_0xaf50('0x21')](function(_0x3201fd){if(_0x3201fd){return[_0x3201fd,![]];}return db[_0xaf50('0xac')][_0xaf50('0x5a')]({'UserId':_0x58e0a6[_0xaf50('0x5d')]['id'],'ContactId':_0x12dee3['id'],'WhatsappAccountId':_0x597e16['id'],'phone':_0x41fb5c,'firstMsgDirection':_0xaf50('0xc2'),'Messages':[_[_0xaf50('0x50')](_0x58e0a6['body'],{'read':![],'body':_0x58e0a6['body']['body'],'phone':_0x41fb5c,'WhatsappAccountId':_0x597e16['id'],'UserId':_0x58e0a6['user']['id'],'ContactId':_0x12dee3['id']})]},{'include':[{'model':db[_0xaf50('0x8a')],'as':_0xaf50('0xc3')}]})[_0xaf50('0x21')](function(_0x33ba68){return[_0x33ba68,!![]];});});}})[_0xaf50('0x72')](function(_0x293089,_0x4ae8ef){if(_0x4ae8ef){return _0x293089;}return db[_0xaf50('0x8a')][_0xaf50('0x5a')](_[_0xaf50('0x50')](_0x58e0a6['body'],{'read':![],'body':_0x58e0a6['body'][_0xaf50('0x5b')],'phone':_0x41fb5c,'WhatsappAccountId':_0x597e16['id'],'WhatsappInteractionId':_0x293089['id'],'UserId':_0x58e0a6[_0xaf50('0x5d')]['id'],'ContactId':_0x12dee3['id']}))['then'](function(_0x4c4582){_0x293089['dataValues'][_0xaf50('0xc3')]=[];_0x293089[_0xaf50('0xc4')][_0xaf50('0xc3')][_0xaf50('0xc5')](_0x4c4582[_0xaf50('0xc4')]);return _0x293089;});})[_0xaf50('0x21')](respondWithResult(_0x449ebe,null))[_0xaf50('0x56')](handleError(_0x449ebe,null));}; \ No newline at end of file +var _0x8a30=['CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','mobile','twilio','from','From','replace','whatsapp:','notifications','messageId','isNil','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','updatedAt','DESC','list','defaults','contact','WhatsappInteraction','interaction','autoclose','applications','push','close','unmanaged','created','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','WhatsappAccounts','UserProfileResource','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','WhatsappAccountId','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','Applications'];(function(_0x56127f,_0x1a4c93){var _0x40f108=function(_0x206491){while(--_0x206491){_0x56127f['push'](_0x56127f['shift']());}};_0x40f108(++_0x1a4c93);}(_0x8a30,0xfc));var _0x08a3=function(_0x117853,_0x9b785a){_0x117853=_0x117853-0x0;var _0x3c1223=_0x8a30[_0x117853];return _0x3c1223;};'use strict';var emlformat=require(_0x08a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08a3('0x1'));var jsonpatch=require(_0x08a3('0x2'));var rp=require(_0x08a3('0x3'));var moment=require('moment');var BPromise=require(_0x08a3('0x4'));var Mustache=require(_0x08a3('0x5'));var util=require('util');var path=require(_0x08a3('0x6'));var sox=require(_0x08a3('0x7'));var csv=require('to-csv');var ejs=require(_0x08a3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08a3('0x9'));var squel=require(_0x08a3('0xa'));var crypto=require('crypto');var jsforce=require(_0x08a3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x08a3('0xc'));var querystring=require(_0x08a3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x08a3('0xe'));var qs=require(_0x08a3('0xf'));var as=require(_0x08a3('0x10'));var hardwareService=require(_0x08a3('0x11'));var logger=require('../../config/logger')(_0x08a3('0x12'));var utils=require(_0x08a3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x08a3('0x14'));var db=require(_0x08a3('0x15'))['db'];config[_0x08a3('0x16')]=_['defaults'](config['redis'],{'host':_0x08a3('0x17'),'port':0x18eb});var socket=require(_0x08a3('0x18'))(new Redis(config[_0x08a3('0x16')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x08a3('0x19'));var client=jayson[_0x08a3('0x1a')][_0x08a3('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xb4eb0c,_0x2674ef,_0x54b34a,_0x3f0a43){return new BPromise(function(_0x58a58c,_0x53deb9){var _0x4b1859=_0x3f0a43||client;return _0x4b1859[_0x08a3('0x1c')](_0xb4eb0c,_0x54b34a)['then'](function(_0x57db5a){logger[_0x08a3('0x1d')](_0x08a3('0x1e'),_0x2674ef,_0x08a3('0x1f'));logger[_0x08a3('0x20')](_0x08a3('0x21'),_0x2674ef,_0x08a3('0x1f'),JSON['stringify'](_0x57db5a));if(_0x57db5a[_0x08a3('0x22')]){if(_0x57db5a[_0x08a3('0x22')][_0x08a3('0x23')]===0x1f4){logger[_0x08a3('0x22')](_0x08a3('0x1e'),_0x2674ef,_0x57db5a[_0x08a3('0x22')][_0x08a3('0x24')]);return _0x53deb9(_0x57db5a[_0x08a3('0x22')][_0x08a3('0x24')]);}logger['error'](_0x08a3('0x1e'),_0x2674ef,_0x57db5a[_0x08a3('0x22')][_0x08a3('0x24')]);return _0x58a58c(_0x57db5a[_0x08a3('0x22')]['message']);}else{logger[_0x08a3('0x1d')](_0x08a3('0x1e'),_0x2674ef,'request\x20sent');_0x58a58c(_0x57db5a[_0x08a3('0x25')][_0x08a3('0x24')]);}})[_0x08a3('0x26')](function(_0x677047){logger[_0x08a3('0x22')](_0x08a3('0x1e'),_0x2674ef,_0x677047);_0x53deb9(_0x677047);});});}function respondWithStatusCode(_0x4cc292,_0xf5705c){_0xf5705c=_0xf5705c||0xcc;return function(_0x4f103d){if(_0x4f103d){return _0x4cc292[_0x08a3('0x27')](_0xf5705c);}return _0x4cc292[_0x08a3('0x28')](_0xf5705c)['end']();};}function respondWithResult(_0x58e2cf,_0x441ae6){_0x441ae6=_0x441ae6||0xc8;return function(_0x15c11b){if(_0x15c11b){return _0x58e2cf['status'](_0x441ae6)[_0x08a3('0x29')](_0x15c11b);}};}function respondWithFilteredResult(_0x512886,_0x446b27){return function(_0x537ebb){if(_0x537ebb){var _0x123db3=typeof _0x446b27[_0x08a3('0x2a')]===_0x08a3('0x2b')&&typeof _0x446b27[_0x08a3('0x2c')]===_0x08a3('0x2b');var _0xb9a137=_0x537ebb[_0x08a3('0x2d')];var _0x49c699=_0x123db3?0x0:_0x446b27[_0x08a3('0x2a')];var _0x16495f=_0x123db3?_0x537ebb[_0x08a3('0x2d')]:_0x446b27[_0x08a3('0x2a')]+_0x446b27[_0x08a3('0x2c')];var _0x13069c;if(_0x16495f>=_0xb9a137){_0x16495f=_0xb9a137;_0x13069c=0xc8;}else{_0x13069c=0xce;}_0x512886[_0x08a3('0x28')](_0x13069c);return _0x512886[_0x08a3('0x2e')](_0x08a3('0x2f'),_0x49c699+'-'+_0x16495f+'/'+_0xb9a137)[_0x08a3('0x29')](_0x537ebb);}return null;};}function patchUpdates(_0x2a3a90){return function(_0x55b38b){try{jsonpatch[_0x08a3('0x30')](_0x55b38b,_0x2a3a90,!![]);}catch(_0x207997){return BPromise[_0x08a3('0x31')](_0x207997);}return _0x55b38b[_0x08a3('0x32')]();};}function saveUpdates(_0x4670e3,_0x596b1e){return function(_0x1508e1){if(_0x1508e1){return _0x1508e1[_0x08a3('0x33')](_0x4670e3)[_0x08a3('0x34')](function(_0x3af779){return _0x3af779;});}return null;};}function removeEntity(_0xaeee4f,_0x534b18){return function(_0x39a29d){if(_0x39a29d){return _0x39a29d['destroy']()[_0x08a3('0x34')](function(){var _0x25f329=_0x39a29d['get']({'plain':!![]});var _0x45c91e=_0x08a3('0x35');return db[_0x08a3('0x36')][_0x08a3('0x37')]({'where':{'type':_0x45c91e,'resourceId':_0x25f329['id']}})[_0x08a3('0x34')](function(){return _0x39a29d;});})[_0x08a3('0x34')](function(){_0xaeee4f[_0x08a3('0x28')](0xcc)[_0x08a3('0x38')]();});}};}function handleEntityNotFound(_0x3035c3,_0x1e63a9){return function(_0x2e5376){if(!_0x2e5376){_0x3035c3['sendStatus'](0x194);}return _0x2e5376;};}function handleError(_0x577e33,_0x41e9a6){_0x41e9a6=_0x41e9a6||0x1f4;return function(_0x19d161){logger[_0x08a3('0x22')](_0x19d161['stack']);if(_0x19d161['name']){delete _0x19d161[_0x08a3('0x39')];}_0x577e33['status'](_0x41e9a6)[_0x08a3('0x3a')](_0x19d161);};}exports[_0x08a3('0x3b')]=function(_0x1b49db,_0x4e3a04){var _0x551a7b={'include':[{'model':db[_0x08a3('0x3c')],'as':_0x08a3('0x3d')}]},_0x2132a9={},_0x210f24={'count':0x0,'rows':[]};var _0x1cb4c7=_[_0x08a3('0x3e')](db[_0x08a3('0x3f')][_0x08a3('0x40')],function(_0x826df6){return{'name':_0x826df6[_0x08a3('0x41')],'type':_0x826df6[_0x08a3('0x42')][_0x08a3('0x43')]};});_0x2132a9[_0x08a3('0x44')]=_[_0x08a3('0x3e')](_0x1cb4c7,'name');_0x2132a9[_0x08a3('0x45')]=_['keys'](_0x1b49db[_0x08a3('0x45')]);_0x2132a9[_0x08a3('0x46')]=_['intersection'](_0x2132a9[_0x08a3('0x44')],_0x2132a9['query']);_0x551a7b[_0x08a3('0x47')]=_[_0x08a3('0x48')](_0x2132a9['model'],qs[_0x08a3('0x49')](_0x1b49db['query'][_0x08a3('0x49')]));_0x551a7b[_0x08a3('0x47')]=_0x551a7b['attributes'][_0x08a3('0x4a')]?_0x551a7b[_0x08a3('0x47')]:_0x2132a9[_0x08a3('0x44')];if(!_0x1b49db['query'][_0x08a3('0x4b')](_0x08a3('0x4c'))){_0x551a7b[_0x08a3('0x2c')]=qs['limit'](_0x1b49db['query'][_0x08a3('0x2c')]);_0x551a7b[_0x08a3('0x2a')]=qs[_0x08a3('0x2a')](_0x1b49db[_0x08a3('0x45')][_0x08a3('0x2a')]);}_0x551a7b[_0x08a3('0x4d')]=qs['sort'](_0x1b49db['query'][_0x08a3('0x4e')]);_0x551a7b[_0x08a3('0x4f')]=qs[_0x08a3('0x46')](_[_0x08a3('0x50')](_0x1b49db[_0x08a3('0x45')],_0x2132a9[_0x08a3('0x46')]),_0x1cb4c7);if(_0x1b49db[_0x08a3('0x45')][_0x08a3('0x51')]){_0x551a7b['where']=_[_0x08a3('0x52')](_0x551a7b[_0x08a3('0x4f')],{'$or':_[_0x08a3('0x3e')](_0x1cb4c7,function(_0x219439){if(_0x219439[_0x08a3('0x42')]!==_0x08a3('0x53')){var _0x32093b={};_0x32093b[_0x219439[_0x08a3('0x39')]]={'$like':'%'+_0x1b49db[_0x08a3('0x45')][_0x08a3('0x51')]+'%'};return _0x32093b;}})});}_0x551a7b=_['merge']({},_0x551a7b,_0x1b49db[_0x08a3('0x54')]);var _0x52008c={'where':_0x551a7b[_0x08a3('0x4f')]};return db[_0x08a3('0x3f')][_0x08a3('0x2d')](_0x52008c)[_0x08a3('0x34')](function(_0x1bb807){_0x210f24['count']=_0x1bb807;if(_0x1b49db[_0x08a3('0x45')]['includeAll']){_0x551a7b[_0x08a3('0x55')]=[{'all':!![]}];}return db[_0x08a3('0x3f')][_0x08a3('0x56')](_0x551a7b);})[_0x08a3('0x34')](function(_0x34bf84){_0x210f24[_0x08a3('0x57')]=_0x34bf84;return _0x210f24;})[_0x08a3('0x34')](respondWithFilteredResult(_0x4e3a04,_0x551a7b))[_0x08a3('0x26')](handleError(_0x4e3a04,null));};exports[_0x08a3('0x58')]=function(_0x3df643,_0x151efe){var _0x1b0fa9={'raw':![],'where':{'id':_0x3df643[_0x08a3('0x59')]['id']},'include':[{'model':db[_0x08a3('0x3c')],'as':_0x08a3('0x3d')}]},_0x5193d4={};_0x5193d4[_0x08a3('0x44')]=_['keys'](db[_0x08a3('0x3f')]['rawAttributes']);_0x5193d4[_0x08a3('0x45')]=_[_0x08a3('0x5a')](_0x3df643[_0x08a3('0x45')]);_0x5193d4[_0x08a3('0x46')]=_[_0x08a3('0x48')](_0x5193d4[_0x08a3('0x44')],_0x5193d4[_0x08a3('0x45')]);_0x1b0fa9[_0x08a3('0x47')]=_['intersection'](_0x5193d4['model'],qs[_0x08a3('0x49')](_0x3df643[_0x08a3('0x45')][_0x08a3('0x49')]));_0x1b0fa9[_0x08a3('0x47')]=_0x1b0fa9['attributes']['length']?_0x1b0fa9[_0x08a3('0x47')]:_0x5193d4['model'];if(_0x3df643[_0x08a3('0x45')][_0x08a3('0x5b')]){_0x1b0fa9[_0x08a3('0x55')]=[{'all':!![]}];}_0x1b0fa9=_[_0x08a3('0x52')]({},_0x1b0fa9,_0x3df643[_0x08a3('0x54')]);return db[_0x08a3('0x3f')]['find'](_0x1b0fa9)['then'](handleEntityNotFound(_0x151efe,null))[_0x08a3('0x34')](respondWithResult(_0x151efe,null))[_0x08a3('0x26')](handleError(_0x151efe,null));};exports['create']=function(_0x401c56,_0xf40b85){return db[_0x08a3('0x3f')][_0x08a3('0x5c')](_0x401c56[_0x08a3('0x5d')],{})[_0x08a3('0x34')](function(_0x45d514){var _0x13eb86=_0x401c56[_0x08a3('0x5e')][_0x08a3('0x5f')]({'plain':!![]});if(!_0x13eb86)throw new Error(_0x08a3('0x60'));if(_0x13eb86[_0x08a3('0x61')]==='user'){var _0x2304ba=_0x45d514[_0x08a3('0x5f')]({'plain':!![]});var _0x1b02b3=_0x08a3('0x35');return db[_0x08a3('0x62')][_0x08a3('0x63')]({'where':{'name':_0x1b02b3,'userProfileId':_0x13eb86[_0x08a3('0x64')]},'raw':!![]})['then'](function(_0x1d8724){if(_0x1d8724&&_0x1d8724[_0x08a3('0x65')]===0x0){return db[_0x08a3('0x36')]['create']({'name':_0x2304ba[_0x08a3('0x39')],'resourceId':_0x2304ba['id'],'type':_0x1d8724[_0x08a3('0x39')],'sectionId':_0x1d8724['id']},{})[_0x08a3('0x34')](function(){return _0x45d514;});}else{return _0x45d514;}})[_0x08a3('0x26')](function(_0x4e8e89){logger[_0x08a3('0x22')](_0x08a3('0x66'),_0x4e8e89);throw _0x4e8e89;});}return _0x45d514;})[_0x08a3('0x34')](respondWithResult(_0xf40b85,0xc9))[_0x08a3('0x26')](handleError(_0xf40b85,null));};exports[_0x08a3('0x33')]=function(_0x4d1d42,_0x1ec0c7){if(_0x4d1d42[_0x08a3('0x5d')]['id']){delete _0x4d1d42[_0x08a3('0x5d')]['id'];}return db[_0x08a3('0x3f')]['find']({'where':{'id':_0x4d1d42['params']['id']},'include':[{'model':db[_0x08a3('0x3c')],'as':_0x08a3('0x3d')}]})[_0x08a3('0x34')](handleEntityNotFound(_0x1ec0c7,null))[_0x08a3('0x34')](saveUpdates(_0x4d1d42[_0x08a3('0x5d')],null))[_0x08a3('0x34')](respondWithResult(_0x1ec0c7,null))[_0x08a3('0x26')](handleError(_0x1ec0c7,null));};exports['destroy']=function(_0x8eb26f,_0x1170ef){return db[_0x08a3('0x3f')]['find']({'where':{'id':_0x8eb26f[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x1170ef,null))['then'](removeEntity(_0x1170ef,null))[_0x08a3('0x26')](handleError(_0x1170ef,null));};exports[_0x08a3('0x67')]=function(_0x2dc996,_0x1e7f06){return db[_0x08a3('0x3f')]['describe']()[_0x08a3('0x34')](respondWithResult(_0x1e7f06,null))[_0x08a3('0x26')](handleError(_0x1e7f06,null));};exports[_0x08a3('0x68')]=function(_0x4073df,_0x20fd15,_0x6d0080){if(_0x4073df[_0x08a3('0x5d')]['id']){delete _0x4073df['body']['id'];}return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x4073df[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x20fd15,null))[_0x08a3('0x34')](function(_0x144a08){if(_0x144a08){_0x4073df['body']['WhatsappAccountId']=_0x144a08['id'];return db['Disposition'][_0x08a3('0x5c')](_0x4073df['body']);}})[_0x08a3('0x34')](respondWithResult(_0x20fd15,null))[_0x08a3('0x26')](handleError(_0x20fd15,null));};exports['getDispositions']=function(_0xd6100b,_0x5a356f,_0x45ddba){var _0x3a1008={'raw':![],'where':{}};var _0x363ce2={};var _0x4a97a6={'count':0x0,'rows':[]};return db[_0x08a3('0x3f')]['findOne']({'where':{'id':_0xd6100b[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x5a356f,null))['then'](function(_0x408845){if(_0x408845){_0x363ce2['model']=_[_0x08a3('0x5a')](db['Disposition'][_0x08a3('0x40')]);_0x363ce2[_0x08a3('0x45')]=_[_0x08a3('0x5a')](_0xd6100b['query']);_0x363ce2[_0x08a3('0x46')]=_[_0x08a3('0x48')](_0x363ce2[_0x08a3('0x44')],_0x363ce2[_0x08a3('0x45')]);_0x3a1008[_0x08a3('0x47')]=_[_0x08a3('0x48')](_0x363ce2[_0x08a3('0x44')],qs['fields'](_0xd6100b['query'][_0x08a3('0x49')]));_0x3a1008['attributes']=_0x3a1008['attributes'][_0x08a3('0x4a')]?_0x3a1008[_0x08a3('0x47')]:_0x363ce2[_0x08a3('0x44')];if(!_0xd6100b['query'][_0x08a3('0x4b')]('nolimit')){_0x3a1008[_0x08a3('0x2c')]=qs[_0x08a3('0x2c')](_0xd6100b['query'][_0x08a3('0x2c')]);_0x3a1008[_0x08a3('0x2a')]=qs['offset'](_0xd6100b['query'][_0x08a3('0x2a')]);}_0x3a1008[_0x08a3('0x4d')]=qs['sort'](_0xd6100b[_0x08a3('0x45')][_0x08a3('0x4e')]);_0x3a1008[_0x08a3('0x4f')]=qs[_0x08a3('0x46')](_[_0x08a3('0x50')](_0xd6100b[_0x08a3('0x45')],_0x363ce2['filters']));_0x3a1008[_0x08a3('0x4f')]['WhatsappAccountId']=_0x408845['id'];if(_0xd6100b[_0x08a3('0x45')][_0x08a3('0x51')]){_0x3a1008[_0x08a3('0x4f')]=_[_0x08a3('0x52')](_0x3a1008[_0x08a3('0x4f')],{'$or':_[_0x08a3('0x3e')](_0x3a1008[_0x08a3('0x47')],function(_0x2ee005){var _0x836a67={};_0x836a67[_0x2ee005]={'$like':'%'+_0xd6100b['query'][_0x08a3('0x51')]+'%'};return _0x836a67;})});}_0x3a1008=_[_0x08a3('0x52')]({},_0x3a1008,_0xd6100b[_0x08a3('0x54')]);return db['Disposition'][_0x08a3('0x2d')]({'where':_0x3a1008[_0x08a3('0x4f')]})['then'](function(_0x1952c4){_0x4a97a6[_0x08a3('0x2d')]=_0x1952c4;if(_0xd6100b[_0x08a3('0x45')]['includeAll']){_0x3a1008[_0x08a3('0x55')]=[{'all':!![]}];}return db[_0x08a3('0x69')][_0x08a3('0x56')](_0x3a1008);})['then'](function(_0x38f98e){_0x4a97a6['rows']=_0x38f98e;return _0x4a97a6;});}})['then'](respondWithFilteredResult(_0x5a356f,_0x3a1008))[_0x08a3('0x26')](handleError(_0x5a356f,null));};exports[_0x08a3('0x6a')]=function(_0x15c191,_0x5298bb,_0x3e58b8){return db['WhatsappAccount']['find']({'where':{'id':_0x15c191[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x5298bb,null))[_0x08a3('0x34')](function(_0x39f032){if(_0x39f032){return _0x39f032[_0x08a3('0x6a')](_0x15c191[_0x08a3('0x45')][_0x08a3('0x6b')]);}})[_0x08a3('0x34')](respondWithStatusCode(_0x5298bb,null))[_0x08a3('0x26')](handleError(_0x5298bb,null));};exports['addAnswer']=function(_0x7c88aa,_0x26c700,_0x5815ec){if(_0x7c88aa[_0x08a3('0x5d')]['id']){delete _0x7c88aa[_0x08a3('0x5d')]['id'];}return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x7c88aa[_0x08a3('0x59')]['id']}})['then'](handleEntityNotFound(_0x26c700,null))[_0x08a3('0x34')](function(_0x4313b1){if(_0x4313b1){_0x7c88aa[_0x08a3('0x5d')]['WhatsappAccountId']=_0x4313b1['id'];return db[_0x08a3('0x6c')][_0x08a3('0x5c')](_0x7c88aa[_0x08a3('0x5d')]);}})[_0x08a3('0x34')](respondWithResult(_0x26c700,null))[_0x08a3('0x26')](handleError(_0x26c700,null));};exports[_0x08a3('0x6d')]=function(_0x4c0a17,_0x5ee9b2,_0x4d7ca3){var _0x29ae2d={'raw':![],'where':{}};var _0x5015ae={};var _0x219a1c={'count':0x0,'rows':[]};return db[_0x08a3('0x3f')][_0x08a3('0x6e')]({'where':{'id':_0x4c0a17[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x5ee9b2,null))[_0x08a3('0x34')](function(_0x4853d2){if(_0x4853d2){_0x5015ae['model']=_[_0x08a3('0x5a')](db[_0x08a3('0x6c')]['rawAttributes']);_0x5015ae[_0x08a3('0x45')]=_['keys'](_0x4c0a17[_0x08a3('0x45')]);_0x5015ae[_0x08a3('0x46')]=_[_0x08a3('0x48')](_0x5015ae[_0x08a3('0x44')],_0x5015ae['query']);_0x29ae2d['attributes']=_[_0x08a3('0x48')](_0x5015ae[_0x08a3('0x44')],qs[_0x08a3('0x49')](_0x4c0a17[_0x08a3('0x45')]['fields']));_0x29ae2d[_0x08a3('0x47')]=_0x29ae2d[_0x08a3('0x47')][_0x08a3('0x4a')]?_0x29ae2d[_0x08a3('0x47')]:_0x5015ae[_0x08a3('0x44')];if(!_0x4c0a17[_0x08a3('0x45')][_0x08a3('0x4b')]('nolimit')){_0x29ae2d[_0x08a3('0x2c')]=qs[_0x08a3('0x2c')](_0x4c0a17[_0x08a3('0x45')][_0x08a3('0x2c')]);_0x29ae2d[_0x08a3('0x2a')]=qs['offset'](_0x4c0a17['query'][_0x08a3('0x2a')]);}_0x29ae2d[_0x08a3('0x4d')]=qs[_0x08a3('0x4e')](_0x4c0a17[_0x08a3('0x45')][_0x08a3('0x4e')]);_0x29ae2d['where']=qs[_0x08a3('0x46')](_[_0x08a3('0x50')](_0x4c0a17[_0x08a3('0x45')],_0x5015ae[_0x08a3('0x46')]));_0x29ae2d[_0x08a3('0x4f')][_0x08a3('0x6f')]=_0x4853d2['id'];if(_0x4c0a17['query'][_0x08a3('0x51')]){_0x29ae2d['where']=_[_0x08a3('0x52')](_0x29ae2d[_0x08a3('0x4f')],{'$or':_['map'](_0x29ae2d[_0x08a3('0x47')],function(_0x5aae06){var _0x391691={};_0x391691[_0x5aae06]={'$like':'%'+_0x4c0a17['query'][_0x08a3('0x51')]+'%'};return _0x391691;})});}_0x29ae2d=_[_0x08a3('0x52')]({},_0x29ae2d,_0x4c0a17[_0x08a3('0x54')]);return db['CannedAnswer'][_0x08a3('0x2d')]({'where':_0x29ae2d['where']})[_0x08a3('0x34')](function(_0x130f72){_0x219a1c[_0x08a3('0x2d')]=_0x130f72;if(_0x4c0a17[_0x08a3('0x45')][_0x08a3('0x5b')]){_0x29ae2d[_0x08a3('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x08a3('0x56')](_0x29ae2d);})[_0x08a3('0x34')](function(_0x3c99ae){_0x219a1c[_0x08a3('0x57')]=_0x3c99ae;return _0x219a1c;});}})[_0x08a3('0x34')](respondWithFilteredResult(_0x5ee9b2,_0x29ae2d))['catch'](handleError(_0x5ee9b2,null));};exports[_0x08a3('0x70')]=function(_0x4c2a5a,_0x42ce39,_0x4773c3){return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x4c2a5a[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x42ce39,null))['then'](function(_0x57bcc0){if(_0x57bcc0){return _0x57bcc0['removeAnswers'](_0x4c2a5a[_0x08a3('0x45')][_0x08a3('0x6b')]);}})[_0x08a3('0x34')](respondWithStatusCode(_0x42ce39,null))['catch'](handleError(_0x42ce39,null));};exports[_0x08a3('0x71')]=function(_0x1b82ae,_0xbb981d,_0x5cde14){return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x1b82ae[_0x08a3('0x59')]['id']}})['then'](handleEntityNotFound(_0xbb981d,null))[_0x08a3('0x34')](function(_0x2ebbd9){if(_0x2ebbd9){return _0x2ebbd9[_0x08a3('0x71')](_0x1b82ae[_0x08a3('0x5d')][_0x08a3('0x6b')],_[_0x08a3('0x72')](_0x1b82ae[_0x08a3('0x5d')],[_0x08a3('0x6b'),'id'])||{})[_0x08a3('0x73')](function(_0x371775){for(var _0xe0bc64=0x0;_0xe0bc64<_0x1b82ae[_0x08a3('0x5d')]['ids'][_0x08a3('0x4a')];_0xe0bc64+=0x1){socket['emit'](_0x08a3('0x74'),{'UserId':Number(_0x1b82ae[_0x08a3('0x5d')][_0x08a3('0x6b')][_0xe0bc64]),'WhatsappAccountId':Number(_0x1b82ae[_0x08a3('0x59')]['id'])});}return _0x371775;});}})['then'](respondWithResult(_0xbb981d,null))[_0x08a3('0x26')](handleError(_0xbb981d,null));};exports[_0x08a3('0x75')]=function(_0x4760e8,_0x11c146,_0x3e4e16){return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x4760e8[_0x08a3('0x59')]['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x11c146,null))['then'](function(_0x1751c0){if(_0x1751c0){return _0x1751c0['removeAgents'](_0x4760e8['query'][_0x08a3('0x6b')])[_0x08a3('0x34')](function(){if(_['isArray'](_0x4760e8[_0x08a3('0x45')][_0x08a3('0x6b')])){for(var _0x584ada=0x0;_0x584ada<_0x4760e8['query'][_0x08a3('0x6b')][_0x08a3('0x4a')];_0x584ada+=0x1){socket[_0x08a3('0x76')](_0x08a3('0x77'),{'UserId':Number(_0x4760e8['query'][_0x08a3('0x6b')][_0x584ada]),'WhatsappAccountId':Number(_0x4760e8[_0x08a3('0x59')]['id'])});}}else{socket[_0x08a3('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x4760e8[_0x08a3('0x45')][_0x08a3('0x6b')]),'WhatsappAccountId':Number(_0x4760e8[_0x08a3('0x59')]['id'])});}});}})[_0x08a3('0x34')](respondWithStatusCode(_0x11c146,null))[_0x08a3('0x26')](handleError(_0x11c146,null));};exports[_0x08a3('0x78')]=function(_0x44b4de,_0x212986,_0x1af779){var _0x3a5760={};var _0x13e3c1={};var _0x3fb297;var _0x66ab32;return db[_0x08a3('0x3f')][_0x08a3('0x6e')]({'where':{'id':_0x44b4de['params']['id']}})[_0x08a3('0x34')](handleEntityNotFound(_0x212986,null))[_0x08a3('0x34')](function(_0x3ff816){if(_0x3ff816){_0x3fb297=_0x3ff816;_0x13e3c1['model']=_[_0x08a3('0x5a')](db[_0x08a3('0x79')][_0x08a3('0x40')]);_0x13e3c1[_0x08a3('0x45')]=_[_0x08a3('0x5a')](_0x44b4de[_0x08a3('0x45')]);_0x13e3c1[_0x08a3('0x46')]=_[_0x08a3('0x48')](_0x13e3c1['model'],_0x13e3c1['query']);_0x3a5760[_0x08a3('0x47')]=_['intersection'](_0x13e3c1['model'],qs[_0x08a3('0x49')](_0x44b4de[_0x08a3('0x45')][_0x08a3('0x49')]));_0x3a5760[_0x08a3('0x47')]=_0x3a5760[_0x08a3('0x47')][_0x08a3('0x4a')]?_0x3a5760[_0x08a3('0x47')]:_0x13e3c1[_0x08a3('0x44')];_0x3a5760[_0x08a3('0x4d')]=qs['sort'](_0x44b4de['query'][_0x08a3('0x4e')]);_0x3a5760[_0x08a3('0x4f')]=qs[_0x08a3('0x46')](_[_0x08a3('0x50')](_0x44b4de['query'],_0x13e3c1['filters']));if(_0x44b4de['query'][_0x08a3('0x51')]){_0x3a5760['where']=_[_0x08a3('0x52')](_0x3a5760[_0x08a3('0x4f')],{'$or':_[_0x08a3('0x3e')](_0x3a5760[_0x08a3('0x47')],function(_0x4e7aad){var _0x52b8e2={};_0x52b8e2[_0x4e7aad]={'$like':'%'+_0x44b4de[_0x08a3('0x45')][_0x08a3('0x51')]+'%'};return _0x52b8e2;})});}_0x3a5760=_[_0x08a3('0x52')]({},_0x3a5760,_0x44b4de['options']);return _0x3fb297[_0x08a3('0x78')](_0x3a5760);}})['then'](function(_0x2eb69e){if(_0x2eb69e){_0x66ab32=_0x2eb69e[_0x08a3('0x4a')];if(!_0x44b4de[_0x08a3('0x45')]['hasOwnProperty']('nolimit')){_0x3a5760[_0x08a3('0x2c')]=qs[_0x08a3('0x2c')](_0x44b4de[_0x08a3('0x45')][_0x08a3('0x2c')]);_0x3a5760['offset']=qs[_0x08a3('0x2a')](_0x44b4de[_0x08a3('0x45')][_0x08a3('0x2a')]);}return _0x3fb297[_0x08a3('0x78')](_0x3a5760);}})['then'](function(_0xbb2aa0){if(_0xbb2aa0){return _0xbb2aa0?{'count':_0x66ab32,'rows':_0xbb2aa0}:null;}})[_0x08a3('0x34')](respondWithResult(_0x212986,null))[_0x08a3('0x26')](handleError(_0x212986,null));};exports[_0x08a3('0x7a')]=function(_0x5f1c79,_0x347bb7){var _0x4937c5=_0x5f1c79[_0x08a3('0x59')]['id'];var _0x297b0c=_0x5f1c79['body'];var _0x123f25=0xc8;var _0x4c0ffd=null;return db[_0x08a3('0x7b')][_0x08a3('0x7c')]({'isolationLevel':db[_0x08a3('0x7b')][_0x08a3('0x7d')][_0x08a3('0x7e')][_0x08a3('0x7f')]},function(_0xd1675e){return db[_0x08a3('0x3f')][_0x08a3('0x6e')]({'where':{'id':_0x4937c5},'transaction':_0xd1675e})[_0x08a3('0x34')](function(_0x322d7a){if(_0x322d7a){return db['WhatsappApplication'][_0x08a3('0x37')]({'where':{'WhatsappAccountId':_0x4937c5},'transaction':_0xd1675e})[_0x08a3('0x34')](function(){var _0x1e6751=_[_0x08a3('0x3e')](_0x297b0c,function(_0x4973e1){_0x4973e1[_0x08a3('0x6f')]=_0x4937c5;return _0x4973e1;});return db[_0x08a3('0x80')][_0x08a3('0x81')](_0x1e6751,{'transaction':_0xd1675e});});}else{_0x123f25=0x194;_0x4c0ffd=[];}});})[_0x08a3('0x34')](function(){if(_0x123f25!==0x194){return db['WhatsappApplication'][_0x08a3('0x82')]({'where':{'WhatsappAccountId':_0x4937c5},'order':_0x08a3('0x83')})['then'](function(_0x40e270){_0x4c0ffd=_0x40e270;});}})[_0x08a3('0x26')](function(_0x273500){_0x123f25=0x1f4;logger[_0x08a3('0x22')](_0x273500[_0x08a3('0x84')]);if(_0x273500[_0x08a3('0x39')]){delete _0x273500[_0x08a3('0x39')];}_0x4c0ffd=_0x273500;})[_0x08a3('0x85')](function(){if(_0x4c0ffd===null){_0x347bb7[_0x08a3('0x27')](_0x123f25);}else{if(_0x123f25===0x1f4){_0x347bb7[_0x08a3('0x28')](_0x123f25)[_0x08a3('0x3a')](_0x4c0ffd);}else{_0x347bb7['status'](_0x123f25)[_0x08a3('0x29')](_0x4c0ffd);}}});};exports[_0x08a3('0x86')]=function(_0x1e8814,_0x3a2f65,_0x259d3a){var _0x5ff799={};var _0x10f477={};var _0x13fa16;var _0x3826a7;return db[_0x08a3('0x3f')][_0x08a3('0x6e')]({'where':{'id':_0x1e8814[_0x08a3('0x59')]['id']}})['then'](handleEntityNotFound(_0x3a2f65,null))[_0x08a3('0x34')](function(_0x3350ca){if(_0x3350ca){_0x13fa16=_0x3350ca;_0x10f477[_0x08a3('0x44')]=_['keys'](db['WhatsappApplication'][_0x08a3('0x40')]);_0x10f477[_0x08a3('0x45')]=_[_0x08a3('0x5a')](_0x1e8814[_0x08a3('0x45')]);_0x10f477[_0x08a3('0x46')]=_[_0x08a3('0x48')](_0x10f477['model'],_0x10f477[_0x08a3('0x45')]);_0x5ff799[_0x08a3('0x47')]=_[_0x08a3('0x48')](_0x10f477[_0x08a3('0x44')],qs[_0x08a3('0x49')](_0x1e8814[_0x08a3('0x45')]['fields']));_0x5ff799[_0x08a3('0x47')]=_0x5ff799[_0x08a3('0x47')]['length']?_0x5ff799[_0x08a3('0x47')]:_0x10f477[_0x08a3('0x44')];_0x5ff799[_0x08a3('0x4d')]=qs[_0x08a3('0x4e')](_0x1e8814[_0x08a3('0x45')][_0x08a3('0x4e')]);_0x5ff799['where']=qs['filters'](_[_0x08a3('0x50')](_0x1e8814[_0x08a3('0x45')],_0x10f477['filters']));if(_0x1e8814['query'][_0x08a3('0x51')]){_0x5ff799[_0x08a3('0x4f')]=_[_0x08a3('0x52')](_0x5ff799['where'],{'$or':_[_0x08a3('0x3e')](_0x5ff799[_0x08a3('0x47')],function(_0x399e63){var _0x1c262f={};_0x1c262f[_0x399e63]={'$like':'%'+_0x1e8814[_0x08a3('0x45')]['filter']+'%'};return _0x1c262f;})});}_0x5ff799=_[_0x08a3('0x52')]({},_0x5ff799,_0x1e8814[_0x08a3('0x54')]);return _0x13fa16['getApplications'](_0x5ff799);}})[_0x08a3('0x34')](function(_0x2420c6){if(_0x2420c6){_0x3826a7=_0x2420c6['length'];if(!_0x1e8814['query'][_0x08a3('0x4b')](_0x08a3('0x4c'))){_0x5ff799[_0x08a3('0x2c')]=qs[_0x08a3('0x2c')](_0x1e8814[_0x08a3('0x45')][_0x08a3('0x2c')]);_0x5ff799[_0x08a3('0x2a')]=qs['offset'](_0x1e8814[_0x08a3('0x45')][_0x08a3('0x2a')]);}return _0x13fa16['getApplications'](_0x5ff799);}})[_0x08a3('0x34')](function(_0x553f74){if(_0x553f74){return _0x553f74?{'count':_0x3826a7,'rows':_0x553f74}:null;}})[_0x08a3('0x34')](respondWithResult(_0x3a2f65,null))[_0x08a3('0x26')](handleError(_0x3a2f65,null));};exports[_0x08a3('0x87')]=function(_0x502361,_0x422e95,_0x2dd9d8){var _0x2ae8d0={'channel':'whatsapp'};var _0x1fb0c4=[];var _0x3800d6=[];var _0x50aa87={};return db[_0x08a3('0x3f')]['find']({'where':{'id':_0x502361[_0x08a3('0x59')]['id']},'include':[{'model':db[_0x08a3('0x80')],'as':'Applications'}]})[_0x08a3('0x34')](handleEntityNotFound(_0x422e95,null))[_0x08a3('0x34')](function(_0x458db0){_0x2ae8d0['account']=_0x458db0;if(_0x2ae8d0[_0x08a3('0x88')]&&_0x2ae8d0[_0x08a3('0x88')][_0x08a3('0x42')]===_0x08a3('0x89')&&_0x502361[_0x08a3('0x5d')]['statuses']){if(_0x502361[_0x08a3('0x5d')][_0x08a3('0x8a')][_0x08a3('0x4a')]===0x0)return;if(_0x502361[_0x08a3('0x5d')]['statuses'][0x0][_0x08a3('0x8b')]!==_0x08a3('0x8c'))return;return db[_0x08a3('0x8d')]['update']({'read':!![],'readAt':_0x502361[_0x08a3('0x5d')][_0x08a3('0x8a')][0x0][_0x08a3('0x8e')]},{'where':{'messageId':_0x502361[_0x08a3('0x5d')][_0x08a3('0x8a')][0x0][_0x08a3('0x8f')]},'individualHooks':!![]})['then'](function(_0x21901b){return _0x422e95[_0x08a3('0x28')](0xc8)[_0x08a3('0x29')](_0x21901b);});}_0x2ae8d0['applications']=_[_0x08a3('0x90')](_0x458db0[_0x08a3('0x91')],['priority'],['asc']);if(_0x2ae8d0[_0x08a3('0x88')]['Applications']){delete _0x2ae8d0['account'][_0x08a3('0x91')];}return db[_0x08a3('0x92')]['describe']()[_0x08a3('0x34')](function(_0x60ecb){if(!_0x60ecb){throw new db['Sequelize'][(_0x08a3('0x93'))](_0x08a3('0x94'));}_0x1fb0c4=_['difference'](_[_0x08a3('0x5a')](_0x60ecb),[_0x08a3('0x95'),'updatedAt']);_0x3800d6=_[_0x08a3('0x96')](_[_0x08a3('0x5a')](_0x60ecb),[_0x08a3('0x95'),'updatedAt','CompanyId','ListId']);_0x2ae8d0[_0x08a3('0x5d')]={'mapKey':_0x08a3('0x97')};if(_0x2ae8d0[_0x08a3('0x88')]&&_0x2ae8d0[_0x08a3('0x88')][_0x08a3('0x42')]===_0x08a3('0x98')){_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x99')]=_0x502361[_0x08a3('0x5d')][_0x08a3('0x9a')][_0x08a3('0x9b')](_0x08a3('0x9c'),'');_0x2ae8d0[_0x08a3('0x5d')]['body']=_0x502361['body']['Body'];_0x2ae8d0[_0x08a3('0x5d')]['messageId']=_0x502361['body']['MessageSid'];}if(_0x2ae8d0[_0x08a3('0x88')]&&_0x2ae8d0['account'][_0x08a3('0x42')]==='sinch'){_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x99')]=_0x502361['body'][_0x08a3('0x9d')][0x0]['from'];_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x5d')]=_0x502361[_0x08a3('0x5d')][_0x08a3('0x9d')][0x0]['message'][_0x08a3('0x5d')];_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x9e')]=_0x502361['body']['notifications'][0x0][_0x08a3('0x8f')];}if(_0x2ae8d0[_0x08a3('0x5d')]['id']){delete _0x2ae8d0[_0x08a3('0x5d')]['id'];}if(_[_0x08a3('0x9f')](_0x2ae8d0[_0x08a3('0x5d')]['from'])){throw new db['Sequelize'][(_0x08a3('0x93'))](_0x08a3('0xa0'));}if(_['isNil'](_0x2ae8d0['body']['body'])||_0x2ae8d0[_0x08a3('0x5d')]['body']===''){throw new db[(_0x08a3('0xa1'))][(_0x08a3('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x08a3('0x9f')](_0x2ae8d0[_0x08a3('0x5d')]['mapKey'])){throw new db[(_0x08a3('0xa1'))][(_0x08a3('0x93'))](_0x08a3('0xa2')+_0x3800d6);}if(!_['includes'](_0x3800d6,_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0xa3')])){throw new db[(_0x08a3('0xa1'))][(_0x08a3('0x93'))](_0x08a3('0xa4')+_0x3800d6);}_0x50aa87[_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0xa3')]]=_0x2ae8d0[_0x08a3('0x5d')]['from'];return db['CmList']['find']({'where':{'id':_0x2ae8d0[_0x08a3('0x88')][_0x08a3('0xa5')]},'include':[{'model':db[_0x08a3('0x92')],'as':_0x08a3('0xa6'),'where':_0x50aa87,'limit':0x1,'order':[[_0x08a3('0xa7'),_0x08a3('0xa8')]]}]});})['then'](handleEntityNotFound(_0x422e95,null))['then'](function(_0x172db1){if(_0x172db1){_0x2ae8d0[_0x08a3('0xa9')]=_[_0x08a3('0x72')](_0x172db1,[_0x08a3('0xa6')]);if(_0x172db1['Contacts'][_0x08a3('0x4a')]){return _0x172db1[_0x08a3('0xa6')][0x0];}var _0x4e6985=_[_0x08a3('0xaa')](_0x2ae8d0['body'],{'firstName':_0x2ae8d0[_0x08a3('0x5d')]['from'],'ListId':_0x172db1['id']});_0x4e6985[_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0xa3')]]=_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x99')];return db[_0x08a3('0x92')][_0x08a3('0x5c')](_0x4e6985,{'fields':_0x1fb0c4,'raw':!![]});}})[_0x08a3('0x34')](handleEntityNotFound(_0x422e95,null))[_0x08a3('0x34')](function(_0x1a6e09){if(_0x1a6e09){_0x2ae8d0[_0x08a3('0xab')]=_0x1a6e09;var _0x136f17={'ContactId':_0x1a6e09['id'],'phone':_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x99')],'WhatsappAccountId':_0x502361[_0x08a3('0x59')]['id']};var _0x2676d0={'ContactId':_0x1a6e09['id'],'WhatsappAccountId':_0x502361['params']['id'],'closed':![]};return db[_0x08a3('0xac')][_0x08a3('0x63')]({'where':_0x2676d0})[_0x08a3('0x34')](function(_0x245dce){if(_0x245dce){return[_0x245dce,![]];}return db[_0x08a3('0xac')]['create'](_0x136f17)[_0x08a3('0x34')](function(_0x454e99){return[_0x454e99,!![]];});});}})[_0x08a3('0x73')](function(_0x57078d,_0x4cb9cf){_0x2ae8d0[_0x08a3('0xad')]=_0x57078d[_0x08a3('0x5f')]({'plain':!![]});_0x2ae8d0['interaction']['created']=![];if(_0x4cb9cf){if(_0x2ae8d0['account'][_0x08a3('0xae')]){_0x2ae8d0[_0x08a3('0xaf')][_0x08a3('0xb0')]({'id':0x0,'priority':_0x2ae8d0[_0x08a3('0xaf')][_0x08a3('0x4a')]+0x1,'app':_0x08a3('0xb1'),'appdata':_0x08a3('0xb2'),'interval':'*,*,*,*'});}_0x2ae8d0['interaction'][_0x08a3('0xb3')]=!![];}return db[_0x08a3('0x8d')][_0x08a3('0x5c')]({'phone':_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0x99')],'messageId':_0x2ae8d0[_0x08a3('0x5d')]['messageId'],'body':_0x2ae8d0[_0x08a3('0x5d')]['body'],'WhatsappAccountId':_0x502361[_0x08a3('0x59')]['id'],'WhatsappInteractionId':_0x57078d['id'],'direction':'in','ContactId':_0x57078d['ContactId'],'AttachmentId':_0x2ae8d0[_0x08a3('0x5d')][_0x08a3('0xb4')]});})[_0x08a3('0x34')](function(_0x4cc93e){_0x2ae8d0[_0x08a3('0x24')]=_0x4cc93e;if(_0x2ae8d0[_0x08a3('0xad')][_0x08a3('0xb5')]){return db[_0x08a3('0x79')][_0x08a3('0x63')]({'attributes':['id',_0x08a3('0x39')],'where':{'id':_0x2ae8d0[_0x08a3('0xad')]['UserId']}})['then'](function(_0x19f3d2){if(_0x19f3d2){_0x2ae8d0[_0x08a3('0xaf')][_0x08a3('0xb6')]({'id':0x0,'priority':0x0,'app':_0x08a3('0xb7'),'appdata':_0x19f3d2[_0x08a3('0x39')]+','+(_0x2ae8d0[_0x08a3('0x88')][_0x08a3('0xb8')]||0xa),'interval':_0x08a3('0xb9')});}return respondWithRpcPromise(_0x08a3('0xba'),'startRouting',_0x2ae8d0);});}return respondWithRpcPromise('Start',_0x08a3('0xbb'),_0x2ae8d0);})[_0x08a3('0x34')](function(_0x2c6ad8){if(_0x2c6ad8){var _0x3b4eaf=0xc8;var _0x2c5a33=_0x08a3('0xbc');logger[_0x08a3('0x1d')](_0x08a3('0x21'),_0x2c5a33,_0x3b4eaf,_0x08a3('0xbd'));logger[_0x08a3('0x20')](_0x08a3('0xbe'),_0x2c5a33,_0x3b4eaf,_0x08a3('0xbd'),JSON[_0x08a3('0xbf')](_0x2c6ad8));if(_0x2ae8d0['account'][_0x08a3('0x42')]===_0x08a3('0x98')){return _0x422e95[_0x08a3('0x28')](_0x3b4eaf)['set']('Content-Type',_0x08a3('0xc0'))['send']('\x0a');}else{return _0x422e95['status'](_0x3b4eaf)[_0x08a3('0x29')](_0x2c6ad8);}}});})[_0x08a3('0x26')](handleError(_0x422e95,null));};exports[_0x08a3('0x3a')]=function(_0x4c67f8,_0x2fcbe2,_0x15cf17){var _0x2764af,_0xeb0828,_0x37bcb3;if(_[_0x08a3('0x9f')](_0x4c67f8[_0x08a3('0x5d')]['body'])||_0x4c67f8[_0x08a3('0x5d')][_0x08a3('0x5d')]===''){throw new db[(_0x08a3('0xa1'))][(_0x08a3('0x93'))](_0x08a3('0xc1'));}if(_[_0x08a3('0x9f')](_0x4c67f8[_0x08a3('0x5d')]['to'])){throw new db[(_0x08a3('0xa1'))]['ValidationError'](_0x08a3('0xc2'));}_0x2764af=_0x4c67f8['body']['to'];return db[_0x08a3('0x3f')][_0x08a3('0x63')]({'where':{'id':_0x4c67f8[_0x08a3('0x59')]['id']},'include':[{'model':db[_0x08a3('0xc3')],'as':_0x08a3('0xc4'),'include':[{'model':db[_0x08a3('0x92')],'as':_0x08a3('0xa6'),'where':{'mobile':_0x2764af},'limit':0x1,'order':[[_0x08a3('0xa7'),_0x08a3('0xa8')]]}]}]})[_0x08a3('0x34')](handleEntityNotFound(_0x2fcbe2,null))[_0x08a3('0x34')](function(_0x13d1c1){if(_0x13d1c1&&_0x13d1c1['List']){_0xeb0828=_0x13d1c1[_0x08a3('0x5f')]({'plain':!![]});if(_0xeb0828[_0x08a3('0xc4')]&&_0xeb0828['List'][_0x08a3('0xa6')][_0x08a3('0x4a')]){return _0xeb0828[_0x08a3('0xc4')][_0x08a3('0xa6')][0x0];}return db['CmContact']['create'](_[_0x08a3('0xaa')](_0x4c67f8[_0x08a3('0x5d')],{'firstName':_0x2764af,'mobile':_0x2764af,'phone':_0x2764af,'ListId':_0xeb0828[_0x08a3('0xa5')]}));}})[_0x08a3('0x34')](handleEntityNotFound(_0x2fcbe2,null))['then'](function(_0x325bc0){if(_0x325bc0){_0x37bcb3=_0x325bc0;return db['WhatsappInteraction'][_0x08a3('0x63')]({'where':{'ContactId':_0x37bcb3['id'],'closed':![],'WhatsappAccountId':_0xeb0828['id']}})['then'](function(_0x107325){if(_0x107325){return[_0x107325,![]];}return db[_0x08a3('0xac')]['create']({'UserId':_0x4c67f8[_0x08a3('0x5e')]['id'],'ContactId':_0x37bcb3['id'],'WhatsappAccountId':_0xeb0828['id'],'phone':_0x2764af,'firstMsgDirection':'out','Messages':[_['merge'](_0x4c67f8[_0x08a3('0x5d')],{'read':![],'body':_0x4c67f8[_0x08a3('0x5d')][_0x08a3('0x5d')],'phone':_0x2764af,'WhatsappAccountId':_0xeb0828['id'],'UserId':_0x4c67f8[_0x08a3('0x5e')]['id'],'ContactId':_0x37bcb3['id']})]},{'include':[{'model':db[_0x08a3('0x8d')],'as':_0x08a3('0xc5')}]})['then'](function(_0x30e7de){return[_0x30e7de,!![]];});});}})['spread'](function(_0x1898e5,_0x317a0f){if(_0x317a0f){return _0x1898e5;}return db[_0x08a3('0x8d')][_0x08a3('0x5c')](_[_0x08a3('0x52')](_0x4c67f8[_0x08a3('0x5d')],{'read':![],'body':_0x4c67f8[_0x08a3('0x5d')]['body'],'phone':_0x2764af,'WhatsappAccountId':_0xeb0828['id'],'WhatsappInteractionId':_0x1898e5['id'],'UserId':_0x4c67f8[_0x08a3('0x5e')]['id'],'ContactId':_0x37bcb3['id']}))[_0x08a3('0x34')](function(_0x2e0043){_0x1898e5['dataValues'][_0x08a3('0xc5')]=[];_0x1898e5[_0x08a3('0xc6')]['Messages'][_0x08a3('0xb0')](_0x2e0043[_0x08a3('0xc6')]);return _0x1898e5;});})[_0x08a3('0x34')](respondWithResult(_0x2fcbe2,null))[_0x08a3('0x26')](handleError(_0x2fcbe2,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index cfb3cfa..00f89ce 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 _0x9f44=['../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x44a4fa,_0xf6824d){var _0x46118a=function(_0x1ec414){while(--_0x1ec414){_0x44a4fa['push'](_0x44a4fa['shift']());}};_0x46118a(++_0xf6824d);}(_0x9f44,0x131));var _0x49f4=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9f44[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require(_0x49f4('0x0'));var WhatsappAccount=require(_0x49f4('0x1'))['db'][_0x49f4('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x49f4('0x3')](0x0);var events={'afterCreate':_0x49f4('0x4'),'afterUpdate':'update','afterDestroy':_0x49f4('0x5')};function emitEvent(_0xe6c239){return function(_0x333740,_0x78345e,_0x302b47){WhatsappAccountEvents[_0x49f4('0x6')](_0xe6c239+':'+_0x333740['id'],_0x333740);WhatsappAccountEvents['emit'](_0xe6c239,_0x333740);_0x302b47(null);};}for(var e in events){if(events[_0x49f4('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x49f4('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1f93=['exports','events','WhatsappAccount','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x222ee9,_0x20c2d2){var _0x161585=function(_0x510ba1){while(--_0x510ba1){_0x222ee9['push'](_0x222ee9['shift']());}};_0x161585(++_0x20c2d2);}(_0x1f93,0x119));var _0x31f9=function(_0x1dfcb9,_0x515572){_0x1dfcb9=_0x1dfcb9-0x0;var _0x3a5f53=_0x1f93[_0x1dfcb9];return _0x3a5f53;};'use strict';var EventEmitter=require(_0x31f9('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x31f9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x31f9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x31f9('0x3')};function emitEvent(_0x2a449e){return function(_0x6bcf5d,_0x32e08d,_0x3284ad){WhatsappAccountEvents[_0x31f9('0x4')](_0x2a449e+':'+_0x6bcf5d['id'],_0x6bcf5d);WhatsappAccountEvents[_0x31f9('0x4')](_0x2a449e,_0x6bcf5d);_0x3284ad(null);};}for(var e in events){if(events[_0x31f9('0x5')](e)){var event=events[e];WhatsappAccount[_0x31f9('0x6')](e,emitEvent(event));}}module[_0x31f9('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a200d25..bd8efbe 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 _0x2b4e=['WhatsappAccount','whatsapp_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x1d28ad,_0x33609a){var _0x1a7993=function(_0x44f361){while(--_0x44f361){_0x1d28ad['push'](_0x1d28ad['shift']());}};_0x1a7993(++_0x33609a);}(_0x2b4e,0x15e));var _0xe2b4=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x2b4e[_0xc40b9f];return _0x535b9c;};'use strict';var _=require('lodash');var util=require(_0xe2b4('0x0'));var logger=require(_0xe2b4('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe2b4('0x2'));var rp=require(_0xe2b4('0x3'));var fs=require('fs');var path=require(_0xe2b4('0x4'));var rimraf=require(_0xe2b4('0x5'));var config=require(_0xe2b4('0x6'));var attributes=require(_0xe2b4('0x7'));module[_0xe2b4('0x8')]=function(_0x3de2f2,_0x189a87){return _0x3de2f2[_0xe2b4('0x9')](_0xe2b4('0xa'),attributes,{'tableName':_0xe2b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4f7=['WhatsappAccount','moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','exports'];(function(_0x118acc,_0x502d65){var _0x4b94f7=function(_0x33f75f){while(--_0x33f75f){_0x118acc['push'](_0x118acc['shift']());}};_0x4b94f7(++_0x502d65);}(_0xc4f7,0x1cf));var _0x7c4f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4f7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7c4f('0x0'));var BPromise=require(_0x7c4f('0x1'));var rp=require(_0x7c4f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c4f('0x3'));var config=require('../../config/environment');var attributes=require(_0x7c4f('0x4'));module[_0x7c4f('0x5')]=function(_0xb36b64,_0x403be2){return _0xb36b64['define'](_0x7c4f('0x6'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index b6e4b09..60ace3a 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 _0xc613=['stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','include','model','then','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc613,0x1b3));var _0x3c61=function(_0x356c70,_0x72c2e3){_0x356c70=_0x356c70-0x0;var _0x46faa2=_0xc613[_0x356c70];return _0x46faa2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c61('0x0'));var BPromise=require(_0x3c61('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c61('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c61('0x3'));var logger=require(_0x3c61('0x4'))(_0x3c61('0x5'));var config=require('../../config/environment');var jayson=require(_0x3c61('0x6'));var client=jayson[_0x3c61('0x7')][_0x3c61('0x8')]({'port':0x232a});config[_0x3c61('0x9')]=_[_0x3c61('0xa')](config[_0x3c61('0x9')],{'host':_0x3c61('0xb'),'port':0x18eb});var socket=require(_0x3c61('0xc'))(new Redis(config[_0x3c61('0x9')]));require(_0x3c61('0xd'))[_0x3c61('0xe')](socket);function respondWithRpcPromise(_0x27ea7b,_0x4ab079,_0x2c9019){return new BPromise(function(_0x1cd5b8,_0x34740f){return client[_0x3c61('0xf')](_0x27ea7b,_0x2c9019)['then'](function(_0x52cb6b){logger[_0x3c61('0x10')](_0x3c61('0x11'),_0x4ab079,_0x3c61('0x12'));logger[_0x3c61('0x13')](_0x3c61('0x14'),_0x4ab079,_0x3c61('0x12'),JSON[_0x3c61('0x15')](_0x52cb6b));if(_0x52cb6b[_0x3c61('0x16')]){if(_0x52cb6b[_0x3c61('0x16')][_0x3c61('0x17')]===0x1f4){logger[_0x3c61('0x16')](_0x3c61('0x11'),_0x4ab079,_0x52cb6b[_0x3c61('0x16')][_0x3c61('0x18')]);return _0x34740f(_0x52cb6b['error'][_0x3c61('0x18')]);}logger[_0x3c61('0x16')](_0x3c61('0x11'),_0x4ab079,_0x52cb6b[_0x3c61('0x16')][_0x3c61('0x18')]);return _0x1cd5b8(_0x52cb6b[_0x3c61('0x16')][_0x3c61('0x18')]);}else{logger[_0x3c61('0x10')](_0x3c61('0x11'),_0x4ab079,_0x3c61('0x12'));_0x1cd5b8(_0x52cb6b[_0x3c61('0x19')][_0x3c61('0x18')]);}})['catch'](function(_0x43d02c){logger[_0x3c61('0x16')](_0x3c61('0x11'),_0x4ab079,_0x43d02c);_0x34740f(_0x43d02c);});});}exports[_0x3c61('0x1a')]=function(_0x53321b){var _0x5dea72=this;return new Promise(function(_0x2571f6,_0x2b1a79){return db[_0x3c61('0x1b')][_0x3c61('0x1c')]({'raw':_0x53321b[_0x3c61('0x1d')]?_0x53321b['options'][_0x3c61('0x1e')]===undefined?!![]:![]:!![],'where':_0x53321b[_0x3c61('0x1d')]?_0x53321b[_0x3c61('0x1d')][_0x3c61('0x1f')]||null:null,'attributes':_0x53321b[_0x3c61('0x1d')]?_0x53321b[_0x3c61('0x1d')][_0x3c61('0x20')]||null:null,'include':_0x53321b['options']?_0x53321b['options']['include']?_[_0x3c61('0x21')](_0x53321b['options'][_0x3c61('0x22')],function(_0xd9e6bc){return{'model':db[_0xd9e6bc[_0x3c61('0x23')]],'as':_0xd9e6bc['as'],'attributes':_0xd9e6bc[_0x3c61('0x20')],'include':_0xd9e6bc['include']?_['map'](_0xd9e6bc[_0x3c61('0x22')],function(_0x4fd2e2){return{'model':db[_0x4fd2e2['model']],'as':_0x4fd2e2['as'],'attributes':_0x4fd2e2[_0x3c61('0x20')],'include':_0x4fd2e2[_0x3c61('0x22')]?_[_0x3c61('0x21')](_0x4fd2e2[_0x3c61('0x22')],function(_0x1e2211){return{'model':db[_0x1e2211[_0x3c61('0x23')]],'as':_0x1e2211['as'],'attributes':_0x1e2211[_0x3c61('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3c61('0x24')](function(_0x2069ed){logger[_0x3c61('0x10')](_0x3c61('0x1a'),_0x53321b);logger[_0x3c61('0x13')](_0x3c61('0x1a'),_0x53321b,JSON['stringify'](_0x2069ed));_0x2571f6(_0x2069ed);})[_0x3c61('0x25')](function(_0x2f2ed0){logger['error'](_0x3c61('0x1a'),_0x2f2ed0[_0x3c61('0x18')],_0x53321b);_0x2b1a79(_0x5dea72[_0x3c61('0x16')](0x1f4,_0x2f2ed0[_0x3c61('0x18')]));});});}; \ No newline at end of file +var _0xa3cb=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','catch','lodash'];(function(_0x581fc6,_0x573fbe){var _0x13bf06=function(_0x293d1b){while(--_0x293d1b){_0x581fc6['push'](_0x581fc6['shift']());}};_0x13bf06(++_0x573fbe);}(_0xa3cb,0x1e0));var _0xba3c=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xa3cb[_0x2ab365];return _0x49fef3;};'use strict';var _=require(_0xba3c('0x0'));var util=require('util');var moment=require(_0xba3c('0x1'));var BPromise=require(_0xba3c('0x2'));var rs=require(_0xba3c('0x3'));var fs=require('fs');var Redis=require(_0xba3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba3c('0x5'));var logger=require(_0xba3c('0x6'))(_0xba3c('0x7'));var config=require(_0xba3c('0x8'));var jayson=require(_0xba3c('0x9'));var client=jayson[_0xba3c('0xa')][_0xba3c('0xb')]({'port':0x232a});config[_0xba3c('0xc')]=_[_0xba3c('0xd')](config['redis'],{'host':_0xba3c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba3c('0xc')]));require(_0xba3c('0xf'))['register'](socket);function respondWithRpcPromise(_0x44fd29,_0x41992a,_0x3df586){return new BPromise(function(_0x367638,_0xeec7ac){return client[_0xba3c('0x10')](_0x44fd29,_0x3df586)[_0xba3c('0x11')](function(_0x4ac39a){logger[_0xba3c('0x12')](_0xba3c('0x13'),_0x41992a,_0xba3c('0x14'));logger[_0xba3c('0x15')](_0xba3c('0x16'),_0x41992a,'request\x20sent',JSON[_0xba3c('0x17')](_0x4ac39a));if(_0x4ac39a[_0xba3c('0x18')]){if(_0x4ac39a[_0xba3c('0x18')]['code']===0x1f4){logger[_0xba3c('0x18')](_0xba3c('0x13'),_0x41992a,_0x4ac39a['error'][_0xba3c('0x19')]);return _0xeec7ac(_0x4ac39a[_0xba3c('0x18')][_0xba3c('0x19')]);}logger[_0xba3c('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x41992a,_0x4ac39a[_0xba3c('0x18')][_0xba3c('0x19')]);return _0x367638(_0x4ac39a[_0xba3c('0x18')][_0xba3c('0x19')]);}else{logger[_0xba3c('0x12')](_0xba3c('0x13'),_0x41992a,_0xba3c('0x14'));_0x367638(_0x4ac39a[_0xba3c('0x1a')][_0xba3c('0x19')]);}})['catch'](function(_0x424ab6){logger['error'](_0xba3c('0x13'),_0x41992a,_0x424ab6);_0xeec7ac(_0x424ab6);});});}exports[_0xba3c('0x1b')]=function(_0x45cbdd){var _0x9c5e64=this;return new Promise(function(_0x1e6bb7,_0x5b6623){return db[_0xba3c('0x1c')][_0xba3c('0x1d')]({'raw':_0x45cbdd[_0xba3c('0x1e')]?_0x45cbdd[_0xba3c('0x1e')][_0xba3c('0x1f')]===undefined?!![]:![]:!![],'where':_0x45cbdd[_0xba3c('0x1e')]?_0x45cbdd[_0xba3c('0x1e')]['where']||null:null,'attributes':_0x45cbdd['options']?_0x45cbdd['options'][_0xba3c('0x20')]||null:null,'include':_0x45cbdd[_0xba3c('0x1e')]?_0x45cbdd[_0xba3c('0x1e')][_0xba3c('0x21')]?_[_0xba3c('0x22')](_0x45cbdd[_0xba3c('0x1e')][_0xba3c('0x21')],function(_0x2fe4d6){return{'model':db[_0x2fe4d6[_0xba3c('0x23')]],'as':_0x2fe4d6['as'],'attributes':_0x2fe4d6[_0xba3c('0x20')],'include':_0x2fe4d6[_0xba3c('0x21')]?_[_0xba3c('0x22')](_0x2fe4d6[_0xba3c('0x21')],function(_0x26a36e){return{'model':db[_0x26a36e[_0xba3c('0x23')]],'as':_0x26a36e['as'],'attributes':_0x26a36e[_0xba3c('0x20')],'include':_0x26a36e[_0xba3c('0x21')]?_['map'](_0x26a36e[_0xba3c('0x21')],function(_0x120afd){return{'model':db[_0x120afd[_0xba3c('0x23')]],'as':_0x120afd['as'],'attributes':_0x120afd[_0xba3c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xba3c('0x11')](function(_0x211f48){logger[_0xba3c('0x12')](_0xba3c('0x1b'),_0x45cbdd);logger[_0xba3c('0x15')]('ShowWhatsappAccount',_0x45cbdd,JSON[_0xba3c('0x17')](_0x211f48));_0x1e6bb7(_0x211f48);})[_0xba3c('0x24')](function(_0x3edeac){logger[_0xba3c('0x18')]('ShowWhatsappAccount',_0x3edeac[_0xba3c('0x19')],_0x45cbdd);_0x5b6623(_0x9c5e64[_0xba3c('0x18')](0x1f4,_0x3edeac['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 1d58ae7..8cf72e6 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 _0xbbf6=['./whatsappAccount.events','save','remove','emit','removeListener','register','length','whatsappAccount:'];(function(_0x1ce236,_0xca922e){var _0x241819=function(_0x1a66f8){while(--_0x1a66f8){_0x1ce236['push'](_0x1ce236['shift']());}};_0x241819(++_0xca922e);}(_0xbbf6,0x1e0));var _0x6bbf=function(_0x3b544a,_0x366b0c){_0x3b544a=_0x3b544a-0x0;var _0x56a79c=_0xbbf6[_0x3b544a];return _0x56a79c;};'use strict';var WhatsappAccountEvents=require(_0x6bbf('0x0'));var events=[_0x6bbf('0x1'),_0x6bbf('0x2'),'update'];function createListener(_0x2d870d,_0x4b9267){return function(_0x351ff1){_0x4b9267[_0x6bbf('0x3')](_0x2d870d,_0x351ff1);};}function removeListener(_0x1d4d9f,_0x3a467a){return function(){WhatsappAccountEvents[_0x6bbf('0x4')](_0x1d4d9f,_0x3a467a);};}exports[_0x6bbf('0x5')]=function(_0x5a948f){for(var _0x29bf6f=0x0,_0x40e63f=events[_0x6bbf('0x6')];_0x29bf6f<_0x40e63f;_0x29bf6f++){var _0x14482d=events[_0x29bf6f];var _0x2c6698=createListener(_0x6bbf('0x7')+_0x14482d,_0x5a948f);WhatsappAccountEvents['on'](_0x14482d,_0x2c6698);}}; \ No newline at end of file +var _0xb995=['length','whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener','register'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xb995,0x1da));var _0x5b99=function(_0x215c55,_0x58a035){_0x215c55=_0x215c55-0x0;var _0x186867=_0xb995[_0x215c55];return _0x186867;};'use strict';var WhatsappAccountEvents=require(_0x5b99('0x0'));var events=[_0x5b99('0x1'),'remove',_0x5b99('0x2')];function createListener(_0x368816,_0x5babee){return function(_0x33d8fd){_0x5babee[_0x5b99('0x3')](_0x368816,_0x33d8fd);};}function removeListener(_0x1ad235,_0x4ecf5a){return function(){WhatsappAccountEvents[_0x5b99('0x4')](_0x1ad235,_0x4ecf5a);};}exports[_0x5b99('0x5')]=function(_0x2fe6c9){for(var _0x4bb497=0x0,_0x26deb1=events[_0x5b99('0x6')];_0x4bb497<_0x26deb1;_0x4bb497++){var _0x29cd3c=events[_0x4bb497];var _0x50968c=createListener(_0x5b99('0x7')+_0x29cd3c,_0x2fe6c9);WhatsappAccountEvents['on'](_0x29cd3c,_0x50968c);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 511b5ca..72ee194 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 _0x1ee0=['update','destroy','multer','util','path','connect-timeout','Router','fs-extra','./whatsappApplication.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x1ee0,0x1c2));var _0x01ee=function(_0x515f4c,_0xdcdaa5){_0x515f4c=_0x515f4c-0x0;var _0x3c05f4=_0x1ee0[_0x515f4c];return _0x3c05f4;};'use strict';var multer=require(_0x01ee('0x0'));var util=require(_0x01ee('0x1'));var path=require(_0x01ee('0x2'));var timeout=require(_0x01ee('0x3'));var express=require('express');var router=express[_0x01ee('0x4')]();var fs_extra=require(_0x01ee('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x01ee('0x6'));router[_0x01ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x01ee('0x8')]);router[_0x01ee('0x7')](_0x01ee('0x9'),auth[_0x01ee('0xa')](),controller['show']);router[_0x01ee('0xb')]('/',auth['isAuthenticated'](),controller[_0x01ee('0xc')]);router[_0x01ee('0xd')](_0x01ee('0x9'),auth[_0x01ee('0xa')](),controller[_0x01ee('0xe')]);router['delete'](_0x01ee('0x9'),auth[_0x01ee('0xa')](),controller[_0x01ee('0xf')]);module['exports']=router; \ No newline at end of file +var _0x392a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x6064e8,_0x1d5fa1){var _0x1c070c=function(_0x2e6111){while(--_0x2e6111){_0x6064e8['push'](_0x6064e8['shift']());}};_0x1c070c(++_0x1d5fa1);}(_0x392a,0x134));var _0xa392=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x392a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa392('0x0'));var util=require(_0xa392('0x1'));var path=require(_0xa392('0x2'));var timeout=require(_0xa392('0x3'));var express=require(_0xa392('0x4'));var router=express[_0xa392('0x5')]();var fs_extra=require(_0xa392('0x6'));var auth=require(_0xa392('0x7'));var interaction=require(_0xa392('0x8'));var config=require(_0xa392('0x9'));var controller=require(_0xa392('0xa'));router[_0xa392('0xb')]('/',auth[_0xa392('0xc')](),controller[_0xa392('0xd')]);router[_0xa392('0xb')](_0xa392('0xe'),auth['isAuthenticated'](),controller[_0xa392('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa392('0x10')]);router[_0xa392('0x11')]('/:id',auth[_0xa392('0xc')](),controller[_0xa392('0x12')]);router[_0xa392('0x13')](_0xa392('0xe'),auth[_0xa392('0xc')](),controller[_0xa392('0x14')]);module[_0xa392('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 64934af..159f212 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 _0xde42=['noop','TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x5ce101,_0x23410b){var _0x3eecc2=function(_0x510ea5){while(--_0x510ea5){_0x5ce101['push'](_0x5ce101['shift']());}};_0x3eecc2(++_0x23410b);}(_0xde42,0x12a));var _0x2de4=function(_0x2129a3,_0x48f17a){_0x2129a3=_0x2129a3-0x0;var _0x18842b=_0xde42[_0x2129a3];return _0x18842b;};'use strict';var Sequelize=require(_0x2de4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2de4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2de4('0x2')},'appdata':{'type':Sequelize[_0x2de4('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2de4('0x4')],'defaultValue':_0x2de4('0x5')}}; \ No newline at end of file +var _0xaaa3=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xaaa3,0xd2));var _0x3aaa=function(_0x19e813,_0x11a215){_0x19e813=_0x19e813-0x0;var _0x37beaf=_0xaaa3[_0x19e813];return _0x37beaf;};'use strict';var Sequelize=require('sequelize');module[_0x3aaa('0x0')]={'priority':{'type':Sequelize[_0x3aaa('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3aaa('0x2')],'allowNull':![],'defaultValue':_0x3aaa('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3aaa('0x2')]},'interval':{'type':Sequelize[_0x3aaa('0x2')],'defaultValue':_0x3aaa('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e50e2f3..5abe68c 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 _0x77d4=['set','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x77d4,0x108));var _0x477d=function(_0x5d0186,_0x27d279){_0x5d0186=_0x5d0186-0x0;var _0x48ece9=_0x77d4[_0x5d0186];return _0x48ece9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x477d('0x10'));var logger=require('../../config/logger')(_0x477d('0x11'));var utils=require(_0x477d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x477d('0x13'));var db=require(_0x477d('0x14'))['db'];function respondWithStatusCode(_0x5a190c,_0x5dd33c){_0x5dd33c=_0x5dd33c||0xcc;return function(_0x6ff724){if(_0x6ff724){return _0x5a190c[_0x477d('0x15')](_0x5dd33c);}return _0x5a190c['status'](_0x5dd33c)[_0x477d('0x16')]();};}function respondWithResult(_0x1d5699,_0x48c73a){_0x48c73a=_0x48c73a||0xc8;return function(_0x4b2021){if(_0x4b2021){return _0x1d5699[_0x477d('0x17')](_0x48c73a)['json'](_0x4b2021);}};}function respondWithFilteredResult(_0x30481f,_0x234b99){return function(_0x25fc02){if(_0x25fc02){var _0x5985b5=typeof _0x234b99[_0x477d('0x18')]===_0x477d('0x19')&&typeof _0x234b99[_0x477d('0x1a')]===_0x477d('0x19');var _0x57b38e=_0x25fc02[_0x477d('0x1b')];var _0x5d5553=_0x5985b5?0x0:_0x234b99[_0x477d('0x18')];var _0x1399d7=_0x5985b5?_0x25fc02[_0x477d('0x1b')]:_0x234b99[_0x477d('0x18')]+_0x234b99[_0x477d('0x1a')];var _0x2145ce;if(_0x1399d7>=_0x57b38e){_0x1399d7=_0x57b38e;_0x2145ce=0xc8;}else{_0x2145ce=0xce;}_0x30481f['status'](_0x2145ce);return _0x30481f[_0x477d('0x1c')]('Content-Range',_0x5d5553+'-'+_0x1399d7+'/'+_0x57b38e)[_0x477d('0x1d')](_0x25fc02);}return null;};}function patchUpdates(_0x24a6d5){return function(_0x40256e){try{jsonpatch[_0x477d('0x1e')](_0x40256e,_0x24a6d5,!![]);}catch(_0x27b3aa){return BPromise[_0x477d('0x1f')](_0x27b3aa);}return _0x40256e[_0x477d('0x20')]();};}function saveUpdates(_0x17154d,_0x45a8bd){return function(_0x5981a){if(_0x5981a){return _0x5981a[_0x477d('0x21')](_0x17154d)[_0x477d('0x22')](function(_0x43c845){return _0x43c845;});}return null;};}function removeEntity(_0x1f3868,_0x4e6a44){return function(_0x4481b0){if(_0x4481b0){return _0x4481b0['destroy']()[_0x477d('0x22')](function(){_0x1f3868[_0x477d('0x17')](0xcc)[_0x477d('0x16')]();});}};}function handleEntityNotFound(_0x2287b4,_0x4bb50e){return function(_0xd6dca5){if(!_0xd6dca5){_0x2287b4[_0x477d('0x15')](0x194);}return _0xd6dca5;};}function handleError(_0x1ca4fe,_0x48ee5e){_0x48ee5e=_0x48ee5e||0x1f4;return function(_0x585648){logger[_0x477d('0x23')](_0x585648[_0x477d('0x24')]);if(_0x585648[_0x477d('0x25')]){delete _0x585648['name'];}_0x1ca4fe[_0x477d('0x17')](_0x48ee5e)[_0x477d('0x26')](_0x585648);};}exports[_0x477d('0x27')]=function(_0xe4dd40,_0x37b332){var _0x537fc4={},_0x2fc959={},_0xeb02f5={'count':0x0,'rows':[]};var _0x17dd16=_[_0x477d('0x28')](db[_0x477d('0x29')][_0x477d('0x2a')],function(_0x180046){return{'name':_0x180046[_0x477d('0x2b')],'type':_0x180046[_0x477d('0x2c')][_0x477d('0x2d')]};});_0x2fc959[_0x477d('0x2e')]=_[_0x477d('0x28')](_0x17dd16,_0x477d('0x25'));_0x2fc959[_0x477d('0x2f')]=_[_0x477d('0x30')](_0xe4dd40[_0x477d('0x2f')]);_0x2fc959[_0x477d('0x31')]=_[_0x477d('0x32')](_0x2fc959[_0x477d('0x2e')],_0x2fc959[_0x477d('0x2f')]);_0x537fc4['attributes']=_[_0x477d('0x32')](_0x2fc959['model'],qs[_0x477d('0x33')](_0xe4dd40[_0x477d('0x2f')][_0x477d('0x33')]));_0x537fc4['attributes']=_0x537fc4[_0x477d('0x34')][_0x477d('0x35')]?_0x537fc4[_0x477d('0x34')]:_0x2fc959[_0x477d('0x2e')];if(!_0xe4dd40[_0x477d('0x2f')][_0x477d('0x36')](_0x477d('0x37'))){_0x537fc4[_0x477d('0x1a')]=qs[_0x477d('0x1a')](_0xe4dd40[_0x477d('0x2f')]['limit']);_0x537fc4[_0x477d('0x18')]=qs[_0x477d('0x18')](_0xe4dd40[_0x477d('0x2f')]['offset']);}_0x537fc4[_0x477d('0x38')]=qs[_0x477d('0x39')](_0xe4dd40[_0x477d('0x2f')]['sort']);_0x537fc4['where']=qs[_0x477d('0x31')](_[_0x477d('0x3a')](_0xe4dd40[_0x477d('0x2f')],_0x2fc959[_0x477d('0x31')]),_0x17dd16);if(_0xe4dd40[_0x477d('0x2f')]['filter']){_0x537fc4[_0x477d('0x3b')]=_['merge'](_0x537fc4[_0x477d('0x3b')],{'$or':_[_0x477d('0x28')](_0x17dd16,function(_0x356f41){if(_0x356f41['type']!=='VIRTUAL'){var _0x184d50={};_0x184d50[_0x356f41[_0x477d('0x25')]]={'$like':'%'+_0xe4dd40[_0x477d('0x2f')][_0x477d('0x3c')]+'%'};return _0x184d50;}})});}_0x537fc4=_['merge']({},_0x537fc4,_0xe4dd40[_0x477d('0x3d')]);var _0xc091e={'where':_0x537fc4[_0x477d('0x3b')]};return db[_0x477d('0x29')][_0x477d('0x1b')](_0xc091e)['then'](function(_0x472149){_0xeb02f5[_0x477d('0x1b')]=_0x472149;if(_0xe4dd40['query'][_0x477d('0x3e')]){_0x537fc4['include']=[{'all':!![]}];}return db[_0x477d('0x29')][_0x477d('0x3f')](_0x537fc4);})[_0x477d('0x22')](function(_0x335b2a){_0xeb02f5[_0x477d('0x40')]=_0x335b2a;return _0xeb02f5;})[_0x477d('0x22')](respondWithFilteredResult(_0x37b332,_0x537fc4))[_0x477d('0x41')](handleError(_0x37b332,null));};exports[_0x477d('0x42')]=function(_0x43ffd1,_0x4c22f5){var _0x5759f={'raw':!![],'where':{'id':_0x43ffd1[_0x477d('0x43')]['id']}},_0x31c9a1={};_0x31c9a1[_0x477d('0x2e')]=_['keys'](db['WhatsappApplication'][_0x477d('0x2a')]);_0x31c9a1[_0x477d('0x2f')]=_['keys'](_0x43ffd1[_0x477d('0x2f')]);_0x31c9a1['filters']=_['intersection'](_0x31c9a1[_0x477d('0x2e')],_0x31c9a1[_0x477d('0x2f')]);_0x5759f[_0x477d('0x34')]=_[_0x477d('0x32')](_0x31c9a1[_0x477d('0x2e')],qs[_0x477d('0x33')](_0x43ffd1['query'][_0x477d('0x33')]));_0x5759f[_0x477d('0x34')]=_0x5759f[_0x477d('0x34')][_0x477d('0x35')]?_0x5759f[_0x477d('0x34')]:_0x31c9a1['model'];if(_0x43ffd1['query'][_0x477d('0x3e')]){_0x5759f[_0x477d('0x44')]=[{'all':!![]}];}_0x5759f=_[_0x477d('0x45')]({},_0x5759f,_0x43ffd1['options']);return db[_0x477d('0x29')][_0x477d('0x46')](_0x5759f)[_0x477d('0x22')](handleEntityNotFound(_0x4c22f5,null))[_0x477d('0x22')](respondWithResult(_0x4c22f5,null))[_0x477d('0x41')](handleError(_0x4c22f5,null));};exports[_0x477d('0x47')]=function(_0x13f606,_0x4d4e19){return db[_0x477d('0x29')][_0x477d('0x47')](_0x13f606[_0x477d('0x48')],{})[_0x477d('0x22')](respondWithResult(_0x4d4e19,0xc9))[_0x477d('0x41')](handleError(_0x4d4e19,null));};exports[_0x477d('0x21')]=function(_0x2aad84,_0x30e474){if(_0x2aad84[_0x477d('0x48')]['id']){delete _0x2aad84[_0x477d('0x48')]['id'];}return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x2aad84[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x30e474,null))[_0x477d('0x22')](saveUpdates(_0x2aad84['body'],null))[_0x477d('0x22')](respondWithResult(_0x30e474,null))[_0x477d('0x41')](handleError(_0x30e474,null));};exports['destroy']=function(_0x566ba0,_0x5cb3ca){return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x566ba0[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x5cb3ca,null))[_0x477d('0x22')](removeEntity(_0x5cb3ca,null))[_0x477d('0x41')](handleError(_0x5cb3ca,null));}; \ No newline at end of file +var _0x2432=['save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','type','query','filters','intersection','attributes','fields','model','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x8f6788,_0x409ec6){var _0x4d0d97=function(_0x48e1a9){while(--_0x48e1a9){_0x8f6788['push'](_0x8f6788['shift']());}};_0x4d0d97(++_0x409ec6);}(_0x2432,0x7a));var _0x2243=function(_0x56b004,_0x1e6dac){_0x56b004=_0x56b004-0x0;var _0x379996=_0x2432[_0x56b004];return _0x379996;};'use strict';var emlformat=require(_0x2243('0x0'));var rimraf=require(_0x2243('0x1'));var zipdir=require(_0x2243('0x2'));var jsonpatch=require(_0x2243('0x3'));var rp=require('request-promise');var moment=require(_0x2243('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2243('0x5'));var util=require(_0x2243('0x6'));var path=require(_0x2243('0x7'));var sox=require(_0x2243('0x8'));var csv=require(_0x2243('0x9'));var ejs=require(_0x2243('0xa'));var fs=require('fs');var fs_extra=require(_0x2243('0xb'));var _=require(_0x2243('0xc'));var squel=require(_0x2243('0xd'));var crypto=require('crypto');var jsforce=require(_0x2243('0xe'));var deskjs=require(_0x2243('0xf'));var toCsv=require(_0x2243('0x9'));var querystring=require(_0x2243('0x10'));var Papa=require(_0x2243('0x11'));var Redis=require(_0x2243('0x12'));var authService=require(_0x2243('0x13'));var qs=require(_0x2243('0x14'));var as=require(_0x2243('0x15'));var hardwareService=require(_0x2243('0x16'));var logger=require(_0x2243('0x17'))(_0x2243('0x18'));var utils=require(_0x2243('0x19'));var config=require(_0x2243('0x1a'));var licenseUtil=require(_0x2243('0x1b'));var db=require(_0x2243('0x1c'))['db'];function respondWithStatusCode(_0x4b5ec5,_0x214433){_0x214433=_0x214433||0xcc;return function(_0x13c2a2){if(_0x13c2a2){return _0x4b5ec5[_0x2243('0x1d')](_0x214433);}return _0x4b5ec5[_0x2243('0x1e')](_0x214433)['end']();};}function respondWithResult(_0x436262,_0x496e30){_0x496e30=_0x496e30||0xc8;return function(_0x328104){if(_0x328104){return _0x436262['status'](_0x496e30)[_0x2243('0x1f')](_0x328104);}};}function respondWithFilteredResult(_0x6da2e2,_0x20e2cf){return function(_0x3388bc){if(_0x3388bc){var _0x4ebd4a=typeof _0x20e2cf['offset']===_0x2243('0x20')&&typeof _0x20e2cf[_0x2243('0x21')]===_0x2243('0x20');var _0xaac77c=_0x3388bc[_0x2243('0x22')];var _0x2595f0=_0x4ebd4a?0x0:_0x20e2cf[_0x2243('0x23')];var _0x3c8bb9=_0x4ebd4a?_0x3388bc[_0x2243('0x22')]:_0x20e2cf[_0x2243('0x23')]+_0x20e2cf[_0x2243('0x21')];var _0x4a1dc2;if(_0x3c8bb9>=_0xaac77c){_0x3c8bb9=_0xaac77c;_0x4a1dc2=0xc8;}else{_0x4a1dc2=0xce;}_0x6da2e2[_0x2243('0x1e')](_0x4a1dc2);return _0x6da2e2[_0x2243('0x24')](_0x2243('0x25'),_0x2595f0+'-'+_0x3c8bb9+'/'+_0xaac77c)['json'](_0x3388bc);}return null;};}function patchUpdates(_0x7818cf){return function(_0x14ed4f){try{jsonpatch[_0x2243('0x26')](_0x14ed4f,_0x7818cf,!![]);}catch(_0x17b976){return BPromise[_0x2243('0x27')](_0x17b976);}return _0x14ed4f[_0x2243('0x28')]();};}function saveUpdates(_0x518bfe,_0x45d4b7){return function(_0x36b1d4){if(_0x36b1d4){return _0x36b1d4[_0x2243('0x29')](_0x518bfe)[_0x2243('0x2a')](function(_0x28c6c4){return _0x28c6c4;});}return null;};}function removeEntity(_0x3424fc,_0x54d51d){return function(_0x3e64c9){if(_0x3e64c9){return _0x3e64c9[_0x2243('0x2b')]()[_0x2243('0x2a')](function(){_0x3424fc[_0x2243('0x1e')](0xcc)[_0x2243('0x2c')]();});}};}function handleEntityNotFound(_0x522d82,_0xedbc67){return function(_0x4d5935){if(!_0x4d5935){_0x522d82['sendStatus'](0x194);}return _0x4d5935;};}function handleError(_0xada872,_0x1153c4){_0x1153c4=_0x1153c4||0x1f4;return function(_0x4b0e0f){logger[_0x2243('0x2d')](_0x4b0e0f[_0x2243('0x2e')]);if(_0x4b0e0f['name']){delete _0x4b0e0f[_0x2243('0x2f')];}_0xada872[_0x2243('0x1e')](_0x1153c4)[_0x2243('0x30')](_0x4b0e0f);};}exports[_0x2243('0x31')]=function(_0x4e3acf,_0x21b3e0){var _0x2ad941={},_0x39d436={},_0x2d523a={'count':0x0,'rows':[]};var _0x8525d7=_[_0x2243('0x32')](db[_0x2243('0x33')][_0x2243('0x34')],function(_0x20f3a3){return{'name':_0x20f3a3['fieldName'],'type':_0x20f3a3[_0x2243('0x35')]['key']};});_0x39d436['model']=_[_0x2243('0x32')](_0x8525d7,_0x2243('0x2f'));_0x39d436[_0x2243('0x36')]=_['keys'](_0x4e3acf[_0x2243('0x36')]);_0x39d436[_0x2243('0x37')]=_[_0x2243('0x38')](_0x39d436['model'],_0x39d436[_0x2243('0x36')]);_0x2ad941[_0x2243('0x39')]=_[_0x2243('0x38')](_0x39d436['model'],qs['fields'](_0x4e3acf[_0x2243('0x36')][_0x2243('0x3a')]));_0x2ad941[_0x2243('0x39')]=_0x2ad941[_0x2243('0x39')]['length']?_0x2ad941[_0x2243('0x39')]:_0x39d436[_0x2243('0x3b')];if(!_0x4e3acf[_0x2243('0x36')]['hasOwnProperty'](_0x2243('0x3c'))){_0x2ad941[_0x2243('0x21')]=qs[_0x2243('0x21')](_0x4e3acf[_0x2243('0x36')]['limit']);_0x2ad941[_0x2243('0x23')]=qs[_0x2243('0x23')](_0x4e3acf[_0x2243('0x36')][_0x2243('0x23')]);}_0x2ad941[_0x2243('0x3d')]=qs['sort'](_0x4e3acf[_0x2243('0x36')][_0x2243('0x3e')]);_0x2ad941[_0x2243('0x3f')]=qs[_0x2243('0x37')](_[_0x2243('0x40')](_0x4e3acf[_0x2243('0x36')],_0x39d436[_0x2243('0x37')]),_0x8525d7);if(_0x4e3acf[_0x2243('0x36')][_0x2243('0x41')]){_0x2ad941[_0x2243('0x3f')]=_['merge'](_0x2ad941[_0x2243('0x3f')],{'$or':_['map'](_0x8525d7,function(_0x27ccba){if(_0x27ccba[_0x2243('0x35')]!==_0x2243('0x42')){var _0x49482a={};_0x49482a[_0x27ccba['name']]={'$like':'%'+_0x4e3acf[_0x2243('0x36')][_0x2243('0x41')]+'%'};return _0x49482a;}})});}_0x2ad941=_[_0x2243('0x43')]({},_0x2ad941,_0x4e3acf[_0x2243('0x44')]);var _0x21240b={'where':_0x2ad941[_0x2243('0x3f')]};return db[_0x2243('0x33')][_0x2243('0x22')](_0x21240b)[_0x2243('0x2a')](function(_0x34063f){_0x2d523a[_0x2243('0x22')]=_0x34063f;if(_0x4e3acf['query'][_0x2243('0x45')]){_0x2ad941[_0x2243('0x46')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x2243('0x47')](_0x2ad941);})['then'](function(_0x4063ab){_0x2d523a[_0x2243('0x48')]=_0x4063ab;return _0x2d523a;})[_0x2243('0x2a')](respondWithFilteredResult(_0x21b3e0,_0x2ad941))[_0x2243('0x49')](handleError(_0x21b3e0,null));};exports[_0x2243('0x4a')]=function(_0xba54cc,_0x5a8b94){var _0x3d39ce={'raw':!![],'where':{'id':_0xba54cc[_0x2243('0x4b')]['id']}},_0xa2872c={};_0xa2872c[_0x2243('0x3b')]=_[_0x2243('0x4c')](db[_0x2243('0x33')]['rawAttributes']);_0xa2872c[_0x2243('0x36')]=_[_0x2243('0x4c')](_0xba54cc[_0x2243('0x36')]);_0xa2872c[_0x2243('0x37')]=_['intersection'](_0xa2872c[_0x2243('0x3b')],_0xa2872c['query']);_0x3d39ce[_0x2243('0x39')]=_[_0x2243('0x38')](_0xa2872c['model'],qs['fields'](_0xba54cc['query']['fields']));_0x3d39ce[_0x2243('0x39')]=_0x3d39ce['attributes'][_0x2243('0x4d')]?_0x3d39ce[_0x2243('0x39')]:_0xa2872c[_0x2243('0x3b')];if(_0xba54cc[_0x2243('0x36')][_0x2243('0x45')]){_0x3d39ce[_0x2243('0x46')]=[{'all':!![]}];}_0x3d39ce=_[_0x2243('0x43')]({},_0x3d39ce,_0xba54cc['options']);return db[_0x2243('0x33')][_0x2243('0x4e')](_0x3d39ce)[_0x2243('0x2a')](handleEntityNotFound(_0x5a8b94,null))['then'](respondWithResult(_0x5a8b94,null))[_0x2243('0x49')](handleError(_0x5a8b94,null));};exports[_0x2243('0x4f')]=function(_0x3f0b79,_0x409e44){return db[_0x2243('0x33')][_0x2243('0x4f')](_0x3f0b79[_0x2243('0x50')],{})[_0x2243('0x2a')](respondWithResult(_0x409e44,0xc9))[_0x2243('0x49')](handleError(_0x409e44,null));};exports[_0x2243('0x29')]=function(_0x4150a8,_0x490fb2){if(_0x4150a8[_0x2243('0x50')]['id']){delete _0x4150a8['body']['id'];}return db[_0x2243('0x33')]['find']({'where':{'id':_0x4150a8[_0x2243('0x4b')]['id']}})[_0x2243('0x2a')](handleEntityNotFound(_0x490fb2,null))['then'](saveUpdates(_0x4150a8['body'],null))[_0x2243('0x2a')](respondWithResult(_0x490fb2,null))[_0x2243('0x49')](handleError(_0x490fb2,null));};exports[_0x2243('0x2b')]=function(_0x5e06b2,_0x25a25a){return db[_0x2243('0x33')]['find']({'where':{'id':_0x5e06b2[_0x2243('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25a25a,null))[_0x2243('0x2a')](removeEntity(_0x25a25a,null))['catch'](handleError(_0x25a25a,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6cf6c06..dad9e2e 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 _0x689c=['define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x689c,0x9e));var _0xc689=function(_0xa598c4,_0x56326c){_0xa598c4=_0xa598c4-0x0;var _0x510698=_0x689c[_0xa598c4];return _0x510698;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc689('0x0'))(_0xc689('0x1'));var moment=require(_0xc689('0x2'));var BPromise=require(_0xc689('0x3'));var rp=require(_0xc689('0x4'));var fs=require('fs');var path=require(_0xc689('0x5'));var rimraf=require('rimraf');var config=require(_0xc689('0x6'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x3a4916,_0x28ce4c){return _0x3a4916[_0xc689('0x7')](_0xc689('0x8'),attributes,{'tableName':_0xc689('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc689('0xa')});}; \ No newline at end of file +var _0xe94a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappApplication','utf8mb4_unicode_ci'];(function(_0x1963e8,_0x1204c1){var _0x3dacfc=function(_0x5ade42){while(--_0x5ade42){_0x1963e8['push'](_0x1963e8['shift']());}};_0x3dacfc(++_0x1204c1);}(_0xe94a,0x1c7));var _0xae94=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe94a[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae94('0x0'));var util=require(_0xae94('0x1'));var logger=require(_0xae94('0x2'))('api');var moment=require(_0xae94('0x3'));var BPromise=require(_0xae94('0x4'));var rp=require(_0xae94('0x5'));var fs=require('fs');var path=require(_0xae94('0x6'));var rimraf=require(_0xae94('0x7'));var config=require(_0xae94('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0xae94('0x9')]=function(_0x1f836b,_0x1f587d){return _0x1f836b[_0xae94('0xa')](_0xae94('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xae94('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2b1c7c0..e5a805d 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 _0x22fb=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15c49f,_0x570377){var _0x5a5c58=function(_0x1b0431){while(--_0x1b0431){_0x15c49f['push'](_0x15c49f['shift']());}};_0x5a5c58(++_0x570377);}(_0x22fb,0x192));var _0xb22f=function(_0x2f85c6,_0x51aa64){_0x2f85c6=_0x2f85c6-0x0;var _0x49ea0f=_0x22fb[_0x2f85c6];return _0x49ea0f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x5904b4,_0x5b56f3){var _0x23b35e=function(_0x28b8b0){while(--_0x28b8b0){_0x5904b4['push'](_0x5904b4['shift']());}};_0x23b35e(++_0x5b56f3);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3907f3,_0x501f76){_0x3907f3=_0x3907f3-0x0;var _0x5ae2d0=_0xa8a8[_0x3907f3];return _0x5ae2d0;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f3ac181..aebe5b9 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 _0xf072=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','/:id/tags','removeTags'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf072,0x1cf));var _0x2f07=function(_0x442c79,_0x3a4dac){_0x442c79=_0x442c79-0x0;var _0xfaf549=_0xf072[_0x442c79];return _0xfaf549;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0x8')](_0x2f07('0xf'),auth[_0x2f07('0x9')](),controller['getMessages']);router[_0x2f07('0x8')](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f07('0x12')]);router[_0x2f07('0x13')]('/:id/messages',auth[_0x2f07('0x9')](),controller[_0x2f07('0x14')]);router[_0x2f07('0x13')]('/:id/tags',auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),_0x2f07('0x17')),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')]('/:id',auth[_0x2f07('0x9')](),interaction['tracked'](_0x2f07('0x16'),_0x2f07('0x1a')),controller[_0x2f07('0x1b')]);router[_0x2f07('0x1c')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),'whatsappinteraction:destroy'),controller[_0x2f07('0x1d')]);router['delete'](_0x2f07('0x1e'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x1f')]);module[_0x2f07('0x20')]=router; \ No newline at end of file +var _0xce68=['Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce68,0x10c));var _0x8ce6=function(_0x54c9c3,_0x1bb59b){_0x54c9c3=_0x54c9c3-0x0;var _0x48d39e=_0xce68[_0x54c9c3];return _0x48d39e;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require('util');var path=require(_0x8ce6('0x1'));var timeout=require(_0x8ce6('0x2'));var express=require(_0x8ce6('0x3'));var router=express[_0x8ce6('0x4')]();var fs_extra=require(_0x8ce6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ce6('0x6'));var config=require(_0x8ce6('0x7'));var controller=require(_0x8ce6('0x8'));router['get']('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xa')]);router['get']('/describe',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xb')]);router[_0x8ce6('0xc')](_0x8ce6('0xd'),auth['isAuthenticated'](),controller[_0x8ce6('0xe')]);router[_0x8ce6('0xc')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x10')]);router[_0x8ce6('0xc')](_0x8ce6('0x11'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x12')]);router[_0x8ce6('0x13')]('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x14')]);router[_0x8ce6('0x13')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x15')]);router[_0x8ce6('0x13')](_0x8ce6('0x16'),auth['isAuthenticated'](),interaction[_0x8ce6('0x17')]('whatsapp',_0x8ce6('0x18')),controller[_0x8ce6('0x19')]);router[_0x8ce6('0x1a')](_0x8ce6('0xd'),auth[_0x8ce6('0x9')](),interaction[_0x8ce6('0x17')](_0x8ce6('0x1b'),_0x8ce6('0x1c')),controller[_0x8ce6('0x1d')]);router[_0x8ce6('0x1e')]('/:id',auth[_0x8ce6('0x9')](),interaction['tracked'](_0x8ce6('0x1b'),_0x8ce6('0x1f')),controller[_0x8ce6('0x20')]);router['delete']('/:id/tags',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 1fc49a9..db1888a 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 _0x18af=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0x34ba0c,_0xf988ee){var _0x1dc0b1=function(_0x2c5102){while(--_0x2c5102){_0x34ba0c['push'](_0x34ba0c['shift']());}};_0x1dc0b1(++_0xf988ee);}(_0x18af,0x8b));var _0xf18a=function(_0x43ebf7,_0x32877f){_0x43ebf7=_0x43ebf7-0x0;var _0x7e0777=_0x18af[_0x43ebf7];return _0x7e0777;};'use strict';var Sequelize=require(_0xf18a('0x0'));var moment=require('moment');module[_0xf18a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf18a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf18a('0x3')]},'phone':{'type':Sequelize[_0xf18a('0x3')]},'read1stAt':{'type':Sequelize[_0xf18a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf18a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf18a('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf18a('0x4')]('in',_0xf18a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf961=['moment','exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x3786c4,_0x56ed9a){var _0x3e208f=function(_0x56839f){while(--_0x56839f){_0x3786c4['push'](_0x3786c4['shift']());}};_0x3e208f(++_0x56ed9a);}(_0xf961,0x1cf));var _0x1f96=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xf961[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0x1f96('0x0'));var moment=require(_0x1f96('0x1'));module[_0x1f96('0x2')]={'closed':{'type':Sequelize[_0x1f96('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1f96('0x4')]},'secondDisposition':{'type':Sequelize[_0x1f96('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1f96('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1f96('0x4')]},'read1stAt':{'type':Sequelize[_0x1f96('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x1f96('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1f96('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1f96('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1f96('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 655dd7c..4a49ae7 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 _0x6014=['end','json','undefined','count','set','Content-Range','update','destroy','then','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','show','keys','filters','intersection','model','fields','attributes','length','includeAll','merge','find','create','body','params','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','nolimit','limit','offset','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','download','unix','toString','join','root','server','files','attachments','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','existsSync','pipe','basename','out','System','secret','renderFile','views','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x6014,0x6d));var _0x4601=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0x6014[_0x250071];return _0x34e574;};'use strict';var rimraf=require(_0x4601('0x0'));var zipdir=require(_0x4601('0x1'));var moment=require(_0x4601('0x2'));var BPromise=require(_0x4601('0x3'));var util=require('util');var path=require(_0x4601('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4601('0x5'));var Redis=require('ioredis');var interaction=require(_0x4601('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4601('0x7'));var logger=require(_0x4601('0x8'))(_0x4601('0x9'));var config=require(_0x4601('0xa'));var db=require(_0x4601('0xb'))['db'];config[_0x4601('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4601('0xd'))(new Redis(config['redis']));require(_0x4601('0xe'))[_0x4601('0xf')](socket);function respondWithStatusCode(_0x119e67,_0xfd114a){_0xfd114a=_0xfd114a||0xcc;return function(_0x1139c9){if(_0x1139c9){return _0x119e67[_0x4601('0x10')](_0xfd114a);}return _0x119e67[_0x4601('0x11')](_0xfd114a)[_0x4601('0x12')]();};}function respondWithResult(_0x2dad9f,_0x477eb6){_0x477eb6=_0x477eb6||0xc8;return function(_0xdbf8a9){if(_0xdbf8a9){return _0x2dad9f['status'](_0x477eb6)[_0x4601('0x13')](_0xdbf8a9);}};}function respondWithFilteredResult(_0x10f5a6,_0x3a0e31){return function(_0x36d36b){if(_0x36d36b){var _0x44803f=typeof _0x3a0e31['offset']===_0x4601('0x14')&&typeof _0x3a0e31['limit']==='undefined';var _0x471e6f=_0x36d36b[_0x4601('0x15')];var _0x312b45=_0x44803f?0x0:_0x3a0e31['offset'];var _0x36a35f=_0x44803f?_0x36d36b[_0x4601('0x15')]:_0x3a0e31['offset']+_0x3a0e31['limit'];var _0x43a6aa;if(_0x36a35f>=_0x471e6f){_0x36a35f=_0x471e6f;_0x43a6aa=0xc8;}else{_0x43a6aa=0xce;}_0x10f5a6[_0x4601('0x11')](_0x43a6aa);return _0x10f5a6[_0x4601('0x16')](_0x4601('0x17'),_0x312b45+'-'+_0x36a35f+'/'+_0x471e6f)['json'](_0x36d36b);}return null;};}function saveUpdates(_0x5da56d){return function(_0x50acc8){if(_0x50acc8){return _0x50acc8[_0x4601('0x18')](_0x5da56d)['then'](function(_0x3d7d9f){return _0x3d7d9f;});}return null;};}function removeEntity(_0x16c74b){return function(_0x240122){if(_0x240122){return _0x240122[_0x4601('0x19')]()[_0x4601('0x1a')](function(){_0x16c74b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x284919){return function(_0x3876c8){if(!_0x3876c8){_0x284919[_0x4601('0x10')](0x194);}return _0x3876c8;};}function handleError(_0x2112fa,_0xc1a97e){_0xc1a97e=_0xc1a97e||0x1f4;return function(_0xccecf3){logger[_0x4601('0x1b')](_0xccecf3[_0x4601('0x1c')]);if(_0xccecf3[_0x4601('0x1d')]){delete _0xccecf3['name'];}_0x2112fa[_0x4601('0x11')](_0xc1a97e)['send'](_0xccecf3);};}exports[_0x4601('0x1e')]=function(_0x5ae3e2,_0x44a869){var _0x5c0066={};var _0x133628=_['map'](db[_0x4601('0x1f')][_0x4601('0x20')],function(_0x2231d1){return{'name':_0x2231d1[_0x4601('0x21')],'type':_0x2231d1[_0x4601('0x22')][_0x4601('0x23')]};});_0x5c0066=qs[_0x4601('0x24')](_0x133628,_0x5ae3e2);return interaction[_0x4601('0x25')](_0x4601('0x26'),_0x5ae3e2[_0x4601('0x27')],_0x5ae3e2[_0x4601('0x28')],_0x5c0066,_0x133628)[_0x4601('0x1a')](respondWithFilteredResult(_0x44a869,_0x5c0066))[_0x4601('0x29')](handleError(_0x44a869,null));};exports[_0x4601('0x2a')]=function(_0x135ad6,_0x5eeb7f){var _0x45249a={'raw':![],'where':{'id':_0x135ad6['params']['id']}},_0xf051d={};_0xf051d['model']=_[_0x4601('0x2b')](db[_0x4601('0x1f')][_0x4601('0x20')]);_0xf051d['query']=_['keys'](_0x135ad6['query']);_0xf051d[_0x4601('0x2c')]=_[_0x4601('0x2d')](_0xf051d[_0x4601('0x2e')],_0xf051d[_0x4601('0x27')]);_0x45249a['attributes']=_['intersection'](_0xf051d[_0x4601('0x2e')],qs[_0x4601('0x2f')](_0x135ad6['query'][_0x4601('0x2f')]));_0x45249a['attributes']=_0x45249a[_0x4601('0x30')][_0x4601('0x31')]?_0x45249a[_0x4601('0x30')]:_0xf051d[_0x4601('0x2e')];if(_0x135ad6[_0x4601('0x27')][_0x4601('0x32')]){_0x45249a['include']=[{'all':!![]}];}_0x45249a=_[_0x4601('0x33')]({},_0x45249a,_0x135ad6['options']);return db['WhatsappInteraction'][_0x4601('0x34')](_0x45249a)[_0x4601('0x1a')](handleEntityNotFound(_0x5eeb7f,null))['then'](respondWithResult(_0x5eeb7f,null))[_0x4601('0x29')](handleError(_0x5eeb7f,null));};exports[_0x4601('0x35')]=function(_0xb6f89,_0x2323ed){return db[_0x4601('0x1f')][_0x4601('0x35')](_0xb6f89['body'],{})[_0x4601('0x1a')](respondWithResult(_0x2323ed,0xc9))[_0x4601('0x29')](handleError(_0x2323ed,null));};exports[_0x4601('0x18')]=function(_0x2a8e8d,_0x41d719){if(_0x2a8e8d['body']['id']){delete _0x2a8e8d[_0x4601('0x36')]['id'];}return db[_0x4601('0x1f')]['find']({'where':{'id':_0x2a8e8d[_0x4601('0x37')]['id']}})[_0x4601('0x1a')](handleEntityNotFound(_0x41d719,null))[_0x4601('0x1a')](saveUpdates(_0x2a8e8d[_0x4601('0x36')],null))[_0x4601('0x1a')](respondWithResult(_0x41d719,null))['catch'](handleError(_0x41d719,null));};exports[_0x4601('0x19')]=function(_0x52867c,_0x33583a){return db['WhatsappInteraction'][_0x4601('0x34')]({'where':{'id':_0x52867c[_0x4601('0x37')]['id']}})[_0x4601('0x1a')](handleEntityNotFound(_0x33583a,null))[_0x4601('0x1a')](removeEntity(_0x33583a,null))[_0x4601('0x29')](handleError(_0x33583a,null));};exports[_0x4601('0x38')]=function(_0x4cdedd,_0x3f2920){return db[_0x4601('0x1f')][_0x4601('0x38')]()[_0x4601('0x1a')](respondWithResult(_0x3f2920,null))[_0x4601('0x29')](handleError(_0x3f2920,null));};exports['addMessage']=function(_0x1ac4bf,_0x5c48ac){return db[_0x4601('0x39')][_0x4601('0x34')]({'where':{'id':_0x1ac4bf['params']['id']}})[_0x4601('0x1a')](handleEntityNotFound(_0x5c48ac,null))[_0x4601('0x1a')](function(_0x1d9ca3){if(_0x1d9ca3){return _0x1d9ca3[_0x4601('0x3a')](_0x1ac4bf['body'][_0x4601('0x3b')],_[_0x4601('0x3c')](_0x1ac4bf[_0x4601('0x36')],[_0x4601('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x5c48ac,null))[_0x4601('0x29')](handleError(_0x5c48ac,null));};exports[_0x4601('0x3d')]=function(_0x407393,_0x16d9b7){var _0x18db13={'raw':![],'where':{}};var _0x4fa2cd={};var _0x30fb4d={'count':0x0,'rows':[]};return db[_0x4601('0x1f')][_0x4601('0x3e')]({'where':{'id':_0x407393[_0x4601('0x37')]['id']}})[_0x4601('0x1a')](handleEntityNotFound(_0x16d9b7,null))[_0x4601('0x1a')](function(_0x1e8d18){if(_0x1e8d18){_0x4fa2cd[_0x4601('0x2e')]=_['keys'](db[_0x4601('0x39')]['rawAttributes']);_0x4fa2cd[_0x4601('0x27')]=_[_0x4601('0x2b')](_0x407393['query']);_0x4fa2cd[_0x4601('0x2c')]=_['intersection'](_0x4fa2cd[_0x4601('0x2e')],_0x4fa2cd[_0x4601('0x27')]);_0x18db13[_0x4601('0x30')]=_[_0x4601('0x2d')](_0x4fa2cd['model'],qs[_0x4601('0x2f')](_0x407393[_0x4601('0x27')]['fields']));_0x18db13[_0x4601('0x30')]=_0x18db13[_0x4601('0x30')][_0x4601('0x31')]?_0x18db13[_0x4601('0x30')]:_0x4fa2cd['model'];if(!_0x407393[_0x4601('0x27')]['hasOwnProperty'](_0x4601('0x3f'))){_0x18db13[_0x4601('0x40')]=qs[_0x4601('0x40')](_0x407393[_0x4601('0x27')][_0x4601('0x40')]);_0x18db13[_0x4601('0x41')]=qs['offset'](_0x407393[_0x4601('0x27')]['offset']);}_0x18db13['order']=qs[_0x4601('0x42')](_0x407393[_0x4601('0x27')][_0x4601('0x42')]);_0x18db13[_0x4601('0x43')]=qs['filters'](_[_0x4601('0x44')](_0x407393['query'],_0x4fa2cd['filters']));_0x18db13['where'][_0x4601('0x45')]=_0x1e8d18['id'];if(_0x407393[_0x4601('0x27')][_0x4601('0x46')]){_0x18db13['where']=_['merge'](_0x18db13['where'],{'$or':_[_0x4601('0x47')](_0x18db13['attributes'],function(_0x19679f){var _0x3c15bc={};_0x3c15bc[_0x19679f]={'$like':'%'+_0x407393['query']['filter']+'%'};return _0x3c15bc;})});}if(_0x407393['query'][_0x4601('0x48')]){var _0x2af7ff=_0x407393[_0x4601('0x27')]['$gte'][_0x4601('0x49')](',');var _0x48d313={};_0x48d313[_0x2af7ff[0x0]]={'$gte':moment(_0x2af7ff[0x1])[_0x4601('0x4a')](_0x4601('0x4b'))};_0x18db13[_0x4601('0x43')]=_['merge'](_0x18db13[_0x4601('0x43')],_0x48d313);}_0x18db13=_[_0x4601('0x33')]({},_0x18db13,_0x407393[_0x4601('0x4c')]);return db['WhatsappMessage'][_0x4601('0x15')]({'where':_0x18db13[_0x4601('0x43')]})[_0x4601('0x1a')](function(_0x4acc46){_0x30fb4d[_0x4601('0x15')]=_0x4acc46;if(_0x407393['query'][_0x4601('0x32')]){_0x18db13[_0x4601('0x4d')]=[{'all':!![]}];}return db[_0x4601('0x39')][_0x4601('0x25')](_0x18db13);})[_0x4601('0x1a')](function(_0x4c0767){_0x30fb4d[_0x4601('0x4e')]=_0x4c0767;return _0x30fb4d;});}})[_0x4601('0x1a')](respondWithFilteredResult(_0x16d9b7,_0x18db13))[_0x4601('0x29')](handleError(_0x16d9b7,null));};exports['addTags']=function(_0x27a2be,_0x3a98e0){return db[_0x4601('0x1f')]['find']({'where':{'id':_0x27a2be[_0x4601('0x37')]['id']}})[_0x4601('0x1a')](handleEntityNotFound(_0x3a98e0,null))['then'](function(_0x51ba21){if(_0x51ba21){return _0x51ba21[_0x4601('0x4f')](_0x27a2be[_0x4601('0x36')][_0x4601('0x3b')],_['omit'](_0x27a2be[_0x4601('0x36')],[_0x4601('0x3b'),'id'])||{})[_0x4601('0x50')](function(){return db[_0x4601('0x51')][_0x4601('0x25')]({'attributes':['id',_0x4601('0x1d'),_0x4601('0x52')],'where':{'id':_0x27a2be[_0x4601('0x36')][_0x4601('0x3b')]}});})[_0x4601('0x1a')](function(_0x187590){socket[_0x4601('0x53')](_0x4601('0x54'),{'id':Number(_0x27a2be[_0x4601('0x37')]['id']),'tags':_0x187590||[]});return{'id':Number(_0x27a2be[_0x4601('0x37')]['id']),'tags':_0x187590||[]};});}})['then'](respondWithResult(_0x3a98e0,null))['catch'](handleError(_0x3a98e0,null));};exports['removeTags']=function(_0x384368,_0x26d280){return db[_0x4601('0x1f')][_0x4601('0x34')]({'where':{'id':_0x384368[_0x4601('0x37')]['id']}})['then'](handleEntityNotFound(_0x26d280,null))[_0x4601('0x1a')](function(_0x508e79){if(_0x508e79){return _0x508e79['removeTags'](_0x384368[_0x4601('0x27')][_0x4601('0x3b')]);}})[_0x4601('0x1a')](respondWithStatusCode(_0x26d280,null))['catch'](handleError(_0x26d280,null));};exports[_0x4601('0x55')]=function(_0x51198c,_0x43f607){var _0x4b67d2=moment()[_0x4601('0x56')]()[_0x4601('0x57')]();var _0x3a8b87=path[_0x4601('0x58')](config[_0x4601('0x59')],_0x4601('0x5a'),_0x4601('0x5b'),'tmp');var _0x1041f4=path[_0x4601('0x58')](config[_0x4601('0x59')],'server','files',_0x4601('0x5c'));var _0x372618=path[_0x4601('0x58')](_0x3a8b87,_0x4b67d2);var _0x5320a3=util[_0x4601('0x4a')]('transcript-%d-%s.zip',_0x51198c[_0x4601('0x37')]['id'],_0x4b67d2);var _0x4da1f9=path[_0x4601('0x58')](_0x3a8b87,_0x5320a3);var _0x135176=[];_0x135176['push']({'model':db[_0x4601('0x5d')],'as':'User','attributes':['id',_0x4601('0x5e')],'raw':!![]});_0x135176[_0x4601('0x5f')]({'model':db[_0x4601('0x60')],'as':_0x4601('0x61'),'attributes':['id',_0x4601('0x62'),_0x4601('0x63')],'raw':!![]});if(_0x51198c[_0x4601('0x27')][_0x4601('0x5c')]){_0x135176[_0x4601('0x5f')]({'model':db[_0x4601('0x64')],'as':_0x4601('0x64'),'raw':!![]});}var _0x4c0941=[{'model':db[_0x4601('0x39')],'as':_0x4601('0x65'),'attributes':['id',_0x4601('0x36'),_0x4601('0x66'),_0x4601('0x67'),'secret',_0x4601('0x68')],'include':_0x135176}];_0x4c0941['push']({'model':db[_0x4601('0x69')],'as':_0x4601('0x6a'),'attributes':['id','name']});_0x4c0941['push']({'model':db['User'],'as':_0x4601('0x6b'),'attributes':['id',_0x4601('0x5e')]});return db[_0x4601('0x1f')]['find']({'where':{'id':_0x51198c[_0x4601('0x37')]['id']},'include':_0x4c0941})[_0x4601('0x1a')](handleEntityNotFound(_0x43f607,null))['then'](function(_0x5be1ff){if(_0x5be1ff){var _0x1c29a0=_0x5be1ff[_0x4601('0x6c')]({'plain':!![]});fs[_0x4601('0x6d')](_0x372618);var _0x33de84={'channel':_0x4601('0x6e'),'account':_0x1c29a0[_0x4601('0x6a')][_0x4601('0x1d')],'agent':_0x1c29a0['Owner']?_0x1c29a0[_0x4601('0x6b')][_0x4601('0x5e')]:_0x4601('0x6f'),'createdAt':moment(_0x1c29a0[_0x4601('0x66')])['format'](_0x4601('0x4b'))['toString'](),'closedAt':_0x1c29a0[_0x4601('0x70')]?moment(_0x1c29a0[_0x4601('0x71')])[_0x4601('0x4a')](_0x4601('0x4b'))[_0x4601('0x57')]():'','disposition':_0x1c29a0['disposition'],'messages':_(_0x1c29a0[_0x4601('0x65')])[_0x4601('0x46')]({'secret':![]})[_0x4601('0x47')](function(_0xccfc3d){if(_0xccfc3d[_0x4601('0x64')]){var _0x1672af=path[_0x4601('0x58')](_0x1041f4,_0xccfc3d['Attachment']['basename']);if(fs[_0x4601('0x72')](_0x1672af)){fs['createReadStream'](_0x1672af)[_0x4601('0x73')](fs['createWriteStream'](path[_0x4601('0x58')](_0x372618,_0xccfc3d[_0x4601('0x64')][_0x4601('0x74')])));}}return{'date':moment(_0xccfc3d['createdAt'])[_0x4601('0x4a')](_0x4601('0x4b'))[_0x4601('0x57')](),'sender':_0xccfc3d['direction']===_0x4601('0x75')?_0xccfc3d['User']?_0xccfc3d[_0x4601('0x5d')][_0x4601('0x5e')]:_0x4601('0x76'):_0xccfc3d['Contact'][_0x4601('0x62')]+(_0xccfc3d[_0x4601('0x61')][_0x4601('0x63')]?'\x20'+_0xccfc3d['Contact']['lastName']:''),'body':_0xccfc3d['Attachment']?_0xccfc3d[_0x4601('0x64')]['basename']:_0xccfc3d[_0x4601('0x36')],'direction':_0xccfc3d['direction']===_0x4601('0x75')?'A':'C','secret':_0xccfc3d[_0x4601('0x77')],'read':_0xccfc3d[_0x4601('0x68')],'attachment':_0xccfc3d[_0x4601('0x64')]};})['value']()};return ejs[_0x4601('0x78')](path[_0x4601('0x58')](config[_0x4601('0x59')],'server',_0x4601('0x79'),'downloadInteraction.ejs'),{'interaction':_0x33de84})[_0x4601('0x1a')](function(_0x31265c){var _0x7e2280=path[_0x4601('0x58')](_0x372618,'transcript-'+_0x1c29a0['id']+'-'+_0x4b67d2+_0x4601('0x7a'));var _0x3cf3ae={'path':_0x7e2280,'channel':_0x4601('0x6e'),'interactionId':_0x1c29a0['id']};return pdf[_0x4601('0x7b')](_0x31265c,_0x3cf3ae);})[_0x4601('0x1a')](function(){return new BPromise(function(_0xe389fa,_0x4959c0){zipdir(_0x372618,{'saveTo':_0x4da1f9},function(_0x2b58fa,_0x2be4f0){if(_0x2b58fa)return _0x4959c0(_0x2b58fa);return _0xe389fa(_0x2be4f0);});})[_0x4601('0x1a')](function(){return new BPromise(function(_0x52d21c,_0x1e3512){rimraf(_0x372618,function(_0x5859f2){if(_0x5859f2)_0x1e3512(_0x5859f2);return _0x52d21c();});});})[_0x4601('0x1a')](function(){return _0x43f607[_0x4601('0x55')](_0x4da1f9,_0x5320a3,function(_0x2ab60b){if(_0x2ab60b){console[_0x4601('0x7c')](_0x4601('0x7d'),_0x2ab60b);}else{fs[_0x4601('0x7e')](_0x4da1f9);}});});});}else{return _0x43f607[_0x4601('0x10')](0xc8);}})[_0x4601('0x29')](handleError(_0x43f607,null));}; \ No newline at end of file +var _0xb6d8=['options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','removeTags','download','root','server','files','tmp','join','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','createdAt','toString','closed','disposition','basename','existsSync','pipe','createWriteStream','out','value','views','transcript-','.pdf','log','err','unlinkSync','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x195cba,_0x18bedd){var _0x9f0891=function(_0xc17c28){while(--_0xc17c28){_0x195cba['push'](_0x195cba['shift']());}};_0x9f0891(++_0x18bedd);}(_0xb6d8,0x1c1));var _0x8b6d=function(_0x3f324a,_0x4d6b9d){_0x3f324a=_0x3f324a-0x0;var _0x5ffe02=_0xb6d8[_0x3f324a];return _0x5ffe02;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x8b6d('0x0'));var BPromise=require(_0x8b6d('0x1'));var util=require(_0x8b6d('0x2'));var path=require(_0x8b6d('0x3'));var ejs=require(_0x8b6d('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x8b6d('0x5'));var interaction=require(_0x8b6d('0x6'));var qs=require(_0x8b6d('0x7'));var pdf=require(_0x8b6d('0x8'));var logger=require('../../config/logger')(_0x8b6d('0x9'));var config=require(_0x8b6d('0xa'));var db=require('../../mysqldb')['db'];config[_0x8b6d('0xb')]=_[_0x8b6d('0xc')](config[_0x8b6d('0xb')],{'host':_0x8b6d('0xd'),'port':0x18eb});var socket=require(_0x8b6d('0xe'))(new Redis(config[_0x8b6d('0xb')]));require(_0x8b6d('0xf'))[_0x8b6d('0x10')](socket);function respondWithStatusCode(_0x166188,_0x1abc12){_0x1abc12=_0x1abc12||0xcc;return function(_0xa6a8c0){if(_0xa6a8c0){return _0x166188[_0x8b6d('0x11')](_0x1abc12);}return _0x166188[_0x8b6d('0x12')](_0x1abc12)[_0x8b6d('0x13')]();};}function respondWithResult(_0x37c700,_0x5636b7){_0x5636b7=_0x5636b7||0xc8;return function(_0x5d330a){if(_0x5d330a){return _0x37c700[_0x8b6d('0x12')](_0x5636b7)[_0x8b6d('0x14')](_0x5d330a);}};}function respondWithFilteredResult(_0x55cf4c,_0x5cda9a){return function(_0x42c4f7){if(_0x42c4f7){var _0x4fc66b=typeof _0x5cda9a[_0x8b6d('0x15')]===_0x8b6d('0x16')&&typeof _0x5cda9a[_0x8b6d('0x17')]===_0x8b6d('0x16');var _0x44c2c7=_0x42c4f7[_0x8b6d('0x18')];var _0x54b7a3=_0x4fc66b?0x0:_0x5cda9a[_0x8b6d('0x15')];var _0x49b976=_0x4fc66b?_0x42c4f7['count']:_0x5cda9a[_0x8b6d('0x15')]+_0x5cda9a[_0x8b6d('0x17')];var _0x1bb01f;if(_0x49b976>=_0x44c2c7){_0x49b976=_0x44c2c7;_0x1bb01f=0xc8;}else{_0x1bb01f=0xce;}_0x55cf4c[_0x8b6d('0x12')](_0x1bb01f);return _0x55cf4c[_0x8b6d('0x19')](_0x8b6d('0x1a'),_0x54b7a3+'-'+_0x49b976+'/'+_0x44c2c7)['json'](_0x42c4f7);}return null;};}function saveUpdates(_0xe00046){return function(_0x48e7aa){if(_0x48e7aa){return _0x48e7aa[_0x8b6d('0x1b')](_0xe00046)[_0x8b6d('0x1c')](function(_0x2f0a4d){return _0x2f0a4d;});}return null;};}function removeEntity(_0x100362){return function(_0x1cdea3){if(_0x1cdea3){return _0x1cdea3[_0x8b6d('0x1d')]()[_0x8b6d('0x1c')](function(){_0x100362['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f19d6){return function(_0x3b59be){if(!_0x3b59be){_0x5f19d6[_0x8b6d('0x11')](0x194);}return _0x3b59be;};}function handleError(_0x1b062c,_0x40a2d4){_0x40a2d4=_0x40a2d4||0x1f4;return function(_0xbd6b45){logger[_0x8b6d('0x1e')](_0xbd6b45['stack']);if(_0xbd6b45[_0x8b6d('0x1f')]){delete _0xbd6b45['name'];}_0x1b062c[_0x8b6d('0x12')](_0x40a2d4)[_0x8b6d('0x20')](_0xbd6b45);};}exports[_0x8b6d('0x21')]=function(_0x57ad26,_0x3427bb){var _0x255011={};var _0x36d4ac=_['map'](db[_0x8b6d('0x22')][_0x8b6d('0x23')],function(_0x569588){return{'name':_0x569588[_0x8b6d('0x24')],'type':_0x569588[_0x8b6d('0x25')][_0x8b6d('0x26')]};});_0x255011=qs[_0x8b6d('0x27')](_0x36d4ac,_0x57ad26);return interaction['findAll'](_0x8b6d('0x28'),_0x57ad26[_0x8b6d('0x29')],_0x57ad26[_0x8b6d('0x2a')],_0x255011,_0x36d4ac)[_0x8b6d('0x1c')](respondWithFilteredResult(_0x3427bb,_0x255011))[_0x8b6d('0x2b')](handleError(_0x3427bb,null));};exports[_0x8b6d('0x2c')]=function(_0x4498de,_0x333fe7){var _0x2cc692={'raw':![],'where':{'id':_0x4498de['params']['id']}},_0x311d5b={};_0x311d5b[_0x8b6d('0x2d')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x311d5b[_0x8b6d('0x29')]=_[_0x8b6d('0x2e')](_0x4498de[_0x8b6d('0x29')]);_0x311d5b[_0x8b6d('0x2f')]=_[_0x8b6d('0x30')](_0x311d5b[_0x8b6d('0x2d')],_0x311d5b['query']);_0x2cc692[_0x8b6d('0x31')]=_[_0x8b6d('0x30')](_0x311d5b[_0x8b6d('0x2d')],qs[_0x8b6d('0x32')](_0x4498de[_0x8b6d('0x29')][_0x8b6d('0x32')]));_0x2cc692[_0x8b6d('0x31')]=_0x2cc692[_0x8b6d('0x31')][_0x8b6d('0x33')]?_0x2cc692[_0x8b6d('0x31')]:_0x311d5b['model'];if(_0x4498de['query'][_0x8b6d('0x34')]){_0x2cc692[_0x8b6d('0x35')]=[{'all':!![]}];}_0x2cc692=_[_0x8b6d('0x36')]({},_0x2cc692,_0x4498de[_0x8b6d('0x37')]);return db[_0x8b6d('0x22')][_0x8b6d('0x38')](_0x2cc692)['then'](handleEntityNotFound(_0x333fe7,null))[_0x8b6d('0x1c')](respondWithResult(_0x333fe7,null))['catch'](handleError(_0x333fe7,null));};exports[_0x8b6d('0x39')]=function(_0x1e6417,_0x58ac75){return db[_0x8b6d('0x22')]['create'](_0x1e6417[_0x8b6d('0x3a')],{})['then'](respondWithResult(_0x58ac75,0xc9))[_0x8b6d('0x2b')](handleError(_0x58ac75,null));};exports[_0x8b6d('0x1b')]=function(_0x3828a2,_0x231e44){if(_0x3828a2[_0x8b6d('0x3a')]['id']){delete _0x3828a2[_0x8b6d('0x3a')]['id'];}return db[_0x8b6d('0x22')][_0x8b6d('0x38')]({'where':{'id':_0x3828a2['params']['id']}})[_0x8b6d('0x1c')](handleEntityNotFound(_0x231e44,null))[_0x8b6d('0x1c')](saveUpdates(_0x3828a2['body'],null))[_0x8b6d('0x1c')](respondWithResult(_0x231e44,null))[_0x8b6d('0x2b')](handleError(_0x231e44,null));};exports['destroy']=function(_0x4b471f,_0x4911c8){return db[_0x8b6d('0x22')][_0x8b6d('0x38')]({'where':{'id':_0x4b471f[_0x8b6d('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4911c8,null))[_0x8b6d('0x1c')](removeEntity(_0x4911c8,null))[_0x8b6d('0x2b')](handleError(_0x4911c8,null));};exports[_0x8b6d('0x3c')]=function(_0x9a9cfc,_0x183d01){return db[_0x8b6d('0x22')]['describe']()[_0x8b6d('0x1c')](respondWithResult(_0x183d01,null))[_0x8b6d('0x2b')](handleError(_0x183d01,null));};exports[_0x8b6d('0x3d')]=function(_0x22071b,_0x5d0cdc){return db[_0x8b6d('0x3e')][_0x8b6d('0x38')]({'where':{'id':_0x22071b[_0x8b6d('0x3b')]['id']}})[_0x8b6d('0x1c')](handleEntityNotFound(_0x5d0cdc,null))['then'](function(_0x1c0bfd){if(_0x1c0bfd){return _0x1c0bfd[_0x8b6d('0x3d')](_0x22071b[_0x8b6d('0x3a')][_0x8b6d('0x3f')],_[_0x8b6d('0x40')](_0x22071b['body'],[_0x8b6d('0x3f'),'id'])||{});}})[_0x8b6d('0x1c')](respondWithResult(_0x5d0cdc,null))[_0x8b6d('0x2b')](handleError(_0x5d0cdc,null));};exports[_0x8b6d('0x41')]=function(_0x66341f,_0x57903f){var _0x3246e4={'raw':![],'where':{}};var _0x5c60e8={};var _0x1ced64={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8b6d('0x42')]({'where':{'id':_0x66341f[_0x8b6d('0x3b')]['id']}})['then'](handleEntityNotFound(_0x57903f,null))[_0x8b6d('0x1c')](function(_0x44cac3){if(_0x44cac3){_0x5c60e8['model']=_[_0x8b6d('0x2e')](db['WhatsappMessage'][_0x8b6d('0x23')]);_0x5c60e8[_0x8b6d('0x29')]=_[_0x8b6d('0x2e')](_0x66341f[_0x8b6d('0x29')]);_0x5c60e8['filters']=_[_0x8b6d('0x30')](_0x5c60e8[_0x8b6d('0x2d')],_0x5c60e8['query']);_0x3246e4[_0x8b6d('0x31')]=_[_0x8b6d('0x30')](_0x5c60e8[_0x8b6d('0x2d')],qs[_0x8b6d('0x32')](_0x66341f[_0x8b6d('0x29')]['fields']));_0x3246e4[_0x8b6d('0x31')]=_0x3246e4[_0x8b6d('0x31')][_0x8b6d('0x33')]?_0x3246e4[_0x8b6d('0x31')]:_0x5c60e8[_0x8b6d('0x2d')];if(!_0x66341f['query'][_0x8b6d('0x43')](_0x8b6d('0x44'))){_0x3246e4[_0x8b6d('0x17')]=qs[_0x8b6d('0x17')](_0x66341f[_0x8b6d('0x29')][_0x8b6d('0x17')]);_0x3246e4['offset']=qs[_0x8b6d('0x15')](_0x66341f[_0x8b6d('0x29')][_0x8b6d('0x15')]);}_0x3246e4['order']=qs[_0x8b6d('0x45')](_0x66341f[_0x8b6d('0x29')]['sort']);_0x3246e4[_0x8b6d('0x46')]=qs['filters'](_[_0x8b6d('0x47')](_0x66341f['query'],_0x5c60e8[_0x8b6d('0x2f')]));_0x3246e4[_0x8b6d('0x46')]['WhatsappInteractionId']=_0x44cac3['id'];if(_0x66341f[_0x8b6d('0x29')]['filter']){_0x3246e4[_0x8b6d('0x46')]=_[_0x8b6d('0x36')](_0x3246e4[_0x8b6d('0x46')],{'$or':_[_0x8b6d('0x48')](_0x3246e4[_0x8b6d('0x31')],function(_0x280ac5){var _0x2e10ea={};_0x2e10ea[_0x280ac5]={'$like':'%'+_0x66341f[_0x8b6d('0x29')][_0x8b6d('0x49')]+'%'};return _0x2e10ea;})});}if(_0x66341f[_0x8b6d('0x29')][_0x8b6d('0x4a')]){var _0xbc5517=_0x66341f[_0x8b6d('0x29')]['$gte'][_0x8b6d('0x4b')](',');var _0x38f6ad={};_0x38f6ad[_0xbc5517[0x0]]={'$gte':moment(_0xbc5517[0x1])[_0x8b6d('0x4c')](_0x8b6d('0x4d'))};_0x3246e4[_0x8b6d('0x46')]=_[_0x8b6d('0x36')](_0x3246e4[_0x8b6d('0x46')],_0x38f6ad);}_0x3246e4=_[_0x8b6d('0x36')]({},_0x3246e4,_0x66341f['options']);return db['WhatsappMessage'][_0x8b6d('0x18')]({'where':_0x3246e4[_0x8b6d('0x46')]})[_0x8b6d('0x1c')](function(_0x2ba94a){_0x1ced64['count']=_0x2ba94a;if(_0x66341f[_0x8b6d('0x29')]['includeAll']){_0x3246e4[_0x8b6d('0x35')]=[{'all':!![]}];}return db[_0x8b6d('0x3e')][_0x8b6d('0x4e')](_0x3246e4);})[_0x8b6d('0x1c')](function(_0x9f201){_0x1ced64[_0x8b6d('0x4f')]=_0x9f201;return _0x1ced64;});}})[_0x8b6d('0x1c')](respondWithFilteredResult(_0x57903f,_0x3246e4))[_0x8b6d('0x2b')](handleError(_0x57903f,null));};exports[_0x8b6d('0x50')]=function(_0x30c8ef,_0x2cf62c){return db['WhatsappInteraction'][_0x8b6d('0x38')]({'where':{'id':_0x30c8ef['params']['id']}})[_0x8b6d('0x1c')](handleEntityNotFound(_0x2cf62c,null))[_0x8b6d('0x1c')](function(_0x5445d5){if(_0x5445d5){return _0x5445d5[_0x8b6d('0x51')](_0x30c8ef['body'][_0x8b6d('0x3f')],_['omit'](_0x30c8ef[_0x8b6d('0x3a')],['ids','id'])||{})[_0x8b6d('0x52')](function(){return db[_0x8b6d('0x53')][_0x8b6d('0x4e')]({'attributes':['id','name','color'],'where':{'id':_0x30c8ef['body'][_0x8b6d('0x3f')]}});})[_0x8b6d('0x1c')](function(_0x4c7ec5){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x30c8ef['params']['id']),'tags':_0x4c7ec5||[]});return{'id':Number(_0x30c8ef['params']['id']),'tags':_0x4c7ec5||[]};});}})[_0x8b6d('0x1c')](respondWithResult(_0x2cf62c,null))[_0x8b6d('0x2b')](handleError(_0x2cf62c,null));};exports[_0x8b6d('0x54')]=function(_0x299dd4,_0x58a318){return db[_0x8b6d('0x22')][_0x8b6d('0x38')]({'where':{'id':_0x299dd4[_0x8b6d('0x3b')]['id']}})[_0x8b6d('0x1c')](handleEntityNotFound(_0x58a318,null))[_0x8b6d('0x1c')](function(_0x26ec7b){if(_0x26ec7b){return _0x26ec7b[_0x8b6d('0x54')](_0x299dd4['query'][_0x8b6d('0x3f')]);}})[_0x8b6d('0x1c')](respondWithStatusCode(_0x58a318,null))[_0x8b6d('0x2b')](handleError(_0x58a318,null));};exports[_0x8b6d('0x55')]=function(_0x3acf9c,_0xc51658){var _0x113403=moment()['unix']()['toString']();var _0x6dbcd8=path['join'](config[_0x8b6d('0x56')],_0x8b6d('0x57'),_0x8b6d('0x58'),_0x8b6d('0x59'));var _0x192881=path[_0x8b6d('0x5a')](config['root'],_0x8b6d('0x57'),_0x8b6d('0x58'),_0x8b6d('0x5b'));var _0x1ee27f=path[_0x8b6d('0x5a')](_0x6dbcd8,_0x113403);var _0x45aa97=util['format']('transcript-%d-%s.zip',_0x3acf9c['params']['id'],_0x113403);var _0x8ffb01=path[_0x8b6d('0x5a')](_0x6dbcd8,_0x45aa97);var _0x53aacc=[];_0x53aacc[_0x8b6d('0x5c')]({'model':db[_0x8b6d('0x5d')],'as':_0x8b6d('0x5d'),'attributes':['id',_0x8b6d('0x5e')],'raw':!![]});_0x53aacc[_0x8b6d('0x5c')]({'model':db[_0x8b6d('0x5f')],'as':_0x8b6d('0x60'),'attributes':['id',_0x8b6d('0x61'),_0x8b6d('0x62')],'raw':!![]});if(_0x3acf9c[_0x8b6d('0x29')][_0x8b6d('0x5b')]){_0x53aacc[_0x8b6d('0x5c')]({'model':db[_0x8b6d('0x63')],'as':_0x8b6d('0x63'),'raw':!![]});}var _0x2d1636=[{'model':db[_0x8b6d('0x3e')],'as':_0x8b6d('0x64'),'attributes':['id',_0x8b6d('0x3a'),'createdAt',_0x8b6d('0x65'),_0x8b6d('0x66'),_0x8b6d('0x67')],'include':_0x53aacc}];_0x2d1636[_0x8b6d('0x5c')]({'model':db[_0x8b6d('0x68')],'as':_0x8b6d('0x69'),'attributes':['id',_0x8b6d('0x1f')]});_0x2d1636[_0x8b6d('0x5c')]({'model':db[_0x8b6d('0x5d')],'as':_0x8b6d('0x6a'),'attributes':['id',_0x8b6d('0x5e')]});return db[_0x8b6d('0x22')]['find']({'where':{'id':_0x3acf9c[_0x8b6d('0x3b')]['id']},'include':_0x2d1636})[_0x8b6d('0x1c')](handleEntityNotFound(_0xc51658,null))['then'](function(_0x2162e3){if(_0x2162e3){var _0x339f20=_0x2162e3['get']({'plain':!![]});fs[_0x8b6d('0x6b')](_0x1ee27f);var _0x391bd3={'channel':_0x8b6d('0x6c'),'account':_0x339f20[_0x8b6d('0x69')][_0x8b6d('0x1f')],'agent':_0x339f20[_0x8b6d('0x6a')]?_0x339f20[_0x8b6d('0x6a')][_0x8b6d('0x5e')]:_0x8b6d('0x6d'),'createdAt':moment(_0x339f20[_0x8b6d('0x6e')])[_0x8b6d('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8b6d('0x6f')](),'closedAt':_0x339f20[_0x8b6d('0x70')]?moment(_0x339f20['closedAt'])['format'](_0x8b6d('0x4d'))[_0x8b6d('0x6f')]():'','disposition':_0x339f20[_0x8b6d('0x71')],'messages':_(_0x339f20['Messages'])[_0x8b6d('0x49')]({'secret':![]})[_0x8b6d('0x48')](function(_0x47362e){if(_0x47362e['Attachment']){var _0x581a4a=path['join'](_0x192881,_0x47362e[_0x8b6d('0x63')][_0x8b6d('0x72')]);if(fs[_0x8b6d('0x73')](_0x581a4a)){fs['createReadStream'](_0x581a4a)[_0x8b6d('0x74')](fs[_0x8b6d('0x75')](path[_0x8b6d('0x5a')](_0x1ee27f,_0x47362e[_0x8b6d('0x63')]['basename'])));}}return{'date':moment(_0x47362e[_0x8b6d('0x6e')])['format'](_0x8b6d('0x4d'))['toString'](),'sender':_0x47362e[_0x8b6d('0x65')]==='out'?_0x47362e[_0x8b6d('0x5d')]?_0x47362e['User'][_0x8b6d('0x5e')]:'System':_0x47362e['Contact'][_0x8b6d('0x61')]+(_0x47362e[_0x8b6d('0x60')][_0x8b6d('0x62')]?'\x20'+_0x47362e['Contact'][_0x8b6d('0x62')]:''),'body':_0x47362e[_0x8b6d('0x63')]?_0x47362e['Attachment'][_0x8b6d('0x72')]:_0x47362e[_0x8b6d('0x3a')],'direction':_0x47362e[_0x8b6d('0x65')]===_0x8b6d('0x76')?'A':'C','secret':_0x47362e[_0x8b6d('0x66')],'read':_0x47362e['read'],'attachment':_0x47362e['Attachment']};})[_0x8b6d('0x77')]()};return ejs['renderFile'](path[_0x8b6d('0x5a')](config[_0x8b6d('0x56')],_0x8b6d('0x57'),_0x8b6d('0x78'),'downloadInteraction.ejs'),{'interaction':_0x391bd3})[_0x8b6d('0x1c')](function(_0x37e357){var _0x1cdf2e=path[_0x8b6d('0x5a')](_0x1ee27f,_0x8b6d('0x79')+_0x339f20['id']+'-'+_0x113403+_0x8b6d('0x7a'));var _0x2db452={'path':_0x1cdf2e,'channel':_0x8b6d('0x6c'),'interactionId':_0x339f20['id']};return pdf['createPdfFromHTML'](_0x37e357,_0x2db452);})[_0x8b6d('0x1c')](function(){return new BPromise(function(_0x93fabf,_0x23f922){zipdir(_0x1ee27f,{'saveTo':_0x8ffb01},function(_0x26cd63,_0x8d1988){if(_0x26cd63)return _0x23f922(_0x26cd63);return _0x93fabf(_0x8d1988);});})[_0x8b6d('0x1c')](function(){return new BPromise(function(_0x2ba9f8,_0x1f706f){rimraf(_0x1ee27f,function(_0x3724cd){if(_0x3724cd)_0x1f706f(_0x3724cd);return _0x2ba9f8();});});})[_0x8b6d('0x1c')](function(){return _0xc51658[_0x8b6d('0x55')](_0x8ffb01,_0x45aa97,function(_0x2a64cd){if(_0x2a64cd){console[_0x8b6d('0x7b')](_0x8b6d('0x7c'),_0x2a64cd);}else{fs[_0x8b6d('0x7d')](_0x8ffb01);}});});});}else{return _0xc51658['sendStatus'](0xc8);}})[_0x8b6d('0x2b')](handleError(_0xc51658,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 69b9eb5..cdb1f12 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 _0x9585=['setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','WhatsappMessage'];(function(_0x55dd55,_0x220b5f){var _0x5774db=function(_0x433ef2){while(--_0x433ef2){_0x55dd55['push'](_0x55dd55['shift']());}};_0x5774db(++_0x220b5f);}(_0x9585,0x15e));var _0x5958=function(_0x128a4e,_0x5b81ba){_0x128a4e=_0x128a4e-0x0;var _0x19db71=_0x9585[_0x128a4e];return _0x19db71;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x5958('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x5958('0x0'))['db'][_0x5958('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5958('0x2')](0x0);var events={'afterCreate':_0x5958('0x3'),'afterUpdate':_0x5958('0x4'),'afterDestroy':_0x5958('0x5')};function emitEvent(_0x28be1b){return function(_0x44ce6d,_0x4ced9f,_0x202d6f){_0x44ce6d['getUsers']({'attributes':['id'],'raw':!![]})[_0x5958('0x6')](function(_0xd655ec){_0x44ce6d[_0x5958('0x7')]('Users',_0xd655ec[_0x5958('0x8')](function(_0x59ff59){return{'id':_0x59ff59['id']};}));return WhatsappMessage[_0x5958('0x9')]({'where':{'WhatsappInteractionId':_0x44ce6d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5958('0x6')](function(_0x5018bf){_0x44ce6d['setDataValue'](_0x5958('0xa'),_0x5018bf[_0x5958('0xb')]);WhatsappInteractionEvents[_0x5958('0xc')](_0x28be1b+':'+_0x44ce6d['id'],_0x44ce6d);WhatsappInteractionEvents[_0x5958('0xc')](_0x28be1b,_0x44ce6d);_0x202d6f(null);})[_0x5958('0xd')](_0x202d6f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x5958('0xe')](e,emitEvent(event));}}module[_0x5958('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3d15=['findAll','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users'];(function(_0x294790,_0x514a64){var _0x222658=function(_0xce1f50){while(--_0xce1f50){_0x294790['push'](_0x294790['shift']());}};_0x222658(++_0x514a64);}(_0x3d15,0x127));var _0x53d1=function(_0x275f4a,_0x2077d4){_0x275f4a=_0x275f4a-0x0;var _0x4b4a21=_0x3d15[_0x275f4a];return _0x4b4a21;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x53d1('0x0'))['db'][_0x53d1('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x53d1('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x53d1('0x3')](0x0);var events={'afterCreate':_0x53d1('0x4'),'afterUpdate':'update','afterDestroy':_0x53d1('0x5')};function emitEvent(_0x462ede){return function(_0x445c55,_0x55171f,_0x3b3e81){_0x445c55[_0x53d1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8abe67){_0x445c55[_0x53d1('0x7')](_0x53d1('0x8'),_0x8abe67['map'](function(_0x328eb3){return{'id':_0x328eb3['id']};}));return WhatsappMessage[_0x53d1('0x9')]({'where':{'WhatsappInteractionId':_0x445c55['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x506185){_0x445c55[_0x53d1('0x7')]('unreadMessages',_0x506185[_0x53d1('0xa')]);WhatsappInteractionEvents[_0x53d1('0xb')](_0x462ede+':'+_0x445c55['id'],_0x445c55);WhatsappInteractionEvents[_0x53d1('0xb')](_0x462ede,_0x445c55);_0x3b3e81(null);})[_0x53d1('0xc')](_0x3b3e81(null));};}for(var e in events){if(events[_0x53d1('0xd')](e)){var event=events[e];WhatsappInteraction[_0x53d1('0xe')](e,emitEvent(event));}}module[_0x53d1('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e5a5676..a320327 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 _0x61e4=['../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2417c3,_0x2c4f59){var _0x36899a=function(_0x30b7d4){while(--_0x30b7d4){_0x2417c3['push'](_0x2417c3['shift']());}};_0x36899a(++_0x2c4f59);}(_0x61e4,0x71));var _0x461e=function(_0x441db3,_0x10f359){_0x441db3=_0x441db3-0x0;var _0x16c05d=_0x61e4[_0x441db3];return _0x16c05d;};'use strict';var _=require(_0x461e('0x0'));var util=require(_0x461e('0x1'));var logger=require(_0x461e('0x2'))(_0x461e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x461e('0x4'));var fs=require('fs');var path=require(_0x461e('0x5'));var rimraf=require(_0x461e('0x6'));var config=require(_0x461e('0x7'));var attributes=require(_0x461e('0x8'));module[_0x461e('0x9')]=function(_0x35103c,_0x9efa62){return _0x35103c[_0x461e('0xa')](_0x461e('0xb'),attributes,{'tableName':_0x461e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25140f,_0x3698a3,_0x5b98ca){if(_0x25140f['changed']('closed')){_0x25140f['closedAt']=moment()[_0x461e('0xd')](_0x461e('0xe'));}_0x5b98ca(null,_0x25140f);}}});}; \ No newline at end of file +var _0xa3c3=['./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x149122,_0x3531da){var _0x44b5f1=function(_0xe0f24b){while(--_0xe0f24b){_0x149122['push'](_0x149122['shift']());}};_0x44b5f1(++_0x3531da);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x2ed9f4,_0x40e9f5){_0x2ed9f4=_0x2ed9f4-0x0;var _0x32c8e7=_0xa3c3[_0x2ed9f4];return _0x32c8e7;};'use strict';var _=require(_0x3a3c('0x0'));var util=require('util');var logger=require(_0x3a3c('0x1'))('api');var moment=require(_0x3a3c('0x2'));var BPromise=require('bluebird');var rp=require(_0x3a3c('0x3'));var fs=require('fs');var path=require(_0x3a3c('0x4'));var rimraf=require('rimraf');var config=require(_0x3a3c('0x5'));var attributes=require(_0x3a3c('0x6'));module[_0x3a3c('0x7')]=function(_0x1b4fc1,_0x5600b3){return _0x1b4fc1['define'](_0x3a3c('0x8'),attributes,{'tableName':_0x3a3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32f0f3,_0x320953,_0x3298b7){if(_0x32f0f3['changed'](_0x3a3c('0xa'))){_0x32f0f3[_0x3a3c('0xb')]=moment()[_0x3a3c('0xc')](_0x3a3c('0xd'));}_0x3298b7(null,_0x32f0f3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 2671f77..17d64a9 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 _0x8a6c=['omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateWhatsappInteraction','update','body','options','raw','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','addTags','ids'];(function(_0x32c40c,_0x5a48c1){var _0x56e979=function(_0x4ed72a){while(--_0x4ed72a){_0x32c40c['push'](_0x32c40c['shift']());}};_0x56e979(++_0x5a48c1);}(_0x8a6c,0xa7));var _0xc8a6=function(_0x599929,_0x466c1a){_0x599929=_0x599929-0x0;var _0x30d427=_0x8a6c[_0x599929];return _0x30d427;};'use strict';var _=require(_0xc8a6('0x0'));var util=require(_0xc8a6('0x1'));var moment=require(_0xc8a6('0x2'));var BPromise=require(_0xc8a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8a6('0x5'));var logger=require(_0xc8a6('0x6'))(_0xc8a6('0x7'));var config=require(_0xc8a6('0x8'));var jayson=require(_0xc8a6('0x9'));var client=jayson['client'][_0xc8a6('0xa')]({'port':0x232a});config[_0xc8a6('0xb')]=_['defaults'](config[_0xc8a6('0xb')],{'host':_0xc8a6('0xc'),'port':0x18eb});var socket=require(_0xc8a6('0xd'))(new Redis(config[_0xc8a6('0xb')]));require(_0xc8a6('0xe'))[_0xc8a6('0xf')](socket);function respondWithRpcPromise(_0x151e14,_0x354ff0,_0x5d6635){return new BPromise(function(_0x31377a,_0x41379c){return client[_0xc8a6('0x10')](_0x151e14,_0x5d6635)[_0xc8a6('0x11')](function(_0x7e33){logger[_0xc8a6('0x12')](_0xc8a6('0x13'),_0x354ff0,_0xc8a6('0x14'));logger[_0xc8a6('0x15')](_0xc8a6('0x16'),_0x354ff0,_0xc8a6('0x14'),JSON['stringify'](_0x7e33));if(_0x7e33[_0xc8a6('0x17')]){if(_0x7e33[_0xc8a6('0x17')]['code']===0x1f4){logger[_0xc8a6('0x17')](_0xc8a6('0x13'),_0x354ff0,_0x7e33[_0xc8a6('0x17')][_0xc8a6('0x18')]);return _0x41379c(_0x7e33['error'][_0xc8a6('0x18')]);}logger[_0xc8a6('0x17')](_0xc8a6('0x13'),_0x354ff0,_0x7e33[_0xc8a6('0x17')][_0xc8a6('0x18')]);return _0x31377a(_0x7e33[_0xc8a6('0x17')][_0xc8a6('0x18')]);}else{logger['info'](_0xc8a6('0x13'),_0x354ff0,'request\x20sent');_0x31377a(_0x7e33[_0xc8a6('0x19')][_0xc8a6('0x18')]);}})['catch'](function(_0x302c3b){logger['error'](_0xc8a6('0x13'),_0x354ff0,_0x302c3b);_0x41379c(_0x302c3b);});});}exports[_0xc8a6('0x1a')]=function(_0x14374d){var _0x161654=this;return new Promise(function(_0x27d15b,_0x186e63){return db['WhatsappInteraction'][_0xc8a6('0x1b')](_0x14374d[_0xc8a6('0x1c')],{'raw':_0x14374d[_0xc8a6('0x1d')]?_0x14374d[_0xc8a6('0x1d')][_0xc8a6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14374d[_0xc8a6('0x1d')]?_0x14374d[_0xc8a6('0x1d')]['where']||null:null,'attributes':_0x14374d[_0xc8a6('0x1d')]?_0x14374d[_0xc8a6('0x1d')]['attributes']||null:null,'limit':_0x14374d[_0xc8a6('0x1d')]?_0x14374d[_0xc8a6('0x1d')]['limit']||null:null})[_0xc8a6('0x11')](function(_0x2d8c65){logger['info'](_0xc8a6('0x1a'),_0x14374d);logger[_0xc8a6('0x15')](_0xc8a6('0x1a'),_0x14374d,JSON['stringify'](_0x2d8c65));_0x27d15b(_0x2d8c65);})[_0xc8a6('0x1f')](function(_0x25bb82){logger[_0xc8a6('0x17')](_0xc8a6('0x1a'),_0x25bb82[_0xc8a6('0x18')],_0x14374d);_0x186e63(_0x161654[_0xc8a6('0x17')](0x1f4,_0x25bb82[_0xc8a6('0x18')]));});});};exports[_0xc8a6('0x20')]=function(_0x4e915f){return new Promise(function(_0x512d6a,_0x10a2bb){return db[_0xc8a6('0x21')][_0xc8a6('0x22')]({'where':_0x4e915f[_0xc8a6('0x1d')]?_0x4e915f[_0xc8a6('0x1d')][_0xc8a6('0x23')]||null:null})['then'](function(_0x279b42){if(_0x279b42){return _0x279b42[_0xc8a6('0x24')](_0x4e915f['body'][_0xc8a6('0x25')],_[_0xc8a6('0x26')](_0x4e915f['body'],[_0xc8a6('0x25'),'id'])||{});}})[_0xc8a6('0x27')](function(_0x261341){logger[_0xc8a6('0x12')]('AddTags',_0x4e915f);logger['debug'](_0xc8a6('0x28'),_0x4e915f,JSON['stringify'](_0x261341));_0x512d6a(_0x261341);})[_0xc8a6('0x1f')](function(_0x190271){logger[_0xc8a6('0x17')]('AddTags',_0x190271[_0xc8a6('0x18')],_0x4e915f);_0x10a2bb(_this['error'](0x1f4,_0x190271['message']));});});}; \ No newline at end of file +var _0x5646=['message','catch','WhatsappInteraction','body','options','raw','where','UpdateWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5646,0x111));var _0x6564=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x5646[_0x52096b];return _0x2b1cc7;};'use strict';var _=require('lodash');var util=require(_0x6564('0x0'));var moment=require(_0x6564('0x1'));var BPromise=require(_0x6564('0x2'));var rs=require(_0x6564('0x3'));var fs=require('fs');var Redis=require(_0x6564('0x4'));var db=require(_0x6564('0x5'))['db'];var utils=require(_0x6564('0x6'));var logger=require(_0x6564('0x7'))(_0x6564('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6564('0x9')]({'port':0x232a});config[_0x6564('0xa')]=_[_0x6564('0xb')](config[_0x6564('0xa')],{'host':_0x6564('0xc'),'port':0x18eb});var socket=require(_0x6564('0xd'))(new Redis(config['redis']));require(_0x6564('0xe'))['register'](socket);function respondWithRpcPromise(_0x111490,_0x545a32,_0x213060){return new BPromise(function(_0x35cedc,_0x23183a){return client['request'](_0x111490,_0x213060)[_0x6564('0xf')](function(_0x229e5b){logger[_0x6564('0x10')](_0x6564('0x11'),_0x545a32,_0x6564('0x12'));logger[_0x6564('0x13')](_0x6564('0x14'),_0x545a32,_0x6564('0x12'),JSON[_0x6564('0x15')](_0x229e5b));if(_0x229e5b[_0x6564('0x16')]){if(_0x229e5b[_0x6564('0x16')]['code']===0x1f4){logger[_0x6564('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x545a32,_0x229e5b[_0x6564('0x16')][_0x6564('0x17')]);return _0x23183a(_0x229e5b[_0x6564('0x16')][_0x6564('0x17')]);}logger[_0x6564('0x16')](_0x6564('0x11'),_0x545a32,_0x229e5b['error'][_0x6564('0x17')]);return _0x35cedc(_0x229e5b[_0x6564('0x16')]['message']);}else{logger[_0x6564('0x10')](_0x6564('0x11'),_0x545a32,_0x6564('0x12'));_0x35cedc(_0x229e5b['result']['message']);}})[_0x6564('0x18')](function(_0x4381d8){logger[_0x6564('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x545a32,_0x4381d8);_0x23183a(_0x4381d8);});});}exports['UpdateWhatsappInteraction']=function(_0x153116){var _0x4c126d=this;return new Promise(function(_0x5d1421,_0x4778e6){return db[_0x6564('0x19')]['update'](_0x153116[_0x6564('0x1a')],{'raw':_0x153116['options']?_0x153116[_0x6564('0x1b')][_0x6564('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153116[_0x6564('0x1b')]?_0x153116[_0x6564('0x1b')][_0x6564('0x1d')]||null:null,'attributes':_0x153116[_0x6564('0x1b')]?_0x153116[_0x6564('0x1b')]['attributes']||null:null,'limit':_0x153116[_0x6564('0x1b')]?_0x153116[_0x6564('0x1b')]['limit']||null:null})['then'](function(_0x3b79e4){logger['info']('UpdateWhatsappInteraction',_0x153116);logger[_0x6564('0x13')](_0x6564('0x1e'),_0x153116,JSON[_0x6564('0x15')](_0x3b79e4));_0x5d1421(_0x3b79e4);})['catch'](function(_0x16dad7){logger[_0x6564('0x16')](_0x6564('0x1e'),_0x16dad7[_0x6564('0x17')],_0x153116);_0x4778e6(_0x4c126d[_0x6564('0x16')](0x1f4,_0x16dad7[_0x6564('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x277997){return new Promise(function(_0x17484c,_0x41ab0c){return db[_0x6564('0x19')][_0x6564('0x1f')]({'where':_0x277997[_0x6564('0x1b')]?_0x277997['options'][_0x6564('0x1d')]||null:null})[_0x6564('0xf')](function(_0x48a2c3){if(_0x48a2c3){return _0x48a2c3[_0x6564('0x20')](_0x277997[_0x6564('0x1a')]['ids'],_[_0x6564('0x21')](_0x277997[_0x6564('0x1a')],[_0x6564('0x22'),'id'])||{});}})[_0x6564('0x23')](function(_0x115389){logger[_0x6564('0x10')](_0x6564('0x24'),_0x277997);logger[_0x6564('0x13')](_0x6564('0x24'),_0x277997,JSON['stringify'](_0x115389));_0x17484c(_0x115389);})[_0x6564('0x18')](function(_0xc7a3c0){logger['error'](_0x6564('0x24'),_0xc7a3c0[_0x6564('0x17')],_0x277997);_0x41ab0c(_this['error'](0x1f4,_0xc7a3c0[_0x6564('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index efe6908..67a7592 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 _0xe23c=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe23c,0xca));var _0xce23=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe23c[_0x27af45];return _0x18df21;};'use strict';var WhatsappInteractionEvents=require(_0xce23('0x0'));var events=['save',_0xce23('0x1'),'update'];function createListener(_0x215dd3,_0x18cef3){return function(_0x4fd8c8){_0x18cef3[_0xce23('0x2')](_0x215dd3,_0x4fd8c8);};}function removeListener(_0x452f8e,_0x4a33d5){return function(){WhatsappInteractionEvents[_0xce23('0x3')](_0x452f8e,_0x4a33d5);};}exports['register']=function(_0x16e4f2){for(var _0x334806=0x0,_0x3955be=events[_0xce23('0x4')];_0x334806<_0x3955be;_0x334806++){var _0x90fbef=events[_0x334806];var _0x75c347=createListener(_0xce23('0x5')+_0x90fbef,_0x16e4f2);WhatsappInteractionEvents['on'](_0x90fbef,_0x75c347);}}; \ No newline at end of file +var _0xb6fb=['register','whatsappInteraction:','update','emit','removeListener'];(function(_0x2ebfd4,_0x4b1ab1){var _0x3a2e74=function(_0x4c3de5){while(--_0x4c3de5){_0x2ebfd4['push'](_0x2ebfd4['shift']());}};_0x3a2e74(++_0x4b1ab1);}(_0xb6fb,0x1ec));var _0xbb6f=function(_0x2c4a43,_0xb2bd59){_0x2c4a43=_0x2c4a43-0x0;var _0x5dc77a=_0xb6fb[_0x2c4a43];return _0x5dc77a;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0xbb6f('0x0')];function createListener(_0x1422e4,_0x1f1018){return function(_0x48b7d0){_0x1f1018[_0xbb6f('0x1')](_0x1422e4,_0x48b7d0);};}function removeListener(_0x56e53e,_0x3a80c6){return function(){WhatsappInteractionEvents[_0xbb6f('0x2')](_0x56e53e,_0x3a80c6);};}exports[_0xbb6f('0x3')]=function(_0x57603e){for(var _0x2260a2=0x0,_0x5714ff=events['length'];_0x2260a2<_0x5714ff;_0x2260a2++){var _0x32ce8f=events[_0x2260a2];var _0x204696=createListener(_0xbb6f('0x4')+_0x32ce8f,_0x57603e);WhatsappInteractionEvents['on'](_0x32ce8f,_0x204696);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0219585..7808e8a 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 _0xe418=['../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1946e4,_0x1c317e){var _0x49a7db=function(_0x9b5c0){while(--_0x9b5c0){_0x1946e4['push'](_0x1946e4['shift']());}};_0x49a7db(++_0x1c317e);}(_0xe418,0xed));var _0x8e41=function(_0x1995fd,_0x335ba3){_0x1995fd=_0x1995fd-0x0;var _0x382303=_0xe418[_0x1995fd];return _0x382303;};'use strict';var multer=require(_0x8e41('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e41('0x1'));var router=express[_0x8e41('0x2')]();var fs_extra=require(_0x8e41('0x3'));var auth=require(_0x8e41('0x4'));var interaction=require(_0x8e41('0x5'));var config=require(_0x8e41('0x6'));var controller=require(_0x8e41('0x7'));router[_0x8e41('0x8')]('/',auth[_0x8e41('0x9')](),controller[_0x8e41('0xa')]);router[_0x8e41('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8e41('0xb')]);router['get'](_0x8e41('0xc'),auth['isAuthenticated'](),controller[_0x8e41('0xd')]);router[_0x8e41('0xe')]('/',auth[_0x8e41('0x9')](),interaction[_0x8e41('0xf')](_0x8e41('0x10'),_0x8e41('0x11')),controller['create']);router[_0x8e41('0xe')](_0x8e41('0x12'),controller[_0x8e41('0x13')]);router[_0x8e41('0x14')](_0x8e41('0xc'),auth[_0x8e41('0x9')](),controller['update']);router[_0x8e41('0x14')](_0x8e41('0x15'),auth[_0x8e41('0x9')](),controller['accept']);router[_0x8e41('0x14')](_0x8e41('0x16'),auth['isAuthenticated'](),controller[_0x8e41('0x17')]);router[_0x8e41('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8e41('0x19')]);module[_0x8e41('0x1a')]=router; \ No newline at end of file +var _0x3f3b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x492133,_0x8cca9f){var _0x4f828f=function(_0x11ea96){while(--_0x11ea96){_0x492133['push'](_0x492133['shift']());}};_0x4f828f(++_0x8cca9f);}(_0x3f3b,0x180));var _0xb3f3=function(_0x4fb5ae,_0x185092){_0x4fb5ae=_0x4fb5ae-0x0;var _0x45201a=_0x3f3b[_0x4fb5ae];return _0x45201a;};'use strict';var multer=require(_0xb3f3('0x0'));var util=require(_0xb3f3('0x1'));var path=require(_0xb3f3('0x2'));var timeout=require(_0xb3f3('0x3'));var express=require(_0xb3f3('0x4'));var router=express[_0xb3f3('0x5')]();var fs_extra=require(_0xb3f3('0x6'));var auth=require(_0xb3f3('0x7'));var interaction=require(_0xb3f3('0x8'));var config=require(_0xb3f3('0x9'));var controller=require(_0xb3f3('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xb3f3('0xb')]);router['get'](_0xb3f3('0xc'),auth[_0xb3f3('0xd')](),controller[_0xb3f3('0xe')]);router[_0xb3f3('0xf')](_0xb3f3('0x10'),auth[_0xb3f3('0xd')](),controller[_0xb3f3('0x11')]);router['post']('/',auth[_0xb3f3('0xd')](),interaction[_0xb3f3('0x12')](_0xb3f3('0x13'),_0xb3f3('0x14')),controller[_0xb3f3('0x15')]);router['post'](_0xb3f3('0x16'),controller[_0xb3f3('0x17')]);router[_0xb3f3('0x18')](_0xb3f3('0x10'),auth['isAuthenticated'](),controller['update']);router['put'](_0xb3f3('0x19'),auth[_0xb3f3('0xd')](),controller['accept']);router['put'](_0xb3f3('0x1a'),auth[_0xb3f3('0xd')](),controller[_0xb3f3('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb3f3('0x1c')]);module[_0xb3f3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index df736bc..3dfe568 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 _0x7857=['BOOLEAN','ENUM','STRING','DATE','TEXT','exports'];(function(_0x430ce1,_0x22d92e){var _0x9f8299=function(_0xafcfa0){while(--_0xafcfa0){_0x430ce1['push'](_0x430ce1['shift']());}};_0x9f8299(++_0x22d92e);}(_0x7857,0x1af));var _0x7785=function(_0x44912,_0x5963df){_0x44912=_0x44912-0x0;var _0x59e400=_0x7857[_0x44912];return _0x59e400;};'use strict';var Sequelize=require('sequelize');module[_0x7785('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7785('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7785('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7785('0x3')](0xbe)},'phone':{'type':Sequelize[_0x7785('0x3')]},'readAt':{'type':Sequelize[_0x7785('0x4')]},'secret':{'type':Sequelize[_0x7785('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7785('0x3')]},'providerResponse':{'type':Sequelize[_0x7785('0x5')]}}; \ No newline at end of file +var _0x65d3=['out','STRING','DATE','BOOLEAN','exports','TEXT','medium','ENUM'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x65d3,0x134));var _0x365d=function(_0x421197,_0x1c3ae7){_0x421197=_0x421197-0x0;var _0x49fb46=_0x65d3[_0x421197];return _0x49fb46;};'use strict';var Sequelize=require('sequelize');module[_0x365d('0x0')]={'body':{'type':Sequelize[_0x365d('0x1')](_0x365d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x365d('0x3')]('in','out'),'defaultValue':_0x365d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x365d('0x5')]},'readAt':{'type':Sequelize[_0x365d('0x6')]},'secret':{'type':Sequelize[_0x365d('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x365d('0x5')]},'providerResponse':{'type':Sequelize[_0x365d('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 85bb67c..52a5917 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 _0x5196=['redis','defaults','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','message','end','status','json','offset','undefined','limit','count','apply','save','update','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','destroy','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','reject','RejectMessage','rejectMessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5196,0x17f));var _0x6519=function(_0x47e7f0,_0x316b99){_0x47e7f0=_0x47e7f0-0x0;var _0x5633db=_0x5196[_0x47e7f0];return _0x5633db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6519('0x0'));var zipdir=require(_0x6519('0x1'));var jsonpatch=require(_0x6519('0x2'));var rp=require(_0x6519('0x3'));var moment=require(_0x6519('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6519('0x5'));var util=require(_0x6519('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6519('0x7'));var ejs=require(_0x6519('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6519('0x9'));var crypto=require(_0x6519('0xa'));var jsforce=require(_0x6519('0xb'));var deskjs=require(_0x6519('0xc'));var toCsv=require(_0x6519('0x7'));var querystring=require(_0x6519('0xd'));var Papa=require('papaparse');var Redis=require(_0x6519('0xe'));var authService=require(_0x6519('0xf'));var qs=require(_0x6519('0x10'));var as=require(_0x6519('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6519('0x12'))(_0x6519('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6519('0x14'));var db=require(_0x6519('0x15'))['db'];config[_0x6519('0x16')]=_[_0x6519('0x17')](config[_0x6519('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x6519('0x18'))(new Redis(config[_0x6519('0x16')]));require('./whatsappMessage.socket')[_0x6519('0x19')](socket);var jayson=require(_0x6519('0x1a'));var client=jayson[_0x6519('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x6519('0x1b')][_0x6519('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x38b148,_0x4d38eb,_0x2b23ca,_0x4d6061){return new BPromise(function(_0x67287,_0x43869a){var _0x431b51=_0x4d6061||client;return _0x431b51[_0x6519('0x1d')](_0x38b148,_0x2b23ca)[_0x6519('0x1e')](function(_0x2054ab){logger[_0x6519('0x1f')](_0x6519('0x20'),_0x4d38eb,_0x6519('0x21'));logger[_0x6519('0x22')](_0x6519('0x23'),_0x4d38eb,_0x6519('0x21'),JSON[_0x6519('0x24')](_0x2054ab));if(_0x2054ab[_0x6519('0x25')]){if(_0x2054ab[_0x6519('0x25')]['code']===0x1f4){logger[_0x6519('0x25')](_0x6519('0x20'),_0x4d38eb,_0x2054ab['error']['message']);return _0x43869a(_0x2054ab[_0x6519('0x25')][_0x6519('0x26')]);}logger[_0x6519('0x25')](_0x6519('0x20'),_0x4d38eb,_0x2054ab['error'][_0x6519('0x26')]);return _0x67287(_0x2054ab[_0x6519('0x25')][_0x6519('0x26')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4d38eb,_0x6519('0x21'));_0x67287(_0x2054ab['result'][_0x6519('0x26')]);}})['catch'](function(_0x37033a){logger[_0x6519('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x4d38eb,_0x37033a);_0x43869a(_0x37033a);});});}function respondWithStatusCode(_0x16e245,_0x564302){_0x564302=_0x564302||0xcc;return function(_0x460468){if(_0x460468){return _0x16e245['sendStatus'](_0x564302);}return _0x16e245['status'](_0x564302)[_0x6519('0x27')]();};}function respondWithResult(_0x244e92,_0xa81eb0){_0xa81eb0=_0xa81eb0||0xc8;return function(_0x147d1a){if(_0x147d1a){return _0x244e92[_0x6519('0x28')](_0xa81eb0)[_0x6519('0x29')](_0x147d1a);}};}function respondWithFilteredResult(_0x192ad0,_0x46b90e){return function(_0x4b9658){if(_0x4b9658){var _0x371cad=typeof _0x46b90e[_0x6519('0x2a')]===_0x6519('0x2b')&&typeof _0x46b90e[_0x6519('0x2c')]===_0x6519('0x2b');var _0x2489a2=_0x4b9658[_0x6519('0x2d')];var _0x233589=_0x371cad?0x0:_0x46b90e[_0x6519('0x2a')];var _0x412a80=_0x371cad?_0x4b9658[_0x6519('0x2d')]:_0x46b90e['offset']+_0x46b90e['limit'];var _0xd061ed;if(_0x412a80>=_0x2489a2){_0x412a80=_0x2489a2;_0xd061ed=0xc8;}else{_0xd061ed=0xce;}_0x192ad0[_0x6519('0x28')](_0xd061ed);return _0x192ad0['set']('Content-Range',_0x233589+'-'+_0x412a80+'/'+_0x2489a2)[_0x6519('0x29')](_0x4b9658);}return null;};}function patchUpdates(_0x2baa18){return function(_0x388e54){try{jsonpatch[_0x6519('0x2e')](_0x388e54,_0x2baa18,!![]);}catch(_0x22cb6c){return BPromise['reject'](_0x22cb6c);}return _0x388e54[_0x6519('0x2f')]();};}function saveUpdates(_0x4a75af,_0x435be0){return function(_0x479bce){if(_0x479bce){return _0x479bce[_0x6519('0x30')](_0x4a75af)[_0x6519('0x1e')](function(_0x5ab5a5){return _0x5ab5a5;});}return null;};}function removeEntity(_0x39b2b5,_0x1b5965){return function(_0x23b94a){if(_0x23b94a){return _0x23b94a['destroy']()[_0x6519('0x1e')](function(){_0x39b2b5['status'](0xcc)[_0x6519('0x27')]();});}};}function handleEntityNotFound(_0x385994,_0x31a388){return function(_0x565d8e){if(!_0x565d8e){_0x385994['sendStatus'](0x194);}return _0x565d8e;};}function handleError(_0x4e5b0a,_0x5f0882){_0x5f0882=_0x5f0882||0x1f4;return function(_0x33219c){logger[_0x6519('0x25')](_0x33219c['stack']);if(_0x33219c['name']){delete _0x33219c[_0x6519('0x31')];}_0x4e5b0a[_0x6519('0x28')](_0x5f0882)[_0x6519('0x32')](_0x33219c);};}exports[_0x6519('0x33')]=function(_0x3e9aac,_0x2d79d3){var _0x5d072c={},_0x22a00b={},_0x3a0971={'count':0x0,'rows':[]};var _0x10b8a4=_[_0x6519('0x34')](db[_0x6519('0x35')][_0x6519('0x36')],function(_0x2d39bc){return{'name':_0x2d39bc[_0x6519('0x37')],'type':_0x2d39bc['type'][_0x6519('0x38')]};});_0x22a00b[_0x6519('0x39')]=_[_0x6519('0x34')](_0x10b8a4,_0x6519('0x31'));_0x22a00b[_0x6519('0x3a')]=_[_0x6519('0x3b')](_0x3e9aac[_0x6519('0x3a')]);_0x22a00b[_0x6519('0x3c')]=_[_0x6519('0x3d')](_0x22a00b[_0x6519('0x39')],_0x22a00b[_0x6519('0x3a')]);_0x5d072c['attributes']=_[_0x6519('0x3d')](_0x22a00b[_0x6519('0x39')],qs['fields'](_0x3e9aac['query'][_0x6519('0x3e')]));_0x5d072c[_0x6519('0x3f')]=_0x5d072c['attributes'][_0x6519('0x40')]?_0x5d072c['attributes']:_0x22a00b[_0x6519('0x39')];if(!_0x3e9aac['query']['hasOwnProperty'](_0x6519('0x41'))){_0x5d072c[_0x6519('0x2c')]=qs[_0x6519('0x2c')](_0x3e9aac[_0x6519('0x3a')][_0x6519('0x2c')]);_0x5d072c[_0x6519('0x2a')]=qs[_0x6519('0x2a')](_0x3e9aac[_0x6519('0x3a')]['offset']);}_0x5d072c['order']=qs[_0x6519('0x42')](_0x3e9aac['query'][_0x6519('0x42')]);_0x5d072c['where']=qs[_0x6519('0x3c')](_[_0x6519('0x43')](_0x3e9aac['query'],_0x22a00b[_0x6519('0x3c')]),_0x10b8a4);if(_0x3e9aac[_0x6519('0x3a')][_0x6519('0x44')]){_0x5d072c[_0x6519('0x45')]=_[_0x6519('0x46')](_0x5d072c[_0x6519('0x45')],{'$or':_['map'](_0x10b8a4,function(_0x3e4718){if(_0x3e4718['type']!==_0x6519('0x47')){var _0x405406={};_0x405406[_0x3e4718[_0x6519('0x31')]]={'$like':'%'+_0x3e9aac[_0x6519('0x3a')]['filter']+'%'};return _0x405406;}})});}_0x5d072c=_['merge']({},_0x5d072c,_0x3e9aac[_0x6519('0x48')]);var _0x56bbef={'where':_0x5d072c['where']};return db[_0x6519('0x35')][_0x6519('0x2d')](_0x56bbef)[_0x6519('0x1e')](function(_0x2b6937){_0x3a0971[_0x6519('0x2d')]=_0x2b6937;if(_0x3e9aac[_0x6519('0x3a')][_0x6519('0x49')]){_0x5d072c['include']=[{'all':!![]}];}return db[_0x6519('0x35')][_0x6519('0x4a')](_0x5d072c);})[_0x6519('0x1e')](function(_0xbffcbe){_0x3a0971[_0x6519('0x4b')]=_0xbffcbe;return _0x3a0971;})[_0x6519('0x1e')](respondWithFilteredResult(_0x2d79d3,_0x5d072c))[_0x6519('0x4c')](handleError(_0x2d79d3,null));};exports['show']=function(_0x53f8e4,_0xb1629d){var _0x137a55={'raw':!![],'where':{'id':_0x53f8e4[_0x6519('0x4d')]['id']}},_0x2f6e43={};_0x2f6e43['model']=_['keys'](db[_0x6519('0x35')][_0x6519('0x36')]);_0x2f6e43[_0x6519('0x3a')]=_['keys'](_0x53f8e4[_0x6519('0x3a')]);_0x2f6e43['filters']=_[_0x6519('0x3d')](_0x2f6e43['model'],_0x2f6e43['query']);_0x137a55[_0x6519('0x3f')]=_[_0x6519('0x3d')](_0x2f6e43[_0x6519('0x39')],qs['fields'](_0x53f8e4[_0x6519('0x3a')][_0x6519('0x3e')]));_0x137a55[_0x6519('0x3f')]=_0x137a55[_0x6519('0x3f')][_0x6519('0x40')]?_0x137a55[_0x6519('0x3f')]:_0x2f6e43[_0x6519('0x39')];if(_0x53f8e4[_0x6519('0x3a')]['includeAll']){_0x137a55['include']=[{'all':!![]}];}_0x137a55=_[_0x6519('0x46')]({},_0x137a55,_0x53f8e4[_0x6519('0x48')]);return db[_0x6519('0x35')][_0x6519('0x4e')](_0x137a55)['then'](handleEntityNotFound(_0xb1629d,null))[_0x6519('0x1e')](respondWithResult(_0xb1629d,null))[_0x6519('0x4c')](handleError(_0xb1629d,null));};exports['create']=function(_0x29cfe1,_0x321e4a){return db[_0x6519('0x35')][_0x6519('0x4f')](_0x29cfe1[_0x6519('0x50')],{})['then'](respondWithResult(_0x321e4a,0xc9))['catch'](handleError(_0x321e4a,null));};exports[_0x6519('0x30')]=function(_0x7e0346,_0x5c7a23){if(_0x7e0346['body']['id']){delete _0x7e0346[_0x6519('0x50')]['id'];}return db['WhatsappMessage'][_0x6519('0x4e')]({'where':{'id':_0x7e0346[_0x6519('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c7a23,null))['then'](saveUpdates(_0x7e0346[_0x6519('0x50')],null))['then'](respondWithResult(_0x5c7a23,null))[_0x6519('0x4c')](handleError(_0x5c7a23,null));};exports[_0x6519('0x51')]=function(_0x18f0f4,_0x1c018f){return db['WhatsappMessage'][_0x6519('0x4e')]({'where':{'id':_0x18f0f4[_0x6519('0x4d')]['id']}})[_0x6519('0x1e')](handleEntityNotFound(_0x1c018f,null))[_0x6519('0x1e')](removeEntity(_0x1c018f,null))[_0x6519('0x4c')](handleError(_0x1c018f,null));};exports[_0x6519('0x52')]=function(_0x4d864f,_0x2999cd){return db['WhatsappMessage'][_0x6519('0x52')]()[_0x6519('0x1e')](respondWithResult(_0x2999cd,null))[_0x6519('0x4c')](handleError(_0x2999cd,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x6519('0x53')]=function(_0x1ef1b3,_0x2564b3,_0x46ec29){var _0x2330c0={'agent':{},'channel':_0x6519('0x54')};if(_0x1ef1b3[_0x6519('0x50')]['id']){delete _0x1ef1b3[_0x6519('0x50')]['id'];}_0x1ef1b3[_0x6519('0x50')][_0x6519('0x55')]=!![];_0x1ef1b3[_0x6519('0x50')][_0x6519('0x56')]=moment()[_0x6519('0x57')](_0x6519('0x58'));_0x1ef1b3['body']['UserId']=_0x1ef1b3['body'][_0x6519('0x59')]||_0x1ef1b3[_0x6519('0x5a')]['id'];_0x2330c0['agent']['id']=_0x1ef1b3[_0x6519('0x50')]['UserId'];return db['WhatsappMessage'][_0x6519('0x4e')]({'where':{'id':_0x1ef1b3[_0x6519('0x4d')]['id'],'UserId':null}})[_0x6519('0x1e')](handleEntityNotFound(_0x2564b3,null))['then'](saveUpdates(_0x1ef1b3[_0x6519('0x50')],null))['then'](function(_0x26f634){if(_0x26f634){_0x2330c0[_0x6519('0x26')]=_0x26f634[_0x6519('0x5b')]({'plain':!![]});return db[_0x6519('0x5c')][_0x6519('0x4e')]({'where':{'id':_0x26f634[_0x6519('0x5d')]}});}return null;})[_0x6519('0x1e')](handleEntityNotFound(_0x2564b3,null))['then'](function(_0x385377){if(_0x385377){return _0x385377[_0x6519('0x30')]({'UserId':_0x1ef1b3[_0x6519('0x50')][_0x6519('0x59')],'read1stAt':_[_0x6519('0x5e')](_0x385377[_0x6519('0x5f')])?moment()[_0x6519('0x57')](_0x6519('0x58')):undefined});}return null;})[_0x6519('0x1e')](function(_0x4fe962){if(_0x4fe962){_0x2330c0[_0x6519('0x60')]=_0x4fe962['get']({'plain':!![]});interaction_log[_0x6519('0x1f')](_0x6519('0x61'),_0x1ef1b3['user']['id'],_0x1ef1b3['user'][_0x6519('0x31')],_0x1ef1b3['user']['role'],_0x2330c0[_0x6519('0x60')]['id'],_0x1ef1b3['body']?JSON[_0x6519('0x24')](_0x1ef1b3[_0x6519('0x50')]):_0x6519('0x62'));return respondWithRpcPromise(_0x6519('0x63'),_0x6519('0x64'),_0x2330c0);}return null;})[_0x6519('0x1e')](function(_0x302373){var _0x1457e3=_0x6519('0x65')+_0x302373[_0x6519('0x26')][_0x6519('0x66')];return db[_0x6519('0x67')][_0x6519('0x3a')](_0x1457e3,{'type':db[_0x6519('0x68')][_0x6519('0x69')][_0x6519('0x6a')],'raw':!![]})[_0x6519('0x1e')](function(_0x1bbc72){return _0x1bbc72;});})['then'](function(_0xc8e62f){if(_0xc8e62f){_0x2330c0[_0x6519('0x26')][_0x6519('0x6b')]=_0xc8e62f[0x0];if(!_0x1ef1b3[_0x6519('0x50')]['UserId'])return;return db[_0x6519('0x6c')][_0x6519('0x4e')]({'where':{'id':_0x1ef1b3[_0x6519('0x50')][_0x6519('0x59')],'role':'agent'},'attributes':['id',_0x6519('0x31'),_0x6519('0x6d'),_0x6519('0x6e'),_0x6519('0x6f')],'raw':!![]});}return null;})[_0x6519('0x1e')](function(_0x30c394){if(!_0x30c394)return null;_0x2330c0['message'][_0x6519('0x70')]=_0x30c394;return _0x2330c0;})[_0x6519('0x1e')](function(_0x55ba42){if(_0x55ba42){if(_0x1ef1b3[_0x6519('0x50')][_0x6519('0x71')]){_0x2330c0['message'][_0x6519('0x72')]=util[_0x6519('0x57')](_0x6519('0x73'),_0x1ef1b3[_0x6519('0x5a')][_0x6519('0x31')]);_0x2330c0[_0x6519('0x26')][_0x6519('0x74')]=_0x2330c0[_0x6519('0x74')];_0x2330c0[_0x6519('0x26')][_0x6519('0x75')]=_0x2330c0['channel'];_0x2330c0[_0x6519('0x26')][_0x6519('0x76')]='accept';return respondWithRpcPromise(_0x6519('0x77'),_0x6519('0x77'),{'event':_0x6519('0x78'),'message':_0x2330c0[_0x6519('0x26')]},client9002)[_0x6519('0x1e')](function(){return _0x2330c0;});}return _0x2330c0;}return null;})[_0x6519('0x1e')](respondWithResult(_0x2564b3,null))['catch'](handleError(_0x2564b3,null));};var interaction_log=require('../../config/logger')(_0x6519('0x79'));exports[_0x6519('0x7a')]=function(_0xf041f6,_0x2670eb,_0x25bcb2){var _0x206f59={'agent':{},'channel':_0x6519('0x54')};if(_0xf041f6[_0x6519('0x50')]['id']){delete _0xf041f6[_0x6519('0x50')]['id'];}_0xf041f6[_0x6519('0x50')]['UserId']=_0xf041f6[_0x6519('0x50')]['UserId']||_0xf041f6[_0x6519('0x5a')]['id'];_0x206f59[_0x6519('0x70')]['id']=_0xf041f6['body'][_0x6519('0x59')];return db[_0x6519('0x35')][_0x6519('0x4e')]({'where':{'id':_0xf041f6['params']['id'],'UserId':null}})[_0x6519('0x1e')](handleEntityNotFound(_0x2670eb,null))['then'](function(_0x52e736){if(_0x52e736){_0x206f59[_0x6519('0x26')]=_0x52e736[_0x6519('0x5b')]({'plain':!![]});return db['WhatsappInteraction'][_0x6519('0x4e')]({'where':{'id':_0x52e736[_0x6519('0x5d')]}});}return null;})[_0x6519('0x1e')](handleEntityNotFound(_0x2670eb,null))[_0x6519('0x1e')](function(_0x8a357){if(_0x8a357){_0x206f59[_0x6519('0x60')]=_0x8a357[_0x6519('0x5b')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf041f6[_0x6519('0x5a')]['id'],_0xf041f6['user'][_0x6519('0x31')],_0xf041f6[_0x6519('0x5a')]['role'],_0x206f59[_0x6519('0x60')]['id'],_0xf041f6['body']?JSON['stringify'](_0xf041f6[_0x6519('0x50')]):'null');return respondWithRpcPromise(_0x6519('0x7b'),_0x6519('0x7c'),_0x206f59);}return null;})[_0x6519('0x1e')](function(_0xb94fb9){var _0x2a7ddf=_0x6519('0x65')+_0xb94fb9[_0x6519('0x26')][_0x6519('0x66')];return db[_0x6519('0x67')][_0x6519('0x3a')](_0x2a7ddf,{'type':db[_0x6519('0x68')][_0x6519('0x69')]['SELECT'],'raw':!![]})[_0x6519('0x1e')](function(_0x2dd07a){return _0x2dd07a;});})['then'](function(_0x3e0dde){if(_0x3e0dde){_0x206f59[_0x6519('0x26')]['contact']=_0x3e0dde[0x0];if(!_0xf041f6[_0x6519('0x50')][_0x6519('0x59')])return;return db[_0x6519('0x6c')][_0x6519('0x4e')]({'where':{'id':_0xf041f6[_0x6519('0x50')]['UserId'],'role':_0x6519('0x70')},'attributes':['id',_0x6519('0x31'),_0x6519('0x6d'),_0x6519('0x6e'),_0x6519('0x6f')],'raw':!![]});}return null;})[_0x6519('0x1e')](function(_0x52b98f){if(!_0x52b98f)return null;_0x206f59[_0x6519('0x26')]['agent']=_0x52b98f;return _0x206f59;})[_0x6519('0x1e')](function(_0x16ef51){if(_0x16ef51){_0x16ef51[_0x6519('0x26')][_0x6519('0x72')]=util['format'](_0x6519('0x73'),_0xf041f6[_0x6519('0x5a')][_0x6519('0x31')]);_0x16ef51['message'][_0x6519('0x74')]=_0x206f59[_0x6519('0x74')];_0x16ef51[_0x6519('0x26')]['motionChannel']=_0x206f59[_0x6519('0x74')];_0x16ef51['message'][_0x6519('0x76')]=_0x6519('0x7a');respondWithRpcPromise(_0x6519('0x77'),_0x6519('0x77'),{'event':'rejectmessage','message':_0x16ef51[_0x6519('0x26')]},client9002);return _0x206f59;}return null;})[_0x6519('0x1e')](respondWithResult(_0x2670eb,null))[_0x6519('0x4c')](handleError(_0x2670eb,null));};exports['status']=function(_0x3dd441,_0x4a3135,_0x46c756){if(_0x3dd441[_0x6519('0x50')]['id']){delete _0x3dd441['body']['id'];}var _0x2fe3d9;return db[_0x6519('0x35')][_0x6519('0x4e')]({'where':{'id':_0x3dd441[_0x6519('0x4d')]['id']}})[_0x6519('0x1e')](handleEntityNotFound(_0x4a3135,null))[_0x6519('0x1e')](function(_0x1c1256){if(_0x1c1256){_0x2fe3d9=_0x1c1256;return db['WhatsappAccount']['find']({'where':{'id':_0x1c1256[_0x6519('0x7d')]}});}})[_0x6519('0x1e')](handleEntityNotFound(_0x4a3135,null))[_0x6519('0x1e')](function(_0x18b858){if(_0x18b858){logger[_0x6519('0x22')](_0x6519('0x7e'),'status',_0x6519('0x7f'),_0x18b858[_0x6519('0x80')],util[_0x6519('0x81')](_0x3dd441[_0x6519('0x50')],{'showHidden':![],'depth':null}));switch(_0x18b858[_0x6519('0x80')]){case _0x6519('0x82'):if(_0x3dd441[_0x6519('0x50')]['MessageSid']&&_0x3dd441[_0x6519('0x50')][_0x6519('0x83')]===_0x2fe3d9[_0x6519('0x84')]&&_0x3dd441[_0x6519('0x50')][_0x6519('0x85')]&&_0x3dd441[_0x6519('0x50')][_0x6519('0x85')]==='read'){return _0x2fe3d9[_0x6519('0x30')]({'read':!![]});}else{logger[_0x6519('0x25')](_0x6519('0x86'),'status',_0x6519('0x82'),util[_0x6519('0x81')](_0x3dd441[_0x6519('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x2fe3d9;}})['then'](respondWithResult(_0x4a3135,null))[_0x6519('0x4c')](handleError(_0x4a3135,null));}; \ No newline at end of file +var _0xca63=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappMessage','findAll','rows','show','include','find','create','body','params','describe','../../config/logger','accept','whatsapp','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','Sequelize','event','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3046d8,_0x19af5e){var _0x56ecb6=function(_0x4d50f9){while(--_0x4d50f9){_0x3046d8['push'](_0x3046d8['shift']());}};_0x56ecb6(++_0x19af5e);}(_0xca63,0x19b));var _0x3ca6=function(_0x1aa0db,_0x2ee6a6){_0x1aa0db=_0x1aa0db-0x0;var _0x4fb769=_0xca63[_0x1aa0db];return _0x4fb769;};'use strict';var emlformat=require(_0x3ca6('0x0'));var rimraf=require(_0x3ca6('0x1'));var zipdir=require(_0x3ca6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ca6('0x3'));var moment=require(_0x3ca6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ca6('0x5'));var util=require('util');var path=require(_0x3ca6('0x6'));var sox=require(_0x3ca6('0x7'));var csv=require(_0x3ca6('0x8'));var ejs=require(_0x3ca6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ca6('0xa'));var squel=require(_0x3ca6('0xb'));var crypto=require(_0x3ca6('0xc'));var jsforce=require(_0x3ca6('0xd'));var deskjs=require(_0x3ca6('0xe'));var toCsv=require(_0x3ca6('0x8'));var querystring=require(_0x3ca6('0xf'));var Papa=require(_0x3ca6('0x10'));var Redis=require(_0x3ca6('0x11'));var authService=require(_0x3ca6('0x12'));var qs=require(_0x3ca6('0x13'));var as=require(_0x3ca6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3ca6('0x15'));var utils=require(_0x3ca6('0x16'));var config=require(_0x3ca6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ca6('0x18'))['db'];config[_0x3ca6('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ca6('0x1a'))(new Redis(config['redis']));require(_0x3ca6('0x1b'))[_0x3ca6('0x1c')](socket);var jayson=require(_0x3ca6('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3ca6('0x1e')][_0x3ca6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x306448,_0x55455b,_0x15cb9a,_0xab7caa){return new BPromise(function(_0x9f881b,_0x3c861f){var _0x56d8dc=_0xab7caa||client;return _0x56d8dc[_0x3ca6('0x20')](_0x306448,_0x15cb9a)[_0x3ca6('0x21')](function(_0x173a2f){logger[_0x3ca6('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x55455b,_0x3ca6('0x23'));logger[_0x3ca6('0x24')](_0x3ca6('0x25'),_0x55455b,'request\x20sent',JSON['stringify'](_0x173a2f));if(_0x173a2f[_0x3ca6('0x26')]){if(_0x173a2f[_0x3ca6('0x26')]['code']===0x1f4){logger[_0x3ca6('0x26')](_0x3ca6('0x27'),_0x55455b,_0x173a2f[_0x3ca6('0x26')]['message']);return _0x3c861f(_0x173a2f['error'][_0x3ca6('0x28')]);}logger[_0x3ca6('0x26')](_0x3ca6('0x27'),_0x55455b,_0x173a2f['error'][_0x3ca6('0x28')]);return _0x9f881b(_0x173a2f[_0x3ca6('0x26')][_0x3ca6('0x28')]);}else{logger[_0x3ca6('0x22')](_0x3ca6('0x27'),_0x55455b,'request\x20sent');_0x9f881b(_0x173a2f[_0x3ca6('0x29')]['message']);}})[_0x3ca6('0x2a')](function(_0x2c3a68){logger[_0x3ca6('0x26')](_0x3ca6('0x27'),_0x55455b,_0x2c3a68);_0x3c861f(_0x2c3a68);});});}function respondWithStatusCode(_0x2a91e4,_0xf8d568){_0xf8d568=_0xf8d568||0xcc;return function(_0x558171){if(_0x558171){return _0x2a91e4[_0x3ca6('0x2b')](_0xf8d568);}return _0x2a91e4[_0x3ca6('0x2c')](_0xf8d568)[_0x3ca6('0x2d')]();};}function respondWithResult(_0x1ecf7c,_0x2f1c2e){_0x2f1c2e=_0x2f1c2e||0xc8;return function(_0x3d2718){if(_0x3d2718){return _0x1ecf7c[_0x3ca6('0x2c')](_0x2f1c2e)[_0x3ca6('0x2e')](_0x3d2718);}};}function respondWithFilteredResult(_0xf4b1b7,_0x4c061b){return function(_0x119d5d){if(_0x119d5d){var _0x54661e=typeof _0x4c061b[_0x3ca6('0x2f')]===_0x3ca6('0x30')&&typeof _0x4c061b[_0x3ca6('0x31')]===_0x3ca6('0x30');var _0x147a19=_0x119d5d[_0x3ca6('0x32')];var _0x13b6f=_0x54661e?0x0:_0x4c061b[_0x3ca6('0x2f')];var _0x146aa0=_0x54661e?_0x119d5d[_0x3ca6('0x32')]:_0x4c061b[_0x3ca6('0x2f')]+_0x4c061b[_0x3ca6('0x31')];var _0x173169;if(_0x146aa0>=_0x147a19){_0x146aa0=_0x147a19;_0x173169=0xc8;}else{_0x173169=0xce;}_0xf4b1b7[_0x3ca6('0x2c')](_0x173169);return _0xf4b1b7[_0x3ca6('0x33')](_0x3ca6('0x34'),_0x13b6f+'-'+_0x146aa0+'/'+_0x147a19)[_0x3ca6('0x2e')](_0x119d5d);}return null;};}function patchUpdates(_0xde7cd9){return function(_0x3aadc6){try{jsonpatch[_0x3ca6('0x35')](_0x3aadc6,_0xde7cd9,!![]);}catch(_0x514a44){return BPromise[_0x3ca6('0x36')](_0x514a44);}return _0x3aadc6['save']();};}function saveUpdates(_0x453835,_0x104c80){return function(_0x4461a7){if(_0x4461a7){return _0x4461a7[_0x3ca6('0x37')](_0x453835)[_0x3ca6('0x21')](function(_0xe1c337){return _0xe1c337;});}return null;};}function removeEntity(_0x4b3df7,_0x153b38){return function(_0xbbaf20){if(_0xbbaf20){return _0xbbaf20[_0x3ca6('0x38')]()['then'](function(){_0x4b3df7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x68a38f,_0x16e3d2){return function(_0x347fe1){if(!_0x347fe1){_0x68a38f[_0x3ca6('0x2b')](0x194);}return _0x347fe1;};}function handleError(_0x2df46c,_0x981113){_0x981113=_0x981113||0x1f4;return function(_0x276741){logger[_0x3ca6('0x26')](_0x276741['stack']);if(_0x276741[_0x3ca6('0x39')]){delete _0x276741[_0x3ca6('0x39')];}_0x2df46c[_0x3ca6('0x2c')](_0x981113)[_0x3ca6('0x3a')](_0x276741);};}exports['index']=function(_0x5c35e1,_0x5599e5){var _0x55cbad={},_0x51ffe8={},_0x285ab5={'count':0x0,'rows':[]};var _0x3228bf=_['map'](db['WhatsappMessage'][_0x3ca6('0x3b')],function(_0x3e2499){return{'name':_0x3e2499[_0x3ca6('0x3c')],'type':_0x3e2499[_0x3ca6('0x3d')][_0x3ca6('0x3e')]};});_0x51ffe8[_0x3ca6('0x3f')]=_[_0x3ca6('0x40')](_0x3228bf,_0x3ca6('0x39'));_0x51ffe8['query']=_[_0x3ca6('0x41')](_0x5c35e1[_0x3ca6('0x42')]);_0x51ffe8[_0x3ca6('0x43')]=_[_0x3ca6('0x44')](_0x51ffe8[_0x3ca6('0x3f')],_0x51ffe8['query']);_0x55cbad['attributes']=_[_0x3ca6('0x44')](_0x51ffe8[_0x3ca6('0x3f')],qs['fields'](_0x5c35e1[_0x3ca6('0x42')][_0x3ca6('0x45')]));_0x55cbad[_0x3ca6('0x46')]=_0x55cbad[_0x3ca6('0x46')][_0x3ca6('0x47')]?_0x55cbad[_0x3ca6('0x46')]:_0x51ffe8[_0x3ca6('0x3f')];if(!_0x5c35e1['query'][_0x3ca6('0x48')](_0x3ca6('0x49'))){_0x55cbad['limit']=qs[_0x3ca6('0x31')](_0x5c35e1[_0x3ca6('0x42')][_0x3ca6('0x31')]);_0x55cbad[_0x3ca6('0x2f')]=qs[_0x3ca6('0x2f')](_0x5c35e1[_0x3ca6('0x42')]['offset']);}_0x55cbad['order']=qs['sort'](_0x5c35e1[_0x3ca6('0x42')][_0x3ca6('0x4a')]);_0x55cbad[_0x3ca6('0x4b')]=qs[_0x3ca6('0x43')](_[_0x3ca6('0x4c')](_0x5c35e1['query'],_0x51ffe8['filters']),_0x3228bf);if(_0x5c35e1[_0x3ca6('0x42')]['filter']){_0x55cbad[_0x3ca6('0x4b')]=_[_0x3ca6('0x4d')](_0x55cbad[_0x3ca6('0x4b')],{'$or':_[_0x3ca6('0x40')](_0x3228bf,function(_0x362e20){if(_0x362e20[_0x3ca6('0x3d')]!==_0x3ca6('0x4e')){var _0x22eb57={};_0x22eb57[_0x362e20[_0x3ca6('0x39')]]={'$like':'%'+_0x5c35e1[_0x3ca6('0x42')][_0x3ca6('0x4f')]+'%'};return _0x22eb57;}})});}_0x55cbad=_[_0x3ca6('0x4d')]({},_0x55cbad,_0x5c35e1[_0x3ca6('0x50')]);var _0x3de111={'where':_0x55cbad[_0x3ca6('0x4b')]};return db['WhatsappMessage'][_0x3ca6('0x32')](_0x3de111)[_0x3ca6('0x21')](function(_0x3db83f){_0x285ab5[_0x3ca6('0x32')]=_0x3db83f;if(_0x5c35e1[_0x3ca6('0x42')]['includeAll']){_0x55cbad['include']=[{'all':!![]}];}return db[_0x3ca6('0x51')][_0x3ca6('0x52')](_0x55cbad);})[_0x3ca6('0x21')](function(_0x2aa6ea){_0x285ab5[_0x3ca6('0x53')]=_0x2aa6ea;return _0x285ab5;})[_0x3ca6('0x21')](respondWithFilteredResult(_0x5599e5,_0x55cbad))[_0x3ca6('0x2a')](handleError(_0x5599e5,null));};exports[_0x3ca6('0x54')]=function(_0x35bb81,_0xa1f9dc){var _0x1fb048={'raw':!![],'where':{'id':_0x35bb81['params']['id']}},_0x571fae={};_0x571fae['model']=_[_0x3ca6('0x41')](db[_0x3ca6('0x51')][_0x3ca6('0x3b')]);_0x571fae[_0x3ca6('0x42')]=_['keys'](_0x35bb81[_0x3ca6('0x42')]);_0x571fae[_0x3ca6('0x43')]=_['intersection'](_0x571fae['model'],_0x571fae[_0x3ca6('0x42')]);_0x1fb048[_0x3ca6('0x46')]=_[_0x3ca6('0x44')](_0x571fae['model'],qs[_0x3ca6('0x45')](_0x35bb81['query'][_0x3ca6('0x45')]));_0x1fb048['attributes']=_0x1fb048[_0x3ca6('0x46')]['length']?_0x1fb048[_0x3ca6('0x46')]:_0x571fae[_0x3ca6('0x3f')];if(_0x35bb81['query']['includeAll']){_0x1fb048[_0x3ca6('0x55')]=[{'all':!![]}];}_0x1fb048=_[_0x3ca6('0x4d')]({},_0x1fb048,_0x35bb81[_0x3ca6('0x50')]);return db['WhatsappMessage'][_0x3ca6('0x56')](_0x1fb048)[_0x3ca6('0x21')](handleEntityNotFound(_0xa1f9dc,null))[_0x3ca6('0x21')](respondWithResult(_0xa1f9dc,null))[_0x3ca6('0x2a')](handleError(_0xa1f9dc,null));};exports[_0x3ca6('0x57')]=function(_0x108652,_0x47dfa8){return db[_0x3ca6('0x51')][_0x3ca6('0x57')](_0x108652[_0x3ca6('0x58')],{})[_0x3ca6('0x21')](respondWithResult(_0x47dfa8,0xc9))[_0x3ca6('0x2a')](handleError(_0x47dfa8,null));};exports['update']=function(_0x3ae3d6,_0x2d3606){if(_0x3ae3d6['body']['id']){delete _0x3ae3d6['body']['id'];}return db['WhatsappMessage'][_0x3ca6('0x56')]({'where':{'id':_0x3ae3d6['params']['id']}})[_0x3ca6('0x21')](handleEntityNotFound(_0x2d3606,null))['then'](saveUpdates(_0x3ae3d6[_0x3ca6('0x58')],null))[_0x3ca6('0x21')](respondWithResult(_0x2d3606,null))[_0x3ca6('0x2a')](handleError(_0x2d3606,null));};exports['destroy']=function(_0x44e2d2,_0x113195){return db['WhatsappMessage'][_0x3ca6('0x56')]({'where':{'id':_0x44e2d2[_0x3ca6('0x59')]['id']}})[_0x3ca6('0x21')](handleEntityNotFound(_0x113195,null))['then'](removeEntity(_0x113195,null))[_0x3ca6('0x2a')](handleError(_0x113195,null));};exports[_0x3ca6('0x5a')]=function(_0x1572e8,_0x2ef255){return db[_0x3ca6('0x51')][_0x3ca6('0x5a')]()[_0x3ca6('0x21')](respondWithResult(_0x2ef255,null))[_0x3ca6('0x2a')](handleError(_0x2ef255,null));};var interaction_log=require(_0x3ca6('0x5b'))('whatsapp-interactions');exports[_0x3ca6('0x5c')]=function(_0x507ea4,_0x4e6220,_0xd86250){var _0xd92792={'agent':{},'channel':_0x3ca6('0x5d')};if(_0x507ea4[_0x3ca6('0x58')]['id']){delete _0x507ea4[_0x3ca6('0x58')]['id'];}_0x507ea4[_0x3ca6('0x58')][_0x3ca6('0x5e')]=!![];_0x507ea4[_0x3ca6('0x58')]['readAt']=moment()['format'](_0x3ca6('0x5f'));_0x507ea4[_0x3ca6('0x58')][_0x3ca6('0x60')]=_0x507ea4[_0x3ca6('0x58')][_0x3ca6('0x60')]||_0x507ea4[_0x3ca6('0x61')]['id'];_0xd92792[_0x3ca6('0x62')]['id']=_0x507ea4['body']['UserId'];return db[_0x3ca6('0x51')][_0x3ca6('0x56')]({'where':{'id':_0x507ea4[_0x3ca6('0x59')]['id'],'UserId':null}})[_0x3ca6('0x21')](handleEntityNotFound(_0x4e6220,null))[_0x3ca6('0x21')](saveUpdates(_0x507ea4[_0x3ca6('0x58')],null))['then'](function(_0x3bf92f){if(_0x3bf92f){_0xd92792[_0x3ca6('0x28')]=_0x3bf92f[_0x3ca6('0x63')]({'plain':!![]});return db[_0x3ca6('0x64')][_0x3ca6('0x56')]({'where':{'id':_0x3bf92f[_0x3ca6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4e6220,null))['then'](function(_0x5c44cf){if(_0x5c44cf){return _0x5c44cf['update']({'UserId':_0x507ea4['body'][_0x3ca6('0x60')],'read1stAt':_[_0x3ca6('0x66')](_0x5c44cf[_0x3ca6('0x67')])?moment()[_0x3ca6('0x68')](_0x3ca6('0x5f')):undefined});}return null;})[_0x3ca6('0x21')](function(_0x149a67){if(_0x149a67){_0xd92792['interaction']=_0x149a67[_0x3ca6('0x63')]({'plain':!![]});interaction_log[_0x3ca6('0x22')](_0x3ca6('0x69'),_0x507ea4[_0x3ca6('0x61')]['id'],_0x507ea4[_0x3ca6('0x61')][_0x3ca6('0x39')],_0x507ea4[_0x3ca6('0x61')]['role'],_0xd92792['interaction']['id'],_0x507ea4[_0x3ca6('0x58')]?JSON[_0x3ca6('0x6a')](_0x507ea4[_0x3ca6('0x58')]):_0x3ca6('0x6b'));return respondWithRpcPromise(_0x3ca6('0x6c'),_0x3ca6('0x6d'),_0xd92792);}return null;})[_0x3ca6('0x21')](function(_0xee84b2){var _0x1cdb90=_0x3ca6('0x6e')+_0xee84b2['message'][_0x3ca6('0x6f')];return db['sequelize'][_0x3ca6('0x42')](_0x1cdb90,{'type':db['Sequelize'][_0x3ca6('0x70')][_0x3ca6('0x71')],'raw':!![]})['then'](function(_0x985552){return _0x985552;});})['then'](function(_0x27ad9b){if(_0x27ad9b){_0xd92792[_0x3ca6('0x28')][_0x3ca6('0x72')]=_0x27ad9b[0x0];if(!_0x507ea4[_0x3ca6('0x58')][_0x3ca6('0x60')])return;return db[_0x3ca6('0x73')][_0x3ca6('0x56')]({'where':{'id':_0x507ea4['body'][_0x3ca6('0x60')],'role':_0x3ca6('0x62')},'attributes':['id',_0x3ca6('0x39'),_0x3ca6('0x74'),_0x3ca6('0x75'),_0x3ca6('0x76')],'raw':!![]});}return null;})[_0x3ca6('0x21')](function(_0x5c5381){if(!_0x5c5381)return null;_0xd92792['message']['agent']=_0x5c5381;return _0xd92792;})[_0x3ca6('0x21')](function(_0x835d70){if(_0x835d70){if(_0x507ea4[_0x3ca6('0x58')][_0x3ca6('0x77')]){_0xd92792['message'][_0x3ca6('0x78')]=util['format'](_0x3ca6('0x79'),_0x507ea4['user'][_0x3ca6('0x39')]);_0xd92792[_0x3ca6('0x28')][_0x3ca6('0x7a')]=_0xd92792['channel'];_0xd92792[_0x3ca6('0x28')][_0x3ca6('0x7b')]=_0xd92792['channel'];_0xd92792['message']['event']=_0x3ca6('0x5c');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3ca6('0x7c'),'message':_0xd92792['message']},client9002)[_0x3ca6('0x21')](function(){return _0xd92792;});}return _0xd92792;}return null;})['then'](respondWithResult(_0x4e6220,null))[_0x3ca6('0x2a')](handleError(_0x4e6220,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x3ca6('0x36')]=function(_0x1f696e,_0x1990b6,_0x1c2d21){var _0x3919f9={'agent':{},'channel':_0x3ca6('0x5d')};if(_0x1f696e[_0x3ca6('0x58')]['id']){delete _0x1f696e[_0x3ca6('0x58')]['id'];}_0x1f696e[_0x3ca6('0x58')][_0x3ca6('0x60')]=_0x1f696e['body'][_0x3ca6('0x60')]||_0x1f696e[_0x3ca6('0x61')]['id'];_0x3919f9[_0x3ca6('0x62')]['id']=_0x1f696e[_0x3ca6('0x58')][_0x3ca6('0x60')];return db[_0x3ca6('0x51')][_0x3ca6('0x56')]({'where':{'id':_0x1f696e[_0x3ca6('0x59')]['id'],'UserId':null}})[_0x3ca6('0x21')](handleEntityNotFound(_0x1990b6,null))['then'](function(_0x4c6623){if(_0x4c6623){_0x3919f9['message']=_0x4c6623['get']({'plain':!![]});return db[_0x3ca6('0x64')][_0x3ca6('0x56')]({'where':{'id':_0x4c6623[_0x3ca6('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x1990b6,null))[_0x3ca6('0x21')](function(_0x19a1f0){if(_0x19a1f0){_0x3919f9[_0x3ca6('0x7d')]=_0x19a1f0[_0x3ca6('0x63')]({'plain':!![]});interaction_log['info'](_0x3ca6('0x7e'),_0x1f696e[_0x3ca6('0x61')]['id'],_0x1f696e['user'][_0x3ca6('0x39')],_0x1f696e[_0x3ca6('0x61')][_0x3ca6('0x7f')],_0x3919f9['interaction']['id'],_0x1f696e[_0x3ca6('0x58')]?JSON[_0x3ca6('0x6a')](_0x1f696e[_0x3ca6('0x58')]):_0x3ca6('0x6b'));return respondWithRpcPromise(_0x3ca6('0x80'),_0x3ca6('0x81'),_0x3919f9);}return null;})[_0x3ca6('0x21')](function(_0x1f51ff){var _0x5124e6=_0x3ca6('0x6e')+_0x1f51ff[_0x3ca6('0x28')]['ContactId'];return db[_0x3ca6('0x82')][_0x3ca6('0x42')](_0x5124e6,{'type':db[_0x3ca6('0x83')][_0x3ca6('0x70')][_0x3ca6('0x71')],'raw':!![]})[_0x3ca6('0x21')](function(_0x3b1636){return _0x3b1636;});})[_0x3ca6('0x21')](function(_0x3705ec){if(_0x3705ec){_0x3919f9['message'][_0x3ca6('0x72')]=_0x3705ec[0x0];if(!_0x1f696e[_0x3ca6('0x58')][_0x3ca6('0x60')])return;return db['User']['find']({'where':{'id':_0x1f696e['body'][_0x3ca6('0x60')],'role':_0x3ca6('0x62')},'attributes':['id',_0x3ca6('0x39'),'fullname',_0x3ca6('0x75'),'internal'],'raw':!![]});}return null;})[_0x3ca6('0x21')](function(_0xb861a4){if(!_0xb861a4)return null;_0x3919f9[_0x3ca6('0x28')]['agent']=_0xb861a4;return _0x3919f9;})[_0x3ca6('0x21')](function(_0x5c499a){if(_0x5c499a){_0x5c499a[_0x3ca6('0x28')][_0x3ca6('0x78')]=util[_0x3ca6('0x68')](_0x3ca6('0x79'),_0x1f696e[_0x3ca6('0x61')][_0x3ca6('0x39')]);_0x5c499a[_0x3ca6('0x28')][_0x3ca6('0x7a')]=_0x3919f9['channel'];_0x5c499a[_0x3ca6('0x28')]['motionChannel']=_0x3919f9[_0x3ca6('0x7a')];_0x5c499a['message'][_0x3ca6('0x84')]=_0x3ca6('0x36');respondWithRpcPromise('EventManager',_0x3ca6('0x85'),{'event':_0x3ca6('0x86'),'message':_0x5c499a[_0x3ca6('0x28')]},client9002);return _0x3919f9;}return null;})[_0x3ca6('0x21')](respondWithResult(_0x1990b6,null))[_0x3ca6('0x2a')](handleError(_0x1990b6,null));};exports[_0x3ca6('0x2c')]=function(_0x499a24,_0x13ee9c,_0x4a72d0){if(_0x499a24[_0x3ca6('0x58')]['id']){delete _0x499a24['body']['id'];}var _0x301fb9;return db['WhatsappMessage'][_0x3ca6('0x56')]({'where':{'id':_0x499a24[_0x3ca6('0x59')]['id']}})['then'](handleEntityNotFound(_0x13ee9c,null))[_0x3ca6('0x21')](function(_0x408650){if(_0x408650){_0x301fb9=_0x408650;return db[_0x3ca6('0x87')][_0x3ca6('0x56')]({'where':{'id':_0x408650[_0x3ca6('0x88')]}});}})['then'](handleEntityNotFound(_0x13ee9c,null))['then'](function(_0x482a1d){if(_0x482a1d){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x3ca6('0x2c'),'received\x20delivery\x20report\x20from',_0x482a1d['type'],util[_0x3ca6('0x89')](_0x499a24['body'],{'showHidden':![],'depth':null}));switch(_0x482a1d[_0x3ca6('0x3d')]){case _0x3ca6('0x8a'):if(_0x499a24['body'][_0x3ca6('0x8b')]&&_0x499a24[_0x3ca6('0x58')][_0x3ca6('0x8b')]===_0x301fb9[_0x3ca6('0x8c')]&&_0x499a24[_0x3ca6('0x58')][_0x3ca6('0x8d')]&&_0x499a24['body'][_0x3ca6('0x8d')]===_0x3ca6('0x5e')){return _0x301fb9[_0x3ca6('0x37')]({'read':!![]});}else{logger[_0x3ca6('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3ca6('0x2c'),_0x3ca6('0x8a'),util['inspect'](_0x499a24['body'],{'showHidden':![],'depth':null}));}break;}return _0x301fb9;}})[_0x3ca6('0x21')](respondWithResult(_0x13ee9c,null))[_0x3ca6('0x2a')](handleError(_0x13ee9c,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7a25143..dd0060a 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 _0x8a5c=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x377616,_0x1c9a86){var _0x3ba7be=function(_0x4e0c51){while(--_0x4e0c51){_0x377616['push'](_0x377616['shift']());}};_0x3ba7be(++_0x1c9a86);}(_0x8a5c,0x136));var _0xc8a5=function(_0x24ea33,_0x249172){_0x24ea33=_0x24ea33-0x0;var _0xcfaa13=_0x8a5c[_0x24ea33];return _0xcfaa13;};'use strict';var EventEmitter=require(_0xc8a5('0x0'));var WhatsappMessage=require(_0xc8a5('0x1'))['db'][_0xc8a5('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc8a5('0x3')](0x0);var events={'afterCreate':_0xc8a5('0x4'),'afterUpdate':_0xc8a5('0x5'),'afterDestroy':_0xc8a5('0x6')};function emitEvent(_0x3e2f37){return function(_0x84a3f4,_0x4dd6e0,_0x2b253c){WhatsappMessageEvents[_0xc8a5('0x7')](_0x3e2f37+':'+_0x84a3f4['id'],_0x84a3f4);WhatsappMessageEvents['emit'](_0x3e2f37,_0x84a3f4);_0x2b253c(null);};}for(var e in events){if(events[_0xc8a5('0x8')](e)){var event=events[e];WhatsappMessage[_0xc8a5('0x9')](e,emitEvent(event));}}module[_0xc8a5('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x76dc=['emit','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x245936,_0x414e47){var _0x399a2f=function(_0x567346){while(--_0x567346){_0x245936['push'](_0x245936['shift']());}};_0x399a2f(++_0x414e47);}(_0x76dc,0x1f2));var _0xc76d=function(_0x468412,_0x373403){_0x468412=_0x468412-0x0;var _0x55ac04=_0x76dc[_0x468412];return _0x55ac04;};'use strict';var EventEmitter=require(_0xc76d('0x0'));var WhatsappMessage=require(_0xc76d('0x1'))['db'][_0xc76d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc76d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc76d('0x4'),'afterDestroy':_0xc76d('0x5')};function emitEvent(_0x5cff74){return function(_0x300f11,_0x50ed3a,_0x507ea7){WhatsappMessageEvents[_0xc76d('0x6')](_0x5cff74+':'+_0x300f11['id'],_0x300f11);WhatsappMessageEvents[_0xc76d('0x6')](_0x5cff74,_0x300f11);_0x507ea7(null);};}for(var e in events){if(events[_0xc76d('0x7')](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 772f4b0..e99516d 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 _0x0532=['create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./whatsappMessage.attributes','define','WhatsappMessage','messageId','body','get','direction','toLowerCase','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0532,0x16c));var _0x2053=function(_0x398682,_0x319991){_0x398682=_0x398682-0x0;var _0x2df58e=_0x0532[_0x398682];return _0x2df58e;};'use strict';var _=require(_0x2053('0x0'));var util=require(_0x2053('0x1'));var logger=require(_0x2053('0x2'))(_0x2053('0x3'));var moment=require(_0x2053('0x4'));var BPromise=require('bluebird');var rp=require(_0x2053('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x2053('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2053('0x7'));module['exports']=function(_0x3632c6,_0x148226){return _0x3632c6[_0x2053('0x8')](_0x2053('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x2053('0xa'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0x2053('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51a796,_0x27e830,_0x29606c){var _0x2dfd5f=_0x3632c6['models'];var _0x58804b=_0x51a796[_0x2053('0xc')]({'plain':!![]});if(_0x58804b[_0x2053('0xd')]['toLowerCase']()==='in'||_0x58804b[_0x2053('0xd')][_0x2053('0xe')]()==='out'&&!_0x58804b[_0x2053('0xf')]&&!_['isNil'](_0x58804b[_0x2053('0x10')])){_0x2dfd5f[_0x2053('0x11')][_0x2053('0x12')]({'where':{'id':_0x58804b[_0x2053('0x13')]}})[_0x2053('0x14')](function(_0x55e69b){if(_0x55e69b){_0x55e69b[_0x2053('0x15')]({'lastMsgAt':_0x58804b[_0x2053('0x16')],'lastMsgDirection':_0x58804b[_0x2053('0xd')]['toLowerCase']()});}})[_0x2053('0x17')](function(_0xb70e3f){console[_0x2053('0x18')](_0xb70e3f);});}if(_0x58804b[_0x2053('0xd')]===_0x2053('0x19')&&!_0x58804b[_0x2053('0xf')]){var _0x6265a0;_0x2dfd5f[_0x2053('0x1a')][_0x2053('0x1b')]({'where':{'id':_0x58804b[_0x2053('0x1c')]},'raw':!![]})[_0x2053('0x14')](function(_0x2ac201){_0x6265a0=_0x2ac201;if(_0x6265a0&&_0x6265a0[_0x2053('0x1d')]){switch(_0x6265a0['type']){case _0x2053('0x1e'):var _0x4d377b=require(_0x2053('0x1e'));if(_0x6265a0[_0x2053('0x1f')]&&_0x6265a0['authToken']&&_0x6265a0[_0x2053('0x20')]){var _0x158fb1=new _0x4d377b(_0x6265a0[_0x2053('0x1f')],_0x6265a0[_0x2053('0x21')]);_0x158fb1[_0x2053('0x22')][_0x2053('0x23')]({'body':_0x58804b[_0x2053('0xb')],'to':_0x2053('0x24')+_0x58804b[_0x2053('0x20')],'from':'whatsapp:'+_0x6265a0['phone'],'statusCallback':_0x6265a0[_0x2053('0x25')]+_0x2053('0x26')+_0x58804b['id']+'/status?token='+_0x6265a0[_0x2053('0x27')]})[_0x2053('0x14')](function(_0x4d1ce2){if(_0x4d1ce2[_0x2053('0x28')]){return _0x51a796[_0x2053('0x15')]({'messageId':_0x4d1ce2[_0x2053('0x28')]});}})[_0x2053('0x17')](function(_0x50a561){logger[_0x2053('0x18')](_0x2053('0x29'),_0x2053('0x2a'),_0x2053('0x1e'),util[_0x2053('0x2b')](_0x50a561,{'showHidden':![],'depth':null}));});}else{logger[_0x2053('0x18')](_0x2053('0x29'),_0x2053('0x2a'),'twilio',_0x2053('0x2c'));}break;case _0x2053('0x2d'):var _0x234cb4=_0x6265a0[_0x2053('0x1f')];var _0x8a395e=_0x6265a0['authToken'];var _0x28fbbb=_0x6265a0[_0x2053('0x2e')]+_0x2053('0x2f')+_0x234cb4+_0x2053('0x30');var _0xeb8f67={'to':[_0x58804b[_0x2053('0x20')]],'message':{'type':'text','text':_0x58804b['body']}};var _0x5314eb={'method':_0x2053('0x31'),'uri':_0x28fbbb,'headers':{'Authorization':_0x2053('0x32')+_0x8a395e,'Content-Type':_0x2053('0x33')},'body':_0xeb8f67,'json':!![]};rp(_0x5314eb)[_0x2053('0x14')](function(_0x1d3eb6){if(_0x1d3eb6['statuses'][0x0][_0x2053('0x34')]){return _0x51a796['update']({'messageId':_0x1d3eb6[_0x2053('0x35')][0x0]['message_id']});}})['catch'](function(_0x5b5427){logger[_0x2053('0x36')](_0x2053('0x37'),_0x5b5427);});break;}}})['finally'](function(){_0x29606c();});}else{_0x29606c();}}},'charset':'utf8mb4','collate':_0x2053('0x38')});}; \ No newline at end of file +var _0x765e=['statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','accountSid','phone','authToken','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','POST','Bearer\x20','application/json'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0x765e,0x1bf));var _0xe765=function(_0x294ad7,_0x5e6a85){_0x294ad7=_0x294ad7-0x0;var _0x35e6fd=_0x765e[_0x294ad7];return _0x35e6fd;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require(_0xe765('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xe765('0x7'));var rimraf=require(_0xe765('0x8'));var config=require('../../config/environment');var attributes=require(_0xe765('0x9'));module[_0xe765('0xa')]=function(_0x3ff2f5,_0x446fc1){return _0x3ff2f5['define'](_0xe765('0xb'),attributes,{'tableName':_0xe765('0xc'),'paranoid':![],'indexes':[{'name':_0xe765('0xd'),'fields':[_0xe765('0xd')]},{'name':_0xe765('0xe'),'fields':[_0xe765('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59f097,_0x558604,_0x11fb96){var _0x5b2562=_0x3ff2f5[_0xe765('0x10')];var _0x392fba=_0x59f097[_0xe765('0x11')]({'plain':!![]});if(_0x392fba[_0xe765('0x12')][_0xe765('0x13')]()==='in'||_0x392fba[_0xe765('0x12')][_0xe765('0x13')]()===_0xe765('0x14')&&!_0x392fba[_0xe765('0x15')]&&!_[_0xe765('0x16')](_0x392fba[_0xe765('0x17')])){_0x5b2562[_0xe765('0x18')][_0xe765('0x19')]({'where':{'id':_0x392fba[_0xe765('0x1a')]}})[_0xe765('0x1b')](function(_0x5abdba){if(_0x5abdba){_0x5abdba[_0xe765('0x1c')]({'lastMsgAt':_0x392fba[_0xe765('0x1d')],'lastMsgDirection':_0x392fba[_0xe765('0x12')][_0xe765('0x13')]()});}})[_0xe765('0x1e')](function(_0x96786c){console[_0xe765('0x1f')](_0x96786c);});}if(_0x392fba[_0xe765('0x12')]===_0xe765('0x14')&&!_0x392fba[_0xe765('0x15')]){var _0x4a88c5;_0x5b2562[_0xe765('0x20')][_0xe765('0x21')]({'where':{'id':_0x392fba[_0xe765('0x22')]},'raw':!![]})[_0xe765('0x1b')](function(_0x51a651){_0x4a88c5=_0x51a651;if(_0x4a88c5&&_0x4a88c5['type']){switch(_0x4a88c5[_0xe765('0x23')]){case'twilio':var _0x186021=require('twilio');if(_0x4a88c5[_0xe765('0x24')]&&_0x4a88c5['authToken']&&_0x4a88c5[_0xe765('0x25')]){var _0x23c34a=new _0x186021(_0x4a88c5[_0xe765('0x24')],_0x4a88c5[_0xe765('0x26')]);_0x23c34a[_0xe765('0x27')][_0xe765('0x28')]({'body':_0x392fba[_0xe765('0xf')],'to':_0xe765('0x29')+_0x392fba[_0xe765('0x25')],'from':_0xe765('0x29')+_0x4a88c5['phone'],'statusCallback':_0x4a88c5['remote']+_0xe765('0x2a')+_0x392fba['id']+_0xe765('0x2b')+_0x4a88c5[_0xe765('0x2c')]})['then'](function(_0xc37507){if(_0xc37507[_0xe765('0x2d')]){return _0x59f097['update']({'messageId':_0xc37507[_0xe765('0x2d')]});}})[_0xe765('0x1e')](function(_0x2804f2){logger[_0xe765('0x1f')](_0xe765('0x2e'),'afterCreate',_0xe765('0x2f'),util[_0xe765('0x30')](_0x2804f2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe765('0x2e'),_0xe765('0x31'),_0xe765('0x2f'),_0xe765('0x32'));}break;case _0xe765('0x33'):var _0x80d7aa=_0x4a88c5[_0xe765('0x24')];var _0x286922=_0x4a88c5['authToken'];var _0xcfff75=_0x4a88c5[_0xe765('0x34')]+_0xe765('0x35')+_0x80d7aa+'/messages/';var _0x75d85b={'to':[_0x392fba[_0xe765('0x25')]],'message':{'type':'text','text':_0x392fba[_0xe765('0xf')]}};var _0x3473ca={'method':_0xe765('0x36'),'uri':_0xcfff75,'headers':{'Authorization':_0xe765('0x37')+_0x286922,'Content-Type':_0xe765('0x38')},'body':_0x75d85b,'json':!![]};rp(_0x3473ca)[_0xe765('0x1b')](function(_0x15902c){if(_0x15902c[_0xe765('0x39')][0x0][_0xe765('0x3a')]){return _0x59f097['update']({'messageId':_0x15902c['statuses'][0x0][_0xe765('0x3a')]});}})['catch'](function(_0x59a076){logger[_0xe765('0x3b')](_0xe765('0x3c'),_0x59a076);});break;}}})[_0xe765('0x3d')](function(){_0x11fb96();});}else{_0x11fb96();}}},'charset':_0xe765('0x3e'),'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 75db0a5..95eea9f 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 _0x2a31=['register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x4eded4,_0x4f5adb){var _0x4a0f17=function(_0x4f7d18){while(--_0x4f7d18){_0x4eded4['push'](_0x4eded4['shift']());}};_0x4a0f17(++_0x4f5adb);}(_0x2a31,0x101));var _0x12a3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2a31[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x12a3('0x0'));var moment=require(_0x12a3('0x1'));var BPromise=require(_0x12a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12a3('0x3'))['db'];var utils=require(_0x12a3('0x4'));var logger=require(_0x12a3('0x5'))(_0x12a3('0x6'));var config=require(_0x12a3('0x7'));var jayson=require(_0x12a3('0x8'));var client=jayson[_0x12a3('0x9')][_0x12a3('0xa')]({'port':0x232a});config['redis']=_[_0x12a3('0xb')](config[_0x12a3('0xc')],{'host':_0x12a3('0xd'),'port':0x18eb});var socket=require(_0x12a3('0xe'))(new Redis(config[_0x12a3('0xc')]));require('./whatsappMessage.socket')[_0x12a3('0xf')](socket);function respondWithRpcPromise(_0x4216f7,_0xc896bb,_0x404983){return new BPromise(function(_0x19ee44,_0xb60c06){return client[_0x12a3('0x10')](_0x4216f7,_0x404983)[_0x12a3('0x11')](function(_0x2550f3){logger['info'](_0x12a3('0x12'),_0xc896bb,_0x12a3('0x13'));logger[_0x12a3('0x14')](_0x12a3('0x15'),_0xc896bb,_0x12a3('0x13'),JSON[_0x12a3('0x16')](_0x2550f3));if(_0x2550f3[_0x12a3('0x17')]){if(_0x2550f3[_0x12a3('0x17')][_0x12a3('0x18')]===0x1f4){logger[_0x12a3('0x17')](_0x12a3('0x12'),_0xc896bb,_0x2550f3['error'][_0x12a3('0x19')]);return _0xb60c06(_0x2550f3['error'][_0x12a3('0x19')]);}logger[_0x12a3('0x17')](_0x12a3('0x12'),_0xc896bb,_0x2550f3[_0x12a3('0x17')]['message']);return _0x19ee44(_0x2550f3['error'][_0x12a3('0x19')]);}else{logger['info'](_0x12a3('0x12'),_0xc896bb,_0x12a3('0x13'));_0x19ee44(_0x2550f3[_0x12a3('0x1a')][_0x12a3('0x19')]);}})['catch'](function(_0x4902de){logger[_0x12a3('0x17')](_0x12a3('0x12'),_0xc896bb,_0x4902de);_0xb60c06(_0x4902de);});});}exports['CreateWhatsappMessage']=function(_0x118ab6){var _0x15e836=this;return new Promise(function(_0x20e78d,_0x54f65e){return db[_0x12a3('0x1b')][_0x12a3('0x1c')](_0x118ab6[_0x12a3('0x1d')],{'raw':_0x118ab6[_0x12a3('0x1e')]?_0x118ab6['options'][_0x12a3('0x1f')]===undefined?!![]:![]:!![]})[_0x12a3('0x11')](function(_0x5680fd){logger['info'](_0x12a3('0x20'),_0x118ab6);logger[_0x12a3('0x14')]('CreateWhatsappMessage',_0x118ab6,JSON[_0x12a3('0x16')](_0x5680fd));_0x20e78d(_0x5680fd);})[_0x12a3('0x21')](function(_0x207041){logger[_0x12a3('0x17')](_0x12a3('0x20'),_0x207041[_0x12a3('0x19')],_0x118ab6);_0x54f65e(_0x15e836['error'](0x1f4,_0x207041[_0x12a3('0x19')]));});});}; \ No newline at end of file +var _0xc0c9=['catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','debug','stringify','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','request\x20sent','error','code','message','WhatsappMessage,\x20%s,\x20%s','result'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xc0c9,0xc2));var _0x9c0c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc0c9[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x9c0c('0x0'));var moment=require(_0x9c0c('0x1'));var BPromise=require('bluebird');var rs=require(_0x9c0c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c0c('0x3'))['db'];var utils=require(_0x9c0c('0x4'));var logger=require(_0x9c0c('0x5'))(_0x9c0c('0x6'));var config=require(_0x9c0c('0x7'));var jayson=require(_0x9c0c('0x8'));var client=jayson[_0x9c0c('0x9')][_0x9c0c('0xa')]({'port':0x232a});config[_0x9c0c('0xb')]=_[_0x9c0c('0xc')](config[_0x9c0c('0xb')],{'host':_0x9c0c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x9c0c('0xe')](socket);function respondWithRpcPromise(_0x944a5a,_0x517035,_0x2eafbb){return new BPromise(function(_0x2f5f96,_0x5ec9b6){return client['request'](_0x944a5a,_0x2eafbb)[_0x9c0c('0xf')](function(_0xc8e8a9){logger[_0x9c0c('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x517035,_0x9c0c('0x11'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x517035,_0x9c0c('0x11'),JSON['stringify'](_0xc8e8a9));if(_0xc8e8a9[_0x9c0c('0x12')]){if(_0xc8e8a9[_0x9c0c('0x12')][_0x9c0c('0x13')]===0x1f4){logger[_0x9c0c('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x517035,_0xc8e8a9[_0x9c0c('0x12')][_0x9c0c('0x14')]);return _0x5ec9b6(_0xc8e8a9[_0x9c0c('0x12')][_0x9c0c('0x14')]);}logger[_0x9c0c('0x12')](_0x9c0c('0x15'),_0x517035,_0xc8e8a9[_0x9c0c('0x12')][_0x9c0c('0x14')]);return _0x2f5f96(_0xc8e8a9[_0x9c0c('0x12')][_0x9c0c('0x14')]);}else{logger['info'](_0x9c0c('0x15'),_0x517035,_0x9c0c('0x11'));_0x2f5f96(_0xc8e8a9[_0x9c0c('0x16')][_0x9c0c('0x14')]);}})[_0x9c0c('0x17')](function(_0x4f3f57){logger[_0x9c0c('0x12')](_0x9c0c('0x15'),_0x517035,_0x4f3f57);_0x5ec9b6(_0x4f3f57);});});}exports[_0x9c0c('0x18')]=function(_0x221971){var _0x25d6a0=this;return new Promise(function(_0x4442e9,_0x580b92){return db[_0x9c0c('0x19')]['create'](_0x221971[_0x9c0c('0x1a')],{'raw':_0x221971[_0x9c0c('0x1b')]?_0x221971[_0x9c0c('0x1b')][_0x9c0c('0x1c')]===undefined?!![]:![]:!![]})[_0x9c0c('0xf')](function(_0x4e7b40){logger['info']('CreateWhatsappMessage',_0x221971);logger[_0x9c0c('0x1d')](_0x9c0c('0x18'),_0x221971,JSON[_0x9c0c('0x1e')](_0x4e7b40));_0x4442e9(_0x4e7b40);})['catch'](function(_0x3ca3e0){logger[_0x9c0c('0x12')]('CreateWhatsappMessage',_0x3ca3e0[_0x9c0c('0x14')],_0x221971);_0x580b92(_0x25d6a0[_0x9c0c('0x12')](0x1f4,_0x3ca3e0[_0x9c0c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 9d4a6cb..2b9de0f 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 _0x34cd=['update','length','whatsappMessage:','save'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x34cd,0xa7));var _0xd34c=function(_0x5c4087,_0xbf9927){_0x5c4087=_0x5c4087-0x0;var _0x4ae9a9=_0x34cd[_0x5c4087];return _0x4ae9a9;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xd34c('0x0'),'remove',_0xd34c('0x1')];function createListener(_0x3c04d2,_0x2b7a03){return function(_0x4ffcaf){_0x2b7a03['emit'](_0x3c04d2,_0x4ffcaf);};}function removeListener(_0x2d0ddb,_0x396053){return function(){WhatsappMessageEvents['removeListener'](_0x2d0ddb,_0x396053);};}exports['register']=function(_0xe47c73){for(var _0x1dab5a=0x0,_0x1b561a=events[_0xd34c('0x2')];_0x1dab5a<_0x1b561a;_0x1dab5a++){var _0x37aadb=events[_0x1dab5a];var _0x28d996=createListener(_0xd34c('0x3')+_0x37aadb,_0xe47c73);WhatsappMessageEvents['on'](_0x37aadb,_0x28d996);}}; \ No newline at end of file +var _0x39f7=['remove','update','removeListener','register','length','whatsappMessage:','save'];(function(_0x4c62b3,_0x5ebd71){var _0x348fd2=function(_0x53cc1c){while(--_0x53cc1c){_0x4c62b3['push'](_0x4c62b3['shift']());}};_0x348fd2(++_0x5ebd71);}(_0x39f7,0xb5));var _0x739f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x39f7[_0x19e35c];return _0x3e1fe8;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x739f('0x0'),_0x739f('0x1'),_0x739f('0x2')];function createListener(_0x150ac6,_0x4982fb){return function(_0x53e099){_0x4982fb['emit'](_0x150ac6,_0x53e099);};}function removeListener(_0x4ad19b,_0x4b3c1a){return function(){WhatsappMessageEvents[_0x739f('0x3')](_0x4ad19b,_0x4b3c1a);};}exports[_0x739f('0x4')]=function(_0x3e1be9){for(var _0x59cf9a=0x0,_0x50c81f=events[_0x739f('0x5')];_0x59cf9a<_0x50c81f;_0x59cf9a++){var _0x15c17b=events[_0x59cf9a];var _0x63eeaa=createListener(_0x739f('0x6')+_0x15c17b,_0x3e1be9);WhatsappMessageEvents['on'](_0x15c17b,_0x63eeaa);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index cb33137..6ec284b 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 _0x1123=['delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','/:id','update'];(function(_0x275a7f,_0x39d81e){var _0xe61308=function(_0x32ee9c){while(--_0x32ee9c){_0x275a7f['push'](_0x275a7f['shift']());}};_0xe61308(++_0x39d81e);}(_0x1123,0xf8));var _0x3112=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1123[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x3112('0x0'));var path=require(_0x3112('0x1'));var timeout=require(_0x3112('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3112('0x3'));var auth=require(_0x3112('0x4'));var interaction=require(_0x3112('0x5'));var config=require(_0x3112('0x6'));var controller=require(_0x3112('0x7'));router[_0x3112('0x8')]('/',auth[_0x3112('0x9')](),controller[_0x3112('0xa')]);router[_0x3112('0x8')]('/describe',auth[_0x3112('0x9')](),controller[_0x3112('0xb')]);router[_0x3112('0x8')]('/:id',auth[_0x3112('0x9')](),controller['show']);router[_0x3112('0x8')]('/:id/members',auth[_0x3112('0x9')](),controller[_0x3112('0xc')]);router[_0x3112('0x8')](_0x3112('0xd'),auth[_0x3112('0x9')](),controller['getTeams']);router[_0x3112('0x8')](_0x3112('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3112('0xf')]('/',auth[_0x3112('0x9')](),controller[_0x3112('0x10')]);router[_0x3112('0xf')](_0x3112('0xd'),auth['isAuthenticated'](),controller[_0x3112('0x11')]);router['post'](_0x3112('0xe'),auth[_0x3112('0x9')](),controller[_0x3112('0x12')]);router[_0x3112('0x13')](_0x3112('0x14'),auth[_0x3112('0x9')](),controller[_0x3112('0x15')]);router[_0x3112('0x16')](_0x3112('0x14'),auth[_0x3112('0x9')](),controller[_0x3112('0x17')]);router['delete'](_0x3112('0xd'),auth['isAuthenticated'](),controller[_0x3112('0x18')]);router[_0x3112('0x16')](_0x3112('0xe'),auth['isAuthenticated'](),controller[_0x3112('0x19')]);module[_0x3112('0x1a')]=router; \ No newline at end of file +var _0xc0f0=['describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xc0f0,0x67));var _0x0c0f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0f0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0c0f('0x0'));var util=require(_0x0c0f('0x1'));var path=require(_0x0c0f('0x2'));var timeout=require(_0x0c0f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c0f('0x4'));var auth=require(_0x0c0f('0x5'));var interaction=require(_0x0c0f('0x6'));var config=require(_0x0c0f('0x7'));var controller=require(_0x0c0f('0x8'));router[_0x0c0f('0x9')]('/',auth[_0x0c0f('0xa')](),controller[_0x0c0f('0xb')]);router[_0x0c0f('0x9')](_0x0c0f('0xc'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0xd')]);router[_0x0c0f('0x9')]('/:id',auth[_0x0c0f('0xa')](),controller['show']);router[_0x0c0f('0x9')](_0x0c0f('0xe'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0xf')]);router['get'](_0x0c0f('0x10'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x11')]);router[_0x0c0f('0x9')](_0x0c0f('0x12'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x13')]);router[_0x0c0f('0x14')]('/',auth[_0x0c0f('0xa')](),controller['create']);router[_0x0c0f('0x14')](_0x0c0f('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x0c0f('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x0c0f('0x15')]);router['put'](_0x0c0f('0x16'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x17')]);router[_0x0c0f('0x18')]('/:id',auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x19')]);router[_0x0c0f('0x18')]('/:id/teams',auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x1a')]);router[_0x0c0f('0x18')](_0x0c0f('0x12'),auth[_0x0c0f('0xa')](),controller[_0x0c0f('0x1b')]);module[_0x0c0f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index af8633e..3ad5c55 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 _0x3d15=['roundrobin','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x49c554,_0x4c33f6){var _0x492985=function(_0x1344fc){while(--_0x1344fc){_0x49c554['push'](_0x49c554['shift']());}};_0x492985(++_0x4c33f6);}(_0x3d15,0x127));var _0x53d1=function(_0x7cf8ec,_0x57fd22){_0x7cf8ec=_0x7cf8ec-0x0;var _0x4a257a=_0x3d15[_0x7cf8ec];return _0x4a257a;};'use strict';var Sequelize=require('sequelize');module[_0x53d1('0x0')]={'name':{'type':Sequelize[_0x53d1('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x53d1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x53d1('0x3')](_0x53d1('0x4'),'beepall',_0x53d1('0x5'))},'description':{'type':Sequelize[_0x53d1('0x1')]}}; \ No newline at end of file +var _0x78f0=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x2fc533,_0x3da3dc){var _0x20207a=function(_0x30f42b){while(--_0x30f42b){_0x2fc533['push'](_0x2fc533['shift']());}};_0x20207a(++_0x3da3dc);}(_0x78f0,0x15d));var _0x078f=function(_0xe735fe,_0x1b39fe){_0xe735fe=_0xe735fe-0x0;var _0x299637=_0x78f0[_0xe735fe];return _0x299637;};'use strict';var Sequelize=require(_0x078f('0x0'));module[_0x078f('0x1')]={'name':{'type':Sequelize[_0x078f('0x2')],'unique':_0x078f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x078f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x078f('0x5')](_0x078f('0x6'),_0x078f('0x7'),'roundrobin')},'description':{'type':Sequelize[_0x078f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7b58a79..08fdbba 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 _0x7bf7=['apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','count','limit','set','json'];(function(_0x3354fc,_0x14822e){var _0x1e9b9c=function(_0x3252a0){while(--_0x3252a0){_0x3354fc['push'](_0x3354fc['shift']());}};_0x1e9b9c(++_0x14822e);}(_0x7bf7,0x67));var _0x77bf=function(_0x250123,_0x36e23d){_0x250123=_0x250123-0x0;var _0x1b3551=_0x7bf7[_0x250123];return _0x1b3551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77bf('0x0'));var zipdir=require(_0x77bf('0x1'));var jsonpatch=require(_0x77bf('0x2'));var rp=require(_0x77bf('0x3'));var moment=require(_0x77bf('0x4'));var BPromise=require(_0x77bf('0x5'));var Mustache=require(_0x77bf('0x6'));var util=require(_0x77bf('0x7'));var path=require(_0x77bf('0x8'));var sox=require(_0x77bf('0x9'));var csv=require(_0x77bf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x77bf('0xb'));var toCsv=require(_0x77bf('0xa'));var querystring=require(_0x77bf('0xc'));var Papa=require(_0x77bf('0xd'));var Redis=require(_0x77bf('0xe'));var authService=require(_0x77bf('0xf'));var qs=require(_0x77bf('0x10'));var as=require(_0x77bf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77bf('0x12'))(_0x77bf('0x13'));var utils=require(_0x77bf('0x14'));var config=require(_0x77bf('0x15'));var licenseUtil=require(_0x77bf('0x16'));var db=require(_0x77bf('0x17'))['db'];config[_0x77bf('0x18')]=_[_0x77bf('0x19')](config['redis'],{'host':_0x77bf('0x1a'),'port':0x18eb});var socket=require(_0x77bf('0x1b'))(new Redis(config[_0x77bf('0x18')]));require('./whatsappQueue.socket')[_0x77bf('0x1c')](socket);function respondWithStatusCode(_0x4a4ebd,_0x44608a){_0x44608a=_0x44608a||0xcc;return function(_0x408a42){if(_0x408a42){return _0x4a4ebd['sendStatus'](_0x44608a);}return _0x4a4ebd[_0x77bf('0x1d')](_0x44608a)[_0x77bf('0x1e')]();};}function respondWithResult(_0x72b8ad,_0x140a6d){_0x140a6d=_0x140a6d||0xc8;return function(_0x157cdd){if(_0x157cdd){return _0x72b8ad[_0x77bf('0x1d')](_0x140a6d)['json'](_0x157cdd);}};}function respondWithFilteredResult(_0x18a62a,_0x2680cb){return function(_0x2cf9be){if(_0x2cf9be){var _0xa1e4bc=typeof _0x2680cb[_0x77bf('0x1f')]===_0x77bf('0x20')&&typeof _0x2680cb['limit']==='undefined';var _0xc9c8e9=_0x2cf9be[_0x77bf('0x21')];var _0x7e539c=_0xa1e4bc?0x0:_0x2680cb['offset'];var _0x55ac89=_0xa1e4bc?_0x2cf9be[_0x77bf('0x21')]:_0x2680cb[_0x77bf('0x1f')]+_0x2680cb[_0x77bf('0x22')];var _0x4fef7c;if(_0x55ac89>=_0xc9c8e9){_0x55ac89=_0xc9c8e9;_0x4fef7c=0xc8;}else{_0x4fef7c=0xce;}_0x18a62a[_0x77bf('0x1d')](_0x4fef7c);return _0x18a62a[_0x77bf('0x23')]('Content-Range',_0x7e539c+'-'+_0x55ac89+'/'+_0xc9c8e9)[_0x77bf('0x24')](_0x2cf9be);}return null;};}function patchUpdates(_0x36913d){return function(_0x46db5e){try{jsonpatch[_0x77bf('0x25')](_0x46db5e,_0x36913d,!![]);}catch(_0x39257b){return BPromise[_0x77bf('0x26')](_0x39257b);}return _0x46db5e[_0x77bf('0x27')]();};}function saveUpdates(_0x2fd775,_0x4fbc48){return function(_0x806045){if(_0x806045){return _0x806045[_0x77bf('0x28')](_0x2fd775)[_0x77bf('0x29')](function(_0x29aa13){return _0x29aa13;});}return null;};}function removeEntity(_0xd54bb,_0x4f5f2f){return function(_0xd583a9){if(_0xd583a9){return _0xd583a9[_0x77bf('0x2a')]()[_0x77bf('0x29')](function(){var _0x19736d=_0xd583a9[_0x77bf('0x2b')]({'plain':!![]});var _0x465121=_0x77bf('0x2c');return db[_0x77bf('0x2d')]['destroy']({'where':{'type':_0x465121,'resourceId':_0x19736d['id']}})[_0x77bf('0x29')](function(){return _0xd583a9;});})[_0x77bf('0x29')](function(){_0xd54bb[_0x77bf('0x1d')](0xcc)[_0x77bf('0x1e')]();});}};}function handleEntityNotFound(_0x47669e,_0x193e92){return function(_0x5bdfdc){if(!_0x5bdfdc){_0x47669e['sendStatus'](0x194);}return _0x5bdfdc;};}function handleError(_0x30dc02,_0x111fa2){_0x111fa2=_0x111fa2||0x1f4;return function(_0x12fb51){logger[_0x77bf('0x2e')](_0x12fb51[_0x77bf('0x2f')]);if(_0x12fb51['name']){delete _0x12fb51[_0x77bf('0x30')];}_0x30dc02[_0x77bf('0x1d')](_0x111fa2)[_0x77bf('0x31')](_0x12fb51);};}exports['index']=function(_0x2e0e0d,_0x189500){var _0x45ff36={},_0xf17e97={},_0x1d330a={'count':0x0,'rows':[]};var _0x2cf855=_[_0x77bf('0x32')](db[_0x77bf('0x33')][_0x77bf('0x34')],function(_0x1e7135){return{'name':_0x1e7135['fieldName'],'type':_0x1e7135['type'][_0x77bf('0x35')]};});_0xf17e97['model']=_[_0x77bf('0x32')](_0x2cf855,_0x77bf('0x30'));_0xf17e97[_0x77bf('0x36')]=_[_0x77bf('0x37')](_0x2e0e0d[_0x77bf('0x36')]);_0xf17e97[_0x77bf('0x38')]=_[_0x77bf('0x39')](_0xf17e97[_0x77bf('0x3a')],_0xf17e97['query']);_0x45ff36[_0x77bf('0x3b')]=_[_0x77bf('0x39')](_0xf17e97[_0x77bf('0x3a')],qs['fields'](_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x3c')]));_0x45ff36[_0x77bf('0x3b')]=_0x45ff36[_0x77bf('0x3b')][_0x77bf('0x3d')]?_0x45ff36[_0x77bf('0x3b')]:_0xf17e97['model'];if(!_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x3e')]('nolimit')){_0x45ff36[_0x77bf('0x22')]=qs['limit'](_0x2e0e0d[_0x77bf('0x36')]['limit']);_0x45ff36[_0x77bf('0x1f')]=qs[_0x77bf('0x1f')](_0x2e0e0d[_0x77bf('0x36')]['offset']);}_0x45ff36[_0x77bf('0x3f')]=qs[_0x77bf('0x40')](_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x40')]);_0x45ff36['where']=qs[_0x77bf('0x38')](_[_0x77bf('0x41')](_0x2e0e0d['query'],_0xf17e97[_0x77bf('0x38')]),_0x2cf855);if(_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x42')]){_0x45ff36[_0x77bf('0x43')]=_[_0x77bf('0x44')](_0x45ff36['where'],{'$or':_[_0x77bf('0x32')](_0x2cf855,function(_0x2ea828){if(_0x2ea828[_0x77bf('0x45')]!=='VIRTUAL'){var _0x3610bc={};_0x3610bc[_0x2ea828[_0x77bf('0x30')]]={'$like':'%'+_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x42')]+'%'};return _0x3610bc;}})});}_0x45ff36=_['merge']({},_0x45ff36,_0x2e0e0d[_0x77bf('0x46')]);var _0x55dd58={'where':_0x45ff36['where']};return db[_0x77bf('0x33')][_0x77bf('0x21')](_0x55dd58)[_0x77bf('0x29')](function(_0xdff47c){_0x1d330a[_0x77bf('0x21')]=_0xdff47c;if(_0x2e0e0d[_0x77bf('0x36')][_0x77bf('0x47')]){_0x45ff36[_0x77bf('0x48')]=[{'all':!![]}];}return db[_0x77bf('0x33')][_0x77bf('0x49')](_0x45ff36);})[_0x77bf('0x29')](function(_0x582385){_0x1d330a['rows']=_0x582385;return _0x1d330a;})[_0x77bf('0x29')](respondWithFilteredResult(_0x189500,_0x45ff36))[_0x77bf('0x4a')](handleError(_0x189500,null));};exports[_0x77bf('0x4b')]=function(_0x27c833,_0x16ffde){var _0x2b0084={'raw':!![],'where':{'id':_0x27c833[_0x77bf('0x4c')]['id']}},_0x392d2a={};_0x392d2a[_0x77bf('0x3a')]=_[_0x77bf('0x37')](db[_0x77bf('0x33')][_0x77bf('0x34')]);_0x392d2a[_0x77bf('0x36')]=_[_0x77bf('0x37')](_0x27c833[_0x77bf('0x36')]);_0x392d2a[_0x77bf('0x38')]=_['intersection'](_0x392d2a['model'],_0x392d2a[_0x77bf('0x36')]);_0x2b0084[_0x77bf('0x3b')]=_[_0x77bf('0x39')](_0x392d2a[_0x77bf('0x3a')],qs[_0x77bf('0x3c')](_0x27c833[_0x77bf('0x36')][_0x77bf('0x3c')]));_0x2b0084[_0x77bf('0x3b')]=_0x2b0084[_0x77bf('0x3b')][_0x77bf('0x3d')]?_0x2b0084[_0x77bf('0x3b')]:_0x392d2a['model'];if(_0x27c833[_0x77bf('0x36')][_0x77bf('0x47')]){_0x2b0084['include']=[{'all':!![]}];}_0x2b0084=_[_0x77bf('0x44')]({},_0x2b0084,_0x27c833[_0x77bf('0x46')]);return db[_0x77bf('0x33')][_0x77bf('0x4d')](_0x2b0084)[_0x77bf('0x29')](handleEntityNotFound(_0x16ffde,null))[_0x77bf('0x29')](respondWithResult(_0x16ffde,null))[_0x77bf('0x4a')](handleError(_0x16ffde,null));};exports[_0x77bf('0x4e')]=function(_0x26d918,_0x15687a){return db[_0x77bf('0x33')][_0x77bf('0x4e')](_0x26d918[_0x77bf('0x4f')],{})[_0x77bf('0x29')](function(_0x310be9){var _0x1ce235=_0x26d918['user']['get']({'plain':!![]});if(!_0x1ce235)throw new Error(_0x77bf('0x50'));if(_0x1ce235['role']===_0x77bf('0x51')){var _0x3bd4a=_0x310be9[_0x77bf('0x2b')]({'plain':!![]});var _0x4869c5='WhatsappQueues';return db['UserProfileSection']['find']({'where':{'name':_0x4869c5,'userProfileId':_0x1ce235[_0x77bf('0x52')]},'raw':!![]})[_0x77bf('0x29')](function(_0x43b928){if(_0x43b928&&_0x43b928['autoAssociation']===0x0){return db[_0x77bf('0x2d')][_0x77bf('0x4e')]({'name':_0x3bd4a[_0x77bf('0x30')],'resourceId':_0x3bd4a['id'],'type':_0x43b928['name'],'sectionId':_0x43b928['id']},{})[_0x77bf('0x29')](function(){return _0x310be9;});}else{return _0x310be9;}})[_0x77bf('0x4a')](function(_0x402542){logger['error'](_0x77bf('0x53'),_0x402542);throw _0x402542;});}return _0x310be9;})['then'](respondWithResult(_0x15687a,0xc9))[_0x77bf('0x4a')](handleError(_0x15687a,null));};exports[_0x77bf('0x28')]=function(_0x52462c,_0x88f204){if(_0x52462c[_0x77bf('0x4f')]['id']){delete _0x52462c['body']['id'];}return db[_0x77bf('0x33')][_0x77bf('0x4d')]({'where':{'id':_0x52462c[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0x88f204,null))[_0x77bf('0x29')](saveUpdates(_0x52462c[_0x77bf('0x4f')],null))[_0x77bf('0x29')](respondWithResult(_0x88f204,null))['catch'](handleError(_0x88f204,null));};exports['destroy']=function(_0x38321f,_0x5941b6){return db[_0x77bf('0x33')][_0x77bf('0x4d')]({'where':{'id':_0x38321f[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0x5941b6,null))[_0x77bf('0x29')](removeEntity(_0x5941b6,null))[_0x77bf('0x4a')](handleError(_0x5941b6,null));};exports[_0x77bf('0x54')]=function(_0x268a5d,_0x278e49){return db[_0x77bf('0x33')]['describe']()[_0x77bf('0x29')](respondWithResult(_0x278e49,null))['catch'](handleError(_0x278e49,null));};exports['getMembers']=function(_0x4248a0,_0x2574e5,_0x2298b4){var _0x47d439={'raw':!![],'where':{}},_0x23cfc2={},_0x2659a0;return db[_0x77bf('0x33')][_0x77bf('0x55')]({'where':{'id':_0x4248a0[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0x2574e5,null))[_0x77bf('0x29')](function(_0x291b95){if(_0x291b95){_0x2659a0=_0x291b95[_0x77bf('0x2b')]({'plain':!![]});_0x23cfc2[_0x77bf('0x3a')]=_[_0x77bf('0x37')](db[_0x77bf('0x56')]['rawAttributes']);_0x23cfc2['query']=_[_0x77bf('0x37')](_0x4248a0[_0x77bf('0x36')]);_0x23cfc2[_0x77bf('0x38')]=_[_0x77bf('0x39')](_0x23cfc2['model'],_0x23cfc2[_0x77bf('0x36')]);_0x47d439[_0x77bf('0x3b')]=_['intersection'](_0x23cfc2[_0x77bf('0x3a')],qs[_0x77bf('0x3c')](_0x4248a0[_0x77bf('0x36')]['fields']));_0x47d439['attributes']=_0x47d439['attributes'][_0x77bf('0x3d')]?_0x47d439[_0x77bf('0x3b')]:_0x23cfc2['model'];if(!_0x4248a0['query'][_0x77bf('0x3e')](_0x77bf('0x57'))){_0x47d439[_0x77bf('0x22')]=qs[_0x77bf('0x22')](_0x4248a0[_0x77bf('0x36')]['limit']);_0x47d439[_0x77bf('0x1f')]=qs['offset'](_0x4248a0[_0x77bf('0x36')][_0x77bf('0x1f')]);}_0x47d439[_0x77bf('0x3f')]=qs[_0x77bf('0x40')](_0x4248a0['query'][_0x77bf('0x40')]);_0x47d439['where']=qs[_0x77bf('0x38')](_[_0x77bf('0x41')](_0x4248a0[_0x77bf('0x36')],_0x23cfc2[_0x77bf('0x38')]));_0x47d439[_0x77bf('0x43')][_0x77bf('0x58')]=_0x291b95['id'];if(_0x4248a0[_0x77bf('0x36')]['filter']){_0x47d439[_0x77bf('0x43')]=_[_0x77bf('0x44')](_0x47d439[_0x77bf('0x43')],{'$or':_[_0x77bf('0x32')](_0x47d439[_0x77bf('0x3b')],function(_0x506ace){var _0x26510f={};_0x26510f[_0x506ace]={'$like':'%'+_0x4248a0[_0x77bf('0x36')][_0x77bf('0x42')]+'%'};return _0x26510f;})});}_0x47d439=_['merge']({},_0x47d439,_0x4248a0[_0x77bf('0x46')]);return db[_0x77bf('0x56')]['findAll'](_0x47d439);}})[_0x77bf('0x29')](function(_0x1a9651){if(_0x1a9651){return db[_0x77bf('0x59')][_0x77bf('0x5a')]({'where':{'id':_[_0x77bf('0x32')](_0x1a9651,_0x77bf('0x5b')),'role':_0x77bf('0x5c')},'attributes':['id','name',_0x77bf('0x5d'),_0x77bf('0x5e'),'createdAt']});}})['then'](function(_0x3e8f24){if(_0x3e8f24){return{'count':_0x3e8f24[_0x77bf('0x21')],'rows':_[_0x77bf('0x32')](_0x3e8f24[_0x77bf('0x5f')],function(_0x5595d4){return{'membername':_0x5595d4[_0x77bf('0x30')],'UserId':_0x5595d4['id'],'queue_name':_0x2659a0['name'],'WhatsappQueueId':_0x2659a0['id'],'interface':util[_0x77bf('0x60')](_0x77bf('0x61'),_0x77bf('0x62'),_0x5595d4[_0x77bf('0x30')]),'penalty':0x0,'paused':_0x5595d4['whatsappPause'],'createdAt':_0x5595d4[_0x77bf('0x63')],'updatedAt':_0x5595d4[_0x77bf('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2574e5,_0x47d439))[_0x77bf('0x4a')](handleError(_0x2574e5,null));};exports[_0x77bf('0x64')]=function(_0x3814d9,_0x49e75c,_0x5d6529){var _0x4aadb9={};var _0xe5281a={};var _0x288908;var _0x5c0f26;return db[_0x77bf('0x33')][_0x77bf('0x55')]({'where':{'id':_0x3814d9[_0x77bf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49e75c,null))['then'](function(_0x192b50){if(_0x192b50){_0x288908=_0x192b50;_0xe5281a['model']=_[_0x77bf('0x37')](db[_0x77bf('0x65')][_0x77bf('0x34')]);_0xe5281a[_0x77bf('0x36')]=_['keys'](_0x3814d9[_0x77bf('0x36')]);_0xe5281a[_0x77bf('0x38')]=_['intersection'](_0xe5281a[_0x77bf('0x3a')],_0xe5281a[_0x77bf('0x36')]);_0x4aadb9[_0x77bf('0x3b')]=_['intersection'](_0xe5281a['model'],qs[_0x77bf('0x3c')](_0x3814d9[_0x77bf('0x36')][_0x77bf('0x3c')]));_0x4aadb9[_0x77bf('0x3b')]=_0x4aadb9[_0x77bf('0x3b')][_0x77bf('0x3d')]?_0x4aadb9[_0x77bf('0x3b')]:_0xe5281a[_0x77bf('0x3a')];_0x4aadb9[_0x77bf('0x3f')]=qs[_0x77bf('0x40')](_0x3814d9[_0x77bf('0x36')][_0x77bf('0x40')]);_0x4aadb9[_0x77bf('0x43')]=qs[_0x77bf('0x38')](_['pick'](_0x3814d9[_0x77bf('0x36')],_0xe5281a[_0x77bf('0x38')]));if(_0x3814d9['query'][_0x77bf('0x42')]){_0x4aadb9[_0x77bf('0x43')]=_[_0x77bf('0x44')](_0x4aadb9[_0x77bf('0x43')],{'$or':_[_0x77bf('0x32')](_0x4aadb9['attributes'],function(_0x379cf4){var _0x28a96f={};_0x28a96f[_0x379cf4]={'$like':'%'+_0x3814d9[_0x77bf('0x36')]['filter']+'%'};return _0x28a96f;})});}_0x4aadb9=_['merge']({},_0x4aadb9,_0x3814d9[_0x77bf('0x46')]);return _0x288908[_0x77bf('0x64')](_0x4aadb9);}})[_0x77bf('0x29')](function(_0x113acf){if(_0x113acf){_0x5c0f26=_0x113acf[_0x77bf('0x3d')];if(!_0x3814d9[_0x77bf('0x36')]['hasOwnProperty'](_0x77bf('0x57'))){_0x4aadb9[_0x77bf('0x22')]=qs['limit'](_0x3814d9['query'][_0x77bf('0x22')]);_0x4aadb9[_0x77bf('0x1f')]=qs[_0x77bf('0x1f')](_0x3814d9['query'][_0x77bf('0x1f')]);}return _0x288908[_0x77bf('0x64')](_0x4aadb9);}})[_0x77bf('0x29')](function(_0x43cbbe){if(_0x43cbbe){return _0x43cbbe?{'count':_0x5c0f26,'rows':_0x43cbbe}:null;}})[_0x77bf('0x29')](respondWithResult(_0x49e75c,null))[_0x77bf('0x4a')](handleError(_0x49e75c,null));};exports[_0x77bf('0x66')]=function(_0xa6ce98,_0x13234b,_0x51132f){var _0x21ea3c=_0xa6ce98['body'][_0x77bf('0x67')];return db[_0x77bf('0x65')][_0x77bf('0x49')]({'where':{'id':_0x21ea3c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x77bf('0x68'),'attributes':['id',_0x77bf('0x30'),_0x77bf('0x69'),_0x77bf('0x6a'),_0x77bf('0x6b')],'raw':!![]}]})[_0x77bf('0x29')](function(_0x59aae1){if(_0x59aae1){var _0x2dff67=_[_0x77bf('0x6c')](_0x59aae1,function(_0x354b72){var _0x43866c=_0x354b72[_0x77bf('0x2b')]({'plain':!![]});return _0x43866c['Agents'];});return db[_0x77bf('0x33')]['find']({'where':{'id':_0xa6ce98[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](function(_0x4185da){return db[_0x77bf('0x6d')][_0x77bf('0x6e')](function(_0x358f42){return _0x4185da[_0x77bf('0x66')](_0x21ea3c,{'transaction':_0x358f42})[_0x77bf('0x29')](function(){return BPromise['each'](_0x2dff67,function(_0x424d45){return db[_0x77bf('0x56')][_0x77bf('0x6f')]({'where':{'UserId':_0x424d45['id'],'WhatsappQueueId':_0xa6ce98[_0x77bf('0x4c')]['id']},'transaction':_0x358f42});});})['then'](function(){_0x2dff67[_0x77bf('0x70')](function(_0x2943c9){socket['emit']('userWhatsappQueue:save',{'UserId':_0x2943c9['id'],'WhatsappQueueId':_0x4185da['id']});});});});});}})['then'](respondWithStatusCode(_0x13234b,null))[_0x77bf('0x4a')](handleError(_0x13234b,null));};exports[_0x77bf('0x71')]=function(_0x817939,_0x40e3ad,_0x1b2f1b){return db[_0x77bf('0x65')][_0x77bf('0x49')]({'where':{'id':_0x817939['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x77bf('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40e3ad,null))[_0x77bf('0x29')](function(_0x33cb3a){var _0x2574a8=_['map'](_0x33cb3a,'id');var _0x1ec4ed=[];var _0x3ddf02=[];var _0x5b6036=squel[_0x77bf('0x72')]();_0x5b6036[_0x77bf('0x73')](_0x77bf('0x74'))['from'](_0x77bf('0x75'),'tq')['join'](_0x77bf('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x77bf('0x43')](_0x77bf('0x77'),_0x817939['params']['id']);for(var _0x19fd86=0x0;_0x19fd86<_0x33cb3a[_0x77bf('0x3d')];_0x19fd86+=0x1){let _0x3e51bf=_0x33cb3a[_0x19fd86];for(var _0x29ace2=0x0;_0x29ace2<_0x3e51bf[_0x77bf('0x68')]['length'];_0x29ace2+=0x1){let _0x22c7cc=_0x3e51bf[_0x77bf('0x68')][_0x29ace2];var _0x18e6b4=_0x5b6036[_0x77bf('0x78')]();_0x18e6b4[_0x77bf('0x43')](_0x77bf('0x79'),_0x22c7cc['id']);_0x3ddf02['push'](db[_0x77bf('0x6d')]['query'](_0x18e6b4['toString'](),{'type':db['sequelize']['QueryTypes'][_0x77bf('0x7a')]})[_0x77bf('0x29')](function(_0x3cb47e){if(_0x3cb47e[_0x77bf('0x3d')]===0x1){return _0x22c7cc['id'];}else{var _0x78a0e1=_[_0x77bf('0x7b')](_['map'](_0x3cb47e,_0x77bf('0x7c')),function(_0x759d29){return _[_0x77bf('0x7d')](_0x2574a8,_0x759d29);});if(_0x78a0e1){return _0x22c7cc['id'];}}}));}}return BPromise[_0x77bf('0x7e')](_0x3ddf02)['then'](function(_0x1cbf99){_0x1ec4ed=_(_0x1ec4ed)[_0x77bf('0x7f')](_0x1cbf99)[_0x77bf('0x80')]()[_0x77bf('0x81')]();return db[_0x77bf('0x33')][_0x77bf('0x4d')]({'where':{'id':_0x817939[_0x77bf('0x4c')]['id']}})['then'](function(_0xbda8f4){return db['sequelize'][_0x77bf('0x6e')](function(_0x146b63){return _0xbda8f4[_0x77bf('0x71')](_0x817939[_0x77bf('0x36')][_0x77bf('0x67')],{'transaction':_0x146b63})['then'](function(){if(!_[_0x77bf('0x82')](_0x1ec4ed)){return _0xbda8f4[_0x77bf('0x83')](_0x1ec4ed,{'transaction':_0x146b63});}})[_0x77bf('0x29')](function(){_0x1ec4ed[_0x77bf('0x70')](function(_0x409c41){socket[_0x77bf('0x84')](_0x77bf('0x85'),{'UserId':_0x409c41,'WhatsappQueueId':_0xbda8f4['id']});});});});});});})['then'](respondWithStatusCode(_0x40e3ad,null))[_0x77bf('0x4a')](handleError(_0x40e3ad,null));};exports[_0x77bf('0x86')]=function(_0x39da03,_0x2d4116,_0x24c72a){return db[_0x77bf('0x33')]['find']({'where':{'id':_0x39da03[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0x2d4116,null))[_0x77bf('0x29')](function(_0x5a100a){if(_0x5a100a){return _0x5a100a[_0x77bf('0x86')](_0x39da03[_0x77bf('0x4f')][_0x77bf('0x67')],_[_0x77bf('0x87')](_0x39da03[_0x77bf('0x4f')],['ids','id'])||{})[_0x77bf('0x88')](function(_0x2152d4){for(var _0x48b1c4=0x0;_0x48b1c4<_0x39da03[_0x77bf('0x4f')][_0x77bf('0x67')]['length'];_0x48b1c4+=0x1){socket['emit'](_0x77bf('0x89'),{'UserId':Number(_0x39da03[_0x77bf('0x4f')][_0x77bf('0x67')][_0x48b1c4]),'WhatsappQueueId':Number(_0x39da03[_0x77bf('0x4c')]['id'])});}return _0x2152d4;});}})[_0x77bf('0x29')](respondWithResult(_0x2d4116,null))[_0x77bf('0x4a')](handleError(_0x2d4116,null));};exports[_0x77bf('0x83')]=function(_0x2b93f4,_0x495263,_0x495952){return db['WhatsappQueue'][_0x77bf('0x4d')]({'where':{'id':_0x2b93f4['params']['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0x495263,null))['then'](function(_0x2af84c){if(_0x2af84c){return _0x2af84c[_0x77bf('0x83')](_0x2b93f4['query'][_0x77bf('0x67')])['then'](function(){if(_[_0x77bf('0x8a')](_0x2b93f4['query'][_0x77bf('0x67')])){for(var _0x249810=0x0;_0x249810<_0x2b93f4['query'][_0x77bf('0x67')][_0x77bf('0x3d')];_0x249810+=0x1){socket[_0x77bf('0x84')](_0x77bf('0x85'),{'UserId':Number(_0x2b93f4[_0x77bf('0x36')]['ids'][_0x249810]),'WhatsappQueueId':Number(_0x2b93f4[_0x77bf('0x4c')]['id'])});}}else{socket[_0x77bf('0x84')](_0x77bf('0x85'),{'UserId':Number(_0x2b93f4[_0x77bf('0x36')]['ids']),'WhatsappQueueId':Number(_0x2b93f4[_0x77bf('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x495263,null))['catch'](handleError(_0x495263,null));};exports[_0x77bf('0x8b')]=function(_0x13a5fb,_0xd2f218,_0x2b7cd9){var _0x235c7d={};var _0x3eadfa={};var _0x326e9b;var _0x3508d6;return db[_0x77bf('0x33')][_0x77bf('0x55')]({'where':{'id':_0x13a5fb[_0x77bf('0x4c')]['id']}})[_0x77bf('0x29')](handleEntityNotFound(_0xd2f218,null))[_0x77bf('0x29')](function(_0x3a6177){if(_0x3a6177){_0x326e9b=_0x3a6177;_0x3eadfa['model']=_['keys'](db[_0x77bf('0x59')]['rawAttributes']);_0x3eadfa['query']=_['keys'](_0x13a5fb['query']);_0x3eadfa['filters']=_[_0x77bf('0x39')](_0x3eadfa[_0x77bf('0x3a')],_0x3eadfa['query']);_0x235c7d[_0x77bf('0x3b')]=_[_0x77bf('0x39')](_0x3eadfa[_0x77bf('0x3a')],qs[_0x77bf('0x3c')](_0x13a5fb['query'][_0x77bf('0x3c')]));_0x235c7d[_0x77bf('0x3b')]=_0x235c7d['attributes'][_0x77bf('0x3d')]?_0x235c7d[_0x77bf('0x3b')]:_0x3eadfa['model'];_0x235c7d['order']=qs[_0x77bf('0x40')](_0x13a5fb[_0x77bf('0x36')]['sort']);_0x235c7d[_0x77bf('0x43')]=qs['filters'](_[_0x77bf('0x41')](_0x13a5fb[_0x77bf('0x36')],_0x3eadfa['filters']));if(_0x13a5fb['query'][_0x77bf('0x42')]){_0x235c7d[_0x77bf('0x43')]=_[_0x77bf('0x44')](_0x235c7d[_0x77bf('0x43')],{'$or':_[_0x77bf('0x32')](_0x235c7d[_0x77bf('0x3b')],function(_0x287040){var _0x4d6e78={};_0x4d6e78[_0x287040]={'$like':'%'+_0x13a5fb[_0x77bf('0x36')][_0x77bf('0x42')]+'%'};return _0x4d6e78;})});}_0x235c7d=_[_0x77bf('0x44')]({},_0x235c7d,_0x13a5fb[_0x77bf('0x46')]);return _0x326e9b[_0x77bf('0x8b')](_0x235c7d);}})[_0x77bf('0x29')](function(_0x2d7bb0){if(_0x2d7bb0){_0x3508d6=_0x2d7bb0[_0x77bf('0x3d')];if(!_0x13a5fb[_0x77bf('0x36')][_0x77bf('0x3e')](_0x77bf('0x57'))){_0x235c7d['limit']=qs[_0x77bf('0x22')](_0x13a5fb[_0x77bf('0x36')]['limit']);_0x235c7d[_0x77bf('0x1f')]=qs[_0x77bf('0x1f')](_0x13a5fb['query'][_0x77bf('0x1f')]);}return _0x326e9b['getAgents'](_0x235c7d);}})[_0x77bf('0x29')](function(_0xdf07a4){if(_0xdf07a4){return _0xdf07a4?{'count':_0x3508d6,'rows':_0xdf07a4}:null;}})[_0x77bf('0x29')](respondWithResult(_0xd2f218,null))[_0x77bf('0x4a')](handleError(_0xd2f218,null));}; \ No newline at end of file +var _0x574e=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','whatsappPause','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','flatMap','sequelize','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','compact','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','omit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','WhatsappQueue','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x574e,0x1df));var _0xe574=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x574e[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xe574('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe574('0x1'));var jsonpatch=require(_0xe574('0x2'));var rp=require(_0xe574('0x3'));var moment=require(_0xe574('0x4'));var BPromise=require(_0xe574('0x5'));var Mustache=require(_0xe574('0x6'));var util=require('util');var path=require(_0xe574('0x7'));var sox=require(_0xe574('0x8'));var csv=require('to-csv');var ejs=require(_0xe574('0x9'));var fs=require('fs');var fs_extra=require(_0xe574('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe574('0xb'));var jsforce=require(_0xe574('0xc'));var deskjs=require(_0xe574('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe574('0xe'));var Redis=require('ioredis');var authService=require(_0xe574('0xf'));var qs=require(_0xe574('0x10'));var as=require(_0xe574('0x11'));var hardwareService=require(_0xe574('0x12'));var logger=require(_0xe574('0x13'))(_0xe574('0x14'));var utils=require('../../config/utils');var config=require(_0xe574('0x15'));var licenseUtil=require(_0xe574('0x16'));var db=require(_0xe574('0x17'))['db'];config[_0xe574('0x18')]=_[_0xe574('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe574('0x1a'))(new Redis(config[_0xe574('0x18')]));require(_0xe574('0x1b'))['register'](socket);function respondWithStatusCode(_0x980148,_0x7aa715){_0x7aa715=_0x7aa715||0xcc;return function(_0x52adfd){if(_0x52adfd){return _0x980148[_0xe574('0x1c')](_0x7aa715);}return _0x980148[_0xe574('0x1d')](_0x7aa715)['end']();};}function respondWithResult(_0x55015b,_0x4e7afa){_0x4e7afa=_0x4e7afa||0xc8;return function(_0x4bf6c0){if(_0x4bf6c0){return _0x55015b[_0xe574('0x1d')](_0x4e7afa)['json'](_0x4bf6c0);}};}function respondWithFilteredResult(_0x374ef8,_0x2c61f1){return function(_0xb89445){if(_0xb89445){var _0x275ea4=typeof _0x2c61f1[_0xe574('0x1e')]===_0xe574('0x1f')&&typeof _0x2c61f1[_0xe574('0x20')]==='undefined';var _0x2ccbfa=_0xb89445[_0xe574('0x21')];var _0xeef118=_0x275ea4?0x0:_0x2c61f1[_0xe574('0x1e')];var _0x55cc9e=_0x275ea4?_0xb89445[_0xe574('0x21')]:_0x2c61f1[_0xe574('0x1e')]+_0x2c61f1[_0xe574('0x20')];var _0xbfb137;if(_0x55cc9e>=_0x2ccbfa){_0x55cc9e=_0x2ccbfa;_0xbfb137=0xc8;}else{_0xbfb137=0xce;}_0x374ef8[_0xe574('0x1d')](_0xbfb137);return _0x374ef8[_0xe574('0x22')](_0xe574('0x23'),_0xeef118+'-'+_0x55cc9e+'/'+_0x2ccbfa)[_0xe574('0x24')](_0xb89445);}return null;};}function patchUpdates(_0x5a1600){return function(_0x154c7b){try{jsonpatch[_0xe574('0x25')](_0x154c7b,_0x5a1600,!![]);}catch(_0x30c798){return BPromise[_0xe574('0x26')](_0x30c798);}return _0x154c7b[_0xe574('0x27')]();};}function saveUpdates(_0x1e6869,_0x84d6db){return function(_0x491b55){if(_0x491b55){return _0x491b55[_0xe574('0x28')](_0x1e6869)[_0xe574('0x29')](function(_0x4757e7){return _0x4757e7;});}return null;};}function removeEntity(_0x306ad3,_0x330fdd){return function(_0x488506){if(_0x488506){return _0x488506[_0xe574('0x2a')]()[_0xe574('0x29')](function(){var _0xa1d4e9=_0x488506[_0xe574('0x2b')]({'plain':!![]});var _0x3c8894='WhatsappQueues';return db[_0xe574('0x2c')][_0xe574('0x2a')]({'where':{'type':_0x3c8894,'resourceId':_0xa1d4e9['id']}})[_0xe574('0x29')](function(){return _0x488506;});})[_0xe574('0x29')](function(){_0x306ad3['status'](0xcc)[_0xe574('0x2d')]();});}};}function handleEntityNotFound(_0x2ddbbe,_0xc9a42a){return function(_0xbbb6de){if(!_0xbbb6de){_0x2ddbbe[_0xe574('0x1c')](0x194);}return _0xbbb6de;};}function handleError(_0x5bee03,_0x222cc1){_0x222cc1=_0x222cc1||0x1f4;return function(_0x3a5c35){logger[_0xe574('0x2e')](_0x3a5c35[_0xe574('0x2f')]);if(_0x3a5c35[_0xe574('0x30')]){delete _0x3a5c35[_0xe574('0x30')];}_0x5bee03[_0xe574('0x1d')](_0x222cc1)[_0xe574('0x31')](_0x3a5c35);};}exports[_0xe574('0x32')]=function(_0x5c441c,_0x57d742){var _0x16707e={},_0x186c36={},_0x1475ea={'count':0x0,'rows':[]};var _0x21f88e=_['map'](db[_0xe574('0x33')]['rawAttributes'],function(_0x14bc64){return{'name':_0x14bc64[_0xe574('0x34')],'type':_0x14bc64[_0xe574('0x35')]['key']};});_0x186c36['model']=_[_0xe574('0x36')](_0x21f88e,_0xe574('0x30'));_0x186c36[_0xe574('0x37')]=_[_0xe574('0x38')](_0x5c441c['query']);_0x186c36[_0xe574('0x39')]=_[_0xe574('0x3a')](_0x186c36[_0xe574('0x3b')],_0x186c36[_0xe574('0x37')]);_0x16707e[_0xe574('0x3c')]=_['intersection'](_0x186c36[_0xe574('0x3b')],qs[_0xe574('0x3d')](_0x5c441c[_0xe574('0x37')][_0xe574('0x3d')]));_0x16707e[_0xe574('0x3c')]=_0x16707e[_0xe574('0x3c')][_0xe574('0x3e')]?_0x16707e[_0xe574('0x3c')]:_0x186c36[_0xe574('0x3b')];if(!_0x5c441c[_0xe574('0x37')][_0xe574('0x3f')](_0xe574('0x40'))){_0x16707e[_0xe574('0x20')]=qs[_0xe574('0x20')](_0x5c441c[_0xe574('0x37')]['limit']);_0x16707e[_0xe574('0x1e')]=qs['offset'](_0x5c441c['query'][_0xe574('0x1e')]);}_0x16707e[_0xe574('0x41')]=qs[_0xe574('0x42')](_0x5c441c[_0xe574('0x37')][_0xe574('0x42')]);_0x16707e[_0xe574('0x43')]=qs['filters'](_[_0xe574('0x44')](_0x5c441c['query'],_0x186c36['filters']),_0x21f88e);if(_0x5c441c[_0xe574('0x37')][_0xe574('0x45')]){_0x16707e[_0xe574('0x43')]=_[_0xe574('0x46')](_0x16707e[_0xe574('0x43')],{'$or':_[_0xe574('0x36')](_0x21f88e,function(_0x9f1367){if(_0x9f1367[_0xe574('0x35')]!==_0xe574('0x47')){var _0x3deddd={};_0x3deddd[_0x9f1367[_0xe574('0x30')]]={'$like':'%'+_0x5c441c['query']['filter']+'%'};return _0x3deddd;}})});}_0x16707e=_['merge']({},_0x16707e,_0x5c441c['options']);var _0x108395={'where':_0x16707e['where']};return db[_0xe574('0x33')]['count'](_0x108395)[_0xe574('0x29')](function(_0x2bb994){_0x1475ea[_0xe574('0x21')]=_0x2bb994;if(_0x5c441c[_0xe574('0x37')][_0xe574('0x48')]){_0x16707e[_0xe574('0x49')]=[{'all':!![]}];}return db[_0xe574('0x33')][_0xe574('0x4a')](_0x16707e);})['then'](function(_0xfdf81d){_0x1475ea[_0xe574('0x4b')]=_0xfdf81d;return _0x1475ea;})[_0xe574('0x29')](respondWithFilteredResult(_0x57d742,_0x16707e))['catch'](handleError(_0x57d742,null));};exports[_0xe574('0x4c')]=function(_0xf5ee4e,_0x234c21){var _0xa60ecc={'raw':!![],'where':{'id':_0xf5ee4e[_0xe574('0x4d')]['id']}},_0x15fee6={};_0x15fee6[_0xe574('0x3b')]=_['keys'](db[_0xe574('0x33')][_0xe574('0x4e')]);_0x15fee6[_0xe574('0x37')]=_['keys'](_0xf5ee4e[_0xe574('0x37')]);_0x15fee6[_0xe574('0x39')]=_[_0xe574('0x3a')](_0x15fee6['model'],_0x15fee6[_0xe574('0x37')]);_0xa60ecc[_0xe574('0x3c')]=_['intersection'](_0x15fee6[_0xe574('0x3b')],qs[_0xe574('0x3d')](_0xf5ee4e['query'][_0xe574('0x3d')]));_0xa60ecc[_0xe574('0x3c')]=_0xa60ecc[_0xe574('0x3c')][_0xe574('0x3e')]?_0xa60ecc['attributes']:_0x15fee6[_0xe574('0x3b')];if(_0xf5ee4e[_0xe574('0x37')][_0xe574('0x48')]){_0xa60ecc[_0xe574('0x49')]=[{'all':!![]}];}_0xa60ecc=_[_0xe574('0x46')]({},_0xa60ecc,_0xf5ee4e[_0xe574('0x4f')]);return db['WhatsappQueue'][_0xe574('0x50')](_0xa60ecc)['then'](handleEntityNotFound(_0x234c21,null))[_0xe574('0x29')](respondWithResult(_0x234c21,null))[_0xe574('0x51')](handleError(_0x234c21,null));};exports[_0xe574('0x52')]=function(_0x34a681,_0x4080eb){return db[_0xe574('0x33')][_0xe574('0x52')](_0x34a681[_0xe574('0x53')],{})[_0xe574('0x29')](function(_0x4ca715){var _0x1c8c87=_0x34a681[_0xe574('0x54')]['get']({'plain':!![]});if(!_0x1c8c87)throw new Error(_0xe574('0x55'));if(_0x1c8c87[_0xe574('0x56')]===_0xe574('0x54')){var _0x301d91=_0x4ca715[_0xe574('0x2b')]({'plain':!![]});var _0x5639dd=_0xe574('0x57');return db['UserProfileSection']['find']({'where':{'name':_0x5639dd,'userProfileId':_0x1c8c87[_0xe574('0x58')]},'raw':!![]})['then'](function(_0x35e0cd){if(_0x35e0cd&&_0x35e0cd[_0xe574('0x59')]===0x0){return db[_0xe574('0x2c')][_0xe574('0x52')]({'name':_0x301d91[_0xe574('0x30')],'resourceId':_0x301d91['id'],'type':_0x35e0cd[_0xe574('0x30')],'sectionId':_0x35e0cd['id']},{})['then'](function(){return _0x4ca715;});}else{return _0x4ca715;}})[_0xe574('0x51')](function(_0x4744c5){logger[_0xe574('0x2e')](_0xe574('0x5a'),_0x4744c5);throw _0x4744c5;});}return _0x4ca715;})[_0xe574('0x29')](respondWithResult(_0x4080eb,0xc9))[_0xe574('0x51')](handleError(_0x4080eb,null));};exports[_0xe574('0x28')]=function(_0x3a6c04,_0x1808fc){if(_0x3a6c04['body']['id']){delete _0x3a6c04['body']['id'];}return db[_0xe574('0x33')][_0xe574('0x50')]({'where':{'id':_0x3a6c04[_0xe574('0x4d')]['id']}})[_0xe574('0x29')](handleEntityNotFound(_0x1808fc,null))['then'](saveUpdates(_0x3a6c04['body'],null))[_0xe574('0x29')](respondWithResult(_0x1808fc,null))['catch'](handleError(_0x1808fc,null));};exports[_0xe574('0x2a')]=function(_0x38b219,_0x208bda){return db[_0xe574('0x33')][_0xe574('0x50')]({'where':{'id':_0x38b219[_0xe574('0x4d')]['id']}})['then'](handleEntityNotFound(_0x208bda,null))[_0xe574('0x29')](removeEntity(_0x208bda,null))[_0xe574('0x51')](handleError(_0x208bda,null));};exports[_0xe574('0x5b')]=function(_0x1349bd,_0x5f2e6b){return db[_0xe574('0x33')][_0xe574('0x5b')]()[_0xe574('0x29')](respondWithResult(_0x5f2e6b,null))[_0xe574('0x51')](handleError(_0x5f2e6b,null));};exports[_0xe574('0x5c')]=function(_0x4d7a76,_0x51b8a8,_0x2c32a0){var _0x338658={'raw':!![],'where':{}},_0x549781={},_0x6f4fc3;return db[_0xe574('0x33')][_0xe574('0x5d')]({'where':{'id':_0x4d7a76[_0xe574('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51b8a8,null))[_0xe574('0x29')](function(_0x16f007){if(_0x16f007){_0x6f4fc3=_0x16f007['get']({'plain':!![]});_0x549781['model']=_[_0xe574('0x38')](db[_0xe574('0x5e')][_0xe574('0x4e')]);_0x549781['query']=_[_0xe574('0x38')](_0x4d7a76[_0xe574('0x37')]);_0x549781['filters']=_[_0xe574('0x3a')](_0x549781[_0xe574('0x3b')],_0x549781[_0xe574('0x37')]);_0x338658['attributes']=_['intersection'](_0x549781[_0xe574('0x3b')],qs[_0xe574('0x3d')](_0x4d7a76[_0xe574('0x37')]['fields']));_0x338658['attributes']=_0x338658[_0xe574('0x3c')]['length']?_0x338658['attributes']:_0x549781[_0xe574('0x3b')];if(!_0x4d7a76[_0xe574('0x37')]['hasOwnProperty']('nolimit')){_0x338658[_0xe574('0x20')]=qs['limit'](_0x4d7a76[_0xe574('0x37')][_0xe574('0x20')]);_0x338658[_0xe574('0x1e')]=qs['offset'](_0x4d7a76[_0xe574('0x37')][_0xe574('0x1e')]);}_0x338658[_0xe574('0x41')]=qs[_0xe574('0x42')](_0x4d7a76[_0xe574('0x37')]['sort']);_0x338658[_0xe574('0x43')]=qs['filters'](_[_0xe574('0x44')](_0x4d7a76[_0xe574('0x37')],_0x549781[_0xe574('0x39')]));_0x338658[_0xe574('0x43')]['WhatsappQueueId']=_0x16f007['id'];if(_0x4d7a76[_0xe574('0x37')][_0xe574('0x45')]){_0x338658[_0xe574('0x43')]=_['merge'](_0x338658[_0xe574('0x43')],{'$or':_[_0xe574('0x36')](_0x338658[_0xe574('0x3c')],function(_0x1c9358){var _0xd94241={};_0xd94241[_0x1c9358]={'$like':'%'+_0x4d7a76['query'][_0xe574('0x45')]+'%'};return _0xd94241;})});}_0x338658=_[_0xe574('0x46')]({},_0x338658,_0x4d7a76[_0xe574('0x4f')]);return db[_0xe574('0x5e')][_0xe574('0x4a')](_0x338658);}})['then'](function(_0xaf1e4a){if(_0xaf1e4a){return db['User'][_0xe574('0x5f')]({'where':{'id':_[_0xe574('0x36')](_0xaf1e4a,'UserId'),'role':_0xe574('0x60')},'attributes':['id',_0xe574('0x30'),'whatsappPause',_0xe574('0x61'),'createdAt']});}})[_0xe574('0x29')](function(_0x46c7ca){if(_0x46c7ca){return{'count':_0x46c7ca[_0xe574('0x21')],'rows':_['map'](_0x46c7ca[_0xe574('0x4b')],function(_0x153663){return{'membername':_0x153663['name'],'UserId':_0x153663['id'],'queue_name':_0x6f4fc3[_0xe574('0x30')],'WhatsappQueueId':_0x6f4fc3['id'],'interface':util[_0xe574('0x62')](_0xe574('0x63'),_0xe574('0x64'),_0x153663[_0xe574('0x30')]),'penalty':0x0,'paused':_0x153663[_0xe574('0x65')],'createdAt':_0x153663[_0xe574('0x66')],'updatedAt':_0x153663[_0xe574('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe574('0x29')](respondWithFilteredResult(_0x51b8a8,_0x338658))[_0xe574('0x51')](handleError(_0x51b8a8,null));};exports[_0xe574('0x67')]=function(_0x525a76,_0x1f5f31,_0xce2bcc){var _0x512e56={};var _0x2413da={};var _0x152fcb;var _0x2a4ca8;return db[_0xe574('0x33')]['findOne']({'where':{'id':_0x525a76[_0xe574('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f5f31,null))[_0xe574('0x29')](function(_0xf2e620){if(_0xf2e620){_0x152fcb=_0xf2e620;_0x2413da['model']=_['keys'](db[_0xe574('0x68')]['rawAttributes']);_0x2413da['query']=_['keys'](_0x525a76[_0xe574('0x37')]);_0x2413da[_0xe574('0x39')]=_[_0xe574('0x3a')](_0x2413da[_0xe574('0x3b')],_0x2413da[_0xe574('0x37')]);_0x512e56[_0xe574('0x3c')]=_[_0xe574('0x3a')](_0x2413da[_0xe574('0x3b')],qs[_0xe574('0x3d')](_0x525a76['query'][_0xe574('0x3d')]));_0x512e56[_0xe574('0x3c')]=_0x512e56[_0xe574('0x3c')][_0xe574('0x3e')]?_0x512e56['attributes']:_0x2413da[_0xe574('0x3b')];_0x512e56[_0xe574('0x41')]=qs[_0xe574('0x42')](_0x525a76[_0xe574('0x37')]['sort']);_0x512e56[_0xe574('0x43')]=qs['filters'](_[_0xe574('0x44')](_0x525a76[_0xe574('0x37')],_0x2413da['filters']));if(_0x525a76[_0xe574('0x37')]['filter']){_0x512e56[_0xe574('0x43')]=_[_0xe574('0x46')](_0x512e56[_0xe574('0x43')],{'$or':_[_0xe574('0x36')](_0x512e56[_0xe574('0x3c')],function(_0x40af53){var _0x2f0cf1={};_0x2f0cf1[_0x40af53]={'$like':'%'+_0x525a76[_0xe574('0x37')][_0xe574('0x45')]+'%'};return _0x2f0cf1;})});}_0x512e56=_[_0xe574('0x46')]({},_0x512e56,_0x525a76[_0xe574('0x4f')]);return _0x152fcb['getTeams'](_0x512e56);}})[_0xe574('0x29')](function(_0x4d5a1b){if(_0x4d5a1b){_0x2a4ca8=_0x4d5a1b[_0xe574('0x3e')];if(!_0x525a76[_0xe574('0x37')]['hasOwnProperty']('nolimit')){_0x512e56['limit']=qs[_0xe574('0x20')](_0x525a76['query'][_0xe574('0x20')]);_0x512e56[_0xe574('0x1e')]=qs[_0xe574('0x1e')](_0x525a76[_0xe574('0x37')]['offset']);}return _0x152fcb['getTeams'](_0x512e56);}})['then'](function(_0x1d390e){if(_0x1d390e){return _0x1d390e?{'count':_0x2a4ca8,'rows':_0x1d390e}:null;}})[_0xe574('0x29')](respondWithResult(_0x1f5f31,null))[_0xe574('0x51')](handleError(_0x1f5f31,null));};exports[_0xe574('0x69')]=function(_0x5a83c5,_0x97d937,_0x2effca){var _0x1a3ab5=_0x5a83c5[_0xe574('0x53')][_0xe574('0x6a')];return db['Team'][_0xe574('0x4a')]({'where':{'id':_0x1a3ab5},'attributes':['id'],'include':[{'model':db[_0xe574('0x6b')],'as':_0xe574('0x6c'),'attributes':['id',_0xe574('0x30'),_0xe574('0x6d'),'voicePause','interface'],'raw':!![]}]})[_0xe574('0x29')](function(_0x39b488){if(_0x39b488){var _0x4ed8fc=_[_0xe574('0x6e')](_0x39b488,function(_0x457f5e){var _0x4230bb=_0x457f5e[_0xe574('0x2b')]({'plain':!![]});return _0x4230bb[_0xe574('0x6c')];});return db[_0xe574('0x33')][_0xe574('0x50')]({'where':{'id':_0x5a83c5[_0xe574('0x4d')]['id']}})['then'](function(_0xa408b6){return db[_0xe574('0x6f')]['transaction'](function(_0x40802d){return _0xa408b6[_0xe574('0x69')](_0x1a3ab5,{'transaction':_0x40802d})['then'](function(){return BPromise[_0xe574('0x70')](_0x4ed8fc,function(_0x1d9bd2){return db[_0xe574('0x5e')]['findOrCreate']({'where':{'UserId':_0x1d9bd2['id'],'WhatsappQueueId':_0x5a83c5['params']['id']},'transaction':_0x40802d});});})[_0xe574('0x29')](function(){_0x4ed8fc[_0xe574('0x71')](function(_0x10021c){socket[_0xe574('0x72')](_0xe574('0x73'),{'UserId':_0x10021c['id'],'WhatsappQueueId':_0xa408b6['id']});});});});});}})[_0xe574('0x29')](respondWithStatusCode(_0x97d937,null))['catch'](handleError(_0x97d937,null));};exports[_0xe574('0x74')]=function(_0x4780ea,_0x244d45,_0x444d0b){return db[_0xe574('0x68')][_0xe574('0x4a')]({'where':{'id':_0x4780ea[_0xe574('0x37')][_0xe574('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xe574('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe574('0x29')](handleEntityNotFound(_0x244d45,null))[_0xe574('0x29')](function(_0x8beaa2){var _0x3f6636=_[_0xe574('0x36')](_0x8beaa2,'id');var _0x5082a6=[];var _0x2267b5=[];var _0x1b3f44=squel[_0xe574('0x75')]();_0x1b3f44['field'](_0xe574('0x76'))[_0xe574('0x77')](_0xe574('0x78'),'tq')[_0xe574('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe574('0x43')](_0xe574('0x7a'),_0x4780ea[_0xe574('0x4d')]['id']);for(var _0x22acc6=0x0;_0x22acc6<_0x8beaa2[_0xe574('0x3e')];_0x22acc6+=0x1){let _0x3215e2=_0x8beaa2[_0x22acc6];for(var _0x15499a=0x0;_0x15499a<_0x3215e2[_0xe574('0x6c')][_0xe574('0x3e')];_0x15499a+=0x1){let _0x5a28df=_0x3215e2[_0xe574('0x6c')][_0x15499a];var _0x3d8a7d=_0x1b3f44[_0xe574('0x7b')]();_0x3d8a7d['where'](_0xe574('0x7c'),_0x5a28df['id']);_0x2267b5[_0xe574('0x7d')](db['sequelize'][_0xe574('0x37')](_0x3d8a7d[_0xe574('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0xe574('0x7f')]})[_0xe574('0x29')](function(_0x460a5c){if(_0x460a5c[_0xe574('0x3e')]===0x1){return _0x5a28df['id'];}else{var _0x2f5da3=_['every'](_[_0xe574('0x36')](_0x460a5c,_0xe574('0x80')),function(_0x25118d){return _['includes'](_0x3f6636,_0x25118d);});if(_0x2f5da3){return _0x5a28df['id'];}}}));}}return BPromise[_0xe574('0x81')](_0x2267b5)[_0xe574('0x29')](function(_0xeaa0c0){_0x5082a6=_(_0x5082a6)['union'](_0xeaa0c0)[_0xe574('0x82')]()['value']();return db[_0xe574('0x33')]['find']({'where':{'id':_0x4780ea[_0xe574('0x4d')]['id']}})[_0xe574('0x29')](function(_0x48fe0c){return db[_0xe574('0x6f')][_0xe574('0x83')](function(_0x5cf6a2){return _0x48fe0c['removeTeams'](_0x4780ea[_0xe574('0x37')][_0xe574('0x6a')],{'transaction':_0x5cf6a2})[_0xe574('0x29')](function(){if(!_[_0xe574('0x84')](_0x5082a6)){return _0x48fe0c[_0xe574('0x85')](_0x5082a6,{'transaction':_0x5cf6a2});}})[_0xe574('0x29')](function(){_0x5082a6[_0xe574('0x71')](function(_0x55aae7){socket[_0xe574('0x72')](_0xe574('0x86'),{'UserId':_0x55aae7,'WhatsappQueueId':_0x48fe0c['id']});});});});});});})[_0xe574('0x29')](respondWithStatusCode(_0x244d45,null))[_0xe574('0x51')](handleError(_0x244d45,null));};exports['addAgents']=function(_0x26e62c,_0xd44916,_0x24b203){return db[_0xe574('0x33')][_0xe574('0x50')]({'where':{'id':_0x26e62c[_0xe574('0x4d')]['id']}})[_0xe574('0x29')](handleEntityNotFound(_0xd44916,null))['then'](function(_0x3effb6){if(_0x3effb6){return _0x3effb6['addAgents'](_0x26e62c['body'][_0xe574('0x6a')],_[_0xe574('0x87')](_0x26e62c['body'],[_0xe574('0x6a'),'id'])||{})['spread'](function(_0x1ca437){for(var _0x23856b=0x0;_0x23856b<_0x26e62c[_0xe574('0x53')][_0xe574('0x6a')]['length'];_0x23856b+=0x1){socket[_0xe574('0x72')]('userWhatsappQueue:save',{'UserId':Number(_0x26e62c['body'][_0xe574('0x6a')][_0x23856b]),'WhatsappQueueId':Number(_0x26e62c[_0xe574('0x4d')]['id'])});}return _0x1ca437;});}})[_0xe574('0x29')](respondWithResult(_0xd44916,null))[_0xe574('0x51')](handleError(_0xd44916,null));};exports[_0xe574('0x85')]=function(_0x4de81e,_0x1736b7,_0x522792){return db[_0xe574('0x33')][_0xe574('0x50')]({'where':{'id':_0x4de81e[_0xe574('0x4d')]['id']}})[_0xe574('0x29')](handleEntityNotFound(_0x1736b7,null))[_0xe574('0x29')](function(_0x150b03){if(_0x150b03){return _0x150b03[_0xe574('0x85')](_0x4de81e['query'][_0xe574('0x6a')])['then'](function(){if(_['isArray'](_0x4de81e['query'][_0xe574('0x6a')])){for(var _0x4e2a25=0x0;_0x4e2a25<_0x4de81e['query'][_0xe574('0x6a')]['length'];_0x4e2a25+=0x1){socket[_0xe574('0x72')](_0xe574('0x86'),{'UserId':Number(_0x4de81e[_0xe574('0x37')][_0xe574('0x6a')][_0x4e2a25]),'WhatsappQueueId':Number(_0x4de81e[_0xe574('0x4d')]['id'])});}}else{socket[_0xe574('0x72')](_0xe574('0x86'),{'UserId':Number(_0x4de81e[_0xe574('0x37')]['ids']),'WhatsappQueueId':Number(_0x4de81e[_0xe574('0x4d')]['id'])});}});}})[_0xe574('0x29')](respondWithStatusCode(_0x1736b7,null))[_0xe574('0x51')](handleError(_0x1736b7,null));};exports['getAgents']=function(_0x2630be,_0x4142c7,_0x5670f8){var _0x4f8b98={};var _0x10a90f={};var _0x415000;var _0x1e5f95;return db[_0xe574('0x33')][_0xe574('0x5d')]({'where':{'id':_0x2630be[_0xe574('0x4d')]['id']}})[_0xe574('0x29')](handleEntityNotFound(_0x4142c7,null))[_0xe574('0x29')](function(_0x1bf381){if(_0x1bf381){_0x415000=_0x1bf381;_0x10a90f[_0xe574('0x3b')]=_[_0xe574('0x38')](db[_0xe574('0x6b')]['rawAttributes']);_0x10a90f[_0xe574('0x37')]=_[_0xe574('0x38')](_0x2630be['query']);_0x10a90f['filters']=_[_0xe574('0x3a')](_0x10a90f[_0xe574('0x3b')],_0x10a90f[_0xe574('0x37')]);_0x4f8b98['attributes']=_['intersection'](_0x10a90f[_0xe574('0x3b')],qs[_0xe574('0x3d')](_0x2630be[_0xe574('0x37')][_0xe574('0x3d')]));_0x4f8b98[_0xe574('0x3c')]=_0x4f8b98[_0xe574('0x3c')][_0xe574('0x3e')]?_0x4f8b98[_0xe574('0x3c')]:_0x10a90f[_0xe574('0x3b')];_0x4f8b98[_0xe574('0x41')]=qs['sort'](_0x2630be[_0xe574('0x37')][_0xe574('0x42')]);_0x4f8b98[_0xe574('0x43')]=qs[_0xe574('0x39')](_[_0xe574('0x44')](_0x2630be[_0xe574('0x37')],_0x10a90f[_0xe574('0x39')]));if(_0x2630be[_0xe574('0x37')]['filter']){_0x4f8b98[_0xe574('0x43')]=_[_0xe574('0x46')](_0x4f8b98[_0xe574('0x43')],{'$or':_[_0xe574('0x36')](_0x4f8b98[_0xe574('0x3c')],function(_0x17ee7e){var _0xc94d14={};_0xc94d14[_0x17ee7e]={'$like':'%'+_0x2630be['query'][_0xe574('0x45')]+'%'};return _0xc94d14;})});}_0x4f8b98=_[_0xe574('0x46')]({},_0x4f8b98,_0x2630be[_0xe574('0x4f')]);return _0x415000[_0xe574('0x88')](_0x4f8b98);}})[_0xe574('0x29')](function(_0x2fc142){if(_0x2fc142){_0x1e5f95=_0x2fc142['length'];if(!_0x2630be[_0xe574('0x37')][_0xe574('0x3f')]('nolimit')){_0x4f8b98[_0xe574('0x20')]=qs[_0xe574('0x20')](_0x2630be[_0xe574('0x37')][_0xe574('0x20')]);_0x4f8b98['offset']=qs['offset'](_0x2630be[_0xe574('0x37')][_0xe574('0x1e')]);}return _0x415000[_0xe574('0x88')](_0x4f8b98);}})['then'](function(_0x27b4c0){if(_0x27b4c0){return _0x27b4c0?{'count':_0x1e5f95,'rows':_0x27b4c0}:null;}})[_0xe574('0x29')](respondWithResult(_0x4142c7,null))['catch'](handleError(_0x4142c7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index dacd112..e247cf3 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 _0xe13c=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x32ea71,_0x20bbdb){var _0x4629a6=function(_0x55f96a){while(--_0x55f96a){_0x32ea71['push'](_0x32ea71['shift']());}};_0x4629a6(++_0x20bbdb);}(_0xe13c,0x11e));var _0xce13=function(_0x114962,_0x32221a){_0x114962=_0x114962-0x0;var _0x4c7173=_0xe13c[_0x114962];return _0x4c7173;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xce13('0x0'))['db'][_0xce13('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce13('0x2'),'afterUpdate':_0xce13('0x3'),'afterDestroy':_0xce13('0x4')};function emitEvent(_0x30657f){return function(_0x2044a7,_0x2eb955,_0x5cc5fe){WhatsappQueueEvents[_0xce13('0x5')](_0x30657f+':'+_0x2044a7['id'],_0x2044a7);WhatsappQueueEvents[_0xce13('0x5')](_0x30657f,_0x2044a7);_0x5cc5fe(null);};}for(var e in events){if(events[_0xce13('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xce13('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xdaf0=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x25f5ba,_0x3b6ba8){var _0x151382=function(_0x179bbe){while(--_0x179bbe){_0x25f5ba['push'](_0x25f5ba['shift']());}};_0x151382(++_0x3b6ba8);}(_0xdaf0,0x1c9));var _0x0daf=function(_0x4b6e9a,_0x5945f4){_0x4b6e9a=_0x4b6e9a-0x0;var _0x3130ac=_0xdaf0[_0x4b6e9a];return _0x3130ac;};'use strict';var EventEmitter=require(_0x0daf('0x0'));var WhatsappQueue=require(_0x0daf('0x1'))['db'][_0x0daf('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0daf('0x3')](0x0);var events={'afterCreate':_0x0daf('0x4'),'afterUpdate':_0x0daf('0x5'),'afterDestroy':_0x0daf('0x6')};function emitEvent(_0x5994a0){return function(_0x5968b4,_0x4594e1,_0x596e99){WhatsappQueueEvents['emit'](_0x5994a0+':'+_0x5968b4['id'],_0x5968b4);WhatsappQueueEvents[_0x0daf('0x7')](_0x5994a0,_0x5968b4);_0x596e99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x0daf('0x8')](e,emitEvent(event));}}module[_0x0daf('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 46a5010..e891092 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 _0xe985=['moment','bluebird','request-promise','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','../../config/logger','api'];(function(_0x332617,_0x55d568){var _0x3a13c6=function(_0x1e9150){while(--_0x1e9150){_0x332617['push'](_0x332617['shift']());}};_0x3a13c6(++_0x55d568);}(_0xe985,0xf8));var _0x5e98=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xe985[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e98('0x0'))(_0x5e98('0x1'));var moment=require(_0x5e98('0x2'));var BPromise=require(_0x5e98('0x3'));var rp=require(_0x5e98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e98('0x5'));var attributes=require(_0x5e98('0x6'));module[_0x5e98('0x7')]=function(_0x4ee14d,_0xa73bee){return _0x4ee14d['define'](_0x5e98('0x8'),attributes,{'tableName':_0x5e98('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9821=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x1abe58,_0x29c2c2){var _0x224a55=function(_0x41c9c6){while(--_0x41c9c6){_0x1abe58['push'](_0x1abe58['shift']());}};_0x224a55(++_0x29c2c2);}(_0x9821,0xa2));var _0x1982=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x9821[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x1982('0x0'));var util=require('util');var logger=require(_0x1982('0x1'))(_0x1982('0x2'));var moment=require(_0x1982('0x3'));var BPromise=require(_0x1982('0x4'));var rp=require(_0x1982('0x5'));var fs=require('fs');var path=require(_0x1982('0x6'));var rimraf=require(_0x1982('0x7'));var config=require(_0x1982('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x1982('0x9')]=function(_0x467209,_0x6f4305){return _0x467209['define']('WhatsappQueue',attributes,{'tableName':_0x1982('0xa'),'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 593c56a..1748b4f 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 _0xbbee=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetWhatsappQueue','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','ShowWhatsappQueue','WhatsappQueue','find','catch','lodash','moment','bluebird','randomstring'];(function(_0x21fb6a,_0x5b2092){var _0x57a750=function(_0x4645c2){while(--_0x4645c2){_0x21fb6a['push'](_0x21fb6a['shift']());}};_0x57a750(++_0x5b2092);}(_0xbbee,0x16d));var _0xebbe=function(_0x2a5b99,_0x4adcd1){_0x2a5b99=_0x2a5b99-0x0;var _0x36d0a7=_0xbbee[_0x2a5b99];return _0x36d0a7;};'use strict';var _=require(_0xebbe('0x0'));var util=require('util');var moment=require(_0xebbe('0x1'));var BPromise=require(_0xebbe('0x2'));var rs=require(_0xebbe('0x3'));var fs=require('fs');var Redis=require(_0xebbe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xebbe('0x5'))(_0xebbe('0x6'));var config=require(_0xebbe('0x7'));var jayson=require(_0xebbe('0x8'));var client=jayson[_0xebbe('0x9')][_0xebbe('0xa')]({'port':0x232a});config['redis']=_[_0xebbe('0xb')](config[_0xebbe('0xc')],{'host':_0xebbe('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebbe('0xc')]));require(_0xebbe('0xe'))[_0xebbe('0xf')](socket);function respondWithRpcPromise(_0xa727d7,_0x174e7d,_0x1f4ac8){return new BPromise(function(_0xbfc8f8,_0x2a3d4c){return client[_0xebbe('0x10')](_0xa727d7,_0x1f4ac8)['then'](function(_0x3b7179){logger[_0xebbe('0x11')](_0xebbe('0x12'),_0x174e7d,'request\x20sent');logger['debug'](_0xebbe('0x13'),_0x174e7d,_0xebbe('0x14'),JSON['stringify'](_0x3b7179));if(_0x3b7179[_0xebbe('0x15')]){if(_0x3b7179[_0xebbe('0x15')][_0xebbe('0x16')]===0x1f4){logger[_0xebbe('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x174e7d,_0x3b7179[_0xebbe('0x15')][_0xebbe('0x17')]);return _0x2a3d4c(_0x3b7179[_0xebbe('0x15')][_0xebbe('0x17')]);}logger[_0xebbe('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x174e7d,_0x3b7179[_0xebbe('0x15')][_0xebbe('0x17')]);return _0xbfc8f8(_0x3b7179['error']['message']);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x174e7d,_0xebbe('0x14'));_0xbfc8f8(_0x3b7179[_0xebbe('0x18')][_0xebbe('0x17')]);}})['catch'](function(_0x54bd0f){logger[_0xebbe('0x15')](_0xebbe('0x12'),_0x174e7d,_0x54bd0f);_0x2a3d4c(_0x54bd0f);});});}exports[_0xebbe('0x19')]=function(_0x1ec02e){var _0x2cd792=this;return new Promise(function(_0x2a6823,_0x4e8e16){return db['WhatsappQueue']['findAll']({'raw':_0x1ec02e[_0xebbe('0x1a')]?_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ec02e[_0xebbe('0x1a')]?_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1c')]||null:null,'attributes':_0x1ec02e[_0xebbe('0x1a')]?_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1d')]||null:null,'limit':_0x1ec02e['options']?_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1e')]||null:null,'include':_0x1ec02e[_0xebbe('0x1a')]?_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1f')]?_[_0xebbe('0x20')](_0x1ec02e[_0xebbe('0x1a')][_0xebbe('0x1f')],function(_0x31282a){return{'model':db[_0x31282a[_0xebbe('0x21')]],'as':_0x31282a['as'],'attributes':_0x31282a['attributes'],'include':_0x31282a[_0xebbe('0x1f')]?_[_0xebbe('0x20')](_0x31282a[_0xebbe('0x1f')],function(_0x5461f9){return{'model':db[_0x5461f9[_0xebbe('0x21')]],'as':_0x5461f9['as'],'attributes':_0x5461f9[_0xebbe('0x1d')],'include':_0x5461f9['include']?_[_0xebbe('0x20')](_0x5461f9[_0xebbe('0x1f')],function(_0xd1246f){return{'model':db[_0xd1246f[_0xebbe('0x21')]],'as':_0xd1246f['as'],'attributes':_0xd1246f[_0xebbe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xebbe('0x22')](function(_0x114d4b){logger[_0xebbe('0x11')](_0xebbe('0x19'),_0x1ec02e);logger[_0xebbe('0x23')](_0xebbe('0x19'),_0x1ec02e,JSON[_0xebbe('0x24')](_0x114d4b));_0x2a6823(_0x114d4b);})['catch'](function(_0x14b9d9){logger[_0xebbe('0x15')](_0xebbe('0x19'),_0x14b9d9['message'],_0x1ec02e);_0x4e8e16(_0x2cd792[_0xebbe('0x15')](0x1f4,_0x14b9d9[_0xebbe('0x17')]));});});};exports[_0xebbe('0x25')]=function(_0x2287a3){var _0x21e0b6=this;return new Promise(function(_0xa4679,_0x5e1199){return db[_0xebbe('0x26')][_0xebbe('0x27')]({'raw':_0x2287a3[_0xebbe('0x1a')]?_0x2287a3[_0xebbe('0x1a')][_0xebbe('0x1b')]===undefined?!![]:![]:!![],'where':_0x2287a3['options']?_0x2287a3[_0xebbe('0x1a')][_0xebbe('0x1c')]||null:null,'attributes':_0x2287a3[_0xebbe('0x1a')]?_0x2287a3[_0xebbe('0x1a')][_0xebbe('0x1d')]||null:null,'include':_0x2287a3[_0xebbe('0x1a')]?_0x2287a3[_0xebbe('0x1a')][_0xebbe('0x1f')]?_[_0xebbe('0x20')](_0x2287a3[_0xebbe('0x1a')][_0xebbe('0x1f')],function(_0x11ab14){return{'model':db[_0x11ab14[_0xebbe('0x21')]],'as':_0x11ab14['as'],'attributes':_0x11ab14['attributes'],'include':_0x11ab14[_0xebbe('0x1f')]?_[_0xebbe('0x20')](_0x11ab14[_0xebbe('0x1f')],function(_0x397556){return{'model':db[_0x397556[_0xebbe('0x21')]],'as':_0x397556['as'],'attributes':_0x397556['attributes'],'include':_0x397556['include']?_[_0xebbe('0x20')](_0x397556[_0xebbe('0x1f')],function(_0x5aec20){return{'model':db[_0x5aec20['model']],'as':_0x5aec20['as'],'attributes':_0x5aec20[_0xebbe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xebbe('0x22')](function(_0x222d08){logger['info'](_0xebbe('0x25'),_0x2287a3);logger['debug'](_0xebbe('0x25'),_0x2287a3,JSON[_0xebbe('0x24')](_0x222d08));_0xa4679(_0x222d08);})[_0xebbe('0x28')](function(_0x195de7){logger[_0xebbe('0x15')](_0xebbe('0x25'),_0x195de7['message'],_0x2287a3);_0x5e1199(_0x21e0b6[_0xebbe('0x15')](0x1f4,_0x195de7[_0xebbe('0x17')]));});});}; \ No newline at end of file +var _0x5a24=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','map','include','model','stringify','ShowWhatsappQueue','find','raw','then','lodash'];(function(_0x108902,_0x7b318c){var _0x28271e=function(_0x4540bf){while(--_0x4540bf){_0x108902['push'](_0x108902['shift']());}};_0x28271e(++_0x7b318c);}(_0x5a24,0x1a3));var _0x45a2=function(_0x1837cc,_0x1e18ff){_0x1837cc=_0x1837cc-0x0;var _0x1cf1ab=_0x5a24[_0x1837cc];return _0x1cf1ab;};'use strict';var _=require(_0x45a2('0x0'));var util=require('util');var moment=require(_0x45a2('0x1'));var BPromise=require(_0x45a2('0x2'));var rs=require(_0x45a2('0x3'));var fs=require('fs');var Redis=require(_0x45a2('0x4'));var db=require(_0x45a2('0x5'))['db'];var utils=require(_0x45a2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x45a2('0x7'));var jayson=require(_0x45a2('0x8'));var client=jayson[_0x45a2('0x9')][_0x45a2('0xa')]({'port':0x232a});config['redis']=_[_0x45a2('0xb')](config[_0x45a2('0xc')],{'host':_0x45a2('0xd'),'port':0x18eb});var socket=require(_0x45a2('0xe'))(new Redis(config[_0x45a2('0xc')]));require('./whatsappQueue.socket')[_0x45a2('0xf')](socket);function respondWithRpcPromise(_0x53e733,_0x288885,_0x434909){return new BPromise(function(_0x2bb74a,_0x27c2e3){return client[_0x45a2('0x10')](_0x53e733,_0x434909)['then'](function(_0x3100e6){logger[_0x45a2('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x288885,_0x45a2('0x12'));logger[_0x45a2('0x13')](_0x45a2('0x14'),_0x288885,_0x45a2('0x12'),JSON['stringify'](_0x3100e6));if(_0x3100e6[_0x45a2('0x15')]){if(_0x3100e6['error'][_0x45a2('0x16')]===0x1f4){logger['error'](_0x45a2('0x17'),_0x288885,_0x3100e6['error'][_0x45a2('0x18')]);return _0x27c2e3(_0x3100e6['error']['message']);}logger[_0x45a2('0x15')](_0x45a2('0x17'),_0x288885,_0x3100e6[_0x45a2('0x15')][_0x45a2('0x18')]);return _0x2bb74a(_0x3100e6[_0x45a2('0x15')]['message']);}else{logger[_0x45a2('0x11')](_0x45a2('0x17'),_0x288885,_0x45a2('0x12'));_0x2bb74a(_0x3100e6[_0x45a2('0x19')][_0x45a2('0x18')]);}})[_0x45a2('0x1a')](function(_0x956cae){logger['error'](_0x45a2('0x17'),_0x288885,_0x956cae);_0x27c2e3(_0x956cae);});});}exports[_0x45a2('0x1b')]=function(_0x5c30b0){var _0x44e091=this;return new Promise(function(_0x4ce294,_0x482d8c){return db[_0x45a2('0x1c')][_0x45a2('0x1d')]({'raw':_0x5c30b0['options']?_0x5c30b0['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c30b0[_0x45a2('0x1e')]?_0x5c30b0[_0x45a2('0x1e')][_0x45a2('0x1f')]||null:null,'attributes':_0x5c30b0[_0x45a2('0x1e')]?_0x5c30b0['options'][_0x45a2('0x20')]||null:null,'limit':_0x5c30b0[_0x45a2('0x1e')]?_0x5c30b0['options'][_0x45a2('0x21')]||null:null,'include':_0x5c30b0['options']?_0x5c30b0[_0x45a2('0x1e')]['include']?_[_0x45a2('0x22')](_0x5c30b0['options'][_0x45a2('0x23')],function(_0x38d0a0){return{'model':db[_0x38d0a0[_0x45a2('0x24')]],'as':_0x38d0a0['as'],'attributes':_0x38d0a0[_0x45a2('0x20')],'include':_0x38d0a0[_0x45a2('0x23')]?_[_0x45a2('0x22')](_0x38d0a0[_0x45a2('0x23')],function(_0x1c8ecc){return{'model':db[_0x1c8ecc['model']],'as':_0x1c8ecc['as'],'attributes':_0x1c8ecc[_0x45a2('0x20')],'include':_0x1c8ecc['include']?_[_0x45a2('0x22')](_0x1c8ecc[_0x45a2('0x23')],function(_0x11bd25){return{'model':db[_0x11bd25[_0x45a2('0x24')]],'as':_0x11bd25['as'],'attributes':_0x11bd25[_0x45a2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb3d60b){logger[_0x45a2('0x11')](_0x45a2('0x1b'),_0x5c30b0);logger[_0x45a2('0x13')](_0x45a2('0x1b'),_0x5c30b0,JSON[_0x45a2('0x25')](_0xb3d60b));_0x4ce294(_0xb3d60b);})[_0x45a2('0x1a')](function(_0x44ef8f){logger[_0x45a2('0x15')](_0x45a2('0x1b'),_0x44ef8f['message'],_0x5c30b0);_0x482d8c(_0x44e091[_0x45a2('0x15')](0x1f4,_0x44ef8f[_0x45a2('0x18')]));});});};exports[_0x45a2('0x26')]=function(_0x1bd8e6){var _0x4dc09c=this;return new Promise(function(_0x122433,_0x3573df){return db[_0x45a2('0x1c')][_0x45a2('0x27')]({'raw':_0x1bd8e6[_0x45a2('0x1e')]?_0x1bd8e6['options'][_0x45a2('0x28')]===undefined?!![]:![]:!![],'where':_0x1bd8e6[_0x45a2('0x1e')]?_0x1bd8e6[_0x45a2('0x1e')][_0x45a2('0x1f')]||null:null,'attributes':_0x1bd8e6['options']?_0x1bd8e6['options']['attributes']||null:null,'include':_0x1bd8e6[_0x45a2('0x1e')]?_0x1bd8e6[_0x45a2('0x1e')][_0x45a2('0x23')]?_[_0x45a2('0x22')](_0x1bd8e6[_0x45a2('0x1e')]['include'],function(_0x445cb0){return{'model':db[_0x445cb0[_0x45a2('0x24')]],'as':_0x445cb0['as'],'attributes':_0x445cb0['attributes'],'include':_0x445cb0[_0x45a2('0x23')]?_[_0x45a2('0x22')](_0x445cb0['include'],function(_0x3d987e){return{'model':db[_0x3d987e[_0x45a2('0x24')]],'as':_0x3d987e['as'],'attributes':_0x3d987e['attributes'],'include':_0x3d987e[_0x45a2('0x23')]?_[_0x45a2('0x22')](_0x3d987e[_0x45a2('0x23')],function(_0x21b1da){return{'model':db[_0x21b1da[_0x45a2('0x24')]],'as':_0x21b1da['as'],'attributes':_0x21b1da[_0x45a2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x45a2('0x29')](function(_0x29d593){logger['info'](_0x45a2('0x26'),_0x1bd8e6);logger[_0x45a2('0x13')](_0x45a2('0x26'),_0x1bd8e6,JSON[_0x45a2('0x25')](_0x29d593));_0x122433(_0x29d593);})[_0x45a2('0x1a')](function(_0x42f1a8){logger[_0x45a2('0x15')](_0x45a2('0x26'),_0x42f1a8[_0x45a2('0x18')],_0x1bd8e6);_0x3573df(_0x4dc09c['error'](0x1f4,_0x42f1a8['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9ec63db..f2a6c41 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 _0x802a=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register','length'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x802a,0x181));var _0xa802=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x802a[_0x4fbfd9];return _0x31dc94;};'use strict';var WhatsappQueueEvents=require(_0xa802('0x0'));var events=[_0xa802('0x1'),'remove',_0xa802('0x2')];function createListener(_0x56f52d,_0x2cb819){return function(_0x26e9a6){_0x2cb819[_0xa802('0x3')](_0x56f52d,_0x26e9a6);};}function removeListener(_0xd30c42,_0x197648){return function(){WhatsappQueueEvents[_0xa802('0x4')](_0xd30c42,_0x197648);};}exports[_0xa802('0x5')]=function(_0x45af8d){for(var _0x215d2d=0x0,_0x4f9706=events[_0xa802('0x6')];_0x215d2d<_0x4f9706;_0x215d2d++){var _0x3882f5=events[_0x215d2d];var _0x24bd3e=createListener(_0xa802('0x7')+_0x3882f5,_0x45af8d);WhatsappQueueEvents['on'](_0x3882f5,_0x24bd3e);}}; \ No newline at end of file +var _0xad73=['removeListener','register','length','whatsappQueue:','save','emit'];(function(_0x4a5f48,_0x4b5c8a){var _0xb85d92=function(_0x4fc071){while(--_0x4fc071){_0x4a5f48['push'](_0x4a5f48['shift']());}};_0xb85d92(++_0x4b5c8a);}(_0xad73,0x17e));var _0x3ad7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xad73[_0x4565bf];return _0x5610ba;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x3ad7('0x0'),'remove','update'];function createListener(_0x5ab25d,_0x11b4a9){return function(_0x5bc9ee){_0x11b4a9[_0x3ad7('0x1')](_0x5ab25d,_0x5bc9ee);};}function removeListener(_0x3b8f9e,_0x4d8b92){return function(){WhatsappQueueEvents[_0x3ad7('0x2')](_0x3b8f9e,_0x4d8b92);};}exports[_0x3ad7('0x3')]=function(_0x4d6078){for(var _0x40db2=0x0,_0x48205e=events[_0x3ad7('0x4')];_0x40db2<_0x48205e;_0x40db2++){var _0x3126c2=events[_0x40db2];var _0x1ed8ad=createListener(_0x3ad7('0x5')+_0x3126c2,_0x4d6078);WhatsappQueueEvents['on'](_0x3126c2,_0x1ed8ad);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 2732bd0..9944c14 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 _0xe6f0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0xe6f0,0x162));var _0x0e6f=function(_0x175697,_0x8c0f37){_0x175697=_0x175697-0x0;var _0x14493c=_0xe6f0[_0x175697];return _0x14493c;};'use strict';var multer=require(_0x0e6f('0x0'));var util=require(_0x0e6f('0x1'));var path=require(_0x0e6f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e6f('0x3'));var router=express[_0x0e6f('0x4')]();var fs_extra=require(_0x0e6f('0x5'));var auth=require(_0x0e6f('0x6'));var interaction=require(_0x0e6f('0x7'));var config=require(_0x0e6f('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0x0e6f('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e6f('0xa')]);router[_0x0e6f('0x9')](_0x0e6f('0xb'),auth[_0x0e6f('0xc')](),controller[_0x0e6f('0xd')]);router[_0x0e6f('0x9')]('/:id',auth[_0x0e6f('0xc')](),controller['show']);router[_0x0e6f('0xe')]('/',auth['isAuthenticated'](),controller[_0x0e6f('0xf')]);router[_0x0e6f('0x10')](_0x0e6f('0x11'),auth[_0x0e6f('0xc')](),controller[_0x0e6f('0x12')]);router['delete'](_0x0e6f('0x11'),auth[_0x0e6f('0xc')](),controller[_0x0e6f('0x13')]);module[_0x0e6f('0x14')]=router; \ No newline at end of file +var _0x7742=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x2afba4,_0x533364){var _0x374fb7=function(_0x4415de){while(--_0x4415de){_0x2afba4['push'](_0x2afba4['shift']());}};_0x374fb7(++_0x533364);}(_0x7742,0x74));var _0x2774=function(_0x1abdd9,_0x5b1fde){_0x1abdd9=_0x1abdd9-0x0;var _0xadd120=_0x7742[_0x1abdd9];return _0xadd120;};'use strict';var multer=require(_0x2774('0x0'));var util=require('util');var path=require(_0x2774('0x1'));var timeout=require('connect-timeout');var express=require(_0x2774('0x2'));var router=express[_0x2774('0x3')]();var fs_extra=require(_0x2774('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2774('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x2774('0x6')](),controller[_0x2774('0x7')]);router[_0x2774('0x8')](_0x2774('0x9'),auth[_0x2774('0x6')](),controller[_0x2774('0xa')]);router[_0x2774('0x8')](_0x2774('0xb'),auth['isAuthenticated'](),controller[_0x2774('0xc')]);router[_0x2774('0xd')]('/',auth[_0x2774('0x6')](),controller[_0x2774('0xe')]);router[_0x2774('0xf')](_0x2774('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2774('0x10')]('/:id',auth[_0x2774('0x6')](),controller[_0x2774('0x11')]);module[_0x2774('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5b6a094..3a61f62 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(_0x1a74ad,_0x427092){var _0xc1ede9=function(_0x4ec92c){while(--_0x4ec92c){_0x1a74ad['push'](_0x1a74ad['shift']());}};_0xc1ede9(++_0x427092);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x52c5ea,_0xf5102f){var _0x1c4103=function(_0xeab371){while(--_0xeab371){_0x52c5ea['push'](_0x52c5ea['shift']());}};_0x1c4103(++_0xf5102f);}(_0x7a54,0x106));var _0x47a5=function(_0x34889e,_0x5e8e4b){_0x34889e=_0x34889e-0x0;var _0x346a85=_0x7a54[_0x34889e];return _0x346a85;};'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 89cf0b2..b7f1167 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 _0x4cf8=['limit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','rows','show','merge','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x524b2a,_0x13e281){var _0x176cc5=function(_0x5c9851){while(--_0x5c9851){_0x524b2a['push'](_0x524b2a['shift']());}};_0x176cc5(++_0x13e281);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x4cf8[_0x3eb713];return _0x1d7128;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){_0x29e9e1[_0x84cf('0x19')](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x1d220a,_0x44d4bf){return function(_0x3c7eda){if(!_0x3c7eda){_0x1d220a[_0x84cf('0x18')](0x194);}return _0x3c7eda;};}function handleError(_0x401aa4,_0x6797c0){_0x6797c0=_0x6797c0||0x1f4;return function(_0x5179c1){logger[_0x84cf('0x27')](_0x5179c1[_0x84cf('0x28')]);if(_0x5179c1[_0x84cf('0x29')]){delete _0x5179c1[_0x84cf('0x29')];}_0x401aa4['status'](_0x6797c0)[_0x84cf('0x2a')](_0x5179c1);};}exports['index']=function(_0x29455e,_0x4092fd){var _0x43b41b={},_0xc15298={},_0x51adcf={'count':0x0,'rows':[]};var _0x20de4b=_[_0x84cf('0x2b')](db[_0x84cf('0x2c')][_0x84cf('0x2d')],function(_0xb4fc5a){return{'name':_0xb4fc5a[_0x84cf('0x2e')],'type':_0xb4fc5a[_0x84cf('0x2f')][_0x84cf('0x30')]};});_0xc15298[_0x84cf('0x31')]=_['map'](_0x20de4b,'name');_0xc15298[_0x84cf('0x32')]=_[_0x84cf('0x33')](_0x29455e[_0x84cf('0x32')]);_0xc15298[_0x84cf('0x34')]=_[_0x84cf('0x35')](_0xc15298[_0x84cf('0x31')],_0xc15298[_0x84cf('0x32')]);_0x43b41b[_0x84cf('0x36')]=_['intersection'](_0xc15298[_0x84cf('0x31')],qs[_0x84cf('0x37')](_0x29455e['query'][_0x84cf('0x37')]));_0x43b41b['attributes']=_0x43b41b[_0x84cf('0x36')][_0x84cf('0x38')]?_0x43b41b[_0x84cf('0x36')]:_0xc15298[_0x84cf('0x31')];if(!_0x29455e[_0x84cf('0x32')]['hasOwnProperty'](_0x84cf('0x39'))){_0x43b41b['limit']=qs['limit'](_0x29455e[_0x84cf('0x32')][_0x84cf('0x3a')]);_0x43b41b['offset']=qs[_0x84cf('0x1c')](_0x29455e[_0x84cf('0x32')][_0x84cf('0x1c')]);}_0x43b41b[_0x84cf('0x3b')]=qs[_0x84cf('0x3c')](_0x29455e[_0x84cf('0x32')]['sort']);_0x43b41b[_0x84cf('0x3d')]=qs[_0x84cf('0x34')](_[_0x84cf('0x3e')](_0x29455e[_0x84cf('0x32')],_0xc15298[_0x84cf('0x34')]),_0x20de4b);if(_0x29455e[_0x84cf('0x32')]['filter']){_0x43b41b[_0x84cf('0x3d')]=_['merge'](_0x43b41b[_0x84cf('0x3d')],{'$or':_[_0x84cf('0x2b')](_0x20de4b,function(_0x3fa39a){if(_0x3fa39a[_0x84cf('0x2f')]!==_0x84cf('0x3f')){var _0x3897b0={};_0x3897b0[_0x3fa39a[_0x84cf('0x29')]]={'$like':'%'+_0x29455e[_0x84cf('0x32')][_0x84cf('0x40')]+'%'};return _0x3897b0;}})});}_0x43b41b=_['merge']({},_0x43b41b,_0x29455e[_0x84cf('0x41')]);var _0x516928={'where':_0x43b41b[_0x84cf('0x3d')]};return db[_0x84cf('0x2c')]['count'](_0x516928)[_0x84cf('0x25')](function(_0x531410){_0x51adcf[_0x84cf('0x1e')]=_0x531410;if(_0x29455e['query'][_0x84cf('0x42')]){_0x43b41b['include']=[{'all':!![]}];}return db[_0x84cf('0x2c')][_0x84cf('0x43')](_0x43b41b);})['then'](function(_0x847ce9){_0x51adcf[_0x84cf('0x44')]=_0x847ce9;return _0x51adcf;})[_0x84cf('0x25')](respondWithFilteredResult(_0x4092fd,_0x43b41b))['catch'](handleError(_0x4092fd,null));};exports[_0x84cf('0x45')]=function(_0x5f1b8e,_0x1c84e0){var _0x58b539={'raw':!![],'where':{'id':_0x5f1b8e['params']['id']}},_0x56b0e5={};_0x56b0e5[_0x84cf('0x31')]=_[_0x84cf('0x33')](db['WhatsappQueueReport'][_0x84cf('0x2d')]);_0x56b0e5['query']=_[_0x84cf('0x33')](_0x5f1b8e[_0x84cf('0x32')]);_0x56b0e5['filters']=_[_0x84cf('0x35')](_0x56b0e5['model'],_0x56b0e5[_0x84cf('0x32')]);_0x58b539['attributes']=_['intersection'](_0x56b0e5['model'],qs['fields'](_0x5f1b8e['query']['fields']));_0x58b539['attributes']=_0x58b539[_0x84cf('0x36')][_0x84cf('0x38')]?_0x58b539[_0x84cf('0x36')]:_0x56b0e5[_0x84cf('0x31')];if(_0x5f1b8e['query'][_0x84cf('0x42')]){_0x58b539['include']=[{'all':!![]}];}_0x58b539=_[_0x84cf('0x46')]({},_0x58b539,_0x5f1b8e[_0x84cf('0x41')]);return db[_0x84cf('0x2c')][_0x84cf('0x47')](_0x58b539)[_0x84cf('0x25')](handleEntityNotFound(_0x1c84e0,null))[_0x84cf('0x25')](respondWithResult(_0x1c84e0,null))['catch'](handleError(_0x1c84e0,null));};exports[_0x84cf('0x48')]=function(_0x2732bf,_0x4a4cf7){return db[_0x84cf('0x2c')][_0x84cf('0x48')](_0x2732bf[_0x84cf('0x49')],{})['then'](respondWithResult(_0x4a4cf7,0xc9))['catch'](handleError(_0x4a4cf7,null));};exports['update']=function(_0x1cf3f6,_0x104421){if(_0x1cf3f6[_0x84cf('0x49')]['id']){delete _0x1cf3f6[_0x84cf('0x49')]['id'];}return db[_0x84cf('0x2c')][_0x84cf('0x47')]({'where':{'id':_0x1cf3f6['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x104421,null))['then'](saveUpdates(_0x1cf3f6[_0x84cf('0x49')],null))['then'](respondWithResult(_0x104421,null))['catch'](handleError(_0x104421,null));};exports[_0x84cf('0x26')]=function(_0xb1c3a8,_0x426df1){return db['WhatsappQueueReport']['find']({'where':{'id':_0xb1c3a8[_0x84cf('0x4a')]['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x426df1,null))[_0x84cf('0x25')](removeEntity(_0x426df1,null))[_0x84cf('0x4b')](handleError(_0x426df1,null));};exports[_0x84cf('0x4c')]=function(_0x4c2025,_0xcfe28f){return db[_0x84cf('0x2c')]['describe']()[_0x84cf('0x25')](respondWithResult(_0xcfe28f,null))['catch'](handleError(_0xcfe28f,null));}; \ No newline at end of file +var _0xb574=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','WhatsappQueueReport','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x2b5448,_0xe31456){var _0xee510e=function(_0x48a4fa){while(--_0x48a4fa){_0x2b5448['push'](_0x2b5448['shift']());}};_0xee510e(++_0xe31456);}(_0xb574,0x106));var _0x4b57=function(_0x2bddc7,_0x2b05a5){_0x2bddc7=_0x2bddc7-0x0;var _0x525d76=_0xb574[_0x2bddc7];return _0x525d76;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x540eff,_0x156962){return function(_0x51d0c3){if(!_0x51d0c3){_0x540eff[_0x4b57('0x16')](0x194);}return _0x51d0c3;};}function handleError(_0x517119,_0x36ceb1){_0x36ceb1=_0x36ceb1||0x1f4;return function(_0x2dc9d8){logger[_0x4b57('0x25')](_0x2dc9d8[_0x4b57('0x26')]);if(_0x2dc9d8[_0x4b57('0x27')]){delete _0x2dc9d8[_0x4b57('0x27')];}_0x517119['status'](_0x36ceb1)['send'](_0x2dc9d8);};}exports[_0x4b57('0x28')]=function(_0x4c58e4,_0x1ea0cb){var _0x458f70={},_0x874cf7={},_0x3af22f={'count':0x0,'rows':[]};var _0x249461=_[_0x4b57('0x29')](db['WhatsappQueueReport'][_0x4b57('0x2a')],function(_0x2e9922){return{'name':_0x2e9922[_0x4b57('0x2b')],'type':_0x2e9922[_0x4b57('0x2c')]['key']};});_0x874cf7[_0x4b57('0x2d')]=_[_0x4b57('0x29')](_0x249461,'name');_0x874cf7[_0x4b57('0x2e')]=_[_0x4b57('0x2f')](_0x4c58e4[_0x4b57('0x2e')]);_0x874cf7[_0x4b57('0x30')]=_['intersection'](_0x874cf7['model'],_0x874cf7['query']);_0x458f70[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x874cf7[_0x4b57('0x2d')],qs[_0x4b57('0x33')](_0x4c58e4[_0x4b57('0x2e')]['fields']));_0x458f70[_0x4b57('0x31')]=_0x458f70[_0x4b57('0x31')][_0x4b57('0x34')]?_0x458f70['attributes']:_0x874cf7[_0x4b57('0x2d')];if(!_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x35')]('nolimit')){_0x458f70[_0x4b57('0x1b')]=qs[_0x4b57('0x1b')](_0x4c58e4['query'][_0x4b57('0x1b')]);_0x458f70[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x1d')]);}_0x458f70[_0x4b57('0x36')]=qs['sort'](_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x37')]);_0x458f70[_0x4b57('0x38')]=qs[_0x4b57('0x30')](_[_0x4b57('0x39')](_0x4c58e4[_0x4b57('0x2e')],_0x874cf7[_0x4b57('0x30')]),_0x249461);if(_0x4c58e4['query']['filter']){_0x458f70[_0x4b57('0x38')]=_[_0x4b57('0x3a')](_0x458f70[_0x4b57('0x38')],{'$or':_['map'](_0x249461,function(_0x40414f){if(_0x40414f[_0x4b57('0x2c')]!==_0x4b57('0x3b')){var _0x3c086e={};_0x3c086e[_0x40414f['name']]={'$like':'%'+_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x3c')]+'%'};return _0x3c086e;}})});}_0x458f70=_[_0x4b57('0x3a')]({},_0x458f70,_0x4c58e4[_0x4b57('0x3d')]);var _0x56528f={'where':_0x458f70['where']};return db['WhatsappQueueReport'][_0x4b57('0x1c')](_0x56528f)[_0x4b57('0x23')](function(_0x188f24){_0x3af22f[_0x4b57('0x1c')]=_0x188f24;if(_0x4c58e4['query'][_0x4b57('0x3e')]){_0x458f70[_0x4b57('0x3f')]=[{'all':!![]}];}return db[_0x4b57('0x40')][_0x4b57('0x41')](_0x458f70);})[_0x4b57('0x23')](function(_0x453129){_0x3af22f[_0x4b57('0x42')]=_0x453129;return _0x3af22f;})[_0x4b57('0x23')](respondWithFilteredResult(_0x1ea0cb,_0x458f70))[_0x4b57('0x43')](handleError(_0x1ea0cb,null));};exports['show']=function(_0x318187,_0x3685fd){var _0x3c5095={'raw':!![],'where':{'id':_0x318187[_0x4b57('0x44')]['id']}},_0x5b2f50={};_0x5b2f50['model']=_[_0x4b57('0x2f')](db[_0x4b57('0x40')][_0x4b57('0x2a')]);_0x5b2f50[_0x4b57('0x2e')]=_[_0x4b57('0x2f')](_0x318187[_0x4b57('0x2e')]);_0x5b2f50[_0x4b57('0x30')]=_[_0x4b57('0x32')](_0x5b2f50[_0x4b57('0x2d')],_0x5b2f50[_0x4b57('0x2e')]);_0x3c5095[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x5b2f50[_0x4b57('0x2d')],qs['fields'](_0x318187['query'][_0x4b57('0x33')]));_0x3c5095[_0x4b57('0x31')]=_0x3c5095[_0x4b57('0x31')][_0x4b57('0x34')]?_0x3c5095['attributes']:_0x5b2f50[_0x4b57('0x2d')];if(_0x318187[_0x4b57('0x2e')]['includeAll']){_0x3c5095[_0x4b57('0x3f')]=[{'all':!![]}];}_0x3c5095=_['merge']({},_0x3c5095,_0x318187[_0x4b57('0x3d')]);return db['WhatsappQueueReport']['find'](_0x3c5095)[_0x4b57('0x23')](handleEntityNotFound(_0x3685fd,null))[_0x4b57('0x23')](respondWithResult(_0x3685fd,null))['catch'](handleError(_0x3685fd,null));};exports[_0x4b57('0x45')]=function(_0xc19684,_0x2732ff){return db[_0x4b57('0x40')][_0x4b57('0x45')](_0xc19684[_0x4b57('0x46')],{})['then'](respondWithResult(_0x2732ff,0xc9))[_0x4b57('0x43')](handleError(_0x2732ff,null));};exports[_0x4b57('0x22')]=function(_0x4a632c,_0xd529fb){if(_0x4a632c[_0x4b57('0x46')]['id']){delete _0x4a632c[_0x4b57('0x46')]['id'];}return db['WhatsappQueueReport'][_0x4b57('0x47')]({'where':{'id':_0x4a632c['params']['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0xd529fb,null))[_0x4b57('0x23')](saveUpdates(_0x4a632c[_0x4b57('0x46')],null))[_0x4b57('0x23')](respondWithResult(_0xd529fb,null))[_0x4b57('0x43')](handleError(_0xd529fb,null));};exports[_0x4b57('0x24')]=function(_0x3d1ecd,_0x3ec6ba){return db['WhatsappQueueReport'][_0x4b57('0x47')]({'where':{'id':_0x3d1ecd[_0x4b57('0x44')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x3ec6ba,null))['then'](removeEntity(_0x3ec6ba,null))[_0x4b57('0x43')](handleError(_0x3ec6ba,null));};exports[_0x4b57('0x48')]=function(_0x32985f,_0x488bea){return db[_0x4b57('0x40')][_0x4b57('0x48')]()[_0x4b57('0x23')](respondWithResult(_0x488bea,null))[_0x4b57('0x43')](handleError(_0x488bea,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index e609541..24d658c 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 _0xb6ca=['moment','bluebird','path','rimraf','../../config/environment','exports','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2a2fc8,_0x2b2af8){var _0x321184=function(_0x40f865){while(--_0x40f865){_0x2a2fc8['push'](_0x2a2fc8['shift']());}};_0x321184(++_0x2b2af8);}(_0xb6ca,0x1bf));var _0xab6c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb6ca[_0x122096];return _0x3d1966;};'use strict';var _=require(_0xab6c('0x0'));var util=require(_0xab6c('0x1'));var logger=require(_0xab6c('0x2'))(_0xab6c('0x3'));var moment=require(_0xab6c('0x4'));var BPromise=require(_0xab6c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab6c('0x6'));var rimraf=require(_0xab6c('0x7'));var config=require(_0xab6c('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xab6c('0x9')]=function(_0x27546c,_0x2887c2){return _0x27546c['define']('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xab6c('0xa'),'fields':[_0xab6c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69d2=['../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69d2,0xd1));var _0x269d=function(_0x34b558,_0x38a872){_0x34b558=_0x34b558-0x0;var _0x37c6f9=_0x69d2[_0x34b558];return _0x37c6f9;};'use strict';var _=require(_0x269d('0x0'));var util=require(_0x269d('0x1'));var logger=require(_0x269d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x269d('0x3'));var rp=require(_0x269d('0x4'));var fs=require('fs');var path=require(_0x269d('0x5'));var rimraf=require(_0x269d('0x6'));var config=require(_0x269d('0x7'));var attributes=require(_0x269d('0x8'));module[_0x269d('0x9')]=function(_0x2629e7,_0x4f5f9b){return _0x2629e7[_0x269d('0xa')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x269d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 1d325a4..1068b7d 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 _0xb28a=['WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','body','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','update','options','where','limit','then','stringify','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x21536f,_0xd31221){var _0x27dcd4=function(_0x3aac4d){while(--_0x3aac4d){_0x21536f['push'](_0x21536f['shift']());}};_0x27dcd4(++_0xd31221);}(_0xb28a,0xef));var _0xab28=function(_0x20cf33,_0x384a39){_0x20cf33=_0x20cf33-0x0;var _0x4cda99=_0xb28a[_0x20cf33];return _0x4cda99;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab28('0x0'));var BPromise=require(_0xab28('0x1'));var rs=require(_0xab28('0x2'));var fs=require('fs');var Redis=require(_0xab28('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xab28('0x4'));var logger=require('../../config/logger')(_0xab28('0x5'));var config=require(_0xab28('0x6'));var jayson=require(_0xab28('0x7'));var client=jayson[_0xab28('0x8')][_0xab28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f9a21,_0x49a63e,_0x5d27f5){return new BPromise(function(_0xde2c4d,_0x5c8442){return client[_0xab28('0xa')](_0x3f9a21,_0x5d27f5)['then'](function(_0x1e2c01){logger[_0xab28('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x49a63e,_0xab28('0xc'));logger[_0xab28('0xd')](_0xab28('0xe'),_0x49a63e,_0xab28('0xc'),JSON['stringify'](_0x1e2c01));if(_0x1e2c01['error']){if(_0x1e2c01[_0xab28('0xf')][_0xab28('0x10')]===0x1f4){logger[_0xab28('0xf')](_0xab28('0x11'),_0x49a63e,_0x1e2c01[_0xab28('0xf')][_0xab28('0x12')]);return _0x5c8442(_0x1e2c01[_0xab28('0xf')][_0xab28('0x12')]);}logger[_0xab28('0xf')](_0xab28('0x11'),_0x49a63e,_0x1e2c01[_0xab28('0xf')]['message']);return _0xde2c4d(_0x1e2c01[_0xab28('0xf')]['message']);}else{logger[_0xab28('0xb')](_0xab28('0x11'),_0x49a63e,_0xab28('0xc'));_0xde2c4d(_0x1e2c01[_0xab28('0x13')][_0xab28('0x12')]);}})[_0xab28('0x14')](function(_0xb05ffb){logger[_0xab28('0xf')](_0xab28('0x11'),_0x49a63e,_0xb05ffb);_0x5c8442(_0xb05ffb);});});}exports['CreateWhatsappQueueReport']=function(_0x2849d3){var _0x3f1203=this;return new Promise(function(_0x1258ea,_0x39592c){return db['WhatsappQueueReport']['create'](_0x2849d3[_0xab28('0x15')],{'raw':_0x2849d3['options']?_0x2849d3['options'][_0xab28('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0xf2634a){logger[_0xab28('0xb')](_0xab28('0x17'),_0x2849d3);logger['debug'](_0xab28('0x17'),_0x2849d3,JSON['stringify'](_0xf2634a));_0x1258ea(_0xf2634a);})[_0xab28('0x14')](function(_0x6bcde5){logger[_0xab28('0xf')](_0xab28('0x17'),_0x6bcde5['message'],_0x2849d3);_0x39592c(_0x3f1203[_0xab28('0xf')](0x1f4,_0x6bcde5[_0xab28('0x12')]));});});};exports[_0xab28('0x18')]=function(_0x4f144a){var _0xc70d9e=this;return new Promise(function(_0x4a7c39,_0x33dbf7){return db[_0xab28('0x19')][_0xab28('0x1a')](_0x4f144a[_0xab28('0x15')],{'raw':_0x4f144a['options']?_0x4f144a[_0xab28('0x1b')][_0xab28('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f144a[_0xab28('0x1b')]?_0x4f144a['options'][_0xab28('0x1c')]||null:null,'attributes':_0x4f144a[_0xab28('0x1b')]?_0x4f144a[_0xab28('0x1b')]['attributes']||null:null,'limit':_0x4f144a[_0xab28('0x1b')]?_0x4f144a['options'][_0xab28('0x1d')]||null:null})[_0xab28('0x1e')](function(_0x839ff9){logger[_0xab28('0xb')](_0xab28('0x18'),_0x4f144a);logger['debug'](_0xab28('0x18'),_0x4f144a,JSON[_0xab28('0x1f')](_0x839ff9));_0x4a7c39(_0x839ff9);})[_0xab28('0x14')](function(_0x2c606e){logger['error'](_0xab28('0x18'),_0x2c606e[_0xab28('0x12')],_0x4f144a);_0x33dbf7(_0xc70d9e[_0xab28('0xf')](0x1f4,_0x2c606e[_0xab28('0x12')]));});});}; \ No newline at end of file +var _0xf55f=['message','result','catch','CreateWhatsappQueueReport','create','body','options','then','WhatsappQueueReport','update','raw','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x206096,_0x1c6cfd){var _0x3f3b50=function(_0xfc6422){while(--_0xfc6422){_0x206096['push'](_0x206096['shift']());}};_0x3f3b50(++_0x1c6cfd);}(_0xf55f,0x18f));var _0xff55=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xf55f[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0xff55('0x0'));var util=require(_0xff55('0x1'));var moment=require(_0xff55('0x2'));var BPromise=require(_0xff55('0x3'));var rs=require(_0xff55('0x4'));var fs=require('fs');var Redis=require(_0xff55('0x5'));var db=require(_0xff55('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff55('0x7'));var config=require('../../config/environment');var jayson=require(_0xff55('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4158a2,_0x3b6ab3,_0x4243d7){return new BPromise(function(_0x1b6cc3,_0x3bbabf){return client['request'](_0x4158a2,_0x4243d7)['then'](function(_0x49b060){logger[_0xff55('0x9')](_0xff55('0xa'),_0x3b6ab3,'request\x20sent');logger[_0xff55('0xb')](_0xff55('0xc'),_0x3b6ab3,_0xff55('0xd'),JSON[_0xff55('0xe')](_0x49b060));if(_0x49b060[_0xff55('0xf')]){if(_0x49b060[_0xff55('0xf')][_0xff55('0x10')]===0x1f4){logger[_0xff55('0xf')](_0xff55('0xa'),_0x3b6ab3,_0x49b060['error'][_0xff55('0x11')]);return _0x3bbabf(_0x49b060[_0xff55('0xf')][_0xff55('0x11')]);}logger[_0xff55('0xf')](_0xff55('0xa'),_0x3b6ab3,_0x49b060[_0xff55('0xf')]['message']);return _0x1b6cc3(_0x49b060[_0xff55('0xf')]['message']);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x3b6ab3,_0xff55('0xd'));_0x1b6cc3(_0x49b060[_0xff55('0x12')][_0xff55('0x11')]);}})[_0xff55('0x13')](function(_0x43bdb1){logger[_0xff55('0xf')](_0xff55('0xa'),_0x3b6ab3,_0x43bdb1);_0x3bbabf(_0x43bdb1);});});}exports[_0xff55('0x14')]=function(_0x5ab3eb){var _0x37a078=this;return new Promise(function(_0x2c3d57,_0x1da221){return db['WhatsappQueueReport'][_0xff55('0x15')](_0x5ab3eb[_0xff55('0x16')],{'raw':_0x5ab3eb[_0xff55('0x17')]?_0x5ab3eb[_0xff55('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xff55('0x18')](function(_0x2d8f79){logger['info']('CreateWhatsappQueueReport',_0x5ab3eb);logger[_0xff55('0xb')]('CreateWhatsappQueueReport',_0x5ab3eb,JSON[_0xff55('0xe')](_0x2d8f79));_0x2c3d57(_0x2d8f79);})[_0xff55('0x13')](function(_0x4ead84){logger[_0xff55('0xf')](_0xff55('0x14'),_0x4ead84['message'],_0x5ab3eb);_0x1da221(_0x37a078[_0xff55('0xf')](0x1f4,_0x4ead84[_0xff55('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x247d59){var _0x40abed=this;return new Promise(function(_0x5e2c6f,_0x4d0cdd){return db[_0xff55('0x19')][_0xff55('0x1a')](_0x247d59['body'],{'raw':_0x247d59[_0xff55('0x17')]?_0x247d59['options'][_0xff55('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x247d59[_0xff55('0x17')]?_0x247d59['options'][_0xff55('0x1c')]||null:null,'attributes':_0x247d59[_0xff55('0x17')]?_0x247d59[_0xff55('0x17')][_0xff55('0x1d')]||null:null,'limit':_0x247d59[_0xff55('0x17')]?_0x247d59[_0xff55('0x17')][_0xff55('0x1e')]||null:null})['then'](function(_0x4fa871){logger[_0xff55('0x9')](_0xff55('0x1f'),_0x247d59);logger['debug'](_0xff55('0x1f'),_0x247d59,JSON[_0xff55('0xe')](_0x4fa871));_0x5e2c6f(_0x4fa871);})[_0xff55('0x13')](function(_0x3234e0){logger[_0xff55('0xf')](_0xff55('0x1f'),_0x3234e0['message'],_0x247d59);_0x4d0cdd(_0x40abed[_0xff55('0xf')](0x1f4,_0x3234e0['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index e1a459f..079ad72 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 _0x98f3=['/:id','show','post','create','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x98f3,0xff));var _0x398f=function(_0x58910b,_0x540685){_0x58910b=_0x58910b-0x0;var _0xfe1259=_0x98f3[_0x58910b];return _0xfe1259;};'use strict';var multer=require('multer');var util=require(_0x398f('0x0'));var path=require(_0x398f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x398f('0x2'));var auth=require(_0x398f('0x3'));var interaction=require(_0x398f('0x4'));var config=require('../../config/environment');var controller=require(_0x398f('0x5'));router[_0x398f('0x6')]('/',auth[_0x398f('0x7')](),controller[_0x398f('0x8')]);router['get'](_0x398f('0x9'),auth[_0x398f('0x7')](),controller[_0x398f('0xa')]);router[_0x398f('0x6')](_0x398f('0xb'),auth[_0x398f('0x7')](),controller[_0x398f('0xc')]);router[_0x398f('0xd')]('/',auth[_0x398f('0x7')](),controller[_0x398f('0xe')]);router['put'](_0x398f('0xb'),auth[_0x398f('0x7')](),controller[_0x398f('0xf')]);router[_0x398f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x398f('0x11')]);module[_0x398f('0x12')]=router; \ No newline at end of file +var _0x8c7b=['./whatsappTransferReport.controller','index','get','/describe','isAuthenticated','/:id','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x8c7b,0x9b));var _0xb8c7=function(_0x2c300c,_0x7ebf98){_0x2c300c=_0x2c300c-0x0;var _0x68852d=_0x8c7b[_0x2c300c];return _0x68852d;};'use strict';var multer=require(_0xb8c7('0x0'));var util=require(_0xb8c7('0x1'));var path=require('path');var timeout=require(_0xb8c7('0x2'));var express=require('express');var router=express[_0xb8c7('0x3')]();var fs_extra=require(_0xb8c7('0x4'));var auth=require(_0xb8c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb8c7('0x6'));var controller=require(_0xb8c7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb8c7('0x8')]);router[_0xb8c7('0x9')](_0xb8c7('0xa'),auth[_0xb8c7('0xb')](),controller['describe']);router['get'](_0xb8c7('0xc'),auth[_0xb8c7('0xb')](),controller['show']);router['post']('/',auth[_0xb8c7('0xb')](),controller[_0xb8c7('0xd')]);router[_0xb8c7('0xe')](_0xb8c7('0xc'),auth[_0xb8c7('0xb')](),controller[_0xb8c7('0xf')]);router[_0xb8c7('0x10')](_0xb8c7('0xc'),auth[_0xb8c7('0xb')](),controller['destroy']);module[_0xb8c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 27d4317..52ffada 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 _0x62cf=['agent','sequelize','STRING','account'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x62cf,0x81));var _0xf62c=function(_0x4cddc7,_0xc7087d){_0x4cddc7=_0x4cddc7-0x0;var _0x241ae9=_0x62cf[_0x4cddc7];return _0x241ae9;};'use strict';var Sequelize=require(_0xf62c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf62c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf62c('0x2'),_0xf62c('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x758a=['ENUM','account','agent','sequelize','exports','STRING'];(function(_0x227b79,_0x270fff){var _0x345c3a=function(_0x230333){while(--_0x230333){_0x227b79['push'](_0x227b79['shift']());}};_0x345c3a(++_0x270fff);}(_0x758a,0x1d1));var _0xa758=function(_0x14fbce,_0x1cb144){_0x14fbce=_0x14fbce-0x0;var _0x7e9153=_0x758a[_0x14fbce];return _0x7e9153;};'use strict';var Sequelize=require(_0xa758('0x0'));module[_0xa758('0x1')]={'uniqueid':{'type':Sequelize[_0xa758('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa758('0x3')](_0xa758('0x4'),_0xa758('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a48c722..34ce87e 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 _0x51c5=['Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','WhatsappTransferReport','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','create','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set'];(function(_0x51f87c,_0x474cae){var _0x4c6284=function(_0x2ef3f1){while(--_0x2ef3f1){_0x51f87c['push'](_0x51f87c['shift']());}};_0x4c6284(++_0x474cae);}(_0x51c5,0xc8));var _0x551c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x51c5[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x551c('0x0'));var jsonpatch=require(_0x551c('0x1'));var rp=require(_0x551c('0x2'));var moment=require(_0x551c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x551c('0x4'));var util=require(_0x551c('0x5'));var path=require(_0x551c('0x6'));var sox=require(_0x551c('0x7'));var csv=require(_0x551c('0x8'));var ejs=require(_0x551c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x551c('0xa'));var squel=require(_0x551c('0xb'));var crypto=require(_0x551c('0xc'));var jsforce=require(_0x551c('0xd'));var deskjs=require(_0x551c('0xe'));var toCsv=require(_0x551c('0x8'));var querystring=require(_0x551c('0xf'));var Papa=require(_0x551c('0x10'));var Redis=require(_0x551c('0x11'));var authService=require(_0x551c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x551c('0x13'));var logger=require('../../config/logger')(_0x551c('0x14'));var utils=require(_0x551c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x551c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd80b2,_0x3db0d9){_0x3db0d9=_0x3db0d9||0xcc;return function(_0x32fa3d){if(_0x32fa3d){return _0xcd80b2[_0x551c('0x17')](_0x3db0d9);}return _0xcd80b2[_0x551c('0x18')](_0x3db0d9)[_0x551c('0x19')]();};}function respondWithResult(_0x1c3c83,_0x569557){_0x569557=_0x569557||0xc8;return function(_0x2587a3){if(_0x2587a3){return _0x1c3c83[_0x551c('0x18')](_0x569557)['json'](_0x2587a3);}};}function respondWithFilteredResult(_0x5db2ea,_0x19713e){return function(_0xedf795){if(_0xedf795){var _0x1af11e=typeof _0x19713e['offset']===_0x551c('0x1a')&&typeof _0x19713e[_0x551c('0x1b')]===_0x551c('0x1a');var _0x532dca=_0xedf795[_0x551c('0x1c')];var _0x29d639=_0x1af11e?0x0:_0x19713e['offset'];var _0x34e284=_0x1af11e?_0xedf795['count']:_0x19713e[_0x551c('0x1d')]+_0x19713e[_0x551c('0x1b')];var _0x16c4d7;if(_0x34e284>=_0x532dca){_0x34e284=_0x532dca;_0x16c4d7=0xc8;}else{_0x16c4d7=0xce;}_0x5db2ea['status'](_0x16c4d7);return _0x5db2ea[_0x551c('0x1e')](_0x551c('0x1f'),_0x29d639+'-'+_0x34e284+'/'+_0x532dca)[_0x551c('0x20')](_0xedf795);}return null;};}function patchUpdates(_0x1fff90){return function(_0x5b7d3b){try{jsonpatch[_0x551c('0x21')](_0x5b7d3b,_0x1fff90,!![]);}catch(_0x1a9916){return BPromise[_0x551c('0x22')](_0x1a9916);}return _0x5b7d3b['save']();};}function saveUpdates(_0x3a9a45,_0x10e611){return function(_0x4613e0){if(_0x4613e0){return _0x4613e0[_0x551c('0x23')](_0x3a9a45)[_0x551c('0x24')](function(_0x4f7398){return _0x4f7398;});}return null;};}function removeEntity(_0x1e664e,_0x520220){return function(_0x24b561){if(_0x24b561){return _0x24b561[_0x551c('0x25')]()['then'](function(){_0x1e664e['status'](0xcc)[_0x551c('0x19')]();});}};}function handleEntityNotFound(_0x23db19,_0x2cc0a6){return function(_0xc101){if(!_0xc101){_0x23db19[_0x551c('0x17')](0x194);}return _0xc101;};}function handleError(_0x2e4110,_0xeb9dce){_0xeb9dce=_0xeb9dce||0x1f4;return function(_0xdefd66){logger[_0x551c('0x26')](_0xdefd66[_0x551c('0x27')]);if(_0xdefd66['name']){delete _0xdefd66['name'];}_0x2e4110[_0x551c('0x18')](_0xeb9dce)[_0x551c('0x28')](_0xdefd66);};}exports[_0x551c('0x29')]=function(_0x37db6c,_0x37b5fa){var _0x20dc09={},_0x6d940b={},_0x1ca9d0={'count':0x0,'rows':[]};var _0x2290bd=_[_0x551c('0x2a')](db[_0x551c('0x2b')]['rawAttributes'],function(_0x40fc65){return{'name':_0x40fc65[_0x551c('0x2c')],'type':_0x40fc65[_0x551c('0x2d')][_0x551c('0x2e')]};});_0x6d940b[_0x551c('0x2f')]=_[_0x551c('0x2a')](_0x2290bd,_0x551c('0x30'));_0x6d940b[_0x551c('0x31')]=_['keys'](_0x37db6c[_0x551c('0x31')]);_0x6d940b[_0x551c('0x32')]=_[_0x551c('0x33')](_0x6d940b['model'],_0x6d940b[_0x551c('0x31')]);_0x20dc09[_0x551c('0x34')]=_[_0x551c('0x33')](_0x6d940b[_0x551c('0x2f')],qs[_0x551c('0x35')](_0x37db6c[_0x551c('0x31')][_0x551c('0x35')]));_0x20dc09[_0x551c('0x34')]=_0x20dc09[_0x551c('0x34')][_0x551c('0x36')]?_0x20dc09['attributes']:_0x6d940b[_0x551c('0x2f')];if(!_0x37db6c[_0x551c('0x31')][_0x551c('0x37')](_0x551c('0x38'))){_0x20dc09[_0x551c('0x1b')]=qs['limit'](_0x37db6c[_0x551c('0x31')][_0x551c('0x1b')]);_0x20dc09[_0x551c('0x1d')]=qs['offset'](_0x37db6c[_0x551c('0x31')][_0x551c('0x1d')]);}_0x20dc09[_0x551c('0x39')]=qs[_0x551c('0x3a')](_0x37db6c[_0x551c('0x31')]['sort']);_0x20dc09[_0x551c('0x3b')]=qs[_0x551c('0x32')](_['pick'](_0x37db6c['query'],_0x6d940b[_0x551c('0x32')]),_0x2290bd);if(_0x37db6c[_0x551c('0x31')][_0x551c('0x3c')]){_0x20dc09[_0x551c('0x3b')]=_[_0x551c('0x3d')](_0x20dc09[_0x551c('0x3b')],{'$or':_['map'](_0x2290bd,function(_0x1e7945){if(_0x1e7945['type']!==_0x551c('0x3e')){var _0x2fabe8={};_0x2fabe8[_0x1e7945[_0x551c('0x30')]]={'$like':'%'+_0x37db6c[_0x551c('0x31')][_0x551c('0x3c')]+'%'};return _0x2fabe8;}})});}_0x20dc09=_['merge']({},_0x20dc09,_0x37db6c['options']);var _0xcb0e12={'where':_0x20dc09[_0x551c('0x3b')]};return db[_0x551c('0x2b')][_0x551c('0x1c')](_0xcb0e12)['then'](function(_0x2212c2){_0x1ca9d0[_0x551c('0x1c')]=_0x2212c2;if(_0x37db6c[_0x551c('0x31')][_0x551c('0x3f')]){_0x20dc09[_0x551c('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x551c('0x41')](_0x20dc09);})[_0x551c('0x24')](function(_0x5c66eb){_0x1ca9d0[_0x551c('0x42')]=_0x5c66eb;return _0x1ca9d0;})[_0x551c('0x24')](respondWithFilteredResult(_0x37b5fa,_0x20dc09))['catch'](handleError(_0x37b5fa,null));};exports[_0x551c('0x43')]=function(_0x3fd39a,_0x3a0ecf){var _0x527b66={'raw':!![],'where':{'id':_0x3fd39a[_0x551c('0x44')]['id']}},_0x47d0ff={};_0x47d0ff['model']=_[_0x551c('0x45')](db['WhatsappTransferReport'][_0x551c('0x46')]);_0x47d0ff['query']=_[_0x551c('0x45')](_0x3fd39a[_0x551c('0x31')]);_0x47d0ff['filters']=_[_0x551c('0x33')](_0x47d0ff[_0x551c('0x2f')],_0x47d0ff[_0x551c('0x31')]);_0x527b66[_0x551c('0x34')]=_['intersection'](_0x47d0ff[_0x551c('0x2f')],qs[_0x551c('0x35')](_0x3fd39a[_0x551c('0x31')][_0x551c('0x35')]));_0x527b66[_0x551c('0x34')]=_0x527b66[_0x551c('0x34')][_0x551c('0x36')]?_0x527b66[_0x551c('0x34')]:_0x47d0ff['model'];if(_0x3fd39a['query'][_0x551c('0x3f')]){_0x527b66[_0x551c('0x40')]=[{'all':!![]}];}_0x527b66=_[_0x551c('0x3d')]({},_0x527b66,_0x3fd39a[_0x551c('0x47')]);return db['WhatsappTransferReport'][_0x551c('0x48')](_0x527b66)[_0x551c('0x24')](handleEntityNotFound(_0x3a0ecf,null))[_0x551c('0x24')](respondWithResult(_0x3a0ecf,null))['catch'](handleError(_0x3a0ecf,null));};exports[_0x551c('0x49')]=function(_0x3950d2,_0x5564c1){return db['WhatsappTransferReport'][_0x551c('0x49')](_0x3950d2[_0x551c('0x4a')],{})[_0x551c('0x24')](respondWithResult(_0x5564c1,0xc9))['catch'](handleError(_0x5564c1,null));};exports[_0x551c('0x23')]=function(_0x2a01ea,_0x55ca9c){if(_0x2a01ea['body']['id']){delete _0x2a01ea[_0x551c('0x4a')]['id'];}return db[_0x551c('0x2b')][_0x551c('0x48')]({'where':{'id':_0x2a01ea['params']['id']}})[_0x551c('0x24')](handleEntityNotFound(_0x55ca9c,null))[_0x551c('0x24')](saveUpdates(_0x2a01ea[_0x551c('0x4a')],null))[_0x551c('0x24')](respondWithResult(_0x55ca9c,null))['catch'](handleError(_0x55ca9c,null));};exports[_0x551c('0x25')]=function(_0x2e34e0,_0x4f583f){return db[_0x551c('0x2b')][_0x551c('0x48')]({'where':{'id':_0x2e34e0[_0x551c('0x44')]['id']}})[_0x551c('0x24')](handleEntityNotFound(_0x4f583f,null))[_0x551c('0x24')](removeEntity(_0x4f583f,null))[_0x551c('0x4b')](handleError(_0x4f583f,null));};exports[_0x551c('0x4c')]=function(_0x4a82a5,_0x18ee4a){return db['WhatsappTransferReport'][_0x551c('0x4c')]()['then'](respondWithResult(_0x18ee4a,null))[_0x551c('0x4b')](handleError(_0x18ee4a,null));}; \ No newline at end of file +var _0xc771=['apply','save','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','update','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xc771,0x100));var _0x1c77=function(_0x5dd7c7,_0x821ecf){_0x5dd7c7=_0x5dd7c7-0x0;var _0xbc6cb0=_0xc771[_0x5dd7c7];return _0xbc6cb0;};'use strict';var emlformat=require(_0x1c77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c77('0x1'));var moment=require(_0x1c77('0x2'));var BPromise=require(_0x1c77('0x3'));var Mustache=require(_0x1c77('0x4'));var util=require('util');var path=require(_0x1c77('0x5'));var sox=require(_0x1c77('0x6'));var csv=require(_0x1c77('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c77('0x8'));var _=require('lodash');var squel=require(_0x1c77('0x9'));var crypto=require('crypto');var jsforce=require(_0x1c77('0xa'));var deskjs=require(_0x1c77('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1c77('0xc'));var Papa=require(_0x1c77('0xd'));var Redis=require(_0x1c77('0xe'));var authService=require(_0x1c77('0xf'));var qs=require(_0x1c77('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c77('0x11'));var logger=require(_0x1c77('0x12'))(_0x1c77('0x13'));var utils=require('../../config/utils');var config=require(_0x1c77('0x14'));var licenseUtil=require(_0x1c77('0x15'));var db=require(_0x1c77('0x16'))['db'];function respondWithStatusCode(_0x5ebe40,_0x134a0c){_0x134a0c=_0x134a0c||0xcc;return function(_0x2b77f8){if(_0x2b77f8){return _0x5ebe40[_0x1c77('0x17')](_0x134a0c);}return _0x5ebe40[_0x1c77('0x18')](_0x134a0c)[_0x1c77('0x19')]();};}function respondWithResult(_0x2d4c00,_0x5de66a){_0x5de66a=_0x5de66a||0xc8;return function(_0x5ec0f9){if(_0x5ec0f9){return _0x2d4c00['status'](_0x5de66a)[_0x1c77('0x1a')](_0x5ec0f9);}};}function respondWithFilteredResult(_0x3643d2,_0x251de2){return function(_0x5e814c){if(_0x5e814c){var _0x336bb7=typeof _0x251de2[_0x1c77('0x1b')]==='undefined'&&typeof _0x251de2[_0x1c77('0x1c')]===_0x1c77('0x1d');var _0x36d504=_0x5e814c['count'];var _0x15fddf=_0x336bb7?0x0:_0x251de2['offset'];var _0x4aff6e=_0x336bb7?_0x5e814c[_0x1c77('0x1e')]:_0x251de2[_0x1c77('0x1b')]+_0x251de2[_0x1c77('0x1c')];var _0x518846;if(_0x4aff6e>=_0x36d504){_0x4aff6e=_0x36d504;_0x518846=0xc8;}else{_0x518846=0xce;}_0x3643d2[_0x1c77('0x18')](_0x518846);return _0x3643d2['set'](_0x1c77('0x1f'),_0x15fddf+'-'+_0x4aff6e+'/'+_0x36d504)['json'](_0x5e814c);}return null;};}function patchUpdates(_0x21839e){return function(_0x2454ff){try{jsonpatch[_0x1c77('0x20')](_0x2454ff,_0x21839e,!![]);}catch(_0x4a083c){return BPromise['reject'](_0x4a083c);}return _0x2454ff[_0x1c77('0x21')]();};}function saveUpdates(_0x3880f3,_0x579c7c){return function(_0x13e394){if(_0x13e394){return _0x13e394['update'](_0x3880f3)[_0x1c77('0x22')](function(_0x1f971d){return _0x1f971d;});}return null;};}function removeEntity(_0x5f4d07,_0x445213){return function(_0x420b2d){if(_0x420b2d){return _0x420b2d[_0x1c77('0x23')]()[_0x1c77('0x22')](function(){_0x5f4d07[_0x1c77('0x18')](0xcc)[_0x1c77('0x19')]();});}};}function handleEntityNotFound(_0x26d660,_0xae35ff){return function(_0x2c94a5){if(!_0x2c94a5){_0x26d660[_0x1c77('0x17')](0x194);}return _0x2c94a5;};}function handleError(_0x18453f,_0x293340){_0x293340=_0x293340||0x1f4;return function(_0x36f235){logger[_0x1c77('0x24')](_0x36f235[_0x1c77('0x25')]);if(_0x36f235[_0x1c77('0x26')]){delete _0x36f235['name'];}_0x18453f['status'](_0x293340)[_0x1c77('0x27')](_0x36f235);};}exports[_0x1c77('0x28')]=function(_0x35597c,_0x20c7ef){var _0x56330a={},_0x2bf1fd={},_0x3286f7={'count':0x0,'rows':[]};var _0x350e14=_[_0x1c77('0x29')](db[_0x1c77('0x2a')][_0x1c77('0x2b')],function(_0x5121eb){return{'name':_0x5121eb['fieldName'],'type':_0x5121eb['type']['key']};});_0x2bf1fd[_0x1c77('0x2c')]=_[_0x1c77('0x29')](_0x350e14,_0x1c77('0x26'));_0x2bf1fd[_0x1c77('0x2d')]=_[_0x1c77('0x2e')](_0x35597c[_0x1c77('0x2d')]);_0x2bf1fd[_0x1c77('0x2f')]=_[_0x1c77('0x30')](_0x2bf1fd[_0x1c77('0x2c')],_0x2bf1fd[_0x1c77('0x2d')]);_0x56330a[_0x1c77('0x31')]=_[_0x1c77('0x30')](_0x2bf1fd[_0x1c77('0x2c')],qs[_0x1c77('0x32')](_0x35597c[_0x1c77('0x2d')][_0x1c77('0x32')]));_0x56330a[_0x1c77('0x31')]=_0x56330a[_0x1c77('0x31')][_0x1c77('0x33')]?_0x56330a[_0x1c77('0x31')]:_0x2bf1fd[_0x1c77('0x2c')];if(!_0x35597c['query']['hasOwnProperty'](_0x1c77('0x34'))){_0x56330a[_0x1c77('0x1c')]=qs[_0x1c77('0x1c')](_0x35597c[_0x1c77('0x2d')][_0x1c77('0x1c')]);_0x56330a['offset']=qs[_0x1c77('0x1b')](_0x35597c[_0x1c77('0x2d')][_0x1c77('0x1b')]);}_0x56330a[_0x1c77('0x35')]=qs[_0x1c77('0x36')](_0x35597c[_0x1c77('0x2d')][_0x1c77('0x36')]);_0x56330a[_0x1c77('0x37')]=qs[_0x1c77('0x2f')](_[_0x1c77('0x38')](_0x35597c['query'],_0x2bf1fd[_0x1c77('0x2f')]),_0x350e14);if(_0x35597c[_0x1c77('0x2d')][_0x1c77('0x39')]){_0x56330a[_0x1c77('0x37')]=_[_0x1c77('0x3a')](_0x56330a[_0x1c77('0x37')],{'$or':_['map'](_0x350e14,function(_0x4d9edb){if(_0x4d9edb[_0x1c77('0x3b')]!==_0x1c77('0x3c')){var _0x30f12e={};_0x30f12e[_0x4d9edb[_0x1c77('0x26')]]={'$like':'%'+_0x35597c[_0x1c77('0x2d')][_0x1c77('0x39')]+'%'};return _0x30f12e;}})});}_0x56330a=_['merge']({},_0x56330a,_0x35597c[_0x1c77('0x3d')]);var _0x218c06={'where':_0x56330a['where']};return db[_0x1c77('0x2a')]['count'](_0x218c06)['then'](function(_0x2a2d32){_0x3286f7[_0x1c77('0x1e')]=_0x2a2d32;if(_0x35597c[_0x1c77('0x2d')][_0x1c77('0x3e')]){_0x56330a[_0x1c77('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x56330a);})[_0x1c77('0x22')](function(_0x3be197){_0x3286f7[_0x1c77('0x40')]=_0x3be197;return _0x3286f7;})[_0x1c77('0x22')](respondWithFilteredResult(_0x20c7ef,_0x56330a))[_0x1c77('0x41')](handleError(_0x20c7ef,null));};exports[_0x1c77('0x42')]=function(_0xe8cbfc,_0x2f9519){var _0x2ee157={'raw':!![],'where':{'id':_0xe8cbfc[_0x1c77('0x43')]['id']}},_0x42dcd3={};_0x42dcd3[_0x1c77('0x2c')]=_[_0x1c77('0x2e')](db['WhatsappTransferReport'][_0x1c77('0x2b')]);_0x42dcd3['query']=_[_0x1c77('0x2e')](_0xe8cbfc[_0x1c77('0x2d')]);_0x42dcd3['filters']=_[_0x1c77('0x30')](_0x42dcd3[_0x1c77('0x2c')],_0x42dcd3[_0x1c77('0x2d')]);_0x2ee157[_0x1c77('0x31')]=_[_0x1c77('0x30')](_0x42dcd3[_0x1c77('0x2c')],qs[_0x1c77('0x32')](_0xe8cbfc['query'][_0x1c77('0x32')]));_0x2ee157[_0x1c77('0x31')]=_0x2ee157[_0x1c77('0x31')][_0x1c77('0x33')]?_0x2ee157[_0x1c77('0x31')]:_0x42dcd3[_0x1c77('0x2c')];if(_0xe8cbfc[_0x1c77('0x2d')][_0x1c77('0x3e')]){_0x2ee157[_0x1c77('0x3f')]=[{'all':!![]}];}_0x2ee157=_[_0x1c77('0x3a')]({},_0x2ee157,_0xe8cbfc['options']);return db[_0x1c77('0x2a')]['find'](_0x2ee157)[_0x1c77('0x22')](handleEntityNotFound(_0x2f9519,null))[_0x1c77('0x22')](respondWithResult(_0x2f9519,null))[_0x1c77('0x41')](handleError(_0x2f9519,null));};exports['create']=function(_0x329ed8,_0x44ab87){return db[_0x1c77('0x2a')]['create'](_0x329ed8['body'],{})[_0x1c77('0x22')](respondWithResult(_0x44ab87,0xc9))[_0x1c77('0x41')](handleError(_0x44ab87,null));};exports[_0x1c77('0x44')]=function(_0x14830c,_0x1f005c){if(_0x14830c[_0x1c77('0x45')]['id']){delete _0x14830c['body']['id'];}return db[_0x1c77('0x2a')][_0x1c77('0x46')]({'where':{'id':_0x14830c['params']['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x1f005c,null))[_0x1c77('0x22')](saveUpdates(_0x14830c[_0x1c77('0x45')],null))[_0x1c77('0x22')](respondWithResult(_0x1f005c,null))[_0x1c77('0x41')](handleError(_0x1f005c,null));};exports[_0x1c77('0x23')]=function(_0x404a31,_0x57fa95){return db[_0x1c77('0x2a')][_0x1c77('0x46')]({'where':{'id':_0x404a31[_0x1c77('0x43')]['id']}})[_0x1c77('0x22')](handleEntityNotFound(_0x57fa95,null))[_0x1c77('0x22')](removeEntity(_0x57fa95,null))[_0x1c77('0x41')](handleError(_0x57fa95,null));};exports[_0x1c77('0x47')]=function(_0x16b1f1,_0x3068b6){return db[_0x1c77('0x2a')][_0x1c77('0x47')]()['then'](respondWithResult(_0x3068b6,null))[_0x1c77('0x41')](handleError(_0x3068b6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ce4ae23..e0fe8a2 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 _0x5c7a=['rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2db91b,_0x232f91){var _0x187932=function(_0x3d7826){while(--_0x3d7826){_0x2db91b['push'](_0x2db91b['shift']());}};_0x187932(++_0x232f91);}(_0x5c7a,0x14c));var _0xa5c7=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x5c7a[_0x460fd7];return _0x44d1c2;};'use strict';var _=require(_0xa5c7('0x0'));var util=require(_0xa5c7('0x1'));var logger=require(_0xa5c7('0x2'))('api');var moment=require(_0xa5c7('0x3'));var BPromise=require(_0xa5c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5c7('0x5'));var rimraf=require(_0xa5c7('0x6'));var config=require(_0xa5c7('0x7'));var attributes=require(_0xa5c7('0x8'));module['exports']=function(_0x109653,_0x2cfbb8){return _0x109653[_0xa5c7('0x9')](_0xa5c7('0xa'),attributes,{'tableName':_0xa5c7('0xb'),'paranoid':![],'indexes':[{'name':_0xa5c7('0xc'),'fields':[_0xa5c7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b56=['define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4da044,_0x24e84f){var _0x3568ca=function(_0x25beba){while(--_0x25beba){_0x4da044['push'](_0x4da044['shift']());}};_0x3568ca(++_0x24e84f);}(_0x7b56,0x15f));var _0x67b5=function(_0x543dc5,_0x5e6b7b){_0x543dc5=_0x543dc5-0x0;var _0x3c8fb5=_0x7b56[_0x543dc5];return _0x3c8fb5;};'use strict';var _=require(_0x67b5('0x0'));var util=require(_0x67b5('0x1'));var logger=require(_0x67b5('0x2'))(_0x67b5('0x3'));var moment=require('moment');var BPromise=require(_0x67b5('0x4'));var rp=require(_0x67b5('0x5'));var fs=require('fs');var path=require(_0x67b5('0x6'));var rimraf=require(_0x67b5('0x7'));var config=require(_0x67b5('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x545c14,_0x5c141b){return _0x545c14[_0x67b5('0x9')](_0x67b5('0xa'),attributes,{'tableName':_0x67b5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 9cdb442..02daf7b 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 _0xe1d6=['stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4055c0,_0x3b839b){var _0x42fdcc=function(_0x2b6eb8){while(--_0x2b6eb8){_0x4055c0['push'](_0x4055c0['shift']());}};_0x42fdcc(++_0x3b839b);}(_0xe1d6,0x65));var _0x6e1d=function(_0x5c5c12,_0x4e46b4){_0x5c5c12=_0x5c5c12-0x0;var _0x9da783=_0xe1d6[_0x5c5c12];return _0x9da783;};'use strict';var _=require('lodash');var util=require(_0x6e1d('0x0'));var moment=require(_0x6e1d('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e1d('0x2'));var fs=require('fs');var Redis=require(_0x6e1d('0x3'));var db=require(_0x6e1d('0x4'))['db'];var utils=require(_0x6e1d('0x5'));var logger=require(_0x6e1d('0x6'))(_0x6e1d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57a860,_0x48725e,_0x161f21){return new BPromise(function(_0xbd7c42,_0x2e2242){return client['request'](_0x57a860,_0x161f21)[_0x6e1d('0x9')](function(_0x4a65f7){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x48725e,_0x6e1d('0xa'));logger[_0x6e1d('0xb')](_0x6e1d('0xc'),_0x48725e,'request\x20sent',JSON[_0x6e1d('0xd')](_0x4a65f7));if(_0x4a65f7[_0x6e1d('0xe')]){if(_0x4a65f7[_0x6e1d('0xe')][_0x6e1d('0xf')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x48725e,_0x4a65f7[_0x6e1d('0xe')][_0x6e1d('0x10')]);return _0x2e2242(_0x4a65f7[_0x6e1d('0xe')][_0x6e1d('0x10')]);}logger[_0x6e1d('0xe')](_0x6e1d('0x11'),_0x48725e,_0x4a65f7[_0x6e1d('0xe')][_0x6e1d('0x10')]);return _0xbd7c42(_0x4a65f7['error'][_0x6e1d('0x10')]);}else{logger['info'](_0x6e1d('0x11'),_0x48725e,_0x6e1d('0xa'));_0xbd7c42(_0x4a65f7[_0x6e1d('0x12')][_0x6e1d('0x10')]);}})['catch'](function(_0x4cdacc){logger[_0x6e1d('0xe')](_0x6e1d('0x11'),_0x48725e,_0x4cdacc);_0x2e2242(_0x4cdacc);});});} \ No newline at end of file +var _0xc928=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x5d8c5b,_0x5c8916){var _0x508213=function(_0x548426){while(--_0x548426){_0x5d8c5b['push'](_0x5d8c5b['shift']());}};_0x508213(++_0x5c8916);}(_0xc928,0x7b));var _0x8c92=function(_0x5c8555,_0x1215a5){_0x5c8555=_0x5c8555-0x0;var _0x317211=_0xc928[_0x5c8555];return _0x317211;};'use strict';var _=require('lodash');var util=require(_0x8c92('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8c92('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c92('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c92('0x3'))(_0x8c92('0x4'));var config=require('../../config/environment');var jayson=require(_0x8c92('0x5'));var client=jayson[_0x8c92('0x6')][_0x8c92('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x465a8b,_0x2ccdd2,_0x39ae98){return new BPromise(function(_0x55c8e0,_0x3b4179){return client['request'](_0x465a8b,_0x39ae98)[_0x8c92('0x8')](function(_0x3732a5){logger['info'](_0x8c92('0x9'),_0x2ccdd2,_0x8c92('0xa'));logger[_0x8c92('0xb')](_0x8c92('0xc'),_0x2ccdd2,_0x8c92('0xa'),JSON['stringify'](_0x3732a5));if(_0x3732a5['error']){if(_0x3732a5[_0x8c92('0xd')][_0x8c92('0xe')]===0x1f4){logger[_0x8c92('0xd')](_0x8c92('0x9'),_0x2ccdd2,_0x3732a5[_0x8c92('0xd')]['message']);return _0x3b4179(_0x3732a5[_0x8c92('0xd')][_0x8c92('0xf')]);}logger[_0x8c92('0xd')](_0x8c92('0x9'),_0x2ccdd2,_0x3732a5[_0x8c92('0xd')][_0x8c92('0xf')]);return _0x55c8e0(_0x3732a5[_0x8c92('0xd')][_0x8c92('0xf')]);}else{logger[_0x8c92('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ccdd2,_0x8c92('0xa'));_0x55c8e0(_0x3732a5[_0x8c92('0x11')][_0x8c92('0xf')]);}})[_0x8c92('0x12')](function(_0x3aa99d){logger['error'](_0x8c92('0x9'),_0x2ccdd2,_0x3aa99d);_0x3b4179(_0x3aa99d);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d18036f..b47a816 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc03e=['./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','number','length','map','pm2_env','online','name','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/license','./config/environment','app'];(function(_0x445e0c,_0x6cdab6){var _0x1559ca=function(_0x364165){while(--_0x364165){_0x445e0c['push'](_0x445e0c['shift']());}};_0x1559ca(++_0x6cdab6);}(_0xc03e,0x15a));var _0xec03=function(_0x36e059,_0x19ee27){_0x36e059=_0x36e059-0x0;var _0x52ee13=_0xc03e[_0x36e059];return _0x52ee13;};'use strict';var _=require(_0xec03('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xec03('0x1'));var rpc=require('./rpc');var config=require(_0xec03('0x2'));var logger=require('./config/logger')(_0xec03('0x3'));var pm2=require(_0xec03('0x4'));var pm2Config=require(_0xec03('0x5'));var schedule=require(_0xec03('0x6'));var chat=require(_0xec03('0x7'));var whatsapp=require(_0xec03('0x8'));var transcribe=require(_0xec03('0x9'));var provider=require(_0xec03('0xa'));function main(){return db[_0xec03('0xb')]['sync']()[_0xec03('0xc')](function(){if(config[_0xec03('0xd')]){return seedDb[_0xec03('0xe')]();}})[_0xec03('0xc')](function(){return checkLicense['default']();})[_0xec03('0xc')](function(){return rpc[_0xec03('0xf')]();})[_0xec03('0xc')](function(_0x2e5e61){logger[_0xec03('0x10')](_0x2e5e61);return chat[_0xec03('0x11')]();})[_0xec03('0xc')](function(){return whatsapp[_0xec03('0x11')]();})['then'](function(){return schedule[_0xec03('0x11')]();})[_0xec03('0xc')](function(){return transcribe[_0xec03('0x11')]();})[_0xec03('0xc')](function(){return provider[_0xec03('0x11')]();})[_0xec03('0xc')](function(_0x8e5f46){logger[_0xec03('0x10')](_0x8e5f46);return pm2['start'](pm2Config);})['then'](function(_0x5ca0e2){var _0x252a60=_0x5ca0e2[_0xec03('0x12')](function(_0x3501ab){return typeof _0x3501ab[_0xec03('0x13')]===_0xec03('0x14')&&_0x3501ab[_0xec03('0x13')]>=0x0;});if(_0x252a60[_0xec03('0x15')]>0x0){throw new Error(_0x252a60[_0xec03('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xec03('0x16')](_0x252a60,function(_0x52f6ae){return'\x22'+_0x52f6ae[_0xec03('0x17')]['name']+'\x22';}));}logger[_0xec03('0x10')]('Online\x20apps:',_['map'](_[_0xec03('0x12')](_0x5ca0e2,{'status':_0xec03('0x18')}),_0xec03('0x19'))[_0xec03('0x1a')]());logger['info'](_0xec03('0x1b'),_['map'](_[_0xec03('0x12')](_0x5ca0e2,function(_0x253910){return _0x253910[_0xec03('0x1c')]!==_0xec03('0x18');}),_0xec03('0x19'))[_0xec03('0x1a')]()||_0xec03('0x1d'));console[_0xec03('0x1e')]('App\x20Ready!');})[_0xec03('0x1f')](function(_0x568c36){console[_0xec03('0x1e')](_0xec03('0x20'),_0x568c36);logger[_0xec03('0x21')](_0xec03('0x22'),_0x568c36);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x92e0=['sequelize','sync','seedDB','default','then','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','log','App\x20Ready!','catch','exit','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider'];(function(_0x5d54d9,_0x47fa33){var _0x187fa6=function(_0x4d295b){while(--_0x4d295b){_0x5d54d9['push'](_0x5d54d9['shift']());}};_0x187fa6(++_0x47fa33);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x092e('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x092e('0x1'));var checkLicense=require(_0x092e('0x2'));var rpc=require(_0x092e('0x3'));var config=require(_0x092e('0x4'));var logger=require(_0x092e('0x5'))(_0x092e('0x6'));var pm2=require(_0x092e('0x7'));var pm2Config=require(_0x092e('0x8'));var schedule=require(_0x092e('0x9'));var chat=require(_0x092e('0xa'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x092e('0xb'));function main(){return db[_0x092e('0xc')][_0x092e('0xd')]()['then'](function(){if(config[_0x092e('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x092e('0xf')]();})[_0x092e('0x10')](function(){return rpc['listen']();})[_0x092e('0x10')](function(_0x5a468e){logger['info'](_0x5a468e);return chat[_0x092e('0x11')]();})['then'](function(){return whatsapp[_0x092e('0x11')]();})['then'](function(){return schedule['start']();})[_0x092e('0x10')](function(){return transcribe['start']();})[_0x092e('0x10')](function(){return provider[_0x092e('0x11')]();})[_0x092e('0x10')](function(_0xcfb407){logger[_0x092e('0x12')](_0xcfb407);return pm2['start'](pm2Config);})['then'](function(_0x254911){var _0xc7e05a=_0x254911['filter'](function(_0x311622){return typeof _0x311622[_0x092e('0x13')]===_0x092e('0x14')&&_0x311622[_0x092e('0x13')]>=0x0;});if(_0xc7e05a['length']>0x0){throw new Error(_0xc7e05a[_0x092e('0x15')]+_0x092e('0x16')+_[_0x092e('0x17')](_0xc7e05a,function(_0x49f5c1){return'\x22'+_0x49f5c1[_0x092e('0x18')][_0x092e('0x19')]+'\x22';}));}logger[_0x092e('0x12')](_0x092e('0x1a'),_[_0x092e('0x17')](_['filter'](_0x254911,{'status':_0x092e('0x1b')}),_0x092e('0x19'))['join']());logger[_0x092e('0x12')]('Offline\x20apps:',_[_0x092e('0x17')](_['filter'](_0x254911,function(_0x4fa6ae){return _0x4fa6ae['status']!==_0x092e('0x1b');}),_0x092e('0x19'))['join']()||'None');console[_0x092e('0x1c')](_0x092e('0x1d'));})[_0x092e('0x1e')](function(_0x362346){console[_0x092e('0x1c')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x362346);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x362346);process[_0x092e('0x1f')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 5b10c2a..a0c589e 100644 --- a/server/components/auth/service.js +++ b/server/components/auth/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x550bc8,_0x4e3932){var _0x4c0a4c=function(_0x466749){while(--_0x466749){_0x550bc8['push'](_0x550bc8['shift']());}};_0x4c0a4c(++_0x4e3932);}(_0x00bb,0x1d8));var _0xb00b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x00bb[_0x30ae5e];return _0x1f2e93;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x2b30bd,_0x6e4b1){var _0xd3e8a4=function(_0x331616){while(--_0x331616){_0x2b30bd['push'](_0x2b30bd['shift']());}};_0xd3e8a4(++_0x6e4b1);}(_0x55ca,0x126));var _0xa55c=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x55ca[_0x190ff6];return _0x5356d2;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f7a3e58..f63b821 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 _0x1a57=['findOne','all','fieldType','type','./sql-utils','../../mysqldb','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','filter','user','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','clause','getFilteredContacts','rows','catch','CmContact','describe','keys','startsWith','cf_','map','CmCustomField'];(function(_0xd83c77,_0x343752){var _0x392ee8=function(_0x576335){while(--_0x576335){_0xd83c77['push'](_0xd83c77['shift']());}};_0x392ee8(++_0x343752);}(_0x1a57,0x1cb));var _0x71a5=function(_0x56ccb9,_0x1873b1){_0x56ccb9=_0x56ccb9-0x0;var _0x476c22=_0x1a57[_0x56ccb9];return _0x476c22;};'use strict';var _=require('lodash');var sqlUtils=require(_0x71a5('0x0'));var db=require(_0x71a5('0x1'))['db'];exports[_0x71a5('0x2')]=function(_0x21c9d3,_0x595b95,_0x570ab2,_0x3aec1b){var _0x5e4255={'count':0x0,'rows':[]};var _0x3eb33d=sqlUtils['skipContactsQuery'](_0x595b95,_0x21c9d3);if(_0x3eb33d){return Promise['resolve'](_0x5e4255);}var _0x533552=sqlUtils['getContactsSubquery']();var _0x35aadf={};var _0x410d60=![];var _0x215511=![];return Promise[_0x71a5('0x3')]()[_0x71a5('0x4')](function(){if(_0x21c9d3[_0x71a5('0x5')]){return sqlUtils[_0x71a5('0x6')](_0x21c9d3['search'],_0x3aec1b);}else{return sqlUtils['parseQueryParameters'](_0x21c9d3,_0x3aec1b);}})['then'](function(_0x299d9e){_0x533552[_0x71a5('0x7')](_0x299d9e[_0x71a5('0x8')]);_0x533552[_0x71a5('0x7')](_0x299d9e[_0x71a5('0x9')]);_0x533552[_0x71a5('0x7')](_0x299d9e[_0x71a5('0xa')]);_0x533552['where'](_0x299d9e[_0x71a5('0xb')]['clause']);_0x35aadf=_0x299d9e[_0x71a5('0xc')];_0x215511=_0x299d9e[_0x71a5('0xb')][_0x71a5('0xd')];return sqlUtils[_0x71a5('0xe')](_0x595b95,_0x21c9d3,_0x215511);})[_0x71a5('0x4')](function(_0x44ee14){_0x533552[_0x71a5('0x7')](_0x44ee14);var _0x4178eb=_0x21c9d3[_0x71a5('0x5')]?_0x35aadf[_0x71a5('0xf')]:_0x21c9d3[_0x71a5('0x10')];_0x410d60=_0x4178eb?!![]:![];return sqlUtils[_0x71a5('0x11')](_0x533552,_0x4178eb);})[_0x71a5('0x4')](function(_0x563d3d){_0x5e4255[_0x71a5('0x12')]=_0x563d3d;if(_0x5e4255[_0x71a5('0x12')]===0x0){return;}if(_0x21c9d3[_0x71a5('0x13')]){_0x215511=!![];}return sqlUtils['buildContactsQuery'](_0x533552,_0x21c9d3['fields'],_0x570ab2,_0x410d60,_0x35aadf[_0x71a5('0x14')],_0x215511);})[_0x71a5('0x4')](function(_0x3786d4){if(!_0x3786d4){return[];}return sqlUtils[_0x71a5('0x15')](_0x3786d4,_0x21c9d3,_0x570ab2);})[_0x71a5('0x4')](function(_0x1e22ec){_0x5e4255[_0x71a5('0x16')]=_0x1e22ec;return _0x5e4255;})[_0x71a5('0x17')](function(_0x4cb1e5){throw _0x4cb1e5;});};exports['describe']=function(){var _0x495ddb={};var _0x36b32f=[];return db[_0x71a5('0x18')][_0x71a5('0x19')]()[_0x71a5('0x4')](function(_0x30b342){_0x495ddb=_0x30b342;var _0x496692=Object[_0x71a5('0x1a')](_0x495ddb)['filter'](function(_0x1e75ba){return _[_0x71a5('0x1b')](_0x1e75ba,_0x71a5('0x1c'))?_0x1e75ba:undefined;});var _0x3d54c8=_0x496692[_0x71a5('0x1d')](function(_0x20c26b){return db[_0x71a5('0x1e')][_0x71a5('0x1f')]({'where':{'id':_0x20c26b['slice'](0x3)},'raw':!![]});});return Promise[_0x71a5('0x20')](_0x3d54c8);})[_0x71a5('0x4')](function(_0x5505f4){for(var _0x5adadd=0x0;_0x5adadd<_0x5505f4['length'];_0x5adadd++){if(_0x5505f4[_0x5adadd]){var _0x42229d=_0x71a5('0x1c')+_0x5505f4[_0x5adadd]['id'];_0x495ddb[_0x42229d][_0x71a5('0x21')]=_0x5505f4[_0x5adadd]['type'];}}_0x36b32f=_[_0x71a5('0x1d')](Object['keys'](_0x495ddb),function(_0xcc5be8){return{'name':_0xcc5be8,'type':_0x495ddb[_0xcc5be8][_0x71a5('0x22')]};});return _0x36b32f;})['catch'](function(_0x16ac54){throw _0x16ac54;});}; \ No newline at end of file +var _0x717d=['fields','user','clause','skip','checkListsRestrictions','ids','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','filter','startsWith','cf_','CmCustomField','findOne','slice','all','length','type','map','./sql-utils','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where'];(function(_0x16bf12,_0x5af840){var _0x1ac7e3=function(_0x525650){while(--_0x525650){_0x16bf12['push'](_0x16bf12['shift']());}};_0x1ac7e3(++_0x5af840);}(_0x717d,0x190));var _0xd717=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0x717d[_0x330141];return _0x1b68a2;};'use strict';var _=require('lodash');var sqlUtils=require(_0xd717('0x0'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x22bacd,_0x3c9c24,_0x408654,_0xf60efe){var _0x2aef96={'count':0x0,'rows':[]};var _0x523a85=sqlUtils['skipContactsQuery'](_0x3c9c24,_0x22bacd);if(_0x523a85){return Promise[_0xd717('0x1')](_0x2aef96);}var _0x4dad4f=sqlUtils['getContactsSubquery']();var _0x204b87={};var _0x181621=![];var _0x2a32d9=![];return Promise[_0xd717('0x1')]()[_0xd717('0x2')](function(){if(_0x22bacd[_0xd717('0x3')]){return sqlUtils[_0xd717('0x4')](_0x22bacd[_0xd717('0x3')],_0xf60efe);}else{return sqlUtils[_0xd717('0x5')](_0x22bacd,_0xf60efe);}})[_0xd717('0x2')](function(_0x5675e9){_0x4dad4f['where'](_0x5675e9[_0xd717('0x6')]);_0x4dad4f[_0xd717('0x7')](_0x5675e9[_0xd717('0x8')]);_0x4dad4f['where'](_0x5675e9['filter']);_0x4dad4f[_0xd717('0x7')](_0x5675e9[_0xd717('0x9')][_0xd717('0xa')]);_0x204b87=_0x5675e9['tags'];_0x2a32d9=_0x5675e9[_0xd717('0x9')][_0xd717('0xb')];return sqlUtils[_0xd717('0xc')](_0x3c9c24,_0x22bacd,_0x2a32d9);})[_0xd717('0x2')](function(_0x197c7d){_0x4dad4f['where'](_0x197c7d);var _0xd3c239=_0x22bacd[_0xd717('0x3')]?_0x204b87[_0xd717('0xd')]:_0x22bacd['tag'];_0x181621=_0xd3c239?!![]:![];return sqlUtils[_0xd717('0xe')](_0x4dad4f,_0xd3c239);})['then'](function(_0x46a5f3){_0x2aef96[_0xd717('0xf')]=_0x46a5f3;if(_0x2aef96[_0xd717('0xf')]===0x0){return;}if(_0x22bacd[_0xd717('0x10')]){_0x2a32d9=!![];}return sqlUtils[_0xd717('0x11')](_0x4dad4f,_0x22bacd['fields'],_0x408654,_0x181621,_0x204b87[_0xd717('0xa')],_0x2a32d9);})[_0xd717('0x2')](function(_0x189800){if(!_0x189800){return[];}return sqlUtils[_0xd717('0x12')](_0x189800,_0x22bacd,_0x408654);})[_0xd717('0x2')](function(_0x48930a){_0x2aef96[_0xd717('0x13')]=_0x48930a;return _0x2aef96;})[_0xd717('0x14')](function(_0x3548c4){throw _0x3548c4;});};exports['describe']=function(){var _0xec8fc2={};var _0x995aee=[];return db[_0xd717('0x15')][_0xd717('0x16')]()[_0xd717('0x2')](function(_0x1280a5){_0xec8fc2=_0x1280a5;var _0x40e67a=Object[_0xd717('0x17')](_0xec8fc2)[_0xd717('0x18')](function(_0x2aed5f){return _[_0xd717('0x19')](_0x2aed5f,_0xd717('0x1a'))?_0x2aed5f:undefined;});var _0x198f81=_0x40e67a['map'](function(_0x2822f1){return db[_0xd717('0x1b')][_0xd717('0x1c')]({'where':{'id':_0x2822f1[_0xd717('0x1d')](0x3)},'raw':!![]});});return Promise[_0xd717('0x1e')](_0x198f81);})[_0xd717('0x2')](function(_0x121096){for(var _0x2e0947=0x0;_0x2e0947<_0x121096[_0xd717('0x1f')];_0x2e0947++){if(_0x121096[_0x2e0947]){var _0x37105e=_0xd717('0x1a')+_0x121096[_0x2e0947]['id'];_0xec8fc2[_0x37105e]['fieldType']=_0x121096[_0x2e0947][_0xd717('0x20')];}}_0x995aee=_[_0xd717('0x21')](Object['keys'](_0xec8fc2),function(_0x1d250d){return{'name':_0x1d250d,'type':_0xec8fc2[_0x1d250d][_0xd717('0x20')]};});return _0x995aee;})['catch'](function(_0x54df3a){throw _0x54df3a;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 09236c0..647953d 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 _0x3f04=['split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','value','start','end','Tag','map','clause','tags','ids','User','user','and','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','concat','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','c.id','limit','offset','group','subqry.id','having','order','color','Sequelize','QueryTypes','SELECT','query','toString','Tags','clone','isEmpty','t.id\x20IN\x20?','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','firstName','phone','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','replace'];(function(_0x448b2b,_0x10a6b2){var _0x4fa5d3=function(_0xbaf763){while(--_0xbaf763){_0x448b2b['push'](_0x448b2b['shift']());}};_0x4fa5d3(++_0x10a6b2);}(_0x3f04,0x110));var _0x43f0=function(_0x3887c4,_0x35209f){_0x3887c4=_0x3887c4-0x0;var _0x1c61b3=_0x3f04[_0x3887c4];return _0x1c61b3;};'use strict';var _=require(_0x43f0('0x0'));var squel=require(_0x43f0('0x1'));var as=require(_0x43f0('0x2'));var qs=require(_0x43f0('0x3'));var utils=require('../interaction/utils');var db=require(_0x43f0('0x4'))['db'];function skipContactsQuery(_0x2cd590,_0x3a0d57){var _0x5289c9=![];if(_0x2cd590[_0x43f0('0x5')]===_0x43f0('0x6')&&!_0x3a0d57[_0x43f0('0x7')]&&!_0x3a0d57[_0x43f0('0x8')]&&_0x3a0d57[_0x43f0('0x9')]!==_0x43f0('0xa')){_0x5289c9=!![];}return _0x5289c9;}function getContactsSubquery(){return squel[_0x43f0('0xb')]()[_0x43f0('0xc')](_0x43f0('0xd'),'c')[_0x43f0('0xe')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x4e5226,_0x2567f2){var _0x2b66b2=_0x2567f2?'c':_0x43f0('0xf');_0x4e5226[_0x43f0('0x10')](_0x43f0('0x11'),'uc',_0x43f0('0x12')+_0x2b66b2+_0x43f0('0x13'))['left_join']('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x2b66b2+_0x43f0('0x13'))[_0x43f0('0x10')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x4e5226;}function addFieldsToQuery(_0x3b36fb,_0x2d740a,_0x4b7850,_0x107186,_0x35dd24){var _0x349f3f=_0x35dd24?'c':_0x43f0('0xf');if(!_0x2d740a){_0x2d740a=['id',_0x43f0('0x14'),'lastName',_0x43f0('0x15'),'mobile',_0x43f0('0x16'),_0x43f0('0x17'),_0x43f0('0x8'),_0x43f0('0x18'),_0x43f0('0x19'),_0x43f0('0x1a'),_0x43f0('0x1b'),_0x43f0('0x1c')];}else if(!_0x2d740a[_0x43f0('0x1d')]('id')){_0x2d740a[_0x43f0('0x1e')]('id');}var _0x5e504c=_0x4b7850&&_0x35dd24||!_0x4b7850&&!_0x35dd24;if(_0x107186){_0x5e504c=_0x107186&&_0x35dd24||!_0x107186&&!_0x35dd24;}_0x2d740a[_0x43f0('0x1f')](function(_0x2ec039){if(_0x2ec039==='TagIds'){if(_0x5e504c){_0x3b36fb['field'](_0x43f0('0x20'),_0x2ec039);}else if(_0x4b7850||_0x107186){_0x3b36fb['field'](_0x349f3f+'.'+_0x2ec039);}}else{_0x3b36fb[_0x43f0('0x21')](_0x349f3f+'.'+_0x2ec039);}});return _0x3b36fb;}function getSqlClauses(){var _0x434196={'default':squel[_0x43f0('0x22')](),'fields':squel[_0x43f0('0x22')](),'filter':squel[_0x43f0('0x22')](),'tags':{'clause':squel[_0x43f0('0x22')](),'ids':null},'user':{'clause':squel[_0x43f0('0x22')](),'skip':![]}};return _0x434196;}function parseTagParameter(_0x4b8ec4){var _0x31650c=squel['expr']();if(_0x4b8ec4){var _0x4f69fd=utils[_0x43f0('0x23')](_0x4b8ec4);_0x4f69fd[_0x43f0('0x1f')](function(_0x3595e0){_0x31650c['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3595e0+',%');});}return _0x31650c;}function parseSearchFilter(_0x22fbe6){var _0xedfc5d=squel[_0x43f0('0x22')]();if(_0x22fbe6){var _0x1ca259=_0x22fbe6[_0x43f0('0x24')]('\x5c','\x5c\x5c')[_0x43f0('0x24')](/'/g,'\x27\x27');if(_0x1ca259[_0x43f0('0x25')]('\x20')[_0x43f0('0x26')]>0x1){_0xedfc5d['or'](_0x43f0('0x27'),qs[_0x43f0('0x28')](_0x1ca259,!![]),null);}else{if(qs[_0x43f0('0x29')](_0x1ca259)){_0xedfc5d['or'](_0x43f0('0x2a'),_0x1ca259+'%');_0xedfc5d['or']('c.phone\x20LIKE\x20?',_0x1ca259+'%');_0xedfc5d['or'](_0x43f0('0x2b'),_0x1ca259+'%');_0xedfc5d['or']('c.fax\x20LIKE\x20?',_0x1ca259+'%');}else if(qs[_0x43f0('0x2c')](_0x1ca259)){_0xedfc5d['or'](_0x43f0('0x2d'),_0x1ca259+'%');}else{_0xedfc5d['or']('c.firstName\x20LIKE\x20?','%'+_0x1ca259+'%');_0xedfc5d['or']('c.lastName\x20LIKE\x20?','%'+_0x1ca259+'%');_0xedfc5d['or']('c.email\x20LIKE\x20?','%'+_0x1ca259+'%');}}}return _0xedfc5d;}function parseAdvancedSearchFilter(_0x53988d,_0x164956){var _0x564021=getSqlClauses();var _0x36cf8d=as[_0x43f0('0x2e')](_0x53988d);var _0x78c60f=_0x36cf8d[_0x43f0('0x2f')];for(var _0x369cd6=0x0;_0x369cd6<_0x36cf8d[_0x43f0('0x30')][_0x43f0('0x26')];_0x369cd6++){var _0x12e707=_0x36cf8d[_0x43f0('0x30')][_0x369cd6];var _0x796935='c';var _0x5241ce=_[_0x43f0('0x31')](_0x164956,[_0x43f0('0x32'),_0x12e707['field']]);if(_0x5241ce){if(_0x12e707[_0x43f0('0x21')]===_0x43f0('0x33')||_0x5241ce['fieldType']===_0x43f0('0x34')){_0x12e707[_0x43f0('0x35')]=_0x43f0('0x36');}var _0xca0f7a=as[_0x43f0('0x37')](_0x796935,_0x5241ce[_0x43f0('0x38')],_0x12e707);_0x564021['default'][_0x78c60f](_0xca0f7a[_0x43f0('0x39')],_0xca0f7a[_0x43f0('0x3a')][_0x43f0('0x3b')],_0xca0f7a[_0x43f0('0x3a')][_0x43f0('0x3c')]);}else{if(_0x12e707[_0x43f0('0x21')]===_0x43f0('0x3d')){var _0x410855=_0x12e707[_0x43f0('0x3a')][_0x43f0('0x25')](',')[_0x43f0('0x3e')](function(_0x28a302){return Number(_0x28a302);});var _0x3855f9=parseTagParameter(_0x410855);_0x564021['tags'][_0x43f0('0x3f')]['and'](_0x3855f9);_0x564021[_0x43f0('0x40')][_0x43f0('0x41')]=_0x410855;}else if(_0x12e707[_0x43f0('0x21')]===_0x43f0('0x42')){_0x564021[_0x43f0('0x43')][_0x43f0('0x3f')][_0x43f0('0x44')](_0x43f0('0x45'),_0x12e707[_0x43f0('0x3a')]);_0x564021[_0x43f0('0x43')][_0x43f0('0x46')]=!![];}}}return _0x564021;}function parseModelFields(_0x58515a,_0x5d1547){var _0x44bf98=squel[_0x43f0('0x22')]();var _0x31aeb2=_(_0x58515a)[_0x43f0('0x47')]()[_0x43f0('0x3e')](function(_0x1a36cc){return _[_0x43f0('0x48')](_0x5d1547,[_0x43f0('0x32'),_0x1a36cc])?_0x1a36cc:undefined;})[_0x43f0('0x49')]()[_0x43f0('0x3a')]();if(_0x58515a[_0x43f0('0x4a')]){_0x31aeb2[_0x43f0('0x1e')]('Contact');}if(_0x58515a['User']){_0x31aeb2['push'](_0x43f0('0x42'));}if(_0x31aeb2[_0x43f0('0x26')]>0x0){_0x31aeb2['forEach'](function(_0x48d227){if(_0x48d227===_0x43f0('0x8')){_0x44bf98['and']('c.ListId\x20IN\x20?',[][_0x43f0('0x4b')](_0x58515a[_0x48d227]));}else if(_0x48d227==='Contact'){var _0x269790='%'+_0x58515a[_0x48d227]+'%';_0x44bf98[_0x43f0('0x44')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x269790);}else if(_0x48d227===_0x43f0('0x42')){_0x44bf98[_0x43f0('0x44')](_0x43f0('0x45'),_0x58515a[_0x48d227]);}else{_0x44bf98['and']('c.'+_0x48d227+'\x20=\x20?',_0x58515a[_0x48d227]);}});}return _0x44bf98;}function parseQueryParameters(_0x594246,_0x3224a4){var _0x19034a=getSqlClauses();return Promise[_0x43f0('0x4c')]()[_0x43f0('0x4d')](function(){return parseModelFields(_0x594246,_0x3224a4);})[_0x43f0('0x4d')](function(_0x3e4bf9){_0x19034a['fields'][_0x43f0('0x44')](_0x3e4bf9);return parseTagParameter(_0x594246[_0x43f0('0x4e')]);})[_0x43f0('0x4d')](function(_0x3fb6cf){_0x19034a['tags'][_0x43f0('0x3f')][_0x43f0('0x44')](_0x3fb6cf);return parseSearchFilter(_0x594246['filter']);})['then'](function(_0x40c73e){_0x19034a[_0x43f0('0x4f')]=_0x40c73e;return _0x19034a;});}function checkListsRestrictions(_0xdb0808,_0x2d6514,_0x4c5bbf){var _0x532972=squel[_0x43f0('0x22')]();return Promise[_0x43f0('0x4c')]()['then'](function(){if(_0x2d6514[_0x43f0('0x7')]&&_0xdb0808[_0x43f0('0x5')]===_0x43f0('0x6')&&!_0x4c5bbf){return _0xdb0808[_0x43f0('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2ee0c9){if(_0x2ee0c9){if(_0x2ee0c9[_0x43f0('0x26')]===0x0){_0x532972[_0x43f0('0x44')](_0x43f0('0x51'));}else{_0x532972['and'](_0x43f0('0x52'),_['map'](_0x2ee0c9,'id'));}}})['then'](function(){return _0x532972;});}function buildContactsQuery(_0x13131e,_0x335105,_0x230dcc,_0x35ae85,_0x299ba7,_0x52c012){if(_0x335105){_0x335105=_0x230dcc[_0x43f0('0x53')];}_0x13131e=addFieldsToQuery(_0x13131e,_0x335105,_0x35ae85,_0x52c012,!![]);var _0x557a1e=squel[_0x43f0('0xb')]();_0x557a1e=addFieldsToQuery(_0x557a1e,_0x335105,_0x35ae85,_0x52c012,![]);if(_0x35ae85||_0x52c012){_0x13131e=applyJoinClauses(_0x13131e,!![]);_0x13131e['group'](_0x43f0('0x54'));if(_0x230dcc[_0x43f0('0x55')]){_0x557a1e[_0x43f0('0x55')](_0x230dcc[_0x43f0('0x55')]);}if(_0x230dcc[_0x43f0('0x56')]){_0x557a1e[_0x43f0('0x56')](_0x230dcc['offset']);}}else{_0x557a1e=applyJoinClauses(_0x557a1e,![]);_0x557a1e[_0x43f0('0x57')](_0x43f0('0x58'));if(_0x230dcc['limit']){_0x13131e[_0x43f0('0x55')](_0x230dcc[_0x43f0('0x55')]);}if(_0x230dcc[_0x43f0('0x56')]){_0x13131e[_0x43f0('0x56')](_0x230dcc[_0x43f0('0x56')]);}}_0x557a1e[_0x43f0('0x59')](_0x299ba7);if(_0x230dcc[_0x43f0('0x5a')]){_0x230dcc[_0x43f0('0x5a')][_0x43f0('0x1f')](function(_0x51bfbb){_0x13131e['order']('c.'+_0x51bfbb[0x0],_0x51bfbb[0x1]==='DESC'?![]:!![]);_0x557a1e[_0x43f0('0x5a')]('subqry.'+_0x51bfbb[0x0],_0x51bfbb[0x1]==='DESC'?![]:!![]);});}_0x557a1e['from'](_0x13131e,'subqry');return _0x557a1e;}function getFilteredContacts(_0x4b2c61){var _0x1334ce=[];return db[_0x43f0('0x3d')]['findAll']({'attributes':['id',_0x43f0('0x32'),_0x43f0('0x5b')],'raw':!![]})[_0x43f0('0x4d')](function(_0x498285){_0x1334ce=_['keyBy'](_0x498285,'id');var _0x5a3797={'type':db[_0x43f0('0x5c')][_0x43f0('0x5d')][_0x43f0('0x5e')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x43f0('0x5f')](_0x4b2c61[_0x43f0('0x60')](),_0x5a3797);})['then'](function(_0x4b859a){_0x4b859a['forEach'](function(_0x2a280b){if(_0x2a280b[_0x43f0('0x1c')]){_0x2a280b[_0x43f0('0x61')]=[];_0x2a280b[_0x43f0('0x1c')][_0x43f0('0x25')](',')['forEach'](function(_0x3165f4){_0x2a280b[_0x43f0('0x61')]['push'](_0x1334ce[_0x3165f4]);});}delete _0x2a280b[_0x43f0('0x1c')];});return _0x4b859a;});}function countFilteredContacts(_0x26c278,_0x35a0b8){var _0x2b05b9=_0x26c278[_0x43f0('0x62')]();_0x2b05b9['field']('COUNT(*)');_0x2b05b9=applyJoinClauses(_0x2b05b9,!![]);_0x26c278['group'](_0x43f0('0x54'));var _0x52221d=utils['getSelectedTags'](_0x35a0b8);if(!_[_0x43f0('0x63')](_0x52221d)){_0x2b05b9[_0x43f0('0xe')](_0x43f0('0x64'),_0x52221d);}var _0x4e3133={'type':db[_0x43f0('0x5c')][_0x43f0('0x5d')][_0x43f0('0x5e')],'raw':!![]};return db['sequelize'][_0x43f0('0x5f')](_0x2b05b9[_0x43f0('0x60')](),_0x4e3133)['then'](function(_0x2ee5e6){return _0x2ee5e6[0x0][_0x43f0('0x65')];});}module[_0x43f0('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x6c25=['deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','datetime','castTo','buildExpression','type','default','text','value','start','end','Tag','map','tags','User','user','clause','and','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','tag','filter','attributes','group','c.id','limit','offset','having','order','DESC','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','COUNT(*)','isEmpty','sequelize','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','uc.CmContactId\x20=\x20','.id','left_join','ct.CmContactId\x20=\x20','lastName','phone','mobile','createdAt','updatedAt'];(function(_0x77a80,_0x291213){var _0x1bff34=function(_0x185b2e){while(--_0x185b2e){_0x77a80['push'](_0x77a80['shift']());}};_0x1bff34(++_0x291213);}(_0x6c25,0x119));var _0x56c2=function(_0x3d16b7,_0x4df8e5){_0x3d16b7=_0x3d16b7-0x0;var _0x41aadd=_0x6c25[_0x3d16b7];return _0x41aadd;};'use strict';var _=require(_0x56c2('0x0'));var squel=require('squel');var as=require(_0x56c2('0x1'));var qs=require(_0x56c2('0x2'));var utils=require(_0x56c2('0x3'));var db=require(_0x56c2('0x4'))['db'];function skipContactsQuery(_0x4353b9,_0x114f7d){var _0x3570ab=![];if(_0x4353b9[_0x56c2('0x5')]===_0x56c2('0x6')&&!_0x114f7d[_0x56c2('0x7')]&&!_0x114f7d[_0x56c2('0x8')]&&_0x114f7d[_0x56c2('0x9')]!==_0x56c2('0xa')){_0x3570ab=!![];}return _0x3570ab;}function getContactsSubquery(){return squel[_0x56c2('0xb')]()[_0x56c2('0xc')](_0x56c2('0xd'),'c')[_0x56c2('0xe')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x46b6c0,_0x7f3510){var _0x28b4c2=_0x7f3510?'c':_0x56c2('0xf');_0x46b6c0['left_join']('cm_user_has_contacts','uc',_0x56c2('0x10')+_0x28b4c2+_0x56c2('0x11'))[_0x56c2('0x12')]('cm_contact_has_tags','ct',_0x56c2('0x13')+_0x28b4c2+'.id')['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x46b6c0;}function addFieldsToQuery(_0x91de96,_0x1fee88,_0x2f198e,_0x64bb78,_0x39d1f2){var _0x108583=_0x39d1f2?'c':_0x56c2('0xf');if(!_0x1fee88){_0x1fee88=['id','firstName',_0x56c2('0x14'),_0x56c2('0x15'),_0x56c2('0x16'),'fax','email',_0x56c2('0x8'),'CompanyId',_0x56c2('0x17'),_0x56c2('0x18'),_0x56c2('0x19'),_0x56c2('0x1a')];}else if(!_0x1fee88[_0x56c2('0x1b')]('id')){_0x1fee88[_0x56c2('0x1c')]('id');}var _0x253112=_0x2f198e&&_0x39d1f2||!_0x2f198e&&!_0x39d1f2;if(_0x64bb78){_0x253112=_0x64bb78&&_0x39d1f2||!_0x64bb78&&!_0x39d1f2;}_0x1fee88[_0x56c2('0x1d')](function(_0x1d9c81){if(_0x1d9c81===_0x56c2('0x1a')){if(_0x253112){_0x91de96[_0x56c2('0x1e')](_0x56c2('0x1f'),_0x1d9c81);}else if(_0x2f198e||_0x64bb78){_0x91de96[_0x56c2('0x1e')](_0x108583+'.'+_0x1d9c81);}}else{_0x91de96[_0x56c2('0x1e')](_0x108583+'.'+_0x1d9c81);}});return _0x91de96;}function getSqlClauses(){var _0x4df303={'default':squel['expr'](),'fields':squel[_0x56c2('0x20')](),'filter':squel[_0x56c2('0x20')](),'tags':{'clause':squel[_0x56c2('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4df303;}function parseTagParameter(_0x244c22){var _0x3f18c9=squel['expr']();if(_0x244c22){var _0x270b70=utils[_0x56c2('0x21')](_0x244c22);_0x270b70[_0x56c2('0x1d')](function(_0x212fb2){_0x3f18c9['or'](_0x56c2('0x22'),'%,'+_0x212fb2+',%');});}return _0x3f18c9;}function parseSearchFilter(_0x3a13e7){var _0x817e0c=squel[_0x56c2('0x20')]();if(_0x3a13e7){var _0x30c8a4=_0x3a13e7[_0x56c2('0x23')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x30c8a4[_0x56c2('0x24')]('\x20')[_0x56c2('0x25')]>0x1){_0x817e0c['or'](_0x56c2('0x26'),qs[_0x56c2('0x27')](_0x30c8a4,!![]),null);}else{if(qs['isNumeric'](_0x30c8a4)){_0x817e0c['or'](_0x56c2('0x28'),_0x30c8a4+'%');_0x817e0c['or']('c.phone\x20LIKE\x20?',_0x30c8a4+'%');_0x817e0c['or'](_0x56c2('0x29'),_0x30c8a4+'%');_0x817e0c['or'](_0x56c2('0x2a'),_0x30c8a4+'%');}else if(qs[_0x56c2('0x2b')](_0x30c8a4)){_0x817e0c['or']('c.email\x20LIKE\x20?',_0x30c8a4+'%');}else{_0x817e0c['or'](_0x56c2('0x2c'),'%'+_0x30c8a4+'%');_0x817e0c['or'](_0x56c2('0x2d'),'%'+_0x30c8a4+'%');_0x817e0c['or'](_0x56c2('0x2e'),'%'+_0x30c8a4+'%');}}}return _0x817e0c;}function parseAdvancedSearchFilter(_0xe8695c,_0x7406f3){var _0x42b227=getSqlClauses();var _0x320c44=as[_0x56c2('0x2f')](_0xe8695c);var _0x28a912=_0x320c44[_0x56c2('0x30')];for(var _0x534935=0x0;_0x534935<_0x320c44[_0x56c2('0x31')]['length'];_0x534935++){var _0x112747=_0x320c44[_0x56c2('0x31')][_0x534935];var _0xc80a7c='c';var _0x5d9b17=_[_0x56c2('0x32')](_0x7406f3,[_0x56c2('0x33'),_0x112747[_0x56c2('0x1e')]]);if(_0x5d9b17){if(_0x112747[_0x56c2('0x1e')]==='dateOfBirth'||_0x5d9b17['fieldType']===_0x56c2('0x34')){_0x112747[_0x56c2('0x35')]='DATE';}var _0x3425a6=as[_0x56c2('0x36')](_0xc80a7c,_0x5d9b17[_0x56c2('0x37')],_0x112747);_0x42b227[_0x56c2('0x38')][_0x28a912](_0x3425a6[_0x56c2('0x39')],_0x3425a6[_0x56c2('0x3a')][_0x56c2('0x3b')],_0x3425a6[_0x56c2('0x3a')][_0x56c2('0x3c')]);}else{if(_0x112747['field']===_0x56c2('0x3d')){var _0x10a6eb=_0x112747[_0x56c2('0x3a')]['split'](',')[_0x56c2('0x3e')](function(_0x3f1ff5){return Number(_0x3f1ff5);});var _0x177ef6=parseTagParameter(_0x10a6eb);_0x42b227['tags']['clause']['and'](_0x177ef6);_0x42b227[_0x56c2('0x3f')]['ids']=_0x10a6eb;}else if(_0x112747[_0x56c2('0x1e')]===_0x56c2('0x40')){_0x42b227[_0x56c2('0x41')][_0x56c2('0x42')][_0x56c2('0x43')](_0x56c2('0x44'),_0x112747['value']);_0x42b227['user'][_0x56c2('0x45')]=!![];}}}return _0x42b227;}function parseModelFields(_0x497157,_0x6c4873){var _0x28ad23=squel[_0x56c2('0x20')]();var _0x3c26e1=_(_0x497157)[_0x56c2('0x46')]()[_0x56c2('0x3e')](function(_0xf05892){return _[_0x56c2('0x47')](_0x6c4873,[_0x56c2('0x33'),_0xf05892])?_0xf05892:undefined;})[_0x56c2('0x48')]()[_0x56c2('0x3a')]();if(_0x497157[_0x56c2('0x49')]){_0x3c26e1[_0x56c2('0x1c')](_0x56c2('0x49'));}if(_0x497157['User']){_0x3c26e1[_0x56c2('0x1c')]('User');}if(_0x3c26e1['length']>0x0){_0x3c26e1[_0x56c2('0x1d')](function(_0x5be65b){if(_0x5be65b==='ListId'){_0x28ad23['and'](_0x56c2('0x4a'),[][_0x56c2('0x4b')](_0x497157[_0x5be65b]));}else if(_0x5be65b===_0x56c2('0x49')){var _0xc56e0f='%'+_0x497157[_0x5be65b]+'%';_0x28ad23[_0x56c2('0x43')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0xc56e0f);}else if(_0x5be65b==='User'){_0x28ad23[_0x56c2('0x43')](_0x56c2('0x44'),_0x497157[_0x5be65b]);}else{_0x28ad23[_0x56c2('0x43')]('c.'+_0x5be65b+_0x56c2('0x4c'),_0x497157[_0x5be65b]);}});}return _0x28ad23;}function parseQueryParameters(_0x22affc,_0x1f76a3){var _0x1ea212=getSqlClauses();return Promise[_0x56c2('0x4d')]()['then'](function(){return parseModelFields(_0x22affc,_0x1f76a3);})[_0x56c2('0x4e')](function(_0x18ec8b){_0x1ea212['fields'][_0x56c2('0x43')](_0x18ec8b);return parseTagParameter(_0x22affc[_0x56c2('0x4f')]);})[_0x56c2('0x4e')](function(_0x578c5c){_0x1ea212[_0x56c2('0x3f')][_0x56c2('0x42')][_0x56c2('0x43')](_0x578c5c);return parseSearchFilter(_0x22affc[_0x56c2('0x50')]);})[_0x56c2('0x4e')](function(_0x109ccc){_0x1ea212[_0x56c2('0x50')]=_0x109ccc;return _0x1ea212;});}function checkListsRestrictions(_0x5711cc,_0x26c905,_0x45ff94){var _0x218464=squel[_0x56c2('0x20')]();return Promise[_0x56c2('0x4d')]()['then'](function(){if(_0x26c905[_0x56c2('0x7')]&&_0x5711cc[_0x56c2('0x5')]===_0x56c2('0x6')&&!_0x45ff94){return _0x5711cc['getLists']({'attributes':['id'],'raw':!![]});}})[_0x56c2('0x4e')](function(_0x527d8b){if(_0x527d8b){if(_0x527d8b['length']===0x0){_0x218464[_0x56c2('0x43')]('c.ListId\x20IS\x20NULL');}else{_0x218464[_0x56c2('0x43')](_0x56c2('0x4a'),_['map'](_0x527d8b,'id'));}}})[_0x56c2('0x4e')](function(){return _0x218464;});}function buildContactsQuery(_0x22dba3,_0x1edc1e,_0x1f9240,_0x400264,_0x27b64c,_0x7ef6e1){if(_0x1edc1e){_0x1edc1e=_0x1f9240[_0x56c2('0x51')];}_0x22dba3=addFieldsToQuery(_0x22dba3,_0x1edc1e,_0x400264,_0x7ef6e1,!![]);var _0x3ef1cf=squel['select']();_0x3ef1cf=addFieldsToQuery(_0x3ef1cf,_0x1edc1e,_0x400264,_0x7ef6e1,![]);if(_0x400264||_0x7ef6e1){_0x22dba3=applyJoinClauses(_0x22dba3,!![]);_0x22dba3[_0x56c2('0x52')](_0x56c2('0x53'));if(_0x1f9240[_0x56c2('0x54')]){_0x3ef1cf['limit'](_0x1f9240[_0x56c2('0x54')]);}if(_0x1f9240[_0x56c2('0x55')]){_0x3ef1cf[_0x56c2('0x55')](_0x1f9240[_0x56c2('0x55')]);}}else{_0x3ef1cf=applyJoinClauses(_0x3ef1cf,![]);_0x3ef1cf[_0x56c2('0x52')]('subqry.id');if(_0x1f9240[_0x56c2('0x54')]){_0x22dba3['limit'](_0x1f9240[_0x56c2('0x54')]);}if(_0x1f9240[_0x56c2('0x55')]){_0x22dba3[_0x56c2('0x55')](_0x1f9240[_0x56c2('0x55')]);}}_0x3ef1cf[_0x56c2('0x56')](_0x27b64c);if(_0x1f9240['order']){_0x1f9240[_0x56c2('0x57')]['forEach'](function(_0x292ade){_0x22dba3[_0x56c2('0x57')]('c.'+_0x292ade[0x0],_0x292ade[0x1]===_0x56c2('0x58')?![]:!![]);_0x3ef1cf['order']('subqry.'+_0x292ade[0x0],_0x292ade[0x1]===_0x56c2('0x58')?![]:!![]);});}_0x3ef1cf[_0x56c2('0xc')](_0x22dba3,_0x56c2('0xf'));return _0x3ef1cf;}function getFilteredContacts(_0x14df7d){var _0x44e16d=[];return db['Tag']['findAll']({'attributes':['id','name',_0x56c2('0x59')],'raw':!![]})[_0x56c2('0x4e')](function(_0x12d781){_0x44e16d=_[_0x56c2('0x5a')](_0x12d781,'id');var _0x2a3bc5={'type':db[_0x56c2('0x5b')][_0x56c2('0x5c')][_0x56c2('0x5d')],'model':db[_0x56c2('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x56c2('0x5f')](_0x14df7d[_0x56c2('0x60')](),_0x2a3bc5);})['then'](function(_0x11c290){_0x11c290['forEach'](function(_0x2be850){if(_0x2be850[_0x56c2('0x1a')]){_0x2be850['Tags']=[];_0x2be850[_0x56c2('0x1a')][_0x56c2('0x24')](',')['forEach'](function(_0x4da86){_0x2be850[_0x56c2('0x61')][_0x56c2('0x1c')](_0x44e16d[_0x4da86]);});}delete _0x2be850[_0x56c2('0x1a')];});return _0x11c290;});}function countFilteredContacts(_0x500f66,_0x441404){var _0x808bb5=_0x500f66['clone']();_0x808bb5[_0x56c2('0x1e')](_0x56c2('0x62'));_0x808bb5=applyJoinClauses(_0x808bb5,!![]);_0x500f66[_0x56c2('0x52')](_0x56c2('0x53'));var _0x136001=utils[_0x56c2('0x21')](_0x441404);if(!_[_0x56c2('0x63')](_0x136001)){_0x808bb5[_0x56c2('0xe')]('t.id\x20IN\x20?',_0x136001);}var _0x49df3c={'type':db[_0x56c2('0x5b')][_0x56c2('0x5c')][_0x56c2('0x5d')],'raw':!![]};return db[_0x56c2('0x64')][_0x56c2('0x5f')](_0x808bb5[_0x56c2('0x60')](),_0x49df3c)[_0x56c2('0x4e')](function(_0x1ce149){return _0x1ce149[0x0][_0x56c2('0x62')];});}module[_0x56c2('0x65')]={'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 b0b35ed..435dc69 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 _0x66f9=['createCipher','update','binary','write','end','final','close','unlink','decryptFile','data','encryptString','secret','utf8','base64','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','hasOwnProperty','createReadStream','createWriteStream'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x66f9,0x6c));var _0x966f=function(_0x3b3d30,_0x219b5c){_0x3b3d30=_0x3b3d30-0x0;var _0x193ac2=_0x66f9[_0x3b3d30];return _0x193ac2;};'use strict';var crypto=require(_0x966f('0x0'));var fs=require('fs');var BPromise=require(_0x966f('0x1'));var _=require(_0x966f('0x2'));var config=require(_0x966f('0x3'));var logger=require(_0x966f('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x966f('0x5')][_0x966f('0x6')],'algorithm':_0x966f('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x966f('0x8')]&&config['encrypt'][_0x966f('0x9')]){var isSupported=isAlgorithmSupported(config[_0x966f('0x8')][_0x966f('0x9')]);if(isSupported){fileOptions[_0x966f('0x9')]=config[_0x966f('0x8')][_0x966f('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x966f('0xa')](',\x20');logger[_0x966f('0xb')](config['encrypt']['algorithm'],_0x966f('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x137f54){return AES_SUPPORTED_RX['test'](_0x137f54);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x26db98){return getSupportedCiphers()['indexOf'](_0x26db98)>-0x1;}function combineOptions(_0x255e25){var _0x5d1a35={};for(var _0x5197b2 in fileOptions){if(fileOptions[_0x966f('0xd')](_0x5197b2)){_0x5d1a35[_0x5197b2]=fileOptions[_0x5197b2];}}if(_0x255e25){for(var _0x377d64 in _0x255e25){if(_0x255e25[_0x966f('0xd')](_0x377d64)){_0x5d1a35[_0x377d64]=_0x255e25[_0x377d64];}}}return _0x5d1a35;}exports['encryptFile']=function(_0x2fdb63,_0x220500,_0x23e172,_0x3454a8){return new BPromise(function(_0x2d2321,_0x151804){_0x3454a8=combineOptions(_0x3454a8);var _0x43e77f=new Buffer(_0x23e172);var _0x3edd66=fs[_0x966f('0xe')](_0x2fdb63);var _0x514b30=fs[_0x966f('0xf')](_0x220500);var _0x42bc1b=crypto[_0x966f('0x10')](_0x3454a8[_0x966f('0x9')],_0x43e77f);_0x3edd66['on']('data',function(_0x546dd3){var _0x4dee74=new Buffer(_0x42bc1b[_0x966f('0x11')](_0x546dd3),_0x966f('0x12'));_0x514b30[_0x966f('0x13')](_0x4dee74);});_0x3edd66['on'](_0x966f('0x14'),function(){try{var _0x897857=new Buffer(_0x42bc1b[_0x966f('0x15')](_0x966f('0x12')),_0x966f('0x12'));_0x514b30[_0x966f('0x13')](_0x897857);_0x514b30[_0x966f('0x14')]();_0x514b30['on'](_0x966f('0x16'),function(){return _0x2d2321(_0x220500);});}catch(_0x33eba2){fs[_0x966f('0x17')](_0x220500);return _0x151804(_0x33eba2);}});});};exports[_0x966f('0x18')]=function(_0x44435a,_0x22f496,_0x126d05,_0x58160f){return new BPromise(function(_0xe2fb04,_0xc8d94c){_0x58160f=combineOptions(_0x58160f);var _0x33e90b=new Buffer(_0x126d05);var _0x17d2b6=fs['createReadStream'](_0x44435a);var _0x4002ce=fs[_0x966f('0xf')](_0x22f496);var _0x5ca4cf=crypto['createDecipher'](_0x58160f[_0x966f('0x9')],_0x33e90b);_0x17d2b6['on'](_0x966f('0x19'),function(_0x237792){var _0x18605f=new Buffer(_0x5ca4cf['update'](_0x237792),_0x966f('0x12'));_0x4002ce[_0x966f('0x13')](_0x18605f);});_0x17d2b6['on']('end',function(){try{var _0x3ba5ca=new Buffer(_0x5ca4cf[_0x966f('0x15')](_0x966f('0x12')),_0x966f('0x12'));_0x4002ce[_0x966f('0x13')](_0x3ba5ca);_0x4002ce[_0x966f('0x14')]();_0x4002ce['on'](_0x966f('0x16'),function(){return _0xe2fb04(_0x22f496);});}catch(_0x41b60b){fs[_0x966f('0x17')](_0x22f496);return _0xc8d94c(_0x41b60b);}});});};exports[_0x966f('0x1a')]=function(_0x274966,_0x4f0c84,_0x4b75f3){var _0x24afca=_0x4b75f3||stringOptions[_0x966f('0x9')];var _0x592f00=_0x4f0c84||stringOptions[_0x966f('0x1b')];var _0x1135cc=crypto[_0x966f('0x10')](_0x24afca,_0x592f00);var _0x3e1d44=_0x1135cc[_0x966f('0x11')](_0x274966,_0x966f('0x1c'),_0x966f('0x1d'));_0x3e1d44+=_0x1135cc[_0x966f('0x15')](_0x966f('0x1d'));return _0x3e1d44;};exports['decryptString']=function(_0x2b5b48,_0x27dfd8,_0x217381){var _0x48960f=_0x217381||stringOptions[_0x966f('0x9')];var _0x4ac400=_0x27dfd8||stringOptions[_0x966f('0x1b')];var _0x4c16fa=crypto[_0x966f('0x1e')](_0x48960f,_0x4ac400);var _0x5e446d=_0x4c16fa['update'](_0x2b5b48,_0x966f('0x1d'),_0x966f('0x1c'));_0x5e446d+=_0x4c16fa[_0x966f('0x15')](_0x966f('0x1c'));return _0x5e446d;}; \ No newline at end of file +var _0x0237=['createWriteStream','createCipher','binary','write','end','final','close','unlink','createReadStream','data','update','secret','utf8','base64','decryptString','bluebird','../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x0237,0x1a2));var _0x7023=function(_0x168f07,_0xa6f748){_0x168f07=_0x168f07-0x0;var _0x187d84=_0x0237[_0x168f07];return _0x187d84;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x7023('0x0'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x7023('0x1'))(_0x7023('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7023('0x3')][_0x7023('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x7023('0x5')};if(config[_0x7023('0x6')]&&config[_0x7023('0x6')][_0x7023('0x7')]){var isSupported=isAlgorithmSupported(config[_0x7023('0x6')][_0x7023('0x7')]);if(isSupported){fileOptions[_0x7023('0x7')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7023('0x8')](',\x20');logger[_0x7023('0x9')](config[_0x7023('0x6')][_0x7023('0x7')],_0x7023('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x40710b){return AES_SUPPORTED_RX[_0x7023('0xb')](_0x40710b);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x7023('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x544781){return getSupportedCiphers()[_0x7023('0xd')](_0x544781)>-0x1;}function combineOptions(_0xe73fa6){var _0x46f032={};for(var _0x298f0d in fileOptions){if(fileOptions[_0x7023('0xe')](_0x298f0d)){_0x46f032[_0x298f0d]=fileOptions[_0x298f0d];}}if(_0xe73fa6){for(var _0x5a1442 in _0xe73fa6){if(_0xe73fa6[_0x7023('0xe')](_0x5a1442)){_0x46f032[_0x5a1442]=_0xe73fa6[_0x5a1442];}}}return _0x46f032;}exports[_0x7023('0xf')]=function(_0x41b9ea,_0x107388,_0x4e037c,_0x50d682){return new BPromise(function(_0x3d0c30,_0xb484c9){_0x50d682=combineOptions(_0x50d682);var _0x4570a0=new Buffer(_0x4e037c);var _0x2bec73=fs['createReadStream'](_0x41b9ea);var _0xa49e42=fs[_0x7023('0x10')](_0x107388);var _0x2b9374=crypto[_0x7023('0x11')](_0x50d682[_0x7023('0x7')],_0x4570a0);_0x2bec73['on']('data',function(_0x301349){var _0x47cfc2=new Buffer(_0x2b9374['update'](_0x301349),_0x7023('0x12'));_0xa49e42[_0x7023('0x13')](_0x47cfc2);});_0x2bec73['on'](_0x7023('0x14'),function(){try{var _0x4a3066=new Buffer(_0x2b9374[_0x7023('0x15')](_0x7023('0x12')),_0x7023('0x12'));_0xa49e42['write'](_0x4a3066);_0xa49e42[_0x7023('0x14')]();_0xa49e42['on'](_0x7023('0x16'),function(){return _0x3d0c30(_0x107388);});}catch(_0x3856e3){fs[_0x7023('0x17')](_0x107388);return _0xb484c9(_0x3856e3);}});});};exports['decryptFile']=function(_0x611dd2,_0x3d9a4a,_0x4b4804,_0x2462c1){return new BPromise(function(_0x41c3d5,_0x7aa8e){_0x2462c1=combineOptions(_0x2462c1);var _0x36cd7e=new Buffer(_0x4b4804);var _0x18c79c=fs[_0x7023('0x18')](_0x611dd2);var _0x422eb7=fs['createWriteStream'](_0x3d9a4a);var _0x3909db=crypto['createDecipher'](_0x2462c1[_0x7023('0x7')],_0x36cd7e);_0x18c79c['on'](_0x7023('0x19'),function(_0x4d5e35){var _0x2dbba5=new Buffer(_0x3909db[_0x7023('0x1a')](_0x4d5e35),'binary');_0x422eb7[_0x7023('0x13')](_0x2dbba5);});_0x18c79c['on'](_0x7023('0x14'),function(){try{var _0x4d1d3e=new Buffer(_0x3909db['final'](_0x7023('0x12')),_0x7023('0x12'));_0x422eb7[_0x7023('0x13')](_0x4d1d3e);_0x422eb7[_0x7023('0x14')]();_0x422eb7['on'](_0x7023('0x16'),function(){return _0x41c3d5(_0x3d9a4a);});}catch(_0x60dbb){fs['unlink'](_0x3d9a4a);return _0x7aa8e(_0x60dbb);}});});};exports['encryptString']=function(_0x1a9b8f,_0xf47035,_0x13c8dd){var _0x4f80d4=_0x13c8dd||stringOptions['algorithm'];var _0x10bb81=_0xf47035||stringOptions[_0x7023('0x1b')];var _0x3e620a=crypto[_0x7023('0x11')](_0x4f80d4,_0x10bb81);var _0x5de1a6=_0x3e620a[_0x7023('0x1a')](_0x1a9b8f,_0x7023('0x1c'),'base64');_0x5de1a6+=_0x3e620a[_0x7023('0x15')](_0x7023('0x1d'));return _0x5de1a6;};exports[_0x7023('0x1e')]=function(_0x4ee6f8,_0x4b2c27,_0x1a1022){var _0x6d42fd=_0x1a1022||stringOptions['algorithm'];var _0x47926e=_0x4b2c27||stringOptions[_0x7023('0x1b')];var _0x4019da=crypto['createDecipher'](_0x6d42fd,_0x47926e);var _0x104d5c=_0x4019da['update'](_0x4ee6f8,_0x7023('0x1d'),_0x7023('0x1c'));_0x104d5c+=_0x4019da[_0x7023('0x15')]('utf8');return _0x104d5c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e4fa2e1..df526ae 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 _0x3e8f=['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','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','join','mkdirSync','each','%s.%s','csv','zip','zip\x20finished'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3e8f,0x1b5));var _0xf3e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e8f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf3e8('0x0'));var path=require(_0xf3e8('0x1'));var _=require(_0xf3e8('0x2'));var csv=require(_0xf3e8('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xf3e8('0x4'));var rimraf=require(_0xf3e8('0x5'));var db=require(_0xf3e8('0x6'))['db'];var dbH=require(_0xf3e8('0x6'))['dbH'];var logger=require(_0xf3e8('0x7'))(_0xf3e8('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xf3e8('0x9')][0x2]);var QUERY=process[_0xf3e8('0x9')][0x3];var PATH=process[_0xf3e8('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x414b0b,_0x4e4563){var _0x1b00b6={'status':_0x414b0b};var _0x22fb68={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e4563){_0x1b00b6['savename']=_0x4e4563;}return db[_0xf3e8('0xa')][_0xf3e8('0xb')](_0x1b00b6,_0x22fb68);}function main(){var _0x36150a=0x1388;var _0x19e1f6;logger[_0xf3e8('0xc')](util[_0xf3e8('0xd')](_0xf3e8('0xe'),EXTRACTED_REPORT_ID,_0xf3e8('0xf')));return db[_0xf3e8('0x10')][_0xf3e8('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf3e8('0x12'),'splitSizeCsv']})[_0xf3e8('0x13')](function(_0x1f9164){if(_0x1f9164){_0x19e1f6=_0x1f9164;_0x36150a=_0x19e1f6[_0xf3e8('0x14')]||0x1388;}})['then'](function(){return dbH[_0xf3e8('0x15')][_0xf3e8('0x16')](util[_0xf3e8('0xd')](_0xf3e8('0x17'),QUERY),{'type':dbH[_0xf3e8('0x15')][_0xf3e8('0x18')][_0xf3e8('0x19')]});})[_0xf3e8('0x13')](function(_0xc91d84){if(!_0xc91d84[0x0][_0xf3e8('0x1a')]){return analyticExtractedReport(_0xf3e8('0x1b'));}var _0x53f269=[];var _0x52c32f=0x0;if(_0x19e1f6['split']){if(_0xc91d84&&_0xc91d84['length']){var _0x316a7b=_[_0xf3e8('0x1c')](_0xc91d84[0x0][_0xf3e8('0x1a')]/_0x36150a);var _0x1401f4=Number['isInteger'](_0xc91d84[0x0][_0xf3e8('0x1a')]/_0x36150a)?_0xc91d84[0x0][_0xf3e8('0x1a')]%_0x36150a:0x0;_0x316a7b[_0xf3e8('0x1d')](function(_0x580192){if(_0x580192>0x0){_0x52c32f+=_0x36150a;}_0x53f269[_0xf3e8('0x1e')](dbH[_0xf3e8('0x15')][_0xf3e8('0x16')](util[_0xf3e8('0xd')](_0xf3e8('0x1f'),QUERY,_0x36150a,_0x52c32f),{'type':dbH[_0xf3e8('0x15')][_0xf3e8('0x18')][_0xf3e8('0x19')]}));});if(_0x1401f4>0x0){_0x52c32f+=_0x36150a;_0x53f269[_0xf3e8('0x1e')](dbH[_0xf3e8('0x15')][_0xf3e8('0x16')](util[_0xf3e8('0xd')](_0xf3e8('0x1f'),QUERY,_0x1401f4,_0x52c32f),{'type':dbH['sequelize']['QueryTypes'][_0xf3e8('0x19')]}));}}}else{_0x53f269['push'](dbH[_0xf3e8('0x15')][_0xf3e8('0x16')](QUERY,{'type':dbH[_0xf3e8('0x15')][_0xf3e8('0x18')][_0xf3e8('0x19')]}));}var _0x247c23=path[_0xf3e8('0x20')](PATH);var _0x2619da=path[_0xf3e8('0x21')](PATH,_0xf3e8('0x22'));var _0x3d883a=_0x19e1f6['split']&&_0x53f269[_0xf3e8('0x23')]>0x1;var _0x1584d0=[];if(!fs['existsSync'](path[_0xf3e8('0x24')](_0x247c23,_0x2619da))&&_0x3d883a){fs[_0xf3e8('0x25')](path['join'](_0x247c23,_0x2619da));}return BPromise[_0xf3e8('0x26')](_0x53f269,function(_0x1550d9){_0x1584d0[_0xf3e8('0x1e')](_0x1550d9);})[_0xf3e8('0x13')](function(){for(var _0xcb26f8=0x0;_0xcb26f8<_0x1584d0[_0xf3e8('0x23')];_0xcb26f8+=0x1){var _0x7df48d;var _0x25e603=_0x1584d0[_0xcb26f8];if(_0x3d883a){_0x7df48d=path[_0xf3e8('0x24')](_0x247c23,_0x2619da,util[_0xf3e8('0xd')]('%s%d.%s',_0x2619da,_0xcb26f8,'csv'));}else{_0x7df48d=path[_0xf3e8('0x24')](_0x247c23,util['format'](_0xf3e8('0x27'),_0x2619da,_0xf3e8('0x28')));}fs['writeFileSync'](_0x7df48d,csv(_0x25e603));}})[_0xf3e8('0x13')](function(){if(_0x3d883a){return new Promise(function(_0xdb20e0){zipdir(path[_0xf3e8('0x24')](_0x247c23,_0x2619da),{'saveTo':path[_0xf3e8('0x24')](_0x247c23,util['format'](_0xf3e8('0x27'),_0x2619da,_0xf3e8('0x29')))},function(_0x4fd416,_0xec7a86){rimraf(path[_0xf3e8('0x24')](_0x247c23,_0x2619da),function(){});_0xdb20e0(_0xf3e8('0x2a'));});});}})[_0xf3e8('0x13')](function(){logger[_0xf3e8('0xc')](util[_0xf3e8('0xd')](_0xf3e8('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x3d883a?util['format']('%s.%s',_0x2619da,_0x3d883a?_0xf3e8('0x29'):_0xf3e8('0x28')):null);});})[_0xf3e8('0x2c')](function(_0x41fd89){logger[_0xf3e8('0xc')](util[_0xf3e8('0xd')](_0xf3e8('0x2d'),EXTRACTED_REPORT_ID,_0xf3e8('0xf')),util[_0xf3e8('0x2e')](_0x41fd89,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xf3e8('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdfe7=['zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','sequelize','query','SELECT','num','Empty','length','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','join','mkdirSync','each','then','csv','%s.%s','zip','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','to-csv','bluebird'];(function(_0xdc4b70,_0x38430e){var _0x3f44ac=function(_0x1400c8){while(--_0x1400c8){_0xdc4b70['push'](_0xdc4b70['shift']());}};_0x3f44ac(++_0x38430e);}(_0xdfe7,0x10f));var _0x7dfe=function(_0x1d72d0,_0x4a8c0b){_0x1d72d0=_0x1d72d0-0x0;var _0x410c39=_0xdfe7[_0x1d72d0];return _0x410c39;};'use strict';var util=require(_0x7dfe('0x0'));var path=require(_0x7dfe('0x1'));var _=require(_0x7dfe('0x2'));var csv=require(_0x7dfe('0x3'));var fs=require('fs');var BPromise=require(_0x7dfe('0x4'));var zipdir=require(_0x7dfe('0x5'));var rimraf=require(_0x7dfe('0x6'));var db=require(_0x7dfe('0x7'))['db'];var dbH=require(_0x7dfe('0x7'))['dbH'];var logger=require(_0x7dfe('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7dfe('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7dfe('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x400e20,_0x27aaf0){var _0x51103d={'status':_0x400e20};var _0x339032={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27aaf0){_0x51103d[_0x7dfe('0xa')]=_0x27aaf0;}return db[_0x7dfe('0xb')][_0x7dfe('0xc')](_0x51103d,_0x339032);}function main(){var _0x4f53ae=0x1388;var _0x2441b5;logger[_0x7dfe('0xd')](util[_0x7dfe('0xe')](_0x7dfe('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x7dfe('0x10')][_0x7dfe('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7dfe('0x12'),_0x7dfe('0x13')]})['then'](function(_0x525895){if(_0x525895){_0x2441b5=_0x525895;_0x4f53ae=_0x2441b5[_0x7dfe('0x13')]||0x1388;}})['then'](function(){return dbH[_0x7dfe('0x14')][_0x7dfe('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7dfe('0x14')]['QueryTypes'][_0x7dfe('0x16')]});})['then'](function(_0x505e7e){if(!_0x505e7e[0x0][_0x7dfe('0x17')]){return analyticExtractedReport(_0x7dfe('0x18'));}var _0x4be96c=[];var _0x1ea205=0x0;if(_0x2441b5[_0x7dfe('0x12')]){if(_0x505e7e&&_0x505e7e[_0x7dfe('0x19')]){var _0x2d8f19=_['range'](_0x505e7e[0x0][_0x7dfe('0x17')]/_0x4f53ae);var _0x21ea52=Number[_0x7dfe('0x1a')](_0x505e7e[0x0]['num']/_0x4f53ae)?_0x505e7e[0x0][_0x7dfe('0x17')]%_0x4f53ae:0x0;_0x2d8f19[_0x7dfe('0x1b')](function(_0x20b50f){if(_0x20b50f>0x0){_0x1ea205+=_0x4f53ae;}_0x4be96c['push'](dbH[_0x7dfe('0x14')][_0x7dfe('0x15')](util[_0x7dfe('0xe')](_0x7dfe('0x1c'),QUERY,_0x4f53ae,_0x1ea205),{'type':dbH['sequelize'][_0x7dfe('0x1d')]['SELECT']}));});if(_0x21ea52>0x0){_0x1ea205+=_0x4f53ae;_0x4be96c['push'](dbH['sequelize'][_0x7dfe('0x15')](util['format'](_0x7dfe('0x1c'),QUERY,_0x21ea52,_0x1ea205),{'type':dbH[_0x7dfe('0x14')][_0x7dfe('0x1d')][_0x7dfe('0x16')]}));}}}else{_0x4be96c[_0x7dfe('0x1e')](dbH[_0x7dfe('0x14')][_0x7dfe('0x15')](QUERY,{'type':dbH['sequelize'][_0x7dfe('0x1d')][_0x7dfe('0x16')]}));}var _0x59a816=path[_0x7dfe('0x1f')](PATH);var _0x818c1d=path['basename'](PATH,'.csv');var _0x3fb879=_0x2441b5['split']&&_0x4be96c['length']>0x1;var _0x40a6dc=[];if(!fs['existsSync'](path[_0x7dfe('0x20')](_0x59a816,_0x818c1d))&&_0x3fb879){fs[_0x7dfe('0x21')](path[_0x7dfe('0x20')](_0x59a816,_0x818c1d));}return BPromise[_0x7dfe('0x22')](_0x4be96c,function(_0x20552a){_0x40a6dc['push'](_0x20552a);})[_0x7dfe('0x23')](function(){for(var _0x58bf31=0x0;_0x58bf31<_0x40a6dc['length'];_0x58bf31+=0x1){var _0xd36541;var _0x227192=_0x40a6dc[_0x58bf31];if(_0x3fb879){_0xd36541=path[_0x7dfe('0x20')](_0x59a816,_0x818c1d,util[_0x7dfe('0xe')]('%s%d.%s',_0x818c1d,_0x58bf31,_0x7dfe('0x24')));}else{_0xd36541=path[_0x7dfe('0x20')](_0x59a816,util[_0x7dfe('0xe')]('%s.%s',_0x818c1d,_0x7dfe('0x24')));}fs['writeFileSync'](_0xd36541,csv(_0x227192));}})['then'](function(){if(_0x3fb879){return new Promise(function(_0x8b0d82){zipdir(path['join'](_0x59a816,_0x818c1d),{'saveTo':path[_0x7dfe('0x20')](_0x59a816,util[_0x7dfe('0xe')](_0x7dfe('0x25'),_0x818c1d,_0x7dfe('0x26')))},function(_0x10f4ae,_0x588bf0){rimraf(path['join'](_0x59a816,_0x818c1d),function(){});_0x8b0d82('zip\x20finished');});});}})['then'](function(){logger[_0x7dfe('0xd')](util[_0x7dfe('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7dfe('0x27')));return analyticExtractedReport(_0x7dfe('0x28'),_0x3fb879?util[_0x7dfe('0xe')](_0x7dfe('0x25'),_0x818c1d,_0x3fb879?_0x7dfe('0x26'):_0x7dfe('0x24')):null);});})[_0x7dfe('0x29')](function(_0xbc3a5a){logger[_0x7dfe('0xd')](util[_0x7dfe('0xe')](_0x7dfe('0x2a'),EXTRACTED_REPORT_ID,_0x7dfe('0x27')),util[_0x7dfe('0x2b')](_0xbc3a5a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7dfe('0x2c'));})['finally'](function(){process[_0x7dfe('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 102a212..f99076e 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 _0x4c87=['pick','toString','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','\x20/\x20','Arial','black','right','num','Setting','find','split','splitSizePdf','then','range','query','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','each','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','map'];(function(_0x416caa,_0x56e9d8){var _0x37c920=function(_0x4ad040){while(--_0x4ad040){_0x416caa['push'](_0x416caa['shift']());}};_0x37c920(++_0x56e9d8);}(_0x4c87,0x157));var _0x74c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4c87[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x74c8('0x0'));var path=require(_0x74c8('0x1'));var moment=require(_0x74c8('0x2'));var htmlToPdfmake=require(_0x74c8('0x3'));var PdfPrinter=require(_0x74c8('0x4'));var zipdir=require(_0x74c8('0x5'));var rimraf=require(_0x74c8('0x6'));var JSDOM=require(_0x74c8('0x7'))['JSDOM'];var window=new JSDOM('')[_0x74c8('0x8')];var BPromise=require(_0x74c8('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x74c8('0xa'))['dbH'];var logger=require('../../config/logger')(_0x74c8('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x74c8('0xc')][0x2]);var QUERY=process[_0x74c8('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x74c8('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x25545a,_0x183a72){var _0x55b5c7={'status':_0x25545a};var _0x50b894={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x183a72){_0x55b5c7[_0x74c8('0xd')]=_0x183a72;}return db[_0x74c8('0xe')][_0x74c8('0xf')](_0x55b5c7,_0x50b894);}function getHeaders(_0xb4ccf){return _[_0x74c8('0x10')](_0xb4ccf,function(_0x4e9f95){return{'text':_0x4e9f95,'style':'tableHeader'};});}function getRows(_0x3f8a24,_0x23fc87){return _[_0x74c8('0x10')](_0x23fc87,function(_0x1e171e){return _(_0x1e171e)[_0x74c8('0x11')](_0x3f8a24)[_0x74c8('0x10')](function(_0x16433a){return _0x16433a?_[_0x74c8('0x12')](_0x16433a):'';})[_0x74c8('0x13')]();});}function createTable(_0x3a80ee,_0x2fd940){var _0x15195c={'widths':_[_0x74c8('0x14')](Array(_0x3a80ee[_0x74c8('0x15')]),0x91),'heights':function(_0x4cdc15){return _0x4cdc15===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x166171=getHeaders(_0x3a80ee);_0x15195c[_0x74c8('0x16')][_0x74c8('0x17')](_0x166171);var _0x45c5f5=getRows(_0x3a80ee,_0x2fd940);_0x15195c[_0x74c8('0x16')]=_0x15195c['body'][_0x74c8('0x18')](_0x45c5f5);return _0x15195c;}function createTables(_0x799afd){var _0x24e75f=[];var _0x1c7f31=_[_0x74c8('0x19')](Object[_0x74c8('0x1a')](_0x799afd[0x0]),0x5);_0x1c7f31[_0x74c8('0x1b')](function(_0x5d9736){_0x24e75f[_0x74c8('0x17')](createTable(_0x5d9736,_0x799afd));});return _0x24e75f;}function getPDFDocDefinition(_0x56a1e7){var _0x5630b9=util[_0x74c8('0x1c')](_0x74c8('0x1d'),NAME,EXTRACTED_REPORT[_0x74c8('0x1e')],moment(EXTRACTED_REPORT[_0x74c8('0x1f')])[_0x74c8('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x74c8('0x20')])[_0x74c8('0x1c')](FORMAT));var _0x5d0b68=[];for(var _0x59a8a5=0x0;_0x59a8a5<_0x56a1e7[_0x74c8('0x15')];_0x59a8a5++){var _0x2b1adb=[];if(_0x59a8a5===0x0){_0x2b1adb['push']({'text':_0x5630b9,'style':_0x74c8('0x21')});}var _0x1fd629={'table':_0x56a1e7[_0x59a8a5]};if(_0x59a8a5>0x0){_0x1fd629[_0x74c8('0x22')]=_0x74c8('0x23');_0x1fd629[_0x74c8('0x24')]=[0x0,0x46,0x0,0x0];}_0x2b1adb[_0x74c8('0x17')](_0x1fd629);_0x5d0b68['push'](_0x2b1adb);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5d0b68,'footer':function(_0x3411e8,_0x4a819e){return{'text':_0x3411e8[_0x74c8('0x12')]()+_0x74c8('0x25')+_0x4a819e,'style':'footer'};},'defaultStyle':{'font':_0x74c8('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x74c8('0x27')},'footer':{'alignment':_0x74c8('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x143411){var _0xd2ee1=0x1388;var _0x51d4e5;if(!_0x143411[0x0][_0x74c8('0x29')]){return analyticExtractedReport('Empty');}return db[_0x74c8('0x2a')][_0x74c8('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x74c8('0x2c'),_0x74c8('0x2d')]})[_0x74c8('0x2e')](function(_0x2b324b){if(_0x2b324b){_0x51d4e5=_0x2b324b;_0xd2ee1=_0x51d4e5[_0x74c8('0x2d')]||0x3e8;}})['then'](function(){var _0x54896a=[];var _0x59f5c6=0x0;if(_0x51d4e5[_0x74c8('0x2c')]){if(_0x143411&&_0x143411[_0x74c8('0x15')]){var _0x255c0=_[_0x74c8('0x2f')](_0x143411[0x0][_0x74c8('0x29')]/_0xd2ee1);var _0x3e1681=Number['isInteger'](_0x143411[0x0][_0x74c8('0x29')]/_0xd2ee1)?_0x143411[0x0][_0x74c8('0x29')]%_0xd2ee1:0x0;_0x255c0['forEach'](function(_0x516e1d){if(_0x516e1d>0x0){_0x59f5c6+=_0xd2ee1;}_0x54896a[_0x74c8('0x17')](dbH['sequelize'][_0x74c8('0x30')](util[_0x74c8('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xd2ee1,_0x59f5c6),{'type':dbH[_0x74c8('0x31')]['QueryTypes'][_0x74c8('0x32')]}));});if(_0x3e1681>0x0){_0x59f5c6+=_0xd2ee1;_0x54896a[_0x74c8('0x17')](dbH[_0x74c8('0x31')][_0x74c8('0x30')](util[_0x74c8('0x1c')](_0x74c8('0x33'),QUERY,_0x3e1681,_0x59f5c6),{'type':dbH[_0x74c8('0x31')][_0x74c8('0x34')]['SELECT']}));}}}else{_0x54896a['push'](dbH[_0x74c8('0x31')][_0x74c8('0x30')](QUERY,{'type':dbH['sequelize'][_0x74c8('0x34')][_0x74c8('0x32')]}));}var _0x26299b=path[_0x74c8('0x35')](PATH);var _0x47feb9=path[_0x74c8('0x36')](PATH,'.pdf');var _0xe82ab9=_0x51d4e5['split']&&_0x54896a[_0x74c8('0x15')]>0x1;var _0x572e23=[];if(!fs[_0x74c8('0x37')](path[_0x74c8('0x38')](_0x26299b,_0x47feb9))&&_0xe82ab9){fs['mkdirSync'](path[_0x74c8('0x38')](_0x26299b,_0x47feb9));}return BPromise[_0x74c8('0x39')](_0x54896a,function(_0x1388e2){_0x572e23[_0x74c8('0x17')](_0x1388e2);})['then'](function(){var _0x320afd=[];for(var _0x1e1c21=0x0;_0x1e1c21<_0x572e23[_0x74c8('0x15')];_0x1e1c21+=0x1){var _0x3e65ae=_0x572e23[_0x1e1c21];var _0x5c0e1e=createTables(_['flatten'](_0x3e65ae));var _0x673331;var _0x73a4f4=getPDFDocDefinition(_0x5c0e1e);var _0x357b3b=getPDFPrinter();var _0x154564=_0x357b3b['createPdfKitDocument'](_0x73a4f4);if(_0xe82ab9){_0x673331=path['join'](_0x26299b,_0x47feb9,util[_0x74c8('0x1c')](_0x74c8('0x3a'),_0x47feb9,_0x1e1c21,_0x74c8('0x3b')));}else{_0x673331=path[_0x74c8('0x38')](_0x26299b,util[_0x74c8('0x1c')]('%s.%s',_0x47feb9,_0x74c8('0x3b')));}_0x320afd[_0x74c8('0x17')](writePDFDocument(_0x154564,_0x673331));}return Promise['all'](_0x320afd);})[_0x74c8('0x2e')](function(){if(_0xe82ab9){return new Promise(function(_0x305a55){zipdir(path[_0x74c8('0x38')](_0x26299b,_0x47feb9),{'saveTo':path[_0x74c8('0x38')](_0x26299b,util[_0x74c8('0x1c')](_0x74c8('0x3c'),_0x47feb9,_0x74c8('0x3d')))},function(){rimraf(path[_0x74c8('0x38')](_0x26299b,_0x47feb9),function(){});_0x305a55(_0x74c8('0x3e'));});});}})[_0x74c8('0x2e')](function(){if(!_0xe82ab9)return;rimraf(path['join'](_0x26299b,_0x47feb9),function(){});})[_0x74c8('0x2e')](function(){logger['info'](util[_0x74c8('0x1c')](_0x74c8('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x74c8('0x40'),_0xe82ab9?util[_0x74c8('0x1c')](_0x74c8('0x3c'),_0x47feb9,_0xe82ab9?'zip':_0x74c8('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x74c8('0x1c')](_0x74c8('0x41'),EXTRACTED_REPORT_ID,_0x74c8('0x42')));return db['AnalyticExtractedReport'][_0x74c8('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x74c8('0x2e')](function(_0x10e3cf){EXTRACTED_REPORT=_0x10e3cf;return dbH[_0x74c8('0x31')][_0x74c8('0x30')](util[_0x74c8('0x1c')](_0x74c8('0x44'),QUERY),{'type':dbH[_0x74c8('0x31')][_0x74c8('0x34')][_0x74c8('0x32')]});})[_0x74c8('0x2e')](extractReport)[_0x74c8('0x45')](function(_0x293336){logger[_0x74c8('0x46')](util[_0x74c8('0x1c')](_0x74c8('0x47'),EXTRACTED_REPORT_ID,_0x74c8('0x42')),util[_0x74c8('0x48')](_0x293336,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x74c8('0x49')](function(){process[_0x74c8('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x58d820=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x74c8('0x4b'),'italics':__dirname+_0x74c8('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x58d820;}function getPDFDocDefinitionFromHTML(_0x31f9f1,_0x484016){var _0x1b3eff=util[_0x74c8('0x1c')](_0x74c8('0x4d'),_0x484016[_0x74c8('0x4e')],_0x484016[_0x74c8('0x4f')]);var _0x1a36cb=moment()[_0x74c8('0x1c')]('YYYY-MM-DD')['toString']();var _0x126c8b=htmlToPdfmake(_0x31f9f1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x126c8b],'defaultStyle':{'font':_0x74c8('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x74c8('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x74c8('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x74c8('0x50')}},'header':function(){return[{'text':_0x74c8('0x51'),'style':_0x74c8('0x21')}];},'footer':function(_0x1769d2,_0x348f3e){return[{'text':util[_0x74c8('0x1c')](_0x74c8('0x52'),_0x1b3eff,_0x1769d2,_0x348f3e,_0x1a36cb),'style':_0x74c8('0x53')}];}};}function writePDFDocument(_0x5e3c54,_0x6c806d){return new Promise(function(_0x152d18,_0x4c3a09){var _0x1b6036=_0x5e3c54[_0x74c8('0x54')](fs[_0x74c8('0x55')](_0x6c806d));_0x1b6036['on']('finish',function(){_0x152d18(_0x74c8('0x56'));});_0x1b6036['on'](_0x74c8('0x57'),function(_0x5ef3b0){_0x4c3a09(_0x5ef3b0);});_0x5e3c54['end']();});}exports[_0x74c8('0x58')]=function(_0xb3d6cb,_0x3e1225){var _0x5881d2=getPDFPrinter();var _0x374c74=getPDFDocDefinitionFromHTML(_0xb3d6cb,_0x3e1225);var _0x304159=_0x5881d2[_0x74c8('0x59')](_0x374c74);return writePDFDocument(_0x304159,_0x3e1225['path'])['catch'](function(_0x421307){throw _0x421307;});}; \ No newline at end of file +var _0xbb7b=['Interaction\x20Transcript','pipe','finish','error','createPdfFromHTML','path','catch','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','value','fill','length','auto','body','push','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','pageBreak','before','footer','Arial','right','num','Empty','Setting','find','then','splitSizePdf','range','sequelize','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','dirname','basename','split','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center'];(function(_0x1da922,_0x246dd2){var _0x3cb621=function(_0x1211d5){while(--_0x1211d5){_0x1da922['push'](_0x1da922['shift']());}};_0x3cb621(++_0x246dd2);}(_0xbb7b,0x1b0));var _0xbbb7=function(_0x2e8d15,_0x276193){_0x2e8d15=_0x2e8d15-0x0;var _0xdde8e5=_0xbb7b[_0x2e8d15];return _0xdde8e5;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xbbb7('0x0'));var htmlToPdfmake=require(_0xbbb7('0x1'));var PdfPrinter=require(_0xbbb7('0x2'));var zipdir=require(_0xbbb7('0x3'));var rimraf=require(_0xbbb7('0x4'));var JSDOM=require(_0xbbb7('0x5'))[_0xbbb7('0x6')];var window=new JSDOM('')[_0xbbb7('0x7')];var BPromise=require(_0xbbb7('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xbbb7('0x9'))[_0xbbb7('0xa')];var logger=require('../../config/logger')(_0xbbb7('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xbbb7('0xc')][0x2]);var QUERY=process[_0xbbb7('0xc')][0x3];var PATH=process[_0xbbb7('0xc')][0x4];var NAME=process[_0xbbb7('0xc')][0x5];var FORMAT=_0xbbb7('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a706b,_0x2f9986){var _0x1f8ec={'status':_0x4a706b};var _0x451b5e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f9986){_0x1f8ec[_0xbbb7('0xe')]=_0x2f9986;}return db['AnalyticExtractedReport'][_0xbbb7('0xf')](_0x1f8ec,_0x451b5e);}function getHeaders(_0x20eef8){return _[_0xbbb7('0x10')](_0x20eef8,function(_0x467902){return{'text':_0x467902,'style':_0xbbb7('0x11')};});}function getRows(_0x4aff13,_0x412e40){return _[_0xbbb7('0x10')](_0x412e40,function(_0x189089){return _(_0x189089)[_0xbbb7('0x12')](_0x4aff13)['map'](function(_0x2f5fe8){return _0x2f5fe8?_['toString'](_0x2f5fe8):'';})[_0xbbb7('0x13')]();});}function createTable(_0x1c612f,_0x4ac4c1){var _0x2047af={'widths':_[_0xbbb7('0x14')](Array(_0x1c612f[_0xbbb7('0x15')]),0x91),'heights':function(_0x31bff8){return _0x31bff8===0x0?_0xbbb7('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5a41db=getHeaders(_0x1c612f);_0x2047af[_0xbbb7('0x17')][_0xbbb7('0x18')](_0x5a41db);var _0x1cb357=getRows(_0x1c612f,_0x4ac4c1);_0x2047af[_0xbbb7('0x17')]=_0x2047af[_0xbbb7('0x17')]['concat'](_0x1cb357);return _0x2047af;}function createTables(_0x26bfdd){var _0x453ac2=[];var _0x292f90=_['chunk'](Object['keys'](_0x26bfdd[0x0]),0x5);_0x292f90[_0xbbb7('0x19')](function(_0xb3428b){_0x453ac2[_0xbbb7('0x18')](createTable(_0xb3428b,_0x26bfdd));});return _0x453ac2;}function getPDFDocDefinition(_0x42ad3b){var _0x184ba7=util['format'](_0xbbb7('0x1a'),NAME,EXTRACTED_REPORT[_0xbbb7('0x1b')],moment(EXTRACTED_REPORT[_0xbbb7('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xbbb7('0x1d')](FORMAT));var _0x4618f4=[];for(var _0x53003d=0x0;_0x53003d<_0x42ad3b[_0xbbb7('0x15')];_0x53003d++){var _0x1c35f1=[];if(_0x53003d===0x0){_0x1c35f1['push']({'text':_0x184ba7,'style':'header'});}var _0x1127e7={'table':_0x42ad3b[_0x53003d]};if(_0x53003d>0x0){_0x1127e7[_0xbbb7('0x1e')]=_0xbbb7('0x1f');_0x1127e7['margin']=[0x0,0x46,0x0,0x0];}_0x1c35f1[_0xbbb7('0x18')](_0x1127e7);_0x4618f4['push'](_0x1c35f1);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4618f4,'footer':function(_0x16928f,_0x32846a){return{'text':_0x16928f['toString']()+'\x20/\x20'+_0x32846a,'style':_0xbbb7('0x20')};},'defaultStyle':{'font':_0xbbb7('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xbbb7('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1c4be2){var _0x1c45ac=0x1388;var _0x3034a5;if(!_0x1c4be2[0x0][_0xbbb7('0x23')]){return analyticExtractedReport(_0xbbb7('0x24'));}return db[_0xbbb7('0x25')][_0xbbb7('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xbbb7('0x27')](function(_0x282be3){if(_0x282be3){_0x3034a5=_0x282be3;_0x1c45ac=_0x3034a5[_0xbbb7('0x28')]||0x3e8;}})[_0xbbb7('0x27')](function(){var _0x5d58a5=[];var _0x56195f=0x0;if(_0x3034a5['split']){if(_0x1c4be2&&_0x1c4be2['length']){var _0x58d827=_[_0xbbb7('0x29')](_0x1c4be2[0x0][_0xbbb7('0x23')]/_0x1c45ac);var _0x5646af=Number['isInteger'](_0x1c4be2[0x0][_0xbbb7('0x23')]/_0x1c45ac)?_0x1c4be2[0x0][_0xbbb7('0x23')]%_0x1c45ac:0x0;_0x58d827['forEach'](function(_0x28c361){if(_0x28c361>0x0){_0x56195f+=_0x1c45ac;}_0x5d58a5[_0xbbb7('0x18')](dbH['sequelize']['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c45ac,_0x56195f),{'type':dbH[_0xbbb7('0x2a')][_0xbbb7('0x2b')]['SELECT']}));});if(_0x5646af>0x0){_0x56195f+=_0x1c45ac;_0x5d58a5['push'](dbH[_0xbbb7('0x2a')]['query'](util[_0xbbb7('0x1d')](_0xbbb7('0x2c'),QUERY,_0x5646af,_0x56195f),{'type':dbH['sequelize']['QueryTypes'][_0xbbb7('0x2d')]}));}}}else{_0x5d58a5[_0xbbb7('0x18')](dbH[_0xbbb7('0x2a')][_0xbbb7('0x2e')](QUERY,{'type':dbH['sequelize'][_0xbbb7('0x2b')][_0xbbb7('0x2d')]}));}var _0x5d692b=path[_0xbbb7('0x2f')](PATH);var _0x3572bb=path[_0xbbb7('0x30')](PATH,'.pdf');var _0x2cfae7=_0x3034a5[_0xbbb7('0x31')]&&_0x5d58a5[_0xbbb7('0x15')]>0x1;var _0x92e77c=[];if(!fs[_0xbbb7('0x32')](path[_0xbbb7('0x33')](_0x5d692b,_0x3572bb))&&_0x2cfae7){fs[_0xbbb7('0x34')](path['join'](_0x5d692b,_0x3572bb));}return BPromise[_0xbbb7('0x35')](_0x5d58a5,function(_0xf2e0f3){_0x92e77c[_0xbbb7('0x18')](_0xf2e0f3);})[_0xbbb7('0x27')](function(){var _0x4f8628=[];for(var _0x3cdf93=0x0;_0x3cdf93<_0x92e77c[_0xbbb7('0x15')];_0x3cdf93+=0x1){var _0x593dff=_0x92e77c[_0x3cdf93];var _0x48dc66=createTables(_[_0xbbb7('0x36')](_0x593dff));var _0x44680f;var _0x2e156e=getPDFDocDefinition(_0x48dc66);var _0x1a2a4c=getPDFPrinter();var _0x44f185=_0x1a2a4c[_0xbbb7('0x37')](_0x2e156e);if(_0x2cfae7){_0x44680f=path['join'](_0x5d692b,_0x3572bb,util[_0xbbb7('0x1d')](_0xbbb7('0x38'),_0x3572bb,_0x3cdf93,'pdf'));}else{_0x44680f=path[_0xbbb7('0x33')](_0x5d692b,util[_0xbbb7('0x1d')](_0xbbb7('0x39'),_0x3572bb,_0xbbb7('0x3a')));}_0x4f8628['push'](writePDFDocument(_0x44f185,_0x44680f));}return Promise[_0xbbb7('0x3b')](_0x4f8628);})[_0xbbb7('0x27')](function(){if(_0x2cfae7){return new Promise(function(_0x376ed5){zipdir(path[_0xbbb7('0x33')](_0x5d692b,_0x3572bb),{'saveTo':path[_0xbbb7('0x33')](_0x5d692b,util[_0xbbb7('0x1d')](_0xbbb7('0x39'),_0x3572bb,_0xbbb7('0x3c')))},function(){rimraf(path['join'](_0x5d692b,_0x3572bb),function(){});_0x376ed5(_0xbbb7('0x3d'));});});}})[_0xbbb7('0x27')](function(){if(!_0x2cfae7)return;rimraf(path[_0xbbb7('0x33')](_0x5d692b,_0x3572bb),function(){});})['then'](function(){logger['info'](util['format'](_0xbbb7('0x3e'),EXTRACTED_REPORT_ID,_0xbbb7('0x3f')));return analyticExtractedReport(_0xbbb7('0x40'),_0x2cfae7?util[_0xbbb7('0x1d')]('%s.%s',_0x3572bb,_0x2cfae7?_0xbbb7('0x3c'):_0xbbb7('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbbb7('0x41')](util[_0xbbb7('0x1d')](_0xbbb7('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xbbb7('0x43')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x18d9bb){EXTRACTED_REPORT=_0x18d9bb;return dbH['sequelize'][_0xbbb7('0x2e')](util[_0xbbb7('0x1d')](_0xbbb7('0x44'),QUERY),{'type':dbH[_0xbbb7('0x2a')][_0xbbb7('0x2b')][_0xbbb7('0x2d')]});})[_0xbbb7('0x27')](extractReport)['catch'](function(_0xef372){logger[_0xbbb7('0x41')](util[_0xbbb7('0x1d')](_0xbbb7('0x45'),EXTRACTED_REPORT_ID,_0xbbb7('0x3f')),util['inspect'](_0xef372,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xbbb7('0x46')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3832af=new PdfPrinter({'Arial':{'normal':__dirname+_0xbbb7('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xbbb7('0x48'),'bolditalics':__dirname+_0xbbb7('0x49')}});return _0x3832af;}function getPDFDocDefinitionFromHTML(_0x20784c,_0x294f6a){var _0x29f52b=util[_0xbbb7('0x1d')](_0xbbb7('0x4a'),_0x294f6a[_0xbbb7('0x4b')],_0x294f6a['interactionId']);var _0x41328a=moment()[_0xbbb7('0x1d')](_0xbbb7('0x4c'))['toString']();var _0x49fd39=htmlToPdfmake(_0x20784c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x49fd39],'defaultStyle':{'font':_0xbbb7('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xbbb7('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbbb7('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbbb7('0x4d')}},'header':function(){return[{'text':_0xbbb7('0x4e'),'style':'header'}];},'footer':function(_0x2e29b5,_0x4aa766){return[{'text':util[_0xbbb7('0x1d')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x29f52b,_0x2e29b5,_0x4aa766,_0x41328a),'style':_0xbbb7('0x20')}];}};}function writePDFDocument(_0x39aaf2,_0x585a5b){return new Promise(function(_0x5904a9,_0x1214fc){var _0x2707ec=_0x39aaf2[_0xbbb7('0x4f')](fs['createWriteStream'](_0x585a5b));_0x2707ec['on'](_0xbbb7('0x50'),function(){_0x5904a9('finish');});_0x2707ec['on'](_0xbbb7('0x51'),function(_0x3b0b9d){_0x1214fc(_0x3b0b9d);});_0x39aaf2['end']();});}exports[_0xbbb7('0x52')]=function(_0x3991da,_0x4a0130){var _0xedb1ea=getPDFPrinter();var _0xf86afd=getPDFDocDefinitionFromHTML(_0x3991da,_0x4a0130);var _0x57f61f=_0xedb1ea[_0xbbb7('0x37')](_0xf86afd);return writePDFDocument(_0x57f61f,_0x4a0130[_0xbbb7('0x53')])[_0xbbb7('0x54')](function(_0x500f11){throw _0x500f11;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 7e3f3c3..c6e6784 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 _0x472f=['Empty','split','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num'];(function(_0x241bec,_0x23d4ae){var _0x2deeb7=function(_0x44846a){while(--_0x44846a){_0x241bec['push'](_0x241bec['shift']());}};_0x2deeb7(++_0x23d4ae);}(_0x472f,0x1e5));var _0xf472=function(_0x2538da,_0x329a1a){_0x2538da=_0x2538da-0x0;var _0x38e61f=_0x472f[_0x2538da];return _0x38e61f;};'use strict';var util=require(_0xf472('0x0'));var path=require(_0xf472('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xf472('0x2'));var BPromise=require(_0xf472('0x3'));var zipdir=require(_0xf472('0x4'));var rimraf=require(_0xf472('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf472('0x6'))['dbH'];var logger=require(_0xf472('0x7'))(_0xf472('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xf472('0x9')][0x2]);var QUERY=process[_0xf472('0x9')][0x3];var PATH=process[_0xf472('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4b8d6e,_0x5400c9){var _0x39faba={'status':_0x4b8d6e};var _0x28f852={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5400c9){_0x39faba[_0xf472('0xa')]=_0x5400c9;}return db[_0xf472('0xb')][_0xf472('0xc')](_0x39faba,_0x28f852);}function main(){var _0x2476cb=0x1388;var _0x4cf018;logger[_0xf472('0xd')](util[_0xf472('0xe')](_0xf472('0xf'),EXTRACTED_REPORT_ID,_0xf472('0x10')));return db[_0xf472('0x11')][_0xf472('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf472('0x13')]})[_0xf472('0x14')](function(_0x5ee7fc){if(_0x5ee7fc){_0x4cf018=_0x5ee7fc;_0x2476cb=_0x4cf018[_0xf472('0x13')]||0x1388;}})[_0xf472('0x14')](function(){return dbH['sequelize'][_0xf472('0x15')](util[_0xf472('0xe')](_0xf472('0x16'),QUERY),{'type':dbH['sequelize'][_0xf472('0x17')]['SELECT']});})[_0xf472('0x14')](function(_0x2170eb){if(!_0x2170eb[0x0][_0xf472('0x18')]){return analyticExtractedReport(_0xf472('0x19'));}var _0x54b283=[];var _0x39390d=0x0;if(_0x4cf018[_0xf472('0x1a')]){if(_0x2170eb&&_0x2170eb[_0xf472('0x1b')]){var _0x2f8420=_[_0xf472('0x1c')](_0x2170eb[0x0]['num']/_0x2476cb);var _0x347f08=Number['isInteger'](_0x2170eb[0x0][_0xf472('0x18')]/_0x2476cb)?_0x2170eb[0x0][_0xf472('0x18')]%_0x2476cb:0x0;_0x2f8420[_0xf472('0x1d')](function(_0x4eb920){if(_0x4eb920>0x0){_0x39390d+=_0x2476cb;}_0x54b283[_0xf472('0x1e')](dbH['sequelize']['query'](util['format'](_0xf472('0x1f'),QUERY,_0x2476cb,_0x39390d),{'type':dbH[_0xf472('0x20')][_0xf472('0x17')]['SELECT']}));});if(_0x347f08>0x0){_0x39390d+=_0x2476cb;_0x54b283[_0xf472('0x1e')](dbH['sequelize'][_0xf472('0x15')](util[_0xf472('0xe')](_0xf472('0x1f'),QUERY,_0x347f08,_0x39390d),{'type':dbH[_0xf472('0x20')][_0xf472('0x17')][_0xf472('0x21')]}));}}}else{_0x54b283[_0xf472('0x1e')](dbH[_0xf472('0x20')][_0xf472('0x15')](QUERY,{'type':dbH[_0xf472('0x20')][_0xf472('0x17')]['SELECT']}));}var _0x14f0a1=path['dirname'](PATH);var _0x5ce6ad=path[_0xf472('0x22')](PATH,_0xf472('0x23'));var _0x1b6c5c=_0x4cf018[_0xf472('0x1a')]&&_0x54b283[_0xf472('0x1b')]>0x1;var _0x105170=[];if(!fs[_0xf472('0x24')](path[_0xf472('0x25')](_0x14f0a1,_0x5ce6ad))&&_0x1b6c5c){fs[_0xf472('0x26')](path[_0xf472('0x25')](_0x14f0a1,_0x5ce6ad));}return BPromise[_0xf472('0x27')](_0x54b283,function(_0x107379){_0x105170[_0xf472('0x1e')](_0x107379);})[_0xf472('0x14')](function(){for(var _0x59f7d4=0x0;_0x59f7d4<_0x105170[_0xf472('0x1b')];_0x59f7d4+=0x1){var _0x3066ec;var _0x4cd188=_0x105170[_0x59f7d4];if(_0x1b6c5c){_0x3066ec=path[_0xf472('0x25')](_0x14f0a1,_0x5ce6ad,util[_0xf472('0xe')](_0xf472('0x28'),_0x5ce6ad,_0x59f7d4,'xlsx'));}else{_0x3066ec=path[_0xf472('0x25')](_0x14f0a1,util[_0xf472('0xe')](_0xf472('0x29'),_0x5ce6ad,_0xf472('0x2a')));}fs[_0xf472('0x2b')](_0x3066ec,json2xls(_0x4cd188),_0xf472('0x2c'));}})['then'](function(){if(_0x1b6c5c){return new Promise(function(_0x25cc04){zipdir(path[_0xf472('0x25')](_0x14f0a1,_0x5ce6ad),{'saveTo':path[_0xf472('0x25')](_0x14f0a1,util[_0xf472('0xe')](_0xf472('0x29'),_0x5ce6ad,_0xf472('0x2d')))},function(_0x1f0b0f,_0x38533d){rimraf(path[_0xf472('0x25')](_0x14f0a1,_0x5ce6ad),function(){});_0x25cc04(_0xf472('0x2e'));});});}})['then'](function(){logger[_0xf472('0xd')](util[_0xf472('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf472('0x10')));return analyticExtractedReport('Completed',_0x1b6c5c?util['format'](_0xf472('0x29'),_0x5ce6ad,_0x1b6c5c?'zip':_0xf472('0x2a')):null);});})['catch'](function(_0x583606){logger[_0xf472('0xd')](util[_0xf472('0xe')](_0xf472('0x2f'),EXTRACTED_REPORT_ID,_0xf472('0x10')),util[_0xf472('0x30')](_0x583606,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf472('0x31'));})[_0xf472('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x754b=['rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','mkdirSync','xlsx','%s.%s','writeFileSync','binary','zip','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','finally','exit','util','path','lodash','json2xls','bluebird'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x754b,0x1ef));var _0xb754=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x754b[_0x172747];return _0x509692;};'use strict';var util=require(_0xb754('0x0'));var path=require(_0xb754('0x1'));var _=require(_0xb754('0x2'));var fs=require('fs');var json2xls=require(_0xb754('0x3'));var BPromise=require(_0xb754('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xb754('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb754('0x6'))[_0xb754('0x7')];var logger=require('../../config/logger')(_0xb754('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xb754('0x9')][0x2]);var QUERY=process[_0xb754('0x9')][0x3];var PATH=process[_0xb754('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ac2bb,_0x197679){var _0x347723={'status':_0x2ac2bb};var _0x4903c8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x197679){_0x347723['savename']=_0x197679;}return db[_0xb754('0xa')][_0xb754('0xb')](_0x347723,_0x4903c8);}function main(){var _0x17f766=0x1388;var _0x1b5588;logger[_0xb754('0xc')](util[_0xb754('0xd')](_0xb754('0xe'),EXTRACTED_REPORT_ID,_0xb754('0xf')));return db['Setting'][_0xb754('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb754('0x11'),_0xb754('0x12')]})['then'](function(_0x5d34d9){if(_0x5d34d9){_0x1b5588=_0x5d34d9;_0x17f766=_0x1b5588[_0xb754('0x12')]||0x1388;}})[_0xb754('0x13')](function(){return dbH[_0xb754('0x14')][_0xb754('0x15')](util[_0xb754('0xd')](_0xb754('0x16'),QUERY),{'type':dbH[_0xb754('0x14')][_0xb754('0x17')]['SELECT']});})[_0xb754('0x13')](function(_0x4ddd00){if(!_0x4ddd00[0x0][_0xb754('0x18')]){return analyticExtractedReport(_0xb754('0x19'));}var _0x22f9f2=[];var _0x1dfd4e=0x0;if(_0x1b5588[_0xb754('0x11')]){if(_0x4ddd00&&_0x4ddd00[_0xb754('0x1a')]){var _0x50c95f=_[_0xb754('0x1b')](_0x4ddd00[0x0]['num']/_0x17f766);var _0x1626f9=Number[_0xb754('0x1c')](_0x4ddd00[0x0]['num']/_0x17f766)?_0x4ddd00[0x0][_0xb754('0x18')]%_0x17f766:0x0;_0x50c95f[_0xb754('0x1d')](function(_0x1f29d7){if(_0x1f29d7>0x0){_0x1dfd4e+=_0x17f766;}_0x22f9f2[_0xb754('0x1e')](dbH[_0xb754('0x14')][_0xb754('0x15')](util[_0xb754('0xd')](_0xb754('0x1f'),QUERY,_0x17f766,_0x1dfd4e),{'type':dbH[_0xb754('0x14')][_0xb754('0x17')][_0xb754('0x20')]}));});if(_0x1626f9>0x0){_0x1dfd4e+=_0x17f766;_0x22f9f2[_0xb754('0x1e')](dbH[_0xb754('0x14')][_0xb754('0x15')](util[_0xb754('0xd')](_0xb754('0x1f'),QUERY,_0x1626f9,_0x1dfd4e),{'type':dbH[_0xb754('0x14')][_0xb754('0x17')][_0xb754('0x20')]}));}}}else{_0x22f9f2[_0xb754('0x1e')](dbH[_0xb754('0x14')][_0xb754('0x15')](QUERY,{'type':dbH[_0xb754('0x14')][_0xb754('0x17')][_0xb754('0x20')]}));}var _0x2f2d19=path[_0xb754('0x21')](PATH);var _0x5d5326=path[_0xb754('0x22')](PATH,'.xlsx');var _0x2f5cf5=_0x1b5588[_0xb754('0x11')]&&_0x22f9f2[_0xb754('0x1a')]>0x1;var _0x19efc2=[];if(!fs[_0xb754('0x23')](path[_0xb754('0x24')](_0x2f2d19,_0x5d5326))&&_0x2f5cf5){fs[_0xb754('0x25')](path[_0xb754('0x24')](_0x2f2d19,_0x5d5326));}return BPromise['each'](_0x22f9f2,function(_0x5e991e){_0x19efc2['push'](_0x5e991e);})[_0xb754('0x13')](function(){for(var _0x115ae5=0x0;_0x115ae5<_0x19efc2[_0xb754('0x1a')];_0x115ae5+=0x1){var _0x2148bc;var _0x522342=_0x19efc2[_0x115ae5];if(_0x2f5cf5){_0x2148bc=path[_0xb754('0x24')](_0x2f2d19,_0x5d5326,util[_0xb754('0xd')]('%s%d.%s',_0x5d5326,_0x115ae5,_0xb754('0x26')));}else{_0x2148bc=path[_0xb754('0x24')](_0x2f2d19,util[_0xb754('0xd')](_0xb754('0x27'),_0x5d5326,_0xb754('0x26')));}fs[_0xb754('0x28')](_0x2148bc,json2xls(_0x522342),_0xb754('0x29'));}})[_0xb754('0x13')](function(){if(_0x2f5cf5){return new Promise(function(_0x12317e){zipdir(path[_0xb754('0x24')](_0x2f2d19,_0x5d5326),{'saveTo':path['join'](_0x2f2d19,util[_0xb754('0xd')](_0xb754('0x27'),_0x5d5326,_0xb754('0x2a')))},function(_0x3a4dee,_0x243842){rimraf(path[_0xb754('0x24')](_0x2f2d19,_0x5d5326),function(){});_0x12317e('zip\x20finished');});});}})[_0xb754('0x13')](function(){logger[_0xb754('0xc')](util[_0xb754('0xd')](_0xb754('0x2b'),EXTRACTED_REPORT_ID,_0xb754('0xf')));return analyticExtractedReport(_0xb754('0x2c'),_0x2f5cf5?util[_0xb754('0xd')]('%s.%s',_0x5d5326,_0x2f5cf5?'zip':_0xb754('0x26')):null);});})['catch'](function(_0x3acf26){logger[_0xb754('0xc')](util[_0xb754('0xd')](_0xb754('0x2d'),EXTRACTED_REPORT_ID,_0xb754('0xf')),util[_0xb754('0x2e')](_0x3acf26,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb754('0x2f'));})[_0xb754('0x30')](function(){process[_0xb754('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 7e27032..f8dbe45 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 _0xacbb=['filter','groupBy','queue','extensions','extension','find','push','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','Set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','*,*,*,*','tag','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x3add4f,_0x45745f){var _0x18e303=function(_0x51972b){while(--_0x51972b){_0x3add4f['push'](_0x3add4f['shift']());}};_0x18e303(++_0x45745f);}(_0xacbb,0xcc));var _0xbacb=function(_0x1e24d3,_0x48bba4){_0x1e24d3=_0x1e24d3-0x0;var _0x136f73=_0xacbb[_0x1e24d3];return _0x136f73;};'use strict';var _=require(_0xbacb('0x0'));var util=require(_0xbacb('0x1'));function rewrite(_0x46686b,_0x1dcde0){var _0x905b13=this;return _0x46686b[_0xbacb('0x2')][_0xbacb('0x3')][_0xbacb('0x4')]({'raw':!![]})[_0xbacb('0x5')](function(_0x4b56e5){_0x905b13[_0xbacb('0x6')]=_0x4b56e5;return _0x46686b['models'][_0xbacb('0x7')][_0xbacb('0x4')]({'where':{'IntervalId':_0x1dcde0[_0xbacb('0x8')]},'raw':!![]});})[_0xbacb('0x5')](function(_0x21f186){return _0x46686b[_0xbacb('0x2')][_0xbacb('0x7')][_0xbacb('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0xbacb('0x9')](_0x21f186,_0xbacb('0xa')))}},'order':[{'raw':_0xbacb('0xb')}],'raw':!![]});})['then'](function(_0x219aa9){var _0x1b8f6f=_['filter'](_0x219aa9,{'priority':'1'});var _0x212870=_[_0xbacb('0xc')](_0x219aa9,{'isApp':0x1});var _0x4cff4a=_[_0xbacb('0xd')](_0x212870,_0xbacb('0xa'));var _0x336da2=[_0xbacb('0xe'),'playback'];var _0x42ffa8=[];var _0x5180cd=[];for(var _0x487b8d in _0x4cff4a){if(_0x4cff4a['hasOwnProperty'](_0x487b8d)){_0x905b13['priority']=0x2;_0x905b13[_0xbacb('0xf')]=[];_0x905b13[_0xbacb('0x10')]=_[_0xbacb('0x11')](_0x1b8f6f,{'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')]});_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0]['type'],'app':'Set','appdata':util[_0xbacb('0x13')](_0xbacb('0x14'),_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')]),'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0]['exten'],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});if(_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')]===_0xbacb('0x19')){_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0]['type'],'app':'Set','appdata':_0xbacb('0x1a')+_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')],'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0]['VoiceExtensionId']});}else if(_0x4cff4a[_0x487b8d][0x0]['type']===_0xbacb('0x1b')){if(_0x905b13['extension']){_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':'CDR(destination)='+(_0x905b13['extension'][_0xbacb('0x1d')]?_0xbacb('0x1e')+_0x905b13[_0xbacb('0x10')][_0xbacb('0x1d')]+'}':_0xbacb('0x1f')),'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0]['VoiceExtensionId']});}_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':'Set','appdata':_0xbacb('0x1a')+_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')],'context':_0x4cff4a[_0x487b8d][0x0]['context'],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0]['VoiceExtensionId']});var _0x46a490=_0x905b13[_0xbacb('0x17')]++;_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x20'),'appdata':_0xbacb('0x21')+(_0x46a490+0x2)+_0xbacb('0x22')+(_0x46a490+0x1)+')','context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x46a490,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0]['VoiceExtensionId']});if(_0x905b13[_0xbacb('0x10')]){_0x905b13[_0xbacb('0xf')]['push']({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':_0x905b13['extension'][_0xbacb('0x1d')]?_0xbacb('0x23')+_0x905b13[_0xbacb('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x4cff4a[_0x487b8d][0x0]['context'],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});}_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':_0xbacb('0x24')+_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')],'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});if(_0x905b13['extension']&&_0x905b13[_0xbacb('0x10')][_0xbacb('0x25')](_0xbacb('0x26'))&&_0x905b13[_0xbacb('0x10')]['recordingFormat']!==_0xbacb('0x27')){_0x905b13[_0xbacb('0xf')]['push']({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':_0xbacb('0x28'),'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0]['exten'],'priority':_0x905b13['priority']++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0]['type'],'app':_0xbacb('0x1c'),'appdata':_0xbacb('0x29')+_0x905b13['extension'][_0xbacb('0x26')]||'wav','context':_0x4cff4a[_0x487b8d][0x0]['context'],'exten':_0x4cff4a[_0x487b8d][0x0]['exten'],'priority':_0x905b13['priority']++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0]['VoiceExtensionId']});}}_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0]['type'],'app':_0xbacb('0x1c'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4cff4a[_0x487b8d][0x0]['context'],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':_0xbacb('0x2a'),'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0]['exten'],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x15')],'app':'Set','appdata':_0xbacb('0x2b'),'context':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x16')],'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'priority':_0x905b13[_0xbacb('0x17')]++,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});for(var _0x23f6d8=0x0,_0x449435=0x0;_0x23f6d8<_0x4cff4a[_0x487b8d]['length'];_0x23f6d8+=0x1,_0x449435=0x0){var _0x21462a=_0x4cff4a[_0x487b8d][_0x23f6d8];if(_0x21462a[_0xbacb('0x15')]){_0x21462a[_0xbacb('0x15')]=_0x21462a['type'][_0xbacb('0x2c')]();}var _0x24dd1b=[];var _0x452e00=[];delete _0x21462a['id'];delete _0x21462a['createdAt'];delete _0x21462a[_0xbacb('0x2d')];var _0x51800f=_0x21462a[_0xbacb('0x2e')]!==_0xbacb('0x2f')?[_0x21462a[_0xbacb('0x2e')]]:_0x21462a[_0xbacb('0x8')]?_[_0xbacb('0x9')](_[_0xbacb('0xc')](_0x905b13['intervals'],{'IntervalId':_0x21462a[_0xbacb('0x8')]}),_0xbacb('0x2e')):[];if(_0x21462a['hasOwnProperty']('tag')){if(_0x21462a[_0xbacb('0x30')]&&_0x21462a[_0xbacb('0x30')]!=='--'){_0x24dd1b['push']({'type':_0x21462a[_0xbacb('0x15')],'app':'Set','appdata':'CDR(tag)='+_0x21462a[_0xbacb('0x30')],'context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13['priority']+_0x449435++,'VoiceExtensionId':_0x21462a['VoiceExtensionId']});}}if(_0x21462a[_0xbacb('0x15')]===_0xbacb('0x1b')&&_0x21462a[_0xbacb('0x25')]('callerID')){if(_0x21462a['callerID']){_0x24dd1b[_0xbacb('0x12')]({'type':_0x21462a[_0xbacb('0x15')],'app':_0xbacb('0x20'),'appdata':_0xbacb('0x32')+_0x21462a[_0xbacb('0x33')]+')','context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f['length']+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});}else{_0x24dd1b[_0xbacb('0x12')]({'type':_0x21462a['type'],'app':_0xbacb('0x20'),'appdata':_0xbacb('0x34'),'context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});}}if(_0x21462a['hasOwnProperty']('answer')){if(_0x336da2[_0xbacb('0x35')](_0x21462a[_0xbacb('0x36')][_0xbacb('0x2c')]())>=0x0&&_0x21462a[_0xbacb('0x37')]!==_0xbacb('0x38')){if(_0x21462a[_0xbacb('0x39')]){_0x24dd1b[_0xbacb('0x12')]({'type':_0x21462a[_0xbacb('0x15')],'app':_0xbacb('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x21462a['context'],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});_0x24dd1b['push']({'type':_0x21462a[_0xbacb('0x15')],'app':_0xbacb('0x1c'),'appdata':_0xbacb('0x3a'),'context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});}else{_0x24dd1b['push']({'type':_0x21462a[_0xbacb('0x15')],'app':_0xbacb('0x20'),'appdata':_0xbacb('0x3b'),'context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a['exten'],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});_0x24dd1b[_0xbacb('0x12')]({'type':_0x21462a['type'],'app':_0xbacb('0x1c'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x21462a[_0xbacb('0x16')],'exten':_0x21462a[_0xbacb('0xa')],'priority':_0x51800f[_0xbacb('0x31')]+_0x905b13[_0xbacb('0x17')]+_0x449435++,'VoiceExtensionId':_0x21462a[_0xbacb('0x18')]});}}}for(var _0xf95789=0x0;_0xf95789<_0x51800f[_0xbacb('0x31')];_0xf95789+=0x1){var _0x15bf81=_0x905b13['priority']+_0x51800f[_0xbacb('0x31')];var _0x21d6cd=_0xf95789===_0x51800f[_0xbacb('0x31')]-0x1?_0x905b13['priority']+_0x24dd1b['length']+_0x452e00['length']+0x2:_0x905b13['priority']+_0xf95789+0x1;_0x24dd1b[_0xbacb('0x3c')](_0xf95789,0x0,{'type':_0x21462a[_0xbacb('0x15')],'app':_0xbacb('0x3d'),'appdata':_0x51800f[_0xf95789]+'?'+_0x21462a[_0xbacb('0x16')]+_0xbacb('0x3e')+_0x15bf81+':'+_0x21462a[_0xbacb('0x16')]+_0xbacb('0x3e')+_0x21d6cd,'exten':_0x21462a[_0xbacb('0xa')],'context':_0x21462a['context'],'priority':_0x905b13[_0xbacb('0x17')]+_0xf95789,'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});}_0x21462a[_0xbacb('0x17')]=_0x24dd1b[_0xbacb('0x31')]?_[_0xbacb('0x3f')](_0x24dd1b)[_0xbacb('0x17')]+0x1:_0x905b13[_0xbacb('0x17')];_0x905b13[_0xbacb('0x17')]=(_0x452e00[_0xbacb('0x31')]?_[_0xbacb('0x3f')](_0x452e00)[_0xbacb('0x17')]:_0x21462a[_0xbacb('0x17')])+0x1;_0x905b13[_0xbacb('0xf')]=_[_0xbacb('0x40')](_0x905b13['extensions'],_0x24dd1b,[_0x21462a],_0x452e00);}_0x905b13[_0xbacb('0xf')][_0xbacb('0x12')]({'type':_0x4cff4a[_0x487b8d][0x0]['type'],'app':_0xbacb('0x41'),'exten':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0xa')],'context':_0x4cff4a[_0x487b8d][0x0]['context'],'priority':_0x905b13[_0xbacb('0x17')],'VoiceExtensionId':_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]});_0x42ffa8['push'](_0x4cff4a[_0x487b8d][0x0][_0xbacb('0x18')]);_0x5180cd=_['concat'](_0x5180cd,_0x905b13[_0xbacb('0xf')]);}}return _0x46686b[_0xbacb('0x42')](function(_0x1d0416){return _0x46686b[_0xbacb('0x2')][_0xbacb('0x7')][_0xbacb('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x42ffa8}},'transaction':_0x1d0416})[_0xbacb('0x5')](function(_0x112ff1){return _0x46686b['models'][_0xbacb('0x7')][_0xbacb('0x44')](_[_0xbacb('0x45')](_0x5180cd,'priority'),{'transaction':_0x1d0416});});});})[_0xbacb('0x46')](function(_0x169110){console[_0xbacb('0x47')](_0x169110);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xab42=['filter','groupBy','exten','queue','priority','extensions','extension','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','*,*,*,*','interval','IntervalId','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','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','Interval','then','intervals','models','VoiceExtension','findAll','uniq','map','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xab42,0x162));var _0x2ab4=function(_0x1db096,_0x1967c9){_0x1db096=_0x1db096-0x0;var _0x28079a=_0xab42[_0x1db096];return _0x28079a;};'use strict';var _=require(_0x2ab4('0x0'));var util=require(_0x2ab4('0x1'));function rewrite(_0x146307,_0x403ed2){var _0x4f30c2=this;return _0x146307['models'][_0x2ab4('0x2')]['findAll']({'raw':!![]})[_0x2ab4('0x3')](function(_0x1b4f3b){_0x4f30c2[_0x2ab4('0x4')]=_0x1b4f3b;return _0x146307[_0x2ab4('0x5')][_0x2ab4('0x6')][_0x2ab4('0x7')]({'where':{'IntervalId':_0x403ed2['IntervalId']},'raw':!![]});})[_0x2ab4('0x3')](function(_0x301c94){return _0x146307['models'][_0x2ab4('0x6')][_0x2ab4('0x7')]({'where':{'exten':{'$in':_[_0x2ab4('0x8')](_[_0x2ab4('0x9')](_0x301c94,'exten'))}},'order':[{'raw':_0x2ab4('0xa')}],'raw':!![]});})['then'](function(_0xe1d3e2){var _0x3a70dc=_[_0x2ab4('0xb')](_0xe1d3e2,{'priority':'1'});var _0x257d4b=_[_0x2ab4('0xb')](_0xe1d3e2,{'isApp':0x1});var _0xffb976=_[_0x2ab4('0xc')](_0x257d4b,_0x2ab4('0xd'));var _0x57aa7c=[_0x2ab4('0xe'),'playback'];var _0x7257e8=[];var _0x19b48f=[];for(var _0x49e79e in _0xffb976){if(_0xffb976['hasOwnProperty'](_0x49e79e)){_0x4f30c2[_0x2ab4('0xf')]=0x2;_0x4f30c2[_0x2ab4('0x10')]=[];_0x4f30c2[_0x2ab4('0x11')]=_[_0x2ab4('0x12')](_0x3a70dc,{'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')]});_0x4f30c2['extensions']['push']({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':util[_0x2ab4('0x15')](_0x2ab4('0x16'),_0xffb976[_0x49e79e][0x0]['type']),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0]['exten'],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});if(_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')]===_0x2ab4('0x19')){_0x4f30c2[_0x2ab4('0x10')][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x1b')+_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')],'context':_0xffb976[_0x49e79e][0x0]['context'],'exten':_0xffb976[_0x49e79e][0x0]['exten'],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});}else if(_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')]===_0x2ab4('0x1c')){if(_0x4f30c2[_0x2ab4('0x11')]){_0x4f30c2['extensions']['push']({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':'CDR(destination)='+(_0x4f30c2[_0x2ab4('0x11')]['cutdigits']?_0x2ab4('0x1d')+_0x4f30c2['extension'][_0x2ab4('0x1e')]+'}':'${EXTEN}'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2['priority']++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});}_0x4f30c2[_0x2ab4('0x10')][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0]['type'],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x1b')+_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')],'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0]['exten'],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});var _0xe1813e=_0x4f30c2[_0x2ab4('0xf')]++;_0x4f30c2['extensions'][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x1f'),'appdata':_0x2ab4('0x20')+(_0xe1813e+0x2)+_0x2ab4('0x21')+(_0xe1813e+0x1)+')','context':_0xffb976[_0x49e79e][0x0]['context'],'exten':_0xffb976[_0x49e79e][0x0]['exten'],'priority':_0xe1813e,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});if(_0x4f30c2['extension']){_0x4f30c2['extensions'][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0]['type'],'app':_0x2ab4('0x14'),'appdata':_0x4f30c2[_0x2ab4('0x11')][_0x2ab4('0x1e')]?_0x2ab4('0x22')+_0x4f30c2[_0x2ab4('0x11')][_0x2ab4('0x1e')]+'}':_0x2ab4('0x23'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});}_0x4f30c2[_0x2ab4('0x10')][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0]['type'],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x24')+_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')],'context':_0xffb976[_0x49e79e][0x0]['context'],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});if(_0x4f30c2[_0x2ab4('0x11')]&&_0x4f30c2[_0x2ab4('0x11')][_0x2ab4('0x25')](_0x2ab4('0x26'))&&_0x4f30c2['extension']['recordingFormat']!==_0x2ab4('0x27')){_0x4f30c2[_0x2ab4('0x10')][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2['priority']++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0]['VoiceExtensionId']});_0x4f30c2['extensions']['push']({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x28')+_0x4f30c2['extension'][_0x2ab4('0x26')]||_0x2ab4('0x29'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0]['VoiceExtensionId']});}}_0x4f30c2['extensions'][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':'Set','appdata':_0x2ab4('0x2a'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0]['VoiceExtensionId']});_0x4f30c2[_0x2ab4('0x10')]['push']({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x2b'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0]['exten'],'priority':_0x4f30c2[_0x2ab4('0xf')]++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});_0x4f30c2[_0x2ab4('0x10')]['push']({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x2c'),'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'priority':_0x4f30c2['priority']++,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});for(var _0x520222=0x0,_0x1b5fcb=0x0;_0x520222<_0xffb976[_0x49e79e][_0x2ab4('0x2d')];_0x520222+=0x1,_0x1b5fcb=0x0){var _0x2ecaf3=_0xffb976[_0x49e79e][_0x520222];if(_0x2ecaf3[_0x2ab4('0x13')]){_0x2ecaf3[_0x2ab4('0x13')]=_0x2ecaf3[_0x2ab4('0x13')]['toLowerCase']();}var _0x49b0af=[];var _0x5eeaa0=[];delete _0x2ecaf3['id'];delete _0x2ecaf3[_0x2ab4('0x2e')];delete _0x2ecaf3['updatedAt'];var _0x154395=_0x2ecaf3['interval']!==_0x2ab4('0x2f')?[_0x2ecaf3[_0x2ab4('0x30')]]:_0x2ecaf3[_0x2ab4('0x31')]?_['map'](_[_0x2ab4('0xb')](_0x4f30c2[_0x2ab4('0x4')],{'IntervalId':_0x2ecaf3[_0x2ab4('0x31')]}),_0x2ab4('0x30')):[];if(_0x2ecaf3[_0x2ab4('0x25')](_0x2ab4('0x32'))){if(_0x2ecaf3[_0x2ab4('0x32')]&&_0x2ecaf3[_0x2ab4('0x32')]!=='--'){_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3['type'],'app':_0x2ab4('0x14'),'appdata':_0x2ab4('0x33')+_0x2ecaf3[_0x2ab4('0x32')],'context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3['exten'],'priority':_0x154395[_0x2ab4('0x2d')]+_0x4f30c2[_0x2ab4('0xf')]+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});}}if(_0x2ecaf3[_0x2ab4('0x13')]==='outbound'&&_0x2ecaf3[_0x2ab4('0x25')](_0x2ab4('0x34'))){if(_0x2ecaf3[_0x2ab4('0x34')]){_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3['type'],'app':_0x2ab4('0x1f'),'appdata':_0x2ab4('0x35')+_0x2ecaf3[_0x2ab4('0x34')]+')','context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3[_0x2ab4('0xd')],'priority':_0x154395['length']+_0x4f30c2[_0x2ab4('0xf')]+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});}else{_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3[_0x2ab4('0x13')],'app':_0x2ab4('0x1f'),'appdata':_0x2ab4('0x36'),'context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3['exten'],'priority':_0x154395['length']+_0x4f30c2[_0x2ab4('0xf')]+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});}}if(_0x2ecaf3[_0x2ab4('0x25')](_0x2ab4('0x37'))){if(_0x57aa7c[_0x2ab4('0x38')](_0x2ecaf3[_0x2ab4('0x39')]['toLowerCase']())>=0x0&&_0x2ecaf3[_0x2ab4('0x3a')]!==_0x2ab4('0x3b')){if(_0x2ecaf3[_0x2ab4('0x37')]){_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3[_0x2ab4('0x13')],'app':_0x2ab4('0x1f'),'appdata':_0x2ab4('0x3c'),'context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3['exten'],'priority':_0x154395[_0x2ab4('0x2d')]+_0x4f30c2[_0x2ab4('0xf')]+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3['type'],'app':_0x2ab4('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3[_0x2ab4('0xd')],'priority':_0x154395['length']+_0x4f30c2[_0x2ab4('0xf')]+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});}else{_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3[_0x2ab4('0x13')],'app':_0x2ab4('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3['exten'],'priority':_0x154395['length']+_0x4f30c2['priority']+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});_0x49b0af[_0x2ab4('0x1a')]({'type':_0x2ecaf3[_0x2ab4('0x13')],'app':'Set','appdata':_0x2ab4('0x3d'),'context':_0x2ecaf3[_0x2ab4('0x17')],'exten':_0x2ecaf3[_0x2ab4('0xd')],'priority':_0x154395[_0x2ab4('0x2d')]+_0x4f30c2['priority']+_0x1b5fcb++,'VoiceExtensionId':_0x2ecaf3[_0x2ab4('0x18')]});}}}for(var _0x37b836=0x0;_0x37b836<_0x154395[_0x2ab4('0x2d')];_0x37b836+=0x1){var _0x26c056=_0x4f30c2[_0x2ab4('0xf')]+_0x154395['length'];var _0x474a71=_0x37b836===_0x154395['length']-0x1?_0x4f30c2[_0x2ab4('0xf')]+_0x49b0af[_0x2ab4('0x2d')]+_0x5eeaa0['length']+0x2:_0x4f30c2[_0x2ab4('0xf')]+_0x37b836+0x1;_0x49b0af[_0x2ab4('0x3e')](_0x37b836,0x0,{'type':_0x2ecaf3[_0x2ab4('0x13')],'app':_0x2ab4('0x3f'),'appdata':_0x154395[_0x37b836]+'?'+_0x2ecaf3[_0x2ab4('0x17')]+_0x2ab4('0x40')+_0x26c056+':'+_0x2ecaf3['context']+',${EXTEN},'+_0x474a71,'exten':_0x2ecaf3['exten'],'context':_0x2ecaf3[_0x2ab4('0x17')],'priority':_0x4f30c2['priority']+_0x37b836,'VoiceExtensionId':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]});}_0x2ecaf3[_0x2ab4('0xf')]=_0x49b0af[_0x2ab4('0x2d')]?_[_0x2ab4('0x41')](_0x49b0af)['priority']+0x1:_0x4f30c2[_0x2ab4('0xf')];_0x4f30c2[_0x2ab4('0xf')]=(_0x5eeaa0[_0x2ab4('0x2d')]?_['last'](_0x5eeaa0)[_0x2ab4('0xf')]:_0x2ecaf3['priority'])+0x1;_0x4f30c2[_0x2ab4('0x10')]=_[_0x2ab4('0x42')](_0x4f30c2['extensions'],_0x49b0af,[_0x2ecaf3],_0x5eeaa0);}_0x4f30c2[_0x2ab4('0x10')][_0x2ab4('0x1a')]({'type':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x13')],'app':_0x2ab4('0x43'),'exten':_0xffb976[_0x49e79e][0x0][_0x2ab4('0xd')],'context':_0xffb976[_0x49e79e][0x0][_0x2ab4('0x17')],'priority':_0x4f30c2['priority'],'VoiceExtensionId':_0xffb976[_0x49e79e][0x0]['VoiceExtensionId']});_0x7257e8['push'](_0xffb976[_0x49e79e][0x0][_0x2ab4('0x18')]);_0x19b48f=_[_0x2ab4('0x42')](_0x19b48f,_0x4f30c2['extensions']);}}return _0x146307[_0x2ab4('0x44')](function(_0x10db6c){return _0x146307[_0x2ab4('0x5')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x7257e8}},'transaction':_0x10db6c})[_0x2ab4('0x3')](function(_0x21560c){return _0x146307[_0x2ab4('0x5')][_0x2ab4('0x6')][_0x2ab4('0x45')](_[_0x2ab4('0x46')](_0x19b48f,_0x2ab4('0xf')),{'transaction':_0x10db6c});});});})[_0x2ab4('0x47')](function(_0x473613){console['error'](_0x473613);});}exports[_0x2ab4('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5840244..500b771 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 _0x603a=['resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','isNil','error','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','cm_hopper','phone','ContactId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','ListId\x20=\x20?','cm_hopper_black','fromQuery','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','all','Campaign','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume'];(function(_0x514645,_0x5dd6b5){var _0x43df13=function(_0x1f230c){while(--_0x1f230c){_0x514645['push'](_0x514645['shift']());}};_0x43df13(++_0x5dd6b5);}(_0x603a,0x1c3));var _0xa603=function(_0x17bf78,_0x11b909){_0x17bf78=_0x17bf78-0x0;var _0x1c6370=_0x603a[_0x17bf78];return _0x1c6370;};'use strict';var BPromise=require(_0xa603('0x0'));var util=require(_0xa603('0x1'));var _=require(_0xa603('0x2'));var fs=require('fs');var squel=require(_0xa603('0x3'));var Papa=require(_0xa603('0x4'));var Redis=require(_0xa603('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xa603('0x6'));var logger=require(_0xa603('0x7'))('api');config[_0xa603('0x8')]=_[_0xa603('0x9')](config[_0xa603('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xa603('0xa'))(new Redis(config['redis']));require(_0xa603('0xb'))['register'](socket);try{if(!process['argv'][0x2]||process[_0xa603('0xc')][0x2]===_0xa603('0xd')||process[_0xa603('0xc')][0x2]===_0xa603('0xe')){throw new Error(_0xa603('0xf'));}var FILEPATH=process[_0xa603('0xc')][0x2];if(!process['argv'][0x3]||process[_0xa603('0xc')][0x3]===_0xa603('0xd')||process[_0xa603('0xc')][0x3]===_0xa603('0xe')||!process['argv'][0x4]||process[_0xa603('0xc')][0x4]==='undefined'||process[_0xa603('0xc')][0x4]===_0xa603('0xe')){throw new Error(_0xa603('0x10'));}var FIELDS=_[_0xa603('0x11')](process[_0xa603('0xc')][0x3][_0xa603('0x12')](','),process[_0xa603('0xc')][0x4]['split'](','));if(!process[_0xa603('0xc')][0x5]||process[_0xa603('0xc')][0x5]===_0xa603('0xd')||process[_0xa603('0xc')][0x5]===_0xa603('0xe')){throw new Error(_0xa603('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xa603('0xc')][0x6]&&process[_0xa603('0xc')][0x6]!==_0xa603('0xd')&&process[_0xa603('0xc')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xa603('0xc')][0x7]&&process['argv'][0x7]!==_0xa603('0xd')&&process[_0xa603('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xa603('0xc')][0x8]||process['argv'][0x8]===_0xa603('0xd')||process[_0xa603('0xc')][0x8]===_0xa603('0xe')){throw new Error(_0xa603('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5d9cf4){logger['error'](_0x5d9cf4);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(_0x1fe2b9,_0x2c0a30,_0x31d801,_0x12cef6){var _0x129e94={'message':_0x2c0a30};_0x129e94[_0x1fe2b9]=!![];if(_0x31d801){_0x129e94['contact']=_0x31d801;}if(_0x12cef6){_0x129e94[_0xa603('0x15')]=_0x12cef6;}return _0x129e94;}function isEmail(_0x10f57a){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'](_0x10f57a);}function checkRow(_0x92d75,_0x5376a2,_0x512ec0){return new BPromise(function(_0x58cefd,_0xdc9544){if(_[_0xa603('0x16')](_0x92d75)){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x512ec0));}if(_0x92d75[_0xa603('0x18')]&&_0x92d75[_0xa603('0x18')][_0xa603('0x19')]){var _0x5162bb=_[_0xa603('0x1a')](_0x92d75[_0xa603('0x18')],_0xa603('0x1b'))[_0xa603('0x1c')](';');return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0x5162bb,null,_0x512ec0));}var _0x3edec7={};for(var _0x52741f in FIELDS){if(FIELDS['hasOwnProperty'](_0x52741f)&&FIELDS[_0x52741f]){_0x3edec7[_0x52741f]=_0x92d75[_0xa603('0x1d')][0x0][FIELDS[_0x52741f]]||_0x92d75[_0xa603('0x1d')][0x0]['\ufeff'+FIELDS[_0x52741f]];}}if(!_0x3edec7[_0xa603('0x1e')]){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0xa603('0x1f'),null,_0x512ec0));}if(!_0x3edec7['phone']){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0xa603('0x20'),null,_0x512ec0));}if(_0x3edec7[_0xa603('0x21')]){var _0x1855fb=moment(_0x3edec7[_0xa603('0x21')],_0xa603('0x22'));if(!_0x1855fb['isValid']()){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0xa603('0x23'),null,_0x512ec0));}}if(_0x3edec7[_0xa603('0x24')]){if(!isEmail(_0x3edec7[_0xa603('0x24')])){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0xa603('0x25'),null,_0x512ec0));}}_0x3edec7[_0xa603('0x26')]=LISTID;_0x3edec7['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa603('0x19')]&&_0x5376a2){var _0x46ea19={};for(var _0x137f2d=0x0,_0xc024f1=DUPLICATES[_0xa603('0x19')];_0x137f2d<_0xc024f1;_0x137f2d+=0x1){_0x46ea19[DUPLICATES[_0x137f2d]]=_0x3edec7[DUPLICATES[_0x137f2d]];}var _0x5d4d91=_[_0xa603('0x27')](_0x5376a2,_0x46ea19);if(_0x5d4d91){return _0xdc9544(handleCheckRowError(_0xa603('0x28'),_0xa603('0x29'),_0x5d4d91,_0x512ec0));}}return db['CmContact'][_0xa603('0x2a')](_0x3edec7,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3edec7)})[_0xa603('0x2b')](function(_0x2548a9){if(DUPLICATES&&DUPLICATES['length']&&_0x5376a2){_0x5376a2[_0xa603('0x2c')](_[_0xa603('0x2d')](_0x3edec7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2548a9['id'];return _0x58cefd();})[_0xa603('0x2e')](function(_0x53d204){return _0xdc9544(handleCheckRowError(_0xa603('0x17'),_0xa603('0x2f')+(_0x53d204[_0xa603('0x1b')]||JSON[_0xa603('0x30')](_0x53d204)),null,_0x512ec0));});});}function checkHopper(){function _0x300cef(){return function(_0x27a360){logger[_0xa603('0x17')](_0xa603('0x31'),'checkHopper',util[_0xa603('0x32')](_0x27a360,{'showHidden':![],'depth':null}));};}var _0x5cdaf8=function(_0x416d11,_0x556b22){var _0x5a591a=squel['insert']()[_0xa603('0x33')](_0xa603('0x34'))['fromQuery']([_0xa603('0x35'),'scheduledAt',_0xa603('0x36'),'ListId',_0x556b22,_0xa603('0x37'),'updatedAt'],squel[_0xa603('0x38')]()[_0xa603('0x39')](_0xa603('0x35'),_0xa603('0x35'))[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x3b'))[_0xa603('0x39')]('id',_0xa603('0x36'))[_0xa603('0x39')](LISTID[_0xa603('0x3c')](),_0xa603('0x26'))['field'](_0x416d11['id'][_0xa603('0x3c')](),_0x556b22)[_0xa603('0x39')](_0xa603('0x3a'),'createdAt')[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x3d'))['from'](_0xa603('0x3e'))[_0xa603('0x3f')](_0xa603('0x40'))[_0xa603('0x3f')]('ListId\x20=\x20?',LISTID[_0xa603('0x3c')]())['where'](_0xa603('0x41'))[_0xa603('0x3f')](_0xa603('0x42'),squel[_0xa603('0x38')]()[_0xa603('0x39')](_0xa603('0x35'))[_0xa603('0x43')](_0xa603('0x34'))[_0xa603('0x3f')](_0x556b22+_0xa603('0x44'),_0x416d11['id'][_0xa603('0x3c')]())))[_0xa603('0x3c')]();return _0x5a591a;};var _0x317a2b=function(_0x26532b,_0x387400){var _0x41f06c=squel['insert']()[_0xa603('0x33')](_0xa603('0x34'))['fromQuery']([_0xa603('0x35'),'scheduledAt','ContactId',_0xa603('0x26'),_0x387400,_0xa603('0x37'),_0xa603('0x3d')],squel[_0xa603('0x38')]()['field'](_0xa603('0x35'),'phone')[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x3b'))[_0xa603('0x39')]('id',_0xa603('0x36'))[_0xa603('0x39')](LISTID[_0xa603('0x3c')](),_0xa603('0x26'))['field'](_0x26532b['id'][_0xa603('0x3c')](),_0x387400)['field'](_0xa603('0x3a'),_0xa603('0x37'))[_0xa603('0x39')](_0xa603('0x3a'),'updatedAt')[_0xa603('0x43')](_0xa603('0x3e'))['where'](_0xa603('0x40'))[_0xa603('0x3f')]('ListId\x20=\x20?',LISTID[_0xa603('0x3c')]())['where'](_0xa603('0x45'),squel[_0xa603('0x46')](hopperContacts))[_0xa603('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xa603('0x3f')](_0xa603('0x42'),squel[_0xa603('0x38')]()[_0xa603('0x39')](_0xa603('0x47'))[_0xa603('0x43')](_0xa603('0x48'))[_0xa603('0x3f')](_0x387400+_0xa603('0x44'),_0x26532b['id'][_0xa603('0x3c')]()))[_0xa603('0x3f')](_0xa603('0x42'),squel[_0xa603('0x38')]()[_0xa603('0x39')](_0xa603('0x35'))[_0xa603('0x43')](_0xa603('0x34'))[_0xa603('0x3f')](_0x387400+_0xa603('0x44'),_0x26532b['id'][_0xa603('0x3c')]())))[_0xa603('0x3c')]();return _0x41f06c;};function _0x561787(_0x24ebb2,_0x513903){var _0x43468e=squel[_0xa603('0x49')]()[_0xa603('0x33')](_0xa603('0x34'))['fromQuery'](['phone',_0xa603('0x3b'),_0xa603('0x36'),_0xa603('0x26'),_0x513903,_0xa603('0x37'),_0xa603('0x3d')],squel['select']()['field']('phone','phone')[_0xa603('0x39')]('NOW()',_0xa603('0x3b'))[_0xa603('0x39')]('id',_0xa603('0x36'))[_0xa603('0x39')](LISTID[_0xa603('0x3c')](),_0xa603('0x26'))[_0xa603('0x39')](_0x24ebb2['id'][_0xa603('0x3c')](),_0x513903)[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x37'))[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x3d'))['from'](_0xa603('0x3e'))[_0xa603('0x3f')](_0xa603('0x40'))[_0xa603('0x3f')](_0xa603('0x4a'),LISTID[_0xa603('0x3c')]())[_0xa603('0x3f')]('id\x20IN\x20?',squel[_0xa603('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa603('0x3c')]();return _0x43468e;}function _0x36bd14(_0x57da00,_0x4b7c82){var _0x100086=squel[_0xa603('0x49')]()[_0xa603('0x33')](_0xa603('0x4b'))[_0xa603('0x4c')]([_0xa603('0x35'),_0xa603('0x36'),_0xa603('0x26'),_0x4b7c82,_0xa603('0x37'),_0xa603('0x3d')],squel[_0xa603('0x38')]()[_0xa603('0x39')](_0xa603('0x35'),_0xa603('0x35'))['field']('id',_0xa603('0x36'))[_0xa603('0x39')](LISTID[_0xa603('0x3c')](),_0xa603('0x26'))[_0xa603('0x39')](_0x57da00['id'][_0xa603('0x3c')](),_0x4b7c82)[_0xa603('0x39')](_0xa603('0x3a'),_0xa603('0x37'))[_0xa603('0x39')](_0xa603('0x3a'),'updatedAt')[_0xa603('0x43')]('cm_contacts')['where'](_0xa603('0x40'))[_0xa603('0x3f')](_0xa603('0x4a'),LISTID[_0xa603('0x3c')]())[_0xa603('0x3f')](_0xa603('0x45'),squel[_0xa603('0x46')](hopperContacts))[_0xa603('0x3f')](_0xa603('0x41')))['toString']();return _0x100086;}return db[_0xa603('0x4d')][_0xa603('0x4e')]({'where':{'type':_0xa603('0x4f')},'attributes':['id',_0xa603('0x50')],'include':[{'model':db[_0xa603('0x51')],'as':_0xa603('0x52'),'where':{'id':LISTID}}]})[_0xa603('0x2b')](function(_0x430332){var _0x32d8d1=[];if(_0x430332){var _0x497336;for(var _0xf11594=0x0,_0xdfdf60;_0xf11594<_0x430332[_0xa603('0x19')];_0xf11594+=0x1){_0xdfdf60=_0x430332[_0xf11594][_0xa603('0x53')]({'plain':!![]});switch(_0xdfdf60['dialCheckDuplicateType']){case'always':_0x32d8d1['push'](db[_0xa603('0x54')][_0xa603('0x55')](_0x317a2b(_0xdfdf60,_0xa603('0x56')))[_0xa603('0x2b')](function(){})[_0xa603('0x2e')](_0x300cef()));break;case _0xa603('0x57'):_0x32d8d1[_0xa603('0x2c')](db[_0xa603('0x54')]['query'](_0x5cdaf8(_0xdfdf60,_0xa603('0x56')))[_0xa603('0x2b')](function(){})[_0xa603('0x2e')](_0x300cef()));break;default:_0x32d8d1[_0xa603('0x2c')](db['sequelize'][_0xa603('0x55')](_0x561787(_0xdfdf60,_0xa603('0x56')))['then'](function(){})[_0xa603('0x2e')](_0x300cef()));}}}return _0x32d8d1;})[_0xa603('0x58')]()['then'](function(){return db[_0xa603('0x4d')]['findAll']({'where':{'type':_0xa603('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xa603('0x2b')](function(_0x376ac7){var _0x3829d0=[];if(_0x376ac7){var _0x567796;for(var _0x52a481=0x0,_0x5003af;_0x52a481<_0x376ac7[_0xa603('0x19')];_0x52a481+=0x1){_0x5003af=_0x376ac7[_0x52a481][_0xa603('0x53')]({'plain':!![]});_0x3829d0['push'](db[_0xa603('0x54')][_0xa603('0x55')](_0x36bd14(_0x5003af,_0xa603('0x56')))[_0xa603('0x2b')](function(){})['catch'](_0x300cef()));}}return _0x3829d0;})[_0xa603('0x58')]();})['then'](function(){return db[_0xa603('0x59')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xa603('0x51')],'as':_0xa603('0x52'),'where':{'id':LISTID}}]})[_0xa603('0x2b')](function(_0x3d97f5){var _0x3740e4=[];if(_0x3d97f5){for(var _0xab7010=0x0,_0x260489;_0xab7010<_0x3d97f5[_0xa603('0x19')];_0xab7010+=0x1){_0x260489=_0x3d97f5[_0xab7010][_0xa603('0x53')]({'plain':!![]});switch(_0x260489[_0xa603('0x50')]){case _0xa603('0x5a'):_0x3740e4[_0xa603('0x2c')](db[_0xa603('0x54')][_0xa603('0x55')](_0x317a2b(_0x260489,'CampaignId'))[_0xa603('0x2b')](function(){})['catch'](_0x300cef()));break;case'onlyIfOpen':_0x3740e4[_0xa603('0x2c')](db[_0xa603('0x54')][_0xa603('0x55')](_0x5cdaf8(_0x260489,_0xa603('0x5b')))[_0xa603('0x2b')](function(){})[_0xa603('0x2e')](_0x300cef()));break;default:_0x3740e4[_0xa603('0x2c')](db[_0xa603('0x54')][_0xa603('0x55')](_0x561787(_0x260489,_0xa603('0x5b')))[_0xa603('0x2b')](function(){})[_0xa603('0x2e')](_0x300cef()));}}}return _0x3740e4;})[_0xa603('0x58')]();})[_0xa603('0x2b')](function(){return db[_0xa603('0x59')][_0xa603('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xa603('0x51')],'as':_0xa603('0x5c'),'where':{'id':LISTID}}]})[_0xa603('0x2b')](function(_0x58712e){var _0x11bcb4=[];if(_0x58712e){for(var _0x18ea39=0x0,_0x5508bd;_0x18ea39<_0x58712e[_0xa603('0x19')];_0x18ea39+=0x1){_0x5508bd=_0x58712e[_0x18ea39][_0xa603('0x53')]({'plain':!![]});_0x11bcb4[_0xa603('0x2c')](db['sequelize'][_0xa603('0x55')](_0x36bd14(_0x5508bd,'CampaignId'))['then'](function(){})[_0xa603('0x2e')](_0x300cef()));}}return _0x11bcb4;})[_0xa603('0x58')]();})[_0xa603('0x2e')](function(_0x1dc0e0){logger['error'](_0xa603('0x5d'),_0xa603('0x5e'),_0x1dc0e0['message']);});}var processPromises=function(_0x4b10eb){return BPromise['all'](promises)[_0xa603('0x2b')](function(_0x5323d4){})[_0xa603('0x2e')](function(_0x3ec1da){logger[_0xa603('0x17')](_0xa603('0x5f'),JSON['stringify'](_0x3ec1da));})[_0xa603('0x60')](function(){socket[_0xa603('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b10eb){return _0x4b10eb[_0xa603('0x62')]();}});};var endCsv=function(){return BPromise[_0xa603('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xa603('0x2b')](function(){socket['emit'](_0xa603('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa603('0x65')](FILEPATH);}catch(_0x4af491){logger[_0xa603('0x17')](_0xa603('0x66'),JSON[_0xa603('0x30')](_0x4af491));}finally{process[_0xa603('0x67')](0x0);}});};process['on'](_0xa603('0x68'),function(){logger['info'](_0xa603('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0xa603('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xa603('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x16b407){var _0x5e0090=fs[_0xa603('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x5e0090,{'header':!![],'skipEmptyLines':!![],'step':function(_0x477cd6,_0x34ad0d){total+=0x1;var _0x4a2856=total;promises[_0xa603('0x2c')](checkRow(_0x477cd6,_0x16b407,_0x4a2856)['then'](function(){success+=0x1;})[_0xa603('0x2e')](function(_0x4fd055){if(_0x4fd055[_0xa603('0x17')]){errors+=0x1;delete _0x4fd055[_0xa603('0x17')];}else if(_0x4fd055[_0xa603('0x28')]){duplicates+=0x1;delete _0x4fd055[_0xa603('0x28')];}rows[_0xa603('0x2c')](_0x4fd055);}));if(total%0xc8===0x0){_0x34ad0d['pause']();return processPromises(_0x34ad0d);}},'complete':function(){return processPromises()[_0xa603('0x2b')](function(){logger[_0xa603('0x6b')](_0xa603('0x6c'));endCsv();});},'error':function(_0x38e57a,_0xb4cebb){logger[_0xa603('0x6b')]('CSV\x20parse\x20error',JSON[_0xa603('0x30')](_0x38e57a));endCsv();}});})[_0xa603('0x2e')](function(_0xf6bfef){logger[_0xa603('0x17')](_0xa603('0x6d'),JSON['stringify'](_0xf6bfef));});}main(); \ No newline at end of file +var _0xcc47=['onlyIfOpen','all','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId'];(function(_0x47383f,_0xf7af52){var _0x3095f0=function(_0xfd30e6){while(--_0xfd30e6){_0x47383f['push'](_0x47383f['shift']());}};_0x3095f0(++_0xf7af52);}(_0xcc47,0x162));var _0x7cc4=function(_0x53dd33,_0x25dc7f){_0x53dd33=_0x53dd33-0x0;var _0x49bbed=_0xcc47[_0x53dd33];return _0x49bbed;};'use strict';var BPromise=require(_0x7cc4('0x0'));var util=require(_0x7cc4('0x1'));var _=require(_0x7cc4('0x2'));var fs=require('fs');var squel=require(_0x7cc4('0x3'));var Papa=require(_0x7cc4('0x4'));var Redis=require(_0x7cc4('0x5'));var db=require(_0x7cc4('0x6'))['db'];var config=require(_0x7cc4('0x7'));var logger=require(_0x7cc4('0x8'))(_0x7cc4('0x9'));config[_0x7cc4('0xa')]=_[_0x7cc4('0xb')](config[_0x7cc4('0xa')],{'host':_0x7cc4('0xc'),'port':0x18eb});var socket=require(_0x7cc4('0xd'))(new Redis(config[_0x7cc4('0xa')]));require('../../../api/cmContact/cmContact.socket')[_0x7cc4('0xe')](socket);try{if(!process[_0x7cc4('0xf')][0x2]||process['argv'][0x2]===_0x7cc4('0x10')||process['argv'][0x2]===_0x7cc4('0x11')){throw new Error(_0x7cc4('0x12'));}var FILEPATH=process[_0x7cc4('0xf')][0x2];if(!process[_0x7cc4('0xf')][0x3]||process[_0x7cc4('0xf')][0x3]===_0x7cc4('0x10')||process[_0x7cc4('0xf')][0x3]==='null'||!process[_0x7cc4('0xf')][0x4]||process[_0x7cc4('0xf')][0x4]===_0x7cc4('0x10')||process[_0x7cc4('0xf')][0x4]===_0x7cc4('0x11')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x7cc4('0x13')](process[_0x7cc4('0xf')][0x3]['split'](','),process[_0x7cc4('0xf')][0x4][_0x7cc4('0x14')](','));if(!process[_0x7cc4('0xf')][0x5]||process[_0x7cc4('0xf')][0x5]===_0x7cc4('0x10')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x7cc4('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x7cc4('0xf')][0x6]!==_0x7cc4('0x10')&&process[_0x7cc4('0xf')][0x6]!==_0x7cc4('0x11')?process['argv'][0x6]:null;var DUPLICATES=process[_0x7cc4('0xf')][0x7]&&process[_0x7cc4('0xf')][0x7]!==_0x7cc4('0x10')&&process['argv'][0x7]!==_0x7cc4('0x11')?process[_0x7cc4('0xf')][0x7]:null;if(!process['argv'][0x8]||process[_0x7cc4('0xf')][0x8]==='undefined'||process[_0x7cc4('0xf')][0x8]===_0x7cc4('0x11')){throw new Error(_0x7cc4('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x8eb66d){logger['error'](_0x8eb66d);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(_0x2b0823,_0x38ee7e,_0x47be73,_0x2e8180){var _0x39c71d={'message':_0x38ee7e};_0x39c71d[_0x2b0823]=!![];if(_0x47be73){_0x39c71d[_0x7cc4('0x16')]=_0x47be73;}if(_0x2e8180){_0x39c71d['index']=_0x2e8180;}return _0x39c71d;}function isEmail(_0x201bb6){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))*$/[_0x7cc4('0x17')](_0x201bb6);}function checkRow(_0x9b6767,_0xe954d6,_0xc4afbb){return new BPromise(function(_0x596cfc,_0x22fc4f){if(_[_0x7cc4('0x18')](_0x9b6767)){return _0x22fc4f(handleCheckRowError(_0x7cc4('0x19'),_0x7cc4('0x1a'),null,_0xc4afbb));}if(_0x9b6767['errors']&&_0x9b6767['errors']['length']){var _0x415f2c=_[_0x7cc4('0x1b')](_0x9b6767[_0x7cc4('0x1c')],_0x7cc4('0x1d'))['join'](';');return _0x22fc4f(handleCheckRowError('error',_0x415f2c,null,_0xc4afbb));}var _0x4c6083={};for(var _0x3b2a16 in FIELDS){if(FIELDS[_0x7cc4('0x1e')](_0x3b2a16)&&FIELDS[_0x3b2a16]){_0x4c6083[_0x3b2a16]=_0x9b6767[_0x7cc4('0x1f')][0x0][FIELDS[_0x3b2a16]]||_0x9b6767[_0x7cc4('0x1f')][0x0]['\ufeff'+FIELDS[_0x3b2a16]];}}if(!_0x4c6083[_0x7cc4('0x20')]){return _0x22fc4f(handleCheckRowError(_0x7cc4('0x19'),_0x7cc4('0x21'),null,_0xc4afbb));}if(!_0x4c6083['phone']){return _0x22fc4f(handleCheckRowError(_0x7cc4('0x19'),'phone\x20not\x20specified!',null,_0xc4afbb));}if(_0x4c6083[_0x7cc4('0x22')]){var _0x7936c5=moment(_0x4c6083[_0x7cc4('0x22')],_0x7cc4('0x23'));if(!_0x7936c5['isValid']()){return _0x22fc4f(handleCheckRowError(_0x7cc4('0x19'),_0x7cc4('0x24'),null,_0xc4afbb));}}if(_0x4c6083[_0x7cc4('0x25')]){if(!isEmail(_0x4c6083[_0x7cc4('0x25')])){return _0x22fc4f(handleCheckRowError('error',_0x7cc4('0x26'),null,_0xc4afbb));}}_0x4c6083[_0x7cc4('0x27')]=LISTID;_0x4c6083[_0x7cc4('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7cc4('0x29')]&&_0xe954d6){var _0x1b538e={};for(var _0x5e6ddd=0x0,_0x45350c=DUPLICATES[_0x7cc4('0x29')];_0x5e6ddd<_0x45350c;_0x5e6ddd+=0x1){_0x1b538e[DUPLICATES[_0x5e6ddd]]=_0x4c6083[DUPLICATES[_0x5e6ddd]];}var _0x53f3c6=_['find'](_0xe954d6,_0x1b538e);if(_0x53f3c6){return _0x22fc4f(handleCheckRowError('duplicate',_0x7cc4('0x2a'),_0x53f3c6,_0xc4afbb));}}return db[_0x7cc4('0x2b')][_0x7cc4('0x2c')](_0x4c6083,{'raw':!![],'hooks':![],'fields':_[_0x7cc4('0x2d')](_0x4c6083)})[_0x7cc4('0x2e')](function(_0x390058){if(DUPLICATES&&DUPLICATES[_0x7cc4('0x29')]&&_0xe954d6){_0xe954d6[_0x7cc4('0x2f')](_[_0x7cc4('0x30')](_0x4c6083,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x390058['id'];return _0x596cfc();})[_0x7cc4('0x31')](function(_0x137f9a){return _0x22fc4f(handleCheckRowError(_0x7cc4('0x19'),'Error\x20while\x20creating\x20contact:\x20'+(_0x137f9a['message']||JSON['stringify'](_0x137f9a)),null,_0xc4afbb));});});}function checkHopper(){function _0x320318(){return function(_0xcb392d){logger[_0x7cc4('0x19')](_0x7cc4('0x32'),_0x7cc4('0x33'),util[_0x7cc4('0x34')](_0xcb392d,{'showHidden':![],'depth':null}));};}var _0x129fbd=function(_0x46d25b,_0xc1d2cb){var _0x356499=squel[_0x7cc4('0x35')]()[_0x7cc4('0x36')](_0x7cc4('0x37'))[_0x7cc4('0x38')]([_0x7cc4('0x39'),_0x7cc4('0x3a'),_0x7cc4('0x3b'),_0x7cc4('0x27'),_0xc1d2cb,_0x7cc4('0x3c'),_0x7cc4('0x3d')],squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')](_0x7cc4('0x39'),_0x7cc4('0x39'))[_0x7cc4('0x3f')](_0x7cc4('0x40'),'scheduledAt')[_0x7cc4('0x3f')]('id',_0x7cc4('0x3b'))['field'](LISTID[_0x7cc4('0x41')](),_0x7cc4('0x27'))[_0x7cc4('0x3f')](_0x46d25b['id'][_0x7cc4('0x41')](),_0xc1d2cb)[_0x7cc4('0x3f')]('NOW()',_0x7cc4('0x3c'))[_0x7cc4('0x3f')](_0x7cc4('0x40'),_0x7cc4('0x3d'))[_0x7cc4('0x42')]('cm_contacts')[_0x7cc4('0x43')](_0x7cc4('0x44'))[_0x7cc4('0x43')](_0x7cc4('0x45'),LISTID[_0x7cc4('0x41')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')](_0x7cc4('0x39'))[_0x7cc4('0x42')](_0x7cc4('0x37'))[_0x7cc4('0x43')](_0xc1d2cb+_0x7cc4('0x46'),_0x46d25b['id'][_0x7cc4('0x41')]())))[_0x7cc4('0x41')]();return _0x356499;};var _0x14bd79=function(_0x4c3cc6,_0x2d3af8){var _0x2dfaa5=squel['insert']()[_0x7cc4('0x36')](_0x7cc4('0x37'))['fromQuery']([_0x7cc4('0x39'),_0x7cc4('0x3a'),'ContactId',_0x7cc4('0x27'),_0x2d3af8,_0x7cc4('0x3c'),_0x7cc4('0x3d')],squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')]('phone',_0x7cc4('0x39'))[_0x7cc4('0x3f')](_0x7cc4('0x40'),_0x7cc4('0x3a'))[_0x7cc4('0x3f')]('id',_0x7cc4('0x3b'))[_0x7cc4('0x3f')](LISTID['toString'](),_0x7cc4('0x27'))[_0x7cc4('0x3f')](_0x4c3cc6['id']['toString'](),_0x2d3af8)[_0x7cc4('0x3f')]('NOW()',_0x7cc4('0x3c'))[_0x7cc4('0x3f')](_0x7cc4('0x40'),_0x7cc4('0x3d'))[_0x7cc4('0x42')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x7cc4('0x45'),LISTID[_0x7cc4('0x41')]())[_0x7cc4('0x43')](_0x7cc4('0x47'),squel[_0x7cc4('0x48')](hopperContacts))[_0x7cc4('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x7cc4('0x43')](_0x7cc4('0x49'),squel[_0x7cc4('0x3e')]()['field'](_0x7cc4('0x4a'))[_0x7cc4('0x42')](_0x7cc4('0x4b'))[_0x7cc4('0x43')](_0x2d3af8+_0x7cc4('0x46'),_0x4c3cc6['id'][_0x7cc4('0x41')]()))['where'](_0x7cc4('0x49'),squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')]('phone')[_0x7cc4('0x42')](_0x7cc4('0x37'))[_0x7cc4('0x43')](_0x2d3af8+_0x7cc4('0x46'),_0x4c3cc6['id'][_0x7cc4('0x41')]())))[_0x7cc4('0x41')]();return _0x2dfaa5;};function _0x2d2919(_0x9e6dc3,_0x331746){var _0x484ce2=squel[_0x7cc4('0x35')]()['into'](_0x7cc4('0x37'))['fromQuery'](['phone','scheduledAt','ContactId',_0x7cc4('0x27'),_0x331746,_0x7cc4('0x3c'),'updatedAt'],squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')](_0x7cc4('0x39'),_0x7cc4('0x39'))[_0x7cc4('0x3f')](_0x7cc4('0x40'),_0x7cc4('0x3a'))[_0x7cc4('0x3f')]('id','ContactId')[_0x7cc4('0x3f')](LISTID['toString'](),_0x7cc4('0x27'))['field'](_0x9e6dc3['id'][_0x7cc4('0x41')](),_0x331746)[_0x7cc4('0x3f')](_0x7cc4('0x40'),'createdAt')['field'](_0x7cc4('0x40'),_0x7cc4('0x3d'))[_0x7cc4('0x42')](_0x7cc4('0x4c'))[_0x7cc4('0x43')](_0x7cc4('0x44'))['where']('ListId\x20=\x20?',LISTID[_0x7cc4('0x41')]())[_0x7cc4('0x43')](_0x7cc4('0x47'),squel[_0x7cc4('0x48')](hopperContacts))[_0x7cc4('0x43')](_0x7cc4('0x4d')))[_0x7cc4('0x41')]();return _0x484ce2;}function _0x2cdbfc(_0x443bc9,_0x169fdd){var _0x79825d=squel[_0x7cc4('0x35')]()[_0x7cc4('0x36')](_0x7cc4('0x4e'))[_0x7cc4('0x38')](['phone',_0x7cc4('0x3b'),_0x7cc4('0x27'),_0x169fdd,_0x7cc4('0x3c'),'updatedAt'],squel[_0x7cc4('0x3e')]()[_0x7cc4('0x3f')]('phone',_0x7cc4('0x39'))[_0x7cc4('0x3f')]('id','ContactId')['field'](LISTID[_0x7cc4('0x41')](),_0x7cc4('0x27'))[_0x7cc4('0x3f')](_0x443bc9['id'][_0x7cc4('0x41')](),_0x169fdd)['field'](_0x7cc4('0x40'),_0x7cc4('0x3c'))[_0x7cc4('0x3f')]('NOW()',_0x7cc4('0x3d'))['from'](_0x7cc4('0x4c'))[_0x7cc4('0x43')](_0x7cc4('0x44'))[_0x7cc4('0x43')](_0x7cc4('0x45'),LISTID['toString']())[_0x7cc4('0x43')]('id\x20IN\x20?',squel[_0x7cc4('0x48')](hopperContacts))[_0x7cc4('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x7cc4('0x41')]();return _0x79825d;}return db[_0x7cc4('0x4f')][_0x7cc4('0x50')]({'where':{'type':_0x7cc4('0x51')},'attributes':['id',_0x7cc4('0x52')],'include':[{'model':db[_0x7cc4('0x53')],'as':_0x7cc4('0x54'),'where':{'id':LISTID}}]})[_0x7cc4('0x2e')](function(_0x54bb30){var _0x7fced6=[];if(_0x54bb30){var _0x360032;for(var _0xdba107=0x0,_0x3e7c0e;_0xdba107<_0x54bb30['length'];_0xdba107+=0x1){_0x3e7c0e=_0x54bb30[_0xdba107][_0x7cc4('0x55')]({'plain':!![]});switch(_0x3e7c0e[_0x7cc4('0x52')]){case _0x7cc4('0x56'):_0x7fced6[_0x7cc4('0x2f')](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x14bd79(_0x3e7c0e,_0x7cc4('0x59')))['then'](function(){})['catch'](_0x320318()));break;case _0x7cc4('0x5a'):_0x7fced6['push'](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x129fbd(_0x3e7c0e,_0x7cc4('0x59')))[_0x7cc4('0x2e')](function(){})[_0x7cc4('0x31')](_0x320318()));break;default:_0x7fced6[_0x7cc4('0x2f')](db[_0x7cc4('0x57')]['query'](_0x2d2919(_0x3e7c0e,_0x7cc4('0x59')))['then'](function(){})[_0x7cc4('0x31')](_0x320318()));}}}return _0x7fced6;})[_0x7cc4('0x5b')]()[_0x7cc4('0x2e')](function(){return db[_0x7cc4('0x4f')][_0x7cc4('0x50')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x214a6d){var _0x4aa609=[];if(_0x214a6d){var _0x1c788d;for(var _0x5c11fc=0x0,_0x3f0ff2;_0x5c11fc<_0x214a6d[_0x7cc4('0x29')];_0x5c11fc+=0x1){_0x3f0ff2=_0x214a6d[_0x5c11fc][_0x7cc4('0x55')]({'plain':!![]});_0x4aa609['push'](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x2cdbfc(_0x3f0ff2,_0x7cc4('0x59')))['then'](function(){})[_0x7cc4('0x31')](_0x320318()));}}return _0x4aa609;})[_0x7cc4('0x5b')]();})[_0x7cc4('0x2e')](function(){return db[_0x7cc4('0x5c')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x7cc4('0x54'),'where':{'id':LISTID}}]})[_0x7cc4('0x2e')](function(_0x1766ce){var _0x20afb6=[];if(_0x1766ce){for(var _0x143895=0x0,_0x55a6a9;_0x143895<_0x1766ce[_0x7cc4('0x29')];_0x143895+=0x1){_0x55a6a9=_0x1766ce[_0x143895][_0x7cc4('0x55')]({'plain':!![]});switch(_0x55a6a9[_0x7cc4('0x52')]){case _0x7cc4('0x56'):_0x20afb6[_0x7cc4('0x2f')](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x14bd79(_0x55a6a9,'CampaignId'))['then'](function(){})[_0x7cc4('0x31')](_0x320318()));break;case _0x7cc4('0x5a'):_0x20afb6[_0x7cc4('0x2f')](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x129fbd(_0x55a6a9,_0x7cc4('0x5d')))[_0x7cc4('0x2e')](function(){})[_0x7cc4('0x31')](_0x320318()));break;default:_0x20afb6['push'](db[_0x7cc4('0x57')][_0x7cc4('0x58')](_0x2d2919(_0x55a6a9,_0x7cc4('0x5d')))[_0x7cc4('0x2e')](function(){})[_0x7cc4('0x31')](_0x320318()));}}}return _0x20afb6;})[_0x7cc4('0x5b')]();})[_0x7cc4('0x2e')](function(){return db[_0x7cc4('0x5c')][_0x7cc4('0x50')]({'attributes':['id'],'include':[{'model':db[_0x7cc4('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x7cc4('0x2e')](function(_0x1a27ca){var _0x266935=[];if(_0x1a27ca){for(var _0x516b19=0x0,_0x32dbfb;_0x516b19<_0x1a27ca[_0x7cc4('0x29')];_0x516b19+=0x1){_0x32dbfb=_0x1a27ca[_0x516b19][_0x7cc4('0x55')]({'plain':!![]});_0x266935[_0x7cc4('0x2f')](db[_0x7cc4('0x57')]['query'](_0x2cdbfc(_0x32dbfb,_0x7cc4('0x5d')))[_0x7cc4('0x2e')](function(){})[_0x7cc4('0x31')](_0x320318()));}}return _0x266935;})[_0x7cc4('0x5b')]();})['catch'](function(_0x3ea131){logger[_0x7cc4('0x19')]('cmContact,\x20%s,\x20%s',_0x7cc4('0x5e'),_0x3ea131[_0x7cc4('0x1d')]);});}var processPromises=function(_0x6f72a1){return BPromise['all'](promises)['then'](function(_0x4209cd){})['catch'](function(_0x254519){logger[_0x7cc4('0x19')](_0x7cc4('0x5f'),JSON[_0x7cc4('0x60')](_0x254519));})[_0x7cc4('0x61')](function(){socket[_0x7cc4('0x62')](_0x7cc4('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x6f72a1){return _0x6f72a1['resume']();}});};var endCsv=function(){return BPromise[_0x7cc4('0x64')]()[_0x7cc4('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x7cc4('0x2e')](function(){socket['emit'](_0x7cc4('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7cc4('0x65')](FILEPATH);}catch(_0x28f460){logger['error'](_0x7cc4('0x66'),JSON[_0x7cc4('0x60')](_0x28f460));}finally{process[_0x7cc4('0x67')](0x0);}});};process['on'](_0x7cc4('0x68'),function(){logger[_0x7cc4('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7cc4('0x14')](',');return db['CmContact'][_0x7cc4('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x58cc4a){var _0x228d9f=fs[_0x7cc4('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7cc4('0x6b')](_0x228d9f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4430a2,_0x4fcf25){total+=0x1;var _0x54020f=total;promises[_0x7cc4('0x2f')](checkRow(_0x4430a2,_0x58cc4a,_0x54020f)[_0x7cc4('0x2e')](function(){success+=0x1;})[_0x7cc4('0x31')](function(_0x5a4436){if(_0x5a4436[_0x7cc4('0x19')]){errors+=0x1;delete _0x5a4436[_0x7cc4('0x19')];}else if(_0x5a4436[_0x7cc4('0x6c')]){duplicates+=0x1;delete _0x5a4436[_0x7cc4('0x6c')];}rows[_0x7cc4('0x2f')](_0x5a4436);}));if(total%0xc8===0x0){_0x4fcf25['pause']();return processPromises(_0x4fcf25);}},'complete':function(){return processPromises()[_0x7cc4('0x2e')](function(){logger['info'](_0x7cc4('0x6d'));endCsv();});},'error':function(_0x5a6322,_0x1147a8){logger[_0x7cc4('0x69')](_0x7cc4('0x6e'),JSON[_0x7cc4('0x60')](_0x5a6322));endCsv();}});})[_0x7cc4('0x31')](function(_0xeadd9c){logger[_0x7cc4('0x19')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x7cc4('0x60')](_0xeadd9c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 25a02da..de18863 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 _0x9327=['cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','spread','catch','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','query','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','set','offset','main','stringify','send','clone','socket_timestamp','root','server/files/tmp','.csv','includes','ContactItemType','name','_description','AdditionalPhones','writeFileSync','parse','createReadStream','data','rows','trim','replace','isNaN','isNumber','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','isValid','\x20not\x20specified','hasOwnProperty','find','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','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','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues','campaigns','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','select','field','phone','from','join','where','CmContact','then','push','all','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','into','cm_hopper_black','fields','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','recallme','cm_contacts','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId'];(function(_0x12d732,_0x8130f0){var _0x102f24=function(_0x310594){while(--_0x310594){_0x12d732['push'](_0x12d732['shift']());}};_0x102f24(++_0x8130f0);}(_0x9327,0x69));var _0x7932=function(_0x551b48,_0x9ef988){_0x551b48=_0x551b48-0x0;var _0x1a2e34=_0x9327[_0x551b48];return _0x1a2e34;};'use strict';var fs=require('fs');var path=require(_0x7932('0x0'));var _=require(_0x7932('0x1'));var Papa=require('papaparse');var util=require(_0x7932('0x2'));var BPromise=require(_0x7932('0x3'));var moment=require(_0x7932('0x4'));var squel=require(_0x7932('0x5'));var Redis=require(_0x7932('0x6'));var db=require(_0x7932('0x7'))['db'];var config=require(_0x7932('0x8'));var shared=require(_0x7932('0x9'));var logger=require('../../../config/logger')(_0x7932('0xa'));config['redis']=_['defaults'](config[_0x7932('0xb')],{'host':_0x7932('0xc'),'port':0x18eb});var socket=require(_0x7932('0xd'))(new Redis(config[_0x7932('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x7932('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x7932('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1c368c){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'](_0x1c368c);}function selectNotIn(_0x5854c3,_0x15831d,_0x3993e6,_0x22b0f2,_0x2da65b){return squel[_0x7932('0x10')]()[_0x7932('0x11')](_0x7932('0x12'))[_0x7932('0x13')](_0x22b0f2)[_0x7932('0x14')](_0x15831d,null,_0x15831d+'.id\x20=\x20'+_0x22b0f2+'.'+_0x3993e6)[_0x7932('0x15')](_0x22b0f2+'.'+_0x3993e6+'\x20=\x20'+_0x5854c3+'.'+_0x3993e6)[_0x7932('0x15')](_0x15831d+'.dialCheckDuplicateType\x20IN\x20('+_0x2da65b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x24c392,_0x49d9f0){promisesAdditionalPhones=[];return db[_0x7932('0x16')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x7932('0x17')](function(_0x24df68){if(_0x24df68!==null){var _0x361fda=[];for(var _0x105ffd=0x0;_0x105ffd<_0x24df68['length'];_0x105ffd++){var _0x48c685=_0x24df68[_0x105ffd];_0x361fda[_0x7932('0x18')](insertAdditionalPhones(_0x48c685));}}Promise[_0x7932('0x19')](_0x361fda)[_0x7932('0x17')](function(){_0x24c392({'val':0x1});});});});}function insertAdditionalPhones(_0x1f81c1){return new Promise(function(_0x2b568b,_0x4772fa){var _0x2e23c2=_0x1f81c1['AdditionalPhones'];var _0x475651=_0x2e23c2[_0x7932('0x1a')](';');var _0x2cade5=[];orderBy=0x0;for(var _0x5135a6=0x0;_0x5135a6<_0x475651['length'];_0x5135a6++){_0x2cade5[_0x7932('0x18')](splitAdditionalPhone(_0x1f81c1['id'],_0x475651[_0x5135a6]));}Promise[_0x7932('0x19')](_0x2cade5)['then'](function(){_0x2b568b({'val':_0x475651['length']});});});}function splitAdditionalPhone(_0x4f93ae,_0x168823){return new Promise(function(_0x158b90,_0x510504){var _0x2cacc3=_0x168823[_0x7932('0x1a')](':');var _0x110d61=_0x2cacc3[0x0];var _0x3bcaea=_0x2cacc3[0x1];if(!_['isNil'](_0x3bcaea)){var _0x357c24=_0x3bcaea[_0x7932('0x1a')]('|');var _0x69241=[];for(var _0x1f43cd=0x0;_0x1f43cd<_0x357c24[_0x7932('0x1b')];_0x1f43cd++){if(_0x357c24[_0x1f43cd]!==''){var _0x181ff4=_[_0x7932('0x1c')](promisesAdditionalPhones,{'contactId':_0x4f93ae,'phone':_0x357c24[_0x1f43cd]});if(_0x181ff4[_0x7932('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x7932('0x18')]({'contactId':_0x4f93ae,'contactTypeId':_0x110d61,'phone':_0x357c24[_0x1f43cd],'orderBy':orderBy});}}}_0x158b90({'ok':0x1});}else _0x158b90({'res':0x0});});}function createAdditionalPhone(_0x3cfb18,_0x492abb,_0x23fc98,_0x296a3b){var _0x2a7a91='';var _0x18b274='';var _0x5c773d=_0x23fc98[_0x7932('0x1a')]('§');_0x2a7a91=_0x5c773d[0x0];if(_0x5c773d[_0x7932('0x1b')]==0x2)_0x18b274=_0x5c773d[0x1];return new Promise(function(_0xb9fb5b,_0x53425b){return db[_0x7932('0x1d')][_0x7932('0x1e')]({'where':{'CmContactId':_0x3cfb18,'item':_0x2a7a91}})[_0x7932('0x17')](function(_0x521609){if(_0x521609){return db[_0x7932('0x1d')][_0x7932('0x1f')]({'ItemTypeId':_0x492abb,'description':_0x18b274,'OrderBy':_0x296a3b},{'where':{'CmContactId':_0x3cfb18,'item':_0x2a7a91}})['then'](function(_0x30f556){_0xb9fb5b({'res':_0x7932('0x20')});});}else{return db[_0x7932('0x1d')][_0x7932('0x21')]({'CmContactId':_0x3cfb18,'item':_0x2a7a91,'description':_0x18b274,'ItemTypeId':_0x492abb,'OrderBy':_0x296a3b,'ItemClass':_0x7932('0x22')})[_0x7932('0x17')](function(_0x1420f4){_0xb9fb5b({'res':_0x7932('0x23')});});}});});}function insertCmHopper(_0x5d3b3a,_0x5db041,_0x89b7e1,_0x5e933c,_0x33d270){var _0x565a84=[_0x7932('0x24'),_0x7932('0x25'),'cm_contacts.id',_0x7932('0x26'),_0x5db041+'.'+_0x5e933c,_0x7932('0x27'),'cm_contacts.updatedAt',_0x7932('0x28'),_0x7932('0x29'),'\x22'+_0x33d270+'\x22'];return squel[_0x7932('0x2a')]()['into'](_0x7932('0x2b'))[_0x7932('0x2c')](['phone',_0x7932('0x2d'),_0x7932('0x2e'),_0x7932('0x2f'),_0x5e933c,_0x7932('0x30'),_0x7932('0x31'),_0x7932('0x32'),_0x7932('0x33'),'recallme'],squel[_0x7932('0x10')]()['fields'](_0x565a84)[_0x7932('0x13')](_0x5db041)[_0x7932('0x14')]('cm_contacts',null,_0x7932('0x34')+_0x5db041+_0x7932('0x35'))[_0x7932('0x14')](_0x89b7e1,null,_0x89b7e1+_0x7932('0x36')+_0x5db041+'.'+_0x5e933c)[_0x7932('0x15')](_0x5db041+'.CmListId\x20=\x20?',_0x5d3b3a)[_0x7932('0x15')](_0x7932('0x37'),NOW)[_0x7932('0x15')](_0x7932('0x38'),selectNotIn(_0x5db041,_0x89b7e1,_0x5e933c,_0x7932('0x2b'),[_0x7932('0x39'),_0x7932('0x3a')]))[_0x7932('0x15')](_0x7932('0x38'),selectNotIn(_0x5db041,_0x89b7e1,_0x5e933c,_0x7932('0x2b'),[_0x7932('0x39')])))[_0x7932('0x3b')]();}function insertCmHopperBlack(_0x4f9668,_0x31a65c,_0x3eb34f,_0x1ec448){var _0x1daaf9=[_0x7932('0x24'),'cm_contacts.id',_0x7932('0x26'),_0x31a65c+'.'+_0x1ec448,_0x7932('0x27'),_0x7932('0x3c')];return squel[_0x7932('0x2a')]()[_0x7932('0x3d')](_0x7932('0x3e'))[_0x7932('0x2c')](['phone',_0x7932('0x2e'),_0x7932('0x2f'),_0x1ec448,'createdAt','updatedAt'],squel[_0x7932('0x10')]()[_0x7932('0x3f')](_0x1daaf9)[_0x7932('0x13')](_0x31a65c)['join']('cm_contacts',null,_0x7932('0x34')+_0x31a65c+_0x7932('0x35'))[_0x7932('0x14')](_0x3eb34f,null,_0x3eb34f+_0x7932('0x36')+_0x31a65c+'.'+_0x1ec448)[_0x7932('0x15')](_0x31a65c+_0x7932('0x40'),_0x4f9668)[_0x7932('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7932('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7932('0x10')]()[_0x7932('0x11')](_0x7932('0x12'))[_0x7932('0x13')](_0x7932('0x3e'))['where'](_0x7932('0x41'),_0x4f9668)[_0x7932('0x15')](_0x1ec448+_0x7932('0x42')+_0x31a65c+'.'+_0x1ec448)))['toString']();}function insertTzCmHopper(_0x426258,_0x17acff,_0x4f840a,_0x175a22,_0x2918eb,_0x2f83b1){var _0x203659=[_0x7932('0x24'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2f83b1+_0x7932('0x43'),_0x7932('0x44'),_0x7932('0x26'),_0x17acff+'.'+_0x175a22,'cm_contacts.createdAt',_0x7932('0x3c'),'cm_contacts.priority',_0x7932('0x29'),'\x22'+_0x2918eb+'\x22'];var _0x5ee929=squel['insert']()[_0x7932('0x3d')](_0x7932('0x2b'))['fromQuery']([_0x7932('0x12'),_0x7932('0x2d'),'ContactId',_0x7932('0x2f'),_0x175a22,_0x7932('0x30'),_0x7932('0x31'),_0x7932('0x32'),_0x7932('0x33'),_0x7932('0x45')],squel['select']()[_0x7932('0x3f')](_0x203659)[_0x7932('0x13')](_0x17acff)[_0x7932('0x14')](_0x7932('0x46'),null,_0x7932('0x34')+_0x17acff+_0x7932('0x35'))[_0x7932('0x14')](_0x4f840a,null,_0x4f840a+_0x7932('0x36')+_0x17acff+'.'+_0x175a22)['join'](_0x2f83b1,null,_0x2f83b1+'.id\x20=\x20'+_0x17acff+'.'+_0x175a22)['where'](_0x17acff+_0x7932('0x40'),_0x426258)[_0x7932('0x15')](_0x7932('0x37'),NOW)[_0x7932('0x15')](_0x7932('0x38'),selectNotIn(_0x17acff,_0x4f840a,_0x175a22,'cm_hopper',[_0x7932('0x39'),_0x7932('0x3a')]))['where'](_0x7932('0x38'),selectNotIn(_0x17acff,_0x4f840a,_0x175a22,_0x7932('0x2b'),[_0x7932('0x39')])))[_0x7932('0x3b')]();return _0x5ee929;}function insertTzCmHopperBlack(_0x238d94,_0x840e4,_0x3d7db8,_0x4cf025){var _0x267511=[_0x7932('0x24'),'cm_contacts.id',_0x7932('0x26'),_0x840e4+'.'+_0x4cf025,_0x7932('0x27'),_0x7932('0x3c')];return squel[_0x7932('0x2a')]()[_0x7932('0x3d')]('cm_hopper_black')['fromQuery'](['phone',_0x7932('0x2e'),_0x7932('0x2f'),_0x4cf025,_0x7932('0x30'),_0x7932('0x31')],squel[_0x7932('0x10')]()[_0x7932('0x3f')](_0x267511)['from'](_0x840e4)[_0x7932('0x14')]('cm_contacts',null,_0x7932('0x34')+_0x840e4+_0x7932('0x35'))[_0x7932('0x14')](_0x3d7db8,null,_0x3d7db8+_0x7932('0x36')+_0x840e4+'.'+_0x4cf025)[_0x7932('0x15')](_0x840e4+_0x7932('0x40'),_0x238d94)[_0x7932('0x15')](_0x7932('0x37'),NOW)[_0x7932('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7932('0x10')]()[_0x7932('0x11')]('phone')[_0x7932('0x13')](_0x7932('0x3e'))[_0x7932('0x15')](_0x7932('0x41'),_0x238d94)['where'](_0x4cf025+_0x7932('0x42')+_0x840e4+'.'+_0x4cf025)))[_0x7932('0x3b')]();}function insertCmHopperAdditionalPhones(_0x4aebf3){var _0x5a540f=[_0x7932('0x47'),_0x7932('0x48'),_0x7932('0x49'),'cm_contact_has_items.createdAt',_0x7932('0x4a')];return squel[_0x7932('0x2a')]()[_0x7932('0x3d')](_0x7932('0x4b'))['fromQuery']([_0x7932('0x4c'),'phone',_0x7932('0x4d'),_0x7932('0x30'),'updatedAt'],squel[_0x7932('0x10')]()[_0x7932('0x3f')](_0x5a540f)[_0x7932('0x13')]('cm_hopper')[_0x7932('0x14')](_0x7932('0x46'),null,_0x7932('0x4e'))[_0x7932('0x14')](_0x7932('0x4f'),null,_0x7932('0x50'))[_0x7932('0x15')](_0x7932('0x51'),_0x4aebf3)[_0x7932('0x15')](_0x7932('0x37'),NOW))[_0x7932('0x3b')]();}function insertCmContact(_0x3842bb,_0x545e4a,_0x40bc6c,_0x824d62){var _0x532aac=_[_0x7932('0x52')](_[_0x7932('0x53')](_0x824d62),[_0x7932('0x2f'),'CompanyId',_0x7932('0x30'),'updatedAt','scheduledAt']);return squel[_0x7932('0x2a')]()[_0x7932('0x3d')](_0x7932('0x46'))['fromQuery'](_0x532aac,squel[_0x7932('0x10')]()['fields'](_0x532aac)[_0x7932('0x13')](_0x545e4a)['where']('('+_0x40bc6c[_0x7932('0x14')](',')+_0x7932('0x54'),squel[_0x7932('0x10')]()[_0x7932('0x3f')](_0x40bc6c)[_0x7932('0x13')](_0x7932('0x46'))[_0x7932('0x15')](_0x7932('0x41'),_0x3842bb)[_0x7932('0x15')](_0x7932('0x55')))[_0x7932('0x15')](_0x7932('0x56'),squel[_0x7932('0x10')]()['field'](_0x7932('0x57'),'min_id')[_0x7932('0x13')](_0x545e4a)[_0x7932('0x58')](_0x40bc6c[_0x7932('0x14')](','))))[_0x7932('0x3b')]();}function handleStop(){logger[_0x7932('0x59')](_0x7932('0x5a'));stopped=!![];}function handleUncaughtException(_0xc39832){logger[_0x7932('0x5b')](_0xc39832[_0x7932('0x5c')]);process[_0x7932('0x5d')](0x1);}function handleError(_0x5944ad,_0x4b7e30){stats['errors'][_0x7932('0x18')]({'name':_0x4b7e30['code'],'message':_0x4b7e30['message'],'row':_0x5944ad});}function handleQuery(_0x4722f6){logger[_0x7932('0x59')](_0x4722f6);return db['sequelize']['query'](_0x4722f6)[_0x7932('0x5e')](function(_0x55f715){results[_0x7932('0x18')](_0x55f715);})[_0x7932('0x5f')](function(_0x1aabec){logger[_0x7932('0x5b')](_0x1aabec[_0x7932('0x5c')]);});}function updateTzCampaigns(_0x326e4a){return new Promise(function(_0x24a491,_0xe2d11b){var _0x403a62=squel[_0x7932('0x10')]()[_0x7932('0x3f')]([_0x7932('0x60'),'campaigns.dialTimezone'])[_0x7932('0x13')]('campaigns')[_0x7932('0x14')](_0x7932('0x61'),null,_0x7932('0x62'))[_0x7932('0x15')]('campaigns_has_cm_lists.CmListId='+_0x326e4a);db[_0x7932('0x63')][_0x7932('0x64')](_0x403a62[_0x7932('0x3b')]())[_0x7932('0x5e')](function(_0x175bcc){var _0x434ee7=[];for(var _0x353723=0x0;_0x353723<_0x175bcc[_0x7932('0x1b')];_0x353723++){_0x434ee7[_0x7932('0x18')](getTimezoneData(_0x175bcc[_0x353723],tmp_campaigns));}BPromise[_0x7932('0x19')](_0x434ee7)['then'](function(){_0x24a491({'val':0x1});});})[_0x7932('0x5f')](function(_0x2d689b){logger['error'](_0x2d689b[_0x7932('0x5c')]);_0x24a491({'val':0x0});});});}function updateTzVoiceQueues(_0x2868a4){return new Promise(function(_0x1448c1,_0x55ce09){var _0x18c3cb=squel['select']()[_0x7932('0x3f')]([_0x7932('0x65'),_0x7932('0x66')])[_0x7932('0x13')]('voice_queues')[_0x7932('0x14')](_0x7932('0x67'),null,_0x7932('0x68'))[_0x7932('0x15')](_0x7932('0x69')+_0x2868a4);db[_0x7932('0x63')][_0x7932('0x64')](_0x18c3cb[_0x7932('0x3b')]())[_0x7932('0x5e')](function(_0x17d662){var _0x3e8a38=[];for(var _0x4242dd=0x0;_0x4242dd<_0x17d662[_0x7932('0x1b')];_0x4242dd++){_0x3e8a38['push'](getTimezoneData(_0x17d662[_0x4242dd],tmp_voice_queues));}BPromise[_0x7932('0x19')](_0x3e8a38)[_0x7932('0x17')](function(){_0x1448c1({'val':0x1});});})['catch'](function(_0x136fdd){logger[_0x7932('0x5b')](_0x136fdd[_0x7932('0x5c')]);_0x1448c1({'val':0x0});});});}function getTimezoneData(_0x35384b,_0x4baf53){return new Promise(function(_0x41cf06,_0x47cba9){var _0x17d532=shared[_0x7932('0x6a')];var _0x59b6fc=_0x17d532[_0x35384b[_0x7932('0x6b')]];if(_[_0x7932('0x6c')](_0x59b6fc)){_0x41cf06({'ret':0x1});}else{var _0xfba419=_0x59b6fc['utcOffset'];var _0x11e9e9=squel[_0x7932('0x2a')]()[_0x7932('0x3d')](_0x4baf53)[_0x7932('0x6d')]('id',_0x35384b['id'])[_0x7932('0x6d')](_0x7932('0x6e'),_0xfba419)['set']('dialTimezone',_0x35384b['dialTimezone'])[_0x7932('0x3b')]();return db[_0x7932('0x63')]['query'](_0x11e9e9)[_0x7932('0x5e')](function(_0x3a3920){_0x41cf06({'ret':0x1});})[_0x7932('0x5f')](function(_0x48910b){logger[_0x7932('0x5b')](_0x48910b[_0x7932('0x5c')]);_0x47cba9({'ret':0x1});});}});}function handleTZQuery(_0x38655e){logger[_0x7932('0x59')](_0x38655e);return db['sequelize']['query'](_0x38655e)[_0x7932('0x5e')](function(_0x2711c4){})[_0x7932('0x5f')](function(_0x4ecd34){logger[_0x7932('0x5b')](_0x4ecd34[_0x7932('0x5c')]);});}function main(_0x48a42c,_0x58cabe,_0x5ccbc2,_0x2417a5){logger[_0x7932('0x59')](_0x7932('0x6f'),_0x48a42c,JSON[_0x7932('0x70')](_0x58cabe));process[_0x7932('0x71')]('start');var _0x35d5ce=_0x58cabe['binding'];var _0xf2a8ca=_[_0x7932('0x72')](_0x35d5ce);var _0x2fc2af=_0x58cabe[_0x7932('0x73')];var _0x4826d6=path[_0x7932('0x14')](config[_0x7932('0x74')],_0x7932('0x75'),_0x2fc2af+_0x7932('0x76'));hasTZ=_[_0x7932('0x53')](_0x35d5ce)[_0x7932('0x77')](_0x7932('0x6b'));var _0x4eed92=_['keys'](_0x35d5ce)[_0x7932('0x14')]();logger['info']('header',_0x4eed92);db[_0x7932('0x78')]['findAll']({'raw':!![],'attributes':['id',_0x7932('0x79')]})['then'](function(_0x2c66d0){for(var _0x26a0cb=0x0;_0x26a0cb<_0x2c66d0[_0x7932('0x1b')];_0x26a0cb++){if(_0x2c66d0[_0x26a0cb][_0x7932('0x79')]in _0x35d5ce){contactItemTypes['push'](_0x2c66d0[_0x26a0cb]);delete _0xf2a8ca[_0x2c66d0[_0x26a0cb][_0x7932('0x79')]];hasAdditionalPhones=!![];}for(var _0x737ff0 in _0x35d5ce){if(_0x2c66d0[_0x26a0cb]['name']+_0x7932('0x7a')===_0x737ff0){phoneDescriptions[_0x7932('0x18')]({'itemTypeId':_0x2c66d0[_0x26a0cb]['id'],'description':_0x737ff0});delete _0xf2a8ca[_0x737ff0];}}}if(hasAdditionalPhones)_0xf2a8ca[_0x7932('0x7b')]='';var _0x19eaa1=_[_0x7932('0x53')](_0xf2a8ca)[_0x7932('0x14')]();logger[_0x7932('0x59')]('header',_0x19eaa1);fs[_0x7932('0x7c')](_0x4826d6,_0x19eaa1+'\x0a');Papa[_0x7932('0x7d')](fs[_0x7932('0x7e')](_0x48a42c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3d5510,_0x4b4e91){try{for(var _0x1d5272=0x0,_0x192117=[];_0x1d5272<_0x3d5510[_0x7932('0x7f')][_0x7932('0x1b')];_0x1d5272++){stats[_0x7932('0x80')]+=0x1;if(_0x3d5510['errors'][_0x1d5272]){handleError(_0x3d5510[_0x7932('0x7f')][_0x1d5272],_0x3d5510['errors'][_0x1d5272]);}else{var _0x1e2227=[];var _0x5ed022=[];var _0x456242={};for(var _0x2027e1 in _0x35d5ce){let _0xd1d830=contactItemTypes['find'](_0x26e93d=>_0x26e93d[_0x7932('0x79')]===_0x2027e1);let _0x29d9eb=contactItemTypes['find'](_0x5782da=>_0x5782da[_0x7932('0x79')]+_0x7932('0x7a')===_0x2027e1);if(_[_0x7932('0x6c')](_0xd1d830)&&_[_0x7932('0x6c')](_0x29d9eb)){if(_0x35d5ce['hasOwnProperty'](_0x2027e1)){if(_0x3d5510[_0x7932('0x7f')][_0x1d5272][_0x35d5ce[_0x2027e1]]){var _0x596851=_[_0x7932('0x81')](_0x3d5510[_0x7932('0x7f')][_0x1d5272][_0x35d5ce[_0x2027e1]][_0x7932('0x82')](/"/g,'\x27'));switch(_0x2027e1){case'scheduledat':var _0xd9028a=moment(_0x596851,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xd9028a['isValid']()){_0x192117[_0x7932('0x18')]('\x22'+_0x596851+'\x22');}else{_0x1e2227[_0x7932('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x7932('0x32'):var _0x4add0f=parseInt(_0x596851);_0x596851=_[_0x7932('0x83')](_0x4add0f)||_0x4add0f<0x0||_0x4add0f>0x4?_0x2417a5?0x3:0x2:_0x4add0f;_0x192117[_0x7932('0x18')]('\x22'+_0x596851+'\x22');break;case _0x7932('0x33'):var _0x5b0e1b=parseInt(_0x596851);if(_[_0x7932('0x84')](_0x5b0e1b)&&_[_0x7932('0x77')](_0x5ccbc2,_0x5b0e1b)){_0x192117['push']('\x22'+_0x5b0e1b+'\x22');}else{_0x1e2227['push'](_0x7932('0x85'));}break;case'email':if(isEmail(_0x596851)){_0x192117[_0x7932('0x18')]('\x22'+_0x596851+'\x22');}else{_0x1e2227[_0x7932('0x18')]('email\x20wrong\x20format');}break;case _0x7932('0x86'):var _0x5245bd=moment(_0x596851,_0x7932('0x87'),!![]);if(_0x5245bd[_0x7932('0x88')]()){_0x192117['push']('\x22'+_0x596851+'\x22');}else{_0x1e2227['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x927260=shared['timezones'];var _0xc7b7d0=_0x927260[_0x596851];if(!_[_0x7932('0x6c')](_0xc7b7d0)){var _0x152310=_0xc7b7d0['utcOffset'];_0x192117['push']('\x22'+_0x596851+'\x22');_0x192117[_0x7932('0x18')]('\x22'+_0x152310+'\x22');}break;default:_0x192117['push']('\x22'+_0x596851+'\x22');}}else{switch(_0x2027e1){case'firstName':case'phone':_0x1e2227['push'](_0x2027e1+_0x7932('0x89'));break;default:_0x192117[_0x7932('0x18')]('\x22\x22');}}}}else{var _0x4749ec='';if(!_['isNil'](_0xd1d830)){if(!_0x456242[_0x7932('0x8a')](_0xd1d830['id'])){if(!_[_0x7932('0x6c')](_0x3d5510[_0x7932('0x7f')][_0x1d5272][_0x35d5ce[_0x2027e1]])){var _0x596851=_['trim'](_0x3d5510[_0x7932('0x7f')][_0x1d5272][_0x35d5ce[_0x2027e1]][_0x7932('0x82')](/"/g,'\x27'));var _0x4a879b=phoneDescriptions[_0x7932('0x8b')](_0x4d7c23=>_0x4d7c23['itemTypeId']===_0xd1d830['id']);if(!_[_0x7932('0x6c')](_0x4a879b)){var _0x83fc05=_[_0x7932('0x81')](_0x3d5510[_0x7932('0x7f')][_0x1d5272][_0x35d5ce[_0x4a879b[_0x7932('0x8c')]]][_0x7932('0x82')](/"/g,'\x27'));if(!_[_0x7932('0x6c')](_0x83fc05))_0x596851=_0x596851+'§'+_0x83fc05;}if(_0x4749ec=='')_0x4749ec=_0x596851;else _0x4749ec+='|'+_0x596851;}_0x5ed022[_0x7932('0x18')](_0xd1d830['id']+':'+_0x4749ec);_0x456242[_0xd1d830['id']]=0x1;}}}}if(hasAdditionalPhones){_0x192117[_0x7932('0x18')]('\x22'+_0x5ed022['join'](';')+'\x22');}if(_0x1e2227['length']){handleError(_0x3d5510[_0x7932('0x7f')][_0x1d5272],{'code':_0x7932('0x8d'),'message':_0x1e2227[_0x7932('0x14')]()});}else{fs[_0x7932('0x8e')](_0x4826d6,_0x192117[_0x7932('0x14')]()+'\x0a');}_0x192117=[];}if(!(stats[_0x7932('0x80')]%0xc8)){socket[_0x7932('0x8f')]('contact:import:'+_0x2fc2af,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7932('0x90'));_0x4b4e91[_0x7932('0x91')]();}}catch(_0x4ba78d){handleError(_0x3d5510[_0x7932('0x7f')][_0x1d5272],{'code':'SystemError','message':_0x4ba78d[_0x7932('0x5c')]});logger['error'](_0x7932('0x92'),_0x4ba78d[_0x7932('0x5c')]);}},'complete':function(){try{var _0x45a681=[];var _0x1198dc=[];var _0x1ef4ed=_0x7932('0x46');if(_0x58cabe[_0x7932('0x93')]&&_0x58cabe[_0x7932('0x93')]['length']){_0x1ef4ed=_0x7932('0x94')+_0x2fc2af;_0x45a681[_0x7932('0x18')](_0x7932('0x95')+_0x1ef4ed+_0x7932('0x96'));}tmp_campaigns=_0x7932('0x97')+_0x2fc2af;tmp_voice_queues=_0x7932('0x98')+_0x2fc2af;_0x1198dc[_0x7932('0x18')](_0x7932('0x95')+tmp_campaigns+_0x7932('0x99'));_0x1198dc[_0x7932('0x18')](_0x7932('0x95')+tmp_voice_queues+_0x7932('0x99'));BPromise[_0x7932('0x9a')](_0x1198dc,handleTZQuery)[_0x7932('0x17')](function(_0x2f4270){updateTzCampaigns(_0x58cabe['ListId'])[_0x7932('0x17')](function(_0x3ee0e5){updateTzVoiceQueues(_0x58cabe[_0x7932('0x2f')])[_0x7932('0x17')](function(_0x15d7b4){if(hasTZ)_0x19eaa1=_0x19eaa1[_0x7932('0x82')](_0x7932('0x6b'),_0x7932('0x9b'));var _0x511257=util[_0x7932('0xf')](_0x7932('0x9c'),_0x4826d6,_0x1ef4ed,_0x19eaa1,_0x58cabe['ListId'],_0x58cabe['CompanyId']||null,NOW,NOW);if(_[_0x7932('0x6c')](_0x35d5ce[_0x7932('0x2d')])){_0x511257+=_0x7932('0x9d');}_0x45a681['push'](_0x511257);if(_0x58cabe[_0x7932('0x93')]&&_0x58cabe[_0x7932('0x93')][_0x7932('0x1b')]){_0x45a681['push'](insertCmContact(_0x58cabe[_0x7932('0x2f')],_0x1ef4ed,_0x58cabe[_0x7932('0x93')],_0x35d5ce));_0x45a681['push'](_0x7932('0x9e')+_0x1ef4ed+';');}BPromise[_0x7932('0x9a')](_0x45a681,handleQuery)[_0x7932('0x17')](function(_0x2fd75b){BPromise[_0x7932('0x19')]([handleAdditionalPhones()])[_0x7932('0x17')](function(){_0x45a681=[];for(var _0x3c2f92=0x0;_0x3c2f92\x20\x20','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','squel','ioredis','../../../mysqldb','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','then','length','AdditionalPhones','split','push','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper'];(function(_0x4a83f4,_0x50f589){var _0x1fc810=function(_0xc651f9){while(--_0xc651f9){_0x4a83f4['push'](_0x4a83f4['shift']());}};_0x1fc810(++_0x50f589);}(_0x4d23,0x1e1));var _0x34d2=function(_0x12ce37,_0x119c06){_0x12ce37=_0x12ce37-0x0;var _0x34452c=_0x4d23[_0x12ce37];return _0x34452c;};'use strict';var fs=require('fs');var path=require(_0x34d2('0x0'));var _=require(_0x34d2('0x1'));var Papa=require('papaparse');var util=require(_0x34d2('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x34d2('0x3'));var Redis=require(_0x34d2('0x4'));var db=require(_0x34d2('0x5'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x34d2('0x6'));config[_0x34d2('0x7')]=_[_0x34d2('0x8')](config[_0x34d2('0x7')],{'host':_0x34d2('0x9'),'port':0x18eb});var socket=require(_0x34d2('0xa'))(new Redis(config[_0x34d2('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x34d2('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x34d2('0xb'));function isEmail(_0x227108){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'](_0x227108);}function selectNotIn(_0x365358,_0x3ec214,_0x1eebb4,_0x2d1371,_0x5aeaa3){return squel[_0x34d2('0xc')]()[_0x34d2('0xd')](_0x34d2('0xe'))['from'](_0x2d1371)[_0x34d2('0xf')](_0x3ec214,null,_0x3ec214+_0x34d2('0x10')+_0x2d1371+'.'+_0x1eebb4)[_0x34d2('0x11')](_0x2d1371+'.'+_0x1eebb4+'\x20=\x20'+_0x365358+'.'+_0x1eebb4)['where'](_0x3ec214+_0x34d2('0x12')+_0x5aeaa3['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2b5c43,_0x31414b){promisesAdditionalPhones=[];return db[_0x34d2('0x13')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x34d2('0x14')](function(_0x79c07f){if(_0x79c07f!==null){var _0x900cce=[];for(var _0xf30f85=0x0;_0xf30f85<_0x79c07f[_0x34d2('0x15')];_0xf30f85++){var _0x43c5db=_0x79c07f[_0xf30f85];_0x900cce['push'](insertAdditionalPhones(_0x43c5db));}}Promise['all'](_0x900cce)[_0x34d2('0x14')](function(){_0x2b5c43({'val':0x1});});});});}function insertAdditionalPhones(_0x57c135){return new Promise(function(_0x44eea3,_0x423280){var _0x46ce0f=_0x57c135[_0x34d2('0x16')];var _0x503fe6=_0x46ce0f[_0x34d2('0x17')](';');var _0x1328df=[];orderBy=0x0;for(var _0x5ba5ea=0x0;_0x5ba5ea<_0x503fe6[_0x34d2('0x15')];_0x5ba5ea++){_0x1328df[_0x34d2('0x18')](splitAdditionalPhone(_0x57c135['id'],_0x503fe6[_0x5ba5ea]));}Promise['all'](_0x1328df)[_0x34d2('0x14')](function(){_0x44eea3({'val':_0x503fe6[_0x34d2('0x15')]});});});}function splitAdditionalPhone(_0x598f50,_0x5ec9bd){return new Promise(function(_0x1daee3,_0x48a494){var _0x52409b=_0x5ec9bd[_0x34d2('0x17')](':');var _0x3eefba=_0x52409b[0x0];var _0x5b3698=_0x52409b[0x1];if(!_[_0x34d2('0x19')](_0x5b3698)){var _0x3d1891=_0x5b3698[_0x34d2('0x17')]('|');var _0x1a7cd9=[];for(var _0x5aceb8=0x0;_0x5aceb8<_0x3d1891[_0x34d2('0x15')];_0x5aceb8++){if(_0x3d1891[_0x5aceb8]!==''){var _0x55fefc=_[_0x34d2('0x1a')](promisesAdditionalPhones,{'contactId':_0x598f50,'phone':_0x3d1891[_0x5aceb8]});if(_0x55fefc[_0x34d2('0x15')]==0x0){orderBy++;promisesAdditionalPhones[_0x34d2('0x18')]({'contactId':_0x598f50,'contactTypeId':_0x3eefba,'phone':_0x3d1891[_0x5aceb8],'orderBy':orderBy});}}}_0x1daee3({'ok':0x1});}else _0x1daee3({'res':0x0});});}function createAdditionalPhone(_0xfc2f5c,_0x4e1c6d,_0x66e1a5,_0x6566b8){var _0x46558a='';var _0x36a1b1='';var _0x6c7dc1=_0x66e1a5[_0x34d2('0x17')]('§');_0x46558a=_0x6c7dc1[0x0];if(_0x6c7dc1[_0x34d2('0x15')]==0x2)_0x36a1b1=_0x6c7dc1[0x1];return new Promise(function(_0x29c1ac,_0x45eacb){return db[_0x34d2('0x1b')][_0x34d2('0x1c')]({'where':{'CmContactId':_0xfc2f5c,'item':_0x46558a}})[_0x34d2('0x14')](function(_0x3dcbea){if(_0x3dcbea){return db[_0x34d2('0x1b')][_0x34d2('0x1d')]({'ItemTypeId':_0x4e1c6d,'description':_0x36a1b1,'OrderBy':_0x6566b8},{'where':{'CmContactId':_0xfc2f5c,'item':_0x46558a}})[_0x34d2('0x14')](function(_0x42c807){_0x29c1ac({'res':'updated'});});}else{return db[_0x34d2('0x1b')][_0x34d2('0x1e')]({'CmContactId':_0xfc2f5c,'item':_0x46558a,'description':_0x36a1b1,'ItemTypeId':_0x4e1c6d,'OrderBy':_0x6566b8,'ItemClass':_0x34d2('0x1f')})[_0x34d2('0x14')](function(_0x1365eb){_0x29c1ac({'res':'inserted'});});}});});}function insertCmHopper(_0x10baaf,_0x54908f,_0x463dcd,_0x653456,_0x1179db){var _0xe5c73d=[_0x34d2('0x20'),_0x34d2('0x21'),_0x34d2('0x22'),_0x34d2('0x23'),_0x54908f+'.'+_0x653456,_0x34d2('0x24'),_0x34d2('0x25'),_0x34d2('0x26'),_0x34d2('0x27'),'\x22'+_0x1179db+'\x22'];return squel['insert']()['into'](_0x34d2('0x28'))[_0x34d2('0x29')]([_0x34d2('0xe'),_0x34d2('0x2a'),_0x34d2('0x2b'),'ListId',_0x653456,_0x34d2('0x2c'),'updatedAt',_0x34d2('0x2d'),_0x34d2('0x2e'),'recallme'],squel['select']()[_0x34d2('0x2f')](_0xe5c73d)[_0x34d2('0x30')](_0x54908f)[_0x34d2('0xf')]('cm_contacts',null,_0x34d2('0x31')+_0x54908f+_0x34d2('0x32'))[_0x34d2('0xf')](_0x463dcd,null,_0x463dcd+_0x34d2('0x10')+_0x54908f+'.'+_0x653456)[_0x34d2('0x11')](_0x54908f+_0x34d2('0x33'),_0x10baaf)[_0x34d2('0x11')](_0x34d2('0x34'),NOW)['where'](_0x34d2('0x35'),selectNotIn(_0x54908f,_0x463dcd,_0x653456,_0x34d2('0x28'),[_0x34d2('0x36'),'\x22onlyIfOpen\x22']))['where'](_0x34d2('0x35'),selectNotIn(_0x54908f,_0x463dcd,_0x653456,'cm_hopper',[_0x34d2('0x36')])))[_0x34d2('0x37')]();}function insertCmHopperBlack(_0x3c5063,_0x47ed6c,_0x5189fc,_0x42180c){var _0x3edead=[_0x34d2('0x20'),'cm_contacts.id',_0x34d2('0x23'),_0x47ed6c+'.'+_0x42180c,_0x34d2('0x24'),_0x34d2('0x25')];return squel[_0x34d2('0x38')]()[_0x34d2('0x39')](_0x34d2('0x3a'))[_0x34d2('0x29')]([_0x34d2('0xe'),_0x34d2('0x2b'),'ListId',_0x42180c,_0x34d2('0x2c'),'updatedAt'],squel[_0x34d2('0xc')]()['fields'](_0x3edead)[_0x34d2('0x30')](_0x47ed6c)[_0x34d2('0xf')]('cm_contacts',null,_0x34d2('0x31')+_0x47ed6c+_0x34d2('0x32'))[_0x34d2('0xf')](_0x5189fc,null,_0x5189fc+'.id\x20=\x20'+_0x47ed6c+'.'+_0x42180c)[_0x34d2('0x11')](_0x47ed6c+'.CmListId\x20=\x20?',_0x3c5063)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x34d2('0x11')](_0x34d2('0x35'),squel[_0x34d2('0xc')]()[_0x34d2('0xd')](_0x34d2('0xe'))[_0x34d2('0x30')](_0x34d2('0x3a'))[_0x34d2('0x11')]('ListId\x20=\x20?',_0x3c5063)[_0x34d2('0x11')](_0x42180c+_0x34d2('0x3b')+_0x47ed6c+'.'+_0x42180c)))[_0x34d2('0x37')]();}function insertTzCmHopper(_0x1c89be,_0x5617a2,_0x442aaf,_0x3d9e45,_0x4af553,_0x3acd56){var _0x44c235=[_0x34d2('0x20'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x3acd56+_0x34d2('0x3c'),'cm_contacts.id','cm_contacts.ListId',_0x5617a2+'.'+_0x3d9e45,_0x34d2('0x24'),_0x34d2('0x25'),_0x34d2('0x26'),_0x34d2('0x27'),'\x22'+_0x4af553+'\x22'];var _0x3d3d66=squel[_0x34d2('0x38')]()['into'](_0x34d2('0x28'))['fromQuery']([_0x34d2('0xe'),_0x34d2('0x2a'),_0x34d2('0x2b'),'ListId',_0x3d9e45,'createdAt','updatedAt','priority',_0x34d2('0x2e'),_0x34d2('0x3d')],squel['select']()[_0x34d2('0x2f')](_0x44c235)['from'](_0x5617a2)['join'](_0x34d2('0x3e'),null,_0x34d2('0x31')+_0x5617a2+'.CmListId')['join'](_0x442aaf,null,_0x442aaf+'.id\x20=\x20'+_0x5617a2+'.'+_0x3d9e45)[_0x34d2('0xf')](_0x3acd56,null,_0x3acd56+_0x34d2('0x10')+_0x5617a2+'.'+_0x3d9e45)[_0x34d2('0x11')](_0x5617a2+'.CmListId\x20=\x20?',_0x1c89be)[_0x34d2('0x11')](_0x34d2('0x34'),NOW)['where'](_0x34d2('0x35'),selectNotIn(_0x5617a2,_0x442aaf,_0x3d9e45,_0x34d2('0x28'),[_0x34d2('0x36'),'\x22onlyIfOpen\x22']))[_0x34d2('0x11')](_0x34d2('0x35'),selectNotIn(_0x5617a2,_0x442aaf,_0x3d9e45,_0x34d2('0x28'),['\x22always\x22'])))['toString']();return _0x3d3d66;}function insertTzCmHopperBlack(_0x37185f,_0xa3a18a,_0x317702,_0x28e657){var _0x4812e7=[_0x34d2('0x20'),_0x34d2('0x22'),_0x34d2('0x23'),_0xa3a18a+'.'+_0x28e657,_0x34d2('0x24'),_0x34d2('0x25')];return squel['insert']()[_0x34d2('0x39')](_0x34d2('0x3a'))[_0x34d2('0x29')]([_0x34d2('0xe'),_0x34d2('0x2b'),_0x34d2('0x3f'),_0x28e657,_0x34d2('0x2c'),_0x34d2('0x40')],squel[_0x34d2('0xc')]()['fields'](_0x4812e7)['from'](_0xa3a18a)[_0x34d2('0xf')](_0x34d2('0x3e'),null,_0x34d2('0x31')+_0xa3a18a+_0x34d2('0x32'))[_0x34d2('0xf')](_0x317702,null,_0x317702+_0x34d2('0x10')+_0xa3a18a+'.'+_0x28e657)['where'](_0xa3a18a+'.CmListId\x20=\x20?',_0x37185f)['where'](_0x34d2('0x34'),NOW)['where'](_0x34d2('0x35'),squel[_0x34d2('0xc')]()[_0x34d2('0xd')](_0x34d2('0xe'))[_0x34d2('0x30')](_0x34d2('0x3a'))['where'](_0x34d2('0x41'),_0x37185f)[_0x34d2('0x11')](_0x28e657+_0x34d2('0x3b')+_0xa3a18a+'.'+_0x28e657)))[_0x34d2('0x37')]();}function insertCmHopperAdditionalPhones(_0x582230){var _0x6e08a9=[_0x34d2('0x42'),_0x34d2('0x43'),_0x34d2('0x44'),'cm_contact_has_items.createdAt',_0x34d2('0x45')];return squel[_0x34d2('0x38')]()['into'](_0x34d2('0x46'))[_0x34d2('0x29')](['CmHopperId',_0x34d2('0xe'),'OrderBy','createdAt',_0x34d2('0x40')],squel[_0x34d2('0xc')]()[_0x34d2('0x2f')](_0x6e08a9)[_0x34d2('0x30')]('cm_hopper')['join'](_0x34d2('0x3e'),null,_0x34d2('0x47'))[_0x34d2('0xf')](_0x34d2('0x48'),null,_0x34d2('0x49'))[_0x34d2('0x11')](_0x34d2('0x4a'),_0x582230)[_0x34d2('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x34d2('0x37')]();}function insertCmContact(_0x5af47d,_0x4b7c08,_0x283b60,_0x2d7074){var _0x4697ee=_[_0x34d2('0x4b')](_[_0x34d2('0x4c')](_0x2d7074),['ListId',_0x34d2('0x4d'),'createdAt',_0x34d2('0x40'),_0x34d2('0x4e')]);return squel['insert']()[_0x34d2('0x39')]('cm_contacts')['fromQuery'](_0x4697ee,squel[_0x34d2('0xc')]()[_0x34d2('0x2f')](_0x4697ee)[_0x34d2('0x30')](_0x4b7c08)[_0x34d2('0x11')]('('+_0x283b60[_0x34d2('0xf')](',')+_0x34d2('0x4f'),squel[_0x34d2('0xc')]()[_0x34d2('0x2f')](_0x283b60)[_0x34d2('0x30')](_0x34d2('0x3e'))[_0x34d2('0x11')](_0x34d2('0x41'),_0x5af47d)['where']('deletedAt\x20IS\x20NULL'))[_0x34d2('0x11')](_0x34d2('0x50'),squel[_0x34d2('0xc')]()[_0x34d2('0xd')]('MIN(id)','min_id')[_0x34d2('0x30')](_0x4b7c08)['group'](_0x283b60['join'](','))))['toString']();}function handleStop(){logger['info'](_0x34d2('0x51'));stopped=!![];}function handleUncaughtException(_0x251e29){logger[_0x34d2('0x52')](_0x251e29[_0x34d2('0x53')]);process[_0x34d2('0x54')](0x1);}function handleError(_0x4f6c05,_0x298432){stats['errors'][_0x34d2('0x18')]({'name':_0x298432[_0x34d2('0x55')],'message':_0x298432['message'],'row':_0x4f6c05});}function handleQuery(_0x554217){logger['info'](_0x554217);return db['sequelize'][_0x34d2('0x56')](_0x554217)['spread'](function(_0x491fc5){results[_0x34d2('0x18')](_0x491fc5);})[_0x34d2('0x57')](function(_0x3ae9e3){logger['error'](_0x3ae9e3[_0x34d2('0x53')]);});}function updateTzCampaigns(_0x61778e){return new Promise(function(_0x1aa370,_0x4bc32a){var _0x1c0676=squel['select']()[_0x34d2('0x2f')]([_0x34d2('0x58'),'campaigns.dialTimezone'])[_0x34d2('0x30')]('campaigns')[_0x34d2('0xf')](_0x34d2('0x59'),null,_0x34d2('0x5a'))[_0x34d2('0x11')](_0x34d2('0x5b')+_0x61778e);db[_0x34d2('0x5c')][_0x34d2('0x56')](_0x1c0676['toString']())['spread'](function(_0x3ab444){var _0x3bd3cc=[];for(var _0x544598=0x0;_0x544598<_0x3ab444[_0x34d2('0x15')];_0x544598++){_0x3bd3cc[_0x34d2('0x18')](getTimezoneData(_0x3ab444[_0x544598],tmp_campaigns));}BPromise[_0x34d2('0x5d')](_0x3bd3cc)[_0x34d2('0x14')](function(){_0x1aa370({'val':0x1});});})['catch'](function(_0x14ea54){logger['error'](_0x14ea54[_0x34d2('0x53')]);_0x1aa370({'val':0x0});});});}function updateTzVoiceQueues(_0x1b2eda){return new Promise(function(_0x9ee51,_0x48807c){var _0x4bf44a=squel['select']()[_0x34d2('0x2f')](['voice_queues.id',_0x34d2('0x5e')])[_0x34d2('0x30')](_0x34d2('0x5f'))[_0x34d2('0xf')](_0x34d2('0x60'),null,_0x34d2('0x61'))['where']('voice_queues_has_cm_lists.CmListId='+_0x1b2eda);db['sequelize'][_0x34d2('0x56')](_0x4bf44a[_0x34d2('0x37')]())[_0x34d2('0x62')](function(_0x5387a5){var _0x569815=[];for(var _0x187ee9=0x0;_0x187ee9<_0x5387a5['length'];_0x187ee9++){_0x569815[_0x34d2('0x18')](getTimezoneData(_0x5387a5[_0x187ee9],tmp_voice_queues));}BPromise[_0x34d2('0x5d')](_0x569815)[_0x34d2('0x14')](function(){_0x9ee51({'val':0x1});});})[_0x34d2('0x57')](function(_0x96e5a){logger[_0x34d2('0x52')](_0x96e5a[_0x34d2('0x53')]);_0x9ee51({'val':0x0});});});}function getTimezoneData(_0x1ed92a,_0x33e7a3){return new Promise(function(_0x2892e6,_0x150f87){var _0x5567f1=shared['timezones'];var _0x45d1d3=_0x5567f1[_0x1ed92a[_0x34d2('0x63')]];if(_['isNil'](_0x45d1d3)){_0x2892e6({'ret':0x1});}else{var _0x2cba59=_0x45d1d3[_0x34d2('0x64')];var _0x39fb18=squel[_0x34d2('0x38')]()[_0x34d2('0x39')](_0x33e7a3)['set']('id',_0x1ed92a['id'])[_0x34d2('0x65')](_0x34d2('0x66'),_0x2cba59)[_0x34d2('0x65')](_0x34d2('0x63'),_0x1ed92a[_0x34d2('0x63')])[_0x34d2('0x37')]();return db[_0x34d2('0x5c')][_0x34d2('0x56')](_0x39fb18)[_0x34d2('0x62')](function(_0x48aaa9){_0x2892e6({'ret':0x1});})[_0x34d2('0x57')](function(_0x2c6fad){logger[_0x34d2('0x52')](_0x2c6fad[_0x34d2('0x53')]);_0x150f87({'ret':0x1});});}});}function handleTZQuery(_0x3d272d){logger[_0x34d2('0x67')](_0x3d272d);return db[_0x34d2('0x5c')][_0x34d2('0x56')](_0x3d272d)[_0x34d2('0x62')](function(_0x2c3e3e){})[_0x34d2('0x57')](function(_0x53b990){logger['error'](_0x53b990[_0x34d2('0x53')]);});}function main(_0x5f5a5f,_0x58b512,_0x43b69b,_0x225e02){logger['info'](_0x34d2('0x68'),_0x5f5a5f,JSON[_0x34d2('0x69')](_0x58b512));process[_0x34d2('0x6a')](_0x34d2('0x6b'));var _0x45767d=_0x58b512[_0x34d2('0x6c')];var _0x43e303=_['clone'](_0x45767d);var _0x316481=_0x58b512[_0x34d2('0x6d')];var _0x2b91dc=path[_0x34d2('0xf')](config[_0x34d2('0x6e')],_0x34d2('0x6f'),_0x316481+'.csv');hasTZ=_[_0x34d2('0x4c')](_0x45767d)[_0x34d2('0x70')](_0x34d2('0x63'));var _0x18a239=_[_0x34d2('0x4c')](_0x45767d)[_0x34d2('0xf')]();logger[_0x34d2('0x67')](_0x34d2('0x71'),_0x18a239);db[_0x34d2('0x72')][_0x34d2('0x73')]({'raw':!![],'attributes':['id',_0x34d2('0x74')]})[_0x34d2('0x14')](function(_0x3752cd){for(var _0x5f07fd=0x0;_0x5f07fd<_0x3752cd['length'];_0x5f07fd++){if(_0x3752cd[_0x5f07fd]['name']in _0x45767d){contactItemTypes[_0x34d2('0x18')](_0x3752cd[_0x5f07fd]);delete _0x43e303[_0x3752cd[_0x5f07fd][_0x34d2('0x74')]];hasAdditionalPhones=!![];}for(var _0x5ee552 in _0x45767d){if(_0x3752cd[_0x5f07fd][_0x34d2('0x74')]+_0x34d2('0x75')===_0x5ee552){phoneDescriptions[_0x34d2('0x18')]({'itemTypeId':_0x3752cd[_0x5f07fd]['id'],'description':_0x5ee552});delete _0x43e303[_0x5ee552];}}}if(hasAdditionalPhones)_0x43e303['AdditionalPhones']='';var _0x59597c=_[_0x34d2('0x4c')](_0x43e303)[_0x34d2('0xf')]();logger[_0x34d2('0x67')]('header',_0x59597c);fs[_0x34d2('0x76')](_0x2b91dc,_0x59597c+'\x0a');Papa[_0x34d2('0x77')](fs[_0x34d2('0x78')](_0x5f5a5f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x29e525,_0x2eb84c){try{for(var _0xae6849=0x0,_0x349951=[];_0xae6849<_0x29e525[_0x34d2('0x79')][_0x34d2('0x15')];_0xae6849++){stats[_0x34d2('0x7a')]+=0x1;if(_0x29e525[_0x34d2('0x7b')][_0xae6849]){handleError(_0x29e525[_0x34d2('0x79')][_0xae6849],_0x29e525['errors'][_0xae6849]);}else{var _0x25b646=[];var _0x5ad694=[];var _0x4246b3={};for(var _0x3fe518 in _0x45767d){let _0x33ec2a=contactItemTypes['find'](_0x43cbe4=>_0x43cbe4[_0x34d2('0x74')]===_0x3fe518);let _0x4c6c83=contactItemTypes['find'](_0x367c1f=>_0x367c1f['name']+'_description'===_0x3fe518);if(_[_0x34d2('0x19')](_0x33ec2a)&&_[_0x34d2('0x19')](_0x4c6c83)){if(_0x45767d['hasOwnProperty'](_0x3fe518)){if(_0x29e525[_0x34d2('0x79')][_0xae6849][_0x45767d[_0x3fe518]]){var _0x3f6fd9=_[_0x34d2('0x7c')](_0x29e525[_0x34d2('0x79')][_0xae6849][_0x45767d[_0x3fe518]][_0x34d2('0x7d')](/"/g,'\x27'));switch(_0x3fe518){case'scheduledat':var _0xbd4a6b=moment(_0x3f6fd9,_0x34d2('0xb'),!![]);if(_0xbd4a6b[_0x34d2('0x7e')]()){_0x349951[_0x34d2('0x18')]('\x22'+_0x3f6fd9+'\x22');}else{_0x25b646[_0x34d2('0x18')](_0x34d2('0x7f'));}break;case'priority':var _0x20fcb4=parseInt(_0x3f6fd9);_0x3f6fd9=_[_0x34d2('0x80')](_0x20fcb4)||_0x20fcb4<0x0||_0x20fcb4>0x4?_0x225e02?0x3:0x2:_0x20fcb4;_0x349951[_0x34d2('0x18')]('\x22'+_0x3f6fd9+'\x22');break;case _0x34d2('0x2e'):var _0x33a7e7=parseInt(_0x3f6fd9);if(_[_0x34d2('0x81')](_0x33a7e7)&&_['includes'](_0x43b69b,_0x33a7e7)){_0x349951[_0x34d2('0x18')]('\x22'+_0x33a7e7+'\x22');}else{_0x25b646[_0x34d2('0x18')]('agent\x20not\x20exists');}break;case _0x34d2('0x82'):if(isEmail(_0x3f6fd9)){_0x349951['push']('\x22'+_0x3f6fd9+'\x22');}else{_0x25b646[_0x34d2('0x18')](_0x34d2('0x83'));}break;case'dateOfBirth':var _0x5cd6cd=moment(_0x3f6fd9,_0x34d2('0x84'),!![]);if(_0x5cd6cd[_0x34d2('0x7e')]()){_0x349951[_0x34d2('0x18')]('\x22'+_0x3f6fd9+'\x22');}else{_0x25b646[_0x34d2('0x18')](_0x34d2('0x85'));}break;case _0x34d2('0x63'):var _0x5eaee5=shared[_0x34d2('0x86')];var _0x267e71=_0x5eaee5[_0x3f6fd9];if(!_['isNil'](_0x267e71)){var _0x5b00e0=_0x267e71[_0x34d2('0x64')];_0x349951[_0x34d2('0x18')]('\x22'+_0x3f6fd9+'\x22');_0x349951[_0x34d2('0x18')]('\x22'+_0x5b00e0+'\x22');}break;default:_0x349951[_0x34d2('0x18')]('\x22'+_0x3f6fd9+'\x22');}}else{switch(_0x3fe518){case _0x34d2('0x87'):case'phone':_0x25b646[_0x34d2('0x18')](_0x3fe518+_0x34d2('0x88'));break;default:_0x349951['push']('\x22\x22');}}}}else{var _0x487545='';if(!_[_0x34d2('0x19')](_0x33ec2a)){if(!_0x4246b3[_0x34d2('0x89')](_0x33ec2a['id'])){if(!_[_0x34d2('0x19')](_0x29e525['data'][_0xae6849][_0x45767d[_0x3fe518]])){var _0x3f6fd9=_[_0x34d2('0x7c')](_0x29e525['data'][_0xae6849][_0x45767d[_0x3fe518]][_0x34d2('0x7d')](/"/g,'\x27'));var _0x28824b=phoneDescriptions['find'](_0x583284=>_0x583284['itemTypeId']===_0x33ec2a['id']);if(!_['isNil'](_0x28824b)){var _0x289e30=_['trim'](_0x29e525[_0x34d2('0x79')][_0xae6849][_0x45767d[_0x28824b['description']]][_0x34d2('0x7d')](/"/g,'\x27'));if(!_['isNil'](_0x289e30))_0x3f6fd9=_0x3f6fd9+'§'+_0x289e30;}if(_0x487545=='')_0x487545=_0x3f6fd9;else _0x487545+='|'+_0x3f6fd9;}_0x5ad694['push'](_0x33ec2a['id']+':'+_0x487545);_0x4246b3[_0x33ec2a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x349951[_0x34d2('0x18')]('\x22'+_0x5ad694[_0x34d2('0xf')](';')+'\x22');}if(_0x25b646[_0x34d2('0x15')]){handleError(_0x29e525[_0x34d2('0x79')][_0xae6849],{'code':_0x34d2('0x8a'),'message':_0x25b646[_0x34d2('0xf')]()});}else{fs[_0x34d2('0x8b')](_0x2b91dc,_0x349951[_0x34d2('0xf')]()+'\x0a');}_0x349951=[];}if(!(stats[_0x34d2('0x7a')]%0xc8)){socket[_0x34d2('0x8c')](_0x34d2('0x8d')+_0x316481,stats);stats['errors']=[];}}if(stopped){logger[_0x34d2('0x67')](_0x34d2('0x8e'));_0x2eb84c[_0x34d2('0x8f')]();}}catch(_0x1acaac){handleError(_0x29e525[_0x34d2('0x79')][_0xae6849],{'code':_0x34d2('0x90'),'message':_0x1acaac[_0x34d2('0x53')]});logger[_0x34d2('0x52')](_0x34d2('0x91'),_0x1acaac['message']);}},'complete':function(){try{var _0x5654e8=[];var _0x647ef2=[];var _0x4f17ba=_0x34d2('0x3e');if(_0x58b512[_0x34d2('0x92')]&&_0x58b512['duplicates'][_0x34d2('0x15')]){_0x4f17ba='cm_contacts_'+_0x316481;_0x5654e8[_0x34d2('0x18')](_0x34d2('0x93')+_0x4f17ba+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x34d2('0x94')+_0x316481;tmp_voice_queues='voice_queues_'+_0x316481;_0x647ef2[_0x34d2('0x18')](_0x34d2('0x93')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x647ef2[_0x34d2('0x18')](_0x34d2('0x93')+tmp_voice_queues+_0x34d2('0x95'));BPromise[_0x34d2('0x96')](_0x647ef2,handleTZQuery)['then'](function(_0x46ce6a){updateTzCampaigns(_0x58b512[_0x34d2('0x3f')])[_0x34d2('0x14')](function(_0x431559){updateTzVoiceQueues(_0x58b512[_0x34d2('0x3f')])['then'](function(_0x467023){if(hasTZ)_0x59597c=_0x59597c['replace'](_0x34d2('0x63'),_0x34d2('0x97'));var _0xdb0272=util['format'](_0x34d2('0x98'),_0x2b91dc,_0x4f17ba,_0x59597c,_0x58b512[_0x34d2('0x3f')],_0x58b512['CompanyId']||null,NOW,NOW);if(_[_0x34d2('0x19')](_0x45767d[_0x34d2('0x2a')])){_0xdb0272+=_0x34d2('0x99');}_0x5654e8['push'](_0xdb0272);if(_0x58b512[_0x34d2('0x92')]&&_0x58b512['duplicates'][_0x34d2('0x15')]){_0x5654e8[_0x34d2('0x18')](insertCmContact(_0x58b512[_0x34d2('0x3f')],_0x4f17ba,_0x58b512[_0x34d2('0x92')],_0x45767d));_0x5654e8['push'](_0x34d2('0x9a')+_0x4f17ba+';');}BPromise[_0x34d2('0x96')](_0x5654e8,handleQuery)[_0x34d2('0x14')](function(_0x1d57d0){BPromise[_0x34d2('0x5d')]([handleAdditionalPhones()])[_0x34d2('0x14')](function(){_0x5654e8=[];for(var _0x5090a6=0x0;_0x5090a6_0x1f67b8[_0x06e9('0x66')]===_0x1a7681);let _0x33fe93=contactItemTypes['find'](_0x435dd8=>_0x435dd8['name']+'_description'===_0x1a7681);if(_[_0x06e9('0x1c')](_0xbb4cec)&&_['isNil'](_0x33fe93)){if(_0x2cf1fa[_0x06e9('0x6f')](_0x1a7681)){if(_0x3afdff[_0x06e9('0x6d')][_0x463268][_0x2cf1fa[_0x1a7681]]){var _0x2200e4=_[_0x06e9('0x70')](_0x3afdff[_0x06e9('0x6d')][_0x463268][_0x2cf1fa[_0x1a7681]][_0x06e9('0x71')](/"/g,'\x27'));switch(_0x1a7681){case _0x06e9('0x33'):var _0xddf80c=moment(_0x2200e4,_0x06e9('0xd'),!![]);if(_0xddf80c['isValid']()){_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x2200e4+'\x22');}else{_0x396a2d[_0x06e9('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x06e9('0x36'):var _0x457508=parseInt(_0x2200e4);_0x2200e4=_[_0x06e9('0x72')](_0x457508)||_0x457508<0x0||_0x457508>0x4?_0x4d475d?0x3:0x2:_0x457508;_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x2200e4+'\x22');break;case _0x06e9('0x73'):var _0x58becd=parseInt(_0x2200e4);if(_['isNumber'](_0x58becd)&&_['includes'](_0x2a2605,_0x58becd)){_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x58becd+'\x22');}else{_0x396a2d[_0x06e9('0x1e')](_0x06e9('0x74'));}break;case _0x06e9('0x75'):if(isEmail(_0x2200e4)){_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x2200e4+'\x22');}else{_0x396a2d[_0x06e9('0x1e')]('email\x20wrong\x20format');}break;case _0x06e9('0x76'):var _0x386cd3=moment(_0x2200e4,'YYYY-MM-DD',!![]);if(_0x386cd3[_0x06e9('0x77')]()){_0x2f319b['push']('\x22'+_0x2200e4+'\x22');}else{_0x396a2d[_0x06e9('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x2200e4+'\x22');}}else{switch(_0x1a7681){case'firstName':case _0x06e9('0x12'):_0x396a2d[_0x06e9('0x1e')](_0x1a7681+_0x06e9('0x78'));break;default:_0x2f319b['push']('\x22\x22');}}}}else{var _0x3184d4='';if(!_[_0x06e9('0x1c')](_0xbb4cec)){if(!_0x3d3aca[_0x06e9('0x6f')](_0xbb4cec['id'])){for(var _0x426e2a=0x0;_0x426e2a<_0x2cf1fa[_0x1a7681]['length'];_0x426e2a++){var _0x2200e4=_[_0x06e9('0x70')](_0x3afdff['data'][_0x463268][_0x2cf1fa[_0x1a7681][_0x426e2a]][_0x06e9('0x71')](/"/g,'\x27'));var _0x296cbf=phoneDescriptions[_0x06e9('0x79')](_0x4a0983=>_0x4a0983[_0x06e9('0x7a')]===_0xbb4cec['id']);if(!_['isNil'](_0x296cbf)){var _0x10b752=_[_0x06e9('0x70')](_0x3afdff[_0x06e9('0x6d')][_0x463268][_0x2cf1fa[_0x296cbf[_0x06e9('0x7b')]][0x0]][_0x06e9('0x71')](/"/g,'\x27'));if(!_[_0x06e9('0x1c')](_0x10b752))_0x2200e4=_0x2200e4+'§'+_0x10b752;}if(_0x3184d4=='')_0x3184d4=_0x2200e4;else _0x3184d4+='|'+_0x2200e4;}_0x35273f[_0x06e9('0x1e')](_0xbb4cec['id']+':'+_0x3184d4);_0x3d3aca[_0xbb4cec['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2f319b[_0x06e9('0x1e')]('\x22'+_0x35273f['join'](';')+'\x22');}if(_0x396a2d[_0x06e9('0x25')]){handleError(_0x3afdff[_0x06e9('0x6d')][_0x463268],{'code':_0x06e9('0x7c'),'message':_0x396a2d[_0x06e9('0x14')]()});}else{fs[_0x06e9('0x7d')](_0x14ed00,_0x2f319b[_0x06e9('0x14')]()+'\x0a');}_0x2f319b=[];}if(!(stats[_0x06e9('0x7e')]%0xc8)){socket[_0x06e9('0x7f')](_0x06e9('0x80')+_0x1e18a5,stats);stats[_0x06e9('0x6e')]=[];}}if(stopped){logger[_0x06e9('0x58')](_0x06e9('0x81'));_0x16a3df[_0x06e9('0x82')]();}}catch(_0x1b4c42){handleError(_0x3afdff['data'][_0x463268],{'code':'SystemError','message':_0x1b4c42[_0x06e9('0x22')]});logger['error'](_0x06e9('0x83'),_0x1b4c42[_0x06e9('0x22')]);}},'complete':function(){try{var _0x5d4aaa=[];var _0x5847b3=tempTableName;_0x5d4aaa[_0x06e9('0x1e')](_0x06e9('0x84')+_0x5847b3+'\x20LIKE\x20cm_contacts;');logger[_0x06e9('0x58')](_0x06e9('0x85'),contactItemTypes['length']);var _0x5a3d13=util[_0x06e9('0xc')](_0x06e9('0x86'),_0x14ed00,_0x5847b3,_0x439a46,_0x2a232c['ListId'],_0x2a232c[_0x06e9('0x87')]||null,NOW,NOW);if(_[_0x06e9('0x1c')](_0x2cf1fa[_0x06e9('0x33')])){_0x5a3d13+=_0x06e9('0x88');}_0x5d4aaa[_0x06e9('0x1e')](_0x5a3d13);BPromise[_0x06e9('0x89')](_0x5d4aaa,handleQuery)['then'](function(_0x2d2656){BPromise[_0x06e9('0x1f')]([handleAdditionalPhones()])[_0x06e9('0x20')](function(){_0x5d4aaa=[];for(var _0x36434e=0x0;_0x36434e\x20\x20');}var _0x5ac6a3=path['join'](config[_0x06e9('0x61')],'server/files/tmp',process[_0x06e9('0x93')][0x2]);if(!fs[_0x06e9('0x94')](_0x5ac6a3)){throw new Error(_0x06e9('0x95'));}var _0x204236={};try{_0x204236=JSON[_0x06e9('0x6b')](process['argv'][0x3]);if(!_0x204236[_0x06e9('0x5e')]){throw new Error(_0x06e9('0x96'));}var _0x267f28=0x0;if(_0x204236[_0x06e9('0x5e')][_0x06e9('0x73')]){_0x267f28=0x1;}if(!_0x204236['ListId']){throw new Error(_0x06e9('0x97'));}}catch(_0x2e37ad){throw new Error(_0x06e9('0x98'));}var _0x5385e9=[];try{_0x5385e9=_[_0x06e9('0x99')](JSON[_0x06e9('0x6b')](process[_0x06e9('0x93')][0x4]),'id');}catch(_0x49226c){logger[_0x06e9('0x58')](_0x06e9('0x9a'));}main(_0x5ac6a3,_0x204236,_0x5385e9,_0x267f28);}validate();process['on'](_0x06e9('0x9b'),handleStop);process['on'](_0x06e9('0x9c'),handleUncaughtException); \ No newline at end of file +var _0x6124=['parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','error','message','split','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','join','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','createdAt','ListId\x20=\x20?','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','Received\x20SIGINT','exit','errors','code','info','catch','stringify','binding','clone','socket_timestamp','ContactItemType','findAll','name','_description','header','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists'];(function(_0xe68b36,_0x5dbd53){var _0x555e0d=function(_0x4df32e){while(--_0x4df32e){_0xe68b36['push'](_0xe68b36['shift']());}};_0x555e0d(++_0x5dbd53);}(_0x6124,0x140));var _0x4612=function(_0x4b8046,_0x17ec74){_0x4b8046=_0x4b8046-0x0;var _0x4e81d2=_0x6124[_0x4b8046];return _0x4e81d2;};'use strict';var fs=require('fs');var path=require(_0x4612('0x0'));var _=require(_0x4612('0x1'));var Papa=require(_0x4612('0x2'));var util=require('util');var BPromise=require(_0x4612('0x3'));var moment=require(_0x4612('0x4'));var squel=require(_0x4612('0x5'));var Redis=require(_0x4612('0x6'));var db=require(_0x4612('0x7'))['db'];var config=require(_0x4612('0x8'));var logger=require(_0x4612('0x9'))('import');config[_0x4612('0xa')]=_[_0x4612('0xb')](config[_0x4612('0xa')],{'host':_0x4612('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4612('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4612('0xd')](_0x4612('0xe'));var tempTableName=_0x4612('0xf')+moment()[_0x4612('0xd')](_0x4612('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1ce67b){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))*$/[_0x4612('0x11')](_0x1ce67b);}function selectNotIn(_0xfbd14a,_0xc649d1,_0x38860e,_0x78ad4b,_0x28339f){return squel[_0x4612('0x12')]()[_0x4612('0x13')](_0x4612('0x14'))[_0x4612('0x15')](_0x78ad4b)['join'](_0xc649d1,null,_0xc649d1+_0x4612('0x16')+_0x78ad4b+'.'+_0x38860e)[_0x4612('0x17')](_0x78ad4b+'.'+_0x38860e+_0x4612('0x18')+_0xfbd14a+'.'+_0x38860e)[_0x4612('0x17')](_0xc649d1+_0x4612('0x19')+_0x28339f['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5929d6,_0x36b16a){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x4612('0x1a')+tempTableName)[_0x4612('0x1b')](function(_0x98dbb2){if(_0x98dbb2!==null){var _0x202395=[];for(var _0x2b60eb=0x0;_0x2b60eb<_0x98dbb2[_0x4612('0x1c')];_0x2b60eb++){var _0x53da2a=_0x98dbb2[_0x2b60eb];if(!_[_0x4612('0x1d')](_0x53da2a[_0x4612('0x14')])){if(!_[_0x4612('0x1d')](_0x53da2a[_0x4612('0x1e')]))_0x202395[_0x4612('0x1f')](insertAdditionalPhones(_0x53da2a));promisesContact[_0x4612('0x1f')]({'contact':_0x53da2a});}}}Promise[_0x4612('0x20')](_0x202395)[_0x4612('0x21')](function(){_0x5929d6({'val':0x1});});})['catch'](function(_0x1820ad){logger[_0x4612('0x22')](_0x1820ad[_0x4612('0x23')]);});});}function insertAdditionalPhones(_0x125fc0){return new Promise(function(_0xe527f8,_0x6f354b){var _0x3ca7cd=_0x125fc0[_0x4612('0x1e')];if(_[_0x4612('0x1d')](_0x3ca7cd))_0x6f354b({'val':0x0});else{var _0x330435=_0x3ca7cd[_0x4612('0x24')](';');var _0x330029=[];orderBy=0x0;for(var _0x4d3a6d=0x0;_0x4d3a6d<_0x330435[_0x4612('0x1c')];_0x4d3a6d++){_0x330029[_0x4612('0x1f')](splitAdditionalPhone(_0x125fc0['id'],_0x330435[_0x4d3a6d]));}Promise[_0x4612('0x20')](_0x330029)['then'](function(){_0xe527f8({'val':_0x330435[_0x4612('0x1c')]});});}});}function splitAdditionalPhone(_0x330da0,_0x20c1fd){return new Promise(function(_0x1280ca,_0x279521){var _0x1c8d2a=_0x20c1fd[_0x4612('0x24')](':');var _0x2bf8e8=_0x1c8d2a[0x0];var _0x2c85dd=_0x1c8d2a[0x1];if(_0x2c85dd!==''){var _0x280fc6=_0x2c85dd[_0x4612('0x24')]('|');var _0x5baa9b=[];for(var _0x230110=0x0;_0x230110<_0x280fc6[_0x4612('0x1c')];_0x230110++){if(_0x280fc6[_0x230110]!==''){var _0x328359=_[_0x4612('0x25')](promisesAdditionalPhones,{'contactId':_0x330da0,'phone':_0x280fc6[_0x230110]});if(_0x328359['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x330da0,'contactTypeId':_0x2bf8e8,'phone':_0x280fc6[_0x230110],'orderBy':orderBy});}}}_0x1280ca({'ok':0x1});}else _0x1280ca({'res':0x0});});}function createAdditionalPhone(_0x2856c0,_0x15e370,_0x504e31,_0x2a2687){var _0x3a0f0c='';var _0x19e4d9='';var _0x11893c=_0x504e31[_0x4612('0x24')]('§');_0x3a0f0c=_0x11893c[0x0];if(_0x11893c[_0x4612('0x1c')]==0x2)_0x19e4d9=_0x11893c[0x1];return new Promise(function(_0x25882f,_0x13c607){return db[_0x4612('0x26')][_0x4612('0x27')]({'where':{'CmContactId':_0x2856c0,'item':_0x3a0f0c}})['then'](function(_0x6c1b6d){if(_0x6c1b6d){return db[_0x4612('0x26')][_0x4612('0x28')]({'ItemTypeId':_0x15e370,'description':_0x19e4d9,'OrderBy':_0x2a2687},{'where':{'CmContactId':_0x2856c0,'item':_0x3a0f0c}})['then'](function(_0x360587){_0x25882f({'res':_0x4612('0x29')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x2856c0,'item':_0x3a0f0c,'ItemTypeId':_0x15e370,'description':_0x19e4d9,'OrderBy':_0x2a2687,'ItemClass':_0x4612('0x2a')})['then'](function(_0x5ed11e){_0x25882f({'res':_0x4612('0x2b')});});}});});}function updateContact(_0x3d2bb3){return new Promise(function(_0x42bc2f,_0x4645e7){var _0x5e3f86=_0x3d2bb3['id'];delete _0x3d2bb3['id'];return db['CmContact'][_0x4612('0x28')](_0x3d2bb3,{'where':{'id':_0x5e3f86}})[_0x4612('0x21')](function(_0x494ecf){updatedRows+=0x1;return db[_0x4612('0x2c')][_0x4612('0x28')]({'phone':_0x3d2bb3[_0x4612('0x14')]},{'where':{'ContactId':_0x5e3f86}})[_0x4612('0x21')](function(_0x1e6312){_0x42bc2f({'ret':'OK'});});});});}function insertCmHopper(_0x49f43e,_0x412ed4,_0x1062f8,_0xce5103,_0x47d98b){var _0x489d3d=[_0x4612('0x2d'),'cm_contacts.scheduledat',_0x4612('0x2e'),'cm_contacts.ListId',_0x412ed4+'.'+_0xce5103,_0x4612('0x2f'),_0x4612('0x30'),_0x4612('0x31'),_0x4612('0x32'),'\x22'+_0x47d98b+'\x22'];return squel[_0x4612('0x33')]()[_0x4612('0x34')](_0x4612('0x35'))[_0x4612('0x36')]([_0x4612('0x14'),_0x4612('0x37'),_0x4612('0x38'),_0x4612('0x39'),_0xce5103,'createdAt',_0x4612('0x3a'),_0x4612('0x3b'),_0x4612('0x3c'),'recallme'],squel[_0x4612('0x12')]()[_0x4612('0x3d')](_0x489d3d)[_0x4612('0x15')](_0x412ed4)['join'](_0x4612('0x3e'),null,_0x4612('0x3f')+_0x412ed4+'.CmListId')[_0x4612('0x40')](_0x1062f8,null,_0x1062f8+_0x4612('0x16')+_0x412ed4+'.'+_0xce5103)[_0x4612('0x17')](_0x412ed4+_0x4612('0x41'),_0x49f43e)['where'](_0x4612('0x42'),NOW)[_0x4612('0x17')](_0x4612('0x43'),selectNotIn(_0x412ed4,_0x1062f8,_0xce5103,'cm_hopper',['\x22always\x22',_0x4612('0x44')]))['where'](_0x4612('0x43'),selectNotIn(_0x412ed4,_0x1062f8,_0xce5103,_0x4612('0x35'),[_0x4612('0x45')])))[_0x4612('0x46')]();}function insertCmHopperBlack(_0x4ed10b,_0xa19986,_0x378592,_0x5c81e2){var _0x2eb81d=['cm_contacts.phone',_0x4612('0x2e'),'cm_contacts.ListId',_0xa19986+'.'+_0x5c81e2,_0x4612('0x2f'),_0x4612('0x30')];return squel[_0x4612('0x33')]()[_0x4612('0x34')](_0x4612('0x47'))[_0x4612('0x36')]([_0x4612('0x14'),_0x4612('0x38'),'ListId',_0x5c81e2,_0x4612('0x48'),_0x4612('0x3a')],squel[_0x4612('0x12')]()[_0x4612('0x3d')](_0x2eb81d)['from'](_0xa19986)[_0x4612('0x40')](_0x4612('0x3e'),null,_0x4612('0x3f')+_0xa19986+'.CmListId')[_0x4612('0x40')](_0x378592,null,_0x378592+_0x4612('0x16')+_0xa19986+'.'+_0x5c81e2)[_0x4612('0x17')](_0xa19986+_0x4612('0x41'),_0x4ed10b)[_0x4612('0x17')](_0x4612('0x42'),NOW)[_0x4612('0x17')](_0x4612('0x43'),squel[_0x4612('0x12')]()[_0x4612('0x13')]('phone')[_0x4612('0x15')](_0x4612('0x47'))[_0x4612('0x17')](_0x4612('0x49'),_0x4ed10b)[_0x4612('0x17')](_0x5c81e2+'\x20=\x20?',_0xa19986+'.'+_0x5c81e2)))[_0x4612('0x46')]();}function insertCmHopperAdditionalPhones(_0x139946){var _0xbf0c96=['cm_hopper.id','cm_contact_has_items.item',_0x4612('0x4a'),'cm_contact_has_items.createdAt',_0x4612('0x4b')];return squel['insert']()[_0x4612('0x34')]('cm_hopper_additional_phones')[_0x4612('0x36')]([_0x4612('0x4c'),_0x4612('0x14'),_0x4612('0x4d'),_0x4612('0x48'),_0x4612('0x3a')],squel[_0x4612('0x12')]()[_0x4612('0x3d')](_0xbf0c96)[_0x4612('0x15')](_0x4612('0x35'))[_0x4612('0x40')]('cm_contacts',null,_0x4612('0x4e'))[_0x4612('0x40')](_0x4612('0x4f'),null,_0x4612('0x50'))[_0x4612('0x17')]('cm_hopper.ListId\x20=\x20?',_0x139946)[_0x4612('0x17')](_0x4612('0x42'),NOW))[_0x4612('0x46')]();}function insertCmContact(_0x23c2b6,_0x198667,_0x773fda,_0x165dfd){var _0x4e3f05=_[_0x4612('0x51')](_['keys'](_0x165dfd),[_0x4612('0x39'),_0x4612('0x52'),'createdAt',_0x4612('0x3a')]);return squel['insert']()[_0x4612('0x34')]('cm_contacts')[_0x4612('0x36')](_0x4e3f05,squel[_0x4612('0x12')]()[_0x4612('0x3d')](_0x4e3f05)[_0x4612('0x15')](_0x198667)['where']('('+_0x773fda[_0x4612('0x40')](',')+_0x4612('0x53'),squel[_0x4612('0x12')]()[_0x4612('0x3d')](_0x773fda)[_0x4612('0x15')](_0x4612('0x3e'))[_0x4612('0x17')](_0x4612('0x49'),_0x23c2b6))[_0x4612('0x17')](_0x4612('0x54'),squel[_0x4612('0x12')]()[_0x4612('0x13')]('MIN(id)',_0x4612('0x55'))[_0x4612('0x15')](_0x198667)[_0x4612('0x56')](_0x773fda[_0x4612('0x40')](','))))[_0x4612('0x46')]();}function handleStop(){logger['info'](_0x4612('0x57'));stopped=!![];}function handleUncaughtException(_0x17349a){logger[_0x4612('0x22')](_0x17349a['message']);process[_0x4612('0x58')](0x1);}function handleError(_0x78b66d,_0x394dd8){stats[_0x4612('0x59')][_0x4612('0x1f')]({'name':_0x394dd8[_0x4612('0x5a')],'message':_0x394dd8['message'],'row':_0x78b66d});}function handleQuery(_0x241d19){logger[_0x4612('0x5b')](_0x241d19);return db['sequelize']['query'](_0x241d19)['spread'](function(_0x4f737f){results['push'](_0x4f737f);})[_0x4612('0x5c')](function(_0x3ad6fc){logger[_0x4612('0x22')](_0x3ad6fc[_0x4612('0x23')]);});}function main(_0x2ee67f,_0xcd7f61,_0x2c7a5c,_0x1f43db){logger[_0x4612('0x5b')]('main',_0x2ee67f,JSON[_0x4612('0x5d')](_0xcd7f61));process['send']('start');var _0x3767c5=_0xcd7f61[_0x4612('0x5e')];var _0x1e49e3=_[_0x4612('0x5f')](_0x3767c5);var _0x447f6d=_0xcd7f61[_0x4612('0x60')];var _0x3dee1f=path[_0x4612('0x40')](config['root'],'server/files/tmp',_0x447f6d+'.csv');logger[_0x4612('0x5b')]('body',_0xcd7f61);db[_0x4612('0x61')][_0x4612('0x62')]({'raw':!![],'attributes':['id',_0x4612('0x63')]})['then'](function(_0x20363f){for(var _0x2b4292=0x0;_0x2b4292<_0x20363f[_0x4612('0x1c')];_0x2b4292++){if(_0x20363f[_0x2b4292][_0x4612('0x63')]in _0x3767c5){contactItemTypes[_0x4612('0x1f')](_0x20363f[_0x2b4292]);delete _0x1e49e3[_0x20363f[_0x2b4292][_0x4612('0x63')]];hasAdditionalPhones=!![];}for(var _0x579107 in _0x3767c5){if(_0x20363f[_0x2b4292][_0x4612('0x63')]+_0x4612('0x64')===_0x579107){phoneDescriptions['push']({'itemTypeId':_0x20363f[_0x2b4292]['id'],'description':_0x579107});delete _0x1e49e3[_0x579107];}}}if(hasAdditionalPhones)_0x1e49e3[_0x4612('0x1e')]='';var _0x27b275=_['keys'](_0x1e49e3)[_0x4612('0x40')]();logger[_0x4612('0x5b')](_0x4612('0x65'),_0x27b275);fs[_0x4612('0x66')](_0x3dee1f,_0x27b275+'\x0a');Papa['parse'](fs[_0x4612('0x67')](_0x2ee67f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x520504,_0x3b680a){try{for(var _0x3152ce=0x0,_0x2dddc8=[];_0x3152ce<_0x520504[_0x4612('0x68')]['length'];_0x3152ce++){stats[_0x4612('0x69')]+=0x1;if(_0x520504[_0x4612('0x59')][_0x3152ce]){handleError(_0x520504[_0x4612('0x68')][_0x3152ce],_0x520504[_0x4612('0x59')][_0x3152ce]);}else{var _0x1870ae=[];var _0x55eac4=[];var _0x294f05={};for(var _0xce5da3 in _0x3767c5){let _0x436181=contactItemTypes[_0x4612('0x6a')](_0x4a10d6=>_0x4a10d6[_0x4612('0x63')]===_0xce5da3);let _0x157270=contactItemTypes[_0x4612('0x6a')](_0x49b39a=>_0x49b39a[_0x4612('0x63')]+_0x4612('0x64')===_0xce5da3);if(_['isNil'](_0x436181)&&_[_0x4612('0x1d')](_0x157270)){if(_0x3767c5[_0x4612('0x6b')](_0xce5da3)){if(_0x520504[_0x4612('0x68')][_0x3152ce][_0x3767c5[_0xce5da3]]){var _0x378b10=_[_0x4612('0x6c')](_0x520504[_0x4612('0x68')][_0x3152ce][_0x3767c5[_0xce5da3]][_0x4612('0x6d')](/"/g,'\x27'));switch(_0xce5da3){case _0x4612('0x37'):var _0x3c6a9c=moment(_0x378b10,_0x4612('0xe'),!![]);if(_0x3c6a9c[_0x4612('0x6e')]()){_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x378b10+'\x22');}else{_0x1870ae[_0x4612('0x1f')](_0x4612('0x6f'));}break;case _0x4612('0x3b'):var _0x573dfe=parseInt(_0x378b10);_0x378b10=_['isNaN'](_0x573dfe)||_0x573dfe<0x0||_0x573dfe>0x4?_0x1f43db?0x3:0x2:_0x573dfe;_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x378b10+'\x22');break;case _0x4612('0x3c'):var _0x40168b=parseInt(_0x378b10);if(_[_0x4612('0x70')](_0x40168b)&&_[_0x4612('0x71')](_0x2c7a5c,_0x40168b)){_0x2dddc8['push']('\x22'+_0x40168b+'\x22');}else{_0x1870ae['push'](_0x4612('0x72'));}break;case _0x4612('0x73'):if(isEmail(_0x378b10)){_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x378b10+'\x22');}else{_0x1870ae[_0x4612('0x1f')](_0x4612('0x74'));}break;case'dateOfBirth':var _0x65f629=moment(_0x378b10,_0x4612('0x75'),!![]);if(_0x65f629['isValid']()){_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x378b10+'\x22');}else{_0x1870ae[_0x4612('0x1f')](_0x4612('0x76'));}break;default:_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x378b10+'\x22');}}else{switch(_0xce5da3){case _0x4612('0x77'):case _0x4612('0x14'):_0x1870ae[_0x4612('0x1f')](_0xce5da3+'\x20not\x20specified');break;default:_0x2dddc8[_0x4612('0x1f')]('\x22\x22');}}}}else{var _0x151fba='';if(!_[_0x4612('0x1d')](_0x436181)){if(!_0x294f05[_0x4612('0x6b')](_0x436181['id'])){for(var _0x539b51=0x0;_0x539b51<_0x3767c5[_0xce5da3]['length'];_0x539b51++){var _0x378b10=_['trim'](_0x520504['data'][_0x3152ce][_0x3767c5[_0xce5da3][_0x539b51]]['replace'](/"/g,'\x27'));var _0x4c6686=phoneDescriptions[_0x4612('0x6a')](_0x74652a=>_0x74652a[_0x4612('0x78')]===_0x436181['id']);if(!_['isNil'](_0x4c6686)){var _0x5a9f9b=_['trim'](_0x520504['data'][_0x3152ce][_0x3767c5[_0x4c6686['description']][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x5a9f9b))_0x378b10=_0x378b10+'§'+_0x5a9f9b;}if(_0x151fba=='')_0x151fba=_0x378b10;else _0x151fba+='|'+_0x378b10;}_0x55eac4[_0x4612('0x1f')](_0x436181['id']+':'+_0x151fba);_0x294f05[_0x436181['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2dddc8[_0x4612('0x1f')]('\x22'+_0x55eac4[_0x4612('0x40')](';')+'\x22');}if(_0x1870ae[_0x4612('0x1c')]){handleError(_0x520504[_0x4612('0x68')][_0x3152ce],{'code':_0x4612('0x79'),'message':_0x1870ae[_0x4612('0x40')]()});}else{fs[_0x4612('0x7a')](_0x3dee1f,_0x2dddc8[_0x4612('0x40')]()+'\x0a');}_0x2dddc8=[];}if(!(stats[_0x4612('0x69')]%0xc8)){socket[_0x4612('0x7b')](_0x4612('0x7c')+_0x447f6d,stats);stats[_0x4612('0x59')]=[];}}if(stopped){logger[_0x4612('0x5b')](_0x4612('0x7d'));_0x3b680a[_0x4612('0x7e')]();}}catch(_0x272b12){handleError(_0x520504[_0x4612('0x68')][_0x3152ce],{'code':_0x4612('0x7f'),'message':_0x272b12[_0x4612('0x23')]});logger[_0x4612('0x22')](_0x4612('0x80'),_0x272b12['message']);}},'complete':function(){try{var _0x355247=[];var _0x2346fe=tempTableName;_0x355247['push'](_0x4612('0x81')+_0x2346fe+_0x4612('0x82'));logger[_0x4612('0x5b')](_0x4612('0x83'),contactItemTypes[_0x4612('0x1c')]);var _0x232459=util[_0x4612('0xd')]('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',_0x3dee1f,_0x2346fe,_0x27b275,_0xcd7f61[_0x4612('0x39')],_0xcd7f61[_0x4612('0x52')]||null,NOW,NOW);if(_['isNil'](_0x3767c5['scheduledat'])){_0x232459+=',\x20scheduledAt\x20=\x20NOW()';}_0x355247['push'](_0x232459);BPromise[_0x4612('0x84')](_0x355247,handleQuery)[_0x4612('0x21')](function(_0x432e68){BPromise[_0x4612('0x20')]([handleAdditionalPhones()])[_0x4612('0x21')](function(){_0x355247=[];for(var _0x4a9044=0x0;_0x4a9044\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.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','TagIds','limit','offset','toString','Setting','findOne','all','clone','COUNT(*)','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','from','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','left_join','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','buildExpression','type','text','start','value','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','ContactId','Tag','clause','tags','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','plainBody','body','keys','some','compact','forEach','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','then','fields','tag','filter','get','chat','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','sequelize','query','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt'];(function(_0x20126d,_0x1623b5){var _0x4e80c8=function(_0x1c370b){while(--_0x1c370b){_0x20126d['push'](_0x20126d['shift']());}};_0x4e80c8(++_0x1623b5);}(_0x5403,0x166));var _0x3540=function(_0x3b4aa6,_0x2685ff){_0x3b4aa6=_0x3b4aa6-0x0;var _0x474edf=_0x5403[_0x3b4aa6];return _0x474edf;};'use strict';var _=require(_0x3540('0x0'));var squel=require(_0x3540('0x1'));var as=require(_0x3540('0x2'));var qs=require(_0x3540('0x3'));var updateInteraction=require('./update-interaction')[_0x3540('0x4')];var utils=require(_0x3540('0x5'));var db=require(_0x3540('0x6'))['db'];function skipInteractionsQuery(_0x5d47bc,_0x795e7f,_0x5014e7){var _0x10ef50=![];var _0x25d5d5=utils[_0x3540('0x7')](_0x5d47bc);if(_0x795e7f[_0x3540('0x8')]===_0x3540('0x9')&&!_0x5014e7['search']&&!_0x5014e7[_0x25d5d5]){_0x10ef50=!![];}return _0x10ef50;}function getTagsQuery(){return squel[_0x3540('0xa')]()[_0x3540('0xb')]('id')[_0x3540('0xb')](_0x3540('0xc'))[_0x3540('0xb')]('color')['from'](_0x3540('0xd'));}function getUsersQuery(_0x3ab636,_0x48aebd){var _0x5da9dc=utils[_0x3540('0xe')](_0x3ab636);var _0xd9fb3b='user_has_'+_0x3ab636+_0x3540('0xf');var _0x13cfd7=squel[_0x3540('0xa')]()[_0x3540('0xb')](_0x3540('0x10'))['field'](_0x3540('0x11'))[_0x3540('0xb')](_0x3540('0x12')+_0x5da9dc)[_0x3540('0x13')](_0xd9fb3b,'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');if(_0x48aebd[_0x3540('0x14')]>0x0){_0x13cfd7[_0x3540('0x15')](_0x3540('0x12')+_0x5da9dc+_0x3540('0x16'),_[_0x3540('0x17')](_0x48aebd,'id'));}return _0x13cfd7;}function getInteractionsQuery(_0x5e3f82){var _0x1f72bc=utils[_0x3540('0x18')](_0x5e3f82);var _0x2d538d=utils[_0x3540('0x7')](_0x5e3f82);var _0x309ea3=utils['getInteractionFK'](_0x5e3f82);return squel[_0x3540('0xa')]()[_0x3540('0x13')](_0x1f72bc[_0x3540('0x19')],'i')['left_join'](_0x3540('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3540('0x1b')](_0x3540('0x1c'),'o',_0x3540('0x1d'))[_0x3540('0x1b')](_0x1f72bc[_0x3540('0x1e')],'a',_0x3540('0x1f')+_0x2d538d)[_0x3540('0x1b')](_0x1f72bc[_0x3540('0x20')],'me',_0x3540('0x21')+_0x309ea3+_0x3540('0x22'))[_0x3540('0x1b')](_0x1f72bc[_0x3540('0x23')],'it','it.'+_0x309ea3+_0x3540('0x22'))[_0x3540('0x1b')]('tools_tags','t',_0x3540('0x24'));}function getSqlClauses(){var _0x358e79={'body':squel[_0x3540('0x25')](),'contact':squel[_0x3540('0x25')](),'default':squel[_0x3540('0x25')](),'fields':squel[_0x3540('0x25')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0x3540('0x25')](),'ids':null},'user':squel[_0x3540('0x25')]()};return _0x358e79;}function parseTagParameter(_0x123f69){var _0x374bee=squel[_0x3540('0x25')]();if(_0x123f69){var _0x3087f7=utils[_0x3540('0x26')](_0x123f69);_0x3087f7['forEach'](function(_0x477513){_0x374bee['or'](_0x3540('0x27'),'%,'+_0x477513+',%');});}return _0x374bee;}function parseReadParameter(_0xcc15c6){var _0xb0c82e='';if(_0xcc15c6){_0xb0c82e=_0x3540('0x28');if(_0xcc15c6==='1'){_0xb0c82e=_0xb0c82e['replace']('{OPERATOR}','=');}else{_0xb0c82e=_0xb0c82e[_0x3540('0x29')](_0x3540('0x2a'),'>');}}return _0xb0c82e;}function parseSearchFilter(_0x2751b0,_0x22afdf){var _0x5a8857=squel['expr']();if(_0x22afdf){var _0x4fbc7e=_0x22afdf[_0x3540('0x29')]('\x5c','\x5c\x5c')[_0x3540('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4fbc7e)){_0x5a8857['or'](_0x3540('0x2b'),_0x4fbc7e+'%');if([_0x3540('0x2c'),'whatsapp'][_0x3540('0x2d')](_0x2751b0)){_0x5a8857['or'](_0x3540('0x2e'),_0x4fbc7e+'%');}else if(_0x2751b0===_0x3540('0x2f')){_0x5a8857['or'](_0x3540('0x30'),_0x4fbc7e+'%');}else if(_0x2751b0==='openchannel'){_0x5a8857['or'](_0x3540('0x31'),_0x4fbc7e+'%');}}else if(_0x2751b0==='mail'&&qs['isEmail'](_0x4fbc7e)){_0x5a8857['or'](_0x3540('0x32'),_0x4fbc7e+'%');}else{if(_0x2751b0===_0x3540('0x33')){_0x5a8857['or'](_0x3540('0x34'),qs[_0x3540('0x35')](_0x4fbc7e,!![]))['or'](_0x3540('0x36'),qs['getFullTextValue'](_0x4fbc7e));}else if(_0x2751b0!=='fax'){_0x5a8857['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3540('0x35')](_0x4fbc7e));}_0x5a8857['or'](_0x3540('0x37'),qs['getFullTextValue'](_0x4fbc7e,!![]),null);}}return _0x5a8857;}function parseAdvancedSearchFilter(_0x295a31,_0x2f0a5f){var _0x4f54c0=getSqlClauses();var _0x1b80d1=as[_0x3540('0x38')](_0x295a31);var _0x3dadd8=_0x1b80d1['sqlOperator'];for(var _0x4eb18d=0x0;_0x4eb18d<_0x1b80d1['conditions']['length'];_0x4eb18d++){var _0x23157b=_0x1b80d1[_0x3540('0x39')][_0x4eb18d];var _0x4ccce1='i';var _0x3284d8=_['find'](_0x2f0a5f,['name',_0x23157b[_0x3540('0xb')]]);if(_0x3284d8){var _0x5bfead=as[_0x3540('0x3a')](_0x4ccce1,_0x3284d8[_0x3540('0x3b')],_0x23157b);_0x4f54c0['default'][_0x3dadd8](_0x5bfead[_0x3540('0x3c')],_0x5bfead['value'][_0x3540('0x3d')],_0x5bfead[_0x3540('0x3e')][_0x3540('0x3f')]);}else{switch(_0x23157b[_0x3540('0xb')]){case _0x3540('0x40'):var _0x4e0732=parseReadParameter(_0x23157b[_0x3540('0x3e')]);_0x4f54c0[_0x3540('0x41')][_0x3540('0x42')](_0x4e0732);break;case _0x3540('0x43'):if(_0x23157b[_0x3540('0x44')]===_0x3540('0x45')){if(_0x23157b[_0x3540('0x3e')][_0x3540('0x46')]('\x20')[_0x3540('0x14')]>0x1){_0x4f54c0[_0x3540('0x47')][_0x3dadd8](_0x3540('0x37'),qs[_0x3540('0x35')](_0x23157b[_0x3540('0x3e')],!![]),null);}else{var _0x50ffef='%'+_0x23157b['value']+'%';_0x4f54c0[_0x3540('0x47')][_0x3dadd8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x50ffef,_0x50ffef,_0x50ffef);}}else{_0x3284d8=_['find'](_0x2f0a5f,['name',_0x3540('0x48')]);_0x23157b[_0x3540('0xb')]=_0x3540('0x48');_0x5bfead=as[_0x3540('0x3a')](_0x4ccce1,_0x3284d8[_0x3540('0x3b')],_0x23157b);_0x4f54c0[_0x3540('0x47')][_0x3dadd8](_0x5bfead[_0x3540('0x3c')],_0x5bfead[_0x3540('0x3e')][_0x3540('0x3d')],_0x5bfead[_0x3540('0x3e')][_0x3540('0x3f')]);}break;case _0x3540('0x49'):var _0x38e62f=_0x23157b['value'][_0x3540('0x46')](',')[_0x3540('0x17')](function(_0x2bac0b){return Number(_0x2bac0b);});var _0x59d31b=parseTagParameter(_0x38e62f);_0x4f54c0['tags'][_0x3540('0x4a')]['and'](_0x59d31b);_0x4f54c0[_0x3540('0x4b')][_0x3540('0x4c')]=_0x38e62f;break;case _0x3540('0x4d'):if(_0x23157b[_0x3540('0x44')]===_0x3540('0x45')){_0x4f54c0[_0x3540('0x4e')][_0x3dadd8](_0x3540('0x4f'),'%'+_0x23157b[_0x3540('0x3e')]+'%',null);}else{_0x3284d8=_[_0x3540('0x50')](_0x2f0a5f,['name',_0x3540('0x51')]);_0x23157b[_0x3540('0xb')]=_0x3540('0x51');_0x5bfead=as[_0x3540('0x3a')](_0x4ccce1,_0x3284d8[_0x3540('0x3b')],_0x23157b);_0x4f54c0[_0x3540('0x4e')][_0x3dadd8](_0x5bfead[_0x3540('0x3c')],_0x5bfead[_0x3540('0x3e')][_0x3540('0x3d')],_0x5bfead[_0x3540('0x3e')][_0x3540('0x3f')]);}break;case'body':case _0x3540('0x52'):_0x5bfead=as['buildExpression']('me',null,_0x23157b);_0x4f54c0[_0x3540('0x53')][_0x3dadd8](_0x5bfead['text'],_0x5bfead[_0x3540('0x3e')]['start'],_0x5bfead[_0x3540('0x3e')]['end']);break;}}}return _0x4f54c0;}function parseModelFields(_0x112eaf,_0x3e4c53,_0x20766e){var _0x504ebe=utils['getAccountFK'](_0x112eaf);var _0x5cfe09=squel[_0x3540('0x25')]();var _0x214674=_(_0x3e4c53)[_0x3540('0x54')]()['map'](function(_0x3d76e1){return _[_0x3540('0x55')](_0x20766e,[_0x3540('0xc'),_0x3d76e1])?_0x3d76e1:undefined;})[_0x3540('0x56')]()[_0x3540('0x3e')]();if(_0x214674[_0x3540('0x14')]>0x0){_0x214674[_0x3540('0x57')](function(_0x6661c8){if(_0x6661c8===_0x504ebe){_0x5cfe09[_0x3540('0x42')]('i.'+_0x504ebe+_0x3540('0x16'),[]['concat'](_0x3e4c53[_0x6661c8]));}else if(_0x6661c8==='createdAt'){var _0x7d0888=JSON['parse'](_0x3e4c53[_0x6661c8])['$gte'];var _0x12823c=JSON[_0x3540('0x58')](_0x3e4c53[_0x6661c8])[_0x3540('0x59')];_0x5cfe09[_0x3540('0x42')](_0x3540('0x5a'),_0x7d0888,_0x12823c);}else{if(_0x3e4c53[_0x6661c8]===_0x3540('0x5b')){_0x5cfe09['and']('i.'+_0x6661c8+_0x3540('0x5c'));}else{_0x5cfe09[_0x3540('0x42')]('i.'+_0x6661c8+'\x20=\x20?',_0x3e4c53[_0x6661c8]);}}});}return _0x5cfe09;}function parseQueryParameters(_0x441ed7,_0x3c591f,_0x2299e6){var _0x5853db=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x441ed7,_0x3c591f,_0x2299e6);})[_0x3540('0x5d')](function(_0x4a823d){_0x5853db[_0x3540('0x5e')][_0x3540('0x42')](_0x4a823d);return parseReadParameter(_0x3c591f[_0x3540('0x41')]);})['then'](function(_0x426359){_0x5853db[_0x3540('0x41')][_0x3540('0x42')](_0x426359);return parseTagParameter(_0x3c591f[_0x3540('0x5f')]);})['then'](function(_0x51e1f1){_0x5853db[_0x3540('0x4b')][_0x3540('0x4a')][_0x3540('0x42')](_0x51e1f1);return parseSearchFilter(_0x441ed7,_0x3c591f['filter']);})[_0x3540('0x5d')](function(_0x205a92){_0x5853db[_0x3540('0x60')]=_0x205a92;return _0x5853db;});}function checkAccountsRestrictions(_0x2d9335,_0x3ee959,_0x12d941){var _0x2df61f=utils[_0x3540('0x7')](_0x2d9335);var _0x2b4ec7=_0x3540('0x61')+_['capitalize'](_0x2d9335)+(_0x2d9335===_0x3540('0x62')?_0x3540('0x63'):_0x3540('0x64'));var _0x32e706=squel[_0x3540('0x25')]();return Promise[_0x3540('0x65')]()['then'](function(){if(_0x12d941['search']&&_0x3ee959[_0x3540('0x8')]===_0x3540('0x9')){return _0x3ee959[_0x2b4ec7]({'attributes':['id'],'raw':!![]});}})[_0x3540('0x5d')](function(_0x819ea7){if(_0x819ea7){if(_0x819ea7['length']===0x0){_0x32e706[_0x3540('0x42')]('i.'+_0x2df61f+_0x3540('0x5c'));}else{_0x32e706[_0x3540('0x42')]('i.'+_0x2df61f+_0x3540('0x16'),_['map'](_0x819ea7,'id'));}}else if(!_0x12d941[_0x2df61f]){_0x32e706['and']('i.'+_0x2df61f+_0x3540('0x66'));}})['then'](function(){return _0x32e706;});}function getClosedOrderClause(_0x312b32,_0x2b98c1){var _0x490c8a='';var _0x108b69=[_0x3540('0x67'),'i.secondDisposition',_0x3540('0x68')];if(_0x312b32===_0x3540('0x33')){_0x108b69[_0x3540('0x69')](_0x3540('0x6a'));}if(_0x2b98c1[_0x3540('0x6b')]==='0'&&_0x312b32==='mail'){_0x490c8a=_0x3540('0x6a');}else{if(_0x2b98c1[_0x3540('0x6b')]==='1'){_0x108b69[_0x3540('0x6c')]();}_0x490c8a=_0x3540('0x6d')+_0x108b69[_0x3540('0x6e')](',\x20')+')';}return _0x490c8a;}function getFilteredInteractions(_0x31125f,_0x4ec125,_0x575618,_0x19e869){var _0x3acea2=utils[_0x3540('0xe')](_0x31125f);var _0x475d0e=_['capitalize'](_0x31125f)+'Interaction';var _0x314e80=[];var _0x5c08c0=getTagsQuery();var _0x24f472={'type':db[_0x3540('0x6f')][_0x3540('0x70')]['SELECT'],'raw':!![]};var _0x4250b8=[];var _0x36b4be=[];return db[_0x3540('0x71')][_0x3540('0x72')](_0x5c08c0['toString'](),_0x24f472)[_0x3540('0x5d')](function(_0x5cfd5a){_0x314e80=_[_0x3540('0x73')](_0x5cfd5a,'id');_0x24f472=_[_0x3540('0x74')](_0x24f472,{'model':db[_0x475d0e],'mapToModel':!![],'nest':!![]});if(_0x575618[_0x3540('0x5e')]){_0x19e869[_0x3540('0x75')][_0x3540('0x57')](function(_0x4bcb66){_0x4ec125[_0x3540('0xb')]('i.'+_0x4bcb66);});}else{_0x4ec125[_0x3540('0xb')](_0x3540('0x76'),_0x3540('0x40'));_0x4ec125[_0x3540('0xb')]('a.key','Account.key');_0x4ec125[_0x3540('0xb')](_0x3540('0x77'),_0x3540('0x78'));if(_0x31125f===_0x3540('0x33')){_0x4ec125[_0x3540('0xb')](_0x3540('0x79'),'Account.email');_0x4ec125[_0x3540('0xb')](_0x3540('0x7a'),_0x3540('0x7b'));_0x4ec125[_0x3540('0xb')]('i.id');_0x4ec125[_0x3540('0xb')](_0x3540('0x7c'));_0x4ec125['field'](_0x3540('0x7d'));_0x4ec125[_0x3540('0xb')](_0x3540('0x7e'));_0x4ec125[_0x3540('0xb')]('i.closedAt');_0x4ec125[_0x3540('0xb')](_0x3540('0x7f'));_0x4ec125[_0x3540('0xb')]('i.lastMsgAt');_0x4ec125[_0x3540('0xb')]('i.lastMsgDirection');_0x4ec125['field'](_0x3540('0x80'));_0x4ec125[_0x3540('0xb')](_0x3540('0x68'));_0x4ec125['field']('i.secondDisposition');_0x4ec125[_0x3540('0xb')]('i.thirdDisposition');_0x4ec125[_0x3540('0xb')](_0x3540('0x6a'));_0x4ec125['field'](_0x3540('0x81'));_0x4ec125[_0x3540('0xb')](_0x3540('0x82'));_0x4ec125['field'](_0x3540('0x83'));_0x4ec125[_0x3540('0xb')](_0x3540('0x84'));}else if(_0x31125f===_0x3540('0x85')){_0x4ec125[_0x3540('0xb')](_0x3540('0x86'),_0x3540('0x7b'));}else{_0x4ec125[_0x3540('0xb')](_0x3540('0x87'),_0x3540('0x7b'));}if(_0x31125f!==_0x3540('0x33')){_0x4ec125['field'](_0x3540('0x88'));}_0x4ec125[_0x3540('0xb')](_0x3540('0x89'),'Contact.firstName');_0x4ec125[_0x3540('0xb')]('c.lastName',_0x3540('0x8a'));_0x4ec125['field'](_0x3540('0x8b'),_0x3540('0x8c'));_0x4ec125[_0x3540('0xb')](_0x3540('0x8d'),'Contact.phone');_0x4ec125[_0x3540('0xb')](_0x3540('0x8e'),_0x3540('0x8f'));_0x4ec125[_0x3540('0xb')](_0x3540('0x90'),_0x3540('0x91'));_0x4ec125[_0x3540('0xb')](_0x3540('0x92'),_0x3540('0x93'));_0x4ec125[_0x3540('0xb')](_0x3540('0x94'),'Owner.internal');_0x4ec125[_0x3540('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3540('0x95'));}if(_0x19e869['limit']){_0x4ec125[_0x3540('0x96')](_0x19e869[_0x3540('0x96')]);}if(_0x19e869[_0x3540('0x97')]){_0x4ec125[_0x3540('0x97')](_0x19e869[_0x3540('0x97')]);}return db[_0x3540('0x71')][_0x3540('0x72')](_0x4ec125['toString'](),_0x24f472);})[_0x3540('0x5d')](function(_0x417ded){_0x4250b8=_0x417ded;var _0x2ca647=getUsersQuery(_0x31125f,_0x4250b8);return db[_0x3540('0x71')][_0x3540('0x72')](_0x2ca647[_0x3540('0x98')](),_0x24f472);})[_0x3540('0x5d')](function(_0x48beee){_0x36b4be=_['groupBy'](_0x48beee,_0x3acea2);if(_0x31125f===_0x3540('0x33')){return db[_0x3540('0x99')][_0x3540('0x9a')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x249414){var _0x45d08a=_0x249414?_0x249414['enableEmailPreview']:undefined;var _0x28d45f=_0x4250b8[_0x3540('0x17')](function(_0x452b7f){return updateInteraction(_0x452b7f,_0x314e80,_0x36b4be,_0x45d08a);});return Promise[_0x3540('0x9b')](_0x28d45f);});}function countFilteredInteractions(_0x2c4637,_0x236da2){var _0x12a294=_0x2c4637[_0x3540('0x9c')]();_0x12a294['field'](_0x3540('0x9d'));_0x12a294[_0x3540('0xb')](_0x3540('0x76'),_0x3540('0x40'));var _0x4bf6db=utils[_0x3540('0x26')](_0x236da2);if(!_['isEmpty'](_0x4bf6db)){_0x12a294['where'](_0x3540('0x9e'),_0x4bf6db);}var _0x4d818a={'type':db[_0x3540('0x6f')][_0x3540('0x70')][_0x3540('0x9f')],'raw':!![]};return db[_0x3540('0x71')][_0x3540('0x72')](_0x12a294[_0x3540('0x98')](),_0x4d818a);}module[_0x3540('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x7dc9=['query','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','length','where','\x20IN\x20?','getInteractionsTables','interactions','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','start','end','unreadMessages','value','read','Contact','operator','contact','ContactId','Tag','split','tags','clause','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','and','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','fields','tag','filter','capitalize','chat','Websites','Accounts','map','\x20IS\x20NOT\x20NULL','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','sequelize','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset'];(function(_0x224d3c,_0xef918a){var _0x13fa78=function(_0x10bdde){while(--_0x10bdde){_0x224d3c['push'](_0x224d3c['shift']());}};_0x13fa78(++_0xef918a);}(_0x7dc9,0x15d));var _0x97dc=function(_0xaa8a83,_0x3987ab){_0xaa8a83=_0xaa8a83-0x0;var _0x19ab59=_0x7dc9[_0xaa8a83];return _0x19ab59;};'use strict';var _=require(_0x97dc('0x0'));var squel=require(_0x97dc('0x1'));var as=require(_0x97dc('0x2'));var qs=require(_0x97dc('0x3'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require(_0x97dc('0x4'));var db=require(_0x97dc('0x5'))['db'];function skipInteractionsQuery(_0x4b42e6,_0x470682,_0xf63e88){var _0x43e6a7=![];var _0x30600a=utils[_0x97dc('0x6')](_0x4b42e6);if(_0x470682[_0x97dc('0x7')]===_0x97dc('0x8')&&!_0xf63e88[_0x97dc('0x9')]&&!_0xf63e88[_0x30600a]){_0x43e6a7=!![];}return _0x43e6a7;}function getTagsQuery(){return squel[_0x97dc('0xa')]()[_0x97dc('0xb')]('id')[_0x97dc('0xb')](_0x97dc('0xc'))['field'](_0x97dc('0xd'))['from'](_0x97dc('0xe'));}function getUsersQuery(_0x30249c,_0x3af804){var _0x1cc9fe=utils[_0x97dc('0xf')](_0x30249c);var _0x2c8ae7=_0x97dc('0x10')+_0x30249c+_0x97dc('0x11');var _0x3dbb54=squel[_0x97dc('0xa')]()[_0x97dc('0xb')](_0x97dc('0x12'))[_0x97dc('0xb')](_0x97dc('0x13'))[_0x97dc('0xb')](_0x97dc('0x14')+_0x1cc9fe)['from'](_0x2c8ae7,'ui')[_0x97dc('0x15')](_0x97dc('0x16'),'u','u.id\x20=\x20ui.UserId');if(_0x3af804[_0x97dc('0x17')]>0x0){_0x3dbb54[_0x97dc('0x18')](_0x97dc('0x14')+_0x1cc9fe+_0x97dc('0x19'),_['map'](_0x3af804,'id'));}return _0x3dbb54;}function getInteractionsQuery(_0x5bef46){var _0x24fcb1=utils[_0x97dc('0x1a')](_0x5bef46);var _0x4670c1=utils[_0x97dc('0x6')](_0x5bef46);var _0x4b015d=utils['getInteractionFK'](_0x5bef46);return squel['select']()['from'](_0x24fcb1[_0x97dc('0x1b')],'i')[_0x97dc('0x15')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x97dc('0x15')](_0x97dc('0x16'),'o',_0x97dc('0x1c'))[_0x97dc('0x15')](_0x24fcb1[_0x97dc('0x1d')],'a',_0x97dc('0x1e')+_0x4670c1)[_0x97dc('0x15')](_0x24fcb1['messages'],'me',_0x97dc('0x1f')+_0x4b015d+_0x97dc('0x20'))[_0x97dc('0x15')](_0x24fcb1[_0x97dc('0x21')],'it',_0x97dc('0x22')+_0x4b015d+'\x20=\x20i.id')['left_join'](_0x97dc('0xe'),'t',_0x97dc('0x23'));}function getSqlClauses(){var _0x8550f6={'body':squel[_0x97dc('0x24')](),'contact':squel[_0x97dc('0x24')](),'default':squel[_0x97dc('0x24')](),'fields':squel['expr'](),'filter':squel[_0x97dc('0x24')](),'read':squel[_0x97dc('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x8550f6;}function parseTagParameter(_0xc212d6){var _0x54da2e=squel[_0x97dc('0x24')]();if(_0xc212d6){var _0x17cda8=utils[_0x97dc('0x25')](_0xc212d6);_0x17cda8[_0x97dc('0x26')](function(_0x3736a7){_0x54da2e['or'](_0x97dc('0x27'),'%,'+_0x3736a7+',%');});}return _0x54da2e;}function parseReadParameter(_0x50c7cf){var _0x1b9e32='';if(_0x50c7cf){_0x1b9e32=_0x97dc('0x28');if(_0x50c7cf==='1'){_0x1b9e32=_0x1b9e32['replace'](_0x97dc('0x29'),'=');}else{_0x1b9e32=_0x1b9e32[_0x97dc('0x2a')](_0x97dc('0x29'),'>');}}return _0x1b9e32;}function parseSearchFilter(_0x16f00d,_0x300421){var _0x58c849=squel['expr']();if(_0x300421){var _0x45af1b=_0x300421[_0x97dc('0x2a')]('\x5c','\x5c\x5c')[_0x97dc('0x2a')](/'/g,'\x27\x27');if(qs[_0x97dc('0x2b')](_0x45af1b)){_0x58c849['or'](_0x97dc('0x2c'),_0x45af1b+'%');if([_0x97dc('0x2d'),_0x97dc('0x2e')][_0x97dc('0x2f')](_0x16f00d)){_0x58c849['or'](_0x97dc('0x30'),_0x45af1b+'%');}else if(_0x16f00d===_0x97dc('0x31')){_0x58c849['or']('i.fax\x20LIKE\x20?',_0x45af1b+'%');}else if(_0x16f00d===_0x97dc('0x32')){_0x58c849['or'](_0x97dc('0x33'),_0x45af1b+'%');}}else if(_0x16f00d==='mail'&&qs[_0x97dc('0x34')](_0x45af1b)){_0x58c849['or'](_0x97dc('0x35'),_0x45af1b+'%');}else{if(_0x16f00d===_0x97dc('0x36')){_0x58c849['or'](_0x97dc('0x37'),qs[_0x97dc('0x38')](_0x45af1b,!![]))['or'](_0x97dc('0x39'),qs[_0x97dc('0x38')](_0x45af1b));}else if(_0x16f00d!==_0x97dc('0x31')){_0x58c849['or'](_0x97dc('0x3a'),qs[_0x97dc('0x38')](_0x45af1b));}_0x58c849['or'](_0x97dc('0x3b'),qs['getFullTextValue'](_0x45af1b,!![]),null);}}return _0x58c849;}function parseAdvancedSearchFilter(_0x1deffe,_0x14be68){var _0x5db800=getSqlClauses();var _0x2745cf=as[_0x97dc('0x3c')](_0x1deffe);var _0x2d1308=_0x2745cf[_0x97dc('0x3d')];for(var _0x1c7b6a=0x0;_0x1c7b6a<_0x2745cf[_0x97dc('0x3e')]['length'];_0x1c7b6a++){var _0x4e7eb0=_0x2745cf[_0x97dc('0x3e')][_0x1c7b6a];var _0x506cd5='i';var _0x56bdb1=_[_0x97dc('0x3f')](_0x14be68,[_0x97dc('0xc'),_0x4e7eb0['field']]);if(_0x56bdb1){var _0x54c212=as[_0x97dc('0x40')](_0x506cd5,_0x56bdb1[_0x97dc('0x41')],_0x4e7eb0);_0x5db800[_0x97dc('0x42')][_0x2d1308](_0x54c212[_0x97dc('0x43')],_0x54c212['value'][_0x97dc('0x44')],_0x54c212['value'][_0x97dc('0x45')]);}else{switch(_0x4e7eb0[_0x97dc('0xb')]){case _0x97dc('0x46'):var _0x2e79a4=parseReadParameter(_0x4e7eb0[_0x97dc('0x47')]);_0x5db800[_0x97dc('0x48')]['and'](_0x2e79a4);break;case _0x97dc('0x49'):if(_0x4e7eb0[_0x97dc('0x4a')]==='$substring'){if(_0x4e7eb0['value']['split']('\x20')['length']>0x1){_0x5db800[_0x97dc('0x4b')][_0x2d1308](_0x97dc('0x3b'),qs[_0x97dc('0x38')](_0x4e7eb0['value'],!![]),null);}else{var _0x5010c0='%'+_0x4e7eb0[_0x97dc('0x47')]+'%';_0x5db800['contact'][_0x2d1308]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5010c0,_0x5010c0,_0x5010c0);}}else{_0x56bdb1=_[_0x97dc('0x3f')](_0x14be68,[_0x97dc('0xc'),_0x97dc('0x4c')]);_0x4e7eb0[_0x97dc('0xb')]=_0x97dc('0x4c');_0x54c212=as[_0x97dc('0x40')](_0x506cd5,_0x56bdb1[_0x97dc('0x41')],_0x4e7eb0);_0x5db800[_0x97dc('0x4b')][_0x2d1308](_0x54c212[_0x97dc('0x43')],_0x54c212[_0x97dc('0x47')][_0x97dc('0x44')],_0x54c212['value']['end']);}break;case _0x97dc('0x4d'):var _0x537c0f=_0x4e7eb0[_0x97dc('0x47')][_0x97dc('0x4e')](',')['map'](function(_0x25a575){return Number(_0x25a575);});var _0x898006=parseTagParameter(_0x537c0f);_0x5db800[_0x97dc('0x4f')][_0x97dc('0x50')]['and'](_0x898006);_0x5db800[_0x97dc('0x4f')]['ids']=_0x537c0f;break;case _0x97dc('0x51'):if(_0x4e7eb0[_0x97dc('0x4a')]==='$substring'){_0x5db800[_0x97dc('0x52')][_0x2d1308](_0x97dc('0x53'),'%'+_0x4e7eb0[_0x97dc('0x47')]+'%',null);}else{_0x56bdb1=_[_0x97dc('0x3f')](_0x14be68,[_0x97dc('0xc'),_0x97dc('0x54')]);_0x4e7eb0['field']=_0x97dc('0x54');_0x54c212=as['buildExpression'](_0x506cd5,_0x56bdb1['type'],_0x4e7eb0);_0x5db800[_0x97dc('0x52')][_0x2d1308](_0x54c212[_0x97dc('0x43')],_0x54c212[_0x97dc('0x47')][_0x97dc('0x44')],_0x54c212[_0x97dc('0x47')][_0x97dc('0x45')]);}break;case _0x97dc('0x55'):case'plainBody':_0x54c212=as[_0x97dc('0x40')]('me',null,_0x4e7eb0);_0x5db800[_0x97dc('0x55')][_0x2d1308](_0x54c212['text'],_0x54c212[_0x97dc('0x47')][_0x97dc('0x44')],_0x54c212['value'][_0x97dc('0x45')]);break;}}}return _0x5db800;}function parseModelFields(_0x3664b4,_0x49f81c,_0x224ca4){var _0x5e3256=utils[_0x97dc('0x6')](_0x3664b4);var _0x85e55e=squel[_0x97dc('0x24')]();var _0x3cd4a2=_(_0x49f81c)['keys']()['map'](function(_0x55212d){return _[_0x97dc('0x56')](_0x224ca4,[_0x97dc('0xc'),_0x55212d])?_0x55212d:undefined;})[_0x97dc('0x57')]()['value']();if(_0x3cd4a2['length']>0x0){_0x3cd4a2[_0x97dc('0x26')](function(_0x504541){if(_0x504541===_0x5e3256){_0x85e55e[_0x97dc('0x58')]('i.'+_0x5e3256+_0x97dc('0x19'),[][_0x97dc('0x59')](_0x49f81c[_0x504541]));}else if(_0x504541==='createdAt'){var _0x5a493b=JSON[_0x97dc('0x5a')](_0x49f81c[_0x504541])[_0x97dc('0x5b')];var _0x116926=JSON['parse'](_0x49f81c[_0x504541])['$lte'];_0x85e55e[_0x97dc('0x58')](_0x97dc('0x5c'),_0x5a493b,_0x116926);}else{if(_0x49f81c[_0x504541]===_0x97dc('0x5d')){_0x85e55e[_0x97dc('0x58')]('i.'+_0x504541+_0x97dc('0x5e'));}else{_0x85e55e[_0x97dc('0x58')]('i.'+_0x504541+'\x20=\x20?',_0x49f81c[_0x504541]);}}});}return _0x85e55e;}function parseQueryParameters(_0x5145a9,_0x35fe59,_0x4103ea){var _0x8ccf10=getSqlClauses();return Promise[_0x97dc('0x5f')]()['then'](function(){return parseModelFields(_0x5145a9,_0x35fe59,_0x4103ea);})[_0x97dc('0x60')](function(_0x4a8ea5){_0x8ccf10[_0x97dc('0x61')][_0x97dc('0x58')](_0x4a8ea5);return parseReadParameter(_0x35fe59['read']);})[_0x97dc('0x60')](function(_0x3343cb){_0x8ccf10[_0x97dc('0x48')][_0x97dc('0x58')](_0x3343cb);return parseTagParameter(_0x35fe59[_0x97dc('0x62')]);})[_0x97dc('0x60')](function(_0x344daa){_0x8ccf10[_0x97dc('0x4f')][_0x97dc('0x50')][_0x97dc('0x58')](_0x344daa);return parseSearchFilter(_0x5145a9,_0x35fe59[_0x97dc('0x63')]);})[_0x97dc('0x60')](function(_0x1515fb){_0x8ccf10[_0x97dc('0x63')]=_0x1515fb;return _0x8ccf10;});}function checkAccountsRestrictions(_0x1675d3,_0x1f39cc,_0x59abea){var _0xfd3878=utils[_0x97dc('0x6')](_0x1675d3);var _0x4ec1d5='get'+_[_0x97dc('0x64')](_0x1675d3)+(_0x1675d3===_0x97dc('0x65')?_0x97dc('0x66'):_0x97dc('0x67'));var _0x43320c=squel[_0x97dc('0x24')]();return Promise[_0x97dc('0x5f')]()[_0x97dc('0x60')](function(){if(_0x59abea[_0x97dc('0x9')]&&_0x1f39cc[_0x97dc('0x7')]===_0x97dc('0x8')){return _0x1f39cc[_0x4ec1d5]({'attributes':['id'],'raw':!![]});}})[_0x97dc('0x60')](function(_0xc678da){if(_0xc678da){if(_0xc678da['length']===0x0){_0x43320c[_0x97dc('0x58')]('i.'+_0xfd3878+_0x97dc('0x5e'));}else{_0x43320c['and']('i.'+_0xfd3878+'\x20IN\x20?',_[_0x97dc('0x68')](_0xc678da,'id'));}}else if(!_0x59abea[_0xfd3878]){_0x43320c[_0x97dc('0x58')]('i.'+_0xfd3878+_0x97dc('0x69'));}})[_0x97dc('0x60')](function(){return _0x43320c;});}function getClosedOrderClause(_0x441e22,_0x4ba3e0){var _0x18adb1='';var _0x2f1af3=['i.thirdDisposition','i.secondDisposition',_0x97dc('0x6a')];if(_0x441e22===_0x97dc('0x36')){_0x2f1af3[_0x97dc('0x6b')](_0x97dc('0x6c'));}if(_0x4ba3e0[_0x97dc('0x6d')]==='0'&&_0x441e22===_0x97dc('0x36')){_0x18adb1='i.substatus';}else{if(_0x4ba3e0[_0x97dc('0x6d')]==='1'){_0x2f1af3[_0x97dc('0x6e')]();}_0x18adb1=_0x97dc('0x6f')+_0x2f1af3[_0x97dc('0x70')](',\x20')+')';}return _0x18adb1;}function getFilteredInteractions(_0x1a863f,_0x367d28,_0x4f0276,_0x4a7faf){var _0x1c1280=utils[_0x97dc('0xf')](_0x1a863f);var _0x246d6f=_['capitalize'](_0x1a863f)+_0x97dc('0x71');var _0x46079c=[];var _0x43356c=getTagsQuery();var _0x43f464={'type':db[_0x97dc('0x72')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1fbff1=[];var _0x40f76b=[];return db[_0x97dc('0x73')]['query'](_0x43356c[_0x97dc('0x74')](),_0x43f464)[_0x97dc('0x60')](function(_0x46a7aa){_0x46079c=_[_0x97dc('0x75')](_0x46a7aa,'id');_0x43f464=_[_0x97dc('0x76')](_0x43f464,{'model':db[_0x246d6f],'mapToModel':!![],'nest':!![]});if(_0x4f0276['fields']){_0x4a7faf[_0x97dc('0x77')][_0x97dc('0x26')](function(_0x5b8c97){_0x367d28[_0x97dc('0xb')]('i.'+_0x5b8c97);});}else{_0x367d28[_0x97dc('0xb')](_0x97dc('0x78'),_0x97dc('0x46'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x79'),_0x97dc('0x7a'));_0x367d28[_0x97dc('0xb')]('a.mandatoryDisposition',_0x97dc('0x7b'));if(_0x1a863f==='mail'){_0x367d28[_0x97dc('0xb')](_0x97dc('0x7c'),'Account.email');_0x367d28[_0x97dc('0xb')](_0x97dc('0x7d'),_0x97dc('0x7e'));_0x367d28['field'](_0x97dc('0x7f'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x80'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x81'));_0x367d28[_0x97dc('0xb')]('i.closed');_0x367d28[_0x97dc('0xb')](_0x97dc('0x82'));_0x367d28['field'](_0x97dc('0x83'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x84'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x85'));_0x367d28['field'](_0x97dc('0x86'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x6a'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x87'));_0x367d28[_0x97dc('0xb')]('i.thirdDisposition');_0x367d28[_0x97dc('0xb')](_0x97dc('0x6c'));_0x367d28['field'](_0x97dc('0x88'));_0x367d28['field'](_0x97dc('0x89'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x8a'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x8b'));}else if(_0x1a863f==='openchannel'){_0x367d28[_0x97dc('0xb')](_0x97dc('0x8c'),'contactName');}else{_0x367d28[_0x97dc('0xb')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x97dc('0x7e'));}if(_0x1a863f!=='mail'){_0x367d28[_0x97dc('0xb')](_0x97dc('0x8d'));}_0x367d28[_0x97dc('0xb')](_0x97dc('0x8e'),'Contact.firstName');_0x367d28[_0x97dc('0xb')]('c.lastName',_0x97dc('0x8f'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x90'),_0x97dc('0x91'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x92'),_0x97dc('0x93'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x94'),_0x97dc('0x95'));_0x367d28[_0x97dc('0xb')]('c.fax',_0x97dc('0x96'));_0x367d28[_0x97dc('0xb')](_0x97dc('0x97'),_0x97dc('0x98'));_0x367d28['field'](_0x97dc('0x99'),_0x97dc('0x9a'));_0x367d28[_0x97dc('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x97dc('0x9b'));}if(_0x4a7faf[_0x97dc('0x9c')]){_0x367d28[_0x97dc('0x9c')](_0x4a7faf[_0x97dc('0x9c')]);}if(_0x4a7faf[_0x97dc('0x9d')]){_0x367d28[_0x97dc('0x9d')](_0x4a7faf[_0x97dc('0x9d')]);}return db[_0x97dc('0x73')][_0x97dc('0x9e')](_0x367d28[_0x97dc('0x74')](),_0x43f464);})[_0x97dc('0x60')](function(_0x551894){_0x1fbff1=_0x551894;var _0x27fc8e=getUsersQuery(_0x1a863f,_0x1fbff1);return db[_0x97dc('0x73')][_0x97dc('0x9e')](_0x27fc8e[_0x97dc('0x74')](),_0x43f464);})[_0x97dc('0x60')](function(_0x493ac8){_0x40f76b=_[_0x97dc('0x9f')](_0x493ac8,_0x1c1280);if(_0x1a863f==='mail'){return db[_0x97dc('0xa0')][_0x97dc('0xa1')]({'attributes':[_0x97dc('0xa2')],'raw':!![]});}})[_0x97dc('0x60')](function(_0x177c46){var _0x260653=_0x177c46?_0x177c46[_0x97dc('0xa2')]:undefined;var _0x30770d=_0x1fbff1['map'](function(_0x3aeb14){return updateInteraction(_0x3aeb14,_0x46079c,_0x40f76b,_0x260653);});return Promise[_0x97dc('0xa3')](_0x30770d);});}function countFilteredInteractions(_0x3fecd6,_0x3c8d9){var _0x52b2d0=_0x3fecd6['clone']();_0x52b2d0['field'](_0x97dc('0xa4'));_0x52b2d0[_0x97dc('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x535311=utils[_0x97dc('0x25')](_0x3c8d9);if(!_[_0x97dc('0xa5')](_0x535311)){_0x52b2d0[_0x97dc('0x18')](_0x97dc('0xa6'),_0x535311);}var _0x300b67={'type':db['Sequelize']['QueryTypes'][_0x97dc('0xa7')],'raw':!![]};return db[_0x97dc('0x73')][_0x97dc('0x9e')](_0x52b2d0['toString'](),_0x300b67);}module[_0x97dc('0xa8')]={'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 6a755ab..bd9b38a 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 _0xb93a=['MailMessage','findOne','out','plainBody','-id','catch','updateInteraction','then','Users','TagIds','lodash','../../mysqldb','fullname','split','forEach','push','waiting','unmanaged','abandoned','closed','disposition','UserId','answered','talking','total'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xb93a,0x6e));var _0xab93=function(_0x913044,_0x264705){_0x913044=_0x913044-0x0;var _0x1e9f6a=_0xb93a[_0x913044];return _0x1e9f6a;};'use strict';var _=require(_0xab93('0x0'));var db=require(_0xab93('0x1'))['db'];function getInteractionUsers(_0x143638,_0x4a848d){return new Promise(function(_0x4a0955,_0xaa052d){try{var _0x33f49c=[];if(_0x4a848d[_0x143638]){_0x33f49c=_0x4a848d[_0x143638]['map'](function(_0x707af){return{'id':_0x707af['id'],'fullname':_0x707af[_0xab93('0x2')]};});}return _0x4a0955(_0x33f49c);}catch(_0x40fbf7){_0xaa052d(_0x40fbf7);}});}function getInteractionTags(_0x4ca3ba,_0xcf882c){var _0x3d819b=[];if(_0x4ca3ba){_0x4ca3ba[_0xab93('0x3')](',')[_0xab93('0x4')](function(_0x1907fe){_0x3d819b[_0xab93('0x5')](_0xcf882c[_0x1907fe]);});}return _0x3d819b;}function updateWaitingCounter(_0x5a13c9){if(_0x5a13c9[_0xab93('0x6')]){_0x5a13c9[_0xab93('0x6')]-=0x1;}}function updateInteractionCounters(_0x57154e){_0x57154e['waiting']=0x0;_0x57154e['talking']=0x0;_0x57154e['answered']=0x0;_0x57154e[_0xab93('0x7')]=0x0;_0x57154e[_0xab93('0x8')]=0x0;_0x57154e['total']=0x0;if(_0x57154e[_0xab93('0x9')]){if(_0x57154e[_0xab93('0xa')]===_0xab93('0x8')){_0x57154e['abandoned']+=0x1;updateWaitingCounter(_0x57154e);}if(_0x57154e[_0xab93('0xb')]){_0x57154e[_0xab93('0xc')]+=0x1;if(_0x57154e['talking']){_0x57154e[_0xab93('0xd')]-=0x1;}}else{if(_0x57154e[_0xab93('0xa')]){_0x57154e[_0xab93('0x7')]+=0x1;updateWaitingCounter(_0x57154e);}}}else{if(!_0x57154e[_0xab93('0xb')]){_0x57154e[_0xab93('0x6')]+=0x1;}if(_0x57154e[_0xab93('0xb')]){_0x57154e[_0xab93('0xd')]+=0x1;updateWaitingCounter(_0x57154e);}}_0x57154e[_0xab93('0xe')]+=0x1;return _0x57154e;}function getLastMessageText(_0x14aada){return db[_0xab93('0xf')][_0xab93('0x10')]({'where':{'$and':[{'MailInteractionId':_0x14aada['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xab93('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xab93('0x12')],'order':_0xab93('0x13'),'raw':!![]})['then'](function(_0x60e7c){if(_0x60e7c&&_0x60e7c['plainBody']){_0x14aada['lastMsgText']=_['trimStart'](_0x60e7c[_0xab93('0x12')]);}return _0x14aada;})[_0xab93('0x14')](function(_0x2aeea5){throw _0x2aeea5;});}exports[_0xab93('0x15')]=function(_0x42cacb,_0x280da6,_0x3ade7c,_0x237519){return new Promise(function(_0x330dbf,_0x522cd1){return getInteractionUsers(_0x42cacb['id'],_0x3ade7c)[_0xab93('0x16')](function(_0x30aba7){_0x42cacb[_0xab93('0x17')]=_0x30aba7;return getInteractionTags(_0x42cacb[_0xab93('0x18')],_0x280da6);})['then'](function(_0x5130d5){_0x42cacb['Tags']=_0x5130d5;delete _0x42cacb[_0xab93('0x18')];return updateInteractionCounters(_0x42cacb);})[_0xab93('0x16')](function(_0x32be3a){if(_0x237519){return getLastMessageText(_0x32be3a);}else{return _0x32be3a;}})[_0xab93('0x16')](function(_0x3f7f69){_0x330dbf(_0x3f7f69);})['catch'](function(_0x59fdf8){_0x522cd1(_0x59fdf8);});});}; \ No newline at end of file +var _0x9e3a=['map','fullname','split','forEach','waiting','talking','unmanaged','abandoned','total','UserId','answered','disposition','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','updateInteraction','then','Users','Tags'];(function(_0x3c14a7,_0x1d9d42){var _0xb61709=function(_0x5a5095){while(--_0x5a5095){_0x3c14a7['push'](_0x3c14a7['shift']());}};_0xb61709(++_0x1d9d42);}(_0x9e3a,0xa8));var _0xa9e3=function(_0x1cc7dc,_0x1a53c0){_0x1cc7dc=_0x1cc7dc-0x0;var _0x40054b=_0x9e3a[_0x1cc7dc];return _0x40054b;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x3fa835,_0x468110){return new Promise(function(_0x4c694a,_0x5b0d51){try{var _0xe01291=[];if(_0x468110[_0x3fa835]){_0xe01291=_0x468110[_0x3fa835][_0xa9e3('0x0')](function(_0x4668a6){return{'id':_0x4668a6['id'],'fullname':_0x4668a6[_0xa9e3('0x1')]};});}return _0x4c694a(_0xe01291);}catch(_0x56e9bd){_0x5b0d51(_0x56e9bd);}});}function getInteractionTags(_0x12239c,_0x1a81ff){var _0x1c4144=[];if(_0x12239c){_0x12239c[_0xa9e3('0x2')](',')[_0xa9e3('0x3')](function(_0x43ff00){_0x1c4144['push'](_0x1a81ff[_0x43ff00]);});}return _0x1c4144;}function updateWaitingCounter(_0x564846){if(_0x564846[_0xa9e3('0x4')]){_0x564846['waiting']-=0x1;}}function updateInteractionCounters(_0x5c9c31){_0x5c9c31[_0xa9e3('0x4')]=0x0;_0x5c9c31[_0xa9e3('0x5')]=0x0;_0x5c9c31['answered']=0x0;_0x5c9c31[_0xa9e3('0x6')]=0x0;_0x5c9c31[_0xa9e3('0x7')]=0x0;_0x5c9c31[_0xa9e3('0x8')]=0x0;if(_0x5c9c31['closed']){if(_0x5c9c31['disposition']===_0xa9e3('0x7')){_0x5c9c31[_0xa9e3('0x7')]+=0x1;updateWaitingCounter(_0x5c9c31);}if(_0x5c9c31[_0xa9e3('0x9')]){_0x5c9c31[_0xa9e3('0xa')]+=0x1;if(_0x5c9c31[_0xa9e3('0x5')]){_0x5c9c31[_0xa9e3('0x5')]-=0x1;}}else{if(_0x5c9c31[_0xa9e3('0xb')]){_0x5c9c31[_0xa9e3('0x6')]+=0x1;updateWaitingCounter(_0x5c9c31);}}}else{if(!_0x5c9c31['UserId']){_0x5c9c31[_0xa9e3('0x4')]+=0x1;}if(_0x5c9c31[_0xa9e3('0x9')]){_0x5c9c31[_0xa9e3('0x5')]+=0x1;updateWaitingCounter(_0x5c9c31);}}_0x5c9c31['total']+=0x1;return _0x5c9c31;}function getLastMessageText(_0x57f371){return db[_0xa9e3('0xc')][_0xa9e3('0xd')]({'where':{'$and':[{'MailInteractionId':_0x57f371['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xa9e3('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xa9e3('0xf'),'raw':!![]})['then'](function(_0x4a9e13){if(_0x4a9e13&&_0x4a9e13[_0xa9e3('0x10')]){_0x57f371[_0xa9e3('0x11')]=_[_0xa9e3('0x12')](_0x4a9e13[_0xa9e3('0x10')]);}return _0x57f371;})[_0xa9e3('0x13')](function(_0x4742e4){throw _0x4742e4;});}exports[_0xa9e3('0x14')]=function(_0x13478c,_0x3f4892,_0x4ea247,_0x19878c){return new Promise(function(_0x3d1f10,_0x57ba39){return getInteractionUsers(_0x13478c['id'],_0x4ea247)[_0xa9e3('0x15')](function(_0x26ff45){_0x13478c[_0xa9e3('0x16')]=_0x26ff45;return getInteractionTags(_0x13478c['TagIds'],_0x3f4892);})[_0xa9e3('0x15')](function(_0x1037af){_0x13478c[_0xa9e3('0x17')]=_0x1037af;delete _0x13478c['TagIds'];return updateInteractionCounters(_0x13478c);})[_0xa9e3('0x15')](function(_0xd3934){if(_0x19878c){return getLastMessageText(_0xd3934);}else{return _0xd3934;}})[_0xa9e3('0x15')](function(_0x43b0b2){_0x3d1f10(_0x43b0b2);})['catch'](function(_0x1dda5c){_0x57ba39(_0x1dda5c);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index b0089ab..dcebee2 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 _0x377e=['unknown','chat','accounts','_interactions','_interaction_has_tags','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','InteractionId','upperFirst'];(function(_0x198fc6,_0x5eaee9){var _0x4376bb=function(_0x4b3241){while(--_0x4b3241){_0x198fc6['push'](_0x198fc6['shift']());}};_0x4376bb(++_0x5eaee9);}(_0x377e,0x1e2));var _0xe377=function(_0x181cbd,_0x51a26e){_0x181cbd=_0x181cbd-0x0;var _0x45b84c=_0x377e[_0x181cbd];return _0x45b84c;};'use strict';var _=require(_0xe377('0x0'));var db=require(_0xe377('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xe377('0x2')),'mail':require('../../config/logger')(_0xe377('0x3')),'fax':require(_0xe377('0x4'))(_0xe377('0x5')),'sms':require(_0xe377('0x4'))(_0xe377('0x6')),'chat':require('../../config/logger')(_0xe377('0x7')),'whatsapp':require('../../config/logger')(_0xe377('0x8'))};function getAccountFK(_0x3fac41){return _[_0xe377('0x9')](_0x3fac41)+(_0x3fac41==='chat'?_0xe377('0xa'):'Account')+'Id';}function getInteractionFK(_0x9fe23f){return _[_0xe377('0x9')](_0x9fe23f)+_0xe377('0xb');}function getInteractionId(_0x67dd6a,_0x4776dc,_0x2eca01){if(_0x67dd6a&&_0x67dd6a[_['upperFirst'](_0x2eca01)+_0xe377('0xb')]){return _0x67dd6a[_[_0xe377('0xc')](_0x2eca01)+_0xe377('0xb')];}else if(_0x67dd6a&&_0x67dd6a['id']){return _0x67dd6a['id'];}else if(_0x4776dc&&_0x4776dc['id']){return _0x4776dc['id'];}else{return _0xe377('0xd');}}function getInteractionsTables(_0x586bfb){return{'accounts':_0x586bfb+'_'+(_0x586bfb===_0xe377('0xe')?'websites':_0xe377('0xf')),'interactions':_0x586bfb+_0xe377('0x10'),'interactionsTags':_0x586bfb+_0xe377('0x11'),'messages':_0x586bfb+_0xe377('0x12'),'userInteractions':'user_has_'+_0x586bfb+_0xe377('0x10')};}function getSelectedTags(_0x2e1d9b){var _0x266931=[];if(_0x2e1d9b){_0x266931=Array[_0xe377('0x13')](_0x2e1d9b)?_0x2e1d9b:[_0x2e1d9b];}return _0x266931;}function log(_0x2aa4e6,_0x1c7302,_0x3c5a3a,_0x5879a5,_0x5f3434,_0x4b1578){loggers[_0x5f3434[_0xe377('0x14')]()][_0x2aa4e6](_0xe377('0x15'),_0x4b1578[_0xe377('0x16')](),_0x1c7302?_0x1c7302['id']:null,_0x1c7302?_0x1c7302[_0xe377('0x17')]:null,_0x1c7302?_0x1c7302[_0xe377('0x18')]:null,getInteractionId(_0x3c5a3a,_0x5879a5,_0x5f3434),_0x3c5a3a?JSON['stringify'](_0x3c5a3a):'null');}function updateUser(_0x16c1d2,_0x557d67,_0x20d236,_0x582af1,_0x1ff8f5){db[_[_0xe377('0xc')](_0x582af1)+_0xe377('0x19')][_0xe377('0x1a')]({'where':{'id':getInteractionId(_0x557d67,_0x20d236,_0x582af1)}})[_0xe377('0x1b')](function(_0x232fc4){if(_0x232fc4){return _0x232fc4[_0xe377('0x1c')]({'UserId':_0x16c1d2?_0x16c1d2['id']:null});}})['then'](function(_0xa150fa){if(_0xa150fa){log(_0xe377('0x1d'),_0x16c1d2,_0x557d67,_0x20d236,_0x582af1,_0x1ff8f5);}})[_0xe377('0x1e')](function(){log(_0xe377('0x1f'),_0x16c1d2,_0x557d67,_0x20d236,_0x582af1,_0x1ff8f5);});}module[_0xe377('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x947a=['capitalize','chat','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','name','null','findOne','then','update','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions'];(function(_0xbcf185,_0x251002){var _0x2ae4de=function(_0x26f5d2){while(--_0x26f5d2){_0xbcf185['push'](_0xbcf185['shift']());}};_0x2ae4de(++_0x251002);}(_0x947a,0x6f));var _0xa947=function(_0x2d5f67,_0x125f70){_0x2d5f67=_0x2d5f67-0x0;var _0x4c0890=_0x947a[_0x2d5f67];return _0x4c0890;};'use strict';var _=require(_0xa947('0x0'));var db=require(_0xa947('0x1'))['db'];var loggers={'openchannel':require(_0xa947('0x2'))(_0xa947('0x3')),'mail':require(_0xa947('0x2'))(_0xa947('0x4')),'fax':require('../../config/logger')(_0xa947('0x5')),'sms':require(_0xa947('0x2'))(_0xa947('0x6')),'chat':require(_0xa947('0x2'))(_0xa947('0x7')),'whatsapp':require(_0xa947('0x2'))(_0xa947('0x8'))};function getAccountFK(_0x30cdf0){return _[_0xa947('0x9')](_0x30cdf0)+(_0x30cdf0===_0xa947('0xa')?'Website':_0xa947('0xb'))+'Id';}function getInteractionFK(_0xe84b7f){return _['capitalize'](_0xe84b7f)+'InteractionId';}function getInteractionId(_0x289e93,_0x227ead,_0x5a7519){if(_0x289e93&&_0x289e93[_['upperFirst'](_0x5a7519)+_0xa947('0xc')]){return _0x289e93[_[_0xa947('0xd')](_0x5a7519)+_0xa947('0xc')];}else if(_0x289e93&&_0x289e93['id']){return _0x289e93['id'];}else if(_0x227ead&&_0x227ead['id']){return _0x227ead['id'];}else{return _0xa947('0xe');}}function getInteractionsTables(_0x13672d){return{'accounts':_0x13672d+'_'+(_0x13672d==='chat'?_0xa947('0xf'):_0xa947('0x10')),'interactions':_0x13672d+_0xa947('0x11'),'interactionsTags':_0x13672d+_0xa947('0x12'),'messages':_0x13672d+_0xa947('0x13'),'userInteractions':_0xa947('0x14')+_0x13672d+_0xa947('0x11')};}function getSelectedTags(_0x599647){var _0x248eeb=[];if(_0x599647){_0x248eeb=Array[_0xa947('0x15')](_0x599647)?_0x599647:[_0x599647];}return _0x248eeb;}function log(_0x1cdabc,_0x372627,_0x396a23,_0x43ff52,_0x3133ea,_0x50ac19){loggers[_0x3133ea['toLowerCase']()][_0x1cdabc]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x50ac19['toUpperCase'](),_0x372627?_0x372627['id']:null,_0x372627?_0x372627[_0xa947('0x16')]:null,_0x372627?_0x372627['role']:null,getInteractionId(_0x396a23,_0x43ff52,_0x3133ea),_0x396a23?JSON['stringify'](_0x396a23):_0xa947('0x17'));}function updateUser(_0x15cbad,_0x5d4cfe,_0x3532da,_0x3bbba1,_0x4f8e7f){db[_[_0xa947('0xd')](_0x3bbba1)+'Interaction'][_0xa947('0x18')]({'where':{'id':getInteractionId(_0x5d4cfe,_0x3532da,_0x3bbba1)}})[_0xa947('0x19')](function(_0x4904d5){if(_0x4904d5){return _0x4904d5[_0xa947('0x1a')]({'UserId':_0x15cbad?_0x15cbad['id']:null});}})[_0xa947('0x19')](function(_0x3904d6){if(_0x3904d6){log('info',_0x15cbad,_0x5d4cfe,_0x3532da,_0x3bbba1,_0x4f8e7f);}})[_0xa947('0x1b')](function(){log(_0xa947('0x1c'),_0x15cbad,_0x5d4cfe,_0x3532da,_0x3bbba1,_0x4f8e7f);});}module[_0xa947('0x1d')]={'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 d3f1235..67be997 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 _0x494c=['then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','parse','hasOwnProperty','use','License','findOne'];(function(_0x54691e,_0x28b041){var _0x5520b2=function(_0x501a05){while(--_0x501a05){_0x54691e['push'](_0x54691e['shift']());}};_0x5520b2(++_0x28b041);}(_0x494c,0x96));var _0xc494=function(_0x44a25c,_0x57220a){_0x44a25c=_0x44a25c-0x0;var _0x51c47e=_0x494c[_0x44a25c];return _0x51c47e;};'use strict';var crypto=require(_0xc494('0x0'));var util=require(_0xc494('0x1'));var compose=require(_0xc494('0x2'));var db=require(_0xc494('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1d1e6d,_0xf53b90){if(_0x1d1e6d&&_0xf53b90){if(_0xf53b90[_0xc494('0x4')]&&_0xf53b90['license']){var _0x1c7b78=_0xf53b90[_0xc494('0x4')];var _0x536705=_0xf53b90[_0xc494('0x5')];var _0x8ed610=_0x1c7b78[_0xc494('0x6')]('-')[0x4];var _0x3f3578=_0x1c7b78[_0xc494('0x6')]('-')[0x0];var _0x3a2601=crypto[_0xc494('0x7')](_0xc494('0x8'),util[_0xc494('0x9')](_0xc494('0xa'),_0x8ed610,_0x1c7b78,_0x3f3578));var _0x456df2=_0x3a2601[_0xc494('0xb')](_0x536705,'base64',_0xc494('0xc'));_0x456df2+=_0x3a2601['final'](_0xc494('0xc'));var _0x3fa2a3=JSON[_0xc494('0xd')](_0x456df2);return _0x3fa2a3[_0xc494('0xe')](_0x1d1e6d)?_0x3fa2a3[_0x1d1e6d]:null;}}return null;}function isLimit(_0x510f7f,_0x2243f1,_0x20ba1d,_0x5f2bad){var _0x54d96a=_0x2243f1;return compose()[_0xc494('0xf')](function(_0xe58bfa,_0x47d44c,_0x570915){return db[_0xc494('0x10')][_0xc494('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xc494('0x12')](function(_0x5cb562){var _0x5e0b05=getValueFromLicense(_0x510f7f,_0x5cb562);return _0x5e0b05?_0x5e0b05:_0x54d96a;})['then'](function(_0x1b1825){_0x54d96a=_0x1b1825;return _0x20ba1d['count'](_0x5f2bad);})['then'](function(_0x186865){if(_0x186865>=_0x54d96a){return _0x47d44c[_0xc494('0x13')](0x193)[_0xc494('0x14')]({'message':util[_0xc494('0x9')](_0xc494('0x15'),_0x510f7f)});}_0x570915();})[_0xc494('0x16')](function(_0x355205){_0x570915(_0x355205);});});}function isUserLimit(){return isLimit(_0xc494('0x17'),0x1,db[_0xc494('0x18')],{'where':{'$or':[{'role':_0xc494('0x19')},{'role':_0xc494('0x1a')}]}});}exports[_0xc494('0x1b')]=isUserLimit; \ No newline at end of file +var _0x67cc=['hasOwnProperty','use','findOne','then','count','status','json','User','admin','user','crypto','../../mysqldb','license','split','aes-256-ctr','format','update','base64','final','utf8','parse'];(function(_0xe68532,_0x17cacb){var _0x280061=function(_0x44c594){while(--_0x44c594){_0xe68532['push'](_0xe68532['shift']());}};_0x280061(++_0x17cacb);}(_0x67cc,0xf1));var _0xc67c=function(_0x5e71ec,_0x420604){_0x5e71ec=_0x5e71ec-0x0;var _0x3c3eb5=_0x67cc[_0x5e71ec];return _0x3c3eb5;};'use strict';var crypto=require(_0xc67c('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0xc67c('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3aaffb,_0x4d2d0e){if(_0x3aaffb&&_0x4d2d0e){if(_0x4d2d0e['data1']&&_0x4d2d0e[_0xc67c('0x2')]){var _0x58c4b8=_0x4d2d0e['data1'];var _0x336c2e=_0x4d2d0e[_0xc67c('0x2')];var _0x1ad64=_0x58c4b8[_0xc67c('0x3')]('-')[0x4];var _0x1558b8=_0x58c4b8[_0xc67c('0x3')]('-')[0x0];var _0x2897a9=crypto['createDecipher'](_0xc67c('0x4'),util[_0xc67c('0x5')]('%s:%s:%s',_0x1ad64,_0x58c4b8,_0x1558b8));var _0x543934=_0x2897a9[_0xc67c('0x6')](_0x336c2e,_0xc67c('0x7'),'utf8');_0x543934+=_0x2897a9[_0xc67c('0x8')](_0xc67c('0x9'));var _0x5dda92=JSON[_0xc67c('0xa')](_0x543934);return _0x5dda92[_0xc67c('0xb')](_0x3aaffb)?_0x5dda92[_0x3aaffb]:null;}}return null;}function isLimit(_0x278ec8,_0x3f8af8,_0x27c3f2,_0x45ebc6){var _0x339168=_0x3f8af8;return compose()[_0xc67c('0xc')](function(_0x1013ee,_0x3a48e9,_0x43b13e){return db['License'][_0xc67c('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xc67c('0xe')](function(_0x3df939){var _0x42d832=getValueFromLicense(_0x278ec8,_0x3df939);return _0x42d832?_0x42d832:_0x339168;})[_0xc67c('0xe')](function(_0x4dc706){_0x339168=_0x4dc706;return _0x27c3f2[_0xc67c('0xf')](_0x45ebc6);})['then'](function(_0x4f1545){if(_0x4f1545>=_0x339168){return _0x3a48e9[_0xc67c('0x10')](0x193)[_0xc67c('0x11')]({'message':util[_0xc67c('0x5')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x278ec8)});}_0x43b13e();})['catch'](function(_0x4fffc7){_0x43b13e(_0x4fffc7);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc67c('0x12')],{'where':{'$or':[{'role':_0xc67c('0x13')},{'role':_0xc67c('0x14')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index d3b592d..bb80108 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 _0xa3df=['castTo','text','field','\x20AS\x20','operator','$ne','$notIn','\x20OR\x20','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','hours','parseSearch','sqlOperator','[$or]','and','[$and]','replace','split','length','slice','match','forEach','filter','indexOf','push','buildExpression','DATE','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD'];(function(_0x59a967,_0x26e592){var _0xba7627=function(_0x354ac5){while(--_0x354ac5){_0x59a967['push'](_0x59a967['shift']());}};_0xba7627(++_0x26e592);}(_0xa3df,0x7a));var _0xfa3d=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xa3df[_0x18a436];return _0x5c2cf8;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xfa3d('0x0')]=function(_0x183b6f){var _0xb2f72b={'conditions':[]};_0xb2f72b[_0xfa3d('0x1')]=_['startsWith'](_0x183b6f,_0xfa3d('0x2'))?'or':_0xfa3d('0x3');var _0x5bf49d=_0x183b6f['replace'](_0xfa3d('0x4'),'')[_0xfa3d('0x5')](_0xfa3d('0x2'),'')[_0xfa3d('0x6')]('||');for(var _0xdb8fa1=0x0;_0xdb8fa1<_0x5bf49d[_0xfa3d('0x7')];_0xdb8fa1++){var _0x5db299=_0x5bf49d[_0xdb8fa1][_0xfa3d('0x6')](':=');var _0x4a7abb=_0x5db299[0x0];var _0x148133=_0x5db299[_0xfa3d('0x8')](0x1);_0x148133['forEach'](function(_0x48c553){var _0x2e95c7=_0x48c553['split']('[')['shift']();var _0xb4f071=_0x48c553[_0xfa3d('0x9')](/\[(.*?)\]/g);_0xb4f071[_0xfa3d('0xa')](function(_0x1ae8dc){var _0x253292=_0x1ae8dc[_0xfa3d('0x6')]('[')[_0xfa3d('0xb')](function(_0x4bfc1b){return _0x4bfc1b[_0xfa3d('0xc')](']')>-0x1;})['map'](function(_0x2a404a){return _0x2a404a[_0xfa3d('0x6')](']')[0x0];})[0x0];_0xb2f72b['conditions'][_0xfa3d('0xd')]({'field':_0x4a7abb,'operator':_0x2e95c7,'value':_0x253292});});});}return _0xb2f72b;};exports[_0xfa3d('0xe')]=function(_0x5943f3,_0x13f076,_0x596d33){var _0x4246d4={};if(_0x13f076===_0xfa3d('0xf')){if(_0x596d33['operator']==='$eq'){_0x596d33['operator']=_0xfa3d('0x10');_0x596d33[_0xfa3d('0x11')]+=','+_0x596d33[_0xfa3d('0x11')];}else if(_[_0xfa3d('0x12')]([_0xfa3d('0x13'),_0xfa3d('0x14')],_0x596d33['operator'])){_0x596d33[_0xfa3d('0x11')]=moment(_0x596d33[_0xfa3d('0x11')])[_0xfa3d('0x15')](0x1,_0xfa3d('0x16'))[_0xfa3d('0x17')](_0xfa3d('0x18'));}}if(_0x596d33[_0xfa3d('0x19')]){_0x13f076=_0x596d33[_0xfa3d('0x19')];_0x4246d4[_0xfa3d('0x1a')]='CAST('+_0x5943f3+'.'+_0x596d33[_0xfa3d('0x1b')]+_0xfa3d('0x1c')+_0x596d33[_0xfa3d('0x19')]+')\x20'+parseOperator(_0x596d33[_0xfa3d('0x1d')]);}else{_0x4246d4[_0xfa3d('0x1a')]=_0x5943f3+'.'+_0x596d33['field']+'\x20'+parseOperator(_0x596d33[_0xfa3d('0x1d')]);}if(_[_0xfa3d('0x12')]([_0xfa3d('0x1e'),_0xfa3d('0x1f')],_0x596d33['operator']))_0x4246d4[_0xfa3d('0x1a')]='('+_0x4246d4[_0xfa3d('0x1a')]+_0xfa3d('0x20')+_0x5943f3+'.'+_0x596d33['field']+'\x20IS\x20NULL)';_0x4246d4[_0xfa3d('0x11')]=parseValue(_0x13f076,_0x596d33[_0xfa3d('0x1d')],_0x596d33[_0xfa3d('0x11')]);return _0x4246d4;};function parseOperator(_0x282cc0){var _0x44fe33;switch(_0x282cc0){case'$in':_0x44fe33='IN\x20?';break;case _0xfa3d('0x1f'):_0x44fe33=_0xfa3d('0x21');break;case _0xfa3d('0x22'):_0x44fe33='=\x20?';break;case _0xfa3d('0x1e'):_0x44fe33=_0xfa3d('0x23');break;case _0xfa3d('0x24'):case _0xfa3d('0x25'):case _0xfa3d('0x26'):_0x44fe33='LIKE\x20?';break;case _0xfa3d('0x27'):_0x44fe33='<\x20?';break;case _0xfa3d('0x13'):_0x44fe33=_0xfa3d('0x28');break;case'$lte':_0x44fe33=_0xfa3d('0x29');break;case _0xfa3d('0x2a'):_0x44fe33=_0xfa3d('0x2b');break;case _0xfa3d('0x10'):_0x44fe33=_0xfa3d('0x2c');break;}return _0x44fe33;}function parseValue(_0x3faeb6,_0x51eaac,_0x89cbde){var _0x589539={'start':undefined,'end':undefined};switch(_0x51eaac){case'$in':case _0xfa3d('0x1f'):_0x589539[_0xfa3d('0x2d')]=_0x89cbde[_0xfa3d('0x6')](',');break;case _0xfa3d('0x24'):_0x589539['start']='%'+_0x89cbde+'%';break;case _0xfa3d('0x25'):_0x589539[_0xfa3d('0x2d')]=_0x89cbde+'%';break;case _0xfa3d('0x26'):_0x589539[_0xfa3d('0x2d')]='%'+_0x89cbde;break;case _0xfa3d('0x10'):var _0x425218=_0x89cbde[_0xfa3d('0x6')](',');var _0x89cbde=_0x425218[_0xfa3d('0x2e')]();var _0x214330=_0x425218[_0xfa3d('0x2f')]();if(_0x3faeb6==='DATE'){_0x89cbde=moment(_0x89cbde)['utcOffset'](0x0,!![])[_0xfa3d('0x17')]();_0x214330=moment(_0x214330)['utcOffset'](0x0,!![])[_0xfa3d('0x15')](0x17,_0xfa3d('0x30'))[_0xfa3d('0x15')](0x3b,'minutes')[_0xfa3d('0x15')](0x3b,'seconds')[_0xfa3d('0x17')]();}_0x589539={'start':_0x89cbde,'end':_0x214330};break;default:_0x589539[_0xfa3d('0x2d')]=_0x89cbde;break;}return _0x589539;} \ No newline at end of file +var _0xa8dc=['value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','CAST(','field','text','$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','forEach','shift','indexOf','map','push','buildExpression','operator','$eq','$between'];(function(_0x5dab7c,_0x2f59d0){var _0x878c2a=function(_0x30c161){while(--_0x30c161){_0x5dab7c['push'](_0x5dab7c['shift']());}};_0x878c2a(++_0x2f59d0);}(_0xa8dc,0x1ca));var _0xca8d=function(_0x53f539,_0x4b348a){_0x53f539=_0x53f539-0x0;var _0x5114ce=_0xa8dc[_0x53f539];return _0x5114ce;};'use strict';var _=require(_0xca8d('0x0'));var moment=require(_0xca8d('0x1'));exports[_0xca8d('0x2')]=function(_0x4327bd){var _0x3c04e0={'conditions':[]};_0x3c04e0[_0xca8d('0x3')]=_[_0xca8d('0x4')](_0x4327bd,_0xca8d('0x5'))?'or':_0xca8d('0x6');var _0x1a6caa=_0x4327bd[_0xca8d('0x7')](_0xca8d('0x8'),'')[_0xca8d('0x7')]('[$or]','')[_0xca8d('0x9')]('||');for(var _0x54fb73=0x0;_0x54fb73<_0x1a6caa['length'];_0x54fb73++){var _0x42ff47=_0x1a6caa[_0x54fb73][_0xca8d('0x9')](':=');var _0x160542=_0x42ff47[0x0];var _0x2932b8=_0x42ff47['slice'](0x1);_0x2932b8[_0xca8d('0xa')](function(_0x2b6eb2){var _0x4e0ff9=_0x2b6eb2['split']('[')[_0xca8d('0xb')]();var _0x4b5b19=_0x2b6eb2['match'](/\[(.*?)\]/g);_0x4b5b19[_0xca8d('0xa')](function(_0x57acda){var _0x29a325=_0x57acda[_0xca8d('0x9')]('[')['filter'](function(_0x429cda){return _0x429cda[_0xca8d('0xc')](']')>-0x1;})[_0xca8d('0xd')](function(_0x36a859){return _0x36a859[_0xca8d('0x9')](']')[0x0];})[0x0];_0x3c04e0['conditions'][_0xca8d('0xe')]({'field':_0x160542,'operator':_0x4e0ff9,'value':_0x29a325});});});}return _0x3c04e0;};exports[_0xca8d('0xf')]=function(_0x4bd8a9,_0x469249,_0x232aaa){var _0x1a29a2={};if(_0x469249==='DATE'){if(_0x232aaa[_0xca8d('0x10')]===_0xca8d('0x11')){_0x232aaa[_0xca8d('0x10')]=_0xca8d('0x12');_0x232aaa[_0xca8d('0x13')]+=','+_0x232aaa[_0xca8d('0x13')];}else if(_[_0xca8d('0x14')]([_0xca8d('0x15'),_0xca8d('0x16')],_0x232aaa[_0xca8d('0x10')])){_0x232aaa[_0xca8d('0x13')]=moment(_0x232aaa[_0xca8d('0x13')])[_0xca8d('0x17')](0x1,_0xca8d('0x18'))[_0xca8d('0x19')](_0xca8d('0x1a'));}}if(_0x232aaa[_0xca8d('0x1b')]){_0x469249=_0x232aaa[_0xca8d('0x1b')];_0x1a29a2['text']=_0xca8d('0x1c')+_0x4bd8a9+'.'+_0x232aaa[_0xca8d('0x1d')]+'\x20AS\x20'+_0x232aaa[_0xca8d('0x1b')]+')\x20'+parseOperator(_0x232aaa[_0xca8d('0x10')]);}else{_0x1a29a2[_0xca8d('0x1e')]=_0x4bd8a9+'.'+_0x232aaa['field']+'\x20'+parseOperator(_0x232aaa['operator']);}if(_[_0xca8d('0x14')]([_0xca8d('0x1f'),_0xca8d('0x20')],_0x232aaa[_0xca8d('0x10')]))_0x1a29a2['text']='('+_0x1a29a2['text']+_0xca8d('0x21')+_0x4bd8a9+'.'+_0x232aaa['field']+'\x20IS\x20NULL)';_0x1a29a2[_0xca8d('0x13')]=parseValue(_0x469249,_0x232aaa['operator'],_0x232aaa['value']);return _0x1a29a2;};function parseOperator(_0x3ffb0c){var _0x39f239;switch(_0x3ffb0c){case _0xca8d('0x22'):_0x39f239=_0xca8d('0x23');break;case'$notIn':_0x39f239='NOT\x20IN\x20?';break;case _0xca8d('0x11'):_0x39f239=_0xca8d('0x24');break;case _0xca8d('0x1f'):_0x39f239=_0xca8d('0x25');break;case _0xca8d('0x26'):case _0xca8d('0x27'):case _0xca8d('0x28'):_0x39f239='LIKE\x20?';break;case'$lt':_0x39f239='<\x20?';break;case _0xca8d('0x15'):_0x39f239=_0xca8d('0x29');break;case _0xca8d('0x16'):_0x39f239=_0xca8d('0x2a');break;case _0xca8d('0x2b'):_0x39f239=_0xca8d('0x2c');break;case _0xca8d('0x12'):_0x39f239=_0xca8d('0x2d');break;}return _0x39f239;}function parseValue(_0x3914af,_0x5972d5,_0x2a9820){var _0x406e15={'start':undefined,'end':undefined};switch(_0x5972d5){case _0xca8d('0x22'):case _0xca8d('0x20'):_0x406e15[_0xca8d('0x2e')]=_0x2a9820[_0xca8d('0x9')](',');break;case'$substring':_0x406e15[_0xca8d('0x2e')]='%'+_0x2a9820+'%';break;case _0xca8d('0x27'):_0x406e15[_0xca8d('0x2e')]=_0x2a9820+'%';break;case _0xca8d('0x28'):_0x406e15['start']='%'+_0x2a9820;break;case _0xca8d('0x12'):var _0x26f350=_0x2a9820[_0xca8d('0x9')](',');var _0x2a9820=_0x26f350[_0xca8d('0xb')]();var _0x44d183=_0x26f350[_0xca8d('0x2f')]();if(_0x3914af===_0xca8d('0x30')){_0x2a9820=moment(_0x2a9820)[_0xca8d('0x31')](0x0,!![])[_0xca8d('0x19')]();_0x44d183=moment(_0x44d183)[_0xca8d('0x31')](0x0,!![])[_0xca8d('0x17')](0x17,_0xca8d('0x32'))[_0xca8d('0x17')](0x3b,_0xca8d('0x33'))['add'](0x3b,_0xca8d('0x34'))[_0xca8d('0x19')]();}_0x406e15={'start':_0x2a9820,'end':_0x44d183};break;default:_0x406e15['start']=_0x2a9820;break;}return _0x406e15;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a578b65..3c64add 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 _0x3b40=['model','limit','where','object','filter','columns','type','lower','merge','lodash','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','isPlainObject','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','split','offset','sort','indexOf','cast','col','priority','unsigned','substr','DESC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','query','$id','intersection','attributes'];(function(_0x2f425b,_0x59e509){var _0xd94cfb=function(_0x2fd4db){while(--_0x2fd4db){_0x2f425b['push'](_0x2f425b['shift']());}};_0xd94cfb(++_0x59e509);}(_0x3b40,0xba));var _0x03b4=function(_0x41c0d0,_0x6cdf4c){_0x41c0d0=_0x41c0d0-0x0;var _0x979747=_0x3b40[_0x41c0d0];return _0x979747;};'use strict';var _=require(_0x03b4('0x0'));var sequelize=require(_0x03b4('0x1'));var moment=require(_0x03b4('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x38d260){var _0x2ef6f3=['ne'];try{var _0x589d35=JSON[_0x03b4('0x3')](_0x38d260);var _0x426bdb=Object[_0x03b4('0x4')](_0x589d35)[0x0];return _0x2ef6f3[_0x03b4('0x5')](_0x426bdb);}catch(_0x45a788){return![];}}function getOperatorValue(_0x199091){var _0x1ffdb3=JSON[_0x03b4('0x3')](_0x199091);var _0x29d8dd=Object[_0x03b4('0x4')](_0x1ffdb3)[0x0];var _0x4d6f45=_0x1ffdb3[_0x29d8dd];return{['$'+_0x29d8dd]:_0x4d6f45};}exports[_0x03b4('0x6')]=function(_0x34fcf6){var _0x301146=null;if(_0x34fcf6){_0x301146=_0x34fcf6['split'](',');}return _0x301146;};exports[_0x03b4('0x7')]=function(_0x128c4f,_0x2b9d84){var _0x2d39c9={};if(!_[_0x03b4('0x8')](_0x128c4f)){_[_0x03b4('0x9')](_0x128c4f,function(_0x22ddb2,_0x3d4c07){try{if(_0x2b9d84){var _0x316473=_['find'](_0x2b9d84,{'name':_0x3d4c07})||{};if(hasSequelizeOperator(_0x22ddb2)){_0x2d39c9[_0x3d4c07]=getOperatorValue(_0x22ddb2);}else if(_0x316473['type']==='DATE'&&_[_0x03b4('0xa')](_0x22ddb2)){var _0x246712=JSON[_0x03b4('0x3')](_0x22ddb2);var _0x227d74={'$gte':moment(moment(_0x246712['$gte'])['format'](_0x03b4('0xb')))[_0x03b4('0xc')]()[_0x03b4('0xd')](),'$lte':moment(moment(_0x246712[_0x03b4('0xe')])[_0x03b4('0xd')]('YYYY-MM-DD'))[_0x03b4('0xc')]()[_0x03b4('0xf')](0x1,'s')['format']()};_0x2d39c9[_0x3d4c07]=_0x227d74;}else if(_0x316473[_0x03b4('0x10')]===_0x03b4('0x11')){_0x2d39c9[_0x3d4c07]=_0x22ddb2;}else{_0x2d39c9[_0x3d4c07]=_[_0x03b4('0x12')](_0x22ddb2)?_0x22ddb2:JSON[_0x03b4('0x3')](_0x22ddb2);}}else{_0x2d39c9[_0x3d4c07]=_[_0x03b4('0x12')](_0x22ddb2)?_0x22ddb2:JSON[_0x03b4('0x3')](_0x22ddb2);}}catch(_0x3d4573){_0x2d39c9[_0x3d4c07]=_0x22ddb2[_0x03b4('0x13')](',');}});}return _0x2d39c9;};exports['limit']=function(_0x3b6462){_0x3b6462=parseInt(_0x3b6462,0xa);if(!_0x3b6462||_0x3b6462<0x0){_0x3b6462=LIMIT_VALUE;}return _0x3b6462;};exports[_0x03b4('0x14')]=function(_0x5d299d){_0x5d299d=parseInt(_0x5d299d,0xa);if(!_0x5d299d||_0x5d299d<0x0){_0x5d299d=0x0;}return _0x5d299d;};exports[_0x03b4('0x15')]=function(_0x635a6d){var _0x1592af,_0x4bb6ae=null;if(_0x635a6d){_0x1592af=_0x635a6d[_0x03b4('0x13')](',');_0x4bb6ae=_['map'](_0x1592af,function(_0x3ebac7){if(_0x3ebac7[_0x03b4('0x16')]('-')===0x0){return[_0x3ebac7==='priority'?sequelize[_0x03b4('0x17')](sequelize[_0x03b4('0x18')](_0x03b4('0x19')),_0x03b4('0x1a')):_0x3ebac7[_0x03b4('0x1b')](0x1),_0x03b4('0x1c')];}else{return[_0x3ebac7===_0x03b4('0x19')?sequelize[_0x03b4('0x17')](sequelize[_0x03b4('0x18')](_0x03b4('0x19')),_0x03b4('0x1a')):_0x3ebac7,'ASC'];}});}return _0x4bb6ae;};exports[_0x03b4('0x1d')]=function(_0xea8765,_0x5b6b56){if(_['isEmpty'](_0xea8765)){return _0xea8765;}if(_[_0x03b4('0x12')](_0xea8765)){for(var _0x418b33=0x0;_0x418b33<_0xea8765[_0x03b4('0x1e')];_0x418b33+=0x1){_0xea8765[_0x418b33]=this['omit'](_0xea8765[_0x418b33],_0x5b6b56);}return _0xea8765;}if(!_[_0x03b4('0x1f')](_0xea8765)){return _0xea8765;}if(_[_0x03b4('0x20')](_0x5b6b56)){_0x5b6b56=[_0x5b6b56];}if(!_[_0x03b4('0x12')](_0x5b6b56)){return _0xea8765;}for(var _0x32a791=0x0;_0x32a791<_0x5b6b56[_0x03b4('0x1e')];_0x32a791+=0x1){_[_0x03b4('0x21')](_0xea8765,_0x5b6b56[_0x32a791]);}for(var _0x558af2 in _0xea8765){if(_0xea8765[_0x03b4('0x22')](_0x558af2)){_0xea8765[_0x558af2]=this[_0x03b4('0x1d')](_0xea8765[_0x558af2],_0x5b6b56);}}return _0xea8765;};exports[_0x03b4('0x23')]=function(_0x20d836){return _0x20d836[_0x03b4('0x24')](RegExp(_0x03b4('0x25')))?!![]:![];};exports[_0x03b4('0x26')]=function(_0x55000e){return _0x55000e[_0x03b4('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x03b4('0x27')]=function(_0x5a1228,_0x22ab53){var _0x30f8a9=[];var _0x45ef45=/[ `!@#$%^&*()_\-?~]/;var _0x49c209=_0x22ab53?_0x03b4('0x28'):_0x03b4('0x29');_0x5a1228[_0x03b4('0x13')](/[ ,]+/)['forEach'](function(_0x4799c9){_0x4799c9=_0x4799c9[_0x03b4('0x2a')](/([^:]")"+/g,'$1');_0x4799c9='+'+_0x4799c9+'*';var _0x5d60b8=_0x4799c9[_0x03b4('0x24')](_0x45ef45);if(_0x5d60b8){_0x4799c9='\x22'+_0x4799c9+'\x22';}_0x30f8a9[_0x03b4('0x2b')](_0x4799c9);});_0x49c209=_0x49c209['replace']('{EXPR}',_0x30f8a9[_0x03b4('0x2c')]('\x20'));return _0x49c209;};exports[_0x03b4('0x2d')]=function(_0x16081a,_0x42d249,_0x31ca19){var _0xe23ce5={},_0x47c7b6={};if(_0x42d249[_0x03b4('0x2e')][_0x03b4('0x2f')]){_0x42d249[_0x03b4('0x2e')]['id']=_0x42d249[_0x03b4('0x2e')]['$id'];delete _0x42d249[_0x03b4('0x2e')][_0x03b4('0x2f')];}_0xe23ce5['model']=_['map'](_0x16081a,_0x03b4('0x10'));_0xe23ce5[_0x03b4('0x2e')]=_[_0x03b4('0x4')](_0x42d249[_0x03b4('0x2e')]);_0xe23ce5['filters']=_[_0x03b4('0x30')](_0xe23ce5['model'],_0xe23ce5[_0x03b4('0x2e')]);_0x47c7b6[_0x03b4('0x31')]=_['intersection'](_0xe23ce5[_0x03b4('0x32')],this[_0x03b4('0x6')](_0x42d249[_0x03b4('0x2e')][_0x03b4('0x6')]));_0x47c7b6['attributes']=_0x47c7b6[_0x03b4('0x31')]['length']?_0x47c7b6['attributes']:_0xe23ce5['model'];if(!_0x42d249[_0x03b4('0x2e')][_0x03b4('0x22')]('nolimit')){_0x47c7b6[_0x03b4('0x33')]=this['limit'](_0x42d249[_0x03b4('0x2e')][_0x03b4('0x33')]);_0x47c7b6['offset']=this[_0x03b4('0x14')](_0x42d249[_0x03b4('0x2e')][_0x03b4('0x14')]);}_0x47c7b6['order']=this[_0x03b4('0x15')](_0x42d249['query'][_0x03b4('0x15')]);_0x47c7b6[_0x03b4('0x34')]=this[_0x03b4('0x7')](_['pick'](_0x42d249['query'],_0xe23ce5['filters']),_0x16081a);if(_0x42d249['query']['filter']){var _0x62e6ab=_0x16081a;var _0x55ad3e=_0x42d249[_0x03b4('0x2e')]['filter'];if(typeof _0x55ad3e===_0x03b4('0x35')){_0x62e6ab=_[_0x03b4('0x36')](_0x16081a,function(_0x43e583){return _['includes'](_0x55ad3e[_0x03b4('0x37')],_0x43e583[_0x03b4('0x10')]);});_0x55ad3e=_0x55ad3e['value'];}_0x47c7b6[_0x03b4('0x34')]=_['merge'](_0x47c7b6[_0x03b4('0x34')],{'$or':_['map'](_0x62e6ab,function(_0x187fb1){if(_0x187fb1[_0x03b4('0x38')]!=='VIRTUAL'){if(_0x31ca19){return sequelize[_0x03b4('0x34')](sequelize['fn']('lower',sequelize[_0x03b4('0x18')](_0x187fb1[_0x03b4('0x10')])),{'$like':sequelize['fn'](_0x03b4('0x39'),'%'+_0x42d249[_0x03b4('0x2e')][_0x03b4('0x36')]+'%')});}else{var _0x2ba3ce={};_0x2ba3ce[_0x187fb1['name']]={'$like':'%'+_0x42d249[_0x03b4('0x2e')][_0x03b4('0x36')]+'%'};return _0x2ba3ce;}}})});}_0x47c7b6=_[_0x03b4('0x3a')]({},_0x47c7b6,_0x42d249['options']);return _0x47c7b6;}; \ No newline at end of file +var _0xb58f=['isEmail','\x22{EXPR}\x22','{EXPR}','push','replace','getOptions','query','$id','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','pick','object','value','where','merge','VIRTUAL','lower','filter','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','type','DATE','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','substr','unsigned','ASC','omit','length','isString','unset','isNumeric','match','^[+]?[0-9]*$'];(function(_0x12d1f6,_0x2bf914){var _0x925734=function(_0x5882dc){while(--_0x5882dc){_0x12d1f6['push'](_0x12d1f6['shift']());}};_0x925734(++_0x2bf914);}(_0xb58f,0x187));var _0xfb58=function(_0x32b3a2,_0x4b557a){_0x32b3a2=_0x32b3a2-0x0;var _0x16ab13=_0xb58f[_0x32b3a2];return _0x16ab13;};'use strict';var _=require(_0xfb58('0x0'));var sequelize=require(_0xfb58('0x1'));var moment=require(_0xfb58('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xf52a2f){var _0x2df9de=['ne'];try{var _0xaf105e=JSON[_0xfb58('0x3')](_0xf52a2f);var _0x5d02a2=Object[_0xfb58('0x4')](_0xaf105e)[0x0];return _0x2df9de[_0xfb58('0x5')](_0x5d02a2);}catch(_0x32e319){return![];}}function getOperatorValue(_0x16b9ad){var _0x18a36c=JSON[_0xfb58('0x3')](_0x16b9ad);var _0x17e8ce=Object[_0xfb58('0x4')](_0x18a36c)[0x0];var _0x16f33d=_0x18a36c[_0x17e8ce];return{['$'+_0x17e8ce]:_0x16f33d};}exports['fields']=function(_0x50784f){var _0x162c7b=null;if(_0x50784f){_0x162c7b=_0x50784f[_0xfb58('0x6')](',');}return _0x162c7b;};exports[_0xfb58('0x7')]=function(_0x24be72,_0x363bf3){var _0x273733={};if(!_[_0xfb58('0x8')](_0x24be72)){_[_0xfb58('0x9')](_0x24be72,function(_0x433ef5,_0x316079){try{if(_0x363bf3){var _0x1689e0=_['find'](_0x363bf3,{'name':_0x316079})||{};if(hasSequelizeOperator(_0x433ef5)){_0x273733[_0x316079]=getOperatorValue(_0x433ef5);}else if(_0x1689e0[_0xfb58('0xa')]===_0xfb58('0xb')&&_['isPlainObject'](_0x433ef5)){var _0x2e96c5=JSON[_0xfb58('0x3')](_0x433ef5);var _0x17b8d4={'$gte':moment(moment(_0x2e96c5['$gte'])[_0xfb58('0xc')](_0xfb58('0xd')))[_0xfb58('0xe')]()[_0xfb58('0xc')](),'$lte':moment(moment(_0x2e96c5['$lte'])['format'](_0xfb58('0xd')))[_0xfb58('0xe')]()[_0xfb58('0xf')](0x1,'s')[_0xfb58('0xc')]()};_0x273733[_0x316079]=_0x17b8d4;}else if(_0x1689e0[_0xfb58('0x10')]===_0xfb58('0x11')){_0x273733[_0x316079]=_0x433ef5;}else{_0x273733[_0x316079]=_[_0xfb58('0x12')](_0x433ef5)?_0x433ef5:JSON[_0xfb58('0x3')](_0x433ef5);}}else{_0x273733[_0x316079]=_[_0xfb58('0x12')](_0x433ef5)?_0x433ef5:JSON[_0xfb58('0x3')](_0x433ef5);}}catch(_0x2a0800){_0x273733[_0x316079]=_0x433ef5['split'](',');}});}return _0x273733;};exports[_0xfb58('0x13')]=function(_0x7f3b5c){_0x7f3b5c=parseInt(_0x7f3b5c,0xa);if(!_0x7f3b5c||_0x7f3b5c<0x0){_0x7f3b5c=LIMIT_VALUE;}return _0x7f3b5c;};exports['offset']=function(_0x1bc241){_0x1bc241=parseInt(_0x1bc241,0xa);if(!_0x1bc241||_0x1bc241<0x0){_0x1bc241=0x0;}return _0x1bc241;};exports[_0xfb58('0x14')]=function(_0x35a3b1){var _0xf7788e,_0x986a36=null;if(_0x35a3b1){_0xf7788e=_0x35a3b1[_0xfb58('0x6')](',');_0x986a36=_[_0xfb58('0x15')](_0xf7788e,function(_0x12cb88){if(_0x12cb88[_0xfb58('0x16')]('-')===0x0){return[_0x12cb88===_0xfb58('0x17')?sequelize[_0xfb58('0x18')](sequelize[_0xfb58('0x19')](_0xfb58('0x17')),'unsigned'):_0x12cb88[_0xfb58('0x1a')](0x1),'DESC'];}else{return[_0x12cb88===_0xfb58('0x17')?sequelize[_0xfb58('0x18')](sequelize[_0xfb58('0x19')](_0xfb58('0x17')),_0xfb58('0x1b')):_0x12cb88,_0xfb58('0x1c')];}});}return _0x986a36;};exports[_0xfb58('0x1d')]=function(_0x3e50df,_0x544e78){if(_['isEmpty'](_0x3e50df)){return _0x3e50df;}if(_[_0xfb58('0x12')](_0x3e50df)){for(var _0x957910=0x0;_0x957910<_0x3e50df[_0xfb58('0x1e')];_0x957910+=0x1){_0x3e50df[_0x957910]=this[_0xfb58('0x1d')](_0x3e50df[_0x957910],_0x544e78);}return _0x3e50df;}if(!_['isObject'](_0x3e50df)){return _0x3e50df;}if(_[_0xfb58('0x1f')](_0x544e78)){_0x544e78=[_0x544e78];}if(!_[_0xfb58('0x12')](_0x544e78)){return _0x3e50df;}for(var _0x55f386=0x0;_0x55f386<_0x544e78[_0xfb58('0x1e')];_0x55f386+=0x1){_[_0xfb58('0x20')](_0x3e50df,_0x544e78[_0x55f386]);}for(var _0x53e9a9 in _0x3e50df){if(_0x3e50df['hasOwnProperty'](_0x53e9a9)){_0x3e50df[_0x53e9a9]=this[_0xfb58('0x1d')](_0x3e50df[_0x53e9a9],_0x544e78);}}return _0x3e50df;};exports[_0xfb58('0x21')]=function(_0x1bc1a8){return _0x1bc1a8[_0xfb58('0x22')](RegExp(_0xfb58('0x23')))?!![]:![];};exports[_0xfb58('0x24')]=function(_0x429927){return _0x429927['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x21a99b,_0x13d236){var _0x4693d1=[];var _0x3baf91=/[ `!@#$%^&*()_\-?~]/;var _0x1e7afc=_0x13d236?_0xfb58('0x25'):_0xfb58('0x26');_0x21a99b[_0xfb58('0x6')](/[ ,]+/)['forEach'](function(_0x49d462){_0x49d462=_0x49d462['replace'](/([^:]")"+/g,'$1');_0x49d462='+'+_0x49d462+'*';var _0x18768f=_0x49d462['match'](_0x3baf91);if(_0x18768f){_0x49d462='\x22'+_0x49d462+'\x22';}_0x4693d1[_0xfb58('0x27')](_0x49d462);});_0x1e7afc=_0x1e7afc[_0xfb58('0x28')](_0xfb58('0x26'),_0x4693d1['join']('\x20'));return _0x1e7afc;};exports[_0xfb58('0x29')]=function(_0x5ea8b6,_0x4c80fb,_0x56dacc){var _0xe3cbc8={},_0xb6e3df={};if(_0x4c80fb[_0xfb58('0x2a')][_0xfb58('0x2b')]){_0x4c80fb[_0xfb58('0x2a')]['id']=_0x4c80fb['query'][_0xfb58('0x2b')];delete _0x4c80fb[_0xfb58('0x2a')]['$id'];}_0xe3cbc8['model']=_[_0xfb58('0x15')](_0x5ea8b6,_0xfb58('0x10'));_0xe3cbc8['query']=_[_0xfb58('0x4')](_0x4c80fb['query']);_0xe3cbc8['filters']=_[_0xfb58('0x2c')](_0xe3cbc8[_0xfb58('0x2d')],_0xe3cbc8[_0xfb58('0x2a')]);_0xb6e3df[_0xfb58('0x2e')]=_[_0xfb58('0x2c')](_0xe3cbc8['model'],this['fields'](_0x4c80fb['query'][_0xfb58('0x2f')]));_0xb6e3df[_0xfb58('0x2e')]=_0xb6e3df['attributes'][_0xfb58('0x1e')]?_0xb6e3df[_0xfb58('0x2e')]:_0xe3cbc8[_0xfb58('0x2d')];if(!_0x4c80fb[_0xfb58('0x2a')][_0xfb58('0x30')](_0xfb58('0x31'))){_0xb6e3df[_0xfb58('0x13')]=this[_0xfb58('0x13')](_0x4c80fb[_0xfb58('0x2a')]['limit']);_0xb6e3df[_0xfb58('0x32')]=this[_0xfb58('0x32')](_0x4c80fb['query'][_0xfb58('0x32')]);}_0xb6e3df[_0xfb58('0x33')]=this[_0xfb58('0x14')](_0x4c80fb[_0xfb58('0x2a')][_0xfb58('0x14')]);_0xb6e3df['where']=this[_0xfb58('0x7')](_[_0xfb58('0x34')](_0x4c80fb[_0xfb58('0x2a')],_0xe3cbc8[_0xfb58('0x7')]),_0x5ea8b6);if(_0x4c80fb[_0xfb58('0x2a')]['filter']){var _0x861f2b=_0x5ea8b6;var _0x35ef18=_0x4c80fb[_0xfb58('0x2a')]['filter'];if(typeof _0x35ef18===_0xfb58('0x35')){_0x861f2b=_['filter'](_0x5ea8b6,function(_0xf0e28c){return _[_0xfb58('0x5')](_0x35ef18['columns'],_0xf0e28c[_0xfb58('0x10')]);});_0x35ef18=_0x35ef18[_0xfb58('0x36')];}_0xb6e3df[_0xfb58('0x37')]=_[_0xfb58('0x38')](_0xb6e3df[_0xfb58('0x37')],{'$or':_['map'](_0x861f2b,function(_0x5ef7f0){if(_0x5ef7f0[_0xfb58('0xa')]!==_0xfb58('0x39')){if(_0x56dacc){return sequelize['where'](sequelize['fn'](_0xfb58('0x3a'),sequelize[_0xfb58('0x19')](_0x5ef7f0[_0xfb58('0x10')])),{'$like':sequelize['fn'](_0xfb58('0x3a'),'%'+_0x4c80fb[_0xfb58('0x2a')]['filter']+'%')});}else{var _0x38c02a={};_0x38c02a[_0x5ef7f0[_0xfb58('0x10')]]={'$like':'%'+_0x4c80fb[_0xfb58('0x2a')][_0xfb58('0x3b')]+'%'};return _0x38c02a;}}})});}_0xb6e3df=_['merge']({},_0xb6e3df,_0x4c80fb[_0xfb58('0x3c')]);return _0xb6e3df;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index b11a5e2..50343cc 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 _0xa16b=['name','fullname','pauseType','find','globalStatus','split','fields','DESC','ASC','getUpdatedSortOptions','internal','substring','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','whatsappStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','value','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','request','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','findOne','getAgents','all','then','flatten','map','uniq','getAgentIdsByQueues','includes','User'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa16b,0x91));var _0xba16=function(_0x44ac1a,_0x54edbc){_0x44ac1a=_0x44ac1a-0x0;var _0x55c483=_0xa16b[_0x44ac1a];return _0x55c483;};'use strict';var _=require(_0xba16('0x0'));var jayson=require(_0xba16('0x1'));var db=require(_0xba16('0x2'))['db'];var amiClient=jayson['client'][_0xba16('0x3')]({'port':0x232a});var routingClient=jayson[_0xba16('0x4')][_0xba16('0x3')]({'port':0x232c});function isAgentPaused(_0x3602b2,_0x54d596){var _0x589c84=[_0x3602b2[_0xba16('0x5')],_0x3602b2[_0xba16('0x6')],_0x3602b2[_0xba16('0x7')],_0x3602b2[_0xba16('0x8')],_0x3602b2[_0xba16('0x9')],_0x3602b2[_0xba16('0xa')],_0x3602b2[_0xba16('0xb')]];if(!_0x54d596)return _[_0xba16('0xc')](_0x589c84);var _0x1430d9=_[_0xba16('0xd')](_0x589c84);return _0x1430d9['length']>0x0&&_0x1430d9[_0xba16('0xe')]<_0x589c84[_0xba16('0xe')]?!![]:![];}function isIdle(_0x434955){return _0x434955===_0xba16('0xf')||_0x434955===_0xba16('0x10')||_0x434955===_0xba16('0x11')||_0x434955===_0xba16('0x12')||_[_0xba16('0x13')](_0x434955);}function isAgentIdle(_0x504af4){if(_0x504af4[_0xba16('0x14')]!==_0xba16('0xf')&&_0x504af4[_0xba16('0xa')]){_0x504af4[_0xba16('0x14')]=_0xba16('0x15');return![];}return _[_0xba16('0xc')]([_0x504af4[_0xba16('0x16')],_0x504af4['faxStatus'],_0x504af4[_0xba16('0x17')],_0x504af4[_0xba16('0x18')],_0x504af4[_0xba16('0x19')],_0x504af4[_0xba16('0x14')],_0x504af4['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xba16('0x1a')]('Agents',{})['then'](function(_0x9b2664){if(_0x9b2664[_0xba16('0x1b')]){throw new Error(_0xba16('0x1c'));}var _0xf040a0=_0x9b2664[_0xba16('0x1d')];return routingClient[_0xba16('0x1a')](_0xba16('0x1e'),{})['then'](function(_0x39f44f){if(_0x39f44f[_0xba16('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x51a949=_0x39f44f[_0xba16('0x1d')];return _['merge']({},_0xf040a0,_0x51a949);});})[_0xba16('0x1f')](function(_0x10ffae){throw _0x10ffae;});}exports[_0xba16('0x20')]=getRealtimeAgents;function getAgentStatus(_0x3289dc){var _0x414bed='unknown';if(isAgentPaused(_0x3289dc))_0x414bed=_0xba16('0x15');else if(isAgentPaused(_0x3289dc,!![]))_0x414bed=_0xba16('0x21');else if(isAgentIdle(_0x3289dc))_0x414bed=_0xba16('0xf');else _0x414bed=_0xba16('0x22');return _0x414bed;}exports[_0xba16('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x1d213e,_0x5780be){var _0x47b7ab=_[_0xba16('0x24')](_0x1d213e)?_0x1d213e:[_0x1d213e];var _0x3380b8=_[_0xba16('0x25')](_0x5780be)+_0xba16('0x26');var _0xb10091=_['map'](_0x47b7ab,function(_0x34d563){return db[_0x3380b8][_0xba16('0x27')]({'where':{'id':_0x34d563}})['then'](function(_0xf83da5){if(!_0xf83da5)return[];return _0xf83da5[_0xba16('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xba16('0x29')](_0xb10091)[_0xba16('0x2a')](function(_0x48613a){var _0x2bc8eb=_(_0x48613a)[_0xba16('0x2b')]()[_0xba16('0x2c')]('id')[_0xba16('0x2d')]()['value']();return _0x2bc8eb;});}exports[_0xba16('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xfd756f,_0x2245a7,_0x1138ac){try{if(_0x2245a7[_0xba16('0xe')]>0x0){_0xfd756f=_0xfd756f[_0xba16('0xd')](function(_0x2b4950){return _0x2245a7[_0xba16('0x2f')](_0x2b4950['id']);});}var _0x2fc4af=_0xfd756f[_0xba16('0xd')](function(_0x4914a9){var _0x5042ca=_0xba16('0x22');if(isAgentIdle(_0x4914a9)){_0x5042ca=_0xba16('0xf');}return _0x5042ca===_0x1138ac;});return _['map'](_0x2fc4af,'id');}catch(_0x29241d){throw _0x29241d;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2b8321,_0x2a8c3f,_0x5c09b5){return Promise['resolve']()[_0xba16('0x2a')](function(){if(_0x2a8c3f[_0xba16('0xe')]>0x0){_0x2b8321=_0x2b8321['filter'](function(_0x339b0a){return _0x2a8c3f[_0xba16('0x2f')](_0x339b0a['id']);});}return _0x2b8321;})['then'](function(){return db[_0xba16('0x30')]['findAll']({'attributes':['id',_0xba16('0x31'),_0xba16('0x32'),'chatPause',_0xba16('0x6'),'mailPause','openchannelPause',_0xba16('0x9'),_0xba16('0xa'),_0xba16('0xb'),_0xba16('0x33')],'where':{'id':{'$in':_[_0xba16('0x2c')](_0x2b8321,'id')}},'raw':!![]});})[_0xba16('0x2a')](function(_0x517cd7){return _0x517cd7['map'](function(_0x8bc015){var _0xde27cb=_[_0xba16('0x34')](_0x2b8321,['id',_0x8bc015['id']]);var _0x2a194e=filterAgentAttributes(_0xde27cb);_['merge'](_0x8bc015,_0x2a194e);_0x8bc015[_0xba16('0x35')]=getAgentStatus(_0x8bc015);return _0x8bc015;});})[_0xba16('0x2a')](function(_0x3f2cc7){var _0x2ec371=sortAgentsByStatus(_0x3f2cc7,_0x5c09b5);return _[_0xba16('0x2c')](_0x2ec371,'id');})['catch'](function(_0x4634f5){throw _0x4634f5;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x54ee1b){var _0x3e951e={'fields':[],'order':null};var _0x3d30ce=_0x54ee1b[_0xba16('0x36')](',');_0x3e951e[_0xba16('0x37')]=_[_0xba16('0xd')](_0x3d30ce,function(_0x32c5e3){if(!_0x32c5e3[_0xba16('0x2f')](_0xba16('0x35'))){return!![];}_0x3e951e['order']=_['startsWith'](_0x32c5e3,'-')?_0xba16('0x38'):_0xba16('0x39');return![];});return _0x3e951e;}exports[_0xba16('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x59ec7e){if(_0x59ec7e['includes'](_0xba16('0x32'))&&!_0x59ec7e['includes'](_0xba16('0x3b'))){var _0x398c30=_0x59ec7e[_0xba16('0x3c')](0x0,_0x59ec7e['indexOf'](_0xba16('0x32')));_0x59ec7e+=','+_0x398c30+_0xba16('0x3b');}return _0x59ec7e;}exports[_0xba16('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0xc48fd0,_0x1bccc8){var _0x3d9cf8=_0xc48fd0['sort'](function(_0x2e81cc,_0x2cbbcd){if(_0x2e81cc['globalStatus']===_0x2cbbcd[_0xba16('0x35')]){if(_0x2e81cc[_0xba16('0x35')]==='pause'){if(_0x1bccc8==='DESC'){return(_0x2e81cc['pauseType']||'')<(_0x2cbbcd[_0xba16('0x33')]||'')||_0x2e81cc[_0xba16('0x32')][_0xba16('0x3e')]()>_0x2cbbcd[_0xba16('0x32')][_0xba16('0x3e')]()?0x1:-0x1;}else{return(_0x2e81cc[_0xba16('0x33')]||'')<(_0x2cbbcd[_0xba16('0x33')]||'')||_0x2e81cc[_0xba16('0x32')][_0xba16('0x3e')]()>_0x2cbbcd['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x1bccc8===_0xba16('0x38')){return _0x2e81cc[_0xba16('0x32')][_0xba16('0x3e')]()<_0x2cbbcd[_0xba16('0x32')][_0xba16('0x3e')]()?0x1:-0x1;}else{return _0x2e81cc[_0xba16('0x32')][_0xba16('0x3e')]()<_0x2cbbcd[_0xba16('0x32')][_0xba16('0x3e')]()?-0x1:0x1;}}}else{if(_0x1bccc8===_0xba16('0x38')){return _0x2e81cc[_0xba16('0x35')]<_0x2cbbcd[_0xba16('0x35')]?0x1:-0x1;}else{return _0x2e81cc[_0xba16('0x35')]<_0x2cbbcd[_0xba16('0x35')]?-0x1:0x1;}}});return _0x3d9cf8;}exports[_0xba16('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x53629c){var _0x1680ff=[_0xba16('0x40'),'online',_0xba16('0x41'),_0xba16('0x42'),_0xba16('0x33'),_0xba16('0x42'),'internal',_0xba16('0x43'),_0xba16('0x5'),'openchannelPause',_0xba16('0x7'),_0xba16('0x9'),'whatsappPause',_0xba16('0x6'),_0xba16('0xa'),_0xba16('0x44'),'openchannelCapacity',_0xba16('0x45'),_0xba16('0x46'),_0xba16('0x47'),_0xba16('0x48'),_0xba16('0x49'),_0xba16('0x4a'),_0xba16('0x4b'),_0xba16('0x4c'),'whatsappCurrentCapacity',_0xba16('0x4d'),_0xba16('0x16'),_0xba16('0x18'),'mailStatus',_0xba16('0x19'),_0xba16('0x4e'),_0xba16('0x4f'),_0xba16('0x14'),_0xba16('0x50'),_0xba16('0x51'),_0xba16('0x52'),_0xba16('0x53'),_0xba16('0x54'),_0xba16('0x55'),_0xba16('0x56'),_0xba16('0x57'),_0xba16('0x58'),_0xba16('0x59'),'phoneBarEnableScreenRecordingByAgent',_0xba16('0x5a'),_0xba16('0x5b')];var _0x443650=[_0xba16('0x5'),_0xba16('0x8'),_0xba16('0x7'),_0xba16('0x9'),_0xba16('0xb'),_0xba16('0x6'),_0xba16('0xa'),_0xba16('0x5c')];var _0x446c23=_(_0x53629c)[_0xba16('0x5d')](_0x443650)[_0xba16('0x5e')](_0x1680ff)[_0xba16('0x5f')]();return _0x446c23;}exports[_0xba16('0x60')]=filterAgentAttributes; \ No newline at end of file +var _0xb071=['isArray','startCase','findOne','getAgents','all','map','value','getAgentIdsByQueues','includes','resolve','User','findAll','name','fullname','chatPause','openchannelPause','pauseType','merge','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','unavailable','isNil','voiceStatus','idle','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch','pause','busy','getAgentStatus'];(function(_0x21b161,_0x36e15a){var _0x395016=function(_0x2a107c){while(--_0x2a107c){_0x21b161['push'](_0x21b161['shift']());}};_0x395016(++_0x36e15a);}(_0xb071,0x1ba));var _0x1b07=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0xb071[_0x2f7d18];return _0x425175;};'use strict';var _=require(_0x1b07('0x0'));var jayson=require(_0x1b07('0x1'));var db=require(_0x1b07('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x1b07('0x3')][_0x1b07('0x4')]({'port':0x232c});function isAgentPaused(_0x2e0f4e,_0x3d14a2){var _0x382b29=[_0x2e0f4e['chatPause'],_0x2e0f4e[_0x1b07('0x5')],_0x2e0f4e[_0x1b07('0x6')],_0x2e0f4e['openchannelPause'],_0x2e0f4e[_0x1b07('0x7')],_0x2e0f4e[_0x1b07('0x8')],_0x2e0f4e[_0x1b07('0x9')]];if(!_0x3d14a2)return _[_0x1b07('0xa')](_0x382b29);var _0x109c3d=_[_0x1b07('0xb')](_0x382b29);return _0x109c3d[_0x1b07('0xc')]>0x0&&_0x109c3d[_0x1b07('0xc')]<_0x382b29[_0x1b07('0xc')]?!![]:![];}function isIdle(_0x3431d4){return _0x3431d4==='idle'||_0x3431d4==='unknown'||_0x3431d4===_0x1b07('0xd')||_0x3431d4==='ringing'||_[_0x1b07('0xe')](_0x3431d4);}function isAgentIdle(_0x516ceb){if(_0x516ceb[_0x1b07('0xf')]!==_0x1b07('0x10')&&_0x516ceb['voicePause']){_0x516ceb[_0x1b07('0xf')]='pause';return![];}return _[_0x1b07('0xa')]([_0x516ceb[_0x1b07('0x11')],_0x516ceb[_0x1b07('0x12')],_0x516ceb[_0x1b07('0x13')],_0x516ceb[_0x1b07('0x14')],_0x516ceb[_0x1b07('0x15')],_0x516ceb[_0x1b07('0xf')],_0x516ceb[_0x1b07('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1b07('0x17')](_0x1b07('0x18'),{})[_0x1b07('0x19')](function(_0x39bcb2){if(_0x39bcb2[_0x1b07('0x1a')]){throw new Error(_0x1b07('0x1b'));}var _0xb99181=_0x39bcb2['result'];return routingClient[_0x1b07('0x17')](_0x1b07('0x18'),{})['then'](function(_0x1c62b2){if(_0x1c62b2[_0x1b07('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3f345a=_0x1c62b2[_0x1b07('0x1c')];return _['merge']({},_0xb99181,_0x3f345a);});})[_0x1b07('0x1d')](function(_0x2a6855){throw _0x2a6855;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x15c56c){var _0x28640a='unknown';if(isAgentPaused(_0x15c56c))_0x28640a=_0x1b07('0x1e');else if(isAgentPaused(_0x15c56c,!![]))_0x28640a='*pause';else if(isAgentIdle(_0x15c56c))_0x28640a=_0x1b07('0x10');else _0x28640a=_0x1b07('0x1f');return _0x28640a;}exports[_0x1b07('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x332cb8,_0xcf525e){var _0x508d8b=_[_0x1b07('0x21')](_0x332cb8)?_0x332cb8:[_0x332cb8];var _0x185cd4=_[_0x1b07('0x22')](_0xcf525e)+'Queue';var _0x3ade3e=_['map'](_0x508d8b,function(_0x4934c3){return db[_0x185cd4][_0x1b07('0x23')]({'where':{'id':_0x4934c3}})[_0x1b07('0x19')](function(_0x404b6d){if(!_0x404b6d)return[];return _0x404b6d[_0x1b07('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x1b07('0x25')](_0x3ade3e)[_0x1b07('0x19')](function(_0x4cff4f){var _0x58f9bb=_(_0x4cff4f)['flatten']()[_0x1b07('0x26')]('id')['uniq']()[_0x1b07('0x27')]();return _0x58f9bb;});}exports[_0x1b07('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xb90793,_0x1624d7,_0x24e8a1){try{if(_0x1624d7[_0x1b07('0xc')]>0x0){_0xb90793=_0xb90793[_0x1b07('0xb')](function(_0x35bf76){return _0x1624d7[_0x1b07('0x29')](_0x35bf76['id']);});}var _0xc97944=_0xb90793['filter'](function(_0x27f8c2){var _0x8a650e=_0x1b07('0x1f');if(isAgentIdle(_0x27f8c2)){_0x8a650e=_0x1b07('0x10');}return _0x8a650e===_0x24e8a1;});return _['map'](_0xc97944,'id');}catch(_0x458d9c){throw _0x458d9c;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2f72f2,_0x14aee9,_0x103841){return Promise[_0x1b07('0x2a')]()[_0x1b07('0x19')](function(){if(_0x14aee9[_0x1b07('0xc')]>0x0){_0x2f72f2=_0x2f72f2[_0x1b07('0xb')](function(_0x43d648){return _0x14aee9['includes'](_0x43d648['id']);});}return _0x2f72f2;})['then'](function(){return db[_0x1b07('0x2b')][_0x1b07('0x2c')]({'attributes':['id',_0x1b07('0x2d'),_0x1b07('0x2e'),_0x1b07('0x2f'),_0x1b07('0x5'),_0x1b07('0x6'),_0x1b07('0x30'),_0x1b07('0x7'),_0x1b07('0x8'),_0x1b07('0x9'),_0x1b07('0x31')],'where':{'id':{'$in':_[_0x1b07('0x26')](_0x2f72f2,'id')}},'raw':!![]});})[_0x1b07('0x19')](function(_0x204fee){return _0x204fee[_0x1b07('0x26')](function(_0x9387d2){var _0x261d4c=_['find'](_0x2f72f2,['id',_0x9387d2['id']]);var _0x4c5119=filterAgentAttributes(_0x261d4c);_[_0x1b07('0x32')](_0x9387d2,_0x4c5119);_0x9387d2[_0x1b07('0x33')]=getAgentStatus(_0x9387d2);return _0x9387d2;});})['then'](function(_0x3e34ee){var _0x4de7d9=sortAgentsByStatus(_0x3e34ee,_0x103841);return _['map'](_0x4de7d9,'id');})[_0x1b07('0x1d')](function(_0x4f44d4){throw _0x4f44d4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x230050){var _0x9d070b={'fields':[],'order':null};var _0x5ded0f=_0x230050[_0x1b07('0x34')](',');_0x9d070b[_0x1b07('0x35')]=_[_0x1b07('0xb')](_0x5ded0f,function(_0x2e28cb){if(!_0x2e28cb['includes']('globalStatus')){return!![];}_0x9d070b[_0x1b07('0x36')]=_[_0x1b07('0x37')](_0x2e28cb,'-')?_0x1b07('0x38'):_0x1b07('0x39');return![];});return _0x9d070b;}exports[_0x1b07('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x3c0b5e){if(_0x3c0b5e[_0x1b07('0x29')](_0x1b07('0x2e'))&&!_0x3c0b5e[_0x1b07('0x29')](_0x1b07('0x3b'))){var _0x514c09=_0x3c0b5e[_0x1b07('0x3c')](0x0,_0x3c0b5e[_0x1b07('0x3d')](_0x1b07('0x2e')));_0x3c0b5e+=','+_0x514c09+_0x1b07('0x3b');}return _0x3c0b5e;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x378791,_0x75cc94){var _0xf26ede=_0x378791[_0x1b07('0x3e')](function(_0x149f6a,_0x3efc68){if(_0x149f6a['globalStatus']===_0x3efc68[_0x1b07('0x33')]){if(_0x149f6a[_0x1b07('0x33')]==='pause'){if(_0x75cc94===_0x1b07('0x38')){return(_0x149f6a[_0x1b07('0x31')]||'')<(_0x3efc68[_0x1b07('0x31')]||'')||_0x149f6a[_0x1b07('0x2e')][_0x1b07('0x3f')]()>_0x3efc68[_0x1b07('0x2e')][_0x1b07('0x3f')]()?0x1:-0x1;}else{return(_0x149f6a[_0x1b07('0x31')]||'')<(_0x3efc68[_0x1b07('0x31')]||'')||_0x149f6a['fullname'][_0x1b07('0x3f')]()>_0x3efc68[_0x1b07('0x2e')][_0x1b07('0x3f')]()?-0x1:0x1;}}else{if(_0x75cc94===_0x1b07('0x38')){return _0x149f6a['fullname'][_0x1b07('0x3f')]()<_0x3efc68[_0x1b07('0x2e')][_0x1b07('0x3f')]()?0x1:-0x1;}else{return _0x149f6a[_0x1b07('0x2e')][_0x1b07('0x3f')]()<_0x3efc68['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x75cc94===_0x1b07('0x38')){return _0x149f6a['globalStatus']<_0x3efc68[_0x1b07('0x33')]?0x1:-0x1;}else{return _0x149f6a[_0x1b07('0x33')]<_0x3efc68['globalStatus']?-0x1:0x1;}}});return _0xf26ede;}exports[_0x1b07('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x184906){var _0x1d91f6=[_0x1b07('0x41'),_0x1b07('0x42'),_0x1b07('0x43'),_0x1b07('0x44'),_0x1b07('0x31'),_0x1b07('0x44'),_0x1b07('0x3b'),_0x1b07('0x45'),_0x1b07('0x2f'),'openchannelPause',_0x1b07('0x6'),_0x1b07('0x7'),_0x1b07('0x9'),'faxPause',_0x1b07('0x8'),'chatCapacity',_0x1b07('0x46'),_0x1b07('0x47'),_0x1b07('0x48'),_0x1b07('0x49'),_0x1b07('0x4a'),_0x1b07('0x4b'),_0x1b07('0x4c'),_0x1b07('0x4d'),_0x1b07('0x4e'),_0x1b07('0x4f'),_0x1b07('0x50'),_0x1b07('0x11'),_0x1b07('0x14'),_0x1b07('0x13'),_0x1b07('0x15'),_0x1b07('0x16'),'faxStatus',_0x1b07('0xf'),_0x1b07('0x51'),_0x1b07('0x52'),_0x1b07('0x53'),_0x1b07('0x54'),'whatsappStatusTime',_0x1b07('0x55'),_0x1b07('0x56'),_0x1b07('0x57'),_0x1b07('0x58'),_0x1b07('0x59'),_0x1b07('0x5a'),'phoneBarEnableAutomaticScreenRecording',_0x1b07('0x5b')];var _0x5307b4=[_0x1b07('0x2f'),_0x1b07('0x30'),_0x1b07('0x6'),_0x1b07('0x7'),_0x1b07('0x9'),_0x1b07('0x5'),'voicePause',_0x1b07('0x42')];var _0x3499f5=_(_0x184906)[_0x1b07('0x5c')](_0x5307b4)[_0x1b07('0x5d')](_0x1d91f6)[_0x1b07('0x27')]();return _0x3499f5;}exports[_0x1b07('0x5e')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index ca67f1a..69a8e21 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 _0xc374=['dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','inbound','concat','outbound','map','get','find','pick','initializeQueues','client','http','available','loggedIn','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringing','ringInUse','talking','unavailable','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor'];(function(_0xd7794d,_0x3d391d){var _0x301a5f=function(_0x1365ca){while(--_0x1365ca){_0xd7794d['push'](_0xd7794d['shift']());}};_0x301a5f(++_0x3d391d);}(_0xc374,0x1c7));var _0x4c37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc374[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0x4c37('0x0')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x4c37('0x1')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x4c37('0x2'),_0x4c37('0x3'),_0x4c37('0x4'),_0x4c37('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x4c37('0x6'),_0x4c37('0x7'),_0x4c37('0x8'),'loggedInDb',_0x4c37('0x9'),_0x4c37('0xa'),_0x4c37('0xb'),_0x4c37('0xc'),_0x4c37('0xd'),_0x4c37('0xe'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x4c37('0xf'),_0x4c37('0x10'),'message','statusMessage',_0x4c37('0x11'),_0x4c37('0x12'),_0x4c37('0x13'),_0x4c37('0x14'),_0x4c37('0x15'),_0x4c37('0x16'),_0x4c37('0x17'),'erlangAbandonmentRate',_0x4c37('0x18'),_0x4c37('0x19'),_0x4c37('0x1a'),_0x4c37('0x1b'),_0x4c37('0x1c'),_0x4c37('0x1d'),'predictiveIntervalAnsweredCalls',_0x4c37('0x1e'),_0x4c37('0x1f'),_0x4c37('0x20'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x56ad75,_0x532d7a){var _0x582d9b=_0x532d7a===_0x4c37('0x21')?amiClient:routingClient;return _0x582d9b[_0x4c37('0x22')](_['startCase'](_0x532d7a)+_0x4c37('0x23'),_0x56ad75)[_0x4c37('0x24')](function(_0x3545d8){if(_0x3545d8['error'])throw new Error(util[_0x4c37('0x25')](_0x4c37('0x26'),_0x532d7a));return _0x3545d8['result'];})['catch'](function(_0x12bb83){throw _0x12bb83;});}exports[_0x4c37('0x27')]=getRealtimeQueues;function initializeQueues(_0xd95bd,_0x23d201,_0x3b4a67,_0x17f8b4){var _0xf86eb3=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3b4a67===_0x4c37('0x21')){if(_0x17f8b4===_0x4c37('0x28')){_0xf86eb3=_0xf86eb3[_0x4c37('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x17f8b4===_0x4c37('0x2a')){_0xf86eb3=_0xf86eb3[_0x4c37('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xd95bd[_0x4c37('0x2b')](function(_0x13c8fe){var _0x5bb81c=_0x13c8fe[_0x4c37('0x2c')]({'plain':!![]});_0x5bb81c[_0x4c37('0x4')]=0x0;_0x5bb81c['loggedInDb']=0x0;_0x5bb81c[_0x4c37('0x3')]=0x0;_0x5bb81c[_0x4c37('0x2')]=0x0;_0x5bb81c['waiting']=0x0;if(_0x3b4a67===_0x4c37('0x21')){_0x5bb81c[_0x4c37('0xd')]=0x0;_0x5bb81c[_0x4c37('0x6')]=0x0;if(_0x17f8b4==='outbound'){_0x5bb81c[_0x4c37('0xf')]=0x0;_0x5bb81c[_0x4c37('0x10')]=0x0;}}var _0x1c83f4=_[_0x4c37('0x2d')](_0x23d201,['id',_0x5bb81c['id']]);if(_0x1c83f4){_['merge'](_0x5bb81c,_[_0x4c37('0x2e')](_0x1c83f4,_0xf86eb3));}return _0x5bb81c;});}exports[_0x4c37('0x2f')]=initializeQueues; \ No newline at end of file +var _0xf02f=['paused','waiting','loggedInDb','notInUse','ringing','ringInUse','unavailable','originated','message','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','outbound','concat','map','get','talking','busy','find','merge','pick','lodash','util','client','http','available','loggedIn'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf02f,0xc2));var _0xff02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf02f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xff02('0x0'));var jayson=require('jayson/promise');var util=require(_0xff02('0x1'));var amiClient=jayson[_0xff02('0x2')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xff02('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xff02('0x4'),_0xff02('0x5'),_0xff02('0x6'),_0xff02('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse','invalid',_0xff02('0x8'),_0xff02('0x9'),'onHold',_0xff02('0xa'),_0xff02('0xb'),'talking',_0xff02('0xc'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xff02('0xd'),_0xff02('0xe'),_0xff02('0xf'),_0xff02('0x10'),'dialMethod',_0xff02('0x11'),_0xff02('0x12'),_0xff02('0x13'),'erlangCalls',_0xff02('0x14'),_0xff02('0x15'),_0xff02('0x16'),_0xff02('0x17'),_0xff02('0x18'),_0xff02('0x19'),_0xff02('0x1a'),_0xff02('0x1b'),_0xff02('0x1c'),'predictiveIntervalDroppedCallsTimeout',_0xff02('0x1d'),_0xff02('0x1e'),_0xff02('0x1f')];function getRealtimeQueues(_0x3d8b56,_0x3f918b){var _0x3679b0=_0x3f918b===_0xff02('0x20')?amiClient:routingClient;return _0x3679b0[_0xff02('0x21')](_['startCase'](_0x3f918b)+_0xff02('0x22'),_0x3d8b56)['then'](function(_0xb6857){if(_0xb6857[_0xff02('0x23')])throw new Error(util[_0xff02('0x24')](_0xff02('0x25'),_0x3f918b));return _0xb6857[_0xff02('0x26')];})[_0xff02('0x27')](function(_0x4467d6){throw _0x4467d6;});}exports[_0xff02('0x28')]=getRealtimeQueues;function initializeQueues(_0xc357ae,_0x3b4eeb,_0x3c2d6f,_0x5787fb){var _0x5574e8=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3c2d6f===_0xff02('0x20')){if(_0x5787fb==='inbound'){_0x5574e8=_0x5574e8['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5787fb===_0xff02('0x29')){_0x5574e8=_0x5574e8[_0xff02('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xc357ae[_0xff02('0x2b')](function(_0x511f28){var _0x3362f6=_0x511f28[_0xff02('0x2c')]({'plain':!![]});_0x3362f6[_0xff02('0x6')]=0x0;_0x3362f6['loggedInDb']=0x0;_0x3362f6[_0xff02('0x5')]=0x0;_0x3362f6['available']=0x0;_0x3362f6[_0xff02('0x7')]=0x0;if(_0x3c2d6f===_0xff02('0x20')){_0x3362f6[_0xff02('0x2d')]=0x0;_0x3362f6[_0xff02('0x2e')]=0x0;if(_0x5787fb==='outbound'){_0x3362f6['pTalking']=0x0;_0x3362f6[_0xff02('0xd')]=0x0;}}var _0x55a2bb=_[_0xff02('0x2f')](_0x3b4eeb,['id',_0x3362f6['id']]);if(_0x55a2bb){_[_0xff02('0x30')](_0x3362f6,_[_0xff02('0x31')](_0x55a2bb,_0x5574e8));}return _0x3362f6;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6aaef0f..28b7ac1 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5e848d,_0x1dbd20){var _0x3785e5=function(_0xc82b39){while(--_0xc82b39){_0x5e848d['push'](_0x5e848d['shift']());}};_0x3785e5(++_0x1dbd20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0xfec4f2,_0x27b2aa){var _0x4ee052=function(_0x195ba5){while(--_0x195ba5){_0xfec4f2['push'](_0xfec4f2['shift']());}};_0x4ee052(++_0x27b2aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index feb76ae..a13135c 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 _0xed65=['test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','head','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','platform','licenseToken'];(function(_0x36f5c8,_0x68d8ec){var _0x2dd830=function(_0x1eac30){while(--_0x1eac30){_0x36f5c8['push'](_0x36f5c8['shift']());}};_0x2dd830(++_0x68d8ec);}(_0xed65,0x121));var _0x5ed6=function(_0x3d3ddd,_0x59b504){_0x3d3ddd=_0x3d3ddd-0x0;var _0x52a4f9=_0xed65[_0x3d3ddd];return _0x52a4f9;};'use strict';var _=require(_0x5ed6('0x0'));var os=require('os');var crypto=require(_0x5ed6('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x5ed6('0x2'))[_0x5ed6('0x3')];var config=require(_0x5ed6('0x4'));function getInterfaces(){var _0x3a8c36=[];var _0x151f40=os[_0x5ed6('0x5')]();var _0x2a66de=_[_0x5ed6('0x6')](_[_0x5ed6('0x7')](_0x151f40));for(var _0x570609=0x0;_0x570609<_0x2a66de[_0x5ed6('0x8')];_0x570609++){var _0x501122=_0x151f40[_0x2a66de[_0x570609]][_0x5ed6('0x9')](function(_0x15b1b6){return _0x15b1b6['family']===_0x5ed6('0xa')&&_0x15b1b6[_0x5ed6('0xb')]===![];});_0x3a8c36=_0x3a8c36['concat'](_0x501122);}return _0x3a8c36;}function getFirstInterface(){var _0x11a7b9=_[_0x5ed6('0xc')](getInterfaces());return{'macAddress':_0x11a7b9&&_0x11a7b9['mac']?_0x11a7b9['mac']:'00:00:00:00:00:00','ipAddress':_0x11a7b9&&_0x11a7b9[_0x5ed6('0xd')]?_0x11a7b9[_0x5ed6('0xd')]:_0x5ed6('0xe')};}exports[_0x5ed6('0xf')]=getFirstInterface;function getCPUhash(){var _0x19a64e=_['orderBy'](os[_0x5ed6('0x10')]()[_0x5ed6('0x11')](function(_0x2461a7){return _0x2461a7['model'];}))[_0x5ed6('0x12')](':');return crypto[_0x5ed6('0x13')](_0x5ed6('0x14'))[_0x5ed6('0x15')](_0x19a64e)[_0x5ed6('0x16')](_0x5ed6('0x17'));}exports['getUuid']=function(){var _0x52ca4c=os[_0x5ed6('0x18')]();var _0xda4e3e=/[0-9a-f-]{36}/;if(config[_0x5ed6('0x19')]&&_0xda4e3e[_0x5ed6('0x1a')](config[_0x5ed6('0x19')])){return config[_0x5ed6('0x19')];}else if(_0x52ca4c===_0x5ed6('0x1b')){return exec(_0x5ed6('0x1c'),{'encoding':_0x5ed6('0x1d')})[_0x5ed6('0x1e')]('\x0d\x0a','');}else{var _0x38f822=getFirstInterface();var _0x514d5c=getCPUhash();var _0x2085d4=_0x514d5c+'|'+os[_0x5ed6('0x1f')]()+'|'+_0x38f822[_0x5ed6('0x20')]+'|'+_0x38f822[_0x5ed6('0x21')];var _0x1c78c1=crypto[_0x5ed6('0x13')](_0x5ed6('0x14'))['update'](_0x2085d4)[_0x5ed6('0x16')]('hex');return _0x1c78c1[_0x5ed6('0x22')](0x0,0x8)+'-'+_0x1c78c1[_0x5ed6('0x22')](0x8,0xc)+'-'+_0x1c78c1[_0x5ed6('0x22')](0xc,0x10)+'-'+_0x1c78c1[_0x5ed6('0x22')](0x10,0x14)+'-'+_0x1c78c1[_0x5ed6('0x22')](0x14);}}; \ No newline at end of file +var _0x8890=['head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','join','createHash','md5','digest','hex','getUuid','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','update','substring','crypto','child_process','execSync','networkInterfaces','orderBy','keys','filter','IPv4','concat'];(function(_0x254fed,_0x30cf21){var _0x480085=function(_0xe7f346){while(--_0xe7f346){_0x254fed['push'](_0x254fed['shift']());}};_0x480085(++_0x30cf21);}(_0x8890,0x77));var _0x0889=function(_0x403f4b,_0x85ef39){_0x403f4b=_0x403f4b-0x0;var _0x1b20a0=_0x8890[_0x403f4b];return _0x1b20a0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x0889('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x0889('0x1'))[_0x0889('0x2')];var config=require('../environment');function getInterfaces(){var _0x450bd6=[];var _0x1439ac=os[_0x0889('0x3')]();var _0x51d1e8=_[_0x0889('0x4')](_[_0x0889('0x5')](_0x1439ac));for(var _0x313201=0x0;_0x313201<_0x51d1e8['length'];_0x313201++){var _0xe257a=_0x1439ac[_0x51d1e8[_0x313201]][_0x0889('0x6')](function(_0x2e2efb){return _0x2e2efb['family']===_0x0889('0x7')&&_0x2e2efb['internal']===![];});_0x450bd6=_0x450bd6[_0x0889('0x8')](_0xe257a);}return _0x450bd6;}function getFirstInterface(){var _0x56deea=_[_0x0889('0x9')](getInterfaces());return{'macAddress':_0x56deea&&_0x56deea[_0x0889('0xa')]?_0x56deea['mac']:_0x0889('0xb'),'ipAddress':_0x56deea&&_0x56deea[_0x0889('0xc')]?_0x56deea[_0x0889('0xc')]:_0x0889('0xd')};}exports[_0x0889('0xe')]=getFirstInterface;function getCPUhash(){var _0x8596eb=_[_0x0889('0x4')](os[_0x0889('0xf')]()['map'](function(_0x58c9b6){return _0x58c9b6['model'];}))[_0x0889('0x10')](':');return crypto[_0x0889('0x11')](_0x0889('0x12'))['update'](_0x8596eb)[_0x0889('0x13')](_0x0889('0x14'));}exports[_0x0889('0x15')]=function(){var _0x3d1813=os['platform']();var _0x402b36=/[0-9a-f-]{36}/;if(config[_0x0889('0x16')]&&_0x402b36[_0x0889('0x17')](config[_0x0889('0x16')])){return config['licenseToken'];}else if(_0x3d1813===_0x0889('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x0889('0x19')})[_0x0889('0x1a')]('\x0d\x0a','');}else{var _0x216b99=getFirstInterface();var _0x5b1c12=getCPUhash();var _0x8be4b9=_0x5b1c12+'|'+os[_0x0889('0x1b')]()+'|'+_0x216b99[_0x0889('0x1c')]+'|'+_0x216b99[_0x0889('0x1d')];var _0x46de34=crypto[_0x0889('0x11')](_0x0889('0x12'))[_0x0889('0x1e')](_0x8be4b9)[_0x0889('0x13')](_0x0889('0x14'));return _0x46de34[_0x0889('0x1f')](0x0,0x8)+'-'+_0x46de34[_0x0889('0x1f')](0x8,0xc)+'-'+_0x46de34[_0x0889('0x1f')](0xc,0x10)+'-'+_0x46de34[_0x0889('0x1f')](0x10,0x14)+'-'+_0x46de34[_0x0889('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index dd817af..748aa88 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 _0xeb39=['moment','request-promise','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data2','data1','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xeb39,0x74));var _0x9eb3=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xeb39[_0x134c2e];return _0x2825db;};'use strict';var util=require(_0x9eb3('0x0'));var moment=require(_0x9eb3('0x1'));var rp=require(_0x9eb3('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0x9eb3('0x3'))['db'];var encryptor=require(_0x9eb3('0x4'));var hardware=require(_0x9eb3('0x5'));var logger=require(_0x9eb3('0x6'))(_0x9eb3('0x7'));var HOST=_0x9eb3('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x52cc1f){return new BPromise(function(_0x42c521,_0x4730cf){var _0x8d8d27=util[_0x9eb3('0x9')](_0x9eb3('0xa'),HOST,_0x52cc1f,module[_0x9eb3('0xb')][_0x9eb3('0xc')]);if(oldToken){_0x8d8d27=util['format'](_0x9eb3('0xd'),HOST,_0x52cc1f,module['exports'][_0x9eb3('0xc')],oldToken);}var _0x34419f={'uri':_0x8d8d27,'method':_0x9eb3('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x34419f)['then'](function(_0x447e50){_0x42c521(_0x447e50);})[_0x9eb3('0xf')](function(_0x49ff53){_0x4730cf(_0x49ff53);});});}function manageLicense(_0xfb076c,_0x2c60f3){var _0x4a0fa8=_0x2c60f3[_0x9eb3('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4a0fa8['data1']!==_0xfb076c&&!_0x4a0fa8[_0x9eb3('0x11')]){oldToken=_0x4a0fa8[_0x9eb3('0x12')];}httpRequest(_0xfb076c)[_0x9eb3('0x13')](function(_0x7e3f9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x7e3f9[_0x9eb3('0x14')]){isOldTokenSent=![];if(!_0x4a0fa8[_0x9eb3('0x7')]&&_0x4a0fa8['license']!=_0x7e3f9[_0x9eb3('0x7')]||_0x4a0fa8[_0x9eb3('0x7')]&&_0x4a0fa8['data2']){logger[_0x9eb3('0x15')](_0x9eb3('0x16'));}if(_0x4a0fa8[_0x9eb3('0x7')]&&!_0x4a0fa8[_0x9eb3('0x11')]&&_0x4a0fa8['license']!=_0x7e3f9[_0x9eb3('0x7')]){logger['info'](_0x9eb3('0x17'));}if(_0x4a0fa8[_0x9eb3('0x7')]&&!_0x4a0fa8[_0x9eb3('0x11')]&&_0x4a0fa8['license']==_0x7e3f9['license']){return _0x2c60f3;}return _0x2c60f3[_0x9eb3('0x18')]({'data1':_0xfb076c,'data2':null,'license':_0x7e3f9[_0x9eb3('0x7')]});}else{if(_0x7e3f9['license']||_0x4a0fa8['license']){if(!_0x4a0fa8[_0x9eb3('0x11')]){if(_0x4a0fa8[_0x9eb3('0x12')]==_0xfb076c){GRAY_PERIOD_REASON='Disabled';logger[_0x9eb3('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x9eb3('0x19');logger['info'](_0x9eb3('0x1a'),_0x4a0fa8[_0x9eb3('0x12')],_0xfb076c);}logger[_0x9eb3('0x15')](_0x9eb3('0x1b'),GRAY_PERIOD_REASON[_0x9eb3('0x1c')](),moment()[_0x9eb3('0x9')](_0x9eb3('0x1d')));return _0x2c60f3[_0x9eb3('0x18')]({'data2':encryptor['encryptString'](moment()[_0x9eb3('0x9')](_0x9eb3('0x1d')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x4a0fa8['data2']),_0x9eb3('0x1e'))>DAYS){logger[_0x9eb3('0x15')](_0x9eb3('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2c60f3['update']({'data1':_0xfb076c,'data2':null,'license':null});}}}else{if(_0x4a0fa8[_0x9eb3('0x12')]!=_0xfb076c){logger['info'](_0x9eb3('0x1a'),_0x4a0fa8[_0x9eb3('0x12')],_0xfb076c);return _0x2c60f3[_0x9eb3('0x18')]({'data1':_0xfb076c,'data2':null,'license':null});}}}return _0x2c60f3;})['then'](function(_0x13bfca){_0x2c60f3=_0x13bfca;})[_0x9eb3('0xf')](function(_0x451aa3){logger['error'](_0x451aa3[_0x9eb3('0x20')]);})[_0x9eb3('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x9eb3('0x22')](),_0x2c60f3);},TIME);});}function defaultLicense(){var _0x56694e=hardware[_0x9eb3('0x22')]();if(_0x56694e){return db[_0x9eb3('0x23')][_0x9eb3('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x56694e}})['spread'](function(_0x262b4d,_0x543e0e){logger[_0x9eb3('0x15')](_0x9eb3('0x25'),_0x56694e);manageLicense(_0x56694e,_0x262b4d);})[_0x9eb3('0xf')](function(_0x5f443){logger['error'](_0x5f443[_0x9eb3('0x20')]);});}}exports[_0x9eb3('0x26')]=defaultLicense; \ No newline at end of file +var _0x0fc2=['toUpperCase','update','YYYY-MM-DD\x20HH:mm','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../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','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s'];(function(_0x5afdf2,_0x45aa0f){var _0x4a390e=function(_0x3dba86){while(--_0x3dba86){_0x5afdf2['push'](_0x5afdf2['shift']());}};_0x4a390e(++_0x45aa0f);}(_0x0fc2,0xca));var _0x20fc=function(_0x4205c7,_0x17bd88){_0x4205c7=_0x4205c7-0x0;var _0x394658=_0x0fc2[_0x4205c7];return _0x394658;};'use strict';var util=require(_0x20fc('0x0'));var moment=require('moment');var rp=require(_0x20fc('0x1'));var BPromise=require(_0x20fc('0x2'));var pkginfo=require(_0x20fc('0x3'))(module,_0x20fc('0x4'));var db=require(_0x20fc('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x20fc('0x6'));var logger=require(_0x20fc('0x7'))(_0x20fc('0x8'));var HOST=_0x20fc('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x413226){return new BPromise(function(_0x41e32c,_0x1205ab){var _0xc5a3fd=util[_0x20fc('0xa')](_0x20fc('0xb'),HOST,_0x413226,module['exports'][_0x20fc('0x4')]);if(oldToken){_0xc5a3fd=util[_0x20fc('0xa')](_0x20fc('0xc'),HOST,_0x413226,module['exports'][_0x20fc('0x4')],oldToken);}var _0x21950a={'uri':_0xc5a3fd,'method':_0x20fc('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x21950a)[_0x20fc('0xe')](function(_0x3d8b20){_0x41e32c(_0x3d8b20);})[_0x20fc('0xf')](function(_0x313fa9){_0x1205ab(_0x313fa9);});});}function manageLicense(_0x377ac1,_0x4280a4){var _0x461645=_0x4280a4[_0x20fc('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x461645[_0x20fc('0x11')]!==_0x377ac1&&!_0x461645[_0x20fc('0x12')]){oldToken=_0x461645[_0x20fc('0x11')];}httpRequest(_0x377ac1)[_0x20fc('0xe')](function(_0x4539b6){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4539b6[_0x20fc('0x13')]){isOldTokenSent=![];if(!_0x461645[_0x20fc('0x8')]&&_0x461645[_0x20fc('0x8')]!=_0x4539b6[_0x20fc('0x8')]||_0x461645['license']&&_0x461645['data2']){logger[_0x20fc('0x14')](_0x20fc('0x15'));}if(_0x461645['license']&&!_0x461645['data2']&&_0x461645['license']!=_0x4539b6[_0x20fc('0x8')]){logger[_0x20fc('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x461645[_0x20fc('0x8')]&&!_0x461645[_0x20fc('0x12')]&&_0x461645['license']==_0x4539b6[_0x20fc('0x8')]){return _0x4280a4;}return _0x4280a4['update']({'data1':_0x377ac1,'data2':null,'license':_0x4539b6[_0x20fc('0x8')]});}else{if(_0x4539b6[_0x20fc('0x8')]||_0x461645['license']){if(!_0x461645[_0x20fc('0x12')]){if(_0x461645['data1']==_0x377ac1){GRAY_PERIOD_REASON=_0x20fc('0x16');logger[_0x20fc('0x14')](_0x20fc('0x17'));}else{GRAY_PERIOD_REASON=_0x20fc('0x18');logger[_0x20fc('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x461645['data1'],_0x377ac1);}logger[_0x20fc('0x14')](_0x20fc('0x19'),GRAY_PERIOD_REASON[_0x20fc('0x1a')](),moment()[_0x20fc('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x4280a4[_0x20fc('0x1b')]({'data2':encryptor['encryptString'](moment()[_0x20fc('0xa')](_0x20fc('0x1c')))});}else{if(moment()['diff'](encryptor[_0x20fc('0x1d')](_0x461645[_0x20fc('0x12')]),_0x20fc('0x1e'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x20fc('0xa')](_0x20fc('0x1c')));isOldTokenSent=![];return _0x4280a4[_0x20fc('0x1b')]({'data1':_0x377ac1,'data2':null,'license':null});}}}else{if(_0x461645[_0x20fc('0x11')]!=_0x377ac1){logger[_0x20fc('0x14')](_0x20fc('0x1f'),_0x461645[_0x20fc('0x11')],_0x377ac1);return _0x4280a4[_0x20fc('0x1b')]({'data1':_0x377ac1,'data2':null,'license':null});}}}return _0x4280a4;})[_0x20fc('0xe')](function(_0x302b6b){_0x4280a4=_0x302b6b;})[_0x20fc('0xf')](function(_0x415024){logger[_0x20fc('0x20')](_0x415024[_0x20fc('0x21')]);})[_0x20fc('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4280a4);},TIME);});}function defaultLicense(){var _0x289dfa=hardware['getUuid']();if(_0x289dfa){return db['License'][_0x20fc('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x289dfa}})['spread'](function(_0x24ea50,_0x1b0189){logger[_0x20fc('0x14')](_0x20fc('0x24'),_0x289dfa);manageLicense(_0x289dfa,_0x24ea50);})[_0x20fc('0xf')](function(_0x111dba){logger[_0x20fc('0x20')](_0x111dba[_0x20fc('0x21')]);});}}exports[_0x20fc('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 8947076..50ddea6 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 _0x242c=['pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','add','days','grayReason','machineUuid','disabled','message','User','findAll','sequelize','COUNT','col','role','count','user','users','telephones','forEach','admin'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x242c,0x15d));var _0xc242=function(_0x3e0c04,_0x3bcf2e){_0x3e0c04=_0x3e0c04-0x0;var _0x3e5170=_0x242c[_0x3e0c04];return _0x3e5170;};'use strict';var util=require(_0xc242('0x0'));var _=require(_0xc242('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xc242('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xc242('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc242('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc242('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc242('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc242('0x6'),'machineUuid':hardware[_0xc242('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x39285f){return new BPromise(function(_0x3867bc,_0x5df92d){return db[_0xc242('0x8')][_0xc242('0x9')](_[_0xc242('0xa')](_0x39285f,{'raw':!![],'where':{'id':0x1}}))[_0xc242('0xb')](function(_0x56c5c4){return checkLicense(_0x56c5c4,null);})[_0xc242('0xb')](function(_0x42bf59){_0x3867bc(_0x42bf59);return;})[_0xc242('0xc')](function(_0x15f4d4){_0x5df92d(_0x15f4d4);});});}function checkLicense(_0x1b10ef,_0x42dd33){if(!_0x1b10ef){demoLicense[_0xc242('0xd')]=_0x1b10ef[_0xc242('0xe')];return demoLicense;}try{var _0x175d27=_0x42dd33||_0x1b10ef[_0xc242('0xf')];if(_[_0xc242('0x10')](_0x175d27)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x46494e=_0x1b10ef[_0xc242('0xe')];var _0x4c1fe0=_0x1b10ef[_0xc242('0x11')];var _0x1397f8=_0x46494e[_0xc242('0x12')]('-')[0x4];var _0x15e167=_0x46494e['split']('-')[0x0];var _0x1adab7=encryptor[_0xc242('0x13')](_0x175d27,util[_0xc242('0x14')](_0xc242('0x15'),_0x1397f8,_0x46494e,_0x15e167));var _0x46e29d=JSON[_0xc242('0x16')](_0x1adab7);_0x46e29d[_0xc242('0x17')]=![];_0x46e29d[_0xc242('0xd')]=_0x46494e;_0x46e29d['machineUuid']=hardware[_0xc242('0x7')]();if(_0x4c1fe0){var _0x405b58=encryptor[_0xc242('0x13')](_0x4c1fe0);_0x46e29d[_0xc242('0x18')]=_0x405b58;_0x46e29d['deadline']=moment(_0x405b58)[_0xc242('0x19')](0x7,_0xc242('0x1a'))['format']();_0x46e29d[_0xc242('0x1b')]=_0x46e29d['uuid']!=_0x46e29d[_0xc242('0x1c')]?'changed':_0xc242('0x1d');}return _0x46e29d;}catch(_0xa55250){breakingLicense[_0xc242('0xd')]=_0x1b10ef[_0xc242('0xe')];breakingLicense[_0xc242('0x1e')]=_0xa55250['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5efe6f,_0x5ed687){getLicense()['then'](function(_0x44afa5){return db[_0xc242('0x1f')][_0xc242('0x20')]({'attributes':['role',[db[_0xc242('0x21')]['fn'](_0xc242('0x22'),db['sequelize'][_0xc242('0x23')](_0xc242('0x24'))),_0xc242('0x25')]],'group':_0xc242('0x24'),'where':{'role':{'$or':['admin',_0xc242('0x26'),'telephone']}},'raw':!![]})[_0xc242('0xb')](function(_0x162961){var _0x5a3e8f={'user':_0x44afa5[_0xc242('0x27')]||0x0,'telephone':_0x44afa5[_0xc242('0x28')]||0x0};_0x162961[_0xc242('0x29')](function(_0x1e1e00){var _0x4a86d9=_0x1e1e00[_0xc242('0x24')]===_0xc242('0x2a')?'user':_0x1e1e00[_0xc242('0x24')];_0x5a3e8f[_0x4a86d9]-=_0x1e1e00[_0xc242('0x25')];if(_0x5a3e8f[_0x4a86d9]<0x0)_0x5a3e8f[_0x4a86d9]=0x0;});_0x5efe6f(_0x5a3e8f);return;});})['catch'](function(_0x48cf5a){_0x5ed687(_0x48cf5a);});});}function checkUserLimits(_0x391949){return new BPromise(function(_0x5c8083,_0x3b4cec){getLimits()[_0xc242('0xb')](function(_0x3aec54){var _0x2818db=_[_0xc242('0x2b')](_[_0xc242('0x2c')](_0x391949,_0xc242('0x24')),[_0xc242('0x2a'),'user',_0xc242('0x2d')]);var _0xbba5dc=(_0x2818db[_0xc242('0x2a')]||0x0)+(_0x2818db[_0xc242('0x26')]||0x0);var _0x29a7a2=_0x2818db[_0xc242('0x2d')]||0x0;if(_0xbba5dc>_0x3aec54[_0xc242('0x26')])return _0x3b4cec(_0xc242('0x2e'));if(_0x29a7a2>_0x3aec54[_0xc242('0x2d')])return _0x3b4cec(_0xc242('0x2f'));return _0x5c8083();})[_0xc242('0xc')](function(_0x290caa){_0x3b4cec(_0x290caa);});});}module[_0xc242('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x45fd=['count','admin','telephone','telephones','user','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','../../components/encryptor','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','uuid','decryptString','deadline','add','days','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col'];(function(_0x1b94b4,_0x18a184){var _0x119e4a=function(_0x3114f9){while(--_0x3114f9){_0x1b94b4['push'](_0x1b94b4['shift']());}};_0x119e4a(++_0x18a184);}(_0x45fd,0x168));var _0xd45f=function(_0x5fd790,_0x3ef8f3){_0x5fd790=_0x5fd790-0x0;var _0x316a46=_0x45fd[_0x5fd790];return _0x316a46;};'use strict';var util=require(_0xd45f('0x0'));var _=require(_0xd45f('0x1'));var moment=require('moment');var BPromise=require(_0xd45f('0x2'));var hardware=require('./hardware');var encryptor=require(_0xd45f('0x3'));var db=require('../../mysqldb')['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':_0xd45f('0x4'),'machineUuid':hardware[_0xd45f('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd45f('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd45f('0x7'),'machineUuid':hardware[_0xd45f('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x368f74){return new BPromise(function(_0x1f1d3b,_0x39b44c){return db[_0xd45f('0x8')][_0xd45f('0x9')](_[_0xd45f('0xa')](_0x368f74,{'raw':!![],'where':{'id':0x1}}))[_0xd45f('0xb')](function(_0x2d0c17){return checkLicense(_0x2d0c17,null);})[_0xd45f('0xb')](function(_0x17d345){_0x1f1d3b(_0x17d345);return;})[_0xd45f('0xc')](function(_0xb0daee){_0x39b44c(_0xb0daee);});});}function checkLicense(_0xc0476,_0x2e12b3){if(!_0xc0476){demoLicense['uuid']=_0xc0476[_0xd45f('0xd')];return demoLicense;}try{var _0x492f8a=_0x2e12b3||_0xc0476[_0xd45f('0xe')];if(_['isEmpty'](_0x492f8a)){throw new Error(_0xd45f('0xf'));}var _0x3958af=_0xc0476['data1'];var _0x49006f=_0xc0476[_0xd45f('0x10')];var _0x375041=_0x3958af[_0xd45f('0x11')]('-')[0x4];var _0x2648e7=_0x3958af[_0xd45f('0x11')]('-')[0x0];var _0x2edccb=encryptor['decryptString'](_0x492f8a,util[_0xd45f('0x12')](_0xd45f('0x13'),_0x375041,_0x3958af,_0x2648e7));var _0x494779=JSON[_0xd45f('0x14')](_0x2edccb);_0x494779[_0xd45f('0x15')]=![];_0x494779[_0xd45f('0x16')]=_0x3958af;_0x494779['machineUuid']=hardware[_0xd45f('0x5')]();if(_0x49006f){var _0x34f756=encryptor[_0xd45f('0x17')](_0x49006f);_0x494779['gray']=_0x34f756;_0x494779[_0xd45f('0x18')]=moment(_0x34f756)[_0xd45f('0x19')](0x7,_0xd45f('0x1a'))[_0xd45f('0x12')]();_0x494779[_0xd45f('0x1b')]=_0x494779[_0xd45f('0x16')]!=_0x494779['machineUuid']?_0xd45f('0x1c'):'disabled';}return _0x494779;}catch(_0x1b51b9){breakingLicense['uuid']=_0xc0476['data1'];breakingLicense[_0xd45f('0x1d')]=_0x1b51b9[_0xd45f('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2de45d,_0x570801){getLicense()[_0xd45f('0xb')](function(_0x87d89f){return db[_0xd45f('0x1e')][_0xd45f('0x1f')]({'attributes':[_0xd45f('0x20'),[db[_0xd45f('0x21')]['fn'](_0xd45f('0x22'),db[_0xd45f('0x21')][_0xd45f('0x23')]('role')),_0xd45f('0x24')]],'group':_0xd45f('0x20'),'where':{'role':{'$or':[_0xd45f('0x25'),'user',_0xd45f('0x26')]}},'raw':!![]})['then'](function(_0x417540){var _0x29d429={'user':_0x87d89f['users']||0x0,'telephone':_0x87d89f[_0xd45f('0x27')]||0x0};_0x417540['forEach'](function(_0x9131c){var _0x3df41b=_0x9131c[_0xd45f('0x20')]==='admin'?_0xd45f('0x28'):_0x9131c[_0xd45f('0x20')];_0x29d429[_0x3df41b]-=_0x9131c[_0xd45f('0x24')];if(_0x29d429[_0x3df41b]<0x0)_0x29d429[_0x3df41b]=0x0;});_0x2de45d(_0x29d429);return;});})[_0xd45f('0xc')](function(_0x13aae6){_0x570801(_0x13aae6);});});}function checkUserLimits(_0x7c349e){return new BPromise(function(_0x4f173b,_0x2541fb){getLimits()[_0xd45f('0xb')](function(_0x40fc76){var _0x3b81d8=_[_0xd45f('0x29')](_['countBy'](_0x7c349e,_0xd45f('0x20')),['admin','user',_0xd45f('0x26')]);var _0x2568dc=(_0x3b81d8[_0xd45f('0x25')]||0x0)+(_0x3b81d8[_0xd45f('0x28')]||0x0);var _0x5c1c76=_0x3b81d8[_0xd45f('0x26')]||0x0;if(_0x2568dc>_0x40fc76['user'])return _0x2541fb(_0xd45f('0x2a'));if(_0x5c1c76>_0x40fc76['telephone'])return _0x2541fb(_0xd45f('0x2b'));return _0x4f173b();})['catch'](function(_0x5a7dc9){_0x2541fb(_0x5a7dc9);});});}module['exports']={'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 82c2941..c2dec45 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 _0x9f0e=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x454f6a,_0x48ef53){var _0x41da65=function(_0x50ef5d){while(--_0x50ef5d){_0x454f6a['push'](_0x454f6a['shift']());}};_0x41da65(++_0x48ef53);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3930a4,_0xf4b113){_0x3930a4=_0x3930a4-0x0;var _0x3f2e03=_0x9f0e[_0x3930a4];return _0x3f2e03;};'use strict';module[_0xe9f0('0x0')]={'DOMAIN':_0xe9f0('0x1'),'SESSION_SECRET':_0xe9f0('0x2'),'GOOGLE_ID':_0xe9f0('0x3'),'GOOGLE_SECRET':_0xe9f0('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xb03e=['myappanuglar-secret','app-id','secret','http://localhost:9000'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1f26a8,_0x8b456e){_0x1f26a8=_0x1f26a8-0x0;var _0x428c2b=_0xb03e[_0x1f26a8];return _0x428c2b;};'use strict';module['exports']={'DOMAIN':_0xeb03('0x0'),'SESSION_SECRET':_0xeb03('0x1'),'GOOGLE_ID':_0xeb03('0x2'),'GOOGLE_SECRET':_0xeb03('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c26003d..5da9773 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5863=['exports','../utils/loggers'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0x5863,0xf5));var _0x3586=function(_0x5dc05d,_0x1423af){_0x5dc05d=_0x5dc05d-0x0;var _0x1c9e6c=_0x5863[_0x5dc05d];return _0x1c9e6c;};'use strict';var fileLogger=require(_0x3586('0x0'))['fileLogger'];module[_0x3586('0x1')]=fileLogger; \ No newline at end of file +var _0xf351=['exports','../utils/loggers'];(function(_0x12ad86,_0x243f0a){var _0x2ccfe8=function(_0x44f7ca){while(--_0x44f7ca){_0x12ad86['push'](_0x12ad86['shift']());}};_0x2ccfe8(++_0x243f0a);}(_0xf351,0x167));var _0x1f35=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xf351[_0x4a7843];return _0x2c57fe;};'use strict';var fileLogger=require(_0x1f35('0x0'))['fileLogger'];module[_0x1f35('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 8d42092..c7eaec6 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 _0x8715=['../../services/xdr/index.js','exports','../../config/environment','resolve','join','legacy-libs','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','xdr'];(function(_0xf0ab64,_0x381317){var _0x27a23d=function(_0x57ab5e){while(--_0x57ab5e){_0xf0ab64['push'](_0xf0ab64['shift']());}};_0x27a23d(++_0x381317);}(_0x8715,0x1b4));var _0x5871=function(_0x845fcc,_0x518cfb){_0x845fcc=_0x845fcc-0x0;var _0x3a0e79=_0x8715[_0x845fcc];return _0x3a0e79;};'use strict';var path=require('path');var cfg=require(_0x5871('0x0'));var env={'NODE_PATH':path[_0x5871('0x1')](path[_0x5871('0x2')](cfg['root'],_0x5871('0x3')))};var pm2config={'apps':[{'name':'express','script':path[_0x5871('0x2')](__dirname,_0x5871('0x4')),'env':env},{'name':_0x5871('0x5'),'script':path[_0x5871('0x2')](__dirname,_0x5871('0x6')),'env':env},{'name':_0x5871('0x7'),'script':path['join'](__dirname,_0x5871('0x8')),'env':env},{'name':_0x5871('0x9'),'script':path[_0x5871('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x5871('0xa'),'script':path[_0x5871('0x2')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x5871('0xb'),'script':path[_0x5871('0x2')](__dirname,_0x5871('0xc')),'env':env}]};module[_0x5871('0xd')]=pm2config; \ No newline at end of file +var _0x3028=['xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','legacy-libs','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js'];(function(_0x3f1673,_0x85a8e){var _0x18a77c=function(_0x19acc9){while(--_0x19acc9){_0x3f1673['push'](_0x3f1673['shift']());}};_0x18a77c(++_0x85a8e);}(_0x3028,0xd5));var _0x8302=function(_0x362264,_0x34b0b4){_0x362264=_0x362264-0x0;var _0x44143b=_0x3028[_0x362264];return _0x44143b;};'use strict';var path=require(_0x8302('0x0'));var cfg=require(_0x8302('0x1'));var env={'NODE_PATH':path[_0x8302('0x2')](path[_0x8302('0x3')](cfg['root'],_0x8302('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x8302('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x8302('0x5'),'script':path['join'](__dirname,_0x8302('0x6')),'env':env},{'name':_0x8302('0x7'),'script':path[_0x8302('0x3')](__dirname,_0x8302('0x8')),'env':env},{'name':_0x8302('0x9'),'script':path[_0x8302('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x8302('0xa'),'script':path[_0x8302('0x3')](__dirname,_0x8302('0xb')),'env':env},{'name':_0x8302('0xc'),'script':path[_0x8302('0x3')](__dirname,_0x8302('0xd')),'env':env}]};module[_0x8302('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b790fe9..3847eaa 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 _0xcf60=['delete','dump','saved','pm2','bluebird','connect','connected','start','then','stop','disconnect','restart','list','describe'];(function(_0x5f2dd3,_0x13cc28){var _0x3e01c4=function(_0x9ef930){while(--_0x9ef930){_0x5f2dd3['push'](_0x5f2dd3['shift']());}};_0x3e01c4(++_0x13cc28);}(_0xcf60,0x1d1));var _0x0cf6=function(_0x1c8c60,_0x30bfc0){_0x1c8c60=_0x1c8c60-0x0;var _0x1285bf=_0xcf60[_0x1c8c60];return _0x1285bf;};'use strict';var pm2=require(_0x0cf6('0x0'));var BPromise=require(_0x0cf6('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x3fe5c0,_0x313b3e){return pm2[_0x0cf6('0x2')](function(_0x5848fd){if(_0x5848fd){return _0x313b3e(_0x5848fd);}return _0x3fe5c0(_0x0cf6('0x3'));});});};exports[_0x0cf6('0x4')]=function(_0x2deab2){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0xd39c0f,_0x12deb1){return pm2[_0x0cf6('0x4')](_0x2deab2,function(_0x26f1b9,_0x332286){if(_0x26f1b9){return _0x12deb1(_0x26f1b9);}pm2['disconnect']();return _0xd39c0f(_0x332286);});});});};exports[_0x0cf6('0x6')]=function(_0x2d3447){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0x28e75c,_0x99b706){return pm2['stop'](_0x2d3447,function(_0x2873bb,_0x56fa49){if(_0x2873bb){return _0x99b706(_0x2873bb);}pm2[_0x0cf6('0x7')]();return _0x28e75c(_0x56fa49);});});});};exports[_0x0cf6('0x8')]=function(_0x1ced86){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0x5869b1,_0x1be6c4){return pm2[_0x0cf6('0x8')](_0x1ced86,function(_0x1f5550,_0x1c9c6e){if(_0x1f5550){return _0x1be6c4(_0x1f5550);}pm2[_0x0cf6('0x7')]();return _0x5869b1(_0x1c9c6e);});});});};exports[_0x0cf6('0x9')]=function(){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0x7eb5e6,_0x3ac894){return pm2[_0x0cf6('0x9')](function(_0x3e3c4e,_0x35fa5b){if(_0x3e3c4e){return _0x3ac894(_0x3e3c4e);}pm2['disconnect']();return _0x7eb5e6(_0x35fa5b);});});});};exports[_0x0cf6('0xa')]=function(_0x4ce5a9){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0x1e5bab,_0x5bc6a6){return pm2[_0x0cf6('0xa')](_0x4ce5a9,function(_0x1cd2e2,_0x336bf4){if(_0x1cd2e2){return _0x5bc6a6(_0x1cd2e2);}pm2['disconnect']();return _0x1e5bab(_0x336bf4);});});});};exports[_0x0cf6('0xb')]=function(_0x2ac930){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0x1295d1,_0x3de3b2){return pm2[_0x0cf6('0xb')](_0x2ac930,function(_0x2c6cd0,_0x535f08){if(_0x2c6cd0){return _0x3de3b2(_0x2c6cd0);}pm2[_0x0cf6('0x7')]();return _0x1295d1(_0x535f08);});});});};exports[_0x0cf6('0xc')]=function(){return connect()[_0x0cf6('0x5')](function(){return new BPromise(function(_0xe50c21,_0xc4800){return pm2[_0x0cf6('0xc')](function(_0x3f8297){if(_0x3f8297){return _0xc4800(_0x3f8297);}return _0xe50c21(_0x0cf6('0xd'));});});});}; \ No newline at end of file +var _0x6d82=['connect','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d82,0x1ab));var _0x26d8=function(_0x29f57c,_0x4f1ef3){_0x29f57c=_0x29f57c-0x0;var _0x4542df=_0x6d82[_0x29f57c];return _0x4542df;};'use strict';var pm2=require(_0x26d8('0x0'));var BPromise=require('bluebird');var config=require(_0x26d8('0x1'));function connect(){return new BPromise(function(_0xf1241c,_0x4afafa){return pm2[_0x26d8('0x2')](function(_0x29bf71){if(_0x29bf71){return _0x4afafa(_0x29bf71);}return _0xf1241c('connected');});});};exports[_0x26d8('0x3')]=function(_0x10c5ac){return connect()[_0x26d8('0x4')](function(){return new BPromise(function(_0x222dbf,_0x469831){return pm2['start'](_0x10c5ac,function(_0x5a2016,_0x22b382){if(_0x5a2016){return _0x469831(_0x5a2016);}pm2[_0x26d8('0x5')]();return _0x222dbf(_0x22b382);});});});};exports[_0x26d8('0x6')]=function(_0x5d0d0d){return connect()[_0x26d8('0x4')](function(){return new BPromise(function(_0x4631b7,_0x2341f9){return pm2[_0x26d8('0x6')](_0x5d0d0d,function(_0x128c42,_0x2c4b30){if(_0x128c42){return _0x2341f9(_0x128c42);}pm2['disconnect']();return _0x4631b7(_0x2c4b30);});});});};exports[_0x26d8('0x7')]=function(_0x55fa4f){return connect()[_0x26d8('0x4')](function(){return new BPromise(function(_0x4fd4a3,_0x796e8){return pm2[_0x26d8('0x7')](_0x55fa4f,function(_0x4e93cd,_0x31c64c){if(_0x4e93cd){return _0x796e8(_0x4e93cd);}pm2[_0x26d8('0x5')]();return _0x4fd4a3(_0x31c64c);});});});};exports[_0x26d8('0x8')]=function(){return connect()[_0x26d8('0x4')](function(){return new BPromise(function(_0x2eb888,_0x38add3){return pm2[_0x26d8('0x8')](function(_0x554b83,_0x3105f8){if(_0x554b83){return _0x38add3(_0x554b83);}pm2[_0x26d8('0x5')]();return _0x2eb888(_0x3105f8);});});});};exports[_0x26d8('0x9')]=function(_0x552d4a){return connect()['then'](function(){return new BPromise(function(_0x4ba3c3,_0x416176){return pm2[_0x26d8('0x9')](_0x552d4a,function(_0x416b9c,_0x18ffeb){if(_0x416b9c){return _0x416176(_0x416b9c);}pm2[_0x26d8('0x5')]();return _0x4ba3c3(_0x18ffeb);});});});};exports[_0x26d8('0xa')]=function(_0x464dd1){return connect()['then'](function(){return new BPromise(function(_0x50e793,_0xca99f0){return pm2[_0x26d8('0xa')](_0x464dd1,function(_0x312139,_0x4f72de){if(_0x312139){return _0xca99f0(_0x312139);}pm2['disconnect']();return _0x50e793(_0x4f72de);});});});};exports[_0x26d8('0xb')]=function(){return connect()[_0x26d8('0x4')](function(){return new BPromise(function(_0x375edc,_0x58f566){return pm2[_0x26d8('0xb')](function(_0x2beef3){if(_0x2beef3){return _0x58f566(_0x2beef3);}return _0x375edc(_0x26d8('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fde3694..a13ee9e 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 _0xea2a=['lastMsgAt','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','ChatInteraction','findAll'];(function(_0x40cb8c,_0x381f11){var _0x5315ce=function(_0x5627ba){while(--_0x5627ba){_0x40cb8c['push'](_0x40cb8c['shift']());}};_0x5315ce(++_0x381f11);}(_0xea2a,0x92));var _0xaea2=function(_0x3c0cd6,_0x5ba428){_0x3c0cd6=_0x3c0cd6-0x0;var _0x4381ec=_0xea2a[_0x3c0cd6];return _0x4381ec;};'use strict';var _=require('lodash');var moment=require(_0xaea2('0x0'));var Redis=require(_0xaea2('0x1'));var util=require(_0xaea2('0x2'));var config=require('../../config/environment');var db=require(_0xaea2('0x3'))['db'];var logger=require(_0xaea2('0x4'))(_0xaea2('0x5'));config[_0xaea2('0x6')]=_[_0xaea2('0x7')](config[_0xaea2('0x6')],{'host':_0xaea2('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaea2('0x6')]));function closeInteractions(){var _0x5c0c45=0x0;var _0x155e63=[];return db[_0xaea2('0x9')][_0xaea2('0xa')]({'raw':!![],'attributes':['id',_0xaea2('0xb')],'where':{'id':0x1}})['then'](function(_0x421a03){_0x5c0c45=_0x421a03['chatTimeout'];if(_0x5c0c45){return db[_0xaea2('0xc')][_0xaea2('0xd')]({'raw':!![],'attributes':['id',_0xaea2('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x421a03[_0xaea2('0xb')],_0xaea2('0xf'))}}});}else{return[];}})[_0xaea2('0x10')](function(_0x1160ad){if(_0x1160ad&&_0x1160ad[_0xaea2('0x11')]){_0x155e63=_['map'](_0x1160ad||[],'id');logger[_0xaea2('0x12')](_0xaea2('0x13'),_0x155e63[_0xaea2('0x14')]());return db[_0xaea2('0xc')][_0xaea2('0x15')]({'closeReason':_0xaea2('0x16'),'disposition':_0xaea2('0x17'),'closed':!![],'closedAt':moment()[_0xaea2('0x18')](_0xaea2('0x19'))},{'where':{'id':_0x155e63}});}})['then'](function(){if(_0x155e63&&_0x155e63[_0xaea2('0x11')]){logger[_0xaea2('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x155e63[_0xaea2('0x14')]());for(var _0x5aa3ab=0x0;_0x5aa3ab<_0x155e63[_0xaea2('0x11')];_0x5aa3ab++){io[_0xaea2('0x1a')]('chatInteraction:update',{'id':_0x155e63[_0x5aa3ab],'closed':!![]});}}})[_0xaea2('0x1b')](function(_0x4b8138){logger[_0xaea2('0x1c')](_0xaea2('0x1d'),_0x4b8138?util[_0xaea2('0x1e')](_0x4b8138,{'showHidden':![],'depth':null}):'');});}exports[_0xaea2('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xbb76=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x2a3ad2,_0x3d9c0a){var _0x35a34d=function(_0x3f15c7){while(--_0x3f15c7){_0x2a3ad2['push'](_0x2a3ad2['shift']());}};_0x35a34d(++_0x3d9c0a);}(_0xbb76,0x12f));var _0x6bb7=function(_0x255b94,_0x352b45){_0x255b94=_0x255b94-0x0;var _0xc5806b=_0xbb76[_0x255b94];return _0xc5806b;};'use strict';var _=require('lodash');var moment=require(_0x6bb7('0x0'));var Redis=require(_0x6bb7('0x1'));var util=require(_0x6bb7('0x2'));var config=require(_0x6bb7('0x3'));var db=require(_0x6bb7('0x4'))['db'];var logger=require('../logger')(_0x6bb7('0x5'));config['redis']=_['defaults'](config[_0x6bb7('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6bb7('0x7'))(new Redis(config[_0x6bb7('0x6')]));function closeInteractions(){var _0x2fa553=0x0;var _0x6eae0a=[];return db[_0x6bb7('0x8')][_0x6bb7('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6bb7('0xa')](function(_0x22e262){_0x2fa553=_0x22e262[_0x6bb7('0xb')];if(_0x2fa553){return db[_0x6bb7('0xc')][_0x6bb7('0xd')]({'raw':!![],'attributes':['id',_0x6bb7('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6bb7('0xf')](_0x22e262['chatTimeout'],'minutes')}}});}else{return[];}})[_0x6bb7('0xa')](function(_0x4850b4){if(_0x4850b4&&_0x4850b4['length']){_0x6eae0a=_[_0x6bb7('0x10')](_0x4850b4||[],'id');logger[_0x6bb7('0x11')](_0x6bb7('0x12'),_0x6eae0a[_0x6bb7('0x13')]());return db[_0x6bb7('0xc')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x6bb7('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x6eae0a}});}})[_0x6bb7('0xa')](function(){if(_0x6eae0a&&_0x6eae0a[_0x6bb7('0x15')]){logger['info'](_0x6bb7('0x16'),_0x6eae0a[_0x6bb7('0x13')]());for(var _0x494ef3=0x0;_0x494ef3<_0x6eae0a[_0x6bb7('0x15')];_0x494ef3++){io[_0x6bb7('0x17')](_0x6bb7('0x18'),{'id':_0x6eae0a[_0x494ef3],'closed':!![]});}}})['catch'](function(_0x2ea420){logger[_0x6bb7('0x19')](_0x6bb7('0x1a'),_0x2ea420?util[_0x6bb7('0x1b')](_0x2ea420,{'showHidden':![],'depth':null}):'');});}exports[_0x6bb7('0x1c')]=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 501ecd2..72b23c5 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 _0x78b5=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x59e30d,_0x564720){var _0x33d0ce=function(_0x3176aa){while(--_0x3176aa){_0x59e30d['push'](_0x59e30d['shift']());}};_0x33d0ce(++_0x564720);}(_0x78b5,0xa4));var _0x578b=function(_0x25720a,_0x3365f6){_0x25720a=_0x25720a-0x0;var _0x1d5485=_0x78b5[_0x25720a];return _0x1d5485;};'use strict';function start(){var _0x168d95=require(_0x578b('0x0'));return _0x168d95[_0x578b('0x1')]();}module[_0x578b('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xc399=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xc399,0x17f));var _0x9c39=function(_0x42bd44,_0x51fe91){_0x42bd44=_0x42bd44-0x0;var _0x2cee8a=_0xc399[_0x42bd44];return _0x2cee8a;};'use strict';function start(){var _0x521c41=require(_0x9c39('0x0'));return _0x521c41[_0x9c39('0x1')]();}module[_0x9c39('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 74a4c41..46ec28f 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 _0x0286=['Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','CloudProvider','map','toString','difference','intersection','length','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','isBetween','startAt','endAt','cron','start','add\x20cron','exists','stop','stop\x20cron','update','update\x20cron','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','status','Sent','message','attachments','text'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x0286,0x7f));var _0x6028=function(_0x4b978a,_0x472e65){_0x4b978a=_0x4b978a-0x0;var _0x2dbd2c=_0x0286[_0x4b978a];return _0x2dbd2c;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x6028('0x0'));var _=require(_0x6028('0x1'));var moment=require(_0x6028('0x2'));var CronJobManager=require(_0x6028('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x6028('0x4'));var logger=require(_0x6028('0x5'))(_0x6028('0x6'));var db=require(_0x6028('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x6028('0x8'));var client=jayson['client'][_0x6028('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x22cd7f,_0xe56f9e){return function(){logger[_0x6028('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x22cd7f[_0x6028('0xb')]);var _0x1ddbfa=!![];var _0x27f633=_0x22cd7f[_0x6028('0xc')]['getSmtpOptions']();var _0x5e42f3={'account':_0x27f633,'message':{'from':util[_0x6028('0xd')](_0x6028('0xe'),_0x22cd7f[_0x6028('0xc')][_0x6028('0xf')],_0x22cd7f[_0x6028('0xc')]['email']||_0x22cd7f[_0x6028('0xc')][_0x6028('0x10')][_0x6028('0x11')]),'to':_0x22cd7f[_0x6028('0xb')],'cc':_0x22cd7f['cc'],'bcc':_0x22cd7f[_0x6028('0x12')],'subject':util[_0x6028('0xd')](_0x6028('0x13'),_0xe56f9e[_0x6028('0xf')],_0x22cd7f[_0x6028('0x14')],_0x22cd7f[_0x6028('0x15')])}};var _0x390356=path[_0x6028('0x16')](__dirname,_0x6028('0x17'));var _0x40c1a1=_0xe56f9e[_0x6028('0x18')];var _0x2e8c77=util[_0x6028('0xd')]('%s.%s',path[_0x6028('0x19')](_0xe56f9e[_0x6028('0x18')],path[_0x6028('0x1a')](_0xe56f9e['savename'])),_0x6028('0x1b'));var _0x51a040=path[_0x6028('0x16')](_0x390356,_0x40c1a1);var _0x28d74b=path[_0x6028('0x16')](_0x390356,_0x2e8c77);if(fs['existsSync'](_0x51a040)){_0xe56f9e[_0x6028('0x1c')]=_0x6028('0x1d');_0x5e42f3[_0x6028('0x1e')][_0x6028('0x1f')]=[{'filename':_0x40c1a1,'path':_0x51a040}];_0x5e42f3[_0x6028('0x1e')][_0x6028('0x20')]=util['format'](_0x6028('0x21'),JSON[_0x6028('0x22')](_0xe56f9e,null,0x2));}else if(fs[_0x6028('0x23')](_0x28d74b)){_0xe56f9e[_0x6028('0x1c')]=_0x6028('0x1d');_0x5e42f3[_0x6028('0x1e')][_0x6028('0x1f')]=[{'filename':_0x2e8c77,'path':_0x28d74b}];}else{_0x5e42f3['message'][_0x6028('0x20')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x22cd7f[_0x6028('0x24')]){_0x1ddbfa=![];logger['info'](_0x6028('0x25'));}}if(_0x1ddbfa){return client[_0x6028('0x26')](_0x6028('0x27'),_0x5e42f3)[_0x6028('0x28')](function(_0x6615a1){if(_0x6615a1[_0x6028('0x29')]){return logger[_0x6028('0x29')](_0x6028('0x2a'),JSON[_0x6028('0x22')](_0x6615a1));}return logger[_0x6028('0xa')](_0x6028('0x2b'));})[_0x6028('0x2c')](function(_0x4f8f9d){return logger[_0x6028('0x29')]('error\x20mail',JSON[_0x6028('0x22')](_0x4f8f9d));});}};}function handleError(){return function(_0x193176){return logger[_0x6028('0x29')](JSON[_0x6028('0x22')](_0x193176));};}function handleResult(_0x258e01){return function(_0x353e31){logger[_0x6028('0xa')](_0x6028('0x2d'),JSON[_0x6028('0x22')](_0x353e31));if(_0x258e01['MailAccount']&&_0x258e01[_0x6028('0xc')][_0x6028('0x10')]&&!_[_0x6028('0x2e')](_0x258e01[_0x6028('0xb')])){setTimeout(handleSendEmail(_0x258e01,_0x353e31),0x3c*0x3e8);}};}function handleJob(_0x489ad9){return function(){try{if(_[_0x6028('0x2e')](_0x489ad9[_0x6028('0x14')])){return logger[_0x6028('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x6028('0x2e')](_0x489ad9[_0x6028('0x15')])){return logger['info'](_0x6028('0x2f'));}var _0x184d6e={'startDate':moment()[_0x6028('0x30')](_0x489ad9[_0x6028('0x14')],_0x489ad9[_0x6028('0x15')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x6028('0x31')),'type':'scheduled','output':_0x489ad9[_0x6028('0x32')],'name':_0x489ad9[_0x6028('0xf')]};if(!_[_0x6028('0x2e')](_0x489ad9['DefaultReportId'])){logger[_0x6028('0xa')](_0x6028('0x33'),_0x489ad9['DefaultReportId']);return analyticDefaultReportController[_0x6028('0x34')]({'id':_0x489ad9[_0x6028('0x35')]},_0x184d6e)['then'](handleResult(_0x489ad9))[_0x6028('0x2c')](handleError());}if(!_[_0x6028('0x2e')](_0x489ad9[_0x6028('0x36')])){logger[_0x6028('0xa')](_0x6028('0x37'),_0x489ad9[_0x6028('0x36')]);return analyticCustomReportController[_0x6028('0x34')]({'id':_0x489ad9[_0x6028('0x36')]},_0x184d6e)[_0x6028('0x28')](handleResult(_0x489ad9))[_0x6028('0x2c')](handleError());}}catch(_0x520480){logger[_0x6028('0x29')](JSON[_0x6028('0x22')](_0x520480));}return logger[_0x6028('0xa')](_0x6028('0x38'));};}function getJobs(_0x12697f){var _0x14321a={};if(_0x12697f){_0x14321a['id']=_0x12697f;}return db['Schedule']['findAll']({'where':_0x14321a,'include':[{'model':db[_0x6028('0xc')],'attributes':['id',_0x6028('0xf'),_0x6028('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x6028('0x10'),'include':[{'model':db[_0x6028('0x39')],'as':_0x6028('0x39')}]}]}]})['then'](function(_0x1539e8){var _0x43438c=_['keys'](manager['jobs']);var _0x198b7a=_[_0x6028('0x3a')](_0x1539e8,function(_0x26a258){return _0x26a258['id'][_0x6028('0x3b')]();});var _0x2d7d67=_['keyBy'](_0x1539e8,function(_0x1222b2){return _0x1222b2['id']['toString']();});var _0x17b7a2=_0x12697f?_0x198b7a:_[_0x6028('0x3c')](_0x198b7a,_0x43438c);var _0x55a657=_[_0x6028('0x3d')](_0x198b7a,_0x43438c);var _0x33bfa7=_[_0x6028('0x3c')](_0x43438c,_0x198b7a);var _0x5f1b47;var _0x431e9c;for(_0x5f1b47=0x0;_0x5f1b47<_0x33bfa7[_0x6028('0x3e')]&&!_0x12697f;_0x5f1b47+=0x1){_0x431e9c=_0x33bfa7[_0x5f1b47][_0x6028('0x3b')]();if(manager['exists'](_0x431e9c)){manager['stop'](_0x431e9c);manager[_0x6028('0x3f')](_0x431e9c);logger[_0x6028('0xa')](_0x6028('0x40'),_0x431e9c);}}logger[_0x6028('0xa')](_0x6028('0x41'),JSON[_0x6028('0x22')](_0x17b7a2));for(_0x5f1b47=0x0;_0x5f1b47<_0x17b7a2[_0x6028('0x3e')];_0x5f1b47+=0x1){_0x431e9c=_0x17b7a2[_0x5f1b47][_0x6028('0x3b')]();logger[_0x6028('0xa')]('index',_0x431e9c);if(_0x12697f){logger[_0x6028('0xa')](_0x6028('0x42'),_0x12697f);logger['info'](JSON[_0x6028('0x22')](_0x2d7d67[_0x431e9c]));BPromise[_0x6028('0x43')]()[_0x6028('0x28')](handleJob(_0x2d7d67[_0x431e9c]));logger['info'](_0x6028('0x44'),_0x2d7d67[_0x431e9c][_0x6028('0xf')],_0x2d7d67[_0x431e9c]['cron']);}else if(_0x2d7d67[_0x431e9c]['cron']&&_0x2d7d67[_0x431e9c]['active']&&moment()[_0x6028('0x45')](_0x2d7d67[_0x431e9c][_0x6028('0x46')],_0x2d7d67[_0x431e9c][_0x6028('0x47')])){manager['add'](_0x431e9c,_0x2d7d67[_0x431e9c][_0x6028('0x48')],handleJob(_0x2d7d67[_0x431e9c]));manager[_0x6028('0x49')](_0x431e9c);logger[_0x6028('0xa')](_0x6028('0x4a'),_0x2d7d67[_0x431e9c]['name'],_0x2d7d67[_0x431e9c]['cron']);}else if(manager[_0x6028('0x4b')](_0x431e9c)){manager[_0x6028('0x4c')](_0x431e9c);manager['deleteJob'](_0x431e9c);logger[_0x6028('0xa')](_0x6028('0x4d'),_0x2d7d67[_0x431e9c][_0x6028('0xf')],_0x2d7d67[_0x431e9c][_0x6028('0x48')]);}}for(_0x5f1b47=0x0,_0x431e9c;_0x5f1b47<_0x55a657[_0x6028('0x3e')]&&!_0x12697f;_0x5f1b47+=0x1){_0x431e9c=_0x55a657[_0x5f1b47][_0x6028('0x3b')]();if(manager[_0x6028('0x4b')](_0x431e9c)){if(_0x2d7d67[_0x431e9c][_0x6028('0x48')]&&_0x2d7d67[_0x431e9c]['active']&&moment()[_0x6028('0x45')](_0x2d7d67[_0x431e9c][_0x6028('0x46')],_0x2d7d67[_0x431e9c][_0x6028('0x47')])){manager[_0x6028('0x4e')](_0x431e9c,_0x2d7d67[_0x431e9c][_0x6028('0x48')],handleJob(_0x2d7d67[_0x431e9c]));logger[_0x6028('0xa')](_0x6028('0x4f'),_0x2d7d67[_0x431e9c][_0x6028('0xf')],_0x2d7d67[_0x431e9c][_0x6028('0x48')]);}else{manager[_0x6028('0x4c')](_0x431e9c);manager[_0x6028('0x3f')](_0x431e9c);logger['info']('stop\x20cron',_0x2d7d67[_0x431e9c][_0x6028('0xf')],_0x2d7d67[_0x431e9c][_0x6028('0x48')]);}}}})[_0x6028('0x2c')](function(_0xb1dc53){logger['error'](JSON[_0x6028('0x22')](_0xb1dc53));});}exports['run']=function(_0x36175b){return getJobs(_0x36175b);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2896=['path','lodash','moment','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','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','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','MailServerOut','CloudProvider','then','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','run','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2896,0x14f));var _0x6289=function(_0x5abc37,_0x45b4bf){_0x5abc37=_0x5abc37-0x0;var _0x151100=_0x2896[_0x5abc37];return _0x151100;};'use strict';var fs=require('fs');var util=require(_0x6289('0x0'));var path=require(_0x6289('0x1'));var _=require(_0x6289('0x2'));var moment=require(_0x6289('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require('../logger')(_0x6289('0x4'));var db=require(_0x6289('0x5'))['db'];var analyticCustomReportController=require(_0x6289('0x6'));var analyticDefaultReportController=require(_0x6289('0x7'));var client=jayson[_0x6289('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x35d42b,_0x2d8630){return function(){logger[_0x6289('0x9')](_0x6289('0xa'),_0x35d42b[_0x6289('0xb')]);var _0xd0e582=!![];var _0x184fbf=_0x35d42b[_0x6289('0xc')][_0x6289('0xd')]();var _0x27ce7f={'account':_0x184fbf,'message':{'from':util[_0x6289('0xe')](_0x6289('0xf'),_0x35d42b[_0x6289('0xc')][_0x6289('0x10')],_0x35d42b[_0x6289('0xc')]['email']||_0x35d42b[_0x6289('0xc')][_0x6289('0x11')]['user']),'to':_0x35d42b[_0x6289('0xb')],'cc':_0x35d42b['cc'],'bcc':_0x35d42b[_0x6289('0x12')],'subject':util[_0x6289('0xe')](_0x6289('0x13'),_0x2d8630[_0x6289('0x10')],_0x35d42b[_0x6289('0x14')],_0x35d42b[_0x6289('0x15')])}};var _0x5f1fc4=path['join'](__dirname,_0x6289('0x16'));var _0x2b455e=_0x2d8630[_0x6289('0x17')];var _0xb0491d=util[_0x6289('0xe')](_0x6289('0x18'),path[_0x6289('0x19')](_0x2d8630['savename'],path[_0x6289('0x1a')](_0x2d8630[_0x6289('0x17')])),_0x6289('0x1b'));var _0x5e36fe=path[_0x6289('0x1c')](_0x5f1fc4,_0x2b455e);var _0x1f2f5c=path[_0x6289('0x1c')](_0x5f1fc4,_0xb0491d);if(fs['existsSync'](_0x5e36fe)){_0x2d8630[_0x6289('0x1d')]=_0x6289('0x1e');_0x27ce7f[_0x6289('0x1f')][_0x6289('0x20')]=[{'filename':_0x2b455e,'path':_0x5e36fe}];_0x27ce7f['message'][_0x6289('0x21')]=util[_0x6289('0xe')](_0x6289('0x22'),JSON[_0x6289('0x23')](_0x2d8630,null,0x2));}else if(fs[_0x6289('0x24')](_0x1f2f5c)){_0x2d8630[_0x6289('0x1d')]=_0x6289('0x1e');_0x27ce7f[_0x6289('0x1f')]['attachments']=[{'filename':_0xb0491d,'path':_0x1f2f5c}];}else{_0x27ce7f[_0x6289('0x1f')][_0x6289('0x21')]=_0x6289('0x25');if(!_0x35d42b['sendIfEmpty']){_0xd0e582=![];logger[_0x6289('0x9')](_0x6289('0x26'));}}if(_0xd0e582){return client[_0x6289('0x27')](_0x6289('0x28'),_0x27ce7f)['then'](function(_0x5de627){if(_0x5de627['error']){return logger[_0x6289('0x29')](_0x6289('0x2a'),JSON[_0x6289('0x23')](_0x5de627));}return logger['info'](_0x6289('0x2b'));})[_0x6289('0x2c')](function(_0x17d023){return logger['error'](_0x6289('0x2a'),JSON['stringify'](_0x17d023));});}};}function handleError(){return function(_0x5ae2e6){return logger[_0x6289('0x29')](JSON[_0x6289('0x23')](_0x5ae2e6));};}function handleResult(_0x371058){return function(_0x423480){logger[_0x6289('0x9')]('data',JSON[_0x6289('0x23')](_0x423480));if(_0x371058[_0x6289('0xc')]&&_0x371058[_0x6289('0xc')]['Smtp']&&!_[_0x6289('0x2d')](_0x371058['email'])){setTimeout(handleSendEmail(_0x371058,_0x423480),0x3c*0x3e8);}};}function handleJob(_0x2efa21){return function(){try{if(_[_0x6289('0x2d')](_0x2efa21[_0x6289('0x14')])){return logger[_0x6289('0x9')](_0x6289('0x2e'));}if(_[_0x6289('0x2d')](_0x2efa21[_0x6289('0x15')])){return logger['info'](_0x6289('0x2f'));}var _0x535165={'startDate':moment()[_0x6289('0x30')](_0x2efa21[_0x6289('0x14')],_0x2efa21[_0x6289('0x15')])[_0x6289('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x6289('0xe')](_0x6289('0x31')),'type':'scheduled','output':_0x2efa21['output'],'name':_0x2efa21[_0x6289('0x10')]};if(!_['isNil'](_0x2efa21['DefaultReportId'])){logger[_0x6289('0x9')](_0x6289('0x32'),_0x2efa21[_0x6289('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x2efa21[_0x6289('0x33')]},_0x535165)['then'](handleResult(_0x2efa21))[_0x6289('0x2c')](handleError());}if(!_[_0x6289('0x2d')](_0x2efa21[_0x6289('0x34')])){logger[_0x6289('0x9')](_0x6289('0x35'),_0x2efa21[_0x6289('0x34')]);return analyticCustomReportController[_0x6289('0x36')]({'id':_0x2efa21[_0x6289('0x34')]},_0x535165)['then'](handleResult(_0x2efa21))[_0x6289('0x2c')](handleError());}}catch(_0x128234){logger[_0x6289('0x29')](JSON[_0x6289('0x23')](_0x128234));}return logger[_0x6289('0x9')](_0x6289('0x37'));};}function getJobs(_0x46629d){var _0x13332d={};if(_0x46629d){_0x13332d['id']=_0x46629d;}return db['Schedule']['findAll']({'where':_0x13332d,'include':[{'model':db[_0x6289('0xc')],'attributes':['id','name',_0x6289('0xb')],'include':[{'model':db[_0x6289('0x38')],'as':_0x6289('0x11'),'include':[{'model':db[_0x6289('0x39')],'as':_0x6289('0x39')}]}]}]})[_0x6289('0x3a')](function(_0x23db34){var _0x3aead7=_[_0x6289('0x3b')](manager[_0x6289('0x3c')]);var _0x1ce11e=_[_0x6289('0x3d')](_0x23db34,function(_0x34610d){return _0x34610d['id'][_0x6289('0x3e')]();});var _0x1767cd=_['keyBy'](_0x23db34,function(_0x5aecd5){return _0x5aecd5['id'][_0x6289('0x3e')]();});var _0x5037bb=_0x46629d?_0x1ce11e:_[_0x6289('0x3f')](_0x1ce11e,_0x3aead7);var _0x1fddbf=_[_0x6289('0x40')](_0x1ce11e,_0x3aead7);var _0x24f48d=_[_0x6289('0x3f')](_0x3aead7,_0x1ce11e);var _0x16ba95;var _0x378fb0;for(_0x16ba95=0x0;_0x16ba95<_0x24f48d[_0x6289('0x41')]&&!_0x46629d;_0x16ba95+=0x1){_0x378fb0=_0x24f48d[_0x16ba95][_0x6289('0x3e')]();if(manager[_0x6289('0x42')](_0x378fb0)){manager[_0x6289('0x43')](_0x378fb0);manager[_0x6289('0x44')](_0x378fb0);logger[_0x6289('0x9')](_0x6289('0x45'),_0x378fb0);}}logger[_0x6289('0x9')]('toRun',JSON['stringify'](_0x5037bb));for(_0x16ba95=0x0;_0x16ba95<_0x5037bb[_0x6289('0x41')];_0x16ba95+=0x1){_0x378fb0=_0x5037bb[_0x16ba95][_0x6289('0x3e')]();logger['info'](_0x6289('0x46'),_0x378fb0);if(_0x46629d){logger[_0x6289('0x9')](_0x6289('0x47'),_0x46629d);logger[_0x6289('0x9')](JSON[_0x6289('0x23')](_0x1767cd[_0x378fb0]));BPromise[_0x6289('0x48')]()[_0x6289('0x3a')](handleJob(_0x1767cd[_0x378fb0]));logger[_0x6289('0x9')](_0x6289('0x49'),_0x1767cd[_0x378fb0][_0x6289('0x10')],_0x1767cd[_0x378fb0][_0x6289('0x4a')]);}else if(_0x1767cd[_0x378fb0][_0x6289('0x4a')]&&_0x1767cd[_0x378fb0][_0x6289('0x4b')]&&moment()[_0x6289('0x4c')](_0x1767cd[_0x378fb0][_0x6289('0x4d')],_0x1767cd[_0x378fb0][_0x6289('0x4e')])){manager[_0x6289('0x4f')](_0x378fb0,_0x1767cd[_0x378fb0][_0x6289('0x4a')],handleJob(_0x1767cd[_0x378fb0]));manager[_0x6289('0x50')](_0x378fb0);logger[_0x6289('0x9')](_0x6289('0x51'),_0x1767cd[_0x378fb0][_0x6289('0x10')],_0x1767cd[_0x378fb0][_0x6289('0x4a')]);}else if(manager[_0x6289('0x42')](_0x378fb0)){manager[_0x6289('0x43')](_0x378fb0);manager[_0x6289('0x44')](_0x378fb0);logger[_0x6289('0x9')](_0x6289('0x52'),_0x1767cd[_0x378fb0][_0x6289('0x10')],_0x1767cd[_0x378fb0][_0x6289('0x4a')]);}}for(_0x16ba95=0x0,_0x378fb0;_0x16ba95<_0x1fddbf[_0x6289('0x41')]&&!_0x46629d;_0x16ba95+=0x1){_0x378fb0=_0x1fddbf[_0x16ba95][_0x6289('0x3e')]();if(manager[_0x6289('0x42')](_0x378fb0)){if(_0x1767cd[_0x378fb0][_0x6289('0x4a')]&&_0x1767cd[_0x378fb0][_0x6289('0x4b')]&&moment()['isBetween'](_0x1767cd[_0x378fb0]['startAt'],_0x1767cd[_0x378fb0][_0x6289('0x4e')])){manager['update'](_0x378fb0,_0x1767cd[_0x378fb0][_0x6289('0x4a')],handleJob(_0x1767cd[_0x378fb0]));logger[_0x6289('0x9')]('update\x20cron',_0x1767cd[_0x378fb0][_0x6289('0x10')],_0x1767cd[_0x378fb0]['cron']);}else{manager[_0x6289('0x43')](_0x378fb0);manager[_0x6289('0x44')](_0x378fb0);logger['info'](_0x6289('0x52'),_0x1767cd[_0x378fb0][_0x6289('0x10')],_0x1767cd[_0x378fb0][_0x6289('0x4a')]);}}}})['catch'](function(_0x1ade3f){logger['error'](JSON['stringify'](_0x1ade3f));});}exports[_0x6289('0x53')]=function(_0xd1cede){return getJobs(_0xd1cede);};exports[_0x6289('0x50')]=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 66c6af6..7885319 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 _0x2f8b=['Settings\x20not\x20available','transcribeAccountId','forEach','push','inspect','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','ValidationError','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','resolve','findOne','Cloud\x20Provider\x20not\x20configured','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x2f8b,0x96));var _0xb2f8=function(_0x2e4e0b,_0x2a515a){_0x2e4e0b=_0x2e4e0b-0x0;var _0xfbd976=_0x2f8b[_0x2e4e0b];return _0xfbd976;};var _=require(_0xb2f8('0x0'));var AWS=require(_0xb2f8('0x1'));var rp=require('request-promise');var util=require(_0xb2f8('0x2'));var BPromise=require(_0xb2f8('0x3'));var db=require(_0xb2f8('0x4'))['db'];var logger=require(_0xb2f8('0x5'))(_0xb2f8('0x6'));function getTranscriptionJob(_0x306f3c,_0x14d705,_0x4dc3ef,_0x2d4d99){return new Promise(function(_0x1e4cfa,_0x21b104){var _0x5b9235=new AWS[(_0xb2f8('0x7'))]({'accessKeyId':_0x14d705,'secretAccessKey':_0x306f3c,'region':_0x4dc3ef});_0x5b9235['getTranscriptionJob']({'TranscriptionJobName':_0x2d4d99},function(_0x23dba6,_0x273476){if(_0x23dba6){return _0x21b104(_0x23dba6);}else{return _0x1e4cfa(_0x273476);}});});}function sentiment(_0x1f38c2,_0x258a34,_0x1c053b,_0x39159c,_0x18ee28){return new Promise(function(_0x5684d9,_0x2acfaa){var _0x180c4c=new AWS[(_0xb2f8('0x8'))]({'accessKeyId':_0x258a34,'secretAccessKey':_0x1f38c2,'region':_0x1c053b});_0x180c4c[_0xb2f8('0x9')]({'Text':_0x39159c,'LanguageCode':_0x18ee28[_0xb2f8('0xa')](0x0,0x2)},function(_0x461247,_0xcce486){if(_0x461247){return _0x2acfaa(_0x461247);}else{return _0x5684d9(_0xcce486);}});});}function checkTranscribeJob(_0x39350f,_0x3aeb83,_0x2f896a){var _0x1dae14;return new BPromise(function(_0xb6e0c2,_0x357819){logger['info'](util['format'](_0xb2f8('0xb'),_0x39350f['id'],_0x39350f[_0xb2f8('0xc')]));return getTranscriptionJob(_0x2f896a['data1'],_0x2f896a[_0xb2f8('0xd')],_0x3aeb83[_0xb2f8('0xe')],_0x39350f[_0xb2f8('0xc')])[_0xb2f8('0xf')](function(_0x57d3c8){logger['info'](util[_0xb2f8('0x10')](_0xb2f8('0x11'),_0x39350f['id'],_0x39350f['transcribeName'],_0x57d3c8[_0xb2f8('0x12')][_0xb2f8('0x13')]));if(!_0x39350f['fileText']){switch(_0x57d3c8[_0xb2f8('0x12')]['TranscriptionJobStatus']){case _0xb2f8('0x14'):var _0x46333f={'transcribeStatus':_0x57d3c8[_0xb2f8('0x12')][_0xb2f8('0x13')],'fileUri':_0x57d3c8[_0xb2f8('0x12')][_0xb2f8('0x15')][_0xb2f8('0x16')]};logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')](_0xb2f8('0x18'),_0x39350f['id']));return rp({'uri':_0x57d3c8['TranscriptionJob'][_0xb2f8('0x15')]['TranscriptFileUri'],'json':!![]})[_0xb2f8('0xf')](function(_0x2b190c){logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x39350f['id']));if(_0x2b190c&&_0x2b190c[_0xb2f8('0x19')]&&_0x2b190c[_0xb2f8('0x19')][_0xb2f8('0x1a')]&&_0x2b190c['results'][_0xb2f8('0x1a')]['length']){_0x46333f['fileText']='';for(var _0x184b24=0x0;_0x184b24<_0x2b190c[_0xb2f8('0x19')]['transcripts'][_0xb2f8('0x1b')];_0x184b24++){_0x46333f[_0xb2f8('0x1c')]+=_0x2b190c[_0xb2f8('0x19')][_0xb2f8('0x1a')][_0x184b24][_0xb2f8('0x1d')]+'';}}return _0x39350f[_0xb2f8('0x1e')](_0x46333f);})['then'](function(){logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x39350f['id']));if(!_0x39350f[_0xb2f8('0x20')]){throw new db[(_0xb2f8('0x21'))]['ValidationError'](_0xb2f8('0x22'));}if(!_0x3aeb83[_0xb2f8('0x23')]||!_0x3aeb83['sentimentAccountId']||!_0x3aeb83[_0xb2f8('0x24')]||!_0x3aeb83[_0xb2f8('0x25')]||!_0x3aeb83[_0xb2f8('0x26')]){throw new db[(_0xb2f8('0x21'))]['ValidationError'](_0xb2f8('0x27'));}if(!_0x46333f[_0xb2f8('0x1c')]){throw new Error(_0xb2f8('0x28'));}if(_0x3aeb83['sentimentAccountId']===_0x2f896a['id']){return _0x2f896a;}else{return db[_0xb2f8('0x29')]['findOne']({'where':{'id':_settings[_0xb2f8('0x2a')]}});}})[_0xb2f8('0xf')](function(_0x26316e){if(!_0x26316e){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))](_0xb2f8('0x2c'));}if(!_0x26316e[_0xb2f8('0x2d')]||!_0x26316e[_0xb2f8('0xd')]){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))]('Cloud\x20Provider\x20not\x20configured');}_0x1dae14=_0x26316e;logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')](_0xb2f8('0x2e'),_0x39350f['id']));return sentiment(_0x1dae14[_0xb2f8('0x2d')],_0x1dae14['data2'],_0x3aeb83[_0xb2f8('0x24')],_0x46333f[_0xb2f8('0x1c')],_0x3aeb83[_0xb2f8('0x25')]);})[_0xb2f8('0xf')](function(_0x443a7a){logger['info'](util[_0xb2f8('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39350f['id']));return _0x39350f['update']({'sentiment':_0x443a7a[_0xb2f8('0x2f')],'sPositive':_0x443a7a[_0xb2f8('0x30')][_0xb2f8('0x31')],'sNegative':_0x443a7a[_0xb2f8('0x30')][_0xb2f8('0x32')],'sMixed':_0x443a7a[_0xb2f8('0x30')]['Mixed'],'sNeutral':_0x443a7a[_0xb2f8('0x30')][_0xb2f8('0x33')]});})[_0xb2f8('0xf')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x39350f['id']));_0xb6e0c2();});case _0xb2f8('0x34'):return _0x39350f[_0xb2f8('0x1e')]({'transcribeStatus':_0xb2f8('0x34'),'failureReason':_0x57d3c8['TranscriptionJob'][_0xb2f8('0x35')]})[_0xb2f8('0xf')](function(){logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x39350f['id']));_0xb6e0c2();});default:logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x39350f['id']));break;}}else{return BPromise[_0xb2f8('0x36')]()[_0xb2f8('0xf')](function(){if(!_0x39350f['tempSentiment']){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))](_0xb2f8('0x22'));}if(!_0x3aeb83[_0xb2f8('0x23')]||!_0x3aeb83[_0xb2f8('0x2a')]||!_0x3aeb83[_0xb2f8('0x24')]||!_0x3aeb83[_0xb2f8('0x25')]||!_0x3aeb83[_0xb2f8('0x26')]){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x39350f[_0xb2f8('0x1c')]){throw new Error(_0xb2f8('0x28'));}if(_0x3aeb83[_0xb2f8('0x2a')]===_0x2f896a['id']){return _0x2f896a;}else{return db[_0xb2f8('0x29')][_0xb2f8('0x37')]({'where':{'id':_settings[_0xb2f8('0x2a')]}});}})['then'](function(_0x366a1d){if(!_0x366a1d){throw new db[(_0xb2f8('0x21'))]['ValidationError'](_0xb2f8('0x2c'));}if(!_0x366a1d[_0xb2f8('0x2d')]||!_0x366a1d[_0xb2f8('0xd')]){throw new db['Sequelize'][(_0xb2f8('0x2b'))](_0xb2f8('0x38'));}_0x1dae14=_0x366a1d;logger['info'](util['format'](_0xb2f8('0x2e'),_0x39350f['id']));return sentiment(_0x1dae14[_0xb2f8('0x2d')],_0x1dae14['data2'],_0x3aeb83[_0xb2f8('0x24')],_0x39350f['fileText'],_0x3aeb83[_0xb2f8('0x25')]);})[_0xb2f8('0xf')](function(_0x2008d4){logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39350f['id']));return _0x39350f[_0xb2f8('0x1e')]({'sentiment':_0x2008d4[_0xb2f8('0x2f')],'sPositive':_0x2008d4['SentimentScore'][_0xb2f8('0x31')],'sNegative':_0x2008d4[_0xb2f8('0x30')][_0xb2f8('0x32')],'sMixed':_0x2008d4[_0xb2f8('0x30')]['Mixed'],'sNeutral':_0x2008d4[_0xb2f8('0x30')]['Neutral'],'transcribeStatus':_0xb2f8('0x14')});})['then'](function(){logger[_0xb2f8('0x17')](util[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x39350f['id']));_0xb6e0c2();});}})[_0xb2f8('0x39')](function(_0x34fb71){if(_0x34fb71){if(!_0x34fb71[_0xb2f8('0x3a')]||_0x34fb71['name']!==_0xb2f8('0x3b')){logger[_0xb2f8('0x3c')](util[_0xb2f8('0x10')](_0xb2f8('0x3d'),_0x39350f['id']),util['inspect'](_0x34fb71,{'showHidden':![],'depth':null}));}}_0xb6e0c2();});});}function checkTranscribe(){var _0x1d42c1;var _0x52b96b;var _0x1291b6;return db[_0xb2f8('0x3e')]['findAll']({'where':{'transcribeStatus':_0xb2f8('0x3f')}})[_0xb2f8('0xf')](function(_0xcb67bf){if(!_0xcb67bf||!_0xcb67bf[_0xb2f8('0x1b')]){throw new db[(_0xb2f8('0x21'))]['ValidationError'](_0xb2f8('0x40'));}_0x1d42c1=_0xcb67bf;return db[_0xb2f8('0x41')][_0xb2f8('0x37')]({'where':{'id':0x1}});})['then'](function(_0x1b0d6e){if(!_0x1b0d6e){throw new db['Sequelize'][(_0xb2f8('0x2b'))](_0xb2f8('0x42'));}_0x52b96b=_0x1b0d6e;if(!_0x52b96b[_0xb2f8('0x6')]||!_0x52b96b[_0xb2f8('0x43')]||!_0x52b96b['transcribeRegion']||!_0x52b96b[_0xb2f8('0x25')]||!_0x52b96b[_0xb2f8('0x26')]){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xb2f8('0x37')]({'where':{'id':_0x52b96b[_0xb2f8('0x43')]}});})['then'](function(_0x25a45a){if(!_0x25a45a){throw new db['Sequelize'][(_0xb2f8('0x2b'))](_0xb2f8('0x2c'));}if(!_0x25a45a[_0xb2f8('0x2d')]||!_0x25a45a[_0xb2f8('0xd')]){throw new db[(_0xb2f8('0x21'))][(_0xb2f8('0x2b'))]('Cloud\x20Provider\x20not\x20configured');}_0x1291b6=_0x25a45a;var _0x36f3fd=[];_0x1d42c1[_0xb2f8('0x44')](function(_0x11bd22){_0x36f3fd[_0xb2f8('0x45')](checkTranscribeJob(_0x11bd22,_0x52b96b,_0x1291b6));});return BPromise['all'](_0x36f3fd);})[_0xb2f8('0x39')](function(_0x537dfe){if(_0x537dfe){if(!_0x537dfe[_0xb2f8('0x3a')]||_0x537dfe[_0xb2f8('0x3a')]!==_0xb2f8('0x3b')){logger[_0xb2f8('0x3c')](util[_0xb2f8('0x46')](_0x537dfe,{'showHidden':![],'depth':null}));}}});}exports[_0xb2f8('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x263f=['data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','resolve','tempSentiment','CloudProvider','Cloud\x20Provider\x20not\x20configured','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','info','format','transcribeName','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available'];(function(_0x17fdb4,_0xc58890){var _0x587905=function(_0x4a1cde){while(--_0x4a1cde){_0x17fdb4['push'](_0x17fdb4['shift']());}};_0x587905(++_0xc58890);}(_0x263f,0x182));var _0xf263=function(_0x4cccdc,_0xe16b38){_0x4cccdc=_0x4cccdc-0x0;var _0x50364d=_0x263f[_0x4cccdc];return _0x50364d;};var _=require(_0xf263('0x0'));var AWS=require(_0xf263('0x1'));var rp=require(_0xf263('0x2'));var util=require(_0xf263('0x3'));var BPromise=require(_0xf263('0x4'));var db=require(_0xf263('0x5'))['db'];var logger=require('../../config/logger')(_0xf263('0x6'));function getTranscriptionJob(_0x3c76e4,_0x453b6e,_0x528b98,_0xbd1369){return new Promise(function(_0xdb2fc1,_0x4c7ab2){var _0x4fded6=new AWS[(_0xf263('0x7'))]({'accessKeyId':_0x453b6e,'secretAccessKey':_0x3c76e4,'region':_0x528b98});_0x4fded6[_0xf263('0x8')]({'TranscriptionJobName':_0xbd1369},function(_0xa2e77e,_0x16ff53){if(_0xa2e77e){return _0x4c7ab2(_0xa2e77e);}else{return _0xdb2fc1(_0x16ff53);}});});}function sentiment(_0x5dcaa0,_0x3bde50,_0x26504c,_0x3d8092,_0x34c634){return new Promise(function(_0xb9fb31,_0x4fc090){var _0x1e9057=new AWS['Comprehend']({'accessKeyId':_0x3bde50,'secretAccessKey':_0x5dcaa0,'region':_0x26504c});_0x1e9057[_0xf263('0x9')]({'Text':_0x3d8092,'LanguageCode':_0x34c634['substring'](0x0,0x2)},function(_0x254c66,_0x5cf56d){if(_0x254c66){return _0x4fc090(_0x254c66);}else{return _0xb9fb31(_0x5cf56d);}});});}function checkTranscribeJob(_0x5e46a6,_0x2fc9f0,_0x2b1145){var _0x17471d;return new BPromise(function(_0xd7a907,_0x1037a4){logger[_0xf263('0xa')](util[_0xf263('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5e46a6['id'],_0x5e46a6[_0xf263('0xc')]));return getTranscriptionJob(_0x2b1145['data1'],_0x2b1145[_0xf263('0xd')],_0x2fc9f0[_0xf263('0xe')],_0x5e46a6[_0xf263('0xc')])[_0xf263('0xf')](function(_0x16b4dd){logger[_0xf263('0xa')](util[_0xf263('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x5e46a6['id'],_0x5e46a6['transcribeName'],_0x16b4dd[_0xf263('0x10')][_0xf263('0x11')]));if(!_0x5e46a6[_0xf263('0x12')]){switch(_0x16b4dd[_0xf263('0x10')][_0xf263('0x11')]){case'COMPLETED':var _0x1adb66={'transcribeStatus':_0x16b4dd['TranscriptionJob'][_0xf263('0x11')],'fileUri':_0x16b4dd[_0xf263('0x10')][_0xf263('0x13')]['TranscriptFileUri']};logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x14'),_0x5e46a6['id']));return rp({'uri':_0x16b4dd['TranscriptionJob'][_0xf263('0x13')][_0xf263('0x15')],'json':!![]})[_0xf263('0xf')](function(_0x426667){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x16'),_0x5e46a6['id']));if(_0x426667&&_0x426667[_0xf263('0x17')]&&_0x426667[_0xf263('0x17')][_0xf263('0x18')]&&_0x426667[_0xf263('0x17')]['transcripts']['length']){_0x1adb66['fileText']='';for(var _0x2de7aa=0x0;_0x2de7aa<_0x426667[_0xf263('0x17')][_0xf263('0x18')][_0xf263('0x19')];_0x2de7aa++){_0x1adb66[_0xf263('0x12')]+=_0x426667[_0xf263('0x17')][_0xf263('0x18')][_0x2de7aa][_0xf263('0x1a')]+'';}}return _0x5e46a6[_0xf263('0x1b')](_0x1adb66);})[_0xf263('0xf')](function(){logger[_0xf263('0xa')](util['format'](_0xf263('0x1c'),_0x5e46a6['id']));if(!_0x5e46a6['tempSentiment']){throw new db[(_0xf263('0x1d'))]['ValidationError'](_0xf263('0x1e'));}if(!_0x2fc9f0[_0xf263('0x1f')]||!_0x2fc9f0['sentimentAccountId']||!_0x2fc9f0['sentimentRegion']||!_0x2fc9f0[_0xf263('0x20')]||!_0x2fc9f0[_0xf263('0x21')]){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))](_0xf263('0x23'));}if(!_0x1adb66[_0xf263('0x12')]){throw new Error(_0xf263('0x24'));}if(_0x2fc9f0[_0xf263('0x25')]===_0x2b1145['id']){return _0x2b1145;}else{return db['CloudProvider'][_0xf263('0x26')]({'where':{'id':_settings[_0xf263('0x25')]}});}})[_0xf263('0xf')](function(_0x43d78e){if(!_0x43d78e){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))](_0xf263('0x27'));}if(!_0x43d78e[_0xf263('0x28')]||!_0x43d78e[_0xf263('0xd')]){throw new db['Sequelize'][(_0xf263('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x17471d=_0x43d78e;logger['info'](util[_0xf263('0xb')](_0xf263('0x29'),_0x5e46a6['id']));return sentiment(_0x17471d['data1'],_0x17471d[_0xf263('0xd')],_0x2fc9f0[_0xf263('0x2a')],_0x1adb66['fileText'],_0x2fc9f0[_0xf263('0x20')]);})[_0xf263('0xf')](function(_0x37a475){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x2b'),_0x5e46a6['id']));return _0x5e46a6['update']({'sentiment':_0x37a475[_0xf263('0x2c')],'sPositive':_0x37a475[_0xf263('0x2d')]['Positive'],'sNegative':_0x37a475['SentimentScore'][_0xf263('0x2e')],'sMixed':_0x37a475[_0xf263('0x2d')][_0xf263('0x2f')],'sNeutral':_0x37a475[_0xf263('0x2d')]['Neutral']});})[_0xf263('0xf')](function(){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x1c'),_0x5e46a6['id']));_0xd7a907();});case _0xf263('0x30'):return _0x5e46a6['update']({'transcribeStatus':_0xf263('0x30'),'failureReason':_0x16b4dd[_0xf263('0x10')][_0xf263('0x31')]})['then'](function(){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x1c'),_0x5e46a6['id']));_0xd7a907();});default:logger[_0xf263('0xa')](util[_0xf263('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x5e46a6['id']));break;}}else{return BPromise[_0xf263('0x32')]()[_0xf263('0xf')](function(){if(!_0x5e46a6[_0xf263('0x33')]){throw new db['Sequelize'][(_0xf263('0x22'))](_0xf263('0x1e'));}if(!_0x2fc9f0[_0xf263('0x1f')]||!_0x2fc9f0['sentimentAccountId']||!_0x2fc9f0[_0xf263('0x2a')]||!_0x2fc9f0['language']||!_0x2fc9f0[_0xf263('0x21')]){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5e46a6['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x2fc9f0[_0xf263('0x25')]===_0x2b1145['id']){return _0x2b1145;}else{return db[_0xf263('0x34')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf263('0xf')](function(_0x1e1dbf){if(!_0x1e1dbf){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))](_0xf263('0x27'));}if(!_0x1e1dbf['data1']||!_0x1e1dbf[_0xf263('0xd')]){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))](_0xf263('0x35'));}_0x17471d=_0x1e1dbf;logger[_0xf263('0xa')](util['format'](_0xf263('0x29'),_0x5e46a6['id']));return sentiment(_0x17471d[_0xf263('0x28')],_0x17471d[_0xf263('0xd')],_0x2fc9f0['sentimentRegion'],_0x5e46a6['fileText'],_0x2fc9f0[_0xf263('0x20')]);})['then'](function(_0x4c7283){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x2b'),_0x5e46a6['id']));return _0x5e46a6['update']({'sentiment':_0x4c7283[_0xf263('0x2c')],'sPositive':_0x4c7283[_0xf263('0x2d')]['Positive'],'sNegative':_0x4c7283[_0xf263('0x2d')][_0xf263('0x2e')],'sMixed':_0x4c7283['SentimentScore'][_0xf263('0x2f')],'sNeutral':_0x4c7283[_0xf263('0x2d')]['Neutral'],'transcribeStatus':_0xf263('0x36')});})[_0xf263('0xf')](function(){logger[_0xf263('0xa')](util[_0xf263('0xb')](_0xf263('0x1c'),_0x5e46a6['id']));_0xd7a907();});}})[_0xf263('0x37')](function(_0xd5f916){if(_0xd5f916){if(!_0xd5f916['name']||_0xd5f916[_0xf263('0x38')]!==_0xf263('0x39')){logger[_0xf263('0x3a')](util[_0xf263('0xb')](_0xf263('0x3b'),_0x5e46a6['id']),util[_0xf263('0x3c')](_0xd5f916,{'showHidden':![],'depth':null}));}}_0xd7a907();});});}function checkTranscribe(){var _0x24da59;var _0x1505a9;var _0x5da8ba;return db[_0xf263('0x3d')][_0xf263('0x3e')]({'where':{'transcribeStatus':_0xf263('0x3f')}})[_0xf263('0xf')](function(_0x54ddf8){if(!_0x54ddf8||!_0x54ddf8[_0xf263('0x19')]){throw new db['Sequelize'][(_0xf263('0x22'))](_0xf263('0x40'));}_0x24da59=_0x54ddf8;return db[_0xf263('0x41')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x5b5585){if(!_0x5b5585){throw new db['Sequelize']['ValidationError'](_0xf263('0x42'));}_0x1505a9=_0x5b5585;if(!_0x1505a9[_0xf263('0x6')]||!_0x1505a9['transcribeAccountId']||!_0x1505a9[_0xf263('0xe')]||!_0x1505a9[_0xf263('0x20')]||!_0x1505a9[_0xf263('0x21')]){throw new db[(_0xf263('0x1d'))][(_0xf263('0x22'))](_0xf263('0x43'));}return db[_0xf263('0x34')][_0xf263('0x26')]({'where':{'id':_0x1505a9[_0xf263('0x44')]}});})[_0xf263('0xf')](function(_0x12c84f){if(!_0x12c84f){throw new db[(_0xf263('0x1d'))]['ValidationError'](_0xf263('0x27'));}if(!_0x12c84f['data1']||!_0x12c84f['data2']){throw new db[(_0xf263('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x5da8ba=_0x12c84f;var _0x382460=[];_0x24da59[_0xf263('0x45')](function(_0x499859){_0x382460[_0xf263('0x46')](checkTranscribeJob(_0x499859,_0x1505a9,_0x5da8ba));});return BPromise['all'](_0x382460);})[_0xf263('0x37')](function(_0x2c4b20){if(_0x2c4b20){if(!_0x2c4b20['name']||_0x2c4b20[_0xf263('0x38')]!==_0xf263('0x39')){logger['error'](util[_0xf263('0x3c')](_0x2c4b20,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index c66a6bd..ae2e3a0 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 _0x061f=['redis','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','then','length','emit','catch','error','inspect','start','lodash','moment','ioredis','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x061f,0x15c));var _0xf061=function(_0x1c469b,_0x56feaa){_0x1c469b=_0x1c469b-0x0;var _0xf52fb=_0x061f[_0x1c469b];return _0xf52fb;};'use strict';var _=require(_0xf061('0x0'));var moment=require(_0xf061('0x1'));var Redis=require(_0xf061('0x2'));var util=require(_0xf061('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0xf061('0x4')]=_['defaults'](config[_0xf061('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf061('0x5'))(new Redis(config[_0xf061('0x4')]));function closeInteractions(){var _0x5152f9=[];return db[_0xf061('0x6')]['findAll']({'raw':!![],'attributes':['id',_0xf061('0x7')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf061('0x8')](0x18,_0xf061('0x9'))}}})['then'](function(_0x4b3889){if(_0x4b3889&&_0x4b3889['length']){_0x5152f9=_[_0xf061('0xa')](_0x4b3889||[],'id');logger[_0xf061('0xb')](_0xf061('0xc'),_0x5152f9[_0xf061('0xd')]());return db[_0xf061('0x6')]['update']({'closeReason':_0xf061('0xe'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5152f9}});}})[_0xf061('0xf')](function(){if(_0x5152f9&&_0x5152f9['length']){logger[_0xf061('0xb')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5152f9[_0xf061('0xd')]());for(var _0x57b6ee=0x0;_0x57b6ee<_0x5152f9[_0xf061('0x10')];_0x57b6ee++){io[_0xf061('0x11')]('whatsappInteraction:update',{'id':_0x5152f9[_0x57b6ee],'closed':!![]});}}})[_0xf061('0x12')](function(_0x1b7519){logger[_0xf061('0x13')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1b7519?util[_0xf061('0x14')](_0x1b7519,{'showHidden':![],'depth':null}):'');});}exports[_0xf061('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3d7a=['emit','whatsappInteraction:update','error','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','WhatsappInteraction','findAll','subtract','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x3a8c1a,_0x12292f){var _0x8e74b=function(_0x38d0c2){while(--_0x38d0c2){_0x3a8c1a['push'](_0x3a8c1a['shift']());}};_0x8e74b(++_0x12292f);}(_0x3d7a,0x1b4));var _0xa3d7=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0x3d7a[_0x466247];return _0x4b352e;};'use strict';var _=require(_0xa3d7('0x0'));var moment=require(_0xa3d7('0x1'));var Redis=require('ioredis');var util=require(_0xa3d7('0x2'));var config=require(_0xa3d7('0x3'));var db=require(_0xa3d7('0x4'))['db'];var logger=require(_0xa3d7('0x5'))(_0xa3d7('0x6'));config['redis']=_['defaults'](config[_0xa3d7('0x7')],{'host':_0xa3d7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa3d7('0x7')]));function closeInteractions(){var _0x4a9ed8=[];return db[_0xa3d7('0x9')][_0xa3d7('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa3d7('0xb')](0x18,'hours')}}})[_0xa3d7('0xc')](function(_0x48889c){if(_0x48889c&&_0x48889c[_0xa3d7('0xd')]){_0x4a9ed8=_['map'](_0x48889c||[],'id');logger['info'](_0xa3d7('0xe'),_0x4a9ed8[_0xa3d7('0xf')]());return db[_0xa3d7('0x9')][_0xa3d7('0x10')]({'closeReason':_0xa3d7('0x11'),'disposition':_0xa3d7('0x12'),'closed':!![],'closedAt':moment()[_0xa3d7('0x13')](_0xa3d7('0x14'))},{'where':{'id':_0x4a9ed8}});}})[_0xa3d7('0xc')](function(){if(_0x4a9ed8&&_0x4a9ed8[_0xa3d7('0xd')]){logger[_0xa3d7('0x15')](_0xa3d7('0x16'),_0x4a9ed8[_0xa3d7('0xf')]());for(var _0x1b8d48=0x0;_0x1b8d48<_0x4a9ed8['length'];_0x1b8d48++){io[_0xa3d7('0x17')](_0xa3d7('0x18'),{'id':_0x4a9ed8[_0x1b8d48],'closed':!![]});}}})['catch'](function(_0x5c8330){logger[_0xa3d7('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5c8330?util['inspect'](_0x5c8330,{'showHidden':![],'depth':null}):'');});}exports[_0xa3d7('0x1a')]=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 6d5e7b1..32d6f63 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x064a=['@xcally.com','push','now','Innocenzo','CmContact','then','bulkCreate','finished\x20populating','CmHopper','hopper1','log','hopper2','catch','util','Biondo','innocenzo.biondo'];(function(_0x579d46,_0x168307){var _0x100b4a=function(_0x2c9d31){while(--_0x2c9d31){_0x579d46['push'](_0x579d46['shift']());}};_0x100b4a(++_0x168307);}(_0x064a,0xbd));var _0xa064=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x064a[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xa064('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xa064('0x1')+i,'phone':0xf879fb460+i,'email':_0xa064('0x2')+i+_0xa064('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa064('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xa064('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa064('0x5')](),'updatedAt':Date[_0xa064('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa064('0x4')]({'id':i,'firstName':_0xa064('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xa064('0x2')+i+_0xa064('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa064('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xa064('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa064('0x5')](),'updatedAt':Date[_0xa064('0x5')]()});}db[_0xa064('0x7')]['destroy']({'where':{}})[_0xa064('0x8')](function(){return db[_0xa064('0x7')][_0xa064('0x9')](contacts);})[_0xa064('0x8')](function(){console['log'](_0xa064('0xa'),'contacts1');return db[_0xa064('0xb')]['destroy']({'where':{}});})[_0xa064('0x8')](function(){return db[_0xa064('0xb')][_0xa064('0x9')](hopper);})[_0xa064('0x8')](function(){console['log'](_0xa064('0xa'),_0xa064('0xc'));return db[_0xa064('0x7')][_0xa064('0x9')](contacts2);})[_0xa064('0x8')](function(){console[_0xa064('0xd')](_0xa064('0xa'),'contacts2');return db[_0xa064('0xb')][_0xa064('0x9')](hopper2);})[_0xa064('0x8')](function(){console[_0xa064('0xd')](_0xa064('0xa'),_0xa064('0xe'));})[_0xa064('0xf')](function(_0x3771d2){console[_0xa064('0xd')](_0x3771d2);}); \ No newline at end of file +var _0x79bc=['hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','bulkCreate'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x79bc,0x1a6));var _0xc79b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x79bc[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0xc79b('0x0'));var db=require(_0xc79b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc79b('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc79b('0x3')+i+_0xc79b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc79b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc79b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc79b('0x2')]({'id':i,'firstName':_0xc79b('0x6')+i,'lastName':_0xc79b('0x7')+i,'phone':0xf879fb460+i,'email':_0xc79b('0x3')+i+_0xc79b('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc79b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xc79b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc79b('0x5')](),'updatedAt':Date[_0xc79b('0x5')]()});}db[_0xc79b('0x8')][_0xc79b('0x9')]({'where':{}})['then'](function(){return db[_0xc79b('0x8')]['bulkCreate'](contacts);})[_0xc79b('0xa')](function(){console['log'](_0xc79b('0xb'),_0xc79b('0xc'));return db[_0xc79b('0xd')][_0xc79b('0x9')]({'where':{}});})[_0xc79b('0xa')](function(){return db[_0xc79b('0xd')]['bulkCreate'](hopper);})[_0xc79b('0xa')](function(){console[_0xc79b('0xe')](_0xc79b('0xb'),_0xc79b('0xf'));return db['CmContact']['bulkCreate'](contacts2);})[_0xc79b('0xa')](function(){console[_0xc79b('0xe')](_0xc79b('0xb'),_0xc79b('0x10'));return db[_0xc79b('0xd')][_0xc79b('0x11')](hopper2);})[_0xc79b('0xa')](function(){console['log'](_0xc79b('0xb'),_0xc79b('0x12'));})[_0xc79b('0x13')](function(_0xcb2ade){console[_0xc79b('0xe')](_0xcb2ade);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 439fb6c..fb096bc 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed5d=['ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push','format','%s%s','agent','udp','wss','all'];(function(_0x16e581,_0x77a1c5){var _0x43bcc8=function(_0x1cc6e5){while(--_0x1cc6e5){_0x16e581['push'](_0x16e581['shift']());}};_0x43bcc8(++_0x77a1c5);}(_0xed5d,0xdc));var _0xded5=function(_0x434a12,_0x2a67b4){_0x434a12=_0x434a12-0x0;var _0x1944c1=_0xed5d[_0x434a12];return _0x1944c1;};'use strict';var util=require(_0xded5('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xded5('0x1')]({'name':util[_0xded5('0x2')](_0xded5('0x3'),_0xded5('0x4'),i),'fullname':util[_0xded5('0x2')]('%s%s',_0xded5('0x4'),i),'email':util[_0xded5('0x2')]('%s%s@xcally.com','agent',i),'role':_0xded5('0x4'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xded5('0x5'),'ws',_0xded5('0x6')],'disallow':[_0xded5('0x7')],'allow':[_0xded5('0x8')],'defaultuser':util[_0xded5('0x2')](_0xded5('0x3'),_0xded5('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':'yes','icesupport':_0xded5('0x9'),'dtlsenable':_0xded5('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xded5('0xa'),'dtlssetup':_0xded5('0xb'),'callerid':util['format'](_0xded5('0xc'),util[_0xded5('0x2')](_0xded5('0x3'),_0xded5('0x4'),i),0xfa0+i)});}db[_0xded5('0xd')][_0xded5('0xe')](users)[_0xded5('0xf')](function(){console[_0xded5('0x10')](_0xded5('0x11'));})[_0xded5('0x12')](function(_0x2a799b){console[_0xded5('0x10')](_0x2a799b);}); \ No newline at end of file +var _0x6ab7=['catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','bulkCreate','then','log','add\x20user'];(function(_0x845cf4,_0x510466){var _0x99bb0a=function(_0x4f593b){while(--_0x4f593b){_0x845cf4['push'](_0x845cf4['shift']());}};_0x99bb0a(++_0x510466);}(_0x6ab7,0xc9));var _0x76ab=function(_0x3f6148,_0x4b767b){_0x3f6148=_0x3f6148-0x0;var _0x39f7b3=_0x6ab7[_0x3f6148];return _0x39f7b3;};'use strict';var util=require(_0x76ab('0x0'));var db=require(_0x76ab('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x76ab('0x2')](_0x76ab('0x3'),_0x76ab('0x4'),i),'fullname':util[_0x76ab('0x2')](_0x76ab('0x3'),_0x76ab('0x4'),i),'email':util[_0x76ab('0x2')](_0x76ab('0x5'),_0x76ab('0x4'),i),'role':_0x76ab('0x4'),'password':_0x76ab('0x6'),'internal':0xfa0+i,'type':_0x76ab('0x7'),'transport':[_0x76ab('0x8'),'ws',_0x76ab('0x9')],'disallow':[_0x76ab('0xa')],'allow':[_0x76ab('0xb')],'defaultuser':util['format']('%s%s',_0x76ab('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':_0x76ab('0xc'),'icesupport':_0x76ab('0xc'),'dtlsenable':_0x76ab('0xc'),'dtlsverify':'no','dtlscertfile':_0x76ab('0xd'),'dtlsprivatekey':_0x76ab('0xe'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x76ab('0x3'),_0x76ab('0x4'),i),0xfa0+i)});}db['User'][_0x76ab('0xf')](users)[_0x76ab('0x10')](function(){console[_0x76ab('0x11')](_0x76ab('0x12'));})[_0x76ab('0x13')](function(_0x29a3e8){console[_0x76ab('0x11')](_0x29a3e8);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index a4d695c..98219eb 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee8f=['ChatQueues','FaxQueues','SmsQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','role','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','SmsQueue','MailQueues','WhatsappQueues','Trunks','Trunk','getChatQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','type','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','leave','removeFaxInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','address','request','remoteAddress','connectedAt','nsp','DISCONNECTED','CONNECTED','util','../mysqldb','./environment','name','Agents','agent','telephone','ivr','findOne','then','autoAssociation','VoiceQueues'];(function(_0x179d95,_0x5f0429){var _0x297aba=function(_0x22b92b){while(--_0x22b92b){_0x179d95['push'](_0x179d95['shift']());}};_0x297aba(++_0x5f0429);}(_0xee8f,0x1ed));var _0xfee8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xee8f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xfee8('0x0'));var BPromise=require('bluebird');var db=require(_0xfee8('0x1'))['db'];var config=require(_0xfee8('0x2'));var queryQueues={'attributes':['id',_0xfee8('0x3')],'include':[{'as':_0xfee8('0x4'),'model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xfee8('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfee8('0x3')],'where':{'role':_0xfee8('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xfee8('0x3')],'where':{'role':_0xfee8('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0xfee8('0x7')}};function getAssociatedResources(_0x1a3966,_0x2d5374,_0x5ac463){return db['UserProfileSection'][_0xfee8('0x8')]({'where':{'name':_0x1a3966,'userProfileId':_0x2d5374},'raw':!![]})[_0xfee8('0x9')](function(_0xb76f6){if(_0xb76f6){if(_0xb76f6[_0xfee8('0xa')]){switch(_0x1a3966){case _0xfee8('0xb'):case _0xfee8('0xc'):case _0xfee8('0xd'):case _0xfee8('0xe'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x5ac463][_0xfee8('0xf')](queryQueues);case _0xfee8('0x10'):return db[_0x5ac463][_0xfee8('0xf')](queryTelephones);case'Trunks':return db[_0x5ac463]['findAll'](queryTrunks);case _0xfee8('0x11'):return db[_0x5ac463][_0xfee8('0xf')](queryCampaigns);}}else{return db[_0xfee8('0x12')][_0xfee8('0xf')]({'attributes':[_0xfee8('0x13')],'where':{'sectionId':_0xb76f6['id']},'raw':!![]})[_0xfee8('0x9')](function(_0x1c285f){if(_0x1c285f){var _0xc8de11={'where':{'id':_[_0xfee8('0x14')](_0x1c285f,_0xfee8('0x13'))},'raw':!![]};switch(_0x5ac463){case _0xfee8('0x15'):_0xc8de11[_0xfee8('0x16')]['role']='telephone';break;case _0xfee8('0x17'):_0xc8de11[_0xfee8('0x16')]['type']=_0xfee8('0x7');break;}return db[_0x5ac463][_0xfee8('0xf')](_0xc8de11);}else{return[];}});}}else{return[];}})['then'](function(_0x45df7b){return _0x45df7b;});}function joinOrLeaveQueues(_0x587c14,_0x5bc4ef,_0x2cf4f4,_0x17c64b){_0x587c14[_0x5bc4ef](util[_0xfee8('0x18')](_0xfee8('0x19'),_0x2cf4f4,_0x17c64b['name']));if(_0x17c64b[_0xfee8('0x4')]){for(var _0x3308e5=0x0;_0x3308e5<_0x17c64b[_0xfee8('0x4')][_0xfee8('0x1a')];_0x3308e5+=0x1){_0x587c14[_0x5bc4ef](util[_0xfee8('0x18')](_0xfee8('0x1b'),_0x17c64b[_0xfee8('0x4')][_0x3308e5][_0xfee8('0x3')]));}}}function joinOrLeave(_0x5025b4,_0x507656,_0x347787){var _0x51d263;if(_0x5025b4[_0xfee8('0x1c')]['query']['id']){db[_0xfee8('0x15')][_0xfee8('0x1d')]({'attributes':['id','name',_0xfee8('0x1e'),_0xfee8('0x1f')],'where':{'id':_0x5025b4['handshake'][_0xfee8('0x20')]['id']},'include':[{'model':db[_0xfee8('0x21')],'as':_0xfee8('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xfee8('0x23')],'as':_0xfee8('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xfee8('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xfee8('0x26')],'as':_0xfee8('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xfee8('0x28')],'as':_0xfee8('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xfee8('0x2a')],'as':_0xfee8('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xfee8('0x9')](function(_0x3f5914){if(_0x3f5914){_0x51d263=_0x3f5914;_0x5025b4[_0x507656](util[_0xfee8('0x18')](_0xfee8('0x1b'),_0x3f5914[_0xfee8('0x3')]));var _0x4997a0=[];switch(_0x3f5914[_0xfee8('0x1e')]){case _0xfee8('0x2c'):_0x5025b4[_0x507656]('voice:inbound');_0x5025b4[_0x507656](_0xfee8('0x2d'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0xfee8('0x2e')];}_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x30')][_0xfee8('0xf')](queryQueues));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x31')]['findAll'](queryQueues));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x32')][_0xfee8('0xf')](queryQueues));_0x4997a0[_0xfee8('0x2f')](db['SmsQueue']['findAll'](queryQueues));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x33')][_0xfee8('0xf')](queryQueues));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x34')][_0xfee8('0xf')](queryQueues));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x35')][_0xfee8('0xf')](queryQueues));_0x4997a0[_0xfee8('0x2f')](db['User'][_0xfee8('0xf')](queryTelephones));_0x4997a0['push'](db['Trunk']['findAll'](queryTrunks));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x17')][_0xfee8('0xf')](queryCampaigns));_0x4997a0[_0xfee8('0x2f')](db['User'][_0xfee8('0xf')](queryAgents));break;case _0xfee8('0x36'):_0x5025b4[_0x507656](_0xfee8('0x37'));_0x5025b4[_0x507656](_0xfee8('0x2d'));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0xb'),_0x3f5914[_0xfee8('0x1f')],'VoiceQueue'));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0xc'),_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x31')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0xd'),_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x32')));_0x4997a0['push'](getAssociatedResources('SmsQueues',_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x38')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0x39'),_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x33')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources('OpenchannelQueues',_0x3f5914['userProfileId'],_0xfee8('0x34')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0x3a'),_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x35')));_0x4997a0['push'](getAssociatedResources('Telephones',_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x15')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources(_0xfee8('0x3b'),_0x3f5914[_0xfee8('0x1f')],_0xfee8('0x3c')));_0x4997a0[_0xfee8('0x2f')](getAssociatedResources('IvrCampaigns',_0x3f5914[_0xfee8('0x1f')],'Campaign'));_0x4997a0[_0xfee8('0x2f')](db[_0xfee8('0x15')][_0xfee8('0xf')](queryAgents));break;case _0xfee8('0x5'):_0x5025b4[_0x507656](_0xfee8('0x37'));_0x5025b4[_0x507656](_0xfee8('0x2d'));_0x4997a0[_0xfee8('0x2f')](_0x3f5914['getVoiceQueues']({'attributes':['id',_0xfee8('0x3')]}));_0x4997a0['push'](_0x3f5914[_0xfee8('0x3d')]({'attributes':['id','name']}));_0x4997a0[_0xfee8('0x2f')](_0x3f5914[_0xfee8('0x3e')]({'attributes':['id',_0xfee8('0x3')]}));_0x4997a0[_0xfee8('0x2f')](_0x3f5914['getSmsQueues']({'attributes':['id',_0xfee8('0x3')]}));_0x4997a0[_0xfee8('0x2f')](_0x3f5914[_0xfee8('0x3f')]({'attributes':['id',_0xfee8('0x3')]}));_0x4997a0[_0xfee8('0x2f')](_0x3f5914['getOpenchannelQueues']({'attributes':['id',_0xfee8('0x3')]}));_0x4997a0['push'](_0x3f5914[_0xfee8('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0xfee8('0x41')](_0x4997a0);}})[_0xfee8('0x9')](function(_0x320617){if(_0x320617&&_0x320617[_0xfee8('0x1a')]){for(var _0x2d501c=0x0;_0x2d501c<_0x320617[_0xfee8('0x1a')];_0x2d501c+=0x1){for(var _0x3c5f03=0x0;_0x3c5f03<_0x320617[_0x2d501c][_0xfee8('0x1a')];_0x3c5f03+=0x1){switch(_0x2d501c){case 0x0:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x42'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x1:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x43'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x2:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x44'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x3:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x45'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x4:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x46'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x5:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x47'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x6:joinOrLeaveQueues(_0x5025b4,_0x507656,_0xfee8('0x48'),_0x320617[_0x2d501c][_0x3c5f03]);break;case 0x7:if(_0x51d263[_0xfee8('0x1e')]!==_0xfee8('0x5'))_0x5025b4[_0x507656](util[_0xfee8('0x18')]('telephone:%s',_0x320617[_0x2d501c][_0x3c5f03][_0xfee8('0x3')]));break;case 0x8:if(_0x51d263[_0xfee8('0x1e')]!=='agent')_0x5025b4[_0x507656](util[_0xfee8('0x18')](_0xfee8('0x49'),_0x320617[_0x2d501c][_0x3c5f03][_0xfee8('0x3')]));break;case 0x9:if(_0x51d263[_0xfee8('0x1e')]!==_0xfee8('0x5'))_0x5025b4[_0x507656](util[_0xfee8('0x18')](_0xfee8('0x4a'),_0x320617[_0x2d501c][_0x3c5f03][_0xfee8('0x4b')],_0x320617[_0x2d501c][_0x3c5f03][_0xfee8('0x3')]));break;case 0xa:_0x5025b4[_0x507656](util[_0xfee8('0x18')](_0xfee8('0x1b'),_0x320617[_0x2d501c][_0x3c5f03][_0xfee8('0x3')]));break;}}}}})[_0xfee8('0x9')](function(){if(_0x507656==='leave'){var _0x14ea4e=_['map'](_0x51d263[_0xfee8('0x22')],'id');return _0x51d263[_0xfee8('0x4c')](_0x14ea4e)[_0xfee8('0x9')](function(){for(var _0x430663=0x0;_0x430663<_0x14ea4e[_0xfee8('0x1a')];_0x430663+=0x1){_0x347787['emit'](_0xfee8('0x4d'),{'ChatInteractionId':Number(_0x14ea4e[_0x430663]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x9')](function(){if(_0x507656==='leave'){var _0x3f2d86=_['map'](_0x51d263[_0xfee8('0x24')],'id');return _0x51d263[_0xfee8('0x4e')](_0x3f2d86)[_0xfee8('0x9')](function(){for(var _0xabb0da=0x0;_0xabb0da<_0x3f2d86[_0xfee8('0x1a')];_0xabb0da+=0x1){_0x347787['emit'](_0xfee8('0x4f'),{'MailInteractionId':Number(_0x3f2d86[_0xabb0da]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x9')](function(){if(_0x507656===_0xfee8('0x50')){var _0x25a283=_[_0xfee8('0x14')](_0x51d263[_0xfee8('0x25')],'id');return _0x51d263[_0xfee8('0x51')](_0x25a283)[_0xfee8('0x9')](function(){for(var _0x279da8=0x0;_0x279da8<_0x25a283[_0xfee8('0x1a')];_0x279da8+=0x1){_0x347787[_0xfee8('0x52')](_0xfee8('0x53'),{'FaxInteractionId':Number(_0x25a283[_0x279da8]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x9')](function(){if(_0x507656===_0xfee8('0x50')){var _0x5dc4d7=_[_0xfee8('0x14')](_0x51d263[_0xfee8('0x27')],'id');return _0x51d263[_0xfee8('0x54')](_0x5dc4d7)[_0xfee8('0x9')](function(){for(var _0x274b70=0x0;_0x274b70<_0x5dc4d7[_0xfee8('0x1a')];_0x274b70+=0x1){_0x347787['emit'](_0xfee8('0x55'),{'SmsInteractionId':Number(_0x5dc4d7[_0x274b70]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x9')](function(){if(_0x507656===_0xfee8('0x50')){var _0x1525c3=_['map'](_0x51d263[_0xfee8('0x29')],'id');return _0x51d263[_0xfee8('0x56')](_0x1525c3)[_0xfee8('0x9')](function(){for(var _0x23a575=0x0;_0x23a575<_0x1525c3['length'];_0x23a575+=0x1){_0x347787[_0xfee8('0x52')](_0xfee8('0x57'),{'OpenchannelInteractionId':Number(_0x1525c3[_0x23a575]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x9')](function(){if(_0x507656===_0xfee8('0x50')){var _0x3ca8ea=_[_0xfee8('0x14')](_0x51d263['WhatsappInteractions'],'id');return _0x51d263[_0xfee8('0x58')](_0x3ca8ea)['then'](function(){for(var _0x3acec7=0x0;_0x3acec7<_0x3ca8ea[_0xfee8('0x1a')];_0x3acec7+=0x1){_0x347787[_0xfee8('0x52')](_0xfee8('0x59'),{'WhatsappInteractionId':Number(_0x3ca8ea[_0x3acec7]),'UserId':Number(_0x51d263['id'])});}});}})[_0xfee8('0x5a')](function(_0x3d7f64){_0x5025b4[_0xfee8('0x5b')](_0x3d7f64);});}}function onDisconnect(_0x966425,_0x10893d){joinOrLeave(_0x966425,_0xfee8('0x50'),_0x10893d);}function onConnect(_0x21038e){joinOrLeave(_0x21038e,_0xfee8('0x5c'));}exports['default']=function(_0x2898d8){_0x2898d8['on'](_0xfee8('0x5d'),function(_0xbc9793){_0xbc9793['setMaxListeners'](0x0);_0xbc9793[_0xfee8('0x5e')]=_0xbc9793[_0xfee8('0x5f')][_0xfee8('0x5d')][_0xfee8('0x60')]+':'+_0xbc9793[_0xfee8('0x5f')][_0xfee8('0x5d')]['remotePort'];_0xbc9793[_0xfee8('0x61')]=new Date();_0xbc9793[_0xfee8('0x5b')]=function(_0x2553b9){console[_0xfee8('0x5b')]('SocketIO\x20'+_0xbc9793[_0xfee8('0x62')]['name']+'['+_0xbc9793['address']+']',_0x2553b9);};_0xbc9793['on']('disconnect',function(){onDisconnect(_0xbc9793,_0x2898d8);_0xbc9793['log'](_0xfee8('0x63'));});onConnect(_0xbc9793);_0xbc9793[_0xfee8('0x5b')](_0xfee8('0x64'));});}; \ No newline at end of file +var _0x6132=['SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','user:%s','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','user','ChatQueues','ChatQueue','OpenchannelQueue','WhatsappQueues','WhatsappQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','voice','chat','fax','mail','openchannel','trunk:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','setMaxListeners','address','request','connection','remoteAddress','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','util','../mysqldb','./environment','name','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','role','Campaign','format','%s:queue:%s','Agents','length','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','FaxInteraction','FaxInteractions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6132,0xf3));var _0x2613=function(_0x3f22fc,_0x1ded64){_0x3f22fc=_0x3f22fc-0x0;var _0x5112c7=_0x6132[_0x3f22fc];return _0x5112c7;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var BPromise=require('bluebird');var db=require(_0x2613('0x1'))['db'];var config=require(_0x2613('0x2'));var queryQueues={'attributes':['id',_0x2613('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x2613('0x3'),'role'],'raw':!![],'where':{'role':_0x2613('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x2613('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2613('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x2613('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2613('0x3'),_0x2613('0x6')],'where':{'type':'ivr'}};function getAssociatedResources(_0x573381,_0x43bbbd,_0x47dfc5){return db[_0x2613('0x7')][_0x2613('0x8')]({'where':{'name':_0x573381,'userProfileId':_0x43bbbd},'raw':!![]})[_0x2613('0x9')](function(_0x34a6fe){if(_0x34a6fe){if(_0x34a6fe[_0x2613('0xa')]){switch(_0x573381){case _0x2613('0xb'):case'ChatQueues':case _0x2613('0xc'):case _0x2613('0xd'):case _0x2613('0xe'):case _0x2613('0xf'):case'WhatsappQueues':return db[_0x47dfc5][_0x2613('0x10')](queryQueues);case _0x2613('0x11'):return db[_0x47dfc5][_0x2613('0x10')](queryTelephones);case _0x2613('0x12'):return db[_0x47dfc5][_0x2613('0x10')](queryTrunks);case _0x2613('0x13'):return db[_0x47dfc5][_0x2613('0x10')](queryCampaigns);}}else{return db[_0x2613('0x14')][_0x2613('0x10')]({'attributes':[_0x2613('0x15')],'where':{'sectionId':_0x34a6fe['id']},'raw':!![]})[_0x2613('0x9')](function(_0x34e96e){if(_0x34e96e){var _0x20d8a5={'where':{'id':_[_0x2613('0x16')](_0x34e96e,_0x2613('0x15'))},'raw':!![]};switch(_0x47dfc5){case _0x2613('0x17'):_0x20d8a5[_0x2613('0x18')][_0x2613('0x19')]=_0x2613('0x5');break;case _0x2613('0x1a'):_0x20d8a5[_0x2613('0x18')][_0x2613('0x6')]='ivr';break;}return db[_0x47dfc5][_0x2613('0x10')](_0x20d8a5);}else{return[];}});}}else{return[];}})[_0x2613('0x9')](function(_0x838811){return _0x838811;});}function joinOrLeaveQueues(_0x283a88,_0x1ef0c0,_0x363754,_0x22c4db){_0x283a88[_0x1ef0c0](util[_0x2613('0x1b')](_0x2613('0x1c'),_0x363754,_0x22c4db[_0x2613('0x3')]));if(_0x22c4db[_0x2613('0x1d')]){for(var _0x48811a=0x0;_0x48811a<_0x22c4db[_0x2613('0x1d')][_0x2613('0x1e')];_0x48811a+=0x1){_0x283a88[_0x1ef0c0](util[_0x2613('0x1b')]('user:%s',_0x22c4db[_0x2613('0x1d')][_0x48811a]['name']));}}}function joinOrLeave(_0x476ef7,_0x324697,_0x4654cd){var _0x1a84db;if(_0x476ef7[_0x2613('0x1f')][_0x2613('0x20')]['id']){db[_0x2613('0x17')][_0x2613('0x21')]({'attributes':['id',_0x2613('0x3'),_0x2613('0x19'),_0x2613('0x22')],'where':{'id':_0x476ef7['handshake'][_0x2613('0x20')]['id']},'include':[{'model':db[_0x2613('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2613('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2613('0x25')],'as':_0x2613('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2613('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2613('0x28')],'as':_0x2613('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x2613('0x9')](function(_0x52fb49){if(_0x52fb49){_0x1a84db=_0x52fb49;_0x476ef7[_0x324697](util[_0x2613('0x1b')](_0x2613('0x2a'),_0x52fb49[_0x2613('0x3')]));var _0x413262=[];switch(_0x52fb49['role']){case _0x2613('0x2b'):_0x476ef7[_0x324697](_0x2613('0x2c'));_0x476ef7[_0x324697](_0x2613('0x2d'));if(queryQueues['hasOwnProperty'](_0x2613('0x2e'))){delete queryQueues[_0x2613('0x2e')];}_0x413262['push'](db[_0x2613('0x2f')]['findAll'](queryQueues));_0x413262[_0x2613('0x30')](db['ChatQueue'][_0x2613('0x10')](queryQueues));_0x413262[_0x2613('0x30')](db[_0x2613('0x31')][_0x2613('0x10')](queryQueues));_0x413262[_0x2613('0x30')](db[_0x2613('0x32')][_0x2613('0x10')](queryQueues));_0x413262[_0x2613('0x30')](db[_0x2613('0x33')][_0x2613('0x10')](queryQueues));_0x413262[_0x2613('0x30')](db['OpenchannelQueue']['findAll'](queryQueues));_0x413262[_0x2613('0x30')](db['WhatsappQueue']['findAll'](queryQueues));_0x413262[_0x2613('0x30')](db[_0x2613('0x17')][_0x2613('0x10')](queryTelephones));_0x413262['push'](db['Trunk']['findAll'](queryTrunks));_0x413262[_0x2613('0x30')](db[_0x2613('0x1a')][_0x2613('0x10')](queryCampaigns));_0x413262[_0x2613('0x30')](db[_0x2613('0x17')][_0x2613('0x10')](queryAgents));break;case _0x2613('0x34'):_0x476ef7[_0x324697](_0x2613('0x2c'));_0x476ef7[_0x324697](_0x2613('0x2d'));_0x413262[_0x2613('0x30')](getAssociatedResources(_0x2613('0xb'),_0x52fb49[_0x2613('0x22')],_0x2613('0x2f')));_0x413262[_0x2613('0x30')](getAssociatedResources(_0x2613('0x35'),_0x52fb49[_0x2613('0x22')],_0x2613('0x36')));_0x413262[_0x2613('0x30')](getAssociatedResources('FaxQueues',_0x52fb49['userProfileId'],'FaxQueue'));_0x413262['push'](getAssociatedResources(_0x2613('0xd'),_0x52fb49[_0x2613('0x22')],'SmsQueue'));_0x413262['push'](getAssociatedResources(_0x2613('0xe'),_0x52fb49['userProfileId'],_0x2613('0x33')));_0x413262[_0x2613('0x30')](getAssociatedResources(_0x2613('0xf'),_0x52fb49['userProfileId'],_0x2613('0x37')));_0x413262[_0x2613('0x30')](getAssociatedResources(_0x2613('0x38'),_0x52fb49[_0x2613('0x22')],_0x2613('0x39')));_0x413262['push'](getAssociatedResources('Telephones',_0x52fb49[_0x2613('0x22')],_0x2613('0x17')));_0x413262['push'](getAssociatedResources(_0x2613('0x12'),_0x52fb49[_0x2613('0x22')],_0x2613('0x3a')));_0x413262['push'](getAssociatedResources(_0x2613('0x13'),_0x52fb49[_0x2613('0x22')],_0x2613('0x1a')));_0x413262[_0x2613('0x30')](db['User']['findAll'](queryAgents));break;case _0x2613('0x4'):_0x476ef7[_0x324697]('voice:inbound');_0x476ef7[_0x324697](_0x2613('0x2d'));_0x413262[_0x2613('0x30')](_0x52fb49[_0x2613('0x3b')]({'attributes':['id',_0x2613('0x3')]}));_0x413262[_0x2613('0x30')](_0x52fb49[_0x2613('0x3c')]({'attributes':['id','name']}));_0x413262[_0x2613('0x30')](_0x52fb49[_0x2613('0x3d')]({'attributes':['id','name']}));_0x413262[_0x2613('0x30')](_0x52fb49[_0x2613('0x3e')]({'attributes':['id',_0x2613('0x3')]}));_0x413262[_0x2613('0x30')](_0x52fb49['getMailQueues']({'attributes':['id','name']}));_0x413262[_0x2613('0x30')](_0x52fb49[_0x2613('0x3f')]({'attributes':['id',_0x2613('0x3')]}));_0x413262[_0x2613('0x30')](_0x52fb49['getWhatsappQueues']({'attributes':['id',_0x2613('0x3')]}));break;}return BPromise['all'](_0x413262);}})['then'](function(_0x3bb3cb){if(_0x3bb3cb&&_0x3bb3cb[_0x2613('0x1e')]){for(var _0x22bad5=0x0;_0x22bad5<_0x3bb3cb[_0x2613('0x1e')];_0x22bad5+=0x1){for(var _0x4ec143=0x0;_0x4ec143<_0x3bb3cb[_0x22bad5][_0x2613('0x1e')];_0x4ec143+=0x1){switch(_0x22bad5){case 0x0:joinOrLeaveQueues(_0x476ef7,_0x324697,_0x2613('0x40'),_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x1:joinOrLeaveQueues(_0x476ef7,_0x324697,_0x2613('0x41'),_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x2:joinOrLeaveQueues(_0x476ef7,_0x324697,_0x2613('0x42'),_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x3:joinOrLeaveQueues(_0x476ef7,_0x324697,'sms',_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x4:joinOrLeaveQueues(_0x476ef7,_0x324697,_0x2613('0x43'),_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x5:joinOrLeaveQueues(_0x476ef7,_0x324697,_0x2613('0x44'),_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x6:joinOrLeaveQueues(_0x476ef7,_0x324697,'whatsapp',_0x3bb3cb[_0x22bad5][_0x4ec143]);break;case 0x7:if(_0x1a84db[_0x2613('0x19')]!==_0x2613('0x4'))_0x476ef7[_0x324697](util[_0x2613('0x1b')]('telephone:%s',_0x3bb3cb[_0x22bad5][_0x4ec143][_0x2613('0x3')]));break;case 0x8:if(_0x1a84db['role']!==_0x2613('0x4'))_0x476ef7[_0x324697](util[_0x2613('0x1b')](_0x2613('0x45'),_0x3bb3cb[_0x22bad5][_0x4ec143][_0x2613('0x3')]));break;case 0x9:if(_0x1a84db[_0x2613('0x19')]!==_0x2613('0x4'))_0x476ef7[_0x324697](util['format'](_0x2613('0x46'),_0x3bb3cb[_0x22bad5][_0x4ec143][_0x2613('0x6')],_0x3bb3cb[_0x22bad5][_0x4ec143][_0x2613('0x3')]));break;case 0xa:_0x476ef7[_0x324697](util[_0x2613('0x1b')](_0x2613('0x2a'),_0x3bb3cb[_0x22bad5][_0x4ec143]['name']));break;}}}}})[_0x2613('0x9')](function(){if(_0x324697===_0x2613('0x47')){var _0x31e3dd=_[_0x2613('0x16')](_0x1a84db[_0x2613('0x48')],'id');return _0x1a84db['removeChatInteractions'](_0x31e3dd)[_0x2613('0x9')](function(){for(var _0x132301=0x0;_0x132301<_0x31e3dd[_0x2613('0x1e')];_0x132301+=0x1){_0x4654cd[_0x2613('0x49')](_0x2613('0x4a'),{'ChatInteractionId':Number(_0x31e3dd[_0x132301]),'UserId':Number(_0x1a84db['id'])});}});}})['then'](function(){if(_0x324697===_0x2613('0x47')){var _0x16395d=_['map'](_0x1a84db[_0x2613('0x4b')],'id');return _0x1a84db[_0x2613('0x4c')](_0x16395d)['then'](function(){for(var _0x194907=0x0;_0x194907<_0x16395d[_0x2613('0x1e')];_0x194907+=0x1){_0x4654cd[_0x2613('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x16395d[_0x194907]),'UserId':Number(_0x1a84db['id'])});}});}})[_0x2613('0x9')](function(){if(_0x324697===_0x2613('0x47')){var _0x2a26d6=_[_0x2613('0x16')](_0x1a84db[_0x2613('0x26')],'id');return _0x1a84db[_0x2613('0x4d')](_0x2a26d6)[_0x2613('0x9')](function(){for(var _0x2f9ed0=0x0;_0x2f9ed0<_0x2a26d6[_0x2613('0x1e')];_0x2f9ed0+=0x1){_0x4654cd['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2a26d6[_0x2f9ed0]),'UserId':Number(_0x1a84db['id'])});}});}})[_0x2613('0x9')](function(){if(_0x324697===_0x2613('0x47')){var _0x28878a=_['map'](_0x1a84db[_0x2613('0x27')],'id');return _0x1a84db[_0x2613('0x4e')](_0x28878a)['then'](function(){for(var _0xf73060=0x0;_0xf73060<_0x28878a[_0x2613('0x1e')];_0xf73060+=0x1){_0x4654cd[_0x2613('0x49')](_0x2613('0x4f'),{'SmsInteractionId':Number(_0x28878a[_0xf73060]),'UserId':Number(_0x1a84db['id'])});}});}})[_0x2613('0x9')](function(){if(_0x324697===_0x2613('0x47')){var _0x2bc548=_['map'](_0x1a84db[_0x2613('0x29')],'id');return _0x1a84db['removeOpenchannelInteractions'](_0x2bc548)[_0x2613('0x9')](function(){for(var _0x5c7766=0x0;_0x5c7766<_0x2bc548[_0x2613('0x1e')];_0x5c7766+=0x1){_0x4654cd['emit'](_0x2613('0x50'),{'OpenchannelInteractionId':Number(_0x2bc548[_0x5c7766]),'UserId':Number(_0x1a84db['id'])});}});}})[_0x2613('0x9')](function(){if(_0x324697===_0x2613('0x47')){var _0x1fd663=_[_0x2613('0x16')](_0x1a84db['WhatsappInteractions'],'id');return _0x1a84db[_0x2613('0x51')](_0x1fd663)['then'](function(){for(var _0x259c4f=0x0;_0x259c4f<_0x1fd663[_0x2613('0x1e')];_0x259c4f+=0x1){_0x4654cd[_0x2613('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x1fd663[_0x259c4f]),'UserId':Number(_0x1a84db['id'])});}});}})[_0x2613('0x52')](function(_0x202a61){_0x476ef7[_0x2613('0x53')](_0x202a61);});}}function onDisconnect(_0x4739c1,_0x312c16){joinOrLeave(_0x4739c1,_0x2613('0x47'),_0x312c16);}function onConnect(_0x538024){joinOrLeave(_0x538024,'join');}exports['default']=function(_0x45e2d6){_0x45e2d6['on']('connection',function(_0x5a5889){_0x5a5889[_0x2613('0x54')](0x0);_0x5a5889[_0x2613('0x55')]=_0x5a5889[_0x2613('0x56')][_0x2613('0x57')][_0x2613('0x58')]+':'+_0x5a5889[_0x2613('0x56')]['connection']['remotePort'];_0x5a5889[_0x2613('0x59')]=new Date();_0x5a5889['log']=function(_0x5dbb14){console[_0x2613('0x53')](_0x2613('0x5a')+_0x5a5889['nsp'][_0x2613('0x3')]+'['+_0x5a5889[_0x2613('0x55')]+']',_0x5dbb14);};_0x5a5889['on'](_0x2613('0x5b'),function(){onDisconnect(_0x5a5889,_0x45e2d6);_0x5a5889[_0x2613('0x53')](_0x2613('0x5c'));});onConnect(_0x5a5889);_0x5a5889[_0x2613('0x53')](_0x2613('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 32a4f1e..57217a7 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 _0x0c5f=['client','http','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','EventManager','then','Trigger,\x20%s','error','code','catch','get','motionChannel','event','direction','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','interface','format','agent','channel','outgoingmessage','offlineMessage','opened','query','UserId','SIP/%s','name','AfterCreate','closed','changed','substatus','AfterUpdate','User','fullname','internal','default','length','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers'];(function(_0x39cd9a,_0x5cfff3){var _0xc062a6=function(_0x78cf50){while(--_0x78cf50){_0x39cd9a['push'](_0x39cd9a['shift']());}};_0xc062a6(++_0x5cfff3);}(_0x0c5f,0x1de));var _0xf0c5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c5f[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf0c5('0x0'));var db=require(_0xf0c5('0x1'))['db'];var jayson=require(_0xf0c5('0x2'));var logger=require(_0xf0c5('0x3'))(_0xf0c5('0x4'));var client=jayson[_0xf0c5('0x5')][_0xf0c5('0x6')]({'port':0x232a});var triggers=[{'channel':_0xf0c5('0x7'),'model':_0xf0c5('0x8'),'event':'afterCreate','condition':_0xf0c5('0x9'),'callback':afterCreate},{'channel':_0xf0c5('0x7'),'model':_0xf0c5('0x8'),'event':_0xf0c5('0xa'),'condition':_0xf0c5('0xb'),'callback':afterUpdate},{'channel':_0xf0c5('0x7'),'model':_0xf0c5('0xc'),'event':_0xf0c5('0xd'),'condition':_0xf0c5('0xe'),'callback':afterCreateMessage},{'channel':_0xf0c5('0x7'),'model':_0xf0c5('0xf'),'event':'afterCreate','condition':_0xf0c5('0xe'),'callback':afterCreateOfflineMessage},{'channel':_0xf0c5('0x10'),'model':_0xf0c5('0x11'),'event':'afterCreate','condition':_0xf0c5('0x9'),'callback':afterCreate},{'channel':_0xf0c5('0x10'),'model':_0xf0c5('0x11'),'event':'afterUpdate','condition':_0xf0c5('0xb'),'callback':afterUpdate},{'channel':_0xf0c5('0x10'),'model':_0xf0c5('0x12'),'event':_0xf0c5('0xd'),'condition':_0xf0c5('0xe'),'callback':afterCreateMessage},{'channel':_0xf0c5('0x13'),'model':'WhatsappInteraction','event':'afterCreate','condition':_0xf0c5('0x9'),'callback':afterCreate},{'channel':_0xf0c5('0x13'),'model':'WhatsappInteraction','event':_0xf0c5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf0c5('0x13'),'model':'WhatsappMessage','event':_0xf0c5('0xd'),'condition':_0xf0c5('0xe'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xf0c5('0x14'),'event':'afterCreate','condition':_0xf0c5('0x9'),'callback':afterCreate},{'channel':_0xf0c5('0x15'),'model':_0xf0c5('0x14'),'event':_0xf0c5('0xa'),'condition':_0xf0c5('0xb'),'callback':afterUpdate},{'channel':_0xf0c5('0x15'),'model':_0xf0c5('0x16'),'event':_0xf0c5('0xd'),'condition':_0xf0c5('0xe'),'callback':afterCreateMessage},{'channel':_0xf0c5('0x17'),'model':_0xf0c5('0x18'),'event':'afterCreate','condition':_0xf0c5('0x9'),'callback':afterCreate},{'channel':_0xf0c5('0x17'),'model':'MailInteraction','event':_0xf0c5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf0c5('0x17'),'model':_0xf0c5('0x19'),'event':'afterCreate','condition':_0xf0c5('0xe'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xf0c5('0x1a'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xf0c5('0x1b'),'model':_0xf0c5('0x1a'),'event':_0xf0c5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf0c5('0x1b'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xf0c5('0xe'),'callback':afterCreateMessage}];function request(_0x5737ce){return client['request'](_0xf0c5('0x1c'),_0x5737ce)[_0xf0c5('0x1d')](function(_0x5012af){logger['info'](_0xf0c5('0x1e'),_0xf0c5('0x1c'),_0x5012af);if(_0x5012af[_0xf0c5('0x1f')]){if(_0x5012af[_0xf0c5('0x1f')][_0xf0c5('0x20')]===0x1f4){logger['error'](_0xf0c5('0x1e'),_0xf0c5('0x1c'),_0x5012af[_0xf0c5('0x1f')]);}}})[_0xf0c5('0x21')](function(_0x14fc37){logger[_0xf0c5('0x1f')]('Trigger,\x20%s',_0xf0c5('0x1c'),_0x14fc37);});}function afterCreateMessage(_0x391a5c){return function(_0x15c0c7){_0x15c0c7=_0x15c0c7[_0xf0c5('0x22')]({'plain':!![]});_0x15c0c7['channel']=_0x391a5c;_0x15c0c7[_0xf0c5('0x23')]=_0x391a5c;_0x15c0c7[_0xf0c5('0x24')]=_0x15c0c7[_0xf0c5('0x25')];Promise['resolve']()[_0xf0c5('0x1d')](function(){if(typeof _0x15c0c7[_0xf0c5('0x26')]==='undefined')return null;var _0x324fa7=_0xf0c5('0x27')+_0x15c0c7[_0xf0c5('0x26')];return db[_0xf0c5('0x28')]['query'](_0x324fa7,{'type':db[_0xf0c5('0x29')][_0xf0c5('0x2a')][_0xf0c5('0x2b')],'raw':!![]});})['then'](function(_0x31bf1b){if(_0x31bf1b){_0x15c0c7[_0xf0c5('0x2c')]=_0x31bf1b[0x0];}if(typeof _0x15c0c7['UserId']==='undefined')return;return getAgent(_0x15c0c7['UserId']);})['then'](function(_0x8f525e){if(_0x8f525e){_0x15c0c7[_0xf0c5('0x2d')]=util[_0xf0c5('0x2e')]('SIP/%s',_0x8f525e['name']);_0x15c0c7[_0xf0c5('0x2f')]=_0x8f525e;_0x15c0c7[_0xf0c5('0x30')]=_0x391a5c;return request({'event':'incomingmessage','message':_0x15c0c7});}else{return request({'event':_0xf0c5('0x31'),'message':_0x15c0c7});}})[_0xf0c5('0x21')](function(_0x4ed04b){logger[_0xf0c5('0x1f')](_0xf0c5('0x1e'),'AfterCreateMessage',_0x4ed04b);});};}function afterCreateOfflineMessage(_0x519219){return function(_0x2b2803){_0x2b2803=_0x2b2803[_0xf0c5('0x22')]({'plain':!![]});_0x2b2803['channel']=_0x519219;_0x2b2803['motionChannel']=_0x519219;_0x2b2803['event']=_0xf0c5('0x32');return request({'event':_0x2b2803[_0xf0c5('0x24')],'message':_0x2b2803});};}function afterCreate(_0x52453e,_0x292a58){return function(_0x580b98){_0x580b98=_0x580b98['get']({'plain':!![]});_0x580b98[_0xf0c5('0x30')]=_0x52453e;_0x580b98[_0xf0c5('0x23')]=_0x52453e;_0x580b98['event']=_0xf0c5('0x33');Promise['resolve']()['then'](function(){var _0x590a9a=_0xf0c5('0x27')+_0x580b98['ContactId'];return db['sequelize'][_0xf0c5('0x34')](_0x590a9a,{'type':db[_0xf0c5('0x29')][_0xf0c5('0x2a')][_0xf0c5('0x2b')],'raw':!![]});})[_0xf0c5('0x1d')](function(_0x1b4298){if(_0x1b4298){_0x580b98[_0xf0c5('0x2c')]=_0x1b4298[0x0];}if(typeof _0x580b98[_0xf0c5('0x35')]==='undefined')return;return getAgent(_0x580b98['UserId']);})[_0xf0c5('0x1d')](function(_0x2e10c3){if(_0x2e10c3){_0x580b98[_0xf0c5('0x2d')]=util[_0xf0c5('0x2e')](_0xf0c5('0x36'),_0x2e10c3[_0xf0c5('0x37')]);_0x580b98[_0xf0c5('0x2f')]=_0x2e10c3;}return request({'event':_0x292a58,'message':_0x580b98});})[_0xf0c5('0x21')](function(_0x1ca934){logger[_0xf0c5('0x1f')](_0xf0c5('0x1e'),_0xf0c5('0x38'),_0x1ca934);});};}function afterUpdate(_0x2ae15e){return function(_0x42d8fa){var _0x43679a=_0x42d8fa['changed'](_0xf0c5('0x39'))&&_0x42d8fa['closed'];var _0x522b13=_0x42d8fa[_0xf0c5('0x3a')](_0xf0c5('0x3b'));if(_0x43679a||_0x522b13){var _0x1b3202=_0x43679a?_0xf0c5('0xb'):'substatus';var _0x2a991c=_0x42d8fa[_0xf0c5('0x22')]({'plain':!![]});_0x2a991c['channel']=_0x2ae15e;_0x2a991c['motionChannel']=_0x2ae15e;_0x2a991c[_0xf0c5('0x24')]=_0x43679a?'closed':'substatus';var _0x57ff67=_0xf0c5('0x27')+_0x2a991c[_0xf0c5('0x26')];return db[_0xf0c5('0x28')][_0xf0c5('0x34')](_0x57ff67,{'type':db[_0xf0c5('0x29')]['QueryTypes'][_0xf0c5('0x2b')],'raw':!![]})['then'](function(_0x47d02e){if(_0x47d02e){_0x2a991c[_0xf0c5('0x2c')]=_0x47d02e[0x0];}if(typeof _0x2a991c[_0xf0c5('0x35')]==='undefined')return;return getAgent(_0x2a991c[_0xf0c5('0x35')]);})[_0xf0c5('0x1d')](function(_0xb742c5){if(_0xb742c5){_0x2a991c['interface']=util[_0xf0c5('0x2e')](_0xf0c5('0x36'),_0xb742c5[_0xf0c5('0x37')]);_0x2a991c[_0xf0c5('0x2f')]=_0xb742c5;}return request({'event':_0x1b3202,'message':_0x2a991c});})[_0xf0c5('0x21')](function(_0x169ef6){logger[_0xf0c5('0x1f')](_0xf0c5('0x1e'),_0xf0c5('0x3c'),_0x169ef6);});}};}function getAgent(_0x34d28e){return db[_0xf0c5('0x3d')]['find']({'where':{'id':_0x34d28e},'attributes':['id',_0xf0c5('0x37'),_0xf0c5('0x3e'),'email',_0xf0c5('0x3f')],'raw':!![]})[_0xf0c5('0x1d')](function(_0x2a5ae2){return _0x2a5ae2;});}exports[_0xf0c5('0x40')]=function(){for(var _0x4891a2=0x0;_0x4891a2=_0xff147[_0x2faa('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4332ff(_0x1b05f7);})[_0x2faa('0x14')](function(_0x252724){_0x547138(_0x252724);});});}; \ No newline at end of file +var _0xe1ab=['openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','../mysqldb','./license/util','voice','fax','sms','whatsapp'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1ab,0xe9));var _0xbe1a=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0xe1ab[_0x56a871];return _0x124954;};'use strict';var _=require(_0xbe1a('0x0'));var BPromise=require('bluebird');var db=require(_0xbe1a('0x1'))['db'];var util=require(_0xbe1a('0x2'));var channels=[_0xbe1a('0x3'),'mail','chat',_0xbe1a('0x4'),_0xbe1a('0x5'),_0xbe1a('0x6'),_0xbe1a('0x7')];exports[_0xbe1a('0x8')]=function(){return channels;};exports[_0xbe1a('0x9')]=function(_0x42aa9f){_0x42aa9f=_0x42aa9f[_0xbe1a('0xa')]();return _[_0xbe1a('0xb')](channels,_0x42aa9f);};exports[_0xbe1a('0xc')]=function(_0x237d33,_0x4d4114,_0x5c5c3c,_0x510d40){var _0x40384c={'loginAttempts':_0x4d4114,'blocked':_0x5c5c3c};if(!_['isUndefined'](_0x510d40)){_0x40384c['blockedAt']=_0x510d40;}return _0x237d33['updateAttributes'](_0x40384c);};exports[_0xbe1a('0xd')]=function(_0x296802){return new BPromise(function(_0x276cb7,_0x54b4af){var _0x6dd486=0x0;if(_0x296802[_0xbe1a('0xe')]!==_0xbe1a('0xf')){_0x276cb7(_0x296802);}db['User'][_0xbe1a('0x10')]({'where':{'role':_0xbe1a('0xf'),'online':!![],'id':{'$ne':_0x296802['id']}}})[_0xbe1a('0x11')](function(_0x4e0396){_0x6dd486=_0x4e0396;return util[_0xbe1a('0xd')]();})[_0xbe1a('0x11')](function(_0x58c151){if(_0x58c151&&_0x58c151[_0xbe1a('0x12')]&&_0x6dd486>=_0x58c151[_0xbe1a('0x12')]){throw Error(_0xbe1a('0x13'));}_0x276cb7(_0x296802);})['catch'](function(_0x472381){_0x54b4af(_0x472381);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 109211d..cf7f929 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Bad\x20Request','Forbidden','OutOfInterval','error','stack'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0xb688,0xcf));var _0x8b68=function(_0x266b88,_0x277477){_0x266b88=_0x266b88-0x0;var _0x49b602=_0xb688[_0x266b88];return _0x49b602;};'use strict';var util=require('util');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var APIError=function(_0x266285,_0x1080e8){this[_0x8b68('0x2')]=_0x266285||_0x8b68('0x3');this['name']=_0x1080e8||_0x8b68('0x4');util[_0x8b68('0x5')](APIError,Error);};var APIBadRequestError=function(_0x30f33d){this[_0x8b68('0x2')]=_0x30f33d||'Bad\x20Request';this[_0x8b68('0x6')]='Bad\x20Request';util[_0x8b68('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2bbffd){this[_0x8b68('0x2')]=_0x2bbffd||_0x8b68('0x7');this[_0x8b68('0x6')]=_0x8b68('0x8');util[_0x8b68('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x21d944){switch(_0x21d944){case _0x8b68('0x9'):return 0x190;case _0x8b68('0xa'),_0x8b68('0xb'):return 0x193;case _0x8b68('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2a852a){return function(_0x502727){logger[_0x8b68('0xc')](_0x502727[_0x8b68('0xd')]);var _0x5e76c=getStatusCode(_0x502727[_0x8b68('0x6')]);if(_0x502727[_0x8b68('0x6')])delete _0x502727[_0x8b68('0x6')];return _0x2a852a[_0x8b68('0xe')](_0x5e76c)[_0x8b68('0xf')](_0x502727);};}module[_0x8b68('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x9c44=['Forbidden','OutOfInterval','status','exports','api','message','Internal\x20Server\x20Error','name','Bad\x20Request','inherits','Entity\x20not\x20found','Not\x20Found'];(function(_0x263fff,_0x2a2e2b){var _0x23da7e=function(_0x2fe810){while(--_0x2fe810){_0x263fff['push'](_0x263fff['shift']());}};_0x23da7e(++_0x2a2e2b);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x49c4('0x0'));var APIError=function(_0x18bf2d,_0x26844b){this[_0x49c4('0x1')]=_0x18bf2d||_0x49c4('0x2');this[_0x49c4('0x3')]=_0x26844b||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x41a183){this['message']=_0x41a183||_0x49c4('0x4');this[_0x49c4('0x3')]=_0x49c4('0x4');util[_0x49c4('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x436234){this['message']=_0x436234||_0x49c4('0x6');this[_0x49c4('0x3')]=_0x49c4('0x7');util[_0x49c4('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4c7d3a){switch(_0x4c7d3a){case'Bad\x20Request':return 0x190;case _0x49c4('0x8'),_0x49c4('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0xb611a1){return function(_0x459d09){logger['error'](_0x459d09['stack']);var _0x1d19bf=getStatusCode(_0x459d09[_0x49c4('0x3')]);if(_0x459d09['name'])delete _0x459d09[_0x49c4('0x3')];return _0xb611a1[_0x49c4('0xa')](_0x1d19bf)['send'](_0x459d09);};}module[_0x49c4('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e0fa260..4fbd4fe 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6931=['render','json','send','exports','404','status'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x6931,0xa5));var _0x1693=function(_0x4dd6ca,_0x38bd9d){_0x4dd6ca=_0x4dd6ca-0x0;var _0x846b7a=_0x6931[_0x4dd6ca];return _0x846b7a;};'use strict';module[_0x1693('0x0')][0x194]=function pageNotFound(_0xe1fa9e,_0x51e896){var _0x5a3aec=_0x1693('0x1');var _0x190052=0x194;var _0x37c53b={'status':_0x190052};_0x51e896['status'](_0x37c53b[_0x1693('0x2')]);_0x51e896[_0x1693('0x3')](_0x5a3aec,{},function(_0x2c6ed0,_0x576a1d){if(_0x2c6ed0){return _0x51e896[_0x1693('0x2')](_0x37c53b['status'])[_0x1693('0x4')](_0x37c53b);}_0x51e896[_0x1693('0x5')](_0x576a1d);});}; \ No newline at end of file +var _0xb447=['status','json','send','exports','404'];(function(_0x5bcb0f,_0x221e89){var _0x57eec2=function(_0x8e295){while(--_0x8e295){_0x5bcb0f['push'](_0x5bcb0f['shift']());}};_0x57eec2(++_0x221e89);}(_0xb447,0xd5));var _0x7b44=function(_0x306015,_0x2520ac){_0x306015=_0x306015-0x0;var _0x2899d3=_0xb447[_0x306015];return _0x2899d3;};'use strict';module[_0x7b44('0x0')][0x194]=function pageNotFound(_0x3ea9a1,_0x3754fe){var _0x2a1836=_0x7b44('0x1');var _0x52a878=0x194;var _0x5954f8={'status':_0x52a878};_0x3754fe['status'](_0x5954f8[_0x7b44('0x2')]);_0x3754fe['render'](_0x2a1836,{},function(_0xa48ea3,_0x20cdb3){if(_0xa48ea3){return _0x3754fe['status'](_0x5954f8[_0x7b44('0x2')])[_0x7b44('0x3')](_0x5954f8);}_0x3754fe[_0x7b44('0x4')](_0x20cdb3);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4cb5bce..75b3932 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(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 345cc19..4d7601c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x587b=['./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/variable','./api/integrationReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/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/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/apidoc','join','root','/www','/demo','static','/snippet','snippet','3.2.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/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/voice/calls/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts'];(function(_0x1276ea,_0x567b4f){var _0x3c4b45=function(_0x32d643){while(--_0x32d643){_0x1276ea['push'](_0x1276ea['shift']());}};_0x3c4b45(++_0x567b4f);}(_0x587b,0xed));var _0xb587=function(_0x4abe3d,_0x32c9b1){_0x4abe3d=_0x4abe3d-0x0;var _0x383ac8=_0x587b[_0x4abe3d];return _0x383ac8;};'use strict';var path=require(_0xb587('0x0'));var express=require('express');var errors=require(_0xb587('0x1'));var config=require(_0xb587('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0xb587('0x3')];var clientSideLogs=require(_0xb587('0x4'));exports[_0xb587('0x5')]=function(_0x1d8574){return setupLoggers(_0x1d8574)[_0xb587('0x6')](function(){_0x1d8574['use'](_0xb587('0x7'),require(_0xb587('0x8')));_0x1d8574[_0xb587('0x9')](_0xb587('0xa'),require(_0xb587('0xb')));_0x1d8574[_0xb587('0x9')](_0xb587('0xc'),require(_0xb587('0xd')));_0x1d8574[_0xb587('0x9')](_0xb587('0xe'),require(_0xb587('0xf')));_0x1d8574['use'](_0xb587('0x10'),require(_0xb587('0x11')));_0x1d8574['use'](_0xb587('0x12'),require(_0xb587('0x13')));_0x1d8574[_0xb587('0x9')](_0xb587('0x14'),require(_0xb587('0x15')));_0x1d8574[_0xb587('0x9')](_0xb587('0x16'),require(_0xb587('0x17')));_0x1d8574[_0xb587('0x9')](_0xb587('0x18'),require(_0xb587('0x19')));_0x1d8574[_0xb587('0x9')](_0xb587('0x1a'),require(_0xb587('0x1b')));_0x1d8574[_0xb587('0x9')](_0xb587('0x1c'),require('./api/voiceCallReport'));_0x1d8574['use']('/api/voice/dials/reports',require(_0xb587('0x1d')));_0x1d8574['use']('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x1d8574[_0xb587('0x9')](_0xb587('0x1e'),require(_0xb587('0x1f')));_0x1d8574[_0xb587('0x9')](_0xb587('0x20'),require(_0xb587('0x21')));_0x1d8574[_0xb587('0x9')](_0xb587('0x22'),require(_0xb587('0x23')));_0x1d8574[_0xb587('0x9')](_0xb587('0x24'),require(_0xb587('0x25')));_0x1d8574[_0xb587('0x9')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x1d8574[_0xb587('0x9')](_0xb587('0x26'),require(_0xb587('0x27')));_0x1d8574[_0xb587('0x9')](_0xb587('0x28'),require(_0xb587('0x29')));_0x1d8574[_0xb587('0x9')]('/api/mail/substatuses',require(_0xb587('0x2a')));_0x1d8574[_0xb587('0x9')](_0xb587('0x2b'),require(_0xb587('0x2c')));_0x1d8574[_0xb587('0x9')](_0xb587('0x2d'),require('./api/mailMessage'));_0x1d8574['use'](_0xb587('0x2e'),require(_0xb587('0x2f')));_0x1d8574[_0xb587('0x9')](_0xb587('0x30'),require(_0xb587('0x31')));_0x1d8574['use'](_0xb587('0x32'),require(_0xb587('0x33')));_0x1d8574[_0xb587('0x9')]('/api/dashboards/items',require(_0xb587('0x34')));_0x1d8574['use'](_0xb587('0x35'),require(_0xb587('0x36')));_0x1d8574[_0xb587('0x9')](_0xb587('0x37'),require(_0xb587('0x38')));_0x1d8574['use']('/api/fax/interactions',require(_0xb587('0x39')));_0x1d8574[_0xb587('0x9')]('/api/fax/messages',require(_0xb587('0x3a')));_0x1d8574[_0xb587('0x9')](_0xb587('0x3b'),require(_0xb587('0x3c')));_0x1d8574[_0xb587('0x9')](_0xb587('0x3d'),require('./api/faxQueueReport'));_0x1d8574[_0xb587('0x9')]('/api/sms/accounts',require(_0xb587('0x3e')));_0x1d8574[_0xb587('0x9')](_0xb587('0x3f'),require(_0xb587('0x40')));_0x1d8574[_0xb587('0x9')]('/api/sms/interactions',require(_0xb587('0x41')));_0x1d8574[_0xb587('0x9')](_0xb587('0x42'),require('./api/smsMessage'));_0x1d8574[_0xb587('0x9')]('/api/sms/queues',require(_0xb587('0x43')));_0x1d8574[_0xb587('0x9')](_0xb587('0x44'),require(_0xb587('0x45')));_0x1d8574[_0xb587('0x9')]('/api/openchannel/applications',require(_0xb587('0x46')));_0x1d8574[_0xb587('0x9')]('/api/openchannel/interactions',require(_0xb587('0x47')));_0x1d8574[_0xb587('0x9')](_0xb587('0x48'),require(_0xb587('0x49')));_0x1d8574[_0xb587('0x9')](_0xb587('0x4a'),require(_0xb587('0x4b')));_0x1d8574['use'](_0xb587('0x4c'),require(_0xb587('0x4d')));_0x1d8574[_0xb587('0x9')](_0xb587('0x4e'),require(_0xb587('0x4f')));_0x1d8574[_0xb587('0x9')]('/api/chat/applications',require('./api/chatApplication'));_0x1d8574[_0xb587('0x9')](_0xb587('0x50'),require(_0xb587('0x51')));_0x1d8574[_0xb587('0x9')](_0xb587('0x52'),require(_0xb587('0x53')));_0x1d8574[_0xb587('0x9')](_0xb587('0x54'),require(_0xb587('0x55')));_0x1d8574[_0xb587('0x9')](_0xb587('0x56'),require(_0xb587('0x57')));_0x1d8574[_0xb587('0x9')](_0xb587('0x58'),require(_0xb587('0x59')));_0x1d8574[_0xb587('0x9')](_0xb587('0x5a'),require('./api/chatProactiveAction'));_0x1d8574[_0xb587('0x9')](_0xb587('0x5b'),require('./api/cmCompany'));_0x1d8574[_0xb587('0x9')](_0xb587('0x5c'),require(_0xb587('0x5d')));_0x1d8574[_0xb587('0x9')](_0xb587('0x5e'),require(_0xb587('0x5f')));_0x1d8574[_0xb587('0x9')](_0xb587('0x60'),require('./api/cmHopperBlack'));_0x1d8574[_0xb587('0x9')](_0xb587('0x61'),require(_0xb587('0x62')));_0x1d8574[_0xb587('0x9')]('/api/cm/hopper_history',require(_0xb587('0x63')));_0x1d8574[_0xb587('0x9')](_0xb587('0x64'),require(_0xb587('0x65')));_0x1d8574[_0xb587('0x9')](_0xb587('0x66'),require('./api/action'));_0x1d8574[_0xb587('0x9')](_0xb587('0x67'),require(_0xb587('0x68')));_0x1d8574[_0xb587('0x9')](_0xb587('0x69'),require('./api/cannedAnswer'));_0x1d8574[_0xb587('0x9')]('/api/dispositions',require(_0xb587('0x6a')));_0x1d8574['use'](_0xb587('0x6b'),require(_0xb587('0x6c')));_0x1d8574['use'](_0xb587('0x6d'),require('./api/interval'));_0x1d8574[_0xb587('0x9')](_0xb587('0x6e'),require('./api/pause'));_0x1d8574[_0xb587('0x9')](_0xb587('0x6f'),require(_0xb587('0x70')));_0x1d8574[_0xb587('0x9')](_0xb587('0x71'),require(_0xb587('0x72')));_0x1d8574[_0xb587('0x9')](_0xb587('0x73'),require(_0xb587('0x74')));_0x1d8574[_0xb587('0x9')](_0xb587('0x75'),require(_0xb587('0x76')));_0x1d8574[_0xb587('0x9')](_0xb587('0x77'),require('./api/tag'));_0x1d8574['use'](_0xb587('0x78'),require(_0xb587('0x79')));_0x1d8574['use']('/api/cm_contact_has_items',require(_0xb587('0x7a')));_0x1d8574[_0xb587('0x9')](_0xb587('0x7b'),require(_0xb587('0x7c')));_0x1d8574[_0xb587('0x9')]('/api/templates',require(_0xb587('0x7d')));_0x1d8574['use']('/api/triggers',require('./api/trigger'));_0x1d8574[_0xb587('0x9')]('/api/variables',require(_0xb587('0x7e')));_0x1d8574['use']('/api/integrations',require('./api/integration'));_0x1d8574[_0xb587('0x9')]('/api/integrations/reports',require(_0xb587('0x7f')));_0x1d8574[_0xb587('0x9')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x1d8574[_0xb587('0x9')]('/api/analytics/default_reports',require(_0xb587('0x80')));_0x1d8574[_0xb587('0x9')](_0xb587('0x81'),require(_0xb587('0x82')));_0x1d8574[_0xb587('0x9')]('/api/analytics/metrics',require(_0xb587('0x83')));_0x1d8574[_0xb587('0x9')](_0xb587('0x84'),require(_0xb587('0x85')));_0x1d8574['use'](_0xb587('0x86'),require(_0xb587('0x87')));_0x1d8574[_0xb587('0x9')]('/api/integrations/salesforce/accounts',require(_0xb587('0x88')));_0x1d8574['use'](_0xb587('0x89'),require(_0xb587('0x8a')));_0x1d8574['use']('/api/integrations/salesforce/fields',require(_0xb587('0x8b')));_0x1d8574[_0xb587('0x9')](_0xb587('0x8c'),require('./api/intSugarcrmAccount'));_0x1d8574[_0xb587('0x9')](_0xb587('0x8d'),require(_0xb587('0x8e')));_0x1d8574['use'](_0xb587('0x8f'),require(_0xb587('0x90')));_0x1d8574['use'](_0xb587('0x91'),require(_0xb587('0x92')));_0x1d8574['use'](_0xb587('0x93'),require(_0xb587('0x94')));_0x1d8574['use']('/api/integrations/desk/fields',require(_0xb587('0x95')));_0x1d8574[_0xb587('0x9')](_0xb587('0x96'),require(_0xb587('0x97')));_0x1d8574['use'](_0xb587('0x98'),require(_0xb587('0x99')));_0x1d8574[_0xb587('0x9')](_0xb587('0x9a'),require('./api/intZohoField'));_0x1d8574[_0xb587('0x9')](_0xb587('0x9b'),require(_0xb587('0x9c')));_0x1d8574[_0xb587('0x9')]('/api/integrations/zendesk/configurations',require(_0xb587('0x9d')));_0x1d8574[_0xb587('0x9')](_0xb587('0x9e'),require(_0xb587('0x9f')));_0x1d8574[_0xb587('0x9')]('/api/integrations/freshdesk/accounts',require(_0xb587('0xa0')));_0x1d8574[_0xb587('0x9')](_0xb587('0xa1'),require(_0xb587('0xa2')));_0x1d8574[_0xb587('0x9')](_0xb587('0xa3'),require(_0xb587('0xa4')));_0x1d8574['use'](_0xb587('0xa5'),require(_0xb587('0xa6')));_0x1d8574[_0xb587('0x9')]('/api/integrations/vtiger/configurations',require(_0xb587('0xa7')));_0x1d8574['use']('/api/integrations/vtiger/fields',require(_0xb587('0xa8')));_0x1d8574[_0xb587('0x9')](_0xb587('0xa9'),require(_0xb587('0xaa')));_0x1d8574[_0xb587('0x9')]('/api/integrations/servicenow/configurations',require(_0xb587('0xab')));_0x1d8574[_0xb587('0x9')](_0xb587('0xac'),require('./api/intServicenowField'));_0x1d8574[_0xb587('0x9')](_0xb587('0xad'),require(_0xb587('0xae')));_0x1d8574[_0xb587('0x9')](_0xb587('0xaf'),require(_0xb587('0xb0')));_0x1d8574[_0xb587('0x9')]('/api/integrations/dynamics365/fields',require(_0xb587('0xb1')));_0x1d8574[_0xb587('0x9')](_0xb587('0xb2'),require(_0xb587('0xb3')));_0x1d8574[_0xb587('0x9')]('/api/integrations/freshsales/configurations',require(_0xb587('0xb4')));_0x1d8574[_0xb587('0x9')](_0xb587('0xb5'),require(_0xb587('0xb6')));_0x1d8574[_0xb587('0x9')](_0xb587('0xb7'),require('./api/network'));_0x1d8574[_0xb587('0x9')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x1d8574[_0xb587('0x9')](_0xb587('0xb8'),require(_0xb587('0xb9')));_0x1d8574[_0xb587('0x9')](_0xb587('0xba'),require('./api/jscriptyAnswerReport'));_0x1d8574[_0xb587('0x9')](_0xb587('0xbb'),require(_0xb587('0xbc')));_0x1d8574[_0xb587('0x9')](_0xb587('0xbd'),require(_0xb587('0xbe')));_0x1d8574[_0xb587('0x9')](_0xb587('0xbf'),require(_0xb587('0xc0')));_0x1d8574[_0xb587('0x9')]('/api/square/reports',require(_0xb587('0xc1')));_0x1d8574[_0xb587('0x9')]('/api/square/details/reports',require(_0xb587('0xc2')));_0x1d8574[_0xb587('0x9')](_0xb587('0xc3'),require(_0xb587('0xc4')));_0x1d8574[_0xb587('0x9')](_0xb587('0xc5'),require(_0xb587('0xc6')));_0x1d8574[_0xb587('0x9')]('/api/square/odbc',require(_0xb587('0xc7')));_0x1d8574[_0xb587('0x9')](_0xb587('0xc8'),require('./api/squareProject'));_0x1d8574[_0xb587('0x9')](_0xb587('0xc9'),require(_0xb587('0xca')));_0x1d8574[_0xb587('0x9')](_0xb587('0xcb'),require(_0xb587('0xcc')));_0x1d8574[_0xb587('0x9')](_0xb587('0xcd'),require(_0xb587('0xce')));_0x1d8574[_0xb587('0x9')]('/api/license',require(_0xb587('0xcf')));_0x1d8574[_0xb587('0x9')]('/api/campaigns',require(_0xb587('0xd0')));_0x1d8574[_0xb587('0x9')](_0xb587('0xd1'),require('./api/migration'));_0x1d8574[_0xb587('0x9')](_0xb587('0xd2'),require(_0xb587('0xd3')));_0x1d8574[_0xb587('0x9')]('/api/plugins',require('./api/plugin'));_0x1d8574[_0xb587('0x9')](_0xb587('0xd4'),require(_0xb587('0xd5')));_0x1d8574[_0xb587('0x9')](_0xb587('0xd6'),require('./api/chatTransferReport'));_0x1d8574['use'](_0xb587('0xd7'),require(_0xb587('0xd8')));_0x1d8574[_0xb587('0x9')](_0xb587('0xd9'),require(_0xb587('0xda')));_0x1d8574[_0xb587('0x9')](_0xb587('0xdb'),require(_0xb587('0xdc')));_0x1d8574[_0xb587('0x9')](_0xb587('0xdd'),require(_0xb587('0xde')));_0x1d8574[_0xb587('0x9')](_0xb587('0xdf'),require('./api/voicePrefix'));_0x1d8574[_0xb587('0x9')](_0xb587('0xe0'),require(_0xb587('0xe1')));_0x1d8574['use'](_0xb587('0xe2'),require(_0xb587('0xe3')));_0x1d8574[_0xb587('0x9')](_0xb587('0xe4'),require(_0xb587('0xe5')));_0x1d8574[_0xb587('0x9')](_0xb587('0xe6'),require(_0xb587('0xe7')));_0x1d8574[_0xb587('0x9')](_0xb587('0xe8'),require(_0xb587('0xe9')));_0x1d8574[_0xb587('0x9')]('/api/whatsapp/applications',require(_0xb587('0xea')));_0x1d8574[_0xb587('0x9')](_0xb587('0xeb'),require('./api/whatsappInteraction'));_0x1d8574[_0xb587('0x9')](_0xb587('0xec'),require(_0xb587('0xed')));_0x1d8574['use']('/api/whatsapp/reports/queue',require(_0xb587('0xee')));_0x1d8574[_0xb587('0x9')](_0xb587('0xef'),require(_0xb587('0xf0')));_0x1d8574[_0xb587('0x9')]('/api/whatsapp/queues',require(_0xb587('0xf1')));_0x1d8574[_0xb587('0x9')](_0xb587('0xf2'),require(_0xb587('0xf3')));_0x1d8574['use'](_0xb587('0xf4'),require(_0xb587('0xf5')));_0x1d8574['use'](_0xb587('0xf6'),require(_0xb587('0xf7')));_0x1d8574[_0xb587('0x9')](_0xb587('0xf8'),require('./api/authLocal'));_0x1d8574['use'](_0xb587('0xf9'),require(_0xb587('0xfa')));_0x1d8574['use'](_0xb587('0xfb'),require('./api/authActiveDirectory'));_0x1d8574[_0xb587('0x9')](_0xb587('0xfc'),require(_0xb587('0xfd')));_0x1d8574[_0xb587('0x9')]('/api/rpc',require('./api/rpc'));_0x1d8574[_0xb587('0x9')]('/api/version',require(_0xb587('0xfe')));_0x1d8574[_0xb587('0x9')](_0xb587('0xff'),require(_0xb587('0x100')));_0x1d8574[_0xb587('0x9')]('/api/pm2',require(_0xb587('0x101')));_0x1d8574[_0xb587('0x9')]('/api/webbar',require(_0xb587('0x102')));_0x1d8574['use']('/api/logs',clientSideLogs);_0x1d8574[_0xb587('0x9')](_0xb587('0x103'),express['static'](path[_0xb587('0x104')](config[_0xb587('0x105')],'/apidoc')));_0x1d8574[_0xb587('0x9')](_0xb587('0x106'),express['static'](path[_0xb587('0x104')](config[_0xb587('0x105')],_0xb587('0x106'))));_0x1d8574[_0xb587('0x9')](_0xb587('0x107'),express[_0xb587('0x108')](path[_0xb587('0x104')](config[_0xb587('0x105')],_0xb587('0x107'))));_0x1d8574['use'](_0xb587('0x109'),express['static'](path[_0xb587('0x104')](config['root'],_0xb587('0x10a'),_0xb587('0x10b'))));_0x1d8574[_0xb587('0x9')]('/plugins',express[_0xb587('0x108')](path[_0xb587('0x104')](config[_0xb587('0x105')],_0xb587('0x10c'))));_0x1d8574[_0xb587('0x10d')](_0xb587('0x10e'))[_0xb587('0x10f')](errors[0x194]);_0x1d8574[_0xb587('0x10d')]('/*')[_0xb587('0x10f')](function(_0x535bb7,_0x3266a3){_0x3266a3[_0xb587('0x110')](path[_0xb587('0x111')](_0x1d8574[_0xb587('0x10f')](_0xb587('0x112'))+_0xb587('0x113')));});return _0x1d8574;});}; \ No newline at end of file +var _0x447e=['/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/mail/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.2.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./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/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField'];(function(_0x25ba6a,_0x1688d5){var _0x46b157=function(_0x272970){while(--_0x272970){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x46b157(++_0x1688d5);}(_0x447e,0x82));var _0xe447=function(_0xbb6d4c,_0x43b8d8){_0xbb6d4c=_0xbb6d4c-0x0;var _0x150279=_0x447e[_0xbb6d4c];return _0x150279;};'use strict';var path=require(_0xe447('0x0'));var express=require('express');var errors=require(_0xe447('0x1'));var config=require(_0xe447('0x2'));var setupLoggers=require(_0xe447('0x3'))[_0xe447('0x4')];var clientSideLogs=require(_0xe447('0x5'));exports['default']=function(_0x3a414f){return setupLoggers(_0x3a414f)[_0xe447('0x6')](function(){_0x3a414f[_0xe447('0x7')]('/api/users',require(_0xe447('0x8')));_0x3a414f[_0xe447('0x7')](_0xe447('0x9'),require(_0xe447('0xa')));_0x3a414f[_0xe447('0x7')](_0xe447('0xb'),require('./api/voiceContext'));_0x3a414f[_0xe447('0x7')](_0xe447('0xc'),require(_0xe447('0xd')));_0x3a414f[_0xe447('0x7')](_0xe447('0xe'),require(_0xe447('0xf')));_0x3a414f['use']('/api/voice/queues',require(_0xe447('0x10')));_0x3a414f[_0xe447('0x7')](_0xe447('0x11'),require(_0xe447('0x12')));_0x3a414f[_0xe447('0x7')](_0xe447('0x13'),require('./api/screenRecording'));_0x3a414f['use'](_0xe447('0x14'),require(_0xe447('0x15')));_0x3a414f[_0xe447('0x7')](_0xe447('0x16'),require(_0xe447('0x17')));_0x3a414f['use']('/api/voice/calls/reports',require(_0xe447('0x18')));_0x3a414f[_0xe447('0x7')](_0xe447('0x19'),require(_0xe447('0x1a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x1b'),require(_0xe447('0x1c')));_0x3a414f[_0xe447('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x3a414f[_0xe447('0x7')](_0xe447('0x1d'),require(_0xe447('0x1e')));_0x3a414f['use'](_0xe447('0x1f'),require('./api/trunk'));_0x3a414f['use']('/api/voice/transfers/reports',require(_0xe447('0x20')));_0x3a414f[_0xe447('0x7')](_0xe447('0x21'),require(_0xe447('0x22')));_0x3a414f[_0xe447('0x7')](_0xe447('0x23'),require(_0xe447('0x24')));_0x3a414f[_0xe447('0x7')](_0xe447('0x25'),require(_0xe447('0x26')));_0x3a414f[_0xe447('0x7')](_0xe447('0x27'),require(_0xe447('0x28')));_0x3a414f['use'](_0xe447('0x29'),require(_0xe447('0x2a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x2b'),require(_0xe447('0x2c')));_0x3a414f[_0xe447('0x7')](_0xe447('0x2d'),require('./api/mailApplication'));_0x3a414f[_0xe447('0x7')]('/api/mail/reports/queue',require(_0xe447('0x2e')));_0x3a414f[_0xe447('0x7')](_0xe447('0x2f'),require('./api/dashboard'));_0x3a414f[_0xe447('0x7')]('/api/dashboards/items',require(_0xe447('0x30')));_0x3a414f[_0xe447('0x7')](_0xe447('0x31'),require(_0xe447('0x32')));_0x3a414f[_0xe447('0x7')](_0xe447('0x33'),require(_0xe447('0x34')));_0x3a414f[_0xe447('0x7')](_0xe447('0x35'),require(_0xe447('0x36')));_0x3a414f[_0xe447('0x7')](_0xe447('0x37'),require('./api/faxMessage'));_0x3a414f[_0xe447('0x7')]('/api/fax/queues',require(_0xe447('0x38')));_0x3a414f[_0xe447('0x7')](_0xe447('0x39'),require('./api/faxQueueReport'));_0x3a414f['use'](_0xe447('0x3a'),require(_0xe447('0x3b')));_0x3a414f[_0xe447('0x7')](_0xe447('0x3c'),require(_0xe447('0x3d')));_0x3a414f[_0xe447('0x7')]('/api/sms/interactions',require(_0xe447('0x3e')));_0x3a414f[_0xe447('0x7')](_0xe447('0x3f'),require(_0xe447('0x40')));_0x3a414f[_0xe447('0x7')](_0xe447('0x41'),require('./api/smsQueue'));_0x3a414f['use'](_0xe447('0x42'),require(_0xe447('0x43')));_0x3a414f['use'](_0xe447('0x44'),require(_0xe447('0x45')));_0x3a414f[_0xe447('0x7')]('/api/openchannel/interactions',require(_0xe447('0x46')));_0x3a414f[_0xe447('0x7')](_0xe447('0x47'),require(_0xe447('0x48')));_0x3a414f['use'](_0xe447('0x49'),require(_0xe447('0x4a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x4b'),require('./api/chatWebsite'));_0x3a414f['use'](_0xe447('0x4c'),require(_0xe447('0x4d')));_0x3a414f['use'](_0xe447('0x4e'),require(_0xe447('0x4f')));_0x3a414f[_0xe447('0x7')](_0xe447('0x50'),require(_0xe447('0x51')));_0x3a414f[_0xe447('0x7')]('/api/chat/messages',require('./api/chatMessage'));_0x3a414f[_0xe447('0x7')](_0xe447('0x52'),require('./api/chatOfflineMessage'));_0x3a414f[_0xe447('0x7')]('/api/chat/queues',require(_0xe447('0x53')));_0x3a414f[_0xe447('0x7')](_0xe447('0x54'),require(_0xe447('0x55')));_0x3a414f[_0xe447('0x7')](_0xe447('0x56'),require(_0xe447('0x57')));_0x3a414f[_0xe447('0x7')](_0xe447('0x58'),require('./api/cmCompany'));_0x3a414f[_0xe447('0x7')](_0xe447('0x59'),require(_0xe447('0x5a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x5b'),require(_0xe447('0x5c')));_0x3a414f['use']('/api/cm/hopper_black',require(_0xe447('0x5d')));_0x3a414f[_0xe447('0x7')](_0xe447('0x5e'),require(_0xe447('0x5f')));_0x3a414f[_0xe447('0x7')](_0xe447('0x60'),require('./api/cmHopperHistory'));_0x3a414f['use']('/api/cm/custom_fields',require(_0xe447('0x61')));_0x3a414f[_0xe447('0x7')](_0xe447('0x62'),require(_0xe447('0x63')));_0x3a414f[_0xe447('0x7')](_0xe447('0x64'),require(_0xe447('0x65')));_0x3a414f[_0xe447('0x7')]('/api/canned_answers',require(_0xe447('0x66')));_0x3a414f['use'](_0xe447('0x67'),require(_0xe447('0x68')));_0x3a414f[_0xe447('0x7')](_0xe447('0x69'),require(_0xe447('0x6a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x6b'),require(_0xe447('0x6c')));_0x3a414f['use'](_0xe447('0x6d'),require(_0xe447('0x6e')));_0x3a414f[_0xe447('0x7')](_0xe447('0x6f'),require(_0xe447('0x70')));_0x3a414f[_0xe447('0x7')](_0xe447('0x71'),require('./api/voiceQueuesLog'));_0x3a414f[_0xe447('0x7')](_0xe447('0x72'),require(_0xe447('0x73')));_0x3a414f[_0xe447('0x7')](_0xe447('0x74'),require(_0xe447('0x75')));_0x3a414f[_0xe447('0x7')]('/api/tags',require(_0xe447('0x76')));_0x3a414f[_0xe447('0x7')](_0xe447('0x77'),require(_0xe447('0x78')));_0x3a414f[_0xe447('0x7')](_0xe447('0x79'),require(_0xe447('0x7a')));_0x3a414f[_0xe447('0x7')](_0xe447('0x7b'),require('./api/cmHopperAdditionalPhone'));_0x3a414f[_0xe447('0x7')](_0xe447('0x7c'),require(_0xe447('0x7d')));_0x3a414f[_0xe447('0x7')]('/api/triggers',require(_0xe447('0x7e')));_0x3a414f[_0xe447('0x7')]('/api/variables',require(_0xe447('0x7f')));_0x3a414f[_0xe447('0x7')](_0xe447('0x80'),require(_0xe447('0x81')));_0x3a414f[_0xe447('0x7')](_0xe447('0x82'),require(_0xe447('0x83')));_0x3a414f['use']('/api/analytics/custom_reports',require(_0xe447('0x84')));_0x3a414f[_0xe447('0x7')](_0xe447('0x85'),require('./api/analyticDefaultReport'));_0x3a414f[_0xe447('0x7')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x3a414f[_0xe447('0x7')](_0xe447('0x86'),require('./api/analyticMetric'));_0x3a414f[_0xe447('0x7')](_0xe447('0x87'),require(_0xe447('0x88')));_0x3a414f['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x3a414f[_0xe447('0x7')](_0xe447('0x89'),require(_0xe447('0x8a')));_0x3a414f[_0xe447('0x7')]('/api/integrations/salesforce/configurations',require(_0xe447('0x8b')));_0x3a414f[_0xe447('0x7')](_0xe447('0x8c'),require(_0xe447('0x8d')));_0x3a414f[_0xe447('0x7')](_0xe447('0x8e'),require(_0xe447('0x8f')));_0x3a414f[_0xe447('0x7')](_0xe447('0x90'),require(_0xe447('0x91')));_0x3a414f[_0xe447('0x7')](_0xe447('0x92'),require('./api/intSugarcrmField'));_0x3a414f['use'](_0xe447('0x93'),require('./api/intDeskAccount'));_0x3a414f[_0xe447('0x7')](_0xe447('0x94'),require(_0xe447('0x95')));_0x3a414f[_0xe447('0x7')](_0xe447('0x96'),require(_0xe447('0x97')));_0x3a414f[_0xe447('0x7')](_0xe447('0x98'),require(_0xe447('0x99')));_0x3a414f[_0xe447('0x7')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x3a414f[_0xe447('0x7')](_0xe447('0x9a'),require(_0xe447('0x9b')));_0x3a414f[_0xe447('0x7')](_0xe447('0x9c'),require(_0xe447('0x9d')));_0x3a414f[_0xe447('0x7')](_0xe447('0x9e'),require(_0xe447('0x9f')));_0x3a414f[_0xe447('0x7')](_0xe447('0xa0'),require(_0xe447('0xa1')));_0x3a414f[_0xe447('0x7')](_0xe447('0xa2'),require('./api/intFreshdeskAccount'));_0x3a414f[_0xe447('0x7')](_0xe447('0xa3'),require('./api/intFreshdeskConfiguration'));_0x3a414f[_0xe447('0x7')](_0xe447('0xa4'),require(_0xe447('0xa5')));_0x3a414f['use']('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x3a414f[_0xe447('0x7')](_0xe447('0xa6'),require(_0xe447('0xa7')));_0x3a414f[_0xe447('0x7')]('/api/integrations/vtiger/fields',require(_0xe447('0xa8')));_0x3a414f['use'](_0xe447('0xa9'),require(_0xe447('0xaa')));_0x3a414f[_0xe447('0x7')](_0xe447('0xab'),require(_0xe447('0xac')));_0x3a414f['use'](_0xe447('0xad'),require(_0xe447('0xae')));_0x3a414f['use']('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x3a414f[_0xe447('0x7')]('/api/integrations/dynamics365/configurations',require(_0xe447('0xaf')));_0x3a414f['use'](_0xe447('0xb0'),require(_0xe447('0xb1')));_0x3a414f['use'](_0xe447('0xb2'),require(_0xe447('0xb3')));_0x3a414f[_0xe447('0x7')](_0xe447('0xb4'),require('./api/intFreshsalesConfiguration'));_0x3a414f['use']('/api/integrations/freshsales/fields',require(_0xe447('0xb5')));_0x3a414f[_0xe447('0x7')](_0xe447('0xb6'),require(_0xe447('0xb7')));_0x3a414f[_0xe447('0x7')](_0xe447('0xb8'),require('./api/chatQueueReport'));_0x3a414f[_0xe447('0x7')](_0xe447('0xb9'),require(_0xe447('0xba')));_0x3a414f[_0xe447('0x7')](_0xe447('0xbb'),require(_0xe447('0xbc')));_0x3a414f[_0xe447('0x7')](_0xe447('0xbd'),require(_0xe447('0xbe')));_0x3a414f[_0xe447('0x7')](_0xe447('0xbf'),require(_0xe447('0xc0')));_0x3a414f[_0xe447('0x7')](_0xe447('0xc1'),require(_0xe447('0xc2')));_0x3a414f['use'](_0xe447('0xc3'),require(_0xe447('0xc4')));_0x3a414f[_0xe447('0x7')](_0xe447('0xc5'),require(_0xe447('0xc6')));_0x3a414f[_0xe447('0x7')]('/api/jscripty/projects',require(_0xe447('0xc7')));_0x3a414f[_0xe447('0x7')](_0xe447('0xc8'),require(_0xe447('0xc9')));_0x3a414f[_0xe447('0x7')](_0xe447('0xca'),require(_0xe447('0xcb')));_0x3a414f[_0xe447('0x7')](_0xe447('0xcc'),require(_0xe447('0xcd')));_0x3a414f[_0xe447('0x7')]('/api/square/recordings',require(_0xe447('0xce')));_0x3a414f[_0xe447('0x7')](_0xe447('0xcf'),require(_0xe447('0xd0')));_0x3a414f['use']('/api/teams',require(_0xe447('0xd1')));_0x3a414f[_0xe447('0x7')]('/api/license',require(_0xe447('0xd2')));_0x3a414f[_0xe447('0x7')](_0xe447('0xd3'),require(_0xe447('0xd4')));_0x3a414f['use'](_0xe447('0xd5'),require(_0xe447('0xd6')));_0x3a414f[_0xe447('0x7')](_0xe447('0xd7'),require(_0xe447('0xd8')));_0x3a414f[_0xe447('0x7')]('/api/plugins',require('./api/plugin'));_0x3a414f['use'](_0xe447('0xd9'),require('./api/mailTransferReport'));_0x3a414f[_0xe447('0x7')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x3a414f[_0xe447('0x7')](_0xe447('0xda'),require(_0xe447('0xdb')));_0x3a414f[_0xe447('0x7')](_0xe447('0xdc'),require(_0xe447('0xdd')));_0x3a414f[_0xe447('0x7')](_0xe447('0xde'),require(_0xe447('0xdf')));_0x3a414f[_0xe447('0x7')](_0xe447('0xe0'),require(_0xe447('0xe1')));_0x3a414f[_0xe447('0x7')](_0xe447('0xe2'),require(_0xe447('0xe3')));_0x3a414f['use'](_0xe447('0xe4'),require(_0xe447('0xe5')));_0x3a414f['use']('/api/userProfile/sections',require(_0xe447('0xe6')));_0x3a414f['use'](_0xe447('0xe7'),require(_0xe447('0xe8')));_0x3a414f[_0xe447('0x7')](_0xe447('0xe9'),require('./api/userNotification'));_0x3a414f['use']('/api/whatsapp/accounts',require(_0xe447('0xea')));_0x3a414f[_0xe447('0x7')](_0xe447('0xeb'),require(_0xe447('0xec')));_0x3a414f['use'](_0xe447('0xed'),require(_0xe447('0xee')));_0x3a414f[_0xe447('0x7')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x3a414f[_0xe447('0x7')]('/api/whatsapp/reports/queue',require(_0xe447('0xef')));_0x3a414f['use']('/api/whatsapp/reports/transfer',require(_0xe447('0xf0')));_0x3a414f['use'](_0xe447('0xf1'),require(_0xe447('0xf2')));_0x3a414f[_0xe447('0x7')](_0xe447('0xf3'),require(_0xe447('0xf4')));_0x3a414f['use'](_0xe447('0xf5'),require(_0xe447('0xf6')));_0x3a414f['use'](_0xe447('0xf7'),require(_0xe447('0xf8')));_0x3a414f['use'](_0xe447('0xf9'),require(_0xe447('0xfa')));_0x3a414f[_0xe447('0x7')](_0xe447('0xfb'),require(_0xe447('0xfc')));_0x3a414f['use'](_0xe447('0xfd'),require(_0xe447('0xfe')));_0x3a414f[_0xe447('0x7')](_0xe447('0xff'),require(_0xe447('0x100')));_0x3a414f[_0xe447('0x7')](_0xe447('0x101'),require(_0xe447('0x102')));_0x3a414f[_0xe447('0x7')](_0xe447('0x103'),require(_0xe447('0x104')));_0x3a414f[_0xe447('0x7')](_0xe447('0x105'),require(_0xe447('0x106')));_0x3a414f[_0xe447('0x7')](_0xe447('0x107'),require(_0xe447('0x108')));_0x3a414f[_0xe447('0x7')]('/api/webbar',require('./api/webbar'));_0x3a414f['use']('/api/logs',clientSideLogs);_0x3a414f[_0xe447('0x7')](_0xe447('0x109'),express[_0xe447('0x10a')](path[_0xe447('0x10b')](config[_0xe447('0x10c')],_0xe447('0x109'))));_0x3a414f[_0xe447('0x7')]('/www',express['static'](path[_0xe447('0x10b')](config['root'],_0xe447('0x10d'))));_0x3a414f[_0xe447('0x7')]('/demo',express['static'](path[_0xe447('0x10b')](config['root'],_0xe447('0x10e'))));_0x3a414f[_0xe447('0x7')](_0xe447('0x10f'),express[_0xe447('0x10a')](path['join'](config[_0xe447('0x10c')],_0xe447('0x110'),_0xe447('0x111'))));_0x3a414f[_0xe447('0x7')](_0xe447('0x112'),express[_0xe447('0x10a')](path[_0xe447('0x10b')](config['root'],_0xe447('0x113'))));_0x3a414f[_0xe447('0x114')](_0xe447('0x115'))[_0xe447('0x116')](errors[0x194]);_0x3a414f[_0xe447('0x114')]('/*')[_0xe447('0x116')](function(_0x1922e3,_0x3a85ff){_0x3a85ff[_0xe447('0x117')](path[_0xe447('0x118')](_0x3a414f[_0xe447('0x116')]('appPath')+_0xe447('0x119')));});return _0x3a414f;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 65ff38c..3f58f70 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe57d=['../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','../config/environment','listen','merge'];(function(_0x51c846,_0x8d8df9){var _0x409189=function(_0xec89d5){while(--_0xec89d5){_0x51c846['push'](_0x51c846['shift']());}};_0x409189(++_0x8d8df9);}(_0xe57d,0xd7));var _0xde57=function(_0x75cb60,_0x5d0574){_0x75cb60=_0x75cb60-0x0;var _0x50c4e9=_0xe57d[_0x75cb60];return _0x50c4e9;};'use strict';var jayson=require(_0xde57('0x0'));var _=require('lodash');var config=require(_0xde57('0x1'));exports[_0xde57('0x2')]=function(){return new Promise(function(_0x5a3a93,_0x51076c){var _0x2243bf={};_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x4')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x5')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x6')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x7')));_0x2243bf=_['merge'](_0x2243bf,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x8')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/memberReport/memberReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x9')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0xa')));_0x2243bf=_['merge'](_0x2243bf,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2243bf=_['merge'](_0x2243bf,require('../api/mailServerIn/mailServerIn.rpc'));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0xb')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0xc')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/mailInteraction/mailInteraction.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0xd')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0xe')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0xf')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x10')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x11')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x12')));_0x2243bf=_['merge'](_0x2243bf,require('../api/faxQueue/faxQueue.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x13')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x14')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x15')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x16')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x17')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x18')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x19')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x1a')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x1b')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/chatInteraction/chatInteraction.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/chatMessage/chatMessage.rpc'));_0x2243bf=_['merge'](_0x2243bf,require('../api/chatQueue/chatQueue.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x1c')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x1d')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x1e')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x1f')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x20')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x21')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x22')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x23')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x24')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x25')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x26')));_0x2243bf=_['merge'](_0x2243bf,require('../api/trigger/trigger.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x27')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x28')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x29')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x2a')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2243bf=_['merge'](_0x2243bf,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x2b')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x2c')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x2d')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x2e')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x2f')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x30')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x31')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x32')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x33')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x34')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x35')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x36')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x37')));_0x2243bf=_['merge'](_0x2243bf,require(_0xde57('0x38')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x39')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x3a')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require('../api/plugin/plugin.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x3b')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x3c')));_0x2243bf=_['merge'](_0x2243bf,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x3d')));_0x2243bf=_[_0xde57('0x3')](_0x2243bf,require(_0xde57('0x3e')));var _0x4f10c1=jayson[_0xde57('0x3f')](_0x2243bf)[_0xde57('0x40')]();var _0x2157ab=config[_0xde57('0x41')][_0xde57('0x42')]||config['port']+0x1;var _0x3a76a1=config[_0xde57('0x41')]['ip']||_0xde57('0x43');_0x4f10c1['on'](_0xde57('0x44'),function(_0x422c71){return _0x51076c(_0x422c71);});_0x4f10c1[_0xde57('0x2')](_0x2157ab,_0x3a76a1,function(){console[_0xde57('0x45')](_0xde57('0x46'),_0x3a76a1,_0x2157ab);require(_0xde57('0x47'))[_0xde57('0x48')]();return _0x5a3a93('RPC\x20listening\x20on\x20'+_0x3a76a1+':'+_0x2157ab);});});}; \ No newline at end of file +var _0xa74d=['../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/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.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/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc'];(function(_0x5bd0c6,_0x4ce03e){var _0x4f2225=function(_0x3a8555){while(--_0x3a8555){_0x5bd0c6['push'](_0x5bd0c6['shift']());}};_0x4f2225(++_0x4ce03e);}(_0xa74d,0xcf));var _0xda74=function(_0x15e5f3,_0x109668){_0x15e5f3=_0x15e5f3-0x0;var _0x1871b6=_0xa74d[_0x15e5f3];return _0x1871b6;};'use strict';var jayson=require(_0xda74('0x0'));var _=require(_0xda74('0x1'));var config=require(_0xda74('0x2'));exports['listen']=function(){return new Promise(function(_0x11c0c8,_0x3ab684){var _0x56101a={};_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x3')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x5')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x6')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x7')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x8')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x9')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0xa')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0xb')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0xc')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0xd')));_0x56101a=_['merge'](_0x56101a,require('../api/mailServerIn/mailServerIn.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0xe')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/mailQueue/mailQueue.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0xf')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x10')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/mailApplication/mailApplication.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x11')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x12')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x13')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x14')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x15')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x16')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x17')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x18')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x19')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x1a')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x1b')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x1c')));_0x56101a=_['merge'](_0x56101a,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x1d')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x1e')));_0x56101a=_['merge'](_0x56101a,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x1f')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x20')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x21')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/cmContact/cmContact.rpc'));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x22')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x23')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x24')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x25')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x26')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x27')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x28')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x29')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x2a')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/trigger/trigger.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/variable/variable.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x2b')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x2c')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x2d')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x2e')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x2f')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x30')));_0x56101a=_['merge'](_0x56101a,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x31')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x32')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x33')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x34')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x35')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x36')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x37')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x38')));_0x56101a=_['merge'](_0x56101a,require('../api/squareRecording/squareRecording.rpc'));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x39')));_0x56101a=_['merge'](_0x56101a,require('../api/campaign/campaign.rpc'));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x3a')));_0x56101a=_['merge'](_0x56101a,require(_0xda74('0x3b')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x3c')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x3d')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x3e')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x3f')));_0x56101a=_[_0xda74('0x4')](_0x56101a,require(_0xda74('0x40')));var _0x4684e7=jayson[_0xda74('0x41')](_0x56101a)[_0xda74('0x42')]();var _0x4fe0b8=config['rpc'][_0xda74('0x43')]||config[_0xda74('0x43')]+0x1;var _0x128e11=config[_0xda74('0x44')]['ip']||_0xda74('0x45');_0x4684e7['on']('error',function(_0x475675){return _0x3ab684(_0x475675);});_0x4684e7[_0xda74('0x46')](_0x4fe0b8,_0x128e11,function(){console['log'](_0xda74('0x47'),_0x128e11,_0x4fe0b8);require(_0xda74('0x48'))[_0xda74('0x49')]();return _0x11c0c8(_0xda74('0x4a')+_0x128e11+':'+_0x4fe0b8);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c7895a0..1e7af85 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 _0x30e9=['split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','write','destroy','prototype','sendRequest','command','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','noop','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','indexOf','substr','startsWith'];(function(_0x3f7049,_0x2ebde3){var _0x17bc5c=function(_0x3c9617){while(--_0x3c9617){_0x3f7049['push'](_0x3f7049['shift']());}};_0x17bc5c(++_0x2ebde3);}(_0x30e9,0x121));var _0x930e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x30e9[_0x68ee8b];return _0x5148f7;};'use strict';var util=require(_0x930e('0x0'));var _=require(_0x930e('0x1'));var EventEmitter=require(_0x930e('0x2'))['EventEmitter'];var AGIReply=require(_0x930e('0x3'));var AGIError=require(_0x930e('0x4'));function AGIChannel(_0x3eebcf){var _0x446ffb=this,_0x5e3535=new AGIReply(),_0x3f09fe=![],_0x19fa8c={};EventEmitter[_0x930e('0x5')](_0x446ffb);_0x3eebcf[_0x930e('0x6')](_0x930e('0x7'));_0x3eebcf[_0x930e('0x8')](0x8*0x3c*0x3c*0x3e8);_0x5e3535['setEncoding'](_0x930e('0x7'));_0x5e3535['on']('headers',function(_0x234cbf){for(var _0x2376ca in _0x234cbf){_0x446ffb[_0x2376ca]=_0x234cbf[_0x2376ca];}_0x446ffb[_0x930e('0x9')](_0x930e('0xa'));});_0x5e3535['on'](_0x930e('0xb'),function(_0x3cadf8){if(_0x3cadf8[_0x930e('0xc')]()==_0x930e('0xd')){_0x446ffb[_0x930e('0x9')]('hangup');return;}if(_0x3cadf8['substring'](0x0,0xb)==_0x930e('0xe')){_0x3f09fe=!![];}if(_0x3f09fe){_0x19fa8c['rx']+=_0x3cadf8+'\x0a';if(_0x3cadf8[_0x930e('0xf')](_0x930e('0x10'))!=-0x1){_0x3f09fe=![];}}else{_0x19fa8c['rx']=_0x3cadf8;}if(_0x3f09fe){return;}if(typeof _0x19fa8c['cb']==_0x930e('0x11')){var _0x2869c5=_0x19fa8c['rx'][_0x930e('0x12')](0x0,0x3),_0x28a5cf=null,_0xce5dfa=null;_0x2869c5=parseInt(_0x2869c5);if(isNaN(_0x2869c5)){_0x19fa8c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2869c5!=0xc8){_0x19fa8c['cb'](null,{'code':_0x2869c5,'result':-0x1,'extra':'KO'});return;}_0x28a5cf=_0x19fa8c['rx'][_0x930e('0x12')](0x4)[_0x930e('0x13')]('result=','');if(_0x28a5cf[_0x930e('0x14')]('\x20')!=-0x1){_0x28a5cf=_0x28a5cf[_0x930e('0x15')](0x0,_0x28a5cf[_0x930e('0x14')]('\x20'));}if(_[_0x930e('0x16')](_0x28a5cf,'-1')){_0x28a5cf=parseInt(_0x28a5cf);}_0xce5dfa=_0x19fa8c['rx'][_0x930e('0x17')]('\x20');if(_0xce5dfa[_0x930e('0x18')]==0x3){_0xce5dfa=_0xce5dfa[0x2]['substring'](0x1,_0xce5dfa[0x2][_0x930e('0x18')]-0x1);}else if(_0xce5dfa[_0x930e('0x18')]>0x3){var _0x4da365=/\((.+)\)/;var _0xac1d0e=_0x19fa8c['rx'][_0x930e('0x19')](_0x4da365);if(_0xac1d0e){_0xce5dfa=_0xac1d0e[0x1];}else{_0xce5dfa=null;}}else{_0xce5dfa=null;}_0x19fa8c['cb'](null,{'code':_0x2869c5,'result':_0x28a5cf,'extra':_0xce5dfa});}});_0x3eebcf['on'](_0x930e('0x1a'),function(_0x4c3571){_0x446ffb[_0x930e('0x9')](_0x930e('0x1a'),new AGIError(_0x930e('0x1b'),_0x4c3571[_0x930e('0x1c')]));});_0x3eebcf['on'](_0x930e('0x1d'),function(){_0x446ffb[_0x930e('0x9')](_0x930e('0x1d'),new AGIError(_0x930e('0x1e')));});_0x3eebcf['on'](_0x930e('0x1f'),function(){_0x446ffb[_0x930e('0x9')](_0x930e('0x1f'),new AGIError(_0x930e('0x20')));_0x3eebcf['destroy']();});_0x3eebcf['pipe'](_0x5e3535);this['command']=function(_0x1cd54a,_0x47789e){var _0x1cd54a=_0x1cd54a||'',_0x47789e=typeof _0x47789e=='function'?_0x47789e:new Function();_0x19fa8c={'tx':_0x1cd54a,'rx':'','cb':_0x47789e};_0x3eebcf[_0x930e('0x21')](_0x1cd54a+'\x0a');},this[_0x930e('0x1d')]=function(){_0x3eebcf[_0x930e('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x930e('0x23')][_0x930e('0x24')]=function(_0x176190){return this[_0x930e('0x25')][_0x930e('0x26')](this,_0x176190);};AGIChannel[_0x930e('0x23')]['answer']=function(){return this[_0x930e('0x24')](_0x930e('0x27'));};AGIChannel[_0x930e('0x23')][_0x930e('0x28')]=function(_0x4782ab,_0x497371,_0x300769){_0x4782ab=_0x4782ab===undefined?_0x930e('0x29'):_0x4782ab;_0x497371=_0x497371===undefined?'5':_0x497371;_0x300769=_0x300769===undefined?'1':_0x300769;return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x2b'),_0x4782ab,_0x497371*0x3e8,_0x300769));};AGIChannel[_0x930e('0x23')]['noop']=function(_0x12a0bf){_0x12a0bf=_0x12a0bf||_0x930e('0x2c');return this['sendRequest'](util[_0x930e('0x2a')](_0x930e('0x2d'),_0x12a0bf));};AGIChannel[_0x930e('0x23')][_0x930e('0x2e')]=function(_0x59a213,_0x5d0d92){if(_[_0x930e('0x2f')](_0x5d0d92)){return this['sendRequest'](util[_0x930e('0x2a')]('EXEC\x20%s\x20%s',_0x59a213,_0x5d0d92[_0x930e('0x30')](',')));}return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x31'),_0x59a213,_0x5d0d92));};AGIChannel[_0x930e('0x23')][_0x930e('0x32')]=function(_0x5c04e8){return this[_0x930e('0x24')](util['format'](_0x930e('0x33'),_0x5c04e8));};AGIChannel[_0x930e('0x23')][_0x930e('0x34')]=function(_0x5b9b47){return this[_0x930e('0x24')](util['format'](_0x930e('0x35'),_0x5b9b47));};AGIChannel[_0x930e('0x23')][_0x930e('0x36')]=function(_0x519d05){return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x37'),_0x519d05));};AGIChannel[_0x930e('0x23')]['hangup']=function(){return this[_0x930e('0x24')](_0x930e('0x38'));};AGIChannel[_0x930e('0x23')][_0x930e('0x39')]=function(_0x446a71,_0x5f2beb){var _0xe9d239=_['isBoolean'](_0x5f2beb)||_[_0x930e('0x3a')](_0x5f2beb)?_0x5f2beb[_0x930e('0x3b')]():_0x5f2beb;return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x3c'),_0x446a71,_0xe9d239?_0xe9d239[_0x930e('0x3b')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x930e('0x23')][_0x930e('0x3d')]=function(_0x30d599,_0x10669e){return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x3e'),_0x30d599,_0x10669e));};AGIChannel['prototype'][_0x930e('0x3f')]=function(_0x3b1250,_0x5c1e0f){return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x40'),_0x3b1250,_0x5c1e0f));};AGIChannel[_0x930e('0x23')][_0x930e('0x41')]=function(_0x5b24a4,_0x3656b0){return this['sendRequest'](util[_0x930e('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5b24a4,_0x3656b0));};AGIChannel[_0x930e('0x23')]['continueAt']=function(_0x11cc51,_0x134444,_0x2fa9c0){_0x134444=_0x134444||this['extension'];_0x2fa9c0=_0x2fa9c0||0x1;this['setContext'](_0x11cc51);this[_0x930e('0x34')](_0x134444);this['setPriority'](_0x2fa9c0);return this[_0x930e('0x42')](util[_0x930e('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x11cc51,_0x134444,_0x2fa9c0));};AGIChannel['prototype']['getVariable']=function(_0x4cdabe){return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x43'),_0x4cdabe));};AGIChannel[_0x930e('0x23')][_0x930e('0x44')]=function(_0x1100bf,_0x4427e4,_0x32965c,_0x3dfc78,_0x2585bd,_0x208734){_0x4427e4=_0x4427e4||_0x930e('0x45');_0x32965c=_0x32965c||'';_0x3dfc78=_0x3dfc78===undefined?-0x1:_0x3dfc78==='-1'?-0x1:_0x3dfc78*0x3e8;_0x2585bd=_0x2585bd===undefined?'':'s='+_0x2585bd;_0x208734=_0x208734?_0x930e('0x46'):'';return this[_0x930e('0x24')](util[_0x930e('0x2a')](_0x930e('0x47'),_0x1100bf,_0x4427e4,_0x32965c,_0x3dfc78,_0x208734,_0x2585bd));};AGIChannel[_0x930e('0x23')][_0x930e('0x48')]=function(_0x4f8388,_0x289dc8){_0x289dc8=_0x289dc8||'';return this[_0x930e('0x24')](util['format'](_0x930e('0x49'),_0x4f8388,_0x289dc8));};AGIChannel['prototype'][_0x930e('0x4a')]=function(_0x492b88){return this['exec']('AGI',_0x492b88);};AGIChannel[_0x930e('0x23')][_0x930e('0x4b')]=function(_0x3eb56e){return this[_0x930e('0x2e')]('WAIT',_0x3eb56e);};AGIChannel['prototype']['error']=function(_0x39e6e6,_0x28ae50){this[_0x930e('0x42')](util[_0x930e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x39e6e6['id'],_0x39e6e6[_0x930e('0x4c')],_0x28ae50));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x930e('0x4d')]=AGIChannel; \ No newline at end of file +var _0x38e4=['streamFile','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','util','lodash','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','emit','ready','line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sync','answer','sendRequest','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s'];(function(_0x2ccf59,_0x196b84){var _0x3c4cb2=function(_0x22d8d7){while(--_0x22d8d7){_0x2ccf59['push'](_0x2ccf59['shift']());}};_0x3c4cb2(++_0x196b84);}(_0x38e4,0x9e));var _0x438e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x38e4[_0x1035c1];return _0x308d67;};'use strict';var util=require(_0x438e('0x0'));var _=require(_0x438e('0x1'));var EventEmitter=require('events')[_0x438e('0x2')];var AGIReply=require(_0x438e('0x3'));var AGIError=require('./error');function AGIChannel(_0x2842fb){var _0x27e5d9=this,_0x387d68=new AGIReply(),_0x5ec55c=![],_0x2ac738={};EventEmitter[_0x438e('0x4')](_0x27e5d9);_0x2842fb[_0x438e('0x5')](_0x438e('0x6'));_0x2842fb[_0x438e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x387d68[_0x438e('0x5')]('utf8');_0x387d68['on']('headers',function(_0x4fd76e){for(var _0x4d5899 in _0x4fd76e){_0x27e5d9[_0x4d5899]=_0x4fd76e[_0x4d5899];}_0x27e5d9[_0x438e('0x8')](_0x438e('0x9'));});_0x387d68['on'](_0x438e('0xa'),function(_0x1a6691){if(_0x1a6691['toLowerCase']()==_0x438e('0xb')){_0x27e5d9['emit'](_0x438e('0xb'));return;}if(_0x1a6691['substring'](0x0,0xb)==_0x438e('0xc')){_0x5ec55c=!![];}if(_0x5ec55c){_0x2ac738['rx']+=_0x1a6691+'\x0a';if(_0x1a6691[_0x438e('0xd')](_0x438e('0xe'))!=-0x1){_0x5ec55c=![];}}else{_0x2ac738['rx']=_0x1a6691;}if(_0x5ec55c){return;}if(typeof _0x2ac738['cb']==_0x438e('0xf')){var _0x245564=_0x2ac738['rx'][_0x438e('0x10')](0x0,0x3),_0x58bf98=null,_0x170831=null;_0x245564=parseInt(_0x245564);if(isNaN(_0x245564)){_0x2ac738['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x438e('0x11')});return;}if(_0x245564!=0xc8){_0x2ac738['cb'](null,{'code':_0x245564,'result':-0x1,'extra':'KO'});return;}_0x58bf98=_0x2ac738['rx'][_0x438e('0x10')](0x4)['replace']('result=','');if(_0x58bf98['indexOf']('\x20')!=-0x1){_0x58bf98=_0x58bf98[_0x438e('0x12')](0x0,_0x58bf98[_0x438e('0x13')]('\x20'));}if(_[_0x438e('0x14')](_0x58bf98,'-1')){_0x58bf98=parseInt(_0x58bf98);}_0x170831=_0x2ac738['rx'][_0x438e('0x15')]('\x20');if(_0x170831[_0x438e('0x16')]==0x3){_0x170831=_0x170831[0x2][_0x438e('0x10')](0x1,_0x170831[0x2][_0x438e('0x16')]-0x1);}else if(_0x170831['length']>0x3){var _0x91a308=/\((.+)\)/;var _0x347505=_0x2ac738['rx'][_0x438e('0x17')](_0x91a308);if(_0x347505){_0x170831=_0x347505[0x1];}else{_0x170831=null;}}else{_0x170831=null;}_0x2ac738['cb'](null,{'code':_0x245564,'result':_0x58bf98,'extra':_0x170831});}});_0x2842fb['on'](_0x438e('0x18'),function(_0x117250){_0x27e5d9[_0x438e('0x8')]('error',new AGIError(_0x438e('0x19'),_0x117250['code']));});_0x2842fb['on']('close',function(){_0x27e5d9[_0x438e('0x8')](_0x438e('0x1a'),new AGIError(_0x438e('0x1b')));});_0x2842fb['on'](_0x438e('0x1c'),function(){_0x27e5d9['emit'](_0x438e('0x1c'),new AGIError(_0x438e('0x1d')));_0x2842fb[_0x438e('0x1e')]();});_0x2842fb[_0x438e('0x1f')](_0x387d68);this[_0x438e('0x20')]=function(_0x489367,_0x5bf513){var _0x489367=_0x489367||'',_0x5bf513=typeof _0x5bf513==_0x438e('0xf')?_0x5bf513:new Function();_0x2ac738={'tx':_0x489367,'rx':'','cb':_0x5bf513};_0x2842fb[_0x438e('0x21')](_0x489367+'\x0a');},this[_0x438e('0x1a')]=function(){_0x2842fb[_0x438e('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x438e('0x22')]['sendRequest']=function(_0x243c16){return this[_0x438e('0x20')][_0x438e('0x23')](this,_0x243c16);};AGIChannel[_0x438e('0x22')][_0x438e('0x24')]=function(){return this[_0x438e('0x25')]('ANSWER');};AGIChannel[_0x438e('0x22')][_0x438e('0x26')]=function(_0x52f85c,_0xcc14d,_0x39edd0){_0x52f85c=_0x52f85c===undefined?_0x438e('0x27'):_0x52f85c;_0xcc14d=_0xcc14d===undefined?'5':_0xcc14d;_0x39edd0=_0x39edd0===undefined?'1':_0x39edd0;return this['sendRequest'](util[_0x438e('0x28')](_0x438e('0x29'),_0x52f85c,_0xcc14d*0x3e8,_0x39edd0));};AGIChannel[_0x438e('0x22')][_0x438e('0x2a')]=function(_0x5213ce){_0x5213ce=_0x5213ce||_0x438e('0x2b');return this[_0x438e('0x25')](util['format']('VERBOSE\x20\x22%s\x22',_0x5213ce));};AGIChannel[_0x438e('0x22')][_0x438e('0x2c')]=function(_0x3986cb,_0x460fea){if(_['isArray'](_0x460fea)){return this[_0x438e('0x25')](util[_0x438e('0x28')]('EXEC\x20%s\x20%s',_0x3986cb,_0x460fea[_0x438e('0x2d')](',')));}return this[_0x438e('0x25')](util[_0x438e('0x28')]('EXEC\x20%s\x20%s',_0x3986cb,_0x460fea));};AGIChannel[_0x438e('0x22')][_0x438e('0x2e')]=function(_0xa69def){return this[_0x438e('0x25')](util[_0x438e('0x28')]('SET\x20CONTEXT\x20%s',_0xa69def));};AGIChannel[_0x438e('0x22')]['setExtension']=function(_0x259651){return this['sendRequest'](util[_0x438e('0x28')](_0x438e('0x2f'),_0x259651));};AGIChannel[_0x438e('0x22')][_0x438e('0x30')]=function(_0x32bbbb){return this[_0x438e('0x25')](util[_0x438e('0x28')](_0x438e('0x31'),_0x32bbbb));};AGIChannel[_0x438e('0x22')]['hangup']=function(){return this[_0x438e('0x25')](_0x438e('0x32'));};AGIChannel[_0x438e('0x22')][_0x438e('0x33')]=function(_0x41be40,_0x8fd1f1){var _0x21bf0d=_[_0x438e('0x34')](_0x8fd1f1)||_[_0x438e('0x35')](_0x8fd1f1)?_0x8fd1f1[_0x438e('0x36')]():_0x8fd1f1;return this[_0x438e('0x25')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x41be40,_0x21bf0d?_0x21bf0d['toString']()[_0x438e('0x37')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x438e('0x22')]['sayNumber']=function(_0x42f0be,_0x14be35){return this[_0x438e('0x25')](util['format'](_0x438e('0x38'),_0x42f0be,_0x14be35));};AGIChannel[_0x438e('0x22')][_0x438e('0x39')]=function(_0xc44b2e,_0xb47d90){return this[_0x438e('0x25')](util[_0x438e('0x28')](_0x438e('0x3a'),_0xc44b2e,_0xb47d90));};AGIChannel[_0x438e('0x22')]['sayPhonetic']=function(_0x38064e,_0xcfc7b){return this[_0x438e('0x25')](util[_0x438e('0x28')](_0x438e('0x3b'),_0x38064e,_0xcfc7b));};AGIChannel[_0x438e('0x22')][_0x438e('0x3c')]=function(_0x376b72,_0x3459b9,_0x3b0b2a){_0x3459b9=_0x3459b9||this['extension'];_0x3b0b2a=_0x3b0b2a||0x1;this[_0x438e('0x2e')](_0x376b72);this[_0x438e('0x3d')](_0x3459b9);this['setPriority'](_0x3b0b2a);return this[_0x438e('0x2a')](util[_0x438e('0x28')]('GOTO\x20%s\x20%s\x20%s',_0x376b72,_0x3459b9,_0x3b0b2a));};AGIChannel[_0x438e('0x22')][_0x438e('0x3e')]=function(_0x1d78fd){return this[_0x438e('0x25')](util['format'](_0x438e('0x3f'),_0x1d78fd));};AGIChannel[_0x438e('0x22')][_0x438e('0x40')]=function(_0x3c6036,_0x3b59e7,_0x14fd38,_0x5b78a8,_0x5d8af8,_0x273ac2){_0x3b59e7=_0x3b59e7||_0x438e('0x41');_0x14fd38=_0x14fd38||'';_0x5b78a8=_0x5b78a8===undefined?-0x1:_0x5b78a8==='-1'?-0x1:_0x5b78a8*0x3e8;_0x5d8af8=_0x5d8af8===undefined?'':'s='+_0x5d8af8;_0x273ac2=_0x273ac2?'BEEP':'';return this['sendRequest'](util[_0x438e('0x28')](_0x438e('0x42'),_0x3c6036,_0x3b59e7,_0x14fd38,_0x5b78a8,_0x273ac2,_0x5d8af8));};AGIChannel['prototype'][_0x438e('0x43')]=function(_0x32eeea,_0x3f24b1){_0x3f24b1=_0x3f24b1||'';return this[_0x438e('0x25')](util[_0x438e('0x28')](_0x438e('0x44'),_0x32eeea,_0x3f24b1));};AGIChannel[_0x438e('0x22')][_0x438e('0x45')]=function(_0x4b5b48){return this[_0x438e('0x2c')](_0x438e('0x46'),_0x4b5b48);};AGIChannel['prototype'][_0x438e('0x47')]=function(_0x2e9d32){return this[_0x438e('0x2c')](_0x438e('0x48'),_0x2e9d32);};AGIChannel[_0x438e('0x22')][_0x438e('0x18')]=function(_0x22ce08,_0x305429){this[_0x438e('0x2a')](util['format'](_0x438e('0x49'),_0x22ce08['id'],_0x22ce08[_0x438e('0x4a')],_0x305429));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 6d5303e..349801e 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 _0x7bba=['push','format','apply','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3b8f1,_0x2a958b){var _0x4f97aa=function(_0x1d5e01){while(--_0x1d5e01){_0x3b8f1['push'](_0x3b8f1['shift']());}};_0x4f97aa(++_0x2a958b);}(_0x7bba,0x1aa));var _0xa7bb=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x7bba[_0x165c96];return _0x5c2420;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xa7bb('0x0'),'E_AGI_ARGUMENT_PORT':_0xa7bb('0x1'),'E_AGI_SERVER_ERROR':_0xa7bb('0x2'),'E_AGI_SERVER_CLOSE':_0xa7bb('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa7bb('0x4'),'E_AGI_SOCKET_CLOSE':_0xa7bb('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xa7bb('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa7bb('0x7'),'E_AGI_IVR_ENTRY':_0xa7bb('0x8')};function AGIError(_0x18e564){var _0x18e564=_0x18e564||null,_0x56960a=_0x56960a||[],_0x229f01=0x1,_0x4759f3='';if(!error[_0x18e564]){_0x18e564='E_AGI_UNDEFINED';}_0x56960a[_0xa7bb('0x9')](error[_0x18e564]);while(arguments[_0x229f01]){_0x56960a[_0xa7bb('0x9')](arguments[_0x229f01]);_0x229f01++;}_0x4759f3=util[_0xa7bb('0xa')][_0xa7bb('0xb')](util,_0x56960a);this[_0xa7bb('0xc')]=_0x4759f3;this[_0xa7bb('0xd')]=_0x18e564;}module[_0xa7bb('0xe')]=AGIError; \ No newline at end of file +var _0x88e0=['Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','name','exports','util','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.','Socket\x20timeout.'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x88e0,0x19c));var _0x088e=function(_0xe8db66,_0x23bb14){_0xe8db66=_0xe8db66-0x0;var _0x125f14=_0x88e0[_0xe8db66];return _0x125f14;};'use strict';var util=require(_0x088e('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x088e('0x1'),'E_AGI_SERVER_ERROR':_0x088e('0x2'),'E_AGI_SERVER_CLOSE':_0x088e('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x088e('0x4'),'E_AGI_SOCKET_ERROR':_0x088e('0x5'),'E_AGI_SOCKET_CLOSE':_0x088e('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x088e('0x7'),'E_AGI_COMMAND_EMPTY':_0x088e('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x088e('0x9')};function AGIError(_0x21fe32){var _0x21fe32=_0x21fe32||null,_0x4fd2b0=_0x4fd2b0||[],_0x4f776d=0x1,_0x219028='';if(!error[_0x21fe32]){_0x21fe32='E_AGI_UNDEFINED';}_0x4fd2b0[_0x088e('0xa')](error[_0x21fe32]);while(arguments[_0x4f776d]){_0x4fd2b0[_0x088e('0xa')](arguments[_0x4f776d]);_0x4f776d++;}_0x219028=util['format'][_0x088e('0xb')](util,_0x4fd2b0);this[_0x088e('0xc')]=_0x219028;this[_0x088e('0xd')]=_0x21fe32;}module[_0x088e('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 59e8530..a9bd599 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 _0x5556=['redis','defaults','localhost','emit','E_AGI_SERVER_ERROR','message','agi','parse','exports','lodash','./error'];(function(_0x2fd1a3,_0x374f64){var _0x2d5aa5=function(_0x5cad67){while(--_0x5cad67){_0x2fd1a3['push'](_0x2fd1a3['shift']());}};_0x2d5aa5(++_0x374f64);}(_0x5556,0x111));var _0x6555=function(_0x34840d,_0x5b6da9){_0x34840d=_0x34840d-0x0;var _0x4c58b4=_0x5556[_0x34840d];return _0x4c58b4;};'use strict';var _=require(_0x6555('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0x6555('0x1'));var config=require('../../config/environment');config[_0x6555('0x2')]=_[_0x6555('0x3')](config[_0x6555('0x2')],{'host':_0x6555('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6555('0x2')]);sub['subscribe']('agi',function(_0x4b302a){if(_0x4b302a)return eventEmitter[_0x6555('0x5')]('error',new AGIError(_0x6555('0x6'),_0x4b302a));});sub['on'](_0x6555('0x7'),function(_0x5b71c9,_0x29138f){if(_0x5b71c9!==_0x6555('0x8'))return;try{var _0x753d39=JSON[_0x6555('0x9')](_0x29138f);eventEmitter[_0x6555('0x5')]('projectUpdate',_0x753d39);}catch(_0x542014){eventEmitter['emit']('error',new AGIError(_0x6555('0x6'),_0x542014));}});module[_0x6555('0xa')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xae9a=['lodash','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports'];(function(_0x360b81,_0x183c51){var _0x460f3f=function(_0x4d7ee3){while(--_0x4d7ee3){_0x360b81['push'](_0x360b81['shift']());}};_0x460f3f(++_0x183c51);}(_0xae9a,0x143));var _0xaae9=function(_0x420aab,_0x103a49){_0x420aab=_0x420aab-0x0;var _0x234c29=_0xae9a[_0x420aab];return _0x234c29;};'use strict';var _=require(_0xaae9('0x0'));var EventEmitter=require('events')[_0xaae9('0x1')];var Redis=require(_0xaae9('0x2'));var AGIError=require(_0xaae9('0x3'));var config=require(_0xaae9('0x4'));config[_0xaae9('0x5')]=_[_0xaae9('0x6')](config[_0xaae9('0x5')],{'host':_0xaae9('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xaae9('0x5')]);sub[_0xaae9('0x8')](_0xaae9('0x9'),function(_0x43309e){if(_0x43309e)return eventEmitter[_0xaae9('0xa')](_0xaae9('0xb'),new AGIError(_0xaae9('0xc'),_0x43309e));});sub['on'](_0xaae9('0xd'),function(_0x57bc60,_0x297fec){if(_0x57bc60!=='agi')return;try{var _0x53c24f=JSON[_0xaae9('0xe')](_0x297fec);eventEmitter[_0xaae9('0xa')](_0xaae9('0xf'),_0x53c24f);}catch(_0xb40941){eventEmitter[_0xaae9('0xa')](_0xaae9('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0xb40941));}});module[_0xaae9('0x10')]={'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 f7a74ce..bbd4140 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 _0x3af3=['menu','getdigits','getsecretdigits','edges','numberOfEdges','addVertex','vertices','prototype','addEdge','size','getVertex','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','condition\x20not\x20found','exports','lodash'];(function(_0x5b9e88,_0x33cc8f){var _0x252375=function(_0x308834){while(--_0x308834){_0x5b9e88['push'](_0x5b9e88['shift']());}};_0x252375(++_0x33cc8f);}(_0x3af3,0xbc));var _0x33af=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0x3af3[_0x3181cc];return _0x547a4a;};'use strict';var _=require(_0x33af('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x33af('0x1'),_0x33af('0x2'),_0x33af('0x3')];var Graph=function(){this['vertices']={};this[_0x33af('0x4')]={};this[_0x33af('0x5')]=0x0;};Graph['prototype'][_0x33af('0x6')]=function(_0x575bde){this[_0x33af('0x7')][_0x575bde['id']]=_0x575bde;this[_0x33af('0x4')][_0x575bde['id']]=[];};Graph[_0x33af('0x8')][_0x33af('0x9')]=function(_0x3e0b63,_0x12a920,_0x181b6c){this[_0x33af('0x4')][_0x3e0b63]['push']({'target':_0x12a920,'condition':_0x181b6c});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x33af('0xa')]=function(){return _['size'](this[_0x33af('0x7')]);};Graph['prototype']['relations']=function(){return this[_0x33af('0x5')];};Graph[_0x33af('0x8')][_0x33af('0xb')]=function(_0x476383){return this[_0x33af('0x7')][_0x476383];};Graph[_0x33af('0x8')]['traverseBFS']=function(_0x894e4d,_0xb6c825){if(!this['vertices'][_0x894e4d]){return logger['info'](_0x33af('0xc'));}var _0x25ea4f=_0xb6c825(this[_0x33af('0x7')][_0x894e4d]);if(!_0x25ea4f){return logger[_0x33af('0xd')](_0x33af('0xe'));}if(this[_0x33af('0x4')][_0x894e4d][_0x33af('0xf')]===0x0){return logger['info'](_0x33af('0x10'));}for(var _0x25c0b4=0x0,_0x17f3c6=[],_0x545acd=![];_0x25c0b4\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','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','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','./server','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','nextTick','error','findIndex','deleted','splice','push','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port'];(function(_0xcad0c8,_0x304a8a){var _0x4e6e9b=function(_0x186f4f){while(--_0x186f4f){_0xcad0c8['push'](_0xcad0c8['shift']());}};_0x4e6e9b(++_0x304a8a);}(_0xdfaa,0x1bc));var _0xadfa=function(_0x5bfe4b,_0x49075f){_0x5bfe4b=_0x5bfe4b-0x0;var _0x21c571=_0xdfaa[_0x5bfe4b];return _0x21c571;};'use strict';var _=require(_0xadfa('0x0'));var syncho=require(_0xadfa('0x1'));var util=require(_0xadfa('0x2'));var config=require(_0xadfa('0x3'));var logger=require(_0xadfa('0x4'))(_0xadfa('0x5'));var utilLicense=require(_0xadfa('0x6'));var rpc=require('./rpc');var Project=require(_0xadfa('0x7'));var AGIEmitter=require(_0xadfa('0x8'))[_0xadfa('0x9')];var projects=[];config[_0xadfa('0x5')]=_[_0xadfa('0xa')](config[_0xadfa('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x2a3ec1){process[_0xadfa('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2a3ec1);agiHandler(_0x2a3ec1);}catch(_0x42ebf2){logger[_0xadfa('0xc')](_0x42ebf2['stack']);}});});}function projectUpdateHandler(_0x2d2e86){try{var _0x4eb862=_[_0xadfa('0xd')](projects,['id',_0x2d2e86['id']]);if(_0x4eb862>-0x1){if(_0x2d2e86[_0xadfa('0xe')]===!![]){projects[_0xadfa('0xf')](_0x4eb862,0x1);}else{projects[_0x4eb862]=_0x2d2e86;}}else{projects[_0xadfa('0x10')](_0x2d2e86);}}catch(_0xdf3376){logger[_0xadfa('0xc')](_0xdf3376[_0xadfa('0x11')]);}}function listeningHandler(){console['log'](_0xadfa('0x12'),config[_0xadfa('0x5')][_0xadfa('0x13')]);logger[_0xadfa('0x14')](util['format'](_0xadfa('0x15'),config[_0xadfa('0x5')]['ip'],config['agi'][_0xadfa('0x13')]));}function errorHandler(_0x590088){if(_0x590088&&_0x590088[_0xadfa('0x16')]&&_0x590088[_0xadfa('0x17')]){logger['error'](util[_0xadfa('0x18')](_0xadfa('0x19'),_0x590088[_0xadfa('0x16')],_0x590088[_0xadfa('0x17')]));}else{logger[_0xadfa('0xc')](util['format']('[ERROR]\x20%s',_0x590088[_0xadfa('0x11')]));}}function closeHandler(){logger[_0xadfa('0x14')](util[_0xadfa('0x18')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xadfa('0x1a')],this[_0xadfa('0x1b')],this[_0xadfa('0x1c')],this[_0xadfa('0x1d')],this[_0xadfa('0x1e')]));try{createSquareReport(this);}catch(_0x2e998b){logger['error'](_0x2e998b[_0xadfa('0x11')]);}}function timeoutHandler(){logger[_0xadfa('0x14')](util[_0xadfa('0x18')](_0xadfa('0x1f'),this[_0xadfa('0x1a')],this[_0xadfa('0x1b')],this[_0xadfa('0x1c')],this[_0xadfa('0x1d')],this[_0xadfa('0x1e')]));}function hangupHandler(){logger['info'](util['format'](_0xadfa('0x20'),this[_0xadfa('0x1a')],this['calleridname'],this[_0xadfa('0x1c')],this[_0xadfa('0x1d')],this[_0xadfa('0x1e')]));this[_0xadfa('0x21')]=!![];}function createSquareReport(_0x3d2ee8,_0x47e294){rpc['createSquareReport'](_0x3d2ee8)[_0xadfa('0x22')](function(_0x3ef3da){if(_0x47e294){_0x47e294(null,_0x3ef3da);}})[_0xadfa('0x23')](function(_0x102a2a){if(_0x47e294){_0x47e294(null,_0x102a2a);}});}function setChannelVariables(_0x245bcb){for(var _0x1cee3b in _0x245bcb){if(_0x245bcb[_0xadfa('0x24')](_0x1cee3b)){if(_0x1cee3b[_0xadfa('0x25')](_0xadfa('0x26'))===0x0){_0x245bcb[_0x1cee3b['substring'](0x4)]=_0x245bcb[_0x1cee3b];delete _0x245bcb[_0x1cee3b];}}}}function agiHandler(_0x2fbf5c){logger[_0xadfa('0x27')](_0xadfa('0x28'),JSON[_0xadfa('0x29')](_0x2fbf5c,null,0x2));logger['info'](util[_0xadfa('0x18')](_0xadfa('0x2a'),_0x2fbf5c[_0xadfa('0x1a')],_0x2fbf5c[_0xadfa('0x1b')],_0x2fbf5c[_0xadfa('0x1c')],_0x2fbf5c[_0xadfa('0x1d')],_0x2fbf5c[_0xadfa('0x1e')]));_0x2fbf5c['on'](_0xadfa('0xc'),errorHandler);_0x2fbf5c['on'](_0xadfa('0x2b'),closeHandler);_0x2fbf5c['on'](_0xadfa('0x2c'),timeoutHandler);_0x2fbf5c[_0xadfa('0x21')]=![];_0x2fbf5c['on'](_0xadfa('0x2d'),hangupHandler);var _0x104546=_[_0xadfa('0x2e')](projects,[_0xadfa('0x16'),_0x2fbf5c[_0xadfa('0x1a')]]);if(!_0x104546)return Project[_0xadfa('0x2f')](_0x2fbf5c);if(!_0x104546['production'])return Project[_0xadfa('0x30')](_0x2fbf5c);return Project[_0xadfa('0x31')](_0x104546,_0x2fbf5c);}function main(){var _0x2f08a1;return utilLicense[_0xadfa('0x32')]()[_0xadfa('0x22')](function(_0x4a0e7f){if(!_0x4a0e7f)return;if(_0x4a0e7f[_0xadfa('0x33')]){if(_0x4a0e7f[_0xadfa('0x34')]&&_0x4a0e7f[_0xadfa('0x34')]>0x0){logger['info'](util['format'](_0xadfa('0x35'),_0x4a0e7f['callysquare']));_0x2f08a1=_0x4a0e7f[_0xadfa('0x34')];}else{logger[_0xadfa('0x14')](_0xadfa('0x36'));}}else{logger['info'](_0xadfa('0x37'));_0x2f08a1=-0x1;}})[_0xadfa('0x22')](function(){return Project['getAll']();})[_0xadfa('0x22')](function(_0x90527e){projects=_0x90527e;return;})[_0xadfa('0x23')](function(_0x6866f1){logger['error']('[LICENSE]',_0x6866f1[_0xadfa('0x11')]);})[_0xadfa('0x38')](function(){var _0x509739=require(_0xadfa('0x39'))(config[_0xadfa('0x5')][_0xadfa('0x13')],config['agi']['ip'],_0x2f08a1);_0x509739['on'](_0xadfa('0xc'),errorHandler);_0x509739['on']('listening',listeningHandler);_0x509739['on']('connection',connectionHandler);_0x509739['on'](_0xadfa('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0x6523=['handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','connection','close','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','agi','projectUpdate','nextTick','error','findIndex','splice','push','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','debug','stringify','timeout','hangup','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6523,0x6e));var _0x3652=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6523[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var syncho=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var config=require(_0x3652('0x2'));var logger=require(_0x3652('0x3'))('agi');var utilLicense=require(_0x3652('0x4'));var rpc=require(_0x3652('0x5'));var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config['agi']=_['defaults'](config[_0x3652('0x6')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x3652('0x7'),projectUpdateHandler);function connectionHandler(_0x13fbdc){process[_0x3652('0x8')](function(){syncho(function(){try{setChannelVariables(_0x13fbdc);agiHandler(_0x13fbdc);}catch(_0x13cefd){logger[_0x3652('0x9')](_0x13cefd['stack']);}});});}function projectUpdateHandler(_0x3d547c){try{var _0x489cd5=_[_0x3652('0xa')](projects,['id',_0x3d547c['id']]);if(_0x489cd5>-0x1){if(_0x3d547c['deleted']===!![]){projects[_0x3652('0xb')](_0x489cd5,0x1);}else{projects[_0x489cd5]=_0x3d547c;}}else{projects[_0x3652('0xc')](_0x3d547c);}}catch(_0x193bf2){logger[_0x3652('0x9')](_0x193bf2[_0x3652('0xd')]);}}function listeningHandler(){console[_0x3652('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x3652('0xf')]);logger[_0x3652('0x10')](util[_0x3652('0x11')](_0x3652('0x12'),config[_0x3652('0x6')]['ip'],config[_0x3652('0x6')][_0x3652('0xf')]));}function errorHandler(_0x2d0ecc){if(_0x2d0ecc&&_0x2d0ecc['name']&&_0x2d0ecc[_0x3652('0x13')]){logger['error'](util['format'](_0x3652('0x14'),_0x2d0ecc['name'],_0x2d0ecc[_0x3652('0x13')]));}else{logger[_0x3652('0x9')](util['format'](_0x3652('0x15'),_0x2d0ecc['stack']));}}function closeHandler(){logger['info'](util[_0x3652('0x11')](_0x3652('0x16'),this['arg_1'],this[_0x3652('0x17')],this[_0x3652('0x18')],this[_0x3652('0x19')],this[_0x3652('0x1a')]));try{createSquareReport(this);}catch(_0x51f566){logger[_0x3652('0x9')](_0x51f566[_0x3652('0xd')]);}}function timeoutHandler(){logger[_0x3652('0x10')](util[_0x3652('0x11')](_0x3652('0x1b'),this[_0x3652('0x1c')],this[_0x3652('0x17')],this['callerid'],this[_0x3652('0x19')],this[_0x3652('0x1a')]));}function hangupHandler(){logger[_0x3652('0x10')](util['format'](_0x3652('0x1d'),this[_0x3652('0x1c')],this[_0x3652('0x17')],this[_0x3652('0x18')],this[_0x3652('0x19')],this[_0x3652('0x1a')]));this[_0x3652('0x1e')]=!![];}function createSquareReport(_0x5be419,_0x2800fc){rpc[_0x3652('0x1f')](_0x5be419)[_0x3652('0x20')](function(_0x35c3cf){if(_0x2800fc){_0x2800fc(null,_0x35c3cf);}})['catch'](function(_0x2f75ad){if(_0x2800fc){_0x2800fc(null,_0x2f75ad);}});}function setChannelVariables(_0xaa02b){for(var _0xf7e6f7 in _0xaa02b){if(_0xaa02b[_0x3652('0x21')](_0xf7e6f7)){if(_0xf7e6f7[_0x3652('0x22')]('agi_')===0x0){_0xaa02b[_0xf7e6f7['substring'](0x4)]=_0xaa02b[_0xf7e6f7];delete _0xaa02b[_0xf7e6f7];}}}}function agiHandler(_0x5acbe0){logger[_0x3652('0x23')]('variables',JSON[_0x3652('0x24')](_0x5acbe0,null,0x2));logger[_0x3652('0x10')](util[_0x3652('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5acbe0[_0x3652('0x1c')],_0x5acbe0[_0x3652('0x17')],_0x5acbe0[_0x3652('0x18')],_0x5acbe0[_0x3652('0x19')],_0x5acbe0['uniqueid']));_0x5acbe0['on'](_0x3652('0x9'),errorHandler);_0x5acbe0['on']('close',closeHandler);_0x5acbe0['on'](_0x3652('0x25'),timeoutHandler);_0x5acbe0[_0x3652('0x1e')]=![];_0x5acbe0['on'](_0x3652('0x26'),hangupHandler);var _0x102285=_['find'](projects,[_0x3652('0x27'),_0x5acbe0[_0x3652('0x1c')]]);if(!_0x102285)return Project['handleNotFound'](_0x5acbe0);if(!_0x102285['production'])return Project[_0x3652('0x28')](_0x5acbe0);return Project[_0x3652('0x29')](_0x102285,_0x5acbe0);}function main(){var _0x4a4309;return utilLicense['getLicense']()[_0x3652('0x20')](function(_0x3182f3){if(!_0x3182f3)return;if(_0x3182f3[_0x3652('0x2a')]){if(_0x3182f3[_0x3652('0x2b')]&&_0x3182f3[_0x3652('0x2b')]>0x0){logger[_0x3652('0x10')](util[_0x3652('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3182f3[_0x3652('0x2b')]));_0x4a4309=_0x3182f3[_0x3652('0x2b')];}else{logger['info'](_0x3652('0x2c'));}}else{logger[_0x3652('0x10')](_0x3652('0x2d'));_0x4a4309=-0x1;}})[_0x3652('0x20')](function(){return Project[_0x3652('0x2e')]();})[_0x3652('0x20')](function(_0x533d5e){projects=_0x533d5e;return;})['catch'](function(_0x4977b8){logger[_0x3652('0x9')]('[LICENSE]',_0x4977b8[_0x3652('0xd')]);})[_0x3652('0x2f')](function(){var _0x487e98=require('./server')(config[_0x3652('0x6')][_0x3652('0xf')],config['agi']['ip'],_0x4a4309);_0x487e98['on']('error',errorHandler);_0x487e98['on']('listening',listeningHandler);_0x487e98['on'](_0x3652('0x30'),connectionHandler);_0x487e98['on'](_0x3652('0x31'),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 095b906..41dd08a 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 _0xee9a=['sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','message','result'];(function(_0x4ee5d3,_0x432589){var _0x3a0562=function(_0x442e4a){while(--_0x442e4a){_0x4ee5d3['push'](_0x4ee5d3['shift']());}};_0x3a0562(++_0x432589);}(_0xee9a,0xac));var _0xaee9=function(_0x296b30,_0xd3a9ec){_0x296b30=_0x296b30-0x0;var _0x49283b=_0xee9a[_0x296b30];return _0x49283b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xaee9('0x0'));var client=jayson[_0xaee9('0x1')][_0xaee9('0x2')]({'port':0x232b});function request(_0x32fef7,_0x319633){return new BPromise(function(_0xeff3fa,_0x41cea0){return client[_0xaee9('0x3')](_0x32fef7,_0x319633)[_0xaee9('0x4')](function(_0x155d97){if(_0x155d97['error']){return _0x41cea0(_0x155d97[_0xaee9('0x5')][_0xaee9('0x6')]);}else{return _0xeff3fa(_0x155d97[_0xaee9('0x7')]);}})['catch'](function(_0x3a94e1){return _0x41cea0(_0x3a94e1);});});}exports[_0xaee9('0x8')]=function(_0x368eee,_0x3d66f2){return request(_0xaee9('0x9'),{'account':_0x368eee,'message':_0x3d66f2});}; \ No newline at end of file +var _0x95e9=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','request','then'];(function(_0x39cf32,_0x4e475c){var _0x682e61=function(_0x2503bd){while(--_0x2503bd){_0x39cf32['push'](_0x39cf32['shift']());}};_0x682e61(++_0x4e475c);}(_0x95e9,0x1f0));var _0x995e=function(_0x395be8,_0x285479){_0x395be8=_0x395be8-0x0;var _0x5ceb20=_0x95e9[_0x395be8];return _0x5ceb20;};'use strict';var BPromise=require(_0x995e('0x0'));var jayson=require(_0x995e('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x14e653,_0x154793){return new BPromise(function(_0x4eb0b9,_0x34f0e){return client[_0x995e('0x2')](_0x14e653,_0x154793)[_0x995e('0x3')](function(_0x286392){if(_0x286392[_0x995e('0x4')]){return _0x34f0e(_0x286392['error'][_0x995e('0x5')]);}else{return _0x4eb0b9(_0x286392[_0x995e('0x6')]);}})[_0x995e('0x7')](function(_0x39d3a0){return _0x34f0e(_0x39d3a0);});});}exports[_0x995e('0x8')]=function(_0x283edc,_0x3e374a){return request(_0x995e('0x9'),{'account':_0x283edc,'message':_0x3e374a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index ad0c4ef..2dcf83e 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 _0x311f=['stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[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','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','length','source','target','value','toJson','mxGraphModel','root','inspect','production','start','debug'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x311f,0x9f));var _0xf311=function(_0x561471,_0xabf9e8){_0x561471=_0x561471-0x0;var _0x2e41a7=_0x311f[_0x561471];return _0x2e41a7;};'use strict';var _=require(_0xf311('0x0'));var moment=require(_0xf311('0x1'));var parser=require(_0xf311('0x2'));var util=require(_0xf311('0x3'));var logger=require(_0xf311('0x4'))(_0xf311('0x5'));var rpc=require(_0xf311('0x6'));var mailRpc=require(_0xf311('0x7'));var Graph=require('./graph');var Vertices=require(_0xf311('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xf311('0x9')]()[_0xf311('0xa')](function(_0x10c202){logger['error'](_0xf311('0xb'),_0x10c202[_0xf311('0xc')]);return[];});}function addVertex(_0x191d2a,_0xd12b43,_0x1ae657){_0xd12b43[_0xf311('0xd')]=_0x1ae657;if(_0xd12b43[_0xf311('0xe')](_0xf311('0xf'))){_0xd12b43[_0xf311('0x10')]=parseInt(_0xd12b43[_0xf311('0xf')],0xa);}_0x191d2a['addVertex'](_[_0xf311('0x11')](_0xd12b43,_0xf311('0x12')));}function initGraph(_0x330583,_0x2096f8){var _0x198f50=new Graph();for(var _0x17e975 in _0x330583){if(_0x330583[_0xf311('0xe')](_0x17e975)){if(_['isArray'](_0x330583[_0x17e975])){for(var _0x4daf22=0x0;_0x4daf22<_0x330583[_0x17e975][_0xf311('0x13')];_0x4daf22+=0x1){addVertex(_0x198f50,_0x330583[_0x17e975][_0x4daf22],_0x17e975);}}else{addVertex(_0x198f50,_0x330583[_0x17e975],_0x17e975);}}}for(var _0x3a1790=0x0;_0x3a1790<_0x2096f8[_0xf311('0x13')];_0x3a1790+=0x1){if(_0x2096f8[_0x3a1790][_0xf311('0x14')]&&_0x2096f8[_0x3a1790][_0xf311('0x15')]){_0x198f50['addEdge'](_0x2096f8[_0x3a1790]['source'],_0x2096f8[_0x3a1790][_0xf311('0x15')],_0x2096f8[_0x3a1790][_0xf311('0x16')]);}}return _0x198f50;}function getRoot(_0x234637){return parser[_0xf311('0x17')](_0x234637,{'object':!![]})[_0xf311('0x18')][_0xf311('0x19')];}function inspect(_0x52d86e){return util[_0xf311('0x1a')](_0x52d86e,{'showHidden':![],'depth':null});}function initialize(_0x492233,_0x30dec7){var _0xcec280=getRoot(_0x492233[_0xf311('0x1b')]);if(!_0xcec280||!_0xcec280[_0xf311('0x1c')])return;var _0xf2180b,_0x3e6bb3,_0x471d1b;logger[_0xf311('0x1d')]('root',JSON[_0xf311('0x1e')](_0xcec280,null,0x2));_0x30dec7[_0xf311('0x1f')]=moment()[_0xf311('0x20')](_0xf311('0x21'));_0xf2180b=initGraph(_['omit'](_0xcec280,'mxCell'),_0xcec280[_0xf311('0x12')]);_0x3e6bb3=new Vertices(_0x30dec7,rpc,mailRpc);logger[_0xf311('0x22')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x30dec7[_0xf311('0x23')],_0x30dec7[_0xf311('0x24')],_0x30dec7[_0xf311('0x25')],_0x30dec7['dnid'],_0x30dec7[_0xf311('0x26')]));_0xf2180b[_0xf311('0x27')](_0xcec280[_0xf311('0x1c')]['id'],function(_0x41049b){try{_0x41049b=_0x3e6bb3[_0xf311('0x28')](_0x41049b);logger[_0xf311('0x1d')](_0xf311('0x29'),JSON[_0xf311('0x1e')](_0x41049b,null,0x2));if(_0x41049b['agicommand']===_0xf311('0x2a')){logger[_0xf311('0x22')](_0xf311('0x2b'));_0x30dec7[_0xf311('0x2c')]=_0x41049b['context']||_0x30dec7[_0xf311('0x2c')];_0x30dec7['extension']=_0x41049b[_0xf311('0x2d')];_0x30dec7[_0xf311('0x2e')]=_0x41049b[_0xf311('0x2e')]?_0x41049b[_0xf311('0x2e')]-0x1:0x1;return null;}else if(_0x41049b&&_0x3e6bb3[_0x41049b[_0xf311('0xd')]]){_0x471d1b=_0x3e6bb3[_0x41049b[_0xf311('0xd')]](_0x41049b);logger[_0xf311('0x22')]('response',JSON[_0xf311('0x1e')](_0x471d1b,null,0x2));if(_0x471d1b&&_0x471d1b[_0xf311('0x2f')]===AGI_CODE_SUCCESS&&_0x471d1b[_0xf311('0x30')]!==AGI_RESULT_ERROR&&!_0x30dec7[_0xf311('0x31')]){logger[_0xf311('0x1d')]('response',inspect(_0x471d1b));return _[_0xf311('0x32')](_0x471d1b[_0xf311('0x30')])?null:_0x471d1b[_0xf311('0x30')][_0xf311('0x33')]();}else{logger[_0xf311('0x34')]('response',inspect(_0x471d1b));return null;}}else{logger[_0xf311('0x34')](_0xf311('0x35'));return null;}}catch(_0x33109f){logger[_0xf311('0x34')](_0x33109f[_0xf311('0xc')]);return null;}});if(_0xcec280[_0xf311('0x36')]){logger[_0xf311('0x22')](util['format'](_0xf311('0x37'),_0x30dec7[_0xf311('0x23')],_0x30dec7[_0xf311('0x24')],_0x30dec7[_0xf311('0x25')],_0x30dec7[_0xf311('0x38')],_0x30dec7[_0xf311('0x26')]));_0xf2180b[_0xf311('0x27')](_0xcec280[_0xf311('0x36')]['id'],function(_0x3ee1bf){try{_0x3ee1bf=_0x3e6bb3[_0xf311('0x28')](_0x3ee1bf);logger[_0xf311('0x1d')](_0xf311('0x29'),JSON[_0xf311('0x1e')](_0x3ee1bf,null,0x2));if(_0x3ee1bf&&_0x3e6bb3[_0x3ee1bf[_0xf311('0xd')]]){_0x471d1b=_0x3e6bb3[_0x3ee1bf[_0xf311('0xd')]](_0x3ee1bf);if(_0x471d1b){logger[_0xf311('0x1d')]('response',inspect(_0x471d1b));return _[_0xf311('0x32')](_0x471d1b['result'])?null:_0x471d1b[_0xf311('0x30')][_0xf311('0x33')]();}else{logger[_0xf311('0x34')]('response',inspect(_0x471d1b));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x4f4abe){logger['error'](_0x4f4abe[_0xf311('0xc')]);return null;}});}logger['info'](util[_0xf311('0x20')](_0xf311('0x39'),_0x30dec7[_0xf311('0x23')],_0x30dec7[_0xf311('0x24')],_0x30dec7[_0xf311('0x25')],_0x30dec7[_0xf311('0x38')],_0x30dec7[_0xf311('0x26')]));logger[_0xf311('0x22')](util[_0xf311('0x20')](_0xf311('0x3a'),_0x30dec7[_0xf311('0x2c')],_0x30dec7[_0xf311('0x2d')],parseInt(_0x30dec7[_0xf311('0x2e')],0xa)+0x1));_0x30dec7[_0xf311('0x3b')](_0x30dec7[_0xf311('0x2c')],_0x30dec7[_0xf311('0x2d')],parseInt(_0x30dec7[_0xf311('0x2e')],0xa)+0x1);_0x30dec7[_0xf311('0x3c')]();}function handleNotFound(_0x326767){logger[_0xf311('0x34')](util[_0xf311('0x20')](_0xf311('0x3d'),_0x326767[_0xf311('0x23')]));_0x326767[_0xf311('0x3b')](_0x326767[_0xf311('0x2c')],_0x326767['extension'],parseInt(_0x326767['priority'],0xa)+0x1);_0x326767['close']();}function handleUnpublished(_0x478e4b){logger[_0xf311('0x34')](util[_0xf311('0x20')]('Project\x20%s\x20not\x20published',_0x478e4b['arg_1']));_0x478e4b[_0xf311('0x3b')](_0x478e4b[_0xf311('0x2c')],_0x478e4b[_0xf311('0x2d')],parseInt(_0x478e4b[_0xf311('0x2e')],0xa)+0x1);_0x478e4b[_0xf311('0x3c')]();}module[_0xf311('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x4fd7=['traverseBFS','clear','vertex','stringify','gotoc','info','context','extension','priority','response','result','evtHangup','isUndefined','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','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','Project\x20%s\x20not\x20published','continueAt','exports','lodash','moment','xml2json','agi','./mailRpc','./graph','catch','error','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','toJson','mxGraphModel','root','start','debug','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid'];(function(_0x3fb6a2,_0x2b15bb){var _0x219a7f=function(_0x5f400d){while(--_0x5f400d){_0x3fb6a2['push'](_0x3fb6a2['shift']());}};_0x219a7f(++_0x2b15bb);}(_0x4fd7,0x1d0));var _0x74fd=function(_0x2c7fe3,_0x37484f){_0x2c7fe3=_0x2c7fe3-0x0;var _0x2bed1a=_0x4fd7[_0x2c7fe3];return _0x2bed1a;};'use strict';var _=require(_0x74fd('0x0'));var moment=require(_0x74fd('0x1'));var parser=require(_0x74fd('0x2'));var util=require('util');var logger=require('../../config/logger')(_0x74fd('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x74fd('0x4'));var Graph=require(_0x74fd('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x74fd('0x6')](function(_0x177b24){logger[_0x74fd('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x177b24['stack']);return[];});}function addVertex(_0x5668b6,_0x15e0f0,_0x1e9ef6){_0x15e0f0[_0x74fd('0x8')]=_0x1e9ef6;if(_0x15e0f0[_0x74fd('0x9')](_0x74fd('0xa'))){_0x15e0f0['maxRetry']=parseInt(_0x15e0f0[_0x74fd('0xa')],0xa);}_0x5668b6[_0x74fd('0xb')](_[_0x74fd('0xc')](_0x15e0f0,_0x74fd('0xd')));}function initGraph(_0x25f8e5,_0x82bf93){var _0x3a48d4=new Graph();for(var _0x194138 in _0x25f8e5){if(_0x25f8e5[_0x74fd('0x9')](_0x194138)){if(_[_0x74fd('0xe')](_0x25f8e5[_0x194138])){for(var _0x5e1e2b=0x0;_0x5e1e2b<_0x25f8e5[_0x194138][_0x74fd('0xf')];_0x5e1e2b+=0x1){addVertex(_0x3a48d4,_0x25f8e5[_0x194138][_0x5e1e2b],_0x194138);}}else{addVertex(_0x3a48d4,_0x25f8e5[_0x194138],_0x194138);}}}for(var _0x4693b1=0x0;_0x4693b1<_0x82bf93[_0x74fd('0xf')];_0x4693b1+=0x1){if(_0x82bf93[_0x4693b1][_0x74fd('0x10')]&&_0x82bf93[_0x4693b1]['target']){_0x3a48d4[_0x74fd('0x11')](_0x82bf93[_0x4693b1][_0x74fd('0x10')],_0x82bf93[_0x4693b1][_0x74fd('0x12')],_0x82bf93[_0x4693b1]['value']);}}return _0x3a48d4;}function getRoot(_0x37f358){return parser[_0x74fd('0x13')](_0x37f358,{'object':!![]})[_0x74fd('0x14')][_0x74fd('0x15')];}function inspect(_0x9c51ee){return util['inspect'](_0x9c51ee,{'showHidden':![],'depth':null});}function initialize(_0x310646,_0x44044c){var _0x5de239=getRoot(_0x310646['production']);if(!_0x5de239||!_0x5de239[_0x74fd('0x16')])return;var _0x776f33,_0x441940,_0x457d22;logger[_0x74fd('0x17')](_0x74fd('0x15'),JSON['stringify'](_0x5de239,null,0x2));_0x44044c['joinAt']=moment()[_0x74fd('0x18')](_0x74fd('0x19'));_0x776f33=initGraph(_[_0x74fd('0xc')](_0x5de239,_0x74fd('0xd')),_0x5de239[_0x74fd('0xd')]);_0x441940=new Vertices(_0x44044c,rpc,mailRpc);logger['info'](util[_0x74fd('0x18')](_0x74fd('0x1a'),_0x44044c[_0x74fd('0x1b')],_0x44044c[_0x74fd('0x1c')],_0x44044c['callerid'],_0x44044c[_0x74fd('0x1d')],_0x44044c[_0x74fd('0x1e')]));_0x776f33[_0x74fd('0x1f')](_0x5de239['start']['id'],function(_0x5c3fdf){try{_0x5c3fdf=_0x441940[_0x74fd('0x20')](_0x5c3fdf);logger[_0x74fd('0x17')](_0x74fd('0x21'),JSON[_0x74fd('0x22')](_0x5c3fdf,null,0x2));if(_0x5c3fdf['agicommand']===_0x74fd('0x23')){logger[_0x74fd('0x24')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x44044c[_0x74fd('0x25')]=_0x5c3fdf['context']||_0x44044c[_0x74fd('0x25')];_0x44044c[_0x74fd('0x26')]=_0x5c3fdf[_0x74fd('0x26')];_0x44044c[_0x74fd('0x27')]=_0x5c3fdf[_0x74fd('0x27')]?_0x5c3fdf[_0x74fd('0x27')]-0x1:0x1;return null;}else if(_0x5c3fdf&&_0x441940[_0x5c3fdf[_0x74fd('0x8')]]){_0x457d22=_0x441940[_0x5c3fdf[_0x74fd('0x8')]](_0x5c3fdf);logger[_0x74fd('0x24')](_0x74fd('0x28'),JSON[_0x74fd('0x22')](_0x457d22,null,0x2));if(_0x457d22&&_0x457d22['code']===AGI_CODE_SUCCESS&&_0x457d22[_0x74fd('0x29')]!==AGI_RESULT_ERROR&&!_0x44044c[_0x74fd('0x2a')]){logger[_0x74fd('0x17')](_0x74fd('0x28'),inspect(_0x457d22));return _[_0x74fd('0x2b')](_0x457d22[_0x74fd('0x29')])?null:_0x457d22[_0x74fd('0x29')]['toString']();}else{logger[_0x74fd('0x7')](_0x74fd('0x28'),inspect(_0x457d22));return null;}}else{logger[_0x74fd('0x7')](_0x74fd('0x2c'));return null;}}catch(_0x7cf3cf){logger[_0x74fd('0x7')](_0x7cf3cf[_0x74fd('0x2d')]);return null;}});if(_0x5de239[_0x74fd('0x2e')]){logger[_0x74fd('0x24')](util[_0x74fd('0x18')](_0x74fd('0x2f'),_0x44044c['arg_1'],_0x44044c['calleridname'],_0x44044c[_0x74fd('0x30')],_0x44044c[_0x74fd('0x1d')],_0x44044c[_0x74fd('0x1e')]));_0x776f33[_0x74fd('0x1f')](_0x5de239[_0x74fd('0x2e')]['id'],function(_0x43b012){try{_0x43b012=_0x441940[_0x74fd('0x20')](_0x43b012);logger[_0x74fd('0x17')]('vertex',JSON['stringify'](_0x43b012,null,0x2));if(_0x43b012&&_0x441940[_0x43b012[_0x74fd('0x8')]]){_0x457d22=_0x441940[_0x43b012[_0x74fd('0x8')]](_0x43b012);if(_0x457d22){logger[_0x74fd('0x17')](_0x74fd('0x28'),inspect(_0x457d22));return _[_0x74fd('0x2b')](_0x457d22['result'])?null:_0x457d22['result'][_0x74fd('0x31')]();}else{logger[_0x74fd('0x7')]('response',inspect(_0x457d22));return null;}}else{logger[_0x74fd('0x7')](_0x74fd('0x2c'));return null;}}catch(_0x1b27f4){logger[_0x74fd('0x7')](_0x1b27f4[_0x74fd('0x2d')]);return null;}});}logger['info'](util['format'](_0x74fd('0x32'),_0x44044c[_0x74fd('0x1b')],_0x44044c[_0x74fd('0x1c')],_0x44044c[_0x74fd('0x30')],_0x44044c[_0x74fd('0x1d')],_0x44044c[_0x74fd('0x1e')]));logger['info'](util[_0x74fd('0x18')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x44044c[_0x74fd('0x25')],_0x44044c[_0x74fd('0x26')],parseInt(_0x44044c[_0x74fd('0x27')],0xa)+0x1));_0x44044c['continueAt'](_0x44044c['context'],_0x44044c[_0x74fd('0x26')],parseInt(_0x44044c[_0x74fd('0x27')],0xa)+0x1);_0x44044c[_0x74fd('0x33')]();}function handleNotFound(_0x45714c){logger[_0x74fd('0x7')](util[_0x74fd('0x18')]('Project\x20%s\x20not\x20found',_0x45714c['arg_1']));_0x45714c['continueAt'](_0x45714c[_0x74fd('0x25')],_0x45714c[_0x74fd('0x26')],parseInt(_0x45714c['priority'],0xa)+0x1);_0x45714c[_0x74fd('0x33')]();}function handleUnpublished(_0x270cc7){logger[_0x74fd('0x7')](util['format'](_0x74fd('0x34'),_0x270cc7['arg_1']));_0x270cc7[_0x74fd('0x35')](_0x270cc7[_0x74fd('0x25')],_0x270cc7[_0x74fd('0x26')],parseInt(_0x270cc7[_0x74fd('0x27')],0xa)+0x1);_0x270cc7[_0x74fd('0x33')]();}module[_0x74fd('0x36')]={'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 062994a..be61e6b 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 _0x765f=['exports','stream','Transform','call','_localBuffer','inherits','prototype','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','split','slice','length','emit','headers','line'];(function(_0x1c78dd,_0x117d6e){var _0x927903=function(_0x464012){while(--_0x464012){_0x1c78dd['push'](_0x1c78dd['shift']());}};_0x927903(++_0x117d6e);}(_0x765f,0x1b1));var _0xf765=function(_0x2cd8c8,_0x40580f){_0x2cd8c8=_0x2cd8c8-0x0;var _0x4e2c19=_0x765f[_0x2cd8c8];return _0x4e2c19;};'use strict';var util=require('util');var Transform=require(_0xf765('0x0'))[_0xf765('0x1')];function AGIReply(_0x56cd4c){Transform[_0xf765('0x2')](this,_0x56cd4c);this[_0xf765('0x3')]='';this['_inBody']=![];}util[_0xf765('0x4')](AGIReply,Transform);AGIReply[_0xf765('0x5')]['_transform']=function(_0x1bc7b0,_0x452e25,_0x3ee82f){var _0x5dc3dc='\x0a',_0x1aead7=['\x0a\x0a',_0xf765('0x6')],_0xf326cc=-0x1,_0x3488be=-0x1,_0x3cfc23='',_0x40f04a=0x0,_0xa7ff7='',_0x474143='';this[_0xf765('0x3')]+=_0x1bc7b0[_0xf765('0x7')]();_0xa7ff7=this[_0xf765('0x3')];if(!this[_0xf765('0x8')]){_0x40f04a=0x0;while(_0x1aead7[_0x40f04a]){while((_0x3488be=_0xa7ff7[_0xf765('0x9')](_0x1aead7[_0x40f04a]))!=-0x1){_0x3cfc23=_0x1aead7[_0x40f04a];_0x474143=_0xa7ff7[_0xf765('0xa')](0x0,_0x3488be);_0xa7ff7=_0xa7ff7[_0xf765('0xa')](_0x3488be+_0x3cfc23['length']);var _0x100adf=_0x474143[_0xf765('0xb')](_0x5dc3dc),_0x17919a=0x0,_0x5a5ffd={},_0x4d0a92='',_0x2cb7e0='',_0x4a6aed=-0x1;while(_0x100adf[_0x17919a]){_0x4a6aed=_0x100adf[_0x17919a]['indexOf'](':');if(_0x4a6aed!=-0x1){_0x4d0a92=_0x100adf[_0x17919a][_0xf765('0xc')](0x0,_0x4a6aed)['trim']();_0x2cb7e0=_0x100adf[_0x17919a][_0xf765('0xc')](_0x4a6aed+0x1)['trim']();if(_0x4d0a92[_0xf765('0xd')]>0x0){_0x5a5ffd[_0x4d0a92]=_0x2cb7e0;}}else{}_0x17919a++;}this[_0xf765('0xe')](_0xf765('0xf'),_0x5a5ffd);this[_0xf765('0x8')]=!![];}_0x40f04a++;}this['_localBuffer']=_0xa7ff7;}else{while((_0xf326cc=_0xa7ff7[_0xf765('0x9')](_0x5dc3dc))!=-0x1){_0x474143=_0xa7ff7[_0xf765('0xa')](0x0,_0xf326cc);this['emit'](_0xf765('0x10'),_0x474143);_0xa7ff7=_0xa7ff7[_0xf765('0xa')](_0xf326cc+_0x5dc3dc[_0xf765('0xd')]);}this['_localBuffer']=_0xa7ff7;}_0x3ee82f();};module[_0xf765('0x11')]=AGIReply; \ No newline at end of file +var _0xe74a=['split','trim','slice','length','emit','headers','line','util','stream','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0xe74a,0x127));var _0xae74=function(_0x2d7a4b,_0xa36b04){_0x2d7a4b=_0x2d7a4b-0x0;var _0x603707=_0xe74a[_0x2d7a4b];return _0x603707;};'use strict';var util=require(_0xae74('0x0'));var Transform=require(_0xae74('0x1'))['Transform'];function AGIReply(_0x33cb4f){Transform[_0xae74('0x2')](this,_0x33cb4f);this[_0xae74('0x3')]='';this[_0xae74('0x4')]=![];}util[_0xae74('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xae74('0x6')]=function(_0x4fda1f,_0x45c735,_0x6195d3){var _0x63d46e='\x0a',_0x1e19e6=['\x0a\x0a',_0xae74('0x7')],_0x2dc15e=-0x1,_0x122b87=-0x1,_0x13cc22='',_0x458bf7=0x0,_0x3806de='',_0x2325ec='';this[_0xae74('0x3')]+=_0x4fda1f[_0xae74('0x8')]();_0x3806de=this[_0xae74('0x3')];if(!this['_inBody']){_0x458bf7=0x0;while(_0x1e19e6[_0x458bf7]){while((_0x122b87=_0x3806de[_0xae74('0x9')](_0x1e19e6[_0x458bf7]))!=-0x1){_0x13cc22=_0x1e19e6[_0x458bf7];_0x2325ec=_0x3806de[_0xae74('0xa')](0x0,_0x122b87);_0x3806de=_0x3806de[_0xae74('0xa')](_0x122b87+_0x13cc22['length']);var _0x3163dc=_0x2325ec[_0xae74('0xb')](_0x63d46e),_0x35b80e=0x0,_0x3c26c8={},_0x2adf20='',_0x4aed89='',_0x38bfbe=-0x1;while(_0x3163dc[_0x35b80e]){_0x38bfbe=_0x3163dc[_0x35b80e][_0xae74('0x9')](':');if(_0x38bfbe!=-0x1){_0x2adf20=_0x3163dc[_0x35b80e]['slice'](0x0,_0x38bfbe)[_0xae74('0xc')]();_0x4aed89=_0x3163dc[_0x35b80e][_0xae74('0xd')](_0x38bfbe+0x1)[_0xae74('0xc')]();if(_0x2adf20[_0xae74('0xe')]>0x0){_0x3c26c8[_0x2adf20]=_0x4aed89;}}else{}_0x35b80e++;}this[_0xae74('0xf')](_0xae74('0x10'),_0x3c26c8);this[_0xae74('0x4')]=!![];}_0x458bf7++;}this[_0xae74('0x3')]=_0x3806de;}else{while((_0x2dc15e=_0x3806de[_0xae74('0x9')](_0x63d46e))!=-0x1){_0x2325ec=_0x3806de['substring'](0x0,_0x2dc15e);this[_0xae74('0xf')](_0xae74('0x11'),_0x2325ec);_0x3806de=_0x3806de['substring'](_0x2dc15e+_0x63d46e[_0xae74('0xe')]);}this[_0xae74('0x3')]=_0x3806de;}_0x6195d3();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8ab56d8..aac71ff 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 _0x21d1=['getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','Smtp','CloudProvider'];(function(_0x5d04d7,_0x3b4ae8){var _0x1ec76a=function(_0x3dd196){while(--_0x3dd196){_0x5d04d7['push'](_0x5d04d7['shift']());}};_0x1ec76a(++_0x3b4ae8);}(_0x21d1,0x1c9));var _0x121d=function(_0x1a7466,_0x2642f1){_0x1a7466=_0x1a7466-0x0;var _0x469ff4=_0x21d1[_0x1a7466];return _0x469ff4;};'use strict';var _=require(_0x121d('0x0'));var moment=require(_0x121d('0x1'));var jayson=require(_0x121d('0x2'));var client=jayson[_0x121d('0x3')][_0x121d('0x4')]({'port':0x2329});function request(_0x14fd65,_0x550ab5){return new Promise(function(_0x50365e,_0x20b991){return client[_0x121d('0x5')](_0x14fd65,_0x550ab5)[_0x121d('0x6')](function(_0x44fa5c){if(_0x44fa5c[_0x121d('0x7')]){return _0x20b991(_0x44fa5c['error'][_0x121d('0x8')]);}else{return _0x50365e(_0x44fa5c[_0x121d('0x9')]);}})[_0x121d('0xa')](function(_0x2d4d7e){return _0x20b991(_0x2d4d7e);});});}exports[_0x121d('0xb')]=function(){return request(_0x121d('0xc'),{'options':{'raw':![],'attributes':['id',_0x121d('0xd'),_0x121d('0xe')]}});};exports[_0x121d('0xf')]=function(_0xa9dd0e){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xa9dd0e},'attributes':[_0x121d('0xe')]}});};exports[_0x121d('0x10')]=function(_0x303f33){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x303f33},'include':[{'model':'MailServerOut','as':_0x121d('0x11'),'include':[{'model':_0x121d('0x12'),'as':_0x121d('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x121d('0x13')]=function(_0x54a257){return request(_0x121d('0x14'),{'options':{'where':{'id':_0x54a257},'attributes':[_0x121d('0xd')]}});};exports[_0x121d('0x15')]=function(_0x48e4ce){return request(_0x121d('0x16'),{'options':{'where':{'id':_0x48e4ce},'attributes':[_0x121d('0xd')]}});};exports[_0x121d('0x17')]=function(_0x8dec86){return request(_0x121d('0x18'),{'options':{'where':{'id':_0x8dec86},'attributes':[_0x121d('0xd')]}});};exports[_0x121d('0x19')]=function(_0x317b8a){return request(_0x121d('0x1a'),{'options':{'where':{'id':_0x317b8a},'attributes':[_0x121d('0x1b')]}});};exports[_0x121d('0x1c')]=function(_0x15eac4){return request(_0x121d('0x1d'),{'options':{'where':{'id':_0x15eac4},'attributes':['name']}});};exports['getContactByPhone']=function(_0x48e041){return request(_0x121d('0x1e'),{'options':{'where':{'phone':_0x48e041[_0x121d('0x1f')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x455041){return request(_0x121d('0x20'),{'options':{'where':{'id':_0x455041},'attributes':[_0x121d('0xd')]}});};exports[_0x121d('0x21')]=function(_0x372f3d){return request(_0x121d('0x22'),{'options':{'where':{'id':_0x372f3d},'attributes':[_0x121d('0x23')]}});};exports[_0x121d('0x24')]=function(_0x22225a){return request(_0x121d('0x25'),{'options':{'raw':![],'where':{'id':_0x22225a},'include':[{'model':_0x121d('0x26'),'as':_0x121d('0x27')}]}});};exports[_0x121d('0x28')]=function(_0x9e6d43){return request(_0x121d('0x29'),{'options':{'where':{'id':_0x9e6d43},'attributes':['id',_0x121d('0xd')]}});};exports[_0x121d('0x2a')]=function(_0x208a7c){return request(_0x121d('0x2b'),{'body':_0x208a7c});};exports[_0x121d('0x2c')]=function(_0x1b5ce6){return request('CreateSquareDetailsReport',{'body':_0x1b5ce6});};exports[_0x121d('0x2d')]=function(_0x18392c){return request(_0x121d('0x2e'),{'body':_[_0x121d('0x2f')](_0x18392c,{'project_name':_0x18392c[_0x121d('0x30')],'prev_project_name':_0x18392c['arg_2']||'','is_subproject':_0x18392c[_0x121d('0x31')]?!![]:![],'leaveAt':moment()['format'](_0x121d('0x32'))})});};exports[_0x121d('0x33')]=function(_0x4762fb){return request(_0x121d('0x34'),{'body':_0x4762fb});};exports[_0x121d('0x35')]=function(_0x3156b5){return request(_0x121d('0x36'),{'body':_0x3156b5});};exports[_0x121d('0x37')]=function(_0x309e30){return request(_0x121d('0x38'),{'options':{'raw':![],'where':{'phone':_0x309e30['phone'],'ListId':_0x309e30[_0x121d('0x39')]}}})['then'](function(_0x314495){if(_0x314495){return _0x314495;}return request(_0x121d('0x3a'),{'body':_0x309e30});});};exports[_0x121d('0x3b')]=function(_0x5edc25){return request('ShowPause',{'options':{'where':{'id':_0x5edc25},'attributes':[_0x121d('0xd')]}});};exports[_0x121d('0x3c')]=function(_0x308e96,_0x40e2ba){return request(_0x121d('0x3d'),{'body':{'interface':_0x40e2ba},'options':{'where':_0x308e96}});};exports[_0x121d('0x3e')]=function(_0x1407e3,_0x4d5314,_0x1cf82c){return request(_0x121d('0x3f'),{'body':{'type':_0x4d5314,'uniqueid':_0x1cf82c},'options':{'where':_0x1407e3}});};exports[_0x121d('0x40')]=function(_0x23fd5f){return request(_0x121d('0x41'),{'body':{},'options':{'where':_0x23fd5f}});};exports[_0x121d('0x42')]=function(_0xff170f){return request(_0x121d('0x43'),{'body':{},'options':{'where':_0xff170f}});}; \ No newline at end of file +var _0xcb57=['production','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','getVariableById','getSquareOdbcById','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','lodash','moment','client','then','error','message','result','catch','getSquareProjects','GetSquareProjects'];(function(_0x6cd0f3,_0x35fef2){var _0x32cea4=function(_0x47970c){while(--_0x47970c){_0x6cd0f3['push'](_0x6cd0f3['shift']());}};_0x32cea4(++_0x35fef2);}(_0xcb57,0xa1));var _0x7cb5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xcb57[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x7cb5('0x0'));var moment=require(_0x7cb5('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x7cb5('0x2')]['http']({'port':0x2329});function request(_0x2183e8,_0x53c185){return new Promise(function(_0x33e1e6,_0x1b1ef7){return client['request'](_0x2183e8,_0x53c185)[_0x7cb5('0x3')](function(_0x87b278){if(_0x87b278[_0x7cb5('0x4')]){return _0x1b1ef7(_0x87b278['error'][_0x7cb5('0x5')]);}else{return _0x33e1e6(_0x87b278[_0x7cb5('0x6')]);}})[_0x7cb5('0x7')](function(_0x715420){return _0x1b1ef7(_0x715420);});});}exports[_0x7cb5('0x8')]=function(){return request(_0x7cb5('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports['getSquareProject']=function(_0x11bafa){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x11bafa},'attributes':[_0x7cb5('0xa')]}});};exports['getMailAccountById']=function(_0x132830){return request(_0x7cb5('0xb'),{'options':{'raw':![],'where':{'id':_0x132830},'include':[{'model':_0x7cb5('0xc'),'as':_0x7cb5('0xd'),'include':[{'model':_0x7cb5('0xe'),'as':_0x7cb5('0xe')}]}],'attributes':['id',_0x7cb5('0xf'),_0x7cb5('0x10')],'smtp':!![]}});};exports[_0x7cb5('0x11')]=function(_0xf96338){return request(_0x7cb5('0x12'),{'options':{'where':{'id':_0xf96338},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x13')]=function(_0x3648cb){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3648cb},'attributes':['name']}});};exports[_0x7cb5('0x14')]=function(_0x30ba6a){return request('ShowVariable',{'options':{'where':{'id':_0x30ba6a},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x15')]=function(_0x238fb4){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x238fb4},'attributes':['dsn']}});};exports[_0x7cb5('0x16')]=function(_0x318afd){return request(_0x7cb5('0x17'),{'options':{'where':{'id':_0x318afd},'attributes':['name']}});};exports[_0x7cb5('0x18')]=function(_0x58e0ea){return request(_0x7cb5('0x19'),{'options':{'where':{'phone':_0x58e0ea[_0x7cb5('0x1a')]},'attributes':['id']}});};exports[_0x7cb5('0x1b')]=function(_0x2b58db){return request(_0x7cb5('0x1c'),{'options':{'where':{'id':_0x2b58db},'attributes':[_0x7cb5('0xf')]}});};exports['getSoundById']=function(_0x208277){return request(_0x7cb5('0x1d'),{'options':{'where':{'id':_0x208277},'attributes':[_0x7cb5('0x1e')]}});};exports['getIntervalById']=function(_0x1b5d35){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1b5d35},'include':[{'model':_0x7cb5('0x1f'),'as':_0x7cb5('0x20')}]}});};exports['getSmsAccountById']=function(_0x3e0496){return request(_0x7cb5('0x21'),{'options':{'where':{'id':_0x3e0496},'attributes':['id',_0x7cb5('0xf')]}});};exports[_0x7cb5('0x22')]=function(_0x2c6846){return request(_0x7cb5('0x23'),{'body':_0x2c6846});};exports[_0x7cb5('0x24')]=function(_0x126dc6){return request(_0x7cb5('0x25'),{'body':_0x126dc6});};exports[_0x7cb5('0x26')]=function(_0x5c4fb1){return request(_0x7cb5('0x27'),{'body':_['merge'](_0x5c4fb1,{'project_name':_0x5c4fb1['arg_1'],'prev_project_name':_0x5c4fb1[_0x7cb5('0x28')]||'','is_subproject':_0x5c4fb1[_0x7cb5('0x28')]?!![]:![],'leaveAt':moment()['format'](_0x7cb5('0x29'))})});};exports[_0x7cb5('0x2a')]=function(_0x35fbf0){return request(_0x7cb5('0x2b'),{'body':_0x35fbf0});};exports[_0x7cb5('0x2c')]=function(_0x3c465b){return request(_0x7cb5('0x2d'),{'body':_0x3c465b});};exports[_0x7cb5('0x2e')]=function(_0x178f22){return request(_0x7cb5('0x2f'),{'options':{'raw':![],'where':{'phone':_0x178f22[_0x7cb5('0x1a')],'ListId':_0x178f22[_0x7cb5('0x30')]}}})[_0x7cb5('0x3')](function(_0x1388f4){if(_0x1388f4){return _0x1388f4;}return request(_0x7cb5('0x31'),{'body':_0x178f22});});};exports['getPauseById']=function(_0x33c3fc){return request(_0x7cb5('0x32'),{'options':{'where':{'id':_0x33c3fc},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x33')]=function(_0x37cd36,_0x4b44fe){return request(_0x7cb5('0x34'),{'body':{'interface':_0x4b44fe},'options':{'where':_0x37cd36}});};exports[_0x7cb5('0x35')]=function(_0x2e2cb6,_0x3d2f72,_0x3f1589){return request(_0x7cb5('0x36'),{'body':{'type':_0x3d2f72,'uniqueid':_0x3f1589},'options':{'where':_0x2e2cb6}});};exports[_0x7cb5('0x37')]=function(_0x393207){return request('UnpauseUser',{'body':{},'options':{'where':_0x393207}});};exports[_0x7cb5('0x38')]=function(_0x2e3d2a){return request('LogoutUser',{'body':{},'options':{'where':_0x2e3d2a}});}; \ 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 f775270..f243cba 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 _0x7c1a=['./polly','./lex','exports'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x7c1a,0x159));var _0xa7c1=function(_0x34ffd5,_0x54c037){_0x34ffd5=_0x34ffd5-0x0;var _0x491cec=_0x7c1a[_0x34ffd5];return _0x491cec;};var polly=require(_0xa7c1('0x0'));var lex=require(_0xa7c1('0x1'));module[_0xa7c1('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x806b=['exports','./polly','./lex'];(function(_0x4cd449,_0x39d661){var _0x294fac=function(_0x116847){while(--_0x116847){_0x4cd449['push'](_0x4cd449['shift']());}};_0x294fac(++_0x39d661);}(_0x806b,0x163));var _0xb806=function(_0x2cc941,_0x36750f){_0x2cc941=_0x2cc941-0x0;var _0x3beb60=_0x806b[_0x2cc941];return _0x3beb60;};var polly=require(_0xb806('0x0'));var lex=require(_0xb806('0x1'));module[_0xb806('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 9b5393b..ae21a2f 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 _0xb43b=['./lib/api','exports'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4db651,_0x1c64f8){_0x4db651=_0x4db651-0x0;var _0x2ffb79=_0xb43b[_0x4db651];return _0x2ffb79;};'use strict';var lex=require(_0xbb43('0x0'));module[_0xbb43('0x1')]=function(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e){return lex(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e);}; \ No newline at end of file +var _0x9c00=['./lib/api','exports'];(function(_0x191a7f,_0x45a4f6){var _0x1ae913=function(_0x46e437){while(--_0x46e437){_0x191a7f['push'](_0x191a7f['shift']());}};_0x1ae913(++_0x45a4f6);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4ef11c,_0x387510){_0x4ef11c=_0x4ef11c-0x0;var _0x1c3026=_0x9c00[_0x4ef11c];return _0x1c3026;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index d0ec9ed..8d3745e 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(_0xbc66ff,_0x4fadc0){var _0x4dd893=function(_0x50e778){while(--_0x50e778){_0xbc66ff['push'](_0xbc66ff['shift']());}};_0x4dd893(++_0x4fadc0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x41f733,_0x10315b){var _0x4bc029=function(_0x429ef9){while(--_0x429ef9){_0x41f733['push'](_0x41f733['shift']());}};_0x4bc029(++_0x10315b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 9116ec8..d1cb64f 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 _0xef5b=['exports','./lib/api'];(function(_0x555bbd,_0x196748){var _0x3184d7=function(_0x274943){while(--_0x274943){_0x555bbd['push'](_0x555bbd['shift']());}};_0x3184d7(++_0x196748);}(_0xef5b,0x131));var _0xbef5=function(_0x3aadc3,_0x15776b){_0x3aadc3=_0x3aadc3-0x0;var _0x1c5248=_0xef5b[_0x3aadc3];return _0x1c5248;};'use strict';var polly=require(_0xbef5('0x0'));module[_0xbef5('0x1')]=function(_0x3b93bc,_0x2b7100,_0xa61686,_0x26d9f6,_0x2c37e3,_0x2c67a6,_0x219eb8){return polly(_0x3b93bc,_0x2b7100,_0xa61686,_0x26d9f6,_0x2c37e3,_0x2c67a6,_0x219eb8);}; \ No newline at end of file +var _0x4902=['exports','./lib/api'];(function(_0x5167f4,_0x431d10){var _0x5ec6a3=function(_0x5b3c97){while(--_0x5b3c97){_0x5167f4['push'](_0x5167f4['shift']());}};_0x5ec6a3(++_0x431d10);}(_0x4902,0x12f));var _0x2490=function(_0x50210b,_0x5bc5e1){_0x50210b=_0x50210b-0x0;var _0x1534f2=_0x4902[_0x50210b];return _0x1534f2;};'use strict';var polly=require(_0x2490('0x0'));module[_0x2490('0x1')]=function(_0x1b889f,_0x3fe9d6,_0x45163f,_0x481cf8,_0x1c03ff,_0x1c825f,_0x45df5f){return polly(_0x1b889f,_0x3fe9d6,_0x45163f,_0x481cf8,_0x1c03ff,_0x1c825f,_0x45df5f);}; \ 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 904880d..84e40f6 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 _0xef8f=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x57fdcb,_0x2e07ee){var _0x289340=function(_0x14237c){while(--_0x14237c){_0x57fdcb['push'](_0x57fdcb['shift']());}};_0x289340(++_0x2e07ee);}(_0xef8f,0x18a));var _0xfef8=function(_0x8841ea,_0x3bd968){_0x8841ea=_0x8841ea-0x0;var _0x587ec5=_0xef8f[_0x8841ea];return _0x587ec5;};'use strict';var fs=require('fs');var path=require(_0xfef8('0x0'));var BPromise=require(_0xfef8('0x1'));var rs=require(_0xfef8('0x2'));var AWS=require(_0xfef8('0x3'));function pollyResult(_0x23f9f5,_0x367a39,_0x300fc3){return new BPromise(function(_0x2c8fd5,_0x259cd3){_0x23f9f5[_0xfef8('0x4')](_0x367a39,function(_0x3ea5a6,_0x4bbd34){if(_0x3ea5a6){_0x259cd3(_0x3ea5a6);}else if(_0x4bbd34){if(_0x4bbd34[_0xfef8('0x5')]instanceof Buffer){fs[_0xfef8('0x6')](_0x300fc3,_0x4bbd34[_0xfef8('0x5')],function(_0x3f13eb){if(_0x3f13eb){_0x259cd3(_0x3f13eb);}else{_0x2c8fd5();}});}else{_0x259cd3(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x259cd3(new Error(_0xfef8('0x7')));}});});}module[_0xfef8('0x8')]=function(_0x347029,_0x52febe,_0x3739ad,_0x4ff7fa,_0x2d22b6,_0x235d25,_0x458632){var _0x524373=new AWS[(_0xfef8('0x9'))]({'accessKeyId':_0x347029,'secretAccessKey':_0x52febe,'region':_0x3739ad});var _0x1d84a1={'Text':_0x2d22b6,'TextType':_0x235d25||_0xfef8('0xa'),'OutputFormat':_0xfef8('0xb'),'VoiceId':_0x4ff7fa};return pollyResult(_0x524373,_0x1d84a1,_0x458632);}; \ No newline at end of file +var _0x8f36=['Polly','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x25bb32,_0x442db4){var _0x310ac8=function(_0x5d27f6){while(--_0x5d27f6){_0x25bb32['push'](_0x25bb32['shift']());}};_0x310ac8(++_0x442db4);}(_0x8f36,0x1a6));var _0x68f3=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8f36[_0x24061a];return _0x82054e;};'use strict';var fs=require('fs');var path=require(_0x68f3('0x0'));var BPromise=require(_0x68f3('0x1'));var rs=require(_0x68f3('0x2'));var AWS=require('aws-sdk');function pollyResult(_0xdbf1fc,_0x40e471,_0x30c50b){return new BPromise(function(_0x26e50d,_0x41f529){_0xdbf1fc[_0x68f3('0x3')](_0x40e471,function(_0x57c2b9,_0x50782d){if(_0x57c2b9){_0x41f529(_0x57c2b9);}else if(_0x50782d){if(_0x50782d[_0x68f3('0x4')]instanceof Buffer){fs[_0x68f3('0x5')](_0x30c50b,_0x50782d[_0x68f3('0x4')],function(_0x3587b5){if(_0x3587b5){_0x41f529(_0x3587b5);}else{_0x26e50d();}});}else{_0x41f529(new Error(_0x68f3('0x6')));}}else{_0x41f529(new Error(_0x68f3('0x7')));}});});}module['exports']=function(_0x79ad40,_0x1e28ca,_0x4ccd52,_0x1367e5,_0x14a06e,_0x9ecff9,_0x548b28){var _0x5d2bc0=new AWS[(_0x68f3('0x8'))]({'accessKeyId':_0x79ad40,'secretAccessKey':_0x1e28ca,'region':_0x4ccd52});var _0x435f94={'Text':_0x14a06e,'TextType':_0x9ecff9||'text','OutputFormat':_0x68f3('0x9'),'VoiceId':_0x1367e5};return pollyResult(_0x5d2bc0,_0x435f94,_0x548b28);}; \ 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 4573095..e073098 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 _0x3e16=['./lib/api','exports'];(function(_0x3ab6cb,_0x591249){var _0x108ae5=function(_0x54be0c){while(--_0x54be0c){_0x3ab6cb['push'](_0x3ab6cb['shift']());}};_0x108ae5(++_0x591249);}(_0x3e16,0x136));var _0x63e1=function(_0x4e3000,_0xe69179){_0x4e3000=_0x4e3000-0x0;var _0x387a4f=_0x3e16[_0x4e3000];return _0x387a4f;};'use strict';var asr=require(_0x63e1('0x0'));module[_0x63e1('0x1')]=function(_0x77a39,_0x36fbb9,_0x443dff,_0x1acc01){return asr(_0x77a39,_0x36fbb9,_0x443dff);}; \ No newline at end of file +var _0x277d=['./lib/api','exports'];(function(_0x2d1cf9,_0x16a765){var _0x5e82d0=function(_0x37ab71){while(--_0x37ab71){_0x2d1cf9['push'](_0x2d1cf9['shift']());}};_0x5e82d0(++_0x16a765);}(_0x277d,0xb4));var _0xd277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x277d[_0x59ee6f];return _0x4c0979;};'use strict';var asr=require(_0xd277('0x0'));module[_0xd277('0x1')]=function(_0x3f2328,_0x413638,_0x29f72f,_0x59522d){return asr(_0x3f2328,_0x413638,_0x29f72f);}; \ 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 ed6658c..57a3ec4 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 _0xd52a=['LINEAR16','8000','bluebird','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','toString','/v1/speech:recognize?key='];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd52a,0xca));var _0xad52=function(_0x59a9cc,_0x29a42c){_0x59a9cc=_0x59a9cc-0x0;var _0x4bf668=_0xd52a[_0x59a9cc];return _0x4bf668;};'use strict';var url=require('url');var BPromise=require(_0xad52('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xad52('0x1')]=function(_0x7b9789,_0x30b335,_0x572592){return new BPromise(function(_0x3f4207,_0x383c44){var _0x130d6d;if(typeof _0x7b9789!==_0xad52('0x2')||_0x7b9789['length']===0x0){return _0x383c44('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x30b335!=='string'||_0x30b335[_0xad52('0x3')]===0x0){return _0x383c44('key\x20should\x20be\x20a\x20string');}if(typeof _0x572592!==_0xad52('0x4')&&(typeof _0x572592!=='string'||_0x572592[_0xad52('0x3')]===0x0)){return _0x383c44(_0xad52('0x5'));}try{_0x130d6d=fs['readFileSync'](_0x7b9789)[_0xad52('0x6')]('base64');}catch(_0x46fbc5){return _0x383c44(_0x46fbc5);}return _0x3f4207({'method':'POST','uri':host+_0xad52('0x7')+_0x30b335,'body':{'config':{'encoding':_0xad52('0x8'),'sampleRateHertz':_0xad52('0x9'),'languageCode':_0x572592},'audio':{'content':_0x130d6d}},'json':!![]});});}; \ No newline at end of file +var _0x261b=['key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','string','filepath\x20should\x20be\x20a\x20string','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x261b,0x15a));var _0xb261=function(_0xa74cb4,_0xfe0182){_0xa74cb4=_0xa74cb4-0x0;var _0x3e5ac3=_0x261b[_0xa74cb4];return _0x3e5ac3;};'use strict';var url=require(_0xb261('0x0'));var BPromise=require(_0xb261('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x5d9cfe,_0x48c7f0,_0x392d5c){return new BPromise(function(_0x5a84d7,_0x30540c){var _0x589255;if(typeof _0x5d9cfe!==_0xb261('0x2')||_0x5d9cfe['length']===0x0){return _0x30540c(_0xb261('0x3'));}if(typeof _0x48c7f0!==_0xb261('0x2')||_0x48c7f0[_0xb261('0x4')]===0x0){return _0x30540c(_0xb261('0x5'));}if(typeof _0x392d5c!=='undefined'&&(typeof _0x392d5c!==_0xb261('0x2')||_0x392d5c[_0xb261('0x4')]===0x0)){return _0x30540c(_0xb261('0x6'));}try{_0x589255=fs[_0xb261('0x7')](_0x5d9cfe)['toString'](_0xb261('0x8'));}catch(_0x2cc655){return _0x30540c(_0x2cc655);}return _0x5a84d7({'method':_0xb261('0x9'),'uri':host+_0xb261('0xa')+_0x48c7f0,'body':{'config':{'encoding':_0xb261('0xb'),'sampleRateHertz':_0xb261('0xc'),'languageCode':_0x392d5c},'audio':{'content':_0x589255}},'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 edb5c7c..4e1feba 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 _0x381a=['./asr','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x381a,0xd2));var _0xa381=function(_0x27b558,_0x223bad){_0x27b558=_0x27b558-0x0;var _0x4cb352=_0x381a[_0x27b558];return _0x4cb352;};var asr=require(_0xa381('0x0'));module[_0xa381('0x1')]={'asr':asr}; \ No newline at end of file +var _0x9436=['./asr','exports'];(function(_0x2c5ce4,_0x1b4766){var _0x4060a3=function(_0x3d4b86){while(--_0x3d4b86){_0x2c5ce4['push'](_0x2c5ce4['shift']());}};_0x4060a3(++_0x1b4766);}(_0x9436,0x15e));var _0x6943=function(_0x1ba90b,_0x179b9d){_0x1ba90b=_0x1ba90b-0x0;var _0x2095da=_0x9436[_0x1ba90b];return _0x2095da;};var asr=require(_0x6943('0x0'));module[_0x6943('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index e113e0b..e0dde41 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 _0x2572=['get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','WHAT_EVER','data','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','POST','from','audioContent','base64','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','parse','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','https','md5','path','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','../../../config/logger','agi','protocol','https:','host'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2572,0xfa));var _0x2257=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2572[_0x2b4411];return _0x8e41ef;};'use strict';var apiai=require(_0x2257('0x0'));var BPromise=require(_0x2257('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x2257('0x2'));var md5=require(_0x2257('0x3'));var path=require(_0x2257('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x2257('0x5'));var sox=require(_0x2257('0x6'));var tts=require(_0x2257('0x7'));var urlParse=require(_0x2257('0x8'))['parse'];var util=require(_0x2257('0x9'));var aws=require(_0x2257('0xa'));var google=require(_0x2257('0xb'));var sestek=require(_0x2257('0xc'));var tilde=require('./tilde');var logger=require(_0x2257('0xd'))(_0x2257('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x28759f,_0x10f34a){return new BPromise(function(_0x235105,_0x5316eb){var _0xf92a63=urlParse(_0x28759f);var _0x5044c9=_0xf92a63[_0x2257('0xf')]===_0x2257('0x10')?https:http;var _0x122b52={'host':_0xf92a63[_0x2257('0x11')],'path':_0xf92a63[_0x2257('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x5044c9[_0x2257('0x12')](_0x122b52,function(_0x2a642a){if(_0x2a642a[_0x2257('0x13')]!==0xc8){logger[_0x2257('0x14')](_0x2257('0x15')+_0x28759f+_0x2257('0x16')+_0x2a642a[_0x2257('0x13')]+'\x20('+_0x2a642a[_0x2257('0x17')]+')');_0x5316eb(new Error('request\x20to\x20'+_0x28759f+_0x2257('0x16')+_0x2a642a[_0x2257('0x13')]+'\x20('+_0x2a642a['statusMessage']+')'));return;}var _0x27a642=fs['createWriteStream'](_0x10f34a);_0x27a642['on']('finish',function(){logger[_0x2257('0x18')](_0x2257('0x19'));_0x27a642['close'](_0x235105);});_0x27a642['on'](_0x2257('0x14'),function(_0x57eb1f){fs[_0x2257('0x1a')](_0x10f34a);logger[_0x2257('0x14')](_0x2257('0x1b'),_0x57eb1f);_0x5316eb(_0x57eb1f);});_0x2a642a[_0x2257('0x1c')](_0x27a642);})['on'](_0x2257('0x14'),function(_0x41748b){logger[_0x2257('0x14')](_0x41748b);_0x5316eb(_0x41748b);})[_0x2257('0x1d')]();});}function uploadFile(_0x9ce339){return new BPromise(function(_0x434e8c,_0x3dbc90){var _0x21db74=urlParse(_0x9ce339);var _0x19ef2a=_0x21db74[_0x2257('0xf')]===_0x2257('0x10')?https:http;var _0x15777c={'host':_0x21db74['host'],'path':_0x21db74[_0x2257('0x4')],'headers':{'user-agent':_0x2257('0x1e')}};_0x19ef2a['get'](_0x15777c,function(_0x1be917){if(_0x1be917['statusCode']!==0xc8){_0x3dbc90(new Error('request\x20to\x20'+_0x9ce339+'\x20failed,\x20status\x20code\x20=\x20'+_0x1be917[_0x2257('0x13')]+'\x20('+_0x1be917['statusMessage']+')'));return;}var _0x3ce234='';_0x1be917['on'](_0x2257('0x1f'),function(_0x1bd941){_0x3ce234+=_0x1bd941;});_0x1be917['on'](_0x2257('0x1d'),function(){_0x434e8c(_0x3ce234);});})['on'](_0x2257('0x14'),function(_0x22f8b9){_0x3dbc90(_0x22f8b9);})['end']();});}function convertFile(_0x28b39f,_0x3afc19){return new BPromise(function(_0x1674bc,_0x97121b){var _0x4fbcf3=sox['transcode'](_0x28b39f,_0x3afc19,{'sampleRate':0x1f40,'format':_0x2257('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4fbcf3['on'](_0x2257('0x14'),function(_0x2c26db){logger[_0x2257('0x14')]('error\x20convert',_0x2c26db);_0x97121b(_0x2c26db);});_0x4fbcf3['on'](_0x2257('0x1d'),function(){logger[_0x2257('0x18')](_0x2257('0x21'));_0x1674bc();});_0x4fbcf3[_0x2257('0x22')]();});}function base64Decode(_0x17a174,_0x5b79b6){var _0x4374e0=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x26'));fs['writeFileSync'](_0x4374e0,_0x17a174,'base64');return convertFile(_0x4374e0,_0x5b79b6)[_0x2257('0x27')](function(){try{fs[_0x2257('0x1a')](_0x4374e0);fs[_0x2257('0x28')](_0x5b79b6,_0x2257('0x29'));}catch(_0x42f8e7){logger[_0x2257('0x14')](_0x42f8e7);}return _0x5b79b6[_0x2257('0x2a')]('.')[0x0];});}function base64Encode(_0x1bb0f6){var _0x554c21=fs[_0x2257('0x2b')](_0x1bb0f6);return new Buffer(_0x554c21)['toString']('base64');}exports[_0x2257('0x2c')]=function(_0x2e9439,_0x45ebf8,_0x55888c,_0x1d4bbc,_0x382200,_0x222801){var _0x5ce6bc,_0x5d48f2;var _0x5e3da7=_0x2257('0x2d');var _0x2436cd=_0x2257('0x2e')+_0x2e9439;var _0x3d613e={};if(_0x45ebf8==='ssml'){_0x3d613e[_0x2257('0x2f')]={'ssml':_0x55888c};}else{_0x3d613e[_0x2257('0x2f')]={'text':_0x55888c};};_0x3d613e['voice']={'languageCode':_0x1d4bbc,'ssmlGender':_0x382200};_0x3d613e[_0x2257('0x30')]={'audioEncoding':_0x2257('0x31'),'sampleRateHertz':0x1f40};var _0x311d9f={'url':_0x5e3da7+'text:synthesize'+_0x2436cd,'method':_0x2257('0x32'),'json':!![],'body':_0x3d613e};return rp(_0x311d9f)[_0x2257('0x27')](function(_0x5f05c0){return new BPromise(function(_0x3c584f,_0x172b49){_0x5ce6bc=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+'.mp3');var _0x4dee48=Buffer[_0x2257('0x33')](_0x5f05c0[_0x2257('0x34')],_0x2257('0x35'));return fs[_0x2257('0x36')](_0x5ce6bc,_0x4dee48,function(_0x443cc0){_0x172b49(_0x443cc0);},function(_0xc2c745){fs[_0x2257('0x28')](_0x5ce6bc,_0x2257('0x29'));_0x3c584f(_0xc2c745);});});})[_0x2257('0x27')](function(_0x13a21e){_0x5d48f2=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x26'));return convertFile(_0x5ce6bc,_0x5d48f2);})[_0x2257('0x27')](function(){try{fs[_0x2257('0x1a')](_0x5ce6bc);fs[_0x2257('0x28')](_0x5d48f2,'777');}catch(_0x214024){logger[_0x2257('0x14')](_0x214024);}logger[_0x2257('0x18')](_0x2257('0x37'),_0x5d48f2['split']('.')[0x0]);return _0x5d48f2['split']('.')[0x0];});};exports[_0x2257('0x38')]=function(_0x54af2f,_0x91b5c7){var _0x4b2d6d=_0x2257('0x39');var _0x55e44c,_0x423e36;var _0x5366ca;var _0x16f44e={'encoding':_0x2257('0x3a'),'method':'POST','timeout':0x2710,'url':_0x4b2d6d,'headers':{'Content-Type':_0x2257('0x3b')},'body':'f.req='+encodeURIComponent(JSON[_0x2257('0x3c')]([[[_0x2257('0x3d'),JSON[_0x2257('0x3c')]([_0x54af2f,_0x91b5c7||'en',![],_0x2257('0x3e')]),null,_0x2257('0x3f')]]]))};return rp(_0x16f44e)['then'](function(_0x3c590a){try{_0x5366ca=eval(_0x3c590a[_0x2257('0x40')](0x5))[0x0][0x2];}catch(_0x159f5e){throw new Error(_0x2257('0x41')+_0x3c590a[_0x2257('0x1f')]);}if(!_0x5366ca){if(_0x54af2f[_0x2257('0x42')]>0xc8){throw new Error(_0x2257('0x43'));}else{throw new Error(_0x2257('0x44')+_0x91b5c7+'\x22\x20might\x20not\x20exist');}}try{_0x5366ca=eval(_0x5366ca)[0x0];}catch(_0x349da1){throw new Error(_0x2257('0x41')+res['data']);}const _0x57a608=_0x5366ca;_0x55e44c=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x45'));fs['writeFileSync'](_0x55e44c,_0x5366ca,{'encoding':_0x2257('0x35')});_0x423e36=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x26'));return convertFile(_0x55e44c,_0x423e36);})[_0x2257('0x27')](function(){try{fs[_0x2257('0x1a')](_0x55e44c);fs[_0x2257('0x28')](_0x423e36,_0x2257('0x29'));}catch(_0x343bdd){logger[_0x2257('0x14')](_0x343bdd);}logger[_0x2257('0x18')](_0x2257('0x46'),_0x423e36[_0x2257('0x2a')]('.')[0x0]);return _0x423e36[_0x2257('0x2a')]('.')[0x0];});};exports[_0x2257('0x47')]=function(_0x204d94,_0x4db865,_0x522a27){return google['asr'](_0x204d94,_0x4db865,_0x522a27)['then'](function(_0x39b05){logger[_0x2257('0x18')](_0x39b05['uri']);return rp(_0x39b05);})[_0x2257('0x27')](function(_0x45f392){var _0x5b7cdb='';var _0x2babb9=0x0;try{fs[_0x2257('0x1a')](_0x204d94);}catch(_0x214ab4){logger[_0x2257('0x14')](_0x214ab4);}if(_0x45f392&&_0x45f392[_0x2257('0x48')]){_0x5b7cdb=_0x45f392['results'][_0x2257('0x49')](function(_0x1589f7){return _0x1589f7&&_0x1589f7[_0x2257('0x4a')][0x0]&&_0x1589f7[_0x2257('0x4a')][0x0][_0x2257('0x4b')]?_0x1589f7['alternatives'][0x0][_0x2257('0x4b')]:'';})[_0x2257('0x4c')]('\x0a');_0x2babb9=_0x45f392['results'][_0x2257('0x49')](function(_0x2b4ab7){return _0x2b4ab7&&_0x2b4ab7['alternatives'][0x0]&&_0x2b4ab7['alternatives'][0x0][_0x2257('0x4d')]?_0x2b4ab7[_0x2257('0x4a')][0x0][_0x2257('0x4d')]:0x0;})['join']('\x0a');}logger[_0x2257('0x18')](_0x2257('0x4e'),_0x5b7cdb);logger['info'](_0x2257('0x4f'),_0x2babb9);return{'transcript':_0x5b7cdb,'confidence':_0x2babb9};})['catch'](function(_0x34faab){logger[_0x2257('0x14')](_0x2257('0x50'),_0x34faab[_0x2257('0x13')],_0x34faab[_0x2257('0x51')],_0x34faab[_0x2257('0x52')]);});};exports[_0x2257('0x53')]=function(_0x1314db,_0x3caccb,_0x2f6ee3,_0x1cf909){var _0x458e08=apiai(_0x3caccb,{'language':_0x1cf909||'en'});return _0x458e08['textRequest'](_0x2f6ee3,{'sessionId':md5(_0x1314db)})[_0x2257('0x27')](function(_0x7e5d96){logger[_0x2257('0x18')](JSON[_0x2257('0x3c')](_0x7e5d96));return{'source':_0x7e5d96[_0x2257('0x54')][_0x2257('0x55')],'resolvedQuery':_0x7e5d96['result'][_0x2257('0x56')],'action':_0x7e5d96[_0x2257('0x54')][_0x2257('0x57')],'actionIncomplete':_0x7e5d96[_0x2257('0x54')][_0x2257('0x58')],'speech':_0x7e5d96[_0x2257('0x54')][_0x2257('0x59')][_0x2257('0x5a')],'score':_0x7e5d96[_0x2257('0x54')][_0x2257('0x5b')],'statusCode':_0x7e5d96[_0x2257('0x5c')][_0x2257('0x5d')],'endConversation':_0x7e5d96[_0x2257('0x54')][_0x2257('0x5e')][_0x2257('0x5f')]||![],'isFallbackIntent':_0x7e5d96['result'][_0x2257('0x5e')][_0x2257('0x60')]};});};exports[_0x2257('0x61')]=function(_0x18787a,_0x5ad5de,_0x4dce61,_0x403ddb,_0x3189db,_0x1470fa){var _0x39877e=_0x403ddb[_0x2257('0x62')](/\\n/g,'\x0a');var _0x112505={'credentials':{'private_key':_0x39877e,'client_email':_0x4dce61}};var _0xd999f6=new dialogflow[(_0x2257('0x63'))](_0x112505);var _0x5d6675=_0xd999f6[_0x2257('0x64')](_0x5ad5de,md5(_0x18787a));var _0x5cc790={'session':_0x5d6675,'queryInput':{'text':{'text':_0x3189db,'languageCode':_0x1470fa}}};return _0xd999f6[_0x2257('0x65')](_0x5cc790)[_0x2257('0x27')](function(_0x2182f2){if(_0x2182f2&&_0x2182f2[_0x2257('0x42')]){logger['info'](_0x2257('0x66'),JSON[_0x2257('0x3c')](_0x2182f2));var _0x9f835=_0x2182f2[0x0];if(_0x9f835){var _0x1d4232={'action':_0x9f835[_0x2257('0x67')][_0x2257('0x57')],'allRequiredParamsPresent':_0x9f835[_0x2257('0x67')][_0x2257('0x68')],'endConversation':_0x9f835[_0x2257('0x67')][_0x2257('0x69')]&&_0x9f835[_0x2257('0x67')][_0x2257('0x69')][_0x2257('0x6a')]?_0x9f835[_0x2257('0x67')]['diagnosticInfo'][_0x2257('0x6a')]['end_conversation'][_0x2257('0x6b')]:![],'fulfillmentText':_0x9f835[_0x2257('0x67')][_0x2257('0x6c')],'intentName':_0x9f835[_0x2257('0x67')]['intent'][_0x2257('0x51')],'intentDisplayName':_0x9f835[_0x2257('0x67')][_0x2257('0x6d')][_0x2257('0x6e')],'isFallbackIntent':_0x9f835[_0x2257('0x67')][_0x2257('0x6d')][_0x2257('0x6f')],'languageCode':_0x9f835[_0x2257('0x67')][_0x2257('0x70')],'queryText':_0x9f835[_0x2257('0x67')]['queryText'],'responseId':_0x9f835[_0x2257('0x71')],'score':_0x9f835[_0x2257('0x67')][_0x2257('0x72')],'speech':_0x9f835[_0x2257('0x67')][_0x2257('0x6c')],'providerResponse':JSON[_0x2257('0x3c')](_0x2182f2)};return _0x1d4232;}}});};exports['tildeASR']=function(_0x27cf62,_0x1376eb,_0x3335bb,_0x9c8c6d){return tilde[_0x2257('0x73')](_0x27cf62,_0x1376eb,_0x3335bb,_0x9c8c6d)[_0x2257('0x27')](function(_0x1cf99a){try{fs[_0x2257('0x1a')](_0x27cf62);}catch(_0x2584ec){logger['error'](_0x2584ec);}logger['info'](_0x2257('0x74'),_0x1cf99a[_0x2257('0x4b')]);logger[_0x2257('0x18')](_0x2257('0x75'),_0x1cf99a['confidence']);return _0x1cf99a;});};exports[_0x2257('0x76')]=function(_0x323061,_0x1fcf19,_0x5ac5a9,_0x233df9,_0xc0dcd7,_0x100776){var _0xb92ef7=path['resolve'](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+'.mp3');var _0x534a7a;return aws[_0x2257('0x77')](_0x323061,_0x1fcf19,_0x5ac5a9,_0x233df9,_0xc0dcd7,_0x100776,_0xb92ef7)[_0x2257('0x27')](function(){_0x534a7a=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs['generate'](0x4)+'.wav');return convertFile(_0xb92ef7,_0x534a7a);})[_0x2257('0x27')](function(){try{fs[_0x2257('0x1a')](_0xb92ef7);fs['chmodSync'](_0x534a7a,'777');}catch(_0x47dcac){logger[_0x2257('0x14')](_0x47dcac);}return _0x534a7a[_0x2257('0x2a')]('.')[0x0];});};exports[_0x2257('0x78')]=function(_0x39a854,_0x391dd9,_0x3b882d,_0x2db8f0,_0x2421b9,_0x6e16e9){return aws['lex'](_0x39a854,_0x391dd9,_0x3b882d,_0x2db8f0,_0x2421b9,_0x6e16e9)[_0x2257('0x27')](function(_0x21881d){logger[_0x2257('0x18')](JSON[_0x2257('0x3c')](_0x21881d));return _0x21881d;});};exports[_0x2257('0x79')]=function(_0x34613e,_0x3c5f00,_0x2550cc,_0x2a6872){var _0x48cb68=util[_0x2257('0x7a')](_0x2257('0x7b'),ISPEECH_API,_0x34613e,encodeURIComponent(_0x3c5f00),_0x2550cc,_0x2a6872);var _0x4ab12e=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+'.mp3');var _0x328a83;return downloadFile(_0x48cb68,_0x4ab12e)[_0x2257('0x27')](function(){_0x328a83=path[_0x2257('0x23')](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x26'));return convertFile(_0x4ab12e,_0x328a83);})[_0x2257('0x27')](function(){try{fs[_0x2257('0x1a')](_0x4ab12e);fs[_0x2257('0x28')](_0x328a83,'777');}catch(_0xad037c){logger[_0x2257('0x14')](_0xad037c);}return _0x328a83[_0x2257('0x2a')]('.')[0x0];});};exports[_0x2257('0x7c')]=function(_0x24ebca,_0x2a0ca8,_0x1d8178,_0xb1a48b){var _0x4b9f19=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2a0ca8,_0x1d8178,base64Encode(_0x24ebca),_0xb1a48b?util[_0x2257('0x7a')](_0x2257('0x7d'),encodeURIComponent(_0xb1a48b)):_0x2257('0x7e'));return uploadFile(_0x4b9f19)[_0x2257('0x27')](function(_0x4e1cff){return querystring[_0x2257('0x7f')](_0x4e1cff);});};exports['sestekNDA']=function(_0x4c9a7e,_0x4be2cd){return sestek['nda'](_0x4c9a7e,_0x4be2cd)[_0x2257('0x27')](function(_0x226f9b){logger[_0x2257('0x18')](JSON[_0x2257('0x3c')](_0x226f9b));var _0x14b987={'speech':_0x226f9b['text'],'action':_0x226f9b['channelData']?_0x226f9b[_0x2257('0x80')][_0x2257('0x81')]:undefined,'actiondata':_0x226f9b[_0x2257('0x80')]?_0x226f9b['channelData'][_0x2257('0x82')]:undefined};if(_0x226f9b[_0x2257('0x80')]&&_0x226f9b['channelData'][_0x2257('0x83')]){return base64Decode(_0x226f9b[_0x2257('0x80')][_0x2257('0x83')][_0x2257('0x84')],path['resolve'](__dirname,_0x2257('0x24'),rs[_0x2257('0x25')](0x4)+_0x2257('0x26')))[_0x2257('0x27')](function(_0xa7db7c){_0x14b987['audiofile']=_0xa7db7c;return _0x14b987;});}return _0x14b987;});};exports[_0x2257('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0x58af=['dirName','apiai-promise','bluebird','dialogflow','http','https','path','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','agi','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','unlink','pipe','end','protocol','data','transcode','wav','error\x20convert','info','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','text:synthesize','POST','from','audioContent','writeFile','tmp','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','.mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile'];(function(_0x2f695c,_0x4d7278){var _0x101d54=function(_0x4db419){while(--_0x4db419){_0x2f695c['push'](_0x2f695c['shift']());}};_0x101d54(++_0x4d7278);}(_0x58af,0x18d));var _0xf58a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x58af[_0x14add3];return _0x4a174f;};'use strict';var apiai=require(_0xf58a('0x0'));var BPromise=require(_0xf58a('0x1'));var dialogflow=require(_0xf58a('0x2'));var fs=require('fs');var http=require(_0xf58a('0x3'));var https=require(_0xf58a('0x4'));var md5=require('md5');var path=require(_0xf58a('0x5'));var querystring=require('querystring');var rp=require(_0xf58a('0x6'));var rs=require(_0xf58a('0x7'));var sox=require(_0xf58a('0x8'));var tts=require(_0xf58a('0x9'));var urlParse=require('url')[_0xf58a('0xa')];var util=require(_0xf58a('0xb'));var aws=require(_0xf58a('0xc'));var google=require('./google');var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xf58a('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2ba3dd,_0x5a1c05){return new BPromise(function(_0x2f90cc,_0x1a87fa){var _0x4a247f=urlParse(_0x2ba3dd);var _0x211481=_0x4a247f['protocol']==='https:'?https:http;var _0x380eb1={'host':_0x4a247f[_0xf58a('0xe')],'path':_0x4a247f[_0xf58a('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x211481[_0xf58a('0xf')](_0x380eb1,function(_0x79ad69){if(_0x79ad69[_0xf58a('0x10')]!==0xc8){logger[_0xf58a('0x11')](_0xf58a('0x12')+_0x2ba3dd+_0xf58a('0x13')+_0x79ad69['statusCode']+'\x20('+_0x79ad69['statusMessage']+')');_0x1a87fa(new Error(_0xf58a('0x12')+_0x2ba3dd+_0xf58a('0x13')+_0x79ad69[_0xf58a('0x10')]+'\x20('+_0x79ad69[_0xf58a('0x14')]+')'));return;}var _0x354be3=fs[_0xf58a('0x15')](_0x5a1c05);_0x354be3['on'](_0xf58a('0x16'),function(){logger['info']('finish\x20download\x20file');_0x354be3[_0xf58a('0x17')](_0x2f90cc);});_0x354be3['on'](_0xf58a('0x11'),function(_0x15747e){fs[_0xf58a('0x18')](_0x5a1c05);logger[_0xf58a('0x11')]('download\x20error',_0x15747e);_0x1a87fa(_0x15747e);});_0x79ad69[_0xf58a('0x19')](_0x354be3);})['on'](_0xf58a('0x11'),function(_0x3e1179){logger[_0xf58a('0x11')](_0x3e1179);_0x1a87fa(_0x3e1179);})[_0xf58a('0x1a')]();});}function uploadFile(_0x252e24){return new BPromise(function(_0x85dd4b,_0x4d9b16){var _0x322a8f=urlParse(_0x252e24);var _0x4d9900=_0x322a8f[_0xf58a('0x1b')]==='https:'?https:http;var _0x99e4a9={'host':_0x322a8f[_0xf58a('0xe')],'path':_0x322a8f[_0xf58a('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4d9900[_0xf58a('0xf')](_0x99e4a9,function(_0x4995ef){if(_0x4995ef[_0xf58a('0x10')]!==0xc8){_0x4d9b16(new Error(_0xf58a('0x12')+_0x252e24+_0xf58a('0x13')+_0x4995ef['statusCode']+'\x20('+_0x4995ef['statusMessage']+')'));return;}var _0x1d750f='';_0x4995ef['on'](_0xf58a('0x1c'),function(_0x497266){_0x1d750f+=_0x497266;});_0x4995ef['on']('end',function(){_0x85dd4b(_0x1d750f);});})['on'](_0xf58a('0x11'),function(_0xe62423){_0x4d9b16(_0xe62423);})[_0xf58a('0x1a')]();});}function convertFile(_0x6555c5,_0x556e0e){return new BPromise(function(_0x34631f,_0x416a69){var _0x3e13be=sox[_0xf58a('0x1d')](_0x6555c5,_0x556e0e,{'sampleRate':0x1f40,'format':_0xf58a('0x1e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e13be['on'](_0xf58a('0x11'),function(_0x48d7c7){logger['error'](_0xf58a('0x1f'),_0x48d7c7);_0x416a69(_0x48d7c7);});_0x3e13be['on'](_0xf58a('0x1a'),function(){logger[_0xf58a('0x20')]('finish\x20to\x20convert');_0x34631f();});_0x3e13be['start']();});}function base64Decode(_0x2cd3d9,_0xab50b3){var _0x54cb34=path[_0xf58a('0x21')](__dirname,'tmp',rs[_0xf58a('0x22')](0x4)+_0xf58a('0x23'));fs[_0xf58a('0x24')](_0x54cb34,_0x2cd3d9,_0xf58a('0x25'));return convertFile(_0x54cb34,_0xab50b3)[_0xf58a('0x26')](function(){try{fs[_0xf58a('0x18')](_0x54cb34);fs[_0xf58a('0x27')](_0xab50b3,'777');}catch(_0x5a3aef){logger[_0xf58a('0x11')](_0x5a3aef);}return _0xab50b3[_0xf58a('0x28')]('.')[0x0];});}function base64Encode(_0x1c41a5){var _0x104710=fs['readFileSync'](_0x1c41a5);return new Buffer(_0x104710)[_0xf58a('0x29')](_0xf58a('0x25'));}exports[_0xf58a('0x2a')]=function(_0x117304,_0x2cd330,_0xa6a6a3,_0x43f0f0,_0x320093,_0x2308a8){var _0x4c413a,_0xc7aa2d;var _0x518ac3=_0xf58a('0x2b');var _0x4608dc=_0xf58a('0x2c')+_0x117304;var _0x25f521={};if(_0x2cd330===_0xf58a('0x2d')){_0x25f521['input']={'ssml':_0xa6a6a3};}else{_0x25f521[_0xf58a('0x2e')]={'text':_0xa6a6a3};};_0x25f521[_0xf58a('0x2f')]={'languageCode':_0x43f0f0,'ssmlGender':_0x320093};_0x25f521['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0xad5489={'url':_0x518ac3+_0xf58a('0x30')+_0x4608dc,'method':_0xf58a('0x31'),'json':!![],'body':_0x25f521};return rp(_0xad5489)[_0xf58a('0x26')](function(_0x574408){return new BPromise(function(_0x42da30,_0x383245){_0x4c413a=path[_0xf58a('0x21')](__dirname,'tmp',rs[_0xf58a('0x22')](0x4)+'.mp3');var _0xd8036=Buffer[_0xf58a('0x32')](_0x574408[_0xf58a('0x33')],_0xf58a('0x25'));return fs[_0xf58a('0x34')](_0x4c413a,_0xd8036,function(_0x292a2f){_0x383245(_0x292a2f);},function(_0x33adf4){fs['chmodSync'](_0x4c413a,'777');_0x42da30(_0x33adf4);});});})[_0xf58a('0x26')](function(_0x4808fe){_0xc7aa2d=path[_0xf58a('0x21')](__dirname,_0xf58a('0x35'),rs[_0xf58a('0x22')](0x4)+_0xf58a('0x23'));return convertFile(_0x4c413a,_0xc7aa2d);})['then'](function(){try{fs['unlink'](_0x4c413a);fs[_0xf58a('0x27')](_0xc7aa2d,_0xf58a('0x36'));}catch(_0x33963c){logger['error'](_0x33963c);}logger[_0xf58a('0x20')](_0xf58a('0x37'),_0xc7aa2d['split']('.')[0x0]);return _0xc7aa2d[_0xf58a('0x28')]('.')[0x0];});};exports[_0xf58a('0x38')]=function(_0xbe6f9c,_0x28f802){var _0x339c04=_0xf58a('0x39');var _0x48452c,_0x550323;var _0x4af59c;var _0x1f62c8={'encoding':_0xf58a('0x3a'),'method':'POST','timeout':0x2710,'url':_0x339c04,'headers':{'Content-Type':_0xf58a('0x3b')},'body':_0xf58a('0x3c')+encodeURIComponent(JSON[_0xf58a('0x3d')]([[['jQ1olc',JSON['stringify']([_0xbe6f9c,_0x28f802||'en',![],_0xf58a('0x3e')]),null,_0xf58a('0x3f')]]]))};return rp(_0x1f62c8)[_0xf58a('0x26')](function(_0x5408a2){try{_0x4af59c=eval(_0x5408a2[_0xf58a('0x40')](0x5))[0x0][0x2];}catch(_0x263002){throw new Error(_0xf58a('0x41')+_0x5408a2[_0xf58a('0x1c')]);}if(!_0x4af59c){if(_0xbe6f9c[_0xf58a('0x42')]>0xc8){throw new Error(_0xf58a('0x43'));}else{throw new Error('lang\x20\x22'+_0x28f802+_0xf58a('0x44'));}}try{_0x4af59c=eval(_0x4af59c)[0x0];}catch(_0xad1890){throw new Error(_0xf58a('0x41')+res['data']);}const _0x3eb0d3=_0x4af59c;_0x48452c=path['resolve'](__dirname,_0xf58a('0x35'),rs['generate'](0x4)+'.mp3');fs['writeFileSync'](_0x48452c,_0x4af59c,{'encoding':_0xf58a('0x25')});_0x550323=path[_0xf58a('0x21')](__dirname,_0xf58a('0x35'),rs['generate'](0x4)+_0xf58a('0x23'));return convertFile(_0x48452c,_0x550323);})['then'](function(){try{fs[_0xf58a('0x18')](_0x48452c);fs['chmodSync'](_0x550323,'777');}catch(_0x3a4e3a){logger['error'](_0x3a4e3a);}logger[_0xf58a('0x20')](_0xf58a('0x45'),_0x550323['split']('.')[0x0]);return _0x550323[_0xf58a('0x28')]('.')[0x0];});};exports['googleASR']=function(_0x46e613,_0x2951f9,_0xd5b87d){return google['asr'](_0x46e613,_0x2951f9,_0xd5b87d)[_0xf58a('0x26')](function(_0x2d74a3){logger['info'](_0x2d74a3[_0xf58a('0x46')]);return rp(_0x2d74a3);})[_0xf58a('0x26')](function(_0x13d050){var _0x39eec6='';var _0x266421=0x0;try{fs[_0xf58a('0x18')](_0x46e613);}catch(_0x171170){logger[_0xf58a('0x11')](_0x171170);}if(_0x13d050&&_0x13d050[_0xf58a('0x47')]){_0x39eec6=_0x13d050[_0xf58a('0x47')]['map'](function(_0x472aea){return _0x472aea&&_0x472aea['alternatives'][0x0]&&_0x472aea[_0xf58a('0x48')][0x0]['transcript']?_0x472aea['alternatives'][0x0][_0xf58a('0x49')]:'';})[_0xf58a('0x4a')]('\x0a');_0x266421=_0x13d050['results'][_0xf58a('0x4b')](function(_0x3fc915){return _0x3fc915&&_0x3fc915[_0xf58a('0x48')][0x0]&&_0x3fc915[_0xf58a('0x48')][0x0]['confidence']?_0x3fc915[_0xf58a('0x48')][0x0][_0xf58a('0x4c')]:0x0;})[_0xf58a('0x4a')]('\x0a');}logger[_0xf58a('0x20')](_0xf58a('0x4d'),_0x39eec6);logger[_0xf58a('0x20')](_0xf58a('0x4e'),_0x266421);return{'transcript':_0x39eec6,'confidence':_0x266421};})['catch'](function(_0x15790c){logger['error'](_0xf58a('0x4f'),_0x15790c[_0xf58a('0x10')],_0x15790c[_0xf58a('0x50')],_0x15790c[_0xf58a('0x51')]);});};exports[_0xf58a('0x52')]=function(_0x30c74f,_0x1c0821,_0x3c4644,_0x388507){var _0x3c5ceb=apiai(_0x1c0821,{'language':_0x388507||'en'});return _0x3c5ceb[_0xf58a('0x53')](_0x3c4644,{'sessionId':md5(_0x30c74f)})['then'](function(_0x839fff){logger[_0xf58a('0x20')](JSON[_0xf58a('0x3d')](_0x839fff));return{'source':_0x839fff[_0xf58a('0x54')][_0xf58a('0x55')],'resolvedQuery':_0x839fff[_0xf58a('0x54')][_0xf58a('0x56')],'action':_0x839fff[_0xf58a('0x54')][_0xf58a('0x57')],'actionIncomplete':_0x839fff[_0xf58a('0x54')][_0xf58a('0x58')],'speech':_0x839fff[_0xf58a('0x54')][_0xf58a('0x59')][_0xf58a('0x5a')],'score':_0x839fff[_0xf58a('0x54')][_0xf58a('0x5b')],'statusCode':_0x839fff['status'][_0xf58a('0x5c')],'endConversation':_0x839fff['result'][_0xf58a('0x5d')]['endConversation']||![],'isFallbackIntent':_0x839fff[_0xf58a('0x54')][_0xf58a('0x5d')]['isFallbackIntent']};});};exports[_0xf58a('0x5e')]=function(_0x2d8b76,_0xecd6c9,_0x244045,_0x346d8a,_0x1309e8,_0x2ee131){var _0x2352f6=_0x346d8a[_0xf58a('0x5f')](/\\n/g,'\x0a');var _0x3d6a50={'credentials':{'private_key':_0x2352f6,'client_email':_0x244045}};var _0x57dee6=new dialogflow[(_0xf58a('0x60'))](_0x3d6a50);var _0x54428d=_0x57dee6['sessionPath'](_0xecd6c9,md5(_0x2d8b76));var _0x47528b={'session':_0x54428d,'queryInput':{'text':{'text':_0x1309e8,'languageCode':_0x2ee131}}};return _0x57dee6[_0xf58a('0x61')](_0x47528b)[_0xf58a('0x26')](function(_0x4a82c6){if(_0x4a82c6&&_0x4a82c6[_0xf58a('0x42')]){logger['info'](_0xf58a('0x62'),JSON[_0xf58a('0x3d')](_0x4a82c6));var _0x1cb7be=_0x4a82c6[0x0];if(_0x1cb7be){var _0x2eb0da={'action':_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x57')],'allRequiredParamsPresent':_0x1cb7be['queryResult'][_0xf58a('0x64')],'endConversation':_0x1cb7be['queryResult'][_0xf58a('0x65')]&&_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x65')][_0xf58a('0x66')]?_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x65')][_0xf58a('0x66')][_0xf58a('0x67')][_0xf58a('0x68')]:![],'fulfillmentText':_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x69')],'intentName':_0x1cb7be['queryResult'][_0xf58a('0x6a')][_0xf58a('0x50')],'intentDisplayName':_0x1cb7be[_0xf58a('0x63')]['intent'][_0xf58a('0x6b')],'isFallbackIntent':_0x1cb7be['queryResult'][_0xf58a('0x6a')][_0xf58a('0x6c')],'languageCode':_0x1cb7be['queryResult'][_0xf58a('0x6d')],'queryText':_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x6e')],'responseId':_0x1cb7be[_0xf58a('0x6f')],'score':_0x1cb7be['queryResult'][_0xf58a('0x70')],'speech':_0x1cb7be[_0xf58a('0x63')][_0xf58a('0x69')],'providerResponse':JSON[_0xf58a('0x3d')](_0x4a82c6)};return _0x2eb0da;}}});};exports[_0xf58a('0x71')]=function(_0x1a71db,_0x586186,_0x3ef918,_0x533519){return tilde['asr'](_0x1a71db,_0x586186,_0x3ef918,_0x533519)[_0xf58a('0x26')](function(_0x2f03f5){try{fs[_0xf58a('0x18')](_0x1a71db);}catch(_0x230d04){logger['error'](_0x230d04);}logger[_0xf58a('0x20')](_0xf58a('0x72'),_0x2f03f5['transcript']);logger[_0xf58a('0x20')]('Tilde\x20ASR\x20confidence',_0x2f03f5[_0xf58a('0x4c')]);return _0x2f03f5;});};exports['awsPolly']=function(_0x45ebbf,_0x1df445,_0x3a27d5,_0x3e635e,_0x2f7a6b,_0x439def){var _0x10f0f0=path[_0xf58a('0x21')](__dirname,'tmp',rs[_0xf58a('0x22')](0x4)+'.mp3');var _0xeb83d9;return aws[_0xf58a('0x73')](_0x45ebbf,_0x1df445,_0x3a27d5,_0x3e635e,_0x2f7a6b,_0x439def,_0x10f0f0)[_0xf58a('0x26')](function(){_0xeb83d9=path[_0xf58a('0x21')](__dirname,'tmp',rs[_0xf58a('0x22')](0x4)+_0xf58a('0x23'));return convertFile(_0x10f0f0,_0xeb83d9);})[_0xf58a('0x26')](function(){try{fs[_0xf58a('0x18')](_0x10f0f0);fs[_0xf58a('0x27')](_0xeb83d9,_0xf58a('0x36'));}catch(_0x4c853b){logger[_0xf58a('0x11')](_0x4c853b);}return _0xeb83d9[_0xf58a('0x28')]('.')[0x0];});};exports[_0xf58a('0x74')]=function(_0x7b5fb,_0x1e8df5,_0x21ac47,_0x2792b4,_0x576aad,_0x50e051){return aws['lex'](_0x7b5fb,_0x1e8df5,_0x21ac47,_0x2792b4,_0x576aad,_0x50e051)[_0xf58a('0x26')](function(_0x38d18c){logger[_0xf58a('0x20')](JSON[_0xf58a('0x3d')](_0x38d18c));return _0x38d18c;});};exports['ispeechTTS']=function(_0x13e098,_0x25b234,_0x22ad93,_0x127df1){var _0x4a6bc5=util[_0xf58a('0x75')](_0xf58a('0x76'),ISPEECH_API,_0x13e098,encodeURIComponent(_0x25b234),_0x22ad93,_0x127df1);var _0x8f960d=path['resolve'](__dirname,_0xf58a('0x35'),rs[_0xf58a('0x22')](0x4)+_0xf58a('0x77'));var _0x16bb1d;return downloadFile(_0x4a6bc5,_0x8f960d)[_0xf58a('0x26')](function(){_0x16bb1d=path[_0xf58a('0x21')](__dirname,_0xf58a('0x35'),rs[_0xf58a('0x22')](0x4)+_0xf58a('0x23'));return convertFile(_0x8f960d,_0x16bb1d);})[_0xf58a('0x26')](function(){try{fs[_0xf58a('0x18')](_0x8f960d);fs['chmodSync'](_0x16bb1d,_0xf58a('0x36'));}catch(_0x21a2da){logger[_0xf58a('0x11')](_0x21a2da);}return _0x16bb1d[_0xf58a('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x132f5a,_0x2ba54b,_0x148bf7,_0x3952cc){var _0x53ac9a=util['format'](_0xf58a('0x78'),ISPEECH_API,_0x2ba54b,_0x148bf7,base64Encode(_0x132f5a),_0x3952cc?util['format'](_0xf58a('0x79'),encodeURIComponent(_0x3952cc)):_0xf58a('0x7a'));return uploadFile(_0x53ac9a)[_0xf58a('0x26')](function(_0x47cfc9){return querystring['parse'](_0x47cfc9);});};exports['sestekNDA']=function(_0x3938e6,_0x25dd07){return sestek[_0xf58a('0x7b')](_0x3938e6,_0x25dd07)[_0xf58a('0x26')](function(_0x2cce84){logger[_0xf58a('0x20')](JSON[_0xf58a('0x3d')](_0x2cce84));var _0x21843f={'speech':_0x2cce84[_0xf58a('0x7c')],'action':_0x2cce84[_0xf58a('0x7d')]?_0x2cce84[_0xf58a('0x7d')][_0xf58a('0x7e')]:undefined,'actiondata':_0x2cce84[_0xf58a('0x7d')]?_0x2cce84[_0xf58a('0x7d')][_0xf58a('0x7f')]:undefined};if(_0x2cce84[_0xf58a('0x7d')]&&_0x2cce84['channelData'][_0xf58a('0x80')]){return base64Decode(_0x2cce84[_0xf58a('0x7d')][_0xf58a('0x80')][_0xf58a('0x81')],path[_0xf58a('0x21')](__dirname,'tmp',rs[_0xf58a('0x22')](0x4)+_0xf58a('0x23')))[_0xf58a('0x26')](function(_0x5e31f3){_0x21843f[_0xf58a('0x82')]=_0x5e31f3;return _0x21843f;});}return _0x21843f;});};exports[_0xf58a('0x83')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 1e83448..aa5c192 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 _0x946d=['./nda','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x946d,0x1f2));var _0xd946=function(_0x586266,_0x21ce2b){_0x586266=_0x586266-0x0;var _0x4df015=_0x946d[_0x586266];return _0x4df015;};var nda=require(_0xd946('0x0'));module[_0xd946('0x1')]={'nda':nda}; \ No newline at end of file +var _0x160b=['./nda','exports'];(function(_0x2a456a,_0x3d2722){var _0x1cc7b0=function(_0x201cae){while(--_0x201cae){_0x2a456a['push'](_0x2a456a['shift']());}};_0x1cc7b0(++_0x3d2722);}(_0x160b,0x7c));var _0xb160=function(_0x26b9ca,_0x18388f){_0x26b9ca=_0x26b9ca-0x0;var _0xb02ace=_0x160b[_0x26b9ca];return _0xb02ace;};var nda=require(_0xb160('0x0'));module[_0xb160('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index e20147d..1bba5d9 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 _0x8a9d=['calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','url','agi','exports','resolve','ndauth_url','/token','username','password','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x5a0f53,_0x3cf8a4){_0x5a0f53=_0x5a0f53-0x0;var _0x262793=_0x8a9d[_0x5a0f53];return _0x262793;};'use strict';var rp=require(_0xd8a9('0x0'));var url=require(_0xd8a9('0x1'));var logger=require('../../../../../config/logger')(_0xd8a9('0x2'));module[_0xd8a9('0x3')]=function(_0x502276,_0x32b520){var _0x4c3805={'method':'POST','uri':url[_0xd8a9('0x4')](_0x32b520[_0xd8a9('0x5')],_0xd8a9('0x6')),'form':{'grant_type':'password','username':_0x32b520[_0xd8a9('0x7')],'password':_0x32b520[_0xd8a9('0x8')]},'json':!![]};return rp(_0x4c3805)[_0xd8a9('0x9')](function(_0x5610b7){var _0x5c3949={'method':_0xd8a9('0xa'),'uri':url[_0xd8a9('0x4')](_0x32b520['ndassistant_url'],_0xd8a9('0xb')),'body':{'type':_0x32b520[_0xd8a9('0xc')]||_0xd8a9('0xd'),'channelId':_0xd8a9('0xe'),'conversation':{'id':_0x502276[_0xd8a9('0xf')]},'from':{'id':_0x502276[_0xd8a9('0x10')],'name':_0x502276[_0xd8a9('0x11')]},'recipient':{'id':_0x502276[_0xd8a9('0x12')],'name':_0x502276[_0xd8a9('0x13')]},'text':_0x32b520[_0xd8a9('0x14')],'channelData':{}},'headers':{'Authorization':_0xd8a9('0x15')+_0x5610b7[_0xd8a9('0x16')]},'json':!![]};if(_0x32b520[_0xd8a9('0x17')]){_0x5c3949[_0xd8a9('0x18')][_0xd8a9('0x19')][_0xd8a9('0x1a')]=_0x32b520['project'];}if(_0x32b520[_0xd8a9('0x1b')]=='1'){_0x5c3949['body'][_0xd8a9('0x19')][_0xd8a9('0x1c')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xd8a9('0x1d')};}if(_0x32b520['custom_action']){_0x5c3949['body'][_0xd8a9('0x19')]['CustomAction']=_0x32b520[_0xd8a9('0x1e')];if(_0x32b520[_0xd8a9('0x1f')]){_0x5c3949[_0xd8a9('0x18')][_0xd8a9('0x19')]['CustomActionData']=_0x32b520[_0xd8a9('0x1f')];}}logger[_0xd8a9('0x20')](JSON[_0xd8a9('0x21')](_0x5c3949));return rp(_0x5c3949);});}; \ No newline at end of file +var _0x67da=['POST','resolve','ndauth_url','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','channelData','project','AudioOutputSettings','custom_action','body','CustomAction','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports'];(function(_0x1ce1c6,_0x1256a4){var _0x636ef8=function(_0x2f9157){while(--_0x2f9157){_0x1ce1c6['push'](_0x1ce1c6['shift']());}};_0x636ef8(++_0x1256a4);}(_0x67da,0x192));var _0xa67d=function(_0x104e17,_0x3d4cc9){_0x104e17=_0x104e17-0x0;var _0x599e09=_0x67da[_0x104e17];return _0x599e09;};'use strict';var rp=require('request-promise');var url=require(_0xa67d('0x0'));var logger=require(_0xa67d('0x1'))(_0xa67d('0x2'));module[_0xa67d('0x3')]=function(_0x472755,_0x3633a0){var _0x1f58c8={'method':_0xa67d('0x4'),'uri':url[_0xa67d('0x5')](_0x3633a0[_0xa67d('0x6')],'/token'),'form':{'grant_type':'password','username':_0x3633a0[_0xa67d('0x7')],'password':_0x3633a0['password']},'json':!![]};return rp(_0x1f58c8)[_0xa67d('0x8')](function(_0x2346f4){var _0x10f89a={'method':_0xa67d('0x4'),'uri':url[_0xa67d('0x5')](_0x3633a0[_0xa67d('0x9')],_0xa67d('0xa')),'body':{'type':_0x3633a0[_0xa67d('0xb')]||_0xa67d('0xc'),'channelId':_0xa67d('0xd'),'conversation':{'id':_0x472755['uniqueid']},'from':{'id':_0x472755[_0xa67d('0xe')],'name':_0x472755[_0xa67d('0xf')]},'recipient':{'id':_0x472755[_0xa67d('0x10')],'name':_0x472755[_0xa67d('0x11')]},'text':_0x3633a0['text'],'channelData':{}},'headers':{'Authorization':_0xa67d('0x12')+_0x2346f4[_0xa67d('0x13')]},'json':!![]};if(_0x3633a0['project']){_0x10f89a['body'][_0xa67d('0x14')]['ProjectName']=_0x3633a0[_0xa67d('0x15')];}if(_0x3633a0['ndagenerate_audio']=='1'){_0x10f89a['body'][_0xa67d('0x14')][_0xa67d('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3633a0[_0xa67d('0x17')]){_0x10f89a[_0xa67d('0x18')][_0xa67d('0x14')][_0xa67d('0x19')]=_0x3633a0['custom_action'];if(_0x3633a0['custom_action_data']){_0x10f89a['body']['channelData'][_0xa67d('0x1a')]=_0x3633a0['custom_action_data'];}}logger[_0xa67d('0x1b')](JSON[_0xa67d('0x1c')](_0x10f89a));return rp(_0x10f89a);});}; \ 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 69e4ae5..bc6753e 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 _0x5f96=['./lib/api','exports'];(function(_0x44cc74,_0x426cda){var _0x8761b4=function(_0xc9e735){while(--_0xc9e735){_0x44cc74['push'](_0x44cc74['shift']());}};_0x8761b4(++_0x426cda);}(_0x5f96,0xbc));var _0x65f9=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x5f96[_0x341e0f];return _0x59555a;};'use strict';var asr=require(_0x65f9('0x0'));module[_0x65f9('0x1')]=function(_0x2207e5,_0x459d64,_0x2f6bc1,_0x257372){return asr(_0x2207e5,_0x459d64,_0x2f6bc1,_0x257372);}; \ No newline at end of file +var _0x3911=['exports','./lib/api'];(function(_0x3de01a,_0xcc1fd4){var _0x43f31e=function(_0xf8e692){while(--_0xf8e692){_0x3de01a['push'](_0x3de01a['shift']());}};_0x43f31e(++_0xcc1fd4);}(_0x3911,0xb3));var _0x1391=function(_0x58f83c,_0x563967){_0x58f83c=_0x58f83c-0x0;var _0x5d2f70=_0x3911[_0x58f83c];return _0x5d2f70;};'use strict';var asr=require(_0x1391('0x0'));module[_0x1391('0x1')]=function(_0xee8a82,_0x310d2e,_0x365b85,_0x159bdb){return asr(_0xee8a82,_0x310d2e,_0x365b85,_0x159bdb);}; \ 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 caf0db8..b611ec4 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 _0xa9e6=['../../../../../../config/logger','agi','exports','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','sha1','update','digest','hex','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xa9e6,0x196));var _0x6a9e=function(_0x12552c,_0x3e4bb7){_0x12552c=_0x12552c-0x0;var _0x2bbb21=_0xa9e6[_0x12552c];return _0x2bbb21;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6a9e('0x0'));var crypto=require('crypto');var logger=require(_0x6a9e('0x1'))(_0x6a9e('0x2'));module[_0x6a9e('0x3')]=function(_0x41ac45,_0x3fd22d,_0x534c9d,_0x45b21f){return new BPromise(function(_0x16ab07,_0x16bd4a){logger[_0x6a9e('0x4')](_0x6a9e('0x5'),_0x45b21f||_0x6a9e('0x6'));var _0x38371b=new WebSocket(_0x45b21f||_0x6a9e('0x6'),{'perMessageDeflate':![]});var _0x118551='';var _0x27ed2c='0';var _0x3f764e='1';var _0x454139=_0x6a9e('0x7');function _0x1dad8c(_0x5da3fa){var _0x19d2bd=crypto['createHash'](_0x6a9e('0x8'));_0x19d2bd[_0x6a9e('0x9')](_0x5da3fa);return _0x19d2bd[_0x6a9e('0xa')](_0x6a9e('0xb'));}function _0x1da7c2(){try{logger[_0x6a9e('0x4')]('Open\x20Tilde\x20ASR\x20socket');var _0x1cd30e=moment()[_0x6a9e('0xc')]();var _0x203f7c=_0x1dad8c(_0x1cd30e+_0x3fd22d+_0x534c9d);_0x38371b[_0x6a9e('0xd')](JSON['stringify']({'appID':_0x3fd22d,'timestamp':_0x1cd30e,'appKey':_0x203f7c}));var _0x5b78ac=fs[_0x6a9e('0xe')](_0x41ac45);_0x5b78ac['on'](_0x6a9e('0xf'),function(_0x437054){_0x38371b['send'](_0x437054);});_0x5b78ac['on'](_0x6a9e('0x10'),function(){_0x38371b[_0x6a9e('0xd')](_0x6a9e('0x11'));});}catch(_0x464cbe){logger[_0x6a9e('0x12')](_0x6a9e('0x13'),JSON[_0x6a9e('0x14')](_0x464cbe));_0x38371b[_0x6a9e('0x15')]();}}function _0x3450e8(_0x59644c){try{if(_0x59644c){var _0x170a5a=JSON['parse'](_0x59644c);switch(_0x170a5a[_0x6a9e('0x16')]){case 0x0:if(_0x170a5a[_0x6a9e('0x17')]){if(_0x170a5a[_0x6a9e('0x17')]['final']){logger[_0x6a9e('0x4')](_0x6a9e('0x18'),JSON[_0x6a9e('0x14')](_0x170a5a[_0x6a9e('0x17')][_0x6a9e('0x19')]));_0x118551=_0x170a5a[_0x6a9e('0x17')][_0x6a9e('0x19')][0x0][_0x6a9e('0x1a')];_0x27ed2c=_0x170a5a[_0x6a9e('0x17')]['hypotheses'][0x0][_0x6a9e('0x1b')];_0x3f764e='0';_0x454139=_0x6a9e('0x1c');_0x38371b[_0x6a9e('0x15')]();}}break;case 0x1:logger[_0x6a9e('0x4')](_0x6a9e('0x7'));_0x3f764e='1';_0x454139=_0x6a9e('0x7');break;case 0x2:logger[_0x6a9e('0x4')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x3f764e='2';_0x454139='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x6a9e('0x4')](_0x6a9e('0x1d'));_0x3f764e='9';_0x454139=_0x6a9e('0x1d');break;case 0xa:logger[_0x6a9e('0x4')](_0x6a9e('0x1e'));_0x3f764e='10';_0x454139=_0x6a9e('0x1e');break;case 0xb:logger[_0x6a9e('0x4')](_0x6a9e('0x1f'));_0x3f764e='11';_0x454139=_0x6a9e('0x1f');}}}catch(_0x14efa3){logger[_0x6a9e('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x6a9e('0x14')](_0x14efa3));_0x38371b[_0x6a9e('0x15')]();}}function _0x22e2e0(){logger[_0x6a9e('0x4')](_0x6a9e('0x20'));_0x16ab07({'transcript':_0x118551,'confidence':_0x27ed2c,'status':_0x3f764e,'status_message':_0x454139});}function _0x2e5dda(_0x2f5333){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x6a9e('0x21')](_0x2f5333)){logger['error'](_[_0x6a9e('0x22')](_0x2f5333)?JSON['stringify'](_0x2f5333):_0x2f5333);}}_0x38371b['on'](_0x6a9e('0x23'),_0x1da7c2);_0x38371b['on'](_0x6a9e('0x24'),_0x3450e8);_0x38371b['on'](_0x6a9e('0x10'),_0x22e2e0);_0x38371b['on'](_0x6a9e('0x12'),_0x2e5dda);});}; \ No newline at end of file +var _0xc592=['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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI'];(function(_0x4b57b3,_0x11bb04){var _0x441f88=function(_0x5ccf54){while(--_0x5ccf54){_0x4b57b3['push'](_0x4b57b3['shift']());}};_0x441f88(++_0x11bb04);}(_0xc592,0x1e5));var _0x2c59=function(_0x2b2ac9,_0x30c0fe){_0x2b2ac9=_0x2b2ac9-0x0;var _0xb8173=_0xc592[_0x2b2ac9];return _0xb8173;};'use strict';var BPromise=require(_0x2c59('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2c59('0x1'));var crypto=require(_0x2c59('0x2'));var logger=require(_0x2c59('0x3'))(_0x2c59('0x4'));module[_0x2c59('0x5')]=function(_0x20097,_0x504a49,_0x5f5466,_0x21214b){return new BPromise(function(_0x2b7946,_0x859db7){logger['info'](_0x2c59('0x6'),_0x21214b||_0x2c59('0x7'));var _0x40a836=new WebSocket(_0x21214b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x37715c='';var _0x1c6d55='0';var _0x418a89='1';var _0x4cb9cf=_0x2c59('0x8');function _0x214965(_0xa9977d){var _0x353b57=crypto[_0x2c59('0x9')](_0x2c59('0xa'));_0x353b57[_0x2c59('0xb')](_0xa9977d);return _0x353b57[_0x2c59('0xc')](_0x2c59('0xd'));}function _0x3af6c0(){try{logger[_0x2c59('0xe')](_0x2c59('0xf'));var _0x1ea8f6=moment()[_0x2c59('0x10')]();var _0x1a7365=_0x214965(_0x1ea8f6+_0x504a49+_0x5f5466);_0x40a836[_0x2c59('0x11')](JSON['stringify']({'appID':_0x504a49,'timestamp':_0x1ea8f6,'appKey':_0x1a7365}));var _0x3ff402=fs[_0x2c59('0x12')](_0x20097);_0x3ff402['on']('data',function(_0x56213f){_0x40a836[_0x2c59('0x11')](_0x56213f);});_0x3ff402['on'](_0x2c59('0x13'),function(){_0x40a836['send'](_0x2c59('0x14'));});}catch(_0x55ecda){logger[_0x2c59('0x15')](_0x2c59('0x16'),JSON[_0x2c59('0x17')](_0x55ecda));_0x40a836[_0x2c59('0x18')]();}}function _0x3e6ba9(_0x5020c0){try{if(_0x5020c0){var _0x22430a=JSON['parse'](_0x5020c0);switch(_0x22430a[_0x2c59('0x19')]){case 0x0:if(_0x22430a[_0x2c59('0x1a')]){if(_0x22430a[_0x2c59('0x1a')][_0x2c59('0x1b')]){logger[_0x2c59('0xe')]('Tilde\x20ASR\x20hypoteses',JSON[_0x2c59('0x17')](_0x22430a[_0x2c59('0x1a')][_0x2c59('0x1c')]));_0x37715c=_0x22430a[_0x2c59('0x1a')][_0x2c59('0x1c')][0x0]['transcript'];_0x1c6d55=_0x22430a[_0x2c59('0x1a')][_0x2c59('0x1c')][0x0][_0x2c59('0x1d')];_0x418a89='0';_0x4cb9cf=_0x2c59('0x1e');_0x40a836[_0x2c59('0x18')]();}}break;case 0x1:logger[_0x2c59('0xe')](_0x2c59('0x8'));_0x418a89='1';_0x4cb9cf=_0x2c59('0x8');break;case 0x2:logger['info'](_0x2c59('0x1f'));_0x418a89='2';_0x4cb9cf='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x418a89='9';_0x4cb9cf=_0x2c59('0x20');break;case 0xa:logger[_0x2c59('0xe')](_0x2c59('0x21'));_0x418a89='10';_0x4cb9cf=_0x2c59('0x21');break;case 0xb:logger[_0x2c59('0xe')](_0x2c59('0x22'));_0x418a89='11';_0x4cb9cf=_0x2c59('0x22');}}}catch(_0x5e67df){logger[_0x2c59('0x15')](_0x2c59('0x23'),JSON[_0x2c59('0x17')](_0x5e67df));_0x40a836[_0x2c59('0x18')]();}}function _0x193f1f(){logger[_0x2c59('0xe')](_0x2c59('0x24'));_0x2b7946({'transcript':_0x37715c,'confidence':_0x1c6d55,'status':_0x418a89,'status_message':_0x4cb9cf});}function _0x37ccfc(_0x98de9c){logger[_0x2c59('0x15')](_0x2c59('0x25'));if(!_[_0x2c59('0x26')](_0x98de9c)){logger[_0x2c59('0x15')](_['isObject'](_0x98de9c)?JSON['stringify'](_0x98de9c):_0x98de9c);}}_0x40a836['on'](_0x2c59('0x27'),_0x3af6c0);_0x40a836['on'](_0x2c59('0x28'),_0x3e6ba9);_0x40a836['on'](_0x2c59('0x13'),_0x193f1f);_0x40a836['on'](_0x2c59('0x15'),_0x37ccfc);});}; \ 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 10cb4be..0259add 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xf319=['./asr'];(function(_0x335a62,_0xfafea4){var _0x249a9a=function(_0xb3a9a5){while(--_0xb3a9a5){_0x335a62['push'](_0x335a62['shift']());}};_0x249a9a(++_0xfafea4);}(_0xf319,0xe5));var _0x9f31=function(_0x498025,_0x11c142){_0x498025=_0x498025-0x0;var _0x71ceee=_0xf319[_0x498025];return _0x71ceee;};var asr=require(_0x9f31('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4941c8d..091f3ae 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x2cfc4e,_0x155bd9){var _0x4788ac=function(_0x9c86ba){while(--_0x9c86ba){_0x2cfc4e['push'](_0x2cfc4e['shift']());}};_0x4788ac(++_0x155bd9);}(_0x34e8,0x12c));var _0x834e=function(_0x274912,_0x3c5cc5){_0x274912=_0x274912-0x0;var _0x4bdbdc=_0x34e8[_0x274912];return _0x4bdbdc;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ 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(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0xe706,0xa3));var _0x6e70=function(_0x282f68,_0x239640){_0x282f68=_0x282f68-0x0;var _0x1aba38=_0xe706[_0x282f68];return _0x1aba38;};'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 903562c..a0071f8 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 _0xf3cd=['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','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','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','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','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','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','url','timeout','number','POST','method','body','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','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','agicommand','hasOwnProperty','isString','replaceAllVariables','isPlainObject','isArray','length','saveRestApiResult','setVariable','%s.%s','replaceObjectAllVariables','recursiveNodeIndex','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','sestekasr'];(function(_0x4bd8b3,_0x417066){var _0x38062b=function(_0x3c22fd){while(--_0x3c22fd){_0x4bd8b3['push'](_0x4bd8b3['shift']());}};_0x38062b(++_0x417066);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xf3cd[_0x28d18d];return _0x470640;};'use strict';var fs=require('fs');var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var sh=require(_0xdf3c('0x2'));var odbc=require(_0xdf3c('0x3'))();var rs=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var Mustache=require('mustache');var rp=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var scripts=require(_0xdf3c('0x9'));var FILES_PATH=_0xdf3c('0xa');var recursiveMapAttributes=[_0xdf3c('0xb'),_0xdf3c('0xc')];var verticesWithRetry=[_0xdf3c('0xd'),_0xdf3c('0xe'),'getsecretdigits'];var AGIVertices=function(_0x15705d,_0x52cf30,_0x52f855){this[_0xdf3c('0xf')]=_0x15705d;this[_0xdf3c('0x10')]=_0x52cf30;this['mailRpc']=_0x52f855;};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x12')]=function(_0x2d420c,_0x21a6e5){this[_0xdf3c('0x10')][_0xdf3c('0x13')](_0x2d420c)[_0xdf3c('0x14')](function(_0x32d2db){_0x21a6e5(null,_0x32d2db?_0x32d2db['name']:![]);})[_0xdf3c('0x15')](function(_0x166ae5){_0x21a6e5(_0x166ae5);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x16')]=function(_0x59e431,_0x2ae4ad){this[_0xdf3c('0x10')][_0xdf3c('0x17')](_0x59e431)['then'](function(_0x18aafa){_0x2ae4ad(null,_0x18aafa?_0x18aafa[_0xdf3c('0x18')]:![]);})[_0xdf3c('0x15')](function(_0x4274fd){_0x2ae4ad(_0x4274fd);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x19')]=function(_0x305ea5,_0x92008b){this[_0xdf3c('0x10')][_0xdf3c('0x1a')](_0x305ea5)['then'](function(_0x13b0e6){_0x92008b(null,_0x13b0e6?_0x13b0e6[_0xdf3c('0x18')]:![]);})[_0xdf3c('0x15')](function(_0x18d4ec){_0x92008b(_0x18d4ec);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1b')]=function(_0x16b02b,_0x3ee0af){this[_0xdf3c('0x10')][_0xdf3c('0x1c')](_0x16b02b)[_0xdf3c('0x14')](function(_0x3d14cc){_0x3ee0af(null,_0x3d14cc?_0x3d14cc[_0xdf3c('0x1d')]:![]);})['catch'](function(_0x4d620f){_0x3ee0af(_0x4d620f);});};AGIVertices[_0xdf3c('0x11')]['getUser']=function(_0x15776c,_0x40e7ec){this[_0xdf3c('0x10')][_0xdf3c('0x1e')](_0x15776c)[_0xdf3c('0x14')](function(_0x36ba1c){_0x40e7ec(null,_0x36ba1c?_0x36ba1c['name']:![]);})[_0xdf3c('0x15')](function(_0x213d75){_0x40e7ec(_0x213d75);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1f')]=function(_0x40032a,_0x3b5371){this[_0xdf3c('0x10')][_0xdf3c('0x20')](_0x40032a)[_0xdf3c('0x14')](function(_0x1adee4){_0x3b5371(null,_0x1adee4?_0x1adee4['name']:![]);})[_0xdf3c('0x15')](function(_0x153daa){_0x3b5371(_0x153daa);});};AGIVertices['prototype'][_0xdf3c('0x21')]=function(_0x59659e,_0x4eaced){var _0x508be9=this;this[_0xdf3c('0x10')][_0xdf3c('0x22')](_0x59659e)['then'](function(_0x5c3b5a){_0x4eaced(null,_0x5c3b5a?_0x508be9[_0xdf3c('0x23')](_0x5c3b5a[_0xdf3c('0x24')]):![]);})[_0xdf3c('0x15')](function(_0x1ccdd4){_0x4eaced(_0x1ccdd4);});};AGIVertices['prototype'][_0xdf3c('0x25')]=function(_0x2a2d94,_0x5386bf){this['rpc'][_0xdf3c('0x26')](_0x2a2d94)[_0xdf3c('0x14')](function(_0x36937e){_0x5386bf(null,_0x36937e?_0x36937e:![]);})['catch'](function(_0x2355f6){_0x5386bf(_0x2355f6);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x27')]=function(_0x10099e,_0x575ae1,_0xda0de0){this[_0xdf3c('0x28')]['sendMailMessage'](_0x10099e,_0x575ae1)[_0xdf3c('0x14')](function(){_0xda0de0(null);})[_0xdf3c('0x15')](function(_0x217a65){_0xda0de0(_0x217a65);});};AGIVertices[_0xdf3c('0x11')]['getIntervals']=function(_0x33632f,_0x360d5c){this[_0xdf3c('0x10')][_0xdf3c('0x29')](_0x33632f)['then'](function(_0x474564){if(_0x474564){if(_0x474564[_0xdf3c('0x2a')]){_0x360d5c(null,[_0x474564['interval']]);}else{_0x360d5c(null,_['map'](_0x474564[_0xdf3c('0x2b')],'interval'));}}else{_0x360d5c(null,![]);}})[_0xdf3c('0x15')](function(_0x5e8130){_0x360d5c(_0x5e8130);});};AGIVertices['prototype']['getSoundPath']=function(_0x44a478){return util[_0xdf3c('0x2c')](_0xdf3c('0x2d'),FILES_PATH,_0x44a478);};AGIVertices[_0xdf3c('0x11')]['getQueryOdbc']=function(_0x49f147,_0x3d8557,_0x49d0f0){odbc[_0xdf3c('0x2e')](_0x49f147,function(_0x17b502){if(_0x17b502){logger[_0xdf3c('0x2f')](_0xdf3c('0x30'),_0x17b502);_0x49d0f0(_0x17b502);}else{logger[_0xdf3c('0x31')](_0xdf3c('0x32'));odbc[_0xdf3c('0x33')](_0x3d8557,function(_0x809f3d,_0x398c76){if(_0x809f3d){logger['info'](_0xdf3c('0x34'),_0x3d8557);_0x49d0f0(_0x809f3d);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x3d8557);odbc[_0xdf3c('0x35')](function(_0x47f760){if(_0x47f760){logger[_0xdf3c('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x47f760);}_0x49d0f0(null,_0x398c76);});}});}});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x36')]=function(_0x1c6dee,_0x1349a4){this[_0xdf3c('0x10')][_0xdf3c('0x37')](_0x1c6dee)[_0xdf3c('0x14')](function(_0x3d47fb){_0x1349a4(null,_0x3d47fb?_0x3d47fb:![]);})[_0xdf3c('0x15')](function(_0xa65478){_0x1349a4(_0xa65478);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x38')]=function(_0x57e0ab,_0x5be92d){this[_0xdf3c('0x10')]['createSmsMessage'](_0x57e0ab)[_0xdf3c('0x14')](function(_0x14d8e1){_0x5be92d(null,_0x14d8e1);})[_0xdf3c('0x15')](function(_0x328b18){_0x5be92d(_0x328b18);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x335c1b,_0x33edab,_0x106975){this['rpc'][_0xdf3c('0x39')]({'uniqueid':this[_0xdf3c('0xf')][_0xdf3c('0x3a')],'node':_0x335c1b[_0xdf3c('0x3b')],'application':_0x335c1b['agicommand'],'data':_0x33edab||null,'project_name':this[_0xdf3c('0xf')][_0xdf3c('0x3c')],'callerid':this[_0xdf3c('0xf')][_0xdf3c('0x3d')]})[_0xdf3c('0x14')](function(_0x55849e){if(_0x106975){_0x106975(null,_0x55849e);}})[_0xdf3c('0x15')](function(_0x286b72){if(_0x106975){_0x106975(_0x286b72);}});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x3e')]=function(_0x36962d,_0x344f1e,_0x555389,_0x4d6349){this[_0xdf3c('0x10')][_0xdf3c('0x3e')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xdf3c('0xf')][_0xdf3c('0x3d')],'calleridname':this[_0xdf3c('0xf')][_0xdf3c('0x3f')],'context':this[_0xdf3c('0xf')][_0xdf3c('0x40')],'extension':this[_0xdf3c('0xf')][_0xdf3c('0x41')],'priority':this[_0xdf3c('0xf')]['priority'],'accountcode':this[_0xdf3c('0xf')][_0xdf3c('0x42')],'dnid':this[_0xdf3c('0xf')][_0xdf3c('0x43')],'projectName':this[_0xdf3c('0xf')][_0xdf3c('0x3c')],'saveName':_0x344f1e,'filename':_0x36962d[_0xdf3c('0x44')]||_0x344f1e,'savePath':_0x555389})['then'](function(_0x1751a8){_0x4d6349(null,_0x1751a8);})['catch'](function(_0xa4e137){_0x4d6349(_0xa4e137);});};AGIVertices['prototype'][_0xdf3c('0x45')]=function(_0x28144f,_0x2ec575,_0x94c5b9,_0x5eef94,_0x55da0f){this['rpc'][_0xdf3c('0x45')]({'uniqueid':this['channel'][_0xdf3c('0x3a')],'body':_0x28144f,'direction':_0x2ec575,'providerName':_0x94c5b9,'providerResponse':_0x5eef94})[_0xdf3c('0x14')](function(_0x446713){if(_0x55da0f){_0x55da0f(null,_0x446713);}})[_0xdf3c('0x15')](function(_0x3b17d9){if(_0x55da0f){_0x55da0f(_0x3b17d9);}});};AGIVertices['prototype']['createCmContact']=function(_0x2371aa,_0x27a541){this['rpc'][_0xdf3c('0x46')]({'firstName':_[_0xdf3c('0x47')](_0x2371aa[_0xdf3c('0x18')])||_[_0xdf3c('0x48')](_0x2371aa[_0xdf3c('0x18')])?_0xdf3c('0x49')+Math[_0xdf3c('0x4a')]():_0x2371aa['name'],'lastName':_['isEmpty'](_0x2371aa[_0xdf3c('0x4b')])||_[_0xdf3c('0x48')](_0x2371aa[_0xdf3c('0x4b')])?null:_0x2371aa[_0xdf3c('0x4b')],'phone':_0x2371aa[_0xdf3c('0x4c')],'ListId':_0x2371aa[_0xdf3c('0x4d')],'scheduledat':_0x2371aa[_0xdf3c('0x4e')],'callbackUniqueid':this[_0xdf3c('0xf')][_0xdf3c('0x3a')],'tags':_0xdf3c('0x4f'),'description':_0xdf3c('0x50')+_0x2371aa['scheduledAt'][_0xdf3c('0x51')](),'priority':_0x2371aa['callback_priority']})['then'](function(_0x5052d5){_0x27a541(null,_0x5052d5);})['catch'](function(_0x541c57){_0x27a541(_0x541c57);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x52')]=function(_0x5c53cd,_0x4257c4){this[_0xdf3c('0x10')]['getPauseById'](_0x5c53cd)[_0xdf3c('0x14')](function(_0x28f935){_0x4257c4(null,_0x28f935?_0x28f935[_0xdf3c('0x18')]:![]);})[_0xdf3c('0x15')](function(_0x396461){_0x4257c4(_0x396461);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x53')]=function(_0xdc859,_0x42efa2,_0xa05518){var _0x55e29b={'role':'agent'};_0x55e29b[_0xdc859]=this[_0xdf3c('0xf')][_0xdf3c('0x3d')];this[_0xdf3c('0x10')]['agentPause'](_0x55e29b,_0x42efa2,this[_0xdf3c('0xf')][_0xdf3c('0x3a')])[_0xdf3c('0x14')](function(_0x552264){_0xa05518(null,_[_0xdf3c('0x48')](_0x552264)?![]:!![]);})[_0xdf3c('0x15')](function(_0x5ca218){logger[_0xdf3c('0x2f')](_0x5ca218);_0xa05518(null,![]);});};AGIVertices['prototype'][_0xdf3c('0x54')]=function(_0x1b03e7,_0x163adc){var _0x3de07e={'role':_0xdf3c('0x55')};_0x3de07e[_0x1b03e7]=this[_0xdf3c('0xf')][_0xdf3c('0x3d')];this[_0xdf3c('0x10')][_0xdf3c('0x54')](_0x3de07e)[_0xdf3c('0x14')](function(_0x283be2){_0x163adc(null,_[_0xdf3c('0x48')](_0x283be2)?![]:!![]);})[_0xdf3c('0x15')](function(_0x206a18){logger[_0xdf3c('0x2f')](_0x206a18);_0x163adc(null,![]);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x56')]=function(_0x510538,_0x4dade5){var _0x2e8511={'role':_0xdf3c('0x55')};_0x2e8511[_0x510538]=this[_0xdf3c('0xf')]['callerid'];this[_0xdf3c('0x10')]['agentLogout'](_0x2e8511)['then'](function(_0x184952){_0x4dade5(null,_[_0xdf3c('0x48')](_0x184952)?![]:!![]);})[_0xdf3c('0x15')](function(_0x373a3e){logger[_0xdf3c('0x2f')](_0x373a3e);_0x4dade5(null,![]);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x57')]=function(_0x3ec03a,_0x3dbf6e){var _0x17b9b6={'role':_0xdf3c('0x55')};_0x17b9b6[_0x3ec03a]=this[_0xdf3c('0xf')][_0xdf3c('0x3d')];var _0x4be79a=_0x3ec03a!=_0xdf3c('0x58')?util[_0xdf3c('0x2c')](_0xdf3c('0x59'),_0xdf3c('0x5a'),this[_0xdf3c('0xf')]['callerid']):undefined;this[_0xdf3c('0x10')][_0xdf3c('0x57')](_0x17b9b6,_0x4be79a)[_0xdf3c('0x14')](function(_0x12d791){_0x3dbf6e(null,_[_0xdf3c('0x48')](_0x12d791)?![]:!![]);})[_0xdf3c('0x15')](function(_0x3c0a8d){logger[_0xdf3c('0x2f')](_0x3c0a8d);_0x3dbf6e(null,![]);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x5b')]=function(_0x55010b,_0xb867a1){sh[_0xdf3c('0x5c')](_[_0xdf3c('0x5d')](_0x55010b),function(_0x1de114,_0x165afb){var _0x128187=_0x165afb[_0xdf3c('0x5e')](/(\r\n|\n|\r)/gm,'');_0xb867a1(null,_0x128187);});};AGIVertices['prototype'][_0xdf3c('0x5f')]=function(_0x662fd5,_0x4e1b77){scripts['googleCloudTTS'](_0x662fd5[_0xdf3c('0x60')],_0x662fd5[_0xdf3c('0x61')]||_0xdf3c('0x62'),_0x662fd5[_0xdf3c('0x62')],_0x662fd5[_0xdf3c('0x63')]||_0xdf3c('0x64'),_0x662fd5[_0xdf3c('0x65')]||_0xdf3c('0x66'),_0x662fd5['audioEncoding']||_0xdf3c('0x67'))[_0xdf3c('0x14')](function(_0x41ab61){_0x4e1b77(null,_0x41ab61);})['catch'](function(_0x44a249){_0x4e1b77(_0x44a249);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x68')]=function(_0x4ff52a,_0x11c5a5){scripts[_0xdf3c('0x68')](_0x4ff52a[_0xdf3c('0x62')],_0x4ff52a[_0xdf3c('0x69')]||'en',0x1)[_0xdf3c('0x14')](function(_0x12f737){_0x11c5a5(null,_0x12f737);})['catch'](function(_0x50753f){_0x11c5a5(_0x50753f);});};AGIVertices['prototype']['restAPI']=function(_0x59c505,_0x2a4e4c){var _0x3f43a0={'uri':_0x59c505[_0xdf3c('0x6a')],'method':_0x59c505['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x59c505[_0xdf3c('0x6b')])===_0xdf3c('0x6c')&&parseInt(_0x59c505[_0xdf3c('0x6b')])>=0x1?parseInt(_0x59c505['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xdf3c('0x6d'),'PUT'],_0x3f43a0[_0xdf3c('0x6e')]['toUpperCase']())){try{_0x3f43a0[_0xdf3c('0x6f')]=_0x59c505[_0xdf3c('0xc')]?JSON[_0xdf3c('0x70')](_0x59c505[_0xdf3c('0xc')]):{};}catch(_0x5316ef){logger['error'](_0xdf3c('0x71'),_0x5316ef);}}try{_0x3f43a0[_0xdf3c('0x72')]=_0x59c505[_0xdf3c('0xb')]?JSON[_0xdf3c('0x70')](_0x59c505[_0xdf3c('0xb')]):{};}catch(_0xa5773a){logger['error'](_0xdf3c('0x73'),_0xa5773a);}if(_0x59c505['computedVariables']){try{var _0x40c8fc=require(_0x59c505[_0xdf3c('0x74')])[_0xdf3c('0x75')](this,_0x3f43a0);_0x3f43a0[_0xdf3c('0x76')]=Mustache[_0xdf3c('0x77')](_0x59c505['url'],_0x40c8fc,{},['$$','$$']);if(_0x3f43a0[_0xdf3c('0x72')]){_0x3f43a0[_0xdf3c('0x72')]=JSON[_0xdf3c('0x70')](Mustache['render'](JSON['stringify'](_0x3f43a0['headers']),_0x40c8fc,{},['$$','$$']));}if(_0x3f43a0['body']){_0x3f43a0[_0xdf3c('0x6f')]=JSON[_0xdf3c('0x70')](Mustache[_0xdf3c('0x77')](JSON[_0xdf3c('0x78')](_0x3f43a0[_0xdf3c('0x6f')]),_0x40c8fc,{},['$$','$$']));}}catch(_0x32573c){logger['error'](_0xdf3c('0x79'),_0x32573c);}}rp(_0x3f43a0)['then'](function(_0x42df23){var _0x389708={'statusCode':_0x42df23[_0xdf3c('0x7a')]||0xc8,'statusMessage':_0x42df23[_0xdf3c('0x7b')]||'OK','headers':_0x42df23[_0xdf3c('0x72')]||{},'body':_0x42df23[_0xdf3c('0x6f')]||{}};_0x2a4e4c(null,_0x389708);})[_0xdf3c('0x15')](function(_0x3eece1){var _0x32d09d={'statusCode':_0x3eece1[_0xdf3c('0x7a')]||0x1f4,'statusMessage':_0x3eece1[_0xdf3c('0x7c')]||_0xdf3c('0x7d'),'headers':_0x3eece1[_0xdf3c('0x7e')][_0xdf3c('0x72')]||{},'body':_0x3eece1['options'][_0xdf3c('0x6f')]||{}};_0x2a4e4c(null,_0x32d09d);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x7f')]=function(_0x137d9a,_0x5bbe5c){scripts[_0xdf3c('0x7f')](this[_0xdf3c('0xf')]['uniqueid'],_0x137d9a['key'],_0x137d9a[_0xdf3c('0x62')],_0x137d9a[_0xdf3c('0x80')]||'en')[_0xdf3c('0x14')](function(_0x1aaf8b){_0x5bbe5c(null,_0x1aaf8b);})[_0xdf3c('0x15')](function(_0x56fc77){_0x5bbe5c(_0x56fc77);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x81')]=function(_0x620c5f,_0x2b6d2b){scripts[_0xdf3c('0x81')](this[_0xdf3c('0xf')]['uniqueid'],_0x620c5f[_0xdf3c('0x82')],_0x620c5f[_0xdf3c('0x83')],_0x620c5f[_0xdf3c('0x84')],_0x620c5f[_0xdf3c('0x62')],_0x620c5f[_0xdf3c('0x85')]||'en')['then'](function(_0x4bedde){_0x2b6d2b(null,_0x4bedde);})['catch'](function(_0x3ff479){_0x2b6d2b(_0x3ff479);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x86')]=function(_0x3de4e6,_0x115f11){scripts[_0xdf3c('0x86')](this[_0xdf3c('0xf')],_0x3de4e6)[_0xdf3c('0x14')](function(_0x5c52e2){_0x115f11(null,_0x5c52e2);})[_0xdf3c('0x15')](function(_0x3eaddd){_0x115f11(_0x3eaddd);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x87')]=function(_0xf04b92,_0x46dd4e){scripts['ispeechTTS'](_0xf04b92[_0xdf3c('0x88')],_0xf04b92[_0xdf3c('0x62')],_0xf04b92['ispeech_tts_language']||'en-US',_0xf04b92[_0xdf3c('0x89')])['then'](function(_0x404e6e){_0x46dd4e(null,_0x404e6e);})[_0xdf3c('0x15')](function(_0x4e917f){_0x46dd4e(_0x4e917f);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x8a')]=function(_0x296fc0,_0x73d18a,_0xa326c9){scripts[_0xdf3c('0x8a')](_0x73d18a,_0x296fc0['key'],_0x296fc0[_0xdf3c('0x8b')]||_0xdf3c('0x64'),this[_0xdf3c('0x8c')](_0x296fc0[_0xdf3c('0x8d')])?_0x296fc0[_0xdf3c('0x8d')]:undefined)[_0xdf3c('0x14')](function(_0x3deacb){_0xa326c9(null,_0x3deacb);})['catch'](function(_0x5b1d3d){_0xa326c9(_0x5b1d3d);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x8e')]=function(_0x1f6f9b,_0x5b6419){scripts[_0xdf3c('0x8e')](_0x1f6f9b['aws_access_key_id'],_0x1f6f9b['aws_secret_access_key'],_0x1f6f9b[_0xdf3c('0x8f')],_0x1f6f9b[_0xdf3c('0x90')]||'Amy',_0x1f6f9b[_0xdf3c('0x62')],_0x1f6f9b['aws_text_type']||_0xdf3c('0x62'))['then'](function(_0x12b135){_0x5b6419(null,_0x12b135);})[_0xdf3c('0x15')](function(_0x284635){_0x5b6419(_0x284635);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x91')]=function(_0x87e942,_0x2790cd){scripts[_0xdf3c('0x91')](this[_0xdf3c('0xf')][_0xdf3c('0x3a')],_0x87e942[_0xdf3c('0x92')],_0x87e942[_0xdf3c('0x93')],_0x87e942[_0xdf3c('0x94')],_0x87e942[_0xdf3c('0x62')],_0x87e942['aws_bot_name'])[_0xdf3c('0x14')](function(_0x22bacf){_0x2790cd(null,_0x22bacf);})[_0xdf3c('0x15')](function(_0x5b959b){_0x2790cd(_0x5b959b);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x95')]=function(_0x32cd2f,_0x6e1899,_0x3da55b){scripts[_0xdf3c('0x95')](_0x6e1899,_0x32cd2f[_0xdf3c('0x88')],_0x32cd2f[_0xdf3c('0x96')]||_0xdf3c('0x64'))[_0xdf3c('0x14')](function(_0x258578){_0x3da55b(null,_0x258578);})['catch'](function(_0x3bc3c9){_0x3da55b(_0x3bc3c9);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x97')]=function(_0x9777ae,_0x70370c,_0x50b0f1){scripts[_0xdf3c('0x97')](_0x70370c,_0x9777ae[_0xdf3c('0x98')],_0x9777ae[_0xdf3c('0x99')],_0x9777ae[_0xdf3c('0x76')])[_0xdf3c('0x14')](function(_0xbe4411){_0x50b0f1(null,_0xbe4411);})['catch'](function(_0x6627){_0x50b0f1(_0x6627);});};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x9a')]=function(_0x23aa73){var _0x310f21=_[_0xdf3c('0x9b')](verticesWithRetry,_0x23aa73[_0xdf3c('0x9c')])?_0x23aa73:_['clone'](_0x23aa73);for(var _0x396b19 in _0x310f21){if(_0x310f21[_0xdf3c('0x9d')](_0x396b19)){if(_0x310f21[_0x396b19]&&_[_0xdf3c('0x9e')](_0x310f21[_0x396b19])){if(_[_0xdf3c('0x9b')](recursiveMapAttributes,_0x396b19)){_0x310f21[_0x396b19]=this['replaceObjectAllVariables'](_0x310f21[_0x396b19]);}else{_0x310f21[_0x396b19]=this[_0xdf3c('0x9f')](_0x310f21[_0x396b19]);}}}}return _0x310f21;};AGIVertices[_0xdf3c('0x11')]['recursiveNodeIndex']=function(_0x33c2ad){for(var _0x4a1bc4 in _0x33c2ad){if(_0x33c2ad[_0xdf3c('0x9d')](_0x4a1bc4)){if(_[_0xdf3c('0xa0')](_0x33c2ad[_0x4a1bc4])){this['recursiveNodeIndex'](_0x33c2ad[_0x4a1bc4]);}else if(_[_0xdf3c('0xa1')](_0x33c2ad[_0x4a1bc4])){for(var _0x106d32=0x0;_0x106d32<_0x33c2ad[_0x4a1bc4][_0xdf3c('0xa2')];_0x106d32++){this['recursiveNodeIndex'](_0x33c2ad[_0x4a1bc4][_0x106d32]);}}else if(_['isString'](_0x33c2ad[_0x4a1bc4])){_0x33c2ad[_0x4a1bc4]=this[_0xdf3c('0x9f')](_0x33c2ad[_0x4a1bc4]);}}}};AGIVertices['prototype'][_0xdf3c('0xa3')]=function(_0x82225d,_0x161604){for(var _0x91dd6e in _0x82225d){if(_0x82225d['hasOwnProperty'](_0x91dd6e)){if(_[_0xdf3c('0xa0')](_0x82225d[_0x91dd6e])){if(!_[_0xdf3c('0x47')](_0x82225d[_0x91dd6e])){this['saveRestApiResult'](_0x82225d[_0x91dd6e],util[_0xdf3c('0x2c')]('%s.%s',_0x161604,_0x91dd6e));}}else if(_[_0xdf3c('0xa1')](_0x82225d[_0x91dd6e])){for(var _0x1f1f09=0x0;_0x1f1f09<_0x82225d[_0x91dd6e]['length'];_0x1f1f09++){this['saveRestApiResult'](_0x82225d[_0x91dd6e][_0x1f1f09],util[_0xdf3c('0x2c')]('%s.%s',_0x161604,_0x91dd6e+'['+_0x1f1f09+']'));}}else{if(!_[_0xdf3c('0x48')](_0x82225d[_0x91dd6e])){this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0xa5'),_0x161604,_0x91dd6e),_0x82225d[_0x91dd6e]);}}}}};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xa6')]=function(_0x1d95d9){try{var _0x42ae0a=JSON[_0xdf3c('0x70')](_0x1d95d9);this[_0xdf3c('0xa7')](_0x42ae0a);return JSON['stringify'](_0x42ae0a);}catch(_0x4299d1){return this[_0xdf3c('0x9f')](_0x1d95d9);}};AGIVertices['prototype'][_0xdf3c('0x9f')]=function(_0x367e4d){var _0x21c508=_0x367e4d[_0xdf3c('0xa8')]('{');for(var _0x7e5769=0x1;_0x7e5769<_0x21c508[_0xdf3c('0xa2')];_0x7e5769+=0x1){var _0x5e92f0=_0x21c508[_0x7e5769][_0xdf3c('0xa8')]('}');if(_0x5e92f0['length']>0x1){_0x367e4d=_0x367e4d[_0xdf3c('0xa9')]('{'+_0x5e92f0[0x0]+'}',this[_0xdf3c('0xf')][_0xdf3c('0x12')](_0x5e92f0[0x0])[_0xdf3c('0xaa')]||_0x5e92f0[0x0]);}}if(_0x21c508[_0xdf3c('0xa2')]===0x1){return _0x367e4d[_0xdf3c('0x51')]();}return this['replaceAllVariables'](_0x367e4d);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xab')]=function(_0x5b4e32,_0x2ad761){var _0x2501e4=this[_0xdf3c('0xf')][_0xdf3c('0x12')](_0x5b4e32);if(_0x2501e4[_0xdf3c('0xac')]===-0x1){return _0x2501e4;}logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xad'),_0x2ad761,_0x2501e4['extra']));return this['channel'][_0xdf3c('0xa4')](_0x2ad761,_0x2501e4[_0xdf3c('0xaa')]);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x8c')]=function(_0x47afe4){return _0x47afe4&&_0x47afe4!=='0'&&_0x47afe4!=='-1'&&_0x47afe4!=='';};AGIVertices['prototype'][_0xdf3c('0xae')]=function(_0x5c15d3){this[_0xdf3c('0x39')]['sync'](this,_0x5c15d3,'-');_0x5c15d3[_0xdf3c('0xaf')]=_0x5c15d3[_0xdf3c('0xae')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xdf3c('0x11')]['mrcpsynth']=function(_0x292798){logger[_0xdf3c('0x31')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x292798[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x292798[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}var _0x1d76ed='\x22'+_0x292798['text']+'\x22';if(this['isConfigured'](_0x292798[_0xdf3c('0x7e')])){_0x1d76ed+=','+_0x292798[_0xdf3c('0x7e')];}var _0x2efe5b=this[_0xdf3c('0xf')][_0xdf3c('0x5c')](_0xdf3c('0xb2'),_0x1d76ed);if(_0x2efe5b[_0xdf3c('0xac')]===-0x1){return _0x2efe5b;}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xb3'),_0x1d76ed));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xb4')]=function(_0x42a160){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xb5'),_0x42a160[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x42a160['grammar'])){return this['channel'][_0xdf3c('0xb0')]('no\x20grammar\x20configured');}var _0x4c3df3=_0x42a160[_0xdf3c('0xb6')];if(this['isConfigured'](_0x42a160[_0xdf3c('0x7e')])){_0x4c3df3+=','+_0x42a160[_0xdf3c('0x7e')];}var _0x5e1366=this['channel']['exec'](_0xdf3c('0xb7'),_0x4c3df3);if(_0x5e1366[_0xdf3c('0xac')]===-0x1){return _0x5e1366;}var _0x11de00=this['getAndSetVariable'](_0xdf3c('0xb8'),'MRCP_RECOG_CONFIDENCE');if(_0x11de00[_0xdf3c('0xac')]===-0x1){return _0x11de00;}var _0x4ba88f=this['getAndSetVariable'](_0xdf3c('0xb9'),_0xdf3c('0xba'));if(_0x4ba88f[_0xdf3c('0xac')]===-0x1){return _0x4ba88f;}var _0x1aa490=this[_0xdf3c('0xab')](_0xdf3c('0xbb'),'MRCP_RECOG_INSTANCE');if(_0x1aa490['result']===-0x1){return _0x1aa490;}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0xbc'),_0x4c3df3));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x8')]=function(_0x2d3f44){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x2d3f44['label']));return this[_0xdf3c('0xf')][_0xdf3c('0x8')]([_0x2d3f44[_0xdf3c('0xbd')],_0x2d3f44[_0xdf3c('0xbe')]]);};AGIVertices['prototype'][_0xdf3c('0xbf')]=function(_0x364b5e){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xc0'),_0x364b5e[_0xdf3c('0x3b')]));if(this['isConfigured'](_0x364b5e[_0xdf3c('0x6b')])){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0xc1'),_0x364b5e[_0xdf3c('0x6b')]));var _0xe5f939=this['channel'][_0xdf3c('0xc2')](_0x364b5e[_0xdf3c('0x6b')]);if(_0xe5f939[_0xdf3c('0xac')]===-0x1){return _0xe5f939;}}return this[_0xdf3c('0xf')][_0xdf3c('0xbf')]();};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x4f')]=function(_0x12ffd3){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0xc3'),_0x12ffd3['label']));if(!this[_0xdf3c('0x8c')](_0x12ffd3[_0xdf3c('0x4d')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x12ffd3,_0xdf3c('0xc4'));}_0x12ffd3[_0xdf3c('0x4e')]=moment();if(this[_0xdf3c('0x8c')](_0x12ffd3[_0xdf3c('0xc5')])){_0x12ffd3[_0xdf3c('0x4e')]=moment()[_0xdf3c('0xc6')](_0x12ffd3[_0xdf3c('0xc5')],'minutes');}if(!this[_0xdf3c('0x8c')](_0x12ffd3[_0xdf3c('0xc7')])){_0x12ffd3['callback_priority']=0x2;}this[_0xdf3c('0x46')][_0xdf3c('0x75')](this,_0x12ffd3);return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0xc8'),_0x12ffd3[_0xdf3c('0x4c')],_0x12ffd3[_0xdf3c('0x4d')],_0x12ffd3['scheduledAt']));};AGIVertices['prototype']['custom_app']=function(_0x157b7a){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xc9'),_0x157b7a[_0xdf3c('0x3b')]));var _0x33132b=this[_0xdf3c('0xf')][_0xdf3c('0x5c')](_0x157b7a['application'],_0x157b7a[_0xdf3c('0x7e')]);if(_0x33132b['result']===-0x1){return _0x33132b;}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xca'),_0x157b7a[_0xdf3c('0xcb')],_0x157b7a[_0xdf3c('0x7e')]));};AGIVertices['prototype'][_0xdf3c('0xcc')]=function(_0x116ac9){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0xcd'),_0x116ac9[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x116ac9['text'])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0xb1'));}var _0x138797='\x22'+_0x116ac9[_0xdf3c('0x62')]+'\x22';if(this[_0xdf3c('0x8c')](_0x116ac9[_0xdf3c('0x7e')])){_0x138797+=','+_0x116ac9[_0xdf3c('0x7e')];}var _0x5be97e=this['channel']['exec'](_0xdf3c('0xb2'),_0x138797);if(_0x5be97e[_0xdf3c('0xac')]===-0x1){return _0x5be97e;}return this['channel']['noop'](util[_0xdf3c('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x138797));};AGIVertices['prototype']['sestektts']=function(_0x3d8d41){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3d8d41[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0x3d8d41[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}var _0x119e04='\x22'+_0x3d8d41[_0xdf3c('0x62')]+'\x22';if(this[_0xdf3c('0x8c')](_0x3d8d41[_0xdf3c('0x7e')])){_0x119e04+=','+_0x3d8d41[_0xdf3c('0x7e')];}var _0x5a527a=this[_0xdf3c('0xf')][_0xdf3c('0x5c')]('MRCPSynth',_0x119e04);if(_0x5a527a[_0xdf3c('0xac')]===-0x1){return _0x5a527a;}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x119e04));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xce')]=function(_0x3ea47d){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xcf'),_0x3ea47d[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x3ea47d[_0xdf3c('0xb6')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xd0'));}var _0x2a4dbf=_0x3ea47d[_0xdf3c('0xb6')];if(this[_0xdf3c('0x8c')](_0x3ea47d[_0xdf3c('0x7e')])){_0x2a4dbf+=','+_0x3ea47d['options'];}var _0x3176cd=this[_0xdf3c('0xf')]['exec'](_0xdf3c('0xb7'),_0x2a4dbf);if(_0x3176cd[_0xdf3c('0xac')]===-0x1){return _0x3176cd;}var _0x162d56=this[_0xdf3c('0xab')]('RECOG_CONFIDENCE()',_0xdf3c('0xd1'));if(_0x162d56[_0xdf3c('0xac')]===-0x1){return _0x162d56;}var _0x5b25d7=this[_0xdf3c('0xab')](_0xdf3c('0xb9'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5b25d7['result']===-0x1){return _0x5b25d7;}var _0x14b70a=this[_0xdf3c('0xab')](_0xdf3c('0xbb'),'LUMENVOX_ASR_INSTANCE');if(_0x14b70a[_0xdf3c('0xac')]===-0x1){return _0x14b70a;}return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xbc'),_0x2a4dbf));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xd2')]=function(_0x27f90e){logger['info'](util[_0xdf3c('0x2c')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x27f90e[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x27f90e[_0xdf3c('0xb6')])){return this['channel'][_0xdf3c('0xb0')]('no\x20grammar\x20configured');}var _0x3cba40=_0x27f90e[_0xdf3c('0xb6')];if(this['isConfigured'](_0x27f90e[_0xdf3c('0x7e')])){_0x3cba40+=','+_0x27f90e[_0xdf3c('0x7e')];}var _0x2c3655=this[_0xdf3c('0xf')]['exec'](_0xdf3c('0xb7'),_0x3cba40);if(_0x2c3655[_0xdf3c('0xac')]===-0x1){return _0x2c3655;}var _0xa61c3f=this[_0xdf3c('0xab')](_0xdf3c('0xb8'),_0xdf3c('0xd3'));if(_0xa61c3f[_0xdf3c('0xac')]===-0x1){return _0xa61c3f;}var _0x5a0ad8=this[_0xdf3c('0xab')](_0xdf3c('0xb9'),_0xdf3c('0xd4'));if(_0x5a0ad8[_0xdf3c('0xac')]===-0x1){return _0x5a0ad8;}var _0x16d755=this[_0xdf3c('0xab')](_0xdf3c('0xbb'),_0xdf3c('0xd5'));if(_0x16d755[_0xdf3c('0xac')]===-0x1){return _0x16d755;}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0xbc'),_0x3cba40));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xd6')]=function(_0x4e822b){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xd7'),_0x4e822b[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x4e822b['odbc_id'])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x4e822b,'no\x20database\x20selected');}var _0x2a0943=this[_0xdf3c('0x1b')][_0xdf3c('0x75')](this,_0x4e822b[_0xdf3c('0xd8')]);if(!_0x2a0943){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x4e822b,_0xdf3c('0xd9'));}if(!this[_0xdf3c('0x8c')](_0x4e822b[_0xdf3c('0x33')])){return this['channel'][_0xdf3c('0x2f')](_0x4e822b,_0xdf3c('0xda'));}var _0x4fcb83=_0x4e822b[_0xdf3c('0x33')][_0xdf3c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0xdb'),_0x4fcb83));var _0x2c6ae1=this[_0xdf3c('0xdc')][_0xdf3c('0x75')](this,_0x2a0943,_0x4fcb83);this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x4e822b,_0x4fcb83);if(!this[_0xdf3c('0x8c')](_0x4e822b['variable_id'])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xdd'));}var _0x28bc25=this['getVariable'][_0xdf3c('0x75')](this,_0x4e822b[_0xdf3c('0xde')]);if(!_0x28bc25){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x4e822b,'no\x20variable\x20found');}var _0x42d291=this;_0x2c6ae1[_0xdf3c('0xdf')](function(_0x1c3c6d,_0x58bc3a){Object['keys'](_0x1c3c6d)[_0xdf3c('0xdf')](function(_0xcaea00){_0x42d291[_0xdf3c('0xf')]['setVariable'](util[_0xdf3c('0x2c')](_0xdf3c('0xe0'),_0x28bc25,_0x58bc3a,_0xcaea00),_0x1c3c6d[_0xcaea00]);});});this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')]('%s_ROWS_COUNT',_0x28bc25),_0x2c6ae1['length']);return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0xe1'),_0x28bc25));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xe2')]=function(_0x3b55c2){logger[_0xdf3c('0xe3')](util['format'](_0xdf3c('0xe4'),_0x3b55c2[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x3b55c2[_0xdf3c('0xe5')])){return this['channel'][_0xdf3c('0x2f')](_0x3b55c2,_0xdf3c('0xe6'));}var _0x234c08=this['getUser']['sync'](this,_0x3b55c2[_0xdf3c('0xe5')]);if(!_0x234c08){return this[_0xdf3c('0xf')]['error'](_0x3b55c2,_0xdf3c('0xe7'));}var _0x5eebe3=this[_0xdf3c('0xf')][_0xdf3c('0x5c')](_0xdf3c('0xe8'),[util[_0xdf3c('0x2c')](_0xdf3c('0xe9'),_0x234c08),_0x3b55c2[_0xdf3c('0x6b')],_0x3b55c2['opts'],_0x3b55c2[_0xdf3c('0x6a')]]);if(_0x5eebe3[_0xdf3c('0xac')]===-0x1){return _0x5eebe3;}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xea'),_0xdf3c('0xe8')));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xeb')]=function(_0x127bfb){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0xec'),_0x127bfb[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0x127bfb[_0xdf3c('0x88')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xed'));}if(!this[_0xdf3c('0x8c')](_0x127bfb['text'])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}this[_0xdf3c('0xf')][_0xdf3c('0xee')]=!![];this[_0xdf3c('0x39')](_0x127bfb);this[_0xdf3c('0x45')](_0x127bfb[_0xdf3c('0x62')],'in','','');this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xef'),_0x127bfb[_0xdf3c('0x62')]));var _0x4c7e12=this[_0xdf3c('0x7f')][_0xdf3c('0x75')](this,_0x127bfb);if(_0x4c7e12){for(var _0x5a1c3a in _0x4c7e12){if(_0x4c7e12[_0xdf3c('0x9d')](_0x5a1c3a)){this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0xf0'),_0x5a1c3a[_0xdf3c('0xf1')]()),_0x4c7e12[_0x5a1c3a]);}}this[_0xdf3c('0x45')](_0x4c7e12[_0xdf3c('0xf2')],_0xdf3c('0xf3'),_0xdf3c('0xeb'),'');return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')]('Dialogflow\x20Result\x20%s',_0x4c7e12[_0xdf3c('0xf2')]));}return this['channel'][_0xdf3c('0x2f')](_0x127bfb,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xdf3c('0x11')]['dialogflowV2']=function(_0x474b7f){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0xf4'),_0x474b7f[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x474b7f[_0xdf3c('0x82')])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0xf5'));}if(!this[_0xdf3c('0x8c')](_0x474b7f[_0xdf3c('0x83')])){return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0xf6'));}if(!this[_0xdf3c('0x8c')](_0x474b7f[_0xdf3c('0x84')])){return this['channel']['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x474b7f[_0xdf3c('0x85')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xf7'));}if(!this[_0xdf3c('0x8c')](_0x474b7f[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0xb1'));}this['channel'][_0xdf3c('0xee')]=!![];this[_0xdf3c('0x39')](_0x474b7f);this[_0xdf3c('0x45')](_0x474b7f[_0xdf3c('0x62')],'in','','');this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xf8'),_0x474b7f['text']));var _0xc2698=this[_0xdf3c('0x81')][_0xdf3c('0x75')](this,_0x474b7f);if(_0xc2698){for(var _0x75285d in _0xc2698){if(_0xc2698[_0xdf3c('0x9d')](_0x75285d)){if(_0x75285d!=='providerResponse'){this['channel'][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0xf0'),_0x75285d[_0xdf3c('0xf1')]()),_0xc2698[_0x75285d]);}}}this[_0xdf3c('0x45')](_0xc2698[_0xdf3c('0xf2')],_0xdf3c('0xf3'),_0xdf3c('0xf9'),_0xc2698[_0xdf3c('0xfa')]);return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0xfb'),_0xc2698[_0xdf3c('0xf2')]));}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x474b7f,_0xdf3c('0xfc'));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xfd')]=function(_0x4e8ad8){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0xfe'),_0x4e8ad8['label']));if(!this[_0xdf3c('0x8c')](_0x4e8ad8[_0xdf3c('0xff')])){return this['channel']['noop'](_0xdf3c('0x100'));}if(!this[_0xdf3c('0x8c')](_0x4e8ad8[_0xdf3c('0x101')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')]('no\x20username\x20configured');}if(!this[_0xdf3c('0x8c')](_0x4e8ad8[_0xdf3c('0x102')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0x103'));}if(!this['isConfigured'](_0x4e8ad8[_0xdf3c('0x104')])){return this['channel'][_0xdf3c('0xb0')]('no\x20text\x20configured');}this['channel'][_0xdf3c('0xee')]=!![];this[_0xdf3c('0x39')](_0x4e8ad8);this[_0xdf3c('0x45')](_0x4e8ad8[_0xdf3c('0x62')],'in','','');this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x105'),_0x4e8ad8['text']));var _0xc68c84=this[_0xdf3c('0x86')][_0xdf3c('0x75')](this,_0x4e8ad8);if(_0xc68c84){for(var _0x386a3b in _0xc68c84){if(_0xc68c84[_0xdf3c('0x9d')](_0x386a3b)){this['channel'][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0x106'),_0x386a3b[_0xdf3c('0xf1')]()),_0xc68c84[_0x386a3b]);}}this[_0xdf3c('0x45')](_0xc68c84['speech'],_0xdf3c('0xf3'),_0xdf3c('0xfd'),'');if(_0xc68c84[_0xdf3c('0x107')]){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x108'),_0xc68c84[_0xdf3c('0x107')]));var _0xb2e933=this[_0xdf3c('0xf')][_0xdf3c('0x109')](_0xc68c84[_0xdf3c('0x107')]);try{fs[_0xdf3c('0x10a')](_0xc68c84[_0xdf3c('0x107')]+_0xdf3c('0x10b'));}catch(_0x2be6c7){logger[_0xdf3c('0x2f')](_0x2be6c7);}return _0xb2e933;}else{return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x10c'),_0xc68c84[_0xdf3c('0xf2')]));}}return this['channel'][_0xdf3c('0x2f')](_0x4e8ad8,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xdf3c('0x11')]['end']=function(_0x425ddb){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x10d'),_0x425ddb[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0x10e'));};AGIVertices[_0xdf3c('0x11')]['ext_dial']=function(_0x3ef6db){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x10f'),_0x3ef6db['label']));var _0x5d5945='';if(_0x3ef6db[_0xdf3c('0x110')]){if(!this[_0xdf3c('0x8c')](_0x3ef6db[_0xdf3c('0x110')])){return this[_0xdf3c('0xf')]['error'](_0x3ef6db,_0xdf3c('0x111'));}else{var _0x5bc20a=parseInt(_0x3ef6db['trunk_id'],0xa);if(isNaN(_0x5bc20a)){_0x5d5945=_0x3ef6db[_0xdf3c('0x110')];}else{_0x5d5945=this[_0xdf3c('0x1f')]['sync'](this,_0x3ef6db[_0xdf3c('0x110')]);if(!_0x5d5945){return this[_0xdf3c('0xf')]['error'](_0x3ef6db,_0xdf3c('0x112'));}}}}else if(_0x3ef6db[_0xdf3c('0x113')]){_0x5d5945=_0x3ef6db['trunk_name'];}else{return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x3ef6db,_0xdf3c('0x111'));}var _0x41796d=this[_0xdf3c('0xf')][_0xdf3c('0x5c')]('DIAL',[util['format'](_0xdf3c('0x114'),_0x5d5945,_0x3ef6db[_0xdf3c('0x4c')]),_0x3ef6db[_0xdf3c('0x6b')],_0x3ef6db[_0xdf3c('0x115')],_0x3ef6db[_0xdf3c('0x6a')]]);if(_0x41796d[_0xdf3c('0xac')]===-0x1){return _0x41796d;}return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xea'),_0xdf3c('0xe8')));};AGIVertices['prototype'][_0xdf3c('0x116')]=function(_0x324940){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x117'),_0x324940[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0x116'));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xe')]=function(_0x216d47){logger['info'](util['format'](_0xdf3c('0x118'),_0x216d47[_0xdf3c('0x3b')]));if(_0x216d47[_0xdf3c('0xaf')]===0x0){return this[_0xdf3c('0xae')](_0x216d47);}_0x216d47[_0xdf3c('0xaf')]-=0x1;if(!this[_0xdf3c('0x8c')](_0x216d47[_0xdf3c('0x119')])){return this[_0xdf3c('0xf')]['error'](_0x216d47,_0xdf3c('0x11a'));}var _0x4765d2=this['getSound'][_0xdf3c('0x75')](this,_0x216d47[_0xdf3c('0x119')]);if(!_0x4765d2){return this['channel'][_0xdf3c('0x2f')](_0x216d47,'no\x20file\x20audio\x20found');}if(!this[_0xdf3c('0x8c')](_0x216d47[_0xdf3c('0xde')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4ae409=this['channel'][_0xdf3c('0x11b')](_0x4765d2,_0x216d47[_0xdf3c('0x11c')],_0x216d47[_0xdf3c('0x11d')]);var _0x22cb17=_0x4ae409[_0xdf3c('0xac')]?_0x4ae409[_0xdf3c('0xac')][_0xdf3c('0x51')]():'';logger['info'](_0xdf3c('0x11e'),JSON[_0xdf3c('0x78')](_0x4ae409));if(_0x4ae409['result']===-0x1){this[_0xdf3c('0x39')]['sync'](this,_0x216d47,_0x22cb17);return _0x4ae409;}else if(_0x4ae409[_0xdf3c('0xaa')]===_0xdf3c('0x6b')){_0x4ae409[_0xdf3c('0xac')]=_0x22cb17['length']>=parseInt(_0x216d47[_0xdf3c('0x11f')])?'x':'i';}else{_0x4ae409[_0xdf3c('0xac')]=_0x22cb17[_0xdf3c('0xa2')]>=parseInt(_0x216d47[_0xdf3c('0x11f')])&&_0x22cb17[_0xdf3c('0xa2')]<=parseInt(_0x216d47['maxdigit'])?'x':'i';}var _0xa16b7f=this[_0xdf3c('0x12')][_0xdf3c('0x75')](this,_0x216d47[_0xdf3c('0xde')]);if(!_0xa16b7f){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x216d47,_0xdf3c('0x120'));}this['channel'][_0xdf3c('0xa4')](_0xa16b7f,_0x22cb17);if(this[_0xdf3c('0x8c')](_0x216d47[_0xdf3c('0x121')])){var _0x4ecd66=parseInt(_0x216d47[_0xdf3c('0x121')],0xa);var _0x58dd62=rs[_0xdf3c('0x122')]({'charset':'*','length':_0x4ecd66});var _0x42d103=_0x22cb17['length'];if(_0x42d103>0x0){if(_0x42d103>_0x4ecd66){this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x216d47,_0x216d47[_0xdf3c('0x123')]===_0xdf3c('0x124')?_0x58dd62+_0x22cb17[_0xdf3c('0x125')](_0x4ecd66):_0x22cb17[_0xdf3c('0x125')](0x0,_0x42d103-_0x4ecd66)+_0x58dd62);}else{this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x216d47,rs[_0xdf3c('0x122')]({'charset':'*','length':_0x42d103}));}}else{this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x216d47,'');}}else{this[_0xdf3c('0x39')]['sync'](this,_0x216d47,_0x22cb17);}return _0x4ae409;};AGIVertices[_0xdf3c('0x11')]['getsecretdigits']=function(_0x57e693){logger['info'](util['format'](_0xdf3c('0x126'),_0x57e693[_0xdf3c('0x3b')]));return this[_0xdf3c('0xe')](_0x57e693);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x127')]=function(_0x3f44b7){logger['info'](util[_0xdf3c('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x3f44b7[_0xdf3c('0x3b')]));this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x3f44b7,_0x3f44b7[_0xdf3c('0x128')]);return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x129'),_0x3f44b7[_0xdf3c('0x128')]));};AGIVertices['prototype'][_0xdf3c('0x12a')]=function(_0x258b2d){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x258b2d['label']));if(!this[_0xdf3c('0x8c')](_0x258b2d[_0xdf3c('0x92')])||!this[_0xdf3c('0x8c')](_0x258b2d[_0xdf3c('0x93')])){return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0x12b'));}if(!this[_0xdf3c('0x8c')](_0x258b2d[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x12c'),_0x258b2d[_0xdf3c('0x62')]));var _0x367df9=this[_0xdf3c('0x8e')]['sync'](this,_0x258b2d);if(_0x367df9){this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x12d'),_0x367df9));var _0x1b2961=this[_0xdf3c('0xf')]['streamFile'](_0x367df9);try{fs[_0xdf3c('0x10a')](_0x367df9+_0xdf3c('0x10b'));}catch(_0x376002){logger[_0xdf3c('0x2f')](_0x376002);}return _0x1b2961;}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x258b2d,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x12e')]=function(_0x5eb960){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x12f'),_0x5eb960[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x5eb960[_0xdf3c('0x92')])||!this['isConfigured'](_0x5eb960['aws_secret_access_key'])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0x12b'));}if(!this[_0xdf3c('0x8c')](_0x5eb960[_0xdf3c('0x130')])){return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0x131'));}if(!this[_0xdf3c('0x8c')](_0x5eb960[_0xdf3c('0x62')])){return this['channel']['noop'](_0xdf3c('0xb1'));}this['channel'][_0xdf3c('0xee')]=!![];this[_0xdf3c('0x39')](_0x5eb960);this[_0xdf3c('0x45')](_0x5eb960[_0xdf3c('0x62')],'in','','');this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x132'),_0x5eb960[_0xdf3c('0x62')]));var _0x5a44f1=this[_0xdf3c('0x91')][_0xdf3c('0x75')](this,_0x5eb960);if(_0x5a44f1){for(var _0x8f769e in _0x5a44f1){if(_0x5a44f1[_0xdf3c('0x9d')](_0x8f769e)&&_[_0xdf3c('0x9e')](_0x5a44f1[_0x8f769e])){this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util['format']('AWS_LEX_%s',_0x8f769e[_0xdf3c('0xf1')]()),_0x5a44f1[_0x8f769e]);}}if(_['isNil'](_0x5a44f1[_0xdf3c('0x7c')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0x133'));}else{this['createSquareMessage'](_0x5a44f1[_0xdf3c('0x7c')],'out',_0xdf3c('0x134'),'');return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x135'),_0x5a44f1[_0xdf3c('0x7c')]));}}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x5eb960,_0xdf3c('0x136'));};AGIVertices['prototype'][_0xdf3c('0x137')]=function(_0x42f305){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x42f305[_0xdf3c('0x3b')],_0x42f305[_0xdf3c('0x6b')]));if(!this[_0xdf3c('0x8c')](_0x42f305[_0xdf3c('0x88')])){return this[_0xdf3c('0xf')]['noop']('no\x20key\x20configured');}var _0x54a06b=_0xdf3c('0x138');var _0x47bef6=util[_0xdf3c('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0xdf3c('0x122')](0x4));var _0x2160ff=util[_0xdf3c('0x2c')]('%s.%s',_0x47bef6,_0x54a06b);var _0x47d44e=!![];if(_0x42f305['beep']===_0xdf3c('0x139')){_0x47d44e=![];}var _0xeecefd=this['channel'][_0xdf3c('0x13a')](_0x47bef6,_0x54a06b,_0x42f305[_0xdf3c('0x13b')],_0x42f305[_0xdf3c('0x6b')],undefined,_0x47d44e);if(_0xeecefd[_0xdf3c('0xac')]!==-0x1){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x13c'),_0x2160ff));var _0x5797ff=this[_0xdf3c('0x95')][_0xdf3c('0x75')](this,_0x42f305,_0x2160ff);if(_0x5797ff){for(var _0x37e578 in _0x5797ff){if(_0x5797ff[_0xdf3c('0x9d')](_0x37e578)){this[_0xdf3c('0xf')]['setVariable'](util[_0xdf3c('0x2c')](_0xdf3c('0x13d'),_0x37e578[_0xdf3c('0xf1')]()),_0x5797ff[_0x37e578]);}}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')]('GoogleASR\x20Result\x20%s',JSON[_0xdf3c('0x78')](_0x5797ff)));}}return _0xeecefd;};AGIVertices['prototype'][_0xdf3c('0x13e')]=function(_0x418d6b){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x13f'),_0x418d6b[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x418d6b[_0xdf3c('0x98')])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0x140'));}if(!this[_0xdf3c('0x8c')](_0x418d6b[_0xdf3c('0x99')])){return this['channel'][_0xdf3c('0xb0')]('no\x20appsecret\x20configured');}var _0xddf03e=_0xdf3c('0x138');var _0x22b00b=util[_0xdf3c('0x2c')](_0xdf3c('0x141'),FILES_PATH,rs[_0xdf3c('0x122')](0x4));var _0x311098=util[_0xdf3c('0x2c')](_0xdf3c('0xa5'),_0x22b00b,_0xddf03e);var _0x33230c=!![];if(_0x418d6b[_0xdf3c('0x142')]===_0xdf3c('0x139')){_0x33230c=![];}var _0x597a56=this['channel']['recordFile'](_0x22b00b,_0xddf03e,_0x418d6b[_0xdf3c('0x13b')],_0x418d6b[_0xdf3c('0x6b')],undefined,_0x33230c);if(_0x597a56[_0xdf3c('0xac')]!==-0x1){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x143'),_0x311098));var _0x46f737=this[_0xdf3c('0x97')][_0xdf3c('0x75')](this,_0x418d6b,_0x311098);if(_0x46f737){for(var _0x38aedd in _0x46f737){if(_0x46f737[_0xdf3c('0x9d')](_0x38aedd)){this[_0xdf3c('0xf')]['setVariable'](util['format'](_0xdf3c('0x144'),_0x38aedd[_0xdf3c('0xf1')]()),_0x46f737[_0x38aedd]);}}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0xdf3c('0x78')](_0x46f737)));}}return _0x597a56;};AGIVertices[_0xdf3c('0x11')]['gotoc']=function(_0xabf05c){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x145'),_0xabf05c[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')][_0xdf3c('0x146')](_0xabf05c[_0xdf3c('0x40')],_0xabf05c['extension'],_0xabf05c[_0xdf3c('0x147')]);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x148')]=function(_0x458e39){logger['info'](util['format'](_0xdf3c('0x149'),_0x458e39[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x458e39[_0xdf3c('0x14a')])){return this['channel']['error'](_0x458e39,_0xdf3c('0x14b'));}try{var _0x1b0ad5=eval(_0x458e39[_0xdf3c('0x14a')])?'true':_0xdf3c('0x14c');this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x14d'),_0x458e39['condition'],_0x1b0ad5));return{'code':0xc8,'result':_0x1b0ad5};}catch(_0x5ef9d0){return{'code':0xc8,'result':_0xdf3c('0x14c')};}};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x14e')]=function(_0x539721){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x539721[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x539721[_0xdf3c('0x14f')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x539721,_0xdf3c('0x150'));}var _0x1d61c5=this[_0xdf3c('0x151')][_0xdf3c('0x75')](this,_0x539721[_0xdf3c('0x14f')]);if(!_0x1d61c5){return this[_0xdf3c('0xf')]['error'](_0x539721,_0xdf3c('0x152'));}for(var _0x176fe=0x0;_0x176fe<_0x1d61c5[_0xdf3c('0xa2')];_0x176fe+=0x1){var _0x4b9541=this[_0xdf3c('0xf')][_0xdf3c('0x12')](util[_0xdf3c('0x2c')](_0xdf3c('0x153'),_0x1d61c5[_0x176fe]));if(_0x4b9541['result']===-0x1){return _0x4b9541;}logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x154'),_0x1d61c5[_0x176fe],_0x4b9541[_0xdf3c('0xaa')]));if(_0x4b9541[_0xdf3c('0xaa')]===_0xdf3c('0x155')){logger['info'](util[_0xdf3c('0x2c')]('IFTIME\x20%s\x20%s',_0x1d61c5[_0x176fe],_0xdf3c('0x155')));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x154'),_0x1d61c5[_0x176fe],_0xdf3c('0x155')));return{'code':0xc8,'result':_0xdf3c('0x155')};}else{logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x154'),_0x1d61c5[_0x176fe],'false'));this[_0xdf3c('0xf')]['noop'](util['format'](_0xdf3c('0x154'),_0x1d61c5[_0x176fe],_0xdf3c('0x14c')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xdf3c('0x11')]['hangup']=function(_0x5e1d8b){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x156'),_0x5e1d8b[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')][_0xdf3c('0x157')]();};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x158')]=function(_0x4c82c4){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x159'),_0x4c82c4[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x4c82c4[_0xdf3c('0x88')])){return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0xed'));}var _0x178d3e=_0xdf3c('0x138');var _0x5857e7=util['format'](_0xdf3c('0x141'),FILES_PATH,rs['generate'](0x4));var _0x7f3f0b=util['format'](_0xdf3c('0xa5'),_0x5857e7,_0x178d3e);var _0x209c4f=!![];if(_0x4c82c4['beep']===_0xdf3c('0x139')){_0x209c4f=![];}var _0x2a37bc=this[_0xdf3c('0xf')][_0xdf3c('0x13a')](_0x5857e7,_0x178d3e,_0x4c82c4[_0xdf3c('0x13b')],_0x4c82c4[_0xdf3c('0x6b')],undefined,_0x209c4f);if(_0x2a37bc['result']!==-0x1){this['channel'][_0xdf3c('0xb0')](util['format'](_0xdf3c('0x15a'),_0x7f3f0b));var _0x1af97a=this[_0xdf3c('0x8a')][_0xdf3c('0x75')](this,_0x4c82c4,_0x7f3f0b);if(_0x1af97a){for(var _0x1263bf in _0x1af97a){if(_0x1af97a[_0xdf3c('0x9d')](_0x1263bf)){this['channel']['setVariable'](util['format'](_0xdf3c('0x15b'),_0x1263bf['toUpperCase']()),_0x1af97a[_0x1263bf]);}}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0x15c'),JSON[_0xdf3c('0x78')](_0x1af97a)));}}return _0x2a37bc;};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x15d')]=function(_0x2beff1){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x15e'),_0x2beff1['label']));if(!this[_0xdf3c('0x8c')](_0x2beff1[_0xdf3c('0x88')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xed'));}if(!this[_0xdf3c('0x8c')](_0x2beff1[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x15f'),_0x2beff1[_0xdf3c('0x62')]));var _0x516aa3=this[_0xdf3c('0x87')]['sync'](this,_0x2beff1);if(_0x516aa3){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0x15a'),_0x516aa3));var _0x23fad4=this['channel'][_0xdf3c('0x109')](_0x516aa3,_0x2beff1[_0xdf3c('0x13b')]);try{fs[_0xdf3c('0x10a')](_0x516aa3+_0xdf3c('0x10b'));}catch(_0x5add00){logger['error'](_0x5add00);}return _0x23fad4;}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x2beff1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x160')]=function(_0x78ff07){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x161'),_0x78ff07[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x78ff07['findBy'])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x78ff07,_0xdf3c('0x162'));}logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x163'),this[_0xdf3c('0xf')]['callerid'],_0x78ff07[_0xdf3c('0x164')]));var _0x118a21=this[_0xdf3c('0x57')][_0xdf3c('0x75')](this,_0x78ff07[_0xdf3c('0x164')]);if(_0x118a21){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x78ff07['findBy']));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x78ff07[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x166')};}else{logger['info'](util['format'](_0xdf3c('0x167'),this['channel'][_0xdf3c('0x3d')],_0x78ff07[_0xdf3c('0x164')]));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x78ff07[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x168')};}};AGIVertices[_0xdf3c('0x11')]['logout']=function(_0x4fcf64){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x169'),_0x4fcf64[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x4fcf64[_0xdf3c('0x164')])){return this['channel'][_0xdf3c('0x2f')](_0x4fcf64,_0xdf3c('0x162'));}logger[_0xdf3c('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdf3c('0xf')]['callerid'],_0x4fcf64['findBy']));var _0x136935=this[_0xdf3c('0x56')]['sync'](this,_0x4fcf64[_0xdf3c('0x164')]);if(_0x136935){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x4fcf64[_0xdf3c('0x164')]));this['channel']['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x4fcf64[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x166')};}else{logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x167'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x4fcf64[_0xdf3c('0x164')]));this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x167'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x4fcf64[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x168')};}};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x16a')]=function(_0x243447){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x16b'),_0x243447[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0x243447[_0xdf3c('0x16c')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x243447,_0xdf3c('0x16d'));}this['channel'][_0xdf3c('0xb0')](util['format'](_0xdf3c('0x16e'),_0x243447[_0xdf3c('0x16c')]));var _0x4a9157=eval(_0x243447[_0xdf3c('0x16c')]);if(!this[_0xdf3c('0x8c')](_0x243447[_0xdf3c('0xde')])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0xdd'));}var _0x172b7c=this['getVariable'][_0xdf3c('0x75')](this,_0x243447['variable_id']);if(!_0x172b7c){return this[_0xdf3c('0xf')]['error'](_0x243447,_0xdf3c('0x120'));}if(_[_0xdf3c('0xa1')](_0x4a9157)){var _0x56d4db=this;_0x4a9157[_0xdf3c('0xdf')](function(_0x5c8dcc,_0x399564){_0x56d4db[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0x16f'),_0x172b7c,_0x399564),_0x5c8dcc);});return this[_0xdf3c('0xf')]['noop'](util['format'](_0xdf3c('0x170'),_0x172b7c));}else{return this['channel'][_0xdf3c('0xa4')](_0x172b7c,_0x4a9157);}};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0xd')]=function(_0x53ccf7){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x53ccf7['label']));if(_0x53ccf7[_0xdf3c('0xaf')]===0x0){return this['maxRetry'](_0x53ccf7);}_0x53ccf7[_0xdf3c('0xaf')]-=0x1;if(!this[_0xdf3c('0x8c')](_0x53ccf7[_0xdf3c('0x119')])){return this[_0xdf3c('0xf')]['error'](_0x53ccf7,'no\x20file\x20audio\x20selected');}var _0xc7732c=this[_0xdf3c('0x21')][_0xdf3c('0x75')](this,_0x53ccf7[_0xdf3c('0x119')]);if(!_0xc7732c){return this[_0xdf3c('0xf')]['error'](_0x53ccf7,_0xdf3c('0x171'));}var _0x242fc1=this[_0xdf3c('0xf')][_0xdf3c('0x11b')](_0xc7732c,_0x53ccf7[_0xdf3c('0x11c')],_0x53ccf7[_0xdf3c('0x172')]);var _0x5c0853=_0x242fc1[_0xdf3c('0xac')];if(_0x242fc1['result']===-0x1){this[_0xdf3c('0x39')]['sync'](this,_0x53ccf7,'-1');return _0x242fc1;}else if(_0x242fc1[_0xdf3c('0xaa')]===_0xdf3c('0x6b')){_0x242fc1['result']=_0x242fc1[_0xdf3c('0xac')]['length']>0x0?_0x242fc1[_0xdf3c('0xac')]:'t';}else if(_[_0xdf3c('0x47')](_0x242fc1[_0xdf3c('0xac')])){_0x242fc1[_0xdf3c('0xac')]='#';_0x5c0853='#';}if(!this[_0xdf3c('0x8c')](_0x53ccf7[_0xdf3c('0xde')])){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xdd'));}else{var _0xfa1485=this[_0xdf3c('0x12')][_0xdf3c('0x75')](this,_0x53ccf7[_0xdf3c('0xde')]);if(!_0xfa1485){return this['channel'][_0xdf3c('0x2f')](_0x53ccf7,_0xdf3c('0x120'));}this[_0xdf3c('0xf')][_0xdf3c('0xa4')](_0xfa1485,_0x5c0853);}this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x53ccf7,_0x5c0853);return _0x242fc1;};AGIVertices['prototype']['noop']=function(_0x3c98b1){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x173'),_0x3c98b1['label']));return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0x3c98b1[_0xdf3c('0x174')]||_0x3c98b1['label']);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x175')]=function(_0x353039){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x176'),_0x353039[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x353039[_0xdf3c('0x164')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x353039,'no\x20find\x20by\x20configured');}logger[_0xdf3c('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x353039[_0xdf3c('0x164')]));var _0x193f32=this[_0xdf3c('0x52')][_0xdf3c('0x75')](this,_0x353039['pause_id']);var _0xa1c12d=this['agentPause'][_0xdf3c('0x75')](this,_0x353039[_0xdf3c('0x164')],_0x193f32);if(_0xa1c12d){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')]['callerid'],_0x353039[_0xdf3c('0x164')]));this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x353039[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x166')};}else{logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x167'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x353039[_0xdf3c('0x164')]));this[_0xdf3c('0xf')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x353039[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x168')};}};AGIVertices['prototype'][_0xdf3c('0x177')]=function(_0x337ffb){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x178'),_0x337ffb[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0x337ffb[_0xdf3c('0x119')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x337ffb,'no\x20file\x20audio\x20selected');}var _0x37915a=this['getSound']['sync'](this,_0x337ffb[_0xdf3c('0x119')]);if(!_0x37915a){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x337ffb,_0xdf3c('0x171'));}var _0x396ef2=this[_0xdf3c('0xf')][_0xdf3c('0x5c')](_0xdf3c('0x179'),[_0x37915a,_0x337ffb[_0xdf3c('0x115')]]);if(_0x396ef2['result']===-0x1){return _0x396ef2;}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0xca'),_0xdf3c('0x179'),_0x37915a));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x17a')]=function(_0xeeba72){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x17b'),_0xeeba72[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0xeeba72[_0xdf3c('0x17c')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0xeeba72,_0xdf3c('0x17d'));}var _0xb0062b='';var _0x29c058=parseInt(_0xeeba72[_0xdf3c('0x17c')],0xa);if(isNaN(_0x29c058)){_0xb0062b=_0xeeba72[_0xdf3c('0x17c')];}else{_0xb0062b=this[_0xdf3c('0x16')][_0xdf3c('0x75')](this,_0xeeba72['queue_id']);if(!_0xb0062b){return this[_0xdf3c('0xf')]['error'](_0xeeba72,_0xdf3c('0x17e'));}}var _0x5199cc='';if(this[_0xdf3c('0x8c')](_0xeeba72['file_id'])){var _0x36fc26=this['getSound'][_0xdf3c('0x75')](this,_0xeeba72['file_id']);if(_0x36fc26){_0x5199cc=_0x36fc26;}}this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0xeeba72,_0xb0062b);if(_0xeeba72[_0xdf3c('0x115')]['indexOf']('x')<0x0){_0xeeba72[_0xdf3c('0x115')]+='x';}if(_0xeeba72['opts'][_0xdf3c('0x17f')]('X')<0x0){_0xeeba72[_0xdf3c('0x115')]+='X';}this[_0xdf3c('0xf')][_0xdf3c('0xa4')](_0xdf3c('0x180'),_0xb0062b?_0xb0062b[_0xdf3c('0x181')]():'');var _0x159cb2=this[_0xdf3c('0xf')][_0xdf3c('0x5c')](_0xdf3c('0x182'),[_0xb0062b,_0xeeba72[_0xdf3c('0x115')],_0xeeba72[_0xdf3c('0x6a')],_0x5199cc,_0xeeba72[_0xdf3c('0x6b')],_0xeeba72[_0xdf3c('0x8')],_0xeeba72[_0xdf3c('0x183')],_0xeeba72[_0xdf3c('0x184')],'',_0xeeba72['position']]);if(_0x159cb2[_0xdf3c('0xac')]===-0x1){return _0x159cb2;}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0xca'),'QUEUE',_0xb0062b));};AGIVertices['prototype'][_0xdf3c('0x185')]=function(_0x2bf18c){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2bf18c[_0xdf3c('0x3b')]));var _0x7a9747=_0x2bf18c['recordingFormat']||'wav';var _0x58465d=util['format'](_0xdf3c('0x186'),this[_0xdf3c('0xf')]['uniqueid'],rs[_0xdf3c('0x122')](0x5));var _0x4c3e3d=util[_0xdf3c('0x2c')](_0xdf3c('0x187'),FILES_PATH,_0x58465d,_0x7a9747);var _0x5b0483=util[_0xdf3c('0x2c')](_0xdf3c('0x141'),FILES_PATH,_0x58465d);this['createSquareRecording'][_0xdf3c('0x75')](this,_0x2bf18c,_0x58465d,_0x4c3e3d);this[_0xdf3c('0xf')]['setVariable'](_0xdf3c('0x188'),_0x58465d);logger[_0xdf3c('0x31')](_0xdf3c('0x189'),_0x5b0483,_0x7a9747,_0x2bf18c[_0xdf3c('0x18a')],_0x2bf18c[_0xdf3c('0x6b')]);return this[_0xdf3c('0xf')][_0xdf3c('0x13a')](_0x5b0483,_0x7a9747,_0x2bf18c[_0xdf3c('0x18a')],_0x2bf18c['timeout'],undefined,!![]);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x18b')]=function(_0x1009c6){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x18c'),_0x1009c6[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x1009c6['url'])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0x18d'));}var _0x4fb97e=this['restAPI'][_0xdf3c('0x75')](this,_0x1009c6);logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x18e'),util['inspect'](_0x4fb97e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1009c6['variable_id'])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0x18f'));}var _0x517e73=this['getVariable'][_0xdf3c('0x75')](this,_0x1009c6['variable_id']);if(!_0x517e73){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x1009c6,'no\x20variable\x20found');}this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0x190'),_0x517e73),_0x4fb97e[_0xdf3c('0x7a')]?_0x4fb97e['statusCode']:_0xdf3c('0x191'));this[_0xdf3c('0xf')][_0xdf3c('0xa4')](util[_0xdf3c('0x2c')](_0xdf3c('0x192'),_0x517e73),_0x4fb97e[_0xdf3c('0x7b')]?_0x4fb97e[_0xdf3c('0x7b')]:'OK');if(_0x4fb97e['body']){try{this['saveRestApiResult'](_0x4fb97e[_0xdf3c('0x6f')],_0x517e73);}catch(_0x439d2e){logger[_0xdf3c('0x2f')](util[_0xdf3c('0x2c')](_0xdf3c('0x193'),_0x517e73));}}return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xe1'),_0x517e73));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x194')]=function(_0x3696b8){logger['info'](util['format'](_0xdf3c('0x195'),_0x3696b8[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')]['sayDigits'](_0x3696b8[_0xdf3c('0x196')][_0xdf3c('0x5e')](/\s+/g,''),_0x3696b8[_0xdf3c('0x18a')]);};AGIVertices['prototype'][_0xdf3c('0x197')]=function(_0x1c56e0){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x198'),_0x1c56e0[_0xdf3c('0x3b')]));return this[_0xdf3c('0xf')][_0xdf3c('0x199')](_0x1c56e0[_0xdf3c('0x6c')][_0xdf3c('0x5e')](/\s+/g,''),_0x1c56e0[_0xdf3c('0x18a')]);};AGIVertices['prototype'][_0xdf3c('0x19a')]=function(_0x4ec4cd){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x19b'),_0x4ec4cd[_0xdf3c('0x3b')]));return this['channel']['sayPhonetic'](_0x4ec4cd['text'],_0x4ec4cd[_0xdf3c('0x18a')]);};AGIVertices['prototype'][_0xdf3c('0x19c')]=function(_0x5120ed){logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x19d'),_0x5120ed[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x5120ed[_0xdf3c('0x19e')])){return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0x19f'));}var _0xff480=this['getMailAccount']['sync'](this,_0x5120ed['account_id']);if(!_0xff480||!_0xff480['Smtp']){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x5120ed,'no\x20mail\x20account\x20found');}var _0x53a9c2={'from':util['format'](_0xdf3c('0x1a0'),_0xff480[_0xdf3c('0x18')],_0xff480[_0xdf3c('0x1a1')]||_0xff480[_0xdf3c('0x1a2')][_0xdf3c('0x1a3')]),'to':_0x5120ed['to']||'','cc':_0x5120ed['cc']||'','bcc':_0x5120ed[_0xdf3c('0x1a4')]||'','subject':_0x5120ed[_0xdf3c('0x1a5')],'html':_0x5120ed['text'],'text':_0x5120ed[_0xdf3c('0x62')]};if(this[_0xdf3c('0x8c')](_0x5120ed[_0xdf3c('0x1a6')])){}logger[_0xdf3c('0xe3')](_0xdf3c('0x1a7'),JSON[_0xdf3c('0x78')](_0x53a9c2));this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x5120ed,_0x5120ed['account_id']);this['channel']['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x1a8'),_0xff480[_0xdf3c('0x18')]));this['sendMailMessage'][_0xdf3c('0x75')](this,_0xff480[_0xdf3c('0x1a9')],_0x53a9c2);return this[_0xdf3c('0xf')][_0xdf3c('0xb0')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1aa')]=function(_0x3a2c6a){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x1ab'),_0x3a2c6a[_0xdf3c('0x3b')]));return this['channel']['noop'](_0xdf3c('0x1ac'));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1ad')]=function(_0x5420de){logger[_0xdf3c('0x31')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5420de[_0xdf3c('0x3b')]));if(!this['isConfigured'](_0x5420de[_0xdf3c('0x1ae')])){return this['channel'][_0xdf3c('0xb0')]('no\x20sms\x20account\x20configured');}var _0x5a5def=this[_0xdf3c('0x36')][_0xdf3c('0x75')](this,_0x5420de[_0xdf3c('0x1ae')]);if(!_0x5a5def){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x5420de,_0xdf3c('0x1af'));}var _0x2c4484={'body':_0x5420de['sms_text'],'phone':_0x5420de['to']||'','SmsAccountId':_0x5a5def['id']};logger['debug'](_0xdf3c('0x1b0'),JSON['stringify'](_0x2c4484));this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x5420de,_0x5420de[_0xdf3c('0x1ae')]);this['channel']['noop'](util['format'](_0xdf3c('0x1b1'),_0x5a5def['name']));this[_0xdf3c('0x38')][_0xdf3c('0x75')](this,_0x2c4484);return this['channel'][_0xdf3c('0xb0')](_0xdf3c('0x1b2'));};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1b3')]=function(_0x56807d){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')](_0xdf3c('0x1b4'),_0x56807d['label']));if(!this['isConfigured'](_0x56807d[_0xdf3c('0xde')])){return this['channel'][_0xdf3c('0x2f')](_0x56807d,'no\x20variable\x20selected');}var _0x452f92=this[_0xdf3c('0x12')][_0xdf3c('0x75')](this,_0x56807d[_0xdf3c('0xde')]);if(!_0x452f92){return this[_0xdf3c('0xf')]['error'](_0x56807d,_0xdf3c('0x120'));}return this[_0xdf3c('0xf')][_0xdf3c('0xa4')](_0x452f92,_0x56807d[_0xdf3c('0x1b5')]);};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1b6')]=function(_0x2401a0){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20START\x20(%s)\x20block',_0x2401a0['label']));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0x1b7'));var _0x32b937=this[_0xdf3c('0xf')]['getVariable'](_0xdf3c('0x1b8'));if(!_[_0xdf3c('0x47')](_0x32b937[_0xdf3c('0xaa')])){this[_0xdf3c('0xf')]['uniqueid']=_0x32b937[_0xdf3c('0xaa')];}if(_0x2401a0[_0xdf3c('0xbf')]===_0xdf3c('0x1b9')){this[_0xdf3c('0xf')][_0xdf3c('0xb0')]('Answer');return this['channel'][_0xdf3c('0xbf')]();}return this[_0xdf3c('0xf')]['noop']('Skipped\x20Answer');};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1ba')]=function(_0x5074e0){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x1bb'),_0x5074e0['label']));if(!this[_0xdf3c('0x8c')](_0x5074e0['project_id'])){return this['channel'][_0xdf3c('0x2f')](_0x5074e0,'no\x20subproject\x20selected');}var _0x29b827=this[_0xdf3c('0x19')]['sync'](this,_0x5074e0['project_id']);if(!this[_0xdf3c('0x8c')](_0x29b827)){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x5074e0,util[_0xdf3c('0x2c')](_0xdf3c('0x1bc'),_0x5074e0['project_id']));}if(_0x29b827===this[_0xdf3c('0xf')]['arg_1']){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x5074e0,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xdf3c('0x39')][_0xdf3c('0x75')](this,_0x5074e0,_0x29b827);var _0x1dd6bb=this[_0xdf3c('0xf')]['exec'](_0xdf3c('0x1bd'),util[_0xdf3c('0x2c')](_0xdf3c('0x1be'),config[_0xdf3c('0x8')][_0xdf3c('0x1bf')]||_0xdf3c('0x1c0'),_0x29b827,this[_0xdf3c('0xf')][_0xdf3c('0x3c')]));if(_0x1dd6bb[_0xdf3c('0xac')]===-0x1){return _0x1dd6bb;}return this['channel'][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0xca'),_0xdf3c('0x1bd'),_0x29b827));};AGIVertices['prototype'][_0xdf3c('0x1c1')]=function(_0x3344b8){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3344b8[_0xdf3c('0x3b')]));var _0x36fa48=this[_0xdf3c('0x5b')]['sync'](this,_0x3344b8[_0xdf3c('0xbd')]);this['createSquareDetailsReport'][_0xdf3c('0x75')](this,_0x3344b8,_0x3344b8[_0xdf3c('0xbd')]);if(this[_0xdf3c('0x8c')](_0x3344b8[_0xdf3c('0xde')])){var _0x3c669f=this[_0xdf3c('0x12')]['sync'](this,_0x3344b8[_0xdf3c('0xde')]);if(_0x3c669f){this[_0xdf3c('0xf')][_0xdf3c('0xa4')](_0x3c669f,_0x36fa48);return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0x1c2'),_0x3344b8[_0xdf3c('0xbd')],_0x3c669f));}}return this[_0xdf3c('0xf')]['noop'](util[_0xdf3c('0x2c')](_0xdf3c('0x1c3'),_0x3344b8[_0xdf3c('0xbd')]));};AGIVertices['prototype'][_0xdf3c('0x1c4')]=function(_0xbd6cd8){logger['info'](util[_0xdf3c('0x2c')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xbd6cd8[_0xdf3c('0x3b')]));_0xbd6cd8['text']=_0xbd6cd8[_0xdf3c('0x62')][_0xdf3c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xdf3c('0x8c')](_0xbd6cd8[_0xdf3c('0x60')])){return this[_0xdf3c('0xf')]['noop'](_0xdf3c('0x1c5'));}if(!this['isConfigured'](_0xbd6cd8['text'])){return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](_0xdf3c('0xb1'));}this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x1c6'),_0xbd6cd8['text']));var _0x247aea=this['googleCloudTTS'][_0xdf3c('0x75')](this,_0xbd6cd8);if(_0x247aea){this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x1c7'),_0x247aea));var _0xca74ea=this['channel'][_0xdf3c('0x109')](_0x247aea);try{fs[_0xdf3c('0x10a')](_0x247aea+'.wav');}catch(_0x2d3153){logger[_0xdf3c('0x2f')](_0x2d3153);}return _0xca74ea;}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0xbd6cd8,_0xdf3c('0x1c8'));};AGIVertices['prototype']['tts']=function(_0x1db828){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1db828[_0xdf3c('0x3b')]));_0x1db828[_0xdf3c('0x62')]=_0x1db828[_0xdf3c('0x62')][_0xdf3c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1db828[_0xdf3c('0x62')])){return this[_0xdf3c('0xf')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0xdf3c('0x2c')]('Trying\x20Google\x20TTS\x20%s',_0x1db828[_0xdf3c('0x62')]));var _0x2cf3a1=this['googleTTS']['sync'](this,_0x1db828);if(_0x2cf3a1){this[_0xdf3c('0xf')]['noop'](util['format'](_0xdf3c('0x1c9'),_0x2cf3a1));var _0x4b8c41=this['channel']['streamFile'](_0x2cf3a1);try{fs[_0xdf3c('0x10a')](_0x2cf3a1+'.wav');}catch(_0xc6f51f){logger[_0xdf3c('0x2f')](_0xc6f51f);}return _0x4b8c41;}return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x1db828,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1ca')]=function(_0x2a6deb){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x1cb'),_0x2a6deb['label']));if(!this[_0xdf3c('0x8c')](_0x2a6deb[_0xdf3c('0x164')])){return this['channel'][_0xdf3c('0x2f')](_0x2a6deb,_0xdf3c('0x162'));}logger['info'](util[_0xdf3c('0x2c')](_0xdf3c('0x163'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x2a6deb[_0xdf3c('0x164')]));var _0x33c73e=this[_0xdf3c('0x54')][_0xdf3c('0x75')](this,_0x2a6deb['findBy']);if(_0x33c73e){logger['info'](util[_0xdf3c('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x2a6deb['findBy']));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x165'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x2a6deb[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x166')};}else{logger[_0xdf3c('0x31')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xdf3c('0x3d')],_0x2a6deb[_0xdf3c('0x164')]));this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util[_0xdf3c('0x2c')](_0xdf3c('0x167'),this[_0xdf3c('0xf')][_0xdf3c('0x3d')],_0x2a6deb[_0xdf3c('0x164')]));return{'code':0xc8,'result':_0xdf3c('0x168')};}};AGIVertices[_0xdf3c('0x11')][_0xdf3c('0x1cc')]=function(_0x9ba122){logger[_0xdf3c('0x31')](util[_0xdf3c('0x2c')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x9ba122[_0xdf3c('0x3b')]));var _0x56d351=this[_0xdf3c('0xf')][_0xdf3c('0x5c')]('VOICEMAIL',[_0x9ba122[_0xdf3c('0x1cd')],_0x9ba122[_0xdf3c('0x7e')]]);if(_0x56d351[_0xdf3c('0xac')]===-0x1){return _0x56d351;}return this[_0xdf3c('0xf')][_0xdf3c('0xb0')](util['format'](_0xdf3c('0xca'),_0xdf3c('0x1ce'),_0x9ba122['mailbox']));};AGIVertices[_0xdf3c('0x11')]['vswitch']=function(_0x47b291){logger[_0xdf3c('0x31')](util['format'](_0xdf3c('0x1cf'),_0x47b291[_0xdf3c('0x3b')]));if(!this[_0xdf3c('0x8c')](_0x47b291[_0xdf3c('0xde')])){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x47b291,_0xdf3c('0x1d0'));}var _0x134616=this[_0xdf3c('0x12')][_0xdf3c('0x75')](this,_0x47b291[_0xdf3c('0xde')]);if(!_0x134616){return this[_0xdf3c('0xf')][_0xdf3c('0x2f')](_0x47b291,'no\x20variable\x20found');}var _0x282c92=this['channel'][_0xdf3c('0x12')](_0x134616);return{'code':0xc8,'result':_0x282c92[_0xdf3c('0xaa')]?_0x282c92['extra']:'-'};};String[_0xdf3c('0x11')][_0xdf3c('0xa9')]=function(_0x13d361,_0x3559e9){return this[_0xdf3c('0xa8')](_0x13d361)['join'](_0x3559e9);};module['exports']=AGIVertices; \ No newline at end of file +var _0x2caf=['variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','indexOf','XMCS-QUEUE','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','channel','rpc','prototype','getVariable','getVariableById','name','getVoiceQueueById','then','catch','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','POST','PUT','method','toUpperCase','body','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','statusCode','message','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','isString','saveRestApiResult','%s.%s','length','setVariable','split','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','DIAL','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]'];(function(_0x45f5df,_0x1a104e){var _0x510674=function(_0xda66b3){while(--_0xda66b3){_0x45f5df['push'](_0x45f5df['shift']());}};_0x510674(++_0x1a104e);}(_0x2caf,0x6a));var _0xf2ca=function(_0x224041,_0x3843aa){_0x224041=_0x224041-0x0;var _0x11195f=_0x2caf[_0x224041];return _0x11195f;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require(_0xf2ca('0x0'))();var rs=require('randomstring');var moment=require(_0xf2ca('0x1'));var Mustache=require(_0xf2ca('0x2'));var rp=require(_0xf2ca('0x3'));var logger=require(_0xf2ca('0x4'))(_0xf2ca('0x5'));var config=require(_0xf2ca('0x6'));var scripts=require(_0xf2ca('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xf2ca('0x8'),_0xf2ca('0x9')];var verticesWithRetry=[_0xf2ca('0xa'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x2fbb08,_0x22ad5d,_0x1177f0){this[_0xf2ca('0xb')]=_0x2fbb08;this[_0xf2ca('0xc')]=_0x22ad5d;this['mailRpc']=_0x1177f0;};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xe')]=function(_0x30e975,_0x4063e9){this[_0xf2ca('0xc')][_0xf2ca('0xf')](_0x30e975)['then'](function(_0x2d0cc7){_0x4063e9(null,_0x2d0cc7?_0x2d0cc7[_0xf2ca('0x10')]:![]);})['catch'](function(_0x88529f){_0x4063e9(_0x88529f);});};AGIVertices[_0xf2ca('0xd')]['getVoiceQueue']=function(_0x5502cc,_0xa4e5b1){this['rpc'][_0xf2ca('0x11')](_0x5502cc)[_0xf2ca('0x12')](function(_0x44906c){_0xa4e5b1(null,_0x44906c?_0x44906c[_0xf2ca('0x10')]:![]);})[_0xf2ca('0x13')](function(_0x2057a2){_0xa4e5b1(_0x2057a2);});};AGIVertices[_0xf2ca('0xd')]['getSquareProject']=function(_0x18500c,_0x4ea298){this[_0xf2ca('0xc')]['getSquareProjectById'](_0x18500c)[_0xf2ca('0x12')](function(_0x6a2b25){_0x4ea298(null,_0x6a2b25?_0x6a2b25['name']:![]);})[_0xf2ca('0x13')](function(_0x160230){_0x4ea298(_0x160230);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x14')]=function(_0x4581e4,_0x1ca233){this[_0xf2ca('0xc')][_0xf2ca('0x15')](_0x4581e4)[_0xf2ca('0x12')](function(_0x24dbde){_0x1ca233(null,_0x24dbde?_0x24dbde[_0xf2ca('0x16')]:![]);})['catch'](function(_0x2a7c27){_0x1ca233(_0x2a7c27);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x17')]=function(_0x51e5d7,_0x41cb71){this[_0xf2ca('0xc')][_0xf2ca('0x18')](_0x51e5d7)[_0xf2ca('0x12')](function(_0x49823b){_0x41cb71(null,_0x49823b?_0x49823b[_0xf2ca('0x10')]:![]);})[_0xf2ca('0x13')](function(_0x56ebed){_0x41cb71(_0x56ebed);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x19')]=function(_0x106e6f,_0x509e33){this['rpc'][_0xf2ca('0x1a')](_0x106e6f)[_0xf2ca('0x12')](function(_0x214fa9){_0x509e33(null,_0x214fa9?_0x214fa9[_0xf2ca('0x10')]:![]);})[_0xf2ca('0x13')](function(_0x427a17){_0x509e33(_0x427a17);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1b')]=function(_0x570aea,_0x18bca4){var _0x2b09a3=this;this[_0xf2ca('0xc')][_0xf2ca('0x1c')](_0x570aea)[_0xf2ca('0x12')](function(_0x41fc04){_0x18bca4(null,_0x41fc04?_0x2b09a3[_0xf2ca('0x1d')](_0x41fc04[_0xf2ca('0x1e')]):![]);})[_0xf2ca('0x13')](function(_0x20a523){_0x18bca4(_0x20a523);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1f')]=function(_0x3e8f86,_0x456e64){this[_0xf2ca('0xc')][_0xf2ca('0x20')](_0x3e8f86)[_0xf2ca('0x12')](function(_0x440888){_0x456e64(null,_0x440888?_0x440888:![]);})[_0xf2ca('0x13')](function(_0x49cdec){_0x456e64(_0x49cdec);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x21')]=function(_0x1c5310,_0x25066b,_0xb75964){this[_0xf2ca('0x22')][_0xf2ca('0x21')](_0x1c5310,_0x25066b)[_0xf2ca('0x12')](function(){_0xb75964(null);})[_0xf2ca('0x13')](function(_0x47bcaf){_0xb75964(_0x47bcaf);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x23')]=function(_0x8d1f59,_0x54c052){this[_0xf2ca('0xc')]['getIntervalById'](_0x8d1f59)[_0xf2ca('0x12')](function(_0x1ccaf3){if(_0x1ccaf3){if(_0x1ccaf3[_0xf2ca('0x24')]){_0x54c052(null,[_0x1ccaf3[_0xf2ca('0x25')]]);}else{_0x54c052(null,_[_0xf2ca('0x26')](_0x1ccaf3['Intervals'],'interval'));}}else{_0x54c052(null,![]);}})[_0xf2ca('0x13')](function(_0x48b49b){_0x54c052(_0x48b49b);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1d')]=function(_0x163cbe){return util[_0xf2ca('0x27')](_0xf2ca('0x28'),FILES_PATH,_0x163cbe);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x29')]=function(_0x3692b1,_0x149df1,_0x1ad216){odbc[_0xf2ca('0x2a')](_0x3692b1,function(_0x453099){if(_0x453099){logger[_0xf2ca('0x2b')](_0xf2ca('0x2c'),_0x453099);_0x1ad216(_0x453099);}else{logger[_0xf2ca('0x2d')](_0xf2ca('0x2e'));odbc['query'](_0x149df1,function(_0x3f669d,_0x3b9f02){if(_0x3f669d){logger[_0xf2ca('0x2d')](_0xf2ca('0x2f'),_0x149df1);_0x1ad216(_0x3f669d);}else{logger['info'](_0xf2ca('0x30'),_0x149df1);odbc['close'](function(_0x53c61){if(_0x53c61){logger[_0xf2ca('0x2b')](_0xf2ca('0x31'),_0x53c61);}_0x1ad216(null,_0x3b9f02);});}});}});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x32')]=function(_0x4fbaec,_0x37e50e){this[_0xf2ca('0xc')]['getSmsAccountById'](_0x4fbaec)[_0xf2ca('0x12')](function(_0x29ebce){_0x37e50e(null,_0x29ebce?_0x29ebce:![]);})[_0xf2ca('0x13')](function(_0x5396ef){_0x37e50e(_0x5396ef);});};AGIVertices[_0xf2ca('0xd')]['createSmsMessage']=function(_0x128419,_0x441c91){this[_0xf2ca('0xc')][_0xf2ca('0x33')](_0x128419)[_0xf2ca('0x12')](function(_0x3f2e98){_0x441c91(null,_0x3f2e98);})[_0xf2ca('0x13')](function(_0xe4494c){_0x441c91(_0xe4494c);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x34')]=function(_0x17de81,_0x3360d9,_0x1f22fc){this[_0xf2ca('0xc')][_0xf2ca('0x34')]({'uniqueid':this['channel'][_0xf2ca('0x35')],'node':_0x17de81[_0xf2ca('0x36')],'application':_0x17de81[_0xf2ca('0x37')],'data':_0x3360d9||null,'project_name':this[_0xf2ca('0xb')][_0xf2ca('0x38')],'callerid':this[_0xf2ca('0xb')][_0xf2ca('0x39')]})[_0xf2ca('0x12')](function(_0x2c6a39){if(_0x1f22fc){_0x1f22fc(null,_0x2c6a39);}})[_0xf2ca('0x13')](function(_0x20f215){if(_0x1f22fc){_0x1f22fc(_0x20f215);}});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x3a')]=function(_0x51a1e3,_0x530212,_0x4037c5,_0x3dfdc9){this['rpc'][_0xf2ca('0x3a')]({'uniqueid':this['channel'][_0xf2ca('0x35')],'callerid':this[_0xf2ca('0xb')][_0xf2ca('0x39')],'calleridname':this['channel'][_0xf2ca('0x3b')],'context':this[_0xf2ca('0xb')]['context'],'extension':this[_0xf2ca('0xb')][_0xf2ca('0x3c')],'priority':this[_0xf2ca('0xb')][_0xf2ca('0x3d')],'accountcode':this['channel'][_0xf2ca('0x3e')],'dnid':this[_0xf2ca('0xb')][_0xf2ca('0x3f')],'projectName':this['channel']['arg_1'],'saveName':_0x530212,'filename':_0x51a1e3[_0xf2ca('0x40')]||_0x530212,'savePath':_0x4037c5})[_0xf2ca('0x12')](function(_0x1a65c6){_0x3dfdc9(null,_0x1a65c6);})[_0xf2ca('0x13')](function(_0x3f31de){_0x3dfdc9(_0x3f31de);});};AGIVertices[_0xf2ca('0xd')]['createSquareMessage']=function(_0x4d595b,_0x22b216,_0x16cc3d,_0x5cee92,_0x2f8ba0){this['rpc'][_0xf2ca('0x41')]({'uniqueid':this['channel'][_0xf2ca('0x35')],'body':_0x4d595b,'direction':_0x22b216,'providerName':_0x16cc3d,'providerResponse':_0x5cee92})['then'](function(_0x535ac6){if(_0x2f8ba0){_0x2f8ba0(null,_0x535ac6);}})[_0xf2ca('0x13')](function(_0x2f2e90){if(_0x2f8ba0){_0x2f8ba0(_0x2f2e90);}});};AGIVertices['prototype'][_0xf2ca('0x42')]=function(_0x3b7014,_0x2eb8d5){this[_0xf2ca('0xc')][_0xf2ca('0x42')]({'firstName':_[_0xf2ca('0x43')](_0x3b7014['name'])||_[_0xf2ca('0x44')](_0x3b7014[_0xf2ca('0x10')])?'callback_'+Math[_0xf2ca('0x45')]():_0x3b7014[_0xf2ca('0x10')],'lastName':_[_0xf2ca('0x43')](_0x3b7014[_0xf2ca('0x46')])||_[_0xf2ca('0x44')](_0x3b7014['lastName'])?null:_0x3b7014['lastName'],'phone':_0x3b7014['phone'],'ListId':_0x3b7014[_0xf2ca('0x47')],'scheduledat':_0x3b7014[_0xf2ca('0x48')],'callbackUniqueid':this[_0xf2ca('0xb')][_0xf2ca('0x35')],'tags':'callback','description':_0xf2ca('0x49')+_0x3b7014[_0xf2ca('0x48')][_0xf2ca('0x4a')](),'priority':_0x3b7014[_0xf2ca('0x4b')]})[_0xf2ca('0x12')](function(_0x2d04a8){_0x2eb8d5(null,_0x2d04a8);})[_0xf2ca('0x13')](function(_0x56b0e5){_0x2eb8d5(_0x56b0e5);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x4c')]=function(_0x2a63f7,_0x48f8c1){this[_0xf2ca('0xc')][_0xf2ca('0x4d')](_0x2a63f7)['then'](function(_0x3d71e2){_0x48f8c1(null,_0x3d71e2?_0x3d71e2[_0xf2ca('0x10')]:![]);})[_0xf2ca('0x13')](function(_0x5efa0b){_0x48f8c1(_0x5efa0b);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x4e')]=function(_0xd867b4,_0x2b94e2,_0x549e92){var _0x57dba5={'role':_0xf2ca('0x4f')};_0x57dba5[_0xd867b4]=this[_0xf2ca('0xb')][_0xf2ca('0x39')];this[_0xf2ca('0xc')]['agentPause'](_0x57dba5,_0x2b94e2,this[_0xf2ca('0xb')]['uniqueid'])[_0xf2ca('0x12')](function(_0x1e579f){_0x549e92(null,_[_0xf2ca('0x44')](_0x1e579f)?![]:!![]);})[_0xf2ca('0x13')](function(_0x5e046d){logger[_0xf2ca('0x2b')](_0x5e046d);_0x549e92(null,![]);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x50')]=function(_0x359eef,_0x40364c){var _0x1c0c42={'role':'agent'};_0x1c0c42[_0x359eef]=this[_0xf2ca('0xb')][_0xf2ca('0x39')];this[_0xf2ca('0xc')][_0xf2ca('0x50')](_0x1c0c42)[_0xf2ca('0x12')](function(_0x490092){_0x40364c(null,_[_0xf2ca('0x44')](_0x490092)?![]:!![]);})[_0xf2ca('0x13')](function(_0x4154ed){logger['error'](_0x4154ed);_0x40364c(null,![]);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x51')]=function(_0x300158,_0x37837a){var _0x315420={'role':_0xf2ca('0x4f')};_0x315420[_0x300158]=this[_0xf2ca('0xb')]['callerid'];this['rpc']['agentLogout'](_0x315420)[_0xf2ca('0x12')](function(_0x456887){_0x37837a(null,_[_0xf2ca('0x44')](_0x456887)?![]:!![]);})[_0xf2ca('0x13')](function(_0xbf858d){logger['error'](_0xbf858d);_0x37837a(null,![]);});};AGIVertices['prototype'][_0xf2ca('0x52')]=function(_0x4bc0dd,_0x1ebce5){var _0x5e66b8={'role':'agent'};_0x5e66b8[_0x4bc0dd]=this['channel'][_0xf2ca('0x39')];var _0xf656fc=_0x4bc0dd!=_0xf2ca('0x53')?util[_0xf2ca('0x27')](_0xf2ca('0x54'),_0xf2ca('0x55'),this[_0xf2ca('0xb')][_0xf2ca('0x39')]):undefined;this['rpc'][_0xf2ca('0x52')](_0x5e66b8,_0xf656fc)[_0xf2ca('0x12')](function(_0x204a59){_0x1ebce5(null,_[_0xf2ca('0x44')](_0x204a59)?![]:!![]);})['catch'](function(_0xba50b2){logger[_0xf2ca('0x2b')](_0xba50b2);_0x1ebce5(null,![]);});};AGIVertices['prototype'][_0xf2ca('0x56')]=function(_0x5ca4ca,_0x438b0f){sh['exec'](_[_0xf2ca('0x57')](_0x5ca4ca),function(_0x2f0ac3,_0x3f0536){var _0x5e3fb7=_0x3f0536[_0xf2ca('0x58')](/(\r\n|\n|\r)/gm,'');_0x438b0f(null,_0x5e3fb7);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x5a6def,_0x30ccc4){scripts[_0xf2ca('0x59')](_0x5a6def[_0xf2ca('0x5a')],_0x5a6def[_0xf2ca('0x5b')]||'text',_0x5a6def[_0xf2ca('0x5c')],_0x5a6def[_0xf2ca('0x5d')]||'en-US',_0x5a6def[_0xf2ca('0x5e')]||_0xf2ca('0x5f'),_0x5a6def['audioEncoding']||_0xf2ca('0x60'))[_0xf2ca('0x12')](function(_0x1b53c6){_0x30ccc4(null,_0x1b53c6);})[_0xf2ca('0x13')](function(_0x242ffe){_0x30ccc4(_0x242ffe);});};AGIVertices[_0xf2ca('0xd')]['googleTTS']=function(_0x22a17d,_0x29c117){scripts[_0xf2ca('0x61')](_0x22a17d[_0xf2ca('0x5c')],_0x22a17d[_0xf2ca('0x62')]||'en',0x1)[_0xf2ca('0x12')](function(_0x436d17){_0x29c117(null,_0x436d17);})['catch'](function(_0x242dc0){_0x29c117(_0x242dc0);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x63')]=function(_0x424dad,_0x5bea6e){var _0x581886={'uri':_0x424dad[_0xf2ca('0x64')],'method':_0x424dad['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x424dad['timeout'])===_0xf2ca('0x65')&&parseInt(_0x424dad[_0xf2ca('0x66')])>=0x1?parseInt(_0x424dad[_0xf2ca('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xf2ca('0x67'),_0xf2ca('0x68')],_0x581886[_0xf2ca('0x69')][_0xf2ca('0x6a')]())){try{_0x581886[_0xf2ca('0x6b')]=_0x424dad['rawBody']?JSON[_0xf2ca('0x6c')](_0x424dad[_0xf2ca('0x9')]):{};}catch(_0x5b7d19){logger[_0xf2ca('0x2b')](_0xf2ca('0x6d'),_0x5b7d19);}}try{_0x581886[_0xf2ca('0x6e')]=_0x424dad[_0xf2ca('0x8')]?JSON[_0xf2ca('0x6c')](_0x424dad[_0xf2ca('0x8')]):{};}catch(_0x14b9cd){logger[_0xf2ca('0x2b')](_0xf2ca('0x6f'),_0x14b9cd);}if(_0x424dad['computedVariables']){try{var _0x4453ba=require(_0x424dad[_0xf2ca('0x70')])[_0xf2ca('0x71')](this,_0x581886);_0x581886[_0xf2ca('0x72')]=Mustache[_0xf2ca('0x73')](_0x424dad[_0xf2ca('0x64')],_0x4453ba,{},['$$','$$']);if(_0x581886['headers']){_0x581886['headers']=JSON[_0xf2ca('0x6c')](Mustache[_0xf2ca('0x73')](JSON[_0xf2ca('0x74')](_0x581886[_0xf2ca('0x6e')]),_0x4453ba,{},['$$','$$']));}if(_0x581886[_0xf2ca('0x6b')]){_0x581886[_0xf2ca('0x6b')]=JSON[_0xf2ca('0x6c')](Mustache[_0xf2ca('0x73')](JSON['stringify'](_0x581886[_0xf2ca('0x6b')]),_0x4453ba,{},['$$','$$']));}}catch(_0x1b16b1){logger[_0xf2ca('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1b16b1);}}rp(_0x581886)[_0xf2ca('0x12')](function(_0x3d1f8){var _0xd924da={'statusCode':_0x3d1f8[_0xf2ca('0x75')]||0xc8,'statusMessage':_0x3d1f8['statusMessage']||'OK','headers':_0x3d1f8[_0xf2ca('0x6e')]||{},'body':_0x3d1f8[_0xf2ca('0x6b')]||{}};_0x5bea6e(null,_0xd924da);})[_0xf2ca('0x13')](function(_0x373b5f){var _0x850fa6={'statusCode':_0x373b5f['statusCode']||0x1f4,'statusMessage':_0x373b5f[_0xf2ca('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x373b5f[_0xf2ca('0x77')][_0xf2ca('0x6e')]||{},'body':_0x373b5f[_0xf2ca('0x77')][_0xf2ca('0x6b')]||{}};_0x5bea6e(null,_0x850fa6);});};AGIVertices['prototype']['googleDialogflow']=function(_0x1bb147,_0x1d3e6f){scripts[_0xf2ca('0x78')](this[_0xf2ca('0xb')][_0xf2ca('0x35')],_0x1bb147[_0xf2ca('0x79')],_0x1bb147[_0xf2ca('0x5c')],_0x1bb147[_0xf2ca('0x7a')]||'en')['then'](function(_0x7c3113){_0x1d3e6f(null,_0x7c3113);})[_0xf2ca('0x13')](function(_0x149066){_0x1d3e6f(_0x149066);});};AGIVertices[_0xf2ca('0xd')]['googleDialogflowV2']=function(_0x494761,_0x23f9cf){scripts['googleDialogflowV2'](this[_0xf2ca('0xb')][_0xf2ca('0x35')],_0x494761[_0xf2ca('0x7b')],_0x494761[_0xf2ca('0x7c')],_0x494761['private_key'],_0x494761[_0xf2ca('0x5c')],_0x494761['dialogflowV2_language']||'en')[_0xf2ca('0x12')](function(_0x1bc4c2){_0x23f9cf(null,_0x1bc4c2);})[_0xf2ca('0x13')](function(_0x49ff48){_0x23f9cf(_0x49ff48);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x7d')]=function(_0x278f5b,_0x1f9151){scripts[_0xf2ca('0x7d')](this['channel'],_0x278f5b)['then'](function(_0x182dfd){_0x1f9151(null,_0x182dfd);})[_0xf2ca('0x13')](function(_0x17148d){_0x1f9151(_0x17148d);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x7e')]=function(_0x26180e,_0xd9b3f3){scripts[_0xf2ca('0x7e')](_0x26180e[_0xf2ca('0x79')],_0x26180e[_0xf2ca('0x5c')],_0x26180e[_0xf2ca('0x7f')]||_0xf2ca('0x80'),_0x26180e[_0xf2ca('0x81')])['then'](function(_0x3a9194){_0xd9b3f3(null,_0x3a9194);})['catch'](function(_0x564ef2){_0xd9b3f3(_0x564ef2);});};AGIVertices['prototype'][_0xf2ca('0x82')]=function(_0x37a711,_0x367322,_0x3782fc){scripts[_0xf2ca('0x82')](_0x367322,_0x37a711[_0xf2ca('0x79')],_0x37a711[_0xf2ca('0x83')]||_0xf2ca('0x80'),this[_0xf2ca('0x84')](_0x37a711[_0xf2ca('0x85')])?_0x37a711[_0xf2ca('0x85')]:undefined)['then'](function(_0x4a9748){_0x3782fc(null,_0x4a9748);})['catch'](function(_0x254377){_0x3782fc(_0x254377);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x86')]=function(_0x44d999,_0x53cd2c){scripts[_0xf2ca('0x86')](_0x44d999[_0xf2ca('0x87')],_0x44d999['aws_secret_access_key'],_0x44d999[_0xf2ca('0x88')],_0x44d999[_0xf2ca('0x89')]||_0xf2ca('0x8a'),_0x44d999[_0xf2ca('0x5c')],_0x44d999[_0xf2ca('0x8b')]||_0xf2ca('0x5c'))[_0xf2ca('0x12')](function(_0x1b3f41){_0x53cd2c(null,_0x1b3f41);})[_0xf2ca('0x13')](function(_0x27c590){_0x53cd2c(_0x27c590);});};AGIVertices[_0xf2ca('0xd')]['awsLex']=function(_0x9ebd90,_0x1c1a4c){scripts[_0xf2ca('0x8c')](this[_0xf2ca('0xb')][_0xf2ca('0x35')],_0x9ebd90[_0xf2ca('0x87')],_0x9ebd90['aws_secret_access_key'],_0x9ebd90[_0xf2ca('0x8d')],_0x9ebd90[_0xf2ca('0x5c')],_0x9ebd90['aws_bot_name'])['then'](function(_0x136ec6){_0x1c1a4c(null,_0x136ec6);})[_0xf2ca('0x13')](function(_0x31d162){_0x1c1a4c(_0x31d162);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x8e')]=function(_0x3f9019,_0x3031a5,_0x36da44){scripts[_0xf2ca('0x8e')](_0x3031a5,_0x3f9019[_0xf2ca('0x79')],_0x3f9019[_0xf2ca('0x8f')]||'en-US')[_0xf2ca('0x12')](function(_0x3f4a51){_0x36da44(null,_0x3f4a51);})[_0xf2ca('0x13')](function(_0x1d18a9){_0x36da44(_0x1d18a9);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x90')]=function(_0x370a2c,_0x1edd82,_0x34f563){scripts[_0xf2ca('0x90')](_0x1edd82,_0x370a2c[_0xf2ca('0x91')],_0x370a2c[_0xf2ca('0x92')],_0x370a2c['uri'])[_0xf2ca('0x12')](function(_0x36b066){_0x34f563(null,_0x36b066);})[_0xf2ca('0x13')](function(_0x1ad364){_0x34f563(_0x1ad364);});};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x93')]=function(_0x13d9d5){var _0x31226d=_[_0xf2ca('0x94')](verticesWithRetry,_0x13d9d5[_0xf2ca('0x37')])?_0x13d9d5:_[_0xf2ca('0x95')](_0x13d9d5);for(var _0x4598fa in _0x31226d){if(_0x31226d[_0xf2ca('0x96')](_0x4598fa)){if(_0x31226d[_0x4598fa]&&_['isString'](_0x31226d[_0x4598fa])){if(_[_0xf2ca('0x94')](recursiveMapAttributes,_0x4598fa)){_0x31226d[_0x4598fa]=this[_0xf2ca('0x97')](_0x31226d[_0x4598fa]);}else{_0x31226d[_0x4598fa]=this[_0xf2ca('0x98')](_0x31226d[_0x4598fa]);}}}}return _0x31226d;};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x99')]=function(_0x327e50){for(var _0x5796f2 in _0x327e50){if(_0x327e50[_0xf2ca('0x96')](_0x5796f2)){if(_[_0xf2ca('0x9a')](_0x327e50[_0x5796f2])){this[_0xf2ca('0x99')](_0x327e50[_0x5796f2]);}else if(_[_0xf2ca('0x9b')](_0x327e50[_0x5796f2])){for(var _0x40f7cd=0x0;_0x40f7cd<_0x327e50[_0x5796f2]['length'];_0x40f7cd++){this[_0xf2ca('0x99')](_0x327e50[_0x5796f2][_0x40f7cd]);}}else if(_[_0xf2ca('0x9c')](_0x327e50[_0x5796f2])){_0x327e50[_0x5796f2]=this[_0xf2ca('0x98')](_0x327e50[_0x5796f2]);}}}};AGIVertices[_0xf2ca('0xd')]['saveRestApiResult']=function(_0x5645b6,_0x4f02bd){for(var _0x677915 in _0x5645b6){if(_0x5645b6[_0xf2ca('0x96')](_0x677915)){if(_[_0xf2ca('0x9a')](_0x5645b6[_0x677915])){if(!_[_0xf2ca('0x43')](_0x5645b6[_0x677915])){this[_0xf2ca('0x9d')](_0x5645b6[_0x677915],util[_0xf2ca('0x27')](_0xf2ca('0x9e'),_0x4f02bd,_0x677915));}}else if(_['isArray'](_0x5645b6[_0x677915])){for(var _0x45e74d=0x0;_0x45e74d<_0x5645b6[_0x677915][_0xf2ca('0x9f')];_0x45e74d++){this[_0xf2ca('0x9d')](_0x5645b6[_0x677915][_0x45e74d],util[_0xf2ca('0x27')]('%s.%s',_0x4f02bd,_0x677915+'['+_0x45e74d+']'));}}else{if(!_[_0xf2ca('0x44')](_0x5645b6[_0x677915])){this['channel'][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0x9e'),_0x4f02bd,_0x677915),_0x5645b6[_0x677915]);}}}}};AGIVertices['prototype'][_0xf2ca('0x97')]=function(_0x2709d1){try{var _0x3e5486=JSON[_0xf2ca('0x6c')](_0x2709d1);this['recursiveNodeIndex'](_0x3e5486);return JSON[_0xf2ca('0x74')](_0x3e5486);}catch(_0x1a7b03){return this[_0xf2ca('0x98')](_0x2709d1);}};AGIVertices[_0xf2ca('0xd')]['replaceAllVariables']=function(_0x5176df){var _0x44a138=_0x5176df[_0xf2ca('0xa1')]('{');for(var _0xefe761=0x1;_0xefe761<_0x44a138[_0xf2ca('0x9f')];_0xefe761+=0x1){var _0x2c5e1e=_0x44a138[_0xefe761]['split']('}');if(_0x2c5e1e['length']>0x1){_0x5176df=_0x5176df['replaceAll']('{'+_0x2c5e1e[0x0]+'}',this[_0xf2ca('0xb')][_0xf2ca('0xe')](_0x2c5e1e[0x0])[_0xf2ca('0xa2')]||_0x2c5e1e[0x0]);}}if(_0x44a138[_0xf2ca('0x9f')]===0x1){return _0x5176df[_0xf2ca('0x4a')]();}return this[_0xf2ca('0x98')](_0x5176df);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xa3')]=function(_0x2faeaf,_0x4d3214){var _0x23a833=this[_0xf2ca('0xb')][_0xf2ca('0xe')](_0x2faeaf);if(_0x23a833[_0xf2ca('0xa4')]===-0x1){return _0x23a833;}logger[_0xf2ca('0x2d')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4d3214,_0x23a833[_0xf2ca('0xa2')]));return this[_0xf2ca('0xb')]['setVariable'](_0x4d3214,_0x23a833[_0xf2ca('0xa2')]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x84')]=function(_0x2d7ce2){return _0x2d7ce2&&_0x2d7ce2!=='0'&&_0x2d7ce2!=='-1'&&_0x2d7ce2!=='';};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xa5')]=function(_0x5989f9){this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x5989f9,'-');_0x5989f9[_0xf2ca('0xa6')]=_0x5989f9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xf2ca('0xa7')]=function(_0x58ac5f){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0xa8'),_0x58ac5f[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x58ac5f[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}var _0x4253b5='\x22'+_0x58ac5f[_0xf2ca('0x5c')]+'\x22';if(this[_0xf2ca('0x84')](_0x58ac5f[_0xf2ca('0x77')])){_0x4253b5+=','+_0x58ac5f[_0xf2ca('0x77')];}var _0x4b0478=this[_0xf2ca('0xb')][_0xf2ca('0xab')](_0xf2ca('0xac'),_0x4253b5);if(_0x4b0478[_0xf2ca('0xa4')]===-0x1){return _0x4b0478;}return this['channel']['noop'](util[_0xf2ca('0x27')](_0xf2ca('0xad'),_0x4253b5));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xae')]=function(_0x5808e5){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xaf'),_0x5808e5['label']));if(!this[_0xf2ca('0x84')](_0x5808e5[_0xf2ca('0xb0')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xb1'));}var _0x5da17f=_0x5808e5[_0xf2ca('0xb0')];if(this[_0xf2ca('0x84')](_0x5808e5['options'])){_0x5da17f+=','+_0x5808e5[_0xf2ca('0x77')];}var _0x44db90=this[_0xf2ca('0xb')][_0xf2ca('0xab')]('MRCPRecog',_0x5da17f);if(_0x44db90['result']===-0x1){return _0x44db90;}var _0x272e23=this[_0xf2ca('0xa3')](_0xf2ca('0xb2'),'MRCP_RECOG_CONFIDENCE');if(_0x272e23[_0xf2ca('0xa4')]===-0x1){return _0x272e23;}var _0x4cc643=this[_0xf2ca('0xa3')](_0xf2ca('0xb3'),_0xf2ca('0xb4'));if(_0x4cc643['result']===-0x1){return _0x4cc643;}var _0x3bea88=this[_0xf2ca('0xa3')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x3bea88['result']===-0x1){return _0x3bea88;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util['format'](_0xf2ca('0xb5'),_0x5da17f));};AGIVertices[_0xf2ca('0xd')]['agi']=function(_0x7e8fda){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0xb6'),_0x7e8fda[_0xf2ca('0x36')]));return this['channel'][_0xf2ca('0x5')]([_0x7e8fda[_0xf2ca('0xb7')],_0x7e8fda[_0xf2ca('0xb8')]]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xb9')]=function(_0x507961){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x507961['label']));if(this[_0xf2ca('0x84')](_0x507961[_0xf2ca('0x66')])){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xba'),_0x507961['timeout']));var _0x2ac7c9=this[_0xf2ca('0xb')][_0xf2ca('0xbb')](_0x507961[_0xf2ca('0x66')]);if(_0x2ac7c9[_0xf2ca('0xa4')]===-0x1){return _0x2ac7c9;}}return this[_0xf2ca('0xb')][_0xf2ca('0xb9')]();};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xbc')]=function(_0xefb798){logger[_0xf2ca('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xefb798[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0xefb798[_0xf2ca('0x47')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0xefb798,'no\x20list\x20selected');}_0xefb798[_0xf2ca('0x48')]=moment();if(this['isConfigured'](_0xefb798[_0xf2ca('0xbd')])){_0xefb798['scheduledAt']=moment()['add'](_0xefb798[_0xf2ca('0xbd')],'minutes');}if(!this[_0xf2ca('0x84')](_0xefb798[_0xf2ca('0x4b')])){_0xefb798[_0xf2ca('0x4b')]=0x2;}this[_0xf2ca('0x42')][_0xf2ca('0x71')](this,_0xefb798);return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0xbe'),_0xefb798[_0xf2ca('0xbf')],_0xefb798[_0xf2ca('0x47')],_0xefb798[_0xf2ca('0x48')]));};AGIVertices[_0xf2ca('0xd')]['custom_app']=function(_0x5688c4){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0xc0'),_0x5688c4[_0xf2ca('0x36')]));var _0x3df46a=this['channel'][_0xf2ca('0xab')](_0x5688c4[_0xf2ca('0xc1')],_0x5688c4['options']);if(_0x3df46a[_0xf2ca('0xa4')]===-0x1){return _0x3df46a;}return this[_0xf2ca('0xb')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5688c4[_0xf2ca('0xc1')],_0x5688c4[_0xf2ca('0x77')]));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xc2')]=function(_0x2d6356){logger['info'](util['format'](_0xf2ca('0xc3'),_0x2d6356[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x2d6356[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}var _0x50d895='\x22'+_0x2d6356[_0xf2ca('0x5c')]+'\x22';if(this['isConfigured'](_0x2d6356[_0xf2ca('0x77')])){_0x50d895+=','+_0x2d6356[_0xf2ca('0x77')];}var _0x3d5945=this[_0xf2ca('0xb')][_0xf2ca('0xab')](_0xf2ca('0xac'),_0x50d895);if(_0x3d5945[_0xf2ca('0xa4')]===-0x1){return _0x3d5945;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xad'),_0x50d895));};AGIVertices[_0xf2ca('0xd')]['sestektts']=function(_0x272bb0){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xc4'),_0x272bb0[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x272bb0[_0xf2ca('0x5c')])){return this['channel'][_0xf2ca('0xa9')]('no\x20text\x20configured');}var _0x428bb7='\x22'+_0x272bb0[_0xf2ca('0x5c')]+'\x22';if(this[_0xf2ca('0x84')](_0x272bb0[_0xf2ca('0x77')])){_0x428bb7+=','+_0x272bb0['options'];}var _0x1556ae=this[_0xf2ca('0xb')]['exec'](_0xf2ca('0xac'),_0x428bb7);if(_0x1556ae['result']===-0x1){return _0x1556ae;}return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x428bb7));};AGIVertices[_0xf2ca('0xd')]['lumenvoxasr']=function(_0x416b6f){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xc5'),_0x416b6f[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x416b6f[_0xf2ca('0xb0')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')]('no\x20grammar\x20configured');}var _0xaa2282=_0x416b6f[_0xf2ca('0xb0')];if(this[_0xf2ca('0x84')](_0x416b6f[_0xf2ca('0x77')])){_0xaa2282+=','+_0x416b6f[_0xf2ca('0x77')];}var _0x18d308=this['channel'][_0xf2ca('0xab')](_0xf2ca('0xc6'),_0xaa2282);if(_0x18d308[_0xf2ca('0xa4')]===-0x1){return _0x18d308;}var _0x38ce26=this[_0xf2ca('0xa3')]('RECOG_CONFIDENCE()',_0xf2ca('0xc7'));if(_0x38ce26[_0xf2ca('0xa4')]===-0x1){return _0x38ce26;}var _0x422ebc=this[_0xf2ca('0xa3')]('RECOG_INPUT()',_0xf2ca('0xc8'));if(_0x422ebc['result']===-0x1){return _0x422ebc;}var _0x27bab4=this[_0xf2ca('0xa3')](_0xf2ca('0xc9'),_0xf2ca('0xca'));if(_0x27bab4[_0xf2ca('0xa4')]===-0x1){return _0x27bab4;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0xaa2282));};AGIVertices['prototype'][_0xf2ca('0xcb')]=function(_0x169bbe){logger[_0xf2ca('0x2d')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x169bbe[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x169bbe['grammar'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xb1'));}var _0x5505a5=_0x169bbe[_0xf2ca('0xb0')];if(this[_0xf2ca('0x84')](_0x169bbe[_0xf2ca('0x77')])){_0x5505a5+=','+_0x169bbe[_0xf2ca('0x77')];}var _0xcee971=this[_0xf2ca('0xb')][_0xf2ca('0xab')](_0xf2ca('0xc6'),_0x5505a5);if(_0xcee971[_0xf2ca('0xa4')]===-0x1){return _0xcee971;}var _0x2ab1f9=this[_0xf2ca('0xa3')](_0xf2ca('0xb2'),_0xf2ca('0xcc'));if(_0x2ab1f9['result']===-0x1){return _0x2ab1f9;}var _0x16f90d=this[_0xf2ca('0xa3')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x16f90d[_0xf2ca('0xa4')]===-0x1){return _0x16f90d;}var _0x4e7637=this[_0xf2ca('0xa3')](_0xf2ca('0xc9'),_0xf2ca('0xcd'));if(_0x4e7637[_0xf2ca('0xa4')]===-0x1){return _0x4e7637;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xb5'),_0x5505a5));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xce')]=function(_0x5b53eb){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xcf'),_0x5b53eb[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x5b53eb['odbc_id'])){return this[_0xf2ca('0xb')]['error'](_0x5b53eb,'no\x20database\x20selected');}var _0x193794=this[_0xf2ca('0x14')][_0xf2ca('0x71')](this,_0x5b53eb['odbc_id']);if(!_0x193794){return this[_0xf2ca('0xb')]['error'](_0x5b53eb,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5b53eb[_0xf2ca('0xd0')])){return this[_0xf2ca('0xb')]['error'](_0x5b53eb,'no\x20query\x20configured');}var _0x1ade53=_0x5b53eb[_0xf2ca('0xd0')][_0xf2ca('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0xd1'),_0x1ade53));var _0x65ed3=this['getQueryOdbc'][_0xf2ca('0x71')](this,_0x193794,_0x1ade53);this[_0xf2ca('0x34')]['sync'](this,_0x5b53eb,_0x1ade53);if(!this[_0xf2ca('0x84')](_0x5b53eb['variable_id'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xd2'));}var _0x3237fd=this[_0xf2ca('0xe')]['sync'](this,_0x5b53eb[_0xf2ca('0xd3')]);if(!_0x3237fd){return this[_0xf2ca('0xb')]['error'](_0x5b53eb,'no\x20variable\x20found');}var _0x27e1f2=this;_0x65ed3[_0xf2ca('0xd4')](function(_0x4d9a27,_0x24325c){Object['keys'](_0x4d9a27)[_0xf2ca('0xd4')](function(_0x208f00){_0x27e1f2['channel'][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0xd5'),_0x3237fd,_0x24325c,_0x208f00),_0x4d9a27[_0x208f00]);});});this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0xd6'),_0x3237fd),_0x65ed3['length']);return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xd7'),_0x3237fd));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xd8')]=function(_0x5646e7){logger[_0xf2ca('0xd9')](util[_0xf2ca('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x5646e7['label']));if(!this[_0xf2ca('0x84')](_0x5646e7[_0xf2ca('0xda')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x5646e7,_0xf2ca('0xdb'));}var _0x1a04ee=this[_0xf2ca('0x17')]['sync'](this,_0x5646e7['sip_id']);if(!_0x1a04ee){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x5646e7,_0xf2ca('0xdc'));}var _0xee54ab=this[_0xf2ca('0xb')][_0xf2ca('0xab')]('DIAL',[util['format'](_0xf2ca('0xdd'),_0x1a04ee),_0x5646e7['timeout'],_0x5646e7['opts'],_0x5646e7[_0xf2ca('0x64')]]);if(_0xee54ab['result']===-0x1){return _0xee54ab;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xde'),_0xf2ca('0xdf')));};AGIVertices[_0xf2ca('0xd')]['dialogflow']=function(_0x34e7de){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x34e7de[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x34e7de['key'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xe0'));}if(!this['isConfigured'](_0x34e7de[_0xf2ca('0x5c')])){return this['channel'][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}this[_0xf2ca('0xb')][_0xf2ca('0xe1')]=!![];this['createSquareDetailsReport'](_0x34e7de);this[_0xf2ca('0x41')](_0x34e7de['text'],'in','','');this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xe2'),_0x34e7de[_0xf2ca('0x5c')]));var _0x5bc0e9=this[_0xf2ca('0x78')]['sync'](this,_0x34e7de);if(_0x5bc0e9){for(var _0x5b664b in _0x5bc0e9){if(_0x5bc0e9[_0xf2ca('0x96')](_0x5b664b)){this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util['format'](_0xf2ca('0xe3'),_0x5b664b[_0xf2ca('0x6a')]()),_0x5bc0e9[_0x5b664b]);}}this[_0xf2ca('0x41')](_0x5bc0e9[_0xf2ca('0xe4')],_0xf2ca('0xe5'),_0xf2ca('0xe6'),'');return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0xe7'),_0x5bc0e9['speech']));}return this[_0xf2ca('0xb')]['error'](_0x34e7de,_0xf2ca('0xe8'));};AGIVertices[_0xf2ca('0xd')]['dialogflowV2']=function(_0x512235){logger['info'](util[_0xf2ca('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x512235['label']));if(!this['isConfigured'](_0x512235[_0xf2ca('0x7b')])){return this[_0xf2ca('0xb')]['noop']('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x512235[_0xf2ca('0x7c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xe9'));}if(!this['isConfigured'](_0x512235[_0xf2ca('0xea')])){return this['channel'][_0xf2ca('0xa9')](_0xf2ca('0xeb'));}if(!this[_0xf2ca('0x84')](_0x512235[_0xf2ca('0xec')])){return this[_0xf2ca('0xb')]['noop']('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x512235[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}this[_0xf2ca('0xb')][_0xf2ca('0xe1')]=!![];this[_0xf2ca('0x34')](_0x512235);this[_0xf2ca('0x41')](_0x512235[_0xf2ca('0x5c')],'in','','');this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xed'),_0x512235[_0xf2ca('0x5c')]));var _0x150e48=this[_0xf2ca('0xee')]['sync'](this,_0x512235);if(_0x150e48){for(var _0x90b276 in _0x150e48){if(_0x150e48['hasOwnProperty'](_0x90b276)){if(_0x90b276!=='providerResponse'){this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util['format'](_0xf2ca('0xe3'),_0x90b276[_0xf2ca('0x6a')]()),_0x150e48[_0x90b276]);}}}this[_0xf2ca('0x41')](_0x150e48['speech'],_0xf2ca('0xe5'),_0xf2ca('0xef'),_0x150e48['providerResponse']);return this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xf0'),_0x150e48[_0xf2ca('0xe4')]));}return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x512235,_0xf2ca('0xf1'));};AGIVertices[_0xf2ca('0xd')]['sesteknda']=function(_0x72c6da){logger['info'](util['format'](_0xf2ca('0xf2'),_0x72c6da[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x72c6da[_0xf2ca('0xf3')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xf4'));}if(!this[_0xf2ca('0x84')](_0x72c6da[_0xf2ca('0xf5')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xf6'));}if(!this['isConfigured'](_0x72c6da['password'])){return this[_0xf2ca('0xb')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x72c6da[_0xf2ca('0xf7')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}this[_0xf2ca('0xb')][_0xf2ca('0xe1')]=!![];this[_0xf2ca('0x34')](_0x72c6da);this[_0xf2ca('0x41')](_0x72c6da[_0xf2ca('0x5c')],'in','','');this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xf8'),_0x72c6da[_0xf2ca('0x5c')]));var _0x4340a5=this[_0xf2ca('0x7d')][_0xf2ca('0x71')](this,_0x72c6da);if(_0x4340a5){for(var _0x7e1f2b in _0x4340a5){if(_0x4340a5[_0xf2ca('0x96')](_0x7e1f2b)){this['channel']['setVariable'](util[_0xf2ca('0x27')](_0xf2ca('0xf9'),_0x7e1f2b['toUpperCase']()),_0x4340a5[_0x7e1f2b]);}}this[_0xf2ca('0x41')](_0x4340a5[_0xf2ca('0xe4')],_0xf2ca('0xe5'),_0xf2ca('0xfa'),'');if(_0x4340a5['audiofile']){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4340a5[_0xf2ca('0xfb')]));var _0x58bd4a=this[_0xf2ca('0xb')]['streamFile'](_0x4340a5['audiofile']);try{fs[_0xf2ca('0xfc')](_0x4340a5['audiofile']+_0xf2ca('0xfd'));}catch(_0x5f123d){logger[_0xf2ca('0x2b')](_0x5f123d);}return _0x58bd4a;}else{return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('SestekNDA\x20Result\x20%s',_0x4340a5[_0xf2ca('0xe4')]));}}return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x72c6da,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0xfe')]=function(_0x4b47a4){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0xff'),_0x4b47a4[_0xf2ca('0x36')]));return this[_0xf2ca('0xb')][_0xf2ca('0xa9')]('end');};AGIVertices['prototype'][_0xf2ca('0x100')]=function(_0x20a311){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x101'),_0x20a311[_0xf2ca('0x36')]));var _0x38957c='';if(_0x20a311[_0xf2ca('0x102')]){if(!this[_0xf2ca('0x84')](_0x20a311[_0xf2ca('0x102')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x20a311,'no\x20trunk\x20selected');}else{var _0x3080ec=parseInt(_0x20a311['trunk_id'],0xa);if(isNaN(_0x3080ec)){_0x38957c=_0x20a311[_0xf2ca('0x102')];}else{_0x38957c=this['getTrunk'][_0xf2ca('0x71')](this,_0x20a311[_0xf2ca('0x102')]);if(!_0x38957c){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x20a311,'no\x20trunk\x20found');}}}}else if(_0x20a311['trunk_name']){_0x38957c=_0x20a311[_0xf2ca('0x103')];}else{return this[_0xf2ca('0xb')]['error'](_0x20a311,_0xf2ca('0x104'));}var _0xba4552=this[_0xf2ca('0xb')]['exec'](_0xf2ca('0xdf'),[util[_0xf2ca('0x27')]('SIP/%s/%s',_0x38957c,_0x20a311[_0xf2ca('0xbf')]),_0x20a311['timeout'],_0x20a311[_0xf2ca('0x105')],_0x20a311['url']]);if(_0xba4552[_0xf2ca('0xa4')]===-0x1){return _0xba4552;}return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0xde'),'DIAL'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x106')]=function(_0x144ebc){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x107'),_0x144ebc[_0xf2ca('0x36')]));return this['channel'][_0xf2ca('0xa9')](_0xf2ca('0x106'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x108')]=function(_0x30c55b){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x109'),_0x30c55b['label']));if(_0x30c55b[_0xf2ca('0xa6')]===0x0){return this[_0xf2ca('0xa5')](_0x30c55b);}_0x30c55b[_0xf2ca('0xa6')]-=0x1;if(!this[_0xf2ca('0x84')](_0x30c55b[_0xf2ca('0x10a')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x30c55b,_0xf2ca('0x10b'));}var _0x10da63=this[_0xf2ca('0x1b')][_0xf2ca('0x71')](this,_0x30c55b[_0xf2ca('0x10a')]);if(!_0x10da63){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x30c55b,_0xf2ca('0x10c'));}if(!this[_0xf2ca('0x84')](_0x30c55b['variable_id'])){return this['channel'][_0xf2ca('0x2b')](_0xf2ca('0xd2'));}var _0x1bdaae=this[_0xf2ca('0xb')][_0xf2ca('0x10d')](_0x10da63,_0x30c55b[_0xf2ca('0x10e')],_0x30c55b['maxdigit']);var _0x4547a6=_0x1bdaae[_0xf2ca('0xa4')]?_0x1bdaae['result']['toString']():'';logger[_0xf2ca('0x2d')](_0xf2ca('0x10f'),JSON[_0xf2ca('0x74')](_0x1bdaae));if(_0x1bdaae[_0xf2ca('0xa4')]===-0x1){this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x30c55b,_0x4547a6);return _0x1bdaae;}else if(_0x1bdaae[_0xf2ca('0xa2')]==='timeout'){_0x1bdaae[_0xf2ca('0xa4')]=_0x4547a6[_0xf2ca('0x9f')]>=parseInt(_0x30c55b[_0xf2ca('0x110')])?'x':'i';}else{_0x1bdaae[_0xf2ca('0xa4')]=_0x4547a6[_0xf2ca('0x9f')]>=parseInt(_0x30c55b[_0xf2ca('0x110')])&&_0x4547a6['length']<=parseInt(_0x30c55b[_0xf2ca('0x111')])?'x':'i';}var _0x2a21a2=this['getVariable'][_0xf2ca('0x71')](this,_0x30c55b[_0xf2ca('0xd3')]);if(!_0x2a21a2){return this['channel']['error'](_0x30c55b,_0xf2ca('0x112'));}this[_0xf2ca('0xb')][_0xf2ca('0xa0')](_0x2a21a2,_0x4547a6);if(this[_0xf2ca('0x84')](_0x30c55b[_0xf2ca('0x113')])){var _0x53e986=parseInt(_0x30c55b[_0xf2ca('0x113')],0xa);var _0xb9e338=rs[_0xf2ca('0x114')]({'charset':'*','length':_0x53e986});var _0x7bc1ee=_0x4547a6[_0xf2ca('0x9f')];if(_0x7bc1ee>0x0){if(_0x7bc1ee>_0x53e986){this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x30c55b,_0x30c55b['hiddendigitspos']===_0xf2ca('0x115')?_0xb9e338+_0x4547a6[_0xf2ca('0x116')](_0x53e986):_0x4547a6[_0xf2ca('0x116')](0x0,_0x7bc1ee-_0x53e986)+_0xb9e338);}else{this[_0xf2ca('0x34')]['sync'](this,_0x30c55b,rs[_0xf2ca('0x114')]({'charset':'*','length':_0x7bc1ee}));}}else{this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x30c55b,'');}}else{this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x30c55b,_0x4547a6);}return _0x1bdaae;};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x117')]=function(_0x166611){logger['info'](util[_0xf2ca('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x166611[_0xf2ca('0x36')]));return this['getdigits'](_0x166611);};AGIVertices[_0xf2ca('0xd')]['goal']=function(_0x455284){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x118'),_0x455284[_0xf2ca('0x36')]));this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x455284,_0x455284['goalname']);return this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x119'),_0x455284[_0xf2ca('0x11a')]));};AGIVertices['prototype'][_0xf2ca('0x11b')]=function(_0x2ab155){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2ab155[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x2ab155[_0xf2ca('0x87')])||!this['isConfigured'](_0x2ab155[_0xf2ca('0x11c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x11d'));}if(!this[_0xf2ca('0x84')](_0x2ab155[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')]['noop'](_0xf2ca('0xaa'));}this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x11e'),_0x2ab155['text']));var _0x4671ad=this[_0xf2ca('0x86')][_0xf2ca('0x71')](this,_0x2ab155);if(_0x4671ad){this['channel'][_0xf2ca('0xa9')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x4671ad));var _0x341ad6=this[_0xf2ca('0xb')]['streamFile'](_0x4671ad);try{fs[_0xf2ca('0xfc')](_0x4671ad+_0xf2ca('0xfd'));}catch(_0x2a5441){logger[_0xf2ca('0x2b')](_0x2a5441);}return _0x341ad6;}return this['channel'][_0xf2ca('0x2b')](_0x2ab155,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xf2ca('0x11f')]=function(_0x9ff5){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x120'),_0x9ff5['label']));if(!this[_0xf2ca('0x84')](_0x9ff5[_0xf2ca('0x87')])||!this[_0xf2ca('0x84')](_0x9ff5['aws_secret_access_key'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x11d'));}if(!this['isConfigured'](_0x9ff5[_0xf2ca('0x121')])){return this['channel'][_0xf2ca('0xa9')](_0xf2ca('0x122'));}if(!this[_0xf2ca('0x84')](_0x9ff5['text'])){return this[_0xf2ca('0xb')]['noop']('no\x20text\x20configured');}this['channel'][_0xf2ca('0xe1')]=!![];this['createSquareDetailsReport'](_0x9ff5);this[_0xf2ca('0x41')](_0x9ff5[_0xf2ca('0x5c')],'in','','');this['channel']['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x123'),_0x9ff5[_0xf2ca('0x5c')]));var _0x26c760=this[_0xf2ca('0x8c')][_0xf2ca('0x71')](this,_0x9ff5);if(_0x26c760){for(var _0x2f20ce in _0x26c760){if(_0x26c760[_0xf2ca('0x96')](_0x2f20ce)&&_[_0xf2ca('0x9c')](_0x26c760[_0x2f20ce])){this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0x124'),_0x2f20ce[_0xf2ca('0x6a')]()),_0x26c760[_0x2f20ce]);}}if(_[_0xf2ca('0x44')](_0x26c760['message'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x125'));}else{this[_0xf2ca('0x41')](_0x26c760[_0xf2ca('0x76')],_0xf2ca('0xe5'),_0xf2ca('0x126'),'');return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x26c760[_0xf2ca('0x76')]));}}return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x9ff5,_0xf2ca('0x127'));};AGIVertices['prototype'][_0xf2ca('0x128')]=function(_0x253d4e){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x129'),_0x253d4e[_0xf2ca('0x36')],_0x253d4e[_0xf2ca('0x66')]));if(!this[_0xf2ca('0x84')](_0x253d4e['key'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xe0'));}var _0x2f6bb2=_0xf2ca('0x12a');var _0x43105f=util[_0xf2ca('0x27')](_0xf2ca('0x12b'),FILES_PATH,rs[_0xf2ca('0x114')](0x4));var _0x350538=util['format'](_0xf2ca('0x9e'),_0x43105f,_0x2f6bb2);var _0x29e6fa=!![];if(_0x253d4e[_0xf2ca('0x12c')]==='NOBEEP'){_0x29e6fa=![];}var _0x3e603e=this['channel'][_0xf2ca('0x12d')](_0x43105f,_0x2f6bb2,_0x253d4e[_0xf2ca('0x12e')],_0x253d4e[_0xf2ca('0x66')],undefined,_0x29e6fa);if(_0x3e603e[_0xf2ca('0xa4')]!==-0x1){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util['format'](_0xf2ca('0x12f'),_0x350538));var _0x4cabee=this['googleASR'][_0xf2ca('0x71')](this,_0x253d4e,_0x350538);if(_0x4cabee){for(var _0x3b3043 in _0x4cabee){if(_0x4cabee[_0xf2ca('0x96')](_0x3b3043)){this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util[_0xf2ca('0x27')]('GOOGLE_ASR_%s',_0x3b3043[_0xf2ca('0x6a')]()),_0x4cabee[_0x3b3043]);}}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util['format'](_0xf2ca('0x130'),JSON['stringify'](_0x4cabee)));}}return _0x3e603e;};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x131')]=function(_0x495011){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x132'),_0x495011['label']));if(!this[_0xf2ca('0x84')](_0x495011[_0xf2ca('0x91')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x133'));}if(!this[_0xf2ca('0x84')](_0x495011[_0xf2ca('0x92')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x134'));}var _0x73762d=_0xf2ca('0x12a');var _0x1056b7=util[_0xf2ca('0x27')](_0xf2ca('0x12b'),FILES_PATH,rs[_0xf2ca('0x114')](0x4));var _0x41541c=util[_0xf2ca('0x27')](_0xf2ca('0x9e'),_0x1056b7,_0x73762d);var _0x483a93=!![];if(_0x495011[_0xf2ca('0x12c')]==='NOBEEP'){_0x483a93=![];}var _0x21189b=this[_0xf2ca('0xb')][_0xf2ca('0x12d')](_0x1056b7,_0x73762d,_0x495011[_0xf2ca('0x12e')],_0x495011[_0xf2ca('0x66')],undefined,_0x483a93);if(_0x21189b[_0xf2ca('0xa4')]!==-0x1){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x135'),_0x41541c));var _0x18e6ce=this[_0xf2ca('0x90')][_0xf2ca('0x71')](this,_0x495011,_0x41541c);if(_0x18e6ce){for(var _0x431ccf in _0x18e6ce){if(_0x18e6ce[_0xf2ca('0x96')](_0x431ccf)){this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0x136'),_0x431ccf[_0xf2ca('0x6a')]()),_0x18e6ce[_0x431ccf]);}}return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x137'),JSON['stringify'](_0x18e6ce)));}}return _0x21189b;};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x138')]=function(_0x5db846){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x139'),_0x5db846[_0xf2ca('0x36')]));return this[_0xf2ca('0xb')]['continueAt'](_0x5db846[_0xf2ca('0x13a')],_0x5db846[_0xf2ca('0x3c')],_0x5db846[_0xf2ca('0x3d')]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x13b')]=function(_0x36b064){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x13c'),_0x36b064['label']));if(!this[_0xf2ca('0x84')](_0x36b064[_0xf2ca('0x13d')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x36b064,_0xf2ca('0x13e'));}try{var _0xe95da7=eval(_0x36b064[_0xf2ca('0x13d')])?'true':_0xf2ca('0x13f');this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x140'),_0x36b064[_0xf2ca('0x13d')],_0xe95da7));return{'code':0xc8,'result':_0xe95da7};}catch(_0x16e41e){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0xf2ca('0x141')]=function(_0x4879c3){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x142'),_0x4879c3[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x4879c3[_0xf2ca('0x143')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x4879c3,_0xf2ca('0x144'));}var _0x95d020=this[_0xf2ca('0x23')][_0xf2ca('0x71')](this,_0x4879c3[_0xf2ca('0x143')]);if(!_0x95d020){return this['channel'][_0xf2ca('0x2b')](_0x4879c3,_0xf2ca('0x145'));}for(var _0x4a0550=0x0;_0x4a0550<_0x95d020[_0xf2ca('0x9f')];_0x4a0550+=0x1){var _0x5370a9=this['channel'][_0xf2ca('0xe')](util[_0xf2ca('0x27')](_0xf2ca('0x146'),_0x95d020[_0x4a0550]));if(_0x5370a9['result']===-0x1){return _0x5370a9;}logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x147'),_0x95d020[_0x4a0550],_0x5370a9[_0xf2ca('0xa2')]));if(_0x5370a9[_0xf2ca('0xa2')]===_0xf2ca('0x148')){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x95d020[_0x4a0550],'true'));this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('IFTIME\x20%s\x20%s',_0x95d020[_0x4a0550],'true'));return{'code':0xc8,'result':_0xf2ca('0x148')};}else{logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x147'),_0x95d020[_0x4a0550],_0xf2ca('0x13f')));this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util['format'](_0xf2ca('0x147'),_0x95d020[_0x4a0550],_0xf2ca('0x13f')));}}return{'code':0xc8,'result':_0xf2ca('0x13f')};};AGIVertices['prototype'][_0xf2ca('0x149')]=function(_0x3fcf1d){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3fcf1d['label']));return this[_0xf2ca('0xb')][_0xf2ca('0x149')]();};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x14a')]=function(_0x4d15c0){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x14b'),_0x4d15c0[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x4d15c0[_0xf2ca('0x79')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xe0'));}var _0x1e29b0='wav';var _0x342924=util['format'](_0xf2ca('0x12b'),FILES_PATH,rs[_0xf2ca('0x114')](0x4));var _0x241b52=util[_0xf2ca('0x27')]('%s.%s',_0x342924,_0x1e29b0);var _0x37764c=!![];if(_0x4d15c0['beep']===_0xf2ca('0x14c')){_0x37764c=![];}var _0x127cee=this[_0xf2ca('0xb')][_0xf2ca('0x12d')](_0x342924,_0x1e29b0,_0x4d15c0[_0xf2ca('0x12e')],_0x4d15c0[_0xf2ca('0x66')],undefined,_0x37764c);if(_0x127cee[_0xf2ca('0xa4')]!==-0x1){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('ispeech\x20%s\x20file\x20created',_0x241b52));var _0x546345=this[_0xf2ca('0x82')][_0xf2ca('0x71')](this,_0x4d15c0,_0x241b52);if(_0x546345){for(var _0x19defa in _0x546345){if(_0x546345[_0xf2ca('0x96')](_0x19defa)){this['channel'][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0x14d'),_0x19defa[_0xf2ca('0x6a')]()),_0x546345[_0x19defa]);}}return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x14e'),JSON['stringify'](_0x546345)));}}return _0x127cee;};AGIVertices['prototype'][_0xf2ca('0x14f')]=function(_0x36dd50){logger['info'](util[_0xf2ca('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x36dd50[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x36dd50[_0xf2ca('0x79')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xe0'));}if(!this['isConfigured'](_0x36dd50[_0xf2ca('0x5c')])){return this['channel'][_0xf2ca('0xa9')]('no\x20text\x20configured');}this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x150'),_0x36dd50[_0xf2ca('0x5c')]));var _0x3d2eee=this[_0xf2ca('0x7e')][_0xf2ca('0x71')](this,_0x36dd50);if(_0x3d2eee){this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x151'),_0x3d2eee));var _0x3ba357=this[_0xf2ca('0xb')][_0xf2ca('0x152')](_0x3d2eee,_0x36dd50[_0xf2ca('0x12e')]);try{fs[_0xf2ca('0xfc')](_0x3d2eee+_0xf2ca('0xfd'));}catch(_0x9d80e9){logger[_0xf2ca('0x2b')](_0x9d80e9);}return _0x3ba357;}return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x36dd50,_0xf2ca('0x153'));};AGIVertices[_0xf2ca('0xd')]['login']=function(_0x30a328){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x154'),_0x30a328['label']));if(!this['isConfigured'](_0x30a328['findBy'])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x30a328,_0xf2ca('0x155'));}logger[_0xf2ca('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x30a328[_0xf2ca('0x156')]));var _0x334906=this[_0xf2ca('0x52')]['sync'](this,_0x30a328['findBy']);if(_0x334906){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x30a328[_0xf2ca('0x156')]));this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x157'),this[_0xf2ca('0xb')]['callerid'],_0x30a328[_0xf2ca('0x156')]));return{'code':0xc8,'result':_0xf2ca('0x158')};}else{logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x159'),this['channel']['callerid'],_0x30a328['findBy']));this['channel'][_0xf2ca('0xa9')](util['format'](_0xf2ca('0x159'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x30a328['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf2ca('0xd')]['logout']=function(_0x5a3341){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5a3341[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x5a3341[_0xf2ca('0x156')])){return this['channel']['error'](_0x5a3341,_0xf2ca('0x155'));}logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x15a'),this[_0xf2ca('0xb')]['callerid'],_0x5a3341[_0xf2ca('0x156')]));var _0x56c22a=this[_0xf2ca('0x51')]['sync'](this,_0x5a3341[_0xf2ca('0x156')]);if(_0x56c22a){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x157'),this[_0xf2ca('0xb')]['callerid'],_0x5a3341[_0xf2ca('0x156')]));this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x157'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x5a3341[_0xf2ca('0x156')]));return{'code':0xc8,'result':_0xf2ca('0x158')};}else{logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x159'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x5a3341['findBy']));this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x159'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x5a3341['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xf2ca('0x15b')]=function(_0x1d4634){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x15c'),_0x1d4634[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x1d4634[_0xf2ca('0x15d')])){return this[_0xf2ca('0xb')]['error'](_0x1d4634,'no\x20operation\x20configured');}this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')]('math\x20%s',_0x1d4634[_0xf2ca('0x15d')]));var _0x5ec6b8=eval(_0x1d4634[_0xf2ca('0x15d')]);if(!this[_0xf2ca('0x84')](_0x1d4634[_0xf2ca('0xd3')])){return this[_0xf2ca('0xb')]['noop'](_0xf2ca('0xd2'));}var _0x38df76=this[_0xf2ca('0xe')]['sync'](this,_0x1d4634[_0xf2ca('0xd3')]);if(!_0x38df76){return this[_0xf2ca('0xb')]['error'](_0x1d4634,_0xf2ca('0x112'));}if(_[_0xf2ca('0x9b')](_0x5ec6b8)){var _0x4c746a=this;_0x5ec6b8['forEach'](function(_0x512f48,_0xe428b){_0x4c746a['channel']['setVariable'](util[_0xf2ca('0x27')](_0xf2ca('0x15e'),_0x38df76,_0xe428b),_0x512f48);});return this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x15f'),_0x38df76));}else{return this[_0xf2ca('0xb')][_0xf2ca('0xa0')](_0x38df76,_0x5ec6b8);}};AGIVertices['prototype']['menu']=function(_0x59ce0a){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x160'),_0x59ce0a['label']));if(_0x59ce0a[_0xf2ca('0xa6')]===0x0){return this[_0xf2ca('0xa5')](_0x59ce0a);}_0x59ce0a[_0xf2ca('0xa6')]-=0x1;if(!this['isConfigured'](_0x59ce0a['file_id'])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x59ce0a,'no\x20file\x20audio\x20selected');}var _0x5c8400=this[_0xf2ca('0x1b')]['sync'](this,_0x59ce0a[_0xf2ca('0x10a')]);if(!_0x5c8400){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x59ce0a,_0xf2ca('0x10c'));}var _0x2759f1=this[_0xf2ca('0xb')][_0xf2ca('0x10d')](_0x5c8400,_0x59ce0a[_0xf2ca('0x10e')],_0x59ce0a['digit']);var _0x2313bf=_0x2759f1['result'];if(_0x2759f1[_0xf2ca('0xa4')]===-0x1){this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x59ce0a,'-1');return _0x2759f1;}else if(_0x2759f1['extra']===_0xf2ca('0x66')){_0x2759f1[_0xf2ca('0xa4')]=_0x2759f1[_0xf2ca('0xa4')][_0xf2ca('0x9f')]>0x0?_0x2759f1[_0xf2ca('0xa4')]:'t';}else if(_[_0xf2ca('0x43')](_0x2759f1['result'])){_0x2759f1[_0xf2ca('0xa4')]='#';_0x2313bf='#';}if(!this[_0xf2ca('0x84')](_0x59ce0a[_0xf2ca('0xd3')])){this['channel']['noop'](_0xf2ca('0xd2'));}else{var _0x12f9fd=this[_0xf2ca('0xe')]['sync'](this,_0x59ce0a['variable_id']);if(!_0x12f9fd){return this['channel']['error'](_0x59ce0a,'no\x20variable\x20found');}this[_0xf2ca('0xb')]['setVariable'](_0x12f9fd,_0x2313bf);}this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x59ce0a,_0x2313bf);return _0x2759f1;};AGIVertices[_0xf2ca('0xd')]['noop']=function(_0x207fe2){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x207fe2[_0xf2ca('0x36')]));return this[_0xf2ca('0xb')]['noop'](_0x207fe2[_0xf2ca('0x161')]||_0x207fe2[_0xf2ca('0x36')]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x162')]=function(_0x23f284){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x163'),_0x23f284[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x23f284[_0xf2ca('0x156')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x23f284,_0xf2ca('0x155'));}logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x15a'),this['channel'][_0xf2ca('0x39')],_0x23f284[_0xf2ca('0x156')]));var _0x4751a3=this[_0xf2ca('0x4c')]['sync'](this,_0x23f284[_0xf2ca('0x164')]);var _0x3e5154=this['agentPause'][_0xf2ca('0x71')](this,_0x23f284[_0xf2ca('0x156')],_0x4751a3);if(_0x3e5154){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x157'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x23f284[_0xf2ca('0x156')]));this['channel'][_0xf2ca('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xf2ca('0x39')],_0x23f284['findBy']));return{'code':0xc8,'result':_0xf2ca('0x158')};}else{logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x23f284[_0xf2ca('0x156')]));this['channel']['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x157'),this['channel']['callerid'],_0x23f284[_0xf2ca('0x156')]));return{'code':0xc8,'result':_0xf2ca('0x165')};}};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x166')]=function(_0x46ff6b){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x167'),_0x46ff6b[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x46ff6b['file_id'])){return this['channel'][_0xf2ca('0x2b')](_0x46ff6b,_0xf2ca('0x10b'));}var _0x56a839=this['getSound'][_0xf2ca('0x71')](this,_0x46ff6b[_0xf2ca('0x10a')]);if(!_0x56a839){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x46ff6b,_0xf2ca('0x10c'));}var _0x13ccb2=this['channel']['exec'](_0xf2ca('0x168'),[_0x56a839,_0x46ff6b[_0xf2ca('0x105')]]);if(_0x13ccb2['result']===-0x1){return _0x13ccb2;}return this[_0xf2ca('0xb')]['noop'](util['format'](_0xf2ca('0x169'),_0xf2ca('0x168'),_0x56a839));};AGIVertices['prototype'][_0xf2ca('0x16a')]=function(_0x26bd7f){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x26bd7f[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x26bd7f[_0xf2ca('0x16b')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x26bd7f,'no\x20queue\x20selected');}var _0x5201fd='';var _0xb56af6=parseInt(_0x26bd7f[_0xf2ca('0x16b')],0xa);if(isNaN(_0xb56af6)){_0x5201fd=_0x26bd7f[_0xf2ca('0x16b')];}else{_0x5201fd=this['getVoiceQueue'][_0xf2ca('0x71')](this,_0x26bd7f['queue_id']);if(!_0x5201fd){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x26bd7f,'no\x20queue\x20found');}}var _0x4b5706='';if(this['isConfigured'](_0x26bd7f['file_id'])){var _0xc5c378=this['getSound'][_0xf2ca('0x71')](this,_0x26bd7f[_0xf2ca('0x10a')]);if(_0xc5c378){_0x4b5706=_0xc5c378;}}this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x26bd7f,_0x5201fd);if(_0x26bd7f[_0xf2ca('0x105')][_0xf2ca('0x16c')]('x')<0x0){_0x26bd7f[_0xf2ca('0x105')]+='x';}if(_0x26bd7f[_0xf2ca('0x105')][_0xf2ca('0x16c')]('X')<0x0){_0x26bd7f[_0xf2ca('0x105')]+='X';}this[_0xf2ca('0xb')]['setVariable'](_0xf2ca('0x16d'),_0x5201fd?_0x5201fd['toLowerCase']():'');var _0x44010b=this['channel']['exec'](_0xf2ca('0x16e'),[_0x5201fd,_0x26bd7f[_0xf2ca('0x105')],_0x26bd7f['url'],_0x4b5706,_0x26bd7f['timeout'],_0x26bd7f['agi'],_0x26bd7f['macro'],_0x26bd7f[_0xf2ca('0x16f')],'',_0x26bd7f[_0xf2ca('0x170')]]);if(_0x44010b[_0xf2ca('0xa4')]===-0x1){return _0x44010b;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x5201fd));};AGIVertices['prototype'][_0xf2ca('0x171')]=function(_0x198c1b){logger['info'](util['format'](_0xf2ca('0x172'),_0x198c1b[_0xf2ca('0x36')]));var _0x2c25be=_0x198c1b[_0xf2ca('0x173')]||_0xf2ca('0x12a');var _0xe7f0ef=util[_0xf2ca('0x27')](_0xf2ca('0x174'),this['channel'][_0xf2ca('0x35')],rs[_0xf2ca('0x114')](0x5));var _0x594114=util[_0xf2ca('0x27')](_0xf2ca('0x175'),FILES_PATH,_0xe7f0ef,_0x2c25be);var _0x569225=util[_0xf2ca('0x27')](_0xf2ca('0x12b'),FILES_PATH,_0xe7f0ef);this[_0xf2ca('0x3a')][_0xf2ca('0x71')](this,_0x198c1b,_0xe7f0ef,_0x594114);this[_0xf2ca('0xb')][_0xf2ca('0xa0')]('RECORDING_SAVENAME',_0xe7f0ef);logger['info'](_0xf2ca('0x176'),_0x569225,_0x2c25be,_0x198c1b[_0xf2ca('0x177')],_0x198c1b[_0xf2ca('0x66')]);return this[_0xf2ca('0xb')][_0xf2ca('0x12d')](_0x569225,_0x2c25be,_0x198c1b[_0xf2ca('0x177')],_0x198c1b[_0xf2ca('0x66')],undefined,!![]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x178')]=function(_0x361cf8){logger['info'](util[_0xf2ca('0x27')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x361cf8[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x361cf8['url'])){return this['channel']['noop'](_0xf2ca('0x179'));}var _0x3dea57=this[_0xf2ca('0x63')]['sync'](this,_0x361cf8);logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x17a'),util[_0xf2ca('0x17b')](_0x3dea57,{'showHidden':![],'depth':null})));if(!this[_0xf2ca('0x84')](_0x361cf8[_0xf2ca('0xd3')])){return this['channel'][_0xf2ca('0xa9')](_0xf2ca('0x17c'));}var _0x36d611=this[_0xf2ca('0xe')][_0xf2ca('0x71')](this,_0x361cf8['variable_id']);if(!_0x36d611){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x361cf8,_0xf2ca('0x112'));}this[_0xf2ca('0xb')]['setVariable'](util[_0xf2ca('0x27')](_0xf2ca('0x17d'),_0x36d611),_0x3dea57['statusCode']?_0x3dea57['statusCode']:_0xf2ca('0x17e'));this[_0xf2ca('0xb')][_0xf2ca('0xa0')](util[_0xf2ca('0x27')](_0xf2ca('0x17f'),_0x36d611),_0x3dea57[_0xf2ca('0x180')]?_0x3dea57[_0xf2ca('0x180')]:'OK');if(_0x3dea57[_0xf2ca('0x6b')]){try{this[_0xf2ca('0x9d')](_0x3dea57[_0xf2ca('0x6b')],_0x36d611);}catch(_0x133075){logger[_0xf2ca('0x2b')](util[_0xf2ca('0x27')](_0xf2ca('0x181'),_0x36d611));}}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0xd7'),_0x36d611));};AGIVertices[_0xf2ca('0xd')]['saydigits']=function(_0x233fa4){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x182'),_0x233fa4[_0xf2ca('0x36')]));return this[_0xf2ca('0xb')][_0xf2ca('0x183')](_0x233fa4[_0xf2ca('0x184')][_0xf2ca('0x58')](/\s+/g,''),_0x233fa4['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x473061){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x185'),_0x473061[_0xf2ca('0x36')]));return this['channel'][_0xf2ca('0x186')](_0x473061['number'][_0xf2ca('0x58')](/\s+/g,''),_0x473061[_0xf2ca('0x177')]);};AGIVertices['prototype']['sayphonetic']=function(_0x19e106){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x187'),_0x19e106['label']));return this[_0xf2ca('0xb')][_0xf2ca('0x188')](_0x19e106[_0xf2ca('0x5c')],_0x19e106[_0xf2ca('0x177')]);};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x189')]=function(_0x5d7677){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x18a'),_0x5d7677[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x5d7677[_0xf2ca('0x18b')])){return this['channel']['noop'](_0xf2ca('0x18c'));}var _0x332072=this[_0xf2ca('0x1f')][_0xf2ca('0x71')](this,_0x5d7677[_0xf2ca('0x18b')]);if(!_0x332072||!_0x332072[_0xf2ca('0x18d')]){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x5d7677,_0xf2ca('0x18e'));}var _0x1a3328={'from':util[_0xf2ca('0x27')](_0xf2ca('0x18f'),_0x332072[_0xf2ca('0x10')],_0x332072[_0xf2ca('0x190')]||_0x332072['Smtp']['user']),'to':_0x5d7677['to']||'','cc':_0x5d7677['cc']||'','bcc':_0x5d7677[_0xf2ca('0x191')]||'','subject':_0x5d7677[_0xf2ca('0x192')],'html':_0x5d7677['text'],'text':_0x5d7677[_0xf2ca('0x5c')]};if(this[_0xf2ca('0x84')](_0x5d7677[_0xf2ca('0x193')])){}logger[_0xf2ca('0xd9')](_0xf2ca('0x194'),JSON[_0xf2ca('0x74')](_0x1a3328));this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x5d7677,_0x5d7677[_0xf2ca('0x18b')]);this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x195'),_0x332072['name']));this['sendMailMessage'][_0xf2ca('0x71')](this,_0x332072[_0xf2ca('0x196')],_0x1a3328);return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x197'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x198')]=function(_0x3af482){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x199'),_0x3af482[_0xf2ca('0x36')]));return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x19a'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x19b')]=function(_0x121971){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x19c'),_0x121971['label']));if(!this[_0xf2ca('0x84')](_0x121971[_0xf2ca('0x19d')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x19e'));}var _0x38e346=this['getSmsAccount']['sync'](this,_0x121971[_0xf2ca('0x19d')]);if(!_0x38e346){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x121971,_0xf2ca('0x19f'));}var _0x581ea0={'body':_0x121971[_0xf2ca('0x1a0')],'phone':_0x121971['to']||'','SmsAccountId':_0x38e346['id']};logger[_0xf2ca('0xd9')](_0xf2ca('0x1a1'),JSON[_0xf2ca('0x74')](_0x581ea0));this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x121971,_0x121971[_0xf2ca('0x19d')]);this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x1a2'),_0x38e346[_0xf2ca('0x10')]));this[_0xf2ca('0x33')][_0xf2ca('0x71')](this,_0x581ea0);return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x1a3'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1a4')]=function(_0x50afeb){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x50afeb[_0xf2ca('0x36')]));if(!this['isConfigured'](_0x50afeb[_0xf2ca('0xd3')])){return this['channel'][_0xf2ca('0x2b')](_0x50afeb,_0xf2ca('0x1a5'));}var _0xef59c6=this['getVariable'][_0xf2ca('0x71')](this,_0x50afeb[_0xf2ca('0xd3')]);if(!_0xef59c6){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x50afeb,_0xf2ca('0x112'));}return this[_0xf2ca('0xb')][_0xf2ca('0xa0')](_0xef59c6,_0x50afeb[_0xf2ca('0x1a6')]);};AGIVertices['prototype'][_0xf2ca('0x1a7')]=function(_0x123588){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x1a8'),_0x123588[_0xf2ca('0x36')]));this['channel'][_0xf2ca('0xa9')](_0xf2ca('0x1a9'));var _0x36a685=this[_0xf2ca('0xb')]['getVariable'](_0xf2ca('0x1aa'));if(!_[_0xf2ca('0x43')](_0x36a685[_0xf2ca('0xa2')])){this[_0xf2ca('0xb')][_0xf2ca('0x35')]=_0x36a685['extra'];}if(_0x123588[_0xf2ca('0xb9')]===_0xf2ca('0x1ab')){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x1ac'));return this[_0xf2ca('0xb')]['answer']();}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x1ad'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1ae')]=function(_0x389300){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x1af'),_0x389300[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x389300[_0xf2ca('0x1b0')])){return this['channel'][_0xf2ca('0x2b')](_0x389300,_0xf2ca('0x1b1'));}var _0x40f8e9=this['getSquareProject'][_0xf2ca('0x71')](this,_0x389300[_0xf2ca('0x1b0')]);if(!this[_0xf2ca('0x84')](_0x40f8e9)){return this[_0xf2ca('0xb')]['error'](_0x389300,util[_0xf2ca('0x27')](_0xf2ca('0x1b2'),_0x389300[_0xf2ca('0x1b0')]));}if(_0x40f8e9===this[_0xf2ca('0xb')][_0xf2ca('0x38')]){return this[_0xf2ca('0xb')]['error'](_0x389300,_0xf2ca('0x1b3'));}this[_0xf2ca('0x34')][_0xf2ca('0x71')](this,_0x389300,_0x40f8e9);var _0x4eb37a=this['channel'][_0xf2ca('0xab')](_0xf2ca('0x1b4'),util[_0xf2ca('0x27')](_0xf2ca('0x1b5'),config[_0xf2ca('0x5')][_0xf2ca('0x1b6')]||_0xf2ca('0x1b7'),_0x40f8e9,this[_0xf2ca('0xb')][_0xf2ca('0x38')]));if(_0x4eb37a[_0xf2ca('0xa4')]===-0x1){return _0x4eb37a;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x169'),_0xf2ca('0x1b4'),_0x40f8e9));};AGIVertices[_0xf2ca('0xd')]['system']=function(_0x1199b5){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1199b5['label']));var _0x2a9174=this['shellCommand']['sync'](this,_0x1199b5['command']);this['createSquareDetailsReport'][_0xf2ca('0x71')](this,_0x1199b5,_0x1199b5[_0xf2ca('0xb7')]);if(this[_0xf2ca('0x84')](_0x1199b5[_0xf2ca('0xd3')])){var _0xbddb86=this[_0xf2ca('0xe')][_0xf2ca('0x71')](this,_0x1199b5[_0xf2ca('0xd3')]);if(_0xbddb86){this['channel'][_0xf2ca('0xa0')](_0xbddb86,_0x2a9174);return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x1b8'),_0x1199b5[_0xf2ca('0xb7')],_0xbddb86));}}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1199b5[_0xf2ca('0xb7')]));};AGIVertices[_0xf2ca('0xd')]['google_cloud_tts']=function(_0x1059a1){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1059a1['label']));_0x1059a1[_0xf2ca('0x5c')]=_0x1059a1[_0xf2ca('0x5c')][_0xf2ca('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1059a1['apiKey'])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0x1b9'));}if(!this[_0xf2ca('0x84')](_0x1059a1[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')]('no\x20text\x20configured');}this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x1ba'),_0x1059a1[_0xf2ca('0x5c')]));var _0x13c8d5=this['googleCloudTTS'][_0xf2ca('0x71')](this,_0x1059a1);if(_0x13c8d5){this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')](_0xf2ca('0x1bb'),_0x13c8d5));var _0x48c8c7=this[_0xf2ca('0xb')]['streamFile'](_0x13c8d5);try{fs[_0xf2ca('0xfc')](_0x13c8d5+_0xf2ca('0xfd'));}catch(_0x3bac5e){logger[_0xf2ca('0x2b')](_0x3bac5e);}return _0x48c8c7;}return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x1059a1,_0xf2ca('0x1bc'));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1bd')]=function(_0x4f7724){logger['info'](util[_0xf2ca('0x27')](_0xf2ca('0x1be'),_0x4f7724['label']));_0x4f7724[_0xf2ca('0x5c')]=_0x4f7724[_0xf2ca('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf2ca('0x84')](_0x4f7724[_0xf2ca('0x5c')])){return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](_0xf2ca('0xaa'));}this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x1bf'),_0x4f7724[_0xf2ca('0x5c')]));var _0x582089=this[_0xf2ca('0x61')]['sync'](this,_0x4f7724);if(_0x582089){this['channel'][_0xf2ca('0xa9')](util['format'](_0xf2ca('0x1c0'),_0x582089));var _0xb1263=this[_0xf2ca('0xb')][_0xf2ca('0x152')](_0x582089);try{fs[_0xf2ca('0xfc')](_0x582089+_0xf2ca('0xfd'));}catch(_0x568510){logger[_0xf2ca('0x2b')](_0x568510);}return _0xb1263;}return this['channel']['error'](_0x4f7724,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xf2ca('0x1c1')]=function(_0x2aa1a9){logger['info'](util[_0xf2ca('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2aa1a9[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x2aa1a9[_0xf2ca('0x156')])){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x2aa1a9,_0xf2ca('0x155'));}logger['info'](util[_0xf2ca('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf2ca('0xb')]['callerid'],_0x2aa1a9['findBy']));var _0x92d9c1=this[_0xf2ca('0x50')][_0xf2ca('0x71')](this,_0x2aa1a9[_0xf2ca('0x156')]);if(_0x92d9c1){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x157'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x2aa1a9[_0xf2ca('0x156')]));this['channel'][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x2aa1a9[_0xf2ca('0x156')]));return{'code':0xc8,'result':_0xf2ca('0x158')};}else{logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xf2ca('0x39')],_0x2aa1a9[_0xf2ca('0x156')]));this[_0xf2ca('0xb')]['noop'](util[_0xf2ca('0x27')](_0xf2ca('0x159'),this[_0xf2ca('0xb')][_0xf2ca('0x39')],_0x2aa1a9[_0xf2ca('0x156')]));return{'code':0xc8,'result':_0xf2ca('0x165')};}};AGIVertices[_0xf2ca('0xd')]['voicemail']=function(_0x8b5097){logger[_0xf2ca('0x2d')](util[_0xf2ca('0x27')](_0xf2ca('0x1c2'),_0x8b5097[_0xf2ca('0x36')]));var _0x202065=this[_0xf2ca('0xb')][_0xf2ca('0xab')](_0xf2ca('0x1c3'),[_0x8b5097['mailbox'],_0x8b5097[_0xf2ca('0x77')]]);if(_0x202065[_0xf2ca('0xa4')]===-0x1){return _0x202065;}return this[_0xf2ca('0xb')][_0xf2ca('0xa9')](util[_0xf2ca('0x27')]('Executed\x20command\x20%s\x20%s',_0xf2ca('0x1c3'),_0x8b5097[_0xf2ca('0x1c4')]));};AGIVertices[_0xf2ca('0xd')][_0xf2ca('0x1c5')]=function(_0x299a3f){logger[_0xf2ca('0x2d')](util['format'](_0xf2ca('0x1c6'),_0x299a3f[_0xf2ca('0x36')]));if(!this[_0xf2ca('0x84')](_0x299a3f[_0xf2ca('0xd3')])){return this[_0xf2ca('0xb')]['error'](_0x299a3f,_0xf2ca('0x1a5'));}var _0x38b628=this[_0xf2ca('0xe')][_0xf2ca('0x71')](this,_0x299a3f['variable_id']);if(!_0x38b628){return this[_0xf2ca('0xb')][_0xf2ca('0x2b')](_0x299a3f,_0xf2ca('0x112'));}var _0x210313=this['channel']['getVariable'](_0x38b628);return{'code':0xc8,'result':_0x210313['extra']?_0x210313[_0xf2ca('0xa2')]:'-'};};String[_0xf2ca('0xd')][_0xf2ca('0x1c7')]=function(_0x5be5f5,_0x2c21a0){return this[_0xf2ca('0xa1')](_0x5be5f5)[_0xf2ca('0x1c8')](_0x2c21a0);};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 7e11d52..f7b0c70 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 _0x0295=['transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','hanguprequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','interface','queue','mandatoryDispositionPause','name','resolve','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','acw','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0295,0x1f0));var _0x5029=function(_0x4259a3,_0x2f9e82){_0x4259a3=_0x4259a3-0x0;var _0x5dfed4=_0x0295[_0x4259a3];return _0x5dfed4;};'use strict';var _=require(_0x5029('0x0'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x5029('0x1'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5029('0x2'));function Acw(_0x36335d){this[_0x5029('0x3')]=_0x36335d[_0x5029('0x3')];this[_0x5029('0x4')]=_0x36335d[_0x5029('0x4')];this[_0x5029('0x5')]=_0x36335d[_0x5029('0x5')];this[_0x5029('0x6')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x5029('0x7'),this['syncHangupRequest'][_0x5029('0x8')](this));ami['on']('hangup',this[_0x5029('0x9')]['bind'](this));ami['on'](_0x5029('0xa'),this[_0x5029('0xb')][_0x5029('0x8')](this));ami['on']('attendedtransfer',this[_0x5029('0xc')][_0x5029('0x8')](this));ami['on'](_0x5029('0xd'),this['syncBlindTransfer'][_0x5029('0x8')](this));ami['on'](_0x5029('0xe'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x49f836){var _0x4aebb6=moment()[_0x5029('0xf')](0x0);var _0x2e0369=moment(_0x49f836)[_0x5029('0xf')](0x0);return _0x4aebb6[_0x5029('0x10')](_0x2e0369,_0x5029('0x11'));}Acw[_0x5029('0x12')][_0x5029('0x13')]=function(_0x317c20,_0x10bf55){var _0x326923=this;var _0x457c73=getDiff(_0x326923[_0x5029('0x5')][_0x317c20][_0x5029('0x14')]);clearTimeout(_0x326923[_0x5029('0x5')][_0x317c20][_0x5029('0x15')]);_0x326923['timers'][_0x317c20][_0x5029('0x15')]=![];return RpcVoiceAgentReport[_0x5029('0x16')]({'acwtime':_0x457c73},_0x326923[_0x5029('0x5')][_0x317c20][_0x5029('0x17')],_0x317c20)[_0x5029('0x18')](function(_0x5e115f){logger[_0x5029('0x19')]('[%s][UPDATE][ACWTIME:%s]',_0x10bf55,_0x457c73,_0x5e115f);})[_0x5029('0x1a')](function(_0x5696b1){logger[_0x5029('0x1b')](_0x5029('0x1c'),_0x10bf55,_0x5696b1);})[_0x5029('0x1d')](function(){delete _0x326923[_0x5029('0x5')][_0x317c20];});};Acw['prototype']['startAcw']=function(_0x4c9184){try{var _0x4a49b6=this;var _0x3f657d=this[_0x5029('0x6')][_0x4c9184][_0x5029('0x1e')];var _0x2bbbcb=this[_0x5029('0x6')][_0x4c9184][_0x5029('0x1f')];var _0x125c26=this[_0x5029('0x3')][_0x2bbbcb];var _0x3e857d=![];var _0x4ceaae='ACW';if(_0x125c26['mandatoryDisposition']&&_0x125c26[_0x5029('0x20')][_0x5029('0x21')]){_0x3e857d=!![];_0x4ceaae=_0x125c26['mandatoryDispositionPause']['name'];}if(!_0x4a49b6[_0x5029('0x4')][_0x3f657d]){return Promise[_0x5029('0x22')]();}return RpcUser[_0x5029('0x23')](_0x4a49b6['agents'][_0x3f657d]['id'])[_0x5029('0x18')](function(_0xb14bc){if(!_0xb14bc||_0xb14bc['voicePause']){logger[_0x5029('0x19')](_0x5029('0x24'),_0x4c9184,_0x3f657d,_0x2bbbcb);return;}logger[_0x5029('0x19')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4c9184,_0x3f657d,_0x2bbbcb);var _0x32da06=_0x4a49b6[_0x5029('0x6')][_0x4c9184][_0x5029('0x25')]&&_0x4a49b6['channels'][_0x4c9184][_0x5029('0x26')]?_0x4a49b6[_0x5029('0x6')][_0x4c9184]['destlinkedid']:_0x4c9184;return RpcUser[_0x5029('0x27')](_0x4a49b6[_0x5029('0x4')][_0x3f657d],_0x4ceaae,_0x32da06);})[_0x5029('0x18')](function(_0x1c3dd9){if(_0x3e857d||!_0x1c3dd9){return;}_0x4a49b6[_0x5029('0x5')][_0x3f657d]={};logger[_0x5029('0x19')](_0x5029('0x28'),_0x4c9184,_0x4a49b6[_0x5029('0x3')][_0x2bbbcb][_0x5029('0x29')],_0x3f657d,_0x2bbbcb);_0x4a49b6[_0x5029('0x5')][_0x3f657d][_0x5029('0x15')]=setTimeout(_0x4a49b6[_0x5029('0x2a')]['bind'](_0x4a49b6,_0x3f657d),_0x4a49b6[_0x5029('0x3')][_0x2bbbcb]['acwTimeout']*0x3e8);_0x4a49b6[_0x5029('0x5')][_0x3f657d]['lastPauseAt']=moment()['format'](_0x5029('0x2b'));_0x4a49b6[_0x5029('0x5')][_0x3f657d][_0x5029('0x17')]=_0x4c9184;_0x4a49b6['timers'][_0x3f657d][_0x5029('0x1f')]=_0x2bbbcb;_0x4a49b6[_0x5029('0x5')][_0x3f657d][_0x5029('0x13')]=_0x4a49b6[_0x5029('0x13')][_0x5029('0x8')](_0x4a49b6,_0x3f657d,_0x4c9184);})[_0x5029('0x1a')](function(){logger[_0x5029('0x1b')](_0x5029('0x28'),_0x4c9184,_0x4a49b6[_0x5029('0x3')][_0x2bbbcb]['acwTimeout'],_0x3f657d,_0x2bbbcb);})[_0x5029('0x1d')](function(){delete _0x4a49b6[_0x5029('0x6')][_0x4c9184];});}catch(_0xc110e8){logger[_0x5029('0x1b')]('[ACW][START]\x20%s',_0xc110e8[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')][_0x5029('0x2a')]=function(_0x594549){try{var _0x4904cc=this;if(_0x4904cc[_0x5029('0x5')][_0x594549]){_0x4904cc[_0x5029('0x5')][_0x594549]['timer']=![];var _0x57784c=_0x4904cc[_0x5029('0x5')][_0x594549][_0x5029('0x17')];var _0x270d66=_0x4904cc[_0x5029('0x5')][_0x594549][_0x5029('0x1f')];var _0xfa9ac=_0x4904cc[_0x5029('0x3')][_0x270d66][_0x5029('0x29')];logger[_0x5029('0x19')](_0x5029('0x2d'),_0x57784c,_0x594549);RpcUser[_0x5029('0x2e')](this[_0x5029('0x4')][_0x594549]);RpcVoiceAgentReport[_0x5029('0x16')]({'acwtime':_0xfa9ac,'agentacw':!![]},_0x57784c,_0x594549)[_0x5029('0x18')](function(_0x5c547e){logger['info'](_0x5029('0x2f'),_0x57784c,_0xfa9ac,_0x5c547e);})[_0x5029('0x1a')](function(_0x423ed1){logger['error'](_0x5029('0x1c'),_0x57784c,_0x423ed1);});}else{logger[_0x5029('0x1b')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x594549);if(_0x4904cc[_0x5029('0x5')]){logger['info'](_0x5029('0x30'),JSON['stringify'](_0x4904cc[_0x5029('0x5')]));}}}catch(_0x359838){logger[_0x5029('0x1b')](_0x5029('0x31'),_0x359838[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')][_0x5029('0x32')]=function(_0x1021ea){try{if(this[_0x5029('0x3')][_0x1021ea['queue']]&&(this[_0x5029('0x3')][_0x1021ea[_0x5029('0x1f')]][_0x5029('0x33')]||this[_0x5029('0x3')][_0x1021ea[_0x5029('0x1f')]][_0x5029('0x34')])){if(this['agents'][_0x1021ea[_0x5029('0x1e')]]){this[_0x5029('0x6')][_0x1021ea[_0x5029('0x17')]]={'queue':_0x1021ea[_0x5029('0x1f')],'interface':_0x1021ea[_0x5029('0x1e')],'destlinkedid':_0x1021ea['destlinkedid']};}}}catch(_0x25087e){logger[_0x5029('0x1b')](_0x5029('0x35'),_0x25087e[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')][_0x5029('0x36')]=function(_0x1a42c5){try{if(this[_0x5029('0x3')][_0x1a42c5[_0x5029('0x1f')]]&&(this['voiceQueues'][_0x1a42c5[_0x5029('0x1f')]][_0x5029('0x33')]||this[_0x5029('0x3')][_0x1a42c5[_0x5029('0x1f')]]['mandatoryDisposition'])){if(this['agents'][_0x1a42c5[_0x5029('0x1e')]]){this[_0x5029('0x6')][_0x1a42c5[_0x5029('0x17')]]={'queue':_0x1a42c5[_0x5029('0x1f')],'interface':_0x1a42c5[_0x5029('0x1e')]};}}}catch(_0x3dfc08){logger[_0x5029('0x1b')](_0x5029('0x37'),_0x3dfc08[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')][_0x5029('0x38')]=function(_0x39370b){try{if(this[_0x5029('0x6')][_0x39370b[_0x5029('0x17')]]&&_[_0x5029('0x39')](this[_0x5029('0x6')][_0x39370b[_0x5029('0x17')]][_0x5029('0x25')])){logger[_0x5029('0x19')](_0x5029('0x3a'),_0x39370b[_0x5029('0x17')]);this['startAcw'](_0x39370b[_0x5029('0x17')]);}else if(this['channels'][_0x39370b[_0x5029('0x3b')]]&&_[_0x5029('0x39')](this['channels'][_0x39370b['linkedid']][_0x5029('0x25')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x39370b[_0x5029('0x3b')]);this[_0x5029('0x3c')](_0x39370b[_0x5029('0x3b')]);}}catch(_0x561291){logger['error'](_0x5029('0x3d'),_0x561291[_0x5029('0x2c')]);}};Acw['prototype'][_0x5029('0x9')]=function(_0x5758a4){try{if(this[_0x5029('0x6')][_0x5758a4['uniqueid']]&&this[_0x5029('0x6')][_0x5758a4[_0x5029('0x17')]][_0x5029('0x25')]){logger[_0x5029('0x19')](_0x5029('0x3e'),_0x5758a4[_0x5029('0x17')]);this[_0x5029('0x3c')](_0x5758a4[_0x5029('0x17')]);}else if(this['channels'][_0x5758a4[_0x5029('0x3b')]]&&this['channels'][_0x5758a4[_0x5029('0x3b')]][_0x5029('0x25')]){logger['info'](_0x5029('0x3f'),_0x5758a4['linkedid']);this['startAcw'](_0x5758a4['linkedid']);}}catch(_0x34e93a){logger['error'](_0x5029('0x40'),_0x34e93a[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')]['syncAttendedTransfer']=function(_0xb43232){try{if(!_['isNil'](this['channels'][_0xb43232[_0x5029('0x41')]])){this[_0x5029('0x3c')](_0xb43232[_0x5029('0x41')]);if(this[_0x5029('0x6')][_0xb43232[_0x5029('0x42')]]){this['channels'][_0xb43232[_0x5029('0x42')]][_0x5029('0x25')]=!![];this[_0x5029('0x6')][_0xb43232[_0x5029('0x43')]]=this['channels'][_0xb43232[_0x5029('0x42')]];delete this[_0x5029('0x6')][_0xb43232['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x5029('0x6')][_0xb43232[_0x5029('0x43')]])){this[_0x5029('0x3c')](_0xb43232[_0x5029('0x43')]);if(this['channels'][_0xb43232[_0x5029('0x44')]]){this[_0x5029('0x6')][_0xb43232[_0x5029('0x44')]][_0x5029('0x25')]=!![];this[_0x5029('0x6')][_0xb43232[_0x5029('0x41')]]=this['channels'][_0xb43232['origtransfereruniqueid']];delete this[_0x5029('0x6')][_0xb43232[_0x5029('0x44')]];}}}catch(_0x3830f2){logger['error'](_0x5029('0x45'),_0x3830f2[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')][_0x5029('0x46')]=function(_0x151663){try{if(this['channels'][_0x151663[_0x5029('0x47')]]){logger[_0x5029('0x19')](_0x5029('0x48'),JSON['stringify'](_0x151663[_0x5029('0x47')]));this['startAcw'](_0x151663[_0x5029('0x47')]);}else if(this['channels'][_0x151663[_0x5029('0x49')]]){logger[_0x5029('0x19')](_0x5029('0x4a'),JSON[_0x5029('0x4b')](_0x151663[_0x5029('0x49')]));this[_0x5029('0x3c')](_0x151663['transfererlinkedid']);}}catch(_0x31c2d2){logger[_0x5029('0x1b')](_0x5029('0x4c'),_0x31c2d2[_0x5029('0x2c')]);}};Acw[_0x5029('0x12')]['syncAgentRingNoAnswer']=function(_0x13ca47){try{if(this['voiceQueues'][_0x13ca47[_0x5029('0x1f')]]&&this['voiceQueues'][_0x13ca47[_0x5029('0x1f')]]['autopause']===_0x5029('0x4d')){if(this['agents'][_0x13ca47['interface']]){logger[_0x5029('0x19')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x13ca47[_0x5029('0x17')],_0x13ca47[_0x5029('0x1e')],_0x13ca47[_0x5029('0x1f')]);return RpcUser['savePause'](this[_0x5029('0x4')][_0x13ca47['interface']],_0x5029('0x4e'),_0x13ca47[_0x5029('0x17')]);}}}catch(_0x1db124){logger[_0x5029('0x1b')](_0x5029('0x4f'),_0x1db124['message']);}};module[_0x5029('0x50')]=Acw; \ No newline at end of file +var _0xf562=['agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','stringify','[ACW][STOP]\x20%s','message','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues'];(function(_0x4f750b,_0x4e3e43){var _0x918b39=function(_0x106d8f){while(--_0x106d8f){_0x4f750b['push'](_0x4f750b['shift']());}};_0x918b39(++_0x4e3e43);}(_0xf562,0x100));var _0x2f56=function(_0x11c714,_0x17582e){_0x11c714=_0x11c714-0x0;var _0x3b8f08=_0xf562[_0x11c714];return _0x3b8f08;};'use strict';var _=require(_0x2f56('0x0'));var moment=require(_0x2f56('0x1'));var ami=require(_0x2f56('0x2'));var logger=require(_0x2f56('0x3'))(_0x2f56('0x4'));var RpcUser=require(_0x2f56('0x5'));var RpcVoiceAgentReport=require(_0x2f56('0x6'));function Acw(_0x217301){this[_0x2f56('0x7')]=_0x217301['voiceQueues'];this[_0x2f56('0x8')]=_0x217301['agents'];this[_0x2f56('0x9')]=_0x217301['timers'];this[_0x2f56('0xa')]={};ami['on'](_0x2f56('0xb'),this[_0x2f56('0xc')][_0x2f56('0xd')](this));ami['on'](_0x2f56('0xe'),this[_0x2f56('0xf')][_0x2f56('0xd')](this));ami['on'](_0x2f56('0x10'),this[_0x2f56('0x11')]['bind'](this));ami['on'](_0x2f56('0x12'),this[_0x2f56('0x13')]['bind'](this));ami['on'](_0x2f56('0x14'),this[_0x2f56('0x15')]['bind'](this));ami['on'](_0x2f56('0x16'),this['syncBlindTransfer'][_0x2f56('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x2f56('0x17')][_0x2f56('0xd')](this));}function getDiff(_0x11ef44){var _0x3d5742=moment()[_0x2f56('0x18')](0x0);var _0x69fc74=moment(_0x11ef44)[_0x2f56('0x18')](0x0);return _0x3d5742[_0x2f56('0x19')](_0x69fc74,'seconds');}Acw[_0x2f56('0x1a')][_0x2f56('0x1b')]=function(_0x11dd1e,_0x1d2463){var _0x341045=this;var _0x546407=getDiff(_0x341045[_0x2f56('0x9')][_0x11dd1e][_0x2f56('0x1c')]);clearTimeout(_0x341045[_0x2f56('0x9')][_0x11dd1e][_0x2f56('0x1d')]);_0x341045[_0x2f56('0x9')][_0x11dd1e]['timer']=![];return RpcVoiceAgentReport[_0x2f56('0x1e')]({'acwtime':_0x546407},_0x341045[_0x2f56('0x9')][_0x11dd1e][_0x2f56('0x1f')],_0x11dd1e)[_0x2f56('0x20')](function(_0x45ad8c){logger['info'](_0x2f56('0x21'),_0x1d2463,_0x546407,_0x45ad8c);})[_0x2f56('0x22')](function(_0x22e2e6){logger[_0x2f56('0x23')](_0x2f56('0x24'),_0x1d2463,_0x22e2e6);})[_0x2f56('0x25')](function(){delete _0x341045[_0x2f56('0x9')][_0x11dd1e];});};Acw[_0x2f56('0x1a')]['startAcw']=function(_0x1474a3){try{var _0x497d3f=this;var _0x5bac85=this[_0x2f56('0xa')][_0x1474a3][_0x2f56('0x26')];var _0x26d5d1=this[_0x2f56('0xa')][_0x1474a3][_0x2f56('0x27')];var _0x433f0b=this[_0x2f56('0x7')][_0x26d5d1];var _0x5c1e69=![];var _0x54c5ef=_0x2f56('0x28');if(_0x433f0b[_0x2f56('0x29')]&&_0x433f0b[_0x2f56('0x2a')][_0x2f56('0x2b')]){_0x5c1e69=!![];_0x54c5ef=_0x433f0b[_0x2f56('0x2a')]['name'];}if(!_0x497d3f[_0x2f56('0x8')][_0x5bac85]){return Promise[_0x2f56('0x2c')]();}return RpcUser[_0x2f56('0x2d')](_0x497d3f[_0x2f56('0x8')][_0x5bac85]['id'])[_0x2f56('0x20')](function(_0x2d1e99){if(!_0x2d1e99||_0x2d1e99[_0x2f56('0x2e')]){logger[_0x2f56('0x2f')](_0x2f56('0x30'),_0x1474a3,_0x5bac85,_0x26d5d1);return;}logger['info'](_0x2f56('0x31'),_0x1474a3,_0x5bac85,_0x26d5d1);var _0x49b89c=_0x497d3f['channels'][_0x1474a3][_0x2f56('0x32')]&&_0x497d3f[_0x2f56('0xa')][_0x1474a3][_0x2f56('0x33')]?_0x497d3f['channels'][_0x1474a3]['destlinkedid']:_0x1474a3;return RpcUser['savePause'](_0x497d3f[_0x2f56('0x8')][_0x5bac85],_0x54c5ef,_0x49b89c);})[_0x2f56('0x20')](function(_0xa785a5){if(_0x5c1e69||!_0xa785a5){return;}_0x497d3f[_0x2f56('0x9')][_0x5bac85]={};logger[_0x2f56('0x2f')](_0x2f56('0x34'),_0x1474a3,_0x497d3f[_0x2f56('0x7')][_0x26d5d1]['acwTimeout'],_0x5bac85,_0x26d5d1);_0x497d3f[_0x2f56('0x9')][_0x5bac85][_0x2f56('0x1d')]=setTimeout(_0x497d3f[_0x2f56('0x35')]['bind'](_0x497d3f,_0x5bac85),_0x497d3f[_0x2f56('0x7')][_0x26d5d1][_0x2f56('0x36')]*0x3e8);_0x497d3f[_0x2f56('0x9')][_0x5bac85][_0x2f56('0x1c')]=moment()[_0x2f56('0x37')](_0x2f56('0x38'));_0x497d3f[_0x2f56('0x9')][_0x5bac85]['uniqueid']=_0x1474a3;_0x497d3f[_0x2f56('0x9')][_0x5bac85][_0x2f56('0x27')]=_0x26d5d1;_0x497d3f['timers'][_0x5bac85][_0x2f56('0x1b')]=_0x497d3f[_0x2f56('0x1b')]['bind'](_0x497d3f,_0x5bac85,_0x1474a3);})[_0x2f56('0x22')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1474a3,_0x497d3f[_0x2f56('0x7')][_0x26d5d1][_0x2f56('0x36')],_0x5bac85,_0x26d5d1);})[_0x2f56('0x25')](function(){delete _0x497d3f['channels'][_0x1474a3];});}catch(_0x32eef6){logger['error'](_0x2f56('0x39'),_0x32eef6['message']);}};Acw[_0x2f56('0x1a')][_0x2f56('0x35')]=function(_0xb1f3fd){try{var _0x549b20=this;if(_0x549b20[_0x2f56('0x9')][_0xb1f3fd]){_0x549b20[_0x2f56('0x9')][_0xb1f3fd][_0x2f56('0x1d')]=![];var _0x39ac26=_0x549b20[_0x2f56('0x9')][_0xb1f3fd][_0x2f56('0x1f')];var _0x5a9cc4=_0x549b20[_0x2f56('0x9')][_0xb1f3fd][_0x2f56('0x27')];var _0x442300=_0x549b20[_0x2f56('0x7')][_0x5a9cc4][_0x2f56('0x36')];logger[_0x2f56('0x2f')](_0x2f56('0x3a'),_0x39ac26,_0xb1f3fd);RpcUser[_0x2f56('0x3b')](this[_0x2f56('0x8')][_0xb1f3fd]);RpcVoiceAgentReport['update']({'acwtime':_0x442300,'agentacw':!![]},_0x39ac26,_0xb1f3fd)[_0x2f56('0x20')](function(_0x4b6213){logger[_0x2f56('0x2f')](_0x2f56('0x21'),_0x39ac26,_0x442300,_0x4b6213);})[_0x2f56('0x22')](function(_0x301acc){logger[_0x2f56('0x23')](_0x2f56('0x24'),_0x39ac26,_0x301acc);});}else{logger[_0x2f56('0x23')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xb1f3fd);if(_0x549b20['timers']){logger[_0x2f56('0x2f')]('[ACW][TIMERS]',JSON[_0x2f56('0x3c')](_0x549b20[_0x2f56('0x9')]));}}}catch(_0x1d3efa){logger[_0x2f56('0x23')](_0x2f56('0x3d'),_0x1d3efa[_0x2f56('0x3e')]);}};Acw[_0x2f56('0x1a')][_0x2f56('0xc')]=function(_0x1de6a7){try{if(this['voiceQueues'][_0x1de6a7['queue']]&&(this[_0x2f56('0x7')][_0x1de6a7['queue']][_0x2f56('0x4')]||this[_0x2f56('0x7')][_0x1de6a7[_0x2f56('0x27')]][_0x2f56('0x29')])){if(this[_0x2f56('0x8')][_0x1de6a7[_0x2f56('0x26')]]){this['channels'][_0x1de6a7['uniqueid']]={'queue':_0x1de6a7['queue'],'interface':_0x1de6a7[_0x2f56('0x26')],'destlinkedid':_0x1de6a7['destlinkedid']};}}}catch(_0x18d2ef){logger[_0x2f56('0x23')]('[ACW][syncAgentConnect]\x20%s',_0x18d2ef[_0x2f56('0x3e')]);}};Acw['prototype'][_0x2f56('0x17')]=function(_0x5b7133){try{if(this[_0x2f56('0x7')][_0x5b7133[_0x2f56('0x27')]]&&(this[_0x2f56('0x7')][_0x5b7133[_0x2f56('0x27')]]['acw']||this[_0x2f56('0x7')][_0x5b7133[_0x2f56('0x27')]][_0x2f56('0x29')])){if(this[_0x2f56('0x8')][_0x5b7133[_0x2f56('0x26')]]){this['channels'][_0x5b7133[_0x2f56('0x1f')]]={'queue':_0x5b7133[_0x2f56('0x27')],'interface':_0x5b7133[_0x2f56('0x26')]};}}}catch(_0x519790){logger[_0x2f56('0x23')]('[ACW][syncAgentConnectPreview]\x20%s',_0x519790[_0x2f56('0x3e')]);}};Acw[_0x2f56('0x1a')]['syncHangupRequest']=function(_0x5d24c5){try{if(this[_0x2f56('0xa')][_0x5d24c5[_0x2f56('0x1f')]]&&_[_0x2f56('0x3f')](this[_0x2f56('0xa')][_0x5d24c5[_0x2f56('0x1f')]]['attended'])){logger[_0x2f56('0x2f')](_0x2f56('0x40'),_0x5d24c5[_0x2f56('0x1f')]);this['startAcw'](_0x5d24c5[_0x2f56('0x1f')]);}else if(this[_0x2f56('0xa')][_0x5d24c5[_0x2f56('0x41')]]&&_[_0x2f56('0x3f')](this['channels'][_0x5d24c5[_0x2f56('0x41')]][_0x2f56('0x32')])){logger[_0x2f56('0x2f')](_0x2f56('0x42'),_0x5d24c5[_0x2f56('0x41')]);this[_0x2f56('0x43')](_0x5d24c5[_0x2f56('0x41')]);}}catch(_0x5a9c12){logger[_0x2f56('0x23')](_0x2f56('0x44'),_0x5a9c12['message']);}};Acw['prototype'][_0x2f56('0x11')]=function(_0x4465b6){try{if(this['channels'][_0x4465b6[_0x2f56('0x1f')]]&&this['channels'][_0x4465b6[_0x2f56('0x1f')]]['attended']){logger[_0x2f56('0x2f')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4465b6['uniqueid']);this[_0x2f56('0x43')](_0x4465b6[_0x2f56('0x1f')]);}else if(this[_0x2f56('0xa')][_0x4465b6[_0x2f56('0x41')]]&&this['channels'][_0x4465b6[_0x2f56('0x41')]]['attended']){logger[_0x2f56('0x2f')](_0x2f56('0x45'),_0x4465b6[_0x2f56('0x41')]);this[_0x2f56('0x43')](_0x4465b6[_0x2f56('0x41')]);}}catch(_0x4c7bb4){logger['error'](_0x2f56('0x46'),_0x4c7bb4[_0x2f56('0x3e')]);}};Acw['prototype'][_0x2f56('0x15')]=function(_0x3ba3b5){try{if(!_[_0x2f56('0x47')](this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x48')]])){this[_0x2f56('0x43')](_0x3ba3b5[_0x2f56('0x48')]);if(this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x49')]]){this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x49')]][_0x2f56('0x32')]=!![];this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x4a')]]=this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x49')]];delete this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x49')]];}}else if(!_[_0x2f56('0x47')](this[_0x2f56('0xa')][_0x3ba3b5['transfertargetuniqueid']])){this['startAcw'](_0x3ba3b5[_0x2f56('0x4a')]);if(this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x4b')]]){this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x4b')]][_0x2f56('0x32')]=!![];this['channels'][_0x3ba3b5[_0x2f56('0x48')]]=this['channels'][_0x3ba3b5[_0x2f56('0x4b')]];delete this[_0x2f56('0xa')][_0x3ba3b5[_0x2f56('0x4b')]];}}}catch(_0x5d19bd){logger[_0x2f56('0x23')](_0x2f56('0x4c'),_0x5d19bd['message']);}};Acw['prototype'][_0x2f56('0x4d')]=function(_0x44b420){try{if(this['channels'][_0x44b420[_0x2f56('0x4e')]]){logger['info'](_0x2f56('0x4f'),JSON[_0x2f56('0x3c')](_0x44b420['transfereruniqueid']));this['startAcw'](_0x44b420[_0x2f56('0x4e')]);}else if(this[_0x2f56('0xa')][_0x44b420['transfererlinkedid']]){logger['info'](_0x2f56('0x50'),JSON[_0x2f56('0x3c')](_0x44b420[_0x2f56('0x51')]));this[_0x2f56('0x43')](_0x44b420['transfererlinkedid']);}}catch(_0x257553){logger[_0x2f56('0x23')](_0x2f56('0x52'),_0x257553[_0x2f56('0x3e')]);}};Acw[_0x2f56('0x1a')]['syncAgentRingNoAnswer']=function(_0x197a07){try{if(this['voiceQueues'][_0x197a07[_0x2f56('0x27')]]&&this[_0x2f56('0x7')][_0x197a07[_0x2f56('0x27')]][_0x2f56('0x53')]===_0x2f56('0x54')){if(this[_0x2f56('0x8')][_0x197a07['interface']]){logger[_0x2f56('0x2f')](_0x2f56('0x55'),_0x197a07[_0x2f56('0x1f')],_0x197a07[_0x2f56('0x26')],_0x197a07['queue']);return RpcUser[_0x2f56('0x56')](this[_0x2f56('0x8')][_0x197a07[_0x2f56('0x26')]],'Auto-Pause',_0x197a07[_0x2f56('0x1f')]);}}}catch(_0x45fafa){logger[_0x2f56('0x23')](_0x2f56('0x57'),_0x45fafa[_0x2f56('0x3e')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8e1bfd5..2e48b78 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 _0x5f8f=['format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','Action','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','connect','shutdown','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','once','exports','asterisk-manager','bluebird','util','../../config/logger','../../config/environment','asterisk','username','password','keepConnected','promisify','action','error'];(function(_0x2955be,_0x17e9c4){var _0x27604b=function(_0x16adc0){while(--_0x16adc0){_0x2955be['push'](_0x2955be['shift']());}};_0x27604b(++_0x17e9c4);}(_0x5f8f,0x7c));var _0xf5f8=function(_0x5f2c23,_0x5cf43d){_0x5f2c23=_0x5f2c23-0x0;var _0x314150=_0x5f8f[_0x5f2c23];return _0x314150;};'use strict';var Manager=require(_0xf5f8('0x0'));var BPromise=require(_0xf5f8('0x1'));var util=require(_0xf5f8('0x2'));var logger=require(_0xf5f8('0x3'))('ami');var config=require(_0xf5f8('0x4'));var ami=new Manager(config[_0xf5f8('0x5')]['port'],config[_0xf5f8('0x5')]['ip'],config[_0xf5f8('0x5')][_0xf5f8('0x6')],config['asterisk'][_0xf5f8('0x7')],!![]);ami[_0xf5f8('0x8')]();ami['Action']=BPromise[_0xf5f8('0x9')](ami[_0xf5f8('0xa')]);function error(_0x59c4a9){logger[_0xf5f8('0xb')](util[_0xf5f8('0xc')](_0xf5f8('0xd'),config[_0xf5f8('0x5')]['username'],config[_0xf5f8('0x5')]['ip'],config['asterisk'][_0xf5f8('0xe')],util[_0xf5f8('0xf')](_0x59c4a9,![],null)));}function close(){logger[_0xf5f8('0xb')](util['format'](_0xf5f8('0x10'),config[_0xf5f8('0x5')][_0xf5f8('0x6')],config[_0xf5f8('0x5')]['ip'],config['asterisk'][_0xf5f8('0xe')]));}ami[_0xf5f8('0x11')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xf5f8('0x12')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0xf5f8('0x13')]=function(){return function(){return ami[_0xf5f8('0x14')]({'action':_0xf5f8('0x15')});};};ami[_0xf5f8('0x16')]=function(){return function(){return ami[_0xf5f8('0x14')]({'action':'queuesummary'});};};ami[_0xf5f8('0x17')]=function(){return function(){return ami[_0xf5f8('0x14')]({'action':_0xf5f8('0x18')});};};function connect(){logger[_0xf5f8('0x19')](util[_0xf5f8('0xc')](_0xf5f8('0x1a'),config[_0xf5f8('0x5')][_0xf5f8('0x6')],config['asterisk']['ip'],config[_0xf5f8('0x5')][_0xf5f8('0xe')]));ami['once']('error',error);ami['once'](_0xf5f8('0x1b'),close);}ami['on'](_0xf5f8('0x1c'),connect);ami['on'](_0xf5f8('0x1d'),function(_0x3483e1){logger[_0xf5f8('0x19')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xf5f8('0x5')][_0xf5f8('0x6')],config[_0xf5f8('0x5')]['ip'],config[_0xf5f8('0x5')][_0xf5f8('0xe')],util[_0xf5f8('0xf')](_0x3483e1,![],null)));});ami['on']('fullybooted',function(){logger[_0xf5f8('0x19')](util[_0xf5f8('0xc')](_0xf5f8('0x1e'),config[_0xf5f8('0x5')][_0xf5f8('0x6')],config[_0xf5f8('0x5')]['ip'],config['asterisk'][_0xf5f8('0xe')]));return Promise['resolve']()['then'](ami[_0xf5f8('0x11')]())[_0xf5f8('0x1f')](ami[_0xf5f8('0x12')]())['then'](ami[_0xf5f8('0x13')]())[_0xf5f8('0x1f')](ami['actionQueueSummary']())['then'](ami[_0xf5f8('0x17')]())['catch'](function(_0x49a41f){logger['error']('[ami.js][fullybooted]',util['inspect'](_0x49a41f,{'showHidden':![],'depth':null}));});});ami['once'](_0xf5f8('0xb'),error);ami[_0xf5f8('0x20')](_0xf5f8('0x1b'),close);module[_0xf5f8('0x21')]=ami; \ No newline at end of file +var _0xc613=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','asterisk','port','username','password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x111692,_0x19f8a9){var _0x11836f=function(_0x2f2714){while(--_0x2f2714){_0x111692['push'](_0x111692['shift']());}};_0x11836f(++_0x19f8a9);}(_0xc613,0xb5));var _0x3c61=function(_0x3c668c,_0x5bed9b){_0x3c668c=_0x3c668c-0x0;var _0x4443d9=_0xc613[_0x3c668c];return _0x4443d9;};'use strict';var Manager=require(_0x3c61('0x0'));var BPromise=require(_0x3c61('0x1'));var util=require(_0x3c61('0x2'));var logger=require(_0x3c61('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x3c61('0x4')][_0x3c61('0x5')],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')][_0x3c61('0x6')],config[_0x3c61('0x4')][_0x3c61('0x7')],!![]);ami[_0x3c61('0x8')]();ami['Action']=BPromise['promisify'](ami[_0x3c61('0x9')]);function error(_0x409550){logger[_0x3c61('0xa')](util[_0x3c61('0xb')](_0x3c61('0xc'),config[_0x3c61('0x4')]['username'],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')][_0x3c61('0x5')],util[_0x3c61('0xd')](_0x409550,![],null)));}function close(){logger[_0x3c61('0xa')](util[_0x3c61('0xb')](_0x3c61('0xe'),config[_0x3c61('0x4')][_0x3c61('0x6')],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')]['port']));}ami[_0x3c61('0xf')]=function(){return function(){return ami[_0x3c61('0x10')]({'action':'sipshowregistry'});};};ami[_0x3c61('0x11')]=function(){return function(){return ami[_0x3c61('0x10')]({'action':_0x3c61('0x12')});};};ami[_0x3c61('0x13')]=function(){return function(){return ami['Action']({'action':_0x3c61('0x14')});};};ami[_0x3c61('0x15')]=function(){return function(){return ami[_0x3c61('0x10')]({'action':_0x3c61('0x16')});};};ami[_0x3c61('0x17')]=function(){return function(){return ami[_0x3c61('0x10')]({'action':_0x3c61('0x18')});};};function connect(){logger[_0x3c61('0x19')](util[_0x3c61('0xb')](_0x3c61('0x1a'),config[_0x3c61('0x4')]['username'],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')][_0x3c61('0x5')]));ami[_0x3c61('0x1b')](_0x3c61('0xa'),error);ami[_0x3c61('0x1b')](_0x3c61('0x1c'),close);}ami['on'](_0x3c61('0x1d'),connect);ami['on'](_0x3c61('0x1e'),function(_0x3904c4){logger[_0x3c61('0x19')](util[_0x3c61('0xb')](_0x3c61('0x1f'),config[_0x3c61('0x4')][_0x3c61('0x6')],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')][_0x3c61('0x5')],util[_0x3c61('0xd')](_0x3904c4,![],null)));});ami['on'](_0x3c61('0x20'),function(){logger[_0x3c61('0x19')](util[_0x3c61('0xb')](_0x3c61('0x21'),config['asterisk']['username'],config[_0x3c61('0x4')]['ip'],config[_0x3c61('0x4')][_0x3c61('0x5')]));return Promise[_0x3c61('0x22')]()[_0x3c61('0x23')](ami[_0x3c61('0xf')]())[_0x3c61('0x23')](ami[_0x3c61('0x11')]())[_0x3c61('0x23')](ami[_0x3c61('0x13')]())[_0x3c61('0x23')](ami[_0x3c61('0x15')]())[_0x3c61('0x23')](ami[_0x3c61('0x17')]())[_0x3c61('0x24')](function(_0x5e12a1){logger[_0x3c61('0xa')](_0x3c61('0x25'),util['inspect'](_0x5e12a1,{'showHidden':![],'depth':null}));});});ami[_0x3c61('0x1b')](_0x3c61('0xa'),error);ami[_0x3c61('0x1b')]('close',close);module[_0x3c61('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6157bf9..5e873d6 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x30977b,_0x22be64){var _0x339a92=function(_0x2d7a68){while(--_0x2d7a68){_0x30977b['push'](_0x30977b['shift']());}};_0x339a92(++_0x22be64);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12a2a7,_0xc34be3){_0x12a2a7=_0x12a2a7-0x0;var _0x3c4725=_0xb43b[_0x12a2a7];return _0x3c4725;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x55fadc,_0x893839){var _0x2edba=function(_0x2dd6c9){while(--_0x2dd6c9){_0x55fadc['push'](_0x55fadc['shift']());}};_0x2edba(++_0x893839);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0xbdb7[_0x5f6a8a];return _0x2cce4d;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 25889fa..a168552 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 _0x7397=['predictiveIntervalTotalCalls','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','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','erlangCallToSecond','erlangAbandonmentRate','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','stack','error','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','isTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','OVERTIME_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','syncAgentConnect','voiceQueues','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','getSeconds','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ListId','CampaignId','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','VoiceQueueId','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','callProgressDetecting','variable','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','HangupInAMD','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','reason\x2019\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','running','statusMessage','getQueueCampaignStatusMessage','inUse','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','throttle','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','actionOriginate','voiceQueue\x20is\x20undefine','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialer','getCaller','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','assign','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','phone','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','RUNNING','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','talking','not_inuse','checkContactEmpty','countReScheduled','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','./utils','../preview/util/util','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------'];(function(_0x2754de,_0x3bd78c){var _0x489d11=function(_0x2c0c2e){while(--_0x2c0c2e){_0x2754de['push'](_0x2754de['shift']());}};_0x489d11(++_0x3bd78c);}(_0x7397,0x1cd));var _0x7739=function(_0x271d59,_0x265071){_0x271d59=_0x271d59-0x0;var _0x29881f=_0x7397[_0x271d59];return _0x29881f;};'use strict';var util=require(_0x7739('0x0'));var _=require(_0x7739('0x1'));var uuid=require(_0x7739('0x2'));var moment=require(_0x7739('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x7739('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x7739('0x5'));var config=require('../../../config/environment/');var logger=require(_0x7739('0x6'))('dialer');var loggerBooked=require(_0x7739('0x6'))(_0x7739('0x7'));var loggerPredictive=require(_0x7739('0x6'))(_0x7739('0x8'));var loggerPredictiveCalls=require(_0x7739('0x6'))(_0x7739('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x7739('0xa'));var ami=require('../ami');config['redis']=_[_0x7739('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7739('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x7739('0xd'));var Interval=require(_0x7739('0xe'));var Action=require(_0x7739('0xf'));var History=require(_0x7739('0x10'));var Final=require('./models/final');var AgentComplete=require(_0x7739('0x11'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x7739('0x12'));var ipAgi=process[_0x7739('0x13')]['XCALLY_IP_AGI']||_0x7739('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7739('0x15')][_0x7739('0x16')]=function(_0x3c5940){this[_0x7739('0x17')]=this['tail']?this['tail'][_0x7739('0x18')](_0x3c5940):_0x3c5940();};function Dialer(_0x280c87,_0x5b3594){this[_0x7739('0x19')]=new Sequence();this[_0x7739('0x1a')]=_0x5b3594;this['voiceQueues']=_0x280c87['voiceQueues'];this[_0x7739('0x1b')]=_0x280c87[_0x7739('0x1b')];this[_0x7739('0x1c')]=_0x280c87[_0x7739('0x1c')];this[_0x7739('0x1d')]=_0x280c87['trunks'];this[_0x7739('0x1e')]=config['maxNumberOriginate']||0x2;this[_0x7739('0x1f')]={};this[_0x7739('0x20')]={};this[_0x7739('0x21')]={};this['uniqueId']={};this[_0x7739('0x22')]={};this[_0x7739('0x23')]={};this[_0x7739('0x24')]={};this[_0x7739('0x25')]={};this['queueBooked']={};this[_0x7739('0x26')]={};this[_0x7739('0x27')]={};ami['on'](_0x7739('0x28'),this['syncAgentConnect'][_0x7739('0x29')](this));ami['on'](_0x7739('0x2a'),this[_0x7739('0x2b')][_0x7739('0x29')](this));ami['on']('originateresponse',this[_0x7739('0x2c')][_0x7739('0x29')](this));ami['on'](_0x7739('0x2d'),this[_0x7739('0x2e')][_0x7739('0x29')](this));ami['on'](_0x7739('0x2f'),this[_0x7739('0xa')][_0x7739('0x29')](this));ami['on']('custom:queuesummarycomplete',this[_0x7739('0x30')][_0x7739('0x29')](this));ami['on'](_0x7739('0x31'),this[_0x7739('0x32')][_0x7739('0x29')](this));ami['on']('newexten',this[_0x7739('0x33')][_0x7739('0x29')](this));ami['on']('varset',this[_0x7739('0x34')][_0x7739('0x29')](this));ami['on']('queuemember',this[_0x7739('0x35')][_0x7739('0x29')](this));ami['on']('queuestatuscomplete',this[_0x7739('0x36')][_0x7739('0x29')](this));this[_0x7739('0x37')]();this['loopClearZombieChannels']();RpcSetting[_0x7739('0x38')]()[_0x7739('0x39')](function(_0x4626ec){previewRecallmeReminderInterval=_0x4626ec['previewRecallmeReminderInterval'];});}function isNotNull(_0x157dd7){return _0x157dd7!==null&&!_[_0x7739('0x3a')](_0x157dd7);}function msgResponse(_0x3cf93f,_0x24eebc,_0x2cf178){return{'action':_0x3cf93f,'response':_0x24eebc,'message':_0x2cf178,'stack':_0x2cf178};}function emit(_0x274789,_0x36ab43,_0x14506f){io['to'](_0x274789)[_0x7739('0x3b')](_0x36ab43,_0x14506f);}function emitOutboundVoiceQueueSummary(_0x59bdc9){if(_0x59bdc9[_0x7739('0x3c')]===_0x7739('0x3d')){logger[_0x7739('0x3e')](_0x7739('0x3f'),util[_0x7739('0x40')](_0x59bdc9,{'showHidden':![],'depth':null}));emit(util[_0x7739('0x41')](_0x7739('0x42'),_0x59bdc9[_0x7739('0x43')]),_0x7739('0x44'),_0x59bdc9);}}function checkGetDataPredictive(_0x50a13b){if(isNotNull(_0x50a13b)&&!_['isEmpty'](_0x50a13b)){loggerPredictive['info'](_0x7739('0x45'));loggerPredictive[_0x7739('0x46')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50a13b['predictiveIntervalTotalCalls']);loggerPredictive[_0x7739('0x46')](_0x7739('0x47'),_0x50a13b[_0x7739('0x48')]);loggerPredictive[_0x7739('0x46')](_0x7739('0x49'),_0x50a13b['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x7739('0x46')](_0x7739('0x4a'),_0x50a13b[_0x7739('0x4b')]);loggerPredictive[_0x7739('0x46')](_0x7739('0x4c'),_0x50a13b[_0x7739('0x4d')]);loggerPredictive[_0x7739('0x46')](_0x7739('0x4e'),_0x50a13b[_0x7739('0x4f')]);loggerPredictive[_0x7739('0x46')](_0x7739('0x50'));if(_0x50a13b[_0x7739('0x51')]>0x0){if(!_[_0x7739('0x3a')](_0x50a13b['predictiveIntervalAvgTalktime'])&&_0x50a13b[_0x7739('0x4f')]>0x0){return!![];}loggerPredictive[_0x7739('0x46')](_0x7739('0x52'));if(!_['isUndefined'](_0x50a13b[_0x7739('0x4d')])&&_0x50a13b[_0x7739('0x4d')]>0x0){return!![];}loggerPredictive['info'](_0x7739('0x53'));}else{loggerPredictive[_0x7739('0x46')](_0x7739('0x54'));}}else{loggerPredictive[_0x7739('0x46')](_0x7739('0x55'));}return![];}function mergeDataErlangB(_0x5b0acc){return function(_0x1aee2d){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x7739('0x46')](_0x7739('0x56'),_0x1aee2d[_0x7739('0x57')]);loggerPredictive[_0x7739('0x46')](_0x7739('0x58'),_0x1aee2d[_0x7739('0x59')]);loggerPredictive[_0x7739('0x46')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1aee2d[_0x7739('0x5a')]);loggerPredictive[_0x7739('0x46')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1aee2d['erlangBusyFactor']);loggerPredictive[_0x7739('0x46')](_0x7739('0x5b'),_0x1aee2d['erlangAbandonmentRate']);loggerPredictive[_0x7739('0x46')]('---------------------------');_[_0x7739('0x5c')](_0x5b0acc,_0x1aee2d);};}function ifInterval(_0x1053ae,_0x24ec9a){if(_['isUndefined'](_0x24ec9a)){return![];}return utils['getSeconds'](undefined,_0x24ec9a)<_0x1053ae*0x3c;}function clearPredictiveAttributes(_0x1fdd83){if(_0x1fdd83[_0x7739('0x24')]){_0x1fdd83[_0x7739('0x24')]=undefined;loggerPredictive[_0x7739('0x3e')](_0x1fdd83[_0x7739('0x43')],'startProgressive\x20value\x20cleared');}if(_0x1fdd83[_0x7739('0x23')]){_0x1fdd83[_0x7739('0x23')]=undefined;loggerPredictive[_0x7739('0x3e')](_0x1fdd83[_0x7739('0x43')],_0x7739('0x5d'));}if(_0x1fdd83['handlePredictive']){clearInterval(_0x1fdd83[_0x7739('0x5e')]);_0x1fdd83[_0x7739('0x5e')]=undefined;loggerPredictive[_0x7739('0x3e')](_0x1fdd83[_0x7739('0x43')],_0x7739('0x5f'));}}function loggerCatchPredictive(_0x2578ca,_0x57e1cc){return function(_0x3ce7fb){loggerPredictive['error'](_0x57e1cc[_0x7739('0x43')],_0x2578ca);loggerPredictive['error'](_0x3ce7fb[_0x7739('0x60')]);clearPredictiveAttributes(_0x57e1cc);};}function loggerCatch(_0x3f2dae){return function(_0xa90fcc){logger[_0x7739('0x61')](_0x3f2dae,util[_0x7739('0x40')](_0xa90fcc,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x285a76,_0x482410,_0x2ce633){return function(_0x347440){utils[_0x7739('0x62')](_0x482410,_0x2ce633,0x0);logger[_0x7739('0x61')](_0x285a76,util[_0x7739('0x40')](_0x347440,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3a7fac){return function(_0x23901){if(isNotNull(_0x23901)&&isNotNull(_0x23901[0x0])){if(_0x23901[0x0][_0x7739('0x63')]>0x0){_0x3a7fac['message']=utils[_0x7739('0x64')]['CONTACTS_RESCHEDULED'];logger[_0x7739('0x46')](_0x7739('0x65')+_0x3a7fac['name'],_0x23901[0x0][_0x7739('0x63')],_0x7739('0x66'));}else{_0x3a7fac[_0x7739('0x67')]=utils['CAMPAIGN_STATUS'][_0x7739('0x68')];logger[_0x7739('0x46')](_0x7739('0x69')+_0x3a7fac[_0x7739('0x43')]);}}};}function createObjHistory(_0x20ef6b,_0x2c98f0,_0x41b060,_0xc23215,_0x1561ae){_0x20ef6b[_0x7739('0x67')]=_0x41b060;var _0x720123=new Action(_0x20ef6b,_0x2c98f0);var _0x4af3a7=new History(_0x720123);_0x4af3a7[_0x7739('0x6a')]=_0xc23215;_0x4af3a7[_0x7739('0x6b')]=_0x1561ae;_0x4af3a7[_0x7739('0x6c')]=_0x720123[_0x7739('0x6d')];return _0x4af3a7;}function unlockQueueStatus(_0x44b9dc,_0x10fae1){setTimeout(function(){if(_[_0x7739('0x3a')](_0x44b9dc[_0x7739('0x6e')])){loggerBooked[_0x7739('0x61')](_0x7739('0x6f'),_0x10fae1);}_0x44b9dc[_0x7739('0x6e')]=!![];loggerBooked['info'](_0x7739('0x70'),_0x10fae1,JSON[_0x7739('0x71')](_[_0x7739('0x72')](_0x44b9dc,[_0x7739('0x43'),_0x7739('0x6e')])));},0x1f3);}function checkInterval(_0x524311){return function(){if(!isNotNull(_0x524311[_0x7739('0x73')])){_0x524311[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x74')];throw _0x524311[_0x7739('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x524311[_0x7739('0x73')][_0x7739('0x75')])){_0x524311[_0x7739('0x67')]=utils['CAMPAIGN_STATUS'][_0x7739('0x74')];throw _0x524311['name']+_0x7739('0x76');}if(!isNotNull(_[_0x7739('0x77')](_0x524311['Interval']['Intervals']))){_0x524311[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x74')];throw _0x524311[_0x7739('0x43')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x30933b){return function(){if(!utils[_0x7739('0x78')](_0x30933b)){_0x30933b[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x79')];throw _0x30933b['name']+_0x7739('0x7a');}};}function emitCampaignSummary(_0x5df0be){if(utils[_0x7739('0x7b')](_0x5df0be)){emit(util[_0x7739('0x41')](_0x7739('0x7c'),_0x5df0be[_0x7739('0x43')]),_0x7739('0x7d'),_0x5df0be);}}function loggerCatchQueueSummary(_0x3b9031,_0x16f60d){return function(_0x3ba353){clearPredictiveAttributes(_0x16f60d);emitCampaignSummary(_0x16f60d);loggerSyncQueueSummary['debug'](_0x3b9031,util[_0x7739('0x40')](_0x3ba353,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1809c7){if(_0x1809c7['sendMessageOneNotActive']){if(_0x1809c7[_0x7739('0x7e')]===0x0){_0x1809c7[_0x7739('0x7f')]=![];_0x1809c7[_0x7739('0x67')]=utils['CAMPAIGN_STATUS'][_0x7739('0x79')];loggerSyncQueueSummary[_0x7739('0x3e')](_0x7739('0x80'),_0x1809c7['name'],_0x7739('0x81'));}else{_0x1809c7['message']=utils[_0x7739('0x64')]['DISACTIVED'];loggerSyncQueueSummary[_0x7739('0x3e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1809c7[_0x7739('0x43')],'is\x20disactive');}emitCampaignSummary(_0x1809c7);}}function myreject(_0x2a3090){return function(_0x315483){return _0x2a3090(msgResponse(_0x7739('0x82'),_0x7739('0x83'),JSON[_0x7739('0x71')](_0x315483)));};}Dialer[_0x7739('0x15')]['isTrunkReachable']=function(_0x557f91){return!_[_0x7739('0x3a')](_0x557f91)&&_0x557f91&&!_[_0x7739('0x3a')](_0x557f91[_0x7739('0x43')])&&!_[_0x7739('0x3a')](_0x557f91[_0x7739('0x84')])&&_0x557f91[_0x7739('0x84')]&&(this[_0x7739('0x1d')][util[_0x7739('0x41')](_0x7739('0x85'),_0x557f91[_0x7739('0x43')])][_0x7739('0x86')]===_0x7739('0x87')||this[_0x7739('0x1d')][util['format'](_0x7739('0x85'),_0x557f91[_0x7739('0x43')])][_0x7739('0x86')]===_0x7739('0x88'));};Dialer['prototype'][_0x7739('0x89')]=function(_0x5ad493){var _0x150d8f=this;return function(){if(!_0x150d8f[_0x7739('0x8a')](_0x5ad493['Trunk'])){if(!_0x150d8f['isTrunkReachable'](_0x5ad493['TrunkBackup'])){_0x5ad493[_0x7739('0x67')]=utils[_0x7739('0x64')]['TRUNK_NOT_REACHABLE'];throw _0x5ad493['name']+_0x7739('0x8b');}}};};Dialer[_0x7739('0x15')][_0x7739('0x8c')]=function(_0x3830e5,_0x340044,_0x4dd7fd,_0x33fb86){var _0x188964=this;return function(){var _0x57fef7=!![];return _0x188964[_0x7739('0x8d')](_0x3830e5,_0x340044,_0x4dd7fd,_0x33fb86,_0x57fef7);};};Dialer['prototype'][_0x7739('0x8e')]=function(_0x5da8ec,_0x52efd0,_0x265431,_0x5a05bf){var _0x589586=this;return function(){var _0x1ff170=![];return _0x589586[_0x7739('0x8d')](_0x5da8ec[_0x7739('0x75')],_0x52efd0,_0x265431,_0x5a05bf,_0x1ff170);};};Dialer['prototype']['ifTimeIvr']=function(_0x4b3d75,_0x1aaa24,_0x6b6421,_0xd29c77,_0xaf9d72){var _0x1fa58f=[];return new Promise(function(_0x3b35de,_0x2b08af){if(!isNotNull(_0x4b3d75)){_0xd29c77[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x74')];return _0x2b08af(msgResponse(_0x7739('0x8f'),_0x7739('0x90'),_0x6b6421+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x7739('0x77')](_0x4b3d75)){_0xd29c77[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x91')];return _0x2b08af(msgResponse(_0x7739('0x8f'),_0x7739('0x90'),_0x6b6421+_0x7739('0x92')));}if(_0x1aaa24&&_['isUndefined'](config['timezones'][_0x1aaa24])){_0xd29c77['message']=utils[_0x7739('0x64')][_0x7739('0x93')];return _0x2b08af(msgResponse('ifTime','Failure',_0x6b6421+_0x7739('0x94')+_0x1aaa24));}if(_['isArray'](_0x4b3d75)){for(var _0x2c266a=0x0;_0x2c266a<_0x4b3d75[_0x7739('0x95')];_0x2c266a+=0x1){_0x1fa58f[_0x7739('0x96')](ami[_0x7739('0x97')]({'action':'command','command':util[_0x7739('0x41')](_0x7739('0x98'),_0x4b3d75[_0x2c266a][_0x7739('0x99')],!_[_0x7739('0x3a')](config[_0x7739('0x9a')][_0x1aaa24])?_0x1aaa24:'')})['then'](function(_0x4246c8){return _0x4246c8[_0x7739('0x9b')][_0x7739('0x9c')](_0x7739('0x9d'))>=0x0;})['catch'](myreject(_0x2b08af)));}}else{_0x1fa58f[_0x7739('0x96')](ami[_0x7739('0x97')]({'action':'command','command':util[_0x7739('0x41')](_0x7739('0x98'),_0x4b3d75,!_[_0x7739('0x3a')](config[_0x7739('0x9a')][_0x1aaa24])?_0x1aaa24:'')})['then'](function(_0x43c0fb){return _0x43c0fb[_0x7739('0x9b')]['indexOf'](_0x7739('0x9d'))>=0x0;})[_0x7739('0x9e')](myreject(_0x2b08af)));}Promise[_0x7739('0x9f')](_0x1fa58f)[_0x7739('0x39')](function(_0x521b17){var _0x22404d=_[_0x7739('0xa0')](_0x521b17);if(_0x22404d){return _0x3b35de(_0x22404d);}else{_0xd29c77[_0x7739('0x67')]=_0xaf9d72?utils['CAMPAIGN_STATUS'][_0x7739('0xa1')]:utils[_0x7739('0x64')]['OVERTIME_INTERVAL'];return _0x2b08af(msgResponse(_0x7739('0xa2'),_0x7739('0x90'),_0x7739('0xa3')+_0xaf9d72+'\x20'+_0x6b6421+_0x7739('0xa4')+util[_0x7739('0x40')](_0x4b3d75,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1aaa24));}})[_0x7739('0x9e')](function(_0x5f438d){return _0x2b08af(msgResponse(_0x7739('0x8f'),'Failure',JSON[_0x7739('0x71')](_0x5f438d)));});});};Dialer[_0x7739('0x15')][_0x7739('0x37')]=function(){var _0x2530f2=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x7739('0x39')](function(){setInterval(function(){_0x2530f2[_0x7739('0xa5')]();},0x3e8);});};Dialer[_0x7739('0x15')][_0x7739('0xa5')]=function(){var _0x22f154=this;var _0x4d8327;for(var _0x5b052b in this['campaigns']){if(typeof this['campaigns'][_0x5b052b]!==_0x7739('0xa6')){_0x4d8327=this['campaigns'][_0x5b052b];if(utils[_0x7739('0x7b')](_0x4d8327)&&utils[_0x7739('0x78')](_0x4d8327)){_0x4d8327[_0x7739('0x7f')]=!![];Promise[_0x7739('0xa7')]()[_0x7739('0x39')](checkIsIVRCampaignActive(_0x4d8327))[_0x7739('0x39')](checkInterval(_0x4d8327))[_0x7739('0x39')](_0x22f154['checkIsTrunkReachable'](_0x4d8327))[_0x7739('0x39')](_0x22f154[_0x7739('0x8c')](_0x4d8327[_0x7739('0xa8')],_0x4d8327[_0x7739('0xa9')],_0x4d8327['name'],_0x4d8327))['then'](_0x22f154[_0x7739('0x8e')](_0x4d8327[_0x7739('0x73')],_0x4d8327[_0x7739('0xa9')],_0x4d8327[_0x7739('0x43')],_0x4d8327))[_0x7739('0x39')](_0x22f154[_0x7739('0xaa')](_0x4d8327))[_0x7739('0x9e')](loggerCatchQueueSummary(_0x7739('0xab'),_0x4d8327));}else{notSendMessagesCampaign(_0x4d8327);}}}};Dialer[_0x7739('0x15')]['checkDialMethod']=function(_0x5dda26){if(_0x5dda26[_0x7739('0xac')]!==_0x7739('0x8')){clearPredictiveAttributes(_0x5dda26);}switch(_0x5dda26[_0x7739('0xac')]){case'progressive':this[_0x7739('0xad')](_0x5dda26,0x1);break;case _0x7739('0xae'):this[_0x7739('0xad')](_0x5dda26,_0x5dda26[_0x7739('0xaf')]);break;case _0x7739('0x8'):this[_0x7739('0x8')](_0x5dda26);break;case _0x7739('0x7'):this[_0x7739('0xad')](_0x5dda26,0x1);break;default:logger[_0x7739('0x61')](_0x7739('0xb0'),_0x5dda26[_0x7739('0x43')],_0x7739('0xb1'));}};Dialer[_0x7739('0x15')][_0x7739('0x8f')]=function(_0x20df29,_0x4b621a){var _0x31a4a8=_0x20df29[_0x7739('0xa9')];var _0x3d6c9b=_0x4b621a?_0x20df29[_0x7739('0xa8')]:_0x20df29[_0x7739('0x73')][_0x7739('0x75')];logger[_0x7739('0xb2')](_0x7739('0xb3'),_0x3d6c9b,_0x31a4a8,_0x20df29['name'],util[_0x7739('0x41')](_0x7739('0xb4'),_0x20df29[_0x7739('0x43')],_0x20df29['id']));var _0x478468=null;return Interval['intervalIftime'](_0x3d6c9b,_0x31a4a8)[_0x7739('0x39')](function(_0xae571d){if(_0xae571d===!![]){return _0xae571d;}else{_0x20df29[_0x7739('0x67')]=_0x4b621a?utils[_0x7739('0x64')][_0x7739('0xa1')]:utils['CAMPAIGN_STATUS'][_0x7739('0xb5')];_0x478468=msgResponse(_0x7739('0xa2'),_0x7739('0x90'),_0x7739('0xa3')+_0x4b621a+'\x20'+_0x20df29[_0x7739('0x43')]+_0x7739('0xa4')+util[_0x7739('0x40')](_0x3d6c9b,{'showHidden':![],'depth':null})+_0x7739('0xb6')+_0x31a4a8);}if(_0x478468!==null){logger[_0x7739('0xb2')](_0x7739('0xb7'),_0x478468);_0x478468['isGlobal']=_0x4b621a;throw _0x478468;}})[_0x7739('0x9e')](function(_0x25fb0d){logger[_0x7739('0x61')](_0x7739('0xb8'),_0x25fb0d);throw msgResponse(_0x7739('0x82'),_0x7739('0x83'),util['inspect'](_0x25fb0d,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x7739('0xb9')]=function(_0x2e2f8a){if(this[_0x7739('0xba')][_0x2e2f8a[_0x7739('0xbb')]]){if(this[_0x7739('0xbc')][_0x2e2f8a[_0x7739('0xbd')]]&&this['uniqueId'][_0x2e2f8a[_0x7739('0xbd')]][_0x7739('0x3c')]!==_0x7739('0xbe')){this[_0x7739('0xbf')](this[_0x7739('0xba')][_0x2e2f8a[_0x7739('0xbb')]]);this[_0x7739('0xbc')][_0x2e2f8a[_0x7739('0xbd')]][_0x7739('0xc0')]=moment()[_0x7739('0x41')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x7739('0x15')]['syncAgentComplete']=function(_0x470ea7){var _0x4cd91b=this['uniqueId'][_0x470ea7[_0x7739('0xbd')]];if(this[_0x7739('0xba')][_0x470ea7['queue']]){if(_0x4cd91b&&_0x4cd91b[_0x7739('0x3c')]!=='ivr'){delete this[_0x7739('0xbc')][_0x470ea7['uniqueid']];this['voiceQueues'][_0x470ea7['queue']][_0x7739('0xc1')]+=0x1;var _0x5bd14c=new AgentComplete(_0x4cd91b,_0x470ea7);if(_0x470ea7[_0x7739('0xc2')]===_0x7739('0xc3')){_0x5bd14c[_0x7739('0xc4')]=this['voiceQueues'][_0x470ea7[_0x7739('0xbb')]][_0x7739('0xc5')]&&this[_0x7739('0xba')][_0x470ea7[_0x7739('0xbb')]][_0x7739('0xc6')]?moment()['format'](_0x7739('0xc7')):undefined;}hopperUtils[_0x7739('0xc8')](_0x5bd14c)[_0x7739('0x9e')](loggerCatch(_0x7739('0xc9')));hopperUtils[_0x7739('0xca')](_0x5bd14c)[_0x7739('0x9e')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7739('0x15')][_0x7739('0x2b')]=function(_0x1a688f){var _0x598e3c=this[_0x7739('0xbc')][_0x1a688f[_0x7739('0xbd')]];var _0x49ffe9=this;var _0x50f25f=![];var _0x4fcdcc;var _0x4a62e3;if(this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]]){if(_0x598e3c&&_0x598e3c['type']!==_0x7739('0xbe')){delete this['uniqueId'][_0x1a688f['uniqueid']];this[_0x7739('0xbf')](this['voiceQueues'][_0x1a688f[_0x7739('0xbb')]]);_0x598e3c[_0x7739('0xcb')]=moment()['format'](_0x7739('0xc7'));var _0x5413cb=new QueueCallerAbandon(_0x598e3c,_0x1a688f);if(utils[_0x7739('0xcc')](_0x598e3c[_0x7739('0xcb')],_0x598e3c['responsetime'])>=_0x598e3c[_0x7739('0xcd')]){this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xce')]+=0x1;this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xcf')]+=0x1;this['voiceQueues'][_0x1a688f['queue']][_0x7739('0xd0')]+=0x1;_0x5413cb[_0x7739('0x6a')]=0xa;_0x5413cb[_0x7739('0x6b')]=_0x7739('0xd1');_0x5413cb[_0x7739('0xd2')]=_0x7739('0xd3');_0x5413cb['agiafterat']=this['voiceQueues'][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xc5')]?moment()[_0x7739('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5413cb[_0x7739('0xd4')]+=0x1;_0x5413cb['countglobal']+=0x1;_0x4fcdcc=this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xd5')];_0x4a62e3=this['voiceQueues'][_0x1a688f['queue']][_0x7739('0xd6')];hopperUtils[_0x7739('0xd7')](_0x5413cb,_0x5413cb[_0x7739('0x6a')],_0x598e3c[_0x7739('0xd8')])[_0x7739('0x39')](function(_0x27efe3){_0x50f25f=_0x27efe3[_0x7739('0xd9')]==0x1;if(_0x5413cb[_0x7739('0xd4')]>=_0x49ffe9[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xda')]){_0x49ffe9[_0x7739('0xdb')](_0x5413cb,_0x27efe3[_0x7739('0xd9')]);}else{hopperUtils[_0x7739('0xdc')]({'active':![],'countdropretry':_0x5413cb['countdropretry'],'scheduledat':moment()[_0x7739('0xdd')](_0x49ffe9['voiceQueues'][_0x1a688f['queue']][_0x7739('0xd5')],_0x7739('0xde'))['format'](_0x7739('0xc7')),'ContactId':_0x598e3c['ContactId'],'ListId':_0x598e3c[_0x7739('0xdf')],'VoiceQueueId':_0x598e3c['VoiceQueueId']||undefined,'CampaignId':_0x598e3c[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch('[rescheduleContact][Drop]'));var _0xf8c55a=new History(_0x5413cb);_0xf8c55a[_0x7739('0x6a')]=0xa;_0xf8c55a[_0x7739('0x6b')]='Drop';_0xf8c55a[_0x7739('0x6d')]=moment()[_0x7739('0x41')](_0x7739('0xc7'));_0xf8c55a[_0x7739('0x6c')]=_0xf8c55a[_0x7739('0x6d')];_0xf8c55a[_0x7739('0xe1')]=_0x5413cb[_0x7739('0xe1')];_0xf8c55a[_0x7739('0xe2')]=_0x5413cb[_0x7739('0xe2')];hopperUtils[_0x7739('0xc8')](_0xf8c55a)['catch'](loggerCatch(_0x7739('0xe3')));}})[_0x7739('0x39')](function(){if(_0x50f25f)hopperUtils['swapAdditionalPhones'](_0x5413cb,_0x4fcdcc,_0x4a62e3)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x1a688f[_0x7739('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xe4')]+=0x1;_0x5413cb[_0x7739('0x6a')]=0xb;_0x5413cb[_0x7739('0x6b')]='Abandoned';_0x5413cb['dropreason']='CALLEREXIT';_0x5413cb[_0x7739('0xe5')]+=0x1;_0x5413cb[_0x7739('0xe6')]+=0x1;_0x4fcdcc=this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xe7')];_0x4a62e3=this[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xd6')];hopperUtils[_0x7739('0xd7')](_0x5413cb,_0x5413cb['state'],_0x598e3c[_0x7739('0xd8')])[_0x7739('0x39')](function(_0x140313){if(_0x5413cb[_0x7739('0xe5')]>=_0x49ffe9[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xe8')]){_0x49ffe9[_0x7739('0xdb')](_0x5413cb,_0x140313[_0x7739('0xd9')]);}else{hopperUtils[_0x7739('0xdc')]({'active':![],'countabandonedretry':_0x5413cb[_0x7739('0xe5')],'scheduledat':moment()[_0x7739('0xdd')](_0x49ffe9[_0x7739('0xba')][_0x1a688f[_0x7739('0xbb')]][_0x7739('0xe7')],_0x7739('0xde'))[_0x7739('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x598e3c['ContactId'],'ListId':_0x598e3c[_0x7739('0xdf')],'VoiceQueueId':_0x598e3c[_0x7739('0xe9')]||undefined,'CampaignId':_0x598e3c['CampaignId']||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0xea')));var _0x72cb0a=new History(_0x5413cb);_0x72cb0a[_0x7739('0x6a')]=0xb;_0x72cb0a[_0x7739('0x6b')]=_0x7739('0xeb');_0x72cb0a[_0x7739('0x6d')]=moment()[_0x7739('0x41')](_0x7739('0xc7'));_0x72cb0a['endtime']=_0x72cb0a['starttime'];_0x72cb0a[_0x7739('0xe1')]=_0x5413cb[_0x7739('0xe1')];_0x72cb0a[_0x7739('0xe2')]=_0x5413cb[_0x7739('0xe2')];hopperUtils[_0x7739('0xc8')](_0x72cb0a)[_0x7739('0x9e')](loggerCatch(_0x7739('0xec')));}})['then'](function(){if(_0x50f25f)hopperUtils[_0x7739('0xed')](_0x5413cb,_0x4fcdcc,_0x4a62e3)[_0x7739('0x39')](function(){return 0x1;});});}}}};Dialer[_0x7739('0x15')][_0x7739('0x33')]=function(_0x2cf956){if(this[_0x7739('0x20')][_0x2cf956['uniqueid']]){this[_0x7739('0x20')][_0x2cf956[_0x7739('0xbd')]]['channel']=_0x2cf956[_0x7739('0xee')];}if(this['uniqueId'][_0x2cf956[_0x7739('0xbd')]]){this['uniqueId'][_0x2cf956['uniqueid']][_0x7739('0xee')]=_0x2cf956[_0x7739('0xee')];}};Dialer[_0x7739('0x15')][_0x7739('0x35')]=function(_0x47871d){if(!this['actions'][_0x47871d['actionid']]){return;}var _0x3db43d=this[_0x7739('0xba')][this['actions'][_0x47871d[_0x7739('0xef')]]['queue']][_0x7739('0xf0')]||_0x7739('0xf1');if(_0x3db43d===_0x7739('0xf2')){if(this['actions'][_0x47871d[_0x7739('0xef')]]&&_[_0x7739('0xf3')](this[_0x7739('0x20')][_0x47871d['actionid']][_0x7739('0xf4')])&&_0x47871d[_0x7739('0x86')]==='1'&&_0x47871d[_0x7739('0xf5')]==='0'){if(this[_0x7739('0x1c')][_0x47871d[_0x7739('0xf6')]]){if(!this['agents'][_0x47871d[_0x7739('0xf6')]][_0x7739('0xf4')]){this[_0x7739('0x1c')][_0x47871d[_0x7739('0xf6')]][_0x7739('0xf4')]=!![];this[_0x7739('0x20')][_0x47871d['actionid']][_0x7739('0xf4')]=!![];this[_0x7739('0x20')][_0x47871d[_0x7739('0xef')]][_0x7739('0xf6')]=_0x47871d[_0x7739('0xf6')];}}}}else if(_0x3db43d==='rrmemory'){if(this[_0x7739('0x20')][_0x47871d[_0x7739('0xef')]]){if(this[_0x7739('0x1c')][_0x47871d[_0x7739('0xf6')]]){this['actions'][_0x47871d[_0x7739('0xef')]][_0x7739('0xf6')]=_0x47871d[_0x7739('0xf6')];if(_[_0x7739('0xf3')](this[_0x7739('0xf7')][this['actions'][_0x47871d[_0x7739('0xef')]][_0x7739('0xbb')]])){this[_0x7739('0xf7')][this[_0x7739('0x20')][_0x47871d[_0x7739('0xef')]]['queue']]=[];}this['queueBooked'][this[_0x7739('0x20')][_0x47871d['actionid']][_0x7739('0xbb')]][_0x7739('0x96')](_[_0x7739('0x5c')](_['pick'](this[_0x7739('0x20')][_0x47871d[_0x7739('0xef')]],[_0x7739('0xf8'),_0x7739('0xf6')]),{'status':_0x47871d[_0x7739('0x86')],'paused':_0x47871d[_0x7739('0xf5')]}));}}}};Dialer[_0x7739('0x15')][_0x7739('0x36')]=function(_0x469da5){if(!this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]]){return;}var _0x62cb1=this;var _0x5437e4=this[_0x7739('0xba')][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]];var _0x53dc08=_0x5437e4['strategy']||'rrmemory';if(_0x53dc08===_0x7739('0xf2')){if(this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]]&&this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]]['stateinterface']){this[_0x7739('0x1a')][_0x7739('0xf9')](this[_0x7739('0x20')][_0x469da5['actionid']]['idHopper'],this['actions'][_0x469da5[_0x7739('0xef')]][_0x7739('0xf6')])[_0x7739('0x9e')](function(_0x2c1391){logger[_0x7739('0x61')](_0x7739('0xfa'),util['inspect'](_0x2c1391,{'showHidden':![],'depth':null}));})['finally'](function(){_0x62cb1[_0x7739('0xbf')](_0x62cb1[_0x7739('0xba')][_0x62cb1[_0x7739('0x20')][_0x469da5['actionid']][_0x7739('0xbb')]]);_0x62cb1['agents'][_0x62cb1[_0x7739('0x20')][_0x469da5['actionid']]['stateinterface']][_0x7739('0xf4')]=![];delete _0x62cb1[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]];unlockQueueStatus(_0x5437e4);});}else{this[_0x7739('0xbf')](this[_0x7739('0xba')][this['actions'][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]]);hopperUtils[_0x7739('0xdc')]({'active':![],'ContactId':this['actions'][_0x469da5[_0x7739('0xef')]][_0x7739('0xfb')],'ListId':this['actions'][_0x469da5['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x469da5['actionid']][_0x7739('0xe9')]||undefined,'CampaignId':this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xe0')]||undefined})['catch'](loggerCatch(_0x7739('0xfc')));delete this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]];unlockQueueStatus(_0x5437e4);}}else if(_0x53dc08===_0x7739('0xf1')){var _0x32cbc8;if(this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]]&&!_[_0x7739('0x77')](this[_0x7739('0xf7')][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]])){if(this[_0x7739('0x26')][_0x62cb1[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]]){this[_0x7739('0x26')][_0x62cb1[_0x7739('0x20')][_0x469da5['actionid']][_0x7739('0xbb')]]=this['queueBookedRR'][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]]['queue']]?this['queueBookedRR'][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]]:this['queueBooked'][this[_0x7739('0x20')][_0x469da5['actionid']][_0x7739('0xbb')]]?this['queueBooked'][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]]['_rr']=this[_0x7739('0x26')][this[_0x7739('0x20')][_0x469da5[_0x7739('0xef')]][_0x7739('0xbb')]];for(var _0x1eee2a=0x0;_0x1eee2a=_0x3887a1[_0x7739('0x120')]){_0x1ca172[_0x7739('0x121')](_0x4a7f5d,_0x404dc4,_0x364b21,_0x7739('0x122'));}else{if(_0x4a7f5d[_0x7739('0x11a')]>=_0x3887a1[_0x7739('0x123')]){_0x1ca172[_0x7739('0x124')](_0x4a7f5d,_0x404dc4,_0x364b21,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4a7f5d[_0x7739('0x11a')],'scheduledat':moment()[_0x7739('0xdd')](_0x3887a1[_0x7739('0x125')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0x4a7f5d[_0x7739('0xfb')],'ListId':_0x4a7f5d['ListId'],'VoiceQueueId':_0x4a7f5d[_0x7739('0xe9')]||undefined,'CampaignId':_0x4a7f5d[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0x404dc4({'reschedule':0x1});}}});}if(_0x2b4fca[_0x7739('0x3c')]===_0x7739('0xbe')&&this['campaigns'][_0x2b4fca[_0x7739('0xbb')]]['dialAMDActive']&&_0x20b1a7[_0x7739('0x10f')]===_0x7739('0x110')){delete this['uniqueId'][_0x20b1a7['uniqueid']];this[_0x7739('0xbf')](this['campaigns'][_0x2b4fca['queue']]);_0x2e3184=new Hangup(_0x2b4fca,_0x20b1a7);_0x2e3184[_0x7739('0x6a')]=0x12;_0x2e3184[_0x7739('0x6b')]=_0x7739('0x126');_0x2e3184[_0x7739('0x112')]=_0x7739('0x113');ami[_0x7739('0x3b')](_0x7739('0x127'),ut['buildObj'](_0x2e3184,_0x7739('0x115')));this[_0x7739('0x116')](_0x2e3184,_0x7739('0x128'),_0x7739('0x129'));}if(_0x2b4fca[_0x7739('0x3c')]==='ivr'&&this['campaigns'][_0x2b4fca[_0x7739('0xbb')]][_0x7739('0x10e')]&&_0x20b1a7[_0x7739('0x10f')]===_0x7739('0x118')){return new Promise(function(_0x3f0d38,_0x57ff3b){delete _0x1ca172[_0x7739('0xbc')][_0x20b1a7[_0x7739('0xbd')]];_0x1ca172['updateOriginated'](_0x1ca172[_0x7739('0x1b')][_0x2b4fca[_0x7739('0xbb')]]);_0x1ca172['campaigns'][_0x2b4fca[_0x7739('0xbb')]][_0x7739('0xc1')]+=0x1;_0x1ca172['campaigns'][_0x2b4fca[_0x7739('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x27e88c=_0x1ca172[_0x7739('0x1b')][_0x2b4fca[_0x7739('0xbb')]];var _0x4e958d=new Hangup(_0x2b4fca,_0x20b1a7);_0x4e958d[_0x7739('0x6a')]=0x13;_0x4e958d[_0x7739('0x6b')]=_0x7739('0x119');_0x4e958d[_0x7739('0x112')]='AMD';_0x4e958d[_0x7739('0x11a')]+=0x1;_0x4e958d[_0x7739('0xe6')]+=0x1;_0x4e958d[_0x7739('0x115')]=!![];ami[_0x7739('0x3b')]('custom:amd',ut['buildObj'](_0x4e958d,'amd'));hopperUtils[_0x7739('0xc8')](_0x4e958d)[_0x7739('0x9e')](loggerCatch(_0x7739('0x11b')));if(_0x4e958d[_0x7739('0x11c')]+_0x4e958d[_0x7739('0x12a')]+_0x4e958d[_0x7739('0x11d')]+_0x4e958d[_0x7739('0x11e')]+_0x4e958d[_0x7739('0xd4')]+_0x4e958d[_0x7739('0xe5')]+_0x4e958d[_0x7739('0x11a')]+_0x4e958d[_0x7739('0x11f')]>=_0x27e88c['dialGlobalMaxRetry']){_0x1ca172[_0x7739('0x121')](_0x4e958d,_0x3f0d38,_0x57ff3b,_0x7739('0x122'));}else{if(_0x4e958d[_0x7739('0x11a')]>=_0x27e88c[_0x7739('0x123')]){_0x1ca172[_0x7739('0x124')](_0x4e958d,_0x3f0d38,_0x57ff3b,_0x7739('0x12b'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4e958d['countmachineretry'],'scheduledat':moment()[_0x7739('0xdd')](_0x27e88c[_0x7739('0x125')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0x4e958d[_0x7739('0xfb')],'ListId':_0x4e958d['ListId'],'VoiceQueueId':_0x4e958d[_0x7739('0xe9')]||undefined,'CampaignId':_0x4e958d[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x12c')));_0x3f0d38({'reschedule':0x1});}}});}}};Dialer[_0x7739('0x15')][_0x7739('0x32')]=function(_0x16cb6b){var _0x1e7687=this[_0x7739('0xbc')][_0x16cb6b[_0x7739('0xbd')]];var _0x1113e9;if(_0x1e7687&&_0x1e7687['type']===_0x7739('0xbe')){delete this['uniqueId'][_0x16cb6b[_0x7739('0xbd')]];this[_0x7739('0xbf')](this[_0x7739('0x1b')][_0x1e7687['queue']]);this[_0x7739('0x1b')][_0x1e7687[_0x7739('0xbb')]][_0x7739('0x12d')]+=0x1;_0x1113e9=new Hangup(_0x1e7687,_0x16cb6b);hopperUtils[_0x7739('0xc8')](_0x1113e9)['catch'](loggerCatch(_0x7739('0x12e')));hopperUtils[_0x7739('0xca')](_0x1113e9)[_0x7739('0x9e')](loggerCatch(_0x7739('0x12f')));}if(_0x1e7687&&_0x1e7687[_0x7739('0x3c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x1e7687[_0x7739('0xbb')]][_0x7739('0x130')])){delete this['uniqueId'][_0x16cb6b[_0x7739('0xbd')]];this[_0x7739('0xbf')](this[_0x7739('0xba')][_0x1e7687[_0x7739('0xbb')]]);this[_0x7739('0xba')][_0x1e7687[_0x7739('0xbb')]]['outboundAnswerCallsDay']+=0x1;this[_0x7739('0xba')][_0x1e7687[_0x7739('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x1113e9=new Hangup(_0x1e7687,_0x16cb6b);_0x1113e9[_0x7739('0x6a')]=0x10;_0x1113e9['statedesc']=_0x7739('0x131');_0x1113e9['membername']=_0x7739('0x132');hopperUtils[_0x7739('0xc8')](_0x1113e9)['catch'](loggerCatch(_0x7739('0x12e')));hopperUtils[_0x7739('0xca')](_0x1113e9)[_0x7739('0x9e')](loggerCatch('[syncHangupIvr]'));}if(_0x1e7687&&_0x1e7687[_0x7739('0x3c')]!==_0x7739('0xbe')&&!isNotNull(this[_0x7739('0xba')][_0x1e7687['queue']]['dialQueueProject'])){delete this[_0x7739('0xbc')][_0x16cb6b['uniqueid']];this[_0x7739('0xbf')](this[_0x7739('0xba')][_0x1e7687[_0x7739('0xbb')]]);this[_0x7739('0xba')][_0x1e7687[_0x7739('0xbb')]]['outboundUnknownCallsDay']+=0x1;_0x1113e9=new Hangup(_0x1e7687,_0x16cb6b);_0x1113e9[_0x7739('0x6a')]=0xc;_0x1113e9[_0x7739('0x6b')]=_0x16cb6b[_0x7739('0x133')];_0x1113e9[_0x7739('0x112')]=_0x7739('0x134');hopperUtils[_0x7739('0xc8')](_0x1113e9)[_0x7739('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x7739('0xca')](_0x1113e9)['catch'](loggerCatch(_0x7739('0x12f')));}};Dialer[_0x7739('0x15')][_0x7739('0xa')]=function(_0x5b5087){var _0x48f5af=this;if(!_0x48f5af[_0x7739('0x27')][_0x5b5087['name']]){_0x48f5af[_0x7739('0x27')][_0x5b5087[_0x7739('0x43')]]={'running':![]};}else if(_0x48f5af[_0x7739('0x27')][_0x5b5087[_0x7739('0x43')]]['running']===!![]){return;}else if(_0x48f5af['queuesSummary'][_0x5b5087[_0x7739('0x43')]][_0x7739('0x135')]===![]){_0x48f5af[_0x7739('0x27')][_0x5b5087[_0x7739('0x43')]][_0x7739('0x135')]=!![];}var _0x85664d=_0x48f5af[_0x7739('0xba')][_0x5b5087[_0x7739('0x43')]];var _0x1bdbae=_0x85664d[_0x7739('0x67')]!==utils['CAMPAIGN_STATUS'][_0x7739('0x79')];var _0x526924=utils['isPreviewCampaign'](_0x85664d);_0x85664d[_0x7739('0x136')]=utils[_0x7739('0x137')](_0x85664d,_0x48f5af['trunks']);Promise[_0x7739('0xa7')]()[_0x7739('0x39')](function(){if(_0x85664d[_0x7739('0x136')]===utils[_0x7739('0x64')][_0x7739('0x79')]){if(_0x1bdbae){clearPredictiveAttributes(_0x85664d);_0x5b5087['startPredictive']=undefined;_0x5b5087[_0x7739('0x24')]=undefined;}if(_0x85664d[_0x7739('0x136')]===utils['CAMPAIGN_STATUS']['INACTIVE']){_0x5b5087['available']=0x0;_0x5b5087['paused']=0x0;_0x5b5087[_0x7739('0x138')]=0x0;_0x5b5087['talking']=0x0;_0x5b5087[_0x7739('0x139')]=0x0;}}else if(_0x85664d[_0x7739('0x136')]===utils[_0x7739('0x64')][_0x7739('0x13a')]&&!_0x526924){return _0x48f5af[_0x7739('0x8f')](_0x85664d,!![])['then'](function(){return _0x48f5af[_0x7739('0x8f')](_0x85664d,![]);})['then'](function(){return _0x48f5af[_0x7739('0x13b')](_0x85664d);})[_0x7739('0x9e')](function(_0x2dc4f1){loggerSyncQueueSummary[_0x7739('0x3e')](_0x7739('0x13c'),util[_0x7739('0x40')](_0x2dc4f1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x85664d);});}else{clearPredictiveAttributes(_0x85664d);}})['then'](function(){var _0x4501da=_0x5b5087[_0x7739('0x13d')](_0x85664d);if(_0x4501da||_0x85664d['queueSummaryCountersUpdated']){_0x85664d['queueSummaryCountersUpdated']=![];_0x5b5087['updateReportFromOutboundQueue'](_0x85664d);Object['assign'](_0x85664d,_0x5b5087);emitOutboundVoiceQueueSummary(_0x5b5087);}_0x48f5af[_0x7739('0x27')][_0x85664d[_0x7739('0x43')]][_0x7739('0x135')]=![];})[_0x7739('0x9e')](function(_0x243113){logger[_0x7739('0x61')](_0x7739('0x13c'),util[_0x7739('0x40')](_0x243113,{'showHidden':![],'depth':null}));_0x48f5af[_0x7739('0x27')][_0x85664d[_0x7739('0x43')]][_0x7739('0x135')]=![];});};Dialer[_0x7739('0x15')][_0x7739('0x30')]=_[_0x7739('0x13e')](function(){var _0x3290e2=_['filter'](this['voiceQueues'],function(_0xca9bba){return _0xca9bba[_0x7739('0x13f')];});var _0x17c8cc=_['filter'](this[_0x7739('0x1c')],function(_0x2a1860){return _0x2a1860[_0x7739('0x140')]&&_0x2a1860[_0x7739('0x86')]==='reachable';});if(_0x3290e2[_0x7739('0x95')]>0x0&&_0x17c8cc[_0x7739('0x95')]>0x0){return Promise[_0x7739('0xa7')]()[_0x7739('0x39')](cmHopper[_0x7739('0x141')](_[_0x7739('0x142')](_0x3290e2,'id'),previewRecallmeReminderInterval,_['map'](_0x17c8cc,'id')))['then'](function(_0x149cb2){for(var _0x5ed9b8=0x0;_0x5ed9b8<_0x149cb2[_0x7739('0x95')];_0x5ed9b8++){var _0x594743=_0x149cb2[_0x5ed9b8][_0x7739('0x143')][_0x7739('0x43')];if(_0x594743)io['to'](util[_0x7739('0x41')]('user:%s',_0x594743))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x149cb2[_0x5ed9b8]});}})['catch'](function(_0x2d03f3){logger[_0x7739('0x61')]('checkPreviewRecallReminder',_0x2d03f3);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x7739('0x15')][_0x7739('0x144')]=function(){var _0x43d116=this;setInterval(function(){_0x43d116[_0x7739('0x145')](_0x43d116[_0x7739('0xbc')],_0x7739('0x146'));_0x43d116[_0x7739('0x145')](_0x43d116[_0x7739('0x20')],'[actions]');},0x32c8);};Dialer[_0x7739('0x15')][_0x7739('0x145')]=function(_0x263956,_0x413726){var _0x30cc9e=this;for(var _0x89fe02 in _0x263956){if(typeof _0x263956[_0x89fe02]!==_0x7739('0xa6')){this[_0x7739('0x19')][_0x7739('0x16')](function(){if(!_[_0x7739('0xf3')](_0x263956[_0x89fe02])){return ami[_0x7739('0x97')]({'action':'status','channel':_0x263956[_0x89fe02][_0x7739('0xee')]})['catch'](function(_0x41435a){if(_0x41435a[_0x7739('0x67')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x263956[_0x89fe02]&&_0x263956[_0x89fe02][_0x7739('0x3c')]!==_0x7739('0xbe')){_0x30cc9e[_0x7739('0xbf')](_0x30cc9e[_0x7739('0xba')][_0x263956[_0x89fe02][_0x7739('0xbb')]]);logger[_0x7739('0x61')]('[Dialer][checkChannel]',_0x413726,_0x89fe02,_0x263956[_0x89fe02]['queue']);delete _0x263956[_0x89fe02];}if(_0x263956[_0x89fe02]&&_0x263956[_0x89fe02][_0x7739('0x3c')]===_0x7739('0xbe')){_0x30cc9e[_0x7739('0xbf')](_0x30cc9e[_0x7739('0x1b')][_0x263956[_0x89fe02]['queue']]);logger[_0x7739('0x61')](_0x7739('0x147'),_0x413726,_0x89fe02,_0x263956[_0x89fe02][_0x7739('0xbb')]);delete _0x263956[_0x89fe02];}},0x2328);}});}});}}};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x312031){return Promise[_0x7739('0xa7')]()['then'](voiceQueueRt[_0x7739('0x148')](_0x312031))[_0x7739('0x9e')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x7739('0x15')][_0x7739('0xbf')]=function(_0x5ad7c4){if(!_[_0x7739('0x3a')](_0x5ad7c4)&&_0x5ad7c4!==null){if(typeof _0x5ad7c4[_0x7739('0x7e')]!=='undefined'){if(_0x5ad7c4[_0x7739('0x7e')]>0x0){_0x5ad7c4[_0x7739('0x7e')]-=0x1;}else{logger[_0x7739('0x61')](_0x7739('0x149'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x7739('0x14a')]=function(_0x53de31,_0x18890d){var _0x594aa9=this;return function(_0x581e4b){_0x594aa9[_0x7739('0xbf')](_0x18890d);logger[_0x7739('0x61')](_0x53de31,util[_0x7739('0x40')](_0x581e4b,{'showHidden':![],'depth':null}));};};Dialer[_0x7739('0x15')]['emptyContact']=function(_0x18cbd3,_0x8512ab,_0x5bc218){var _0x3ae9c4={'state':0x19,'statedesc':_0x7739('0x14b')};this['updateOriginated'](_0x8512ab);this[_0x7739('0x116')](_['merge'](_0x3ae9c4,_[_0x7739('0x72')](_0x5bc218,[_0x7739('0xfb'),_0x7739('0xdf'),_0x7739('0x14c'),_0x7739('0xe9'),_0x7739('0xe0')])),'[emptyContact][createHistory]',_0x7739('0x14d'));logger[_0x7739('0x61')](_0x18cbd3);};Dialer[_0x7739('0x15')][_0x7739('0x116')]=function(_0x3d849e,_0x483c41,_0x27e02f){hopperUtils['createHistory'](_0x3d849e)['catch'](loggerCatch(_0x483c41));hopperUtils[_0x7739('0xca')](_0x3d849e)[_0x7739('0x9e')](loggerCatch(_0x27e02f));};Dialer[_0x7739('0x15')][_0x7739('0xdb')]=function(_0x29cd97,_0x328615){hopperUtils['createHistory'](_0x29cd97)[_0x7739('0x9e')](loggerCatch(_0x7739('0xc9')));if(_0x328615==0x0){hopperUtils[_0x7739('0xca')](_0x29cd97)['catch'](loggerCatch(_0x7739('0x14e')));}};Dialer[_0x7739('0x15')][_0x7739('0x14f')]=function(_0x5b587f){return Promise[_0x7739('0xa7')]()[_0x7739('0x39')](cmHopper['handlePreviewRecallNotifications'](_0x5b587f['id'],previewRecallmeReminderInterval))[_0x7739('0x39')](function(_0x2b2d8b){for(var _0x23c25f=0x0;_0x23c25f<_0x2b2d8b['length'];_0x23c25f++){var _0x45caee=_0x2b2d8b[_0x23c25f][_0x7739('0x143')]['name'];if(_0x45caee)io['to'](util[_0x7739('0x41')](_0x7739('0x150'),_0x45caee))[_0x7739('0x3b')]('user:dialPreviewRecallReminder',{'hopper':_0x2b2d8b[_0x23c25f]});}})[_0x7739('0x9e')](function(){});};Dialer['prototype'][_0x7739('0xaa')]=function(_0x119105){var _0x4d150d=this;return function(){_0x4d150d['handleIvr'](_0x119105);};};Dialer[_0x7739('0x15')][_0x7739('0x151')]=function(_0x3a2186,_0x583709){var _0x33f511=this;var _0x2d6456=uuid['v4']();this[_0x7739('0x20')][_0x2d6456]=new Action(_0x3a2186,_0x583709,_0x2d6456);return new Promise(function(_0x424dbd,_0x2c2ffa){if(_[_0x7739('0x3a')](_0x3a2186)&&typeof _0x3a2186!=='object'){return _0x2c2ffa(msgResponse('originate','Failure',_0x7739('0x152')));}if(_[_0x7739('0x3a')](_0x583709['phone'])||_0x583709['phone']===null){return _0x2c2ffa(msgResponse(_0x7739('0x153'),_0x7739('0x90'),_0x7739('0x154')));}var _0x541115={'XMD-CALLERID':_0x33f511['actions'][_0x2d6456]['getCaller'](),'XMD-AGI':_0x3a2186['dialQueueProject']?util[_0x7739('0x41')](_0x7739('0x155'),ipAgi,_0x3a2186[_0x7739('0x130')]):_0x7739('0x156'),'XMD-AGIAFTER':_0x3a2186['dialQueueProject2']?util[_0x7739('0x41')](_0x7739('0x155'),ipAgi,_0x3a2186[_0x7739('0xc5')]):_0x7739('0x156'),'XMD-QUEUE':utils[_0x7739('0x157')](_0x3a2186)?util[_0x7739('0x41')](_0x7739('0x158'),_0x3a2186[_0x7739('0x43')],_0x3a2186['dialQueueOptions']||'',_0x3a2186[_0x7739('0xc6')]?'c':'',_0x3a2186[_0x7739('0xcd')]||0x3):_0x7739('0x156'),'XMD-CONTACTID':_0x583709[_0x7739('0xfb')],'XMD-CDRTYPE':_0x7739('0x159'),'CALLERID(all)':_0x33f511[_0x7739('0x20')][_0x2d6456][_0x7739('0x15a')](),'XMD-AMD':_0x3a2186['dialAMDActive']?_0x7739('0x13a'):'NONE','XMD-DESTINATION':_0x7739('0x15b')};if(_0x3a2186[_0x7739('0x10e')]){_0x541115['XMD-AMDINITIALSILENCE']=_0x3a2186[_0x7739('0x15c')]||0x9c4;_0x541115[_0x7739('0x15d')]=_0x3a2186[_0x7739('0x15e')]||0x5dc;_0x541115['XMD-AMDAFTERGREETINGSILENCE']=_0x3a2186[_0x7739('0x15f')]||0x320;_0x541115[_0x7739('0x160')]=_0x3a2186[_0x7739('0x161')]||0x1388;_0x541115['XMD-AMDMINWORDLENGTH']=_0x3a2186[_0x7739('0x162')]||0x64;_0x541115[_0x7739('0x163')]=_0x3a2186[_0x7739('0x164')]||0x32;_0x541115[_0x7739('0x165')]=_0x3a2186[_0x7739('0x166')]||0x3;_0x541115[_0x7739('0x167')]=_0x3a2186[_0x7739('0x168')]||0x100;_0x541115[_0x7739('0x169')]=_0x3a2186[_0x7739('0x16a')]||0x1388;}if(utils[_0x7739('0x157')](_0x3a2186)){_0x541115[_0x7739('0x16b')]=_0x583709[_0x7739('0xe9')];}else{_0x541115[_0x7739('0x16c')]=_0x583709[_0x7739('0xe0')];}var _0x4e82a7=utils['setXMDContactVariables'](_0x583709[_0x7739('0x16d')]);Object[_0x7739('0x16e')](_0x541115,_0x4e82a7);var _0x7c997=_0x33f511[_0x7739('0x8a')](_0x3a2186[_0x7739('0x16f')])?utils[_0x7739('0x170')](_0x3a2186[_0x7739('0x16f')][_0x7739('0x171')],_0x3a2186[_0x7739('0x172')],_0x3a2186[_0x7739('0x173')]>0x0?utils['getCallerIdRandom'](_0x3a2186[_0x7739('0x174')],_0x3a2186[_0x7739('0x173')]):_0x3a2186[_0x7739('0x174')]):utils['getCallerId'](_[_0x7739('0xf3')](_0x3a2186[_0x7739('0x175')])?_0x3a2186[_0x7739('0x16f')][_0x7739('0x171')]:_0x3a2186['TrunkBackup'][_0x7739('0x171')],_0x3a2186[_0x7739('0x172')],_0x3a2186[_0x7739('0x173')]>0x0?utils['getCallerIdRandom'](_0x3a2186[_0x7739('0x174')],_0x3a2186[_0x7739('0x173')]):_0x3a2186[_0x7739('0x174')]);if(_0x7c997){_0x541115[_0x7739('0x176')]=_0x33f511[_0x7739('0x20')][_0x2d6456]['originatecalleridname']=utils[_0x7739('0x177')](_0x7c997);_0x541115[_0x7739('0x178')]=_0x583709[_0x7739('0x179')];}_0x3a2186['variables']=_0x541115;return ami[_0x7739('0x97')]({'actionid':_0x2d6456,'action':_0x7739('0x153'),'channel':_0x33f511[_0x7739('0x8a')](_0x3a2186[_0x7739('0x16f')])?util[_0x7739('0x41')](_0x7739('0x17a'),_0x3a2186['Trunk'][_0x7739('0x43')],isNotNull(_0x3a2186[_0x7739('0x17b')])?_0x3a2186[_0x7739('0x17b')][_0x7739('0x17c')]()||'':'',_0x3a2186[_0x7739('0x17d')]>0x0?_0x583709[_0x7739('0x179')][_0x7739('0x17e')](_0x3a2186[_0x7739('0x17d')]):_0x583709[_0x7739('0x179')]):util[_0x7739('0x41')](_0x7739('0x17a'),_[_0x7739('0xf3')](_0x3a2186[_0x7739('0x175')])?_0x3a2186['Trunk']['name']:_0x3a2186[_0x7739('0x175')]['name'],isNotNull(_0x3a2186[_0x7739('0x17b')])?_0x3a2186['dialPrefix'][_0x7739('0x17c')]()||'':'',_0x3a2186[_0x7739('0x17d')]>0x0?_0x583709[_0x7739('0x179')][_0x7739('0x17e')](_0x3a2186[_0x7739('0x17d')]):_0x583709['phone']),'callerid':_0x7c997,'Exten':'xcally-motion-dialer','Context':_0x7739('0x17f'),'Priority':'1','variable':_0x541115,'timeout':(_0x3a2186[_0x7739('0x180')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2d6456})[_0x7739('0x39')](function(_0x3f99a2){return _0x424dbd(_0x3f99a2);})[_0x7739('0x9e')](function(_0x130432){_0x3a2186['outboundOriginateFailureCallsDay']+=0x1;var _0x26868f=new History(_0x33f511[_0x7739('0x20')][_0x2d6456]);logger['error'](util[_0x7739('0x41')](_0x7739('0x181'),JSON[_0x7739('0x71')](_0x130432)));_0x26868f[_0x7739('0x6a')]=0xe;_0x26868f[_0x7739('0x6b')]=_0x7739('0x182');_0x26868f[_0x7739('0x6d')]=moment()[_0x7739('0x41')](_0x7739('0xc7'));_0x26868f[_0x7739('0x6c')]=_0x26868f[_0x7739('0x6d')];hopperUtils[_0x7739('0xc8')](_0x26868f)[_0x7739('0x9e')](loggerCatch(_0x7739('0x183')));_0x33f511[_0x7739('0xca')](_0x26868f)['catch'](loggerCatch('[originate][error]'))[_0x7739('0x18')](function(){delete _0x33f511['actions'][_0x2d6456];return _0x2c2ffa(msgResponse(_0x7739('0x153'),_0x7739('0x83'),_0x7739('0x184')));});});});};Dialer['prototype'][_0x7739('0x185')]=function(_0x5a4393,_0x2d0ccb,_0x24dca2){var _0xde2570=new History(_0x2d0ccb);if(_0xde2570['countbusyretry']+_0xde2570[_0x7739('0x12a')]+_0xde2570[_0x7739('0x11d')]+_0xde2570[_0x7739('0x11e')]+_0xde2570[_0x7739('0xd4')]+_0xde2570[_0x7739('0xe5')]+_0xde2570[_0x7739('0x11a')]+_0xde2570[_0x7739('0x11f')]>=_0x24dca2[_0x7739('0x120')]-0x1){return!![];}switch(_0x5a4393){case 0x3:if(_0xde2570[_0x7739('0x11d')]>=_0x24dca2['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countnoanswerretry':_0xde2570['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2[_0x7739('0x186')],_0x7739('0xde'))[_0x7739('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570['VoiceQueueId']||undefined,'CampaignId':_0xde2570['CampaignId']||undefined})[_0x7739('0x9e')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xde2570[_0x7739('0x11c')]>=_0x24dca2[_0x7739('0x187')]-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countbusyretry':_0xde2570[_0x7739('0x11c')]+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2['dialBusyRetryFrequency'],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570['ContactId'],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570['VoiceQueueId']||undefined,'CampaignId':_0xde2570[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x188')));break;case 0x8:if(_0xde2570[_0x7739('0x12a')]>=_0x24dca2[_0x7739('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0xde2570[_0x7739('0x12a')]+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2[_0x7739('0x18a')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570[_0x7739('0xe9')]||undefined,'CampaignId':_0xde2570[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x18b')));break;case 0x0:if(_0xde2570[_0x7739('0x11e')]>=_0x24dca2[_0x7739('0x18c')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xde2570[_0x7739('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x24dca2['dialNoSuchNumberRetryFrequency'],_0x7739('0xde'))[_0x7739('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xde2570['ContactId'],'ListId':_0xde2570['ListId'],'VoiceQueueId':_0xde2570[_0x7739('0xe9')]||undefined,'CampaignId':_0xde2570['CampaignId']||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x18d')));}break;case 0xa:if(_0xde2570[_0x7739('0xd4')]>=_0x24dca2[_0x7739('0xda')]-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countdropretry':_0xde2570[_0x7739('0xd4')]+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2[_0x7739('0xd5')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570['VoiceQueueId']||undefined,'CampaignId':_0xde2570[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x18e')));break;case 0xb:if(_0xde2570[_0x7739('0xe5')]>=_0x24dca2[_0x7739('0xe8')]-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countabandonedretry':_0xde2570[_0x7739('0xe5')]+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2[_0x7739('0xe7')],'minutes')[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570['ListId'],'VoiceQueueId':_0xde2570[_0x7739('0xe9')]||undefined,'CampaignId':_0xde2570['CampaignId']||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0xea')));break;case 0x13:if(_0xde2570[_0x7739('0x11a')]>=_0x24dca2[_0x7739('0x123')]-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countmachineretry':_0xde2570[_0x7739('0x11a')]+=0x1,'scheduledat':moment()[_0x7739('0xdd')](_0x24dca2[_0x7739('0x125')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570[_0x7739('0xe9')]||undefined,'CampaignId':_0xde2570[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x12c')));break;case 0x14:if(_0xde2570[_0x7739('0x11f')]>=_0x24dca2[_0x7739('0x18f')]-0x1){return!![];}hopperUtils[_0x7739('0xdc')]({'active':![],'countagentrejectretry':_0xde2570[_0x7739('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x24dca2[_0x7739('0x190')],_0x7739('0xde'))[_0x7739('0x41')](_0x7739('0xc7')),'ContactId':_0xde2570[_0x7739('0xfb')],'ListId':_0xde2570[_0x7739('0xdf')],'VoiceQueueId':_0xde2570[_0x7739('0xe9')]||undefined,'CampaignId':_0xde2570[_0x7739('0xe0')]||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x191')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x15f93f,_0xd75549,_0x316226){var _0x3b421a=this;var _0x3a057f=new History(_0x15f93f);var _0x286812=![];var _0x1b3d66;var _0x402d2b;return new Promise(function(_0x5f060d,_0x1d9bd9){if(_[_0x7739('0x3a')](_0xd75549)&&typeof _0xd75549!==_0x7739('0x192')){return _0x1d9bd9(msgResponse(_0x7739('0x193'),'Failure',_0x7739('0x194')));}if(_[_0x7739('0x3a')](_0x316226)&&typeof _0x316226!==_0x7739('0x192')){return _0x1d9bd9(msgResponse('[callProgressDetecting]',_0x7739('0x90'),_0x7739('0x195')));}hopperUtils['verifyAdditionalPhones'](_0x3a057f,_0x316226[_0x7739('0xc2')],_0xd75549)[_0x7739('0x39')](function(_0x1eba02){if(_0x1eba02['additional']==0x1)_0x286812=!![];switch(_0x316226[_0x7739('0xc2')]){case'0':_0xd75549[_0x7739('0x196')]+=0x1;_0x3a057f[_0x7739('0x6a')]=0x0;_0x3a057f[_0x7739('0x6b')]='NoSuchNumber';_0x3a057f[_0x7739('0x11e')]+=0x1;_0x3a057f[_0x7739('0xe6')]+=0x1;ami[_0x7739('0x3b')]('custom:agentnosuchnumber',ut[_0x7739('0x114')](_0x15f93f,_0x7739('0x197')));_0x1b3d66=_0xd75549[_0x7739('0x198')];_0x402d2b=_0xd75549[_0x7739('0xd6')];hopperUtils['createHistory'](_0x3a057f)[_0x7739('0x9e')](loggerCatch(_0x7739('0x11b')));if(_0x3b421a[_0x7739('0x185')](0x0,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f[_0x7739('0x11e')]>=_0xd75549[_0x7739('0x18c')]){_0x3b421a['createStateFinal'](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x199'));}else{_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x199'));}}break;case'3':_0xd75549[_0x7739('0x19a')]+=0x1;_0x3a057f[_0x7739('0x6a')]=0x3;_0x3a057f[_0x7739('0x6b')]=_0x7739('0x19b');_0x3a057f[_0x7739('0x11d')]+=0x1;_0x3a057f['countglobal']+=0x1;var _0xfbf67a=ut[_0x7739('0x19c')](_0x15f93f,_0xd75549);ami[_0x7739('0x3b')](_0x7739('0x19d'),_0xfbf67a);_0x1b3d66=_0xd75549[_0x7739('0x186')];_0x402d2b=_0xd75549[_0x7739('0xd6')];hopperUtils[_0x7739('0xc8')](_0x3a057f)[_0x7739('0x9e')](loggerCatch(_0x7739('0x19e')));if(_0x3b421a['checkRetriveMax'](0x3,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f[_0x7739('0x11d')]>=_0xd75549['dialNoAnswerMaxRetry']){_0x3b421a[_0x7739('0x124')](_0x3a057f,_0x5f060d,_0x1d9bd9,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3b421a['stateGlobal'](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x19f'));}}break;case'5':_0xd75549[_0x7739('0x1a0')]+=0x1;_0x3a057f['state']=0x5;_0x3a057f['statedesc']=_0x7739('0x1a1');_0x3a057f['countbusyretry']+=0x1;_0x3a057f[_0x7739('0xe6')]+=0x1;ami[_0x7739('0x3b')]('custom:agentbusy',ut['buildObj'](_0x15f93f,_0x7739('0x1a2')));_0x1b3d66=_0xd75549['dialBusyRetryFrequency'];_0x402d2b=_0xd75549[_0x7739('0xd6')];hopperUtils[_0x7739('0xc8')](_0x3a057f)[_0x7739('0x9e')](loggerCatch(_0x7739('0x1a3')));if(_0x3b421a[_0x7739('0x185')](0x5,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f[_0x7739('0x11c')]>=_0xd75549[_0x7739('0x187')]){_0x3b421a[_0x7739('0x124')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x1a4'));}else{_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x1a4'));}}break;case'8':_0xd75549[_0x7739('0x1a5')]+=0x1;_0x3a057f[_0x7739('0x6a')]=0x8;_0x3a057f['statedesc']=_0x7739('0x1a6');_0x3a057f[_0x7739('0x12a')]+=0x1;_0x3a057f[_0x7739('0xe6')]+=0x1;_0x1b3d66=_0xd75549[_0x7739('0x18a')];_0x402d2b=_0xd75549[_0x7739('0xd6')];ami[_0x7739('0x3b')](_0x7739('0x1a7'),ut[_0x7739('0x114')](_0x15f93f,_0x7739('0x1a8')));hopperUtils[_0x7739('0xc8')](_0x3a057f)[_0x7739('0x9e')](loggerCatch(_0x7739('0x1a9')));if(_0x3b421a[_0x7739('0x185')](0x8,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f['countcongestionretry']>=_0xd75549[_0x7739('0x189')]){_0x3b421a[_0x7739('0x124')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x1aa'));}else{_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x1aa'));}}break;case'11':_0xd75549[_0x7739('0x1ab')]+=0x1;_0x3a057f[_0x7739('0x6a')]=0xb;_0x3a057f[_0x7739('0x6b')]=_0x7739('0xeb');_0x3a057f['countabandonedretry']+=0x1;_0x3a057f[_0x7739('0xe6')]+=0x1;_0x1b3d66=_0xd75549[_0x7739('0xe7')];_0x402d2b=_0xd75549[_0x7739('0xd6')];hopperUtils[_0x7739('0xc8')](_0x3a057f)[_0x7739('0x9e')](loggerCatch(_0x7739('0xec')));if(_0x3b421a[_0x7739('0x185')](0xb,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f['countabandonedretry']>=_0xd75549[_0x7739('0xe8')]){_0x3b421a['createStateFinal'](_0x3a057f,_0x5f060d,_0x1d9bd9,'reason\x2011\x20abandoned');}else{_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x7739('0x1ac'));}}break;case'20':_0xd75549[_0x7739('0x1ad')]+=0x1;_0x3a057f[_0x7739('0x6a')]=0x14;_0x3a057f[_0x7739('0x6b')]=_0x7739('0x1ae');_0x3a057f[_0x7739('0x11f')]+=0x1;_0x3a057f[_0x7739('0xe6')]+=0x1;_0x1b3d66=_0xd75549[_0x7739('0x190')];_0x402d2b=_0xd75549[_0x7739('0xd6')];ami[_0x7739('0x3b')](_0x7739('0x1af'),ut[_0x7739('0x114')](_0x15f93f,_0x7739('0x1b0')));hopperUtils[_0x7739('0xc8')](_0x3a057f)['catch'](loggerCatch(_0x7739('0x1b1')));if(_0x3b421a[_0x7739('0x185')](0x14,_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f[_0x7739('0x11f')]>=_0xd75549[_0x7739('0x18f')]){_0x3b421a[_0x7739('0x124')](_0x3a057f,_0x5f060d,_0x1d9bd9,'reason\x2020\x20agentreject');}else{_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,'reason\x2020\x20agentreject');}}break;default:_0xd75549['outboundUnknownCallsDay']+=0x1;_0x3a057f[_0x7739('0x6a')]=0xc;_0x3a057f[_0x7739('0x6b')]=_0x316226[_0x7739('0xc2')];_0x1b3d66=_0xd75549[_0x7739('0x190')];_0x402d2b=_0xd75549[_0x7739('0xd6')];hopperUtils[_0x7739('0xc8')](_0x3a057f)['catch'](loggerCatch(_0x7739('0x1b2')));if(_0x3b421a[_0x7739('0x185')](_0x316226[_0x7739('0xc2')],_0x15f93f,_0xd75549)&&!_0x286812){if(_0x3a057f['countbusyretry']+_0x3a057f['countcongestionretry']+_0x3a057f[_0x7739('0x11d')]+_0x3a057f['countnosuchnumberretry']+_0x3a057f[_0x7739('0xd4')]+_0x3a057f[_0x7739('0xe5')]+_0x3a057f[_0x7739('0x11a')]+_0x3a057f[_0x7739('0x11f')]>=_0xd75549['dialGlobalMaxRetry']){_0x3b421a[_0x7739('0x121')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x316226[_0x7739('0xc2')]);}else{_0x3b421a[_0x7739('0x124')](_0x3a057f,_0x5f060d,_0x1d9bd9,_0x316226[_0x7739('0xc2')]);}}}})[_0x7739('0x39')](function(){if(_0x286812){hopperUtils[_0x7739('0xed')](_0x3a057f,_0x1b3d66,_0x402d2b)[_0x7739('0x39')](function(){return _0x5f060d(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x1df83b,_0xd3adcd,_0x4e87df,_0xf72f43){var _0x14d305=new Final(_0x1df83b);_0x14d305[_0x7739('0x6a')]=0xf;_0x14d305[_0x7739('0x6b')]=_0x7739('0x1b3');this[_0x7739('0x124')](_0x14d305,_0xd3adcd,_0x4e87df,_0xf72f43);};Dialer[_0x7739('0x15')][_0x7739('0x124')]=function(_0x519279,_0x2f6afe,_0x266f40,_0xfaad42){hopperUtils[_0x7739('0xca')](_0x519279)[_0x7739('0x39')](function(){return _0x2f6afe(msgResponse(_0x7739('0x193'),_0x7739('0x10a'),_0xfaad42));})[_0x7739('0x9e')](function(){return _0x266f40(msgResponse('[moveContactManagedDialer][0]',_0x7739('0x90'),_0x7739('0x1b4')));});};Dialer[_0x7739('0x15')][_0x7739('0x8')]=function(_0x5b7c02){var _0x87c26d=_0x5b7c02[_0x7739('0x1b5')]/0x64;var _0x581b58=_0x5b7c02[_0x7739('0xcf')]/(_0x5b7c02[_0x7739('0xcf')]+_0x5b7c02[_0x7739('0xc1')]);var _0x1599eb=Math[_0x7739('0x1b6')](_0x5b7c02['predictiveIntervalAvailable']*(_0x5b7c02[_0x7739('0x1b7')]/0x64));var _0x35536f=Math[_0x7739('0x1b6')](_0x5b7c02['predictiveIntervalAvailable']*(_0x5b7c02[_0x7739('0x1b8')]/0x64));var _0x54399d=_0x5b7c02[_0x7739('0x1b9')]+_0x5b7c02['talking'];var _0x923a2a=Math[_0x7739('0x1ba')](_0x5b7c02['erlangCalls']*_0x5b7c02[_0x7739('0x5a')]*_0x5b7c02[_0x7739('0x1bb')]*_0x5b7c02['predictiveIntervalMultiplicativeFactor']);if(_[_0x7739('0x3a')](_0x5b7c02[_0x7739('0x24')])){if(!_['isUndefined'](_0x5b7c02[_0x7739('0x23')])){_0x5b7c02[_0x7739('0x23')]=undefined;loggerPredictive[_0x7739('0x61')]('[startMethodPredictive][StartProgressive]',_0x7739('0x1bc'));}if(!_[_0x7739('0x3a')](_0x5b7c02[_0x7739('0x5e')])){loggerPredictive[_0x7739('0x61')]('[startMethodPredictive][StartProgressive]',_0x7739('0x1bd'));clearInterval(_0x5b7c02[_0x7739('0x5e')]);_0x5b7c02['handlePredictive']=undefined;}_0x5b7c02[_0x7739('0x24')]=moment()[_0x7739('0x41')](_0x7739('0xc7'));loggerPredictive[_0x7739('0x46')](_0x5b7c02['name'],_0x7739('0x1be'),_0x5b7c02[_0x7739('0x24')]);this[_0x7739('0xad')](_0x5b7c02,0x1);}else if(ifInterval(_0x5b7c02[_0x7739('0x1bf')],_0x5b7c02[_0x7739('0x24')])){this[_0x7739('0xad')](_0x5b7c02,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x5b7c02['startProgressive'],_0x5b7c02['name']);_0x5b7c02['erlangCalls']=0x0;_0x5b7c02[_0x7739('0xd0')]=0x0;}else if(_0x87c26d<_0x581b58&&_0x5b7c02[_0x7739('0x1c0')]==='dropRate'){clearPredictiveAttributes(_0x5b7c02);loggerPredictive[_0x7739('0x46')](_0x7739('0x1c1'),_0x7739('0x1c2'),_0x581b58,'startProgressive',_0x5b7c02['name']);}else if(_0x923a2a<_0x5b7c02[_0x7739('0xd0')]&&_0x5b7c02[_0x7739('0x1c0')]===_0x7739('0x1c3')){clearPredictiveAttributes(_0x5b7c02);loggerPredictive[_0x7739('0x46')](_0x7739('0x1c4'),_0x7739('0x1c5'),_0x923a2a,'Drop\x20in\x20this\x20interval',_0x5b7c02[_0x7739('0xd0')],_0x7739('0x24'),_0x5b7c02[_0x7739('0x43')]);}else if(!ifInterval(_0x5b7c02[_0x7739('0x1bf')],_0x5b7c02['startProgressive'])&&_[_0x7739('0x3a')](_0x5b7c02[_0x7739('0x23')])&&!_[_0x7739('0x3a')](_0x5b7c02['startProgressive'])){_0x5b7c02['startPredictive']=moment()[_0x7739('0x41')](_0x7739('0xc7'));loggerPredictive[_0x7739('0x46')](_0x5b7c02[_0x7739('0x43')],_0x7739('0x1c6'),_0x5b7c02['startPredictive']);hopperUtils[_0x7739('0x1c7')](_0x5b7c02[_0x7739('0x1bf')])[_0x7739('0x39')](this[_0x7739('0x1c8')](_0x5b7c02))[_0x7739('0x39')](mergeDataErlangB(_0x5b7c02))[_0x7739('0x39')](this['startMethodPredictive'](_0x5b7c02))[_0x7739('0x9e')](loggerCatchPredictive(_0x7739('0x1c9'),_0x5b7c02));}else if(!ifInterval(_0x5b7c02[_0x7739('0x1bf')],_0x5b7c02[_0x7739('0x23')])){_0x5b7c02[_0x7739('0xd0')]=0x0;_0x5b7c02[_0x7739('0x23')]=moment()['format'](_0x7739('0xc7'));loggerPredictive['info'](_0x5b7c02['name'],_0x7739('0x1ca'),_0x5b7c02[_0x7739('0x23')]);clearInterval(_0x5b7c02[_0x7739('0x5e')]);_0x5b7c02[_0x7739('0x5e')]=undefined;hopperUtils[_0x7739('0x1c7')](_0x5b7c02[_0x7739('0x1bf')])[_0x7739('0x39')](this[_0x7739('0x1c8')](_0x5b7c02))[_0x7739('0x39')](mergeDataErlangB(_0x5b7c02))[_0x7739('0x39')](this[_0x7739('0x1cb')](_0x5b7c02))[_0x7739('0x9e')](loggerCatchPredictive(_0x7739('0x1cc'),_0x5b7c02));}else if(_0x5b7c02['predictiveIntervalAvailable']&&_0x54399d<_0x5b7c02[_0x7739('0x1cd')]-_0x35536f){clearPredictiveAttributes(_0x5b7c02);loggerPredictive[_0x7739('0x46')](_0x5b7c02['name'],_0x7739('0x1ce'),_0x54399d,_0x7739('0x1cf'),_0x5b7c02[_0x7739('0x1cd')],'-',_0x35536f,'=',_0x5b7c02[_0x7739('0x1cd')]-_0x35536f,')');}else if(_0x5b7c02[_0x7739('0x1cd')]&&_0x54399d>_0x5b7c02['predictiveIntervalAvailable']+_0x1599eb){clearPredictiveAttributes(_0x5b7c02);loggerPredictive[_0x7739('0x46')](_0x5b7c02[_0x7739('0x43')],_0x7739('0x1ce'),_0x54399d,_0x7739('0x1d0'),_0x5b7c02['predictiveIntervalAvailable'],'+',_0x1599eb,'=',_0x5b7c02['predictiveIntervalAvailable']+_0x1599eb,')');}};Dialer[_0x7739('0x15')][_0x7739('0x1c8')]=function(_0x314b46){var _0x45f169=this;return function(_0x25027b){return new Promise(function(_0xf9b1c0,_0x4a05a1){_[_0x7739('0x5c')](_0x314b46,_0x25027b[0x0]);if(checkGetDataPredictive(_0x25027b[0x0])){var _0x1f80dc=_0x314b46[_0x7739('0x1cd')]=_0x314b46['talking']+_0x314b46[_0x7739('0x1b9')];var _0xdd306e=_0x314b46[_0x7739('0x1bf')]*0x3c;var _0x92e282=_0x25027b[0x0]['predictiveIntervalAvgTalktime']+_0x25027b[0x0][_0x7739('0x4d')];var _0x57df10=(_0x25027b[0x0]['predictiveIntervalAnsweredCalls']+_0x25027b[0x0][_0x7739('0xce')]+_0x25027b[0x0][_0x7739('0x4b')])/_0x25027b[0x0][_0x7739('0x51')];_0x314b46[_0x7739('0x1bb')]=_0x57df10>0x0?_0x57df10:0x1;switch(_0x314b46[_0x7739('0x1c0')]){case'dropRate':var _0x29e344=_0x314b46['dialPredictiveOptimizationPercentage']/0x64;return _0x45f169['abandonmentRate'](_0x1f80dc,_0xdd306e,_0x92e282,_0x57df10,_0x29e344)[_0x7739('0x39')](function(_0x44de56){return _0xf9b1c0(_0x44de56);});case _0x7739('0x1d1'):var _0x7751ee=_0x314b46[_0x7739('0x1b5')]/0x64;return _0x45f169[_0x7739('0x1d2')](_0x1f80dc,_0xdd306e,_0x92e282,_0x57df10,_0x7751ee)[_0x7739('0x39')](function(_0x92c826){return _0xf9b1c0(_0x92c826);});default:return _0x4a05a1(msgResponse(_0x7739('0x1d3'),_0x7739('0x90'),'Unknown\x20Predictive'));}}else{return _0x4a05a1(msgResponse(_0x7739('0x1d3'),_0x7739('0x90'),_0x7739('0x1d4')));}});};};Dialer[_0x7739('0x15')]['getDataPredictiveOld']=function(_0x452f5f){var _0x202360=this;return function(_0x4ed925){return new Promise(function(_0x32ad19,_0x5271db){_[_0x7739('0x5c')](_0x452f5f,_0x4ed925[0x0]);if(checkGetDataPredictive(_0x4ed925[0x0])){loggerPredictive['info'](JSON[_0x7739('0x71')](_0x4ed925[0x0]));if(_0x452f5f['dialPredictiveOptimization']===_0x7739('0x1c3')){return _0x202360['getVoiceQueueRtPauses'](_0x452f5f['id'])['then'](function(_0x280adb){var _0x1833e9=_0x452f5f[_0x7739('0x1d5')]-_0x280adb[0x0]['outboundQueuePauses'];var _0x1d0722=_0x452f5f[_0x7739('0x1bf')]*0x3c;var _0x3e23e4=_0x4ed925[0x0]['predictiveIntervalAvgTalktime']+_0x4ed925[0x0][_0x7739('0x4d')];var _0x4032bb=(_0x4ed925[0x0][_0x7739('0x48')]+_0x4ed925[0x0][_0x7739('0xce')]+_0x4ed925[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4ed925[0x0][_0x7739('0x51')];var _0x38a677=_0x452f5f[_0x7739('0x1b5')]/0x64;_0x452f5f[_0x7739('0x1d6')]=_0x280adb[0x0][_0x7739('0x1d7')]||0x0;_0x452f5f[_0x7739('0x1bb')]=_0x4032bb>0x0?_0x4032bb:0x1;return _0x202360[_0x7739('0x1d8')](_0x1833e9,_0x1d0722,_0x3e23e4,_0x4032bb,_0x38a677);})[_0x7739('0x39')](function(_0x2ffc66){return _0x32ad19(_0x2ffc66);})[_0x7739('0x9e')](function(_0x2c8670){return _0x5271db(msgResponse(_0x7739('0x1d9'),_0x7739('0x90'),JSON[_0x7739('0x71')](_0x2c8670)));});}if(_0x452f5f[_0x7739('0x1c0')]==='agentBusyFactor'){return _0x202360[_0x7739('0x148')](_0x452f5f['id'])['then'](function(_0x420637){var _0x1092e8=_0x452f5f['loggedIn']-_0x420637[0x0][_0x7739('0x1d7')];var _0x4fc40c=_0x452f5f[_0x7739('0x1bf')]*0x3c;var _0x915880=_0x4ed925[0x0]['predictiveIntervalAvgTalktime']+_0x4ed925[0x0][_0x7739('0x4d')];var _0x24d4df=(_0x4ed925[0x0][_0x7739('0x48')]+_0x4ed925[0x0][_0x7739('0xce')]+_0x4ed925[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4ed925[0x0][_0x7739('0x51')];var _0x285c89=_0x452f5f[_0x7739('0x1b5')]/0x64;_0x452f5f['predictiveIntervalPauses']=_0x420637[0x0]['outboundQueuePauses']||0x0;_0x452f5f[_0x7739('0x1bb')]=_0x24d4df>0x0?_0x24d4df:0x1;return _0x202360[_0x7739('0x1d2')](_0x1092e8,_0x4fc40c,_0x915880,_0x24d4df,_0x285c89);})[_0x7739('0x39')](function(_0x25095e){return _0x32ad19(_0x25095e);})[_0x7739('0x9e')](function(_0x602271){return _0x5271db(msgResponse(_0x7739('0x1d9'),_0x7739('0x90'),JSON[_0x7739('0x71')](_0x602271)));});}}else{return _0x5271db(msgResponse(_0x7739('0x1d3'),_0x7739('0x90'),_0x7739('0x1d4')));}});};};Dialer['prototype'][_0x7739('0x1cb')]=function(_0x4ea56e){var _0x4b0eb5=this;return function(){var _0x1d4e0c=0x0;var _0x34e966=Math[_0x7739('0x1ba')](_0x4ea56e[_0x7739('0x59')]*0x3e8);if(_0x34e966>0x0){_0x34e966=_0x34e966<0x64?0x64:_0x34e966;loggerPredictive[_0x7739('0x46')](_0x4ea56e[_0x7739('0x43')],_0x7739('0x1da'),_0x34e966,_0x7739('0x1db'));_0x4ea56e[_0x7739('0x5e')]=setInterval(function(){_0x4b0eb5[_0x7739('0x5e')](_0x4ea56e);loggerPredictiveCalls[_0x7739('0x46')](_0x7739('0x1dc'),_0x1d4e0c+=0x1);},_0x34e966);}else{loggerPredictive['info'](_0x4ea56e[_0x7739('0x43')],_0x7739('0x1dd'));}};};Dialer['prototype'][_0x7739('0x1de')]=function(_0x5d914f,_0x47d2f2){var _0xcf2913=this;return function(_0x350a6d){if(_[_0x7739('0x77')](_0x350a6d)){if(_[_0x7739('0xf3')](_0x47d2f2[_0x7739('0x14c')])||!_0x47d2f2[_0x7739('0x1df')]){if(_0x5d914f[_0x7739('0xac')]===_0x7739('0x7')){_0x5d914f['queueStatusComplete']=_['isUndefined'](_0x5d914f[_0x7739('0x6e')])?!![]:_0x5d914f['queueStatusComplete'];var _0x3c2693=uuid['v4']();_0xcf2913[_0x7739('0x20')][_0x3c2693]=new Action(_0x5d914f,_0x47d2f2,_0x3c2693);loggerBooked['info'](_0x7739('0x1e0'),_0x3c2693,_0x7739('0x1e1'),JSON['stringify'](_0x5d914f[_0x7739('0x6e')]),_0x7739('0x1e2'),_0x5d914f[_0x7739('0x43')]);if(_0x5d914f[_0x7739('0x6e')]){_0x5d914f[_0x7739('0x6e')]=![];_0xcf2913[_0x7739('0xf7')][_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xbb')]]=[];ami[_0x7739('0x97')]({'actionid':_0x3c2693,'action':_0x7739('0x1e3'),'queue':_0x5d914f['name']})[_0x7739('0x9e')](function(){_0xcf2913[_0x7739('0xbf')](_0x5d914f);hopperUtils[_0x7739('0xdc')]({'active':![],'ContactId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xfb')],'ListId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xdf')],'VoiceQueueId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xe9')]||undefined,'CampaignId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xe0')]||undefined})['catch'](loggerCatch(_0x7739('0x1e4')));delete _0xcf2913[_0x7739('0x20')][_0x3c2693];});}else{loggerBooked[_0x7739('0x46')](_0x7739('0x1e5'),JSON[_0x7739('0x71')](_0x5d914f['queueStatusComplete']),'Queue:\x20',_0x5d914f['name']);_0xcf2913[_0x7739('0xbf')](_0x5d914f);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0xcf2913['actions'][_0x3c2693][_0x7739('0xfb')],'ListId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xdf')],'VoiceQueueId':_0xcf2913[_0x7739('0x20')][_0x3c2693][_0x7739('0xe9')]||undefined,'CampaignId':_0xcf2913['actions'][_0x3c2693]['CampaignId']||undefined})[_0x7739('0x9e')](loggerCatch(_0x7739('0x1e4')));delete _0xcf2913[_0x7739('0x20')][_0x3c2693];}}else{return _0xcf2913[_0x7739('0x151')](_0x5d914f,_0x47d2f2);}}else{if(utils[_0x7739('0xcc')](undefined,_0x47d2f2[_0x7739('0x1e6')])<_0x5d914f[_0x7739('0x1e7')]*0x3c){if(_0x47d2f2[_0x7739('0x143')]&&!_0x47d2f2[_0x7739('0x143')][_0x7739('0x1e8')]){_0xcf2913[_0x7739('0x1a')][_0x7739('0xf9')](_0x47d2f2['id'])[_0x7739('0x18')](function(){_0xcf2913[_0x7739('0xbf')](_0x5d914f);});}else{hopperUtils[_0x7739('0x1e9')]({'active':![]},_0x47d2f2['id'],0x1)[_0x7739('0x18')](function(){_0xcf2913['updateOriginated'](_0x5d914f);});}}else{_0x5d914f[_0x7739('0x1ea')]+=0x1;_0xcf2913[_0x7739('0xbf')](_0x5d914f);if(_0x5d914f[_0x7739('0x1eb')]){hopperUtils[_0x7739('0xdc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x47d2f2['ContactId'],'ListId':_0x47d2f2[_0x7739('0xdf')],'VoiceQueueId':_0x47d2f2['VoiceQueueId']||undefined,'CampaignId':_0x47d2f2[_0x7739('0xe0')]||undefined})['catch'](loggerCatch(_0x7739('0x1ec')));hopperUtils[_0x7739('0xc8')](createObjHistory(_0x5d914f,_0x47d2f2,utils[_0x7739('0x64')][_0x7739('0x1ed')],0x17,'RecallInQueue'))[_0x7739('0x9e')](loggerCatch(_0x7739('0x1ee')));}else{_0xcf2913[_0x7739('0x116')](createObjHistory(_0x5d914f,_0x47d2f2,utils[_0x7739('0x64')][_0x7739('0x1ef')],0x16,_0x7739('0x1f0')),_0x7739('0x1f1'),'[Originate][HistoryRecallClose]');}}}}else{_0x5d914f[_0x7739('0x1f2')]+=0x1;_0xcf2913[_0x7739('0x116')](createObjHistory(_0x5d914f,_0x47d2f2,utils[_0x7739('0x64')][_0x7739('0x1f3')],0xd,_0x7739('0x1f4')),_0x7739('0x1f5'),'[Originate][MoveBlacklist]');throw _0x7739('0x1f6');}};};Dialer[_0x7739('0x15')]['handleIvr']=function(_0x573d61){var _0xba5c97=this;var _0x3b8026=_0x573d61[_0x7739('0x1f7')]-_0x573d61['originated'];emitCampaignSummary(_0x573d61);if(_0x3b8026>0x0&&_0x573d61[_0x7739('0x1f8')]==0x0){if(_0x3b8026>this[_0x7739('0x1e')]){_0x3b8026=this['maxNumberOriginate'];}_0x573d61[_0x7739('0x1f8')]=0x1;hopperUtils['getContactDialerIvr'](_0x573d61,_0x3b8026)[_0x7739('0x39')](function(_0x17a499){_0x573d61['temp']=0x0;if(_0x17a499){if(!utils['checkContactEmpty'](_0x17a499)){_0x573d61[_0x7739('0x67')]=utils[_0x7739('0x64')][_0x7739('0x68')];logger['info']('[getContactCampaign2][Empty]'+_0x573d61[_0x7739('0x43')]);}else{_0x573d61['originated']+=_0x17a499[_0x7739('0x95')];_0x573d61[_0x7739('0x67')]=utils['CAMPAIGN_STATUS'][_0x7739('0x1f9')];for(var _0x48fe0b=0x0;_0x48fe0b<_0x17a499[_0x7739('0x95')];_0x48fe0b+=0x1){_0x573d61[_0x7739('0x1fa')]+=0x1;if(_['isNil'](_0x17a499[_0x48fe0b])||_[_0x7739('0xf3')](_0x17a499[_0x48fe0b]['Contact'])||_[_0x7739('0xf3')](_0x17a499[_0x48fe0b][_0x7739('0x179')])){_0xba5c97[_0x7739('0x1fb')]('[actionOriginate]\x20',_0x573d61,_0x17a499[_0x48fe0b]);}else{hopperUtils[_0x7739('0x1fc')](_['pick'](_0x17a499[_0x48fe0b],['CampaignId',_0x7739('0x179')]))[_0x7739('0x39')](_0xba5c97['checkContactBlack'](_0x573d61,_0x17a499[_0x48fe0b]))[_0x7739('0x9e')](_0xba5c97[_0x7739('0x14a')](_0x7739('0x1fd'),_0x573d61));}}}}})[_0x7739('0x9e')](loggerGetContactDialer(_0x7739('0x1fe'),_0x573d61,_0x3b8026));}};Dialer[_0x7739('0x15')][_0x7739('0xad')]=function(_0x259bd,_0x48c856){var _0x40ed2a=this;var _0x474d1b=[];if(_0x48c856<0x1||_0x259bd[_0x7739('0xac')]==='booked'){_0x48c856=0x1;}var _0x4245aa=Math[_0x7739('0x1ba')](_0x259bd[_0x7739('0x1b9')]*_0x48c856)-_0x259bd[_0x7739('0x7e')];if(_0x259bd[_0x7739('0x1ff')]>0x0){var _0x4c7ca=_0x259bd[_0x7739('0x1ff')]-_0x259bd[_0x7739('0x7e')]-_0x259bd[_0x7739('0x200')]-_0x259bd[_0x7739('0x139')];if(_0x4245aa>_0x4c7ca){_0x4245aa=_0x4c7ca;}}if(_0x4245aa>0x0&&_0x259bd[_0x7739('0x1f8')]==0x0){if(_0x259bd[_0x7739('0xac')]===_0x7739('0x7')){_0x4245aa=0x1;}if(_0x4245aa>this[_0x7739('0x1e')]){_0x4245aa=this[_0x7739('0x1e')];}for(var _0x4f03ee in this[_0x7739('0x1c')]){if(typeof this[_0x7739('0x1c')][_0x4f03ee]!=='undefined'){if(this[_0x7739('0x1c')][_0x4f03ee]['state']===_0x7739('0x201')&&this['agents'][_0x4f03ee]['status']===_0x7739('0x87')){_0x474d1b[_0x7739('0x96')](this[_0x7739('0x1c')][_0x4f03ee]['id']);}}}_0x259bd[_0x7739('0x1f8')]=0x1;hopperUtils['getContactDialer'](_0x259bd,_0x474d1b,_0x4245aa)[_0x7739('0x39')](function(_0x11e3e1){_0x259bd[_0x7739('0x1f8')]=0x0;if(_0x11e3e1){if(!utils[_0x7739('0x202')](_0x11e3e1)){hopperUtils[_0x7739('0x203')](_0x259bd)[_0x7739('0x39')](sendMessageReschedule(_0x259bd))[_0x7739('0x9e')](loggerCatch('[countReScheduled]\x20'));}else{_0x259bd[_0x7739('0x7e')]+=_0x11e3e1[_0x7739('0x95')];_0x259bd['message']=_0x259bd['dialMethod']===_0x7739('0x7')?utils[_0x7739('0x64')][_0x7739('0x13a')]:utils['CAMPAIGN_STATUS'][_0x7739('0x1f9')];for(var _0x462736=0x0;_0x462736<_0x11e3e1[_0x7739('0x95')];_0x462736+=0x1){if(_[_0x7739('0xf3')](_0x11e3e1[_0x462736])||_['isNil'](_0x11e3e1[_0x462736][_0x7739('0x16d')])||_[_0x7739('0xf3')](_0x11e3e1[_0x462736][_0x7739('0x179')])){_0x40ed2a[_0x7739('0x1fb')]('[actionOriginate]\x20',_0x259bd,_0x11e3e1[_0x462736]);}else{hopperUtils[_0x7739('0x204')](_['pick'](_0x11e3e1[_0x462736],[_0x7739('0xe9'),_0x7739('0x179')]))[_0x7739('0x39')](_0x40ed2a['checkContactBlack'](_0x259bd,_0x11e3e1[_0x462736]))['catch'](_0x40ed2a[_0x7739('0x14a')](_0x7739('0x205'),_0x259bd));}}}}})[_0x7739('0x9e')](loggerGetContactDialer(_0x7739('0x206'),_0x259bd,_0x4245aa));}};Dialer[_0x7739('0x15')]['handlePredictive']=function(_0x4f85c5){if(_0x4f85c5[_0x7739('0x1ff')]>0x0){var _0x53de7b=_0x4f85c5[_0x7739('0x1ff')]-_0x4f85c5[_0x7739('0x7e')]-_0x4f85c5['talking'];if(_0x53de7b>0x0&&_0x4f85c5['temp']==0x0){this[_0x7739('0x207')](_0x4f85c5);}else{loggerPredictiveCalls[_0x7739('0x46')](_0x7739('0x208'));}}else{this[_0x7739('0x207')](_0x4f85c5);}};Dialer[_0x7739('0x15')]['tryOriginatePredictive']=function(_0x12f266){var _0x4207a0=this;var _0x2920ca=[];_0x12f266[_0x7739('0x7e')]+=0x1;for(var _0x3ab1a2 in this[_0x7739('0x1c')]){if(typeof this[_0x7739('0x1c')][_0x3ab1a2]!==_0x7739('0xa6')){if(this[_0x7739('0x1c')][_0x3ab1a2][_0x7739('0x6a')]===_0x7739('0x201')&&this[_0x7739('0x1c')][_0x3ab1a2]['status']===_0x7739('0x87')){_0x2920ca[_0x7739('0x96')](this[_0x7739('0x1c')][_0x3ab1a2]['id']);}}}_0x12f266[_0x7739('0x1f8')]=0x1;return this['getContactDialer'](_0x12f266['id'],_0x2920ca,0x1,_0x12f266[_0x7739('0x209')],_0x12f266)[_0x7739('0x39')](function(_0x3c1602){_0x12f266[_0x7739('0x1f8')]=0x1;if(_0x3c1602){if(!utils[_0x7739('0x202')](_0x3c1602)){utils[_0x7739('0x62')](_0x12f266,0x1,0x0);return hopperUtils['countReScheduled'](_0x12f266)[_0x7739('0x39')](sendMessageReschedule(_0x12f266))[_0x7739('0x9e')](loggerCatch(_0x7739('0x20a')));}else{_0x12f266[_0x7739('0x67')]=utils[_0x7739('0x64')]['RUNNING'];if(_[_0x7739('0xf3')](_0x3c1602[0x0])||_[_0x7739('0xf3')](_0x3c1602[0x0][_0x7739('0x16d')])||_['isNil'](_0x3c1602[0x0][_0x7739('0x179')])){_0x4207a0[_0x7739('0x1fb')](_0x7739('0x205'),_0x12f266,_0x3c1602[0x0]);}else{return hopperUtils[_0x7739('0x204')](_[_0x7739('0x72')](_0x3c1602[0x0],[_0x7739('0xe9'),_0x7739('0x179')]))['then'](_0x4207a0[_0x7739('0x1de')](_0x12f266,_0x3c1602[0x0]))[_0x7739('0x9e')](_0x4207a0[_0x7739('0x14a')](_0x7739('0x20b'),_0x12f266));}}}})[_0x7739('0x9e')](loggerGetContactDialer(_0x7739('0x20c'),_0x12f266,0x1));};Dialer[_0x7739('0x15')][_0x7739('0x1d8')]=function(_0x591073,_0x33741a,_0xefa74e,_0x177917,_0x41ca21,_0x30f8cb){loggerPredictive[_0x7739('0x46')](_0x7739('0x20d'));loggerPredictive[_0x7739('0x46')]('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',_0x591073);loggerPredictive[_0x7739('0x46')](_0x7739('0x20e'),_0x33741a);loggerPredictive[_0x7739('0x46')](_0x7739('0x20f'),_0xefa74e);loggerPredictive[_0x7739('0x46')](_0x7739('0x210'),_0x177917);loggerPredictive[_0x7739('0x46')](_0x7739('0x211'),_0x41ca21);loggerPredictive[_0x7739('0x46')](_0x7739('0x50'));return new Promise(function(_0x37082b,_0x4cbb4e){if(_0x591073<=0x0||isNaN(_0x591073)){return _0x4cbb4e(msgResponse('[abandonmentRate]',_0x7739('0x83'),_0x7739('0x212')+_0x591073));}if(_0xefa74e<=0x0||isNaN(_0xefa74e)){return _0x4cbb4e(msgResponse(_0x7739('0x213'),_0x7739('0x83'),_0x7739('0x214')+_0xefa74e));}if(_0x177917<=0x0||isNaN(_0x177917)){return _0x4cbb4e(msgResponse(_0x7739('0x213'),_0x7739('0x83'),_0x7739('0x215')+_0x177917));}if(_0x33741a<=0x0||isNaN(_0x33741a)){return _0x4cbb4e(msgResponse(_0x7739('0x213'),'Error',_0x7739('0x216')+_0x33741a));}if(_0x41ca21<=0x0||isNaN(_0x41ca21)){return _0x4cbb4e(msgResponse('[abandonmentRate]',_0x7739('0x83'),_0x7739('0x217')+_0x41ca21));}_0x30f8cb=_0x30f8cb||0x0;var _0x3aefd9=0x1/_0xefa74e;var _0x20526f=0x0;var _0xc9c005=0x0;var _0x3a401c=0x0;var _0x2105c0=0x0;for(var _0xbf99c1=0x0;_0x3a401c<_0x41ca21;_0xbf99c1+=0x1){_0xc9c005=_0xbf99c1/_0x33741a;_0x20526f=(_0x177917*_0xc9c005+_0x30f8cb)/_0x3aefd9;_0x3a401c=utils[_0x7739('0x218')](_0x20526f,_0x591073);_0x2105c0=_0x20526f/_0x591073*(0x1-utils[_0x7739('0x218')](_0x20526f,_0x591073));}return _0x37082b({'erlangCalls':_0xbf99c1,'erlangCallToSecond':_0x33741a/_0xbf99c1,'erlangAbandonmentRate':_0x3a401c,'erlangBusyFactor':_0x2105c0});});};Dialer['prototype']['busyFactor']=function(_0x201035,_0x3ac32f,_0x3b28c3,_0xbaa37d,_0x4309a6,_0x2e6676){loggerPredictive['info'](_0x7739('0x219'));loggerPredictive[_0x7739('0x46')](_0x7739('0x21a'),_0x201035);loggerPredictive[_0x7739('0x46')](_0x7739('0x20e'),_0x3ac32f);loggerPredictive['info'](_0x7739('0x20f'),_0x3b28c3);loggerPredictive[_0x7739('0x46')](_0x7739('0x210'),_0xbaa37d);loggerPredictive[_0x7739('0x46')](_0x7739('0x21b'),_0x4309a6);loggerPredictive[_0x7739('0x46')](_0x7739('0x50'));return new Promise(function(_0x57ba7c,_0x4e8ae9){if(_0x201035<=0x0||isNaN(_0x201035)){return _0x4e8ae9(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x201035));}if(_0x3b28c3<=0x0||isNaN(_0x3b28c3)){return _0x4e8ae9(msgResponse(_0x7739('0x21c'),_0x7739('0x83'),_0x7739('0x214')+_0x3b28c3));}if(_0xbaa37d<=0x0||isNaN(_0xbaa37d)){return _0x4e8ae9(msgResponse(_0x7739('0x21c'),_0x7739('0x83'),_0x7739('0x215')+_0xbaa37d));}if(_0x3ac32f<=0x0||isNaN(_0x3ac32f)){return _0x4e8ae9(msgResponse('[busyFactor]',_0x7739('0x83'),_0x7739('0x216')+_0x3ac32f));}if(_0x4309a6<=0x0||isNaN(_0x4309a6)){return _0x4e8ae9(msgResponse(_0x7739('0x21c'),'Error','Umin\x20=\x20'+_0x4309a6));}_0x2e6676=_0x2e6676||0x0;var _0xbf1b93=0x1/_0x3b28c3;var _0x503847=0x0;var _0x1f4541=0x0;var _0x24a5ed=0x0;var _0x3786ae=0x0;for(var _0x4bd0ec=0x0;_0x3786ae<_0x4309a6;_0x4bd0ec+=0x1){_0x1f4541=_0x4bd0ec/_0x3ac32f;_0x503847=(_0xbaa37d*_0x1f4541+_0x2e6676)/_0xbf1b93;_0x24a5ed=utils[_0x7739('0x218')](_0x503847,_0x201035);_0x3786ae=_0x503847/_0x201035*(0x1-utils[_0x7739('0x218')](_0x503847,_0x201035));}return _0x57ba7c({'erlangCalls':_0x4bd0ec,'erlangCallToSecond':_0x3ac32f/_0x4bd0ec,'erlangAbandonmentRate':_0x24a5ed,'erlangBusyFactor':_0x3786ae});});};module[_0x7739('0x21d')]=Dialer; \ No newline at end of file +var _0x9598=['checkIfTime','ifTimeIvr','checkIfTimeIntervals','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','timezones','content','true','catch','then','indexOf','all','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','ifTime','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','predictive','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','syncQueueCallerAbandon','ivr','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','ListId','VoiceQueueId','channel','actionid','strategy','rrmemory','locked','paused','stateinterface','isNil','idHopper','syncQueueStatusComplete','roundrobin','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','variable','amdstatus','exten','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','dialAMDActive','countmachineretry','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countglobal','[syncAgentComplete][createHistory][0]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','talking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','[uniqueid]','clearZombieChannels','[actions]','undefined','[Dialer][checkChannel]','getVoiceQueueRtPauses','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:dialPreviewRecallReminder','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','TrunkBackup','substring','from-sip','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialMachineMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','emptyContact','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','exports','util','lodash','uuid','moment','./utils/hopper','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','info','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','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','predictiveIntervalTotalCalls','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','message','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INACTIVE','\x20NOT\x20Active','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','\x20trunk\x20is\x20not\x20reachable'];(function(_0x13d387,_0x155111){var _0x426dd4=function(_0x2d2014){while(--_0x2d2014){_0x13d387['push'](_0x13d387['shift']());}};_0x426dd4(++_0x155111);}(_0x9598,0x186));var _0x8959=function(_0x2a5c01,_0x1d4a70){_0x2a5c01=_0x2a5c01-0x0;var _0xa07bf0=_0x9598[_0x2a5c01];return _0xa07bf0;};'use strict';var util=require(_0x8959('0x0'));var _=require(_0x8959('0x1'));var uuid=require(_0x8959('0x2'));var moment=require(_0x8959('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require(_0x8959('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x8959('0x5'))(_0x8959('0x6'));var loggerBooked=require(_0x8959('0x5'))(_0x8959('0x7'));var loggerPredictive=require(_0x8959('0x5'))('predictive');var loggerPredictiveCalls=require(_0x8959('0x5'))(_0x8959('0x8'));var loggerSyncQueueSummary=require(_0x8959('0x5'))(_0x8959('0x9'));var ami=require(_0x8959('0xa'));config['redis']=_[_0x8959('0xb')](config[_0x8959('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x8959('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x8959('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x8959('0xf'));var Interval=require(_0x8959('0x10'));var Action=require(_0x8959('0x11'));var History=require(_0x8959('0x12'));var Final=require(_0x8959('0x13'));var AgentComplete=require(_0x8959('0x14'));var QueueCallerAbandon=require(_0x8959('0x15'));var Hangup=require(_0x8959('0x16'));var ipAgi=process[_0x8959('0x17')][_0x8959('0x18')]||_0x8959('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8959('0x1a')][_0x8959('0x1b')]=function(_0x584594){this['tail']=this['tail']?this[_0x8959('0x1c')][_0x8959('0x1d')](_0x584594):_0x584594();};function Dialer(_0x172f73,_0x48731b){this[_0x8959('0x1e')]=new Sequence();this[_0x8959('0x1f')]=_0x48731b;this[_0x8959('0x20')]=_0x172f73['voiceQueues'];this[_0x8959('0x21')]=_0x172f73[_0x8959('0x21')];this[_0x8959('0x22')]=_0x172f73['agents'];this[_0x8959('0x23')]=_0x172f73[_0x8959('0x23')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x8959('0x24')]={};this[_0x8959('0x25')]={};this[_0x8959('0x26')]={};this[_0x8959('0x27')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x8959('0x28')]={};this[_0x8959('0x29')]={};this[_0x8959('0x2a')]={};this['queueBookedRR']={};this[_0x8959('0x2b')]={};ami['on'](_0x8959('0x2c'),this[_0x8959('0x2d')][_0x8959('0x2e')](this));ami['on'](_0x8959('0x2f'),this['syncQueueCallerAbandon'][_0x8959('0x2e')](this));ami['on'](_0x8959('0x30'),this['syncOriginateResponse'][_0x8959('0x2e')](this));ami['on'](_0x8959('0x31'),this['syncAgentComplete'][_0x8959('0x2e')](this));ami['on'](_0x8959('0x32'),this[_0x8959('0x9')][_0x8959('0x2e')](this));ami['on'](_0x8959('0x33'),this[_0x8959('0x34')][_0x8959('0x2e')](this));ami['on'](_0x8959('0x35'),this[_0x8959('0x36')][_0x8959('0x2e')](this));ami['on'](_0x8959('0x37'),this[_0x8959('0x38')]['bind'](this));ami['on'](_0x8959('0x39'),this[_0x8959('0x3a')][_0x8959('0x2e')](this));ami['on']('queuemember',this[_0x8959('0x3b')][_0x8959('0x2e')](this));ami['on'](_0x8959('0x3c'),this['syncQueueStatusComplete']['bind'](this));this[_0x8959('0x3d')]();this[_0x8959('0x3e')]();RpcSetting[_0x8959('0x3f')]()['then'](function(_0x4700f2){previewRecallmeReminderInterval=_0x4700f2[_0x8959('0x40')];});}function isNotNull(_0x3b4419){return _0x3b4419!==null&&!_[_0x8959('0x41')](_0x3b4419);}function msgResponse(_0x2bbc73,_0x176141,_0x2b42c7){return{'action':_0x2bbc73,'response':_0x176141,'message':_0x2b42c7,'stack':_0x2b42c7};}function emit(_0xc8d702,_0x5c9248,_0x42cc5a){io['to'](_0xc8d702)[_0x8959('0x42')](_0x5c9248,_0x42cc5a);}function emitOutboundVoiceQueueSummary(_0x53f2f5){if(_0x53f2f5[_0x8959('0x43')]===_0x8959('0x44')){logger[_0x8959('0x45')](_0x8959('0x46'),util[_0x8959('0x47')](_0x53f2f5,{'showHidden':![],'depth':null}));emit(util['format'](_0x8959('0x48'),_0x53f2f5[_0x8959('0x49')]),_0x8959('0x4a'),_0x53f2f5);}}function checkGetDataPredictive(_0xfb1f8){if(isNotNull(_0xfb1f8)&&!_['isEmpty'](_0xfb1f8)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x8959('0x4b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfb1f8['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfb1f8[_0x8959('0x4c')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x4d'),_0xfb1f8[_0x8959('0x4e')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x4f'),_0xfb1f8['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x8959('0x4b')](_0x8959('0x50'),_0xfb1f8[_0x8959('0x51')]);loggerPredictive['info'](_0x8959('0x52'),_0xfb1f8[_0x8959('0x53')]);loggerPredictive[_0x8959('0x4b')]('---------------------------');if(_0xfb1f8[_0x8959('0x54')]>0x0){if(!_[_0x8959('0x41')](_0xfb1f8['predictiveIntervalAvgTalktime'])&&_0xfb1f8[_0x8959('0x53')]>0x0){return!![];}loggerPredictive[_0x8959('0x4b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x8959('0x41')](_0xfb1f8[_0x8959('0x51')])&&_0xfb1f8[_0x8959('0x51')]>0x0){return!![];}loggerPredictive['info'](_0x8959('0x55'));}else{loggerPredictive[_0x8959('0x4b')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x8959('0x4b')](_0x8959('0x56'));}return![];}function mergeDataErlangB(_0x3856eb){return function(_0x1e29ca){loggerPredictive[_0x8959('0x4b')](_0x8959('0x57'));loggerPredictive[_0x8959('0x4b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e29ca[_0x8959('0x58')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x59'),_0x1e29ca[_0x8959('0x5a')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5b'),_0x1e29ca[_0x8959('0x5c')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5d'),_0x1e29ca['erlangBusyFactor']);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5b'),_0x1e29ca[_0x8959('0x5c')]);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5e'));_[_0x8959('0x5f')](_0x3856eb,_0x1e29ca);};}function ifInterval(_0x1cb35e,_0x545577){if(_[_0x8959('0x41')](_0x545577)){return![];}return utils[_0x8959('0x60')](undefined,_0x545577)<_0x1cb35e*0x3c;}function clearPredictiveAttributes(_0x577586){if(_0x577586[_0x8959('0x28')]){_0x577586[_0x8959('0x28')]=undefined;loggerPredictive[_0x8959('0x45')](_0x577586['name'],'startProgressive\x20value\x20cleared');}if(_0x577586[_0x8959('0x61')]){_0x577586['startPredictive']=undefined;loggerPredictive[_0x8959('0x45')](_0x577586[_0x8959('0x49')],'startPredictive\x20value\x20cleared');}if(_0x577586[_0x8959('0x62')]){clearInterval(_0x577586['handlePredictive']);_0x577586[_0x8959('0x62')]=undefined;loggerPredictive[_0x8959('0x45')](_0x577586[_0x8959('0x49')],_0x8959('0x63'));}}function loggerCatchPredictive(_0x55bbdb,_0x1c606e){return function(_0x14cfa5){loggerPredictive['error'](_0x1c606e['name'],_0x55bbdb);loggerPredictive['error'](_0x14cfa5['stack']);clearPredictiveAttributes(_0x1c606e);};}function loggerCatch(_0x286225){return function(_0x62d1a0){logger[_0x8959('0x64')](_0x286225,util[_0x8959('0x47')](_0x62d1a0,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x345477,_0x21b998,_0x1ffcab){return function(_0x4855c8){utils[_0x8959('0x65')](_0x21b998,_0x1ffcab,0x0);logger[_0x8959('0x64')](_0x345477,util['inspect'](_0x4855c8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x38bb91){return function(_0x3168bb){if(isNotNull(_0x3168bb)&&isNotNull(_0x3168bb[0x0])){if(_0x3168bb[0x0]['contactsRescheduled']>0x0){_0x38bb91[_0x8959('0x66')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x8959('0x4b')](_0x8959('0x67')+_0x38bb91[_0x8959('0x49')],_0x3168bb[0x0][_0x8959('0x68')],_0x8959('0x69'));}else{_0x38bb91[_0x8959('0x66')]=utils[_0x8959('0x6a')][_0x8959('0x6b')];logger[_0x8959('0x4b')](_0x8959('0x6c')+_0x38bb91[_0x8959('0x49')]);}}};}function createObjHistory(_0x46c04c,_0x7497bc,_0x43e5bb,_0x5e3df0,_0x28c30d){_0x46c04c[_0x8959('0x66')]=_0x43e5bb;var _0x29c9dc=new Action(_0x46c04c,_0x7497bc);var _0x259d23=new History(_0x29c9dc);_0x259d23[_0x8959('0x6d')]=_0x5e3df0;_0x259d23[_0x8959('0x6e')]=_0x28c30d;_0x259d23[_0x8959('0x6f')]=_0x29c9dc[_0x8959('0x70')];return _0x259d23;}function unlockQueueStatus(_0x2a0fc1,_0x5bde9d){setTimeout(function(){if(_[_0x8959('0x41')](_0x2a0fc1['queueStatusComplete'])){loggerBooked[_0x8959('0x64')]('[unlockQueueStatus][undefined]',_0x5bde9d);}_0x2a0fc1[_0x8959('0x71')]=!![];loggerBooked[_0x8959('0x4b')](_0x8959('0x72'),_0x5bde9d,JSON[_0x8959('0x73')](_[_0x8959('0x74')](_0x2a0fc1,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x1f494b){return function(){if(!isNotNull(_0x1f494b[_0x8959('0x75')])){_0x1f494b['message']=utils[_0x8959('0x6a')][_0x8959('0x76')];throw _0x1f494b[_0x8959('0x49')]+_0x8959('0x77');}if(!isNotNull(_0x1f494b['Interval'][_0x8959('0x78')])){_0x1f494b[_0x8959('0x66')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x1f494b['name']+_0x8959('0x77');}if(!isNotNull(_[_0x8959('0x79')](_0x1f494b[_0x8959('0x75')][_0x8959('0x78')]))){_0x1f494b['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x1f494b[_0x8959('0x49')]+_0x8959('0x77');}};}function checkIsIVRCampaignActive(_0x1713eb){return function(){if(!utils['isIVRCampaignActive'](_0x1713eb)){_0x1713eb[_0x8959('0x66')]=utils['CAMPAIGN_STATUS'][_0x8959('0x7a')];throw _0x1713eb[_0x8959('0x49')]+_0x8959('0x7b');}};}function emitCampaignSummary(_0x43f2d1){if(utils['isIVRCampaign'](_0x43f2d1)){emit(util[_0x8959('0x7c')](_0x8959('0x7d'),_0x43f2d1[_0x8959('0x49')]),_0x8959('0x7e'),_0x43f2d1);}}function loggerCatchQueueSummary(_0x64ed74,_0x806c44){return function(_0x2bd975){clearPredictiveAttributes(_0x806c44);emitCampaignSummary(_0x806c44);loggerSyncQueueSummary[_0x8959('0x45')](_0x64ed74,util[_0x8959('0x47')](_0x2bd975,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x16d35b){if(_0x16d35b[_0x8959('0x7f')]){if(_0x16d35b[_0x8959('0x80')]===0x0){_0x16d35b['sendMessageOneNotActive']=![];_0x16d35b['message']=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary[_0x8959('0x45')](_0x8959('0x81'),_0x16d35b[_0x8959('0x49')],_0x8959('0x82'));}else{_0x16d35b[_0x8959('0x66')]=utils[_0x8959('0x6a')]['DISACTIVED'];loggerSyncQueueSummary[_0x8959('0x45')](_0x8959('0x81'),_0x16d35b[_0x8959('0x49')],'is\x20disactive');}emitCampaignSummary(_0x16d35b);}}function myreject(_0x358e50){return function(_0x45f6e7){return _0x358e50(msgResponse(_0x8959('0x83'),_0x8959('0x84'),JSON[_0x8959('0x73')](_0x45f6e7)));};}Dialer[_0x8959('0x1a')][_0x8959('0x85')]=function(_0x3d8eb8){return!_[_0x8959('0x41')](_0x3d8eb8)&&_0x3d8eb8&&!_[_0x8959('0x41')](_0x3d8eb8[_0x8959('0x49')])&&!_[_0x8959('0x41')](_0x3d8eb8[_0x8959('0x86')])&&_0x3d8eb8['active']&&(this[_0x8959('0x23')][util[_0x8959('0x7c')](_0x8959('0x87'),_0x3d8eb8['name'])]['status']===_0x8959('0x88')||this[_0x8959('0x23')][util[_0x8959('0x7c')]('SIP/%s',_0x3d8eb8[_0x8959('0x49')])][_0x8959('0x89')]===_0x8959('0x8a'));};Dialer[_0x8959('0x1a')][_0x8959('0x8b')]=function(_0x1c1b3e){var _0x15abce=this;return function(){if(!_0x15abce[_0x8959('0x85')](_0x1c1b3e[_0x8959('0x8c')])){if(!_0x15abce['isTrunkReachable'](_0x1c1b3e['TrunkBackup'])){_0x1c1b3e[_0x8959('0x66')]=utils[_0x8959('0x6a')]['TRUNK_NOT_REACHABLE'];throw _0x1c1b3e['name']+_0x8959('0x8d');}}};};Dialer['prototype'][_0x8959('0x8e')]=function(_0x557504,_0x2b0793,_0x34652d,_0x12de9d){var _0x1e4520=this;return function(){var _0x2164ca=!![];return _0x1e4520[_0x8959('0x8f')](_0x557504,_0x2b0793,_0x34652d,_0x12de9d,_0x2164ca);};};Dialer[_0x8959('0x1a')][_0x8959('0x90')]=function(_0x1510ac,_0x2ecb2c,_0x4d759a,_0x1e4389){var _0x2b34be=this;return function(){var _0x397cd9=![];return _0x2b34be[_0x8959('0x8f')](_0x1510ac[_0x8959('0x78')],_0x2ecb2c,_0x4d759a,_0x1e4389,_0x397cd9);};};Dialer[_0x8959('0x1a')][_0x8959('0x8f')]=function(_0x55faa1,_0x564e48,_0x1369de,_0x5b55a2,_0x15fc93){var _0x27ad81=[];return new Promise(function(_0x4bd758,_0xa23130){if(!isNotNull(_0x55faa1)){_0x5b55a2['message']=utils[_0x8959('0x6a')][_0x8959('0x76')];return _0xa23130(msgResponse('ifTime','Failure',_0x1369de+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x8959('0x79')](_0x55faa1)){_0x5b55a2['message']=utils[_0x8959('0x6a')][_0x8959('0x91')];return _0xa23130(msgResponse('ifTime','Failure',_0x1369de+_0x8959('0x92')));}if(_0x564e48&&_[_0x8959('0x41')](config['timezones'][_0x564e48])){_0x5b55a2[_0x8959('0x66')]=utils[_0x8959('0x6a')][_0x8959('0x93')];return _0xa23130(msgResponse('ifTime',_0x8959('0x94'),_0x1369de+_0x8959('0x95')+_0x564e48));}if(_[_0x8959('0x96')](_0x55faa1)){for(var _0x11fa53=0x0;_0x11fa53<_0x55faa1[_0x8959('0x97')];_0x11fa53+=0x1){_0x27ad81[_0x8959('0x98')](ami[_0x8959('0x99')]({'action':_0x8959('0x9a'),'command':util[_0x8959('0x7c')](_0x8959('0x9b'),_0x55faa1[_0x11fa53][_0x8959('0x9c')],!_[_0x8959('0x41')](config[_0x8959('0x9d')][_0x564e48])?_0x564e48:'')})['then'](function(_0x2373ff){return _0x2373ff[_0x8959('0x9e')]['indexOf'](_0x8959('0x9f'))>=0x0;})[_0x8959('0xa0')](myreject(_0xa23130)));}}else{_0x27ad81[_0x8959('0x98')](ami['Action']({'action':'command','command':util[_0x8959('0x7c')](_0x8959('0x9b'),_0x55faa1,!_[_0x8959('0x41')](config[_0x8959('0x9d')][_0x564e48])?_0x564e48:'')})[_0x8959('0xa1')](function(_0x2b15f1){return _0x2b15f1[_0x8959('0x9e')][_0x8959('0xa2')](_0x8959('0x9f'))>=0x0;})['catch'](myreject(_0xa23130)));}Promise[_0x8959('0xa3')](_0x27ad81)[_0x8959('0xa1')](function(_0x3fe4e9){var _0x20ef10=_['some'](_0x3fe4e9);if(_0x20ef10){return _0x4bd758(_0x20ef10);}else{_0x5b55a2['message']=_0x15fc93?utils[_0x8959('0x6a')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8959('0x6a')][_0x8959('0xa4')];return _0xa23130(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x15fc93+'\x20'+_0x1369de+_0x8959('0xa5')+util[_0x8959('0x47')](_0x55faa1,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x564e48));}})[_0x8959('0xa0')](function(_0x182282){return _0xa23130(msgResponse(_0x8959('0xa6'),_0x8959('0x94'),JSON['stringify'](_0x182282)));});});};Dialer[_0x8959('0x1a')][_0x8959('0x3d')]=function(){var _0x2d9e77=this;return cmHopper[_0x8959('0xa7')]({'active':![]},{'where':{'active':!![]}})[_0x8959('0xa1')](function(){setInterval(function(){_0x2d9e77[_0x8959('0xa8')]();},0x3e8);});};Dialer[_0x8959('0x1a')]['syncCampaigns']=function(){var _0x478727=this;var _0x41d292;for(var _0x413de2 in this[_0x8959('0x21')]){if(typeof this['campaigns'][_0x413de2]!=='undefined'){_0x41d292=this[_0x8959('0x21')][_0x413de2];if(utils['isIVRCampaign'](_0x41d292)&&utils[_0x8959('0xa9')](_0x41d292)){_0x41d292[_0x8959('0x7f')]=!![];Promise[_0x8959('0xaa')]()[_0x8959('0xa1')](checkIsIVRCampaignActive(_0x41d292))[_0x8959('0xa1')](checkInterval(_0x41d292))[_0x8959('0xa1')](_0x478727['checkIsTrunkReachable'](_0x41d292))[_0x8959('0xa1')](_0x478727[_0x8959('0x8e')](_0x41d292[_0x8959('0xab')],_0x41d292[_0x8959('0xac')],_0x41d292[_0x8959('0x49')],_0x41d292))['then'](_0x478727['checkIfTimeIntervals'](_0x41d292[_0x8959('0x75')],_0x41d292[_0x8959('0xac')],_0x41d292[_0x8959('0x49')],_0x41d292))['then'](_0x478727[_0x8959('0xad')](_0x41d292))[_0x8959('0xa0')](loggerCatchQueueSummary('[syncCampaigns]',_0x41d292));}else{notSendMessagesCampaign(_0x41d292);}}}};Dialer[_0x8959('0x1a')][_0x8959('0xae')]=function(_0x13c329){if(_0x13c329[_0x8959('0xaf')]!==_0x8959('0xb0')){clearPredictiveAttributes(_0x13c329);}switch(_0x13c329['dialMethod']){case _0x8959('0xb1'):this[_0x8959('0xb2')](_0x13c329,0x1);break;case _0x8959('0xb3'):this[_0x8959('0xb2')](_0x13c329,_0x13c329[_0x8959('0xb4')]);break;case _0x8959('0xb0'):this['predictive'](_0x13c329);break;case'booked':this['handlePower'](_0x13c329,0x1);break;default:logger[_0x8959('0x64')](_0x8959('0xb5'),_0x13c329[_0x8959('0x49')],_0x8959('0xb6'));}};Dialer['prototype']['ifTime']=function(_0x7fb43c,_0x4555eb){var _0x5b02d1=_0x7fb43c[_0x8959('0xac')];var _0x2e3833=_0x4555eb?_0x7fb43c[_0x8959('0xab')]:_0x7fb43c[_0x8959('0x75')][_0x8959('0x78')];logger[_0x8959('0xb7')](_0x8959('0xb8'),_0x2e3833,_0x5b02d1,_0x7fb43c[_0x8959('0x49')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x7fb43c[_0x8959('0x49')],_0x7fb43c['id']));var _0x52b917=null;return Interval[_0x8959('0xb9')](_0x2e3833,_0x5b02d1)[_0x8959('0xa1')](function(_0x9ddd8f){if(_0x9ddd8f===!![]){return _0x9ddd8f;}else{_0x7fb43c[_0x8959('0x66')]=_0x4555eb?utils[_0x8959('0x6a')][_0x8959('0xba')]:utils[_0x8959('0x6a')][_0x8959('0xa4')];_0x52b917=msgResponse(_0x8959('0xbb'),_0x8959('0x94'),_0x8959('0xbc')+_0x4555eb+'\x20'+_0x7fb43c[_0x8959('0x49')]+_0x8959('0xa5')+util[_0x8959('0x47')](_0x2e3833,{'showHidden':![],'depth':null})+_0x8959('0xbd')+_0x5b02d1);}if(_0x52b917!==null){logger[_0x8959('0xb7')](_0x8959('0xbe'),_0x52b917);_0x52b917[_0x8959('0xbf')]=_0x4555eb;throw _0x52b917;}})[_0x8959('0xa0')](function(_0x2b458b){logger[_0x8959('0x64')]('AMI\x20IfTime',_0x2b458b);throw msgResponse(_0x8959('0x83'),'Error',util['inspect'](_0x2b458b,{'showHidden':![],'depth':null}));});};Dialer[_0x8959('0x1a')][_0x8959('0x2d')]=function(_0x461735){if(this[_0x8959('0x20')][_0x461735[_0x8959('0xc0')]]){if(this['uniqueId'][_0x461735[_0x8959('0xc1')]]&&this['uniqueId'][_0x461735['uniqueid']][_0x8959('0x43')]!=='ivr'){this[_0x8959('0xc2')](this[_0x8959('0x20')][_0x461735[_0x8959('0xc0')]]);this[_0x8959('0x27')][_0x461735['uniqueid']][_0x8959('0xc3')]=moment()[_0x8959('0x7c')](_0x8959('0xc4'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x3fc294){var _0x4b6669=this[_0x8959('0x27')][_0x3fc294[_0x8959('0xc1')]];if(this['voiceQueues'][_0x3fc294[_0x8959('0xc0')]]){if(_0x4b6669&&_0x4b6669[_0x8959('0x43')]!=='ivr'){delete this[_0x8959('0x27')][_0x3fc294['uniqueid']];this[_0x8959('0x20')][_0x3fc294['queue']][_0x8959('0xc5')]+=0x1;var _0x4bf648=new AgentComplete(_0x4b6669,_0x3fc294);if(_0x3fc294['reason']===_0x8959('0xc6')){_0x4bf648['agiafterat']=this[_0x8959('0x20')][_0x3fc294[_0x8959('0xc0')]][_0x8959('0xc7')]&&this['voiceQueues'][_0x3fc294['queue']][_0x8959('0xc8')]?moment()['format'](_0x8959('0xc4')):undefined;}hopperUtils[_0x8959('0xc9')](_0x4bf648)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x8959('0xca')](_0x4bf648)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x8959('0x1a')][_0x8959('0xcb')]=function(_0x59783a){var _0x38e733=this[_0x8959('0x27')][_0x59783a[_0x8959('0xc1')]];var _0x4e36b5=this;var _0x1edb0f=![];var _0x3e8177;var _0x5a83d9;if(this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]]){if(_0x38e733&&_0x38e733[_0x8959('0x43')]!==_0x8959('0xcc')){delete this[_0x8959('0x27')][_0x59783a[_0x8959('0xc1')]];this[_0x8959('0xc2')](this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]]);_0x38e733[_0x8959('0xcd')]=moment()[_0x8959('0x7c')](_0x8959('0xc4'));var _0x4dc5b8=new QueueCallerAbandon(_0x38e733,_0x59783a);if(utils[_0x8959('0x60')](_0x38e733['droptime'],_0x38e733[_0x8959('0xce')])>=_0x38e733[_0x8959('0xcf')]){this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0x4e')]+=0x1;this['voiceQueues'][_0x59783a[_0x8959('0xc0')]][_0x8959('0xd0')]+=0x1;this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xd1')]+=0x1;_0x4dc5b8[_0x8959('0x6d')]=0xa;_0x4dc5b8[_0x8959('0x6e')]='Drop';_0x4dc5b8[_0x8959('0xd2')]=_0x8959('0xd3');_0x4dc5b8[_0x8959('0xd4')]=this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xc7')]?moment()[_0x8959('0x7c')](_0x8959('0xc4')):undefined;_0x4dc5b8[_0x8959('0xd5')]+=0x1;_0x4dc5b8['countglobal']+=0x1;_0x3e8177=this[_0x8959('0x20')][_0x59783a['queue']]['dialDropRetryFrequency'];_0x5a83d9=this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xd6')];hopperUtils[_0x8959('0xd7')](_0x4dc5b8,_0x4dc5b8[_0x8959('0x6d')],_0x38e733[_0x8959('0xd8')])[_0x8959('0xa1')](function(_0x263809){_0x1edb0f=_0x263809[_0x8959('0xd9')]==0x1;if(_0x4dc5b8[_0x8959('0xd5')]>=_0x4e36b5[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]]['dialDropMaxRetry']){_0x4e36b5[_0x8959('0xda')](_0x4dc5b8,_0x263809[_0x8959('0xd9')]);}else{hopperUtils[_0x8959('0xdb')]({'active':![],'countdropretry':_0x4dc5b8[_0x8959('0xd5')],'scheduledat':moment()[_0x8959('0xdc')](_0x4e36b5[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xdd')],'minutes')[_0x8959('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38e733[_0x8959('0xde')],'ListId':_0x38e733['ListId'],'VoiceQueueId':_0x38e733['VoiceQueueId']||undefined,'CampaignId':_0x38e733[_0x8959('0xdf')]||undefined})['catch'](loggerCatch(_0x8959('0xe0')));var _0x18f072=new History(_0x4dc5b8);_0x18f072[_0x8959('0x6d')]=0xa;_0x18f072[_0x8959('0x6e')]=_0x8959('0xe1');_0x18f072[_0x8959('0x70')]=moment()[_0x8959('0x7c')](_0x8959('0xc4'));_0x18f072['endtime']=_0x18f072['starttime'];_0x18f072['calleridname']=_0x4dc5b8[_0x8959('0xe2')];_0x18f072[_0x8959('0xe3')]=_0x4dc5b8['calleridnum'];hopperUtils[_0x8959('0xc9')](_0x18f072)[_0x8959('0xa0')](loggerCatch(_0x8959('0xe4')));}})['then'](function(){if(_0x1edb0f)hopperUtils[_0x8959('0xe5')](_0x4dc5b8,_0x3e8177,_0x5a83d9)['then'](function(){return 0x1;});});}else{this[_0x8959('0x20')][_0x59783a['queue']][_0x8959('0xe6')]+=0x1;this['voiceQueues'][_0x59783a[_0x8959('0xc0')]][_0x8959('0xe7')]+=0x1;_0x4dc5b8['state']=0xb;_0x4dc5b8[_0x8959('0x6e')]=_0x8959('0xe8');_0x4dc5b8[_0x8959('0xd2')]=_0x8959('0xe9');_0x4dc5b8[_0x8959('0xea')]+=0x1;_0x4dc5b8['countglobal']+=0x1;_0x3e8177=this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xeb')];_0x5a83d9=this[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xd6')];hopperUtils[_0x8959('0xd7')](_0x4dc5b8,_0x4dc5b8[_0x8959('0x6d')],_0x38e733[_0x8959('0xd8')])[_0x8959('0xa1')](function(_0x43446a){if(_0x4dc5b8['countabandonedretry']>=_0x4e36b5[_0x8959('0x20')][_0x59783a['queue']][_0x8959('0xec')]){_0x4e36b5[_0x8959('0xda')](_0x4dc5b8,_0x43446a[_0x8959('0xd9')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4dc5b8[_0x8959('0xea')],'scheduledat':moment()[_0x8959('0xdc')](_0x4e36b5[_0x8959('0x20')][_0x59783a[_0x8959('0xc0')]][_0x8959('0xeb')],'minutes')[_0x8959('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38e733[_0x8959('0xde')],'ListId':_0x38e733[_0x8959('0xed')],'VoiceQueueId':_0x38e733[_0x8959('0xee')]||undefined,'CampaignId':_0x38e733[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0xed262b=new History(_0x4dc5b8);_0xed262b[_0x8959('0x6d')]=0xb;_0xed262b[_0x8959('0x6e')]=_0x8959('0xe8');_0xed262b['starttime']=moment()[_0x8959('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0xed262b[_0x8959('0x6f')]=_0xed262b[_0x8959('0x70')];_0xed262b[_0x8959('0xe2')]=_0x4dc5b8['calleridname'];_0xed262b[_0x8959('0xe3')]=_0x4dc5b8[_0x8959('0xe3')];hopperUtils[_0x8959('0xc9')](_0xed262b)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8959('0xa1')](function(){if(_0x1edb0f)hopperUtils[_0x8959('0xe5')](_0x4dc5b8,_0x3e8177,_0x5a83d9)[_0x8959('0xa1')](function(){return 0x1;});});}}}};Dialer[_0x8959('0x1a')]['syncNewExten']=function(_0xa0d4c7){if(this[_0x8959('0x25')][_0xa0d4c7['uniqueid']]){this[_0x8959('0x25')][_0xa0d4c7[_0x8959('0xc1')]]['channel']=_0xa0d4c7[_0x8959('0xef')];}if(this['uniqueId'][_0xa0d4c7[_0x8959('0xc1')]]){this[_0x8959('0x27')][_0xa0d4c7[_0x8959('0xc1')]]['channel']=_0xa0d4c7[_0x8959('0xef')];}};Dialer[_0x8959('0x1a')][_0x8959('0x3b')]=function(_0x5f4b69){if(!this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]]){return;}var _0x29398f=this[_0x8959('0x20')][this[_0x8959('0x25')][_0x5f4b69['actionid']][_0x8959('0xc0')]][_0x8959('0xf1')]||_0x8959('0xf2');if(_0x29398f==='roundrobin'){if(this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]]&&_['isNil'](this['actions'][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xf3')])&&_0x5f4b69[_0x8959('0x89')]==='1'&&_0x5f4b69[_0x8959('0xf4')]==='0'){if(this[_0x8959('0x22')][_0x5f4b69[_0x8959('0xf5')]]){if(!this['agents'][_0x5f4b69[_0x8959('0xf5')]]['locked']){this[_0x8959('0x22')][_0x5f4b69[_0x8959('0xf5')]][_0x8959('0xf3')]=!![];this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xf3')]=!![];this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xf5')]=_0x5f4b69[_0x8959('0xf5')];}}}}else if(_0x29398f===_0x8959('0xf2')){if(this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]]){if(this['agents'][_0x5f4b69[_0x8959('0xf5')]]){this['actions'][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xf5')]=_0x5f4b69[_0x8959('0xf5')];if(_[_0x8959('0xf6')](this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xc0')]])){this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]]['queue']]=[];}this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x5f4b69[_0x8959('0xf0')]][_0x8959('0xc0')]][_0x8959('0x98')](_['merge'](_[_0x8959('0x74')](this[_0x8959('0x25')][_0x5f4b69['actionid']],[_0x8959('0xf7'),_0x8959('0xf5')]),{'status':_0x5f4b69[_0x8959('0x89')],'paused':_0x5f4b69['paused']}));}}}};Dialer[_0x8959('0x1a')][_0x8959('0xf8')]=function(_0x4ae441){if(!this['actions'][_0x4ae441['actionid']]){return;}var _0x4b00db=this;var _0x4431bf=this[_0x8959('0x20')][this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]]['queue']];var _0x1b0861=_0x4431bf['strategy']||_0x8959('0xf2');if(_0x1b0861===_0x8959('0xf9')){if(this[_0x8959('0x25')][_0x4ae441['actionid']]&&this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xf5')]){this['preview']['run'](this[_0x8959('0x25')][_0x4ae441['actionid']][_0x8959('0xf7')],this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xf5')])[_0x8959('0xa0')](function(_0x36d021){logger[_0x8959('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x8959('0x47')](_0x36d021,{'showHidden':![],'depth':null}));})[_0x8959('0x1d')](function(){_0x4b00db[_0x8959('0xc2')](_0x4b00db['voiceQueues'][_0x4b00db[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]);_0x4b00db['agents'][_0x4b00db[_0x8959('0x25')][_0x4ae441['actionid']][_0x8959('0xf5')]]['locked']=![];delete _0x4b00db[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]];unlockQueueStatus(_0x4431bf);});}else{this[_0x8959('0xc2')](this['voiceQueues'][this['actions'][_0x4ae441['actionid']][_0x8959('0xc0')]]);hopperUtils[_0x8959('0xdb')]({'active':![],'ContactId':this[_0x8959('0x25')][_0x4ae441['actionid']][_0x8959('0xde')],'ListId':this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xed')],'VoiceQueueId':this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8959('0x25')][_0x4ae441['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x8959('0xfa')));delete this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]];unlockQueueStatus(_0x4431bf);}}else if(_0x1b0861==='rrmemory'){var _0x65e2f3;if(this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]]&&!_[_0x8959('0x79')](this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]]['queue']])){if(this[_0x8959('0xfb')][_0x4b00db['actions'][_0x4ae441['actionid']][_0x8959('0xc0')]]){this['queueBookedRR'][_0x4b00db[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]=this[_0x8959('0xfb')][this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]?this[_0x8959('0xfb')][this['actions'][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]:this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x4ae441['actionid']][_0x8959('0xc0')]]?this['queueBooked'][this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]['_rr']||0x0:0x0;}this[_0x8959('0x2a')][this[_0x8959('0x25')][_0x4ae441[_0x8959('0xf0')]][_0x8959('0xc0')]]['_rr']=this['queueBookedRR'][this[_0x8959('0x25')][_0x4ae441['actionid']][_0x8959('0xc0')]];for(var _0x5a6790=0x0;_0x5a6790=_0x2115d4[_0x8959('0x120')]){_0x2030ca[_0x8959('0x121')](_0x2bcd79,_0x13af5f,_0x22988e,_0x8959('0x122'));}else{if(_0x2bcd79['countmachineretry']>=_0x2115d4['dialMachineMaxRetry']){_0x2030ca[_0x8959('0x123')](_0x2bcd79,_0x13af5f,_0x22988e,_0x8959('0x124'));}else{hopperUtils[_0x8959('0xdb')]({'active':![],'countmachineretry':_0x2bcd79[_0x8959('0x11b')],'scheduledat':moment()['add'](_0x2115d4[_0x8959('0x125')],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x2bcd79[_0x8959('0xde')],'ListId':_0x2bcd79[_0x8959('0xed')],'VoiceQueueId':_0x2bcd79[_0x8959('0xee')]||undefined,'CampaignId':_0x2bcd79['CampaignId']||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x127')));_0x13af5f({'reschedule':0x1});}}});}if(_0x277bc0[_0x8959('0x43')]===_0x8959('0xcc')&&this[_0x8959('0x21')][_0x277bc0[_0x8959('0xc0')]][_0x8959('0x11a')]&&_0x131337[_0x8959('0x10f')]===_0x8959('0x110')){delete this[_0x8959('0x27')][_0x131337[_0x8959('0xc1')]];this[_0x8959('0xc2')](this['campaigns'][_0x277bc0[_0x8959('0xc0')]]);_0x5edb10=new Hangup(_0x277bc0,_0x131337);_0x5edb10[_0x8959('0x6d')]=0x12;_0x5edb10[_0x8959('0x6e')]=_0x8959('0x112');_0x5edb10['membername']=_0x8959('0x114');ami[_0x8959('0x42')]('custom:amd',ut[_0x8959('0x116')](_0x5edb10,_0x8959('0x117')));this[_0x8959('0x118')](_0x5edb10,_0x8959('0x128'),_0x8959('0x129'));}if(_0x277bc0[_0x8959('0x43')]===_0x8959('0xcc')&&this[_0x8959('0x21')][_0x277bc0['queue']][_0x8959('0x11a')]&&_0x131337[_0x8959('0x10f')]==='MACHINE'){return new Promise(function(_0x3528b8,_0x4359d6){delete _0x2030ca[_0x8959('0x27')][_0x131337['uniqueid']];_0x2030ca[_0x8959('0xc2')](_0x2030ca[_0x8959('0x21')][_0x277bc0[_0x8959('0xc0')]]);_0x2030ca[_0x8959('0x21')][_0x277bc0[_0x8959('0xc0')]][_0x8959('0xc5')]+=0x1;_0x2030ca['campaigns'][_0x277bc0['queue']][_0x8959('0x111')]+=0x1;var _0x3f3b9b=_0x2030ca['campaigns'][_0x277bc0[_0x8959('0xc0')]];var _0x22eaa7=new Hangup(_0x277bc0,_0x131337);_0x22eaa7['state']=0x13;_0x22eaa7[_0x8959('0x6e')]=_0x8959('0x12a');_0x22eaa7['membername']=_0x8959('0x114');_0x22eaa7[_0x8959('0x11b')]+=0x1;_0x22eaa7[_0x8959('0x12b')]+=0x1;_0x22eaa7[_0x8959('0x117')]=!![];ami[_0x8959('0x42')](_0x8959('0x115'),ut[_0x8959('0x116')](_0x22eaa7,_0x8959('0x117')));hopperUtils[_0x8959('0xc9')](_0x22eaa7)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12c')));if(_0x22eaa7['countbusyretry']+_0x22eaa7['countcongestionretry']+_0x22eaa7[_0x8959('0x11d')]+_0x22eaa7[_0x8959('0x11e')]+_0x22eaa7[_0x8959('0xd5')]+_0x22eaa7['countabandonedretry']+_0x22eaa7['countmachineretry']+_0x22eaa7[_0x8959('0x11f')]>=_0x3f3b9b[_0x8959('0x120')]){_0x2030ca[_0x8959('0x121')](_0x22eaa7,_0x3528b8,_0x4359d6,_0x8959('0x122'));}else{if(_0x22eaa7[_0x8959('0x11b')]>=_0x3f3b9b['dialMachineMaxRetry']){_0x2030ca[_0x8959('0x123')](_0x22eaa7,_0x3528b8,_0x4359d6,_0x8959('0x124'));}else{hopperUtils[_0x8959('0xdb')]({'active':![],'countmachineretry':_0x22eaa7['countmachineretry'],'scheduledat':moment()[_0x8959('0xdc')](_0x3f3b9b[_0x8959('0x125')],_0x8959('0x126'))[_0x8959('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22eaa7['ContactId'],'ListId':_0x22eaa7[_0x8959('0xed')],'VoiceQueueId':_0x22eaa7[_0x8959('0xee')]||undefined,'CampaignId':_0x22eaa7[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x127')));_0x3528b8({'reschedule':0x1});}}});}}};Dialer[_0x8959('0x1a')][_0x8959('0x36')]=function(_0x3de394){var _0x574690=this['uniqueId'][_0x3de394[_0x8959('0xc1')]];var _0x52c249;if(_0x574690&&_0x574690[_0x8959('0x43')]===_0x8959('0xcc')){delete this['uniqueId'][_0x3de394[_0x8959('0xc1')]];this[_0x8959('0xc2')](this['campaigns'][_0x574690[_0x8959('0xc0')]]);this[_0x8959('0x21')][_0x574690[_0x8959('0xc0')]][_0x8959('0x12d')]+=0x1;_0x52c249=new Hangup(_0x574690,_0x3de394);hopperUtils[_0x8959('0xc9')](_0x52c249)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12e')));hopperUtils[_0x8959('0xca')](_0x52c249)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12f')));}if(_0x574690&&_0x574690['type']!==_0x8959('0xcc')&&isNotNull(this[_0x8959('0x20')][_0x574690[_0x8959('0xc0')]][_0x8959('0x130')])){delete this[_0x8959('0x27')][_0x3de394['uniqueid']];this[_0x8959('0xc2')](this[_0x8959('0x20')][_0x574690[_0x8959('0xc0')]]);this['voiceQueues'][_0x574690[_0x8959('0xc0')]][_0x8959('0xc5')]+=0x1;this[_0x8959('0x20')][_0x574690[_0x8959('0xc0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x52c249=new Hangup(_0x574690,_0x3de394);_0x52c249[_0x8959('0x6d')]=0x10;_0x52c249[_0x8959('0x6e')]=_0x8959('0x131');_0x52c249[_0x8959('0x113')]=_0x8959('0x132');hopperUtils[_0x8959('0xc9')](_0x52c249)[_0x8959('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x8959('0xca')](_0x52c249)['catch'](loggerCatch(_0x8959('0x12f')));}if(_0x574690&&_0x574690[_0x8959('0x43')]!==_0x8959('0xcc')&&!isNotNull(this['voiceQueues'][_0x574690[_0x8959('0xc0')]][_0x8959('0x130')])){delete this[_0x8959('0x27')][_0x3de394[_0x8959('0xc1')]];this['updateOriginated'](this[_0x8959('0x20')][_0x574690['queue']]);this[_0x8959('0x20')][_0x574690[_0x8959('0xc0')]][_0x8959('0x133')]+=0x1;_0x52c249=new Hangup(_0x574690,_0x3de394);_0x52c249[_0x8959('0x6d')]=0xc;_0x52c249[_0x8959('0x6e')]=_0x3de394[_0x8959('0x134')];_0x52c249['membername']=_0x8959('0x135');hopperUtils[_0x8959('0xc9')](_0x52c249)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12e')));hopperUtils[_0x8959('0xca')](_0x52c249)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12f')));}};Dialer[_0x8959('0x1a')][_0x8959('0x9')]=function(_0x456781){var _0xb9d56a=this;if(!_0xb9d56a['queuesSummary'][_0x456781[_0x8959('0x49')]]){_0xb9d56a[_0x8959('0x2b')][_0x456781[_0x8959('0x49')]]={'running':![]};}else if(_0xb9d56a[_0x8959('0x2b')][_0x456781['name']]['running']===!![]){return;}else if(_0xb9d56a['queuesSummary'][_0x456781[_0x8959('0x49')]][_0x8959('0x136')]===![]){_0xb9d56a[_0x8959('0x2b')][_0x456781['name']][_0x8959('0x136')]=!![];}var _0x1789a2=_0xb9d56a[_0x8959('0x20')][_0x456781['name']];var _0x2c1a01=_0x1789a2['message']!==utils[_0x8959('0x6a')][_0x8959('0x7a')];var _0x401b82=utils[_0x8959('0x137')](_0x1789a2);_0x1789a2['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x1789a2,_0xb9d56a[_0x8959('0x23')]);Promise[_0x8959('0xaa')]()[_0x8959('0xa1')](function(){if(_0x1789a2[_0x8959('0x138')]===utils[_0x8959('0x6a')][_0x8959('0x7a')]){if(_0x2c1a01){clearPredictiveAttributes(_0x1789a2);_0x456781[_0x8959('0x61')]=undefined;_0x456781['startProgressive']=undefined;}if(_0x1789a2[_0x8959('0x138')]===utils[_0x8959('0x6a')][_0x8959('0x7a')]){_0x456781[_0x8959('0x139')]=0x0;_0x456781['paused']=0x0;_0x456781[_0x8959('0x13a')]=0x0;_0x456781[_0x8959('0x13b')]=0x0;_0x456781['pTalking']=0x0;}}else if(_0x1789a2[_0x8959('0x138')]===utils['CAMPAIGN_STATUS'][_0x8959('0x13c')]&&!_0x401b82){return _0xb9d56a[_0x8959('0xa6')](_0x1789a2,!![])[_0x8959('0xa1')](function(){return _0xb9d56a['ifTime'](_0x1789a2,![]);})[_0x8959('0xa1')](function(){return _0xb9d56a['checkDialMethod'](_0x1789a2);})[_0x8959('0xa0')](function(_0x44161c){loggerSyncQueueSummary[_0x8959('0x45')](_0x8959('0x13d'),util['inspect'](_0x44161c,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1789a2);});}else{clearPredictiveAttributes(_0x1789a2);}})[_0x8959('0xa1')](function(){var _0x138052=_0x456781['compareToOutboundQueue'](_0x1789a2);if(_0x138052||_0x1789a2[_0x8959('0x13e')]){_0x1789a2[_0x8959('0x13e')]=![];_0x456781[_0x8959('0x13f')](_0x1789a2);Object[_0x8959('0x140')](_0x1789a2,_0x456781);emitOutboundVoiceQueueSummary(_0x456781);}_0xb9d56a['queuesSummary'][_0x1789a2[_0x8959('0x49')]][_0x8959('0x136')]=![];})[_0x8959('0xa0')](function(_0x3815ad){logger['error'](_0x8959('0x13d'),util[_0x8959('0x47')](_0x3815ad,{'showHidden':![],'depth':null}));_0xb9d56a['queuesSummary'][_0x1789a2['name']][_0x8959('0x136')]=![];});};Dialer[_0x8959('0x1a')][_0x8959('0x34')]=_['throttle'](function(){var _0xbab30e=_[_0x8959('0x141')](this[_0x8959('0x20')],function(_0x158a7f){return _0x158a7f[_0x8959('0x142')];});var _0x519112=_[_0x8959('0x141')](this[_0x8959('0x22')],function(_0x47feec){return _0x47feec[_0x8959('0x143')]&&_0x47feec[_0x8959('0x89')]===_0x8959('0x88');});if(_0xbab30e[_0x8959('0x97')]>0x0&&_0x519112[_0x8959('0x97')]>0x0){return Promise[_0x8959('0xaa')]()[_0x8959('0xa1')](cmHopper[_0x8959('0x144')](_['map'](_0xbab30e,'id'),previewRecallmeReminderInterval,_[_0x8959('0x145')](_0x519112,'id')))[_0x8959('0xa1')](function(_0x55f1d7){for(var _0x4578f1=0x0;_0x4578f1<_0x55f1d7[_0x8959('0x97')];_0x4578f1++){var _0x58039c=_0x55f1d7[_0x4578f1]['Agent'][_0x8959('0x49')];if(_0x58039c)io['to'](util[_0x8959('0x7c')](_0x8959('0x146'),_0x58039c))[_0x8959('0x42')]('user:dialPreviewRecallReminder',{'hopper':_0x55f1d7[_0x4578f1]});}})[_0x8959('0xa0')](function(_0x276699){logger[_0x8959('0x64')]('checkPreviewRecallReminder',_0x276699);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8959('0x1a')][_0x8959('0x3e')]=function(){var _0x21f026=this;setInterval(function(){_0x21f026['clearZombieChannels'](_0x21f026['uniqueId'],_0x8959('0x147'));_0x21f026[_0x8959('0x148')](_0x21f026['actions'],_0x8959('0x149'));},0x32c8);};Dialer[_0x8959('0x1a')][_0x8959('0x148')]=function(_0x21647c,_0xd8defc){var _0x2c41c9=this;for(var _0x38b9fd in _0x21647c){if(typeof _0x21647c[_0x38b9fd]!==_0x8959('0x14a')){this[_0x8959('0x1e')][_0x8959('0x1b')](function(){if(!_[_0x8959('0xf6')](_0x21647c[_0x38b9fd])){return ami['Action']({'action':'status','channel':_0x21647c[_0x38b9fd][_0x8959('0xef')]})[_0x8959('0xa0')](function(_0x492eed){if(_0x492eed['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x21647c[_0x38b9fd]&&_0x21647c[_0x38b9fd][_0x8959('0x43')]!=='ivr'){_0x2c41c9[_0x8959('0xc2')](_0x2c41c9[_0x8959('0x20')][_0x21647c[_0x38b9fd][_0x8959('0xc0')]]);logger[_0x8959('0x64')](_0x8959('0x14b'),_0xd8defc,_0x38b9fd,_0x21647c[_0x38b9fd]['queue']);delete _0x21647c[_0x38b9fd];}if(_0x21647c[_0x38b9fd]&&_0x21647c[_0x38b9fd][_0x8959('0x43')]==='ivr'){_0x2c41c9[_0x8959('0xc2')](_0x2c41c9['campaigns'][_0x21647c[_0x38b9fd][_0x8959('0xc0')]]);logger[_0x8959('0x64')]('[Dialer][checkChannel][ivr]',_0xd8defc,_0x38b9fd,_0x21647c[_0x38b9fd][_0x8959('0xc0')]);delete _0x21647c[_0x38b9fd];}},0x2328);}});}});}}};Dialer[_0x8959('0x1a')][_0x8959('0x14c')]=function(_0x552492){return Promise['resolve']()[_0x8959('0xa1')](voiceQueueRt[_0x8959('0x14c')](_0x552492))[_0x8959('0xa0')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x340af0){if(!_[_0x8959('0x41')](_0x340af0)&&_0x340af0!==null){if(typeof _0x340af0['originated']!=='undefined'){if(_0x340af0['originated']>0x0){_0x340af0[_0x8959('0x80')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x8959('0x1a')][_0x8959('0x14d')]=function(_0x46dcbb,_0x4cca48){var _0x3ce33f=this;return function(_0x35c89c){_0x3ce33f[_0x8959('0xc2')](_0x4cca48);logger[_0x8959('0x64')](_0x46dcbb,util[_0x8959('0x47')](_0x35c89c,{'showHidden':![],'depth':null}));};};Dialer[_0x8959('0x1a')]['emptyContact']=function(_0x9eee83,_0x1aed75,_0x4818df){var _0x4de460={'state':0x19,'statedesc':_0x8959('0x14e')};this[_0x8959('0xc2')](_0x1aed75);this[_0x8959('0x118')](_['merge'](_0x4de460,_[_0x8959('0x74')](_0x4818df,['ContactId',_0x8959('0xed'),_0x8959('0x14f'),_0x8959('0xee'),_0x8959('0xdf')])),_0x8959('0x150'),_0x8959('0x151'));logger[_0x8959('0x64')](_0x9eee83);};Dialer[_0x8959('0x1a')][_0x8959('0x118')]=function(_0x4ff830,_0x58be86,_0x5c3eb4){hopperUtils['createHistory'](_0x4ff830)[_0x8959('0xa0')](loggerCatch(_0x58be86));hopperUtils[_0x8959('0xca')](_0x4ff830)['catch'](loggerCatch(_0x5c3eb4));};Dialer[_0x8959('0x1a')][_0x8959('0xda')]=function(_0x3136e8,_0x358bcc){hopperUtils['createHistory'](_0x3136e8)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x358bcc==0x0){hopperUtils['moveContactManagedDialer'](_0x3136e8)[_0x8959('0xa0')](loggerCatch(_0x8959('0x152')));}};Dialer['prototype'][_0x8959('0x153')]=function(_0x158df2){return Promise['resolve']()[_0x8959('0xa1')](cmHopper[_0x8959('0x144')](_0x158df2['id'],previewRecallmeReminderInterval))[_0x8959('0xa1')](function(_0x229fb7){for(var _0x14420=0x0;_0x14420<_0x229fb7[_0x8959('0x97')];_0x14420++){var _0x485a8b=_0x229fb7[_0x14420]['Agent'][_0x8959('0x49')];if(_0x485a8b)io['to'](util[_0x8959('0x7c')]('user:%s',_0x485a8b))[_0x8959('0x42')](_0x8959('0x154'),{'hopper':_0x229fb7[_0x14420]});}})[_0x8959('0xa0')](function(){});};Dialer[_0x8959('0x1a')]['launchHandleIvr']=function(_0x371899){var _0xe4306d=this;return function(){_0xe4306d[_0x8959('0x155')](_0x371899);};};Dialer[_0x8959('0x1a')]['actionOriginate']=function(_0xd7d5c4,_0x29e181){var _0xb450fb=this;var _0x131d0a=uuid['v4']();this[_0x8959('0x25')][_0x131d0a]=new Action(_0xd7d5c4,_0x29e181,_0x131d0a);return new Promise(function(_0x128323,_0x90045c){if(_['isUndefined'](_0xd7d5c4)&&typeof _0xd7d5c4!==_0x8959('0x156')){return _0x90045c(msgResponse(_0x8959('0x157'),_0x8959('0x94'),_0x8959('0x158')));}if(_['isUndefined'](_0x29e181['phone'])||_0x29e181[_0x8959('0x159')]===null){return _0x90045c(msgResponse(_0x8959('0x157'),_0x8959('0x94'),_0x8959('0x15a')));}var _0x29395e={'XMD-CALLERID':_0xb450fb[_0x8959('0x25')][_0x131d0a][_0x8959('0x15b')](),'XMD-AGI':_0xd7d5c4[_0x8959('0x130')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xd7d5c4['dialQueueProject']):_0x8959('0x15c'),'XMD-AGIAFTER':_0xd7d5c4[_0x8959('0xc7')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xd7d5c4[_0x8959('0xc7')]):_0x8959('0x15c'),'XMD-QUEUE':utils['isOutboundQueue'](_0xd7d5c4)?util[_0x8959('0x7c')](_0x8959('0x15d'),_0xd7d5c4[_0x8959('0x49')],_0xd7d5c4[_0x8959('0x15e')]||'',_0xd7d5c4[_0x8959('0xc8')]?'c':'',_0xd7d5c4[_0x8959('0xcf')]||0x3):'NONE','XMD-CONTACTID':_0x29e181[_0x8959('0xde')],'XMD-CDRTYPE':_0x8959('0x6'),'CALLERID(all)':_0xb450fb[_0x8959('0x25')][_0x131d0a][_0x8959('0x15b')](),'XMD-AMD':_0xd7d5c4[_0x8959('0x11a')]?_0x8959('0x13c'):_0x8959('0x15c'),'XMD-DESTINATION':_0x8959('0x15f')};if(_0xd7d5c4[_0x8959('0x11a')]){_0x29395e['XMD-AMDINITIALSILENCE']=_0xd7d5c4[_0x8959('0x160')]||0x9c4;_0x29395e[_0x8959('0x161')]=_0xd7d5c4['dialAMDGreeting']||0x5dc;_0x29395e[_0x8959('0x162')]=_0xd7d5c4[_0x8959('0x163')]||0x320;_0x29395e[_0x8959('0x164')]=_0xd7d5c4[_0x8959('0x165')]||0x1388;_0x29395e['XMD-AMDMINWORDLENGTH']=_0xd7d5c4[_0x8959('0x166')]||0x64;_0x29395e['XMD-AMDBETWEENWORDSSILENCE']=_0xd7d5c4[_0x8959('0x167')]||0x32;_0x29395e[_0x8959('0x168')]=_0xd7d5c4[_0x8959('0x169')]||0x3;_0x29395e[_0x8959('0x16a')]=_0xd7d5c4[_0x8959('0x16b')]||0x100;_0x29395e[_0x8959('0x16c')]=_0xd7d5c4[_0x8959('0x16d')]||0x1388;}if(utils['isOutboundQueue'](_0xd7d5c4)){_0x29395e['XMD-VOICEQUEUEID']=_0x29e181['VoiceQueueId'];}else{_0x29395e[_0x8959('0x16e')]=_0x29e181[_0x8959('0xdf')];}var _0xfc4b1=utils[_0x8959('0x16f')](_0x29e181[_0x8959('0x170')]);Object[_0x8959('0x140')](_0x29395e,_0xfc4b1);var _0x22aed1=_0xb450fb['isTrunkReachable'](_0xd7d5c4[_0x8959('0x8c')])?utils[_0x8959('0x171')](_0xd7d5c4[_0x8959('0x8c')]['callerid'],_0xd7d5c4['dialOriginateCallerIdName'],_0xd7d5c4[_0x8959('0x172')]>0x0?utils[_0x8959('0x173')](_0xd7d5c4[_0x8959('0x174')],_0xd7d5c4['dialRandomLastDigitCallerIdNumber']):_0xd7d5c4['dialOriginateCallerIdNumber']):utils['getCallerId'](_[_0x8959('0xf6')](_0xd7d5c4['TrunkBackup'])?_0xd7d5c4[_0x8959('0x8c')][_0x8959('0x175')]:_0xd7d5c4['TrunkBackup'][_0x8959('0x175')],_0xd7d5c4['dialOriginateCallerIdName'],_0xd7d5c4[_0x8959('0x172')]>0x0?utils['getCallerIdRandom'](_0xd7d5c4[_0x8959('0x174')],_0xd7d5c4[_0x8959('0x172')]):_0xd7d5c4[_0x8959('0x174')]);if(_0x22aed1){_0x29395e[_0x8959('0x176')]=_0xb450fb[_0x8959('0x25')][_0x131d0a]['originatecalleridname']=utils['extractCalleridName'](_0x22aed1);_0x29395e[_0x8959('0x177')]=_0x29e181[_0x8959('0x159')];}_0xd7d5c4[_0x8959('0x178')]=_0x29395e;return ami[_0x8959('0x99')]({'actionid':_0x131d0a,'action':_0x8959('0x157'),'channel':_0xb450fb[_0x8959('0x85')](_0xd7d5c4['Trunk'])?util['format']('SIP/%s/%s%s',_0xd7d5c4[_0x8959('0x8c')]['name'],isNotNull(_0xd7d5c4[_0x8959('0x179')])?_0xd7d5c4[_0x8959('0x179')][_0x8959('0x17a')]()||'':'',_0xd7d5c4[_0x8959('0x17b')]>0x0?_0x29e181['phone']['substring'](_0xd7d5c4['dialCutDigit']):_0x29e181[_0x8959('0x159')]):util[_0x8959('0x7c')](_0x8959('0x17c'),_[_0x8959('0xf6')](_0xd7d5c4[_0x8959('0x17d')])?_0xd7d5c4[_0x8959('0x8c')]['name']:_0xd7d5c4[_0x8959('0x17d')][_0x8959('0x49')],isNotNull(_0xd7d5c4[_0x8959('0x179')])?_0xd7d5c4['dialPrefix'][_0x8959('0x17a')]()||'':'',_0xd7d5c4['dialCutDigit']>0x0?_0x29e181['phone'][_0x8959('0x17e')](_0xd7d5c4['dialCutDigit']):_0x29e181[_0x8959('0x159')]),'callerid':_0x22aed1,'Exten':_0x8959('0x15f'),'Context':_0x8959('0x17f'),'Priority':'1','variable':_0x29395e,'timeout':(_0xd7d5c4['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x131d0a})[_0x8959('0xa1')](function(_0x51db00){return _0x128323(_0x51db00);})[_0x8959('0xa0')](function(_0x444acd){_0xd7d5c4[_0x8959('0x180')]+=0x1;var _0x58c6ee=new History(_0xb450fb['actions'][_0x131d0a]);logger[_0x8959('0x64')](util[_0x8959('0x7c')]('[originateError]:\x20%s',JSON[_0x8959('0x73')](_0x444acd)));_0x58c6ee[_0x8959('0x6d')]=0xe;_0x58c6ee[_0x8959('0x6e')]=_0x8959('0x181');_0x58c6ee['starttime']=moment()[_0x8959('0x7c')](_0x8959('0xc4'));_0x58c6ee[_0x8959('0x6f')]=_0x58c6ee[_0x8959('0x70')];hopperUtils[_0x8959('0xc9')](_0x58c6ee)[_0x8959('0xa0')](loggerCatch('[originate][error]'));_0xb450fb[_0x8959('0xca')](_0x58c6ee)[_0x8959('0xa0')](loggerCatch(_0x8959('0x182')))[_0x8959('0x1d')](function(){delete _0xb450fb['actions'][_0x131d0a];return _0x90045c(msgResponse('originate',_0x8959('0x84'),_0x8959('0x183')));});});});};Dialer[_0x8959('0x1a')][_0x8959('0x184')]=function(_0x362202,_0x4d22d9,_0x4c956e){var _0x570dc0=new History(_0x4d22d9);if(_0x570dc0[_0x8959('0x11c')]+_0x570dc0[_0x8959('0x185')]+_0x570dc0[_0x8959('0x11d')]+_0x570dc0['countnosuchnumberretry']+_0x570dc0[_0x8959('0xd5')]+_0x570dc0[_0x8959('0xea')]+_0x570dc0['countmachineretry']+_0x570dc0['countagentrejectretry']>=_0x4c956e[_0x8959('0x120')]-0x1){return!![];}switch(_0x362202){case 0x3:if(_0x570dc0[_0x8959('0x11d')]>=_0x4c956e[_0x8959('0x186')]-0x1){return!![];}hopperUtils[_0x8959('0xdb')]({'active':![],'countnoanswerretry':_0x570dc0[_0x8959('0x11d')]+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e['dialNoAnswerRetryFrequency'],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0['CampaignId']||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x187')));break;case 0x5:if(_0x570dc0[_0x8959('0x11c')]>=_0x4c956e[_0x8959('0x188')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x570dc0[_0x8959('0x11c')]+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e[_0x8959('0x189')],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x570dc0['countcongestionretry']>=_0x4c956e['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x8959('0xdb')]({'active':![],'countcongestionretry':_0x570dc0[_0x8959('0x185')]+=0x1,'scheduledat':moment()['add'](_0x4c956e['dialCongestionRetryFrequency'],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0['VoiceQueueId']||undefined,'CampaignId':_0x570dc0['CampaignId']||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x18a')));break;case 0x0:if(_0x570dc0[_0x8959('0x11e')]>=_0x4c956e[_0x8959('0x18b')]-0x1){return!![];}else{hopperUtils[_0x8959('0xdb')]({'active':![],'countnosuchnumberretry':_0x570dc0['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e['dialNoSuchNumberRetryFrequency'],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0['ContactId'],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0['CampaignId']||undefined})[_0x8959('0xa0')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x570dc0[_0x8959('0xd5')]>=_0x4c956e[_0x8959('0x18c')]-0x1){return!![];}hopperUtils[_0x8959('0xdb')]({'active':![],'countdropretry':_0x570dc0['countdropretry']+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e[_0x8959('0xdd')],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0[_0x8959('0xdf')]||undefined})['catch'](loggerCatch(_0x8959('0xe0')));break;case 0xb:if(_0x570dc0[_0x8959('0xea')]>=_0x4c956e['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x8959('0xdb')]({'active':![],'countabandonedretry':_0x570dc0[_0x8959('0xea')]+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e[_0x8959('0xeb')],_0x8959('0x126'))[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0['ContactId'],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x18d')));break;case 0x13:if(_0x570dc0[_0x8959('0x11b')]>=_0x4c956e[_0x8959('0x18e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x570dc0[_0x8959('0x11b')]+=0x1,'scheduledat':moment()[_0x8959('0xdc')](_0x4c956e['dialMachineRetryFrequency'],'minutes')[_0x8959('0x7c')](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x570dc0[_0x8959('0x11f')]>=_0x4c956e['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x570dc0[_0x8959('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x4c956e[_0x8959('0x18f')],_0x8959('0x126'))['format'](_0x8959('0xc4')),'ContactId':_0x570dc0[_0x8959('0xde')],'ListId':_0x570dc0[_0x8959('0xed')],'VoiceQueueId':_0x570dc0[_0x8959('0xee')]||undefined,'CampaignId':_0x570dc0[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x190')));break;default:return!![];}};Dialer[_0x8959('0x1a')][_0x8959('0x191')]=function(_0xac1797,_0x160bb6,_0x3c8639){var _0xc765b8=this;var _0x38601b=new History(_0xac1797);var _0x58ed6d=![];var _0x25cd46;var _0xbaeff6;return new Promise(function(_0xac147b,_0x516e79){if(_[_0x8959('0x41')](_0x160bb6)&&typeof _0x160bb6!==_0x8959('0x156')){return _0x516e79(msgResponse(_0x8959('0x192'),_0x8959('0x94'),_0x8959('0x193')));}if(_[_0x8959('0x41')](_0x3c8639)&&typeof _0x3c8639!=='object'){return _0x516e79(msgResponse(_0x8959('0x192'),_0x8959('0x94'),_0x8959('0x194')));}hopperUtils[_0x8959('0xd7')](_0x38601b,_0x3c8639['reason'],_0x160bb6)[_0x8959('0xa1')](function(_0x28b5cd){if(_0x28b5cd['additional']==0x1)_0x58ed6d=!![];switch(_0x3c8639[_0x8959('0x195')]){case'0':_0x160bb6[_0x8959('0x196')]+=0x1;_0x38601b[_0x8959('0x6d')]=0x0;_0x38601b['statedesc']=_0x8959('0x197');_0x38601b['countnosuchnumberretry']+=0x1;_0x38601b[_0x8959('0x12b')]+=0x1;ami[_0x8959('0x42')]('custom:agentnosuchnumber',ut[_0x8959('0x116')](_0xac1797,_0x8959('0x198')));_0x25cd46=_0x160bb6[_0x8959('0x199')];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];hopperUtils[_0x8959('0xc9')](_0x38601b)[_0x8959('0xa0')](loggerCatch(_0x8959('0x12c')));if(_0xc765b8['checkRetriveMax'](0x0,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x11e')]>=_0x160bb6[_0x8959('0x18b')]){_0xc765b8[_0x8959('0x123')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x19a'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x19a'));}}break;case'3':_0x160bb6[_0x8959('0x19b')]+=0x1;_0x38601b['state']=0x3;_0x38601b[_0x8959('0x6e')]=_0x8959('0x19c');_0x38601b[_0x8959('0x11d')]+=0x1;_0x38601b[_0x8959('0x12b')]+=0x1;var _0x17d3e0=ut[_0x8959('0x19d')](_0xac1797,_0x160bb6);ami['emit']('custom:agentnoanswer',_0x17d3e0);_0x25cd46=_0x160bb6['dialNoAnswerRetryFrequency'];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];hopperUtils[_0x8959('0xc9')](_0x38601b)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0xc765b8['checkRetriveMax'](0x3,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x11d')]>=_0x160bb6[_0x8959('0x186')]){_0xc765b8[_0x8959('0x123')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x19e'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x19e'));}}break;case'5':_0x160bb6[_0x8959('0x19f')]+=0x1;_0x38601b['state']=0x5;_0x38601b['statedesc']='Busy';_0x38601b['countbusyretry']+=0x1;_0x38601b[_0x8959('0x12b')]+=0x1;ami[_0x8959('0x42')]('custom:agentbusy',ut[_0x8959('0x116')](_0xac1797,_0x8959('0x1a0')));_0x25cd46=_0x160bb6['dialBusyRetryFrequency'];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];hopperUtils['createHistory'](_0x38601b)[_0x8959('0xa0')](loggerCatch(_0x8959('0x1a1')));if(_0xc765b8[_0x8959('0x184')](0x5,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x11c')]>=_0x160bb6[_0x8959('0x188')]){_0xc765b8[_0x8959('0x123')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1a2'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,'reason\x205\x20busy');}}break;case'8':_0x160bb6[_0x8959('0x1a3')]+=0x1;_0x38601b[_0x8959('0x6d')]=0x8;_0x38601b[_0x8959('0x6e')]=_0x8959('0x1a4');_0x38601b['countcongestionretry']+=0x1;_0x38601b[_0x8959('0x12b')]+=0x1;_0x25cd46=_0x160bb6[_0x8959('0x1a5')];_0xbaeff6=_0x160bb6['callAdditionalPhoneAfterMin'];ami[_0x8959('0x42')](_0x8959('0x1a6'),ut[_0x8959('0x116')](_0xac1797,'congestion'));hopperUtils[_0x8959('0xc9')](_0x38601b)['catch'](loggerCatch(_0x8959('0x1a7')));if(_0xc765b8['checkRetriveMax'](0x8,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x185')]>=_0x160bb6[_0x8959('0x1a8')]){_0xc765b8[_0x8959('0x123')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1a9'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1a9'));}}break;case'11':_0x160bb6['outboundAbandonedCallsDay']+=0x1;_0x38601b[_0x8959('0x6d')]=0xb;_0x38601b[_0x8959('0x6e')]=_0x8959('0xe8');_0x38601b[_0x8959('0xea')]+=0x1;_0x38601b[_0x8959('0x12b')]+=0x1;_0x25cd46=_0x160bb6[_0x8959('0xeb')];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];hopperUtils[_0x8959('0xc9')](_0x38601b)['catch'](loggerCatch(_0x8959('0x1aa')));if(_0xc765b8[_0x8959('0x184')](0xb,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0xea')]>=_0x160bb6['dialAbandonedMaxRetry']){_0xc765b8[_0x8959('0x123')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1ab'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1ab'));}}break;case'20':_0x160bb6[_0x8959('0x1ac')]+=0x1;_0x38601b[_0x8959('0x6d')]=0x14;_0x38601b['statedesc']=_0x8959('0x1ad');_0x38601b[_0x8959('0x11f')]+=0x1;_0x38601b['countglobal']+=0x1;_0x25cd46=_0x160bb6[_0x8959('0x18f')];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];ami['emit'](_0x8959('0x1ae'),ut[_0x8959('0x116')](_0xac1797,'agentreject'));hopperUtils[_0x8959('0xc9')](_0x38601b)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xc765b8[_0x8959('0x184')](0x14,_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x11f')]>=_0x160bb6[_0x8959('0x1af')]){_0xc765b8['createStateFinal'](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1b0'));}else{_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x8959('0x1b0'));}}break;default:_0x160bb6[_0x8959('0x133')]+=0x1;_0x38601b[_0x8959('0x6d')]=0xc;_0x38601b['statedesc']=_0x3c8639[_0x8959('0x195')];_0x25cd46=_0x160bb6[_0x8959('0x18f')];_0xbaeff6=_0x160bb6[_0x8959('0xd6')];hopperUtils['createHistory'](_0x38601b)[_0x8959('0xa0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xc765b8[_0x8959('0x184')](_0x3c8639['reason'],_0xac1797,_0x160bb6)&&!_0x58ed6d){if(_0x38601b[_0x8959('0x11c')]+_0x38601b['countcongestionretry']+_0x38601b['countnoanswerretry']+_0x38601b[_0x8959('0x11e')]+_0x38601b[_0x8959('0xd5')]+_0x38601b[_0x8959('0xea')]+_0x38601b[_0x8959('0x11b')]+_0x38601b['countagentrejectretry']>=_0x160bb6[_0x8959('0x120')]){_0xc765b8[_0x8959('0x121')](_0x38601b,_0xac147b,_0x516e79,_0x3c8639[_0x8959('0x195')]);}else{_0xc765b8['createStateFinal'](_0x38601b,_0xac147b,_0x516e79,_0x3c8639[_0x8959('0x195')]);}}}})[_0x8959('0xa1')](function(){if(_0x58ed6d){hopperUtils[_0x8959('0xe5')](_0x38601b,_0x25cd46,_0xbaeff6)['then'](function(){return _0xac147b(0x1);});}});});};Dialer[_0x8959('0x1a')]['stateGlobal']=function(_0x3b9d14,_0x1f0498,_0x57ae49,_0x1a05a8){var _0x456668=new Final(_0x3b9d14);_0x456668[_0x8959('0x6d')]=0xf;_0x456668[_0x8959('0x6e')]=_0x8959('0x1b1');this['createStateFinal'](_0x456668,_0x1f0498,_0x57ae49,_0x1a05a8);};Dialer[_0x8959('0x1a')][_0x8959('0x123')]=function(_0x53ccde,_0x34e755,_0x24b57b,_0x513c7d){hopperUtils['moveContactManagedDialer'](_0x53ccde)[_0x8959('0xa1')](function(){return _0x34e755(msgResponse(_0x8959('0x192'),_0x8959('0x10b'),_0x513c7d));})[_0x8959('0xa0')](function(){return _0x24b57b(msgResponse(_0x8959('0x1b2'),'Failure',_0x8959('0x1b3')));});};Dialer[_0x8959('0x1a')]['predictive']=function(_0x259f82){var _0x385154=_0x259f82[_0x8959('0x1b4')]/0x64;var _0x4d7332=_0x259f82[_0x8959('0xd0')]/(_0x259f82['outboundDropCallsDayTimeout']+_0x259f82['outboundAnswerCallsDay']);var _0x354196=Math[_0x8959('0x1b5')](_0x259f82[_0x8959('0x1b6')]*(_0x259f82['predictiveIntervalMaxThreshold']/0x64));var _0x16063b=Math['round'](_0x259f82[_0x8959('0x1b6')]*(_0x259f82['predictiveIntervalMinThreshold']/0x64));var _0x588a8c=_0x259f82[_0x8959('0x139')]+_0x259f82[_0x8959('0x13b')];var _0x6b1f40=Math[_0x8959('0x1b7')](_0x259f82['erlangCalls']*_0x259f82[_0x8959('0x5c')]*_0x259f82[_0x8959('0x1b8')]*_0x259f82[_0x8959('0x1b9')]);if(_['isUndefined'](_0x259f82[_0x8959('0x28')])){if(!_[_0x8959('0x41')](_0x259f82[_0x8959('0x61')])){_0x259f82[_0x8959('0x61')]=undefined;loggerPredictive['error'](_0x8959('0x1ba'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x8959('0x41')](_0x259f82[_0x8959('0x62')])){loggerPredictive[_0x8959('0x64')](_0x8959('0x1ba'),_0x8959('0x1bb'));clearInterval(_0x259f82['handlePredictive']);_0x259f82['handlePredictive']=undefined;}_0x259f82[_0x8959('0x28')]=moment()[_0x8959('0x7c')](_0x8959('0xc4'));loggerPredictive[_0x8959('0x4b')](_0x259f82[_0x8959('0x49')],_0x8959('0x1bc'),_0x259f82['startProgressive']);this[_0x8959('0xb2')](_0x259f82,0x1);}else if(ifInterval(_0x259f82[_0x8959('0x1bd')],_0x259f82[_0x8959('0x28')])){this[_0x8959('0xb2')](_0x259f82,0x1);loggerPredictiveCalls['info'](_0x8959('0x1be'),_0x259f82[_0x8959('0x28')],_0x259f82[_0x8959('0x49')]);_0x259f82[_0x8959('0x58')]=0x0;_0x259f82[_0x8959('0xd1')]=0x0;}else if(_0x385154<_0x4d7332&&_0x259f82['dialPredictiveOptimization']===_0x8959('0x1bf')){clearPredictiveAttributes(_0x259f82);loggerPredictive[_0x8959('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x8959('0x1c0'),_0x4d7332,_0x8959('0x28'),_0x259f82[_0x8959('0x49')]);}else if(_0x6b1f40<_0x259f82[_0x8959('0xd1')]&&_0x259f82['dialPredictiveOptimization']===_0x8959('0x1bf')){clearPredictiveAttributes(_0x259f82);loggerPredictive['info'](_0x8959('0x1c1'),'Max\x20Drop\x20',_0x6b1f40,_0x8959('0x1c2'),_0x259f82[_0x8959('0xd1')],_0x8959('0x28'),_0x259f82[_0x8959('0x49')]);}else if(!ifInterval(_0x259f82[_0x8959('0x1bd')],_0x259f82[_0x8959('0x28')])&&_[_0x8959('0x41')](_0x259f82['startPredictive'])&&!_[_0x8959('0x41')](_0x259f82[_0x8959('0x28')])){_0x259f82[_0x8959('0x61')]=moment()[_0x8959('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8959('0x4b')](_0x259f82[_0x8959('0x49')],_0x8959('0x1c3'),_0x259f82['startPredictive']);hopperUtils[_0x8959('0x1c4')](_0x259f82[_0x8959('0x1bd')])[_0x8959('0xa1')](this[_0x8959('0x1c5')](_0x259f82))['then'](mergeDataErlangB(_0x259f82))[_0x8959('0xa1')](this[_0x8959('0x1c6')](_0x259f82))[_0x8959('0xa0')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x259f82));}else if(!ifInterval(_0x259f82[_0x8959('0x1bd')],_0x259f82['startPredictive'])){_0x259f82[_0x8959('0xd1')]=0x0;_0x259f82[_0x8959('0x61')]=moment()[_0x8959('0x7c')](_0x8959('0xc4'));loggerPredictive[_0x8959('0x4b')](_0x259f82[_0x8959('0x49')],'recalculate\x20predictive\x20at',_0x259f82[_0x8959('0x61')]);clearInterval(_0x259f82[_0x8959('0x62')]);_0x259f82['handlePredictive']=undefined;hopperUtils[_0x8959('0x1c4')](_0x259f82[_0x8959('0x1bd')])[_0x8959('0xa1')](this['getDataPredictive'](_0x259f82))['then'](mergeDataErlangB(_0x259f82))[_0x8959('0xa1')](this[_0x8959('0x1c6')](_0x259f82))[_0x8959('0xa0')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x259f82));}else if(_0x259f82[_0x8959('0x1b6')]&&_0x588a8c<_0x259f82['predictiveIntervalAvailable']-_0x16063b){clearPredictiveAttributes(_0x259f82);loggerPredictive[_0x8959('0x4b')](_0x259f82[_0x8959('0x49')],_0x8959('0x1c7'),_0x588a8c,')\x20are\x20less\x20than\x20threshold\x20(',_0x259f82[_0x8959('0x1b6')],'-',_0x16063b,'=',_0x259f82[_0x8959('0x1b6')]-_0x16063b,')');}else if(_0x259f82[_0x8959('0x1b6')]&&_0x588a8c>_0x259f82[_0x8959('0x1b6')]+_0x354196){clearPredictiveAttributes(_0x259f82);loggerPredictive[_0x8959('0x4b')](_0x259f82[_0x8959('0x49')],_0x8959('0x1c7'),_0x588a8c,_0x8959('0x1c8'),_0x259f82[_0x8959('0x1b6')],'+',_0x354196,'=',_0x259f82[_0x8959('0x1b6')]+_0x354196,')');}};Dialer[_0x8959('0x1a')]['getDataPredictive']=function(_0x1a6626){var _0x123c8a=this;return function(_0x5abdc5){return new Promise(function(_0x179867,_0x1921f2){_[_0x8959('0x5f')](_0x1a6626,_0x5abdc5[0x0]);if(checkGetDataPredictive(_0x5abdc5[0x0])){var _0x459882=_0x1a6626[_0x8959('0x1b6')]=_0x1a6626[_0x8959('0x13b')]+_0x1a6626[_0x8959('0x139')];var _0x44cfcd=_0x1a6626[_0x8959('0x1bd')]*0x3c;var _0x361475=_0x5abdc5[0x0]['predictiveIntervalAvgTalktime']+_0x5abdc5[0x0][_0x8959('0x51')];var _0x1d4f36=(_0x5abdc5[0x0][_0x8959('0x4c')]+_0x5abdc5[0x0][_0x8959('0x4e')]+_0x5abdc5[0x0][_0x8959('0xe6')])/_0x5abdc5[0x0]['predictiveIntervalTotalCalls'];_0x1a6626['predictiveIntervalHitRate']=_0x1d4f36>0x0?_0x1d4f36:0x1;switch(_0x1a6626[_0x8959('0x1c9')]){case _0x8959('0x1bf'):var _0x34bcd8=_0x1a6626[_0x8959('0x1b4')]/0x64;return _0x123c8a[_0x8959('0x1ca')](_0x459882,_0x44cfcd,_0x361475,_0x1d4f36,_0x34bcd8)[_0x8959('0xa1')](function(_0x486eab){return _0x179867(_0x486eab);});case _0x8959('0x1cb'):var _0x3fcb1a=_0x1a6626[_0x8959('0x1b4')]/0x64;return _0x123c8a[_0x8959('0x1cc')](_0x459882,_0x44cfcd,_0x361475,_0x1d4f36,_0x3fcb1a)[_0x8959('0xa1')](function(_0x5c05b0){return _0x179867(_0x5c05b0);});default:return _0x1921f2(msgResponse('[getDataPredictive]',_0x8959('0x94'),_0x8959('0x1cd')));}}else{return _0x1921f2(msgResponse(_0x8959('0x1ce'),_0x8959('0x94'),'check\x20failure'));}});};};Dialer[_0x8959('0x1a')][_0x8959('0x1cf')]=function(_0x4cdd8c){var _0x54b8d0=this;return function(_0x19b5fe){return new Promise(function(_0x592f81,_0x249834){_[_0x8959('0x5f')](_0x4cdd8c,_0x19b5fe[0x0]);if(checkGetDataPredictive(_0x19b5fe[0x0])){loggerPredictive[_0x8959('0x4b')](JSON['stringify'](_0x19b5fe[0x0]));if(_0x4cdd8c[_0x8959('0x1c9')]===_0x8959('0x1bf')){return _0x54b8d0[_0x8959('0x14c')](_0x4cdd8c['id'])[_0x8959('0xa1')](function(_0x488532){var _0x56d9a1=_0x4cdd8c[_0x8959('0x1d0')]-_0x488532[0x0][_0x8959('0x1d1')];var _0x3ab213=_0x4cdd8c[_0x8959('0x1bd')]*0x3c;var _0x345b41=_0x19b5fe[0x0]['predictiveIntervalAvgTalktime']+_0x19b5fe[0x0]['predictiveIntervalAvgHoldtime'];var _0xb68154=(_0x19b5fe[0x0]['predictiveIntervalAnsweredCalls']+_0x19b5fe[0x0][_0x8959('0x4e')]+_0x19b5fe[0x0][_0x8959('0xe6')])/_0x19b5fe[0x0][_0x8959('0x54')];var _0x1c7ae6=_0x4cdd8c['dialPredictiveOptimizationPercentage']/0x64;_0x4cdd8c[_0x8959('0x1d2')]=_0x488532[0x0]['outboundQueuePauses']||0x0;_0x4cdd8c[_0x8959('0x1b8')]=_0xb68154>0x0?_0xb68154:0x1;return _0x54b8d0['abandonmentRate'](_0x56d9a1,_0x3ab213,_0x345b41,_0xb68154,_0x1c7ae6);})[_0x8959('0xa1')](function(_0x3dc79f){return _0x592f81(_0x3dc79f);})[_0x8959('0xa0')](function(_0x4875ed){return _0x249834(msgResponse('[CatchErlangB]',_0x8959('0x94'),JSON['stringify'](_0x4875ed)));});}if(_0x4cdd8c[_0x8959('0x1c9')]===_0x8959('0x1cb')){return _0x54b8d0[_0x8959('0x14c')](_0x4cdd8c['id'])[_0x8959('0xa1')](function(_0x1305b3){var _0x23288a=_0x4cdd8c[_0x8959('0x1d0')]-_0x1305b3[0x0][_0x8959('0x1d1')];var _0x1e0a7=_0x4cdd8c[_0x8959('0x1bd')]*0x3c;var _0x162c33=_0x19b5fe[0x0][_0x8959('0x53')]+_0x19b5fe[0x0][_0x8959('0x51')];var _0x523739=(_0x19b5fe[0x0]['predictiveIntervalAnsweredCalls']+_0x19b5fe[0x0][_0x8959('0x4e')]+_0x19b5fe[0x0][_0x8959('0xe6')])/_0x19b5fe[0x0][_0x8959('0x54')];var _0x4234cb=_0x4cdd8c[_0x8959('0x1b4')]/0x64;_0x4cdd8c['predictiveIntervalPauses']=_0x1305b3[0x0]['outboundQueuePauses']||0x0;_0x4cdd8c['predictiveIntervalHitRate']=_0x523739>0x0?_0x523739:0x1;return _0x54b8d0['busyFactor'](_0x23288a,_0x1e0a7,_0x162c33,_0x523739,_0x4234cb);})[_0x8959('0xa1')](function(_0x30bece){return _0x592f81(_0x30bece);})[_0x8959('0xa0')](function(_0x4880fa){return _0x249834(msgResponse('[CatchErlangB]',_0x8959('0x94'),JSON[_0x8959('0x73')](_0x4880fa)));});}}else{return _0x249834(msgResponse('[getDataPredictive]',_0x8959('0x94'),'check\x20failure'));}});};};Dialer[_0x8959('0x1a')]['startMethodPredictive']=function(_0x421f3b){var _0x214e6b=this;return function(){var _0x688a2a=0x0;var _0x3cbe9b=Math[_0x8959('0x1b7')](_0x421f3b[_0x8959('0x5a')]*0x3e8);if(_0x3cbe9b>0x0){_0x3cbe9b=_0x3cbe9b<0x64?0x64:_0x3cbe9b;loggerPredictive[_0x8959('0x4b')](_0x421f3b['name'],_0x8959('0x1d3'),_0x3cbe9b,_0x8959('0x1d4'));_0x421f3b[_0x8959('0x62')]=setInterval(function(){_0x214e6b[_0x8959('0x62')](_0x421f3b);loggerPredictiveCalls[_0x8959('0x4b')](_0x8959('0x1d5'),_0x688a2a+=0x1);},_0x3cbe9b);}else{loggerPredictive['info'](_0x421f3b[_0x8959('0x49')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x8959('0x1a')][_0x8959('0x1d6')]=function(_0x5ef250,_0x1669f1){var _0x26efee=this;return function(_0x4278c9){if(_[_0x8959('0x79')](_0x4278c9)){if(_[_0x8959('0xf6')](_0x1669f1[_0x8959('0x14f')])||!_0x1669f1[_0x8959('0x1d7')]){if(_0x5ef250['dialMethod']===_0x8959('0x7')){_0x5ef250[_0x8959('0x71')]=_[_0x8959('0x41')](_0x5ef250[_0x8959('0x71')])?!![]:_0x5ef250[_0x8959('0x71')];var _0x342a3b=uuid['v4']();_0x26efee[_0x8959('0x25')][_0x342a3b]=new Action(_0x5ef250,_0x1669f1,_0x342a3b);loggerBooked['info']('[booked][checkContactBlack]',_0x342a3b,_0x8959('0x1d8'),JSON[_0x8959('0x73')](_0x5ef250['queueStatusComplete']),_0x8959('0x1d9'),_0x5ef250[_0x8959('0x49')]);if(_0x5ef250[_0x8959('0x71')]){_0x5ef250[_0x8959('0x71')]=![];_0x26efee[_0x8959('0x2a')][_0x26efee[_0x8959('0x25')][_0x342a3b]['queue']]=[];ami[_0x8959('0x99')]({'actionid':_0x342a3b,'action':'queuestatus','queue':_0x5ef250[_0x8959('0x49')]})['catch'](function(){_0x26efee[_0x8959('0xc2')](_0x5ef250);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x26efee[_0x8959('0x25')][_0x342a3b][_0x8959('0xde')],'ListId':_0x26efee['actions'][_0x342a3b][_0x8959('0xed')],'VoiceQueueId':_0x26efee[_0x8959('0x25')][_0x342a3b][_0x8959('0xee')]||undefined,'CampaignId':_0x26efee[_0x8959('0x25')][_0x342a3b]['CampaignId']||undefined})[_0x8959('0xa0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x26efee[_0x8959('0x25')][_0x342a3b];});}else{loggerBooked['info'](_0x8959('0x1da'),JSON[_0x8959('0x73')](_0x5ef250[_0x8959('0x71')]),_0x8959('0x1d9'),_0x5ef250[_0x8959('0x49')]);_0x26efee[_0x8959('0xc2')](_0x5ef250);hopperUtils[_0x8959('0xdb')]({'active':![],'ContactId':_0x26efee[_0x8959('0x25')][_0x342a3b][_0x8959('0xde')],'ListId':_0x26efee['actions'][_0x342a3b][_0x8959('0xed')],'VoiceQueueId':_0x26efee[_0x8959('0x25')][_0x342a3b][_0x8959('0xee')]||undefined,'CampaignId':_0x26efee[_0x8959('0x25')][_0x342a3b][_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x1db')));delete _0x26efee[_0x8959('0x25')][_0x342a3b];}}else{return _0x26efee[_0x8959('0x1dc')](_0x5ef250,_0x1669f1);}}else{if(utils[_0x8959('0x60')](undefined,_0x1669f1['scheduledat'])<_0x5ef250[_0x8959('0x1dd')]*0x3c){if(_0x1669f1[_0x8959('0x1de')]&&!_0x1669f1[_0x8959('0x1de')][_0x8959('0x1df')]){_0x26efee[_0x8959('0x1f')][_0x8959('0x101')](_0x1669f1['id'])[_0x8959('0x1d')](function(){_0x26efee[_0x8959('0xc2')](_0x5ef250);});}else{hopperUtils[_0x8959('0x1e0')]({'active':![]},_0x1669f1['id'],0x1)[_0x8959('0x1d')](function(){_0x26efee['updateOriginated'](_0x5ef250);});}}else{_0x5ef250[_0x8959('0x1e1')]+=0x1;_0x26efee[_0x8959('0xc2')](_0x5ef250);if(_0x5ef250[_0x8959('0x1e2')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1669f1[_0x8959('0xde')],'ListId':_0x1669f1[_0x8959('0xed')],'VoiceQueueId':_0x1669f1['VoiceQueueId']||undefined,'CampaignId':_0x1669f1[_0x8959('0xdf')]||undefined})[_0x8959('0xa0')](loggerCatch(_0x8959('0x1e3')));hopperUtils[_0x8959('0xc9')](createObjHistory(_0x5ef250,_0x1669f1,utils[_0x8959('0x6a')][_0x8959('0x1e4')],0x17,'RecallInQueue'))[_0x8959('0xa0')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x26efee[_0x8959('0x118')](createObjHistory(_0x5ef250,_0x1669f1,utils[_0x8959('0x6a')][_0x8959('0x1e5')],0x16,'RecallFailedTimeout'),_0x8959('0x1e6'),_0x8959('0x1e7'));}}}}else{_0x5ef250[_0x8959('0x1e8')]+=0x1;_0x26efee['saveInDb'](createObjHistory(_0x5ef250,_0x1669f1,utils[_0x8959('0x6a')][_0x8959('0x1e9')],0xd,_0x8959('0x1ea')),_0x8959('0x1eb'),'[Originate][MoveBlacklist]');throw _0x8959('0x1ec');}};};Dialer['prototype']['handleIvr']=function(_0x1f87ce){var _0xdd48c6=this;var _0x2dea2c=_0x1f87ce[_0x8959('0x1ed')]-_0x1f87ce[_0x8959('0x80')];emitCampaignSummary(_0x1f87ce);if(_0x2dea2c>0x0&&_0x1f87ce[_0x8959('0x1ee')]==0x0){if(_0x2dea2c>this[_0x8959('0x1ef')]){_0x2dea2c=this[_0x8959('0x1ef')];}_0x1f87ce['temp']=0x1;hopperUtils[_0x8959('0x1f0')](_0x1f87ce,_0x2dea2c)[_0x8959('0xa1')](function(_0x137e2f){_0x1f87ce[_0x8959('0x1ee')]=0x0;if(_0x137e2f){if(!utils[_0x8959('0x1f1')](_0x137e2f)){_0x1f87ce[_0x8959('0x66')]=utils[_0x8959('0x6a')][_0x8959('0x6b')];logger[_0x8959('0x4b')](_0x8959('0x1f2')+_0x1f87ce['name']);}else{_0x1f87ce[_0x8959('0x80')]+=_0x137e2f[_0x8959('0x97')];_0x1f87ce[_0x8959('0x66')]=utils[_0x8959('0x6a')]['RUNNING'];for(var _0x1f3edb=0x0;_0x1f3edb<_0x137e2f[_0x8959('0x97')];_0x1f3edb+=0x1){_0x1f87ce[_0x8959('0x1f3')]+=0x1;if(_[_0x8959('0xf6')](_0x137e2f[_0x1f3edb])||_[_0x8959('0xf6')](_0x137e2f[_0x1f3edb][_0x8959('0x170')])||_[_0x8959('0xf6')](_0x137e2f[_0x1f3edb]['phone'])){_0xdd48c6['emptyContact'](_0x8959('0x1f4'),_0x1f87ce,_0x137e2f[_0x1f3edb]);}else{hopperUtils[_0x8959('0x1f5')](_[_0x8959('0x74')](_0x137e2f[_0x1f3edb],['CampaignId',_0x8959('0x159')]))['then'](_0xdd48c6[_0x8959('0x1d6')](_0x1f87ce,_0x137e2f[_0x1f3edb]))[_0x8959('0xa0')](_0xdd48c6[_0x8959('0x14d')]('[actionOriginateIvr]\x20',_0x1f87ce));}}}}})['catch'](loggerGetContactDialer(_0x8959('0x1f6'),_0x1f87ce,_0x2dea2c));}};Dialer[_0x8959('0x1a')][_0x8959('0xb2')]=function(_0x28d443,_0x3e609b){var _0x46f18b=this;var _0x16061e=[];if(_0x3e609b<0x1||_0x28d443[_0x8959('0xaf')]==='booked'){_0x3e609b=0x1;}var _0xfd6e90=Math['floor'](_0x28d443[_0x8959('0x139')]*_0x3e609b)-_0x28d443[_0x8959('0x80')];if(_0x28d443[_0x8959('0x1f7')]>0x0){var _0x24091c=_0x28d443[_0x8959('0x1f7')]-_0x28d443[_0x8959('0x80')]-_0x28d443[_0x8959('0x13b')]-_0x28d443[_0x8959('0x1f8')];if(_0xfd6e90>_0x24091c){_0xfd6e90=_0x24091c;}}if(_0xfd6e90>0x0&&_0x28d443['temp']==0x0){if(_0x28d443[_0x8959('0xaf')]===_0x8959('0x7')){_0xfd6e90=0x1;}if(_0xfd6e90>this[_0x8959('0x1ef')]){_0xfd6e90=this['maxNumberOriginate'];}for(var _0x524bd0 in this[_0x8959('0x22')]){if(typeof this[_0x8959('0x22')][_0x524bd0]!==_0x8959('0x14a')){if(this[_0x8959('0x22')][_0x524bd0]['state']===_0x8959('0x1f9')&&this[_0x8959('0x22')][_0x524bd0][_0x8959('0x89')]===_0x8959('0x88')){_0x16061e[_0x8959('0x98')](this[_0x8959('0x22')][_0x524bd0]['id']);}}}_0x28d443[_0x8959('0x1ee')]=0x1;hopperUtils[_0x8959('0x1fa')](_0x28d443,_0x16061e,_0xfd6e90)['then'](function(_0x472a82){_0x28d443[_0x8959('0x1ee')]=0x0;if(_0x472a82){if(!utils[_0x8959('0x1f1')](_0x472a82)){hopperUtils[_0x8959('0x1fb')](_0x28d443)[_0x8959('0xa1')](sendMessageReschedule(_0x28d443))[_0x8959('0xa0')](loggerCatch(_0x8959('0x1fc')));}else{_0x28d443[_0x8959('0x80')]+=_0x472a82[_0x8959('0x97')];_0x28d443[_0x8959('0x66')]=_0x28d443[_0x8959('0xaf')]==='booked'?utils[_0x8959('0x6a')][_0x8959('0x13c')]:utils[_0x8959('0x6a')][_0x8959('0x1fd')];for(var _0x228266=0x0;_0x228266<_0x472a82[_0x8959('0x97')];_0x228266+=0x1){if(_[_0x8959('0xf6')](_0x472a82[_0x228266])||_['isNil'](_0x472a82[_0x228266][_0x8959('0x170')])||_[_0x8959('0xf6')](_0x472a82[_0x228266][_0x8959('0x159')])){_0x46f18b[_0x8959('0x1fe')](_0x8959('0x1f4'),_0x28d443,_0x472a82[_0x228266]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x472a82[_0x228266],[_0x8959('0xee'),'phone']))[_0x8959('0xa1')](_0x46f18b[_0x8959('0x1d6')](_0x28d443,_0x472a82[_0x228266]))[_0x8959('0xa0')](_0x46f18b[_0x8959('0x14d')]('[actionOriginate]\x20',_0x28d443));}}}}})[_0x8959('0xa0')](loggerGetContactDialer(_0x8959('0x1ff'),_0x28d443,_0xfd6e90));}};Dialer[_0x8959('0x1a')][_0x8959('0x62')]=function(_0x266e86){if(_0x266e86[_0x8959('0x1f7')]>0x0){var _0x483e18=_0x266e86[_0x8959('0x1f7')]-_0x266e86['originated']-_0x266e86[_0x8959('0x13b')];if(_0x483e18>0x0&&_0x266e86[_0x8959('0x1ee')]==0x0){this['tryOriginatePredictive'](_0x266e86);}else{loggerPredictiveCalls[_0x8959('0x4b')](_0x8959('0x200'));}}else{this[_0x8959('0x201')](_0x266e86);}};Dialer['prototype'][_0x8959('0x201')]=function(_0x2a5ebf){var _0x53ada6=this;var _0xa96ba0=[];_0x2a5ebf[_0x8959('0x80')]+=0x1;for(var _0x171e03 in this[_0x8959('0x22')]){if(typeof this[_0x8959('0x22')][_0x171e03]!=='undefined'){if(this[_0x8959('0x22')][_0x171e03][_0x8959('0x6d')]===_0x8959('0x1f9')&&this['agents'][_0x171e03][_0x8959('0x89')]===_0x8959('0x88')){_0xa96ba0['push'](this[_0x8959('0x22')][_0x171e03]['id']);}}}_0x2a5ebf[_0x8959('0x1ee')]=0x1;return this[_0x8959('0x1fa')](_0x2a5ebf['id'],_0xa96ba0,0x1,_0x2a5ebf['dialOrderByScheduledAt'],_0x2a5ebf)[_0x8959('0xa1')](function(_0x206be7){_0x2a5ebf[_0x8959('0x1ee')]=0x1;if(_0x206be7){if(!utils[_0x8959('0x1f1')](_0x206be7)){utils[_0x8959('0x65')](_0x2a5ebf,0x1,0x0);return hopperUtils[_0x8959('0x1fb')](_0x2a5ebf)[_0x8959('0xa1')](sendMessageReschedule(_0x2a5ebf))[_0x8959('0xa0')](loggerCatch(_0x8959('0x1fc')));}else{_0x2a5ebf[_0x8959('0x66')]=utils['CAMPAIGN_STATUS']['RUNNING'];if(_[_0x8959('0xf6')](_0x206be7[0x0])||_[_0x8959('0xf6')](_0x206be7[0x0][_0x8959('0x170')])||_['isNil'](_0x206be7[0x0][_0x8959('0x159')])){_0x53ada6[_0x8959('0x1fe')](_0x8959('0x1f4'),_0x2a5ebf,_0x206be7[0x0]);}else{return hopperUtils[_0x8959('0x202')](_[_0x8959('0x74')](_0x206be7[0x0],[_0x8959('0xee'),_0x8959('0x159')]))[_0x8959('0xa1')](_0x53ada6[_0x8959('0x1d6')](_0x2a5ebf,_0x206be7[0x0]))[_0x8959('0xa0')](_0x53ada6[_0x8959('0x14d')](_0x8959('0x203'),_0x2a5ebf));}}}})[_0x8959('0xa0')](loggerGetContactDialer(_0x8959('0x204'),_0x2a5ebf,0x1));};Dialer[_0x8959('0x1a')][_0x8959('0x1ca')]=function(_0x423c67,_0x16fb8e,_0x216888,_0x27b3f4,_0x55e4b3,_0x3df253){loggerPredictive[_0x8959('0x4b')](_0x8959('0x205'));loggerPredictive[_0x8959('0x4b')](_0x8959('0x206'),_0x423c67);loggerPredictive[_0x8959('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16fb8e);loggerPredictive[_0x8959('0x4b')](_0x8959('0x207'),_0x216888);loggerPredictive[_0x8959('0x4b')](_0x8959('0x208'),_0x27b3f4);loggerPredictive[_0x8959('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55e4b3);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5e'));return new Promise(function(_0x2026b6,_0x5bdab4){if(_0x423c67<=0x0||isNaN(_0x423c67)){return _0x5bdab4(msgResponse(_0x8959('0x209'),'Error',_0x8959('0x20a')+_0x423c67));}if(_0x216888<=0x0||isNaN(_0x216888)){return _0x5bdab4(msgResponse(_0x8959('0x209'),'Error','Ts\x20=\x20'+_0x216888));}if(_0x27b3f4<=0x0||isNaN(_0x27b3f4)){return _0x5bdab4(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x27b3f4));}if(_0x16fb8e<=0x0||isNaN(_0x16fb8e)){return _0x5bdab4(msgResponse(_0x8959('0x209'),_0x8959('0x84'),'interval\x20=\x20'+_0x16fb8e));}if(_0x55e4b3<=0x0||isNaN(_0x55e4b3)){return _0x5bdab4(msgResponse('[abandonmentRate]',_0x8959('0x84'),_0x8959('0x20b')+_0x55e4b3));}_0x3df253=_0x3df253||0x0;var _0x126ad9=0x1/_0x216888;var _0x4923a3=0x0;var _0x4cfbb2=0x0;var _0x2b8471=0x0;var _0xadb764=0x0;for(var _0x11fd0e=0x0;_0x2b8471<_0x55e4b3;_0x11fd0e+=0x1){_0x4cfbb2=_0x11fd0e/_0x16fb8e;_0x4923a3=(_0x27b3f4*_0x4cfbb2+_0x3df253)/_0x126ad9;_0x2b8471=utils[_0x8959('0x20c')](_0x4923a3,_0x423c67);_0xadb764=_0x4923a3/_0x423c67*(0x1-utils['erlangb'](_0x4923a3,_0x423c67));}return _0x2026b6({'erlangCalls':_0x11fd0e,'erlangCallToSecond':_0x16fb8e/_0x11fd0e,'erlangAbandonmentRate':_0x2b8471,'erlangBusyFactor':_0xadb764});});};Dialer[_0x8959('0x1a')]['busyFactor']=function(_0x5549b7,_0x260304,_0xe9f325,_0x41d05f,_0x2c556e,_0x4a62d2){loggerPredictive[_0x8959('0x4b')](_0x8959('0x20d'));loggerPredictive[_0x8959('0x4b')]('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',_0x5549b7);loggerPredictive[_0x8959('0x4b')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x260304);loggerPredictive['info'](_0x8959('0x207'),_0xe9f325);loggerPredictive[_0x8959('0x4b')](_0x8959('0x208'),_0x41d05f);loggerPredictive[_0x8959('0x4b')](_0x8959('0x20e'),_0x2c556e);loggerPredictive[_0x8959('0x4b')](_0x8959('0x5e'));return new Promise(function(_0xa8d90e,_0x407b2b){if(_0x5549b7<=0x0||isNaN(_0x5549b7)){return _0x407b2b(msgResponse(_0x8959('0x20f'),_0x8959('0x84'),_0x8959('0x20a')+_0x5549b7));}if(_0xe9f325<=0x0||isNaN(_0xe9f325)){return _0x407b2b(msgResponse('[busyFactor]',_0x8959('0x84'),_0x8959('0x210')+_0xe9f325));}if(_0x41d05f<=0x0||isNaN(_0x41d05f)){return _0x407b2b(msgResponse(_0x8959('0x20f'),'Error',_0x8959('0x211')+_0x41d05f));}if(_0x260304<=0x0||isNaN(_0x260304)){return _0x407b2b(msgResponse(_0x8959('0x20f'),'Error',_0x8959('0x212')+_0x260304));}if(_0x2c556e<=0x0||isNaN(_0x2c556e)){return _0x407b2b(msgResponse('[busyFactor]',_0x8959('0x84'),'Umin\x20=\x20'+_0x2c556e));}_0x4a62d2=_0x4a62d2||0x0;var _0xe0c171=0x1/_0xe9f325;var _0x403a30=0x0;var _0x244d00=0x0;var _0x291e30=0x0;var _0xff93cf=0x0;for(var _0x1b2c36=0x0;_0xff93cf<_0x2c556e;_0x1b2c36+=0x1){_0x244d00=_0x1b2c36/_0x260304;_0x403a30=(_0x41d05f*_0x244d00+_0x4a62d2)/_0xe0c171;_0x291e30=utils['erlangb'](_0x403a30,_0x5549b7);_0xff93cf=_0x403a30/_0x5549b7*(0x1-utils[_0x8959('0x20c')](_0x403a30,_0x5549b7));}return _0xa8d90e({'erlangCalls':_0x1b2c36,'erlangCallToSecond':_0x260304/_0x1b2c36,'erlangAbandonmentRate':_0x291e30,'erlangBusyFactor':_0xff93cf});});};module[_0x8959('0x213')]=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 8083523..5339cf2 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 _0xc47a=['dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','lastName','number','queue','name','type'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc47a,0x14a));var _0xac47=function(_0x5c6214,_0x3c349c){_0x5c6214=_0x5c6214-0x0;var _0x38fc7d=_0xc47a[_0x5c6214];return _0x38fc7d;};'use strict';var util=require(_0xac47('0x0'));var _=require(_0xac47('0x1'));var moment=require(_0xac47('0x2'));function checkNameSurname(_0x29afc3,_0x46f9f5,_0x1d6de2){var _0x4161c2='';if(!_[_0xac47('0x3')](_0x46f9f5)&&_0xac47('0x4')===typeof _0x46f9f5){_0x4161c2+=_0x46f9f5;}if(!_[_0xac47('0x3')](_0x1d6de2)&&_0xac47('0x4')===typeof _0x1d6de2){_0x4161c2+='\x20'+_0x1d6de2;}if(_0x4161c2!==''){return _0x4161c2;}return _0x29afc3;}function Action(_0x416d52,_0x10bb36,_0x585cc0){this[_0xac47('0x5')]=_0x416d52;this[_0xac47('0x6')]=_0x585cc0||undefined;this['name']=checkNameSurname(_0x10bb36[_0xac47('0x7')]['phone'],_0x10bb36['Contact'][_0xac47('0x8')],_0x10bb36[_0xac47('0x7')][_0xac47('0x9')]);this[_0xac47('0xa')]=_0x10bb36['phone'];this[_0xac47('0xb')]=_0x416d52[_0xac47('0xc')];this['active']=_0x10bb36['active']||![];this[_0xac47('0xd')]=_0x416d52['type'];this[_0xac47('0xe')]=_0x416d52[_0xac47('0xe')]||0x3;this['scheduledat']=_0x10bb36['scheduledat'];this['countbusyretry']=_0x10bb36[_0xac47('0xf')];this['countcongestionretry']=_0x10bb36[_0xac47('0x10')];this[_0xac47('0x11')]=_0x10bb36[_0xac47('0x11')];this[_0xac47('0x12')]=_0x10bb36[_0xac47('0x12')];this[_0xac47('0x13')]=_0x10bb36[_0xac47('0x13')];this['countabandonedretry']=_0x10bb36[_0xac47('0x14')];this[_0xac47('0x15')]=_0x10bb36[_0xac47('0x15')];this[_0xac47('0x16')]=_0x10bb36[_0xac47('0x16')];this[_0xac47('0x17')]=_0x10bb36[_0xac47('0x17')];this[_0xac47('0x18')]=_0x10bb36[_0xac47('0x18')];this[_0xac47('0x19')]=_0x10bb36[_0xac47('0x19')];this['VoiceQueueId']=_0x10bb36[_0xac47('0x1a')];this[_0xac47('0x1b')]=_0x10bb36[_0xac47('0x1b')];this[_0xac47('0x1c')]=_0x10bb36['id'];this[_0xac47('0x1d')]=_0x10bb36['Contact']['firstName']||'';this[_0xac47('0x1e')]=moment()['format'](_0xac47('0x1f'));this[_0xac47('0x20')]=_0x10bb36[_0xac47('0x20')];this[_0xac47('0x21')]=_0x10bb36[_0xac47('0x21')];this[_0xac47('0x22')]=_0x10bb36[_0xac47('0x22')];this['recallme']=_0x10bb36[_0xac47('0x23')];this['originatecalleridnum']='';this[_0xac47('0x24')]='';}Action[_0xac47('0x25')][_0xac47('0x26')]=function(){return util[_0xac47('0x27')]('\x22%s\x22\x20<%s>',this[_0xac47('0xc')],this[_0xac47('0x5')][_0xac47('0x28')]>0x0?this[_0xac47('0xa')][_0xac47('0x29')](this[_0xac47('0x5')][_0xac47('0x28')]):this['number']);};Action[_0xac47('0x25')][_0xac47('0x2a')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x7e99=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','queue','type'];(function(_0xc78832,_0x27a347){var _0x21753a=function(_0x2efa96){while(--_0x2efa96){_0xc78832['push'](_0xc78832['shift']());}};_0x21753a(++_0x27a347);}(_0x7e99,0x16d));var _0x97e9=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x7e99[_0xc4001c];return _0x49f7bc;};'use strict';var util=require('util');var _=require(_0x97e9('0x0'));var moment=require(_0x97e9('0x1'));function checkNameSurname(_0x4b7fbc,_0x47d5c3,_0xf067f7){var _0x41dbe6='';if(!_[_0x97e9('0x2')](_0x47d5c3)&&_0x97e9('0x3')===typeof _0x47d5c3){_0x41dbe6+=_0x47d5c3;}if(!_[_0x97e9('0x2')](_0xf067f7)&&_0x97e9('0x3')===typeof _0xf067f7){_0x41dbe6+='\x20'+_0xf067f7;}if(_0x41dbe6!==''){return _0x41dbe6;}return _0x4b7fbc;}function Action(_0x51c8cb,_0x443aa5,_0x57c214){this[_0x97e9('0x4')]=_0x51c8cb;this[_0x97e9('0x5')]=_0x57c214||undefined;this[_0x97e9('0x6')]=checkNameSurname(_0x443aa5[_0x97e9('0x7')]['phone'],_0x443aa5[_0x97e9('0x7')][_0x97e9('0x8')],_0x443aa5[_0x97e9('0x7')][_0x97e9('0x9')]);this[_0x97e9('0xa')]=_0x443aa5['phone'];this[_0x97e9('0xb')]=_0x51c8cb[_0x97e9('0x6')];this['active']=_0x443aa5['active']||![];this[_0x97e9('0xc')]=_0x51c8cb[_0x97e9('0xc')];this[_0x97e9('0xd')]=_0x51c8cb[_0x97e9('0xd')]||0x3;this[_0x97e9('0xe')]=_0x443aa5['scheduledat'];this[_0x97e9('0xf')]=_0x443aa5['countbusyretry'];this[_0x97e9('0x10')]=_0x443aa5[_0x97e9('0x10')];this[_0x97e9('0x11')]=_0x443aa5[_0x97e9('0x11')];this[_0x97e9('0x12')]=_0x443aa5[_0x97e9('0x12')];this[_0x97e9('0x13')]=_0x443aa5[_0x97e9('0x13')];this['countabandonedretry']=_0x443aa5[_0x97e9('0x14')];this['countmachineretry']=_0x443aa5[_0x97e9('0x15')];this['countagentrejectretry']=_0x443aa5[_0x97e9('0x16')];this['ContactId']=_0x443aa5['ContactId'];this['ListId']=_0x443aa5[_0x97e9('0x17')];this[_0x97e9('0x18')]=_0x443aa5[_0x97e9('0x18')];this[_0x97e9('0x19')]=_0x443aa5['VoiceQueueId'];this['CampaignId']=_0x443aa5[_0x97e9('0x1a')];this[_0x97e9('0x1b')]=_0x443aa5['id'];this['ContactFirstName']=_0x443aa5['Contact'][_0x97e9('0x8')]||'';this['starttime']=moment()[_0x97e9('0x1c')](_0x97e9('0x1d'));this[_0x97e9('0x1e')]=_0x443aa5[_0x97e9('0x1e')];this[_0x97e9('0x1f')]=_0x443aa5['callbackuniqueid'];this[_0x97e9('0x20')]=_0x443aa5['callbackat'];this[_0x97e9('0x21')]=_0x443aa5[_0x97e9('0x21')];this['originatecalleridnum']='';this[_0x97e9('0x22')]='';}Action[_0x97e9('0x23')][_0x97e9('0x24')]=function(){return util['format'](_0x97e9('0x25'),this[_0x97e9('0x6')],this[_0x97e9('0x4')][_0x97e9('0x26')]>0x0?this[_0x97e9('0xa')][_0x97e9('0x27')](this[_0x97e9('0x4')][_0x97e9('0x26')]):this[_0x97e9('0xa')]);};Action[_0x97e9('0x23')][_0x97e9('0x28')]=function(){return this['queue'];};module[_0x97e9('0x29')]=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 0f2759b..dcebf56 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 _0xf82d=['countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf82d,0x6f));var _0xdf82=function(_0xdff2bf,_0x39d52a){_0xdff2bf=_0xdff2bf-0x0;var _0x57436b=_0xf82d[_0xdff2bf];return _0x57436b;};'use strict';var moment=require('moment');var utils=require(_0xdf82('0x0'));function AgentComplete(_0x225f27,_0x1c4490){this[_0xdf82('0x1')]=0x4;this[_0xdf82('0x2')]='Answer';this[_0xdf82('0x3')]=_0x225f27[_0xdf82('0x3')];this[_0xdf82('0x4')]=_0x225f27[_0xdf82('0x4')];this[_0xdf82('0x5')]=_0x225f27['type']==='outbound'?_0xdf82('0x6'):_0x225f27['type'];this[_0xdf82('0x7')]=_0x225f27[_0xdf82('0x7')];this[_0xdf82('0x8')]=_0x225f27[_0xdf82('0x8')];this[_0xdf82('0x9')]=_0x225f27[_0xdf82('0x9')];this[_0xdf82('0xa')]=_0x225f27['countbusyretry']+_0x225f27['countcongestionretry']+_0x225f27[_0xdf82('0x9')]+_0x225f27[_0xdf82('0xb')]+_0x225f27[_0xdf82('0xc')]+_0x225f27[_0xdf82('0xd')]+_0x225f27[_0xdf82('0xe')]+_0x225f27['countagentrejectretry'];this['countnosuchnumberretry']=_0x225f27[_0xdf82('0xb')];this['countdropretry']=_0x225f27[_0xdf82('0xc')];this[_0xdf82('0xd')]=_0x225f27[_0xdf82('0xd')];this[_0xdf82('0xe')]=_0x225f27['countmachineretry'];this[_0xdf82('0xf')]=_0x225f27[_0xdf82('0xf')];this[_0xdf82('0x10')]=_0x1c4490[_0xdf82('0x10')];this['calleridname']=_0x225f27[_0xdf82('0x11')];this[_0xdf82('0x12')]=_0x225f27[_0xdf82('0x13')];this[_0xdf82('0x14')]=_0x225f27[_0xdf82('0x14')];this['responsetime']=_0x225f27[_0xdf82('0x15')];this[_0xdf82('0x16')]=_0x225f27['answertime'];this[_0xdf82('0x17')]=moment()[_0xdf82('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdf82('0x19')]=utils[_0xdf82('0x1a')](_0x225f27['responsetime'],_0x225f27[_0xdf82('0x14')]);this['holdtime']=utils[_0xdf82('0x1a')](_0x225f27[_0xdf82('0x16')],_0x225f27[_0xdf82('0x15')]);this[_0xdf82('0x1b')]=utils[_0xdf82('0x1a')](this[_0xdf82('0x17')],_0x225f27['answertime']);this['queue']=_0x1c4490['queue'];this['membername']=_0x1c4490['membername'];this[_0xdf82('0x1c')]=_0x1c4490[_0xdf82('0x1c')];this[_0xdf82('0x1d')]=_0x225f27['callback'];this[_0xdf82('0x1e')]=_0x225f27[_0xdf82('0x1e')];this[_0xdf82('0x1f')]=_0x225f27[_0xdf82('0x1f')];this[_0xdf82('0x20')]=_0x225f27[_0xdf82('0x20')];this['ContactId']=_0x225f27[_0xdf82('0x21')];this[_0xdf82('0x22')]=_0x225f27[_0xdf82('0x22')];this[_0xdf82('0x23')]=_0x225f27[_0xdf82('0x23')];this[_0xdf82('0x24')]=_0x225f27[_0xdf82('0x24')];this[_0xdf82('0x25')]=_0x225f27[_0xdf82('0x25')];this['originatecalleridnum']=_0x225f27[_0xdf82('0x26')]||'';this[_0xdf82('0x27')]=_0x225f27[_0xdf82('0x27')]||'';this[_0xdf82('0x28')]=_0x225f27[_0xdf82('0x28')];}module[_0xdf82('0x29')]=AgentComplete; \ No newline at end of file +var _0x3a15=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme'];(function(_0x2afa77,_0x5ad1de){var _0x301008=function(_0x4e3f32){while(--_0x4e3f32){_0x2afa77['push'](_0x2afa77['shift']());}};_0x301008(++_0x5ad1de);}(_0x3a15,0x199));var _0x53a1=function(_0x5e43f4,_0x47ea74){_0x5e43f4=_0x5e43f4-0x0;var _0x3bcd34=_0x3a15[_0x5e43f4];return _0x3bcd34;};'use strict';var moment=require(_0x53a1('0x0'));var utils=require('../utils');function AgentComplete(_0xf1c7a,_0x4d5baa){this[_0x53a1('0x1')]=0x4;this[_0x53a1('0x2')]=_0x53a1('0x3');this['scheduledat']=_0xf1c7a['scheduledat'];this[_0x53a1('0x4')]=_0xf1c7a['type'];this['campaigntype']=_0xf1c7a[_0x53a1('0x4')]===_0x53a1('0x5')?_0x53a1('0x6'):_0xf1c7a[_0x53a1('0x4')];this['countbusyretry']=_0xf1c7a['countbusyretry'];this[_0x53a1('0x7')]=_0xf1c7a[_0x53a1('0x7')];this[_0x53a1('0x8')]=_0xf1c7a[_0x53a1('0x8')];this['countglobal']=_0xf1c7a[_0x53a1('0x9')]+_0xf1c7a[_0x53a1('0x7')]+_0xf1c7a[_0x53a1('0x8')]+_0xf1c7a['countnosuchnumberretry']+_0xf1c7a[_0x53a1('0xa')]+_0xf1c7a[_0x53a1('0xb')]+_0xf1c7a[_0x53a1('0xc')]+_0xf1c7a[_0x53a1('0xd')];this['countnosuchnumberretry']=_0xf1c7a[_0x53a1('0xe')];this['countdropretry']=_0xf1c7a[_0x53a1('0xa')];this[_0x53a1('0xb')]=_0xf1c7a[_0x53a1('0xb')];this[_0x53a1('0xc')]=_0xf1c7a[_0x53a1('0xc')];this[_0x53a1('0xd')]=_0xf1c7a[_0x53a1('0xd')];this[_0x53a1('0xf')]=_0x4d5baa[_0x53a1('0xf')];this['calleridname']=_0xf1c7a[_0x53a1('0x10')];this['calleridnum']=_0xf1c7a['number'];this[_0x53a1('0x11')]=_0xf1c7a[_0x53a1('0x11')];this[_0x53a1('0x12')]=_0xf1c7a[_0x53a1('0x12')];this[_0x53a1('0x13')]=_0xf1c7a[_0x53a1('0x13')];this[_0x53a1('0x14')]=moment()['format'](_0x53a1('0x15'));this[_0x53a1('0x16')]=utils[_0x53a1('0x17')](_0xf1c7a['responsetime'],_0xf1c7a['starttime']);this[_0x53a1('0x18')]=utils[_0x53a1('0x17')](_0xf1c7a['answertime'],_0xf1c7a[_0x53a1('0x12')]);this[_0x53a1('0x19')]=utils[_0x53a1('0x17')](this[_0x53a1('0x14')],_0xf1c7a['answertime']);this['queue']=_0x4d5baa['queue'];this[_0x53a1('0x1a')]=_0x4d5baa['membername'];this[_0x53a1('0x1b')]=_0x4d5baa['reason'];this['callback']=_0xf1c7a['callback'];this[_0x53a1('0x1c')]=_0xf1c7a['callbackuniqueid'];this[_0x53a1('0x1d')]=_0xf1c7a[_0x53a1('0x1d')];this[_0x53a1('0x1e')]=_0xf1c7a[_0x53a1('0x1e')];this[_0x53a1('0x1f')]=_0xf1c7a[_0x53a1('0x1f')];this[_0x53a1('0x20')]=_0xf1c7a[_0x53a1('0x20')];this['UserId']=_0xf1c7a[_0x53a1('0x21')];this[_0x53a1('0x22')]=_0xf1c7a[_0x53a1('0x22')];this[_0x53a1('0x23')]=_0xf1c7a['CampaignId'];this[_0x53a1('0x24')]=_0xf1c7a[_0x53a1('0x24')]||'';this['originatecalleridname']=_0xf1c7a[_0x53a1('0x25')]||'';this[_0x53a1('0x26')]=_0xf1c7a[_0x53a1('0x26')];}module[_0x53a1('0x27')]=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 11e668d..1345fb1 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 _0x45af=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x5f14f3,_0xdaad2e){var _0x8d5420=function(_0x43222d){while(--_0x43222d){_0x5f14f3['push'](_0x5f14f3['shift']());}};_0x8d5420(++_0xdaad2e);}(_0x45af,0x17e));var _0xf45a=function(_0x531c3a,_0x144c58){_0x531c3a=_0x531c3a-0x0;var _0x246e2e=_0x45af[_0x531c3a];return _0x246e2e;};'use strict';function Final(_0x3d3b85){this['uniqueid']=_0x3d3b85[_0xf45a('0x0')];this[_0xf45a('0x1')]=_0x3d3b85[_0xf45a('0x1')];this[_0xf45a('0x2')]=_0x3d3b85[_0xf45a('0x2')];this['campaigntype']=_0x3d3b85[_0xf45a('0x2')]===_0xf45a('0x3')?_0xf45a('0x4'):_0x3d3b85[_0xf45a('0x2')];this[_0xf45a('0x5')]=_0x3d3b85['countbusyretry'];this[_0xf45a('0x6')]=_0x3d3b85[_0xf45a('0x6')];this[_0xf45a('0x7')]=_0x3d3b85[_0xf45a('0x7')];this[_0xf45a('0x8')]=_0x3d3b85[_0xf45a('0x5')]+_0x3d3b85[_0xf45a('0x6')]+_0x3d3b85[_0xf45a('0x7')]+_0x3d3b85[_0xf45a('0x9')]+_0x3d3b85[_0xf45a('0xa')]+_0x3d3b85[_0xf45a('0xb')]+_0x3d3b85[_0xf45a('0xc')]+_0x3d3b85[_0xf45a('0xd')];this[_0xf45a('0x9')]=_0x3d3b85[_0xf45a('0x9')];this['countdropretry']=_0x3d3b85['countdropretry'];this[_0xf45a('0xb')]=_0x3d3b85['countabandonedretry'];this[_0xf45a('0xc')]=_0x3d3b85[_0xf45a('0xc')];this[_0xf45a('0xd')]=_0x3d3b85[_0xf45a('0xd')];this[_0xf45a('0x4')]=_0x3d3b85[_0xf45a('0x4')];this['calleridname']=_0x3d3b85[_0xf45a('0xe')];this[_0xf45a('0xf')]=_0x3d3b85[_0xf45a('0xf')];this['starttime']=_0x3d3b85['starttime'];this['responsetime']=_0x3d3b85['responsetime'];this[_0xf45a('0x10')]=_0x3d3b85['responsetime'];this[_0xf45a('0x11')]=_0x3d3b85['ringtime']||0x0;this[_0xf45a('0x12')]=_0x3d3b85[_0xf45a('0x12')]||0x0;this['talktime']=_0x3d3b85[_0xf45a('0x13')]||0x0;this[_0xf45a('0x14')]=_0x3d3b85[_0xf45a('0x14')];this[_0xf45a('0x15')]=_0x3d3b85[_0xf45a('0x15')];this[_0xf45a('0x16')]=_0x3d3b85['callbackat'];this[_0xf45a('0x17')]=_0x3d3b85[_0xf45a('0x17')];this[_0xf45a('0x18')]=_0x3d3b85[_0xf45a('0x18')];this['ListId']=_0x3d3b85[_0xf45a('0x19')];this[_0xf45a('0x1a')]=_0x3d3b85[_0xf45a('0x1a')];this[_0xf45a('0x1b')]=_0x3d3b85[_0xf45a('0x1b')];this['CampaignId']=_0x3d3b85[_0xf45a('0x1c')];this['originatecalleridnum']=_0x3d3b85[_0xf45a('0x1d')]||'';this['originatecalleridname']=_0x3d3b85[_0xf45a('0x1e')]||'';this[_0xf45a('0x1f')]=_0x3d3b85[_0xf45a('0x1f')];this['statedesc']=_0x3d3b85[_0xf45a('0x20')];}module[_0xf45a('0x21')]=Final; \ No newline at end of file +var _0xcb4e=['ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x20dc9b,_0x2c80b4){var _0x5074ee=function(_0x31b19e){while(--_0x31b19e){_0x20dc9b['push'](_0x20dc9b['shift']());}};_0x5074ee(++_0x2c80b4);}(_0xcb4e,0x104));var _0xecb4=function(_0x401e0d,_0x48acb3){_0x401e0d=_0x401e0d-0x0;var _0x5da4d4=_0xcb4e[_0x401e0d];return _0x5da4d4;};'use strict';function Final(_0x3497eb){this[_0xecb4('0x0')]=_0x3497eb[_0xecb4('0x0')];this[_0xecb4('0x1')]=_0x3497eb['scheduledat'];this['type']=_0x3497eb[_0xecb4('0x2')];this[_0xecb4('0x3')]=_0x3497eb[_0xecb4('0x2')]===_0xecb4('0x4')?_0xecb4('0x5'):_0x3497eb[_0xecb4('0x2')];this[_0xecb4('0x6')]=_0x3497eb[_0xecb4('0x6')];this['countcongestionretry']=_0x3497eb[_0xecb4('0x7')];this['countnoanswerretry']=_0x3497eb[_0xecb4('0x8')];this[_0xecb4('0x9')]=_0x3497eb['countbusyretry']+_0x3497eb[_0xecb4('0x7')]+_0x3497eb[_0xecb4('0x8')]+_0x3497eb['countnosuchnumberretry']+_0x3497eb['countdropretry']+_0x3497eb[_0xecb4('0xa')]+_0x3497eb[_0xecb4('0xb')]+_0x3497eb[_0xecb4('0xc')];this[_0xecb4('0xd')]=_0x3497eb['countnosuchnumberretry'];this[_0xecb4('0xe')]=_0x3497eb[_0xecb4('0xe')];this[_0xecb4('0xa')]=_0x3497eb['countabandonedretry'];this['countmachineretry']=_0x3497eb['countmachineretry'];this['countagentrejectretry']=_0x3497eb[_0xecb4('0xc')];this[_0xecb4('0x5')]=_0x3497eb[_0xecb4('0x5')];this[_0xecb4('0xf')]=_0x3497eb[_0xecb4('0xf')];this[_0xecb4('0x10')]=_0x3497eb[_0xecb4('0x10')];this['starttime']=_0x3497eb[_0xecb4('0x11')];this[_0xecb4('0x12')]=_0x3497eb['responsetime'];this[_0xecb4('0x13')]=_0x3497eb[_0xecb4('0x12')];this[_0xecb4('0x14')]=_0x3497eb[_0xecb4('0x14')]||0x0;this[_0xecb4('0x15')]=_0x3497eb[_0xecb4('0x15')]||0x0;this[_0xecb4('0x16')]=_0x3497eb['talktime']||0x0;this[_0xecb4('0x17')]=_0x3497eb[_0xecb4('0x17')];this[_0xecb4('0x18')]=_0x3497eb[_0xecb4('0x18')];this['callbackat']=_0x3497eb['callbackat'];this[_0xecb4('0x19')]=_0x3497eb[_0xecb4('0x19')];this[_0xecb4('0x1a')]=_0x3497eb['ContactId'];this[_0xecb4('0x1b')]=_0x3497eb[_0xecb4('0x1b')];this[_0xecb4('0x1c')]=_0x3497eb['UserId'];this[_0xecb4('0x1d')]=_0x3497eb[_0xecb4('0x1d')];this[_0xecb4('0x1e')]=_0x3497eb[_0xecb4('0x1e')];this[_0xecb4('0x1f')]=_0x3497eb[_0xecb4('0x1f')]||'';this['originatecalleridname']=_0x3497eb['originatecalleridname']||'';this[_0xecb4('0x20')]=_0x3497eb[_0xecb4('0x20')];this[_0xecb4('0x21')]=_0x3497eb[_0xecb4('0x21')];}module[_0xecb4('0x22')]=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 9f86f1d..4bd90ec 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 _0x77b9=['IVR','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername'];(function(_0x43e2c6,_0x41ff95){var _0x105324=function(_0x45b609){while(--_0x45b609){_0x43e2c6['push'](_0x43e2c6['shift']());}};_0x105324(++_0x41ff95);}(_0x77b9,0x15b));var _0x977b=function(_0x209094,_0x20f1e6){_0x209094=_0x209094-0x0;var _0x569c4b=_0x77b9[_0x209094];return _0x569c4b;};'use strict';var moment=require(_0x977b('0x0'));var utils=require(_0x977b('0x1'));function Hangup(_0xa7dc0f,_0x571cf7){this[_0x977b('0x2')]=0x4;this['statedesc']=_0x977b('0x3');this[_0x977b('0x4')]=_0xa7dc0f[_0x977b('0x4')];this['type']=_0xa7dc0f[_0x977b('0x5')];this[_0x977b('0x6')]=_0xa7dc0f[_0x977b('0x5')]===_0x977b('0x7')?_0x977b('0x8'):_0xa7dc0f[_0x977b('0x5')];this[_0x977b('0x9')]=_0xa7dc0f[_0x977b('0x9')]||![];this[_0x977b('0xa')]=_0xa7dc0f[_0x977b('0xa')];this['countcongestionretry']=_0xa7dc0f[_0x977b('0xb')];this['countnoanswerretry']=_0xa7dc0f[_0x977b('0xc')];this[_0x977b('0xd')]=_0xa7dc0f[_0x977b('0xa')]+_0xa7dc0f[_0x977b('0xb')]+_0xa7dc0f[_0x977b('0xc')]+_0xa7dc0f[_0x977b('0xe')]+_0xa7dc0f[_0x977b('0xf')]+_0xa7dc0f[_0x977b('0x10')]+_0xa7dc0f['countmachineretry']+_0xa7dc0f[_0x977b('0x11')];this[_0x977b('0xe')]=_0xa7dc0f[_0x977b('0xe')];this[_0x977b('0xf')]=_0xa7dc0f[_0x977b('0xf')];this[_0x977b('0x10')]=_0xa7dc0f[_0x977b('0x10')];this[_0x977b('0x12')]=_0xa7dc0f[_0x977b('0x12')];this[_0x977b('0x11')]=_0xa7dc0f[_0x977b('0x11')];this[_0x977b('0x13')]=_0x571cf7[_0x977b('0x13')];this[_0x977b('0x14')]=_0xa7dc0f['name'];this[_0x977b('0x15')]=_0xa7dc0f['number'];this[_0x977b('0x16')]=_0xa7dc0f[_0x977b('0x16')];this[_0x977b('0x17')]=_0xa7dc0f['responsetime'];this[_0x977b('0x18')]=moment()[_0x977b('0x19')](_0x977b('0x1a'));this['ringtime']=utils[_0x977b('0x1b')](_0xa7dc0f['responsetime'],_0xa7dc0f[_0x977b('0x16')]);this[_0x977b('0x1c')]=0x0;this[_0x977b('0x1d')]=utils['getSeconds'](this[_0x977b('0x18')],_0xa7dc0f[_0x977b('0x17')]);this[_0x977b('0x8')]=_0xa7dc0f[_0x977b('0x8')];this[_0x977b('0x1e')]=_0x977b('0x1f');this[_0x977b('0x20')]=_0x571cf7['cause-txt'];this[_0x977b('0x21')]=_0xa7dc0f['callback'];this['callbackuniqueid']=_0xa7dc0f[_0x977b('0x22')];this[_0x977b('0x23')]=_0xa7dc0f[_0x977b('0x23')];this[_0x977b('0x24')]=_0xa7dc0f[_0x977b('0x24')];this['ContactId']=_0xa7dc0f['ContactId'];this[_0x977b('0x25')]=_0xa7dc0f[_0x977b('0x25')];this['UserId']=_0xa7dc0f[_0x977b('0x26')];this['VoiceQueueId']=_0xa7dc0f[_0x977b('0x27')];this[_0x977b('0x28')]=_0xa7dc0f[_0x977b('0x28')];}module[_0x977b('0x29')]=Hangup; \ No newline at end of file +var _0x91a2=['ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x48411e,_0x40e028){var _0x341cb2=function(_0x3f7aa7){while(--_0x3f7aa7){_0x48411e['push'](_0x48411e['shift']());}};_0x341cb2(++_0x40e028);}(_0x91a2,0x1e9));var _0x291a=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x91a2[_0xf55e73];return _0x116b99;};'use strict';var moment=require(_0x291a('0x0'));var utils=require(_0x291a('0x1'));function Hangup(_0x2af49b,_0x3c2afa){this['state']=0x4;this[_0x291a('0x2')]=_0x291a('0x3');this[_0x291a('0x4')]=_0x2af49b[_0x291a('0x4')];this[_0x291a('0x5')]=_0x2af49b[_0x291a('0x5')];this['campaigntype']=_0x2af49b[_0x291a('0x5')]===_0x291a('0x6')?_0x291a('0x7'):_0x2af49b[_0x291a('0x5')];this['amd']=_0x2af49b[_0x291a('0x8')]||![];this[_0x291a('0x9')]=_0x2af49b['countbusyretry'];this[_0x291a('0xa')]=_0x2af49b[_0x291a('0xa')];this['countnoanswerretry']=_0x2af49b[_0x291a('0xb')];this[_0x291a('0xc')]=_0x2af49b[_0x291a('0x9')]+_0x2af49b['countcongestionretry']+_0x2af49b[_0x291a('0xb')]+_0x2af49b['countnosuchnumberretry']+_0x2af49b[_0x291a('0xd')]+_0x2af49b[_0x291a('0xe')]+_0x2af49b[_0x291a('0xf')]+_0x2af49b[_0x291a('0x10')];this[_0x291a('0x11')]=_0x2af49b['countnosuchnumberretry'];this[_0x291a('0xd')]=_0x2af49b[_0x291a('0xd')];this[_0x291a('0xe')]=_0x2af49b[_0x291a('0xe')];this[_0x291a('0xf')]=_0x2af49b[_0x291a('0xf')];this[_0x291a('0x10')]=_0x2af49b[_0x291a('0x10')];this[_0x291a('0x12')]=_0x3c2afa[_0x291a('0x12')];this[_0x291a('0x13')]=_0x2af49b[_0x291a('0x14')];this['calleridnum']=_0x2af49b[_0x291a('0x15')];this[_0x291a('0x16')]=_0x2af49b[_0x291a('0x16')];this[_0x291a('0x17')]=_0x2af49b[_0x291a('0x17')];this[_0x291a('0x18')]=moment()[_0x291a('0x19')](_0x291a('0x1a'));this[_0x291a('0x1b')]=utils[_0x291a('0x1c')](_0x2af49b[_0x291a('0x17')],_0x2af49b[_0x291a('0x16')]);this['holdtime']=0x0;this[_0x291a('0x1d')]=utils[_0x291a('0x1c')](this[_0x291a('0x18')],_0x2af49b['responsetime']);this[_0x291a('0x7')]=_0x2af49b['queue'];this[_0x291a('0x1e')]=_0x291a('0x1f');this[_0x291a('0x20')]=_0x3c2afa[_0x291a('0x21')];this[_0x291a('0x22')]=_0x2af49b['callback'];this[_0x291a('0x23')]=_0x2af49b[_0x291a('0x23')];this['callbackat']=_0x2af49b[_0x291a('0x24')];this[_0x291a('0x25')]=_0x2af49b[_0x291a('0x25')];this[_0x291a('0x26')]=_0x2af49b[_0x291a('0x26')];this[_0x291a('0x27')]=_0x2af49b['ListId'];this[_0x291a('0x28')]=_0x2af49b['UserId'];this[_0x291a('0x29')]=_0x2af49b[_0x291a('0x29')];this['CampaignId']=_0x2af49b[_0x291a('0x2a')];}module[_0x291a('0x2b')]=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 6c53612..65cc84f 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 _0xe8a1=['originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','number','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x509cf6,_0x10c5de){var _0x2fafc8=function(_0x4d7b22){while(--_0x4d7b22){_0x509cf6['push'](_0x509cf6['shift']());}};_0x2fafc8(++_0x10c5de);}(_0xe8a1,0x1a6));var _0x1e8a=function(_0x191ec4,_0x4556eb){_0x191ec4=_0x191ec4-0x0;var _0x494534=_0xe8a1[_0x191ec4];return _0x494534;};'use strict';var utils=require(_0x1e8a('0x0'));function History(_0x4a468e){this['uniqueid']=_0x4a468e[_0x1e8a('0x1')];this[_0x1e8a('0x2')]=_0x4a468e[_0x1e8a('0x2')]||undefined;this['type']=_0x4a468e['type'];this[_0x1e8a('0x3')]=_0x4a468e[_0x1e8a('0x4')]===_0x1e8a('0x5')?_0x1e8a('0x6'):_0x4a468e[_0x1e8a('0x4')];this[_0x1e8a('0x7')]=_0x4a468e['countbusyretry'];this['countcongestionretry']=_0x4a468e[_0x1e8a('0x8')];this['countnoanswerretry']=_0x4a468e['countnoanswerretry'];this[_0x1e8a('0x9')]=_0x4a468e['countbusyretry']+_0x4a468e[_0x1e8a('0x8')]+_0x4a468e[_0x1e8a('0xa')]+_0x4a468e[_0x1e8a('0xb')]+_0x4a468e['countdropretry']+_0x4a468e[_0x1e8a('0xc')]+_0x4a468e[_0x1e8a('0xd')]+_0x4a468e[_0x1e8a('0xe')];this[_0x1e8a('0xb')]=_0x4a468e[_0x1e8a('0xb')];this['countdropretry']=_0x4a468e[_0x1e8a('0xf')];this[_0x1e8a('0xc')]=_0x4a468e[_0x1e8a('0xc')];this[_0x1e8a('0xd')]=_0x4a468e[_0x1e8a('0xd')];this[_0x1e8a('0xe')]=_0x4a468e['countagentrejectretry'];this[_0x1e8a('0x6')]=_0x4a468e['queue'];this['calleridname']=_0x4a468e[_0x1e8a('0x10')];this['calleridnum']=_0x4a468e[_0x1e8a('0x11')];this['starttime']=_0x4a468e[_0x1e8a('0x12')];this[_0x1e8a('0x13')]=_0x4a468e[_0x1e8a('0x13')];this[_0x1e8a('0x14')]=_0x4a468e[_0x1e8a('0x13')];this['ringtime']=utils[_0x1e8a('0x15')](_0x4a468e[_0x1e8a('0x13')],_0x4a468e['starttime']);this[_0x1e8a('0x16')]=0x0;this[_0x1e8a('0x17')]=0x0;this[_0x1e8a('0x18')]=_0x4a468e[_0x1e8a('0x18')];this[_0x1e8a('0x19')]=_0x4a468e[_0x1e8a('0x19')];this[_0x1e8a('0x1a')]=_0x4a468e[_0x1e8a('0x1a')];this[_0x1e8a('0x1b')]=_0x4a468e[_0x1e8a('0x1b')];this[_0x1e8a('0x1c')]=_0x4a468e[_0x1e8a('0x1c')];this[_0x1e8a('0x1d')]=_0x4a468e[_0x1e8a('0x1d')];this[_0x1e8a('0x1e')]=_0x4a468e[_0x1e8a('0x1e')];this[_0x1e8a('0x1f')]=_0x4a468e[_0x1e8a('0x1f')];this[_0x1e8a('0x20')]=_0x4a468e[_0x1e8a('0x20')];this[_0x1e8a('0x21')]=_0x4a468e['originatecalleridnum']||'';this[_0x1e8a('0x22')]=_0x4a468e[_0x1e8a('0x22')]||'';this[_0x1e8a('0x23')]=_0x4a468e[_0x1e8a('0x23')];this[_0x1e8a('0x24')]=_0x4a468e['statedesc'];}module[_0x1e8a('0x25')]=History; \ No newline at end of file +var _0xd371=['originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x289e8b,_0x2e86e9){var _0x4442a5=function(_0x54cb8f){while(--_0x54cb8f){_0x289e8b['push'](_0x289e8b['shift']());}};_0x4442a5(++_0x2e86e9);}(_0xd371,0x101));var _0x1d37=function(_0x2df413,_0x5303ae){_0x2df413=_0x2df413-0x0;var _0x1f5133=_0xd371[_0x2df413];return _0x1f5133;};'use strict';var utils=require(_0x1d37('0x0'));function History(_0x25741f){this[_0x1d37('0x1')]=_0x25741f[_0x1d37('0x1')];this[_0x1d37('0x2')]=_0x25741f[_0x1d37('0x2')]||undefined;this['type']=_0x25741f[_0x1d37('0x3')];this[_0x1d37('0x4')]=_0x25741f['type']===_0x1d37('0x5')?_0x1d37('0x6'):_0x25741f[_0x1d37('0x3')];this['countbusyretry']=_0x25741f['countbusyretry'];this['countcongestionretry']=_0x25741f[_0x1d37('0x7')];this[_0x1d37('0x8')]=_0x25741f[_0x1d37('0x8')];this[_0x1d37('0x9')]=_0x25741f[_0x1d37('0xa')]+_0x25741f['countcongestionretry']+_0x25741f[_0x1d37('0x8')]+_0x25741f[_0x1d37('0xb')]+_0x25741f[_0x1d37('0xc')]+_0x25741f[_0x1d37('0xd')]+_0x25741f[_0x1d37('0xe')]+_0x25741f[_0x1d37('0xf')];this['countnosuchnumberretry']=_0x25741f['countnosuchnumberretry'];this['countdropretry']=_0x25741f[_0x1d37('0xc')];this[_0x1d37('0xd')]=_0x25741f[_0x1d37('0xd')];this['countmachineretry']=_0x25741f[_0x1d37('0xe')];this[_0x1d37('0xf')]=_0x25741f[_0x1d37('0xf')];this['queue']=_0x25741f[_0x1d37('0x6')];this['calleridname']=_0x25741f[_0x1d37('0x10')];this[_0x1d37('0x11')]=_0x25741f['number'];this[_0x1d37('0x12')]=_0x25741f[_0x1d37('0x12')];this['responsetime']=_0x25741f[_0x1d37('0x13')];this['endtime']=_0x25741f[_0x1d37('0x13')];this['ringtime']=utils['getSeconds'](_0x25741f[_0x1d37('0x13')],_0x25741f[_0x1d37('0x12')]);this[_0x1d37('0x14')]=0x0;this[_0x1d37('0x15')]=0x0;this[_0x1d37('0x16')]=_0x25741f[_0x1d37('0x16')];this[_0x1d37('0x17')]=_0x25741f[_0x1d37('0x17')];this[_0x1d37('0x18')]=_0x25741f[_0x1d37('0x18')];this[_0x1d37('0x19')]=_0x25741f[_0x1d37('0x19')];this[_0x1d37('0x1a')]=_0x25741f[_0x1d37('0x1a')];this[_0x1d37('0x1b')]=_0x25741f[_0x1d37('0x1b')];this[_0x1d37('0x1c')]=_0x25741f[_0x1d37('0x1c')];this[_0x1d37('0x1d')]=_0x25741f[_0x1d37('0x1d')];this[_0x1d37('0x1e')]=_0x25741f[_0x1d37('0x1e')];this[_0x1d37('0x1f')]=_0x25741f[_0x1d37('0x1f')]||'';this[_0x1d37('0x20')]=_0x25741f['originatecalleridname']||'';this[_0x1d37('0x21')]=_0x25741f[_0x1d37('0x21')];this[_0x1d37('0x22')]=_0x25741f[_0x1d37('0x22')];}module[_0x1d37('0x23')]=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 e1c26d4..a6a4358 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 _0xd959=['countmachineretry','uniqueid','calleridname','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x23d528,_0x1edf07){var _0x5812f1=function(_0x451e3e){while(--_0x451e3e){_0x23d528['push'](_0x23d528['shift']());}};_0x5812f1(++_0x1edf07);}(_0xd959,0x73));var _0x9d95=function(_0x180354,_0x5b71ab){_0x180354=_0x180354-0x0;var _0x3fc5d9=_0xd959[_0x180354];return _0x3fc5d9;};'use strict';var utils=require(_0x9d95('0x0'));function QueueCallerAbandon(_0x14dea8,_0x143750){this['scheduledat']=_0x14dea8[_0x9d95('0x1')];this[_0x9d95('0x2')]=_0x14dea8[_0x9d95('0x2')];this[_0x9d95('0x3')]=_0x14dea8['type']===_0x9d95('0x4')?_0x9d95('0x5'):_0x14dea8['type'];this[_0x9d95('0x6')]=_0x14dea8[_0x9d95('0x6')];this[_0x9d95('0x7')]=_0x14dea8[_0x9d95('0x7')];this[_0x9d95('0x8')]=_0x14dea8[_0x9d95('0x8')];this[_0x9d95('0x9')]=_0x14dea8[_0x9d95('0x6')]+_0x14dea8[_0x9d95('0x7')]+_0x14dea8['countnoanswerretry']+_0x14dea8[_0x9d95('0xa')]+_0x14dea8[_0x9d95('0xb')]+_0x14dea8[_0x9d95('0xc')]+_0x14dea8['countmachineretry']+_0x14dea8[_0x9d95('0xd')];this[_0x9d95('0xa')]=_0x14dea8[_0x9d95('0xa')];this[_0x9d95('0xb')]=_0x14dea8[_0x9d95('0xb')];this[_0x9d95('0xc')]=_0x14dea8['countabandonedretry'];this[_0x9d95('0xe')]=_0x14dea8[_0x9d95('0xe')];this['countagentrejectretry']=_0x14dea8[_0x9d95('0xd')];this['uniqueid']=_0x143750[_0x9d95('0xf')];this[_0x9d95('0x10')]=_0x14dea8['name'];this['calleridnum']=_0x14dea8[_0x9d95('0x11')];this[_0x9d95('0x12')]=_0x14dea8[_0x9d95('0x12')];this[_0x9d95('0x13')]=_0x14dea8[_0x9d95('0x13')];this[_0x9d95('0x14')]=_0x14dea8[_0x9d95('0x14')];this[_0x9d95('0x15')]=_0x14dea8[_0x9d95('0x15')];this[_0x9d95('0x16')]=this[_0x9d95('0x14')];this['ringtime']=utils[_0x9d95('0x17')](_0x14dea8[_0x9d95('0x13')],_0x14dea8[_0x9d95('0x12')]);this[_0x9d95('0x18')]=utils[_0x9d95('0x17')](this['droptime'],_0x14dea8[_0x9d95('0x13')]);this[_0x9d95('0x19')]=0x0;this[_0x9d95('0x5')]=_0x143750['queue'];this[_0x9d95('0x1a')]=_0x143750[_0x9d95('0x1b')];this['reason']=_0x143750[_0x9d95('0x1c')];this[_0x9d95('0x1d')]=_0x14dea8[_0x9d95('0x1d')];this[_0x9d95('0x1e')]=_0x14dea8[_0x9d95('0x1e')];this[_0x9d95('0x1f')]=_0x14dea8['callbackat'];this[_0x9d95('0x20')]=_0x14dea8[_0x9d95('0x20')];this['ContactId']=_0x14dea8[_0x9d95('0x21')];this['ListId']=_0x14dea8[_0x9d95('0x22')];this[_0x9d95('0x23')]=_0x14dea8['UserId'];this[_0x9d95('0x24')]=_0x14dea8[_0x9d95('0x24')];this['CampaignId']=_0x14dea8[_0x9d95('0x25')];this[_0x9d95('0x26')]=_0x14dea8[_0x9d95('0x26')]||'';this['originatecalleridname']=_0x14dea8[_0x9d95('0x27')]||'';this[_0x9d95('0x28')]=_0x14dea8[_0x9d95('0x28')];this[_0x9d95('0x29')]=_0x14dea8['state'];this[_0x9d95('0x2a')]=_0x14dea8[_0x9d95('0x2a')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x2214=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x20225e,_0x428f19){var _0x3c3b88=function(_0xe65f01){while(--_0xe65f01){_0x20225e['push'](_0x20225e['shift']());}};_0x3c3b88(++_0x428f19);}(_0x2214,0x165));var _0x4221=function(_0x55afda,_0xed3983){_0x55afda=_0x55afda-0x0;var _0x477c4c=_0x2214[_0x55afda];return _0x477c4c;};'use strict';var utils=require(_0x4221('0x0'));function QueueCallerAbandon(_0x2ba767,_0x5abaa5){this[_0x4221('0x1')]=_0x2ba767[_0x4221('0x1')];this['type']=_0x2ba767[_0x4221('0x2')];this[_0x4221('0x3')]=_0x2ba767[_0x4221('0x2')]===_0x4221('0x4')?_0x4221('0x5'):_0x2ba767[_0x4221('0x2')];this['countbusyretry']=_0x2ba767[_0x4221('0x6')];this[_0x4221('0x7')]=_0x2ba767[_0x4221('0x7')];this[_0x4221('0x8')]=_0x2ba767[_0x4221('0x8')];this[_0x4221('0x9')]=_0x2ba767[_0x4221('0x6')]+_0x2ba767['countcongestionretry']+_0x2ba767[_0x4221('0x8')]+_0x2ba767[_0x4221('0xa')]+_0x2ba767[_0x4221('0xb')]+_0x2ba767[_0x4221('0xc')]+_0x2ba767[_0x4221('0xd')]+_0x2ba767['countagentrejectretry'];this[_0x4221('0xa')]=_0x2ba767['countnosuchnumberretry'];this[_0x4221('0xb')]=_0x2ba767['countdropretry'];this['countabandonedretry']=_0x2ba767[_0x4221('0xc')];this[_0x4221('0xd')]=_0x2ba767[_0x4221('0xd')];this[_0x4221('0xe')]=_0x2ba767[_0x4221('0xe')];this[_0x4221('0xf')]=_0x5abaa5['uniqueid'];this[_0x4221('0x10')]=_0x2ba767[_0x4221('0x11')];this[_0x4221('0x12')]=_0x2ba767[_0x4221('0x13')];this[_0x4221('0x14')]=_0x2ba767[_0x4221('0x14')];this[_0x4221('0x15')]=_0x2ba767[_0x4221('0x15')];this[_0x4221('0x16')]=_0x2ba767[_0x4221('0x16')];this[_0x4221('0x17')]=_0x2ba767[_0x4221('0x17')];this[_0x4221('0x18')]=this[_0x4221('0x16')];this[_0x4221('0x19')]=utils[_0x4221('0x1a')](_0x2ba767[_0x4221('0x15')],_0x2ba767[_0x4221('0x14')]);this[_0x4221('0x1b')]=utils[_0x4221('0x1a')](this['droptime'],_0x2ba767['responsetime']);this[_0x4221('0x1c')]=0x0;this[_0x4221('0x5')]=_0x5abaa5[_0x4221('0x5')];this[_0x4221('0x1d')]=_0x5abaa5[_0x4221('0x1e')];this[_0x4221('0x1f')]=_0x5abaa5['reason'];this[_0x4221('0x20')]=_0x2ba767[_0x4221('0x20')];this[_0x4221('0x21')]=_0x2ba767[_0x4221('0x21')];this[_0x4221('0x22')]=_0x2ba767[_0x4221('0x22')];this[_0x4221('0x23')]=_0x2ba767[_0x4221('0x23')];this[_0x4221('0x24')]=_0x2ba767[_0x4221('0x24')];this[_0x4221('0x25')]=_0x2ba767[_0x4221('0x25')];this[_0x4221('0x26')]=_0x2ba767[_0x4221('0x26')];this[_0x4221('0x27')]=_0x2ba767[_0x4221('0x27')];this[_0x4221('0x28')]=_0x2ba767[_0x4221('0x28')];this[_0x4221('0x29')]=_0x2ba767[_0x4221('0x29')]||'';this[_0x4221('0x2a')]=_0x2ba767['originatecalleridname']||'';this[_0x4221('0x2b')]=_0x2ba767['agiafterat'];this[_0x4221('0x2c')]=_0x2ba767[_0x4221('0x2c')];this[_0x4221('0x2d')]=_0x2ba767[_0x4221('0x2d')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index f6b6faa..1100100 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 _0x687b=['checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[getContactDialerIvr]','countReScheduled','[rescheduleContact]','rescheduleContact','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]'];(function(_0x32375e,_0x21ac0c){var _0x38291a=function(_0x2cf968){while(--_0x2cf968){_0x32375e['push'](_0x32375e['shift']());}};_0x38291a(++_0x21ac0c);}(_0x687b,0x14a));var _0xb687=function(_0x34edec,_0x228935){_0x34edec=_0x34edec-0x0;var _0x2d276d=_0x687b[_0x34edec];return _0x2d276d;};'use strict';var util=require(_0xb687('0x0'));var logger=require(_0xb687('0x1'))(_0xb687('0x2'));var cmHopper=require(_0xb687('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xb687('0x4'));function inspectError(_0x2a4a7c){return util[_0xb687('0x5')](_0x2a4a7c,{'showHidden':![],'depth':null});}function getContactDialer(_0x31bd0d,_0x46e5b3,_0x194c55){return cmHopper[_0xb687('0x6')](_0x31bd0d['id'],_0x46e5b3,_0x194c55,_0x31bd0d[_0xb687('0x7')])[_0xb687('0x8')](function(_0x27b750){_0x31bd0d['temp']=0x0;logger[_0xb687('0x9')](_0xb687('0xa'),inspectError(_0x27b750));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x1a99c5,_0x21e3ab){return cmHopper[_0xb687('0xb')](_0x1a99c5['id'],_0x21e3ab,_0x1a99c5[_0xb687('0x7')])[_0xb687('0x8')](function(_0x309d84){_0x1a99c5[_0xb687('0xc')]=0x0;logger[_0xb687('0x9')](_0xb687('0xd'),inspectError(_0x309d84));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x226e56){return cmHopper[_0xb687('0xe')](_0x226e56)[_0xb687('0x8')](function(_0x12a0be){logger['error']('[countReScheduled]',inspectError(_0x12a0be));});}exports[_0xb687('0xe')]=countReScheduled;function rescheduleContact(_0x155ebe){return cmHopper['rescheduleContact'](_0x155ebe)[_0xb687('0x8')](function(_0x2f1ac0){logger[_0xb687('0x9')](_0xb687('0xf'),inspectError(_0x2f1ac0));});}exports[_0xb687('0x10')]=rescheduleContact;function unlockContact(_0x3ab914,_0x30622f,_0x141375){return cmHopper[_0xb687('0x11')](_0x3ab914,_0x30622f,_0x141375)[_0xb687('0x8')](function(_0x25124a){logger[_0xb687('0x9')]('[unlockContact]',inspectError(_0x25124a));});}exports[_0xb687('0x11')]=unlockContact;function moveContactManagedDialer(_0x328301){return cmHopper[_0xb687('0x12')](_0x328301)['catch'](function(_0x48958d){logger[_0xb687('0x9')](_0xb687('0x13'),inspectError(_0x48958d));});}exports[_0xb687('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x4b593b){return cmHopperBlack[_0xb687('0x14')](_0x4b593b)['catch'](function(_0x1bd2bf){logger[_0xb687('0x9')](_0xb687('0x15'),inspectError(_0x1bd2bf));});}exports[_0xb687('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x49d5a1){return cmHopperBlack[_0xb687('0x16')](_0x49d5a1)['catch'](function(_0x335541){logger[_0xb687('0x9')](_0xb687('0x17'),inspectError(_0x335541));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1dc06b,_0x491623,_0xa95e91){return cmHopperAdditionalPhone[_0xb687('0x18')](_0x1dc06b,_0x491623,_0xa95e91)[_0xb687('0x8')](function(_0x38866c){logger[_0xb687('0x9')](_0xb687('0x19'),inspectError(_0x38866c));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xf45db0,_0x129347,_0x1c1585){return cmHopperAdditionalPhone[_0xb687('0x1a')](_0xf45db0,_0x129347,_0x1c1585)[_0xb687('0x8')](function(_0x4136c9){logger[_0xb687('0x9')](_0xb687('0x1b'),inspectError(_0x4136c9));});}exports[_0xb687('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x2e6185){return cmHopperHistory['avgHandleTime'](_0x2e6185)[_0xb687('0x8')](function(_0x192966){logger[_0xb687('0x9')](_0xb687('0x1c'),inspectError(_0x192966));});}exports[_0xb687('0x1d')]=avgHandleTime;function createHistory(_0x173c58){return cmHopperHistory['createHistory'](_0x173c58)[_0xb687('0x8')](function(_0x5143af){logger[_0xb687('0x9')](_0xb687('0x1e'),inspectError(_0x5143af));});}exports[_0xb687('0x1f')]=createHistory; \ No newline at end of file +var _0x9a5a=['../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[avgHandleTime]','createHistory','util'];(function(_0x3b22e9,_0x354406){var _0x230314=function(_0x29ae96){while(--_0x29ae96){_0x3b22e9['push'](_0x3b22e9['shift']());}};_0x230314(++_0x354406);}(_0x9a5a,0x194));var _0xa9a5=function(_0x32ae87,_0x17e5a4){_0x32ae87=_0x32ae87-0x0;var _0x932149=_0x9a5a[_0x32ae87];return _0x932149;};'use strict';var util=require(_0xa9a5('0x0'));var logger=require(_0xa9a5('0x1'))(_0xa9a5('0x2'));var cmHopper=require(_0xa9a5('0x3'));var cmHopperAdditionalPhone=require(_0xa9a5('0x4'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xa9a5('0x5'));function inspectError(_0x1e6fb1){return util[_0xa9a5('0x6')](_0x1e6fb1,{'showHidden':![],'depth':null});}function getContactDialer(_0x1080a9,_0x31e823,_0x1ae623){return cmHopper['getContactDialer'](_0x1080a9['id'],_0x31e823,_0x1ae623,_0x1080a9[_0xa9a5('0x7')])[_0xa9a5('0x8')](function(_0x20bbe8){_0x1080a9[_0xa9a5('0x9')]=0x0;logger[_0xa9a5('0xa')]('[getContactDialer]',inspectError(_0x20bbe8));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x57d90b,_0xc95120){return cmHopper[_0xa9a5('0xb')](_0x57d90b['id'],_0xc95120,_0x57d90b[_0xa9a5('0x7')])[_0xa9a5('0x8')](function(_0x158317){_0x57d90b[_0xa9a5('0x9')]=0x0;logger[_0xa9a5('0xa')]('[getContactDialerIvr]',inspectError(_0x158317));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x56f162){return cmHopper[_0xa9a5('0xc')](_0x56f162)[_0xa9a5('0x8')](function(_0x3a5084){logger[_0xa9a5('0xa')](_0xa9a5('0xd'),inspectError(_0x3a5084));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xe6a34b){return cmHopper[_0xa9a5('0xe')](_0xe6a34b)[_0xa9a5('0x8')](function(_0x453b49){logger[_0xa9a5('0xa')](_0xa9a5('0xf'),inspectError(_0x453b49));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x30a479,_0x25c458,_0x476843){return cmHopper[_0xa9a5('0x10')](_0x30a479,_0x25c458,_0x476843)['catch'](function(_0x3353ca){logger[_0xa9a5('0xa')](_0xa9a5('0x11'),inspectError(_0x3353ca));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x3c505b){return cmHopper['moveContactManagedDialer'](_0x3c505b)['catch'](function(_0x2fb6bc){logger[_0xa9a5('0xa')]('[moveContactManagedDialer]',inspectError(_0x2fb6bc));});}exports[_0xa9a5('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x5d05d5){return cmHopperBlack[_0xa9a5('0x13')](_0x5d05d5)[_0xa9a5('0x8')](function(_0x3bd8e9){logger[_0xa9a5('0xa')](_0xa9a5('0x14'),inspectError(_0x3bd8e9));});}exports[_0xa9a5('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x21ea08){return cmHopperBlack[_0xa9a5('0x15')](_0x21ea08)[_0xa9a5('0x8')](function(_0x19d619){logger[_0xa9a5('0xa')](_0xa9a5('0x16'),inspectError(_0x19d619));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x5c8314,_0x59b37c,_0x43017d){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5c8314,_0x59b37c,_0x43017d)[_0xa9a5('0x8')](function(_0x198821){logger[_0xa9a5('0xa')]('[verifyAdditionalPhone]',inspectError(_0x198821));});}exports[_0xa9a5('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0xb37bcb,_0x341723,_0x4f1076){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xb37bcb,_0x341723,_0x4f1076)[_0xa9a5('0x8')](function(_0x19ccbd){logger[_0xa9a5('0xa')]('[swapAdditionalPhone]',inspectError(_0x19ccbd));});}exports[_0xa9a5('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x45afca){return cmHopperHistory['avgHandleTime'](_0x45afca)[_0xa9a5('0x8')](function(_0x474671){logger['error'](_0xa9a5('0x19'),inspectError(_0x474671));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x11366f){return cmHopperHistory['createHistory'](_0x11366f)[_0xa9a5('0x8')](function(_0x3b271d){logger['error']('[createHistory]',inspectError(_0x3b271d));});}exports[_0xa9a5('0x1a')]=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 dd5ef8b..a8db024 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 _0x4e3b=['XMD-','toUpperCase','lodash','moment','util','dialer','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','match','string','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','decrementOriginate','erlangb','checkContactLowerLimitOriginate','description','updatedAt','undefined','%s%s'];(function(_0x178323,_0x18d7b9){var _0x4f17b8=function(_0x1378f8){while(--_0x1378f8){_0x178323['push'](_0x178323['shift']());}};_0x4f17b8(++_0x18d7b9);}(_0x4e3b,0xac));var _0xb4e3=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x4e3b[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0xb4e3('0x0'));var moment=require(_0xb4e3('0x1'));var util=require(_0xb4e3('0x2'));var logger=require('../../../../config/logger')(_0xb4e3('0x3'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xb4e3('0x4'),'CONTACTS_RESCHEDULED':_0xb4e3('0x5'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xb4e3('0x6'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xb4e3('0x7'),'NO_AVAILABLE_CONTACTS':_0xb4e3('0x8'),'NULL_INTERVAL':_0xb4e3('0x9'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xb4e3('0xa'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xb4e3('0xb'),'RUNNING':_0xb4e3('0xc'),'UNKNOWN_TIMEZONE':_0xb4e3('0xd'),'UNREACHABLE_TRUNK':_0xb4e3('0xe')};exports[_0xb4e3('0xf')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2f390c){return _0x2f390c[_0xb4e3('0x10')]===_0xb4e3('0x11');}exports[_0xb4e3('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x18d4cc){return _0x18d4cc[_0xb4e3('0x13')]===_0xb4e3('0x14');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x85ece1){return _0x85ece1[_0xb4e3('0x13')]===_0xb4e3('0x15');}exports[_0xb4e3('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x300b19){return _0x300b19[_0xb4e3('0x17')];}exports[_0xb4e3('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x16090f){return _0x16090f['active'];}exports[_0xb4e3('0x19')]=isIVRCampaignActive;function getSeconds(_0x39b9e2,_0x27a42f){var _0x2fc0a0=moment(_0x39b9e2)[_0xb4e3('0x1a')](0x0);var _0x22375e=moment(_0x27a42f)[_0xb4e3('0x1a')](0x0);return _0x2fc0a0[_0xb4e3('0x1b')](_0x22375e,_0xb4e3('0x1c'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x531817,_0x349155){var _0x10097d=![];var _0x2dcada=_0x531817[_0xb4e3('0x10')]!==_0x349155[_0xb4e3('0x10')]||_0x531817[_0xb4e3('0x17')]!==_0x349155[_0xb4e3('0x17')]||_0x531817[_0xb4e3('0x1d')]!==_0x349155[_0xb4e3('0x1d')];var _0x47d764=_0x531817[_0xb4e3('0x1e')]!==_0x349155[_0xb4e3('0x1e')]||_0x531817[_0xb4e3('0x1f')]!==_0x349155[_0xb4e3('0x1f')]||_0x531817[_0xb4e3('0x20')]!==_0x349155[_0xb4e3('0x20')]||_0x531817[_0xb4e3('0x21')]!==_0x349155[_0xb4e3('0x21')]||_0x531817[_0xb4e3('0x22')]!==_0x349155[_0xb4e3('0x22')]||_0x531817[_0xb4e3('0x23')]!==_0x349155[_0xb4e3('0x23')]||_0x531817[_0xb4e3('0x24')]!==_0x349155[_0xb4e3('0x24')]||_0x531817[_0xb4e3('0x25')]!==_0x349155['inUse']||_0x531817[_0xb4e3('0x26')]!==_0x349155[_0xb4e3('0x26')];if(_0x531817[_0xb4e3('0x27')]&&_0x349155[_0xb4e3('0x27')]){_0x10097d=_0x531817['Trunk'][_0xb4e3('0x28')]!==_0x349155['Trunk'][_0xb4e3('0x28')]||_0x531817[_0xb4e3('0x27')][_0xb4e3('0x29')]!==_0x349155[_0xb4e3('0x27')][_0xb4e3('0x29')];}return _0x2dcada||_0x47d764||_0x10097d;}exports[_0xb4e3('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x30d2c8){var _0x22ab22=null;var _0x5bf8d5=_0x30d2c8[_0xb4e3('0x2b')];if(_['isNil'](_0x30d2c8[_0xb4e3('0x2c')])||_[_0xb4e3('0x2d')](_0x30d2c8[_0xb4e3('0x2e')])||_[_0xb4e3('0x2d')](_0x30d2c8[_0xb4e3('0x2e')][_0xb4e3('0x2f')])){_0x22ab22=CAMPAIGN_STATUS[_0xb4e3('0x30')];}else if(_[_0xb4e3('0x31')](_0x30d2c8['dialGlobalInterval'])||_[_0xb4e3('0x31')](_0x30d2c8['Interval'][_0xb4e3('0x2f')])){_0x22ab22=CAMPAIGN_STATUS[_0xb4e3('0x32')];}else if(_0x5bf8d5&&!timezones[_0x5bf8d5]){_0x22ab22=CAMPAIGN_STATUS[_0xb4e3('0x33')];}return _0x22ab22;}function checkAnyValidTrunk(_0x1cbd73,_0xde4049){var _0x377713=null;var _0x912659=_0xb4e3('0x34');var _0x31e758=[_0xb4e3('0x35'),_0xb4e3('0x36')];var _0x429aed=!![];if(_0x1cbd73[_0xb4e3('0x27')]&&_0x1cbd73[_0xb4e3('0x27')]['active']){_0x912659+=_0x1cbd73[_0xb4e3('0x27')]['name'];_0x377713=_0xde4049[_0x912659];_0x429aed=_0x31e758['includes'](_0x377713[_0xb4e3('0x37')]);}else if(_0x1cbd73[_0xb4e3('0x38')]&&_0x1cbd73['TrunkBackup'][_0xb4e3('0x29')]){_0x912659+=_0x1cbd73[_0xb4e3('0x38')][_0xb4e3('0x28')];_0x377713=_0xde4049[_0x912659];_0x429aed=_0x31e758[_0xb4e3('0x39')](_0x377713[_0xb4e3('0x37')]);}return _0x429aed;}function getQueueCampaignStatusMessage(_0x42662a,_0x5c7091){var _0x36f1fc=CAMPAIGN_STATUS['ACTIVE'];var _0x188050=isPreviewCampaign(_0x42662a);if(!isQueueCampaignActive(_0x42662a)){if(_0x188050){_0x36f1fc=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x42662a[_0xb4e3('0x26')]===0x0&&_0x42662a['talking']===0x0&&_0x42662a[_0xb4e3('0x24')]===0x0&&(_0x42662a['pTalking']||0x0)===0x0){_0x36f1fc=CAMPAIGN_STATUS[_0xb4e3('0x3a')];}else{_0x36f1fc=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x42662a['loggedIn']===0x0){_0x36f1fc=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x42662a,_0x5c7091)){_0x36f1fc=CAMPAIGN_STATUS[_0xb4e3('0x3b')];}else if(!isPreviewCampaign(_0x42662a)){var _0x2880f9=checkAnyValidQueueCampaignInterval(_0x42662a);if(_0x2880f9){_0x36f1fc=_0x2880f9;}}return _0x36f1fc;}exports[_0xb4e3('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x41d703){var _0x44e5c7=CAMPAIGN_STATUS[_0xb4e3('0x3d')];if(_0x41d703[_0xb4e3('0x26')]===0x0&&_0x41d703[_0xb4e3('0x22')]===0x0&&_0x41d703['waiting']===0x0&&(_0x41d703[_0xb4e3('0x23')]||0x0)===0x0){_0x44e5c7=CAMPAIGN_STATUS['INACTIVE'];}return _0x44e5c7;}exports[_0xb4e3('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x29679b){var _0x3911db=_0x29679b[_0xb4e3('0x3f')](/"(.*?)"/);return _0x3911db?_0x3911db[0x1]:_0x29679b;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x5b8afa,_0x4ecce9,_0x148d80){if(!_['isUndefined'](_0x148d80)&&typeof _0x148d80===_0xb4e3('0x40')&&!_[_0xb4e3('0x31')](_0x148d80)){if(!_[_0xb4e3('0x41')](_0x4ecce9)&&typeof _0x4ecce9===_0xb4e3('0x40')&&!_['isEmpty'](_0x4ecce9)){return util[_0xb4e3('0x42')](_0xb4e3('0x43'),_0x4ecce9,_0x148d80);}return util[_0xb4e3('0x42')](_0xb4e3('0x43'),_0x148d80,_0x148d80);}if(!_[_0xb4e3('0x41')](_0x5b8afa)&&typeof _0x5b8afa===_0xb4e3('0x40')&&!_[_0xb4e3('0x31')](_0x5b8afa)){return _0x5b8afa;}return _0xb4e3('0x44');}exports[_0xb4e3('0x45')]=getCallerId;function getCallerIdRandom(_0xa7018e,_0x3d431f){var _0x575287;var _0x168481;var _0x3fece4;if(_0x3d431f<=0x0){_0x3d431f=0x1;}_0x575287=new RegExp('\x5cw{0,'+_0x3d431f+'}$');_0x168481=Math['pow'](0xa,_0x3d431f-0x1);_0x3fece4=Math[_0xb4e3('0x46')](0xa,_0x3d431f)-0x1;return util['format']('%s',_[_0xb4e3('0x47')](_0xa7018e,_0x575287,_[_0xb4e3('0x48')](_0x168481,_0x3fece4)[_0xb4e3('0x49')]()));}exports[_0xb4e3('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x2da8fa){if(_0x2da8fa['originated']&&_0x2da8fa[_0xb4e3('0x26')]>0x0){_0x2da8fa['originated']-=0x1;}else{logger[_0xb4e3('0x4b')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xb4e3('0x4c')]=decrementOriginate;function checkContactEmpty(_0x35ae1a){return _0x35ae1a&&_0x35ae1a['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x1a1da,_0x5ac3a2){if(_0x5ac3a2===0x0){return 0x0;}var _0x3ff226=0x1;for(var _0x1b27b7=0x1;_0x1b27b7<=_0x5ac3a2;_0x1b27b7+=0x1){_0x3ff226=0x1+_0x3ff226*_0x1b27b7/_0x1a1da;}return 0x1/_0x3ff226;}exports[_0xb4e3('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x161fd8,_0x284074,_0x3e2298){if(_0x284074>_0x3e2298){for(var _0x3d5526=0x0;_0x3d5526<_0x284074-_0x3e2298;_0x3d5526+=0x1){decrementOriginate(_0x161fd8);}}}exports[_0xb4e3('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x28174f){var _0x57b148={};var _0x13f36c=['id','createdAt',_0xb4e3('0x4f'),'tags',_0xb4e3('0x50')];if(_0x28174f){for(var _0x37bde4 in _0x28174f){if(typeof _0x28174f[_0x37bde4]!==_0xb4e3('0x51')){if(!_[_0xb4e3('0x2d')](_0x28174f[_0x37bde4])&&!_0x13f36c[_0xb4e3('0x39')](_0x37bde4)){_0x57b148[util[_0xb4e3('0x42')](_0xb4e3('0x52'),_0xb4e3('0x53'),_0x37bde4[_0xb4e3('0x54')]())]=_0x28174f[_0x37bde4];}}}}return _0x57b148;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0x49aa=['\x5cw{0,','pow','replace','random','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','createdAt','tags','undefined','%s%s','XMD-','toUpperCase','lodash','util','../../../../config/logger','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','status','TrunkBackup','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId'];(function(_0x1a6498,_0xe352d6){var _0xc64cb1=function(_0x372bef){while(--_0x372bef){_0x1a6498['push'](_0x1a6498['shift']());}};_0xc64cb1(++_0xe352d6);}(_0x49aa,0xc6));var _0xa49a=function(_0x145de5,_0x281865){_0x145de5=_0x145de5-0x0;var _0x27854a=_0x49aa[_0x145de5];return _0x27854a;};'use strict';var _=require(_0xa49a('0x0'));var moment=require('moment');var util=require(_0xa49a('0x1'));var logger=require(_0xa49a('0x2'))('dialer');var timezones=require(_0xa49a('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xa49a('0x4'),'BLACKLIST':_0xa49a('0x5'),'CONTACTS_RESCHEDULED':_0xa49a('0x6'),'DEACTIVATED':_0xa49a('0x7'),'DISACTIVED':_0xa49a('0x8'),'EMPTY_INTERVAL':_0xa49a('0x9'),'INACTIVE':_0xa49a('0xa'),'NO_AGENTS_LOGGED':_0xa49a('0xb'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xa49a('0xc'),'OVERTIME_INTERVAL':_0xa49a('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xa49a('0xe'),'QUEUE_RECALL':_0xa49a('0xf'),'RECALL_TIMEOUT':_0xa49a('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xa49a('0x11'),'UNREACHABLE_TRUNK':_0xa49a('0x12')};exports[_0xa49a('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5e607a){return _0x5e607a[_0xa49a('0x14')]===_0xa49a('0x15');}exports[_0xa49a('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x5a8633){return _0x5a8633[_0xa49a('0x17')]===_0xa49a('0x18');}exports[_0xa49a('0x19')]=isIVRCampaign;function isOutboundQueue(_0x9d5e6e){return _0x9d5e6e[_0xa49a('0x17')]===_0xa49a('0x1a');}exports[_0xa49a('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x21ee08){return _0x21ee08[_0xa49a('0x1c')];}exports[_0xa49a('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x50b2ff){return _0x50b2ff['active'];}exports[_0xa49a('0x1e')]=isIVRCampaignActive;function getSeconds(_0xd4b493,_0x8d15a6){var _0x4f5dcd=moment(_0xd4b493)[_0xa49a('0x1f')](0x0);var _0x54d55a=moment(_0x8d15a6)[_0xa49a('0x1f')](0x0);return _0x4f5dcd['diff'](_0x54d55a,_0xa49a('0x20'));}exports[_0xa49a('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x138bfa,_0x949cb7){var _0x29fc06=![];var _0x505907=_0x138bfa['dialMethod']!==_0x949cb7[_0xa49a('0x14')]||_0x138bfa['dialActive']!==_0x949cb7['dialActive']||_0x138bfa[_0xa49a('0x22')]!==_0x949cb7['message'];var _0xa4f6fc=_0x138bfa[_0xa49a('0x23')]!==_0x949cb7['available']||_0x138bfa[_0xa49a('0x24')]!==_0x949cb7[_0xa49a('0x24')]||_0x138bfa['loggedInDb']!==_0x949cb7[_0xa49a('0x25')]||_0x138bfa[_0xa49a('0x26')]!==_0x949cb7[_0xa49a('0x26')]||_0x138bfa['talking']!==_0x949cb7[_0xa49a('0x27')]||_0x138bfa[_0xa49a('0x28')]!==_0x949cb7[_0xa49a('0x28')]||_0x138bfa[_0xa49a('0x29')]!==_0x949cb7[_0xa49a('0x29')]||_0x138bfa['inUse']!==_0x949cb7[_0xa49a('0x2a')]||_0x138bfa[_0xa49a('0x2b')]!==_0x949cb7[_0xa49a('0x2b')];if(_0x138bfa['Trunk']&&_0x949cb7['Trunk']){_0x29fc06=_0x138bfa[_0xa49a('0x2c')][_0xa49a('0x2d')]!==_0x949cb7[_0xa49a('0x2c')][_0xa49a('0x2d')]||_0x138bfa[_0xa49a('0x2c')][_0xa49a('0x2e')]!==_0x949cb7[_0xa49a('0x2c')]['active'];}return _0x505907||_0xa4f6fc||_0x29fc06;}exports[_0xa49a('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x121d63){var _0xff07a8=null;var _0x396413=_0x121d63[_0xa49a('0x30')];if(_[_0xa49a('0x31')](_0x121d63[_0xa49a('0x32')])||_[_0xa49a('0x31')](_0x121d63[_0xa49a('0x33')])||_[_0xa49a('0x31')](_0x121d63['Interval'][_0xa49a('0x34')])){_0xff07a8=CAMPAIGN_STATUS[_0xa49a('0x35')];}else if(_[_0xa49a('0x36')](_0x121d63[_0xa49a('0x32')])||_[_0xa49a('0x36')](_0x121d63['Interval']['Intervals'])){_0xff07a8=CAMPAIGN_STATUS[_0xa49a('0x37')];}else if(_0x396413&&!timezones[_0x396413]){_0xff07a8=CAMPAIGN_STATUS[_0xa49a('0x38')];}return _0xff07a8;}function checkAnyValidTrunk(_0x3384c4,_0x34a345){var _0x6d45a=null;var _0x24ec11=_0xa49a('0x39');var _0xbf37d4=[_0xa49a('0x3a'),'unmonitored'];var _0x276bd8=!![];if(_0x3384c4[_0xa49a('0x2c')]&&_0x3384c4[_0xa49a('0x2c')][_0xa49a('0x2e')]){_0x24ec11+=_0x3384c4[_0xa49a('0x2c')][_0xa49a('0x2d')];_0x6d45a=_0x34a345[_0x24ec11];_0x276bd8=_0xbf37d4['includes'](_0x6d45a[_0xa49a('0x3b')]);}else if(_0x3384c4['TrunkBackup']&&_0x3384c4[_0xa49a('0x3c')][_0xa49a('0x2e')]){_0x24ec11+=_0x3384c4[_0xa49a('0x3c')][_0xa49a('0x2d')];_0x6d45a=_0x34a345[_0x24ec11];_0x276bd8=_0xbf37d4[_0xa49a('0x3d')](_0x6d45a[_0xa49a('0x3b')]);}return _0x276bd8;}function getQueueCampaignStatusMessage(_0x303902,_0x4cec99){var _0x2a3104=CAMPAIGN_STATUS[_0xa49a('0x4')];var _0xbe86=isPreviewCampaign(_0x303902);if(!isQueueCampaignActive(_0x303902)){if(_0xbe86){_0x2a3104=CAMPAIGN_STATUS[_0xa49a('0x3e')];}else{if(_0x303902[_0xa49a('0x2b')]===0x0&&_0x303902[_0xa49a('0x27')]===0x0&&_0x303902['waiting']===0x0&&(_0x303902[_0xa49a('0x28')]||0x0)===0x0){_0x2a3104=CAMPAIGN_STATUS[_0xa49a('0x3e')];}else{_0x2a3104=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x303902['loggedIn']===0x0){_0x2a3104=CAMPAIGN_STATUS[_0xa49a('0x3f')];}else if(!checkAnyValidTrunk(_0x303902,_0x4cec99)){_0x2a3104=CAMPAIGN_STATUS[_0xa49a('0x40')];}else if(!isPreviewCampaign(_0x303902)){var _0x3ed344=checkAnyValidQueueCampaignInterval(_0x303902);if(_0x3ed344){_0x2a3104=_0x3ed344;}}return _0x2a3104;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x516a4d){var _0x4e316d=CAMPAIGN_STATUS[_0xa49a('0x41')];if(_0x516a4d[_0xa49a('0x2b')]===0x0&&_0x516a4d[_0xa49a('0x27')]===0x0&&_0x516a4d[_0xa49a('0x29')]===0x0&&(_0x516a4d['pTalking']||0x0)===0x0){_0x4e316d=CAMPAIGN_STATUS[_0xa49a('0x3e')];}return _0x4e316d;}exports[_0xa49a('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xc0ec1a){var _0x4762cd=_0xc0ec1a[_0xa49a('0x43')](/"(.*?)"/);return _0x4762cd?_0x4762cd[0x1]:_0xc0ec1a;}exports[_0xa49a('0x44')]=extractCalleridName;function getCallerId(_0x18ff72,_0x102e5b,_0x3f6204){if(!_[_0xa49a('0x45')](_0x3f6204)&&typeof _0x3f6204===_0xa49a('0x46')&&!_[_0xa49a('0x36')](_0x3f6204)){if(!_[_0xa49a('0x45')](_0x102e5b)&&typeof _0x102e5b===_0xa49a('0x46')&&!_[_0xa49a('0x36')](_0x102e5b)){return util['format'](_0xa49a('0x47'),_0x102e5b,_0x3f6204);}return util[_0xa49a('0x48')](_0xa49a('0x47'),_0x3f6204,_0x3f6204);}if(!_[_0xa49a('0x45')](_0x18ff72)&&typeof _0x18ff72==='string'&&!_[_0xa49a('0x36')](_0x18ff72)){return _0x18ff72;}return _0xa49a('0x49');}exports[_0xa49a('0x4a')]=getCallerId;function getCallerIdRandom(_0x2c38d9,_0x42674f){var _0x98b0b3;var _0x553630;var _0x3fe989;if(_0x42674f<=0x0){_0x42674f=0x1;}_0x98b0b3=new RegExp(_0xa49a('0x4b')+_0x42674f+'}$');_0x553630=Math[_0xa49a('0x4c')](0xa,_0x42674f-0x1);_0x3fe989=Math[_0xa49a('0x4c')](0xa,_0x42674f)-0x1;return util[_0xa49a('0x48')]('%s',_[_0xa49a('0x4d')](_0x2c38d9,_0x98b0b3,_[_0xa49a('0x4e')](_0x553630,_0x3fe989)['toString']()));}exports[_0xa49a('0x4f')]=getCallerIdRandom;function decrementOriginate(_0x1c80be){if(_0x1c80be[_0xa49a('0x2b')]&&_0x1c80be['originated']>0x0){_0x1c80be[_0xa49a('0x2b')]-=0x1;}else{logger['error'](_0xa49a('0x50'));}}exports[_0xa49a('0x51')]=decrementOriginate;function checkContactEmpty(_0x5251f1){return _0x5251f1&&_0x5251f1[_0xa49a('0x52')]>0x0;}exports[_0xa49a('0x53')]=checkContactEmpty;function erlangb(_0x32926e,_0x2bf647){if(_0x2bf647===0x0){return 0x0;}var _0x59b70=0x1;for(var _0x1078e7=0x1;_0x1078e7<=_0x2bf647;_0x1078e7+=0x1){_0x59b70=0x1+_0x59b70*_0x1078e7/_0x32926e;}return 0x1/_0x59b70;}exports[_0xa49a('0x54')]=erlangb;function checkContactLowerLimitOriginate(_0x355d6e,_0x2126dd,_0x490339){if(_0x2126dd>_0x490339){for(var _0x37982f=0x0;_0x37982f<_0x2126dd-_0x490339;_0x37982f+=0x1){decrementOriginate(_0x355d6e);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xb342f5){var _0x1b83cd={};var _0x2c32e0=['id',_0xa49a('0x55'),'description',_0xa49a('0x56'),'updatedAt'];if(_0xb342f5){for(var _0x50d8d1 in _0xb342f5){if(typeof _0xb342f5[_0x50d8d1]!==_0xa49a('0x57')){if(!_[_0xa49a('0x31')](_0xb342f5[_0x50d8d1])&&!_0x2c32e0[_0xa49a('0x3d')](_0x50d8d1)){_0x1b83cd[util['format'](_0xa49a('0x58'),_0xa49a('0x59'),_0x50d8d1[_0xa49a('0x5a')]())]=_0xb342f5[_0x50d8d1];}}}}return _0x1b83cd;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ebfb25d..ecf68d3 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(_0xcaf578,_0x2bcb25){var _0x1e0176=function(_0x4ab3de){while(--_0x4ab3de){_0xcaf578['push'](_0xcaf578['shift']());}};_0x1e0176(++_0x2bcb25);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x504d2e,_0x2eba7d){var _0x42d3b9=function(_0x4289e0){while(--_0x4289e0){_0x504d2e['push'](_0x504d2e['shift']());}};_0x42d3b9(++_0x2eba7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 63fb532..2bbdd7e 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 _0x7103=['calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','.pdf','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncFaxStatus','receivefax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','syncNewExten','value','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate'];(function(_0x486210,_0x22a8b7){var _0x5aed7b=function(_0x1c310d){while(--_0x1c310d){_0x486210['push'](_0x486210['shift']());}};_0x5aed7b(++_0x22a8b7);}(_0x7103,0x129));var _0x3710=function(_0x5d8d3c,_0x19b7ab){_0x5d8d3c=_0x5d8d3c-0x0;var _0x2d6b04=_0x7103[_0x5d8d3c];return _0x2d6b04;};'use strict';var util=require(_0x3710('0x0'));var _=require(_0x3710('0x1'));var BPromise=require(_0x3710('0x2'));var uuid=require(_0x3710('0x3'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3710('0x4'));var gs=require(_0x3710('0x5'));var logger=require(_0x3710('0x6'))(_0x3710('0x7'));var ami=require(_0x3710('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x3710('0x9'));var Action=require(_0x3710('0xa'));var faxAccount=require(_0x3710('0xb'));var attachment=require(_0x3710('0xc'));var faxMessage=require(_0x3710('0xd'));function Fax(_0x46a62f){this[_0x3710('0xe')]={};this[_0x3710('0xf')]=_0x46a62f['faxAccounts'];this[_0x3710('0x10')]=_0x46a62f[_0x3710('0x10')];this[_0x3710('0x11')]={};ami['on'](_0x3710('0x12'),this[_0x3710('0x13')][_0x3710('0x14')](this));ami['on'](_0x3710('0x15'),this[_0x3710('0x16')][_0x3710('0x14')](this));ami['on'](_0x3710('0x17'),this['syncNewState'][_0x3710('0x14')](this));ami['on'](_0x3710('0x18'),this['syncNewExten'][_0x3710('0x14')](this));ami['on']('faxstatus',this[_0x3710('0x19')]['bind'](this));ami['on'](_0x3710('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0x3710('0x1b'),this[_0x3710('0x1c')][_0x3710('0x14')](this));ami['on']('originateresponse',this[_0x3710('0x1d')][_0x3710('0x14')](this));}Fax[_0x3710('0x1e')][_0x3710('0x13')]=function(_0x5b2333){if(_0x5b2333[_0x3710('0x1f')]===_0x3710('0x20')){for(var _0x4ff42f in this['faxAccounts']){if(this[_0x3710('0xf')][_0x3710('0x21')](_0x4ff42f)){if(_0x5b2333[_0x3710('0x22')]===this[_0x3710('0xf')][_0x4ff42f]['localstationid']){this[_0x3710('0xe')][_0x5b2333[_0x3710('0x23')]]={};this['channels'][_0x5b2333[_0x3710('0x23')]][_0x3710('0x24')]=_0x5b2333['channel'];this[_0x3710('0xe')][_0x5b2333[_0x3710('0x23')]]['id']=this[_0x3710('0xf')][_0x4ff42f]['id'];this[_0x3710('0xe')][_0x5b2333[_0x3710('0x23')]][_0x3710('0x25')]=this[_0x3710('0xf')][_0x4ff42f][_0x3710('0x25')];logger[_0x3710('0x26')](_0x5b2333[_0x3710('0x23')],_0x3710('0x27'));}}}}if(this[_0x3710('0x11')][_0x5b2333[_0x3710('0x23')]]){this[_0x3710('0xe')][_0x5b2333[_0x3710('0x23')]]={};this[_0x3710('0xe')][_0x5b2333[_0x3710('0x23')]][_0x3710('0x24')]=_0x5b2333[_0x3710('0x24')];logger[_0x3710('0x26')](_0x5b2333[_0x3710('0x23')],_0x3710('0x27'));}};Fax[_0x3710('0x1e')][_0x3710('0x16')]=function(_0x5e6435){if(this[_0x3710('0xe')][_0x5e6435['uniqueid']]){for(var _0x35dd66 in _0x5e6435[_0x3710('0x28')]){if(_0x5e6435[_0x3710('0x28')][_0x3710('0x21')](_0x35dd66)){this['channels'][_0x5e6435['uniqueid']][_0x35dd66]=_0x5e6435['value'];}}}};Fax['prototype']['syncNewState']=function(_0x4cc63b){if(this['channels'][_0x4cc63b[_0x3710('0x23')]]){this[_0x3710('0xe')][_0x4cc63b[_0x3710('0x23')]]['channelstate']=_0x4cc63b[_0x3710('0x29')];this[_0x3710('0xe')][_0x4cc63b[_0x3710('0x23')]][_0x3710('0x2a')]=_0x4cc63b[_0x3710('0x2a')];}};Fax['prototype'][_0x3710('0x2b')]=function(_0x10ce90){if(this[_0x3710('0xe')][_0x10ce90['uniqueid']]){for(var _0x33fd7b in _0x10ce90['variable']){if(_0x10ce90[_0x3710('0x28')][_0x3710('0x21')](_0x33fd7b)){this[_0x3710('0xe')][_0x10ce90[_0x3710('0x23')]][_0x33fd7b]=_0x10ce90[_0x3710('0x2c')];}}}};Fax[_0x3710('0x1e')][_0x3710('0x19')]=function(_0x1019ae){if(this[_0x3710('0xe')][_0x1019ae[_0x3710('0x23')]]){this[_0x3710('0xe')][_0x1019ae[_0x3710('0x23')]]['operation']=_0x1019ae['operation'];this[_0x3710('0xe')][_0x1019ae[_0x3710('0x23')]]['status']=_0x1019ae[_0x3710('0x2d')];this[_0x3710('0xe')][_0x1019ae['uniqueid']][_0x3710('0x2e')]=_0x1019ae['localstationid'];this[_0x3710('0xe')][_0x1019ae[_0x3710('0x23')]]['filename']=_0x1019ae[_0x3710('0x2f')];logger[_0x3710('0x26')](_0x1019ae[_0x3710('0x23')],_0x3710('0x30'));}};Fax[_0x3710('0x1e')][_0x3710('0x31')]=function(_0x2d5a28){var _0x1326c9=this;if(this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]]){var _0x19eb3c=this['channels'][_0x2d5a28['uniqueid']]['id'];this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x32')]=_0x2d5a28[_0x3710('0x32')];this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x33')]=_0x2d5a28['pagestransferred'];this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x2e')]=_0x2d5a28[_0x3710('0x2e')];this['channels'][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x34')]=_0x2d5a28[_0x3710('0x34')];this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x35')]=_0x2d5a28[_0x3710('0x35')];this['channels'][_0x2d5a28[_0x3710('0x23')]][_0x3710('0x2f')]=_0x2d5a28[_0x3710('0x2f')];this[_0x3710('0xe')][_0x2d5a28[_0x3710('0x23')]]['calleridnum']=_0x2d5a28[_0x3710('0x36')];if(this[_0x3710('0xe')][_0x2d5a28['uniqueid']][_0x3710('0x33')]>0x0){tiff2pdf(_0x2d5a28['filename'],_0x3710('0x37'),function(_0x19d997){logger[_0x3710('0x26')](_0x2d5a28['uniqueid'],_0x3710('0x38'),_0x19d997[_0x3710('0x39')]);attachment[_0x3710('0x3a')]({'name':path[_0x3710('0x3b')](_0x2d5a28[_0x3710('0x2f')])[_0x3710('0x25')],'basename':path[_0x3710('0x3b')](_0x2d5a28['filename'])['name']+'.pdf','type':_0x3710('0x3c')})[_0x3710('0x3d')](function(_0x5dd5c6){faxAccount[_0x3710('0x3e')](_0x19eb3c,{'from':_0x2d5a28['calleridnum'],'mapKey':_0x3710('0x7'),'body':path['parse'](_0x2d5a28[_0x3710('0x2f')])[_0x3710('0x25')]+_0x3710('0x3f'),'AttachmentId':_0x5dd5c6['id']})[_0x3710('0x40')](function(_0x32f355){logger['error'](_0x2d5a28[_0x3710('0x23')],_0x3710('0x41'),JSON[_0x3710('0x42')](_0x32f355));});})[_0x3710('0x40')](function(_0xdcfce0){logger['error'](_0x2d5a28[_0x3710('0x23')],'\x20receiveFax\x20',JSON[_0x3710('0x42')](_0xdcfce0));});});}logger[_0x3710('0x26')](_0x2d5a28[_0x3710('0x23')],_0x3710('0x43'));}};Fax['prototype'][_0x3710('0x1d')]=function(_0x234a91){if(this['actions'][_0x234a91[_0x3710('0x23')]]){_[_0x3710('0x44')](this[_0x3710('0xe')][_0x234a91[_0x3710('0x23')]],_[_0x3710('0x45')](_0x234a91,['response',_0x3710('0x46')]));}};function updateStatus(_0x307c20){if(_0x307c20[_0x3710('0x47')]){faxMessage[_0x3710('0x48')](_0x307c20[_0x3710('0x47')],{'failMessage':_0x3710('0x49')})[_0x3710('0x3d')](function(_0x3081c1){ut['logger'](_0x3710('0x4a'),_0x3081c1);})[_0x3710('0x40')](function(_0x403b8b){ut[_0x3710('0x4b')](_0x3710('0x4c'),_0x403b8b);});}else{ut['logger'](_0x3710('0x4d'));}}Fax['prototype']['updateStatus']=function(_0x1bad50,_0x5f31ac,_0x10861e){var _0x2bd418=this;var _0x153470={};if(_0x5f31ac){_0x153470={'read':_0x5f31ac};}else{_0x153470={'failMessage':_0x10861e};}if(this[_0x3710('0x11')][_0x1bad50][_0x3710('0x47')]){faxMessage[_0x3710('0x48')](this[_0x3710('0x11')][_0x1bad50][_0x3710('0x47')],_0x153470)[_0x3710('0x3d')](function(_0x1b1ec0){ut[_0x3710('0x4b')](_0x3710('0x4e'),_0x1b1ec0);})[_0x3710('0x40')](function(_0x450dd5){ut[_0x3710('0x4b')](_0x3710('0x4f'),_0x450dd5);})[_0x3710('0x50')](function(){delete _0x2bd418[_0x3710('0xe')][_0x1bad50];delete _0x2bd418['actions'][_0x1bad50];});}else{ut[_0x3710('0x4b')](_0x3710('0x51'));delete this[_0x3710('0xe')][_0x1bad50];delete this[_0x3710('0x11')][_0x1bad50];}};Fax[_0x3710('0x1e')]['syncHangup']=function(_0x3dfb2e){var _0x2326c7=this;if(this['channels'][_0x3dfb2e[_0x3710('0x23')]]){if(this[_0x3710('0x11')][_0x3dfb2e['uniqueid']]){this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]]['id']=this[_0x3710('0x11')][_0x3dfb2e['uniqueid']]['id'];this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]][_0x3710('0x25')]=this[_0x3710('0x11')][_0x3dfb2e[_0x3710('0x23')]][_0x3710('0x25')];}logger[_0x3710('0x26')](_0x3dfb2e['uniqueid'],this[_0x3710('0x11')][_0x3dfb2e[_0x3710('0x23')]]?_0x3710('0x52'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x3710('0xe')][_0x3dfb2e['uniqueid']]));if(this[_0x3710('0x11')][_0x3dfb2e[_0x3710('0x23')]]){if(this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]][_0x3710('0x53')]>0x0&&this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]]['faxstatus']===_0x3710('0x54')){this[_0x3710('0x55')](_0x3dfb2e['uniqueid'],!![]);}else{this[_0x3710('0x55')](_0x3dfb2e['uniqueid'],![],this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]][_0x3710('0x56')]?_0x3710('0x57')+this[_0x3710('0xe')][_0x3dfb2e[_0x3710('0x23')]][_0x3710('0x56')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x3710('0x58')]=function(_0xfcbf5b){var _0x53adba=this;return new BPromise(function(_0x32132d,_0x4148ea){_0x53adba[_0x3710('0x59')](_0xfcbf5b,_0x53adba['faxAccounts'][_0xfcbf5b[_0x3710('0x5a')]])['then'](function(_0x442125){ut[_0x3710('0x4b')]('[Fax][execOriginate][success]',_0x442125);_0x32132d(ut[_0x3710('0x39')]('Fax\x20received'));})[_0x3710('0x40')](function(_0x44318c){ut[_0x3710('0x4b')](_0x3710('0x5b'),_0x44318c);updateStatus(_0xfcbf5b);_0x4148ea(ut[_0x3710('0x39')]('Fax\x20failed'));});});};Fax[_0x3710('0x1e')][_0x3710('0x5c')]=function(_0x3149ae){var _0x542531=this;return new BPromise(function(_0x47aca3,_0x25d951){var _0x4d48f4=_0x542531[_0x3710('0x5d')](_0x542531[_0x3710('0xf')][_0x3149ae[_0x3710('0x5a')]][_0x3710('0x5e')],_0x3149ae);if(_0x4d48f4[_0x3710('0x5f')]){_0x47aca3(ut[_0x3710('0x39')]('Trunk\x20Reachable'));}else{_0x25d951(ut[_0x3710('0x39')](_0x4d48f4[_0x3710('0x39')]));}});};function originate(_0x8dab1a,_0x1f9ee1,_0x3b54f3){return new BPromise(function(_0x3b0e18,_0x5ee881){if(_0x3b54f3){var _0x5cb6ce=util['format'](_0x3710('0x60'),path[_0x3710('0x3b')](_0x8dab1a[_0x3710('0x61')])[_0x3710('0x25')],_0x8dab1a[_0x3710('0x61')]);gs['execute'](_0x5cb6ce)['then'](function(){_0x8dab1a[_0x3710('0x61')]=util[_0x3710('0x62')]('%s/%s.tif',path[_0x3710('0x3b')](_0x8dab1a['path'])[_0x3710('0x63')],path[_0x3710('0x3b')](_0x8dab1a['path'])[_0x3710('0x25')]);_0x1f9ee1[_0x3710('0x64')]=_0x8dab1a[_0x3710('0x61')];ut[_0x3710('0x4b')](_0x3710('0x65'),'');ami[_0x3710('0x66')](ut[_0x3710('0x67')](_0x8dab1a,_0x1f9ee1))[_0x3710('0x3d')](function(_0x553d9e){_0x3b0e18(_0x553d9e);})[_0x3710('0x40')](function(_0x3bf936){_0x5ee881(_0x3bf936);});})[_0x3710('0x40')](function(_0x1f5721){_0x5ee881(_0x1f5721);});}else{ami[_0x3710('0x66')](ut['variablesAction'](_0x8dab1a,_0x1f9ee1))[_0x3710('0x3d')](function(_0x267b59){_0x3b0e18(_0x267b59);})[_0x3710('0x40')](function(_0x21b3a5){_0x5ee881(_0x21b3a5);});}});}Fax[_0x3710('0x1e')][_0x3710('0x59')]=function(_0xae4ef4,_0x398af7){var _0x1d8503=this;return new BPromise(function(_0x41ba4a,_0x5694d2){var _0x44e5da=uuid['v4']();var _0x15a1f1=ut['addVariables'](_0xae4ef4,_0x398af7);_0x1d8503['actions'][_0x44e5da]=new Action(_0x44e5da,_0x398af7,_0xae4ef4);var _0x50641c=_0x1d8503['actions'][_0x44e5da];if(path[_0x3710('0x3b')](_0xae4ef4['path'])[_0x3710('0x68')]==='.pdf'){originate(_0x50641c,_0x15a1f1,!![])[_0x3710('0x3d')](function(_0x3614a0){_0x41ba4a(_0x3614a0);})[_0x3710('0x40')](function(_0x1fd50d){_0x5694d2(_0x1fd50d);});}else{originate(_0x50641c,_0x15a1f1,![])['then'](function(_0x321eb1){_0x41ba4a(_0x321eb1);})[_0x3710('0x40')](function(_0x1411bc){_0x5694d2(_0x1411bc);});}});};Fax[_0x3710('0x1e')][_0x3710('0x69')]=function(_0x38f844){return!_['isNil'](_0x38f844)&&!_[_0x3710('0x6a')](_0x38f844[_0x3710('0x25')])&&!_[_0x3710('0x6a')](_0x38f844[_0x3710('0x6b')])&&_0x38f844[_0x3710('0x6b')]&&!_[_0x3710('0x6a')](this[_0x3710('0x10')][util['format'](_0x3710('0x6c'),_0x38f844[_0x3710('0x25')])])&&!_[_0x3710('0x6a')](this[_0x3710('0x10')][util['format'](_0x3710('0x6c'),_0x38f844['name'])][_0x3710('0x2d')])&&(this['trunks'][util[_0x3710('0x62')](_0x3710('0x6c'),_0x38f844['name'])][_0x3710('0x2d')]===_0x3710('0x6d')||this[_0x3710('0x10')][util['format'](_0x3710('0x6c'),_0x38f844['name'])]['status']===_0x3710('0x6e'));};Fax[_0x3710('0x1e')][_0x3710('0x5d')]=function(_0x4f486c,_0x42c3d0){if(!this['isTrunkReachable'](_0x4f486c)){ut[_0x3710('0x4b')](_0x3710('0x6f'),_[_0x3710('0x6a')](_0x4f486c)?'':_0x4f486c['name']+_0x3710('0x70'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x3710('0x6a')](_0x42c3d0['fax'])){ut[_0x3710('0x4b')](_0x3710('0x71'),JSON[_0x3710('0x42')](_0x42c3d0));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3710('0x6a')](_0x42c3d0[_0x3710('0x61')])){ut[_0x3710('0x4b')](_0x3710('0x72'),JSON[_0x3710('0x42')](_0x42c3d0));return{'isValid':![],'message':_0x3710('0x73')};}return{'isValid':!![],'message':_0x3710('0x74')};};module['exports']=Fax; \ No newline at end of file +var _0xf6dc=['receivefax','syncReceiveFax','syncHangup','originateresponse','prototype','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','syncNewState','channelstate','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','parse','then','notify','.pdf','catch','\x20notify\x20','\x20receiveFax\x20','stringify','syncOriginateResponse','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','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','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','syncVarSet','bind','syncNewExten','faxstatus','syncFaxStatus'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xf6dc,0xbd));var _0xcf6d=function(_0x52d441,_0x343fb0){_0x52d441=_0x52d441-0x0;var _0x5cf70f=_0xf6dc[_0x52d441];return _0x5cf70f;};'use strict';var util=require(_0xcf6d('0x0'));var _=require(_0xcf6d('0x1'));var BPromise=require(_0xcf6d('0x2'));var uuid=require('uuid');var moment=require(_0xcf6d('0x3'));var path=require(_0xcf6d('0x4'));var tiff2pdf=require(_0xcf6d('0x5'));var gs=require('./util/gs');var logger=require(_0xcf6d('0x6'))(_0xcf6d('0x7'));var ami=require(_0xcf6d('0x8'));var rpcDb=require(_0xcf6d('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0xcf6d('0xa'));var attachment=require(_0xcf6d('0xb'));var faxMessage=require(_0xcf6d('0xc'));function Fax(_0x149484){this['channels']={};this[_0xcf6d('0xd')]=_0x149484[_0xcf6d('0xd')];this[_0xcf6d('0xe')]=_0x149484['trunks'];this[_0xcf6d('0xf')]={};ami['on'](_0xcf6d('0x10'),this[_0xcf6d('0x11')]['bind'](this));ami['on']('varset',this[_0xcf6d('0x12')][_0xcf6d('0x13')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on']('newexten',this[_0xcf6d('0x14')][_0xcf6d('0x13')](this));ami['on'](_0xcf6d('0x15'),this[_0xcf6d('0x16')][_0xcf6d('0x13')](this));ami['on'](_0xcf6d('0x17'),this[_0xcf6d('0x18')][_0xcf6d('0x13')](this));ami['on']('hangup',this[_0xcf6d('0x19')][_0xcf6d('0x13')](this));ami['on'](_0xcf6d('0x1a'),this['syncOriginateResponse'][_0xcf6d('0x13')](this));}Fax[_0xcf6d('0x1b')][_0xcf6d('0x11')]=function(_0x387f16){if(_0x387f16[_0xcf6d('0x1c')]===_0xcf6d('0x1d')){for(var _0x3cd146 in this[_0xcf6d('0xd')]){if(this[_0xcf6d('0xd')]['hasOwnProperty'](_0x3cd146)){if(_0x387f16[_0xcf6d('0x1e')]===this[_0xcf6d('0xd')][_0x3cd146][_0xcf6d('0x1f')]){this['channels'][_0x387f16['uniqueid']]={};this[_0xcf6d('0x20')][_0x387f16[_0xcf6d('0x21')]]['channel']=_0x387f16[_0xcf6d('0x22')];this[_0xcf6d('0x20')][_0x387f16[_0xcf6d('0x21')]]['id']=this[_0xcf6d('0xd')][_0x3cd146]['id'];this[_0xcf6d('0x20')][_0x387f16[_0xcf6d('0x21')]]['name']=this['faxAccounts'][_0x3cd146][_0xcf6d('0x23')];logger[_0xcf6d('0x24')](_0x387f16[_0xcf6d('0x21')],_0xcf6d('0x25'));}}}}if(this['actions'][_0x387f16['uniqueid']]){this[_0xcf6d('0x20')][_0x387f16['uniqueid']]={};this[_0xcf6d('0x20')][_0x387f16['uniqueid']][_0xcf6d('0x22')]=_0x387f16[_0xcf6d('0x22')];logger[_0xcf6d('0x24')](_0x387f16[_0xcf6d('0x21')],_0xcf6d('0x25'));}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x12')]=function(_0x1af8b4){if(this[_0xcf6d('0x20')][_0x1af8b4[_0xcf6d('0x21')]]){for(var _0x23eb46 in _0x1af8b4[_0xcf6d('0x26')]){if(_0x1af8b4[_0xcf6d('0x26')][_0xcf6d('0x27')](_0x23eb46)){this['channels'][_0x1af8b4[_0xcf6d('0x21')]][_0x23eb46]=_0x1af8b4['value'];}}}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x28')]=function(_0x26577f){if(this[_0xcf6d('0x20')][_0x26577f[_0xcf6d('0x21')]]){this[_0xcf6d('0x20')][_0x26577f[_0xcf6d('0x21')]][_0xcf6d('0x29')]=_0x26577f['channelstate'];this[_0xcf6d('0x20')][_0x26577f[_0xcf6d('0x21')]]['channelstatedesc']=_0x26577f['channelstatedesc'];}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x14')]=function(_0x12bf29){if(this[_0xcf6d('0x20')][_0x12bf29[_0xcf6d('0x21')]]){for(var _0x54b053 in _0x12bf29[_0xcf6d('0x26')]){if(_0x12bf29[_0xcf6d('0x26')][_0xcf6d('0x27')](_0x54b053)){this[_0xcf6d('0x20')][_0x12bf29['uniqueid']][_0x54b053]=_0x12bf29['value'];}}}};Fax['prototype'][_0xcf6d('0x16')]=function(_0x3dda85){if(this['channels'][_0x3dda85['uniqueid']]){this[_0xcf6d('0x20')][_0x3dda85['uniqueid']][_0xcf6d('0x2a')]=_0x3dda85[_0xcf6d('0x2a')];this['channels'][_0x3dda85[_0xcf6d('0x21')]][_0xcf6d('0x2b')]=_0x3dda85['status'];this['channels'][_0x3dda85[_0xcf6d('0x21')]][_0xcf6d('0x1f')]=_0x3dda85[_0xcf6d('0x1f')];this['channels'][_0x3dda85['uniqueid']]['filename']=_0x3dda85[_0xcf6d('0x2c')];logger['info'](_0x3dda85[_0xcf6d('0x21')],_0xcf6d('0x2d'));}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x18')]=function(_0x3bc834){var _0x3246f6=this;if(this['channels'][_0x3bc834[_0xcf6d('0x21')]]){var _0x27e734=this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]]['id'];this[_0xcf6d('0x20')][_0x3bc834['uniqueid']]['remotestationid']=_0x3bc834['remotestationid'];this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x2e')]=_0x3bc834[_0xcf6d('0x2e')];this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]]['localstationid']=_0x3bc834['localstationid'];this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x2f')]=_0x3bc834['resolution'];this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x30')]=_0x3bc834[_0xcf6d('0x30')];this[_0xcf6d('0x20')][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x2c')]=_0x3bc834[_0xcf6d('0x2c')];this['channels'][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x31')]=_0x3bc834[_0xcf6d('0x31')];if(this['channels'][_0x3bc834[_0xcf6d('0x21')]][_0xcf6d('0x2e')]>0x0){tiff2pdf(_0x3bc834[_0xcf6d('0x2c')],'/var/opt/motion2/server/files/attachments/',function(_0x1069c8){logger[_0xcf6d('0x24')](_0x3bc834['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x1069c8['message']);attachment['create']({'name':path[_0xcf6d('0x32')](_0x3bc834[_0xcf6d('0x2c')])[_0xcf6d('0x23')],'basename':path[_0xcf6d('0x32')](_0x3bc834[_0xcf6d('0x2c')])['name']+'.pdf','type':'application/pdf'})[_0xcf6d('0x33')](function(_0x24cf96){faxAccount[_0xcf6d('0x34')](_0x27e734,{'from':_0x3bc834['calleridnum'],'mapKey':'fax','body':path['parse'](_0x3bc834[_0xcf6d('0x2c')])[_0xcf6d('0x23')]+_0xcf6d('0x35'),'AttachmentId':_0x24cf96['id']})[_0xcf6d('0x36')](function(_0x5e6765){logger['error'](_0x3bc834[_0xcf6d('0x21')],_0xcf6d('0x37'),JSON['stringify'](_0x5e6765));});})[_0xcf6d('0x36')](function(_0x4290b3){logger['error'](_0x3bc834[_0xcf6d('0x21')],_0xcf6d('0x38'),JSON[_0xcf6d('0x39')](_0x4290b3));});});}logger[_0xcf6d('0x24')](_0x3bc834['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x3a')]=function(_0x3ad527){if(this[_0xcf6d('0xf')][_0x3ad527[_0xcf6d('0x21')]]){_['merge'](this[_0xcf6d('0x20')][_0x3ad527[_0xcf6d('0x21')]],_['pick'](_0x3ad527,[_0xcf6d('0x3b'),_0xcf6d('0x3c')]));}};function updateStatus(_0x2ec10c){if(_0x2ec10c[_0xcf6d('0x3d')]){faxMessage[_0xcf6d('0x3e')](_0x2ec10c['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xcf6d('0x33')](function(_0x1f903f){ut['logger']('[Fax][Message][Error][Updated]',_0x1f903f);})[_0xcf6d('0x36')](function(_0x2fd01c){ut[_0xcf6d('0x3f')](_0xcf6d('0x40'),_0x2fd01c);});}else{ut['logger'](_0xcf6d('0x41'));}}Fax[_0xcf6d('0x1b')][_0xcf6d('0x42')]=function(_0x15a1df,_0x476155,_0x49f45b){var _0x3b90c9=this;var _0x3c956e={};if(_0x476155){_0x3c956e={'read':_0x476155};}else{_0x3c956e={'failMessage':_0x49f45b};}if(this[_0xcf6d('0xf')][_0x15a1df][_0xcf6d('0x3d')]){faxMessage[_0xcf6d('0x3e')](this[_0xcf6d('0xf')][_0x15a1df][_0xcf6d('0x3d')],_0x3c956e)['then'](function(_0x2bdafe){ut['logger'](_0xcf6d('0x43'),_0x2bdafe);})['catch'](function(_0x410921){ut['logger'](_0xcf6d('0x44'),_0x410921);})['finally'](function(){delete _0x3b90c9[_0xcf6d('0x20')][_0x15a1df];delete _0x3b90c9['actions'][_0x15a1df];});}else{ut[_0xcf6d('0x3f')](_0xcf6d('0x45'));delete this[_0xcf6d('0x20')][_0x15a1df];delete this[_0xcf6d('0xf')][_0x15a1df];}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x19')]=function(_0x3150df){var _0x28c10c=this;if(this[_0xcf6d('0x20')][_0x3150df['uniqueid']]){if(this['actions'][_0x3150df['uniqueid']]){this[_0xcf6d('0x20')][_0x3150df['uniqueid']]['id']=this[_0xcf6d('0xf')][_0x3150df[_0xcf6d('0x21')]]['id'];this[_0xcf6d('0x20')][_0x3150df[_0xcf6d('0x21')]][_0xcf6d('0x23')]=this['actions'][_0x3150df['uniqueid']][_0xcf6d('0x23')];}logger[_0xcf6d('0x24')](_0x3150df[_0xcf6d('0x21')],this[_0xcf6d('0xf')][_0x3150df[_0xcf6d('0x21')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0xcf6d('0x39')](this[_0xcf6d('0x20')][_0x3150df[_0xcf6d('0x21')]]));if(this[_0xcf6d('0xf')][_0x3150df[_0xcf6d('0x21')]]){if(this['channels'][_0x3150df[_0xcf6d('0x21')]][_0xcf6d('0x46')]>0x0&&this[_0xcf6d('0x20')][_0x3150df[_0xcf6d('0x21')]][_0xcf6d('0x15')]===_0xcf6d('0x47')){this[_0xcf6d('0x42')](_0x3150df[_0xcf6d('0x21')],!![]);}else{this['updateStatus'](_0x3150df[_0xcf6d('0x21')],![],this[_0xcf6d('0x20')][_0x3150df[_0xcf6d('0x21')]][_0xcf6d('0x48')]?'SENDING\x20FAILED:\x20'+this[_0xcf6d('0x20')][_0x3150df['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0xcf6d('0x1b')][_0xcf6d('0x49')]=function(_0x286cd7){var _0x3cceaa=this;return new BPromise(function(_0x2f4d9f,_0x1f0a6c){_0x3cceaa[_0xcf6d('0x4a')](_0x286cd7,_0x3cceaa[_0xcf6d('0xd')][_0x286cd7[_0xcf6d('0x4b')]])[_0xcf6d('0x33')](function(_0x34971a){ut[_0xcf6d('0x3f')](_0xcf6d('0x4c'),_0x34971a);_0x2f4d9f(ut[_0xcf6d('0x4d')](_0xcf6d('0x4e')));})[_0xcf6d('0x36')](function(_0x1ecd2b){ut[_0xcf6d('0x3f')](_0xcf6d('0x4f'),_0x1ecd2b);updateStatus(_0x286cd7);_0x1f0a6c(ut[_0xcf6d('0x4d')](_0xcf6d('0x50')));});});};Fax[_0xcf6d('0x1b')][_0xcf6d('0x51')]=function(_0x56bf29){var _0x66c5b5=this;return new BPromise(function(_0xed6a90,_0x18b773){var _0x383bbb=_0x66c5b5[_0xcf6d('0x52')](_0x66c5b5[_0xcf6d('0xd')][_0x56bf29[_0xcf6d('0x4b')]][_0xcf6d('0x53')],_0x56bf29);if(_0x383bbb['isValid']){_0xed6a90(ut[_0xcf6d('0x4d')](_0xcf6d('0x54')));}else{_0x18b773(ut[_0xcf6d('0x4d')](_0x383bbb['message']));}});};function originate(_0x177f0d,_0x18a85b,_0xcd1d5d){return new BPromise(function(_0xb2edbb,_0x59800b){if(_0xcd1d5d){var _0xc42772=util[_0xcf6d('0x55')](_0xcf6d('0x56'),path['parse'](_0x177f0d[_0xcf6d('0x4')])['name'],_0x177f0d[_0xcf6d('0x4')]);gs[_0xcf6d('0x57')](_0xc42772)[_0xcf6d('0x33')](function(){_0x177f0d[_0xcf6d('0x4')]=util[_0xcf6d('0x55')](_0xcf6d('0x58'),path[_0xcf6d('0x32')](_0x177f0d[_0xcf6d('0x4')])[_0xcf6d('0x59')],path['parse'](_0x177f0d['path'])[_0xcf6d('0x23')]);_0x18a85b[_0xcf6d('0x5a')]=_0x177f0d['path'];ut[_0xcf6d('0x3f')]('Convert\x20pdf\x20to\x20tif','');ami[_0xcf6d('0x5b')](ut[_0xcf6d('0x5c')](_0x177f0d,_0x18a85b))['then'](function(_0x36ae86){_0xb2edbb(_0x36ae86);})[_0xcf6d('0x36')](function(_0x3d83d6){_0x59800b(_0x3d83d6);});})['catch'](function(_0x43bd1f){_0x59800b(_0x43bd1f);});}else{ami[_0xcf6d('0x5b')](ut['variablesAction'](_0x177f0d,_0x18a85b))[_0xcf6d('0x33')](function(_0x249274){_0xb2edbb(_0x249274);})['catch'](function(_0x2a584b){_0x59800b(_0x2a584b);});}});}Fax[_0xcf6d('0x1b')][_0xcf6d('0x4a')]=function(_0x43402e,_0x263e4b){var _0x1fed58=this;return new BPromise(function(_0x3c68b5,_0x365fa7){var _0x47499f=uuid['v4']();var _0xcce6a=ut[_0xcf6d('0x5d')](_0x43402e,_0x263e4b);_0x1fed58[_0xcf6d('0xf')][_0x47499f]=new Action(_0x47499f,_0x263e4b,_0x43402e);var _0x51f02e=_0x1fed58[_0xcf6d('0xf')][_0x47499f];if(path[_0xcf6d('0x32')](_0x43402e['path'])['ext']==='.pdf'){originate(_0x51f02e,_0xcce6a,!![])[_0xcf6d('0x33')](function(_0x2b62ef){_0x3c68b5(_0x2b62ef);})[_0xcf6d('0x36')](function(_0x3ebe36){_0x365fa7(_0x3ebe36);});}else{originate(_0x51f02e,_0xcce6a,![])[_0xcf6d('0x33')](function(_0x352c03){_0x3c68b5(_0x352c03);})[_0xcf6d('0x36')](function(_0x4f3289){_0x365fa7(_0x4f3289);});}});};Fax['prototype'][_0xcf6d('0x5e')]=function(_0x1f9aaa){return!_[_0xcf6d('0x5f')](_0x1f9aaa)&&!_[_0xcf6d('0x5f')](_0x1f9aaa[_0xcf6d('0x23')])&&!_[_0xcf6d('0x5f')](_0x1f9aaa[_0xcf6d('0x60')])&&_0x1f9aaa[_0xcf6d('0x60')]&&!_[_0xcf6d('0x5f')](this[_0xcf6d('0xe')][util[_0xcf6d('0x55')](_0xcf6d('0x61'),_0x1f9aaa['name'])])&&!_[_0xcf6d('0x5f')](this[_0xcf6d('0xe')][util[_0xcf6d('0x55')]('SIP/%s',_0x1f9aaa[_0xcf6d('0x23')])]['status'])&&(this[_0xcf6d('0xe')][util[_0xcf6d('0x55')](_0xcf6d('0x61'),_0x1f9aaa[_0xcf6d('0x23')])][_0xcf6d('0x2b')]===_0xcf6d('0x62')||this['trunks'][util[_0xcf6d('0x55')](_0xcf6d('0x61'),_0x1f9aaa[_0xcf6d('0x23')])]['status']===_0xcf6d('0x63'));};Fax[_0xcf6d('0x1b')]['checkTrunk']=function(_0x47943c,_0x366deb){if(!this[_0xcf6d('0x5e')](_0x47943c)){ut[_0xcf6d('0x3f')](_0xcf6d('0x64'),_[_0xcf6d('0x5f')](_0x47943c)?'':_0x47943c['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xcf6d('0x65')};}if(_['isNil'](_0x366deb[_0xcf6d('0x7')])){ut[_0xcf6d('0x3f')](_0xcf6d('0x66'),JSON[_0xcf6d('0x39')](_0x366deb));return{'isValid':![],'message':_0xcf6d('0x67')};}if(_[_0xcf6d('0x5f')](_0x366deb[_0xcf6d('0x4')])){ut[_0xcf6d('0x3f')](_0xcf6d('0x68'),JSON[_0xcf6d('0x39')](_0x366deb));return{'isValid':![],'message':_0xcf6d('0x69')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3a4e431..70b2f35 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 _0x1b45=['then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','error','inspect','notify','resolve'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x1b45,0x17f));var _0x51b4=function(_0x35c4e8,_0x18ff04){_0x35c4e8=_0x35c4e8-0x0;var _0x4a958a=_0x1b45[_0x35c4e8];return _0x4a958a;};'use strict';var util=require('util');var BPromise=require(_0x51b4('0x0'));var logger=require(_0x51b4('0x1'))(_0x51b4('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5adc05){return function(_0x47871c){logger[_0x51b4('0x3')](_0x5adc05,util[_0x51b4('0x4')](_0x47871c,{'showHidden':![],'depth':null}));};}exports[_0x51b4('0x5')]=function(_0x2efc8a,_0x28ae58){return BPromise[_0x51b4('0x6')]()[_0x51b4('0x7')](faxAccount[_0x51b4('0x5')](_0x2efc8a,_0x28ae58))[_0x51b4('0x8')](loggerCatch(_0x51b4('0x9')));}; \ No newline at end of file +var _0xa0c2=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','resolve','then','notify','[Notify]\x20','util','bluebird'];(function(_0x1abed5,_0x325dbd){var _0x2f28fc=function(_0x5c7606){while(--_0x5c7606){_0x1abed5['push'](_0x1abed5['shift']());}};_0x2f28fc(++_0x325dbd);}(_0xa0c2,0x153));var _0x2a0c=function(_0x291167,_0x482eff){_0x291167=_0x291167-0x0;var _0x102c7b=_0xa0c2[_0x291167];return _0x102c7b;};'use strict';var util=require(_0x2a0c('0x0'));var BPromise=require(_0x2a0c('0x1'));var logger=require(_0x2a0c('0x2'))(_0x2a0c('0x3'));var _=require(_0x2a0c('0x4'));var faxAccount=require(_0x2a0c('0x5'));function loggerCatch(_0x5b9b31){return function(_0x585b01){logger[_0x2a0c('0x6')](_0x5b9b31,util['inspect'](_0x585b01,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5d71ed,_0x38bb9d){return BPromise[_0x2a0c('0x7')]()[_0x2a0c('0x8')](faxAccount[_0x2a0c('0x9')](_0x5d71ed,_0x38bb9d))['catch'](loggerCatch(_0x2a0c('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 3221e44..1617b83 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 _0x785d=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x4b82eb,_0x29544f){var _0xb3d036=function(_0x588489){while(--_0x588489){_0x4b82eb['push'](_0x4b82eb['shift']());}};_0xb3d036(++_0x29544f);}(_0x785d,0x69));var _0xd785=function(_0x4feb7a,_0x18b69e){_0x4feb7a=_0x4feb7a-0x0;var _0x119bee=_0x785d[_0x4feb7a];return _0x119bee;};'use strict';var util=require(_0xd785('0x0'));var logger=require(_0xd785('0x1'))(_0xd785('0x2'));var BPromise=require(_0xd785('0x3'));var exec=require(_0xd785('0x4'))[_0xd785('0x5')];exports[_0xd785('0x6')]=function(_0x5ee1c9){return new BPromise(function(_0x5523bc,_0x54f4ab){exec(_0x5ee1c9,function(_0x5ce3e2,_0x32121c,_0x29d366){logger[_0xd785('0x7')](_0xd785('0x8'),_0x32121c);if(_0x5ce3e2){logger[_0xd785('0x7')](_0xd785('0x8'),_0xd785('0x9'),util[_0xd785('0xa')](_0x5ce3e2,{'showHidden':![],'depth':null}),_0x32121c,_0x29d366);_0x54f4ab(_0x5ce3e2);}_0x5523bc(_0x32121c);});});}; \ No newline at end of file +var _0x7009=['util','../../../../config/logger','child_process','exec','execute','info','Exec\x20gs'];(function(_0x581537,_0x69d09e){var _0x5d64e0=function(_0x2c320c){while(--_0x2c320c){_0x581537['push'](_0x581537['shift']());}};_0x5d64e0(++_0x69d09e);}(_0x7009,0x188));var _0x9700=function(_0x279212,_0x57f5e1){_0x279212=_0x279212-0x0;var _0x57a315=_0x7009[_0x279212];return _0x57a315;};'use strict';var util=require(_0x9700('0x0'));var logger=require(_0x9700('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x9700('0x2'))[_0x9700('0x3')];exports[_0x9700('0x4')]=function(_0x194229){return new BPromise(function(_0x5d1cc4,_0x3ab4f6){exec(_0x194229,function(_0x3a4823,_0x5c44f1,_0x3e72db){logger[_0x9700('0x5')](_0x9700('0x6'),_0x5c44f1);if(_0x3a4823){logger[_0x9700('0x5')](_0x9700('0x6'),'\x20Error\x20:',util['inspect'](_0x3a4823,{'showHidden':![],'depth':null}),_0x5c44f1,_0x3e72db);_0x3ab4f6(_0x3a4823);}_0x5d1cc4(_0x5c44f1);});});}; \ 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 5885a10..f275050 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 _0x30f2=['gateway','faxdetect','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','fax','message','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x30f2,0x14c));var _0x230f=function(_0x2c92f1,_0x35de77){_0x2c92f1=_0x2c92f1-0x0;var _0x25ee5a=_0x30f2[_0x2c92f1];return _0x25ee5a;};'use strict';var util=require(_0x230f('0x0'));var _=require(_0x230f('0x1'));var moment=require(_0x230f('0x2'));var logger=require('../../../../config/logger')(_0x230f('0x3'));exports[_0x230f('0x4')]=function(_0x180296){return{'message':_0x180296};};exports['logger']=function(_0x19a4a9,_0x477b7b){logger['info'](_0x19a4a9,util[_0x230f('0x5')](_0x477b7b,{'showHidden':![],'depth':null}));};exports[_0x230f('0x6')]=function(_0x20fda6,_0x5259f2){var _0x331f9f={'XMF-ECM':_0x5259f2['ecm'],'XMF-HEADERINFO':_0x5259f2[_0x230f('0x7')],'XMF-MINRATE':_0x5259f2[_0x230f('0x8')],'XMF-MAXRATE':_0x5259f2[_0x230f('0x9')],'XMF-MODEM':util[_0x230f('0xa')](_0x230f('0xb'),_0x5259f2[_0x230f('0xc')]),'XMF-GATEWAY':_0x5259f2[_0x230f('0xd')],'XMF-FAXDETECT':_0x5259f2[_0x230f('0xe')],'XMF-T38TIMEOUT':_0x5259f2['t38timeout'],'XMF-LOCALSTATIONID':_0x5259f2['localstationid'],'XMF-PATH':_0x20fda6['path']};return _0x331f9f;};exports[_0x230f('0xf')]=function(_0x4a3f5a,_0x198968){return{'actionid':_0x4a3f5a[_0x230f('0x10')],'action':_0x230f('0x11'),'channel':_0x4a3f5a[_0x230f('0x12')],'Exten':_0x230f('0x13'),'Context':_0x230f('0x14'),'Priority':'1','callerid':util['format'](_0x230f('0x15'),_0x4a3f5a['headerinfo']?_0x4a3f5a[_0x230f('0x7')]:'',_0x4a3f5a[_0x230f('0x16')]),'variable':_0x198968,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4a3f5a['uniqueid']};}; \ No newline at end of file +var _0x98dc=['message','logger','info','inspect','addVariables','minrate','maxrate','format','modem','gateway','faxdetect','localstationid','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','fax'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x98dc,0x193));var _0xc98d=function(_0xdc253f,_0x3c1130){_0xdc253f=_0xdc253f-0x0;var _0x358a44=_0x98dc[_0xdc253f];return _0x358a44;};'use strict';var util=require(_0xc98d('0x0'));var _=require(_0xc98d('0x1'));var moment=require(_0xc98d('0x2'));var logger=require(_0xc98d('0x3'))(_0xc98d('0x4'));exports[_0xc98d('0x5')]=function(_0x28b38c){return{'message':_0x28b38c};};exports[_0xc98d('0x6')]=function(_0x50fca7,_0x2ac7cf){logger[_0xc98d('0x7')](_0x50fca7,util[_0xc98d('0x8')](_0x2ac7cf,{'showHidden':![],'depth':null}));};exports[_0xc98d('0x9')]=function(_0x4d1d87,_0x146995){var _0x28ed59={'XMF-ECM':_0x146995['ecm'],'XMF-HEADERINFO':_0x146995['headerinfo'],'XMF-MINRATE':_0x146995[_0xc98d('0xa')],'XMF-MAXRATE':_0x146995[_0xc98d('0xb')],'XMF-MODEM':util[_0xc98d('0xc')]('\x22%s\x22',_0x146995[_0xc98d('0xd')]),'XMF-GATEWAY':_0x146995[_0xc98d('0xe')],'XMF-FAXDETECT':_0x146995[_0xc98d('0xf')],'XMF-T38TIMEOUT':_0x146995['t38timeout'],'XMF-LOCALSTATIONID':_0x146995[_0xc98d('0x10')],'XMF-PATH':_0x4d1d87['path']};return _0x28ed59;};exports[_0xc98d('0x11')]=function(_0xc1aa70,_0x160e7b){return{'actionid':_0xc1aa70[_0xc98d('0x12')],'action':'originate','channel':_0xc1aa70[_0xc98d('0x13')],'Exten':_0xc98d('0x14'),'Context':_0xc98d('0x15'),'Priority':'1','callerid':util[_0xc98d('0xc')](_0xc98d('0x16'),_0xc1aa70[_0xc98d('0x17')]?_0xc1aa70['headerinfo']:'',_0xc1aa70[_0xc98d('0x10')]),'variable':_0x160e7b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xc1aa70[_0xc98d('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1eb6fb5..e1626cd 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 _0x7a70=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports'];(function(_0x269ee0,_0x5e2727){var _0x4f970b=function(_0x11f55b){while(--_0x11f55b){_0x269ee0['push'](_0x269ee0['shift']());}};_0x4f970b(++_0x5e2727);}(_0x7a70,0x1dc));var _0x07a7=function(_0x144bc5,_0x5915fb){_0x144bc5=_0x144bc5-0x0;var _0x54eb45=_0x7a70[_0x144bc5];return _0x54eb45;};'use strict';var util=require(_0x07a7('0x0'));var moment=require(_0x07a7('0x1'));var server=require(_0x07a7('0x2'));var Realtime=require(_0x07a7('0x3'));var Report=require(_0x07a7('0x4'));var Acw=require(_0x07a7('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x07a7('0x6'));var Preview=require('./preview');var Fax=require(_0x07a7('0x7'));var user=require(_0x07a7('0x8'));var voiceQueue=require(_0x07a7('0x9'));var voiceQueueReport=require(_0x07a7('0xa'));var voiceCallReport=require(_0x07a7('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0x07a7('0xc'));var template=require(_0x07a7('0xd'));var cmHopperHistory=require(_0x07a7('0xe'));var campaign=require(_0x07a7('0xf'));var voiceExtension=require(_0x07a7('0x10'));var faxAccount=require(_0x07a7('0x11'));var zendesk=require(_0x07a7('0x12'));var salesforce=require(_0x07a7('0x13'));var sugarcrm=require(_0x07a7('0x14'));var freshdesk=require(_0x07a7('0x15'));var desk=require(_0x07a7('0x16'));var zoho=require(_0x07a7('0x17'));var vtiger=require(_0x07a7('0x18'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x07a7('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x07a7('0x1a')](_0x07a7('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x07a7('0x1b')]()[_0x07a7('0x1c')](user[_0x07a7('0x1d')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x1e')]())[_0x07a7('0x1c')](user[_0x07a7('0x1f')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x20')]())['then'](trunk[_0x07a7('0x21')]())[_0x07a7('0x1c')](realtime['initTrunks']())[_0x07a7('0x1c')](voiceQueue[_0x07a7('0x22')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x23')]())[_0x07a7('0x1c')](trigger[_0x07a7('0x24')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x25')]())[_0x07a7('0x1c')](template[_0x07a7('0x26')]())[_0x07a7('0x1c')](realtime['initTemplates']())[_0x07a7('0x1c')](zendesk[_0x07a7('0x27')]())[_0x07a7('0x1c')](realtime['initZendeskAccounts']())[_0x07a7('0x1c')](salesforce[_0x07a7('0x28')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x29')]())[_0x07a7('0x1c')](sugarcrm[_0x07a7('0x2a')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x07a7('0x2b')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x2c')]())[_0x07a7('0x1c')](desk[_0x07a7('0x2d')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x2e')]())[_0x07a7('0x1c')](zoho[_0x07a7('0x2f')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x30')]())['then'](vtiger[_0x07a7('0x31')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x32')]())['then'](freshsales[_0x07a7('0x33')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x34')]())[_0x07a7('0x1c')](servicenow[_0x07a7('0x35')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x36')]())[_0x07a7('0x1c')](dynamics365[_0x07a7('0x37')]())['then'](realtime[_0x07a7('0x38')]())[_0x07a7('0x1c')](campaign[_0x07a7('0x39')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x3a')]())[_0x07a7('0x1c')](voiceExtension[_0x07a7('0x3b')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x3c')]())[_0x07a7('0x1c')](faxAccount[_0x07a7('0x3d')]())[_0x07a7('0x1c')](realtime['initFaxAccounts']())[_0x07a7('0x1c')](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0x07a7('0x3e')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x3f')]())[_0x07a7('0x1c')](cmHopperHistory[_0x07a7('0x40')]())['then'](realtime[_0x07a7('0x41')]())[_0x07a7('0x1c')](cmHopperHistory[_0x07a7('0x42')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x43')]())['then'](voiceCallReport[_0x07a7('0x44')]())[_0x07a7('0x1c')](realtime[_0x07a7('0x45')]())[_0x07a7('0x46')](function(_0x4a3059){logger[_0x07a7('0x47')](_0x07a7('0x48'),util[_0x07a7('0x49')](_0x4a3059,{'showHidden':![],'depth':null}));});}function main(){return server[_0x07a7('0x4a')](realtime,preview,fax)[_0x07a7('0x1c')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x07a7('0x1c')](function(){report[_0x07a7('0x4b')]();setInterval(initRealtime,0x1388);})[_0x07a7('0x46')](function(_0x3c5b4b){logger['error'](_0x07a7('0x4c'),util[_0x07a7('0x49')](_0x3c5b4b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4fcf=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','util','./server','./report','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0x33f404,_0x344c7f){var _0x5c9437=function(_0xe33ec){while(--_0xe33ec){_0x33f404['push'](_0x33f404['shift']());}};_0x5c9437(++_0x344c7f);}(_0x4fcf,0x109));var _0xf4fc=function(_0x5a4779,_0x414192){_0x5a4779=_0x5a4779-0x0;var _0xa96b80=_0x4fcf[_0x5a4779];return _0xa96b80;};'use strict';var util=require(_0xf4fc('0x0'));var moment=require('moment');var server=require(_0xf4fc('0x1'));var Realtime=require('./realtime');var Report=require(_0xf4fc('0x2'));var Acw=require('./acw');var Trigger=require(_0xf4fc('0x3'));var Dialer=require('./dialer');var Preview=require(_0xf4fc('0x4'));var Fax=require(_0xf4fc('0x5'));var user=require(_0xf4fc('0x6'));var voiceQueue=require(_0xf4fc('0x7'));var voiceQueueReport=require(_0xf4fc('0x8'));var voiceCallReport=require(_0xf4fc('0x9'));var trunk=require(_0xf4fc('0xa'));var trigger=require('./rpc/trigger');var template=require(_0xf4fc('0xb'));var cmHopperHistory=require(_0xf4fc('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf4fc('0xd'));var zendesk=require(_0xf4fc('0xe'));var salesforce=require(_0xf4fc('0xf'));var sugarcrm=require(_0xf4fc('0x10'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xf4fc('0x11'));var vtiger=require(_0xf4fc('0x12'));var freshsales=require(_0xf4fc('0x13'));var servicenow=require(_0xf4fc('0x14'));var dynamics365=require(_0xf4fc('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(_0xf4fc('0x16'))(_0xf4fc('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf4fc('0x18')](_0xf4fc('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf4fc('0x18')](_0xf4fc('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xf4fc('0x1a')]()['then'](user[_0xf4fc('0x1b')]())['then'](realtime['initAgents']())[_0xf4fc('0x1c')](user[_0xf4fc('0x1d')]())['then'](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x1e')]())['then'](voiceQueue[_0xf4fc('0x1f')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x20')]())[_0xf4fc('0x1c')](trigger['getTriggers']())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x21')]())[_0xf4fc('0x1c')](template[_0xf4fc('0x22')]())['then'](realtime[_0xf4fc('0x23')]())[_0xf4fc('0x1c')](zendesk[_0xf4fc('0x24')]())[_0xf4fc('0x1c')](realtime['initZendeskAccounts']())['then'](salesforce[_0xf4fc('0x25')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x26')]())['then'](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xf4fc('0x27')]())[_0xf4fc('0x1c')](freshdesk[_0xf4fc('0x28')]())['then'](realtime['initFreshdeskAccounts']())[_0xf4fc('0x1c')](desk[_0xf4fc('0x29')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x2a')]())[_0xf4fc('0x1c')](zoho[_0xf4fc('0x2b')]())['then'](realtime[_0xf4fc('0x2c')]())[_0xf4fc('0x1c')](vtiger[_0xf4fc('0x2d')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x2e')]())['then'](freshsales[_0xf4fc('0x2f')]())[_0xf4fc('0x1c')](realtime['initFreshsalesAccounts']())[_0xf4fc('0x1c')](servicenow['getServicenowAccounts']())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x30')]())['then'](dynamics365[_0xf4fc('0x31')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x32')]())[_0xf4fc('0x1c')](campaign[_0xf4fc('0x33')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x34')]())['then'](voiceExtension[_0xf4fc('0x35')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x36')]())[_0xf4fc('0x1c')](faxAccount[_0xf4fc('0x37')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x38')]())[_0xf4fc('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0xf4fc('0x1a')]()[_0xf4fc('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x39')]())['then'](cmHopperHistory[_0xf4fc('0x3a')]())[_0xf4fc('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0xf4fc('0x1c')](cmHopperHistory[_0xf4fc('0x3b')]())[_0xf4fc('0x1c')](realtime[_0xf4fc('0x3c')]())['then'](voiceCallReport[_0xf4fc('0x3d')]())['then'](realtime[_0xf4fc('0x3e')]())['catch'](function(_0x488998){logger[_0xf4fc('0x3f')](_0xf4fc('0x40'),util[_0xf4fc('0x41')](_0x488998,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf4fc('0x42')](realtime,preview,fax)[_0xf4fc('0x1c')](function(){return initRealtime();})['then'](function(){return initParams();})[_0xf4fc('0x1c')](function(){report[_0xf4fc('0x43')]();setInterval(initRealtime,0x1388);})[_0xf4fc('0x44')](function(_0x48c523){logger[_0xf4fc('0x3f')](_0xf4fc('0x45'),util[_0xf4fc('0x41')](_0x48c523,{'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 6ed6ff9..adb63a1 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 _0x0b1b=['emit','user:presence','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','user:%s'];(function(_0x4dbb4d,_0x2d6cbe){var _0x39cf9f=function(_0x1c99b9){while(--_0x1c99b9){_0x4dbb4d['push'](_0x4dbb4d['shift']());}};_0x39cf9f(++_0x2d6cbe);}(_0x0b1b,0x6f));var _0xb0b1=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x0b1b[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0xb0b1('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0xb0b1('0x1'));var Redis=require(_0xb0b1('0x2'));var config=require(_0xb0b1('0x3'));config[_0xb0b1('0x4')]=_[_0xb0b1('0x5')](config[_0xb0b1('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb0b1('0x4')]));function Agent(_0x52a582){this['id']=_0x52a582['id']||0x0;this[_0xb0b1('0x6')]=_0x52a582[_0xb0b1('0x6')]||'';this[_0xb0b1('0x7')]=_0x52a582['email']||'';this['accountcode']=_0x52a582[_0xb0b1('0x8')]||'';this['fullname']=_0x52a582[_0xb0b1('0x9')]||'';this[_0xb0b1('0xa')]=_0xb0b1('0xb');this[_0xb0b1('0xc')]=0x0;this[_0xb0b1('0xd')]=_0xb0b1('0xb');this[_0xb0b1('0xe')]='';this['phone']='';this[_0xb0b1('0xf')]='';this[_0xb0b1('0x10')]='';this[_0xb0b1('0x11')]=_0x52a582['online']||![];this[_0xb0b1('0x12')]=_0xb0b1('0xb');this[_0xb0b1('0x13')]=0x0;this[_0xb0b1('0x14')]='';this[_0xb0b1('0x15')]='';this[_0xb0b1('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0xb0b1('0x17')][_0xb0b1('0x18')]=function(_0x1db9b4){var _0x20f7e7;if(_0x1db9b4&&_0x1db9b4[_0xb0b1('0xa')]){_0x20f7e7=_0x1db9b4[_0xb0b1('0xa')][_0xb0b1('0x19')]();switch(_0x20f7e7){case _0xb0b1('0x1a'):_0x20f7e7=_0xb0b1('0x1b');break;case'inuse':_0x20f7e7=_0xb0b1('0x1c');break;}}if(_0x20f7e7&&this[_0xb0b1('0x12')]!==_0x20f7e7||_0x1db9b4[_0xb0b1('0x1d')]){this[_0xb0b1('0x13')]=_[_0xb0b1('0x1e')](moment()[_0xb0b1('0x1f')]('x'));}if(_0x20f7e7){this['voiceStatus']=_0x20f7e7;}var _0xa7eb5d={'id':this['id'],'name':this[_0xb0b1('0x6')],'email':this[_0xb0b1('0x7')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0xb0b1('0xa')],'stateTime':this[_0xb0b1('0xc')],'status':this[_0xb0b1('0xd')],'address':this[_0xb0b1('0xe')],'online':this[_0xb0b1('0x11')],'voiceStatus':this[_0xb0b1('0x12')],'voiceStatusTime':this[_0xb0b1('0x13')],'voiceStatusCallerIdNumber':this[_0xb0b1('0x14')],'voiceStatusQueue':this[_0xb0b1('0x15')],'interface':this[_0xb0b1('0x10')],'onhold':this['onhold']};var _0x577341=md5(JSON['stringify'](_0xa7eb5d));if(this[_0xb0b1('0x1')]!==_0x577341){this[_0xb0b1('0x1')]=_0x577341;io['to'](util[_0xb0b1('0x1f')](_0xb0b1('0x20'),_0xa7eb5d[_0xb0b1('0x6')]))[_0xb0b1('0x21')]('user:save',_0xa7eb5d);io[_0xb0b1('0x21')](_0xb0b1('0x22'),_0xa7eb5d);}};module[_0xb0b1('0x23')]=Agent; \ No newline at end of file +var _0x6a15=['accountcode','fullname','state','unknown','stateTime','phone','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','voiceStatusTime','toNumber','format','status','voiceStatusCallerIdNumber','interface','stringify','user:%s','emit','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email'];(function(_0x44c8cb,_0x2e28c7){var _0x3bf406=function(_0x2dbe74){while(--_0x2dbe74){_0x44c8cb['push'](_0x44c8cb['shift']());}};_0x3bf406(++_0x2e28c7);}(_0x6a15,0x6a));var _0x56a1=function(_0x12cd12,_0x4d4351){_0x12cd12=_0x12cd12-0x0;var _0x4bed1b=_0x6a15[_0x12cd12];return _0x4bed1b;};'use strict';var _=require(_0x56a1('0x0'));var util=require(_0x56a1('0x1'));var moment=require('moment');var md5=require(_0x56a1('0x2'));var Redis=require(_0x56a1('0x3'));var config=require(_0x56a1('0x4'));config[_0x56a1('0x5')]=_[_0x56a1('0x6')](config[_0x56a1('0x5')],{'host':_0x56a1('0x7'),'port':0x18eb});var io=require(_0x56a1('0x8'))(new Redis(config[_0x56a1('0x5')]));function Agent(_0x4842f2){this['id']=_0x4842f2['id']||0x0;this['name']=_0x4842f2[_0x56a1('0x9')]||'';this[_0x56a1('0xa')]=_0x4842f2['email']||'';this[_0x56a1('0xb')]=_0x4842f2[_0x56a1('0xb')]||'';this[_0x56a1('0xc')]=_0x4842f2[_0x56a1('0xc')]||'';this[_0x56a1('0xd')]=_0x56a1('0xe');this[_0x56a1('0xf')]=0x0;this['status']=_0x56a1('0xe');this['address']='';this[_0x56a1('0x10')]='';this['mobile']='';this['interface']='';this[_0x56a1('0x11')]=_0x4842f2[_0x56a1('0x11')]||![];this[_0x56a1('0x12')]=_0x56a1('0xe');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x56a1('0x13')]='';this[_0x56a1('0x14')]=![];this[_0x56a1('0x15')]=![];this[_0x56a1('0x2')]='';}Agent['prototype'][_0x56a1('0x16')]=function(_0x1abcb1){var _0x30c01d;if(_0x1abcb1&&_0x1abcb1[_0x56a1('0xd')]){_0x30c01d=_0x1abcb1[_0x56a1('0xd')][_0x56a1('0x17')]();switch(_0x30c01d){case _0x56a1('0x18'):_0x30c01d='idle';break;case _0x56a1('0x19'):_0x30c01d=_0x56a1('0x1a');break;}}if(_0x30c01d&&this[_0x56a1('0x12')]!==_0x30c01d||_0x1abcb1[_0x56a1('0x1b')]){this[_0x56a1('0x1c')]=_[_0x56a1('0x1d')](moment()[_0x56a1('0x1e')]('x'));}if(_0x30c01d){this[_0x56a1('0x12')]=_0x30c01d;}var _0x561e0c={'id':this['id'],'name':this[_0x56a1('0x9')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x56a1('0xc')],'state':this['state'],'stateTime':this[_0x56a1('0xf')],'status':this[_0x56a1('0x1f')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x56a1('0x12')],'voiceStatusTime':this[_0x56a1('0x1c')],'voiceStatusCallerIdNumber':this[_0x56a1('0x20')],'voiceStatusQueue':this[_0x56a1('0x13')],'interface':this[_0x56a1('0x21')],'onhold':this['onhold']};var _0x1bc5b8=md5(JSON[_0x56a1('0x22')](_0x561e0c));if(this[_0x56a1('0x2')]!==_0x1bc5b8){this[_0x56a1('0x2')]=_0x1bc5b8;io['to'](util[_0x56a1('0x1e')](_0x56a1('0x23'),_0x561e0c['name']))['emit']('user:save',_0x561e0c);io[_0x56a1('0x24')](_0x56a1('0x25'),_0x561e0c);}};module[_0x56a1('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 73346e3..548ebb1 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 _0xba1c=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba1c,0x16c));var _0xcba1=function(_0x66002b,_0x2870d4){_0x66002b=_0x66002b-0x0;var _0x984709=_0xba1c[_0x66002b];return _0x984709;};'use strict';function Campaign(_0x1c7bd0){this['id']=_0x1c7bd0['id']||0x0;this[_0xcba1('0x0')]=_0x1c7bd0[_0xcba1('0x0')]||'';this[_0xcba1('0x1')]=_0x1c7bd0['type']||_0xcba1('0x2');this[_0xcba1('0x3')]=0x0;this[_0xcba1('0x4')]=0x0;this[_0xcba1('0x5')]=0x0;this[_0xcba1('0x6')]=0x0;this[_0xcba1('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0xcba1('0x8')]=_0x1c7bd0[_0xcba1('0x8')];this[_0xcba1('0x9')]=_0x1c7bd0[_0xcba1('0x9')];this[_0xcba1('0xa')]=_0x1c7bd0[_0xcba1('0xa')]||null;this[_0xcba1('0xb')]=_0x1c7bd0['dialGlobalInterval']?_0x1c7bd0[_0xcba1('0xb')]:null;this['dialOriginateCallerIdName']=_0x1c7bd0['dialOriginateCallerIdName'];this[_0xcba1('0xc')]=_0x1c7bd0[_0xcba1('0xc')];this['dialOriginateTimeout']=_0x1c7bd0['dialOriginateTimeout']||0x1e;this[_0xcba1('0xd')]=_0x1c7bd0[_0xcba1('0xd')];this[_0xcba1('0xe')]=_0x1c7bd0['dialCongestionRetryFrequency'];this[_0xcba1('0xf')]=_0x1c7bd0[_0xcba1('0xf')];this['dialBusyRetryFrequency']=_0x1c7bd0[_0xcba1('0x10')];this[_0xcba1('0x11')]=_0x1c7bd0[_0xcba1('0x11')];this[_0xcba1('0x12')]=_0x1c7bd0[_0xcba1('0x12')];this['dialGlobalMaxRetry']=_0x1c7bd0[_0xcba1('0x13')];this[_0xcba1('0x14')]=_0x1c7bd0['dialNoSuchNumberMaxRetry']||0x3;this[_0xcba1('0x15')]=_0x1c7bd0[_0xcba1('0x15')]||0x96;this[_0xcba1('0x16')]=_0x1c7bd0[_0xcba1('0x16')]||0x3;this[_0xcba1('0x17')]=_0x1c7bd0[_0xcba1('0x17')]||0x96;this[_0xcba1('0x18')]=_0x1c7bd0[_0xcba1('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x1c7bd0[_0xcba1('0x19')]||0x96;this[_0xcba1('0x1a')]=_0x1c7bd0[_0xcba1('0x1a')]||0x3;this[_0xcba1('0x1b')]=_0x1c7bd0[_0xcba1('0x1b')]||0x96;this[_0xcba1('0x1c')]=_0x1c7bd0['dialAgentRejectMaxRetry']||0x3;this[_0xcba1('0x1d')]=_0x1c7bd0['dialAgentRejectRetryFrequency']||0x96;this[_0xcba1('0x1e')]=_0x1c7bd0[_0xcba1('0x1e')]||_0xcba1('0x1f');this[_0xcba1('0x20')]=_0x1c7bd0[_0xcba1('0x20')]||undefined;this[_0xcba1('0x21')]=_0x1c7bd0[_0xcba1('0x21')]||undefined;this['dialCutDigit']=_0x1c7bd0['dialCutDigit']||undefined;this[_0xcba1('0x22')]=_0x1c7bd0[_0xcba1('0x22')]?_0x1c7bd0['TrunkBackup']:undefined;this[_0xcba1('0x23')]=_0x1c7bd0[_0xcba1('0x23')]?_0x1c7bd0['Trunk']:undefined;this[_0xcba1('0x24')]=_0x1c7bd0[_0xcba1('0x24')]?_0x1c7bd0[_0xcba1('0x24')]:undefined;this[_0xcba1('0x25')]=_0x1c7bd0[_0xcba1('0x25')]?_0x1c7bd0[_0xcba1('0x25')]:undefined;this[_0xcba1('0x26')]=_0x1c7bd0[_0xcba1('0x25')]?_0x1c7bd0[_0xcba1('0x25')][_0xcba1('0x0')]:undefined;this[_0xcba1('0x27')]=_0x1c7bd0[_0xcba1('0x27')]||![];this[_0xcba1('0x28')]=_0x1c7bd0[_0xcba1('0x28')];this[_0xcba1('0x29')]=_0x1c7bd0[_0xcba1('0x29')];this[_0xcba1('0x2a')]=_0x1c7bd0[_0xcba1('0x2a')];this[_0xcba1('0x2b')]=_0x1c7bd0[_0xcba1('0x2b')];this['dialAMDMinWordLength']=_0x1c7bd0[_0xcba1('0x2c')];this['dialAMDBetweenWordsSilence']=_0x1c7bd0[_0xcba1('0x2d')];this[_0xcba1('0x2e')]=_0x1c7bd0['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1c7bd0[_0xcba1('0x2f')];this['dialAMDMaximumWordLength']=_0x1c7bd0['dialAMDMaximumWordLength'];}module[_0xcba1('0x30')]=Campaign; \ No newline at end of file +var _0x13ac=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialAMDActive'];(function(_0x53c39c,_0x13a2c3){var _0x26e3b1=function(_0xf4e0c8){while(--_0xf4e0c8){_0x53c39c['push'](_0x53c39c['shift']());}};_0x26e3b1(++_0x13a2c3);}(_0x13ac,0x159));var _0xc13a=function(_0xd8ad9f,_0x332568){_0xd8ad9f=_0xd8ad9f-0x0;var _0x2ec5f5=_0x13ac[_0xd8ad9f];return _0x2ec5f5;};'use strict';function Campaign(_0x2ce4cf){this['id']=_0x2ce4cf['id']||0x0;this[_0xc13a('0x0')]=_0x2ce4cf['name']||'';this[_0xc13a('0x1')]=_0x2ce4cf[_0xc13a('0x1')]||_0xc13a('0x2');this[_0xc13a('0x3')]=0x0;this['temp']=0x0;this[_0xc13a('0x4')]=0x0;this[_0xc13a('0x5')]=0x0;this[_0xc13a('0x6')]='';this[_0xc13a('0x7')]=!![];this[_0xc13a('0x8')]=_0x2ce4cf['active'];this['limitCalls']=_0x2ce4cf[_0xc13a('0x9')];this[_0xc13a('0xa')]=_0x2ce4cf[_0xc13a('0xa')]||null;this[_0xc13a('0xb')]=_0x2ce4cf[_0xc13a('0xb')]?_0x2ce4cf[_0xc13a('0xb')]:null;this['dialOriginateCallerIdName']=_0x2ce4cf[_0xc13a('0xc')];this['dialOriginateCallerIdNumber']=_0x2ce4cf[_0xc13a('0xd')];this[_0xc13a('0xe')]=_0x2ce4cf[_0xc13a('0xe')]||0x1e;this[_0xc13a('0xf')]=_0x2ce4cf['dialCongestionMaxRetry'];this[_0xc13a('0x10')]=_0x2ce4cf[_0xc13a('0x10')];this[_0xc13a('0x11')]=_0x2ce4cf[_0xc13a('0x11')];this[_0xc13a('0x12')]=_0x2ce4cf[_0xc13a('0x12')];this['dialNoAnswerMaxRetry']=_0x2ce4cf[_0xc13a('0x13')];this[_0xc13a('0x14')]=_0x2ce4cf[_0xc13a('0x14')];this['dialGlobalMaxRetry']=_0x2ce4cf[_0xc13a('0x15')];this[_0xc13a('0x16')]=_0x2ce4cf[_0xc13a('0x16')]||0x3;this[_0xc13a('0x17')]=_0x2ce4cf['dialNoSuchNumberRetryFrequency']||0x96;this[_0xc13a('0x18')]=_0x2ce4cf[_0xc13a('0x18')]||0x3;this[_0xc13a('0x19')]=_0x2ce4cf['dialDropRetryFrequency']||0x96;this[_0xc13a('0x1a')]=_0x2ce4cf[_0xc13a('0x1a')]||0x3;this[_0xc13a('0x1b')]=_0x2ce4cf[_0xc13a('0x1b')]||0x96;this[_0xc13a('0x1c')]=_0x2ce4cf[_0xc13a('0x1c')]||0x3;this[_0xc13a('0x1d')]=_0x2ce4cf[_0xc13a('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x2ce4cf[_0xc13a('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2ce4cf['dialAgentRejectRetryFrequency']||0x96;this[_0xc13a('0x1f')]=_0x2ce4cf[_0xc13a('0x1f')]||_0xc13a('0x20');this[_0xc13a('0x21')]=_0x2ce4cf[_0xc13a('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2ce4cf['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xc13a('0x22')]=_0x2ce4cf['dialCutDigit']||undefined;this[_0xc13a('0x23')]=_0x2ce4cf['TrunkBackup']?_0x2ce4cf[_0xc13a('0x23')]:undefined;this['Trunk']=_0x2ce4cf['Trunk']?_0x2ce4cf[_0xc13a('0x24')]:undefined;this['Interval']=_0x2ce4cf['Interval']?_0x2ce4cf['Interval']:undefined;this['SquareProject']=_0x2ce4cf[_0xc13a('0x25')]?_0x2ce4cf[_0xc13a('0x25')]:undefined;this['dialQueueProject']=_0x2ce4cf['SquareProject']?_0x2ce4cf[_0xc13a('0x25')][_0xc13a('0x0')]:undefined;this[_0xc13a('0x26')]=_0x2ce4cf['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2ce4cf[_0xc13a('0x27')];this[_0xc13a('0x28')]=_0x2ce4cf[_0xc13a('0x28')];this[_0xc13a('0x29')]=_0x2ce4cf['dialAMDAfterGreetingSilence'];this[_0xc13a('0x2a')]=_0x2ce4cf[_0xc13a('0x2a')];this[_0xc13a('0x2b')]=_0x2ce4cf[_0xc13a('0x2b')];this[_0xc13a('0x2c')]=_0x2ce4cf[_0xc13a('0x2c')];this[_0xc13a('0x2d')]=_0x2ce4cf['dialAMDMaximumNumberOfWords'];this[_0xc13a('0x2e')]=_0x2ce4cf['dialAMDSilenceThreshold'];this[_0xc13a('0x2f')]=_0x2ce4cf[_0xc13a('0x2f')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3cd2fae..5ab0dd0 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 _0x1189=['monitor','monitorFilename','monitors','transferType','mohtime','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition'];(function(_0x45482f,_0x5da0c6){var _0x56477f=function(_0x2a1b53){while(--_0x2a1b53){_0x45482f['push'](_0x45482f['shift']());}};_0x56477f(++_0x5da0c6);}(_0x1189,0x17f));var _0x9118=function(_0x1e71b4,_0x51132c){_0x1e71b4=_0x1e71b4-0x0;var _0x13fa85=_0x1189[_0x1e71b4];return _0x13fa85;};'use strict';function Channel(){this[_0x9118('0x0')]=null;this[_0x9118('0x1')]='';this[_0x9118('0x2')]='';this[_0x9118('0x3')]=0x0;this['calleridname']='';this[_0x9118('0x4')]=undefined;this[_0x9118('0x5')]=undefined;this[_0x9118('0x6')]=0x0;this[_0x9118('0x7')]='';this[_0x9118('0x8')]=0x0;this[_0x9118('0x9')]=0x0;this[_0x9118('0xa')]=0x0;this['answered']=![];this[_0x9118('0xb')]=null;this[_0x9118('0xc')]=null;this[_0x9118('0xd')]=![];this[_0x9118('0xe')]=![];this[_0x9118('0xf')]='';this[_0x9118('0x10')]='';this['duration']=0x0;this[_0x9118('0x11')]=0x0;this[_0x9118('0x12')]=0x0;this[_0x9118('0x13')]=null;this[_0x9118('0x14')]=null;this[_0x9118('0x15')]=null;this[_0x9118('0x16')]=![];this[_0x9118('0x17')]=null;this['queue']=null;this[_0x9118('0x18')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x9118('0x19')]=undefined;this[_0x9118('0x1a')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xeb0f=['billableseconds','holdtime','type','monitor','monitorFilename','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration'];(function(_0x4b6cc6,_0x25d0f1){var _0x1ddd53=function(_0x44d989){while(--_0x44d989){_0x4b6cc6['push'](_0x4b6cc6['shift']());}};_0x1ddd53(++_0x25d0f1);}(_0xeb0f,0x176));var _0xfeb0=function(_0x19e7ce,_0x596fa1){_0x19e7ce=_0x19e7ce-0x0;var _0x3f6c51=_0xeb0f[_0x19e7ce];return _0x3f6c51;};'use strict';function Channel(){this[_0xfeb0('0x0')]=null;this['channel']='';this[_0xfeb0('0x1')]='';this[_0xfeb0('0x2')]=0x0;this[_0xfeb0('0x3')]='';this[_0xfeb0('0x4')]=undefined;this[_0xfeb0('0x5')]=undefined;this[_0xfeb0('0x6')]=0x0;this['context']='';this[_0xfeb0('0x7')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xfeb0('0x8')]=![];this[_0xfeb0('0x9')]=null;this[_0xfeb0('0xa')]=null;this[_0xfeb0('0xb')]=![];this[_0xfeb0('0xc')]=![];this[_0xfeb0('0xd')]='';this[_0xfeb0('0xe')]='';this[_0xfeb0('0xf')]=0x0;this[_0xfeb0('0x10')]=0x0;this[_0xfeb0('0x11')]=0x0;this[_0xfeb0('0x12')]=null;this['tag']=null;this['disposition']=null;this[_0xfeb0('0x13')]=![];this[_0xfeb0('0x14')]=null;this['queue']=null;this['monitors']=[];this[_0xfeb0('0x15')]=undefined;this[_0xfeb0('0x16')]=undefined;this[_0xfeb0('0x17')]=undefined;this[_0xfeb0('0x18')]=0x0;}module[_0xfeb0('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e490fa0..75ea648 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 _0x2a2a=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x1927a6,_0x4855e5){var _0x5e6f49=function(_0x4a5ceb){while(--_0x4a5ceb){_0x1927a6['push'](_0x1927a6['shift']());}};_0x5e6f49(++_0x4855e5);}(_0x2a2a,0xc4));var _0xa2a2=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0x2a2a[_0x2142c8];return _0x4286e9;};'use strict';function DeskAccount(_0xb57827){this['id']=_0xb57827['id']||0x0;this[_0xa2a2('0x0')]=_0xb57827[_0xa2a2('0x0')]||'';this['username']=_0xb57827[_0xa2a2('0x1')]||'';this[_0xa2a2('0x2')]=_0xb57827['remoteUri']||'';this[_0xa2a2('0x3')]=_0xb57827[_0xa2a2('0x3')]||'';this[_0xa2a2('0x4')]=_0xb57827[_0xa2a2('0x4')]||'';this[_0xa2a2('0x5')]=_0xb57827[_0xa2a2('0x5')]||'';this[_0xa2a2('0x6')]=_0xb57827[_0xa2a2('0x6')]||'';this[_0xa2a2('0x7')]=_0xb57827['token']||'';this[_0xa2a2('0x8')]=_0xb57827['tokenSecret']||'';this[_0xa2a2('0x9')]=_0xb57827['type']||'';this[_0xa2a2('0xa')]=_0xb57827['serverUrl']||'';this[_0xa2a2('0xb')]=_0xb57827[_0xa2a2('0xb')]||{};}module[_0xa2a2('0xc')]=DeskAccount; \ No newline at end of file +var _0x556c=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x51a58c,_0x5b0474){var _0x513149=function(_0x5e374f){while(--_0x5e374f){_0x51a58c['push'](_0x51a58c['shift']());}};_0x513149(++_0x5b0474);}(_0x556c,0xec));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};'use strict';function DeskAccount(_0x3a178b){this['id']=_0x3a178b['id']||0x0;this[_0xc556('0x0')]=_0x3a178b['name']||'';this[_0xc556('0x1')]=_0x3a178b['username']||'';this[_0xc556('0x2')]=_0x3a178b[_0xc556('0x2')]||'';this[_0xc556('0x3')]=_0x3a178b[_0xc556('0x3')]||'';this[_0xc556('0x4')]=_0x3a178b[_0xc556('0x4')]||'';this[_0xc556('0x5')]=_0x3a178b[_0xc556('0x5')]||'';this[_0xc556('0x6')]=_0x3a178b[_0xc556('0x6')]||'';this['token']=_0x3a178b[_0xc556('0x7')]||'';this['tokenSecret']=_0x3a178b[_0xc556('0x8')]||'';this[_0xc556('0x9')]=_0x3a178b[_0xc556('0x9')]||'';this[_0xc556('0xa')]=_0x3a178b['serverUrl']||'';this[_0xc556('0xb')]=_0x3a178b[_0xc556('0xb')]||{};}module[_0xc556('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index cbbdc59..d89f4b3 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 _0x72f9=['name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x2d0341,_0x2eaef6){var _0x3891a1=function(_0x1af526){while(--_0x1af526){_0x2d0341['push'](_0x2d0341['shift']());}};_0x3891a1(++_0x2eaef6);}(_0x72f9,0xb0));var _0x972f=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x72f9[_0x1b95a1];return _0x57aef1;};'use strict';function Dynamics365Account(_0x314b69){this['id']=_0x314b69['id']||0x0;this[_0x972f('0x0')]=_0x314b69[_0x972f('0x0')]||'';this['username']=_0x314b69['username']||'';this[_0x972f('0x1')]=_0x314b69[_0x972f('0x1')]||'';this[_0x972f('0x2')]=_0x314b69[_0x972f('0x2')]||'';this['tenantId']=_0x314b69[_0x972f('0x3')]||'';this[_0x972f('0x4')]=_0x314b69['clientId']||'';this[_0x972f('0x5')]=_0x314b69[_0x972f('0x5')]||{};this[_0x972f('0x6')]=_0x314b69['serverUrl']||'';this[_0x972f('0x7')]=_0x314b69[_0x972f('0x7')]||![];this[_0x972f('0x8')]=_0x314b69[_0x972f('0x8')]||{};this[_0x972f('0x9')]=_0x314b69[_0x972f('0x9')]||{};}module[_0x972f('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x6d60=['remoteUri','tenantId','clientSecret','serverUrl','Configurations','CloudProvider','name','username','password'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d60,0x11d));var _0x06d6=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x6d60[_0xea343d];return _0x2c6e9c;};'use strict';function Dynamics365Account(_0x4ce35d){this['id']=_0x4ce35d['id']||0x0;this['name']=_0x4ce35d[_0x06d6('0x0')]||'';this[_0x06d6('0x1')]=_0x4ce35d['username']||'';this[_0x06d6('0x2')]=_0x4ce35d[_0x06d6('0x2')]||'';this[_0x06d6('0x3')]=_0x4ce35d[_0x06d6('0x3')]||'';this['tenantId']=_0x4ce35d[_0x06d6('0x4')]||'';this['clientId']=_0x4ce35d['clientId']||'';this[_0x06d6('0x5')]=_0x4ce35d[_0x06d6('0x5')]||{};this[_0x06d6('0x6')]=_0x4ce35d[_0x06d6('0x6')]||'';this['modernAuthentication']=_0x4ce35d['modernAuthentication']||![];this[_0x06d6('0x7')]=_0x4ce35d[_0x06d6('0x7')]||{};this['CloudProvider']=_0x4ce35d[_0x06d6('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 6a02de7..8db5a4c 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 _0xa1f2=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0xd3f68f,_0x314282){var _0x14e2dd=function(_0x384b87){while(--_0x384b87){_0xd3f68f['push'](_0xd3f68f['shift']());}};_0x14e2dd(++_0x314282);}(_0xa1f2,0x184));var _0x2a1f=function(_0x38b3e9,_0x24f4d5){_0x38b3e9=_0x38b3e9-0x0;var _0x2f1d69=_0xa1f2[_0x38b3e9];return _0x2f1d69;};'use strict';function FaxAccount(_0x4106a2){this['id']=_0x4106a2['id']||0x0;this[_0x2a1f('0x0')]=_0x4106a2[_0x2a1f('0x0')]||'';this[_0x2a1f('0x1')]=_0x4106a2[_0x2a1f('0x1')];this[_0x2a1f('0x2')]=_0x4106a2['ecm'];this[_0x2a1f('0x3')]=_0x4106a2['headerinfo'];this[_0x2a1f('0x4')]=_0x4106a2[_0x2a1f('0x4')];this['minrate']=_0x4106a2['minrate']||0x960;this[_0x2a1f('0x5')]=_0x4106a2[_0x2a1f('0x5')]||0x3840;this[_0x2a1f('0x6')]=_0x4106a2[_0x2a1f('0x6')]||_0x2a1f('0x7');this[_0x2a1f('0x8')]=_0x4106a2[_0x2a1f('0x8')]||'no';this[_0x2a1f('0x9')]=_0x4106a2[_0x2a1f('0x9')]||'no';this[_0x2a1f('0xa')]=_0x4106a2[_0x2a1f('0xa')]||0x1388;this['tech']=_0x4106a2[_0x2a1f('0xb')]||'SIP';this[_0x2a1f('0xc')]=_0x4106a2[_0x2a1f('0xc')]?_0x4106a2[_0x2a1f('0xc')]:undefined;this[_0x2a1f('0xd')]=_0x4106a2[_0x2a1f('0xd')];this['key']=_0x4106a2[_0x2a1f('0xe')];}module[_0x2a1f('0xf')]=FaxAccount; \ No newline at end of file +var _0xe2bc=['v17,v27,v29','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xe2bc,0x15d));var _0xce2b=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xe2bc[_0x47fd36];return _0x21a0fc;};'use strict';function FaxAccount(_0x8ec848){this['id']=_0x8ec848['id']||0x0;this[_0xce2b('0x0')]=_0x8ec848[_0xce2b('0x0')]||'';this[_0xce2b('0x1')]=_0x8ec848[_0xce2b('0x1')];this[_0xce2b('0x2')]=_0x8ec848[_0xce2b('0x2')];this['headerinfo']=_0x8ec848[_0xce2b('0x3')];this['localstationid']=_0x8ec848[_0xce2b('0x4')];this[_0xce2b('0x5')]=_0x8ec848[_0xce2b('0x5')]||0x960;this[_0xce2b('0x6')]=_0x8ec848[_0xce2b('0x6')]||0x3840;this[_0xce2b('0x7')]=_0x8ec848[_0xce2b('0x7')]||_0xce2b('0x8');this['gateway']=_0x8ec848['gateway']||'no';this['faxdetect']=_0x8ec848[_0xce2b('0x9')]||'no';this[_0xce2b('0xa')]=_0x8ec848[_0xce2b('0xa')]||0x1388;this[_0xce2b('0xb')]=_0x8ec848[_0xce2b('0xb')]||_0xce2b('0xc');this['Trunk']=_0x8ec848['Trunk']?_0x8ec848[_0xce2b('0xd')]:undefined;this[_0xce2b('0xe')]=_0x8ec848[_0xce2b('0xe')];this[_0xce2b('0xf')]=_0x8ec848[_0xce2b('0xf')];}module[_0xce2b('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d2a34ef..b5c7299 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 _0x65d7=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x27714d,_0x457b53){var _0x18e2fb=function(_0x28f1d9){while(--_0x28f1d9){_0x27714d['push'](_0x27714d['shift']());}};_0x18e2fb(++_0x457b53);}(_0x65d7,0x199));var _0x765d=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x65d7[_0x553150];return _0x18193d;};'use strict';function FreshdeskAccount(_0x2375ef){this['id']=_0x2375ef['id']||0x0;this[_0x765d('0x0')]=_0x2375ef[_0x765d('0x0')]||'';this[_0x765d('0x1')]=_0x2375ef[_0x765d('0x1')]||'';this[_0x765d('0x2')]=_0x2375ef[_0x765d('0x3')]||'';this[_0x765d('0x4')]=_0x2375ef[_0x765d('0x4')]||'';this[_0x765d('0x5')]=_0x2375ef[_0x765d('0x5')]||'';this['Configurations']=_0x2375ef[_0x765d('0x6')]||{};}module[_0x765d('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xdc4f=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x45b190,_0x6297da){var _0x46234d=function(_0x41f5ad){while(--_0x41f5ad){_0x45b190['push'](_0x45b190['shift']());}};_0x46234d(++_0x6297da);}(_0xdc4f,0xe3));var _0xfdc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc4f[_0x20a584];return _0x4b41a8;};'use strict';function FreshdeskAccount(_0x571efd){this['id']=_0x571efd['id']||0x0;this[_0xfdc4('0x0')]=_0x571efd[_0xfdc4('0x0')]||'';this['username']=_0x571efd[_0xfdc4('0x1')]||'';this[_0xfdc4('0x2')]=_0x571efd[_0xfdc4('0x3')]||'';this[_0xfdc4('0x4')]=_0x571efd[_0xfdc4('0x4')]||'';this['serverUrl']=_0x571efd[_0xfdc4('0x5')]||'';this[_0xfdc4('0x6')]=_0x571efd['Configurations']||{};}module[_0xfdc4('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index eca4bb4..a9a28d9 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 _0x885a=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3a14ac,_0x55403f){var _0x5e3bc3=function(_0x11f956){while(--_0x11f956){_0x3a14ac['push'](_0x3a14ac['shift']());}};_0x5e3bc3(++_0x55403f);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';function FreshsalesAccount(_0x30ab1d){this['id']=_0x30ab1d['id']||0x0;this[_0xa885('0x0')]=_0x30ab1d[_0xa885('0x0')]||'';this[_0xa885('0x1')]=_0x30ab1d[_0xa885('0x1')]||'';this['apiKey']=_0x30ab1d[_0xa885('0x2')]||'';this[_0xa885('0x3')]=_0x30ab1d[_0xa885('0x3')]||'';this[_0xa885('0x4')]=_0x30ab1d[_0xa885('0x4')]||'';this[_0xa885('0x5')]=_0x30ab1d['Configurations']||{};}module[_0xa885('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xbbbd=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xa655df,_0x370529){var _0x3f8366=function(_0x29d736){while(--_0x29d736){_0xa655df['push'](_0xa655df['shift']());}};_0x3f8366(++_0x370529);}(_0xbbbd,0x86));var _0xdbbb=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xbbbd[_0x35885a];return _0xe86249;};'use strict';function FreshsalesAccount(_0x145880){this['id']=_0x145880['id']||0x0;this[_0xdbbb('0x0')]=_0x145880[_0xdbbb('0x0')]||'';this[_0xdbbb('0x1')]=_0x145880[_0xdbbb('0x1')]||'';this[_0xdbbb('0x2')]=_0x145880[_0xdbbb('0x3')]||'';this[_0xdbbb('0x4')]=_0x145880[_0xdbbb('0x4')]||'';this[_0xdbbb('0x5')]=_0x145880[_0xdbbb('0x5')]||'';this[_0xdbbb('0x6')]=_0x145880['Configurations']||{};}module[_0xdbbb('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 edb7359..f37a4a8 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 _0xf927=['voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned'];(function(_0x310198,_0x2d2575){var _0x3ee526=function(_0x4f61fe){while(--_0x4f61fe){_0x310198['push'](_0x310198['shift']());}};_0x3ee526(++_0x2d2575);}(_0xf927,0xef));var _0x7f92=function(_0x113f6e,_0x4b3835){_0x113f6e=_0x113f6e-0x0;var _0x1612f9=_0xf927[_0x113f6e];return _0x1612f9;};'use strict';function QueueReport(){this[_0x7f92('0x0')]=_0x7f92('0x1');this[_0x7f92('0x2')]='';this['calleridnum']='';this[_0x7f92('0x3')]='';this['queue']='';this[_0x7f92('0x4')]=null;this[_0x7f92('0x5')]=null;this[_0x7f92('0x6')]=0x1;this[_0x7f92('0x7')]=0x1;this[_0x7f92('0x8')]=![];this[_0x7f92('0x9')]=null;this['queuecallercomplete']=![];this[_0x7f92('0xa')]=null;this[_0x7f92('0xb')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x7f92('0xc')]='';this[_0x7f92('0xd')]='';this[_0x7f92('0xe')]='';this[_0x7f92('0xf')]='';this[_0x7f92('0x10')]='';this[_0x7f92('0x11')]='';this[_0x7f92('0x12')]='';this[_0x7f92('0x13')]=0x0;this[_0x7f92('0x14')]=![];this['lastAssignedTo']='';this['motionChannel']=_0x7f92('0x15');this[_0x7f92('0x16')]=null;this[_0x7f92('0x17')]=0x0;this[_0x7f92('0x18')]={};}module[_0x7f92('0x19')]=QueueReport; \ No newline at end of file +var _0x704a=['priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten'];(function(_0x2ba72d,_0x10093d){var _0x14f4ae=function(_0x159378){while(--_0x159378){_0x2ba72d['push'](_0x2ba72d['shift']());}};_0x14f4ae(++_0x10093d);}(_0x704a,0x167));var _0xa704=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x704a[_0x53ccf2];return _0x5a2964;};'use strict';function QueueReport(){this[_0xa704('0x0')]='inbound';this[_0xa704('0x1')]='';this[_0xa704('0x2')]='';this[_0xa704('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xa704('0x4')]=null;this[_0xa704('0x5')]=0x1;this['count']=0x1;this[_0xa704('0x6')]=![];this['queuecallerabandonAt']=null;this[_0xa704('0x7')]=![];this[_0xa704('0x8')]=null;this['queuecallerexit']=![];this[_0xa704('0x9')]=null;this[_0xa704('0xa')]=0x1;this[_0xa704('0xb')]='';this[_0xa704('0xc')]='';this[_0xa704('0xd')]='';this[_0xa704('0xe')]='';this['context']='';this[_0xa704('0xf')]='';this[_0xa704('0x10')]='';this[_0xa704('0x11')]=0x0;this[_0xa704('0x12')]=![];this[_0xa704('0x13')]='';this[_0xa704('0x14')]='voice';this[_0xa704('0x15')]=null;this[_0xa704('0x16')]=0x0;this[_0xa704('0x17')]={};}module[_0xa704('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8f554b7..c250283 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 _0x6e12=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientSecret'];(function(_0x4dccad,_0x3abc4e){var _0x1bf842=function(_0x3516ad){while(--_0x3516ad){_0x4dccad['push'](_0x4dccad['shift']());}};_0x1bf842(++_0x3abc4e);}(_0x6e12,0x1d4));var _0x26e1=function(_0x25711c,_0x2ae795){_0x25711c=_0x25711c-0x0;var _0xb3f358=_0x6e12[_0x25711c];return _0xb3f358;};'use strict';function SalesforceAccount(_0x269bd7){this['id']=_0x269bd7['id']||0x0;this[_0x26e1('0x0')]=_0x269bd7[_0x26e1('0x0')]||'';this['username']=_0x269bd7[_0x26e1('0x1')]||'';this[_0x26e1('0x2')]=_0x269bd7[_0x26e1('0x2')]||'';this[_0x26e1('0x3')]=_0x269bd7[_0x26e1('0x3')]||'';this['clientId']=_0x269bd7['clientId']||'';this[_0x26e1('0x4')]=_0x269bd7[_0x26e1('0x4')]||'';this[_0x26e1('0x5')]=_0x269bd7['securityToken']||'';this['type']=_0x269bd7[_0x26e1('0x6')]||_0x26e1('0x7');this['serverUrl']=_0x269bd7[_0x26e1('0x8')]||'';this[_0x26e1('0x9')]=_0x269bd7[_0x26e1('0x9')]||{};}module[_0x26e1('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xe837=['exports','name','username','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe837,0x141));var _0x7e83=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0xe837[_0x3f6565];return _0x4abd23;};'use strict';function SalesforceAccount(_0xad3f71){this['id']=_0xad3f71['id']||0x0;this[_0x7e83('0x0')]=_0xad3f71[_0x7e83('0x0')]||'';this[_0x7e83('0x1')]=_0xad3f71[_0x7e83('0x1')]||'';this['remoteUri']=_0xad3f71['remoteUri']||'';this[_0x7e83('0x2')]=_0xad3f71[_0x7e83('0x2')]||'';this[_0x7e83('0x3')]=_0xad3f71[_0x7e83('0x3')]||'';this[_0x7e83('0x4')]=_0xad3f71[_0x7e83('0x4')]||'';this['securityToken']=_0xad3f71[_0x7e83('0x5')]||'';this[_0x7e83('0x6')]=_0xad3f71[_0x7e83('0x6')]||_0x7e83('0x7');this[_0x7e83('0x8')]=_0xad3f71[_0x7e83('0x8')]||'';this['Configurations']=_0xad3f71['Configurations']||{};}module[_0x7e83('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index b5f8b56..bd7e060 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 _0xcba3=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x21e891,_0x459f72){var _0x328725=function(_0xdadc73){while(--_0xdadc73){_0x21e891['push'](_0x21e891['shift']());}};_0x328725(++_0x459f72);}(_0xcba3,0x1dc));var _0x3cba=function(_0x1992a0,_0x5543fa){_0x1992a0=_0x1992a0-0x0;var _0x41d9ef=_0xcba3[_0x1992a0];return _0x41d9ef;};'use strict';function ServicenowAccount(_0x49ff37){this['id']=_0x49ff37['id']||0x0;this[_0x3cba('0x0')]=_0x49ff37[_0x3cba('0x0')]||'';this['username']=_0x49ff37[_0x3cba('0x1')]||'';this[_0x3cba('0x2')]=_0x49ff37['password']||'';this[_0x3cba('0x3')]=_0x49ff37[_0x3cba('0x3')]||'';this[_0x3cba('0x4')]=_0x49ff37['serverUrl']||'';this[_0x3cba('0x5')]=_0x49ff37[_0x3cba('0x5')]||{};}module[_0x3cba('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x5bef=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x2073fb,_0x4bbdaa){var _0x5c7241=function(_0x231557){while(--_0x231557){_0x2073fb['push'](_0x2073fb['shift']());}};_0x5c7241(++_0x4bbdaa);}(_0x5bef,0x183));var _0xf5be=function(_0x5dbb2,_0x1e3317){_0x5dbb2=_0x5dbb2-0x0;var _0x4ba922=_0x5bef[_0x5dbb2];return _0x4ba922;};'use strict';function ServicenowAccount(_0x5e585a){this['id']=_0x5e585a['id']||0x0;this[_0xf5be('0x0')]=_0x5e585a[_0xf5be('0x0')]||'';this[_0xf5be('0x1')]=_0x5e585a[_0xf5be('0x1')]||'';this['password']=_0x5e585a['password']||'';this[_0xf5be('0x2')]=_0x5e585a[_0xf5be('0x2')]||'';this[_0xf5be('0x3')]=_0x5e585a['serverUrl']||'';this[_0xf5be('0x4')]=_0x5e585a['Configurations']||{};}module[_0xf5be('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5eab342..3301e06 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 _0x776b=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x585f40,_0x4a3091){var _0x44fc86=function(_0x5bcedc){while(--_0x5bcedc){_0x585f40['push'](_0x585f40['shift']());}};_0x44fc86(++_0x4a3091);}(_0x776b,0x9c));var _0xb776=function(_0x42a5a9,_0x121bb8){_0x42a5a9=_0x42a5a9-0x0;var _0x4387a4=_0x776b[_0x42a5a9];return _0x4387a4;};'use strict';function SugarcrmAccount(_0x16e0cd){this['id']=_0x16e0cd['id']||0x0;this['name']=_0x16e0cd[_0xb776('0x0')]||'';this[_0xb776('0x1')]=_0x16e0cd['username']||'';this[_0xb776('0x2')]=_0x16e0cd[_0xb776('0x2')]||'';this[_0xb776('0x3')]=_0x16e0cd['remoteUri']||'';this[_0xb776('0x4')]=_0x16e0cd[_0xb776('0x4')]||'';this['Configurations']=_0x16e0cd[_0xb776('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xc30e=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x59f109,_0x12b421){var _0x4fdae2=function(_0x3449a1){while(--_0x3449a1){_0x59f109['push'](_0x59f109['shift']());}};_0x4fdae2(++_0x12b421);}(_0xc30e,0x1d8));var _0xec30=function(_0x5730ef,_0x29d62b){_0x5730ef=_0x5730ef-0x0;var _0x5d7bc9=_0xc30e[_0x5730ef];return _0x5d7bc9;};'use strict';function SugarcrmAccount(_0x272160){this['id']=_0x272160['id']||0x0;this['name']=_0x272160[_0xec30('0x0')]||'';this[_0xec30('0x1')]=_0x272160[_0xec30('0x1')]||'';this[_0xec30('0x2')]=_0x272160[_0xec30('0x2')]||'';this[_0xec30('0x3')]=_0x272160[_0xec30('0x3')]||'';this['serverUrl']=_0x272160[_0xec30('0x4')]||'';this[_0xec30('0x5')]=_0x272160[_0xec30('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b3602d9..be4a4b7 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 _0x8058=['unknown','address','name','accountcode','state'];(function(_0x3b8d92,_0x39f743){var _0x239a20=function(_0x616793){while(--_0x616793){_0x3b8d92['push'](_0x3b8d92['shift']());}};_0x239a20(++_0x39f743);}(_0x8058,0x101));var _0x8805=function(_0x3086a1,_0x583641){_0x3086a1=_0x3086a1-0x0;var _0xef9925=_0x8058[_0x3086a1];return _0xef9925;};'use strict';function Telephone(_0x24b766){this['id']=_0x24b766['id']||0x0;this[_0x8805('0x0')]=_0x24b766['name']||'';this[_0x8805('0x1')]=_0x24b766['accountcode']||'';this[_0x8805('0x2')]=_0x8805('0x3');this['stateTime']=0x0;this['status']=_0x8805('0x3');this[_0x8805('0x4')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x624a=['accountcode','state','unknown','name'];(function(_0x4a30cf,_0x312dd4){var _0x4d975b=function(_0x170368){while(--_0x170368){_0x4a30cf['push'](_0x4a30cf['shift']());}};_0x4d975b(++_0x312dd4);}(_0x624a,0x143));var _0xa624=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x624a[_0x650e11];return _0x1a9b47;};'use strict';function Telephone(_0x367401){this['id']=_0x367401['id']||0x0;this[_0xa624('0x0')]=_0x367401['name']||'';this[_0xa624('0x1')]=_0x367401[_0xa624('0x1')]||'';this[_0xa624('0x2')]=_0xa624('0x3');this['stateTime']=0x0;this['status']=_0xa624('0x3');this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 12af6d0..c9f4fed 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x52073b,_0x3f08ce){var _0xecd652=function(_0x4fba35){while(--_0x4fba35){_0x52073b['push'](_0x52073b['shift']());}};_0xecd652(++_0x3f08ce);}(_0xb10b,0x12a));var _0xbb10=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xb10b[_0xc0d9bc];return _0x32ff73;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x328480,_0x13ab1c){var _0xe1f41c=function(_0x1ad5a2){while(--_0x1ad5a2){_0x328480['push'](_0x328480['shift']());}};_0xe1f41c(++_0x13ab1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 96d5e8f..6206239 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1435c4,_0x38e210){var _0xc45994=function(_0x978adb){while(--_0x978adb){_0x1435c4['push'](_0x1435c4['shift']());}};_0xc45994(++_0x38e210);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5f21af,_0x5c4f02){_0x5f21af=_0x5f21af-0x0;var _0x3ab0ad=_0x9ffd[_0x5f21af];return _0x3ab0ad;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index fe5efd7..eaeeba8 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 _0xe944=['address','defaultuser','exports','active','name','state','unknown','stateTime','registry','split','host','domainport','refresh'];(function(_0x248c51,_0xdf9962){var _0x28c4ce=function(_0xfd6d44){while(--_0xfd6d44){_0x248c51['push'](_0x248c51['shift']());}};_0x28c4ce(++_0xdf9962);}(_0xe944,0x1d7));var _0x4e94=function(_0x4adc77,_0x43ec38){_0x4adc77=_0x4adc77-0x0;var _0x5121d5=_0xe944[_0x4adc77];return _0x5121d5;};'use strict';function Trunk(_0x3be681){this['id']=_0x3be681['id']||0x0;this['active']=_0x3be681[_0x4e94('0x0')]||![];this[_0x4e94('0x1')]=_0x3be681[_0x4e94('0x1')]||'';this[_0x4e94('0x2')]=_0x4e94('0x3');this[_0x4e94('0x4')]=0x0;this['status']='unknown';this[_0x4e94('0x5')]=_0x3be681[_0x4e94('0x5')]&&_0x3be681[_0x4e94('0x5')]['indexOf'](':')?_0x3be681['registry'][_0x4e94('0x6')](':')[0x0]:'';this[_0x4e94('0x7')]='';this['port']='';this['domain']='';this[_0x4e94('0x8')]='';this[_0x4e94('0x9')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0x4e94('0xa')]='';this[_0x4e94('0xb')]=_0x3be681[_0x4e94('0xb')]||'';}module[_0x4e94('0xc')]=Trunk; \ No newline at end of file +var _0x6919=['refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','port','domainport'];(function(_0x20c3a3,_0x317116){var _0x36df80=function(_0x42dab6){while(--_0x42dab6){_0x20c3a3['push'](_0x20c3a3['shift']());}};_0x36df80(++_0x317116);}(_0x6919,0x165));var _0x9691=function(_0x194d23,_0x35b80e){_0x194d23=_0x194d23-0x0;var _0x159102=_0x6919[_0x194d23];return _0x159102;};'use strict';function Trunk(_0x3da9b7){this['id']=_0x3da9b7['id']||0x0;this[_0x9691('0x0')]=_0x3da9b7['active']||![];this[_0x9691('0x1')]=_0x3da9b7['name']||'';this[_0x9691('0x2')]=_0x9691('0x3');this[_0x9691('0x4')]=0x0;this[_0x9691('0x5')]=_0x9691('0x3');this[_0x9691('0x6')]=_0x3da9b7[_0x9691('0x6')]&&_0x3da9b7[_0x9691('0x6')][_0x9691('0x7')](':')?_0x3da9b7[_0x9691('0x6')][_0x9691('0x8')](':')[0x0]:'';this['host']='';this[_0x9691('0x9')]='';this['domain']='';this[_0x9691('0xa')]='';this[_0x9691('0xb')]='';this[_0x9691('0xc')]=_0x9691('0x3');this[_0x9691('0xd')]='';this[_0x9691('0xe')]='';this['defaultuser']=_0x3da9b7['defaultuser']||'';}module[_0x9691('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 f5a748f..2433b0f 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 _0xbf7d=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4ea479,_0x12c56e){var _0x47cc55=function(_0x29a6a0){while(--_0x29a6a0){_0x4ea479['push'](_0x4ea479['shift']());}};_0x47cc55(++_0x12c56e);}(_0xbf7d,0x1d3));var _0xdbf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf7d[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x4086be){this['id']=_0x4086be['id']||0x0;this[_0xdbf7('0x0')]=_0x4086be['exten']||'';this['recordingFormat']=_0x4086be[_0xdbf7('0x1')]||_0xdbf7('0x2');this[_0xdbf7('0x3')]=_0x4086be[_0xdbf7('0x3')]||![];}module[_0xdbf7('0x4')]=voiceExtension; \ No newline at end of file +var _0x67ba=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x532719,_0x20eb62){var _0x1a2b81=function(_0x5c0644){while(--_0x5c0644){_0x532719['push'](_0x532719['shift']());}};_0x1a2b81(++_0x20eb62);}(_0x67ba,0x1d7));var _0xa67b=function(_0x115ed8,_0x50983c){_0x115ed8=_0x115ed8-0x0;var _0x13722a=_0x67ba[_0x115ed8];return _0x13722a;};'use strict';function voiceExtension(_0x4e7b4d){this['id']=_0x4e7b4d['id']||0x0;this[_0xa67b('0x0')]=_0x4e7b4d[_0xa67b('0x0')]||'';this[_0xa67b('0x1')]=_0x4e7b4d[_0xa67b('0x1')]||_0xa67b('0x2');this[_0xa67b('0x3')]=_0x4e7b4d['mandatoryDisposition']||![];}module[_0xa67b('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 b4bf1aa..f3ef0cc 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 _0xad5f=['outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','inUse','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0xad5f,0x1a8));var _0xfad5=function(_0x42bfc9,_0x92ccf5){_0x42bfc9=_0x42bfc9-0x0;var _0x645e2b=_0xad5f[_0x42bfc9];return _0x645e2b;};'use strict';var monitorFormat={'wav':_0xfad5('0x0'),'wav49':_0xfad5('0x1'),'gsm':_0xfad5('0x2')};var strategy={'fewestcalls':_0xfad5('0x3'),'leastrecent':_0xfad5('0x4'),'linear':_0xfad5('0x5'),'random':'random','ringall':_0xfad5('0x6'),'rr':_0xfad5('0x7'),'rrmemory':_0xfad5('0x8'),'rrordered':_0xfad5('0x9'),'wrandom':_0xfad5('0xa')};function VoiceQueue(_0x180450){this['id']=_0x180450['id']||0x0;this[_0xfad5('0xb')]=_0x180450['name']||'';this[_0xfad5('0xc')]=_0x180450[_0xfad5('0xc')]||'';this[_0xfad5('0xd')]=_0x180450[_0xfad5('0xd')]||'inbound';this[_0xfad5('0xe')]=0x0;this[_0xfad5('0xf')]=0x0;this[_0xfad5('0x10')]=0x0;this[_0xfad5('0x11')]=0x0;this[_0xfad5('0x12')]=0x0;this[_0xfad5('0x13')]=0x0;this[_0xfad5('0x14')]=0x0;this['abandoned']=0x0;this[_0xfad5('0x15')]=0x0;this[_0xfad5('0x16')]=0x0;this[_0xfad5('0x17')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0xfad5('0x18')]=0x0;this[_0xfad5('0x19')]=0x0;this[_0xfad5('0x1a')]=0x0;this[_0xfad5('0x1b')]=0x0;this[_0xfad5('0x1c')]=0x0;this['talking']=0x0;this[_0xfad5('0x1d')]=0x0;this[_0xfad5('0x1e')]=0x0;this[_0xfad5('0x1f')]=_0x180450[_0xfad5('0x1f')]||![];this[_0xfad5('0x20')]=_0x180450[_0xfad5('0x20')]||0xa;this[_0xfad5('0x21')]=_0x180450['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0xfad5('0x22')]='';this[_0xfad5('0x23')]='';this[_0xfad5('0x24')]=0x0;this[_0xfad5('0x25')]=0x0;this[_0xfad5('0x26')]=_0x180450[_0xfad5('0x26')]||null;this[_0xfad5('0x27')]=_0x180450[_0xfad5('0x27')]?_0x180450[_0xfad5('0x27')]:null;this['dialActive']=_0x180450['dialActive'];this[_0xfad5('0x28')]=_0x180450[_0xfad5('0x28')]||'progressive';this['dialLimitChannel']=_0x180450[_0xfad5('0x29')]||0x0;this[_0xfad5('0x2a')]=_0x180450['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x180450[_0xfad5('0x2b')]||0x1;this[_0xfad5('0x2c')]=_0x180450[_0xfad5('0x2c')]||_0xfad5('0x2d');this[_0xfad5('0x2e')]=_0x180450['dialPredictiveOptimizationPercentage']||0.03;this[_0xfad5('0x2f')]=_0x180450['dialPredictiveInterval']||0x258;this[_0xfad5('0x30')]=_0x180450[_0xfad5('0x30')]||_0xfad5('0x31');this[_0xfad5('0x32')]=_0x180450[_0xfad5('0x32')]||_0xfad5('0x31');this[_0xfad5('0x33')]=_0x180450[_0xfad5('0x33')]||0x1e;this[_0xfad5('0x34')]=_0x180450[_0xfad5('0x34')]||_0xfad5('0x35');this['dialQueueTimeout']=_0x180450[_0xfad5('0x36')]||0x3;this[_0xfad5('0x37')]=_0x180450[_0xfad5('0x37')]||undefined;this[_0xfad5('0x38')]=_0x180450[_0xfad5('0x38')]||0x3;this['dialCongestionRetryFrequency']=_0x180450[_0xfad5('0x39')]||0x96;this[_0xfad5('0x3a')]=_0x180450[_0xfad5('0x3a')]||0x3;this['dialBusyRetryFrequency']=_0x180450[_0xfad5('0x3b')]||0x96;this['dialNoAnswerMaxRetry']=_0x180450[_0xfad5('0x3c')]||0x3;this[_0xfad5('0x3d')]=_0x180450[_0xfad5('0x3d')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x180450[_0xfad5('0x3e')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x180450['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x180450[_0xfad5('0x3f')]||0x3;this[_0xfad5('0x40')]=_0x180450[_0xfad5('0x40')]||0x96;this[_0xfad5('0x41')]=_0x180450[_0xfad5('0x41')]||0x3;this[_0xfad5('0x42')]=_0x180450[_0xfad5('0x42')]||0x96;this[_0xfad5('0x43')]=_0x180450[_0xfad5('0x43')]||0x3;this[_0xfad5('0x44')]=_0x180450['dialMachineRetryFrequency']||0x96;this[_0xfad5('0x45')]=_0x180450[_0xfad5('0x45')]||0x3;this[_0xfad5('0x46')]=_0x180450['dialAgentRejectRetryFrequency']||0x96;this[_0xfad5('0x47')]=_0x180450[_0xfad5('0x47')]||0x3;this[_0xfad5('0x48')]=_0x180450[_0xfad5('0x48')]||0x4;this['Trunk']=_0x180450[_0xfad5('0x49')]?_0x180450[_0xfad5('0x49')]:undefined;this[_0xfad5('0x4a')]=_0x180450[_0xfad5('0x4a')]?_0x180450[_0xfad5('0x4a')]:undefined;this['dialPrefix']=_0x180450[_0xfad5('0x4b')]||undefined;this[_0xfad5('0x4c')]=_0x180450[_0xfad5('0x4c')]?_0x180450['Interval']:undefined;this[_0xfad5('0x4d')]=_0x180450[_0xfad5('0x4d')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x180450[_0xfad5('0x4e')]||undefined;this[_0xfad5('0x4f')]=_0x180450[_0xfad5('0x4f')]||undefined;this[_0xfad5('0x50')]=strategy[_0x180450[_0xfad5('0x50')]];this[_0xfad5('0x51')]=!![];this[_0xfad5('0x52')]=_0x180450['dialAMDActive']||![];this[_0xfad5('0x53')]=_0x180450[_0xfad5('0x53')];this[_0xfad5('0x54')]=_0x180450[_0xfad5('0x54')];this[_0xfad5('0x55')]=_0x180450['dialAMDAfterGreetingSilence'];this[_0xfad5('0x56')]=_0x180450[_0xfad5('0x56')];this['dialAMDMinWordLength']=_0x180450[_0xfad5('0x57')];this[_0xfad5('0x58')]=_0x180450[_0xfad5('0x58')];this['dialAMDMaximumNumberOfWords']=_0x180450['dialAMDMaximumNumberOfWords'];this[_0xfad5('0x59')]=_0x180450[_0xfad5('0x59')];this[_0xfad5('0x5a')]=_0x180450[_0xfad5('0x5a')];this[_0xfad5('0x5b')]=0x0;this[_0xfad5('0x5c')]=0x0;this[_0xfad5('0x5d')]=_0x180450[_0xfad5('0x5d')];this[_0xfad5('0x5e')]=0x0;this[_0xfad5('0x5f')]=0x0;this[_0xfad5('0x60')]=0x0;this[_0xfad5('0x61')]=0x0;this[_0xfad5('0x62')]=0x0;this[_0xfad5('0x63')]=0x0;this[_0xfad5('0x64')]=0x0;this[_0xfad5('0x65')]=0x0;this[_0xfad5('0x66')]=0x0;this[_0xfad5('0x67')]=0x0;this[_0xfad5('0x68')]=0x0;this[_0xfad5('0x69')]=0x0;this['outboundReCallsDay']=0x0;this[_0xfad5('0x6a')]=0x0;this[_0xfad5('0x6b')]=undefined;this['startPredictive']=undefined;this[_0xfad5('0x6c')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xfad5('0x6d')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xfad5('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xfad5('0x6f')]=0x0;this[_0xfad5('0x70')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xfad5('0x71')]=_0x180450[_0xfad5('0x72')]||0x14;this['predictiveIntervalMinThreshold']=_0x180450['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xfad5('0x73')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xfad5('0x74')]=0x0;this['erlangCallToSecond']=0x0;this[_0xfad5('0x75')]=0x0;this[_0xfad5('0x76')]=0x0;this[_0xfad5('0x77')]=_0x180450[_0xfad5('0x77')]||0x1e;this[_0xfad5('0x78')]=_0x180450['dialRecallInQueue']||![];this[_0xfad5('0x79')]=!!_0x180450[_0xfad5('0x79')]||![];this[_0xfad5('0x7a')]=!!_0x180450['dialPreviewRecallmeReminder']||![];this[_0xfad5('0x7b')]=_0x180450[_0xfad5('0x7b')]||undefined;this['dialAgiAfterHangupClient']=_0x180450[_0xfad5('0x7c')]||![];this[_0xfad5('0x7d')]=_0x180450['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x180450['monitor_format']]?monitorFormat[_0x180450[_0xfad5('0xc')]]:undefined;this[_0xfad5('0x7e')]=_0x180450[_0xfad5('0x7e')]||![];this[_0xfad5('0x7f')]=_0x180450['mandatoryDispositionPause']?_0x180450[_0xfad5('0x7f')]:undefined;this[_0xfad5('0x80')]=![];}module[_0xfad5('0x81')]=VoiceQueue; \ No newline at end of file +var _0x65ac=['type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','ringing','ringInUse','unknown','acw','acwTimeout','autopause','message','originated','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','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav49','gsm','fewestcalls','linear','ringall','rrmemory','rrordered','wrandom','name','monitor_format'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x65ac,0x100));var _0xc65a=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x65ac[_0x58dc25];return _0x21b0a7;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xc65a('0x0'),'gsm':_0xc65a('0x1')};var strategy={'fewestcalls':_0xc65a('0x2'),'leastrecent':'leastrecent','linear':_0xc65a('0x3'),'random':'random','ringall':_0xc65a('0x4'),'rr':'roundrobin','rrmemory':_0xc65a('0x5'),'rrordered':_0xc65a('0x6'),'wrandom':_0xc65a('0x7')};function VoiceQueue(_0x25abc5){this['id']=_0x25abc5['id']||0x0;this[_0xc65a('0x8')]=_0x25abc5[_0xc65a('0x8')]||'';this[_0xc65a('0x9')]=_0x25abc5[_0xc65a('0x9')]||'';this[_0xc65a('0xa')]=_0x25abc5[_0xc65a('0xa')]||_0xc65a('0xb');this[_0xc65a('0xc')]=0x0;this[_0xc65a('0xd')]=0x0;this[_0xc65a('0xe')]=0x0;this[_0xc65a('0xf')]=0x0;this[_0xc65a('0x10')]=0x0;this[_0xc65a('0x11')]=0x0;this[_0xc65a('0x12')]=0x0;this[_0xc65a('0x13')]=0x0;this[_0xc65a('0x14')]=0x0;this[_0xc65a('0x15')]=0x0;this[_0xc65a('0x16')]=0x0;this[_0xc65a('0x17')]=0x0;this[_0xc65a('0x18')]=0x0;this[_0xc65a('0x19')]=0x0;this['onHold']=0x0;this[_0xc65a('0x1a')]=0x0;this[_0xc65a('0x1b')]=0x0;this[_0xc65a('0x1c')]=0x0;this['talking']=0x0;this['unavailable']=0x0;this[_0xc65a('0x1d')]=0x0;this[_0xc65a('0x1e')]=_0x25abc5['acw']||![];this[_0xc65a('0x1f')]=_0x25abc5['acwTimeout']||0xa;this[_0xc65a('0x20')]=_0x25abc5[_0xc65a('0x20')]||'no';this['sendMessageOneNotActive']=!![];this[_0xc65a('0x21')]='';this['statusMessage']='';this[_0xc65a('0x22')]=0x0;this['temp']=0x0;this[_0xc65a('0x23')]=_0x25abc5['dialTimezone']||null;this[_0xc65a('0x24')]=_0x25abc5[_0xc65a('0x24')]?_0x25abc5[_0xc65a('0x24')]:null;this[_0xc65a('0x25')]=_0x25abc5[_0xc65a('0x25')];this[_0xc65a('0x26')]=_0x25abc5[_0xc65a('0x26')]||_0xc65a('0x27');this[_0xc65a('0x28')]=_0x25abc5[_0xc65a('0x28')]||0x0;this[_0xc65a('0x29')]=_0x25abc5[_0xc65a('0x29')]||0x0;this['dialPowerLevel']=_0x25abc5[_0xc65a('0x2a')]||0x1;this[_0xc65a('0x2b')]=_0x25abc5[_0xc65a('0x2b')]||_0xc65a('0x2c');this[_0xc65a('0x2d')]=_0x25abc5['dialPredictiveOptimizationPercentage']||0.03;this[_0xc65a('0x2e')]=_0x25abc5['dialPredictiveInterval']||0x258;this[_0xc65a('0x2f')]=_0x25abc5[_0xc65a('0x2f')]||_0xc65a('0x30');this[_0xc65a('0x31')]=_0x25abc5[_0xc65a('0x31')]||_0xc65a('0x30');this[_0xc65a('0x32')]=_0x25abc5[_0xc65a('0x32')]||0x1e;this[_0xc65a('0x33')]=_0x25abc5[_0xc65a('0x33')]||'tTxX';this[_0xc65a('0x34')]=_0x25abc5[_0xc65a('0x34')]||0x3;this['dialQueueProject']=_0x25abc5[_0xc65a('0x35')]||undefined;this[_0xc65a('0x36')]=_0x25abc5[_0xc65a('0x36')]||0x3;this[_0xc65a('0x37')]=_0x25abc5['dialCongestionRetryFrequency']||0x96;this[_0xc65a('0x38')]=_0x25abc5[_0xc65a('0x38')]||0x3;this['dialBusyRetryFrequency']=_0x25abc5[_0xc65a('0x39')]||0x96;this[_0xc65a('0x3a')]=_0x25abc5[_0xc65a('0x3a')]||0x3;this[_0xc65a('0x3b')]=_0x25abc5[_0xc65a('0x3b')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x25abc5[_0xc65a('0x3c')]||0x3;this[_0xc65a('0x3d')]=_0x25abc5[_0xc65a('0x3d')]||0x96;this[_0xc65a('0x3e')]=_0x25abc5[_0xc65a('0x3e')]||0x3;this[_0xc65a('0x3f')]=_0x25abc5[_0xc65a('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x25abc5[_0xc65a('0x40')]||0x3;this[_0xc65a('0x41')]=_0x25abc5[_0xc65a('0x41')]||0x96;this[_0xc65a('0x42')]=_0x25abc5[_0xc65a('0x42')]||0x3;this[_0xc65a('0x43')]=_0x25abc5[_0xc65a('0x43')]||0x96;this[_0xc65a('0x44')]=_0x25abc5['dialAgentRejectMaxRetry']||0x3;this[_0xc65a('0x45')]=_0x25abc5[_0xc65a('0x45')]||0x96;this[_0xc65a('0x46')]=_0x25abc5[_0xc65a('0x46')]||0x3;this[_0xc65a('0x47')]=_0x25abc5[_0xc65a('0x47')]||0x4;this[_0xc65a('0x48')]=_0x25abc5[_0xc65a('0x48')]?_0x25abc5[_0xc65a('0x48')]:undefined;this[_0xc65a('0x49')]=_0x25abc5[_0xc65a('0x49')]?_0x25abc5[_0xc65a('0x49')]:undefined;this[_0xc65a('0x4a')]=_0x25abc5[_0xc65a('0x4a')]||undefined;this[_0xc65a('0x4b')]=_0x25abc5[_0xc65a('0x4b')]?_0x25abc5[_0xc65a('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0x25abc5[_0xc65a('0x4c')]||_0xc65a('0x4d');this[_0xc65a('0x4e')]=_0x25abc5[_0xc65a('0x4e')]||undefined;this[_0xc65a('0x4f')]=_0x25abc5[_0xc65a('0x4f')]||undefined;this[_0xc65a('0x50')]=strategy[_0x25abc5[_0xc65a('0x50')]];this[_0xc65a('0x51')]=!![];this[_0xc65a('0x52')]=_0x25abc5['dialAMDActive']||![];this[_0xc65a('0x53')]=_0x25abc5[_0xc65a('0x53')];this[_0xc65a('0x54')]=_0x25abc5[_0xc65a('0x54')];this['dialAMDAfterGreetingSilence']=_0x25abc5[_0xc65a('0x55')];this[_0xc65a('0x56')]=_0x25abc5[_0xc65a('0x56')];this[_0xc65a('0x57')]=_0x25abc5[_0xc65a('0x57')];this[_0xc65a('0x58')]=_0x25abc5[_0xc65a('0x58')];this['dialAMDMaximumNumberOfWords']=_0x25abc5[_0xc65a('0x59')];this[_0xc65a('0x5a')]=_0x25abc5[_0xc65a('0x5a')];this[_0xc65a('0x5b')]=_0x25abc5[_0xc65a('0x5b')];this['outboundRejectCallsDay']=0x0;this[_0xc65a('0x5c')]=0x0;this[_0xc65a('0x5d')]=_0x25abc5[_0xc65a('0x5d')];this[_0xc65a('0x5e')]=0x0;this[_0xc65a('0x5f')]=0x0;this[_0xc65a('0x60')]=0x0;this[_0xc65a('0x61')]=0x0;this[_0xc65a('0x62')]=0x0;this[_0xc65a('0x63')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xc65a('0x64')]=0x0;this[_0xc65a('0x65')]=0x0;this[_0xc65a('0x66')]=0x0;this[_0xc65a('0x67')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xc65a('0x68')]=0x0;this[_0xc65a('0x69')]=0x0;this[_0xc65a('0x6a')]=undefined;this[_0xc65a('0x6b')]=undefined;this[_0xc65a('0x6c')]=undefined;this[_0xc65a('0x6d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xc65a('0x6e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xc65a('0x6f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xc65a('0x70')]=0x0;this[_0xc65a('0x71')]=0x0;this[_0xc65a('0x72')]=_0x25abc5[_0xc65a('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x25abc5['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xc65a('0x74')]=0x0;this[_0xc65a('0x75')]=0x0;this[_0xc65a('0x76')]=0x1;this[_0xc65a('0x77')]=0x0;this[_0xc65a('0x78')]=0x0;this[_0xc65a('0x79')]=0x0;this[_0xc65a('0x7a')]=0x0;this[_0xc65a('0x7b')]=_0x25abc5[_0xc65a('0x7b')]||0x1e;this[_0xc65a('0x7c')]=_0x25abc5[_0xc65a('0x7c')]||![];this['dialPreviewAutoRecallMe']=!!_0x25abc5[_0xc65a('0x7d')]||![];this[_0xc65a('0x7e')]=!!_0x25abc5['dialPreviewRecallmeReminder']||![];this[_0xc65a('0x7f')]=_0x25abc5[_0xc65a('0x7f')]||undefined;this[_0xc65a('0x80')]=_0x25abc5[_0xc65a('0x80')]||![];this[_0xc65a('0x81')]=_0x25abc5[_0xc65a('0x81')]||![];this[_0xc65a('0x9')]=monitorFormat[_0x25abc5[_0xc65a('0x9')]]?monitorFormat[_0x25abc5[_0xc65a('0x9')]]:undefined;this[_0xc65a('0x82')]=_0x25abc5['mandatoryDisposition']||![];this[_0xc65a('0x83')]=_0x25abc5[_0xc65a('0x83')]?_0x25abc5[_0xc65a('0x83')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0xc65a('0x84')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index f6dbbf1..b08be68 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 _0xbfda=['prototype','createReport','unknown','unavailable','loggedin','callers','length','online','includes','status','booked','keys','queue','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','ringing','waiting','answered','inUse','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','talking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','paused','ringInUse','sumHoldTime','type','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid'];(function(_0x3d5d40,_0x143d30){var _0x5ddfa8=function(_0x257915){while(--_0x257915){_0x3d5d40['push'](_0x3d5d40['shift']());}};_0x5ddfa8(++_0x143d30);}(_0xbfda,0x1dc));var _0xabfd=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0xbfda[_0x834bb6];return _0xa35d00;};'use strict';var INBOUND_COUNTERS=[_0xabfd('0x0'),_0xabfd('0x1'),_0xabfd('0x2'),'paused',_0xabfd('0x3'),'talking',_0xabfd('0x4')];var OUTBOUND_COUNTERS=[_0xabfd('0x0'),_0xabfd('0x5'),_0xabfd('0x6'),'loggedIn',_0xabfd('0x2'),'originated',_0xabfd('0x7'),'outboundAnswerCallsDay',_0xabfd('0x8'),'outboundBusyCallsDay',_0xabfd('0x9'),_0xabfd('0xa'),_0xabfd('0xb'),_0xabfd('0xc'),_0xabfd('0xd'),_0xabfd('0xe'),'paused',_0xabfd('0xf'),_0xabfd('0x10'),_0xabfd('0x11'),_0xabfd('0x12'),_0xabfd('0x13'),_0xabfd('0x4')];function VoiceQueueSummary(_0x1d56bc){this['id']=_0x1d56bc['id'];this[_0xabfd('0x14')]=_0x1d56bc[_0xabfd('0x14')];this[_0xabfd('0x15')]=_0x1d56bc[_0xabfd('0x15')];this[_0xabfd('0x16')]=_0x1d56bc[_0xabfd('0x16')]||0x0;this['answered']=_0x1d56bc[_0xabfd('0x5')]||0x0;this[_0xabfd('0x0')]=_0x1d56bc['available']||0x0;this[_0xabfd('0x17')]=_0x1d56bc[_0xabfd('0x17')]||0x0;this[_0xabfd('0x6')]=_0x1d56bc[_0xabfd('0x6')]||0x0;this[_0xabfd('0x18')]=_0x1d56bc[_0xabfd('0x18')]||0x0;this[_0xabfd('0x1')]=_0x1d56bc[_0xabfd('0x1')]||0x0;this[_0xabfd('0x2')]=_0x1d56bc['loggedInDb']||0x0;this[_0xabfd('0x19')]=_0x1d56bc[_0xabfd('0x19')]||0x0;this[_0xabfd('0x1a')]=_0x1d56bc[_0xabfd('0x1a')]||0x0;this[_0xabfd('0x1b')]=_0x1d56bc[_0xabfd('0x1b')]||0x0;this[_0xabfd('0x3')]=_0x1d56bc['ringing']||0x0;this[_0xabfd('0x1c')]=_0x1d56bc['ringInUse'];this[_0xabfd('0x11')]=_0x1d56bc[_0xabfd('0x11')];this[_0xabfd('0x12')]=_0x1d56bc[_0xabfd('0x12')];this[_0xabfd('0x1d')]=_0x1d56bc[_0xabfd('0x1d')]||0x0;this[_0xabfd('0x10')]=_0x1d56bc[_0xabfd('0x10')]||0x0;this[_0xabfd('0x13')]=_0x1d56bc[_0xabfd('0x13')]||0x0;this[_0xabfd('0x1e')]=_0x1d56bc[_0xabfd('0x1e')];this['unavailable']=_0x1d56bc['unavailable']||0x0;this['unknown']=_0x1d56bc['unknown']||0x0;this[_0xabfd('0x1f')]=_0x1d56bc[_0xabfd('0x1f')]||0x0;this[_0xabfd('0x4')]=_0x1d56bc[_0xabfd('0x4')]||0x0;if(_0x1d56bc['type']==='outbound'){this['pTalking']=_0x1d56bc[_0xabfd('0xf')]||0x0;this[_0xabfd('0x20')]=_0x1d56bc[_0xabfd('0x20')];this[_0xabfd('0x21')]=_0x1d56bc[_0xabfd('0x21')];this['dialOriginateCallerIdName']=_0x1d56bc[_0xabfd('0x22')];this[_0xabfd('0x23')]=_0x1d56bc[_0xabfd('0x23')];this[_0xabfd('0x24')]=_0x1d56bc[_0xabfd('0x24')];this[_0xabfd('0x25')]=_0x1d56bc[_0xabfd('0x25')];this['temp']=_0x1d56bc[_0xabfd('0x26')];this[_0xabfd('0x27')]=_0x1d56bc[_0xabfd('0x27')];this[_0xabfd('0x28')]=_0x1d56bc['outboundAnswerCallsDay'];this[_0xabfd('0x8')]=_0x1d56bc[_0xabfd('0x8')];this[_0xabfd('0x29')]=_0x1d56bc[_0xabfd('0x29')];this[_0xabfd('0x9')]=_0x1d56bc['outboundCongestionCallsDay'];this[_0xabfd('0x2a')]=_0x1d56bc['outboundDropCallsDayACS'];this[_0xabfd('0x2b')]=_0x1d56bc[_0xabfd('0x2b')];this['outboundDropCallsDayTimeout']=_0x1d56bc[_0xabfd('0x2c')];this[_0xabfd('0xa')]=_0x1d56bc[_0xabfd('0xa')];this[_0xabfd('0xb')]=_0x1d56bc['outboundNoSuchCallsDay'];this[_0xabfd('0x2d')]=_0x1d56bc[_0xabfd('0x2d')];this[_0xabfd('0xc')]=_0x1d56bc[_0xabfd('0xc')];this['outboundRejectCallsDay']=_0x1d56bc['outboundRejectCallsDay'];this[_0xabfd('0xe')]=_0x1d56bc['outboundUnknownCallsDay'];this[_0xabfd('0x2e')]=_0x1d56bc[_0xabfd('0x2e')];this[_0xabfd('0x2f')]=_0x1d56bc[_0xabfd('0x2f')];this[_0xabfd('0x30')]=_0x1d56bc[_0xabfd('0x30')];this[_0xabfd('0x31')]=_0x1d56bc[_0xabfd('0x31')];this[_0xabfd('0x32')]=_0x1d56bc[_0xabfd('0x32')];this[_0xabfd('0x33')]=_0x1d56bc[_0xabfd('0x33')];this[_0xabfd('0x34')]=_0x1d56bc['predictiveIntervalErlangCallsDroppedCalls'];this[_0xabfd('0x35')]=_0x1d56bc[_0xabfd('0x35')];this[_0xabfd('0x36')]=_0x1d56bc['predictiveIntervalMultiplicativeFactor'];this[_0xabfd('0x37')]=_0x1d56bc[_0xabfd('0x37')];this[_0xabfd('0x38')]=_0x1d56bc['predictiveIntervalAvailable'];this[_0xabfd('0x39')]=_0x1d56bc['predictiveIntervalTotalCalls'];this[_0xabfd('0x3a')]=_0x1d56bc[_0xabfd('0x3a')];this[_0xabfd('0x3b')]=_0x1d56bc[_0xabfd('0x3b')];this[_0xabfd('0x3c')]=_0x1d56bc[_0xabfd('0x3c')];this[_0xabfd('0x3d')]=_0x1d56bc[_0xabfd('0x3d')];this[_0xabfd('0x3e')]=_0x1d56bc[_0xabfd('0x3e')];this[_0xabfd('0x3f')]=_0x1d56bc['startPredictive'];this['startProgressive']=_0x1d56bc[_0xabfd('0x40')];this[_0xabfd('0x41')]=_0x1d56bc[_0xabfd('0x41')];this[_0xabfd('0x42')]=_0x1d56bc[_0xabfd('0x42')];}if(_0x1d56bc[_0xabfd('0x43')]){this['Trunk']={'id':_0x1d56bc[_0xabfd('0x43')]['id'],'name':_0x1d56bc[_0xabfd('0x43')][_0xabfd('0x14')],'active':_0x1d56bc[_0xabfd('0x43')][_0xabfd('0x44')],'callerid':_0x1d56bc[_0xabfd('0x43')][_0xabfd('0x45')]};}}VoiceQueueSummary[_0xabfd('0x46')][_0xabfd('0x47')]=function(_0x4177e3,_0xb6f384,_0x52e882,_0x4bd31f){this[_0xabfd('0x2')]=0x0;this[_0xabfd('0x10')]=0x0;this[_0xabfd('0x1b')]=0x0;this[_0xabfd('0x48')]=0x0;this[_0xabfd('0x1a')]=0x0;this[_0xabfd('0x6')]=0x0;this[_0xabfd('0x17')]=0x0;this[_0xabfd('0x18')]=0x0;this[_0xabfd('0x49')]=0x0;this['ringing']=0x0;this[_0xabfd('0x1c')]=0x0;this['onHold']=0x0;if(_0x52e882){if(_0x52e882['available']){this['available']=Number(_0x52e882[_0xabfd('0x0')]);}if(_0x52e882['loggedin']){this['loggedIn']=Number(_0x52e882[_0xabfd('0x4a')]);}if(_0x52e882[_0xabfd('0x4b')]){this[_0xabfd('0x4')]=Number(_0x52e882[_0xabfd('0x4b')]);}}for(var _0xf110c3=0x0;_0xf110c3<_0x4177e3[_0xabfd('0x4c')];_0xf110c3++){var _0x426245=_0xb6f384['SIP/'+_0x4177e3[_0xf110c3]['name']];if(_0x426245&&_0x426245[_0xabfd('0x4d')]){this[_0xabfd('0x2')]+=0x1;}if(_0x4177e3[_0xf110c3]['incall']==='1'){this[_0xabfd('0x10')]+=0x1;}if(_0x4177e3[_0xf110c3][_0xabfd('0x1b')]==='1'&&!['2','7','8'][_0xabfd('0x4e')](_0x4177e3[_0xf110c3][_0xabfd('0x4f')])){this[_0xabfd('0x1b')]+=0x1;}switch(_0x4177e3[_0xf110c3]['status']){case'0':this[_0xabfd('0x48')]+=0x1;break;case'1':this[_0xabfd('0x1a')]+=0x1;break;case'2':this[_0xabfd('0x6')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xabfd('0x18')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xabfd('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xabfd('0x21')]===_0xabfd('0x50')){var _0x28d264=Object[_0xabfd('0x51')](_0x4bd31f);for(var _0x56f3fc=0x0;_0x56f3fc<_0x28d264[_0xabfd('0x4c')];_0x56f3fc++){var _0x1335fd=_0x28d264[_0x56f3fc];var _0x2345b3=_0x4bd31f[_0x1335fd];if(_0x2345b3[_0xabfd('0x52')]===this[_0xabfd('0x14')]&&_0x2345b3['type']===_0xabfd('0x53')&&_0x2345b3[_0xabfd('0x54')]==='xcally-motion-preview'){this[_0xabfd('0x10')]+=0x1;}}if(this[_0xabfd('0x10')]>this[_0xabfd('0x6')]){this[_0xabfd('0x10')]=this[_0xabfd('0x6')];}this[_0xabfd('0xf')]=0x0;}return this;};VoiceQueueSummary[_0xabfd('0x46')][_0xabfd('0x55')]=function(_0x1333e9){var _0x20c10d=![];if(_0x1333e9){_0x20c10d=INBOUND_COUNTERS[_0xabfd('0x56')](function(_0x1d69fa){return this[_0x1d69fa]!==_0x1333e9[_0x1d69fa];},this);}return _0x20c10d;};VoiceQueueSummary[_0xabfd('0x46')][_0xabfd('0x57')]=function(_0x1662eb){var _0x3f1c5c=![];var _0x1104b4=![];var _0x1a595a=![];if(_0x1662eb){_0x3f1c5c=this[_0xabfd('0x21')]!==_0x1662eb[_0xabfd('0x21')]||this[_0xabfd('0x20')]!==_0x1662eb[_0xabfd('0x20')]||this[_0xabfd('0x41')]!==_0x1662eb[_0xabfd('0x41')]||this[_0xabfd('0x42')]!==_0x1662eb[_0xabfd('0x42')];_0x1104b4=OUTBOUND_COUNTERS[_0xabfd('0x56')](function(_0x2a3de7){return this[_0x2a3de7]!==_0x1662eb[_0x2a3de7];},this);if(this[_0xabfd('0x43')]&&_0x1662eb[_0xabfd('0x43')]){_0x1a595a=this['Trunk'][_0xabfd('0x14')]!==_0x1662eb['Trunk'][_0xabfd('0x14')]||this[_0xabfd('0x43')][_0xabfd('0x44')]!==_0x1662eb[_0xabfd('0x43')][_0xabfd('0x44')];}}return _0x3f1c5c||_0x1104b4||_0x1a595a;};VoiceQueueSummary[_0xabfd('0x46')][_0xabfd('0x58')]=function(_0x1e1037){this['answered']=_0x1e1037[_0xabfd('0x5')];this[_0xabfd('0x41')]=_0x1e1037['message'];this[_0xabfd('0x42')]=_0x1e1037[_0xabfd('0x42')];this[_0xabfd('0x3a')]=_0x1e1037[_0xabfd('0x3a')];this['outboundAbandonedCallsDay']=_0x1e1037[_0xabfd('0x7')];this[_0xabfd('0x28')]=_0x1e1037[_0xabfd('0x28')];this[_0xabfd('0x8')]=_0x1e1037[_0xabfd('0x8')];this[_0xabfd('0x29')]=_0x1e1037[_0xabfd('0x29')];this[_0xabfd('0x9')]=_0x1e1037[_0xabfd('0x9')];this[_0xabfd('0xa')]=_0x1e1037['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x1e1037[_0xabfd('0xb')];this[_0xabfd('0xc')]=_0x1e1037['outboundReCallsDay'];this[_0xabfd('0xd')]=_0x1e1037[_0xabfd('0xd')];this['outboundUnknownCallsDay']=_0x1e1037[_0xabfd('0xe')];this[_0xabfd('0x11')]=_0x1e1037['sumBillable'];this['sumDuration']=_0x1e1037[_0xabfd('0x12')];this[_0xabfd('0x13')]=_0x1e1037['total'];if(this[_0xabfd('0x21')]===_0xabfd('0x59')){this[_0xabfd('0xf')]=_0x1e1037['pTalking'];}};module[_0xabfd('0x5a')]=VoiceQueueSummary; \ No newline at end of file +var _0xfd87=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','onHold','loggedin','callers','length','SIP/','online','includes','status','booked','queue','dialer','exten','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAnswerCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumDuration','name','strategy','abandoned','busy','invalid','notInUse','ringInUse','sumBillable','sumHoldTime','total','type','unavailable','unknown','unmanaged','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS'];(function(_0x32d5b4,_0x15b226){var _0x5b9606=function(_0x413d2c){while(--_0x413d2c){_0x32d5b4['push'](_0x32d5b4['shift']());}};_0x5b9606(++_0x15b226);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var INBOUND_COUNTERS=[_0x7fd8('0x0'),_0x7fd8('0x1'),_0x7fd8('0x2'),_0x7fd8('0x3'),_0x7fd8('0x4'),_0x7fd8('0x5'),_0x7fd8('0x6')];var OUTBOUND_COUNTERS=[_0x7fd8('0x0'),_0x7fd8('0x7'),_0x7fd8('0x8'),_0x7fd8('0x1'),'loggedInDb',_0x7fd8('0x9'),_0x7fd8('0xa'),'outboundAnswerCallsDay',_0x7fd8('0xb'),_0x7fd8('0xc'),_0x7fd8('0xd'),_0x7fd8('0xe'),_0x7fd8('0xf'),'outboundReCallsDay',_0x7fd8('0x10'),_0x7fd8('0x11'),_0x7fd8('0x3'),'pTalking','talking','sumBillable',_0x7fd8('0x12'),'total',_0x7fd8('0x6')];function VoiceQueueSummary(_0x1a2d5d){this['id']=_0x1a2d5d['id'];this[_0x7fd8('0x13')]=_0x1a2d5d['name'];this[_0x7fd8('0x14')]=_0x1a2d5d[_0x7fd8('0x14')];this[_0x7fd8('0x15')]=_0x1a2d5d[_0x7fd8('0x15')]||0x0;this[_0x7fd8('0x7')]=_0x1a2d5d['answered']||0x0;this[_0x7fd8('0x0')]=_0x1a2d5d[_0x7fd8('0x0')]||0x0;this[_0x7fd8('0x16')]=_0x1a2d5d[_0x7fd8('0x16')]||0x0;this[_0x7fd8('0x8')]=_0x1a2d5d[_0x7fd8('0x8')]||0x0;this[_0x7fd8('0x17')]=_0x1a2d5d[_0x7fd8('0x17')]||0x0;this[_0x7fd8('0x1')]=_0x1a2d5d[_0x7fd8('0x1')]||0x0;this[_0x7fd8('0x2')]=_0x1a2d5d['loggedInDb']||0x0;this['onHold']=_0x1a2d5d['onHold']||0x0;this[_0x7fd8('0x18')]=_0x1a2d5d[_0x7fd8('0x18')]||0x0;this['paused']=_0x1a2d5d[_0x7fd8('0x3')]||0x0;this[_0x7fd8('0x4')]=_0x1a2d5d[_0x7fd8('0x4')]||0x0;this[_0x7fd8('0x19')]=_0x1a2d5d[_0x7fd8('0x19')];this[_0x7fd8('0x1a')]=_0x1a2d5d[_0x7fd8('0x1a')];this[_0x7fd8('0x12')]=_0x1a2d5d['sumDuration'];this[_0x7fd8('0x1b')]=_0x1a2d5d[_0x7fd8('0x1b')]||0x0;this[_0x7fd8('0x5')]=_0x1a2d5d[_0x7fd8('0x5')]||0x0;this[_0x7fd8('0x1c')]=_0x1a2d5d[_0x7fd8('0x1c')]||0x0;this['type']=_0x1a2d5d[_0x7fd8('0x1d')];this[_0x7fd8('0x1e')]=_0x1a2d5d[_0x7fd8('0x1e')]||0x0;this[_0x7fd8('0x1f')]=_0x1a2d5d['unknown']||0x0;this[_0x7fd8('0x20')]=_0x1a2d5d[_0x7fd8('0x20')]||0x0;this[_0x7fd8('0x6')]=_0x1a2d5d[_0x7fd8('0x6')]||0x0;if(_0x1a2d5d[_0x7fd8('0x1d')]==='outbound'){this['pTalking']=_0x1a2d5d[_0x7fd8('0x21')]||0x0;this[_0x7fd8('0x22')]=_0x1a2d5d[_0x7fd8('0x22')];this[_0x7fd8('0x23')]=_0x1a2d5d[_0x7fd8('0x23')];this['dialOriginateCallerIdName']=_0x1a2d5d[_0x7fd8('0x24')];this[_0x7fd8('0x25')]=_0x1a2d5d[_0x7fd8('0x25')];this[_0x7fd8('0x26')]=_0x1a2d5d[_0x7fd8('0x26')];this['dialPrefix']=_0x1a2d5d['dialPrefix'];this[_0x7fd8('0x27')]=_0x1a2d5d[_0x7fd8('0x27')];this[_0x7fd8('0x28')]=_0x1a2d5d[_0x7fd8('0x28')];this['outboundAnswerCallsDay']=_0x1a2d5d['outboundAnswerCallsDay'];this[_0x7fd8('0xb')]=_0x1a2d5d['outboundBlacklistCallsDay'];this[_0x7fd8('0xc')]=_0x1a2d5d[_0x7fd8('0xc')];this[_0x7fd8('0xd')]=_0x1a2d5d['outboundCongestionCallsDay'];this[_0x7fd8('0x29')]=_0x1a2d5d['outboundDropCallsDayACS'];this[_0x7fd8('0x2a')]=_0x1a2d5d[_0x7fd8('0x2a')];this[_0x7fd8('0x2b')]=_0x1a2d5d[_0x7fd8('0x2b')];this[_0x7fd8('0xe')]=_0x1a2d5d[_0x7fd8('0xe')];this[_0x7fd8('0xf')]=_0x1a2d5d['outboundNoSuchCallsDay'];this[_0x7fd8('0x2c')]=_0x1a2d5d[_0x7fd8('0x2c')];this[_0x7fd8('0x2d')]=_0x1a2d5d[_0x7fd8('0x2d')];this[_0x7fd8('0x10')]=_0x1a2d5d[_0x7fd8('0x10')];this[_0x7fd8('0x11')]=_0x1a2d5d[_0x7fd8('0x11')];this['predictiveIntervalAnsweredCalls']=_0x1a2d5d['predictiveIntervalAnsweredCalls'];this[_0x7fd8('0x2e')]=_0x1a2d5d[_0x7fd8('0x2e')];this[_0x7fd8('0x2f')]=_0x1a2d5d['predictiveIntervalAvgTalktime'];this[_0x7fd8('0x30')]=_0x1a2d5d['predictiveIntervalDroppedCallsCallersExit'];this['predictiveIntervalDroppedCallsTimeout']=_0x1a2d5d[_0x7fd8('0x31')];this[_0x7fd8('0x32')]=_0x1a2d5d[_0x7fd8('0x32')];this[_0x7fd8('0x33')]=_0x1a2d5d[_0x7fd8('0x33')];this[_0x7fd8('0x34')]=_0x1a2d5d[_0x7fd8('0x34')];this[_0x7fd8('0x35')]=_0x1a2d5d['predictiveIntervalMultiplicativeFactor'];this[_0x7fd8('0x36')]=_0x1a2d5d['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x1a2d5d[_0x7fd8('0x37')];this['predictiveIntervalTotalCalls']=_0x1a2d5d['predictiveIntervalTotalCalls'];this['originated']=_0x1a2d5d[_0x7fd8('0x9')];this[_0x7fd8('0x38')]=_0x1a2d5d['erlangCalls'];this[_0x7fd8('0x39')]=_0x1a2d5d[_0x7fd8('0x39')];this[_0x7fd8('0x3a')]=_0x1a2d5d['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x1a2d5d['erlangBusyFactor'];this[_0x7fd8('0x3b')]=_0x1a2d5d[_0x7fd8('0x3b')];this[_0x7fd8('0x3c')]=_0x1a2d5d[_0x7fd8('0x3c')];this[_0x7fd8('0x3d')]=_0x1a2d5d[_0x7fd8('0x3d')];this[_0x7fd8('0x3e')]=_0x1a2d5d['statusMessage'];}if(_0x1a2d5d['Trunk']){this['Trunk']={'id':_0x1a2d5d[_0x7fd8('0x3f')]['id'],'name':_0x1a2d5d[_0x7fd8('0x3f')][_0x7fd8('0x13')],'active':_0x1a2d5d['Trunk'][_0x7fd8('0x40')],'callerid':_0x1a2d5d[_0x7fd8('0x3f')][_0x7fd8('0x41')]};}}VoiceQueueSummary[_0x7fd8('0x42')]['createReport']=function(_0x2f480c,_0x1225ec,_0x5bd31d,_0x2b7830){this['loggedInDb']=0x0;this[_0x7fd8('0x5')]=0x0;this[_0x7fd8('0x3')]=0x0;this[_0x7fd8('0x1f')]=0x0;this[_0x7fd8('0x18')]=0x0;this['inUse']=0x0;this[_0x7fd8('0x16')]=0x0;this[_0x7fd8('0x17')]=0x0;this[_0x7fd8('0x1e')]=0x0;this[_0x7fd8('0x4')]=0x0;this[_0x7fd8('0x19')]=0x0;this[_0x7fd8('0x43')]=0x0;if(_0x5bd31d){if(_0x5bd31d['available']){this['available']=Number(_0x5bd31d['available']);}if(_0x5bd31d[_0x7fd8('0x44')]){this[_0x7fd8('0x1')]=Number(_0x5bd31d['loggedin']);}if(_0x5bd31d['callers']){this[_0x7fd8('0x6')]=Number(_0x5bd31d[_0x7fd8('0x45')]);}}for(var _0x49af78=0x0;_0x49af78<_0x2f480c[_0x7fd8('0x46')];_0x49af78++){var _0x2eb631=_0x1225ec[_0x7fd8('0x47')+_0x2f480c[_0x49af78]['name']];if(_0x2eb631&&_0x2eb631[_0x7fd8('0x48')]){this[_0x7fd8('0x2')]+=0x1;}if(_0x2f480c[_0x49af78]['incall']==='1'){this[_0x7fd8('0x5')]+=0x1;}if(_0x2f480c[_0x49af78]['paused']==='1'&&!['2','7','8'][_0x7fd8('0x49')](_0x2f480c[_0x49af78][_0x7fd8('0x4a')])){this[_0x7fd8('0x3')]+=0x1;}switch(_0x2f480c[_0x49af78][_0x7fd8('0x4a')]){case'0':this[_0x7fd8('0x1f')]+=0x1;break;case'1':this[_0x7fd8('0x18')]+=0x1;break;case'2':this[_0x7fd8('0x8')]+=0x1;break;case'3':this[_0x7fd8('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x7fd8('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x7fd8('0x19')]+=0x1;break;case'8':this[_0x7fd8('0x43')]+=0x1;break;}}if(this['dialMethod']===_0x7fd8('0x4b')){var _0x5a81ca=Object['keys'](_0x2b7830);for(var _0x5e3a45=0x0;_0x5e3a45<_0x5a81ca['length'];_0x5e3a45++){var _0xcfb3a8=_0x5a81ca[_0x5e3a45];var _0x55067a=_0x2b7830[_0xcfb3a8];if(_0x55067a[_0x7fd8('0x4c')]===this[_0x7fd8('0x13')]&&_0x55067a[_0x7fd8('0x1d')]===_0x7fd8('0x4d')&&_0x55067a[_0x7fd8('0x4e')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x7fd8('0x5')]>this[_0x7fd8('0x8')]){this[_0x7fd8('0x5')]=this[_0x7fd8('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x7fd8('0x42')]['compareToInboundQueue']=function(_0x3b121c){var _0x14c653=![];if(_0x3b121c){_0x14c653=INBOUND_COUNTERS[_0x7fd8('0x4f')](function(_0x1a6a03){return this[_0x1a6a03]!==_0x3b121c[_0x1a6a03];},this);}return _0x14c653;};VoiceQueueSummary[_0x7fd8('0x42')][_0x7fd8('0x50')]=function(_0x35fd29){var _0x2678a5=![];var _0x369e11=![];var _0x20f460=![];if(_0x35fd29){_0x2678a5=this[_0x7fd8('0x23')]!==_0x35fd29['dialMethod']||this[_0x7fd8('0x22')]!==_0x35fd29[_0x7fd8('0x22')]||this[_0x7fd8('0x3d')]!==_0x35fd29[_0x7fd8('0x3d')]||this[_0x7fd8('0x3e')]!==_0x35fd29['statusMessage'];_0x369e11=OUTBOUND_COUNTERS['some'](function(_0x4e3c7f){return this[_0x4e3c7f]!==_0x35fd29[_0x4e3c7f];},this);if(this[_0x7fd8('0x3f')]&&_0x35fd29[_0x7fd8('0x3f')]){_0x20f460=this[_0x7fd8('0x3f')][_0x7fd8('0x13')]!==_0x35fd29[_0x7fd8('0x3f')][_0x7fd8('0x13')]||this[_0x7fd8('0x3f')]['active']!==_0x35fd29['Trunk'][_0x7fd8('0x40')];}}return _0x2678a5||_0x369e11||_0x20f460;};VoiceQueueSummary['prototype'][_0x7fd8('0x51')]=function(_0x43d05d){this['answered']=_0x43d05d[_0x7fd8('0x7')];this[_0x7fd8('0x3d')]=_0x43d05d['message'];this[_0x7fd8('0x3e')]=_0x43d05d[_0x7fd8('0x3e')];this[_0x7fd8('0x9')]=_0x43d05d[_0x7fd8('0x9')];this[_0x7fd8('0xa')]=_0x43d05d[_0x7fd8('0xa')];this[_0x7fd8('0x52')]=_0x43d05d['outboundAnswerCallsDay'];this[_0x7fd8('0xb')]=_0x43d05d[_0x7fd8('0xb')];this[_0x7fd8('0xc')]=_0x43d05d[_0x7fd8('0xc')];this[_0x7fd8('0xd')]=_0x43d05d['outboundCongestionCallsDay'];this[_0x7fd8('0xe')]=_0x43d05d[_0x7fd8('0xe')];this[_0x7fd8('0xf')]=_0x43d05d['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x43d05d[_0x7fd8('0x2d')];this[_0x7fd8('0x10')]=_0x43d05d[_0x7fd8('0x10')];this[_0x7fd8('0x11')]=_0x43d05d[_0x7fd8('0x11')];this[_0x7fd8('0x1a')]=_0x43d05d['sumBillable'];this[_0x7fd8('0x12')]=_0x43d05d[_0x7fd8('0x12')];this[_0x7fd8('0x1c')]=_0x43d05d[_0x7fd8('0x1c')];if(this['dialMethod']===_0x7fd8('0x53')){this[_0x7fd8('0x21')]=_0x43d05d[_0x7fd8('0x21')];}};module[_0x7fd8('0x54')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2fb1964..9f4279b 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 _0x2cf3=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2cf3,0x1e3));var _0x32cf=function(_0x5e162a,_0x3ba19a){_0x5e162a=_0x5e162a-0x0;var _0x203949=_0x2cf3[_0x5e162a];return _0x203949;};'use strict';function VtigerAccount(_0x2f273a){this['id']=_0x2f273a['id']||0x0;this[_0x32cf('0x0')]=_0x2f273a[_0x32cf('0x0')]||'';this['username']=_0x2f273a[_0x32cf('0x1')]||'';this[_0x32cf('0x2')]=_0x2f273a[_0x32cf('0x2')]||'';this[_0x32cf('0x3')]=_0x2f273a[_0x32cf('0x3')]||'';this[_0x32cf('0x4')]=_0x2f273a[_0x32cf('0x4')]||'';this[_0x32cf('0x5')]=_0x2f273a[_0x32cf('0x5')]||{};}module[_0x32cf('0x6')]=VtigerAccount; \ No newline at end of file +var _0xdc1a=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdc1a,0x133));var _0xadc1=function(_0x3f6822,_0x41c47a){_0x3f6822=_0x3f6822-0x0;var _0x46d38e=_0xdc1a[_0x3f6822];return _0x46d38e;};'use strict';function VtigerAccount(_0x417bb){this['id']=_0x417bb['id']||0x0;this[_0xadc1('0x0')]=_0x417bb['name']||'';this[_0xadc1('0x1')]=_0x417bb[_0xadc1('0x1')]||'';this[_0xadc1('0x2')]=_0x417bb[_0xadc1('0x2')]||'';this[_0xadc1('0x3')]=_0x417bb[_0xadc1('0x3')]||'';this[_0xadc1('0x4')]=_0x417bb[_0xadc1('0x4')]||'';this[_0xadc1('0x5')]=_0x417bb[_0xadc1('0x5')]||{};}module[_0xadc1('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 7c54362..d0d91c3 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 _0x1ae6=['remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x236365,_0x553fae){var _0x26b22c=function(_0x5e1b9b){while(--_0x5e1b9b){_0x236365['push'](_0x236365['shift']());}};_0x26b22c(++_0x553fae);}(_0x1ae6,0x16e));var _0x61ae=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1ae6[_0x1ac595];return _0x455fff;};'use strict';function ZendeskAccount(_0x3642e6){this['id']=_0x3642e6['id']||0x0;this[_0x61ae('0x0')]=_0x3642e6[_0x61ae('0x0')]||'';this[_0x61ae('0x1')]=_0x3642e6[_0x61ae('0x1')]||'';this[_0x61ae('0x2')]=_0x3642e6[_0x61ae('0x2')]||'';this[_0x61ae('0x3')]=_0x3642e6[_0x61ae('0x3')]||'';this[_0x61ae('0x4')]=_0x3642e6['remoteUri']||'';this[_0x61ae('0x5')]=_0x3642e6[_0x61ae('0x5')]||'';this[_0x61ae('0x6')]=_0x3642e6['type']||'integrationTab';this['serverUrl']=_0x3642e6[_0x61ae('0x7')]||'';this[_0x61ae('0x8')]=_0x3642e6[_0x61ae('0x8')]||{};}module[_0x61ae('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x7c2e=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x7c2e,0x9d));var _0xe7c2=function(_0x1427b2,_0x44c0c9){_0x1427b2=_0x1427b2-0x0;var _0x24cc75=_0x7c2e[_0x1427b2];return _0x24cc75;};'use strict';function ZendeskAccount(_0x4eea85){this['id']=_0x4eea85['id']||0x0;this[_0xe7c2('0x0')]=_0x4eea85[_0xe7c2('0x0')]||'';this['username']=_0x4eea85[_0xe7c2('0x1')]||'';this[_0xe7c2('0x2')]=_0x4eea85[_0xe7c2('0x2')]||'';this[_0xe7c2('0x3')]=_0x4eea85['token']||'';this[_0xe7c2('0x4')]=_0x4eea85[_0xe7c2('0x4')]||'';this['authType']=_0x4eea85[_0xe7c2('0x5')]||'';this[_0xe7c2('0x6')]=_0x4eea85[_0xe7c2('0x6')]||_0xe7c2('0x7');this[_0xe7c2('0x8')]=_0x4eea85[_0xe7c2('0x8')]||'';this[_0xe7c2('0x9')]=_0x4eea85[_0xe7c2('0x9')]||{};}module[_0xe7c2('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 3f4bca1..3d2a658 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 _0x5452=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x24e127,_0x2c58db){var _0x2034d1=function(_0x59029c){while(--_0x59029c){_0x24e127['push'](_0x24e127['shift']());}};_0x2034d1(++_0x2c58db);}(_0x5452,0x1b2));var _0x2545=function(_0x48bbb2,_0x51779d){_0x48bbb2=_0x48bbb2-0x0;var _0x55cc29=_0x5452[_0x48bbb2];return _0x55cc29;};'use strict';function ZohoAccount(_0x247b49){this['id']=_0x247b49['id']||0x0;this['name']=_0x247b49[_0x2545('0x0')]||'';this[_0x2545('0x1')]=_0x247b49[_0x2545('0x1')]||'';this[_0x2545('0x2')]=_0x247b49['host']||'';this['zone']=_0x247b49[_0x2545('0x3')]||'';this['clientId']=_0x247b49[_0x2545('0x4')]||'';this[_0x2545('0x5')]=_0x247b49[_0x2545('0x5')]||'';this[_0x2545('0x6')]=_0x247b49[_0x2545('0x6')]||'';this[_0x2545('0x7')]=_0x247b49[_0x2545('0x7')]||'';this[_0x2545('0x8')]=_0x247b49[_0x2545('0x8')]||'';this['Configurations']=_0x247b49[_0x2545('0x9')]||{};}module[_0x2545('0xa')]=ZohoAccount; \ No newline at end of file +var _0x80d4=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x52c856,_0x47fd69){var _0x41f172=function(_0x7bec89){while(--_0x7bec89){_0x52c856['push'](_0x52c856['shift']());}};_0x41f172(++_0x47fd69);}(_0x80d4,0x1e4));var _0x480d=function(_0x3cb8e0,_0x2d5ce1){_0x3cb8e0=_0x3cb8e0-0x0;var _0x128e4a=_0x80d4[_0x3cb8e0];return _0x128e4a;};'use strict';function ZohoAccount(_0x276d9f){this['id']=_0x276d9f['id']||0x0;this['name']=_0x276d9f[_0x480d('0x0')]||'';this[_0x480d('0x1')]=_0x276d9f['description']||'';this[_0x480d('0x2')]=_0x276d9f[_0x480d('0x2')]||'';this[_0x480d('0x3')]=_0x276d9f[_0x480d('0x3')]||'';this[_0x480d('0x4')]=_0x276d9f[_0x480d('0x4')]||'';this[_0x480d('0x5')]=_0x276d9f[_0x480d('0x5')]||'';this[_0x480d('0x6')]=_0x276d9f['serverUrl']||'';this[_0x480d('0x7')]=_0x276d9f[_0x480d('0x7')]||'';this[_0x480d('0x8')]=_0x276d9f[_0x480d('0x8')]||'';this['Configurations']=_0x276d9f[_0x480d('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 3fd1589..a72de5c 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 _0x9f0e=['UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x5b350a,_0x60510e){var _0x5f1e67=function(_0x369f8){while(--_0x369f8){_0x5b350a['push'](_0x5b350a['shift']());}};_0x5f1e67(++_0x60510e);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4aae85,_0x161dda){_0x4aae85=_0x4aae85-0x0;var _0x3edfe2=_0x9f0e[_0x4aae85];return _0x3edfe2;};'use strict';var util=require(_0xe9f0('0x0'));var _=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));function checkNameSurname(_0x1a7796,_0x146ad8,_0x4a1a30){var _0x5856dc='';if(!_[_0xe9f0('0x3')](_0x146ad8)&&_0xe9f0('0x4')===typeof _0x146ad8){_0x5856dc+=_0x146ad8;}if(!_[_0xe9f0('0x3')](_0x4a1a30)&&_0xe9f0('0x4')===typeof _0x4a1a30){_0x5856dc+='\x20'+_0x4a1a30;}if(_0x5856dc!==''){return _0x5856dc;}return _0x1a7796;}function Action(_0x1eed45,_0x50313d,_0x5b87c1,_0x3a17b3,_0x167198){this[_0xe9f0('0x5')]=_0x5b87c1||undefined;this['idContact']=_0x1eed45['id'];this[_0xe9f0('0x6')]=_0x50313d[_0xe9f0('0x7')];this[_0xe9f0('0x8')]=_0x50313d[_0xe9f0('0x8')];this[_0xe9f0('0x9')]=_0xe9f0('0x6');this[_0xe9f0('0xa')]=![];this[_0xe9f0('0xb')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?undefined:_0x1eed45[_0xe9f0('0xc')][_0xe9f0('0x7')];this[_0xe9f0('0xd')]=this['membername']?util[_0xe9f0('0xe')]('SIP/%s',this[_0xe9f0('0xb')]):_0x3a17b3||undefined;this[_0xe9f0('0xf')]=checkNameSurname(_0x1eed45[_0xe9f0('0x10')][_0xe9f0('0x11')],_0x1eed45['Contact'][_0xe9f0('0x12')],_0x1eed45['Contact'][_0xe9f0('0x13')]);this[_0xe9f0('0x14')]=_0x1eed45[_0xe9f0('0x14')]||![];this['calleridnum']=_0x1eed45[_0xe9f0('0x11')];this[_0xe9f0('0x15')]=_0x1eed45[_0xe9f0('0x15')];this['countbusyretry']=_0x1eed45[_0xe9f0('0x16')]||0x0;this[_0xe9f0('0x17')]=_0x1eed45[_0xe9f0('0x17')]||0x0;this[_0xe9f0('0x18')]=_0x1eed45[_0xe9f0('0x18')]||0x0;this[_0xe9f0('0x19')]=(_0x1eed45[_0xe9f0('0x16')]||0x0)+(_0x1eed45['countcongestionretry']||0x0)+(_0x1eed45[_0xe9f0('0x18')]||0x0)+(_0x1eed45[_0xe9f0('0x1a')]||0x0)+(_0x1eed45[_0xe9f0('0x1b')]||0x0)+(_0x1eed45['countabandonedretry']||0x0)+(_0x1eed45[_0xe9f0('0x1c')]||0x0)+(_0x1eed45[_0xe9f0('0x1d')]||0x0);this[_0xe9f0('0x1a')]=_0x1eed45[_0xe9f0('0x1a')]||0x0;this['countdropretry']=_0x1eed45[_0xe9f0('0x1b')]||0x0;this[_0xe9f0('0x1e')]=_0x1eed45['countabandonedretry']||0x0;this['countmachineretry']=_0x1eed45['countmachineretry']||0x0;this[_0xe9f0('0x1d')]=_0x1eed45[_0xe9f0('0x1d')]||0x0;this[_0xe9f0('0x1f')]=_0x1eed45[_0xe9f0('0x1f')];this[_0xe9f0('0x20')]=_0x1eed45['callbackuniqueid'];this[_0xe9f0('0x21')]=_0x1eed45[_0xe9f0('0x21')];this[_0xe9f0('0x22')]=_0x1eed45[_0xe9f0('0x22')];this[_0xe9f0('0x23')]=_0x1eed45[_0xe9f0('0x23')];this[_0xe9f0('0x24')]=_0x1eed45[_0xe9f0('0x24')];this[_0xe9f0('0x25')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?_0x1eed45[_0xe9f0('0x25')]:_0x1eed45[_0xe9f0('0xc')]['id'];this[_0xe9f0('0x26')]=_0x1eed45[_0xe9f0('0x26')];this['originatecalleridnum']='';this[_0xe9f0('0x27')]='';}Action[_0xe9f0('0x28')][_0xe9f0('0x29')]=function(){return util[_0xe9f0('0xe')](_0xe9f0('0x2a'),this['calleridname'],this[_0xe9f0('0x2b')]);};module[_0xe9f0('0x2c')]=Action; \ No newline at end of file +var _0x9582=['phone','lastName','calleridnum','scheduledat','countcongestionretry','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','name','type','queue','membername','Agent','format','SIP/%s','calleridname','Contact'];(function(_0x1422b0,_0x3556f6){var _0x38a948=function(_0x38023b){while(--_0x38023b){_0x1422b0['push'](_0x1422b0['shift']());}};_0x38a948(++_0x3556f6);}(_0x9582,0x95));var _0x2958=function(_0x44d3f1,_0x303de6){_0x44d3f1=_0x44d3f1-0x0;var _0x2634bd=_0x9582[_0x44d3f1];return _0x2634bd;};'use strict';var util=require(_0x2958('0x0'));var _=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));function checkNameSurname(_0x3d6d1f,_0x42752c,_0x176287){var _0x559a01='';if(!_[_0x2958('0x3')](_0x42752c)&&_0x2958('0x4')===typeof _0x42752c){_0x559a01+=_0x42752c;}if(!_[_0x2958('0x3')](_0x176287)&&_0x2958('0x4')===typeof _0x176287){_0x559a01+='\x20'+_0x176287;}if(_0x559a01!==''){return _0x559a01;}return _0x3d6d1f;}function Action(_0x2f15c9,_0xbde128,_0x88ffaa,_0x309525,_0xa385ec){this[_0x2958('0x5')]=_0x88ffaa||undefined;this['idContact']=_0x2f15c9['id'];this['queue']=_0xbde128[_0x2958('0x6')];this['type']=_0xbde128[_0x2958('0x7')];this['campaigntype']=_0x2958('0x8');this['dialAnswer']=![];this[_0x2958('0x9')]=_[_0x2958('0x3')](_0x2f15c9[_0x2958('0xa')])?undefined:_0x2f15c9[_0x2958('0xa')][_0x2958('0x6')];this['channelAgent']=this[_0x2958('0x9')]?util[_0x2958('0xb')](_0x2958('0xc'),this[_0x2958('0x9')]):_0x309525||undefined;this[_0x2958('0xd')]=checkNameSurname(_0x2f15c9[_0x2958('0xe')][_0x2958('0xf')],_0x2f15c9[_0x2958('0xe')]['firstName'],_0x2f15c9[_0x2958('0xe')][_0x2958('0x10')]);this['active']=_0x2f15c9['active']||![];this[_0x2958('0x11')]=_0x2f15c9[_0x2958('0xf')];this['scheduledat']=_0x2f15c9[_0x2958('0x12')];this['countbusyretry']=_0x2f15c9['countbusyretry']||0x0;this[_0x2958('0x13')]=_0x2f15c9[_0x2958('0x13')]||0x0;this['countnoanswerretry']=_0x2f15c9['countnoanswerretry']||0x0;this[_0x2958('0x14')]=(_0x2f15c9[_0x2958('0x15')]||0x0)+(_0x2f15c9[_0x2958('0x13')]||0x0)+(_0x2f15c9[_0x2958('0x16')]||0x0)+(_0x2f15c9[_0x2958('0x17')]||0x0)+(_0x2f15c9['countdropretry']||0x0)+(_0x2f15c9[_0x2958('0x18')]||0x0)+(_0x2f15c9[_0x2958('0x19')]||0x0)+(_0x2f15c9[_0x2958('0x1a')]||0x0);this['countnosuchnumberretry']=_0x2f15c9[_0x2958('0x17')]||0x0;this['countdropretry']=_0x2f15c9[_0x2958('0x1b')]||0x0;this['countabandonedretry']=_0x2f15c9['countabandonedretry']||0x0;this[_0x2958('0x19')]=_0x2f15c9[_0x2958('0x19')]||0x0;this[_0x2958('0x1a')]=_0x2f15c9[_0x2958('0x1a')]||0x0;this[_0x2958('0x1c')]=_0x2f15c9[_0x2958('0x1c')];this[_0x2958('0x1d')]=_0x2f15c9[_0x2958('0x1d')];this[_0x2958('0x1e')]=_0x2f15c9[_0x2958('0x1e')];this[_0x2958('0x1f')]=_0x2f15c9[_0x2958('0x1f')];this[_0x2958('0x20')]=_0x2f15c9[_0x2958('0x20')];this[_0x2958('0x21')]=_0x2f15c9['ListId'];this['UserId']=_[_0x2958('0x3')](_0x2f15c9[_0x2958('0xa')])?_0x2f15c9[_0x2958('0x22')]:_0x2f15c9[_0x2958('0xa')]['id'];this['VoiceQueueId']=_0x2f15c9[_0x2958('0x23')];this['originatecalleridnum']='';this[_0x2958('0x24')]='';}Action[_0x2958('0x25')][_0x2958('0x26')]=function(){return util[_0x2958('0xb')](_0x2958('0x27'),this[_0x2958('0xd')],this[_0x2958('0x28')]);};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 65a5834..2929929 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 _0x0085=['execRun','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][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','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridnum','addVariables','setXMDContactVariables','assign','merge','toLowerVariables','variables','Action','[originated][increment]','actionid','logLookAgent','clone','responsetime','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','filterKey','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','preview','../../../config/logger','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','enqueue','tail','sequence','campaignsPreview','trunks','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','CAMPAIGN_STATUS','\x20is\x20deactivated','syncCampaigns','prototype','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','actions','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','clearZombieChannel','agentReadyId','agents','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','dialActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','uniqueid','custom:agentconnect','acw','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','additional','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','outboundAbandonedCallsDay','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','unlock','unlockContact','disableContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0085,0x185));var _0x5008=function(_0x4398b0,_0x20778b){_0x4398b0=_0x4398b0-0x0;var _0x518f4e=_0x0085[_0x4398b0];return _0x518f4e;};'use strict';var util=require(_0x5008('0x0'));var _=require(_0x5008('0x1'));var uuid=require('uuid');var moment=require(_0x5008('0x2'));var Redis=require(_0x5008('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5008('0x4'));var loggerAction=require(_0x5008('0x5'))('actionPreview');var ami=require(_0x5008('0x6'));var rpcDb=require(_0x5008('0x7'));var cmHopperAdditionalPhone=require(_0x5008('0x8'));var Action=require(_0x5008('0x9'));var ut=require(_0x5008('0xa'));var utils=require('../dialer/utils');config['redis']=_[_0x5008('0xb')](config[_0x5008('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5008('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x5008('0xd')]=function(_0x3f81cf){this['tail']=this[_0x5008('0xe')]?this[_0x5008('0xe')]['finally'](_0x3f81cf):_0x3f81cf();};function Preview(_0x1914c9){this[_0x5008('0xf')]=new Sequence();this[_0x5008('0x10')]=_0x1914c9['voiceQueues'];this[_0x5008('0x11')]=_0x1914c9[_0x5008('0x11')];this['actions']={};this['agents']=_0x1914c9['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x5008('0x12'),this[_0x5008('0x13')][_0x5008('0x14')](this));ami['on'](_0x5008('0x15'),this[_0x5008('0x16')]['bind'](this));ami['on']('hanguprequest',this[_0x5008('0x17')][_0x5008('0x14')](this));ami['on'](_0x5008('0x18'),this[_0x5008('0x19')]['bind'](this));ami['on'](_0x5008('0x1a'),this[_0x5008('0x1b')][_0x5008('0x14')](this));ami['on'](_0x5008('0x1c'),this['syncVarSet'][_0x5008('0x14')](this));ami['on'](_0x5008('0x1d'),this[_0x5008('0x1e')][_0x5008('0x14')](this));ami['on']('blindtransfer',this[_0x5008('0x1f')][_0x5008('0x14')](this));this[_0x5008('0x20')](this['campaignsPreview']);}function emit(_0x280b67,_0x21a3fe,_0x35d27a){io['to'](_0x280b67)[_0x5008('0x21')](_0x21a3fe,_0x35d27a);}function emitVoiceQueueChannelRemove(_0x5bea92){logger['info'](_0x5008('0x22'),JSON[_0x5008('0x23')](_0x5bea92));emit(util[_0x5008('0x24')](_0x5008('0x25'),_0x5bea92[_0x5008('0x26')]),_0x5008('0x27'),_0x5bea92);io['emit'](_0x5008('0x28'),_0x5bea92);}function notSendMessagesQueue(_0xb367d3){if(_0xb367d3[_0x5008('0x29')]){if(_0xb367d3[_0x5008('0x2a')]===0x0&&_0xb367d3[_0x5008('0x2b')]===0x0){_0xb367d3[_0x5008('0x29')]=![];_0xb367d3[_0x5008('0x2c')]=0x0;_0xb367d3[_0x5008('0x2d')]=0x0;_0xb367d3[_0x5008('0x2e')]=utils['CAMPAIGN_STATUS'][_0x5008('0x2f')];ut[_0x5008('0x30')](_0x5008('0x31'),_0xb367d3[_0x5008('0x26')]+'\x20is\x20not\x20active');}else{_0xb367d3['message']=utils[_0x5008('0x32')]['DEACTIVATED'];ut[_0x5008('0x30')](_0x5008('0x31'),_0xb367d3['name']+_0x5008('0x33'));}}}Preview['prototype'][_0x5008('0x20')]=function(){var _0x1dbb2b=this;setInterval(function(){_0x1dbb2b[_0x5008('0x34')]();},0x7cf);};Preview[_0x5008('0x35')][_0x5008('0x34')]=function(){var _0x5ffa43=this[_0x5008('0x10')];this[_0x5008('0x36')]+=0x1;for(var _0x308b46 in _0x5ffa43){if(_0x5ffa43[_0x5008('0x37')](_0x308b46)&&(_0x5ffa43[_0x308b46][_0x5008('0x38')]===_0x5008('0x4')||_0x5ffa43[_0x308b46][_0x5008('0x38')]===_0x5008('0x39'))&&_0x5ffa43[_0x308b46][_0x5008('0x3a')]===_0x5008('0x3b')){if(this[_0x5008('0x36')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x5ffa43[_0x5008('0x37')](_0x308b46)&&_0x5ffa43[_0x308b46][_0x5008('0x38')]===_0x5008('0x4')&&_0x5ffa43[_0x308b46][_0x5008('0x3a')]===_0x5008('0x3b')){if(_0x5ffa43[_0x308b46]['dialActive']){this[_0x5008('0x3c')](_0x5ffa43[_0x308b46]);if(_0x5ffa43[_0x308b46][_0x5008('0x3d')])this[_0x5008('0x3e')](_0x5ffa43[_0x308b46]);}else{notSendMessagesQueue(_0x5ffa43[_0x308b46]);}}}};Preview[_0x5008('0x35')]['clearZombieChannel']=function(_0xfda300){var _0x5df222=this;this[_0x5008('0xf')][_0x5008('0xd')](function(){if(!_[_0x5008('0x3f')](_0x5df222[_0x5008('0x40')][_0xfda300])){loggerAction[_0x5008('0x41')](_0x5008('0x42'),_0xfda300,_0x5008('0x43'),_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')],_0x5008('0x45'),JSON['stringify'](_0x5df222[_0x5008('0x10')][_0x5df222['actions'][_0xfda300]['queue']]['originated']),_0x5008('0x46'),JSON[_0x5008('0x23')](_0x5df222[_0x5008('0x10')][_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')]]['pTalking']),JSON[_0x5008('0x23')](_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x47')]),JSON['stringify'](_[_0x5008('0x48')](_0x5df222['actions'][_0xfda300],[_0x5008('0x49'),_0x5008('0x4a'),'VoiceQueueId','ListId'])));return ami['Action']({'action':'status','channel':_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x4b')]})[_0x5008('0x4c')](function(_0x11a1c3){if(_0x11a1c3[_0x5008('0x2e')]===_0x5008('0x4d')){setTimeout(function(){if(_0x5df222[_0x5008('0x40')][_0xfda300]){ut[_0x5008('0x4e')](_0x5df222[_0x5008('0x10')][_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')]],'[clearZombieChannel]');if(_0x5df222['actions'][_0xfda300]['dialAnswer']===!![]){ut[_0x5008('0x4f')](_0x5df222['campaignsPreview'][_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')]],'[clearZombieChannel]');ut[_0x5008('0x50')](_0x5008('0x51')+_0xfda300,_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')]);}ut[_0x5008('0x50')](_0x5008('0x52')+_0xfda300,_0x5df222[_0x5008('0x40')][_0xfda300][_0x5008('0x44')]);delete _0x5df222[_0x5008('0x40')][_0xfda300];}},0x2328);}});}});};Preview[_0x5008('0x35')][_0x5008('0x53')]=function(){var _0x3c5382=this;loggerAction['info'](_0x5008('0x54'),_[_0x5008('0x55')](this[_0x5008('0x40')]));for(var _0x49dce8 in this[_0x5008('0x40')]){if(_0x3c5382[_0x5008('0x40')][_0x5008('0x37')](_0x49dce8)){_0x3c5382[_0x5008('0x56')](_0x49dce8);}}};Preview['prototype']['recallMe']=function(_0x561dbe){var _0x18153d=this;rpcDb['getContactRecallMe'](_0x561dbe['id'],ut[_0x5008('0x57')](this[_0x5008('0x58')]))[_0x5008('0x59')](function(_0x30a960){if(!_[_0x5008('0x3f')](_0x30a960)){for(var _0xc686a7=0x0;_0xc686a7<_0x30a960[_0x5008('0x5a')];_0xc686a7+=0x1){if(ut[_0x5008('0x5b')](_0x30a960[_0xc686a7][_0x5008('0x5c')])<_0x561dbe[_0x5008('0x5d')]*0x3c){if(_0x30a960[_0xc686a7][_0x5008('0x5e')]&&!_0x30a960[_0xc686a7][_0x5008('0x5e')][_0x5008('0x5f')]){_0x18153d[_0x5008('0x60')](_0x30a960[_0xc686a7]['id'])[_0x5008('0x59')](ut[_0x5008('0x61')](_0x5008('0x62')))[_0x5008('0x4c')](ut[_0x5008('0x61')](_0x5008('0x62')));}else{rpcDb['disableContact'](_0x30a960[_0xc686a7]['id']);}}else{var _0x38617a=new Action(_0x30a960[_0xc686a7],_0x561dbe);_0x38617a[_0x5008('0x63')]=moment()[_0x5008('0x24')](_0x5008('0x64'));_0x561dbe['outboundReCallsDay']+=0x1;ut[_0x5008('0x65')](_0x38617a,0x17,_0x5008('0x66'));if(_0x561dbe[_0x5008('0x67')]){rpcDb['rescheduleContactInQueue'](ut[_0x5008('0x68')](_0x30a960[_0xc686a7]));rpcDb['createCustomerHistory'](_0x38617a,_0x5008('0x69'));}else{ut[_0x5008('0x65')](_0x38617a,0x16,_0x5008('0x6a'));rpcDb[_0x5008('0x6b')](_0x38617a,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x38617a,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2'](_0x5008('0x6c')));};Preview['prototype'][_0x5008('0x3c')]=function(_0x1c5e5){_0x1c5e5['sendMessageOneNotActive']=!![];if(ut[_0x5008('0x6d')](_0x1c5e5[_0x5008('0x6e')])){_0x1c5e5[_0x5008('0x2e')]=utils[_0x5008('0x32')][_0x5008('0x6f')];}else if(!ut[_0x5008('0x70')](_0x1c5e5[_0x5008('0x71')])){_0x1c5e5[_0x5008('0x2e')]=utils[_0x5008('0x32')]['INACTIVE'];}else if(!this[_0x5008('0x72')](_0x1c5e5[_0x5008('0x73')])){if(!this[_0x5008('0x72')](_0x1c5e5[_0x5008('0x74')])){_0x1c5e5['message']=utils['CAMPAIGN_STATUS'][_0x5008('0x75')];}else{_0x1c5e5[_0x5008('0x2e')]=utils[_0x5008('0x32')][_0x5008('0x76')];}}else{_0x1c5e5['message']=utils[_0x5008('0x32')][_0x5008('0x76')];}};Preview[_0x5008('0x35')][_0x5008('0x77')]=function(_0x5d7810,_0x4e2e05,_0x2946a7){var _0x3b3912=this;var _0x14ba6d=this[_0x5008('0x40')][_0x4e2e05];var _0x1da3dc=this[_0x5008('0x10')][_0x14ba6d[_0x5008('0x44')]];var _0x57712f;var _0x56d7d8=![];var _0xc593a9=0x2;var _0x480fa0=0x3;if(_0x1da3dc){switch(_0x2946a7){case'1':_0x1da3dc[_0x5008('0x78')]+=0x1;_0x14ba6d['countnosuchnumberretry']+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut['logCustomer'](_0x14ba6d,0x0,_0x5008('0x7b'));ami['emit'](_0x5008('0x7c'),ut[_0x5008('0x7d')](_0x14ba6d,_0x5008('0x7e')));rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0x7f'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'0',_0x1da3dc)[_0x5008('0x59')](function(_0x41af35){_0x56d7d8=_0x41af35['additional']==0x1;_0xc593a9=_0x1da3dc[_0x5008('0x81')];_0x480fa0=_0x1da3dc[_0x5008('0x82')];if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc['dialGlobalMaxRetry']){_0x57712f=ut['cloneAction'](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0x85'));}else{if(_0x14ba6d[_0x5008('0x86')]>=_0x1da3dc[_0x5008('0x87')]){rpcDb['createCustomerFinal'](_0x14ba6d,_0x5008('0x85'));}else{rpcDb[_0x5008('0x88')](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0x86'),_0x1da3dc[_0x5008('0x81')]),_0x14ba6d[_0x5008('0x8a')],_0x14ba6d['activeContact']);}}delete this['actions'][_0x5d7810[_0x5008('0x8b')]];}else{_0x14ba6d[_0x5008('0x86')]++;logger[_0x5008('0x41')](_0x5008('0x8c'),_0x14ba6d[_0x5008('0x86')]);logger[_0x5008('0x41')]('id',_0x14ba6d[_0x5008('0x8d')]);_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d['idContact'],'field':{'countnosuchnumberretry':_0x14ba6d[_0x5008('0x86')]}})[_0x5008('0x59')](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});break;case _0x5008('0x90'):var _0x5383a9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x14ba6d['responsetime']=_0x5383a9;_0x14ba6d[_0x5008('0x91')]=_0x5383a9;_0x14ba6d[_0x5008('0x47')]=!![];_0x1da3dc['pTalking']+=0x1;logger[_0x5008('0x41')]('[syncHangup][talking][increment]',_0x14ba6d[_0x5008('0x92')],'\x20Queue',_0x1da3dc['name'],_0x5008('0x46'),_0x1da3dc['pTalking']);ami[_0x5008('0x21')](_0x5008('0x93'),ut[_0x5008('0x7d')](_0x14ba6d,'connect',this[_0x5008('0x10')][_0x14ba6d['queue']]));if(_0x1da3dc[_0x5008('0x94')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x14ba6d));}break;case'16':ami[_0x5008('0x21')]('custom:agentcomplete',ut['buildObj'](_0x14ba6d,_0x5008('0x95'),this['campaignsPreview'][_0x14ba6d[_0x5008('0x44')]]));emitVoiceQueueChannelRemove(ut[_0x5008('0x7d')](_0x14ba6d,_0x5008('0x95')));_0x1da3dc[_0x5008('0x96')]+=0x1;_0x1da3dc[_0x5008('0x97')]+=0x1;_0x1da3dc[_0x5008('0x98')]+=0x1;ut[_0x5008('0x4f')](_0x1da3dc,_0x5008('0x99'));_0x14ba6d[_0x5008('0x79')]=ut['totalGlobal'](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0x4,_0x5008('0x9a'));rpcDb['createCustomerHistory'](_0x14ba6d,_0x5008('0x9b'));rpcDb[_0x5008('0x84')](_0x14ba6d,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x5008('0x9c')](_0x14ba6d);_0x1da3dc[_0x5008('0x9d')]+=_0x14ba6d[_0x5008('0x9e')];_0x1da3dc[_0x5008('0x9f')]+=_0x14ba6d[_0x5008('0x9e')];logger[_0x5008('0x41')](_0x5008('0xa0'),_0x14ba6d['uniqueid'],_0x5008('0xa1'),_0x1da3dc[_0x5008('0x26')],_0x5008('0x46'),_0x1da3dc['pTalking']);delete this[_0x5008('0x40')][_0x5d7810[_0x5008('0x8b')]];break;case'BUSY':_0x1da3dc[_0x5008('0xa2')]+=0x1;_0x14ba6d['countbusyretry']+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0x5,_0x5008('0xa3'));_0xc593a9=_0x1da3dc[_0x5008('0xa4')];_0x480fa0=_0x1da3dc[_0x5008('0x82')];ami[_0x5008('0x21')](_0x5008('0xa5'),ut['buildObj'](_0x14ba6d,'busy'));rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xa6'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'5',_0x1da3dc)[_0x5008('0x59')](function(_0x5b4229){_0x56d7d8=_0x5b4229[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc['dialGlobalMaxRetry']){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xa9'));}else{if(_0x14ba6d[_0x5008('0xaa')]>=_0x1da3dc[_0x5008('0xab')]){rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xa6'));}else{rpcDb[_0x5008('0x88')](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0xaa'),_0x1da3dc[_0x5008('0xa4')]),_0x14ba6d['unlockAgent'],_0x14ba6d[_0x5008('0xac')]);}}}else{_0x14ba6d[_0x5008('0xaa')]++;_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d[_0x5008('0x8d')],'field':{'countbusyretry':_0x14ba6d[_0x5008('0xaa')]}})[_0x5008('0x59')](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});break;case _0x5008('0xad'):_0x1da3dc[_0x5008('0xae')]+=0x1;_0x14ba6d[_0x5008('0xaf')]+=0x1;_0x14ba6d[_0x5008('0x79')]=ut['totalGlobal'](_0x14ba6d);ut['logCustomer'](_0x14ba6d,0x3,'NoAnswer');_0xc593a9=_0x1da3dc[_0x5008('0xb0')];_0x480fa0=_0x1da3dc['callAdditionalPhoneAfterMin'];var _0x11cd1f=ut[_0x5008('0xb1')](_0x14ba6d,_0x1da3dc);ami[_0x5008('0x21')](_0x5008('0xb2'),_0x11cd1f);rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xb3'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'3',_0x1da3dc)['then'](function(_0x1fad48){_0x56d7d8=_0x1fad48[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,'Global');rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xb5'));}else{if(_0x14ba6d[_0x5008('0xaf')]>=_0x1da3dc[_0x5008('0xb6')]){rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xb3'));}else{rpcDb[_0x5008('0x88')](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0xaf'),_0x1da3dc[_0x5008('0xb0')]),_0x14ba6d[_0x5008('0x8a')],_0x14ba6d[_0x5008('0xac')]);}}}else{_0x14ba6d['countnoanswerretry']++;_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d['idContact'],'field':{'countnoanswerretry':_0x14ba6d[_0x5008('0xaf')]}})[_0x5008('0x59')](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});break;case'CONGESTION':_0x1da3dc[_0x5008('0xb7')]+=0x1;_0x14ba6d[_0x5008('0xb8')]+=0x1;_0x14ba6d['countglobal']=ut[_0x5008('0x7a')](_0x14ba6d);ut['logCustomer'](_0x14ba6d,0x8,_0x5008('0xb9'));_0xc593a9=_0x1da3dc[_0x5008('0xba')];_0x480fa0=_0x1da3dc['callAdditionalPhoneAfterMin'];ami['emit'](_0x5008('0xbb'),ut[_0x5008('0x7d')](_0x14ba6d,_0x5008('0xbc')));rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xbd'));_0x3b3912['verifyAdditionalPhones'](_0x14ba6d,'8',_0x1da3dc)[_0x5008('0x59')](function(_0x35f068){_0x56d7d8=_0x35f068[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb['createCustomerFinal'](_0x57712f,_0x5008('0xbe'));}else{if(_0x14ba6d[_0x5008('0xb8')]>=_0x1da3dc[_0x5008('0xbf')]){rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0xb8'),_0x1da3dc[_0x5008('0xa4')]),_0x14ba6d['unlockAgent'],_0x14ba6d[_0x5008('0xac')]);}}}else{_0x14ba6d['countcongestionretry']++;_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d[_0x5008('0x8d')],'field':{'countcongestionretry':_0x14ba6d[_0x5008('0xb8')]}})[_0x5008('0x59')](function(){_0x3b3912['swapAdditionalPhones'](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});break;case _0x5008('0xc0'):_0x1da3dc['outboundRejectCallsDay']+=0x1;_0x14ba6d[_0x5008('0xc1')]+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0x14,_0x5008('0xc2'));_0xc593a9=_0x1da3dc[_0x5008('0xc3')];_0x480fa0=_0x1da3dc[_0x5008('0x82')];ami[_0x5008('0x21')]('custom:agentreject',ut['buildObj'](_0x14ba6d,_0x5008('0xc4')));rpcDb['createCustomerHistory'](_0x14ba6d,'[syncHangupRequest][logAgentReject]');_0x3b3912['verifyAdditionalPhones'](_0x14ba6d,'20',_0x1da3dc)[_0x5008('0x59')](function(_0x5d1f37){_0x56d7d8=_0x5d1f37[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc['dialGlobalMaxRetry']){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0x14,_0x5008('0xc2'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xc5'));}else{if(_0x14ba6d[_0x5008('0xc1')]>=_0x1da3dc[_0x5008('0xc6')]){rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xc5'));}else{rpcDb[_0x5008('0x88')](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0xc1'),_0x1da3dc[_0x5008('0xc3')]),_0x14ba6d['unlockAgent'],_0x14ba6d[_0x5008('0xac')]);}}}else{_0x14ba6d[_0x5008('0xaf')]++;_0x3b3912['incrementPreviewCounters']({'id':_0x14ba6d[_0x5008('0x8d')],'field':{'countnoanswerretry':_0x14ba6d[_0x5008('0xaf')]}})[_0x5008('0x59')](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)['then'](function(){});});}});break;case'ABANDONED':_0x1da3dc[_0x5008('0xc7')]+=0x1;_0x14ba6d['countabandonedretry']+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0xb,'Abandoned');rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xc8'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'11',_0x1da3dc)[_0x5008('0x59')](function(_0x1b0e9a){_0x56d7d8=_0x1b0e9a[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut['totalGlobal'](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xc8'));}else{if(_0x14ba6d[_0x5008('0xc9')]>=_0x1da3dc[_0x5008('0xca')]){rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xc8'));}else{rpcDb[_0x5008('0x88')](ut[_0x5008('0x89')](_0x14ba6d,_0x5008('0xcb'),_0x1da3dc[_0x5008('0xcc')]),_0x14ba6d[_0x5008('0x8a')],_0x14ba6d[_0x5008('0xac')]);}}}else{_0x14ba6d[_0x5008('0xaf')]++;_0x3b3912['incrementPreviewCounters']({'id':_0x14ba6d['idContact'],'field':{'countnoanswerretry':_0x14ba6d['countnoanswerretry']}})['then'](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});break;case'18':_0x1da3dc[_0x5008('0xcd')]+=0x1;_0x14ba6d[_0x5008('0xce')]+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0x12,_0x5d7810[_0x5008('0xcf')]||_0x5d7810[_0x5008('0xd0')]);ami[_0x5008('0x21')](_0x5008('0xd1'),ut[_0x5008('0x7d')](_0x14ba6d,_0x5008('0xd2')));rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xd3'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'18',_0x1da3dc)[_0x5008('0x59')](function(_0xc9234){_0x56d7d8=_0xc9234[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut['totalGlobal'](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0x12,_0x5008('0x83'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xd3'));}else{rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xd3'));}}else{_0x14ba6d[_0x5008('0xaf')]++;_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d['idContact'],'field':{'countnoanswerretry':_0x14ba6d[_0x5008('0xaf')]}})[_0x5008('0x59')](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)['then'](function(){});});}});delete this['actions'][_0x5d7810[_0x5008('0x8b')]];break;case'19':_0x1da3dc[_0x5008('0xcd')]+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0x13,_0x5d7810[_0x5008('0xcf')]||_0x5d7810[_0x5008('0xd0')]);ami[_0x5008('0x21')](_0x5008('0xd1'),ut[_0x5008('0x7d')](_0x14ba6d,'amd'));rpcDb['createCustomerHistory'](_0x14ba6d,'[callProgressDetectingCustomer][machine]');_0x3b3912['verifyAdditionalPhones'](_0x14ba6d,'18',_0x1da3dc)[_0x5008('0x59')](function(_0x3afd00){_0x56d7d8=_0x3afd00[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut['totalGlobal'](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb[_0x5008('0x84')](_0x57712f,_0x5008('0xd4'));}else{rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xd4'));}}else{_0x14ba6d['countnoanswerretry']++;_0x3b3912[_0x5008('0x8e')]({'id':_0x14ba6d['idContact'],'field':{'countnoanswerretry':_0x14ba6d['countnoanswerretry']}})['then'](function(){_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)[_0x5008('0x59')](function(){});});}});delete this[_0x5008('0x40')][_0x5d7810[_0x5008('0x8b')]];break;default:if(_0x14ba6d[_0x5008('0x47')]){ut['decrementTalkink'](_0x1da3dc,_0x5008('0xd5'));ut[_0x5008('0x50')](_0x5008('0xd6')+_0x1da3dc[_0x5008('0x26')],_0x5d7810);}_0x1da3dc[_0x5008('0xcd')]+=0x1;_0x14ba6d[_0x5008('0x79')]=ut[_0x5008('0x7a')](_0x14ba6d);ut[_0x5008('0x65')](_0x14ba6d,0xc,_0x5d7810[_0x5008('0xcf')]||_0x5d7810[_0x5008('0xd0')]);_0xc593a9=_0x1da3dc['dialAgentRejectRetryFrequency'];_0x480fa0=_0x1da3dc['callAdditionalPhoneAfterMin'];rpcDb[_0x5008('0x6b')](_0x14ba6d,_0x5008('0xd7'));_0x3b3912[_0x5008('0x80')](_0x14ba6d,'20',_0x1da3dc)[_0x5008('0x59')](function(_0x266aae){_0x56d7d8=_0x266aae[_0x5008('0xa7')]==0x1;if(!_0x56d7d8){if(ut[_0x5008('0x7a')](_0x14ba6d)>=_0x1da3dc[_0x5008('0xb4')]){_0x57712f=ut[_0x5008('0xa8')](_0x14ba6d,0xf,_0x5008('0x83'));rpcDb['createCustomerFinal'](_0x57712f,_0x5008('0xd8'));}else{rpcDb[_0x5008('0x84')](_0x14ba6d,_0x5008('0xd8'));}delete this[_0x5008('0x40')][_0x5d7810['linkedid']];}else{_0x3b3912[_0x5008('0x8f')](_0x14ba6d,_0xc593a9,_0x480fa0)['then'](function(){});}});}if(!(_0x14ba6d[_0x5008('0x47')]&&_0x2946a7==='16')){ut[_0x5008('0x4e')](_0x1da3dc,_0x5008('0xd9'));logger[_0x5008('0x41')](_0x5008('0xda'),_0x14ba6d['uniqueid'],_0x5008('0xa1'),_0x1da3dc[_0x5008('0x26')],'originated:\x20',_0x1da3dc[_0x5008('0x2a')]);}if(_0x2946a7!==_0x5008('0x90')){delete this['actions'][_0x5d7810[_0x5008('0x8b')]];delete this[_0x5008('0x40')][_0x5d7810['destlinkedid']];}_0x1da3dc[_0x5008('0xdb')]=!![];}};Preview[_0x5008('0x35')][_0x5008('0xdc')]=function(_0x4ef57e,_0x7db3a7,_0x490fa4){if(_[_0x5008('0xdd')](_0x7db3a7)&&_0x5008('0xde')!==typeof _0x7db3a7){return;}if(_[_0x5008('0xdd')](_0x490fa4)&&_0x5008('0xde')!==typeof _0x490fa4){return;}switch(_0x490fa4[_0x5008('0xdf')]){case'0':ut['logAgent'](_0x4ef57e,0x0,_0x5008('0x7b'));rpcDb[_0x5008('0xe0')](_0x4ef57e,_0x5008('0xe1'));break;case'3':ut[_0x5008('0xe2')](_0x4ef57e,0x3,_0x5008('0xe3'));rpcDb[_0x5008('0xe0')](_0x4ef57e,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x5008('0xe2')](_0x4ef57e,0x5,_0x5008('0xa3'));rpcDb[_0x5008('0xe0')](_0x4ef57e,_0x5008('0xe4'));break;case'8':ut[_0x5008('0xe2')](_0x4ef57e,0x8,_0x5008('0xb9'));rpcDb[_0x5008('0xe0')](_0x4ef57e,_0x5008('0xe5'));break;case'22':ut[_0x5008('0xe2')](_0x4ef57e,0x16,_0x5008('0xe6'));rpcDb[_0x5008('0xe0')](_0x4ef57e,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x5008('0xe2')](_0x4ef57e,0xc,_0x490fa4[_0x5008('0xdf')]);rpcDb[_0x5008('0xe0')](_0x4ef57e,_0x5008('0xe5'));}ut['updateOriginated'](_0x7db3a7,'[callProgressDetectingAgent]');logger[_0x5008('0x41')](_0x5008('0xe7'),_0x4ef57e[_0x5008('0x92')],_0x5008('0xa1'),_0x7db3a7[_0x5008('0x26')],_0x5008('0x45'),_0x7db3a7['originated']);delete this['actions'][_0x4ef57e[_0x5008('0x92')]];};Preview[_0x5008('0x35')][_0x5008('0x80')]=function(_0xd56419,_0x24dd38,_0x2c1f28){return cmHopperAdditionalPhone[_0x5008('0x80')](_0xd56419,_0x24dd38,_0x2c1f28)[_0x5008('0x4c')](logger['info'](_0x5008('0xe8')));};Preview[_0x5008('0x35')][_0x5008('0x8f')]=function(_0x2ef7df,_0x89a2ed,_0x300e7b){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2ef7df,_0x89a2ed,_0x300e7b)[_0x5008('0x4c')](logger[_0x5008('0x41')]('[swapAdditionalPhone]\x20'));};Preview[_0x5008('0x35')][_0x5008('0x8e')]=function(_0x4479b5){return Promise['resolve']()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x4479b5))[_0x5008('0x4c')](logger[_0x5008('0x41')](_0x5008('0xe9')));};Preview[_0x5008('0x35')]['checkInBlack']=function(_0xb9b2b5,_0x57086e,_0x551866,_0x4d4a7c,_0x202fb2){var _0x3b159c=this;return new Promise(function(_0x4d9ec8,_0x4eb972){if(_['isNil'](_0x57086e)||_['isNil'](_0x57086e[_0x5008('0xea')])||_['isNil'](_0x57086e[_0x5008('0xeb')])||_[_0x5008('0x3f')](_0x57086e[_0x5008('0xec')])){_0x4eb972(ut['message'](_0x5008('0xed'),_0x4d4a7c,_0x202fb2));return;}var _0xdbe022=uuid['v4']();var _0x328600=_0x3b159c['campaignsPreview'][_0x57086e[_0x5008('0x43')]['name']];var _0x47ab63=_0x551866?_0x3b159c[_0x5008('0x58')][_0x551866]['id']:undefined;_0x3b159c[_0x5008('0x40')][_0xdbe022]=new Action(_0x57086e,_0x328600,_0xdbe022,_0x551866,_0x47ab63);var _0x3fc26c=_0x3b159c['actions'][_0xdbe022];_0x3fc26c['unlockAgent']=_0x4d4a7c;_0x3fc26c[_0x5008('0xac')]=_0x202fb2;_0x3fc26c[_0x5008('0xee')]=_0x551866;if(_['isEmpty'](_0xb9b2b5)){_0x3b159c[_0x5008('0xef')](_0x3fc26c,_0x328600,_0x57086e,_0x551866)[_0x5008('0x59')](function(_0x4dcd6e){logger[_0x5008('0x41')](_0x5008('0xf0'),'Queue:\x20'+_0x3fc26c[_0x5008('0x44')]+_0x5008('0xf1')+_0x3fc26c[_0x5008('0x8d')],JSON['stringify'](_0x4dcd6e));ami[_0x5008('0x21')](_0x5008('0xf2'),ut[_0x5008('0x7d')](_0x3fc26c,_0x5008('0xf3'),_0x3b159c[_0x5008('0x10')][_0x3fc26c[_0x5008('0x44')]]));_0x4d9ec8(ut['message']('Calling'));})[_0x5008('0x4c')](function(_0x4b10a5){ut[_0x5008('0x30')](_0x5008('0xf4'),_0x4b10a5);_0x4eb972(ut['message'](_0x5008('0xf5'),_0x4d4a7c,_0x202fb2));});}else{_0x328600['outboundBlacklistCallsDay']+=0x1;ut[_0x5008('0xf6')](_0x3fc26c);rpcDb[_0x5008('0xf7')](_0x3fc26c,_0x5008('0xf8'));delete _0x3b159c[_0x5008('0x40')][_0xdbe022];_0x4eb972(ut[_0x5008('0x2e')]('Contact\x20in\x20black\x20List',_0x4d4a7c,_0x202fb2));}});};Preview[_0x5008('0x35')]['isTrunkReachable']=function(_0x21a9b5){return!_['isNil'](_0x21a9b5)&&!_[_0x5008('0x3f')](_0x21a9b5[_0x5008('0x26')])&&!_[_0x5008('0x3f')](_0x21a9b5[_0x5008('0xf9')])&&_0x21a9b5[_0x5008('0xf9')]&&!_['isNil'](this[_0x5008('0x11')][util['format'](_0x5008('0xfa'),_0x21a9b5[_0x5008('0x26')])])&&!_[_0x5008('0x3f')](this[_0x5008('0x11')][util[_0x5008('0x24')](_0x5008('0xfa'),_0x21a9b5[_0x5008('0x26')])][_0x5008('0xfb')])&&(this[_0x5008('0x11')][util[_0x5008('0x24')](_0x5008('0xfa'),_0x21a9b5[_0x5008('0x26')])][_0x5008('0xfb')]===_0x5008('0xfc')||this[_0x5008('0x11')][util[_0x5008('0x24')](_0x5008('0xfa'),_0x21a9b5['name'])][_0x5008('0xfb')]===_0x5008('0xfd'));};Preview[_0x5008('0x35')][_0x5008('0x60')]=function(_0x33ec76,_0x5ca716){return this['execRun'](_0x33ec76,_0x5ca716)[_0x5008('0x59')](function(_0x4d7a43){return _[_0x5008('0x48')](_0x4d7a43,['message']);})[_0x5008('0x4c')](function(_0x2c0ecf){if(_0x2c0ecf[_0x5008('0xfe')]){rpcDb[_0x5008('0xff')](_0x33ec76);}if(_0x2c0ecf[_0x5008('0xf9')]){rpcDb[_0x5008('0x100')](_0x33ec76);}throw _[_0x5008('0x48')](_0x2c0ecf,[_0x5008('0x2e')]);});};Preview['prototype'][_0x5008('0x101')]=function(_0x59fd6c,_0x21a1ae){var _0x16eecd=this;var _0xd232b,_0x645845;return rpcDb[_0x5008('0x102')](_0x59fd6c)[_0x5008('0x59')](function(_0x1ad58b){if(!_['isNil'](_0x1ad58b[0x0])){_0x645845=_0x1ad58b[0x0][_0x5008('0x103')]?![]:!![];_0xd232b=_0x1ad58b[0x0][_0x5008('0x103')]?!![]:![];_0xd232b=_0x21a1ae?!![]:_0xd232b;}var _0x6cd1d9=_0x16eecd[_0x5008('0x104')](_0x1ad58b);if(_0x6cd1d9['isValid']){rpcDb[_0x5008('0x105')](_[_0x5008('0x48')](_0x1ad58b[0x0],[_0x5008('0xec'),_0x5008('0xeb')]))[_0x5008('0x59')](function(_0x4df5c5){_0x16eecd['checkInBlack'](_0x4df5c5,_0x1ad58b[0x0],_0x21a1ae,_0x645845,_0xd232b)['then'](function(_0x4f5661){return _0x4f5661;})[_0x5008('0x4c')](function(_0x314d6f){throw _0x314d6f;});})[_0x5008('0x4c')](function(_0x51ef10){ut[_0x5008('0x30')](_0x5008('0x106'),_0x51ef10);throw ut[_0x5008('0x2e')](_0x5008('0x107'),_0x645845,_0xd232b);});}else{throw ut[_0x5008('0x2e')](_0x6cd1d9['message'],_0x645845,_0xd232b);}})[_0x5008('0x4c')](function(_0x343e64){ut[_0x5008('0x30')](_0x5008('0x108'),_0x343e64);throw ut['message'](_0x5008('0x107'),![],!![]);});};Preview[_0x5008('0x35')][_0x5008('0x104')]=function(_0x2ccc8d){if(_[_0x5008('0x3f')](_0x2ccc8d)||_[_0x5008('0x109')](_0x2ccc8d)||!_['isNil'](_0x2ccc8d[0x0][_0x5008('0x5e')])&&_[_0x5008('0x3f')](_0x2ccc8d[0x0][_0x5008('0x5e')][_0x5008('0x26')])){ut[_0x5008('0x30')](_0x5008('0x10a'),_0x2ccc8d);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x175156=this[_0x5008('0x10')][_0x2ccc8d[0x0][_0x5008('0x43')][_0x5008('0x26')]];_0x175156['message']=utils['CAMPAIGN_STATUS'][_0x5008('0x76')];if(_['isNil'](_0x175156)){ut['logger'](_0x5008('0x10b'),_0x175156);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x5008('0x72')](_0x175156[_0x5008('0x73')])){ut['logger'](_0x5008('0x10c'),'campaign\x20Name:\x20'+_0x175156[_0x5008('0x26')]+_0x5008('0x10d'));if(!this[_0x5008('0x72')](_0x175156[_0x5008('0x74')])){ut[_0x5008('0x30')](_0x5008('0x10c'),_0x175156[_0x5008('0x26')]+_0x5008('0x10e'));return{'isValid':![],'message':_0x5008('0x10f')};}}if(!ut['isActive'](_0x175156[_0x5008('0x71')])){ut[_0x5008('0x30')](_0x5008('0x110'),_0x175156[_0x5008('0x26')]+_0x5008('0x111'));return{'isValid':![],'message':_0x5008('0x112')+_0x175156['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x5008('0x113')};};Preview['prototype'][_0x5008('0xef')]=function(_0x2130d7,_0x3db6b4,_0x2a1ec8,_0x18235d){var _0x1c8d7d=this;return new Promise(function(_0x23db8f,_0x305f4f){var _0x4e3d59=_0x2130d7['uniqueid'];var _0x290b9b=_0x1c8d7d[_0x5008('0x72')](_0x3db6b4[_0x5008('0x73')])?util['format']('SIP/%s/%s%s',_0x3db6b4[_0x5008('0x73')][_0x5008('0x26')],_[_0x5008('0x3f')](_0x3db6b4[_0x5008('0x114')])?'':_0x3db6b4['dialPrefix']['trim']()||'',_0x3db6b4[_0x5008('0x115')]>0x0?_0x2a1ec8[_0x5008('0xeb')][_0x5008('0x116')](_0x3db6b4[_0x5008('0x115')]):_0x2a1ec8[_0x5008('0xeb')]):util[_0x5008('0x24')](_0x5008('0x117'),_[_0x5008('0x3f')](_0x3db6b4[_0x5008('0x74')])?_0x3db6b4[_0x5008('0x73')][_0x5008('0x26')]:_0x3db6b4['TrunkBackup'][_0x5008('0x26')],_['isNil'](_0x3db6b4[_0x5008('0x114')])?'':_0x3db6b4[_0x5008('0x114')][_0x5008('0x118')]()||'',_0x3db6b4[_0x5008('0x115')]>0x0?_0x2a1ec8['phone'][_0x5008('0x116')](_0x3db6b4['dialCutDigit']):_0x2a1ec8['phone']);var _0x27529f=_0x1c8d7d[_0x5008('0x72')](_0x3db6b4['Trunk'])?ut[_0x5008('0x119')](_0x3db6b4[_0x5008('0x73')][_0x5008('0x11a')],_0x3db6b4[_0x5008('0x11b')],_0x3db6b4['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x3db6b4[_0x5008('0x11c')],_0x3db6b4['dialRandomLastDigitCallerIdNumber']):_0x3db6b4[_0x5008('0x11c')]):ut[_0x5008('0x119')](_[_0x5008('0x3f')](_0x3db6b4['TrunkBackup'])?_0x3db6b4[_0x5008('0x73')][_0x5008('0x11a')]:_0x3db6b4[_0x5008('0x74')][_0x5008('0x11a')],_0x3db6b4['dialOriginateCallerIdName'],_0x3db6b4[_0x5008('0x11d')]>0x0?ut[_0x5008('0x11e')](_0x3db6b4[_0x5008('0x11c')],_0x3db6b4[_0x5008('0x11d')]):_0x3db6b4[_0x5008('0x11c')]);if(_0x27529f){_0x2130d7['originatecalleridname']=ut['extractCalleridName'](_0x27529f);_0x2130d7[_0x5008('0x11f')]=ut['extractCalleridNumber'](_0x27529f);}var _0x43f94b=ut[_0x5008('0x120')](_0x3db6b4,_0x2a1ec8,_0x290b9b,_0x27529f,_0x4e3d59,_0x2130d7);var _0x5476a8=utils[_0x5008('0x121')](_0x2a1ec8[_0x5008('0xea')]);Object[_0x5008('0x122')](_0x43f94b,_0x5476a8);_[_0x5008('0x123')](_0x2130d7,ut[_0x5008('0x124')](_0x43f94b));_0x2130d7['starttime']=moment()[_0x5008('0x24')](_0x5008('0x64'));_0x3db6b4[_0x5008('0x125')]=_0x43f94b;var _0x3aa8e8=ut['variablesAction'](_0x2130d7,_0x3db6b4,_0x43f94b,_0x2130d7['activeContact'],_0x18235d);return ami[_0x5008('0x126')](_0x3aa8e8)['then'](function(_0x4bcff0){_0x3db6b4[_0x5008('0x2a')]+=0x1;logger[_0x5008('0x41')](_0x5008('0x127'),_0x4e3d59,_0x5008('0xa1'),_0x3db6b4[_0x5008('0x26')],_0x5008('0x45'),_0x3db6b4['originated']);_0x23db8f(_0x4bcff0);})[_0x5008('0x4c')](function(_0x9276){ut[_0x5008('0xe2')](_0x2130d7,0xe,'OriginateError');rpcDb[_0x5008('0xe0')](_0x2130d7,'[originateFailure][logOriginateFailure]');_0x305f4f(_0x9276);});});};Preview[_0x5008('0x35')]['syncNewExten']=function(_0xbc4e0c){if(this['actions'][_0xbc4e0c[_0x5008('0x8b')]]){this['actions'][_0xbc4e0c[_0x5008('0x8b')]]['channel']=_0xbc4e0c[_0x5008('0x4b')];}};Preview[_0x5008('0x35')][_0x5008('0x13')]=function(_0x894e3f){var _0x38e4bd=this;var _0x43c62c=this[_0x5008('0x40')][_0x894e3f[_0x5008('0x128')]];if(_0x43c62c){if(_0x43c62c[_0x5008('0xee')]&&this[_0x5008('0x58')][_0x43c62c[_0x5008('0xee')]]){ut[_0x5008('0x129')](_0x43c62c,this['agents'][_0x43c62c[_0x5008('0xee')]]['name'],this['agents'][_0x43c62c[_0x5008('0xee')]]['id']);}var _0x39bc4e=_[_0x5008('0x12a')](_0x43c62c);_0x39bc4e[_0x5008('0x12b')]=moment()[_0x5008('0x24')](_0x5008('0x64'));var _0x17a737=_0x38e4bd[_0x5008('0x10')][_0x43c62c[_0x5008('0x44')]];if(ut[_0x5008('0x12c')](_0x894e3f[_0x5008('0x12d')])){if(_0x43c62c[_0x5008('0x8a')]){rpcDb[_0x5008('0xff')](_0x43c62c[_0x5008('0x8d')]);}if(_0x43c62c[_0x5008('0xac')]){rpcDb[_0x5008('0x100')](_0x43c62c['idContact']);}ami[_0x5008('0x21')]('custom:agentringnoanswer',ut['buildObj'](_0x43c62c,_0x5008('0x12e'),this[_0x5008('0x10')][_0x43c62c[_0x5008('0x44')]]));this[_0x5008('0xdc')](_0x39bc4e,_0x17a737,_0x894e3f);}else{_0x43c62c[_0x5008('0x63')]=moment()[_0x5008('0x24')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x5008('0xe2')](_0x39bc4e,0x4,'Answer');rpcDb[_0x5008('0xe0')](_0x39bc4e,_0x5008('0x12f'));}}};Preview[_0x5008('0x35')][_0x5008('0x16')]=function(_0xc927b4){var _0x1a8a76=this[_0x5008('0x40')][_0xc927b4[_0x5008('0x8b')]];var _0x522b39;if(_0x1a8a76){_0x522b39=this['campaignsPreview'][_0x1a8a76[_0x5008('0x44')]];logger[_0x5008('0x41')](_0x5008('0x130'),_0xc927b4[_0x5008('0x8b')],_0x5008('0xa1'),_0x522b39[_0x5008('0x26')],_0x5008('0x46'),_0x522b39[_0x5008('0x2b')]);}if(this[_0x5008('0x40')][_0xc927b4[_0x5008('0x8b')]]&&_0xc927b4['linkedid']!==_0xc927b4[_0x5008('0x92')]){if(_0xc927b4['cause']==='16'&&this['actions'][_0xc927b4[_0x5008('0x8b')]]['dialAnswer']){this[_0x5008('0x77')](_0xc927b4,_0xc927b4[_0x5008('0x8b')],_0xc927b4['cause']);}else if(this['actions'][_0xc927b4[_0x5008('0x8b')]][_0x5008('0x47')]){logger[_0x5008('0x41')](_0x5008('0x131'),_0xc927b4['linkedid'],_0xc927b4['cause'],_0x5008('0xa1'),_0x522b39[_0x5008('0x26')],_0x5008('0x46'),_0x522b39['pTalking']);this[_0x5008('0x77')](_0xc927b4,_0xc927b4['linkedid'],_0xc927b4[_0x5008('0x132')]);}}else if(_0x1a8a76&&_[_0x5008('0x3f')](_0x1a8a76[_0x5008('0x133')])&&_0x522b39['dialQueueProject']&&_0xc927b4[_0x5008('0x8b')]===_0xc927b4['uniqueid']&&_[_0x5008('0x3f')](_0xc927b4[_0x5008('0xdf')])&&_0xc927b4[_0x5008('0x132')]==='16'&&_0xc927b4[_0x5008('0x134')]==='6'&&_[_0x5008('0xdd')](_0x1a8a76[_0x5008('0x135')])){if(_0x1a8a76[_0x5008('0x8a')]){rpcDb[_0x5008('0xff')](_0x1a8a76[_0x5008('0x8d')]);}if(_0x1a8a76[_0x5008('0xac')]){rpcDb['disableContact'](_0x1a8a76[_0x5008('0x8d')]);}_0xc927b4['reason']='22';this[_0x5008('0xdc')](_0x1a8a76,_0x522b39,_0xc927b4);}else if(_0x1a8a76&&_0x1a8a76['transfer']){if(_0xc927b4[_0x5008('0x132')]==='16'&&this[_0x5008('0x40')][_0xc927b4[_0x5008('0x8b')]][_0x5008('0x47')]){logger[_0x5008('0x41')](_0x5008('0x136'),_0xc927b4[_0x5008('0x8b')],_0xc927b4[_0x5008('0x132')],_0x5008('0xa1'),_0x522b39[_0x5008('0x26')],_0x5008('0x46'),_0x522b39['pTalking']);this['callProgressDetectingCustomer'](_0xc927b4,_0xc927b4['linkedid'],_0xc927b4[_0x5008('0x132')]);}else if(this[_0x5008('0x40')][_0xc927b4[_0x5008('0x8b')]][_0x5008('0x47')]){logger['info'](_0x5008('0x131'),_0xc927b4[_0x5008('0x8b')],_0xc927b4['cause'],_0x5008('0xa1'),_0x522b39[_0x5008('0x26')],_0x5008('0x46'),_0x522b39[_0x5008('0x2b')]);this[_0x5008('0x77')](_0xc927b4,_0xc927b4[_0x5008('0x8b')],_0xc927b4[_0x5008('0x132')]);}}};Preview[_0x5008('0x35')][_0x5008('0x19')]=function(_0x376639){if(this['actions'][_0x376639['destlinkedid']]&&_0x376639[_0x5008('0x137')]!==_0x376639[_0x5008('0x138')]){this[_0x5008('0x77')](_0x376639,_0x376639[_0x5008('0x137')],_0x376639[_0x5008('0xd0')]);}};Preview[_0x5008('0x35')]['syncHangupRequest']=function(_0x4d73cb){if(this[_0x5008('0x40')][_0x4d73cb[_0x5008('0x8b')]]&&_0x4d73cb[_0x5008('0x8b')]!==_0x4d73cb[_0x5008('0x92')]&&!this[_0x5008('0x40')][_0x4d73cb['linkedid']][_0x5008('0x47')]){if(_0x4d73cb[_0x5008('0x132')]==='1'){this[_0x5008('0x77')](_0x4d73cb,_0x4d73cb['linkedid'],_0x4d73cb[_0x5008('0x132')]);}}};Preview['prototype'][_0x5008('0x139')]=function(_0x1bc5d0,_0x5886e7,_0x3239d9){if(this[_0x5008('0x40')][_0x1bc5d0]){if(_[_0x5008('0x3f')](this['actions'][_0x1bc5d0][_0x5008('0x125')])){this[_0x5008('0x40')][_0x1bc5d0][_0x5008('0x125')]={};}this[_0x5008('0x40')][_0x1bc5d0]['variables'][_0x5886e7]=_0x3239d9;}};Preview[_0x5008('0x35')]['syncVarSet']=function(_0x3f122f){try{if(!_[_0x5008('0x3f')](_0x3f122f)){if(ut[_0x5008('0x13a')](_['keys'](_0x3f122f[_0x5008('0x13b')])[0x0])){this[_0x5008('0x139')](_0x3f122f['uniqueid'],_['keys'](_0x3f122f[_0x5008('0x13b')])[0x0],_0x3f122f[_0x5008('0x13c')]);}}}catch(_0x47219d){logger[_0x5008('0x13d')](_0x5008('0x13e'),util[_0x5008('0x13f')](_0x47219d,{'showHidden':![],'depth':null}));}};Preview[_0x5008('0x35')]['syncAttendedTransfer']=function(_0x1e8306){if(_0x1e8306){if(this[_0x5008('0x40')][_0x1e8306['transfertargetlinkedid']]){this[_0x5008('0x40')][_0x1e8306[_0x5008('0x140')]][_0x5008('0x135')]=!![];}}};Preview[_0x5008('0x35')]['syncBlindTransfer']=function(_0x46b8e7){if(_0x46b8e7){if(this[_0x5008('0x40')][_0x46b8e7[_0x5008('0x141')]]){this[_0x5008('0x40')][_0x46b8e7[_0x5008('0x141')]][_0x5008('0x135')]=!![];}}};module[_0x5008('0x142')]=Preview; \ No newline at end of file +var _0xe5ee=['outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','catch','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','logger','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','recallme','validateContact','isValid','checkIsBlackList','phone','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','dialPrefix','trim','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','isFailure','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','originated','available','paused','CAMPAIGN_STATUS','\x20is\x20not\x20active','message','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','dialMethod','preview','outbound','type','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','run','[RecallMe]','logger2','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','loggedIn','isActive','dialActive','INACTIVE','Trunk','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','uniqueid','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','dialBusyRetryFrequency','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]'];(function(_0x2220d7,_0x804d20){var _0xe4a29f=function(_0x2e3341){while(--_0x2e3341){_0x2220d7['push'](_0x2220d7['shift']());}};_0xe4a29f(++_0x804d20);}(_0xe5ee,0x8f));var _0xee5e=function(_0x2dd839,_0x28c341){_0x2dd839=_0x2dd839-0x0;var _0x414292=_0xe5ee[_0x2dd839];return _0x414292;};'use strict';var util=require(_0xee5e('0x0'));var _=require(_0xee5e('0x1'));var uuid=require(_0xee5e('0x2'));var moment=require('moment');var Redis=require(_0xee5e('0x3'));var config=require(_0xee5e('0x4'));var logger=require(_0xee5e('0x5'))('preview');var loggerAction=require('../../../config/logger')(_0xee5e('0x6'));var ami=require(_0xee5e('0x7'));var rpcDb=require(_0xee5e('0x8'));var cmHopperAdditionalPhone=require(_0xee5e('0x9'));var Action=require(_0xee5e('0xa'));var ut=require(_0xee5e('0xb'));var utils=require(_0xee5e('0xc'));config['redis']=_['defaults'](config[_0xee5e('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xee5e('0xe'))(new Redis(config[_0xee5e('0xd')]));var Sequence=function(){};Sequence['prototype'][_0xee5e('0xf')]=function(_0xbecbc9){this[_0xee5e('0x10')]=this[_0xee5e('0x10')]?this[_0xee5e('0x10')][_0xee5e('0x11')](_0xbecbc9):_0xbecbc9();};function Preview(_0x1982d6){this[_0xee5e('0x12')]=new Sequence();this[_0xee5e('0x13')]=_0x1982d6[_0xee5e('0x14')];this['trunks']=_0x1982d6['trunks'];this['actions']={};this['agents']=_0x1982d6[_0xee5e('0x15')];this[_0xee5e('0x16')]=0x0;ami['on']('originateresponse',this[_0xee5e('0x17')][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x19'),this[_0xee5e('0x1a')][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x1b'),this[_0xee5e('0x1c')][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x1d'),this[_0xee5e('0x1e')][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x1f'),this['syncNewExten'][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x20'),this[_0xee5e('0x21')][_0xee5e('0x18')](this));ami['on'](_0xee5e('0x22'),this['syncAttendedTransfer'][_0xee5e('0x18')](this));ami['on']('blindtransfer',this[_0xee5e('0x23')]['bind'](this));this[_0xee5e('0x24')](this[_0xee5e('0x13')]);}function emit(_0x1c173d,_0x213f07,_0x522dc1){io['to'](_0x1c173d)[_0xee5e('0x25')](_0x213f07,_0x522dc1);}function emitVoiceQueueChannelRemove(_0x2e6050){logger[_0xee5e('0x26')](_0xee5e('0x27'),JSON[_0xee5e('0x28')](_0x2e6050));emit(util['format'](_0xee5e('0x29'),_0x2e6050[_0xee5e('0x2a')]),_0xee5e('0x2b'),_0x2e6050);io['emit']('voice_queue_presence:remove',_0x2e6050);}function notSendMessagesQueue(_0x1a7c0c){if(_0x1a7c0c[_0xee5e('0x2c')]){if(_0x1a7c0c[_0xee5e('0x2d')]===0x0&&_0x1a7c0c['pTalking']===0x0){_0x1a7c0c[_0xee5e('0x2c')]=![];_0x1a7c0c[_0xee5e('0x2e')]=0x0;_0x1a7c0c[_0xee5e('0x2f')]=0x0;_0x1a7c0c['message']=utils[_0xee5e('0x30')]['INACTIVE'];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1a7c0c[_0xee5e('0x2a')]+_0xee5e('0x31'));}else{_0x1a7c0c[_0xee5e('0x32')]=utils['CAMPAIGN_STATUS']['DEACTIVATED'];ut['logger'](_0xee5e('0x33'),_0x1a7c0c[_0xee5e('0x2a')]+'\x20is\x20deactivated');}}}Preview[_0xee5e('0x34')]['loopCampaigns']=function(){var _0x1b81ed=this;setInterval(function(){_0x1b81ed[_0xee5e('0x35')]();},0x7cf);};Preview[_0xee5e('0x34')][_0xee5e('0x35')]=function(){var _0x167bcb=this[_0xee5e('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x21526a in _0x167bcb){if(_0x167bcb[_0xee5e('0x36')](_0x21526a)&&(_0x167bcb[_0x21526a][_0xee5e('0x37')]===_0xee5e('0x38')||_0x167bcb[_0x21526a][_0xee5e('0x37')]==='booked')&&_0x167bcb[_0x21526a]['type']===_0xee5e('0x39')){if(this['clockClearZombieChannels']>0x7){this[_0xee5e('0x16')]=0x0;this['clearZombieChannels']();}}if(_0x167bcb['hasOwnProperty'](_0x21526a)&&_0x167bcb[_0x21526a]['dialMethod']===_0xee5e('0x38')&&_0x167bcb[_0x21526a][_0xee5e('0x3a')]===_0xee5e('0x39')){if(_0x167bcb[_0x21526a]['dialActive']){this['setMessage'](_0x167bcb[_0x21526a]);if(_0x167bcb[_0x21526a]['dialPreviewAutoRecallMe'])this[_0xee5e('0x3b')](_0x167bcb[_0x21526a]);}else{notSendMessagesQueue(_0x167bcb[_0x21526a]);}}}};Preview[_0xee5e('0x34')][_0xee5e('0x3c')]=function(_0x48a8cf){var _0x45a78e=this;this[_0xee5e('0x12')][_0xee5e('0xf')](function(){if(!_[_0xee5e('0x3d')](_0x45a78e[_0xee5e('0x3e')][_0x48a8cf])){loggerAction[_0xee5e('0x26')](_0xee5e('0x3f'),_0x48a8cf,_0xee5e('0x40'),_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')],_0xee5e('0x42'),JSON[_0xee5e('0x28')](_0x45a78e['campaignsPreview'][_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')]]['originated']),_0xee5e('0x43'),JSON[_0xee5e('0x28')](_0x45a78e['campaignsPreview'][_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')]]['pTalking']),JSON['stringify'](_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x44')]),JSON[_0xee5e('0x28')](_[_0xee5e('0x45')](_0x45a78e[_0xee5e('0x3e')][_0x48a8cf],[_0xee5e('0x46'),_0xee5e('0x47'),_0xee5e('0x48'),_0xee5e('0x49')])));return ami[_0xee5e('0x4a')]({'action':_0xee5e('0x4b'),'channel':_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x4c')]})['catch'](function(_0x27262c){if(_0x27262c[_0xee5e('0x32')]===_0xee5e('0x4d')){setTimeout(function(){if(_0x45a78e['actions'][_0x48a8cf]){ut['updateOriginated'](_0x45a78e['campaignsPreview'][_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')]],'[clearZombieChannel]');if(_0x45a78e[_0xee5e('0x3e')][_0x48a8cf]['dialAnswer']===!![]){ut[_0xee5e('0x4e')](_0x45a78e['campaignsPreview'][_0x45a78e['actions'][_0x48a8cf][_0xee5e('0x41')]],'[clearZombieChannel]');ut[_0xee5e('0x4f')]('[Dialer][checkChannel][pTalking][Preview]'+_0x48a8cf,_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')]);}ut[_0xee5e('0x4f')](_0xee5e('0x50')+_0x48a8cf,_0x45a78e[_0xee5e('0x3e')][_0x48a8cf][_0xee5e('0x41')]);delete _0x45a78e[_0xee5e('0x3e')][_0x48a8cf];}},0x2328);}});}});};Preview[_0xee5e('0x34')]['clearZombieChannels']=function(){var _0x44782e=this;loggerAction['info'](_0xee5e('0x51'),_[_0xee5e('0x52')](this[_0xee5e('0x3e')]));for(var _0x3a6e7c in this[_0xee5e('0x3e')]){if(_0x44782e[_0xee5e('0x3e')]['hasOwnProperty'](_0x3a6e7c)){_0x44782e[_0xee5e('0x3c')](_0x3a6e7c);}}};Preview[_0xee5e('0x34')][_0xee5e('0x3b')]=function(_0x3c876b){var _0x1cb5cf=this;rpcDb[_0xee5e('0x53')](_0x3c876b['id'],ut[_0xee5e('0x54')](this[_0xee5e('0x15')]))[_0xee5e('0x55')](function(_0xb55b35){if(!_[_0xee5e('0x3d')](_0xb55b35)){for(var _0x35bdce=0x0;_0x35bdce<_0xb55b35[_0xee5e('0x56')];_0x35bdce+=0x1){if(ut[_0xee5e('0x57')](_0xb55b35[_0x35bdce][_0xee5e('0x58')])<_0x3c876b['dialRecallMeTimeout']*0x3c){if(_0xb55b35[_0x35bdce][_0xee5e('0x59')]&&!_0xb55b35[_0x35bdce]['Agent']['voicePause']){_0x1cb5cf[_0xee5e('0x5a')](_0xb55b35[_0x35bdce]['id'])[_0xee5e('0x55')](ut['logger2'](_0xee5e('0x5b')))['catch'](ut[_0xee5e('0x5c')](_0xee5e('0x5b')));}else{rpcDb[_0xee5e('0x5d')](_0xb55b35[_0x35bdce]['id']);}}else{var _0x2c551d=new Action(_0xb55b35[_0x35bdce],_0x3c876b);_0x2c551d[_0xee5e('0x5e')]=moment()[_0xee5e('0x5f')](_0xee5e('0x60'));_0x3c876b[_0xee5e('0x61')]+=0x1;ut[_0xee5e('0x62')](_0x2c551d,0x17,_0xee5e('0x63'));if(_0x3c876b[_0xee5e('0x64')]){rpcDb[_0xee5e('0x65')](ut[_0xee5e('0x66')](_0xb55b35[_0x35bdce]));rpcDb['createCustomerHistory'](_0x2c551d,_0xee5e('0x67'));}else{ut[_0xee5e('0x62')](_0x2c551d,0x16,_0xee5e('0x68'));rpcDb[_0xee5e('0x69')](_0x2c551d,'[HistoryRecallClose]');rpcDb[_0xee5e('0x6a')](_0x2c551d,_0xee5e('0x6b'));}}}}})['catch'](ut[_0xee5e('0x5c')](_0xee5e('0x6c')));};Preview[_0xee5e('0x34')][_0xee5e('0x6d')]=function(_0x20d13d){_0x20d13d[_0xee5e('0x2c')]=!![];if(ut['IsNotLoggedIn'](_0x20d13d[_0xee5e('0x6e')])){_0x20d13d['message']=utils[_0xee5e('0x30')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xee5e('0x6f')](_0x20d13d[_0xee5e('0x70')])){_0x20d13d[_0xee5e('0x32')]=utils[_0xee5e('0x30')][_0xee5e('0x71')];}else if(!this['isTrunkReachable'](_0x20d13d[_0xee5e('0x72')])){if(!this[_0xee5e('0x73')](_0x20d13d[_0xee5e('0x74')])){_0x20d13d['message']=utils[_0xee5e('0x30')][_0xee5e('0x75')];}else{_0x20d13d[_0xee5e('0x32')]=utils['CAMPAIGN_STATUS'][_0xee5e('0x76')];}}else{_0x20d13d[_0xee5e('0x32')]=utils['CAMPAIGN_STATUS'][_0xee5e('0x76')];}};Preview[_0xee5e('0x34')][_0xee5e('0x77')]=function(_0x5688e5,_0x91a243,_0x2b32c7){var _0x17e244=this;var _0x15addd=this[_0xee5e('0x3e')][_0x91a243];var _0x3f872e=this[_0xee5e('0x13')][_0x15addd['queue']];var _0x2015df;var _0x2f2646=![];var _0x401311=0x2;var _0x44377d=0x3;if(_0x3f872e){switch(_0x2b32c7){case'1':_0x3f872e[_0xee5e('0x78')]+=0x1;_0x15addd[_0xee5e('0x79')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x0,_0xee5e('0x7c'));ami[_0xee5e('0x25')](_0xee5e('0x7d'),ut[_0xee5e('0x7e')](_0x15addd,_0xee5e('0x7f')));rpcDb[_0xee5e('0x69')](_0x15addd,_0xee5e('0x80'));_0x17e244[_0xee5e('0x81')](_0x15addd,'0',_0x3f872e)['then'](function(_0x291a78){_0x2f2646=_0x291a78[_0xee5e('0x82')]==0x1;_0x401311=_0x3f872e['dialNoSuchNumberRetryFrequency'];_0x44377d=_0x3f872e[_0xee5e('0x83')];if(!_0x2f2646){if(ut[_0xee5e('0x7b')](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0xf,_0xee5e('0x86'));rpcDb[_0xee5e('0x6a')](_0x2015df,_0xee5e('0x87'));}else{if(_0x15addd[_0xee5e('0x79')]>=_0x3f872e[_0xee5e('0x88')]){rpcDb[_0xee5e('0x6a')](_0x15addd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xee5e('0x89')](ut[_0xee5e('0x8a')](_0x15addd,_0xee5e('0x79'),_0x3f872e['dialNoSuchNumberRetryFrequency']),_0x15addd[_0xee5e('0x8b')],_0x15addd[_0xee5e('0x8c')]);}}delete this['actions'][_0x5688e5['linkedid']];}else{_0x15addd[_0xee5e('0x79')]++;logger[_0xee5e('0x26')](_0xee5e('0x8d'),_0x15addd[_0xee5e('0x79')]);logger['info']('id',_0x15addd[_0xee5e('0x8e')]);_0x17e244['incrementPreviewCounters']({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnosuchnumberretry':_0x15addd[_0xee5e('0x79')]}})[_0xee5e('0x55')](function(){_0x17e244[_0xee5e('0x8f')](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});});}});break;case _0xee5e('0x90'):var _0x2f2148=moment()['format'](_0xee5e('0x60'));_0x15addd[_0xee5e('0x91')]=_0x2f2148;_0x15addd[_0xee5e('0x92')]=_0x2f2148;_0x15addd[_0xee5e('0x44')]=!![];_0x3f872e[_0xee5e('0x93')]+=0x1;logger[_0xee5e('0x26')](_0xee5e('0x94'),_0x15addd['uniqueid'],_0xee5e('0x95'),_0x3f872e[_0xee5e('0x2a')],_0xee5e('0x43'),_0x3f872e[_0xee5e('0x93')]);ami['emit'](_0xee5e('0x96'),ut['buildObj'](_0x15addd,_0xee5e('0x97'),this[_0xee5e('0x13')][_0x15addd[_0xee5e('0x41')]]));if(_0x3f872e['acw']){ami[_0xee5e('0x25')]('custom:agentConnectPreview',ut[_0xee5e('0x98')](_0x15addd));}break;case'16':ami['emit'](_0xee5e('0x99'),ut[_0xee5e('0x7e')](_0x15addd,'complete',this[_0xee5e('0x13')][_0x15addd[_0xee5e('0x41')]]));emitVoiceQueueChannelRemove(ut[_0xee5e('0x7e')](_0x15addd,_0xee5e('0x9a')));_0x3f872e[_0xee5e('0x9b')]+=0x1;_0x3f872e['total']+=0x1;_0x3f872e[_0xee5e('0x9c')]+=0x1;ut[_0xee5e('0x4e')](_0x3f872e,_0xee5e('0x9d'));_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut['logCustomer'](_0x15addd,0x4,_0xee5e('0x9e'));rpcDb[_0xee5e('0x69')](_0x15addd,_0xee5e('0x9f'));rpcDb[_0xee5e('0x6a')](_0x15addd,_0xee5e('0xa0'));rpcDb['crateCustomerReportQueue'](_0x15addd);_0x3f872e[_0xee5e('0xa1')]+=_0x15addd[_0xee5e('0xa2')];_0x3f872e[_0xee5e('0xa3')]+=_0x15addd['talktime'];logger[_0xee5e('0x26')]('[syncHangup][talking][decrement]',_0x15addd[_0xee5e('0xa4')],_0xee5e('0x95'),_0x3f872e[_0xee5e('0x2a')],_0xee5e('0x43'),_0x3f872e[_0xee5e('0x93')]);delete this['actions'][_0x5688e5[_0xee5e('0xa5')]];break;case _0xee5e('0xa6'):_0x3f872e[_0xee5e('0xa7')]+=0x1;_0x15addd[_0xee5e('0xa8')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut['totalGlobal'](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x5,_0xee5e('0xa9'));_0x401311=_0x3f872e['dialBusyRetryFrequency'];_0x44377d=_0x3f872e[_0xee5e('0x83')];ami[_0xee5e('0x25')](_0xee5e('0xaa'),ut[_0xee5e('0x7e')](_0x15addd,'busy'));rpcDb['createCustomerHistory'](_0x15addd,_0xee5e('0xab'));_0x17e244[_0xee5e('0x81')](_0x15addd,'5',_0x3f872e)[_0xee5e('0x55')](function(_0x20ea45){_0x2f2646=_0x20ea45['additional']==0x1;if(!_0x2f2646){if(ut['totalGlobal'](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut['cloneAction'](_0x15addd,0xf,_0xee5e('0x86'));rpcDb[_0xee5e('0x6a')](_0x2015df,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x15addd[_0xee5e('0xa8')]>=_0x3f872e[_0xee5e('0xac')]){rpcDb[_0xee5e('0x6a')](_0x15addd,_0xee5e('0xab'));}else{rpcDb[_0xee5e('0x89')](ut[_0xee5e('0x8a')](_0x15addd,_0xee5e('0xa8'),_0x3f872e[_0xee5e('0xad')]),_0x15addd['unlockAgent'],_0x15addd['activeContact']);}}}else{_0x15addd[_0xee5e('0xa8')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countbusyretry':_0x15addd[_0xee5e('0xa8')]}})[_0xee5e('0x55')](function(){_0x17e244[_0xee5e('0x8f')](_0x15addd,_0x401311,_0x44377d)['then'](function(){});});}});break;case _0xee5e('0xaf'):_0x3f872e[_0xee5e('0xb0')]+=0x1;_0x15addd[_0xee5e('0xb1')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x3,'NoAnswer');_0x401311=_0x3f872e['dialNoAnswerRetryFrequency'];_0x44377d=_0x3f872e[_0xee5e('0x83')];var _0x133d8e=ut['buildNoAnswerEventPayload'](_0x15addd,_0x3f872e);ami[_0xee5e('0x25')]('custom:agentnoanswer',_0x133d8e);rpcDb[_0xee5e('0x69')](_0x15addd,'[callProgressDetectingCustomer][logNoAnswer]');_0x17e244[_0xee5e('0x81')](_0x15addd,'3',_0x3f872e)[_0xee5e('0x55')](function(_0x1f011d){_0x2f2646=_0x1f011d[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut[_0xee5e('0x7b')](_0x15addd)>=_0x3f872e['dialGlobalMaxRetry']){_0x2015df=ut['cloneAction'](_0x15addd,0xf,_0xee5e('0x86'));rpcDb['createCustomerFinal'](_0x2015df,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x15addd[_0xee5e('0xb1')]>=_0x3f872e[_0xee5e('0xb2')]){rpcDb[_0xee5e('0x6a')](_0x15addd,_0xee5e('0xb3'));}else{rpcDb[_0xee5e('0x89')](ut['scheduledAt'](_0x15addd,'countnoanswerretry',_0x3f872e['dialNoAnswerRetryFrequency']),_0x15addd[_0xee5e('0x8b')],_0x15addd[_0xee5e('0x8c')]);}}}else{_0x15addd[_0xee5e('0xb1')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnoanswerretry':_0x15addd[_0xee5e('0xb1')]}})[_0xee5e('0x55')](function(){_0x17e244['swapAdditionalPhones'](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});});}});break;case'CONGESTION':_0x3f872e[_0xee5e('0xb4')]+=0x1;_0x15addd[_0xee5e('0xb5')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x8,_0xee5e('0xb6'));_0x401311=_0x3f872e[_0xee5e('0xb7')];_0x44377d=_0x3f872e[_0xee5e('0x83')];ami[_0xee5e('0x25')]('custom:agentcongestion',ut[_0xee5e('0x7e')](_0x15addd,_0xee5e('0xb8')));rpcDb['createCustomerHistory'](_0x15addd,_0xee5e('0xb9'));_0x17e244[_0xee5e('0x81')](_0x15addd,'8',_0x3f872e)[_0xee5e('0x55')](function(_0x1039f5){_0x2f2646=_0x1039f5[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut['totalGlobal'](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0xf,'Global');rpcDb[_0xee5e('0x6a')](_0x2015df,_0xee5e('0xba'));}else{if(_0x15addd[_0xee5e('0xb5')]>=_0x3f872e[_0xee5e('0xbb')]){rpcDb[_0xee5e('0x6a')](_0x15addd,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xee5e('0x89')](ut[_0xee5e('0x8a')](_0x15addd,_0xee5e('0xb5'),_0x3f872e['dialBusyRetryFrequency']),_0x15addd['unlockAgent'],_0x15addd[_0xee5e('0x8c')]);}}}else{_0x15addd['countcongestionretry']++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd['idContact'],'field':{'countcongestionretry':_0x15addd['countcongestionretry']}})[_0xee5e('0x55')](function(){_0x17e244[_0xee5e('0x8f')](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});});}});break;case'CANCEL':_0x3f872e[_0xee5e('0xbc')]+=0x1;_0x15addd[_0xee5e('0xbd')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x14,_0xee5e('0xbe'));_0x401311=_0x3f872e['dialAgentRejectRetryFrequency'];_0x44377d=_0x3f872e[_0xee5e('0x83')];ami[_0xee5e('0x25')](_0xee5e('0xbf'),ut['buildObj'](_0x15addd,'agentreject'));rpcDb['createCustomerHistory'](_0x15addd,_0xee5e('0xc0'));_0x17e244['verifyAdditionalPhones'](_0x15addd,'20',_0x3f872e)[_0xee5e('0x55')](function(_0x57a4fd){_0x2f2646=_0x57a4fd[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut['totalGlobal'](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0x14,_0xee5e('0xbe'));rpcDb[_0xee5e('0x6a')](_0x2015df,_0xee5e('0xc1'));}else{if(_0x15addd[_0xee5e('0xbd')]>=_0x3f872e[_0xee5e('0xc2')]){rpcDb[_0xee5e('0x6a')](_0x15addd,_0xee5e('0xc1'));}else{rpcDb['rescheduleContact'](ut[_0xee5e('0x8a')](_0x15addd,_0xee5e('0xbd'),_0x3f872e[_0xee5e('0xc3')]),_0x15addd[_0xee5e('0x8b')],_0x15addd[_0xee5e('0x8c')]);}}}else{_0x15addd[_0xee5e('0xb1')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnoanswerretry':_0x15addd[_0xee5e('0xb1')]}})['then'](function(){_0x17e244['swapAdditionalPhones'](_0x15addd,_0x401311,_0x44377d)['then'](function(){});});}});break;case _0xee5e('0xc4'):_0x3f872e[_0xee5e('0xc5')]+=0x1;_0x15addd[_0xee5e('0xc6')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x15addd,_0xee5e('0xc7'));_0x17e244['verifyAdditionalPhones'](_0x15addd,'11',_0x3f872e)[_0xee5e('0x55')](function(_0x168ee2){_0x2f2646=_0x168ee2[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut[_0xee5e('0x7b')](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0xf,_0xee5e('0x86'));rpcDb[_0xee5e('0x6a')](_0x2015df,_0xee5e('0xc7'));}else{if(_0x15addd[_0xee5e('0xc8')]>=_0x3f872e[_0xee5e('0xc9')]){rpcDb['createCustomerFinal'](_0x15addd,_0xee5e('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0xee5e('0x8a')](_0x15addd,_0xee5e('0xc6'),_0x3f872e[_0xee5e('0xca')]),_0x15addd[_0xee5e('0x8b')],_0x15addd['activeContact']);}}}else{_0x15addd[_0xee5e('0xb1')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnoanswerretry':_0x15addd['countnoanswerretry']}})[_0xee5e('0x55')](function(){_0x17e244[_0xee5e('0x8f')](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});});}});break;case'18':_0x3f872e['outboundUnknownCallsDay']+=0x1;_0x15addd[_0xee5e('0xcb')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x12,_0x5688e5[_0xee5e('0xcc')]||_0x5688e5[_0xee5e('0xcd')]);ami[_0xee5e('0x25')](_0xee5e('0xce'),ut[_0xee5e('0x7e')](_0x15addd,_0xee5e('0xcf')));rpcDb['createCustomerHistory'](_0x15addd,_0xee5e('0xd0'));_0x17e244[_0xee5e('0x81')](_0x15addd,'18',_0x3f872e)[_0xee5e('0x55')](function(_0x43973a){_0x2f2646=_0x43973a[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut[_0xee5e('0x7b')](_0x15addd)>=_0x3f872e['dialGlobalMaxRetry']){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0x12,_0xee5e('0x86'));rpcDb[_0xee5e('0x6a')](_0x2015df,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xee5e('0x6a')](_0x15addd,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x15addd[_0xee5e('0xb1')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnoanswerretry':_0x15addd[_0xee5e('0xb1')]}})['then'](function(){_0x17e244['swapAdditionalPhones'](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});});}});delete this[_0xee5e('0x3e')][_0x5688e5[_0xee5e('0xa5')]];break;case'19':_0x3f872e[_0xee5e('0xd1')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut[_0xee5e('0x7b')](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0x13,_0x5688e5['cause-txt']||_0x5688e5[_0xee5e('0xcd')]);ami[_0xee5e('0x25')]('custom:amd',ut[_0xee5e('0x7e')](_0x15addd,_0xee5e('0xcf')));rpcDb[_0xee5e('0x69')](_0x15addd,'[callProgressDetectingCustomer][machine]');_0x17e244[_0xee5e('0x81')](_0x15addd,'18',_0x3f872e)[_0xee5e('0x55')](function(_0x5396c3){_0x2f2646=_0x5396c3[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut['totalGlobal'](_0x15addd)>=_0x3f872e[_0xee5e('0x84')]){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0xf,_0xee5e('0x86'));rpcDb[_0xee5e('0x6a')](_0x2015df,_0xee5e('0xd2'));}else{rpcDb['createCustomerFinal'](_0x15addd,_0xee5e('0xd2'));}}else{_0x15addd[_0xee5e('0xb1')]++;_0x17e244[_0xee5e('0xae')]({'id':_0x15addd[_0xee5e('0x8e')],'field':{'countnoanswerretry':_0x15addd[_0xee5e('0xb1')]}})[_0xee5e('0x55')](function(){_0x17e244['swapAdditionalPhones'](_0x15addd,_0x401311,_0x44377d)['then'](function(){});});}});delete this[_0xee5e('0x3e')][_0x5688e5[_0xee5e('0xa5')]];break;default:if(_0x15addd[_0xee5e('0x44')]){ut[_0xee5e('0x4e')](_0x3f872e,_0xee5e('0xd3'));ut[_0xee5e('0x4f')](_0xee5e('0xd4')+_0x3f872e[_0xee5e('0x2a')],_0x5688e5);}_0x3f872e[_0xee5e('0xd1')]+=0x1;_0x15addd[_0xee5e('0x7a')]=ut['totalGlobal'](_0x15addd);ut[_0xee5e('0x62')](_0x15addd,0xc,_0x5688e5[_0xee5e('0xcc')]||_0x5688e5['dialstatus']);_0x401311=_0x3f872e['dialAgentRejectRetryFrequency'];_0x44377d=_0x3f872e['callAdditionalPhoneAfterMin'];rpcDb[_0xee5e('0x69')](_0x15addd,'[callProgressDetectingCustomer][logUnknown]');_0x17e244[_0xee5e('0x81')](_0x15addd,'20',_0x3f872e)[_0xee5e('0x55')](function(_0x1f10fb){_0x2f2646=_0x1f10fb[_0xee5e('0x82')]==0x1;if(!_0x2f2646){if(ut['totalGlobal'](_0x15addd)>=_0x3f872e['dialGlobalMaxRetry']){_0x2015df=ut[_0xee5e('0x85')](_0x15addd,0xf,_0xee5e('0x86'));rpcDb['createCustomerFinal'](_0x2015df,_0xee5e('0xd5'));}else{rpcDb[_0xee5e('0x6a')](_0x15addd,_0xee5e('0xd5'));}delete this[_0xee5e('0x3e')][_0x5688e5[_0xee5e('0xa5')]];}else{_0x17e244[_0xee5e('0x8f')](_0x15addd,_0x401311,_0x44377d)[_0xee5e('0x55')](function(){});}});}if(!(_0x15addd[_0xee5e('0x44')]&&_0x2b32c7==='16')){ut['updateOriginated'](_0x3f872e,_0xee5e('0xd6'));logger['info'](_0xee5e('0xd7'),_0x15addd[_0xee5e('0xa4')],_0xee5e('0x95'),_0x3f872e[_0xee5e('0x2a')],_0xee5e('0x42'),_0x3f872e[_0xee5e('0x2d')]);}if(_0x2b32c7!==_0xee5e('0x90')){delete this[_0xee5e('0x3e')][_0x5688e5['linkedid']];delete this[_0xee5e('0x3e')][_0x5688e5[_0xee5e('0xd8')]];}_0x3f872e['queueSummaryCountersUpdated']=!![];}};Preview['prototype'][_0xee5e('0xd9')]=function(_0x1b4092,_0x261956,_0x3cd111){if(_[_0xee5e('0xda')](_0x261956)&&_0xee5e('0xdb')!==typeof _0x261956){return;}if(_['isUndefined'](_0x3cd111)&&_0xee5e('0xdb')!==typeof _0x3cd111){return;}switch(_0x3cd111[_0xee5e('0xdc')]){case'0':ut[_0xee5e('0xdd')](_0x1b4092,0x0,'NoSuchNumber');rpcDb[_0xee5e('0xde')](_0x1b4092,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xee5e('0xdd')](_0x1b4092,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x1b4092,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xee5e('0xdd')](_0x1b4092,0x5,'Busy');rpcDb[_0xee5e('0xde')](_0x1b4092,_0xee5e('0xdf'));break;case'8':ut[_0xee5e('0xdd')](_0x1b4092,0x8,'Congestion');rpcDb[_0xee5e('0xde')](_0x1b4092,_0xee5e('0xe0'));break;case'22':ut[_0xee5e('0xdd')](_0x1b4092,0x16,_0xee5e('0xe1'));rpcDb['createAgentHistory'](_0x1b4092,_0xee5e('0xe2'));break;default:ut[_0xee5e('0xdd')](_0x1b4092,0xc,_0x3cd111[_0xee5e('0xdc')]);rpcDb[_0xee5e('0xde')](_0x1b4092,_0xee5e('0xe0'));}ut[_0xee5e('0xe3')](_0x261956,_0xee5e('0xe4'));logger[_0xee5e('0x26')](_0xee5e('0xe5'),_0x1b4092[_0xee5e('0xa4')],_0xee5e('0x95'),_0x261956[_0xee5e('0x2a')],_0xee5e('0x42'),_0x261956[_0xee5e('0x2d')]);delete this[_0xee5e('0x3e')][_0x1b4092['uniqueid']];};Preview['prototype']['verifyAdditionalPhones']=function(_0xc16610,_0x61562e,_0x1195d9){return cmHopperAdditionalPhone[_0xee5e('0x81')](_0xc16610,_0x61562e,_0x1195d9)[_0xee5e('0xe6')](logger[_0xee5e('0x26')](_0xee5e('0xe7')));};Preview[_0xee5e('0x34')][_0xee5e('0x8f')]=function(_0x5c0454,_0x199954,_0x5a2991){return cmHopperAdditionalPhone[_0xee5e('0x8f')](_0x5c0454,_0x199954,_0x5a2991)['catch'](logger[_0xee5e('0x26')](_0xee5e('0xe8')));};Preview[_0xee5e('0x34')]['incrementPreviewCounters']=function(_0x3ef96e){return Promise[_0xee5e('0xe9')]()[_0xee5e('0x55')](cmHopperAdditionalPhone[_0xee5e('0xae')](_0x3ef96e))[_0xee5e('0xe6')](logger[_0xee5e('0x26')](_0xee5e('0xea')));};Preview[_0xee5e('0x34')][_0xee5e('0xeb')]=function(_0x51b36f,_0x2453a6,_0x2ae30c,_0x1a74c2,_0x513007){var _0x280f2e=this;return new Promise(function(_0x37db13,_0x4f4870){if(_[_0xee5e('0x3d')](_0x2453a6)||_['isNil'](_0x2453a6[_0xee5e('0xec')])||_[_0xee5e('0x3d')](_0x2453a6['phone'])||_[_0xee5e('0x3d')](_0x2453a6[_0xee5e('0x48')])){_0x4f4870(ut[_0xee5e('0x32')]('Contact\x20is\x20undefined',_0x1a74c2,_0x513007));return;}var _0x2ec47b=uuid['v4']();var _0x444f00=_0x280f2e[_0xee5e('0x13')][_0x2453a6[_0xee5e('0x40')][_0xee5e('0x2a')]];var _0x3b9c16=_0x2ae30c?_0x280f2e[_0xee5e('0x15')][_0x2ae30c]['id']:undefined;_0x280f2e[_0xee5e('0x3e')][_0x2ec47b]=new Action(_0x2453a6,_0x444f00,_0x2ec47b,_0x2ae30c,_0x3b9c16);var _0x537971=_0x280f2e['actions'][_0x2ec47b];_0x537971['unlockAgent']=_0x1a74c2;_0x537971[_0xee5e('0x8c')]=_0x513007;_0x537971[_0xee5e('0xed')]=_0x2ae30c;if(_[_0xee5e('0xee')](_0x51b36f)){_0x280f2e[_0xee5e('0xef')](_0x537971,_0x444f00,_0x2453a6,_0x2ae30c)[_0xee5e('0x55')](function(_0x30a47b){logger[_0xee5e('0x26')]('[Preview][execCall][success]',_0xee5e('0xf0')+_0x537971[_0xee5e('0x41')]+_0xee5e('0xf1')+_0x537971[_0xee5e('0x8e')],JSON['stringify'](_0x30a47b));ami[_0xee5e('0x25')](_0xee5e('0xf2'),ut['buildObj'](_0x537971,'called',_0x280f2e[_0xee5e('0x13')][_0x537971[_0xee5e('0x41')]]));_0x37db13(ut[_0xee5e('0x32')](_0xee5e('0xf3')));})[_0xee5e('0xe6')](function(_0x34eeea){ut[_0xee5e('0xf4')](_0xee5e('0xf5'),_0x34eeea);_0x4f4870(ut[_0xee5e('0x32')](_0xee5e('0xf6'),_0x1a74c2,_0x513007));});}else{_0x444f00[_0xee5e('0xf7')]+=0x1;ut[_0xee5e('0xf8')](_0x537971);rpcDb[_0xee5e('0xf9')](_0x537971,_0xee5e('0xfa'));delete _0x280f2e[_0xee5e('0x3e')][_0x2ec47b];_0x4f4870(ut[_0xee5e('0x32')](_0xee5e('0xfb'),_0x1a74c2,_0x513007));}});};Preview[_0xee5e('0x34')][_0xee5e('0x73')]=function(_0x1a69ba){return!_[_0xee5e('0x3d')](_0x1a69ba)&&!_[_0xee5e('0x3d')](_0x1a69ba[_0xee5e('0x2a')])&&!_[_0xee5e('0x3d')](_0x1a69ba[_0xee5e('0xfc')])&&_0x1a69ba[_0xee5e('0xfc')]&&!_[_0xee5e('0x3d')](this[_0xee5e('0xfd')][util['format'](_0xee5e('0xfe'),_0x1a69ba['name'])])&&!_[_0xee5e('0x3d')](this['trunks'][util[_0xee5e('0x5f')]('SIP/%s',_0x1a69ba[_0xee5e('0x2a')])][_0xee5e('0x4b')])&&(this[_0xee5e('0xfd')][util[_0xee5e('0x5f')](_0xee5e('0xfe'),_0x1a69ba['name'])][_0xee5e('0x4b')]===_0xee5e('0xff')||this['trunks'][util[_0xee5e('0x5f')](_0xee5e('0xfe'),_0x1a69ba['name'])][_0xee5e('0x4b')]===_0xee5e('0x100'));};Preview['prototype'][_0xee5e('0x5a')]=function(_0x5b23aa,_0x58684c){return this[_0xee5e('0x101')](_0x5b23aa,_0x58684c)[_0xee5e('0x55')](function(_0x10902f){return _[_0xee5e('0x45')](_0x10902f,['message']);})[_0xee5e('0xe6')](function(_0x107b97){if(_0x107b97[_0xee5e('0x102')]){rpcDb['unlockContact'](_0x5b23aa);}if(_0x107b97[_0xee5e('0xfc')]){rpcDb[_0xee5e('0x5d')](_0x5b23aa);}throw _[_0xee5e('0x45')](_0x107b97,['message']);});};Preview[_0xee5e('0x34')][_0xee5e('0x101')]=function(_0x1accc5,_0x552841){var _0x416735=this;var _0x40ac48,_0x66c45;return rpcDb['getContactPreview'](_0x1accc5)[_0xee5e('0x55')](function(_0x14b77f){if(!_[_0xee5e('0x3d')](_0x14b77f[0x0])){_0x66c45=_0x14b77f[0x0][_0xee5e('0x103')]?![]:!![];_0x40ac48=_0x14b77f[0x0][_0xee5e('0x103')]?!![]:![];_0x40ac48=_0x552841?!![]:_0x40ac48;}var _0x1413cd=_0x416735[_0xee5e('0x104')](_0x14b77f);if(_0x1413cd[_0xee5e('0x105')]){rpcDb[_0xee5e('0x106')](_[_0xee5e('0x45')](_0x14b77f[0x0],[_0xee5e('0x48'),_0xee5e('0x107')]))['then'](function(_0xcd5a6b){_0x416735[_0xee5e('0xeb')](_0xcd5a6b,_0x14b77f[0x0],_0x552841,_0x66c45,_0x40ac48)['then'](function(_0x4faa53){return _0x4faa53;})['catch'](function(_0x490f1e){throw _0x490f1e;});})[_0xee5e('0xe6')](function(_0x30bf08){ut['logger']('[Preview][checkIsBlackList]',_0x30bf08);throw ut['message'](_0xee5e('0x108'),_0x66c45,_0x40ac48);});}else{throw ut[_0xee5e('0x32')](_0x1413cd[_0xee5e('0x32')],_0x66c45,_0x40ac48);}})[_0xee5e('0xe6')](function(_0x4d2dfe){ut[_0xee5e('0xf4')]('[Preview][getContactPreview]',_0x4d2dfe);throw ut['message'](_0xee5e('0x108'),![],!![]);});};Preview['prototype'][_0xee5e('0x104')]=function(_0x543eaf){if(_[_0xee5e('0x3d')](_0x543eaf)||_[_0xee5e('0xee')](_0x543eaf)||!_[_0xee5e('0x3d')](_0x543eaf[0x0]['Agent'])&&_[_0xee5e('0x3d')](_0x543eaf[0x0][_0xee5e('0x59')]['name'])){ut[_0xee5e('0xf4')](_0xee5e('0x109'),_0x543eaf);return{'isValid':![],'message':_0xee5e('0x10a')};}var _0x3ede0b=this[_0xee5e('0x13')][_0x543eaf[0x0][_0xee5e('0x40')][_0xee5e('0x2a')]];_0x3ede0b['message']=utils['CAMPAIGN_STATUS'][_0xee5e('0x76')];if(_[_0xee5e('0x3d')](_0x3ede0b)){ut[_0xee5e('0xf4')](_0xee5e('0x10b'),_0x3ede0b);return{'isValid':![],'message':_0xee5e('0x10c')};}if(!this['isTrunkReachable'](_0x3ede0b['Trunk'])){ut['logger'](_0xee5e('0x10d'),_0xee5e('0x10e')+_0x3ede0b[_0xee5e('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xee5e('0x73')](_0x3ede0b[_0xee5e('0x74')])){ut[_0xee5e('0xf4')](_0xee5e('0x10d'),_0x3ede0b[_0xee5e('0x2a')]+_0xee5e('0x10f'));return{'isValid':![],'message':_0xee5e('0x110')};}}if(!ut[_0xee5e('0x6f')](_0x3ede0b[_0xee5e('0x70')])){ut[_0xee5e('0xf4')](_0xee5e('0x111'),_0x3ede0b['name']+_0xee5e('0x112'));return{'isValid':![],'message':_0xee5e('0x10e')+_0x3ede0b[_0xee5e('0x2a')]+_0xee5e('0x112')};}return{'isValid':!![],'message':_0xee5e('0x113')};};Preview[_0xee5e('0x34')]['execCall']=function(_0x515603,_0x191b33,_0x938356,_0x4b13bf){var _0x4c672c=this;return new Promise(function(_0x2badfa,_0x26c6ad){var _0x2867e8=_0x515603[_0xee5e('0xa4')];var _0x49e343=_0x4c672c['isTrunkReachable'](_0x191b33['Trunk'])?util['format'](_0xee5e('0x114'),_0x191b33[_0xee5e('0x72')][_0xee5e('0x2a')],_[_0xee5e('0x3d')](_0x191b33['dialPrefix'])?'':_0x191b33['dialPrefix']['trim']()||'',_0x191b33[_0xee5e('0x115')]>0x0?_0x938356['phone'][_0xee5e('0x116')](_0x191b33['dialCutDigit']):_0x938356[_0xee5e('0x107')]):util[_0xee5e('0x5f')](_0xee5e('0x114'),_['isNil'](_0x191b33[_0xee5e('0x74')])?_0x191b33[_0xee5e('0x72')]['name']:_0x191b33[_0xee5e('0x74')][_0xee5e('0x2a')],_[_0xee5e('0x3d')](_0x191b33[_0xee5e('0x117')])?'':_0x191b33['dialPrefix'][_0xee5e('0x118')]()||'',_0x191b33['dialCutDigit']>0x0?_0x938356[_0xee5e('0x107')][_0xee5e('0x116')](_0x191b33[_0xee5e('0x115')]):_0x938356['phone']);var _0x5aba40=_0x4c672c[_0xee5e('0x73')](_0x191b33[_0xee5e('0x72')])?ut['getCallerId'](_0x191b33['Trunk'][_0xee5e('0x119')],_0x191b33[_0xee5e('0x11a')],_0x191b33[_0xee5e('0x11b')]>0x0?ut['getCallerIdRandom'](_0x191b33[_0xee5e('0x11c')],_0x191b33[_0xee5e('0x11b')]):_0x191b33[_0xee5e('0x11c')]):ut[_0xee5e('0x11d')](_[_0xee5e('0x3d')](_0x191b33[_0xee5e('0x74')])?_0x191b33['Trunk'][_0xee5e('0x119')]:_0x191b33['TrunkBackup'][_0xee5e('0x119')],_0x191b33['dialOriginateCallerIdName'],_0x191b33[_0xee5e('0x11b')]>0x0?ut[_0xee5e('0x11e')](_0x191b33[_0xee5e('0x11c')],_0x191b33[_0xee5e('0x11b')]):_0x191b33['dialOriginateCallerIdNumber']);if(_0x5aba40){_0x515603['originatecalleridname']=ut[_0xee5e('0x11f')](_0x5aba40);_0x515603['originatecalleridnum']=ut[_0xee5e('0x120')](_0x5aba40);}var _0x11ca27=ut[_0xee5e('0x121')](_0x191b33,_0x938356,_0x49e343,_0x5aba40,_0x2867e8,_0x515603);var _0x5862e4=utils['setXMDContactVariables'](_0x938356[_0xee5e('0xec')]);Object['assign'](_0x11ca27,_0x5862e4);_[_0xee5e('0x122')](_0x515603,ut[_0xee5e('0x123')](_0x11ca27));_0x515603['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x191b33[_0xee5e('0x124')]=_0x11ca27;var _0x5dac04=ut[_0xee5e('0x125')](_0x515603,_0x191b33,_0x11ca27,_0x515603['activeContact'],_0x4b13bf);return ami[_0xee5e('0x4a')](_0x5dac04)[_0xee5e('0x55')](function(_0x341bcb){_0x191b33['originated']+=0x1;logger[_0xee5e('0x26')](_0xee5e('0x126'),_0x2867e8,_0xee5e('0x95'),_0x191b33['name'],'originated:\x20',_0x191b33[_0xee5e('0x2d')]);_0x2badfa(_0x341bcb);})[_0xee5e('0xe6')](function(_0xdfcd0){ut[_0xee5e('0xdd')](_0x515603,0xe,_0xee5e('0x127'));rpcDb[_0xee5e('0xde')](_0x515603,_0xee5e('0x128'));_0x26c6ad(_0xdfcd0);});});};Preview[_0xee5e('0x34')][_0xee5e('0x129')]=function(_0x353d16){if(this[_0xee5e('0x3e')][_0x353d16[_0xee5e('0xa5')]]){this['actions'][_0x353d16[_0xee5e('0xa5')]]['channel']=_0x353d16[_0xee5e('0x4c')];}};Preview[_0xee5e('0x34')][_0xee5e('0x17')]=function(_0x540ff3){var _0x26b1da=this;var _0x55b29a=this['actions'][_0x540ff3['actionid']];if(_0x55b29a){if(_0x55b29a['lookAgent']&&this[_0xee5e('0x15')][_0x55b29a['lookAgent']]){ut[_0xee5e('0x12a')](_0x55b29a,this[_0xee5e('0x15')][_0x55b29a['lookAgent']]['name'],this[_0xee5e('0x15')][_0x55b29a[_0xee5e('0xed')]]['id']);}var _0x381cb4=_['clone'](_0x55b29a);_0x381cb4['responsetime']=moment()[_0xee5e('0x5f')](_0xee5e('0x60'));var _0x5995a9=_0x26b1da[_0xee5e('0x13')][_0x55b29a[_0xee5e('0x41')]];if(ut[_0xee5e('0x12b')](_0x540ff3['response'])){if(_0x55b29a[_0xee5e('0x8b')]){rpcDb[_0xee5e('0x12c')](_0x55b29a[_0xee5e('0x8e')]);}if(_0x55b29a[_0xee5e('0x8c')]){rpcDb[_0xee5e('0x5d')](_0x55b29a['idContact']);}ami[_0xee5e('0x25')](_0xee5e('0x12d'),ut[_0xee5e('0x7e')](_0x55b29a,'rejected',this[_0xee5e('0x13')][_0x55b29a[_0xee5e('0x41')]]));this[_0xee5e('0xd9')](_0x381cb4,_0x5995a9,_0x540ff3);}else{_0x55b29a['starttime']=moment()[_0xee5e('0x5f')](_0xee5e('0x60'));ut[_0xee5e('0xdd')](_0x381cb4,0x4,_0xee5e('0x9e'));rpcDb[_0xee5e('0xde')](_0x381cb4,_0xee5e('0x12e'));}}};Preview[_0xee5e('0x34')]['syncHangup']=function(_0x4ef5ce){var _0x18cd20=this[_0xee5e('0x3e')][_0x4ef5ce[_0xee5e('0xa5')]];var _0xce0614;if(_0x18cd20){_0xce0614=this[_0xee5e('0x13')][_0x18cd20[_0xee5e('0x41')]];logger[_0xee5e('0x26')](_0xee5e('0x12f'),_0x4ef5ce[_0xee5e('0xa5')],'\x20Queue',_0xce0614[_0xee5e('0x2a')],'pTalking:\x20',_0xce0614[_0xee5e('0x93')]);}if(this[_0xee5e('0x3e')][_0x4ef5ce[_0xee5e('0xa5')]]&&_0x4ef5ce[_0xee5e('0xa5')]!==_0x4ef5ce[_0xee5e('0xa4')]){if(_0x4ef5ce['cause']==='16'&&this[_0xee5e('0x3e')][_0x4ef5ce['linkedid']][_0xee5e('0x44')]){this[_0xee5e('0x77')](_0x4ef5ce,_0x4ef5ce[_0xee5e('0xa5')],_0x4ef5ce[_0xee5e('0x130')]);}else if(this[_0xee5e('0x3e')][_0x4ef5ce[_0xee5e('0xa5')]][_0xee5e('0x44')]){logger[_0xee5e('0x26')](_0xee5e('0x131'),_0x4ef5ce[_0xee5e('0xa5')],_0x4ef5ce[_0xee5e('0x130')],_0xee5e('0x95'),_0xce0614[_0xee5e('0x2a')],_0xee5e('0x43'),_0xce0614[_0xee5e('0x93')]);this[_0xee5e('0x77')](_0x4ef5ce,_0x4ef5ce['linkedid'],_0x4ef5ce[_0xee5e('0x130')]);}}else if(_0x18cd20&&_[_0xee5e('0x3d')](_0x18cd20[_0xee5e('0x132')])&&_0xce0614['dialQueueProject']&&_0x4ef5ce[_0xee5e('0xa5')]===_0x4ef5ce['uniqueid']&&_[_0xee5e('0x3d')](_0x4ef5ce[_0xee5e('0xdc')])&&_0x4ef5ce[_0xee5e('0x130')]==='16'&&_0x4ef5ce[_0xee5e('0x133')]==='6'&&_[_0xee5e('0xda')](_0x18cd20['transfer'])){if(_0x18cd20[_0xee5e('0x8b')]){rpcDb[_0xee5e('0x12c')](_0x18cd20['idContact']);}if(_0x18cd20['activeContact']){rpcDb[_0xee5e('0x5d')](_0x18cd20[_0xee5e('0x8e')]);}_0x4ef5ce[_0xee5e('0xdc')]='22';this[_0xee5e('0xd9')](_0x18cd20,_0xce0614,_0x4ef5ce);}else if(_0x18cd20&&_0x18cd20[_0xee5e('0x134')]){if(_0x4ef5ce[_0xee5e('0x130')]==='16'&&this[_0xee5e('0x3e')][_0x4ef5ce[_0xee5e('0xa5')]]['dialAnswer']){logger[_0xee5e('0x26')](_0xee5e('0x135'),_0x4ef5ce['linkedid'],_0x4ef5ce[_0xee5e('0x130')],'\x20Queue',_0xce0614[_0xee5e('0x2a')],_0xee5e('0x43'),_0xce0614[_0xee5e('0x93')]);this[_0xee5e('0x77')](_0x4ef5ce,_0x4ef5ce[_0xee5e('0xa5')],_0x4ef5ce['cause']);}else if(this[_0xee5e('0x3e')][_0x4ef5ce['linkedid']]['dialAnswer']){logger['info'](_0xee5e('0x131'),_0x4ef5ce[_0xee5e('0xa5')],_0x4ef5ce['cause'],_0xee5e('0x95'),_0xce0614[_0xee5e('0x2a')],'pTalking:\x20',_0xce0614[_0xee5e('0x93')]);this['callProgressDetectingCustomer'](_0x4ef5ce,_0x4ef5ce['linkedid'],_0x4ef5ce[_0xee5e('0x130')]);}}};Preview['prototype'][_0xee5e('0x1e')]=function(_0x2fddf1){if(this[_0xee5e('0x3e')][_0x2fddf1['destlinkedid']]&&_0x2fddf1[_0xee5e('0xd8')]!==_0x2fddf1[_0xee5e('0x136')]){this['callProgressDetectingCustomer'](_0x2fddf1,_0x2fddf1[_0xee5e('0xd8')],_0x2fddf1[_0xee5e('0xcd')]);}};Preview[_0xee5e('0x34')][_0xee5e('0x1c')]=function(_0x1cb457){if(this[_0xee5e('0x3e')][_0x1cb457[_0xee5e('0xa5')]]&&_0x1cb457[_0xee5e('0xa5')]!==_0x1cb457[_0xee5e('0xa4')]&&!this[_0xee5e('0x3e')][_0x1cb457[_0xee5e('0xa5')]][_0xee5e('0x44')]){if(_0x1cb457[_0xee5e('0x130')]==='1'){this['callProgressDetectingCustomer'](_0x1cb457,_0x1cb457[_0xee5e('0xa5')],_0x1cb457[_0xee5e('0x130')]);}}};Preview[_0xee5e('0x34')][_0xee5e('0x137')]=function(_0x53325c,_0x5ddeab,_0x422e80){if(this[_0xee5e('0x3e')][_0x53325c]){if(_['isNil'](this[_0xee5e('0x3e')][_0x53325c]['variables'])){this[_0xee5e('0x3e')][_0x53325c][_0xee5e('0x124')]={};}this['actions'][_0x53325c][_0xee5e('0x124')][_0x5ddeab]=_0x422e80;}};Preview['prototype'][_0xee5e('0x21')]=function(_0x49a1fc){try{if(!_[_0xee5e('0x3d')](_0x49a1fc)){if(ut[_0xee5e('0x138')](_[_0xee5e('0x139')](_0x49a1fc[_0xee5e('0x13a')])[0x0])){this[_0xee5e('0x137')](_0x49a1fc[_0xee5e('0xa4')],_[_0xee5e('0x139')](_0x49a1fc[_0xee5e('0x13a')])[0x0],_0x49a1fc[_0xee5e('0x13b')]);}}}catch(_0x316b3b){logger[_0xee5e('0x13c')](_0xee5e('0x13d'),util[_0xee5e('0x13e')](_0x316b3b,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xee5e('0x13f')]=function(_0x4adff4){if(_0x4adff4){if(this[_0xee5e('0x3e')][_0x4adff4[_0xee5e('0x140')]]){this['actions'][_0x4adff4[_0xee5e('0x140')]]['transfer']=!![];}}};Preview[_0xee5e('0x34')][_0xee5e('0x23')]=function(_0x59858b){if(_0x59858b){if(this[_0xee5e('0x3e')][_0x59858b[_0xee5e('0x141')]]){this[_0xee5e('0x3e')][_0x59858b[_0xee5e('0x141')]][_0xee5e('0x134')]=!![];}}};module[_0xee5e('0x142')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5441ba7..fa210a0 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 _0x6b07=['../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x6b07,0x96));var _0x76b0=function(_0x2f7b06,_0x3a84e2){_0x2f7b06=_0x2f7b06-0x0;var _0x3d6277=_0x6b07[_0x2f7b06];return _0x3d6277;};'use strict';var util=require(_0x76b0('0x0'));var BPromise=require(_0x76b0('0x1'));var logger=require('../../../config/logger')('preview');var cmHopper=require(_0x76b0('0x2'));var cmHopperHistory=require(_0x76b0('0x3'));var cmHopperBlack=require(_0x76b0('0x4'));var agentReportPreview=require(_0x76b0('0x5'));var voiceQueueReport=require(_0x76b0('0x6'));function loggerCatch(_0x44177f){return function(_0x361d46){logger[_0x76b0('0x7')](_0x44177f,util[_0x76b0('0x8')](_0x361d46,{'showHidden':![],'depth':null}));};}function create(_0x359b08){return cmHopperHistory[_0x76b0('0x9')](_0x359b08)[_0x76b0('0xa')](loggerCatch(_0x76b0('0xb')));}function createAgent(_0x811330){return BPromise['resolve']()[_0x76b0('0xc')](agentReportPreview['createHistory'](_0x811330))[_0x76b0('0xa')](loggerCatch(_0x76b0('0xb')));}function moveContact(_0x22456b){return cmHopper[_0x76b0('0xd')](_0x22456b,!![])[_0x76b0('0xa')](loggerCatch(_0x76b0('0xe')));}exports[_0x76b0('0xf')]=function(_0x1d46a2){return cmHopperBlack[_0x76b0('0xf')](_0x1d46a2)[_0x76b0('0xa')](loggerCatch(_0x76b0('0x10')));};exports['getContactPreview']=function(_0x5a521c){return BPromise[_0x76b0('0x11')]()[_0x76b0('0xc')](cmHopper['getContactPreview'](_0x5a521c))[_0x76b0('0xa')](loggerCatch(_0x76b0('0x12')));};exports[_0x76b0('0x9')]=function(_0x5817f9,_0x59c62b){create(_0x5817f9)[_0x76b0('0xa')](loggerCatch(_0x59c62b));moveContact(_0x5817f9)[_0x76b0('0xa')](loggerCatch(_0x59c62b));};exports[_0x76b0('0x13')]=function(_0x1d4644,_0x42364d){createAgent(_0x1d4644)[_0x76b0('0xa')](loggerCatch(_0x42364d));};exports[_0x76b0('0x14')]=function(_0x232e4f,_0x5cad2d){create(_0x232e4f)[_0x76b0('0xa')](loggerCatch(_0x5cad2d));};exports[_0x76b0('0x15')]=function(_0x54b07f,_0xa6537f){moveContact(_0x54b07f)['catch'](loggerCatch(_0xa6537f));};exports[_0x76b0('0x16')]=function(_0x39cb6c,_0x876429,_0x26681e){if(_0x876429){_0x39cb6c['UserId']=null;}if(_0x26681e){_0x39cb6c[_0x76b0('0x17')]=![];}return cmHopper['rescheduleContact'](_0x39cb6c)[_0x76b0('0xa')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x76b0('0x18')]=function(_0x41a477){return cmHopper[_0x76b0('0x18')](_0x41a477)[_0x76b0('0xa')](loggerCatch(_0x76b0('0x19')));};exports[_0x76b0('0x1a')]=function(_0x1b30ef){return cmHopper[_0x76b0('0x1a')]({'UserId':null},_0x1b30ef,0x1)[_0x76b0('0xa')](loggerCatch(_0x76b0('0x1b')));};exports[_0x76b0('0x1c')]=function(_0x532522){return cmHopper[_0x76b0('0x1a')]({'active':![]},_0x532522,0x1)[_0x76b0('0xa')](loggerCatch(_0x76b0('0x1d')));};exports[_0x76b0('0x1e')]=function(_0x5b6cf2){var _0x5ecd4c={};_0x5ecd4c['type']=_0x5b6cf2['type'];_0x5ecd4c[_0x76b0('0x1f')]=_0x5b6cf2[_0x76b0('0x1f')];_0x5ecd4c['calleridnum']=_0x5b6cf2['calleridnum'];_0x5ecd4c[_0x76b0('0x20')]=_0x5b6cf2[_0x76b0('0x20')];_0x5ecd4c[_0x76b0('0x21')]=_0x5b6cf2[_0x76b0('0x21')];_0x5ecd4c[_0x76b0('0x22')]=_0x5b6cf2[_0x76b0('0x23')];_0x5ecd4c[_0x76b0('0x24')]=_0x5b6cf2['answertime'];_0x5ecd4c['queuecallercomplete']=0x1;_0x5ecd4c[_0x76b0('0x25')]=_0x5b6cf2[_0x76b0('0x26')];_0x5ecd4c['connectedlinename']=_0x5b6cf2[_0x76b0('0x27')];_0x5ecd4c[_0x76b0('0x28')]=_0x76b0('0x29');_0x5ecd4c[_0x76b0('0x2a')]=_0x76b0('0x2b');_0x5ecd4c[_0x76b0('0x2c')]=0x0;_0x5ecd4c[_0x76b0('0x2d')]=0x1;_0x5ecd4c[_0x76b0('0x2e')]=_0x5b6cf2[_0x76b0('0x27')];_0x5ecd4c[_0x76b0('0x2f')]='COMPLETED';return BPromise[_0x76b0('0x11')]()['then'](voiceQueueReport[_0x76b0('0x30')](_0x5ecd4c))[_0x76b0('0xa')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x76b0('0x31')]=function(_0x1b86ba,_0x1ac6c9){return BPromise[_0x76b0('0x11')]()[_0x76b0('0xc')](cmHopper['getContactRecallMe'](_0x1b86ba,_0x1ac6c9))[_0x76b0('0xa')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x76b0('0x32')]=function(_0x49da67){return cmHopper[_0x76b0('0x16')](_0x49da67,!![],!![])['catch'](loggerCatch(_0x76b0('0x33')));}; \ No newline at end of file +var _0x8c84=['preview','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','resolve','then','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x8c84,0x1ad));var _0x48c8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8c84[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x48c8('0x0'));var BPromise=require(_0x48c8('0x1'));var logger=require(_0x48c8('0x2'))(_0x48c8('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x48c8('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x48c8('0x5'));function loggerCatch(_0x414dea){return function(_0x12d596){logger[_0x48c8('0x6')](_0x414dea,util[_0x48c8('0x7')](_0x12d596,{'showHidden':![],'depth':null}));};}function create(_0x17a7f5){return cmHopperHistory[_0x48c8('0x8')](_0x17a7f5)['catch'](loggerCatch(_0x48c8('0x9')));}function createAgent(_0xfbc6e5){return BPromise['resolve']()['then'](agentReportPreview[_0x48c8('0x8')](_0xfbc6e5))[_0x48c8('0xa')](loggerCatch(_0x48c8('0x9')));}function moveContact(_0x2d3524){return cmHopper[_0x48c8('0xb')](_0x2d3524,!![])[_0x48c8('0xa')](loggerCatch(_0x48c8('0xc')));}exports[_0x48c8('0xd')]=function(_0x29326c){return cmHopperBlack[_0x48c8('0xd')](_0x29326c)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x172ec0){return BPromise[_0x48c8('0xe')]()[_0x48c8('0xf')](cmHopper[_0x48c8('0x10')](_0x172ec0))[_0x48c8('0xa')](loggerCatch(_0x48c8('0x11')));};exports[_0x48c8('0x8')]=function(_0x2722ba,_0x752124){create(_0x2722ba)[_0x48c8('0xa')](loggerCatch(_0x752124));moveContact(_0x2722ba)['catch'](loggerCatch(_0x752124));};exports[_0x48c8('0x12')]=function(_0x5a4e1a,_0x51dbd9){createAgent(_0x5a4e1a)[_0x48c8('0xa')](loggerCatch(_0x51dbd9));};exports[_0x48c8('0x13')]=function(_0x1e6362,_0x479af4){create(_0x1e6362)['catch'](loggerCatch(_0x479af4));};exports['createCustomerFinal']=function(_0x33a37b,_0x39151d){moveContact(_0x33a37b)[_0x48c8('0xa')](loggerCatch(_0x39151d));};exports[_0x48c8('0x14')]=function(_0x4be312,_0x3a6243,_0x7e8018){if(_0x3a6243){_0x4be312['UserId']=null;}if(_0x7e8018){_0x4be312[_0x48c8('0x15')]=![];}return cmHopper['rescheduleContact'](_0x4be312)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x48c8('0x16')]=function(_0x55db6a){return cmHopper['countReScheduled'](_0x55db6a)[_0x48c8('0xa')](loggerCatch(_0x48c8('0x17')));};exports[_0x48c8('0x18')]=function(_0x356d72){return cmHopper[_0x48c8('0x18')]({'UserId':null},_0x356d72,0x1)[_0x48c8('0xa')](loggerCatch(_0x48c8('0x19')));};exports[_0x48c8('0x1a')]=function(_0x82de76){return cmHopper[_0x48c8('0x18')]({'active':![]},_0x82de76,0x1)[_0x48c8('0xa')](loggerCatch(_0x48c8('0x1b')));};exports[_0x48c8('0x1c')]=function(_0x5e7958){var _0x5dbce4={};_0x5dbce4[_0x48c8('0x1d')]=_0x5e7958['type'];_0x5dbce4[_0x48c8('0x1e')]=_0x5e7958['uniqueid'];_0x5dbce4[_0x48c8('0x1f')]=_0x5e7958[_0x48c8('0x1f')];_0x5dbce4['calleridname']=_0x5e7958[_0x48c8('0x20')];_0x5dbce4[_0x48c8('0x21')]=_0x5e7958[_0x48c8('0x21')];_0x5dbce4[_0x48c8('0x22')]=_0x5e7958[_0x48c8('0x23')];_0x5dbce4[_0x48c8('0x24')]=_0x5e7958['answertime'];_0x5dbce4[_0x48c8('0x25')]=0x1;_0x5dbce4['queuecallercompleteAt']=_0x5e7958[_0x48c8('0x26')];_0x5dbce4[_0x48c8('0x27')]=_0x5e7958[_0x48c8('0x28')];_0x5dbce4[_0x48c8('0x29')]=_0x48c8('0x2a');_0x5dbce4[_0x48c8('0x2b')]=_0x48c8('0x2c');_0x5dbce4[_0x48c8('0x2d')]=0x0;_0x5dbce4[_0x48c8('0x2e')]=0x1;_0x5dbce4['lastAssignedTo']=_0x5e7958['membername'];_0x5dbce4['queuecallerexitreason']=_0x48c8('0x2f');return BPromise[_0x48c8('0xe')]()['then'](voiceQueueReport[_0x48c8('0x30')](_0x5dbce4))[_0x48c8('0xa')](loggerCatch(_0x48c8('0x31')));};exports[_0x48c8('0x32')]=function(_0x3acdbb,_0x214f21){return BPromise[_0x48c8('0xe')]()[_0x48c8('0xf')](cmHopper[_0x48c8('0x32')](_0x3acdbb,_0x214f21))[_0x48c8('0xa')](loggerCatch(_0x48c8('0x33')));};exports[_0x48c8('0x34')]=function(_0x555018){return cmHopper['rescheduleContact'](_0x555018,!![],!![])['catch'](loggerCatch(_0x48c8('0x35')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index e195944..396dc72 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 _0xfa91=['\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','interface','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callbackuniqueid','recallme','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','match','extractCalleridNumber','noanswer','keys','variables','forEach','toLowerCase','buildNoAnswerEventPayload','moment','../../../../config/logger','env','XCALLY_IP_AGI','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','dialPreviewUrl','dialQueueProject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa91,0x100));var _0x1fa9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xfa91[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1fa9('0x0'));var logger=require(_0x1fa9('0x1'))('preview');var ipAgi=process[_0x1fa9('0x2')][_0x1fa9('0x3')]||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0x1fa9('0x4')]=function(_0x2c91de){return function(_0xfda7dd){logger[_0x1fa9('0x5')](_0x2c91de,util[_0x1fa9('0x6')](_0xfda7dd,{'showHidden':![],'depth':null}));};};exports[_0x1fa9('0x7')]=function(_0x2389d3,_0x26ab20){logger[_0x1fa9('0x8')](_0x2389d3,util['inspect'](_0x26ab20,{'showHidden':![],'depth':null}));};exports[_0x1fa9('0x9')]=function(_0x396861,_0x15a44b){logger[_0x1fa9('0x5')](_0x396861,util[_0x1fa9('0x6')](_0x15a44b,{'showHidden':![],'depth':null}));};exports[_0x1fa9('0xa')]=function(_0x49c5e0){return function(_0x2c82b0){logger[_0x1fa9('0x8')](_0x49c5e0,util['inspect'](_0x2c82b0,{'showHidden':![],'depth':null}));};};exports[_0x1fa9('0xb')]=function(_0x1fcd10,_0x5f2016,_0x24772f){return{'message':_0x1fcd10,'unlock':_0x5f2016,'active':_0x24772f};};exports[_0x1fa9('0xc')]=function(_0x3d6a1b,_0x3c1d46,_0x7d1f3b){if(!_[_0x1fa9('0xd')](_0x7d1f3b)&&_0x1fa9('0xe')===typeof _0x7d1f3b&&!_['isEmpty'](_0x7d1f3b)){if(!_[_0x1fa9('0xd')](_0x3c1d46)&&_0x1fa9('0xe')===typeof _0x3c1d46&&!_[_0x1fa9('0xf')](_0x3c1d46)){return util[_0x1fa9('0x10')]('\x22%s\x22\x20<%s>',_0x3c1d46,_0x7d1f3b);}return util[_0x1fa9('0x10')]('\x22%s\x22\x20<%s>',_0x7d1f3b,_0x7d1f3b);}if(!_[_0x1fa9('0xd')](_0x3d6a1b)&&'string'===typeof _0x3d6a1b&&!_['isEmpty'](_0x3d6a1b)){return _0x3d6a1b;}return _0x1fa9('0x11');};exports[_0x1fa9('0x12')]=function(_0x6c2a4e){if(_[_0x1fa9('0x13')](_0x6c2a4e)){return![];}return _0x6c2a4e;};exports[_0x1fa9('0x14')]=function(_0x527860,_0x48f0bc,_0xb169da,_0xaae06b,_0x282944,_0x22f53b){var _0x5e2a51={'XMD-QUEUE':_0x48f0bc[_0x1fa9('0x15')]?_0x48f0bc[_0x1fa9('0x15')][_0x1fa9('0x16')]:'','XMD-CALLERID':_0xaae06b,'XMD-CALLERID-PREVIEW':_0x22f53b?util[_0x1fa9('0x10')](_0x1fa9('0x17'),_0x22f53b[_0x1fa9('0x18')],_0x22f53b[_0x1fa9('0x19')]):_0xaae06b,'XMD-DIALID':_0x282944,'XMD-CONTACTID':_0x48f0bc['ContactId'],'XMD-CDRTYPE':_0x1fa9('0x1a'),'CALLERID(all)':_0xaae06b,'XMD-VOICEQUEUEID':_0x48f0bc[_0x1fa9('0x1b')],'XMD-DIALCHANNEL':_0xb169da,'XMD-DIALTIMEOUT':_0x527860[_0x1fa9('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x1fa9('0x10')]('\x22rtTxX%s%s\x22',_0x527860['dialQueueProject2']?'g':'',_[_0x1fa9('0xf')](_0x527860[_0x1fa9('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x527860[_0x1fa9('0x1e')]||'','XMD-AGI':_0x527860[_0x1fa9('0x1f')]?util[_0x1fa9('0x10')](_0x1fa9('0x20'),ipAgi,_0x527860[_0x1fa9('0x1f')]):_0x1fa9('0x21'),'XMD-AGIAFTER':_0x527860['dialQueueProject2']?util[_0x1fa9('0x10')](_0x1fa9('0x20'),ipAgi,_0x527860[_0x1fa9('0x22')]):_0x1fa9('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x22f53b?_0x22f53b['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x22f53b?_0x22f53b['originatecalleridname']:'','XMD-DESTINATION':_0x1fa9('0x23'),'SIPADDHEADER':_0x1fa9('0x24')};if(!_[_0x1fa9('0xf')](_0x527860[_0x1fa9('0x1d')])){_0x5e2a51[util['format']('%s',_0x1fa9('0x25'))]=_0x527860['monitor_format'];_0x5e2a51[util[_0x1fa9('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x282944;}return _0x5e2a51;};exports['toLowerVariables']=function(_0x42112a){var _0x339dfb={};for(var _0x52f53a in _0x42112a){if(_0x42112a[_0x1fa9('0x26')](_0x52f53a)){_0x339dfb[util[_0x1fa9('0x10')]('%s',_['toLower'](_0x52f53a))]=_0x42112a[_0x52f53a];}}return{'variables':_0x339dfb};};exports[_0x1fa9('0x27')]=function(_0x2610c0,_0x3d1e43){if(!_[_0x1fa9('0x13')](_0x2610c0)){if(_0x2610c0['hasOwnProperty']('originated')){if(_0x2610c0['originated']>0x0){_0x2610c0[_0x1fa9('0x28')]-=0x1;}else{logger[_0x1fa9('0x5')](_0x1fa9('0x29'),_0x3d1e43);}}}else{logger['error'](_0x1fa9('0x2a'),_0x3d1e43);}};exports[_0x1fa9('0x2b')]=function(_0x208689){var _0x40669a=moment()[_0x1fa9('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x208689[_0x1fa9('0x2c')]=0xd;_0x208689[_0x1fa9('0x2d')]=_0x1fa9('0x2e');_0x208689[_0x1fa9('0x2f')]=_0x40669a;_0x208689[_0x1fa9('0x30')]=_0x40669a;_0x208689[_0x1fa9('0x31')]=_0x40669a;};exports[_0x1fa9('0x32')]=function(_0x427f92,_0x2fee06,_0x46952f){var _0x1411c0=moment()[_0x1fa9('0x10')](_0x1fa9('0x33'));_0x427f92['state']=_0x2fee06;_0x427f92['statedesc']=_0x46952f;_0x427f92[_0x1fa9('0x30')]=_0x1411c0;_0x427f92[_0x1fa9('0x34')]=utils[_0x1fa9('0x35')](_0x427f92[_0x1fa9('0x30')],_0x427f92['starttime']);};exports[_0x1fa9('0x36')]=function(_0x1c8434,_0x2b5f31,_0x401454){_0x1c8434[_0x1fa9('0x37')]=_0x2b5f31;_0x1c8434[_0x1fa9('0x38')]=_0x401454;};exports[_0x1fa9('0x39')]=function(_0x419bdb,_0x374139,_0x2df61a){var _0x3a7939=moment()[_0x1fa9('0x10')](_0x1fa9('0x33'));_0x419bdb[_0x1fa9('0x2c')]=_0x374139;_0x419bdb[_0x1fa9('0x2d')]=_0x2df61a;_0x419bdb[_0x1fa9('0x30')]=_0x419bdb[_0x1fa9('0x30')]?_0x419bdb['responsetime']:_0x3a7939;_0x419bdb[_0x1fa9('0x31')]=_0x419bdb[_0x1fa9('0x31')]?_0x419bdb[_0x1fa9('0x31')]:_0x3a7939;_0x419bdb[_0x1fa9('0x34')]=utils[_0x1fa9('0x35')](_0x419bdb[_0x1fa9('0x30')]||0x0,_0x419bdb[_0x1fa9('0x2f')]||0x0);_0x419bdb[_0x1fa9('0x3a')]=_0x419bdb[_0x1fa9('0x3b')]?utils['getSeconds'](_0x419bdb[_0x1fa9('0x31')],_0x419bdb['answertime']):0x0;};exports['isFailure']=function(_0x427e59){return _0x427e59===_0x1fa9('0x3c');};exports[_0x1fa9('0x3d')]=function(_0xa4a791,_0x4ac2af,_0x364aea,_0x2a674e,_0x2a68f9){var _0x489b35=_0x2a674e?_0x1fa9('0x3e'):_0xa4a791[_0x1fa9('0x18')];_0x489b35=_0x2a68f9?_0x1fa9('0x3f'):_0x489b35;return{'actionid':_0xa4a791['uniqueid'],'action':_0x1fa9('0x40'),'channel':_0xa4a791[_0x1fa9('0x41')],'callerid':util[_0x1fa9('0x10')]('\x22%s\x22\x20<%s>',_0x489b35,_0xa4a791[_0x1fa9('0x19')]),'Exten':_0x1fa9('0x23'),'Context':_0x1fa9('0x42'),'Priority':'1','variable':_0x364aea,'timeout':(_0x4ac2af[_0x1fa9('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa4a791[_0x1fa9('0x44')]};};exports[_0x1fa9('0x45')]=function(_0x9a4793){return _0x9a4793[_0x1fa9('0x46')]+_0x9a4793[_0x1fa9('0x47')]+_0x9a4793[_0x1fa9('0x48')]+_0x9a4793['countagentrejectretry']+_0x9a4793[_0x1fa9('0x49')];};exports[_0x1fa9('0x4a')]=function(_0xf5cd6f){var _0x24392a=_['clone'](_0xf5cd6f);_0x24392a[_0x1fa9('0x2c')]=0xf;_0x24392a['statedesc']=_0x1fa9('0x4b');return _0x24392a;};exports[_0x1fa9('0x4c')]=function(_0x1a7f7f,_0x505322,_0x19f670){var _0x2adccd={};_0x2adccd[_0x505322]=_0x1a7f7f[_0x505322];_0x2adccd[_0x1fa9('0x4d')]=![];_0x2adccd[_0x1fa9('0x4e')]=moment()[_0x1fa9('0x4f')](_0x19f670,_0x1fa9('0x50'))[_0x1fa9('0x10')](_0x1fa9('0x33'));_0x2adccd[_0x1fa9('0x51')]=_0x1a7f7f[_0x1fa9('0x51')];_0x2adccd[_0x1fa9('0x52')]=_0x1a7f7f[_0x1fa9('0x52')];_0x2adccd[_0x1fa9('0x1b')]=_0x1a7f7f['VoiceQueueId']||undefined;return _0x2adccd;};exports[_0x1fa9('0x53')]=function(_0x599b5a,_0x5e329e){if(!_['isNil'](_0x599b5a)){if(_0x599b5a[_0x1fa9('0x54')]>0x0){_0x599b5a['pTalking']-=0x1;}else{logger[_0x1fa9('0x5')](_0x5e329e,_0x1fa9('0x55'));}}else{logger[_0x1fa9('0x5')](_0x5e329e,_0x1fa9('0x56'));}};exports[_0x1fa9('0x57')]=function(_0x49575d){if(_0x49575d<=0x0){return!![];}return![];};function buildObj(_0xb34e72,_0xfc4c9,_0x3ecde9){_0xb34e72['lastevent']=_0xfc4c9;_0xb34e72['name']=_0xb34e72[_0x1fa9('0x58')];_0xb34e72['interface']=_0xb34e72[_0x1fa9('0x41')];_0xb34e72[_0x1fa9('0x59')]=_0x1fa9('0x5a');if(_0x3ecde9){_0xb34e72[_0x1fa9('0x5b')]=_0x3ecde9['mandatoryDisposition'];}return _0xb34e72;}exports[_0x1fa9('0x5c')]=buildObj;exports[_0x1fa9('0x5d')]=function(_0x3d090e){var _0x58d63c={};_0x58d63c['queue']=_0x3d090e[_0x1fa9('0x58')];_0x58d63c[_0x1fa9('0x5e')]=_0x3d090e['channelAgent'];_0x58d63c['uniqueid']=_0x3d090e[_0x1fa9('0x44')];return _0x58d63c;};exports['agentReadyId']=function(_0x5624ad){var _0x2df721=[];for(var _0x12cf34 in _0x5624ad){if(_0x5624ad['hasOwnProperty'](_0x12cf34)){if(!_[_0x1fa9('0x13')](_0x5624ad[_0x12cf34])&&_0x5624ad[_0x12cf34][_0x1fa9('0x2c')]===_0x1fa9('0x5f')&&_0x5624ad[_0x12cf34][_0x1fa9('0x60')]===_0x1fa9('0x61')){_0x2df721[_0x1fa9('0x62')](_0x5624ad[_0x12cf34]['id']);}}}return _0x2df721;};exports[_0x1fa9('0x63')]=function(_0x28d96a){var _0x1bc730=moment()[_0x1fa9('0x64')](0x0);var _0x4feee2=moment(_0x28d96a)[_0x1fa9('0x64')](0x0);return _0x1bc730[_0x1fa9('0x65')](_0x4feee2,_0x1fa9('0x66'));};exports['createBody']=function(_0x147b4b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x147b4b[_0x1fa9('0x51')],'ListId':_0x147b4b[_0x1fa9('0x52')],'VoiceQueueId':_0x147b4b[_0x1fa9('0x1b')]||undefined,'CampaignId':_0x147b4b[_0x1fa9('0x67')]||undefined};};exports[_0x1fa9('0x68')]=function(_0x2af211){if(_0x2af211===_0x1fa9('0x44')||_0x2af211===_0x1fa9('0x69')||_0x2af211===_0x1fa9('0x58')||_0x2af211===_0x1fa9('0x6a')||_0x2af211===_0x1fa9('0x6b')||_0x2af211===_0x1fa9('0x6c')||_0x2af211===_0x1fa9('0x37')||_0x2af211===_0x1fa9('0x41')||_0x2af211===_0x1fa9('0x18')||_0x2af211==='active'||_0x2af211==='calleridnum'||_0x2af211==='scheduledat'||_0x2af211==='countbusyretry'||_0x2af211===_0x1fa9('0x47')||_0x2af211===_0x1fa9('0x48')||_0x2af211===_0x1fa9('0x6d')||_0x2af211==='callback'||_0x2af211===_0x1fa9('0x6e')||_0x2af211==='callbackat'||_0x2af211===_0x1fa9('0x6f')||_0x2af211===_0x1fa9('0x51')||_0x2af211===_0x1fa9('0x52')||_0x2af211==='UserId'||_0x2af211===_0x1fa9('0x1b')||_0x2af211==='sipcallid'||_0x2af211===_0x1fa9('0x70')||_0x2af211==='xmd-queue'||_0x2af211===_0x1fa9('0x71')||_0x2af211==='xmd-listid'||_0x2af211===_0x1fa9('0x72')||_0x2af211===_0x1fa9('0x73')||_0x2af211===_0x1fa9('0x74')||_0x2af211===_0x1fa9('0x75')||_0x2af211===_0x1fa9('0x76')||_0x2af211==='xmd-contactid'||_0x2af211==='xmd-cdrtype'||_0x2af211===_0x1fa9('0x77')||_0x2af211===_0x1fa9('0x78')||_0x2af211===_0x1fa9('0x79')||_0x2af211===_0x1fa9('0x7a')||_0x2af211===_0x1fa9('0x7b')||_0x2af211===_0x1fa9('0x7c')||_0x2af211===_0x1fa9('0x7d')||_0x2af211===_0x1fa9('0x7e')||_0x2af211===_0x1fa9('0x7f')||_0x2af211===_0x1fa9('0x80')||_0x2af211===_0x1fa9('0x81')||_0x2af211===_0x1fa9('0x7a')||_0x2af211===_0x1fa9('0x7b')||_0x2af211===_0x1fa9('0x7c')||_0x2af211===_0x1fa9('0x7d')||_0x2af211==='rtpaudioqosloss'||_0x2af211===_0x1fa9('0x7f')||_0x2af211===_0x1fa9('0x80')||_0x2af211===_0x1fa9('0x81')||_0x2af211===_0x1fa9('0x82')||_0x2af211===_0x1fa9('0x83')||_0x2af211===_0x1fa9('0x2c')||_0x2af211==='statedesc'){return![];}return!![];};exports[_0x1fa9('0x84')]=function(_0xc037a3,_0x571ffb){var _0x4a715c,_0x3f915c,_0x64bdd5;if(_0x571ffb<=0x0){_0x571ffb=0x1;}_0x4a715c=new RegExp(_0x1fa9('0x85')+_0x571ffb+'}$');_0x3f915c=Math['pow'](0xa,_0x571ffb-0x1);_0x64bdd5=Math[_0x1fa9('0x86')](0xa,_0x571ffb)-0x1;return util[_0x1fa9('0x10')]('%s',_['replace'](_0xc037a3,_0x4a715c,_[_0x1fa9('0x87')](_0x3f915c,_0x64bdd5)));};exports['extractCalleridName']=function(_0x3ceb3a){var _0x1b1c9a=_0x3ceb3a[_0x1fa9('0x88')](/"(.*?)"/);return _0x1b1c9a?_0x1b1c9a[0x1]:_0x3ceb3a;};exports[_0x1fa9('0x89')]=function(_0x5953db){var _0x3abfdf=_0x5953db['match'](/<(.*?)>/);return _0x3abfdf?_0x3abfdf[0x1]:_0x5953db;};function buildNoAnswerEventPayload(_0x4e5854,_0xa32b61){var _0x431ac0=buildObj(_0x4e5854,_0x1fa9('0x8a'));if(!_[_0x1fa9('0xf')](_0xa32b61['variables'])){Object[_0x1fa9('0x8b')](_0xa32b61[_0x1fa9('0x8c')])[_0x1fa9('0x8d')](function(_0x58a3f9){_0x431ac0[_0x58a3f9[_0x1fa9('0x8e')]()]=_0xa32b61['variables'][_0x58a3f9];});}return _0x431ac0;}exports[_0x1fa9('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xb37e=['Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','getSeconds','answertime','isFailure','Failure','variablesAction','originate','channelAgent','xcally-motion-preview','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','clone','Global','scheduledAt','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','getDiff','milliseconds','diff','seconds','CampaignId','idContact','type','campaigntype','dialAnswer','active','scheduledat','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','env','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','loggerError','logger2','info','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname'];(function(_0x29ec6a,_0x3a01cd){var _0x564c31=function(_0x21cae8){while(--_0x21cae8){_0x29ec6a['push'](_0x29ec6a['shift']());}};_0x564c31(++_0x3a01cd);}(_0xb37e,0x178));var _0xeb37=function(_0x3dcd00,_0x357ae1){_0x3dcd00=_0x3dcd00-0x0;var _0x29e6af=_0xb37e[_0x3dcd00];return _0x29e6af;};'use strict';var util=require(_0xeb37('0x0'));var _=require('lodash');var moment=require(_0xeb37('0x1'));var logger=require(_0xeb37('0x2'))('preview');var ipAgi=process[_0xeb37('0x3')]['XCALLY_IP_AGI']||_0xeb37('0x4');var utils=require(_0xeb37('0x5'));exports[_0xeb37('0x6')]=function(_0x2046ea){return function(_0x268f63){logger[_0xeb37('0x7')](_0x2046ea,util['inspect'](_0x268f63,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5863dc,_0x5b6d1d){logger['info'](_0x5863dc,util[_0xeb37('0x8')](_0x5b6d1d,{'showHidden':![],'depth':null}));};exports[_0xeb37('0x9')]=function(_0x34790,_0x711422){logger[_0xeb37('0x7')](_0x34790,util[_0xeb37('0x8')](_0x711422,{'showHidden':![],'depth':null}));};exports[_0xeb37('0xa')]=function(_0x4c6c0a){return function(_0x30c5a2){logger[_0xeb37('0xb')](_0x4c6c0a,util['inspect'](_0x30c5a2,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2bce55,_0x1f63a1,_0x466928){return{'message':_0x2bce55,'unlock':_0x1f63a1,'active':_0x466928};};exports[_0xeb37('0xc')]=function(_0x59df5b,_0xaae49b,_0x20d847){if(!_['isUndefined'](_0x20d847)&&_0xeb37('0xd')===typeof _0x20d847&&!_[_0xeb37('0xe')](_0x20d847)){if(!_[_0xeb37('0xf')](_0xaae49b)&&_0xeb37('0xd')===typeof _0xaae49b&&!_['isEmpty'](_0xaae49b)){return util[_0xeb37('0x10')](_0xeb37('0x11'),_0xaae49b,_0x20d847);}return util['format'](_0xeb37('0x11'),_0x20d847,_0x20d847);}if(!_[_0xeb37('0xf')](_0x59df5b)&&'string'===typeof _0x59df5b&&!_[_0xeb37('0xe')](_0x59df5b)){return _0x59df5b;}return _0xeb37('0x12');};exports[_0xeb37('0x13')]=function(_0x3f6e63){if(_['isNil'](_0x3f6e63)){return![];}return _0x3f6e63;};exports[_0xeb37('0x14')]=function(_0x27c042,_0x543411,_0x5537cb,_0x5a36f2,_0x34d7c6,_0x1f53ad){var _0x4f5416={'XMD-QUEUE':_0x543411['Queue']?_0x543411[_0xeb37('0x15')][_0xeb37('0x16')]:'','XMD-CALLERID':_0x5a36f2,'XMD-CALLERID-PREVIEW':_0x1f53ad?util[_0xeb37('0x10')](_0xeb37('0x11'),_0x1f53ad[_0xeb37('0x17')],_0x1f53ad[_0xeb37('0x18')]):_0x5a36f2,'XMD-DIALID':_0x34d7c6,'XMD-CONTACTID':_0x543411[_0xeb37('0x19')],'XMD-CDRTYPE':_0xeb37('0x1a'),'CALLERID(all)':_0x5a36f2,'XMD-VOICEQUEUEID':_0x543411[_0xeb37('0x1b')],'XMD-DIALCHANNEL':_0x5537cb,'XMD-DIALTIMEOUT':_0x27c042[_0xeb37('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xeb37('0x10')](_0xeb37('0x1d'),_0x27c042[_0xeb37('0x1e')]?'g':'',_[_0xeb37('0xe')](_0x27c042[_0xeb37('0x1f')])?'':_0xeb37('0x20')),'XMD-DIALURL':_0x27c042[_0xeb37('0x21')]||'','XMD-AGI':_0x27c042['dialQueueProject']?util[_0xeb37('0x10')](_0xeb37('0x22'),ipAgi,_0x27c042[_0xeb37('0x23')]):_0xeb37('0x24'),'XMD-AGIAFTER':_0x27c042[_0xeb37('0x1e')]?util[_0xeb37('0x10')](_0xeb37('0x22'),ipAgi,_0x27c042[_0xeb37('0x1e')]):_0xeb37('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x1f53ad?_0x1f53ad['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1f53ad?_0x1f53ad[_0xeb37('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xeb37('0x26')};if(!_[_0xeb37('0xe')](_0x27c042[_0xeb37('0x1f')])){_0x4f5416[util[_0xeb37('0x10')]('%s',_0xeb37('0x27'))]=_0x27c042[_0xeb37('0x1f')];_0x4f5416[util['format']('%s',_0xeb37('0x28'))]=_0x34d7c6;}return _0x4f5416;};exports[_0xeb37('0x29')]=function(_0x3b223d){var _0x5db916={};for(var _0x52bb88 in _0x3b223d){if(_0x3b223d[_0xeb37('0x2a')](_0x52bb88)){_0x5db916[util[_0xeb37('0x10')]('%s',_[_0xeb37('0x2b')](_0x52bb88))]=_0x3b223d[_0x52bb88];}}return{'variables':_0x5db916};};exports[_0xeb37('0x2c')]=function(_0x2ff991,_0x1b43cc){if(!_[_0xeb37('0x2d')](_0x2ff991)){if(_0x2ff991[_0xeb37('0x2a')]('originated')){if(_0x2ff991['originated']>0x0){_0x2ff991[_0xeb37('0x2e')]-=0x1;}else{logger[_0xeb37('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1b43cc);}}}else{logger['error'](_0xeb37('0x2f'),_0x1b43cc);}};exports[_0xeb37('0x30')]=function(_0x52ee5b){var _0x18d609=moment()[_0xeb37('0x10')](_0xeb37('0x31'));_0x52ee5b[_0xeb37('0x32')]=0xd;_0x52ee5b[_0xeb37('0x33')]='Blacklist';_0x52ee5b[_0xeb37('0x34')]=_0x18d609;_0x52ee5b[_0xeb37('0x35')]=_0x18d609;_0x52ee5b[_0xeb37('0x36')]=_0x18d609;};exports[_0xeb37('0x37')]=function(_0x48118d,_0x176a95,_0x20277b){var _0x31f942=moment()[_0xeb37('0x10')](_0xeb37('0x31'));_0x48118d[_0xeb37('0x32')]=_0x176a95;_0x48118d['statedesc']=_0x20277b;_0x48118d[_0xeb37('0x35')]=_0x31f942;_0x48118d[_0xeb37('0x38')]=utils['getSeconds'](_0x48118d[_0xeb37('0x35')],_0x48118d['starttime']);};exports[_0xeb37('0x39')]=function(_0x3a428a,_0x52c18c,_0x5ae8c9){_0x3a428a[_0xeb37('0x3a')]=_0x52c18c;_0x3a428a[_0xeb37('0x3b')]=_0x5ae8c9;};exports[_0xeb37('0x3c')]=function(_0x283fb3,_0x469a8f,_0xbf26a0){var _0x22c94f=moment()[_0xeb37('0x10')](_0xeb37('0x31'));_0x283fb3[_0xeb37('0x32')]=_0x469a8f;_0x283fb3[_0xeb37('0x33')]=_0xbf26a0;_0x283fb3[_0xeb37('0x35')]=_0x283fb3['responsetime']?_0x283fb3[_0xeb37('0x35')]:_0x22c94f;_0x283fb3[_0xeb37('0x36')]=_0x283fb3['endtime']?_0x283fb3[_0xeb37('0x36')]:_0x22c94f;_0x283fb3[_0xeb37('0x38')]=utils[_0xeb37('0x3d')](_0x283fb3['responsetime']||0x0,_0x283fb3[_0xeb37('0x34')]||0x0);_0x283fb3['talktime']=_0x283fb3[_0xeb37('0x3e')]?utils['getSeconds'](_0x283fb3[_0xeb37('0x36')],_0x283fb3[_0xeb37('0x3e')]):0x0;};exports[_0xeb37('0x3f')]=function(_0x5beb60){return _0x5beb60===_0xeb37('0x40');};exports[_0xeb37('0x41')]=function(_0x42c425,_0x211a5b,_0x480a55,_0x129efc,_0x3cd27b){var _0x20be6a=_0x129efc?'RECALL':_0x42c425[_0xeb37('0x17')];_0x20be6a=_0x3cd27b?'BOOKED':_0x20be6a;return{'actionid':_0x42c425['uniqueid'],'action':_0xeb37('0x42'),'channel':_0x42c425[_0xeb37('0x43')],'callerid':util[_0xeb37('0x10')](_0xeb37('0x11'),_0x20be6a,_0x42c425[_0xeb37('0x18')]),'Exten':_0xeb37('0x44'),'Context':'from-sip','Priority':'1','variable':_0x480a55,'timeout':(_0x211a5b[_0xeb37('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42c425[_0xeb37('0x46')]};};exports[_0xeb37('0x47')]=function(_0x4994cf){return _0x4994cf[_0xeb37('0x48')]+_0x4994cf[_0xeb37('0x49')]+_0x4994cf['countnoanswerretry']+_0x4994cf['countagentrejectretry']+_0x4994cf[_0xeb37('0x4a')];};exports['cloneAction']=function(_0x29e85e){var _0x793df6=_[_0xeb37('0x4b')](_0x29e85e);_0x793df6['state']=0xf;_0x793df6[_0xeb37('0x33')]=_0xeb37('0x4c');return _0x793df6;};exports[_0xeb37('0x4d')]=function(_0x2f5f1e,_0x18c538,_0x17a4d6){var _0x17a521={};_0x17a521[_0x18c538]=_0x2f5f1e[_0x18c538];_0x17a521['active']=![];_0x17a521['scheduledat']=moment()['add'](_0x17a4d6,_0xeb37('0x4e'))[_0xeb37('0x10')](_0xeb37('0x31'));_0x17a521[_0xeb37('0x19')]=_0x2f5f1e['ContactId'];_0x17a521[_0xeb37('0x4f')]=_0x2f5f1e[_0xeb37('0x4f')];_0x17a521['VoiceQueueId']=_0x2f5f1e[_0xeb37('0x1b')]||undefined;return _0x17a521;};exports['decrementTalkink']=function(_0x3581f1,_0x214231){if(!_[_0xeb37('0x2d')](_0x3581f1)){if(_0x3581f1['pTalking']>0x0){_0x3581f1[_0xeb37('0x50')]-=0x1;}else{logger['error'](_0x214231,_0xeb37('0x51'));}}else{logger[_0xeb37('0x7')](_0x214231,_0xeb37('0x52'));}};exports['IsNotLoggedIn']=function(_0xe377db){if(_0xe377db<=0x0){return!![];}return![];};function buildObj(_0x1b7c62,_0x5decef,_0xd32be0){_0x1b7c62[_0xeb37('0x53')]=_0x5decef;_0x1b7c62[_0xeb37('0x16')]=_0x1b7c62[_0xeb37('0x54')];_0x1b7c62[_0xeb37('0x55')]=_0x1b7c62[_0xeb37('0x43')];_0x1b7c62['motionChannel']=_0xeb37('0x56');if(_0xd32be0){_0x1b7c62['mandatoryDisposition']=_0xd32be0[_0xeb37('0x57')];}return _0x1b7c62;}exports[_0xeb37('0x58')]=buildObj;exports[_0xeb37('0x59')]=function(_0x296a18){var _0x583d17={};_0x583d17['queue']=_0x296a18[_0xeb37('0x54')];_0x583d17['interface']=_0x296a18[_0xeb37('0x43')];_0x583d17[_0xeb37('0x46')]=_0x296a18[_0xeb37('0x46')];return _0x583d17;};exports[_0xeb37('0x5a')]=function(_0x492c23){var _0xbaf4da=[];for(var _0x12accc in _0x492c23){if(_0x492c23[_0xeb37('0x2a')](_0x12accc)){if(!_[_0xeb37('0x2d')](_0x492c23[_0x12accc])&&_0x492c23[_0x12accc][_0xeb37('0x32')]===_0xeb37('0x5b')&&_0x492c23[_0x12accc]['status']===_0xeb37('0x5c')){_0xbaf4da['push'](_0x492c23[_0x12accc]['id']);}}}return _0xbaf4da;};exports[_0xeb37('0x5d')]=function(_0x4f11d){var _0x5aeec5=moment()[_0xeb37('0x5e')](0x0);var _0x2feb0d=moment(_0x4f11d)[_0xeb37('0x5e')](0x0);return _0x5aeec5[_0xeb37('0x5f')](_0x2feb0d,_0xeb37('0x60'));};exports['createBody']=function(_0x4e0dcf){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e0dcf[_0xeb37('0x19')],'ListId':_0x4e0dcf[_0xeb37('0x4f')],'VoiceQueueId':_0x4e0dcf[_0xeb37('0x1b')]||undefined,'CampaignId':_0x4e0dcf[_0xeb37('0x61')]||undefined};};exports['filterKey']=function(_0x4f8945){if(_0x4f8945===_0xeb37('0x46')||_0x4f8945===_0xeb37('0x62')||_0x4f8945===_0xeb37('0x54')||_0x4f8945===_0xeb37('0x63')||_0x4f8945===_0xeb37('0x64')||_0x4f8945===_0xeb37('0x65')||_0x4f8945===_0xeb37('0x3a')||_0x4f8945===_0xeb37('0x43')||_0x4f8945==='calleridname'||_0x4f8945===_0xeb37('0x66')||_0x4f8945==='calleridnum'||_0x4f8945===_0xeb37('0x67')||_0x4f8945===_0xeb37('0x48')||_0x4f8945==='countcongestionretry'||_0x4f8945===_0xeb37('0x68')||_0x4f8945===_0xeb37('0x69')||_0x4f8945===_0xeb37('0x6a')||_0x4f8945==='callbackuniqueid'||_0x4f8945===_0xeb37('0x6b')||_0x4f8945===_0xeb37('0x6c')||_0x4f8945===_0xeb37('0x19')||_0x4f8945===_0xeb37('0x4f')||_0x4f8945===_0xeb37('0x3b')||_0x4f8945===_0xeb37('0x1b')||_0x4f8945===_0xeb37('0x6d')||_0x4f8945===_0xeb37('0x6e')||_0x4f8945===_0xeb37('0x6f')||_0x4f8945===_0xeb37('0x70')||_0x4f8945===_0xeb37('0x71')||_0x4f8945==='xmd-dialurl'||_0x4f8945===_0xeb37('0x72')||_0x4f8945===_0xeb37('0x73')||_0x4f8945===_0xeb37('0x74')||_0x4f8945==='xmd-dialchannel'||_0x4f8945==='xmd-contactid'||_0x4f8945==='xmd-cdrtype'||_0x4f8945==='xmd-callerid'||_0x4f8945===_0xeb37('0x75')||_0x4f8945===_0xeb37('0x76')||_0x4f8945===_0xeb37('0x77')||_0x4f8945==='rtpaudioqosbridged'||_0x4f8945===_0xeb37('0x78')||_0x4f8945===_0xeb37('0x79')||_0x4f8945===_0xeb37('0x7a')||_0x4f8945===_0xeb37('0x7b')||_0x4f8945==='rtpaudioqosrtt'||_0x4f8945===_0xeb37('0x7c')||_0x4f8945==='rtpaudioqos'||_0x4f8945===_0xeb37('0x7d')||_0x4f8945==='rtpaudioqosjitter'||_0x4f8945===_0xeb37('0x79')||_0x4f8945===_0xeb37('0x7a')||_0x4f8945===_0xeb37('0x7b')||_0x4f8945==='rtpaudioqosrtt'||_0x4f8945==='rtpaudioqosrttbridged'||_0x4f8945===_0xeb37('0x7e')||_0x4f8945==='bridgepvtcallid'||_0x4f8945===_0xeb37('0x32')||_0x4f8945===_0xeb37('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x55a445,_0x3b97ee){var _0x5bc7b3,_0x569dfb,_0x48e6cf;if(_0x3b97ee<=0x0){_0x3b97ee=0x1;}_0x5bc7b3=new RegExp(_0xeb37('0x7f')+_0x3b97ee+'}$');_0x569dfb=Math[_0xeb37('0x80')](0xa,_0x3b97ee-0x1);_0x48e6cf=Math[_0xeb37('0x80')](0xa,_0x3b97ee)-0x1;return util[_0xeb37('0x10')]('%s',_['replace'](_0x55a445,_0x5bc7b3,_['random'](_0x569dfb,_0x48e6cf)));};exports[_0xeb37('0x81')]=function(_0x2d68d1){var _0x522d01=_0x2d68d1[_0xeb37('0x82')](/"(.*?)"/);return _0x522d01?_0x522d01[0x1]:_0x2d68d1;};exports[_0xeb37('0x83')]=function(_0x344d22){var _0x57fc80=_0x344d22[_0xeb37('0x82')](/<(.*?)>/);return _0x57fc80?_0x57fc80[0x1]:_0x344d22;};function buildNoAnswerEventPayload(_0x1bb552,_0x23ad24){var _0x49ff1b=buildObj(_0x1bb552,_0xeb37('0x84'));if(!_[_0xeb37('0xe')](_0x23ad24[_0xeb37('0x85')])){Object[_0xeb37('0x86')](_0x23ad24[_0xeb37('0x85')])[_0xeb37('0x87')](function(_0x1bc529){_0x49ff1b[_0x1bc529[_0xeb37('0x88')]()]=_0x23ad24[_0xeb37('0x85')][_0x1bc529];});}return _0x49ff1b;}exports[_0xeb37('0x89')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 690cbcb..2efd60b 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 _0x0cc2=['voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload'];(function(_0xf7c2a9,_0x9337fe){var _0x367b36=function(_0x57636c){while(--_0x57636c){_0xf7c2a9['push'](_0xf7c2a9['shift']());}};_0x367b36(++_0x9337fe);}(_0x0cc2,0x107));var _0x20cc=function(_0x399661,_0x59989c){_0x399661=_0x399661-0x0;var _0x487e2a=_0x0cc2[_0x399661];return _0x487e2a;};'use strict';exports[_0x20cc('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x20cc('0x1'),'required':!![]},'penalty':{'type':_0x20cc('0x2'),'required':![]},'paused':{'type':_0x20cc('0x3'),'required':![]}};exports[_0x20cc('0x4')]={'queue':{'type':_0x20cc('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x20cc('0x5')]={'interface':{'type':_0x20cc('0x1'),'required':!![]},'paused':{'type':_0x20cc('0x3')},'reason':{'type':_0x20cc('0x1'),'required':![]}};exports[_0x20cc('0x6')]={'module':{'type':'string','required':![]}};exports[_0x20cc('0x7')]={'uniqueid':{'type':_0x20cc('0x1'),'required':!![]}};exports[_0x20cc('0x8')]={'uniqueid':{'type':_0x20cc('0x1'),'required':!![]},'filename':{'type':_0x20cc('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x20cc('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x20cc('0x9')]={'uniqueid':{'type':_0x20cc('0x1'),'required':!![]},'exten':{'type':_0x20cc('0x1'),'required':!![]},'context':{'type':_0x20cc('0x1')}}; \ No newline at end of file +var _0x00f3=['voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicequeuechannelhangup'];(function(_0x1eb294,_0x5e033b){var _0x3a3baa=function(_0x45d590){while(--_0x45d590){_0x1eb294['push'](_0x1eb294['shift']());}};_0x3a3baa(++_0x5e033b);}(_0x00f3,0x1a8));var _0x300f=function(_0x70700,_0x53fdd9){_0x70700=_0x70700-0x0;var _0x249860=_0x00f3[_0x70700];return _0x249860;};'use strict';exports[_0x300f('0x0')]={'queue':{'type':_0x300f('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x300f('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x300f('0x2'),'required':![]}};exports[_0x300f('0x3')]={'queue':{'type':_0x300f('0x1'),'required':!![]},'interface':{'type':_0x300f('0x1'),'required':!![]}};exports[_0x300f('0x4')]={'interface':{'type':_0x300f('0x1'),'required':!![]},'paused':{'type':_0x300f('0x2')},'reason':{'type':_0x300f('0x1'),'required':![]}};exports[_0x300f('0x5')]={'module':{'type':_0x300f('0x1'),'required':![]}};exports[_0x300f('0x6')]={'uniqueid':{'type':_0x300f('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x300f('0x1'),'required':!![]},'filename':{'type':_0x300f('0x1')},'format':{'type':_0x300f('0x1')},'mixmonitorid':{'type':_0x300f('0x1')}};exports[_0x300f('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x300f('0x8')]={'uniqueid':{'type':_0x300f('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x300f('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d28564a..3264f0e 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x1fcdcd,_0x1ed53e){var _0x352eb0=function(_0x170b93){while(--_0x170b93){_0x1fcdcd['push'](_0x1fcdcd['shift']());}};_0x352eb0(++_0x1ed53e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xb10b[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x41ac4e,_0x3ca43d){var _0x201a0b=function(_0x4315a0){while(--_0x4315a0){_0x41ac4e['push'](_0x41ac4e['shift']());}};_0x201a0b(++_0x3ca43d);}(_0xdb28,0x106));var _0x8db2=function(_0x329a4c,_0x60f265){_0x329a4c=_0x329a4c-0x0;var _0x298f65=_0xdb28[_0x329a4c];return _0x298f65;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f57235f..33d4f3b 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 _0x1274=['assign','hasOwnProperty'];(function(_0x52a16d,_0x368b10){var _0x587944=function(_0x2210c8){while(--_0x2210c8){_0x52a16d['push'](_0x52a16d['shift']());}};_0x587944(++_0x368b10);}(_0x1274,0xac));var _0x4127=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1274[_0x3dd15e];return _0x231fd0;};'use strict';function mergeDBDataToRealtime(_0x3ca336,_0x177078){var _0x144695=Object[_0x4127('0x0')]({},_0x3ca336);for(var _0x4ee8ae in _0x177078){if(_0x144695[_0x4127('0x1')](_0x4ee8ae)){_0x144695[_0x4ee8ae]=_0x177078[_0x4ee8ae];}}return _0x144695;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0xb390=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x5e086c,_0xf3030b){var _0x2b3a94=function(_0x38e399){while(--_0x38e399){_0x5e086c['push'](_0x5e086c['shift']());}};_0x2b3a94(++_0xf3030b);}(_0xb390,0x168));var _0x0b39=function(_0x15fffd,_0x4177f0){_0x15fffd=_0x15fffd-0x0;var _0x232607=_0xb390[_0x15fffd];return _0x232607;};'use strict';function mergeDBDataToRealtime(_0x4992e7,_0x107f2b){var _0x5509ce=Object[_0x0b39('0x0')]({},_0x4992e7);for(var _0x2877fb in _0x107f2b){if(_0x5509ce[_0x0b39('0x1')](_0x2877fb)){_0x5509ce[_0x2877fb]=_0x107f2b[_0x2877fb];}}return _0x5509ce;}exports[_0x0b39('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 d9e349e..197c4ef 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 _0x7674=['attendedTransfer','findAgent','find','accountcode','name','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','isNil','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','split','outbound','destination','exten','type','dialer','lastdata','queue','context','callerid','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','monitor','monitors','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','create','startsWith','substring','indexOf','mobile','phone','blindTransfer','transfererlinkedid','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','voiceDialReport','blindtransfer','attendedtransfer'];(function(_0x23bf9a,_0x5df854){var _0x3233f3=function(_0x31548d){while(--_0x31548d){_0x23bf9a['push'](_0x23bf9a['shift']());}};_0x3233f3(++_0x5df854);}(_0x7674,0xf3));var _0x4767=function(_0x3fd66d,_0x410d26){_0x3fd66d=_0x3fd66d-0x0;var _0x5a6464=_0x7674[_0x3fd66d];return _0x5a6464;};'use strict';var _=require(_0x4767('0x0'));var moment=require(_0x4767('0x1'));var util=require('util');var config=require(_0x4767('0x2'));var ami=require(_0x4767('0x3'));var RpcVoiceAgentReport=require(_0x4767('0x4'));var RpcVoiceCallReport=require(_0x4767('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x4767('0x6'));var RpcVoiceQueueReport=require(_0x4767('0x7'));var RpcVoiceRecording=require(_0x4767('0x8'));var RpcVoiceTransferReport=require(_0x4767('0x9'));var VoiceQueueReport=require(_0x4767('0xa'));var VoiceCallReport=require(_0x4767('0xb'));var VoiceAgentReport=require(_0x4767('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x4767('0xd'));function Report(_0x2d9dbe){this['realtime']=_0x2d9dbe;this[_0x4767('0xe')]=_0x2d9dbe[_0x4767('0xe')];this[_0x4767('0xf')]=_0x2d9dbe[_0x4767('0xf')];}Report[_0x4767('0x10')][_0x4767('0x11')]=function(_0x519890){var _0xf5bc97=new VoiceQueueReport(this['realtime']);var _0x232a1f=new VoiceAgentReport(this[_0x4767('0x12')]);var _0x4b2cc0=new VoiceDialReport(this[_0x4767('0x12')]);var _0xdb5302=new VoiceCallReport(this[_0x4767('0x12')]);var _0xc4b628=new UserReport(this[_0x4767('0x12')]);if(config[_0x4767('0x13')]&&config['xdr'][_0x4767('0x14')]){ami['on'](_0x4767('0x15'),this['voiceQueueReport']['bind'](this));ami['on'](_0x4767('0x16'),this[_0x4767('0x17')]['bind'](this));ami['on'](_0x4767('0x18'),this[_0x4767('0x19')][_0x4767('0x1a')](this));ami['on']('custom:voiceDialReport',this[_0x4767('0x1b')][_0x4767('0x1a')](this));ami['on'](_0x4767('0x1c'),this['blindTransfer'][_0x4767('0x1a')](this));ami['on'](_0x4767('0x1d'),this[_0x4767('0x1e')][_0x4767('0x1a')](this));}};Report[_0x4767('0x10')][_0x4767('0x1f')]=function(_0x1fb720){var _0x415b59;_0x415b59=_[_0x4767('0x20')](this[_0x4767('0xe')],function(_0x28d574){return _0x28d574['accountcode']==_0x1fb720||_0x28d574['name']==_0x1fb720;});if(_['isNil'](_0x415b59)){var _0x392841=_[_0x4767('0x20')](this[_0x4767('0xf')],function(_0x104615){return _0x104615[_0x4767('0x21')]==_0x1fb720||_0x104615[_0x4767('0x22')]==_0x1fb720;});if(_0x392841){_0x415b59=_[_0x4767('0x20')](this['agents'],function(_0xafbb10){return _0xafbb10[_0x4767('0x23')]==util['format'](_0x4767('0x24'),_0x392841[_0x4767('0x22')]);});}}return _0x415b59;};Report[_0x4767('0x10')][_0x4767('0x25')]=function(_0xa0eb8){for(var _0x4cf83b=0x0;_0x4cf83b<_0xa0eb8[_0x4767('0x26')];_0x4cf83b+=0x1){var _0x411f7a=this['findAgent'](_0xa0eb8[_0x4cf83b][_0x4767('0x27')]);if(_0x411f7a){_0xa0eb8[_0x4cf83b][_0x4767('0x21')]=_0x411f7a['accountcode'];_0xa0eb8[_0x4cf83b][_0x4767('0x28')]=!![];_0xa0eb8[_0x4cf83b][_0x4767('0x29')]=_0x411f7a['name'];_0xa0eb8[_0x4cf83b]['interface']=_[_0x4767('0x2a')](_0x411f7a[_0x4767('0x23')])?util[_0x4767('0x2b')](_0x4767('0x24'),_0x411f7a[_0x4767('0x22')]):_0x411f7a[_0x4767('0x23')];if(_0xa0eb8[_0x4cf83b][_0x4767('0x2c')]){_0xa0eb8[_0x4cf83b][_0x4767('0x2d')]=moment()['format'](_0x4767('0x2e'));}if(_0xa0eb8[_0x4cf83b][_0x4767('0x2f')]){_0xa0eb8[_0x4cf83b]['queuecallerexitAt']=moment()[_0x4767('0x2b')](_0x4767('0x2e'));}RpcMemberReport['voiceQueueReport'](_0xa0eb8[_0x4cf83b]);}RpcVoiceQueueReport['create'](_0xa0eb8[_0x4cf83b]);}};function extractCalleridNumber(_0x202278){var _0x36dad8=_0x202278[_0x4767('0x30')](/<(.*?)>/);return _0x36dad8?_0x36dad8[0x1]:_0x202278;}Report[_0x4767('0x10')][_0x4767('0x31')]=function(_0x59d6a2){for(var _0x542781=0x0;_0x542781','calleridname','transfers','linkedid','transfereelinkedid','type','getCallType','UserId','membername','monitor'];(function(_0x5e6e50,_0x29ca09){var _0x3e8434=function(_0x379499){while(--_0x379499){_0x5e6e50['push'](_0x5e6e50['shift']());}};_0x3e8434(++_0x29ca09);}(_0x6743,0x6d));var _0x3674=function(_0x141e5f,_0x216927){_0x141e5f=_0x141e5f-0x0;var _0x5bea96=_0x6743[_0x141e5f];return _0x5bea96;};'use strict';var _=require('lodash');var moment=require(_0x3674('0x0'));var util=require(_0x3674('0x1'));var config=require('../../../config/environment');var ami=require(_0x3674('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x3674('0x3'));var RpcVoiceDialReport=require(_0x3674('0x4'));var RpcMemberReport=require(_0x3674('0x5'));var RpcVoiceQueueReport=require(_0x3674('0x6'));var RpcVoiceRecording=require(_0x3674('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x3674('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x3674('0x9'));var UserReport=require('./userReport');function Report(_0x2b69b6){this[_0x3674('0xa')]=_0x2b69b6;this[_0x3674('0xb')]=_0x2b69b6[_0x3674('0xb')];this[_0x3674('0xc')]=_0x2b69b6[_0x3674('0xc')];}Report[_0x3674('0xd')][_0x3674('0xe')]=function(_0x2b82f4){var _0x2e18bb=new VoiceQueueReport(this['realtime']);var _0x2f56bb=new VoiceAgentReport(this[_0x3674('0xa')]);var _0x468faa=new VoiceDialReport(this[_0x3674('0xa')]);var _0x5950bf=new VoiceCallReport(this[_0x3674('0xa')]);var _0x4e1ca5=new UserReport(this[_0x3674('0xa')]);if(config[_0x3674('0xf')]&&config[_0x3674('0xf')][_0x3674('0x10')]){ami['on'](_0x3674('0x11'),this[_0x3674('0x12')][_0x3674('0x13')](this));ami['on'](_0x3674('0x14'),this[_0x3674('0x15')][_0x3674('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x3674('0x16')][_0x3674('0x13')](this));ami['on'](_0x3674('0x17'),this[_0x3674('0x18')]['bind'](this));ami['on'](_0x3674('0x19'),this[_0x3674('0x1a')]['bind'](this));ami['on']('attendedtransfer',this[_0x3674('0x1b')][_0x3674('0x13')](this));}};Report[_0x3674('0xd')][_0x3674('0x1c')]=function(_0x4939b2){var _0x51c7aa;_0x51c7aa=_[_0x3674('0x1d')](this[_0x3674('0xb')],function(_0x28ac73){return _0x28ac73[_0x3674('0x1e')]==_0x4939b2||_0x28ac73[_0x3674('0x1f')]==_0x4939b2;});if(_[_0x3674('0x20')](_0x51c7aa)){var _0x197094=_['find'](this[_0x3674('0xc')],function(_0x63ecfc){return _0x63ecfc[_0x3674('0x1e')]==_0x4939b2||_0x63ecfc['name']==_0x4939b2;});if(_0x197094){_0x51c7aa=_[_0x3674('0x1d')](this[_0x3674('0xb')],function(_0x38f01d){return _0x38f01d[_0x3674('0x21')]==util[_0x3674('0x22')](_0x3674('0x23'),_0x197094[_0x3674('0x1f')]);});}}return _0x51c7aa;};Report['prototype'][_0x3674('0x12')]=function(_0x48fd47){for(var _0x3cd119=0x0;_0x3cd119<_0x48fd47[_0x3674('0x24')];_0x3cd119+=0x1){var _0x840ab4=this['findAgent'](_0x48fd47[_0x3cd119][_0x3674('0x25')]);if(_0x840ab4){_0x48fd47[_0x3cd119][_0x3674('0x1e')]=_0x840ab4[_0x3674('0x1e')];_0x48fd47[_0x3cd119][_0x3674('0x26')]=!![];_0x48fd47[_0x3cd119][_0x3674('0x27')]=_0x840ab4[_0x3674('0x1f')];_0x48fd47[_0x3cd119][_0x3674('0x21')]=_[_0x3674('0x20')](_0x840ab4[_0x3674('0x21')])?util[_0x3674('0x22')](_0x3674('0x23'),_0x840ab4['name']):_0x840ab4[_0x3674('0x21')];if(_0x48fd47[_0x3cd119][_0x3674('0x28')]){_0x48fd47[_0x3cd119][_0x3674('0x29')]=moment()[_0x3674('0x22')](_0x3674('0x2a'));}if(_0x48fd47[_0x3cd119][_0x3674('0x2b')]){_0x48fd47[_0x3cd119][_0x3674('0x2c')]=moment()[_0x3674('0x22')](_0x3674('0x2a'));}RpcMemberReport[_0x3674('0x12')](_0x48fd47[_0x3cd119]);}RpcVoiceQueueReport[_0x3674('0x2d')](_0x48fd47[_0x3cd119]);}};function extractCalleridNumber(_0x5add49){var _0x5ed502=_0x5add49[_0x3674('0x2e')](/<(.*?)>/);return _0x5ed502?_0x5ed502[0x1]:_0x5add49;}Report['prototype'][_0x3674('0x2f')]=function(_0x11aef3){for(var _0x4c702d=0x0;_0x4c702d0x0?!![]:![];if(!_0x40b392){return this['syncQueueSummaryComplete'](this['summary'][_0xb9c7('0x6b')]);}};VoiceQueueReport['prototype'][_0xb9c7('0x1b')]=function(_0x2dc553){var _0x5f45ae=this['summary']['id'];if(this['summary']['queuestatus'][_0x5f45ae]&&this[_0xb9c7('0x14')][_0xb9c7('0x64')][_0x5f45ae][_0x2dc553[_0xb9c7('0x5e')]]){this['summary'][_0xb9c7('0x64')][_0x5f45ae][_0x2dc553[_0xb9c7('0x5e')]][_0xb9c7('0xf')][_0xb9c7('0x6c')](_0x2dc553);}};VoiceQueueReport['prototype'][_0xb9c7('0x17')]=function(_0x22fc7a){var _0x2a2cfe=this;try{if(this['isNotNull'](_0x22fc7a)&&this[_0xb9c7('0x6d')](_0x22fc7a[_0xb9c7('0x50')])){logger[_0xb9c7('0x4b')](_0xb9c7('0x6e'),util[_0xb9c7('0x42')](_0x22fc7a,{'showHidden':![],'depth':null}));var _0x861642=this[_0xb9c7('0x12')][_0x22fc7a[_0xb9c7('0x50')]];if(_0x861642){logger[_0xb9c7('0x4b')](_0xb9c7('0x6f'),_0x861642['name']);this['summary'][_0xb9c7('0x5c')][_0x861642[_0xb9c7('0x59')]]={'summaryEvent':_0x22fc7a};this[_0xb9c7('0x14')][_0xb9c7('0x6a')]+=0x1;return ami[_0xb9c7('0x5b')]({'action':'queuestatus','queue':_0x861642[_0xb9c7('0x59')]})[_0xb9c7('0x70')](function(_0x1a09f7){if(!_0x2a2cfe['summary']['queuestatus'][_0x22fc7a['actionid']]){_0x2a2cfe[_0xb9c7('0x14')]['queuestatus'][_0x22fc7a[_0xb9c7('0x5e')]]={};}_0x2a2cfe[_0xb9c7('0x14')][_0xb9c7('0x64')][_0x22fc7a[_0xb9c7('0x5e')]][_0x1a09f7[_0xb9c7('0x5e')]]={'queue':_0x861642[_0xb9c7('0x59')],'agents':[]};})[_0xb9c7('0x3f')](function(_0x267dbb){throw _0x267dbb;});}}}catch(_0x54b671){logger[_0xb9c7('0x43')]('[voiceQueueReport][queuesummary]',util[_0xb9c7('0x42')](_0x54b671,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x19')]=function(_0x5f500c){if(this[_0xb9c7('0x14')]['statusRequests']>0x0){this['summary'][_0xb9c7('0x6b')]=_0x5f500c;return;}logger[_0xb9c7('0x4b')](_0xb9c7('0x71'),util[_0xb9c7('0x42')](_0x5f500c,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0xb9c7('0x49')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x1f')]=function(_0x5b8f35){try{if(this[_0xb9c7('0x6d')](_0x5b8f35)){logger['debug'](_0xb9c7('0x72'),_0x5b8f35[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x5b8f35,{'showHidden':![],'depth':null}));if(_[_0xb9c7('0x5a')](this['queueReports'][_0x5b8f35['uniqueid']])){this['queueReports'][_0x5b8f35['uniqueid']]=[];}if(_[_0xb9c7('0x5a')](this[_0xb9c7('0x10')][_0x5b8f35[_0xb9c7('0x4e')]])){this['channels'][_0x5b8f35[_0xb9c7('0x4e')]]={};}var _0x43fa8d=new QueueReport();_0x43fa8d[_0xb9c7('0x50')]=_0x5b8f35[_0xb9c7('0x50')];_0x43fa8d['type']=this[_0xb9c7('0x12')][_0x43fa8d[_0xb9c7('0x50')]]&&this[_0xb9c7('0x12')][_0x43fa8d[_0xb9c7('0x50')]][_0xb9c7('0x65')]?this['voiceQueues'][_0x43fa8d[_0xb9c7('0x50')]]['type']||_0xb9c7('0x66'):_0xb9c7('0x66');_0x43fa8d['queuecallerjoinAt']=moment()[_0xb9c7('0x58')](_0xb9c7('0x73'));_0x43fa8d[_0xb9c7('0x74')]=_0x5b8f35['position'];_0x43fa8d[_0xb9c7('0x75')]=_0x5b8f35[_0xb9c7('0x75')];_0x43fa8d[_0xb9c7('0x4e')]=_0x5b8f35[_0xb9c7('0x4e')];_0x43fa8d[_0xb9c7('0x76')]=this[_0xb9c7('0x10')][_0x5b8f35[_0xb9c7('0x4e')]][_0xb9c7('0x76')];logger[_0xb9c7('0x77')](_0xb9c7('0x78'),_0x43fa8d['queue'],_0x43fa8d[_0xb9c7('0x65')]);Object[_0xb9c7('0x79')](_0x43fa8d,_[_0xb9c7('0x7a')](_0x5b8f35,_[_0xb9c7('0x7b')](_0x43fa8d)));this[_0xb9c7('0xe')][_0x5b8f35[_0xb9c7('0x4e')]]['push'](_0x43fa8d);this[_0xb9c7('0x10')][_0x5b8f35[_0xb9c7('0x4e')]]=_0x43fa8d;this[_0xb9c7('0x4a')](_0x43fa8d,_0xb9c7('0x7c'));}}catch(_0x2daddd){logger['error'](_0xb9c7('0x72'),_0x5b8f35[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x2daddd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x7d')]=function(_0x38516a){try{if(this[_0xb9c7('0x6d')](_0x38516a)){logger['debug'](_0xb9c7('0x7e'),_0x38516a[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x38516a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x38516a[_0xb9c7('0x4e')]]){var _0x3254a7=_[_0xb9c7('0x7f')](this[_0xb9c7('0xe')][_0x38516a['uniqueid']]);_0x3254a7[_0xb9c7('0x3a')]=![];_0x3254a7['queuecallercompleteAt']=null;_0x3254a7[_0xb9c7('0x80')]=_0x38516a['holdtime'];_0x3254a7[_0xb9c7('0x81')]=_0x38516a[_0xb9c7('0x81')];_0x3254a7[_0xb9c7('0x20')]=!![];_0x3254a7[_0xb9c7('0x82')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3254a7[_0xb9c7('0x53')]=_0xb9c7('0x83');_0x3254a7[_0xb9c7('0x84')]=null;logger[_0xb9c7('0x77')](_0xb9c7('0x85'),_0x3254a7[_0xb9c7('0x50')],_0x3254a7['type']);this[_0xb9c7('0x10')][_0x38516a[_0xb9c7('0x4e')]]=_0x3254a7;this[_0xb9c7('0x47')](_0x3254a7,_0xb9c7('0x20'));}}}catch(_0x461608){logger[_0xb9c7('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x38516a[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x461608,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x22')]=function(_0x1b9b44){try{if(this['isNotNull'](_0x1b9b44)){logger[_0xb9c7('0x4b')](_0xb9c7('0x86'),_0x1b9b44[_0xb9c7('0x4e')],util['inspect'](_0x1b9b44,{'showHidden':![],'depth':null}));if(this[_0xb9c7('0xe')][_0x1b9b44['uniqueid']]){var _0x241f58=_[_0xb9c7('0x7f')](this[_0xb9c7('0xe')][_0x1b9b44[_0xb9c7('0x4e')]]);_0x241f58['queuecallerleaveAt']=moment()[_0xb9c7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x241f58['connectedlinenum']=_0x1b9b44[_0xb9c7('0x87')];_0x241f58[_0xb9c7('0x88')]=_0x1b9b44[_0xb9c7('0x88')];logger[_0xb9c7('0x77')](_0xb9c7('0x89'),_0x241f58[_0xb9c7('0x50')],_0x241f58[_0xb9c7('0x65')],_0x1b9b44[_0xb9c7('0x87')],_0x1b9b44[_0xb9c7('0x88')]);this[_0xb9c7('0x10')][_0x1b9b44[_0xb9c7('0x4e')]]=_0x241f58;this[_0xb9c7('0x4a')](_0x241f58,_0xb9c7('0x21'));}}}catch(_0x4b12e5){logger[_0xb9c7('0x43')](_0xb9c7('0x86'),_0x1b9b44[_0xb9c7('0x4e')],util['inspect'](_0x4b12e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x26')]=function(_0x4523cd){try{if(this[_0xb9c7('0x6d')](_0x4523cd)){logger[_0xb9c7('0x4b')](_0xb9c7('0x8a'),_0x4523cd['uniqueid'],util[_0xb9c7('0x42')](_0x4523cd,{'showHidden':![],'depth':null}));if(this[_0xb9c7('0xe')][_0x4523cd[_0xb9c7('0x4e')]]){var _0x3f9a28=_['last'](this[_0xb9c7('0xe')][_0x4523cd[_0xb9c7('0x4e')]]);_0x3f9a28['queuecallercomplete']=!![];_0x3f9a28[_0xb9c7('0x53')]='COMPLETEDBYAGENT';logger['info'](_0xb9c7('0x8b'),_0x3f9a28['queue'],_0x3f9a28[_0xb9c7('0x65')]);}}}catch(_0x18535b){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x4523cd[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x18535b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x24')]=function(_0x2336dc){try{if(this['isNotNull'](_0x2336dc)){logger[_0xb9c7('0x4b')](_0xb9c7('0x8c'),_0x2336dc[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x2336dc,{'showHidden':![],'depth':null}));if(this[_0xb9c7('0xe')][_0x2336dc[_0xb9c7('0x4e')]]){var _0x4517fa=_[_0xb9c7('0x7f')](this[_0xb9c7('0xe')][_0x2336dc['uniqueid']]);_0x4517fa['queuecallerabandon']=![];_0x4517fa[_0xb9c7('0x82')]=null;_0x4517fa[_0xb9c7('0x8d')]=!![];_0x4517fa[_0xb9c7('0x84')]=_0x2336dc[_0xb9c7('0x8e')];_0x4517fa[_0xb9c7('0x80')]=_0x2336dc[_0xb9c7('0x80')];_0x4517fa[_0xb9c7('0x3a')]=!![];_0x4517fa[_0xb9c7('0x39')]=![];_0x4517fa[_0xb9c7('0x8f')]=null;if(!_0x4517fa[_0xb9c7('0x90')]){if(_0x2336dc['reason']==_0xb9c7('0x90')){_0x4517fa['queuecallerexitreason']=_0xb9c7('0x91');logger['info'](_0xb9c7('0x92'),_0x4517fa[_0xb9c7('0x50')],_0x4517fa[_0xb9c7('0x65')]);}else{if(_[_0xb9c7('0x93')](_0x2336dc[_0xb9c7('0x3e')]['toLowerCase'](),_0xb9c7('0x94'))){if(this[_0xb9c7('0xe')][_0x2336dc[_0xb9c7('0x95')]]){var _0x2d54c9=_['last'](this['queueReports'][_0x2336dc[_0xb9c7('0x95')]]);_0x2d54c9[_0xb9c7('0x3a')]=![];_0x2d54c9[_0xb9c7('0x39')]=!![];_0x2d54c9[_0xb9c7('0x8f')]=moment(_0x4517fa['queuecallerjoinAt'])[_0xb9c7('0x96')](_0x2336dc[_0xb9c7('0x80')],_0xb9c7('0x97'))[_0xb9c7('0x58')](_0xb9c7('0x73'));_0x2d54c9['queuecallerexitreason']=_0xb9c7('0x98');_0x2d54c9[_0xb9c7('0x90')]=!![];_0x2d54c9[_0xb9c7('0x99')]=_0xb9c7('0x9a');_0x2d54c9[_0xb9c7('0x9b')]=_0x2336dc[_0xb9c7('0x9c')];_0x2d54c9[_0xb9c7('0x9d')]=_0x2336dc[_0xb9c7('0x4e')];logger[_0xb9c7('0x77')](_0xb9c7('0x9e'),_0x2d54c9[_0xb9c7('0x50')],_0x2d54c9[_0xb9c7('0x65')]);var _0x2b6991=this[_0xb9c7('0xe')][_0x2336dc['linkedid']];this['queueReports'][_0x2336dc[_0xb9c7('0x95')]]=this[_0xb9c7('0xe')][_0x2336dc['uniqueid']];this[_0xb9c7('0xe')][_0x2336dc[_0xb9c7('0x4e')]]=_0x2b6991;}}else{_0x4517fa[_0xb9c7('0x53')]=_0xb9c7('0x9f')+_0x2336dc[_0xb9c7('0xa0')][_0xb9c7('0xa1')]();logger['info'](_0xb9c7('0xa2'),_0x4517fa[_0xb9c7('0x50')],_0x4517fa[_0xb9c7('0x65')],_0x4517fa[_0xb9c7('0x53')]);}}}this['channels'][_0x2336dc[_0xb9c7('0x4e')]]=_0x4517fa;}}}catch(_0x2341c5){logger[_0xb9c7('0x43')](_0xb9c7('0x8c'),_0x2336dc[_0xb9c7('0x4e')],util['inspect'](_0x2341c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0x28')]=function(_0x4c876f){try{if(this['isNotNull'](_0x4c876f)){logger['debug'](_0xb9c7('0xa3'),_0x4c876f[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x4c876f,{'showHidden':![],'depth':null}));this[_0xb9c7('0xa4')](_0x4c876f[_0xb9c7('0x4e')],_[_0xb9c7('0x7b')](_0x4c876f['variable'])[0x0],_0x4c876f[_0xb9c7('0xa5')]);if(this[_0xb9c7('0xe')][_0x4c876f['uniqueid']]){var _0x1163ba=_[_0xb9c7('0x7f')](this[_0xb9c7('0xe')][_0x4c876f[_0xb9c7('0x4e')]]);if(_0x1163ba){if(this[_0xb9c7('0x6d')](_0x4c876f[_0xb9c7('0xa6')])&&this[_0xb9c7('0x6d')](_0x4c876f[_0xb9c7('0xa6')][_0xb9c7('0x64')])){switch(_0x4c876f['value']){case _0xb9c7('0xa7'):_0x1163ba[_0xb9c7('0x39')]=![];_0x1163ba[_0xb9c7('0x8f')]=null;break;case _0xb9c7('0xa8'):_0x1163ba[_0xb9c7('0xa9')]=_0xb9c7('0xaa');_0x1163ba[_0xb9c7('0x39')]=!![];_0x1163ba[_0xb9c7('0x8f')]=moment()[_0xb9c7('0x58')](_0xb9c7('0x73'));_0x1163ba[_0xb9c7('0xab')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb9c7('0x4b')](_0xb9c7('0xac'),_0x4c876f[_0xb9c7('0x4e')],util[_0xb9c7('0x42')](_0x1163ba,{'showHidden':![],'depth':null}));ami['emit'](_0xb9c7('0xad'),_0x1163ba);break;default:_0x1163ba[_0xb9c7('0x39')]=!![];_0x1163ba[_0xb9c7('0x8f')]=moment()[_0xb9c7('0x58')](_0xb9c7('0x73'));_0x1163ba['queuecallerleaveAt']=moment()[_0xb9c7('0x58')](_0xb9c7('0x73'));}_0x1163ba[_0xb9c7('0x20')]=![];_0x1163ba[_0xb9c7('0x82')]=null;_0x1163ba[_0xb9c7('0x53')]=_0x4c876f[_0xb9c7('0xa5')];this[_0xb9c7('0x10')][_0x4c876f[_0xb9c7('0x4e')]]=_0x1163ba;this['emitVoiceQueueChannelRemove'](_0x1163ba,_0xb9c7('0x27'));}else if(this[_0xb9c7('0x6d')](_0x4c876f[_0xb9c7('0xa6')])&&this[_0xb9c7('0x6d')](_0x4c876f['variable'][_0xb9c7('0xae')])){if(!_0x1163ba['queuecallerabandon']){_0x1163ba[_0xb9c7('0x39')]=!![];_0x1163ba['queuecallerexitAt']=moment()[_0xb9c7('0x58')](_0xb9c7('0x73'));_0x1163ba[_0xb9c7('0x53')]=_0xb9c7('0xaf');_0x1163ba['queuecallerleaveAt']=moment()['format'](_0xb9c7('0x73'));this[_0xb9c7('0x10')][_0x4c876f['uniqueid']]=_0x1163ba;}}logger[_0xb9c7('0x77')](_0xb9c7('0xb0'),_0x4c876f[_0xb9c7('0x4e')],_0x1163ba[_0xb9c7('0x50')],_0x1163ba[_0xb9c7('0x65')],_[_0xb9c7('0x7b')](_0x4c876f[_0xb9c7('0xa6')])[0x0],_0x4c876f[_0xb9c7('0xa5')]);_0x1163ba[_0xb9c7('0x15')]=this[_0xb9c7('0x15')][_0x4c876f[_0xb9c7('0x4e')]];}}}}catch(_0x371ed0){logger[_0xb9c7('0x43')](_0xb9c7('0xa3'),_0x4c876f['uniqueid'],util[_0xb9c7('0x42')](_0x371ed0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb9c7('0x9')][_0xb9c7('0xa4')]=function(_0x543d68,_0x4ed45c,_0x10b8dd){var _0x1357a8=['rtpaudioqos',_0xb9c7('0xb1'),_0xb9c7('0xb2'),'rtpaudioqosjitterbridged',_0xb9c7('0xb3'),_0xb9c7('0xb4'),_0xb9c7('0xb5'),_0xb9c7('0xb6'),'sipcallid','sipuri',_0xb9c7('0xb7'),_0xb9c7('0xb8'),'membercalls',_0xb9c7('0xb9'),_0xb9c7('0xba'),'memberlastcall','membername',_0xb9c7('0xbb'),_0xb9c7('0xbc')];if(!_['isNil'](_0x4ed45c)&&!_[_0xb9c7('0xbd')](_0x1357a8,_0x4ed45c)){if(_[_0xb9c7('0x5a')](this[_0xb9c7('0x15')][_0x543d68])){this[_0xb9c7('0x15')][_0x543d68]={};}this[_0xb9c7('0x15')][_0x543d68][_0x4ed45c]=_0x10b8dd;}};VoiceQueueReport['prototype'][_0xb9c7('0xbe')]=function(_0x1e291b,_0x332aee,_0x2b3f04){try{var _0x5c1f89={};if(this['queueReports'][_0x1e291b]){for(var _0x903ad7=0x0;_0x903ad70x0?!![]:![];if(!_0x54da7c){return this[_0x1278('0x19')](this[_0x1278('0x15')]['completeEvent']);}};VoiceQueueReport['prototype'][_0x1278('0x1a')]=function(_0x576fb4){var _0x2603dd=this[_0x1278('0x15')]['id'];if(this[_0x1278('0x15')]['queuestatus'][_0x2603dd]&&this[_0x1278('0x15')]['queuestatus'][_0x2603dd][_0x576fb4['actionid']]){this[_0x1278('0x15')][_0x1278('0x62')][_0x2603dd][_0x576fb4['actionid']][_0x1278('0x10')]['push'](_0x576fb4);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x9c8486){var _0x5abb56=this;try{if(this[_0x1278('0x5c')](_0x9c8486)&&this[_0x1278('0x5c')](_0x9c8486[_0x1278('0x50')])){logger[_0x1278('0x4d')](_0x1278('0x6b'),util[_0x1278('0x45')](_0x9c8486,{'showHidden':![],'depth':null}));var _0xec98e7=this[_0x1278('0x13')][_0x9c8486[_0x1278('0x50')]];if(_0xec98e7){logger[_0x1278('0x4d')](_0x1278('0x6c'),_0xec98e7[_0x1278('0x5a')]);this[_0x1278('0x15')][_0x1278('0x5e')][_0xec98e7[_0x1278('0x5a')]]={'summaryEvent':_0x9c8486};this[_0x1278('0x15')][_0x1278('0x6a')]+=0x1;return ami[_0x1278('0x3d')]({'action':_0x1278('0x62'),'queue':_0xec98e7[_0x1278('0x5a')]})[_0x1278('0x60')](function(_0x2fc995){if(!_0x5abb56[_0x1278('0x15')][_0x1278('0x62')][_0x9c8486['actionid']]){_0x5abb56[_0x1278('0x15')][_0x1278('0x62')][_0x9c8486[_0x1278('0x61')]]={};}_0x5abb56['summary'][_0x1278('0x62')][_0x9c8486[_0x1278('0x61')]][_0x2fc995[_0x1278('0x61')]]={'queue':_0xec98e7[_0x1278('0x5a')],'agents':[]};})[_0x1278('0x40')](function(_0x5c4d4a){throw _0x5c4d4a;});}}}catch(_0x45bff9){logger['error'](_0x1278('0x63'),util['inspect'](_0x45bff9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')][_0x1278('0x19')]=function(_0x5218ee){if(this[_0x1278('0x15')][_0x1278('0x6a')]>0x0){this[_0x1278('0x15')][_0x1278('0x6d')]=_0x5218ee;return;}logger[_0x1278('0x4d')](_0x1278('0x6e'),util[_0x1278('0x45')](_0x5218ee,{'showHidden':![],'depth':null}));this[_0x1278('0x15')]=initializeSummary();ami[_0x1278('0x4b')](_0x1278('0x6f'),{});};VoiceQueueReport['prototype'][_0x1278('0x1e')]=function(_0x1733bb){try{if(this[_0x1278('0x5c')](_0x1733bb)){logger[_0x1278('0x4d')](_0x1278('0x70'),_0x1733bb['uniqueid'],util[_0x1278('0x45')](_0x1733bb,{'showHidden':![],'depth':null}));if(_[_0x1278('0x5d')](this[_0x1278('0xe')][_0x1733bb[_0x1278('0x53')]])){this['queueReports'][_0x1733bb[_0x1278('0x53')]]=[];}if(_[_0x1278('0x5d')](this['channels'][_0x1733bb[_0x1278('0x53')]])){this['channels'][_0x1733bb[_0x1278('0x53')]]={};}var _0x335864=new QueueReport();_0x335864['queue']=_0x1733bb[_0x1278('0x50')];_0x335864[_0x1278('0x67')]=this[_0x1278('0x13')][_0x335864[_0x1278('0x50')]]&&this['voiceQueues'][_0x335864['queue']][_0x1278('0x67')]?this[_0x1278('0x13')][_0x335864['queue']]['type']||_0x1278('0x58'):_0x1278('0x58');_0x335864[_0x1278('0x71')]=moment()[_0x1278('0x55')](_0x1278('0x72'));_0x335864[_0x1278('0x73')]=_0x1733bb['position'];_0x335864[_0x1278('0x74')]=_0x1733bb['count'];_0x335864[_0x1278('0x53')]=_0x1733bb['uniqueid'];_0x335864[_0x1278('0x75')]=this['channels'][_0x1733bb['uniqueid']]['routealias'];logger['info'](_0x1278('0x76'),_0x335864[_0x1278('0x50')],_0x335864[_0x1278('0x67')]);Object[_0x1278('0x77')](_0x335864,_['pick'](_0x1733bb,_[_0x1278('0x78')](_0x335864)));this[_0x1278('0xe')][_0x1733bb[_0x1278('0x53')]]['push'](_0x335864);this['channels'][_0x1733bb[_0x1278('0x53')]]=_0x335864;this['emitVoiceQueueChannelSave'](_0x335864,'queuecallerjoin');}}catch(_0x2a2abd){logger[_0x1278('0x43')](_0x1278('0x70'),_0x1733bb[_0x1278('0x53')],util[_0x1278('0x45')](_0x2a2abd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')]['syncQueueCallerAbandon']=function(_0x82f20e){try{if(this[_0x1278('0x5c')](_0x82f20e)){logger[_0x1278('0x4d')](_0x1278('0x79'),_0x82f20e[_0x1278('0x53')],util['inspect'](_0x82f20e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x82f20e[_0x1278('0x53')]]){var _0x5a6858=_[_0x1278('0x7a')](this[_0x1278('0xe')][_0x82f20e[_0x1278('0x53')]]);_0x5a6858[_0x1278('0x39')]=![];_0x5a6858[_0x1278('0x7b')]=null;_0x5a6858[_0x1278('0x7c')]=_0x82f20e['holdtime'];_0x5a6858['originalposition']=_0x82f20e[_0x1278('0x7d')];_0x5a6858[_0x1278('0x1f')]=!![];_0x5a6858[_0x1278('0x7e')]=moment()[_0x1278('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a6858['queuecallerexitreason']=_0x1278('0x7f');_0x5a6858[_0x1278('0x80')]=null;logger[_0x1278('0x81')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5a6858['queue'],_0x5a6858[_0x1278('0x67')]);this[_0x1278('0x11')][_0x82f20e[_0x1278('0x53')]]=_0x5a6858;this[_0x1278('0x49')](_0x5a6858,_0x1278('0x1f'));}}}catch(_0x46eda8){logger[_0x1278('0x43')](_0x1278('0x79'),_0x82f20e[_0x1278('0x53')],util[_0x1278('0x45')](_0x46eda8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')][_0x1278('0x22')]=function(_0x481130){try{if(this[_0x1278('0x5c')](_0x481130)){logger[_0x1278('0x4d')](_0x1278('0x82'),_0x481130[_0x1278('0x53')],util[_0x1278('0x45')](_0x481130,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x481130[_0x1278('0x53')]]){var _0x3bae93=_['last'](this['queueReports'][_0x481130[_0x1278('0x53')]]);_0x3bae93[_0x1278('0x83')]=moment()[_0x1278('0x55')](_0x1278('0x72'));_0x3bae93[_0x1278('0x84')]=_0x481130[_0x1278('0x84')];_0x3bae93[_0x1278('0x85')]=_0x481130[_0x1278('0x85')];logger[_0x1278('0x81')](_0x1278('0x86'),_0x3bae93[_0x1278('0x50')],_0x3bae93[_0x1278('0x67')],_0x481130[_0x1278('0x84')],_0x481130[_0x1278('0x85')]);this[_0x1278('0x11')][_0x481130['uniqueid']]=_0x3bae93;this[_0x1278('0x4c')](_0x3bae93,_0x1278('0x21'));}}}catch(_0x4c3a24){logger[_0x1278('0x43')](_0x1278('0x82'),_0x481130[_0x1278('0x53')],util[_0x1278('0x45')](_0x4c3a24,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')]['syncAgentConnect']=function(_0x3b3cfb){try{if(this[_0x1278('0x5c')](_0x3b3cfb)){logger[_0x1278('0x4d')](_0x1278('0x87'),_0x3b3cfb[_0x1278('0x53')],util[_0x1278('0x45')](_0x3b3cfb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3b3cfb[_0x1278('0x53')]]){var _0x382ef1=_[_0x1278('0x7a')](this['queueReports'][_0x3b3cfb['uniqueid']]);_0x382ef1[_0x1278('0x39')]=!![];_0x382ef1[_0x1278('0x54')]=_0x1278('0x88');logger[_0x1278('0x81')](_0x1278('0x89'),_0x382ef1[_0x1278('0x50')],_0x382ef1[_0x1278('0x67')]);}}}catch(_0x512b1e){logger[_0x1278('0x43')](_0x1278('0x87'),_0x3b3cfb[_0x1278('0x53')],util[_0x1278('0x45')](_0x512b1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')][_0x1278('0x24')]=function(_0x15af71){try{if(this['isNotNull'](_0x15af71)){logger[_0x1278('0x4d')](_0x1278('0x8a'),_0x15af71[_0x1278('0x53')],util[_0x1278('0x45')](_0x15af71,{'showHidden':![],'depth':null}));if(this[_0x1278('0xe')][_0x15af71[_0x1278('0x53')]]){var _0x34dcc2=_[_0x1278('0x7a')](this['queueReports'][_0x15af71[_0x1278('0x53')]]);_0x34dcc2[_0x1278('0x1f')]=![];_0x34dcc2[_0x1278('0x7e')]=null;_0x34dcc2[_0x1278('0x8b')]=!![];_0x34dcc2['lastAssignedTo']=_0x15af71['membername'];_0x34dcc2[_0x1278('0x7c')]=_0x15af71['holdtime'];_0x34dcc2['queuecallercomplete']=!![];_0x34dcc2[_0x1278('0x38')]=![];_0x34dcc2[_0x1278('0x8c')]=null;if(!_0x34dcc2[_0x1278('0x8d')]){if(_0x15af71[_0x1278('0x8e')]==_0x1278('0x8d')){_0x34dcc2['queuecallerexitreason']='COMPLETED';logger[_0x1278('0x81')](_0x1278('0x8f'),_0x34dcc2[_0x1278('0x50')],_0x34dcc2[_0x1278('0x67')]);}else{if(_['startsWith'](_0x15af71['channel']['toLowerCase'](),_0x1278('0x90'))){if(this[_0x1278('0xe')][_0x15af71[_0x1278('0x91')]]){var _0x28bf64=_[_0x1278('0x7a')](this[_0x1278('0xe')][_0x15af71['linkedid']]);_0x28bf64[_0x1278('0x39')]=![];_0x28bf64['queuecallerexit']=!![];_0x28bf64[_0x1278('0x8c')]=moment(_0x34dcc2[_0x1278('0x71')])['add'](_0x15af71['holdtime'],_0x1278('0x92'))[_0x1278('0x55')](_0x1278('0x72'));_0x28bf64[_0x1278('0x54')]='FORWARDTRANSFER';_0x28bf64[_0x1278('0x8d')]=!![];_0x28bf64[_0x1278('0x93')]=_0x1278('0x94');_0x28bf64[_0x1278('0x95')]=_0x15af71[_0x1278('0x96')];_0x28bf64['transferuniqueid']=_0x15af71['uniqueid'];logger[_0x1278('0x81')](_0x1278('0x97'),_0x28bf64[_0x1278('0x50')],_0x28bf64[_0x1278('0x67')]);var _0x3cf150=this[_0x1278('0xe')][_0x15af71[_0x1278('0x91')]];this['queueReports'][_0x15af71[_0x1278('0x91')]]=this['queueReports'][_0x15af71[_0x1278('0x53')]];this[_0x1278('0xe')][_0x15af71[_0x1278('0x53')]]=_0x3cf150;}}else{_0x34dcc2[_0x1278('0x54')]=_0x1278('0x98')+_0x15af71[_0x1278('0x8e')]['toUpperCase']();logger[_0x1278('0x81')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x34dcc2[_0x1278('0x50')],_0x34dcc2[_0x1278('0x67')],_0x34dcc2['queuecallerexitreason']);}}}this['channels'][_0x15af71[_0x1278('0x53')]]=_0x34dcc2;}}}catch(_0x46eeee){logger['error'](_0x1278('0x8a'),_0x15af71[_0x1278('0x53')],util[_0x1278('0x45')](_0x46eeee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x461e70){try{if(this[_0x1278('0x5c')](_0x461e70)){logger[_0x1278('0x4d')](_0x1278('0x99'),_0x461e70[_0x1278('0x53')],util[_0x1278('0x45')](_0x461e70,{'showHidden':![],'depth':null}));this[_0x1278('0x9a')](_0x461e70[_0x1278('0x53')],_[_0x1278('0x78')](_0x461e70[_0x1278('0x9b')])[0x0],_0x461e70['value']);if(this['queueReports'][_0x461e70['uniqueid']]){var _0x5ac284=_[_0x1278('0x7a')](this[_0x1278('0xe')][_0x461e70[_0x1278('0x53')]]);if(_0x5ac284){if(this[_0x1278('0x5c')](_0x461e70[_0x1278('0x9b')])&&this[_0x1278('0x5c')](_0x461e70['variable'][_0x1278('0x62')])){switch(_0x461e70[_0x1278('0x9c')]){case _0x1278('0x9d'):_0x5ac284[_0x1278('0x38')]=![];_0x5ac284[_0x1278('0x8c')]=null;break;case _0x1278('0x9e'):_0x5ac284[_0x1278('0x9f')]=_0x1278('0xa0');_0x5ac284[_0x1278('0x38')]=!![];_0x5ac284[_0x1278('0x8c')]=moment()[_0x1278('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ac284['queuecallerleaveAt']=moment()[_0x1278('0x55')](_0x1278('0x72'));logger['debug'](_0x1278('0xa1'),_0x461e70[_0x1278('0x53')],util[_0x1278('0x45')](_0x5ac284,{'showHidden':![],'depth':null}));ami[_0x1278('0x4b')](_0x1278('0xa2'),_0x5ac284);break;default:_0x5ac284['queuecallerexit']=!![];_0x5ac284['queuecallerexitAt']=moment()[_0x1278('0x55')](_0x1278('0x72'));_0x5ac284[_0x1278('0x83')]=moment()[_0x1278('0x55')](_0x1278('0x72'));}_0x5ac284[_0x1278('0x1f')]=![];_0x5ac284[_0x1278('0x7e')]=null;_0x5ac284['queuecallerexitreason']=_0x461e70[_0x1278('0x9c')];this[_0x1278('0x11')][_0x461e70[_0x1278('0x53')]]=_0x5ac284;this['emitVoiceQueueChannelRemove'](_0x5ac284,_0x1278('0xa3'));}else if(this[_0x1278('0x5c')](_0x461e70[_0x1278('0x9b')])&&this[_0x1278('0x5c')](_0x461e70[_0x1278('0x9b')]['queueposition'])){if(!_0x5ac284[_0x1278('0x1f')]){_0x5ac284[_0x1278('0x38')]=!![];_0x5ac284['queuecallerexitAt']=moment()[_0x1278('0x55')](_0x1278('0x72'));_0x5ac284[_0x1278('0x54')]=_0x1278('0xa4');_0x5ac284[_0x1278('0x83')]=moment()[_0x1278('0x55')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x461e70[_0x1278('0x53')]]=_0x5ac284;}}logger[_0x1278('0x81')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x461e70[_0x1278('0x53')],_0x5ac284[_0x1278('0x50')],_0x5ac284[_0x1278('0x67')],_[_0x1278('0x78')](_0x461e70[_0x1278('0x9b')])[0x0],_0x461e70[_0x1278('0x9c')]);_0x5ac284['variables']=this[_0x1278('0x16')][_0x461e70[_0x1278('0x53')]];}}}}catch(_0x25b821){logger[_0x1278('0x43')](_0x1278('0x99'),_0x461e70[_0x1278('0x53')],util[_0x1278('0x45')](_0x25b821,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1278('0x47')][_0x1278('0x9a')]=function(_0x44a29a,_0xf0ef9d,_0x320470){var _0x16c78f=['rtpaudioqos','rtpaudioqosbridged',_0x1278('0xa5'),_0x1278('0xa6'),_0x1278('0xa7'),_0x1278('0xa8'),'rtpaudioqosrtt',_0x1278('0xa9'),_0x1278('0xaa'),_0x1278('0xab'),_0x1278('0xac'),_0x1278('0xad'),_0x1278('0xae'),_0x1278('0xaf'),_0x1278('0xb0'),_0x1278('0xb1'),_0x1278('0xb2'),_0x1278('0xb3'),_0x1278('0xb4')];if(!_['isNil'](_0xf0ef9d)&&!_['includes'](_0x16c78f,_0xf0ef9d)){if(_['isUndefined'](this['variables'][_0x44a29a])){this[_0x1278('0x16')][_0x44a29a]={};}this[_0x1278('0x16')][_0x44a29a][_0xf0ef9d]=_0x320470;}};VoiceQueueReport[_0x1278('0x47')]['handleHangup']=function(_0xe58aa6,_0x5b7d56,_0x7ffe7f){try{var _0x4ed92a={};if(this[_0x1278('0xe')][_0xe58aa6]){for(var _0x55d487=0x0;_0x55d487=0x0?moment(_0x1a46a5[_0xef86('0x1c')])[_0xef86('0x10')](_0x1a46a5['starttime'],_0xef86('0x1d')):null,'data1':_0xef86('0x1e'),'data2':_0x1a46a5[_0xef86('0x17')],'data3':_0x1a46a5['exten'],'data4':_0x1a46a5[_0xef86('0x1f')]||null,'role':_0xef86('0x15'),'internal':_0x1a46a5['accountcode']?_[_0xef86('0x16')](_0x1a46a5['accountcode']):undefined,'uniqueid':_0x1a46a5[_0xef86('0x18')]},'log':_0xef86('0x8')});}; \ No newline at end of file +var _0x2b54=['accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','membername','endtime','lodash','../client','voiceQueueReport','queuecallerexitAt','Request','voice','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent'];(function(_0x3cb5e1,_0x412008){var _0x2c336d=function(_0x377889){while(--_0x377889){_0x3cb5e1['push'](_0x3cb5e1['shift']());}};_0x2c336d(++_0x412008);}(_0x2b54,0xdf));var _0x42b5=function(_0x1bd94a,_0xaef125){_0x1bd94a=_0x1bd94a-0x0;var _0x21d395=_0x2b54[_0x1bd94a];return _0x21d395;};'use strict';var moment=require('moment');var _=require(_0x42b5('0x0'));var util=require('util');var client=require(_0x42b5('0x1'));exports[_0x42b5('0x2')]=function(_0xe8c42b){var _0xa6746d=_0xe8c42b['queuecallercompleteAt']||_0xe8c42b[_0x42b5('0x3')];return client[_0x42b5('0x4')]('CreateMemberReport',{'body':{'channel':_0x42b5('0x5'),'membername':_0xe8c42b['lastAssignedTo'],'interface':_['isNil'](_0xe8c42b[_0x42b5('0x6')])?util['format'](_0x42b5('0x7'),_0xe8c42b['lastAssignedTo']):_0xe8c42b[_0x42b5('0x6')],'type':_0x42b5('0x8'),'enterAt':_0xe8c42b[_0x42b5('0x9')],'exitAt':_0xa6746d,'duration':moment(_0xa6746d)[_0x42b5('0xa')](_0xe8c42b['queuecallerleaveAt'],_0x42b5('0xb')),'data1':_0x42b5('0xc'),'data2':_0xe8c42b[_0x42b5('0xd')],'data3':_0xe8c42b[_0x42b5('0xe')],'data4':null,'data5':_0xe8c42b[_0x42b5('0xf')],'role':_0x42b5('0x10'),'internal':_0xe8c42b[_0x42b5('0x11')]?_[_0x42b5('0x12')](_0xe8c42b[_0x42b5('0x11')]):undefined,'uniqueid':_0xe8c42b[_0x42b5('0x13')]},'log':_0x42b5('0x14')});};exports[_0x42b5('0x15')]=function(_0x2886e5){return client[_0x42b5('0x4')]('CreateMemberReport',{'body':{'channel':_0x42b5('0x5'),'membername':_0x2886e5[_0x42b5('0x16')],'interface':_0x2886e5[_0x42b5('0x6')],'type':_0x42b5('0x8'),'enterAt':_0x2886e5['starttime'],'exitAt':_0x2886e5['endtime'],'duration':moment(_0x2886e5[_0x42b5('0x17')])[_0x42b5('0xa')](_0x2886e5['starttime'],_0x42b5('0xb'))>=0x0?moment(_0x2886e5[_0x42b5('0x17')])['diff'](_0x2886e5['starttime'],_0x42b5('0xb')):null,'data1':'outbound','data2':_0x2886e5[_0x42b5('0x11')],'data3':_0x2886e5[_0x42b5('0xe')],'data4':_0x2886e5['dialstring']||null,'role':_0x42b5('0x10'),'internal':_0x2886e5[_0x42b5('0x11')]?_['toNumber'](_0x2886e5[_0x42b5('0x11')]):undefined,'uniqueid':_0x2886e5['uniqueid']},'log':_0x42b5('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d0f6b3f..903ab50 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 _0x33e5=['getSettings','Request','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x5b1a04,_0x1765a9){var _0x13fd3e=function(_0x3843f3){while(--_0x3843f3){_0x5b1a04['push'](_0x5b1a04['shift']());}};_0x13fd3e(++_0x1765a9);}(_0x33e5,0x13a));var _0x533e=function(_0x1a4d70,_0x3fa5b0){_0x1a4d70=_0x1a4d70-0x0;var _0x3c32d8=_0x33e5[_0x1a4d70];return _0x3c32d8;};'use strict';var client=require(_0x533e('0x0'));exports[_0x533e('0x1')]=function(){return client[_0x533e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x533e('0x3'),'previewRecallmeReminderInterval']},'log':_0x533e('0x4')});}; \ No newline at end of file +var _0x4060=['previewRecallmeReminderInterval','GetSettings','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4060,0x89));var _0x0406=function(_0x1800b6,_0x466b37){_0x1800b6=_0x1800b6-0x0;var _0x196507=_0x4060[_0x1800b6];return _0x196507;};'use strict';var client=require('../client');exports[_0x0406('0x0')]=function(){return client['Request'](_0x0406('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0406('0x2'),_0x0406('0x3')]},'log':_0x0406('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 39c7dc0..bc1ee3b 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 _0x484a=['html','../client','getTemplates','GetTemplate','name'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x484a,0x191));var _0xa484=function(_0x2ad968,_0x1f629e){_0x2ad968=_0x2ad968-0x0;var _0x5a41bf=_0x484a[_0x2ad968];return _0x5a41bf;};'use strict';var client=require(_0xa484('0x0'));exports[_0xa484('0x1')]=function(_0x5d1db3){return function(_0x177213){return client['Request'](_0xa484('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa484('0x3'),_0xa484('0x4')]},'log':_0xa484('0x2')});};}; \ No newline at end of file +var _0x3eeb=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x134467,_0x40bd2a){var _0x2ab317=function(_0x575401){while(--_0x575401){_0x134467['push'](_0x134467['shift']());}};_0x2ab317(++_0x40bd2a);}(_0x3eeb,0x172));var _0xb3ee=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3eeb[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0xb3ee('0x0'));exports[_0xb3ee('0x1')]=function(_0xea6919){return function(_0x497bd3){return client[_0xb3ee('0x2')](_0xb3ee('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb3ee('0x4'),_0xb3ee('0x5')]},'log':_0xb3ee('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8045f4d..c8e2f06 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 _0x74a4=['Request','GetTrigger','name','status','AllConditions','field','operator','Condition','AnyConditions','value','Action','Actions','action','data2','data3','data5','data6','../client','getTriggers'];(function(_0xd91b61,_0x492f0a){var _0x1f72ba=function(_0x13c879){while(--_0x13c879){_0xd91b61['push'](_0xd91b61['shift']());}};_0x1f72ba(++_0x492f0a);}(_0x74a4,0x1c6));var _0x474a=function(_0x2e38b9,_0x4b177d){_0x2e38b9=_0x2e38b9-0x0;var _0x43510f=_0x74a4[_0x2e38b9];return _0x43510f;};'use strict';var client=require(_0x474a('0x0'));exports[_0x474a('0x1')]=function(_0x925927){return function(_0x33dba6){return client[_0x474a('0x2')](_0x474a('0x3'),{'options':{'raw':![],'attributes':['id',_0x474a('0x4'),'channel',_0x474a('0x5')],'include':[{'model':'Condition','as':_0x474a('0x6'),'attributes':['id',_0x474a('0x7'),_0x474a('0x8'),'value']},{'model':_0x474a('0x9'),'as':_0x474a('0xa'),'attributes':['id','field',_0x474a('0x8'),_0x474a('0xb')]},{'model':_0x474a('0xc'),'as':_0x474a('0xd'),'attributes':['id',_0x474a('0xe'),'data1',_0x474a('0xf'),_0x474a('0x10'),'data4',_0x474a('0x11'),_0x474a('0x12'),'data7']}]},'log':_0x474a('0x3')});};}; \ No newline at end of file +var _0x0199=['Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel'];(function(_0x5f2f62,_0x105ffc){var _0x560984=function(_0x96ff10){while(--_0x96ff10){_0x5f2f62['push'](_0x5f2f62['shift']());}};_0x560984(++_0x105ffc);}(_0x0199,0xfe));var _0x9019=function(_0xdc7efc,_0xfe05fd){_0xdc7efc=_0xdc7efc-0x0;var _0x29e9ea=_0x0199[_0xdc7efc];return _0x29e9ea;};'use strict';var client=require(_0x9019('0x0'));exports[_0x9019('0x1')]=function(_0x56088f){return function(_0x41a7b0){return client[_0x9019('0x2')](_0x9019('0x3'),{'options':{'raw':![],'attributes':['id',_0x9019('0x4'),_0x9019('0x5'),'status'],'include':[{'model':_0x9019('0x6'),'as':_0x9019('0x7'),'attributes':['id',_0x9019('0x8'),_0x9019('0x9'),_0x9019('0xa')]},{'model':_0x9019('0x6'),'as':_0x9019('0xb'),'attributes':['id','field',_0x9019('0x9'),_0x9019('0xa')]},{'model':_0x9019('0xc'),'as':'Actions','attributes':['id',_0x9019('0xd'),_0x9019('0xe'),'data2',_0x9019('0xf'),_0x9019('0x10'),_0x9019('0x11'),_0x9019('0x12'),_0x9019('0x13')]}]},'log':_0x9019('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b57df98..a282cee 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 _0xa73a=['GetTrunk','getTrunks','Request'];(function(_0x3d392e,_0x19ee15){var _0xda3726=function(_0x1dfba2){while(--_0x1dfba2){_0x3d392e['push'](_0x3d392e['shift']());}};_0xda3726(++_0x19ee15);}(_0xa73a,0x82));var _0xaa73=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xa73a[_0x1e03a6];return _0x295b64;};'use strict';var client=require('../client');exports[_0xaa73('0x0')]=function(_0x3d8fed){return function(_0x230542){return client[_0xaa73('0x1')](_0xaa73('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry','defaultuser']},'log':_0xaa73('0x2')});};}; \ No newline at end of file +var _0x0a25=['getTrunks','Request','name','registry','defaultuser','GetTrunk','../client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0a25,0x68));var _0x50a2=function(_0x5e9c85,_0x461674){_0x5e9c85=_0x5e9c85-0x0;var _0xcbdcf7=_0x0a25[_0x5e9c85];return _0xcbdcf7;};'use strict';var client=require(_0x50a2('0x0'));exports[_0x50a2('0x1')]=function(_0x486abe){return function(_0x36cacc){return client[_0x50a2('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x50a2('0x3'),_0x50a2('0x4'),_0x50a2('0x5')]},'log':_0x50a2('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9099361..684ae95 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x14bb1e,_0x1d0625){var _0xe726bf=function(_0x8984c1){while(--_0x8984c1){_0x14bb1e['push'](_0x14bb1e['shift']());}};_0xe726bf(++_0x1d0625);}(_0xedd9,0xfc));var _0x9edd=function(_0x37be36,_0x18fe03){_0x37be36=_0x37be36-0x0;var _0x47108e=_0xedd9[_0x37be36];return _0x47108e;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe706,0xa3));var _0x6e70=function(_0x108de9,_0x59c896){_0x108de9=_0x108de9-0x0;var _0x3038af=_0xe706[_0x108de9];return _0x3038af;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 17f1760..a4b6da7 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 _0xdadb=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x53dc2f,_0x352f5f){var _0x2db8b6=function(_0x1c82c9){while(--_0x1c82c9){_0x53dc2f['push'](_0x53dc2f['shift']());}};_0x2db8b6(++_0x352f5f);}(_0xdadb,0x131));var _0xbdad=function(_0x4bbd94,_0x29e165){_0x4bbd94=_0x4bbd94-0x0;var _0x5aab27=_0xdadb[_0x4bbd94];return _0x5aab27;};'use strict';var client=require(_0xbdad('0x0'));exports[_0xbdad('0x1')]=function(_0x1267d0){return client[_0xbdad('0x2')](_0xbdad('0x3'),{'body':_0x1267d0,'log':'CreateVoiceAgentReport'});};exports[_0xbdad('0x4')]=function(_0x6953de,_0xab2637,_0x57763d){return client[_0xbdad('0x2')](_0xbdad('0x5'),{'body':_0x6953de,'options':{'where':{'uniqueid':_0xab2637,'interface':_0x57763d,'agentcomplete':!![]}},'log':_0xbdad('0x5')});}; \ No newline at end of file +var _0x222f=['CreateVoiceAgentReport','Request','UpdateVoiceAgentReport','../client','create'];(function(_0x10fc8b,_0x19a34e){var _0x562973=function(_0x2257c8){while(--_0x2257c8){_0x10fc8b['push'](_0x10fc8b['shift']());}};_0x562973(++_0x19a34e);}(_0x222f,0x67));var _0xf222=function(_0xcf7d1e,_0x1b00ad){_0xcf7d1e=_0xcf7d1e-0x0;var _0x42b2cb=_0x222f[_0xcf7d1e];return _0x42b2cb;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(_0x5cbd5b){return client['Request'](_0xf222('0x2'),{'body':_0x5cbd5b,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x48e3e2,_0x7ce5d1,_0x4f65ba){return client[_0xf222('0x3')](_0xf222('0x4'),{'body':_0x48e3e2,'options':{'where':{'uniqueid':_0x7ce5d1,'interface':_0x4f65ba,'agentcomplete':!![]}},'log':_0xf222('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 71adaee..5562669 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 _0x8168=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create'];(function(_0x57acf2,_0x2e69ab){var _0x12bd71=function(_0x5b6211){while(--_0x5b6211){_0x57acf2['push'](_0x57acf2['shift']());}};_0x12bd71(++_0x2e69ab);}(_0x8168,0xd7));var _0x8816=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0x8168[_0x114d1f];return _0x5b91d4;};'use strict';var moment=require(_0x8816('0x0'));var util=require(_0x8816('0x1'));var _=require(_0x8816('0x2'));var client=require(_0x8816('0x3'));exports[_0x8816('0x4')]=function(_0x4ff4ff){return client[_0x8816('0x5')](_0x8816('0x6'),{'body':_[_0x8816('0x7')](_0x4ff4ff,{'source':_0x4ff4ff[_0x8816('0x8')],'destinationcontext':_0x4ff4ff[_0x8816('0x9')],'callerid':_0x4ff4ff[_0x8816('0xa')],'amaflags':'DOCUMENTATION'}),'log':_0x8816('0x6')});};exports[_0x8816('0xb')]=function(){return function(){return client[_0x8816('0x5')](_0x8816('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x8816('0xd')](_0x8816('0xe'))[_0x8816('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x8816('0xe'))[_0x8816('0xf')](_0x8816('0x10'))]}},'attributes':['type',_0x8816('0x11'),'duration',_0x8816('0x12')]},'log':_0x8816('0x13')});};}; \ No newline at end of file +var _0x657e=['outbound','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','lodash','../client','Request','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport'];(function(_0x3d404f,_0x47ed72){var _0x3a9e21=function(_0x54a58e){while(--_0x54a58e){_0x3d404f['push'](_0x3d404f['shift']());}};_0x3a9e21(++_0x47ed72);}(_0x657e,0x172));var _0xe657=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x657e[_0x96f74c];return _0x379222;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xe657('0x0'));var client=require(_0xe657('0x1'));exports['create']=function(_0x3d7561){return client[_0xe657('0x2')]('CreateVoiceCallReport',{'body':_['merge'](_0x3d7561,{'source':_0x3d7561[_0xe657('0x3')],'destinationcontext':_0x3d7561[_0xe657('0x4')],'callerid':_0x3d7561[_0xe657('0x5')],'amaflags':_0xe657('0x6')}),'log':_0xe657('0x7')});};exports[_0xe657('0x8')]=function(){return function(){return client['Request'](_0xe657('0x9'),{'options':{'where':{'type':[_0xe657('0xa')],'createdAt':{'$between':[moment()[_0xe657('0xb')](_0xe657('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe657('0xd')]('day')[_0xe657('0xe')](_0xe657('0xf'))]}},'attributes':[_0xe657('0x10'),_0xe657('0x11'),_0xe657('0x12'),'billableseconds']},'log':_0xe657('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 269657c..b31f3e7 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 _0x1fbb=['CreateVoiceDialReport','../client','create','Request'];(function(_0x4e9f29,_0x1bbcbf){var _0x8e1ab3=function(_0x4a4e6b){while(--_0x4a4e6b){_0x4e9f29['push'](_0x4e9f29['shift']());}};_0x8e1ab3(++_0x1bbcbf);}(_0x1fbb,0x17d));var _0xb1fb=function(_0x534a0b,_0x30c451){_0x534a0b=_0x534a0b-0x0;var _0x19544a=_0x1fbb[_0x534a0b];return _0x19544a;};'use strict';var client=require(_0xb1fb('0x0'));exports[_0xb1fb('0x1')]=function(_0x486683){return client[_0xb1fb('0x2')](_0xb1fb('0x3'),{'body':_0x486683,'log':_0xb1fb('0x3')});}; \ No newline at end of file +var _0x5255=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1f6f06,_0x49aa08){var _0xbd442d=function(_0x45773e){while(--_0x45773e){_0x1f6f06['push'](_0x1f6f06['shift']());}};_0xbd442d(++_0x49aa08);}(_0x5255,0x1a7));var _0x5525=function(_0x2e64bf,_0x5a1325){_0x2e64bf=_0x2e64bf-0x0;var _0x3099e=_0x5255[_0x2e64bf];return _0x3099e;};'use strict';var client=require(_0x5525('0x0'));exports[_0x5525('0x1')]=function(_0x57c4d3){return client[_0x5525('0x2')](_0x5525('0x3'),{'body':_0x57c4d3,'log':_0x5525('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 190fa64..614bb69 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 _0xfa20=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xfa20,0x141));var _0x0fa2=function(_0x5e43d9,_0x28d012){_0x5e43d9=_0x5e43d9-0x0;var _0x230bfd=_0xfa20[_0x5e43d9];return _0x230bfd;};'use strict';var client=require(_0x0fa2('0x0'));exports[_0x0fa2('0x1')]=function(){return function(){return client[_0x0fa2('0x2')](_0x0fa2('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0fa2('0x4'),_0x0fa2('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x0fa2('0x1')});};}; \ No newline at end of file +var _0xd3d1=['exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x5e00c9,_0x3ccccf){var _0x493101=function(_0x461621){while(--_0x461621){_0x5e00c9['push'](_0x5e00c9['shift']());}};_0x493101(++_0x3ccccf);}(_0xd3d1,0x172));var _0x1d3d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd3d1[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0x1d3d('0x0'));exports[_0x1d3d('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x1d3d('0x2'),_0x1d3d('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1d3d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e841f9a..f507b5a 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 _0x4e37=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialOrderByScheduledAt','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x4e37,0x17e));var _0x74e3=function(_0x2ddd42,_0x39be46){_0x2ddd42=_0x2ddd42-0x0;var _0x189dc1=_0x4e37[_0x2ddd42];return _0x189dc1;};'use strict';var client=require('../client');exports[_0x74e3('0x0')]=function(){return function(){return client[_0x74e3('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x74e3('0x2'),'acw',_0x74e3('0x3'),_0x74e3('0x4'),_0x74e3('0x5'),_0x74e3('0x6'),_0x74e3('0x7'),_0x74e3('0x8'),_0x74e3('0x9'),'dialLimitQueue',_0x74e3('0xa'),'dialPredictiveOptimization',_0x74e3('0xb'),_0x74e3('0xc'),_0x74e3('0xd'),_0x74e3('0xe'),_0x74e3('0xf'),_0x74e3('0x10'),'dialQueueTimeout',_0x74e3('0x11'),_0x74e3('0x12'),_0x74e3('0x13'),_0x74e3('0x14'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x74e3('0x15'),_0x74e3('0x16'),_0x74e3('0x17'),_0x74e3('0x18'),_0x74e3('0x19'),_0x74e3('0x1a'),_0x74e3('0x1b'),'dialAMDInitialSilence',_0x74e3('0x1c'),'dialAMDAfterGreetingSilence',_0x74e3('0x1d'),_0x74e3('0x1e'),_0x74e3('0x1f'),'dialAMDMaximumNumberOfWords',_0x74e3('0x20'),_0x74e3('0x21'),_0x74e3('0x22'),'dialRecallMeTimeout','dialRecallInQueue',_0x74e3('0x23'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x74e3('0x24'),_0x74e3('0x5'),_0x74e3('0x25'),_0x74e3('0x26'),_0x74e3('0x27'),_0x74e3('0x28'),_0x74e3('0x29'),_0x74e3('0x2a'),_0x74e3('0x2b'),_0x74e3('0x2c'),'dialAbandonedRetryFrequency',_0x74e3('0x2d'),_0x74e3('0x2e'),'dialAgentRejectMaxRetry',_0x74e3('0x2f'),'mandatoryDisposition',_0x74e3('0x30'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0x74e3('0x31')],'include':[{'model':_0x74e3('0x32'),'as':'Trunk','attributes':['id',_0x74e3('0x2'),_0x74e3('0x33'),_0x74e3('0x34')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x74e3('0x35'),'attributes':['id',_0x74e3('0x2'),_0x74e3('0x33'),_0x74e3('0x34')]},{'model':'Interval','as':_0x74e3('0x36'),'attributes':['id',_0x74e3('0x2')],'include':[{'model':_0x74e3('0x36'),'as':_0x74e3('0x37'),'attributes':['id',_0x74e3('0x2'),_0x74e3('0x38')]}]}]},'log':_0x74e3('0x0')});};}; \ No newline at end of file +var _0x735f=['name','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue'];(function(_0x36c367,_0x506b7a){var _0x5daa53=function(_0x1aa2e6){while(--_0x1aa2e6){_0x36c367['push'](_0x36c367['shift']());}};_0x5daa53(++_0x506b7a);}(_0x735f,0xb4));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf735('0x0')]=function(){return function(){return client[_0xf735('0x1')](_0xf735('0x2'),{'options':{'raw':![],'attributes':['id',_0xf735('0x3'),_0xf735('0x4'),'acwTimeout','autopause',_0xf735('0x5'),_0xf735('0x6'),_0xf735('0x7'),_0xf735('0x8'),_0xf735('0x9'),_0xf735('0xa'),_0xf735('0xb'),_0xf735('0xc'),'dialPredictiveOptimizationPercentage',_0xf735('0xd'),_0xf735('0xe'),_0xf735('0xf'),_0xf735('0x10'),_0xf735('0x11'),_0xf735('0x12'),_0xf735('0x13'),_0xf735('0x14'),_0xf735('0x15'),'dialBusyMaxRetry',_0xf735('0x16'),_0xf735('0x17'),_0xf735('0x18'),'dialGlobalMaxRetry',_0xf735('0x19'),_0xf735('0x1a'),_0xf735('0x1b'),'dialCheckDuplicateType',_0xf735('0x1c'),_0xf735('0x1d'),'dialAMDGreeting',_0xf735('0x1e'),_0xf735('0x1f'),_0xf735('0x20'),_0xf735('0x21'),_0xf735('0x22'),_0xf735('0x23'),_0xf735('0x24'),_0xf735('0x25'),'dialRecallMeTimeout','dialRecallInQueue',_0xf735('0x26'),'dialAgiAfterHangupAgent',_0xf735('0x27'),_0xf735('0x28'),_0xf735('0x5'),'strategy',_0xf735('0x29'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xf735('0x2a'),_0xf735('0x2b'),_0xf735('0x2c'),'dialAbandonedMaxRetry',_0xf735('0x2d'),_0xf735('0x2e'),_0xf735('0x2f'),_0xf735('0x30'),'dialAgentRejectRetryFrequency',_0xf735('0x31'),_0xf735('0x32'),_0xf735('0x33'),_0xf735('0x34'),'dialPreviewRecallmeReminder'],'include':[{'model':_0xf735('0x35'),'as':_0xf735('0x35'),'attributes':['id',_0xf735('0x3'),_0xf735('0x36'),_0xf735('0x37')]},{'model':'Pause','as':_0xf735('0x38'),'attributes':['id','name']},{'model':_0xf735('0x35'),'as':_0xf735('0x39'),'attributes':['id',_0xf735('0x3'),_0xf735('0x36'),_0xf735('0x37')]},{'model':'Interval','as':_0xf735('0x3a'),'attributes':['id',_0xf735('0x3')],'include':[{'model':_0xf735('0x3a'),'as':_0xf735('0x3b'),'attributes':['id',_0xf735('0x3'),_0xf735('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index b624438..fef5f08 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(_0xb7115d,_0x294d03){var _0x6929e3=function(_0x2177c6){while(--_0x2177c6){_0xb7115d['push'](_0xb7115d['shift']());}};_0x6929e3(++_0x294d03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x2f417c,_0x54b399){var _0xcf52dc=function(_0x585f2e){while(--_0x585f2e){_0x2f417c['push'](_0x2f417c['shift']());}};_0xcf52dc(++_0x54b399);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 a13c4d1..6488d8c 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 _0x0ef6=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x53bcdf,_0x3859e4){var _0x1205e1=function(_0x46c50a){while(--_0x46c50a){_0x53bcdf['push'](_0x53bcdf['shift']());}};_0x1205e1(++_0x3859e4);}(_0x0ef6,0x1bf));var _0x60ef=function(_0x5c7c08,_0x37c4f2){_0x5c7c08=_0x5c7c08-0x0;var _0x4fa094=_0x0ef6[_0x5c7c08];return _0x4fa094;};'use strict';var client=require(_0x60ef('0x0'));exports[_0x60ef('0x1')]=function(_0x1a0979){return function(){return client['Request'](_0x60ef('0x2'),{'options':{'where':{'VoiceQueueId':_0x1a0979,'paused':!![]},'raw':!![]},'log':_0x60ef('0x1')});};}; \ No newline at end of file +var _0x0c9f=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x0c9f,0x88));var _0xf0c9=function(_0x2a91ac,_0xd6f8f2){_0x2a91ac=_0x2a91ac-0x0;var _0x5ca0bb=_0x0c9f[_0x2a91ac];return _0x5ca0bb;};'use strict';var client=require('../client');exports[_0xf0c9('0x0')]=function(_0x17bf3c){return function(){return client[_0xf0c9('0x1')](_0xf0c9('0x2'),{'options':{'where':{'VoiceQueueId':_0x17bf3c,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 106b049..5fafefd 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3c770a,_0x31af61){var _0x489a6a=function(_0x572d01){while(--_0x572d01){_0x3c770a['push'](_0x3c770a['shift']());}};_0x489a6a(++_0x31af61);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x43b8ed,_0x594c0e){var _0x2d0f58=function(_0x2504bf){while(--_0x2504bf){_0x43b8ed['push'](_0x43b8ed['shift']());}};_0x2d0f58(++_0x594c0e);}(_0x7a54,0x106));var _0x47a5=function(_0x28078d,_0x571d88){_0x28078d=_0x28078d-0x0;var _0x591c36=_0x7a54[_0x28078d];return _0x591c36;};'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 diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 857821f..b6814a1 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 _0x1654=['blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension'];(function(_0x1fb062,_0xa1afb){var _0x427d67=function(_0x221135){while(--_0x221135){_0x1fb062['push'](_0x1fb062['shift']());}};_0x427d67(++_0xa1afb);}(_0x1654,0x1af));var _0x4165=function(_0x4404db,_0x3ecde9){_0x4404db=_0x4404db-0x0;var _0x426aad=_0x1654[_0x4404db];return _0x426aad;};'use strict';var client=require(_0x4165('0x0'));exports[_0x4165('0x1')]={};exports[_0x4165('0x2')]=function(_0x449b34){return client[_0x4165('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x449b34[_0x4165('0x4')],'transfererchannel':_0x449b34[_0x4165('0x5')],'transferercalleridnum':_0x449b34[_0x4165('0x6')],'transferercalleridname':_0x449b34[_0x4165('0x7')],'transfererconnectedlinenum':_0x449b34[_0x4165('0x8')],'transfererconnectedlinename':_0x449b34['transfererconnectedlinename'],'transfereraccountcode':_0x449b34[_0x4165('0x9')],'transferercontext':_0x449b34['transferercontext'],'transfererexten':_0x449b34[_0x4165('0xa')],'transfererlinkedid':_0x449b34['transfererlinkedid'],'transfereechannel':_0x449b34[_0x4165('0xb')],'transfereecalleridnum':_0x449b34[_0x4165('0xc')],'transfereecalleridname':_0x449b34['transfereecalleridname'],'transfereeconnectedlinenum':_0x449b34[_0x4165('0xd')],'transfereeconnectedlinename':_0x449b34[_0x4165('0xe')],'transfereeaccountcode':_0x449b34['transfereeaccountcode'],'transfereecontext':_0x449b34[_0x4165('0xf')],'transfereeexten':_0x449b34[_0x4165('0x10')],'transfereelinkedid':_0x449b34[_0x4165('0x11')],'isexternal':_0x449b34[_0x4165('0x12')],'context':_0x449b34['context'],'extension':_0x449b34[_0x4165('0x13')],'type':_0x4165('0x14')},'log':_0x4165('0x15')});};exports[_0x4165('0x16')]=function(_0x115175){return client[_0x4165('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x115175['result'],'transfererchannel':_0x115175[_0x4165('0x17')],'transferercalleridnum':_0x115175[_0x4165('0x18')],'transferercalleridname':_0x115175['origtransferercalleridname'],'transfererconnectedlinenum':_0x115175[_0x4165('0x19')],'transfererconnectedlinename':_0x115175[_0x4165('0x1a')],'transfereraccountcode':_0x115175[_0x4165('0x1b')],'transferercontext':_0x115175[_0x4165('0x1c')],'transfererexten':_0x115175[_0x4165('0x1d')],'transfererlinkedid':_0x115175['origtransfererlinkedid'],'transfereechannel':_0x115175[_0x4165('0x1e')],'transfereecalleridnum':_0x115175[_0x4165('0x1f')],'transfereecalleridname':_0x115175[_0x4165('0x20')],'transfereeconnectedlinenum':_0x115175[_0x4165('0x21')],'transfereeconnectedlinename':_0x115175[_0x4165('0x22')],'transfereeaccountcode':_0x115175[_0x4165('0x23')],'transfereecontext':_0x115175[_0x4165('0x24')],'transfereeexten':_0x115175[_0x4165('0x25')],'transfereelinkedid':_0x115175[_0x4165('0x26')],'isexternal':_0x115175[_0x4165('0x12')],'context':_0x115175['origtransferercontext'],'extension':_0x115175[_0x4165('0x27')],'type':_0x4165('0x28')},'log':_0x4165('0x15')});}; \ No newline at end of file +var _0x850e=['transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel'];(function(_0x14d950,_0x1ccfbb){var _0xb7a2a2=function(_0x15cb2b){while(--_0x15cb2b){_0x14d950['push'](_0x14d950['shift']());}};_0xb7a2a2(++_0x1ccfbb);}(_0x850e,0x13a));var _0xe850=function(_0x3b3002,_0x913b2e){_0x3b3002=_0x3b3002-0x0;var _0x3d5bb9=_0x850e[_0x3b3002];return _0x3d5bb9;};'use strict';var client=require(_0xe850('0x0'));exports[_0xe850('0x1')]={};exports[_0xe850('0x2')]=function(_0x1b9e23){return client[_0xe850('0x3')](_0xe850('0x4'),{'body':{'result':_0x1b9e23['result'],'transfererchannel':_0x1b9e23[_0xe850('0x5')],'transferercalleridnum':_0x1b9e23[_0xe850('0x6')],'transferercalleridname':_0x1b9e23[_0xe850('0x7')],'transfererconnectedlinenum':_0x1b9e23[_0xe850('0x8')],'transfererconnectedlinename':_0x1b9e23[_0xe850('0x9')],'transfereraccountcode':_0x1b9e23[_0xe850('0xa')],'transferercontext':_0x1b9e23[_0xe850('0xb')],'transfererexten':_0x1b9e23[_0xe850('0xc')],'transfererlinkedid':_0x1b9e23['transfererlinkedid'],'transfereechannel':_0x1b9e23[_0xe850('0xd')],'transfereecalleridnum':_0x1b9e23[_0xe850('0xe')],'transfereecalleridname':_0x1b9e23[_0xe850('0xf')],'transfereeconnectedlinenum':_0x1b9e23[_0xe850('0x10')],'transfereeconnectedlinename':_0x1b9e23['transfereeconnectedlinename'],'transfereeaccountcode':_0x1b9e23[_0xe850('0x11')],'transfereecontext':_0x1b9e23[_0xe850('0x12')],'transfereeexten':_0x1b9e23[_0xe850('0x13')],'transfereelinkedid':_0x1b9e23[_0xe850('0x14')],'isexternal':_0x1b9e23['isexternal'],'context':_0x1b9e23['context'],'extension':_0x1b9e23['extension'],'type':_0xe850('0x15')},'log':_0xe850('0x4')});};exports[_0xe850('0x16')]=function(_0x2aea01){return client[_0xe850('0x3')](_0xe850('0x4'),{'body':{'result':_0x2aea01[_0xe850('0x17')],'transfererchannel':_0x2aea01[_0xe850('0x18')],'transferercalleridnum':_0x2aea01[_0xe850('0x19')],'transferercalleridname':_0x2aea01['origtransferercalleridname'],'transfererconnectedlinenum':_0x2aea01['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2aea01[_0xe850('0x1a')],'transfereraccountcode':_0x2aea01[_0xe850('0x1b')],'transferercontext':_0x2aea01[_0xe850('0x1c')],'transfererexten':_0x2aea01[_0xe850('0x1d')],'transfererlinkedid':_0x2aea01[_0xe850('0x1e')],'transfereechannel':_0x2aea01[_0xe850('0x1f')],'transfereecalleridnum':_0x2aea01[_0xe850('0x20')],'transfereecalleridname':_0x2aea01['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2aea01['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2aea01['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2aea01[_0xe850('0x21')],'transfereecontext':_0x2aea01[_0xe850('0x22')],'transfereeexten':_0x2aea01[_0xe850('0x23')],'transfereelinkedid':_0x2aea01[_0xe850('0x24')],'isexternal':_0x2aea01[_0xe850('0x25')],'context':_0x2aea01[_0xe850('0x26')],'extension':_0x2aea01[_0xe850('0x27')],'type':_0xe850('0x28')},'log':_0xe850('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9fe6e4f..9a83206 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 _0xef17=['format','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','channels','resolve','StopMixMonitor','stop','%s.%s','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','exten','context','trunks','outboundChannels','outbound','run','event','custom:','faxAccounts','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','%s/%s','SIP','name','timers','timer','agents','QueuePause','isConnected','error','asterisk','username','pick','reload','module','then','message','ami\x20disconnected','join','command','action','Command','content','catch','voiceQueues','hasOwnProperty','push','length','find','undefined','values','voicechannel','uniqueid','channel','wav','Action','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase'];(function(_0x34f0fb,_0x3323b2){var _0x9b7b2b=function(_0x3cca84){while(--_0x3cca84){_0x34f0fb['push'](_0x34f0fb['shift']());}};_0x9b7b2b(++_0x3323b2);}(_0xef17,0x136));var _0x7ef1=function(_0x44f23c,_0x42e5e3){_0x44f23c=_0x44f23c-0x0;var _0x181238=_0xef17[_0x44f23c];return _0x181238;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var jayson=require(_0x7ef1('0x2'));var schema=require(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var config=require(_0x7ef1('0x5'));var properties=require(_0x7ef1('0x6'));var ami=require(_0x7ef1('0x7'));var VoiceQueueSummary=require(_0x7ef1('0x8'));exports['listen']=function(_0x1d2f83,_0x514b70,_0x138ed1){return new Promise(function(_0x498596,_0x34a040){var _0x4ba2f0={'QueuePause':function(_0x5aec63){return new Promise(function(_0x10c896){var _0x3398a6=util['format'](_0x7ef1('0x9'),_0x7ef1('0xa'),_0x5aec63[_0x7ef1('0xb')]);if(_0x1d2f83[_0x7ef1('0xc')]&&_0x1d2f83[_0x7ef1('0xc')][_0x3398a6]&&_0x1d2f83[_0x7ef1('0xc')][_0x3398a6][_0x7ef1('0xd')]){_0x1d2f83['timers'][_0x3398a6]['updateAcw']();}if(_0x1d2f83[_0x7ef1('0xe')][_0x3398a6]){_0x1d2f83['agents'][_0x3398a6]['updateStatusRealtime']({'statePause':_0x5aec63['pause']?!![]:![]});}_0x10c896({'code':0xc8,'message':_0x7ef1('0xf')});});},'Reload':function(_0x51e226){var _0x36ddf9=this;return new Promise(function(_0x29c920,_0x32eed0){if(ami[_0x7ef1('0x10')]()==![]){return _0x32eed0(_0x36ddf9[_0x7ef1('0x11')](0x1f4,[config[_0x7ef1('0x12')]['ip'],config[_0x7ef1('0x12')][_0x7ef1('0x13')],'ami\x20disconnected']['join']('\x20')));}_0x51e226=_[_0x7ef1('0x14')](_0x51e226,_['keys'](properties[_0x7ef1('0x15')][_0x7ef1('0x16')]));_0x51e226['action']='Reload';return ami['Action'](_0x51e226)[_0x7ef1('0x17')](function(_0x4da0fa){_0x29c920({'code':0xc8,'message':_0x4da0fa[_0x7ef1('0x18')]});})['catch'](function(_0x5a7b2b){_0x32eed0(_0x36ddf9['error'](0x1f5,_0x5a7b2b[_0x7ef1('0x18')]));});});},'Command':function(_0x575a75){var _0x38c5a7=this;return new Promise(function(_0x2a8fab,_0x5291b0){if(ami['isConnected']()==![]){return _0x5291b0(_0x38c5a7[_0x7ef1('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x7ef1('0x12')][_0x7ef1('0x13')],_0x7ef1('0x19')][_0x7ef1('0x1a')]('\x20')));}_0x575a75=_[_0x7ef1('0x14')](_0x575a75,_0x7ef1('0x1b'));_0x575a75[_0x7ef1('0x1c')]=_0x7ef1('0x1d');return ami['Action'](_0x575a75)[_0x7ef1('0x17')](function(_0x3b118f){_0x2a8fab({'code':0xc8,'message':_0x3b118f[_0x7ef1('0x1e')]});})[_0x7ef1('0x1f')](function(_0x31b5bf){_0x5291b0(_0x38c5a7[_0x7ef1('0x11')](0x1f5,_0x31b5bf[_0x7ef1('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x144e74){var _0x508a5f=[];for(var _0x4b1ace in _0x1d2f83[_0x7ef1('0x20')]){if(_0x1d2f83[_0x7ef1('0x20')][_0x7ef1('0x21')](_0x4b1ace)){var _0xcfce5e=_0x1d2f83[_0x7ef1('0x20')][_0x4b1ace];var _0x4cfa16=new VoiceQueueSummary(_0xcfce5e);_0x508a5f[_0x7ef1('0x22')](_0x4cfa16);}}_0x144e74({'count':_0x508a5f[_0x7ef1('0x23')],'rows':_0x508a5f});});},'UpdateVoiceQueue':function(_0x445902){return new Promise(function(_0x4af5f5,_0x232f4e){var _0x238fdc=_[_0x7ef1('0x24')](_0x1d2f83['voiceQueues'],{'id':parseInt(_0x445902['id'])});var _0x2e8f1b=_['omit'](_0x445902,['id']);if(_0x238fdc){for(var _0x3306b0 in _0x2e8f1b){if(typeof _0x2e8f1b[_0x3306b0]!==_0x7ef1('0x25')&&typeof _0x238fdc[_0x3306b0]!=='undefined'){_0x238fdc[_0x3306b0]=_0x2e8f1b[_0x3306b0];}}_0x4af5f5(_0x238fdc);}else{_0x232f4e();}});},'VoiceChannels':function(){return new Promise(function(_0x5f25de){var _0x1c674a=_[_0x7ef1('0x26')](_0x1d2f83['channels']);_0x5f25de({'count':_0x1c674a[_0x7ef1('0x23')],'rows':_0x1c674a});});},'VoiceChannelMixMonitor':function(_0x56fe40){var _0x3aa113=this;return new Promise(function(_0x47d6eb,_0x122999){if(ami[_0x7ef1('0x10')]()==![]){return _0x122999(_0x3aa113['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x7ef1('0x19')][_0x7ef1('0x1a')]('\x20')));}var _0x596abe=schema(properties[_0x7ef1('0x27')])['validate'](_0x56fe40);if(_0x596abe['length']>0x0){return _0x122999(_0x3aa113[_0x7ef1('0x11')](0x1f4,_['map'](_0x596abe,_0x7ef1('0x18'))[_0x7ef1('0x1a')](',\x20')));}var _0x112c22=_[_0x7ef1('0x24')](_0x1d2f83['channels'],{'uniqueid':_0x56fe40[_0x7ef1('0x28')]});if(_0x112c22&&_0x112c22[_0x7ef1('0x29')]){var _0x525915=util['format']('%s.%s',_0x56fe40['filename']||_0x56fe40[_0x7ef1('0x28')],_0x56fe40['format']||_0x7ef1('0x2a'));return ami[_0x7ef1('0x2b')]({'action':_0x7ef1('0x2c'),'channel':_0x112c22[_0x7ef1('0x29')],'file':_0x525915,'options':_0x7ef1('0x2d')})[_0x7ef1('0x17')](function(_0x43c6c4){var _0x278aaf=_[_0x7ef1('0x24')](_0x112c22[_0x7ef1('0x2e')],{'filename':_0x7ef1('0x2f')+_0x525915['toLowerCase']()});if(_[_0x7ef1('0x30')](_0x278aaf)){_0x112c22[_0x7ef1('0x2e')]['push']({'filename':_0x7ef1('0x2f')+_0x525915[_0x7ef1('0x31')](),'createdAt':moment()[_0x7ef1('0x32')](_0x7ef1('0x33')),'mixmonitorid':_0x43c6c4[_0x7ef1('0x34')],'status':'rec'});}else{_0x278aaf[_0x7ef1('0x34')]=_0x43c6c4[_0x7ef1('0x34')];_0x278aaf[_0x7ef1('0x35')]=_0x7ef1('0x36');}_0x47d6eb({'code':0xc8,'message':[_0x56fe40[_0x7ef1('0x28')],_0x7ef1('0x37'),_0x43c6c4[_0x7ef1('0x34')]][_0x7ef1('0x1a')]('\x20'),'mixmonitorid':_0x43c6c4[_0x7ef1('0x34')]});})[_0x7ef1('0x1f')](function(_0x252176){_0x122999(_0x3aa113[_0x7ef1('0x11')](0x1f5,[_0x56fe40[_0x7ef1('0x28')],_0x252176[_0x7ef1('0x18')][_0x7ef1('0x31')]()]['join']('\x20')));});}else{return _0x122999(_0x3aa113[_0x7ef1('0x11')](0x1f5,_0x7ef1('0x38')));}});},'VoiceChannelStopMixMonitor':function(_0x302212){var _0xc26328=this;return new Promise(function(_0x3889d7,_0x1328e2){if(ami[_0x7ef1('0x10')]()==![]){return _0x1328e2(_0xc26328[_0x7ef1('0x11')](0x1f4,[config[_0x7ef1('0x12')]['ip'],config[_0x7ef1('0x12')][_0x7ef1('0x13')],_0x7ef1('0x19')][_0x7ef1('0x1a')]('\x20')));}var _0x56036d=schema(properties[_0x7ef1('0x27')])[_0x7ef1('0x3')](_0x302212);if(_0x56036d[_0x7ef1('0x23')]>0x0){return _0x1328e2(_0xc26328[_0x7ef1('0x11')](0x1f4,_[_0x7ef1('0x39')](_0x56036d,_0x7ef1('0x18'))['join'](',\x20')));}var _0x4448ca=_[_0x7ef1('0x24')](_0x1d2f83[_0x7ef1('0x3a')],{'uniqueid':_0x302212[_0x7ef1('0x28')]});if(_0x4448ca){return Promise[_0x7ef1('0x3b')]()[_0x7ef1('0x17')](function(){if(_0x4448ca['channel']){return ami[_0x7ef1('0x2b')]({'action':_0x7ef1('0x3c'),'channel':_0x4448ca[_0x7ef1('0x29')],'mixmonitorid':_0x302212[_0x7ef1('0x34')]})['catch'](function(){});}})[_0x7ef1('0x17')](function(){if(_0x4448ca['destinationchannel']){return ami['Action']({'action':_0x7ef1('0x3c'),'channel':_0x4448ca['destinationchannel'],'mixmonitorid':_0x302212[_0x7ef1('0x34')]})['catch'](function(){});}})[_0x7ef1('0x17')](function(){var _0x17e41f=_[_0x7ef1('0x24')](_0x4448ca[_0x7ef1('0x2e')],{'mixmonitorid':_0x302212[_0x7ef1('0x34')]});if(_0x17e41f){_0x17e41f[_0x7ef1('0x35')]=_0x7ef1('0x3d');}})[_0x7ef1('0x17')](function(){var _0x49e089=util['format'](_0x7ef1('0x3e'),_0x302212[_0x7ef1('0x3f')]||_0x302212['uniqueid'],_0x302212[_0x7ef1('0x32')]||_0x7ef1('0x2a'));var _0xd06ca9=_['find'](_0x4448ca['monitors'],{'filename':_0x7ef1('0x2f')+_0x49e089['toLowerCase']()});if(_0xd06ca9){_0xd06ca9['status']=_0x7ef1('0x3d');}})[_0x7ef1('0x17')](function(){_0x3889d7({'code':0xc8,'message':[_0x302212[_0x7ef1('0x28')],_0x7ef1('0x40')][_0x7ef1('0x1a')]('\x20')});})['catch'](function(_0xd4a407){_0x1328e2(_0xc26328['error'](0x1f5,[_0x302212[_0x7ef1('0x28')],_0xd4a407['message'][_0x7ef1('0x31')]()]['join']('\x20')));});}else{return _0x1328e2(_0xc26328['error'](0x1f5,_0x7ef1('0x38')));}});},'VoiceQueuesChannels':function(_0x560bc0){var _0x1cbd0c=this;return new Promise(function(_0x30a4ce){var _0x54a0bb=_[_0x7ef1('0x26')](_0x1d2f83[_0x7ef1('0x41')]);var _0x2d996f={'count':_0x54a0bb['length'],'rows':_0x54a0bb};if(_0x560bc0&&_0x560bc0[_0x7ef1('0x42')]){if(![_0x7ef1('0x43'),'outbound'][_0x7ef1('0x44')](_0x560bc0[_0x7ef1('0x42')])){return _0x34a040(_0x1cbd0c[_0x7ef1('0x11')](0x190,_0x7ef1('0x45')));}var _0x2f17a7=_[_0x7ef1('0x46')](_0x54a0bb,function(_0x3439c9){return _0x3439c9['type']===_0x560bc0['type'];});_0x2d996f[_0x7ef1('0x47')]=_0x2f17a7[_0x7ef1('0x23')];_0x2d996f[_0x7ef1('0x48')]=_0x2f17a7;}_0x30a4ce(_0x2d996f);});},'VoiceQueuesChannel':function(_0xa38413){var _0x129ed9=this;return new Promise(function(_0x3769e1,_0x3ee5e0){var _0x1c0a83=schema(properties[_0x7ef1('0x49')])[_0x7ef1('0x3')](_0xa38413);if(_0x1c0a83[_0x7ef1('0x23')]>0x0){return _0x3ee5e0(_0x129ed9['error'](0x1f4,_[_0x7ef1('0x39')](_0x1c0a83,_0x7ef1('0x18'))[_0x7ef1('0x1a')](',\x20')));}var _0x21f564=_[_0x7ef1('0x24')](_0x1d2f83['queueChannels'],{'uniqueid':_0xa38413[_0x7ef1('0x28')]});if(_0x21f564){_0x3769e1(_0x21f564);}else{return _0x3ee5e0(_0x129ed9[_0x7ef1('0x11')](0x1f5,_0x7ef1('0x38')));}});},'VoiceQueuesChannelHangup':function(_0x4806d6){var _0xfa8316=this;return new Promise(function(_0x3e054e,_0x5bbcfb){if(ami[_0x7ef1('0x10')]()==![]){return _0x5bbcfb(_0xfa8316[_0x7ef1('0x11')](0x1f4,[config[_0x7ef1('0x12')]['ip'],config[_0x7ef1('0x12')][_0x7ef1('0x13')],_0x7ef1('0x19')][_0x7ef1('0x1a')]('\x20')));}var _0x35539f=schema(properties[_0x7ef1('0x4a')])[_0x7ef1('0x3')](_0x4806d6);if(_0x35539f[_0x7ef1('0x23')]>0x0){return _0x5bbcfb(_0xfa8316['error'](0x1f4,_[_0x7ef1('0x39')](_0x35539f,_0x7ef1('0x18'))['join'](',\x20')));}var _0x415bb1=_[_0x7ef1('0x24')](_0x1d2f83[_0x7ef1('0x41')],{'uniqueid':_0x4806d6['uniqueid']});if(_0x415bb1&&_0x415bb1[_0x7ef1('0x29')]){return ami[_0x7ef1('0x2b')]({'action':'Hangup','channel':_0x415bb1[_0x7ef1('0x29')]})[_0x7ef1('0x17')](function(_0x3c4aab){_0x3e054e({'code':0xc8,'message':[_0x4806d6['uniqueid'],_0x3c4aab[_0x7ef1('0x18')][_0x7ef1('0x31')]()][_0x7ef1('0x1a')]('\x20')});})['catch'](function(_0xf79c9f){_0x5bbcfb(_0xfa8316[_0x7ef1('0x11')](0x1f5,[_0x4806d6[_0x7ef1('0x28')],_0xf79c9f['message'][_0x7ef1('0x31')]()][_0x7ef1('0x1a')]('\x20')));});}else{return _0x5bbcfb(_0xfa8316['error'](0x1f5,_0x7ef1('0x38')));}});},'VoiceQueuesChannelRedirect':function(_0x446476){var _0x2de250=this;return new Promise(function(_0x3f2800,_0x431844){if(ami[_0x7ef1('0x10')]()==![]){return _0x431844(_0x2de250[_0x7ef1('0x11')](0x1f4,[config[_0x7ef1('0x12')]['ip'],config[_0x7ef1('0x12')]['username'],_0x7ef1('0x19')]['join']('\x20')));}var _0x253f6b=schema(properties['voicequeuechannelredirect'])[_0x7ef1('0x3')](_0x446476);if(_0x253f6b[_0x7ef1('0x23')]>0x0){return _0x431844(_0x2de250[_0x7ef1('0x11')](0x1f4,_[_0x7ef1('0x39')](_0x253f6b,'message')[_0x7ef1('0x1a')](',\x20')));}var _0x44a4e3=_[_0x7ef1('0x24')](_0x1d2f83[_0x7ef1('0x41')],{'uniqueid':_0x446476[_0x7ef1('0x28')]});if(_0x44a4e3&&_0x44a4e3['channel']){return ami[_0x7ef1('0x2b')]({'action':'Redirect','channel':_0x44a4e3['channel'],'exten':_0x446476[_0x7ef1('0x4b')],'context':_0x446476[_0x7ef1('0x4c')]||_0x44a4e3[_0x7ef1('0x4c')],'priority':0x1})[_0x7ef1('0x17')](function(_0x1d7981){_0x3f2800({'code':0xc8,'message':[_0x446476['uniqueid'],_0x1d7981[_0x7ef1('0x18')][_0x7ef1('0x31')]()]['join']('\x20')});})[_0x7ef1('0x1f')](function(_0x1387ee){_0x431844(_0x2de250[_0x7ef1('0x11')](0x1f5,[_0x446476[_0x7ef1('0x28')],_0x1387ee['message'][_0x7ef1('0x31')]()][_0x7ef1('0x1a')]('\x20')));});}else{return _0x431844(_0x2de250[_0x7ef1('0x11')](0x1f5,_0x7ef1('0x38')));}});},'Agents':function(_0x55061c){return new Promise(function(_0x5dbc7b){var _0x321473=_[_0x7ef1('0x26')](_0x1d2f83[_0x7ef1('0xe')]);if(_0x55061c&&_0x55061c['id']){var _0x18be83=_[_0x7ef1('0x24')](_0x321473,function(_0x3206d6){return _0x3206d6['id']===_0x55061c['id'];});_0x5dbc7b(_0x18be83);}else{_0x5dbc7b({'count':_0x321473['length'],'rows':_0x321473});}});},'Telephones':function(){return new Promise(function(_0x5d9d54){var _0x5c5e9a=_[_0x7ef1('0x26')](_0x1d2f83['telephones']);_0x5d9d54({'count':_0x5c5e9a['length'],'rows':_0x5c5e9a});});},'Trunks':function(){return new Promise(function(_0xbf256a){var _0x24f3ed=_['values'](_0x1d2f83[_0x7ef1('0x4d')]);_0xbf256a({'count':_0x24f3ed[_0x7ef1('0x23')],'rows':_0x24f3ed});});},'OutboundChannels':function(){return new Promise(function(_0x323912){var _0xfd038d=_[_0x7ef1('0x26')](_0x1d2f83[_0x7ef1('0x4e')]);_0x323912({'count':_0xfd038d[_0x7ef1('0x23')],'rows':_0xfd038d});});},'Outbound':function(){return new Promise(function(_0x337518){_0x337518(_0x1d2f83[_0x7ef1('0x4f')]);});},'Campaigns':function(){return new Promise(function(_0x157d6e){var _0x17bd86=_[_0x7ef1('0x26')](_0x1d2f83['campaigns']);_0x157d6e({'count':_0x17bd86[_0x7ef1('0x23')],'rows':_0x17bd86});});},'VoiceQueuesPreview':function(_0x58b0a7){var _0x32344c=this;return new Promise(function(_0x5194e7,_0x48ef87){_0x514b70[_0x7ef1('0x50')](_0x58b0a7['id'])[_0x7ef1('0x17')](function(_0xebae30){_0x5194e7({'code':0xc8,'message':_0xebae30[_0x7ef1('0x18')]});})[_0x7ef1('0x1f')](function(_0x8d48b4){_0x48ef87(_0x32344c['error'](0x1f4,_0x8d48b4[_0x7ef1('0x18')]));});});},'EventManager':function(_0x3afee0){var _0x80067a=this;return new Promise(function(_0x375072,_0x254577){if(!_0x3afee0[_0x7ef1('0x51')]){return _0x254577(_0x80067a[_0x7ef1('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x7ef1('0x52')+_0x3afee0[_0x7ef1('0x51')],_0x3afee0[_0x7ef1('0x18')]);_0x375072({'code':0xc8,'message':_0x3afee0});});},'FaxAccounts':function(){return new Promise(function(_0x162e8d){var _0x14c723=_[_0x7ef1('0x26')](_0x1d2f83[_0x7ef1('0x53')]);_0x162e8d({'count':_0x14c723['length'],'rows':_0x14c723});});},'SendFax':function(_0x1f274a){var _0x1a89d4=this;return new Promise(function(_0xc169c0,_0x5db8a0){_0x138ed1['send'](_0x1f274a)[_0x7ef1('0x17')](function(_0x18aca9){_0xc169c0({'code':0xc8,'message':_0x18aca9[_0x7ef1('0x18')]});})[_0x7ef1('0x1f')](function(_0x4ce8a3){_0x5db8a0(_0x1a89d4[_0x7ef1('0x11')](0x1f4,_0x4ce8a3[_0x7ef1('0x18')]));});});},'CheckAfterSend':function(_0x33c1b8){var _0x516bf5=this;return new Promise(function(_0x58c27d,_0x513753){_0x138ed1['checkAfterSend'](_0x33c1b8)[_0x7ef1('0x17')](function(_0x4feeba){_0x58c27d({'code':0xc8,'message':_0x4feeba[_0x7ef1('0x18')]});})[_0x7ef1('0x1f')](function(_0x2be8aa){_0x513753(_0x516bf5[_0x7ef1('0x11')](0x1f4,_0x2be8aa[_0x7ef1('0x18')]));});});}};var _0x50109c=jayson[_0x7ef1('0x54')](_0x4ba2f0)[_0x7ef1('0x55')]();_0x50109c['on']('error',function(_0x5d7de0){return _0x34a040(_0x5d7de0);});_0x50109c[_0x7ef1('0x56')](0x232a,_0x7ef1('0x57'),function(){console[_0x7ef1('0x58')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x498596(_0x7ef1('0x59')+0x232a);});});}; \ No newline at end of file +var _0x8958=['push','find','omit','undefined','channels','length','voicechannel','map','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','validate','StopMixMonitor','destinationchannel','toLowerCase','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','inbound','outbound','includes','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','values','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','../properties','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','reload','action','Reload','Action','then','message','catch','error','username','command','content','voiceQueues','hasOwnProperty'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8958,0x93));var _0x8895=function(_0x51d43b,_0x1bcc8c){_0x51d43b=_0x51d43b-0x0;var _0x445477=_0x8958[_0x51d43b];return _0x445477;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x8895('0x1'));var ami=require('../ami');var VoiceQueueSummary=require(_0x8895('0x2'));exports[_0x8895('0x3')]=function(_0x26d8e3,_0x59e641,_0x22fa52){return new Promise(function(_0x2f03ad,_0x124e1e){var _0x40cec6={'QueuePause':function(_0x33013a){return new Promise(function(_0x51376b){var _0xe018b8=util[_0x8895('0x4')](_0x8895('0x5'),_0x8895('0x6'),_0x33013a[_0x8895('0x7')]);if(_0x26d8e3[_0x8895('0x8')]&&_0x26d8e3[_0x8895('0x8')][_0xe018b8]&&_0x26d8e3[_0x8895('0x8')][_0xe018b8][_0x8895('0x9')]){_0x26d8e3[_0x8895('0x8')][_0xe018b8]['updateAcw']();}if(_0x26d8e3[_0x8895('0xa')][_0xe018b8]){_0x26d8e3[_0x8895('0xa')][_0xe018b8][_0x8895('0xb')]({'statePause':_0x33013a[_0x8895('0xc')]?!![]:![]});}_0x51376b({'code':0xc8,'message':_0x8895('0xd')});});},'Reload':function(_0xaf93bc){var _0x5af0ef=this;return new Promise(function(_0x24c53d,_0x34e856){if(ami[_0x8895('0xe')]()==![]){return _0x34e856(_0x5af0ef['error'](0x1f4,[config['asterisk']['ip'],config[_0x8895('0xf')]['username'],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}_0xaf93bc=_[_0x8895('0x12')](_0xaf93bc,_[_0x8895('0x13')](properties[_0x8895('0x14')]['module']));_0xaf93bc[_0x8895('0x15')]=_0x8895('0x16');return ami[_0x8895('0x17')](_0xaf93bc)[_0x8895('0x18')](function(_0x2848b7){_0x24c53d({'code':0xc8,'message':_0x2848b7[_0x8895('0x19')]});})[_0x8895('0x1a')](function(_0x26cee0){_0x34e856(_0x5af0ef[_0x8895('0x1b')](0x1f5,_0x26cee0[_0x8895('0x19')]));});});},'Command':function(_0x24fef0){var _0x6b8a16=this;return new Promise(function(_0x2df795,_0x54e6d4){if(ami['isConnected']()==![]){return _0x54e6d4(_0x6b8a16['error'](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')][_0x8895('0x1c')],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}_0x24fef0=_[_0x8895('0x12')](_0x24fef0,_0x8895('0x1d'));_0x24fef0[_0x8895('0x15')]='Command';return ami[_0x8895('0x17')](_0x24fef0)[_0x8895('0x18')](function(_0x2a403){_0x2df795({'code':0xc8,'message':_0x2a403[_0x8895('0x1e')]});})[_0x8895('0x1a')](function(_0x4d092d){_0x54e6d4(_0x6b8a16['error'](0x1f5,_0x4d092d[_0x8895('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x398382){var _0x38f7ad=[];for(var _0x24a376 in _0x26d8e3['voiceQueues']){if(_0x26d8e3[_0x8895('0x1f')][_0x8895('0x20')](_0x24a376)){var _0x187a15=_0x26d8e3['voiceQueues'][_0x24a376];var _0x4aee03=new VoiceQueueSummary(_0x187a15);_0x38f7ad[_0x8895('0x21')](_0x4aee03);}}_0x398382({'count':_0x38f7ad['length'],'rows':_0x38f7ad});});},'UpdateVoiceQueue':function(_0x3d51b0){return new Promise(function(_0x3e3b48,_0x10b48f){var _0xf5fb66=_[_0x8895('0x22')](_0x26d8e3['voiceQueues'],{'id':parseInt(_0x3d51b0['id'])});var _0x4d567a=_[_0x8895('0x23')](_0x3d51b0,['id']);if(_0xf5fb66){for(var _0x37ac3a in _0x4d567a){if(typeof _0x4d567a[_0x37ac3a]!==_0x8895('0x24')&&typeof _0xf5fb66[_0x37ac3a]!==_0x8895('0x24')){_0xf5fb66[_0x37ac3a]=_0x4d567a[_0x37ac3a];}}_0x3e3b48(_0xf5fb66);}else{_0x10b48f();}});},'VoiceChannels':function(){return new Promise(function(_0x19b6dd){var _0x560b93=_['values'](_0x26d8e3[_0x8895('0x25')]);_0x19b6dd({'count':_0x560b93[_0x8895('0x26')],'rows':_0x560b93});});},'VoiceChannelMixMonitor':function(_0x1c16f6){var _0x29f565=this;return new Promise(function(_0x1eabb6,_0x52f2ac){if(ami[_0x8895('0xe')]()==![]){return _0x52f2ac(_0x29f565['error'](0x1f4,[config[_0x8895('0xf')]['ip'],config['asterisk'][_0x8895('0x1c')],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}var _0x3e71fa=schema(properties[_0x8895('0x27')])['validate'](_0x1c16f6);if(_0x3e71fa[_0x8895('0x26')]>0x0){return _0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f4,_[_0x8895('0x28')](_0x3e71fa,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x574f0e=_[_0x8895('0x22')](_0x26d8e3['channels'],{'uniqueid':_0x1c16f6[_0x8895('0x29')]});if(_0x574f0e&&_0x574f0e['channel']){var _0x21c22b=util[_0x8895('0x4')](_0x8895('0x2a'),_0x1c16f6[_0x8895('0x2b')]||_0x1c16f6[_0x8895('0x29')],_0x1c16f6['format']||_0x8895('0x2c'));return ami['Action']({'action':_0x8895('0x2d'),'channel':_0x574f0e[_0x8895('0x2e')],'file':_0x21c22b,'options':_0x8895('0x2f')})[_0x8895('0x18')](function(_0x25fa39){var _0x16e110=_['find'](_0x574f0e[_0x8895('0x30')],{'filename':_0x8895('0x31')+_0x21c22b['toLowerCase']()});if(_[_0x8895('0x32')](_0x16e110)){_0x574f0e['monitors'][_0x8895('0x21')]({'filename':_0x8895('0x31')+_0x21c22b['toLowerCase'](),'createdAt':moment()[_0x8895('0x4')](_0x8895('0x33')),'mixmonitorid':_0x25fa39['mixmonitorid'],'status':'rec'});}else{_0x16e110[_0x8895('0x34')]=_0x25fa39[_0x8895('0x34')];_0x16e110[_0x8895('0x35')]=_0x8895('0x36');}_0x1eabb6({'code':0xc8,'message':[_0x1c16f6[_0x8895('0x29')],'MixMonitor\x20Success',_0x25fa39[_0x8895('0x34')]][_0x8895('0x11')]('\x20'),'mixmonitorid':_0x25fa39[_0x8895('0x34')]});})[_0x8895('0x1a')](function(_0x1d9e26){_0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f5,[_0x1c16f6['uniqueid'],_0x1d9e26[_0x8895('0x19')]['toLowerCase']()][_0x8895('0x11')]('\x20')));});}else{return _0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1ca234){var _0x4e8fbc=this;return new Promise(function(_0x1e6395,_0x5e6413){if(ami['isConnected']()==![]){return _0x5e6413(_0x4e8fbc['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}var _0x596531=schema(properties['voicechannel'])[_0x8895('0x37')](_0x1ca234);if(_0x596531[_0x8895('0x26')]>0x0){return _0x5e6413(_0x4e8fbc['error'](0x1f4,_[_0x8895('0x28')](_0x596531,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x3b873b=_[_0x8895('0x22')](_0x26d8e3['channels'],{'uniqueid':_0x1ca234['uniqueid']});if(_0x3b873b){return Promise['resolve']()[_0x8895('0x18')](function(){if(_0x3b873b['channel']){return ami[_0x8895('0x17')]({'action':_0x8895('0x38'),'channel':_0x3b873b[_0x8895('0x2e')],'mixmonitorid':_0x1ca234[_0x8895('0x34')]})['catch'](function(){});}})[_0x8895('0x18')](function(){if(_0x3b873b[_0x8895('0x39')]){return ami[_0x8895('0x17')]({'action':_0x8895('0x38'),'channel':_0x3b873b[_0x8895('0x39')],'mixmonitorid':_0x1ca234[_0x8895('0x34')]})[_0x8895('0x1a')](function(){});}})[_0x8895('0x18')](function(){var _0x55fb78=_[_0x8895('0x22')](_0x3b873b[_0x8895('0x30')],{'mixmonitorid':_0x1ca234['mixmonitorid']});if(_0x55fb78){_0x55fb78[_0x8895('0x35')]='stop';}})['then'](function(){var _0x13546d=util[_0x8895('0x4')](_0x8895('0x2a'),_0x1ca234['filename']||_0x1ca234[_0x8895('0x29')],_0x1ca234['format']||_0x8895('0x2c'));var _0x152197=_[_0x8895('0x22')](_0x3b873b[_0x8895('0x30')],{'filename':_0x8895('0x31')+_0x13546d[_0x8895('0x3a')]()});if(_0x152197){_0x152197[_0x8895('0x35')]='stop';}})['then'](function(){_0x1e6395({'code':0xc8,'message':[_0x1ca234[_0x8895('0x29')],_0x8895('0x3b')]['join']('\x20')});})[_0x8895('0x1a')](function(_0x580a07){_0x5e6413(_0x4e8fbc['error'](0x1f5,[_0x1ca234[_0x8895('0x29')],_0x580a07['message'][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')));});}else{return _0x5e6413(_0x4e8fbc[_0x8895('0x1b')](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannels':function(_0x2714d3){var _0x39a1d9=this;return new Promise(function(_0x306481){var _0x38d6ae=_['values'](_0x26d8e3[_0x8895('0x3d')]);var _0x3e25e7={'count':_0x38d6ae[_0x8895('0x26')],'rows':_0x38d6ae};if(_0x2714d3&&_0x2714d3['type']){if(![_0x8895('0x3e'),_0x8895('0x3f')][_0x8895('0x40')](_0x2714d3[_0x8895('0x41')])){return _0x124e1e(_0x39a1d9[_0x8895('0x1b')](0x190,_0x8895('0x42')));}var _0x434ab8=_[_0x8895('0x43')](_0x38d6ae,function(_0x13488f){return _0x13488f[_0x8895('0x41')]===_0x2714d3['type'];});_0x3e25e7[_0x8895('0x44')]=_0x434ab8[_0x8895('0x26')];_0x3e25e7[_0x8895('0x45')]=_0x434ab8;}_0x306481(_0x3e25e7);});},'VoiceQueuesChannel':function(_0x10560a){var _0x3c8a97=this;return new Promise(function(_0x4dfa4b,_0x1b3c99){var _0x38c88f=schema(properties[_0x8895('0x46')])[_0x8895('0x37')](_0x10560a);if(_0x38c88f[_0x8895('0x26')]>0x0){return _0x1b3c99(_0x3c8a97['error'](0x1f4,_[_0x8895('0x28')](_0x38c88f,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x59e725=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x10560a[_0x8895('0x29')]});if(_0x59e725){_0x4dfa4b(_0x59e725);}else{return _0x1b3c99(_0x3c8a97['error'](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x207548){var _0x564284=this;return new Promise(function(_0x2b6ceb,_0x26f68c){if(ami['isConnected']()==![]){return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')][_0x8895('0x1c')],'ami\x20disconnected']['join']('\x20')));}var _0x4f8902=schema(properties[_0x8895('0x47')])[_0x8895('0x37')](_0x207548);if(_0x4f8902['length']>0x0){return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f4,_[_0x8895('0x28')](_0x4f8902,'message')[_0x8895('0x11')](',\x20')));}var _0x4ef5b9=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x207548[_0x8895('0x29')]});if(_0x4ef5b9&&_0x4ef5b9[_0x8895('0x2e')]){return ami[_0x8895('0x17')]({'action':'Hangup','channel':_0x4ef5b9['channel']})[_0x8895('0x18')](function(_0x216abb){_0x2b6ceb({'code':0xc8,'message':[_0x207548['uniqueid'],_0x216abb[_0x8895('0x19')][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')});})[_0x8895('0x1a')](function(_0x4e4e57){_0x26f68c(_0x564284[_0x8895('0x1b')](0x1f5,[_0x207548[_0x8895('0x29')],_0x4e4e57[_0x8895('0x19')][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')));});}else{return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x129af3){var _0x2bffd7=this;return new Promise(function(_0x21c7bb,_0xb903d8){if(ami[_0x8895('0xe')]()==![]){return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x13b143=schema(properties[_0x8895('0x48')])[_0x8895('0x37')](_0x129af3);if(_0x13b143[_0x8895('0x26')]>0x0){return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f4,_['map'](_0x13b143,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x59a910=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x129af3[_0x8895('0x29')]});if(_0x59a910&&_0x59a910[_0x8895('0x2e')]){return ami[_0x8895('0x17')]({'action':'Redirect','channel':_0x59a910[_0x8895('0x2e')],'exten':_0x129af3[_0x8895('0x49')],'context':_0x129af3[_0x8895('0x4a')]||_0x59a910[_0x8895('0x4a')],'priority':0x1})[_0x8895('0x18')](function(_0x7a312c){_0x21c7bb({'code':0xc8,'message':[_0x129af3[_0x8895('0x29')],_0x7a312c['message'][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')});})['catch'](function(_0x1ffefd){_0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f5,[_0x129af3[_0x8895('0x29')],_0x1ffefd[_0x8895('0x19')][_0x8895('0x3a')]()]['join']('\x20')));});}else{return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0xe6bef9){return new Promise(function(_0x2440cb){var _0x5d2fb0=_[_0x8895('0x4b')](_0x26d8e3[_0x8895('0xa')]);if(_0xe6bef9&&_0xe6bef9['id']){var _0x140b2a=_[_0x8895('0x22')](_0x5d2fb0,function(_0x57e429){return _0x57e429['id']===_0xe6bef9['id'];});_0x2440cb(_0x140b2a);}else{_0x2440cb({'count':_0x5d2fb0[_0x8895('0x26')],'rows':_0x5d2fb0});}});},'Telephones':function(){return new Promise(function(_0x495a99){var _0x48f11a=_[_0x8895('0x4b')](_0x26d8e3[_0x8895('0x4c')]);_0x495a99({'count':_0x48f11a[_0x8895('0x26')],'rows':_0x48f11a});});},'Trunks':function(){return new Promise(function(_0x561f93){var _0x23c936=_['values'](_0x26d8e3[_0x8895('0x4d')]);_0x561f93({'count':_0x23c936[_0x8895('0x26')],'rows':_0x23c936});});},'OutboundChannels':function(){return new Promise(function(_0x3893fb){var _0x42d342=_[_0x8895('0x4b')](_0x26d8e3['outboundChannels']);_0x3893fb({'count':_0x42d342['length'],'rows':_0x42d342});});},'Outbound':function(){return new Promise(function(_0x270fef){_0x270fef(_0x26d8e3['outbound']);});},'Campaigns':function(){return new Promise(function(_0x3707a6){var _0x2b5fb2=_['values'](_0x26d8e3[_0x8895('0x4e')]);_0x3707a6({'count':_0x2b5fb2[_0x8895('0x26')],'rows':_0x2b5fb2});});},'VoiceQueuesPreview':function(_0x3ace6f){var _0xc4c8dc=this;return new Promise(function(_0x166e9a,_0x4f80a3){_0x59e641[_0x8895('0x4f')](_0x3ace6f['id'])['then'](function(_0x4e1733){_0x166e9a({'code':0xc8,'message':_0x4e1733[_0x8895('0x19')]});})['catch'](function(_0x39a9f7){_0x4f80a3(_0xc4c8dc[_0x8895('0x1b')](0x1f4,_0x39a9f7[_0x8895('0x19')]));});});},'EventManager':function(_0x39f5e5){var _0x53591d=this;return new Promise(function(_0x4d802e,_0x571731){if(!_0x39f5e5[_0x8895('0x50')]){return _0x571731(_0x53591d[_0x8895('0x1b')](0x1f4,_0x8895('0x51')));}ami[_0x8895('0x52')](_0x8895('0x53')+_0x39f5e5[_0x8895('0x50')],_0x39f5e5['message']);_0x4d802e({'code':0xc8,'message':_0x39f5e5});});},'FaxAccounts':function(){return new Promise(function(_0xeed6da){var _0x102b48=_[_0x8895('0x4b')](_0x26d8e3['faxAccounts']);_0xeed6da({'count':_0x102b48[_0x8895('0x26')],'rows':_0x102b48});});},'SendFax':function(_0x565bb8){var _0x10f104=this;return new Promise(function(_0x4bfd9b,_0x291bec){_0x22fa52[_0x8895('0x54')](_0x565bb8)['then'](function(_0x3fd5f0){_0x4bfd9b({'code':0xc8,'message':_0x3fd5f0[_0x8895('0x19')]});})['catch'](function(_0x2c12e3){_0x291bec(_0x10f104[_0x8895('0x1b')](0x1f4,_0x2c12e3[_0x8895('0x19')]));});});},'CheckAfterSend':function(_0xef59db){var _0x214730=this;return new Promise(function(_0x17c993,_0x18413b){_0x22fa52['checkAfterSend'](_0xef59db)[_0x8895('0x18')](function(_0x5ada19){_0x17c993({'code':0xc8,'message':_0x5ada19[_0x8895('0x19')]});})[_0x8895('0x1a')](function(_0x32d52c){_0x18413b(_0x214730[_0x8895('0x1b')](0x1f4,_0x32d52c['message']));});});}};var _0x3be1e4=jayson[_0x8895('0x55')](_0x40cec6)[_0x8895('0x56')]();_0x3be1e4['on'](_0x8895('0x1b'),function(_0x2d803b){return _0x124e1e(_0x2d803b);});_0x3be1e4[_0x8895('0x3')](0x232a,_0x8895('0x57'),function(){console[_0x8895('0x58')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2f03ad(_0x8895('0x59')+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 c8fa63b..328898c 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 _0x62dd=['defaults','redis','localhost','info','[CM][%s][%s]','emit','exec','data1','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','toLowerCase','lodash','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact'];(function(_0xc5a3cd,_0x30cf6e){var _0x4673be=function(_0x96d021){while(--_0x96d021){_0xc5a3cd['push'](_0xc5a3cd['shift']());}};_0x4673be(++_0x30cf6e);}(_0x62dd,0x10d));var _0xd62d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd62d('0x0'));var BPromise=require(_0xd62d('0x1'));var Redis=require('ioredis');var util=require(_0xd62d('0x2'));var config=require(_0xd62d('0x3'));var logger=require('../../../../config/logger')(_0xd62d('0x4'));var cmContactRpc=require(_0xd62d('0x5'));config['redis']=_[_0xd62d('0x6')](config[_0xd62d('0x7')],{'host':_0xd62d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd62d('0x7')]));function emit(_0x88984a,_0x27e721,_0x132462,_0x10baba,_0x322be1){logger[_0xd62d('0x9')](_0xd62d('0xa'),_0x88984a,_0x27e721['id'],_0x132462,_0x10baba,JSON['stringify'](_0x322be1));io['to'](_0x132462)[_0xd62d('0xb')](_0x10baba,_0x322be1);}exports[_0xd62d('0xc')]=function(_0x1fbfe7,_0x72f46d,_0x3fa178,_0x4fa0f1){var _0x2322ab,_0x208c8c;var _0x45a51f={};var _0xf7ee4;var _0x53ed76=Number(_0x3fa178[_0xd62d('0xd')]);var _0x3ee591=_0x3fa178['data2']?Boolean(Number(_0x3fa178['data2'])):![];var _0x2a74ae;var _0x3569db=![];if(!_[_0xd62d('0xe')](_0x3fa178[_0xd62d('0xf')])){if(_0x3fa178['data5']=='1')_0x3569db=!![];}if(!_0x3569db){if(_0x4fa0f1['xmd-contactid']){_0x45a51f['id']=_0x4fa0f1[_0xd62d('0x10')];}}if(!_0x45a51f['id']){_0x45a51f[_0xd62d('0x11')]=_0x53ed76;_0x2a74ae=_0x3fa178[_0xd62d('0x12')]&&_0x3fa178[_0xd62d('0x12')]!=='0'?_0x3fa178[_0xd62d('0x12')][_0xd62d('0x13')](','):[_0xd62d('0x14')];_0x45a51f[_0xd62d('0x15')]=_[_0xd62d('0x16')](_0x2a74ae,function(_0x508303){var _0x42ecad={};_0x42ecad[_0x508303]=_0x4fa0f1[_0xd62d('0x17')]?_0x4fa0f1['destcalleridnum']:_0x4fa0f1[_0xd62d('0x18')];return _0x42ecad;});_0xf7ee4=_0x4fa0f1[_0xd62d('0x17')]?_0x4fa0f1[_0xd62d('0x19')]:_0x4fa0f1[_0xd62d('0x18')];}var _0x39bace=['id',_0xd62d('0x1a'),'lastName','phone',_0xd62d('0x1b'),_0xd62d('0x1c'),_0xd62d('0x11'),_0xd62d('0x1d'),'scheduledAt',_0xd62d('0x1e')];var _0x28affd=_[_0xd62d('0x1f')](_0x39bace,_0x2a74ae);BPromise[_0xd62d('0x20')]()[_0xd62d('0x21')](cmContactRpc[_0xd62d('0x22')]({'attributes':_0x28affd,'where':_0x45a51f,'phone':_0xf7ee4}))[_0xd62d('0x21')](function(_0x18c75e){_0x208c8c=_0x18c75e;if(!_[_0xd62d('0x23')](_0x208c8c)){if(_0x208c8c[_0xd62d('0x24')]===0x1){_0x2322ab=_0x208c8c[0x0];logger[_0xd62d('0x9')](_0xd62d('0x25'),_0x4fa0f1[_0xd62d('0x26')],_0x72f46d['id'],_0x2322ab['id']);}else{logger['info'](_0xd62d('0x27'),_0x4fa0f1[_0xd62d('0x26')],_0x72f46d['id'],_[_0xd62d('0x16')](_0x208c8c,'id')['join'](','));}return;}else{logger[_0xd62d('0x9')](_0xd62d('0x28'),_0x4fa0f1[_0xd62d('0x26')],_0x72f46d['id']);var _0x80dffc={'ListId':_0x53ed76};var _0x3ff0ab=_0x3fa178[_0xd62d('0x29')]&&_0x3fa178[_0xd62d('0x29')]!=='0'?_0x3fa178[_0xd62d('0x29')]:'phone';if(_0x3ee591){logger[_0xd62d('0x9')](_0xd62d('0x2a'),_0x4fa0f1[_0xd62d('0x26')],_0x72f46d['id']);_0x80dffc[_0x3ff0ab]=_[_0xd62d('0xe')](_0x4fa0f1[_0xd62d('0x17')])?_0x4fa0f1[_0xd62d('0x18')]:_0x4fa0f1[_0xd62d('0x19')];if(_['isNil'](_0x4fa0f1['routeId'])){_0x80dffc['firstName']=_0x4fa0f1['calleridname']&&_0x4fa0f1[_0xd62d('0x2b')]!==_0xd62d('0x2c')?_0x4fa0f1[_0xd62d('0x2b')]:_0xd62d('0x2d');}else{_0x80dffc['firstName']=_0x4fa0f1[_0xd62d('0x2e')]&&_0x4fa0f1['destcalleridname']!==''?_0x4fa0f1['destcalleridname']:_0xd62d('0x2d');}return BPromise['resolve']()[_0xd62d('0x21')](cmContactRpc[_0xd62d('0x2f')](_0x80dffc))[_0xd62d('0x21')](function(_0x24f933){_0x2322ab=_0x24f933;_0x208c8c[_0xd62d('0x30')](_0x24f933);if(_0x2322ab){logger[_0xd62d('0x9')](_0xd62d('0x31'),_0x4fa0f1[_0xd62d('0x26')],_0x72f46d['id'],_0x2322ab['id']);}return;});}else{logger[_0xd62d('0x9')](_0xd62d('0x32'),_0x4fa0f1['uniqueid'],_0x72f46d['id']);_0x80dffc[_0x3ff0ab]=_['isNil'](_0x4fa0f1[_0xd62d('0x17')])?_0x4fa0f1[_0xd62d('0x18')]:_0x4fa0f1[_0xd62d('0x19')];if(_[_0xd62d('0xe')](_0x4fa0f1['routeId'])){_0x80dffc[_0xd62d('0x1a')]=_0x4fa0f1[_0xd62d('0x2b')]&&_0x4fa0f1[_0xd62d('0x2b')]!==_0xd62d('0x2c')?_0x4fa0f1[_0xd62d('0x2b')]:_0xd62d('0x2d');}else{_0x80dffc[_0xd62d('0x1a')]=_0x4fa0f1['destcalleridname']&&_0x4fa0f1[_0xd62d('0x2e')]!==''?_0x4fa0f1[_0xd62d('0x2e')]:'Unknown';}_0x2322ab=_0x80dffc;_0x208c8c[_0xd62d('0x30')](_0x80dffc);return;}}})[_0xd62d('0x21')](function(){if(_0x1fbfe7){emit(_0x4fa0f1['uniqueid'],_0x72f46d,util[_0xd62d('0x33')]('user:%s',_0x1fbfe7['name']),util['format'](_0xd62d('0x34'),_0x3fa178[_0xd62d('0x35')][_0xd62d('0x36')]()),{'evt':_['merge'](_0x4fa0f1,{'autoCreate':_0x3ee591}),'contact':_0x2322ab===undefined?{}:_0x2322ab,'contacts':_0x208c8c[_0xd62d('0x24')]===0x0?undefined:_0x208c8c});}});}; \ No newline at end of file +var _0xc35f=['calleridname','','destcalleridname','Unknown','resolve','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','ListId','createdAt','updatedAt','union','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled'];(function(_0x3d9778,_0x4c909a){var _0x14e368=function(_0x253f9e){while(--_0x253f9e){_0x3d9778['push'](_0x3d9778['shift']());}};_0x14e368(++_0x4c909a);}(_0xc35f,0x16f));var _0xfc35=function(_0x27acb0,_0x4bc9eb){_0x27acb0=_0x27acb0-0x0;var _0x2c3e10=_0xc35f[_0x27acb0];return _0x2c3e10;};'use strict';var _=require(_0xfc35('0x0'));var BPromise=require(_0xfc35('0x1'));var Redis=require(_0xfc35('0x2'));var util=require(_0xfc35('0x3'));var config=require(_0xfc35('0x4'));var logger=require(_0xfc35('0x5'))(_0xfc35('0x6'));var cmContactRpc=require(_0xfc35('0x7'));config[_0xfc35('0x8')]=_[_0xfc35('0x9')](config[_0xfc35('0x8')],{'host':_0xfc35('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfc35('0x8')]));function emit(_0x16077a,_0x2a16ea,_0xfd2169,_0x53ee60,_0x56a014){logger[_0xfc35('0xb')]('[CM][%s][%s]',_0x16077a,_0x2a16ea['id'],_0xfd2169,_0x53ee60,JSON[_0xfc35('0xc')](_0x56a014));io['to'](_0xfd2169)[_0xfc35('0xd')](_0x53ee60,_0x56a014);}exports[_0xfc35('0xe')]=function(_0x138fe0,_0x5bd7df,_0x5d2967,_0x464f9b){var _0x436afc,_0x5f57f3;var _0x7f2a17={};var _0x3cd92f;var _0x53e553=Number(_0x5d2967[_0xfc35('0xf')]);var _0xa1c840=_0x5d2967[_0xfc35('0x10')]?Boolean(Number(_0x5d2967[_0xfc35('0x10')])):![];var _0x5324bc;var _0x38757f=![];if(!_[_0xfc35('0x11')](_0x5d2967[_0xfc35('0x12')])){if(_0x5d2967[_0xfc35('0x12')]=='1')_0x38757f=!![];}if(!_0x38757f){if(_0x464f9b[_0xfc35('0x13')]){_0x7f2a17['id']=_0x464f9b[_0xfc35('0x13')];}}if(!_0x7f2a17['id']){_0x7f2a17['ListId']=_0x53e553;_0x5324bc=_0x5d2967[_0xfc35('0x14')]&&_0x5d2967[_0xfc35('0x14')]!=='0'?_0x5d2967['data3']['split'](','):['phone'];_0x7f2a17[_0xfc35('0x15')]=_[_0xfc35('0x16')](_0x5324bc,function(_0x13a1ca){var _0x371fff={};_0x371fff[_0x13a1ca]=_0x464f9b[_0xfc35('0x17')]?_0x464f9b[_0xfc35('0x18')]:_0x464f9b[_0xfc35('0x19')];return _0x371fff;});_0x3cd92f=_0x464f9b['routeId']?_0x464f9b[_0xfc35('0x18')]:_0x464f9b[_0xfc35('0x19')];}var _0x4fd805=['id',_0xfc35('0x1a'),_0xfc35('0x1b'),_0xfc35('0x1c'),_0xfc35('0x1d'),_0xfc35('0x1e'),_0xfc35('0x1f'),_0xfc35('0x20'),'scheduledAt',_0xfc35('0x21')];var _0x570a08=_[_0xfc35('0x22')](_0x4fd805,_0x5324bc);BPromise['resolve']()['then'](cmContactRpc[_0xfc35('0x23')]({'attributes':_0x570a08,'where':_0x7f2a17,'phone':_0x3cd92f}))[_0xfc35('0x24')](function(_0x4507ac){_0x5f57f3=_0x4507ac;if(!_[_0xfc35('0x25')](_0x5f57f3)){if(_0x5f57f3[_0xfc35('0x26')]===0x1){_0x436afc=_0x5f57f3[0x0];logger['info'](_0xfc35('0x27'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id'],_0x436afc['id']);}else{logger[_0xfc35('0xb')](_0xfc35('0x29'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id'],_['map'](_0x5f57f3,'id')[_0xfc35('0x2a')](','));}return;}else{logger['info'](_0xfc35('0x2b'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id']);var _0x7dbebb={'ListId':_0x53e553};var _0x455f47=_0x5d2967[_0xfc35('0x2c')]&&_0x5d2967[_0xfc35('0x2c')]!=='0'?_0x5d2967[_0xfc35('0x2c')]:_0xfc35('0x1c');if(_0xa1c840){logger['info'](_0xfc35('0x2d'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id']);_0x7dbebb[_0x455f47]=_[_0xfc35('0x11')](_0x464f9b[_0xfc35('0x17')])?_0x464f9b[_0xfc35('0x19')]:_0x464f9b[_0xfc35('0x18')];if(_['isNil'](_0x464f9b[_0xfc35('0x17')])){_0x7dbebb[_0xfc35('0x1a')]=_0x464f9b[_0xfc35('0x2e')]&&_0x464f9b[_0xfc35('0x2e')]!==_0xfc35('0x2f')?_0x464f9b[_0xfc35('0x2e')]:'Unknown';}else{_0x7dbebb[_0xfc35('0x1a')]=_0x464f9b[_0xfc35('0x30')]&&_0x464f9b[_0xfc35('0x30')]!==''?_0x464f9b[_0xfc35('0x30')]:_0xfc35('0x31');}return BPromise[_0xfc35('0x32')]()[_0xfc35('0x24')](cmContactRpc['createContact'](_0x7dbebb))[_0xfc35('0x24')](function(_0xc2cc90){_0x436afc=_0xc2cc90;_0x5f57f3[_0xfc35('0x33')](_0xc2cc90);if(_0x436afc){logger[_0xfc35('0xb')](_0xfc35('0x34'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id'],_0x436afc['id']);}return;});}else{logger[_0xfc35('0xb')](_0xfc35('0x35'),_0x464f9b[_0xfc35('0x28')],_0x5bd7df['id']);_0x7dbebb[_0x455f47]=_[_0xfc35('0x11')](_0x464f9b[_0xfc35('0x17')])?_0x464f9b[_0xfc35('0x19')]:_0x464f9b[_0xfc35('0x18')];if(_['isNil'](_0x464f9b['routeId'])){_0x7dbebb[_0xfc35('0x1a')]=_0x464f9b['calleridname']&&_0x464f9b[_0xfc35('0x2e')]!==''?_0x464f9b[_0xfc35('0x2e')]:_0xfc35('0x31');}else{_0x7dbebb[_0xfc35('0x1a')]=_0x464f9b[_0xfc35('0x30')]&&_0x464f9b[_0xfc35('0x30')]!==''?_0x464f9b[_0xfc35('0x30')]:_0xfc35('0x31');}_0x436afc=_0x7dbebb;_0x5f57f3[_0xfc35('0x33')](_0x7dbebb);return;}}})['then'](function(){if(_0x138fe0){emit(_0x464f9b[_0xfc35('0x28')],_0x5bd7df,util['format'](_0xfc35('0x36'),_0x138fe0[_0xfc35('0x37')]),util[_0xfc35('0x38')]('trigger:%s',_0x5d2967['action'][_0xfc35('0x39')]()),{'evt':_[_0xfc35('0x3a')](_0x464f9b,{'autoCreate':_0xa1c840}),'contact':_0x436afc===undefined?{}:_0x436afc,'contacts':_0x5f57f3[_0xfc35('0x26')]===0x0?undefined:_0x5f57f3});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 44973ee..ad82f13 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 _0xd9aa=['value','ChatWebsiteId','upperFirst','AccountId','operator','interaction','message','event','agent','membername','lastevent','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','motionChannel','undefined','debug','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','contactmanager','motionbar','browser','data1','TemplateId','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','trigger:%s','exec','integration','accounts','queue','routeId','query','search','replace','channel','length','AllConditions','checkConditions','AnyConditions','checkTrigger:\x20trigger','field','account','chat'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0xd9aa,0x93));var _0xad9a=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd9aa[_0x2aa0e7];return _0x1472c0;};'use strict';var util=require(_0xad9a('0x0'));var _=require(_0xad9a('0x1'));var url=require(_0xad9a('0x2'));var Mustache=require(_0xad9a('0x3'));var Redis=require(_0xad9a('0x4'));var urlforward=require(_0xad9a('0x5'));var integration=require(_0xad9a('0x6'));var cmContact=require(_0xad9a('0x7'));var script=require('./script');var config=require('../../../config/environment');var logger=require(_0xad9a('0x8'))('trigger');var ami=require(_0xad9a('0x9'));config[_0xad9a('0xa')]=_[_0xad9a('0xb')](config['redis'],{'host':_0xad9a('0xc'),'port':0x18eb});var io=require(_0xad9a('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x342b4a,_0x466a72){return _0x342b4a==_0x466a72;},'not_equals':function(_0x5a6c64,_0x3ecfca){return _0x5a6c64!=_0x3ecfca;}};var barAndWebActions=[_0xad9a('0xe'),_0xad9a('0x2'),_0xad9a('0xf')];function Trigger(_0x5e35fa){this[_0xad9a('0x10')]=_0x5e35fa[_0xad9a('0x10')];this[_0xad9a('0x11')]=_0x5e35fa['agents'];this[_0xad9a('0x12')]=_0x5e35fa[_0xad9a('0x12')];this[_0xad9a('0x13')]=_0x5e35fa[_0xad9a('0x13')];this['voiceExtensions']=_0x5e35fa['voiceExtensions'];this[_0xad9a('0x14')]=_0x5e35fa[_0xad9a('0x14')];this[_0xad9a('0x15')]=_0x5e35fa[_0xad9a('0x15')];this[_0xad9a('0x16')]=_0x5e35fa[_0xad9a('0x16')];this[_0xad9a('0x17')]=_0x5e35fa[_0xad9a('0x17')];this[_0xad9a('0x18')]=_0x5e35fa[_0xad9a('0x18')];this['deskAccounts']=_0x5e35fa[_0xad9a('0x19')];this[_0xad9a('0x1a')]=_0x5e35fa[_0xad9a('0x1a')];this[_0xad9a('0x1b')]=_0x5e35fa[_0xad9a('0x1b')];this[_0xad9a('0x1c')]=_0x5e35fa['dynamics365Accounts'];this[_0xad9a('0x1d')]=_0x5e35fa[_0xad9a('0x1d')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xad9a('0x16')],'freshdesk':this[_0xad9a('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xad9a('0x18')],'desk':this[_0xad9a('0x19')],'vtiger':this[_0xad9a('0x1a')],'dynamics365':this[_0xad9a('0x1c')],'freshsales':this[_0xad9a('0x1d')],'servicenow':this[_0xad9a('0x1b')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x1f'),this['syncCustomEvent']['bind'](this));ami['on'](_0xad9a('0x20'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x22'),this['syncCustomEvent'][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x23'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x24'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0xad9a('0x26'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x27'),this['syncCustomEvent'][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x28'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0xad9a('0x21')]['bind'](this));ami['on'](_0xad9a('0x29'),this['syncCustomEvent']['bind'](this));ami['on'](_0xad9a('0x2a'),this['syncAgentDial']['bind'](this));ami['on']('custom:dialconnect',this[_0xad9a('0x2b')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x2c'),this[_0xad9a('0x2b')]['bind'](this));ami['on'](_0xad9a('0x2d'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on']('custom:closedinteraction',this[_0xad9a('0x21')]['bind'](this));ami['on']('custom:substatus',this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x2e'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x2f'),this['syncCustomEvent'][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x30'),this[_0xad9a('0x21')][_0xad9a('0x1e')](this));ami['on'](_0xad9a('0x31'),this[_0xad9a('0x21')]['bind'](this));ami['on'](_0xad9a('0x32'),this['syncCustomEvent']['bind'](this));}Trigger[_0xad9a('0x33')][_0xad9a('0x34')]=function(_0x3e55a5,_0x487d43,_0x371d7b){logger['info'](_0x3e55a5,_0x487d43,JSON[_0xad9a('0x35')](_0x371d7b));io['to'](_0x3e55a5)[_0xad9a('0x34')](_0x487d43,_0x371d7b);};Trigger['prototype'][_0xad9a('0x21')]=function(_0x5376b6){var _0x1eef2a=_['clone'](_0x5376b6);if(typeof _0x1eef2a[_0xad9a('0x36')]===_0xad9a('0x37')){_0x1eef2a[_0xad9a('0x36')]='voice';}logger[_0xad9a('0x38')](_0xad9a('0x21'),util[_0xad9a('0x39')](_0x1eef2a,{'showHidden':!![],'depth':null}));this[_0xad9a('0x3a')](_0x1eef2a);};Trigger['prototype'][_0xad9a('0x2b')]=function(_0x21307b){if(this[_0xad9a('0x11')][_0x21307b[_0xad9a('0x3b')]]){this['syncCustomEvent'](_0x21307b);}};Trigger[_0xad9a('0x33')][_0xad9a('0x3a')]=function(_0x46c646){var _0x78a553;for(var _0x4b80b0 in this[_0xad9a('0x10')]){if(this[_0xad9a('0x10')][_0xad9a('0x3c')](_0x4b80b0)){if(this['triggers'][_0x4b80b0][_0xad9a('0x3d')]){_0x78a553=this[_0xad9a('0x3e')](this[_0xad9a('0x10')][_0x4b80b0],_0x46c646);if(_0x78a553){_[_0xad9a('0x3f')](_0x46c646,_0x46c646[_0xad9a('0x40')]);for(var _0x3e1e75=0x0,_0x46f8d9,_0x48118d,_0x1d518b;_0x3e1e750x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x52a00b,_0x1c3049){var _0x59c2e4=function(_0x2e58a4){while(--_0x2e58a4){_0x52a00b['push'](_0x52a00b['shift']());}};_0x59c2e4(++_0x1c3049);}(_0x3e74,0x175));var _0x43e7=function(_0x35b4ba,_0xf1ab0){_0x35b4ba=_0x35b4ba-0x0;var _0x574595=_0x3e74[_0x35b4ba];return _0x574595;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 3a7db5c..c310357 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 _0xf8a2=['contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','nameField','idField','indexOf','content','incident','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','trigger:browser:url','CloudProvider','serverUrl','stripTrailingSlash','unmanaged','modernAuthentication','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','data2','POST','clientId','username','password','then','catch','error','toUpperCase','GET','Bearer\x20','4.0','isNil','email','userEmail','length','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum'];(function(_0x402959,_0x33fdbd){var _0x53d473=function(_0x2223e2){while(--_0x2223e2){_0x402959['push'](_0x402959['shift']());}};_0x53d473(++_0x33fdbd);}(_0xf8a2,0x105));var _0x2f8a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf8a2[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x2f8a('0x0'));var rp=require(_0x2f8a('0x1'));var util=require(_0x2f8a('0x2'));var intUtil=require('./util');var md5=require(_0x2f8a('0x3'));var Redis=require(_0x2f8a('0x4'));var logger=require('../../../../config/logger')(_0x2f8a('0x5'));var config=require(_0x2f8a('0x6'));config[_0x2f8a('0x7')]=_[_0x2f8a('0x8')](config['redis'],{'host':_0x2f8a('0x9'),'port':0x18eb});var io=require(_0x2f8a('0xa'))(new Redis(config[_0x2f8a('0x7')]));function getAuthToken(_0x156a6a,_0x4fc409,_0x1b05ef){if(_0x156a6a['modernAuthentication']){_0x156a6a[_0x2f8a('0xb')]=_0x156a6a['CloudProvider']['data7'];_0x156a6a['tenantId']=_0x156a6a['CloudProvider'][_0x2f8a('0xc')];return Promise['resolve'](_0x156a6a['CloudProvider']['data5']);}var _0x50634e={'method':_0x2f8a('0xd'),'uri':_0x4fc409,'form':{'client_id':_0x156a6a[_0x2f8a('0xe')],'resource':_0x156a6a[_0x2f8a('0xb')],'username':_0x156a6a[_0x2f8a('0xf')],'password':_0x156a6a[_0x2f8a('0x10')],'grant_type':_0x2f8a('0x10'),'client_secret':_0x156a6a['clientSecret']},'json':!![]};return rp(_0x50634e)[_0x2f8a('0x11')](function(_0x293476){return _0x293476['access_token'];})[_0x2f8a('0x12')](function(_0x18eb25){logger[_0x2f8a('0x13')]('['+[_0x1b05ef[_0x2f8a('0x14')]()]+']\x20Wrong\x20credentials!');return _0x18eb25['message'];});}function getUser(_0x4827e7,_0x8cb4de,_0x5e1f12,_0x84697d,_0x8debc5,_0x3e03b8){return new Promise(function(_0x4dec12,_0x23cab5){return getAuthToken(_0x8cb4de,_0x84697d,_0x3e03b8)[_0x2f8a('0x11')](function(_0x11ea8f){var _0x31f665={'method':_0x2f8a('0x15'),'uri':_0x8debc5+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x2f8a('0x16')+_0x11ea8f,'OData-Version':_0x2f8a('0x17')},'json':!![]};return rp(_0x31f665);})[_0x2f8a('0x11')](function(_0x3338b3){var _0x158ed4=_0x3338b3['value'];var _0x3c9327=![];var _0x5732d8=null;if(!_[_0x2f8a('0x18')](_0x5e1f12)){if(intUtil['validateEmail'](_0x5e1f12[_0x2f8a('0x19')])){_0x4827e7[_0x2f8a('0x1a')]=_0x5e1f12[_0x2f8a('0x19')];for(_0x5732d8=0x0;_0x5732d8<_0x158ed4[_0x2f8a('0x1b')];_0x5732d8++){if(_0x158ed4[_0x5732d8]['internalemailaddress']===_0x5e1f12[_0x2f8a('0x19')]&&!_0x158ed4[_0x5732d8][_0x2f8a('0x1c')]){_0x3c9327=!![];logger['info']('['+[_0x3e03b8[_0x2f8a('0x14')]()]+_0x2f8a('0x1d')+_0x158ed4[_0x5732d8]['systemuserid']+'!');_0x4827e7[_0x2f8a('0x1e')]=_0x158ed4[_0x5732d8][_0x2f8a('0x1f')];}}}}if(!_0x3c9327){logger[_0x2f8a('0x20')]('['+[_0x3e03b8['toUpperCase']()]+_0x2f8a('0x21'));_0x4827e7['userEmail']=_0x8cb4de[_0x2f8a('0xf')];for(_0x5732d8=0x0;_0x5732d8<_0x158ed4[_0x2f8a('0x1b')];_0x5732d8++){if(_0x158ed4[_0x5732d8]['internalemailaddress']===_0x8cb4de['username']){_0x4827e7[_0x2f8a('0x1e')]=_0x158ed4[_0x5732d8][_0x2f8a('0x1f')];}}}_0x4dec12(_0x4827e7);})[_0x2f8a('0x12')](function(_0x108c91){_0x23cab5(_0x108c91[_0x2f8a('0x22')]);});});}function createEndUser(_0x19acb2,_0x4e7dfb,_0x5d3184,_0x5b4998,_0x417c15,_0x5efc9e,_0x43dc70){return new Promise(function(_0x371349,_0x344a25){return getAuthToken(_0x4e7dfb,_0x5d3184,_0x5efc9e)[_0x2f8a('0x11')](function(_0x7fb6eb){var _0x17be49=_0x5efc9e[_0x2f8a('0x23')]()===_0x2f8a('0x24')?_0x417c15[_0x2f8a('0x25')]:_0x417c15[_0x2f8a('0x26')];var _0x1a8d8d={'method':_0x2f8a('0xd'),'uri':_0x5b4998+_0x2f8a('0x27'),'body':{'fullname':_0x17be49,'firstname':_0x17be49,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2f8a('0x28')+_0x19acb2[_0x2f8a('0x1e')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x7fb6eb,'OData-Version':_0x2f8a('0x17')},'json':!![],'resolveWithFullResponse':!![]};_0x1a8d8d[_0x2f8a('0x29')][_0x43dc70]=_0x17be49;return rp(_0x1a8d8d);})[_0x2f8a('0x11')](function(_0x430945){var _0x5531ea=_0x430945[_0x2f8a('0x2a')][_0x2f8a('0x2b')];var _0x2759c4=_0x5531ea[_0x2f8a('0x2c')](_0x5531ea[_0x2f8a('0x2d')]('(')+0x1,_0x5531ea[_0x2f8a('0x2d')](')'));_0x19acb2[_0x2f8a('0x2e')]=_0x2759c4;_0x371349(_0x19acb2);})[_0x2f8a('0x12')](function(_0x4556ce){_0x344a25(_0x4556ce[_0x2f8a('0x22')]);});});}function getEndUser(_0x3d9e55,_0x774e30,_0x337d8f,_0x760e7,_0x25378e,_0xc7d116,_0x321612,_0x445ff6){var _0x11b10c=_0xc7d116[_0x2f8a('0x23')]()===_0x2f8a('0x24')?_0x25378e['destcalleridnum']:_0x25378e[_0x2f8a('0x26')];return getAuthToken(_0x774e30,_0x337d8f,_0xc7d116)[_0x2f8a('0x11')](function(_0x387d7b){_0x445ff6=_0x445ff6?_0x445ff6:_0x2f8a('0x2f');var _0x2d7b2f={'method':_0x2f8a('0x15'),'uri':_0x760e7+_0x2f8a('0x30')+_0x445ff6+'&$filter='+_0x445ff6+_0x2f8a('0x31')+_0x11b10c[_0x2f8a('0x32')]('+',_0x2f8a('0x33'))+'\x27','headers':{'Authorization':_0x2f8a('0x16')+_0x387d7b,'If-None-Match':null,'OData-Version':_0x2f8a('0x17')},'json':!![]};return rp(_0x2d7b2f);})[_0x2f8a('0x11')](function(_0xa7d17e){var _0x305574=![];if(!_0xa7d17e)return _0x305574;var _0x3fa464=_0xa7d17e[_0x2f8a('0x34')];for(var _0x4a0478=0x0;_0x4a0478<_0x3fa464[_0x2f8a('0x1b')];_0x4a0478++){if(_0x3fa464[_0x4a0478][_0x445ff6]===_0x11b10c){_0x305574=!![];_0x3d9e55[_0x2f8a('0x2e')]=_0x3fa464[_0x4a0478][_0x2f8a('0x35')];}}return _0x305574;})['then'](function(_0x3a4fff){if(_0x3a4fff)return _0x3d9e55;if(_0x321612==='nothing'){logger[_0x2f8a('0x20')]('['+[_0xc7d116[_0x2f8a('0x14')]()]+_0x2f8a('0x36'));return _0x3d9e55;}return createEndUser(_0x3d9e55,_0x774e30,_0x337d8f,_0x760e7,_0x25378e,_0xc7d116,_0x445ff6)[_0x2f8a('0x11')](function(_0x1c2ed3){logger[_0x2f8a('0x20')]('['+[_0xc7d116[_0x2f8a('0x14')]()]+_0x2f8a('0x37'),_0x1c2ed3[_0x2f8a('0x2e')]);return _0x1c2ed3;});});}function getCustomFields(_0x3c1b93,_0x17e07e,_0x5384c1){var _0x4668f4={};if(_0x3c1b93[_0x2f8a('0x1b')]>0x0){_['forEach'](_0x3c1b93,function(_0x3fd849){if(_[_0x2f8a('0x38')]([_0x2f8a('0x39'),'picklist'],_0x3fd849['type'])&&_0x3fd849[_0x2f8a('0x3a')]&&!_0x3fd849['customField']){var _0x5ae757=_0x3fd849[_0x2f8a('0x3b')][_0x2f8a('0x23')]();var _0x38ee80=_0x5ae757[_0x2f8a('0x2c')](0x0,_0x5ae757[_0x2f8a('0x3c')]('_'));var _0x5e51f1=_0x5ae757[_0x2f8a('0x2c')](_0x5ae757[_0x2f8a('0x3c')]('_')+0x1);if(_0x38ee80===_0x5384c1){_0x4668f4[_0x5e51f1]=_0x3fd849[_0x2f8a('0x3d')];}}});}return _0x4668f4;}function getTicket(_0x272f5c,_0x4aa455,_0x5f1cc3,_0x1b259c,_0x59ddd8,_0x44c2ac,_0x1aad81){return new Promise(function(_0x281751,_0x3bfa61){var _0x3acdff;return getAuthToken(_0x4aa455,_0x5f1cc3,_0x1aad81)[_0x2f8a('0x11')](function(_0x3b9264){if(_0x44c2ac['ticketType']===_0x2f8a('0x3e')){_0x3acdff={'method':_0x2f8a('0xd'),'uri':_0x1b259c+'incidents','body':Object[_0x2f8a('0x3f')]({},{'title':intUtil['getString'](_0x44c2ac[_0x2f8a('0x40')],_0x59ddd8,'\x20'),'description':intUtil[_0x2f8a('0x41')](_0x44c2ac[_0x2f8a('0x42')],_0x59ddd8,'\x0a'),'customerid_contact@odata.bind':_0x272f5c['enduserId']?_0x2f8a('0x43')+_0x272f5c[_0x2f8a('0x2e')]+')':undefined,'ownerid@odata.bind':_0x2f8a('0x28')+_0x272f5c['userId']+')','caseorigincode':'1'},getCustomFields(_0x44c2ac[_0x2f8a('0x44')],_0x59ddd8,_0x44c2ac['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x3b9264,'OData-Version':_0x2f8a('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x44c2ac[_0x2f8a('0x45')]==='phonecall'){var _0x451a7e=_0x272f5c[_0x2f8a('0x2e')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x272f5c[_0x2f8a('0x1e')]+')','participationtypemask':_0x272f5c[_0x2f8a('0x46')]===_0x2f8a('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x2f8a('0x43')+_0x272f5c[_0x2f8a('0x2e')]+')','participationtypemask':_0x272f5c[_0x2f8a('0x46')]===_0x2f8a('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2f8a('0x28')+_0x272f5c[_0x2f8a('0x1e')]+')','participationtypemask':_0x272f5c[_0x2f8a('0x46')]===_0x2f8a('0x47')?0x2:0x1}];_0x3acdff={'method':_0x2f8a('0xd'),'uri':_0x1b259c+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x2f8a('0x41')](_0x44c2ac[_0x2f8a('0x40')],_0x59ddd8,'\x20'),'phonenumber':String(_0x59ddd8['calleridnum']),'description':intUtil[_0x2f8a('0x41')](_0x44c2ac[_0x2f8a('0x42')],_0x59ddd8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x272f5c[_0x2f8a('0x2e')]?_0x2f8a('0x43')+_0x272f5c[_0x2f8a('0x2e')]+')':undefined,'ownerid@odata.bind':_0x2f8a('0x28')+_0x272f5c[_0x2f8a('0x1e')]+')','directioncode':_0x272f5c[_0x2f8a('0x46')]===_0x2f8a('0x47')?![]:!![],'phonecall_activity_parties':_0x451a7e},getCustomFields(_0x44c2ac[_0x2f8a('0x44')],_0x59ddd8,_0x44c2ac[_0x2f8a('0x45')])),'headers':{'Authorization':_0x2f8a('0x16')+_0x3b9264,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3acdff);})[_0x2f8a('0x11')](function(_0x36f073){var _0x30ce81=_0x36f073[_0x2f8a('0x2a')][_0x2f8a('0x2b')];var _0x55d12f=_0x30ce81[_0x2f8a('0x2c')](_0x30ce81['lastIndexOf']('(')+0x1,_0x30ce81[_0x2f8a('0x2d')](')'));_0x272f5c[_0x2f8a('0x48')]=_0x55d12f;_0x281751(_0x272f5c);})[_0x2f8a('0x12')](function(_0x2b0b60){_0x3bfa61(_0x2b0b60[_0x2f8a('0x22')]);});});}function emit(_0x2bf597,_0x34f5de,_0x16ac0f,_0x34fbf0){var _0x286bdf={'uri':util['format'](_0x2f8a('0x49'),_0x2bf597,_0x16ac0f,_0x34fbf0)};io['to'](util[_0x2f8a('0x4a')]('user:%s',_0x34f5de))[_0x2f8a('0x4b')](_0x2f8a('0x4c'),_0x286bdf);}exports['cs']=function(_0x1dfe77,_0x4edb94,_0x2bb96f,_0x215156,_0x30db88,_0x5843e0,_0x115a71,_0x2c73fd){var _0x4bd85d={};_0x5843e0[_0x2f8a('0xb')]=_0x5843e0['modernAuthentication']?intUtil['stripTrailingSlash'](_0x5843e0[_0x2f8a('0x4d')]['data7']):intUtil['stripTrailingSlash'](_0x5843e0['remoteUri']);_0x5843e0[_0x2f8a('0x4e')]=intUtil[_0x2f8a('0x4f')](_0x5843e0[_0x2f8a('0x4e')]);_0x4bd85d[_0x2f8a('0x46')]=_0x2c73fd===_0x2f8a('0x47')||_0x2c73fd===_0x2f8a('0x50')?_0x2f8a('0x47'):_0x2f8a('0x24');var _0x36b388=_0x5843e0[_0x2f8a('0x51')]?util[_0x2f8a('0x4a')](_0x2f8a('0x52'),_0x5843e0[_0x2f8a('0x4d')]['data7']):util['format'](_0x2f8a('0x52'),_0x5843e0[_0x2f8a('0xb')]);var _0x2bb801=util['format'](_0x2f8a('0x53'),_0x5843e0['tenantId']);var _0xaba8fc=util[_0x2f8a('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5843e0[_0x2f8a('0x4e')],_0x4edb94[_0x2f8a('0x54')],md5(_0x4edb94[_0x2f8a('0x54')]));if(_0x30db88&&_0x30db88['monitor_format']){logger[_0x2f8a('0x20')]('[QUEUE]',_0x2f8a('0x55'));_0x4edb94[_0x2f8a('0x56')]=_0xaba8fc;}else if(_0x115a71&&_0x115a71['recordingFormat']&&_0x115a71[_0x2f8a('0x57')]!==_0x2f8a('0x58')){logger[_0x2f8a('0x20')](_0x2f8a('0x59'),'Recording\x20is\x20enabled!');_0x4edb94[_0x2f8a('0x56')]=_0xaba8fc;}else{_0x4edb94[_0x2f8a('0x56')]='';}return getUser(_0x4bd85d,_0x5843e0,_0x215156,_0x2bb801,_0x36b388,_0x2c73fd)['then'](function(_0x4b6f8a){logger[_0x2f8a('0x20')]('['+_0x2c73fd[_0x2f8a('0x14')]()+_0x2f8a('0x5a'),_0x4b6f8a['userId']);logger[_0x2f8a('0x20')]('['+_0x2c73fd[_0x2f8a('0x14')]()+_0x2f8a('0x5b'),_0x4b6f8a[_0x2f8a('0x1a')]);return getEndUser(_0x4b6f8a,_0x5843e0,_0x2bb801,_0x36b388,_0x4edb94,_0x2c73fd,_0x2bb96f[_0x2f8a('0x5c')],_0x2bb96f[_0x2f8a('0x5d')]);})[_0x2f8a('0x11')](function(_0x180ab7){logger[_0x2f8a('0x20')]('['+_0x2c73fd['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x180ab7[_0x2f8a('0x2e')]);logger[_0x2f8a('0x20')]('['+_0x2c73fd[_0x2f8a('0x14')]()+_0x2f8a('0x5e'),_0x4edb94[_0x2f8a('0x26')]);return getTicket(_0x180ab7,_0x5843e0,_0x2bb801,_0x36b388,_0x4edb94,_0x2bb96f,_0x2c73fd);})['then'](function(_0x1f719e){logger[_0x2f8a('0x20')](util[_0x2f8a('0x4a')]('['+_0x2c73fd[_0x2f8a('0x14')]()+_0x2f8a('0x5f'),_0x2bb96f[_0x2f8a('0x45')],_0x1f719e[_0x2f8a('0x48')]));logger[_0x2f8a('0x20')](util[_0x2f8a('0x4a')]('['+_0x2c73fd[_0x2f8a('0x14')]()+_0x2f8a('0x60'),_0x2c73fd));if(_0x2c73fd!==_0x2f8a('0x50')&&_0x2bb96f['openNewTab']){logger['info']('['+_0x2c73fd[_0x2f8a('0x14')]()+']',_0x2f8a('0x61'));emit(_0x5843e0[_0x2f8a('0xb')],_0x215156[_0x2f8a('0x62')],_0x2bb96f['ticketType'],_0x1f719e[_0x2f8a('0x48')]);}})[_0x2f8a('0x12')](function(_0x5a7e3f){logger[_0x2f8a('0x13')]('['+_0x2c73fd['toUpperCase']()+_0x2f8a('0x63'),_0x5a7e3f[_0x2f8a('0x22')]);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x5a7e3f);});}; \ No newline at end of file +var _0x8417=['recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','password','clientSecret','access_token','catch','error','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid','userEmail','length','username','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','lastIndexOf','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','idField','substring','indexOf','content','incident','incidents','assign','getString','Subjects','enduserId','Fields','phonecall','callDirection','/contacts(','queue','phonecalls','Descriptions','ticketType','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x4d6a29,_0x13ea42){var _0x3a95f3=function(_0x27d2c2){while(--_0x27d2c2){_0x4d6a29['push'](_0x4d6a29['shift']());}};_0x3a95f3(++_0x13ea42);}(_0x8417,0x16b));var _0x7841=function(_0x5be067,_0x21df9b){_0x5be067=_0x5be067-0x0;var _0x4a18b3=_0x8417[_0x5be067];return _0x4a18b3;};'use strict';var _=require(_0x7841('0x0'));var rp=require(_0x7841('0x1'));var util=require(_0x7841('0x2'));var intUtil=require(_0x7841('0x3'));var md5=require(_0x7841('0x4'));var Redis=require('ioredis');var logger=require(_0x7841('0x5'))(_0x7841('0x6'));var config=require('../../../../config/environment');config[_0x7841('0x7')]=_[_0x7841('0x8')](config[_0x7841('0x7')],{'host':_0x7841('0x9'),'port':0x18eb});var io=require(_0x7841('0xa'))(new Redis(config[_0x7841('0x7')]));function getAuthToken(_0x346601,_0xadbb74,_0x5e376f){if(_0x346601[_0x7841('0xb')]){_0x346601[_0x7841('0xc')]=_0x346601[_0x7841('0xd')][_0x7841('0xe')];_0x346601[_0x7841('0xf')]=_0x346601[_0x7841('0xd')][_0x7841('0x10')];return Promise[_0x7841('0x11')](_0x346601['CloudProvider'][_0x7841('0x12')]);}var _0x160c58={'method':_0x7841('0x13'),'uri':_0xadbb74,'form':{'client_id':_0x346601['clientId'],'resource':_0x346601[_0x7841('0xc')],'username':_0x346601['username'],'password':_0x346601['password'],'grant_type':_0x7841('0x14'),'client_secret':_0x346601[_0x7841('0x15')]},'json':!![]};return rp(_0x160c58)['then'](function(_0x5978df){return _0x5978df[_0x7841('0x16')];})[_0x7841('0x17')](function(_0x38f74d){logger[_0x7841('0x18')]('['+[_0x5e376f['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x38f74d[_0x7841('0x19')];});}function getUser(_0x36025c,_0x3b3305,_0x3fd70c,_0x3662d5,_0x1d8f0f,_0x5dddac){return new Promise(function(_0x1deb93,_0x14568d){return getAuthToken(_0x3b3305,_0x3662d5,_0x5dddac)[_0x7841('0x1a')](function(_0x2a3471){var _0x3b13bd={'method':_0x7841('0x1b'),'uri':_0x1d8f0f+_0x7841('0x1c'),'headers':{'Authorization':_0x7841('0x1d')+_0x2a3471,'OData-Version':_0x7841('0x1e')},'json':!![]};return rp(_0x3b13bd);})[_0x7841('0x1a')](function(_0x3da648){var _0xdcf944=_0x3da648[_0x7841('0x1f')];var _0x4fd3a0=![];var _0x196908=null;if(!_[_0x7841('0x20')](_0x3fd70c)){if(intUtil[_0x7841('0x21')](_0x3fd70c[_0x7841('0x22')])){_0x36025c['userEmail']=_0x3fd70c[_0x7841('0x22')];for(_0x196908=0x0;_0x196908<_0xdcf944['length'];_0x196908++){if(_0xdcf944[_0x196908][_0x7841('0x23')]===_0x3fd70c['email']&&!_0xdcf944[_0x196908][_0x7841('0x24')]){_0x4fd3a0=!![];logger[_0x7841('0x25')]('['+[_0x5dddac[_0x7841('0x26')]()]+_0x7841('0x27')+_0xdcf944[_0x196908]['systemuserid']+'!');_0x36025c[_0x7841('0x28')]=_0xdcf944[_0x196908][_0x7841('0x29')];}}}}if(!_0x4fd3a0){logger[_0x7841('0x25')]('['+[_0x5dddac['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x36025c[_0x7841('0x2a')]=_0x3b3305['username'];for(_0x196908=0x0;_0x196908<_0xdcf944[_0x7841('0x2b')];_0x196908++){if(_0xdcf944[_0x196908][_0x7841('0x23')]===_0x3b3305[_0x7841('0x2c')]){_0x36025c[_0x7841('0x28')]=_0xdcf944[_0x196908][_0x7841('0x29')];}}}_0x1deb93(_0x36025c);})['catch'](function(_0x4986fb){_0x14568d(_0x4986fb[_0x7841('0x19')]);});});}function createEndUser(_0x440dc4,_0x4b64c8,_0x5a918a,_0x35cd3e,_0x17947b,_0x35f3e2,_0x330894){return new Promise(function(_0x46f028,_0x162f72){return getAuthToken(_0x4b64c8,_0x5a918a,_0x35f3e2)[_0x7841('0x1a')](function(_0x27a35c){var _0x4e2ef8=_0x35f3e2[_0x7841('0x2d')]()===_0x7841('0x2e')?_0x17947b[_0x7841('0x2f')]:_0x17947b[_0x7841('0x30')];var _0x5b583b={'method':_0x7841('0x13'),'uri':_0x35cd3e+_0x7841('0x31'),'body':{'fullname':_0x4e2ef8,'firstname':_0x4e2ef8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7841('0x32')+_0x440dc4[_0x7841('0x28')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x27a35c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5b583b[_0x7841('0x33')][_0x330894]=_0x4e2ef8;return rp(_0x5b583b);})[_0x7841('0x1a')](function(_0x4ac9e2){var _0x4f41c6=_0x4ac9e2[_0x7841('0x34')]['odata-entityid'];var _0x270c6f=_0x4f41c6['substring'](_0x4f41c6[_0x7841('0x35')]('(')+0x1,_0x4f41c6[_0x7841('0x35')](')'));_0x440dc4['enduserId']=_0x270c6f;_0x46f028(_0x440dc4);})['catch'](function(_0x3c93c9){_0x162f72(_0x3c93c9[_0x7841('0x19')]);});});}function getEndUser(_0xaa6689,_0x45faf3,_0x2875d1,_0x4a8b82,_0x550c58,_0x286f25,_0x3eb53d,_0x60651a){var _0x435504=_0x286f25[_0x7841('0x2d')]()===_0x7841('0x2e')?_0x550c58[_0x7841('0x2f')]:_0x550c58[_0x7841('0x30')];return getAuthToken(_0x45faf3,_0x2875d1,_0x286f25)['then'](function(_0x219eff){_0x60651a=_0x60651a?_0x60651a:_0x7841('0x36');var _0x4912bc={'method':'GET','uri':_0x4a8b82+_0x7841('0x37')+_0x60651a+_0x7841('0x38')+_0x60651a+'\x20eq\x20\x27'+_0x435504[_0x7841('0x39')]('+',_0x7841('0x3a'))+'\x27','headers':{'Authorization':_0x7841('0x1d')+_0x219eff,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4912bc);})[_0x7841('0x1a')](function(_0x298712){var _0xec16b5=![];if(!_0x298712)return _0xec16b5;var _0x4b1e66=_0x298712[_0x7841('0x1f')];for(var _0xfd72bf=0x0;_0xfd72bf<_0x4b1e66[_0x7841('0x2b')];_0xfd72bf++){if(_0x4b1e66[_0xfd72bf][_0x60651a]===_0x435504){_0xec16b5=!![];_0xaa6689['enduserId']=_0x4b1e66[_0xfd72bf][_0x7841('0x3b')];}}return _0xec16b5;})['then'](function(_0x346330){if(_0x346330)return _0xaa6689;if(_0x3eb53d==='nothing'){logger[_0x7841('0x25')]('['+[_0x286f25['toUpperCase']()]+_0x7841('0x3c'));return _0xaa6689;}return createEndUser(_0xaa6689,_0x45faf3,_0x2875d1,_0x4a8b82,_0x550c58,_0x286f25,_0x60651a)[_0x7841('0x1a')](function(_0x432654){logger[_0x7841('0x25')]('['+[_0x286f25['toUpperCase']()]+_0x7841('0x3d'),_0x432654['enduserId']);return _0x432654;});});}function getCustomFields(_0x565939,_0x303b68,_0x344569){var _0x5182f9={};if(_0x565939[_0x7841('0x2b')]>0x0){_[_0x7841('0x3e')](_0x565939,function(_0x3f63fe){if(_[_0x7841('0x3f')]([_0x7841('0x40'),_0x7841('0x41')],_0x3f63fe['type'])&&_0x3f63fe[_0x7841('0x42')]&&!_0x3f63fe['customField']){var _0x340f70=_0x3f63fe[_0x7841('0x43')][_0x7841('0x2d')]();var _0x3a83e6=_0x340f70[_0x7841('0x44')](0x0,_0x340f70[_0x7841('0x45')]('_'));var _0x5232df=_0x340f70['substring'](_0x340f70[_0x7841('0x45')]('_')+0x1);if(_0x3a83e6===_0x344569){_0x5182f9[_0x5232df]=_0x3f63fe[_0x7841('0x46')];}}});}return _0x5182f9;}function getTicket(_0x93cfdb,_0x19a60b,_0x2cb74d,_0x2a646b,_0x1f3925,_0x556618,_0x5b1d3a){return new Promise(function(_0x1094de,_0x542d3b){var _0x1a69bb;return getAuthToken(_0x19a60b,_0x2cb74d,_0x5b1d3a)['then'](function(_0xdcd2fe){if(_0x556618['ticketType']===_0x7841('0x47')){_0x1a69bb={'method':_0x7841('0x13'),'uri':_0x2a646b+_0x7841('0x48'),'body':Object[_0x7841('0x49')]({},{'title':intUtil[_0x7841('0x4a')](_0x556618[_0x7841('0x4b')],_0x1f3925,'\x20'),'description':intUtil[_0x7841('0x4a')](_0x556618['Descriptions'],_0x1f3925,'\x0a'),'customerid_contact@odata.bind':_0x93cfdb['enduserId']?'/contacts('+_0x93cfdb[_0x7841('0x4c')]+')':undefined,'ownerid@odata.bind':_0x7841('0x32')+_0x93cfdb['userId']+')','caseorigincode':'1'},getCustomFields(_0x556618[_0x7841('0x4d')],_0x1f3925,_0x556618['ticketType'])),'headers':{'Authorization':_0x7841('0x1d')+_0xdcd2fe,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x556618['ticketType']===_0x7841('0x4e')){var _0x1b9078=_0x93cfdb[_0x7841('0x4c')]?[{'partyid_systemuser@odata.bind':_0x7841('0x32')+_0x93cfdb[_0x7841('0x28')]+')','participationtypemask':_0x93cfdb[_0x7841('0x4f')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x7841('0x50')+_0x93cfdb['enduserId']+')','participationtypemask':_0x93cfdb[_0x7841('0x4f')]===_0x7841('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x93cfdb[_0x7841('0x28')]+')','participationtypemask':_0x93cfdb[_0x7841('0x4f')]===_0x7841('0x51')?0x2:0x1}];_0x1a69bb={'method':'POST','uri':_0x2a646b+_0x7841('0x52'),'body':Object[_0x7841('0x49')]({},{'subject':intUtil[_0x7841('0x4a')](_0x556618[_0x7841('0x4b')],_0x1f3925,'\x20'),'phonenumber':String(_0x1f3925[_0x7841('0x30')]),'description':intUtil[_0x7841('0x4a')](_0x556618[_0x7841('0x53')],_0x1f3925,'\x0a'),'regardingobjectid_contact@odata.bind':_0x93cfdb[_0x7841('0x4c')]?_0x7841('0x50')+_0x93cfdb[_0x7841('0x4c')]+')':undefined,'ownerid@odata.bind':_0x7841('0x32')+_0x93cfdb[_0x7841('0x28')]+')','directioncode':_0x93cfdb[_0x7841('0x4f')]===_0x7841('0x51')?![]:!![],'phonecall_activity_parties':_0x1b9078},getCustomFields(_0x556618['Fields'],_0x1f3925,_0x556618[_0x7841('0x54')])),'headers':{'Authorization':_0x7841('0x1d')+_0xdcd2fe,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1a69bb);})[_0x7841('0x1a')](function(_0x503a18){var _0x3818f0=_0x503a18[_0x7841('0x34')][_0x7841('0x55')];var _0x54feaf=_0x3818f0['substring'](_0x3818f0['lastIndexOf']('(')+0x1,_0x3818f0[_0x7841('0x35')](')'));_0x93cfdb['ticketId']=_0x54feaf;_0x1094de(_0x93cfdb);})[_0x7841('0x17')](function(_0x18ef62){_0x542d3b(_0x18ef62[_0x7841('0x19')]);});});}function emit(_0x4a4f29,_0x273b04,_0x4ca0de,_0xee8b87){var _0x31de4d={'uri':util[_0x7841('0x56')](_0x7841('0x57'),_0x4a4f29,_0x4ca0de,_0xee8b87)};io['to'](util[_0x7841('0x56')](_0x7841('0x58'),_0x273b04))['emit'](_0x7841('0x59'),_0x31de4d);}exports['cs']=function(_0x284ddd,_0x20d160,_0x12c877,_0x6874ea,_0x26d996,_0x1bcac3,_0x33e2f6,_0x32d38a){var _0x3b618a={};_0x1bcac3[_0x7841('0xc')]=_0x1bcac3[_0x7841('0xb')]?intUtil['stripTrailingSlash'](_0x1bcac3['CloudProvider'][_0x7841('0xe')]):intUtil[_0x7841('0x5a')](_0x1bcac3['remoteUri']);_0x1bcac3['serverUrl']=intUtil['stripTrailingSlash'](_0x1bcac3['serverUrl']);_0x3b618a[_0x7841('0x4f')]=_0x32d38a===_0x7841('0x51')||_0x32d38a===_0x7841('0x5b')?_0x7841('0x51'):_0x7841('0x2e');var _0x2dfc62=_0x1bcac3[_0x7841('0xb')]?util['format'](_0x7841('0x5c'),_0x1bcac3[_0x7841('0xd')][_0x7841('0xe')]):util[_0x7841('0x56')]('%s/api/data/v9.0/',_0x1bcac3['remoteUri']);var _0x1dfc47=util['format'](_0x7841('0x5d'),_0x1bcac3['tenantId']);var _0x2dc413=util[_0x7841('0x56')](_0x7841('0x5e'),_0x1bcac3[_0x7841('0x5f')],_0x20d160['uniqueid'],md5(_0x20d160[_0x7841('0x60')]));if(_0x26d996&&_0x26d996[_0x7841('0x61')]){logger[_0x7841('0x25')](_0x7841('0x62'),_0x7841('0x63'));_0x20d160[_0x7841('0x64')]=_0x2dc413;}else if(_0x33e2f6&&_0x33e2f6['recordingFormat']&&_0x33e2f6[_0x7841('0x65')]!==_0x7841('0x66')){logger[_0x7841('0x25')](_0x7841('0x67'),_0x7841('0x63'));_0x20d160[_0x7841('0x64')]=_0x2dc413;}else{_0x20d160[_0x7841('0x64')]='';}return getUser(_0x3b618a,_0x1bcac3,_0x6874ea,_0x1dfc47,_0x2dfc62,_0x32d38a)[_0x7841('0x1a')](function(_0x1d7f7b){logger['info']('['+_0x32d38a[_0x7841('0x26')]()+_0x7841('0x68'),_0x1d7f7b[_0x7841('0x28')]);logger[_0x7841('0x25')]('['+_0x32d38a['toUpperCase']()+_0x7841('0x69'),_0x1d7f7b[_0x7841('0x2a')]);return getEndUser(_0x1d7f7b,_0x1bcac3,_0x1dfc47,_0x2dfc62,_0x20d160,_0x32d38a,_0x12c877[_0x7841('0x6a')],_0x12c877[_0x7841('0x6b')]);})[_0x7841('0x1a')](function(_0x1b3c70){logger[_0x7841('0x25')]('['+_0x32d38a[_0x7841('0x26')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x1b3c70['enduserId']);logger[_0x7841('0x25')]('['+_0x32d38a[_0x7841('0x26')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x20d160['calleridnum']);return getTicket(_0x1b3c70,_0x1bcac3,_0x1dfc47,_0x2dfc62,_0x20d160,_0x12c877,_0x32d38a);})['then'](function(_0x28337c){logger['info'](util[_0x7841('0x56')]('['+_0x32d38a['toUpperCase']()+_0x7841('0x6c'),_0x12c877[_0x7841('0x54')],_0x28337c[_0x7841('0x6d')]));logger['info'](util[_0x7841('0x56')]('['+_0x32d38a[_0x7841('0x26')]()+_0x7841('0x6e'),_0x32d38a));if(_0x32d38a!=='unmanaged'&&_0x12c877[_0x7841('0x6f')]){logger[_0x7841('0x25')]('['+_0x32d38a[_0x7841('0x26')]()+']',_0x7841('0x70'));emit(_0x1bcac3[_0x7841('0xc')],_0x6874ea[_0x7841('0x71')],_0x12c877[_0x7841('0x54')],_0x28337c[_0x7841('0x6d')]);}})[_0x7841('0x17')](function(_0xd3d22e){logger[_0x7841('0x18')]('['+_0x32d38a[_0x7841('0x26')]()+_0x7841('0x72'),_0xd3d22e[_0x7841('0x19')]);console[_0x7841('0x18')](_0x7841('0x73'),_0xd3d22e);});}; \ 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 05d473f..a07103e 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 _0xeee1=['email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','stringify','map','forEach','picklist','type','nameField','customField','toLowerCase','includes','string','idField','push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization'];(function(_0x160f8f,_0x9d677b){var _0x25aeb7=function(_0x356a44){while(--_0x356a44){_0x160f8f['push'](_0x160f8f['shift']());}};_0x25aeb7(++_0x9d677b);}(_0xeee1,0x65));var _0x1eee=function(_0x12af2e,_0x56fff7){_0x12af2e=_0x12af2e-0x0;var _0xa34000=_0xeee1[_0x12af2e];return _0xa34000;};'use strict';var _=require(_0x1eee('0x0'));var rp=require(_0x1eee('0x1'));var md5=require('md5');var util=require(_0x1eee('0x2'));var Redis=require('ioredis');var intUtil=require(_0x1eee('0x3'));var config=require(_0x1eee('0x4'));var logger=require('../../../../config/logger')(_0x1eee('0x5'));config['redis']=_[_0x1eee('0x6')](config[_0x1eee('0x7')],{'host':_0x1eee('0x8'),'port':0x18eb});var io=require(_0x1eee('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x1eee('0xa'),'Accept':_0x1eee('0xa')};function emit(_0x3a0447,_0x5bacb6,_0x1350a1){io['to'](_0x3a0447)['emit'](_0x5bacb6,_0x1350a1);}function getTicket(_0x337dd3,_0x2f219e,_0x248020,_0x447b48,_0x5e1f72){logger[_0x1eee('0xb')](_0x1eee('0xc'));var _0x24dab1=_[_0x1eee('0xd')]({'responder_id':_0x2f219e['id'],'requester_id':_0x248020['id'],'name':util[_0x1eee('0xe')]('Caller\x20-\x20%s',_0x5e1f72[_0x1eee('0xf')]),'phone':_0x5e1f72[_0x1eee('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x447b48[_0x1eee('0x11')],_0x5e1f72,'\x20'),'description':intUtil[_0x1eee('0x12')](_0x447b48[_0x1eee('0x13')],_0x5e1f72,_0x1eee('0x14')),'tags':getTags(_0x447b48[_0x1eee('0x15')],'name')},getCustomFields(_0x447b48[_0x1eee('0x16')],_0x5e1f72));_0x24dab1[_0x1eee('0x17')]=_[_0x1eee('0x18')](_[_0x1eee('0x19')](_0x24dab1['custom_fields'],'id'),_0x1eee('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0x337dd3[_0x1eee('0x1b')]),'method':'POST','body':_0x24dab1})['then'](function(_0x1d81ea){logger[_0x1eee('0xb')](_0x1eee('0x1c'));return _0x1d81ea;});}function getUser(_0x4db426,_0x325370){if(intUtil[_0x1eee('0x1d')](_0x325370)){return request({'uri':util[_0x1eee('0xe')](_0x1eee('0x1e'),_0x4db426['remoteUri']),'qs':{'email':_0x325370}})[_0x1eee('0x1f')](function(_0xc6c6ce){if(_0xc6c6ce[_0x1eee('0x20')]){logger[_0x1eee('0xb')](_0x1eee('0x21'));return _[_0x1eee('0x22')](_0xc6c6ce,function(_0x64b044){return _0x64b044[_0x1eee('0x23')]['email']===_0x325370;});}else{logger[_0x1eee('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1eee('0xe')](_0x1eee('0x24'),_0x4db426[_0x1eee('0x1b')])})['then'](function(_0x4b5598){logger[_0x1eee('0xb')]('Admin\x20account\x20selected.');return _0x4b5598;});}});}else{logger[_0x1eee('0xb')](_0x1eee('0x25'));return request({'uri':util[_0x1eee('0xe')](_0x1eee('0x24'),_0x4db426['remoteUri'])})[_0x1eee('0x1f')](function(_0xea57d2){logger['info'](_0x1eee('0x26'));return _0xea57d2;});}}function getEndUser(_0x5d1fbc,_0x291295,_0x775faa){logger[_0x1eee('0xb')](_0x1eee('0x27'),_0x775faa);return request({'uri':util[_0x1eee('0xe')]('%s/api/v2/contacts',_0x5d1fbc[_0x1eee('0x1b')]),'qs':{'phone':_0x775faa}})['then'](function(_0x5ec9d8){if(_0x5ec9d8['length']){logger[_0x1eee('0xb')]('Enduser\x20found!');return _[_0x1eee('0x22')](_0x5ec9d8,{'phone':_0x775faa});}else{logger[_0x1eee('0xb')](_0x1eee('0x28'));return request({'uri':util[_0x1eee('0xe')](_0x1eee('0x29'),_0x5d1fbc[_0x1eee('0x1b')]),'method':_0x1eee('0x2a'),'body':{'name':_0x291295,'phone':_0x775faa}})[_0x1eee('0x1f')](function(_0x23d39b){logger[_0x1eee('0xb')](_0x1eee('0x2b'));return _0x23d39b;});}});}function getAuth(_0x3967fb){return util[_0x1eee('0xe')](_0x1eee('0x2c'),new Buffer(_0x3967fb[_0x1eee('0x2d')]+':X')[_0x1eee('0x2e')]('base64'));}function request(_0x526f24){logger['debug']('[HTTP]',JSON[_0x1eee('0x2f')](_0x526f24));return rp(_[_0x1eee('0x6')](_0x526f24,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5f1632,_0x1c5e8a){var _0x50d96c=[];if(_0x5f1632&&_0x5f1632[_0x1eee('0x20')]>0x0){_0x50d96c=_[_0x1eee('0x30')](_0x5f1632,_0x1c5e8a);}return _0x50d96c;}function getCustomFields(_0x1ff6f4,_0x27ea0c){var _0x359b48=[];var _0x224c23={'custom_fields':[]};if(_0x1ff6f4[_0x1eee('0x20')]>0x0){_[_0x1eee('0x31')](_0x1ff6f4,function(_0x116505){if(_['includes'](['string',_0x1eee('0x32')],_0x116505[_0x1eee('0x33')])&&_0x116505[_0x1eee('0x34')]&&!_0x116505[_0x1eee('0x35')]){_0x224c23[_0x116505[_0x1eee('0x34')][_0x1eee('0x36')]()]=_0x116505['content'][_0x1eee('0x2e')]();}else if(_[_0x1eee('0x37')]([_0x1eee('0x38'),_0x1eee('0x32')],_0x116505[_0x1eee('0x33')])&&_0x116505[_0x1eee('0x39')]&&_0x116505[_0x1eee('0x35')]){_0x224c23['custom_fields'][_0x1eee('0x3a')]({'id':_0x116505[_0x1eee('0x39')],'value':_0x116505[_0x1eee('0x3b')][_0x1eee('0x2e')]()});}else if(_0x116505['type']===_0x1eee('0x3c')&&_0x116505[_0x1eee('0x3d')]&&_0x116505[_0x1eee('0x39')]&&_0x116505[_0x1eee('0x35')]){_0x27ea0c[_0x116505[_0x1eee('0x3d')]]&&_0x224c23['custom_fields'][_0x1eee('0x3a')]({'id':_0x116505[_0x1eee('0x39')],'value':_0x27ea0c[_0x116505[_0x1eee('0x3d')]]['toString']()});}else if(_0x116505['type']===_0x1eee('0x3e')&&_0x116505[_0x1eee('0x3f')]&&_0x116505[_0x1eee('0x3f')]['name']&&_0x116505[_0x1eee('0x39')]&&_0x116505[_0x1eee('0x35')]){_0x27ea0c[_0x116505[_0x1eee('0x3f')][_0x1eee('0x40')][_0x1eee('0x36')]()]&&_0x224c23[_0x1eee('0x17')][_0x1eee('0x3a')]({'id':_0x116505[_0x1eee('0x39')],'value':_0x27ea0c[_0x116505[_0x1eee('0x3f')][_0x1eee('0x40')][_0x1eee('0x36')]()]['toString']()});}});}return _0x224c23;}exports[_0x1eee('0x41')]=function(_0x1c0be0,_0x489893,_0x37efea,_0x3a5a66,_0x57ee65,_0x16d4eb){var _0x56ec1c,_0x2dccb8;_0x16d4eb[_0x1eee('0x1b')]=intUtil[_0x1eee('0x42')](_0x16d4eb[_0x1eee('0x1b')]);_0x16d4eb[_0x1eee('0x43')]=intUtil[_0x1eee('0x42')](_0x16d4eb['serverUrl']);if(_0x57ee65&&_0x57ee65[_0x1eee('0x44')]){logger[_0x1eee('0xb')](_0x1eee('0x45'),_0x1eee('0x46'));_0x489893['recordingURL']=util['format'](_0x1eee('0x47'),_0x16d4eb[_0x1eee('0x43')],_0x489893[_0x1eee('0x48')],md5(_0x489893['uniqueid']));}else{_0x489893[_0x1eee('0x49')]='';}headers['Authorization']=getAuth(_0x16d4eb);return getUser(_0x16d4eb,_0x3a5a66['email'])[_0x1eee('0x1f')](function(_0x81fa52){_0x56ec1c=_0x81fa52;logger[_0x1eee('0xb')]('The\x20User\x20ID\x20is:',_0x56ec1c['id']);return getEndUser(_0x16d4eb,_0x489893[_0x1eee('0xf')],_0x489893[_0x1eee('0x10')]);})[_0x1eee('0x1f')](function(_0x451b41){_0x2dccb8=_0x451b41;logger[_0x1eee('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2dccb8['id']);return getTicket(_0x16d4eb,_0x56ec1c,_0x2dccb8,_0x37efea,_0x489893);})['then'](function(_0x46d6b0){if(_0x46d6b0&&_0x46d6b0['id']){logger[_0x1eee('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x46d6b0['id']);logger['info'](_0x1eee('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1eee('0xe')](_0x1eee('0x4a'),_0x3a5a66['name']),_0x1eee('0x4b'),{'uri':util[_0x1eee('0xe')]('%s/helpdesk/tickets/%d',_0x16d4eb[_0x1eee('0x1b')],_0x46d6b0['id'])});}})[_0x1eee('0x4c')](function(_0x57835b){logger[_0x1eee('0x4d')](_0x1eee('0x45'),JSON[_0x1eee('0x2f')](_0x57835b));});};exports[_0x1eee('0x4e')]=function(_0x4f3414,_0x2eaed5,_0x908d92,_0x9926b7,_0x4cc25e,_0x5f26e6,_0x10b110){var _0x3eaaea,_0x33bb4c;_0x5f26e6[_0x1eee('0x1b')]=intUtil[_0x1eee('0x42')](_0x5f26e6[_0x1eee('0x1b')]);_0x5f26e6[_0x1eee('0x43')]=intUtil['stripTrailingSlash'](_0x5f26e6[_0x1eee('0x43')]);if(_0x10b110&&_0x10b110[_0x1eee('0x4f')]&&_0x10b110[_0x1eee('0x4f')]!==_0x1eee('0x50')){logger[_0x1eee('0xb')](_0x1eee('0x51'),_0x1eee('0x46'));_0x2eaed5['recordingURL']=util[_0x1eee('0xe')](_0x1eee('0x47'),_0x5f26e6['serverUrl'],_0x2eaed5[_0x1eee('0x48')],md5(_0x2eaed5[_0x1eee('0x48')]));}headers[_0x1eee('0x52')]=getAuth(_0x5f26e6);return getUser(_0x5f26e6,_0x9926b7[_0x1eee('0x53')])[_0x1eee('0x1f')](function(_0x53dd12){_0x3eaaea=_0x53dd12;logger[_0x1eee('0xb')](_0x1eee('0x54'),_0x3eaaea['id']);return getEndUser(_0x5f26e6,_0x2eaed5[_0x1eee('0x55')],_0x2eaed5[_0x1eee('0x56')]);})['then'](function(_0xb5ad72){_0x33bb4c=_0xb5ad72;logger[_0x1eee('0xb')](_0x1eee('0x57'),_0x33bb4c['id']);return getTicket(_0x5f26e6,_0x3eaaea,_0x33bb4c,_0x908d92,_0x2eaed5);})[_0x1eee('0x1f')](function(_0x17fcb7){if(_0x17fcb7&&_0x17fcb7['id']){logger[_0x1eee('0xb')](_0x1eee('0x1c'));logger[_0x1eee('0xb')](_0x1eee('0x58'),_0x17fcb7['id']);logger[_0x1eee('0xb')](_0x1eee('0x51'),_0x1eee('0x59'));emit(util[_0x1eee('0xe')](_0x1eee('0x4a'),_0x9926b7[_0x1eee('0x40')]),_0x1eee('0x4b'),{'uri':util[_0x1eee('0xe')]('%s/helpdesk/tickets/%d',_0x5f26e6[_0x1eee('0x1b')],_0x17fcb7['id'])});}})[_0x1eee('0x4c')](function(_0x5a39cf){logger[_0x1eee('0x4d')]('[OUTBOUND]',JSON[_0x1eee('0x2f')](_0x5a39cf));});};exports['unmanaged']=function(_0x23e5c2,_0x471fce,_0x4cd96,_0x41d966,_0x5b4200,_0x5bb77c){var _0x4197e1,_0x3af62d;_0x5bb77c['remoteUri']=intUtil[_0x1eee('0x42')](_0x5bb77c[_0x1eee('0x1b')]);_0x5bb77c[_0x1eee('0x43')]=intUtil[_0x1eee('0x42')](_0x5bb77c['serverUrl']);if(_0x5b4200&&_0x5b4200[_0x1eee('0x44')]){logger[_0x1eee('0xb')]('['+_0x471fce[_0x1eee('0x5a')][_0x1eee('0x5b')]()+']',_0x1eee('0x46'));_0x471fce[_0x1eee('0x49')]=util[_0x1eee('0xe')](_0x1eee('0x47'),_0x5bb77c[_0x1eee('0x43')],_0x471fce[_0x1eee('0x48')],md5(_0x471fce[_0x1eee('0x48')]));}else{_0x471fce[_0x1eee('0x49')]='';}headers[_0x1eee('0x52')]=getAuth(_0x5bb77c);return getUser(_0x5bb77c,'')[_0x1eee('0x1f')](function(_0x18fff1){_0x4197e1=_0x18fff1;logger['info'](_0x1eee('0x54'),_0x4197e1['id']);return getEndUser(_0x5bb77c,_0x471fce[_0x1eee('0xf')],_0x471fce['calleridnum']);})['then'](function(_0x49626c){_0x3af62d=_0x49626c;logger[_0x1eee('0xb')](_0x1eee('0x57'),_0x3af62d['id']);return getTicket(_0x5bb77c,_0x4197e1,_0x3af62d,_0x4cd96,_0x471fce);})[_0x1eee('0x1f')](function(_0x40b21f){if(_0x40b21f){logger['info'](_0x1eee('0x1c'));logger[_0x1eee('0xb')](_0x1eee('0x58'),_0x40b21f['id']);}})['catch'](function(_0x5b3252){logger[_0x1eee('0x4d')]('['+_0x471fce[_0x1eee('0x5a')][_0x1eee('0x5b')]()+']',JSON[_0x1eee('0x2f')](_0x5b3252));});}; \ No newline at end of file +var _0x1810=['monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','Tags','name','Fields','custom_fields','keyBy','value','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','toLowerCase','content','picklist','idField','customField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl'];(function(_0x4e7a23,_0x5969b4){var _0x1843d2=function(_0x18d3e5){while(--_0x18d3e5){_0x4e7a23['push'](_0x4e7a23['shift']());}};_0x1843d2(++_0x5969b4);}(_0x1810,0x181));var _0x0181=function(_0x581481,_0x190792){_0x581481=_0x581481-0x0;var _0x4dfd79=_0x1810[_0x581481];return _0x4dfd79;};'use strict';var _=require(_0x0181('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x0181('0x1'));var Redis=require(_0x0181('0x2'));var intUtil=require(_0x0181('0x3'));var config=require(_0x0181('0x4'));var logger=require('../../../../config/logger')(_0x0181('0x5'));config['redis']=_[_0x0181('0x6')](config[_0x0181('0x7')],{'host':_0x0181('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0181('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x0181('0x9')};function emit(_0x511f20,_0x526bf2,_0x2a0b52){io['to'](_0x511f20)[_0x0181('0xa')](_0x526bf2,_0x2a0b52);}function getTicket(_0x503355,_0x1e3fa5,_0x1936b3,_0x212e75,_0x44becf){logger['info'](_0x0181('0xb'));var _0x37acad=_[_0x0181('0xc')]({'responder_id':_0x1e3fa5['id'],'requester_id':_0x1936b3['id'],'name':util[_0x0181('0xd')](_0x0181('0xe'),_0x44becf['calleridname']),'phone':_0x44becf['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x212e75[_0x0181('0xf')],_0x44becf,'\x20'),'description':intUtil[_0x0181('0x10')](_0x212e75[_0x0181('0x11')],_0x44becf,'
'),'tags':getTags(_0x212e75[_0x0181('0x12')],_0x0181('0x13'))},getCustomFields(_0x212e75[_0x0181('0x14')],_0x44becf));_0x37acad[_0x0181('0x15')]=_['mapValues'](_[_0x0181('0x16')](_0x37acad['custom_fields'],'id'),_0x0181('0x17'));return request({'uri':util[_0x0181('0xd')]('%s/api/v2/tickets',_0x503355[_0x0181('0x18')]),'method':_0x0181('0x19'),'body':_0x37acad})[_0x0181('0x1a')](function(_0xf2a771){logger[_0x0181('0x1b')]('Ticket\x20created!');return _0xf2a771;});}function getUser(_0x46fdf7,_0x4fdfe5){if(intUtil[_0x0181('0x1c')](_0x4fdfe5)){return request({'uri':util[_0x0181('0xd')](_0x0181('0x1d'),_0x46fdf7['remoteUri']),'qs':{'email':_0x4fdfe5}})[_0x0181('0x1a')](function(_0x4787cc){if(_0x4787cc[_0x0181('0x1e')]){logger[_0x0181('0x1b')](_0x0181('0x1f'));return _[_0x0181('0x20')](_0x4787cc,function(_0x38073e){return _0x38073e[_0x0181('0x21')][_0x0181('0x22')]===_0x4fdfe5;});}else{logger[_0x0181('0x1b')](_0x0181('0x23'));return request({'uri':util[_0x0181('0xd')](_0x0181('0x24'),_0x46fdf7['remoteUri'])})[_0x0181('0x1a')](function(_0x503684){logger['info'](_0x0181('0x25'));return _0x503684;});}});}else{logger[_0x0181('0x1b')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0181('0xd')](_0x0181('0x24'),_0x46fdf7[_0x0181('0x18')])})[_0x0181('0x1a')](function(_0x262083){logger['info'](_0x0181('0x25'));return _0x262083;});}}function getEndUser(_0x254759,_0x38ab21,_0x499ade){logger[_0x0181('0x1b')](_0x0181('0x26'),_0x499ade);return request({'uri':util[_0x0181('0xd')](_0x0181('0x27'),_0x254759[_0x0181('0x18')]),'qs':{'phone':_0x499ade}})[_0x0181('0x1a')](function(_0x34c0c2){if(_0x34c0c2[_0x0181('0x1e')]){logger[_0x0181('0x1b')]('Enduser\x20found!');return _[_0x0181('0x20')](_0x34c0c2,{'phone':_0x499ade});}else{logger['info'](_0x0181('0x28'));return request({'uri':util[_0x0181('0xd')](_0x0181('0x27'),_0x254759[_0x0181('0x18')]),'method':_0x0181('0x19'),'body':{'name':_0x38ab21,'phone':_0x499ade}})[_0x0181('0x1a')](function(_0x24c33f){logger['info'](_0x0181('0x29'));return _0x24c33f;});}});}function getAuth(_0x265c7c){return util[_0x0181('0xd')]('Basic\x20%s',new Buffer(_0x265c7c[_0x0181('0x2a')]+':X')[_0x0181('0x2b')]('base64'));}function request(_0x4c5895){logger[_0x0181('0x2c')](_0x0181('0x2d'),JSON[_0x0181('0x2e')](_0x4c5895));return rp(_[_0x0181('0x6')](_0x4c5895,{'method':_0x0181('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x23f6d6,_0x1efd36){var _0x17cd3a=[];if(_0x23f6d6&&_0x23f6d6[_0x0181('0x1e')]>0x0){_0x17cd3a=_[_0x0181('0x30')](_0x23f6d6,_0x1efd36);}return _0x17cd3a;}function getCustomFields(_0x44b788,_0x22de65){var _0x1b8334=[];var _0x18bf81={'custom_fields':[]};if(_0x44b788[_0x0181('0x1e')]>0x0){_['forEach'](_0x44b788,function(_0x506f8b){if(_[_0x0181('0x31')]([_0x0181('0x32'),'picklist'],_0x506f8b[_0x0181('0x33')])&&_0x506f8b[_0x0181('0x34')]&&!_0x506f8b['customField']){_0x18bf81[_0x506f8b[_0x0181('0x34')][_0x0181('0x35')]()]=_0x506f8b[_0x0181('0x36')][_0x0181('0x2b')]();}else if(_[_0x0181('0x31')]([_0x0181('0x32'),_0x0181('0x37')],_0x506f8b[_0x0181('0x33')])&&_0x506f8b[_0x0181('0x38')]&&_0x506f8b[_0x0181('0x39')]){_0x18bf81[_0x0181('0x15')][_0x0181('0x3a')]({'id':_0x506f8b[_0x0181('0x38')],'value':_0x506f8b['content']['toString']()});}else if(_0x506f8b[_0x0181('0x33')]==='variable'&&_0x506f8b[_0x0181('0x3b')]&&_0x506f8b['idField']&&_0x506f8b[_0x0181('0x39')]){_0x22de65[_0x506f8b[_0x0181('0x3b')]]&&_0x18bf81[_0x0181('0x15')][_0x0181('0x3a')]({'id':_0x506f8b[_0x0181('0x38')],'value':_0x22de65[_0x506f8b['variableName']][_0x0181('0x2b')]()});}else if(_0x506f8b[_0x0181('0x33')]===_0x0181('0x3c')&&_0x506f8b[_0x0181('0x3d')]&&_0x506f8b[_0x0181('0x3d')]['name']&&_0x506f8b['idField']&&_0x506f8b['customField']){_0x22de65[_0x506f8b[_0x0181('0x3d')]['name'][_0x0181('0x35')]()]&&_0x18bf81[_0x0181('0x15')][_0x0181('0x3a')]({'id':_0x506f8b['idField'],'value':_0x22de65[_0x506f8b[_0x0181('0x3d')][_0x0181('0x13')][_0x0181('0x35')]()][_0x0181('0x2b')]()});}});}return _0x18bf81;}exports[_0x0181('0x3e')]=function(_0x55cf17,_0x1ba039,_0x3f2ab3,_0x5619f8,_0x36d865,_0x4fccc3){var _0x4e420a,_0x3b40bb;_0x4fccc3[_0x0181('0x18')]=intUtil[_0x0181('0x3f')](_0x4fccc3['remoteUri']);_0x4fccc3[_0x0181('0x40')]=intUtil['stripTrailingSlash'](_0x4fccc3[_0x0181('0x40')]);if(_0x36d865&&_0x36d865[_0x0181('0x41')]){logger['info']('[QUEUE]',_0x0181('0x42'));_0x1ba039[_0x0181('0x43')]=util[_0x0181('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4fccc3[_0x0181('0x40')],_0x1ba039[_0x0181('0x44')],md5(_0x1ba039[_0x0181('0x44')]));}else{_0x1ba039[_0x0181('0x43')]='';}headers[_0x0181('0x45')]=getAuth(_0x4fccc3);return getUser(_0x4fccc3,_0x5619f8[_0x0181('0x22')])[_0x0181('0x1a')](function(_0x38aa70){_0x4e420a=_0x38aa70;logger['info'](_0x0181('0x46'),_0x4e420a['id']);return getEndUser(_0x4fccc3,_0x1ba039[_0x0181('0x47')],_0x1ba039[_0x0181('0x48')]);})['then'](function(_0x3b677e){_0x3b40bb=_0x3b677e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3b40bb['id']);return getTicket(_0x4fccc3,_0x4e420a,_0x3b40bb,_0x3f2ab3,_0x1ba039);})[_0x0181('0x1a')](function(_0x1f8868){if(_0x1f8868&&_0x1f8868['id']){logger[_0x0181('0x1b')](_0x0181('0x49'));logger[_0x0181('0x1b')](_0x0181('0x4a'),_0x1f8868['id']);logger[_0x0181('0x1b')]('[QUEUE]',_0x0181('0x4b'));emit(util[_0x0181('0xd')](_0x0181('0x4c'),_0x5619f8['name']),_0x0181('0x4d'),{'uri':util[_0x0181('0xd')](_0x0181('0x4e'),_0x4fccc3['remoteUri'],_0x1f8868['id'])});}})[_0x0181('0x4f')](function(_0x2113a1){logger[_0x0181('0x50')](_0x0181('0x51'),JSON[_0x0181('0x2e')](_0x2113a1));});};exports[_0x0181('0x52')]=function(_0x2b3823,_0x587dd0,_0x427783,_0x430337,_0x31e567,_0x3abb59,_0xe099fb){var _0x2ec7a6,_0x2a4d38;_0x3abb59['remoteUri']=intUtil['stripTrailingSlash'](_0x3abb59[_0x0181('0x18')]);_0x3abb59[_0x0181('0x40')]=intUtil[_0x0181('0x3f')](_0x3abb59[_0x0181('0x40')]);if(_0xe099fb&&_0xe099fb['recordingFormat']&&_0xe099fb[_0x0181('0x53')]!=='none'){logger[_0x0181('0x1b')](_0x0181('0x54'),_0x0181('0x42'));_0x587dd0[_0x0181('0x43')]=util[_0x0181('0xd')](_0x0181('0x55'),_0x3abb59[_0x0181('0x40')],_0x587dd0['uniqueid'],md5(_0x587dd0['uniqueid']));}headers[_0x0181('0x45')]=getAuth(_0x3abb59);return getUser(_0x3abb59,_0x430337[_0x0181('0x22')])['then'](function(_0x379cbc){_0x2ec7a6=_0x379cbc;logger[_0x0181('0x1b')](_0x0181('0x46'),_0x2ec7a6['id']);return getEndUser(_0x3abb59,_0x587dd0[_0x0181('0x56')],_0x587dd0[_0x0181('0x57')]);})[_0x0181('0x1a')](function(_0x3b613a){_0x2a4d38=_0x3b613a;logger[_0x0181('0x1b')](_0x0181('0x58'),_0x2a4d38['id']);return getTicket(_0x3abb59,_0x2ec7a6,_0x2a4d38,_0x427783,_0x587dd0);})[_0x0181('0x1a')](function(_0x1bd0e8){if(_0x1bd0e8&&_0x1bd0e8['id']){logger[_0x0181('0x1b')](_0x0181('0x49'));logger['info'](_0x0181('0x4a'),_0x1bd0e8['id']);logger[_0x0181('0x1b')](_0x0181('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0181('0xd')](_0x0181('0x4c'),_0x430337['name']),_0x0181('0x4d'),{'uri':util[_0x0181('0xd')](_0x0181('0x4e'),_0x3abb59['remoteUri'],_0x1bd0e8['id'])});}})[_0x0181('0x4f')](function(_0xdca689){logger[_0x0181('0x50')](_0x0181('0x54'),JSON[_0x0181('0x2e')](_0xdca689));});};exports['unmanaged']=function(_0x96d831,_0xa6bd27,_0x31594c,_0x5b5a44,_0x2cec8d,_0x3f2e26){var _0x46222a,_0x46c927;_0x3f2e26[_0x0181('0x18')]=intUtil[_0x0181('0x3f')](_0x3f2e26['remoteUri']);_0x3f2e26[_0x0181('0x40')]=intUtil[_0x0181('0x3f')](_0x3f2e26[_0x0181('0x40')]);if(_0x2cec8d&&_0x2cec8d['monitor_format']){logger['info']('['+_0xa6bd27['lastevent'][_0x0181('0x59')]()+']',_0x0181('0x42'));_0xa6bd27[_0x0181('0x43')]=util[_0x0181('0xd')](_0x0181('0x55'),_0x3f2e26[_0x0181('0x40')],_0xa6bd27[_0x0181('0x44')],md5(_0xa6bd27[_0x0181('0x44')]));}else{_0xa6bd27[_0x0181('0x43')]='';}headers[_0x0181('0x45')]=getAuth(_0x3f2e26);return getUser(_0x3f2e26,'')[_0x0181('0x1a')](function(_0x212ff6){_0x46222a=_0x212ff6;logger['info'](_0x0181('0x46'),_0x46222a['id']);return getEndUser(_0x3f2e26,_0xa6bd27[_0x0181('0x47')],_0xa6bd27[_0x0181('0x48')]);})[_0x0181('0x1a')](function(_0x1e3b14){_0x46c927=_0x1e3b14;logger[_0x0181('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x46c927['id']);return getTicket(_0x3f2e26,_0x46222a,_0x46c927,_0x31594c,_0xa6bd27);})[_0x0181('0x1a')](function(_0x536dfa){if(_0x536dfa){logger[_0x0181('0x1b')](_0x0181('0x49'));logger[_0x0181('0x1b')](_0x0181('0x4a'),_0x536dfa['id']);}})['catch'](function(_0x58d2f8){logger[_0x0181('0x50')]('['+_0xa6bd27['lastevent'][_0x0181('0x59')]()+']',JSON[_0x0181('0x2e')](_0x58d2f8));});}; \ 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 d992b1a..3aa3828 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 _0x2b46=['toUpperCase','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','adminEmail','message','/api/lookup?q=','&f=','find','contacts','format','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','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','ioredis','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x2b46,0x138));var _0x62b4=function(_0x115765,_0x31cff4){_0x115765=_0x115765-0x0;var _0x118df8=_0x2b46[_0x115765];return _0x118df8;};'use strict';var _=require(_0x62b4('0x0'));var rp=require(_0x62b4('0x1'));var md5=require(_0x62b4('0x2'));var util=require('util');var moment=require(_0x62b4('0x3'));var Promise=require('bluebird');var Redis=require(_0x62b4('0x4'));var intUtil=require('./util');var config=require(_0x62b4('0x5'));var logger=require('../../../../config/logger')(_0x62b4('0x6'));config[_0x62b4('0x7')]=_[_0x62b4('0x8')](config[_0x62b4('0x7')],{'host':_0x62b4('0x9'),'port':0x18eb});var io=require(_0x62b4('0xa'))(new Redis(config[_0x62b4('0x7')]));function getAdminId(_0x5ad02d,_0x5a23f8,_0x200c83,_0x5784f3){return new Promise(function(_0x5b2a70,_0xf5d749){var _0xd1fca4=![];var _0x12c2f7={'method':_0x62b4('0xb'),'uri':_0x5784f3+_0x62b4('0xc'),'json':!![]};_0x12c2f7[_0x62b4('0xd')]=_0x200c83;logger[_0x62b4('0xe')](_0x62b4('0xf'));return rp(_0x12c2f7)['then'](function(_0x2cc812){if(_0x2cc812){var _0x18c65d=_0x2cc812[_0x62b4('0x10')];var _0x31cf71=null;for(_0x31cf71=0x0;_0x31cf71<_0x18c65d[_0x62b4('0x11')];_0x31cf71++){if(_0x18c65d[_0x31cf71][_0x62b4('0x12')]===_0x5ad02d['adminEmail']){_0x5ad02d[_0x62b4('0x13')]=_0x18c65d[_0x31cf71]['id'];_0xd1fca4=!![];}}if(_0xd1fca4){logger[_0x62b4('0xe')](_0x62b4('0x14'),_0x5ad02d[_0x62b4('0x13')]);_0x5b2a70(_0x5ad02d);}else{_0xf5d749({'statusCode':0x194,'message':_0x62b4('0x15')});}}else{_0xf5d749({'statusCode':0x194,'message':_0x62b4('0x15')});}})[_0x62b4('0x16')](function(_0x52d095){logger[_0x62b4('0x17')]('['+[_0x5a23f8[_0x62b4('0x18')]()]+']',_0x52d095['message']);_0xf5d749(_0x52d095);});});}function getUser(_0x23006d,_0x5a94f0,_0x57c900){return function(_0x26fc3c){return new Promise(function(_0x58e615,_0x9b7524){var _0x2ed2f9={'method':_0x62b4('0xb'),'uri':_0x57c900+_0x62b4('0xc'),'json':!![]};_0x2ed2f9['headers']=_0x5a94f0;logger['info'](_0x62b4('0x19'));return rp(_0x2ed2f9)[_0x62b4('0x1a')](function(_0x120dc4){if(_0x120dc4){var _0xd4f524=_0x120dc4[_0x62b4('0x10')];var _0xf16308=![];var _0x3c2d44=null;if(_0x26fc3c[_0x62b4('0x1b')]!==null){logger['info'](_0x62b4('0x1c'),_0x26fc3c[_0x62b4('0x1b')]);_0x26fc3c[_0x62b4('0x1d')]=_0x26fc3c['agentEmail'];for(_0x3c2d44=0x0;_0x3c2d44<_0xd4f524['length'];_0x3c2d44++){if(_0xd4f524[_0x3c2d44]['email']===_0x26fc3c[_0x62b4('0x1b')]){_0xf16308=!![];_0x26fc3c[_0x62b4('0x1e')]=_0xd4f524[_0x3c2d44]['id'];logger['info'](_0x62b4('0x1f'),_0x26fc3c[_0x62b4('0x1e')]);}}}if(!_0xf16308){logger[_0x62b4('0xe')]('Admin\x20selected');_0x26fc3c[_0x62b4('0x1d')]=_0x26fc3c[_0x62b4('0x20')];_0x26fc3c[_0x62b4('0x1e')]=_0x26fc3c[_0x62b4('0x13')];_0xf16308=!![];}if(_0xf16308){_0x58e615(_0x26fc3c);}else{_0x9b7524({'statusCode':0x194,'message':_0x62b4('0x15')});}}else{_0x9b7524({'statusCode':0x194,'message':_0x62b4('0x15')});}})[_0x62b4('0x16')](function(_0x14b33b){logger['error']('['+[_0x23006d[_0x62b4('0x18')]()]+']',_0x14b33b[_0x62b4('0x21')]);_0x9b7524(_0x14b33b);});});};}function searchContact(_0x45b0d5,_0x990727,_0x133e3e,_0x4eeee1){return new Promise(function(_0x2897f5,_0x22843f){var _0x4f0a16={'method':_0x62b4('0xb'),'headers':_0x990727,'uri':_0x45b0d5+_0x62b4('0x22')+_0x4eeee1+_0x62b4('0x23')+_0x133e3e+'&entities=contact','json':!![]};rp(_0x4f0a16)[_0x62b4('0x1a')](function(_0x50e77c){var _0x200cd2=_[_0x62b4('0x24')](_0x50e77c[_0x62b4('0x25')][_0x62b4('0x25')],[_0x133e3e,_0x4eeee1]);_0x2897f5(_0x200cd2);})[_0x62b4('0x16')](function(_0xa4c59b){_0x22843f(_0xa4c59b);});});}function getEndUser(_0x1454c4,_0x49dad6,_0x531058){return function(_0x5300f9){return new Promise(function(_0x4734ba,_0x132649){logger[_0x62b4('0xe')](util[_0x62b4('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5300f9[_0x62b4('0x27')]));searchContact(_0x531058,_0x49dad6,_0x62b4('0x28'),_0x5300f9[_0x62b4('0x27')])[_0x62b4('0x1a')](function(_0x5a9c1d){if(_0x5a9c1d){_0x5300f9[_0x62b4('0x29')]=_0x5a9c1d['id'];logger[_0x62b4('0xe')](_0x62b4('0x2a'),_0x5300f9[_0x62b4('0x29')]);return _0x4734ba(_0x5300f9);}searchContact(_0x531058,_0x49dad6,_0x62b4('0x2b'),_0x5300f9[_0x62b4('0x27')])['then'](function(_0x1042d5){if(_0x1042d5){_0x5300f9[_0x62b4('0x29')]=_0x1042d5['id'];logger[_0x62b4('0xe')](_0x62b4('0x2c'),_0x5300f9['endUserId']);return _0x4734ba(_0x5300f9);}createEndUser(_0x5300f9,_0x1454c4,_0x49dad6,_0x531058)[_0x62b4('0x1a')](function(_0x1de8c3){logger[_0x62b4('0xe')](_0x62b4('0x2d'),_0x1de8c3[_0x62b4('0x29')]);return _0x4734ba(_0x1de8c3);});});})['catch'](function(_0x2d2d65){_0x132649(_0x2d2d65);});});};}function createEndUser(_0x3b6ed4,_0x219b9f,_0x239479,_0x3f30df){return new Promise(function(_0x8860e3,_0x24ff39){var _0x4d1672=moment();var _0x1186da={'method':_0x62b4('0x2e'),'uri':_0x3f30df+_0x62b4('0x2f'),'body':{'contact':{'last_name':_0x3b6ed4[_0x62b4('0x27')],'work_number':_0x3b6ed4[_0x62b4('0x27')],'mobile_number':_0x3b6ed4['contactNumber'],'owner_id':_0x3b6ed4[_0x62b4('0x1e')],'created_at':_0x4d1672['format'](_0x62b4('0x30'))}},'json':!![]};_0x1186da[_0x62b4('0xd')]=_0x239479;logger['info'](_0x62b4('0x31'));return rp(_0x1186da)[_0x62b4('0x1a')](function(_0x37c67b){_0x3b6ed4[_0x62b4('0x29')]=_0x37c67b['contact']['id'];_0x8860e3(_0x3b6ed4);})[_0x62b4('0x16')](function(_0x1eb0bf){logger[_0x62b4('0x17')]('['+[_0x219b9f[_0x62b4('0x18')]()]+']',_0x1eb0bf['message']);_0x24ff39(_0x1eb0bf[_0x62b4('0x21')]);});});}function getTicket(_0x36cadb,_0x3ff5c1,_0x382df7,_0x993ef3,_0xb1dd2a){return function(_0x3abd7c){logger[_0x62b4('0xe')](_0x62b4('0x32'));return new Promise(function(_0x2b96d2,_0x4630e6){var _0x3ee907=moment();var _0x3d99ef={'method':_0x62b4('0x2e'),'uri':_0x382df7+_0x62b4('0x33'),'body':{'title':intUtil[_0x62b4('0x34')](_0x993ef3[_0x62b4('0x35')],_0xb1dd2a,'\x20'),'description':intUtil[_0x62b4('0x34')](_0x993ef3[_0x62b4('0x36')],_0xb1dd2a,'\x0a'),'owner_id':_0x3abd7c['userId'],'creater_id':_0x3abd7c['adminId'],'targetable_id':_0x3abd7c[_0x62b4('0x29')],'targetable_type':_0x62b4('0x37'),'created_at':_0x3ee907['format'](_0x62b4('0x30')),'due_date':_0x3ee907[_0x62b4('0x38')](0x1e,'m')[_0x62b4('0x26')](_0x62b4('0x30'))},'json':!![]};_0x3d99ef[_0x62b4('0xd')]=_0x3ff5c1;return rp(_0x3d99ef)[_0x62b4('0x1a')](function(_0x5a446e){_0x3abd7c[_0x62b4('0x39')]=_0x5a446e[_0x62b4('0x3a')]['id'];logger[_0x62b4('0xe')](_0x62b4('0x3b'),_0x3abd7c['ticketId']);_0x2b96d2(_0x3abd7c);})[_0x62b4('0x16')](function(_0x564ba7){logger[_0x62b4('0x17')]('['+[_0x36cadb[_0x62b4('0x18')]()]+']',_0x564ba7[_0x62b4('0x21')]);_0x4630e6(_0x564ba7['message']);});});};}function emit(_0x1c6e7c,_0x4b6cf2,_0x202e9d){var _0x450be5={'uri':_0x1c6e7c+_0x62b4('0x3c')+_0x202e9d};io['to'](util['format'](_0x62b4('0x3d'),_0x4b6cf2))[_0x62b4('0x3e')](_0x62b4('0x3f'),_0x450be5);}exports['cs']=function(_0x300889,_0x10d11f,_0x50993,_0x32860e,_0x449773,_0x59aab0,_0x1e625c,_0x2b2f34){var _0x5a7ef7={};var _0x2d7ae2={'Authorization':_0x62b4('0x40')+_0x59aab0['apiKey']};_0x59aab0[_0x62b4('0x41')]=intUtil[_0x62b4('0x42')](_0x59aab0[_0x62b4('0x41')]);_0x59aab0[_0x62b4('0x43')]=intUtil[_0x62b4('0x42')](_0x59aab0['serverUrl']);var _0xf2dd87=_0x59aab0[_0x62b4('0x41')];_0x5a7ef7[_0x62b4('0x20')]=_0x59aab0[_0x62b4('0x44')];_0x5a7ef7[_0x62b4('0x27')]=_0x2b2f34['toLowerCase']()===_0x62b4('0x45')?_0x10d11f[_0x62b4('0x46')]:_0x10d11f['calleridnum'];_0x5a7ef7[_0x62b4('0x47')]=_0x2b2f34===_0x62b4('0x48')||_0x2b2f34===_0x62b4('0x49')?'queue':'outbound';if(_0x32860e){_0x5a7ef7[_0x62b4('0x1b')]=_0x32860e[_0x62b4('0x12')];}var _0x42f4da=util[_0x62b4('0x26')](_0x62b4('0x4a'),_0x59aab0[_0x62b4('0x43')],_0x10d11f[_0x62b4('0x4b')],md5(_0x10d11f[_0x62b4('0x4b')]));if(_0x449773&&_0x449773[_0x62b4('0x4c')]){logger[_0x62b4('0xe')]('[QUEUE]',_0x62b4('0x4d'));_0x10d11f[_0x62b4('0x4e')]=_0x42f4da;}else if(_0x1e625c&&_0x1e625c['recordingFormat']&&_0x1e625c[_0x62b4('0x4f')]!==_0x62b4('0x50')){logger[_0x62b4('0xe')]('[OUTBOUND]',_0x62b4('0x4d'));_0x10d11f[_0x62b4('0x4e')]=_0x42f4da;}else{_0x10d11f[_0x62b4('0x4e')]='';}return getAdminId(_0x5a7ef7,_0x2b2f34,_0x2d7ae2,_0xf2dd87)[_0x62b4('0x1a')](getUser(_0x2b2f34,_0x2d7ae2,_0xf2dd87))[_0x62b4('0x1a')](getEndUser(_0x2b2f34,_0x2d7ae2,_0xf2dd87))[_0x62b4('0x1a')](getTicket(_0x2b2f34,_0x2d7ae2,_0xf2dd87,_0x50993,_0x10d11f))[_0x62b4('0x1a')](function(_0x50dfeb){logger[_0x62b4('0xe')](util[_0x62b4('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x50dfeb[_0x62b4('0x39')]));if(_0x2b2f34!==_0x62b4('0x49')){logger[_0x62b4('0xe')]('['+[_0x2b2f34[_0x62b4('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0xf2dd87,_0x32860e[_0x62b4('0x51')],_0x50dfeb['endUserId']);}})[_0x62b4('0x16')](function(_0x45897e){logger[_0x62b4('0x17')]('['+[_0x2b2f34['toUpperCase']()]+_0x62b4('0x52'),util[_0x62b4('0x53')](_0x45897e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5fbd=['Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','destcalleridnum','callDirection','unmanaged','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','name','inspect','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','&entities=contact','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','Subjects','Descriptions','Contact','add','ticketId','task','user:%s'];(function(_0x2a3341,_0x5d8d77){var _0xae88e1=function(_0x1ef580){while(--_0x1ef580){_0x2a3341['push'](_0x2a3341['shift']());}};_0xae88e1(++_0x5d8d77);}(_0x5fbd,0x64));var _0xd5fb=function(_0x182b32,_0x35176b){_0x182b32=_0x182b32-0x0;var _0x2f6d0e=_0x5fbd[_0x182b32];return _0x2f6d0e;};'use strict';var _=require(_0xd5fb('0x0'));var rp=require(_0xd5fb('0x1'));var md5=require('md5');var util=require(_0xd5fb('0x2'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0xd5fb('0x3'));var intUtil=require(_0xd5fb('0x4'));var config=require(_0xd5fb('0x5'));var logger=require(_0xd5fb('0x6'))(_0xd5fb('0x7'));config[_0xd5fb('0x8')]=_[_0xd5fb('0x9')](config['redis'],{'host':_0xd5fb('0xa'),'port':0x18eb});var io=require(_0xd5fb('0xb'))(new Redis(config[_0xd5fb('0x8')]));function getAdminId(_0x1758a5,_0x40fb65,_0x9fefa5,_0x5a4d17){return new Promise(function(_0x87d841,_0x5a1d14){var _0x3879e4=![];var _0x3958b4={'method':'GET','uri':_0x5a4d17+_0xd5fb('0xc'),'json':!![]};_0x3958b4['headers']=_0x9fefa5;logger[_0xd5fb('0xd')](_0xd5fb('0xe'));return rp(_0x3958b4)[_0xd5fb('0xf')](function(_0xa72efc){if(_0xa72efc){var _0x518773=_0xa72efc[_0xd5fb('0x10')];var _0x1febd2=null;for(_0x1febd2=0x0;_0x1febd2<_0x518773[_0xd5fb('0x11')];_0x1febd2++){if(_0x518773[_0x1febd2][_0xd5fb('0x12')]===_0x1758a5[_0xd5fb('0x13')]){_0x1758a5[_0xd5fb('0x14')]=_0x518773[_0x1febd2]['id'];_0x3879e4=!![];}}if(_0x3879e4){logger[_0xd5fb('0xd')]('Admin\x20found:',_0x1758a5['adminId']);_0x87d841(_0x1758a5);}else{_0x5a1d14({'statusCode':0x194,'message':_0xd5fb('0x15')});}}else{_0x5a1d14({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xd5fb('0x16')](function(_0x5d339c){logger[_0xd5fb('0x17')]('['+[_0x40fb65[_0xd5fb('0x18')]()]+']',_0x5d339c[_0xd5fb('0x19')]);_0x5a1d14(_0x5d339c);});});}function getUser(_0x4318e3,_0x5ede5f,_0x3da3ae){return function(_0x504402){return new Promise(function(_0x2d6aae,_0x497a93){var _0x53b2ac={'method':_0xd5fb('0x1a'),'uri':_0x3da3ae+'/api/selector/owners','json':!![]};_0x53b2ac[_0xd5fb('0x1b')]=_0x5ede5f;logger[_0xd5fb('0xd')](_0xd5fb('0x1c'));return rp(_0x53b2ac)[_0xd5fb('0xf')](function(_0x151ea){if(_0x151ea){var _0x47ba10=_0x151ea[_0xd5fb('0x10')];var _0x162b21=![];var _0xfcd111=null;if(_0x504402[_0xd5fb('0x1d')]!==null){logger[_0xd5fb('0xd')](_0xd5fb('0x1e'),_0x504402[_0xd5fb('0x1d')]);_0x504402['userEmail']=_0x504402[_0xd5fb('0x1d')];for(_0xfcd111=0x0;_0xfcd111<_0x47ba10[_0xd5fb('0x11')];_0xfcd111++){if(_0x47ba10[_0xfcd111]['email']===_0x504402[_0xd5fb('0x1d')]){_0x162b21=!![];_0x504402[_0xd5fb('0x1f')]=_0x47ba10[_0xfcd111]['id'];logger[_0xd5fb('0xd')](_0xd5fb('0x20'),_0x504402[_0xd5fb('0x1f')]);}}}if(!_0x162b21){logger[_0xd5fb('0xd')](_0xd5fb('0x21'));_0x504402[_0xd5fb('0x22')]=_0x504402[_0xd5fb('0x13')];_0x504402[_0xd5fb('0x1f')]=_0x504402[_0xd5fb('0x14')];_0x162b21=!![];}if(_0x162b21){_0x2d6aae(_0x504402);}else{_0x497a93({'statusCode':0x194,'message':_0xd5fb('0x15')});}}else{_0x497a93({'statusCode':0x194,'message':_0xd5fb('0x15')});}})[_0xd5fb('0x16')](function(_0x41e545){logger[_0xd5fb('0x17')]('['+[_0x4318e3[_0xd5fb('0x18')]()]+']',_0x41e545[_0xd5fb('0x19')]);_0x497a93(_0x41e545);});});};}function searchContact(_0x3d8ec7,_0x54223e,_0x2744b1,_0x18aa55){return new Promise(function(_0x4ab0d1,_0x3268e0){var _0x19d11c={'method':'GET','headers':_0x54223e,'uri':_0x3d8ec7+'/api/lookup?q='+_0x18aa55+'&f='+_0x2744b1+_0xd5fb('0x23'),'json':!![]};rp(_0x19d11c)[_0xd5fb('0xf')](function(_0x3422b0){var _0x33993c=_[_0xd5fb('0x24')](_0x3422b0[_0xd5fb('0x25')][_0xd5fb('0x25')],[_0x2744b1,_0x18aa55]);_0x4ab0d1(_0x33993c);})[_0xd5fb('0x16')](function(_0x1bd4ba){_0x3268e0(_0x1bd4ba);});});}function getEndUser(_0x5bd2f7,_0x5d4e05,_0xdf3998){return function(_0x98f493){return new Promise(function(_0x2a70ec,_0x2212d7){logger['info'](util[_0xd5fb('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x98f493[_0xd5fb('0x27')]));searchContact(_0xdf3998,_0x5d4e05,'mobile_number',_0x98f493[_0xd5fb('0x27')])[_0xd5fb('0xf')](function(_0x557c58){if(_0x557c58){_0x98f493[_0xd5fb('0x28')]=_0x557c58['id'];logger[_0xd5fb('0xd')](_0xd5fb('0x29'),_0x98f493[_0xd5fb('0x28')]);return _0x2a70ec(_0x98f493);}searchContact(_0xdf3998,_0x5d4e05,_0xd5fb('0x2a'),_0x98f493[_0xd5fb('0x27')])[_0xd5fb('0xf')](function(_0x4e0868){if(_0x4e0868){_0x98f493['endUserId']=_0x4e0868['id'];logger[_0xd5fb('0xd')](_0xd5fb('0x2b'),_0x98f493[_0xd5fb('0x28')]);return _0x2a70ec(_0x98f493);}createEndUser(_0x98f493,_0x5bd2f7,_0x5d4e05,_0xdf3998)[_0xd5fb('0xf')](function(_0x1f2fd0){logger[_0xd5fb('0xd')](_0xd5fb('0x2c'),_0x1f2fd0[_0xd5fb('0x28')]);return _0x2a70ec(_0x1f2fd0);});});})[_0xd5fb('0x16')](function(_0x3e9a57){_0x2212d7(_0x3e9a57);});});};}function createEndUser(_0x44b128,_0x1e74e4,_0x2d9583,_0x46fc62){return new Promise(function(_0x21ac4f,_0x11d3f9){var _0x3ab284=moment();var _0x595126={'method':_0xd5fb('0x2d'),'uri':_0x46fc62+'/api/contacts','body':{'contact':{'last_name':_0x44b128[_0xd5fb('0x27')],'work_number':_0x44b128[_0xd5fb('0x27')],'mobile_number':_0x44b128[_0xd5fb('0x27')],'owner_id':_0x44b128['userId'],'created_at':_0x3ab284[_0xd5fb('0x26')](_0xd5fb('0x2e'))}},'json':!![]};_0x595126[_0xd5fb('0x1b')]=_0x2d9583;logger[_0xd5fb('0xd')](_0xd5fb('0x2f'));return rp(_0x595126)[_0xd5fb('0xf')](function(_0x683146){_0x44b128[_0xd5fb('0x28')]=_0x683146['contact']['id'];_0x21ac4f(_0x44b128);})[_0xd5fb('0x16')](function(_0x379c96){logger[_0xd5fb('0x17')]('['+[_0x1e74e4[_0xd5fb('0x18')]()]+']',_0x379c96['message']);_0x11d3f9(_0x379c96['message']);});});}function getTicket(_0x36e314,_0x84d9d8,_0x57a8d1,_0x57f5f1,_0x1a16af){return function(_0x1d7a23){logger[_0xd5fb('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x570da1,_0x14cf4d){var _0xdcbe7d=moment();var _0x49fecb={'method':'POST','uri':_0x57a8d1+_0xd5fb('0x30'),'body':{'title':intUtil['getString'](_0x57f5f1[_0xd5fb('0x31')],_0x1a16af,'\x20'),'description':intUtil['getString'](_0x57f5f1[_0xd5fb('0x32')],_0x1a16af,'\x0a'),'owner_id':_0x1d7a23[_0xd5fb('0x1f')],'creater_id':_0x1d7a23[_0xd5fb('0x14')],'targetable_id':_0x1d7a23[_0xd5fb('0x28')],'targetable_type':_0xd5fb('0x33'),'created_at':_0xdcbe7d['format'](_0xd5fb('0x2e')),'due_date':_0xdcbe7d[_0xd5fb('0x34')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x49fecb[_0xd5fb('0x1b')]=_0x84d9d8;return rp(_0x49fecb)[_0xd5fb('0xf')](function(_0x29ae8f){_0x1d7a23[_0xd5fb('0x35')]=_0x29ae8f[_0xd5fb('0x36')]['id'];logger[_0xd5fb('0xd')]('Task\x20created:',_0x1d7a23[_0xd5fb('0x35')]);_0x570da1(_0x1d7a23);})[_0xd5fb('0x16')](function(_0x27a8f6){logger[_0xd5fb('0x17')]('['+[_0x36e314[_0xd5fb('0x18')]()]+']',_0x27a8f6[_0xd5fb('0x19')]);_0x14cf4d(_0x27a8f6['message']);});});};}function emit(_0x490d17,_0x305dd5,_0x29f5a6){var _0x58d7dc={'uri':_0x490d17+'/contacts/'+_0x29f5a6};io['to'](util[_0xd5fb('0x26')](_0xd5fb('0x37'),_0x305dd5))['emit']('trigger:browser:url',_0x58d7dc);}exports['cs']=function(_0x322031,_0x43b182,_0x26526d,_0x4523fc,_0x43ef61,_0x515cff,_0x4ca42b,_0x592055){var _0x4a6862={};var _0x2e6ded={'Authorization':_0xd5fb('0x38')+_0x515cff[_0xd5fb('0x39')]};_0x515cff[_0xd5fb('0x3a')]=intUtil['stripTrailingSlash'](_0x515cff[_0xd5fb('0x3a')]);_0x515cff[_0xd5fb('0x3b')]=intUtil[_0xd5fb('0x3c')](_0x515cff[_0xd5fb('0x3b')]);var _0x1cecd0=_0x515cff[_0xd5fb('0x3a')];_0x4a6862[_0xd5fb('0x13')]=_0x515cff[_0xd5fb('0x3d')];_0x4a6862[_0xd5fb('0x27')]=_0x592055[_0xd5fb('0x3e')]()==='outbound'?_0x43b182[_0xd5fb('0x3f')]:_0x43b182['calleridnum'];_0x4a6862[_0xd5fb('0x40')]=_0x592055==='queue'||_0x592055===_0xd5fb('0x41')?_0xd5fb('0x42'):_0xd5fb('0x43');if(_0x4523fc){_0x4a6862['agentEmail']=_0x4523fc[_0xd5fb('0x12')];}var _0x33ad51=util['format'](_0xd5fb('0x44'),_0x515cff[_0xd5fb('0x3b')],_0x43b182[_0xd5fb('0x45')],md5(_0x43b182[_0xd5fb('0x45')]));if(_0x43ef61&&_0x43ef61[_0xd5fb('0x46')]){logger['info'](_0xd5fb('0x47'),_0xd5fb('0x48'));_0x43b182[_0xd5fb('0x49')]=_0x33ad51;}else if(_0x4ca42b&&_0x4ca42b[_0xd5fb('0x4a')]&&_0x4ca42b[_0xd5fb('0x4a')]!==_0xd5fb('0x4b')){logger[_0xd5fb('0xd')]('[OUTBOUND]',_0xd5fb('0x48'));_0x43b182['recordingURL']=_0x33ad51;}else{_0x43b182[_0xd5fb('0x49')]='';}return getAdminId(_0x4a6862,_0x592055,_0x2e6ded,_0x1cecd0)[_0xd5fb('0xf')](getUser(_0x592055,_0x2e6ded,_0x1cecd0))[_0xd5fb('0xf')](getEndUser(_0x592055,_0x2e6ded,_0x1cecd0))[_0xd5fb('0xf')](getTicket(_0x592055,_0x2e6ded,_0x1cecd0,_0x26526d,_0x43b182))[_0xd5fb('0xf')](function(_0x47ce9b){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x47ce9b[_0xd5fb('0x35')]));if(_0x592055!==_0xd5fb('0x41')){logger[_0xd5fb('0xd')]('['+[_0x592055[_0xd5fb('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1cecd0,_0x4523fc[_0xd5fb('0x4c')],_0x47ce9b[_0xd5fb('0x28')]);}})[_0xd5fb('0x16')](function(_0x1188a8){logger[_0xd5fb('0x17')]('['+[_0x592055[_0xd5fb('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xd5fb('0x4d')](_0x1188a8,{'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 40261da..54ed9e8 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 _0xac7d=['[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','util','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','unknown\x20integration','../../../../config/logger','error'];(function(_0x424ef4,_0x330fa0){var _0x40cb6f=function(_0x10acb7){while(--_0x10acb7){_0x424ef4['push'](_0x424ef4['shift']());}};_0x40cb6f(++_0x330fa0);}(_0xac7d,0x12c));var _0xdac7=function(_0x24cf0f,_0x31376b){_0x24cf0f=_0x24cf0f-0x0;var _0x2a1a31=_0xac7d[_0x24cf0f];return _0x2a1a31;};'use strict';var _=require('lodash');var util=require(_0xdac7('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xdac7('0x1'));var zoho=require(_0xdac7('0x2'));var desk=require(_0xdac7('0x3'));var vtiger=require(_0xdac7('0x4'));var servicenow=require(_0xdac7('0x5'));var dynamics365=require('./dynamics365');var freshsales=require(_0xdac7('0x6'));var integrations=[_0xdac7('0x7'),_0xdac7('0x8'),_0xdac7('0x9'),_0xdac7('0xa'),_0xdac7('0xb'),_0xdac7('0xc'),_0xdac7('0xd'),_0xdac7('0xe'),_0xdac7('0xf'),_0xdac7('0x10')];exports[_0xdac7('0x11')]=function(_0x1ebbf4,_0x312f35,_0x25f383,_0x1acd76,_0x4b64e9,_0x4e3a31){if(_0x25f383){if(_[_0xdac7('0x12')](integrations,_0x1ebbf4[_0xdac7('0x13')][_0xdac7('0x14')]())){try{var _0x4872a1=null;var _0x1ec6a9='';var _0x3d792d=_0x25f383[_0x1ebbf4[_0xdac7('0x13')][_0xdac7('0x14')]()];if(_0x3d792d){var _0x183dd1=_0x3d792d[_0x1ebbf4['data2']];if(_0x183dd1){var _0x411232=_[_0xdac7('0x15')](_0x183dd1[_0xdac7('0x16')],{'id':parseInt(_0x1ebbf4[_0xdac7('0x17')],0xa)});if(_0x411232){if(_0x1acd76){if(_0x4b64e9&&_0x312f35['queue']){_0x1ec6a9=_0xdac7('0x18');}else if(_0x312f35[_0xdac7('0x19')]){_0x1ec6a9=_0xdac7('0x1a');}else{console['log'](_0xdac7('0x1b'),_0x312f35);}}else{_0x1ec6a9=_0xdac7('0x1c');}switch(_0x1ebbf4[_0xdac7('0x13')][_0xdac7('0x14')]()){case _0xdac7('0x7'):zendesk[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case _0xdac7('0x8'):salesforce[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case'sugarcrm':sugarcrm[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case'freshdesk':freshdesk[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case'zoho':zoho[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case _0xdac7('0xc'):desk[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case _0xdac7('0xd'):vtiger[_0x1ec6a9](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31);break;case _0xdac7('0xf'):freshsales['cs'](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31,_0x1ec6a9);break;case _0xdac7('0x10'):servicenow['cs'](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31,_0x1ec6a9);break;case _0xdac7('0xe'):dynamics365['cs'](_0x1ebbf4,_0x312f35,_0x411232,_0x1acd76,_0x4b64e9,_0x183dd1,_0x4e3a31,_0x1ec6a9);break;default:console[_0xdac7('0x1d')](_0xdac7('0x1e'));}}else{_0x4872a1=require(_0xdac7('0x1f'))(_0x1ebbf4[_0xdac7('0x13')][_0xdac7('0x14')]());_0x4872a1[_0xdac7('0x20')](_0xdac7('0x21'),util[_0xdac7('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1ebbf4[_0xdac7('0x13')]['toLowerCase'](),_0x1ebbf4[_0xdac7('0x17')]));}}else{_0x4872a1=require('../../../../config/logger')(_0x1ebbf4[_0xdac7('0x13')]['toLowerCase']());_0x4872a1[_0xdac7('0x20')](_0xdac7('0x21'),util['format'](_0xdac7('0x23'),_0x1ebbf4[_0xdac7('0x13')][_0xdac7('0x14')](),_0x1ebbf4[_0xdac7('0x24')]));}}else{}}catch(_0x301e06){console[_0xdac7('0x20')](_0x301e06);}}}}; \ No newline at end of file +var _0x164d=['./desk','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data1','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','salesforce','log','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','format','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho'];(function(_0x38ae4f,_0x1d3180){var _0x1e92db=function(_0x1a1cb9){while(--_0x1a1cb9){_0x38ae4f['push'](_0x38ae4f['shift']());}};_0x1e92db(++_0x1d3180);}(_0x164d,0x82));var _0xd164=function(_0x9f7958,_0x496d9f){_0x9f7958=_0x9f7958-0x0;var _0x53d281=_0x164d[_0x9f7958];return _0x53d281;};'use strict';var _=require(_0xd164('0x0'));var util=require('util');var zendesk=require(_0xd164('0x1'));var salesforce=require(_0xd164('0x2'));var sugarcrm=require(_0xd164('0x3'));var freshdesk=require(_0xd164('0x4'));var zoho=require(_0xd164('0x5'));var desk=require(_0xd164('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xd164('0x7'));var dynamics365=require(_0xd164('0x8'));var freshsales=require('./freshsales');var integrations=[_0xd164('0x9'),'salesforce',_0xd164('0xa'),_0xd164('0xb'),_0xd164('0xc'),_0xd164('0xd'),_0xd164('0xe'),_0xd164('0xf'),_0xd164('0x10'),_0xd164('0x11')];exports[_0xd164('0x12')]=function(_0x2d65a4,_0x4366e1,_0x431da2,_0x1c2352,_0x180eb7,_0x3a9774){if(_0x431da2){if(_['includes'](integrations,_0x2d65a4['data1'][_0xd164('0x13')]())){try{var _0x580a43=null;var _0x13a7bb='';var _0x2df56a=_0x431da2[_0x2d65a4[_0xd164('0x14')][_0xd164('0x13')]()];if(_0x2df56a){var _0x368c00=_0x2df56a[_0x2d65a4['data2']];if(_0x368c00){var _0x1337dd=_['find'](_0x368c00['Configurations'],{'id':parseInt(_0x2d65a4['data3'],0xa)});if(_0x1337dd){if(_0x1c2352){if(_0x180eb7&&_0x4366e1[_0xd164('0x15')]){_0x13a7bb=_0xd164('0x15');}else if(_0x4366e1[_0xd164('0x16')]){_0x13a7bb=_0xd164('0x17');}else{console['log'](_0xd164('0x18'),_0x4366e1);}}else{_0x13a7bb=_0xd164('0x19');}switch(_0x2d65a4[_0xd164('0x14')][_0xd164('0x13')]()){case'zendesk':zendesk[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case _0xd164('0x1a'):salesforce[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case _0xd164('0xa'):sugarcrm[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case'freshdesk':freshdesk[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case'zoho':zoho[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case _0xd164('0xd'):desk[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case'vtiger':vtiger[_0x13a7bb](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774);break;case _0xd164('0x10'):freshsales['cs'](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774,_0x13a7bb);break;case _0xd164('0x11'):servicenow['cs'](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774,_0x13a7bb);break;case'dynamics365':dynamics365['cs'](_0x2d65a4,_0x4366e1,_0x1337dd,_0x1c2352,_0x180eb7,_0x368c00,_0x3a9774,_0x13a7bb);break;default:console[_0xd164('0x1b')]('unknown\x20integration');}}else{_0x580a43=require(_0xd164('0x1c'))(_0x2d65a4[_0xd164('0x14')]['toLowerCase']());_0x580a43[_0xd164('0x1d')](_0xd164('0x1e'),util['format'](_0xd164('0x1f'),_0x2d65a4[_0xd164('0x14')]['toLowerCase'](),_0x2d65a4[_0xd164('0x20')]));}}else{_0x580a43=require('../../../../config/logger')(_0x2d65a4[_0xd164('0x14')][_0xd164('0x13')]());_0x580a43[_0xd164('0x1d')](_0xd164('0x1e'),util[_0xd164('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x2d65a4[_0xd164('0x14')][_0xd164('0x13')](),_0x2d65a4['data2']));}}else{}}catch(_0x440954){console['error'](_0x440954);}}}}; \ 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 6f64ec9..cca294d 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 _0x6f2d=['variableName','Variable','name','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','User','find','execute','then','Email','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','length','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Account','Lead','first','Name','Phone','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes','string','idField','content','toString','variable'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6f2d,0xb0));var _0xd6f2=function(_0x5c5b94,_0x25517b){_0x5c5b94=_0x5c5b94-0x0;var _0x35d190=_0x6f2d[_0x5c5b94];return _0x35d190;};'use strict';var _=require(_0xd6f2('0x0'));var rp=require(_0xd6f2('0x1'));var moment=require(_0xd6f2('0x2'));var BPromise=require(_0xd6f2('0x3'));var md5=require('md5');var jsforce=require(_0xd6f2('0x4'));var util=require(_0xd6f2('0x5'));var Redis=require(_0xd6f2('0x6'));var intUtil=require(_0xd6f2('0x7'));var config=require(_0xd6f2('0x8'));var logger=require(_0xd6f2('0x9'))('salesforce');config['redis']=_[_0xd6f2('0xa')](config[_0xd6f2('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd6f2('0xb')]));function emit(_0x3a803e,_0x5dfdff,_0x48c51d){io['to'](_0x3a803e)[_0xd6f2('0xc')](_0x5dfdff,_0x48c51d);}function getTicket(_0x140c76,_0x84579e,_0x4c544e,_0x404bdf,_0x317503,_0x9865c,_0x397493,_0x191975){var _0x2853ee=Object[_0xd6f2('0xd')]({},{'OwnerId':_0x84579e['id'],'Subject':intUtil[_0xd6f2('0xe')](_0x404bdf[_0xd6f2('0xf')],_0x317503,'\x20'),'Description':intUtil[_0xd6f2('0xe')](_0x404bdf[_0xd6f2('0x10')],_0x317503,'\x0a')},getCustomFields(_0x9865c,_0x317503));if(_0x4c544e){if(_0x404bdf[_0xd6f2('0x11')]===_0xd6f2('0x12')){_0x2853ee[_0xd6f2('0x13')]=moment[_0xd6f2('0x14')]();_0x2853ee[_0xd6f2('0x15')]=![];_0x2853ee[_0xd6f2('0x16')]=![];if(_0x4c544e[_0xd6f2('0x17')]===_0xd6f2('0x18')||_0x4c544e[_0xd6f2('0x17')]===_0xd6f2('0x19')){_0x2853ee[_0xd6f2('0x1a')]=_0x4c544e['id'];}else if(_0x4c544e[_0xd6f2('0x17')]===_0xd6f2('0x1b')){_0x2853ee[_0xd6f2('0x1c')]=_0x4c544e['id'];}}else if(_0x404bdf[_0xd6f2('0x11')]===_0xd6f2('0x1d')){if(_0x4c544e[_0xd6f2('0x17')]===_0xd6f2('0x18')){_0x2853ee[_0xd6f2('0x1e')]=_0x4c544e['id'];}else if(_0x4c544e['endUserType']===_0xd6f2('0x1b')){_0x2853ee[_0xd6f2('0x1f')]=_0x4c544e['id'];}else if(_0x4c544e[_0xd6f2('0x17')]===_0xd6f2('0x19')&&_0x404bdf[_0xd6f2('0x20')]){_0x2853ee[_0x404bdf[_0xd6f2('0x20')]]=_0x4c544e['id'];}else{logger[_0xd6f2('0x21')](_0xd6f2('0x22'));}}}return _0x397493['sobject'](_0x404bdf[_0xd6f2('0x11')])[_0xd6f2('0x23')](_0x2853ee);}function getUser(_0x3db85f,_0x5c46e6,_0x2a8788){if(!_[_0xd6f2('0x24')](_0x5c46e6)&&intUtil['validateEmail'](_0x5c46e6)){var _0x48c214={'Email':_0x5c46e6};var _0x280f0b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2a8788[_0xd6f2('0x25')](_0xd6f2('0x26'))[_0xd6f2('0x27')](_0x48c214,_0x280f0b)[_0xd6f2('0x28')]()[_0xd6f2('0x29')](function(_0x16fb72){if(_0x16fb72['length']){var _0x5a5900=_['find'](_0x16fb72,function(_0x3d1251){return _0x3d1251[_0xd6f2('0x2a')]===_0x5c46e6;});if(_0x5a5900){logger[_0xd6f2('0x21')]('Agent\x20%s\x20found.',_0x5c46e6);return BPromise[_0xd6f2('0x2b')]({'id':_0x5a5900['Id'],'name':_0x5a5900['Name']});}}else{logger[_0xd6f2('0x21')](_0xd6f2('0x2c'),_0x5c46e6);return _0x2a8788[_0xd6f2('0x2d')]()[_0xd6f2('0x29')](function(_0x2bc74e){return BPromise['resolve']({'id':_0x2bc74e[_0xd6f2('0x2e')],'name':_0x2bc74e['display_name']});});}});}else{logger[_0xd6f2('0x21')](_0xd6f2('0x2c'),_0x5c46e6);return _0x2a8788['identity']()['then'](function(_0x1d4a69){return BPromise['resolve']({'id':_0x1d4a69[_0xd6f2('0x2e')],'name':_0x1d4a69[_0xd6f2('0x2f')]});});}}function getEndUser(_0x344a5c,_0x33a9d6,_0x1ad973,_0xf34cde,_0x2bd13b){var _0x5c94d8={'$or':{'Phone':_0xf34cde}};var _0x274091={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd6f2('0x2b')]()[_0xd6f2('0x29')](function(){logger[_0xd6f2('0x21')](_0xd6f2('0x30'),_0xf34cde,_0x33a9d6[_0xd6f2('0x31')]);switch(_0x33a9d6[_0xd6f2('0x31')]){case'contact_lead':var _0x5557fd=_[_0xd6f2('0x32')](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x33')]){var _0x5d293a={};_0x5d293a[_0x33a9d6[_0xd6f2('0x33')]]=_0xf34cde;_['merge'](_0x5557fd[_0xd6f2('0x34')],_0x5d293a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x35'))[_0xd6f2('0x27')](_0x5557fd,_0x274091)[_0xd6f2('0x28')]()[_0xd6f2('0x29')](function(_0x443ab1){if(_0x443ab1&&_0x443ab1[_0xd6f2('0x36')]){return _0x443ab1;}else{var _0x3ac27a=_['cloneDeep'](_0x5c94d8);if(_0x33a9d6['additionalSearchLead']){var _0x31ac10={};_0x31ac10[_0x33a9d6[_0xd6f2('0x37')]]=_0xf34cde;_[_0xd6f2('0x38')](_0x3ac27a[_0xd6f2('0x34')],_0x31ac10);}return _0x2bd13b[_0xd6f2('0x25')]('Lead')[_0xd6f2('0x27')](_0x3ac27a,_0x274091);}});case _0xd6f2('0x39'):var _0x3f1542=_['cloneDeep'](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x3a')]){var _0x5d293a={};_0x5d293a[_0x33a9d6[_0xd6f2('0x3a')]]=_0xf34cde;_['merge'](_0x3f1542[_0xd6f2('0x34')],_0x5d293a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x3b'))['find'](_0x3f1542,_0x274091)['execute']()[_0xd6f2('0x29')](function(_0x3e38e6){if(_0x3e38e6&&_0x3e38e6[_0xd6f2('0x36')]){return _0x3e38e6;}else{var _0x4b101d=_['cloneDeep'](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x33')]){var _0x47c3fe={};_0x47c3fe[_0x33a9d6['additionalSearchContact']]=_0xf34cde;_[_0xd6f2('0x38')](_0x4b101d['$or'],_0x47c3fe);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x35'))[_0xd6f2('0x27')](_0x4b101d,_0x274091)[_0xd6f2('0x29')](function(_0x4fd744){if(_0x4fd744&&_0x4fd744[_0xd6f2('0x36')]){return _0x4fd744;}else{var _0x1cb54f=_[_0xd6f2('0x32')](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x37')]){var _0x4e6b5a={};_0x4e6b5a[_0x33a9d6[_0xd6f2('0x37')]]=_0xf34cde;_[_0xd6f2('0x38')](_0x1cb54f[_0xd6f2('0x34')],_0x4e6b5a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x3c'))['find'](_0x1cb54f,_0x274091);}});}});case'contact':var _0x5557fd=_[_0xd6f2('0x32')](_0x5c94d8);if(_0x33a9d6['additionalSearchContact']){var _0x5d293a={};_0x5d293a[_0x33a9d6[_0xd6f2('0x33')]]=_0xf34cde;_[_0xd6f2('0x38')](_0x5557fd['$or'],_0x5d293a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x35'))[_0xd6f2('0x27')](_0x5557fd,_0x274091)[_0xd6f2('0x28')]();case _0xd6f2('0x19'):var _0x4c2cfa=_[_0xd6f2('0x32')](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x37')]){var _0x5d293a={};_0x5d293a[_0x33a9d6['additionalSearchLead']]=_0xf34cde;_[_0xd6f2('0x38')](_0x4c2cfa[_0xd6f2('0x34')],_0x5d293a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x3c'))[_0xd6f2('0x27')](_0x4c2cfa,_0x274091);case _0xd6f2('0x1b'):var _0x3f1542=_[_0xd6f2('0x32')](_0x5c94d8);if(_0x33a9d6[_0xd6f2('0x3a')]){var _0x5d293a={};_0x5d293a[_0x33a9d6[_0xd6f2('0x3a')]]=_0xf34cde;_[_0xd6f2('0x38')](_0x3f1542[_0xd6f2('0x34')],_0x5d293a);}return _0x2bd13b[_0xd6f2('0x25')](_0xd6f2('0x3b'))[_0xd6f2('0x27')](_0x3f1542,_0x274091);default:return null;}})[_0xd6f2('0x29')](function(_0x5e961f){if(_0x5e961f&&_0x5e961f['length']){var _0x30e9e9=_[_0xd6f2('0x3d')](_0x5e961f);if(_0x30e9e9){return BPromise['resolve']({'id':_0x30e9e9['Id'],'name':_0x30e9e9[_0xd6f2('0x3e')],'phone':_0x30e9e9[_0xd6f2('0x3f')],'endUserType':_0x30e9e9['attributes'][_0xd6f2('0x40')][_0xd6f2('0x41')]()});}}})[_0xd6f2('0x29')](function(_0x3f4945){if(_0x3f4945){logger[_0xd6f2('0x21')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3f4945[_0xd6f2('0x17')],_0xf34cde);return BPromise[_0xd6f2('0x2b')](_0x3f4945);}else{logger['info'](_0xd6f2('0x42'),_0xf34cde);var _0x4a1125={'Phone':_0xf34cde};if(_0x33a9d6['moduleCreate']){if(_0x33a9d6['moduleCreate']===_0xd6f2('0x18')){logger[_0xd6f2('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf34cde,_0x33a9d6[_0xd6f2('0x43')]);_0x4a1125[_0xd6f2('0x44')]=_0x1ad973!==_0xd6f2('0x45')?_0x1ad973:util['format']('Caller\x20-\x20%s',_0xf34cde);}else if(_0x33a9d6['moduleCreate']==='lead'){logger['info'](_0xd6f2('0x46'),_0xf34cde,_0x33a9d6['moduleCreate']);_0x4a1125[_0xd6f2('0x44')]=_0x1ad973!==_0xd6f2('0x45')?_0x1ad973:util[_0xd6f2('0x47')](_0xd6f2('0x48'),_0xf34cde);_0x4a1125[_0xd6f2('0x49')]=_0xd6f2('0x4a');}else if(_0x33a9d6['moduleCreate']==='account'){logger[_0xd6f2('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf34cde,_0x33a9d6[_0xd6f2('0x43')]);_0x4a1125['Name']=_0x1ad973!==''?_0x1ad973:util[_0xd6f2('0x47')]('Caller\x20-\x20%s',_0xf34cde);}else{return null;}}return _0x2bd13b[_0xd6f2('0x25')](_[_0xd6f2('0x4b')](_0x33a9d6[_0xd6f2('0x43')]))[_0xd6f2('0x23')](_0x4a1125)[_0xd6f2('0x29')](function(_0x52db8c){return BPromise[_0xd6f2('0x2b')]({'id':_0x52db8c['id'],'endUserType':_0x33a9d6[_0xd6f2('0x43')]});});}});}function getCustomFields(_0xc98dc9,_0x2c3f70){var _0x2c0a23={};if(_0xc98dc9['length']>0x0){_['forEach'](_0xc98dc9,function(_0x16a21f){if(_[_0xd6f2('0x4c')]([_0xd6f2('0x4d'),'picklist'],_0x16a21f[_0xd6f2('0x40')])&&_0x16a21f[_0xd6f2('0x4e')]){_0x2c0a23[_0x16a21f[_0xd6f2('0x4e')]]=_0x16a21f[_0xd6f2('0x4f')][_0xd6f2('0x50')]();}else if(_0x16a21f['type']===_0xd6f2('0x51')&&_0x16a21f['variableName']&&_0x16a21f[_0xd6f2('0x4e')]){_0x2c3f70[_0x16a21f[_0xd6f2('0x52')]]&&(_0x2c0a23[_0x16a21f[_0xd6f2('0x4e')]]=_0x2c3f70[_0x16a21f[_0xd6f2('0x52')]][_0xd6f2('0x50')]());}else if(_0x16a21f[_0xd6f2('0x40')]==='customVariable'&&_0x16a21f[_0xd6f2('0x53')]&&_0x16a21f['Variable']['name']&&_0x16a21f['idField']){_0x2c3f70[_0x16a21f['Variable'][_0xd6f2('0x54')]['toLowerCase']()]&&(_0x2c0a23[_0x16a21f[_0xd6f2('0x4e')]]=_0x2c3f70[_0x16a21f[_0xd6f2('0x53')][_0xd6f2('0x54')]['toLowerCase']()][_0xd6f2('0x50')]());}});}return _0x2c0a23;}function getConnection(_0x402228){var _0x1334fd=_0x402228['password'][_0xd6f2('0x55')](_0x402228[_0xd6f2('0x56')]);var _0xb6dbc0=new jsforce[(_0xd6f2('0x57'))]({'oauth2':{'loginUrl':_0x402228[_0xd6f2('0x58')]||'https://login.salesforce.com','clientId':_0x402228[_0xd6f2('0x59')],'clientSecret':_0x402228[_0xd6f2('0x5a')]}});return _0xb6dbc0[_0xd6f2('0x5b')](_0x402228[_0xd6f2('0x5c')],_0x1334fd)[_0xd6f2('0x29')](function(){logger[_0xd6f2('0x21')](_0xd6f2('0x5d'));return _0xb6dbc0;});}exports[_0xd6f2('0x5e')]=function(_0x101b70,_0xeae6e1,_0x13a548,_0x3740f0,_0x421406,_0x4b0e1d){var _0x585caa,_0x1c5bc0,_0x539f38,_0x442cab;_0x4b0e1d[_0xd6f2('0x5f')]=intUtil[_0xd6f2('0x60')](_0x4b0e1d['serverUrl']);_0x4b0e1d[_0xd6f2('0x58')]=intUtil[_0xd6f2('0x60')](_0x4b0e1d[_0xd6f2('0x58')]);if(_0x421406&&_0x421406[_0xd6f2('0x61')]){logger['info'](_0xd6f2('0x62'),_0xd6f2('0x63'));_0xeae6e1[_0xd6f2('0x64')]=util[_0xd6f2('0x47')](_0xd6f2('0x65'),_0x4b0e1d[_0xd6f2('0x5f')],_0xeae6e1[_0xd6f2('0x66')],md5(_0xeae6e1[_0xd6f2('0x66')]));}else{_0xeae6e1[_0xd6f2('0x64')]='';}return getConnection(_0x4b0e1d)[_0xd6f2('0x29')](function(_0xef49e6){_0x442cab=_0xef49e6;return getUser(_0x4b0e1d,_0x3740f0[_0xd6f2('0x67')],_0x442cab);})[_0xd6f2('0x29')](function(_0x52c8f7){_0x585caa=_0x52c8f7;return getEndUser(_0x4b0e1d,_0x13a548,_0xeae6e1[_0xd6f2('0x68')],_0xeae6e1['calleridnum'],_0x442cab);})['then'](function(_0x1988cd){_0x1c5bc0=_0x1988cd;return getTicket(_0x4b0e1d,_0x585caa,_0x1c5bc0,_0x13a548,_0xeae6e1,_0x13a548[_0xd6f2('0x69')],_0x442cab,'queue');})['then'](function(_0x1d538a){_0x539f38=_0x1d538a;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x539f38['id']);logger[_0xd6f2('0x21')](_0xd6f2('0x6a'),_0x539f38['id'],_0x3740f0[_0xd6f2('0x54')],_0x4b0e1d[_0xd6f2('0x40')]);switch(_0x4b0e1d[_0xd6f2('0x40')]){case _0xd6f2('0x6b'):emit(util['format'](_0xd6f2('0x6c'),_0x3740f0['name']),_0xd6f2('0x6d'),{'recordId':_0x539f38['id']});break;case _0xd6f2('0x6e'):emit(util[_0xd6f2('0x47')](_0xd6f2('0x6c'),_0x3740f0['name']),_0xd6f2('0x6f'),{'uri':util[_0xd6f2('0x47')]('%s/%s/e',_0x442cab[_0xd6f2('0x70')],_0x539f38['id'])});break;default:logger[_0xd6f2('0x71')](_0xd6f2('0x72'));}})[_0xd6f2('0x73')](function(_0x1c3a04){logger['error'](_0xd6f2('0x62'),_0x1c3a04);});};exports[_0xd6f2('0x74')]=function(_0x579850,_0x56730d,_0x192e37,_0x254f19,_0x574bc6,_0x1cf3ac,_0x472a77){var _0x2e5874,_0x46fa37,_0x4250a9,_0x3abfea;_0x1cf3ac[_0xd6f2('0x5f')]=intUtil[_0xd6f2('0x60')](_0x1cf3ac[_0xd6f2('0x5f')]);_0x1cf3ac[_0xd6f2('0x58')]=intUtil[_0xd6f2('0x60')](_0x1cf3ac[_0xd6f2('0x58')]);if(_0x472a77&&_0x472a77[_0xd6f2('0x75')]&&_0x472a77[_0xd6f2('0x75')]!==_0xd6f2('0x76')){logger[_0xd6f2('0x21')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x56730d['recordingURL']=util[_0xd6f2('0x47')](_0xd6f2('0x65'),_0x1cf3ac[_0xd6f2('0x5f')],_0x56730d[_0xd6f2('0x66')],md5(_0x56730d['uniqueid']));}return getConnection(_0x1cf3ac)[_0xd6f2('0x29')](function(_0x93405a){_0x3abfea=_0x93405a;return getUser(_0x1cf3ac,_0x254f19[_0xd6f2('0x67')],_0x3abfea);})[_0xd6f2('0x29')](function(_0x56fea6){_0x2e5874=_0x56fea6;return getEndUser(_0x1cf3ac,_0x192e37,_0x56730d[_0xd6f2('0x77')],_0x56730d['destcalleridnum'],_0x3abfea);})[_0xd6f2('0x29')](function(_0x45d5bb){_0x46fa37=_0x45d5bb;return getTicket(_0x1cf3ac,_0x2e5874,_0x46fa37,_0x192e37,_0x56730d,_0x192e37[_0xd6f2('0x69')],_0x3abfea,_0xd6f2('0x74'));})[_0xd6f2('0x29')](function(_0x4d28f5){_0x4250a9=_0x4d28f5;logger['info'](_0xd6f2('0x78'),_0x4250a9['id']);logger[_0xd6f2('0x21')](_0xd6f2('0x79'),_0x4250a9['id'],_0x254f19[_0xd6f2('0x54')],_0x1cf3ac[_0xd6f2('0x40')]);switch(_0x1cf3ac['type']){case _0xd6f2('0x6b'):emit(util['format'](_0xd6f2('0x6c'),_0x254f19['name']),_0xd6f2('0x6d'),{'recordId':_0x4250a9['id']});break;case _0xd6f2('0x6e'):emit(util['format'](_0xd6f2('0x6c'),_0x254f19[_0xd6f2('0x54')]),_0xd6f2('0x6f'),{'uri':util[_0xd6f2('0x47')](_0xd6f2('0x7a'),_0x3abfea[_0xd6f2('0x70')],_0x4250a9['id'])});break;default:logger['error']('[OUTBOUND]',_0xd6f2('0x7b'));}})['catch'](function(_0xffd5f4){logger[_0xd6f2('0x71')]('[OUTBOUND]',_0xffd5f4);});};exports['unmanaged']=function(_0x458f17,_0x2ec781,_0x1c9782,_0x18d16d,_0x591754,_0x475e50){var _0x557f43,_0x3c2ff4,_0x1b20cb,_0x369e34;_0x475e50[_0xd6f2('0x5f')]=intUtil[_0xd6f2('0x60')](_0x475e50[_0xd6f2('0x5f')]);_0x475e50[_0xd6f2('0x58')]=intUtil['stripTrailingSlash'](_0x475e50[_0xd6f2('0x58')]);if(_0x591754&&_0x591754['monitor_format']){logger[_0xd6f2('0x21')]('['+_0x2ec781[_0xd6f2('0x7c')]['toUpperCase']()+']',_0xd6f2('0x63'));_0x2ec781['recordingURL']=util[_0xd6f2('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x475e50[_0xd6f2('0x5f')],_0x2ec781[_0xd6f2('0x66')],md5(_0x2ec781[_0xd6f2('0x66')]));}else{_0x2ec781[_0xd6f2('0x64')]='';}return getConnection(_0x475e50)['then'](function(_0x31a264){_0x369e34=_0x31a264;if(!_[_0xd6f2('0x24')](_0x18d16d)){return getUser(_0x475e50,_0x18d16d['name'],_0x369e34);}else{return getUser(_0x475e50,null,_0x369e34);}})[_0xd6f2('0x29')](function(_0x5a56c0){_0x557f43=_0x5a56c0;return getEndUser(_0x475e50,_0x1c9782,_0x2ec781[_0xd6f2('0x68')],_0x2ec781[_0xd6f2('0x7d')],_0x369e34);})[_0xd6f2('0x29')](function(_0x4e65e3){_0x3c2ff4=_0x4e65e3;return getTicket(_0x475e50,_0x557f43,_0x3c2ff4,_0x1c9782,_0x2ec781,_0x1c9782[_0xd6f2('0x69')],_0x369e34);})[_0xd6f2('0x29')](function(_0xb492ee){_0x1b20cb=_0xb492ee;logger[_0xd6f2('0x21')]('['+_0x2ec781[_0xd6f2('0x7c')][_0xd6f2('0x7e')]()+_0xd6f2('0x7f'),_0x1b20cb['id']);logger[_0xd6f2('0x21')]('['+_0x2ec781[_0xd6f2('0x7c')][_0xd6f2('0x7e')]()+_0xd6f2('0x80'),_0x475e50['type']);})[_0xd6f2('0x73')](function(_0x53113d){logger[_0xd6f2('0x71')]('['+_0x2ec781[_0xd6f2('0x7c')][_0xd6f2('0x7e')]()+']',_0x53113d);});}; \ No newline at end of file +var _0xcb6a=['LastName','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','includes','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','lead','WhoId','endUserType','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','Name','then','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','cloneDeep','additionalSearchAccount','Account','additionalSearchContact','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.'];(function(_0x743ca2,_0x3ef14b){var _0x1d4b58=function(_0x459f08){while(--_0x459f08){_0x743ca2['push'](_0x743ca2['shift']());}};_0x1d4b58(++_0x3ef14b);}(_0xcb6a,0xb7));var _0xacb6=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcb6a[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xacb6('0x0'));var rp=require(_0xacb6('0x1'));var moment=require(_0xacb6('0x2'));var BPromise=require(_0xacb6('0x3'));var md5=require(_0xacb6('0x4'));var jsforce=require('jsforce');var util=require(_0xacb6('0x5'));var Redis=require(_0xacb6('0x6'));var intUtil=require(_0xacb6('0x7'));var config=require(_0xacb6('0x8'));var logger=require(_0xacb6('0x9'))('salesforce');config[_0xacb6('0xa')]=_['defaults'](config[_0xacb6('0xa')],{'host':_0xacb6('0xb'),'port':0x18eb});var io=require(_0xacb6('0xc'))(new Redis(config[_0xacb6('0xa')]));function emit(_0xa3bf61,_0x430c87,_0x50c3ab){io['to'](_0xa3bf61)[_0xacb6('0xd')](_0x430c87,_0x50c3ab);}function getTicket(_0xbe4a1e,_0x461666,_0x36e386,_0x449f6c,_0x29fe5d,_0x4c796c,_0x5200c2,_0x5a0e78){var _0x268833=Object['assign']({},{'OwnerId':_0x461666['id'],'Subject':intUtil['getString'](_0x449f6c[_0xacb6('0xe')],_0x29fe5d,'\x20'),'Description':intUtil[_0xacb6('0xf')](_0x449f6c['Descriptions'],_0x29fe5d,'\x0a')},getCustomFields(_0x4c796c,_0x29fe5d));if(_0x36e386){if(_0x449f6c[_0xacb6('0x10')]===_0xacb6('0x11')){_0x268833[_0xacb6('0x12')]=moment[_0xacb6('0x13')]();_0x268833[_0xacb6('0x14')]=![];_0x268833[_0xacb6('0x15')]=![];if(_0x36e386['endUserType']==='contact'||_0x36e386['endUserType']===_0xacb6('0x16')){_0x268833[_0xacb6('0x17')]=_0x36e386['id'];}else if(_0x36e386[_0xacb6('0x18')]===_0xacb6('0x19')){_0x268833[_0xacb6('0x1a')]=_0x36e386['id'];}}else if(_0x449f6c[_0xacb6('0x10')]===_0xacb6('0x1b')){if(_0x36e386[_0xacb6('0x18')]===_0xacb6('0x1c')){_0x268833[_0xacb6('0x1d')]=_0x36e386['id'];}else if(_0x36e386[_0xacb6('0x18')]==='account'){_0x268833[_0xacb6('0x1e')]=_0x36e386['id'];}else if(_0x36e386[_0xacb6('0x18')]==='lead'&&_0x449f6c['leadId']){_0x268833[_0x449f6c[_0xacb6('0x1f')]]=_0x36e386['id'];}else{logger[_0xacb6('0x20')](_0xacb6('0x21'));}}}return _0x5200c2[_0xacb6('0x22')](_0x449f6c[_0xacb6('0x10')])['create'](_0x268833);}function getUser(_0x214e64,_0x4e3a79,_0x3c3343){if(!_[_0xacb6('0x23')](_0x4e3a79)&&intUtil[_0xacb6('0x24')](_0x4e3a79)){var _0x46553c={'Email':_0x4e3a79};var _0x50bd71={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3c3343[_0xacb6('0x22')](_0xacb6('0x25'))[_0xacb6('0x26')](_0x46553c,_0x50bd71)[_0xacb6('0x27')]()['then'](function(_0x6cb17d){if(_0x6cb17d[_0xacb6('0x28')]){var _0xfbcb39=_['find'](_0x6cb17d,function(_0x4d13e3){return _0x4d13e3['Email']===_0x4e3a79;});if(_0xfbcb39){logger[_0xacb6('0x20')](_0xacb6('0x29'),_0x4e3a79);return BPromise['resolve']({'id':_0xfbcb39['Id'],'name':_0xfbcb39[_0xacb6('0x2a')]});}}else{logger[_0xacb6('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4e3a79);return _0x3c3343['identity']()[_0xacb6('0x2b')](function(_0x100cc5){return BPromise[_0xacb6('0x2c')]({'id':_0x100cc5[_0xacb6('0x2d')],'name':_0x100cc5[_0xacb6('0x2e')]});});}});}else{logger[_0xacb6('0x20')](_0xacb6('0x2f'),_0x4e3a79);return _0x3c3343[_0xacb6('0x30')]()[_0xacb6('0x2b')](function(_0x426c52){return BPromise[_0xacb6('0x2c')]({'id':_0x426c52[_0xacb6('0x2d')],'name':_0x426c52[_0xacb6('0x2e')]});});}}function getEndUser(_0xae3e80,_0x5a09e4,_0x18213f,_0xf677d2,_0x2e4360){var _0x239ee3={'$or':{'Phone':_0xf677d2}};var _0x55e9c9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xacb6('0x2c')]()['then'](function(){logger[_0xacb6('0x20')](_0xacb6('0x31'),_0xf677d2,_0x5a09e4[_0xacb6('0x32')]);switch(_0x5a09e4[_0xacb6('0x32')]){case'contact_lead':var _0x2025be=_['cloneDeep'](_0x239ee3);if(_0x5a09e4['additionalSearchContact']){var _0x1c1889={};_0x1c1889[_0x5a09e4['additionalSearchContact']]=_0xf677d2;_[_0xacb6('0x33')](_0x2025be[_0xacb6('0x34')],_0x1c1889);}return _0x2e4360['sobject'](_0xacb6('0x35'))[_0xacb6('0x26')](_0x2025be,_0x55e9c9)[_0xacb6('0x27')]()[_0xacb6('0x2b')](function(_0x3aab35){if(_0x3aab35&&_0x3aab35[_0xacb6('0x28')]){return _0x3aab35;}else{var _0x5bbe98=_['cloneDeep'](_0x239ee3);if(_0x5a09e4[_0xacb6('0x36')]){var _0x55de2a={};_0x55de2a[_0x5a09e4['additionalSearchLead']]=_0xf677d2;_[_0xacb6('0x33')](_0x5bbe98['$or'],_0x55de2a);}return _0x2e4360['sobject'](_0xacb6('0x37'))[_0xacb6('0x26')](_0x5bbe98,_0x55e9c9);}});case _0xacb6('0x38'):var _0x162ca4=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4[_0xacb6('0x3a')]){var _0x1c1889={};_0x1c1889[_0x5a09e4[_0xacb6('0x3a')]]=_0xf677d2;_[_0xacb6('0x33')](_0x162ca4[_0xacb6('0x34')],_0x1c1889);}return _0x2e4360[_0xacb6('0x22')](_0xacb6('0x3b'))[_0xacb6('0x26')](_0x162ca4,_0x55e9c9)['execute']()['then'](function(_0x554293){if(_0x554293&&_0x554293[_0xacb6('0x28')]){return _0x554293;}else{var _0x5ad721=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4[_0xacb6('0x3c')]){var _0xac0036={};_0xac0036[_0x5a09e4[_0xacb6('0x3c')]]=_0xf677d2;_[_0xacb6('0x33')](_0x5ad721[_0xacb6('0x34')],_0xac0036);}return _0x2e4360[_0xacb6('0x22')]('Contact')[_0xacb6('0x26')](_0x5ad721,_0x55e9c9)['then'](function(_0x432243){if(_0x432243&&_0x432243[_0xacb6('0x28')]){return _0x432243;}else{var _0x144707=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4[_0xacb6('0x36')]){var _0x124e3d={};_0x124e3d[_0x5a09e4[_0xacb6('0x36')]]=_0xf677d2;_[_0xacb6('0x33')](_0x144707[_0xacb6('0x34')],_0x124e3d);}return _0x2e4360[_0xacb6('0x22')]('Lead')[_0xacb6('0x26')](_0x144707,_0x55e9c9);}});}});case'contact':var _0x2025be=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4['additionalSearchContact']){var _0x1c1889={};_0x1c1889[_0x5a09e4['additionalSearchContact']]=_0xf677d2;_[_0xacb6('0x33')](_0x2025be[_0xacb6('0x34')],_0x1c1889);}return _0x2e4360[_0xacb6('0x22')](_0xacb6('0x35'))['find'](_0x2025be,_0x55e9c9)[_0xacb6('0x27')]();case _0xacb6('0x16'):var _0x15c153=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4[_0xacb6('0x36')]){var _0x1c1889={};_0x1c1889[_0x5a09e4[_0xacb6('0x36')]]=_0xf677d2;_[_0xacb6('0x33')](_0x15c153[_0xacb6('0x34')],_0x1c1889);}return _0x2e4360[_0xacb6('0x22')]('Lead')[_0xacb6('0x26')](_0x15c153,_0x55e9c9);case _0xacb6('0x19'):var _0x162ca4=_[_0xacb6('0x39')](_0x239ee3);if(_0x5a09e4['additionalSearchAccount']){var _0x1c1889={};_0x1c1889[_0x5a09e4['additionalSearchAccount']]=_0xf677d2;_[_0xacb6('0x33')](_0x162ca4[_0xacb6('0x34')],_0x1c1889);}return _0x2e4360[_0xacb6('0x22')](_0xacb6('0x3b'))['find'](_0x162ca4,_0x55e9c9);default:return null;}})[_0xacb6('0x2b')](function(_0x110553){if(_0x110553&&_0x110553['length']){var _0x174908=_['first'](_0x110553);if(_0x174908){return BPromise[_0xacb6('0x2c')]({'id':_0x174908['Id'],'name':_0x174908[_0xacb6('0x2a')],'phone':_0x174908[_0xacb6('0x3d')],'endUserType':_0x174908[_0xacb6('0x3e')][_0xacb6('0x3f')]['toLowerCase']()});}}})[_0xacb6('0x2b')](function(_0x5da05d){if(_0x5da05d){logger[_0xacb6('0x20')](_0xacb6('0x40'),_0x5da05d[_0xacb6('0x18')],_0xf677d2);return BPromise['resolve'](_0x5da05d);}else{logger[_0xacb6('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0xf677d2);var _0xed222={'Phone':_0xf677d2};if(_0x5a09e4[_0xacb6('0x41')]){if(_0x5a09e4[_0xacb6('0x41')]===_0xacb6('0x1c')){logger[_0xacb6('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf677d2,_0x5a09e4[_0xacb6('0x41')]);_0xed222['LastName']=_0x18213f!==_0xacb6('0x42')?_0x18213f:util[_0xacb6('0x43')]('Caller\x20-\x20%s',_0xf677d2);}else if(_0x5a09e4[_0xacb6('0x41')]===_0xacb6('0x16')){logger[_0xacb6('0x20')](_0xacb6('0x44'),_0xf677d2,_0x5a09e4[_0xacb6('0x41')]);_0xed222[_0xacb6('0x45')]=_0x18213f!==_0xacb6('0x42')?_0x18213f:util[_0xacb6('0x43')](_0xacb6('0x46'),_0xf677d2);_0xed222[_0xacb6('0x47')]=_0xacb6('0x48');}else if(_0x5a09e4[_0xacb6('0x41')]==='account'){logger[_0xacb6('0x20')](_0xacb6('0x44'),_0xf677d2,_0x5a09e4[_0xacb6('0x41')]);_0xed222[_0xacb6('0x2a')]=_0x18213f!==_0xacb6('0x42')?_0x18213f:util[_0xacb6('0x43')](_0xacb6('0x46'),_0xf677d2);}else{return null;}}return _0x2e4360[_0xacb6('0x22')](_[_0xacb6('0x49')](_0x5a09e4[_0xacb6('0x41')]))['create'](_0xed222)[_0xacb6('0x2b')](function(_0x4adbf0){return BPromise[_0xacb6('0x2c')]({'id':_0x4adbf0['id'],'endUserType':_0x5a09e4[_0xacb6('0x41')]});});}});}function getCustomFields(_0x2a1356,_0x62c3ee){var _0x2c97bb={};if(_0x2a1356['length']>0x0){_['forEach'](_0x2a1356,function(_0x3aaabb){if(_[_0xacb6('0x4a')]([_0xacb6('0x4b'),'picklist'],_0x3aaabb[_0xacb6('0x3f')])&&_0x3aaabb['idField']){_0x2c97bb[_0x3aaabb[_0xacb6('0x4c')]]=_0x3aaabb[_0xacb6('0x4d')][_0xacb6('0x4e')]();}else if(_0x3aaabb[_0xacb6('0x3f')]==='variable'&&_0x3aaabb[_0xacb6('0x4f')]&&_0x3aaabb['idField']){_0x62c3ee[_0x3aaabb['variableName']]&&(_0x2c97bb[_0x3aaabb[_0xacb6('0x4c')]]=_0x62c3ee[_0x3aaabb['variableName']]['toString']());}else if(_0x3aaabb[_0xacb6('0x3f')]===_0xacb6('0x50')&&_0x3aaabb[_0xacb6('0x51')]&&_0x3aaabb['Variable'][_0xacb6('0x52')]&&_0x3aaabb['idField']){_0x62c3ee[_0x3aaabb['Variable'][_0xacb6('0x52')][_0xacb6('0x53')]()]&&(_0x2c97bb[_0x3aaabb[_0xacb6('0x4c')]]=_0x62c3ee[_0x3aaabb[_0xacb6('0x51')]['name'][_0xacb6('0x53')]()][_0xacb6('0x4e')]());}});}return _0x2c97bb;}function getConnection(_0x43674d){var _0x2b9b39=_0x43674d['password'][_0xacb6('0x54')](_0x43674d['securityToken']);var _0xaf50cc=new jsforce['Connection']({'oauth2':{'loginUrl':_0x43674d[_0xacb6('0x55')]||_0xacb6('0x56'),'clientId':_0x43674d[_0xacb6('0x57')],'clientSecret':_0x43674d[_0xacb6('0x58')]}});return _0xaf50cc['login'](_0x43674d['username'],_0x2b9b39)[_0xacb6('0x2b')](function(){logger['info'](_0xacb6('0x59'));return _0xaf50cc;});}exports[_0xacb6('0x5a')]=function(_0x32647f,_0x4c73a1,_0xfe97e,_0x2b9207,_0xdfeccf,_0xbe1bd1){var _0x185184,_0x4f6cbf,_0x50769e,_0x19ebf9;_0xbe1bd1[_0xacb6('0x5b')]=intUtil[_0xacb6('0x5c')](_0xbe1bd1['serverUrl']);_0xbe1bd1[_0xacb6('0x55')]=intUtil['stripTrailingSlash'](_0xbe1bd1[_0xacb6('0x55')]);if(_0xdfeccf&&_0xdfeccf['monitor_format']){logger[_0xacb6('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4c73a1[_0xacb6('0x5d')]=util[_0xacb6('0x43')](_0xacb6('0x5e'),_0xbe1bd1[_0xacb6('0x5b')],_0x4c73a1[_0xacb6('0x5f')],md5(_0x4c73a1[_0xacb6('0x5f')]));}else{_0x4c73a1['recordingURL']='';}return getConnection(_0xbe1bd1)[_0xacb6('0x2b')](function(_0xd10461){_0x19ebf9=_0xd10461;return getUser(_0xbe1bd1,_0x2b9207['email'],_0x19ebf9);})[_0xacb6('0x2b')](function(_0xc988b2){_0x185184=_0xc988b2;return getEndUser(_0xbe1bd1,_0xfe97e,_0x4c73a1[_0xacb6('0x60')],_0x4c73a1['calleridnum'],_0x19ebf9);})[_0xacb6('0x2b')](function(_0x2fc0d8){_0x4f6cbf=_0x2fc0d8;return getTicket(_0xbe1bd1,_0x185184,_0x4f6cbf,_0xfe97e,_0x4c73a1,_0xfe97e['Fields'],_0x19ebf9,_0xacb6('0x5a'));})['then'](function(_0x9512cf){_0x50769e=_0x9512cf;logger[_0xacb6('0x20')](_0xacb6('0x61'),_0x50769e['id']);logger[_0xacb6('0x20')](_0xacb6('0x62'),_0x50769e['id'],_0x2b9207[_0xacb6('0x52')],_0xbe1bd1[_0xacb6('0x3f')]);switch(_0xbe1bd1[_0xacb6('0x3f')]){case _0xacb6('0x63'):emit(util[_0xacb6('0x43')](_0xacb6('0x64'),_0x2b9207[_0xacb6('0x52')]),_0xacb6('0x65'),{'recordId':_0x50769e['id']});break;case'newTab':emit(util[_0xacb6('0x43')](_0xacb6('0x64'),_0x2b9207[_0xacb6('0x52')]),_0xacb6('0x66'),{'uri':util[_0xacb6('0x43')](_0xacb6('0x67'),_0x19ebf9[_0xacb6('0x68')],_0x50769e['id'])});break;default:logger[_0xacb6('0x69')](_0xacb6('0x6a'));}})['catch'](function(_0x1b290a){logger[_0xacb6('0x69')](_0xacb6('0x6b'),_0x1b290a);});};exports[_0xacb6('0x6c')]=function(_0x33ce32,_0x136c7c,_0x38a05f,_0x3425a7,_0x1b12d2,_0x34d97d,_0x53c173){var _0x56f3a8,_0x549675,_0x15f2cf,_0x5f4e14;_0x34d97d[_0xacb6('0x5b')]=intUtil[_0xacb6('0x5c')](_0x34d97d[_0xacb6('0x5b')]);_0x34d97d[_0xacb6('0x55')]=intUtil['stripTrailingSlash'](_0x34d97d[_0xacb6('0x55')]);if(_0x53c173&&_0x53c173['recordingFormat']&&_0x53c173[_0xacb6('0x6d')]!==_0xacb6('0x6e')){logger[_0xacb6('0x20')](_0xacb6('0x6f'),'Recording\x20is\x20enabled!');_0x136c7c['recordingURL']=util['format'](_0xacb6('0x5e'),_0x34d97d[_0xacb6('0x5b')],_0x136c7c[_0xacb6('0x5f')],md5(_0x136c7c[_0xacb6('0x5f')]));}return getConnection(_0x34d97d)['then'](function(_0x206bc8){_0x5f4e14=_0x206bc8;return getUser(_0x34d97d,_0x3425a7['email'],_0x5f4e14);})[_0xacb6('0x2b')](function(_0x1fe5a6){_0x56f3a8=_0x1fe5a6;return getEndUser(_0x34d97d,_0x38a05f,_0x136c7c[_0xacb6('0x70')],_0x136c7c['destcalleridnum'],_0x5f4e14);})[_0xacb6('0x2b')](function(_0x5b308c){_0x549675=_0x5b308c;return getTicket(_0x34d97d,_0x56f3a8,_0x549675,_0x38a05f,_0x136c7c,_0x38a05f[_0xacb6('0x71')],_0x5f4e14,_0xacb6('0x6c'));})[_0xacb6('0x2b')](function(_0x5e57f2){_0x15f2cf=_0x5e57f2;logger[_0xacb6('0x20')](_0xacb6('0x72'),_0x15f2cf['id']);logger[_0xacb6('0x20')](_0xacb6('0x73'),_0x15f2cf['id'],_0x3425a7[_0xacb6('0x52')],_0x34d97d[_0xacb6('0x3f')]);switch(_0x34d97d[_0xacb6('0x3f')]){case'integrationTab':emit(util[_0xacb6('0x43')]('user:%s',_0x3425a7[_0xacb6('0x52')]),'trigger:salesforce:display',{'recordId':_0x15f2cf['id']});break;case _0xacb6('0x74'):emit(util[_0xacb6('0x43')](_0xacb6('0x64'),_0x3425a7['name']),_0xacb6('0x66'),{'uri':util[_0xacb6('0x43')](_0xacb6('0x67'),_0x5f4e14[_0xacb6('0x68')],_0x15f2cf['id'])});break;default:logger[_0xacb6('0x69')](_0xacb6('0x6f'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x129bab){logger[_0xacb6('0x69')]('[OUTBOUND]',_0x129bab);});};exports[_0xacb6('0x75')]=function(_0x3b27b4,_0x5d79ec,_0x1984a4,_0x3428f1,_0x49eb6a,_0x11426e){var _0x4ab307,_0xdbe556,_0x1f1630,_0x2b5a14;_0x11426e['serverUrl']=intUtil[_0xacb6('0x5c')](_0x11426e[_0xacb6('0x5b')]);_0x11426e[_0xacb6('0x55')]=intUtil[_0xacb6('0x5c')](_0x11426e['remoteUri']);if(_0x49eb6a&&_0x49eb6a[_0xacb6('0x76')]){logger[_0xacb6('0x20')]('['+_0x5d79ec[_0xacb6('0x77')][_0xacb6('0x78')]()+']',_0xacb6('0x79'));_0x5d79ec[_0xacb6('0x5d')]=util[_0xacb6('0x43')](_0xacb6('0x5e'),_0x11426e[_0xacb6('0x5b')],_0x5d79ec[_0xacb6('0x5f')],md5(_0x5d79ec[_0xacb6('0x5f')]));}else{_0x5d79ec[_0xacb6('0x5d')]='';}return getConnection(_0x11426e)[_0xacb6('0x2b')](function(_0x4f43ab){_0x2b5a14=_0x4f43ab;if(!_[_0xacb6('0x23')](_0x3428f1)){return getUser(_0x11426e,_0x3428f1[_0xacb6('0x52')],_0x2b5a14);}else{return getUser(_0x11426e,null,_0x2b5a14);}})[_0xacb6('0x2b')](function(_0x4b7e1f){_0x4ab307=_0x4b7e1f;return getEndUser(_0x11426e,_0x1984a4,_0x5d79ec['calleridname'],_0x5d79ec[_0xacb6('0x7a')],_0x2b5a14);})[_0xacb6('0x2b')](function(_0x139bfe){_0xdbe556=_0x139bfe;return getTicket(_0x11426e,_0x4ab307,_0xdbe556,_0x1984a4,_0x5d79ec,_0x1984a4[_0xacb6('0x71')],_0x2b5a14);})[_0xacb6('0x2b')](function(_0x1693ac){_0x1f1630=_0x1693ac;logger[_0xacb6('0x20')]('['+_0x5d79ec[_0xacb6('0x77')]['toUpperCase']()+_0xacb6('0x7b'),_0x1f1630['id']);logger['info']('['+_0x5d79ec[_0xacb6('0x77')]['toUpperCase']()+_0xacb6('0x7c'),_0x11426e[_0xacb6('0x3f')]);})[_0xacb6('0x7d')](function(_0x1bf38e){logger['error']('['+_0x5d79ec['lastevent'][_0xacb6('0x78')]()+']',_0x1bf38e);});}; \ 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 d2b27ce..69d4ce0 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 _0xa5fa=['endUserNumber','user','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','nameField','customField','content','toString','string','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','serverUrl','format','%s/api/now/table/','isNil','email','outbound','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','./util','../../../../config/environment','redis','defaults','socket.io-emitter','GET','then','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','length','active','true','userId','sys_id','adminEmail','catch',']\x20using\x20admin\x20profile','POST','sys_user?'];(function(_0xb78f74,_0x2548d1){var _0x465eb1=function(_0x590567){while(--_0x590567){_0xb78f74['push'](_0xb78f74['shift']());}};_0x465eb1(++_0x2548d1);}(_0xa5fa,0x188));var _0xaa5f=function(_0x47370b,_0x1c12e8){_0x47370b=_0x47370b-0x0;var _0x43e3e2=_0xa5fa[_0x47370b];return _0x43e3e2;};'use strict';var _=require(_0xaa5f('0x0'));var Promise=require(_0xaa5f('0x1'));var rp=require(_0xaa5f('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0xaa5f('0x3'));var intUtil=require(_0xaa5f('0x4'));var config=require(_0xaa5f('0x5'));var logger=require('../../../../config/logger')('servicenow');config[_0xaa5f('0x6')]=_[_0xaa5f('0x7')](config[_0xaa5f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xaa5f('0x8'))(new Redis(config['redis']));function getAdminUser(_0x45d67c,_0x35bcf8,_0x3982bf,_0xacd0d0,_0x227fd1,_0x250bca){return new Promise(function(_0x3444cb,_0x3142c5){var _0x582ea9={'method':_0xaa5f('0x9'),'uri':_0xacd0d0+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x227fd1+'&'+_0x250bca,'auth':_0x35bcf8,'json':!![]};return rp(_0x582ea9)[_0xaa5f('0xa')](function(_0x880203){if(_0x880203[_0xaa5f('0xb')]['length']>0x0){_0x3982bf[_0xaa5f('0xc')]=_0x880203['result'][0x0]['sys_id'];}logger[_0xaa5f('0xd')]('['+[_0x45d67c[_0xaa5f('0xe')]()]+_0xaa5f('0xf'),_0x3982bf);_0x3444cb(_0x3982bf);})['catch'](function(_0x1d5968){logger[_0xaa5f('0x10')]('['+[_0x45d67c[_0xaa5f('0xe')]()]+']',_0x1d5968[_0xaa5f('0x11')]);_0x3142c5(_0x1d5968[_0xaa5f('0x11')]);});});}function getUser(_0x20bd90,_0x46269f,_0x1f0eed,_0x3de2be,_0x4bcd48){return function(_0x4712bd){logger[_0xaa5f('0xd')]('['+[_0x20bd90[_0xaa5f('0xe')]()]+_0xaa5f('0x12'),_0x4712bd);return new Promise(function(_0x2e5ed1,_0x51df2d){if(intUtil[_0xaa5f('0x13')](_0x4712bd[_0xaa5f('0x14')])){var _0x7c0ae8={'method':_0xaa5f('0x9'),'uri':_0x1f0eed+_0xaa5f('0x15')+_0x4712bd[_0xaa5f('0x14')]+'&'+_0x3de2be+'&'+_0x4bcd48,'auth':_0x46269f,'json':!![]};logger[_0xaa5f('0xd')]('['+[_0x20bd90[_0xaa5f('0xe')]()]+'],\x20getUser\x20rp\x20obj',_0x7c0ae8);return rp(_0x7c0ae8)['then'](function(_0x57d846){logger['info']('['+[_0x20bd90['toUpperCase']()]+'],\x20getUser\x20entity',_0x57d846);if(_0x57d846[_0xaa5f('0xb')][_0xaa5f('0x16')]>0x0&&String(_0x57d846[_0xaa5f('0xb')][0x0][_0xaa5f('0x17')])===_0xaa5f('0x18')){_0x4712bd[_0xaa5f('0x19')]=_0x57d846[_0xaa5f('0xb')][0x0][_0xaa5f('0x1a')];}else{_0x4712bd[_0xaa5f('0x19')]=_0x4712bd[_0xaa5f('0xc')];_0x4712bd[_0xaa5f('0x14')]=_0x4712bd[_0xaa5f('0x1b')];}logger['info']('['+[_0x20bd90['toUpperCase']()]+'],\x20getUser\x20crm',_0x4712bd);_0x2e5ed1(_0x4712bd);})[_0xaa5f('0x1c')](function(_0x5c49d8){logger[_0xaa5f('0x10')]('['+[_0x20bd90[_0xaa5f('0xe')]()]+']',_0x5c49d8[_0xaa5f('0x11')]);_0x51df2d(_0x5c49d8[_0xaa5f('0x11')]);});}else{logger[_0xaa5f('0xd')]('['+[_0x20bd90['toUpperCase']()]+_0xaa5f('0x1d'));_0x4712bd['userId']=_0x4712bd[_0xaa5f('0xc')];_0x4712bd[_0xaa5f('0x14')]=_0x4712bd[_0xaa5f('0x1b')];_0x2e5ed1(_0x4712bd);}});};}function createEndUser(_0x3ffd6b,_0x2d7736,_0x1b498f,_0x110686,_0x3dd1b3){logger['info']('['+[_0x3ffd6b[_0xaa5f('0xe')]()]+'],\x20createEndUser\x20input\x20crm',_0x1b498f);return new Promise(function(_0x5332e9,_0x3a780d){var _0xc10929={'method':_0xaa5f('0x1e'),'uri':_0x110686+_0xaa5f('0x1f')+_0x3dd1b3,'body':{'user_name':_0x1b498f[_0xaa5f('0x20')],'roles':_0xaa5f('0x21'),'first_name':_0x1b498f[_0xaa5f('0x20')],'active':_0xaa5f('0x18'),'date_format':_0xaa5f('0x22'),'phone':_0x1b498f['endUserNumber']},'auth':_0x2d7736,'json':!![]};return rp(_0xc10929)[_0xaa5f('0xa')](function(_0x1ccb94){logger[_0xaa5f('0xd')]('['+[_0x3ffd6b['toUpperCase']()]+_0xaa5f('0x23'),_0x1ccb94[_0xaa5f('0xb')]);_0x1b498f['endUserId']=_0x1ccb94[_0xaa5f('0xb')][_0xaa5f('0x1a')];_0x5332e9(_0x1b498f);})[_0xaa5f('0x1c')](function(_0x44150d){logger[_0xaa5f('0x10')]('['+[_0x3ffd6b[_0xaa5f('0xe')]()]+']',_0x44150d['message']);_0x3a780d(_0x44150d[_0xaa5f('0x11')]);});});}function getEndUser(_0x8b6387,_0x270a43,_0x35425e,_0x3b9411,_0x477732){return function(_0x359bf5){logger['info']('['+[_0x8b6387[_0xaa5f('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x359bf5);return new Promise(function(_0x4e4d65,_0x4a1df1){var _0x2b9e00={'method':_0xaa5f('0x9'),'uri':_0x35425e+_0xaa5f('0x24')+_0x359bf5['endUserNumber']+'&'+_0x3b9411+'&'+_0x477732,'auth':_0x270a43,'json':!![]};return rp(_0x2b9e00)[_0xaa5f('0xa')](function(_0x2817f8){if(_0x2817f8[_0xaa5f('0xb')][_0xaa5f('0x16')]>0x0){_0x359bf5[_0xaa5f('0x25')]=_0x2817f8[_0xaa5f('0xb')][0x0][_0xaa5f('0x1a')];logger[_0xaa5f('0xd')]('['+[_0x8b6387[_0xaa5f('0xe')]()]+_0xaa5f('0x26'),_0x359bf5);_0x4e4d65(_0x359bf5);}else{return createEndUser(_0x8b6387,_0x270a43,_0x359bf5,_0x35425e,_0x3b9411)[_0xaa5f('0xa')](function(_0x3ebde2){logger['info']('['+[_0x8b6387[_0xaa5f('0xe')]()]+_0xaa5f('0x27'),_0x3ebde2);_0x4e4d65(_0x3ebde2);});}})[_0xaa5f('0x1c')](function(_0x3c5d7a){logger['error']('['+[_0x8b6387[_0xaa5f('0xe')]()]+']',_0x3c5d7a[_0xaa5f('0x11')]);_0x4a1df1(_0x3c5d7a['message']);});});};}function getCustomFields(_0x46cf03,_0x28cbac){var _0x5d439d={};if(_0x46cf03[_0xaa5f('0x16')]>0x0){_[_0xaa5f('0x28')](_0x46cf03,function(_0x115d7f){if(_['includes'](['string',_0xaa5f('0x29')],_0x115d7f[_0xaa5f('0x2a')])&&_0x115d7f[_0xaa5f('0x2b')]&&!_0x115d7f[_0xaa5f('0x2c')]){_0x5d439d[_0x115d7f[_0xaa5f('0x2b')]['toLowerCase']()]=_0x115d7f[_0xaa5f('0x2d')][_0xaa5f('0x2e')]();}else if(_['includes']([_0xaa5f('0x2f'),_0xaa5f('0x29')],_0x115d7f[_0xaa5f('0x2a')])&&_0x115d7f[_0xaa5f('0x30')]&&_0x115d7f[_0xaa5f('0x2c')]){_0x5d439d[_0x115d7f[_0xaa5f('0x30')][_0xaa5f('0x31')]()]=_0x115d7f[_0xaa5f('0x2d')][_0xaa5f('0x2e')]();}else if(_0x115d7f['type']===_0xaa5f('0x32')&&_0x115d7f[_0xaa5f('0x33')]&&_0x115d7f[_0xaa5f('0x30')]&&_0x115d7f[_0xaa5f('0x2c')]){_0x5d439d[_0x115d7f['idField']['toLowerCase']()]=_0x28cbac[_0x115d7f[_0xaa5f('0x33')]][_0xaa5f('0x2e')]();}else if(_0x115d7f['type']===_0xaa5f('0x34')&&_0x115d7f[_0xaa5f('0x35')]&&_0x115d7f[_0xaa5f('0x35')]['name']&&_0x115d7f['idField']&&_0x115d7f['customField']){_0x5d439d[_0x115d7f[_0xaa5f('0x30')][_0xaa5f('0x31')]()]=_0x28cbac[_0x115d7f['Variable'][_0xaa5f('0x36')]['toLowerCase']()][_0xaa5f('0x2e')]();}});}return _0x5d439d;}function getTicket(_0x17e642,_0x250c9e,_0x298d6a,_0xf988bb,_0x4854af,_0x3113be){return function(_0x5c8c12){logger[_0xaa5f('0xd')]('['+[_0x17e642[_0xaa5f('0xe')]()]+_0xaa5f('0x37'),_0x5c8c12);return new Promise(function(_0x349ed6,_0x5c399c){var _0x322f42=_0x17e642['toLowerCase']()==='outbound'?_0x5c8c12[_0xaa5f('0x19')]:_0x5c8c12[_0xaa5f('0x25')];var _0x20c220={'method':_0xaa5f('0x1e'),'uri':_0x298d6a+_0xaa5f('0x38')+'?'+_0x3113be,'body':Object[_0xaa5f('0x39')]({},{'active':_0xaa5f('0x18'),'caller_id':_0x322f42,'assigned_to':_0x5c8c12[_0xaa5f('0x19')],'short_description':intUtil[_0xaa5f('0x3a')](_0xf988bb[_0xaa5f('0x3b')],_0x4854af,'\x20'),'description':intUtil[_0xaa5f('0x3a')](_0xf988bb[_0xaa5f('0x3c')],_0x4854af,'\x0a')},getCustomFields(_0xf988bb[_0xaa5f('0x3d')],_0x4854af)),'auth':_0x250c9e,'json':!![]};return rp(_0x20c220)[_0xaa5f('0xa')](function(_0x4d9496){logger[_0xaa5f('0xd')]('['+[_0x17e642[_0xaa5f('0xe')]()]+_0xaa5f('0x3e'),_0x4d9496[_0xaa5f('0xb')]);_0x5c8c12[_0xaa5f('0x3f')]=_0x4d9496[_0xaa5f('0xb')]['sys_id'];_0x5c8c12['ticketNumber']=_0x4d9496[_0xaa5f('0xb')][_0xaa5f('0x40')];logger[_0xaa5f('0xd')]('['+[_0x17e642['toUpperCase']()]+_0xaa5f('0x41'),_0x5c8c12);_0x349ed6(_0x5c8c12);})[_0xaa5f('0x1c')](function(_0xe93f5c){logger[_0xaa5f('0x10')]('['+[_0x17e642[_0xaa5f('0xe')]()]+']',_0xe93f5c[_0xaa5f('0x11')]);_0x5c399c(_0xe93f5c[_0xaa5f('0x11')]);});});};}function createRemoteTag(_0x5ba580,_0x4d72e3,_0x47c725,_0x492a99){return new Promise(function(_0x52a3eb,_0x5d0096){var _0x3df80f={'method':_0xaa5f('0x1e'),'uri':_0x47c725+_0xaa5f('0x42')+'?'+_0x492a99,'body':{'short_description':_0x5ba580,'global':!![],'active':!![],'name':_0x5ba580},'auth':_0x4d72e3,'json':!![]};return rp(_0x3df80f)[_0xaa5f('0xa')](function(_0x34c3a1){var _0x11d9ba=_0x34c3a1[_0xaa5f('0xb')][_0xaa5f('0x1a')];_0x52a3eb(_0x11d9ba);});});}function getRemoteTag(_0x1647b6,_0x1b6861,_0x355c37,_0x2845d0,_0x1dd34d){return new Promise(function(_0x2fb231,_0x2dc297){var _0x4c8198={'method':_0xaa5f('0x9'),'uri':_0x355c37+_0xaa5f('0x42')+'?sysparm_query=name%3D'+_0x1647b6+'&'+_0x2845d0,'auth':_0x1b6861,'json':!![]};return rp(_0x4c8198)[_0xaa5f('0xa')](function(_0x45f3a4){if(_0x45f3a4[_0xaa5f('0xb')][_0xaa5f('0x16')]>0x0){var _0x4b1429=_0x45f3a4['result'][0x0]['sys_id'];_0x2fb231(_0x4b1429);}else{return createRemoteTag(_0x1647b6,_0x1b6861,_0x355c37,_0x2845d0)[_0xaa5f('0xa')](function(_0x657019){_0x2fb231(_0x657019);});}});});}function assignTagToIncident(_0x5389e5,_0x17e89e,_0x59c950,_0x70741a,_0x513c6c){return new Promise(function(_0x5d0b0e,_0x3fc275){var _0x3adbe2={'method':_0xaa5f('0x1e'),'uri':_0x59c950+_0xaa5f('0x43')+'?'+_0x513c6c,'body':{'label':_0x5389e5,'table':_0xaa5f('0x38'),'id_type':_0xaa5f('0x44'),'table_key':_0x70741a[_0xaa5f('0x3f')],'title':'Incident\x20-\x20'+_0x70741a['ticketNumber'],'id_display':_0x70741a[_0xaa5f('0x45')]},'auth':_0x17e89e,'json':!![]};return rp(_0x3adbe2)[_0xaa5f('0xa')](function(_0xef0a43){_0x5d0b0e();})[_0xaa5f('0x1c')](function(){_0x5d0b0e();});});}function manageTags(_0x5411dd,_0x3fd5e7,_0x48cbce,_0x392c54,_0xb6cbe8,_0x4ae9d3,_0x11b801){return new Promise(function(_0x8c3338,_0x1ac469){var _0x3b70cf=[];_0x3fd5e7[_0xaa5f('0x28')](function(_0x44e654){_0x3b70cf[_0xaa5f('0x46')](getRemoteTag(_0x44e654,_0x48cbce,_0x392c54,_0x4ae9d3,_0x11b801));});return Promise[_0xaa5f('0x47')](_0x3b70cf)[_0xaa5f('0xa')](function(_0x1c9a54){if(_0x1c9a54[_0xaa5f('0x16')]){logger[_0xaa5f('0xd')]('['+[_0x5411dd[_0xaa5f('0xe')]()]+_0xaa5f('0x48'),_0x1c9a54);var _0x51f40d=[];_0x1c9a54[_0xaa5f('0x28')](function(_0x1db2ee){_0x51f40d[_0xaa5f('0x46')](assignTagToIncident(_0x1db2ee,_0x48cbce,_0x392c54,_0xb6cbe8,_0x4ae9d3));});return Promise[_0xaa5f('0x47')](_0x51f40d)[_0xaa5f('0xa')](function(){_0x8c3338();})[_0xaa5f('0x1c')](function(){_0x8c3338();});}else{_0x8c3338();}});});}function getTags(_0x57ffc3,_0x51ef84,_0x348db3,_0x253ff8,_0x31d060,_0x274aeb){return function(_0x327ef7){return new Promise(function(_0x475abb,_0x3c1362){var _0x29ded5=[];var _0x343617=_0x253ff8[_0xaa5f('0x49')];if(_0x343617&&_0x343617[_0xaa5f('0x16')]>0x0){_0x29ded5=_[_0xaa5f('0x4a')](_0x343617,'name');}if(_0x29ded5[_0xaa5f('0x16')]>0x0){return manageTags(_0x57ffc3,_0x29ded5,_0x51ef84,_0x348db3,_0x327ef7,_0x31d060,_0x274aeb)[_0xaa5f('0xa')](function(){_0x475abb(_0x327ef7);});}else{_0x475abb(_0x327ef7);}});};}function emit(_0x3c4dbc,_0x42c462,_0x5901c6){var _0x3fee26=_0xaa5f('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xaa5f('0x4c')+_0xaa5f('0x4d');var _0x6b66c5={'uri':_0x3c4dbc+_0xaa5f('0x4e')+_0x5901c6+_0x3fee26};io['to'](util['format'](_0xaa5f('0x4f'),_0x42c462))[_0xaa5f('0x50')](_0xaa5f('0x51'),_0x6b66c5);}exports['cs']=function(_0x1424bd,_0xc82455,_0x599b9c,_0x4a4940,_0x3893eb,_0x5bdcba,_0x3313ba,_0x465f50){var _0x4761af={};var _0x59eb11={'user':_0x5bdcba['username'],'pass':_0x5bdcba[_0xaa5f('0x52')]};var _0x4de266=_0xaa5f('0x53');var _0x1d7c5c='sysparm_display_value=true';_0x5bdcba[_0xaa5f('0x54')]=intUtil['stripTrailingSlash'](_0x5bdcba[_0xaa5f('0x54')]);_0x5bdcba[_0xaa5f('0x55')]=intUtil['stripTrailingSlash'](_0x5bdcba[_0xaa5f('0x55')]);var _0x1a2c3d=util[_0xaa5f('0x56')](_0xaa5f('0x57'),_0x5bdcba[_0xaa5f('0x54')]);_0x4761af['userEmail']=!_[_0xaa5f('0x58')](_0x4a4940)?_0x4a4940[_0xaa5f('0x59')]:null;_0x4761af[_0xaa5f('0x1b')]=_0x5bdcba['email'];_0x4761af['endUserNumber']=_0x465f50[_0xaa5f('0x31')]()===_0xaa5f('0x5a')?_0xc82455['destcalleridnum']:_0xc82455[_0xaa5f('0x5b')];_0x4761af['callDirection']=_0x465f50===_0xaa5f('0x5c')||_0x465f50===_0xaa5f('0x5d')?_0xaa5f('0x5c'):_0xaa5f('0x5a');var _0x19e560=util[_0xaa5f('0x56')](_0xaa5f('0x5e'),_0x5bdcba[_0xaa5f('0x55')],_0xc82455[_0xaa5f('0x5f')],md5(_0xc82455[_0xaa5f('0x5f')]));if(_0x3893eb&&_0x3893eb[_0xaa5f('0x60')]){logger[_0xaa5f('0xd')](_0xaa5f('0x61'),_0xaa5f('0x62'));_0xc82455[_0xaa5f('0x63')]=_0x19e560;}else if(_0x3313ba&&_0x3313ba[_0xaa5f('0x64')]&&_0x3313ba['recordingFormat']!==_0xaa5f('0x65')){logger[_0xaa5f('0xd')](_0xaa5f('0x66'),_0xaa5f('0x62'));_0xc82455[_0xaa5f('0x63')]=_0x19e560;}else{_0xc82455[_0xaa5f('0x63')]='';}return getAdminUser(_0x465f50,_0x59eb11,_0x4761af,_0x1a2c3d,_0x1d7c5c,_0x4de266)[_0xaa5f('0xa')](getUser(_0x465f50,_0x59eb11,_0x1a2c3d,_0x1d7c5c,_0x4de266))[_0xaa5f('0xa')](getEndUser(_0x465f50,_0x59eb11,_0x1a2c3d,_0x1d7c5c,_0x4de266))['then'](getTicket(_0x465f50,_0x59eb11,_0x1a2c3d,_0x599b9c,_0xc82455,_0x1d7c5c))[_0xaa5f('0xa')](function(_0xd718e6){logger['info'](util[_0xaa5f('0x56')](_0xaa5f('0x67'),_0xd718e6[_0xaa5f('0x3f')]));logger[_0xaa5f('0xd')](util[_0xaa5f('0x56')]('call\x20direction:\x20%s',_0x465f50));if(_0x465f50!==_0xaa5f('0x5d')){logger[_0xaa5f('0xd')]('['+[_0x465f50[_0xaa5f('0xe')]()]+']',_0xaa5f('0x68'));emit(_0x5bdcba[_0xaa5f('0x54')],_0x4a4940[_0xaa5f('0x36')],_0xd718e6[_0xaa5f('0x3f')]);}})[_0xaa5f('0x1c')](function(_0x2f02ec){logger[_0xaa5f('0x10')]('['+[_0x465f50['toUpperCase']()]+_0xaa5f('0x69'),util['inspect'](_0x2f02ec,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4063=['none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','then','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','true','sys_id','userId','adminEmail','error',']\x20using\x20admin\x20profile','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','GET','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toString','toLowerCase','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat'];(function(_0x46599d,_0x335ded){var _0x2e111a=function(_0x3530c4){while(--_0x3530c4){_0x46599d['push'](_0x46599d['shift']());}};_0x2e111a(++_0x335ded);}(_0x4063,0x6a));var _0x3406=function(_0x274057,_0x8e11c8){_0x274057=_0x274057-0x0;var _0x29fc37=_0x4063[_0x274057];return _0x29fc37;};'use strict';var _=require(_0x3406('0x0'));var Promise=require(_0x3406('0x1'));var rp=require(_0x3406('0x2'));var util=require(_0x3406('0x3'));var md5=require(_0x3406('0x4'));var Redis=require(_0x3406('0x5'));var intUtil=require(_0x3406('0x6'));var config=require(_0x3406('0x7'));var logger=require('../../../../config/logger')('servicenow');config[_0x3406('0x8')]=_[_0x3406('0x9')](config[_0x3406('0x8')],{'host':_0x3406('0xa'),'port':0x18eb});var io=require(_0x3406('0xb'))(new Redis(config['redis']));function getAdminUser(_0x4a4ccb,_0x468f37,_0x426ae2,_0x4e2348,_0x18afaf,_0x3dad30){return new Promise(function(_0x1d6466,_0x4b7901){var _0x31c70f={'method':'GET','uri':_0x4e2348+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x18afaf+'&'+_0x3dad30,'auth':_0x468f37,'json':!![]};return rp(_0x31c70f)[_0x3406('0xc')](function(_0x3a4bb7){if(_0x3a4bb7[_0x3406('0xd')][_0x3406('0xe')]>0x0){_0x426ae2[_0x3406('0xf')]=_0x3a4bb7[_0x3406('0xd')][0x0]['sys_id'];}logger['info']('['+[_0x4a4ccb[_0x3406('0x10')]()]+_0x3406('0x11'),_0x426ae2);_0x1d6466(_0x426ae2);})[_0x3406('0x12')](function(_0x29ccc5){logger['error']('['+[_0x4a4ccb[_0x3406('0x10')]()]+']',_0x29ccc5['message']);_0x4b7901(_0x29ccc5[_0x3406('0x13')]);});});}function getUser(_0x4d764c,_0x1fcae9,_0x172135,_0x40c8da,_0x347b8d){return function(_0x161fa4){logger[_0x3406('0x14')]('['+[_0x4d764c[_0x3406('0x10')]()]+_0x3406('0x15'),_0x161fa4);return new Promise(function(_0x66777,_0x288a4e){if(intUtil[_0x3406('0x16')](_0x161fa4[_0x3406('0x17')])){var _0x442697={'method':'GET','uri':_0x172135+_0x3406('0x18')+_0x161fa4['userEmail']+'&'+_0x40c8da+'&'+_0x347b8d,'auth':_0x1fcae9,'json':!![]};logger['info']('['+[_0x4d764c['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x442697);return rp(_0x442697)[_0x3406('0xc')](function(_0x108caf){logger[_0x3406('0x14')]('['+[_0x4d764c[_0x3406('0x10')]()]+'],\x20getUser\x20entity',_0x108caf);if(_0x108caf['result']['length']>0x0&&String(_0x108caf['result'][0x0][_0x3406('0x19')])===_0x3406('0x1a')){_0x161fa4['userId']=_0x108caf['result'][0x0][_0x3406('0x1b')];}else{_0x161fa4[_0x3406('0x1c')]=_0x161fa4[_0x3406('0xf')];_0x161fa4['userEmail']=_0x161fa4[_0x3406('0x1d')];}logger[_0x3406('0x14')]('['+[_0x4d764c[_0x3406('0x10')]()]+'],\x20getUser\x20crm',_0x161fa4);_0x66777(_0x161fa4);})[_0x3406('0x12')](function(_0x478635){logger[_0x3406('0x1e')]('['+[_0x4d764c[_0x3406('0x10')]()]+']',_0x478635['message']);_0x288a4e(_0x478635[_0x3406('0x13')]);});}else{logger[_0x3406('0x14')]('['+[_0x4d764c[_0x3406('0x10')]()]+_0x3406('0x1f'));_0x161fa4['userId']=_0x161fa4['adminId'];_0x161fa4['userEmail']=_0x161fa4[_0x3406('0x1d')];_0x66777(_0x161fa4);}});};}function createEndUser(_0x17d170,_0xb59966,_0x4f3b9e,_0x591c5a,_0x5d0958){logger['info']('['+[_0x17d170[_0x3406('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x4f3b9e);return new Promise(function(_0xf2ef0b,_0x244423){var _0x4f9c7f={'method':'POST','uri':_0x591c5a+'sys_user?'+_0x5d0958,'body':{'user_name':_0x4f3b9e[_0x3406('0x20')],'roles':'user','first_name':_0x4f3b9e['endUserNumber'],'active':'true','date_format':_0x3406('0x21'),'phone':_0x4f3b9e['endUserNumber']},'auth':_0xb59966,'json':!![]};return rp(_0x4f9c7f)[_0x3406('0xc')](function(_0x3d6d4){logger['info']('['+[_0x17d170[_0x3406('0x10')]()]+_0x3406('0x22'),_0x3d6d4['result']);_0x4f3b9e[_0x3406('0x23')]=_0x3d6d4['result'][_0x3406('0x1b')];_0xf2ef0b(_0x4f3b9e);})[_0x3406('0x12')](function(_0x2fcd18){logger['error']('['+[_0x17d170[_0x3406('0x10')]()]+']',_0x2fcd18[_0x3406('0x13')]);_0x244423(_0x2fcd18[_0x3406('0x13')]);});});}function getEndUser(_0x1d51ac,_0x269692,_0x24e810,_0x457a7e,_0x17b491){return function(_0x29e587){logger['info']('['+[_0x1d51ac[_0x3406('0x10')]()]+_0x3406('0x24'),_0x29e587);return new Promise(function(_0x252713,_0x466cce){var _0x52ca31={'method':_0x3406('0x25'),'uri':_0x24e810+_0x3406('0x26')+_0x29e587[_0x3406('0x20')]+'&'+_0x457a7e+'&'+_0x17b491,'auth':_0x269692,'json':!![]};return rp(_0x52ca31)[_0x3406('0xc')](function(_0xbca7b3){if(_0xbca7b3[_0x3406('0xd')][_0x3406('0xe')]>0x0){_0x29e587[_0x3406('0x23')]=_0xbca7b3[_0x3406('0xd')][0x0][_0x3406('0x1b')];logger[_0x3406('0x14')]('['+[_0x1d51ac[_0x3406('0x10')]()]+'],\x20getEndUser\x20crm',_0x29e587);_0x252713(_0x29e587);}else{return createEndUser(_0x1d51ac,_0x269692,_0x29e587,_0x24e810,_0x457a7e)[_0x3406('0xc')](function(_0x13f6a4){logger[_0x3406('0x14')]('['+[_0x1d51ac[_0x3406('0x10')]()]+_0x3406('0x27'),_0x13f6a4);_0x252713(_0x13f6a4);});}})['catch'](function(_0xdc13d6){logger[_0x3406('0x1e')]('['+[_0x1d51ac[_0x3406('0x10')]()]+']',_0xdc13d6[_0x3406('0x13')]);_0x466cce(_0xdc13d6[_0x3406('0x13')]);});});};}function getCustomFields(_0x46ace9,_0x35507a){var _0x3e9c61={};if(_0x46ace9['length']>0x0){_[_0x3406('0x28')](_0x46ace9,function(_0xaa9336){if(_[_0x3406('0x29')](['string',_0x3406('0x2a')],_0xaa9336[_0x3406('0x2b')])&&_0xaa9336[_0x3406('0x2c')]&&!_0xaa9336[_0x3406('0x2d')]){_0x3e9c61[_0xaa9336[_0x3406('0x2c')]['toLowerCase']()]=_0xaa9336['content'][_0x3406('0x2e')]();}else if(_['includes'](['string',_0x3406('0x2a')],_0xaa9336['type'])&&_0xaa9336['idField']&&_0xaa9336[_0x3406('0x2d')]){_0x3e9c61[_0xaa9336['idField'][_0x3406('0x2f')]()]=_0xaa9336['content'][_0x3406('0x2e')]();}else if(_0xaa9336[_0x3406('0x2b')]==='variable'&&_0xaa9336['variableName']&&_0xaa9336[_0x3406('0x30')]&&_0xaa9336[_0x3406('0x2d')]){_0x3e9c61[_0xaa9336[_0x3406('0x30')][_0x3406('0x2f')]()]=_0x35507a[_0xaa9336[_0x3406('0x31')]][_0x3406('0x2e')]();}else if(_0xaa9336['type']===_0x3406('0x32')&&_0xaa9336[_0x3406('0x33')]&&_0xaa9336[_0x3406('0x33')]['name']&&_0xaa9336[_0x3406('0x30')]&&_0xaa9336[_0x3406('0x2d')]){_0x3e9c61[_0xaa9336[_0x3406('0x30')][_0x3406('0x2f')]()]=_0x35507a[_0xaa9336[_0x3406('0x33')][_0x3406('0x34')]['toLowerCase']()]['toString']();}});}return _0x3e9c61;}function getTicket(_0x261063,_0xaa89d4,_0x3b5fb1,_0xde61c6,_0x270f28,_0xd86ff1){return function(_0x5bcace){logger['info']('['+[_0x261063[_0x3406('0x10')]()]+_0x3406('0x35'),_0x5bcace);return new Promise(function(_0x5350c0,_0x23856a){var _0x7fbc3c=_0x261063[_0x3406('0x2f')]()==='outbound'?_0x5bcace[_0x3406('0x1c')]:_0x5bcace[_0x3406('0x23')];var _0x2af080={'method':_0x3406('0x36'),'uri':_0x3b5fb1+_0x3406('0x37')+'?'+_0xd86ff1,'body':Object['assign']({},{'active':_0x3406('0x1a'),'caller_id':_0x7fbc3c,'assigned_to':_0x5bcace[_0x3406('0x1c')],'short_description':intUtil['getString'](_0xde61c6['Subjects'],_0x270f28,'\x20'),'description':intUtil['getString'](_0xde61c6['Descriptions'],_0x270f28,'\x0a')},getCustomFields(_0xde61c6[_0x3406('0x38')],_0x270f28)),'auth':_0xaa89d4,'json':!![]};return rp(_0x2af080)[_0x3406('0xc')](function(_0x3522dd){logger['info']('['+[_0x261063['toUpperCase']()]+_0x3406('0x39'),_0x3522dd[_0x3406('0xd')]);_0x5bcace[_0x3406('0x3a')]=_0x3522dd['result'][_0x3406('0x1b')];_0x5bcace[_0x3406('0x3b')]=_0x3522dd[_0x3406('0xd')][_0x3406('0x3c')];logger[_0x3406('0x14')]('['+[_0x261063[_0x3406('0x10')]()]+']\x20getTicket\x20crm',_0x5bcace);_0x5350c0(_0x5bcace);})[_0x3406('0x12')](function(_0x480e0a){logger['error']('['+[_0x261063[_0x3406('0x10')]()]+']',_0x480e0a[_0x3406('0x13')]);_0x23856a(_0x480e0a['message']);});});};}function createRemoteTag(_0x23d947,_0x1a3144,_0x2c7670,_0x3a9e56){return new Promise(function(_0x2b2e1d,_0x2bd3a5){var _0x44bda8={'method':_0x3406('0x36'),'uri':_0x2c7670+_0x3406('0x3d')+'?'+_0x3a9e56,'body':{'short_description':_0x23d947,'global':!![],'active':!![],'name':_0x23d947},'auth':_0x1a3144,'json':!![]};return rp(_0x44bda8)[_0x3406('0xc')](function(_0x285a6b){var _0x32c9fe=_0x285a6b[_0x3406('0xd')][_0x3406('0x1b')];_0x2b2e1d(_0x32c9fe);});});}function getRemoteTag(_0x2622a8,_0x161b47,_0x16bc2e,_0x18640a,_0x67bbc){return new Promise(function(_0x1895eb,_0x4814e4){var _0x3dea41={'method':_0x3406('0x25'),'uri':_0x16bc2e+_0x3406('0x3d')+_0x3406('0x3e')+_0x2622a8+'&'+_0x18640a,'auth':_0x161b47,'json':!![]};return rp(_0x3dea41)[_0x3406('0xc')](function(_0xa97788){if(_0xa97788[_0x3406('0xd')]['length']>0x0){var _0x3f6dda=_0xa97788[_0x3406('0xd')][0x0][_0x3406('0x1b')];_0x1895eb(_0x3f6dda);}else{return createRemoteTag(_0x2622a8,_0x161b47,_0x16bc2e,_0x18640a)['then'](function(_0x35a53e){_0x1895eb(_0x35a53e);});}});});}function assignTagToIncident(_0xdf1d4d,_0xa84f5d,_0x1e1479,_0x412c25,_0x42ed16){return new Promise(function(_0x4ec867,_0x2e1358){var _0x3560b1={'method':_0x3406('0x36'),'uri':_0x1e1479+_0x3406('0x3f')+'?'+_0x42ed16,'body':{'label':_0xdf1d4d,'table':_0x3406('0x37'),'id_type':'Incident','table_key':_0x412c25['ticketId'],'title':_0x3406('0x40')+_0x412c25['ticketNumber'],'id_display':_0x412c25[_0x3406('0x3b')]},'auth':_0xa84f5d,'json':!![]};return rp(_0x3560b1)['then'](function(_0x48ddfa){_0x4ec867();})[_0x3406('0x12')](function(){_0x4ec867();});});}function manageTags(_0x1af369,_0x335a4f,_0x285966,_0x92529a,_0x357dfd,_0x421863,_0x11975c){return new Promise(function(_0x1ef75a,_0x3b385d){var _0x5bebc5=[];_0x335a4f[_0x3406('0x28')](function(_0x3d2927){_0x5bebc5[_0x3406('0x41')](getRemoteTag(_0x3d2927,_0x285966,_0x92529a,_0x421863,_0x11975c));});return Promise[_0x3406('0x42')](_0x5bebc5)[_0x3406('0xc')](function(_0x5caaad){if(_0x5caaad[_0x3406('0xe')]){logger[_0x3406('0x14')]('['+[_0x1af369['toUpperCase']()]+_0x3406('0x43'),_0x5caaad);var _0x5c2656=[];_0x5caaad[_0x3406('0x28')](function(_0x1d132d){_0x5c2656[_0x3406('0x41')](assignTagToIncident(_0x1d132d,_0x285966,_0x92529a,_0x357dfd,_0x421863));});return Promise[_0x3406('0x42')](_0x5c2656)[_0x3406('0xc')](function(){_0x1ef75a();})[_0x3406('0x12')](function(){_0x1ef75a();});}else{_0x1ef75a();}});});}function getTags(_0x2b2032,_0x3284d7,_0x4a8ce0,_0x48db26,_0x57644c,_0x4ad0cf){return function(_0x428a89){return new Promise(function(_0x569162,_0x29bdfd){var _0x4bf711=[];var _0x42c358=_0x48db26[_0x3406('0x44')];if(_0x42c358&&_0x42c358[_0x3406('0xe')]>0x0){_0x4bf711=_[_0x3406('0x45')](_0x42c358,_0x3406('0x34'));}if(_0x4bf711[_0x3406('0xe')]>0x0){return manageTags(_0x2b2032,_0x4bf711,_0x3284d7,_0x4a8ce0,_0x428a89,_0x57644c,_0x4ad0cf)[_0x3406('0xc')](function(){_0x569162(_0x428a89);});}else{_0x569162(_0x428a89);}});};}function emit(_0x2a3c22,_0x16be23,_0x13b272){var _0x559289=_0x3406('0x46')+_0x3406('0x47')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x3406('0x48');var _0x3b2b39={'uri':_0x2a3c22+_0x3406('0x49')+_0x13b272+_0x559289};io['to'](util[_0x3406('0x4a')]('user:%s',_0x16be23))[_0x3406('0x4b')](_0x3406('0x4c'),_0x3b2b39);}exports['cs']=function(_0xebf918,_0x942b61,_0x13f178,_0xaf93ce,_0xecc2dd,_0x218416,_0x5d9901,_0x2e5c5d){var _0x4d400d={};var _0x3737e6={'user':_0x218416[_0x3406('0x4d')],'pass':_0x218416[_0x3406('0x4e')]};var _0x3405d5=_0x3406('0x4f');var _0x2233ba=_0x3406('0x50');_0x218416['remoteUri']=intUtil[_0x3406('0x51')](_0x218416[_0x3406('0x52')]);_0x218416[_0x3406('0x53')]=intUtil['stripTrailingSlash'](_0x218416[_0x3406('0x53')]);var _0x186bd8=util[_0x3406('0x4a')](_0x3406('0x54'),_0x218416[_0x3406('0x52')]);_0x4d400d[_0x3406('0x17')]=!_[_0x3406('0x55')](_0xaf93ce)?_0xaf93ce[_0x3406('0x56')]:null;_0x4d400d[_0x3406('0x1d')]=_0x218416['email'];_0x4d400d[_0x3406('0x20')]=_0x2e5c5d[_0x3406('0x2f')]()===_0x3406('0x57')?_0x942b61[_0x3406('0x58')]:_0x942b61['calleridnum'];_0x4d400d['callDirection']=_0x2e5c5d===_0x3406('0x59')||_0x2e5c5d==='unmanaged'?_0x3406('0x59'):_0x3406('0x57');var _0x227941=util[_0x3406('0x4a')](_0x3406('0x5a'),_0x218416[_0x3406('0x53')],_0x942b61[_0x3406('0x5b')],md5(_0x942b61['uniqueid']));if(_0xecc2dd&&_0xecc2dd['monitor_format']){logger['info'](_0x3406('0x5c'),_0x3406('0x5d'));_0x942b61[_0x3406('0x5e')]=_0x227941;}else if(_0x5d9901&&_0x5d9901[_0x3406('0x5f')]&&_0x5d9901[_0x3406('0x5f')]!==_0x3406('0x60')){logger['info']('[OUTBOUND]',_0x3406('0x5d'));_0x942b61[_0x3406('0x5e')]=_0x227941;}else{_0x942b61['recordingURL']='';}return getAdminUser(_0x2e5c5d,_0x3737e6,_0x4d400d,_0x186bd8,_0x2233ba,_0x3405d5)['then'](getUser(_0x2e5c5d,_0x3737e6,_0x186bd8,_0x2233ba,_0x3405d5))[_0x3406('0xc')](getEndUser(_0x2e5c5d,_0x3737e6,_0x186bd8,_0x2233ba,_0x3405d5))['then'](getTicket(_0x2e5c5d,_0x3737e6,_0x186bd8,_0x13f178,_0x942b61,_0x2233ba))[_0x3406('0xc')](function(_0x29cfba){logger['info'](util[_0x3406('0x4a')](_0x3406('0x61'),_0x29cfba[_0x3406('0x3a')]));logger[_0x3406('0x14')](util[_0x3406('0x4a')](_0x3406('0x62'),_0x2e5c5d));if(_0x2e5c5d!=='unmanaged'){logger[_0x3406('0x14')]('['+[_0x2e5c5d['toUpperCase']()]+']',_0x3406('0x63'));emit(_0x218416[_0x3406('0x52')],_0xaf93ce[_0x3406('0x34')],_0x29cfba['ticketId']);}})[_0x3406('0x12')](function(_0x4f3b08){logger[_0x3406('0x1e')]('['+[_0x2e5c5d[_0x3406('0x10')]()]+_0x3406('0x64'),util['inspect'](_0x4f3b08,{'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 b151254..e0aa468 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 _0x3c70=['Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','type','string','nameField','toLowerCase','content','toString','customField','variable','customVariable','Variable','custom_fields','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','[OUTBOUND]','unmanaged','lastevent','toUpperCase','isNil','lodash','bluebird','md5','util','ioredis','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','value'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x3c70,0x142));var _0x03c7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x3c70[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x03c7('0x0'));var rp=require('request-promise');var BPromise=require(_0x03c7('0x1'));var md5=require(_0x03c7('0x2'));var util=require(_0x03c7('0x3'));var Redis=require(_0x03c7('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x03c7('0x5'));config['redis']=_[_0x03c7('0x6')](config[_0x03c7('0x7')],{'host':_0x03c7('0x8'),'port':0x18eb});var io=require(_0x03c7('0x9'))(new Redis(config[_0x03c7('0x7')]));var def={'method':_0x03c7('0xa'),'json':!![]};function emit(_0x1cf114,_0x5ec01a,_0x2f2b0a){io['to'](_0x1cf114)['emit'](_0x5ec01a,_0x2f2b0a);}function getTicket(_0xeed13b,_0x38a9e3,_0x29aef6,_0x50cfa3,_0x37bad7,_0x25cb53,_0x1253fb,_0x7e00b7){logger[_0x03c7('0xb')](_0x03c7('0xc'));var _0x22abc2=new Date();var _0x502ff0=[{'name':'name','value':intUtil[_0x03c7('0xd')](_0x50cfa3[_0x03c7('0xe')],_0x37bad7,'\x20')},{'name':'assigned_user_id','value':_0x38a9e3['id']},{'name':_0x03c7('0xf'),'value':_0x38a9e3['id']},{'name':'description','value':intUtil[_0x03c7('0xd')](_0x50cfa3[_0x03c7('0x10')],_0x37bad7,'\x0a')},{'name':'date_start','value':_0x22abc2[_0x03c7('0x11')]()[_0x03c7('0x12')](0x0,0x13)[_0x03c7('0x13')]('T','\x20')},{'name':_0x03c7('0x14'),'value':'0'},{'name':_0x03c7('0x15'),'value':'15'},{'name':_0x03c7('0x16'),'value':_0x29aef6['id']},{'name':_0x03c7('0x17'),'value':_0x03c7('0x18')},{'name':_0x03c7('0x19'),'value':_0x29aef6[_0x03c7('0x1a')]},{'name':'direction','value':_0x7e00b7}];if(_0x25cb53[_0x03c7('0x1b')]){_[_0x03c7('0x1c')](_0x25cb53,function(_0x4d29cb){if(_0x37bad7[_0x4d29cb[_0x03c7('0x1d')]]){_0x502ff0[_0x03c7('0x1e')]({'name':_0x4d29cb[_0x03c7('0x1f')],'value':_0x37bad7[_0x4d29cb[_0x03c7('0x1d')]]});}});}return request({'form':{'method':_0x03c7('0x20'),'input_type':'JSON','response_type':_0x03c7('0x21'),'rest_data':JSON[_0x03c7('0x22')]({'session':_0x1253fb['id'],'module_name':_0x03c7('0x23'),'name_value_list':_0x502ff0})}});}function getAuth(_0x404b68){return util[_0x03c7('0x24')](_0x03c7('0x25'),new Buffer(_0x404b68[_0x03c7('0x26')]+':X')['toString'](_0x03c7('0x27')));}function getServerInfo(_0x420af7){return request({'form':{'method':_0x03c7('0x28'),'input_type':_0x03c7('0x21'),'response_type':_0x03c7('0x21'),'rest_data':JSON['stringify']({'session':_0x420af7['id']})}});}function getUser(_0x1322db,_0x2bc657,_0x5bb25d){if(!_['isNil'](_0x2bc657)){logger['info'](_0x03c7('0x29'),_0x2bc657);return request({'form':{'method':_0x03c7('0x2a'),'input_type':_0x03c7('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5bb25d['id'],'module_name':_0x03c7('0x2b'),'query':util[_0x03c7('0x24')](_0x03c7('0x2c'),_0x2bc657),'order_by':'','offset':'0','select_fields':['id',_0x03c7('0x1a'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x03c7('0x2d')](function(_0x3fc2a8){if(_0x3fc2a8[_0x03c7('0x2e')][_0x03c7('0x1b')]){var _0x21544d=_[_0x03c7('0x2f')](_0x3fc2a8['entry_list'],function(_0x7d3d0b){return _0x7d3d0b[_0x03c7('0x30')]['user_name'][_0x03c7('0x31')]===_0x2bc657;});if(_0x21544d){logger['info'](_0x03c7('0x32'));return BPromise[_0x03c7('0x33')]({'id':_0x21544d[_0x03c7('0x30')]['id']['value'],'name':_0x21544d[_0x03c7('0x30')][_0x03c7('0x1a')][_0x03c7('0x31')]});}}logger['info'](_0x03c7('0x34'));return BPromise['resolve']({'id':_0x5bb25d[_0x03c7('0x30')][_0x03c7('0x35')]['value'],'name':_0x5bb25d[_0x03c7('0x30')][_0x03c7('0x36')][_0x03c7('0x31')]});});}else{logger['info'](_0x03c7('0x37'));return BPromise['resolve']({'id':_0x5bb25d[_0x03c7('0x30')][_0x03c7('0x35')][_0x03c7('0x31')],'name':_0x5bb25d[_0x03c7('0x30')][_0x03c7('0x36')]['value']});}}function getEndUser(_0x5001f9,_0x3401cb,_0xdae410,_0xf6082b){logger[_0x03c7('0xb')](_0x03c7('0x38'),_0xdae410);return request({'form':{'method':_0x03c7('0x2a'),'input_type':'JSON','response_type':_0x03c7('0x21'),'rest_data':JSON[_0x03c7('0x22')]({'session':_0xf6082b['id'],'module_name':_0x03c7('0x18'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0xdae410),'order_by':'','offset':'0','select_fields':['id',_0x03c7('0x1a'),_0x03c7('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x03c7('0x2d')](function(_0x1dbeed){if(_0x1dbeed[_0x03c7('0x2e')]['length']){var _0x5085bf=_[_0x03c7('0x2f')](_0x1dbeed['entry_list'],function(_0x5e6044){return _0x5e6044[_0x03c7('0x30')][_0x03c7('0x39')][_0x03c7('0x31')]===_0xdae410;});if(_0x5085bf){logger[_0x03c7('0xb')]('Enduser\x20found!');return BPromise[_0x03c7('0x33')]({'id':_0x5085bf[_0x03c7('0x30')]['id'][_0x03c7('0x31')],'name':_0x5085bf[_0x03c7('0x30')][_0x03c7('0x1a')]['value'],'phone':_0x5085bf[_0x03c7('0x30')]['phone_home']['value']});}}else{logger[_0x03c7('0xb')](_0x03c7('0x3a'));return request({'form':{'method':_0x03c7('0x20'),'input_type':_0x03c7('0x21'),'response_type':_0x03c7('0x21'),'rest_data':JSON['stringify']({'session':_0xf6082b['id'],'module_name':_0x03c7('0x18'),'name_value_list':[{'name':_0x03c7('0x3b'),'value':_0x3401cb!==_0x03c7('0x3c')?_0x3401cb:util['format'](_0x03c7('0x3d'),_0xdae410)},{'name':_0x03c7('0x39'),'value':_0xdae410}]})}})['then'](function(_0x3877b0){logger['info'](_0x03c7('0x3e'));return BPromise[_0x03c7('0x33')]({'id':_0x3877b0['id'],'name':_0x3877b0[_0x03c7('0x2e')]['first_name'][_0x03c7('0x31')],'phone':_0x3877b0[_0x03c7('0x2e')]['phone_home'][_0x03c7('0x31')]});});}});}function request(_0x17330b){logger[_0x03c7('0x3f')](_0x03c7('0x40'),JSON[_0x03c7('0x22')](_0x17330b));return rp(_['merge'](def,_0x17330b));}function getTags(_0x3274a8,_0x521c78){var _0x5e05be=[];if(_0x3274a8&&_0x3274a8[_0x03c7('0x1b')]>0x0){_0x5e05be=_['map'](_0x3274a8,_0x521c78);}return _0x5e05be;}function getCustomFields(_0x1f995c,_0x15a60e){var _0x36ce4d=[];var _0x2d9083={'custom_fields':[]};if(_0x1f995c[_0x03c7('0x1b')]>0x0){_[_0x03c7('0x1c')](_0x1f995c,function(_0x562123){if(_0x562123[_0x03c7('0x41')]===_0x03c7('0x42')&&_0x562123['nameField']&&!_0x562123['customField']){_0x2d9083[_0x562123[_0x03c7('0x43')][_0x03c7('0x44')]()]=_0x562123[_0x03c7('0x45')][_0x03c7('0x46')]();}else if(_0x562123[_0x03c7('0x41')]==='string'&&_0x562123[_0x03c7('0x1f')]&&_0x562123[_0x03c7('0x47')]){_0x2d9083['custom_fields']['push']({'id':_0x562123[_0x03c7('0x1f')],'value':_0x562123[_0x03c7('0x45')][_0x03c7('0x46')]()});}else if(_0x562123[_0x03c7('0x41')]===_0x03c7('0x48')&&_0x562123[_0x03c7('0x1d')]&&_0x562123[_0x03c7('0x1f')]&&_0x562123[_0x03c7('0x47')]){_0x15a60e[_0x562123[_0x03c7('0x1d')]]&&_0x2d9083['custom_fields']['push']({'id':_0x562123[_0x03c7('0x1f')],'value':_0x15a60e[_0x562123[_0x03c7('0x1d')]][_0x03c7('0x46')]()});}else if(_0x562123[_0x03c7('0x41')]===_0x03c7('0x49')&&_0x562123[_0x03c7('0x4a')]&&_0x562123[_0x03c7('0x4a')][_0x03c7('0x1a')]&&_0x562123['idField']&&_0x562123[_0x03c7('0x47')]){_0x15a60e[_0x562123[_0x03c7('0x4a')][_0x03c7('0x1a')][_0x03c7('0x44')]()]&&_0x2d9083[_0x03c7('0x4b')][_0x03c7('0x1e')]({'id':_0x562123[_0x03c7('0x1f')],'value':_0x15a60e[_0x562123['Variable'][_0x03c7('0x1a')][_0x03c7('0x44')]()][_0x03c7('0x46')]()});}});}return _0x2d9083;}function getConnection(_0x27e646){return request({'method':_0x03c7('0xa'),'form':{'method':_0x03c7('0x4c'),'input_type':_0x03c7('0x21'),'response_type':_0x03c7('0x21'),'rest_data':JSON[_0x03c7('0x22')]({'user_auth':{'user_name':_0x27e646[_0x03c7('0x4d')],'password':_0x27e646[_0x03c7('0x4e')],'encryption':_0x03c7('0x4f')},'application':_0x03c7('0x50')})}})['then'](function(_0x1d3b71){var _0x2c84ef=_0x1d3b71;if(_0x2c84ef['id']){def['sessionID']=_0x2c84ef['id'];return BPromise[_0x03c7('0x33')](_0x2c84ef);}else{throw new Error(util[_0x03c7('0x24')](_0x03c7('0x51'),_0x27e646['id']));}});}function setRelationship(_0x3094a4,_0x5ac595,_0x271437,_0x216e21){return request({'form':{'method':_0x03c7('0x52'),'input_type':_0x03c7('0x21'),'response_type':_0x03c7('0x21'),'rest_data':JSON[_0x03c7('0x22')]({'session':_0x3094a4['id'],'module_name':_0x03c7('0x23'),'module_id':_0x271437['id'],'link_field_name':_0x216e21,'related_ids':[_0x5ac595['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x03c7('0x53')]=function(_0x1486f3,_0x31655c,_0x33b73b,_0x35a87f,_0x50466c,_0x2ee431){var _0x4710b0,_0x5b2da4,_0x9332b4,_0x516e15;_0x2ee431[_0x03c7('0x54')]=intUtil[_0x03c7('0x55')](_0x2ee431[_0x03c7('0x54')]);_0x2ee431[_0x03c7('0x56')]=intUtil['stripTrailingSlash'](_0x2ee431[_0x03c7('0x56')]);def[_0x03c7('0x57')]=util[_0x03c7('0x24')]('%s/service/v4_1/rest.php',_0x2ee431[_0x03c7('0x54')]);if(_0x50466c&&_0x50466c[_0x03c7('0x58')]){logger['info'](_0x03c7('0x59'),_0x03c7('0x5a'));_0x31655c[_0x03c7('0x5b')]=util[_0x03c7('0x24')](_0x03c7('0x5c'),_0x2ee431[_0x03c7('0x56')],_0x31655c[_0x03c7('0x5d')],md5(_0x31655c['uniqueid']));}else{_0x31655c[_0x03c7('0x5b')]='';}return getConnection(_0x2ee431)[_0x03c7('0x2d')](function(_0x22a21a){_0x516e15=_0x22a21a;return getUser(_0x2ee431,_0x35a87f[_0x03c7('0x1a')],_0x516e15);})[_0x03c7('0x2d')](function(_0x5db1ae){_0x4710b0=_0x5db1ae;logger[_0x03c7('0xb')]('The\x20User\x20ID\x20is:',_0x4710b0['id']);return getEndUser(_0x2ee431,_0x31655c[_0x03c7('0x5e')],_0x31655c[_0x03c7('0x5f')],_0x516e15);})[_0x03c7('0x2d')](function(_0x1a2e30){_0x5b2da4=_0x1a2e30;logger[_0x03c7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5b2da4['id']);return getTicket(_0x2ee431,_0x4710b0,_0x5b2da4,_0x33b73b,_0x31655c,_0x33b73b[_0x03c7('0x60')],_0x516e15,_0x03c7('0x61'));})[_0x03c7('0x2d')](function(_0x59026f){_0x9332b4=_0x59026f;logger[_0x03c7('0xb')](_0x03c7('0x62'));logger[_0x03c7('0xb')](_0x03c7('0x63'),_0x9332b4['id']);return setRelationship(_0x516e15,_0x4710b0,_0x9332b4,_0x03c7('0x64'));})['then'](function(){return setRelationship(_0x516e15,_0x5b2da4,_0x9332b4,_0x03c7('0x65'));})['then'](function(){return getServerInfo(_0x516e15);})[_0x03c7('0x2d')](function(_0x1140e7){var _0x35119d=parseInt(_0x1140e7[_0x03c7('0x66')][_0x03c7('0x67')](0x0));var _0x248b7a=util[_0x03c7('0x24')](_0x03c7('0x68'),_0x2ee431[_0x03c7('0x54')],_0x9332b4['id']);if(_0x35119d>0x6){_0x248b7a=util[_0x03c7('0x24')](_0x03c7('0x69'),_0x2ee431[_0x03c7('0x54')],_0x9332b4['id']);}logger[_0x03c7('0xb')](_0x03c7('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x03c7('0x24')](_0x03c7('0x6a'),_0x35a87f[_0x03c7('0x1a')]),_0x03c7('0x6b'),{'uri':_0x248b7a});})[_0x03c7('0x6c')](function(_0x4ddbd4){logger[_0x03c7('0x6d')](_0x03c7('0x59'),JSON['stringify'](_0x4ddbd4));});};exports[_0x03c7('0x6e')]=function(_0x2747c1,_0x44d99e,_0x483177,_0x2c7078,_0x9c4c77,_0x21c06f,_0x3031e8){var _0x31d4ba,_0x31575d,_0x59068c,_0x570b22;_0x21c06f[_0x03c7('0x54')]=intUtil[_0x03c7('0x55')](_0x21c06f[_0x03c7('0x54')]);_0x21c06f[_0x03c7('0x56')]=intUtil[_0x03c7('0x55')](_0x21c06f[_0x03c7('0x56')]);def['uri']=util['format'](_0x03c7('0x6f'),_0x21c06f[_0x03c7('0x54')]);if(_0x3031e8&&_0x3031e8[_0x03c7('0x70')]&&_0x3031e8['recordingFormat']!==_0x03c7('0x71')){logger[_0x03c7('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x44d99e['recordingURL']=util[_0x03c7('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21c06f['serverUrl'],_0x44d99e['uniqueid'],md5(_0x44d99e['uniqueid']));}return getConnection(_0x21c06f)[_0x03c7('0x2d')](function(_0x2e9d69){_0x570b22=_0x2e9d69;return getUser(_0x21c06f,_0x2c7078[_0x03c7('0x1a')],_0x570b22);})[_0x03c7('0x2d')](function(_0xa243b5){_0x31d4ba=_0xa243b5;logger[_0x03c7('0xb')](_0x03c7('0x72'),_0x31d4ba['id']);return getEndUser(_0x21c06f,_0x44d99e[_0x03c7('0x73')],_0x44d99e[_0x03c7('0x74')],_0x570b22);})['then'](function(_0x42133c){_0x31575d=_0x42133c;logger[_0x03c7('0xb')](_0x03c7('0x75'),_0x31575d['id']);return getTicket(_0x21c06f,_0x31d4ba,_0x31575d,_0x483177,_0x44d99e,_0x483177[_0x03c7('0x60')],_0x570b22,_0x03c7('0x76'));})[_0x03c7('0x2d')](function(_0x2be975){_0x59068c=_0x2be975;logger[_0x03c7('0xb')](_0x03c7('0x62'));logger[_0x03c7('0xb')](_0x03c7('0x63'),_0x59068c['id']);return setRelationship(_0x570b22,_0x31d4ba,_0x59068c,_0x03c7('0x64'));})['then'](function(){return setRelationship(_0x570b22,_0x31575d,_0x59068c,_0x03c7('0x65'));})['then'](function(){return getServerInfo(_0x570b22);})[_0x03c7('0x2d')](function(_0x3ab810){var _0x26cb74=parseInt(_0x3ab810['version'][_0x03c7('0x67')](0x0));var _0x1d34f9=util['format'](_0x03c7('0x68'),_0x21c06f[_0x03c7('0x54')],_0x59068c['id']);if(_0x26cb74>0x6){_0x1d34f9=util[_0x03c7('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x21c06f[_0x03c7('0x54')],_0x59068c['id']);}logger[_0x03c7('0xb')](_0x03c7('0x77'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x03c7('0x24')](_0x03c7('0x6a'),_0x2c7078['name']),'trigger:browser:url',{'uri':_0x1d34f9});})['catch'](function(_0x4191c7){logger[_0x03c7('0x6d')](_0x03c7('0x77'),JSON[_0x03c7('0x22')](_0x4191c7));});};exports[_0x03c7('0x78')]=function(_0x1ceb89,_0x14920a,_0x317b,_0x5aae07,_0x22770f,_0x56e6e8){var _0x38ddce,_0x34d1fb,_0x102f0c,_0xdfcfe9;_0x56e6e8[_0x03c7('0x54')]=intUtil[_0x03c7('0x55')](_0x56e6e8[_0x03c7('0x54')]);_0x56e6e8[_0x03c7('0x56')]=intUtil[_0x03c7('0x55')](_0x56e6e8[_0x03c7('0x56')]);def[_0x03c7('0x57')]=util[_0x03c7('0x24')](_0x03c7('0x6f'),_0x56e6e8[_0x03c7('0x54')]);if(_0x22770f&&_0x22770f['monitor_format']){logger[_0x03c7('0xb')]('['+_0x14920a[_0x03c7('0x79')][_0x03c7('0x7a')]()+']',_0x03c7('0x5a'));_0x14920a['recordingURL']=util[_0x03c7('0x24')](_0x03c7('0x5c'),_0x56e6e8[_0x03c7('0x56')],_0x14920a['uniqueid'],md5(_0x14920a[_0x03c7('0x5d')]));}else{_0x14920a[_0x03c7('0x5b')]='';}return getConnection(_0x56e6e8)[_0x03c7('0x2d')](function(_0x146723){_0xdfcfe9=_0x146723;if(!_[_0x03c7('0x7b')](_0x5aae07)){return getUser(_0x56e6e8,_0x5aae07[_0x03c7('0x1a')],_0xdfcfe9);}else{return getUser(_0x56e6e8,null,_0xdfcfe9);}})[_0x03c7('0x2d')](function(_0x53e427){_0x38ddce=_0x53e427;logger[_0x03c7('0xb')](_0x03c7('0x72'),_0x38ddce['id']);return getEndUser(_0x56e6e8,_0x14920a[_0x03c7('0x5e')],_0x14920a[_0x03c7('0x5f')],_0xdfcfe9);})[_0x03c7('0x2d')](function(_0x1cc339){_0x34d1fb=_0x1cc339;logger[_0x03c7('0xb')](_0x03c7('0x75'),_0x34d1fb['id']);return getTicket(_0x56e6e8,_0x38ddce,_0x34d1fb,_0x317b,_0x14920a,_0x317b[_0x03c7('0x60')],_0xdfcfe9,_0x03c7('0x61'));})[_0x03c7('0x2d')](function(_0x213f8f){_0x102f0c=_0x213f8f;logger['info']('Ticket\x20created!');logger[_0x03c7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x102f0c['id']);return setRelationship(_0xdfcfe9,_0x38ddce,_0x102f0c,_0x03c7('0x64'));})[_0x03c7('0x2d')](function(){return setRelationship(_0xdfcfe9,_0x34d1fb,_0x102f0c,_0x03c7('0x65'));})['then'](function(){return getServerInfo(_0xdfcfe9);})[_0x03c7('0x6c')](function(_0xef553d){logger[_0x03c7('0x6d')]('['+_0x14920a[_0x03c7('0x79')][_0x03c7('0x7a')]()+']',JSON[_0x03c7('0x22')](_0xef553d));});}; \ No newline at end of file +var _0x7383=['The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','calleridname','calleridnum','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','parent_id','Contacts','parent_name','name','direction','length','idField','variableName','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','custom_fields','push','toString','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!'];(function(_0x16c91a,_0x500075){var _0x453c05=function(_0xd22763){while(--_0xd22763){_0x16c91a['push'](_0x16c91a['shift']());}};_0x453c05(++_0x500075);}(_0x7383,0x18d));var _0x3738=function(_0xae5ad4,_0x58b46e){_0xae5ad4=_0xae5ad4-0x0;var _0x54d414=_0x7383[_0xae5ad4];return _0x54d414;};'use strict';var _=require('lodash');var rp=require(_0x3738('0x0'));var BPromise=require(_0x3738('0x1'));var md5=require(_0x3738('0x2'));var util=require(_0x3738('0x3'));var Redis=require(_0x3738('0x4'));var intUtil=require(_0x3738('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3738('0x6'))(_0x3738('0x7'));config[_0x3738('0x8')]=_[_0x3738('0x9')](config[_0x3738('0x8')],{'host':_0x3738('0xa'),'port':0x18eb});var io=require(_0x3738('0xb'))(new Redis(config[_0x3738('0x8')]));var def={'method':_0x3738('0xc'),'json':!![]};function emit(_0x5d24cd,_0x1cfcd4,_0xde6160){io['to'](_0x5d24cd)[_0x3738('0xd')](_0x1cfcd4,_0xde6160);}function getTicket(_0x5b27ac,_0x4e9704,_0x44d554,_0x42acb6,_0x4a134a,_0x126722,_0x458d50,_0x5ccb87){logger[_0x3738('0xe')](_0x3738('0xf'));var _0xe01f3c=new Date();var _0x293dcf=[{'name':'name','value':intUtil[_0x3738('0x10')](_0x42acb6[_0x3738('0x11')],_0x4a134a,'\x20')},{'name':_0x3738('0x12'),'value':_0x4e9704['id']},{'name':_0x3738('0x13'),'value':_0x4e9704['id']},{'name':_0x3738('0x14'),'value':intUtil[_0x3738('0x10')](_0x42acb6['Descriptions'],_0x4a134a,'\x0a')},{'name':_0x3738('0x15'),'value':_0xe01f3c[_0x3738('0x16')]()[_0x3738('0x17')](0x0,0x13)[_0x3738('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x3738('0x19'),'value':_0x44d554['id']},{'name':'parent_type','value':_0x3738('0x1a')},{'name':_0x3738('0x1b'),'value':_0x44d554[_0x3738('0x1c')]},{'name':_0x3738('0x1d'),'value':_0x5ccb87}];if(_0x126722[_0x3738('0x1e')]){_['forEach'](_0x126722,function(_0x3fbc5c){if(_0x4a134a[_0x3fbc5c['variableName']]){_0x293dcf['push']({'name':_0x3fbc5c[_0x3738('0x1f')],'value':_0x4a134a[_0x3fbc5c[_0x3738('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3738('0x21'),'response_type':_0x3738('0x21'),'rest_data':JSON[_0x3738('0x22')]({'session':_0x458d50['id'],'module_name':_0x3738('0x23'),'name_value_list':_0x293dcf})}});}function getAuth(_0x352d58){return util[_0x3738('0x24')](_0x3738('0x25'),new Buffer(_0x352d58[_0x3738('0x26')]+':X')['toString'](_0x3738('0x27')));}function getServerInfo(_0x311fe3){return request({'form':{'method':_0x3738('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3738('0x22')]({'session':_0x311fe3['id']})}});}function getUser(_0x33edfb,_0x266246,_0x858355){if(!_[_0x3738('0x29')](_0x266246)){logger[_0x3738('0xe')](_0x3738('0x2a'),_0x266246);return request({'form':{'method':_0x3738('0x2b'),'input_type':'JSON','response_type':_0x3738('0x21'),'rest_data':JSON[_0x3738('0x22')]({'session':_0x858355['id'],'module_name':_0x3738('0x2c'),'query':util[_0x3738('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x266246),'order_by':'','offset':'0','select_fields':['id',_0x3738('0x1c'),_0x3738('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3738('0x2e')](function(_0x3c9f7a){if(_0x3c9f7a[_0x3738('0x2f')]['length']){var _0x5de145=_[_0x3738('0x30')](_0x3c9f7a[_0x3738('0x2f')],function(_0x15b6cb){return _0x15b6cb[_0x3738('0x31')]['user_name'][_0x3738('0x32')]===_0x266246;});if(_0x5de145){logger[_0x3738('0xe')](_0x3738('0x33'));return BPromise[_0x3738('0x34')]({'id':_0x5de145['name_value_list']['id']['value'],'name':_0x5de145['name_value_list'][_0x3738('0x1c')][_0x3738('0x32')]});}}logger[_0x3738('0xe')](_0x3738('0x35'));return BPromise[_0x3738('0x34')]({'id':_0x858355[_0x3738('0x31')]['user_id'][_0x3738('0x32')],'name':_0x858355[_0x3738('0x31')][_0x3738('0x2d')]['value']});});}else{logger[_0x3738('0xe')](_0x3738('0x36'));return BPromise[_0x3738('0x34')]({'id':_0x858355[_0x3738('0x31')]['user_id']['value'],'name':_0x858355['name_value_list']['user_name'][_0x3738('0x32')]});}}function getEndUser(_0x36837f,_0x55769d,_0x225a69,_0x444718){logger[_0x3738('0xe')]('Searching\x20enduser\x20with\x20phone',_0x225a69);return request({'form':{'method':'get_entry_list','input_type':_0x3738('0x21'),'response_type':_0x3738('0x21'),'rest_data':JSON['stringify']({'session':_0x444718['id'],'module_name':_0x3738('0x1a'),'query':util[_0x3738('0x24')](_0x3738('0x37'),_0x225a69),'order_by':'','offset':'0','select_fields':['id',_0x3738('0x1c'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3738('0x2e')](function(_0x34eafb){if(_0x34eafb[_0x3738('0x2f')][_0x3738('0x1e')]){var _0x2cdfd2=_[_0x3738('0x30')](_0x34eafb[_0x3738('0x2f')],function(_0x573ee1){return _0x573ee1[_0x3738('0x31')]['phone_home'][_0x3738('0x32')]===_0x225a69;});if(_0x2cdfd2){logger[_0x3738('0xe')](_0x3738('0x38'));return BPromise[_0x3738('0x34')]({'id':_0x2cdfd2['name_value_list']['id'][_0x3738('0x32')],'name':_0x2cdfd2[_0x3738('0x31')]['name'][_0x3738('0x32')],'phone':_0x2cdfd2['name_value_list'][_0x3738('0x39')][_0x3738('0x32')]});}}else{logger[_0x3738('0xe')](_0x3738('0x3a'));return request({'form':{'method':'set_entry','input_type':_0x3738('0x21'),'response_type':_0x3738('0x21'),'rest_data':JSON[_0x3738('0x22')]({'session':_0x444718['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3738('0x3b'),'value':_0x55769d!==_0x3738('0x3c')?_0x55769d:util[_0x3738('0x24')](_0x3738('0x3d'),_0x225a69)},{'name':_0x3738('0x39'),'value':_0x225a69}]})}})[_0x3738('0x2e')](function(_0x399cb6){logger[_0x3738('0xe')](_0x3738('0x3e'));return BPromise[_0x3738('0x34')]({'id':_0x399cb6['id'],'name':_0x399cb6[_0x3738('0x2f')][_0x3738('0x3b')][_0x3738('0x32')],'phone':_0x399cb6['entry_list'][_0x3738('0x39')][_0x3738('0x32')]});});}});}function request(_0x103030){logger[_0x3738('0x3f')](_0x3738('0x40'),JSON['stringify'](_0x103030));return rp(_[_0x3738('0x41')](def,_0x103030));}function getTags(_0x2a4077,_0x370d1c){var _0x5dbbb7=[];if(_0x2a4077&&_0x2a4077[_0x3738('0x1e')]>0x0){_0x5dbbb7=_[_0x3738('0x42')](_0x2a4077,_0x370d1c);}return _0x5dbbb7;}function getCustomFields(_0x1aac24,_0x554329){var _0x39002a=[];var _0x376288={'custom_fields':[]};if(_0x1aac24[_0x3738('0x1e')]>0x0){_[_0x3738('0x43')](_0x1aac24,function(_0x4e2966){if(_0x4e2966[_0x3738('0x44')]===_0x3738('0x45')&&_0x4e2966[_0x3738('0x46')]&&!_0x4e2966[_0x3738('0x47')]){_0x376288[_0x4e2966[_0x3738('0x46')][_0x3738('0x48')]()]=_0x4e2966['content']['toString']();}else if(_0x4e2966[_0x3738('0x44')]==='string'&&_0x4e2966[_0x3738('0x1f')]&&_0x4e2966[_0x3738('0x47')]){_0x376288[_0x3738('0x49')][_0x3738('0x4a')]({'id':_0x4e2966['idField'],'value':_0x4e2966['content'][_0x3738('0x4b')]()});}else if(_0x4e2966[_0x3738('0x44')]===_0x3738('0x4c')&&_0x4e2966[_0x3738('0x20')]&&_0x4e2966[_0x3738('0x1f')]&&_0x4e2966['customField']){_0x554329[_0x4e2966[_0x3738('0x20')]]&&_0x376288[_0x3738('0x49')]['push']({'id':_0x4e2966[_0x3738('0x1f')],'value':_0x554329[_0x4e2966['variableName']][_0x3738('0x4b')]()});}else if(_0x4e2966['type']===_0x3738('0x4d')&&_0x4e2966['Variable']&&_0x4e2966[_0x3738('0x4e')][_0x3738('0x1c')]&&_0x4e2966['idField']&&_0x4e2966['customField']){_0x554329[_0x4e2966[_0x3738('0x4e')]['name'][_0x3738('0x48')]()]&&_0x376288['custom_fields'][_0x3738('0x4a')]({'id':_0x4e2966[_0x3738('0x1f')],'value':_0x554329[_0x4e2966['Variable']['name'][_0x3738('0x48')]()][_0x3738('0x4b')]()});}});}return _0x376288;}function getConnection(_0x195e02){return request({'method':_0x3738('0xc'),'form':{'method':_0x3738('0x4f'),'input_type':_0x3738('0x21'),'response_type':_0x3738('0x21'),'rest_data':JSON[_0x3738('0x22')]({'user_auth':{'user_name':_0x195e02[_0x3738('0x50')],'password':_0x195e02[_0x3738('0x51')],'encryption':_0x3738('0x52')},'application':_0x3738('0x53')})}})[_0x3738('0x2e')](function(_0x24e720){var _0x42493c=_0x24e720;if(_0x42493c['id']){def[_0x3738('0x54')]=_0x42493c['id'];return BPromise[_0x3738('0x34')](_0x42493c);}else{throw new Error(util[_0x3738('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x195e02['id']));}});}function setRelationship(_0x558d7a,_0x473b02,_0xb10096,_0x1b9efb){return request({'form':{'method':_0x3738('0x55'),'input_type':_0x3738('0x21'),'response_type':_0x3738('0x21'),'rest_data':JSON[_0x3738('0x22')]({'session':_0x558d7a['id'],'module_name':_0x3738('0x23'),'module_id':_0xb10096['id'],'link_field_name':_0x1b9efb,'related_ids':[_0x473b02['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x45dd91,_0xdb0523,_0x45c856,_0x20ee77,_0x18f37e,_0x21e11e){var _0x30b9e4,_0xb39983,_0x11b350,_0xf859c7;_0x21e11e['remoteUri']=intUtil[_0x3738('0x56')](_0x21e11e['remoteUri']);_0x21e11e['serverUrl']=intUtil[_0x3738('0x56')](_0x21e11e[_0x3738('0x57')]);def['uri']=util[_0x3738('0x24')]('%s/service/v4_1/rest.php',_0x21e11e[_0x3738('0x58')]);if(_0x18f37e&&_0x18f37e[_0x3738('0x59')]){logger['info'](_0x3738('0x5a'),_0x3738('0x5b'));_0xdb0523[_0x3738('0x5c')]=util[_0x3738('0x24')](_0x3738('0x5d'),_0x21e11e[_0x3738('0x57')],_0xdb0523[_0x3738('0x5e')],md5(_0xdb0523[_0x3738('0x5e')]));}else{_0xdb0523['recordingURL']='';}return getConnection(_0x21e11e)[_0x3738('0x2e')](function(_0x410ffd){_0xf859c7=_0x410ffd;return getUser(_0x21e11e,_0x20ee77[_0x3738('0x1c')],_0xf859c7);})['then'](function(_0x1714d0){_0x30b9e4=_0x1714d0;logger['info']('The\x20User\x20ID\x20is:',_0x30b9e4['id']);return getEndUser(_0x21e11e,_0xdb0523['calleridname'],_0xdb0523['calleridnum'],_0xf859c7);})[_0x3738('0x2e')](function(_0x57314a){_0xb39983=_0x57314a;logger[_0x3738('0xe')](_0x3738('0x5f'),_0xb39983['id']);return getTicket(_0x21e11e,_0x30b9e4,_0xb39983,_0x45c856,_0xdb0523,_0x45c856[_0x3738('0x60')],_0xf859c7,_0x3738('0x61'));})[_0x3738('0x2e')](function(_0x229798){_0x11b350=_0x229798;logger[_0x3738('0xe')](_0x3738('0x62'));logger[_0x3738('0xe')](_0x3738('0x63'),_0x11b350['id']);return setRelationship(_0xf859c7,_0x30b9e4,_0x11b350,_0x3738('0x64'));})[_0x3738('0x2e')](function(){return setRelationship(_0xf859c7,_0xb39983,_0x11b350,_0x3738('0x65'));})[_0x3738('0x2e')](function(){return getServerInfo(_0xf859c7);})['then'](function(_0x16552c){var _0xd60203=parseInt(_0x16552c[_0x3738('0x66')][_0x3738('0x67')](0x0));var _0x465936=util[_0x3738('0x24')](_0x3738('0x68'),_0x21e11e['remoteUri'],_0x11b350['id']);if(_0xd60203>0x6){_0x465936=util[_0x3738('0x24')](_0x3738('0x69'),_0x21e11e['remoteUri'],_0x11b350['id']);}logger[_0x3738('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3738('0x24')](_0x3738('0x6a'),_0x20ee77[_0x3738('0x1c')]),_0x3738('0x6b'),{'uri':_0x465936});})[_0x3738('0x6c')](function(_0x17c224){logger[_0x3738('0x6d')](_0x3738('0x5a'),JSON[_0x3738('0x22')](_0x17c224));});};exports[_0x3738('0x6e')]=function(_0x272a51,_0x49d12f,_0x568a4b,_0x1a43b6,_0x1ccb3c,_0x13b33b,_0x4de77f){var _0x3c9b90,_0x2dd156,_0x2ecab3,_0xdc9c4a;_0x13b33b[_0x3738('0x58')]=intUtil['stripTrailingSlash'](_0x13b33b[_0x3738('0x58')]);_0x13b33b[_0x3738('0x57')]=intUtil[_0x3738('0x56')](_0x13b33b[_0x3738('0x57')]);def[_0x3738('0x6f')]=util[_0x3738('0x24')](_0x3738('0x70'),_0x13b33b[_0x3738('0x58')]);if(_0x4de77f&&_0x4de77f['recordingFormat']&&_0x4de77f[_0x3738('0x71')]!==_0x3738('0x72')){logger['info'](_0x3738('0x73'),'Recording\x20is\x20enabled!');_0x49d12f[_0x3738('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x13b33b[_0x3738('0x57')],_0x49d12f[_0x3738('0x5e')],md5(_0x49d12f[_0x3738('0x5e')]));}return getConnection(_0x13b33b)[_0x3738('0x2e')](function(_0x4f5959){_0xdc9c4a=_0x4f5959;return getUser(_0x13b33b,_0x1a43b6[_0x3738('0x1c')],_0xdc9c4a);})[_0x3738('0x2e')](function(_0x4845d0){_0x3c9b90=_0x4845d0;logger['info']('The\x20User\x20ID\x20is:',_0x3c9b90['id']);return getEndUser(_0x13b33b,_0x49d12f[_0x3738('0x74')],_0x49d12f[_0x3738('0x75')],_0xdc9c4a);})[_0x3738('0x2e')](function(_0x356ac1){_0x2dd156=_0x356ac1;logger[_0x3738('0xe')](_0x3738('0x5f'),_0x2dd156['id']);return getTicket(_0x13b33b,_0x3c9b90,_0x2dd156,_0x568a4b,_0x49d12f,_0x568a4b[_0x3738('0x60')],_0xdc9c4a,_0x3738('0x76'));})[_0x3738('0x2e')](function(_0x402737){_0x2ecab3=_0x402737;logger[_0x3738('0xe')](_0x3738('0x62'));logger['info'](_0x3738('0x63'),_0x2ecab3['id']);return setRelationship(_0xdc9c4a,_0x3c9b90,_0x2ecab3,_0x3738('0x64'));})[_0x3738('0x2e')](function(){return setRelationship(_0xdc9c4a,_0x2dd156,_0x2ecab3,_0x3738('0x65'));})['then'](function(){return getServerInfo(_0xdc9c4a);})[_0x3738('0x2e')](function(_0x3da4aa){var _0x3a3460=parseInt(_0x3da4aa[_0x3738('0x66')][_0x3738('0x67')](0x0));var _0x2666f3=util['format'](_0x3738('0x68'),_0x13b33b[_0x3738('0x58')],_0x2ecab3['id']);if(_0x3a3460>0x6){_0x2666f3=util[_0x3738('0x24')](_0x3738('0x69'),_0x13b33b[_0x3738('0x58')],_0x2ecab3['id']);}logger['info'](_0x3738('0x73'),_0x3738('0x77'));emit(util[_0x3738('0x24')]('user:%s',_0x1a43b6[_0x3738('0x1c')]),_0x3738('0x6b'),{'uri':_0x2666f3});})['catch'](function(_0x33dee3){logger[_0x3738('0x6d')](_0x3738('0x73'),JSON[_0x3738('0x22')](_0x33dee3));});};exports['unmanaged']=function(_0x574090,_0x143ede,_0x544a7a,_0x559008,_0x7c3b0c,_0x222c47){var _0x457072,_0x2e5875,_0x4da671,_0x688692;_0x222c47[_0x3738('0x58')]=intUtil[_0x3738('0x56')](_0x222c47['remoteUri']);_0x222c47['serverUrl']=intUtil[_0x3738('0x56')](_0x222c47[_0x3738('0x57')]);def[_0x3738('0x6f')]=util[_0x3738('0x24')]('%s/service/v4_1/rest.php',_0x222c47[_0x3738('0x58')]);if(_0x7c3b0c&&_0x7c3b0c[_0x3738('0x59')]){logger['info']('['+_0x143ede[_0x3738('0x78')]['toUpperCase']()+']',_0x3738('0x5b'));_0x143ede['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x222c47['serverUrl'],_0x143ede['uniqueid'],md5(_0x143ede[_0x3738('0x5e')]));}else{_0x143ede[_0x3738('0x5c')]='';}return getConnection(_0x222c47)['then'](function(_0x2d2de0){_0x688692=_0x2d2de0;if(!_['isNil'](_0x559008)){return getUser(_0x222c47,_0x559008[_0x3738('0x1c')],_0x688692);}else{return getUser(_0x222c47,null,_0x688692);}})['then'](function(_0x4f77c9){_0x457072=_0x4f77c9;logger['info']('The\x20User\x20ID\x20is:',_0x457072['id']);return getEndUser(_0x222c47,_0x143ede[_0x3738('0x79')],_0x143ede[_0x3738('0x7a')],_0x688692);})[_0x3738('0x2e')](function(_0x1d79d9){_0x2e5875=_0x1d79d9;logger[_0x3738('0xe')](_0x3738('0x5f'),_0x2e5875['id']);return getTicket(_0x222c47,_0x457072,_0x2e5875,_0x544a7a,_0x143ede,_0x544a7a[_0x3738('0x60')],_0x688692,'Inbound');})[_0x3738('0x2e')](function(_0x57a2ba){_0x4da671=_0x57a2ba;logger[_0x3738('0xe')](_0x3738('0x62'));logger[_0x3738('0xe')](_0x3738('0x63'),_0x4da671['id']);return setRelationship(_0x688692,_0x457072,_0x4da671,_0x3738('0x64'));})[_0x3738('0x2e')](function(){return setRelationship(_0x688692,_0x2e5875,_0x4da671,_0x3738('0x65'));})['then'](function(){return getServerInfo(_0x688692);})[_0x3738('0x6c')](function(_0x3dc2a0){logger[_0x3738('0x6d')]('['+_0x143ede[_0x3738('0x78')][_0x3738('0x7b')]()+']',JSON[_0x3738('0x22')](_0x3dc2a0));});}; \ 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 d347af7..5fbab36 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 _0xbd26=['validateEmail','isNil','test','lodash','util','getString','sortBy','type','string','variable','variableName','toString','customVariable','Variable','name','toLowerCase','key','push','format','keyType','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xbd26,0x99));var _0x6bd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bd2('0x0'));var util=require(_0x6bd2('0x1'));exports[_0x6bd2('0x2')]=function(_0x362545,_0x5c43f6,_0x407185){var _0x31859d=[];if(_0x362545['length']>0x0){var _0x242155=_[_0x6bd2('0x3')](_0x362545,['id']);for(var _0x55871f=0x0;_0x55871f<_0x242155['length'];_0x55871f++){var _0x278bde=_0x242155[_0x55871f];if(_0x278bde[_0x6bd2('0x4')]===_0x6bd2('0x5')){_0x31859d['push'](_0x278bde['content']);}else if(_0x278bde[_0x6bd2('0x4')]===_0x6bd2('0x6')&&_0x278bde['variableName']){_0x5c43f6[_0x278bde[_0x6bd2('0x7')]]&&_0x31859d['push'](_0x5c43f6[_0x278bde[_0x6bd2('0x7')]][_0x6bd2('0x8')]());}else if(_0x278bde[_0x6bd2('0x4')]===_0x6bd2('0x9')&&_0x278bde[_0x6bd2('0xa')]&&_0x278bde['Variable'][_0x6bd2('0xb')]){_0x5c43f6[_0x278bde[_0x6bd2('0xa')][_0x6bd2('0xb')][_0x6bd2('0xc')]()]&&_0x31859d['push'](_0x5c43f6[_0x278bde[_0x6bd2('0xa')][_0x6bd2('0xb')][_0x6bd2('0xc')]()][_0x6bd2('0x8')]());}else if(_0x278bde[_0x6bd2('0x4')]==='keyValue'){if(_0x278bde['keyType']===_0x6bd2('0x5')&&_0x278bde[_0x6bd2('0xd')]){_0x31859d[_0x6bd2('0xe')](util[_0x6bd2('0xf')]('%s:\x20%s',_0x278bde['key'],_0x278bde['keyContent']));}else if(_0x278bde[_0x6bd2('0x10')]==='variable'&&_0x278bde[_0x6bd2('0x7')]&&_0x278bde[_0x6bd2('0xd')]){_0x5c43f6[_0x278bde['variableName']]&&_0x31859d[_0x6bd2('0xe')](util[_0x6bd2('0xf')](_0x6bd2('0x11'),_0x278bde[_0x6bd2('0xd')],_0x5c43f6[_0x278bde[_0x6bd2('0x7')]]));}else if(_0x278bde['keyType']==='customVariable'&&_0x278bde['Variable']&&_0x278bde[_0x6bd2('0xa')]['name']&&_0x278bde[_0x6bd2('0xd')]){_0x5c43f6[_0x278bde['Variable']['name'][_0x6bd2('0xc')]()]&&_0x31859d[_0x6bd2('0xe')](util[_0x6bd2('0xf')](_0x6bd2('0x11'),_0x278bde[_0x6bd2('0xd')],_0x5c43f6[_0x278bde[_0x6bd2('0xa')]['name'][_0x6bd2('0xc')]()]));}}}}return _0x31859d[_0x6bd2('0x12')](_0x407185);};exports[_0x6bd2('0x13')]=function(_0x34c59d){var _0x4c956b=_0x34c59d[_0x6bd2('0x14')](-0x1);if(_0x4c956b==='/'){_0x34c59d=_0x34c59d['substring'](0x0,_0x34c59d[_0x6bd2('0x15')](_0x4c956b));}return _0x34c59d;};exports[_0x6bd2('0x16')]=function(_0x5a92d1){if(!_[_0x6bd2('0x17')](_0x5a92d1)&&_0x5a92d1!==''){var _0x338bcd=/^(([^<>()\[\]\\.,;:\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 _0x338bcd[_0x6bd2('0x18')](String(_0x5a92d1)[_0x6bd2('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x00c8=['push','variableName','toString','customVariable','Variable','name','toLowerCase','string','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','content','variable'];(function(_0x2dc78b,_0x1371d2){var _0x53e1d6=function(_0x335250){while(--_0x335250){_0x2dc78b['push'](_0x2dc78b['shift']());}};_0x53e1d6(++_0x1371d2);}(_0x00c8,0x110));var _0x800c=function(_0x366152,_0x57245a){_0x366152=_0x366152-0x0;var _0x26cfee=_0x00c8[_0x366152];return _0x26cfee;};'use strict';var _=require(_0x800c('0x0'));var util=require(_0x800c('0x1'));exports[_0x800c('0x2')]=function(_0x1d469d,_0x338155,_0x544e21){var _0x385778=[];if(_0x1d469d['length']>0x0){var _0xfbdee4=_[_0x800c('0x3')](_0x1d469d,['id']);for(var _0x13aa15=0x0;_0x13aa15<_0xfbdee4[_0x800c('0x4')];_0x13aa15++){var _0x28c770=_0xfbdee4[_0x13aa15];if(_0x28c770[_0x800c('0x5')]==='string'){_0x385778['push'](_0x28c770[_0x800c('0x6')]);}else if(_0x28c770[_0x800c('0x5')]===_0x800c('0x7')&&_0x28c770['variableName']){_0x338155[_0x28c770['variableName']]&&_0x385778[_0x800c('0x8')](_0x338155[_0x28c770[_0x800c('0x9')]][_0x800c('0xa')]());}else if(_0x28c770[_0x800c('0x5')]===_0x800c('0xb')&&_0x28c770[_0x800c('0xc')]&&_0x28c770[_0x800c('0xc')]['name']){_0x338155[_0x28c770['Variable'][_0x800c('0xd')][_0x800c('0xe')]()]&&_0x385778[_0x800c('0x8')](_0x338155[_0x28c770[_0x800c('0xc')][_0x800c('0xd')]['toLowerCase']()][_0x800c('0xa')]());}else if(_0x28c770[_0x800c('0x5')]==='keyValue'){if(_0x28c770['keyType']===_0x800c('0xf')&&_0x28c770[_0x800c('0x10')]){_0x385778[_0x800c('0x8')](util[_0x800c('0x11')](_0x800c('0x12'),_0x28c770[_0x800c('0x10')],_0x28c770[_0x800c('0x13')]));}else if(_0x28c770[_0x800c('0x14')]===_0x800c('0x7')&&_0x28c770[_0x800c('0x9')]&&_0x28c770['key']){_0x338155[_0x28c770[_0x800c('0x9')]]&&_0x385778[_0x800c('0x8')](util[_0x800c('0x11')](_0x800c('0x12'),_0x28c770[_0x800c('0x10')],_0x338155[_0x28c770[_0x800c('0x9')]]));}else if(_0x28c770[_0x800c('0x14')]===_0x800c('0xb')&&_0x28c770[_0x800c('0xc')]&&_0x28c770[_0x800c('0xc')][_0x800c('0xd')]&&_0x28c770['key']){_0x338155[_0x28c770[_0x800c('0xc')][_0x800c('0xd')][_0x800c('0xe')]()]&&_0x385778[_0x800c('0x8')](util[_0x800c('0x11')]('%s:\x20%s',_0x28c770[_0x800c('0x10')],_0x338155[_0x28c770['Variable']['name']['toLowerCase']()]));}}}}return _0x385778[_0x800c('0x15')](_0x544e21);};exports[_0x800c('0x16')]=function(_0x5a3dc7){var _0x2bc015=_0x5a3dc7['slice'](-0x1);if(_0x2bc015==='/'){_0x5a3dc7=_0x5a3dc7[_0x800c('0x17')](0x0,_0x5a3dc7[_0x800c('0x18')](_0x2bc015));}return _0x5a3dc7;};exports[_0x800c('0x19')]=function(_0x35cae2){if(!_[_0x800c('0x1a')](_0x35cae2)&&_0x35cae2!==''){var _0x429ba6=/^(([^<>()\[\]\\.,;:\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 _0x429ba6[_0x800c('0x1b')](String(_0x35cae2)[_0x800c('0xe')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 5a6963a..d23293d 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4f7e6a,_0x3e3878){var _0x5373f8=function(_0x57d34e){while(--_0x57d34e){_0x4f7e6a['push'](_0x4f7e6a['shift']());}};_0x5373f8(++_0x3e3878);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _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(_0x47cbe4,_0x226111){var _0x21e7cb=function(_0x890374){while(--_0x890374){_0x47cbe4['push'](_0x47cbe4['shift']());}};_0x21e7cb(++_0x226111);}(_0x34e8,0x12c));var _0x834e=function(_0x2b0903,_0x2d97ae){_0x2b0903=_0x2b0903-0x0;var _0x34ff5b=_0x34e8[_0x2b0903];return _0x34ff5b;};'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 4500a2e..a96bc04 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 _0xd3a0=['queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','[QUEUE]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','base64','[HTTP]','stringify','length','map','forEach','includes','picklist','type','nameField','customField','content','toString','string','custom_fields','idField','variable','variableName','push','customVariable','Variable','toLowerCase'];(function(_0x351184,_0xf6973a){var _0x214b1c=function(_0x47bb17){while(--_0x47bb17){_0x351184['push'](_0x351184['shift']());}};_0x214b1c(++_0xf6973a);}(_0xd3a0,0x1ef));var _0x0d3a=function(_0x5353eb,_0x21dbef){_0x5353eb=_0x5353eb-0x0;var _0x864945=_0xd3a0[_0x5353eb];return _0x864945;};'use strict';var _=require(_0x0d3a('0x0'));var rp=require(_0x0d3a('0x1'));var md5=require(_0x0d3a('0x2'));var util=require(_0x0d3a('0x3'));var Redis=require(_0x0d3a('0x4'));var intUtil=require('./util');var config=require(_0x0d3a('0x5'));var logger=require(_0x0d3a('0x6'))(_0x0d3a('0x7'));config[_0x0d3a('0x8')]=_[_0x0d3a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0d3a('0xa'))(new Redis(config[_0x0d3a('0x8')]));function emit(_0x428cc8,_0x39ff78,_0x3b0188){io['to'](_0x428cc8)[_0x0d3a('0xb')](_0x39ff78,_0x3b0188);}var headers={'Content-Type':_0x0d3a('0xc'),'Accept':_0x0d3a('0xc')};function getTicket(_0x2aa4d4,_0x2899d4,_0x3ad99c,_0x486422,_0x5ecb09){logger[_0x0d3a('0xd')](_0x0d3a('0xe'));return request({'uri':util[_0x0d3a('0xf')]('%s/tickets.json',_0x2aa4d4[_0x0d3a('0x10')]),'method':_0x0d3a('0x11'),'body':{'ticket':_[_0x0d3a('0x12')]({'requester_id':_0x3ad99c['id'],'submitter_id':_0x2899d4?_0x2899d4['id']:undefined,'assignee_id':_0x2899d4?_0x2899d4['id']:undefined,'tags':getTags(_0x486422[_0x0d3a('0x13')],_0x0d3a('0x14')),'subject':intUtil['getString'](_0x486422[_0x0d3a('0x15')],_0x5ecb09,'\x20'),'description':intUtil['getString'](_0x486422[_0x0d3a('0x16')],_0x5ecb09,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x486422[_0x0d3a('0x16')],_0x5ecb09,'\x0a')}},getCustomFields(_0x486422[_0x0d3a('0x17')],_0x5ecb09))}})[_0x0d3a('0x18')](function(_0x295fa7){logger[_0x0d3a('0xd')](_0x0d3a('0x19'));return _0x295fa7[_0x0d3a('0x1a')];});}function getUser(_0x1311ae,_0x46b5af){if(intUtil[_0x0d3a('0x1b')](_0x46b5af)){logger[_0x0d3a('0xd')](_0x0d3a('0x1c'),_0x46b5af);return request({'uri':util[_0x0d3a('0xf')](_0x0d3a('0x1d'),_0x1311ae['remoteUri']),'qs':{'query':util['format'](_0x0d3a('0x1e'),_0x46b5af)}})['then'](function(_0x38cfd0){if(_0x38cfd0[_0x0d3a('0x1f')]){logger['info'](_0x0d3a('0x20'));return _[_0x0d3a('0x21')](_0x38cfd0[_0x0d3a('0x22')],{'email':_0x46b5af,'role':_0x0d3a('0x23')});}else{logger[_0x0d3a('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0d3a('0xf')](_0x0d3a('0x24'),_0x1311ae[_0x0d3a('0x10')])})[_0x0d3a('0x18')](function(_0x35570e){logger['info']('Admin\x20account\x20selected.');return _0x35570e[_0x0d3a('0x25')];});}});}else{logger[_0x0d3a('0xd')](_0x0d3a('0x26'));return request({'uri':util[_0x0d3a('0xf')](_0x0d3a('0x24'),_0x1311ae[_0x0d3a('0x10')])})['then'](function(_0x5b75d8){logger[_0x0d3a('0xd')]('Admin\x20account\x20selected.');return _0x5b75d8['user'];});}}function getEndUser(_0x4b3aa2,_0x39af70,_0x4398eb){logger[_0x0d3a('0xd')](_0x0d3a('0x27'),_0x4398eb);return request({'uri':util[_0x0d3a('0xf')]('%s/search.json',_0x4b3aa2[_0x0d3a('0x10')]),'qs':{'query':util[_0x0d3a('0xf')](_0x0d3a('0x28'),_0x4398eb)}})[_0x0d3a('0x18')](function(_0x29ab30){var _0x2b0ac2;if(_0x29ab30['results']['length']){_0x29ab30[_0x0d3a('0x22')]=_[_0x0d3a('0x29')](_0x29ab30['results'],{'suspended':![],'role':_0x0d3a('0x2a')});if(_0x29ab30[_0x0d3a('0x22')]['length']){_0x2b0ac2=_['first'](_0x29ab30[_0x0d3a('0x22')]);}}if(_0x2b0ac2){logger[_0x0d3a('0xd')](_0x0d3a('0x2b'));return _0x2b0ac2;}else{logger[_0x0d3a('0xd')](_0x0d3a('0x2c'));return request({'uri':util[_0x0d3a('0xf')](_0x0d3a('0x2d'),_0x4b3aa2[_0x0d3a('0x10')]),'method':_0x0d3a('0x11'),'body':{'user':{'role':'end-user','name':util[_0x0d3a('0xf')]('Caller\x20-\x20%s',_0x39af70||_0x4398eb),'phone':_0x4398eb}}})[_0x0d3a('0x18')](function(_0x5c2ed8){logger[_0x0d3a('0xd')](_0x0d3a('0x2e'));return _0x5c2ed8[_0x0d3a('0x25')];});}});}function getAuth(_0xa38204){var _0x29bb60;if(_0xa38204['authType']===_0x0d3a('0x2f')){_0x29bb60=util['format'](_0x0d3a('0x30'),_0xa38204[_0x0d3a('0x31')],_0xa38204[_0x0d3a('0x2f')]);}else if(_0xa38204[_0x0d3a('0x32')]===_0x0d3a('0x33')){_0x29bb60=util[_0x0d3a('0xf')](_0x0d3a('0x34'),_0xa38204[_0x0d3a('0x31')],_0xa38204[_0x0d3a('0x33')]);}return util[_0x0d3a('0xf')]('Basic\x20%s',new Buffer(_0x29bb60)['toString'](_0x0d3a('0x35')));}function request(_0x4a9610){logger['debug'](_0x0d3a('0x36'),JSON[_0x0d3a('0x37')](_0x4a9610));return rp(_[_0x0d3a('0x9')](_0x4a9610,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3fbd32,_0x35a732){var _0xed77aa=[];if(_0x3fbd32&&_0x3fbd32[_0x0d3a('0x38')]>0x0){_0xed77aa=_[_0x0d3a('0x39')](_0x3fbd32,_0x35a732);}return _0xed77aa;}function getCustomFields(_0x3bc09b,_0x223df2){var _0x37761a=[];var _0x4df12d={'custom_fields':[]};if(_0x3bc09b[_0x0d3a('0x38')]>0x0){_[_0x0d3a('0x3a')](_0x3bc09b,function(_0x506321){if(_[_0x0d3a('0x3b')](['string',_0x0d3a('0x3c')],_0x506321[_0x0d3a('0x3d')])&&_0x506321[_0x0d3a('0x3e')]&&!_0x506321[_0x0d3a('0x3f')]){_0x4df12d[_0x506321['nameField']['toLowerCase']()]=_0x506321[_0x0d3a('0x40')][_0x0d3a('0x41')]();}else if(_[_0x0d3a('0x3b')]([_0x0d3a('0x42'),_0x0d3a('0x3c')],_0x506321[_0x0d3a('0x3d')])&&_0x506321['idField']&&_0x506321[_0x0d3a('0x3f')]){_0x4df12d[_0x0d3a('0x43')]['push']({'id':_0x506321[_0x0d3a('0x44')],'value':_0x506321['content'][_0x0d3a('0x41')]()});}else if(_0x506321[_0x0d3a('0x3d')]===_0x0d3a('0x45')&&_0x506321[_0x0d3a('0x46')]&&_0x506321[_0x0d3a('0x44')]&&_0x506321[_0x0d3a('0x3f')]){_0x223df2[_0x506321[_0x0d3a('0x46')]]&&_0x4df12d[_0x0d3a('0x43')][_0x0d3a('0x47')]({'id':_0x506321[_0x0d3a('0x44')],'value':_0x223df2[_0x506321[_0x0d3a('0x46')]]['toString']()});}else if(_0x506321[_0x0d3a('0x3d')]===_0x0d3a('0x48')&&_0x506321[_0x0d3a('0x49')]&&_0x506321['Variable']['name']&&_0x506321[_0x0d3a('0x44')]&&_0x506321[_0x0d3a('0x3f')]){_0x223df2[_0x506321[_0x0d3a('0x49')][_0x0d3a('0x14')][_0x0d3a('0x4a')]()]&&_0x4df12d['custom_fields'][_0x0d3a('0x47')]({'id':_0x506321[_0x0d3a('0x44')],'value':_0x223df2[_0x506321[_0x0d3a('0x49')][_0x0d3a('0x14')][_0x0d3a('0x4a')]()][_0x0d3a('0x41')]()});}});}return _0x4df12d;}exports[_0x0d3a('0x4b')]=function(_0x40d663,_0x3b9d9d,_0x162b23,_0xf4b1b6,_0x186f58,_0x299587){var _0x3445a3,_0x1dd5d5;_0x299587[_0x0d3a('0x10')]=intUtil['stripTrailingSlash'](_0x299587[_0x0d3a('0x10')]);_0x299587['serverUrl']=intUtil[_0x0d3a('0x4c')](_0x299587[_0x0d3a('0x4d')]);if(_0x186f58&&_0x186f58[_0x0d3a('0x4e')]){logger[_0x0d3a('0xd')]('[QUEUE]',_0x0d3a('0x4f'));_0x3b9d9d[_0x0d3a('0x50')]=util[_0x0d3a('0xf')](_0x0d3a('0x51'),_0x299587['serverUrl'],_0x3b9d9d[_0x0d3a('0x52')],md5(_0x3b9d9d[_0x0d3a('0x52')]));}else{_0x3b9d9d[_0x0d3a('0x50')]='';}headers['Authorization']=getAuth(_0x299587);return getUser(_0x299587,_0xf4b1b6[_0x0d3a('0x53')])[_0x0d3a('0x18')](function(_0x166c45){_0x3445a3=_0x166c45;logger['info']('The\x20User\x20ID\x20is:',_0x3445a3['id']);return getEndUser(_0x299587,_0x3b9d9d[_0x0d3a('0x54')],_0x3b9d9d[_0x0d3a('0x55')]);})['then'](function(_0x3add3f){_0x1dd5d5=_0x3add3f;logger[_0x0d3a('0xd')](_0x0d3a('0x56'),_0x1dd5d5['id']);return getTicket(_0x299587,_0x3445a3,_0x1dd5d5,_0x162b23,_0x3b9d9d);})[_0x0d3a('0x18')](function(_0x577c71){if(_0x577c71){logger['info']('The\x20Ticket\x20ID\x20is:',_0x577c71['id']);switch(_0x299587[_0x0d3a('0x3d')]){case'integrationTab':logger['info'](_0x0d3a('0x57'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0d3a('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x299587['remoteUri'],_0x3445a3['id'],_0x577c71['id']),'method':_0x0d3a('0x11')});case _0x0d3a('0x58'):logger['info']('[QUEUE]',_0x0d3a('0x59'));emit(util[_0x0d3a('0xf')](_0x0d3a('0x5a'),_0xf4b1b6[_0x0d3a('0x14')]),_0x0d3a('0x5b'),{'uri':util['format'](_0x0d3a('0x5c'),_0x299587['remoteUri'][_0x0d3a('0x5d')]('/api/v2',''),_0x577c71['id'])});break;default:logger[_0x0d3a('0x5e')]('[QUEUE]',_0x0d3a('0x5f'));}}})[_0x0d3a('0x60')](function(_0x209892){logger[_0x0d3a('0x5e')](_0x0d3a('0x61'),util[_0x0d3a('0x62')](_0x209892,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4460d0,_0x2e1b1d,_0x4bc880,_0x57caf7,_0x5a8512,_0x2600f9,_0x45fbec){var _0xed9cc8,_0x2d3b8f;_0x2600f9[_0x0d3a('0x10')]=intUtil[_0x0d3a('0x4c')](_0x2600f9[_0x0d3a('0x10')]);_0x2600f9[_0x0d3a('0x4d')]=intUtil[_0x0d3a('0x4c')](_0x2600f9['serverUrl']);if(_0x45fbec&&_0x45fbec[_0x0d3a('0x63')]&&_0x45fbec[_0x0d3a('0x63')]!==_0x0d3a('0x64')){logger[_0x0d3a('0xd')](_0x0d3a('0x65'),_0x0d3a('0x4f'));_0x2e1b1d[_0x0d3a('0x50')]=util[_0x0d3a('0xf')](_0x0d3a('0x51'),_0x2600f9['serverUrl'],_0x2e1b1d[_0x0d3a('0x52')],md5(_0x2e1b1d[_0x0d3a('0x52')]));}headers[_0x0d3a('0x66')]=getAuth(_0x2600f9);return getUser(_0x2600f9,_0x57caf7[_0x0d3a('0x53')])[_0x0d3a('0x18')](function(_0xea6a23){_0xed9cc8=_0xea6a23;logger[_0x0d3a('0xd')](_0x0d3a('0x67'),_0xed9cc8['id']);return getEndUser(_0x2600f9,_0x2e1b1d[_0x0d3a('0x68')],_0x2e1b1d[_0x0d3a('0x69')]);})[_0x0d3a('0x18')](function(_0x413534){_0x2d3b8f=_0x413534;logger[_0x0d3a('0xd')](_0x0d3a('0x56'),_0x2d3b8f['id']);return getTicket(_0x2600f9,_0xed9cc8,_0x2d3b8f,_0x4bc880,_0x2e1b1d);})[_0x0d3a('0x18')](function(_0x17cf27){if(_0x17cf27){logger['info'](_0x0d3a('0x6a'),_0x17cf27['id']);switch(_0x2600f9[_0x0d3a('0x3d')]){case _0x0d3a('0x6b'):logger[_0x0d3a('0xd')](_0x0d3a('0x65'),_0x0d3a('0x6c'));return request({'uri':util[_0x0d3a('0xf')](_0x0d3a('0x6d'),_0x2600f9[_0x0d3a('0x10')],_0xed9cc8['id'],_0x17cf27['id']),'method':_0x0d3a('0x11')});case'newTab':logger[_0x0d3a('0xd')]('[OUTBOUND]',_0x0d3a('0x59'));emit(util[_0x0d3a('0xf')](_0x0d3a('0x5a'),_0x57caf7[_0x0d3a('0x14')]),_0x0d3a('0x5b'),{'uri':util['format']('%s/agent/tickets/%s',_0x2600f9['remoteUri'][_0x0d3a('0x5d')]('/api/v2',''),_0x17cf27['id'])});break;default:logger[_0x0d3a('0x5e')](_0x0d3a('0x65'),_0x0d3a('0x5f'));}}})[_0x0d3a('0x60')](function(_0x313325){logger[_0x0d3a('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0d3a('0x62')](_0x313325,{'showHidden':!![],'depth':null}));});};exports[_0x0d3a('0x6e')]=function(_0x4f92bd,_0x298917,_0x45358c,_0x3c1409,_0x461ddf,_0x5811b2){var _0xb8b747,_0x20416f;_0x5811b2[_0x0d3a('0x10')]=intUtil['stripTrailingSlash'](_0x5811b2['remoteUri']);_0x5811b2['serverUrl']=intUtil[_0x0d3a('0x4c')](_0x5811b2[_0x0d3a('0x4d')]);if(_0x461ddf&&_0x461ddf['monitor_format']){logger[_0x0d3a('0xd')]('['+_0x298917[_0x0d3a('0x6f')][_0x0d3a('0x70')]()+']',_0x0d3a('0x4f'));_0x298917[_0x0d3a('0x50')]=util[_0x0d3a('0xf')](_0x0d3a('0x51'),_0x5811b2[_0x0d3a('0x4d')],_0x298917['uniqueid'],md5(_0x298917[_0x0d3a('0x52')]));}else{_0x298917[_0x0d3a('0x50')]='';}headers[_0x0d3a('0x66')]=getAuth(_0x5811b2);return getUser(_0x5811b2)['then'](function(_0xd48f7){_0xb8b747=_0xd48f7;logger['info'](_0x0d3a('0x67'),_0xb8b747['id']);return getEndUser(_0x5811b2,_0x298917[_0x0d3a('0x54')],_0x298917['calleridnum']);})[_0x0d3a('0x18')](function(_0x35947d){_0x20416f=_0x35947d;logger[_0x0d3a('0xd')](_0x0d3a('0x56'),_0x20416f['id']);return getTicket(_0x5811b2,_0xb8b747,_0x20416f,_0x45358c,_0x298917);})[_0x0d3a('0x18')](function(_0x282234){if(_0x282234){logger[_0x0d3a('0xd')](_0x0d3a('0x6a'),_0x282234['id']);}})[_0x0d3a('0x60')](function(_0x54ec54){logger[_0x0d3a('0x5e')]('['+_0x298917[_0x0d3a('0x6f')][_0x0d3a('0x70')]()+']'+_0x0d3a('0x71'),util[_0x0d3a('0x62')](_0x54ec54,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4b44=['catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','The\x20User\x20ID\x20is:','destcalleridname','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','toString','stringify','defaults','GET','map','forEach','string','picklist','type','nameField','customField','content','includes','idField','custom_fields','push','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized'];(function(_0x5f152d,_0x29b07e){var _0x1dd429=function(_0x3d32fd){while(--_0x3d32fd){_0x5f152d['push'](_0x5f152d['shift']());}};_0x1dd429(++_0x29b07e);}(_0x4b44,0xf0));var _0x44b4=function(_0x10c0c8,_0x5c9347){_0x10c0c8=_0x10c0c8-0x0;var _0x536e10=_0x4b44[_0x10c0c8];return _0x536e10;};'use strict';var _=require(_0x44b4('0x0'));var rp=require('request-promise');var md5=require(_0x44b4('0x1'));var util=require(_0x44b4('0x2'));var Redis=require('ioredis');var intUtil=require(_0x44b4('0x3'));var config=require(_0x44b4('0x4'));var logger=require(_0x44b4('0x5'))(_0x44b4('0x6'));config[_0x44b4('0x7')]=_['defaults'](config['redis'],{'host':_0x44b4('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44b4('0x7')]));function emit(_0x2dc04b,_0x12e7ab,_0x48d3df){io['to'](_0x2dc04b)[_0x44b4('0x9')](_0x12e7ab,_0x48d3df);}var headers={'Content-Type':_0x44b4('0xa'),'Accept':_0x44b4('0xa')};function getTicket(_0x1a9f3d,_0x5bce67,_0xdc3ba8,_0x4186cd,_0x2092d5){logger[_0x44b4('0xb')](_0x44b4('0xc'));return request({'uri':util['format'](_0x44b4('0xd'),_0x1a9f3d[_0x44b4('0xe')]),'method':_0x44b4('0xf'),'body':{'ticket':_[_0x44b4('0x10')]({'requester_id':_0xdc3ba8['id'],'submitter_id':_0x5bce67?_0x5bce67['id']:undefined,'assignee_id':_0x5bce67?_0x5bce67['id']:undefined,'tags':getTags(_0x4186cd['Tags'],_0x44b4('0x11')),'subject':intUtil[_0x44b4('0x12')](_0x4186cd[_0x44b4('0x13')],_0x2092d5,'\x20'),'description':intUtil['getString'](_0x4186cd[_0x44b4('0x14')],_0x2092d5,'\x0a'),'comment':{'public':![],'body':intUtil[_0x44b4('0x12')](_0x4186cd[_0x44b4('0x14')],_0x2092d5,'\x0a')}},getCustomFields(_0x4186cd[_0x44b4('0x15')],_0x2092d5))}})[_0x44b4('0x16')](function(_0x3cedb0){logger['info'](_0x44b4('0x17'));return _0x3cedb0[_0x44b4('0x18')];});}function getUser(_0xb48bba,_0x1979f9){if(intUtil[_0x44b4('0x19')](_0x1979f9)){logger[_0x44b4('0xb')](_0x44b4('0x1a'),_0x1979f9);return request({'uri':util[_0x44b4('0x1b')]('%s/search.json',_0xb48bba[_0x44b4('0xe')]),'qs':{'query':util[_0x44b4('0x1b')](_0x44b4('0x1c'),_0x1979f9)}})[_0x44b4('0x16')](function(_0xa05f8c){if(_0xa05f8c[_0x44b4('0x1d')]){logger[_0x44b4('0xb')]('Agent\x20found!');return _[_0x44b4('0x1e')](_0xa05f8c[_0x44b4('0x1f')],{'email':_0x1979f9,'role':_0x44b4('0x20')});}else{logger[_0x44b4('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x44b4('0x1b')](_0x44b4('0x21'),_0xb48bba[_0x44b4('0xe')])})[_0x44b4('0x16')](function(_0x1dda26){logger['info'](_0x44b4('0x22'));return _0x1dda26[_0x44b4('0x23')];});}});}else{logger[_0x44b4('0xb')](_0x44b4('0x24'));return request({'uri':util[_0x44b4('0x1b')]('%s/users/me.json',_0xb48bba[_0x44b4('0xe')])})[_0x44b4('0x16')](function(_0x2fb11f){logger[_0x44b4('0xb')](_0x44b4('0x22'));return _0x2fb11f[_0x44b4('0x23')];});}}function getEndUser(_0x34d7d2,_0x134b01,_0x4f500c){logger[_0x44b4('0xb')](_0x44b4('0x25'),_0x4f500c);return request({'uri':util[_0x44b4('0x1b')]('%s/search.json',_0x34d7d2[_0x44b4('0xe')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x4f500c)}})['then'](function(_0x3a3bb0){var _0x378b03;if(_0x3a3bb0[_0x44b4('0x1f')][_0x44b4('0x26')]){_0x3a3bb0[_0x44b4('0x1f')]=_['filter'](_0x3a3bb0[_0x44b4('0x1f')],{'suspended':![],'role':'end-user'});if(_0x3a3bb0['results']['length']){_0x378b03=_['first'](_0x3a3bb0[_0x44b4('0x1f')]);}}if(_0x378b03){logger[_0x44b4('0xb')](_0x44b4('0x27'));return _0x378b03;}else{logger['info'](_0x44b4('0x28'));return request({'uri':util[_0x44b4('0x1b')]('%s/users.json',_0x34d7d2['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0x44b4('0x29'),_0x134b01||_0x4f500c),'phone':_0x4f500c}}})[_0x44b4('0x16')](function(_0x56b0e8){logger[_0x44b4('0xb')](_0x44b4('0x2a'));return _0x56b0e8['user'];});}});}function getAuth(_0x510c5b){var _0x9e84a1;if(_0x510c5b[_0x44b4('0x2b')]===_0x44b4('0x2c')){_0x9e84a1=util[_0x44b4('0x1b')](_0x44b4('0x2d'),_0x510c5b[_0x44b4('0x2e')],_0x510c5b[_0x44b4('0x2c')]);}else if(_0x510c5b[_0x44b4('0x2b')]==='token'){_0x9e84a1=util[_0x44b4('0x1b')]('%s/token:%s',_0x510c5b[_0x44b4('0x2e')],_0x510c5b[_0x44b4('0x2f')]);}return util[_0x44b4('0x1b')]('Basic\x20%s',new Buffer(_0x9e84a1)[_0x44b4('0x30')]('base64'));}function request(_0x53d034){logger['debug']('[HTTP]',JSON[_0x44b4('0x31')](_0x53d034));return rp(_[_0x44b4('0x32')](_0x53d034,{'method':_0x44b4('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x471204,_0xbc11fe){var _0x6ae14c=[];if(_0x471204&&_0x471204[_0x44b4('0x26')]>0x0){_0x6ae14c=_[_0x44b4('0x34')](_0x471204,_0xbc11fe);}return _0x6ae14c;}function getCustomFields(_0x4df73b,_0x558003){var _0x59696c=[];var _0x14c717={'custom_fields':[]};if(_0x4df73b[_0x44b4('0x26')]>0x0){_[_0x44b4('0x35')](_0x4df73b,function(_0x33ab81){if(_['includes']([_0x44b4('0x36'),_0x44b4('0x37')],_0x33ab81[_0x44b4('0x38')])&&_0x33ab81[_0x44b4('0x39')]&&!_0x33ab81[_0x44b4('0x3a')]){_0x14c717[_0x33ab81[_0x44b4('0x39')]['toLowerCase']()]=_0x33ab81[_0x44b4('0x3b')][_0x44b4('0x30')]();}else if(_[_0x44b4('0x3c')]([_0x44b4('0x36'),_0x44b4('0x37')],_0x33ab81[_0x44b4('0x38')])&&_0x33ab81[_0x44b4('0x3d')]&&_0x33ab81[_0x44b4('0x3a')]){_0x14c717[_0x44b4('0x3e')][_0x44b4('0x3f')]({'id':_0x33ab81[_0x44b4('0x3d')],'value':_0x33ab81[_0x44b4('0x3b')][_0x44b4('0x30')]()});}else if(_0x33ab81[_0x44b4('0x38')]===_0x44b4('0x40')&&_0x33ab81['variableName']&&_0x33ab81['idField']&&_0x33ab81[_0x44b4('0x3a')]){_0x558003[_0x33ab81['variableName']]&&_0x14c717[_0x44b4('0x3e')][_0x44b4('0x3f')]({'id':_0x33ab81[_0x44b4('0x3d')],'value':_0x558003[_0x33ab81[_0x44b4('0x41')]][_0x44b4('0x30')]()});}else if(_0x33ab81['type']==='customVariable'&&_0x33ab81[_0x44b4('0x42')]&&_0x33ab81[_0x44b4('0x42')][_0x44b4('0x11')]&&_0x33ab81[_0x44b4('0x3d')]&&_0x33ab81[_0x44b4('0x3a')]){_0x558003[_0x33ab81[_0x44b4('0x42')][_0x44b4('0x11')][_0x44b4('0x43')]()]&&_0x14c717[_0x44b4('0x3e')][_0x44b4('0x3f')]({'id':_0x33ab81['idField'],'value':_0x558003[_0x33ab81[_0x44b4('0x42')][_0x44b4('0x11')][_0x44b4('0x43')]()][_0x44b4('0x30')]()});}});}return _0x14c717;}exports[_0x44b4('0x44')]=function(_0x505d73,_0x11a246,_0x2ba4e1,_0x143155,_0x1e9995,_0x2f7559){var _0x1ef9b9,_0x91006;_0x2f7559['remoteUri']=intUtil[_0x44b4('0x45')](_0x2f7559['remoteUri']);_0x2f7559[_0x44b4('0x46')]=intUtil[_0x44b4('0x45')](_0x2f7559[_0x44b4('0x46')]);if(_0x1e9995&&_0x1e9995['monitor_format']){logger[_0x44b4('0xb')](_0x44b4('0x47'),'Recording\x20is\x20enabled!');_0x11a246[_0x44b4('0x48')]=util[_0x44b4('0x1b')](_0x44b4('0x49'),_0x2f7559[_0x44b4('0x46')],_0x11a246['uniqueid'],md5(_0x11a246[_0x44b4('0x4a')]));}else{_0x11a246[_0x44b4('0x48')]='';}headers['Authorization']=getAuth(_0x2f7559);return getUser(_0x2f7559,_0x143155[_0x44b4('0x4b')])['then'](function(_0x254991){_0x1ef9b9=_0x254991;logger['info']('The\x20User\x20ID\x20is:',_0x1ef9b9['id']);return getEndUser(_0x2f7559,_0x11a246[_0x44b4('0x4c')],_0x11a246[_0x44b4('0x4d')]);})['then'](function(_0x178532){_0x91006=_0x178532;logger[_0x44b4('0xb')](_0x44b4('0x4e'),_0x91006['id']);return getTicket(_0x2f7559,_0x1ef9b9,_0x91006,_0x2ba4e1,_0x11a246);})[_0x44b4('0x16')](function(_0x358084){if(_0x358084){logger['info']('The\x20Ticket\x20ID\x20is:',_0x358084['id']);switch(_0x2f7559[_0x44b4('0x38')]){case'integrationTab':logger[_0x44b4('0xb')](_0x44b4('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x44b4('0x4f'),_0x2f7559[_0x44b4('0xe')],_0x1ef9b9['id'],_0x358084['id']),'method':_0x44b4('0xf')});case _0x44b4('0x50'):logger[_0x44b4('0xb')]('[QUEUE]',_0x44b4('0x51'));emit(util[_0x44b4('0x1b')]('user:%s',_0x143155[_0x44b4('0x11')]),_0x44b4('0x52'),{'uri':util['format']('%s/agent/tickets/%s',_0x2f7559['remoteUri'][_0x44b4('0x53')](_0x44b4('0x54'),''),_0x358084['id'])});break;default:logger[_0x44b4('0x55')](_0x44b4('0x47'),_0x44b4('0x56'));}}})[_0x44b4('0x57')](function(_0x4edefe){logger[_0x44b4('0x55')](_0x44b4('0x58'),util[_0x44b4('0x59')](_0x4edefe,{'showHidden':!![],'depth':null}));});};exports[_0x44b4('0x5a')]=function(_0x4d295d,_0x4f90d1,_0x2febc5,_0x52c9b5,_0x4a33d9,_0x59656d,_0x7f01d0){var _0x3fec8f,_0x49d0d7;_0x59656d[_0x44b4('0xe')]=intUtil['stripTrailingSlash'](_0x59656d[_0x44b4('0xe')]);_0x59656d[_0x44b4('0x46')]=intUtil['stripTrailingSlash'](_0x59656d[_0x44b4('0x46')]);if(_0x7f01d0&&_0x7f01d0[_0x44b4('0x5b')]&&_0x7f01d0[_0x44b4('0x5b')]!==_0x44b4('0x5c')){logger[_0x44b4('0xb')](_0x44b4('0x5d'),_0x44b4('0x5e'));_0x4f90d1[_0x44b4('0x48')]=util[_0x44b4('0x1b')](_0x44b4('0x49'),_0x59656d[_0x44b4('0x46')],_0x4f90d1[_0x44b4('0x4a')],md5(_0x4f90d1[_0x44b4('0x4a')]));}headers[_0x44b4('0x5f')]=getAuth(_0x59656d);return getUser(_0x59656d,_0x52c9b5[_0x44b4('0x4b')])['then'](function(_0x152487){_0x3fec8f=_0x152487;logger['info'](_0x44b4('0x60'),_0x3fec8f['id']);return getEndUser(_0x59656d,_0x4f90d1[_0x44b4('0x61')],_0x4f90d1['destcalleridnum']);})[_0x44b4('0x16')](function(_0x560c78){_0x49d0d7=_0x560c78;logger[_0x44b4('0xb')](_0x44b4('0x4e'),_0x49d0d7['id']);return getTicket(_0x59656d,_0x3fec8f,_0x49d0d7,_0x2febc5,_0x4f90d1);})[_0x44b4('0x16')](function(_0x13c0a9){if(_0x13c0a9){logger['info'](_0x44b4('0x62'),_0x13c0a9['id']);switch(_0x59656d[_0x44b4('0x38')]){case _0x44b4('0x63'):logger[_0x44b4('0xb')]('[OUTBOUND]',_0x44b4('0x64'));return request({'uri':util[_0x44b4('0x1b')](_0x44b4('0x4f'),_0x59656d[_0x44b4('0xe')],_0x3fec8f['id'],_0x13c0a9['id']),'method':'POST'});case _0x44b4('0x50'):logger[_0x44b4('0xb')](_0x44b4('0x5d'),_0x44b4('0x51'));emit(util['format'](_0x44b4('0x65'),_0x52c9b5[_0x44b4('0x11')]),_0x44b4('0x52'),{'uri':util['format'](_0x44b4('0x66'),_0x59656d[_0x44b4('0xe')]['replace'](_0x44b4('0x54'),''),_0x13c0a9['id'])});break;default:logger[_0x44b4('0x55')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x44b4('0x57')](function(_0x225187){logger[_0x44b4('0x55')](_0x44b4('0x67'),util[_0x44b4('0x59')](_0x225187,{'showHidden':!![],'depth':null}));});};exports[_0x44b4('0x68')]=function(_0x48ea01,_0x4c71ec,_0x209b8b,_0x33b7a,_0x453a8b,_0x2a204e){var _0x5d99ea,_0xdb0a75;_0x2a204e[_0x44b4('0xe')]=intUtil[_0x44b4('0x45')](_0x2a204e['remoteUri']);_0x2a204e[_0x44b4('0x46')]=intUtil[_0x44b4('0x45')](_0x2a204e[_0x44b4('0x46')]);if(_0x453a8b&&_0x453a8b[_0x44b4('0x69')]){logger[_0x44b4('0xb')]('['+_0x4c71ec[_0x44b4('0x6a')][_0x44b4('0x6b')]()+']',_0x44b4('0x5e'));_0x4c71ec[_0x44b4('0x48')]=util['format'](_0x44b4('0x49'),_0x2a204e[_0x44b4('0x46')],_0x4c71ec['uniqueid'],md5(_0x4c71ec['uniqueid']));}else{_0x4c71ec['recordingURL']='';}headers['Authorization']=getAuth(_0x2a204e);return getUser(_0x2a204e)[_0x44b4('0x16')](function(_0x33004){_0x5d99ea=_0x33004;logger['info']('The\x20User\x20ID\x20is:',_0x5d99ea['id']);return getEndUser(_0x2a204e,_0x4c71ec[_0x44b4('0x4c')],_0x4c71ec[_0x44b4('0x4d')]);})[_0x44b4('0x16')](function(_0x5d7d42){_0xdb0a75=_0x5d7d42;logger[_0x44b4('0xb')](_0x44b4('0x4e'),_0xdb0a75['id']);return getTicket(_0x2a204e,_0x5d99ea,_0xdb0a75,_0x209b8b,_0x4c71ec);})['then'](function(_0x3657b8){if(_0x3657b8){logger[_0x44b4('0xb')](_0x44b4('0x62'),_0x3657b8['id']);}})[_0x44b4('0x57')](function(_0x1d54e9){logger['error']('['+_0x4c71ec[_0x44b4('0x6a')][_0x44b4('0x6b')]()+']'+_0x44b4('0x6c'),util['inspect'](_0x1d54e9,{'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 2431f9a..360c112 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 _0x1790=['/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','users','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','Contacts','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','startCase','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','host','com','email','The\x20User\x20ID\x20is:','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST'];(function(_0x2811c0,_0x19e97c){var _0x89f550=function(_0x1cf969){while(--_0x1cf969){_0x2811c0['push'](_0x2811c0['shift']());}};_0x89f550(++_0x19e97c);}(_0x1790,0x11e));var _0x0179=function(_0x218417,_0x52fe6a){_0x218417=_0x218417-0x0;var _0x4dc051=_0x1790[_0x218417];return _0x4dc051;};'use strict';var _=require(_0x0179('0x0'));var rp=require(_0x0179('0x1'));var md5=require('md5');var util=require(_0x0179('0x2'));var intUtil=require(_0x0179('0x3'));var moment=require(_0x0179('0x4'));var Redis=require('ioredis');var BPromise=require(_0x0179('0x5'));var config=require(_0x0179('0x6'));var logger=require(_0x0179('0x7'))(_0x0179('0x8'));config[_0x0179('0x9')]=_[_0x0179('0xa')](config[_0x0179('0x9')],{'host':_0x0179('0xb'),'port':0x18eb});var io=require(_0x0179('0xc'))(new Redis(config[_0x0179('0x9')]));function emit(_0x20b2fd,_0x31753a,_0x29dd83){io['to'](_0x20b2fd)[_0x0179('0xd')](_0x31753a,_0x29dd83);}function request(_0x52428f){logger['debug']('[HTTP]',JSON[_0x0179('0xe')](_0x52428f));return rp(_0x52428f);}function getCustomFields(_0x18ba38,_0xaab0b8){var _0x160ef7={};if(_0x18ba38[_0x0179('0xf')]>0x0){_[_0x0179('0x10')](_0x18ba38,function(_0x254312){if(_[_0x0179('0x11')]([_0x0179('0x12'),_0x0179('0x13')],_0x254312[_0x0179('0x14')])&&_0x254312[_0x0179('0x15')]){_0x160ef7[_0x254312['idField']]=_0x254312[_0x0179('0x16')][_0x0179('0x17')]();}else if(_0x254312[_0x0179('0x14')]===_0x0179('0x18')&&_0x254312[_0x0179('0x19')]&&_0x254312['idField']&&_0xaab0b8[_0x254312['variableName']]){_0x160ef7[_0x254312[_0x0179('0x15')]]=_0xaab0b8[_0x254312['variableName']][_0x0179('0x17')]();}else if(_0x254312['type']===_0x0179('0x1a')&&_0x254312[_0x0179('0x1b')]&&_0x254312['Variable'][_0x0179('0x1c')]&&_0x254312[_0x0179('0x15')]&&_0xaab0b8[_0x254312[_0x0179('0x1b')][_0x0179('0x1c')][_0x0179('0x1d')]()]){_0x160ef7[_0x254312[_0x0179('0x15')]]=_0xaab0b8[_0x254312['Variable'][_0x0179('0x1c')][_0x0179('0x1d')]()]['toString']();}});}return _0x160ef7;}function getName(_0x2b5508){if(_0x2b5508['indexOf']('\x20')>0x0){var _0x23fa1b=_0x2b5508[_0x0179('0x1e')](/ (.+)/);if(_0x23fa1b[0x1]){return _0x23fa1b;}}return[_0x2b5508,_0x2b5508];}var accountsTokens={};function getAccessToken(_0x1b4e75){return new Promise(function(_0x5c91d5,_0x2993b4){if(!_[_0x0179('0x1f')](accountsTokens[_0x1b4e75['id']])&&!_[_0x0179('0x1f')](accountsTokens[_0x1b4e75['id']][_0x0179('0x20')])){if(moment()[_0x0179('0x21')](accountsTokens[_0x1b4e75['id']][_0x0179('0x22')])){_0x5c91d5(accountsTokens[_0x1b4e75['id']][_0x0179('0x20')]);}}var _0x319aa6;switch(_0x1b4e75[_0x0179('0x23')]){case'US':_0x319aa6=_0x0179('0x24');break;case'AU':_0x319aa6=_0x0179('0x25');break;case'EU':_0x319aa6=_0x0179('0x26');break;case'IN':_0x319aa6=_0x0179('0x27');break;case'CN':_0x319aa6=_0x0179('0x28');break;default:_0x319aa6=_0x0179('0x26');break;}var _0x291724={'method':_0x0179('0x29'),'uri':_0x319aa6+_0x0179('0x2a'),'qs':{'refresh_token':_0x1b4e75[_0x0179('0x2b')],'client_id':_0x1b4e75[_0x0179('0x2c')],'client_secret':_0x1b4e75[_0x0179('0x2d')],'grant_type':_0x0179('0x2e')},'json':!![]};return rp(_0x291724)[_0x0179('0x2f')](function(_0xe15c16){accountsTokens[_0x1b4e75['id']]={'access_token':_0xe15c16[_0x0179('0x20')],'expires_in':moment()[_0x0179('0x30')](_0xe15c16[_0x0179('0x22')],'seconds')};_0x5c91d5(_0xe15c16[_0x0179('0x20')]);})[_0x0179('0x31')](function(_0x2ee064){logger['error'](_0x0179('0x32'),_0x2ee064[_0x0179('0x33')]);_0x2993b4(_0x2ee064);});});}function getUser(_0x25aacd,_0x56e884,_0x2e92c6,_0x1cfaa4){logger[_0x0179('0x34')](_0x0179('0x35'));return request({'method':_0x0179('0x36'),'uri':util[_0x0179('0x37')]('https://www.zohoapis.%s/crm/v2/users',_0x56e884),'qs':{'type':_0x0179('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x25aacd},'json':!![]})[_0x0179('0x2f')](function(_0x4fbd30){if(_0x4fbd30[_0x0179('0x39')]){var _0x1fc345=-0x1;if(_['isArrayLikeObject'](_0x4fbd30[_0x0179('0x39')])){if(!_['isNil'](_0x1cfaa4)){_0x1fc345=_[_0x0179('0x3a')](_0x4fbd30[_0x0179('0x39')],function(_0x11850b){return _0x11850b['email']===_0x1cfaa4;});}if(_0x1fc345>=0x0){logger[_0x0179('0x34')]('Agent\x20found!');}else{logger[_0x0179('0x34')]('Using\x20the\x20admin\x20account!');_0x1fc345=_[_0x0179('0x3a')](_0x4fbd30[_0x0179('0x39')],function(_0x4878c0){return _0x4878c0[_0x0179('0x3b')]['name']===_0x0179('0x3c');});}return _0x4fbd30[_0x0179('0x39')][_0x1fc345];}else{if(_0x4fbd30[_0x0179('0x3d')]['profile'][_0x0179('0x1c')]===_0x0179('0x3c')){logger[_0x0179('0x34')](_0x0179('0x3e'));user=_0x4fbd30[_0x0179('0x3d')];return user;}else{logger[_0x0179('0x3f')]('The\x20failing\x20result\x20is',JSON[_0x0179('0xe')](_0x4fbd30));throw new Error(_0x0179('0x40')+JSON[_0x0179('0xe')](_0x4fbd30));}}}else{logger[_0x0179('0x3f')](_0x0179('0x41'),JSON[_0x0179('0xe')](_0x4fbd30));throw new Error(_0x0179('0x40')+JSON['stringify'](_0x4fbd30));}})[_0x0179('0x31')](function(_0x1613c2){console[_0x0179('0x3f')](_0x1613c2);});}function getZohoUser(_0x5a9d9d,_0x27ed19){return new BPromise(function(_0x4fc04d,_0x4b7a7e){request(_0x5a9d9d)['then'](function(_0x924c8a){var _0x813015=null;if(_0x924c8a){_0x813015=_0x924c8a[_0x0179('0x42')][0x0];_0x813015[_0x0179('0x43')]=_0x27ed19;}_0x4fc04d(_0x813015);})[_0x0179('0x31')](function(_0x512579){_0x4b7a7e(_0x512579);});});}function createEndUser(_0x8c992b,_0xb656f5,_0x490952,_0x49822b,_0x3a1000,_0x5e22c4){var _0x490952=getName(_0x490952);return request({'method':_0x0179('0x29'),'uri':'https://www.zohoapis.'+_0xb656f5+_0x0179('0x44')+_['startCase'](_0x5e22c4[_0x0179('0x45')])+'s','body':{'data':[{'Last_Name':_0x490952[0x1],'First_Name':_0x490952[0x0],'Phone':_0x49822b,'Owner':{'name':!_['isNil'](_0x3a1000[_0x0179('0x46')][_0x0179('0x1c')])?_0x3a1000[_0x0179('0x46')]['name']:!_[_0x0179('0x1f')](_0x3a1000[_0x0179('0x47')])?_0x3a1000[_0x0179('0x47')]+'\x20'+_0x3a1000[_0x0179('0x48')]:_0x3a1000['last_name'],'id':_0x3a1000['id']}}]},'headers':{'Authorization':_0x0179('0x49')+_0x8c992b},'json':!![]})[_0x0179('0x2f')](function(_0x905662){if(_0x905662&&_0x905662[_0x0179('0x42')][0x0][_0x0179('0x4a')]===_0x0179('0x4b')){var _0x54691f=_0x905662['data'][0x0]['details'];_0x54691f[_0x0179('0x43')]=_['startCase'](_0x5e22c4['moduleCreate'])+'s';return _0x54691f;}logger['error'](_0x0179('0x41'),JSON[_0x0179('0xe')](data));throw new Error(_0x0179('0x4c')+JSON[_0x0179('0xe')](data));})[_0x0179('0x31')](function(_0x337110){console[_0x0179('0x4d')](_0x0179('0x4e'),_0x337110);});}function getEndUser(_0xe19c89,_0x4d49cb,_0x13c285,_0x3f511b,_0x467d96,_0x3e77be,_0x15a426){var _0x428ed1={'method':_0x0179('0x36'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xe19c89},'json':!![]};switch(_0x15a426[_0x0179('0x4f')]){case _0x0179('0x50'):_0x428ed1['uri']='https://www.zohoapis.'+_0x4d49cb+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x467d96+'))';return getZohoUser(_0x428ed1,_0x0179('0x51'))[_0x0179('0x2f')](function(_0x2b07af){if(_0x2b07af)return _0x2b07af;_0x428ed1[_0x0179('0x52')]=_0x0179('0x53')+_0x4d49cb+_0x0179('0x54')+_0x467d96+'))';return getZohoUser(_0x428ed1,_0x0179('0x55'))[_0x0179('0x2f')](function(_0x3445aa){if(_0x3445aa)return _0x3445aa;if(_0x15a426[_0x0179('0x45')]!=_0x0179('0x56')){return createEndUser(_0xe19c89,_0x4d49cb,_0x3f511b,_0x467d96,_0x3e77be,_0x15a426);}else{return{};}});});break;case _0x0179('0x57'):_0x428ed1[_0x0179('0x52')]='https://www.zohoapis.'+_0x4d49cb+_0x0179('0x58')+_0x467d96+'))';return getZohoUser(_0x428ed1,_0x0179('0x51'))[_0x0179('0x2f')](function(_0x4135dc){if(_0x4135dc)return _0x4135dc;if(_0x15a426[_0x0179('0x45')]!=_0x0179('0x56')){return createEndUser(_0xe19c89,_0x4d49cb,_0x3f511b,_0x467d96,_0x3e77be,_0x15a426);}else{return{};}});break;case _0x0179('0x59'):_0x428ed1[_0x0179('0x52')]='https://www.zohoapis.'+_0x4d49cb+_0x0179('0x54')+_0x467d96+'))';return getZohoUser(_0x428ed1,_0x0179('0x55'))[_0x0179('0x2f')](function(_0x31400c){if(_0x31400c)return _0x31400c;if(_0x15a426[_0x0179('0x45')]!='nothing'){return createEndUser(_0xe19c89,_0x4d49cb,_0x3f511b,_0x467d96,_0x3e77be,_0x15a426);}else{return{};}});break;}}function getCall(_0x112233,_0x14be6a,_0x1f713d,_0x128a0b,_0xcf27fa,_0x18a3c7,_0x477bf9,_0x1cb4ea){logger[_0x0179('0x34')](_0x0179('0x5a'));var _0x35fc16={};_0x35fc16[_0x0179('0x5b')]={'name':!_['isNil'](_0x128a0b[_0x0179('0x46')][_0x0179('0x1c')])&&!_['isNil'](_0x128a0b[_0x0179('0x3b')]['name'])&&_0x128a0b[_0x0179('0x3b')][_0x0179('0x1c')]===_0x0179('0x5c')?_0x128a0b[_0x0179('0x46')][_0x0179('0x1c')]:!_['isNil'](_0x128a0b[_0x0179('0x47')])?_0x128a0b[_0x0179('0x47')]+'\x20'+_0x128a0b[_0x0179('0x48')]:_0x128a0b[_0x0179('0x48')],'id':_0x128a0b['id']};_0x35fc16[_0x0179('0x5d')]=intUtil[_0x0179('0x5e')](_0x18a3c7['Subjects'],_0x477bf9,'\x20');_0x35fc16[_0x0179('0x5f')]=intUtil[_0x0179('0x5e')](_0x18a3c7[_0x0179('0x60')],_0x477bf9,'\x0a');if(_0xcf27fa[_0x0179('0x43')]==='Contacts'){_0x35fc16[_0x0179('0x61')]={'name':!_[_0x0179('0x1f')](_0xcf27fa[_0x0179('0x62')])?_0xcf27fa['Full_Name']:!_['isNil'](_0xcf27fa[_0x0179('0x63')])?_0xcf27fa[_0x0179('0x63')]+'\x20'+_0xcf27fa[_0x0179('0x64')]:_0xcf27fa['Last_Name'],'id':_0xcf27fa['id']};}if(_0xcf27fa['enduserType']==='Leads'){_0x35fc16[_0x0179('0x65')]={'name':!_[_0x0179('0x1f')](_0xcf27fa[_0x0179('0x62')])?_0xcf27fa[_0x0179('0x62')]:!_[_0x0179('0x1f')](_0xcf27fa[_0x0179('0x63')])?_0xcf27fa[_0x0179('0x63')]+'\x20'+_0xcf27fa[_0x0179('0x64')]:_0xcf27fa[_0x0179('0x64')],'id':_0xcf27fa['id']};_0x35fc16[_0x0179('0x66')]=_[_0x0179('0x67')](_0xcf27fa['enduserType']);}if(_0x477bf9[_0x0179('0x68')]){_0x35fc16[_0x0179('0x69')]=moment['utc'](parseInt(_0x477bf9[_0x0179('0x68')])*0x3e8)[_0x0179('0x37')](_0x0179('0x6a'));}else if(_0x477bf9[_0x0179('0x6b')]&&_0x477bf9[_0x0179('0x6c')]){_0x35fc16['Call_Duration']=moment[_0x0179('0x6d')](moment(_0x477bf9[_0x0179('0x6c')],_0x0179('0x6e'))[_0x0179('0x6f')](moment(_0x477bf9[_0x0179('0x70')],_0x0179('0x6e'))))[_0x0179('0x37')](_0x0179('0x6a'));}switch(_0x477bf9['lastevent']){case _0x0179('0x71'):_0x35fc16[_0x0179('0x72')]=_0x0179('0x73');break;case'complete':case _0x0179('0x74'):_0x35fc16[_0x0179('0x72')]=_0x0179('0x75');break;case _0x0179('0x76'):_0x35fc16[_0x0179('0x72')]=_0x0179('0x77');break;case _0x0179('0x78'):_0x35fc16[_0x0179('0x72')]=_0x0179('0x79');break;case'timeout':_0x35fc16[_0x0179('0x72')]=_0x0179('0x7a');default:}_0x35fc16[_0x0179('0x7b')]=(_0x1cb4ea==='outbound'?moment(_0x477bf9[_0x0179('0x70')])[_0x0179('0x37')](_0x0179('0x6e')):moment(_0x477bf9[_0x0179('0x7c')])[_0x0179('0x37')](_0x0179('0x6e')))||moment()[_0x0179('0x37')](_0x0179('0x6e'));_0x35fc16[_0x0179('0x7d')]=_0x1cb4ea||_0x0179('0x7e');_0x35fc16=_[_0x0179('0x7f')](_0x35fc16,getCustomFields(_0x18a3c7[_0x0179('0x80')],_0x477bf9));return request({'method':_0x0179('0x29'),'uri':_0x0179('0x53')+_0x14be6a+_0x0179('0x81'),'headers':{'Authorization':_0x0179('0x49')+_0x112233},'body':{'data':[_0x35fc16]},'json':!![]})[_0x0179('0x2f')](function(_0x4bcbc5){if(_0x4bcbc5&&_0x4bcbc5[_0x0179('0x42')][0x0][_0x0179('0x4a')]===_0x0179('0x4b')){logger['info'](_0x0179('0x82'));return{'id':_0x4bcbc5[_0x0179('0x42')][0x0]['details']['id']};}})[_0x0179('0x31')](function(_0x65208a){logger[_0x0179('0x34')](_0x0179('0x83'),_0x65208a['stack']);console[_0x0179('0x4d')](_0x0179('0x83'),_0x65208a);});}exports[_0x0179('0x84')]=function(_0x597644,_0x469921,_0x4dd4d1,_0x33b83a,_0x26cf80,_0x6b967c){var _0x595621,_0x5f0260,_0x565aea;_0x6b967c['host']=intUtil[_0x0179('0x85')](_0x6b967c['host']);_0x6b967c['serverUrl']=intUtil[_0x0179('0x85')](_0x6b967c['serverUrl']);if(_0x26cf80&&_0x26cf80[_0x0179('0x86')]){logger[_0x0179('0x34')](_0x0179('0x87'),_0x0179('0x88'));_0x469921[_0x0179('0x89')]=_0x6b967c['serverUrl']+_0x0179('0x8a')+_0x469921[_0x0179('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x469921['uniqueid']);}else{_0x469921['recordingURL']='';}var _0x5d28e0=_0x6b967c[_0x0179('0x8c')]==='zoho.eu'?'eu':_0x0179('0x8d');return getAccessToken(_0x6b967c)[_0x0179('0x2f')](function(_0x4167af){_0x565aea=_0x4167af;return getUser(_0x565aea,_0x5d28e0,_0x6b967c,_0x33b83a[_0x0179('0x8e')]);})[_0x0179('0x2f')](function(_0x104559){_0x595621=_0x104559;logger['info'](_0x0179('0x8f'),_0x595621['id']);return getEndUser(_0x565aea,_0x5d28e0,_0x6b967c,_0x469921['calleridname'],_0x469921[_0x0179('0x90')],_0x595621,_0x4dd4d1);})[_0x0179('0x2f')](function(_0x18f0b1){_0x5f0260=_0x18f0b1;return getCall(_0x565aea,_0x5d28e0,_0x6b967c,_0x595621,_0x5f0260,_0x4dd4d1,_0x469921,_0x0179('0x7e'));})['then'](function(_0x54d314){if(_0x54d314){logger[_0x0179('0x34')]('The\x20Call\x20ID\x20is:',_0x54d314['id']);logger[_0x0179('0x34')](_0x0179('0x87'),_0x0179('0x91'));emit(util[_0x0179('0x37')](_0x0179('0x92'),_0x33b83a[_0x0179('0x1c')]),_0x0179('0x93'),{'uri':_0x0179('0x94')+_0x6b967c[_0x0179('0x8c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x54d314['id']});}})['catch'](function(_0x2ec36a){logger[_0x0179('0x3f')](_0x0179('0x87'),JSON[_0x0179('0xe')](_0x2ec36a));});};exports[_0x0179('0x95')]=function(_0x46fe68,_0x4fab12,_0x268999,_0x2150e2,_0x200e99,_0x2062be,_0x582094){var _0x4e97e1,_0x13dd4a,_0x1820d9;_0x2062be[_0x0179('0x8c')]=intUtil['stripTrailingSlash'](_0x2062be[_0x0179('0x8c')]);_0x2062be[_0x0179('0x96')]=intUtil['stripTrailingSlash'](_0x2062be[_0x0179('0x96')]);if(_0x582094&&_0x582094[_0x0179('0x97')]&&_0x582094['recordingFormat']!==_0x0179('0x98')){logger[_0x0179('0x34')](_0x0179('0x99'),'Recording\x20is\x20enabled!');_0x4fab12[_0x0179('0x89')]=_0x2062be['serverUrl']+'/api/voice/recordings/'+_0x4fab12[_0x0179('0x8b')]+_0x0179('0x9a')+md5(_0x4fab12[_0x0179('0x8b')]);}var _0x32dfcd=_0x2062be[_0x0179('0x8c')]===_0x0179('0x9b')?'eu':_0x0179('0x8d');return getAccessToken(_0x2062be)[_0x0179('0x2f')](function(_0x54d793){_0x1820d9=_0x54d793;return getUser(_0x1820d9,_0x32dfcd,_0x2062be,_0x2150e2['email']);})[_0x0179('0x2f')](function(_0x299825){_0x4e97e1=_0x299825;logger['info'](_0x0179('0x8f'),_0x4e97e1['id']);return getEndUser(_0x1820d9,_0x32dfcd,_0x2062be,_0x4fab12[_0x0179('0x9c')],_0x4fab12[_0x0179('0x9d')],_0x4e97e1,_0x268999);})[_0x0179('0x2f')](function(_0x43864d){_0x13dd4a=_0x43864d;return getCall(_0x1820d9,_0x32dfcd,_0x2062be,_0x4e97e1,_0x13dd4a,_0x268999,_0x4fab12,_0x0179('0x9e'));})[_0x0179('0x2f')](function(_0x356d23){if(_0x356d23){logger[_0x0179('0x34')](_0x0179('0x9f'),_0x356d23['id']);logger['info']('[OUTBOUND]',_0x0179('0x91'));emit(util[_0x0179('0x37')](_0x0179('0x92'),_0x2150e2['name']),_0x0179('0x93'),{'uri':_0x0179('0x94')+_0x2062be['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x356d23['id']});}})['catch'](function(_0x17e46c){logger['error']('[OUTBOUND]',JSON['stringify'](_0x17e46c));});};exports[_0x0179('0xa0')]=function(_0x18c1ae,_0x3a7f9a,_0x15fd29,_0x3f5c35,_0x3a0f91,_0x38ece5){var _0x3374e2,_0xf180c,_0x3f50d1;_0x38ece5[_0x0179('0x8c')]=intUtil['stripTrailingSlash'](_0x38ece5['host']);_0x38ece5[_0x0179('0x96')]=intUtil['stripTrailingSlash'](_0x38ece5[_0x0179('0x96')]);if(_0x3a0f91&&_0x3a0f91[_0x0179('0x86')]){logger[_0x0179('0x34')]('['+_0x3a7f9a[_0x0179('0xa1')][_0x0179('0xa2')]()+']',_0x0179('0x88'));_0x3a7f9a['recordingURL']=_0x38ece5['serverUrl']+'/api/voice/recordings/'+_0x3a7f9a[_0x0179('0x8b')]+_0x0179('0x9a')+md5(_0x3a7f9a[_0x0179('0x8b')]);}else{_0x3a7f9a[_0x0179('0x89')]='';}var _0x8fdfc5=_0x38ece5[_0x0179('0x8c')]===_0x0179('0x9b')?'eu':_0x0179('0x8d');return getAccessToken(_0x38ece5)['then'](function(_0x5dcda9){_0x3f50d1=_0x5dcda9;return getUser(_0x3f50d1,_0x8fdfc5,_0x38ece5);})[_0x0179('0x2f')](function(_0x1b7405){_0x3374e2=_0x1b7405;logger[_0x0179('0x34')](_0x0179('0x8f'),_0x3374e2['id']);return getEndUser(_0x3f50d1,_0x8fdfc5,_0x38ece5,_0x3a7f9a[_0x0179('0xa3')],_0x3a7f9a['calleridnum'],_0x3374e2,_0x15fd29);})[_0x0179('0x2f')](function(_0x132aef){_0xf180c=_0x132aef;return getCall(_0x3f50d1,_0x8fdfc5,_0x38ece5,_0x3374e2,_0xf180c,_0x15fd29,_0x3a7f9a,_0x0179('0x7e'));})[_0x0179('0x2f')](function(_0x5b7770){if(_0x5b7770){logger['info'](_0x0179('0x9f'),_0x5b7770['id']);}})[_0x0179('0x31')](function(_0x503d30){logger[_0x0179('0x3f')]('['+_0x3a7f9a[_0x0179('0xa1')][_0x0179('0xa2')]()+']',JSON[_0x0179('0xe')](_0x503d30));});}; \ No newline at end of file +var _0x6177=['error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','complete','connect','Call_Result','Rejected','abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','/crm/v2/Calls','Call\x20created!','err','stack','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','[OUTBOUND]','unmanaged','toUpperCase','request-promise','md5','util','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','user','Administrator'];(function(_0x214ad6,_0xd2d89b){var _0x2bed1d=function(_0x4eaf05){while(--_0x4eaf05){_0x214ad6['push'](_0x214ad6['shift']());}};_0x2bed1d(++_0xd2d89b);}(_0x6177,0x192));var _0x7617=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x6177[_0x1da04e];return _0xdd8c41;};'use strict';var _=require('lodash');var rp=require(_0x7617('0x0'));var md5=require(_0x7617('0x1'));var util=require(_0x7617('0x2'));var intUtil=require(_0x7617('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x7617('0x4'));var config=require(_0x7617('0x5'));var logger=require(_0x7617('0x6'))(_0x7617('0x7'));config[_0x7617('0x8')]=_[_0x7617('0x9')](config[_0x7617('0x8')],{'host':_0x7617('0xa'),'port':0x18eb});var io=require(_0x7617('0xb'))(new Redis(config[_0x7617('0x8')]));function emit(_0x429169,_0x17ae72,_0x3d793a){io['to'](_0x429169)[_0x7617('0xc')](_0x17ae72,_0x3d793a);}function request(_0x4f5771){logger[_0x7617('0xd')](_0x7617('0xe'),JSON[_0x7617('0xf')](_0x4f5771));return rp(_0x4f5771);}function getCustomFields(_0xa29410,_0x9715f2){var _0x5611e6={};if(_0xa29410['length']>0x0){_['forEach'](_0xa29410,function(_0x2e0a5b){if(_['includes'](['string',_0x7617('0x10')],_0x2e0a5b[_0x7617('0x11')])&&_0x2e0a5b['idField']){_0x5611e6[_0x2e0a5b[_0x7617('0x12')]]=_0x2e0a5b[_0x7617('0x13')][_0x7617('0x14')]();}else if(_0x2e0a5b['type']===_0x7617('0x15')&&_0x2e0a5b['variableName']&&_0x2e0a5b[_0x7617('0x12')]&&_0x9715f2[_0x2e0a5b[_0x7617('0x16')]]){_0x5611e6[_0x2e0a5b[_0x7617('0x12')]]=_0x9715f2[_0x2e0a5b[_0x7617('0x16')]][_0x7617('0x14')]();}else if(_0x2e0a5b[_0x7617('0x11')]===_0x7617('0x17')&&_0x2e0a5b[_0x7617('0x18')]&&_0x2e0a5b[_0x7617('0x18')][_0x7617('0x19')]&&_0x2e0a5b[_0x7617('0x12')]&&_0x9715f2[_0x2e0a5b[_0x7617('0x18')][_0x7617('0x19')][_0x7617('0x1a')]()]){_0x5611e6[_0x2e0a5b[_0x7617('0x12')]]=_0x9715f2[_0x2e0a5b[_0x7617('0x18')]['name'][_0x7617('0x1a')]()]['toString']();}});}return _0x5611e6;}function getName(_0x2d2c75){if(_0x2d2c75['indexOf']('\x20')>0x0){var _0x2e4de6=_0x2d2c75[_0x7617('0x1b')](/ (.+)/);if(_0x2e4de6[0x1]){return _0x2e4de6;}}return[_0x2d2c75,_0x2d2c75];}var accountsTokens={};function getAccessToken(_0x1ec898){return new Promise(function(_0x3c643b,_0x2f2206){if(!_[_0x7617('0x1c')](accountsTokens[_0x1ec898['id']])&&!_[_0x7617('0x1c')](accountsTokens[_0x1ec898['id']][_0x7617('0x1d')])){if(moment()[_0x7617('0x1e')](accountsTokens[_0x1ec898['id']]['expires_in'])){_0x3c643b(accountsTokens[_0x1ec898['id']][_0x7617('0x1d')]);}}var _0x53dc59;switch(_0x1ec898[_0x7617('0x1f')]){case'US':_0x53dc59=_0x7617('0x20');break;case'AU':_0x53dc59=_0x7617('0x21');break;case'EU':_0x53dc59=_0x7617('0x22');break;case'IN':_0x53dc59='https://accounts.zoho.in';break;case'CN':_0x53dc59=_0x7617('0x23');break;default:_0x53dc59=_0x7617('0x22');break;}var _0x3ce127={'method':_0x7617('0x24'),'uri':_0x53dc59+_0x7617('0x25'),'qs':{'refresh_token':_0x1ec898[_0x7617('0x26')],'client_id':_0x1ec898['clientId'],'client_secret':_0x1ec898['clientSecret'],'grant_type':_0x7617('0x27')},'json':!![]};return rp(_0x3ce127)[_0x7617('0x28')](function(_0x56b495){accountsTokens[_0x1ec898['id']]={'access_token':_0x56b495['access_token'],'expires_in':moment()[_0x7617('0x29')](_0x56b495[_0x7617('0x2a')],_0x7617('0x2b'))};_0x3c643b(_0x56b495['access_token']);})[_0x7617('0x2c')](function(_0x123832){logger['error'](_0x7617('0x2d'),_0x123832['stack']);_0x2f2206(_0x123832);});});}function getUser(_0x4ce575,_0x105f56,_0x1334c9,_0x212ea5){logger['info'](_0x7617('0x2e'));return request({'method':'GET','uri':util[_0x7617('0x2f')](_0x7617('0x30'),_0x105f56),'qs':{'type':_0x7617('0x31')},'headers':{'Authorization':_0x7617('0x32')+_0x4ce575},'json':!![]})[_0x7617('0x28')](function(_0x548270){if(_0x548270[_0x7617('0x33')]){var _0x5e634d=-0x1;if(_[_0x7617('0x34')](_0x548270[_0x7617('0x33')])){if(!_[_0x7617('0x1c')](_0x212ea5)){_0x5e634d=_[_0x7617('0x35')](_0x548270[_0x7617('0x33')],function(_0x3d7a28){return _0x3d7a28[_0x7617('0x36')]===_0x212ea5;});}if(_0x5e634d>=0x0){logger[_0x7617('0x37')]('Agent\x20found!');}else{logger['info'](_0x7617('0x38'));_0x5e634d=_['findIndex'](_0x548270[_0x7617('0x33')],function(_0x351b67){return _0x351b67[_0x7617('0x39')][_0x7617('0x19')]==='Administrator';});}return _0x548270['users'][_0x5e634d];}else{if(_0x548270[_0x7617('0x3a')][_0x7617('0x39')][_0x7617('0x19')]===_0x7617('0x3b')){logger[_0x7617('0x37')](_0x7617('0x38'));user=_0x548270[_0x7617('0x3a')];return user;}else{logger[_0x7617('0x3c')]('The\x20failing\x20result\x20is',JSON[_0x7617('0xf')](_0x548270));throw new Error(_0x7617('0x3d')+JSON[_0x7617('0xf')](_0x548270));}}}else{logger[_0x7617('0x3c')](_0x7617('0x3e'),JSON[_0x7617('0xf')](_0x548270));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7617('0xf')](_0x548270));}})[_0x7617('0x2c')](function(_0x544f3f){console['error'](_0x544f3f);});}function getZohoUser(_0x33aaf6,_0x3aa6d0){return new BPromise(function(_0x57917e,_0x51aa6b){request(_0x33aaf6)[_0x7617('0x28')](function(_0x5985a2){var _0x520c6f=null;if(_0x5985a2){_0x520c6f=_0x5985a2[_0x7617('0x3f')][0x0];_0x520c6f['enduserType']=_0x3aa6d0;}_0x57917e(_0x520c6f);})['catch'](function(_0x592550){_0x51aa6b(_0x592550);});});}function createEndUser(_0x378f38,_0x5726e9,_0x5d840c,_0x3a95b9,_0x20362b,_0x4d5629){var _0x5d840c=getName(_0x5d840c);return request({'method':_0x7617('0x24'),'uri':_0x7617('0x40')+_0x5726e9+'/crm/v2/'+_[_0x7617('0x41')](_0x4d5629[_0x7617('0x42')])+'s','body':{'data':[{'Last_Name':_0x5d840c[0x1],'First_Name':_0x5d840c[0x0],'Phone':_0x3a95b9,'Owner':{'name':!_[_0x7617('0x1c')](_0x20362b['role'][_0x7617('0x19')])?_0x20362b[_0x7617('0x43')][_0x7617('0x19')]:!_['isNil'](_0x20362b['first_name'])?_0x20362b[_0x7617('0x44')]+'\x20'+_0x20362b[_0x7617('0x45')]:_0x20362b[_0x7617('0x45')],'id':_0x20362b['id']}}]},'headers':{'Authorization':_0x7617('0x32')+_0x378f38},'json':!![]})[_0x7617('0x28')](function(_0x33e8b6){if(_0x33e8b6&&_0x33e8b6['data'][0x0][_0x7617('0x46')]===_0x7617('0x47')){var _0x51527d=_0x33e8b6[_0x7617('0x3f')][0x0][_0x7617('0x48')];_0x51527d[_0x7617('0x49')]=_[_0x7617('0x41')](_0x4d5629['moduleCreate'])+'s';return _0x51527d;}logger[_0x7617('0x3c')]('The\x20failing\x20result\x20is',JSON[_0x7617('0xf')](data));throw new Error(_0x7617('0x4a')+JSON[_0x7617('0xf')](data));})['catch'](function(_0x5373d6){console[_0x7617('0x4b')](_0x7617('0x4c'),_0x5373d6);});}function getEndUser(_0x11f29e,_0x5587e2,_0x547818,_0x19a3a6,_0x4580e2,_0x20fc89,_0x525c44){var _0x5aaacc={'method':_0x7617('0x4d'),'uri':'','headers':{'Authorization':_0x7617('0x32')+_0x11f29e},'json':!![]};switch(_0x525c44['moduleSearch']){case _0x7617('0x4e'):_0x5aaacc[_0x7617('0x4f')]=_0x7617('0x40')+_0x5587e2+_0x7617('0x50')+_0x4580e2+'))';return getZohoUser(_0x5aaacc,_0x7617('0x51'))[_0x7617('0x28')](function(_0x379f36){if(_0x379f36)return _0x379f36;_0x5aaacc[_0x7617('0x4f')]=_0x7617('0x40')+_0x5587e2+_0x7617('0x52')+_0x4580e2+'))';return getZohoUser(_0x5aaacc,_0x7617('0x53'))['then'](function(_0x31aef6){if(_0x31aef6)return _0x31aef6;if(_0x525c44[_0x7617('0x42')]!=_0x7617('0x54')){return createEndUser(_0x11f29e,_0x5587e2,_0x19a3a6,_0x4580e2,_0x20fc89,_0x525c44);}else{return{};}});});break;case _0x7617('0x55'):_0x5aaacc[_0x7617('0x4f')]=_0x7617('0x40')+_0x5587e2+_0x7617('0x50')+_0x4580e2+'))';return getZohoUser(_0x5aaacc,_0x7617('0x51'))[_0x7617('0x28')](function(_0x2edd77){if(_0x2edd77)return _0x2edd77;if(_0x525c44['moduleCreate']!=_0x7617('0x54')){return createEndUser(_0x11f29e,_0x5587e2,_0x19a3a6,_0x4580e2,_0x20fc89,_0x525c44);}else{return{};}});break;case _0x7617('0x56'):_0x5aaacc['uri']=_0x7617('0x40')+_0x5587e2+_0x7617('0x52')+_0x4580e2+'))';return getZohoUser(_0x5aaacc,_0x7617('0x53'))[_0x7617('0x28')](function(_0x5f331b){if(_0x5f331b)return _0x5f331b;if(_0x525c44['moduleCreate']!=_0x7617('0x54')){return createEndUser(_0x11f29e,_0x5587e2,_0x19a3a6,_0x4580e2,_0x20fc89,_0x525c44);}else{return{};}});break;}}function getCall(_0x231aca,_0x4781c3,_0x403e0a,_0x59bda5,_0x36caab,_0x5e269a,_0x12893e,_0x247dc1){logger[_0x7617('0x37')](_0x7617('0x57'));var _0x1d427d={};_0x1d427d[_0x7617('0x58')]={'name':!_[_0x7617('0x1c')](_0x59bda5['role'][_0x7617('0x19')])&&!_[_0x7617('0x1c')](_0x59bda5['profile'][_0x7617('0x19')])&&_0x59bda5[_0x7617('0x39')]['name']===_0x7617('0x59')?_0x59bda5[_0x7617('0x43')][_0x7617('0x19')]:!_[_0x7617('0x1c')](_0x59bda5[_0x7617('0x44')])?_0x59bda5['first_name']+'\x20'+_0x59bda5[_0x7617('0x45')]:_0x59bda5[_0x7617('0x45')],'id':_0x59bda5['id']};_0x1d427d[_0x7617('0x5a')]=intUtil[_0x7617('0x5b')](_0x5e269a['Subjects'],_0x12893e,'\x20');_0x1d427d[_0x7617('0x5c')]=intUtil[_0x7617('0x5b')](_0x5e269a[_0x7617('0x5d')],_0x12893e,'\x0a');if(_0x36caab[_0x7617('0x49')]===_0x7617('0x51')){_0x1d427d[_0x7617('0x5e')]={'name':!_[_0x7617('0x1c')](_0x36caab['Full_Name'])?_0x36caab[_0x7617('0x5f')]:!_[_0x7617('0x1c')](_0x36caab[_0x7617('0x60')])?_0x36caab[_0x7617('0x60')]+'\x20'+_0x36caab[_0x7617('0x61')]:_0x36caab[_0x7617('0x61')],'id':_0x36caab['id']};}if(_0x36caab[_0x7617('0x49')]===_0x7617('0x53')){_0x1d427d[_0x7617('0x62')]={'name':!_[_0x7617('0x1c')](_0x36caab[_0x7617('0x5f')])?_0x36caab[_0x7617('0x5f')]:!_[_0x7617('0x1c')](_0x36caab[_0x7617('0x60')])?_0x36caab['First_Name']+'\x20'+_0x36caab[_0x7617('0x61')]:_0x36caab[_0x7617('0x61')],'id':_0x36caab['id']};_0x1d427d['$se_module']=_[_0x7617('0x41')](_0x36caab[_0x7617('0x49')]);}if(_0x12893e[_0x7617('0x63')]){_0x1d427d[_0x7617('0x64')]=moment['utc'](parseInt(_0x12893e[_0x7617('0x63')])*0x3e8)[_0x7617('0x2f')]('mm:ss');}else if(_0x12893e[_0x7617('0x65')]&&_0x12893e[_0x7617('0x66')]){_0x1d427d[_0x7617('0x64')]=moment[_0x7617('0x67')](moment(_0x12893e['endtime'],_0x7617('0x68'))[_0x7617('0x69')](moment(_0x12893e[_0x7617('0x6a')],_0x7617('0x68'))))[_0x7617('0x2f')]('mm:ss');}switch(_0x12893e[_0x7617('0x6b')]){case _0x7617('0x6c'):_0x1d427d['Call_Result']='Called';break;case _0x7617('0x6d'):case _0x7617('0x6e'):_0x1d427d[_0x7617('0x6f')]='Answered';break;case'rejected':_0x1d427d['Call_Result']=_0x7617('0x70');break;case _0x7617('0x71'):_0x1d427d[_0x7617('0x6f')]='Abandoned';break;case _0x7617('0x72'):_0x1d427d['Call_Result']='Timeout';default:}_0x1d427d[_0x7617('0x73')]=(_0x247dc1==='outbound'?moment(_0x12893e['starttime'])[_0x7617('0x2f')](_0x7617('0x68')):moment(_0x12893e[_0x7617('0x74')])[_0x7617('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x7617('0x2f')]('YYYY-MM-DDTHH:mm:ss');_0x1d427d[_0x7617('0x75')]=_0x247dc1||'Inbound';_0x1d427d=_[_0x7617('0x76')](_0x1d427d,getCustomFields(_0x5e269a['Fields'],_0x12893e));return request({'method':_0x7617('0x24'),'uri':_0x7617('0x40')+_0x4781c3+_0x7617('0x77'),'headers':{'Authorization':_0x7617('0x32')+_0x231aca},'body':{'data':[_0x1d427d]},'json':!![]})[_0x7617('0x28')](function(_0x4d6b65){if(_0x4d6b65&&_0x4d6b65['data'][0x0][_0x7617('0x46')]==='SUCCESS'){logger[_0x7617('0x37')](_0x7617('0x78'));return{'id':_0x4d6b65[_0x7617('0x3f')][0x0][_0x7617('0x48')]['id']};}})[_0x7617('0x2c')](function(_0x1c8543){logger[_0x7617('0x37')](_0x7617('0x79'),_0x1c8543[_0x7617('0x7a')]);console[_0x7617('0x4b')]('err',_0x1c8543);});}exports[_0x7617('0x7b')]=function(_0x1572dc,_0x5a3497,_0x52ca42,_0x5735ed,_0x84b07b,_0x23a9e9){var _0x1feba7,_0x37bee3,_0x4073f9;_0x23a9e9['host']=intUtil[_0x7617('0x7c')](_0x23a9e9[_0x7617('0x7d')]);_0x23a9e9[_0x7617('0x7e')]=intUtil[_0x7617('0x7c')](_0x23a9e9[_0x7617('0x7e')]);if(_0x84b07b&&_0x84b07b[_0x7617('0x7f')]){logger[_0x7617('0x37')]('[QUEUE]',_0x7617('0x80'));_0x5a3497[_0x7617('0x81')]=_0x23a9e9[_0x7617('0x7e')]+_0x7617('0x82')+_0x5a3497[_0x7617('0x83')]+_0x7617('0x84')+md5(_0x5a3497[_0x7617('0x83')]);}else{_0x5a3497['recordingURL']='';}var _0x38f680=_0x23a9e9[_0x7617('0x7d')]===_0x7617('0x85')?'eu':_0x7617('0x86');return getAccessToken(_0x23a9e9)[_0x7617('0x28')](function(_0xf0fd2e){_0x4073f9=_0xf0fd2e;return getUser(_0x4073f9,_0x38f680,_0x23a9e9,_0x5735ed[_0x7617('0x36')]);})[_0x7617('0x28')](function(_0x19967a){_0x1feba7=_0x19967a;logger[_0x7617('0x37')](_0x7617('0x87'),_0x1feba7['id']);return getEndUser(_0x4073f9,_0x38f680,_0x23a9e9,_0x5a3497[_0x7617('0x88')],_0x5a3497['calleridnum'],_0x1feba7,_0x52ca42);})[_0x7617('0x28')](function(_0x3ff7d9){_0x37bee3=_0x3ff7d9;return getCall(_0x4073f9,_0x38f680,_0x23a9e9,_0x1feba7,_0x37bee3,_0x52ca42,_0x5a3497,_0x7617('0x89'));})[_0x7617('0x28')](function(_0x1c908f){if(_0x1c908f){logger[_0x7617('0x37')](_0x7617('0x8a'),_0x1c908f['id']);logger[_0x7617('0x37')](_0x7617('0x8b'),_0x7617('0x8c'));emit(util[_0x7617('0x2f')](_0x7617('0x8d'),_0x5735ed['name']),_0x7617('0x8e'),{'uri':_0x7617('0x8f')+_0x23a9e9['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x1c908f['id']});}})[_0x7617('0x2c')](function(_0x7e4a5e){logger[_0x7617('0x3c')](_0x7617('0x8b'),JSON[_0x7617('0xf')](_0x7e4a5e));});};exports[_0x7617('0x90')]=function(_0x354098,_0x1948e6,_0x4da4b3,_0x4747d0,_0x35cc4c,_0x16156c,_0x44d9f3){var _0x54815b,_0x9b1eb2,_0x3a6c5d;_0x16156c[_0x7617('0x7d')]=intUtil[_0x7617('0x7c')](_0x16156c['host']);_0x16156c['serverUrl']=intUtil['stripTrailingSlash'](_0x16156c[_0x7617('0x7e')]);if(_0x44d9f3&&_0x44d9f3[_0x7617('0x91')]&&_0x44d9f3[_0x7617('0x91')]!==_0x7617('0x92')){logger[_0x7617('0x37')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1948e6['recordingURL']=_0x16156c['serverUrl']+'/api/voice/recordings/'+_0x1948e6['uniqueid']+_0x7617('0x84')+md5(_0x1948e6[_0x7617('0x83')]);}var _0x21cff5=_0x16156c['host']==='zoho.eu'?'eu':_0x7617('0x86');return getAccessToken(_0x16156c)[_0x7617('0x28')](function(_0x2bb454){_0x3a6c5d=_0x2bb454;return getUser(_0x3a6c5d,_0x21cff5,_0x16156c,_0x4747d0['email']);})[_0x7617('0x28')](function(_0x5ed5d4){_0x54815b=_0x5ed5d4;logger[_0x7617('0x37')](_0x7617('0x87'),_0x54815b['id']);return getEndUser(_0x3a6c5d,_0x21cff5,_0x16156c,_0x1948e6[_0x7617('0x93')],_0x1948e6[_0x7617('0x94')],_0x54815b,_0x4da4b3);})[_0x7617('0x28')](function(_0x4d1c06){_0x9b1eb2=_0x4d1c06;return getCall(_0x3a6c5d,_0x21cff5,_0x16156c,_0x54815b,_0x9b1eb2,_0x4da4b3,_0x1948e6,_0x7617('0x95'));})[_0x7617('0x28')](function(_0x22f09c){if(_0x22f09c){logger[_0x7617('0x37')]('The\x20Call\x20ID\x20is:',_0x22f09c['id']);logger['info']('[OUTBOUND]',_0x7617('0x8c'));emit(util[_0x7617('0x2f')](_0x7617('0x8d'),_0x4747d0[_0x7617('0x19')]),'trigger:browser:url',{'uri':_0x7617('0x8f')+_0x16156c['host']+_0x7617('0x96')+_0x22f09c['id']});}})['catch'](function(_0x3b03b6){logger[_0x7617('0x3c')](_0x7617('0x97'),JSON[_0x7617('0xf')](_0x3b03b6));});};exports[_0x7617('0x98')]=function(_0x4b79d8,_0x4e015e,_0x47e1b5,_0x122b8d,_0xe50d0f,_0x10fdb9){var _0x32d967,_0x380318,_0x5b4bd9;_0x10fdb9[_0x7617('0x7d')]=intUtil['stripTrailingSlash'](_0x10fdb9[_0x7617('0x7d')]);_0x10fdb9[_0x7617('0x7e')]=intUtil[_0x7617('0x7c')](_0x10fdb9[_0x7617('0x7e')]);if(_0xe50d0f&&_0xe50d0f[_0x7617('0x7f')]){logger[_0x7617('0x37')]('['+_0x4e015e[_0x7617('0x6b')][_0x7617('0x99')]()+']','Recording\x20is\x20enabled!');_0x4e015e['recordingURL']=_0x10fdb9[_0x7617('0x7e')]+'/api/voice/recordings/'+_0x4e015e[_0x7617('0x83')]+_0x7617('0x84')+md5(_0x4e015e[_0x7617('0x83')]);}else{_0x4e015e[_0x7617('0x81')]='';}var _0x2f2c61=_0x10fdb9['host']===_0x7617('0x85')?'eu':'com';return getAccessToken(_0x10fdb9)[_0x7617('0x28')](function(_0x44e79d){_0x5b4bd9=_0x44e79d;return getUser(_0x5b4bd9,_0x2f2c61,_0x10fdb9);})['then'](function(_0x25ecb9){_0x32d967=_0x25ecb9;logger['info']('The\x20User\x20ID\x20is:',_0x32d967['id']);return getEndUser(_0x5b4bd9,_0x2f2c61,_0x10fdb9,_0x4e015e[_0x7617('0x88')],_0x4e015e['calleridnum'],_0x32d967,_0x47e1b5);})['then'](function(_0x5047fd){_0x380318=_0x5047fd;return getCall(_0x5b4bd9,_0x2f2c61,_0x10fdb9,_0x32d967,_0x380318,_0x47e1b5,_0x4e015e,_0x7617('0x89'));})['then'](function(_0x2b2431){if(_0x2b2431){logger[_0x7617('0x37')](_0x7617('0x8a'),_0x2b2431['id']);}})[_0x7617('0x2c')](function(_0xe3fab9){logger['error']('['+_0x4e015e[_0x7617('0x6b')][_0x7617('0x99')]()+']',JSON[_0x7617('0xf')](_0xe3fab9));});}; \ 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 4c0a454..3c5337b 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 _0x7635=['data2','Script','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x7635,0x140));var _0x5763=function(_0x2ecb33,_0x4e1f74){_0x2ecb33=_0x2ecb33-0x0;var _0x38c528=_0x7635[_0x2ecb33];return _0x38c528;};'use strict';var util=require(_0x5763('0x0'));var sh=require(_0x5763('0x1'));var Mustache=require(_0x5763('0x2'));var logger=require(_0x5763('0x3'))(_0x5763('0x4'));exports['exec']=function(_0x43af25,_0x58f3b7){var _0x3bf8cc=_0x43af25[_0x5763('0x5')]?_0x43af25[_0x5763('0x5')]:_0x5763('0x6');var _0x102e84=_0x43af25[_0x5763('0x7')]?Mustache['render'](_0x43af25[_0x5763('0x7')],_0x58f3b7):_0x58f3b7;sh[_0x5763('0x8')](_0x102e84,function(_0x54d887,_0x532314,_0x4f2f80){if(_0x54d887!==0x0){logger[_0x5763('0x9')](util[_0x5763('0xa')](_0x5763('0xb'),_0x3bf8cc,_0x102e84,_0x54d887,_0x4f2f80));}else{logger[_0x5763('0xc')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3bf8cc,_0x102e84,_0x532314));}});}; \ No newline at end of file +var _0x9c9b=['exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x325b08,_0xd3fe6d){var _0x3cf588=function(_0x19e0e2){while(--_0x19e0e2){_0x325b08['push'](_0x325b08['shift']());}};_0x3cf588(++_0xd3fe6d);}(_0x9c9b,0x1e9));var _0xb9c9=function(_0x352879,_0x3bd5c8){_0x352879=_0x352879-0x0;var _0x29f1b4=_0x9c9b[_0x352879];return _0x29f1b4;};'use strict';var util=require(_0xb9c9('0x0'));var sh=require(_0xb9c9('0x1'));var Mustache=require(_0xb9c9('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0xb9c9('0x3')]=function(_0x5e85d7,_0x564857){var _0xf3f9c5=_0x5e85d7[_0xb9c9('0x4')]?_0x5e85d7['data2']:_0xb9c9('0x5');var _0x2209e7=_0x5e85d7[_0xb9c9('0x6')]?Mustache[_0xb9c9('0x7')](_0x5e85d7[_0xb9c9('0x6')],_0x564857):_0x564857;sh[_0xb9c9('0x3')](_0x2209e7,function(_0x50e7b5,_0x46d86a,_0x5f44d1){if(_0x50e7b5!==0x0){logger['error'](util[_0xb9c9('0x8')](_0xb9c9('0x9'),_0xf3f9c5,_0x2209e7,_0x50e7b5,_0x5f44d1));}else{logger[_0xb9c9('0xa')](util['format'](_0xb9c9('0xb'),_0xf3f9c5,_0x2209e7,_0x46d86a));}});}; \ 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 145b851..9fa11e1 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 _0x5399=['mustache','trigger','exec','data1','render','data2','data5','number','headers','parse','stack','toUpperCase','PUT','data7','error','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','body','format','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash'];(function(_0x3f44e0,_0x36cff4){var _0x3be66d=function(_0x47c1c9){while(--_0x47c1c9){_0x3f44e0['push'](_0x3f44e0['shift']());}};_0x3be66d(++_0x36cff4);}(_0x5399,0xd0));var _0x9539=function(_0x4ed6c7,_0x2e6803){_0x4ed6c7=_0x4ed6c7-0x0;var _0x112d0c=_0x5399[_0x4ed6c7];return _0x112d0c;};'use strict';var rp=require('request-promise');var util=require(_0x9539('0x0'));var _=require(_0x9539('0x1'));var Mustache=require(_0x9539('0x2'));var logger=require('../../../../config/logger')(_0x9539('0x3'));exports[_0x9539('0x4')]=function(_0x3b7ec5,_0x16c0b3){var _0x1f309f,_0x24dd2a;var _0x520cf3={'method':_0x3b7ec5[_0x9539('0x5')]['toUpperCase'](),'uri':Mustache[_0x9539('0x6')](_0x3b7ec5[_0x9539('0x7')],_0x16c0b3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b7ec5[_0x9539('0x8')])===_0x9539('0x9')&&parseInt(_0x3b7ec5[_0x9539('0x8')])>=0x1&&parseInt(_0x3b7ec5[_0x9539('0x8')])<=0xa?parseInt(_0x3b7ec5[_0x9539('0x8')])*0x3e8:0x5*0x3e8};try{_0x520cf3[_0x9539('0xa')]=_0x3b7ec5['data6']?JSON[_0x9539('0xb')](Mustache[_0x9539('0x6')](_0x3b7ec5['data6'],_0x16c0b3)):{};}catch(_0x177293){logger['error'](_0x177293[_0x9539('0xc')]);}switch(_0x3b7ec5[_0x9539('0x5')][_0x9539('0xd')]()){case'GET':case'DELETE':_0x1f309f=null;_0x520cf3['qs']=_0x16c0b3;break;case'POST':case _0x9539('0xe'):if(_0x3b7ec5[_0x9539('0xf')]){try{_0x1f309f=JSON[_0x9539('0xb')](Mustache['render'](_0x3b7ec5[_0x9539('0xf')],_0x16c0b3));_0x520cf3['body']=_0x1f309f;}catch(_0x2dc248){logger['error'](_0x2dc248['stack']);logger[_0x9539('0x10')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x1f309f=_0x16c0b3;_0x520cf3['body']=_0x1f309f;}break;}logger[_0x9539('0x11')](util['format'](_0x9539('0x12'),_0x3b7ec5['data1'],_0x3b7ec5[_0x9539('0x7')],JSON[_0x9539('0x13')](_0x520cf3)));rp(_0x520cf3)[_0x9539('0x14')](function(_0x3cfeaa){_0x1f309f=!_[_0x9539('0x15')](_0x1f309f)?_0x9539('0x16')+_0x1f309f:'';_0x24dd2a=typeof _0x3cfeaa['body']===_0x9539('0x17')?JSON[_0x9539('0x13')](_0x3cfeaa[_0x9539('0x18')]):_0x3cfeaa[_0x9539('0x18')];logger[_0x9539('0x11')](util[_0x9539('0x19')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3b7ec5[_0x9539('0x5')],_0x3b7ec5[_0x9539('0x7')],_0x3cfeaa['statusCode'],_0x24dd2a));})[_0x9539('0x1a')](function(_0x3fbed8){logger[_0x9539('0x10')](util['format'](_0x9539('0x1b'),_0x3b7ec5['data1'],_0x3b7ec5['data2'],_0x3fbed8['statusCode'],_0x3fbed8[_0x9539('0x1c')],_0x3fbed8[_0x9539('0x1d')]));});}; \ No newline at end of file +var _0x66f0=['stringify','then','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','../../../../config/logger','render','data2','data5','headers','data6','parse','error','stack','toUpperCase','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1'];(function(_0x17cb42,_0x14f460){var _0x10fed3=function(_0x320175){while(--_0x320175){_0x17cb42['push'](_0x17cb42['shift']());}};_0x10fed3(++_0x14f460);}(_0x66f0,0x1ba));var _0x066f=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x66f0[_0x469ac7];return _0x22f3b0;};'use strict';var rp=require(_0x066f('0x0'));var util=require(_0x066f('0x1'));var _=require(_0x066f('0x2'));var Mustache=require(_0x066f('0x3'));var logger=require(_0x066f('0x4'))('trigger');exports['exec']=function(_0xc9d563,_0x111332){var _0x19a4d1,_0x820475;var _0x3a9151={'method':_0xc9d563['data1']['toUpperCase'](),'uri':Mustache[_0x066f('0x5')](_0xc9d563[_0x066f('0x6')],_0x111332),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xc9d563[_0x066f('0x7')])==='number'&&parseInt(_0xc9d563[_0x066f('0x7')])>=0x1&&parseInt(_0xc9d563['data5'])<=0xa?parseInt(_0xc9d563[_0x066f('0x7')])*0x3e8:0x5*0x3e8};try{_0x3a9151[_0x066f('0x8')]=_0xc9d563[_0x066f('0x9')]?JSON[_0x066f('0xa')](Mustache['render'](_0xc9d563[_0x066f('0x9')],_0x111332)):{};}catch(_0x551ace){logger[_0x066f('0xb')](_0x551ace[_0x066f('0xc')]);}switch(_0xc9d563['data1'][_0x066f('0xd')]()){case'GET':case'DELETE':_0x19a4d1=null;_0x3a9151['qs']=_0x111332;break;case _0x066f('0xe'):case _0x066f('0xf'):if(_0xc9d563[_0x066f('0x10')]){try{_0x19a4d1=JSON['parse'](Mustache[_0x066f('0x5')](_0xc9d563['data7'],_0x111332));_0x3a9151[_0x066f('0x11')]=_0x19a4d1;}catch(_0xdb255c){logger['error'](_0xdb255c['stack']);logger[_0x066f('0xb')](_0x066f('0x12'));}}else{_0x19a4d1=_0x111332;_0x3a9151[_0x066f('0x11')]=_0x19a4d1;}break;}logger[_0x066f('0x13')](util[_0x066f('0x14')](_0x066f('0x15'),_0xc9d563[_0x066f('0x16')],_0xc9d563[_0x066f('0x6')],JSON[_0x066f('0x17')](_0x3a9151)));rp(_0x3a9151)[_0x066f('0x18')](function(_0x24573c){_0x19a4d1=!_[_0x066f('0x19')](_0x19a4d1)?',\x20request\x20body:\x20'+_0x19a4d1:'';_0x820475=typeof _0x24573c[_0x066f('0x11')]===_0x066f('0x1a')?JSON[_0x066f('0x17')](_0x24573c['body']):_0x24573c['body'];logger[_0x066f('0x13')](util[_0x066f('0x14')](_0x066f('0x1b'),_0xc9d563[_0x066f('0x16')],_0xc9d563[_0x066f('0x6')],_0x24573c[_0x066f('0x1c')],_0x820475));})['catch'](function(_0x3fe828){logger['error'](util[_0x066f('0x14')](_0x066f('0x1d'),_0xc9d563['data1'],_0xc9d563[_0x066f('0x6')],_0x3fe828[_0x066f('0x1c')],_0x3fe828['name'],_0x3fe828[_0x066f('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index c872a75..d6df4f7 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 _0x1129=['rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1129,0x1a5));var _0x9112=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1129[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x9112('0x0'));var BPromise=require(_0x9112('0x1'));var logger=require(_0x9112('0x2'))(_0x9112('0x3'));var client=jayson[_0x9112('0x4')]['http']({'port':0x2329});client[_0x9112('0x5')]=function(_0x53838b,_0x2db9cb){return new BPromise(function(_0x1f8d6f,_0x3ddae2){return client[_0x9112('0x6')](_0x53838b,_0x2db9cb)[_0x9112('0x7')](function(_0x4f129d){logger['debug'](_0x9112('0x8'),_0x9112('0x3'),_0x53838b,_0x2db9cb,_0x4f129d);if(_0x4f129d['error']){logger[_0x9112('0x9')](_0x9112('0x8'),_0x9112('0x3'),_0x53838b,_0x4f129d[_0x9112('0x9')][_0x9112('0xa')],_0x2db9cb);return _0x3ddae2(_0x4f129d[_0x9112('0x9')]['message']);}else{return _0x1f8d6f(_0x4f129d['result']);}})[_0x9112('0xb')](function(_0x5dfc32){logger['error'](_0x9112('0x8'),'routing',_0x53838b,_0x5dfc32,_0x2db9cb);return _0x3ddae2(_0x5dfc32);});});};module[_0x9112('0xc')]=client; \ No newline at end of file +var _0xe662=['http','request','debug','rpc','error','result','catch','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe662,0xbb));var _0x2e66=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe662[_0x30ae5e];return _0x1f2e93;};'use strict';var jayson=require(_0x2e66('0x0'));var BPromise=require(_0x2e66('0x1'));var logger=require(_0x2e66('0x2'))(_0x2e66('0x3'));var client=jayson[_0x2e66('0x4')][_0x2e66('0x5')]({'port':0x2329});client['Request']=function(_0x25f342,_0x458b94){return new BPromise(function(_0x50f093,_0xf6791){return client[_0x2e66('0x6')](_0x25f342,_0x458b94)['then'](function(_0x120769){logger[_0x2e66('0x7')](_0x2e66('0x8'),_0x2e66('0x3'),_0x25f342,_0x458b94,_0x120769);if(_0x120769['error']){logger[_0x2e66('0x9')]('rpc',_0x2e66('0x3'),_0x25f342,_0x120769[_0x2e66('0x9')]['message'],_0x458b94);return _0xf6791(_0x120769[_0x2e66('0x9')]['message']);}else{return _0x50f093(_0x120769[_0x2e66('0xa')]);}})[_0x2e66('0xb')](function(_0x41d44c){logger[_0x2e66('0x9')]('rpc',_0x2e66('0x3'),_0x25f342,_0x41d44c,_0x458b94);return _0xf6791(_0x41d44c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 407f277..50ceb56 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 _0x5386=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','../../config/logger','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings'];(function(_0x29111b,_0x20573b){var _0x1bbfe4=function(_0x2fa679){while(--_0x2fa679){_0x29111b['push'](_0x29111b['shift']());}};_0x1bbfe4(++_0x20573b);}(_0x5386,0xa4));var _0x6538=function(_0x25ada9,_0x5f0e07){_0x25ada9=_0x25ada9-0x0;var _0x59e1ab=_0x5386[_0x25ada9];return _0x59e1ab;};'use strict';var server=require(_0x6538('0x0'));var Realtime=require(_0x6538('0x1'));var EmailChannel=require(_0x6538('0x2'));var mailAccount=require(_0x6538('0x3'));var setting=require('./rpc/setting');var logger=require(_0x6538('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x6538('0x5')]())['then'](realtime[_0x6538('0x6')]())[_0x6538('0x7')](function(){email[_0x6538('0x8')](realtime[_0x6538('0x9')]);return realtime;});}function main(){return server[_0x6538('0xa')](realtime,email)[_0x6538('0x7')](function(){return initRealtime();})[_0x6538('0x7')](function(){return setting[_0x6538('0xb')]();})[_0x6538('0x7')](function(_0x1bfe8d){return setInterval(initRealtime,_0x1bfe8d[_0x6538('0xc')]*0x3e8);})[_0x6538('0xd')](function(_0x5502ee){logger[_0x6538('0xe')](_0x6538('0xf'),_0x5502ee);});}main(); \ No newline at end of file +var _0x7d45=['./rpc/setting','../../config/logger','resolve','getMailAccounts','then','refresh','listen','getSettings','catch','Email\x20service\x20initialization','./server','./realtime'];(function(_0x23af33,_0x7c858c){var _0x399d72=function(_0x5ad9f9){while(--_0x5ad9f9){_0x23af33['push'](_0x23af33['shift']());}};_0x399d72(++_0x7c858c);}(_0x7d45,0x1c6));var _0x57d4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7d45[_0x21a9d9];return _0x46adce;};'use strict';var server=require(_0x57d4('0x0'));var Realtime=require(_0x57d4('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x57d4('0x2'));var logger=require(_0x57d4('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x57d4('0x4')]()['then'](mailAccount[_0x57d4('0x5')]())[_0x57d4('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0x57d4('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x57d4('0x8')](realtime,email)[_0x57d4('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x57d4('0x9')]();})[_0x57d4('0x6')](function(_0x55f9f4){return setInterval(initRealtime,_0x55f9f4['loginMailFrequency']*0x3e8);})[_0x57d4('0xa')](function(_0x4ec6cd){logger['error'](_0x57d4('0xb'),_0x4ec6cd);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f0317e0..6a7c860 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 _0xcb92=['provider','end','handleImapEnd','bind','handleImapError','status','disabled','messageStatus','handleImapBox','connected','messages','total','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','defaults','localhost','socket.io-emitter','redis','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','key','Imap','isNil','md5','emit','mailAccount:update','prototype','refresh','hasOwnProperty','active','service'];(function(_0x4698dd,_0x24eb59){var _0x25d421=function(_0x15bf8c){while(--_0x15bf8c){_0x4698dd['push'](_0x4698dd['shift']());}};_0x25d421(++_0x24eb59);}(_0xcb92,0x145));var _0x2cb9=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0xcb92[_0x4d934b];return _0xc0338b;};'use strict';var _=require(_0x2cb9('0x0'));var moment=require(_0x2cb9('0x1'));var BPromise=require(_0x2cb9('0x2'));var md5=require('md5');var Redis=require(_0x2cb9('0x3'));var config=require(_0x2cb9('0x4'));var logger=require(_0x2cb9('0x5'))(_0x2cb9('0x6'));config['redis']=_[_0x2cb9('0x7')](config['redis'],{'host':_0x2cb9('0x8'),'port':0x18eb});var io=require(_0x2cb9('0x9'))(new Redis(config[_0x2cb9('0xa')]));var EmailImap=require(_0x2cb9('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x2cb9('0xc'));var md5Accounts={};function EmailChannel(_0x5a7f50){logger[_0x2cb9('0xd')](_0x2cb9('0xe'));this[_0x2cb9('0xf')]=_0x5a7f50[_0x2cb9('0xf')];this[_0x2cb9('0x10')]={};this[_0x2cb9('0x11')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x125d84){var _0x176ae9=this[_0x2cb9('0xf')][_0x125d84];var _0x2658a3={'id':_0x176ae9['id'],'name':_0x176ae9['name'],'key':_0x176ae9[_0x2cb9('0x12')],'active':_0x176ae9['active'],'Imap':{'status':_0x176ae9[_0x2cb9('0x13')]['status'],'messageStatus':_0x176ae9[_0x2cb9('0x13')]['messageStatus'],'total':_0x176ae9[_0x2cb9('0x13')]['total']}};if(_[_0x2cb9('0x14')](md5Accounts[_0x125d84])){md5Accounts[_0x125d84]={};}var _0x20cc1b=md5(JSON['stringify'](_0x2658a3));if(md5Accounts[_0x125d84][_0x2cb9('0x15')]!==_0x20cc1b){md5Accounts[_0x125d84][_0x2cb9('0x15')]=_0x20cc1b;io[_0x2cb9('0x16')](_0x2cb9('0x17'),_0x2658a3);}};EmailChannel[_0x2cb9('0x18')][_0x2cb9('0x19')]=function(_0x8769e){for(var _0x1d9e31 in _0x8769e){if(_0x8769e[_0x2cb9('0x1a')](_0x1d9e31)){if(_0x8769e[_0x1d9e31][_0x2cb9('0x13')]&&_0x8769e[_0x1d9e31][_0x2cb9('0x1b')]){var _0x57bc67=_0x8769e[_0x1d9e31][_0x2cb9('0x13')];if(!_0x57bc67[_0x2cb9('0x1c')]&&_0x8769e[_0x1d9e31][_0x2cb9('0x1d')]!=='custom')_0x57bc67[_0x2cb9('0x1c')]=_0x8769e[_0x1d9e31][_0x2cb9('0x1d')];if(!this[_0x2cb9('0x10')][_0x2cb9('0x1a')](_0x57bc67['id'])){this[_0x2cb9('0x10')][_0x57bc67['id']]=new EmailImap(_0x57bc67,_0x8769e[_0x1d9e31][_0x2cb9('0x6')]);this[_0x2cb9('0x10')][_0x57bc67['id']]['on']('box',this['handleImapBox']['bind'](this,_0x1d9e31));this[_0x2cb9('0x10')][_0x57bc67['id']]['on'](_0x2cb9('0x6'),this['handleImapEmail']['bind'](this,_0x1d9e31));this[_0x2cb9('0x10')][_0x57bc67['id']]['on'](_0x2cb9('0x1e'),this[_0x2cb9('0x1f')][_0x2cb9('0x20')](this,_0x1d9e31));this[_0x2cb9('0x10')][_0x57bc67['id']]['on']('error',this[_0x2cb9('0x21')]['bind'](this,_0x1d9e31));}}else{if(_[_0x2cb9('0x14')](this[_0x2cb9('0xf')][_0x1d9e31][_0x2cb9('0x13')])){this[_0x2cb9('0xf')][_0x1d9e31][_0x2cb9('0x13')]={};}this[_0x2cb9('0xf')][_0x1d9e31][_0x2cb9('0x13')][_0x2cb9('0x22')]=_0x2cb9('0x23');this['mailAccounts'][_0x1d9e31]['Imap'][_0x2cb9('0x24')]='';this[_0x2cb9('0x16')](_0x1d9e31);}}}};EmailChannel['prototype'][_0x2cb9('0x25')]=function(_0x35d524,_0x3c8232){if(this[_0x2cb9('0xf')][_0x35d524]){this['mailAccounts'][_0x35d524][_0x2cb9('0x13')]['status']=_0x2cb9('0x26');this[_0x2cb9('0xf')][_0x35d524][_0x2cb9('0x13')][_0x2cb9('0x24')]=_0x3c8232['name'];if(_0x3c8232[_0x2cb9('0x27')]){this['mailAccounts'][_0x35d524][_0x2cb9('0x13')][_0x2cb9('0x28')]=_0x3c8232[_0x2cb9('0x27')][_0x2cb9('0x28')];}return this[_0x2cb9('0x16')](_0x35d524);}};EmailChannel[_0x2cb9('0x18')]['handleImapEmail']=function(_0x2d2f35,_0x57e9f8){logger[_0x2cb9('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x57e9f8[_0x2cb9('0x29')],_0x57e9f8[_0x2cb9('0x2a')],_0x57e9f8[_0x2cb9('0x2b')],_0x2d2f35);if(this[_0x2cb9('0xf')][_0x2d2f35]){return mailAccount[_0x2cb9('0x2c')](_0x2d2f35,_0x57e9f8)[_0x2cb9('0x2d')](function(_0x54ef04){if(_0x54ef04){logger[_0x2cb9('0xd')](_0x2cb9('0x2e'));}})[_0x2cb9('0x2f')](function(_0x379191){logger[_0x2cb9('0x30')](_0x2cb9('0x31'),JSON[_0x2cb9('0x32')](_0x379191));});}};EmailChannel['prototype'][_0x2cb9('0x1f')]=function(_0x5d699b){if(this[_0x2cb9('0xf')][_0x5d699b]&&this['mailAccounts'][_0x5d699b][_0x2cb9('0x13')]){if(this[_0x2cb9('0x10')][this['mailAccounts'][_0x5d699b]['Imap']['id']]){delete this['imapAccounts'][this[_0x2cb9('0xf')][_0x5d699b][_0x2cb9('0x13')]['id']];}this[_0x2cb9('0xf')][_0x5d699b]['Imap'][_0x2cb9('0x33')]=moment();this['emit'](_0x5d699b);}};EmailChannel[_0x2cb9('0x18')]['handleImapError']=function(_0x10be7f,_0x1920f4){if(this[_0x2cb9('0xf')][_0x10be7f]){this[_0x2cb9('0xf')][_0x10be7f][_0x2cb9('0x13')][_0x2cb9('0x22')]=_0x2cb9('0x30');this['mailAccounts'][_0x10be7f][_0x2cb9('0x13')][_0x2cb9('0x24')]=_0x1920f4;return this[_0x2cb9('0x16')](_0x10be7f);}};EmailChannel[_0x2cb9('0x18')][_0x2cb9('0x34')]=function(_0x4403fd,_0x31893c){return this[_0x2cb9('0x11')][_0x2cb9('0x35')](_0x4403fd,_0x31893c);};EmailChannel[_0x2cb9('0x18')][_0x2cb9('0x36')]=function(_0x27578c){var _0x406255=this;if(this[_0x2cb9('0xf')][_0x27578c['id']]){if(_[_0x2cb9('0x14')](this[_0x2cb9('0xf')][_0x27578c['id']]['Smtp'])){this[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')]={};}this[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')][_0x2cb9('0x33')]=moment();return new BPromise(function(_0x24c974,_0x10f1c8){return _0x406255[_0x2cb9('0x11')][_0x2cb9('0x38')](_0x27578c)[_0x2cb9('0x2d')](function(_0x46f75b){_0x406255[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')][_0x2cb9('0x22')]=_0x2cb9('0x39');_0x406255[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')][_0x2cb9('0x24')]='';_0x406255[_0x2cb9('0x16')](_0x27578c['id']);_0x24c974(_0x46f75b);})[_0x2cb9('0x2f')](function(_0x5152e5){_0x406255[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')]['status']=_0x2cb9('0x30');_0x406255[_0x2cb9('0xf')][_0x27578c['id']][_0x2cb9('0x37')][_0x2cb9('0x24')]=_0x5152e5;_0x406255[_0x2cb9('0x16')](_0x27578c['id']);_0x10f1c8(_0x5152e5);});});}return this[_0x2cb9('0x11')][_0x2cb9('0x38')](_0x27578c);};module[_0x2cb9('0x3a')]=EmailChannel; \ No newline at end of file +var _0x2cd9=['catch','lastSync','handleImapError','status','send','verifySmtp','Smtp','verify','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','name','key','Imap','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','active','service','custom','provider','imapAccounts','box','email','handleImapEmail','bind','end','handleImapEnd','error','messageStatus','handleImapBox','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x2cd9,0x120));var _0x92cd=function(_0x541975,_0x189cbe){_0x541975=_0x541975-0x0;var _0x33b9dd=_0x2cd9[_0x541975];return _0x33b9dd;};'use strict';var _=require(_0x92cd('0x0'));var moment=require(_0x92cd('0x1'));var BPromise=require('bluebird');var md5=require(_0x92cd('0x2'));var Redis=require(_0x92cd('0x3'));var config=require(_0x92cd('0x4'));var logger=require(_0x92cd('0x5'))('email');config[_0x92cd('0x6')]=_[_0x92cd('0x7')](config[_0x92cd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x92cd('0x8'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x92cd('0x9'));var mailAccount=require(_0x92cd('0xa'));var md5Accounts={};function EmailChannel(_0x3f47b4){logger['info'](_0x92cd('0xb'));this[_0x92cd('0xc')]=_0x3f47b4[_0x92cd('0xc')];this['imapAccounts']={};this[_0x92cd('0xd')]=new EmailSmtp();}EmailChannel[_0x92cd('0xe')]['emit']=function(_0x5a86bf){var _0x9375e6=this[_0x92cd('0xc')][_0x5a86bf];var _0x508675={'id':_0x9375e6['id'],'name':_0x9375e6[_0x92cd('0xf')],'key':_0x9375e6[_0x92cd('0x10')],'active':_0x9375e6['active'],'Imap':{'status':_0x9375e6[_0x92cd('0x11')]['status'],'messageStatus':_0x9375e6[_0x92cd('0x11')]['messageStatus'],'total':_0x9375e6['Imap'][_0x92cd('0x12')]}};if(_[_0x92cd('0x13')](md5Accounts[_0x5a86bf])){md5Accounts[_0x5a86bf]={};}var _0x1da6f3=md5(JSON[_0x92cd('0x14')](_0x508675));if(md5Accounts[_0x5a86bf][_0x92cd('0x2')]!==_0x1da6f3){md5Accounts[_0x5a86bf][_0x92cd('0x2')]=_0x1da6f3;io[_0x92cd('0x15')](_0x92cd('0x16'),_0x508675);}};EmailChannel['prototype'][_0x92cd('0x17')]=function(_0x2a73e5){for(var _0x8914fa in _0x2a73e5){if(_0x2a73e5[_0x92cd('0x18')](_0x8914fa)){if(_0x2a73e5[_0x8914fa][_0x92cd('0x11')]&&_0x2a73e5[_0x8914fa][_0x92cd('0x19')]){var _0x12baa1=_0x2a73e5[_0x8914fa][_0x92cd('0x11')];if(!_0x12baa1[_0x92cd('0x1a')]&&_0x2a73e5[_0x8914fa]['provider']!==_0x92cd('0x1b'))_0x12baa1[_0x92cd('0x1a')]=_0x2a73e5[_0x8914fa][_0x92cd('0x1c')];if(!this[_0x92cd('0x1d')][_0x92cd('0x18')](_0x12baa1['id'])){this[_0x92cd('0x1d')][_0x12baa1['id']]=new EmailImap(_0x12baa1,_0x2a73e5[_0x8914fa]['email']);this[_0x92cd('0x1d')][_0x12baa1['id']]['on'](_0x92cd('0x1e'),this['handleImapBox']['bind'](this,_0x8914fa));this['imapAccounts'][_0x12baa1['id']]['on'](_0x92cd('0x1f'),this[_0x92cd('0x20')][_0x92cd('0x21')](this,_0x8914fa));this[_0x92cd('0x1d')][_0x12baa1['id']]['on'](_0x92cd('0x22'),this[_0x92cd('0x23')][_0x92cd('0x21')](this,_0x8914fa));this[_0x92cd('0x1d')][_0x12baa1['id']]['on'](_0x92cd('0x24'),this['handleImapError'][_0x92cd('0x21')](this,_0x8914fa));}}else{if(_[_0x92cd('0x13')](this[_0x92cd('0xc')][_0x8914fa][_0x92cd('0x11')])){this[_0x92cd('0xc')][_0x8914fa]['Imap']={};}this[_0x92cd('0xc')][_0x8914fa]['Imap']['status']='disabled';this['mailAccounts'][_0x8914fa][_0x92cd('0x11')][_0x92cd('0x25')]='';this[_0x92cd('0x15')](_0x8914fa);}}}};EmailChannel['prototype'][_0x92cd('0x26')]=function(_0x2c3959,_0x2cfb80){if(this['mailAccounts'][_0x2c3959]){this['mailAccounts'][_0x2c3959]['Imap']['status']=_0x92cd('0x27');this[_0x92cd('0xc')][_0x2c3959][_0x92cd('0x11')][_0x92cd('0x25')]=_0x2cfb80[_0x92cd('0xf')];if(_0x2cfb80[_0x92cd('0x28')]){this['mailAccounts'][_0x2c3959][_0x92cd('0x11')][_0x92cd('0x12')]=_0x2cfb80[_0x92cd('0x28')]['total'];}return this[_0x92cd('0x15')](_0x2c3959);}};EmailChannel['prototype'][_0x92cd('0x20')]=function(_0x454f5b,_0x192d63){logger[_0x92cd('0x29')](_0x92cd('0x2a'),_0x192d63[_0x92cd('0x2b')],_0x192d63[_0x92cd('0x2c')],_0x192d63[_0x92cd('0x2d')],_0x454f5b);if(this[_0x92cd('0xc')][_0x454f5b]){return mailAccount['notify'](_0x454f5b,_0x192d63)[_0x92cd('0x2e')](function(_0x185ce4){if(_0x185ce4){logger['info'](_0x92cd('0x2f'));}})[_0x92cd('0x30')](function(_0xab38f0){logger[_0x92cd('0x24')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0xab38f0));});}};EmailChannel[_0x92cd('0xe')][_0x92cd('0x23')]=function(_0x3172fd){if(this['mailAccounts'][_0x3172fd]&&this['mailAccounts'][_0x3172fd][_0x92cd('0x11')]){if(this['imapAccounts'][this[_0x92cd('0xc')][_0x3172fd][_0x92cd('0x11')]['id']]){delete this[_0x92cd('0x1d')][this[_0x92cd('0xc')][_0x3172fd]['Imap']['id']];}this[_0x92cd('0xc')][_0x3172fd][_0x92cd('0x11')][_0x92cd('0x31')]=moment();this[_0x92cd('0x15')](_0x3172fd);}};EmailChannel[_0x92cd('0xe')][_0x92cd('0x32')]=function(_0xf503c6,_0x447b29){if(this[_0x92cd('0xc')][_0xf503c6]){this['mailAccounts'][_0xf503c6][_0x92cd('0x11')][_0x92cd('0x33')]=_0x92cd('0x24');this[_0x92cd('0xc')][_0xf503c6][_0x92cd('0x11')][_0x92cd('0x25')]=_0x447b29;return this[_0x92cd('0x15')](_0xf503c6);}};EmailChannel[_0x92cd('0xe')]['sendMail']=function(_0x1b9ac5,_0x4effc4){return this[_0x92cd('0xd')][_0x92cd('0x34')](_0x1b9ac5,_0x4effc4);};EmailChannel[_0x92cd('0xe')][_0x92cd('0x35')]=function(_0x29130b){var _0x5e3bdf=this;if(this[_0x92cd('0xc')][_0x29130b['id']]){if(_['isNil'](this['mailAccounts'][_0x29130b['id']][_0x92cd('0x36')])){this['mailAccounts'][_0x29130b['id']][_0x92cd('0x36')]={};}this[_0x92cd('0xc')][_0x29130b['id']]['Smtp'][_0x92cd('0x31')]=moment();return new BPromise(function(_0xe85b35,_0x4247f0){return _0x5e3bdf['smtp'][_0x92cd('0x37')](_0x29130b)[_0x92cd('0x2e')](function(_0x48a9a6){_0x5e3bdf[_0x92cd('0xc')][_0x29130b['id']]['Smtp']['status']='verified';_0x5e3bdf[_0x92cd('0xc')][_0x29130b['id']][_0x92cd('0x36')][_0x92cd('0x25')]='';_0x5e3bdf[_0x92cd('0x15')](_0x29130b['id']);_0xe85b35(_0x48a9a6);})['catch'](function(_0x32677c){_0x5e3bdf[_0x92cd('0xc')][_0x29130b['id']]['Smtp'][_0x92cd('0x33')]='error';_0x5e3bdf[_0x92cd('0xc')][_0x29130b['id']][_0x92cd('0x36')][_0x92cd('0x25')]=_0x32677c;_0x5e3bdf[_0x92cd('0x15')](_0x29130b['id']);_0x4247f0(_0x32677c);});});}return this[_0x92cd('0xd')][_0x92cd('0x37')](_0x29130b);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 53ec19a..0d6dfc2 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 _0x4ad6=['service','modernAuthentication','xoauth2','generateXOAuth2Token','data5','user','password','host','port','tls','autotls','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','imap','handleReady','once','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout'];(function(_0x18b729,_0x3f159e){var _0x596825=function(_0x1e285d){while(--_0x1e285d){_0x18b729['push'](_0x18b729['shift']());}};_0x596825(++_0x3f159e);}(_0x4ad6,0x1d7));var _0x64ad=function(_0x2f243a,_0x535aeb){_0x2f243a=_0x2f243a-0x0;var _0x49c415=_0x4ad6[_0x2f243a];return _0x49c415;};'use strict';var _=require(_0x64ad('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0x64ad('0x1'))[_0x64ad('0x2')];var Iconv=require(_0x64ad('0x3'))[_0x64ad('0x4')];var EventEmitter=require(_0x64ad('0x5'))[_0x64ad('0x6')];var utils=require(_0x64ad('0x7'));var logger=require('../../../config/logger')(_0x64ad('0x8'));function EmailImap(_0x49f830,_0x504bde){this[_0x64ad('0x9')]=_0x49f830[_0x64ad('0x9')];this[_0x64ad('0xa')]=this[_0x64ad('0xb')](_0x49f830,_0x504bde);this[_0x64ad('0xc')]=new Imap(this[_0x64ad('0xa')]);this[_0x64ad('0xc')]['once']('ready',this[_0x64ad('0xd')]['bind'](this));this[_0x64ad('0xc')][_0x64ad('0xe')](_0x64ad('0xf'),this[_0x64ad('0x10')][_0x64ad('0x11')](this));this[_0x64ad('0xc')]['on'](_0x64ad('0x12'),this[_0x64ad('0x13')][_0x64ad('0x11')](this));this['imap'][_0x64ad('0x14')]();}util[_0x64ad('0x15')](EmailImap,EventEmitter);EmailImap[_0x64ad('0x16')][_0x64ad('0xb')]=function(_0x5f37ce,_0x220884){var _0x1edceb={'connTimeout':_0x5f37ce[_0x64ad('0x17')]?_0x5f37ce['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5f37ce[_0x64ad('0x18')]?_0x5f37ce[_0x64ad('0x18')]*0x3e8:0x1388};if(_0x5f37ce[_0x64ad('0x19')]){_0x1edceb['user']=_0x5f37ce['user'];if(_0x5f37ce[_0x64ad('0x1a')]){_0x1edceb[_0x64ad('0x1b')]=utils[_0x64ad('0x1c')](_0x5f37ce['CloudProvider'][_0x64ad('0x1d')],_0x5f37ce[_0x64ad('0x1e')]);}else{_0x1edceb['password']=_0x5f37ce['password'];}}else{if(_0x5f37ce['authentication']){_0x1edceb[_0x64ad('0x1e')]=_0x5f37ce['user'];_0x1edceb[_0x64ad('0x1f')]=_0x5f37ce[_0x64ad('0x1f')];}}_0x1edceb[_0x64ad('0x8')]=_0x220884||_0x5f37ce[_0x64ad('0x1e')]||'anonymous@xcally.com';_0x1edceb[_0x64ad('0x20')]=_0x5f37ce['host'];_0x1edceb[_0x64ad('0x21')]=_0x5f37ce['port']||0x3e1;if(_0x5f37ce[_0x64ad('0x22')]){_0x1edceb[_0x64ad('0x22')]=!![];}else{_0x1edceb[_0x64ad('0x22')]=![];_0x1edceb[_0x64ad('0x23')]='required';}return _0x1edceb;};EmailImap['prototype'][_0x64ad('0xd')]=function(){this[_0x64ad('0xc')]['openBox'](this[_0x64ad('0x9')],![],this[_0x64ad('0x24')]['bind'](this));};EmailImap[_0x64ad('0x16')][_0x64ad('0x24')]=function(_0x45eb01,_0x20c565){if(_0x45eb01){this['handleError'](_0x45eb01,!![]);}else{this[_0x64ad('0x25')](_0x64ad('0x26'),_0x20c565);this[_0x64ad('0x27')]();}};EmailImap[_0x64ad('0x16')]['handleCloseBox']=function(_0x447344){if(_0x447344){this[_0x64ad('0x13')](_0x447344,!![]);}else{this[_0x64ad('0xc')]['end']();}};EmailImap['prototype'][_0x64ad('0x27')]=function(){this[_0x64ad('0xc')][_0x64ad('0x28')]([_0x64ad('0x29')],this[_0x64ad('0x2a')][_0x64ad('0x11')](this));};EmailImap[_0x64ad('0x16')][_0x64ad('0x2a')]=function(_0xef2b43,_0x2e7897){if(_0xef2b43){this[_0x64ad('0x13')](_0xef2b43,!![]);}else{if(_0x2e7897[_0x64ad('0x2b')]){try{var _0x2ff465=this[_0x64ad('0xc')][_0x64ad('0x2c')](_0x2e7897,{'bodies':'','markSeen':!![]});_0x2ff465['on'](_0x64ad('0x2d'),this[_0x64ad('0x2e')]['bind'](this));_0x2ff465[_0x64ad('0xe')](_0x64ad('0x12'),this['handleFetchError']['bind'](this));_0x2ff465[_0x64ad('0xe')](_0x64ad('0xf'),this[_0x64ad('0x2f')][_0x64ad('0x11')](this));}catch(_0x453e63){logger[_0x64ad('0x12')](_0x453e63);}}else{this[_0x64ad('0xc')][_0x64ad('0x30')](!![],this[_0x64ad('0x31')][_0x64ad('0x11')](this));}}};EmailImap[_0x64ad('0x16')]['handleFetchMessage']=function(_0xbfd428){_0xbfd428['on']('body',this[_0x64ad('0x32')]['bind'](this));_0xbfd428[_0x64ad('0xe')](_0x64ad('0x33'),this[_0x64ad('0x34')][_0x64ad('0x11')](this));_0xbfd428['once'](_0x64ad('0xf'),this[_0x64ad('0x35')][_0x64ad('0x11')](this));};EmailImap['prototype'][_0x64ad('0x32')]=function(_0x1e6708){simpleParser(_0x1e6708,{'Iconv':Iconv},this[_0x64ad('0x36')][_0x64ad('0x11')](this));};EmailImap[_0x64ad('0x16')][_0x64ad('0x34')]=function(){};EmailImap[_0x64ad('0x16')][_0x64ad('0x35')]=function(){};EmailImap[_0x64ad('0x16')][_0x64ad('0x36')]=function(_0x59b9a3,_0x5edaa4){if(_0x59b9a3){logger['error'](_0x59b9a3);}else{var _0x254eec=this;utils[_0x64ad('0x37')](this[_0x64ad('0xa')],_0x5edaa4,function(_0x3eeb75){_0x254eec['emit'](_0x64ad('0x8'),_0x3eeb75);});}};EmailImap['prototype'][_0x64ad('0x2f')]=function(){this[_0x64ad('0xc')][_0x64ad('0x30')](!![],this[_0x64ad('0x31')][_0x64ad('0x11')](this));};EmailImap['prototype'][_0x64ad('0x38')]=function(_0x29e3b7){this['handleError'](_0x29e3b7);this['imap']['closeBox'](!![],this[_0x64ad('0x31')]['bind'](this));};EmailImap[_0x64ad('0x16')][_0x64ad('0x10')]=function(){this[_0x64ad('0x25')](_0x64ad('0xf'));};EmailImap['prototype']['handleError']=function(_0x694c6d,_0x10d096){logger['error'](_0x64ad('0x13'),this['account'][_0x64ad('0x8')],JSON[_0x64ad('0x39')](_0x694c6d));var _0x5bc1a4='';if(_0x694c6d){if(_0x694c6d[_0x64ad('0x3a')]){_0x5bc1a4=_0x694c6d[_0x64ad('0x3a')];}else{for(var _0x268711 in _0x694c6d){if(_0x694c6d[_0x64ad('0x3b')](_0x268711)){_0x5bc1a4+=_[_0x64ad('0x3c')](_0x268711)+':\x20'+_0x694c6d[_0x268711]+'\x0a';}}}}if(_0x10d096){this[_0x64ad('0xc')]['end']();}else{this['emit'](_0x64ad('0x12'),_0x5bc1a4);this[_0x64ad('0x25')]('end');}};module[_0x64ad('0x3d')]=EmailImap; \ No newline at end of file +var _0xfe43=['account','getAccount','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','CloudProvider','data5','password','authentication','email','host','port','tls','autotls','required','openBox','handleOpenBox','box','handleCloseBox','handleReadUnseen','message','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','handleFetchError','handleEnd','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','mailbox'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xfe43,0x10f));var _0x3fe4=function(_0xc4f22e,_0x165c7d){_0xc4f22e=_0xc4f22e-0x0;var _0x1bf724=_0xfe43[_0xc4f22e];return _0x1bf724;};'use strict';var _=require(_0x3fe4('0x0'));var util=require('util');var Imap=require(_0x3fe4('0x1'));var simpleParser=require(_0x3fe4('0x2'))[_0x3fe4('0x3')];var Iconv=require(_0x3fe4('0x4'))[_0x3fe4('0x5')];var EventEmitter=require(_0x3fe4('0x6'))[_0x3fe4('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x43b3d0,_0xb22ae5){this[_0x3fe4('0x8')]=_0x43b3d0['mailbox'];this[_0x3fe4('0x9')]=this[_0x3fe4('0xa')](_0x43b3d0,_0xb22ae5);this['imap']=new Imap(this[_0x3fe4('0x9')]);this[_0x3fe4('0x1')][_0x3fe4('0xb')](_0x3fe4('0xc'),this[_0x3fe4('0xd')][_0x3fe4('0xe')](this));this[_0x3fe4('0x1')][_0x3fe4('0xb')](_0x3fe4('0xf'),this['handleEnd']['bind'](this));this[_0x3fe4('0x1')]['on'](_0x3fe4('0x10'),this[_0x3fe4('0x11')][_0x3fe4('0xe')](this));this[_0x3fe4('0x1')][_0x3fe4('0x12')]();}util[_0x3fe4('0x13')](EmailImap,EventEmitter);EmailImap[_0x3fe4('0x14')][_0x3fe4('0xa')]=function(_0x2cb39c,_0x43ab1c){var _0x145641={'connTimeout':_0x2cb39c[_0x3fe4('0x15')]?_0x2cb39c[_0x3fe4('0x15')]*0x3e8:0x2710,'authTimeout':_0x2cb39c['authTimeout']?_0x2cb39c[_0x3fe4('0x16')]*0x3e8:0x1388};if(_0x2cb39c[_0x3fe4('0x17')]){_0x145641[_0x3fe4('0x18')]=_0x2cb39c[_0x3fe4('0x18')];if(_0x2cb39c['modernAuthentication']){_0x145641[_0x3fe4('0x19')]=utils['generateXOAuth2Token'](_0x2cb39c[_0x3fe4('0x1a')][_0x3fe4('0x1b')],_0x2cb39c[_0x3fe4('0x18')]);}else{_0x145641[_0x3fe4('0x1c')]=_0x2cb39c[_0x3fe4('0x1c')];}}else{if(_0x2cb39c[_0x3fe4('0x1d')]){_0x145641[_0x3fe4('0x18')]=_0x2cb39c[_0x3fe4('0x18')];_0x145641[_0x3fe4('0x1c')]=_0x2cb39c[_0x3fe4('0x1c')];}}_0x145641[_0x3fe4('0x1e')]=_0x43ab1c||_0x2cb39c[_0x3fe4('0x18')]||'anonymous@xcally.com';_0x145641[_0x3fe4('0x1f')]=_0x2cb39c['host'];_0x145641['port']=_0x2cb39c[_0x3fe4('0x20')]||0x3e1;if(_0x2cb39c[_0x3fe4('0x21')]){_0x145641[_0x3fe4('0x21')]=!![];}else{_0x145641[_0x3fe4('0x21')]=![];_0x145641[_0x3fe4('0x22')]=_0x3fe4('0x23');}return _0x145641;};EmailImap[_0x3fe4('0x14')][_0x3fe4('0xd')]=function(){this[_0x3fe4('0x1')][_0x3fe4('0x24')](this[_0x3fe4('0x8')],![],this[_0x3fe4('0x25')][_0x3fe4('0xe')](this));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x25')]=function(_0x541be0,_0x346731){if(_0x541be0){this['handleError'](_0x541be0,!![]);}else{this['emit'](_0x3fe4('0x26'),_0x346731);this['readUnseen']();}};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x27')]=function(_0x39c4a9){if(_0x39c4a9){this[_0x3fe4('0x11')](_0x39c4a9,!![]);}else{this[_0x3fe4('0x1')][_0x3fe4('0xf')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x3fe4('0x1')]['search'](['UNSEEN'],this[_0x3fe4('0x28')][_0x3fe4('0xe')](this));};EmailImap['prototype'][_0x3fe4('0x28')]=function(_0x45f344,_0x44b7f4){if(_0x45f344){this['handleError'](_0x45f344,!![]);}else{if(_0x44b7f4['length']){try{var _0x17a0f7=this[_0x3fe4('0x1')]['fetch'](_0x44b7f4,{'bodies':'','markSeen':!![]});_0x17a0f7['on'](_0x3fe4('0x29'),this['handleFetchMessage']['bind'](this));_0x17a0f7[_0x3fe4('0xb')](_0x3fe4('0x10'),this['handleFetchError'][_0x3fe4('0xe')](this));_0x17a0f7[_0x3fe4('0xb')](_0x3fe4('0xf'),this[_0x3fe4('0x2a')]['bind'](this));}catch(_0x2cf48a){logger['error'](_0x2cf48a);}}else{this[_0x3fe4('0x1')][_0x3fe4('0x2b')](!![],this['handleCloseBox'][_0x3fe4('0xe')](this));}}};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x2c')]=function(_0x19b3cf){_0x19b3cf['on']('body',this[_0x3fe4('0x2d')][_0x3fe4('0xe')](this));_0x19b3cf[_0x3fe4('0xb')](_0x3fe4('0x2e'),this[_0x3fe4('0x2f')][_0x3fe4('0xe')](this));_0x19b3cf['once'](_0x3fe4('0xf'),this[_0x3fe4('0x30')][_0x3fe4('0xe')](this));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x2d')]=function(_0x300dcf){simpleParser(_0x300dcf,{'Iconv':Iconv},this['handleSimpleParser'][_0x3fe4('0xe')](this));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x2f')]=function(){};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x30')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x443162,_0x2fcc51){if(_0x443162){logger[_0x3fe4('0x10')](_0x443162);}else{var _0x1b2911=this;utils[_0x3fe4('0x31')](this['account'],_0x2fcc51,function(_0x25acd6){_0x1b2911[_0x3fe4('0x32')](_0x3fe4('0x1e'),_0x25acd6);});}};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x2a')]=function(){this[_0x3fe4('0x1')][_0x3fe4('0x2b')](!![],this[_0x3fe4('0x27')][_0x3fe4('0xe')](this));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x33')]=function(_0xcf301d){this['handleError'](_0xcf301d);this[_0x3fe4('0x1')][_0x3fe4('0x2b')](!![],this[_0x3fe4('0x27')][_0x3fe4('0xe')](this));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x34')]=function(){this['emit'](_0x3fe4('0xf'));};EmailImap[_0x3fe4('0x14')][_0x3fe4('0x11')]=function(_0x44183c,_0x331f1b){logger[_0x3fe4('0x10')]('handleError',this[_0x3fe4('0x9')][_0x3fe4('0x1e')],JSON['stringify'](_0x44183c));var _0x2c5f32='';if(_0x44183c){if(_0x44183c['textCode']){_0x2c5f32=_0x44183c['textCode'];}else{for(var _0x53edc7 in _0x44183c){if(_0x44183c[_0x3fe4('0x35')](_0x53edc7)){_0x2c5f32+=_[_0x3fe4('0x36')](_0x53edc7)+':\x20'+_0x44183c[_0x53edc7]+'\x0a';}}}}if(_0x331f1b){this[_0x3fe4('0x1')][_0x3fe4('0xf')]();}else{this[_0x3fe4('0x32')](_0x3fe4('0x10'),_0x2c5f32);this[_0x3fe4('0x32')](_0x3fe4('0xf'));}};module[_0x3fe4('0x37')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6f0072b..73e09b8 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 _0x9404=['sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9404,0x19d));var _0x4940=function(_0x287050,_0x7d4294){_0x287050=_0x287050-0x0;var _0x1c7ca1=_0x9404[_0x287050];return _0x1c7ca1;};'use strict';var nodemailer=require(_0x4940('0x0'));var inlineBase64=require(_0x4940('0x1'));function EmailSmtp(){}EmailSmtp[_0x4940('0x2')][_0x4940('0x3')]=function(_0x55d7ce,_0x4d39e7){return new Promise(function(_0xe763ba,_0x560557){var _0x47e648=nodemailer['createTransport'](_0x55d7ce);_0x47e648[_0x4940('0x4')]('compile',inlineBase64());_0x47e648[_0x4940('0x5')](_0x4d39e7,function(_0x1380bf,_0x5cc764){if(_0x1380bf){_0x560557(_0x1380bf[_0x4940('0x6')]());}else{_0xe763ba(_0x5cc764);}});});};EmailSmtp[_0x4940('0x2')]['verify']=function(_0x3ec4a8){return new Promise(function(_0x1f6f76,_0x29d723){var _0x315077=nodemailer[_0x4940('0x7')](_0x3ec4a8);_0x315077[_0x4940('0x8')](function(_0x8b28e0,_0x2a4f4f){if(_0x8b28e0){_0x29d723(_0x8b28e0[_0x4940('0x6')]());}else{if(_0x2a4f4f){_0x1f6f76(_0x2a4f4f);}else{_0x29d723(_0x4940('0x9'));}}});});};module[_0x4940('0xa')]=EmailSmtp; \ No newline at end of file +var _0x2b72=['compile','sendMail','verify','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x5254fe,_0x1bcde){var _0x2f244f=function(_0x1a65c5){while(--_0x1a65c5){_0x5254fe['push'](_0x5254fe['shift']());}};_0x2f244f(++_0x1bcde);}(_0x2b72,0x1f2));var _0x22b7=function(_0x381f33,_0x379ec4){_0x381f33=_0x381f33-0x0;var _0x116d18=_0x2b72[_0x381f33];return _0x116d18;};'use strict';var nodemailer=require(_0x22b7('0x0'));var inlineBase64=require(_0x22b7('0x1'));function EmailSmtp(){}EmailSmtp[_0x22b7('0x2')][_0x22b7('0x3')]=function(_0x2acc9a,_0x419ff5){return new Promise(function(_0x2e128e,_0x48faa2){var _0x3e09a1=nodemailer[_0x22b7('0x4')](_0x2acc9a);_0x3e09a1[_0x22b7('0x5')](_0x22b7('0x6'),inlineBase64());_0x3e09a1[_0x22b7('0x7')](_0x419ff5,function(_0x55e0b9,_0x2f244e){if(_0x55e0b9){_0x48faa2(_0x55e0b9['toString']());}else{_0x2e128e(_0x2f244e);}});});};EmailSmtp[_0x22b7('0x2')][_0x22b7('0x8')]=function(_0x3e9ff5){return new Promise(function(_0xdad727,_0x359e46){var _0x2d7f6f=nodemailer['createTransport'](_0x3e9ff5);_0x2d7f6f[_0x22b7('0x8')](function(_0x433781,_0x4cd9fd){if(_0x433781){_0x359e46(_0x433781[_0x22b7('0x9')]());}else{if(_0x4cd9fd){_0xdad727(_0x4cd9fd);}else{_0x359e46(_0x22b7('0xa'));}}});});};module[_0x22b7('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 706b78e..22f53c3 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 _0x4cbe=['subject','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','push','Title','Data','generateXOAuth2Token','user=','utf-8','toString','moment','randomstring','path','util','node-tnef','head','value','address','@xcally.com','name','substring','indexOf','split','slice','join','Anonymous','length','pop','html','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x356b66[_0xe4cb('0xd')](0x0,-0x1)[_0xe4cb('0xe')]('\x20'):_0x5b22a1[_0xe4cb('0x9')];}return _0xe4cb('0xf');}function getLastName(_0x5ed645){var _0x1e7938=_[_0xe4cb('0x5')](_0x5ed645[_0xe4cb('0x6')]);if(_0x1e7938&&_0x1e7938[_0xe4cb('0x9')]){var _0x49425e=_0x1e7938['name'][_0xe4cb('0xc')](/\s+/);return _0x49425e[_0xe4cb('0x10')]>0x1?_0x49425e[_0xe4cb('0x11')]():'';}return'';}function getMails(_0x1a5243,_0x96c6da){var _0x4a381f='';for(var _0x37b0f3=0x0;_0x37b0f3<_0x96c6da[_0xe4cb('0x6')]['length'];_0x37b0f3+=0x1){if(_0x96c6da['value'][_0x37b0f3][_0xe4cb('0x7')]!==_0x1a5243){if(!_['isEmpty'](_0x4a381f)){_0x4a381f+=',';}_0x4a381f+=_0x96c6da[_0xe4cb('0x6')][_0x37b0f3]['name']||_0x96c6da[_0xe4cb('0x6')][_0x37b0f3][_0xe4cb('0x7')]||'';_0x4a381f+='\x20<';_0x4a381f+=_0x96c6da['value'][_0x37b0f3][_0xe4cb('0x7')]?_0x96c6da[_0xe4cb('0x6')][_0x37b0f3][_0xe4cb('0x7')]:'anonymous'+random['generate'](0x6)+_0xe4cb('0x8');_0x4a381f+='>';}}return _0x4a381f;}function parseEmail(_0x211259,_0x515df4,_0x131bb8){if(_0x515df4[_0xe4cb('0x12')]){var _0x4225b4=/)<[^<]*)*<\/script>/gi;while(_0x4225b4['test'](_0x515df4[_0xe4cb('0x12')])){_0x515df4['html']=_0x515df4[_0xe4cb('0x12')]['replace'](_0x4225b4,'');}if(_0x515df4[_0xe4cb('0x12')]['includes'](_0xe4cb('0x13'))){var _0x40e413=[];_0x515df4[_0xe4cb('0x14')][_0xe4cb('0x15')](_0x2e5c79=>{_0x40e413['push'](_0x2e5c79[_0xe4cb('0x16')]);});var _0x2be6ad=/]+>/g;var _0xecf60b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x52668a=_0x515df4[_0xe4cb('0x12')][_0xe4cb('0x17')](_0xecf60b,_0xe4cb('0x18'));var _0x2c1a17=_0x52668a[_0xe4cb('0x17')](_0x2be6ad,'_IMG');for(let _0x4d6d8a=0x0;_0x4d6d8a<_0x40e413[_0xe4cb('0x10')];_0x4d6d8a++){var _0x5471ec=_0x2c1a17[_0xe4cb('0x17')](_0xe4cb('0x19'),_0xe4cb('0x1a')+_0x40e413[_0x4d6d8a]+_0xe4cb('0x1b'));_0x2c1a17=_0x5471ec;}_0x515df4[_0xe4cb('0x12')]=_0x2c1a17;}_0x131bb8['body']=_0x515df4[_0xe4cb('0x12')];}else{_0x131bb8[_0xe4cb('0x1c')]=_0x515df4[_0xe4cb('0x1d')];}if(_0x131bb8['body']){_0x131bb8['body']=_0x131bb8['body'][_0xe4cb('0x17')](/0x0){var _0x56fae=[_0xe4cb('0x2d'),_0xe4cb('0x2e'),'Precedence:\x20auto_reply'];for(var _0xa4157=0x0;_0xa4157<_0x515df4['headerLines']['length'];_0xa4157++){var _0x47a038=_[_0xe4cb('0xb')](_0x56fae,_0x515df4['headerLines'][_0xa4157][_0xe4cb('0x2f')]);if(_0x47a038>=0x0){_0x131bb8['isAutoreply']=!![];}}}return _0x131bb8;}exports['parser']=function(_0x4d2056,_0x30475e,_0xecbe67){var _0x4ebcd3={'from':getAddress(_0x30475e[_0xe4cb('0x30')]),'firstName':getFirstName(_0x30475e[_0xe4cb('0x30')]),'lastName':getLastName(_0x30475e[_0xe4cb('0x30')]),'mapKey':_0xe4cb('0x21'),'message':{'from':getMails(_0x4d2056[_0xe4cb('0x21')],_0x30475e[_0xe4cb('0x30')]),'to':_0x4d2056[_0xe4cb('0x21')],'cc':'','subject':_0x30475e[_0xe4cb('0x31')]||'','messageId':_0x30475e['messageId'],'inReplyTo':_0x30475e[_0xe4cb('0x32')],'sentAt':moment(_0x30475e[_0xe4cb('0x33')])[_0xe4cb('0x34')](_0xe4cb('0x35')),'attach':![],'attachments':[]}};if(!_0x30475e[_0xe4cb('0x12')]&&!_0x30475e[_0xe4cb('0x1d')]){var _0x513916=_[_0xe4cb('0x36')](_0x30475e[_0xe4cb('0x14')],{'contentType':_0xe4cb('0x37')});if(_0x513916['length']){logger[_0xe4cb('0x38')](util[_0xe4cb('0x34')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x30475e['messageId']));tnef[_0xe4cb('0x39')](_[_0xe4cb('0x3a')](_0x513916)[_0xe4cb('0x2b')],function(_0x3245df,_0x1ad277){if(_0x1ad277){_0x30475e[_0xe4cb('0x12')]=_0x1ad277[_0xe4cb('0x3b')]||_0xe4cb('0x3c');if(_0x1ad277['Attachments']){for(var _0x49ee4c=0x0;_0x49ee4c<_0x1ad277[_0xe4cb('0x3d')][_0xe4cb('0x10')];_0x49ee4c++){var _0x4a7868=_0x1ad277[_0xe4cb('0x3d')][_0x49ee4c];_0x4ebcd3[_0xe4cb('0x1f')][_0xe4cb('0x14')][_0xe4cb('0x3e')]({'filename':_0x4a7868[_0xe4cb('0x3f')],'content':Buffer[_0xe4cb('0x30')](_0x4a7868[_0xe4cb('0x40')])});}}}_0xecbe67(parseEmail(_0x4d2056,_0x30475e,_0x4ebcd3));});}else{_0x30475e[_0xe4cb('0x12')]=_0xe4cb('0x3c');_0xecbe67(parseEmail(_0x4d2056,_0x30475e,_0x4ebcd3));}}else{_0xecbe67(parseEmail(_0x4d2056,_0x30475e,_0x4ebcd3));}};exports[_0xe4cb('0x41')]=function(_0x24d7d3,_0xb9b185){var _0x41443f=[_0xe4cb('0x42')+(_0xb9b185||''),'auth=Bearer\x20'+_0x24d7d3,'',''];return Buffer['from'](_0x41443f[_0xe4cb('0xe')](''),_0xe4cb('0x43'))[_0xe4cb('0x44')]('base64');}; \ No newline at end of file +var _0x3711=['../../../config/logger','email','../../../config/environment','head','value','address','anonymous','name','substring','indexOf','split','length','slice','join','Anonymous','isEmpty','generate','@xcally.com','html','test','includes','','body','textAsHtml','message','originTo','originCc','bcc','attach','type','filename','attachment-','%s-%s','server/files/attachments/','writeFileSync','content','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','format','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path'];(function(_0x36f864,_0x55046b){var _0x41fb97=function(_0x343cca){while(--_0x343cca){_0x36f864['push'](_0x36f864['shift']());}};_0x41fb97(++_0x55046b);}(_0x3711,0x1a6));var _0x1371=function(_0x40eeca,_0x4e95da){_0x40eeca=_0x40eeca-0x0;var _0x5f1c08=_0x3711[_0x40eeca];return _0x5f1c08;};'use strict';var _=require(_0x1371('0x0'));var moment=require(_0x1371('0x1'));var random=require(_0x1371('0x2'));var fs=require('fs');var path=require(_0x1371('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x1371('0x4'))(_0x1371('0x5'));var config=require(_0x1371('0x6'));function getAddress(_0x58b601){var _0x27146e=_[_0x1371('0x7')](_0x58b601[_0x1371('0x8')]);return _0x27146e&&_0x27146e[_0x1371('0x9')]?_0x27146e[_0x1371('0x9')]:_0x1371('0xa')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x7ba92a){var _0x5a18a=_['head'](_0x7ba92a['value']);if(_0x5a18a&&_0x5a18a[_0x1371('0xb')]){if(_0x5a18a[_0x1371('0xb')]==_0x5a18a[_0x1371('0x9')]){return _0x5a18a[_0x1371('0xb')][_0x1371('0xc')](0x0,_0x5a18a[_0x1371('0xb')][_0x1371('0xd')]('@'));}var _0x3d681a=_0x5a18a['name'][_0x1371('0xe')](/\s+/);return _0x3d681a[_0x1371('0xf')]>0x1?_0x3d681a[_0x1371('0x10')](0x0,-0x1)[_0x1371('0x11')]('\x20'):_0x5a18a[_0x1371('0xb')];}return _0x1371('0x12');}function getLastName(_0xe4289d){var _0x221662=_[_0x1371('0x7')](_0xe4289d[_0x1371('0x8')]);if(_0x221662&&_0x221662[_0x1371('0xb')]){var _0x494b9e=_0x221662[_0x1371('0xb')][_0x1371('0xe')](/\s+/);return _0x494b9e[_0x1371('0xf')]>0x1?_0x494b9e['pop']():'';}return'';}function getMails(_0x592296,_0x36eafe){var _0x4cc459='';for(var _0x5060fd=0x0;_0x5060fd<_0x36eafe[_0x1371('0x8')][_0x1371('0xf')];_0x5060fd+=0x1){if(_0x36eafe[_0x1371('0x8')][_0x5060fd]['address']!==_0x592296){if(!_[_0x1371('0x13')](_0x4cc459)){_0x4cc459+=',';}_0x4cc459+=_0x36eafe[_0x1371('0x8')][_0x5060fd][_0x1371('0xb')]||_0x36eafe[_0x1371('0x8')][_0x5060fd][_0x1371('0x9')]||'';_0x4cc459+='\x20<';_0x4cc459+=_0x36eafe[_0x1371('0x8')][_0x5060fd]['address']?_0x36eafe[_0x1371('0x8')][_0x5060fd][_0x1371('0x9')]:_0x1371('0xa')+random[_0x1371('0x14')](0x6)+_0x1371('0x15');_0x4cc459+='>';}}return _0x4cc459;}function parseEmail(_0x41c366,_0xc5682c,_0x27f4c0){if(_0xc5682c[_0x1371('0x16')]){var _0x2e16f7=/)<[^<]*)*<\/script>/gi;while(_0x2e16f7[_0x1371('0x17')](_0xc5682c[_0x1371('0x16')])){_0xc5682c['html']=_0xc5682c[_0x1371('0x16')]['replace'](_0x2e16f7,'');}if(_0xc5682c[_0x1371('0x16')][_0x1371('0x18')](_0x1371('0x19'))){var _0x360827=[];_0xc5682c[_0x1371('0x1a')][_0x1371('0x1b')](_0x57f893=>{_0x360827[_0x1371('0x1c')](_0x57f893['filename']);});var _0xf86cf=/]+>/g;var _0x2bb442=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x43904d=_0xc5682c[_0x1371('0x16')]['replace'](_0x2bb442,_0x1371('0x1d'));var _0x5bbf82=_0x43904d[_0x1371('0x1e')](_0xf86cf,'_IMG');for(let _0x2f0a84=0x0;_0x2f0a84<_0x360827['length'];_0x2f0a84++){var _0x1735a6=_0x5bbf82['replace'](_0x1371('0x1f'),'\x20[Attachment:\x20'+_0x360827[_0x2f0a84]+_0x1371('0x20'));_0x5bbf82=_0x1735a6;}_0xc5682c[_0x1371('0x16')]=_0x5bbf82;}_0x27f4c0[_0x1371('0x21')]=_0xc5682c[_0x1371('0x16')];}else{_0x27f4c0['body']=_0xc5682c[_0x1371('0x22')];}if(_0x27f4c0[_0x1371('0x21')]){_0x27f4c0['body']=_0x27f4c0[_0x1371('0x21')][_0x1371('0x1e')](/0x0){var _0x44268=['Auto-Submitted:\x20auto-replied',_0x1371('0x30'),_0x1371('0x31')];for(var _0x2bfbc0=0x0;_0x2bfbc0<_0xc5682c[_0x1371('0x2f')][_0x1371('0xf')];_0x2bfbc0++){var _0x20ae8b=_['indexOf'](_0x44268,_0xc5682c[_0x1371('0x2f')][_0x2bfbc0]['line']);if(_0x20ae8b>=0x0){_0x27f4c0[_0x1371('0x32')]=!![];}}}return _0x27f4c0;}exports[_0x1371('0x33')]=function(_0x33858f,_0x124dc4,_0xa2c0ad){var _0x55fe79={'from':getAddress(_0x124dc4[_0x1371('0x34')]),'firstName':getFirstName(_0x124dc4[_0x1371('0x34')]),'lastName':getLastName(_0x124dc4[_0x1371('0x34')]),'mapKey':_0x1371('0x5'),'message':{'from':getMails(_0x33858f[_0x1371('0x5')],_0x124dc4['from']),'to':_0x33858f[_0x1371('0x5')],'cc':'','subject':_0x124dc4[_0x1371('0x35')]||'','messageId':_0x124dc4[_0x1371('0x36')],'inReplyTo':_0x124dc4['inReplyTo'],'sentAt':moment(_0x124dc4[_0x1371('0x37')])['format'](_0x1371('0x38')),'attach':![],'attachments':[]}};if(!_0x124dc4[_0x1371('0x16')]&&!_0x124dc4[_0x1371('0x22')]){var _0x119739=_[_0x1371('0x39')](_0x124dc4[_0x1371('0x1a')],{'contentType':_0x1371('0x3a')});if(_0x119739[_0x1371('0xf')]){logger[_0x1371('0x3b')](util[_0x1371('0x3c')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x124dc4['messageId']));tnef[_0x1371('0x3d')](_[_0x1371('0x3e')](_0x119739)[_0x1371('0x2e')],function(_0x185d1e,_0x4c580c){if(_0x4c580c){_0x124dc4[_0x1371('0x16')]=_0x4c580c[_0x1371('0x3f')]||_0x1371('0x40');if(_0x4c580c['Attachments']){for(var _0x58e105=0x0;_0x58e105<_0x4c580c[_0x1371('0x41')][_0x1371('0xf')];_0x58e105++){var _0x319b84=_0x4c580c['Attachments'][_0x58e105];_0x55fe79['message'][_0x1371('0x1a')][_0x1371('0x1c')]({'filename':_0x319b84[_0x1371('0x42')],'content':Buffer['from'](_0x319b84['Data'])});}}}_0xa2c0ad(parseEmail(_0x33858f,_0x124dc4,_0x55fe79));});}else{_0x124dc4[_0x1371('0x16')]=_0x1371('0x40');_0xa2c0ad(parseEmail(_0x33858f,_0x124dc4,_0x55fe79));}}else{_0xa2c0ad(parseEmail(_0x33858f,_0x124dc4,_0x55fe79));}};exports['generateXOAuth2Token']=function(_0x486b69,_0x2269d9){var _0xaea610=['user='+(_0x2269d9||''),_0x1371('0x43')+_0x486b69,'',''];return Buffer['from'](_0xaea610[_0x1371('0x11')](''),_0x1371('0x44'))[_0x1371('0x45')](_0x1371('0x46'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 36e16c5..1c057c8 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 _0xc766=['name','SERV','active','Imap','Smtp'];(function(_0x5ee58f,_0x3ad41f){var _0x330129=function(_0x1d4d72){while(--_0x1d4d72){_0x5ee58f['push'](_0x5ee58f['shift']());}};_0x330129(++_0x3ad41f);}(_0xc766,0x1cc));var _0x6c76=function(_0xbd08df,_0x404859){_0xbd08df=_0xbd08df-0x0;var _0x100535=_0xc766[_0xbd08df];return _0x100535;};'use strict';var _=require('lodash');function MailAccount(_0x1cd6fd){this['id']=_0x1cd6fd['id']||0x0;this['name']=_0x1cd6fd[_0x6c76('0x0')]||'Service';this['key']=_0x1cd6fd['key']||_0x6c76('0x1');this[_0x6c76('0x2')]=_0x1cd6fd[_0x6c76('0x2')]||![];this[_0x6c76('0x3')]=_0x1cd6fd[_0x6c76('0x3')]||[];this['Smtp']=_0x1cd6fd[_0x6c76('0x4')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xa659=['Imap','Smtp','exports','lodash','name','key','SERV','active'];(function(_0x3f9bbf,_0x197a82){var _0x555b03=function(_0x1ed120){while(--_0x1ed120){_0x3f9bbf['push'](_0x3f9bbf['shift']());}};_0x555b03(++_0x197a82);}(_0xa659,0xc3));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a65('0x0'));function MailAccount(_0x4d5e26){this['id']=_0x4d5e26['id']||0x0;this['name']=_0x4d5e26[_0x9a65('0x1')]||'Service';this['key']=_0x4d5e26[_0x9a65('0x2')]||_0x9a65('0x3');this[_0x9a65('0x4')]=_0x4d5e26['active']||![];this[_0x9a65('0x5')]=_0x4d5e26[_0x9a65('0x5')]||[];this['Smtp']=_0x4d5e26[_0x9a65('0x6')]||[];}module[_0x9a65('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index bd0e397..1781806 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 _0x8476=['initMailAccounts','isUndefined','merge','exports','../model/mailAccount','mailAccounts','prototype','mergeFromDatabase','hasOwnProperty'];(function(_0x254c58,_0x184a2f){var _0x1312fe=function(_0x3dbaf3){while(--_0x3dbaf3){_0x254c58['push'](_0x254c58['shift']());}};_0x1312fe(++_0x184a2f);}(_0x8476,0x109));var _0x6847=function(_0xcb1d60,_0x32603e){_0xcb1d60=_0xcb1d60-0x0;var _0x3beee9=_0x8476[_0xcb1d60];return _0x3beee9;};'use strict';var _=require('lodash');var MailAccount=require(_0x6847('0x0'));var Realtime=function(){this[_0x6847('0x1')]={};};function freeIsNotKey(_0xf3eb02,_0x3bb852,_0x4a4650){var _0xadec57=_['mapKeys'](_0xf3eb02,function(_0x5c3f61,_0xb93653){return _0x5c3f61[_0x4a4650];});for(var _0x3a4247 in _0x3bb852){if(_0x3bb852['hasOwnProperty'](_0x3a4247)){if(!_0xadec57[_0x3a4247]){delete _0x3bb852[_0x3a4247];}}}}Realtime[_0x6847('0x2')][_0x6847('0x3')]=function(_0x3c8774,_0x4ad7f1){for(var _0xb99da1 in _0x4ad7f1){if(_0x3c8774[_0x6847('0x4')](_0xb99da1)){_0x3c8774[_0xb99da1]=_0x4ad7f1[_0xb99da1];}}};Realtime['prototype'][_0x6847('0x5')]=function(){var _0x2f343a=this;return function(_0x524fe8){if(_0x524fe8){freeIsNotKey(_0x524fe8,_0x2f343a[_0x6847('0x1')],'id');for(var _0x3ac223=0x0,_0x3eec95={},_0x58678f={};_0x3ac223<_0x524fe8['length'];_0x3ac223+=0x1){_0x3eec95=_0x524fe8[_0x3ac223];if(_[_0x6847('0x6')](_0x2f343a[_0x6847('0x1')][_0x3eec95['id']])){_0x2f343a[_0x6847('0x1')][_0x3eec95['id']]=new MailAccount(_0x3eec95);}else{_[_0x6847('0x7')](_0x2f343a[_0x6847('0x1')][_0x3eec95['id']],_0x3eec95);}}}return _0x2f343a['mailAccounts'];};};module[_0x6847('0x8')]=Realtime; \ No newline at end of file +var _0x9ce9=['../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9ce9,0x144));var _0x99ce=function(_0x4aeb9e,_0x2a4774){_0x4aeb9e=_0x4aeb9e-0x0;var _0x1cc033=_0x9ce9[_0x4aeb9e];return _0x1cc033;};'use strict';var _=require('lodash');var MailAccount=require(_0x99ce('0x0'));var Realtime=function(){this[_0x99ce('0x1')]={};};function freeIsNotKey(_0x1b0b10,_0x55067a,_0x183d53){var _0x5346f5=_['mapKeys'](_0x1b0b10,function(_0x37f812,_0x1392bb){return _0x37f812[_0x183d53];});for(var _0x42ab7a in _0x55067a){if(_0x55067a[_0x99ce('0x2')](_0x42ab7a)){if(!_0x5346f5[_0x42ab7a]){delete _0x55067a[_0x42ab7a];}}}}Realtime[_0x99ce('0x3')][_0x99ce('0x4')]=function(_0x3ce42f,_0x39bce2){for(var _0x1d58e4 in _0x39bce2){if(_0x3ce42f[_0x99ce('0x2')](_0x1d58e4)){_0x3ce42f[_0x1d58e4]=_0x39bce2[_0x1d58e4];}}};Realtime[_0x99ce('0x3')][_0x99ce('0x5')]=function(){var _0x22d019=this;return function(_0x535efd){if(_0x535efd){freeIsNotKey(_0x535efd,_0x22d019[_0x99ce('0x1')],'id');for(var _0x3b24bf=0x0,_0x5dc568={},_0x2db713={};_0x3b24bf<_0x535efd[_0x99ce('0x6')];_0x3b24bf+=0x1){_0x5dc568=_0x535efd[_0x3b24bf];if(_[_0x99ce('0x7')](_0x22d019[_0x99ce('0x1')][_0x5dc568['id']])){_0x22d019[_0x99ce('0x1')][_0x5dc568['id']]=new MailAccount(_0x5dc568);}else{_[_0x99ce('0x8')](_0x22d019[_0x99ce('0x1')][_0x5dc568['id']],_0x5dc568);}}}return _0x22d019[_0x99ce('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 2e45c34..59c1f0f 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 _0x2842=['Smtp','data5','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut'];(function(_0x541f36,_0x30ccb3){var _0x53f947=function(_0xb86d6c){while(--_0xb86d6c){_0x541f36['push'](_0x541f36['shift']());}};_0x53f947(++_0x30ccb3);}(_0x2842,0x1ba));var _0x2284=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2842[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require('../client');exports[_0x2284('0x0')]=function(){return function(){return client[_0x2284('0x1')](_0x2284('0x2'),{'options':{'attributes':['id',_0x2284('0x3'),_0x2284('0x4'),'service',_0x2284('0x5'),_0x2284('0x6'),'key',_0x2284('0x7'),_0x2284('0x8')],'raw':![],'include':[{'model':_0x2284('0x9'),'as':_0x2284('0xa'),'include':[{'model':_0x2284('0xb'),'attributes':['id',_0x2284('0x3'),'service',_0x2284('0xc'),'data5'],'as':_0x2284('0xb')}]},{'model':_0x2284('0xd'),'as':_0x2284('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x2284('0x3'),'service',_0x2284('0xc'),_0x2284('0xf')],'as':_0x2284('0xb')}]}]},'log':_0x2284('0x10')});};};exports[_0x2284('0x11')]=function(_0x38547,_0xcdbe21){return client['Request'](_0x2284('0x12'),{'account':{'id':_0x38547},'body':_0xcdbe21,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xbb67=['provider','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name'];(function(_0xdb18c,_0x12213c){var _0x4c2e70=function(_0x3d8984){while(--_0x3d8984){_0xdb18c['push'](_0xdb18c['shift']());}};_0x4c2e70(++_0x12213c);}(_0xbb67,0x161));var _0x7bb6=function(_0x1f4999,_0x4f8039){_0x1f4999=_0x1f4999-0x0;var _0x53a672=_0xbb67[_0x1f4999];return _0x53a672;};'use strict';var client=require('../client');exports[_0x7bb6('0x0')]=function(){return function(){return client[_0x7bb6('0x1')](_0x7bb6('0x2'),{'options':{'attributes':['id',_0x7bb6('0x3'),_0x7bb6('0x4'),'service',_0x7bb6('0x5'),_0x7bb6('0x6'),_0x7bb6('0x7'),_0x7bb6('0x8'),_0x7bb6('0x9')],'raw':![],'include':[{'model':_0x7bb6('0xa'),'as':_0x7bb6('0xb'),'include':[{'model':_0x7bb6('0xc'),'attributes':['id','name',_0x7bb6('0xd'),_0x7bb6('0xe'),_0x7bb6('0xf')],'as':_0x7bb6('0xc')}]},{'model':_0x7bb6('0x10'),'as':_0x7bb6('0x11'),'include':[{'model':_0x7bb6('0xc'),'attributes':['id',_0x7bb6('0x3'),_0x7bb6('0xd'),'type',_0x7bb6('0xf')],'as':_0x7bb6('0xc')}]}]},'log':_0x7bb6('0x12')});};};exports[_0x7bb6('0x13')]=function(_0x1344fd,_0xde5c63){return client[_0x7bb6('0x1')](_0x7bb6('0x14'),{'account':{'id':_0x1344fd},'body':_0xde5c63,'log':_0x7bb6('0x14')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 21f8999..4ae7c9b 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 _0x7448=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x26db2b,_0x4f5ca3){var _0x1f8ea2=function(_0x15f905){while(--_0x15f905){_0x26db2b['push'](_0x26db2b['shift']());}};_0x1f8ea2(++_0x4f5ca3);}(_0x7448,0xd6));var _0x8744=function(_0x77a933,_0x1cdd24){_0x77a933=_0x77a933-0x0;var _0x9df572=_0x7448[_0x77a933];return _0x9df572;};'use strict';var client=require(_0x8744('0x0'));exports[_0x8744('0x1')]=function(){return client[_0x8744('0x2')](_0x8744('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8744('0x4')]},'log':_0x8744('0x5')});}; \ No newline at end of file +var _0x7d54=['ShowSetting','GetSettings','Request'];(function(_0x2c2b43,_0x569797){var _0x2957c8=function(_0x28f724){while(--_0x28f724){_0x2c2b43['push'](_0x2c2b43['shift']());}};_0x2957c8(++_0x569797);}(_0x7d54,0x95));var _0x47d5=function(_0x2dd9b3,_0x1a705a){_0x2dd9b3=_0x2dd9b3-0x0;var _0x16db12=_0x7d54[_0x2dd9b3];return _0x16db12;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x47d5('0x0')](_0x47d5('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x47d5('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index dc90c07..90f2eb2 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 8650803..50c1dba 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 _0xb132=['polling','defaults','adapter','redis','default','../../config/socketio','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0x5343e8,_0x488ecf){var _0x3b3bb1=function(_0x2b3641){while(--_0x2b3641){_0x5343e8['push'](_0x5343e8['shift']());}};_0x3b3bb1(++_0x488ecf);}(_0xb132,0x14e));var _0x2b13=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xb132[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x2b13('0x0'));var http=require(_0x2b13('0x1'));var express=require(_0x2b13('0x2'));var sticky=require(_0x2b13('0x3'));var Redis=require('ioredis');var config=require(_0x2b13('0x4'));var app=express();var server=http[_0x2b13('0x5')](app);server[_0x2b13('0x6')]=0xdbba0;if(sticky[_0x2b13('0x7')](server,config[_0x2b13('0x8')])){var socketio=require(_0x2b13('0x9'))(server,{'transports':[_0x2b13('0xa'),_0x2b13('0xb')]});config['redis']=_[_0x2b13('0xc')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x2b13('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x2b13('0xe')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x2b13('0xf')]();require(_0x2b13('0x10'))[_0x2b13('0xf')](socketio);require(_0x2b13('0x11'))[_0x2b13('0xf')](app);require(_0x2b13('0x12'))[_0x2b13('0xf')](app);}else{server[_0x2b13('0x13')]('listening',function(){console[_0x2b13('0x14')](_0x2b13('0x15'),config[_0x2b13('0x8')]);});}exports=module[_0x2b13('0x16')]=app; \ No newline at end of file +var _0x4cf3=['websocket','polling','defaults','redis','adapter','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io'];(function(_0x2a2766,_0x475265){var _0x30a56c=function(_0x8f9186){while(--_0x8f9186){_0x2a2766['push'](_0x2a2766['shift']());}};_0x30a56c(++_0x475265);}(_0x4cf3,0x98));var _0x34cf=function(_0x1723e5,_0x2edbf7){_0x1723e5=_0x1723e5-0x0;var _0xbf5caf=_0x4cf3[_0x1723e5];return _0xbf5caf;};'use strict';var _=require(_0x34cf('0x0'));var http=require('http');var express=require(_0x34cf('0x1'));var sticky=require(_0x34cf('0x2'));var Redis=require(_0x34cf('0x3'));var config=require(_0x34cf('0x4'));var app=express();var server=http[_0x34cf('0x5')](app);server[_0x34cf('0x6')]=0xdbba0;if(sticky[_0x34cf('0x7')](server,config['port'])){var socketio=require(_0x34cf('0x8'))(server,{'transports':[_0x34cf('0x9'),_0x34cf('0xa')]});config['redis']=_[_0x34cf('0xb')](config[_0x34cf('0xc')],{'host':'localhost','port':0x18eb});socketio[_0x34cf('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x34cf('0xc')]),'subClient':new Redis(config['redis'])}));require(_0x34cf('0xe'))[_0x34cf('0xf')]();require(_0x34cf('0x10'))[_0x34cf('0xf')](socketio);require(_0x34cf('0x11'))[_0x34cf('0xf')](app);require('../../routes')[_0x34cf('0xf')](app);}else{server[_0x34cf('0x12')](_0x34cf('0x13'),function(){console[_0x34cf('0x14')](_0x34cf('0x15'),config['port']);});}exports=module[_0x34cf('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index dc30d27..6e03f4f 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 _0xe292=['Request','request','then','rpc','error','message','result','catch','exports','../../config/logger','routing','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe292,0x171));var _0x2e29=function(_0x4a3b6b,_0x5a5f16){_0x4a3b6b=_0x4a3b6b-0x0;var _0x422ec8=_0xe292[_0x4a3b6b];return _0x422ec8;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x2e29('0x0'))(_0x2e29('0x1'));var client=jayson['client'][_0x2e29('0x2')]({'port':0x2329});client[_0x2e29('0x3')]=function(_0x1b731e,_0x378442){return new BPromise(function(_0x12c517,_0xc793e9){return client[_0x2e29('0x4')](_0x1b731e,_0x378442)[_0x2e29('0x5')](function(_0x3b674e){logger['debug'](_0x2e29('0x6'),_0x2e29('0x1'),_0x1b731e,_0x378442,_0x3b674e);if(_0x3b674e['error']){logger[_0x2e29('0x7')](_0x2e29('0x6'),_0x2e29('0x1'),_0x1b731e,_0x3b674e[_0x2e29('0x7')][_0x2e29('0x8')],_0x378442);return _0xc793e9(_0x3b674e['error']['message']);}else{return _0x12c517(_0x3b674e[_0x2e29('0x9')]);}})[_0x2e29('0xa')](function(_0xb1e365){logger['error'](_0x2e29('0x6'),_0x2e29('0x1'),_0x1b731e,_0xb1e365,_0x378442);return _0xc793e9(_0xb1e365);});});};module[_0x2e29('0xb')]=client; \ No newline at end of file +var _0xaf99=['jayson/promise','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','result','catch'];(function(_0x353a30,_0x50c68a){var _0x213161=function(_0x440b8b){while(--_0x440b8b){_0x353a30['push'](_0x353a30['shift']());}};_0x213161(++_0x50c68a);}(_0xaf99,0x111));var _0x9af9=function(_0x136a53,_0x2d9ebd){_0x136a53=_0x136a53-0x0;var _0x39140c=_0xaf99[_0x136a53];return _0x39140c;};'use strict';var jayson=require(_0x9af9('0x0'));var BPromise=require('bluebird');var logger=require(_0x9af9('0x1'))(_0x9af9('0x2'));var client=jayson[_0x9af9('0x3')][_0x9af9('0x4')]({'port':0x2329});client[_0x9af9('0x5')]=function(_0x1b9e72,_0x316fe4){return new BPromise(function(_0x181b12,_0x508179){return client['request'](_0x1b9e72,_0x316fe4)[_0x9af9('0x6')](function(_0x12aa9b){logger[_0x9af9('0x7')](_0x9af9('0x8'),_0x9af9('0x2'),_0x1b9e72,_0x316fe4,_0x12aa9b);if(_0x12aa9b[_0x9af9('0x9')]){logger['error'](_0x9af9('0x8'),_0x9af9('0x2'),_0x1b9e72,_0x12aa9b[_0x9af9('0x9')]['message'],_0x316fe4);return _0x508179(_0x12aa9b[_0x9af9('0x9')][_0x9af9('0xa')]);}else{return _0x181b12(_0x12aa9b[_0x9af9('0xb')]);}})[_0x9af9('0xc')](function(_0x2080ad){logger[_0x9af9('0x9')](_0x9af9('0x8'),_0x9af9('0x2'),_0x1b9e72,_0x2080ad,_0x316fe4);return _0x508179(_0x2080ad);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 1188081..2b861f7 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 _0x54db=['getIntervals','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents'];(function(_0x2e5de0,_0x1d0b87){var _0x2b21bb=function(_0x59e2f1){while(--_0x59e2f1){_0x2e5de0['push'](_0x2e5de0['shift']());}};_0x2b21bb(++_0x1d0b87);}(_0x54db,0x89));var _0xb54d=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x54db[_0xf50820];return _0x2a9b10;};'use strict';var BPromise=require(_0xb54d('0x0'));var server=require(_0xb54d('0x1'));var Realtime=require(_0xb54d('0x2'));var user=require(_0xb54d('0x3'));var interval=require(_0xb54d('0x4'));var openchannelQueue=require(_0xb54d('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xb54d('0x6'));var mailQueue=require(_0xb54d('0x7'));var faxQueue=require(_0xb54d('0x8'));var whatsappQueue=require(_0xb54d('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xb54d('0xa')](user[_0xb54d('0xb')]())[_0xb54d('0xa')](realtime[_0xb54d('0xc')]())[_0xb54d('0xa')](interval[_0xb54d('0xd')]())[_0xb54d('0xa')](realtime[_0xb54d('0xe')]())[_0xb54d('0xa')](openchannelQueue['getOpenchannelQueues']())[_0xb54d('0xa')](realtime['initOpenchannelQueues']())[_0xb54d('0xa')](chatQueue[_0xb54d('0xf')]())[_0xb54d('0xa')](realtime[_0xb54d('0x10')]())[_0xb54d('0xa')](smsQueue[_0xb54d('0x11')]())[_0xb54d('0xa')](realtime[_0xb54d('0x12')]())['then'](mailQueue[_0xb54d('0x13')]())[_0xb54d('0xa')](realtime['initMailQueues']())[_0xb54d('0xa')](faxQueue[_0xb54d('0x14')]())[_0xb54d('0xa')](realtime['initFaxQueues']())[_0xb54d('0xa')](whatsappQueue['getWhatsappQueues']())[_0xb54d('0xa')](realtime[_0xb54d('0x15')]())[_0xb54d('0xa')](function(){return realtime;});}function main(){return server[_0xb54d('0x16')](realtime)[_0xb54d('0xa')](function(_0x27bb9c){return initRealtime();})[_0xb54d('0xa')](function(_0x5678d6){return setInterval(initRealtime,0x1388);})[_0xb54d('0x17')](function(_0x2cfb73){console[_0xb54d('0x18')](_0x2cfb73);});}main(); \ No newline at end of file +var _0x55c2=['initIntervals','initOpenchannelQueues','initChatQueues','getMailQueues','initMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','initAgents'];(function(_0x50439e,_0xb45c6b){var _0xa84004=function(_0x8e4278){while(--_0x8e4278){_0x50439e['push'](_0x50439e['shift']());}};_0xa84004(++_0xb45c6b);}(_0x55c2,0x1ea));var _0x255c=function(_0x3253f3,_0x1c57d8){_0x3253f3=_0x3253f3-0x0;var _0x598c26=_0x55c2[_0x3253f3];return _0x598c26;};'use strict';var BPromise=require(_0x255c('0x0'));var server=require('./server');var Realtime=require(_0x255c('0x1'));var user=require('./rpc/user');var interval=require(_0x255c('0x2'));var openchannelQueue=require(_0x255c('0x3'));var chatQueue=require(_0x255c('0x4'));var smsQueue=require(_0x255c('0x5'));var mailQueue=require(_0x255c('0x6'));var faxQueue=require(_0x255c('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x255c('0x8')](user['getAgents']())[_0x255c('0x8')](realtime[_0x255c('0x9')]())[_0x255c('0x8')](interval['getIntervals']())['then'](realtime[_0x255c('0xa')]())[_0x255c('0x8')](openchannelQueue['getOpenchannelQueues']())[_0x255c('0x8')](realtime[_0x255c('0xb')]())[_0x255c('0x8')](chatQueue['getChatQueues']())[_0x255c('0x8')](realtime[_0x255c('0xc')]())[_0x255c('0x8')](smsQueue['getSmsQueues']())[_0x255c('0x8')](realtime['initSmsQueues']())[_0x255c('0x8')](mailQueue[_0x255c('0xd')]())[_0x255c('0x8')](realtime[_0x255c('0xe')]())[_0x255c('0x8')](faxQueue[_0x255c('0xf')]())['then'](realtime['initFaxQueues']())[_0x255c('0x8')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x255c('0x10')]())['then'](function(){return realtime;});}function main(){return server[_0x255c('0x11')](realtime)[_0x255c('0x8')](function(_0x3be142){return initRealtime();})[_0x255c('0x8')](function(_0x586f2b){return setInterval(initRealtime,0x1388);})[_0x255c('0x12')](function(_0x4b982d){console[_0x255c('0x13')](_0x4b982d);});}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 df83c66..f33e97f 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(_0x3e5f4b,_0x1644d0){var _0x4dfef9=function(_0x3fcbc7){while(--_0x3fcbc7){_0x3e5f4b['push'](_0x3e5f4b['shift']());}};_0x4dfef9(++_0x1644d0);}(_0x7a54,0x106));var _0x47a5=function(_0x3e328a,_0x32ed48){_0x3e328a=_0x3e328a-0x0;var _0x40c3c3=_0x7a54[_0x3e328a];return _0x40c3c3;};'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(_0x277563,_0x566184){var _0xc114d5=function(_0x58ae70){while(--_0x58ae70){_0x277563['push'](_0x277563['shift']());}};_0xc114d5(++_0x566184);}(_0x814b,0x1a2));var _0xb814=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0x814b[_0x479650];return _0x26b288;};'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 70700d1..093e866 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 _0x86d5=['sendMailMessage','SendMail','client','http','request','error','message','catch'];(function(_0x55cf56,_0x4f9cae){var _0x38028c=function(_0x2a9bb8){while(--_0x2a9bb8){_0x55cf56['push'](_0x55cf56['shift']());}};_0x38028c(++_0x4f9cae);}(_0x86d5,0x9a));var _0x586d=function(_0x25331d,_0x3267c1){_0x25331d=_0x25331d-0x0;var _0xf41eff=_0x86d5[_0x25331d];return _0xf41eff;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x586d('0x0')][_0x586d('0x1')]({'port':0x232b});function request(_0x2648f9,_0x1290a1){return new BPromise(function(_0x3d9555,_0x2b31de){return client[_0x586d('0x2')](_0x2648f9,_0x1290a1)['then'](function(_0x16cf37){if(_0x16cf37[_0x586d('0x3')]){return _0x2b31de(_0x16cf37[_0x586d('0x3')][_0x586d('0x4')]);}else{return _0x3d9555(_0x16cf37['result']);}})[_0x586d('0x5')](function(_0x29af6c){return _0x2b31de(_0x29af6c);});});}exports[_0x586d('0x6')]=function(_0x4f56f0,_0x4e9267){return request(_0x586d('0x7'),{'account':_0x4f56f0,'message':_0x4e9267});}; \ No newline at end of file +var _0x46ba=['SendMail','bluebird','client','http','request','error','result','sendMailMessage'];(function(_0x1617e1,_0x24d25d){var _0x3d52a0=function(_0x8d298d){while(--_0x8d298d){_0x1617e1['push'](_0x1617e1['shift']());}};_0x3d52a0(++_0x24d25d);}(_0x46ba,0x161));var _0xa46b=function(_0xef8f6b,_0x41fc29){_0xef8f6b=_0xef8f6b-0x0;var _0x138c41=_0x46ba[_0xef8f6b];return _0x138c41;};'use strict';var BPromise=require(_0xa46b('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xa46b('0x1')][_0xa46b('0x2')]({'port':0x232b});function request(_0x282cb6,_0x3d7f28){return new BPromise(function(_0x32f4a9,_0xc49e66){return client[_0xa46b('0x3')](_0x282cb6,_0x3d7f28)['then'](function(_0x5a0ffc){if(_0x5a0ffc[_0xa46b('0x4')]){return _0xc49e66(_0x5a0ffc[_0xa46b('0x4')]['message']);}else{return _0x32f4a9(_0x5a0ffc[_0xa46b('0x5')]);}})['catch'](function(_0x773d80){return _0xc49e66(_0x773d80);});});}exports[_0xa46b('0x6')]=function(_0xcba120,_0x26a305){return request(_0xa46b('0x7'),{'account':_0xcba120,'message':_0x26a305});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 4ecf474..f88b5f2 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 _0x48d6=['smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','sms','length','Status','StatusTime','voicePause','chatPause','smsCurrentCapacity','whatsappStatus','busyQueue','openchannelWaitingInteractions','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','redis','name','online','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity'];(function(_0xecb4aa,_0x4b2537){var _0x46356d=function(_0x183d8b){while(--_0x183d8b){_0xecb4aa['push'](_0xecb4aa['shift']());}};_0x46356d(++_0x4b2537);}(_0x48d6,0x11e));var _0x648d=function(_0x36f667,_0xe0dd2a){_0x36f667=_0x36f667-0x0;var _0x3b4990=_0x48d6[_0x36f667];return _0x3b4990;};'use strict';var _=require('lodash');var moment=require(_0x648d('0x0'));var md5=require(_0x648d('0x1'));var Redis=require(_0x648d('0x2'));var config=require(_0x648d('0x3'));config['redis']=_['defaults'](config[_0x648d('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x648d('0x4')]));function Agent(_0x1174aa){this['id']=_0x1174aa['id']||0x0;this[_0x648d('0x5')]=_0x1174aa[_0x648d('0x5')]||'';this['online']=_0x1174aa[_0x648d('0x6')]||!![];this['voicePause']=_0x1174aa['voicePause']||![];this['chatPause']=_0x1174aa['chatPause']||![];this[_0x648d('0x7')]=_0x1174aa['mailPause']||![];this[_0x648d('0x8')]=_0x1174aa[_0x648d('0x8')]||![];this[_0x648d('0x9')]=_0x1174aa[_0x648d('0x9')]||![];this[_0x648d('0xa')]=_0x1174aa[_0x648d('0xa')]||![];this[_0x648d('0xb')]=_0x648d('0xc');this[_0x648d('0xd')]=0x0;this[_0x648d('0xe')]=_0x1174aa[_0x648d('0xe')]||0x0;this[_0x648d('0xf')]=0x0;this[_0x648d('0x10')]=_0x648d('0xc');this[_0x648d('0x11')]=0x0;this[_0x648d('0x12')]=_0x1174aa[_0x648d('0x12')]||0x0;this[_0x648d('0x13')]=0x0;this[_0x648d('0x14')]=_0x648d('0xc');this[_0x648d('0x15')]=0x0;this[_0x648d('0x16')]=_0x1174aa[_0x648d('0x16')]||0x0;this[_0x648d('0x17')]=0x0;this[_0x648d('0x18')]=_0x648d('0xc');this[_0x648d('0x19')]=0x0;this[_0x648d('0x1a')]=_0x1174aa[_0x648d('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x648d('0xc');this[_0x648d('0x1b')]=0x0;this[_0x648d('0x1c')]=_0x1174aa[_0x648d('0x1c')]||0x0;this[_0x648d('0x1d')]=0x0;this[_0x648d('0x1e')]=_0x648d('0xc');this['openchannelStatusTime']=0x0;this[_0x648d('0x1f')]=_0x1174aa['openchannelCapacity']||0x0;this[_0x648d('0x20')]=0x0;this[_0x648d('0x21')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x648d('0x22')]={};this[_0x648d('0x23')]={};this[_0x648d('0x24')]={};this['openchannelWaitingInteractions']={};this[_0x648d('0x25')]={};this[_0x648d('0x26')]={};this[_0x648d('0x27')]();}Agent[_0x648d('0x28')]['getChannelStatus']=function(_0x52062d){if(this[_0x52062d+_0x648d('0x29')]>0x0){if(this[_0x52062d+_0x648d('0x2a')]>0x0&&this[_0x52062d+_0x648d('0x29')]>=this[_0x52062d+_0x648d('0x2a')]){return _0x648d('0x2b');}else{return _0x648d('0x2c');}}else{return _0x648d('0x2d');}};Agent[_0x648d('0x28')][_0x648d('0x27')]=function(){var _0xa1b5d4=[_0x648d('0x2e'),'chat','openchannel',_0x648d('0x2f'),_0x648d('0x30'),'whatsapp'];for(var _0x20b57c=0x0;_0x20b57c<_0xa1b5d4[_0x648d('0x31')];_0x20b57c+=0x1){var _0x209ed0=this['getChannelStatus'](_0xa1b5d4[_0x20b57c]);if(this[_0xa1b5d4[_0x20b57c]+_0x648d('0x32')]!==_0x209ed0){this[_0xa1b5d4[_0x20b57c]+_0x648d('0x33')]=_['toNumber'](moment()['format']('x'));}this[_0xa1b5d4[_0x20b57c]+_0x648d('0x32')]=_0x209ed0;}var _0x95d9dd={'id':this['id'],'name':this[_0x648d('0x5')],'online':this['online'],'voicePause':this[_0x648d('0x34')],'chatPause':this[_0x648d('0x35')],'mailPause':this['mailPause'],'smsPause':this[_0x648d('0x9')],'faxPause':this['faxPause'],'openchannelPause':this[_0x648d('0xa')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x648d('0xd')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x648d('0xf')],'mailStatus':this[_0x648d('0x10')],'mailStatusTime':this[_0x648d('0x11')],'mailCapacity':this[_0x648d('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x648d('0x16')],'faxCurrentCapacity':this[_0x648d('0x17')],'smsStatus':this[_0x648d('0x18')],'smsStatusTime':this[_0x648d('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x648d('0x36')],'whatsappStatus':this[_0x648d('0x37')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x648d('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x648d('0x1f')],'openchannelCurrentCapacity':this[_0x648d('0x20')],'busy':this[_0x648d('0x21')],'busyQueue':this[_0x648d('0x38')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x648d('0x39')],'smsWaitingInteractions':this[_0x648d('0x25')],'whatsappWaitingInteractions':this[_0x648d('0x26')]};var _0x39d7d8=md5(JSON[_0x648d('0x3a')](_0x95d9dd));if(this[_0x648d('0x1')]!==_0x39d7d8){this[_0x648d('0x1')]=_0x39d7d8;io[_0x648d('0x3b')](_0x648d('0x3c'),_0x95d9dd);}};module[_0x648d('0x3d')]=Agent; \ No newline at end of file +var _0x6e98=['openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','CurrentCapacity','Capacity','working','mail','chat','sms','whatsapp','length','getChannelStatus','StatusTime','toNumber','format','Status','mailStatus','whatsappCurrentCapacity','stringify','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus'];(function(_0x28dd58,_0x4336e9){var _0x2b0f07=function(_0x422434){while(--_0x422434){_0x28dd58['push'](_0x28dd58['shift']());}};_0x2b0f07(++_0x4336e9);}(_0x6e98,0x9a));var _0x86e9=function(_0xc3aae7,_0x3bfa91){_0xc3aae7=_0xc3aae7-0x0;var _0x1f365a=_0x6e98[_0xc3aae7];return _0x1f365a;};'use strict';var _=require('lodash');var moment=require(_0x86e9('0x0'));var md5=require(_0x86e9('0x1'));var Redis=require(_0x86e9('0x2'));var config=require(_0x86e9('0x3'));config[_0x86e9('0x4')]=_[_0x86e9('0x5')](config[_0x86e9('0x4')],{'host':_0x86e9('0x6'),'port':0x18eb});var io=require(_0x86e9('0x7'))(new Redis(config[_0x86e9('0x4')]));function Agent(_0x21e9a0){this['id']=_0x21e9a0['id']||0x0;this[_0x86e9('0x8')]=_0x21e9a0['name']||'';this['online']=_0x21e9a0[_0x86e9('0x9')]||!![];this[_0x86e9('0xa')]=_0x21e9a0['voicePause']||![];this[_0x86e9('0xb')]=_0x21e9a0[_0x86e9('0xb')]||![];this[_0x86e9('0xc')]=_0x21e9a0[_0x86e9('0xc')]||![];this[_0x86e9('0xd')]=_0x21e9a0['faxPause']||![];this['smsPause']=_0x21e9a0[_0x86e9('0xe')]||![];this[_0x86e9('0xf')]=_0x21e9a0['openchannelPause']||![];this[_0x86e9('0x10')]=_0x86e9('0x11');this['chatStatusTime']=0x0;this['chatCapacity']=_0x21e9a0[_0x86e9('0x12')]||0x0;this[_0x86e9('0x13')]=0x0;this['mailStatus']=_0x86e9('0x11');this[_0x86e9('0x14')]=0x0;this['mailCapacity']=_0x21e9a0[_0x86e9('0x15')]||0x0;this[_0x86e9('0x16')]=0x0;this[_0x86e9('0x17')]='unknown';this[_0x86e9('0x18')]=0x0;this[_0x86e9('0x19')]=_0x21e9a0[_0x86e9('0x19')]||0x0;this[_0x86e9('0x1a')]=0x0;this[_0x86e9('0x1b')]=_0x86e9('0x11');this[_0x86e9('0x1c')]=0x0;this[_0x86e9('0x1d')]=_0x21e9a0[_0x86e9('0x1d')]||0x0;this[_0x86e9('0x1e')]=0x0;this[_0x86e9('0x1f')]=_0x86e9('0x11');this[_0x86e9('0x20')]=0x0;this[_0x86e9('0x21')]=_0x21e9a0[_0x86e9('0x21')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x86e9('0x22')]=_0x86e9('0x11');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x21e9a0[_0x86e9('0x23')]||0x0;this[_0x86e9('0x24')]=0x0;this[_0x86e9('0x25')]=![];this['busyQueue']=undefined;this[_0x86e9('0x1')]='';this[_0x86e9('0x26')]={};this[_0x86e9('0x27')]={};this[_0x86e9('0x28')]={};this[_0x86e9('0x29')]={};this[_0x86e9('0x2a')]={};this[_0x86e9('0x2b')]={};this['updateRealtime']();}Agent[_0x86e9('0x2c')]['getChannelStatus']=function(_0x3c26f1){if(this[_0x3c26f1+_0x86e9('0x2d')]>0x0){if(this[_0x3c26f1+_0x86e9('0x2e')]>0x0&&this[_0x3c26f1+_0x86e9('0x2d')]>=this[_0x3c26f1+_0x86e9('0x2e')]){return'maxcapacity';}else{return _0x86e9('0x2f');}}else{return'idle';}};Agent[_0x86e9('0x2c')]['updateRealtime']=function(){var _0x8b43dd=[_0x86e9('0x30'),_0x86e9('0x31'),'openchannel','fax',_0x86e9('0x32'),_0x86e9('0x33')];for(var _0xa31493=0x0;_0xa31493<_0x8b43dd[_0x86e9('0x34')];_0xa31493+=0x1){var _0x5cd35d=this[_0x86e9('0x35')](_0x8b43dd[_0xa31493]);if(this[_0x8b43dd[_0xa31493]+'Status']!==_0x5cd35d){this[_0x8b43dd[_0xa31493]+_0x86e9('0x36')]=_[_0x86e9('0x37')](moment()[_0x86e9('0x38')]('x'));}this[_0x8b43dd[_0xa31493]+_0x86e9('0x39')]=_0x5cd35d;}var _0x3ddeaf={'id':this['id'],'name':this[_0x86e9('0x8')],'online':this[_0x86e9('0x9')],'voicePause':this[_0x86e9('0xa')],'chatPause':this[_0x86e9('0xb')],'mailPause':this[_0x86e9('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x86e9('0xd')],'openchannelPause':this[_0x86e9('0xf')],'chatStatus':this[_0x86e9('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x86e9('0x12')],'chatCurrentCapacity':this[_0x86e9('0x13')],'mailStatus':this[_0x86e9('0x3a')],'mailStatusTime':this[_0x86e9('0x14')],'mailCapacity':this[_0x86e9('0x15')],'mailCurrentCapacity':this[_0x86e9('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x86e9('0x18')],'faxCapacity':this[_0x86e9('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x86e9('0x1b')],'smsStatusTime':this[_0x86e9('0x1c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x86e9('0x20')],'whatsappCapacity':this[_0x86e9('0x21')],'whatsappCurrentCapacity':this[_0x86e9('0x3b')],'openchannelStatus':this[_0x86e9('0x22')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x86e9('0x23')],'openchannelCurrentCapacity':this[_0x86e9('0x24')],'busy':this[_0x86e9('0x25')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x86e9('0x26')],'faxWaitingInteractions':this[_0x86e9('0x27')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0xd31bc2=md5(JSON[_0x86e9('0x3c')](_0x3ddeaf));if(this[_0x86e9('0x1')]!==_0xd31bc2){this['md5']=_0xd31bc2;io[_0x86e9('0x3d')](_0x86e9('0x3e'),_0x3ddeaf);}};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 5e75748..c3d4223 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 _0xf86c=['Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xf86c,0xbf));var _0xcf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf86('0x0'));var md5=require(_0xcf86('0x1'));var util=require(_0xcf86('0x2'));var Redis=require(_0xcf86('0x3'));var config=require(_0xcf86('0x4'));config[_0xcf86('0x5')]=_[_0xcf86('0x6')](config['redis'],{'host':_0xcf86('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcf86('0x5')]));function ChatQueue(_0x3a6e19){this['id']=_0x3a6e19['id']||0x0;this['name']=_0x3a6e19[_0xcf86('0x8')]||'';this['timeout']=_0x3a6e19[_0xcf86('0x9')]||0xa;this[_0xcf86('0xa')]=_0x3a6e19['strategy']||_0xcf86('0xb');this['Agents']=_0x3a6e19[_0xcf86('0xc')];this['mapAgentsId']={};this[_0xcf86('0xd')]=0x0;this['md5']='';this[_0xcf86('0xe')]();this[_0xcf86('0xf')]();}ChatQueue[_0xcf86('0x10')][_0xcf86('0xe')]=function(){var _0x5a8eb5=this[_0xcf86('0x11')][_0xcf86('0x12')];this['mapAgentsId']=_[_0xcf86('0x13')](this[_0xcf86('0xc')],'id');this[_0xcf86('0x11')][_0xcf86('0x12')]=_0x5a8eb5;};ChatQueue[_0xcf86('0x10')][_0xcf86('0xf')]=function(){this[_0xcf86('0x14')]=0x0;this[_0xcf86('0x15')]=0x0;for(var _0x1c92fe=0x0;_0x1c92fe=0x0?this[_0xcf86('0x18')]:0x0;var _0x4c3e41={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xcf86('0x8')],'paused':this[_0xcf86('0x15')],'waiting':this[_0xcf86('0xd')]};var _0x31063d=md5(JSON[_0xcf86('0x19')](_0x4c3e41));if(this['md5']!==_0x31063d){this['md5']=_0x31063d;io['to'](util[_0xcf86('0x1a')]('chat:queue:%s',_0x4c3e41[_0xcf86('0x8')]))[_0xcf86('0x1b')]('chat_queue:save',_0x4c3e41);}};module[_0xcf86('0x1c')]=ChatQueue; \ No newline at end of file +var _0x28ab=['map','_rr','loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting'];(function(_0x54b996,_0x4893dd){var _0x4023b3=function(_0x1dcc25){while(--_0x1dcc25){_0x54b996['push'](_0x54b996['shift']());}};_0x4023b3(++_0x4893dd);}(_0x28ab,0xf6));var _0xb28a=function(_0x298fa9,_0x214e11){_0x298fa9=_0x298fa9-0x0;var _0x47bef3=_0x28ab[_0x298fa9];return _0x47bef3;};'use strict';var _=require('lodash');var md5=require(_0xb28a('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xb28a('0x1'));config[_0xb28a('0x2')]=_[_0xb28a('0x3')](config['redis'],{'host':_0xb28a('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb28a('0x2')]));function ChatQueue(_0x16a42b){this['id']=_0x16a42b['id']||0x0;this[_0xb28a('0x5')]=_0x16a42b[_0xb28a('0x5')]||'';this[_0xb28a('0x6')]=_0x16a42b[_0xb28a('0x6')]||0xa;this['strategy']=_0x16a42b[_0xb28a('0x7')]||_0xb28a('0x8');this[_0xb28a('0x9')]=_0x16a42b['Agents'];this[_0xb28a('0xa')]={};this['waiting']=0x0;this[_0xb28a('0x0')]='';this['updateRouting']();this[_0xb28a('0xb')]();}ChatQueue[_0xb28a('0xc')][_0xb28a('0xd')]=function(){var _0x22bddb=this[_0xb28a('0xa')]['_rr'];this[_0xb28a('0xa')]=_[_0xb28a('0xe')](this['Agents'],'id');this[_0xb28a('0xa')][_0xb28a('0xf')]=_0x22bddb;};ChatQueue[_0xb28a('0xc')][_0xb28a('0xb')]=function(){this[_0xb28a('0x10')]=0x0;this[_0xb28a('0x11')]=0x0;for(var _0x233b81=0x0;_0x233b81=0x0?this['available']:0x0;var _0x238484={'id':this['id'],'available':this[_0xb28a('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xb28a('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x444940=md5(JSON[_0xb28a('0x15')](_0x238484));if(this[_0xb28a('0x0')]!==_0x444940){this['md5']=_0x444940;io['to'](util[_0xb28a('0x16')](_0xb28a('0x17'),_0x238484[_0xb28a('0x5')]))['emit'](_0xb28a('0x18'),_0x238484);}};module[_0xb28a('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index aed3fc8..2b5455a 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 _0xf06d=['fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','length','available','stringify'];(function(_0x588e72,_0x4f9e66){var _0x4bd7e2=function(_0xada279){while(--_0xada279){_0x588e72['push'](_0x588e72['shift']());}};_0x4bd7e2(++_0x4f9e66);}(_0xf06d,0x199));var _0xdf06=function(_0x2b6ec7,_0x514fd5){_0x2b6ec7=_0x2b6ec7-0x0;var _0x41063d=_0xf06d[_0x2b6ec7];return _0x41063d;};'use strict';var _=require(_0xdf06('0x0'));var md5=require(_0xdf06('0x1'));var util=require(_0xdf06('0x2'));var Redis=require(_0xdf06('0x3'));var config=require(_0xdf06('0x4'));config[_0xdf06('0x5')]=_[_0xdf06('0x6')](config[_0xdf06('0x5')],{'host':_0xdf06('0x7'),'port':0x18eb});var io=require(_0xdf06('0x8'))(new Redis(config['redis']));function FaxQueue(_0xcac92){this['id']=_0xcac92['id']||0x0;this[_0xdf06('0x9')]=_0xcac92[_0xdf06('0x9')]||'';this[_0xdf06('0xa')]=_0xcac92[_0xdf06('0xa')]||0xa;this[_0xdf06('0xb')]=_0xcac92[_0xdf06('0xb')]||_0xdf06('0xc');this['Agents']=_0xcac92[_0xdf06('0xd')];this[_0xdf06('0xe')]={};this[_0xdf06('0xf')]=0x0;this[_0xdf06('0x1')]='';this['updateRouting']();this[_0xdf06('0x10')]();}FaxQueue[_0xdf06('0x11')][_0xdf06('0x12')]=function(){var _0x17b5d7=this[_0xdf06('0xe')]['_rr'];this[_0xdf06('0xe')]=_[_0xdf06('0x13')](this['Agents'],'id');this[_0xdf06('0xe')][_0xdf06('0x14')]=_0x17b5d7;};FaxQueue['prototype'][_0xdf06('0x10')]=function(){this[_0xdf06('0x15')]=0x0;this[_0xdf06('0x16')]=0x0;for(var _0x50dd59=0x0;_0x50dd59=0x0?this[_0xdf06('0x18')]:0x0;var _0x5cdc6f={'id':this['id'],'available':this[_0xdf06('0x18')],'loggedIn':this[_0xdf06('0x15')],'name':this['name'],'paused':this[_0xdf06('0x16')],'waiting':this[_0xdf06('0xf')]};var _0x1ed13a=md5(JSON[_0xdf06('0x19')](_0x5cdc6f));if(this[_0xdf06('0x1')]!==_0x1ed13a){this['md5']=_0x1ed13a;io['to'](util['format'](_0xdf06('0x1a'),_0x5cdc6f[_0xdf06('0x9')]))['emit'](_0xdf06('0x1b'),_0x5cdc6f);}};module[_0xdf06('0x1c')]=FaxQueue; \ No newline at end of file +var _0x4bd7=['updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','length','faxPause','available','format','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','md5','updateRouting'];(function(_0x1254e2,_0x3cb386){var _0x28692b=function(_0x50aa0a){while(--_0x50aa0a){_0x1254e2['push'](_0x1254e2['shift']());}};_0x28692b(++_0x3cb386);}(_0x4bd7,0xa9));var _0x74bd=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0x4bd7[_0x49e454];return _0x21d045;};'use strict';var _=require(_0x74bd('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x74bd('0x1'));var config=require(_0x74bd('0x2'));config[_0x74bd('0x3')]=_[_0x74bd('0x4')](config[_0x74bd('0x3')],{'host':_0x74bd('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x74bd('0x3')]));function FaxQueue(_0x3fbc08){this['id']=_0x3fbc08['id']||0x0;this[_0x74bd('0x6')]=_0x3fbc08['name']||'';this['timeout']=_0x3fbc08[_0x74bd('0x7')]||0xa;this[_0x74bd('0x8')]=_0x3fbc08['strategy']||_0x74bd('0x9');this['Agents']=_0x3fbc08[_0x74bd('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x74bd('0xb')]='';this[_0x74bd('0xc')]();this[_0x74bd('0xd')]();}FaxQueue['prototype'][_0x74bd('0xc')]=function(){var _0x1c062e=this[_0x74bd('0xe')][_0x74bd('0xf')];this[_0x74bd('0xe')]=_[_0x74bd('0x10')](this[_0x74bd('0xa')],'id');this[_0x74bd('0xe')][_0x74bd('0xf')]=_0x1c062e;};FaxQueue['prototype'][_0x74bd('0xd')]=function(){this[_0x74bd('0x11')]=0x0;this[_0x74bd('0x12')]=0x0;for(var _0x25704a=0x0;_0x25704a=0x0?this[_0x74bd('0x15')]:0x0;var _0x50eaf9={'id':this['id'],'available':this[_0x74bd('0x15')],'loggedIn':this[_0x74bd('0x11')],'name':this[_0x74bd('0x6')],'paused':this[_0x74bd('0x12')],'waiting':this['waiting']};var _0x503566=md5(JSON['stringify'](_0x50eaf9));if(this[_0x74bd('0xb')]!==_0x503566){this[_0x74bd('0xb')]=_0x503566;io['to'](util[_0x74bd('0x16')]('fax:queue:%s',_0x50eaf9[_0x74bd('0x6')]))[_0x74bd('0x17')](_0x74bd('0x18'),_0x50eaf9);}};module[_0x74bd('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index a7b6007..7e1f127 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 _0x66e2=['Intervals','exports','name'];(function(_0x3ebd31,_0x1142ca){var _0x553103=function(_0x4e27ae){while(--_0x4e27ae){_0x3ebd31['push'](_0x3ebd31['shift']());}};_0x553103(++_0x1142ca);}(_0x66e2,0x119));var _0x266e=function(_0x6fc3c7,_0x1ae0ae){_0x6fc3c7=_0x6fc3c7-0x0;var _0x257825=_0x66e2[_0x6fc3c7];return _0x257825;};'use strict';function Interval(_0xe5db82){this['id']=_0xe5db82['id']||0x0;this[_0x266e('0x0')]=_0xe5db82['name']||'';this[_0x266e('0x1')]=_0xe5db82[_0x266e('0x1')]||{};}module[_0x266e('0x2')]=Interval; \ No newline at end of file +var _0xf68f=['exports','Intervals'];(function(_0x45aa9f,_0x4e217f){var _0x35c600=function(_0x45757f){while(--_0x45757f){_0x45aa9f['push'](_0x45aa9f['shift']());}};_0x35c600(++_0x4e217f);}(_0xf68f,0xf7));var _0xff68=function(_0x12941a,_0x4c60e6){_0x12941a=_0x12941a-0x0;var _0x48d4db=_0xf68f[_0x12941a];return _0x48d4db;};'use strict';function Interval(_0x3c5342){this['id']=_0x3c5342['id']||0x0;this['name']=_0x3c5342['name']||'';this['Intervals']=_0x3c5342[_0xff68('0x0')]||{};}module[_0xff68('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index a0e4465..8a132c2 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 _0x1b47=['lodash','ioredis','../../../config/environment','defaults','localhost','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','online','available','stringify','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x54e51e,_0xf741f7){var _0x39b54b=function(_0x1f5c81){while(--_0x1f5c81){_0x54e51e['push'](_0x54e51e['shift']());}};_0x39b54b(++_0xf741f7);}(_0x1b47,0x1a0));var _0x71b4=function(_0x2cb1df,_0x4b439c){_0x2cb1df=_0x2cb1df-0x0;var _0x30e674=_0x1b47[_0x2cb1df];return _0x30e674;};'use strict';var _=require(_0x71b4('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x71b4('0x1'));var config=require(_0x71b4('0x2'));config['redis']=_[_0x71b4('0x3')](config['redis'],{'host':_0x71b4('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x71b4('0x5')]));function MailQueue(_0x450866){this['id']=_0x450866['id']||0x0;this['name']=_0x450866[_0x71b4('0x6')]||'';this['timeout']=_0x450866[_0x71b4('0x7')]||0xa;this['strategy']=_0x450866[_0x71b4('0x8')]||'beepall';this['Agents']=_0x450866[_0x71b4('0x9')];this[_0x71b4('0xa')]={};this[_0x71b4('0xb')]=0x0;this[_0x71b4('0xc')]='';this[_0x71b4('0xd')]();this[_0x71b4('0xe')]();}MailQueue['prototype']['updateRouting']=function(){var _0x580b74=this[_0x71b4('0xa')]['_rr'];this[_0x71b4('0xa')]=_['map'](this[_0x71b4('0x9')],'id');this[_0x71b4('0xa')][_0x71b4('0xf')]=_0x580b74;};MailQueue[_0x71b4('0x10')][_0x71b4('0xe')]=function(){this[_0x71b4('0x11')]=0x0;this[_0x71b4('0x12')]=0x0;for(var _0x1537e7=0x0;_0x1537e7=0x0?this[_0x71b4('0x14')]:0x0;var _0x574107={'id':this['id'],'available':this[_0x71b4('0x14')],'loggedIn':this[_0x71b4('0x11')],'name':this[_0x71b4('0x6')],'paused':this[_0x71b4('0x12')],'waiting':this[_0x71b4('0xb')]};var _0x4f4241=md5(JSON[_0x71b4('0x15')](_0x574107));if(this['md5']!==_0x4f4241){this[_0x71b4('0xc')]=_0x4f4241;io['to'](util['format'](_0x71b4('0x16'),_0x574107[_0x71b4('0x6')]))[_0x71b4('0x17')](_0x71b4('0x18'),_0x574107);}};module[_0x71b4('0x19')]=MailQueue; \ No newline at end of file +var _0xf2a7=['timeout','strategy','beepall','Agents','updateRealtime','prototype','mapAgentsId','_rr','map','paused','online','loggedIn','available','waiting','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','redis','localhost','name'];(function(_0x1923fb,_0x5073b2){var _0x3baa34=function(_0x34c02d){while(--_0x34c02d){_0x1923fb['push'](_0x1923fb['shift']());}};_0x3baa34(++_0x5073b2);}(_0xf2a7,0x1c3));var _0x7f2a=function(_0x8b26ea,_0x23b486){_0x8b26ea=_0x8b26ea-0x0;var _0x2b91bb=_0xf2a7[_0x8b26ea];return _0x2b91bb;};'use strict';var _=require(_0x7f2a('0x0'));var md5=require(_0x7f2a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7f2a('0x2')]=_['defaults'](config[_0x7f2a('0x2')],{'host':_0x7f2a('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7f2a('0x2')]));function MailQueue(_0x5cc785){this['id']=_0x5cc785['id']||0x0;this[_0x7f2a('0x4')]=_0x5cc785[_0x7f2a('0x4')]||'';this[_0x7f2a('0x5')]=_0x5cc785['timeout']||0xa;this['strategy']=_0x5cc785[_0x7f2a('0x6')]||_0x7f2a('0x7');this[_0x7f2a('0x8')]=_0x5cc785[_0x7f2a('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x7f2a('0x1')]='';this['updateRouting']();this[_0x7f2a('0x9')]();}MailQueue[_0x7f2a('0xa')]['updateRouting']=function(){var _0x1cd209=this[_0x7f2a('0xb')][_0x7f2a('0xc')];this[_0x7f2a('0xb')]=_[_0x7f2a('0xd')](this[_0x7f2a('0x8')],'id');this[_0x7f2a('0xb')][_0x7f2a('0xc')]=_0x1cd209;};MailQueue[_0x7f2a('0xa')][_0x7f2a('0x9')]=function(){this['loggedIn']=0x0;this[_0x7f2a('0xe')]=0x0;for(var _0x437e0c=0x0;_0x437e0c=0x0?this[_0x7f2a('0x11')]:0x0;var _0x45f353={'id':this['id'],'available':this[_0x7f2a('0x11')],'loggedIn':this[_0x7f2a('0x10')],'name':this[_0x7f2a('0x4')],'paused':this[_0x7f2a('0xe')],'waiting':this[_0x7f2a('0x12')]};var _0x3a23e2=md5(JSON[_0x7f2a('0x13')](_0x45f353));if(this[_0x7f2a('0x1')]!==_0x3a23e2){this[_0x7f2a('0x1')]=_0x3a23e2;io['to'](util[_0x7f2a('0x14')](_0x7f2a('0x15'),_0x45f353['name']))['emit'](_0x7f2a('0x16'),_0x45f353);}};module[_0x7f2a('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e48bc62..7cc7a8f 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(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x1261,0x144));var _0x1126=function(_0x5d5e3b,_0xc516c3){_0x5d5e3b=_0x5d5e3b-0x0;var _0x4d559d=_0x1261[_0x5d5e3b];return _0x4d559d;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e2029ee..45ef325 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 _0xc368=['emit','sms_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms:queue:%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc368,0x7b));var _0x8c36=function(_0x3a7ef9,_0x39f813){_0x3a7ef9=_0x3a7ef9-0x0;var _0x2e4bad=_0xc368[_0x3a7ef9];return _0x2e4bad;};'use strict';var _=require('lodash');var md5=require(_0x8c36('0x0'));var util=require('util');var Redis=require(_0x8c36('0x1'));var config=require(_0x8c36('0x2'));config[_0x8c36('0x3')]=_[_0x8c36('0x4')](config[_0x8c36('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x8c36('0x5'))(new Redis(config[_0x8c36('0x3')]));function SmsQueue(_0x912acb){this['id']=_0x912acb['id']||0x0;this[_0x8c36('0x6')]=_0x912acb['name']||'';this['timeout']=_0x912acb[_0x8c36('0x7')]||0xa;this[_0x8c36('0x8')]=_0x912acb[_0x8c36('0x8')]||_0x8c36('0x9');this[_0x8c36('0xa')]=_0x912acb[_0x8c36('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x8c36('0xb')]();this[_0x8c36('0xc')]();}SmsQueue['prototype'][_0x8c36('0xb')]=function(){var _0x1c49a0=this[_0x8c36('0xd')][_0x8c36('0xe')];this[_0x8c36('0xd')]=_[_0x8c36('0xf')](this[_0x8c36('0xa')],'id');this[_0x8c36('0xd')][_0x8c36('0xe')]=_0x1c49a0;};SmsQueue[_0x8c36('0x10')][_0x8c36('0xc')]=function(){this[_0x8c36('0x11')]=0x0;this[_0x8c36('0x12')]=0x0;for(var _0x220f18=0x0;_0x220f18=0x0?this[_0x8c36('0x16')]:0x0;var _0x46ae6e={'id':this['id'],'available':this[_0x8c36('0x16')],'loggedIn':this[_0x8c36('0x11')],'name':this[_0x8c36('0x6')],'paused':this['paused'],'waiting':this[_0x8c36('0x17')]};var _0x409de0=md5(JSON[_0x8c36('0x18')](_0x46ae6e));if(this[_0x8c36('0x0')]!==_0x409de0){this[_0x8c36('0x0')]=_0x409de0;io['to'](util[_0x8c36('0x19')](_0x8c36('0x1a'),_0x46ae6e[_0x8c36('0x6')]))[_0x8c36('0x1b')](_0x8c36('0x1c'),_0x46ae6e);}};module[_0x8c36('0x1d')]=SmsQueue; \ No newline at end of file +var _0x8664=['prototype','_rr','loggedIn','online','smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime'];(function(_0xebec41,_0x111ee8){var _0x517d76=function(_0x7f4439){while(--_0x7f4439){_0xebec41['push'](_0xebec41['shift']());}};_0x517d76(++_0x111ee8);}(_0x8664,0x11a));var _0x4866=function(_0x5f0447,_0x3949be){_0x5f0447=_0x5f0447-0x0;var _0x3a1a12=_0x8664[_0x5f0447];return _0x3a1a12;};'use strict';var _=require(_0x4866('0x0'));var md5=require(_0x4866('0x1'));var util=require(_0x4866('0x2'));var Redis=require(_0x4866('0x3'));var config=require(_0x4866('0x4'));config[_0x4866('0x5')]=_[_0x4866('0x6')](config[_0x4866('0x5')],{'host':_0x4866('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4866('0x5')]));function SmsQueue(_0x595c9d){this['id']=_0x595c9d['id']||0x0;this[_0x4866('0x8')]=_0x595c9d[_0x4866('0x8')]||'';this[_0x4866('0x9')]=_0x595c9d[_0x4866('0x9')]||0xa;this[_0x4866('0xa')]=_0x595c9d[_0x4866('0xa')]||'beepall';this[_0x4866('0xb')]=_0x595c9d[_0x4866('0xb')];this[_0x4866('0xc')]={};this[_0x4866('0xd')]=0x0;this[_0x4866('0x1')]='';this['updateRouting']();this[_0x4866('0xe')]();}SmsQueue[_0x4866('0xf')]['updateRouting']=function(){var _0x253b1f=this[_0x4866('0xc')]['_rr'];this['mapAgentsId']=_['map'](this[_0x4866('0xb')],'id');this[_0x4866('0xc')][_0x4866('0x10')]=_0x253b1f;};SmsQueue[_0x4866('0xf')][_0x4866('0xe')]=function(){this[_0x4866('0x11')]=0x0;this['paused']=0x0;for(var _0x92e62e=0x0;_0x92e62e=0x0?this[_0x4866('0x15')]:0x0;var _0x137ddf={'id':this['id'],'available':this[_0x4866('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x4866('0x14')],'waiting':this[_0x4866('0xd')]};var _0x4b0126=md5(JSON[_0x4866('0x16')](_0x137ddf));if(this['md5']!==_0x4b0126){this[_0x4866('0x1')]=_0x4b0126;io['to'](util['format'](_0x4866('0x17'),_0x137ddf[_0x4866('0x8')]))[_0x4866('0x18')](_0x4866('0x19'),_0x137ddf);}};module[_0x4866('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 187912c..9d329e7 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 _0x70d6=['Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','length','online','loggedIn','whatsappPause','available','paused','stringify','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x11b0fc,_0xef00a){var _0xd79b47=function(_0x38741a){while(--_0x38741a){_0x11b0fc['push'](_0x11b0fc['shift']());}};_0xd79b47(++_0xef00a);}(_0x70d6,0xb8));var _0x670d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x70d6[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x670d('0x0'));var md5=require(_0x670d('0x1'));var util=require(_0x670d('0x2'));var Redis=require(_0x670d('0x3'));var config=require(_0x670d('0x4'));config[_0x670d('0x5')]=_['defaults'](config[_0x670d('0x5')],{'host':_0x670d('0x6'),'port':0x18eb});var io=require(_0x670d('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x224a84){this['id']=_0x224a84['id']||0x0;this[_0x670d('0x8')]=_0x224a84[_0x670d('0x8')]||'';this['timeout']=_0x224a84[_0x670d('0x9')]||0xa;this[_0x670d('0xa')]=_0x224a84['strategy']||_0x670d('0xb');this['Agents']=_0x224a84[_0x670d('0xc')];this[_0x670d('0xd')]={};this['waiting']=0x0;this[_0x670d('0x1')]='';this[_0x670d('0xe')]();this[_0x670d('0xf')]();}WhatsappQueue[_0x670d('0x10')][_0x670d('0xe')]=function(){var _0x2e8cea=this['mapAgentsId'][_0x670d('0x11')];this[_0x670d('0xd')]=_['map'](this[_0x670d('0xc')],'id');this[_0x670d('0xd')][_0x670d('0x11')]=_0x2e8cea;};WhatsappQueue[_0x670d('0x10')][_0x670d('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1818f6=0x0;_0x1818f6=0x0?this['available']:0x0;var _0x24cb1b={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x670d('0x8')],'paused':this[_0x670d('0x17')],'waiting':this['waiting']};var _0x159f2b=md5(JSON[_0x670d('0x18')](_0x24cb1b));if(this[_0x670d('0x1')]!==_0x159f2b){this[_0x670d('0x1')]=_0x159f2b;io['to'](util[_0x670d('0x19')]('whatsapp:queue:%s',_0x24cb1b[_0x670d('0x8')]))[_0x670d('0x1a')](_0x670d('0x1b'),_0x24cb1b);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xf894=['whatsapp_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf894,0x152));var _0x4f89=function(_0x2fcefd,_0x12500c){_0x2fcefd=_0x2fcefd-0x0;var _0x211895=_0xf894[_0x2fcefd];return _0x211895;};'use strict';var _=require('lodash');var md5=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var Redis=require(_0x4f89('0x2'));var config=require('../../../config/environment');config[_0x4f89('0x3')]=_[_0x4f89('0x4')](config[_0x4f89('0x3')],{'host':_0x4f89('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x10f756){this['id']=_0x10f756['id']||0x0;this['name']=_0x10f756[_0x4f89('0x6')]||'';this[_0x4f89('0x7')]=_0x10f756[_0x4f89('0x7')]||0xa;this['strategy']=_0x10f756[_0x4f89('0x8')]||_0x4f89('0x9');this[_0x4f89('0xa')]=_0x10f756[_0x4f89('0xa')];this[_0x4f89('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x4f89('0xc')]();this['updateRealtime']();}WhatsappQueue[_0x4f89('0xd')][_0x4f89('0xc')]=function(){var _0xd5a1f2=this['mapAgentsId'][_0x4f89('0xe')];this[_0x4f89('0xb')]=_[_0x4f89('0xf')](this['Agents'],'id');this[_0x4f89('0xb')][_0x4f89('0xe')]=_0xd5a1f2;};WhatsappQueue['prototype'][_0x4f89('0x10')]=function(){this[_0x4f89('0x11')]=0x0;this[_0x4f89('0x12')]=0x0;for(var _0xa4262a=0x0;_0xa4262a=0x0?this[_0x4f89('0x16')]:0x0;var _0x47e9d7={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4f89('0x11')],'name':this[_0x4f89('0x6')],'paused':this[_0x4f89('0x12')],'waiting':this['waiting']};var _0x25c010=md5(JSON[_0x4f89('0x17')](_0x47e9d7));if(this[_0x4f89('0x0')]!==_0x25c010){this[_0x4f89('0x0')]=_0x25c010;io['to'](util['format'](_0x4f89('0x18'),_0x47e9d7[_0x4f89('0x6')]))[_0x4f89('0x19')](_0x4f89('0x1a'),_0x47e9d7);}};module[_0x4f89('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 07e682e..1c1543c 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(_0x120390,_0x5477d7){var _0xcb68ae=function(_0x8e21fa){while(--_0x8e21fa){_0x120390['push'](_0x120390['shift']());}};_0xcb68ae(++_0x5477d7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5489c4,_0x1e7a17){_0x5489c4=_0x5489c4-0x0;var _0x2c4624=_0xb10b[_0x5489c4];return _0x2c4624;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index ef84739..3ee510d 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 _0xf3b8=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x3e3a88,_0x3acda7){var _0x1d41c4=function(_0x4b23da){while(--_0x4b23da){_0x3e3a88['push'](_0x3e3a88['shift']());}};_0x1d41c4(++_0x3acda7);}(_0xf3b8,0xcd));var _0x8f3b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xf3b8[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0x8f3b('0x0'));exports[_0x8f3b('0x1')]=function(_0x2b1d02,_0x3cd2d6){return client[_0x8f3b('0x2')](_0x8f3b('0x3'),{'body':_0x3cd2d6,'options':{'where':{'id':_0x2b1d02}},'log':_0x8f3b('0x4')});};exports[_0x8f3b('0x5')]=function(_0x3318c9,_0x2552d2){return client[_0x8f3b('0x2')](_0x8f3b('0x6'),{'body':_0x2552d2,'options':{'where':{'id':_0x3318c9}},'log':_0x8f3b('0x7')});}; \ No newline at end of file +var _0x9509=['addTagsToChatInteraction','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x9509,0x92));var _0x9950=function(_0x45f25c,_0x290300){_0x45f25c=_0x45f25c-0x0;var _0x5df5a5=_0x9509[_0x45f25c];return _0x5df5a5;};'use strict';var client=require('../client');exports['update']=function(_0x2ad4a1,_0x2ee741){return client[_0x9950('0x0')](_0x9950('0x1'),{'body':_0x2ee741,'options':{'where':{'id':_0x2ad4a1}},'log':_0x9950('0x2')});};exports[_0x9950('0x3')]=function(_0x240f70,_0x2f2b9e){return client['Request']('AddTagsToChatInteraction',{'body':_0x2f2b9e,'options':{'where':{'id':_0x240f70}},'log':_0x9950('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 1dfa956..db20e82 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 _0xa053=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x4cbc13,_0x2fe3aa){var _0x4f2101=function(_0x20a795){while(--_0x20a795){_0x4cbc13['push'](_0x4cbc13['shift']());}};_0x4f2101(++_0x2fe3aa);}(_0xa053,0xee));var _0x3a05=function(_0x5bbb7f,_0x45b2fa){_0x5bbb7f=_0x5bbb7f-0x0;var _0x3dbc2f=_0xa053[_0x5bbb7f];return _0x3dbc2f;};'use strict';var client=require('../client');exports[_0x3a05('0x0')]=function(_0x3f3825){return client[_0x3a05('0x1')](_0x3a05('0x2'),{'body':_0x3f3825,'log':_0x3a05('0x3')});}; \ No newline at end of file +var _0xfa84=['../client','CreateChatMessage','createChatMessage'];(function(_0x311666,_0x17b07d){var _0x2bc692=function(_0x200073){while(--_0x200073){_0x311666['push'](_0x311666['shift']());}};_0x2bc692(++_0x17b07d);}(_0xfa84,0xcf));var _0x4fa8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfa84[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x4fa8('0x0'));exports['create']=function(_0x406218){return client['Request'](_0x4fa8('0x1'),{'body':_0x406218,'log':_0x4fa8('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5a3a762..a1189ae 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 _0x0f89=['online','../client','getChatQueues','Request','name','timeout','strategy','User'];(function(_0x167b2e,_0x4b900a){var _0x1e7d43=function(_0x584d75){while(--_0x584d75){_0x167b2e['push'](_0x167b2e['shift']());}};_0x1e7d43(++_0x4b900a);}(_0x0f89,0x111));var _0x90f8=function(_0xbd2858,_0x3b28d1){_0xbd2858=_0xbd2858-0x0;var _0x11f656=_0x0f89[_0xbd2858];return _0x11f656;};'use strict';var client=require(_0x90f8('0x0'));exports[_0x90f8('0x1')]=function(){return function(){return client[_0x90f8('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x90f8('0x3'),_0x90f8('0x4'),_0x90f8('0x5')],'include':[{'model':_0x90f8('0x6'),'as':'Agents','attributes':['id',_0x90f8('0x3'),_0x90f8('0x7'),'chatPause']}]},'log':_0x90f8('0x1')});};}; \ No newline at end of file +var _0x5577=['strategy','User','Agents','name','online','getChatQueues','../client','Request','GetChatQueue','timeout'];(function(_0x471968,_0x37a597){var _0x1fa26c=function(_0x3d11a1){while(--_0x3d11a1){_0x471968['push'](_0x471968['shift']());}};_0x1fa26c(++_0x37a597);}(_0x5577,0x1b4));var _0x7557=function(_0x3b5778,_0x228ccf){_0x3b5778=_0x3b5778-0x0;var _0x3e3902=_0x5577[_0x3b5778];return _0x3e3902;};'use strict';var client=require(_0x7557('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x7557('0x1')](_0x7557('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7557('0x3'),_0x7557('0x4')],'include':[{'model':_0x7557('0x5'),'as':_0x7557('0x6'),'attributes':['id',_0x7557('0x7'),_0x7557('0x8'),'chatPause']}]},'log':_0x7557('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 5a59758..2e897ba 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 _0xf041=['CreateChatQueueReport','UpdateChatQueueReport','Request'];(function(_0x52e6ac,_0x15af90){var _0x3f7683=function(_0x37ac34){while(--_0x37ac34){_0x52e6ac['push'](_0x52e6ac['shift']());}};_0x3f7683(++_0x15af90);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['create']=function(_0xc35ebe){return client[_0x1f04('0x0')](_0x1f04('0x1'),{'body':_0xc35ebe,'log':_0x1f04('0x1')});};exports['update']=function(_0x4348a1,_0x5445a0){return client[_0x1f04('0x0')]('UpdateChatQueueReport',{'body':_0x5445a0,'options':{'where':{'uniqueid':_0x4348a1},'order':[['id','DESC']],'limit':0x1},'log':_0x1f04('0x2')});}; \ No newline at end of file +var _0x2bdb=['Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport','update'];(function(_0x51a6af,_0x219d20){var _0x190e2c=function(_0x1f391b){while(--_0x1f391b){_0x51a6af['push'](_0x51a6af['shift']());}};_0x190e2c(++_0x219d20);}(_0x2bdb,0x105));var _0xb2bd=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x2bdb[_0x1d1d09];return _0x8827e;};'use strict';var client=require(_0xb2bd('0x0'));exports['create']=function(_0x156a93){return client['Request'](_0xb2bd('0x1'),{'body':_0x156a93,'log':_0xb2bd('0x1')});};exports[_0xb2bd('0x2')]=function(_0x552d38,_0x438ced){return client[_0xb2bd('0x3')](_0xb2bd('0x4'),{'body':_0x438ced,'options':{'where':{'uniqueid':_0x552d38},'order':[['id',_0xb2bd('0x5')]],'limit':0x1},'log':_0xb2bd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index cdf93b3..b592a47 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x7a54,0x106));var _0x47a5=function(_0x2c5e06,_0x279f35){_0x2c5e06=_0x2c5e06-0x0;var _0x5e8df9=_0x7a54[_0x2c5e06];return _0x5e8df9;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x7a54,0x106));var _0x47a5=function(_0x5c3970,_0x1182b0){_0x5c3970=_0x5c3970-0x0;var _0x2da7b3=_0x7a54[_0x5c3970];return _0x2da7b3;};'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 95ac8b5..d97661d 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 _0xcb76=['createFaxMessage','create','Request'];(function(_0x21f554,_0x1a5f38){var _0x1acf96=function(_0x16c9be){while(--_0x16c9be){_0x21f554['push'](_0x21f554['shift']());}};_0x1acf96(++_0x1a5f38);}(_0xcb76,0x11e));var _0x6cb7=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xcb76[_0x543084];return _0x306a57;};'use strict';var client=require('../client');exports[_0x6cb7('0x0')]=function(_0x2955d0){return client[_0x6cb7('0x1')]('CreateFaxMessage',{'body':_0x2955d0,'log':_0x6cb7('0x2')});}; \ No newline at end of file +var _0x867f=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x15181a,_0x641784){var _0x44c55b=function(_0x82485b){while(--_0x82485b){_0x15181a['push'](_0x15181a['shift']());}};_0x44c55b(++_0x641784);}(_0x867f,0xdd));var _0xf867=function(_0x241b5a,_0x5ac06c){_0x241b5a=_0x241b5a-0x0;var _0x49fff8=_0x867f[_0x241b5a];return _0x49fff8;};'use strict';var client=require(_0xf867('0x0'));exports[_0xf867('0x1')]=function(_0x523d4e){return client['Request'](_0xf867('0x2'),{'body':_0x523d4e,'log':_0xf867('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a978ab2..c9bc5ba 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 _0x5f02=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x42c423,_0x7f2d37){var _0x358d9c=function(_0x401372){while(--_0x401372){_0x42c423['push'](_0x42c423['shift']());}};_0x358d9c(++_0x7f2d37);}(_0x5f02,0x113));var _0x25f0=function(_0x358367,_0x3e7a10){_0x358367=_0x358367-0x0;var _0x41531b=_0x5f02[_0x358367];return _0x41531b;};'use strict';var client=require(_0x25f0('0x0'));exports[_0x25f0('0x1')]=function(){return function(){return client[_0x25f0('0x2')](_0x25f0('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x25f0('0x4')],'include':[{'model':_0x25f0('0x5'),'as':_0x25f0('0x6'),'attributes':['id','name',_0x25f0('0x7'),_0x25f0('0x8')]}]},'log':_0x25f0('0x1')});};}; \ No newline at end of file +var _0xfdba=['online','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents'];(function(_0x3a8445,_0x51c953){var _0x51bf93=function(_0x1585e0){while(--_0x1585e0){_0x3a8445['push'](_0x3a8445['shift']());}};_0x51bf93(++_0x51c953);}(_0xfdba,0xf4));var _0xafdb=function(_0x21387f,_0x4a55b5){_0x21387f=_0x21387f-0x0;var _0x3a1a36=_0xfdba[_0x21387f];return _0x3a1a36;};'use strict';var client=require(_0xafdb('0x0'));exports[_0xafdb('0x1')]=function(){return function(){return client[_0xafdb('0x2')](_0xafdb('0x3'),{'options':{'raw':![],'attributes':['id',_0xafdb('0x4'),_0xafdb('0x5'),'strategy'],'include':[{'model':_0xafdb('0x6'),'as':_0xafdb('0x7'),'attributes':['id',_0xafdb('0x4'),_0xafdb('0x8'),'faxPause']}]},'log':_0xafdb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 642367e..c73b628 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 _0x4741=['create','Request','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x139410,_0x1dd6bf){var _0x288aa0=function(_0x114a63){while(--_0x114a63){_0x139410['push'](_0x139410['shift']());}};_0x288aa0(++_0x1dd6bf);}(_0x4741,0x1a9));var _0x1474=function(_0x43652d,_0x7ffffd){_0x43652d=_0x43652d-0x0;var _0x552ea0=_0x4741[_0x43652d];return _0x552ea0;};'use strict';var client=require(_0x1474('0x0'));exports[_0x1474('0x1')]=function(_0x23139b){return client[_0x1474('0x2')]('CreateFaxQueueReport',{'body':_0x23139b,'log':'CreateFaxQueueReport'});};exports[_0x1474('0x3')]=function(_0x16d968,_0x59fd76){return client[_0x1474('0x2')](_0x1474('0x4'),{'body':_0x59fd76,'options':{'where':{'uniqueid':_0x16d968},'order':[['id',_0x1474('0x5')]],'limit':0x1},'log':_0x1474('0x4')});}; \ No newline at end of file +var _0x17d3=['update','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x17d3,0x140));var _0x317d=function(_0x1154e8,_0x3eb8af){_0x1154e8=_0x1154e8-0x0;var _0x4ead1c=_0x17d3[_0x1154e8];return _0x4ead1c;};'use strict';var client=require(_0x317d('0x0'));exports[_0x317d('0x1')]=function(_0x4f6cab){return client[_0x317d('0x2')]('CreateFaxQueueReport',{'body':_0x4f6cab,'log':_0x317d('0x3')});};exports[_0x317d('0x4')]=function(_0x4c9d27,_0x84b32d){return client['Request'](_0x317d('0x5'),{'body':_0x84b32d,'options':{'where':{'uniqueid':_0x4c9d27},'order':[['id','DESC']],'limit':0x1},'log':_0x317d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2c3c922..a51239c 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 _0x8dbe=['name','Intervals','interval','getIntervals'];(function(_0x416a51,_0x2f0c6c){var _0x133749=function(_0x3468eb){while(--_0x3468eb){_0x416a51['push'](_0x416a51['shift']());}};_0x133749(++_0x2f0c6c);}(_0x8dbe,0x133));var _0xe8db=function(_0x5937b1,_0x46b095){_0x5937b1=_0x5937b1-0x0;var _0x4fec9f=_0x8dbe[_0x5937b1];return _0x4fec9f;};'use strict';var client=require('../client');exports[_0xe8db('0x0')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe8db('0x1')],'include':[{'model':'Interval','as':_0xe8db('0x2'),'attributes':['id',_0xe8db('0x1'),_0xe8db('0x3')]}]},'log':_0xe8db('0x0')});};}; \ No newline at end of file +var _0xc740=['../client','getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0xa9dfc5,_0x3a25a4){var _0x44a588=function(_0x339575){while(--_0x339575){_0xa9dfc5['push'](_0xa9dfc5['shift']());}};_0x44a588(++_0x3a25a4);}(_0xc740,0x198));var _0x0c74=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc740[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x0c74('0x0'));exports[_0x0c74('0x1')]=function(){return function(){return client[_0x0c74('0x2')](_0x0c74('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0c74('0x4')],'include':[{'model':_0x0c74('0x5'),'as':_0x0c74('0x6'),'attributes':['id',_0x0c74('0x4'),_0x0c74('0x7')]}]},'log':_0x0c74('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1076217..cc30f48 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 _0x4b17=['addTagsToChatInteraction','../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x4685a7,_0x7acd54){var _0x2e3d34=function(_0x2043a6){while(--_0x2043a6){_0x4685a7['push'](_0x4685a7['shift']());}};_0x2e3d34(++_0x7acd54);}(_0x4b17,0x10f));var _0x74b1=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0x4b17[_0x2afb44];return _0x15ccc2;};'use strict';var client=require(_0x74b1('0x0'));exports['update']=function(_0xd6951,_0x5483a2){return client[_0x74b1('0x1')](_0x74b1('0x2'),{'body':_0x5483a2,'options':{'where':{'id':_0xd6951}},'log':'updateMailInteraction'});};exports[_0x74b1('0x3')]=function(_0x4f206f,_0x4fdea2){return client[_0x74b1('0x1')](_0x74b1('0x4'),{'body':_0x4fdea2,'options':{'where':{'id':_0x4f206f}},'log':_0x74b1('0x5')});}; \ No newline at end of file +var _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x33af,0xec));var _0xf33a=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0x33af[_0x5e6fe1];return _0x5a6018;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index a98ef2d..4c5be78 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 _0x4a13=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x35ec58,_0x2b96a0){var _0x3e2ded=function(_0x2cf973){while(--_0x2cf973){_0x35ec58['push'](_0x35ec58['shift']());}};_0x3e2ded(++_0x2b96a0);}(_0x4a13,0x1b3));var _0x34a1=function(_0x4495c5,_0x285041){_0x4495c5=_0x4495c5-0x0;var _0x57c99f=_0x4a13[_0x4495c5];return _0x57c99f;};'use strict';var client=require('../client');exports[_0x34a1('0x0')]=function(_0x50826e){return client[_0x34a1('0x1')](_0x34a1('0x2'),{'body':_0x50826e,'log':_0x34a1('0x3')});}; \ No newline at end of file +var _0xed46=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x1668a3,_0x4d9c56){var _0x3c7760=function(_0x2ae421){while(--_0x2ae421){_0x1668a3['push'](_0x1668a3['shift']());}};_0x3c7760(++_0x4d9c56);}(_0xed46,0xd0));var _0x6ed4=function(_0x29c934,_0x3c30e2){_0x29c934=_0x29c934-0x0;var _0x4302de=_0xed46[_0x29c934];return _0x4302de;};'use strict';var client=require(_0x6ed4('0x0'));exports[_0x6ed4('0x1')]=function(_0x2d64c9){return client[_0x6ed4('0x2')](_0x6ed4('0x3'),{'body':_0x2d64c9,'log':_0x6ed4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d4a5c1e..051f831 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 _0x0f2d=['mailPause','getMailQueues','../client','Request','GetMailQueue','name','timeout','User','Agents'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x0f2d,0x1a9));var _0xd0f2=function(_0x292c40,_0x19bfe4){_0x292c40=_0x292c40-0x0;var _0x409863=_0x0f2d[_0x292c40];return _0x409863;};'use strict';var client=require(_0xd0f2('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xd0f2('0x1')](_0xd0f2('0x2'),{'options':{'raw':![],'attributes':['id',_0xd0f2('0x3'),_0xd0f2('0x4'),'strategy'],'include':[{'model':_0xd0f2('0x5'),'as':_0xd0f2('0x6'),'attributes':['id',_0xd0f2('0x3'),'online',_0xd0f2('0x7')]}]},'log':_0xd0f2('0x8')});};}; \ No newline at end of file +var _0x872c=['strategy','User','Agents','online','mailPause','getMailQueues','Request','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x872c,0xba));var _0xc872=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x872c[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xc872('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xc872('0x1'),_0xc872('0x2'),_0xc872('0x3')],'include':[{'model':_0xc872('0x4'),'as':_0xc872('0x5'),'attributes':['id',_0xc872('0x1'),_0xc872('0x6'),_0xc872('0x7')]}]},'log':_0xc872('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 57b6bcc..93ca684 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 _0xe789=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xe789,0x131));var _0x9e78=function(_0x5c6968,_0x35f27a){_0x5c6968=_0x5c6968-0x0;var _0x243611=_0xe789[_0x5c6968];return _0x243611;};'use strict';var client=require(_0x9e78('0x0'));exports[_0x9e78('0x1')]=function(_0x4ccaf1){return client[_0x9e78('0x2')](_0x9e78('0x3'),{'body':_0x4ccaf1,'log':'CreateMailQueueReport'});};exports[_0x9e78('0x4')]=function(_0x14bf49,_0x67304e){return client[_0x9e78('0x2')](_0x9e78('0x5'),{'body':_0x67304e,'options':{'where':{'uniqueid':_0x14bf49},'order':[['id',_0x9e78('0x6')]],'limit':0x1},'log':_0x9e78('0x5')});}; \ No newline at end of file +var _0x6677=['UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x4147fb,_0x59f275){var _0x578203=function(_0x96e562){while(--_0x96e562){_0x4147fb['push'](_0x4147fb['shift']());}};_0x578203(++_0x59f275);}(_0x6677,0x93));var _0x7667=function(_0x267dab,_0x289f6c){_0x267dab=_0x267dab-0x0;var _0x593b1a=_0x6677[_0x267dab];return _0x593b1a;};'use strict';var client=require('../client');exports[_0x7667('0x0')]=function(_0x4d5ef3){return client[_0x7667('0x1')]('CreateMailQueueReport',{'body':_0x4d5ef3,'log':_0x7667('0x2')});};exports['update']=function(_0x16a48a,_0x2b3474){return client[_0x7667('0x1')](_0x7667('0x3'),{'body':_0x2b3474,'options':{'where':{'uniqueid':_0x16a48a},'order':[['id',_0x7667('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b6fdc85..6d6d1fb 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 _0x863d=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x863d,0x17c));var _0xd863=function(_0x52b4c3,_0xbfd896){_0x52b4c3=_0x52b4c3-0x0;var _0x524094=_0x863d[_0x52b4c3];return _0x524094;};'use strict';var client=require(_0xd863('0x0'));exports[_0xd863('0x1')]=function(_0x3bb88e,_0x26b62e){return client[_0xd863('0x2')](_0xd863('0x3'),{'body':_0x26b62e,'options':{'where':{'id':_0x3bb88e}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x47e037,_0x1b37dd){return client[_0xd863('0x2')](_0xd863('0x4'),{'body':_0x1b37dd,'options':{'where':{'id':_0x47e037}},'log':_0xd863('0x5')});}; \ No newline at end of file +var _0x72fe=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x72fe,0x1ec));var _0xe72f=function(_0x7ef63c,_0xa9cf32){_0x7ef63c=_0x7ef63c-0x0;var _0xba3fdb=_0x72fe[_0x7ef63c];return _0xba3fdb;};'use strict';var client=require('../client');exports[_0xe72f('0x0')]=function(_0x1912ec,_0x4cbc84){return client[_0xe72f('0x1')](_0xe72f('0x2'),{'body':_0x4cbc84,'options':{'where':{'id':_0x1912ec}},'log':_0xe72f('0x3')});};exports['addTags']=function(_0x29f733,_0x477198){return client['Request'](_0xe72f('0x4'),{'body':_0x477198,'options':{'where':{'id':_0x29f733}},'log':_0xe72f('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a64b6f4..bbb4547 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 _0x1941=['../client','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x1cf84e,_0x2a8e56){var _0x49e7a1=function(_0x5e414b){while(--_0x5e414b){_0x1cf84e['push'](_0x1cf84e['shift']());}};_0x49e7a1(++_0x2a8e56);}(_0x1941,0xb1));var _0x1194=function(_0x576368,_0x42dfa2){_0x576368=_0x576368-0x0;var _0x3cc671=_0x1941[_0x576368];return _0x3cc671;};'use strict';var client=require(_0x1194('0x0'));exports['create']=function(_0x4fd7b3){return client['Request'](_0x1194('0x1'),{'body':_0x4fd7b3,'log':_0x1194('0x2')});}; \ No newline at end of file +var _0xea5b=['Request','CreateOpenchannelMessage','create'];(function(_0x171c27,_0x5094ca){var _0xfed5fb=function(_0x19bbd3){while(--_0x19bbd3){_0x171c27['push'](_0x171c27['shift']());}};_0xfed5fb(++_0x5094ca);}(_0xea5b,0xe3));var _0xbea5=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xea5b[_0x49b207];return _0x2dc8fa;};'use strict';var client=require('../client');exports[_0xbea5('0x0')]=function(_0x1602eb){return client[_0xbea5('0x1')](_0xbea5('0x2'),{'body':_0x1602eb,'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 8ba1c41..04a5c37 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 _0xea5d=['Agents','getOpenchannelQueues','name','timeout','strategy'];(function(_0x284d34,_0x2dc059){var _0x400d9a=function(_0x179394){while(--_0x179394){_0x284d34['push'](_0x284d34['shift']());}};_0x400d9a(++_0x2dc059);}(_0xea5d,0x132));var _0xdea5=function(_0x2f37d2,_0xf4bb44){_0x2f37d2=_0x2f37d2-0x0;var _0x441d3a=_0xea5d[_0x2f37d2];return _0x441d3a;};'use strict';var client=require('../client');exports[_0xdea5('0x0')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xdea5('0x1'),_0xdea5('0x2'),_0xdea5('0x3')],'include':[{'model':'User','as':_0xdea5('0x4'),'attributes':['id',_0xdea5('0x1'),'online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xf2d4=['Request','GetOpenchannelQueue','timeout','strategy','User','openchannelPause','../client','getOpenchannelQueues'];(function(_0x1a1128,_0x1784d8){var _0x1f5bd2=function(_0x8e0c15){while(--_0x8e0c15){_0x1a1128['push'](_0x1a1128['shift']());}};_0x1f5bd2(++_0x1784d8);}(_0xf2d4,0x166));var _0x4f2d=function(_0xadce07,_0x2a0fe2){_0xadce07=_0xadce07-0x0;var _0x5a5cff=_0xf2d4[_0xadce07];return _0x5a5cff;};'use strict';var client=require(_0x4f2d('0x0'));exports[_0x4f2d('0x1')]=function(){return function(){return client[_0x4f2d('0x2')](_0x4f2d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4f2d('0x4'),_0x4f2d('0x5')],'include':[{'model':_0x4f2d('0x6'),'as':'Agents','attributes':['id','name','online',_0x4f2d('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 263f822..c259934 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 _0xf2e2=['../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x4b2b66,_0x55ed64){var _0x6ca690=function(_0x5cd46d){while(--_0x5cd46d){_0x4b2b66['push'](_0x4b2b66['shift']());}};_0x6ca690(++_0x55ed64);}(_0xf2e2,0x1ce));var _0x2f2e=function(_0x2c99fe,_0x38ee8f){_0x2c99fe=_0x2c99fe-0x0;var _0x901ad1=_0xf2e2[_0x2c99fe];return _0x901ad1;};'use strict';var client=require(_0x2f2e('0x0'));exports[_0x2f2e('0x1')]=function(_0x20574e){return client['Request'](_0x2f2e('0x2'),{'body':_0x20574e,'log':'CreateOpenchannelQueueReport'});};exports[_0x2f2e('0x3')]=function(_0x37b1fc,_0x13cc54){return client[_0x2f2e('0x4')](_0x2f2e('0x5'),{'body':_0x13cc54,'options':{'where':{'uniqueid':_0x37b1fc},'order':[['id',_0x2f2e('0x6')]],'limit':0x1},'log':_0x2f2e('0x5')});}; \ No newline at end of file +var _0xcf74=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x1698f9,_0xcc585f){var _0x3448a3=function(_0x36b672){while(--_0x36b672){_0x1698f9['push'](_0x1698f9['shift']());}};_0x3448a3(++_0xcc585f);}(_0xcf74,0x17f));var _0x4cf7=function(_0x2fb350,_0x532b7e){_0x2fb350=_0x2fb350-0x0;var _0x217cd9=_0xcf74[_0x2fb350];return _0x217cd9;};'use strict';var client=require(_0x4cf7('0x0'));exports[_0x4cf7('0x1')]=function(_0x504ac2){return client[_0x4cf7('0x2')]('CreateOpenchannelQueueReport',{'body':_0x504ac2,'log':_0x4cf7('0x3')});};exports[_0x4cf7('0x4')]=function(_0x47322e,_0x6004d6){return client['Request'](_0x4cf7('0x5'),{'body':_0x6004d6,'options':{'where':{'uniqueid':_0x47322e},'order':[['id',_0x4cf7('0x6')]],'limit':0x1},'log':_0x4cf7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index e6c7135..e95a0c7 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 _0x8558=['AddTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x33456d,_0x379a78){var _0x53b120=function(_0xb5d79c){while(--_0xb5d79c){_0x33456d['push'](_0x33456d['shift']());}};_0x53b120(++_0x379a78);}(_0x8558,0x103));var _0x8855=function(_0x45e30b,_0x1f067f){_0x45e30b=_0x45e30b-0x0;var _0x8af131=_0x8558[_0x45e30b];return _0x8af131;};'use strict';var client=require('../client');exports[_0x8855('0x0')]=function(_0xde5f32,_0x2d6bed){return client[_0x8855('0x1')](_0x8855('0x2'),{'body':_0x2d6bed,'options':{'where':{'id':_0xde5f32}},'log':_0x8855('0x3')});};exports[_0x8855('0x4')]=function(_0x4ccead,_0x1bbbee){return client['Request'](_0x8855('0x5'),{'body':_0x1bbbee,'options':{'where':{'id':_0x4ccead}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x121d=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x121d,0xea));var _0xd121=function(_0x5357b2,_0x1b23e6){_0x5357b2=_0x5357b2-0x0;var _0x5307a1=_0x121d[_0x5357b2];return _0x5307a1;};'use strict';var client=require(_0xd121('0x0'));exports[_0xd121('0x1')]=function(_0xa98163,_0x449207){return client[_0xd121('0x2')](_0xd121('0x3'),{'body':_0x449207,'options':{'where':{'id':_0xa98163}},'log':_0xd121('0x4')});};exports[_0xd121('0x5')]=function(_0x20a687,_0x349fc5){return client[_0xd121('0x2')](_0xd121('0x6'),{'body':_0x349fc5,'options':{'where':{'id':_0x20a687}},'log':_0xd121('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 02d0735..700c4a6 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 _0xea0e=['create','Request','CreateSmsMessage','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea0e,0xff));var _0xeea0=function(_0x1023de,_0x71e5ca){_0x1023de=_0x1023de-0x0;var _0x2220ea=_0xea0e[_0x1023de];return _0x2220ea;};'use strict';var client=require(_0xeea0('0x0'));exports[_0xeea0('0x1')]=function(_0x2627fd){return client[_0xeea0('0x2')](_0xeea0('0x3'),{'body':_0x2627fd,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x6c38=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x2c50a6,_0x2a9854){var _0x3e6556=function(_0x3ad784){while(--_0x3ad784){_0x2c50a6['push'](_0x2c50a6['shift']());}};_0x3e6556(++_0x2a9854);}(_0x6c38,0x1f0));var _0x86c3=function(_0x414b15,_0x29cb3e){_0x414b15=_0x414b15-0x0;var _0x52d34c=_0x6c38[_0x414b15];return _0x52d34c;};'use strict';var client=require('../client');exports[_0x86c3('0x0')]=function(_0xb573b3){return client[_0x86c3('0x1')](_0x86c3('0x2'),{'body':_0xb573b3,'log':_0x86c3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index dd75b13..78480a7 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x95f08,_0x1565f5){var _0x206212=function(_0x257d4){while(--_0x257d4){_0x95f08['push'](_0x95f08['shift']());}};_0x206212(++_0x1565f5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0xcb91[_0xac0de1];return _0x1c1995;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x1596e7,_0x286af3){var _0x4fea7e=function(_0x3d1607){while(--_0x3d1607){_0x1596e7['push'](_0x1596e7['shift']());}};_0x4fea7e(++_0x286af3);}(_0xe706,0xa3));var _0x6e70=function(_0x21a209,_0x1b8347){_0x21a209=_0x21a209-0x0;var _0x40c2a8=_0xe706[_0x21a209];return _0x40c2a8;};'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 c85644f..a3a07ce 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xedd9,0xfc));var _0x9edd=function(_0x13510b,_0xe3eaf){_0x13510b=_0x13510b-0x0;var _0x569df9=_0xedd9[_0x13510b];return _0x569df9;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x70e0,0x17b));var _0x070e=function(_0x7a19a8,_0xb8966b){_0x7a19a8=_0x7a19a8-0x0;var _0x2815f6=_0x70e0[_0x7a19a8];return _0x2815f6;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3b2fc65..fd131b4 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(_0x41682b,_0x33b6e4){var _0x137693=function(_0x3e67ac){while(--_0x3e67ac){_0x41682b['push'](_0x41682b['shift']());}};_0x137693(++_0x33b6e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x2b698c,_0x5bbdd5){var _0x535317=function(_0x2e76c0){while(--_0x2e76c0){_0x2b698c['push'](_0x2b698c['shift']());}};_0x535317(++_0x5bbdd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('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 9ecc25d..9e4a8a8 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 _0xdbb1=['../client','Request','addTags'];(function(_0x2e3e1e,_0x20efb6){var _0x359d86=function(_0x185a8e){while(--_0x185a8e){_0x2e3e1e['push'](_0x2e3e1e['shift']());}};_0x359d86(++_0x20efb6);}(_0xdbb1,0x105));var _0x1dbb=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xdbb1[_0x2df507];return _0x1f7167;};'use strict';var client=require(_0x1dbb('0x0'));exports['update']=function(_0x53f27d,_0x4b55f7){return client[_0x1dbb('0x1')]('UpdateWhatsappInteraction',{'body':_0x4b55f7,'options':{'where':{'id':_0x53f27d}},'log':'updateWhatsappInteraction'});};exports[_0x1dbb('0x2')]=function(_0x483e15,_0xa1e321){return client[_0x1dbb('0x1')]('AddTagsToWhatsappInteraction',{'body':_0xa1e321,'options':{'where':{'id':_0x483e15}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x5ff9=['../client','update','Request','addTags','AddTagsToWhatsappInteraction'];(function(_0x2a3035,_0x4a311f){var _0x1cd9ec=function(_0x316d5d){while(--_0x316d5d){_0x2a3035['push'](_0x2a3035['shift']());}};_0x1cd9ec(++_0x4a311f);}(_0x5ff9,0xa0));var _0x95ff=function(_0x48f870,_0x776535){_0x48f870=_0x48f870-0x0;var _0x24107e=_0x5ff9[_0x48f870];return _0x24107e;};'use strict';var client=require(_0x95ff('0x0'));exports[_0x95ff('0x1')]=function(_0x4dc587,_0x1962c3){return client[_0x95ff('0x2')]('UpdateWhatsappInteraction',{'body':_0x1962c3,'options':{'where':{'id':_0x4dc587}},'log':'updateWhatsappInteraction'});};exports[_0x95ff('0x3')]=function(_0x58eb5d,_0x5b1bee){return client[_0x95ff('0x2')](_0x95ff('0x4'),{'body':_0x5b1bee,'options':{'where':{'id':_0x58eb5d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index e968fec..7d387f5 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 _0x6379=['createWhatsappMessage','../client','create','Request'];(function(_0x2b4586,_0x5bef96){var _0x2f5763=function(_0xab7405){while(--_0xab7405){_0x2b4586['push'](_0x2b4586['shift']());}};_0x2f5763(++_0x5bef96);}(_0x6379,0xb9));var _0x9637=function(_0x25d6db,_0x51b7f8){_0x25d6db=_0x25d6db-0x0;var _0x2abc0c=_0x6379[_0x25d6db];return _0x2abc0c;};'use strict';var client=require(_0x9637('0x0'));exports[_0x9637('0x1')]=function(_0x5ab321){return client[_0x9637('0x2')]('CreateWhatsappMessage',{'body':_0x5ab321,'log':_0x9637('0x3')});}; \ No newline at end of file +var _0x3bf6=['Request','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bf6,0x87));var _0x63bf=function(_0x485f03,_0x14ab71){_0x485f03=_0x485f03-0x0;var _0x3edc3a=_0x3bf6[_0x485f03];return _0x3edc3a;};'use strict';var client=require('../client');exports[_0x63bf('0x0')]=function(_0x695e82){return client[_0x63bf('0x1')]('CreateWhatsappMessage',{'body':_0x695e82,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 74261b7..a889360 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 _0x1304=['Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x543e8c,_0x199c6d){var _0x1a7278=function(_0x2d56a6){while(--_0x2d56a6){_0x543e8c['push'](_0x543e8c['shift']());}};_0x1a7278(++_0x199c6d);}(_0x1304,0x194));var _0x4130=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1304[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x4130('0x0')]=function(){return function(){return client[_0x4130('0x1')](_0x4130('0x2'),{'options':{'raw':![],'attributes':['id',_0x4130('0x3'),'timeout',_0x4130('0x4')],'include':[{'model':_0x4130('0x5'),'as':_0x4130('0x6'),'attributes':['id',_0x4130('0x3'),_0x4130('0x7'),_0x4130('0x8')]}]},'log':_0x4130('0x0')});};}; \ No newline at end of file +var _0x3277=['timeout','strategy','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0x3277,0x175));var _0x7327=function(_0x43f9e2,_0x2d992d){_0x43f9e2=_0x43f9e2-0x0;var _0x3ba562=_0x3277[_0x43f9e2];return _0x3ba562;};'use strict';var client=require(_0x7327('0x0'));exports[_0x7327('0x1')]=function(){return function(){return client[_0x7327('0x2')](_0x7327('0x3'),{'options':{'raw':![],'attributes':['id',_0x7327('0x4'),_0x7327('0x5'),_0x7327('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7327('0x4'),_0x7327('0x7'),_0x7327('0x8')]}]},'log':_0x7327('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 03ca59c..ae0eeda 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 _0x1e31=['Request','CreateWhatsappQueueReport','update','DESC','../client'];(function(_0x22abbf,_0x499e93){var _0x340c8a=function(_0x32467e){while(--_0x32467e){_0x22abbf['push'](_0x22abbf['shift']());}};_0x340c8a(++_0x499e93);}(_0x1e31,0x103));var _0x11e3=function(_0x7dc3b3,_0xc8741c){_0x7dc3b3=_0x7dc3b3-0x0;var _0x412587=_0x1e31[_0x7dc3b3];return _0x412587;};'use strict';var client=require(_0x11e3('0x0'));exports['create']=function(_0x5ca68e){return client[_0x11e3('0x1')](_0x11e3('0x2'),{'body':_0x5ca68e,'log':_0x11e3('0x2')});};exports[_0x11e3('0x3')]=function(_0x1f9e5b,_0x5191f6){return client[_0x11e3('0x1')]('UpdateWhatsappQueueReport',{'body':_0x5191f6,'options':{'where':{'uniqueid':_0x1f9e5b},'order':[['id',_0x11e3('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x5a05=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x5a05,0x9c));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x55a0('0x0'));exports[_0x55a0('0x1')]=function(_0x81d7af){return client[_0x55a0('0x2')]('CreateWhatsappQueueReport',{'body':_0x81d7af,'log':_0x55a0('0x3')});};exports[_0x55a0('0x4')]=function(_0xa82a64,_0x6631e6){return client[_0x55a0('0x2')]('UpdateWhatsappQueueReport',{'body':_0x6631e6,'options':{'where':{'uniqueid':_0xa82a64},'order':[['id',_0x55a0('0x5')]],'limit':0x1},'log':_0x55a0('0x6')});}; \ 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 ead72cc..446963b 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 _0x5863=['routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','timeout','atimeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','seq-queue'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0x5863,0x152));var _0x3586=function(_0x26774f,_0x1158df){_0x26774f=_0x26774f-0x0;var _0x321260=_0x5863[_0x26774f];return _0x321260;};'use strict';var schema=require(_0x3586('0x0'));var _=require('lodash');var util=require(_0x3586('0x1'));var seqqueue=require(_0x3586('0x2'));var logger=require('../../../../config/logger')(_0x3586('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3586('0x4'),'required':!![],'message':_0x3586('0x5')},'timeout':{'type':_0x3586('0x6'),'message':_0x3586('0x7')}});function writeLog(_0x208863,_0x4f17bb,_0x9fa8b9){return logger[_0x3586('0x8')](util[_0x3586('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x208863,_0x4f17bb['name'],_0x9fa8b9));}function handleFindAgent(_0x1ff62d){return function(_0xb726fa){return _0xb726fa[_0x3586('0xa')][_0x3586('0xb')]()===_0x1ff62d[_0x3586('0xb')]();};}exports[_0x3586('0xc')]=function(_0x55fa46,_0x370b11,_0xe4f72e,_0x3e1b6b){return function(_0x5839f4){try{var _0x36ccc6={'name':_0x370b11[0x0],'timeout':_0x370b11[0x1]};var _0x58c8a8=queue[_0x3586('0x0')](_0x36ccc6,{'typecast':!![]});if(_0x58c8a8[_0x3586('0xd')]){logger[_0x3586('0xe')](_0x3586('0xf'),_0x55fa46,_['map'](_0x58c8a8,_0x3586('0x10'))[_0x3586('0x11')](',\x20'));_0x5839f4[_0x3586('0x12')]();}else{var _0x564383=_['find'](_0xe4f72e['agents'],handleFindAgent(_0x36ccc6[_0x3586('0xa')]));if(_0x564383){var _0x1f3863=(_0x36ccc6[_0x3586('0x13')]||0xa)*0x3e8;var _0x5e34da,_0x4b7fcb;var _0x53d280=seqqueue['createQueue'](_0x1f3863);_0x53d280['id']=_0x55fa46;_0x53d280[_0x3586('0x14')]=_0x1f3863;_0x53d280[_0x3586('0x15')]=_0x3e1b6b[_0x3586('0x15')];writeLog(_0x55fa46,_0x564383,util[_0x3586('0x9')](_0x3586('0x16'),_0x1f3863));_0xe4f72e[_0x3586('0x17')][_0x55fa46]['on'](_0x3586('0x18'),function(){logger[_0x3586('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x55fa46);clearTimeout(_0x4b7fcb);_0x4b7fcb=undefined;_0x53d280[_0x3586('0x19')]();if(_0xe4f72e[_0x3586('0x17')][_0x55fa46]){delete _0xe4f72e['rules'][_0x55fa46];}_0x5839f4[_0x3586('0x12')]();});_0xe4f72e[_0x3586('0x17')][_0x55fa46]['on']('complete',function(){if(_0xe4f72e[_0x3586('0x17')][_0x55fa46]){delete _0xe4f72e[_0x3586('0x17')][_0x55fa46];}});_0x4b7fcb=setTimeout(function(){logger[_0x3586('0x8')](_0x3586('0x1a'),_0x55fa46);clearTimeout(_0x4b7fcb);_0x53d280[_0x3586('0x19')]();_0x5839f4[_0x3586('0x1b')]();},_0x1f3863);strategy['agent'](_0x53d280,_0x564383,_0xe4f72e,_0x3e1b6b);}else{logger['error'](_0x3586('0x1c'),_0x55fa46,_0x36ccc6[_0x3586('0xa')]);_0x5839f4[_0x3586('0x12')]();}}}catch(_0x1d612d){console[_0x3586('0x1d')](_0x1d612d);logger['error'](_0x3586('0x1e'),_0x55fa46,_0x1d612d['stack']);_0x5839f4[_0x3586('0x12')]();}};}; \ No newline at end of file +var _0xbca6=['next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','stop','find','timeout','atimeout','channel','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x30a5c1,_0x38e40d){var _0x278197=function(_0x5c8bc3){while(--_0x5c8bc3){_0x30a5c1['push'](_0x30a5c1['shift']());}};_0x278197(++_0x38e40d);}(_0xbca6,0x139));var _0x6bca=function(_0x30e798,_0x22ee21){_0x30e798=_0x30e798-0x0;var _0x237159=_0xbca6[_0x30e798];return _0x237159;};'use strict';var schema=require(_0x6bca('0x0'));var _=require(_0x6bca('0x1'));var util=require(_0x6bca('0x2'));var seqqueue=require(_0x6bca('0x3'));var logger=require(_0x6bca('0x4'))(_0x6bca('0x5'));var strategy=require(_0x6bca('0x6'));var queue=schema({'name':{'type':_0x6bca('0x7'),'required':!![],'message':_0x6bca('0x8')},'timeout':{'type':_0x6bca('0x9'),'message':_0x6bca('0xa')}});function writeLog(_0x74496b,_0xb163db,_0x27d162){return logger[_0x6bca('0xb')](util[_0x6bca('0xc')](_0x6bca('0xd'),_0x74496b,_0xb163db['name'],_0x27d162));}function handleFindAgent(_0x5ec9a5){return function(_0x4bf9b1){return _0x4bf9b1[_0x6bca('0xe')][_0x6bca('0xf')]()===_0x5ec9a5[_0x6bca('0xf')]();};}exports[_0x6bca('0x10')]=function(_0x1191cd,_0x262281,_0x778e28,_0x422099){return function(_0x2d851f){try{var _0x30890f={'name':_0x262281[0x0],'timeout':_0x262281[0x1]};var _0x1f9aa8=queue[_0x6bca('0x0')](_0x30890f,{'typecast':!![]});if(_0x1f9aa8['length']){logger['error'](_0x6bca('0x11'),_0x1191cd,_['map'](_0x1f9aa8,'message')['join'](',\x20'));_0x2d851f[_0x6bca('0x12')]();}else{var _0x24b9bd=_[_0x6bca('0x13')](_0x778e28['agents'],handleFindAgent(_0x30890f['name']));if(_0x24b9bd){var _0x4a2969=(_0x30890f[_0x6bca('0x14')]||0xa)*0x3e8;var _0x8ffbd8,_0x46368f;var _0x326ba3=seqqueue['createQueue'](_0x4a2969);_0x326ba3['id']=_0x1191cd;_0x326ba3[_0x6bca('0x15')]=_0x4a2969;_0x326ba3[_0x6bca('0x16')]=_0x422099[_0x6bca('0x16')];writeLog(_0x1191cd,_0x24b9bd,util[_0x6bca('0xc')]('START:%s',_0x4a2969));_0x778e28[_0x6bca('0x17')][_0x1191cd]['on']('end',function(){logger[_0x6bca('0xb')](_0x6bca('0x18'),_0x1191cd);clearTimeout(_0x46368f);_0x46368f=undefined;_0x326ba3[_0x6bca('0x19')]();if(_0x778e28[_0x6bca('0x17')][_0x1191cd]){delete _0x778e28[_0x6bca('0x17')][_0x1191cd];}_0x2d851f[_0x6bca('0x12')]();});_0x778e28[_0x6bca('0x17')][_0x1191cd]['on']('complete',function(){if(_0x778e28[_0x6bca('0x17')][_0x1191cd]){delete _0x778e28['rules'][_0x1191cd];}});_0x46368f=setTimeout(function(){logger[_0x6bca('0xb')](_0x6bca('0x1a'),_0x1191cd);clearTimeout(_0x46368f);_0x326ba3[_0x6bca('0x19')]();_0x2d851f[_0x6bca('0x1b')]();},_0x4a2969);strategy[_0x6bca('0x1c')](_0x326ba3,_0x24b9bd,_0x778e28,_0x422099);}else{logger[_0x6bca('0x1d')](_0x6bca('0x1e'),_0x1191cd,_0x30890f[_0x6bca('0xe')]);_0x2d851f[_0x6bca('0x12')]();}}}catch(_0x1fb01c){console[_0x6bca('0x1f')](_0x1fb01c);logger[_0x6bca('0x1d')](_0x6bca('0x20'),_0x1191cd,_0x1fb01c[_0x6bca('0x21')]);_0x2d851f[_0x6bca('0x12')]();}};}; \ 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 8b31be6..19b0b72 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 _0x28f3=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','Failed','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x28f3,0x127));var _0x328f=function(_0x2701c8,_0x1435b7){_0x2701c8=_0x2701c8-0x0;var _0xc66061=_0x28f3[_0x2701c8];return _0xc66061;};'use strict';var _=require(_0x328f('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x328f('0x1'))(_0x328f('0x2'));var rpc={'chatMessage':require(_0x328f('0x3')),'openchannelMessage':require(_0x328f('0x4')),'mailMessage':require(_0x328f('0x5')),'smsMessage':require(_0x328f('0x6')),'faxMessage':require(_0x328f('0x7')),'whatsappMessage':require(_0x328f('0x8'))};exports['consequence']=function(_0x25cdea,_0x534373){return function(_0x1da4c4){try{if(!_[_0x328f('0x9')](this[_0x328f('0xa')][_0x328f('0xb')])){logger[_0x328f('0xc')]('[%s][AMAZONLEX]\x20%s',_0x25cdea,_0x328f('0xd'));return _0x1da4c4['next']();}var _0x5a0be0={'ContactId':this[_0x328f('0xe')]['id'],'sentAt':moment()[_0x328f('0xf')](_0x328f('0x10')),'direction':_0x328f('0x11')};if(this[_0x328f('0x12')]===_0x328f('0x13')||this[_0x328f('0x12')]==='whatsapp'){_0x5a0be0['phone']=this[_0x328f('0xa')][_0x328f('0x14')];}var _0x206930=this['channel'];if(_0x206930===_0x328f('0x15')){_0x5a0be0[_0x328f('0x16')]=this[_0x328f('0x17')]['id'];}else{_0x5a0be0[_[_0x328f('0x18')](_0x206930)+_0x328f('0x19')]=this[_0x328f('0x17')]['id'];}_0x5a0be0[_['upperFirst'](_0x206930)+_0x328f('0x1a')]=this['interaction']['id'];if(this[_0x328f('0xa')][_0x328f('0x1b')]){var _0x24e638=_0x534373[0x4];if(!_['isEmpty'](_0x24e638)){_0x5a0be0[_0x328f('0x1c')]=utils[_0x328f('0x1d')](_0x24e638,this);return rpc[_0x206930+_0x328f('0x1e')][_0x328f('0x1f')](_0x5a0be0)[_0x328f('0x20')](function(_0x59f41d){logger['info'](_0x328f('0x21'),_0x25cdea,_0x5a0be0['body']);})[_0x328f('0x22')](function(_0x468735){logger[_0x328f('0x23')](_0x328f('0x21'),_0x25cdea,JSON[_0x328f('0x24')](_0x468735));})['finally'](function(){logger[_0x328f('0xc')](_0x328f('0x25'),_0x25cdea);_0x1da4c4['stop']();});}else{logger[_0x328f('0xc')](_0x328f('0x26'),_0x25cdea);_0x1da4c4['stop']();}}else{var _0x2927b9=this;var _0xc42b0b=new AWS[(_0x328f('0x27'))]({'accessKeyId':_0x534373[0x0],'secretAccessKey':_0x534373[0x1],'region':_0x534373[0x2]});var _0x162a60={'botAlias':_0x328f('0x28'),'botName':_0x534373[0x3],'inputText':this[_0x328f('0x29')]['body'],'userId':this[_0x328f('0x12')]+':'+this['interaction']['id'][_0x328f('0x2a')]()};_0xc42b0b[_0x328f('0x2b')](_0x162a60,function(_0x3b75d6,_0x105ff8){if(_0x3b75d6){logger['error'](_0x328f('0x21'),_0x25cdea,_0x3b75d6[_0x328f('0x29')]);_0x1da4c4[_0x328f('0x2c')]();}else if(_0x105ff8&&_0x105ff8[_0x328f('0x29')]){_0x2927b9['body'][_0x328f('0x2d')]=_0x105ff8;_0x5a0be0['body']=_0x105ff8[_0x328f('0x29')];_0x5a0be0[_0x328f('0x2e')]=_0x328f('0x2d');_0x5a0be0[_0x328f('0x2f')]=JSON['stringify'](_0x105ff8);return rpc[_0x206930+_0x328f('0x1e')][_0x328f('0x1f')](_0x5a0be0)[_0x328f('0x20')](function(_0x36d654){logger[_0x328f('0xc')](_0x328f('0x21'),_0x25cdea,_0x5a0be0[_0x328f('0x1c')]);if(_0x105ff8['dialogState']==_0x328f('0x30')){_0x1da4c4[_0x328f('0x2c')]();}else{_0x1da4c4[_0x328f('0x31')]();}})['catch'](function(_0x1234a){logger[_0x328f('0x23')](_0x328f('0x21'),_0x25cdea,JSON['stringify'](_0x1234a));_0x1da4c4[_0x328f('0x2c')]();});}else{_0x1da4c4['next']();}});}}catch(_0x334c53){logger[_0x328f('0x23')](_0x328f('0x21'),_0x25cdea,JSON[_0x328f('0x24')](_0x334c53));_0x1da4c4[_0x328f('0x31')]();}};}; \ No newline at end of file +var _0x4458=['[%s][AMAZONLEX]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','info','body','catch','error','finally','stop','LexRuntime','$LATEST','message','postText','providerName','amazonlex','providerResponse','stringify','dialogState','Failed','next','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId'];(function(_0x478495,_0x1b85e3){var _0x28513d=function(_0x34dd61){while(--_0x34dd61){_0x478495['push'](_0x478495['shift']());}};_0x28513d(++_0x1b85e3);}(_0x4458,0x181));var _0x8445=function(_0x488291,_0xb98e97){_0x488291=_0x488291-0x0;var _0x4fd4a7=_0x4458[_0x488291];return _0x4fd4a7;};'use strict';var _=require(_0x8445('0x0'));var moment=require('moment');var AWS=require(_0x8445('0x1'));var utils=require(_0x8445('0x2'));var logger=require(_0x8445('0x3'))(_0x8445('0x4'));var rpc={'chatMessage':require(_0x8445('0x5')),'openchannelMessage':require(_0x8445('0x6')),'mailMessage':require(_0x8445('0x7')),'smsMessage':require(_0x8445('0x8')),'faxMessage':require(_0x8445('0x9')),'whatsappMessage':require(_0x8445('0xa'))};exports[_0x8445('0xb')]=function(_0x351660,_0x5ec16d){return function(_0x26b896){try{if(!_[_0x8445('0xc')](this[_0x8445('0xd')][_0x8445('0xe')])){logger['info'](_0x8445('0xf'),_0x351660,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x26b896['next']();}var _0x3b11c6={'ContactId':this[_0x8445('0x10')]['id'],'sentAt':moment()[_0x8445('0x11')](_0x8445('0x12')),'direction':_0x8445('0x13')};if(this[_0x8445('0x14')]==='sms'||this['channel']==='whatsapp'){_0x3b11c6['phone']=this[_0x8445('0xd')][_0x8445('0x15')];}var _0x50a207=this[_0x8445('0x14')];if(_0x50a207===_0x8445('0x16')){_0x3b11c6['ChatWebsiteId']=this[_0x8445('0x17')]['id'];}else{_0x3b11c6[_[_0x8445('0x18')](_0x50a207)+_0x8445('0x19')]=this['account']['id'];}_0x3b11c6[_[_0x8445('0x18')](_0x50a207)+_0x8445('0x1a')]=this['interaction']['id'];if(this[_0x8445('0xd')][_0x8445('0x1b')]){var _0x5b9f0c=_0x5ec16d[0x4];if(!_[_0x8445('0x1c')](_0x5b9f0c)){_0x3b11c6['body']=utils[_0x8445('0x1d')](_0x5b9f0c,this);return rpc[_0x50a207+_0x8445('0x1e')][_0x8445('0x1f')](_0x3b11c6)[_0x8445('0x20')](function(_0x53a964){logger[_0x8445('0x21')](_0x8445('0xf'),_0x351660,_0x3b11c6[_0x8445('0x22')]);})[_0x8445('0x23')](function(_0x46764e){logger[_0x8445('0x24')]('[%s][AMAZONLEX]\x20%s',_0x351660,JSON['stringify'](_0x46764e));})[_0x8445('0x25')](function(){logger[_0x8445('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x351660);_0x26b896['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x351660);_0x26b896[_0x8445('0x26')]();}}else{var _0x421592=this;var _0x3e698a=new AWS[(_0x8445('0x27'))]({'accessKeyId':_0x5ec16d[0x0],'secretAccessKey':_0x5ec16d[0x1],'region':_0x5ec16d[0x2]});var _0x4f9bb0={'botAlias':_0x8445('0x28'),'botName':_0x5ec16d[0x3],'inputText':this[_0x8445('0x29')][_0x8445('0x22')],'userId':this[_0x8445('0x14')]+':'+this[_0x8445('0xd')]['id']['toString']()};_0x3e698a[_0x8445('0x2a')](_0x4f9bb0,function(_0x45b233,_0x39b063){if(_0x45b233){logger[_0x8445('0x24')](_0x8445('0xf'),_0x351660,_0x45b233[_0x8445('0x29')]);_0x26b896['next']();}else if(_0x39b063&&_0x39b063[_0x8445('0x29')]){_0x421592['body']['amazonlex']=_0x39b063;_0x3b11c6[_0x8445('0x22')]=_0x39b063['message'];_0x3b11c6[_0x8445('0x2b')]=_0x8445('0x2c');_0x3b11c6[_0x8445('0x2d')]=JSON[_0x8445('0x2e')](_0x39b063);return rpc[_0x50a207+'Message'][_0x8445('0x1f')](_0x3b11c6)[_0x8445('0x20')](function(_0x4829e7){logger['info'](_0x8445('0xf'),_0x351660,_0x3b11c6['body']);if(_0x39b063[_0x8445('0x2f')]==_0x8445('0x30')){_0x26b896[_0x8445('0x31')]();}else{_0x26b896['stop']();}})[_0x8445('0x23')](function(_0x10c45c){logger['error'](_0x8445('0xf'),_0x351660,JSON['stringify'](_0x10c45c));_0x26b896[_0x8445('0x31')]();});}else{_0x26b896[_0x8445('0x31')]();}});}}catch(_0x337381){logger[_0x8445('0x24')](_0x8445('0xf'),_0x351660,JSON[_0x8445('0x2e')](_0x337381));_0x26b896[_0x8445('0x26')]();}};}; \ 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 cc3d1f9..bddc62e 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 _0xf6fb=['catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','then','Interaction'];(function(_0x1ec050,_0x4518b1){var _0x49f249=function(_0x1b96bf){while(--_0x1b96bf){_0x1ec050['push'](_0x1ec050['shift']());}};_0x49f249(++_0x4518b1);}(_0xf6fb,0x120));var _0xbf6f=function(_0x406347,_0x3afc59){_0x406347=_0x406347-0x0;var _0x75e14e=_0xf6fb[_0x406347];return _0x75e14e;};'use strict';var _=require('lodash');var moment=require(_0xbf6f('0x0'));var utils=require(_0xbf6f('0x1'));var logger=require(_0xbf6f('0x2'))(_0xbf6f('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbf6f('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbf6f('0x5')),'faxMessage':require(_0xbf6f('0x6')),'whatsappMessage':require(_0xbf6f('0x7')),'chatInteraction':require(_0xbf6f('0x8')),'openchannelInteraction':require(_0xbf6f('0x9')),'mailInteraction':require(_0xbf6f('0xa')),'smsInteraction':require(_0xbf6f('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xbf6f('0xc'))};var mailRpc=require(_0xbf6f('0xd'));exports[_0xbf6f('0xe')]=function(_0x436981,_0x2bca3d,_0x129ab8,_0x195900){return function(_0x112fe8){try{var _0x161312=this[_0xbf6f('0xf')];if(_0x161312===_0xbf6f('0x10')&&_0x195900[_0xbf6f('0x11')][_0xbf6f('0x12')]){logger[_0xbf6f('0x13')](_0xbf6f('0x14'),_0x436981,_0xbf6f('0x15'));return _0x112fe8[_0xbf6f('0x16')]();}if(_0x2bca3d[0x0]==='1'&&(_[_0xbf6f('0x17')](this[_0xbf6f('0x18')][_0xbf6f('0x19')])||!this[_0xbf6f('0x18')]['created'])){logger[_0xbf6f('0x13')](_0xbf6f('0x14'),_0x436981,_0xbf6f('0x1a'));return _0x112fe8[_0xbf6f('0x16')]();}if(_0x2bca3d[0x0]==='2'&&this['interaction'][_0xbf6f('0x1b')]){logger['info'](_0xbf6f('0x1c'),_0x436981,'One\x20Time\x20already\x20sent');return _0x112fe8[_0xbf6f('0x16')]();}var _0x15158b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xbf6f('0x1d')](_0xbf6f('0x1e')),'direction':_0xbf6f('0x1f')};if(this['channel']==='mail'){_0x15158b['body']=utils[_0xbf6f('0x20')](_0x2bca3d[0x2],this);}else{_0x15158b[_0xbf6f('0x11')]=utils[_0xbf6f('0x20')](_0x2bca3d[0x1],this);}if(this[_0xbf6f('0x21')]){_0x15158b['to']=this[_0xbf6f('0x21')][_0xbf6f('0x22')]||'';if(this['channel']===_0xbf6f('0x10')&&_0x2bca3d[0x1]==='1'){_0x15158b['cc']=this[_0xbf6f('0x21')]['cc']||'';}_0x15158b[_0xbf6f('0x22')]=this[_0xbf6f('0x21')]['to']||'';_0x15158b[_0xbf6f('0x23')]=this[_0xbf6f('0x21')]['phone']||'';_0x15158b[_0xbf6f('0x24')]=!![];if(this[_0xbf6f('0x21')][_0xbf6f('0x25')]){_0x15158b[_0xbf6f('0x25')]='';_0x15158b[_0xbf6f('0x25')]+=_[_0xbf6f('0x26')](this['message'][_0xbf6f('0x25')],'Re:')?'':_0xbf6f('0x27');_0x15158b[_0xbf6f('0x25')]+=this['message'][_0xbf6f('0x25')];}}if(this[_0xbf6f('0xf')]===_0xbf6f('0x28')){_0x15158b['ChatWebsiteId']=this[_0xbf6f('0x29')]['id'];}else{_0x15158b[_[_0xbf6f('0x2a')](this[_0xbf6f('0xf')])+_0xbf6f('0x2b')]=this[_0xbf6f('0x29')]['id'];}_0x15158b[_[_0xbf6f('0x2a')](this[_0xbf6f('0xf')])+_0xbf6f('0x2c')]=this[_0xbf6f('0x18')]['id'];var _0x236324=this[_0xbf6f('0x18')];if(rpc[this[_0xbf6f('0xf')]+_0xbf6f('0x2d')]){if(this[_0xbf6f('0xf')]===_0xbf6f('0x10')){_0x15158b[_0xbf6f('0x2e')]=this[_0xbf6f('0x21')][_0xbf6f('0x2f')];_0x15158b[_0xbf6f('0x30')]=_0xbf6f('0x31')+_[_0xbf6f('0x32')](_0x15158b[_0xbf6f('0x11')],_0xbf6f('0x33'),_0xbf6f('0x34'))+_0xbf6f('0x35');_0x15158b[_0xbf6f('0x36')]={'Auto-Submitted':_0xbf6f('0x37'),'X-Auto-Response-Suppress':'All','Precedence':_0xbf6f('0x38')};return mailRpc[_0xbf6f('0x39')](this['account'][_0xbf6f('0x3a')],_0x15158b)['then'](function(_0x11383d){logger[_0xbf6f('0x13')](_0xbf6f('0x3b'),_0x436981);_0x15158b[_0xbf6f('0x2f')]=_0x11383d[_0xbf6f('0x21')]['messageId'];return rpc[_0x161312+_0xbf6f('0x2d')][_0xbf6f('0x3c')](_0x15158b);})['then'](function(_0x13d34a){logger[_0xbf6f('0x13')](_0xbf6f('0x14'),_0x436981,JSON[_0xbf6f('0x3d')](_0x13d34a));})['catch'](function(_0x21aefa){logger[_0xbf6f('0x3e')](_0xbf6f('0x3f'),_0x436981,JSON['stringify'](_0x21aefa));})[_0xbf6f('0x40')](function(){Promise['resolve']()[_0xbf6f('0x41')](function(){if(_0x2bca3d[0x0]!=='2'||_0x236324[_0xbf6f('0x1b')])return;return rpc[_0x161312+_0xbf6f('0x42')]['update'](_0x236324['id'],{'autoreplyExecuted':!![]})[_0xbf6f('0x41')](function(_0x18920f){logger[_0xbf6f('0x13')](_0xbf6f('0x1c'),_0x436981,JSON[_0xbf6f('0x3d')](_0x18920f));})[_0xbf6f('0x43')](function(_0x5c6513){logger[_0xbf6f('0x3e')](_0xbf6f('0x44'),_0x436981,JSON[_0xbf6f('0x3d')](_0x5c6513));});})[_0xbf6f('0x41')](function(){_0x112fe8[_0xbf6f('0x16')]();});});}else{return rpc[this[_0xbf6f('0xf')]+_0xbf6f('0x2d')]['create'](_0x15158b)[_0xbf6f('0x41')](function(){logger[_0xbf6f('0x13')](_0xbf6f('0x14'),_0x436981,_0x15158b[_0xbf6f('0x11')]);})[_0xbf6f('0x43')](function(_0x4b53b0){logger[_0xbf6f('0x3e')](_0xbf6f('0x14'),_0x436981,JSON[_0xbf6f('0x3d')](_0x4b53b0));})['finally'](function(){Promise[_0xbf6f('0x45')]()[_0xbf6f('0x41')](function(){if(_0x2bca3d[0x0]!=='2'||_0x236324[_0xbf6f('0x1b')])return;return rpc[_0x161312+_0xbf6f('0x42')]['update'](_0x236324['id'],{'autoreplyExecuted':!![]})[_0xbf6f('0x41')](function(_0x1cb962){logger[_0xbf6f('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x436981,JSON[_0xbf6f('0x3d')](_0x1cb962));})[_0xbf6f('0x43')](function(_0x40dfb5){logger['error'](_0xbf6f('0x44'),_0x436981,JSON[_0xbf6f('0x3d')](_0x40dfb5));});})[_0xbf6f('0x41')](function(){_0x112fe8[_0xbf6f('0x16')]();});});}}}catch(_0x2d2aaf){logger[_0xbf6f('0x3e')]('[%s][AUTOREPLY]\x20%s',_0x436981,JSON['stringify'](_0x2d2aaf));_0x112fe8[_0xbf6f('0x46')]();}};}; \ No newline at end of file +var _0xce11=['phone','read','subject','startsWith','Re:','Re:\x20','upperFirst','AccountId','account','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from'];(function(_0xccdde3,_0x4786bb){var _0x3e3a29=function(_0x4e9bc2){while(--_0x4e9bc2){_0xccdde3['push'](_0xccdde3['shift']());}};_0x3e3a29(++_0x4786bb);}(_0xce11,0xf3));var _0x1ce1=function(_0x7a49f0,_0x4e794c){_0x7a49f0=_0x7a49f0-0x0;var _0x1161d3=_0xce11[_0x7a49f0];return _0x1161d3;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require('./utils');var logger=require(_0x1ce1('0x0'))('routing');var rpc={'chatMessage':require(_0x1ce1('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1ce1('0x2')),'smsMessage':require(_0x1ce1('0x3')),'faxMessage':require(_0x1ce1('0x4')),'whatsappMessage':require(_0x1ce1('0x5')),'chatInteraction':require(_0x1ce1('0x6')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x1ce1('0x7')),'smsInteraction':require(_0x1ce1('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1ce1('0x9'))};var mailRpc=require(_0x1ce1('0xa'));exports[_0x1ce1('0xb')]=function(_0xdada6a,_0x18f192,_0x81d305,_0x2d41b2){return function(_0x30f3a8){try{var _0x397033=this[_0x1ce1('0xc')];if(_0x397033===_0x1ce1('0xd')&&_0x2d41b2[_0x1ce1('0xe')][_0x1ce1('0xf')]){logger['info'](_0x1ce1('0x10'),_0xdada6a,_0x1ce1('0x11'));return _0x30f3a8[_0x1ce1('0x12')]();}if(_0x18f192[0x0]==='1'&&(_[_0x1ce1('0x13')](this[_0x1ce1('0x14')][_0x1ce1('0x15')])||!this[_0x1ce1('0x14')][_0x1ce1('0x15')])){logger[_0x1ce1('0x16')](_0x1ce1('0x10'),_0xdada6a,_0x1ce1('0x17'));return _0x30f3a8[_0x1ce1('0x12')]();}if(_0x18f192[0x0]==='2'&&this[_0x1ce1('0x14')]['autoreplyExecuted']){logger[_0x1ce1('0x16')](_0x1ce1('0x18'),_0xdada6a,_0x1ce1('0x19'));return _0x30f3a8[_0x1ce1('0x12')]();}var _0x2ad012={'ContactId':this[_0x1ce1('0x1a')]['id'],'sentAt':moment()[_0x1ce1('0x1b')](_0x1ce1('0x1c')),'direction':_0x1ce1('0x1d')};if(this[_0x1ce1('0xc')]==='mail'){_0x2ad012[_0x1ce1('0xe')]=utils[_0x1ce1('0x1e')](_0x18f192[0x2],this);}else{_0x2ad012['body']=utils[_0x1ce1('0x1e')](_0x18f192[0x1],this);}if(this['message']){_0x2ad012['to']=this[_0x1ce1('0x1f')][_0x1ce1('0x20')]||'';if(this['channel']===_0x1ce1('0xd')&&_0x18f192[0x1]==='1'){_0x2ad012['cc']=this[_0x1ce1('0x1f')]['cc']||'';}_0x2ad012[_0x1ce1('0x20')]=this[_0x1ce1('0x1f')]['to']||'';_0x2ad012[_0x1ce1('0x21')]=this['message'][_0x1ce1('0x21')]||'';_0x2ad012[_0x1ce1('0x22')]=!![];if(this[_0x1ce1('0x1f')][_0x1ce1('0x23')]){_0x2ad012[_0x1ce1('0x23')]='';_0x2ad012['subject']+=_[_0x1ce1('0x24')](this['message'][_0x1ce1('0x23')],_0x1ce1('0x25'))?'':_0x1ce1('0x26');_0x2ad012[_0x1ce1('0x23')]+=this[_0x1ce1('0x1f')][_0x1ce1('0x23')];}}if(this[_0x1ce1('0xc')]==='chat'){_0x2ad012['ChatWebsiteId']=this['account']['id'];}else{_0x2ad012[_[_0x1ce1('0x27')](this[_0x1ce1('0xc')])+_0x1ce1('0x28')]=this[_0x1ce1('0x29')]['id'];}_0x2ad012[_[_0x1ce1('0x27')](this[_0x1ce1('0xc')])+'InteractionId']=this[_0x1ce1('0x14')]['id'];var _0x4c670d=this[_0x1ce1('0x14')];if(rpc[this[_0x1ce1('0xc')]+_0x1ce1('0x2a')]){if(this[_0x1ce1('0xc')]==='mail'){_0x2ad012[_0x1ce1('0x2b')]=this[_0x1ce1('0x1f')][_0x1ce1('0x2c')];_0x2ad012[_0x1ce1('0x2d')]=_0x1ce1('0x2e')+_[_0x1ce1('0x2f')](_0x2ad012['body'],']+(>|$)/g,''),'priorityTrue':_0x304993[0x1],'priorityFalse':_0x304993[0x2]};var _0xe63bf=gotoif['validate'](_0x44bc57,{'typecast':!![]});if(_0xe63bf[_0xccc0('0xc')]){logger[_0xccc0('0xd')](_0xccc0('0xe'),_0xe08314,_[_0xccc0('0xf')](_0xe63bf,_0xccc0('0x10'))[_0xccc0('0x11')](',\x20'));_0x2c64a1['stop']();}else{try{var _0x2da1b4=eval('('+_0x44bc57['condition']+')');var _0x5768e7=_0x2da1b4?_0x44bc57['priorityTrue']:_0x44bc57[_0xccc0('0x12')];logger[_0xccc0('0x13')](_0xccc0('0x14'),_0xe08314,_0x44bc57[_0xccc0('0x15')],_0x2da1b4,_0x5768e7||_0xccc0('0x16'));if(_0x5768e7){var _0x414aff=_[_0xccc0('0x17')](_0x2c64a1[_0xccc0('0x18')](),{'p':_0x5768e7});if(_0x414aff>=0x0){logger[_0xccc0('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xe08314,_0x5768e7||_0xccc0('0x16'),_0x414aff);_0x2c64a1[_0xccc0('0x16')](_0x414aff);}else{logger[_0xccc0('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xe08314,_0x5768e7||'next');_0x2c64a1['stop']();}}else{_0x2c64a1[_0xccc0('0x16')]();}}catch(_0x55cb01){logger[_0xccc0('0xd')](_0xccc0('0x19'),_0xe08314,_0x55cb01[_0xccc0('0x10')]);_0x2c64a1[_0xccc0('0x1a')]();}}}catch(_0xa5b6e4){logger[_0xccc0('0xd')](_0xccc0('0xe'),_0xe08314,JSON['stringify'](_0xa5b6e4));_0x2c64a1[_0xccc0('0x1a')]();}};}; \ No newline at end of file +var _0xdb74=['number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xdb74,0x1a9));var _0x4db7=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xdb74[_0x1035c1];return _0x308d67;};'use strict';var schema=require(_0x4db7('0x0'));var _=require('lodash');var htmlToText=require(_0x4db7('0x1'));var utils=require(_0x4db7('0x2'));var logger=require(_0x4db7('0x3'))(_0x4db7('0x4'));var gotoif=schema({'condition':{'type':_0x4db7('0x5'),'required':!![],'message':_0x4db7('0x6')},'priorityTrue':{'type':_0x4db7('0x7'),'message':_0x4db7('0x8')},'priorityFalse':{'type':'number','message':_0x4db7('0x9')}});exports['consequence']=function(_0x5b13d2,_0x59a69c){return function(_0x2aab0d){try{var _0x2c6835={'condition':htmlToText[_0x4db7('0xa')](utils[_0x4db7('0xb')](_0x59a69c[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x59a69c[0x1],'priorityFalse':_0x59a69c[0x2]};var _0x105ed7=gotoif[_0x4db7('0x0')](_0x2c6835,{'typecast':!![]});if(_0x105ed7['length']){logger[_0x4db7('0xc')](_0x4db7('0xd'),_0x5b13d2,_['map'](_0x105ed7,_0x4db7('0xe'))[_0x4db7('0xf')](',\x20'));_0x2aab0d[_0x4db7('0x10')]();}else{try{var _0x137615=eval('('+_0x2c6835[_0x4db7('0x11')]+')');var _0x5f72f=_0x137615?_0x2c6835[_0x4db7('0x12')]:_0x2c6835['priorityFalse'];logger[_0x4db7('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5b13d2,_0x2c6835[_0x4db7('0x11')],_0x137615,_0x5f72f||_0x4db7('0x14'));if(_0x5f72f){var _0x518d44=_[_0x4db7('0x15')](_0x2aab0d[_0x4db7('0x16')](),{'p':_0x5f72f});if(_0x518d44>=0x0){logger[_0x4db7('0x13')](_0x4db7('0x17'),_0x5b13d2,_0x5f72f||_0x4db7('0x14'),_0x518d44);_0x2aab0d['next'](_0x518d44);}else{logger[_0x4db7('0x13')](_0x4db7('0x18'),_0x5b13d2,_0x5f72f||_0x4db7('0x14'));_0x2aab0d[_0x4db7('0x10')]();}}else{_0x2aab0d[_0x4db7('0x14')]();}}catch(_0x43a417){logger[_0x4db7('0xc')](_0x4db7('0x19'),_0x5b13d2,_0x43a417['message']);_0x2aab0d[_0x4db7('0x10')]();}}}catch(_0x562bfa){logger[_0x4db7('0xc')](_0x4db7('0xd'),_0x5b13d2,JSON[_0x4db7('0x1a')](_0x562bfa));_0x2aab0d['stop']();}};}; \ 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 21ae075..b413612 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 _0xe1ad=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe1ad,0xc2));var _0xde1a=function(_0x92dbcd,_0x4f16cb){_0x92dbcd=_0x92dbcd-0x0;var _0x30ea2e=_0xe1ad[_0x92dbcd];return _0x30ea2e;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xde1a('0x0'))(_0xde1a('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xde1a('0x2')}});exports[_0xde1a('0x3')]=function(_0x5eb3e1,_0x93c78c){return function(_0x45c5d5){try{var _0x146b45={'priority':_0x93c78c[0x0]};var _0x19b22d=gotop['validate'](_0x146b45,{'typecast':!![]});if(_0x19b22d[_0xde1a('0x4')]){logger[_0xde1a('0x5')](_0xde1a('0x6'),_0x5eb3e1,_[_0xde1a('0x7')](_0x19b22d,_0xde1a('0x8'))['join'](',\x20'));_0x45c5d5[_0xde1a('0x9')]();}else{logger[_0xde1a('0xa')](_0xde1a('0xb'),_0x5eb3e1,_0x146b45[_0xde1a('0xc')]);if(_0x146b45[_0xde1a('0xc')]){var _0x2da7d3=_[_0xde1a('0xd')](_0x45c5d5[_0xde1a('0xe')](),{'p':_0x146b45[_0xde1a('0xc')]});if(_0x2da7d3>=0x0){logger[_0xde1a('0xa')](_0xde1a('0xf'),_0x5eb3e1,_0x146b45['priority']||'next',_0x2da7d3);_0x45c5d5[_0xde1a('0x10')](_0x2da7d3);}else{logger[_0xde1a('0xa')](_0xde1a('0x11'),_0x5eb3e1,_0x146b45[_0xde1a('0xc')]||_0xde1a('0x10'));_0x45c5d5[_0xde1a('0x9')]();}}else{_0x45c5d5[_0xde1a('0x10')]();}}}catch(_0x45850e){logger[_0xde1a('0x5')](_0xde1a('0x6'),_0x5eb3e1,JSON[_0xde1a('0x12')](_0x45850e));_0x45c5d5[_0xde1a('0x9')]();}};}; \ No newline at end of file +var _0x8fcb=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x87a7d9,_0x1fa17c){var _0x488f0c=function(_0x155c53){while(--_0x155c53){_0x87a7d9['push'](_0x87a7d9['shift']());}};_0x488f0c(++_0x1fa17c);}(_0x8fcb,0x158));var _0xb8fc=function(_0x5b032a,_0x12d59b){_0x5b032a=_0x5b032a-0x0;var _0x21ab09=_0x8fcb[_0x5b032a];return _0x21ab09;};'use strict';var schema=require(_0xb8fc('0x0'));var _=require(_0xb8fc('0x1'));var logger=require(_0xb8fc('0x2'))(_0xb8fc('0x3'));var gotop=schema({'priority':{'type':_0xb8fc('0x4'),'required':!![],'message':_0xb8fc('0x5')}});exports[_0xb8fc('0x6')]=function(_0x38520a,_0x58b7df){return function(_0x155c1c){try{var _0x49b6ab={'priority':_0x58b7df[0x0]};var _0x25cfc9=gotop[_0xb8fc('0x0')](_0x49b6ab,{'typecast':!![]});if(_0x25cfc9['length']){logger[_0xb8fc('0x7')](_0xb8fc('0x8'),_0x38520a,_['map'](_0x25cfc9,_0xb8fc('0x9'))[_0xb8fc('0xa')](',\x20'));_0x155c1c[_0xb8fc('0xb')]();}else{logger[_0xb8fc('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x38520a,_0x49b6ab['priority']);if(_0x49b6ab[_0xb8fc('0xd')]){var _0xd3d26f=_[_0xb8fc('0xe')](_0x155c1c['rules'](),{'p':_0x49b6ab[_0xb8fc('0xd')]});if(_0xd3d26f>=0x0){logger[_0xb8fc('0xc')](_0xb8fc('0xf'),_0x38520a,_0x49b6ab[_0xb8fc('0xd')]||_0xb8fc('0x10'),_0xd3d26f);_0x155c1c[_0xb8fc('0x10')](_0xd3d26f);}else{logger[_0xb8fc('0xc')](_0xb8fc('0x11'),_0x38520a,_0x49b6ab[_0xb8fc('0xd')]||_0xb8fc('0x10'));_0x155c1c['stop']();}}else{_0x155c1c[_0xb8fc('0x10')]();}}}catch(_0x54a701){logger[_0xb8fc('0x7')](_0xb8fc('0x8'),_0x38520a,JSON[_0xb8fc('0x12')](_0x54a701));_0x155c1c[_0xb8fc('0xb')]();}};}; \ 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 8b6e95f..0c4e01d 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 _0x6c4d=['../../rpc/whatsappMessage','contact','account','upperFirst','channel','InteractionId','interaction','Message','then','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x6c4d,0x1dd));var _0xd6c4=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x6c4d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd6c4('0x0'));var utils=require('./utils');var logger=require(_0xd6c4('0x1'))('routing');var rpc={'chatMessage':require(_0xd6c4('0x2')),'openchannelMessage':require(_0xd6c4('0x3')),'mailMessage':require(_0xd6c4('0x4')),'smsMessage':require(_0xd6c4('0x5')),'faxMessage':require(_0xd6c4('0x6')),'whatsappMessage':require(_0xd6c4('0x7'))};exports['consequence']=function(_0x1c8c0b,_0x41c02f){return function(_0x249a1f){try{var _0x4725f8={'body':utils['getMustacheRender'](_0x41c02f[0x0],this),'ContactId':this[_0xd6c4('0x8')]['id']};if(this['channel']==='chat'){_0x4725f8['ChatWebsiteId']=this[_0xd6c4('0x9')]['id'];}else{_0x4725f8[_[_0xd6c4('0xa')](this[_0xd6c4('0xb')])+'AccountId']=this[_0xd6c4('0x9')]['id'];}_0x4725f8[_[_0xd6c4('0xa')](this[_0xd6c4('0xb')])+_0xd6c4('0xc')]=this[_0xd6c4('0xd')]['id'];if(rpc[this[_0xd6c4('0xb')]+'Message']){return rpc[this[_0xd6c4('0xb')]+_0xd6c4('0xe')]['create'](_0x4725f8)[_0xd6c4('0xf')](function(_0x42a3c7){logger['info'](_0xd6c4('0x10'),_0x1c8c0b,_0x4725f8[_0xd6c4('0x11')]);_0x249a1f['next']();})[_0xd6c4('0x12')](function(_0x4bce31){logger[_0xd6c4('0x13')]('[%s][MESSAGE]\x20%s',_0x1c8c0b,JSON[_0xd6c4('0x14')](_0x4bce31));_0x249a1f[_0xd6c4('0x15')]();});}}catch(_0x2f8e24){logger[_0xd6c4('0x13')](_0xd6c4('0x10'),_0x1c8c0b,JSON['stringify'](_0x2f8e24));_0x249a1f['stop']();}};}; \ No newline at end of file +var _0xd5fc=['AccountId','InteractionId','interaction','channel','Message','create','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','chat','account','upperFirst'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0xd5fc,0xae));var _0xcd5f=function(_0x6ce1bd,_0x40636d){_0x6ce1bd=_0x6ce1bd-0x0;var _0x5a5597=_0xd5fc[_0x6ce1bd];return _0x5a5597;};'use strict';var _=require(_0xcd5f('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xcd5f('0x1')),'openchannelMessage':require(_0xcd5f('0x2')),'mailMessage':require(_0xcd5f('0x3')),'smsMessage':require(_0xcd5f('0x4')),'faxMessage':require(_0xcd5f('0x5')),'whatsappMessage':require(_0xcd5f('0x6'))};exports['consequence']=function(_0x3eeb6b,_0x4b4ca8){return function(_0x95b8bb){try{var _0x159b3f={'body':utils['getMustacheRender'](_0x4b4ca8[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xcd5f('0x7')){_0x159b3f['ChatWebsiteId']=this[_0xcd5f('0x8')]['id'];}else{_0x159b3f[_[_0xcd5f('0x9')](this['channel'])+_0xcd5f('0xa')]=this['account']['id'];}_0x159b3f[_[_0xcd5f('0x9')](this['channel'])+_0xcd5f('0xb')]=this[_0xcd5f('0xc')]['id'];if(rpc[this[_0xcd5f('0xd')]+_0xcd5f('0xe')]){return rpc[this['channel']+_0xcd5f('0xe')][_0xcd5f('0xf')](_0x159b3f)['then'](function(_0x14125f){logger[_0xcd5f('0x10')](_0xcd5f('0x11'),_0x3eeb6b,_0x159b3f[_0xcd5f('0x12')]);_0x95b8bb[_0xcd5f('0x13')]();})['catch'](function(_0x2ff7e1){logger[_0xcd5f('0x14')](_0xcd5f('0x11'),_0x3eeb6b,JSON[_0xcd5f('0x15')](_0x2ff7e1));_0x95b8bb[_0xcd5f('0x16')]();});}}catch(_0xb4503d){logger[_0xcd5f('0x14')]('[%s][MESSAGE]\x20%s',_0x3eeb6b,JSON[_0xcd5f('0x15')](_0xb4503d));_0x95b8bb[_0xcd5f('0x16')]();}};}; \ 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 0baaae8..6998b9c 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 _0xd5a5=['[%s][NOOP]\x20%s','next','stringify','stop','../../../../config/logger','routing','info'];(function(_0x3aa5cf,_0x4879b3){var _0x22854a=function(_0x3e8a49){while(--_0x3e8a49){_0x3aa5cf['push'](_0x3aa5cf['shift']());}};_0x22854a(++_0x4879b3);}(_0xd5a5,0x1d9));var _0x5d5a=function(_0x3abde4,_0x51963f){_0x3abde4=_0x3abde4-0x0;var _0x978153=_0xd5a5[_0x3abde4];return _0x978153;};'use strict';var utils=require('./utils');var logger=require(_0x5d5a('0x0'))(_0x5d5a('0x1'));exports['consequence']=function(_0x46f54c,_0x377cfc){return function(_0x75afd9){try{logger[_0x5d5a('0x2')](_0x5d5a('0x3'),_0x46f54c,utils['getMustacheRender'](_0x377cfc[0x0],this));_0x75afd9[_0x5d5a('0x4')]();}catch(_0x1dfe74){logger['error']('[%s][NOOP]\x20%s',_0x46f54c,JSON[_0x5d5a('0x5')](_0x1dfe74));_0x75afd9[_0x5d5a('0x6')]();}};}; \ No newline at end of file +var _0x95ef=['[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','./utils','../../../../config/logger','consequence','info'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x95ef,0x11c));var _0xf95e=function(_0x1a0e65,_0x13297e){_0x1a0e65=_0x1a0e65-0x0;var _0x474167=_0x95ef[_0x1a0e65];return _0x474167;};'use strict';var utils=require(_0xf95e('0x0'));var logger=require(_0xf95e('0x1'))('routing');exports[_0xf95e('0x2')]=function(_0x29331c,_0x1d0228){return function(_0x5447a4){try{logger[_0xf95e('0x3')](_0xf95e('0x4'),_0x29331c,utils[_0xf95e('0x5')](_0x1d0228[0x0],this));_0x5447a4['next']();}catch(_0x1ae37f){logger['error'](_0xf95e('0x4'),_0x29331c,JSON[_0xf95e('0x6')](_0x1ae37f));_0x5447a4[_0xf95e('0x7')]();}};}; \ 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 2a0513a..c503f35 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 _0xdd1a=['create\x20queue\x20report','accepted','info','catch','update\x20queue\x20report','timeout','toLowerCase','consequence','length','join','stop','find','Queues','createQueue','atimeout','qtimeout','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','capitalize','InteractionId','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','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','upperFirst','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd1a,0x1a0));var _0xadd1=function(_0x5efb3a,_0xbc0b27){_0x5efb3a=_0x5efb3a-0x0;var _0x2fabd9=_0xdd1a[_0x5efb3a];return _0x2fabd9;};'use strict';var schema=require(_0xadd1('0x0'));var _=require(_0xadd1('0x1'));var util=require(_0xadd1('0x2'));var seqqueue=require(_0xadd1('0x3'));var moment=require(_0xadd1('0x4'));var Redis=require(_0xadd1('0x5'));var config=require(_0xadd1('0x6'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xadd1('0x7'));config[_0xadd1('0x8')]=_['defaults'](config['redis'],{'host':_0xadd1('0x9'),'port':0x18eb});var io=require(_0xadd1('0xa'))(new Redis(config[_0xadd1('0x8')]));var attributes=['id','queue_id',_0xadd1('0xb'),_0xadd1('0xc'),_0xadd1('0xd'),_0xadd1('0xe')];function emit(_0x32a712,_0x1f33ce,_0x3d366f){io['to'](_0x32a712)[_0xadd1('0xf')](_0x1f33ce,_0x3d366f);}function emitChannelQueueInteraction(_0xfa37bd,_0x309c41,_0x551b8f,_0x38de18,_0x5d38e4,_0x513ac4,_0x459b36,_0x2bac33){var _0x2664ff=_[_0xadd1('0x10')](_0x551b8f);_0x2664ff[_0xadd1('0x11')]=_0x2bac33;_0x2664ff['queue']=_0x309c41;_0x2664ff['account']=_0x38de18;_0x2664ff['id']=_0x5d38e4;if(_0x513ac4){attributes['push'](_[_0xadd1('0x12')](_0xfa37bd)+_0xadd1('0x13'));_0x459b36[util['format'](_0xadd1('0x14'),_0xfa37bd)][_0x5d38e4]=_['pick'](_0x2664ff,attributes);}else{delete _0x459b36[util[_0xadd1('0x15')](_0xadd1('0x14'),_0xfa37bd)][_0x5d38e4];}emit(util['format'](_0xadd1('0x16'),_0xfa37bd,_0x309c41),util[_0xadd1('0x15')](_0xadd1('0x17'),_0xfa37bd,_0x513ac4?_0xadd1('0x18'):_0xadd1('0x19')),_[_0xadd1('0x1a')](_0x2664ff,attributes));}var rpc={'openchannelQueueReport':require(_0xadd1('0x1b')),'mailQueueReport':require(_0xadd1('0x1c')),'chatQueueReport':require(_0xadd1('0x1d')),'smsQueueReport':require(_0xadd1('0x1e')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xadd1('0x1f'))};var queue=schema({'name':{'type':_0xadd1('0x20'),'required':!![],'message':_0xadd1('0x21')},'timeout':{'type':_0xadd1('0x22'),'message':_0xadd1('0x23')}});function startRouting(_0x54fcff,_0x47f750,_0x53347a,_0x377fc0){if(_0x54fcff&&_0x47f750&&_0x53347a){_0x47f750[_0xadd1('0x24')]+=0x1;var _0x4b675c={'uniqueid':_0x54fcff,'from':_0x53347a['body']?_0x53347a[_0xadd1('0x25')][_0xadd1('0xd')]:'','joinAt':moment()['format'](_0xadd1('0x26')),'ContactId':_0x53347a['contact']?_0x53347a[_0xadd1('0x27')]['id']:null,'ListId':_0x53347a[_0xadd1('0x28')]?_0x53347a[_0xadd1('0x28')]['id']:null};_0x4b675c[_['upperFirst'](_0x53347a[_0xadd1('0x29')])+'QueueId']=_0x47f750['id']||null;_0x4b675c[_[_0xadd1('0x2a')](_0x53347a[_0xadd1('0x29')])+_0xadd1('0x13')]=_0x53347a[_0xadd1('0x2b')]?_0x53347a[_0xadd1('0x2b')]['id']:null;_0x4b675c[_[_0xadd1('0x2a')](_0x53347a[_0xadd1('0x29')])+'MessageId']=_0x53347a['message']?_0x53347a[_0xadd1('0x2c')]['id']:null;_0x4b675c[_[_0xadd1('0x2a')](_0x53347a[_0xadd1('0x29')])+(_0x53347a[_0xadd1('0x29')]!==_0xadd1('0x2d')?_0xadd1('0x2e'):_0xadd1('0x2f'))]=_0x53347a['account']?_0x53347a[_0xadd1('0xb')]['id']:null;logger['info'](util[_0xadd1('0x15')](_0xadd1('0x30'),_0x54fcff,_0x47f750['name']));emitChannelQueueInteraction(_0x53347a[_0xadd1('0x29')],_0x47f750[_0xadd1('0x31')],_0x4b675c,_0x53347a[_0xadd1('0xb')][_0xadd1('0x31')],_0x53347a[_0xadd1('0x2c')]['id'],!![],_0x377fc0,_0x47f750['id']);if(rpc[_0x53347a[_0xadd1('0x29')]+_0xadd1('0x32')]){return rpc[_0x53347a[_0xadd1('0x29')]+_0xadd1('0x32')]['create'](_0x4b675c)['catch'](function(_0x5dcb8b){logger[_0xadd1('0x33')](_0xadd1('0x34'));});}}}function stopRouting(_0x4449c6,_0x2f36f5,_0x4c8c92,_0xc99ea6){if(_0x4449c6&&_0x2f36f5){_0x2f36f5[_0xadd1('0x24')]-=0x1;var _0x5c1ece={'leaveAt':moment()[_0xadd1('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xadd1('0x26')),'reason':_0xadd1('0x35')};logger[_0xadd1('0x36')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4449c6,_0x2f36f5['name']));emitChannelQueueInteraction(_0x4c8c92[_0xadd1('0x29')],_0x2f36f5['name'],_0x4c8c92[_0xadd1('0x25')],_0x4c8c92[_0xadd1('0xb')][_0xadd1('0x31')],_0x4c8c92[_0xadd1('0x2c')]['id'],![],_0xc99ea6,_0x2f36f5['id']);if(rpc[_0x4c8c92[_0xadd1('0x29')]+_0xadd1('0x32')]){return rpc[_0x4c8c92[_0xadd1('0x29')]+'QueueReport']['update'](_0x4449c6,_0x5c1ece)[_0xadd1('0x37')](function(_0x195e36){logger[_0xadd1('0x33')](_0xadd1('0x38'));});}}}function endRouting(_0x53fd24,_0x2d3853,_0x4a7a39,_0x212408){if(_0x53fd24&&_0x2d3853){_0x2d3853['waiting']-=0x1;var _0x477657={'leaveAt':moment()[_0xadd1('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xadd1('0x26')),'reason':_0xadd1('0x39')};logger[_0xadd1('0x36')](util[_0xadd1('0x15')]('[%s][END:QUEUE][NAME:%s]',_0x53fd24,_0x2d3853[_0xadd1('0x31')]));emitChannelQueueInteraction(_0x4a7a39[_0xadd1('0x29')],_0x2d3853[_0xadd1('0x31')],_0x4a7a39['body'],_0x4a7a39['account']['name'],_0x4a7a39[_0xadd1('0x2c')]['id'],![],_0x212408);if(rpc[_0x4a7a39['channel']+_0xadd1('0x32')]){return rpc[_0x4a7a39[_0xadd1('0x29')]+_0xadd1('0x32')]['update'](_0x53fd24,_0x477657)['catch'](function(_0x2be151){logger[_0xadd1('0x33')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4da302){return function(_0xa8210f){return _0xa8210f[_0xadd1('0x31')][_0xadd1('0x3a')]()===_0x4da302['toLowerCase']();};}exports[_0xadd1('0x3b')]=function(_0x187ffa,_0x1c139a,_0x35b556,_0x11f354){return function(_0x58a9d5){try{var _0xa7624d={'name':_0x1c139a[0x0],'timeout':_0x1c139a[0x1]};var _0x68e528=queue[_0xadd1('0x0')](_0xa7624d,{'typecast':!![]});if(_0x68e528[_0xadd1('0x3c')]){logger[_0xadd1('0x33')]('[%s][QUEUE]\x20%s',_0x187ffa,_['map'](_0x68e528,'message')[_0xadd1('0x3d')](',\x20'));_0x58a9d5[_0xadd1('0x3e')]();}else{var _0x400bc7=_[_0xadd1('0x3f')](_0x35b556[_0x11f354[_0xadd1('0x29')]+_0xadd1('0x40')],handleFindQueue(_0xa7624d[_0xadd1('0x31')]));if(_0x400bc7){startRouting(_0x187ffa,_0x400bc7,_0x11f354,_0x35b556);var _0x44bb72=(_0x400bc7[_0xadd1('0x39')]||0xa)*0x3e8;var _0x318f49=(_0xa7624d[_0xadd1('0x39')]||0x14)*0x3e8;var _0x277757;if(_0x44bb72>_0x318f49){_0x318f49=_0x44bb72;}var _0x2acce0=seqqueue[_0xadd1('0x41')](_0x44bb72);_0x2acce0['id']=_0x187ffa;_0x2acce0[_0xadd1('0x42')]=_0x44bb72;_0x2acce0[_0xadd1('0x43')]=_0x318f49;_0x2acce0[_0xadd1('0x29')]=_0x11f354['channel'];_0x35b556['rules'][_0x187ffa]['on']('end',function(){logger[_0xadd1('0x36')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x187ffa);stopRouting(_0x187ffa,_0x400bc7,_0x11f354,_0x35b556);clearTimeout(_0x277757);_0x277757=undefined;_0x2acce0[_0xadd1('0x44')](!![]);if(_0x35b556[_0xadd1('0x45')][_0x187ffa]){delete _0x35b556['rules'][_0x187ffa];}_0x58a9d5['stop']();});_0x35b556[_0xadd1('0x45')][_0x187ffa]['on'](_0xadd1('0x46'),function(){if(_0x35b556['rules'][_0x187ffa]){delete _0x35b556[_0xadd1('0x45')][_0x187ffa];}});_0x277757=setTimeout(function(){logger[_0xadd1('0x36')](_0xadd1('0x47'),_0x187ffa);endRouting(_0x187ffa,_0x400bc7,_0x11f354,_0x35b556);clearTimeout(_0x277757);_0x2acce0[_0xadd1('0x44')](!![]);_0x58a9d5[_0xadd1('0x48')]();},_0x318f49);switch(_0x400bc7[_0xadd1('0x49')]){case _0xadd1('0x4a'):strategy[_0xadd1('0x4a')](_0x2acce0,_0x400bc7,_0x35b556,_0x11f354);break;default:strategy[_0xadd1('0x4b')](_0x2acce0,_0x400bc7,_0x35b556,_0x11f354);}}else{logger[_0xadd1('0x33')](_0xadd1('0x4c'),_0x187ffa,_0xa7624d[_0xadd1('0x31')]);_0x58a9d5[_0xadd1('0x3e')]();}}}catch(_0x18ee5f){console['log'](_0x18ee5f);logger[_0xadd1('0x33')](_0xadd1('0x4d'),_0x187ffa,_0x18ee5f['stack']);_0x58a9d5[_0xadd1('0x3e')]();}};}; \ No newline at end of file +var _0x2789=['../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','from','emit','clone','queue_id','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','interaction','message','chat','info','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment'];(function(_0x4ca866,_0x4c6c5d){var _0x35e05b=function(_0x4f1207){while(--_0x4f1207){_0x4ca866['push'](_0x4ca866['shift']());}};_0x35e05b(++_0x4c6c5d);}(_0x2789,0x1aa));var _0x9278=function(_0xeb6b0a,_0x178bd2){_0xeb6b0a=_0xeb6b0a-0x0;var _0x4d38f0=_0x2789[_0xeb6b0a];return _0x4d38f0;};'use strict';var schema=require(_0x9278('0x0'));var _=require(_0x9278('0x1'));var util=require(_0x9278('0x2'));var seqqueue=require(_0x9278('0x3'));var moment=require('moment');var Redis=require(_0x9278('0x4'));var config=require(_0x9278('0x5'));var logger=require(_0x9278('0x6'))(_0x9278('0x7'));var strategy=require(_0x9278('0x8'));config['redis']=_['defaults'](config[_0x9278('0x9')],{'host':_0x9278('0xa'),'port':0x18eb});var io=require(_0x9278('0xb'))(new Redis(config[_0x9278('0x9')]));var attributes=['id','queue_id',_0x9278('0xc'),'queue',_0x9278('0xd'),'joinAt'];function emit(_0x6e89a5,_0x4adeaf,_0x3f8a37){io['to'](_0x6e89a5)[_0x9278('0xe')](_0x4adeaf,_0x3f8a37);}function emitChannelQueueInteraction(_0x37fb51,_0x9e3eaa,_0x35204e,_0x9c3de4,_0x3f34e0,_0x59fe97,_0x120b12,_0x495c70){var _0x57a7ff=_[_0x9278('0xf')](_0x35204e);_0x57a7ff[_0x9278('0x10')]=_0x495c70;_0x57a7ff['queue']=_0x9e3eaa;_0x57a7ff[_0x9278('0xc')]=_0x9c3de4;_0x57a7ff['id']=_0x3f34e0;if(_0x59fe97){attributes[_0x9278('0x11')](_[_0x9278('0x12')](_0x37fb51)+_0x9278('0x13'));_0x120b12[util[_0x9278('0x14')]('%sQueuesWaitingInteractions',_0x37fb51)][_0x3f34e0]=_[_0x9278('0x15')](_0x57a7ff,attributes);}else{delete _0x120b12[util[_0x9278('0x14')](_0x9278('0x16'),_0x37fb51)][_0x3f34e0];}emit(util[_0x9278('0x14')]('%s:queue:%s',_0x37fb51,_0x9e3eaa),util[_0x9278('0x14')]('%s_queue_waiting_interaction:%s',_0x37fb51,_0x59fe97?'save':_0x9278('0x17')),_[_0x9278('0x15')](_0x57a7ff,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x9278('0x18')),'chatQueueReport':require(_0x9278('0x19')),'smsQueueReport':require(_0x9278('0x1a')),'faxQueueReport':require(_0x9278('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9278('0x1c')},'timeout':{'type':_0x9278('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x585533,_0x10b02c,_0x44735b,_0x526501){if(_0x585533&&_0x10b02c&&_0x44735b){_0x10b02c[_0x9278('0x1e')]+=0x1;var _0xf36172={'uniqueid':_0x585533,'from':_0x44735b['body']?_0x44735b[_0x9278('0x1f')]['from']:'','joinAt':moment()['format'](_0x9278('0x20')),'ContactId':_0x44735b['contact']?_0x44735b[_0x9278('0x21')]['id']:null,'ListId':_0x44735b['list']?_0x44735b[_0x9278('0x22')]['id']:null};_0xf36172[_[_0x9278('0x23')](_0x44735b['channel'])+_0x9278('0x24')]=_0x10b02c['id']||null;_0xf36172[_[_0x9278('0x23')](_0x44735b[_0x9278('0x25')])+_0x9278('0x13')]=_0x44735b[_0x9278('0x26')]?_0x44735b[_0x9278('0x26')]['id']:null;_0xf36172[_['upperFirst'](_0x44735b[_0x9278('0x25')])+'MessageId']=_0x44735b[_0x9278('0x27')]?_0x44735b[_0x9278('0x27')]['id']:null;_0xf36172[_[_0x9278('0x23')](_0x44735b['channel'])+(_0x44735b[_0x9278('0x25')]!==_0x9278('0x28')?'AccountId':'WebsiteId')]=_0x44735b[_0x9278('0xc')]?_0x44735b[_0x9278('0xc')]['id']:null;logger[_0x9278('0x29')](util[_0x9278('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x585533,_0x10b02c['name']));emitChannelQueueInteraction(_0x44735b[_0x9278('0x25')],_0x10b02c[_0x9278('0x2a')],_0xf36172,_0x44735b[_0x9278('0xc')][_0x9278('0x2a')],_0x44735b[_0x9278('0x27')]['id'],!![],_0x526501,_0x10b02c['id']);if(rpc[_0x44735b[_0x9278('0x25')]+_0x9278('0x2b')]){return rpc[_0x44735b['channel']+_0x9278('0x2b')][_0x9278('0x2c')](_0xf36172)['catch'](function(_0x471f27){logger[_0x9278('0x2d')](_0x9278('0x2e'));});}}}function stopRouting(_0x43ca87,_0x5e3e03,_0x398a95,_0x2027bc){if(_0x43ca87&&_0x5e3e03){_0x5e3e03['waiting']-=0x1;var _0x1da2c0={'leaveAt':moment()['format'](_0x9278('0x20')),'acceptAt':moment()[_0x9278('0x14')](_0x9278('0x20')),'reason':_0x9278('0x2f')};logger[_0x9278('0x29')](util[_0x9278('0x14')](_0x9278('0x30'),_0x43ca87,_0x5e3e03['name']));emitChannelQueueInteraction(_0x398a95[_0x9278('0x25')],_0x5e3e03[_0x9278('0x2a')],_0x398a95['body'],_0x398a95[_0x9278('0xc')][_0x9278('0x2a')],_0x398a95['message']['id'],![],_0x2027bc,_0x5e3e03['id']);if(rpc[_0x398a95[_0x9278('0x25')]+'QueueReport']){return rpc[_0x398a95[_0x9278('0x25')]+_0x9278('0x2b')][_0x9278('0x31')](_0x43ca87,_0x1da2c0)[_0x9278('0x32')](function(_0x33a3ad){logger[_0x9278('0x2d')](_0x9278('0x33'));});}}}function endRouting(_0x3eeecd,_0x51d793,_0x301a62,_0x342589){if(_0x3eeecd&&_0x51d793){_0x51d793[_0x9278('0x1e')]-=0x1;var _0x663d2b={'leaveAt':moment()[_0x9278('0x14')](_0x9278('0x20')),'exitAt':moment()[_0x9278('0x14')](_0x9278('0x20')),'reason':_0x9278('0x34')};logger['info'](util['format'](_0x9278('0x35'),_0x3eeecd,_0x51d793['name']));emitChannelQueueInteraction(_0x301a62['channel'],_0x51d793[_0x9278('0x2a')],_0x301a62[_0x9278('0x1f')],_0x301a62[_0x9278('0xc')][_0x9278('0x2a')],_0x301a62[_0x9278('0x27')]['id'],![],_0x342589);if(rpc[_0x301a62['channel']+'QueueReport']){return rpc[_0x301a62[_0x9278('0x25')]+_0x9278('0x2b')]['update'](_0x3eeecd,_0x663d2b)[_0x9278('0x32')](function(_0x58a694){logger[_0x9278('0x2d')](_0x9278('0x33'));});}}}function handleFindQueue(_0x3bf8b4){return function(_0x31acf2){return _0x31acf2[_0x9278('0x2a')][_0x9278('0x36')]()===_0x3bf8b4['toLowerCase']();};}exports[_0x9278('0x37')]=function(_0x3c2a67,_0x1e7581,_0x2f357e,_0x2617f8){return function(_0x10fc75){try{var _0x59145c={'name':_0x1e7581[0x0],'timeout':_0x1e7581[0x1]};var _0x2b7fa3=queue[_0x9278('0x0')](_0x59145c,{'typecast':!![]});if(_0x2b7fa3['length']){logger[_0x9278('0x2d')](_0x9278('0x38'),_0x3c2a67,_[_0x9278('0x39')](_0x2b7fa3,_0x9278('0x27'))['join'](',\x20'));_0x10fc75['stop']();}else{var _0x4c425f=_[_0x9278('0x3a')](_0x2f357e[_0x2617f8[_0x9278('0x25')]+_0x9278('0x3b')],handleFindQueue(_0x59145c[_0x9278('0x2a')]));if(_0x4c425f){startRouting(_0x3c2a67,_0x4c425f,_0x2617f8,_0x2f357e);var _0x498127=(_0x4c425f[_0x9278('0x34')]||0xa)*0x3e8;var _0x8b19a1=(_0x59145c[_0x9278('0x34')]||0x14)*0x3e8;var _0x2c8d7d;if(_0x498127>_0x8b19a1){_0x8b19a1=_0x498127;}var _0x377bf3=seqqueue[_0x9278('0x3c')](_0x498127);_0x377bf3['id']=_0x3c2a67;_0x377bf3[_0x9278('0x3d')]=_0x498127;_0x377bf3[_0x9278('0x3e')]=_0x8b19a1;_0x377bf3['channel']=_0x2617f8[_0x9278('0x25')];_0x2f357e[_0x9278('0x3f')][_0x3c2a67]['on']('end',function(){logger[_0x9278('0x29')](_0x9278('0x40'),_0x3c2a67);stopRouting(_0x3c2a67,_0x4c425f,_0x2617f8,_0x2f357e);clearTimeout(_0x2c8d7d);_0x2c8d7d=undefined;_0x377bf3[_0x9278('0x41')](!![]);if(_0x2f357e[_0x9278('0x3f')][_0x3c2a67]){delete _0x2f357e[_0x9278('0x3f')][_0x3c2a67];}_0x10fc75['stop']();});_0x2f357e[_0x9278('0x3f')][_0x3c2a67]['on']('complete',function(){if(_0x2f357e[_0x9278('0x3f')][_0x3c2a67]){delete _0x2f357e[_0x9278('0x3f')][_0x3c2a67];}});_0x2c8d7d=setTimeout(function(){logger[_0x9278('0x29')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3c2a67);endRouting(_0x3c2a67,_0x4c425f,_0x2617f8,_0x2f357e);clearTimeout(_0x2c8d7d);_0x377bf3[_0x9278('0x41')](!![]);_0x10fc75['next']();},_0x8b19a1);switch(_0x4c425f[_0x9278('0x42')]){case _0x9278('0x43'):strategy[_0x9278('0x43')](_0x377bf3,_0x4c425f,_0x2f357e,_0x2617f8);break;default:strategy['beepall'](_0x377bf3,_0x4c425f,_0x2f357e,_0x2617f8);}}else{logger[_0x9278('0x2d')](_0x9278('0x44'),_0x3c2a67,_0x59145c['name']);_0x10fc75[_0x9278('0x45')]();}}}catch(_0x131881){console[_0x9278('0x46')](_0x131881);logger[_0x9278('0x2d')]('[%s][QUEUE]\x20%s',_0x3c2a67,_0x131881[_0x9278('0x47')]);_0x10fc75[_0x9278('0x45')]();}};}; \ 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 2fff8b3..b1188ee 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 _0x34e8=['busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x34e8,0x12c));var _0x834e=function(_0x588b36,_0x1f02a6){_0x588b36=_0x588b36-0x0;var _0x57dd9e=_0x34e8[_0x588b36];return _0x57dd9e;};'use strict';var _=require(_0x834e('0x0'));var uuid=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var logger=require(_0x834e('0x3'))('routing');var Agent=function(_0x832422,_0x21e2e0,_0x472111,_0x31bf20){this[_0x834e('0x4')]=uuid['v4']();this[_0x834e('0x5')]=_0x832422;this[_0x834e('0x6')]=_0x21e2e0;this['realtime']=_0x472111;this[_0x834e('0x7')]=_0x31bf20;this['squeue'][_0x834e('0x8')](this[_0x834e('0x9')][_0x834e('0xa')](this),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xc'),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xd'),this[_0x834e('0xe')][_0x834e('0xa')](this));};Agent[_0x834e('0xf')][_0x834e('0x8')]=function(){this[_0x834e('0x5')][_0x834e('0x8')](this['handleRun'][_0x834e('0xa')](this),this[_0x834e('0xb')]['bind'](this));};Agent[_0x834e('0xf')][_0x834e('0xe')]=function(){this[_0x834e('0xb')](!![]);};Agent[_0x834e('0xf')]['handleRun']=function(){logger[_0x834e('0x10')](_0x834e('0x11'),this['squeue']['id'],this[_0x834e('0x6')]['id']);if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']])){logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x834e('0x8')][_0x834e('0xa')](this),0x3e8);}else{if(this[_0x834e('0x7')][_0x834e('0x15')]||util[_0x834e('0x16')](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']],this[_0x834e('0x5')][_0x834e('0x17')],![])){this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=!![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util['saveWaitingNotification'](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue'][_0x834e('0x17')]);util[_0x834e('0x1a')](this['notificationId'],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']],null,this[_0x834e('0x7')]);util[_0x834e('0x1b')](this['squeue']['id'],this['realtime'][_0x834e('0x13')][this['agent']['id']],_0x834e('0x1c')+(this[_0x834e('0x7')][_0x834e('0x15')]?_0x834e('0x1d'):''));}else{logger[_0x834e('0x10')](_0x834e('0x1e'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x834e('0xf')][_0x834e('0xb')]=function(_0x106d6a){if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']])){return logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this[_0x834e('0x6')]['id']);}else{logger[_0x834e('0x10')](_0x834e('0x1f'),this['squeue']['id'],this[_0x834e('0x6')]['id']);util['hideNotification'](this[_0x834e('0x4')],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],null,this[_0x834e('0x7')]);this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util[_0x834e('0x20')](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue']['channel']);util['writeLog'](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],_0x106d6a?_0x834e('0x21'):_0x834e('0x22'));}if(!_0x106d6a){setTimeout(this['push'][_0x834e('0xa')](this),0x3e8);}};function agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed){return new Agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed);}module[_0x834e('0x23')]=agent; \ No newline at end of file +var _0x99e9=['prototype','handleRun','debug','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','notificationId','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','writeLog','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','squeue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained'];(function(_0x2e5f1c,_0x43c2c0){var _0x2f5624=function(_0x418e72){while(--_0x418e72){_0x2e5f1c['push'](_0x2e5f1c['shift']());}};_0x2f5624(++_0x43c2c0);}(_0x99e9,0xb4));var _0x999e=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x99e9[_0x27bcf5];return _0x4ce4cf;};'use strict';var _=require('lodash');var uuid=require(_0x999e('0x0'));var util=require(_0x999e('0x1'));var logger=require(_0x999e('0x2'))(_0x999e('0x3'));var Agent=function(_0x4aaeb4,_0x19a818,_0x2f803e,_0x3aac27){this['notificationId']=uuid['v4']();this[_0x999e('0x4')]=_0x4aaeb4;this['agent']=_0x19a818;this[_0x999e('0x5')]=_0x2f803e;this[_0x999e('0x3')]=_0x3aac27;this[_0x999e('0x4')][_0x999e('0x6')](this['handleRun'][_0x999e('0x7')](this),this[_0x999e('0x8')][_0x999e('0x7')](this));this[_0x999e('0x4')]['on'](_0x999e('0x9'),this[_0x999e('0x8')][_0x999e('0x7')](this));this[_0x999e('0x4')]['on'](_0x999e('0xa'),this[_0x999e('0xb')][_0x999e('0x7')](this));};Agent[_0x999e('0xc')][_0x999e('0x6')]=function(){this[_0x999e('0x4')][_0x999e('0x6')](this[_0x999e('0xd')][_0x999e('0x7')](this),this['handleTimeout'][_0x999e('0x7')](this));};Agent['prototype'][_0x999e('0xb')]=function(){this[_0x999e('0x8')](!![]);};Agent[_0x999e('0xc')]['handleRun']=function(){logger[_0x999e('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x999e('0x4')]['id'],this['agent']['id']);if(_['isNil'](this[_0x999e('0x5')][_0x999e('0xf')][this[_0x999e('0x10')]['id']])){logger[_0x999e('0xe')](_0x999e('0x11'),this[_0x999e('0x4')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x999e('0x3')][_0x999e('0x12')]||util[_0x999e('0x13')](this[_0x999e('0x4')]['id'],this[_0x999e('0x5')][_0x999e('0xf')][this['agent']['id']],this['squeue'][_0x999e('0x14')],![])){this[_0x999e('0x5')][_0x999e('0xf')][this['agent']['id']][_0x999e('0x15')]=!![];this[_0x999e('0x5')][_0x999e('0xf')][this[_0x999e('0x10')]['id']][_0x999e('0x16')]=undefined;util[_0x999e('0x17')](this[_0x999e('0x5')],this['routing'],this['agent'],this[_0x999e('0x4')][_0x999e('0x14')]);util['showNotification'](this[_0x999e('0x18')],this[_0x999e('0x4')]['id'],this[_0x999e('0x5')][_0x999e('0xf')][this[_0x999e('0x10')]['id']],null,this[_0x999e('0x3')]);util['writeLog'](this[_0x999e('0x4')]['id'],this[_0x999e('0x5')][_0x999e('0xf')][this[_0x999e('0x10')]['id']],_0x999e('0x19')+(this[_0x999e('0x3')][_0x999e('0x12')]?':FORCED':''));}else{logger[_0x999e('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x999e('0x10')]['id']);setTimeout(this[_0x999e('0x6')][_0x999e('0x7')](this),0x3e8);}}};Agent['prototype'][_0x999e('0x8')]=function(_0x28f7ba){if(_[_0x999e('0x1a')](this[_0x999e('0x5')][_0x999e('0xf')][this[_0x999e('0x10')]['id']])){return logger[_0x999e('0xe')](_0x999e('0x11'),this[_0x999e('0x4')]['id'],this[_0x999e('0x10')]['id']);}else{logger['debug'](_0x999e('0x1b'),this[_0x999e('0x4')]['id'],this[_0x999e('0x10')]['id']);util['hideNotification'](this[_0x999e('0x18')],this['squeue']['id'],this['realtime'][_0x999e('0xf')][this[_0x999e('0x10')]['id']],null,this['routing']);this['realtime'][_0x999e('0xf')][this[_0x999e('0x10')]['id']][_0x999e('0x15')]=![];this[_0x999e('0x5')]['agents'][this[_0x999e('0x10')]['id']][_0x999e('0x16')]=undefined;util[_0x999e('0x1c')](this[_0x999e('0x5')],this['routing'],this['agent'],this[_0x999e('0x4')]['channel']);util[_0x999e('0x1d')](this[_0x999e('0x4')]['id'],this[_0x999e('0x5')][_0x999e('0xf')][this['agent']['id']],_0x28f7ba?_0x999e('0x1e'):_0x999e('0x1f'));}if(!_0x28f7ba){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x327866,_0x4aa98c,_0xa0c150,_0x5dac45){return new Agent(_0x327866,_0x4aa98c,_0xa0c150,_0x5dac45);}module['exports']=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 5f13d52..1212510 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 _0x3337=['agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','name','saveWaitingNotification','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','realtime','bind','handleTimeout','drained','prototype','push','handleRun','handleDrained','queue','isNil','Agents','length'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x3337,0xfe));var _0x7333=function(_0x68fd48,_0x1e359f){_0x68fd48=_0x68fd48-0x0;var _0x4135c1=_0x3337[_0x68fd48];return _0x4135c1;};'use strict';var _=require(_0x7333('0x0'));var uuid=require(_0x7333('0x1'));var util=require(_0x7333('0x2'));var logger=require(_0x7333('0x3'))(_0x7333('0x4'));var Beepall=function(_0xad971,_0x16a9b9,_0x26f122,_0xd22718){this['notificationId']=uuid['v4']();this[_0x7333('0x5')]=_0xad971;this['queue']=_0x16a9b9;this[_0x7333('0x6')]=_0x26f122;this[_0x7333('0x4')]=_0xd22718;this[_0x7333('0x5')]['push'](this['handleRun'][_0x7333('0x7')](this),this['handleTimeout'][_0x7333('0x7')](this));this[_0x7333('0x5')]['on']('timeout',this[_0x7333('0x8')][_0x7333('0x7')](this));this['squeue']['on'](_0x7333('0x9'),this['handleDrained'][_0x7333('0x7')](this));};Beepall[_0x7333('0xa')][_0x7333('0xb')]=function(){this[_0x7333('0x5')][_0x7333('0xb')](this[_0x7333('0xc')][_0x7333('0x7')](this),this[_0x7333('0x8')][_0x7333('0x7')](this));};Beepall[_0x7333('0xa')][_0x7333('0xd')]=function(){this[_0x7333('0x8')](!![]);};Beepall[_0x7333('0xa')]['handleRun']=function(){var _0x1b1601=!![];if(!_['isNil'](this[_0x7333('0xe')])&&!_[_0x7333('0xf')](this['queue'][_0x7333('0x10')])&&this[_0x7333('0xe')]['Agents'][_0x7333('0x11')]>0x0){for(var _0xeee392=0x0,_0x2c7731;_0xeee3920x0){for(var _0x279f57=0x0,_0x40de0f;_0x279f570x0&&_0x3005d3[_0x3ec744+_0xaa29('0x21')]>=_0x3005d3[_0x3ec744+_0xaa29('0x20')]){writeLog(_0x3ad7c8,_0x3005d3,_0x3ec744[_0xaa29('0x22')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xaa29('0x23')]=function(_0x1fd6be,_0x2b3137,_0x53c642,_0x5101c2,_0x4808c3){return sendNotification(!![],_0x1fd6be,_0x2b3137,_0x53c642,_0x5101c2,_0x4808c3);};exports[_0xaa29('0x24')]=function(_0x28d935,_0x2458d4,_0xa6ceea,_0x326fc0,_0x4543ad){return sendNotification(![],_0x28d935,_0x2458d4,_0xa6ceea,_0x326fc0,_0x4543ad);};exports[_0xaa29('0x25')]=function(_0x6752e1,_0x1c9932,_0x592dc3){var _0x3a435e=_0x1c9932[_0xaa29('0x26')][_0xaa29('0x27')];if(!_0x3a435e&&_0x592dc3){_0x3a435e=_0x592dc3['id'];}var _0x1a0ff1=_[_0xaa29('0x28')](_0x6752e1[_0x1c9932[_0xaa29('0x29')]+_0xaa29('0x2a')],function(_0xd6d586){var _0x5a925a=_[_0xaa29('0x2b')](_0x1c9932[_0xaa29('0x29')])+_0xaa29('0x2c');return _0xd6d586[_0x5a925a]===_0x1c9932[_0xaa29('0x26')]['id'];});if(!_0x1a0ff1&&_0x3a435e){_0x1a0ff1=_[_0xaa29('0x28')](_0x6752e1[_0xaa29('0x2d')][_0x3a435e][_0x1c9932[_0xaa29('0x29')]+'WaitingInteractions'],function(_0x2d90bb){return _0x2d90bb['id']===_0x1c9932[_0xaa29('0x26')]['id'];});}return _0x1a0ff1;};exports['saveWaitingNotification']=function(_0x3be679,_0x56b154,_0x40bd56,_0x3e9e2a){_0x3be679[_0xaa29('0x2d')][_0x40bd56['id']][_0x3e9e2a+'WaitingInteractions'][_0x56b154['message']['id']]={'id':_0x56b154[_0xaa29('0x26')]['id']};};exports[_0xaa29('0x2e')]=function(_0x190193,_0x5a1560,_0x7bf8e0,_0x517f2a){delete _0x190193[_0xaa29('0x2d')][_0x7bf8e0['id']][_0x517f2a+_0xaa29('0x2f')][_0x5a1560[_0xaa29('0x30')]['id']];};exports[_0xaa29('0x31')]=writeLog; \ No newline at end of file +var _0xd85a=['redis','defaults','localhost','socket.io-emitter','format','user:%s','emit','user:save','\x20interaction','name','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','notification:%s','save','remove','debug','isAgentAvailable','busy','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','QueuesWaitingInteractions','capitalize','channel','InteractionId','some','agents','saveWaitingNotification','message','removeWaitingNotification','WaitingInteractions','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0xd85a,0x167));var _0xad85=function(_0x25997e,_0x3400f5){_0x25997e=_0x25997e-0x0;var _0x52742c=_0xd85a[_0x25997e];return _0x52742c;};'use strict';var _=require(_0xad85('0x0'));var util=require(_0xad85('0x1'));var utils=require('../utils');var Redis=require(_0xad85('0x2'));var config=require(_0xad85('0x3'));var logger=require(_0xad85('0x4'))('routing');config[_0xad85('0x5')]=_[_0xad85('0x6')](config[_0xad85('0x5')],{'host':_0xad85('0x7'),'port':0x18eb});var io=require(_0xad85('0x8'))(new Redis(config[_0xad85('0x5')]));function sendNotification(_0x2d4bc4,_0x4da406,_0x5c4fd3,_0x4559d0,_0x13a411,_0x23bffb){io['to'](util[_0xad85('0x9')](_0xad85('0xa'),_0x4559d0['name']))[_0xad85('0xb')](_0xad85('0xc'),_0x4559d0);var _0x3e5537=_0x23bffb||{};var _0x3a94f2=_0x5c4fd3['split']('.');var _0x2f016c={'uniqueid':_0x4da406,'channel':_0x3a94f2[0x0],'id':_0x3a94f2[0x1],'title':_0x3a94f2[0x0]+_0xad85('0xd'),'interactionId':_0x3a94f2[0x2],'queue':_0x13a411?_0x13a411[_0xad85('0xe')]:null,'sound':_0x3e5537[_0xad85('0xf')]['notificationSound'],'shake':_0x3e5537[_0xad85('0xf')][_0xad85('0x10')]};try{if(!_0x3e5537[_0xad85('0x11')]){_0x3e5537[_0xad85('0x11')]={};}if(_0x13a411){_0x3e5537[_0xad85('0x11')]['queue']=_0x13a411;}else if(_0x3e5537[_0xad85('0x11')][_0xad85('0x12')]){delete _0x3e5537[_0xad85('0x11')][_0xad85('0x12')];}_0x2f016c['msg']=utils[_0xad85('0x13')](_0x3e5537[_0xad85('0xf')][_0xad85('0x14')],_0x3e5537);}catch(_0x128567){_0x2f016c[_0xad85('0x15')]=_0xad85('0x16');logger['error'](util[_0xad85('0x9')]('[%s][QUEUE]\x20%s',_0x4da406,_0x128567['message']));}io['to'](util[_0xad85('0x9')]('user:%s',_0x4559d0[_0xad85('0xe')]))[_0xad85('0xb')](util[_0xad85('0x9')](_0xad85('0x17'),_0x2d4bc4?_0xad85('0x18'):_0xad85('0x19')),_0x2f016c);}function writeLog(_0x220d1e,_0x14997f,_0x12e1fc){return logger[_0xad85('0x1a')](util[_0xad85('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x220d1e,_0x14997f[_0xad85('0xe')],_0x12e1fc));}exports[_0xad85('0x1b')]=function(_0x1af4c0,_0x392b5c,_0x2e8b8f,_0x221941){if(_0x392b5c[_0xad85('0x1c')]){writeLog(_0x1af4c0,_0x392b5c,'BUSY');return![];}if(!_0x392b5c['online']){writeLog(_0x1af4c0,_0x392b5c,_0xad85('0x1d'));return![];}if(_0x392b5c[_0x2e8b8f+_0xad85('0x1e')]){writeLog(_0x1af4c0,_0x392b5c,_0xad85('0x1f'));return![];}if(_0x221941&&_0x392b5c['hasOwnProperty'](_0x2e8b8f+'Capacity')&&_0x392b5c[_0xad85('0x20')](_0x2e8b8f+_0xad85('0x21'))){if(_0x392b5c[_0x2e8b8f+'Capacity']>0x0&&_0x392b5c[_0x2e8b8f+_0xad85('0x21')]>=_0x392b5c[_0x2e8b8f+_0xad85('0x22')]){writeLog(_0x1af4c0,_0x392b5c,_0x2e8b8f[_0xad85('0x23')]()+_0xad85('0x24'));return![];}}return!![];};exports[_0xad85('0x25')]=function(_0x7e8590,_0x204999,_0x5628f1,_0x4d578f,_0x4bddb3){return sendNotification(!![],_0x7e8590,_0x204999,_0x5628f1,_0x4d578f,_0x4bddb3);};exports[_0xad85('0x26')]=function(_0x36e3ba,_0xd28f58,_0x331bbb,_0x1d3d3c,_0x22311b){return sendNotification(![],_0x36e3ba,_0xd28f58,_0x331bbb,_0x1d3d3c,_0x22311b);};exports[_0xad85('0x27')]=function(_0x1afa70,_0x1cf14d,_0x47d44b){var _0x37dccb=_0x1cf14d[_0xad85('0x28')][_0xad85('0x29')];if(!_0x37dccb&&_0x47d44b){_0x37dccb=_0x47d44b['id'];}var _0x101732=_['some'](_0x1afa70[_0x1cf14d['channel']+_0xad85('0x2a')],function(_0x6fe760){var _0x244c18=_[_0xad85('0x2b')](_0x1cf14d[_0xad85('0x2c')])+_0xad85('0x2d');return _0x6fe760[_0x244c18]===_0x1cf14d[_0xad85('0x28')]['id'];});if(!_0x101732&&_0x37dccb){_0x101732=_[_0xad85('0x2e')](_0x1afa70[_0xad85('0x2f')][_0x37dccb][_0x1cf14d[_0xad85('0x2c')]+'WaitingInteractions'],function(_0x16d0a5){return _0x16d0a5['id']===_0x1cf14d[_0xad85('0x28')]['id'];});}return _0x101732;};exports[_0xad85('0x30')]=function(_0x19d5d0,_0x364823,_0x1987f9,_0x4aef42){_0x19d5d0['agents'][_0x1987f9['id']][_0x4aef42+'WaitingInteractions'][_0x364823[_0xad85('0x31')]['id']]={'id':_0x364823[_0xad85('0x28')]['id']};};exports[_0xad85('0x32')]=function(_0x28c430,_0x32f686,_0x107495,_0x2273f7){delete _0x28c430[_0xad85('0x2f')][_0x107495['id']][_0x2273f7+_0xad85('0x33')][_0x32f686[_0xad85('0x31')]['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 dff8ddb..f8d9c10 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 _0x805f=['getMustacheRender','exec','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x805f,0x110));var _0xf805=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x805f[_0x21a9d9];return _0x46adce;};'use strict';var schema=require(_0xf805('0x0'));var sh=require(_0xf805('0x1'));var _=require(_0xf805('0x2'));var utils=require(_0xf805('0x3'));var logger=require(_0xf805('0x4'))('routing');var system=schema({'command':{'type':_0xf805('0x5'),'required':!![],'message':_0xf805('0x6')}});exports[_0xf805('0x7')]=function(_0x553a33,_0x66462d){return function(_0x231933){try{var _0x1e77a3={'command':_0x66462d[0x0]};var _0x162d99=system[_0xf805('0x0')](_0x1e77a3,{'typecast':!![]});if(_0x162d99[_0xf805('0x8')]){logger[_0xf805('0x9')](_0xf805('0xa'),_0x553a33,_['map'](_0x162d99,_0xf805('0xb'))[_0xf805('0xc')](',\x20'));logger[_0xf805('0xd')](_0xf805('0xe'),_0x553a33);_0x231933[_0xf805('0xf')]();}else{var _0x3e4766=this;var _0xb3a904=utils[_0xf805('0x10')](_0x66462d[0x0],this);logger[_0xf805('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x553a33,_0xb3a904);sh[_0xf805('0x11')](_[_0xf805('0x12')](_0xb3a904),function(_0xa593fe,_0x169702){logger[_0xf805('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x553a33,_0xa593fe);if(_0xa593fe==0x0){var _0x4aad97=_0x169702['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xf805('0x13')](_0x66462d[0x1])||_[_0xf805('0x14')](_0x66462d[0x1])){logger['info'](_0xf805('0x15'),_0x553a33);_0x3e4766[_0xf805('0x16')][_0x66462d[0x1]]=_0x4aad97;}else{logger[_0xf805('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x553a33,_0x66462d[0x1],_0x4aad97);_0x3e4766[_0xf805('0x16')][_0x66462d[0x1]]=_0x4aad97;}}_0x231933[_0xf805('0xf')]();});}}catch(_0x570e73){logger['error'](_0xf805('0xa'),_0x553a33,_['isObject'](_0x570e73)?JSON[_0xf805('0x17')](_0x570e73):_0x570e73);logger[_0xf805('0xd')](_0xf805('0xe'),_0x553a33);_0x231933[_0xf805('0xf')]();}};}; \ No newline at end of file +var _0x38c3=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty'];(function(_0x537f2c,_0x406994){var _0x10d6cf=function(_0x271d34){while(--_0x271d34){_0x537f2c['push'](_0x537f2c['shift']());}};_0x10d6cf(++_0x406994);}(_0x38c3,0x13d));var _0x338c=function(_0x216e72,_0x5cd161){_0x216e72=_0x216e72-0x0;var _0x2ff28d=_0x38c3[_0x216e72];return _0x2ff28d;};'use strict';var schema=require(_0x338c('0x0'));var sh=require(_0x338c('0x1'));var _=require('lodash');var utils=require(_0x338c('0x2'));var logger=require(_0x338c('0x3'))(_0x338c('0x4'));var system=schema({'command':{'type':_0x338c('0x5'),'required':!![],'message':_0x338c('0x6')}});exports[_0x338c('0x7')]=function(_0x4acb1a,_0x236c87){return function(_0x581e00){try{var _0x41c16d={'command':_0x236c87[0x0]};var _0x28eeb3=system['validate'](_0x41c16d,{'typecast':!![]});if(_0x28eeb3[_0x338c('0x8')]){logger[_0x338c('0x9')](_0x338c('0xa'),_0x4acb1a,_['map'](_0x28eeb3,_0x338c('0xb'))[_0x338c('0xc')](',\x20'));logger[_0x338c('0xd')](_0x338c('0xe'),_0x4acb1a);_0x581e00[_0x338c('0xf')]();}else{var _0x2861b0=this;var _0x12cebe=utils['getMustacheRender'](_0x236c87[0x0],this);logger[_0x338c('0xd')](_0x338c('0x10'),_0x4acb1a,_0x12cebe);sh['exec'](_[_0x338c('0x11')](_0x12cebe),function(_0x4d6cc7,_0x38ff0d){logger[_0x338c('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4acb1a,_0x4d6cc7);if(_0x4d6cc7==0x0){var _0x1734d4=_0x38ff0d[_0x338c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x338c('0x13')](_0x236c87[0x1])||_[_0x338c('0x14')](_0x236c87[0x1])){logger[_0x338c('0xd')](_0x338c('0x15'),_0x4acb1a);_0x2861b0[_0x338c('0x16')][_0x236c87[0x1]]=_0x1734d4;}else{logger[_0x338c('0xd')](_0x338c('0x17'),_0x4acb1a,_0x236c87[0x1],_0x1734d4);_0x2861b0[_0x338c('0x16')][_0x236c87[0x1]]=_0x1734d4;}}_0x581e00['next']();});}}catch(_0x5afbd4){logger[_0x338c('0x9')](_0x338c('0xa'),_0x4acb1a,_[_0x338c('0x18')](_0x5afbd4)?JSON[_0x338c('0x19')](_0x5afbd4):_0x5afbd4);logger['info'](_0x338c('0xe'),_0x4acb1a);_0x581e00[_0x338c('0xf')]();}};}; \ 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 daace4d..8391069 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 _0x330b=['channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','join','info','next'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x330b,0x177));var _0xb330=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x330b[_0x29b886];return _0x263ef9;};'use strict';var schema=require(_0xb330('0x0'));var _=require(_0xb330('0x1'));var rpc={'chatInteraction':require(_0xb330('0x2')),'openchannelInteraction':require(_0xb330('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb330('0x4')),'faxInteraction':require(_0xb330('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xb330('0x6'))(_0xb330('0x7'));var tag=schema({'tag':{'type':_0xb330('0x8'),'required':!![],'message':_0xb330('0x9')}});exports[_0xb330('0xa')]=function(_0x38081f,_0x4815a9,_0x37e543,_0x2037c8){return function(_0x381c99){try{var _0x752e09={'tag':_0x4815a9[0x0]};var _0x289eb2=tag['validate'](_0x752e09,{'typecast':!![]});if(_0x289eb2['length']){logger[_0xb330('0xb')]('[%s][TAG]\x20%s',_0x38081f,_[_0xb330('0xc')](_0x289eb2,_0xb330('0xd'))[_0xb330('0xe')](',\x20'));logger[_0xb330('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x38081f);_0x381c99[_0xb330('0x10')]();}else{var _0x101a48={'ids':[_0x4815a9[0x0]]};if(rpc[_0x2037c8[_0xb330('0x11')]+'Interaction']){rpc[_0x2037c8['channel']+_0xb330('0x12')]['addTags'](_0x2037c8[_0xb330('0x13')]['id'],_0x101a48)[_0xb330('0x14')](function(_0x5d6f18){logger[_0xb330('0xf')](_0xb330('0x15'),_0x38081f,_0x4815a9[0x1],_0x2037c8[_0xb330('0x11')],_0x2037c8[_0xb330('0x13')]['id']);})[_0xb330('0x16')](function(_0x4064c7){logger['error'](_0xb330('0x17'),_0x38081f,JSON[_0xb330('0x18')](_0x4064c7));logger[_0xb330('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x38081f);})[_0xb330('0x19')](function(){_0x381c99['next']();});}}}catch(_0x1e1067){logger[_0xb330('0xb')](_0xb330('0x17'),_0x38081f,_[_0xb330('0x1a')](_0x1e1067)?JSON[_0xb330('0x18')](_0x1e1067):_0x1e1067);logger['info'](_0xb330('0x1b'),_0x38081f);_0x381c99['next']();}};}; \ No newline at end of file +var _0x25ed=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','validate','length','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','isObject','next','lodash'];(function(_0x1e1a39,_0x3ea4b7){var _0x76f5bb=function(_0x1884c6){while(--_0x1884c6){_0x1e1a39['push'](_0x1e1a39['shift']());}};_0x76f5bb(++_0x3ea4b7);}(_0x25ed,0x1b7));var _0xd25e=function(_0x21f4b2,_0x4fffe5){_0x21f4b2=_0x21f4b2-0x0;var _0x1d8b06=_0x25ed[_0x21f4b2];return _0x1d8b06;};'use strict';var schema=require('validate');var _=require(_0xd25e('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd25e('0x1')),'smsInteraction':require(_0xd25e('0x2')),'mailInteraction':require(_0xd25e('0x3')),'faxInteraction':require(_0xd25e('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xd25e('0x5'));var tag=schema({'tag':{'type':_0xd25e('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x15e31c,_0x357c82,_0x2a4ee6,_0x5a1bae){return function(_0x67aec7){try{var _0x31343e={'tag':_0x357c82[0x0]};var _0x159c41=tag[_0xd25e('0x7')](_0x31343e,{'typecast':!![]});if(_0x159c41[_0xd25e('0x8')]){logger[_0xd25e('0x9')]('[%s][TAG]\x20%s',_0x15e31c,_[_0xd25e('0xa')](_0x159c41,_0xd25e('0xb'))[_0xd25e('0xc')](',\x20'));logger['info'](_0xd25e('0xd'),_0x15e31c);_0x67aec7['next']();}else{var _0x402327={'ids':[_0x357c82[0x0]]};if(rpc[_0x5a1bae[_0xd25e('0xe')]+_0xd25e('0xf')]){rpc[_0x5a1bae[_0xd25e('0xe')]+_0xd25e('0xf')]['addTags'](_0x5a1bae['interaction']['id'],_0x402327)['then'](function(_0x3693b1){logger[_0xd25e('0x10')](_0xd25e('0x11'),_0x15e31c,_0x357c82[0x1],_0x5a1bae[_0xd25e('0xe')],_0x5a1bae['interaction']['id']);})[_0xd25e('0x12')](function(_0x5b0fab){logger[_0xd25e('0x9')](_0xd25e('0x13'),_0x15e31c,JSON['stringify'](_0x5b0fab));logger['info'](_0xd25e('0xd'),_0x15e31c);})['finally'](function(){_0x67aec7['next']();});}}}catch(_0x28279d){logger['error'](_0xd25e('0x13'),_0x15e31c,_[_0xd25e('0x14')](_0x28279d)?JSON['stringify'](_0x28279d):_0x28279d);logger[_0xd25e('0x10')](_0xd25e('0xd'),_0x15e31c);_0x67aec7[_0xd25e('0x15')]();}};}; \ 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 3d0dff2..28cd832 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 _0xfad6=['&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','consequence','replace','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','params','utf8','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId='];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xfad6,0xb1));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var logger=require(_0x6fad('0x0'))(_0x6fad('0x1'));var _=require(_0x6fad('0x2'));var arr=[];exports[_0x6fad('0x3')]=function(_0x4a7806,_0x25953f){return function(_0x20b894){var _0x47e5cd=_0x25953f[0xa];var _0x54dbd1=_0x25953f[0xb];var _0x24571d=_0x25953f[0xc];var _0xc7d76d=_0x25953f[0xd];var _0x1d30cd=_0x25953f[0xe];var _0x27ce1c=_0x25953f[0xf][_0x6fad('0x4')](/\n/g,'\x20-\x20');var _0x5fc43f=_0x25953f[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x54dbd1)){arr[_0x6fad('0x5')](_0x54dbd1);var _0x441dc6=_0x25953f[0x3];var _0x2ca3cf=_0x25953f[0x4];var _0x1154d5=_0x25953f[0x1];var _0x58e47c=_0x25953f[0x0];var _0x45a045={};_0x45a045[_0x6fad('0x6')]=_0x25953f[0x8]+_0x6fad('0x7')+_0x24571d+'|'+_0x47e5cd+'|'+_0xc7d76d+'|'+_0x54dbd1+'|'+_0x1d30cd;_0x45a045[_0x6fad('0x8')]=_0x25953f[0x7]+_0x6fad('0x7')+_0x24571d+'|'+_0x47e5cd+'|'+_0xc7d76d+'|'+_0x54dbd1+'|'+_0x1d30cd+'|'+_0x27ce1c+'|'+_0x5fc43f;_0x45a045[_0x6fad('0x9')]=_0x25953f[0x9];var _0x915080={};_0x915080[_0x6fad('0xa')]='2.0';_0x915080[_0x6fad('0xb')]='login';var _0x1327bb=[];_0x1327bb['push'](_0x25953f[0x2]);_0x1327bb['push'](_0x25953f[0x5]);_0x1327bb['push'](_0x25953f[0x6]);_0x915080[_0x6fad('0xc')]=_0x1327bb;_0x915080['id']=0x1;var _0x4dc753=JSON['stringify'](_0x915080);var _0x16401d={'encoding':_0x6fad('0xd'),'method':_0x6fad('0xe'),'timeout':0x2710,'url':_0x441dc6,'headers':{'Content-Type':_0x6fad('0xf')},'body':_0x4dc753};return rp(_0x16401d)['then'](function(_0x402380){const _0x19f686=JSON[_0x6fad('0x10')](_0x402380);if(!_0x19f686[_0x6fad('0x11')][_0x6fad('0x12')]){throw new Error(_0x6fad('0x13'));}var _0x1b6c9c=_0x54dbd1;var _0x22cae7=_0x6fad('0x14')+_0x1154d5+_0x6fad('0x15')+_0x58e47c+_0x6fad('0x16')+_0x1b6c9c+_0x6fad('0x17')+JSON[_0x6fad('0x18')](_0x45a045);var _0x4f488e=_0x2ca3cf+'?'+_0x22cae7;return rp(_0x4f488e);})['then'](function(_0x56b1b6){logger[_0x6fad('0x19')](_0x6fad('0x1a'),_0x4a7806,_0x56b1b6);_0x20b894[_0x6fad('0x1b')]();})[_0x6fad('0x1c')](function(_0x24658a){logger[_0x6fad('0x1d')](_0x6fad('0x1e'),_0x4a7806,_[_0x6fad('0x1f')](_0x24658a)?JSON[_0x6fad('0x18')](_0x24658a):_0x24658a);_0x20b894[_0x6fad('0x1b')]();});}else{logger[_0x6fad('0x19')](_0x6fad('0x20'),_0x4a7806);_0x20b894['next']();}};}; \ No newline at end of file +var _0xaa74=['result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','stringify','POST','then','parse'];(function(_0x8fd7be,_0xcd1d8d){var _0xd527d7=function(_0x34a173){while(--_0x34a173){_0x8fd7be['push'](_0x8fd7be['shift']());}};_0xd527d7(++_0xcd1d8d);}(_0xaa74,0x1b4));var _0x4aa7=function(_0xdd6bfb,_0x367d57){_0xdd6bfb=_0xdd6bfb-0x0;var _0x1775f1=_0xaa74[_0xdd6bfb];return _0x1775f1;};'use strict';var rp=require('request-promise');var logger=require(_0x4aa7('0x0'))(_0x4aa7('0x1'));var _=require(_0x4aa7('0x2'));var arr=[];exports[_0x4aa7('0x3')]=function(_0xa47ad7,_0x42e8cc){return function(_0x566fc2){var _0xf11ea5=_0x42e8cc[0xa];var _0x4f2274=_0x42e8cc[0xb];var _0x706324=_0x42e8cc[0xc];var _0x32a14e=_0x42e8cc[0xd];var _0x1216ea=_0x42e8cc[0xe];var _0x133a23=_0x42e8cc[0xf][_0x4aa7('0x4')](/\n/g,_0x4aa7('0x5'));var _0x115eb9=_0x42e8cc[0x10][_0x4aa7('0x4')](/\n/g,'\x20');if(!arr[_0x4aa7('0x6')](_0x4f2274)){arr[_0x4aa7('0x7')](_0x4f2274);var _0x44a356=_0x42e8cc[0x3];var _0x16578f=_0x42e8cc[0x4];var _0x29e4eb=_0x42e8cc[0x1];var _0x164c84=_0x42e8cc[0x0];var _0x1ea2f8={};_0x1ea2f8[_0x4aa7('0x8')]=_0x42e8cc[0x8]+_0x4aa7('0x9')+_0x706324+'|'+_0xf11ea5+'|'+_0x32a14e+'|'+_0x4f2274+'|'+_0x1216ea;_0x1ea2f8[_0x4aa7('0xa')]=_0x42e8cc[0x7]+_0x4aa7('0x9')+_0x706324+'|'+_0xf11ea5+'|'+_0x32a14e+'|'+_0x4f2274+'|'+_0x1216ea+'|'+_0x133a23+'|'+_0x115eb9;_0x1ea2f8[_0x4aa7('0xb')]=_0x42e8cc[0x9];var _0xfb2781={};_0xfb2781[_0x4aa7('0xc')]='2.0';_0xfb2781[_0x4aa7('0xd')]=_0x4aa7('0xe');var _0x146f2b=[];_0x146f2b[_0x4aa7('0x7')](_0x42e8cc[0x2]);_0x146f2b[_0x4aa7('0x7')](_0x42e8cc[0x5]);_0x146f2b[_0x4aa7('0x7')](_0x42e8cc[0x6]);_0xfb2781['params']=_0x146f2b;_0xfb2781['id']=0x1;var _0x501df2=JSON[_0x4aa7('0xf')](_0xfb2781);var _0x1c5c5d={'encoding':'utf8','method':_0x4aa7('0x10'),'timeout':0x2710,'url':_0x44a356,'headers':{'Content-Type':'application/json-rpc'},'body':_0x501df2};return rp(_0x1c5c5d)[_0x4aa7('0x11')](function(_0x31f3e2){const _0x234a30=JSON[_0x4aa7('0x12')](_0x31f3e2);if(!_0x234a30[_0x4aa7('0x13')][_0x4aa7('0x14')]){throw new Error(_0x4aa7('0x15'));}var _0x92725c=_0x4f2274;var _0x398045=_0x4aa7('0x16')+_0x29e4eb+_0x4aa7('0x17')+_0x164c84+_0x4aa7('0x18')+_0x92725c+_0x4aa7('0x19')+JSON[_0x4aa7('0xf')](_0x1ea2f8);var _0x5e3e1d=_0x16578f+'?'+_0x398045;return rp(_0x5e3e1d);})[_0x4aa7('0x11')](function(_0x38e28c){logger[_0x4aa7('0x1a')](_0x4aa7('0x1b'),_0xa47ad7,_0x38e28c);_0x566fc2['stop']();})[_0x4aa7('0x1c')](function(_0xcb8a7){logger[_0x4aa7('0x1d')](_0x4aa7('0x1e'),_0xa47ad7,_[_0x4aa7('0x1f')](_0xcb8a7)?JSON[_0x4aa7('0xf')](_0xcb8a7):_0xcb8a7);_0x566fc2[_0x4aa7('0x20')]();});}else{logger[_0x4aa7('0x1a')](_0x4aa7('0x21'),_0xa47ad7);_0x566fc2[_0x4aa7('0x22')]();}};}; \ 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 19059f7..1bad0cf 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3789dc,_0x27bebd){var _0x286d5e=function(_0x59e6b6){while(--_0x59e6b6){_0x3789dc['push'](_0x3789dc['shift']());}};_0x286d5e(++_0x27bebd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x250cba,_0x32aaa0){var _0x2439bd=function(_0x4fd7f5){while(--_0x4fd7f5){_0x250cba['push'](_0x250cba['shift']());}};_0x2439bd(++_0x32aaa0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index f29b6ea..5a11f0e 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 _0x1174=['mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','stringify','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','rules','channel','message','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','interaction','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','loggedIn','paused','waiting'];(function(_0x2964bb,_0x2fc9ff){var _0x44b30d=function(_0x58ffce){while(--_0x58ffce){_0x2964bb['push'](_0x2964bb['shift']());}};_0x44b30d(++_0x2fc9ff);}(_0x1174,0x79));var _0x4117=function(_0x9e33cb,_0x9158a){_0x9e33cb=_0x9e33cb-0x0;var _0x5ab75a=_0x1174[_0x9e33cb];return _0x5ab75a;};'use strict';var _=require(_0x4117('0x0'));var util=require('util');var path=require(_0x4117('0x1'));var fs=require('fs');var jayson=require(_0x4117('0x2'));var BPromise=require(_0x4117('0x3'));var utils=require(_0x4117('0x4'));var sUtils=require(_0x4117('0x5'));var logger=require(_0x4117('0x6'))(_0x4117('0x7'));var rpc={'openchannelQueueReport':require(_0x4117('0x8')),'mailQueueReport':require(_0x4117('0x9')),'chatQueueReport':require(_0x4117('0xa')),'smsQueueReport':require(_0x4117('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x4117('0xc'));function getId(_0x1fb266,_0x8896a,_0x2af97e){return util[_0x4117('0xd')](_0x4117('0xe'),_0x1fb266,_0x8896a||0x0,_0x2af97e||0x0);}function getIntervals(_0x538a77,_0x4059ca){var _0x36d7de=[];if(!_['isNil'](_0x4059ca[_0x4117('0xf')])&&!_['isNil'](_0x538a77[_0x4059ca[_0x4117('0xf')]])&&!_[_0x4117('0x10')](_0x538a77[_0x4059ca[_0x4117('0xf')]]['Intervals'])){_0x36d7de=_[_0x4117('0x11')](_0x538a77[_0x4059ca[_0x4117('0xf')]][_0x4117('0x12')],_0x4117('0x13'));}else if(!_[_0x4117('0x10')](_0x4059ca[_0x4117('0x13')])){_0x36d7de=[_0x4059ca[_0x4117('0x13')]];}return _0x36d7de;}exports['listen']=function(_0x55c28b){_0x55c28b[_0x4117('0x14')]={};return new BPromise(function(_0x1a3ebf,_0x25f3ca){var _0x3b2899={'Start':function(_0x33d412){var _0xd4286a=this;return new Promise(function(_0xfd4ec7,_0x1a817d){if(_0x33d412){try{var _0x39ddeb=[];var _0x13025b=getId(_0x33d412[_0x4117('0x15')],_0x33d412['message']?_0x33d412[_0x4117('0x16')]['id']:0x0,_0x33d412['interaction']?_0x33d412['interaction']['id']:0x0);var _0x168455=sUtils[_0x4117('0x17')](_0x55c28b,_0x33d412);if(!_0x168455&&_0x33d412[_0x4117('0x18')]&&_[_0x4117('0x19')](_0x33d412[_0x4117('0x18')])&&_0x33d412[_0x4117('0x18')][_0x4117('0x1a')]){for(var _0x45249e=0x0;_0x45249e<_0x33d412[_0x4117('0x18')][_0x4117('0x1a')];_0x45249e+=0x1){var _0x2b057f=_0x33d412[_0x4117('0x18')][_0x45249e];if(fs[_0x4117('0x1b')](path[_0x4117('0x1c')](__dirname,_0x4117('0x18'),_0x2b057f[_0x4117('0x1d')]+'.js'))){var _0x22c9e1=[];switch(_0x2b057f[_0x4117('0x1d')][_0x4117('0x1e')]()){case _0x4117('0x1f'):var _0x22e04d=_0x2b057f[_0x4117('0x20')][_0x4117('0x21')](',');if(_0x33d412[_0x4117('0x15')]===_0x4117('0x22')){_0x22c9e1['push'](_0x22e04d[0x0]);_0x22c9e1['push'](_0x22e04d[0x1]);_0x22c9e1[_0x4117('0x23')](_0x22e04d[_0x4117('0x24')](0x2,_0x22e04d[_0x4117('0x1a')])['join'](','));}else{_0x22c9e1[_0x4117('0x23')](_0x22e04d[0x0]);_0x22c9e1[_0x4117('0x23')](_0x22e04d['slice'](0x1,_0x22e04d[_0x4117('0x1a')])['join'](','));}break;case _0x4117('0x25'):var _0x4264a3=_0x2b057f[_0x4117('0x20')][_0x4117('0x21')](',');_0x22c9e1[_0x4117('0x23')](_0x4264a3[0x0]);_0x22c9e1[_0x4117('0x23')](_0x4264a3[0x1]);_0x22c9e1['push'](_0x4264a3['slice'](0x2,_0x4264a3[_0x4117('0x1a')])[_0x4117('0x1c')](','));break;case'dialogflowv2':var _0x19d5c1=_0x2b057f[_0x4117('0x20')][_0x4117('0x21')](',');_0x22c9e1['push'](_0x19d5c1[0x0]);_0x22c9e1[_0x4117('0x23')](_0x19d5c1[0x1]);_0x22c9e1[_0x4117('0x23')](_0x19d5c1[0x2]);_0x22c9e1['push'](_0x19d5c1[0x3]);_0x22c9e1['push'](_0x19d5c1[_0x4117('0x24')](0x4,_0x19d5c1[_0x4117('0x1a')])[_0x4117('0x1c')](','));break;case _0x4117('0x26'):var _0x5b0d8f=_0x2b057f[_0x4117('0x20')]['split'](',');_0x22c9e1['push'](_0x5b0d8f[0x0]);_0x22c9e1[_0x4117('0x23')](_0x5b0d8f[0x1]);_0x22c9e1['push'](_0x5b0d8f[0x2]);_0x22c9e1[_0x4117('0x23')](_0x5b0d8f[0x3]);_0x22c9e1[_0x4117('0x23')](_0x5b0d8f[_0x4117('0x24')](0x4,_0x5b0d8f[_0x4117('0x1a')])[_0x4117('0x1c')](','));break;case'message':_0x22c9e1[_0x4117('0x23')](_0x2b057f['appdata']);break;case _0x4117('0x27'):_0x22c9e1[_0x4117('0x23')](_0x2b057f['TagId']);_0x22c9e1['push'](_0x2b057f[_0x4117('0x20')]);break;case _0x4117('0x28'):var _0x1cda1f=utils[_0x4117('0x29')](_0x33d412[_0x4117('0x2a')][_0x4117('0x2b')],_0x33d412);var _0x19399f=_0x2b057f[_0x4117('0x20')][_0x4117('0x21')](',');_0x22c9e1[_0x4117('0x23')](_0x19399f[0x0]);_0x22c9e1['push'](_0x19399f[0x1]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0x2]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0x3]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0x4]);_0x22c9e1['push'](_0x19399f[0x5]);_0x22c9e1['push'](_0x19399f[0x6]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0x7]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0x8]);_0x22c9e1['push'](_0x19399f[0x9]);_0x22c9e1[_0x4117('0x23')](_0x19399f[0xa]);_0x22c9e1[_0x4117('0x23')](_0x33d412[_0x4117('0x2c')]['id']);_0x22c9e1[_0x4117('0x23')](_0x33d412['message']['id']);_0x22c9e1[_0x4117('0x23')](_0x2b057f[_0x4117('0x2d')]);_0x22c9e1[_0x4117('0x23')](_0x33d412[_0x4117('0x2c')][_0x4117('0x2e')]);_0x22c9e1[_0x4117('0x23')](_0x33d412[_0x4117('0x2f')][_0x4117('0x2f')]);_0x22c9e1[_0x4117('0x23')](_0x1cda1f);break;default:_0x22c9e1=_[_0x4117('0x10')](_0x2b057f[_0x4117('0x20')])?[]:_0x2b057f['appdata']['split'](',');}var _0x13a7c5={'id':util[_0x4117('0xd')](_0x4117('0x30'),_0x13025b,_0x2b057f['id'],_0x2b057f[_0x4117('0x1d')]),'condition':require(_0x4117('0x31'))[_0x4117('0x32')](_0x13025b,getIntervals(_0x55c28b[_0x4117('0x33')],_0x2b057f),_0x55c28b),'consequence':require(_0x4117('0x34')+_0x2b057f['app'])['consequence'](_0x13025b,_0x22c9e1,_0x55c28b,_0x33d412),'p':_0x2b057f[_0x4117('0x35')]||0x0};logger[_0x4117('0x36')](_0x4117('0x37'),_0x13a7c5['id'],_0x4117('0x38'),getIntervals(_0x55c28b[_0x4117('0x33')],_0x2b057f)[_0x4117('0x1c')](_0x4117('0x39')));_0x39ddeb[_0x4117('0x23')](_0x13a7c5);}else{logger[_0x4117('0x3a')](_0x4117('0x3b'),path[_0x4117('0x1c')](__dirname,'applications',_0x2b057f['app']+'.js'));}}_0x55c28b[_0x4117('0x14')][_0x13025b]=new RuleEngine(_0x39ddeb);_0x55c28b[_0x4117('0x14')][_0x13025b][_0x4117('0x3c')](_0x33d412,function(_0x29f9b3){logger[_0x4117('0x36')](_0x4117('0x3d'),JSON['stringify'](_0x29f9b3[_0x4117('0x3e')]));if(_0x55c28b['rules'][_0x13025b]){_0x55c28b['rules'][_0x13025b]['emit'](_0x4117('0x3f'));}});return _0xfd4ec7({'code':0xc8,'message':_0x33d412});}else{if(_0x168455){logger[_0x4117('0x36')](util[_0x4117('0xd')](_0x4117('0x40'),_0x13025b));}else{logger[_0x4117('0x36')]('No\x20applications\x20to\x20execute');}return _0xfd4ec7({'code':0xc8,'message':_0x33d412});}}catch(_0x53e1e6){logger[_0x4117('0x3a')](_0x53e1e6[_0x4117('0x41')]);return _0x1a817d(_0xd4286a[_0x4117('0x3a')](0x1f4,_0x53e1e6));}}return _0x1a817d(_0x4117('0x42'));});},'AcceptMessage':function(_0x10c720){var _0x251853=this;return new Promise(function(_0x505223,_0x4e641f){if(_0x10c720[_0x4117('0x43')]&&_0x10c720[_0x4117('0x43')]['id']){if(_0x55c28b[_0x4117('0x44')][_0x10c720['agent']['id']]){_0x55c28b['agents'][_0x10c720[_0x4117('0x43')]['id']]['busy']=![];_0x55c28b[_0x4117('0x44')][_0x10c720['agent']['id']][_0x4117('0x45')]=undefined;}}if(_0x10c720[_0x4117('0x16')]&&_0x10c720[_0x4117('0x16')]['id']){try{var _0x49b357=getId(_0x10c720[_0x4117('0x15')],_0x10c720[_0x4117('0x16')]?_0x10c720[_0x4117('0x16')]['id']:0x0,_0x10c720[_0x4117('0x2c')]?_0x10c720[_0x4117('0x2c')]['id']:0x0);if(_0x55c28b['rules'][_0x49b357]){_0x55c28b[_0x4117('0x14')][_0x49b357]['emit'](_0x4117('0x46'));if(rpc[_0x10c720[_0x4117('0x15')]+_0x4117('0x47')]){rpc[_0x10c720[_0x4117('0x15')]+_0x4117('0x47')]['update'](_0x49b357,{'UserId':_0x10c720[_0x4117('0x16')]['UserId']})['catch'](function(){logger[_0x4117('0x3a')](_0x4117('0x48'));});}}return _0x505223({'code':0xc8,'message':_0x10c720});}catch(_0x409b6c){logger[_0x4117('0x3a')](_0x409b6c['stack']);return _0x4e641f(_0x251853[_0x4117('0x3a')](0x1f4,_0x409b6c));}}logger[_0x4117('0x3a')](_0x4117('0x49'));return _0x4e641f(_0x251853['error'](0x1f4,_0x4117('0x49')));});},'RejectMessage':function(_0x452c2c){var _0x129c40=this;return new Promise(function(_0x2cbb3d,_0x14a0ad){if(_0x452c2c['agent']&&_0x452c2c[_0x4117('0x43')]['id']){try{if(_0x55c28b['agents'][_0x452c2c[_0x4117('0x43')]['id']]){_0x55c28b[_0x4117('0x44')][_0x452c2c['agent']['id']][_0x4117('0x4a')]=![];_0x55c28b[_0x4117('0x44')][_0x452c2c[_0x4117('0x43')]['id']]['busyQueue']=undefined;}return _0x2cbb3d({'code':0xc8,'message':_0x452c2c});}catch(_0x314f70){logger[_0x4117('0x3a')](_0x314f70[_0x4117('0x41')]);return _0x14a0ad(_0x129c40['error'](0x1f4,_0x314f70));}}logger[_0x4117('0x3a')](_0x4117('0x49'));return _0x14a0ad(_0x129c40[_0x4117('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x20fb7b){var _0x4ea035=this;return new Promise(function(_0x182d51,_0x5f2d5b){if(_0x20fb7b[_0x4117('0x15')]&&_0x20fb7b[_0x4117('0x2c')]&&_0x20fb7b['interaction']['id']){try{var _0x507a72=getId(_0x20fb7b[_0x4117('0x15')],_0x20fb7b[_0x4117('0x16')]?_0x20fb7b[_0x4117('0x16')]['id']:0x0,_0x20fb7b['interaction']?_0x20fb7b[_0x4117('0x2c')]['id']:0x0);if(_0x55c28b[_0x4117('0x14')][_0x507a72]){_0x55c28b[_0x4117('0x14')][_0x507a72][_0x4117('0x4b')](_0x4117('0x46'));}return _0x182d51({'code':0xc8,'message':_0x20fb7b});}catch(_0x131088){logger[_0x4117('0x3a')](_0x131088[_0x4117('0x41')]);return _0x5f2d5b(_0x4ea035[_0x4117('0x3a')](0x1f4,_0x131088));}}logger[_0x4117('0x3a')](_0x4117('0x49'));return _0x5f2d5b(_0x4ea035['error'](0x1f4,_0x4117('0x49')));});},'AgentCapacity':function(_0x11214){var _0x5741ac=this;return new Promise(function(_0x1ba6de,_0x5eb855){if(_0x55c28b[_0x4117('0x44')][_0x4117('0x4c')](_0x11214['id'])){for(var _0x43d5aa in _0x11214['capacity']){if(_0x11214[_0x4117('0x4d')][_0x4117('0x4c')](_0x43d5aa)){if(_0x55c28b[_0x4117('0x44')][_0x11214['id']][_0x4117('0x4c')](_0x43d5aa+_0x4117('0x4e'))){_0x55c28b[_0x4117('0x44')][_0x11214['id']][_0x43d5aa+_0x4117('0x4e')]=parseInt(_0x11214[_0x4117('0x4d')][_0x43d5aa],0xa);}}}_0x55c28b['agents'][_0x11214['id']][_0x4117('0x4f')]();return _0x1ba6de({'code':0xc8,'message':_0x55c28b[_0x4117('0x44')][_0x11214['id']]});}else{return _0x5eb855(_0x5741ac[_0x4117('0x3a')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4ea724){return new Promise(function(_0x46fb10){var _0x51f0dd=_[_0x4117('0x50')](_0x55c28b['agents']);if(_0x4ea724&&_0x4ea724['id']){var _0x59cc24=_[_0x4117('0x51')](_0x51f0dd,function(_0x4d9b51){return _0x4d9b51['id']===_0x4ea724['id'];});_0x46fb10(_0x59cc24);}else{_0x46fb10({'count':_0x51f0dd[_0x4117('0x1a')],'rows':_0x51f0dd});}});},'ChatQueues':function(){return new Promise(function(_0x55f39d){var _0x50cc80=[];for(var _0x13a38b in _0x55c28b[_0x4117('0x52')]){if(_0x55c28b[_0x4117('0x52')][_0x4117('0x4c')](_0x13a38b)){var _0x44d118=_0x55c28b['chatQueues'][_0x13a38b];var _0x4ed570={'id':_0x44d118['id'],'available':_0x44d118[_0x4117('0x53')],'loggedIn':_0x44d118[_0x4117('0x54')],'name':_0x44d118['name'],'paused':_0x44d118[_0x4117('0x55')],'waiting':_0x44d118[_0x4117('0x56')]};_0x50cc80[_0x4117('0x23')](_0x4ed570);}}_0x55f39d({'count':_0x50cc80[_0x4117('0x1a')],'rows':_0x50cc80});});},'MailQueues':function(){return new Promise(function(_0x313e47){var _0x450ffd=[];for(var _0x59be9f in _0x55c28b[_0x4117('0x57')]){if(_0x55c28b[_0x4117('0x57')][_0x4117('0x4c')](_0x59be9f)){var _0x4a1f65=_0x55c28b[_0x4117('0x57')][_0x59be9f];var _0x42881f={'id':_0x4a1f65['id'],'available':_0x4a1f65[_0x4117('0x53')],'loggedIn':_0x4a1f65[_0x4117('0x54')],'name':_0x4a1f65[_0x4117('0x58')],'paused':_0x4a1f65['paused'],'waiting':_0x4a1f65[_0x4117('0x56')]};_0x450ffd[_0x4117('0x23')](_0x42881f);}}_0x313e47({'count':_0x450ffd[_0x4117('0x1a')],'rows':_0x450ffd});});},'OpenchannelQueues':function(){return new Promise(function(_0x8db167){var _0x5b1665=[];for(var _0x3c2cbf in _0x55c28b[_0x4117('0x59')]){if(_0x55c28b['openchannelQueues'][_0x4117('0x4c')](_0x3c2cbf)){var _0x12c208=_0x55c28b[_0x4117('0x59')][_0x3c2cbf];var _0x367d49={'id':_0x12c208['id'],'available':_0x12c208[_0x4117('0x53')],'loggedIn':_0x12c208[_0x4117('0x54')],'name':_0x12c208[_0x4117('0x58')],'paused':_0x12c208[_0x4117('0x55')],'waiting':_0x12c208[_0x4117('0x56')]};_0x5b1665[_0x4117('0x23')](_0x367d49);}}_0x8db167({'count':_0x5b1665[_0x4117('0x1a')],'rows':_0x5b1665});});},'SmsQueues':function(){return new Promise(function(_0x55e9f6){var _0x1ea3da=[];for(var _0x182a09 in _0x55c28b[_0x4117('0x5a')]){if(_0x55c28b[_0x4117('0x5a')]['hasOwnProperty'](_0x182a09)){var _0xd44dd0=_0x55c28b['smsQueues'][_0x182a09];var _0xd04bc9={'id':_0xd44dd0['id'],'available':_0xd44dd0[_0x4117('0x53')],'loggedIn':_0xd44dd0['loggedIn'],'name':_0xd44dd0[_0x4117('0x58')],'paused':_0xd44dd0[_0x4117('0x55')],'waiting':_0xd44dd0[_0x4117('0x56')]};_0x1ea3da[_0x4117('0x23')](_0xd04bc9);}}_0x55e9f6({'count':_0x1ea3da[_0x4117('0x1a')],'rows':_0x1ea3da});});},'FaxQueues':function(){return new Promise(function(_0x70b63d){var _0x1f037f=[];for(var _0xf1e75e in _0x55c28b['faxQueues']){if(_0x55c28b[_0x4117('0x5b')][_0x4117('0x4c')](_0xf1e75e)){var _0x13223c=_0x55c28b[_0x4117('0x5b')][_0xf1e75e];var _0x162252={'id':_0x13223c['id'],'available':_0x13223c['available'],'loggedIn':_0x13223c[_0x4117('0x54')],'name':_0x13223c['name'],'paused':_0x13223c[_0x4117('0x55')],'waiting':_0x13223c['waiting']};_0x1f037f[_0x4117('0x23')](_0x162252);}}_0x70b63d({'count':_0x1f037f[_0x4117('0x1a')],'rows':_0x1f037f});});},'WhatsappQueues':function(){return new Promise(function(_0x2b934f){var _0x44698f=[];for(var _0x547b07 in _0x55c28b[_0x4117('0x5c')]){if(_0x55c28b['whatsappQueues']['hasOwnProperty'](_0x547b07)){var _0x1d19c4=_0x55c28b[_0x4117('0x5c')][_0x547b07];var _0xeaaf8f={'id':_0x1d19c4['id'],'available':_0x1d19c4['available'],'loggedIn':_0x1d19c4[_0x4117('0x54')],'name':_0x1d19c4[_0x4117('0x58')],'paused':_0x1d19c4[_0x4117('0x55')],'waiting':_0x1d19c4['waiting']};_0x44698f['push'](_0xeaaf8f);}}_0x2b934f({'count':_0x44698f[_0x4117('0x1a')],'rows':_0x44698f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4e70e0){var _0x37a13=_[_0x4117('0x50')](_0x55c28b[_0x4117('0x5d')]);_0x4e70e0({'count':_0x37a13[_0x4117('0x1a')],'rows':_0x37a13});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4a97b2){var _0x13176b=_['values'](_0x55c28b[_0x4117('0x5e')]);_0x4a97b2({'count':_0x13176b[_0x4117('0x1a')],'rows':_0x13176b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x413d1b){var _0x574dd3=_[_0x4117('0x50')](_0x55c28b[_0x4117('0x5f')]);_0x413d1b({'count':_0x574dd3['length'],'rows':_0x574dd3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x58e838){var _0x3f48be=_[_0x4117('0x50')](_0x55c28b[_0x4117('0x60')]);_0x58e838({'count':_0x3f48be[_0x4117('0x1a')],'rows':_0x3f48be});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1dbf8d){var _0x44a216=_[_0x4117('0x50')](_0x55c28b['faxQueuesWaitingInteractions']);_0x1dbf8d({'count':_0x44a216['length'],'rows':_0x44a216});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x180659){var _0x41e8c9=_[_0x4117('0x50')](_0x55c28b['whatsappQueuesWaitingInteractions']);_0x180659({'count':_0x41e8c9['length'],'rows':_0x41e8c9});});}};var _0x3ea448=jayson[_0x4117('0x61')](_0x3b2899)[_0x4117('0x62')]();_0x3ea448['on'](_0x4117('0x3a'),function(_0x329807){logger['error'](JSON[_0x4117('0x63')](_0x329807));return _0x25f3ca(_0x329807);});_0x3ea448[_0x4117('0x64')](0x232c,_0x4117('0x65'),function(){console[_0x4117('0x66')](_0x4117('0x67'),0x232c);return _0x1a3ebf('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x4f2a=['Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agents','agent','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','name','waiting','mailQueues','available','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','./applications/strategy/util','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','.js','app','autoreply','appdata','channel','mail','push','slice','dialogflow','split','dialogflowv2','amazonlex','message','tag','TagId','tvox','getMustacheRender','notificationTemplate','./interval','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','info','stringify','matchPath','emit','complete','format'];(function(_0x49f9f2,_0x28bbc5){var _0x5449df=function(_0x40f88b){while(--_0x40f88b){_0x49f9f2['push'](_0x49f9f2['shift']());}};_0x5449df(++_0x28bbc5);}(_0x4f2a,0x152));var _0xa4f2=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x4f2a[_0x199b1f];return _0x267ac9;};'use strict';var _=require(_0xa4f2('0x0'));var util=require(_0xa4f2('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xa4f2('0x2'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0xa4f2('0x3'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0xa4f2('0x4')),'mailQueueReport':require(_0xa4f2('0x5')),'chatQueueReport':require(_0xa4f2('0x6')),'smsQueueReport':require(_0xa4f2('0x7')),'faxQueueReport':require(_0xa4f2('0x8')),'whatsappQueueReport':require(_0xa4f2('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x221d75,_0x5176ec,_0xc0db8f){return util['format'](_0xa4f2('0xa'),_0x221d75,_0x5176ec||0x0,_0xc0db8f||0x0);}function getIntervals(_0x2687ce,_0x34f810){var _0x4e2517=[];if(!_[_0xa4f2('0xb')](_0x34f810[_0xa4f2('0xc')])&&!_['isNil'](_0x2687ce[_0x34f810[_0xa4f2('0xc')]])&&!_[_0xa4f2('0xb')](_0x2687ce[_0x34f810[_0xa4f2('0xc')]][_0xa4f2('0xd')])){_0x4e2517=_[_0xa4f2('0xe')](_0x2687ce[_0x34f810[_0xa4f2('0xc')]][_0xa4f2('0xd')],_0xa4f2('0xf'));}else if(!_[_0xa4f2('0xb')](_0x34f810[_0xa4f2('0xf')])){_0x4e2517=[_0x34f810['interval']];}return _0x4e2517;}exports['listen']=function(_0x3e5216){_0x3e5216[_0xa4f2('0x10')]={};return new BPromise(function(_0x4910a2,_0x2c82a4){var _0x55b464={'Start':function(_0x11c228){var _0x3d47d8=this;return new Promise(function(_0xefa375,_0x4e1b4a){if(_0x11c228){try{var _0x7cd22d=[];var _0x5b0ee6=getId(_0x11c228['channel'],_0x11c228['message']?_0x11c228['message']['id']:0x0,_0x11c228['interaction']?_0x11c228[_0xa4f2('0x11')]['id']:0x0);var _0x32367e=sUtils[_0xa4f2('0x12')](_0x3e5216,_0x11c228);if(!_0x32367e&&_0x11c228[_0xa4f2('0x13')]&&_[_0xa4f2('0x14')](_0x11c228[_0xa4f2('0x13')])&&_0x11c228[_0xa4f2('0x13')][_0xa4f2('0x15')]){for(var _0x2b552d=0x0;_0x2b552d<_0x11c228['applications'][_0xa4f2('0x15')];_0x2b552d+=0x1){var _0xe17742=_0x11c228[_0xa4f2('0x13')][_0x2b552d];if(fs[_0xa4f2('0x16')](path[_0xa4f2('0x17')](__dirname,'applications',_0xe17742['app']+_0xa4f2('0x18')))){var _0x466af5=[];switch(_0xe17742[_0xa4f2('0x19')]['toLowerCase']()){case _0xa4f2('0x1a'):var _0xd9d12b=_0xe17742[_0xa4f2('0x1b')]['split'](',');if(_0x11c228[_0xa4f2('0x1c')]===_0xa4f2('0x1d')){_0x466af5[_0xa4f2('0x1e')](_0xd9d12b[0x0]);_0x466af5['push'](_0xd9d12b[0x1]);_0x466af5[_0xa4f2('0x1e')](_0xd9d12b[_0xa4f2('0x1f')](0x2,_0xd9d12b['length'])['join'](','));}else{_0x466af5[_0xa4f2('0x1e')](_0xd9d12b[0x0]);_0x466af5[_0xa4f2('0x1e')](_0xd9d12b[_0xa4f2('0x1f')](0x1,_0xd9d12b[_0xa4f2('0x15')])[_0xa4f2('0x17')](','));}break;case _0xa4f2('0x20'):var _0x56115c=_0xe17742[_0xa4f2('0x1b')][_0xa4f2('0x21')](',');_0x466af5[_0xa4f2('0x1e')](_0x56115c[0x0]);_0x466af5[_0xa4f2('0x1e')](_0x56115c[0x1]);_0x466af5[_0xa4f2('0x1e')](_0x56115c[_0xa4f2('0x1f')](0x2,_0x56115c['length'])[_0xa4f2('0x17')](','));break;case _0xa4f2('0x22'):var _0x541e4d=_0xe17742['appdata'][_0xa4f2('0x21')](',');_0x466af5[_0xa4f2('0x1e')](_0x541e4d[0x0]);_0x466af5[_0xa4f2('0x1e')](_0x541e4d[0x1]);_0x466af5['push'](_0x541e4d[0x2]);_0x466af5[_0xa4f2('0x1e')](_0x541e4d[0x3]);_0x466af5[_0xa4f2('0x1e')](_0x541e4d[_0xa4f2('0x1f')](0x4,_0x541e4d[_0xa4f2('0x15')])['join'](','));break;case _0xa4f2('0x23'):var _0x3b0804=_0xe17742[_0xa4f2('0x1b')][_0xa4f2('0x21')](',');_0x466af5['push'](_0x3b0804[0x0]);_0x466af5[_0xa4f2('0x1e')](_0x3b0804[0x1]);_0x466af5['push'](_0x3b0804[0x2]);_0x466af5[_0xa4f2('0x1e')](_0x3b0804[0x3]);_0x466af5['push'](_0x3b0804['slice'](0x4,_0x3b0804[_0xa4f2('0x15')])[_0xa4f2('0x17')](','));break;case _0xa4f2('0x24'):_0x466af5[_0xa4f2('0x1e')](_0xe17742[_0xa4f2('0x1b')]);break;case _0xa4f2('0x25'):_0x466af5[_0xa4f2('0x1e')](_0xe17742[_0xa4f2('0x26')]);_0x466af5[_0xa4f2('0x1e')](_0xe17742[_0xa4f2('0x1b')]);break;case _0xa4f2('0x27'):var _0x5afdc1=utils[_0xa4f2('0x28')](_0x11c228['account'][_0xa4f2('0x29')],_0x11c228);var _0x5cfc1c=_0xe17742['appdata'][_0xa4f2('0x21')](',');_0x466af5['push'](_0x5cfc1c[0x0]);_0x466af5['push'](_0x5cfc1c[0x1]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x2]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x3]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x4]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x5]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x6]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x7]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x8]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0x9]);_0x466af5[_0xa4f2('0x1e')](_0x5cfc1c[0xa]);_0x466af5[_0xa4f2('0x1e')](_0x11c228[_0xa4f2('0x11')]['id']);_0x466af5[_0xa4f2('0x1e')](_0x11c228[_0xa4f2('0x24')]['id']);_0x466af5[_0xa4f2('0x1e')](_0xe17742['ChatWebsiteId']);_0x466af5['push'](_0x11c228[_0xa4f2('0x11')]['ContactId']);_0x466af5['push'](_0x11c228['body']['body']);_0x466af5[_0xa4f2('0x1e')](_0x5afdc1);break;default:_0x466af5=_[_0xa4f2('0xb')](_0xe17742['appdata'])?[]:_0xe17742[_0xa4f2('0x1b')][_0xa4f2('0x21')](',');}var _0x164f16={'id':util['format']('%s:%s:%s',_0x5b0ee6,_0xe17742['id'],_0xe17742[_0xa4f2('0x19')]),'condition':require(_0xa4f2('0x2a'))[_0xa4f2('0x2b')](_0x5b0ee6,getIntervals(_0x3e5216['intervals'],_0xe17742),_0x3e5216),'consequence':require(_0xa4f2('0x2c')+_0xe17742[_0xa4f2('0x19')])[_0xa4f2('0x2d')](_0x5b0ee6,_0x466af5,_0x3e5216,_0x11c228),'p':_0xe17742[_0xa4f2('0x2e')]||0x0};logger['info'](_0xa4f2('0x2f'),_0x164f16['id'],_0xa4f2('0x30'),getIntervals(_0x3e5216[_0xa4f2('0x31')],_0xe17742)[_0xa4f2('0x17')](_0xa4f2('0x32')));_0x7cd22d[_0xa4f2('0x1e')](_0x164f16);}else{logger[_0xa4f2('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xa4f2('0x17')](__dirname,'applications',_0xe17742[_0xa4f2('0x19')]+_0xa4f2('0x18')));}}_0x3e5216[_0xa4f2('0x10')][_0x5b0ee6]=new RuleEngine(_0x7cd22d);_0x3e5216[_0xa4f2('0x10')][_0x5b0ee6]['execute'](_0x11c228,function(_0x3a08a0){logger[_0xa4f2('0x34')]('Applications\x20executed',JSON[_0xa4f2('0x35')](_0x3a08a0[_0xa4f2('0x36')]));if(_0x3e5216[_0xa4f2('0x10')][_0x5b0ee6]){_0x3e5216[_0xa4f2('0x10')][_0x5b0ee6][_0xa4f2('0x37')](_0xa4f2('0x38'));}});return _0xefa375({'code':0xc8,'message':_0x11c228});}else{if(_0x32367e){logger[_0xa4f2('0x34')](util[_0xa4f2('0x39')](_0xa4f2('0x3a'),_0x5b0ee6));}else{logger[_0xa4f2('0x34')](_0xa4f2('0x3b'));}return _0xefa375({'code':0xc8,'message':_0x11c228});}}catch(_0x2cbec3){logger[_0xa4f2('0x33')](_0x2cbec3[_0xa4f2('0x3c')]);return _0x4e1b4a(_0x3d47d8[_0xa4f2('0x33')](0x1f4,_0x2cbec3));}}return _0x4e1b4a(_0xa4f2('0x3d'));});},'AcceptMessage':function(_0x1e8c37){var _0x23ff2e=this;return new Promise(function(_0x5aff06,_0x9bb740){if(_0x1e8c37['agent']&&_0x1e8c37['agent']['id']){if(_0x3e5216[_0xa4f2('0x3e')][_0x1e8c37['agent']['id']]){_0x3e5216['agents'][_0x1e8c37[_0xa4f2('0x3f')]['id']][_0xa4f2('0x40')]=![];_0x3e5216[_0xa4f2('0x3e')][_0x1e8c37[_0xa4f2('0x3f')]['id']][_0xa4f2('0x41')]=undefined;}}if(_0x1e8c37[_0xa4f2('0x24')]&&_0x1e8c37[_0xa4f2('0x24')]['id']){try{var _0x2acaaa=getId(_0x1e8c37[_0xa4f2('0x1c')],_0x1e8c37[_0xa4f2('0x24')]?_0x1e8c37['message']['id']:0x0,_0x1e8c37[_0xa4f2('0x11')]?_0x1e8c37[_0xa4f2('0x11')]['id']:0x0);if(_0x3e5216[_0xa4f2('0x10')][_0x2acaaa]){_0x3e5216[_0xa4f2('0x10')][_0x2acaaa][_0xa4f2('0x37')](_0xa4f2('0x42'));if(rpc[_0x1e8c37[_0xa4f2('0x1c')]+_0xa4f2('0x43')]){rpc[_0x1e8c37[_0xa4f2('0x1c')]+'QueueReport'][_0xa4f2('0x44')](_0x2acaaa,{'UserId':_0x1e8c37[_0xa4f2('0x24')][_0xa4f2('0x45')]})[_0xa4f2('0x46')](function(){logger['error'](_0xa4f2('0x47'));});}}return _0x5aff06({'code':0xc8,'message':_0x1e8c37});}catch(_0x2536bb){logger[_0xa4f2('0x33')](_0x2536bb['stack']);return _0x9bb740(_0x23ff2e[_0xa4f2('0x33')](0x1f4,_0x2536bb));}}logger['error']('message\x20is\x20empty');return _0x9bb740(_0x23ff2e[_0xa4f2('0x33')](0x1f4,_0xa4f2('0x48')));});},'RejectMessage':function(_0x566e8e){var _0x22d02a=this;return new Promise(function(_0x3d398d,_0x3e3674){if(_0x566e8e[_0xa4f2('0x3f')]&&_0x566e8e[_0xa4f2('0x3f')]['id']){try{if(_0x3e5216[_0xa4f2('0x3e')][_0x566e8e[_0xa4f2('0x3f')]['id']]){_0x3e5216[_0xa4f2('0x3e')][_0x566e8e['agent']['id']][_0xa4f2('0x40')]=![];_0x3e5216[_0xa4f2('0x3e')][_0x566e8e[_0xa4f2('0x3f')]['id']][_0xa4f2('0x41')]=undefined;}return _0x3d398d({'code':0xc8,'message':_0x566e8e});}catch(_0x528911){logger['error'](_0x528911[_0xa4f2('0x3c')]);return _0x3e3674(_0x22d02a[_0xa4f2('0x33')](0x1f4,_0x528911));}}logger['error'](_0xa4f2('0x48'));return _0x3e3674(_0x22d02a[_0xa4f2('0x33')](0x1f4,_0xa4f2('0x48')));});},'AbandonInteraction':function(_0x32b42c){var _0x54b5c5=this;return new Promise(function(_0x15d08e,_0xb3624b){if(_0x32b42c[_0xa4f2('0x1c')]&&_0x32b42c['interaction']&&_0x32b42c[_0xa4f2('0x11')]['id']){try{var _0x45f054=getId(_0x32b42c[_0xa4f2('0x1c')],_0x32b42c[_0xa4f2('0x24')]?_0x32b42c[_0xa4f2('0x24')]['id']:0x0,_0x32b42c['interaction']?_0x32b42c[_0xa4f2('0x11')]['id']:0x0);if(_0x3e5216[_0xa4f2('0x10')][_0x45f054]){_0x3e5216[_0xa4f2('0x10')][_0x45f054][_0xa4f2('0x37')]('end');}return _0x15d08e({'code':0xc8,'message':_0x32b42c});}catch(_0x33e4c7){logger['error'](_0x33e4c7['stack']);return _0xb3624b(_0x54b5c5[_0xa4f2('0x33')](0x1f4,_0x33e4c7));}}logger['error'](_0xa4f2('0x48'));return _0xb3624b(_0x54b5c5[_0xa4f2('0x33')](0x1f4,_0xa4f2('0x48')));});},'AgentCapacity':function(_0x2b5631){var _0x1b2db8=this;return new Promise(function(_0x5a9449,_0x36de96){if(_0x3e5216[_0xa4f2('0x3e')][_0xa4f2('0x49')](_0x2b5631['id'])){for(var _0xcbca44 in _0x2b5631[_0xa4f2('0x4a')]){if(_0x2b5631[_0xa4f2('0x4a')][_0xa4f2('0x49')](_0xcbca44)){if(_0x3e5216[_0xa4f2('0x3e')][_0x2b5631['id']]['hasOwnProperty'](_0xcbca44+_0xa4f2('0x4b'))){_0x3e5216[_0xa4f2('0x3e')][_0x2b5631['id']][_0xcbca44+'CurrentCapacity']=parseInt(_0x2b5631['capacity'][_0xcbca44],0xa);}}}_0x3e5216['agents'][_0x2b5631['id']][_0xa4f2('0x4c')]();return _0x5a9449({'code':0xc8,'message':_0x3e5216['agents'][_0x2b5631['id']]});}else{return _0x36de96(_0x1b2db8[_0xa4f2('0x33')](0x1f4,_0xa4f2('0x4d')));}});},'Agents':function(_0x5d1014){return new Promise(function(_0x5c2930){var _0x3c89b1=_['values'](_0x3e5216[_0xa4f2('0x3e')]);if(_0x5d1014&&_0x5d1014['id']){var _0x4d2323=_['find'](_0x3c89b1,function(_0x308f7e){return _0x308f7e['id']===_0x5d1014['id'];});_0x5c2930(_0x4d2323);}else{_0x5c2930({'count':_0x3c89b1[_0xa4f2('0x15')],'rows':_0x3c89b1});}});},'ChatQueues':function(){return new Promise(function(_0x344ada){var _0x121c8d=[];for(var _0x42796b in _0x3e5216[_0xa4f2('0x4e')]){if(_0x3e5216['chatQueues'][_0xa4f2('0x49')](_0x42796b)){var _0x4c31c1=_0x3e5216[_0xa4f2('0x4e')][_0x42796b];var _0x3631d2={'id':_0x4c31c1['id'],'available':_0x4c31c1['available'],'loggedIn':_0x4c31c1['loggedIn'],'name':_0x4c31c1[_0xa4f2('0x4f')],'paused':_0x4c31c1['paused'],'waiting':_0x4c31c1[_0xa4f2('0x50')]};_0x121c8d['push'](_0x3631d2);}}_0x344ada({'count':_0x121c8d[_0xa4f2('0x15')],'rows':_0x121c8d});});},'MailQueues':function(){return new Promise(function(_0x1cca8c){var _0x176796=[];for(var _0x5204b0 in _0x3e5216['mailQueues']){if(_0x3e5216[_0xa4f2('0x51')][_0xa4f2('0x49')](_0x5204b0)){var _0x2d1a15=_0x3e5216[_0xa4f2('0x51')][_0x5204b0];var _0x560146={'id':_0x2d1a15['id'],'available':_0x2d1a15[_0xa4f2('0x52')],'loggedIn':_0x2d1a15[_0xa4f2('0x53')],'name':_0x2d1a15[_0xa4f2('0x4f')],'paused':_0x2d1a15[_0xa4f2('0x54')],'waiting':_0x2d1a15[_0xa4f2('0x50')]};_0x176796[_0xa4f2('0x1e')](_0x560146);}}_0x1cca8c({'count':_0x176796['length'],'rows':_0x176796});});},'OpenchannelQueues':function(){return new Promise(function(_0x21595e){var _0x38493e=[];for(var _0x2916df in _0x3e5216[_0xa4f2('0x55')]){if(_0x3e5216[_0xa4f2('0x55')][_0xa4f2('0x49')](_0x2916df)){var _0x2601ff=_0x3e5216['openchannelQueues'][_0x2916df];var _0x342802={'id':_0x2601ff['id'],'available':_0x2601ff['available'],'loggedIn':_0x2601ff[_0xa4f2('0x53')],'name':_0x2601ff[_0xa4f2('0x4f')],'paused':_0x2601ff[_0xa4f2('0x54')],'waiting':_0x2601ff[_0xa4f2('0x50')]};_0x38493e['push'](_0x342802);}}_0x21595e({'count':_0x38493e[_0xa4f2('0x15')],'rows':_0x38493e});});},'SmsQueues':function(){return new Promise(function(_0x418175){var _0x92414b=[];for(var _0x19dc25 in _0x3e5216['smsQueues']){if(_0x3e5216[_0xa4f2('0x56')][_0xa4f2('0x49')](_0x19dc25)){var _0x5b9539=_0x3e5216[_0xa4f2('0x56')][_0x19dc25];var _0xa3384c={'id':_0x5b9539['id'],'available':_0x5b9539[_0xa4f2('0x52')],'loggedIn':_0x5b9539[_0xa4f2('0x53')],'name':_0x5b9539['name'],'paused':_0x5b9539['paused'],'waiting':_0x5b9539['waiting']};_0x92414b['push'](_0xa3384c);}}_0x418175({'count':_0x92414b[_0xa4f2('0x15')],'rows':_0x92414b});});},'FaxQueues':function(){return new Promise(function(_0x2096a3){var _0xbd6038=[];for(var _0x554a15 in _0x3e5216[_0xa4f2('0x57')]){if(_0x3e5216[_0xa4f2('0x57')][_0xa4f2('0x49')](_0x554a15)){var _0xc027b7=_0x3e5216[_0xa4f2('0x57')][_0x554a15];var _0x358757={'id':_0xc027b7['id'],'available':_0xc027b7['available'],'loggedIn':_0xc027b7[_0xa4f2('0x53')],'name':_0xc027b7[_0xa4f2('0x4f')],'paused':_0xc027b7[_0xa4f2('0x54')],'waiting':_0xc027b7[_0xa4f2('0x50')]};_0xbd6038[_0xa4f2('0x1e')](_0x358757);}}_0x2096a3({'count':_0xbd6038['length'],'rows':_0xbd6038});});},'WhatsappQueues':function(){return new Promise(function(_0x3eefec){var _0x1d0ab9=[];for(var _0x486e8a in _0x3e5216[_0xa4f2('0x58')]){if(_0x3e5216[_0xa4f2('0x58')][_0xa4f2('0x49')](_0x486e8a)){var _0x5765c0=_0x3e5216['whatsappQueues'][_0x486e8a];var _0x2b6f19={'id':_0x5765c0['id'],'available':_0x5765c0['available'],'loggedIn':_0x5765c0[_0xa4f2('0x53')],'name':_0x5765c0[_0xa4f2('0x4f')],'paused':_0x5765c0['paused'],'waiting':_0x5765c0[_0xa4f2('0x50')]};_0x1d0ab9[_0xa4f2('0x1e')](_0x2b6f19);}}_0x3eefec({'count':_0x1d0ab9['length'],'rows':_0x1d0ab9});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x49e6ea){var _0x49d320=_[_0xa4f2('0x59')](_0x3e5216['chatQueuesWaitingInteractions']);_0x49e6ea({'count':_0x49d320[_0xa4f2('0x15')],'rows':_0x49d320});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x29faec){var _0x1ae1e6=_[_0xa4f2('0x59')](_0x3e5216['mailQueuesWaitingInteractions']);_0x29faec({'count':_0x1ae1e6[_0xa4f2('0x15')],'rows':_0x1ae1e6});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x64229c){var _0x200cd5=_[_0xa4f2('0x59')](_0x3e5216[_0xa4f2('0x5a')]);_0x64229c({'count':_0x200cd5['length'],'rows':_0x200cd5});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x508f57){var _0xa04b93=_[_0xa4f2('0x59')](_0x3e5216[_0xa4f2('0x5b')]);_0x508f57({'count':_0xa04b93[_0xa4f2('0x15')],'rows':_0xa04b93});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x9c30dc){var _0x4e3c3f=_[_0xa4f2('0x59')](_0x3e5216[_0xa4f2('0x5c')]);_0x9c30dc({'count':_0x4e3c3f[_0xa4f2('0x15')],'rows':_0x4e3c3f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4fbe82){var _0x11958e=_[_0xa4f2('0x59')](_0x3e5216[_0xa4f2('0x5d')]);_0x4fbe82({'count':_0x11958e[_0xa4f2('0x15')],'rows':_0x11958e});});}};var _0x11467d=jayson['server'](_0x55b464)[_0xa4f2('0x5e')]();_0x11467d['on'](_0xa4f2('0x33'),function(_0x2f26f9){logger[_0xa4f2('0x33')](JSON[_0xa4f2('0x35')](_0x2f26f9));return _0x2c82a4(_0x2f26f9);});_0x11467d[_0xa4f2('0x5f')](0x232c,_0xa4f2('0x60'),function(){console[_0xa4f2('0x61')](_0xa4f2('0x62'),0x232c);return _0x4910a2('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f558453..98957b2 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 _0xf256=['[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','then','error','message','result','catch','condition','rules','info','stop','length','push','format','iftime\x20%s','indexOf','true','all','join','\x20|\x20','when','log'];(function(_0x49c5b0,_0xca8692){var _0x4efb64=function(_0x292e79){while(--_0x292e79){_0x49c5b0['push'](_0x49c5b0['shift']());}};_0x4efb64(++_0xca8692);}(_0xf256,0x120));var _0x6f25=function(_0x36a148,_0x76deec){_0x36a148=_0x36a148-0x0;var _0x5e80f9=_0xf256[_0x36a148];return _0x5e80f9;};'use strict';var util=require(_0x6f25('0x0'));var BPromise=require(_0x6f25('0x1'));var jayson=require(_0x6f25('0x2'));var _=require(_0x6f25('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson['client']['http']({'port':0x232a});function request(_0x1df1d2,_0x24e84c){return new BPromise(function(_0x182b40,_0x451d32){return client['request'](_0x1df1d2,_0x24e84c)[_0x6f25('0x4')](function(_0x444536){if(_0x444536[_0x6f25('0x5')]){return _0x451d32(_0x444536[_0x6f25('0x5')][_0x6f25('0x6')]);}else{return _0x182b40(_0x444536[_0x6f25('0x7')]);}})[_0x6f25('0x8')](function(_0x7bf3a5){return _0x451d32(_0x7bf3a5);});});}exports[_0x6f25('0x9')]=function(_0x2add0c,_0xac4cef,_0x48d923){return function(_0x28adee){if(_0x48d923[_0x6f25('0xa')]&&!_0x48d923[_0x6f25('0xa')][_0x2add0c]){logger[_0x6f25('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2add0c);return _0x28adee[_0x6f25('0xc')]();}var _0x12425a=[];for(var _0x40b0c4=0x0;_0x40b0c4<_0xac4cef[_0x6f25('0xd')];_0x40b0c4+=0x1){_0x12425a[_0x6f25('0xe')](request('Command',{'command':util[_0x6f25('0xf')](_0x6f25('0x10'),_0xac4cef[_0x40b0c4])})[_0x6f25('0x4')](function(_0x51c736){return _0x51c736&&_0x51c736['message']&&_0x51c736[_0x6f25('0x6')][_0x6f25('0x11')](_0x6f25('0x12'))>=0x0?!![]:![];})['catch'](function(_0x9ab581){logger['error']('[%s][INTERVAL]\x20%s',_0x2add0c,_0xac4cef[_0x40b0c4]);}));}BPromise[_0x6f25('0x13')](_0x12425a)[_0x6f25('0x4')](function(_0x3bee3a){var _0x43a760=_['some'](_0x3bee3a);logger[_0x6f25('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x2add0c,_0xac4cef[_0x6f25('0x14')](_0x6f25('0x15')),_0x43a760);_0x28adee[_0x6f25('0x16')](_0x43a760);})[_0x6f25('0x8')](function(_0x2e90dd){console[_0x6f25('0x17')](_0x2e90dd);logger['error'](_0x6f25('0x18'),_0x2add0c,_0xac4cef[_0x6f25('0x14')]('\x20|\x20'),_0x2e90dd[_0x6f25('0x19')]);_0x28adee[_0x6f25('0xc')]();});};}; \ No newline at end of file +var _0x56f6=['format','iftime\x20%s','message','true','error','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','util','bluebird','lodash','routing','client','then','result','catch','rules','info','stop','length','push'];(function(_0x8c8183,_0x4e7d14){var _0x3649c6=function(_0x4f87a9){while(--_0x4f87a9){_0x8c8183['push'](_0x8c8183['shift']());}};_0x3649c6(++_0x4e7d14);}(_0x56f6,0xdd));var _0x656f=function(_0x3e8f83,_0x506e7a){_0x3e8f83=_0x3e8f83-0x0;var _0x5160e3=_0x56f6[_0x3e8f83];return _0x5160e3;};'use strict';var util=require(_0x656f('0x0'));var BPromise=require(_0x656f('0x1'));var jayson=require('jayson/promise');var _=require(_0x656f('0x2'));var logger=require('../../../config/logger')(_0x656f('0x3'));var client=jayson[_0x656f('0x4')]['http']({'port':0x232a});function request(_0x374ec5,_0x771d4c){return new BPromise(function(_0x3185f3,_0x2dd1d7){return client['request'](_0x374ec5,_0x771d4c)[_0x656f('0x5')](function(_0x1fc018){if(_0x1fc018['error']){return _0x2dd1d7(_0x1fc018['error']['message']);}else{return _0x3185f3(_0x1fc018[_0x656f('0x6')]);}})[_0x656f('0x7')](function(_0x447644){return _0x2dd1d7(_0x447644);});});}exports['condition']=function(_0x4486e2,_0x31cc60,_0x458065){return function(_0x2a60e7){if(_0x458065[_0x656f('0x8')]&&!_0x458065[_0x656f('0x8')][_0x4486e2]){logger[_0x656f('0x9')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4486e2);return _0x2a60e7[_0x656f('0xa')]();}var _0x489ab3=[];for(var _0x411046=0x0;_0x411046<_0x31cc60[_0x656f('0xb')];_0x411046+=0x1){_0x489ab3[_0x656f('0xc')](request('Command',{'command':util[_0x656f('0xd')](_0x656f('0xe'),_0x31cc60[_0x411046])})[_0x656f('0x5')](function(_0x30ddd8){return _0x30ddd8&&_0x30ddd8[_0x656f('0xf')]&&_0x30ddd8[_0x656f('0xf')]['indexOf'](_0x656f('0x10'))>=0x0?!![]:![];})['catch'](function(_0x359e98){logger[_0x656f('0x11')](_0x656f('0x12'),_0x4486e2,_0x31cc60[_0x411046]);}));}BPromise[_0x656f('0x13')](_0x489ab3)[_0x656f('0x5')](function(_0x1034ef){var _0x1fee0d=_['some'](_0x1034ef);logger[_0x656f('0x9')](_0x656f('0x14'),_0x4486e2,_0x31cc60[_0x656f('0x15')]('\x20|\x20'),_0x1fee0d);_0x2a60e7[_0x656f('0x16')](_0x1fee0d);})[_0x656f('0x7')](function(_0x275ce7){console[_0x656f('0x17')](_0x275ce7);logger['error'](_0x656f('0x14'),_0x4486e2,_0x31cc60[_0x656f('0x15')](_0x656f('0x18')),_0x275ce7[_0x656f('0x19')]);_0x2a60e7[_0x656f('0xa')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index e0d854a..291839f 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 _0xbfcc=['now','lastevent','called','connectedlinename','agentringnoanswer','isNil','debug','timeout','reason','holdtime','ringtime','push','error','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','talktime','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','extension','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererexten','transfertargetuniqueid','agentcalledAt','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','info','format','membername','interface','connectedlinenum','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','uniqueid'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0xbfcc[_0x56756b];return _0xa3002;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1a2fe0,_0x2d1386){utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1a2fe0['uniqueid'],_0x1a2fe0['channel'],_0x1a2fe0['queue'],_0x1a2fe0[_0xcbfc('0x3')],_0x1a2fe0[_0xcbfc('0x4')],_0x1a2fe0['calleridnum'],_0x1a2fe0[_0xcbfc('0x5')],_0x1a2fe0['lastevent']));if(_0x1a2fe0[_0xcbfc('0x6')]){utils[_0xcbfc('0x7')](_0x1a2fe0[_0xcbfc('0x6')])[_0xcbfc('0x8')](function(_0x4eff22){if(_0x4eff22){_0x1a2fe0[_0xcbfc('0x9')]=_0x4eff22[_0xcbfc('0x9')];_0x1a2fe0[_0xcbfc('0xa')]=_0x1a2fe0[_0xcbfc('0xb')]?_0x4eff22[_0xcbfc('0xc')]:![];_0x1a2fe0[_0xcbfc('0xd')]=_0x1a2fe0['agentacw']?_0x4eff22[_0xcbfc('0xe')]:0x0;}utils[_0xcbfc('0xf')](_0xcbfc('0x10'),_0x1a2fe0);});}else{utils[_0xcbfc('0xf')](_0xcbfc('0x10'),_0x1a2fe0);}if(_0x2d1386){delete transfers[_0x1a2fe0['uniqueid']];}else{delete agents[_0x1a2fe0[_0xcbfc('0x11')]];}}exports[_0xcbfc('0x12')]=function(_0x80d08d){try{utils['debug'](util[_0xcbfc('0x2')](_0xcbfc('0x13'),_0x80d08d[_0xcbfc('0x14')]),_0x80d08d);agents[_0x80d08d[_0xcbfc('0x11')]]=_0x80d08d;agents[_0x80d08d[_0xcbfc('0x11')]]['agentcalledAt']=utils[_0xcbfc('0x15')]();agents[_0x80d08d[_0xcbfc('0x11')]][_0xcbfc('0x16')]=_0xcbfc('0x17');agents[_0x80d08d['destuniqueid']]['connectedlinenum']=null;agents[_0x80d08d[_0xcbfc('0x11')]][_0xcbfc('0x18')]=null;utils[_0xcbfc('0x1')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x80d08d[_0xcbfc('0x14')],agents[_0x80d08d[_0xcbfc('0x11')]][_0xcbfc('0x3')],_0x80d08d['destuniqueid']));}catch(_0x3825d5){utils['error'](util[_0xcbfc('0x2')](_0xcbfc('0x13'),_0x80d08d[_0xcbfc('0x14')]),_0x3825d5);}};exports[_0xcbfc('0x19')]=function(_0x25c167){try{if(!_[_0xcbfc('0x1a')](agents[_0x25c167['destuniqueid']])){utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')]('[%s][agents][agentringnoanswer]',_0x25c167[_0xcbfc('0x14')]),_0x25c167);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x25c167[_0xcbfc('0x14')],agents[_0x25c167['destuniqueid']]['membername'],_0x25c167[_0xcbfc('0x11')]));agents[_0x25c167[_0xcbfc('0x11')]][_0xcbfc('0x19')]=!![];agents[_0x25c167[_0xcbfc('0x11')]]['agentringnoanswerAt']=utils[_0xcbfc('0x15')]();agents[_0x25c167['destuniqueid']][_0xcbfc('0x16')]=_0xcbfc('0x1c');agents[_0x25c167['destuniqueid']][_0xcbfc('0x1d')]=_0xcbfc('0x1c');agents[_0x25c167['destuniqueid']][_0xcbfc('0x1e')]=_0x25c167[_0xcbfc('0x1f')]?parseInt(_0x25c167[_0xcbfc('0x1f')])/0x3e8:0x0;agents[_0x25c167[_0xcbfc('0x11')]]['talktime']=0x0;unanswered[_0xcbfc('0x20')](_0x25c167[_0xcbfc('0x11')]);}}catch(_0x4f632a){utils[_0xcbfc('0x21')](util[_0xcbfc('0x2')](_0xcbfc('0x22'),_0x25c167[_0xcbfc('0x14')]),_0x4f632a);}};exports[_0xcbfc('0x23')]=function(_0x19d2e){try{_[_0xcbfc('0x24')](agents,function(_0x5366cf,_0x41b68b){if(_0x5366cf[_0xcbfc('0x14')]==_0x19d2e[_0xcbfc('0x14')]&&!_[_0xcbfc('0x25')](unanswered,_0x5366cf['destuniqueid'])){utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')](_0xcbfc('0x26'),_0x19d2e[_0xcbfc('0x14')]),_0x19d2e);utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')](_0xcbfc('0x27'),_0x19d2e['uniqueid'],_0x5366cf[_0xcbfc('0x3')],_0x5366cf[_0xcbfc('0x11')]));_0x5366cf['agentringnoanswer']=!![];_0x5366cf[_0xcbfc('0x28')]=utils[_0xcbfc('0x15')]();_0x5366cf[_0xcbfc('0x16')]='abandoned';_0x5366cf['reason']='abandoned';_0x5366cf[_0xcbfc('0x1e')]=_0x19d2e[_0xcbfc('0x1e')];_0x5366cf[_0xcbfc('0x29')]=0x0;writeDB(_0x5366cf);}});}catch(_0x9c1ff3){utils[_0xcbfc('0x21')](util[_0xcbfc('0x2')](_0xcbfc('0x26'),_0x19d2e[_0xcbfc('0x14')]),_0x9c1ff3);}};exports['agentconnect']=function(_0x2f14ff){try{if(agents[_0x2f14ff[_0xcbfc('0x11')]]){utils['debug'](util[_0xcbfc('0x2')]('[%s][agents][agentconnect]',_0x2f14ff[_0xcbfc('0x14')]),_0x2f14ff);utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2f14ff[_0xcbfc('0x14')],agents[_0x2f14ff['destuniqueid']]['membername'],_0x2f14ff[_0xcbfc('0x11')]));agents[_0x2f14ff[_0xcbfc('0x11')]][_0xcbfc('0x2a')]=utils[_0xcbfc('0x15')]();agents[_0x2f14ff[_0xcbfc('0x11')]][_0xcbfc('0x5')]=_0x2f14ff[_0xcbfc('0x5')];agents[_0x2f14ff[_0xcbfc('0x11')]]['connectedlinename']=_0x2f14ff[_0xcbfc('0x18')];agents[_0x2f14ff['destuniqueid']][_0xcbfc('0x1e')]=_0x2f14ff[_0xcbfc('0x1f')];agents[_0x2f14ff[_0xcbfc('0x11')]][_0xcbfc('0x16')]='connect';_['forIn'](agents,function(_0x236b66,_0x1c678b){if(_0x236b66[_0xcbfc('0x11')]!=_0x2f14ff[_0xcbfc('0x11')]&&_0x236b66[_0xcbfc('0x14')]==_0x2f14ff['uniqueid']){_0x236b66[_0xcbfc('0x29')]=0x0;_0x236b66[_0xcbfc('0x1e')]=_0x2f14ff[_0xcbfc('0x1f')];_0x236b66['agentringnoanswer']=!![];_0x236b66[_0xcbfc('0x28')]=utils[_0xcbfc('0x15')]();_0x236b66[_0xcbfc('0x16')]='answered_elsewhere';_0x236b66[_0xcbfc('0x1d')]=_0xcbfc('0x2b');_0x236b66[_0xcbfc('0x2c')]=_0x2f14ff[_0xcbfc('0x11')];_0x236b66[_0xcbfc('0x2d')]=_0x2f14ff[_0xcbfc('0x3')];writeDB(_0x236b66);}});}}catch(_0x1e14bb){utils['error'](util[_0xcbfc('0x2')](_0xcbfc('0x2e'),_0x2f14ff['uniqueid']),_0x1e14bb);}};exports[_0xcbfc('0xb')]=function(_0x50a01c){try{if(!_[_0xcbfc('0x1a')](agents[_0x50a01c[_0xcbfc('0x11')]])){utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')](_0xcbfc('0x2f'),_0x50a01c[_0xcbfc('0x14')]),_0x50a01c);utils['info'](util[_0xcbfc('0x2')](_0xcbfc('0x30'),_0x50a01c[_0xcbfc('0x14')],agents[_0x50a01c[_0xcbfc('0x11')]][_0xcbfc('0x3')],_0x50a01c[_0xcbfc('0x11')]));agents[_0x50a01c[_0xcbfc('0x11')]]['agentcomplete']=!![];agents[_0x50a01c[_0xcbfc('0x11')]][_0xcbfc('0x31')]=utils['now']();agents[_0x50a01c[_0xcbfc('0x11')]][_0xcbfc('0x29')]=utils[_0xcbfc('0x32')](agents[_0x50a01c['destuniqueid']][_0xcbfc('0x31')],agents[_0x50a01c[_0xcbfc('0x11')]][_0xcbfc('0x2a')]);agents[_0x50a01c[_0xcbfc('0x11')]][_0xcbfc('0x1d')]=_0x50a01c[_0xcbfc('0x1d')];agents[_0x50a01c[_0xcbfc('0x11')]]['lastevent']='complete';writeDB(agents[_0x50a01c[_0xcbfc('0x11')]]);}}catch(_0x94398c){utils[_0xcbfc('0x21')](util[_0xcbfc('0x2')]('[%s][agents][agentcomplete]',_0x50a01c['uniqueid']),_0x94398c);}};exports[_0xcbfc('0x33')]=function(_0xe5c5ef){try{if(!_[_0xcbfc('0x1a')](agents[_0xe5c5ef['transfereruniqueid']])){utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')](_0xcbfc('0x34'),_0xe5c5ef['uniqueid']),_0xe5c5ef);utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')](_0xcbfc('0x35'),_0xe5c5ef[_0xcbfc('0x14')],agents[_0xe5c5ef[_0xcbfc('0x36')]][_0xcbfc('0x3')],agents[_0xe5c5ef[_0xcbfc('0x36')]][_0xcbfc('0x14')]));agents[_0xe5c5ef[_0xcbfc('0x36')]][_0xcbfc('0x37')]=!![];agents[_0xe5c5ef['transfereruniqueid']][_0xcbfc('0x38')]=_0xcbfc('0x39');agents[_0xe5c5ef[_0xcbfc('0x36')]]['transferexten']=_0xe5c5ef[_0xcbfc('0x3a')];agents[_0xe5c5ef[_0xcbfc('0x36')]]['transferuniqueid']=agents[_0xe5c5ef[_0xcbfc('0x36')]][_0xcbfc('0x14')];}}catch(_0x38db76){utils[_0xcbfc('0x21')](util['format'](_0xcbfc('0x34'),_0xe5c5ef[_0xcbfc('0x14')]),_0x38db76);}};exports['attendedtransfer']=function(_0x2fe240){try{utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')](_0xcbfc('0x3b'),_0x2fe240[_0xcbfc('0x3c')]),_0x2fe240);if(_0x2fe240[_0xcbfc('0x3c')]==_0x2fe240[_0xcbfc('0x3d')]){if(!_[_0xcbfc('0x1a')](agents[_0x2fe240[_0xcbfc('0x3e')]])){utils[_0xcbfc('0x1')](util['format'](_0xcbfc('0x3f'),_0x2fe240['origtransfereruniqueid'],agents[_0x2fe240['secondtransfereruniqueid']]['membername']));agents[_0x2fe240[_0xcbfc('0x3e')]][_0xcbfc('0x37')]=!![];agents[_0x2fe240[_0xcbfc('0x3e')]][_0xcbfc('0x38')]=_0xcbfc('0x40');agents[_0x2fe240[_0xcbfc('0x3e')]][_0xcbfc('0x41')]=_0x2fe240[_0xcbfc('0x42')];agents[_0x2fe240['secondtransfereruniqueid']][_0xcbfc('0x43')]=_0x2fe240[_0xcbfc('0x3c')];}if(_0x2fe240[_0xcbfc('0x44')]&&agents[_0x2fe240['transfereeuniqueid']]){agents[_0x2fe240[_0xcbfc('0x44')]][_0xcbfc('0x45')]=0x1;transfers[_0x2fe240[_0xcbfc('0x44')]]=_[_0xcbfc('0x46')](agents[_0x2fe240[_0xcbfc('0x44')]]);transfers[_0x2fe240[_0xcbfc('0x44')]][_0xcbfc('0x47')]=agents[_0x2fe240['secondtransfereruniqueid']][_0xcbfc('0x47')];transfers[_0x2fe240['transfereeuniqueid']][_0xcbfc('0x48')]=agents[_0x2fe240[_0xcbfc('0x3e')]]['calleridname'];transfers[_0x2fe240[_0xcbfc('0x44')]]['agentcalledAt']=utils[_0xcbfc('0x15')]();transfers[_0x2fe240[_0xcbfc('0x44')]][_0xcbfc('0x2a')]=utils[_0xcbfc('0x15')]();transfers[_0x2fe240[_0xcbfc('0x44')]][_0xcbfc('0x1e')]=0x0;transfers[_0x2fe240['transfereeuniqueid']][_0xcbfc('0x45')]=0x2;}}else if(_0x2fe240[_0xcbfc('0x3e')]==_0x2fe240['secondtransfererlinkedid']){if(!_[_0xcbfc('0x1a')](agents[_0x2fe240[_0xcbfc('0x3c')]])){utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')](_0xcbfc('0x3f'),_0x2fe240[_0xcbfc('0x3c')],agents[_0x2fe240[_0xcbfc('0x3c')]][_0xcbfc('0x3')]));agents[_0x2fe240['origtransfereruniqueid']][_0xcbfc('0x37')]=!![];agents[_0x2fe240[_0xcbfc('0x3c')]][_0xcbfc('0x38')]=_0xcbfc('0x40');agents[_0x2fe240[_0xcbfc('0x3c')]][_0xcbfc('0x41')]=_0x2fe240[_0xcbfc('0x49')];agents[_0x2fe240[_0xcbfc('0x3c')]][_0xcbfc('0x43')]=_0x2fe240[_0xcbfc('0x3e')];}if(_0x2fe240['transfertargetuniqueid']&&agents[_0x2fe240[_0xcbfc('0x4a')]]){agents[_0x2fe240[_0xcbfc('0x4a')]]['agententerreason']=0x1;transfers[_0x2fe240[_0xcbfc('0x4a')]]=_['clone'](agents[_0x2fe240['transfertargetuniqueid']]);transfers[_0x2fe240[_0xcbfc('0x4a')]][_0xcbfc('0x47')]=agents[_0x2fe240[_0xcbfc('0x3c')]][_0xcbfc('0x47')];transfers[_0x2fe240[_0xcbfc('0x4a')]]['calleridname']=agents[_0x2fe240['origtransfereruniqueid']][_0xcbfc('0x48')];transfers[_0x2fe240[_0xcbfc('0x4a')]][_0xcbfc('0x4b')]=utils[_0xcbfc('0x15')]();transfers[_0x2fe240[_0xcbfc('0x4a')]]['agentconnectAt']=utils[_0xcbfc('0x15')]();transfers[_0x2fe240[_0xcbfc('0x4a')]][_0xcbfc('0x1e')]=0x0;transfers[_0x2fe240['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x4c3d4d){utils[_0xcbfc('0x21')](util['format']('[%s][agents][attendedtransfer]',_0x2fe240[_0xcbfc('0x3c')]),_0x4c3d4d);}};exports['hangup']=function(_0x99068f){try{utils[_0xcbfc('0x1b')](util[_0xcbfc('0x2')](_0xcbfc('0x4c'),_0x99068f[_0xcbfc('0x14')]),_0x99068f);if(agents[_0x99068f[_0xcbfc('0x14')]]&&agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x1d')]===_0xcbfc('0x1c')){if(_0x99068f['cause']==='21'){agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x1d')]=_0xcbfc('0x4d');agents[_0x99068f['uniqueid']][_0xcbfc('0x16')]=_0xcbfc('0x4d');}utils[_0xcbfc('0x1')](util[_0xcbfc('0x2')](_0xcbfc('0x4e'),_0x99068f[_0xcbfc('0x14')],agents[_0x99068f[_0xcbfc('0x14')]]['membername'],agents[_0x99068f[_0xcbfc('0x14')]]['reason'],agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x16')]));writeDB(agents[_0x99068f[_0xcbfc('0x14')]]);var _0x51019a=unanswered[_0xcbfc('0x4f')](_0x99068f['uniqueid']);if(_0x51019a>-0x1){unanswered[_0xcbfc('0x50')](_0x51019a,0x1);}}if(transfers[_0x99068f[_0xcbfc('0x14')]]){transfers[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0xb')]=!![];transfers[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x31')]=utils[_0xcbfc('0x15')]();transfers[_0x99068f['uniqueid']][_0xcbfc('0x29')]=utils[_0xcbfc('0x32')](transfers[_0x99068f[_0xcbfc('0x14')]]['agentcompleteAt'],transfers[_0x99068f[_0xcbfc('0x14')]]['agentconnectAt']);transfers[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x1d')]=_0xcbfc('0x51');transfers[_0x99068f['uniqueid']][_0xcbfc('0x16')]=_0xcbfc('0x52');utils['info'](util[_0xcbfc('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x99068f[_0xcbfc('0x14')],transfers[_0x99068f['uniqueid']][_0xcbfc('0x3')],transfers[_0x99068f[_0xcbfc('0x14')]]['reason'],transfers[_0x99068f[_0xcbfc('0x14')]]['lastevent']));writeDB(transfers[_0x99068f[_0xcbfc('0x14')]],!![]);}if(agents[_0x99068f[_0xcbfc('0x14')]]&&agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x2a')]){agents[_0x99068f['uniqueid']][_0xcbfc('0xb')]=!![];agents[_0x99068f['uniqueid']][_0xcbfc('0x31')]=utils[_0xcbfc('0x15')]();agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x29')]=utils[_0xcbfc('0x32')](agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x31')],agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x2a')]);agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x1d')]=agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x37')]?_0xcbfc('0x37'):_0xcbfc('0x51');agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x16')]='complete';utils[_0xcbfc('0x1')](util['format'](_0xcbfc('0x4e'),_0x99068f['uniqueid'],agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x3')],agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x1d')],agents[_0x99068f[_0xcbfc('0x14')]][_0xcbfc('0x16')]));writeDB(agents[_0x99068f[_0xcbfc('0x14')]]);}}catch(_0x4f38cb){utils[_0xcbfc('0x21')](util['format'](_0xcbfc('0x4c'),_0x99068f[_0xcbfc('0x14')]),_0x4f38cb);}}; \ No newline at end of file +var _0xeb74=['timeout','reason','holdtime','ringtime','talktime','push','error','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','calleridnum','calleridname','ATTENDED','transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','util','./utils','info','format','uniqueid','channel','queue','membername','interface','connectedlinenum','getVoiceQueueByName','type','agentacw','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb74,0xe3));var _0x4eb7=function(_0x28a63c,_0x3c8846){_0x28a63c=_0x28a63c-0x0;var _0x4ca2d5=_0xeb74[_0x28a63c];return _0x4ca2d5;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var utils=require(_0x4eb7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x9b674c,_0x2b5a60){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x9b674c[_0x4eb7('0x5')],_0x9b674c[_0x4eb7('0x6')],_0x9b674c[_0x4eb7('0x7')],_0x9b674c[_0x4eb7('0x8')],_0x9b674c[_0x4eb7('0x9')],_0x9b674c['calleridnum'],_0x9b674c[_0x4eb7('0xa')],_0x9b674c['lastevent']));if(_0x9b674c[_0x4eb7('0x7')]){utils[_0x4eb7('0xb')](_0x9b674c['queue'])['then'](function(_0xe07330){if(_0xe07330){_0x9b674c[_0x4eb7('0xc')]=_0xe07330['type'];_0x9b674c[_0x4eb7('0xd')]=_0x9b674c['agentcomplete']?_0xe07330[_0x4eb7('0xe')]:![];_0x9b674c[_0x4eb7('0xf')]=_0x9b674c[_0x4eb7('0xd')]?_0xe07330['acwTimeout']:0x0;}utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);});}else{utils[_0x4eb7('0x10')](_0x4eb7('0x11'),_0x9b674c);}if(_0x2b5a60){delete transfers[_0x9b674c[_0x4eb7('0x5')]];}else{delete agents[_0x9b674c[_0x4eb7('0x12')]];}}exports[_0x4eb7('0x13')]=function(_0x4c27a4){try{utils['debug'](util['format'](_0x4eb7('0x14'),_0x4c27a4['uniqueid']),_0x4c27a4);agents[_0x4c27a4[_0x4eb7('0x12')]]=_0x4c27a4;agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x18');agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0xa')]=null;agents[_0x4c27a4[_0x4eb7('0x12')]]['connectedlinename']=null;utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x19'),_0x4c27a4[_0x4eb7('0x5')],agents[_0x4c27a4[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x4c27a4[_0x4eb7('0x12')]));}catch(_0x16c024){utils['error'](util[_0x4eb7('0x4')](_0x4eb7('0x14'),_0x4c27a4[_0x4eb7('0x5')]),_0x16c024);}};exports[_0x4eb7('0x1a')]=function(_0x32f0f5){try{if(!_[_0x4eb7('0x1b')](agents[_0x32f0f5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x32f0f5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x1d'),_0x32f0f5[_0x4eb7('0x5')],agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x32f0f5[_0x4eb7('0x12')]));agents[_0x32f0f5['destuniqueid']][_0x4eb7('0x1a')]=!![];agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x17')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x4eb7('0x1f');agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0x32f0f5[_0x4eb7('0x22')]?parseInt(_0x32f0f5[_0x4eb7('0x22')])/0x3e8:0x0;agents[_0x32f0f5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=0x0;unanswered[_0x4eb7('0x24')](_0x32f0f5[_0x4eb7('0x12')]);}}catch(_0x33a2c1){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x1c'),_0x32f0f5[_0x4eb7('0x5')]),_0x33a2c1);}};exports['queuecallerabandon']=function(_0x34515c){try{_['forIn'](agents,function(_0x446872,_0x13f71a){if(_0x446872[_0x4eb7('0x5')]==_0x34515c[_0x4eb7('0x5')]&&!_[_0x4eb7('0x26')](unanswered,_0x446872[_0x4eb7('0x12')])){utils[_0x4eb7('0x27')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x34515c);utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x29'),_0x34515c[_0x4eb7('0x5')],_0x446872['membername'],_0x446872['destuniqueid']));_0x446872[_0x4eb7('0x1a')]=!![];_0x446872[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x446872[_0x4eb7('0x17')]='abandoned';_0x446872[_0x4eb7('0x20')]=_0x4eb7('0x2a');_0x446872[_0x4eb7('0x21')]=_0x34515c[_0x4eb7('0x21')];_0x446872[_0x4eb7('0x23')]=0x0;writeDB(_0x446872);}});}catch(_0x5ab58d){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x28'),_0x34515c['uniqueid']),_0x5ab58d);}};exports[_0x4eb7('0x2b')]=function(_0xe1cc8f){try{if(agents[_0xe1cc8f[_0x4eb7('0x12')]]){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentconnect]',_0xe1cc8f[_0x4eb7('0x5')]),_0xe1cc8f);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x2c'),_0xe1cc8f['uniqueid'],agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0xe1cc8f[_0x4eb7('0x12')]));agents[_0xe1cc8f[_0x4eb7('0x12')]]['agentconnectAt']=utils['now']();agents[_0xe1cc8f['destuniqueid']][_0x4eb7('0xa')]=_0xe1cc8f[_0x4eb7('0xa')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x2d')]=_0xe1cc8f[_0x4eb7('0x2d')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];agents[_0xe1cc8f[_0x4eb7('0x12')]][_0x4eb7('0x17')]='connect';_[_0x4eb7('0x2e')](agents,function(_0x38218f,_0xe04d76){if(_0x38218f[_0x4eb7('0x12')]!=_0xe1cc8f[_0x4eb7('0x12')]&&_0x38218f[_0x4eb7('0x5')]==_0xe1cc8f[_0x4eb7('0x5')]){_0x38218f[_0x4eb7('0x23')]=0x0;_0x38218f[_0x4eb7('0x21')]=_0xe1cc8f[_0x4eb7('0x22')];_0x38218f[_0x4eb7('0x1a')]=!![];_0x38218f[_0x4eb7('0x1e')]=utils[_0x4eb7('0x16')]();_0x38218f[_0x4eb7('0x17')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x20')]=_0x4eb7('0x2f');_0x38218f[_0x4eb7('0x30')]=_0xe1cc8f[_0x4eb7('0x12')];_0x38218f[_0x4eb7('0x31')]=_0xe1cc8f['membername'];writeDB(_0x38218f);}});}}catch(_0x2fd5c2){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x32'),_0xe1cc8f[_0x4eb7('0x5')]),_0x2fd5c2);}};exports[_0x4eb7('0x33')]=function(_0x3cd9e5){try{if(!_[_0x4eb7('0x1b')](agents[_0x3cd9e5[_0x4eb7('0x12')]])){utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]',_0x3cd9e5[_0x4eb7('0x5')]),_0x3cd9e5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3cd9e5[_0x4eb7('0x5')],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x8')],_0x3cd9e5[_0x4eb7('0x12')]));agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x33')]=!![];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x23')]=utils[_0x4eb7('0x35')](agents[_0x3cd9e5['destuniqueid']]['agentcompleteAt'],agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x36')]);agents[_0x3cd9e5[_0x4eb7('0x12')]][_0x4eb7('0x20')]=_0x3cd9e5[_0x4eb7('0x20')];agents[_0x3cd9e5['destuniqueid']][_0x4eb7('0x17')]=_0x4eb7('0x37');writeDB(agents[_0x3cd9e5['destuniqueid']]);}}catch(_0x22e09c){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x38'),_0x3cd9e5[_0x4eb7('0x5')]),_0x22e09c);}};exports[_0x4eb7('0x39')]=function(_0x5774d5){try{if(!_[_0x4eb7('0x1b')](agents[_0x5774d5['transfereruniqueid']])){utils['debug'](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x5774d5);utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x3b'),_0x5774d5[_0x4eb7('0x5')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x8')],agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x5')]));agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3d')]=!![];agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x3e')]=_0x4eb7('0x3f');agents[_0x5774d5[_0x4eb7('0x3c')]][_0x4eb7('0x40')]=_0x5774d5[_0x4eb7('0x41')];agents[_0x5774d5[_0x4eb7('0x3c')]]['transferuniqueid']=agents[_0x5774d5[_0x4eb7('0x3c')]]['uniqueid'];}}catch(_0x4db5f7){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x3a'),_0x5774d5[_0x4eb7('0x5')]),_0x4db5f7);}};exports[_0x4eb7('0x42')]=function(_0x553736){try{utils['debug'](util[_0x4eb7('0x4')]('[%s][agents][attendedtransfer]',_0x553736[_0x4eb7('0x43')]),_0x553736);if(_0x553736[_0x4eb7('0x43')]==_0x553736[_0x4eb7('0x44')]){if(!_[_0x4eb7('0x1b')](agents[_0x553736['secondtransfereruniqueid']])){utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736[_0x4eb7('0x43')],agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x8')]));agents[_0x553736[_0x4eb7('0x46')]]['transfer']=!![];agents[_0x553736[_0x4eb7('0x46')]][_0x4eb7('0x3e')]='ATTENDED';agents[_0x553736[_0x4eb7('0x46')]]['transferexten']=_0x553736[_0x4eb7('0x47')];agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736[_0x4eb7('0x43')];}if(_0x553736[_0x4eb7('0x49')]&&agents[_0x553736[_0x4eb7('0x49')]]){agents[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4a')]=0x1;transfers[_0x553736['transfereeuniqueid']]=_['clone'](agents[_0x553736[_0x4eb7('0x49')]]);transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4b')]=agents[_0x553736[_0x4eb7('0x46')]]['calleridnum'];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x4c')]=agents[_0x553736['secondtransfereruniqueid']][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x15')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x49')]][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x553736[_0x4eb7('0x49')]]['agententerreason']=0x2;}}else if(_0x553736[_0x4eb7('0x46')]==_0x553736['secondtransfererlinkedid']){if(!_[_0x4eb7('0x1b')](agents[_0x553736['origtransfereruniqueid']])){utils['info'](util[_0x4eb7('0x4')](_0x4eb7('0x45'),_0x553736['origtransfereruniqueid'],agents[_0x553736[_0x4eb7('0x43')]]['membername']));agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x3d')]=!![];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x3e')]=_0x4eb7('0x4d');agents[_0x553736['origtransfereruniqueid']]['transferexten']=_0x553736['secondtransfererexten'];agents[_0x553736['origtransfereruniqueid']][_0x4eb7('0x48')]=_0x553736['secondtransfereruniqueid'];}if(_0x553736[_0x4eb7('0x4e')]&&agents[_0x553736[_0x4eb7('0x4e')]]){agents[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4a')]=0x1;transfers[_0x553736[_0x4eb7('0x4e')]]=_[_0x4eb7('0x4f')](agents[_0x553736[_0x4eb7('0x4e')]]);transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x4b')]=agents[_0x553736['origtransfereruniqueid']]['calleridnum'];transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x4c')]=agents[_0x553736[_0x4eb7('0x43')]][_0x4eb7('0x4c')];transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x15')]=utils['now']();transfers[_0x553736['transfertargetuniqueid']][_0x4eb7('0x36')]=utils[_0x4eb7('0x16')]();transfers[_0x553736[_0x4eb7('0x4e')]][_0x4eb7('0x21')]=0x0;transfers[_0x553736[_0x4eb7('0x4e')]]['agententerreason']=0x2;}}}catch(_0x439861){utils[_0x4eb7('0x25')](util[_0x4eb7('0x4')](_0x4eb7('0x50'),_0x553736['origtransfereruniqueid']),_0x439861);}};exports['hangup']=function(_0x3bcbd1){try{utils[_0x4eb7('0x27')](util['format'](_0x4eb7('0x51'),_0x3bcbd1['uniqueid']),_0x3bcbd1);if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]===_0x4eb7('0x1f')){if(_0x3bcbd1['cause']==='21'){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=_0x4eb7('0x52');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x52');}utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);var _0x31e6d2=unanswered[_0x4eb7('0x54')](_0x3bcbd1['uniqueid']);if(_0x31e6d2>-0x1){unanswered['splice'](_0x31e6d2,0x1);}}if(transfers[_0x3bcbd1[_0x4eb7('0x5')]]){transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x23')]=utils['diffTime'](transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],transfers[_0x3bcbd1[_0x4eb7('0x5')]]['agentconnectAt']);transfers[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')]=_0x4eb7('0x55');transfers[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']='complete';utils[_0x4eb7('0x3')](util[_0x4eb7('0x4')](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')],transfers[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]));writeDB(transfers[_0x3bcbd1[_0x4eb7('0x5')]],!![]);}if(agents[_0x3bcbd1[_0x4eb7('0x5')]]&&agents[_0x3bcbd1['uniqueid']]['agentconnectAt']){agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x33')]=!![];agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')]=utils[_0x4eb7('0x16')]();agents[_0x3bcbd1[_0x4eb7('0x5')]]['talktime']=utils['diffTime'](agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x34')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x36')]);agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x20')]=agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x3d')]?_0x4eb7('0x3d'):_0x4eb7('0x55');agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x17')]=_0x4eb7('0x37');utils[_0x4eb7('0x3')](util['format'](_0x4eb7('0x53'),_0x3bcbd1[_0x4eb7('0x5')],agents[_0x3bcbd1[_0x4eb7('0x5')]][_0x4eb7('0x8')],agents[_0x3bcbd1['uniqueid']][_0x4eb7('0x20')],agents[_0x3bcbd1[_0x4eb7('0x5')]]['lastevent']));writeDB(agents[_0x3bcbd1[_0x4eb7('0x5')]]);}}catch(_0x2448a1){utils[_0x4eb7('0x25')](util['format'](_0x4eb7('0x51'),_0x3bcbd1[_0x4eb7('0x5')]),_0x2448a1);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ced1f2b..2bd3daa 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 _0xefdb=['xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','format','linkedid','OutgoingSpoolFailed','info','context','exten','error','newstate','debug','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable'];(function(_0x663b00,_0x3a8b3e){var _0x2726a1=function(_0x2202a8){while(--_0x2202a8){_0x663b00['push'](_0x663b00['shift']());}};_0x2726a1(++_0x3a8b3e);}(_0xefdb,0x1c0));var _0xbefd=function(_0x561d44,_0x43907e){_0x561d44=_0x561d44-0x0;var _0x5c253e=_0xefdb[_0x561d44];return _0x5c253e;};'use strict';var _=require(_0xbefd('0x0'));var util=require(_0xbefd('0x1'));var utils=require(_0xbefd('0x2'));var dispositions=[_0xbefd('0x3'),_0xbefd('0x4'),_0xbefd('0x4'),_0xbefd('0x3'),_0xbefd('0x3'),_0xbefd('0x3'),_0xbefd('0x5'),'BUSY',_0xbefd('0x4'),_0xbefd('0x4'),_0xbefd('0x4')];var channels={};function writeDB(_0x6f6a84){utils['info'](util['format'](_0xbefd('0x6'),_0x6f6a84[_0xbefd('0x7')],_0x6f6a84[_0xbefd('0x8')],_0x6f6a84[_0xbefd('0x9')],_0x6f6a84[_0xbefd('0xa')],_0x6f6a84[_0xbefd('0xb')],_0x6f6a84[_0xbefd('0xc')],_0x6f6a84['connectedlinenum'],_0x6f6a84[_0xbefd('0xd')]));if(_0x6f6a84[_0xbefd('0xe')]){utils[_0xbefd('0xf')](_0x6f6a84['accountcode'])[_0xbefd('0x10')](function(_0x5d0e71){if(_0x5d0e71){_0x6f6a84[_0xbefd('0x11')]=_0x5d0e71['id'];}utils[_0xbefd('0x12')](_0xbefd('0x13'),_0x6f6a84);});}else{utils['request'](_0xbefd('0x13'),_0x6f6a84);}if(channels[_0x6f6a84[_0xbefd('0x7')]]){delete channels[_0x6f6a84['uniqueid']];}}exports['newchannel']=function(_0x5d9f4d){try{utils['debug'](util[_0xbefd('0x14')]('[%s][calls][newchannel]',_0x5d9f4d[_0xbefd('0x7')]),_0x5d9f4d);if(_0x5d9f4d[_0xbefd('0x7')]==_0x5d9f4d[_0xbefd('0x15')]&&_0x5d9f4d[_0xbefd('0x8')]!=_0xbefd('0x16')){utils[_0xbefd('0x17')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5d9f4d[_0xbefd('0x7')],_0x5d9f4d[_0xbefd('0x18')],_0x5d9f4d['exten']));channels[_0x5d9f4d['uniqueid']]={'uniqueid':_0x5d9f4d[_0xbefd('0x7')],'accountcode':_0x5d9f4d['accountcode'],'source':_0x5d9f4d[_0xbefd('0xc')],'destination':_0x5d9f4d[_0xbefd('0x19')],'destinationcontext':_0x5d9f4d[_0xbefd('0x18')],'channel':_0x5d9f4d[_0xbefd('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbefd('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x61a3d){utils[_0xbefd('0x1a')](util[_0xbefd('0x14')]('[%s][calls][newchannel]',_0x5d9f4d[_0xbefd('0x7')]),_0x61a3d);}};exports[_0xbefd('0x1b')]=function(_0x2f266d){try{utils[_0xbefd('0x1c')](util['format'](_0xbefd('0x1d'),_0x2f266d['uniqueid']),_0x2f266d);if(!_[_0xbefd('0x1e')](channels[_0x2f266d[_0xbefd('0x7')]])&&_0x2f266d['channelstate']==0x6){utils['info'](util['format'](_0xbefd('0x1f'),_0x2f266d[_0xbefd('0x7')],_0x2f266d[_0xbefd('0x18')],_0x2f266d['channel']));if(_['isNil'](channels[_0x2f266d[_0xbefd('0x7')]][_0xbefd('0x20')])){channels[_0x2f266d['uniqueid']][_0xbefd('0x20')]=utils[_0xbefd('0x21')]();}}else if(!_[_0xbefd('0x1e')](channels[_0x2f266d[_0xbefd('0x15')]])&&_0x2f266d[_0xbefd('0x22')]==0x6&&_0x2f266d[_0xbefd('0x18')]!='transfer'){utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x23'),_0x2f266d[_0xbefd('0x7')],_0x2f266d[_0xbefd('0x15')],_0x2f266d['context'],_0x2f266d[_0xbefd('0x8')]));channels[_0x2f266d[_0xbefd('0x15')]][_0xbefd('0xe')]=_0x2f266d[_0xbefd('0xe')];channels[_0x2f266d['linkedid']][_0xbefd('0x24')]=_0x2f266d[_0xbefd('0x8')];if(_[_0xbefd('0x1e')](channels[_0x2f266d[_0xbefd('0x15')]][_0xbefd('0x25')])){channels[_0x2f266d[_0xbefd('0x15')]]['answertime']=utils[_0xbefd('0x21')]();}channels[_0x2f266d[_0xbefd('0x15')]][_0xbefd('0x26')]=dispositions[_[_0xbefd('0x27')](_0x2f266d[_0xbefd('0x22')])]||'ANSWERED';}}catch(_0x35f0d8){utils['error'](util[_0xbefd('0x14')](_0xbefd('0x1d'),_0x2f266d[_0xbefd('0x7')]),_0x35f0d8);}};exports[_0xbefd('0x28')]=function(_0x480477){try{if(!_[_0xbefd('0x1e')](channels[_0x480477['uniqueid']])){utils[_0xbefd('0x1c')](util[_0xbefd('0x14')]('[%s][calls][hangup]',_0x480477['uniqueid']),_0x480477);if(_[_0xbefd('0x1e')](channels[_0x480477['uniqueid']][_0xbefd('0x29')])){channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x29')]=_0x480477['calleridname']+'\x20<'+_0x480477[_0xbefd('0xc')]+'>';}utils[_0xbefd('0x17')](util['format'](_0xbefd('0x2a'),_0x480477['uniqueid'],channels[_0x480477['uniqueid']][_0xbefd('0x29')],_0x480477['cause-txt']));channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x2b')]=utils[_0xbefd('0x21')]();channels[_0x480477[_0xbefd('0x7')]]['duration']=utils[_0xbefd('0x2c')](channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x2b')],channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x2d')]);channels[_0x480477['uniqueid']][_0xbefd('0x2e')]=channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x25')]?utils[_0xbefd('0x2c')](channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x2b')],channels[_0x480477[_0xbefd('0x7')]][_0xbefd('0x25')]):0x0;writeDB(channels[_0x480477[_0xbefd('0x7')]]);}}catch(_0x171d45){utils[_0xbefd('0x1a')](util[_0xbefd('0x14')](_0xbefd('0x2f'),_0x480477['uniqueid']),_0x171d45);}};exports[_0xbefd('0x30')]=function(_0x8e981b){try{if(!_[_0xbefd('0x1e')](channels[_0x8e981b[_0xbefd('0x31')]])){utils[_0xbefd('0x1c')](util[_0xbefd('0x14')](_0xbefd('0x32'),_0x8e981b[_0xbefd('0x33')]),_0x8e981b);if(channels[_0x8e981b[_0xbefd('0x31')]]['channel']==_0x8e981b[_0xbefd('0x34')]){utils[_0xbefd('0x17')](util[_0xbefd('0x14')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x8e981b[_0xbefd('0x33')],_0x8e981b['localtwolinkedid'],_0x8e981b[_0xbefd('0x35')]));channels[_0x8e981b['localtwolinkedid']][_0xbefd('0x24')]=_0x8e981b[_0xbefd('0x35')];channels[_0x8e981b[_0xbefd('0x31')]][_0xbefd('0x36')]=_0xbefd('0x37');}else if(channels[_0x8e981b[_0xbefd('0x31')]][_0xbefd('0x8')]=_0x8e981b[_0xbefd('0x38')]){utils[_0xbefd('0x17')](util['format'](_0xbefd('0x39'),_0x8e981b['origtransfereruniqueid'],_0x8e981b[_0xbefd('0x31')],_0x8e981b[_0xbefd('0x3a')]));channels[_0x8e981b['localtwolinkedid']][_0xbefd('0x24')]=_0x8e981b['origtransfererchannel'];channels[_0x8e981b[_0xbefd('0x31')]]['userfield']='_attended';}}}catch(_0x27a926){utils[_0xbefd('0x1a')](util[_0xbefd('0x14')](_0xbefd('0x32'),_0x8e981b[_0xbefd('0x33')]),_0x27a926);}};exports[_0xbefd('0x3b')]=function(_0x4230a6){try{if(!_['isNil'](channels[_0x4230a6[_0xbefd('0x7')]])){utils[_0xbefd('0x1c')](util['format']('[%s][calls][musiconholdstart]',_0x4230a6[_0xbefd('0x7')]),_0x4230a6);channels[_0x4230a6[_0xbefd('0x7')]][_0xbefd('0x3c')]=utils[_0xbefd('0x21')]();utils['info'](util[_0xbefd('0x14')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4230a6['uniqueid'],channels[_0x4230a6[_0xbefd('0x7')]][_0xbefd('0x3c')]));}}catch(_0x12c572){utils['error'](util[_0xbefd('0x14')](_0xbefd('0x3d'),_0x4230a6[_0xbefd('0x7')]),_0x12c572);}};exports[_0xbefd('0x3e')]=function(_0x31b6a9){try{if(!_[_0xbefd('0x1e')](channels[_0x31b6a9[_0xbefd('0x7')]])){utils[_0xbefd('0x1c')](util[_0xbefd('0x14')]('[%s][calls][musiconholdstop]',_0x31b6a9[_0xbefd('0x7')]),_0x31b6a9);if(!_[_0xbefd('0x1e')](channels[_0x31b6a9['uniqueid']][_0xbefd('0x3c')])){channels[_0x31b6a9[_0xbefd('0x7')]][_0xbefd('0x3f')]+=utils[_0xbefd('0x2c')](utils[_0xbefd('0x21')](),channels[_0x31b6a9[_0xbefd('0x7')]][_0xbefd('0x3c')]);utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x40'),_0x31b6a9[_0xbefd('0x7')],channels[_0x31b6a9[_0xbefd('0x7')]][_0xbefd('0x3f')]));delete channels[_0x31b6a9[_0xbefd('0x7')]][_0xbefd('0x3c')];}}}catch(_0x101ea8){utils[_0xbefd('0x1a')](util[_0xbefd('0x14')](_0xbefd('0x41'),_0x31b6a9[_0xbefd('0x7')]),_0x101ea8);}};exports[_0xbefd('0x42')]=function(_0x5b750d){try{if(!_[_0xbefd('0x1e')](channels[_0x5b750d[_0xbefd('0x7')]])){utils[_0xbefd('0x1c')](util['format'](_0xbefd('0x43'),_0x5b750d['uniqueid']),_0x5b750d);if(!_[_0xbefd('0x1e')](_0x5b750d['variable']['xmd-originatecalleridnum'])){utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x44'),_0x5b750d[_0xbefd('0x7')],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x46')]=_0x5b750d['value'];}if(!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x48')])){utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x49'),_0x5b750d[_0xbefd('0x7')],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x4a')]=_0x5b750d[_0xbefd('0x45')];channels[_0x5b750d['uniqueid']][_0xbefd('0x29')]='\x22'+_0x5b750d[_0xbefd('0x45')]+'\x22\x20<'+_0x5b750d[_0xbefd('0x45')]+'>';}if(!_[_0xbefd('0x1e')](_0x5b750d['variable'][_0xbefd('0x4b')])||!_['isNil'](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x4c')])){utils['info'](util[_0xbefd('0x14')](_0xbefd('0x4d'),_0x5b750d[_0xbefd('0x7')],!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x4b')])?_0xbefd('0x4b'):'xmd-callerid',_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x29')]=_0x5b750d['value'];}if(!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x4e')])||!_[_0xbefd('0x1e')](_0x5b750d['variable']['xmcs-queue'])){utils['info'](util[_0xbefd('0x14')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5b750d['uniqueid'],!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x4e')])?'xmd-queue':'xmcs-queue',_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x4f')]=_0xbefd('0x50');channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x51')]=_0x5b750d['value'];channels[_0x5b750d['uniqueid']]['queue']=!![];}if(!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x52')])){utils[_0xbefd('0x17')](util[_0xbefd('0x14')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x5b750d[_0xbefd('0x7')],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]]['ContactId']=_0x5b750d[_0xbefd('0x45')];}if(!_[_0xbefd('0x1e')](_0x5b750d[_0xbefd('0x47')][_0xbefd('0x53')])){utils['info'](util[_0xbefd('0x14')](_0xbefd('0x54'),_0x5b750d['uniqueid'],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]]['type']=_0x5b750d[_0xbefd('0x45')];}if(!_['isNil'](_0x5b750d[_0xbefd('0x47')]['outboundrouteid'])){utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x55'),_0x5b750d['uniqueid'],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d[_0xbefd('0x7')]][_0xbefd('0x56')]=_0x5b750d[_0xbefd('0x45')];}if(!_[_0xbefd('0x1e')](_0x5b750d['variable'][_0xbefd('0x57')])){utils['info'](util['format'](_0xbefd('0x58'),_0x5b750d[_0xbefd('0x7')],_0x5b750d[_0xbefd('0x45')]));channels[_0x5b750d['uniqueid']][_0xbefd('0x57')]=_0x5b750d[_0xbefd('0x45')];}}}catch(_0x2b6f2d){utils[_0xbefd('0x1a')](util['format']('[%s][calls][varset]',_0x5b750d[_0xbefd('0x7')]),_0x2b6f2d);}};exports['newexten']=function(_0x50ca17){try{if(!_['isNil'](channels[_0x50ca17[_0xbefd('0x7')]])){utils[_0xbefd('0x1c')](util['format'](_0xbefd('0x59'),_0x50ca17['uniqueid']),_0x50ca17);utils[_0xbefd('0x17')](util[_0xbefd('0x14')](_0xbefd('0x5a'),_0x50ca17['uniqueid'],_0x50ca17[_0xbefd('0x5b')],_0x50ca17['appdata']));if(_0x50ca17[_0xbefd('0x5b')][_0xbefd('0x5c')]()==_0xbefd('0x5d')&&_[_0xbefd('0x5e')](_0x50ca17[_0xbefd('0x5f')][_0xbefd('0x5c')](),_0xbefd('0x60'))){var _0x43c8ec=_0x50ca17['appdata'][_0xbefd('0x61')]('=');var _0x4d1922=_0x43c8ec[0x0][_0xbefd('0x62')](_0x43c8ec[0x0]['lastIndexOf']('(')+0x1,_0x43c8ec[0x0][_0xbefd('0x63')](')'));var _0x11ac6c=_0x43c8ec[0x1];channels[_0x50ca17['uniqueid']][_0x4d1922]=_0x11ac6c;}if(!_[_0xbefd('0x64')]([_0xbefd('0x28'),_0xbefd('0x65'),_0xbefd('0x66'),_0xbefd('0x5d'),_0xbefd('0x67')],_0x50ca17[_0xbefd('0x5b')]['toLowerCase']())){channels[_0x50ca17['uniqueid']][_0xbefd('0x4f')]=_0x50ca17[_0xbefd('0x5b')];channels[_0x50ca17['uniqueid']][_0xbefd('0x51')]=_0x50ca17[_0xbefd('0x5f')];}}}catch(_0x787255){utils[_0xbefd('0x1a')](util[_0xbefd('0x14')](_0xbefd('0x59'),_0x50ca17[_0xbefd('0x7')]),_0x787255);}}; \ No newline at end of file +var _0x0171=['linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','lastapplication','Queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','uniqueid','channel','membername','calleridnum','connectedlinenum','getUserByInternal','accountcode','UserId','CreateVoiceCallReport','request','newchannel','debug','format','[%s][calls][newchannel]'];(function(_0x508d6f,_0x21838f){var _0xf51bd5=function(_0x1158ae){while(--_0x1158ae){_0x508d6f['push'](_0x508d6f['shift']());}};_0xf51bd5(++_0x21838f);}(_0x0171,0x1df));var _0x1017=function(_0x3fc744,_0x54c157){_0x3fc744=_0x3fc744-0x0;var _0x325160=_0x0171[_0x3fc744];return _0x325160;};'use strict';var _=require('lodash');var util=require(_0x1017('0x0'));var utils=require(_0x1017('0x1'));var dispositions=[_0x1017('0x2'),_0x1017('0x3'),_0x1017('0x3'),_0x1017('0x2'),_0x1017('0x2'),_0x1017('0x2'),_0x1017('0x4'),_0x1017('0x5'),_0x1017('0x3'),_0x1017('0x3'),_0x1017('0x3')];var channels={};function writeDB(_0x2145f2){utils[_0x1017('0x6')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2145f2[_0x1017('0x7')],_0x2145f2[_0x1017('0x8')],_0x2145f2['queue'],_0x2145f2[_0x1017('0x9')],_0x2145f2['interface'],_0x2145f2[_0x1017('0xa')],_0x2145f2[_0x1017('0xb')],_0x2145f2['lastevent']));if(_0x2145f2['accountcode']){utils[_0x1017('0xc')](_0x2145f2[_0x1017('0xd')])['then'](function(_0x4170bd){if(_0x4170bd){_0x2145f2[_0x1017('0xe')]=_0x4170bd['id'];}utils['request'](_0x1017('0xf'),_0x2145f2);});}else{utils[_0x1017('0x10')]('CreateVoiceCallReport',_0x2145f2);}if(channels[_0x2145f2[_0x1017('0x7')]]){delete channels[_0x2145f2[_0x1017('0x7')]];}}exports[_0x1017('0x11')]=function(_0x2a77df){try{utils[_0x1017('0x12')](util[_0x1017('0x13')](_0x1017('0x14'),_0x2a77df['uniqueid']),_0x2a77df);if(_0x2a77df[_0x1017('0x7')]==_0x2a77df[_0x1017('0x15')]&&_0x2a77df[_0x1017('0x8')]!=_0x1017('0x16')){utils[_0x1017('0x6')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2a77df[_0x1017('0x7')],_0x2a77df[_0x1017('0x17')],_0x2a77df[_0x1017('0x18')]));channels[_0x2a77df[_0x1017('0x7')]]={'uniqueid':_0x2a77df['uniqueid'],'accountcode':_0x2a77df['accountcode'],'source':_0x2a77df[_0x1017('0xa')],'destination':_0x2a77df[_0x1017('0x18')],'destinationcontext':_0x2a77df[_0x1017('0x17')],'channel':_0x2a77df[_0x1017('0x8')],'starttime':utils[_0x1017('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1017('0x2'),'amaflags':_0x1017('0x1a')};}}catch(_0x3db64a){utils[_0x1017('0x1b')](util[_0x1017('0x13')](_0x1017('0x14'),_0x2a77df['uniqueid']),_0x3db64a);}};exports[_0x1017('0x1c')]=function(_0x50f6f9){try{utils[_0x1017('0x12')](util['format'](_0x1017('0x1d'),_0x50f6f9[_0x1017('0x7')]),_0x50f6f9);if(!_[_0x1017('0x1e')](channels[_0x50f6f9[_0x1017('0x7')]])&&_0x50f6f9[_0x1017('0x1f')]==0x6){utils[_0x1017('0x6')](util[_0x1017('0x13')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x50f6f9['uniqueid'],_0x50f6f9[_0x1017('0x17')],_0x50f6f9[_0x1017('0x8')]));if(_[_0x1017('0x1e')](channels[_0x50f6f9[_0x1017('0x7')]][_0x1017('0x20')])){channels[_0x50f6f9[_0x1017('0x7')]]['systemanswertime']=utils[_0x1017('0x19')]();}}else if(!_[_0x1017('0x1e')](channels[_0x50f6f9[_0x1017('0x15')]])&&_0x50f6f9[_0x1017('0x1f')]==0x6&&_0x50f6f9[_0x1017('0x17')]!=_0x1017('0x21')){utils[_0x1017('0x6')](util[_0x1017('0x13')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x50f6f9[_0x1017('0x7')],_0x50f6f9[_0x1017('0x15')],_0x50f6f9['context'],_0x50f6f9[_0x1017('0x8')]));channels[_0x50f6f9[_0x1017('0x15')]][_0x1017('0xd')]=_0x50f6f9[_0x1017('0xd')];channels[_0x50f6f9[_0x1017('0x15')]][_0x1017('0x22')]=_0x50f6f9['channel'];if(_[_0x1017('0x1e')](channels[_0x50f6f9[_0x1017('0x15')]][_0x1017('0x23')])){channels[_0x50f6f9[_0x1017('0x15')]][_0x1017('0x23')]=utils[_0x1017('0x19')]();}channels[_0x50f6f9['linkedid']]['disposition']=dispositions[_[_0x1017('0x24')](_0x50f6f9['channelstate'])]||_0x1017('0x4');}}catch(_0x54e850){utils['error'](util['format'](_0x1017('0x1d'),_0x50f6f9[_0x1017('0x7')]),_0x54e850);}};exports[_0x1017('0x25')]=function(_0xf41166){try{if(!_[_0x1017('0x1e')](channels[_0xf41166[_0x1017('0x7')]])){utils[_0x1017('0x12')](util['format'](_0x1017('0x26'),_0xf41166[_0x1017('0x7')]),_0xf41166);if(_['isNil'](channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x27')])){channels[_0xf41166[_0x1017('0x7')]]['callerid']=_0xf41166[_0x1017('0x28')]+'\x20<'+_0xf41166[_0x1017('0xa')]+'>';}utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x29'),_0xf41166[_0x1017('0x7')],channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x27')],_0xf41166[_0x1017('0x2a')]));channels[_0xf41166[_0x1017('0x7')]]['endtime']=utils[_0x1017('0x19')]();channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x2b')]=utils[_0x1017('0x2c')](channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x2d')],channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x2e')]);channels[_0xf41166[_0x1017('0x7')]]['billableseconds']=channels[_0xf41166['uniqueid']][_0x1017('0x23')]?utils['diffTime'](channels[_0xf41166['uniqueid']][_0x1017('0x2d')],channels[_0xf41166[_0x1017('0x7')]][_0x1017('0x23')]):0x0;writeDB(channels[_0xf41166[_0x1017('0x7')]]);}}catch(_0x5c549d){utils[_0x1017('0x1b')](util[_0x1017('0x13')]('[%s][calls][hangup]',_0xf41166[_0x1017('0x7')]),_0x5c549d);}};exports[_0x1017('0x2f')]=function(_0x427ffb){try{if(!_[_0x1017('0x1e')](channels[_0x427ffb[_0x1017('0x30')]])){utils[_0x1017('0x12')](util[_0x1017('0x13')](_0x1017('0x31'),_0x427ffb['origtransfereruniqueid']),_0x427ffb);if(channels[_0x427ffb[_0x1017('0x30')]]['channel']==_0x427ffb[_0x1017('0x32')]){utils[_0x1017('0x6')](util[_0x1017('0x13')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x427ffb[_0x1017('0x33')],_0x427ffb[_0x1017('0x30')],_0x427ffb[_0x1017('0x34')]));channels[_0x427ffb['localtwolinkedid']]['destinationchannel']=_0x427ffb[_0x1017('0x34')];channels[_0x427ffb[_0x1017('0x30')]]['userfield']=_0x1017('0x35');}else if(channels[_0x427ffb[_0x1017('0x30')]][_0x1017('0x8')]=_0x427ffb[_0x1017('0x36')]){utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x37'),_0x427ffb[_0x1017('0x33')],_0x427ffb[_0x1017('0x30')],_0x427ffb[_0x1017('0x38')]));channels[_0x427ffb['localtwolinkedid']][_0x1017('0x22')]=_0x427ffb[_0x1017('0x38')];channels[_0x427ffb[_0x1017('0x30')]][_0x1017('0x39')]=_0x1017('0x35');}}}catch(_0x464a2b){utils['error'](util[_0x1017('0x13')](_0x1017('0x31'),_0x427ffb[_0x1017('0x33')]),_0x464a2b);}};exports['musiconholdstart']=function(_0x739923){try{if(!_['isNil'](channels[_0x739923[_0x1017('0x7')]])){utils[_0x1017('0x12')](util[_0x1017('0x13')](_0x1017('0x3a'),_0x739923['uniqueid']),_0x739923);channels[_0x739923[_0x1017('0x7')]][_0x1017('0x3b')]=utils[_0x1017('0x19')]();utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x3c'),_0x739923['uniqueid'],channels[_0x739923[_0x1017('0x7')]][_0x1017('0x3b')]));}}catch(_0x1fe20b){utils[_0x1017('0x1b')](util[_0x1017('0x13')]('[%s][calls][musiconholdstart]',_0x739923['uniqueid']),_0x1fe20b);}};exports[_0x1017('0x3d')]=function(_0x167947){try{if(!_[_0x1017('0x1e')](channels[_0x167947['uniqueid']])){utils['debug'](util[_0x1017('0x13')]('[%s][calls][musiconholdstop]',_0x167947['uniqueid']),_0x167947);if(!_['isNil'](channels[_0x167947[_0x1017('0x7')]]['musiconholdstartAt'])){channels[_0x167947[_0x1017('0x7')]][_0x1017('0x3e')]+=utils[_0x1017('0x2c')](utils[_0x1017('0x19')](),channels[_0x167947[_0x1017('0x7')]][_0x1017('0x3b')]);utils[_0x1017('0x6')](util['format'](_0x1017('0x3f'),_0x167947['uniqueid'],channels[_0x167947[_0x1017('0x7')]]['mohtime']));delete channels[_0x167947[_0x1017('0x7')]][_0x1017('0x3b')];}}}catch(_0x3a2144){utils['error'](util['format'](_0x1017('0x40'),_0x167947[_0x1017('0x7')]),_0x3a2144);}};exports[_0x1017('0x41')]=function(_0x183a8c){try{if(!_[_0x1017('0x1e')](channels[_0x183a8c[_0x1017('0x7')]])){utils[_0x1017('0x12')](util['format'](_0x1017('0x42'),_0x183a8c['uniqueid']),_0x183a8c);if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')][_0x1017('0x44')])){utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x45'),_0x183a8c[_0x1017('0x7')],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]]['source']=_0x183a8c[_0x1017('0x46')];}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')][_0x1017('0x47')])){utils['info'](util['format'](_0x1017('0x48'),_0x183a8c['uniqueid'],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]][_0x1017('0x49')]=_0x183a8c['value'];channels[_0x183a8c['uniqueid']]['callerid']='\x22'+_0x183a8c[_0x1017('0x46')]+_0x1017('0x4a')+_0x183a8c[_0x1017('0x46')]+'>';}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')]['xmd-callerid-preview'])||!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')]['xmd-callerid'])){utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x4b'),_0x183a8c[_0x1017('0x7')],!_[_0x1017('0x1e')](_0x183a8c['variable'][_0x1017('0x4c')])?'xmd-callerid-preview':'xmd-callerid',_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c['uniqueid']][_0x1017('0x27')]=_0x183a8c[_0x1017('0x46')];}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')][_0x1017('0x4d')])||!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')]['xmcs-queue'])){utils[_0x1017('0x6')](util['format'](_0x1017('0x4b'),_0x183a8c[_0x1017('0x7')],!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')][_0x1017('0x4d')])?'xmd-queue':'xmcs-queue',_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]][_0x1017('0x4e')]=_0x1017('0x4f');channels[_0x183a8c[_0x1017('0x7')]]['lastdata']=_0x183a8c[_0x1017('0x46')];channels[_0x183a8c[_0x1017('0x7')]]['queue']=!![];}if(!_[_0x1017('0x1e')](_0x183a8c['variable'][_0x1017('0x50')])){utils[_0x1017('0x6')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x183a8c['uniqueid'],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]][_0x1017('0x51')]=_0x183a8c[_0x1017('0x46')];}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')][_0x1017('0x52')])){utils['info'](util['format'](_0x1017('0x53'),_0x183a8c[_0x1017('0x7')],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]]['type']=_0x183a8c[_0x1017('0x46')];}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')]['outboundrouteid'])){utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x54'),_0x183a8c[_0x1017('0x7')],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]][_0x1017('0x55')]=_0x183a8c[_0x1017('0x46')];}if(!_[_0x1017('0x1e')](_0x183a8c[_0x1017('0x43')]['sipcallid'])){utils[_0x1017('0x6')](util['format'](_0x1017('0x56'),_0x183a8c['uniqueid'],_0x183a8c[_0x1017('0x46')]));channels[_0x183a8c[_0x1017('0x7')]]['sipcallid']=_0x183a8c[_0x1017('0x46')];}}}catch(_0x3e42c1){utils[_0x1017('0x1b')](util[_0x1017('0x13')](_0x1017('0x42'),_0x183a8c[_0x1017('0x7')]),_0x3e42c1);}};exports['newexten']=function(_0x998bc0){try{if(!_[_0x1017('0x1e')](channels[_0x998bc0[_0x1017('0x7')]])){utils[_0x1017('0x12')](util[_0x1017('0x13')](_0x1017('0x57'),_0x998bc0[_0x1017('0x7')]),_0x998bc0);utils[_0x1017('0x6')](util[_0x1017('0x13')](_0x1017('0x58'),_0x998bc0[_0x1017('0x7')],_0x998bc0[_0x1017('0x59')],_0x998bc0[_0x1017('0x5a')]));if(_0x998bc0[_0x1017('0x59')][_0x1017('0x5b')]()==_0x1017('0x5c')&&_[_0x1017('0x5d')](_0x998bc0[_0x1017('0x5a')][_0x1017('0x5b')](),'cdr')){var _0x2db48a=_0x998bc0[_0x1017('0x5a')]['split']('=');var _0xbec3fe=_0x2db48a[0x0][_0x1017('0x5e')](_0x2db48a[0x0][_0x1017('0x5f')]('(')+0x1,_0x2db48a[0x0][_0x1017('0x5f')](')'));var _0x558426=_0x2db48a[0x1];channels[_0x998bc0[_0x1017('0x7')]][_0xbec3fe]=_0x558426;}if(!_[_0x1017('0x60')]([_0x1017('0x25'),_0x1017('0x61'),_0x1017('0x62'),_0x1017('0x5c'),_0x1017('0x63')],_0x998bc0['application'][_0x1017('0x5b')]())){channels[_0x998bc0[_0x1017('0x7')]][_0x1017('0x4e')]=_0x998bc0[_0x1017('0x59')];channels[_0x998bc0[_0x1017('0x7')]]['lastdata']=_0x998bc0['appdata'];}}}catch(_0x43c468){utils[_0x1017('0x1b')](util[_0x1017('0x13')](_0x1017('0x57'),_0x998bc0[_0x1017('0x7')]),_0x43c468);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 45d65f2..86ff157 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 _0xe2bb=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x3a676b,_0x297c77){var _0x1aac22=function(_0x5a4731){while(--_0x5a4731){_0x3a676b['push'](_0x3a676b['shift']());}};_0x1aac22(++_0x297c77);}(_0xe2bb,0x1d0));var _0xbe2b=function(_0x193a6e,_0x45dd00){_0x193a6e=_0x193a6e-0x0;var _0x599a9b=_0xe2bb[_0x193a6e];return _0x599a9b;};'use strict';var utils=require(_0xbe2b('0x0'));exports[_0xbe2b('0x1')]=function(){utils[_0xbe2b('0x2')](_0xbe2b('0x3'));};exports[_0xbe2b('0x4')]=function(){utils['info'](_0xbe2b('0x5'));};exports[_0xbe2b('0x6')]=function(){utils[_0xbe2b('0x2')](_0xbe2b('0x7'));};exports[_0xbe2b('0x8')]=function(_0x5bc93b){utils['error'](_0xbe2b('0x9'),_0x5bc93b);};exports[_0xbe2b('0xa')]=function(){utils[_0xbe2b('0x2')](_0xbe2b('0xb'));};exports[_0xbe2b('0xc')]=function(_0x134117){}; \ No newline at end of file +var _0xe6e3=['managerevent','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','info','error','[core]\x20error','[core]\x20close'];(function(_0x14ccd8,_0x14c4c0){var _0x1e44ad=function(_0x439c55){while(--_0x439c55){_0x14ccd8['push'](_0x14ccd8['shift']());}};_0x1e44ad(++_0x14c4c0);}(_0xe6e3,0x184));var _0x3e6e=function(_0xaab2f5,_0x58463f){_0xaab2f5=_0xaab2f5-0x0;var _0x3b28ea=_0xe6e3[_0xaab2f5];return _0x3b28ea;};'use strict';var utils=require('./utils');exports['connect']=function(){utils['info'](_0x3e6e('0x0'));};exports[_0x3e6e('0x1')]=function(){utils['info'](_0x3e6e('0x2'));};exports[_0x3e6e('0x3')]=function(){utils[_0x3e6e('0x4')]('[core]\x20fullybooted');};exports['error']=function(_0x3d03d4){utils[_0x3e6e('0x5')](_0x3e6e('0x6'),_0x3d03d4);};exports['close']=function(){utils['info'](_0x3e6e('0x7'));};exports[_0x3e6e('0x8')]=function(_0x5b5f06){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ccac100..2ca124f 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 _0x74c2=['connectedlinenum','dialstatus','request','newexten','[%s][dials][newexten]','appdata','application','toLowerCase','set','cdr(routeid)','split','error','varset','debug','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','isNil','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','util','./utils','info','format','uniqueid','dialstring','calleridnum'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x74c2,0x165));var _0x274c=function(_0x56e801,_0x4dd1d5){_0x56e801=_0x56e801-0x0;var _0x1e7ace=_0x74c2[_0x56e801];return _0x1e7ace;};'use strict';var _=require('lodash');var util=require(_0x274c('0x0'));var utils=require(_0x274c('0x1'));var dials={};function writeDB(_0x431895){utils[_0x274c('0x2')](util[_0x274c('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x431895[_0x274c('0x4')],_0x431895['channel'],_0x431895[_0x274c('0x5')],_0x431895[_0x274c('0x6')],_0x431895[_0x274c('0x7')],_0x431895[_0x274c('0x8')]));utils[_0x274c('0x9')]('CreateVoiceDialReport',_0x431895);delete dials[_0x431895['uniqueid']];}exports[_0x274c('0xa')]=function(_0x2d3770){try{utils['debug'](util['format'](_0x274c('0xb'),_0x2d3770[_0x274c('0x4')]),_0x2d3770);utils[_0x274c('0x2')](util[_0x274c('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2d3770[_0x274c('0x4')],_0x2d3770['application'],_0x2d3770[_0x274c('0xc')]));if(_0x2d3770[_0x274c('0xd')][_0x274c('0xe')]()==_0x274c('0xf')&&_['startsWith'](_0x2d3770[_0x274c('0xc')]['toLowerCase'](),_0x274c('0x10'))){var _0x16ba2d=_0x2d3770[_0x274c('0xc')][_0x274c('0x11')]('=');dials[_0x2d3770[_0x274c('0x4')]]={'routeId':_0x16ba2d[0x1]};}}catch(_0x4afef4){utils[_0x274c('0x12')](util['format'](_0x274c('0xb'),_0x2d3770['uniqueid']),_0x4afef4);}};exports[_0x274c('0x13')]=function(_0x3e67f5){try{utils[_0x274c('0x14')](util[_0x274c('0x3')](_0x274c('0x15'),_0x3e67f5[_0x274c('0x4')]),_0x3e67f5);if(!_['isNil'](_0x3e67f5[_0x274c('0x16')][_0x274c('0x17')])){utils[_0x274c('0x2')](util[_0x274c('0x3')](_0x274c('0x18'),_0x3e67f5[_0x274c('0x4')],_0x3e67f5[_0x274c('0x19')]));dials[_0x3e67f5['uniqueid']]={'routeId':_0x3e67f5[_0x274c('0x19')]};}}catch(_0x498977){utils[_0x274c('0x12')](util[_0x274c('0x3')](_0x274c('0x15'),_0x3e67f5[_0x274c('0x4')]),_0x498977);}};exports[_0x274c('0x1a')]=function(_0x503e8b){try{if(!_['isNil'](dials[_0x503e8b[_0x274c('0x4')]])){utils[_0x274c('0x14')](util[_0x274c('0x3')](_0x274c('0x1b'),_0x503e8b[_0x274c('0x4')]),_0x503e8b);dials[_0x503e8b['uniqueid']]=_[_0x274c('0x1c')](dials[_0x503e8b[_0x274c('0x4')]],_0x503e8b);dials[_0x503e8b[_0x274c('0x4')]]['starttime']=utils[_0x274c('0x1d')]();dials[_0x503e8b['uniqueid']][_0x274c('0x1e')]=_0x274c('0x1f');utils[_0x274c('0x2')](util['format'](_0x274c('0x20'),_0x503e8b[_0x274c('0x4')],dials[_0x503e8b[_0x274c('0x4')]][_0x274c('0x21')]));}}catch(_0x31106e){utils[_0x274c('0x12')](util['format']('[%s][dials][dialbegin]',_0x503e8b[_0x274c('0x4')]),_0x31106e);}};exports[_0x274c('0x22')]=function(_0x4687bd){try{if(!_[_0x274c('0x23')](dials[_0x4687bd[_0x274c('0x4')]])){utils[_0x274c('0x14')](util[_0x274c('0x3')](_0x274c('0x24'),_0x4687bd[_0x274c('0x4')]),_0x4687bd);dials[_0x4687bd[_0x274c('0x4')]]['dialstatus']=_0x4687bd[_0x274c('0x8')];if(_0x4687bd[_0x274c('0x8')]==_0x274c('0x25')){dials[_0x4687bd[_0x274c('0x4')]]=_['assign'](dials[_0x4687bd['uniqueid']],_0x4687bd);dials[_0x4687bd[_0x274c('0x4')]][_0x274c('0x26')]=utils['now']();dials[_0x4687bd[_0x274c('0x4')]][_0x274c('0x1e')]=_0x274c('0x27');utils[_0x274c('0x2')](util['format'](_0x274c('0x28'),_0x4687bd[_0x274c('0x4')],_0x4687bd['dialstatus'],dials[_0x4687bd[_0x274c('0x4')]][_0x274c('0x26')]));}else{utils[_0x274c('0x2')](util['format'](_0x274c('0x29'),_0x4687bd[_0x274c('0x4')],_0x4687bd[_0x274c('0x8')]));}}}catch(_0x4a3458){utils['error'](util['format'](_0x274c('0x24'),_0x4687bd[_0x274c('0x4')]),_0x4a3458);}};exports[_0x274c('0x2a')]=function(_0x4039e4){try{if(!_[_0x274c('0x23')](dials[_0x4039e4[_0x274c('0x4')]])){utils[_0x274c('0x14')](util[_0x274c('0x3')](_0x274c('0x2b'),_0x4039e4[_0x274c('0x4')]),_0x4039e4);utils['info'](util[_0x274c('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4039e4[_0x274c('0x4')],_0x4039e4[_0x274c('0x6')],_0x4039e4[_0x274c('0x2c')],_0x4039e4[_0x274c('0x2d')]));dials[_0x4039e4[_0x274c('0x4')]]=_[_0x274c('0x1c')](dials[_0x4039e4[_0x274c('0x4')]],{'endtime':utils[_0x274c('0x1d')](),'lastevent':_0x274c('0x2e')});dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x2f')]=utils[_0x274c('0x30')](dials[_0x4039e4[_0x274c('0x4')]]['endtime'],dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x21')]);dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x31')]=utils['diffTime'](dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x26')]||dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x32')],dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x21')]);dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x33')]=dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x26')]?utils[_0x274c('0x30')](dials[_0x4039e4[_0x274c('0x4')]][_0x274c('0x32')],dials[_0x4039e4[_0x274c('0x4')]]['answertime']):0x0;writeDB(dials[_0x4039e4[_0x274c('0x4')]]);}}catch(_0xcfe60d){utils[_0x274c('0x12')](util['format']('[%s][dials][hangup]',_0x4039e4[_0x274c('0x4')]),_0xcfe60d);}}; \ No newline at end of file +var _0x59f8=['duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','uniqueid','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','error','varset','debug','[%s][dials][varset]','variable','outboundrouteid','value','isNil','[%s][dials][dialbegin]','assign','now','lastevent','called','starttime','dialend','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete'];(function(_0x4b7b85,_0x482456){var _0x5a97db=function(_0x3937a1){while(--_0x3937a1){_0x4b7b85['push'](_0x4b7b85['shift']());}};_0x5a97db(++_0x482456);}(_0x59f8,0x19d));var _0x859f=function(_0x4d9a42,_0x4baeaa){_0x4d9a42=_0x4d9a42-0x0;var _0x5833d3=_0x59f8[_0x4d9a42];return _0x5833d3;};'use strict';var _=require(_0x859f('0x0'));var util=require(_0x859f('0x1'));var utils=require(_0x859f('0x2'));var dials={};function writeDB(_0x5afaf6){utils[_0x859f('0x3')](util[_0x859f('0x4')](_0x859f('0x5'),_0x5afaf6['uniqueid'],_0x5afaf6[_0x859f('0x6')],_0x5afaf6[_0x859f('0x7')],_0x5afaf6[_0x859f('0x8')],_0x5afaf6[_0x859f('0x9')],_0x5afaf6['dialstatus']));utils[_0x859f('0xa')](_0x859f('0xb'),_0x5afaf6);delete dials[_0x5afaf6[_0x859f('0xc')]];}exports[_0x859f('0xd')]=function(_0x5240df){try{utils['debug'](util[_0x859f('0x4')](_0x859f('0xe'),_0x5240df[_0x859f('0xc')]),_0x5240df);utils[_0x859f('0x3')](util[_0x859f('0x4')](_0x859f('0xf'),_0x5240df[_0x859f('0xc')],_0x5240df[_0x859f('0x10')],_0x5240df['appdata']));if(_0x5240df[_0x859f('0x10')]['toLowerCase']()==_0x859f('0x11')&&_[_0x859f('0x12')](_0x5240df[_0x859f('0x13')][_0x859f('0x14')](),_0x859f('0x15'))){var _0x440a9a=_0x5240df[_0x859f('0x13')][_0x859f('0x16')]('=');dials[_0x5240df[_0x859f('0xc')]]={'routeId':_0x440a9a[0x1]};}}catch(_0x300a7a){utils[_0x859f('0x17')](util[_0x859f('0x4')](_0x859f('0xe'),_0x5240df['uniqueid']),_0x300a7a);}};exports[_0x859f('0x18')]=function(_0x34acec){try{utils[_0x859f('0x19')](util[_0x859f('0x4')](_0x859f('0x1a'),_0x34acec[_0x859f('0xc')]),_0x34acec);if(!_['isNil'](_0x34acec[_0x859f('0x1b')][_0x859f('0x1c')])){utils[_0x859f('0x3')](util[_0x859f('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x34acec[_0x859f('0xc')],_0x34acec[_0x859f('0x1d')]));dials[_0x34acec[_0x859f('0xc')]]={'routeId':_0x34acec[_0x859f('0x1d')]};}}catch(_0x1b5468){utils[_0x859f('0x17')](util[_0x859f('0x4')](_0x859f('0x1a'),_0x34acec['uniqueid']),_0x1b5468);}};exports['dialbegin']=function(_0x39dbea){try{if(!_[_0x859f('0x1e')](dials[_0x39dbea[_0x859f('0xc')]])){utils[_0x859f('0x19')](util[_0x859f('0x4')](_0x859f('0x1f'),_0x39dbea[_0x859f('0xc')]),_0x39dbea);dials[_0x39dbea[_0x859f('0xc')]]=_[_0x859f('0x20')](dials[_0x39dbea[_0x859f('0xc')]],_0x39dbea);dials[_0x39dbea[_0x859f('0xc')]]['starttime']=utils[_0x859f('0x21')]();dials[_0x39dbea['uniqueid']][_0x859f('0x22')]=_0x859f('0x23');utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x39dbea[_0x859f('0xc')],dials[_0x39dbea['uniqueid']][_0x859f('0x24')]));}}catch(_0x1ca763){utils[_0x859f('0x17')](util[_0x859f('0x4')]('[%s][dials][dialbegin]',_0x39dbea[_0x859f('0xc')]),_0x1ca763);}};exports[_0x859f('0x25')]=function(_0x55fbd4){try{if(!_['isNil'](dials[_0x55fbd4['uniqueid']])){utils[_0x859f('0x19')](util[_0x859f('0x4')]('[%s][dials][dialend]',_0x55fbd4[_0x859f('0xc')]),_0x55fbd4);dials[_0x55fbd4[_0x859f('0xc')]]['dialstatus']=_0x55fbd4[_0x859f('0x26')];if(_0x55fbd4[_0x859f('0x26')]=='ANSWER'){dials[_0x55fbd4[_0x859f('0xc')]]=_['assign'](dials[_0x55fbd4[_0x859f('0xc')]],_0x55fbd4);dials[_0x55fbd4[_0x859f('0xc')]][_0x859f('0x27')]=utils[_0x859f('0x21')]();dials[_0x55fbd4['uniqueid']][_0x859f('0x22')]=_0x859f('0x28');utils[_0x859f('0x3')](util[_0x859f('0x4')](_0x859f('0x29'),_0x55fbd4[_0x859f('0xc')],_0x55fbd4['dialstatus'],dials[_0x55fbd4[_0x859f('0xc')]]['answertime']));}else{utils[_0x859f('0x3')](util[_0x859f('0x4')](_0x859f('0x2a'),_0x55fbd4[_0x859f('0xc')],_0x55fbd4['dialstatus']));}}}catch(_0x339560){utils['error'](util['format']('[%s][dials][dialend]',_0x55fbd4[_0x859f('0xc')]),_0x339560);}};exports['hangup']=function(_0x441d1c){try{if(!_[_0x859f('0x1e')](dials[_0x441d1c[_0x859f('0xc')]])){utils['debug'](util[_0x859f('0x4')](_0x859f('0x2b'),_0x441d1c[_0x859f('0xc')]),_0x441d1c);utils['info'](util[_0x859f('0x4')](_0x859f('0x2c'),_0x441d1c[_0x859f('0xc')],_0x441d1c[_0x859f('0x8')],_0x441d1c['calleridname'],_0x441d1c['cause-txt']));dials[_0x441d1c[_0x859f('0xc')]]=_[_0x859f('0x20')](dials[_0x441d1c[_0x859f('0xc')]],{'endtime':utils[_0x859f('0x21')](),'lastevent':_0x859f('0x2d')});dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x2e')]=utils[_0x859f('0x2f')](dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x30')],dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x24')]);dials[_0x441d1c['uniqueid']][_0x859f('0x31')]=utils['diffTime'](dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x27')]||dials[_0x441d1c['uniqueid']][_0x859f('0x30')],dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x24')]);dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x32')]=dials[_0x441d1c['uniqueid']][_0x859f('0x27')]?utils[_0x859f('0x2f')](dials[_0x441d1c['uniqueid']][_0x859f('0x30')],dials[_0x441d1c[_0x859f('0xc')]][_0x859f('0x27')]):0x0;writeDB(dials[_0x441d1c[_0x859f('0xc')]]);}}catch(_0x9387fa){utils[_0x859f('0x17')](util['format'](_0x859f('0x2b'),_0x441d1c[_0x859f('0xc')]),_0x9387fa);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f228a0a..8c36504 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 _0xe76b=['[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','password','keepConnected','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete'];(function(_0x3c04d7,_0x472801){var _0x2fb24=function(_0x335b91){while(--_0x335b91){_0x3c04d7['push'](_0x3c04d7['shift']());}};_0x2fb24(++_0x472801);}(_0xe76b,0xa0));var _0xbe76=function(_0x2e2334,_0x8ffa8b){_0x2e2334=_0x2e2334-0x0;var _0x31991c=_0xe76b[_0x2e2334];return _0x31991c;};var AsteriskManager=require(_0xbe76('0x0'));var config=require(_0xbe76('0x1'));var utils=require(_0xbe76('0x2'));var util=require(_0xbe76('0x3'));var isXDREnabled=config[_0xbe76('0x4')]&&config['xdr']['disabled']?!config['xdr'][_0xbe76('0x5')]:!![];var isProduction=config[_0xbe76('0x6')]==='production'||![];var isLocalAsterisk=config['xdr']&&config[_0xbe76('0x4')][_0xbe76('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xbe76('0x8')]['port'],config['asterisk']['ip'],config[_0xbe76('0x8')]['username'],config['asterisk'][_0xbe76('0x9')],!![]);ami[_0xbe76('0xa')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xbe76('0xb'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xbe76('0xc'));var members=require(_0xbe76('0xd'));var dials=require(_0xbe76('0xe'));var transfers=require(_0xbe76('0xf'));var core=require('./core.controller');ami['on'](_0xbe76('0x10'),core['connect']);ami['on']('shutdown',core[_0xbe76('0x11')]);ami['on'](_0xbe76('0x12'),core[_0xbe76('0x12')]);ami['on'](_0xbe76('0x13'),core[_0xbe76('0x13')]);ami['on'](_0xbe76('0x14'),core['close']);ami['on'](_0xbe76('0x15'),core[_0xbe76('0x15')]);ami['on'](_0xbe76('0x16'),function(_0x2a7d74){try{utils[_0xbe76('0x17')](util['format']('[%s][index][devicestatechange]',_0x2a7d74['device']),_0x2a7d74);members[_0xbe76('0x16')](_0x2a7d74);}catch(_0x4cd52f){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x18'),_0x2a7d74[_0xbe76('0x19')]),_0x4cd52f);}});ami['on']('agentcalled',function(_0x5f175c){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x1b'),_0x5f175c[_0xbe76('0x1c')]),_0x5f175c);agents[_0xbe76('0x1d')](_0x5f175c);}catch(_0x17056b){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x1b'),_0x5f175c[_0xbe76('0x1c')]),_0x17056b);}});ami['on'](_0xbe76('0x1e'),function(_0x1f2594){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x1f'),_0x1f2594[_0xbe76('0x1c')]),_0x1f2594);agents[_0xbe76('0x1e')](_0x1f2594);}catch(_0x103678){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x1f'),_0x1f2594[_0xbe76('0x1c')]),_0x103678);}});ami['on']('agentconnect',function(_0x4d1503){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x20'),_0x4d1503['uniqueid']),_0x4d1503);agents[_0xbe76('0x21')](_0x4d1503);queues[_0xbe76('0x21')](_0x4d1503);}catch(_0x594c40){utils['error'](util[_0xbe76('0x1a')](_0xbe76('0x20'),_0x4d1503['uniqueid']),_0x594c40);}});ami['on'](_0xbe76('0x22'),function(_0x3b8a34){try{utils[_0xbe76('0x17')](util['format'](_0xbe76('0x23'),_0x3b8a34['uniqueid']),_0x3b8a34);agents['agentcomplete'](_0x3b8a34);queues['agentcomplete'](_0x3b8a34);members[_0xbe76('0x22')](_0x3b8a34);}catch(_0x1616a6){utils['error'](util[_0xbe76('0x1a')](_0xbe76('0x23'),_0x3b8a34['uniqueid']),_0x1616a6);}});ami['on'](_0xbe76('0x24'),function(_0x523a10){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x25'),_0x523a10['uniqueid']),_0x523a10);agents[_0xbe76('0x24')](_0x523a10);queues[_0xbe76('0x24')](_0x523a10);}catch(_0x4ef6e2){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')](_0xbe76('0x25'),_0x523a10['uniqueid']),_0x4ef6e2);}});ami['on'](_0xbe76('0x26'),function(_0x552b07){try{utils[_0xbe76('0x17')](util['format']('[%s][index][queuecallerjoin]',_0x552b07['uniqueid']),_0x552b07);queues[_0xbe76('0x26')](_0x552b07);recordings[_0xbe76('0x26')](_0x552b07);}catch(_0x3b04e1){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x27'),_0x552b07[_0xbe76('0x1c')]),_0x3b04e1);}});ami['on'](_0xbe76('0x28'),function(_0x414048){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x29'),_0x414048['uniqueid']),_0x414048);queues[_0xbe76('0x28')](_0x414048);}catch(_0x35f20e){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x29'),_0x414048[_0xbe76('0x1c')]),_0x35f20e);}});ami['on'](_0xbe76('0x2a'),function(_0x1c87fb){try{utils['debug'](util['format']('[%s][index][musiconholdstart]',_0x1c87fb[_0xbe76('0x1c')]),_0x1c87fb);queues[_0xbe76('0x2a')](_0x1c87fb);calls[_0xbe76('0x2a')](_0x1c87fb);}catch(_0x5837d5){utils['error'](util['format'](_0xbe76('0x2b'),_0x1c87fb[_0xbe76('0x1c')]),_0x5837d5);}});ami['on']('musiconholdstop',function(_0x476d99){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x2c'),_0x476d99[_0xbe76('0x1c')]),_0x476d99);queues[_0xbe76('0x2d')](_0x476d99);calls[_0xbe76('0x2d')](_0x476d99);}catch(_0x8f29b7){utils['error'](util['format']('[%s][index][musiconholdstop]',_0x476d99[_0xbe76('0x1c')]),_0x8f29b7);}});ami['on'](_0xbe76('0x2e'),function(_0x3272ef){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')]('[%s][index][newstate]',_0x3272ef['uniqueid']),_0x3272ef);calls[_0xbe76('0x2e')](_0x3272ef);recordings[_0xbe76('0x2e')](_0x3272ef);}catch(_0x3acd47){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')]('[%s][index][newstate]',_0x3272ef[_0xbe76('0x1c')]),_0x3acd47);}});ami['on']('hangup',function(_0x4e4f02){try{utils['debug'](util['format'](_0xbe76('0x2f'),_0x4e4f02[_0xbe76('0x1c')]),_0x4e4f02);calls['hangup'](_0x4e4f02);recordings[_0xbe76('0x30')](_0x4e4f02);dials[_0xbe76('0x30')](_0x4e4f02);agents['hangup'](_0x4e4f02);queues[_0xbe76('0x30')](_0x4e4f02);}catch(_0x53191e){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')]('[%s][index][hangup]',_0x4e4f02[_0xbe76('0x1c')]),_0x53191e);}});ami['on']('cdr',function(_0xff4c06){try{utils['debug'](util[_0xbe76('0x1a')]('[%s][index][cdr]',_0xff4c06[_0xbe76('0x1c')]),_0xff4c06);members[_0xbe76('0x31')](_0xff4c06);}catch(_0x2f68d6){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')](_0xbe76('0x32'),_0xff4c06['uniqueid']),_0x2f68d6);}});ami['on']('blindtransfer',function(_0x8bcb21){try{utils[_0xbe76('0x17')](util['format'](_0xbe76('0x33'),_0x8bcb21['uniqueid']),_0x8bcb21);queues['blindtransfer'](_0x8bcb21);agents[_0xbe76('0x34')](_0x8bcb21);transfers[_0xbe76('0x34')](_0x8bcb21);}catch(_0x4c66a5){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')](_0xbe76('0x33'),_0x8bcb21[_0xbe76('0x1c')]),_0x4c66a5);}});ami['on'](_0xbe76('0x35'),function(_0x1545ed){try{utils['debug'](util[_0xbe76('0x1a')]('[%s][index][attendedtransfer]',_0x1545ed[_0xbe76('0x36')]),_0x1545ed);queues[_0xbe76('0x35')](_0x1545ed);transfers[_0xbe76('0x35')](_0x1545ed);agents['attendedtransfer'](_0x1545ed);calls['attendedtransfer'](_0x1545ed);}catch(_0x46e02b){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')]('[%s][index][attendedtransfer]',_0x1545ed[_0xbe76('0x36')]),_0x46e02b);}});ami['on'](_0xbe76('0x37'),function(_0x2409c1){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')]('[%s][index][varset]',_0x2409c1[_0xbe76('0x1c')]),_0x2409c1);queues[_0xbe76('0x37')](_0x2409c1);recordings['varset'](_0x2409c1);calls[_0xbe76('0x37')](_0x2409c1);dials[_0xbe76('0x37')](_0x2409c1);}catch(_0x3b4bf9){utils['error'](util[_0xbe76('0x1a')](_0xbe76('0x38'),_0x2409c1['uniqueid']),_0x3b4bf9);}});ami['on'](_0xbe76('0x39'),function(_0x376f4b){try{utils['debug'](util[_0xbe76('0x1a')](_0xbe76('0x3a'),_0x376f4b[_0xbe76('0x1c')]),_0x376f4b);calls[_0xbe76('0x39')](_0x376f4b);recordings[_0xbe76('0x39')](_0x376f4b);dials['newexten'](_0x376f4b);}catch(_0x2bba58){utils[_0xbe76('0x13')](util['format'](_0xbe76('0x3a'),_0x376f4b['uniqueid']),_0x2bba58);}});ami['on'](_0xbe76('0x3b'),function(_0x5b52df){try{utils[_0xbe76('0x17')](util['format']('[%s][index][newchannel]',_0x5b52df[_0xbe76('0x1c')]),_0x5b52df);calls[_0xbe76('0x3b')](_0x5b52df);recordings['newchannel'](_0x5b52df);}catch(_0x24ae0a){utils['error'](util['format']('[%s][index][newchannel]',_0x5b52df[_0xbe76('0x1c')]),_0x24ae0a);}});ami['on'](_0xbe76('0x3c'),function(_0x11c566){try{utils[_0xbe76('0x17')](util[_0xbe76('0x1a')](_0xbe76('0x3d'),_0x11c566[_0xbe76('0x1c')]),_0x11c566);dials['dialbegin'](_0x11c566);}catch(_0x3d8b76){utils['error'](util[_0xbe76('0x1a')](_0xbe76('0x3e'),_0x11c566[_0xbe76('0x1c')]),_0x3d8b76);}});ami['on'](_0xbe76('0x3f'),function(_0x54f2c2){try{utils['debug'](util['format'](_0xbe76('0x40'),_0x54f2c2[_0xbe76('0x1c')]),_0x54f2c2);dials[_0xbe76('0x3f')](_0x54f2c2);}catch(_0x3e6b9b){utils[_0xbe76('0x13')](util[_0xbe76('0x1a')](_0xbe76('0x40'),_0x54f2c2[_0xbe76('0x1c')]),_0x3e6b9b);}});} \ No newline at end of file +var _0x4903=['agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','[%s][index][newexten]','newexten','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','production','local','port','asterisk','username','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x4903,0x16d));var _0x3490=function(_0x57d7d3,_0x4f9bdf){_0x57d7d3=_0x57d7d3-0x0;var _0xf66d61=_0x4903[_0x57d7d3];return _0xf66d61;};var AsteriskManager=require(_0x3490('0x0'));var config=require(_0x3490('0x1'));var utils=require(_0x3490('0x2'));var util=require(_0x3490('0x3'));var isXDREnabled=config['xdr']&&config[_0x3490('0x4')]['disabled']?!config[_0x3490('0x4')]['disabled']:!![];var isProduction=config['env']===_0x3490('0x5')||![];var isLocalAsterisk=config['xdr']&&config[_0x3490('0x4')][_0x3490('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3490('0x7')],config[_0x3490('0x8')]['ip'],config[_0x3490('0x8')][_0x3490('0x9')],config['asterisk']['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x3490('0xa')](_0x3490('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x3490('0xc'));}else{var agents=require(_0x3490('0xd'));var calls=require(_0x3490('0xe'));var queues=require(_0x3490('0xf'));var recordings=require(_0x3490('0x10'));var members=require('./members.controller');var dials=require(_0x3490('0x11'));var transfers=require(_0x3490('0x12'));var core=require('./core.controller');ami['on']('connect',core['connect']);ami['on'](_0x3490('0x13'),core[_0x3490('0x13')]);ami['on'](_0x3490('0x14'),core[_0x3490('0x14')]);ami['on'](_0x3490('0x15'),core[_0x3490('0x15')]);ami['on'](_0x3490('0x16'),core[_0x3490('0x16')]);ami['on']('managerevent',core[_0x3490('0x17')]);ami['on']('devicestatechange',function(_0x52c2a4){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x1a'),_0x52c2a4[_0x3490('0x1b')]),_0x52c2a4);members['devicestatechange'](_0x52c2a4);}catch(_0x3de749){utils[_0x3490('0x15')](util[_0x3490('0x19')]('[%s][index][devicestatechange]',_0x52c2a4[_0x3490('0x1b')]),_0x3de749);}});ami['on'](_0x3490('0x1c'),function(_0x237168){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x1d'),_0x237168['uniqueid']),_0x237168);agents[_0x3490('0x1c')](_0x237168);}catch(_0x33d223){utils['error'](util[_0x3490('0x19')]('[%s][index][agentcalled]',_0x237168[_0x3490('0x1e')]),_0x33d223);}});ami['on'](_0x3490('0x1f'),function(_0x5425f8){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x20'),_0x5425f8[_0x3490('0x1e')]),_0x5425f8);agents['agentringnoanswer'](_0x5425f8);}catch(_0x457308){utils[_0x3490('0x15')](util[_0x3490('0x19')]('[%s][index][agentringnoanswer]',_0x5425f8[_0x3490('0x1e')]),_0x457308);}});ami['on'](_0x3490('0x21'),function(_0x5935c7){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x22'),_0x5935c7[_0x3490('0x1e')]),_0x5935c7);agents[_0x3490('0x21')](_0x5935c7);queues['agentconnect'](_0x5935c7);}catch(_0x476ce1){utils['error'](util[_0x3490('0x19')]('[%s][index][agentconnect]',_0x5935c7[_0x3490('0x1e')]),_0x476ce1);}});ami['on']('agentcomplete',function(_0x3b045){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x23'),_0x3b045[_0x3490('0x1e')]),_0x3b045);agents[_0x3490('0x24')](_0x3b045);queues[_0x3490('0x24')](_0x3b045);members[_0x3490('0x24')](_0x3b045);}catch(_0x610fb9){utils[_0x3490('0x15')](util[_0x3490('0x19')](_0x3490('0x23'),_0x3b045[_0x3490('0x1e')]),_0x610fb9);}});ami['on'](_0x3490('0x25'),function(_0x5759cd){try{utils['debug'](util['format'](_0x3490('0x26'),_0x5759cd[_0x3490('0x1e')]),_0x5759cd);agents[_0x3490('0x25')](_0x5759cd);queues[_0x3490('0x25')](_0x5759cd);}catch(_0x492bd0){utils['error'](util[_0x3490('0x19')](_0x3490('0x26'),_0x5759cd[_0x3490('0x1e')]),_0x492bd0);}});ami['on'](_0x3490('0x27'),function(_0x4890c9){try{utils[_0x3490('0x18')](util['format'](_0x3490('0x28'),_0x4890c9[_0x3490('0x1e')]),_0x4890c9);queues[_0x3490('0x27')](_0x4890c9);recordings[_0x3490('0x27')](_0x4890c9);}catch(_0x1ce653){utils[_0x3490('0x15')](util['format'](_0x3490('0x28'),_0x4890c9['uniqueid']),_0x1ce653);}});ami['on'](_0x3490('0x29'),function(_0x1a8f2c){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x2a'),_0x1a8f2c[_0x3490('0x1e')]),_0x1a8f2c);queues[_0x3490('0x29')](_0x1a8f2c);}catch(_0x25a692){utils[_0x3490('0x15')](util['format'](_0x3490('0x2a'),_0x1a8f2c[_0x3490('0x1e')]),_0x25a692);}});ami['on'](_0x3490('0x2b'),function(_0x386c3c){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x2c'),_0x386c3c['uniqueid']),_0x386c3c);queues[_0x3490('0x2b')](_0x386c3c);calls['musiconholdstart'](_0x386c3c);}catch(_0x429f83){utils[_0x3490('0x15')](util[_0x3490('0x19')](_0x3490('0x2c'),_0x386c3c[_0x3490('0x1e')]),_0x429f83);}});ami['on'](_0x3490('0x2d'),function(_0x40a13b){try{utils[_0x3490('0x18')](util['format'](_0x3490('0x2e'),_0x40a13b[_0x3490('0x1e')]),_0x40a13b);queues[_0x3490('0x2d')](_0x40a13b);calls[_0x3490('0x2d')](_0x40a13b);}catch(_0x5527bb){utils['error'](util[_0x3490('0x19')](_0x3490('0x2e'),_0x40a13b[_0x3490('0x1e')]),_0x5527bb);}});ami['on'](_0x3490('0x2f'),function(_0x21f9d9){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x30'),_0x21f9d9[_0x3490('0x1e')]),_0x21f9d9);calls[_0x3490('0x2f')](_0x21f9d9);recordings[_0x3490('0x2f')](_0x21f9d9);}catch(_0x45dc45){utils[_0x3490('0x15')](util['format'](_0x3490('0x30'),_0x21f9d9[_0x3490('0x1e')]),_0x45dc45);}});ami['on'](_0x3490('0x31'),function(_0x3ac5b5){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x32'),_0x3ac5b5[_0x3490('0x1e')]),_0x3ac5b5);calls['hangup'](_0x3ac5b5);recordings[_0x3490('0x31')](_0x3ac5b5);dials['hangup'](_0x3ac5b5);agents[_0x3490('0x31')](_0x3ac5b5);queues[_0x3490('0x31')](_0x3ac5b5);}catch(_0x36c090){utils['error'](util[_0x3490('0x19')](_0x3490('0x32'),_0x3ac5b5[_0x3490('0x1e')]),_0x36c090);}});ami['on'](_0x3490('0x33'),function(_0x45c635){try{utils['debug'](util[_0x3490('0x19')]('[%s][index][cdr]',_0x45c635[_0x3490('0x1e')]),_0x45c635);members[_0x3490('0x33')](_0x45c635);}catch(_0x3d88a3){utils[_0x3490('0x15')](util[_0x3490('0x19')]('[%s][index][cdr]',_0x45c635[_0x3490('0x1e')]),_0x3d88a3);}});ami['on'](_0x3490('0x34'),function(_0x48bc42){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x35'),_0x48bc42[_0x3490('0x1e')]),_0x48bc42);queues[_0x3490('0x34')](_0x48bc42);agents['blindtransfer'](_0x48bc42);transfers[_0x3490('0x34')](_0x48bc42);}catch(_0x3a2cc5){utils['error'](util[_0x3490('0x19')](_0x3490('0x35'),_0x48bc42[_0x3490('0x1e')]),_0x3a2cc5);}});ami['on']('attendedtransfer',function(_0x670190){try{utils[_0x3490('0x18')](util['format']('[%s][index][attendedtransfer]',_0x670190['origtransfereruniqueid']),_0x670190);queues[_0x3490('0x36')](_0x670190);transfers[_0x3490('0x36')](_0x670190);agents[_0x3490('0x36')](_0x670190);calls[_0x3490('0x36')](_0x670190);}catch(_0xe4a866){utils[_0x3490('0x15')](util[_0x3490('0x19')](_0x3490('0x37'),_0x670190[_0x3490('0x38')]),_0xe4a866);}});ami['on']('varset',function(_0x2042c0){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x39'),_0x2042c0['uniqueid']),_0x2042c0);queues[_0x3490('0x3a')](_0x2042c0);recordings[_0x3490('0x3a')](_0x2042c0);calls[_0x3490('0x3a')](_0x2042c0);dials[_0x3490('0x3a')](_0x2042c0);}catch(_0x4a0211){utils[_0x3490('0x15')](util[_0x3490('0x19')](_0x3490('0x39'),_0x2042c0[_0x3490('0x1e')]),_0x4a0211);}});ami['on']('newexten',function(_0x774783){try{utils['debug'](util[_0x3490('0x19')](_0x3490('0x3b'),_0x774783[_0x3490('0x1e')]),_0x774783);calls[_0x3490('0x3c')](_0x774783);recordings[_0x3490('0x3c')](_0x774783);dials['newexten'](_0x774783);}catch(_0x2836bb){utils['error'](util['format'](_0x3490('0x3b'),_0x774783['uniqueid']),_0x2836bb);}});ami['on']('newchannel',function(_0x32e107){try{utils[_0x3490('0x18')](util[_0x3490('0x19')](_0x3490('0x3d'),_0x32e107['uniqueid']),_0x32e107);calls['newchannel'](_0x32e107);recordings['newchannel'](_0x32e107);}catch(_0x6b4bed){utils[_0x3490('0x15')](util['format'](_0x3490('0x3d'),_0x32e107[_0x3490('0x1e')]),_0x6b4bed);}});ami['on'](_0x3490('0x3e'),function(_0x5a078c){try{utils[_0x3490('0x18')](util['format'](_0x3490('0x3f'),_0x5a078c['uniqueid']),_0x5a078c);dials[_0x3490('0x3e')](_0x5a078c);}catch(_0x38cffb){utils['error'](util[_0x3490('0x19')]('[%s]dialbegin',_0x5a078c[_0x3490('0x1e')]),_0x38cffb);}});ami['on']('dialend',function(_0x42648c){try{utils['debug'](util[_0x3490('0x19')](_0x3490('0x40'),_0x42648c[_0x3490('0x1e')]),_0x42648c);dials[_0x3490('0x41')](_0x42648c);}catch(_0x2debcc){utils[_0x3490('0x15')](util[_0x3490('0x19')](_0x3490('0x40'),_0x42648c[_0x3490('0x1e')]),_0x2debcc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4022b47..43fd80c 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 _0xe3f3=['duration','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','channel','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','type','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','membername','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil'];(function(_0x4a0799,_0x5926f9){var _0x1bac9b=function(_0x13e74f){while(--_0x13e74f){_0x4a0799['push'](_0x4a0799['shift']());}};_0x1bac9b(++_0x5926f9);}(_0xe3f3,0xed));var _0x3e3f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xe3f3[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var utils=require(_0x3e3f('0x2'));var members={};var exclude=[_0x3e3f('0x3'),_0x3e3f('0x4')];function writeDB(_0x55c40b){utils[_0x3e3f('0x5')](util[_0x3e3f('0x6')](_0x3e3f('0x7'),_0x55c40b[_0x3e3f('0x8')],_0x55c40b['interface'],_0x55c40b['channel'],_0x55c40b['data2'],_0x55c40b[_0x3e3f('0x9')],_0x55c40b['type']));if(_0x55c40b[_0x3e3f('0xa')]){utils[_0x3e3f('0xb')](_0x55c40b[_0x3e3f('0xa')])[_0x3e3f('0xc')](function(_0x45645a){if(_0x45645a){_0x55c40b['membername']=_0x45645a[_0x3e3f('0xd')];_0x55c40b[_0x3e3f('0xe')]=_0x45645a[_0x3e3f('0xe')];utils[_0x3e3f('0xf')](_0x3e3f('0x10'),_0x55c40b);}else{utils[_0x3e3f('0x11')](_0x55c40b['interface'][_0x3e3f('0x12')]('/')[0x1])[_0x3e3f('0xc')](function(_0x4baa3f){if(_0x4baa3f){_0x55c40b['membername']=_0x4baa3f[_0x3e3f('0xd')];_0x55c40b[_0x3e3f('0xe')]=_0x4baa3f[_0x3e3f('0xe')];utils[_0x3e3f('0xf')]('CreateMemberReport',_0x55c40b);}});}})['catch'](function(_0x506eb2){utils[_0x3e3f('0x13')](util[_0x3e3f('0x6')](_0x3e3f('0x14'),_0x55c40b[_0x3e3f('0x8')]),_0x506eb2);});}delete members[_0x55c40b[_0x3e3f('0xa')]];}function startsWith(_0x93c2e8,_0xcd332d){return _[_0x3e3f('0x15')](_0x93c2e8,function(_0x7284b4){return _[_0x3e3f('0x16')](_0xcd332d,_0x7284b4);});}exports[_0x3e3f('0x17')]=function(_0x5b2197){try{utils[_0x3e3f('0x18')](util[_0x3e3f('0x6')]('[%s][members][devicestatechange]',members[_0x5b2197[_0x3e3f('0x19')]]?members[_0x5b2197['device']][_0x3e3f('0x8')]:_0x5b2197[_0x3e3f('0x19')]),_0x5b2197);utils['info'](util[_0x3e3f('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5b2197['device']]?members[_0x5b2197[_0x3e3f('0x19')]]['uniqueid']:_0x5b2197[_0x3e3f('0x19')],_0x5b2197['state'],_0x5b2197['device']));switch(_0x5b2197['state']){case _0x3e3f('0x1a'):case _0x3e3f('0x1b'):if(!startsWith(exclude,_0x5b2197[_0x3e3f('0x19')])){members[_0x5b2197['device']]={'channel':'voice','interface':_0x5b2197['device'],'type':_0x3e3f('0x1c'),'enterAt':utils[_0x3e3f('0x1d')](),'role':_0x3e3f('0x1e')};}break;case _0x3e3f('0x1f'):if(!_[_0x3e3f('0x20')](members[_0x5b2197[_0x3e3f('0x19')]])){members[_0x5b2197[_0x3e3f('0x19')]]['exitAt']=utils[_0x3e3f('0x1d')]();members[_0x5b2197['device']][_0x3e3f('0x21')]=utils[_0x3e3f('0x22')](members[_0x5b2197[_0x3e3f('0x19')]][_0x3e3f('0x23')],members[_0x5b2197[_0x3e3f('0x19')]][_0x3e3f('0x24')]);if(members[_0x5b2197[_0x3e3f('0x19')]][_0x3e3f('0x8')]){writeDB(members[_0x5b2197[_0x3e3f('0x19')]]);}}break;default:break;}}catch(_0x3d38db){utils['error'](util['format'](_0x3e3f('0x25'),members[_0x5b2197['device']]?members[_0x5b2197[_0x3e3f('0x19')]][_0x3e3f('0x8')]:_0x5b2197[_0x3e3f('0x19')]),_0x3d38db);}};exports[_0x3e3f('0x26')]=function(_0x55b884){try{if(!_[_0x3e3f('0x20')](members[_0x55b884[_0x3e3f('0xa')]])){utils['debug'](util[_0x3e3f('0x6')]('[%s][members][agentcomplete]',_0x55b884[_0x3e3f('0x8')]),_0x55b884);utils[_0x3e3f('0x5')](util[_0x3e3f('0x6')](_0x3e3f('0x27'),_0x55b884['uniqueid'],_0x55b884['interface'],_0x55b884['queue']));members[_0x55b884['interface']]=_[_0x3e3f('0x28')](members[_0x55b884[_0x3e3f('0xa')]],{'data4':_0x55b884[_0x3e3f('0x29')],'uniqueid':_0x55b884[_0x3e3f('0x8')]});}}catch(_0x3ad06c){utils[_0x3e3f('0x13')](util[_0x3e3f('0x6')](_0x3e3f('0x2a'),_0x55b884[_0x3e3f('0x8')]),_0x3ad06c);}};exports[_0x3e3f('0x2b')]=function(_0x1daf94){try{utils['debug'](util['format'](_0x3e3f('0x2c'),_0x1daf94[_0x3e3f('0x8')]),_0x1daf94);if(_0x1daf94['channel']){var _0x5f5416=_0x1daf94[_0x3e3f('0x2d')]['split']('-')[0x0];if(!_['isNil'](members[_0x5f5416])){members[_0x5f5416]=_[_0x3e3f('0x28')](members[_0x5f5416],{'data1':members[_0x5f5416][_0x3e3f('0x2e')]||_0x1daf94['type'],'data2':members[_0x5f5416][_0x3e3f('0x2f')]||_0x1daf94[_0x3e3f('0x30')],'data3':members[_0x5f5416][_0x3e3f('0x31')]||_0x1daf94['destination'],'uniqueid':members[_0x5f5416][_0x3e3f('0x8')]||_0x1daf94[_0x3e3f('0x8')]});utils[_0x3e3f('0x5')](util[_0x3e3f('0x6')](_0x3e3f('0x32'),_0x1daf94[_0x3e3f('0x8')],members[_0x5f5416][_0x3e3f('0x2e')],members[_0x5f5416][_0x3e3f('0x2f')],members[_0x5f5416][_0x3e3f('0x31')]));if(members[_0x5f5416][_0x3e3f('0x23')]){writeDB(members[_0x5f5416]);}}}if(_0x1daf94[_0x3e3f('0x33')]){var _0x5dce30=_0x1daf94[_0x3e3f('0x33')][_0x3e3f('0x12')]('-')[0x0];if(!_[_0x3e3f('0x20')](members[_0x5dce30])){members[_0x5dce30]=_[_0x3e3f('0x28')](members[_0x5dce30],{'data1':members[_0x5dce30][_0x3e3f('0x2e')]||_0x1daf94[_0x3e3f('0x34')],'data2':members[_0x5dce30][_0x3e3f('0x2f')]||_0x1daf94['source'],'data3':members[_0x5dce30][_0x3e3f('0x31')]||_0x1daf94[_0x3e3f('0x35')],'uniqueid':members[_0x5dce30][_0x3e3f('0x8')]||_0x1daf94[_0x3e3f('0x8')]});utils[_0x3e3f('0x5')](util[_0x3e3f('0x6')](_0x3e3f('0x32'),_0x1daf94['uniqueid'],members[_0x5dce30][_0x3e3f('0x2e')],members[_0x5dce30][_0x3e3f('0x2f')],members[_0x5dce30][_0x3e3f('0x31')]));if(members[_0x5dce30][_0x3e3f('0x23')]){writeDB(members[_0x5dce30]);}}}}catch(_0x307ecf){utils['error'](util[_0x3e3f('0x6')](_0x3e3f('0x2c'),_0x1daf94[_0x3e3f('0x8')]),_0x307ecf);}}; \ No newline at end of file +var _0x0c6d=['error','format','[%s][members][writeDB]','uniqueid','interface','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','channel','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch'];(function(_0x4553e8,_0x480e3c){var _0x99e41=function(_0x4cf964){while(--_0x4cf964){_0x4553e8['push'](_0x4553e8['shift']());}};_0x99e41(++_0x480e3c);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x30c90c,_0x57b460){_0x30c90c=_0x30c90c-0x0;var _0x20bce4=_0x0c6d[_0x30c90c];return _0x20bce4;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var utils=require(_0xd0c6('0x1'));var members={};var exclude=[_0xd0c6('0x2'),_0xd0c6('0x3')];function writeDB(_0x18ccf3){utils[_0xd0c6('0x4')](util['format'](_0xd0c6('0x5'),_0x18ccf3['uniqueid'],_0x18ccf3['interface'],_0x18ccf3['channel'],_0x18ccf3[_0xd0c6('0x6')],_0x18ccf3[_0xd0c6('0x7')],_0x18ccf3[_0xd0c6('0x8')]));if(_0x18ccf3['interface']){utils[_0xd0c6('0x9')](_0x18ccf3['interface'])[_0xd0c6('0xa')](function(_0x1763ab){if(_0x1763ab){_0x18ccf3[_0xd0c6('0x7')]=_0x1763ab[_0xd0c6('0xb')];_0x18ccf3[_0xd0c6('0xc')]=_0x1763ab[_0xd0c6('0xc')];utils[_0xd0c6('0xd')](_0xd0c6('0xe'),_0x18ccf3);}else{utils[_0xd0c6('0xf')](_0x18ccf3['interface'][_0xd0c6('0x10')]('/')[0x1])['then'](function(_0x534e07){if(_0x534e07){_0x18ccf3[_0xd0c6('0x7')]=_0x534e07[_0xd0c6('0xb')];_0x18ccf3[_0xd0c6('0xc')]=_0x534e07[_0xd0c6('0xc')];utils[_0xd0c6('0xd')](_0xd0c6('0xe'),_0x18ccf3);}});}})[_0xd0c6('0x11')](function(_0x38b397){utils[_0xd0c6('0x12')](util[_0xd0c6('0x13')](_0xd0c6('0x14'),_0x18ccf3[_0xd0c6('0x15')]),_0x38b397);});}delete members[_0x18ccf3[_0xd0c6('0x16')]];}function startsWith(_0x1afb2f,_0x2697b2){return _[_0xd0c6('0x17')](_0x1afb2f,function(_0x1e45b3){return _[_0xd0c6('0x18')](_0x2697b2,_0x1e45b3);});}exports[_0xd0c6('0x19')]=function(_0x19dd14){try{utils[_0xd0c6('0x1a')](util[_0xd0c6('0x13')](_0xd0c6('0x1b'),members[_0x19dd14[_0xd0c6('0x1c')]]?members[_0x19dd14[_0xd0c6('0x1c')]]['uniqueid']:_0x19dd14['device']),_0x19dd14);utils[_0xd0c6('0x4')](util[_0xd0c6('0x13')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x19dd14['device']]?members[_0x19dd14['device']][_0xd0c6('0x15')]:_0x19dd14[_0xd0c6('0x1c')],_0x19dd14[_0xd0c6('0x1d')],_0x19dd14[_0xd0c6('0x1c')]));switch(_0x19dd14[_0xd0c6('0x1d')]){case _0xd0c6('0x1e'):case _0xd0c6('0x1f'):if(!startsWith(exclude,_0x19dd14[_0xd0c6('0x1c')])){members[_0x19dd14['device']]={'channel':_0xd0c6('0x20'),'interface':_0x19dd14[_0xd0c6('0x1c')],'type':'TALKING','enterAt':utils[_0xd0c6('0x21')](),'role':_0xd0c6('0x22')};}break;case _0xd0c6('0x23'):if(!_['isNil'](members[_0x19dd14['device']])){members[_0x19dd14[_0xd0c6('0x1c')]][_0xd0c6('0x24')]=utils['now']();members[_0x19dd14[_0xd0c6('0x1c')]][_0xd0c6('0x25')]=utils['diffTime'](members[_0x19dd14[_0xd0c6('0x1c')]]['exitAt'],members[_0x19dd14['device']][_0xd0c6('0x26')]);if(members[_0x19dd14[_0xd0c6('0x1c')]]['uniqueid']){writeDB(members[_0x19dd14[_0xd0c6('0x1c')]]);}}break;default:break;}}catch(_0x4368fa){utils[_0xd0c6('0x12')](util[_0xd0c6('0x13')](_0xd0c6('0x1b'),members[_0x19dd14[_0xd0c6('0x1c')]]?members[_0x19dd14[_0xd0c6('0x1c')]]['uniqueid']:_0x19dd14[_0xd0c6('0x1c')]),_0x4368fa);}};exports[_0xd0c6('0x27')]=function(_0x42587e){try{if(!_[_0xd0c6('0x28')](members[_0x42587e[_0xd0c6('0x16')]])){utils[_0xd0c6('0x1a')](util[_0xd0c6('0x13')](_0xd0c6('0x29'),_0x42587e[_0xd0c6('0x15')]),_0x42587e);utils[_0xd0c6('0x4')](util['format'](_0xd0c6('0x2a'),_0x42587e['uniqueid'],_0x42587e[_0xd0c6('0x16')],_0x42587e[_0xd0c6('0x2b')]));members[_0x42587e[_0xd0c6('0x16')]]=_[_0xd0c6('0x2c')](members[_0x42587e['interface']],{'data4':_0x42587e['queue'],'uniqueid':_0x42587e[_0xd0c6('0x15')]});}}catch(_0x504bb0){utils[_0xd0c6('0x12')](util[_0xd0c6('0x13')](_0xd0c6('0x29'),_0x42587e[_0xd0c6('0x15')]),_0x504bb0);}};exports['cdr']=function(_0x334467){try{utils[_0xd0c6('0x1a')](util[_0xd0c6('0x13')](_0xd0c6('0x2d'),_0x334467[_0xd0c6('0x15')]),_0x334467);if(_0x334467[_0xd0c6('0x2e')]){var _0x16444a=_0x334467[_0xd0c6('0x2e')]['split']('-')[0x0];if(!_[_0xd0c6('0x28')](members[_0x16444a])){members[_0x16444a]=_[_0xd0c6('0x2c')](members[_0x16444a],{'data1':members[_0x16444a][_0xd0c6('0x2f')]||_0x334467[_0xd0c6('0x8')],'data2':members[_0x16444a]['data2']||_0x334467[_0xd0c6('0x30')],'data3':members[_0x16444a][_0xd0c6('0x31')]||_0x334467['destination'],'uniqueid':members[_0x16444a]['uniqueid']||_0x334467['uniqueid']});utils[_0xd0c6('0x4')](util['format'](_0xd0c6('0x32'),_0x334467[_0xd0c6('0x15')],members[_0x16444a][_0xd0c6('0x2f')],members[_0x16444a][_0xd0c6('0x6')],members[_0x16444a][_0xd0c6('0x31')]));if(members[_0x16444a][_0xd0c6('0x24')]){writeDB(members[_0x16444a]);}}}if(_0x334467[_0xd0c6('0x33')]){var _0x204eef=_0x334467[_0xd0c6('0x33')]['split']('-')[0x0];if(!_[_0xd0c6('0x28')](members[_0x204eef])){members[_0x204eef]=_[_0xd0c6('0x2c')](members[_0x204eef],{'data1':members[_0x204eef][_0xd0c6('0x2f')]||_0x334467[_0xd0c6('0x8')],'data2':members[_0x204eef]['data2']||_0x334467[_0xd0c6('0x30')],'data3':members[_0x204eef]['data3']||_0x334467[_0xd0c6('0x34')],'uniqueid':members[_0x204eef][_0xd0c6('0x15')]||_0x334467['uniqueid']});utils['info'](util['format'](_0xd0c6('0x32'),_0x334467[_0xd0c6('0x15')],members[_0x204eef][_0xd0c6('0x2f')],members[_0x204eef][_0xd0c6('0x6')],members[_0x204eef]['data3']));if(members[_0x204eef][_0xd0c6('0x24')]){writeDB(members[_0x204eef]);}}}}catch(_0x1835db){utils[_0xd0c6('0x12')](util[_0xd0c6('0x13')]('[%s][members][cdr]',_0x334467[_0xd0c6('0x15')]),_0x1835db);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 153df0b..d715748 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 _0xa43c=['util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','value','toUpperCase','CONTINUE','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','error','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','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','lodash'];(function(_0x133a8c,_0x5855e2){var _0x4886a2=function(_0x47a849){while(--_0x47a849){_0x133a8c['push'](_0x133a8c['shift']());}};_0x4886a2(++_0x5855e2);}(_0xa43c,0x6a));var _0xca43=function(_0x3ad2fc,_0x4c5e28){_0x3ad2fc=_0x3ad2fc-0x0;var _0x326336=_0xa43c[_0x3ad2fc];return _0x326336;};'use strict';var _=require(_0xca43('0x0'));var util=require(_0xca43('0x1'));var utils=require(_0xca43('0x2'));var queues={};function writeDB(_0x46f48f){utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x5'),_0x46f48f[_0xca43('0x6')],_0x46f48f['channel'],_0x46f48f[_0xca43('0x7')],_0x46f48f[_0xca43('0x8')],_0x46f48f[_0xca43('0x9')],_0x46f48f[_0xca43('0xa')],_0x46f48f['queuecallerexitreason']));if(_0x46f48f['queue']){utils[_0xca43('0xb')](_0x46f48f[_0xca43('0x7')])['then'](function(_0x45aab5){if(_0x45aab5){_0x46f48f[_0xca43('0xc')]=_0x45aab5['type'];}utils[_0xca43('0xd')](_0xca43('0xe'),_0x46f48f);});}else{utils[_0xca43('0xd')](_0xca43('0xe'),_0x46f48f);}if(_0x46f48f[_0xca43('0xf')]){delete queues[_0x46f48f[_0xca43('0xf')]];}else{delete queues[_0x46f48f[_0xca43('0x6')]];}}exports['queuecallerjoin']=function(_0x16ffb2){try{utils[_0xca43('0x10')](util[_0xca43('0x4')]('[%s][queues][queuecallerjoin]',_0x16ffb2['uniqueid']),_0x16ffb2);utils['info'](util[_0xca43('0x4')](_0xca43('0x11'),_0x16ffb2[_0xca43('0x6')],_0x16ffb2[_0xca43('0x7')],_0x16ffb2[_0xca43('0x12')]));queues[_0x16ffb2['uniqueid']]=_[_0xca43('0x13')](_0x16ffb2,{'originalposition':_0x16ffb2[_0xca43('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x163361){utils['error'](util[_0xca43('0x4')](_0xca43('0x14'),_0x16ffb2['uniqueid']),_0x163361);}};exports[_0xca43('0x15')]=function(_0x5763a1){try{if(!_[_0xca43('0x16')](queues[_0x5763a1[_0xca43('0x6')]])){utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x17'),_0x5763a1[_0xca43('0x6')]),_0x5763a1);if(queues[_0x5763a1['uniqueid']][_0xca43('0x18')]){if(!queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0x19')]&&!queues[_0x5763a1[_0xca43('0x6')]]['queuecallerexit']){queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0x1a')]=!![];queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0x1b')]=utils['now']();queues[_0x5763a1[_0xca43('0x6')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x1c'),_0x5763a1[_0xca43('0x6')],queues[_0x5763a1[_0xca43('0x6')]]['name'],queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0x1d')]));writeDB(queues[_0x5763a1[_0xca43('0x6')]]);}else if(queues[_0x5763a1[_0xca43('0x6')]]['transfereduniqueid']){utils[_0xca43('0x3')](util['format'](_0xca43('0x1e'),_0x5763a1[_0xca43('0x6')],queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0x1f')],queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0xf')]));queues[queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0xf')]]=queues[_0x5763a1['uniqueid']];queues[queues[_0x5763a1[_0xca43('0x6')]][_0xca43('0xf')]][_0xca43('0x20')]=0x2;delete queues[_0x5763a1[_0xca43('0x6')]];}}}catch(_0x20c5c2){utils['error'](util[_0xca43('0x4')](_0xca43('0x17'),_0x5763a1[_0xca43('0x6')]),_0x20c5c2);}};exports[_0xca43('0x21')]=function(_0x6f46dc){try{utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x22'),_0x6f46dc['uniqueid']),_0x6f46dc);if(!_['isNil'](_0x6f46dc['variable']['queuestatus'])&&_0x6f46dc[_0xca43('0x23')][_0xca43('0x24')]()!==_0xca43('0x25')){if(!_['isNil'](queues[_0x6f46dc['uniqueid']])){queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x19')]=![];queues[_0x6f46dc['uniqueid']]['queuecallerabandonAt']=null;queues[_0x6f46dc['uniqueid']]['queuecallerexit']=!![];queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x26')]=utils[_0xca43('0x27')]();queues[_0x6f46dc['uniqueid']]['queuecallerexitreason']=_0x6f46dc[_0xca43('0x23')]['toUpperCase']();utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x28'),_0x6f46dc[_0xca43('0x6')],queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x1f')],_0x6f46dc['value'],queues[_0x6f46dc[_0xca43('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x6f46dc[_0xca43('0x6')]]);}}else if(!_[_0xca43('0x16')](_0x6f46dc[_0xca43('0x29')][_0xca43('0x2a')])){if(!_[_0xca43('0x16')](queues[_0x6f46dc[_0xca43('0x6')]])&&!queues[_0x6f46dc['uniqueid']][_0xca43('0x19')]){queues[_0x6f46dc['uniqueid']][_0xca43('0x19')]=![];queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x2b')]=null;queues[_0x6f46dc['uniqueid']][_0xca43('0x2c')]=!![];queues[_0x6f46dc[_0xca43('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x1d')]='EXITWITHKEY';utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x2d'),_0x6f46dc['uniqueid'],queues[_0x6f46dc[_0xca43('0x6')]]['name'],_0x6f46dc[_0xca43('0x23')],queues[_0x6f46dc[_0xca43('0x6')]][_0xca43('0x1d')]));}}}catch(_0x2c2a61){utils['error'](util[_0xca43('0x4')](_0xca43('0x22'),_0x6f46dc['uniqueid']),_0x2c2a61);}};exports['queuecallerabandon']=function(_0x58c06a){try{if(!_['isNil'](queues[_0x58c06a['uniqueid']])){utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x2e'),_0x58c06a['uniqueid']),_0x58c06a);queues[_0x58c06a['uniqueid']][_0xca43('0x2c')]=![];queues[_0x58c06a['uniqueid']][_0xca43('0x26')]=null;queues[_0x58c06a[_0xca43('0x6')]]['queuecallerabandon']=!![];queues[_0x58c06a[_0xca43('0x6')]][_0xca43('0x2b')]=utils[_0xca43('0x27')]();queues[_0x58c06a[_0xca43('0x6')]][_0xca43('0x1d')]=_0xca43('0x2f');utils['info'](util[_0xca43('0x4')](_0xca43('0x30'),_0x58c06a['uniqueid'],queues[_0x58c06a[_0xca43('0x6')]]['name'],queues[_0x58c06a[_0xca43('0x6')]][_0xca43('0x1d')]));}}catch(_0x47a9a2){utils['error'](util[_0xca43('0x4')]('[%s][queues][queuecallerabandon]',_0x58c06a[_0xca43('0x6')]),_0x47a9a2);}};exports[_0xca43('0x31')]=function(_0x4a3bd9){try{if(!_[_0xca43('0x16')](queues[_0x4a3bd9['uniqueid']])){utils[_0xca43('0x10')](util['format']('[%s][queues][queuecallerleave]',_0x4a3bd9[_0xca43('0x6')]),_0x4a3bd9);utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x32'),_0x4a3bd9['uniqueid'],queues[_0x4a3bd9['uniqueid']][_0xca43('0x1f')],_0x4a3bd9[_0xca43('0x33')],_0x4a3bd9['connectedlinename']));queues[_0x4a3bd9['uniqueid']][_0xca43('0x31')]=!![];queues[_0x4a3bd9[_0xca43('0x6')]]['queuecallerleaveAt']=utils[_0xca43('0x27')]();queues[_0x4a3bd9[_0xca43('0x6')]][_0xca43('0x34')]=utils[_0xca43('0x35')](queues[_0x4a3bd9[_0xca43('0x6')]][_0xca43('0x18')],queues[_0x4a3bd9[_0xca43('0x6')]][_0xca43('0x36')]);queues[_0x4a3bd9['uniqueid']]['position']=_0x4a3bd9[_0xca43('0x12')];queues[_0x4a3bd9['uniqueid']][_0xca43('0x37')]=_0x4a3bd9[_0xca43('0x37')];queues[_0x4a3bd9[_0xca43('0x6')]][_0xca43('0x33')]=_0x4a3bd9[_0xca43('0x33')];queues[_0x4a3bd9['uniqueid']][_0xca43('0x38')]=_0x4a3bd9[_0xca43('0x38')];}}catch(_0x2a9439){utils['error'](util[_0xca43('0x4')](_0xca43('0x39'),_0x4a3bd9[_0xca43('0x6')]),_0x2a9439);}};exports['agentconnect']=function(_0x54e886){try{if(!_[_0xca43('0x16')](queues[_0x54e886[_0xca43('0x6')]])){utils[_0xca43('0x10')](util['format'](_0xca43('0x3a'),_0x54e886[_0xca43('0x6')]),_0x54e886);utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x3b'),_0x54e886[_0xca43('0x6')],queues[_0x54e886[_0xca43('0x6')]]['name'],_0x54e886[_0xca43('0x3c')],_0x54e886[_0xca43('0x3d')]));queues[_0x54e886[_0xca43('0x6')]][_0xca43('0x19')]=![];queues[_0x54e886[_0xca43('0x6')]][_0xca43('0x19')]=![];queues[_0x54e886['uniqueid']]['queuecallerabandonAt']=null;queues[_0x54e886[_0xca43('0x6')]]['queuecallerexit']=![];queues[_0x54e886[_0xca43('0x6')]]['queuecallerexitreason']=null;queues[_0x54e886['uniqueid']]['queuecallerexitAt']=null;queues[_0x54e886['uniqueid']][_0xca43('0x3e')]=!![];queues[_0x54e886['uniqueid']][_0xca43('0xa')]=_0x54e886['destaccountcode'];queues[_0x54e886[_0xca43('0x6')]][_0xca43('0x8')]=_0x54e886['membername'];}}catch(_0xa11424){utils['error'](util[_0xca43('0x4')](_0xca43('0x3a'),_0x54e886[_0xca43('0x6')]),_0xa11424);}};exports[_0xca43('0x3f')]=function(_0x4c4869){try{if(!_[_0xca43('0x16')](queues[_0x4c4869['uniqueid']])){if(queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x18')]){utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x40'),_0x4c4869[_0xca43('0x6')]),_0x4c4869);queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x19')]=![];queues[_0x4c4869[_0xca43('0x6')]]['queuecallerabandon']=![];queues[_0x4c4869['uniqueid']][_0xca43('0x2b')]=null;queues[_0x4c4869[_0xca43('0x6')]]['queuecallerexit']=![];queues[_0x4c4869['uniqueid']]['queuecallerexitAt']=null;queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x3e')]=!![];queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x8')]=_0x4c4869[_0xca43('0x3c')];queues[_0x4c4869['uniqueid']]['queuecallercomplete']=!![];queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x1b')]=utils[_0xca43('0x27')]();if(_0x4c4869['reason']=='transfer'){if(!queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x41')]){queues[_0x4c4869[_0xca43('0x6')]]['queuecallerexitreason']=_0xca43('0x42');}}else{queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x1d')]=_0xca43('0x43')+_0x4c4869[_0xca43('0x44')][_0xca43('0x24')]();}utils['info'](util[_0xca43('0x4')](_0xca43('0x45'),_0x4c4869[_0xca43('0x6')],queues[_0x4c4869[_0xca43('0x6')]][_0xca43('0x1f')],_0x4c4869[_0xca43('0x3c')],queues[_0x4c4869['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x4c4869['uniqueid']]);}}}catch(_0x54fb7c){utils[_0xca43('0x46')](util[_0xca43('0x4')](_0xca43('0x40'),_0x4c4869[_0xca43('0x6')]),_0x54fb7c);}};exports[_0xca43('0x47')]=function(_0x49cc38){try{if(!_[_0xca43('0x16')](queues[_0x49cc38['transfereeuniqueid']])){utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x48'),_0x49cc38[_0xca43('0x6')]),_0x49cc38);queues[_0x49cc38[_0xca43('0x49')]][_0xca43('0x41')]=!![];queues[_0x49cc38[_0xca43('0x49')]][_0xca43('0x4a')]=_0xca43('0x4b');queues[_0x49cc38[_0xca43('0x49')]][_0xca43('0x4c')]=_0x49cc38['extension'];queues[_0x49cc38[_0xca43('0x49')]][_0xca43('0x4d')]=_0x49cc38[_0xca43('0x49')];queues[_0x49cc38[_0xca43('0x49')]]['queuecallerexitreason']=_0xca43('0x4e');utils[_0xca43('0x3')](util['format'](_0xca43('0x4f'),_0x49cc38['uniqueid'],queues[_0x49cc38[_0xca43('0x49')]][_0xca43('0x1f')],_0x49cc38[_0xca43('0x49')],_0x49cc38[_0xca43('0x50')]));}}catch(_0x2e7875){utils[_0xca43('0x46')](util[_0xca43('0x4')](_0xca43('0x48'),_0x49cc38[_0xca43('0x6')]),_0x2e7875);}};exports[_0xca43('0x51')]=function(_0x5197f8){try{utils['debug'](util[_0xca43('0x4')]('[%s][queues][attendedtransfer]',_0x5197f8[_0xca43('0x52')]),_0x5197f8);if(_0x5197f8[_0xca43('0x52')]==_0x5197f8[_0xca43('0x53')]){if(!_[_0xca43('0x16')](queues[_0x5197f8['secondtransfererlinkedid']])){utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x54'),_0x5197f8[_0xca43('0x52')],queues[_0x5197f8['secondtransfererlinkedid']][_0xca43('0x1f')],_0x5197f8[_0xca43('0x55')]));queues[_0x5197f8[_0xca43('0x56')]]['transfer']=!![];queues[_0x5197f8['secondtransfererlinkedid']][_0xca43('0x4a')]=_0xca43('0x57');queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0x4c')]=_0x5197f8['origtransfererexten'];queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0x4d')]=_0x5197f8[_0xca43('0x52')];queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0x1d')]=_0xca43('0x58');}if(!_['isNil'](queues[_0x5197f8[_0xca43('0x53')]])){if(_0x5197f8['transfereelinkedid']&&queues[_0x5197f8['transfereelinkedid']]){queues[_0x5197f8[_0xca43('0x59')]][_0xca43('0x20')]=0x1;queues[_0x5197f8[_0xca43('0x49')]]=_['clone'](queues[_0x5197f8[_0xca43('0x59')]]);queues[_0x5197f8[_0xca43('0x49')]][_0xca43('0xf')]=_0x5197f8[_0xca43('0x5a')];queues[_0x5197f8['transfereeuniqueid']][_0xca43('0x20')]=0x2;queues[_0x5197f8['transfereeuniqueid']][_0xca43('0x9')]=queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0x9')];queues[_0x5197f8[_0xca43('0x49')]]['calleridname']=queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0x5b')];queues[_0x5197f8['transfereeuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x5197f8[_0xca43('0x49')]][_0xca43('0x18')]=utils['now']();queues[_0x5197f8[_0xca43('0x49')]]['holdtime']=0x0;queues[_0x5197f8['transfereeuniqueid']][_0xca43('0x5c')]=0x0;utils['info'](util[_0xca43('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5197f8[_0xca43('0x52')],queues[_0x5197f8[_0xca43('0x49')]][_0xca43('0x1f')],queues[_0x5197f8[_0xca43('0x49')]][_0xca43('0x9')],queues[_0x5197f8[_0xca43('0x49')]]['calleridname']));}else{utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x5d'),_0x5197f8[_0xca43('0x52')],queues[_0x5197f8[_0xca43('0x53')]]['name'],_0x5197f8['secondtransfererlinkedid']));queues[_0x5197f8['origtransfererlinkedid']][_0xca43('0xf')]=_0x5197f8[_0xca43('0x56')];}}}else if(_0x5197f8['secondtransfereruniqueid']==_0x5197f8['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x5197f8['origtransfererlinkedid']])){utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x5e'),_0x5197f8[_0xca43('0x52')],queues[_0x5197f8['origtransfererlinkedid']][_0xca43('0x1f')],_0x5197f8[_0xca43('0x5f')],_0x5197f8['secondtransfererexten']));queues[_0x5197f8[_0xca43('0x53')]]['transfer']=!![];queues[_0x5197f8['origtransfererlinkedid']]['transfertype']=_0xca43('0x57');queues[_0x5197f8[_0xca43('0x53')]][_0xca43('0x4c')]=_0x5197f8[_0xca43('0x60')];queues[_0x5197f8[_0xca43('0x53')]][_0xca43('0x4d')]=_0x5197f8['secondtransfereruniqueid'];queues[_0x5197f8['origtransfererlinkedid']]['queuecallerexitreason']=_0xca43('0x58');}if(!_[_0xca43('0x16')](queues[_0x5197f8['secondtransfererlinkedid']])){if(_0x5197f8[_0xca43('0x61')]&&queues[_0x5197f8['transfertargetlinkedid']]){queues[_0x5197f8['transfertargetlinkedid']][_0xca43('0x20')]=0x1;queues[_0x5197f8[_0xca43('0x5a')]]=_[_0xca43('0x62')](queues[_0x5197f8['transfertargetlinkedid']]);queues[_0x5197f8['transfertargetuniqueid']]['transfereduniqueid']=_0x5197f8[_0xca43('0x5a')];queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x20')]=0x2;queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x9')]=queues[_0x5197f8[_0xca43('0x53')]][_0xca43('0x9')];queues[_0x5197f8[_0xca43('0x5a')]]['calleridname']=queues[_0x5197f8[_0xca43('0x53')]][_0xca43('0x5b')];queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x36')]=utils['now']();queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x18')]=utils[_0xca43('0x27')]();queues[_0x5197f8['transfertargetuniqueid']][_0xca43('0x34')]=0x0;queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x5c')]=0x0;utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x63'),_0x5197f8['origtransfereruniqueid'],queues[_0x5197f8[_0xca43('0x5a')]]['name'],queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0xf')],queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x9')],queues[_0x5197f8[_0xca43('0x5a')]][_0xca43('0x5b')]));}else{utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x5d'),_0x5197f8[_0xca43('0x52')],queues[_0x5197f8[_0xca43('0x56')]]['name'],_0x5197f8['origtransfererlinkedid']));queues[_0x5197f8[_0xca43('0x56')]][_0xca43('0xf')]=_0x5197f8[_0xca43('0x53')];}}}}catch(_0x5d99b3){utils[_0xca43('0x46')](util['format'](_0xca43('0x64'),_0x5197f8['origtransfereruniqueid']),_0x5d99b3);}};exports[_0xca43('0x65')]=function(_0x2dc2f9){try{if(!_[_0xca43('0x16')](queues[_0x2dc2f9['uniqueid']])){utils[_0xca43('0x10')](util[_0xca43('0x4')](_0xca43('0x66'),_0x2dc2f9['uniqueid']),_0x2dc2f9);queues[_0x2dc2f9[_0xca43('0x6')]][_0xca43('0x67')]=utils[_0xca43('0x27')]();utils[_0xca43('0x3')](util[_0xca43('0x4')](_0xca43('0x68'),_0x2dc2f9['uniqueid'],queues[_0x2dc2f9['uniqueid']]['name'],queues[_0x2dc2f9[_0xca43('0x6')]][_0xca43('0x67')]));}}catch(_0x381778){utils[_0xca43('0x46')](util[_0xca43('0x4')]('[%s][queues][musiconholdstart]',_0x2dc2f9[_0xca43('0x6')]),_0x381778);}};exports['musiconholdstop']=function(_0xe8b582){try{if(!_['isNil'](queues[_0xe8b582[_0xca43('0x6')]])){if(!_[_0xca43('0x16')](queues[_0xe8b582[_0xca43('0x6')]][_0xca43('0x67')])){utils['debug'](util['format'](_0xca43('0x69'),_0xe8b582[_0xca43('0x6')]),_0xe8b582);queues[_0xe8b582[_0xca43('0x6')]]['mohtime']+=utils[_0xca43('0x35')](utils['now'](),queues[_0xe8b582[_0xca43('0x6')]][_0xca43('0x67')]);utils['info'](util['format'](_0xca43('0x6a'),_0xe8b582['uniqueid'],queues[_0xe8b582[_0xca43('0x6')]][_0xca43('0x1f')],queues[_0xe8b582[_0xca43('0x6')]]['mohtime']));delete queues[_0xe8b582[_0xca43('0x6')]][_0xca43('0x67')];}}}catch(_0x57340c){utils[_0xca43('0x46')](util[_0xca43('0x4')](_0xca43('0x69'),_0xe8b582[_0xca43('0x6')]),_0x57340c);}}; \ No newline at end of file +var _0x8084=['debug','info','position','uniqueid','assign','error','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertype','ATTENDED','origtransfererexten','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin'];(function(_0x5cd333,_0x21b696){var _0x4dc408=function(_0x44ffd3){while(--_0x44ffd3){_0x5cd333['push'](_0x5cd333['shift']());}};_0x4dc408(++_0x21b696);}(_0x8084,0x126));var _0x4808=function(_0x40b2c2,_0x376f83){_0x40b2c2=_0x40b2c2-0x0;var _0x35098f=_0x8084[_0x40b2c2];return _0x35098f;};'use strict';var _=require('lodash');var util=require(_0x4808('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x5684ec){utils['info'](util[_0x4808('0x1')](_0x4808('0x2'),_0x5684ec['uniqueid'],_0x5684ec['channel'],_0x5684ec[_0x4808('0x3')],_0x5684ec[_0x4808('0x4')],_0x5684ec[_0x4808('0x5')],_0x5684ec[_0x4808('0x6')],_0x5684ec[_0x4808('0x7')]));if(_0x5684ec[_0x4808('0x3')]){utils[_0x4808('0x8')](_0x5684ec['queue'])[_0x4808('0x9')](function(_0x184dee){if(_0x184dee){_0x5684ec[_0x4808('0xa')]=_0x184dee[_0x4808('0xa')];}utils['request'](_0x4808('0xb'),_0x5684ec);});}else{utils[_0x4808('0xc')](_0x4808('0xb'),_0x5684ec);}if(_0x5684ec[_0x4808('0xd')]){delete queues[_0x5684ec[_0x4808('0xd')]];}else{delete queues[_0x5684ec['uniqueid']];}}exports[_0x4808('0xe')]=function(_0x57f526){try{utils[_0x4808('0xf')](util[_0x4808('0x1')]('[%s][queues][queuecallerjoin]',_0x57f526['uniqueid']),_0x57f526);utils[_0x4808('0x10')](util[_0x4808('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x57f526['uniqueid'],_0x57f526[_0x4808('0x3')],_0x57f526[_0x4808('0x11')]));queues[_0x57f526[_0x4808('0x12')]]=_[_0x4808('0x13')](_0x57f526,{'originalposition':_0x57f526[_0x4808('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x379a5a){utils[_0x4808('0x14')](util['format']('[%s][queues][queuecallerjoin]',_0x57f526[_0x4808('0x12')]),_0x379a5a);}};exports['hangup']=function(_0x4eff18){try{if(!_[_0x4808('0x15')](queues[_0x4eff18['uniqueid']])){utils[_0x4808('0xf')](util[_0x4808('0x1')]('[%s][queues][hangup]',_0x4eff18['uniqueid']),_0x4eff18);if(queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x16')]){if(!queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x17')]&&!queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x18')]){queues[_0x4eff18[_0x4808('0x12')]]['queuecallercomplete']=!![];queues[_0x4eff18[_0x4808('0x12')]]['queuecallercompleteAt']=utils[_0x4808('0x19')]();queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x7')]=_0x4808('0x1a');}utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x1b'),_0x4eff18[_0x4808('0x12')],queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x1c')],queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x7')]));writeDB(queues[_0x4eff18[_0x4808('0x12')]]);}else if(queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0xd')]){utils[_0x4808('0x10')](util['format'](_0x4808('0x1d'),_0x4eff18[_0x4808('0x12')],queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0x1c')],queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0xd')]));queues[queues[_0x4eff18[_0x4808('0x12')]][_0x4808('0xd')]]=queues[_0x4eff18[_0x4808('0x12')]];queues[queues[_0x4eff18['uniqueid']][_0x4808('0xd')]][_0x4808('0x1e')]=0x2;delete queues[_0x4eff18['uniqueid']];}}}catch(_0x45e543){utils['error'](util[_0x4808('0x1')](_0x4808('0x1f'),_0x4eff18['uniqueid']),_0x45e543);}};exports[_0x4808('0x20')]=function(_0x4ea63b){try{utils[_0x4808('0xf')](util[_0x4808('0x1')]('[%s][queues][varset]',_0x4ea63b[_0x4808('0x12')]),_0x4ea63b);if(!_[_0x4808('0x15')](_0x4ea63b[_0x4808('0x21')][_0x4808('0x22')])&&_0x4ea63b[_0x4808('0x23')][_0x4808('0x24')]()!==_0x4808('0x25')){if(!_[_0x4808('0x15')](queues[_0x4ea63b[_0x4808('0x12')]])){queues[_0x4ea63b[_0x4808('0x12')]]['queuecallerabandon']=![];queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x26')]=null;queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x18')]=!![];queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x27')]=utils['now']();queues[_0x4ea63b['uniqueid']][_0x4808('0x7')]=_0x4ea63b['value'][_0x4808('0x24')]();utils[_0x4808('0x10')](util['format'](_0x4808('0x28'),_0x4ea63b[_0x4808('0x12')],queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x1c')],_0x4ea63b['value'],queues[_0x4ea63b['uniqueid']][_0x4808('0x7')]));writeDB(queues[_0x4ea63b[_0x4808('0x12')]]);}}else if(!_['isNil'](_0x4ea63b[_0x4808('0x21')][_0x4808('0x29')])){if(!_[_0x4808('0x15')](queues[_0x4ea63b[_0x4808('0x12')]])&&!queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x17')]){queues[_0x4ea63b['uniqueid']]['queuecallerabandon']=![];queues[_0x4ea63b[_0x4808('0x12')]]['queuecallerabandonAt']=null;queues[_0x4ea63b['uniqueid']][_0x4808('0x18')]=!![];queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x27')]=utils[_0x4808('0x19')]();queues[_0x4ea63b[_0x4808('0x12')]][_0x4808('0x7')]=_0x4808('0x2a');utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x2b'),_0x4ea63b[_0x4808('0x12')],queues[_0x4ea63b['uniqueid']][_0x4808('0x1c')],_0x4ea63b[_0x4808('0x23')],queues[_0x4ea63b['uniqueid']][_0x4808('0x7')]));}}}catch(_0x1e7642){utils[_0x4808('0x14')](util[_0x4808('0x1')]('[%s][queues][varset]',_0x4ea63b[_0x4808('0x12')]),_0x1e7642);}};exports[_0x4808('0x17')]=function(_0x1d6e01){try{if(!_[_0x4808('0x15')](queues[_0x1d6e01[_0x4808('0x12')]])){utils[_0x4808('0xf')](util[_0x4808('0x1')](_0x4808('0x2c'),_0x1d6e01['uniqueid']),_0x1d6e01);queues[_0x1d6e01['uniqueid']]['queuecallerexit']=![];queues[_0x1d6e01['uniqueid']][_0x4808('0x27')]=null;queues[_0x1d6e01[_0x4808('0x12')]][_0x4808('0x17')]=!![];queues[_0x1d6e01[_0x4808('0x12')]]['queuecallerabandonAt']=utils[_0x4808('0x19')]();queues[_0x1d6e01[_0x4808('0x12')]][_0x4808('0x7')]=_0x4808('0x2d');utils['info'](util['format'](_0x4808('0x2e'),_0x1d6e01['uniqueid'],queues[_0x1d6e01[_0x4808('0x12')]][_0x4808('0x1c')],queues[_0x1d6e01[_0x4808('0x12')]][_0x4808('0x7')]));}}catch(_0x368a62){utils['error'](util[_0x4808('0x1')](_0x4808('0x2c'),_0x1d6e01[_0x4808('0x12')]),_0x368a62);}};exports[_0x4808('0x2f')]=function(_0x584428){try{if(!_[_0x4808('0x15')](queues[_0x584428[_0x4808('0x12')]])){utils['debug'](util[_0x4808('0x1')]('[%s][queues][queuecallerleave]',_0x584428['uniqueid']),_0x584428);utils[_0x4808('0x10')](util[_0x4808('0x1')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x584428[_0x4808('0x12')],queues[_0x584428[_0x4808('0x12')]]['name'],_0x584428['connectedlinenum'],_0x584428[_0x4808('0x30')]));queues[_0x584428[_0x4808('0x12')]][_0x4808('0x2f')]=!![];queues[_0x584428[_0x4808('0x12')]][_0x4808('0x16')]=utils['now']();queues[_0x584428[_0x4808('0x12')]][_0x4808('0x31')]=utils[_0x4808('0x32')](queues[_0x584428[_0x4808('0x12')]][_0x4808('0x16')],queues[_0x584428['uniqueid']][_0x4808('0x33')]);queues[_0x584428[_0x4808('0x12')]][_0x4808('0x11')]=_0x584428[_0x4808('0x11')];queues[_0x584428[_0x4808('0x12')]][_0x4808('0x34')]=_0x584428['count'];queues[_0x584428['uniqueid']][_0x4808('0x35')]=_0x584428['connectedlinenum'];queues[_0x584428[_0x4808('0x12')]][_0x4808('0x30')]=_0x584428['connectedlinename'];}}catch(_0x113905){utils[_0x4808('0x14')](util[_0x4808('0x1')](_0x4808('0x36'),_0x584428[_0x4808('0x12')]),_0x113905);}};exports[_0x4808('0x37')]=function(_0x9475ed){try{if(!_[_0x4808('0x15')](queues[_0x9475ed['uniqueid']])){utils[_0x4808('0xf')](util[_0x4808('0x1')](_0x4808('0x38'),_0x9475ed['uniqueid']),_0x9475ed);utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x39'),_0x9475ed[_0x4808('0x12')],queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x1c')],_0x9475ed['membername'],_0x9475ed[_0x4808('0x3a')]));queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x17')]=![];queues[_0x9475ed['uniqueid']]['queuecallerabandon']=![];queues[_0x9475ed[_0x4808('0x12')]]['queuecallerabandonAt']=null;queues[_0x9475ed['uniqueid']][_0x4808('0x18')]=![];queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x7')]=null;queues[_0x9475ed[_0x4808('0x12')]]['queuecallerexitAt']=null;queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x3b')]=!![];queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x6')]=_0x9475ed[_0x4808('0x3a')];queues[_0x9475ed[_0x4808('0x12')]][_0x4808('0x4')]=_0x9475ed[_0x4808('0x3c')];}}catch(_0x280362){utils['error'](util[_0x4808('0x1')](_0x4808('0x38'),_0x9475ed[_0x4808('0x12')]),_0x280362);}};exports[_0x4808('0x3d')]=function(_0x5ca216){try{if(!_[_0x4808('0x15')](queues[_0x5ca216[_0x4808('0x12')]])){if(queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x16')]){utils[_0x4808('0xf')](util[_0x4808('0x1')](_0x4808('0x3e'),_0x5ca216[_0x4808('0x12')]),_0x5ca216);queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x17')]=![];queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x17')]=![];queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x26')]=null;queues[_0x5ca216[_0x4808('0x12')]]['queuecallerexit']=![];queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x27')]=null;queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x3b')]=!![];queues[_0x5ca216[_0x4808('0x12')]]['lastAssignedTo']=_0x5ca216['membername'];queues[_0x5ca216['uniqueid']][_0x4808('0x3f')]=!![];queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x40')]=utils['now']();if(_0x5ca216[_0x4808('0x41')]==_0x4808('0x42')){if(!queues[_0x5ca216[_0x4808('0x12')]]['transfer']){queues[_0x5ca216[_0x4808('0x12')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x5ca216['uniqueid']][_0x4808('0x7')]=_0x4808('0x43')+_0x5ca216[_0x4808('0x41')][_0x4808('0x24')]();}utils[_0x4808('0x10')](util['format'](_0x4808('0x44'),_0x5ca216[_0x4808('0x12')],queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x1c')],_0x5ca216[_0x4808('0x3c')],queues[_0x5ca216[_0x4808('0x12')]][_0x4808('0x7')]));writeDB(queues[_0x5ca216[_0x4808('0x12')]]);}}}catch(_0x3ce130){utils[_0x4808('0x14')](util[_0x4808('0x1')](_0x4808('0x3e'),_0x5ca216['uniqueid']),_0x3ce130);}};exports[_0x4808('0x45')]=function(_0x31b866){try{if(!_['isNil'](queues[_0x31b866[_0x4808('0x46')]])){utils[_0x4808('0xf')](util[_0x4808('0x1')]('[%s][queues][blindtransfer]',_0x31b866['uniqueid']),_0x31b866);queues[_0x31b866[_0x4808('0x46')]][_0x4808('0x42')]=!![];queues[_0x31b866['transfereeuniqueid']]['transfertype']=_0x4808('0x47');queues[_0x31b866[_0x4808('0x46')]][_0x4808('0x48')]=_0x31b866[_0x4808('0x49')];queues[_0x31b866['transfereeuniqueid']][_0x4808('0x4a')]=_0x31b866[_0x4808('0x46')];queues[_0x31b866[_0x4808('0x46')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x4b'),_0x31b866['uniqueid'],queues[_0x31b866[_0x4808('0x46')]][_0x4808('0x1c')],_0x31b866[_0x4808('0x46')],_0x31b866['extension']));}}catch(_0x2cdbeb){utils['error'](util[_0x4808('0x1')](_0x4808('0x4c'),_0x31b866[_0x4808('0x12')]),_0x2cdbeb);}};exports[_0x4808('0x4d')]=function(_0x57b92){try{utils[_0x4808('0xf')](util['format'](_0x4808('0x4e'),_0x57b92[_0x4808('0x4f')]),_0x57b92);if(_0x57b92[_0x4808('0x4f')]==_0x57b92['origtransfererlinkedid']){if(!_[_0x4808('0x15')](queues[_0x57b92[_0x4808('0x50')]])){utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x51'),_0x57b92[_0x4808('0x4f')],queues[_0x57b92[_0x4808('0x50')]]['name'],_0x57b92['origtransfererexten']));queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x42')]=!![];queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x52')]=_0x4808('0x53');queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x48')]=_0x57b92[_0x4808('0x54')];queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x4a')]=_0x57b92[_0x4808('0x4f')];queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x4808('0x15')](queues[_0x57b92[_0x4808('0x55')]])){if(_0x57b92[_0x4808('0x56')]&&queues[_0x57b92['transfereelinkedid']]){queues[_0x57b92[_0x4808('0x56')]][_0x4808('0x1e')]=0x1;queues[_0x57b92[_0x4808('0x46')]]=_[_0x4808('0x57')](queues[_0x57b92[_0x4808('0x56')]]);queues[_0x57b92[_0x4808('0x46')]][_0x4808('0xd')]=_0x57b92[_0x4808('0x58')];queues[_0x57b92[_0x4808('0x46')]]['queuecallerenterreason']=0x2;queues[_0x57b92['transfereeuniqueid']][_0x4808('0x5')]=queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x5')];queues[_0x57b92[_0x4808('0x46')]][_0x4808('0x59')]=queues[_0x57b92[_0x4808('0x50')]][_0x4808('0x59')];queues[_0x57b92[_0x4808('0x46')]][_0x4808('0x33')]=utils['now']();queues[_0x57b92[_0x4808('0x46')]][_0x4808('0x16')]=utils['now']();queues[_0x57b92['transfereeuniqueid']][_0x4808('0x31')]=0x0;queues[_0x57b92['transfereeuniqueid']][_0x4808('0x5a')]=0x0;utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x5b'),_0x57b92[_0x4808('0x4f')],queues[_0x57b92['transfereeuniqueid']][_0x4808('0x1c')],queues[_0x57b92['transfereeuniqueid']][_0x4808('0x5')],queues[_0x57b92['transfereeuniqueid']][_0x4808('0x59')]));}else{utils[_0x4808('0x10')](util['format'](_0x4808('0x5c'),_0x57b92['origtransfereruniqueid'],queues[_0x57b92[_0x4808('0x55')]]['name'],_0x57b92[_0x4808('0x50')]));queues[_0x57b92[_0x4808('0x55')]]['transfereduniqueid']=_0x57b92[_0x4808('0x50')];}}}else if(_0x57b92[_0x4808('0x5d')]==_0x57b92[_0x4808('0x50')]){if(!_['isNil'](queues[_0x57b92[_0x4808('0x55')]])){utils[_0x4808('0x10')](util['format'](_0x4808('0x5e'),_0x57b92[_0x4808('0x4f')],queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x1c')],_0x57b92['secondtransfereruniqueid'],_0x57b92[_0x4808('0x5f')]));queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x42')]=!![];queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x52')]=_0x4808('0x53');queues[_0x57b92['origtransfererlinkedid']][_0x4808('0x48')]=_0x57b92['secondtransfererexten'];queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x4a')]=_0x57b92[_0x4808('0x5d')];queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x7')]=_0x4808('0x60');}if(!_['isNil'](queues[_0x57b92['secondtransfererlinkedid']])){if(_0x57b92[_0x4808('0x61')]&&queues[_0x57b92[_0x4808('0x61')]]){queues[_0x57b92[_0x4808('0x61')]][_0x4808('0x1e')]=0x1;queues[_0x57b92[_0x4808('0x58')]]=_[_0x4808('0x57')](queues[_0x57b92[_0x4808('0x61')]]);queues[_0x57b92[_0x4808('0x58')]]['transfereduniqueid']=_0x57b92[_0x4808('0x58')];queues[_0x57b92[_0x4808('0x58')]]['queuecallerenterreason']=0x2;queues[_0x57b92[_0x4808('0x58')]][_0x4808('0x5')]=queues[_0x57b92[_0x4808('0x55')]][_0x4808('0x5')];queues[_0x57b92[_0x4808('0x58')]]['calleridname']=queues[_0x57b92[_0x4808('0x55')]]['calleridname'];queues[_0x57b92['transfertargetuniqueid']][_0x4808('0x33')]=utils[_0x4808('0x19')]();queues[_0x57b92[_0x4808('0x58')]][_0x4808('0x16')]=utils[_0x4808('0x19')]();queues[_0x57b92[_0x4808('0x58')]][_0x4808('0x31')]=0x0;queues[_0x57b92[_0x4808('0x58')]]['mohtime']=0x0;utils[_0x4808('0x10')](util[_0x4808('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x57b92[_0x4808('0x4f')],queues[_0x57b92[_0x4808('0x58')]][_0x4808('0x1c')],queues[_0x57b92[_0x4808('0x58')]][_0x4808('0xd')],queues[_0x57b92['transfertargetuniqueid']]['calleridnum'],queues[_0x57b92[_0x4808('0x58')]]['calleridname']));}else{utils[_0x4808('0x10')](util['format'](_0x4808('0x5c'),_0x57b92[_0x4808('0x4f')],queues[_0x57b92['secondtransfererlinkedid']][_0x4808('0x1c')],_0x57b92[_0x4808('0x55')]));queues[_0x57b92[_0x4808('0x50')]]['transfereduniqueid']=_0x57b92[_0x4808('0x55')];}}}}catch(_0x177de8){utils[_0x4808('0x14')](util[_0x4808('0x1')](_0x4808('0x4e'),_0x57b92[_0x4808('0x4f')]),_0x177de8);}};exports['musiconholdstart']=function(_0x4c96fc){try{if(!_[_0x4808('0x15')](queues[_0x4c96fc[_0x4808('0x12')]])){utils['debug'](util[_0x4808('0x1')]('[%s][queues][musiconholdstart]',_0x4c96fc[_0x4808('0x12')]),_0x4c96fc);queues[_0x4c96fc[_0x4808('0x12')]]['musiconholdstartAt']=utils['now']();utils[_0x4808('0x10')](util['format'](_0x4808('0x62'),_0x4c96fc[_0x4808('0x12')],queues[_0x4c96fc[_0x4808('0x12')]]['name'],queues[_0x4c96fc[_0x4808('0x12')]][_0x4808('0x63')]));}}catch(_0x18c330){utils[_0x4808('0x14')](util[_0x4808('0x1')]('[%s][queues][musiconholdstart]',_0x4c96fc[_0x4808('0x12')]),_0x18c330);}};exports[_0x4808('0x64')]=function(_0x28398b){try{if(!_[_0x4808('0x15')](queues[_0x28398b['uniqueid']])){if(!_[_0x4808('0x15')](queues[_0x28398b[_0x4808('0x12')]]['musiconholdstartAt'])){utils['debug'](util[_0x4808('0x1')](_0x4808('0x65'),_0x28398b[_0x4808('0x12')]),_0x28398b);queues[_0x28398b['uniqueid']]['mohtime']+=utils['diffTime'](utils['now'](),queues[_0x28398b[_0x4808('0x12')]]['musiconholdstartAt']);utils[_0x4808('0x10')](util[_0x4808('0x1')](_0x4808('0x66'),_0x28398b[_0x4808('0x12')],queues[_0x28398b[_0x4808('0x12')]][_0x4808('0x1c')],queues[_0x28398b[_0x4808('0x12')]][_0x4808('0x5a')]));delete queues[_0x28398b[_0x4808('0x12')]][_0x4808('0x63')];}}}catch(_0x160452){utils['error'](util[_0x4808('0x1')]('[%s][queues][musiconholdstop]',_0x28398b[_0x4808('0x12')]),_0x160452);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 38c0bdc..b38975e 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 _0x91fd=['replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith'];(function(_0xb7ce58,_0x2c8d93){var _0x3a2b50=function(_0x573898){while(--_0x573898){_0xb7ce58['push'](_0xb7ce58['shift']());}};_0x3a2b50(++_0x2c8d93);}(_0x91fd,0x10f));var _0xd91f=function(_0x1ae79c,_0x5b0135){_0x1ae79c=_0x1ae79c-0x0;var _0x4b8636=_0x91fd[_0x1ae79c];return _0x4b8636;};'use strict';var _=require(_0xd91f('0x0'));var util=require('util');var utils=require(_0xd91f('0x1'));var recordings={};function writeDB(_0x6a97f2){utils['info'](util[_0xd91f('0x2')](_0xd91f('0x3'),_0x6a97f2[_0xd91f('0x4')]));if(_0x6a97f2[_0xd91f('0x5')]){utils[_0xd91f('0x6')](_0x6a97f2[_0xd91f('0x5')])[_0xd91f('0x7')](function(_0x55e959){if(_0x55e959){_0x6a97f2[_0xd91f('0x8')]=_0x55e959['name'];_0x6a97f2[_0xd91f('0x9')]=_0x55e959['id'];}utils[_0xd91f('0xa')](_0xd91f('0xb'),_0x6a97f2);});}else{utils[_0xd91f('0xa')](_0xd91f('0xb'),_0x6a97f2);}}exports['newchannel']=function(_0x21eae1){try{utils[_0xd91f('0xc')](util[_0xd91f('0x2')](_0xd91f('0xd'),_0x21eae1[_0xd91f('0x4')]),_0x21eae1);if(_0x21eae1[_0xd91f('0x4')]==_0x21eae1[_0xd91f('0xe')]){utils[_0xd91f('0xf')](util['format'](_0xd91f('0x10'),_0x21eae1[_0xd91f('0x4')],_0x21eae1[_0xd91f('0x11')],_0x21eae1[_0xd91f('0x12')]));recordings[_0x21eae1[_0xd91f('0x4')]]={'uniqueid':_0x21eae1[_0xd91f('0x4')],'accountcode':_0x21eae1[_0xd91f('0x5')],'exten':_0x21eae1['exten'],'context':_0x21eae1[_0xd91f('0x11')],'channel':_0x21eae1['channel'],'monitors':[]};}}catch(_0x2c6720){utils[_0xd91f('0x13')](util[_0xd91f('0x2')](_0xd91f('0xd'),_0x21eae1['uniqueid']),_0x2c6720);}};exports[_0xd91f('0x14')]=function(_0x4cb408){try{utils['debug'](util[_0xd91f('0x2')](_0xd91f('0x15'),_0x4cb408[_0xd91f('0x4')]),_0x4cb408);if(!_['isNil'](recordings[_0x4cb408['uniqueid']])&&_0x4cb408[_0xd91f('0x16')]==0x6){utils[_0xd91f('0xf')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4cb408[_0xd91f('0x4')],_0x4cb408[_0xd91f('0x11')],_0x4cb408['channel']));}else if(!_[_0xd91f('0x17')](recordings[_0x4cb408['linkedid']])&&_0x4cb408[_0xd91f('0x16')]==0x6&&_0x4cb408[_0xd91f('0x11')]!=_0xd91f('0x18')){utils['info'](util['format'](_0xd91f('0x19'),_0x4cb408['uniqueid'],_0x4cb408[_0xd91f('0xe')],_0x4cb408[_0xd91f('0x11')],_0x4cb408[_0xd91f('0x1a')]));recordings[_0x4cb408[_0xd91f('0xe')]][_0xd91f('0x5')]=_0x4cb408[_0xd91f('0x5')];}}catch(_0x19e531){utils[_0xd91f('0x13')](util[_0xd91f('0x2')](_0xd91f('0x15'),_0x4cb408[_0xd91f('0x4')]),_0x19e531);}};exports[_0xd91f('0x1b')]=function(_0x1ae973){try{if(!_[_0xd91f('0x17')](_0x1ae973[_0xd91f('0x1c')])&&!_[_0xd91f('0x17')](_0x1ae973[_0xd91f('0x1c')][_0xd91f('0x1d')])){utils[_0xd91f('0xc')](util['format'](_0xd91f('0x1e'),_0x1ae973[_0xd91f('0x4')]),_0x1ae973);utils[_0xd91f('0xf')](util[_0xd91f('0x2')](_0xd91f('0x1f'),_0x1ae973[_0xd91f('0x4')],_0x1ae973[_0xd91f('0x1c')],_0x1ae973[_0xd91f('0x20')]));if(_[_0xd91f('0x21')](_0x1ae973[_0xd91f('0x20')],'.wav49')){_0x1ae973[_0xd91f('0x20')]=_0x1ae973[_0xd91f('0x20')][_0xd91f('0x22')](_0xd91f('0x23'),_0xd91f('0x24'));}if(recordings[_0x1ae973[_0xd91f('0xe')]]){var _0xf8cb93=_[_0xd91f('0x25')](recordings[_0x1ae973['linkedid']][_0xd91f('0x26')],{'value':_0x1ae973[_0xd91f('0x20')]});if(_[_0xd91f('0x17')](_0xf8cb93)){recordings[_0x1ae973[_0xd91f('0xe')]][_0xd91f('0x26')][_0xd91f('0x27')]({'value':_0x1ae973['value']});}}}}catch(_0x3c41b8){utils[_0xd91f('0x13')](util[_0xd91f('0x2')](_0xd91f('0x1e'),_0x1ae973[_0xd91f('0x4')]),_0x3c41b8);}};exports[_0xd91f('0x28')]=function(_0xe68425){try{if(!_[_0xd91f('0x17')](recordings[_0xe68425[_0xd91f('0x4')]])){utils['debug'](util[_0xd91f('0x2')](_0xd91f('0x29'),_0xe68425[_0xd91f('0x4')]),_0xe68425);utils[_0xd91f('0xf')](util[_0xd91f('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0xe68425[_0xd91f('0x4')],_0xe68425[_0xd91f('0x2a')],_0xe68425[_0xd91f('0x2b')],_0xe68425[_0xd91f('0x2c')]));recordings[_0xe68425[_0xd91f('0x4')]][_0xd91f('0x2a')]=_0xe68425['calleridnum'];recordings[_0xe68425[_0xd91f('0x4')]]['calleridname']=_0xe68425[_0xd91f('0x2b')];recordings[_0xe68425[_0xd91f('0x4')]]['connectedlinenum']=_0xe68425[_0xd91f('0x2d')];recordings[_0xe68425[_0xd91f('0x4')]]['connectedlinename']=_0xe68425[_0xd91f('0x2e')];if(recordings[_0xe68425[_0xd91f('0x4')]]['type']=='outbound'&&recordings[_0xe68425[_0xd91f('0x4')]][_0xd91f('0x5')]){recordings[_0xe68425['uniqueid']]['connectedlinenum']=recordings[_0xe68425[_0xd91f('0x4')]][_0xd91f('0x5')];recordings[_0xe68425[_0xd91f('0x4')]][_0xd91f('0x2e')]='';}recordings[_0xe68425[_0xd91f('0x4')]][_0xd91f('0x26')]['forEach'](function(_0x12f4ec){var _0x48e53f=_[_0xd91f('0x2f')](recordings[_0xe68425[_0xd91f('0x4')]]);_0x48e53f[_0xd91f('0x20')]=_0x12f4ec[_0xd91f('0x20')];writeDB(_0x48e53f);});delete recordings[_0xe68425[_0xd91f('0x4')]];}}catch(_0x50eeee){utils[_0xd91f('0x13')](util[_0xd91f('0x2')]('[%s][recordings][hangup]',_0xe68425[_0xd91f('0x4')]),_0x50eeee);}};exports[_0xd91f('0x30')]=function(_0x22900d){try{if(!_[_0xd91f('0x17')](recordings[_0x22900d[_0xd91f('0x4')]])){utils['debug'](util[_0xd91f('0x2')](_0xd91f('0x31'),_0x22900d[_0xd91f('0x4')]),_0x22900d);utils['info'](util[_0xd91f('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x22900d[_0xd91f('0x4')],_0x22900d['application'],_0x22900d[_0xd91f('0x32')]));if(_0x22900d[_0xd91f('0x33')][_0xd91f('0x34')]()==_0xd91f('0x35')&&_['startsWith'](_0x22900d[_0xd91f('0x32')][_0xd91f('0x34')](),_0xd91f('0x36'))){var _0x1913fa=_0x22900d[_0xd91f('0x32')][_0xd91f('0x37')]('=');var _0x3480bf=_0x1913fa[0x0][_0xd91f('0x38')](_0x1913fa[0x0][_0xd91f('0x39')]('(')+0x1,_0x1913fa[0x0]['lastIndexOf'](')'));var _0x3b1d8e=_0x1913fa[0x1];recordings[_0x22900d[_0xd91f('0x4')]][_0x3480bf]=_0x3b1d8e;}}}catch(_0x12bb62){utils[_0xd91f('0x13')](util[_0xd91f('0x2')](_0xd91f('0x31'),_0x22900d[_0xd91f('0x4')]),_0x12bb62);}};exports[_0xd91f('0x3a')]=function(_0x58c715){try{if(!_[_0xd91f('0x17')](recordings[_0x58c715[_0xd91f('0x4')]])){utils[_0xd91f('0xc')](util[_0xd91f('0x2')](_0xd91f('0x3b'),_0x58c715['uniqueid']),_0x58c715);utils[_0xd91f('0xf')](util[_0xd91f('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x58c715[_0xd91f('0x4')],_0x58c715['queue']));recordings[_0x58c715[_0xd91f('0x4')]][_0xd91f('0x3c')]=_0x58c715['queue'];}}catch(_0x12f93c){utils[_0xd91f('0x13')](util['format'](_0xd91f('0x3b'),_0x58c715[_0xd91f('0x4')]),_0x12f93c);}}; \ No newline at end of file +var _0x189a=['linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','debug'];(function(_0x37e3bc,_0x151a0e){var _0x50936a=function(_0x258579){while(--_0x258579){_0x37e3bc['push'](_0x37e3bc['shift']());}};_0x50936a(++_0x151a0e);}(_0x189a,0x73));var _0xa189=function(_0xb8cd7a,_0x589939){_0xb8cd7a=_0xb8cd7a-0x0;var _0x4d2fc7=_0x189a[_0xb8cd7a];return _0x4d2fc7;};'use strict';var _=require(_0xa189('0x0'));var util=require(_0xa189('0x1'));var utils=require(_0xa189('0x2'));var recordings={};function writeDB(_0x519d9d){utils['info'](util[_0xa189('0x3')](_0xa189('0x4'),_0x519d9d[_0xa189('0x5')]));if(_0x519d9d[_0xa189('0x6')]){utils[_0xa189('0x7')](_0x519d9d[_0xa189('0x6')])[_0xa189('0x8')](function(_0x1da177){if(_0x1da177){_0x519d9d[_0xa189('0x9')]=_0x1da177[_0xa189('0xa')];_0x519d9d[_0xa189('0xb')]=_0x1da177['id'];}utils[_0xa189('0xc')](_0xa189('0xd'),_0x519d9d);});}else{utils[_0xa189('0xc')](_0xa189('0xd'),_0x519d9d);}}exports['newchannel']=function(_0xfeb5f9){try{utils[_0xa189('0xe')](util[_0xa189('0x3')]('[%s][recordings][newchannel]',_0xfeb5f9['uniqueid']),_0xfeb5f9);if(_0xfeb5f9[_0xa189('0x5')]==_0xfeb5f9[_0xa189('0xf')]){utils['info'](util[_0xa189('0x3')](_0xa189('0x10'),_0xfeb5f9['uniqueid'],_0xfeb5f9['context'],_0xfeb5f9[_0xa189('0x11')]));recordings[_0xfeb5f9[_0xa189('0x5')]]={'uniqueid':_0xfeb5f9['uniqueid'],'accountcode':_0xfeb5f9[_0xa189('0x6')],'exten':_0xfeb5f9[_0xa189('0x11')],'context':_0xfeb5f9[_0xa189('0x12')],'channel':_0xfeb5f9[_0xa189('0x13')],'monitors':[]};}}catch(_0x5ba597){utils[_0xa189('0x14')](util['format'](_0xa189('0x15'),_0xfeb5f9[_0xa189('0x5')]),_0x5ba597);}};exports[_0xa189('0x16')]=function(_0x589604){try{utils[_0xa189('0xe')](util[_0xa189('0x3')]('[%s][recordings][newstate]',_0x589604[_0xa189('0x5')]),_0x589604);if(!_[_0xa189('0x17')](recordings[_0x589604['uniqueid']])&&_0x589604[_0xa189('0x18')]==0x6){utils[_0xa189('0x19')](util['format'](_0xa189('0x1a'),_0x589604[_0xa189('0x5')],_0x589604[_0xa189('0x12')],_0x589604['channel']));}else if(!_[_0xa189('0x17')](recordings[_0x589604['linkedid']])&&_0x589604[_0xa189('0x18')]==0x6&&_0x589604[_0xa189('0x12')]!=_0xa189('0x1b')){utils[_0xa189('0x19')](util[_0xa189('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x589604[_0xa189('0x5')],_0x589604[_0xa189('0xf')],_0x589604['context'],_0x589604[_0xa189('0x13')]));recordings[_0x589604[_0xa189('0xf')]][_0xa189('0x6')]=_0x589604[_0xa189('0x6')];}}catch(_0x59f073){utils[_0xa189('0x14')](util[_0xa189('0x3')](_0xa189('0x1c'),_0x589604[_0xa189('0x5')]),_0x59f073);}};exports[_0xa189('0x1d')]=function(_0x2e456a){try{if(!_[_0xa189('0x17')](_0x2e456a[_0xa189('0x1e')])&&!_[_0xa189('0x17')](_0x2e456a[_0xa189('0x1e')][_0xa189('0x1f')])){utils[_0xa189('0xe')](util['format'](_0xa189('0x20'),_0x2e456a['uniqueid']),_0x2e456a);utils[_0xa189('0x19')](util['format'](_0xa189('0x21'),_0x2e456a['uniqueid'],_0x2e456a[_0xa189('0x1e')],_0x2e456a[_0xa189('0x22')]));if(_[_0xa189('0x23')](_0x2e456a[_0xa189('0x22')],_0xa189('0x24'))){_0x2e456a[_0xa189('0x22')]=_0x2e456a['value']['replace'](_0xa189('0x24'),_0xa189('0x25'));}if(recordings[_0x2e456a[_0xa189('0xf')]]){var _0x1f82de=_[_0xa189('0x26')](recordings[_0x2e456a[_0xa189('0xf')]][_0xa189('0x27')],{'value':_0x2e456a[_0xa189('0x22')]});if(_[_0xa189('0x17')](_0x1f82de)){recordings[_0x2e456a[_0xa189('0xf')]][_0xa189('0x27')][_0xa189('0x28')]({'value':_0x2e456a[_0xa189('0x22')]});}}}}catch(_0x1d7067){utils[_0xa189('0x14')](util['format']('[%s][recordings][varset]',_0x2e456a[_0xa189('0x5')]),_0x1d7067);}};exports[_0xa189('0x29')]=function(_0x4355ff){try{if(!_[_0xa189('0x17')](recordings[_0x4355ff[_0xa189('0x5')]])){utils[_0xa189('0xe')](util[_0xa189('0x3')]('[%s][recordings][hangup]',_0x4355ff['uniqueid']),_0x4355ff);utils[_0xa189('0x19')](util[_0xa189('0x3')](_0xa189('0x2a'),_0x4355ff[_0xa189('0x5')],_0x4355ff[_0xa189('0x2b')],_0x4355ff['calleridname'],_0x4355ff['cause-txt']));recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2b')]=_0x4355ff[_0xa189('0x2b')];recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2c')]=_0x4355ff['calleridname'];recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2d')]=_0x4355ff[_0xa189('0x2d')];recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2e')]=_0x4355ff[_0xa189('0x2e')];if(recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2f')]==_0xa189('0x30')&&recordings[_0x4355ff[_0xa189('0x5')]]['accountcode']){recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2d')]=recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x6')];recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x2e')]='';}recordings[_0x4355ff[_0xa189('0x5')]][_0xa189('0x27')][_0xa189('0x31')](function(_0x201daa){var _0x30556c=_['clone'](recordings[_0x4355ff[_0xa189('0x5')]]);_0x30556c['value']=_0x201daa[_0xa189('0x22')];writeDB(_0x30556c);});delete recordings[_0x4355ff[_0xa189('0x5')]];}}catch(_0x509c36){utils[_0xa189('0x14')](util[_0xa189('0x3')](_0xa189('0x32'),_0x4355ff[_0xa189('0x5')]),_0x509c36);}};exports['newexten']=function(_0x33bd3b){try{if(!_[_0xa189('0x17')](recordings[_0x33bd3b[_0xa189('0x5')]])){utils[_0xa189('0xe')](util['format']('[%s][recordings][newexten]',_0x33bd3b[_0xa189('0x5')]),_0x33bd3b);utils[_0xa189('0x19')](util['format'](_0xa189('0x33'),_0x33bd3b['uniqueid'],_0x33bd3b[_0xa189('0x34')],_0x33bd3b[_0xa189('0x35')]));if(_0x33bd3b[_0xa189('0x34')]['toLowerCase']()==_0xa189('0x36')&&_[_0xa189('0x37')](_0x33bd3b[_0xa189('0x35')][_0xa189('0x38')](),_0xa189('0x39'))){var _0x73cd46=_0x33bd3b[_0xa189('0x35')]['split']('=');var _0x3929f2=_0x73cd46[0x0][_0xa189('0x3a')](_0x73cd46[0x0]['lastIndexOf']('(')+0x1,_0x73cd46[0x0][_0xa189('0x3b')](')'));var _0x4d9610=_0x73cd46[0x1];recordings[_0x33bd3b['uniqueid']][_0x3929f2]=_0x4d9610;}}}catch(_0x477273){utils[_0xa189('0x14')](util[_0xa189('0x3')](_0xa189('0x3c'),_0x33bd3b[_0xa189('0x5')]),_0x477273);}};exports[_0xa189('0x3d')]=function(_0x3cfed8){try{if(!_[_0xa189('0x17')](recordings[_0x3cfed8[_0xa189('0x5')]])){utils[_0xa189('0xe')](util[_0xa189('0x3')](_0xa189('0x3e'),_0x3cfed8['uniqueid']),_0x3cfed8);utils['info'](util['format'](_0xa189('0x3f'),_0x3cfed8[_0xa189('0x5')],_0x3cfed8['queue']));recordings[_0x3cfed8[_0xa189('0x5')]][_0xa189('0x40')]=_0x3cfed8[_0xa189('0x40')];}}catch(_0x102cea){utils[_0xa189('0x14')](util[_0xa189('0x3')](_0xa189('0x3e'),_0x3cfed8['uniqueid']),_0x102cea);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f8ac275..703071b 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 _0xde80=['transferercalleridnum','transfereecalleridname','blind','error','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x3374b6,_0x2ded11){var _0x5d2cdd=function(_0x45c083){while(--_0x45c083){_0x3374b6['push'](_0x3374b6['shift']());}};_0x5d2cdd(++_0x2ded11);}(_0xde80,0x141));var _0x0de8=function(_0x173e76,_0x1fc71f){_0x173e76=_0x173e76-0x0;var _0x12ea30=_0xde80[_0x173e76];return _0x12ea30;};'use strict';var _=require(_0x0de8('0x0'));var util=require('util');var utils=require(_0x0de8('0x1'));function writeDB(_0x62cff1){utils[_0x0de8('0x2')](util[_0x0de8('0x3')](_0x0de8('0x4'),_0x62cff1[_0x0de8('0x5')]===_0x0de8('0x6')?_0x62cff1['origtransfereruniqueid']:_0x62cff1[_0x0de8('0x7')],_0x62cff1['type']));utils[_0x0de8('0x8')](_0x0de8('0x9'),_0x62cff1);}exports['blindtransfer']=function(_0x475ae9){try{utils['debug'](util[_0x0de8('0x3')](_0x0de8('0xa'),_0x475ae9['uniqueid']),_0x475ae9);utils[_0x0de8('0x2')](util[_0x0de8('0x3')](_0x0de8('0xb'),_0x475ae9[_0x0de8('0x7')],_0x475ae9[_0x0de8('0xc')],_0x475ae9['transferercalleridname'],_0x475ae9['transfereecalleridnum'],_0x475ae9[_0x0de8('0xd')]));_0x475ae9[_0x0de8('0x5')]=_0x0de8('0xe');writeDB(_0x475ae9);}catch(_0x563106){utils[_0x0de8('0xf')](util[_0x0de8('0x3')](_0x0de8('0xa'),_0x475ae9['uniqueid']),_0x563106);}};exports['attendedtransfer']=function(_0x209334){try{utils[_0x0de8('0x10')](util[_0x0de8('0x3')](_0x0de8('0x11'),_0x209334[_0x0de8('0x12')]),_0x209334);utils[_0x0de8('0x2')](util[_0x0de8('0x3')](_0x0de8('0x13'),_0x209334[_0x0de8('0x12')],_0x209334['origtransferercalleridnum'],_0x209334[_0x0de8('0x14')],_0x209334['transfertargetcalleridnum'],_0x209334[_0x0de8('0x15')]));_0x209334=_[_0x0de8('0x16')](_0x209334,{'transfererchannel':_0x209334['origtransfererchannel'],'transferercalleridnum':_0x209334[_0x0de8('0x17')],'transferercalleridname':_0x209334[_0x0de8('0x14')],'transfererconnectedlinenum':_0x209334['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x209334[_0x0de8('0x18')],'transfereraccountcode':_0x209334[_0x0de8('0x19')],'transferercontext':_0x209334[_0x0de8('0x1a')],'transfererexten':_0x209334['secondtransfererexten'],'transfererlinkedid':_0x209334[_0x0de8('0x1b')],'context':_0x209334[_0x0de8('0x1c')],'extension':_0x209334[_0x0de8('0x1d')],'type':_0x0de8('0x6')});if(_['isNil'](_0x209334[_0x0de8('0x1e')])){_0x209334=_[_0x0de8('0x16')](_0x209334,{'transfereechannel':_0x209334['transfertargetchannel'],'transfereecalleridnum':_0x209334[_0x0de8('0x1f')],'transfereecalleridname':_0x209334['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x209334[_0x0de8('0x20')],'transfereeconnectedlinename':_0x209334[_0x0de8('0x21')],'transfereeaccountcode':_0x209334[_0x0de8('0x22')],'transfereecontext':_0x209334[_0x0de8('0x23')],'transfereeexten':_0x209334[_0x0de8('0x24')],'transfereelinkedid':_0x209334['transfertargetlinkedid']});}writeDB(_0x209334);}catch(_0x2a6eb7){utils[_0x0de8('0xf')](util['format'](_0x0de8('0x11'),_0x209334[_0x0de8('0x12')]),_0x2a6eb7);}}; \ No newline at end of file +var _0xce57=['transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x188b6c,_0x5308a4){var _0x46e2c5=function(_0x41023b){while(--_0x41023b){_0x188b6c['push'](_0x188b6c['shift']());}};_0x46e2c5(++_0x5308a4);}(_0xce57,0x123));var _0x7ce5=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xce57[_0x368bba];return _0x409f8f;};'use strict';var _=require('lodash');var util=require(_0x7ce5('0x0'));var utils=require('./utils');function writeDB(_0x281b57){utils[_0x7ce5('0x1')](util[_0x7ce5('0x2')](_0x7ce5('0x3'),_0x281b57[_0x7ce5('0x4')]==='attended'?_0x281b57[_0x7ce5('0x5')]:_0x281b57[_0x7ce5('0x6')],_0x281b57['type']));utils[_0x7ce5('0x7')](_0x7ce5('0x8'),_0x281b57);}exports[_0x7ce5('0x9')]=function(_0x1e6709){try{utils[_0x7ce5('0xa')](util['format'](_0x7ce5('0xb'),_0x1e6709[_0x7ce5('0x6')]),_0x1e6709);utils['info'](util['format'](_0x7ce5('0xc'),_0x1e6709[_0x7ce5('0x6')],_0x1e6709[_0x7ce5('0xd')],_0x1e6709[_0x7ce5('0xe')],_0x1e6709['transfereecalleridnum'],_0x1e6709[_0x7ce5('0xf')]));_0x1e6709[_0x7ce5('0x4')]=_0x7ce5('0x10');writeDB(_0x1e6709);}catch(_0xb073fe){utils[_0x7ce5('0x11')](util['format'](_0x7ce5('0xb'),_0x1e6709[_0x7ce5('0x6')]),_0xb073fe);}};exports['attendedtransfer']=function(_0x4a296d){try{utils[_0x7ce5('0xa')](util[_0x7ce5('0x2')](_0x7ce5('0x12'),_0x4a296d['origtransfereruniqueid']),_0x4a296d);utils[_0x7ce5('0x1')](util[_0x7ce5('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4a296d[_0x7ce5('0x5')],_0x4a296d[_0x7ce5('0x13')],_0x4a296d[_0x7ce5('0x14')],_0x4a296d[_0x7ce5('0x15')],_0x4a296d[_0x7ce5('0x16')]));_0x4a296d=_[_0x7ce5('0x17')](_0x4a296d,{'transfererchannel':_0x4a296d[_0x7ce5('0x18')],'transferercalleridnum':_0x4a296d[_0x7ce5('0x13')],'transferercalleridname':_0x4a296d[_0x7ce5('0x14')],'transfererconnectedlinenum':_0x4a296d[_0x7ce5('0x19')],'transfererconnectedlinename':_0x4a296d['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4a296d[_0x7ce5('0x1a')],'transferercontext':_0x4a296d[_0x7ce5('0x1b')],'transfererexten':_0x4a296d[_0x7ce5('0x1c')],'transfererlinkedid':_0x4a296d[_0x7ce5('0x1d')],'context':_0x4a296d[_0x7ce5('0x1e')],'extension':_0x4a296d[_0x7ce5('0x1f')],'type':'attended'});if(_[_0x7ce5('0x20')](_0x4a296d[_0x7ce5('0x21')])){_0x4a296d=_[_0x7ce5('0x17')](_0x4a296d,{'transfereechannel':_0x4a296d[_0x7ce5('0x22')],'transfereecalleridnum':_0x4a296d[_0x7ce5('0x15')],'transfereecalleridname':_0x4a296d[_0x7ce5('0x16')],'transfereeconnectedlinenum':_0x4a296d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4a296d[_0x7ce5('0x23')],'transfereeaccountcode':_0x4a296d['transfertargetaccountcode'],'transfereecontext':_0x4a296d[_0x7ce5('0x24')],'transfereeexten':_0x4a296d[_0x7ce5('0x25')],'transfereelinkedid':_0x4a296d['transfertargetlinkedid']});}writeDB(_0x4a296d);}catch(_0x5c5045){utils[_0x7ce5('0x11')](util['format'](_0x7ce5('0x12'),_0x4a296d[_0x7ce5('0x5')]),_0x5c5045);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 173e9e0..3256ad8 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 _0x3e9c=['name','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','interface','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3e9c[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require(_0xc3e9('0x0'));var jayson=require(_0xc3e9('0x1'));var moment=require(_0xc3e9('0x2'));var util=require(_0xc3e9('0x3'));var client=jayson[_0xc3e9('0x4')][_0xc3e9('0x5')]({'port':0x2329});var logger=require(_0xc3e9('0x6'))(_0xc3e9('0x7'));exports[_0xc3e9('0x8')]=function(_0x14921b,_0x2c0c59){logger[_0xc3e9('0x8')](_0x14921b,_0x2c0c59?util[_0xc3e9('0x9')](_0x2c0c59,{'showHidden':![],'depth':null}):'');};exports[_0xc3e9('0xa')]=function(_0x41b9cc,_0x27eaf3){logger[_0xc3e9('0xa')](_0x41b9cc,_0x27eaf3?util[_0xc3e9('0x9')](_0x27eaf3,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x16f094,_0x27bac7){logger[_0xc3e9('0xb')](_0x16f094,_0x27bac7?util[_0xc3e9('0x9')](_0x27bac7,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x11e70b,_0x5156a2){return client[_0xc3e9('0xc')](_0x11e70b,{'body':_0x5156a2})[_0xc3e9('0xd')](function(_0x2dc41f){logger[_0xc3e9('0xa')](_0xc3e9('0xe'),_0x11e70b,_0x2dc41f?util[_0xc3e9('0x9')](_0x2dc41f,{'showHidden':![],'depth':null}):'');})[_0xc3e9('0xf')](function(_0x1de8a6){logger['error'](_0xc3e9('0xe'),_0x11e70b,_0x1de8a6?util['inspect'](_0x1de8a6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x7ec84d){return client['request'](_0xc3e9('0x10'),{'options':{'raw':!![],'attributes':['id',_0xc3e9('0x11'),'name',_0xc3e9('0x12')],'where':_0x7ec84d,'limit':0x1}})[_0xc3e9('0xd')](function(_0x4036b5){logger[_0xc3e9('0xa')]('[utils][getUser]\x20where:%s',JSON[_0xc3e9('0x13')](_0x7ec84d),_0x4036b5?util['inspect'](_0x4036b5,{'showHidden':![],'depth':null}):'');return _0x4036b5[_0xc3e9('0x14')]['length']?_0x4036b5[_0xc3e9('0x14')][0x0]:null;});}exports[_0xc3e9('0x15')]=function(_0x36955e){return new BPromise(function(_0xa8cbf9,_0x117fb2){if(_0x36955e){return getUser({'internal':_0x36955e})[_0xc3e9('0xd')](function(_0x22a1d8){logger[_0xc3e9('0x8')](_0xc3e9('0x16'),_0x36955e,_0x22a1d8?_0xc3e9('0x17'):_0xc3e9('0x18'));return _0xa8cbf9(_0x22a1d8);})[_0xc3e9('0xf')](function(_0x3e9841){logger[_0xc3e9('0xb')]('[utils][getUserByInternal]',_0x3e9841?util[_0xc3e9('0x9')](_0x3e9841,{'showHidden':![],'depth':null}):'');return _0xa8cbf9(null);});}return _0xa8cbf9(null);});};exports[_0xc3e9('0x19')]=function(_0x48feec){return new BPromise(function(_0x22b7ea,_0x45a5a6){if(_0x48feec){return getUser({'interface':_0x48feec})[_0xc3e9('0xd')](function(_0x2ba2d6){logger[_0xc3e9('0x8')](_0xc3e9('0x1a'),_0x48feec,_0x2ba2d6?_0xc3e9('0x17'):_0xc3e9('0x18'));return _0x22b7ea(_0x2ba2d6);})[_0xc3e9('0xf')](function(_0x5eec2a){logger[_0xc3e9('0xb')](_0xc3e9('0x1b'),_0x5eec2a?util['inspect'](_0x5eec2a,{'showHidden':![],'depth':null}):'');return _0x22b7ea(null);});}return _0x22b7ea(null);});};exports['getUserByName']=function(_0x394a8a){return new BPromise(function(_0x501f97,_0x39781c){if(_0x394a8a){return getUser({'name':_0x394a8a})[_0xc3e9('0xd')](function(_0x390263){logger[_0xc3e9('0x8')](_0xc3e9('0x1c'),_0x394a8a,_0x390263?_0xc3e9('0x17'):'notfound');return _0x501f97(_0x390263);})['catch'](function(_0x3e10b6){logger[_0xc3e9('0xb')]('[utils][getUserByName]',_0x3e10b6?util[_0xc3e9('0x9')](_0x3e10b6,{'showHidden':![],'depth':null}):'');return _0x501f97(null);});}return _0x501f97(null);});};exports[_0xc3e9('0x1d')]=function(_0x460d6d){return new BPromise(function(_0x1040c9,_0x376128){if(_0x460d6d){return client[_0xc3e9('0xc')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xc3e9('0x1e'),_0xc3e9('0x1f'),'acw',_0xc3e9('0x20')],'where':{'name':_0x460d6d},'limit':0x1}})[_0xc3e9('0xd')](function(_0x3f44c5){logger[_0xc3e9('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x460d6d,_0x3f44c5?util[_0xc3e9('0x9')](_0x3f44c5,{'showHidden':![],'depth':null}):'');logger[_0xc3e9('0x8')](_0xc3e9('0x21'),_0x460d6d,_0x3f44c5?_0xc3e9('0x17'):_0xc3e9('0x18'));return _0x1040c9(_0x3f44c5[_0xc3e9('0x14')][_0xc3e9('0x22')]?_0x3f44c5[_0xc3e9('0x14')][0x0]:null);})[_0xc3e9('0xf')](function(_0x150977){logger[_0xc3e9('0xb')](_0xc3e9('0x23'),_0x150977?util[_0xc3e9('0x9')](_0x150977,{'showHidden':![],'depth':null}):'');return _0x1040c9(null);});}return _0x1040c9(null);});};exports[_0xc3e9('0x24')]=function(_0x240e59,_0x3216ca){return moment(_0x240e59)[_0xc3e9('0x25')](_0x3216ca,_0xc3e9('0x26'))[_0xc3e9('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x4c676d,_0x4c92dd){return moment(_0x4c676d)[_0xc3e9('0x28')](_0x4c92dd,_0xc3e9('0x26'))[_0xc3e9('0x27')](_0xc3e9('0x29'));};exports[_0xc3e9('0x2a')]=function(_0x2b7653,_0x18a13d){return moment(_0x2b7653)['diff'](moment(_0x18a13d),_0xc3e9('0x26'));};exports[_0xc3e9('0x2b')]=function(_0x5d00e9,_0x28f56f){return parseInt(_0x5d00e9,0xa)+parseInt(_0x28f56f,0xa);};exports[_0xc3e9('0x2c')]=function(){return moment()['format'](_0xc3e9('0x29'));};exports[_0xc3e9('0x2d')]=function(_0x281c1c,_0x21ad65){if(_0x21ad65){return moment(_0x281c1c)[_0xc3e9('0x2d')](_0x21ad65);}return!![];};exports[_0xc3e9('0x2e')]=function(_0x4692b9,_0x1ffc79){if(_0x1ffc79){return moment(_0x4692b9)[_0xc3e9('0x2e')](_0x1ffc79);}else if(_0x4692b9){return!![];}return![];}; \ No newline at end of file +var _0x77ed=['name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','diffTime','diff','sumTime','now','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','util','http','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x77ed,0x152));var _0xd77e=function(_0xe31bec,_0x538126){_0xe31bec=_0xe31bec-0x0;var _0x1ea969=_0x77ed[_0xe31bec];return _0x1ea969;};'use strict';var BPromise=require(_0xd77e('0x0'));var jayson=require(_0xd77e('0x1'));var moment=require('moment');var util=require(_0xd77e('0x2'));var client=jayson['client'][_0xd77e('0x3')]({'port':0x2329});var logger=require(_0xd77e('0x4'))('xdr');exports[_0xd77e('0x5')]=function(_0x2b1944,_0xd010bc){logger[_0xd77e('0x5')](_0x2b1944,_0xd010bc?util[_0xd77e('0x6')](_0xd010bc,{'showHidden':![],'depth':null}):'');};exports[_0xd77e('0x7')]=function(_0x557bf0,_0x3f26c4){logger['debug'](_0x557bf0,_0x3f26c4?util[_0xd77e('0x6')](_0x3f26c4,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x29e1fe,_0x321828){logger[_0xd77e('0x8')](_0x29e1fe,_0x321828?util[_0xd77e('0x6')](_0x321828,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x21e9b0,_0x1aacdb){return client['request'](_0x21e9b0,{'body':_0x1aacdb})[_0xd77e('0x9')](function(_0x1cb07a){logger['debug'](_0xd77e('0xa'),_0x21e9b0,_0x1cb07a?util['inspect'](_0x1cb07a,{'showHidden':![],'depth':null}):'');})[_0xd77e('0xb')](function(_0x4ed0db){logger[_0xd77e('0x8')](_0xd77e('0xa'),_0x21e9b0,_0x4ed0db?util[_0xd77e('0x6')](_0x4ed0db,{'showHidden':![],'depth':null}):'');});};function getUser(_0x505f50){return client[_0xd77e('0xc')](_0xd77e('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xd77e('0xe'),_0xd77e('0xf')],'where':_0x505f50,'limit':0x1}})[_0xd77e('0x9')](function(_0x181a3e){logger['debug'](_0xd77e('0x10'),JSON['stringify'](_0x505f50),_0x181a3e?util[_0xd77e('0x6')](_0x181a3e,{'showHidden':![],'depth':null}):'');return _0x181a3e[_0xd77e('0x11')][_0xd77e('0x12')]?_0x181a3e[_0xd77e('0x11')][0x0]:null;});}exports[_0xd77e('0x13')]=function(_0x34bb93){return new BPromise(function(_0x4818be,_0x4945d8){if(_0x34bb93){return getUser({'internal':_0x34bb93})[_0xd77e('0x9')](function(_0x4bc023){logger[_0xd77e('0x5')](_0xd77e('0x14'),_0x34bb93,_0x4bc023?_0xd77e('0x15'):_0xd77e('0x16'));return _0x4818be(_0x4bc023);})[_0xd77e('0xb')](function(_0x57c9ff){logger[_0xd77e('0x8')]('[utils][getUserByInternal]',_0x57c9ff?util[_0xd77e('0x6')](_0x57c9ff,{'showHidden':![],'depth':null}):'');return _0x4818be(null);});}return _0x4818be(null);});};exports[_0xd77e('0x17')]=function(_0x3036b7){return new BPromise(function(_0x38c8f3,_0xe0cc83){if(_0x3036b7){return getUser({'interface':_0x3036b7})[_0xd77e('0x9')](function(_0x581131){logger[_0xd77e('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3036b7,_0x581131?'found':'notfound');return _0x38c8f3(_0x581131);})[_0xd77e('0xb')](function(_0x9f33ca){logger[_0xd77e('0x8')](_0xd77e('0x18'),_0x9f33ca?util[_0xd77e('0x6')](_0x9f33ca,{'showHidden':![],'depth':null}):'');return _0x38c8f3(null);});}return _0x38c8f3(null);});};exports[_0xd77e('0x19')]=function(_0x1e22d2){return new BPromise(function(_0x4e1457,_0xc2c7ac){if(_0x1e22d2){return getUser({'name':_0x1e22d2})[_0xd77e('0x9')](function(_0x2bbe19){logger[_0xd77e('0x5')](_0xd77e('0x1a'),_0x1e22d2,_0x2bbe19?_0xd77e('0x15'):_0xd77e('0x16'));return _0x4e1457(_0x2bbe19);})[_0xd77e('0xb')](function(_0x333646){logger[_0xd77e('0x8')](_0xd77e('0x1b'),_0x333646?util['inspect'](_0x333646,{'showHidden':![],'depth':null}):'');return _0x4e1457(null);});}return _0x4e1457(null);});};exports['getVoiceQueueByName']=function(_0x168988){return new BPromise(function(_0xf3dfdb,_0x1a4aaf){if(_0x168988){return client[_0xd77e('0xc')](_0xd77e('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xd77e('0xe'),_0xd77e('0x1d'),_0xd77e('0x1e'),_0xd77e('0x1f')],'where':{'name':_0x168988},'limit':0x1}})[_0xd77e('0x9')](function(_0x26a861){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x168988,_0x26a861?util[_0xd77e('0x6')](_0x26a861,{'showHidden':![],'depth':null}):'');logger[_0xd77e('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x168988,_0x26a861?'found':_0xd77e('0x16'));return _0xf3dfdb(_0x26a861[_0xd77e('0x11')][_0xd77e('0x12')]?_0x26a861[_0xd77e('0x11')][0x0]:null);})[_0xd77e('0xb')](function(_0x520b0b){logger[_0xd77e('0x8')](_0xd77e('0x20'),_0x520b0b?util[_0xd77e('0x6')](_0x520b0b,{'showHidden':![],'depth':null}):'');return _0xf3dfdb(null);});}return _0xf3dfdb(null);});};exports[_0xd77e('0x21')]=function(_0x287585,_0x9c6156){return moment(_0x287585)['add'](_0x9c6156,_0xd77e('0x22'))[_0xd77e('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd77e('0x24')]=function(_0x3bfaf7,_0x5321e3){return moment(_0x3bfaf7)['subtract'](_0x5321e3,'seconds')[_0xd77e('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd77e('0x25')]=function(_0xd0fe10,_0x1a4b1){return moment(_0xd0fe10)[_0xd77e('0x26')](moment(_0x1a4b1),_0xd77e('0x22'));};exports[_0xd77e('0x27')]=function(_0x478fb7,_0x4d2a97){return parseInt(_0x478fb7,0xa)+parseInt(_0x4d2a97,0xa);};exports[_0xd77e('0x28')]=function(){return moment()[_0xd77e('0x23')](_0xd77e('0x29'));};exports[_0xd77e('0x2a')]=function(_0x1e7ec7,_0x3e0090){if(_0x3e0090){return moment(_0x1e7ec7)['isAfter'](_0x3e0090);}return!![];};exports[_0xd77e('0x2b')]=function(_0x542bfa,_0x9be5be){if(_0x9be5be){return moment(_0x542bfa)['isBefore'](_0x9be5be);}else if(_0x542bfa){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 0cc5c45..49765c8 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 _0x1253=['role','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','other','agent_name','setupLoggers','path','util','./safe-template','safeTemplate','maskSensitiveData','/var','join','client','name','then','catch','log','user','no-user','data','timestamp','error','api','auth','set','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x1253,0xdd));var _0x3125=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1253[_0x501510];return _0x1e6ee5;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require('express-winston');var path=require(_0x3125('0x0'));var util=require(_0x3125('0x1'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x3125('0x2'))[_0x3125('0x3')];var maskSensitiveData=require('./mask-sensitive-data')[_0x3125('0x4')];function ClientSideLogger(){function _0x2218a4(_0x54ff7c){var _0x10f969=path['join'](_0x3125('0x5'),'log','xcally');var _0x3e293d=path[_0x3125('0x6')](_0x3125('0x7'),_0x54ff7c['role']+'-'+_0x54ff7c[_0x3125('0x8')]);return fs['ensureDir'](path[_0x3125('0x6')](_0x10f969,_0x3e293d))[_0x3125('0x9')](function(){var _0x399bff=fileLogger(_0x3125('0x7'),path[_0x3125('0x6')](_0x10f969,_0x3e293d));return _0x399bff;})[_0x3125('0xa')](function(_0x202223){throw _0x202223;});}this[_0x3125('0xb')]=function(_0x13a7c0,_0x555b71,_0x12f2c4,_0x45831d){return _0x2218a4(_0x13a7c0[_0x3125('0xc')])[_0x3125('0x9')](function(_0x4de543){var _0x52a303=_0x4de543[_0x555b71];return _0x52a303;})[_0x3125('0x9')](function(_0x24427b){var _0x5b5bb2=_0x13a7c0[_0x3125('0xc')]?_0x13a7c0[_0x3125('0xc')]['id']:_0x3125('0xd');var _0x421587=_0x45831d[_0x3125('0xe')];var _0x18edaf=_0x45831d[_0x3125('0xf')];var _0xa7a515=new Date(Number(_0x18edaf));return _0x24427b(_0x5b5bb2,_0xa7a515,_0x12f2c4,_0x421587);})[_0x3125('0xa')](function(_0x348d00){fileLogger(_0x3125('0x7'))[_0x3125('0x10')](_0x348d00);});};}function setupLoggers(_0x4d7b5f){return new Promise(function(_0x19b468){var _0x102efb=new ClientSideLogger();var _0x242f37=fileLogger(_0x3125('0x11'));var _0x11ae2b=fileLogger(_0x3125('0x12'));_0x4d7b5f[_0x3125('0x13')]('client-side-logger',_0x102efb);_0x4d7b5f['use'](ewinston['logger']({'winstonInstance':_0x242f37,'meta':![],'statusLevels':!![],'msg':function(_0x3d1f,_0x19c556){var _0x236008=_0x3125('0x14');if(!_[_0x3125('0x15')](_0x3d1f[_0x3125('0x16')])){_0x236008+='\x20body=%s';var _0x2f935=_0x3d1f[_0x3125('0x16')];maskSensitiveData(_0x2f935);}return safeTemplate(util[_0x3125('0x17')](_0x236008,_0x3d1f['method'],_0x3d1f['headers'][_0x3125('0x18')]?_0x3d1f[_0x3125('0x19')][_0x3125('0x18')]:_0x3d1f[_0x3125('0x1a')][_0x3125('0x1b')]||_0x3d1f['ip'],_0x3d1f[_0x3125('0x1c')],_0x19c556[_0x3125('0x1d')],_0x19c556[_0x3125('0x1e')],_0x3d1f[_0x3125('0xc')]?_0x3d1f[_0x3125('0xc')]['id']:null,_0x3d1f['user']?_0x3d1f[_0x3125('0xc')]['name']:null,_0x3d1f[_0x3125('0xc')]?_0x3d1f[_0x3125('0xc')][_0x3125('0x1f')]:null,_0x2f935?util['inspect'](_0x2f935,![],null):''));}}));_0x4d7b5f[_0x3125('0x20')](ewinston[_0x3125('0x21')]({'winstonInstance':_0x11ae2b,'meta':![],'statusLevels':!![],'msg':function(_0x1ea7fd,_0xc695a2){var _0x261294=_0x3125('0x22');if(_0x1ea7fd[_0x3125('0x16')]&&_0x1ea7fd['body'][_0x3125('0x23')]&&_0x1ea7fd[_0x3125('0x16')][_0x3125('0x24')]){_0x261294=_0x3125('0x25');}return util[_0x3125('0x17')](_0x261294,_0x1ea7fd[_0x3125('0x26')],_0x1ea7fd[_0x3125('0x19')][_0x3125('0x18')]?_0x1ea7fd[_0x3125('0x19')][_0x3125('0x18')]:_0x1ea7fd[_0x3125('0x1a')][_0x3125('0x1b')]||_0x1ea7fd['ip'],_0x1ea7fd[_0x3125('0x1c')],_0xc695a2[_0x3125('0x1d')],_0xc695a2[_0x3125('0x1e')],_0x1ea7fd[_0x3125('0xc')]?_0x1ea7fd[_0x3125('0xc')]['id']:null,_0x1ea7fd[_0x3125('0xc')]?_0x1ea7fd[_0x3125('0xc')]['name']:null,_0x1ea7fd[_0x3125('0xc')]?_0x1ea7fd['user'][_0x3125('0x1f')]:null,_0x1ea7fd[_0x3125('0x16')]&&_0x1ea7fd[_0x3125('0x16')]['device']?_0x1ea7fd[_0x3125('0x16')][_0x3125('0x23')]:_0x3125('0x27'),_0x1ea7fd[_0x3125('0x16')]&&_0x1ea7fd[_0x3125('0x16')][_0x3125('0x24')]?_0x1ea7fd['body'][_0x3125('0x24')]:'',_0x1ea7fd[_0x3125('0x16')]&&_0x1ea7fd[_0x3125('0x16')][_0x3125('0x28')]?_0x1ea7fd['body'][_0x3125('0x28')]:'');},'ignoreRoute':function(_0x4f2ab8){var _0x2802ac=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2802ac['test'](_0x4f2ab8[_0x3125('0x1c')]);}}));return _0x19b468();});}exports[_0x3125('0x29')]=setupLoggers; \ No newline at end of file +var _0x8404=['maskSensitiveData','join','/var','log','client','name','ensureDir','then','user','no-user','data','timestamp','catch','api','set','logger','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','connection','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data'];(function(_0x26cd05,_0x1f7d74){var _0x3e13b9=function(_0x1af957){while(--_0x1af957){_0x26cd05['push'](_0x26cd05['shift']());}};_0x3e13b9(++_0x1f7d74);}(_0x8404,0x141));var _0x4840=function(_0x43e1e8,_0x271d02){_0x43e1e8=_0x43e1e8-0x0;var _0x34387d=_0x8404[_0x43e1e8];return _0x34387d;};var fs=require(_0x4840('0x0'));var _=require(_0x4840('0x1'));var ewinston=require(_0x4840('0x2'));var path=require('path');var util=require('util');var fileLogger=require(_0x4840('0x3'))[_0x4840('0x4')];var safeTemplate=require(_0x4840('0x5'))[_0x4840('0x6')];var maskSensitiveData=require(_0x4840('0x7'))[_0x4840('0x8')];function ClientSideLogger(){function _0x3a8d44(_0x261050){var _0x6aa9ae=path[_0x4840('0x9')](_0x4840('0xa'),_0x4840('0xb'),'xcally');var _0x3c0efb=path[_0x4840('0x9')](_0x4840('0xc'),_0x261050['role']+'-'+_0x261050[_0x4840('0xd')]);return fs[_0x4840('0xe')](path['join'](_0x6aa9ae,_0x3c0efb))[_0x4840('0xf')](function(){var _0x4f2efd=fileLogger(_0x4840('0xc'),path[_0x4840('0x9')](_0x6aa9ae,_0x3c0efb));return _0x4f2efd;})['catch'](function(_0x36e3c1){throw _0x36e3c1;});}this[_0x4840('0xb')]=function(_0x1c079e,_0x2cf22b,_0x62e8d2,_0x16201d){return _0x3a8d44(_0x1c079e[_0x4840('0x10')])[_0x4840('0xf')](function(_0x5af9f5){var _0x4f349d=_0x5af9f5[_0x2cf22b];return _0x4f349d;})[_0x4840('0xf')](function(_0x36fe4a){var _0x2c92d4=_0x1c079e[_0x4840('0x10')]?_0x1c079e[_0x4840('0x10')]['id']:_0x4840('0x11');var _0x207b4c=_0x16201d[_0x4840('0x12')];var _0x566d1f=_0x16201d[_0x4840('0x13')];var _0x4395bc=new Date(Number(_0x566d1f));return _0x36fe4a(_0x2c92d4,_0x4395bc,_0x62e8d2,_0x207b4c);})[_0x4840('0x14')](function(_0x4b540e){fileLogger(_0x4840('0xc'))['error'](_0x4b540e);});};}function setupLoggers(_0x34a448){return new Promise(function(_0xb6cdec){var _0x202b84=new ClientSideLogger();var _0x1cad9b=fileLogger(_0x4840('0x15'));var _0x5876f9=fileLogger('auth');_0x34a448[_0x4840('0x16')]('client-side-logger',_0x202b84);_0x34a448['use'](ewinston[_0x4840('0x17')]({'winstonInstance':_0x1cad9b,'meta':![],'statusLevels':!![],'msg':function(_0x3adabc,_0x51f57f){var _0x5907d7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x4840('0x18')](_0x3adabc[_0x4840('0x19')])){_0x5907d7+=_0x4840('0x1a');var _0x15255a=_0x3adabc[_0x4840('0x19')];maskSensitiveData(_0x15255a);}return safeTemplate(util['format'](_0x5907d7,_0x3adabc[_0x4840('0x1b')],_0x3adabc[_0x4840('0x1c')][_0x4840('0x1d')]?_0x3adabc[_0x4840('0x1c')][_0x4840('0x1d')]:_0x3adabc['connection'][_0x4840('0x1e')]||_0x3adabc['ip'],_0x3adabc[_0x4840('0x1f')],_0x51f57f[_0x4840('0x20')],_0x51f57f[_0x4840('0x21')],_0x3adabc[_0x4840('0x10')]?_0x3adabc['user']['id']:null,_0x3adabc[_0x4840('0x10')]?_0x3adabc[_0x4840('0x10')]['name']:null,_0x3adabc[_0x4840('0x10')]?_0x3adabc['user'][_0x4840('0x22')]:null,_0x15255a?util[_0x4840('0x23')](_0x15255a,![],null):''));}}));_0x34a448[_0x4840('0x24')](ewinston[_0x4840('0x17')]({'winstonInstance':_0x5876f9,'meta':![],'statusLevels':!![],'msg':function(_0x130576,_0x833c77){var _0x495bfe=_0x4840('0x25');if(_0x130576[_0x4840('0x19')]&&_0x130576[_0x4840('0x19')]['device']&&_0x130576['body'][_0x4840('0x26')]){_0x495bfe=_0x4840('0x27');}return util[_0x4840('0x28')](_0x495bfe,_0x130576['method'],_0x130576[_0x4840('0x1c')]['x-forwarded-for']?_0x130576[_0x4840('0x1c')][_0x4840('0x1d')]:_0x130576[_0x4840('0x29')][_0x4840('0x1e')]||_0x130576['ip'],_0x130576['url'],_0x833c77[_0x4840('0x20')],_0x833c77[_0x4840('0x21')],_0x130576[_0x4840('0x10')]?_0x130576[_0x4840('0x10')]['id']:null,_0x130576[_0x4840('0x10')]?_0x130576[_0x4840('0x10')][_0x4840('0xd')]:null,_0x130576[_0x4840('0x10')]?_0x130576[_0x4840('0x10')][_0x4840('0x22')]:null,_0x130576[_0x4840('0x19')]&&_0x130576[_0x4840('0x19')][_0x4840('0x2a')]?_0x130576[_0x4840('0x19')][_0x4840('0x2a')]:_0x4840('0x2b'),_0x130576['body']&&_0x130576[_0x4840('0x19')][_0x4840('0x26')]?_0x130576[_0x4840('0x19')][_0x4840('0x26')]:'',_0x130576[_0x4840('0x19')]&&_0x130576[_0x4840('0x19')][_0x4840('0x2c')]?_0x130576[_0x4840('0x19')][_0x4840('0x2c')]:'');},'ignoreRoute':function(_0x1ddf62){var _0x4060ef=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4060ef[_0x4840('0x2d')](_0x1ddf62['url']);}}));return _0xb6cdec();});}exports[_0x4840('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index c82630e..ca48e70 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd87e=['format','ddd','includes','dowCompare','date','max','min','MMM','monthCompare','guess','isMoment','split','padStart','length','iftime','moment-timezone','map','source','join','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','monthsShort','concat','exports','circularMonthInterval','clone','hours','minutes','isBefore','startOf','endOf','day','isBetween','timeCompare'];(function(_0x3e4e2c,_0x2fa4af){var _0x474e9d=function(_0x3fb0f4){while(--_0x3fb0f4){_0x3e4e2c['push'](_0x3e4e2c['shift']());}};_0x474e9d(++_0x2fa4af);}(_0xd87e,0x18b));var _0xed87=function(_0x45733e,_0x305175){_0x45733e=_0x45733e-0x0;var _0x15b259=_0xd87e[_0x45733e];return _0x15b259;};var _=require('lodash');var moment=require(_0xed87('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xed87('0x1')](function(_0xfe0c5d){return _0xfe0c5d[_0xed87('0x2')];})[_0xed87('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xed87('0x4');function throwIfDateNotValid(_0x5d92b4){if(!_0x5d92b4['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x121994){var _0x25437e=_0x121994['split'](':')[_0xed87('0x1')](function(_0x4960b8){return parseInt(_0x4960b8,0xa);});var _0x53eb73=_0x25437e[0x0];var _0x31e60d=_0x25437e[0x1];if(_0x53eb73<0x0||_0x53eb73>0x17||_0x31e60d<0x0||_0x31e60d>0x3b){throw new Error(EINVALID_DATE);}return[_0x53eb73,_0x31e60d];}function circularDoWInterval(_0x484354,_0x24d29b){if(_0x484354===_0x24d29b){return[_0x484354];}else{var _0x931840=moment[_0xed87('0x5')]();moment[_0xed87('0x5')]('en');var _0x2264c8=moment[_0xed87('0x6')]()['map'](function(_0x1c9b96){return _0x1c9b96[_0xed87('0x7')]();});moment[_0xed87('0x5')](_0x931840);var _0x5d2310=_0x2264c8[_0xed87('0x8')](_0x484354);var _0x42b56c=_0x2264c8[_0xed87('0x8')](_0x24d29b);if(_0x42b56c>_0x5d2310){return _0x2264c8[_0xed87('0x9')](_0x5d2310,_0x42b56c+0x1);}else{var _0x4a19bf=_0x2264c8['slice'](0x0,_0x42b56c+0x1);var _0x2ca804=_0x2264c8[_0xed87('0x9')](_0x5d2310);return _0x2ca804['concat'](_0x4a19bf);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x5231e6,_0x220614){if(_0x5231e6===_0x220614){return[_0x5231e6];}else{var _0x45400c=moment['locale']();moment[_0xed87('0x5')]('en');var _0x50bacd=moment[_0xed87('0xa')]()[_0xed87('0x1')](function(_0x2bc9b8){return _0x2bc9b8[_0xed87('0x7')]();});moment[_0xed87('0x5')](_0x45400c);var _0x26a080=_0x50bacd[_0xed87('0x8')](_0x5231e6);var _0x1c84d3=_0x50bacd['indexOf'](_0x220614);if(_0x1c84d3>_0x26a080){return _0x50bacd[_0xed87('0x9')](_0x26a080,_0x1c84d3+0x1);}else{var _0x4ee748=_0x50bacd[_0xed87('0x9')](0x0,_0x1c84d3+0x1);var _0x206acb=_0x50bacd[_0xed87('0x9')](_0x26a080);return _0x206acb[_0xed87('0xb')](_0x4ee748);}}}module[_0xed87('0xc')][_0xed87('0xd')]=circularMonthInterval;function parseDom(_0x176dd7){var _0x5d00de=parseInt(_0x176dd7,0xa);if(_0x5d00de<0x1||_0x5d00de>0x1f){throw new Error(EINVALID_DATE);}return _0x5d00de;}function timeCompare(_0x164a37,_0x1a9d94,_0x3d184f){var _0xa36cec=_0x164a37[_0xed87('0xe')]();var _0x28e9ce=extractTime(_0x1a9d94);var _0x4b85a4=_0x28e9ce[0x0];var _0x5f1f6d=_0x28e9ce[0x1];var _0x1ac682=_0x164a37['clone']()[_0xed87('0xf')](_0x4b85a4)[_0xed87('0x10')](_0x5f1f6d);throwIfDateNotValid(_0x1ac682);var _0x5829ab=extractTime(_0x3d184f);var _0x4d9525=_0x5829ab[0x0];var _0x9f1bbb=_0x5829ab[0x1];var _0x4610c9=_0x164a37[_0xed87('0xe')]()[_0xed87('0xf')](_0x4d9525)['minutes'](_0x9f1bbb);throwIfDateNotValid(_0x4610c9);if(_0x4610c9[_0xed87('0x11')](_0x1ac682)){var _0x192c1c=_0xa36cec[_0xed87('0xe')]()[_0xed87('0x12')]('day');var _0x48d39b=_0xa36cec[_0xed87('0xe')]()[_0xed87('0x13')](_0xed87('0x14'));return _0xa36cec['isBetween'](_0x1ac682,_0x48d39b,undefined,'[]')||_0xa36cec[_0xed87('0x15')](_0x192c1c,_0x4610c9,undefined,'[]');}else{return _0xa36cec[_0xed87('0x15')](_0x1ac682,_0x4610c9,undefined,'[]');}}module[_0xed87('0xc')][_0xed87('0x16')]=timeCompare;function dowCompare(_0x39c723,_0x2308de,_0x533aac){var _0x2beff0=_0x39c723['locale']('en')[_0xed87('0x17')](_0xed87('0x18'))[_0xed87('0x7')]();return circularDoWInterval(_0x2308de,_0x533aac)[_0xed87('0x19')](_0x2beff0);}module['exports'][_0xed87('0x1a')]=dowCompare;function domCompare(_0x46b0a2,_0xe2c866,_0x21c657){var _0x13e63c=_0x46b0a2[_0xed87('0x1b')]();if(_0xe2c866===_0x21c657){return _0x13e63c===_0xe2c866;}else{var _0x259eb0=_0x46b0a2['daysInMonth']();var _0x52b93a=_0xe2c866<_0x21c657;let _0x2e594e=![];var _0x2a62b7=0x0;var _0x512f23=0x0;if(_0x52b93a){_0x2a62b7=Math[_0xed87('0x1c')](0x1,_0xe2c866);_0x512f23=Math[_0xed87('0x1d')](_0x21c657,_0x259eb0);_0x2e594e=_0x13e63c>=_0x2a62b7&&_0x13e63c<=_0x512f23;}else{_0x2a62b7=Math[_0xed87('0x1d')](_0xe2c866,_0x259eb0);_0x512f23=Math[_0xed87('0x1c')](0x1,_0x21c657);_0x2e594e=_0x13e63c>=_0x2a62b7||_0x13e63c<=_0x512f23;}return _0x2e594e;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x5d7ad9,_0x28fd13,_0x203dbe){var _0x1e2de2=_0x5d7ad9[_0xed87('0x5')]('en')[_0xed87('0x17')](_0xed87('0x1e'))[_0xed87('0x7')]();return circularMonthInterval(_0x28fd13,_0x203dbe)['includes'](_0x1e2de2);}module['exports'][_0xed87('0x1f')]=monthCompare;function iftime(_0x2c0e24,_0x1d6e59=moment['tz'][_0xed87('0x20')](),_0x1dd113=moment()){if(!validateRx['test'](_0x2c0e24)){throw new Error(EINVALID_STRING);}else{var _0x5de4d0=(moment[_0xed87('0x21')](_0x1dd113)?_0x1dd113[_0xed87('0xe')]():moment(_0x1dd113))['tz'](_0x1d6e59)[_0xed87('0x5')]('en');throwIfDateNotValid(_0x5de4d0);var _0x5ec648=_0x2c0e24[_0xed87('0x22')](',');var _0x4d6533=_0x5ec648[0x0];var _0x54b6dd=_0x5ec648[0x1];var _0x1e1bcc=_0x5ec648[0x2];var _0x3417aa=_0x5ec648[0x3];let _0x413415=!![];if(_0x4d6533!=='*'){var _0x91eabe=_0x4d6533[_0xed87('0x22')]('-');var _0x16f39e=_[_0xed87('0x23')](_0x91eabe[0x0],0x5,'0');var _0x1601ba=_0x91eabe[_0xed87('0x24')]===0x2?_[_0xed87('0x23')](_0x91eabe[0x1],0x5,'0'):_0x16f39e;_0x413415=timeCompare(_0x5de4d0,_0x16f39e,_0x1601ba);}let _0x26bdd6=!![];if(_0x54b6dd!=='*'){var _0x14d5c6=_0x54b6dd[_0xed87('0x22')]('-');var _0x2d6df=_0x14d5c6[0x0];var _0x5b25ed=_0x14d5c6[_0xed87('0x24')]===0x2?_0x14d5c6[0x1]:_0x2d6df;_0x26bdd6=dowCompare(_0x5de4d0,_0x2d6df,_0x5b25ed);}let _0x6f8bd=!![];if(_0x1e1bcc!=='*'){var _0x3e19e5=_0x1e1bcc['split']('-');var _0xfc4874=parseDom(_0x3e19e5[0x0]);var _0x19f1d3=_0x3e19e5[_0xed87('0x24')]===0x2?parseDom(_0x3e19e5[0x1]):_0xfc4874;_0x6f8bd=domCompare(_0x5de4d0,_0xfc4874,_0x19f1d3);}let _0x5b6db3=!![];if(_0x3417aa!=='*'){var _0x5b587f=_0x3417aa['split']('-');var _0x3e27fa=_0x5b587f[0x0];var _0x2a8c33=_0x5b587f[_0xed87('0x24')]===0x2?_0x5b587f[0x1]:_0x5b587f[0x0];_0x5b6db3=monthCompare(_0x5de4d0,_0x3e27fa,_0x2a8c33);}return _0x413415&&_0x26bdd6&&_0x6f8bd&&_0x5b6db3;}}module['exports'][_0xed87('0x25')]=iftime; \ No newline at end of file +var _0x178d=['indexOf','slice','concat','exports','clone','hours','minutes','isBefore','day','isBetween','timeCompare','format','includes','dowCompare','date','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x178d,0x182));var _0xd178=function(_0x1a13e8,_0xb6c38d){_0x1a13e8=_0x1a13e8-0x0;var _0xc0f3c3=_0x178d[_0x1a13e8];return _0xc0f3c3;};var _=require(_0xd178('0x0'));var moment=require(_0xd178('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]['map'](function(_0x11ff61){return _0x11ff61[_0xd178('0x2')];})[_0xd178('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xd178('0x4');var EINVALID_DATE=_0xd178('0x5');function throwIfDateNotValid(_0x351c39){if(!_0x351c39['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x951026){var _0x61fd48=_0x951026[_0xd178('0x6')](':')[_0xd178('0x7')](function(_0x2c9389){return parseInt(_0x2c9389,0xa);});var _0x5d029c=_0x61fd48[0x0];var _0x3ed493=_0x61fd48[0x1];if(_0x5d029c<0x0||_0x5d029c>0x17||_0x3ed493<0x0||_0x3ed493>0x3b){throw new Error(EINVALID_DATE);}return[_0x5d029c,_0x3ed493];}function circularDoWInterval(_0x3df269,_0xe6d94a){if(_0x3df269===_0xe6d94a){return[_0x3df269];}else{var _0x5bc48b=moment[_0xd178('0x8')]();moment[_0xd178('0x8')]('en');var _0xaacd10=moment['weekdaysShort']()[_0xd178('0x7')](function(_0x22341d){return _0x22341d[_0xd178('0x9')]();});moment['locale'](_0x5bc48b);var _0x4935be=_0xaacd10[_0xd178('0xa')](_0x3df269);var _0x3ccd45=_0xaacd10[_0xd178('0xa')](_0xe6d94a);if(_0x3ccd45>_0x4935be){return _0xaacd10[_0xd178('0xb')](_0x4935be,_0x3ccd45+0x1);}else{var _0x5a0cca=_0xaacd10['slice'](0x0,_0x3ccd45+0x1);var _0x512095=_0xaacd10[_0xd178('0xb')](_0x4935be);return _0x512095[_0xd178('0xc')](_0x5a0cca);}}}module[_0xd178('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x37c189,_0x49d877){if(_0x37c189===_0x49d877){return[_0x37c189];}else{var _0x2df3a7=moment[_0xd178('0x8')]();moment[_0xd178('0x8')]('en');var _0x4211d5=moment['monthsShort']()[_0xd178('0x7')](function(_0x5026a5){return _0x5026a5[_0xd178('0x9')]();});moment[_0xd178('0x8')](_0x2df3a7);var _0x3c227a=_0x4211d5[_0xd178('0xa')](_0x37c189);var _0xef2c97=_0x4211d5[_0xd178('0xa')](_0x49d877);if(_0xef2c97>_0x3c227a){return _0x4211d5['slice'](_0x3c227a,_0xef2c97+0x1);}else{var _0x1d5456=_0x4211d5[_0xd178('0xb')](0x0,_0xef2c97+0x1);var _0x43fe88=_0x4211d5[_0xd178('0xb')](_0x3c227a);return _0x43fe88['concat'](_0x1d5456);}}}module[_0xd178('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0xa5eb89){var _0x44d14a=parseInt(_0xa5eb89,0xa);if(_0x44d14a<0x1||_0x44d14a>0x1f){throw new Error(EINVALID_DATE);}return _0x44d14a;}function timeCompare(_0x4fbb42,_0x106b28,_0x17881f){var _0x4dcad1=_0x4fbb42[_0xd178('0xe')]();var _0x587681=extractTime(_0x106b28);var _0x1f1068=_0x587681[0x0];var _0x4f093e=_0x587681[0x1];var _0x30a327=_0x4fbb42[_0xd178('0xe')]()[_0xd178('0xf')](_0x1f1068)[_0xd178('0x10')](_0x4f093e);throwIfDateNotValid(_0x30a327);var _0x49890e=extractTime(_0x17881f);var _0x3c83c6=_0x49890e[0x0];var _0x55e465=_0x49890e[0x1];var _0x516e0a=_0x4fbb42[_0xd178('0xe')]()[_0xd178('0xf')](_0x3c83c6)['minutes'](_0x55e465);throwIfDateNotValid(_0x516e0a);if(_0x516e0a[_0xd178('0x11')](_0x30a327)){var _0xdb0774=_0x4dcad1[_0xd178('0xe')]()['startOf'](_0xd178('0x12'));var _0x2f94b8=_0x4dcad1[_0xd178('0xe')]()['endOf'](_0xd178('0x12'));return _0x4dcad1[_0xd178('0x13')](_0x30a327,_0x2f94b8,undefined,'[]')||_0x4dcad1[_0xd178('0x13')](_0xdb0774,_0x516e0a,undefined,'[]');}else{return _0x4dcad1['isBetween'](_0x30a327,_0x516e0a,undefined,'[]');}}module[_0xd178('0xd')][_0xd178('0x14')]=timeCompare;function dowCompare(_0x2b5607,_0x1000b4,_0x9567d6){var _0x53da91=_0x2b5607[_0xd178('0x8')]('en')[_0xd178('0x15')]('ddd')[_0xd178('0x9')]();return circularDoWInterval(_0x1000b4,_0x9567d6)[_0xd178('0x16')](_0x53da91);}module[_0xd178('0xd')][_0xd178('0x17')]=dowCompare;function domCompare(_0x8cc601,_0x2e018d,_0x44801e){var _0x1dd339=_0x8cc601[_0xd178('0x18')]();if(_0x2e018d===_0x44801e){return _0x1dd339===_0x2e018d;}else{var _0x35eb02=_0x8cc601['daysInMonth']();var _0x2e26ec=_0x2e018d<_0x44801e;let _0x27e0ad=![];var _0x699247=0x0;var _0x308539=0x0;if(_0x2e26ec){_0x699247=Math[_0xd178('0x19')](0x1,_0x2e018d);_0x308539=Math[_0xd178('0x1a')](_0x44801e,_0x35eb02);_0x27e0ad=_0x1dd339>=_0x699247&&_0x1dd339<=_0x308539;}else{_0x699247=Math[_0xd178('0x1a')](_0x2e018d,_0x35eb02);_0x308539=Math['max'](0x1,_0x44801e);_0x27e0ad=_0x1dd339>=_0x699247||_0x1dd339<=_0x308539;}return _0x27e0ad;}}module[_0xd178('0xd')][_0xd178('0x1b')]=domCompare;function monthCompare(_0x1d6eac,_0x1fb6d9,_0x323ced){var _0x263fe7=_0x1d6eac[_0xd178('0x8')]('en')[_0xd178('0x15')](_0xd178('0x1c'))[_0xd178('0x9')]();return circularMonthInterval(_0x1fb6d9,_0x323ced)['includes'](_0x263fe7);}module[_0xd178('0xd')][_0xd178('0x1d')]=monthCompare;function iftime(_0x14e7f2,_0x2129b8=moment['tz'][_0xd178('0x1e')](),_0x26521a=moment()){if(!validateRx[_0xd178('0x1f')](_0x14e7f2)){throw new Error(EINVALID_STRING);}else{var _0x1d521b=(moment[_0xd178('0x20')](_0x26521a)?_0x26521a['clone']():moment(_0x26521a))['tz'](_0x2129b8)['locale']('en');throwIfDateNotValid(_0x1d521b);var _0x5590c6=_0x14e7f2[_0xd178('0x6')](',');var _0x51cf0e=_0x5590c6[0x0];var _0x3ae1f3=_0x5590c6[0x1];var _0x125f4f=_0x5590c6[0x2];var _0x5393cb=_0x5590c6[0x3];let _0x4f569e=!![];if(_0x51cf0e!=='*'){var _0x72d301=_0x51cf0e[_0xd178('0x6')]('-');var _0xedf1c2=_[_0xd178('0x21')](_0x72d301[0x0],0x5,'0');var _0x2418f8=_0x72d301[_0xd178('0x22')]===0x2?_[_0xd178('0x21')](_0x72d301[0x1],0x5,'0'):_0xedf1c2;_0x4f569e=timeCompare(_0x1d521b,_0xedf1c2,_0x2418f8);}let _0x2eda3c=!![];if(_0x3ae1f3!=='*'){var _0x14b9ac=_0x3ae1f3[_0xd178('0x6')]('-');var _0x497849=_0x14b9ac[0x0];var _0x546801=_0x14b9ac[_0xd178('0x22')]===0x2?_0x14b9ac[0x1]:_0x497849;_0x2eda3c=dowCompare(_0x1d521b,_0x497849,_0x546801);}let _0x1501b6=!![];if(_0x125f4f!=='*'){var _0x512fda=_0x125f4f[_0xd178('0x6')]('-');var _0x137f22=parseDom(_0x512fda[0x0]);var _0x68d55a=_0x512fda[_0xd178('0x22')]===0x2?parseDom(_0x512fda[0x1]):_0x137f22;_0x1501b6=domCompare(_0x1d521b,_0x137f22,_0x68d55a);}let _0x47c13a=!![];if(_0x5393cb!=='*'){var _0x4992fc=_0x5393cb[_0xd178('0x6')]('-');var _0x4ca38e=_0x4992fc[0x0];var _0x204200=_0x4992fc['length']===0x2?_0x4992fc[0x1]:_0x4992fc[0x0];_0x47c13a=monthCompare(_0x1d521b,_0x4ca38e,_0x204200);}return _0x4f569e&&_0x2eda3c&&_0x1501b6&&_0x47c13a;}}module['exports'][_0xd178('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 448308a..0203c1f 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f51=['transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','bold\x20white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','level','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger'];(function(_0x32b3c2,_0xe56fd){var _0x40a313=function(_0x51ba92){while(--_0x51ba92){_0x32b3c2['push'](_0x32b3c2['shift']());}};_0x40a313(++_0xe56fd);}(_0x1f51,0x119));var _0x11f5=function(_0x2e1047,_0x546d79){_0x2e1047=_0x2e1047-0x0;var _0x1aba6d=_0x1f51[_0x2e1047];return _0x1aba6d;};'use strict';var path=require(_0x11f5('0x0'));var util=require('util');var moment=require(_0x11f5('0x1'));var winston=require(_0x11f5('0x2'));var config=require(_0x11f5('0x3'));var debugLevel=config[_0x11f5('0x4')]?config['debugLevel'][_0x11f5('0x5')]():_0x11f5('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x11f5('0x7'),'warn':_0x11f5('0x8'),'info':'white','print':_0x11f5('0x9'),'success':'bold\x20green','http':_0x11f5('0xa'),'verbose':_0x11f5('0xb'),'debug':_0x11f5('0xc'),'silly':_0x11f5('0xd')};winston[_0x11f5('0xe')](XC_LOG_COLORS);function getLogFileName(_0x4fecb8,_0x3c3d0d,_0x3cdfbd){var _0x4efb4e=_0x4fecb8||_0x11f5('0xf');return path[_0x11f5('0x10')](_0x4efb4e,util[_0x11f5('0x11')]('%s-%s.log',_0x3c3d0d,_0x3cdfbd));}function formatter(_0x2235bd,_0x55f248){_0x55f248[_0x11f5('0x12')]=_0x55f248['message'][_0x11f5('0x13')](/@@{/g,_0x11f5('0x14'))[_0x11f5('0x13')](/}@@/g,'}}}')[_0x11f5('0x13')](/@{/g,'{{')[_0x11f5('0x13')](/}@/g,'}}');return util[_0x11f5('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x11f5('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x55f248[_0x11f5('0x15')]['toUpperCase'](),_0x2235bd,_0x55f248['message']);}function fileFormat(_0xdb6490,_0x2de24f){_0x2de24f[_0x11f5('0x12')]=_0x2de24f[_0x11f5('0x12')][_0x11f5('0x13')](/@@{/g,_0x11f5('0x14'))[_0x11f5('0x13')](/}@@/g,_0x11f5('0x16'))[_0x11f5('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x21d014=_0x2de24f[_0x11f5('0x17')]&&Object[_0x11f5('0x18')](_0x2de24f[_0x11f5('0x17')])[_0x11f5('0x19')]?'\x0a\x09'+JSON[_0x11f5('0x1a')](_0x2de24f['meta']):'';return util[_0x11f5('0x11')](_0x11f5('0x1b'),moment()['format'](_0x11f5('0x1c')),_0x2de24f[_0x11f5('0x15')][_0x11f5('0x1d')](),_0xdb6490,_0x2de24f[_0x11f5('0x12')],_0x21d014);}function consoleLogger(){var _0x51f88d=new winston[(_0x11f5('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x11f5('0x1f'))][(_0x11f5('0x20'))]({'level':_0x11f5('0x21'),'json':![],'formatter':function(_0x453629){return formatter('',_0x453629);}})]});return _0x51f88d;}function fileLogger(_0x16dc4e,_0x1339fb){var _0x2bb494=new winston[(_0x11f5('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x11f5('0x1f'))]['File']({'name':util[_0x11f5('0x11')](_0x11f5('0x22'),_0x16dc4e,'error'),'filename':getLogFileName(_0x1339fb,_0x16dc4e,_0x11f5('0x23')),'level':_0x11f5('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f23dd){return fileFormat(_0x16dc4e,_0x1f23dd);}}),new winston[(_0x11f5('0x1f'))][(_0x11f5('0x24'))]({'name':util[_0x11f5('0x11')](_0x11f5('0x22'),_0x16dc4e,debugLevel),'filename':getLogFileName(_0x1339fb,_0x16dc4e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b288d){return fileFormat(_0x16dc4e,_0x1b288d);}}),new winston['transports'][(_0x11f5('0x20'))]({'level':_0x11f5('0x21'),'json':![],'formatter':function(_0x2ff379){return fileFormat(_0x16dc4e,_0x2ff379);}})]});return _0x2bb494;}exports[_0x11f5('0x25')]=consoleLogger;exports[_0x11f5('0x26')]=fileLogger; \ No newline at end of file +var _0x83d2=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','warn','File','%s-%s','error','transports','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x83d2,0xd4));var _0x283d=function(_0x401e16,_0xf02481){_0x401e16=_0x401e16-0x0;var _0x2e46f0=_0x83d2[_0x401e16];return _0x2e46f0;};'use strict';var path=require(_0x283d('0x0'));var util=require(_0x283d('0x1'));var moment=require(_0x283d('0x2'));var winston=require(_0x283d('0x3'));var config=require(_0x283d('0x4'));var debugLevel=config[_0x283d('0x5')]?config['debugLevel'][_0x283d('0x6')]():_0x283d('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':_0x283d('0x8'),'error':'red','warn':_0x283d('0x9'),'info':_0x283d('0xa'),'print':'bold\x20white','success':_0x283d('0xb'),'http':_0x283d('0xc'),'verbose':_0x283d('0xd'),'debug':'bold\x20blue','silly':_0x283d('0xe')};winston[_0x283d('0xf')](XC_LOG_COLORS);function getLogFileName(_0x38330d,_0x468875,_0x23c8b6){var _0x465ea8=_0x38330d||_0x283d('0x10');return path[_0x283d('0x11')](_0x465ea8,util[_0x283d('0x12')](_0x283d('0x13'),_0x468875,_0x23c8b6));}function formatter(_0x595cec,_0x39de2a){_0x39de2a[_0x283d('0x14')]=_0x39de2a[_0x283d('0x14')][_0x283d('0x15')](/@@{/g,'{{{')[_0x283d('0x15')](/}@@/g,_0x283d('0x16'))['replace'](/@{/g,'{{')[_0x283d('0x15')](/}@/g,'}}');return util[_0x283d('0x12')](_0x283d('0x17'),moment()[_0x283d('0x12')](_0x283d('0x18')),_0x39de2a[_0x283d('0x19')][_0x283d('0x1a')](),_0x595cec,_0x39de2a[_0x283d('0x14')]);}function fileFormat(_0x290b77,_0x1532ee){_0x1532ee[_0x283d('0x14')]=_0x1532ee['message'][_0x283d('0x15')](/@@{/g,_0x283d('0x1b'))[_0x283d('0x15')](/}@@/g,_0x283d('0x16'))[_0x283d('0x15')](/@{/g,'{{')[_0x283d('0x15')](/}@/g,'}}');var _0xa935d3=_0x1532ee['meta']&&Object['keys'](_0x1532ee[_0x283d('0x1c')])['length']?'\x0a\x09'+JSON['stringify'](_0x1532ee[_0x283d('0x1c')]):'';return util[_0x283d('0x12')](_0x283d('0x1d'),moment()[_0x283d('0x12')](_0x283d('0x18')),_0x1532ee['level'][_0x283d('0x1a')](),_0x290b77,_0x1532ee['message'],_0xa935d3);}function consoleLogger(){var _0x59a5d6=new winston[(_0x283d('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x283d('0x1f'))]({'level':_0x283d('0x20'),'json':![],'formatter':function(_0x38a733){return formatter('',_0x38a733);}})]});return _0x59a5d6;}function fileLogger(_0xdbd63d,_0x5e3555){var _0x363a16=new winston[(_0x283d('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x283d('0x21'))]({'name':util[_0x283d('0x12')](_0x283d('0x22'),_0xdbd63d,_0x283d('0x23')),'filename':getLogFileName(_0x5e3555,_0xdbd63d,_0x283d('0x23')),'level':_0x283d('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1eb627){return fileFormat(_0xdbd63d,_0x1eb627);}}),new winston[(_0x283d('0x24'))][(_0x283d('0x21'))]({'name':util[_0x283d('0x12')](_0x283d('0x22'),_0xdbd63d,debugLevel),'filename':getLogFileName(_0x5e3555,_0xdbd63d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x45f20c){return fileFormat(_0xdbd63d,_0x45f20c);}}),new winston[(_0x283d('0x24'))][(_0x283d('0x1f'))]({'level':_0x283d('0x20'),'json':![],'formatter':function(_0x89b88a){return fileFormat(_0xdbd63d,_0x89b88a);}})]});return _0x363a16;}exports[_0x283d('0x25')]=consoleLogger;exports[_0x283d('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3b09550..a1f2ad1 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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x1967,0x173));var _0x7196=function(_0x5b82c2,_0x186443){_0x5b82c2=_0x5b82c2-0x0;var _0x420948=_0x1967[_0x5b82c2];return _0x420948;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x142b63,_0x45f298){_0x142b63=_0x142b63-0x0;var _0x2565e4=_0x7a54[_0x142b63];return _0x2565e4;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 6900eed..3f85716 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 _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x9974f1,_0xcb4a90){var _0x159360=function(_0x455c09){while(--_0x455c09){_0x9974f1['push'](_0x9974f1['shift']());}};_0x159360(++_0xcb4a90);}(_0xe511,0x16f));var _0x1e51=function(_0x22a7c5,_0x5e21dd){_0x22a7c5=_0x22a7c5-0x0;var _0x694018=_0xe511[_0x22a7c5];return _0x694018;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate; \ No newline at end of file +var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x1d246a,_0x49be62){var _0x4f233b=function(_0x43ca54){while(--_0x43ca54){_0x1d246a['push'](_0x1d246a['shift']());}};_0x4f233b(++_0x49be62);}(_0x1a85,0x178));var _0x51a8=function(_0x17479d,_0x593129){_0x17479d=_0x17479d-0x0;var _0x2d461c=_0x1a85[_0x17479d];return _0x2d461c;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 82287f6..b354236 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 _0xd382=['Updating\x20app.json','exports','path','../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','motion2','env','NODE_PATH','string','pathExists','then','readJSON','info'];(function(_0x3851a3,_0x2b22de){var _0x200dd0=function(_0x1c8735){while(--_0x1c8735){_0x3851a3['push'](_0x3851a3['shift']());}};_0x200dd0(++_0x2b22de);}(_0xd382,0x6e));var _0x2d38=function(_0x51b0be,_0x1dd85d){_0x51b0be=_0x51b0be-0x0;var _0xe393e8=_0xd382[_0x51b0be];return _0xe393e8;};var fs=require('fs-extra');var path=require(_0x2d38('0x0'));var config=require(_0x2d38('0x1'));var root=config[_0x2d38('0x2')];var APP_JSON_PATH=path[_0x2d38('0x3')](root,_0x2d38('0x4'));var NODEPATH=path[_0x2d38('0x3')](root,_0x2d38('0x5'));function setLegacyLibsNodeEnvPath(_0x4f7114){let _0x2704fc=![];if(Array['isArray'](_0x4f7114[_0x2d38('0x6')])){var _0x19d5d2=_0x4f7114[_0x2d38('0x6')][_0x2d38('0x7')](function(_0x1fd83e){return _0x1fd83e['name']===_0x2d38('0x8');});if(_0x19d5d2>-0x1){var _0x347aab=_0x4f7114[_0x2d38('0x6')][_0x19d5d2];if(typeof _0x347aab[_0x2d38('0x9')][_0x2d38('0xa')]!==_0x2d38('0xb')){_0x347aab['env'][_0x2d38('0xa')]=NODEPATH;_0x2704fc=!![];}}return{'appConfig':_0x4f7114,'updated':_0x2704fc};}}function updateAppConfig(_0x88c9d6){return fs[_0x2d38('0xc')](APP_JSON_PATH)[_0x2d38('0xd')](function(_0x3a5823){if(_0x3a5823){return fs[_0x2d38('0xe')](APP_JSON_PATH)[_0x2d38('0xd')](function(_0xc9226){var _0x2d7785=setLegacyLibsNodeEnvPath(_0xc9226);if(_0x2d7785['updated']){_0x88c9d6[_0x2d38('0xf')](_0x2d38('0x10'));return fs['writeJSON'](APP_JSON_PATH,_0xc9226,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x2d38('0x3')]();}});}module[_0x2d38('0x11')]=updateAppConfig; \ No newline at end of file +var _0x233d=['fs-extra','../config/environment','root','server/app.json','resolve','legacy-libs','isArray','apps','name','motion2','env','NODE_PATH','pathExists','then','readJSON','Updating\x20app.json','exports'];(function(_0xff9f18,_0xdaf065){var _0x575351=function(_0x52bc2f){while(--_0x52bc2f){_0xff9f18['push'](_0xff9f18['shift']());}};_0x575351(++_0xdaf065);}(_0x233d,0xaa));var _0xd233=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0x233d[_0x34c063];return _0x2c63a3;};var fs=require(_0xd233('0x0'));var path=require('path');var config=require(_0xd233('0x1'));var root=config[_0xd233('0x2')];var APP_JSON_PATH=path['resolve'](root,_0xd233('0x3'));var NODEPATH=path[_0xd233('0x4')](root,_0xd233('0x5'));function setLegacyLibsNodeEnvPath(_0x38a5d3){let _0x2da8f4=![];if(Array[_0xd233('0x6')](_0x38a5d3[_0xd233('0x7')])){var _0x24d49b=_0x38a5d3[_0xd233('0x7')]['findIndex'](function(_0x2d2664){return _0x2d2664[_0xd233('0x8')]===_0xd233('0x9');});if(_0x24d49b>-0x1){var _0x4f45f0=_0x38a5d3[_0xd233('0x7')][_0x24d49b];if(typeof _0x4f45f0[_0xd233('0xa')][_0xd233('0xb')]!=='string'){_0x4f45f0[_0xd233('0xa')][_0xd233('0xb')]=NODEPATH;_0x2da8f4=!![];}}return{'appConfig':_0x38a5d3,'updated':_0x2da8f4};}}function updateAppConfig(_0x25d766){return fs[_0xd233('0xc')](APP_JSON_PATH)[_0xd233('0xd')](function(_0x52a41e){if(_0x52a41e){return fs[_0xd233('0xe')](APP_JSON_PATH)['then'](function(_0x394e4c){var _0x9cc9f6=setLegacyLibsNodeEnvPath(_0x394e4c);if(_0x9cc9f6['updated']){_0x25d766['info'](_0xd233('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x394e4c,{'spaces':0x2});}else{return Promise[_0xd233('0x4')]();}});}else{return Promise[_0xd233('0x4')]();}});}module[_0xd233('0x10')]=updateAppConfig; \ No newline at end of file -- 1.7.1